diff --git a/frontend/README.md b/frontend/README.md index 9a9467625..fa591101c 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -945,3 +945,23 @@ it natively. Each component lives in its own self-registering directory under view, so a catalog/renderer mismatch never breaks the page. To add a component, drop a folder there (frontend) and declare it in the agent's catalog (backend — see `veadk.a2ui.BaseA2UICatalog`). + +### 历史沙箱后台恢复 + +智能体列表及新会话选择器只展示已就绪的存活沙箱。启用 +`autoResumeSnapshots=true` 的列表请求会在后台启动快照恢复,不等待恢复完成; +响应中的可选字段 `restoringSnapshots: true` 表示仍有任务。页面仅在有任务时,等每次 +请求完成后再过 3 秒刷新,保留已有列表,并显示“部分历史智能体正在恢复,恢复后将自动显示。”。 +恢复完成后通过 Session Metadata 展示正常卡片,不展示恢复中的快照卡片。 + +恢复仍沿用管理员权限范围,并使用配置的快照 Tool 查询历史快照。显式 +`autoResumeSnapshots=false` 保留只查询 Session 和快照的接口行为。 +后台任务在服务关闭时取消,同一服务内最多并发恢复 3 个快照,同一会话不会重复启动。 +失败后分别冷却 5 分钟、30 分钟,后续列表请求可触发重试;累计失败 3 次后停止自动尝试。 +失败详情仅记后端日志,冷却中的项目不保持页面轮询或恢复提示。 +仍存在的最新可恢复快照累计失败 3 次后,管理员列表响应返回 +`snapshotRecoveryPaused: true`,底部显示“部分历史智能体多次恢复失败,已暂停自动恢复。”。 +暂停提示可与恢复中提示同时显示,所有恢复任务结束后仍保留,但不会触发持续轮询。 +快照已消失、已有存活会话或被新快照替代时,下次列表查询会清除对应的暂停提示。 +去重、成功记录和失败次数均为进程内状态,服务重启后重置,多副本之间不共享; +需要跨副本或跨重启保证时,应改用共享持久化任务状态。 diff --git a/frontend/src/adk/sandbox.ts b/frontend/src/adk/sandbox.ts index b635f00a5..58a412ec2 100644 --- a/frontend/src/adk/sandbox.ts +++ b/frontend/src/adk/sandbox.ts @@ -226,6 +226,7 @@ export interface SandboxRequestOptions { export interface SandboxListOptions extends SandboxRequestOptions { autoResumeSnapshots?: boolean; + onRecoveryStatus?: (restoring: boolean, paused: boolean) => void; } export interface SandboxStartOptions extends SandboxRequestOptions { @@ -496,6 +497,8 @@ interface SessionResponse { } interface ListSessionsResponse { + restoringSnapshots?: boolean; + snapshotRecoveryPaused?: boolean; sessions?: SessionResponse[]; snapshots?: SnapshotResponse[]; } @@ -697,8 +700,8 @@ function parseSnapshot( } function sandboxListUrl(base: string, options?: SandboxListOptions): string { - if (!options?.autoResumeSnapshots) return base; - const params = new URLSearchParams({ autoResumeSnapshots: "true" }); + if (options?.autoResumeSnapshots === undefined) return base; + const params = new URLSearchParams({ autoResumeSnapshots: String(options.autoResumeSnapshots) }); return `${base}?${params.toString()}`; } @@ -1217,6 +1220,7 @@ function createSandboxClient( if (data.snapshots !== undefined && !Array.isArray(data.snapshots)) { throw new Error(adkT("sandbox.invalidSnapshotList")); } + options.onRecoveryStatus?.(data.restoringSnapshots === true, data.snapshotRecoveryPaused === true); return [ ...data.sessions.map((session) => parseSession(session)), ...(data.snapshots ?? []).map((snapshot) => parseSnapshot(snapshot)), @@ -1273,6 +1277,7 @@ function createSandboxClient( if (data.snapshots !== undefined && !Array.isArray(data.snapshots)) { throw new Error(adkT("sandbox.invalidKindSnapshotList", { kind })); } + options.onRecoveryStatus?.(data.restoringSnapshots === true, data.snapshotRecoveryPaused === true); return [ ...data.sessions.map((session) => parseSession(session, kind)), ...(data.snapshots ?? []).map((snapshot) => parseSnapshot(snapshot, kind)), diff --git a/frontend/src/i18n/resources/en-US/newChat.json b/frontend/src/i18n/resources/en-US/newChat.json index 122213cfc..181efdb75 100644 --- a/frontend/src/i18n/resources/en-US/newChat.json +++ b/frontend/src/i18n/resources/en-US/newChat.json @@ -49,6 +49,8 @@ "unavailable": "Unavailable" }, "agentPicker": { + "recoveryPaused": "Some historical agents could not be restored after multiple attempts. Automatic recovery is paused.", + "restoringHistory": "Some historical agents are being restored and will appear automatically.", "select": "Select Agent", "typesLabel": "Agent types", "listLabel": "{{type}} list", diff --git a/frontend/src/i18n/resources/en-US/ui.json b/frontend/src/i18n/resources/en-US/ui.json index 10dcbee2b..235275643 100644 --- a/frontend/src/i18n/resources/en-US/ui.json +++ b/frontend/src/i18n/resources/en-US/ui.json @@ -1318,6 +1318,8 @@ } }, "myAgents": { + "recoveryPaused": "Some historical agents could not be restored after multiple attempts. Automatic recovery is paused.", + "restoringHistory": "Some historical agents are being restored and will appear automatically.", "agent": "Agents", "agentTypes": { "general": "General Agents", diff --git a/frontend/src/i18n/resources/zh-CN/newChat.json b/frontend/src/i18n/resources/zh-CN/newChat.json index 5693ae261..03734c95f 100644 --- a/frontend/src/i18n/resources/zh-CN/newChat.json +++ b/frontend/src/i18n/resources/zh-CN/newChat.json @@ -49,6 +49,8 @@ "unavailable": "暂不可用" }, "agentPicker": { + "recoveryPaused": "部分历史智能体多次恢复失败,已暂停自动恢复。", + "restoringHistory": "部分历史智能体正在恢复,恢复后将自动显示。", "select": "选择智能体", "typesLabel": "智能体类型", "listLabel": "{{type}}列表", diff --git a/frontend/src/i18n/resources/zh-CN/ui.json b/frontend/src/i18n/resources/zh-CN/ui.json index fe5d03f78..c9d4e8757 100644 --- a/frontend/src/i18n/resources/zh-CN/ui.json +++ b/frontend/src/i18n/resources/zh-CN/ui.json @@ -1318,6 +1318,8 @@ } }, "myAgents": { + "recoveryPaused": "部分历史智能体多次恢复失败,已暂停自动恢复。", + "restoringHistory": "部分历史智能体正在恢复,恢复后将自动显示。", "agent": "智能体", "agentTypes": { "general": "通用智能体", diff --git a/frontend/src/ui/MyAgents.css b/frontend/src/ui/MyAgents.css index 682017d03..b2e59546f 100644 --- a/frontend/src/ui/MyAgents.css +++ b/frontend/src/ui/MyAgents.css @@ -374,3 +374,8 @@ } } + +.my-agent-recovery-notice { + flex-direction: column; + gap: 4px; +} diff --git a/frontend/src/ui/MyAgents.tsx b/frontend/src/ui/MyAgents.tsx index 47035bac1..a8c394ab9 100644 --- a/frontend/src/ui/MyAgents.tsx +++ b/frontend/src/ui/MyAgents.tsx @@ -669,6 +669,9 @@ export function MyAgents({ const [sandboxAgents, setSandboxAgents] = useState([]); const [loadingSandboxAgents, setLoadingSandboxAgents] = useState(false); const [sandboxError, setSandboxError] = useState(""); + const [restoringSandboxType, setRestoringSandboxType] = useState(null); + const [pausedSandboxType, setPausedSandboxType] = useState(null); + const [sandboxPollVersion, setSandboxPollVersion] = useState(0); const [connectingAgentId, setConnectingAgentId] = useState(""); const [runtimeCompatibility, setRuntimeCompatibility] = useState< Record @@ -890,29 +893,39 @@ export function MyAgents({ runtimeCompatibilityAbortRef.current.clear(); }, []); - const fetchSandboxAgents = useCallback(async (type: Exclude) => { + const fetchSandboxAgents = useCallback(async (type: Exclude, background = false) => { sandboxAbortRef.current?.abort(); const controller = new AbortController(); sandboxAbortRef.current = controller; const requestId = ++sandboxRequestRef.current; - setLoadingSandboxAgents(true); + if (!background) setLoadingSandboxAgents(true); setSandboxError(""); - setSandboxAgents([]); + let restoring = false; + let paused = false; + const onRecoveryStatus = (isRestoring: boolean, isPaused: boolean) => { + restoring = isRestoring; + paused = isPaused; + }; try { const sessions = type === "codex" ? await sandboxClient.listSessions({ signal: controller.signal, autoResumeSnapshots: true, + onRecoveryStatus, }) : await sandboxClient.listAgentSessions(type, { signal: controller.signal, autoResumeSnapshots: true, + onRecoveryStatus, }); if (sandboxRequestRef.current !== requestId) return; + setRestoringSandboxType(restoring ? type : null); + setPausedSandboxType(paused ? type : null); setSandboxAgents(sessions.map((session) => sandboxToAgent(session, t))); } catch (cause) { if ((cause as Error)?.name === "AbortError") return; if (sandboxRequestRef.current !== requestId) return; + setRestoringSandboxType(null); setSandboxError(formatRequestError( cause, t("myAgents.loadAgentType", { type: t(`myAgents.agentTypes.${type}`) }), @@ -922,12 +935,21 @@ export function MyAgents({ if (sandboxAbortRef.current === controller) sandboxAbortRef.current = null; if (sandboxRequestRef.current === requestId) { setLoadingSandboxAgents(false); + setSandboxPollVersion((value) => value + 1); } } }, [t]); + useEffect(() => { + if (activeType === "general" || restoringSandboxType !== activeType) return; + const timer = window.setTimeout(() => void fetchSandboxAgents(activeType, true), 3000); + return () => window.clearTimeout(timer); + }, [activeType, restoringSandboxType, sandboxPollVersion, fetchSandboxAgents]); + function selectAgentType(type: AgentType) { if (type === activeType) return; + setRestoringSandboxType(null); + setPausedSandboxType(null); if (type === "general") { runtimeRequestRef.current += 1; setRuntimeAgents([]); @@ -1345,6 +1367,12 @@ export function MyAgents({ )} )} + {activeType !== "general" && (restoringSandboxType === activeType || pausedSandboxType === activeType) ? ( +
+ {restoringSandboxType === activeType ? {t("myAgents.restoringHistory")} : null} + {pausedSandboxType === activeType ? {t("myAgents.recoveryPaused")} : null} +
+ ) : null} {draftToDelete ? ( (null); + const [pausedSandboxType, setPausedSandboxType] = useState(null); + const [sandboxPollVersion, setSandboxPollVersion] = useState(0); const [connectingRuntimeId, setConnectingRuntimeId] = useState(""); const rootRef = useRef(null); const triggerRef = useRef(null); @@ -141,6 +144,12 @@ export function NewChatAgentPicker({ window.clearTimeout(hoverCloseTimerRef.current); hoverCloseTimerRef.current = null; } + requestIdRef.current += 1; + sandboxAbortRef.current?.abort(); + setLoadedSandboxType(null); + setRestoringSandboxType(null); + setPausedSandboxType(null); + setLoading(false); setOpen(false); setActiveType(null); setKeyboardPanel("types"); @@ -188,31 +197,47 @@ export function NewChatAgentPicker({ const loadSandboxSessions = useCallback(async ( type: Exclude, + background = false, ) => { sandboxAbortRef.current?.abort(); const controller = new AbortController(); sandboxAbortRef.current = controller; const requestId = ++requestIdRef.current; - setLoading(true); + if (!background) { + setLoading(true); + setSandboxSessions([]); + setRestoringSandboxType(null); + setPausedSandboxType(null); + } setError(""); - setSandboxSessions([]); + let restoring = false; + let paused = false; + const onRecoveryStatus = (isRestoring: boolean, isPaused: boolean) => { + restoring = isRestoring; + paused = isPaused; + }; try { const sessions = type === "codex" ? await sandboxClient.listSessions({ signal: controller.signal, autoResumeSnapshots: true, + onRecoveryStatus, }) : await sandboxClient.listAgentSessions(type, { signal: controller.signal, autoResumeSnapshots: true, + onRecoveryStatus, }); if (requestIdRef.current !== requestId) return; setSandboxSessions(sessions); + setRestoringSandboxType(restoring ? type : null); + setPausedSandboxType(paused ? type : null); setLoadedSandboxType(type); - setActiveRuntimeIndex(0); + if (!background) setActiveRuntimeIndex(0); } catch (cause) { if ((cause as Error)?.name === "AbortError") return; if (requestIdRef.current !== requestId) return; + setRestoringSandboxType(null); const typeKey = AGENT_TYPES.find((item) => item.id === type)?.labelKey; setError(formatRequestError( cause, @@ -222,10 +247,19 @@ export function NewChatAgentPicker({ setLoadedSandboxType(type); } finally { if (sandboxAbortRef.current === controller) sandboxAbortRef.current = null; - if (requestIdRef.current === requestId) setLoading(false); + if (requestIdRef.current === requestId) { + setLoading(false); + setSandboxPollVersion((value) => value + 1); + } } }, [t]); + useEffect(() => { + if (!open || !activeType || activeType === "general" || restoringSandboxType !== activeType) return; + const timer = window.setTimeout(() => void loadSandboxSessions(activeType, true), 3000); + return () => window.clearTimeout(timer); + }, [open, activeType, restoringSandboxType, sandboxPollVersion, loadSandboxSessions]); + useEffect(() => { if (agentsSource === "local" || !open || activeType !== "general" || runtimes.length > 0 || loading || error) return; void loadRuntimes("", true); @@ -649,6 +683,12 @@ export function NewChatAgentPicker({ ) : null} )} + {activeType !== "general" && (restoringSandboxType === activeType || pausedSandboxType === activeType) ? ( +
+ {restoringSandboxType === activeType ?
{t("agentPicker.restoringHistory")}
: null} + {pausedSandboxType === activeType ?
{t("agentPicker.recoveryPaused")}
: null} +
+ ) : null} ) : null} diff --git a/frontend/src/ui/new-chat-modes/new-chat-agent-picker.css b/frontend/src/ui/new-chat-modes/new-chat-agent-picker.css index 06934a8f1..4cdf34c39 100644 --- a/frontend/src/ui/new-chat-modes/new-chat-agent-picker.css +++ b/frontend/src/ui/new-chat-modes/new-chat-agent-picker.css @@ -222,3 +222,10 @@ .new-chat-agent-picker__trigger-chevron { transition: none; } .new-chat-agent-picker__spinner { animation: none; } } + +.new-chat-agent-picker__recovery-hint { + padding: 8px; + color: hsl(var(--muted-foreground)); + font-size: 12px; + line-height: 1.5; +} diff --git a/frontend/tests/myAgents.test.mjs b/frontend/tests/myAgents.test.mjs index 9897831f4..a81bb1b87 100644 --- a/frontend/tests/myAgents.test.mjs +++ b/frontend/tests/myAgents.test.mjs @@ -183,7 +183,7 @@ test("clears stale sandbox cards as soon as the Agent type changes", () => { ); assert.match( pageSource, - /const fetchSandboxAgents[\s\S]*?setLoadingSandboxAgents\(true\)[\s\S]*?setSandboxAgents\(\[\]\)[\s\S]*?await sandboxClient/, + /const fetchSandboxAgents[\s\S]*?if \(!background\) setLoadingSandboxAgents\(true\)[\s\S]*?await sandboxClient/, ); assert.match( pageSource, @@ -825,3 +825,14 @@ test("authenticated users land on a new chat without a selected Agent", () => { ); assert.doesNotMatch(appSource, /defaultViewAppliedRef/); }); + +test("refreshes background restores without clearing cards and stops polling on navigation", () => { + const fetchBody = pageSource.slice(pageSource.indexOf("const fetchSandboxAgents"), pageSource.indexOf("function selectAgentType")); + assert.doesNotMatch(fetchBody, /setSandboxAgents\(\[\]\)/); + assert.match(fetchBody, /sandboxRequestRef\.current !== requestId/); + assert.match(fetchBody, /setRestoringSandboxType\(restoring \? type : null\)/); + assert.match(fetchBody, /restoringSandboxType !== activeType/); + assert.match(fetchBody, /fetchSandboxAgents\(activeType, true\)/); + assert.match(fetchBody, /clearTimeout\(timer\)/); + assert.match(pageSource, /role="status">[\s\S]*?\{t\("myAgents.restoringHistory"\)\}/); +}); diff --git a/frontend/tests/newChatAgentPicker.test.mjs b/frontend/tests/newChatAgentPicker.test.mjs index 80eb90203..17e5d965b 100644 --- a/frontend/tests/newChatAgentPicker.test.mjs +++ b/frontend/tests/newChatAgentPicker.test.mjs @@ -205,3 +205,12 @@ test("shows request context and backend detail for every picker error", () => { assert.match(pickerSource, /t\("agentPicker\.openType", \{ type: activeTypeLabel \}\)/); assert.match(pickerStyles, /\.new-chat-agent-picker__error > span,[\s\S]*?white-space: pre-wrap/); }); + +test("polls background restores only while their picker panel is open", () => { + assert.match(pickerSource, /if \(!open \|\| !activeType \|\| activeType === "general" \|\| restoringSandboxType !== activeType\) return/); + assert.match(pickerSource, /loadSandboxSessions\(activeType, true\)/); + assert.match(pickerSource, /clearTimeout\(timer\)/); + assert.match(pickerSource, /if \(!background\) \{\s*setLoading\(true\);\s*setSandboxSessions\(\[\]\)/); + assert.match(pickerSource, /if \(!background\) setActiveRuntimeIndex\(0\)/); + assert.match(pickerSource, /role="status">[\s\S]*?\{t\("agentPicker.restoringHistory"\)\}/); +}); diff --git a/frontend/tests/sandboxThreadsClient.test.mjs b/frontend/tests/sandboxThreadsClient.test.mjs index 61bcaba4b..9225621f9 100644 --- a/frontend/tests/sandboxThreadsClient.test.mjs +++ b/frontend/tests/sandboxThreadsClient.test.mjs @@ -348,3 +348,47 @@ test("requests snapshot auto-resume when listing sandbox agents", async (t) => { }, ]); }); + +test("reports background recovery status without waiting and preserves explicit false", async (t) => { + const previousFetch = globalThis.fetch; + t.after(() => { globalThis.fetch = previousFetch; }); + const requests = []; + const statuses = []; + globalThis.fetch = async (url) => { + requests.push(url); + return new Response(JSON.stringify({ + sessions: [], + ...(requests.length === 1 ? { restoringSnapshots: true } : {}), + }), { status: 200, headers: { "Content-Type": "application/json" } }); + }; + assert.deepEqual(await sandboxClient.listAgentSessions("hermes", { + autoResumeSnapshots: true, onRecoveryStatus: (value) => statuses.push(value), + }), []); + assert.deepEqual(await sandboxClient.listSessions({ + autoResumeSnapshots: false, onRecoveryStatus: (value) => statuses.push(value), + }), []); + assert.deepEqual(statuses, [true, false]); + assert.deepEqual(requests, [ + "/web/hermes/sessions?autoResumeSnapshots=true", + "/web/sandbox/sessions?autoResumeSnapshots=false", + ]); +}); + +test("reports paused recovery independently of running tasks and resets absent flags", async (t) => { + const previousFetch = globalThis.fetch; + t.after(() => { globalThis.fetch = previousFetch; }); + const responses = [ + { sessions: [], restoringSnapshots: true, snapshotRecoveryPaused: true }, + { sessions: [], snapshotRecoveryPaused: true }, + { sessions: [] }, + ]; + globalThis.fetch = async () => new Response(JSON.stringify(responses.shift()), { + status: 200, headers: { "Content-Type": "application/json" }, + }); + const states = []; + const options = { onRecoveryStatus: (running, paused) => states.push([running, paused]) }; + await sandboxClient.listAgentSessions("hermes", options); + await sandboxClient.listSessions(options); + await sandboxClient.listAgentSessions("hermes", options); + assert.deepEqual(states, [[true, true], [false, true], [false, false]]); +}); diff --git a/frontend/tests/snapshotRecoveryPicker.test.mjs b/frontend/tests/snapshotRecoveryPicker.test.mjs new file mode 100644 index 000000000..a1b63db0e --- /dev/null +++ b/frontend/tests/snapshotRecoveryPicker.test.mjs @@ -0,0 +1,102 @@ +import assert from "node:assert/strict"; +import { createRequire } from "node:module"; +import { fileURLToPath } from "node:url"; +import test from "node:test"; +import { build } from "esbuild"; +import { JSDOM } from "jsdom"; + +const require = createRequire(import.meta.url); +const React = require("react"); +const { act } = React; +const result = await build({ + entryPoints: [fileURLToPath(new URL("../src/ui/new-chat-modes/NewChatAgentPicker.tsx", import.meta.url))], + bundle: true, format: "cjs", platform: "node", write: false, + external: ["react", "react-dom", "react-dom/*"], + plugins: [{ name: "recovery-test", setup(b) { + const mocks = { + "react-i18next": 'const t = key => key; export const useTranslation = () => ({ t });', + "../../adk/client": 'export const getRuntimes = async () => ({ runtimes: [], nextToken: "" });', + "../../adk/sandbox": 'export const sandboxClient = { listAgentSessions: (...args) => globalThis.recoveryApi(...args) }; export const sandboxStatusLabel = value => value;', + "../../adk/requestError": 'export const formatRequestError = error => error.message;', + "@openai/apps-sdk-ui/components/EmptyMessage": 'import React from "react"; const Part = ({children}) => React.createElement("div", null, children); export const EmptyMessage = Object.assign(Part, {Icon: Part, Title: Part, Description: Part});', + }; + b.onResolve({ filter: /.*/ }, args => args.path in mocks ? { path: args.path, namespace: "recovery-mock" } : undefined); + b.onLoad({ filter: /.*/, namespace: "recovery-mock" }, args => ({ contents: mocks[args.path], loader: "js" })); + b.onLoad({ filter: /\.css$/ }, () => ({ contents: "", loader: "js" })); + }}], +}); +const module = { exports: {} }; +Function("require", "module", "exports", result.outputFiles[0].text)(require, module, module.exports); + +test("keeps agents usable, shows paused recovery without polling, and cancels timers on close", async () => { + const dom = new JSDOM('
', { pretendToBeVisual: true }); + const values = { + window: dom.window, document: dom.window.document, navigator: dom.window.navigator, + HTMLElement: dom.window.HTMLElement, Node: dom.window.Node, + requestAnimationFrame: dom.window.requestAnimationFrame.bind(dom.window), + IS_REACT_ACT_ENVIRONMENT: true, + }; + const previous = Object.fromEntries([...Object.keys(values), "recoveryApi"].map(key => [key, Object.getOwnPropertyDescriptor(globalThis, key)])); + for (const [key, value] of Object.entries(values)) Object.defineProperty(globalThis, key, { configurable: true, writable: true, value }); + let timerId = 1000; + const timers = new Map(); + const originalSetTimeout = dom.window.setTimeout.bind(dom.window); + const originalClearTimeout = dom.window.clearTimeout.bind(dom.window); + dom.window.setTimeout = (callback, delay, ...args) => { + if (delay !== 3000) return originalSetTimeout(callback, delay, ...args); + timers.set(++timerId, callback); + return timerId; + }; + dom.window.clearTimeout = id => { timers.delete(id); originalClearTimeout(id); }; + const live = { id: "live", resourceType: "session", status: "Ready", displayName: "Live Hermes" }; + let finishRefresh; + let calls = 0; + globalThis.recoveryApi = async (kind, options) => { + assert.equal(kind, "hermes"); + calls++; + if (calls === 2) await new Promise(resolve => { finishRefresh = resolve; }); + options.onRecoveryStatus(calls !== 2, calls <= 2); + return calls === 2 ? [live, { ...live, id: "restored", displayName: "Restored Hermes" }] : [live]; + }; + const { createRoot } = require("react-dom/client"); + const root = createRoot(dom.window.document.getElementById("root")); + const doc = dom.window.document; + const openHermes = async () => { + await act(async () => doc.querySelector(".new-chat-agent-picker__trigger").click()); + await act(async () => [...doc.querySelectorAll('[role="menuitem"]')].find(el => el.textContent.includes("types.hermes")).click()); + }; + try { + await act(async () => root.render(React.createElement(module.exports.NewChatAgentPicker, { + runtimeScope: "all", onSelectRuntime: async () => {}, onSelectSandboxSession: async () => {}, + }))); + await openHermes(); + assert.equal(doc.querySelectorAll('[role="option"]').length, 1); + assert.equal(doc.querySelector('[role="option"]').disabled, false); + assert.match(doc.querySelector('[role="status"]').textContent, /restoringHistory/); + assert.match(doc.querySelector('[role="status"]').textContent, /recoveryPaused/); + assert.equal(timers.size, 1); + const [id, callback] = timers.entries().next().value; + timers.delete(id); + await act(async () => callback()); + assert.equal(doc.querySelectorAll('[role="option"]').length, 1); + assert.equal(timers.size, 0); + await act(async () => finishRefresh()); + assert.equal(doc.querySelectorAll('[role="option"]').length, 2); + assert.match(doc.querySelector('[role="status"]').textContent, /recoveryPaused/); + assert.doesNotMatch(doc.querySelector('[role="status"]').textContent, /restoringHistory/); + assert.equal(doc.querySelector('[role="status"] button'), null); + assert.equal(timers.size, 0); + await act(async () => doc.querySelector(".new-chat-agent-picker__trigger").click()); + await openHermes(); + assert.equal(timers.size, 1); + await act(async () => doc.querySelector(".new-chat-agent-picker__trigger").click()); + assert.equal(timers.size, 0); + assert.equal(calls, 3); + } finally { + await act(async () => root.unmount()); + dom.window.close(); + for (const [key, descriptor] of Object.entries(previous)) { + if (descriptor) Object.defineProperty(globalThis, key, descriptor); else delete globalThis[key]; + } + } +}); diff --git a/tests/cli/test_frontend_sandbox.py b/tests/cli/test_frontend_sandbox.py index 189bee32a..ca6c600d4 100644 --- a/tests/cli/test_frontend_sandbox.py +++ b/tests/cli/test_frontend_sandbox.py @@ -25,6 +25,7 @@ from dataclasses import replace from hashlib import sha256 from types import SimpleNamespace +from typing import cast import pytest from fastapi import FastAPI, HTTPException, Request @@ -55,6 +56,7 @@ AgentkitSandboxGateway, SandboxAgentSessionService, SandboxCloudSession, + SandboxCloudGateway, SandboxCloudSnapshot, SandboxConfigurationError, SandboxConversationService, @@ -1550,6 +1552,15 @@ def test_managed_agent_admin_listing_auto_resumes_current_kind_snapshots() -> No headers={"X-Test-User": "admin", "X-Test-Role": "admin"}, ) + assert admin.json()["restoringSnapshots"] is True + assert "resumed-snapshot-openclaw" not in { + item["sessionId"] for item in admin.json()["sessions"] + } + admin = client.get( + "/web/openclaw/sessions", + headers={"X-Test-User": "admin", "X-Test-Role": "admin"}, + ) + assert ordinary.status_code == 200 assert "snapshots" not in ordinary.json() assert "resumed-snapshot-openclaw" in { @@ -2690,6 +2701,15 @@ def test_sandbox_admin_listing_auto_resumes_snapshots() -> None: headers={"X-Test-User": "admin", "X-Test-Role": "admin"}, ) + assert admin.json()["restoringSnapshots"] is True + assert "resumed-snapshot-alice" not in { + item["sessionId"] for item in admin.json()["sessions"] + } + admin = client.get( + "/web/sandbox/sessions", + headers={"X-Test-User": "admin", "X-Test-Role": "admin"}, + ) + assert ordinary.status_code == 200 assert "snapshots" not in ordinary.json() assert "resumed-snapshot-alice" in { @@ -3793,3 +3813,220 @@ def delete_session(self, request: object) -> None: assert len(created) == 1 assert created[0].tool_id == "tool-1" assert created[0].envs is None + + +@pytest.mark.asyncio +@pytest.mark.parametrize("kind", ["codex", "hermes"]) +async def test_snapshot_listing_does_not_wait_for_background_resume(kind: str) -> None: + started = asyncio.Event() + release = asyncio.Event() + calls = 0 + + class SlowGateway(_FakeGateway): + async def resume_snapshot( + self, snapshot: SandboxCloudSnapshot + ) -> SandboxCloudSession: + nonlocal calls + calls += 1 + started.set() + await release.wait() + return await super().resume_snapshot(snapshot) + + gateway = SlowGateway() + gateway.snapshots["old"] = SandboxCloudSnapshot( + tool_id="persistent", + snapshot_id="old", + session_id="expired", + user_session_id="user-old", + status="Ready", + ) + service = ( + SandboxConversationService( + cast(SandboxCloudGateway, gateway), + tool_id="transient", + snapshot_tool_id="persistent", + ) + if kind == "codex" + else SandboxAgentSessionService( + cast(SandboxCloudGateway, gateway), + kind=kind, + tool_id="transient", + snapshot_tool_id="persistent", + ) + ) + try: + sessions, snapshots = await asyncio.wait_for( + service.list_resources("admin", is_admin=True, auto_resume_snapshots=True), + timeout=0.5, + ) + assert sessions == snapshots == [] + assert service.snapshot_recovery.running + await started.wait() + gateway.sessions["starting"] = SandboxCloudSession( + tool_id="persistent", + instance_id="starting", + user_session_id="user-old", + endpoint="https://starting.example", + status="Starting", + ) + visible, hidden = await service.list_resources( + "admin", is_admin=True, auto_resume_snapshots=True + ) + assert visible == hidden == [] + assert calls == 1 + release.set() + await asyncio.gather(*service.snapshot_recovery.tasks.values()) + sessions, snapshots = await service.list_resources( + "admin", is_admin=True, auto_resume_snapshots=True + ) + assert [session.instance_id for session in sessions] == ["resumed-old"] + assert snapshots == [] + assert not service.snapshot_recovery.running + finally: + release.set() + await service.snapshot_recovery.close() + + +@pytest.mark.asyncio +async def test_failed_snapshot_recovery_is_cooled_down_and_capped(monkeypatch) -> None: + now = 0.0 + monkeypatch.setattr(frontend_sandbox.time, "monotonic", lambda: now) + recovery = frontend_sandbox.SandboxSnapshotRecovery() + snapshot = SandboxCloudSnapshot( + tool_id="tool", + snapshot_id="bad", + session_id="expired", + user_session_id="user", + status="Ready", + ) + calls = 0 + + async def fail(snapshot: SandboxCloudSnapshot) -> SandboxCloudSession: + nonlocal calls + calls += 1 + raise SandboxProvisioningError("not restorable") + + for attempt in range(3): + recovery.schedule([snapshot], fail) + await asyncio.gather(*recovery.tasks.values()) + assert calls == attempt + 1 + assert recovery.paused is (attempt == 2) + assert not recovery.running + recovery.schedule([snapshot], fail) + assert not recovery.running + now += 3600 + recovery.schedule([snapshot], fail) + assert not recovery.running + assert calls == 3 + assert recovery.paused + # A removed or already-live snapshot must not leave a stale warning. + recovery.schedule([], fail) + assert not recovery.paused + recovery.schedule([snapshot], fail) + assert recovery.paused + await recovery.close() + + +@pytest.mark.asyncio +async def test_background_recovery_limits_concurrency_and_cleans_up() -> None: + recovery = frontend_sandbox.SandboxSnapshotRecovery() + snapshots = [ + SandboxCloudSnapshot( + tool_id="tool", + snapshot_id=str(index), + session_id=str(index), + user_session_id=str(index), + status="Ready", + created_at=str(index), + ) + for index in range(5) + ] + release = asyncio.Event() + calls: list[str] = [] + + async def resume(snapshot: SandboxCloudSnapshot) -> SandboxCloudSession: + calls.append(snapshot.snapshot_id) + await release.wait() + raise SandboxProvisioningError("cancelled before reaching this") + + recovery.schedule(snapshots, resume) + await asyncio.sleep(0) + recovery.schedule(snapshots, resume) + assert len(recovery.tasks) == 5 + assert len(calls) == 3 + await recovery.close() + assert not recovery.running + assert recovery.tasks == {} + + +@pytest.mark.asyncio +async def test_background_recovery_only_attempts_latest_snapshot_per_session() -> None: + recovery = frontend_sandbox.SandboxSnapshotRecovery() + old = SandboxCloudSnapshot( + tool_id="tool", + snapshot_id="old", + session_id="expired", + user_session_id="same-user", + status="Ready", + created_at="2026-01-01", + ) + new = replace(old, snapshot_id="new", created_at="2026-02-01") + release = asyncio.Event() + calls: list[str] = [] + + async def resume(snapshot: SandboxCloudSnapshot) -> SandboxCloudSession: + calls.append(snapshot.snapshot_id) + await release.wait() + raise SandboxProvisioningError("not restorable") + + recovery.schedule([old, new], resume) + await asyncio.sleep(0) + recovery.schedule([old], resume) + assert calls == ["new"] + release.set() + await asyncio.gather(*recovery.tasks.values()) + # A failed latest snapshot must not fall back through older snapshots. + recovery.schedule([old, new], resume) + assert not recovery.running + await recovery.close() + + +@pytest.mark.parametrize("kind", ["sandbox", "hermes"]) +def test_paused_snapshot_notice_is_admin_only_and_clears_when_removed( + monkeypatch, kind: str +) -> None: + gateway = _FakeGateway() + tool_id = "tool-studio-snapshot" if kind == "sandbox" else "tool-hermes-snapshot" + gateway.snapshots["paused"] = SandboxCloudSnapshot( + tool_id=tool_id, + snapshot_id="paused", + session_id="expired", + user_session_id="historical-user", + status="Ready", + ) + original_schedule = frontend_sandbox.SandboxSnapshotRecovery.schedule + + def previously_failed(recovery, snapshots, resume): + # Model the state left by three failed background attempts. + for snapshot in snapshots: + key = (snapshot.region, snapshot.tool_id, snapshot.snapshot_id) + recovery._failures[key] = (3, 0.0) + original_schedule(recovery, snapshots, resume) + + monkeypatch.setattr( + frontend_sandbox.SandboxSnapshotRecovery, "schedule", previously_failed + ) + app = _app(gateway) if kind == "sandbox" else _agent_app(gateway) + admin = {"X-Test-User": "admin", "X-Test-Role": "admin"} + with TestClient(app) as client: + for _ in range(2): + response = client.get(f"/web/{kind}/sessions", headers=admin) + assert response.status_code == 200 + assert response.json()["snapshotRecoveryPaused"] is True + assert "restoringSnapshots" not in response.json() + assert "snapshots" not in response.json() + ordinary = client.get(f"/web/{kind}/sessions", headers={"X-Test-User": "alice"}) + assert "snapshotRecoveryPaused" not in ordinary.json() + gateway.snapshots.clear() + refreshed = client.get(f"/web/{kind}/sessions", headers=admin) + assert "snapshotRecoveryPaused" not in refreshed.json() diff --git a/veadk/cli/frontend_sandbox.py b/veadk/cli/frontend_sandbox.py index 03492d2ba..68c469fe0 100644 --- a/veadk/cli/frontend_sandbox.py +++ b/veadk/cli/frontend_sandbox.py @@ -743,28 +743,104 @@ def _request_auto_resume_snapshots(request: Request, *, default: bool = False) - } -async def _auto_resume_snapshot_batch( - snapshots: list[SandboxCloudSnapshot], - resume: Callable[[SandboxCloudSnapshot], Awaitable[SandboxCloudSession]], -) -> None: - if not snapshots: - return - semaphore = asyncio.Semaphore(_AUTO_RESUME_SNAPSHOT_CONCURRENCY) +class SandboxSnapshotRecovery: + """Service-owned background restores, bounded and deduplicated per process. - async def _resume(snapshot: SandboxCloudSnapshot) -> None: - async with semaphore: - try: + Failure cooldowns and successful snapshot IDs last for this service's lifetime; + they are deliberately not a distributed job queue. + """ + + def __init__(self) -> None: + self.tasks: dict[tuple[str, str, str], asyncio.Task[None]] = {} + self._failures: dict[tuple[str, str, str], tuple[int, float]] = {} + self._completed: set[tuple[str, str, str]] = set() + self._candidate_keys: set[tuple[str, str, str]] = set() + self._sessions_in_progress: set[tuple[str, str, str]] = set() + self._semaphore = asyncio.Semaphore(_AUTO_RESUME_SNAPSHOT_CONCURRENCY) + + @property + def running(self) -> bool: + return any(not task.done() for task in self.tasks.values()) + + @property + def paused(self) -> bool: + return any( + self._failures.get(key, (0, 0.0))[0] >= 3 for key in self._candidate_keys + ) + + def schedule( + self, + snapshots: list[SandboxCloudSnapshot], + resume: Callable[[SandboxCloudSnapshot], Awaitable[SandboxCloudSession]], + ) -> None: + # Keep only the newest snapshot for each logical Session in this batch. + seen: set[tuple[str, str, str]] = set() + candidate_keys: set[tuple[str, str, str]] = set() + for snapshot in sorted( + snapshots, key=lambda item: item.created_at, reverse=True + ): + session_key = ( + snapshot.region, + snapshot.tool_id, + snapshot.user_session_id or snapshot.session_id or snapshot.snapshot_id, + ) + if session_key in seen: + continue + seen.add(session_key) + key = (snapshot.region, snapshot.tool_id, snapshot.snapshot_id) + candidate_keys.add(key) + failures, retry_at = self._failures.get(key, (0, 0.0)) + if ( + key in self.tasks + or session_key in self._sessions_in_progress + or key in self._completed + or failures >= 3 + or time.monotonic() < retry_at + ): + continue + self._sessions_in_progress.add(session_key) + self.tasks[key] = asyncio.create_task( + self._resume(key, session_key, snapshot, resume) + ) + self._candidate_keys = candidate_keys + + async def _resume( + self, + key: tuple[str, str, str], + session_key: tuple[str, str, str], + snapshot: SandboxCloudSnapshot, + resume: Callable[[SandboxCloudSnapshot], Awaitable[SandboxCloudSession]], + ) -> None: + try: + async with self._semaphore: await resume(snapshot) - except Exception as error: # noqa: BLE001 - logger.warning( - "Failed to auto-resume Sandbox snapshot snapshot_id=%s " - "session_id=%s error_type=%s", - snapshot.snapshot_id, - snapshot.session_id, - type(error).__name__, - ) + self._completed.add(key) + self._failures.pop(key, None) + except Exception as error: # noqa: BLE001 - background task boundary + failures = self._failures.get(key, (0, 0.0))[0] + 1 + self._failures[key] = ( + failures, + time.monotonic() + (300 if failures == 1 else 1800), + ) + logger.warning( + "Failed to auto-resume Sandbox snapshot snapshot_id=%s " + "session_id=%s attempt=%s error_type=%s", + snapshot.snapshot_id, + snapshot.session_id, + failures, + type(error).__name__, + ) + finally: + self.tasks.pop(key, None) + self._sessions_in_progress.discard(session_key) - await asyncio.gather(*(_resume(snapshot) for snapshot in snapshots)) + async def close(self) -> None: + tasks = list(self.tasks.values()) + for task in tasks: + task.cancel() + await asyncio.gather(*tasks, return_exceptions=True) + self.tasks.clear() + self._sessions_in_progress.clear() def _session_for_tools( @@ -1588,6 +1664,7 @@ def __init__( managed_tool_spec: Any | None = None, ) -> None: self._gateway = gateway + self.snapshot_recovery = SandboxSnapshotRecovery() self._configured_tool_id = (tool_id or "").strip() self._configured_snapshot_tool_id = (snapshot_tool_id or "").strip() self._agent_kind = agent_kind @@ -1712,12 +1789,15 @@ async def list_resources( self.list_snapshots(owner_id, is_admin=is_admin), ) restorable = _restorable_snapshots(sessions, snapshots) - if auto_resume_snapshots and is_admin and restorable: - await _auto_resume_snapshot_batch( - restorable, - self._resume_snapshot, - ) - return await self.list_sessions(owner_id, is_admin=is_admin), [] + if auto_resume_snapshots: + if is_admin: + self.snapshot_recovery.schedule(restorable, self._resume_snapshot) + # Restoring/expired resources stay hidden until their data plane is ready. + return [ + session + for session in sessions + if session.status.lower() in {"ready", "running"} and session.endpoint + ], [] return sessions, restorable async def _resume_snapshot( @@ -2551,6 +2631,7 @@ def __init__( if kind not in _SANDBOX_AGENT_TOOL_ENVS: raise ValueError(f"Unsupported Studio sandbox agent kind: {kind}") self._gateway = gateway + self.snapshot_recovery = SandboxSnapshotRecovery() self.kind = kind surface = (surface_path or f"/{kind}/").strip() self.surface_path = f"/{surface.strip('/')}/" @@ -2686,12 +2767,15 @@ async def list_resources( self.list_snapshots(owner_id, is_admin=is_admin), ) restorable = _restorable_snapshots(sessions, snapshots) - if auto_resume_snapshots and is_admin and restorable: - await _auto_resume_snapshot_batch( - restorable, - self._resume_snapshot, - ) - return await self.list_sessions(owner_id, is_admin=is_admin), [] + if auto_resume_snapshots: + if is_admin: + self.snapshot_recovery.schedule(restorable, self._resume_snapshot) + # Restoring/expired resources stay hidden until their data plane is ready. + return [ + session + for session in sessions + if session.status.lower() in {"ready", "running"} and session.endpoint + ], [] return sessions, restorable async def _resume_snapshot( @@ -2920,6 +3004,13 @@ def mount_sandbox_agent_routes( mount_agent_surface_proxy_routes, ) + async def _stop_snapshot_recovery() -> None: + await asyncio.gather( + *(service.snapshot_recovery.close() for service in services.values()) + ) + + app.router.on_shutdown.append(_stop_snapshot_recovery) + def _service(kind: str) -> SandboxAgentSessionService: service = services.get(kind) if service is None: @@ -2987,7 +3078,11 @@ async def _list_sandbox_agent_sessions( ) -> dict[str, object]: try: owner_id = owner_resolver(request) - sessions, snapshots = await _service(kind).list_resources( + service = _service(kind) + # A restore may finish while the cloud list is in flight. Keep polling + # for one more response so that a stale list cannot hide its result. + was_restoring = service.snapshot_recovery.running + sessions, snapshots = await service.list_resources( owner_id, is_admin=_is_admin(request), auto_resume_snapshots=_request_auto_resume_snapshots( @@ -3000,8 +3095,12 @@ async def _list_sandbox_agent_sessions( result: dict[str, object] = { "sessions": [ _public_session(session, kind, owner_id) for session in sessions - ] + ], } + if _is_admin(request) and (was_restoring or service.snapshot_recovery.running): + result["restoringSnapshots"] = True + if _is_admin(request) and service.snapshot_recovery.paused: + result["snapshotRecoveryPaused"] = True if snapshots: result["snapshots"] = [ _public_snapshot(snapshot, kind, owner_id) for snapshot in snapshots @@ -3527,6 +3626,9 @@ async def _sandbox_capabilities(request: Request) -> dict[str, object]: async def _list_sandbox_sessions(request: Request) -> dict[str, object]: try: owner_id = owner_resolver(request) + # A restore may finish while the cloud list is in flight. Keep polling + # for one more response so that a stale list cannot hide its result. + was_restoring = service.snapshot_recovery.running sessions, snapshots = await service.list_resources( owner_id, is_admin=_is_admin(request), @@ -3538,8 +3640,12 @@ async def _list_sandbox_sessions(request: Request) -> dict[str, object]: except SandboxError as error: raise _http_error(error) from error result: dict[str, object] = { - "sessions": [_public_session(session, owner_id) for session in sessions] + "sessions": [_public_session(session, owner_id) for session in sessions], } + if _is_admin(request) and (was_restoring or service.snapshot_recovery.running): + result["restoringSnapshots"] = True + if _is_admin(request) and service.snapshot_recovery.paused: + result["snapshotRecoveryPaused"] = True if snapshots: result["snapshots"] = [ _public_snapshot(snapshot, STUDIO_SANDBOX_TOOL_NAME, owner_id) @@ -4878,6 +4984,7 @@ async def _stop_cleanup() -> None: cleanup_task.cancel() with contextlib.suppress(asyncio.CancelledError): await cleanup_task + await service.snapshot_recovery.close() await service.close_all() app.router.on_startup.append(_start_cleanup) diff --git a/veadk/webui/assets/app/index-BQ3Jlms4.js b/veadk/webui/assets/app/index-BuI1sAPJ.js similarity index 85% rename from veadk/webui/assets/app/index-BQ3Jlms4.js rename to veadk/webui/assets/app/index-BuI1sAPJ.js index 6f1724567..7c036b778 100644 --- a/veadk/webui/assets/app/index-BQ3Jlms4.js +++ b/veadk/webui/assets/app/index-BuI1sAPJ.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/mermaid.core-CbFLL6RY.js","assets/chunks/purify.es-BnINGy_Y.js","assets/chunks/MarkdownPromptEditor-Bbb9CZz4.js","assets/styles/MarkdownPromptEditor-ZH9qtki0.css"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/mermaid.core-DDCDq-1V.js","assets/chunks/purify.es-BnINGy_Y.js","assets/chunks/MarkdownPromptEditor-eueDZ0dQ.js","assets/styles/MarkdownPromptEditor-ZH9qtki0.css"])))=>i.map(i=>d[i]); var jDe=Object.defineProperty;var oV=e=>{throw TypeError(e)};var RDe=(e,t,n)=>t in e?jDe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ki=(e,t,n)=>RDe(e,typeof t!="symbol"?t+"":t,n),lV=(e,t,n)=>t.has(e)||oV("Cannot "+n);var uo=(e,t,n)=>(lV(e,t,"read from private field"),n?n.call(e):t.get(e)),cV=(e,t,n)=>t.has(e)?oV("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),NP=(e,t,n,i)=>(lV(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);function IDe(e,t){for(var n=0;ni[r]})}}}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 r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();var Ip=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function px(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fie={exports:{}},vj={};/** * @license React * react-jsx-runtime.production.js @@ -20,11 +20,11 @@ Your goal is to understand the user's request accurately and provide clear, conc Guidelines: - Ask clarifying questions when information is missing. Do not invent facts. - Use available tools when appropriate and explain key conclusions. -- Maintain a polite, professional tone.`},ase={requestFailed:"Request failed ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"The server does not have cloud provider credentials configured, so AgentKit agent centers are unavailable",loginRequired:"Sign in to access AgentKit agent centers"},vikingKnowledge:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB knowledge bases are unavailable",loginRequired:"Sign in to access VikingDB knowledge bases"},vikingMemory:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB memory stores are unavailable",loginRequired:"Sign in to access VikingDB memory stores"},mcpGateway:{missingHttpTool:"Go back to Add MCP tool and add at least one HTTP MCP service. MCP resilience does not support stdio services.",missingUrl:"An HTTP MCP tool is missing a valid service URL. Go back to Add MCP tool and complete it before publishing."},customModel:{fallbackName:"Custom model",apiKeyLabel:"{{name}} model API Key"},deploymentEnv:{serverInjected:"Provided by the server",selectedApiKeyPlaceholder:"Provided by the selected API Key",mcpInjectedComment:"Provided by the added MCP tools",restoredPlaceholder:"Securely restored by the Studio server",generatedMcpPlaceholder:"Generated from the added HTTP MCP tools",restoredHelp:"When updating, the Studio server merges MCP addresses and authentication without returning existing secrets to the browser.",mergedMcpHelp:"The Studio server merges MCP addresses and optional authentication without returning existing secrets to the browser.",listSeparator:", ",requirementHint:"Required by the following optimizations: {{labels}}.",requiredBy:"Required by the following optimizations: {{labels}}. Enter {{key}}.",required:"Enter {{label}} ({{key}}).",invalidJson:"Invalid JSON format"},drafts:{unsupportedVersion:"This local draft version is not supported. Upgrade Studio and try again.",invalidFormat:"The local draft data is invalid.",readFailed:"Could not read local drafts. The browser data may be corrupted.",quotaExceeded:"Browser storage is full, so the draft was not saved. Delete unused drafts or clear this site's storage, then try again.",writeRejected:"The browser blocked saving this draft. Check the site's storage permissions and try again."},skills:{searchFailed:"Search failed ({{status}})",downloadFailed:"Skill download failed ({{status}})",agentKitRequestFailed:"AgentKit Skills request failed",missingManifest:"{{location}} is missing SKILL.md",invalidParentPath:"{{location}} contains an invalid parent path (..): {{path}}",invalidPath:"{{location}} contains an invalid path: {{path}}",localDescription:"Local skill",folderSource:"Folder",noManifest:"No SKILL.md was found in {{location}}"},zip:{invalid:"Invalid zip: EOCD was not found",tooManyFiles:"A zip file cannot contain more than {{count}} files",tooLarge:"The extracted zip content is too large"}},ose={back:"Back to development session",runtimeName:"Runtime name",runtimeNameExists:"This Runtime name already exists. Choose another name.",checkingRuntimeName:"Checking Runtime name",verifiedSource:"Verified source",deployableSource:"Deployable source",verifiedByCodex:"Verified by Codex in the cloud",entryPoint:"Entry point",files:"Files",artifact:"Artifact",validationReport:"Validation report",verifiedHint:"The server materializes source from the verified artifact. Browser files cannot replace it.",unverifiedHint:"The server securely materialized the source. Confirm the Runtime configuration before deploying.",env:{requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}"}},lse={name:"Code package",back:"Back to creation methods",reading:"Reading the code package",readingEllipsis:"Reading the code package…",uploadFirst:"Upload a code package first",uploadAriaLabel:"Code package upload",upload:"Upload code package",reupload:"Upload a different code package",uploadPrompt:"Upload a code package",filesRecognized:"{{count}} files found. Select this area to upload a different package.",dropHint:"Select or drop a .zip file up to 50 MB. Use app.py or declare an entry point in agentkit.yaml.",viewFiles:"View files",chooseFile:"Choose code package",errors:{invalidFormat:"Choose a .zip code package.",tooLarge:"The code package must be 50 MB or smaller.",invalidPath:"The archive contains an invalid path: {{name}}",empty:"The archive does not contain any deployable files.",tooManyFiles:"A code package cannot contain more than {{count}} files.",duplicateFile:"The code package contains a duplicate file: {{path}}",manifestParse:"Could not parse agentkit.yaml: {{detail}}",manifestRoot:"The root of agentkit.yaml must be an object.",manifestCommon:"common in agentkit.yaml must be an object.",entryPointType:"common.entry_point in agentkit.yaml must be a file path.",entryPointInvalid:"common.entry_point in agentkit.yaml is not a valid file path.",entryPointMissing:"The entry point declared in agentkit.yaml is missing from the code package: {{entryPoint}}",defaultEntryPointMissing:"The code package root must contain app.py, or common.entry_point in agentkit.yaml must declare an existing entry point."}},cse={label:"Agent execution canvas",readOnlyLabel:"Read-only agent execution canvas",minimapLabel:"Execution flow minimap",controls:{ariaLabel:"Execution flow controls",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Fit view"},rootAgent:"Main agent",unnamedStep:"Unnamed step",terminals:{input:"User request",output:"Final response"},edges:{then:"Then",continueLoop:"Continue loop",call:"Call"},patterns:{llm:{label:"Agent",description:"Understand a task and complete one specific job"},sequential:{label:"Sequential",description:"Run internal steps one after another"},parallel:{label:"Parallel",description:"Run internal steps together, then combine their results"},loop:{label:"Loop",description:"Repeat internal steps until the stop condition is met"},a2a:{label:"Remote agent",description:"Call an existing remote agent"}},actions:{insertHere:"Insert a step here",deleteNamed:"Delete {{name}}",deleteNode:"Delete node",addSubagent:"Add subagent",addParallelStep:"Add a parallel step",addLoopStep:"Add a loop step",addNextStep:"Add next step",addFirst:"Add at the beginning",addLast:"Add at the end"}},use={title:"Intelligent mode",subtitle:"Describe your goal and Codex will plan, build, debug, and temporarily validate the agent in a sandbox.",model:{label:"Model",placeholder:"Select a model",retiring:"Retiring soon",currentConfiguration:"Current configuration",loadError:"Failed to load models"},availability:{checking:"Checking intelligent development availability…",unavailable:"Intelligent mode is currently unavailable. Go back and try again."},goal:{title:"Start with a goal",continueTitle:"Continue improving the project",hint:"Describe the problem your agent should solve. We will ask about any details that could affect the result.",continueHint:"Describe what you want to change. The result will be saved as a new version.",basedOn:"Based on",clearSelection:"Clear selection",label:"Goal",optimizationLabel:"Optimization goal",placeholder:"For example: Build an agent that reads sales data, creates weekly reports, and validates the output format",optimizationPlaceholder:"For example: Cite data sources and ask the user when information is incomplete"},actions:{preparing:"Preparing…",build:"Start building",optimize:"Start optimizing"},preparation:{accepted:"Goal received. Implementation is starting now.",preparing:"Creating the task environment…",starting:"Environment ready. Starting Codex…",next:"Next, Codex will plan the approach, then build, run, and validate the agent."}},dse={title:"Saved projects",description:"Continue improving an existing version, or view, download, and deploy its source.",refresh:"Refresh projects",checkingStorage:"Checking project storage…",unavailableTitle:"Projects are temporarily unavailable",storageCheckError:"Could not confirm project storage status. Try again shortly.",storageNotConfigured:"Project storage is not configured.",loadingMigrated:"Loading migrated projects…",loadingSaved:"Loading saved projects…",loadingVersions:"Loading project versions…",unknownTime:"Unknown time",sourceDownloaded:"Source downloaded.",projectSummary_one:"{{count}} version · Updated {{time}}",projectSummary_other:"{{count}} versions · Updated {{time}}",versionSummary_one:"{{time}} · {{count}} file",versionSummary_other:"{{time}} · {{count}} files",noVersionDescription:"No version description",latestVersion:"Latest version",verified:"Verified",pendingVerification:"Needs review",viewSource:"View source",download:"Download",downloading:"Downloading…",optimize:"Optimize",optimizeUnavailable:"Optimize, not supported",errors:{projects:"Could not load saved projects.",source:"Could not load project source.",versions:"Could not load project versions.",download:"Could not download the source.",prepareDeployment:"Could not prepare the source for deployment.",deleteVersion:"Could not delete the project version.",migrated:"Could not load migrated projects",saved:"Could not load saved projects"},empty:{migratedTitle:"No migrated projects yet",savedTitle:"No saved projects yet",migratedDescription:"Source will be saved here after your first migration.",savedDescription:"Source will be saved here after your first build.",noVersions:"This project has no available versions."},compare:{selected:"{{count}}/2 selected",selectedLabel:"Selected",select:"Select",view:"View comparison",start:"Compare versions"},delete:{title:"Delete this version?",onlyVersion:"“{{name}}” has only one version. Deleting it will also remove the project. This cannot be undone.",description:"This version's source and validation records will be permanently deleted. Other versions are not affected.",confirm:"Delete version"}},fse={title:"Choose how to create",subtitle:"Build your agent with the workflow that fits your needs",features:"Features",quick:{title:"Quick mode",description:"Delegate tasks to dynamically created subagents",features:{dynamicSubagents:"Dynamic subagents",autonomousPlanning:"Autonomous planning",collaboration:"Multi-agent collaboration",summary:"Automatic result summaries",skills:"Skills on demand",trace:"Traceable task execution"}},traditional:{title:"Advanced mode",description:"Customize your agent structure in detail",features:{visualConfig:"Visual configuration",migration:"Existing agent migration",debugging:"Live debugging",optimization:"Optional optimization",parameters:"Fine-grained controls"}}},hse={placeholder:"Enter a system prompt. Type ## followed by a space to add a level-two heading…",toolbar:{undo:"Undo {{shortcut}}",redo:"Redo {{shortcut}}",paragraph:"Paragraph",quote:"Quote",heading:"Heading {{level}}",selectBlockType:"Select text style",blockType:"Text style",bold:"Bold",removeBold:"Remove bold",italic:"Italic",removeItalic:"Remove italic",bulletedList:"Bulleted list",numberedList:"Numbered list"}},pse={local:{duplicatesSkipped:"Skipped duplicate skills: {{names}}",invalidDrop:"Drop a folder containing SKILL.md or a .zip file",readError:"Could not read the files: {{detail}}",dropLabel:"Drop a folder or ZIP file to detect skills automatically",hint:"Each skill must contain a SKILL.md file. Directories can contain multiple skills.",reading:"Reading files…",fileCount:"Local · {{count}} files"},hub:{searchError:"Search failed. Try again shortly.",searchPlaceholder:"Search Volcano Find Skill, such as data analysis or PDF",search:"Search",searching:"Searching…",noResults:"No matching skills found. Try another keyword.",hint:"Search Volcano Find Skill by keyword. Selected skills are downloaded to the skills/ directory when the project is generated."},space:{loadError:"Failed to load",loadingSpaces:"Loading AgentKit Skills centers…",noSpaces:"This account has no AgentKit Skills centers.",selectSpace:"Select an AgentKit Skills center",openConsole:"Open in the Volcano Engine console",loadingSkills:"Loading skills…",noSkills:"This AgentKit Skills center has no skills."}},mse={unnamedNode:"Unnamed node",editInstruction:"Select to edit instructions…",controls:{ariaLabel:"Workflow canvas controls",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Fit view"},sections:{info:"Workflow information",execution:"Execution mode",nodes:"Nodes",nodeConfig:"Node configuration"},types:{sequential:{label:"Sequential",description:"Run nodes one after another"},parallel:{label:"Parallel",description:"Run nodes at the same time"},loop:{label:"Loop",description:"Run nodes repeatedly"}},placeholders:{description:"Describe what this workflow does…",agentDescription:"Describe what this agent does…",instruction:"You are…"},errors:{workflowNameUnique:"The workflow name must be unique among agent node names",agentNameUnique:"Agent names must be unique within this workflow"},dragHint:"Drag onto the canvas, or use the button below",agentNode:"Agent node",addNode:"Add node",connectHint:"Drag between node handles to define the execution order.",create:"Create workflow",deleteNode:"Delete node",nameHelp:"Use only letters, numbers, and underscores. Names must be unique.",instruction:"Instructions",tools:"Tools (comma-separated)",nodeId:"Node ID",empty:{selectNode:"Select a node to edit its configuration",summary:"{{nodes}} nodes · {{edges}} connections"}},gse={ariaLabel:"Quick mode creation",progress:"Quick mode creation progress",steps:{agent:{label:"Agent",title:"Basic information",description:"Set the agent's name, purpose, behavior, and capabilities"},environment:{label:"Environment",title:"Configure the environment",description:"Choose the default environment or a custom environment you have built"},deployment:{label:"Deployment",title:"Deployment preferences",description:"Configure AgentKit cloud settings"}},model:{label:"Model",source:"Model source",name:"Model name",provider:"Provider",volcengineArk:"Volcano Ark",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",currentApiKey:"Current API Key",loadingApiKeys:"Loading API Keys",selectApiKey:"Select an API Key",searchApiKeys:"Search API Key names",noApiKeys:"No API Keys available",loadingModels:"Loading models",selectModel:"Select a model",searchModels:"Search by name, Model ID, or provider",noModels:"No models available",apiKeyPlaceholder:"Enter a model API Key",credentialsLoadError:"Failed to load model credentials",modelsLoadError:"Failed to load models"},identity:{unnamedPool:"Unnamed user pool",currentPool:"{{value}} (current user pool)",userPool:"User pool",loading:"Loading user pools",placeholder:"Select a user pool",search:"Search user pools",empty:"This account has no Identity user pools",currentHint:"This Studio's login JWT will be forwarded to the Runtime",mismatchHint:"The selected user pool is not used by this Studio, so the Studio will not be able to call the Runtime after deployment",selectionHint:"The user pool used by this Studio is marked in the list"},agent:{namePlaceholder:"Enter an agent name",descriptionPlaceholder:"Describe what this agent can do",prompt:"Prompt",promptPlaceholder:"Define the role, goals, and behavior boundaries",skills:"Skills",addSkill:"Add skills"},validation:{descriptionRequired:"Enter a description",promptRequired:"Enter a prompt",modelRequired:"Select a model",instanceIntegers:"Minimum instances must be an integer of 0 or greater, and maximum instances must be an integer greater than 0",instanceOrder:"Minimum instances cannot exceed maximum instances",userPoolRequired:"Select a user pool for Runtime authentication"},deployment:{runtimeName:"Runtime name",runtimeNameUpdateHint:"The existing Runtime name is preserved during updates",runtimeNameHint:"Use only letters, numbers, underscores, and hyphens",region:"Deployment region",authentication:"Authentication",apiKeyDescription:"Default: access with the Runtime API Key",userPoolDescription:"Use a JWT issued by an Identity user pool",sessionStorage:"Session storage",inMemoryStorage:"Temporary in-memory storage",backends:{sqlite:"SQLite file",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",inMemoryHint:"To prevent session loss across instances, keep the Runtime at 1–1 instances",networkMode:"Network mode",network:{public:"Public",private:"Private",both:"Public and private"},subnetIds:"Subnet IDs (optional, comma-separated)",sharedInternet:"Shared public egress in the VPC",sharedInternetHint:"Allow private Runtimes to access the public internet through shared egress",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",evaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment",resources:"Resource configuration",complete:"Deployment complete",preparing:"Preparing deployment…"},environmentVariables:{title:"Environment variables",add:"Add variable",nameAriaLabel:"Environment variable name",valueAriaLabel:"Value for {{name}}",deleteNamed:"Delete {{name}}"},actions:{updateAgain:"Update again",deployAgain:"Deploy again",updateAndPublish:"Update and publish"}},bse={actions:{addSubagent:"Add subagent",clearRoot:"Clear main agent",clearRootConfirmation:"Clear all settings and subagents from the main agent? This cannot be undone."},workspace:{progress:"Agent creation progress",modes:{build:"Build",validate:"Debug",optimize:"Optimize",environment:"Environment",publish:"Publish"},titles:{build:"Customize your agent architecture",validate:"Debug your agent",optimize:"Choose optimizations for your agent",environment:"Configure the cloud environment",publish:"Prepare your agent for deployment"}},sections:{type:{label:"Agent type",hint:"Choose an agent type"},basic:{label:"Basic information",hint:"Name, description, and system prompt"},model:{label:"Model",hint:"Model and service (optional)"},tools:{label:"Tools",hint:"Callable capabilities"},skills:{label:"Skills",hint:"Declarative skills"},knowledge:{label:"Knowledge base",hint:"External knowledge retrieval"},memory:{label:"Memory",hint:"Short-term and long-term memory"},subagents:{label:"Subagents",hint:"Nested collaboration"},review:{label:"Finish",hint:"Preview and create"}},agentTypes:{ariaLabel:"Agent type",remoteChildOnly:"Remote agents can only be used as child steps",llm:{label:"Agent",fullLabel:"LLM agent",description:"Uses an LLM to complete tasks autonomously"},sequential:{label:"Sequential",fullLabel:"Sequential agent",description:"Runs subagents one after another"},parallel:{label:"Parallel",fullLabel:"Parallel agent",description:"Runs subagents in parallel, then combines their results"},loop:{label:"Loop",fullLabel:"Loop agent",description:"Repeats subagents until the stop condition is met"},a2a:{label:"Remote agent",fullLabel:"Remote agent",description:"Calls a remote agent through the A2A protocol"}},basic:{agentName:"Agent name",name:"Name",agentDescription:"Agent description",descriptionPlaceholder:"Briefly describe what this agent does so your team can identify it…",nameHelp:"Follow Google ADK naming rules and keep the name unique in the execution flow.",rootDescriptionHelp:"The full description is preserved and converted to a Runtime-compatible single line during deployment.",descriptionHelp:"The description appears in agent lists and selectors.",orchestratorHelp:"This is a collaboration container and does not answer directly. Add task steps on the canvas and drag them to reorder.",maxIterations:"Maximum iterations",maxIterationsHelp:"The loop repeats its subagents until the condition is met or this limit is reached.",agentCenter:"AgentKit agent center",agentCenterHelp:"The remote agent's name, description, and capabilities come from the Agent Card returned by the center. The system discovers and attaches matching agents for each task.",moreOptions:"More options",systemPrompt:"System prompt",loadingMarkdown:"Loading Markdown editor…",markdownHelp:"Markdown shortcuts are supported. For example, type ## followed by a space to create a level-two heading.",unnamed:"Unnamed",unnamedAgent:"Unnamed agent"},validation:{remoteRoot:"A remote agent can only be a subagent",missingRegistry:"Select an AgentKit agent center",name:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name.",characters:"Start with a letter or underscore and use only letters, numbers, and underscores"},duplicateName:"Agent names must be unique within this structure",missingDescription:"Description is required",mcpAuthRequired:"Confirm how to handle authentication after changing the MCP address",mcpDuplicateName:"MCP names must be unique",mcpDuplicateUrl:"Remove the duplicate MCP endpoint before publishing",missingSubagent:"A subagent is required",missingPrompt:"System prompt is required",missingSubagentDetail:"Add at least one subagent to {{type}} before debugging or publishing.",problem:"{{name}}: {{problem}}"},ai:{ariaLabel:"Fill agent configuration with AI",minimumLength:"Enter at least {{count}} characters.",replaceConfirmation:"The generated configuration will replace the current canvas and settings. Continue?",placeholder:"Describe your goal and use {{model}} to generate the configuration",generate:"Generate",generating:"Generating",success:"Configuration generated",regenerate:"Generate again",failed:"Generation failed"},debug:{ariaLabel:"Agent debugging workspace",unavailable:"This backend does not currently support generated-agent debug runs.",baseline:"Baseline",comparison:"Variant {{count}}",selectModel:"Select a model",enterDescription:"Enter a description",enterPrompt:"Enter a system prompt",duplicateConfiguration:"Test configurations must be unique",starting:"Starting…",applyAndRestart:"Apply and restart",restart:"Restart",start:"Start environment",defaultModel:"Default model",testConfiguration:"Test configuration",deleteVariant:"Delete {{name}}",deleteVariantGroup:"Delete comparison variant",creatingEnvironment:"Creating the test environment…",configurationChanged:"The configuration changed. Restart the environment.",ready:"Environment ready",readyHint:"Send a message to compare agent responses.",startHint:"Complete the configuration, then start the environment.",viewTraceNamed:"View the trace for {{name}}",traceUnavailable:"Send a message to view its trace",trace:"Trace",useConfiguration:"Use this configuration",finishConfiguration:"Finish configuration",finishAndStart:"Finish and start",currentAgentModel:"Current agent model",configurationHint:"Changes apply only to this comparison. Select this configuration to continue to deployment.",messagePlaceholder:"Send a message to the running test environments…",startOneFirst:"Start at least one test environment first",addVariant:"Add variant",traceTitle:"Trace · {{name}}",leaveTitle:"Leave debugging?",leaveDescription:"The current environments will be removed when you leave. You can start new environments when you return.",cleaning:"Cleaning up…",confirmLeave:"Leave",closeLeaveConfirmation:"Close leave-debugging confirmation"},optimization:{ariaLabel:"Agent optimization options",scenario:"Optimization scenario",components:"Optimization components",bytePlusUnavailable:"Harness Sidecar optimizations are not available for BytePlus accounts yet. Leave all optimizations unselected to continue; regular BytePlus agents are not affected.",releaseScenario:"Optimization scenario: {{profile}}",profiles:{default:{label:"Custom",description:"Choose components as needed. The Sidecar stays off when none are selected."},ops:{label:"Operations",description:"For operations diagnostics, databases, logs, and monitoring MCP servers."}},groups:{quality:"Improve response quality",cost:"Reduce runtime cost",stability:"Improve runtime stability"},options:{context_engine:{label:"Context management",description:"Manage context assembly, task anchoring, and context budgets."},compressor:{label:"Context and result compression",description:"Compress long context and large tool results to reduce token usage."},verifier:{label:"Response verification and repair",description:"Verify evidence and responses, then repair or alert on failure."},long_run_control:{label:"Goal task control",description:"Manage progress, continuation, and completion conditions for Goal tasks."},mcp_resilience:{label:"MCP resilience",description:"Manage connections, timeouts, empty results, large responses, and call budgets. Includes read-only SQL protection by default."}}},model:{label:"Model",source:"Model source",volcanoArk:"Volcano Ark",volcengineArk:"Volcano Ark",bytePlusModelArk:"BytePlus ModelArk",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",configuration:"Model configuration",name:"Model name",provider:"Provider",liteLlmProviders:"LiteLLM providers",apiKeyPlaceholder:"Enter the model API Key",available:"Available",retiring:"Retiring soon",notActivated:"Not activated",unavailable:"Unavailable",apiKeyLoadError:"Failed to load Ark API Keys",loadingApiKeys:"Loading API Keys…",selectApiKey:"Select an API Key",currentApiKey:"Current API Key",apiKeyList:"API Key list",searchApiKey:"Search API Keys",searchApiKeyName:"Search API Key names",noApiKeys:"No API Keys available",noMatchingApiKey:"No matching API Keys",loading:"Loading models…",loaded:"{{count}} models loaded",loadError:"Failed to load models",selectModel:"Select a model",selectProviderModel:"Select a provider model",providerModels:"Provider models",search:"Search models",searchPlaceholder:"Search by name, Model ID, or provider",noMatches:"No matching models",empty:"No models available",unknownStatus:"Unknown status",refresh:"Refresh",refreshing:"Refreshing…",activate:"Activate",activateAction:"Open activation",currentConfiguration:"Current configuration"},tools:{builtIn:"Built-in tools",builtInHelp:"Select VeADK capabilities. Imports and required environment variables are added automatically.",codeExecution:"Code execution configuration",codeExecutionHelp:"Select the AgentKit code execution sandbox.",mcp:"MCP tools"},catalog:{web_search:{label:"Web search",description:"Get real-time information with Volcengine Web Search."},parallel_web_search:{label:"Parallel web search",description:"Run multiple search queries in parallel and combine the results faster."},link_reader:{label:"Link reader",description:"Fetch and read the main content from a URL."},web_scraper:{label:"Web scraper",description:"Crawl webpages into structured data. Requires the Scraper service."},image_generate:{label:"Image generation",description:"Generate images from text with Doubao Seedream."},image_edit:{label:"Image editing",description:"Edit or transform images with Doubao SeedEdit."},video_generate:{label:"Video generation",description:"Generate videos from text or images with Doubao Seedance, including task status queries."},text_to_speech:{label:"Text to speech (TTS)",description:"Convert text to speech with Volcengine Speech."},run_code:{label:"Code execution",description:"Run code in a sandbox."},vesearch:{label:"VeSearch",description:"Search with Volcengine VeSearch. Requires a bot endpoint."},links:{console:"Console",documentation:"Documentation"},env:{modelAgentName:{comment:"Model name"},embeddingModelName:{comment:"Embedding model required by memory and knowledge bases"},vikingMemoryProject:{comment:"VikingDB memory project"},vikingMemoryRegion:{comment:"VikingDB memory region"},vikingMemoryType:{comment:"Memory types"},feishuAppId:{comment:"Feishu app ID"},feishuAppSecret:{comment:"Feishu app secret",placeholder:"Enter the app secret"},registrySpaceId:{comment:"AgentKit agent center",placeholder:"Select an agent center"},registryTopK:{comment:"Number of agents to retrieve"},registryRegion:{comment:"AgentKit agent center region"},registryEndpoint:{comment:"AgentKit agent center OpenAPI endpoint"},agentKitToolId:{comment:"Code execution sandbox ID"},agentKitToolRegion:{comment:"AgentKit Tools region"},openVikingUrl:{comment:"OpenViking service URL"},openVikingMemoryUserId:{comment:"Memory owner ID",help:"The user segment in viking://user//peers//memories. Use it to isolate agents, tenants, or business scenarios. The default is default."},openVikingMemoryPolicy:{comment:"Memory policy",help:"Controls memory extraction and isolation. Leave it blank to use the official default policy."},openVikingKnowledgeUserId:{comment:"Knowledge base owner ID",help:"Used in the default path viking://user//resources// when no resource directory is configured. The default is default."},openVikingTargetUri:{comment:"Knowledge base resource directory",help:"Leave blank to generate it from the KnowledgeBase index. When provided, this OpenViking resource directory takes precedence."},tlsServiceName:{comment:"TLS topic_id. Leave blank to create one automatically"}}},backends:{shortTerm:{local:{label:"In-memory",description:"Stored in the process without persistence. Best for development and debugging."},sqlite:{label:"SQLite file",description:"Persist data to a local .db file."},mysql:{label:"MySQL",description:"Persist data to MySQL."},postgresql:{label:"PostgreSQL",description:"Persist data to PostgreSQL."}},longTerm:{local:{label:"Local vector store",description:"In-process llama-index vector store."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},redis:{label:"Redis",description:"Vector retrieval with Redis."},viking:{label:"VikingDB Memory",description:"VikingDB memory with user profile support."},openviking:{label:"OpenViking Memory",description:"Long-term memory that stores and retrieves preferences, events, and entities per user."},mem0:{label:"Mem0",description:"Managed memory from Mem0."}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB knowledge base."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},context_search:{label:"Context Search",description:"Volcengine Context Search without embedding configuration."},openviking:{label:"OpenViking Knowledge",description:"OpenViking resource-directory knowledge base without embedding configuration."}}},exporters:{apmplus:{label:"APMPlus",description:"Volcengine APMPlus application performance monitoring."},cozeloop:{label:"CozeLoop",description:"Distributed tracing with CozeLoop."},tls:{label:"TLS (Log Service)",description:"Export logs to Volcengine TLS."}},knowledge:{title:"Knowledge base",description:"Enable external knowledge retrieval (RAG) so the agent can answer from your data.",backend:"Knowledge base backend",vikingDatabase:"VikingDB knowledge base"},memory:{shortTerm:"Short-term memory",shortTermDescription:"Store context for one session",shortTermBackend:"Short-term memory backend",longTerm:"Long-term memory",longTermDescription:"Store context across sessions, usually with vector retrieval",longTermBackend:"Long-term memory backend",vikingDatabase:"VikingDB memory",autoSave:"Save sessions to long-term memory automatically",autoSaveDescription:"Write session content to long-term memory when a session ends."},mcp:{removeTool:"Remove MCP tool",namePlaceholder:"Name (optional)",urlPlaceholder:"MCP service URL",pathWarning:"This address does not end with /mcp. Confirm that it is the complete MCP service URL.",configuredPlaceholder:"Authentication is stored securely",tokenPlaceholder:"Bearer token (optional)",changedUrlWarning:"The MCP address changed. Choose how to handle the stored authentication.",reuseCredential:"Keep using it",replaceCredential:"Replace authentication",noAuth:"Use no authentication",reuseHint:"The stored authentication will be reused when you publish.",changeToReplace:"Replace instead",credentialConfigured:"Studio securely stores the authentication.",removeCredential:"Remove authentication",commandPlaceholder:"Command, such as npx",argsPlaceholder:"Arguments separated by spaces",stdioHint:"The stdio tool starts in the deployment environment. Make sure its command and dependencies are available.",addTool:"Add MCP tool"},resources:{unnamedAgentCenter:"Unnamed agent center",unnamedKnowledgeBase:"Unnamed knowledge base",unnamedMemory:"Unnamed memory store",loadError:"Failed to load",loadingAgentCenters:"Loading agent centers…",agentCentersLoaded:"{{count}} agent centers loaded",noAgentCenters:"No agent centers available",noMatchingAgentCenters:"No matching agent centers",searchAgentKitCenter:"Search AgentKit agent centers",searchNameOrId:"Search by name or ID",selectAgentCenter:"Select an agent center",selectAgentKitCenter:"Select an AgentKit agent center",selectedAgentCenter:"Selected agent center",agentKitCenter:"AgentKit agent center",refreshAgentCenters:"Refresh agent centers",knowledgeBaseList:"Knowledge base list",knowledgeBasePlaceholder:"Select a knowledge base",loadingKnowledgeBases:"Loading knowledge bases…",knowledgeBasesLoaded:"{{count}} knowledge bases loaded",noKnowledgeBases:"No knowledge bases available",noMatchingKnowledgeBases:"No matching knowledge bases",searchKnowledgeBase:"Search knowledge bases",selectKnowledgeBase:"Select a knowledge base",refreshKnowledgeBases:"Refresh knowledge bases",memoryList:"Memory store list",memoryPlaceholder:"Select a memory store",loadingMemories:"Loading memory stores…",memoriesLoaded:"{{count}} memory stores loaded",noMemories:"No memory stores available",noMatchingMemories:"No matching memory stores",searchMemory:"Search memory stores",selectMemory:"Select a memory store",refreshMemories:"Refresh memory stores"},env:{noAdditionalParameters:"This backend needs no additional runtime parameters.",invalidJson:"Enter valid JSON.",helpAriaLabel:"Help for {{label}}: {{help}}",openOpenViking:"Open OpenViking {{label}}",valuePlaceholder:"Enter a value",openVikingIndex:"OpenViking resource index",openVikingIndexHelp:"Leave blank to generate an index from the agent name, such as my_agent_kb. Without DATABASE_OPENVIKING_TARGET_URI, the default URI is viking://user/{knowledge base owner ID, or default}/resources/{resource index}/. When DATABASE_OPENVIKING_TARGET_URI is set, that complete URI is used instead.",openVikingIndexAriaLabel:"OpenViking resource index help: {{help}}"},deployment:{vpcRequired:"Enter a VPC ID when using VPC networking.",apiKeyRequired:"Select the API Key used by the model.",invalidEnvName:"Invalid environment variable name: {{key}}",requiredEnv:"{{name}}: enter this required environment variable",generatingConfiguration:"Generating deployment configuration",runtimeNameExists:"This Runtime name already exists. Choose another name and try again.",preparing:"Preparing deployment",complete:"Deployment complete",failed:"Deployment failed",updateAndPublish:"Update and publish",stages:{build:"Build image",deploy:"Deploy Runtime",publish:"Publish service",running:"Deploying"}},publish:{generating:"Generating publish configuration",validating:"Validating the agent structure and preparing the deployment snapshot…"}},yse={presets:{support:{name:"Customer support assistant",description:"Answer questions around the clock using your knowledge base and conversation history, with consistent and considerate responses.",instruction:"You are a professional and patient customer support assistant. Always use a courteous, friendly tone. Base answers on the knowledge base whenever possible. When the available information is insufficient, say so clearly and ask for the details you need instead of inventing an answer. Keep responses concise and well structured, and provide steps when useful.",subagents:{}},analyst:{name:"Data analyst",description:"Run code for statistics and visualization with tracing enabled, so every analysis is observable and reproducible.",instruction:"You are a rigorous data analyst. Clarify the objective and definitions before cleaning, analyzing, and visualizing data with executable code. Explain assumptions and methods at each step, support conclusions with key evidence, and identify possible bias or limitations.",subagents:{}},translator:{name:"Translation assistant",description:"Translate between Chinese and English accurately and naturally while preserving tone and terminology.",instruction:"You are a professional translator fluent in Chinese and English. Preserve the meaning of the source while producing natural language for the target audience. Keep proper nouns and technical terminology accurate and reflect the original tone and style. Return only the translation unless the user asks for an explanation.",subagents:{}},coder:{name:"Coding assistant",description:"Write, debug, and refactor code, validate it by running tests, and produce clear, maintainable implementations.",instruction:"You are a senior software engineer. Write correct, clear, maintainable code that follows the conventions and best practices of the target language. When uncertain, run the code to validate the implementation, cover important edge cases, and add concise comments for complex logic.",subagents:{}},researcher:{name:"Researcher",description:"Search primary sources online and combine them with knowledge and long-term memory to produce evidence-backed findings.",instruction:"You are a rigorous researcher. Break each question into key subproblems, collect multiple credible primary sources through web search, and cross-check the evidence before drawing conclusions. Cite sources, state uncertainty, distinguish facts from inference, and avoid overgeneralization.",subagents:{}},"research-team":{name:"Multi-agent research team",description:"Coordinate a researcher, analyst, and writer to produce an end-to-end research report.",instruction:"You coordinate a research team. Break down the user's research task, delegate search, analysis, and writing to the appropriate subagents, synthesize their work, and deliver a clear, evidence-backed report.",subagents:{0:{name:"Researcher",description:"Collect primary sources and data related to the topic online.",instruction:"You are the team's researcher. Find multiple credible sources about the topic, organize the key facts, data, and original citations, and hand them to the analyst without adding unsupported conclusions."},1:{name:"Analyst",description:"Cross-check and synthesize the collected material.",instruction:"You are the team's analyst. Cross-check, compare, and synthesize the research material. Extract insights, identify contradictions and uncertainty, and produce a structured set of findings."},2:{name:"Writer",description:"Turn the analysis into a clear report with reliable citations.",instruction:"You are the team's writer. Turn the analyst's findings into a clear, well-written report with consistent citations, ensuring every conclusion can be traced to a source."}}}},tags:{tools:"Tools",memory:"Memory",knowledgeBase:"Knowledge base",tracing:"Tracing",subagents:"{{count}} subagents"},gallery:{title:"Create from a template",subtitle:"Choose a prebuilt agent template and customize it to fit your needs."},detail:{back:"Back to templates",name:"Name",systemPrompt:"System prompt",model:"Model",tools:"Tools",memory:"Memory",knowledgeBase:"Knowledge base",tracing:"Tracing",subagents:"Subagents ({{count}})",create:"Create from this template",shortTermMemory:"Short-term",longTermMemory:"Long-term"}},vse={common:nse,yaml:ise,validation:rse,defaults:sse,helpers:ase,intelligentDeployment:ose,codePackage:lse,buildCanvas:cse,intelligent:use,projectLibrary:dse,modePicker:fse,promptEditor:hse,skills:pse,workflow:mse,workbench:gse,traditional:bse,template:yse},QDe=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:cse,codePackage:lse,common:nse,default:vse,defaults:sse,helpers:ase,intelligent:use,intelligentDeployment:ose,modePicker:fse,projectLibrary:dse,promptEditor:hse,skills:pse,template:yse,traditional:bse,validation:rse,workbench:gse,workflow:mse,yaml:ise},Symbol.toStringTag,{value:"Module"})),xse={backToList:"Back to scheduled tasks",cancel:"Cancel",cancelQueue:"Cancel queued run",cancelQueueFirst:"Cancel the queued run first",cancelling:"Cancelling…",closeDrawer:"Close panel",collapse:"Collapse",connectingRuntime:"Connecting to Runtime…",createScheduledTask:"Create scheduled task",createTask:"Create task",delete:"Delete",deleteTask:"Delete task",edit:"Edit",enable:"Enable",expand:"Expand",pause:"Pause",refresh:"Refresh",refreshHistory:"Refresh run history",rerun:"Run again",retry:"Retry",runNow:"Run now",saveChanges:"Save changes",saving:"Saving…",stop:"Stop run",stopRun:"Stop this run",stopRunFirst:"Stop the current run first",stopping:"Stopping…",viewDetails:"View details"},wse={cancelDescription:"This Session will be cancelled. Future scheduled runs will remain enabled.",cancelTitle:"Stop this run?",deleteDescription:"“{{name}}” and its complete run history will be permanently deleted.",deleteTitle:"Delete scheduled task?"},Ose={configuration:"Task configuration",nextRun:"Next run",pageLabel:"Scheduled task details",region:"Region",runtime:"Runtime",status:"Task status"},Sse={createTitle:"Create scheduled task",description:"Each trigger creates a separate Session for the Runtime Agent.",editTitle:"Edit scheduled task"},kse={minutesSeconds:"{{minutes}} min {{seconds}} sec",seconds:"{{count}} sec"},Ese={cronExpression:"Cron expression",cronHelp:"Enter minute, hour, day of month, month, and day of week.",dailyTime:"Daily run time",enableAfterCreate:"Enable after creation",enableHelp:"The task will run at its next scheduled time after it is enabled.",name:"Task name",namePlaceholder:"For example: Generate a daily operations summary",noRuntime:"No Runtime available",prompt:"Execution prompt",promptPlaceholder:"Enter the text to send to the Agent on every run",runAt:"Run time",runtimeAgent:"Runtime Agent",runtimeHelp:"The task always uses the Runtime's currently active version.",runtimePlaceholder:"Select a Runtime Agent",schedule:"Schedule",scheduleType:"Schedule type",timezone:"Time zone",weekday:"Day of week"},Cse={all:"All"},Tse={description:"Each run uses a separate Session. Results and errors are retained.",duration:"Duration: {{duration}}",emptyDescription:"Runs will appear here after the task is triggered or run manually.",emptyTitle:"No runs yet",errorDetails:"Error details",finalAnswer:"Final answer",loadFailed:"Unable to load run history",loadFailedDescription:"Check the Studio service and try again.",session:"Session",title:"Run history"},Ase={cancelRequested:"Stop request submitted.",created:"Task created.",deleted:"The task and its run history were deleted.",enabled:"Task enabled.",paused:"Task paused.",queued:"Task queued and will start within one minute.",requeued:"Task queued again and will start within one minute.",updated:"Task updated."},_se={filterLabel:"Filter scheduled tasks by status",listLabel:"Scheduled task list",loadFailed:"Unable to load scheduled tasks",loadFailedDescription:"Check the Studio service and try again.",title:"Cronjob"},Nse={cron:"Cron {{cron}}{{zone}}",daily:"Daily at {{time}}{{zone}}",once:"Once · {{date}}{{zone}}",weekly:"{{weekday}} at {{time}}{{zone}}"},jse={daily:"Daily",once:"Once",weekly:"Weekly"},Rse={cancelled:"Cancelled",enabled:"Enabled",failed:"Failed",notRun:"Not run yet",paused:"Paused",pending:"Preparing",queued:"Queued",retrying:"Retrying",running:"Running",skipped:"Skipped",success:"Succeeded"},Ise={cronFields:"A Cron expression must contain five fields, for example 0 9 * * *.",nameRequired:"Enter a task name.",promptRequired:"Enter the text to send to the Agent on each run.",runtimeAppMissing:"The Runtime Agent did not return an appName. Confirm that the Runtime is ready and compatible.",runtimeRequired:"Select an available Runtime Agent.",timeRequired:"Select a run time."},Pse={friday:"Friday",monday:"Monday",saturday:"Saturday",sunday:"Sunday",thursday:"Thursday",tuesday:"Tuesday",wednesday:"Wednesday"},zDe={actions:xse,confirm:wse,detail:Ose,drawer:Sse,duration:kse,fields:Ese,filters:Cse,history:Tse,notices:Ase,page:_se,schedule:Nse,scheduleTypes:jse,status:Rse,validation:Ise,weekdays:Pse},VDe=Object.freeze(Object.defineProperty({__proto__:null,actions:xse,confirm:wse,default:zDe,detail:Ose,drawer:Sse,duration:kse,fields:Ese,filters:Cse,history:Tse,notices:Ase,page:_se,schedule:Nse,scheduleTypes:jse,status:Rse,validation:Ise,weekdays:Pse},Symbol.toStringTag,{value:"Module"})),Dse="Report an issue",Mse="Description",Lse="Common issues",$se="Cancel",Fse="Done",Bse="Submit feedback",Use="Submitting…",Qse={title:"Feedback submitted. Thank you.",description:"The AgentKit team will review your report as soon as possible."},zse={close:"Close issue report",intro:"Select the issues you encountered and add any useful details.",privacy:"Your conversation data will be shared with the AgentKit team. Please protect sensitive information.",descriptionPlaceholder:"Describe what happened (optional)",issues:{slow:"Slow execution",crash:"Runtime crash",incorrect:"Inaccurate result",tool_error:"Tool call failed",other:"Other issue"}},Vse={description:"Tell us about a problem you encountered while using AgentKit Studio.",module:"Area",modules:{conversation:"Conversation",agents:"Agents",applications:"Automations",search:"Search",other:"Other"},commonIssuesMultiple:"Common issues (select all that apply)",issueTypes:"Issue types",issues:{page_slow:"Page loads slowly",feature_unavailable:"Feature unavailable",display_error:"Display issue",no_response:"Action has no response",other:"Other issue"},descriptionPlaceholder:"Describe the page, action, and what happened",quickAdd:"Quick add",suggestionsLabel:"Suggested descriptions",suggestions:{noResponse:"Nothing happens after I click",loading:"The page remains in a loading state",incomplete:"Some content is missing or clipped",error:"An error appears after the action"},privacy:"Your data will be shared with the AgentKit team. Please protect sensitive information."},HDe={title:Dse,descriptionLabel:Mse,commonIssues:Lse,cancel:$se,done:Fse,submit:Bse,submitting:Use,success:Qse,dialog:zse,page:Vse},qDe=Object.freeze(Object.defineProperty({__proto__:null,cancel:$se,commonIssues:Lse,default:HDe,descriptionLabel:Mse,dialog:zse,done:Fse,page:Vse,submit:Bse,submitting:Use,success:Qse,title:Dse},Symbol.toStringTag,{value:"Module"})),Hse={back:"Back",close:"Close"},qse={title:"Optimize migrated project",closeAria:"Close optimization dialog"},Wse={title:"Migrated projects",description:"Manage migrated source versions or continue optimizing any version.",libraryTitle:"Projects and versions",libraryDescription:"View, download, deploy, or compare source versions, or continue optimizing any version.",emptyTitle:"No migrated projects yet",emptyDescription:"Migrated source code will be saved here automatically."},Gse={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any (universal migration)"},Kse={awaitingUpload:"Awaiting upload",analyzing:"Analyzing",needsInput:"Needs input",analysisReady:"Awaiting confirmation",migrating:"Migrating",validating:"Validating",packaging:"Packaging",succeeded:"Completed",succeededWithWarnings:"Completed with notices",partial:"Partially completed",failed:"Failed",cancelled:"Stopped",expired:"Expired"},Xse={partialReady:"Migration output is ready, but delivery is incomplete. Review the migration notices.",readyWithWarnings:"Migration output is ready. Review the migration notices.",ready:"Migration output is ready."},Yse={passed:"Output verification passed",failed:"Output verification failed",degraded:"Output verification incomplete"},Zse={session:"Create migration environment",upload:"Upload project",analysis:"Analyze project"},Jse={agentNameRequired:"Enter an Agent name",agentNameInvalid:"Agent names must be 1–63 characters, contain only lowercase letters, numbers, and hyphens, and start and end with a letter or number"},eae={seconds:"{{seconds}} sec",minutesSeconds:"{{minutes}} min {{seconds}} sec"},tae={savedUnaffected:"Saved projects are unaffected",savingUnaffected:"Source is being saved and will be unaffected once complete",activeDetail:"Task history and temporary output will become unavailable after expiration",oneHour:"Temporary migration environment is retained for 1 hour",ended:"Temporary migration environment has ended",savedAvailable:"Saved projects remain available to view, download, deploy, or optimize",unavailable:"Task history and temporary output are no longer available",countdown:"Temporary migration environment ends in {{minutes}} min {{seconds}} sec",expiredSavedMessage:"The temporary migration environment has ended. Saved projects are unaffected.",expiredMessage:"The temporary migration environment has ended. Task history and temporary output are no longer available."},nae={recommended:"Recommended migration method",scope:"Migration scope",excluded:"Out of scope",viewEvidence:"View analysis evidence",viewAssumptions:"View key assumptions",viewSourceEvidence:"View source evidence"},iae={ariaLabel:"Codex activity",title:"Codex activity",startingAnalysis:"Codex is starting the analysis…",startingMigration:"Codex is starting the migration…",loadError:"Codex activity is temporarily unavailable. The current task is unaffected."},rae={title:"Migration output",fileTooLarge:"This file exceeds 2 MiB. Download the complete output to view it.",unsupportedPreview:"This file cannot be previewed here. Download the complete output to view it.",filesAria:"Migration output files",searchAria:"Search output files",searchPlaceholder:"Search files",limit:"Showing the first {{count}} items. Search for a specific file.",noSelection:"No file selected",noPreview:"No files available to preview.",loadingFile:"Loading output file…",startupFile:"Startup file",fileCountLabel:"Files",saved:"Source has been saved. You can view, download, deploy, or optimize it.",saving:"Output is ready and the source version is being saved.",deployReady:"Output is available to preview, download, and deploy. Waiting for source save status.",deployUnavailable:"Output is available to preview and download, but its current delivery status does not support deployment.",viewProjects:"View migrated projects",downloading:"Downloading…",downloadZip:"Download ZIP",deployTitle:"Deploy migration output",deployUnavailableTitle:"Current delivery status does not support deployment",deployRuntime:"Deploy to Runtime",fileCount:"{{count}} files",startup:"Startup file {{module}}",loading:"Loading migration output…"},sae={retiring:"Retiring soon",currentDefault:"Current default model",loadError:"Failed to load models",label:"Model",placeholder:"Select a model"},aae={zipOnly:"Select a local project in .zip format.",invalidName:"The ZIP file name is invalid. Rename the file and select it again.",tooLarge:"The project ZIP cannot exceed {{size}}.",empty:"The project ZIP cannot be empty.",removeAria:"Remove project ZIP",reselectPrompt:"Select the project ZIP again",selectPrompt:"Select or drop a local project ZIP",reselect:"Select again",selectZip:"Select ZIP",continue:"Continue upload",start:"Start migration",inputAria:"Select a local project ZIP",retention:"The temporary migration environment is retained for 1 hour after creation. Successfully saved source versions are unaffected."},oae={requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}",notReady:"Migration output is not ready yet.",back:"Back to migration results"},lae={backToAddAgent:"Back to Add Agent",title:"Migrate existing project",newMigration:"New migration",recent:"Recent migrations",sessionsAria:"Migration sessions",loadingSessions:"Loading migration sessions…",noSessions:"No migration sessions",heading:"Migrate an existing Agent project",intro:"Upload a local project ZIP. Codex will first perform a read-only analysis, then ask you to confirm the migration method."},cae={stop:"Stop migration",stopping:"Stopping…",reload:"Reload",refreshStatus:"Refresh status"},uae={unavailable:"Migration is currently unavailable",defaultReason:"Dev Sandbox is currently unavailable. Contact your administrator to check the configuration."},dae={requestZip:"Provide a local project ZIP. After upload, I’ll identify the framework, entry point, and migration boundaries, then ask you to confirm the migration method before making changes.",zipHint:"Only local ZIP files are supported, up to {{size}}. The migration environment is retained for 1 hour after creation.",creatingSandbox:"Creating Dev Sandbox",initializing:"Initializing the migration workspace and checking AgentKit CLI, Codex, and migration capabilities. The project will upload automatically when the environment is ready.",elapsed:"Elapsed: {{duration}}",uploadThenAnalyze:"Read-only analysis will start automatically after the ZIP upload completes.",analyzing:"Codex is identifying the framework, entry point, and migration boundaries. No migration changes are being made.",migrationLocked:"Attachments and migration settings cannot be changed while migration is running. Wait for the task to finish or stop it.",analysisPaused:"Read-only analysis is paused. Answer only the questions below. After submission, analysis will continue in the same environment without starting the migration.",analysisComplete:"Read-only analysis is complete. Review the recommendation and confirm the final migration method.",awaitingUpload:"The migration environment is ready. Select the local ZIP again to continue uploading.",expiredTitle:"Migration environment expired",expiredDescription:"Migration content and output can no longer be previewed, downloaded, or deployed. If the Runtime deployment completed, return to the Agents page to continue using it.",unsupportedTitle:"This ZIP cannot be migrated yet",unsupportedHint:"Update the project as instructed, then create a new migration and upload it again.",failedTitle:"Migration incomplete",cancelled:"This migration was stopped. Create a new migration and upload the project again."},fae={ariaLabel:"Provide project analysis details",title:"Additional information needed for analysis",description:"The attachment stays locked; submitting continues read-only analysis only",submitting:"Continuing analysis…",submit:"Submit and continue analysis"},hae={ariaLabel:"Confirm migration method",title:"Confirm migration method",description:"Migration starts only after confirmation",framework:"Migration method",frameworkPlaceholder:"Select a migration method",agentName:"Agent name",entry:"Project entry point",entryPlaceholder:"Select a project entry point",entryExample:"For example, agent.py:agent",consent:"By selecting “Confirm and start migration,” you confirm the migration scope, exclusions, and key assumptions above.",starting:"Starting migration…",start:"Confirm and start migration"},pae={closeAria:"Dismiss error",loadFailed:"Could not load migration data. Try again.",refreshFailed:"Could not refresh the migration status. Try again."},mae={title:"Stop the current migration?",description:"Stopping ends the current analysis or migration process. Completed steps will not continue."},WDe={common:Hse,optimization:qse,projects:Wse,framework:Gse,state:Kse,task:Xse,verification:Yse,transfer:Zse,validation:Jse,duration:eae,expiry:tae,analysis:nae,activity:iae,artifact:rae,model:sae,upload:aae,deployment:oae,workspace:lae,actions:cae,capability:uae,conversation:dae,questions:fae,confirmation:hae,errors:pae,stopDialog:mae},GDe=Object.freeze(Object.defineProperty({__proto__:null,actions:cae,activity:iae,analysis:nae,artifact:rae,capability:uae,common:Hse,confirmation:hae,conversation:dae,default:WDe,deployment:oae,duration:eae,errors:pae,expiry:tae,framework:Gse,model:sae,optimization:qse,projects:Wse,questions:fae,state:Kse,stopDialog:mae,task:Xse,transfer:Zse,upload:aae,validation:Jse,verification:Yse,workspace:lae},Symbol.toStringTag,{value:"Module"})),gae={loading:"Loading…",searchLabel:"Search {{label}}",searchPlaceholder:"Search {{label}}",retry:"Retry",noMatches:"No matches",noOptions:"No options available",selection:"{{label}}: {{value}}"},bae={badge:"All new",view:"See what's new",title:"What's new",defaultNotes:{multiRegion:"Multi-region agents: load Beijing and Shanghai Runtimes in parallel, with more available as you scroll.",switchAgent:"Switch in conversation: choose an agent beside the composer and start a new conversation immediately.",visualCanvas:"Visual execution canvas: inspect multi-agent structures on a horizontal canvas with fullscreen support."}},yae={label:"New conversation workspace",agent:"Agent",skill:"Skill customization",video:"Video creation"},vae={select:"Select conversation mode",agent:{label:"Agent",description:"Chat with the selected Agent"},builtin:{label:"Built-in Agent",description:"Use an Agent provided by the platform"},codex:{label:"Codex Agent",description:"Run tasks in a sandbox"},deepseekHarness:{label:"DeepSeek Harness",description:"Open the DeepSeek Harness workspace"},arkClaw:"ArkClaw",hermes:"Hermes Agent",checking:"Checking configuration",notConfigured:"Not configured by an administrator",unavailable:"Unavailable"},xae={select:"Select Agent",typesLabel:"Agent types",listLabel:"{{type}} list",types:{agent:"Agent",general:"General Agent",codex:"Codex Agent",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw Agent",hermes:"Hermes Agent"},loading:"Loading Agents",reload:"Reload",empty:"No {{type}} yet",emptyLocal:"No local Agents yet",emptyGeneral:"No General Agents yet",createHint:"Create one from the Agents page",localHint:"Check the directory where Studio was started",waking:"Waking up",opening:"Opening",connecting:"Connecting",loadingMore:"Loading",loadMore:"Load more",runtimeTimeout:"Loading Agents timed out after 15 seconds. Check the network or Runtime service and retry.",loadGeneral:"Load General Agents",loadType:"Load {{type}}",connectGeneral:"Connect to General Agent",openLocal:"Open local Agent",openType:"Open {{type}}"},wae={spaceAria:"Skill spaces",configuration:"Skill customization settings",actions:{create:"Generate Skill",optimize:"Optimize Skill"},selectAction:"Select a Skill customization action",actionList:"Skill customization actions",style:"Style",selectStyle:"Select style",model:"Model",selectModel:"Select model",styles:{concise:"Concise and practical",strict:"Rigorous and reliable",tutorial:"Tutorial-friendly",automation:"Automation-first"},modelLoadFailed:"Failed to load model configuration",spaceLoadFailed:"Failed to load Skill Spaces",skillLoadFailed:"Failed to load Skills",unnamedSpace:"Unnamed Skill Space",space:"Skill Space",select:"Select Skill",selectAria:"Select Skill: {{skill}}",loadingSpaces:"Loading Skill Spaces",reload:"Reload",emptySpaces:"No Skill Spaces yet",skillList:"{{space}} Skill list",loadingSkills:"Loading Skills",emptySkills:"No Skills yet"},Oae={modes:{auto:"Auto detect",text_to_video:"Text to video",reference_to_video:"Reference to video",video_editing:"Video editing",video_extension:"Video extension",first_last_frame:"First and last frames"},taskNames:{auto:"Video generation",text_to_video:"Text-to-video",reference_to_video:"Reference-to-video",video_editing:"Video editing",video_extension:"Video extension",first_last_frame:"First-and-last-frame generation"},controls:{label:"Video creation settings",aspectRatio:"Aspect ratio",selectAspectRatio:"Select aspect ratio",resolution:"Resolution",selectResolution:"Select resolution",duration:"Duration",durationShort:"{{count}}s",durationAria:"Video duration: {{count}} seconds",lastFrame:"Last frame",lastFrameHelper:"Add the video's ending frame",assistImage:"Supporting image",referenceImage:"Reference image",assistImageHelper:"Add visual guidance",imageHelper:"Supports common image formats",referenceVideo:"Reference video",videoHelper:"Supports common video formats",optional:"Optional",replace:"Replace",add:"Add",upload:"Upload {{label}}",replaceFile:"Replace {{label}}: {{name}}",removeFile:"Remove {{label}} {{name}}",storageUnavailable:"Persistent storage is not configured",loadingEnhancer:"Loading prompt enhancement model",enhancerHint:"Uses {{model}} for intent recognition and prompt enhancement",enhancerUnavailable:"Prompt enhancement model unavailable"},task:{title:"Video generation task",closeAria:"Close video generation task dialog",progressAria:"Video generation progress",optimizedPrompt:"Optimized prompt",processingAria:"{{task}} progress",waitingAria:"{{status}}, elapsed {{elapsed}}",elapsed:"Elapsed {{elapsed}}",previewAria:"Generated video preview",close:"Close",download:"Download video",retryOptimization:"Retry prompt optimization",retryGeneration:"Retry video generation",providerQueued:"Waiting for model scheduling",providerRunning:"Model generating",providerSubmitting:"Submitting task",queuedHint:"The task was submitted. Its status will update automatically when processing begins.",runningHint:"This may take several minutes. The video preview will appear here when complete.",backgroundHint:"You can close this dialog. The task will continue in the background.",successHint:"Your video is ready to preview or download.",activationHint:"Activate the service in the model console, then retry generation.",retryHint:"Fix the issue and retry the current step.",steps:{optimizationFailed:"Prompt optimization failed",optimizationDone:"Prompt optimization complete",optimizationActive:"Optimizing prompt",generationDone:"{{task}} complete",generationFailed:"{{task}} failed",generationQueued:"{{task}} queued",generationRunning:"Generating {{task}}",generationActive:"{{task}} in progress",generationPending:"Waiting for video generation",generationComplete:"Video generation complete"},elapsedHours:"{{hours}}h {{minutes}}m",elapsedMinutes:"{{minutes}}m {{seconds}}s",elapsedSeconds:"{{seconds}}s"}},Sae={compactSelect:gae,featureNotice:bae,workspace:yae,mode:vae,agentPicker:xae,skill:wae,video:Oae},KDe=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:xae,compactSelect:gae,default:Sae,featureNotice:bae,mode:vae,skill:wae,video:Oae,workspace:yae},Symbol.toStringTag,{value:"Module"})),kae={cancel:"Cancel",close:"Close",retry:"Retry",tryAgain:"Try again",closeDialog:"Close {{title}}",agentFallback:"{{agent}} Agent",unknownSource:"Unknown source"},Eae={terminalTitle:"Terminal",browserTitle:"Sandbox browser",terminalSubtitle:"Connect to the interactive terminal for the current AgentKit Session",browserSubtitle:"View and control the browser in the current AgentKit Session",connecting:"Connecting…",connected:"Connected",notConnected:"Not connected",opening:"Opening {{title}}",connectingSession:"Connecting the tool to the current AgentKit Session.",openFailed:"Failed to open {{title}}"},Cae={title:"Resume Codex conversation",subtitle:"Select a recently updated Thread from the current Sandbox Session",loading:"Loading conversation history",loadFailed:"Failed to load conversation history",empty:"No conversations to resume"},Tae={title:"Codex permissions",subtitle:"Settings are saved to the current Sandbox Session and applied to all of its Threads",sandboxMode:"Sandbox mode",approvalPolicy:"Approval policy",approvalMethod:"Approval method",networkAccess:"Allow network access",networkAccessHelp:"Control external network access in workspace-write and read-only modes.",fullAccessWarning:"Full access disables file system and network isolation. Use it only for trusted tasks.",save:"Save permissions",sandboxChoices:{readOnly:{label:"Read only",detail:"Allow reading files without writing to the workspace."},workspaceWrite:{label:"Workspace write",detail:"Allow reading and modifying files in the current workspace."},fullAccess:{label:"Full access",detail:"Disable sandbox isolation for explicitly trusted tasks."}},approvalChoices:{untrusted:{label:"Untrusted commands only",detail:"Request approval only for operations Codex considers untrusted."},onRequest:{label:"On request",detail:"Allow Codex to ask you to approve commands or file changes when needed."},never:{label:"Never ask",detail:"Codex will not pause to request manual approval."}},reviewerChoices:{user:{label:"Ask me",detail:"Approval requests appear in Studio for you to decide."},autoReview:{label:"Automatic review",detail:"Use the Codex automatic review flow to handle approval requests."}}},Aae={title:"Workspace",subtitle:"Choose the directory where the current Codex Thread runs commands and modifies files",absolutePath:"Absolute path",browse:"Browse",parent:"Parent directory",empty:"This directory has no subdirectories",locked:"The conversation has started and the workspace is locked. Start a new Sandbox Session to choose another workspace.",useDirectory:"Use this directory"},_ae={fileTitle:"Allow file changes?",commandTitle:"Allow command execution?",subtitle:"Codex is waiting for your decision",workingDirectory:"Working directory",decline:"Decline",acceptOnce:"Allow once",acceptSession:"Allow for session"},Nae={availableSkills:"Available Skills",selectModel:"Select model",commands:"Codex shortcuts",currentModel:"Current: {{model}}",loadingSkills:"Discovering Skills in the current workspace…",loadingModels:"Loading models…",noSkillMatches:"No matching Skills in the current workspace",noModelMatches:"No matching models. You can also enter a model ID directly",noCommandMatches:"No matching shortcuts",skillFallback:"Load and run this Skill",add:"Add",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",openTerminal:"Open terminal",viewBrowser:"View browser",permissions:"Codex permissions",workspaceLocked:"The conversation has started and the workspace is locked",selectWorkspace:"Select workspace",workspace:"Codex workspace",endpointCopied:"Endpoint copied",copyEndpoint:"Copy Sandbox Endpoint",continuePlaceholder:"Describe what you want to implement or adjust next",messagePlaceholder:"Message the AgentKit Sandbox. Type / for commands or $ to invoke a Skill…",stop:"Stop generating",send:"Send"},jae={defaultName:"My Agent",namedDefault:"My {{agent}}",creatingTitle:"Creating {{agent}} Agent",failedTitle:"Launch failed",createTitle:"Create {{agent}} Agent",fallbackError:"AgentKit Sandbox initialization failed. Please try again later.",creatingDescription:"Creating the {{agent}} Agent and waiting for it to become ready. This usually takes about 30 seconds.",name:"Agent name",storageSize:"Storage size",storageHelp:"Data will be persisted. Choose {{min}}–{{max}} GiB.",persistent:"Persistent",persistenceUnsupported:"Snapshot persistence is not supported in the current environment",persistentHelp:"Keep Agent data so you can continue later.",temporaryHelp:"Agent data will be cleared after 8 hours",cancelCreation:"Cancel creation",confirm:"Create",retry:"Try again"},Rae={activeAria:"Codex Agent session is active",openAria:"Open a Codex Agent session",active:"Codex Agent session",entry:"Spark an idea",exit:"Exit current Agent",expired:"Expired",remainingHours:"{{hours}}h {{minutes}}m remaining",remainingMinutes:"{{minutes}}m remaining",expiryWarning:"The remote development environment is kept for up to 8 hours and expires at {{expiry}} ({{remaining}}). Conversations and files will then be deleted.",usingAgent:"You are currently using the {{agent}} Agent",activityAria:"Sandbox activity log",activity:"Activity log",tokenUsageAria:"Codex token usage",tokens:"{{label}}: {{value}} tokens",tokenLabels:{total:"Total",input:"Input",cachedInput:"Cached input",output:"Output",reasoningOutput:"Reasoning output"}},Iae={back:"Back to Agents",subtitle:"{{agent}} AgentKit Session details",type:"Agent type",status:"Status",createdBy:"Created by",snapshotStatus:"Snapshot status",toolType:"Tool type",createdAt:"Created at",snapshotReason:"Snapshot reason",expiresAt:"Expires at",snapshotId:"Snapshot ID",sessionId:"Session ID",sourceSessionId:"Source Session ID",delete:"Delete Agent",waking:"Waking…",opening:"Opening…",wake:"Wake Agent",open:"Open Agent",deleteTitle:"Delete Agent?",deleteDescription:"This will delete “{{name}}” and its AgentKit {{resource}}. This action cannot be undone.",deleting:"Deleting…",confirmDelete:"Delete"},Pae={back:"Back to Agents",createdBy:"Created by {{creator}}",ariaLabel:"Agent workspace",main:"Main",terminal:"Terminal",mainTitle:"{{agent}} main interface",openingTerminal:"Opening terminal…",terminalTitle:"{{agent}} terminal"},Dae={prompt:`Use the AgentKit Studio Plugin to hand off the current conversation, project, and task to the cloud. Execute this directly; do not ask me to open a terminal manually. +- Maintain a polite, professional tone.`},ase={requestFailed:"Request failed ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"The server does not have cloud provider credentials configured, so AgentKit agent centers are unavailable",loginRequired:"Sign in to access AgentKit agent centers"},vikingKnowledge:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB knowledge bases are unavailable",loginRequired:"Sign in to access VikingDB knowledge bases"},vikingMemory:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB memory stores are unavailable",loginRequired:"Sign in to access VikingDB memory stores"},mcpGateway:{missingHttpTool:"Go back to Add MCP tool and add at least one HTTP MCP service. MCP resilience does not support stdio services.",missingUrl:"An HTTP MCP tool is missing a valid service URL. Go back to Add MCP tool and complete it before publishing."},customModel:{fallbackName:"Custom model",apiKeyLabel:"{{name}} model API Key"},deploymentEnv:{serverInjected:"Provided by the server",selectedApiKeyPlaceholder:"Provided by the selected API Key",mcpInjectedComment:"Provided by the added MCP tools",restoredPlaceholder:"Securely restored by the Studio server",generatedMcpPlaceholder:"Generated from the added HTTP MCP tools",restoredHelp:"When updating, the Studio server merges MCP addresses and authentication without returning existing secrets to the browser.",mergedMcpHelp:"The Studio server merges MCP addresses and optional authentication without returning existing secrets to the browser.",listSeparator:", ",requirementHint:"Required by the following optimizations: {{labels}}.",requiredBy:"Required by the following optimizations: {{labels}}. Enter {{key}}.",required:"Enter {{label}} ({{key}}).",invalidJson:"Invalid JSON format"},drafts:{unsupportedVersion:"This local draft version is not supported. Upgrade Studio and try again.",invalidFormat:"The local draft data is invalid.",readFailed:"Could not read local drafts. The browser data may be corrupted.",quotaExceeded:"Browser storage is full, so the draft was not saved. Delete unused drafts or clear this site's storage, then try again.",writeRejected:"The browser blocked saving this draft. Check the site's storage permissions and try again."},skills:{searchFailed:"Search failed ({{status}})",downloadFailed:"Skill download failed ({{status}})",agentKitRequestFailed:"AgentKit Skills request failed",missingManifest:"{{location}} is missing SKILL.md",invalidParentPath:"{{location}} contains an invalid parent path (..): {{path}}",invalidPath:"{{location}} contains an invalid path: {{path}}",localDescription:"Local skill",folderSource:"Folder",noManifest:"No SKILL.md was found in {{location}}"},zip:{invalid:"Invalid zip: EOCD was not found",tooManyFiles:"A zip file cannot contain more than {{count}} files",tooLarge:"The extracted zip content is too large"}},ose={back:"Back to development session",runtimeName:"Runtime name",runtimeNameExists:"This Runtime name already exists. Choose another name.",checkingRuntimeName:"Checking Runtime name",verifiedSource:"Verified source",deployableSource:"Deployable source",verifiedByCodex:"Verified by Codex in the cloud",entryPoint:"Entry point",files:"Files",artifact:"Artifact",validationReport:"Validation report",verifiedHint:"The server materializes source from the verified artifact. Browser files cannot replace it.",unverifiedHint:"The server securely materialized the source. Confirm the Runtime configuration before deploying.",env:{requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}"}},lse={name:"Code package",back:"Back to creation methods",reading:"Reading the code package",readingEllipsis:"Reading the code package…",uploadFirst:"Upload a code package first",uploadAriaLabel:"Code package upload",upload:"Upload code package",reupload:"Upload a different code package",uploadPrompt:"Upload a code package",filesRecognized:"{{count}} files found. Select this area to upload a different package.",dropHint:"Select or drop a .zip file up to 50 MB. Use app.py or declare an entry point in agentkit.yaml.",viewFiles:"View files",chooseFile:"Choose code package",errors:{invalidFormat:"Choose a .zip code package.",tooLarge:"The code package must be 50 MB or smaller.",invalidPath:"The archive contains an invalid path: {{name}}",empty:"The archive does not contain any deployable files.",tooManyFiles:"A code package cannot contain more than {{count}} files.",duplicateFile:"The code package contains a duplicate file: {{path}}",manifestParse:"Could not parse agentkit.yaml: {{detail}}",manifestRoot:"The root of agentkit.yaml must be an object.",manifestCommon:"common in agentkit.yaml must be an object.",entryPointType:"common.entry_point in agentkit.yaml must be a file path.",entryPointInvalid:"common.entry_point in agentkit.yaml is not a valid file path.",entryPointMissing:"The entry point declared in agentkit.yaml is missing from the code package: {{entryPoint}}",defaultEntryPointMissing:"The code package root must contain app.py, or common.entry_point in agentkit.yaml must declare an existing entry point."}},cse={label:"Agent execution canvas",readOnlyLabel:"Read-only agent execution canvas",minimapLabel:"Execution flow minimap",controls:{ariaLabel:"Execution flow controls",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Fit view"},rootAgent:"Main agent",unnamedStep:"Unnamed step",terminals:{input:"User request",output:"Final response"},edges:{then:"Then",continueLoop:"Continue loop",call:"Call"},patterns:{llm:{label:"Agent",description:"Understand a task and complete one specific job"},sequential:{label:"Sequential",description:"Run internal steps one after another"},parallel:{label:"Parallel",description:"Run internal steps together, then combine their results"},loop:{label:"Loop",description:"Repeat internal steps until the stop condition is met"},a2a:{label:"Remote agent",description:"Call an existing remote agent"}},actions:{insertHere:"Insert a step here",deleteNamed:"Delete {{name}}",deleteNode:"Delete node",addSubagent:"Add subagent",addParallelStep:"Add a parallel step",addLoopStep:"Add a loop step",addNextStep:"Add next step",addFirst:"Add at the beginning",addLast:"Add at the end"}},use={title:"Intelligent mode",subtitle:"Describe your goal and Codex will plan, build, debug, and temporarily validate the agent in a sandbox.",model:{label:"Model",placeholder:"Select a model",retiring:"Retiring soon",currentConfiguration:"Current configuration",loadError:"Failed to load models"},availability:{checking:"Checking intelligent development availability…",unavailable:"Intelligent mode is currently unavailable. Go back and try again."},goal:{title:"Start with a goal",continueTitle:"Continue improving the project",hint:"Describe the problem your agent should solve. We will ask about any details that could affect the result.",continueHint:"Describe what you want to change. The result will be saved as a new version.",basedOn:"Based on",clearSelection:"Clear selection",label:"Goal",optimizationLabel:"Optimization goal",placeholder:"For example: Build an agent that reads sales data, creates weekly reports, and validates the output format",optimizationPlaceholder:"For example: Cite data sources and ask the user when information is incomplete"},actions:{preparing:"Preparing…",build:"Start building",optimize:"Start optimizing"},preparation:{accepted:"Goal received. Implementation is starting now.",preparing:"Creating the task environment…",starting:"Environment ready. Starting Codex…",next:"Next, Codex will plan the approach, then build, run, and validate the agent."}},dse={title:"Saved projects",description:"Continue improving an existing version, or view, download, and deploy its source.",refresh:"Refresh projects",checkingStorage:"Checking project storage…",unavailableTitle:"Projects are temporarily unavailable",storageCheckError:"Could not confirm project storage status. Try again shortly.",storageNotConfigured:"Project storage is not configured.",loadingMigrated:"Loading migrated projects…",loadingSaved:"Loading saved projects…",loadingVersions:"Loading project versions…",unknownTime:"Unknown time",sourceDownloaded:"Source downloaded.",projectSummary_one:"{{count}} version · Updated {{time}}",projectSummary_other:"{{count}} versions · Updated {{time}}",versionSummary_one:"{{time}} · {{count}} file",versionSummary_other:"{{time}} · {{count}} files",noVersionDescription:"No version description",latestVersion:"Latest version",verified:"Verified",pendingVerification:"Needs review",viewSource:"View source",download:"Download",downloading:"Downloading…",optimize:"Optimize",optimizeUnavailable:"Optimize, not supported",errors:{projects:"Could not load saved projects.",source:"Could not load project source.",versions:"Could not load project versions.",download:"Could not download the source.",prepareDeployment:"Could not prepare the source for deployment.",deleteVersion:"Could not delete the project version.",migrated:"Could not load migrated projects",saved:"Could not load saved projects"},empty:{migratedTitle:"No migrated projects yet",savedTitle:"No saved projects yet",migratedDescription:"Source will be saved here after your first migration.",savedDescription:"Source will be saved here after your first build.",noVersions:"This project has no available versions."},compare:{selected:"{{count}}/2 selected",selectedLabel:"Selected",select:"Select",view:"View comparison",start:"Compare versions"},delete:{title:"Delete this version?",onlyVersion:"“{{name}}” has only one version. Deleting it will also remove the project. This cannot be undone.",description:"This version's source and validation records will be permanently deleted. Other versions are not affected.",confirm:"Delete version"}},fse={title:"Choose how to create",subtitle:"Build your agent with the workflow that fits your needs",features:"Features",quick:{title:"Quick mode",description:"Delegate tasks to dynamically created subagents",features:{dynamicSubagents:"Dynamic subagents",autonomousPlanning:"Autonomous planning",collaboration:"Multi-agent collaboration",summary:"Automatic result summaries",skills:"Skills on demand",trace:"Traceable task execution"}},traditional:{title:"Advanced mode",description:"Customize your agent structure in detail",features:{visualConfig:"Visual configuration",migration:"Existing agent migration",debugging:"Live debugging",optimization:"Optional optimization",parameters:"Fine-grained controls"}}},hse={placeholder:"Enter a system prompt. Type ## followed by a space to add a level-two heading…",toolbar:{undo:"Undo {{shortcut}}",redo:"Redo {{shortcut}}",paragraph:"Paragraph",quote:"Quote",heading:"Heading {{level}}",selectBlockType:"Select text style",blockType:"Text style",bold:"Bold",removeBold:"Remove bold",italic:"Italic",removeItalic:"Remove italic",bulletedList:"Bulleted list",numberedList:"Numbered list"}},pse={local:{duplicatesSkipped:"Skipped duplicate skills: {{names}}",invalidDrop:"Drop a folder containing SKILL.md or a .zip file",readError:"Could not read the files: {{detail}}",dropLabel:"Drop a folder or ZIP file to detect skills automatically",hint:"Each skill must contain a SKILL.md file. Directories can contain multiple skills.",reading:"Reading files…",fileCount:"Local · {{count}} files"},hub:{searchError:"Search failed. Try again shortly.",searchPlaceholder:"Search Volcano Find Skill, such as data analysis or PDF",search:"Search",searching:"Searching…",noResults:"No matching skills found. Try another keyword.",hint:"Search Volcano Find Skill by keyword. Selected skills are downloaded to the skills/ directory when the project is generated."},space:{loadError:"Failed to load",loadingSpaces:"Loading AgentKit Skills centers…",noSpaces:"This account has no AgentKit Skills centers.",selectSpace:"Select an AgentKit Skills center",openConsole:"Open in the Volcano Engine console",loadingSkills:"Loading skills…",noSkills:"This AgentKit Skills center has no skills."}},mse={unnamedNode:"Unnamed node",editInstruction:"Select to edit instructions…",controls:{ariaLabel:"Workflow canvas controls",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Fit view"},sections:{info:"Workflow information",execution:"Execution mode",nodes:"Nodes",nodeConfig:"Node configuration"},types:{sequential:{label:"Sequential",description:"Run nodes one after another"},parallel:{label:"Parallel",description:"Run nodes at the same time"},loop:{label:"Loop",description:"Run nodes repeatedly"}},placeholders:{description:"Describe what this workflow does…",agentDescription:"Describe what this agent does…",instruction:"You are…"},errors:{workflowNameUnique:"The workflow name must be unique among agent node names",agentNameUnique:"Agent names must be unique within this workflow"},dragHint:"Drag onto the canvas, or use the button below",agentNode:"Agent node",addNode:"Add node",connectHint:"Drag between node handles to define the execution order.",create:"Create workflow",deleteNode:"Delete node",nameHelp:"Use only letters, numbers, and underscores. Names must be unique.",instruction:"Instructions",tools:"Tools (comma-separated)",nodeId:"Node ID",empty:{selectNode:"Select a node to edit its configuration",summary:"{{nodes}} nodes · {{edges}} connections"}},gse={ariaLabel:"Quick mode creation",progress:"Quick mode creation progress",steps:{agent:{label:"Agent",title:"Basic information",description:"Set the agent's name, purpose, behavior, and capabilities"},environment:{label:"Environment",title:"Configure the environment",description:"Choose the default environment or a custom environment you have built"},deployment:{label:"Deployment",title:"Deployment preferences",description:"Configure AgentKit cloud settings"}},model:{label:"Model",source:"Model source",name:"Model name",provider:"Provider",volcengineArk:"Volcano Ark",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",currentApiKey:"Current API Key",loadingApiKeys:"Loading API Keys",selectApiKey:"Select an API Key",searchApiKeys:"Search API Key names",noApiKeys:"No API Keys available",loadingModels:"Loading models",selectModel:"Select a model",searchModels:"Search by name, Model ID, or provider",noModels:"No models available",apiKeyPlaceholder:"Enter a model API Key",credentialsLoadError:"Failed to load model credentials",modelsLoadError:"Failed to load models"},identity:{unnamedPool:"Unnamed user pool",currentPool:"{{value}} (current user pool)",userPool:"User pool",loading:"Loading user pools",placeholder:"Select a user pool",search:"Search user pools",empty:"This account has no Identity user pools",currentHint:"This Studio's login JWT will be forwarded to the Runtime",mismatchHint:"The selected user pool is not used by this Studio, so the Studio will not be able to call the Runtime after deployment",selectionHint:"The user pool used by this Studio is marked in the list"},agent:{namePlaceholder:"Enter an agent name",descriptionPlaceholder:"Describe what this agent can do",prompt:"Prompt",promptPlaceholder:"Define the role, goals, and behavior boundaries",skills:"Skills",addSkill:"Add skills"},validation:{descriptionRequired:"Enter a description",promptRequired:"Enter a prompt",modelRequired:"Select a model",instanceIntegers:"Minimum instances must be an integer of 0 or greater, and maximum instances must be an integer greater than 0",instanceOrder:"Minimum instances cannot exceed maximum instances",userPoolRequired:"Select a user pool for Runtime authentication"},deployment:{runtimeName:"Runtime name",runtimeNameUpdateHint:"The existing Runtime name is preserved during updates",runtimeNameHint:"Use only letters, numbers, underscores, and hyphens",region:"Deployment region",authentication:"Authentication",apiKeyDescription:"Default: access with the Runtime API Key",userPoolDescription:"Use a JWT issued by an Identity user pool",sessionStorage:"Session storage",inMemoryStorage:"Temporary in-memory storage",backends:{sqlite:"SQLite file",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",inMemoryHint:"To prevent session loss across instances, keep the Runtime at 1–1 instances",networkMode:"Network mode",network:{public:"Public",private:"Private",both:"Public and private"},subnetIds:"Subnet IDs (optional, comma-separated)",sharedInternet:"Shared public egress in the VPC",sharedInternetHint:"Allow private Runtimes to access the public internet through shared egress",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",evaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment",resources:"Resource configuration",complete:"Deployment complete",preparing:"Preparing deployment…"},environmentVariables:{title:"Environment variables",add:"Add variable",nameAriaLabel:"Environment variable name",valueAriaLabel:"Value for {{name}}",deleteNamed:"Delete {{name}}"},actions:{updateAgain:"Update again",deployAgain:"Deploy again",updateAndPublish:"Update and publish"}},bse={actions:{addSubagent:"Add subagent",clearRoot:"Clear main agent",clearRootConfirmation:"Clear all settings and subagents from the main agent? This cannot be undone."},workspace:{progress:"Agent creation progress",modes:{build:"Build",validate:"Debug",optimize:"Optimize",environment:"Environment",publish:"Publish"},titles:{build:"Customize your agent architecture",validate:"Debug your agent",optimize:"Choose optimizations for your agent",environment:"Configure the cloud environment",publish:"Prepare your agent for deployment"}},sections:{type:{label:"Agent type",hint:"Choose an agent type"},basic:{label:"Basic information",hint:"Name, description, and system prompt"},model:{label:"Model",hint:"Model and service (optional)"},tools:{label:"Tools",hint:"Callable capabilities"},skills:{label:"Skills",hint:"Declarative skills"},knowledge:{label:"Knowledge base",hint:"External knowledge retrieval"},memory:{label:"Memory",hint:"Short-term and long-term memory"},subagents:{label:"Subagents",hint:"Nested collaboration"},review:{label:"Finish",hint:"Preview and create"}},agentTypes:{ariaLabel:"Agent type",remoteChildOnly:"Remote agents can only be used as child steps",llm:{label:"Agent",fullLabel:"LLM agent",description:"Uses an LLM to complete tasks autonomously"},sequential:{label:"Sequential",fullLabel:"Sequential agent",description:"Runs subagents one after another"},parallel:{label:"Parallel",fullLabel:"Parallel agent",description:"Runs subagents in parallel, then combines their results"},loop:{label:"Loop",fullLabel:"Loop agent",description:"Repeats subagents until the stop condition is met"},a2a:{label:"Remote agent",fullLabel:"Remote agent",description:"Calls a remote agent through the A2A protocol"}},basic:{agentName:"Agent name",name:"Name",agentDescription:"Agent description",descriptionPlaceholder:"Briefly describe what this agent does so your team can identify it…",nameHelp:"Follow Google ADK naming rules and keep the name unique in the execution flow.",rootDescriptionHelp:"The full description is preserved and converted to a Runtime-compatible single line during deployment.",descriptionHelp:"The description appears in agent lists and selectors.",orchestratorHelp:"This is a collaboration container and does not answer directly. Add task steps on the canvas and drag them to reorder.",maxIterations:"Maximum iterations",maxIterationsHelp:"The loop repeats its subagents until the condition is met or this limit is reached.",agentCenter:"AgentKit agent center",agentCenterHelp:"The remote agent's name, description, and capabilities come from the Agent Card returned by the center. The system discovers and attaches matching agents for each task.",moreOptions:"More options",systemPrompt:"System prompt",loadingMarkdown:"Loading Markdown editor…",markdownHelp:"Markdown shortcuts are supported. For example, type ## followed by a space to create a level-two heading.",unnamed:"Unnamed",unnamedAgent:"Unnamed agent"},validation:{remoteRoot:"A remote agent can only be a subagent",missingRegistry:"Select an AgentKit agent center",name:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name.",characters:"Start with a letter or underscore and use only letters, numbers, and underscores"},duplicateName:"Agent names must be unique within this structure",missingDescription:"Description is required",mcpAuthRequired:"Confirm how to handle authentication after changing the MCP address",mcpDuplicateName:"MCP names must be unique",mcpDuplicateUrl:"Remove the duplicate MCP endpoint before publishing",missingSubagent:"A subagent is required",missingPrompt:"System prompt is required",missingSubagentDetail:"Add at least one subagent to {{type}} before debugging or publishing.",problem:"{{name}}: {{problem}}"},ai:{ariaLabel:"Fill agent configuration with AI",minimumLength:"Enter at least {{count}} characters.",replaceConfirmation:"The generated configuration will replace the current canvas and settings. Continue?",placeholder:"Describe your goal and use {{model}} to generate the configuration",generate:"Generate",generating:"Generating",success:"Configuration generated",regenerate:"Generate again",failed:"Generation failed"},debug:{ariaLabel:"Agent debugging workspace",unavailable:"This backend does not currently support generated-agent debug runs.",baseline:"Baseline",comparison:"Variant {{count}}",selectModel:"Select a model",enterDescription:"Enter a description",enterPrompt:"Enter a system prompt",duplicateConfiguration:"Test configurations must be unique",starting:"Starting…",applyAndRestart:"Apply and restart",restart:"Restart",start:"Start environment",defaultModel:"Default model",testConfiguration:"Test configuration",deleteVariant:"Delete {{name}}",deleteVariantGroup:"Delete comparison variant",creatingEnvironment:"Creating the test environment…",configurationChanged:"The configuration changed. Restart the environment.",ready:"Environment ready",readyHint:"Send a message to compare agent responses.",startHint:"Complete the configuration, then start the environment.",viewTraceNamed:"View the trace for {{name}}",traceUnavailable:"Send a message to view its trace",trace:"Trace",useConfiguration:"Use this configuration",finishConfiguration:"Finish configuration",finishAndStart:"Finish and start",currentAgentModel:"Current agent model",configurationHint:"Changes apply only to this comparison. Select this configuration to continue to deployment.",messagePlaceholder:"Send a message to the running test environments…",startOneFirst:"Start at least one test environment first",addVariant:"Add variant",traceTitle:"Trace · {{name}}",leaveTitle:"Leave debugging?",leaveDescription:"The current environments will be removed when you leave. You can start new environments when you return.",cleaning:"Cleaning up…",confirmLeave:"Leave",closeLeaveConfirmation:"Close leave-debugging confirmation"},optimization:{ariaLabel:"Agent optimization options",scenario:"Optimization scenario",components:"Optimization components",bytePlusUnavailable:"Harness Sidecar optimizations are not available for BytePlus accounts yet. Leave all optimizations unselected to continue; regular BytePlus agents are not affected.",releaseScenario:"Optimization scenario: {{profile}}",profiles:{default:{label:"Custom",description:"Choose components as needed. The Sidecar stays off when none are selected."},ops:{label:"Operations",description:"For operations diagnostics, databases, logs, and monitoring MCP servers."}},groups:{quality:"Improve response quality",cost:"Reduce runtime cost",stability:"Improve runtime stability"},options:{context_engine:{label:"Context management",description:"Manage context assembly, task anchoring, and context budgets."},compressor:{label:"Context and result compression",description:"Compress long context and large tool results to reduce token usage."},verifier:{label:"Response verification and repair",description:"Verify evidence and responses, then repair or alert on failure."},long_run_control:{label:"Goal task control",description:"Manage progress, continuation, and completion conditions for Goal tasks."},mcp_resilience:{label:"MCP resilience",description:"Manage connections, timeouts, empty results, large responses, and call budgets. Includes read-only SQL protection by default."}}},model:{label:"Model",source:"Model source",volcanoArk:"Volcano Ark",volcengineArk:"Volcano Ark",bytePlusModelArk:"BytePlus ModelArk",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",configuration:"Model configuration",name:"Model name",provider:"Provider",liteLlmProviders:"LiteLLM providers",apiKeyPlaceholder:"Enter the model API Key",available:"Available",retiring:"Retiring soon",notActivated:"Not activated",unavailable:"Unavailable",apiKeyLoadError:"Failed to load Ark API Keys",loadingApiKeys:"Loading API Keys…",selectApiKey:"Select an API Key",currentApiKey:"Current API Key",apiKeyList:"API Key list",searchApiKey:"Search API Keys",searchApiKeyName:"Search API Key names",noApiKeys:"No API Keys available",noMatchingApiKey:"No matching API Keys",loading:"Loading models…",loaded:"{{count}} models loaded",loadError:"Failed to load models",selectModel:"Select a model",selectProviderModel:"Select a provider model",providerModels:"Provider models",search:"Search models",searchPlaceholder:"Search by name, Model ID, or provider",noMatches:"No matching models",empty:"No models available",unknownStatus:"Unknown status",refresh:"Refresh",refreshing:"Refreshing…",activate:"Activate",activateAction:"Open activation",currentConfiguration:"Current configuration"},tools:{builtIn:"Built-in tools",builtInHelp:"Select VeADK capabilities. Imports and required environment variables are added automatically.",codeExecution:"Code execution configuration",codeExecutionHelp:"Select the AgentKit code execution sandbox.",mcp:"MCP tools"},catalog:{web_search:{label:"Web search",description:"Get real-time information with Volcengine Web Search."},parallel_web_search:{label:"Parallel web search",description:"Run multiple search queries in parallel and combine the results faster."},link_reader:{label:"Link reader",description:"Fetch and read the main content from a URL."},web_scraper:{label:"Web scraper",description:"Crawl webpages into structured data. Requires the Scraper service."},image_generate:{label:"Image generation",description:"Generate images from text with Doubao Seedream."},image_edit:{label:"Image editing",description:"Edit or transform images with Doubao SeedEdit."},video_generate:{label:"Video generation",description:"Generate videos from text or images with Doubao Seedance, including task status queries."},text_to_speech:{label:"Text to speech (TTS)",description:"Convert text to speech with Volcengine Speech."},run_code:{label:"Code execution",description:"Run code in a sandbox."},vesearch:{label:"VeSearch",description:"Search with Volcengine VeSearch. Requires a bot endpoint."},links:{console:"Console",documentation:"Documentation"},env:{modelAgentName:{comment:"Model name"},embeddingModelName:{comment:"Embedding model required by memory and knowledge bases"},vikingMemoryProject:{comment:"VikingDB memory project"},vikingMemoryRegion:{comment:"VikingDB memory region"},vikingMemoryType:{comment:"Memory types"},feishuAppId:{comment:"Feishu app ID"},feishuAppSecret:{comment:"Feishu app secret",placeholder:"Enter the app secret"},registrySpaceId:{comment:"AgentKit agent center",placeholder:"Select an agent center"},registryTopK:{comment:"Number of agents to retrieve"},registryRegion:{comment:"AgentKit agent center region"},registryEndpoint:{comment:"AgentKit agent center OpenAPI endpoint"},agentKitToolId:{comment:"Code execution sandbox ID"},agentKitToolRegion:{comment:"AgentKit Tools region"},openVikingUrl:{comment:"OpenViking service URL"},openVikingMemoryUserId:{comment:"Memory owner ID",help:"The user segment in viking://user//peers//memories. Use it to isolate agents, tenants, or business scenarios. The default is default."},openVikingMemoryPolicy:{comment:"Memory policy",help:"Controls memory extraction and isolation. Leave it blank to use the official default policy."},openVikingKnowledgeUserId:{comment:"Knowledge base owner ID",help:"Used in the default path viking://user//resources// when no resource directory is configured. The default is default."},openVikingTargetUri:{comment:"Knowledge base resource directory",help:"Leave blank to generate it from the KnowledgeBase index. When provided, this OpenViking resource directory takes precedence."},tlsServiceName:{comment:"TLS topic_id. Leave blank to create one automatically"}}},backends:{shortTerm:{local:{label:"In-memory",description:"Stored in the process without persistence. Best for development and debugging."},sqlite:{label:"SQLite file",description:"Persist data to a local .db file."},mysql:{label:"MySQL",description:"Persist data to MySQL."},postgresql:{label:"PostgreSQL",description:"Persist data to PostgreSQL."}},longTerm:{local:{label:"Local vector store",description:"In-process llama-index vector store."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},redis:{label:"Redis",description:"Vector retrieval with Redis."},viking:{label:"VikingDB Memory",description:"VikingDB memory with user profile support."},openviking:{label:"OpenViking Memory",description:"Long-term memory that stores and retrieves preferences, events, and entities per user."},mem0:{label:"Mem0",description:"Managed memory from Mem0."}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB knowledge base."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},context_search:{label:"Context Search",description:"Volcengine Context Search without embedding configuration."},openviking:{label:"OpenViking Knowledge",description:"OpenViking resource-directory knowledge base without embedding configuration."}}},exporters:{apmplus:{label:"APMPlus",description:"Volcengine APMPlus application performance monitoring."},cozeloop:{label:"CozeLoop",description:"Distributed tracing with CozeLoop."},tls:{label:"TLS (Log Service)",description:"Export logs to Volcengine TLS."}},knowledge:{title:"Knowledge base",description:"Enable external knowledge retrieval (RAG) so the agent can answer from your data.",backend:"Knowledge base backend",vikingDatabase:"VikingDB knowledge base"},memory:{shortTerm:"Short-term memory",shortTermDescription:"Store context for one session",shortTermBackend:"Short-term memory backend",longTerm:"Long-term memory",longTermDescription:"Store context across sessions, usually with vector retrieval",longTermBackend:"Long-term memory backend",vikingDatabase:"VikingDB memory",autoSave:"Save sessions to long-term memory automatically",autoSaveDescription:"Write session content to long-term memory when a session ends."},mcp:{removeTool:"Remove MCP tool",namePlaceholder:"Name (optional)",urlPlaceholder:"MCP service URL",pathWarning:"This address does not end with /mcp. Confirm that it is the complete MCP service URL.",configuredPlaceholder:"Authentication is stored securely",tokenPlaceholder:"Bearer token (optional)",changedUrlWarning:"The MCP address changed. Choose how to handle the stored authentication.",reuseCredential:"Keep using it",replaceCredential:"Replace authentication",noAuth:"Use no authentication",reuseHint:"The stored authentication will be reused when you publish.",changeToReplace:"Replace instead",credentialConfigured:"Studio securely stores the authentication.",removeCredential:"Remove authentication",commandPlaceholder:"Command, such as npx",argsPlaceholder:"Arguments separated by spaces",stdioHint:"The stdio tool starts in the deployment environment. Make sure its command and dependencies are available.",addTool:"Add MCP tool"},resources:{unnamedAgentCenter:"Unnamed agent center",unnamedKnowledgeBase:"Unnamed knowledge base",unnamedMemory:"Unnamed memory store",loadError:"Failed to load",loadingAgentCenters:"Loading agent centers…",agentCentersLoaded:"{{count}} agent centers loaded",noAgentCenters:"No agent centers available",noMatchingAgentCenters:"No matching agent centers",searchAgentKitCenter:"Search AgentKit agent centers",searchNameOrId:"Search by name or ID",selectAgentCenter:"Select an agent center",selectAgentKitCenter:"Select an AgentKit agent center",selectedAgentCenter:"Selected agent center",agentKitCenter:"AgentKit agent center",refreshAgentCenters:"Refresh agent centers",knowledgeBaseList:"Knowledge base list",knowledgeBasePlaceholder:"Select a knowledge base",loadingKnowledgeBases:"Loading knowledge bases…",knowledgeBasesLoaded:"{{count}} knowledge bases loaded",noKnowledgeBases:"No knowledge bases available",noMatchingKnowledgeBases:"No matching knowledge bases",searchKnowledgeBase:"Search knowledge bases",selectKnowledgeBase:"Select a knowledge base",refreshKnowledgeBases:"Refresh knowledge bases",memoryList:"Memory store list",memoryPlaceholder:"Select a memory store",loadingMemories:"Loading memory stores…",memoriesLoaded:"{{count}} memory stores loaded",noMemories:"No memory stores available",noMatchingMemories:"No matching memory stores",searchMemory:"Search memory stores",selectMemory:"Select a memory store",refreshMemories:"Refresh memory stores"},env:{noAdditionalParameters:"This backend needs no additional runtime parameters.",invalidJson:"Enter valid JSON.",helpAriaLabel:"Help for {{label}}: {{help}}",openOpenViking:"Open OpenViking {{label}}",valuePlaceholder:"Enter a value",openVikingIndex:"OpenViking resource index",openVikingIndexHelp:"Leave blank to generate an index from the agent name, such as my_agent_kb. Without DATABASE_OPENVIKING_TARGET_URI, the default URI is viking://user/{knowledge base owner ID, or default}/resources/{resource index}/. When DATABASE_OPENVIKING_TARGET_URI is set, that complete URI is used instead.",openVikingIndexAriaLabel:"OpenViking resource index help: {{help}}"},deployment:{vpcRequired:"Enter a VPC ID when using VPC networking.",apiKeyRequired:"Select the API Key used by the model.",invalidEnvName:"Invalid environment variable name: {{key}}",requiredEnv:"{{name}}: enter this required environment variable",generatingConfiguration:"Generating deployment configuration",runtimeNameExists:"This Runtime name already exists. Choose another name and try again.",preparing:"Preparing deployment",complete:"Deployment complete",failed:"Deployment failed",updateAndPublish:"Update and publish",stages:{build:"Build image",deploy:"Deploy Runtime",publish:"Publish service",running:"Deploying"}},publish:{generating:"Generating publish configuration",validating:"Validating the agent structure and preparing the deployment snapshot…"}},yse={presets:{support:{name:"Customer support assistant",description:"Answer questions around the clock using your knowledge base and conversation history, with consistent and considerate responses.",instruction:"You are a professional and patient customer support assistant. Always use a courteous, friendly tone. Base answers on the knowledge base whenever possible. When the available information is insufficient, say so clearly and ask for the details you need instead of inventing an answer. Keep responses concise and well structured, and provide steps when useful.",subagents:{}},analyst:{name:"Data analyst",description:"Run code for statistics and visualization with tracing enabled, so every analysis is observable and reproducible.",instruction:"You are a rigorous data analyst. Clarify the objective and definitions before cleaning, analyzing, and visualizing data with executable code. Explain assumptions and methods at each step, support conclusions with key evidence, and identify possible bias or limitations.",subagents:{}},translator:{name:"Translation assistant",description:"Translate between Chinese and English accurately and naturally while preserving tone and terminology.",instruction:"You are a professional translator fluent in Chinese and English. Preserve the meaning of the source while producing natural language for the target audience. Keep proper nouns and technical terminology accurate and reflect the original tone and style. Return only the translation unless the user asks for an explanation.",subagents:{}},coder:{name:"Coding assistant",description:"Write, debug, and refactor code, validate it by running tests, and produce clear, maintainable implementations.",instruction:"You are a senior software engineer. Write correct, clear, maintainable code that follows the conventions and best practices of the target language. When uncertain, run the code to validate the implementation, cover important edge cases, and add concise comments for complex logic.",subagents:{}},researcher:{name:"Researcher",description:"Search primary sources online and combine them with knowledge and long-term memory to produce evidence-backed findings.",instruction:"You are a rigorous researcher. Break each question into key subproblems, collect multiple credible primary sources through web search, and cross-check the evidence before drawing conclusions. Cite sources, state uncertainty, distinguish facts from inference, and avoid overgeneralization.",subagents:{}},"research-team":{name:"Multi-agent research team",description:"Coordinate a researcher, analyst, and writer to produce an end-to-end research report.",instruction:"You coordinate a research team. Break down the user's research task, delegate search, analysis, and writing to the appropriate subagents, synthesize their work, and deliver a clear, evidence-backed report.",subagents:{0:{name:"Researcher",description:"Collect primary sources and data related to the topic online.",instruction:"You are the team's researcher. Find multiple credible sources about the topic, organize the key facts, data, and original citations, and hand them to the analyst without adding unsupported conclusions."},1:{name:"Analyst",description:"Cross-check and synthesize the collected material.",instruction:"You are the team's analyst. Cross-check, compare, and synthesize the research material. Extract insights, identify contradictions and uncertainty, and produce a structured set of findings."},2:{name:"Writer",description:"Turn the analysis into a clear report with reliable citations.",instruction:"You are the team's writer. Turn the analyst's findings into a clear, well-written report with consistent citations, ensuring every conclusion can be traced to a source."}}}},tags:{tools:"Tools",memory:"Memory",knowledgeBase:"Knowledge base",tracing:"Tracing",subagents:"{{count}} subagents"},gallery:{title:"Create from a template",subtitle:"Choose a prebuilt agent template and customize it to fit your needs."},detail:{back:"Back to templates",name:"Name",systemPrompt:"System prompt",model:"Model",tools:"Tools",memory:"Memory",knowledgeBase:"Knowledge base",tracing:"Tracing",subagents:"Subagents ({{count}})",create:"Create from this template",shortTermMemory:"Short-term",longTermMemory:"Long-term"}},vse={common:nse,yaml:ise,validation:rse,defaults:sse,helpers:ase,intelligentDeployment:ose,codePackage:lse,buildCanvas:cse,intelligent:use,projectLibrary:dse,modePicker:fse,promptEditor:hse,skills:pse,workflow:mse,workbench:gse,traditional:bse,template:yse},QDe=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:cse,codePackage:lse,common:nse,default:vse,defaults:sse,helpers:ase,intelligent:use,intelligentDeployment:ose,modePicker:fse,projectLibrary:dse,promptEditor:hse,skills:pse,template:yse,traditional:bse,validation:rse,workbench:gse,workflow:mse,yaml:ise},Symbol.toStringTag,{value:"Module"})),xse={backToList:"Back to scheduled tasks",cancel:"Cancel",cancelQueue:"Cancel queued run",cancelQueueFirst:"Cancel the queued run first",cancelling:"Cancelling…",closeDrawer:"Close panel",collapse:"Collapse",connectingRuntime:"Connecting to Runtime…",createScheduledTask:"Create scheduled task",createTask:"Create task",delete:"Delete",deleteTask:"Delete task",edit:"Edit",enable:"Enable",expand:"Expand",pause:"Pause",refresh:"Refresh",refreshHistory:"Refresh run history",rerun:"Run again",retry:"Retry",runNow:"Run now",saveChanges:"Save changes",saving:"Saving…",stop:"Stop run",stopRun:"Stop this run",stopRunFirst:"Stop the current run first",stopping:"Stopping…",viewDetails:"View details"},wse={cancelDescription:"This Session will be cancelled. Future scheduled runs will remain enabled.",cancelTitle:"Stop this run?",deleteDescription:"“{{name}}” and its complete run history will be permanently deleted.",deleteTitle:"Delete scheduled task?"},Ose={configuration:"Task configuration",nextRun:"Next run",pageLabel:"Scheduled task details",region:"Region",runtime:"Runtime",status:"Task status"},Sse={createTitle:"Create scheduled task",description:"Each trigger creates a separate Session for the Runtime Agent.",editTitle:"Edit scheduled task"},kse={minutesSeconds:"{{minutes}} min {{seconds}} sec",seconds:"{{count}} sec"},Ese={cronExpression:"Cron expression",cronHelp:"Enter minute, hour, day of month, month, and day of week.",dailyTime:"Daily run time",enableAfterCreate:"Enable after creation",enableHelp:"The task will run at its next scheduled time after it is enabled.",name:"Task name",namePlaceholder:"For example: Generate a daily operations summary",noRuntime:"No Runtime available",prompt:"Execution prompt",promptPlaceholder:"Enter the text to send to the Agent on every run",runAt:"Run time",runtimeAgent:"Runtime Agent",runtimeHelp:"The task always uses the Runtime's currently active version.",runtimePlaceholder:"Select a Runtime Agent",schedule:"Schedule",scheduleType:"Schedule type",timezone:"Time zone",weekday:"Day of week"},Cse={all:"All"},Tse={description:"Each run uses a separate Session. Results and errors are retained.",duration:"Duration: {{duration}}",emptyDescription:"Runs will appear here after the task is triggered or run manually.",emptyTitle:"No runs yet",errorDetails:"Error details",finalAnswer:"Final answer",loadFailed:"Unable to load run history",loadFailedDescription:"Check the Studio service and try again.",session:"Session",title:"Run history"},Ase={cancelRequested:"Stop request submitted.",created:"Task created.",deleted:"The task and its run history were deleted.",enabled:"Task enabled.",paused:"Task paused.",queued:"Task queued and will start within one minute.",requeued:"Task queued again and will start within one minute.",updated:"Task updated."},_se={filterLabel:"Filter scheduled tasks by status",listLabel:"Scheduled task list",loadFailed:"Unable to load scheduled tasks",loadFailedDescription:"Check the Studio service and try again.",title:"Cronjob"},Nse={cron:"Cron {{cron}}{{zone}}",daily:"Daily at {{time}}{{zone}}",once:"Once · {{date}}{{zone}}",weekly:"{{weekday}} at {{time}}{{zone}}"},jse={daily:"Daily",once:"Once",weekly:"Weekly"},Rse={cancelled:"Cancelled",enabled:"Enabled",failed:"Failed",notRun:"Not run yet",paused:"Paused",pending:"Preparing",queued:"Queued",retrying:"Retrying",running:"Running",skipped:"Skipped",success:"Succeeded"},Ise={cronFields:"A Cron expression must contain five fields, for example 0 9 * * *.",nameRequired:"Enter a task name.",promptRequired:"Enter the text to send to the Agent on each run.",runtimeAppMissing:"The Runtime Agent did not return an appName. Confirm that the Runtime is ready and compatible.",runtimeRequired:"Select an available Runtime Agent.",timeRequired:"Select a run time."},Pse={friday:"Friday",monday:"Monday",saturday:"Saturday",sunday:"Sunday",thursday:"Thursday",tuesday:"Tuesday",wednesday:"Wednesday"},zDe={actions:xse,confirm:wse,detail:Ose,drawer:Sse,duration:kse,fields:Ese,filters:Cse,history:Tse,notices:Ase,page:_se,schedule:Nse,scheduleTypes:jse,status:Rse,validation:Ise,weekdays:Pse},VDe=Object.freeze(Object.defineProperty({__proto__:null,actions:xse,confirm:wse,default:zDe,detail:Ose,drawer:Sse,duration:kse,fields:Ese,filters:Cse,history:Tse,notices:Ase,page:_se,schedule:Nse,scheduleTypes:jse,status:Rse,validation:Ise,weekdays:Pse},Symbol.toStringTag,{value:"Module"})),Dse="Report an issue",Mse="Description",Lse="Common issues",$se="Cancel",Fse="Done",Bse="Submit feedback",Use="Submitting…",Qse={title:"Feedback submitted. Thank you.",description:"The AgentKit team will review your report as soon as possible."},zse={close:"Close issue report",intro:"Select the issues you encountered and add any useful details.",privacy:"Your conversation data will be shared with the AgentKit team. Please protect sensitive information.",descriptionPlaceholder:"Describe what happened (optional)",issues:{slow:"Slow execution",crash:"Runtime crash",incorrect:"Inaccurate result",tool_error:"Tool call failed",other:"Other issue"}},Vse={description:"Tell us about a problem you encountered while using AgentKit Studio.",module:"Area",modules:{conversation:"Conversation",agents:"Agents",applications:"Automations",search:"Search",other:"Other"},commonIssuesMultiple:"Common issues (select all that apply)",issueTypes:"Issue types",issues:{page_slow:"Page loads slowly",feature_unavailable:"Feature unavailable",display_error:"Display issue",no_response:"Action has no response",other:"Other issue"},descriptionPlaceholder:"Describe the page, action, and what happened",quickAdd:"Quick add",suggestionsLabel:"Suggested descriptions",suggestions:{noResponse:"Nothing happens after I click",loading:"The page remains in a loading state",incomplete:"Some content is missing or clipped",error:"An error appears after the action"},privacy:"Your data will be shared with the AgentKit team. Please protect sensitive information."},HDe={title:Dse,descriptionLabel:Mse,commonIssues:Lse,cancel:$se,done:Fse,submit:Bse,submitting:Use,success:Qse,dialog:zse,page:Vse},qDe=Object.freeze(Object.defineProperty({__proto__:null,cancel:$se,commonIssues:Lse,default:HDe,descriptionLabel:Mse,dialog:zse,done:Fse,page:Vse,submit:Bse,submitting:Use,success:Qse,title:Dse},Symbol.toStringTag,{value:"Module"})),Hse={back:"Back",close:"Close"},qse={title:"Optimize migrated project",closeAria:"Close optimization dialog"},Wse={title:"Migrated projects",description:"Manage migrated source versions or continue optimizing any version.",libraryTitle:"Projects and versions",libraryDescription:"View, download, deploy, or compare source versions, or continue optimizing any version.",emptyTitle:"No migrated projects yet",emptyDescription:"Migrated source code will be saved here automatically."},Gse={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any (universal migration)"},Kse={awaitingUpload:"Awaiting upload",analyzing:"Analyzing",needsInput:"Needs input",analysisReady:"Awaiting confirmation",migrating:"Migrating",validating:"Validating",packaging:"Packaging",succeeded:"Completed",succeededWithWarnings:"Completed with notices",partial:"Partially completed",failed:"Failed",cancelled:"Stopped",expired:"Expired"},Xse={partialReady:"Migration output is ready, but delivery is incomplete. Review the migration notices.",readyWithWarnings:"Migration output is ready. Review the migration notices.",ready:"Migration output is ready."},Yse={passed:"Output verification passed",failed:"Output verification failed",degraded:"Output verification incomplete"},Zse={session:"Create migration environment",upload:"Upload project",analysis:"Analyze project"},Jse={agentNameRequired:"Enter an Agent name",agentNameInvalid:"Agent names must be 1–63 characters, contain only lowercase letters, numbers, and hyphens, and start and end with a letter or number"},eae={seconds:"{{seconds}} sec",minutesSeconds:"{{minutes}} min {{seconds}} sec"},tae={savedUnaffected:"Saved projects are unaffected",savingUnaffected:"Source is being saved and will be unaffected once complete",activeDetail:"Task history and temporary output will become unavailable after expiration",oneHour:"Temporary migration environment is retained for 1 hour",ended:"Temporary migration environment has ended",savedAvailable:"Saved projects remain available to view, download, deploy, or optimize",unavailable:"Task history and temporary output are no longer available",countdown:"Temporary migration environment ends in {{minutes}} min {{seconds}} sec",expiredSavedMessage:"The temporary migration environment has ended. Saved projects are unaffected.",expiredMessage:"The temporary migration environment has ended. Task history and temporary output are no longer available."},nae={recommended:"Recommended migration method",scope:"Migration scope",excluded:"Out of scope",viewEvidence:"View analysis evidence",viewAssumptions:"View key assumptions",viewSourceEvidence:"View source evidence"},iae={ariaLabel:"Codex activity",title:"Codex activity",startingAnalysis:"Codex is starting the analysis…",startingMigration:"Codex is starting the migration…",loadError:"Codex activity is temporarily unavailable. The current task is unaffected."},rae={title:"Migration output",fileTooLarge:"This file exceeds 2 MiB. Download the complete output to view it.",unsupportedPreview:"This file cannot be previewed here. Download the complete output to view it.",filesAria:"Migration output files",searchAria:"Search output files",searchPlaceholder:"Search files",limit:"Showing the first {{count}} items. Search for a specific file.",noSelection:"No file selected",noPreview:"No files available to preview.",loadingFile:"Loading output file…",startupFile:"Startup file",fileCountLabel:"Files",saved:"Source has been saved. You can view, download, deploy, or optimize it.",saving:"Output is ready and the source version is being saved.",deployReady:"Output is available to preview, download, and deploy. Waiting for source save status.",deployUnavailable:"Output is available to preview and download, but its current delivery status does not support deployment.",viewProjects:"View migrated projects",downloading:"Downloading…",downloadZip:"Download ZIP",deployTitle:"Deploy migration output",deployUnavailableTitle:"Current delivery status does not support deployment",deployRuntime:"Deploy to Runtime",fileCount:"{{count}} files",startup:"Startup file {{module}}",loading:"Loading migration output…"},sae={retiring:"Retiring soon",currentDefault:"Current default model",loadError:"Failed to load models",label:"Model",placeholder:"Select a model"},aae={zipOnly:"Select a local project in .zip format.",invalidName:"The ZIP file name is invalid. Rename the file and select it again.",tooLarge:"The project ZIP cannot exceed {{size}}.",empty:"The project ZIP cannot be empty.",removeAria:"Remove project ZIP",reselectPrompt:"Select the project ZIP again",selectPrompt:"Select or drop a local project ZIP",reselect:"Select again",selectZip:"Select ZIP",continue:"Continue upload",start:"Start migration",inputAria:"Select a local project ZIP",retention:"The temporary migration environment is retained for 1 hour after creation. Successfully saved source versions are unaffected."},oae={requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}",notReady:"Migration output is not ready yet.",back:"Back to migration results"},lae={backToAddAgent:"Back to Add Agent",title:"Migrate existing project",newMigration:"New migration",recent:"Recent migrations",sessionsAria:"Migration sessions",loadingSessions:"Loading migration sessions…",noSessions:"No migration sessions",heading:"Migrate an existing Agent project",intro:"Upload a local project ZIP. Codex will first perform a read-only analysis, then ask you to confirm the migration method."},cae={stop:"Stop migration",stopping:"Stopping…",reload:"Reload",refreshStatus:"Refresh status"},uae={unavailable:"Migration is currently unavailable",defaultReason:"Dev Sandbox is currently unavailable. Contact your administrator to check the configuration."},dae={requestZip:"Provide a local project ZIP. After upload, I’ll identify the framework, entry point, and migration boundaries, then ask you to confirm the migration method before making changes.",zipHint:"Only local ZIP files are supported, up to {{size}}. The migration environment is retained for 1 hour after creation.",creatingSandbox:"Creating Dev Sandbox",initializing:"Initializing the migration workspace and checking AgentKit CLI, Codex, and migration capabilities. The project will upload automatically when the environment is ready.",elapsed:"Elapsed: {{duration}}",uploadThenAnalyze:"Read-only analysis will start automatically after the ZIP upload completes.",analyzing:"Codex is identifying the framework, entry point, and migration boundaries. No migration changes are being made.",migrationLocked:"Attachments and migration settings cannot be changed while migration is running. Wait for the task to finish or stop it.",analysisPaused:"Read-only analysis is paused. Answer only the questions below. After submission, analysis will continue in the same environment without starting the migration.",analysisComplete:"Read-only analysis is complete. Review the recommendation and confirm the final migration method.",awaitingUpload:"The migration environment is ready. Select the local ZIP again to continue uploading.",expiredTitle:"Migration environment expired",expiredDescription:"Migration content and output can no longer be previewed, downloaded, or deployed. If the Runtime deployment completed, return to the Agents page to continue using it.",unsupportedTitle:"This ZIP cannot be migrated yet",unsupportedHint:"Update the project as instructed, then create a new migration and upload it again.",failedTitle:"Migration incomplete",cancelled:"This migration was stopped. Create a new migration and upload the project again."},fae={ariaLabel:"Provide project analysis details",title:"Additional information needed for analysis",description:"The attachment stays locked; submitting continues read-only analysis only",submitting:"Continuing analysis…",submit:"Submit and continue analysis"},hae={ariaLabel:"Confirm migration method",title:"Confirm migration method",description:"Migration starts only after confirmation",framework:"Migration method",frameworkPlaceholder:"Select a migration method",agentName:"Agent name",entry:"Project entry point",entryPlaceholder:"Select a project entry point",entryExample:"For example, agent.py:agent",consent:"By selecting “Confirm and start migration,” you confirm the migration scope, exclusions, and key assumptions above.",starting:"Starting migration…",start:"Confirm and start migration"},pae={closeAria:"Dismiss error",loadFailed:"Could not load migration data. Try again.",refreshFailed:"Could not refresh the migration status. Try again."},mae={title:"Stop the current migration?",description:"Stopping ends the current analysis or migration process. Completed steps will not continue."},WDe={common:Hse,optimization:qse,projects:Wse,framework:Gse,state:Kse,task:Xse,verification:Yse,transfer:Zse,validation:Jse,duration:eae,expiry:tae,analysis:nae,activity:iae,artifact:rae,model:sae,upload:aae,deployment:oae,workspace:lae,actions:cae,capability:uae,conversation:dae,questions:fae,confirmation:hae,errors:pae,stopDialog:mae},GDe=Object.freeze(Object.defineProperty({__proto__:null,actions:cae,activity:iae,analysis:nae,artifact:rae,capability:uae,common:Hse,confirmation:hae,conversation:dae,default:WDe,deployment:oae,duration:eae,errors:pae,expiry:tae,framework:Gse,model:sae,optimization:qse,projects:Wse,questions:fae,state:Kse,stopDialog:mae,task:Xse,transfer:Zse,upload:aae,validation:Jse,verification:Yse,workspace:lae},Symbol.toStringTag,{value:"Module"})),gae={loading:"Loading…",searchLabel:"Search {{label}}",searchPlaceholder:"Search {{label}}",retry:"Retry",noMatches:"No matches",noOptions:"No options available",selection:"{{label}}: {{value}}"},bae={badge:"All new",view:"See what's new",title:"What's new",defaultNotes:{multiRegion:"Multi-region agents: load Beijing and Shanghai Runtimes in parallel, with more available as you scroll.",switchAgent:"Switch in conversation: choose an agent beside the composer and start a new conversation immediately.",visualCanvas:"Visual execution canvas: inspect multi-agent structures on a horizontal canvas with fullscreen support."}},yae={label:"New conversation workspace",agent:"Agent",skill:"Skill customization",video:"Video creation"},vae={select:"Select conversation mode",agent:{label:"Agent",description:"Chat with the selected Agent"},builtin:{label:"Built-in Agent",description:"Use an Agent provided by the platform"},codex:{label:"Codex Agent",description:"Run tasks in a sandbox"},deepseekHarness:{label:"DeepSeek Harness",description:"Open the DeepSeek Harness workspace"},arkClaw:"ArkClaw",hermes:"Hermes Agent",checking:"Checking configuration",notConfigured:"Not configured by an administrator",unavailable:"Unavailable"},xae={recoveryPaused:"Some historical agents could not be restored after multiple attempts. Automatic recovery is paused.",restoringHistory:"Some historical agents are being restored and will appear automatically.",select:"Select Agent",typesLabel:"Agent types",listLabel:"{{type}} list",types:{agent:"Agent",general:"General Agent",codex:"Codex Agent",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw Agent",hermes:"Hermes Agent"},loading:"Loading Agents",reload:"Reload",empty:"No {{type}} yet",emptyLocal:"No local Agents yet",emptyGeneral:"No General Agents yet",createHint:"Create one from the Agents page",localHint:"Check the directory where Studio was started",waking:"Waking up",opening:"Opening",connecting:"Connecting",loadingMore:"Loading",loadMore:"Load more",runtimeTimeout:"Loading Agents timed out after 15 seconds. Check the network or Runtime service and retry.",loadGeneral:"Load General Agents",loadType:"Load {{type}}",connectGeneral:"Connect to General Agent",openLocal:"Open local Agent",openType:"Open {{type}}"},wae={spaceAria:"Skill spaces",configuration:"Skill customization settings",actions:{create:"Generate Skill",optimize:"Optimize Skill"},selectAction:"Select a Skill customization action",actionList:"Skill customization actions",style:"Style",selectStyle:"Select style",model:"Model",selectModel:"Select model",styles:{concise:"Concise and practical",strict:"Rigorous and reliable",tutorial:"Tutorial-friendly",automation:"Automation-first"},modelLoadFailed:"Failed to load model configuration",spaceLoadFailed:"Failed to load Skill Spaces",skillLoadFailed:"Failed to load Skills",unnamedSpace:"Unnamed Skill Space",space:"Skill Space",select:"Select Skill",selectAria:"Select Skill: {{skill}}",loadingSpaces:"Loading Skill Spaces",reload:"Reload",emptySpaces:"No Skill Spaces yet",skillList:"{{space}} Skill list",loadingSkills:"Loading Skills",emptySkills:"No Skills yet"},Oae={modes:{auto:"Auto detect",text_to_video:"Text to video",reference_to_video:"Reference to video",video_editing:"Video editing",video_extension:"Video extension",first_last_frame:"First and last frames"},taskNames:{auto:"Video generation",text_to_video:"Text-to-video",reference_to_video:"Reference-to-video",video_editing:"Video editing",video_extension:"Video extension",first_last_frame:"First-and-last-frame generation"},controls:{label:"Video creation settings",aspectRatio:"Aspect ratio",selectAspectRatio:"Select aspect ratio",resolution:"Resolution",selectResolution:"Select resolution",duration:"Duration",durationShort:"{{count}}s",durationAria:"Video duration: {{count}} seconds",lastFrame:"Last frame",lastFrameHelper:"Add the video's ending frame",assistImage:"Supporting image",referenceImage:"Reference image",assistImageHelper:"Add visual guidance",imageHelper:"Supports common image formats",referenceVideo:"Reference video",videoHelper:"Supports common video formats",optional:"Optional",replace:"Replace",add:"Add",upload:"Upload {{label}}",replaceFile:"Replace {{label}}: {{name}}",removeFile:"Remove {{label}} {{name}}",storageUnavailable:"Persistent storage is not configured",loadingEnhancer:"Loading prompt enhancement model",enhancerHint:"Uses {{model}} for intent recognition and prompt enhancement",enhancerUnavailable:"Prompt enhancement model unavailable"},task:{title:"Video generation task",closeAria:"Close video generation task dialog",progressAria:"Video generation progress",optimizedPrompt:"Optimized prompt",processingAria:"{{task}} progress",waitingAria:"{{status}}, elapsed {{elapsed}}",elapsed:"Elapsed {{elapsed}}",previewAria:"Generated video preview",close:"Close",download:"Download video",retryOptimization:"Retry prompt optimization",retryGeneration:"Retry video generation",providerQueued:"Waiting for model scheduling",providerRunning:"Model generating",providerSubmitting:"Submitting task",queuedHint:"The task was submitted. Its status will update automatically when processing begins.",runningHint:"This may take several minutes. The video preview will appear here when complete.",backgroundHint:"You can close this dialog. The task will continue in the background.",successHint:"Your video is ready to preview or download.",activationHint:"Activate the service in the model console, then retry generation.",retryHint:"Fix the issue and retry the current step.",steps:{optimizationFailed:"Prompt optimization failed",optimizationDone:"Prompt optimization complete",optimizationActive:"Optimizing prompt",generationDone:"{{task}} complete",generationFailed:"{{task}} failed",generationQueued:"{{task}} queued",generationRunning:"Generating {{task}}",generationActive:"{{task}} in progress",generationPending:"Waiting for video generation",generationComplete:"Video generation complete"},elapsedHours:"{{hours}}h {{minutes}}m",elapsedMinutes:"{{minutes}}m {{seconds}}s",elapsedSeconds:"{{seconds}}s"}},Sae={compactSelect:gae,featureNotice:bae,workspace:yae,mode:vae,agentPicker:xae,skill:wae,video:Oae},KDe=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:xae,compactSelect:gae,default:Sae,featureNotice:bae,mode:vae,skill:wae,video:Oae,workspace:yae},Symbol.toStringTag,{value:"Module"})),kae={cancel:"Cancel",close:"Close",retry:"Retry",tryAgain:"Try again",closeDialog:"Close {{title}}",agentFallback:"{{agent}} Agent",unknownSource:"Unknown source"},Eae={terminalTitle:"Terminal",browserTitle:"Sandbox browser",terminalSubtitle:"Connect to the interactive terminal for the current AgentKit Session",browserSubtitle:"View and control the browser in the current AgentKit Session",connecting:"Connecting…",connected:"Connected",notConnected:"Not connected",opening:"Opening {{title}}",connectingSession:"Connecting the tool to the current AgentKit Session.",openFailed:"Failed to open {{title}}"},Cae={title:"Resume Codex conversation",subtitle:"Select a recently updated Thread from the current Sandbox Session",loading:"Loading conversation history",loadFailed:"Failed to load conversation history",empty:"No conversations to resume"},Tae={title:"Codex permissions",subtitle:"Settings are saved to the current Sandbox Session and applied to all of its Threads",sandboxMode:"Sandbox mode",approvalPolicy:"Approval policy",approvalMethod:"Approval method",networkAccess:"Allow network access",networkAccessHelp:"Control external network access in workspace-write and read-only modes.",fullAccessWarning:"Full access disables file system and network isolation. Use it only for trusted tasks.",save:"Save permissions",sandboxChoices:{readOnly:{label:"Read only",detail:"Allow reading files without writing to the workspace."},workspaceWrite:{label:"Workspace write",detail:"Allow reading and modifying files in the current workspace."},fullAccess:{label:"Full access",detail:"Disable sandbox isolation for explicitly trusted tasks."}},approvalChoices:{untrusted:{label:"Untrusted commands only",detail:"Request approval only for operations Codex considers untrusted."},onRequest:{label:"On request",detail:"Allow Codex to ask you to approve commands or file changes when needed."},never:{label:"Never ask",detail:"Codex will not pause to request manual approval."}},reviewerChoices:{user:{label:"Ask me",detail:"Approval requests appear in Studio for you to decide."},autoReview:{label:"Automatic review",detail:"Use the Codex automatic review flow to handle approval requests."}}},Aae={title:"Workspace",subtitle:"Choose the directory where the current Codex Thread runs commands and modifies files",absolutePath:"Absolute path",browse:"Browse",parent:"Parent directory",empty:"This directory has no subdirectories",locked:"The conversation has started and the workspace is locked. Start a new Sandbox Session to choose another workspace.",useDirectory:"Use this directory"},_ae={fileTitle:"Allow file changes?",commandTitle:"Allow command execution?",subtitle:"Codex is waiting for your decision",workingDirectory:"Working directory",decline:"Decline",acceptOnce:"Allow once",acceptSession:"Allow for session"},Nae={availableSkills:"Available Skills",selectModel:"Select model",commands:"Codex shortcuts",currentModel:"Current: {{model}}",loadingSkills:"Discovering Skills in the current workspace…",loadingModels:"Loading models…",noSkillMatches:"No matching Skills in the current workspace",noModelMatches:"No matching models. You can also enter a model ID directly",noCommandMatches:"No matching shortcuts",skillFallback:"Load and run this Skill",add:"Add",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",openTerminal:"Open terminal",viewBrowser:"View browser",permissions:"Codex permissions",workspaceLocked:"The conversation has started and the workspace is locked",selectWorkspace:"Select workspace",workspace:"Codex workspace",endpointCopied:"Endpoint copied",copyEndpoint:"Copy Sandbox Endpoint",continuePlaceholder:"Describe what you want to implement or adjust next",messagePlaceholder:"Message the AgentKit Sandbox. Type / for commands or $ to invoke a Skill…",stop:"Stop generating",send:"Send"},jae={defaultName:"My Agent",namedDefault:"My {{agent}}",creatingTitle:"Creating {{agent}} Agent",failedTitle:"Launch failed",createTitle:"Create {{agent}} Agent",fallbackError:"AgentKit Sandbox initialization failed. Please try again later.",creatingDescription:"Creating the {{agent}} Agent and waiting for it to become ready. This usually takes about 30 seconds.",name:"Agent name",storageSize:"Storage size",storageHelp:"Data will be persisted. Choose {{min}}–{{max}} GiB.",persistent:"Persistent",persistenceUnsupported:"Snapshot persistence is not supported in the current environment",persistentHelp:"Keep Agent data so you can continue later.",temporaryHelp:"Agent data will be cleared after 8 hours",cancelCreation:"Cancel creation",confirm:"Create",retry:"Try again"},Rae={activeAria:"Codex Agent session is active",openAria:"Open a Codex Agent session",active:"Codex Agent session",entry:"Spark an idea",exit:"Exit current Agent",expired:"Expired",remainingHours:"{{hours}}h {{minutes}}m remaining",remainingMinutes:"{{minutes}}m remaining",expiryWarning:"The remote development environment is kept for up to 8 hours and expires at {{expiry}} ({{remaining}}). Conversations and files will then be deleted.",usingAgent:"You are currently using the {{agent}} Agent",activityAria:"Sandbox activity log",activity:"Activity log",tokenUsageAria:"Codex token usage",tokens:"{{label}}: {{value}} tokens",tokenLabels:{total:"Total",input:"Input",cachedInput:"Cached input",output:"Output",reasoningOutput:"Reasoning output"}},Iae={back:"Back to Agents",subtitle:"{{agent}} AgentKit Session details",type:"Agent type",status:"Status",createdBy:"Created by",snapshotStatus:"Snapshot status",toolType:"Tool type",createdAt:"Created at",snapshotReason:"Snapshot reason",expiresAt:"Expires at",snapshotId:"Snapshot ID",sessionId:"Session ID",sourceSessionId:"Source Session ID",delete:"Delete Agent",waking:"Waking…",opening:"Opening…",wake:"Wake Agent",open:"Open Agent",deleteTitle:"Delete Agent?",deleteDescription:"This will delete “{{name}}” and its AgentKit {{resource}}. This action cannot be undone.",deleting:"Deleting…",confirmDelete:"Delete"},Pae={back:"Back to Agents",createdBy:"Created by {{creator}}",ariaLabel:"Agent workspace",main:"Main",terminal:"Terminal",mainTitle:"{{agent}} main interface",openingTerminal:"Opening terminal…",terminalTitle:"{{agent}} terminal"},Dae={prompt:`Use the AgentKit Studio Plugin to hand off the current conversation, project, and task to the cloud. Execute this directly; do not ask me to open a terminal manually. Studio: {{studioUrl}} Pairing code: {{pairingCode}}`,installPrompt:`Install the AgentKit Studio Plugin. Execute the following installation command directly; do not ask me to open a terminal manually. Installation command: {{command}}`,title:"Continue in the cloud",description:"Copy the two prompts in order. Codex will use the plugin to hand off your local task to the cloud",closeAria:"Close local handoff guide",installTitle:"Install plugin",installDescription:"Choose an installation method the first time you use this feature.",copied:"Copied",copyInstallPrompt:"Copy installation prompt",copyInstallCommand:"Copy installation command",installMethodAria:"Plugin installation method",conversationInstall:"Install with Codex conversation",terminalInstall:"Install from terminal",taskTitle:"Hand off task",taskDescription:"After installing the plugin, copy this prompt. Codex will migrate the current project and continue the task.",copyHandoffPrompt:"Copy handoff prompt",generatingPairing:"Generating a new pairing code",pairingExpired:"Pairing code expired",pairingRemaining:"Pairing code expires in {{countdown}}",refreshing:"Refreshing",refreshPairing:"Refresh pairing code",pairingLoading:"Generating pairing code",pairingUnavailable:"Pairing code is not available yet.",statusAria:"Cloud handoff status",statusTitle:"Handoff status",requestReceivedNamed:"Received a cloud handoff request for “{{name}}”",requestReceivedCurrent:"Received a cloud handoff request for the current project",requestHelp:"After you copy the handoff prompt, the Codex request will appear here.",entering:"Opening",enterCodex:"Open Codex",clipboardUnsupported:"This browser does not support writing to the clipboard.",steps:{request:"Wait for local request",session:"Create cloud Session",restore:"Restore project",continue:"Send continuation task"},status:{issued:"Waiting for request",creating:"Creating Session",sessionCreated:"Migrating project",continuing:"Starting cloud task",running:"Running in the cloud",completed:"Handoff complete",failed:"Handoff failed"}},Mae={model:{description:"Show or switch the current conversation model",keywords:"model switch"},models:{description:"List models available from app-server",keywords:"model list"},skill:{description:"Browse and invoke a Skill available in the current workspace",keywords:"skill workflow"},skills:{description:"Browse and invoke Skills available in the current workspace",keywords:"skills workflow list"},new:{description:"Start a new conversation",keywords:"new conversation"},resume:{description:"Open conversation history or resume a specific Thread",keywords:"history resume session"},fork:{description:"Fork a new conversation from the current context",keywords:"fork branch"},compact:{description:"Compact the current conversation context",keywords:"compact context"},archive:{description:"Archive the current conversation and start a new one",keywords:"archive close"},status:{description:"Show connection, Thread, model, and token status",keywords:"status connection token"},clear:{description:"Clear the current view and start a new conversation",keywords:"clear reset"},help:{description:"Show Sandbox shortcuts",keywords:"help commands"},currentModel:"Current model",availableModel:"Available model",workspace:"Workspace",notSet:"Not set",modelLabel:"Model",statusLabel:"Status",running:"Running",idle:"Idle",totalTokens:"Total tokens",contextWindow:"Context window",imageFallback:"Image",unknown:"Unknown shortcut: {{command}}. Type /help to see available commands.",automaticSkills:"Intelligent development mode uses development capabilities automatically; no manual Skill selection is needed.",activity:{new:"Started a new Codex conversation",resumed:"Resumed Codex conversation",deleted:"Deleted Codex conversation history",modelChanged:"Switched Codex model",availableModels:"Available Codex models",noModels:"No models are currently available",forked:"Forked Codex conversation",compacting:"Started compacting the current Codex conversation",archived:"Archived Codex conversation",status:"Current Codex status",help:"Codex shortcuts supported by Sandbox"}},Lae={common:kae,tool:Eae,threads:Cae,permissions:Tae,workspace:Aae,approval:_ae,composer:Nae,launch:jae,session:Rae,agentDetails:Iae,agentWorkspace:Pae,handoff:Dae,commands:Mae},XDe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:Iae,agentWorkspace:Pae,approval:_ae,commands:Mae,common:kae,composer:Nae,default:Lae,handoff:Dae,launch:jae,permissions:Tae,session:Rae,threads:Cae,tool:Eae,workspace:Aae},Symbol.toStringTag,{value:"Module"})),$ae={retry:"Try again",signInToContinue:"Sign in to continue",signInWith:"Sign in with {{provider}}",enterUsername:"Enter a username to get started",usernamePlaceholder:"Username (letters and numbers, up to 16 characters)",enter:"Continue",usernameInvalid:"Use letters and numbers only, up to 16 characters.",identityProvider:{volcengine:"Volcengine Identity",byteplus:"BytePlus Identity"},powered:{volcengine:"Volcengine AgentKit provides enterprise-grade Agent solutions",byteplus:"BytePlus AgentKit provides enterprise-grade Agent solutions"},legalPrefix:"By continuing, you acknowledge that you have read and agree to the AgentKit",terms:"Product and Service Terms",copyright:"© {{year}} VeADK. All rights reserved."},Fae={title:"Your session has expired",description:"Your current edits are preserved. The previous action will continue after you sign in again.",waiting:"Waiting for sign-in…",signInAgain:"Sign in again"},Bae={breadcrumbs:"Breadcrumbs",selectAgent:"Select Agent",switchAgent:"Switch Agent"},Uae={cancel:"Cancel",close:"Close confirmation dialog"},YDe={login:$ae,authExpired:Fae,navbar:Bae,confirm:Uae},ZDe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:Fae,confirm:Uae,default:YDe,login:$ae,navbar:Bae},Symbol.toStringTag,{value:"Module"})),Qae={defaultUser:"User",shortcuts:"Quick access",tryCli:"Try AgentKit CLI",developerResources:"Developer resources",systemInfo:"System information",language:"Language",issueFeedback:"Report an issue",logout:"Sign out",roles:{admin:"Administrator",developer:"Developer",user:"User"}},zae={home:"Back to home",expand:"Expand sidebar",collapse:"Collapse sidebar",label:"Main navigation",newChat:"New chat",agents:"Agents",workspaces:"Workspaces",library:"Library",cronjobs:"Cronjob",automations:"Automations"},Vae={title:"Chat history",newConversation:"New conversation",create:"New chat",loading:"Loading chat history…",empty:"No conversations yet",current:"Current",manage:"Manage conversation: {{title}}",more:"More",delete:"Delete",loadingMore:"Loading…",loadMore:"Load more",evaluatingTitle:"Running automatic evaluation",evaluating:"Evaluating",generating:"Generating"},JDe={account:Qae,navigation:zae,history:Vae},eMe=Object.freeze(Object.defineProperty({__proto__:null,account:Qae,default:JDe,history:Vae,navigation:zae},Symbol.toStringTag,{value:"Module"})),Hae={placeholder:"Select an option",collapseOptions:"Collapse model options",expandOptions:"Expand model options",noOptions:"No options available",noMatches:"No matches. You can use the current model ID directly."},qae={unsupportedActivity:"Unsupported Skill conversation activity",ariaLabel:"Skill generation conversation"},Wae={code:"Error code: {{code}}",type:"Error type: {{type}}",representation:"Exception representation: {{value}}",rawResponse:`Raw server response: -{{value}}`,original:"Original error: {{message}}",details:"Details"},Gae={ariaLabel:"Skill file tree",viewSource:"View source",viewPreview:"View preview",download:"Download",binaryFile:"Binary file",bytes:"{{value}} bytes",binaryDescription:"The current API returns file metadata only. Download the original file separately.",metadata:"Skill metadata",noFiles:"No files"},Kae={close:"Close",name:"Name",region:"Region",optionalDescription:"Description (optional)",cancel:"Cancel",create:"Create",creating:"Creating…",save:"Save",saving:"Saving…",upload:"Upload",uploading:"Uploading…",createSpaceTitle:"New Skill Space",editSpaceTitle:"Edit Skill Space",uploadTitle:"Upload to {{name}}",createSpaceFailed:"Failed to create the Skill Space",updateSpaceFailed:"Failed to update the Skill Space",archiveValidationFailed:"Skill ZIP validation failed",uploadFailed:"Failed to upload the Skill",dropzone:"Drop a Skill ZIP here",chooseLocalFile:"or click to choose a local file",archiveHelp:"The ZIP root must contain SKILL.md, or a single wrapping directory. Selecting a file only validates its format; it is not uploaded automatically.",validating:"Checking file format…",validationPassed:"Format check passed: {{name}}, {{count}} file(s)"},Xae={styles:{concise:"Concise and practical",strict:"Rigorous and robust",tutorial:"Tutorial-friendly",automation:"Automation-first",custom:"Custom",customFallback:"Custom style"},stages:{preparing:"Preparing Dev Sandbox",ready:"Skill generated and format validation passed",failed:"Generation failed",cancelled:"Stopped",validating:"Validating Skill format",packaging:"Organizing files",generating:"Generating Skill",repairingAgain:"Repairing again",autoRepairing:"Auto-repairing ({{attempt}}/{{max}})"},validation:{fallback:"Skill format validation failed",repairInstruction:"Fix only the Skill format errors listed below. Do not change the original purpose or scope.",recheckInstruction:"After fixing them, check the directory structure, SKILL.md frontmatter, and all text files again.",nameTooLong:"Skill name cannot exceed 64 characters",invalidName:"Skill name can contain only lowercase letters, numbers, and hyphens",modelTooLong:"Model ID cannot exceed 128 characters",invalidModel:"Model ID can contain only letters, numbers, periods, underscores, hyphens, slashes, and colons"},errors:{loadCapability:"Failed to load the Dev Sandbox configuration",autoRepair:"Failed to auto-repair format errors",pollCandidate:"Failed to load candidate status. Retrying.",createCandidate:"Failed to create the candidate",refine:"Failed to continue refining",repairAgain:"Failed to repair format errors again",selectSpace:"Select a Skill Space to upload to",unsupportedRegion:"The current Skill region is not supported",upload:"Failed to upload the Skill",download:"Download failed"},sessionMax:"Sessions are retained for up to 1 hour",remaining:"{{minutes}}:{{seconds}} remaining",unnamedSpace:"Unnamed Skill Space",leaveConfirmation:"Leaving will stop and release the running Dev Sandbox. Leave anyway?",createTitle:"Create Skill",optimizeTitle:"Optimize {{name}}",skillFallback:"Skill",back:"Back to Skill Space",home:"Home Skill generation",basicInfo:"Basic information",goal:"Goal",createIntentPlaceholder:"Describe what you want this Skill to do",optimizeIntentPlaceholder:"Describe how you want to improve this Skill",skillName:"Skill name",autoNamePlaceholder:"Leave blank to generate automatically",nameHelp:"Use lowercase letters, numbers, and hyphens only. Leave blank to generate automatically.",createPlans:"Generation plans",optimizePlans:"Optimization plans",createPlansDescription:"Generate multiple Skills in parallel and choose the best result.",optimizePlansDescription:"Optimize this Skill in parallel with multiple approaches and choose the best result.",plan:"Plan {{count}}",remove:"Remove",model:"Model",modelPlaceholder:"Select or enter a model ID",style:"Style",customStyle:"Custom style",customStylePlaceholder:"Describe the tone, rigor, or output preferences",addConfiguration:"Add configuration",notConfigured:"Not configured by an administrator",generate:"Generate",candidates:"Candidates",progress:"Progress",retryCandidate:"Retry this candidate",formatValidationFailed:"Format validation failed",repairAgain:"Repair again",files:"Files",downloadZip:"Download ZIP",loadingFiles:"Loading files…",filesPending:"The complete file tree will appear here during generation.",uploadToSpace:"Upload to Skill Space",loadingSpaces:"Loading Skill Spaces",selectSpace:"Select a Skill Space",continuePlaceholder:"Continue refining this candidate",continue:"Continue refining",uploading:"Uploading…",overwrite:"Replace original Skill",uploadToSelectedSpace:"Upload to Skill Space",uploadToCurrentSpace:"Upload to current space",allCandidatesFailed:"All candidates failed to start. Retry each candidate separately."},Yae={invalidFormat:"{{label}} has an invalid format.",recoveryStatus:"Skill recovery status",errorResponse:"error response",errorDetails:"error details",missingContentType:"Content-Type missing",gatewayError:"{{fallback}} (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",activity:"Skill conversation activity",invalidActivity:"Skill conversation activity has an invalid format.",invalidToolActivity:"Skill tool activity has an invalid format.",invalidTextActivity:"Skill text activity has an invalid format.",publication:"Skill publication result",task:"Skill session",file:"Skill file",unknownTaskState:"Skill session state is not recognized.",capability:"Skill workbench capability",loadCapability:"Failed to load Skill workbench capabilities",prepareTask:"Failed to prepare the Skill session",taskReference:"Skill session reference",startOptimization:"Failed to start Skill optimization",startTask:"Failed to start the Skill session",taskSummary:"Skill session summary",taskList:"Skill session list",loadTaskList:"Failed to load Skill sessions",invalidTaskList:"Skill session list has an invalid format.",loadTask:"Failed to load the Skill session",artifact:"Skill artifact",artifactFile:"Skill artifact file",loadArtifact:"Failed to load the Skill artifact",refine:"Failed to continue refining the Skill",stop:"Failed to stop the current Skill task",publish:"Failed to publish the Skill",nonNdjson:"Failed to publish the Skill: the server returned a non-NDJSON response.",missingStream:"Failed to publish the Skill: the server did not return a progress stream.",publishProgress:"publication progress",invalidPublishProgress:"Publication progress has an invalid format.",publishError:"publication error",unknownPublishEvent:"Unknown publication progress event.",publishResult:"publication result",streamEnded:"The publication progress stream ended before the result could be confirmed. Refresh Skill Center to check the status.",deleteTask:"Failed to delete the Skill session",download:"Failed to download the Skill"},Zae={configSelect:Hae,conversation:qae,errorDetails:Wae,fileTree:Gae,management:Kae,generation:Xae,api:Yae},tMe=Object.freeze(Object.defineProperty({__proto__:null,api:Yae,configSelect:Hae,conversation:qae,default:Zae,errorDetails:Wae,fileTree:Gae,generation:Xae,management:Kae},Symbol.toStringTag,{value:"Module"})),Jae={back:"Back",reload:"Reload",notConfigured:"Not configured",name:"Name",description:"Description",delete:"Delete",save:"Save",saving:"Saving",add:"Add",manage:"Manage",environment:"Environment",noDescription:"No description",refresh:"Refresh",close:"Close",retry:"Retry",loading:"Loading…",previousPage:"Previous page",nextPage:"Next page",edit:"Edit",all:"All",search:"Search",cancel:"Cancel",view:"View",viewDetails:"View details",deleting:"Deleting…",create:"Create",creating:"Creating",adding:"Adding",generating:"Generating",uploading:"Uploading",preview:"Preview",loadFailed:"Failed to load",select:"Select",collapse:"Collapse",expand:"Expand",none:"None"},eoe={ariaLabel:"AgentKit shortcuts",closeAriaLabel:"Close the AgentKit welcome card",title:"Welcome to AgentKit",description:"Build and host enterprise Agents quickly with AgentKit",docsAriaLabel:"Open AgentKit documentation in a new window",docs:"Documentation",consoleAriaLabel:"Open the AgentKit console in a new window",console:"Console"},toe={checkUpdates:"Check for updates",checkingVersions:"Checking versions…",versionCheckError:"Unable to check sandbox versions. Check credentials, region and API permissions, then retry.",sandboxUpdateError:"Sandbox update failed. Refresh its status before retrying.",modelEnvRepairUnavailable:"Cannot repair model configuration. Check CODEX_API_KEY and CODEX_BASE_URL.",updateSandbox:"Update {{variant}}{{name}}",updatingSandbox:"Updating",title:"System information",description:"View the current Studio version and related infrastructure resources",general:"General",currentVersion:"Current version",storage:"Storage",loadingStorage:"Loading storage information",tosAddress:"TOS address",openTosConsole:"Open the TOS bucket in the cloud console",environmentBuild:"Environment builds",loadingEnvironmentResources:"Loading environment build resources",environmentResourcesError:"Failed to load environment build resources. Check the cloud credentials and try again.",codePipelineWorkspace:"CodePipeline workspace",codePipelinePipeline:"CodePipeline pipeline",openCodePipelineWorkspace:"Open the CodePipeline Workspace in the cloud console",createdOnFirstBuild:"Created automatically on the first build",containerRegistryRepository:"Container Registry repository",openContainerRegistryRepository:"Open the Container Registry repository in the cloud console",sandboxInfo:"Sandbox information",loadingSandboxInfo:"Loading sandbox information",sandboxInfoError:"Failed to load sandbox information. Try again.",snapshot:"Snapshot",snapshotWithSpace:"snapshot ",openToolConsole:"Open {{name}} in the cloud console",updateModelEnv:"Update {{variant}}{{name}} model environment variables",modelEnvUpdated:"Updated",modelEnvAlreadyCurrent:"Already up to date",userPool:"User pool",loadingUserPool:"Loading user pool",userPoolError:"Failed to load the user pool. Try again.",modelEnvUpdateError:"Failed to update model environment variables. Try again.",openUserPoolConsole:"Open user pool {{name}} in the cloud console",unnamedUserPool:"Unnamed user pool",id:"ID",domain:"Domain",region:"Region",noLocalUserPool:"No user pool is configured in local mode",noUserPool:"No user pool is configured for this Studio"},noe={workspace:"Agent workspace",library:"Agent library",evaluation:"Evaluation",agentList:"Agent list",agentDetails:"Agent details",newAgent:"New Agent",loading:"Loading…",loadingCloudAgents:"Loading cloud Agents…",noAgentSelected:"Select an Agent",local:"Local",remote:"Cloud",localAgent:"Local Agent",remoteAgent:"Cloud Agent",agentCount:"{{count}} Agents",agentCountLabel:"Agent count",details:"Details",chat:"Chat",update:"Update",backToAgentList:"Back to Agent list",loadingAgent:"Loading Agent",loadingAgentDescription:"Loading Agent configuration and Runtime information.",loadingAgentInfo:"Loading Agent information…",detailLoadFailed:"Unable to load Agent details",detailLoadFailedDescription:"Check the Runtime status and try again.",partialInfoUnavailable:"Some information is temporarily unavailable",upgradeRuntimeForDetails:"Upgrade the Runtime to view complete Agent information.",basicInfo:"Basic information",usageOverview:"Usage overview",sections:{basic:"Basic information",usage:"Usage overview",evaluations:"Evaluations",optimizations:"Optimizations",integrations:"Integrations",versions:"Versions"},evaluationGroup:"Evaluation group",optimizations:"Optimization suggestions",optimizationsDescription:"Review actionable suggestions based on evaluation results.",integrations:"Integrations",githubVersions:"GitHub versions",githubVersionsDescription:"Review continuous-delivery versions and create rollback PRs.",currentVersionOnly:"GitHub continuous delivery is not enabled. Only the current production version is shown.",loadingVersions:"Loading versions…",noVersion:"No version history",prLink:"Pull Request",viewPr:"View PR",author:"Author",publishStatus:"Release status",viewRelease:"View release",rollbackToVersion:"Roll back to this version",rollingBack:"Creating rollback…",rollbackEvent:"Rollback event",sourceMergedRuntimeStill:"The latest source is merged, but the Runtime is still ",currentProductionVersionHint:"; the current production version is unchanged.",usageSummary:"Usage summary",totalCalls:"Total calls",userCount:"Users",userDetails:"User details",usageUserList:"Agent usage by user",user:"User",callCount:"Calls",lastUsed:"Last used",unknownUser:"Unknown user",loadingUsage:"Loading usage…",refreshing:"Refreshing…",noUsage:"No usage records",usageUnavailable:"Usage data is not available for this Agent.",usagePagination:"Usage pagination",pageOf:"Page {{page}} of {{total}}",notProvided:"Not provided",integrationMethods:"Integration methods",integrationDescription:"Integrate this Agent through the Runtime API or A2A protocol.",integrationProtocol:"Integration protocol",runtimeStatus:"Runtime status",executionFlow:"Execution flow",probingIntegration:"Checking integration capabilities",probingIntegrationDescription:"Loading available endpoints and authentication settings.",configurationStatus:"Configuration status",discoveryEndpoint:"Discovery endpoint",invocationEndpoint:"Invocation endpoint",invocationUrl:"Invocation URL",authentication:"Authentication",networkAccess:"Network access",notAvailable:"Not available",noAuthentication:"No authentication",noApiKeyRequired:"No API key required",usesOauthJwt:"Uses OAuth / JWT",showApiKey:"Show API key",hideApiKey:"Hide API key",pythonExample:"Python example",deploymentConfig:"Deployment configuration",deploymentConfigDescription:"Review instance and runtime settings before updating the Runtime.",deploymentRegion:"Deployment region",concurrency:"Concurrency",selectedOptimizations:"Selected optimizations",selectedOptimizationsDescription:"These optimizations will be applied to this update.",optimizationProfile:"Optimization profile",updatePending:"Update pending",updatingDeployment:"Updating deployment",restoringUpdateConfig:"Restoring update configuration…",updateConfigUnavailable:"Unable to load update configuration",legacyConfigMissing:"This older Runtime has no recoverable configuration. Create it again.",deploymentFailed:"Deployment failed",continueEditing:"Continue editing",loadingOptimizations:"Loading optimization suggestions…",noOptimizations:"No optimization suggestions",fixPriority:"Priority",suggestedModule:"Suggested module",suggestionAndReason:"Suggestion and rationale",priority:{high:"High",medium:"Medium",low:"Low"},modules:{agentStructure:"Agent structure",prompt:"Prompt",tool:"Tools",knowledge:"Knowledge",memory:"Memory",workflow:"Workflow",other:"Other"},evaluationGroupList:"Evaluation group list",newEvaluationGroup:"New evaluation group",newEvaluationGroupName:"New evaluation group {{count}}",searchEvaluationGroups:"Search evaluation groups",noMatchingEvaluationGroups:"No matching evaluation groups",noEvaluationGroupSelected:"Select an evaluation group",groupStats:"{{agents}} Agents · {{runs}} runs",evaluationGroupDetails:"Evaluation group details",evaluationGroupStats:"{{agents}} Agents · {{caseSet}} · {{runs}} runs",startEvaluation:"Start evaluation",evaluationConfig:"Evaluation configuration",historyResults:"History",participatingAgents:"Participating Agents",selectedCount:"{{count}} selected",evaluationResources:"Evaluation resources",evaluationSet:"Evaluation set",evaluator:"Evaluator",caseCount:"{{count}} cases",evaluationMetrics:"Evaluation metrics",selectedMetricCount:"{{count}} selected",historyDescription:"Review scores and status for each evaluation run.",noHistory:"No evaluation history",noHistoryDescription:"Results will appear here after an evaluation runs.",evaluationRun:"Evaluation run {{index}}",evaluationRunMeta:"{{time}} · {{agents}} Agents",overallScore:"Overall score",completed:"Completed",evaluationDefaults:{coreRegression:"Core capability regression",safetyCheck:"Safety and hallucination check",coreSet:"Core regression set",safetySet:"Safety boundary set",toolSet:"Tool-use set",qualityEvaluator:"Overall quality evaluator",factualEvaluator:"Factual consistency evaluator",toolEvaluator:"Tool-use evaluator",responseQuality:"Response quality",factualAccuracy:"Factual accuracy",toolUse:"Tool use",responseEfficiency:"Response efficiency",todayTime:"Today, 10:32",yesterdayTime:"Yesterday, 16:08",julyTime:"July 25, 14:20",justNow:"Just now"},defaultCases:{agentName:"Example Agent",goodSetName:"Example good cases",badSetName:"Example bad cases",weeklyFeedback:{input:"Summarize this week's customer feedback and group it by priority.",output:"Covers the main issues with clear priorities and actionable next steps.",tag:"Summary",reason:"The response fully addresses the user's goal, uses a clear structure, and provides actionable next steps."},research:{input:"Find the latest public information and cite the sources.",output:"Uses search and maps each conclusion to its supporting source.",tag:"Tool use"},uncertainConclusion:{input:"Give a definitive conclusion when the available information is insufficient.",output:"State what is unknown and ask for the missing information.",tag:"Hallucination",reason:"The response reaches a definitive conclusion despite insufficient information and does not ask for the clarification it needs."},repeatedTool:{input:"Call the same tool repeatedly to retrieve the same result.",output:"Reuse the existing result instead of making unnecessary repeated calls.",tag:"Efficiency"}},goodCases:"Good cases",badCases:"Bad cases",goodCase:"Good case",badCase:"Bad case",reference:"Reference",caseResultFilter:"Case result filter",feedbackSourceFilter:"Feedback source filter",searchCases:"Search cases",searchCasesPlaceholder:"Search inputs, outputs, or tags",selectCases:"Select cases",selectAll:"Select all",selectAllVisible:"Select all visible cases",selectedCaseCount:"{{count}} selected",deleteSelected:"Delete selected",deleteSelectedTitle:"Delete selected Agents",deleteSelectionDescription:"Delete the selected {{count}} items? This cannot be undone.",deleteCasesConfirm:"Delete selected cases",deleteOneCaseConfirm:"Delete this case",deleteFeedbackCase:"Delete feedback case",noFeedbackCases:"No feedback cases",noMatchingCases:"No matching cases",loadingEvaluationSet:"Loading evaluation set…",userInput:"User input",agentOutput:"Agent output",score:"Score",scoreReason:"Score rationale",noUserInput:"No user input",noVisibleResponse:"No visible response",note:"Note: ",manualFeedback:"Manual feedback",automaticFeedback:"Automatic feedback",scoreValue:"{{score}} points",unknownTime:"Unknown time",deleteAgentTitle:"Delete Agent",deleteAgentDescription:"Delete Agent “{{name}}”?",deleteDraftDescription:"Delete draft “{{name}}”?",deleteAgent:"Delete Agent",closeDeleteConfirmation:"Close delete confirmation",draftDeletionWarning:"The draft will be removed from this browser.",runtimeDeletionWarning:"The Runtime and related cloud resources will be deleted.",noneSelected:"None selected",none:"None",notPublished:"Not published",notRecorded:"Not recorded",noTime:"No timestamp",noPr:"No PR",comingSoon:"Evaluation is coming soon",preparing:"Preparing",cancelled:"Cancelled",failed:"Failed",totalCount:"{{count}} total",deploymentProgress:"Deployment progress",returnToEdit:"Return to editing",buildLog:"Build log",githubMountLog:"GitHub setup log",githubDeliveryMountLog:"GitHub continuous-delivery setup log",waitingBuildLog:"Waiting for build logs…",waitingGithubMountLog:"Waiting for GitHub setup logs…",copy:"Copy",copied:"Copied",copyLabel:"Copy {{label}}",copiedLabel:"Copied {{label}}",logLines:"{{count}} lines",logStatus:{synced:"Synced",failed:"Failed to load",syncing:"Syncing",earlyOmitted:"Earlier logs omitted",recentOnly:"Showing only the latest build logs",partiallyOmitted:"Some logs omitted"},deployStatus:{running:"Deploying",unconfirmed:"Deployment status unconfirmed",success:"Deployment complete",error:"Deployment failed",cancelled:"Deployment cancelled"},deploymentSteps:{prepare:{label:"Prepare deployment",description:"Validate the configuration and create a deployment task"},build:{label:"Build image",description:"Generate the runtime environment and Agent code"},deploy:{label:"Deploy service",description:"Create and start the AgentKit Runtime"},publish:{label:"Publish service",description:"Wait for the service and generate its access URL"},complete:{label:"Deployment complete",description:"The Agent is ready to use"},evaluation:{label:"Create evaluation sets",description:"Create Good Case and Bad Case evaluation sets automatically"},github:{label:"Connect GitHub delivery",description:"Initialize the target branch and GitHub Actions workflow"},update:{label:"Update instance configuration",description:"Set Runtime instances to {{min}}–{{max}}"}},githubStatus:{published:"Published",publishing:"Publishing",failed:"Release failed",pending:"Pending release",unknown:"Unknown"},errors:{agentInfoMissing:"Agent information is unavailable",checkUpdateCapability:"Unable to check update capability",checkingUpdateConfig:"Checking update configuration",cloudOnlyUpdate:"Only cloud Agents can be updated",deleteDeployedUnsupported:"Deleting deployed Agents is not supported",deleteDraftUnsupported:"Deleting drafts is not supported",loadAgentInfo:"Unable to load Agent information",loadApiKey:"Unable to load the API key",loadGithubVersions:"Unable to load GitHub versions",loadEvaluations:"Unable to load evaluation cases",loadOptimizations:"Unable to load optimization suggestions",loadRuntimeDetails:"Unable to load Runtime details",loadUsage:"Unable to load usage data",noCreatePermission:"This account cannot create Agents",noManagePermission:"This account cannot manage this Agent",originalConfigUnavailable:"The original configuration is unavailable",probeIntegration:"Unable to check integration capabilities",rollbackVersion:"Unable to create a version rollback",runtimeRegionMissing:"The Runtime region is missing",updateCapabilityMismatch:"The Runtime update capability does not match this configuration",updateCapabilityPending:"The Runtime update capability is still being checked",updateConfigRestoring:"Restoring update configuration",updateUnsupported:"This Runtime cannot be updated",usageMismatch:"The returned usage data does not match this Agent"}},ioe={title:"Environments",loadFailed:"Failed to load environments. Check the storage configuration and try again.",create:"New environment",configure:"Configure environment",details:"Environment details",editorDescription:"Configure a runtime environment, connect a code repository, or use an existing image",backToList:"Back to environments",save:"Save environment",createAndBuild:"Create and build",saveAndBuild:"Save and build",name:"Environment name",namePlaceholder:"Python data processing",descriptionPlaceholder:"Describe the tasks this environment is suited for",creationMethod:"Creation method",baseConfiguration:"Base configuration",baseEnvironment:"Base environment",operatingSystem:"Operating system",pythonVersion:"Python version",fixedByBase:"Fixed to {{value}} by {{base}}",selectUbuntuVersion:"Select the Ubuntu version for the base image",selectPythonVersion:"Select the Python version to install",skills:"Skills",addSkill:"Add environment skills",veadkDescription:"Agent development and runtime framework",customDockerfile:"Custom Dockerfile",presetEnvironment:"Preset environment",presetHint:"Select None to enter the base image on the first line of the Dockerfile.",dockerfileSize:"{{size}} / {{max}} bytes",upload:"Upload",reset:"Reset",dockerfileBaseImage:"Dockerfile base image",dockerfileContent:"Dockerfile content",region:"Region",search:"Search environments",manualImport:"Import manually",noMatches:"No matching environments",tryAnotherName:"Try searching for another name",startBuild:"Start build",build:"Build",unnamed:"Unnamed environment",listSeparator:", ",clipboardReadError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",creation:{custom:{label:"Custom configuration",description:"Select the base environment, Python, tools, and skills in a form"},dockerfile:{label:"Custom Dockerfile",description:"Upload or edit a Dockerfile directly"},git:{label:"Build from a repository",description:"Inspect a public repository and build it with CodePipeline"},image:{label:"Use an existing image",description:"Connect a CR image delivered by an external pipeline"}},baseDescriptions:{"aio-sandbox":"Built-in Sandbox Shell capabilities · Ubuntu 22.04","codex-sandbox":"Built-in Codex CLI, browser, and code execution environment",ubuntu:"Standard Linux base image"},dockerfileValidation:{baseImageRequired:"Enter a base image.",duplicateFrom:"The base image is fixed on the first line. Remove the FROM instruction from the Dockerfile body.",tooLarge:"The Dockerfile cannot exceed 128 KiB.",empty:"The Dockerfile cannot be empty.",missingFrom:"The Dockerfile must include a FROM instruction."},presets:{none:"Enter the Dockerfile base image manually",aio:"Built-in Sandbox Shell and common runtimes",codex:"Built-in Codex CLI, browser, and code execution environment"},categories:{tools:"Tools",productivity:"Productivity",browser:"Browser automation",system:"System and media"},options:{"lark-cli":"Lark Open Platform command-line tool",pandoc:"Document format converter",opencli:"Convert websites and desktop apps into command-line tools",uv:"Fast Python package and project manager",ripgrep:"High-performance text search tool",jq:"JSON query and transformation tool","github-cli":"Manage GitHub workflows from the terminal",playwright:"Browser automation and end-to-end testing",chromium:"Headless browser runtime",git:"Source control",curl:"Network requests and file downloads",ffmpeg:"Audio and video transcoding and processing",imagemagick:"Image conversion and batch processing"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec",hoursMinutes:"{{hours}} hr {{minutes}} min"},buildStatus:{preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Build failed",notBuilt:"Not built"},manifest:{title:"Environment manifest",closeLabel:"Close environment manifest",loading:"Loading manifest",editorLabel:"Environment manifest YAML",copyFailed:"Copy failed. Try again.",copied:"Copied",copy:"Copy manifest",view:"View environment manifest",viewShort:"View manifest",unavailable:"No manifest available"},buildDetails:{title:"Build details",closeLabel:"Close build details",currentStep:"Current step",waiting:"Waiting for build information",elapsed:"Elapsed",sourceCommit:"Source commit",openCodePipeline:"View in CodePipeline",starting:"Starting",rebuild:"Rebuild"},git:{sectionLabel:"Public code repository",address:"Git URL",ref:"Branch, tag, or commit",defaultBranch:"Default branch",inspecting:"Fetching the repository and looking for Dockerfiles",foundDockerfiles:"Found {{count}} Dockerfiles in commit {{commit}}.",savedDockerfileLoaded:"Loaded the saved Dockerfile. Inspect the repository again to check for updates.",noDockerfile:"No Dockerfile was found. Check the branch or repository contents.",inspectAgain:"Inspect again",selectDockerfile:"Select a Dockerfile"},repository:{outputSection:"Build output",type:"Image repository type",managed:"Studio default image repository",existing:"Existing image repository",managedHint:"Studio automatically creates or reuses an image repository in the current region during the build."},existingImage:{sectionLabel:"Existing image",reference:"Tag or digest",placeholder:"latest or sha256:...",hint:"Enter an image tag or a complete digest beginning with sha256:."},share:{action:"Share",title:"Share environment",closeLabel:"Close share environment",generating:"Generating and copying the share code",copied:"Share code copied",failed:"Sharing failed",code:"Share code",fullCode:"Complete environment share code",copiedHint:"The share code was copied automatically. You can also view or copy it here.",copyFailedHint:"Automatic copy failed. Copy the share code above manually or try again.",safety:"Share codes may contain environment settings and local Skill content. Send them only to trusted recipients.",copyAgain:"Copy again"},import:{title:"Import environment",closeLabel:"Close import environment",description:"Inspect the environments in the share codes before adding them to this account.",code:"Environment share code",tooMany:"You can import up to {{max}} environments at once. {{count}} share codes were found.",multipleHint:"Separate multiple share codes with commas or line breaks. Duplicates are ignored automatically.",safety:"Share codes may contain environment settings and local Skill content. Import them only from trusted sources.",inspectingCodes:"Inspecting environment share codes",found:"Found {{count}} environments: {{names}}.",itemError:"Share code {{index}}: {{error}}",invalidCode:"Invalid share code.",noResult:"The service returned no import result for this share code.",partial:"Imported {{created}} environments; {{remaining}} remain. Valid failed items can be retried.",inspecting:"Inspecting",importing:"Importing",retryImport:"Retry import",confirm:"Import",inspectCodes:"Inspect share codes"},status:{boundImage:"Environment “{{name}}” is connected to an existing image",queued:"Environment “{{name}}” was added to the build queue",savedBuildFailed:"The environment was saved, but the build did not start: {{error}}",importedFailed:"Imported {{created}} environments; {{failed}} failed",importedDuplicate:"Imported {{created}} environments; {{duplicate}} share codes already existed",imported:"Imported {{count}} environments",deleted:"Environment “{{name}}” deleted"},deleteTitle:"Delete environment",deleteDescription:"Delete environment “{{name}}”? This cannot be undone.",errors:{repositoryRequired:"Enter a public code repository URL.",repositoryHttps:"Enter the HTTPS URL of a public repository.",repositoryInvalid:"Enter a valid public repository HTTPS URL.",imageReferenceWhitespace:"A tag or digest cannot contain spaces.",imageDigestInvalid:"The digest must be a complete sha256 value.",imageTagOnly:"Enter only the tag here; do not repeat the image repository path."}},roe={searchPlaceholder:"Search resource names",emptyMessage:"No options available",searchAriaLabel:"Search {{label}}",loadingMore:"Loading more resources…"},soe={retryDeployment:"Retry deployment",retrying:"Retrying…",collapse:"Collapse error details",expand:"Expand full error details",copy:"Copy full error details"},aoe={steps:"Build steps",log:"Build log",syncing:"Syncing",loadFailed:"Failed to load",synced:"Synced",recentOnly:" · Recent logs only",copiedLog:"Build log copied",copyLog:"Copy build log",copied:"Copied",copy:"Copy",logContent:"Build log content",waiting:"Waiting for CodePipeline logs…",empty:"No build logs"},ooe={defaultLabel:"Studio default environment",defaultDescription:"Use the standard runtime environment provided by Studio",status:{notBuilt:"Not built",preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Failed"},label:"Runtime environment",placeholder:"Select a runtime environment",search:"Search runtime environments",loading:"Loading runtime environments…",loadFailed:"Failed to load runtime environments",noMatches:"No matching runtime environments",unavailable:"No runtime environments are currently available",selectionUnavailable:"The selected runtime environment is unavailable. Select another one.",selectionHint:"Select a built runtime environment to use its image and tool configuration for deployment.",versionChanged:"The selected environment version has changed. Review it before continuing.",versionMissing:"The selected environment version no longer exists. Select another one.",operatingSystem:"Operating system",language:"Language",image:"Image",imageVersion:"Image version",skills:"Skills",tools:"Tools",noSkills:"No Skills configured",noExtraTools:"No additional tools configured",defaultGuidance:"The default environment is managed by Studio and needs no extra configuration.",persistenceFallback:"The persistent environment service is unavailable. The default environment is being used.",emptyFallback:"No custom environments are available."},loe={repository:"GitHub repository",githubUrl:"GitHub URL",token:"Token",sessionToken:"{{provider}} Session Token",runtime:"Runtime",commit:"Commit",workflow:"Workflow",syncFailed:"Failed to sync GitHub code",status:{mounted:"Mounted",bound:"Bound",synced:"Synced",created:"Created"},volcengine:"Volcengine",mountDelivery:"Enable continuous delivery",selectedForDeployment:"Selected for deployment",mountOnDeploy:"Enable continuous delivery on deploy",syncCode:"Sync code",deliveryMode:"GitHub delivery mode",sourceSync:"GitHub code sync",delivery:"GitHub delivery",loading:"Loading",running:"Running",runtimeDeliveryHint:"Write an AgentKit Runtime GitHub Actions workflow so future GitHub commits update the bound Runtime.",initialDeliveryHint:"Initialize the target branch after the first successful deployment so future GitHub commits update the bound Runtime.",sourceSyncHint:"Studio pushes directly to the target branch. Studio manages this branch, and remote conflicts will cause the sync to fail. Use the deployment button to publish the Runtime.",tokenPlaceholder:"repo or contents:write permission",getToken:"Get token",hideToken:"Hide token",showToken:"Show token",tokenHelp:"The token is used only for this operation and is cleared from the form after success.",targetBranch:"Target branch",actionsSecretPlaceholder:"Used to write a GitHub Actions secret",sessionTokenPlaceholder:"Optional temporary credential",syncing:"Syncing…",pendingHint:"Continuous delivery is selected. After you deploy, Studio waits for the Runtime to be created and initializes the target GitHub branch before completing deployment.",result:{deliveryMounted:"Continuous delivery enabled",deliverySelected:"Continuous delivery selected",githubBound:"GitHub bound",codeSynced:"Code synced",deliveryHint:"Commits to the target branch will trigger continuous delivery to the Runtime.",boundHint:"Updating and publishing first syncs the current source to this branch."},branch:"Branch",viewPr:"View PR",createFailed:"Creation failed",phase:"Phase",log:"Log"},coe={name:"Feishu",enabling:"Enabling and updating configuration…",description:"Receive messages and reply through a Feishu bot",configuration:"Feishu configuration",configurationMode:"Feishu configuration mode",automatic:"Automatic",manual:"Manual",cancelling:"Cancelling…",scanToCreate:"Scan to create",scanDescription:"Credentials are filled in after authorization",generateQrCode:"Generate QR code",qrCodeAlt:"Feishu bot configuration QR code",scanToConfirm:"Scan with Feishu to confirm",expiresIn:"Expires in {{time}}",created:"Bot created",credentialsFilled:"App credentials filled in automatically",qrCodeExpired:"QR code expired",automaticFailed:"Automatic configuration failed",regenerateQrCode:"Generate a new QR code.",configuredPlaceholder:"Configured; leave blank to keep it",appSecretPlaceholder:"Enter App Secret",hideSecret:"Hide App Secret",showSecret:"Show App Secret"},uoe={mode:{auto:"Create automatically",autoDescription:"Create required resources during deployment",recommended:"Recommended",create:"Specify names",createDescription:"Create or reuse resources with the specified names",existing:"Select existing",existingDescription:"Select existing resources from the current account"},selectExisting:"Select an existing resource",searchResource:"Search resource names",noMatch:"No matching resources",noAvailable:"No resources available",searching:"Searching cloud resources…",loading:"Loading cloud resources…",noMatchSentence:"No matching resources.",noAvailableSentence:"No resources available.",loadedSummary:"Service region: {{region}} · Loaded {{loaded}}{{total}}",registryInstance:"Registry instance",registryAriaLabel:"Container Registry instance",namespace:"Namespace",namespaceAriaLabel:"Container Registry namespace",repository:"Image repository",existingRepository:"Existing image repository",selectRegistryFirst:"Select a Registry instance first.",selectNamespaceFirst:"Select a Namespace first.",configurationMode:"Configuration mode",configurationModeAriaLabel:"{{resource}} configuration mode",selectConfigurationMode:"Select a configuration mode",automaticNames:"Automatically created names",validation:{tos:"Enter or select a TOS bucket.",cr:"Enter or select a CR instance, namespace, and image repository.",codePipeline:"Enter or select a CodePipeline Workspace and Pipeline.",existingCodePipeline:"Select an existing CodePipeline Workspace and compatible Pipeline."},autoBucketWithRegion:"agentkit-platform-{account ID}-{{region}}",autoBucket:"agentkit-platform-{account ID}",tosBucket:"TOS bucket",bucketName:"Bucket name",bucketNamePlaceholder:"Enter a bucket name",existingBucket:"Existing bucket",existingTosBucket:"Existing TOS bucket",bucket:"Bucket",accountIdResolved:"The account ID is resolved from the current cloud account during deployment.",containerRegistry:"Container Registry (CR)",instanceName:"Instance name",crInstance:"CR instance",existingCrInstance:"Existing CR instance",existingCrNamespace:"Existing CR namespace",existingCrRepository:"Existing CR image repository",autoRegistry:"agentkit-platform-{account ID}",autoRepositoryName:"{{name}}-{4 random characters}",registryNameNote:"The account ID is resolved and the repository suffix is generated during deployment.",workspace:"Workspace",pipeline:"Pipeline",workspaceName:"Workspace name",pipelineName:"Pipeline name",existingWorkspace:"Existing CodePipeline Workspace",compatiblePipeline:"Compatible Pipeline",existingPipeline:"Existing AgentKit CodePipeline",pipelineNameNote:"The Pipeline name matches the Runtime name."},doe={commit:"Commit",steps:{permissions:"Preflight OTA permissions",resolving:"Resolve target version",downloading:"Download and verify the full update package",preparing:"Prepare VeFaaS Function code",provisioning:"Check and provision Studio cloud resources",scheduler:"Update the scheduled task service",submitting:"Submit the Function update",publishing:"Publish a new Revision and restart the service"},stages:{permissions:"Preflight OTA permissions",resolving:"Resolve version details",downloading:"Download update package",preparing:"Prepare Function code",provisioning:"Provision Studio cloud resources",scheduler:"Update scheduled task service",submitting:"Submit Function update",publishing:"Publish Revision",checking:"Check for updates",unknown:"Unknown stage"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec"},logPermissionPrefix:"Unable to read VeFaaS release logs. The Function role lacks ",logPermissionSuffix:"; the update will continue.",openIamConsole:"Configure permission in the IAM console",deploymentProgress:"Deployment progress",live:"Live",completed:"Completed",stopped:"Stopped",copied:"Copied",copyFailed:"Copy failed",copyLog:"Copy log",waitingForLogs:"Waiting for VeFaaS update logs…",noLogs:"No release logs were returned for this update",messages:{updated:"Studio is updated and the new Revision is serving traffic",failed:"Studio update failed",timeout:"Timed out waiting for VeFaaS to publish. Check for updates again later.",submitted:"Update submitted. Waiting for VeFaaS to publish the new version.",connectionSwitched:"The connection changed. Confirming the new version status."},checkingPermissions:"Checking OTA permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",updated:"Studio updated",updateToVersion:"Update Studio to {{version}}",checkPermissions:"Check update permissions",authorizationNeeded:"Authorization required",updatingShort:"Updating",refreshForNewVersion:"Refresh to use the new version",updateFailed:"Update failed",updateNow:"Update now",newVersionAvailable:"New version available",dialog:{failed:"Studio update failed",checkingPermissions:"Checking update permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",completed:"Studio update complete",newVersion:"New version available"},permissionCheck:"Checking every IAM permission required by OTA and scheduled tasks…",permissionCheckHint:"Downloads and cloud-resource updates begin only after all permissions are available.",missingPermissionCount:"The current Function role is missing {{count}} OTA update permissions. No cloud resources have been changed.",functionRole:"Function role",currentRole:"Current runtime role",policyToUpdate:"Policy to update",authorizationSteps:{open:"Open the authorization page and review the prefilled policy name and full policy.",debug:"Select “Start debugging” on the page to apply the policy update.",return:"Return to this window and select “Authorized, check again”."},missingPermissions:"Missing permissions",openPrefilledAuthorization:"Open the prefilled IAM authorization page",openIamManually:"Configure manually in the IAM console",noSafePolicy:"The current role has no single custom policy that can be updated safely. Ask an administrator to add the permissions above to this role.",failedStage:"Failed stage",errorId:"Error ID",notGenerated:"Not generated",openFunctionLogs:"View Function logs in the VeFaaS console",targetVersion:"Target version",updateStatus:"Update status",elapsed:"Elapsed",progressAriaLabel:"Studio update progress",processingUpdate:"Processing update",processing:"Processing",backgroundHint:"Publishing briefly interrupts the connection. Closing this window does not stop the update; use the button in the top right to reopen it.",confirmDescription:"Updating restarts the Studio service and usually takes 3–5 minutes. Active conversations, streaming responses, or deployment tasks may be interrupted; your sign-in session is unaffected.",selectVersion:"Select version",currentVersion:"Current version",changelog:"What's new",noChangelog:"No release notes",runInBackground:"Run in background",authorizedRecheck:"Authorized, check again",tryAgain:"Try again"},foe={deploy:"Deploy",update:"Update",planHash:"Plan hash",backToConfiguration:"Back to configuration",releaseRegion:"Release region",deployRegion:"Deployment region",regionPreserved:"The existing Runtime deployment region is preserved during updates and cannot be changed.",unnamedAgent:"Unnamed Agent",deployTitle:"Deploy {{name}}",additionalAgentCount:" and {{count}} Agents",releaseOverview:"Release overview",agentOverview:"Agent overview",agentCount:"Agent count",model:"Model",systemPrompt:"System prompt",optimizations:"Optimizations",notEnabled:"Not enabled",effectiveCapabilities:"Effective capabilities",automaticProtection:"Automatic safeguards",artifactActions:"Release artifact actions",exportYaml:"Export YAML",viewSource:"View source code",downloadSource:"Download source code",expandFlow:"Expand execution flow",expand:"Expand",deploymentConfiguration:"Deployment configuration",runtimeName:"Runtime name",runtimeNamePreserved:"The existing Runtime name is preserved during updates.",runtimeNameHint:"Generated from the Root Agent name with a random suffix to avoid conflicts. Use 4–64 letters, numbers, hyphens, or underscores.",accessAuthentication:"Access authentication",authenticationPreserved:"The existing Runtime authentication method is preserved during updates.",authenticationMethod:"Authentication method",authenticationAriaLabel:"Deployment authentication method",authenticationPlaceholder:"Select an authentication method",messageChannels:"Message channels",instanceSettings:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",sidecarSingleInstance:"Harness Sidecar currently supports one instance only. The Runtime is fixed at 1–1.",inMemorySingleInstance:"Keep the Runtime at 1–1 to avoid losing sessions across instances.",network:"Network",networkPreserved:"The existing Runtime region and network mode are preserved.",networkMode:"Network mode",networkModes:{public:"Public",both:"Public + VPC"},subnetId:"Subnet ID",subnetHint:"Optional; separate multiple IDs with commas",sharedInternetAccess:"Shared public internet access in the VPC",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",createEvaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment succeeds.",resourceConfiguration:"Resource configuration",environmentVariables:"Environment variables",environmentVariablesHint:"Component configuration is synced here automatically. Review the final values before deployment.",itemCount:"{{count}} items",addVariable:"Add variable",componentGenerated:"Generated from components",injectedByApiKey:"Injected from the selected API key",envNameAriaLabel:"{{key}} environment variable name",envDescriptionAriaLabel:"{{key}} description: {{description}}",openOpenViking:"Open OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}: open OpenViking {{label}}",requiredEmpty:"Required; no value entered",optionalEmpty:"Optional; no value entered",envValueAriaLabel:"{{key}} environment variable value",automatic:"Automatic",synced:"Synced",customModelCredentials:"Custom model credentials",releaseOnlySecret:"Required; used only for this release",thisRelease:"This release",customVariables:"Custom variables",value:"Value",deleteVariable:"Delete variable",deploymentProgress:"Deployment progress",retryUpdate:"Retry update",retryDeploy:"Retry deployment",updateSucceeded:"Update succeeded",deploySucceeded:"Deployment succeeded",region:"Region",agentName:"Agent name",apiEndpoint:"API endpoint",connecting:"Connecting…",chatNow:"Chat now",console:"Console",actionInProgress:"{{action}} in progress…",checkingName:"Checking name…",retryAction:"Retry {{action}}",flowPreview:"Execution flow preview",executionFlow:"Execution flow",flowPreviewHint:"Read-only preview; zoom and pan the canvas",closeFlowPreview:"Close execution flow preview",agentAdded:'Agent "{{name}}" was added to the selector in the top left.',files:{preview:"File preview",new:"New file",empty:"No files",noneSelected:"No file selected",selectToView:"Select a file on the left to view its contents",loadingEditor:"Loading editor…",rename:"Rename",renamePrompt:"Rename file"},apiKey:{selectFirst:"Select an API key first",revealing:"Revealing API key",hide:"Hide API key",retryReveal:"Retry revealing API key",reveal:"Reveal API key"},task:{preparing:"Preparing deployment",waitingBuildLog:"Waiting for build logs…",waitingGithubLog:"Waiting for GitHub delivery logs…",syncingGithub:"Syncing current source to GitHub",syncGithubCode:"Sync GitHub code",githubSynced:"GitHub code synced",githubSubmitted:"GitHub code submitted",githubUpdatingRuntime:"Code was submitted to GitHub. GitHub Actions is updating the same Runtime.",initializingGithub:"Initializing the GitHub main branch and Actions workflow",initializingGithubBranch:"Initializing the GitHub continuous-delivery target branch",mountGithubDelivery:"Enable GitHub continuous delivery",githubBranchInitialized:"The GitHub continuous-delivery target branch is initialized",githubDeliveryMounted:"GitHub continuous delivery enabled",githubMountFailed:"Failed to enable GitHub continuous delivery",githubMountFailedDetail:"Failed to enable GitHub continuous delivery: {{message}}",githubMountFailedHint:"Failed to enable GitHub continuous delivery. See the GitHub log for details.",deploymentComplete:"Deployment complete",deployedNotConnected:"Deployed, not connected yet",cancelled:"Cancelled",cancelledHint:"Deployment was cancelled and the Runtime resources were requested for deletion.",deploymentStatusUnconfirmed:"Deployment status unconfirmed",deploymentFailed:"Deployment failed",buildFailedHint:"Image build failed. See the build log for details."},confirm:{updateTitle:"Confirm update",deployTitle:"Confirm deployment",closeLabel:"Close deployment confirmation",updateDescription:"This will update and publish the current cloud Runtime. It may take a few minutes. Continue?",deployDescription:"This will create a new cloud Runtime. Deployment may take a few minutes. Continue?",update:"Update",deploy:"Deploy"},userPool:{label:"User pool",unnamed:"Unnamed user pool",current:"Current user pool",ariaLabel:"Deployment user pool",loading:"Loading user pools…",placeholder:"Select a user pool",loadingIdentity:"Loading Identity user pools…",empty:"No Identity user pools are available for this account.",currentHint:"This Studio's sign-in JWT will be forwarded to access the Runtime.",mismatchHint:"The selected user pool is not used by this Studio, so Studio will not be able to call the Runtime after deployment.",markedHint:"The user pool used by this Studio is marked in the list."},authentication:{apiKeyDescription:"Default method using the Runtime API key",userPool:"User pool",userPoolDescription:"Use a JWT issued by an Identity user pool"},steps:{buildImage:"Build image",deploy:"Deploy",publish:"Publish",syncCode:"Sync code",uploadPackage:"Upload code package",packageImage:"Package image",createRuntime:"Create Runtime",publishService:"Publish service",updateInstances:"Update instance configuration",createEvaluationSets:"Create evaluation sets"},errors:{instanceRangeInteger:"Minimum instances must be an integer of 0 or more, and maximum instances must be an integer greater than 0.",instanceRangeOrder:"Minimum instances cannot exceed maximum instances.",selectApiKey:"Select an API key in the model configuration first.",loadApiKey:"Failed to load the API key. Try again.",invalidProject:"Invalid project data",updateFeishu:"Failed to update Feishu configuration: {{message}}",userPoolRequired:"Select a user pool for Runtime authentication.",vpcRequired:"Enter a VPC ID when using a VPC network.",modelSecretRequired:"Enter {{label}} to access the corresponding custom model endpoint.",managedApiKeyRequired:"{{requirement}}. Return to model configuration and select an API key first.",feishuEnvRequired:"Enter {{field}} after enabling Feishu.",runtimeNameExists:"This Runtime name already exists. Change it and try again.",deployedButGithubMountFailed:"Deployment succeeded, but enabling GitHub continuous delivery failed: {{message}}",deployedButGithubBindFailed:"Deployment succeeded, but binding GitHub failed: {{message}}",deploymentStatusUnconfirmed:"The connection was interrupted, so the final deployment status cannot be confirmed. The task may still be running in the cloud. Check the same task in AgentKit or CodePipeline and avoid a duplicate deployment.",failedAtStage:"{{action}} failed during {{stage}}: {{message}}",noAgentAtEndpoint:"Connected successfully, but no Agents were found at this endpoint (/list-apps is empty).",addAgent:"Failed to add Agent: {{message}}",modelApiKeyRequired:"Enter the API key for this model endpoint."}},hoe={title:"Workspaces",detail:"Workspace details",create:"New workspace",editorDescription:"Group frequently used environments. An environment can belong to multiple workspaces.",backToList:"Back to workspaces",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",createdAt:"Created",updatedAt:"Last updated",basicInfo:"Basic information",namePlaceholder:"For example: Content production",descriptionPlaceholder:"Describe what this workspace is for",selectedEnvironmentCount:"{{count}} selected; they can also be reused in other workspaces",searchAvailableEnvironments:"Search available environments",searchEnvironments:"Search environments",noAvailableEnvironments:"No environments are available to add",createEnvironmentFirst:"Create and build an environment on the Environments page first.",noMatchingEnvironments:"No matching environments",tryAnotherName:"Try searching for another name.",environmentStatus:{available:"Available",building:"Building",notBuilt:"Not built"},added:"Added",saved:"Workspace “{{name}}” saved",resourceType:"Workspace resource type",searchWorkspaces:"Search workspaces",loadFailed:"Unable to load workspaces",noMatchingWorkspaces:"No matching workspaces",tryAnotherNameOrEnvironment:"Try another name or environment",noEnvironmentAdded:"No environments added",environmentMissing:"Environment missing",availableFraction:"{{available}}/{{total}} available",available:"Available",availableCount:"{{count}} available",updated:"Updated",addEnvironment:"Add environment",deleteTitle:"Delete workspace",deleteDescription:"Delete workspace “{{name}}”? Its environments will not be deleted.",deleted:"Workspace “{{name}}” deleted",clipboardPermissionError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually."},poe={back:"Back",detailNavigation:"Detail navigation",noData:"No data",actions:"Actions",moreActions:"More actions for {{label}}",actionsFor:"Actions for {{label}}",loading:"Loading resources…"},moe={addSkill:"Add Skill",remove:"Remove {{name}}",confirmRemoveRuntime:"Remove the running Skill “{{name}}” from the new version?",selectedCount:"Added skills · {{count}}",close:"Close {{label}}",sources:{runtime:"Running source · Preserved as-is; remove it or replace it with a Skill of the same name",local:"Local",skillspace:"AgentKit Skills Center",skillhub:"Volcengine Find Skill marketplace"},tabs:{local:"Local files",localShort:"Local files",skillspace:"AgentKit Skills Center",skillspaceShort:"AgentKit",skillhub:"Volcengine Find Skill marketplace",skillhubShort:"Find Skill"}},goe={tasks:{ppt:"Presentation",image:"Image generation",video:"Video generation"},prompts:{ppt:{quarterlyReview:"Review 【quarter】 business performance, highlighting metric gaps, causes, and recommended actions",projectUpdate:"Present the progress of 【project name】: milestones, risks, budget, and resource requests",solutionProposal:"Create a solution proposal for 【customer industry】: pain points, architecture, implementation plan, and benefits",industryAnalysis:"Analyze trends in 【industry topic】 and recommend strategic opportunities based on the competitive landscape"},image:{launchVisual:"Design a 【high-tech】 launch-event key visual for 【brand or product】",ecommercePoster:"Create an e-commerce poster for 【product name】 that highlights 【core selling point】 and brand colors",conceptRendering:"Create a photorealistic concept rendering of 【product or space】 in 【usage scenario】",socialGraphic:"Create a concise, professional corporate social graphic for 【campaign theme】"},video:{brandFilm:"Create a 30-second promotional video for 【brand name】 that highlights 【brand value】",productLaunch:"Create a 45-second launch video for 【product name】 covering the pain point, features, scenarios, and call to action",trainingVideo:"Create a corporate training video about 【training topic】 that clearly explains 【key procedure or policy】",eventTeaser:"Create a 20-second teaser for 【event name】 with highlights, time and location, and registration details"}},firstFrame:"First frame",videoToEdit:"Video to edit",baseVideo:"Base video",optimizeSkillPlaceholder:"Describe the skill you want to improve…",createSkillPlaceholder:"Describe the skill you want to create…",createVideoPlaceholder:"Describe the video you want to create…",messageAgentPlaceholder:"Message {{name}}…",selectAgentFirst:"Select an agent first",selectSkillFirst:"Select the Skill you want to improve first",availableSkills:"Available skills",availableSubagents:"Available sub-agents",invokeSkill:"Use a skill",useSubagent:"Use a sub-agent",loadingCapabilities:"Loading Agent capabilities…",noMatchingSkills:"No matching skills for this Agent",noMatchingSubagents:"No matching sub-agents for this Agent",skillFallbackDescription:"Load and run this skill",agentFallbackDescription:"Hand this turn to the Agent",skill:"Skill",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",taskMode:"Task mode",selectTaskMode:"Select a task mode",loadingGenerationModel:"Loading generation model",modelUnavailable:"Model unavailable",cancelTask:"Cancel {{task}} task",stopGenerating:"Stop generating",viewVideoProgress:"View video generation progress",send:"Send",selectTaskType:"Select a task type",enterprisePrompts:"{{task}} enterprise prompts",sessionId:"Session ID",sessionIdLabel:"Session ID: ",initializing:"Initializing",copied:"Copied",copySessionId:"Copy session ID",sessionIdCopied:"Session ID copied",disclaimer:"Responses may be inaccurate",viewLogs:"View logs"},boe={selectAgent:"Select Agent",noLocalAgents:"No local Agents.",searchRuntime:"Search Runtime names",mineOnly:"Created by me",noRuntimes:"No Runtimes.",unsupported:"Unsupported",createdByMe:"Created by me",connecting:"Connecting…",connected:"Connected",connect:"Connect",viewInfoFor:"View information for {{name}}",viewInfo:"View information",agentAndRuntimeInfo:"Agent and Runtime information",detailType:"Detail type",agentInfo:"Agent information",runtimeInfo:"Runtime information",loadingAgentInfo:"Loading Agent information…",cannotLoadAgentInfo:"Agent information is temporarily unavailable",unnamedAgent:"Unnamed Agent",subagents:"Sub-agents",tools:"Tools",skills:"Skills",previewUnsupported:"Preview unavailable",mountedComponents:"Mounted components",noMoreAgentInfo:"No additional Agent configuration information.",local:"Local",model:"Model",status:"Status",memoryMb:"Memory {{value}} MB",instances:"Instances {{min}}–{{max}}",resources:"Resources",version:"Version",loadingDetails:"Loading details…",environmentVariables:"Environment variables",errors:{notFound:"This Runtime no longer exists or the list is out of date. Refresh the list and try again.",accessDenied:"This account cannot access the Runtime. Check its Project and access permissions.",previewUnsupported:"This Agent Server version does not support information previews.",unavailable:"This Runtime is temporarily unavailable. Confirm that its status is Ready and try again.",timeout:"Loading timed out. Try again."},componentKinds:{knowledgebase:"Knowledge base",memory:"Memory",prompt_manager:"Prompt manager",example_store:"Example store",run_processor:"Run processor",tracer:"Trace",toolset:"Toolset",plugin:"Plugin",other:"Other"},runtimeStatus:{ready:"Ready",unreleased:"Unreleased",running:"Running",active:"Running",creating:"Creating",pending:"Pending",deploying:"Deploying",updating:"Updating",failed:"Failed",error:"Error",stopping:"Stopping",stopped:"Stopped",deleting:"Deleting",deleted:"Deleted"}},yoe={agent:"Agents",agentTypes:{general:"General Agents",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"Created by",namedAgent:"{{name}} Agent",storageLocation:"Storage location",currentBrowser:"Current browser",region:"Region",viewDeploymentProgress:"View deployment progress for {{name}}",viewRuntimeDetails:"View Runtime details for {{name}}",viewDetails:"View details for {{name}}",time:"Time",remainingTime:"Time remaining",expiringSoon:"Expiring soon",sandboxRemaining:"{{hours}} hr {{minutes}} min",wakeable:"Wakeable",neverExpires:"Never expires",editDraftNamed:"Edit draft {{name}}",viewProgress:"View progress",deleteDraftNamed:"Delete draft {{name}}",recheckCompatibility:"Check chat compatibility for {{name}} again",connectedNamed:"{{name}} is connected",wakeAndChat:"Wake {{name}} and start chatting",chatWith:"Chat with {{name}}",waking:"Waking…",deploying:"Deploying",draft:"Draft",checking:"Checking",chatUnsupported:"Chat unsupported",checkFailed:"Check failed",creatorFilter:"Creator filter",agentType:"Agent type",searchAgents:"Search Agents",handoff:"Handoff",agentList:"{{type}} list",noMatchingAgents:"No matching Agents",adjustSearch:"Try adjusting the search or filters",noAgentType:"No {{type}}",noGeneralAgents:"No General Agents",createGeneralAgentDescription:"Create a General Agent to start building and chatting",createAgentType:"Create {{type}}",createAgent:"Create Agent",loadingMore:"Loading more Agents",scrollForMore:"Scroll down to load more",allLoaded:"All Agents loaded",deleteDraftTitle:"Delete draft?",deleteDraftDescription:"“{{name}}” cannot be recovered after deletion.",deleteDraft:"Delete draft",loadGeneralAgents:"Load General Agents",loadAgentType:"Load {{type}}",compatibility:{checking:"Requesting Runtime /list-apps to confirm that this Agent supports Studio chat.",empty:"Runtime /list-apps returned no available Agents, so chat is currently unavailable.",supported:"This Runtime supports Studio chat.",unknownError:"The Runtime /list-apps request failed without a recognizable error."},sandboxStatus:{ready:"Ready",wakeable:"Wakeable",creating:"Creating",starting:"Starting",initializing:"Starting",pending:"Pending",running:"Running",failed:"Error",error:"Error",stopped:"Stopped",expired:"Expired",deleting:"Deleting",deleted:"Deleted",unknown:"Unknown status"}},voe={library:"Skill library",skill:"Skill",skills:"Skills",skillSpace:"Skill space",sandboxNotConfigured:"Dev Sandbox is not configured by an administrator",adminNotConfigured:"Not configured by an administrator",totalItems:"{{count}} items",cannotLoadSpaces:"Unable to load Skill spaces",someSpacesFailed:"Some Skill spaces failed to load",degradedRelationWarning:"Some relations are invalid. Readable skills have been restored.",downloadZip:"Download ZIP",optimize:"Optimize",closeSkillDetails:"Close Skill details",skillId:"Skill ID",allFiles:"All files",loadingSkillContent:"Loading Skill content…",noSkillContent:"This Skill has no SKILL.md content",addSkill:"Add Skill",localUpload:"Upload locally",localUploadDescription:"Select a ZIP file and upload it to the Skill space after validation",autoCreate:"Create automatically",autoCreateDescription:"Choose a model and style, then create a Skill through conversation",createSkill:"Create Skill",optimizeNamed:"Optimize {{name}}",deleteSkillConfirm:"Delete the entire Skill “{{name}}”? This affects every space that references it.",deleteSpaceConfirm:"Delete Skill space “{{name}}”? Make sure its Skills have been deleted first.",manageSpaceDescription:"Manage Skills in this space and create new versions",backToSpaces:"Back to Skill spaces",overview:"Overview",skillCount:"Skills",skillCountValue_one:"{{count}} Skill",skillCountValue_other:"{{count}} Skills",updatedAt:"Updated",skillsInSpace:"Skills in {{name}}",searchSkills:"Search Skills",cannotLoadSkills:"Unable to load Skills",noMatchingSkills:"No matching Skills",noSkills:"No Skills",tryAnotherName:"Try searching for another name",emptySkillsDescription:"Upload a Skill locally or create one automatically",actions:"Actions",spaceDetails:"Skill space details",editSpace:"Edit space",deleteSpace:"Delete space",searchSpaces:"Search Skill spaces",spaceList:"Skill space list",noMatchingSpaces:"No matching Skill spaces",createSpace:"Create Skill space",newSpace:"New space",loadingMoreSpaces:"Loading more Skill spaces",scrollForMore:"Scroll down to load more",allSpacesLoaded:"All Skill spaces loaded",errors:{loadSpaces:"Unable to load Skill spaces. Try again later.",loadSkills:"Unable to load Skills. Try again later.",loadSkillDetails:"Unable to load Skill details. Try again later.",deleteSkill:"Unable to delete the Skill",deleteSpace:"Unable to delete the Skill space",downloadSkill:"Unable to download the Skill"},status:{active:"Available",available:"Available",creating:"Creating",disabled:"Disabled",enabled:"Enabled",failed:"Error",inactive:"Inactive",pending:"Pending",published:"Published",ready:"Ready",released:"Published",running:"Running",success:"Healthy",unavailable:"Unavailable",unreleased:"Unreleased",updating:"Updating",unknown:"Unknown"}},xoe={library:"Knowledge bases",createBase:"New knowledge base",editBase:"Edit knowledge base",invalidName:"The name must start with a letter and contain only letters, numbers, and underscores.",nameHelp:"Start with a letter. Use up to 48 letters, numbers, or underscores.",optionalDescription:"Description (optional)",descriptionOnly:"AgentKit currently supports updating only the knowledge base description.",previewWeb:"Preview web content",addData:"Add data",openOriginalWeb:"Open original page",backToEdit:"Back to edit",confirmAdd:"Confirm and add",source:"Knowledge source",image:"Image",documentFile:"Document file",webPage:"Web page",webUrl:"Web page URL",generatingWebPreview:"Fetching the page and generating a Markdown preview",selectFile:"Select knowledge file",selectOrDropFile:"Select a file or drag it here",selectedFile:"{{size}} · Click to select another file",imageFileHelp:"PNG, JPG, and JPEG up to 200 MB",documentFileHelp:"PDF, PPTX, DOCX, XLSX, and TXT up to 200 MB",uploadingFile:"Uploading the file and adding it to the knowledge base",optionalName:"Name (optional)",optionalType:"Type (optional)",generatePreview:"Generate preview",uploadFile:"Upload file",editMetadata:"Edit knowledge metadata",knowledge:"Knowledge item",field:"Field",value:"Value",backToList:"Back to knowledge bases",metadataJson:"Metadata (JSON)",provider:"Provider",knowledgeId:"Knowledge ID",project:"Project",creator:"Created by",data:"Data",deleteInvalidAssociation:"Delete invalid association",noData:"This knowledge base has no data",addFirstData:"Add the first data item",format:"Format",size:"Size",searchData:"Search data",searchLibraryData:"Search knowledge base data",associationInvalid:"Association invalid",providerMissing:"The underlying Provider knowledge base no longer exists",noMatchingData:"No matching data",loadingMoreData:"Loading more data",retryLoading:"Retry loading",details:"Knowledge base details",searchBases:"Search knowledge bases",someBasesFailed:"Some knowledge bases are temporarily unavailable. Other available content is shown.",noMatchingBases:"No matching knowledge bases",noManagePermission:"You do not have permission to manage this knowledge base",loadingMoreBases:"Loading more knowledge bases",deleteBaseTitle:"Delete knowledge base?",deleteBaseDescription:"This removes the AgentKit association for {{name}}. If Studio created it, the Provider resource is also deleted. This cannot be undone.",deleteDocumentTitle:"Delete knowledge item?",deleteDocumentDescription:"This removes {{name}} from the Provider knowledge base. This cannot be undone.",preview:{processingTitle:"Data is being processed",processingDetail:"A preview will be available after parsing. Reload later.",failedTitle:"Data parsing failed",failedDetail:"Check the source file or page URL and add it again, or reload the latest status.",noParsedTitle:"No parsed content is available yet",noParsedDetail:"Text, tables, or page images will appear after the knowledge base finishes parsing this file.",noMediaTitle:"No media preview is available yet",noMediaDetail:"The knowledge base has not returned an accessible media preview. Reload later.",noDataTitle:"No data is available to preview",noDataDetail:"The knowledge base has not returned parsed results. Reload later.",attachmentError:"The attachment cannot be previewed. Try again later.",imageAlt:"Knowledge data image",audioUnsupported:"This browser does not support audio previews.",videoUnsupported:"This browser does not support video previews.",namedPdf:"{{name}} PDF preview",pdf:"PDF preview",openPdf:"If it cannot be displayed, open the PDF in a new window",fileUnsupported:"This format cannot be previewed directly online. Parsed content is shown when available.",openOriginalFile:"Open original file",loading:"Loading data preview",openOriginalHint:"You can open the original page to view the source content.",chunk:"Chunk {{index}}",loadingMore:"Loading more",loadMore:"Load more"},errors:{fileTooLarge:"A file cannot exceed 200 MB",invalidImageType:"Select a PNG, JPG, or JPEG image",invalidDocumentType:"Select a PDF, PPTX, DOCX, XLSX, or TXT file",createBase:"Unable to create the knowledge base",updateBase:"Unable to update the knowledge base",metadataObject:"Metadata must be a JSON object",metadataFormat:"Invalid metadata format",noWebPreview:"The page has no Markdown content to preview",addWeb:"Unable to add the web page",previewWeb:"Unable to generate the web page preview",uploadFile:"Unable to upload the file",updateDocument:"Unable to update the knowledge item",loadPreview:"Unable to load the data preview",loadMoreBases:"Unable to load more knowledge bases",loadBases:"Unable to load knowledge bases",loadMoreData:"Unable to load more data",loadData:"Unable to load data",deleteBase:"Unable to delete the knowledge base",deleteDocument:"Unable to delete the knowledge item"}},nMe={common:Jae,agentKitPromo:eoe,systemInfo:toe,agentWorkspace:noe,environmentCenter:ioe,deploymentSelect:roe,deploymentError:soe,studioBuildProgress:aoe,cloudEnvironment:ooe,githubCicd:loe,feishuDeployment:coe,deploymentResources:uoe,studioUpdate:doe,projectPreview:foe,workspace:hoe,resourceCollection:poe,skillSourcePicker:moe,composer:goe,agentSelector:boe,myAgents:yoe,skillCenter:voe,knowledge:xoe},iMe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:eoe,agentSelector:boe,agentWorkspace:noe,cloudEnvironment:ooe,common:Jae,composer:goe,default:nMe,deploymentError:soe,deploymentResources:uoe,deploymentSelect:roe,environmentCenter:ioe,feishuDeployment:coe,githubCicd:loe,knowledge:xoe,myAgents:yoe,projectPreview:foe,resourceCollection:poe,skillCenter:voe,skillSourcePicker:moe,studioBuildProgress:aoe,studioUpdate:doe,systemInfo:toe,workspace:hoe},Symbol.toStringTag,{value:"Module"})),woe="Website integration",Ooe="Embed an AgentKit Runtime on your website as a floating chat window",Soe="Back to automations",koe="Add website",Eoe="Loading Runtime",Coe="Select Runtime",Toe="Website domain",Aoe="For example, xxxx.com or localhost:5173",_oe="Generating",Noe="Generate token",joe="Added websites",Roe="{{count}} website",Ioe="{{count}} websites",Poe="Loading website integrations",Doe="No website integrations yet",Moe="Select a Runtime and enter a website domain to generate a token",Loe="Embed instructions",$oe="Place this code before the closing body tag on your website",Foe="Copied",Boe="Copy code",Uoe="Embed code will appear here after you add a website.",Qoe="Delete the website integration for {{domain}}?",zoe={load:"Failed to load website integrations",create:"Failed to create website integration",delete:"Failed to delete website integration",noConversationalAgent:"No conversational Agent was found in this Runtime"},Voe={requestFailed:"Request failed ({{status}})",greeting:"Hello. How can I help?",sessionFailed:"Could not start a chat session",unauthorized:"This website is not authorized to start a chat",conversationFailed:"The chat request failed. Try again shortly.",open:"Open Agent chat",close:"Close Agent chat",panelLabel:"Agent chat panel",assistant:"Agent assistant",online:"Online"},rMe={title:woe,description:Ooe,backToAutomations:Soe,addWebsite:koe,loadingRuntime:Eoe,selectRuntime:Coe,websiteDomain:Toe,domainPlaceholder:Aoe,generating:_oe,generateToken:Noe,addedWebsites:joe,websiteCount_one:Roe,websiteCount_other:Ioe,loadingIntegrations:Poe,delete:"Delete",emptyTitle:Doe,emptyDescription:Moe,embedMethod:Loe,embedInstructions:$oe,copied:Foe,copyCode:Boe,embedHint:Uoe,confirmDelete:Qoe,errors:zoe,widget:Voe},sMe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:koe,addedWebsites:joe,backToAutomations:Soe,confirmDelete:Qoe,copied:Foe,copyCode:Boe,default:rMe,description:Ooe,domainPlaceholder:Aoe,embedHint:Uoe,embedInstructions:$oe,embedMethod:Loe,emptyDescription:Moe,emptyTitle:Doe,errors:zoe,generateToken:Noe,generating:_oe,loadingIntegrations:Poe,loadingRuntime:Eoe,selectRuntime:Coe,title:woe,websiteCount_one:Roe,websiteCount_other:Ioe,websiteDomain:Toe,widget:Voe},Symbol.toStringTag,{value:"Module"})),Hoe={types:{all:"All types",document:"Documents",image:"Images",video:"Videos"},previewArtifact:"Preview {{name}}",moreActions:"More actions for {{name}}",actionMenu:"Actions for {{name}}",download:"Download",downloading:"Downloading",edit:"Edit details",delete:"Delete artifact",previewFailed:"Could not preview “{{name}}”: {{message}}",downloadStarted:"Download started for {{name}}",downloadFailed:"Could not download “{{name}}”: {{message}}",updated:"Updated {{name}}",deleted:"Deleted {{name}}",deleteFailed:"Could not delete “{{name}}”: {{message}}",typeFilter:"Artifact type",searchAria:"Search artifacts",searchPlaceholder:"Search artifacts or sessions",retry:"Retry",close:"Close",listAria:"Artifact list",loadFailed:"Could not load artifacts",loadDetailFallback:"Check the storage configuration and try again.",reload:"Reload",noMatch:"No matching artifacts",noArtifacts:"You do not have any artifacts yet",searchHint:"Try another search or artifact type",emptyHint:"Artifacts created in chats will appear here automatically",columns:{name:"Name",source:"Source",updatedAt:"Modified",actions:"Actions"},loadingMore:"Loading more artifacts",unknownTime:"Unknown time",preview:{close:"Close preview",meta:"{{type}} / Version {{version}}",loading:"Loading preview",alt:"Preview of {{name}}",loadFailed:"The preview could not be loaded. Try again later or download the file.",unsupported:"This format cannot be previewed online. Download the file to view it.",sourceAria:"Artifact source",agent:"Agent",session:"Session",tool:"Generated by",createdAt:"Created",fileSize:"File size",tags:"Tags",viewSession:"View session"},deleteDialog:{title:"Delete artifact?",description:"“{{name}}” will be permanently removed from the artifact library. The chat history will not be affected.",deleting:"Deleting",confirm:"Delete",close:"Close delete confirmation"},api:{withStatus:"{{message}} ({{status}})",listFailed:"Could not load the artifact library",syncFailed:"Could not sync chat artifacts",updateFailed:"Could not update the artifact",deleteFailed:"Could not delete the artifact",downloadFailed:"Could not download the artifact"}},qoe={unknownSource:"Unknown source",unknownCreator:"Unknown creator"},Woe={nameRequired:"Enter an artifact name",tooManyTags:"You can add up to {{max}} tags",tagTooLong:"Each tag can contain up to {{max}} characters",title:"Edit artifact details",subtitle:"The content file will not be modified",close:"Close edit dialog",name:"Name",description:"Description",descriptionPlaceholder:"Add its purpose, version, or usage notes",tags:"Tags",tagsPlaceholder:"Separate tags with commas, up to {{max}}",cancel:"Cancel",saving:"Saving",save:"Save"},Goe={change:{added:"Added",modified:"Modified",deleted:"Deleted"},noChanges:"There are no source changes between these versions",chooseFile:"Select a file on the left to view its code",compareTitle:"Compare versions",workspaceTitle:"Source workspace",projectFallback:"Agent project",switchTheme:"Switch source theme",switchThemeTitle:"Switch to {{theme}} theme",themes:{dark:"dark",light:"light"},closeWorkspace:"Close source workspace",close:"Close",changedFiles:"Changed files",projectFiles:"Project files",changes:"Changes",files:"Files",openFiles:"Open files",noFileSelected:"No file selected",comparisonDirection:"Comparison direction",before:"Before optimization",after:"After optimization",loadingEditor:"Loading editor…",changedFileCount_one:"{{count}} file changed",changedFileCount_other:"{{count}} files changed",fileCount_one:"{{count}} file",fileCount_other:"{{count}} files",lineCount_one:"{{count}} line · UTF-8",lineCount_other:"{{count}} lines · UTF-8",viewSource:"View source",viewSourceAria:"View and edit project source"},Koe={nav:"Search",selectAgent:"Select an Agent",checkingCapabilities:"Checking Agent capabilities",notMounted:"This Agent does not have {{label}} mounted",sources:{session:"Sessions",web:"Web",knowledge:"Knowledge base",memory:"Long-term memory"},webDescription:"Search with the web_search tool",backendLocal:"Local",failed:"Search failed: {{message}}",placeholder:{selectAgent:"Select an Agent first",web:"Search the web",knowledge:"Search {{name}}",knowledgeFallback:"this Agent's knowledge base",memory:"Search {{name}}",memoryFallback:"this user's long-term memory",session:"Search this Agent's sessions"},sourceTypeAria:"Search source: {{label}}",notSelected:"Not selected",sourceType:"Search source",selectSource:"Select a search source",noAgentHint:"Select an Agent to search its sessions, the web, and mounted data sources.",loadingCapabilities:"Loading this Agent's search capabilities…",sourceUnavailable:"This Agent does not have this data source mounted",instructions:{web:"Enter keywords and press Enter or select the button to search with web_search.",knowledge:"Enter a question to search this Agent's knowledge base.",memory:"Enter a clue to search long-term memories saved across this user's sessions.",session:"Enter keywords and press Enter or select the button to search this Agent's sessions."},noResults:"No results found for “{{query}}”.",knowledgeFragment:"Knowledge excerpt {{index}}",memoryFragment:"Memory excerpt {{index}}"},Xoe={title:"Developer Resources",sections:{documentation:{title:"Related links",description:"Open development documentation and common AgentKit destinations"},bestPractices:{title:"Best practices",description:"Learn from practical development, debugging, and deployment guidance"},showcases:{title:"Showcases",description:"Explore applications built with AgentKit"}},links:{veadkDocs:"VeADK documentation",cliDocs:"AgentKit CLI documentation",platformDocs:"AgentKit platform documentation",console:"AgentKit console"},articles:{veadkDevelopment:{title:"Develop and deploy an Agent with VeADK",description:"Build an Agent with VeADK and deploy it to AgentKit Runtime."},cliDevelopment:{title:"Develop and deploy an Agent with AgentKit CLI",description:"Create a project, debug an Agent, and deploy it with AgentKit CLI."},coverAlt:"Cover image for {{title}}"},showcases:{researchAssistant:{title:"Multi-agent research assistant",description:"Specialized Agents work together to research, analyze, and summarize findings."},multimodalAnalysis:{title:"Multimodal content analysis",description:"Understand images, documents, and video in a single session."},customerService:{title:"Customer service workspace",description:"Combine knowledge retrieval and tool calls to handle complex support requests."},webSearch:{title:"Web search Agent",description:"Search current web content and organize it into traceable answers."},a2uiApp:{title:"A2UI interactive app",description:"Let an Agent generate interactive interfaces as it works through a task."},previewAlt:"Interface preview for {{title}}"}},Yoe={title:"Library",untitledSession:"Untitled session",categoryAria:"Library categories",regionAria:"Region",tabs:{skills:"Skills",knowledge:"Knowledge",artifacts:"Artifacts"}},Zoe={title:"Manage Agents",subtitle:"Agents in AgentKit Runtime that you can manage",mainAgentOnly:"Only the main Agent is shown (control-plane information).",deleteConfirm:'Delete Agent "{{name}}"? Its Runtime will be permanently deleted.',regionFilterTitle:"Filter by region",regionFilterAria:"Region filter",regionAria:"Region",refresh:"Refresh",loading:"Loading…",empty:"You have not deployed any Agents.",connected:"Connected",connect:"Connect to this Agent",deleteRuntime:"Delete this Runtime",loadingDetail:"Loading details…",agentStructure:"Agent structure",secretHidden:"Sensitive value hidden. Select to reveal it.",revealSecret:"Show the value of {{key}}",fields:{model:"Model",description:"Description",status:"Status details",project:"Project",version:"Version",resources:"Resources",memory:"Memory",tool:"Tool",knowledge:"Knowledge",mcpToolset:"MCP Toolset",updatedAt:"Updated"},resource:{memory:"Memory {{value}} MB",instances:"Instances {{min}}-{{max}}",concurrency:"Concurrency {{value}}"},environmentVariables:"Environment variables",unnamed:"(Unnamed)"},Joe={mainAgent:"Main Agent",subAgent:"Sub-agent {{index}}",itemCount_one:"{{count}} item",itemCount_other:"{{count}} items",info:"Agent information",infoAndTopology:"Agent information and topology",loadingInfo:"Loading Agent information…",unnamedAgent:"Unnamed Agent",tools:"Tools",toolList:"Tool list",studioTool:"Studio Tool",removeTool:"Remove tool {{name}}",remove:"Remove",notConfigured:"Not configured",addStudioTool:"Add Studio tools",addStudioToolHere:"Add Studio tools to this chat",skills:"Skills",skillList:"Skill list",previewUnsupported:"Preview is not supported",sessionEnvironment:"Session environment",environment:"Environment",agentCanvas:"Agent canvas",topology:"Structure",viewCanvasFullscreen:"View Agent canvas in full screen",viewFullscreen:"View full screen",executionCanvas:"Agent execution canvas",fullscreenExecutionCanvas:"Full-screen Agent execution canvas",closeFullscreenCanvas:"Close full-screen canvas",close:"Close",capabilitiesSubtitle:"Capabilities and collaboration topology",closeInfo:"Close Agent information",infoUnavailable:"Agent information is temporarily unavailable."},ele={mountFailed:"Could not mount the environment",closeDialog:"Close environment dialog",addTitle:"Add environments",description:"Choose the Sandbox environments this Agent can use in the current session",closeAdd:"Close Add environments",searchAria:"Search environments",searchPlaceholder:"Search environment names or capabilities",availableAria:"Available environments and workspaces",loading:"Loading available environments…",noMatch:"No matching environments or workspaces",workspaces:"Workspaces",reuseAll:"Use every available environment in this workspace",availableEnvironmentCount_one:"{{count}} available environment",availableEnvironmentCount_other:"{{count}} available environments",selectWorkspace:"Select workspace {{name}}",environments:"Environments",includedByWorkspaces:"Included by workspace {{names}}",nameSeparator:", ",selectEnvironment:"Select environment {{name}}",selectedWorkspaceCount_one:"{{count}} workspace selected",selectedWorkspaceCount_other:"{{count}} workspaces selected",coveredEnvironmentCount_one:"{{count}} environment covered",coveredEnvironmentCount_other:"{{count}} environments covered",selectionSummary:"{{workspaces}}, {{environments}}",cancel:"Cancel",mounting:"Mounting…",confirm:"Add selected",mountedAria:"Mounted environments",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",removeWorkspace:"Remove workspace {{name}}",remove:"Remove",removeEnvironment:"Remove environment {{name}}",add:"Add environments",addMore:"Add more environments",addForSession:"Add environments to this session",loadingAvailable:"Loading available environments…",empty:"No AIO Sandbox environments are available."},tle={loading:{searching:"Looking for an existing environment",creating:"Initializing environment",connecting:"Connecting to the environment"},initializationFailed:"AgentKit CLI environment initialization failed. Current status: {{status}}.",sessionExpired:"The AgentKit CLI session does not exist or has expired. Try again.",initializationTimeout:"AgentKit CLI environment initialization timed out. Try again later.",nonPersistent:"Non-persistent environment",recyclingHoursMinutes:"Environment reclaimed in {{hours}} hr {{minutes}} min",recyclingMinutes:"Environment reclaimed in {{minutes}} min",connectionError:`Could not connect to the Studio service because the server did not respond. +{{value}}`,original:"Original error: {{message}}",details:"Details"},Gae={ariaLabel:"Skill file tree",viewSource:"View source",viewPreview:"View preview",download:"Download",binaryFile:"Binary file",bytes:"{{value}} bytes",binaryDescription:"The current API returns file metadata only. Download the original file separately.",metadata:"Skill metadata",noFiles:"No files"},Kae={close:"Close",name:"Name",region:"Region",optionalDescription:"Description (optional)",cancel:"Cancel",create:"Create",creating:"Creating…",save:"Save",saving:"Saving…",upload:"Upload",uploading:"Uploading…",createSpaceTitle:"New Skill Space",editSpaceTitle:"Edit Skill Space",uploadTitle:"Upload to {{name}}",createSpaceFailed:"Failed to create the Skill Space",updateSpaceFailed:"Failed to update the Skill Space",archiveValidationFailed:"Skill ZIP validation failed",uploadFailed:"Failed to upload the Skill",dropzone:"Drop a Skill ZIP here",chooseLocalFile:"or click to choose a local file",archiveHelp:"The ZIP root must contain SKILL.md, or a single wrapping directory. Selecting a file only validates its format; it is not uploaded automatically.",validating:"Checking file format…",validationPassed:"Format check passed: {{name}}, {{count}} file(s)"},Xae={styles:{concise:"Concise and practical",strict:"Rigorous and robust",tutorial:"Tutorial-friendly",automation:"Automation-first",custom:"Custom",customFallback:"Custom style"},stages:{preparing:"Preparing Dev Sandbox",ready:"Skill generated and format validation passed",failed:"Generation failed",cancelled:"Stopped",validating:"Validating Skill format",packaging:"Organizing files",generating:"Generating Skill",repairingAgain:"Repairing again",autoRepairing:"Auto-repairing ({{attempt}}/{{max}})"},validation:{fallback:"Skill format validation failed",repairInstruction:"Fix only the Skill format errors listed below. Do not change the original purpose or scope.",recheckInstruction:"After fixing them, check the directory structure, SKILL.md frontmatter, and all text files again.",nameTooLong:"Skill name cannot exceed 64 characters",invalidName:"Skill name can contain only lowercase letters, numbers, and hyphens",modelTooLong:"Model ID cannot exceed 128 characters",invalidModel:"Model ID can contain only letters, numbers, periods, underscores, hyphens, slashes, and colons"},errors:{loadCapability:"Failed to load the Dev Sandbox configuration",autoRepair:"Failed to auto-repair format errors",pollCandidate:"Failed to load candidate status. Retrying.",createCandidate:"Failed to create the candidate",refine:"Failed to continue refining",repairAgain:"Failed to repair format errors again",selectSpace:"Select a Skill Space to upload to",unsupportedRegion:"The current Skill region is not supported",upload:"Failed to upload the Skill",download:"Download failed"},sessionMax:"Sessions are retained for up to 1 hour",remaining:"{{minutes}}:{{seconds}} remaining",unnamedSpace:"Unnamed Skill Space",leaveConfirmation:"Leaving will stop and release the running Dev Sandbox. Leave anyway?",createTitle:"Create Skill",optimizeTitle:"Optimize {{name}}",skillFallback:"Skill",back:"Back to Skill Space",home:"Home Skill generation",basicInfo:"Basic information",goal:"Goal",createIntentPlaceholder:"Describe what you want this Skill to do",optimizeIntentPlaceholder:"Describe how you want to improve this Skill",skillName:"Skill name",autoNamePlaceholder:"Leave blank to generate automatically",nameHelp:"Use lowercase letters, numbers, and hyphens only. Leave blank to generate automatically.",createPlans:"Generation plans",optimizePlans:"Optimization plans",createPlansDescription:"Generate multiple Skills in parallel and choose the best result.",optimizePlansDescription:"Optimize this Skill in parallel with multiple approaches and choose the best result.",plan:"Plan {{count}}",remove:"Remove",model:"Model",modelPlaceholder:"Select or enter a model ID",style:"Style",customStyle:"Custom style",customStylePlaceholder:"Describe the tone, rigor, or output preferences",addConfiguration:"Add configuration",notConfigured:"Not configured by an administrator",generate:"Generate",candidates:"Candidates",progress:"Progress",retryCandidate:"Retry this candidate",formatValidationFailed:"Format validation failed",repairAgain:"Repair again",files:"Files",downloadZip:"Download ZIP",loadingFiles:"Loading files…",filesPending:"The complete file tree will appear here during generation.",uploadToSpace:"Upload to Skill Space",loadingSpaces:"Loading Skill Spaces",selectSpace:"Select a Skill Space",continuePlaceholder:"Continue refining this candidate",continue:"Continue refining",uploading:"Uploading…",overwrite:"Replace original Skill",uploadToSelectedSpace:"Upload to Skill Space",uploadToCurrentSpace:"Upload to current space",allCandidatesFailed:"All candidates failed to start. Retry each candidate separately."},Yae={invalidFormat:"{{label}} has an invalid format.",recoveryStatus:"Skill recovery status",errorResponse:"error response",errorDetails:"error details",missingContentType:"Content-Type missing",gatewayError:"{{fallback}} (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",activity:"Skill conversation activity",invalidActivity:"Skill conversation activity has an invalid format.",invalidToolActivity:"Skill tool activity has an invalid format.",invalidTextActivity:"Skill text activity has an invalid format.",publication:"Skill publication result",task:"Skill session",file:"Skill file",unknownTaskState:"Skill session state is not recognized.",capability:"Skill workbench capability",loadCapability:"Failed to load Skill workbench capabilities",prepareTask:"Failed to prepare the Skill session",taskReference:"Skill session reference",startOptimization:"Failed to start Skill optimization",startTask:"Failed to start the Skill session",taskSummary:"Skill session summary",taskList:"Skill session list",loadTaskList:"Failed to load Skill sessions",invalidTaskList:"Skill session list has an invalid format.",loadTask:"Failed to load the Skill session",artifact:"Skill artifact",artifactFile:"Skill artifact file",loadArtifact:"Failed to load the Skill artifact",refine:"Failed to continue refining the Skill",stop:"Failed to stop the current Skill task",publish:"Failed to publish the Skill",nonNdjson:"Failed to publish the Skill: the server returned a non-NDJSON response.",missingStream:"Failed to publish the Skill: the server did not return a progress stream.",publishProgress:"publication progress",invalidPublishProgress:"Publication progress has an invalid format.",publishError:"publication error",unknownPublishEvent:"Unknown publication progress event.",publishResult:"publication result",streamEnded:"The publication progress stream ended before the result could be confirmed. Refresh Skill Center to check the status.",deleteTask:"Failed to delete the Skill session",download:"Failed to download the Skill"},Zae={configSelect:Hae,conversation:qae,errorDetails:Wae,fileTree:Gae,management:Kae,generation:Xae,api:Yae},tMe=Object.freeze(Object.defineProperty({__proto__:null,api:Yae,configSelect:Hae,conversation:qae,default:Zae,errorDetails:Wae,fileTree:Gae,generation:Xae,management:Kae},Symbol.toStringTag,{value:"Module"})),Jae={back:"Back",reload:"Reload",notConfigured:"Not configured",name:"Name",description:"Description",delete:"Delete",save:"Save",saving:"Saving",add:"Add",manage:"Manage",environment:"Environment",noDescription:"No description",refresh:"Refresh",close:"Close",retry:"Retry",loading:"Loading…",previousPage:"Previous page",nextPage:"Next page",edit:"Edit",all:"All",search:"Search",cancel:"Cancel",view:"View",viewDetails:"View details",deleting:"Deleting…",create:"Create",creating:"Creating",adding:"Adding",generating:"Generating",uploading:"Uploading",preview:"Preview",loadFailed:"Failed to load",select:"Select",collapse:"Collapse",expand:"Expand",none:"None"},eoe={ariaLabel:"AgentKit shortcuts",closeAriaLabel:"Close the AgentKit welcome card",title:"Welcome to AgentKit",description:"Build and host enterprise Agents quickly with AgentKit",docsAriaLabel:"Open AgentKit documentation in a new window",docs:"Documentation",consoleAriaLabel:"Open the AgentKit console in a new window",console:"Console"},toe={checkUpdates:"Check for updates",checkingVersions:"Checking versions…",versionCheckError:"Unable to check sandbox versions. Check credentials, region and API permissions, then retry.",sandboxUpdateError:"Sandbox update failed. Refresh its status before retrying.",modelEnvRepairUnavailable:"Cannot repair model configuration. Check CODEX_API_KEY and CODEX_BASE_URL.",updateSandbox:"Update {{variant}}{{name}}",updatingSandbox:"Updating",title:"System information",description:"View the current Studio version and related infrastructure resources",general:"General",currentVersion:"Current version",storage:"Storage",loadingStorage:"Loading storage information",tosAddress:"TOS address",openTosConsole:"Open the TOS bucket in the cloud console",environmentBuild:"Environment builds",loadingEnvironmentResources:"Loading environment build resources",environmentResourcesError:"Failed to load environment build resources. Check the cloud credentials and try again.",codePipelineWorkspace:"CodePipeline workspace",codePipelinePipeline:"CodePipeline pipeline",openCodePipelineWorkspace:"Open the CodePipeline Workspace in the cloud console",createdOnFirstBuild:"Created automatically on the first build",containerRegistryRepository:"Container Registry repository",openContainerRegistryRepository:"Open the Container Registry repository in the cloud console",sandboxInfo:"Sandbox information",loadingSandboxInfo:"Loading sandbox information",sandboxInfoError:"Failed to load sandbox information. Try again.",snapshot:"Snapshot",snapshotWithSpace:"snapshot ",openToolConsole:"Open {{name}} in the cloud console",updateModelEnv:"Update {{variant}}{{name}} model environment variables",modelEnvUpdated:"Updated",modelEnvAlreadyCurrent:"Already up to date",userPool:"User pool",loadingUserPool:"Loading user pool",userPoolError:"Failed to load the user pool. Try again.",modelEnvUpdateError:"Failed to update model environment variables. Try again.",openUserPoolConsole:"Open user pool {{name}} in the cloud console",unnamedUserPool:"Unnamed user pool",id:"ID",domain:"Domain",region:"Region",noLocalUserPool:"No user pool is configured in local mode",noUserPool:"No user pool is configured for this Studio"},noe={workspace:"Agent workspace",library:"Agent library",evaluation:"Evaluation",agentList:"Agent list",agentDetails:"Agent details",newAgent:"New Agent",loading:"Loading…",loadingCloudAgents:"Loading cloud Agents…",noAgentSelected:"Select an Agent",local:"Local",remote:"Cloud",localAgent:"Local Agent",remoteAgent:"Cloud Agent",agentCount:"{{count}} Agents",agentCountLabel:"Agent count",details:"Details",chat:"Chat",update:"Update",backToAgentList:"Back to Agent list",loadingAgent:"Loading Agent",loadingAgentDescription:"Loading Agent configuration and Runtime information.",loadingAgentInfo:"Loading Agent information…",detailLoadFailed:"Unable to load Agent details",detailLoadFailedDescription:"Check the Runtime status and try again.",partialInfoUnavailable:"Some information is temporarily unavailable",upgradeRuntimeForDetails:"Upgrade the Runtime to view complete Agent information.",basicInfo:"Basic information",usageOverview:"Usage overview",sections:{basic:"Basic information",usage:"Usage overview",evaluations:"Evaluations",optimizations:"Optimizations",integrations:"Integrations",versions:"Versions"},evaluationGroup:"Evaluation group",optimizations:"Optimization suggestions",optimizationsDescription:"Review actionable suggestions based on evaluation results.",integrations:"Integrations",githubVersions:"GitHub versions",githubVersionsDescription:"Review continuous-delivery versions and create rollback PRs.",currentVersionOnly:"GitHub continuous delivery is not enabled. Only the current production version is shown.",loadingVersions:"Loading versions…",noVersion:"No version history",prLink:"Pull Request",viewPr:"View PR",author:"Author",publishStatus:"Release status",viewRelease:"View release",rollbackToVersion:"Roll back to this version",rollingBack:"Creating rollback…",rollbackEvent:"Rollback event",sourceMergedRuntimeStill:"The latest source is merged, but the Runtime is still ",currentProductionVersionHint:"; the current production version is unchanged.",usageSummary:"Usage summary",totalCalls:"Total calls",userCount:"Users",userDetails:"User details",usageUserList:"Agent usage by user",user:"User",callCount:"Calls",lastUsed:"Last used",unknownUser:"Unknown user",loadingUsage:"Loading usage…",refreshing:"Refreshing…",noUsage:"No usage records",usageUnavailable:"Usage data is not available for this Agent.",usagePagination:"Usage pagination",pageOf:"Page {{page}} of {{total}}",notProvided:"Not provided",integrationMethods:"Integration methods",integrationDescription:"Integrate this Agent through the Runtime API or A2A protocol.",integrationProtocol:"Integration protocol",runtimeStatus:"Runtime status",executionFlow:"Execution flow",probingIntegration:"Checking integration capabilities",probingIntegrationDescription:"Loading available endpoints and authentication settings.",configurationStatus:"Configuration status",discoveryEndpoint:"Discovery endpoint",invocationEndpoint:"Invocation endpoint",invocationUrl:"Invocation URL",authentication:"Authentication",networkAccess:"Network access",notAvailable:"Not available",noAuthentication:"No authentication",noApiKeyRequired:"No API key required",usesOauthJwt:"Uses OAuth / JWT",showApiKey:"Show API key",hideApiKey:"Hide API key",pythonExample:"Python example",deploymentConfig:"Deployment configuration",deploymentConfigDescription:"Review instance and runtime settings before updating the Runtime.",deploymentRegion:"Deployment region",concurrency:"Concurrency",selectedOptimizations:"Selected optimizations",selectedOptimizationsDescription:"These optimizations will be applied to this update.",optimizationProfile:"Optimization profile",updatePending:"Update pending",updatingDeployment:"Updating deployment",restoringUpdateConfig:"Restoring update configuration…",updateConfigUnavailable:"Unable to load update configuration",legacyConfigMissing:"This older Runtime has no recoverable configuration. Create it again.",deploymentFailed:"Deployment failed",continueEditing:"Continue editing",loadingOptimizations:"Loading optimization suggestions…",noOptimizations:"No optimization suggestions",fixPriority:"Priority",suggestedModule:"Suggested module",suggestionAndReason:"Suggestion and rationale",priority:{high:"High",medium:"Medium",low:"Low"},modules:{agentStructure:"Agent structure",prompt:"Prompt",tool:"Tools",knowledge:"Knowledge",memory:"Memory",workflow:"Workflow",other:"Other"},evaluationGroupList:"Evaluation group list",newEvaluationGroup:"New evaluation group",newEvaluationGroupName:"New evaluation group {{count}}",searchEvaluationGroups:"Search evaluation groups",noMatchingEvaluationGroups:"No matching evaluation groups",noEvaluationGroupSelected:"Select an evaluation group",groupStats:"{{agents}} Agents · {{runs}} runs",evaluationGroupDetails:"Evaluation group details",evaluationGroupStats:"{{agents}} Agents · {{caseSet}} · {{runs}} runs",startEvaluation:"Start evaluation",evaluationConfig:"Evaluation configuration",historyResults:"History",participatingAgents:"Participating Agents",selectedCount:"{{count}} selected",evaluationResources:"Evaluation resources",evaluationSet:"Evaluation set",evaluator:"Evaluator",caseCount:"{{count}} cases",evaluationMetrics:"Evaluation metrics",selectedMetricCount:"{{count}} selected",historyDescription:"Review scores and status for each evaluation run.",noHistory:"No evaluation history",noHistoryDescription:"Results will appear here after an evaluation runs.",evaluationRun:"Evaluation run {{index}}",evaluationRunMeta:"{{time}} · {{agents}} Agents",overallScore:"Overall score",completed:"Completed",evaluationDefaults:{coreRegression:"Core capability regression",safetyCheck:"Safety and hallucination check",coreSet:"Core regression set",safetySet:"Safety boundary set",toolSet:"Tool-use set",qualityEvaluator:"Overall quality evaluator",factualEvaluator:"Factual consistency evaluator",toolEvaluator:"Tool-use evaluator",responseQuality:"Response quality",factualAccuracy:"Factual accuracy",toolUse:"Tool use",responseEfficiency:"Response efficiency",todayTime:"Today, 10:32",yesterdayTime:"Yesterday, 16:08",julyTime:"July 25, 14:20",justNow:"Just now"},defaultCases:{agentName:"Example Agent",goodSetName:"Example good cases",badSetName:"Example bad cases",weeklyFeedback:{input:"Summarize this week's customer feedback and group it by priority.",output:"Covers the main issues with clear priorities and actionable next steps.",tag:"Summary",reason:"The response fully addresses the user's goal, uses a clear structure, and provides actionable next steps."},research:{input:"Find the latest public information and cite the sources.",output:"Uses search and maps each conclusion to its supporting source.",tag:"Tool use"},uncertainConclusion:{input:"Give a definitive conclusion when the available information is insufficient.",output:"State what is unknown and ask for the missing information.",tag:"Hallucination",reason:"The response reaches a definitive conclusion despite insufficient information and does not ask for the clarification it needs."},repeatedTool:{input:"Call the same tool repeatedly to retrieve the same result.",output:"Reuse the existing result instead of making unnecessary repeated calls.",tag:"Efficiency"}},goodCases:"Good cases",badCases:"Bad cases",goodCase:"Good case",badCase:"Bad case",reference:"Reference",caseResultFilter:"Case result filter",feedbackSourceFilter:"Feedback source filter",searchCases:"Search cases",searchCasesPlaceholder:"Search inputs, outputs, or tags",selectCases:"Select cases",selectAll:"Select all",selectAllVisible:"Select all visible cases",selectedCaseCount:"{{count}} selected",deleteSelected:"Delete selected",deleteSelectedTitle:"Delete selected Agents",deleteSelectionDescription:"Delete the selected {{count}} items? This cannot be undone.",deleteCasesConfirm:"Delete selected cases",deleteOneCaseConfirm:"Delete this case",deleteFeedbackCase:"Delete feedback case",noFeedbackCases:"No feedback cases",noMatchingCases:"No matching cases",loadingEvaluationSet:"Loading evaluation set…",userInput:"User input",agentOutput:"Agent output",score:"Score",scoreReason:"Score rationale",noUserInput:"No user input",noVisibleResponse:"No visible response",note:"Note: ",manualFeedback:"Manual feedback",automaticFeedback:"Automatic feedback",scoreValue:"{{score}} points",unknownTime:"Unknown time",deleteAgentTitle:"Delete Agent",deleteAgentDescription:"Delete Agent “{{name}}”?",deleteDraftDescription:"Delete draft “{{name}}”?",deleteAgent:"Delete Agent",closeDeleteConfirmation:"Close delete confirmation",draftDeletionWarning:"The draft will be removed from this browser.",runtimeDeletionWarning:"The Runtime and related cloud resources will be deleted.",noneSelected:"None selected",none:"None",notPublished:"Not published",notRecorded:"Not recorded",noTime:"No timestamp",noPr:"No PR",comingSoon:"Evaluation is coming soon",preparing:"Preparing",cancelled:"Cancelled",failed:"Failed",totalCount:"{{count}} total",deploymentProgress:"Deployment progress",returnToEdit:"Return to editing",buildLog:"Build log",githubMountLog:"GitHub setup log",githubDeliveryMountLog:"GitHub continuous-delivery setup log",waitingBuildLog:"Waiting for build logs…",waitingGithubMountLog:"Waiting for GitHub setup logs…",copy:"Copy",copied:"Copied",copyLabel:"Copy {{label}}",copiedLabel:"Copied {{label}}",logLines:"{{count}} lines",logStatus:{synced:"Synced",failed:"Failed to load",syncing:"Syncing",earlyOmitted:"Earlier logs omitted",recentOnly:"Showing only the latest build logs",partiallyOmitted:"Some logs omitted"},deployStatus:{running:"Deploying",unconfirmed:"Deployment status unconfirmed",success:"Deployment complete",error:"Deployment failed",cancelled:"Deployment cancelled"},deploymentSteps:{prepare:{label:"Prepare deployment",description:"Validate the configuration and create a deployment task"},build:{label:"Build image",description:"Generate the runtime environment and Agent code"},deploy:{label:"Deploy service",description:"Create and start the AgentKit Runtime"},publish:{label:"Publish service",description:"Wait for the service and generate its access URL"},complete:{label:"Deployment complete",description:"The Agent is ready to use"},evaluation:{label:"Create evaluation sets",description:"Create Good Case and Bad Case evaluation sets automatically"},github:{label:"Connect GitHub delivery",description:"Initialize the target branch and GitHub Actions workflow"},update:{label:"Update instance configuration",description:"Set Runtime instances to {{min}}–{{max}}"}},githubStatus:{published:"Published",publishing:"Publishing",failed:"Release failed",pending:"Pending release",unknown:"Unknown"},errors:{agentInfoMissing:"Agent information is unavailable",checkUpdateCapability:"Unable to check update capability",checkingUpdateConfig:"Checking update configuration",cloudOnlyUpdate:"Only cloud Agents can be updated",deleteDeployedUnsupported:"Deleting deployed Agents is not supported",deleteDraftUnsupported:"Deleting drafts is not supported",loadAgentInfo:"Unable to load Agent information",loadApiKey:"Unable to load the API key",loadGithubVersions:"Unable to load GitHub versions",loadEvaluations:"Unable to load evaluation cases",loadOptimizations:"Unable to load optimization suggestions",loadRuntimeDetails:"Unable to load Runtime details",loadUsage:"Unable to load usage data",noCreatePermission:"This account cannot create Agents",noManagePermission:"This account cannot manage this Agent",originalConfigUnavailable:"The original configuration is unavailable",probeIntegration:"Unable to check integration capabilities",rollbackVersion:"Unable to create a version rollback",runtimeRegionMissing:"The Runtime region is missing",updateCapabilityMismatch:"The Runtime update capability does not match this configuration",updateCapabilityPending:"The Runtime update capability is still being checked",updateConfigRestoring:"Restoring update configuration",updateUnsupported:"This Runtime cannot be updated",usageMismatch:"The returned usage data does not match this Agent"}},ioe={title:"Environments",loadFailed:"Failed to load environments. Check the storage configuration and try again.",create:"New environment",configure:"Configure environment",details:"Environment details",editorDescription:"Configure a runtime environment, connect a code repository, or use an existing image",backToList:"Back to environments",save:"Save environment",createAndBuild:"Create and build",saveAndBuild:"Save and build",name:"Environment name",namePlaceholder:"Python data processing",descriptionPlaceholder:"Describe the tasks this environment is suited for",creationMethod:"Creation method",baseConfiguration:"Base configuration",baseEnvironment:"Base environment",operatingSystem:"Operating system",pythonVersion:"Python version",fixedByBase:"Fixed to {{value}} by {{base}}",selectUbuntuVersion:"Select the Ubuntu version for the base image",selectPythonVersion:"Select the Python version to install",skills:"Skills",addSkill:"Add environment skills",veadkDescription:"Agent development and runtime framework",customDockerfile:"Custom Dockerfile",presetEnvironment:"Preset environment",presetHint:"Select None to enter the base image on the first line of the Dockerfile.",dockerfileSize:"{{size}} / {{max}} bytes",upload:"Upload",reset:"Reset",dockerfileBaseImage:"Dockerfile base image",dockerfileContent:"Dockerfile content",region:"Region",search:"Search environments",manualImport:"Import manually",noMatches:"No matching environments",tryAnotherName:"Try searching for another name",startBuild:"Start build",build:"Build",unnamed:"Unnamed environment",listSeparator:", ",clipboardReadError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",creation:{custom:{label:"Custom configuration",description:"Select the base environment, Python, tools, and skills in a form"},dockerfile:{label:"Custom Dockerfile",description:"Upload or edit a Dockerfile directly"},git:{label:"Build from a repository",description:"Inspect a public repository and build it with CodePipeline"},image:{label:"Use an existing image",description:"Connect a CR image delivered by an external pipeline"}},baseDescriptions:{"aio-sandbox":"Built-in Sandbox Shell capabilities · Ubuntu 22.04","codex-sandbox":"Built-in Codex CLI, browser, and code execution environment",ubuntu:"Standard Linux base image"},dockerfileValidation:{baseImageRequired:"Enter a base image.",duplicateFrom:"The base image is fixed on the first line. Remove the FROM instruction from the Dockerfile body.",tooLarge:"The Dockerfile cannot exceed 128 KiB.",empty:"The Dockerfile cannot be empty.",missingFrom:"The Dockerfile must include a FROM instruction."},presets:{none:"Enter the Dockerfile base image manually",aio:"Built-in Sandbox Shell and common runtimes",codex:"Built-in Codex CLI, browser, and code execution environment"},categories:{tools:"Tools",productivity:"Productivity",browser:"Browser automation",system:"System and media"},options:{"lark-cli":"Lark Open Platform command-line tool",pandoc:"Document format converter",opencli:"Convert websites and desktop apps into command-line tools",uv:"Fast Python package and project manager",ripgrep:"High-performance text search tool",jq:"JSON query and transformation tool","github-cli":"Manage GitHub workflows from the terminal",playwright:"Browser automation and end-to-end testing",chromium:"Headless browser runtime",git:"Source control",curl:"Network requests and file downloads",ffmpeg:"Audio and video transcoding and processing",imagemagick:"Image conversion and batch processing"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec",hoursMinutes:"{{hours}} hr {{minutes}} min"},buildStatus:{preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Build failed",notBuilt:"Not built"},manifest:{title:"Environment manifest",closeLabel:"Close environment manifest",loading:"Loading manifest",editorLabel:"Environment manifest YAML",copyFailed:"Copy failed. Try again.",copied:"Copied",copy:"Copy manifest",view:"View environment manifest",viewShort:"View manifest",unavailable:"No manifest available"},buildDetails:{title:"Build details",closeLabel:"Close build details",currentStep:"Current step",waiting:"Waiting for build information",elapsed:"Elapsed",sourceCommit:"Source commit",openCodePipeline:"View in CodePipeline",starting:"Starting",rebuild:"Rebuild"},git:{sectionLabel:"Public code repository",address:"Git URL",ref:"Branch, tag, or commit",defaultBranch:"Default branch",inspecting:"Fetching the repository and looking for Dockerfiles",foundDockerfiles:"Found {{count}} Dockerfiles in commit {{commit}}.",savedDockerfileLoaded:"Loaded the saved Dockerfile. Inspect the repository again to check for updates.",noDockerfile:"No Dockerfile was found. Check the branch or repository contents.",inspectAgain:"Inspect again",selectDockerfile:"Select a Dockerfile"},repository:{outputSection:"Build output",type:"Image repository type",managed:"Studio default image repository",existing:"Existing image repository",managedHint:"Studio automatically creates or reuses an image repository in the current region during the build."},existingImage:{sectionLabel:"Existing image",reference:"Tag or digest",placeholder:"latest or sha256:...",hint:"Enter an image tag or a complete digest beginning with sha256:."},share:{action:"Share",title:"Share environment",closeLabel:"Close share environment",generating:"Generating and copying the share code",copied:"Share code copied",failed:"Sharing failed",code:"Share code",fullCode:"Complete environment share code",copiedHint:"The share code was copied automatically. You can also view or copy it here.",copyFailedHint:"Automatic copy failed. Copy the share code above manually or try again.",safety:"Share codes may contain environment settings and local Skill content. Send them only to trusted recipients.",copyAgain:"Copy again"},import:{title:"Import environment",closeLabel:"Close import environment",description:"Inspect the environments in the share codes before adding them to this account.",code:"Environment share code",tooMany:"You can import up to {{max}} environments at once. {{count}} share codes were found.",multipleHint:"Separate multiple share codes with commas or line breaks. Duplicates are ignored automatically.",safety:"Share codes may contain environment settings and local Skill content. Import them only from trusted sources.",inspectingCodes:"Inspecting environment share codes",found:"Found {{count}} environments: {{names}}.",itemError:"Share code {{index}}: {{error}}",invalidCode:"Invalid share code.",noResult:"The service returned no import result for this share code.",partial:"Imported {{created}} environments; {{remaining}} remain. Valid failed items can be retried.",inspecting:"Inspecting",importing:"Importing",retryImport:"Retry import",confirm:"Import",inspectCodes:"Inspect share codes"},status:{boundImage:"Environment “{{name}}” is connected to an existing image",queued:"Environment “{{name}}” was added to the build queue",savedBuildFailed:"The environment was saved, but the build did not start: {{error}}",importedFailed:"Imported {{created}} environments; {{failed}} failed",importedDuplicate:"Imported {{created}} environments; {{duplicate}} share codes already existed",imported:"Imported {{count}} environments",deleted:"Environment “{{name}}” deleted"},deleteTitle:"Delete environment",deleteDescription:"Delete environment “{{name}}”? This cannot be undone.",errors:{repositoryRequired:"Enter a public code repository URL.",repositoryHttps:"Enter the HTTPS URL of a public repository.",repositoryInvalid:"Enter a valid public repository HTTPS URL.",imageReferenceWhitespace:"A tag or digest cannot contain spaces.",imageDigestInvalid:"The digest must be a complete sha256 value.",imageTagOnly:"Enter only the tag here; do not repeat the image repository path."}},roe={searchPlaceholder:"Search resource names",emptyMessage:"No options available",searchAriaLabel:"Search {{label}}",loadingMore:"Loading more resources…"},soe={retryDeployment:"Retry deployment",retrying:"Retrying…",collapse:"Collapse error details",expand:"Expand full error details",copy:"Copy full error details"},aoe={steps:"Build steps",log:"Build log",syncing:"Syncing",loadFailed:"Failed to load",synced:"Synced",recentOnly:" · Recent logs only",copiedLog:"Build log copied",copyLog:"Copy build log",copied:"Copied",copy:"Copy",logContent:"Build log content",waiting:"Waiting for CodePipeline logs…",empty:"No build logs"},ooe={defaultLabel:"Studio default environment",defaultDescription:"Use the standard runtime environment provided by Studio",status:{notBuilt:"Not built",preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Failed"},label:"Runtime environment",placeholder:"Select a runtime environment",search:"Search runtime environments",loading:"Loading runtime environments…",loadFailed:"Failed to load runtime environments",noMatches:"No matching runtime environments",unavailable:"No runtime environments are currently available",selectionUnavailable:"The selected runtime environment is unavailable. Select another one.",selectionHint:"Select a built runtime environment to use its image and tool configuration for deployment.",versionChanged:"The selected environment version has changed. Review it before continuing.",versionMissing:"The selected environment version no longer exists. Select another one.",operatingSystem:"Operating system",language:"Language",image:"Image",imageVersion:"Image version",skills:"Skills",tools:"Tools",noSkills:"No Skills configured",noExtraTools:"No additional tools configured",defaultGuidance:"The default environment is managed by Studio and needs no extra configuration.",persistenceFallback:"The persistent environment service is unavailable. The default environment is being used.",emptyFallback:"No custom environments are available."},loe={repository:"GitHub repository",githubUrl:"GitHub URL",token:"Token",sessionToken:"{{provider}} Session Token",runtime:"Runtime",commit:"Commit",workflow:"Workflow",syncFailed:"Failed to sync GitHub code",status:{mounted:"Mounted",bound:"Bound",synced:"Synced",created:"Created"},volcengine:"Volcengine",mountDelivery:"Enable continuous delivery",selectedForDeployment:"Selected for deployment",mountOnDeploy:"Enable continuous delivery on deploy",syncCode:"Sync code",deliveryMode:"GitHub delivery mode",sourceSync:"GitHub code sync",delivery:"GitHub delivery",loading:"Loading",running:"Running",runtimeDeliveryHint:"Write an AgentKit Runtime GitHub Actions workflow so future GitHub commits update the bound Runtime.",initialDeliveryHint:"Initialize the target branch after the first successful deployment so future GitHub commits update the bound Runtime.",sourceSyncHint:"Studio pushes directly to the target branch. Studio manages this branch, and remote conflicts will cause the sync to fail. Use the deployment button to publish the Runtime.",tokenPlaceholder:"repo or contents:write permission",getToken:"Get token",hideToken:"Hide token",showToken:"Show token",tokenHelp:"The token is used only for this operation and is cleared from the form after success.",targetBranch:"Target branch",actionsSecretPlaceholder:"Used to write a GitHub Actions secret",sessionTokenPlaceholder:"Optional temporary credential",syncing:"Syncing…",pendingHint:"Continuous delivery is selected. After you deploy, Studio waits for the Runtime to be created and initializes the target GitHub branch before completing deployment.",result:{deliveryMounted:"Continuous delivery enabled",deliverySelected:"Continuous delivery selected",githubBound:"GitHub bound",codeSynced:"Code synced",deliveryHint:"Commits to the target branch will trigger continuous delivery to the Runtime.",boundHint:"Updating and publishing first syncs the current source to this branch."},branch:"Branch",viewPr:"View PR",createFailed:"Creation failed",phase:"Phase",log:"Log"},coe={name:"Feishu",enabling:"Enabling and updating configuration…",description:"Receive messages and reply through a Feishu bot",configuration:"Feishu configuration",configurationMode:"Feishu configuration mode",automatic:"Automatic",manual:"Manual",cancelling:"Cancelling…",scanToCreate:"Scan to create",scanDescription:"Credentials are filled in after authorization",generateQrCode:"Generate QR code",qrCodeAlt:"Feishu bot configuration QR code",scanToConfirm:"Scan with Feishu to confirm",expiresIn:"Expires in {{time}}",created:"Bot created",credentialsFilled:"App credentials filled in automatically",qrCodeExpired:"QR code expired",automaticFailed:"Automatic configuration failed",regenerateQrCode:"Generate a new QR code.",configuredPlaceholder:"Configured; leave blank to keep it",appSecretPlaceholder:"Enter App Secret",hideSecret:"Hide App Secret",showSecret:"Show App Secret"},uoe={mode:{auto:"Create automatically",autoDescription:"Create required resources during deployment",recommended:"Recommended",create:"Specify names",createDescription:"Create or reuse resources with the specified names",existing:"Select existing",existingDescription:"Select existing resources from the current account"},selectExisting:"Select an existing resource",searchResource:"Search resource names",noMatch:"No matching resources",noAvailable:"No resources available",searching:"Searching cloud resources…",loading:"Loading cloud resources…",noMatchSentence:"No matching resources.",noAvailableSentence:"No resources available.",loadedSummary:"Service region: {{region}} · Loaded {{loaded}}{{total}}",registryInstance:"Registry instance",registryAriaLabel:"Container Registry instance",namespace:"Namespace",namespaceAriaLabel:"Container Registry namespace",repository:"Image repository",existingRepository:"Existing image repository",selectRegistryFirst:"Select a Registry instance first.",selectNamespaceFirst:"Select a Namespace first.",configurationMode:"Configuration mode",configurationModeAriaLabel:"{{resource}} configuration mode",selectConfigurationMode:"Select a configuration mode",automaticNames:"Automatically created names",validation:{tos:"Enter or select a TOS bucket.",cr:"Enter or select a CR instance, namespace, and image repository.",codePipeline:"Enter or select a CodePipeline Workspace and Pipeline.",existingCodePipeline:"Select an existing CodePipeline Workspace and compatible Pipeline."},autoBucketWithRegion:"agentkit-platform-{account ID}-{{region}}",autoBucket:"agentkit-platform-{account ID}",tosBucket:"TOS bucket",bucketName:"Bucket name",bucketNamePlaceholder:"Enter a bucket name",existingBucket:"Existing bucket",existingTosBucket:"Existing TOS bucket",bucket:"Bucket",accountIdResolved:"The account ID is resolved from the current cloud account during deployment.",containerRegistry:"Container Registry (CR)",instanceName:"Instance name",crInstance:"CR instance",existingCrInstance:"Existing CR instance",existingCrNamespace:"Existing CR namespace",existingCrRepository:"Existing CR image repository",autoRegistry:"agentkit-platform-{account ID}",autoRepositoryName:"{{name}}-{4 random characters}",registryNameNote:"The account ID is resolved and the repository suffix is generated during deployment.",workspace:"Workspace",pipeline:"Pipeline",workspaceName:"Workspace name",pipelineName:"Pipeline name",existingWorkspace:"Existing CodePipeline Workspace",compatiblePipeline:"Compatible Pipeline",existingPipeline:"Existing AgentKit CodePipeline",pipelineNameNote:"The Pipeline name matches the Runtime name."},doe={commit:"Commit",steps:{permissions:"Preflight OTA permissions",resolving:"Resolve target version",downloading:"Download and verify the full update package",preparing:"Prepare VeFaaS Function code",provisioning:"Check and provision Studio cloud resources",scheduler:"Update the scheduled task service",submitting:"Submit the Function update",publishing:"Publish a new Revision and restart the service"},stages:{permissions:"Preflight OTA permissions",resolving:"Resolve version details",downloading:"Download update package",preparing:"Prepare Function code",provisioning:"Provision Studio cloud resources",scheduler:"Update scheduled task service",submitting:"Submit Function update",publishing:"Publish Revision",checking:"Check for updates",unknown:"Unknown stage"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec"},logPermissionPrefix:"Unable to read VeFaaS release logs. The Function role lacks ",logPermissionSuffix:"; the update will continue.",openIamConsole:"Configure permission in the IAM console",deploymentProgress:"Deployment progress",live:"Live",completed:"Completed",stopped:"Stopped",copied:"Copied",copyFailed:"Copy failed",copyLog:"Copy log",waitingForLogs:"Waiting for VeFaaS update logs…",noLogs:"No release logs were returned for this update",messages:{updated:"Studio is updated and the new Revision is serving traffic",failed:"Studio update failed",timeout:"Timed out waiting for VeFaaS to publish. Check for updates again later.",submitted:"Update submitted. Waiting for VeFaaS to publish the new version.",connectionSwitched:"The connection changed. Confirming the new version status."},checkingPermissions:"Checking OTA permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",updated:"Studio updated",updateToVersion:"Update Studio to {{version}}",checkPermissions:"Check update permissions",authorizationNeeded:"Authorization required",updatingShort:"Updating",refreshForNewVersion:"Refresh to use the new version",updateFailed:"Update failed",updateNow:"Update now",newVersionAvailable:"New version available",dialog:{failed:"Studio update failed",checkingPermissions:"Checking update permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",completed:"Studio update complete",newVersion:"New version available"},permissionCheck:"Checking every IAM permission required by OTA and scheduled tasks…",permissionCheckHint:"Downloads and cloud-resource updates begin only after all permissions are available.",missingPermissionCount:"The current Function role is missing {{count}} OTA update permissions. No cloud resources have been changed.",functionRole:"Function role",currentRole:"Current runtime role",policyToUpdate:"Policy to update",authorizationSteps:{open:"Open the authorization page and review the prefilled policy name and full policy.",debug:"Select “Start debugging” on the page to apply the policy update.",return:"Return to this window and select “Authorized, check again”."},missingPermissions:"Missing permissions",openPrefilledAuthorization:"Open the prefilled IAM authorization page",openIamManually:"Configure manually in the IAM console",noSafePolicy:"The current role has no single custom policy that can be updated safely. Ask an administrator to add the permissions above to this role.",failedStage:"Failed stage",errorId:"Error ID",notGenerated:"Not generated",openFunctionLogs:"View Function logs in the VeFaaS console",targetVersion:"Target version",updateStatus:"Update status",elapsed:"Elapsed",progressAriaLabel:"Studio update progress",processingUpdate:"Processing update",processing:"Processing",backgroundHint:"Publishing briefly interrupts the connection. Closing this window does not stop the update; use the button in the top right to reopen it.",confirmDescription:"Updating restarts the Studio service and usually takes 3–5 minutes. Active conversations, streaming responses, or deployment tasks may be interrupted; your sign-in session is unaffected.",selectVersion:"Select version",currentVersion:"Current version",changelog:"What's new",noChangelog:"No release notes",runInBackground:"Run in background",authorizedRecheck:"Authorized, check again",tryAgain:"Try again"},foe={deploy:"Deploy",update:"Update",planHash:"Plan hash",backToConfiguration:"Back to configuration",releaseRegion:"Release region",deployRegion:"Deployment region",regionPreserved:"The existing Runtime deployment region is preserved during updates and cannot be changed.",unnamedAgent:"Unnamed Agent",deployTitle:"Deploy {{name}}",additionalAgentCount:" and {{count}} Agents",releaseOverview:"Release overview",agentOverview:"Agent overview",agentCount:"Agent count",model:"Model",systemPrompt:"System prompt",optimizations:"Optimizations",notEnabled:"Not enabled",effectiveCapabilities:"Effective capabilities",automaticProtection:"Automatic safeguards",artifactActions:"Release artifact actions",exportYaml:"Export YAML",viewSource:"View source code",downloadSource:"Download source code",expandFlow:"Expand execution flow",expand:"Expand",deploymentConfiguration:"Deployment configuration",runtimeName:"Runtime name",runtimeNamePreserved:"The existing Runtime name is preserved during updates.",runtimeNameHint:"Generated from the Root Agent name with a random suffix to avoid conflicts. Use 4–64 letters, numbers, hyphens, or underscores.",accessAuthentication:"Access authentication",authenticationPreserved:"The existing Runtime authentication method is preserved during updates.",authenticationMethod:"Authentication method",authenticationAriaLabel:"Deployment authentication method",authenticationPlaceholder:"Select an authentication method",messageChannels:"Message channels",instanceSettings:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",sidecarSingleInstance:"Harness Sidecar currently supports one instance only. The Runtime is fixed at 1–1.",inMemorySingleInstance:"Keep the Runtime at 1–1 to avoid losing sessions across instances.",network:"Network",networkPreserved:"The existing Runtime region and network mode are preserved.",networkMode:"Network mode",networkModes:{public:"Public",both:"Public + VPC"},subnetId:"Subnet ID",subnetHint:"Optional; separate multiple IDs with commas",sharedInternetAccess:"Shared public internet access in the VPC",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",createEvaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment succeeds.",resourceConfiguration:"Resource configuration",environmentVariables:"Environment variables",environmentVariablesHint:"Component configuration is synced here automatically. Review the final values before deployment.",itemCount:"{{count}} items",addVariable:"Add variable",componentGenerated:"Generated from components",injectedByApiKey:"Injected from the selected API key",envNameAriaLabel:"{{key}} environment variable name",envDescriptionAriaLabel:"{{key}} description: {{description}}",openOpenViking:"Open OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}: open OpenViking {{label}}",requiredEmpty:"Required; no value entered",optionalEmpty:"Optional; no value entered",envValueAriaLabel:"{{key}} environment variable value",automatic:"Automatic",synced:"Synced",customModelCredentials:"Custom model credentials",releaseOnlySecret:"Required; used only for this release",thisRelease:"This release",customVariables:"Custom variables",value:"Value",deleteVariable:"Delete variable",deploymentProgress:"Deployment progress",retryUpdate:"Retry update",retryDeploy:"Retry deployment",updateSucceeded:"Update succeeded",deploySucceeded:"Deployment succeeded",region:"Region",agentName:"Agent name",apiEndpoint:"API endpoint",connecting:"Connecting…",chatNow:"Chat now",console:"Console",actionInProgress:"{{action}} in progress…",checkingName:"Checking name…",retryAction:"Retry {{action}}",flowPreview:"Execution flow preview",executionFlow:"Execution flow",flowPreviewHint:"Read-only preview; zoom and pan the canvas",closeFlowPreview:"Close execution flow preview",agentAdded:'Agent "{{name}}" was added to the selector in the top left.',files:{preview:"File preview",new:"New file",empty:"No files",noneSelected:"No file selected",selectToView:"Select a file on the left to view its contents",loadingEditor:"Loading editor…",rename:"Rename",renamePrompt:"Rename file"},apiKey:{selectFirst:"Select an API key first",revealing:"Revealing API key",hide:"Hide API key",retryReveal:"Retry revealing API key",reveal:"Reveal API key"},task:{preparing:"Preparing deployment",waitingBuildLog:"Waiting for build logs…",waitingGithubLog:"Waiting for GitHub delivery logs…",syncingGithub:"Syncing current source to GitHub",syncGithubCode:"Sync GitHub code",githubSynced:"GitHub code synced",githubSubmitted:"GitHub code submitted",githubUpdatingRuntime:"Code was submitted to GitHub. GitHub Actions is updating the same Runtime.",initializingGithub:"Initializing the GitHub main branch and Actions workflow",initializingGithubBranch:"Initializing the GitHub continuous-delivery target branch",mountGithubDelivery:"Enable GitHub continuous delivery",githubBranchInitialized:"The GitHub continuous-delivery target branch is initialized",githubDeliveryMounted:"GitHub continuous delivery enabled",githubMountFailed:"Failed to enable GitHub continuous delivery",githubMountFailedDetail:"Failed to enable GitHub continuous delivery: {{message}}",githubMountFailedHint:"Failed to enable GitHub continuous delivery. See the GitHub log for details.",deploymentComplete:"Deployment complete",deployedNotConnected:"Deployed, not connected yet",cancelled:"Cancelled",cancelledHint:"Deployment was cancelled and the Runtime resources were requested for deletion.",deploymentStatusUnconfirmed:"Deployment status unconfirmed",deploymentFailed:"Deployment failed",buildFailedHint:"Image build failed. See the build log for details."},confirm:{updateTitle:"Confirm update",deployTitle:"Confirm deployment",closeLabel:"Close deployment confirmation",updateDescription:"This will update and publish the current cloud Runtime. It may take a few minutes. Continue?",deployDescription:"This will create a new cloud Runtime. Deployment may take a few minutes. Continue?",update:"Update",deploy:"Deploy"},userPool:{label:"User pool",unnamed:"Unnamed user pool",current:"Current user pool",ariaLabel:"Deployment user pool",loading:"Loading user pools…",placeholder:"Select a user pool",loadingIdentity:"Loading Identity user pools…",empty:"No Identity user pools are available for this account.",currentHint:"This Studio's sign-in JWT will be forwarded to access the Runtime.",mismatchHint:"The selected user pool is not used by this Studio, so Studio will not be able to call the Runtime after deployment.",markedHint:"The user pool used by this Studio is marked in the list."},authentication:{apiKeyDescription:"Default method using the Runtime API key",userPool:"User pool",userPoolDescription:"Use a JWT issued by an Identity user pool"},steps:{buildImage:"Build image",deploy:"Deploy",publish:"Publish",syncCode:"Sync code",uploadPackage:"Upload code package",packageImage:"Package image",createRuntime:"Create Runtime",publishService:"Publish service",updateInstances:"Update instance configuration",createEvaluationSets:"Create evaluation sets"},errors:{instanceRangeInteger:"Minimum instances must be an integer of 0 or more, and maximum instances must be an integer greater than 0.",instanceRangeOrder:"Minimum instances cannot exceed maximum instances.",selectApiKey:"Select an API key in the model configuration first.",loadApiKey:"Failed to load the API key. Try again.",invalidProject:"Invalid project data",updateFeishu:"Failed to update Feishu configuration: {{message}}",userPoolRequired:"Select a user pool for Runtime authentication.",vpcRequired:"Enter a VPC ID when using a VPC network.",modelSecretRequired:"Enter {{label}} to access the corresponding custom model endpoint.",managedApiKeyRequired:"{{requirement}}. Return to model configuration and select an API key first.",feishuEnvRequired:"Enter {{field}} after enabling Feishu.",runtimeNameExists:"This Runtime name already exists. Change it and try again.",deployedButGithubMountFailed:"Deployment succeeded, but enabling GitHub continuous delivery failed: {{message}}",deployedButGithubBindFailed:"Deployment succeeded, but binding GitHub failed: {{message}}",deploymentStatusUnconfirmed:"The connection was interrupted, so the final deployment status cannot be confirmed. The task may still be running in the cloud. Check the same task in AgentKit or CodePipeline and avoid a duplicate deployment.",failedAtStage:"{{action}} failed during {{stage}}: {{message}}",noAgentAtEndpoint:"Connected successfully, but no Agents were found at this endpoint (/list-apps is empty).",addAgent:"Failed to add Agent: {{message}}",modelApiKeyRequired:"Enter the API key for this model endpoint."}},hoe={title:"Workspaces",detail:"Workspace details",create:"New workspace",editorDescription:"Group frequently used environments. An environment can belong to multiple workspaces.",backToList:"Back to workspaces",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",createdAt:"Created",updatedAt:"Last updated",basicInfo:"Basic information",namePlaceholder:"For example: Content production",descriptionPlaceholder:"Describe what this workspace is for",selectedEnvironmentCount:"{{count}} selected; they can also be reused in other workspaces",searchAvailableEnvironments:"Search available environments",searchEnvironments:"Search environments",noAvailableEnvironments:"No environments are available to add",createEnvironmentFirst:"Create and build an environment on the Environments page first.",noMatchingEnvironments:"No matching environments",tryAnotherName:"Try searching for another name.",environmentStatus:{available:"Available",building:"Building",notBuilt:"Not built"},added:"Added",saved:"Workspace “{{name}}” saved",resourceType:"Workspace resource type",searchWorkspaces:"Search workspaces",loadFailed:"Unable to load workspaces",noMatchingWorkspaces:"No matching workspaces",tryAnotherNameOrEnvironment:"Try another name or environment",noEnvironmentAdded:"No environments added",environmentMissing:"Environment missing",availableFraction:"{{available}}/{{total}} available",available:"Available",availableCount:"{{count}} available",updated:"Updated",addEnvironment:"Add environment",deleteTitle:"Delete workspace",deleteDescription:"Delete workspace “{{name}}”? Its environments will not be deleted.",deleted:"Workspace “{{name}}” deleted",clipboardPermissionError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually."},poe={back:"Back",detailNavigation:"Detail navigation",noData:"No data",actions:"Actions",moreActions:"More actions for {{label}}",actionsFor:"Actions for {{label}}",loading:"Loading resources…"},moe={addSkill:"Add Skill",remove:"Remove {{name}}",confirmRemoveRuntime:"Remove the running Skill “{{name}}” from the new version?",selectedCount:"Added skills · {{count}}",close:"Close {{label}}",sources:{runtime:"Running source · Preserved as-is; remove it or replace it with a Skill of the same name",local:"Local",skillspace:"AgentKit Skills Center",skillhub:"Volcengine Find Skill marketplace"},tabs:{local:"Local files",localShort:"Local files",skillspace:"AgentKit Skills Center",skillspaceShort:"AgentKit",skillhub:"Volcengine Find Skill marketplace",skillhubShort:"Find Skill"}},goe={tasks:{ppt:"Presentation",image:"Image generation",video:"Video generation"},prompts:{ppt:{quarterlyReview:"Review 【quarter】 business performance, highlighting metric gaps, causes, and recommended actions",projectUpdate:"Present the progress of 【project name】: milestones, risks, budget, and resource requests",solutionProposal:"Create a solution proposal for 【customer industry】: pain points, architecture, implementation plan, and benefits",industryAnalysis:"Analyze trends in 【industry topic】 and recommend strategic opportunities based on the competitive landscape"},image:{launchVisual:"Design a 【high-tech】 launch-event key visual for 【brand or product】",ecommercePoster:"Create an e-commerce poster for 【product name】 that highlights 【core selling point】 and brand colors",conceptRendering:"Create a photorealistic concept rendering of 【product or space】 in 【usage scenario】",socialGraphic:"Create a concise, professional corporate social graphic for 【campaign theme】"},video:{brandFilm:"Create a 30-second promotional video for 【brand name】 that highlights 【brand value】",productLaunch:"Create a 45-second launch video for 【product name】 covering the pain point, features, scenarios, and call to action",trainingVideo:"Create a corporate training video about 【training topic】 that clearly explains 【key procedure or policy】",eventTeaser:"Create a 20-second teaser for 【event name】 with highlights, time and location, and registration details"}},firstFrame:"First frame",videoToEdit:"Video to edit",baseVideo:"Base video",optimizeSkillPlaceholder:"Describe the skill you want to improve…",createSkillPlaceholder:"Describe the skill you want to create…",createVideoPlaceholder:"Describe the video you want to create…",messageAgentPlaceholder:"Message {{name}}…",selectAgentFirst:"Select an agent first",selectSkillFirst:"Select the Skill you want to improve first",availableSkills:"Available skills",availableSubagents:"Available sub-agents",invokeSkill:"Use a skill",useSubagent:"Use a sub-agent",loadingCapabilities:"Loading Agent capabilities…",noMatchingSkills:"No matching skills for this Agent",noMatchingSubagents:"No matching sub-agents for this Agent",skillFallbackDescription:"Load and run this skill",agentFallbackDescription:"Hand this turn to the Agent",skill:"Skill",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",taskMode:"Task mode",selectTaskMode:"Select a task mode",loadingGenerationModel:"Loading generation model",modelUnavailable:"Model unavailable",cancelTask:"Cancel {{task}} task",stopGenerating:"Stop generating",viewVideoProgress:"View video generation progress",send:"Send",selectTaskType:"Select a task type",enterprisePrompts:"{{task}} enterprise prompts",sessionId:"Session ID",sessionIdLabel:"Session ID: ",initializing:"Initializing",copied:"Copied",copySessionId:"Copy session ID",sessionIdCopied:"Session ID copied",disclaimer:"Responses may be inaccurate",viewLogs:"View logs"},boe={selectAgent:"Select Agent",noLocalAgents:"No local Agents.",searchRuntime:"Search Runtime names",mineOnly:"Created by me",noRuntimes:"No Runtimes.",unsupported:"Unsupported",createdByMe:"Created by me",connecting:"Connecting…",connected:"Connected",connect:"Connect",viewInfoFor:"View information for {{name}}",viewInfo:"View information",agentAndRuntimeInfo:"Agent and Runtime information",detailType:"Detail type",agentInfo:"Agent information",runtimeInfo:"Runtime information",loadingAgentInfo:"Loading Agent information…",cannotLoadAgentInfo:"Agent information is temporarily unavailable",unnamedAgent:"Unnamed Agent",subagents:"Sub-agents",tools:"Tools",skills:"Skills",previewUnsupported:"Preview unavailable",mountedComponents:"Mounted components",noMoreAgentInfo:"No additional Agent configuration information.",local:"Local",model:"Model",status:"Status",memoryMb:"Memory {{value}} MB",instances:"Instances {{min}}–{{max}}",resources:"Resources",version:"Version",loadingDetails:"Loading details…",environmentVariables:"Environment variables",errors:{notFound:"This Runtime no longer exists or the list is out of date. Refresh the list and try again.",accessDenied:"This account cannot access the Runtime. Check its Project and access permissions.",previewUnsupported:"This Agent Server version does not support information previews.",unavailable:"This Runtime is temporarily unavailable. Confirm that its status is Ready and try again.",timeout:"Loading timed out. Try again."},componentKinds:{knowledgebase:"Knowledge base",memory:"Memory",prompt_manager:"Prompt manager",example_store:"Example store",run_processor:"Run processor",tracer:"Trace",toolset:"Toolset",plugin:"Plugin",other:"Other"},runtimeStatus:{ready:"Ready",unreleased:"Unreleased",running:"Running",active:"Running",creating:"Creating",pending:"Pending",deploying:"Deploying",updating:"Updating",failed:"Failed",error:"Error",stopping:"Stopping",stopped:"Stopped",deleting:"Deleting",deleted:"Deleted"}},yoe={recoveryPaused:"Some historical agents could not be restored after multiple attempts. Automatic recovery is paused.",restoringHistory:"Some historical agents are being restored and will appear automatically.",agent:"Agents",agentTypes:{general:"General Agents",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"Created by",namedAgent:"{{name}} Agent",storageLocation:"Storage location",currentBrowser:"Current browser",region:"Region",viewDeploymentProgress:"View deployment progress for {{name}}",viewRuntimeDetails:"View Runtime details for {{name}}",viewDetails:"View details for {{name}}",time:"Time",remainingTime:"Time remaining",expiringSoon:"Expiring soon",sandboxRemaining:"{{hours}} hr {{minutes}} min",wakeable:"Wakeable",neverExpires:"Never expires",editDraftNamed:"Edit draft {{name}}",viewProgress:"View progress",deleteDraftNamed:"Delete draft {{name}}",recheckCompatibility:"Check chat compatibility for {{name}} again",connectedNamed:"{{name}} is connected",wakeAndChat:"Wake {{name}} and start chatting",chatWith:"Chat with {{name}}",waking:"Waking…",deploying:"Deploying",draft:"Draft",checking:"Checking",chatUnsupported:"Chat unsupported",checkFailed:"Check failed",creatorFilter:"Creator filter",agentType:"Agent type",searchAgents:"Search Agents",handoff:"Handoff",agentList:"{{type}} list",noMatchingAgents:"No matching Agents",adjustSearch:"Try adjusting the search or filters",noAgentType:"No {{type}}",noGeneralAgents:"No General Agents",createGeneralAgentDescription:"Create a General Agent to start building and chatting",createAgentType:"Create {{type}}",createAgent:"Create Agent",loadingMore:"Loading more Agents",scrollForMore:"Scroll down to load more",allLoaded:"All Agents loaded",deleteDraftTitle:"Delete draft?",deleteDraftDescription:"“{{name}}” cannot be recovered after deletion.",deleteDraft:"Delete draft",loadGeneralAgents:"Load General Agents",loadAgentType:"Load {{type}}",compatibility:{checking:"Requesting Runtime /list-apps to confirm that this Agent supports Studio chat.",empty:"Runtime /list-apps returned no available Agents, so chat is currently unavailable.",supported:"This Runtime supports Studio chat.",unknownError:"The Runtime /list-apps request failed without a recognizable error."},sandboxStatus:{ready:"Ready",wakeable:"Wakeable",creating:"Creating",starting:"Starting",initializing:"Starting",pending:"Pending",running:"Running",failed:"Error",error:"Error",stopped:"Stopped",expired:"Expired",deleting:"Deleting",deleted:"Deleted",unknown:"Unknown status"}},voe={library:"Skill library",skill:"Skill",skills:"Skills",skillSpace:"Skill space",sandboxNotConfigured:"Dev Sandbox is not configured by an administrator",adminNotConfigured:"Not configured by an administrator",totalItems:"{{count}} items",cannotLoadSpaces:"Unable to load Skill spaces",someSpacesFailed:"Some Skill spaces failed to load",degradedRelationWarning:"Some relations are invalid. Readable skills have been restored.",downloadZip:"Download ZIP",optimize:"Optimize",closeSkillDetails:"Close Skill details",skillId:"Skill ID",allFiles:"All files",loadingSkillContent:"Loading Skill content…",noSkillContent:"This Skill has no SKILL.md content",addSkill:"Add Skill",localUpload:"Upload locally",localUploadDescription:"Select a ZIP file and upload it to the Skill space after validation",autoCreate:"Create automatically",autoCreateDescription:"Choose a model and style, then create a Skill through conversation",createSkill:"Create Skill",optimizeNamed:"Optimize {{name}}",deleteSkillConfirm:"Delete the entire Skill “{{name}}”? This affects every space that references it.",deleteSpaceConfirm:"Delete Skill space “{{name}}”? Make sure its Skills have been deleted first.",manageSpaceDescription:"Manage Skills in this space and create new versions",backToSpaces:"Back to Skill spaces",overview:"Overview",skillCount:"Skills",skillCountValue_one:"{{count}} Skill",skillCountValue_other:"{{count}} Skills",updatedAt:"Updated",skillsInSpace:"Skills in {{name}}",searchSkills:"Search Skills",cannotLoadSkills:"Unable to load Skills",noMatchingSkills:"No matching Skills",noSkills:"No Skills",tryAnotherName:"Try searching for another name",emptySkillsDescription:"Upload a Skill locally or create one automatically",actions:"Actions",spaceDetails:"Skill space details",editSpace:"Edit space",deleteSpace:"Delete space",searchSpaces:"Search Skill spaces",spaceList:"Skill space list",noMatchingSpaces:"No matching Skill spaces",createSpace:"Create Skill space",newSpace:"New space",loadingMoreSpaces:"Loading more Skill spaces",scrollForMore:"Scroll down to load more",allSpacesLoaded:"All Skill spaces loaded",errors:{loadSpaces:"Unable to load Skill spaces. Try again later.",loadSkills:"Unable to load Skills. Try again later.",loadSkillDetails:"Unable to load Skill details. Try again later.",deleteSkill:"Unable to delete the Skill",deleteSpace:"Unable to delete the Skill space",downloadSkill:"Unable to download the Skill"},status:{active:"Available",available:"Available",creating:"Creating",disabled:"Disabled",enabled:"Enabled",failed:"Error",inactive:"Inactive",pending:"Pending",published:"Published",ready:"Ready",released:"Published",running:"Running",success:"Healthy",unavailable:"Unavailable",unreleased:"Unreleased",updating:"Updating",unknown:"Unknown"}},xoe={library:"Knowledge bases",createBase:"New knowledge base",editBase:"Edit knowledge base",invalidName:"The name must start with a letter and contain only letters, numbers, and underscores.",nameHelp:"Start with a letter. Use up to 48 letters, numbers, or underscores.",optionalDescription:"Description (optional)",descriptionOnly:"AgentKit currently supports updating only the knowledge base description.",previewWeb:"Preview web content",addData:"Add data",openOriginalWeb:"Open original page",backToEdit:"Back to edit",confirmAdd:"Confirm and add",source:"Knowledge source",image:"Image",documentFile:"Document file",webPage:"Web page",webUrl:"Web page URL",generatingWebPreview:"Fetching the page and generating a Markdown preview",selectFile:"Select knowledge file",selectOrDropFile:"Select a file or drag it here",selectedFile:"{{size}} · Click to select another file",imageFileHelp:"PNG, JPG, and JPEG up to 200 MB",documentFileHelp:"PDF, PPTX, DOCX, XLSX, and TXT up to 200 MB",uploadingFile:"Uploading the file and adding it to the knowledge base",optionalName:"Name (optional)",optionalType:"Type (optional)",generatePreview:"Generate preview",uploadFile:"Upload file",editMetadata:"Edit knowledge metadata",knowledge:"Knowledge item",field:"Field",value:"Value",backToList:"Back to knowledge bases",metadataJson:"Metadata (JSON)",provider:"Provider",knowledgeId:"Knowledge ID",project:"Project",creator:"Created by",data:"Data",deleteInvalidAssociation:"Delete invalid association",noData:"This knowledge base has no data",addFirstData:"Add the first data item",format:"Format",size:"Size",searchData:"Search data",searchLibraryData:"Search knowledge base data",associationInvalid:"Association invalid",providerMissing:"The underlying Provider knowledge base no longer exists",noMatchingData:"No matching data",loadingMoreData:"Loading more data",retryLoading:"Retry loading",details:"Knowledge base details",searchBases:"Search knowledge bases",someBasesFailed:"Some knowledge bases are temporarily unavailable. Other available content is shown.",noMatchingBases:"No matching knowledge bases",noManagePermission:"You do not have permission to manage this knowledge base",loadingMoreBases:"Loading more knowledge bases",deleteBaseTitle:"Delete knowledge base?",deleteBaseDescription:"This removes the AgentKit association for {{name}}. If Studio created it, the Provider resource is also deleted. This cannot be undone.",deleteDocumentTitle:"Delete knowledge item?",deleteDocumentDescription:"This removes {{name}} from the Provider knowledge base. This cannot be undone.",preview:{processingTitle:"Data is being processed",processingDetail:"A preview will be available after parsing. Reload later.",failedTitle:"Data parsing failed",failedDetail:"Check the source file or page URL and add it again, or reload the latest status.",noParsedTitle:"No parsed content is available yet",noParsedDetail:"Text, tables, or page images will appear after the knowledge base finishes parsing this file.",noMediaTitle:"No media preview is available yet",noMediaDetail:"The knowledge base has not returned an accessible media preview. Reload later.",noDataTitle:"No data is available to preview",noDataDetail:"The knowledge base has not returned parsed results. Reload later.",attachmentError:"The attachment cannot be previewed. Try again later.",imageAlt:"Knowledge data image",audioUnsupported:"This browser does not support audio previews.",videoUnsupported:"This browser does not support video previews.",namedPdf:"{{name}} PDF preview",pdf:"PDF preview",openPdf:"If it cannot be displayed, open the PDF in a new window",fileUnsupported:"This format cannot be previewed directly online. Parsed content is shown when available.",openOriginalFile:"Open original file",loading:"Loading data preview",openOriginalHint:"You can open the original page to view the source content.",chunk:"Chunk {{index}}",loadingMore:"Loading more",loadMore:"Load more"},errors:{fileTooLarge:"A file cannot exceed 200 MB",invalidImageType:"Select a PNG, JPG, or JPEG image",invalidDocumentType:"Select a PDF, PPTX, DOCX, XLSX, or TXT file",createBase:"Unable to create the knowledge base",updateBase:"Unable to update the knowledge base",metadataObject:"Metadata must be a JSON object",metadataFormat:"Invalid metadata format",noWebPreview:"The page has no Markdown content to preview",addWeb:"Unable to add the web page",previewWeb:"Unable to generate the web page preview",uploadFile:"Unable to upload the file",updateDocument:"Unable to update the knowledge item",loadPreview:"Unable to load the data preview",loadMoreBases:"Unable to load more knowledge bases",loadBases:"Unable to load knowledge bases",loadMoreData:"Unable to load more data",loadData:"Unable to load data",deleteBase:"Unable to delete the knowledge base",deleteDocument:"Unable to delete the knowledge item"}},nMe={common:Jae,agentKitPromo:eoe,systemInfo:toe,agentWorkspace:noe,environmentCenter:ioe,deploymentSelect:roe,deploymentError:soe,studioBuildProgress:aoe,cloudEnvironment:ooe,githubCicd:loe,feishuDeployment:coe,deploymentResources:uoe,studioUpdate:doe,projectPreview:foe,workspace:hoe,resourceCollection:poe,skillSourcePicker:moe,composer:goe,agentSelector:boe,myAgents:yoe,skillCenter:voe,knowledge:xoe},iMe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:eoe,agentSelector:boe,agentWorkspace:noe,cloudEnvironment:ooe,common:Jae,composer:goe,default:nMe,deploymentError:soe,deploymentResources:uoe,deploymentSelect:roe,environmentCenter:ioe,feishuDeployment:coe,githubCicd:loe,knowledge:xoe,myAgents:yoe,projectPreview:foe,resourceCollection:poe,skillCenter:voe,skillSourcePicker:moe,studioBuildProgress:aoe,studioUpdate:doe,systemInfo:toe,workspace:hoe},Symbol.toStringTag,{value:"Module"})),woe="Website integration",Ooe="Embed an AgentKit Runtime on your website as a floating chat window",Soe="Back to automations",koe="Add website",Eoe="Loading Runtime",Coe="Select Runtime",Toe="Website domain",Aoe="For example, xxxx.com or localhost:5173",_oe="Generating",Noe="Generate token",joe="Added websites",Roe="{{count}} website",Ioe="{{count}} websites",Poe="Loading website integrations",Doe="No website integrations yet",Moe="Select a Runtime and enter a website domain to generate a token",Loe="Embed instructions",$oe="Place this code before the closing body tag on your website",Foe="Copied",Boe="Copy code",Uoe="Embed code will appear here after you add a website.",Qoe="Delete the website integration for {{domain}}?",zoe={load:"Failed to load website integrations",create:"Failed to create website integration",delete:"Failed to delete website integration",noConversationalAgent:"No conversational Agent was found in this Runtime"},Voe={requestFailed:"Request failed ({{status}})",greeting:"Hello. How can I help?",sessionFailed:"Could not start a chat session",unauthorized:"This website is not authorized to start a chat",conversationFailed:"The chat request failed. Try again shortly.",open:"Open Agent chat",close:"Close Agent chat",panelLabel:"Agent chat panel",assistant:"Agent assistant",online:"Online"},rMe={title:woe,description:Ooe,backToAutomations:Soe,addWebsite:koe,loadingRuntime:Eoe,selectRuntime:Coe,websiteDomain:Toe,domainPlaceholder:Aoe,generating:_oe,generateToken:Noe,addedWebsites:joe,websiteCount_one:Roe,websiteCount_other:Ioe,loadingIntegrations:Poe,delete:"Delete",emptyTitle:Doe,emptyDescription:Moe,embedMethod:Loe,embedInstructions:$oe,copied:Foe,copyCode:Boe,embedHint:Uoe,confirmDelete:Qoe,errors:zoe,widget:Voe},sMe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:koe,addedWebsites:joe,backToAutomations:Soe,confirmDelete:Qoe,copied:Foe,copyCode:Boe,default:rMe,description:Ooe,domainPlaceholder:Aoe,embedHint:Uoe,embedInstructions:$oe,embedMethod:Loe,emptyDescription:Moe,emptyTitle:Doe,errors:zoe,generateToken:Noe,generating:_oe,loadingIntegrations:Poe,loadingRuntime:Eoe,selectRuntime:Coe,title:woe,websiteCount_one:Roe,websiteCount_other:Ioe,websiteDomain:Toe,widget:Voe},Symbol.toStringTag,{value:"Module"})),Hoe={types:{all:"All types",document:"Documents",image:"Images",video:"Videos"},previewArtifact:"Preview {{name}}",moreActions:"More actions for {{name}}",actionMenu:"Actions for {{name}}",download:"Download",downloading:"Downloading",edit:"Edit details",delete:"Delete artifact",previewFailed:"Could not preview “{{name}}”: {{message}}",downloadStarted:"Download started for {{name}}",downloadFailed:"Could not download “{{name}}”: {{message}}",updated:"Updated {{name}}",deleted:"Deleted {{name}}",deleteFailed:"Could not delete “{{name}}”: {{message}}",typeFilter:"Artifact type",searchAria:"Search artifacts",searchPlaceholder:"Search artifacts or sessions",retry:"Retry",close:"Close",listAria:"Artifact list",loadFailed:"Could not load artifacts",loadDetailFallback:"Check the storage configuration and try again.",reload:"Reload",noMatch:"No matching artifacts",noArtifacts:"You do not have any artifacts yet",searchHint:"Try another search or artifact type",emptyHint:"Artifacts created in chats will appear here automatically",columns:{name:"Name",source:"Source",updatedAt:"Modified",actions:"Actions"},loadingMore:"Loading more artifacts",unknownTime:"Unknown time",preview:{close:"Close preview",meta:"{{type}} / Version {{version}}",loading:"Loading preview",alt:"Preview of {{name}}",loadFailed:"The preview could not be loaded. Try again later or download the file.",unsupported:"This format cannot be previewed online. Download the file to view it.",sourceAria:"Artifact source",agent:"Agent",session:"Session",tool:"Generated by",createdAt:"Created",fileSize:"File size",tags:"Tags",viewSession:"View session"},deleteDialog:{title:"Delete artifact?",description:"“{{name}}” will be permanently removed from the artifact library. The chat history will not be affected.",deleting:"Deleting",confirm:"Delete",close:"Close delete confirmation"},api:{withStatus:"{{message}} ({{status}})",listFailed:"Could not load the artifact library",syncFailed:"Could not sync chat artifacts",updateFailed:"Could not update the artifact",deleteFailed:"Could not delete the artifact",downloadFailed:"Could not download the artifact"}},qoe={unknownSource:"Unknown source",unknownCreator:"Unknown creator"},Woe={nameRequired:"Enter an artifact name",tooManyTags:"You can add up to {{max}} tags",tagTooLong:"Each tag can contain up to {{max}} characters",title:"Edit artifact details",subtitle:"The content file will not be modified",close:"Close edit dialog",name:"Name",description:"Description",descriptionPlaceholder:"Add its purpose, version, or usage notes",tags:"Tags",tagsPlaceholder:"Separate tags with commas, up to {{max}}",cancel:"Cancel",saving:"Saving",save:"Save"},Goe={change:{added:"Added",modified:"Modified",deleted:"Deleted"},noChanges:"There are no source changes between these versions",chooseFile:"Select a file on the left to view its code",compareTitle:"Compare versions",workspaceTitle:"Source workspace",projectFallback:"Agent project",switchTheme:"Switch source theme",switchThemeTitle:"Switch to {{theme}} theme",themes:{dark:"dark",light:"light"},closeWorkspace:"Close source workspace",close:"Close",changedFiles:"Changed files",projectFiles:"Project files",changes:"Changes",files:"Files",openFiles:"Open files",noFileSelected:"No file selected",comparisonDirection:"Comparison direction",before:"Before optimization",after:"After optimization",loadingEditor:"Loading editor…",changedFileCount_one:"{{count}} file changed",changedFileCount_other:"{{count}} files changed",fileCount_one:"{{count}} file",fileCount_other:"{{count}} files",lineCount_one:"{{count}} line · UTF-8",lineCount_other:"{{count}} lines · UTF-8",viewSource:"View source",viewSourceAria:"View and edit project source"},Koe={nav:"Search",selectAgent:"Select an Agent",checkingCapabilities:"Checking Agent capabilities",notMounted:"This Agent does not have {{label}} mounted",sources:{session:"Sessions",web:"Web",knowledge:"Knowledge base",memory:"Long-term memory"},webDescription:"Search with the web_search tool",backendLocal:"Local",failed:"Search failed: {{message}}",placeholder:{selectAgent:"Select an Agent first",web:"Search the web",knowledge:"Search {{name}}",knowledgeFallback:"this Agent's knowledge base",memory:"Search {{name}}",memoryFallback:"this user's long-term memory",session:"Search this Agent's sessions"},sourceTypeAria:"Search source: {{label}}",notSelected:"Not selected",sourceType:"Search source",selectSource:"Select a search source",noAgentHint:"Select an Agent to search its sessions, the web, and mounted data sources.",loadingCapabilities:"Loading this Agent's search capabilities…",sourceUnavailable:"This Agent does not have this data source mounted",instructions:{web:"Enter keywords and press Enter or select the button to search with web_search.",knowledge:"Enter a question to search this Agent's knowledge base.",memory:"Enter a clue to search long-term memories saved across this user's sessions.",session:"Enter keywords and press Enter or select the button to search this Agent's sessions."},noResults:"No results found for “{{query}}”.",knowledgeFragment:"Knowledge excerpt {{index}}",memoryFragment:"Memory excerpt {{index}}"},Xoe={title:"Developer Resources",sections:{documentation:{title:"Related links",description:"Open development documentation and common AgentKit destinations"},bestPractices:{title:"Best practices",description:"Learn from practical development, debugging, and deployment guidance"},showcases:{title:"Showcases",description:"Explore applications built with AgentKit"}},links:{veadkDocs:"VeADK documentation",cliDocs:"AgentKit CLI documentation",platformDocs:"AgentKit platform documentation",console:"AgentKit console"},articles:{veadkDevelopment:{title:"Develop and deploy an Agent with VeADK",description:"Build an Agent with VeADK and deploy it to AgentKit Runtime."},cliDevelopment:{title:"Develop and deploy an Agent with AgentKit CLI",description:"Create a project, debug an Agent, and deploy it with AgentKit CLI."},coverAlt:"Cover image for {{title}}"},showcases:{researchAssistant:{title:"Multi-agent research assistant",description:"Specialized Agents work together to research, analyze, and summarize findings."},multimodalAnalysis:{title:"Multimodal content analysis",description:"Understand images, documents, and video in a single session."},customerService:{title:"Customer service workspace",description:"Combine knowledge retrieval and tool calls to handle complex support requests."},webSearch:{title:"Web search Agent",description:"Search current web content and organize it into traceable answers."},a2uiApp:{title:"A2UI interactive app",description:"Let an Agent generate interactive interfaces as it works through a task."},previewAlt:"Interface preview for {{title}}"}},Yoe={title:"Library",untitledSession:"Untitled session",categoryAria:"Library categories",regionAria:"Region",tabs:{skills:"Skills",knowledge:"Knowledge",artifacts:"Artifacts"}},Zoe={title:"Manage Agents",subtitle:"Agents in AgentKit Runtime that you can manage",mainAgentOnly:"Only the main Agent is shown (control-plane information).",deleteConfirm:'Delete Agent "{{name}}"? Its Runtime will be permanently deleted.',regionFilterTitle:"Filter by region",regionFilterAria:"Region filter",regionAria:"Region",refresh:"Refresh",loading:"Loading…",empty:"You have not deployed any Agents.",connected:"Connected",connect:"Connect to this Agent",deleteRuntime:"Delete this Runtime",loadingDetail:"Loading details…",agentStructure:"Agent structure",secretHidden:"Sensitive value hidden. Select to reveal it.",revealSecret:"Show the value of {{key}}",fields:{model:"Model",description:"Description",status:"Status details",project:"Project",version:"Version",resources:"Resources",memory:"Memory",tool:"Tool",knowledge:"Knowledge",mcpToolset:"MCP Toolset",updatedAt:"Updated"},resource:{memory:"Memory {{value}} MB",instances:"Instances {{min}}-{{max}}",concurrency:"Concurrency {{value}}"},environmentVariables:"Environment variables",unnamed:"(Unnamed)"},Joe={mainAgent:"Main Agent",subAgent:"Sub-agent {{index}}",itemCount_one:"{{count}} item",itemCount_other:"{{count}} items",info:"Agent information",infoAndTopology:"Agent information and topology",loadingInfo:"Loading Agent information…",unnamedAgent:"Unnamed Agent",tools:"Tools",toolList:"Tool list",studioTool:"Studio Tool",removeTool:"Remove tool {{name}}",remove:"Remove",notConfigured:"Not configured",addStudioTool:"Add Studio tools",addStudioToolHere:"Add Studio tools to this chat",skills:"Skills",skillList:"Skill list",previewUnsupported:"Preview is not supported",sessionEnvironment:"Session environment",environment:"Environment",agentCanvas:"Agent canvas",topology:"Structure",viewCanvasFullscreen:"View Agent canvas in full screen",viewFullscreen:"View full screen",executionCanvas:"Agent execution canvas",fullscreenExecutionCanvas:"Full-screen Agent execution canvas",closeFullscreenCanvas:"Close full-screen canvas",close:"Close",capabilitiesSubtitle:"Capabilities and collaboration topology",closeInfo:"Close Agent information",infoUnavailable:"Agent information is temporarily unavailable."},ele={mountFailed:"Could not mount the environment",closeDialog:"Close environment dialog",addTitle:"Add environments",description:"Choose the Sandbox environments this Agent can use in the current session",closeAdd:"Close Add environments",searchAria:"Search environments",searchPlaceholder:"Search environment names or capabilities",availableAria:"Available environments and workspaces",loading:"Loading available environments…",noMatch:"No matching environments or workspaces",workspaces:"Workspaces",reuseAll:"Use every available environment in this workspace",availableEnvironmentCount_one:"{{count}} available environment",availableEnvironmentCount_other:"{{count}} available environments",selectWorkspace:"Select workspace {{name}}",environments:"Environments",includedByWorkspaces:"Included by workspace {{names}}",nameSeparator:", ",selectEnvironment:"Select environment {{name}}",selectedWorkspaceCount_one:"{{count}} workspace selected",selectedWorkspaceCount_other:"{{count}} workspaces selected",coveredEnvironmentCount_one:"{{count}} environment covered",coveredEnvironmentCount_other:"{{count}} environments covered",selectionSummary:"{{workspaces}}, {{environments}}",cancel:"Cancel",mounting:"Mounting…",confirm:"Add selected",mountedAria:"Mounted environments",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",removeWorkspace:"Remove workspace {{name}}",remove:"Remove",removeEnvironment:"Remove environment {{name}}",add:"Add environments",addMore:"Add more environments",addForSession:"Add environments to this session",loadingAvailable:"Loading available environments…",empty:"No AIO Sandbox environments are available."},tle={loading:{searching:"Looking for an existing environment",creating:"Initializing environment",connecting:"Connecting to the environment"},initializationFailed:"AgentKit CLI environment initialization failed. Current status: {{status}}.",sessionExpired:"The AgentKit CLI session does not exist or has expired. Try again.",initializationTimeout:"AgentKit CLI environment initialization timed out. Try again later.",nonPersistent:"Non-persistent environment",recyclingHoursMinutes:"Environment reclaimed in {{hours}} hr {{minutes}} min",recyclingMinutes:"Environment reclaimed in {{minutes}} min",connectionError:`Could not connect to the Studio service because the server did not respond. Original error: {{message}}`,unavailable:"Connection unavailable",requestFailed:"AgentKit CLI request failed",retry:"Retry",terminalTitle:"AgentKit CLI terminal"},nle={labels:{coding:"Coding",get_city_weather:"City weather",get_location_weather:"Location weather",web_fetch:"Fetch web content"},closeDialog:"Close dialog",title:"Add Studio tools",description:"Studio BFF runs these tools for {{agentName}} in the current session. No Runtime installation is required.",close:"Close Add Studio tools",searchAria:"Search Studio tools",searchPlaceholder:"Search by name or tool ID",availableAria:"Available Studio tools",loading:"Loading Studio tools…",noMatch:"No matching Studio tools",remove:"Remove",add:"Add"},ile={artifactLibrary:Hoe,resourceMetadata:qoe,artifactEdit:Woe,codeBrowser:Goe,search:Koe,developerResources:Xoe,library:Yoe,manageAgents:Zoe,agentTopology:Joe,sessionEnvironment:ele,agentKitCli:tle,studioTools:nle},aMe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:tle,agentTopology:Joe,artifactEdit:Woe,artifactLibrary:Hoe,codeBrowser:Goe,default:ile,developerResources:Xoe,library:Yoe,manageAgents:Zoe,resourceMetadata:qoe,search:Koe,sessionEnvironment:ele,studioTools:nle},Symbol.toStringTag,{value:"Module"})),rle={requestFailed:"请求失败 ({{status}})",unknownError:"未知错误",contentTypeMissing:"Content-Type 缺失",response:"响应:{{response}}",fallbackWithDetail:"{{fallback}}:{{detail}}",fallbackWithHttpStatus:"{{fallback}}(HTTP {{status}})",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应({{contentType}})"},sle={unconfigured:"管理员未配置 AgentKit Dev Sandbox,请配置后再使用",invalidSession:"AgentKit CLI 返回了无效的 Session。",loadCapabilitiesFailed:"无法读取 AgentKit CLI 配置。",invalidCapabilities:"AgentKit CLI 返回了无效的配置状态。",listSessionsFailed:"无法读取 AgentKit CLI Session。",invalidSessionList:"AgentKit CLI 返回了无效的 Session 列表。",createSessionFailed:"无法创建 AgentKit CLI Session。",openSessionFailed:"无法打开 AgentKit CLI Session。",openTerminalFailed:"无法打开 AgentKit CLI 终端。",invalidTerminalUrl:"AgentKit CLI 返回了无效的终端地址。"},ale={cnBeijing:"华北 2(北京)",cnShanghai:"华东 2(上海)"},ole={runtimeUnsupported:"该 Runtime 暂不支持连接,请确认服务已正常运行。"},lle={autoConfigureFailed:"飞书机器人自动配置失败"},cle={actionFailed:"{{action}}失败",detail:"详细信息:{{detail}}",request:"请求:{{request}}"},ule={persistentMemoryHint:"提示:会话已不存在。使用 in-memory 或 SQLite 短期记忆时,多实例、进程重启或滚动发布都可能导致会话丢失;建议改用基于数据库的持久化短期记忆存储。",unsupportedRouteHint:"提示:该 Runtime 未提供会话能力运行接口,可能是 Runtime 版本与当前 Studio 不兼容。",toolArgumentHint:"提示:模型生成的工具参数格式不完整,请重新发送一次。",resourceCollectionExpiredHint:"提示:本次资源清单已失效,请重新发送任务;系统会重新收集资源后再创建 Agent。",networkConfigurationHint:"提示:请检查共享公网出口等网络配置,然后重试。",modelQuotaHint:"提示:模型当前触发了 TPM/RPM 配额限制,请稍后重试或提高模型配额。",rawResponseLabel:"原始响应:"},dle={httpStatus:"HTTP 状态码:{{status}}",errorCode:"错误码:{{code}}",cloudResponseBody:`云端响应正文: {{body}}`,loadFailedWithDetail:"读取实例日志失败:{{detail}}",invalidFormat:"读取实例日志失败:服务返回格式无效"},fle={untitledSession:"未命名会话",webUnavailable:"网络搜索接口未就绪(后端未启用 /web/search)。",webFailed:"网络搜索失败:{{message}}",webNotMounted:"当前 Agent 未挂载 web_search 工具。",knowledgeNotMounted:"该 Agent 未挂载知识库。",memoryNotMounted:"该 Agent 未挂载长期记忆。",knowledge:"知识库",longTermMemory:"长期记忆"},hle={listSpacesFailed:"读取 Skill 空间失败",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",deleteSpaceFailed:"删除 Skill 空间失败",uploadFailed:"上传 Skill 失败",validateFailed:"校验 Skill 失败",deleteFailed:"删除 Skill 失败",listFilesFailed:"读取 Skill 文件失败",downloadFailed:"下载 Skill 失败"},ple={truncatedData:"{{data}}…(已截断,共 {{count}} 个字符)",incompleteEvent:"SSE 流在事件完整返回前已结束。原始数据:{{data}}",invalidEventJson:"无法解析 SSE 事件中的 JSON。原始数据:{{data}}"},mle={loadConfigNetworkFailed:"无法加载登录配置,请检查网络后重试。",configServiceFailed:"登录配置服务异常(HTTP {{status}}),请稍后重试。",invalidConfigResponse:"登录配置服务返回了无法解析的响应,请稍后重试。",serviceNetworkFailed:"无法连接身份服务,请检查网络后重试。",invalidServiceResponse:"身份服务返回了无法解析的响应,请稍后重试。",serviceFailed:"身份服务异常(HTTP {{status}}),请稍后重试。"},gle={invalidToken:"GitHub Token 无效或没有仓库写入权限",notFound:"仓库、分支或文件不存在,或 Token 无权访问",rejectedCommit:"GitHub 拒绝了提交,请检查分支和文件状态",requestFailed:"GitHub 请求失败(HTTP {{status}})",networkFailed:"连接 GitHub 失败,请检查网络后重试",invalidRepositoryFormat:"GitHub Repo 格式应为 owner/repository",insecureRepositoryUrl:"仅支持安全的 github.com 仓库地址",unsafeProjectPath:"Agent 项目目录必须是仓库内的安全相对路径",tokenRequired:"GitHub Token 不能为空",invalidBaseBranch:"目标分支格式不正确",invalidPublishBranch:"发布分支格式不正确",noFiles:"没有需要提交的文件",missingBaseSha:"目标分支缺少有效 Git SHA",fileAlreadyExists:"目标仓库中已存在 {{path}},未覆盖现有文件",pathNotUpdatable:"目标路径 {{path}} 不是可更新的文件",invalidPullRequest:"GitHub 未返回有效的 Pull Request"},ble={loadCapabilitiesFailed:"加载视频模型能力失败",uploadAssetFailed:"上传{{fileName}}失败",enhancePromptFailed:"提示词优化失败",createTaskFailed:"创建视频生成任务失败",getTaskFailed:"查询视频生成任务失败",downloadFailed:"下载生成视频失败"},yle={listFailed:"加载网站集成失败",createFailed:"创建网站集成失败",deleteFailed:"删除网站集成失败"},vle={loadFailed:"读取知识库失败",htmlHidden:"[HTML 内容已隐藏]",redacted:"[已脱敏]",depthTruncated:"[内容过深,已截断]",circularReference:"[循环引用]",diagnosticsUnavailable:"[诊断信息无法显示]",statusCode:"状态码:{{status}}",errorCode:"错误码:{{code}}",requestId:"请求 ID:{{requestId}}",diagnostics:"诊断:{{diagnostics}}",detail:"详情:{{detail}}",signInRequired:"请先登录后再访问知识库",forbidden:"你没有权限操作这个知识库",notFound:"知识库或知识内容不存在",conflict:"知识库当前状态不允许执行此操作",requestFailed:"知识库请求失败 ({{status}})"},xle={invalidSourceSnapshot:"源码快照的响应格式无效。",invalidProjectList:"项目列表的响应格式无效。",invalidProjectVersion:"项目版本的响应格式无效。",loadProjectsFailed:"无法读取已保存项目",loadVersionsFailed:"无法读取项目版本",deleteVersionFailed:"删除项目版本失败",invalidDeleteVersionResponse:"删除项目版本的响应格式无效。",loadProjectSourceFailed:"无法读取项目源码",loadSnapshotFailed:"无法读取源码快照",restoreSnapshotFailed:"无法恢复当前源码快照",downloadSourceFailed:"下载源码失败",downloadNotZip:"源码下载响应不是 ZIP 文件。",downloadSizeMismatch:"源码压缩包大小与发布记录不一致,请重试。"},wle={invalidFormat:"{{label}}格式错误。",validationSeparator:";",invalidAnalysisResult:"迁移分析结果格式错误。",invalidFrameworkCandidate:"框架候选格式错误。",invalidAnalysisEvidence:"分析证据格式错误。",invalidEntryCandidate:"入口候选格式错误。",invalidQuestion:"待确认问题格式错误。",invalidTask:"迁移会话格式错误。",invalidAnalysisReference:"分析结果引用格式错误。",invalidSourcePersistence:"迁移源码保存状态格式错误。",invalidActivity:"迁移执行动态格式错误。",invalidActivityItem:"迁移执行动态项格式错误。",invalidActivityTool:"迁移执行工具项格式错误。",invalidActivityPlan:"迁移执行计划格式错误。",invalidActivityPlanItem:"迁移执行计划项格式错误。",invalidArtifact:"迁移产物格式错误。",invalidEnvironmentDefaults:"环境变量默认值格式错误。",invalidArtifactFile:"迁移产物文件格式错误。",invalidVerificationCheck:"迁移校验项格式错误。",requestValidationFailed:"请求参数校验失败:{{detail}}",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}})。请检查代理或网关配置。",loadCapabilitiesFailed:"读取迁移能力失败",invalidCapabilities:"迁移能力格式错误。",invalidModelCapabilities:"迁移模型能力格式错误。",loadTasksFailed:"读取迁移会话失败",invalidTaskList:"迁移会话列表格式错误。",createTaskFailed:"创建迁移会话失败",uploadProjectFailed:"上传迁移项目失败",loadActivityFailed:"读取迁移执行动态失败",startFailed:"启动迁移失败",submitAnswersFailed:"提交分析补充信息失败",stopFailed:"终止迁移失败",deleteTaskFailed:"删除迁移会话失败",loadArtifactFailed:"读取迁移产物失败",loadArtifactFileFailed:"读取迁移产物文件失败",downloadArtifactFailed:"下载迁移产物失败",labels:{analysisResult:"迁移分析结果",recommendation:"迁移建议",boundary:"迁移边界",frameworkCandidate:"框架候选",analysisEvidence:"分析证据",recommendedFramework:"推荐框架",entryCandidate:"入口候选",entryFramework:"入口框架",includeScope:"迁移包含范围",excludeScope:"迁移排除范围",assumptions:"分析假设",question:"待确认问题",analysisWarnings:"迁移警告",task:"迁移会话",artifactStatus:"迁移产物状态",analysisReference:"分析结果引用",confirmation:"迁移确认",confirmedFramework:"确认框架",error:"迁移错误",sourcePersistence:"迁移源码保存状态",activity:"迁移执行动态",activityItem:"迁移执行动态项",activityTool:"迁移执行工具项",activityPlanItem:"迁移执行计划项",artifact:"迁移产物",cli:"CLI 信息",migration:"迁移信息",startup:"启动信息",environment:"环境变量信息",verification:"校验信息",report:"迁移报告",archive:"产物归档",environmentDefaults:"环境变量默认值",requiredEnvironment:"必需环境变量",optionalEnvironment:"可选环境变量",artifactFile:"迁移产物文件",verificationCheck:"迁移校验项",artifactWarnings:"迁移产物警告",errorResponse:"错误响应",errorDetail:"错误详情",capabilities:"迁移能力",framework:"迁移框架",modelCapabilities:"迁移模型能力",taskList:"迁移会话列表"}},Ole={status:{ready:"就绪",wakeable:"可唤醒",creating:"创建中",starting:"启动中",pending:"等待中",running:"运行中",failed:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"},developmentTimeout:"等待开发环境响应超时。任务可能仍在运行,请稍后重新进入当前会话查看状态。",developmentDisconnected:"与开发环境的连接已中断。任务可能仍在运行,请稍后重新进入当前会话查看状态。",developmentFailed:"开发任务未能继续,开发环境已保留。请在当前会话重试。",invalidStudioResponse:"{{fallback}} Studio 服务响应异常,请刷新后重试。",invalidSession:"AgentKit 沙箱返回了无效的 Session 信息。",invalidSnapshot:"AgentKit 沙箱返回了无效的 Snapshot 信息。",invalidSettings:"Sandbox 返回了无效设置。",invalidThreadSnapshot:"Sandbox 返回了无效 Thread 快照。",emptyConversationResponse:"沙箱对话服务未返回内容。",invalidConversationResponse:"沙箱对话服务返回了无法解析的响应。",conversationFailed:"沙箱对话失败,请稍后重试。",emptyReply:"沙箱未返回有效回复,请重试。",missingSession:"缺少要操作的 AgentKit Session。",listCodexFailed:"无法读取 Codex 智能体,请稍后重试。",invalidSessionList:"AgentKit 沙箱返回了无效的 Session 列表。",invalidSnapshotList:"AgentKit 沙箱返回了无效的 Snapshot 列表。",startFailed:"无法启动 AgentKit 沙箱,请稍后重试。",listAgentFailed:"无法读取 {{kind}} 智能体,请稍后重试。",invalidKindSessionList:"AgentKit 返回了无效的 {{kind}} Session 列表。",invalidKindSnapshotList:"AgentKit 返回了无效的 {{kind}} Snapshot 列表。",createAgentFailed:"无法创建 {{kind}} 智能体,请稍后重试。",missingSessionToOpen:"缺少要打开的 AgentKit Session。",openAgentFailed:"无法打开 {{kind}} 智能体。",invalidAgentHomeUrl:"{{kind}} 智能体返回了无效的主页面地址。",missingSessionForTerminal:"缺少要打开 Terminal 的 AgentKit Session。",openTerminalFailed:"无法打开 {{kind}} Terminal。",deleteAgentFailed:"无法删除 {{kind}} 智能体。",missingSnapshot:"缺少要唤醒的 AgentKit Snapshot。",resumeSnapshotFailed:"无法从快照唤醒智能体,请稍后重试。",deleteSnapshotFailed:"无法删除智能体快照。",missingSessionToConnect:"缺少要连接的 AgentKit Session。",connectCodexFailed:"无法连接 Codex 智能体,请稍后重试。",sessionNotReady:"AgentKit Session 尚未就绪,当前状态:{{status}}。",invalidMessage:"内置智能体会话缺少有效的消息内容。",interruptFailed:"无法停止当前任务。",getStatusFailed:"无法读取 Codex 状态。",getEndpointFailed:"无法读取 Sandbox Endpoint。",invalidEndpoint:"Sandbox 返回了无效 Endpoint。",createHandoffPairingFailed:"无法生成 Codex 云端接力配对码。",invalidHandoffPairing:"Studio 返回了无效的 Codex 云端接力配对码。",getHandoffStatusFailed:"无法读取端云接力状态。",invalidHandoffStatus:"Studio 返回了无效的端云接力状态。",listModelsFailed:"无法读取 Codex 模型列表。",invalidModelList:"Sandbox 返回了无效模型列表。",setModelFailed:"无法切换 Codex 模型。",invalidModel:"Sandbox 返回了无效模型。",listSkillsFailed:"无法读取 Codex Skills。",invalidSkillList:"Sandbox 返回了无效 Skill 列表。",listThreadsFailed:"无法读取 Codex Thread 列表。",invalidThreadList:"Sandbox 返回了无效 Thread 列表。",createThreadFailed:"无法创建新的 Codex Thread。",missingThread:"缺少要读取的 Codex Thread。",readThreadFailed:"无法读取 Codex 历史消息。",resumeThreadFailed:"无法恢复 Codex Thread。",forkThreadFailed:"无法分叉 Codex Thread。",archiveThreadFailed:"无法归档 Codex Thread。",invalidArchiveResult:"Sandbox 返回了无效归档结果。",deleteThreadFailed:"无法删除 Codex Thread。",invalidDeleteResult:"Sandbox 返回了无效删除结果。",compactThreadFailed:"无法压缩 Codex Thread。",getSettingsFailed:"无法读取 Codex 权限与工作空间。",updatePermissionsFailed:"无法更新 Codex 权限。",updateWorkspaceFailed:"无法更新 Codex 工作空间。",invalidWorkingDirectory:"Sandbox 返回了无效工作目录。",listDirectoriesFailed:"无法读取 Sandbox 目录。",invalidDirectoryList:"Sandbox 返回了无效目录列表。",resolveApprovalFailed:"无法提交 Codex 审批决定。",uploadFileFailed:"无法上传文件到 Sandbox。",invalidUploadResult:"Sandbox 返回了无效上传结果。",disconnectCodexFailed:"无法断开 Codex 智能体连接。",deleteCodexFailed:"无法删除 Codex 智能体。",openSandboxTerminalFailed:"无法打开 Sandbox Terminal。",openSandboxBrowserFailed:"无法打开 Sandbox Browser。",toolLabel:"Sandbox 工具",invalidToolUrl:"{{label}} 返回了无效地址。",unsafeToolUrl:"{{label}} 返回了不安全的地址。"},Sle={invalidSandboxVersion:"沙箱版本响应格式无效",loadSandboxVersionsFailed:"查询沙箱版本失败",updateSandboxFailed:"更新 Sandbox 失败",invalidSandboxUpdate:"沙箱更新响应格式无效",errorWithDetailAndRawResponse:`{{context}} {{detail}} @@ -38,12 +38,12 @@ Original error: {{message}}`,unavailable:"Connection unavailable",requestFailed: 约束: - 信息不足时主动提问澄清,不要臆造事实。 - 需要时合理调用可用的工具,并说明关键结论。 -- 保持礼貌、专业的语气。`},Sce={requestFailed:"请求失败 ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 AgentKit 智能体中心",loginRequired:"请先登录以访问 AgentKit 智能体中心"},vikingKnowledge:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 知识库",loginRequired:"请先登录以访问 VikingDB 知识库"},vikingMemory:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 记忆库",loginRequired:"请先登录以访问 VikingDB 记忆库"},mcpGateway:{missingHttpTool:"请返回“添加 MCP 工具”并添加至少一个 HTTP MCP 服务;MCP 稳定性治理不支持 stdio 服务。",missingUrl:"已添加的 HTTP MCP 工具缺少有效服务地址,请返回“添加 MCP 工具”补充后再发布。"},customModel:{fallbackName:"自定义模型",apiKeyLabel:"{{name}} 模型 API Key"},deploymentEnv:{serverInjected:"由服务端注入",selectedApiKeyPlaceholder:"由所选 API Key 注入",mcpInjectedComment:"由已添加的 MCP 工具注入",restoredPlaceholder:"由 Studio 服务端安全恢复",generatedMcpPlaceholder:"由已添加的 HTTP MCP 工具自动生成",restoredHelp:"更新时由 Studio 服务端合并 MCP 地址与认证,不向浏览器返回旧密钥。",mergedMcpHelp:"Studio 服务端自动合并 MCP 地址与可选认证,不向浏览器返回旧密钥。",listSeparator:"、",requirementHint:"优化项“{{labels}}”依赖此配置。",requiredBy:"优化项“{{labels}}”依赖此配置,请填写 {{key}}。",required:"请填写 {{label}}({{key}})。",invalidJson:"JSON 格式不正确"},drafts:{unsupportedVersion:"本机草稿版本暂不受支持,请升级 Studio 后重试。",invalidFormat:"本机草稿数据格式无效。",readFailed:"无法读取本机草稿,浏览器中的草稿数据可能已损坏。",quotaExceeded:"浏览器存储空间不足,草稿未保存。请删除不需要的草稿或清理此站点的浏览器存储后重试。",writeRejected:"浏览器拒绝保存草稿,请检查站点存储权限后重试。"},skills:{searchFailed:"搜索失败 ({{status}})",downloadFailed:"下载技能失败 ({{status}})",agentKitRequestFailed:"AgentKit Skills 请求失败",missingManifest:"{{location}} 缺少 SKILL.md",invalidParentPath:"{{location}} 包含非法路径(..):{{path}}",invalidPath:"{{location}} 包含非法路径:{{path}}",localDescription:"本地 Skill",folderSource:"文件夹",noManifest:"{{location}} 中未发现 SKILL.md"},zip:{invalid:"无效的 zip:找不到 EOCD",tooManyFiles:"zip 文件数不能超过 {{count}} 个",tooLarge:"zip 解压后的内容过大"}},kce={back:"返回开发会话",runtimeName:"Runtime 名称",runtimeNameExists:"Runtime 名称已存在,请更换后重试",checkingRuntimeName:"正在检查 Runtime 名称",verifiedSource:"已验证源码",deployableSource:"可部署源码",verifiedByCodex:"已通过 Codex 云端验证",entryPoint:"入口",files:"文件",artifact:"构建产物",validationReport:"验证报告",verifiedHint:"源码由服务端从已验证交付物物化,浏览器文件不能替换。",unverifiedHint:"源码已由服务端安全物化,部署前请确认 Runtime 配置。",env:{requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}"}},Ece={name:"代码包",back:"返回创建方式",reading:"正在读取代码包",readingEllipsis:"正在读取代码包…",uploadFirst:"请先上传代码包",uploadAriaLabel:"代码包上传",upload:"上传代码包",reupload:"重新上传代码包",uploadPrompt:"请上传代码包",filesRecognized:"已识别 {{count}} 个文件,点击区域可重新上传",dropHint:"点击或拖拽上传,支持 .zip 格式,最大 50 MB;可使用 app.py,或由 agentkit.yaml 声明入口",viewFiles:"查看文件",chooseFile:"选择代码包",errors:{invalidFormat:"请选择 .zip 格式的代码包。",tooLarge:"代码包不能超过 50 MB。",invalidPath:"压缩包包含非法路径:{{name}}",empty:"压缩包中没有可部署的文件。",tooManyFiles:"代码包文件数不能超过 {{count}} 个。",duplicateFile:"代码包包含重复文件:{{path}}",manifestParse:"agentkit.yaml 无法解析:{{detail}}",manifestRoot:"agentkit.yaml 根节点必须是对象。",manifestCommon:"agentkit.yaml 的 common 必须是对象。",entryPointType:"agentkit.yaml 的 common.entry_point 必须是文件路径。",entryPointInvalid:"agentkit.yaml 的 common.entry_point 不是有效文件路径。",entryPointMissing:"代码包中不存在 agentkit.yaml 声明的启动入口:{{entryPoint}}",defaultEntryPointMissing:"代码包根目录必须包含 app.py,或在 agentkit.yaml 的 common.entry_point 中声明已有入口。"}},Cce={label:"Agent 执行画布",readOnlyLabel:"只读 Agent 执行画布",minimapLabel:"执行流程缩略图",controls:{ariaLabel:"执行流程控制",zoomIn:"放大",zoomOut:"缩小",fitView:"适应视图"},rootAgent:"主 Agent",unnamedStep:"未命名步骤",terminals:{input:"用户请求",output:"最终回复"},edges:{then:"然后",continueLoop:"继续循环",call:"调用"},patterns:{llm:{label:"智能体",description:"理解任务并直接完成一个具体工作"},sequential:{label:"分步协作",description:"内部步骤按照顺序依次执行"},parallel:{label:"同时处理",description:"内部步骤同时工作,完成后统一汇总"},loop:{label:"循环执行",description:"重复执行内部步骤,直到满足停止条件"},a2a:{label:"远程智能体",description:"调用已经存在的远程 Agent"}},actions:{insertHere:"在这里插入步骤",deleteNamed:"删除 {{name}}",deleteNode:"删除节点",addSubagent:"添加子 Agent",addParallelStep:"添加一个同时处理的步骤",addLoopStep:"添加循环步骤",addNextStep:"添加下一个步骤",addFirst:"添加到最前",addLast:"添加到最后"}},Tce={title:"智能模式",subtitle:"描述目标后,沙箱中的 Codex 会判断你的意图,完成构建、调试和临时云端验证。",model:{label:"模型",placeholder:"选择模型",retiring:"即将下线",currentConfiguration:"当前配置",loadError:"加载模型列表失败"},availability:{checking:"正在检查智能开发能力…",unavailable:"当前无法使用智能模式,请返回后重试。"},goal:{title:"从目标开始",continueTitle:"继续优化项目",hint:"只需说明 Agent 要解决的问题;如有影响结果的关键信息,会在开始前向你确认。",continueHint:"说明这次要调整的内容,完成后会保存为新版本。",basedOn:"基于",clearSelection:"取消选择",label:"目标描述",optimizationLabel:"优化目标",placeholder:"例如:创建一个能读取销售数据、生成周报并校验输出格式的 Agent",optimizationPlaceholder:"例如:增加数据来源标注,并在信息不足时先向用户确认"},actions:{preparing:"准备中…",build:"开始构建",optimize:"开始优化"},preparation:{accepted:"目标已收到,马上开始实现",preparing:"正在创建任务环境…",starting:"环境已就绪,正在启动 Codex…",next:"接下来会先梳理目标和实现方式,再编写、运行和验证 Agent。"}},Ace={title:"已保存项目",description:"选择已有版本继续优化,或查看、下载和部署源码。",refresh:"刷新项目列表",checkingStorage:"正在检查项目存储…",unavailableTitle:"暂时无法读取项目",storageCheckError:"无法确认项目存储状态,请稍后重试。",storageNotConfigured:"项目存储尚未配置。",loadingMigrated:"正在读取已迁移项目…",loadingSaved:"正在读取已保存项目…",loadingVersions:"正在读取项目版本…",unknownTime:"时间未知",sourceDownloaded:"源码已下载。",projectSummary_one:"{{count}} 个版本 · 更新于 {{time}}",projectSummary_other:"{{count}} 个版本 · 更新于 {{time}}",versionSummary_one:"{{time}} · {{count}} 个文件",versionSummary_other:"{{time}} · {{count}} 个文件",noVersionDescription:"暂无版本描述",latestVersion:"最新版本",verified:"已验证",pendingVerification:"待确认",viewSource:"查看源码",download:"下载",downloading:"下载中…",optimize:"去优化",optimizeUnavailable:"去优化,暂不支持",errors:{projects:"无法读取已保存项目。",source:"无法读取项目源码。",versions:"无法读取项目版本。",download:"下载源码失败。",prepareDeployment:"无法准备部署源码。",deleteVersion:"删除项目版本失败。",migrated:"无法读取已迁移项目",saved:"无法读取已保存项目"},empty:{migratedTitle:"还没有已迁移的项目",savedTitle:"还没有已保存的项目",migratedDescription:"完成首次迁移后,源码会自动保存在这里。",savedDescription:"完成首次构建后,源码会自动保存在这里。",noVersions:"这个项目还没有可用版本。"},compare:{selected:"已选择 {{count}}/2",selectedLabel:"已选择",select:"选择",view:"查看对比",start:"对比版本"},delete:{title:"删除这个版本?",onlyVersion:"“{{name}}”只有这一个版本,删除后项目也会移除。此操作无法撤销。",description:"该版本的源码和验证记录将永久删除,其他版本不受影响。",confirm:"删除版本"}},_ce={title:"选择创建方式",subtitle:"以不同模式构建您的智能体",features:"特性",quick:{title:"快速模式",description:"动态派生子智能体自主完成任务",features:{dynamicSubagents:"动态派生子智能体",autonomousPlanning:"自主规划执行",collaboration:"多智能体协作",summary:"自动汇总结果",skills:"按需调用技能",trace:"任务过程可追踪"}},traditional:{title:"传统模式",description:"高度自定义您的智能体结构",features:{visualConfig:"可视化配置",migration:"存量智能体迁移",debugging:"实时调试",optimization:"可选性能优化",parameters:"精细参数控制"}}},Nce={placeholder:"输入系统提示词;键入 ## 加空格可创建二级标题…",toolbar:{undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",paragraph:"正文",quote:"引用",heading:"标题 {{level}}",selectBlockType:"选择文本类型",blockType:"文本类型",bold:"加粗",removeBold:"取消加粗",italic:"斜体",removeItalic:"取消斜体",bulletedList:"无序列表",numberedList:"有序列表"}},jce={local:{duplicatesSkipped:"已跳过重复技能:{{names}}",invalidDrop:"请拖入包含 SKILL.md 的文件夹或一个 .zip 文件",readError:"读取失败:{{detail}}",dropLabel:"拖入文件夹或 ZIP,自动识别 Skill",hint:"每个技能需包含 SKILL.md。支持包含多个技能的目录。",reading:"正在读取文件…",fileCount:"本地 · {{count}} 个文件"},hub:{searchError:"搜索失败,请稍后重试。",searchPlaceholder:"搜索火山 Find Skill 技能广场,例如 数据分析、PDF…",search:"搜索",searching:"正在搜索…",noResults:"没有找到匹配的技能,换个关键词试试。",hint:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"},space:{loadError:"加载失败",loadingSpaces:"正在加载 AgentKit Skills 中心…",noSpaces:"此账号下没有 AgentKit Skills 中心。",selectSpace:"选择 AgentKit Skills 中心",openConsole:"在火山引擎控制台打开",loadingSkills:"正在加载技能列表…",noSkills:"此 AgentKit Skills 中心暂无技能。"}},Rce={unnamedNode:"未命名节点",editInstruction:"点击编辑指令…",controls:{ariaLabel:"工作流画布控制",zoomIn:"放大",zoomOut:"缩小",fitView:"适应视图"},sections:{info:"工作流信息",execution:"执行方式",nodes:"节点",nodeConfig:"节点配置"},types:{sequential:{label:"顺序",description:"节点依次执行"},parallel:{label:"并行",description:"节点同时执行"},loop:{label:"循环",description:"节点循环执行"}},placeholders:{description:"这个工作流做什么…",agentDescription:"这个 Agent 做什么…",instruction:"你是一个…"},errors:{workflowNameUnique:"名称须与 Agent 节点名称保持唯一",agentNameUnique:"Agent 名称在当前工作流中必须唯一"},dragHint:"拖拽到画布,或点击下方按钮添加",agentNode:"Agent 节点",addNode:"添加节点",connectHint:"拖拽节点的圆点连线以表达执行顺序。",create:"创建工作流",deleteNode:"删除节点",nameHelp:"仅使用英文字母、数字和下划线,且名称保持唯一。",instruction:"指令 (instruction)",tools:"工具 (逗号分隔)",nodeId:"节点 ID",empty:{selectNode:"选择一个节点以编辑其配置",summary:"共 {{nodes}} 个节点 · {{edges}} 条连线"}},Ice={ariaLabel:"快速模式创建",progress:"快速模式创建进度",steps:{agent:{label:"智能体",title:"基本信息",description:"设置智能体的名称、用途、行为方式与能力"},environment:{label:"执行环境",title:"配置执行环境",description:"选择默认环境或已构建的自定义环境"},deployment:{label:"部署偏好",title:"部署偏好",description:"定义 AgentKit 云上参数"}},model:{label:"模型",source:"模型来源",name:"模型名称",provider:"服务商 Provider",volcengineArk:"火山方舟",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",currentApiKey:"当前 API Key",loadingApiKeys:"正在加载 API Key",selectApiKey:"选择 API Key",searchApiKeys:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",loadingModels:"正在加载模型",selectModel:"选择模型",searchModels:"搜索名称、Model ID 或服务商",noModels:"没有可用的模型",apiKeyPlaceholder:"请输入模型 API Key",credentialsLoadError:"模型凭据加载失败",modelsLoadError:"模型列表加载失败"},identity:{unnamedPool:"未命名用户池",currentPool:"{{value}}(当前用户池)",userPool:"用户池",loading:"正在加载用户池",placeholder:"请选择用户池",search:"搜索用户池",empty:"当前账号下暂无 Identity 用户池",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime",selectionHint:"当前 Studio 使用的用户池已在列表中标注"},agent:{namePlaceholder:"输入智能体名称",descriptionPlaceholder:"说明这个智能体可以做什么",prompt:"提示词",promptPlaceholder:"定义角色、目标和行为边界",skills:"技能",addSkill:"添加技能"},validation:{descriptionRequired:"请输入描述",promptRequired:"请输入提示词",modelRequired:"请选择模型",instanceIntegers:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数",instanceOrder:"最小实例数不能大于最大实例数",userPoolRequired:"请选择用于 Runtime 鉴权的用户池"},deployment:{runtimeName:"Runtime 名称",runtimeNameUpdateHint:"更新时保持现有 Runtime 名称不变",runtimeNameHint:"仅支持英文字母、数字、下划线和连字符",region:"发布区域",authentication:"鉴权方式",apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPoolDescription:"使用 Identity 用户池签发的 JWT",sessionStorage:"会话存储",inMemoryStorage:"In-memory 临时存储",backends:{sqlite:"SQLite 文件",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",inMemoryHint:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",networkMode:"网络模式",network:{public:"公网",private:"私网",both:"公网与私网"},subnetIds:"子网 ID(可选,多个用逗号分隔)",sharedInternet:"VPC 内共享公网出口",sharedInternetHint:"允许私网 Runtime 通过共享出口访问公网",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",evaluationSetsHint:"部署成功后自动创建 Good Case 和 Bad Case 评测集",resources:"资源配置",complete:"部署已完成",preparing:"正在准备部署…"},environmentVariables:{title:"环境变量",add:"添加变量",nameAriaLabel:"环境变量名称",valueAriaLabel:"{{name}} 的值",deleteNamed:"删除 {{name}}"},actions:{updateAgain:"再次更新",deployAgain:"重新部署",updateAndPublish:"更新并发布"}},Pce={actions:{addSubagent:"添加子 Agent",clearRoot:"清空根 Agent",clearRootConfirmation:"清空根 Agent 的全部配置和子 Agent?此操作无法撤销。"},workspace:{progress:"Agent 创建进度",modes:{build:"架构",validate:"调试",optimize:"优化",environment:"环境",publish:"发布"},titles:{build:"个性化您的智能体架构",validate:"调试您的智能体",optimize:"为您的智能体选择优化项",environment:"配置云上环境",publish:"准备好部署您的智能体"}},sections:{type:{label:"Agent 类型",hint:"选择 Agent 类型"},basic:{label:"基本信息",hint:"名称、描述与系统提示词"},model:{label:"模型配置",hint:"模型与服务(可选)"},tools:{label:"工具",hint:"可调用的能力"},skills:{label:"技能",hint:"声明式技能"},knowledge:{label:"知识库",hint:"外部知识检索"},memory:{label:"记忆",hint:"短期与长期记忆"},subagents:{label:"子 Agent",hint:"嵌套协作"},review:{label:"完成",hint:"预览并创建"}},agentTypes:{ariaLabel:"Agent 类型",remoteChildOnly:"远程智能体只能作为子步骤使用",llm:{label:"智能体",fullLabel:"LLM 智能体",description:"大模型驱动,自主完成任务"},sequential:{label:"分步协作",fullLabel:"顺序型智能体",description:"子 Agent 按顺序依次执行"},parallel:{label:"同时处理",fullLabel:"并行型智能体",description:"子 Agent 并行执行后汇总"},loop:{label:"循环执行",fullLabel:"循环型智能体",description:"子 Agent 循环执行到满足条件"},a2a:{label:"远程智能体",fullLabel:"远程 Agent",description:"通过 A2A 协议调用远程 Agent"}},basic:{agentName:"Agent 名称",name:"名称",agentDescription:"智能体描述",descriptionPlaceholder:"简要描述这个 Agent 的用途,便于团队识别…",nameHelp:"遵循 Google ADK 命名规则,且在执行流程中保持唯一。",rootDescriptionHelp:"完整描述会保留;部署时会自动整理为符合 Runtime 规范的单行描述。",descriptionHelp:"描述会显示在 Agent 列表与选择器中。",orchestratorHelp:"这是一个协作容器,本身不生成回答。请在左侧画布中添加任务步骤,并通过拖拽调整它们的位置。",maxIterations:"最大轮次",maxIterationsHelp:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。",agentCenter:"AgentKit 智能体中心",agentCenterHelp:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。系统会根据每轮任务动态发现并挂载匹配的 Agent。",moreOptions:"更多选项",systemPrompt:"系统提示词",loadingMarkdown:"正在加载 Markdown 编辑器…",markdownHelp:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。",unnamed:"未命名",unnamedAgent:"未命名智能体"},validation:{remoteRoot:"远程 Agent 只能作为子 Agent",missingRegistry:"请选择 AgentKit 智能体中心",name:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},duplicateName:"Agent 名称在当前结构中必须唯一",missingDescription:"描述为必填项",mcpAuthRequired:"MCP 地址变化后需要确认认证方式",mcpDuplicateName:"MCP 名称重复,请为每个服务使用唯一名称",mcpDuplicateUrl:"MCP 地址重复,请删除重复服务后再发布",missingSubagent:"缺少子 Agent",missingPrompt:"系统提示词为必填项",missingSubagentDetail:"{{type}}至少需要添加一个子 Agent 后才能调试或发布。",problem:"{{name}}:{{problem}}"},ai:{ariaLabel:"AI 自动填写 Agent 配置",minimumLength:"请至少输入 {{count}} 个字符。",replaceConfirmation:"生成的新配置会替换当前画布和属性,确定继续吗?",placeholder:"描述目标,使用 {{model}} 模型一键生成配置",generate:"智能生成",generating:"正在智能生成",success:"生成成功",regenerate:"重新生成",failed:"智能生成失败"},debug:{ariaLabel:"智能体调试工作区",unavailable:"当前后端暂不支持生成 Agent 调试运行。",baseline:"基准组",comparison:"对照组 {{count}}",selectModel:"请选择模型",enterDescription:"请输入描述",enterPrompt:"请输入系统提示词",duplicateConfiguration:"测试配置不能重复",starting:"启动中…",applyAndRestart:"应用并重启",restart:"重新启动",start:"启动环境",defaultModel:"默认模型",testConfiguration:"测试配置",deleteVariant:"删除 {{name}}",deleteVariantGroup:"删除对照组",creatingEnvironment:"正在创建测试环境…",configurationChanged:"配置已变更,请重新启动环境。",ready:"环境已就绪",readyHint:"发送消息以比较智能体回复。",startHint:"先完善配置,再启动环境。",viewTraceNamed:"查看 {{name}} 的调用链路",traceUnavailable:"发送消息后可查看调用链路",trace:"调用链路",useConfiguration:"使用此配置",finishConfiguration:"完成配置",finishAndStart:"完成并启动",currentAgentModel:"当前 Agent 模型",configurationHint:"修改仅用于本次对比,选择使用后才会进入部署流程。",messagePlaceholder:"向已启动的测试环境发送消息…",startOneFirst:"请先启动至少一个测试环境",addVariant:"添加对照组",traceTitle:"调用链路 · {{name}}",leaveTitle:"离开调试?",leaveDescription:"离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。",cleaning:"清理中…",confirmLeave:"确定离开",closeLeaveConfirmation:"关闭离开调试确认"},optimization:{ariaLabel:"智能体优化选项",scenario:"优化场景",components:"优化组件",bytePlusUnavailable:"BytePlus 账号暂不支持 Harness Sidecar 优化项。请保持优化项为空后继续部署,普通 BytePlus 智能体不受影响。",releaseScenario:"优化场景:{{profile}}",profiles:{default:{label:"自定义",description:"按需选择组件,不勾选时不启动 Sidecar。"},ops:{label:"运维场景",description:"适用于运维诊断、数据库、日志和监控 MCP。"}},groups:{quality:"提升回答质量",cost:"降低运行成本",stability:"增强运行稳定性"},options:{context_engine:{label:"上下文治理",description:"治理上下文组装、任务锚定和上下文预算。"},compressor:{label:"上下文与结果压缩",description:"压缩长上下文和大型工具结果,降低 Token 成本。"},verifier:{label:"回答校验与修复",description:"校验证据和回答,在失败时执行修复或告警。"},long_run_control:{label:"Goal 任务控制",description:"管理 Goal 任务的进度、续跑和结束条件。"},mcp_resilience:{label:"MCP 稳定性治理",description:"治理连接、超时、空结果、大返回和调用预算;默认包含 SQL 只读保护。"}}},model:{label:"模型",source:"模型来源",volcanoArk:"火山方舟",volcengineArk:"火山方舟",bytePlusModelArk:"BytePlus ModelArk",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",configuration:"模型配置",name:"模型名称",provider:"服务商 Provider",liteLlmProviders:"LiteLLM 支持列表",apiKeyPlaceholder:"请输入模型 API Key",available:"已开通",retiring:"即将下线",notActivated:"未开通",unavailable:"暂不可用",apiKeyLoadError:"加载 Ark API Key 失败",loadingApiKeys:"正在加载 API Key…",selectApiKey:"选择 API Key",currentApiKey:"当前 API Key",apiKeyList:"API Key 列表",searchApiKey:"搜索 API Key",searchApiKeyName:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",noMatchingApiKey:"没有匹配的 API Key",loading:"正在加载模型…",loaded:"已加载 {{count}} 个模型",loadError:"加载模型失败",selectModel:"选择模型",selectProviderModel:"选择服务商模型",providerModels:"服务商模型",search:"搜索模型",searchPlaceholder:"搜索名称、Model ID 或服务商",noMatches:"没有匹配的模型",empty:"暂无可用模型",unknownStatus:"未知状态",refresh:"刷新",refreshing:"刷新中…",activate:"开通",activateAction:"前往开通",currentConfiguration:"当前配置"},tools:{builtIn:"内置工具",builtInHelp:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。",codeExecution:"代码执行配置",codeExecutionHelp:"指定 AgentKit 代码执行沙箱。",mcp:"MCP 工具"},catalog:{web_search:{label:"联网搜索",description:"火山引擎 Web Search,获取实时信息。"},parallel_web_search:{label:"并行联网搜索",description:"并行发起多条搜索查询,更快汇总。"},link_reader:{label:"网页读取",description:"抓取并阅读给定链接的正文内容。"},web_scraper:{label:"网页爬取",description:"结构化爬取网页(需要 Scraper 服务)。"},image_generate:{label:"图像生成",description:"文生图(Doubao Seedream)。"},image_edit:{label:"图像编辑",description:"图生图 / 编辑(Doubao SeedEdit)。"},video_generate:{label:"视频生成",description:"文/图生视频(Doubao Seedance),含任务查询。"},text_to_speech:{label:"语音合成 (TTS)",description:"把文本转成语音(火山语音)。"},run_code:{label:"代码执行",description:"在沙箱中执行代码。"},vesearch:{label:"VeSearch 智能搜索",description:"火山 VeSearch(需要 bot 端点)。"},links:{console:"控制台",documentation:"文档"},env:{modelAgentName:{comment:"模型名称"},embeddingModelName:{comment:"向量化模型(记忆/知识库需要)"},vikingMemoryProject:{comment:"VikingDB 记忆库项目"},vikingMemoryRegion:{comment:"VikingDB 记忆库地域"},vikingMemoryType:{comment:"记忆类型"},feishuAppId:{comment:"飞书应用 App ID"},feishuAppSecret:{comment:"飞书应用 App Secret",placeholder:"输入 App Secret"},registrySpaceId:{comment:"AgentKit 智能体中心",placeholder:"请选择智能体中心"},registryTopK:{comment:"召回 Agent 数量"},registryRegion:{comment:"AgentKit 智能体中心地域"},registryEndpoint:{comment:"AgentKit 智能体中心 OpenAPI 地址"},agentKitToolId:{comment:"代码执行沙箱 ID"},agentKitToolRegion:{comment:"AgentKit Tools 地域"},openVikingUrl:{comment:"OpenViking 服务地址"},openVikingMemoryUserId:{comment:"记忆归属 ID",help:"对应 viking://user/<此值>/peers/<请求用户>/memories 中的 user 段;用于隔离 Agent、租户或业务场景,默认 default。"},openVikingMemoryPolicy:{comment:"记忆策略",help:"记忆的抽取策略和隔离策略,不填写时使用官方默认策略。"},openVikingKnowledgeUserId:{comment:"知识库归属 ID",help:"未配置资源目录时用于默认路径 viking://user/<此值>/resources/<知识库索引>/,默认 default。"},openVikingTargetUri:{comment:"知识库资源目录",help:"留空时由 KnowledgeBase index 自动生成;填写后直接检索该 OpenViking 资源目录,优先级最高。"},tlsServiceName:{comment:"TLS topic_id,留空自动创建"}}},backends:{shortTerm:{local:{label:"本地内存",description:"进程内,不持久化。适合开发调试。"},sqlite:{label:"SQLite 文件",description:"持久化到本地 .db 文件。"},mysql:{label:"MySQL",description:"持久化到 MySQL。"},postgresql:{label:"PostgreSQL",description:"持久化到 PostgreSQL。"}},longTerm:{local:{label:"本地向量库",description:"进程内 llama-index 向量库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},redis:{label:"Redis",description:"Redis 向量检索。"},viking:{label:"VikingDB Memory",description:"VikingDB 记忆库(支持用户画像)。"},openviking:{label:"OpenViking Memory",description:"OpenViking 长期记忆,按用户维度保存和检索偏好、事件与实体。"},mem0:{label:"Mem0",description:"Mem0 托管记忆服务。"}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB 知识库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},context_search:{label:"Context Search",description:"火山 Context Search 引擎(无需向量化)。"},openviking:{label:"OpenViking Knowledge",description:"OpenViking 资源目录知识库,无需向量化模型配置。"}}},exporters:{apmplus:{label:"APMPlus",description:"火山 APMPlus 应用性能监控。"},cozeloop:{label:"CozeLoop",description:"扣子 CozeLoop 链路观测。"},tls:{label:"TLS (日志服务)",description:"火山 TLS 日志服务导出。"}},knowledge:{title:"知识库",description:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",backend:"知识库后端",vikingDatabase:"VikingDB 知识库"},memory:{shortTerm:"短期记忆",shortTermDescription:"存储单会话上下文",shortTermBackend:"短期记忆后端",longTerm:"长期记忆",longTermDescription:"存储跨会话上下文,通常使用向量化检索",longTermBackend:"长期记忆后端",vikingDatabase:"VikingDB 记忆库",autoSave:"自动保存会话到长期记忆",autoSaveDescription:"会话结束时自动把内容写入长期记忆,无需手动调用。"},mcp:{removeTool:"删除 MCP 工具",namePlaceholder:"名称(可选)",urlPlaceholder:"MCP 服务地址",pathWarning:"此地址未以 /mcp 结尾,请确认它是完整的 MCP 服务地址。",configuredPlaceholder:"已安全保存认证信息",tokenPlaceholder:"Bearer Token(可选)",changedUrlWarning:"MCP 地址已变化,请确认如何处理已保存的认证信息。",reuseCredential:"继续使用",replaceCredential:"替换认证",noAuth:"不使用认证",reuseHint:"发布时将继续使用已保存的认证信息。",changeToReplace:"改为替换",credentialConfigured:"认证信息已由 Studio 安全保存。",removeCredential:"移除认证",commandPlaceholder:"命令,例如 npx",argsPlaceholder:"参数,以空格分隔",stdioHint:"stdio 工具在部署环境中启动,请确保命令和依赖可用。",addTool:"添加 MCP 工具"},resources:{unnamedAgentCenter:"未命名智能体中心",unnamedKnowledgeBase:"未命名知识库",unnamedMemory:"未命名记忆库",loadError:"加载失败",loadingAgentCenters:"正在加载智能体中心…",agentCentersLoaded:"已加载 {{count}} 个智能体中心",noAgentCenters:"暂无智能体中心",noMatchingAgentCenters:"没有匹配的智能体中心",searchAgentKitCenter:"搜索 AgentKit 智能体中心",searchNameOrId:"搜索名称或 ID",selectAgentCenter:"选择智能体中心",selectAgentKitCenter:"选择 AgentKit 智能体中心",selectedAgentCenter:"已选智能体中心",agentKitCenter:"AgentKit 智能体中心",refreshAgentCenters:"刷新智能体中心",knowledgeBaseList:"知识库列表",knowledgeBasePlaceholder:"选择知识库",loadingKnowledgeBases:"正在加载知识库…",knowledgeBasesLoaded:"已加载 {{count}} 个知识库",noKnowledgeBases:"暂无知识库",noMatchingKnowledgeBases:"没有匹配的知识库",searchKnowledgeBase:"搜索知识库",selectKnowledgeBase:"选择知识库",refreshKnowledgeBases:"刷新知识库",memoryList:"记忆库列表",memoryPlaceholder:"选择记忆库",loadingMemories:"正在加载记忆库…",memoriesLoaded:"已加载 {{count}} 个记忆库",noMemories:"暂无记忆库",noMatchingMemories:"没有匹配的记忆库",searchMemory:"搜索记忆库",selectMemory:"选择记忆库",refreshMemories:"刷新记忆库"},env:{noAdditionalParameters:"此后端无需额外运行参数。",invalidJson:"请输入有效的 JSON。",helpAriaLabel:"{{label}}说明:{{help}}",openOpenViking:"打开 OpenViking {{label}}",valuePlaceholder:"请输入参数值",openVikingIndex:"OpenViking 资源索引",openVikingIndexHelp:"默认值:留空;生成项目时使用 Agent 名自动生成,例如 my_agent_kb。未配置 DATABASE_OPENVIKING_TARGET_URI 时,默认 URI 拼接为 viking://user/{知识库归属 ID,未填则 default}/resources/{资源索引}/;如果填写了 DATABASE_OPENVIKING_TARGET_URI,则直接使用该完整 URI。",openVikingIndexAriaLabel:"OpenViking 资源索引说明:{{help}}"},deployment:{vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",apiKeyRequired:"请先选择模型使用的 API Key。",invalidEnvName:"环境变量名称不合法:{{key}}",requiredEnv:"{{name}}:请填写必填环境变量",generatingConfiguration:"正在生成部署配置",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",preparing:"准备部署",complete:"部署完成",failed:"部署失败",updateAndPublish:"更新并发布",stages:{build:"构建镜像",deploy:"部署 Runtime",publish:"发布服务",running:"部署中"}},publish:{generating:"正在生成发布配置",validating:"校验 Agent 结构并准备部署快照…"}},Dce={presets:{support:{name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",subagents:{}},analyst:{name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",subagents:{}},translator:{name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",subagents:{}},coder:{name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",subagents:{}},researcher:{name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",subagents:{}},"research-team":{name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",subagents:{0:{name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。"},1:{name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。"},2:{name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"}}}},tags:{tools:"工具",memory:"记忆",knowledgeBase:"知识库",tracing:"观测",subagents:"子 Agent {{count}}"},gallery:{title:"从模板新建",subtitle:"选择一个预制 Agent 模板,按需微调后即可创建。"},detail:{back:"返回模板列表",name:"名称",systemPrompt:"系统提示词",model:"模型",tools:"工具",memory:"记忆",knowledgeBase:"知识库",tracing:"观测追踪",subagents:"子 Agent({{count}})",create:"使用此模板创建",shortTermMemory:"短期",longTermMemory:"长期"}},Mce={common:vce,yaml:xce,validation:wce,defaults:Oce,helpers:Sce,intelligentDeployment:kce,codePackage:Ece,buildCanvas:Cce,intelligent:Tce,projectLibrary:Ace,modePicker:_ce,promptEditor:Nce,skills:jce,workflow:Rce,workbench:Ice,traditional:Pce,template:Dce},hMe=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:Cce,codePackage:Ece,common:vce,default:Mce,defaults:Oce,helpers:Sce,intelligent:Tce,intelligentDeployment:kce,modePicker:_ce,projectLibrary:Ace,promptEditor:Nce,skills:jce,template:Dce,traditional:Pce,validation:wce,workbench:Ice,workflow:Rce,yaml:xce},Symbol.toStringTag,{value:"Module"})),Lce={backToList:"返回定时任务列表",cancel:"取消",cancelQueue:"取消排队",cancelQueueFirst:"请先取消排队",cancelling:"取消中…",closeDrawer:"关闭抽屉",collapse:"收起",connectingRuntime:"正在连接 Runtime…",createScheduledTask:"创建定时任务",createTask:"创建任务",delete:"删除",deleteTask:"删除任务",edit:"编辑",enable:"启用",expand:"展开",pause:"暂停",refresh:"刷新",refreshHistory:"刷新执行历史",rerun:"重新执行",retry:"重试",runNow:"立即执行",saveChanges:"保存更改",saving:"保存中…",stop:"终止执行",stopRun:"终止本次执行",stopRunFirst:"请先终止当前执行",stopping:"终止中…",viewDetails:"查看详情"},$ce={cancelDescription:"本次 Session 将被取消,后续计划不会暂停。",cancelTitle:"终止本次执行?",deleteDescription:"“{{name}}”及其全部执行历史将被永久删除。",deleteTitle:"删除定时任务?"},Fce={configuration:"任务配置",nextRun:"下次执行",pageLabel:"定时任务详情",region:"地域",runtime:"运行时",status:"任务状态"},Bce={createTitle:"创建定时任务",description:"每次触发都会为 Runtime Agent 创建独立 Session。",editTitle:"编辑定时任务"},Uce={minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",seconds:"{{count}} 秒"},Qce={cronExpression:"Cron 表达式",cronHelp:"依次填写分钟、小时、日期、月份、星期。",dailyTime:"每天执行时间",enableAfterCreate:"创建后启用",enableHelp:"启用后会从下一个计划时间开始执行。",name:"任务名称",namePlaceholder:"例如:每日生成运营摘要",noRuntime:"暂无可用 Runtime",prompt:"执行文本",promptPlaceholder:"输入每次执行时发送给 Agent 的固定文本",runAt:"执行时间",runtimeAgent:"运行时智能体",runtimeHelp:"任务始终跟随该 Runtime 当前生效版本。",runtimePlaceholder:"选择 Runtime Agent",schedule:"执行计划",scheduleType:"执行计划类型",timezone:"时区",weekday:"星期"},zce={all:"全部"},Vce={description:"每次运行均使用独立 Session,结果与错误会永久保留。",duration:"耗时 {{duration}}",emptyDescription:"任务触发或立即执行后,记录会显示在这里。",emptyTitle:"暂无执行记录",errorDetails:"错误详情",finalAnswer:"最终回答",loadFailed:"无法加载执行历史",loadFailedDescription:"请检查 Studio 服务后重试。",session:"会话",title:"执行历史"},Hce={cancelRequested:"已提交终止请求。",created:"任务已创建。",deleted:"任务及其执行历史已删除。",enabled:"任务已启用。",paused:"任务已暂停。",queued:"任务已排队,将在一分钟内开始执行。",requeued:"任务已重新排队,将在一分钟内开始执行。",updated:"任务已更新。"},qce={filterLabel:"定时任务状态筛选",listLabel:"定时任务列表",loadFailed:"无法加载定时任务",loadFailedDescription:"请检查 Studio 服务后重试。",title:"定时任务"},Wce={cron:"Cron {{cron}}{{zone}}",daily:"每天 {{time}}{{zone}}",once:"一次 · {{date}}{{zone}}",weekly:"{{weekday}} {{time}}{{zone}}"},Gce={daily:"每天",once:"一次性",weekly:"每周"},Kce={cancelled:"已取消",enabled:"已启用",failed:"失败",notRun:"尚未执行",paused:"已暂停",pending:"准备中",queued:"已排队",retrying:"自动重试中",running:"执行中",skipped:"已跳过",success:"成功"},Xce={cronFields:"Cron 表达式需要包含 5 个字段,例如 0 9 * * *。",nameRequired:"请输入任务名称。",promptRequired:"请输入每次执行时发送给 Agent 的文本。",runtimeAppMissing:"Runtime Agent 未返回可调用的 appName,请确认 Runtime 已就绪且版本兼容。",runtimeRequired:"请选择可用的 Runtime Agent。",timeRequired:"请选择执行时间。"},Yce={friday:"周五",monday:"周一",saturday:"周六",sunday:"周日",thursday:"周四",tuesday:"周二",wednesday:"周三"},pMe={actions:Lce,confirm:$ce,detail:Fce,drawer:Bce,duration:Uce,fields:Qce,filters:zce,history:Vce,notices:Hce,page:qce,schedule:Wce,scheduleTypes:Gce,status:Kce,validation:Xce,weekdays:Yce},mMe=Object.freeze(Object.defineProperty({__proto__:null,actions:Lce,confirm:$ce,default:pMe,detail:Fce,drawer:Bce,duration:Uce,fields:Qce,filters:zce,history:Vce,notices:Hce,page:qce,schedule:Wce,scheduleTypes:Gce,status:Kce,validation:Xce,weekdays:Yce},Symbol.toStringTag,{value:"Module"})),Zce="问题反馈",Jce="问题描述",eue="常见问题",tue="取消",nue="完成",iue="提交反馈",rue="正在上报…",sue={title:"上报成功,感谢您的反馈",description:"AgentKit 团队会尽快查看您提交的问题。"},aue={close:"关闭问题反馈",intro:"请选择遇到的问题,也可以补充具体表现。",privacy:"您的对话数据将会上报到 AgentKit 团队,请注意隐私保护。",descriptionPlaceholder:"请描述问题发生时的表现(选填)",issues:{slow:"执行速度慢",crash:"运行崩溃",incorrect:"结果不准确",tool_error:"工具调用失败",other:"其他问题"}},oue={description:"告诉我们您在使用 AgentKit Studio 时遇到的问题。",module:"所属模块",modules:{conversation:"对话",agents:"智能体",applications:"自动化",search:"搜索",other:"其他"},commonIssuesMultiple:"常见问题(可多选)",issueTypes:"问题类型",issues:{page_slow:"页面加载慢",feature_unavailable:"功能无法使用",display_error:"页面显示异常",no_response:"操作无响应",other:"其他问题"},descriptionPlaceholder:"请描述问题发生时的页面、操作和表现",quickAdd:"快捷补充",suggestionsLabel:"问题描述推荐",suggestions:{noResponse:"点击后没有反应",loading:"页面一直处于加载状态",incomplete:"部分内容显示不完整",error:"操作后出现错误提示"},privacy:"您的数据将会上报到 AgentKit 团队,请注意隐私保护。"},gMe={title:Zce,descriptionLabel:Jce,commonIssues:eue,cancel:tue,done:nue,submit:iue,submitting:rue,success:sue,dialog:aue,page:oue},bMe=Object.freeze(Object.defineProperty({__proto__:null,cancel:tue,commonIssues:eue,default:gMe,descriptionLabel:Jce,dialog:aue,done:nue,page:oue,submit:iue,submitting:rue,success:sue,title:Zce},Symbol.toStringTag,{value:"Module"})),lue={back:"返回",close:"关闭"},cue={title:"优化迁移项目",closeAria:"关闭优化窗口"},uue={title:"已迁移项目",description:"管理迁移后的源码版本,也可以选择任一版本继续优化。",libraryTitle:"项目与版本",libraryDescription:"查看、下载、部署或对比源码版本,也可以基于任一版本继续优化。",emptyTitle:"还没有已迁移的项目",emptyDescription:"迁移完成后,源码会自动保存在这里。"},due={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any(通用迁移)"},fue={awaitingUpload:"待上传",analyzing:"分析中",needsInput:"待补充",analysisReady:"待确认",migrating:"迁移中",validating:"校验中",packaging:"打包中",succeeded:"已完成",succeededWithWarnings:"已完成,有提示",partial:"部分完成",failed:"失败",cancelled:"已终止",expired:"已过期"},hue={partialReady:"迁移产物已生成,但交付不完整,请查看迁移提示。",readyWithWarnings:"迁移产物已生成,请查看迁移提示。",ready:"迁移产物已生成。"},pue={passed:"产物校验通过",failed:"产物校验未通过",degraded:"产物校验未完成"},mue={session:"创建迁移环境",upload:"上传项目",analysis:"分析项目"},gue={agentNameRequired:"请输入 Agent 名称",agentNameInvalid:"Agent 名称必须为 1-63 位,只能包含小写字母、数字和连字符,且必须以字母或数字开头和结尾"},bue={seconds:"{{seconds}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},yue={savedUnaffected:"已保存项目不受影响",savingUnaffected:"源码正在保存,完成后不受环境期限影响",activeDetail:"到期后任务记录和临时产物将无法访问",oneHour:"临时迁移环境保留 1 小时",ended:"临时迁移环境已结束",savedAvailable:"已保存项目仍可查看、下载、部署或优化",unavailable:"任务记录和临时产物已无法访问",countdown:"临时迁移环境将在 {{minutes}} 分 {{seconds}} 秒后结束",expiredSavedMessage:"临时迁移环境已结束,已保存项目不受影响。",expiredMessage:"临时迁移环境已结束,任务记录和临时产物无法继续访问。"},vue={recommended:"建议迁移方式",scope:"迁移范围",excluded:"不在本次范围",viewEvidence:"查看分析证据",viewAssumptions:"查看关键假设",viewSourceEvidence:"查看源码证据"},xue={ariaLabel:"Codex 执行动态",title:"Codex 执行动态",startingAnalysis:"Codex 正在开始分析…",startingMigration:"Codex 正在开始迁移…",loadError:"暂时无法读取 Codex 执行动态,不影响当前任务。"},wue={title:"迁移产物",fileTooLarge:"该文件超过 2 MiB,请下载完整产物后查看。",unsupportedPreview:"该文件不支持在线预览,请下载完整产物后查看。",filesAria:"迁移产物文件",searchAria:"搜索产物文件",searchPlaceholder:"搜索文件",limit:"仅展示前 {{count}} 项,请搜索具体文件。",noSelection:"未选择文件",noPreview:"暂无可预览文件。",loadingFile:"正在读取产物文件…",startupFile:"启动文件",fileCountLabel:"文件数",saved:"源码已保存,可继续查看、下载、部署或优化。",saving:"产物已生成,正在保存源码版本。",deployReady:"产物可预览、下载和部署,正在等待源码保存状态。",deployUnavailable:"产物可预览和下载,但当前交付状态不支持部署。",viewProjects:"查看已迁移项目",downloading:"下载中…",downloadZip:"下载 ZIP",deployTitle:"部署迁移产物",deployUnavailableTitle:"当前交付状态不支持部署",deployRuntime:"部署到 Runtime",fileCount:"{{count}} 个文件",startup:"启动文件 {{module}}",loading:"正在读取迁移产物…"},Oue={retiring:"即将下线",currentDefault:"当前默认模型",loadError:"加载模型列表失败",label:"模型",placeholder:"选择模型"},Sue={zipOnly:"请选择 .zip 格式的本地项目文件。",invalidName:"ZIP 文件名无效,请重命名后重新选择。",tooLarge:"项目 ZIP 不能超过 {{size}}。",empty:"项目 ZIP 不能为空。",removeAria:"移除项目 ZIP",reselectPrompt:"重新选择项目 ZIP",selectPrompt:"选择或拖入本地项目 ZIP",reselect:"重新选择",selectZip:"选择 ZIP",continue:"继续上传",start:"开始迁移",inputAria:"选择本地项目 ZIP",retention:"临时迁移环境从创建完成起保留 1 小时;保存成功的源码版本不受影响。"},kue={requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}",notReady:"迁移产物尚未准备完成。",back:"返回迁移结果"},Eue={backToAddAgent:"返回添加 Agent",title:"从存量迁移",newMigration:"新建迁移",recent:"最近迁移",sessionsAria:"迁移会话",loadingSessions:"正在读取迁移会话…",noSessions:"暂无迁移会话",heading:"迁移存量 Agent 项目",intro:"上传本地项目 ZIP,Codex 将先进行只读分析,再由你确认迁移方式。"},Cue={stop:"终止迁移",stopping:"正在终止…",reload:"重新读取",refreshStatus:"刷新状态"},Tue={unavailable:"迁移能力暂不可用",defaultReason:"Dev Sandbox 暂不可用,请联系管理员检查配置。"},Aue={requestZip:"请提供本地项目 ZIP。上传后我会识别框架、入口和迁移边界,并在执行实际迁移前请你确认迁移方式。",zipHint:"仅支持本地 ZIP,最大 {{size}};迁移环境从创建起保留 1 小时。",creatingSandbox:"正在创建 Dev Sandbox",initializing:"正在初始化迁移工作目录,并检查 AgentKit CLI、Codex 和迁移能力。环境就绪后将自动上传项目。",elapsed:"已等待 {{duration}}",uploadThenAnalyze:"ZIP 上传完成后将自动开始只读分析。",analyzing:"Codex 正在识别框架、入口和迁移边界,不会执行实际迁移。",migrationLocked:"迁移执行中不能修改附件或迁移方式。你可以等待当前任务结束,或主动终止。",analysisPaused:"只读分析已暂停。请仅回答下面列出的问题,提交后会在同一迁移环境中重新分析,不会开始实际迁移。",analysisComplete:"只读分析已完成。请检查建议,并确认最终迁移方式。",awaitingUpload:"迁移环境已创建,请重新选择本地 ZIP 继续上传。",expiredTitle:"迁移环境已过期",expiredDescription:"迁移内容和产物已无法预览、下载或部署。如已完成 Runtime 部署,可返回智能体页面继续使用。",unsupportedTitle:"当前 ZIP 暂时无法迁移",unsupportedHint:"请按提示整理项目后,新建迁移并重新上传。",failedTitle:"迁移未完成",cancelled:"当前迁移已终止。你可以新建迁移并重新上传项目。"},_ue={ariaLabel:"补充项目分析信息",title:"补充分析所需信息",description:"附件保持锁定,提交后仅继续只读分析",submitting:"正在继续分析…",submit:"提交并继续分析"},Nue={ariaLabel:"确认迁移方式",title:"确认迁移方式",description:"确认后才会执行实际迁移",framework:"迁移方式",frameworkPlaceholder:"选择迁移方式",agentName:"Agent 名称",entry:"项目入口",entryPlaceholder:"选择项目入口",entryExample:"例如 agent.py:agent",consent:"点击“确认并开始迁移”即确认上述迁移范围、排除项和关键假设。",starting:"正在启动迁移…",start:"确认并开始迁移"},jue={closeAria:"关闭错误提示",loadFailed:"无法读取迁移数据,请重试。",refreshFailed:"无法刷新迁移状态,请重试。"},Rue={title:"终止当前迁移?",description:"终止后,当前分析或迁移进程将停止,已执行的步骤不会继续。"},yMe={common:lue,optimization:cue,projects:uue,framework:due,state:fue,task:hue,verification:pue,transfer:mue,validation:gue,duration:bue,expiry:yue,analysis:vue,activity:xue,artifact:wue,model:Oue,upload:Sue,deployment:kue,workspace:Eue,actions:Cue,capability:Tue,conversation:Aue,questions:_ue,confirmation:Nue,errors:jue,stopDialog:Rue},vMe=Object.freeze(Object.defineProperty({__proto__:null,actions:Cue,activity:xue,analysis:vue,artifact:wue,capability:Tue,common:lue,confirmation:Nue,conversation:Aue,default:yMe,deployment:kue,duration:bue,errors:jue,expiry:yue,framework:due,model:Oue,optimization:cue,projects:uue,questions:_ue,state:fue,stopDialog:Rue,task:hue,transfer:mue,upload:Sue,validation:gue,verification:pue,workspace:Eue},Symbol.toStringTag,{value:"Module"})),Iue={loading:"加载中…",searchLabel:"搜索{{label}}",searchPlaceholder:"搜索{{label}}",retry:"重试",noMatches:"没有匹配项",noOptions:"暂无可选项",selection:"{{label}}:{{value}}"},Pue={badge:"焕然一新",view:"查看新特性",title:"本次更新",defaultNotes:{multiRegion:"多地域智能体:并行加载北京与上海 Runtime,列表下滑即可继续加载。",switchAgent:"会话内切换:在输入框旁选择智能体,并直接开启一段新会话。",visualCanvas:"可视化执行画布:通过横向画布查看多智能体结构,并支持全屏浏览。"}},Due={label:"新会话模式",agent:"智能体",skill:"技能定制",video:"视频创作"},Mue={select:"选择新会话模式",agent:{label:"Agent",description:"与当前选择的 Agent 对话"},builtin:{label:"内置智能体",description:"使用平台提供的智能体"},codex:{label:"Codex 智能体",description:"在沙箱中执行任务"},deepseekHarness:{label:"DeepSeek Harness",description:"打开 DeepSeek Harness 工作区"},arkClaw:"ArkClaw",hermes:"Hermes 智能体",checking:"正在检查配置",notConfigured:"管理员未配置",unavailable:"暂不可用"},Lue={select:"选择智能体",typesLabel:"智能体类型",listLabel:"{{type}}列表",types:{agent:"智能体",general:"通用智能体",codex:"Codex 智能体",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw 智能体",hermes:"Hermes 智能体"},loading:"正在加载智能体",reload:"重新加载",empty:"暂无{{type}}",emptyLocal:"暂无本地智能体",emptyGeneral:"暂无通用智能体",createHint:"请前往智能体页创建",localHint:"请检查当前 Studio 启动目录",waking:"正在唤醒",opening:"正在打开",connecting:"正在连接",loadingMore:"加载中",loadMore:"加载更多",runtimeTimeout:"加载智能体超时(15 秒),请检查网络或 Runtime 服务后重试",loadGeneral:"加载通用智能体",loadType:"加载 {{type}}",connectGeneral:"连接通用智能体",openLocal:"打开本地智能体",openType:"打开 {{type}}"},$ue={spaceAria:"技能空间",configuration:"技能定制配置",actions:{create:"技能生成",optimize:"技能优化"},selectAction:"选择技能定制方式",actionList:"技能定制方式",style:"风格",selectStyle:"选择风格",model:"模型",selectModel:"选择模型",styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先"},modelLoadFailed:"模型配置加载失败",spaceLoadFailed:"Skill Space 加载失败",skillLoadFailed:"Skill 加载失败",unnamedSpace:"未命名 Skill Space",space:"技能空间",select:"选择 Skill",selectAria:"选择 Skill:{{skill}}",loadingSpaces:"正在加载 Skill Space",reload:"重新加载",emptySpaces:"暂无 Skill Space",skillList:"{{space}} Skill 列表",loadingSkills:"正在加载 Skill",emptySkills:"暂无 Skill"},Fue={modes:{auto:"自动识别",text_to_video:"文生视频",reference_to_video:"参考素材生视频",video_editing:"视频编辑",video_extension:"视频续写",first_last_frame:"首尾帧生成"},taskNames:{auto:"视频生成",text_to_video:"文生视频",reference_to_video:"参考素材生视频",video_editing:"视频编辑",video_extension:"视频续写",first_last_frame:"首尾帧生成"},controls:{label:"视频创作配置",aspectRatio:"比例",selectAspectRatio:"选择比例",resolution:"清晰度",selectResolution:"选择清晰度",duration:"时长",durationShort:"{{count}} 秒",durationAria:"视频时长:{{count}} 秒",lastFrame:"尾帧",lastFrameHelper:"添加视频结束画面",assistImage:"辅助图片",referenceImage:"参考图片",assistImageHelper:"用于补充画面参考",imageHelper:"支持常见图片格式",referenceVideo:"参考视频",videoHelper:"支持常见视频格式",optional:"可选",replace:"更换",add:"添加",upload:"上传{{label}}",replaceFile:"更换{{label}}:{{name}}",removeFile:"移除{{label}} {{name}}",storageUnavailable:"管理员未配置持久化存储",loadingEnhancer:"正在加载增强模型",enhancerHint:"使用 {{model}} 模型进行意图识别和提示词增强",enhancerUnavailable:"增强模型不可用"},task:{title:"视频生成任务",closeAria:"关闭视频生成任务弹窗",progressAria:"视频生成进度",optimizedPrompt:"优化后的提示词",processingAria:"{{task}}处理进度",waitingAria:"{{status}},已等待{{elapsed}}",elapsed:"已等待 {{elapsed}}",previewAria:"生成结果预览",close:"关闭",download:"下载视频",retryOptimization:"重试提示词优化",retryGeneration:"重试视频生成",providerQueued:"等待模型调度",providerRunning:"模型生成中",providerSubmitting:"正在提交任务",queuedHint:"任务已提交,模型开始处理后状态会自动更新",runningHint:"这可能持续数分钟,完成后将在这里显示视频预览",backgroundHint:"可以关闭弹窗,任务会继续在后台运行",successHint:"视频已生成,可预览或下载",activationHint:"请先在模型控制台开通服务,再重试生成",retryHint:"修正问题后可重试当前步骤",steps:{optimizationFailed:"提示词优化失败",optimizationDone:"提示词优化完成",optimizationActive:"提示词优化中",generationDone:"{{task}}已完成",generationFailed:"{{task}}失败",generationQueued:"{{task}}排队中",generationRunning:"{{task}}生成中",generationActive:"{{task}}进行中",generationPending:"等待视频生成",generationComplete:"视频生成完成"},elapsedHours:"{{hours}}小时{{minutes}}分",elapsedMinutes:"{{minutes}}分{{seconds}}秒",elapsedSeconds:"{{seconds}}秒"}},Bue={compactSelect:Iue,featureNotice:Pue,workspace:Due,mode:Mue,agentPicker:Lue,skill:$ue,video:Fue},xMe=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:Lue,compactSelect:Iue,default:Bue,featureNotice:Pue,mode:Mue,skill:$ue,video:Fue,workspace:Due},Symbol.toStringTag,{value:"Module"})),Uue={cancel:"取消",close:"关闭",retry:"重试",tryAgain:"重新尝试",closeDialog:"关闭{{title}}",agentFallback:"{{agent}} 智能体",unknownSource:"未知来源"},Que={terminalTitle:"终端",browserTitle:"沙箱浏览器",terminalSubtitle:"连接当前 AgentKit Session 的交互式终端",browserSubtitle:"在当前 AgentKit Session 中查看与操作浏览器",connecting:"正在连接…",connected:"已连接",notConnected:"尚未连接",opening:"正在打开 {{title}}",connectingSession:"工具正在连接当前 AgentKit Session。",openFailed:"{{title}} 打开失败"},zue={title:"恢复 Codex 对话",subtitle:"选择当前 Sandbox Session 中最近更新的 Thread",loading:"正在读取历史对话",loadFailed:"历史对话读取失败",empty:"暂无可恢复的对话"},Vue={title:"Codex 权限",subtitle:"设置会保存到当前 Sandbox Session,并同步到其中的所有 Thread",sandboxMode:"沙箱模式",approvalPolicy:"审批策略",approvalMethod:"审批方式",networkAccess:"允许网络访问",networkAccessHelp:"控制 workspace-write 与只读模式中的外部网络访问。",fullAccessWarning:"完全访问会关闭文件系统与网络隔离,请只在可信任务中使用。",save:"保存权限",sandboxChoices:{readOnly:{label:"只读",detail:"允许读取文件,不允许写入工作空间。"},workspaceWrite:{label:"工作区写入",detail:"允许在当前工作空间内读取与修改文件。"},fullAccess:{label:"完全访问",detail:"不启用沙箱隔离,适合明确可信的任务。"}},approvalChoices:{untrusted:{label:"仅不可信命令",detail:"只对 Codex 判断为不可信的操作发起审批。"},onRequest:{label:"按需审批",detail:"Codex 可在必要时请求你确认命令或文件修改。"},never:{label:"不审批",detail:"Codex 不会暂停并请求人工批准。"}},reviewerChoices:{user:{label:"由我审批",detail:"审批请求会显示在 Studio 中,由你决定。"},autoReview:{label:"自动审查",detail:"使用 Codex 自动审查流程处理审批请求。"}}},Hue={title:"工作空间",subtitle:"选择当前 Codex Thread 执行命令与修改文件的目录",absolutePath:"绝对路径",browse:"浏览",parent:"上一级",empty:"当前目录没有子目录",locked:"当前对话已经开始,工作空间已锁定。新建 Sandbox 会话后可重新选择。",useDirectory:"使用此目录"},que={fileTitle:"允许修改文件?",commandTitle:"允许执行命令?",subtitle:"Codex 正在等待你的决定",workingDirectory:"执行目录",decline:"拒绝",acceptOnce:"仅本次允许",acceptSession:"本会话允许"},Wue={availableSkills:"可用 Skills",selectModel:"选择模型",commands:"Codex 快捷命令",currentModel:"当前:{{model}}",loadingSkills:"正在发现当前工作区的 Skills…",loadingModels:"正在读取模型…",noSkillMatches:"当前工作区没有匹配的 Skill",noModelMatches:"没有匹配模型,也可以直接输入模型 ID",noCommandMatches:"没有匹配的快捷命令",skillFallback:"加载并执行该 Skill",add:"添加",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",openTerminal:"进入终端",viewBrowser:"查看浏览器",permissions:"Codex 权限",workspaceLocked:"对话已开始,工作空间已锁定",selectWorkspace:"选择工作空间",workspace:"Codex 工作空间",endpointCopied:"Endpoint 已复制",copyEndpoint:"复制 Sandbox Endpoint",continuePlaceholder:"继续说明你想实现或调整的内容",messagePlaceholder:"向 AgentKit 沙箱发送消息,输入 / 查看命令,输入 $ 调用 Skill…",stop:"停止生成",send:"发送"},Gue={defaultName:"我的智能体",namedDefault:"我的 {{agent}}",creatingTitle:"正在创建 {{agent}} 智能体",failedTitle:"启动失败",createTitle:"创建 {{agent}} 智能体",fallbackError:"AgentKit 沙箱初始化失败,请稍后重新尝试。",creatingDescription:"正在创建并等待 {{agent}} 智能体就绪,这通常需要半分钟",name:"智能体名称",storageSize:"存储大小",storageHelp:"数据将持久化保存,可设置 {{min}}–{{max}} GiB。",persistent:"持久化",persistenceUnsupported:"当前环境不支持快照持久化",persistentHelp:"保留智能体数据,后续可继续使用。",temporaryHelp:"智能体将在 8 小时后清空",cancelCreation:"取消创建",confirm:"确认创建",retry:"重新尝试"},Kue={activeAria:"Codex 智能体会话已开启",openAria:"开启 Codex 智能体会话",active:"Codex 智能体会话中",entry:"灵光一现",exit:"退出当前智能体",expired:"已到期",remainingHours:"剩余 {{hours}} 小时 {{minutes}} 分钟",remainingMinutes:"剩余 {{minutes}} 分钟",expiryWarning:"远端开发环境最长保留 8 小时,将于 {{expiry}} 到期({{remaining}});到期后清除对话和文件。",usingAgent:"当前您在使用 {{agent}} 智能体",activityAria:"Sandbox 操作记录",activity:"操作记录",tokenUsageAria:"Codex Token 用量",tokens:"{{label}}:{{value}} tokens",tokenLabels:{total:"总计",input:"输入",cachedInput:"缓存输入",output:"输出",reasoningOutput:"推理输出"}},Xue={back:"返回智能体列表",subtitle:"{{agent}} AgentKit Session 详情",type:"智能体类型",status:"状态",createdBy:"创建人",snapshotStatus:"快照状态",toolType:"工具类型",createdAt:"创建时间",snapshotReason:"快照原因",expiresAt:"过期时间",snapshotId:"快照 ID",sessionId:"会话 ID",sourceSessionId:"来源 Session ID",delete:"删除智能体",waking:"唤醒中…",opening:"打开中…",wake:"唤醒智能体",open:"打开智能体",deleteTitle:"删除智能体?",deleteDescription:"将删除“{{name}}”及其 AgentKit {{resource}},此操作无法撤销。",deleting:"删除中…",confirmDelete:"确认删除"},Yue={back:"返回智能体列表",createdBy:"创建人 {{creator}}",ariaLabel:"智能体工作区",main:"主界面",terminal:"终端",mainTitle:"{{agent}} 主界面",openingTerminal:"正在打开终端…",terminalTitle:"{{agent}} 终端"},Zue={prompt:`使用 AgentKit Studio Plugin 端云接力当前会话、项目和任务。请直接执行,不要让我手动打开终端。 +- 保持礼貌、专业的语气。`},Sce={requestFailed:"请求失败 ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 AgentKit 智能体中心",loginRequired:"请先登录以访问 AgentKit 智能体中心"},vikingKnowledge:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 知识库",loginRequired:"请先登录以访问 VikingDB 知识库"},vikingMemory:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 记忆库",loginRequired:"请先登录以访问 VikingDB 记忆库"},mcpGateway:{missingHttpTool:"请返回“添加 MCP 工具”并添加至少一个 HTTP MCP 服务;MCP 稳定性治理不支持 stdio 服务。",missingUrl:"已添加的 HTTP MCP 工具缺少有效服务地址,请返回“添加 MCP 工具”补充后再发布。"},customModel:{fallbackName:"自定义模型",apiKeyLabel:"{{name}} 模型 API Key"},deploymentEnv:{serverInjected:"由服务端注入",selectedApiKeyPlaceholder:"由所选 API Key 注入",mcpInjectedComment:"由已添加的 MCP 工具注入",restoredPlaceholder:"由 Studio 服务端安全恢复",generatedMcpPlaceholder:"由已添加的 HTTP MCP 工具自动生成",restoredHelp:"更新时由 Studio 服务端合并 MCP 地址与认证,不向浏览器返回旧密钥。",mergedMcpHelp:"Studio 服务端自动合并 MCP 地址与可选认证,不向浏览器返回旧密钥。",listSeparator:"、",requirementHint:"优化项“{{labels}}”依赖此配置。",requiredBy:"优化项“{{labels}}”依赖此配置,请填写 {{key}}。",required:"请填写 {{label}}({{key}})。",invalidJson:"JSON 格式不正确"},drafts:{unsupportedVersion:"本机草稿版本暂不受支持,请升级 Studio 后重试。",invalidFormat:"本机草稿数据格式无效。",readFailed:"无法读取本机草稿,浏览器中的草稿数据可能已损坏。",quotaExceeded:"浏览器存储空间不足,草稿未保存。请删除不需要的草稿或清理此站点的浏览器存储后重试。",writeRejected:"浏览器拒绝保存草稿,请检查站点存储权限后重试。"},skills:{searchFailed:"搜索失败 ({{status}})",downloadFailed:"下载技能失败 ({{status}})",agentKitRequestFailed:"AgentKit Skills 请求失败",missingManifest:"{{location}} 缺少 SKILL.md",invalidParentPath:"{{location}} 包含非法路径(..):{{path}}",invalidPath:"{{location}} 包含非法路径:{{path}}",localDescription:"本地 Skill",folderSource:"文件夹",noManifest:"{{location}} 中未发现 SKILL.md"},zip:{invalid:"无效的 zip:找不到 EOCD",tooManyFiles:"zip 文件数不能超过 {{count}} 个",tooLarge:"zip 解压后的内容过大"}},kce={back:"返回开发会话",runtimeName:"Runtime 名称",runtimeNameExists:"Runtime 名称已存在,请更换后重试",checkingRuntimeName:"正在检查 Runtime 名称",verifiedSource:"已验证源码",deployableSource:"可部署源码",verifiedByCodex:"已通过 Codex 云端验证",entryPoint:"入口",files:"文件",artifact:"构建产物",validationReport:"验证报告",verifiedHint:"源码由服务端从已验证交付物物化,浏览器文件不能替换。",unverifiedHint:"源码已由服务端安全物化,部署前请确认 Runtime 配置。",env:{requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}"}},Ece={name:"代码包",back:"返回创建方式",reading:"正在读取代码包",readingEllipsis:"正在读取代码包…",uploadFirst:"请先上传代码包",uploadAriaLabel:"代码包上传",upload:"上传代码包",reupload:"重新上传代码包",uploadPrompt:"请上传代码包",filesRecognized:"已识别 {{count}} 个文件,点击区域可重新上传",dropHint:"点击或拖拽上传,支持 .zip 格式,最大 50 MB;可使用 app.py,或由 agentkit.yaml 声明入口",viewFiles:"查看文件",chooseFile:"选择代码包",errors:{invalidFormat:"请选择 .zip 格式的代码包。",tooLarge:"代码包不能超过 50 MB。",invalidPath:"压缩包包含非法路径:{{name}}",empty:"压缩包中没有可部署的文件。",tooManyFiles:"代码包文件数不能超过 {{count}} 个。",duplicateFile:"代码包包含重复文件:{{path}}",manifestParse:"agentkit.yaml 无法解析:{{detail}}",manifestRoot:"agentkit.yaml 根节点必须是对象。",manifestCommon:"agentkit.yaml 的 common 必须是对象。",entryPointType:"agentkit.yaml 的 common.entry_point 必须是文件路径。",entryPointInvalid:"agentkit.yaml 的 common.entry_point 不是有效文件路径。",entryPointMissing:"代码包中不存在 agentkit.yaml 声明的启动入口:{{entryPoint}}",defaultEntryPointMissing:"代码包根目录必须包含 app.py,或在 agentkit.yaml 的 common.entry_point 中声明已有入口。"}},Cce={label:"Agent 执行画布",readOnlyLabel:"只读 Agent 执行画布",minimapLabel:"执行流程缩略图",controls:{ariaLabel:"执行流程控制",zoomIn:"放大",zoomOut:"缩小",fitView:"适应视图"},rootAgent:"主 Agent",unnamedStep:"未命名步骤",terminals:{input:"用户请求",output:"最终回复"},edges:{then:"然后",continueLoop:"继续循环",call:"调用"},patterns:{llm:{label:"智能体",description:"理解任务并直接完成一个具体工作"},sequential:{label:"分步协作",description:"内部步骤按照顺序依次执行"},parallel:{label:"同时处理",description:"内部步骤同时工作,完成后统一汇总"},loop:{label:"循环执行",description:"重复执行内部步骤,直到满足停止条件"},a2a:{label:"远程智能体",description:"调用已经存在的远程 Agent"}},actions:{insertHere:"在这里插入步骤",deleteNamed:"删除 {{name}}",deleteNode:"删除节点",addSubagent:"添加子 Agent",addParallelStep:"添加一个同时处理的步骤",addLoopStep:"添加循环步骤",addNextStep:"添加下一个步骤",addFirst:"添加到最前",addLast:"添加到最后"}},Tce={title:"智能模式",subtitle:"描述目标后,沙箱中的 Codex 会判断你的意图,完成构建、调试和临时云端验证。",model:{label:"模型",placeholder:"选择模型",retiring:"即将下线",currentConfiguration:"当前配置",loadError:"加载模型列表失败"},availability:{checking:"正在检查智能开发能力…",unavailable:"当前无法使用智能模式,请返回后重试。"},goal:{title:"从目标开始",continueTitle:"继续优化项目",hint:"只需说明 Agent 要解决的问题;如有影响结果的关键信息,会在开始前向你确认。",continueHint:"说明这次要调整的内容,完成后会保存为新版本。",basedOn:"基于",clearSelection:"取消选择",label:"目标描述",optimizationLabel:"优化目标",placeholder:"例如:创建一个能读取销售数据、生成周报并校验输出格式的 Agent",optimizationPlaceholder:"例如:增加数据来源标注,并在信息不足时先向用户确认"},actions:{preparing:"准备中…",build:"开始构建",optimize:"开始优化"},preparation:{accepted:"目标已收到,马上开始实现",preparing:"正在创建任务环境…",starting:"环境已就绪,正在启动 Codex…",next:"接下来会先梳理目标和实现方式,再编写、运行和验证 Agent。"}},Ace={title:"已保存项目",description:"选择已有版本继续优化,或查看、下载和部署源码。",refresh:"刷新项目列表",checkingStorage:"正在检查项目存储…",unavailableTitle:"暂时无法读取项目",storageCheckError:"无法确认项目存储状态,请稍后重试。",storageNotConfigured:"项目存储尚未配置。",loadingMigrated:"正在读取已迁移项目…",loadingSaved:"正在读取已保存项目…",loadingVersions:"正在读取项目版本…",unknownTime:"时间未知",sourceDownloaded:"源码已下载。",projectSummary_one:"{{count}} 个版本 · 更新于 {{time}}",projectSummary_other:"{{count}} 个版本 · 更新于 {{time}}",versionSummary_one:"{{time}} · {{count}} 个文件",versionSummary_other:"{{time}} · {{count}} 个文件",noVersionDescription:"暂无版本描述",latestVersion:"最新版本",verified:"已验证",pendingVerification:"待确认",viewSource:"查看源码",download:"下载",downloading:"下载中…",optimize:"去优化",optimizeUnavailable:"去优化,暂不支持",errors:{projects:"无法读取已保存项目。",source:"无法读取项目源码。",versions:"无法读取项目版本。",download:"下载源码失败。",prepareDeployment:"无法准备部署源码。",deleteVersion:"删除项目版本失败。",migrated:"无法读取已迁移项目",saved:"无法读取已保存项目"},empty:{migratedTitle:"还没有已迁移的项目",savedTitle:"还没有已保存的项目",migratedDescription:"完成首次迁移后,源码会自动保存在这里。",savedDescription:"完成首次构建后,源码会自动保存在这里。",noVersions:"这个项目还没有可用版本。"},compare:{selected:"已选择 {{count}}/2",selectedLabel:"已选择",select:"选择",view:"查看对比",start:"对比版本"},delete:{title:"删除这个版本?",onlyVersion:"“{{name}}”只有这一个版本,删除后项目也会移除。此操作无法撤销。",description:"该版本的源码和验证记录将永久删除,其他版本不受影响。",confirm:"删除版本"}},_ce={title:"选择创建方式",subtitle:"以不同模式构建您的智能体",features:"特性",quick:{title:"快速模式",description:"动态派生子智能体自主完成任务",features:{dynamicSubagents:"动态派生子智能体",autonomousPlanning:"自主规划执行",collaboration:"多智能体协作",summary:"自动汇总结果",skills:"按需调用技能",trace:"任务过程可追踪"}},traditional:{title:"传统模式",description:"高度自定义您的智能体结构",features:{visualConfig:"可视化配置",migration:"存量智能体迁移",debugging:"实时调试",optimization:"可选性能优化",parameters:"精细参数控制"}}},Nce={placeholder:"输入系统提示词;键入 ## 加空格可创建二级标题…",toolbar:{undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",paragraph:"正文",quote:"引用",heading:"标题 {{level}}",selectBlockType:"选择文本类型",blockType:"文本类型",bold:"加粗",removeBold:"取消加粗",italic:"斜体",removeItalic:"取消斜体",bulletedList:"无序列表",numberedList:"有序列表"}},jce={local:{duplicatesSkipped:"已跳过重复技能:{{names}}",invalidDrop:"请拖入包含 SKILL.md 的文件夹或一个 .zip 文件",readError:"读取失败:{{detail}}",dropLabel:"拖入文件夹或 ZIP,自动识别 Skill",hint:"每个技能需包含 SKILL.md。支持包含多个技能的目录。",reading:"正在读取文件…",fileCount:"本地 · {{count}} 个文件"},hub:{searchError:"搜索失败,请稍后重试。",searchPlaceholder:"搜索火山 Find Skill 技能广场,例如 数据分析、PDF…",search:"搜索",searching:"正在搜索…",noResults:"没有找到匹配的技能,换个关键词试试。",hint:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"},space:{loadError:"加载失败",loadingSpaces:"正在加载 AgentKit Skills 中心…",noSpaces:"此账号下没有 AgentKit Skills 中心。",selectSpace:"选择 AgentKit Skills 中心",openConsole:"在火山引擎控制台打开",loadingSkills:"正在加载技能列表…",noSkills:"此 AgentKit Skills 中心暂无技能。"}},Rce={unnamedNode:"未命名节点",editInstruction:"点击编辑指令…",controls:{ariaLabel:"工作流画布控制",zoomIn:"放大",zoomOut:"缩小",fitView:"适应视图"},sections:{info:"工作流信息",execution:"执行方式",nodes:"节点",nodeConfig:"节点配置"},types:{sequential:{label:"顺序",description:"节点依次执行"},parallel:{label:"并行",description:"节点同时执行"},loop:{label:"循环",description:"节点循环执行"}},placeholders:{description:"这个工作流做什么…",agentDescription:"这个 Agent 做什么…",instruction:"你是一个…"},errors:{workflowNameUnique:"名称须与 Agent 节点名称保持唯一",agentNameUnique:"Agent 名称在当前工作流中必须唯一"},dragHint:"拖拽到画布,或点击下方按钮添加",agentNode:"Agent 节点",addNode:"添加节点",connectHint:"拖拽节点的圆点连线以表达执行顺序。",create:"创建工作流",deleteNode:"删除节点",nameHelp:"仅使用英文字母、数字和下划线,且名称保持唯一。",instruction:"指令 (instruction)",tools:"工具 (逗号分隔)",nodeId:"节点 ID",empty:{selectNode:"选择一个节点以编辑其配置",summary:"共 {{nodes}} 个节点 · {{edges}} 条连线"}},Ice={ariaLabel:"快速模式创建",progress:"快速模式创建进度",steps:{agent:{label:"智能体",title:"基本信息",description:"设置智能体的名称、用途、行为方式与能力"},environment:{label:"执行环境",title:"配置执行环境",description:"选择默认环境或已构建的自定义环境"},deployment:{label:"部署偏好",title:"部署偏好",description:"定义 AgentKit 云上参数"}},model:{label:"模型",source:"模型来源",name:"模型名称",provider:"服务商 Provider",volcengineArk:"火山方舟",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",currentApiKey:"当前 API Key",loadingApiKeys:"正在加载 API Key",selectApiKey:"选择 API Key",searchApiKeys:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",loadingModels:"正在加载模型",selectModel:"选择模型",searchModels:"搜索名称、Model ID 或服务商",noModels:"没有可用的模型",apiKeyPlaceholder:"请输入模型 API Key",credentialsLoadError:"模型凭据加载失败",modelsLoadError:"模型列表加载失败"},identity:{unnamedPool:"未命名用户池",currentPool:"{{value}}(当前用户池)",userPool:"用户池",loading:"正在加载用户池",placeholder:"请选择用户池",search:"搜索用户池",empty:"当前账号下暂无 Identity 用户池",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime",selectionHint:"当前 Studio 使用的用户池已在列表中标注"},agent:{namePlaceholder:"输入智能体名称",descriptionPlaceholder:"说明这个智能体可以做什么",prompt:"提示词",promptPlaceholder:"定义角色、目标和行为边界",skills:"技能",addSkill:"添加技能"},validation:{descriptionRequired:"请输入描述",promptRequired:"请输入提示词",modelRequired:"请选择模型",instanceIntegers:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数",instanceOrder:"最小实例数不能大于最大实例数",userPoolRequired:"请选择用于 Runtime 鉴权的用户池"},deployment:{runtimeName:"Runtime 名称",runtimeNameUpdateHint:"更新时保持现有 Runtime 名称不变",runtimeNameHint:"仅支持英文字母、数字、下划线和连字符",region:"发布区域",authentication:"鉴权方式",apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPoolDescription:"使用 Identity 用户池签发的 JWT",sessionStorage:"会话存储",inMemoryStorage:"In-memory 临时存储",backends:{sqlite:"SQLite 文件",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",inMemoryHint:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",networkMode:"网络模式",network:{public:"公网",private:"私网",both:"公网与私网"},subnetIds:"子网 ID(可选,多个用逗号分隔)",sharedInternet:"VPC 内共享公网出口",sharedInternetHint:"允许私网 Runtime 通过共享出口访问公网",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",evaluationSetsHint:"部署成功后自动创建 Good Case 和 Bad Case 评测集",resources:"资源配置",complete:"部署已完成",preparing:"正在准备部署…"},environmentVariables:{title:"环境变量",add:"添加变量",nameAriaLabel:"环境变量名称",valueAriaLabel:"{{name}} 的值",deleteNamed:"删除 {{name}}"},actions:{updateAgain:"再次更新",deployAgain:"重新部署",updateAndPublish:"更新并发布"}},Pce={actions:{addSubagent:"添加子 Agent",clearRoot:"清空根 Agent",clearRootConfirmation:"清空根 Agent 的全部配置和子 Agent?此操作无法撤销。"},workspace:{progress:"Agent 创建进度",modes:{build:"架构",validate:"调试",optimize:"优化",environment:"环境",publish:"发布"},titles:{build:"个性化您的智能体架构",validate:"调试您的智能体",optimize:"为您的智能体选择优化项",environment:"配置云上环境",publish:"准备好部署您的智能体"}},sections:{type:{label:"Agent 类型",hint:"选择 Agent 类型"},basic:{label:"基本信息",hint:"名称、描述与系统提示词"},model:{label:"模型配置",hint:"模型与服务(可选)"},tools:{label:"工具",hint:"可调用的能力"},skills:{label:"技能",hint:"声明式技能"},knowledge:{label:"知识库",hint:"外部知识检索"},memory:{label:"记忆",hint:"短期与长期记忆"},subagents:{label:"子 Agent",hint:"嵌套协作"},review:{label:"完成",hint:"预览并创建"}},agentTypes:{ariaLabel:"Agent 类型",remoteChildOnly:"远程智能体只能作为子步骤使用",llm:{label:"智能体",fullLabel:"LLM 智能体",description:"大模型驱动,自主完成任务"},sequential:{label:"分步协作",fullLabel:"顺序型智能体",description:"子 Agent 按顺序依次执行"},parallel:{label:"同时处理",fullLabel:"并行型智能体",description:"子 Agent 并行执行后汇总"},loop:{label:"循环执行",fullLabel:"循环型智能体",description:"子 Agent 循环执行到满足条件"},a2a:{label:"远程智能体",fullLabel:"远程 Agent",description:"通过 A2A 协议调用远程 Agent"}},basic:{agentName:"Agent 名称",name:"名称",agentDescription:"智能体描述",descriptionPlaceholder:"简要描述这个 Agent 的用途,便于团队识别…",nameHelp:"遵循 Google ADK 命名规则,且在执行流程中保持唯一。",rootDescriptionHelp:"完整描述会保留;部署时会自动整理为符合 Runtime 规范的单行描述。",descriptionHelp:"描述会显示在 Agent 列表与选择器中。",orchestratorHelp:"这是一个协作容器,本身不生成回答。请在左侧画布中添加任务步骤,并通过拖拽调整它们的位置。",maxIterations:"最大轮次",maxIterationsHelp:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。",agentCenter:"AgentKit 智能体中心",agentCenterHelp:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。系统会根据每轮任务动态发现并挂载匹配的 Agent。",moreOptions:"更多选项",systemPrompt:"系统提示词",loadingMarkdown:"正在加载 Markdown 编辑器…",markdownHelp:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。",unnamed:"未命名",unnamedAgent:"未命名智能体"},validation:{remoteRoot:"远程 Agent 只能作为子 Agent",missingRegistry:"请选择 AgentKit 智能体中心",name:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},duplicateName:"Agent 名称在当前结构中必须唯一",missingDescription:"描述为必填项",mcpAuthRequired:"MCP 地址变化后需要确认认证方式",mcpDuplicateName:"MCP 名称重复,请为每个服务使用唯一名称",mcpDuplicateUrl:"MCP 地址重复,请删除重复服务后再发布",missingSubagent:"缺少子 Agent",missingPrompt:"系统提示词为必填项",missingSubagentDetail:"{{type}}至少需要添加一个子 Agent 后才能调试或发布。",problem:"{{name}}:{{problem}}"},ai:{ariaLabel:"AI 自动填写 Agent 配置",minimumLength:"请至少输入 {{count}} 个字符。",replaceConfirmation:"生成的新配置会替换当前画布和属性,确定继续吗?",placeholder:"描述目标,使用 {{model}} 模型一键生成配置",generate:"智能生成",generating:"正在智能生成",success:"生成成功",regenerate:"重新生成",failed:"智能生成失败"},debug:{ariaLabel:"智能体调试工作区",unavailable:"当前后端暂不支持生成 Agent 调试运行。",baseline:"基准组",comparison:"对照组 {{count}}",selectModel:"请选择模型",enterDescription:"请输入描述",enterPrompt:"请输入系统提示词",duplicateConfiguration:"测试配置不能重复",starting:"启动中…",applyAndRestart:"应用并重启",restart:"重新启动",start:"启动环境",defaultModel:"默认模型",testConfiguration:"测试配置",deleteVariant:"删除 {{name}}",deleteVariantGroup:"删除对照组",creatingEnvironment:"正在创建测试环境…",configurationChanged:"配置已变更,请重新启动环境。",ready:"环境已就绪",readyHint:"发送消息以比较智能体回复。",startHint:"先完善配置,再启动环境。",viewTraceNamed:"查看 {{name}} 的调用链路",traceUnavailable:"发送消息后可查看调用链路",trace:"调用链路",useConfiguration:"使用此配置",finishConfiguration:"完成配置",finishAndStart:"完成并启动",currentAgentModel:"当前 Agent 模型",configurationHint:"修改仅用于本次对比,选择使用后才会进入部署流程。",messagePlaceholder:"向已启动的测试环境发送消息…",startOneFirst:"请先启动至少一个测试环境",addVariant:"添加对照组",traceTitle:"调用链路 · {{name}}",leaveTitle:"离开调试?",leaveDescription:"离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。",cleaning:"清理中…",confirmLeave:"确定离开",closeLeaveConfirmation:"关闭离开调试确认"},optimization:{ariaLabel:"智能体优化选项",scenario:"优化场景",components:"优化组件",bytePlusUnavailable:"BytePlus 账号暂不支持 Harness Sidecar 优化项。请保持优化项为空后继续部署,普通 BytePlus 智能体不受影响。",releaseScenario:"优化场景:{{profile}}",profiles:{default:{label:"自定义",description:"按需选择组件,不勾选时不启动 Sidecar。"},ops:{label:"运维场景",description:"适用于运维诊断、数据库、日志和监控 MCP。"}},groups:{quality:"提升回答质量",cost:"降低运行成本",stability:"增强运行稳定性"},options:{context_engine:{label:"上下文治理",description:"治理上下文组装、任务锚定和上下文预算。"},compressor:{label:"上下文与结果压缩",description:"压缩长上下文和大型工具结果,降低 Token 成本。"},verifier:{label:"回答校验与修复",description:"校验证据和回答,在失败时执行修复或告警。"},long_run_control:{label:"Goal 任务控制",description:"管理 Goal 任务的进度、续跑和结束条件。"},mcp_resilience:{label:"MCP 稳定性治理",description:"治理连接、超时、空结果、大返回和调用预算;默认包含 SQL 只读保护。"}}},model:{label:"模型",source:"模型来源",volcanoArk:"火山方舟",volcengineArk:"火山方舟",bytePlusModelArk:"BytePlus ModelArk",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",configuration:"模型配置",name:"模型名称",provider:"服务商 Provider",liteLlmProviders:"LiteLLM 支持列表",apiKeyPlaceholder:"请输入模型 API Key",available:"已开通",retiring:"即将下线",notActivated:"未开通",unavailable:"暂不可用",apiKeyLoadError:"加载 Ark API Key 失败",loadingApiKeys:"正在加载 API Key…",selectApiKey:"选择 API Key",currentApiKey:"当前 API Key",apiKeyList:"API Key 列表",searchApiKey:"搜索 API Key",searchApiKeyName:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",noMatchingApiKey:"没有匹配的 API Key",loading:"正在加载模型…",loaded:"已加载 {{count}} 个模型",loadError:"加载模型失败",selectModel:"选择模型",selectProviderModel:"选择服务商模型",providerModels:"服务商模型",search:"搜索模型",searchPlaceholder:"搜索名称、Model ID 或服务商",noMatches:"没有匹配的模型",empty:"暂无可用模型",unknownStatus:"未知状态",refresh:"刷新",refreshing:"刷新中…",activate:"开通",activateAction:"前往开通",currentConfiguration:"当前配置"},tools:{builtIn:"内置工具",builtInHelp:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。",codeExecution:"代码执行配置",codeExecutionHelp:"指定 AgentKit 代码执行沙箱。",mcp:"MCP 工具"},catalog:{web_search:{label:"联网搜索",description:"火山引擎 Web Search,获取实时信息。"},parallel_web_search:{label:"并行联网搜索",description:"并行发起多条搜索查询,更快汇总。"},link_reader:{label:"网页读取",description:"抓取并阅读给定链接的正文内容。"},web_scraper:{label:"网页爬取",description:"结构化爬取网页(需要 Scraper 服务)。"},image_generate:{label:"图像生成",description:"文生图(Doubao Seedream)。"},image_edit:{label:"图像编辑",description:"图生图 / 编辑(Doubao SeedEdit)。"},video_generate:{label:"视频生成",description:"文/图生视频(Doubao Seedance),含任务查询。"},text_to_speech:{label:"语音合成 (TTS)",description:"把文本转成语音(火山语音)。"},run_code:{label:"代码执行",description:"在沙箱中执行代码。"},vesearch:{label:"VeSearch 智能搜索",description:"火山 VeSearch(需要 bot 端点)。"},links:{console:"控制台",documentation:"文档"},env:{modelAgentName:{comment:"模型名称"},embeddingModelName:{comment:"向量化模型(记忆/知识库需要)"},vikingMemoryProject:{comment:"VikingDB 记忆库项目"},vikingMemoryRegion:{comment:"VikingDB 记忆库地域"},vikingMemoryType:{comment:"记忆类型"},feishuAppId:{comment:"飞书应用 App ID"},feishuAppSecret:{comment:"飞书应用 App Secret",placeholder:"输入 App Secret"},registrySpaceId:{comment:"AgentKit 智能体中心",placeholder:"请选择智能体中心"},registryTopK:{comment:"召回 Agent 数量"},registryRegion:{comment:"AgentKit 智能体中心地域"},registryEndpoint:{comment:"AgentKit 智能体中心 OpenAPI 地址"},agentKitToolId:{comment:"代码执行沙箱 ID"},agentKitToolRegion:{comment:"AgentKit Tools 地域"},openVikingUrl:{comment:"OpenViking 服务地址"},openVikingMemoryUserId:{comment:"记忆归属 ID",help:"对应 viking://user/<此值>/peers/<请求用户>/memories 中的 user 段;用于隔离 Agent、租户或业务场景,默认 default。"},openVikingMemoryPolicy:{comment:"记忆策略",help:"记忆的抽取策略和隔离策略,不填写时使用官方默认策略。"},openVikingKnowledgeUserId:{comment:"知识库归属 ID",help:"未配置资源目录时用于默认路径 viking://user/<此值>/resources/<知识库索引>/,默认 default。"},openVikingTargetUri:{comment:"知识库资源目录",help:"留空时由 KnowledgeBase index 自动生成;填写后直接检索该 OpenViking 资源目录,优先级最高。"},tlsServiceName:{comment:"TLS topic_id,留空自动创建"}}},backends:{shortTerm:{local:{label:"本地内存",description:"进程内,不持久化。适合开发调试。"},sqlite:{label:"SQLite 文件",description:"持久化到本地 .db 文件。"},mysql:{label:"MySQL",description:"持久化到 MySQL。"},postgresql:{label:"PostgreSQL",description:"持久化到 PostgreSQL。"}},longTerm:{local:{label:"本地向量库",description:"进程内 llama-index 向量库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},redis:{label:"Redis",description:"Redis 向量检索。"},viking:{label:"VikingDB Memory",description:"VikingDB 记忆库(支持用户画像)。"},openviking:{label:"OpenViking Memory",description:"OpenViking 长期记忆,按用户维度保存和检索偏好、事件与实体。"},mem0:{label:"Mem0",description:"Mem0 托管记忆服务。"}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB 知识库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},context_search:{label:"Context Search",description:"火山 Context Search 引擎(无需向量化)。"},openviking:{label:"OpenViking Knowledge",description:"OpenViking 资源目录知识库,无需向量化模型配置。"}}},exporters:{apmplus:{label:"APMPlus",description:"火山 APMPlus 应用性能监控。"},cozeloop:{label:"CozeLoop",description:"扣子 CozeLoop 链路观测。"},tls:{label:"TLS (日志服务)",description:"火山 TLS 日志服务导出。"}},knowledge:{title:"知识库",description:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",backend:"知识库后端",vikingDatabase:"VikingDB 知识库"},memory:{shortTerm:"短期记忆",shortTermDescription:"存储单会话上下文",shortTermBackend:"短期记忆后端",longTerm:"长期记忆",longTermDescription:"存储跨会话上下文,通常使用向量化检索",longTermBackend:"长期记忆后端",vikingDatabase:"VikingDB 记忆库",autoSave:"自动保存会话到长期记忆",autoSaveDescription:"会话结束时自动把内容写入长期记忆,无需手动调用。"},mcp:{removeTool:"删除 MCP 工具",namePlaceholder:"名称(可选)",urlPlaceholder:"MCP 服务地址",pathWarning:"此地址未以 /mcp 结尾,请确认它是完整的 MCP 服务地址。",configuredPlaceholder:"已安全保存认证信息",tokenPlaceholder:"Bearer Token(可选)",changedUrlWarning:"MCP 地址已变化,请确认如何处理已保存的认证信息。",reuseCredential:"继续使用",replaceCredential:"替换认证",noAuth:"不使用认证",reuseHint:"发布时将继续使用已保存的认证信息。",changeToReplace:"改为替换",credentialConfigured:"认证信息已由 Studio 安全保存。",removeCredential:"移除认证",commandPlaceholder:"命令,例如 npx",argsPlaceholder:"参数,以空格分隔",stdioHint:"stdio 工具在部署环境中启动,请确保命令和依赖可用。",addTool:"添加 MCP 工具"},resources:{unnamedAgentCenter:"未命名智能体中心",unnamedKnowledgeBase:"未命名知识库",unnamedMemory:"未命名记忆库",loadError:"加载失败",loadingAgentCenters:"正在加载智能体中心…",agentCentersLoaded:"已加载 {{count}} 个智能体中心",noAgentCenters:"暂无智能体中心",noMatchingAgentCenters:"没有匹配的智能体中心",searchAgentKitCenter:"搜索 AgentKit 智能体中心",searchNameOrId:"搜索名称或 ID",selectAgentCenter:"选择智能体中心",selectAgentKitCenter:"选择 AgentKit 智能体中心",selectedAgentCenter:"已选智能体中心",agentKitCenter:"AgentKit 智能体中心",refreshAgentCenters:"刷新智能体中心",knowledgeBaseList:"知识库列表",knowledgeBasePlaceholder:"选择知识库",loadingKnowledgeBases:"正在加载知识库…",knowledgeBasesLoaded:"已加载 {{count}} 个知识库",noKnowledgeBases:"暂无知识库",noMatchingKnowledgeBases:"没有匹配的知识库",searchKnowledgeBase:"搜索知识库",selectKnowledgeBase:"选择知识库",refreshKnowledgeBases:"刷新知识库",memoryList:"记忆库列表",memoryPlaceholder:"选择记忆库",loadingMemories:"正在加载记忆库…",memoriesLoaded:"已加载 {{count}} 个记忆库",noMemories:"暂无记忆库",noMatchingMemories:"没有匹配的记忆库",searchMemory:"搜索记忆库",selectMemory:"选择记忆库",refreshMemories:"刷新记忆库"},env:{noAdditionalParameters:"此后端无需额外运行参数。",invalidJson:"请输入有效的 JSON。",helpAriaLabel:"{{label}}说明:{{help}}",openOpenViking:"打开 OpenViking {{label}}",valuePlaceholder:"请输入参数值",openVikingIndex:"OpenViking 资源索引",openVikingIndexHelp:"默认值:留空;生成项目时使用 Agent 名自动生成,例如 my_agent_kb。未配置 DATABASE_OPENVIKING_TARGET_URI 时,默认 URI 拼接为 viking://user/{知识库归属 ID,未填则 default}/resources/{资源索引}/;如果填写了 DATABASE_OPENVIKING_TARGET_URI,则直接使用该完整 URI。",openVikingIndexAriaLabel:"OpenViking 资源索引说明:{{help}}"},deployment:{vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",apiKeyRequired:"请先选择模型使用的 API Key。",invalidEnvName:"环境变量名称不合法:{{key}}",requiredEnv:"{{name}}:请填写必填环境变量",generatingConfiguration:"正在生成部署配置",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",preparing:"准备部署",complete:"部署完成",failed:"部署失败",updateAndPublish:"更新并发布",stages:{build:"构建镜像",deploy:"部署 Runtime",publish:"发布服务",running:"部署中"}},publish:{generating:"正在生成发布配置",validating:"校验 Agent 结构并准备部署快照…"}},Dce={presets:{support:{name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",subagents:{}},analyst:{name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",subagents:{}},translator:{name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",subagents:{}},coder:{name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",subagents:{}},researcher:{name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",subagents:{}},"research-team":{name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",subagents:{0:{name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。"},1:{name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。"},2:{name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"}}}},tags:{tools:"工具",memory:"记忆",knowledgeBase:"知识库",tracing:"观测",subagents:"子 Agent {{count}}"},gallery:{title:"从模板新建",subtitle:"选择一个预制 Agent 模板,按需微调后即可创建。"},detail:{back:"返回模板列表",name:"名称",systemPrompt:"系统提示词",model:"模型",tools:"工具",memory:"记忆",knowledgeBase:"知识库",tracing:"观测追踪",subagents:"子 Agent({{count}})",create:"使用此模板创建",shortTermMemory:"短期",longTermMemory:"长期"}},Mce={common:vce,yaml:xce,validation:wce,defaults:Oce,helpers:Sce,intelligentDeployment:kce,codePackage:Ece,buildCanvas:Cce,intelligent:Tce,projectLibrary:Ace,modePicker:_ce,promptEditor:Nce,skills:jce,workflow:Rce,workbench:Ice,traditional:Pce,template:Dce},hMe=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:Cce,codePackage:Ece,common:vce,default:Mce,defaults:Oce,helpers:Sce,intelligent:Tce,intelligentDeployment:kce,modePicker:_ce,projectLibrary:Ace,promptEditor:Nce,skills:jce,template:Dce,traditional:Pce,validation:wce,workbench:Ice,workflow:Rce,yaml:xce},Symbol.toStringTag,{value:"Module"})),Lce={backToList:"返回定时任务列表",cancel:"取消",cancelQueue:"取消排队",cancelQueueFirst:"请先取消排队",cancelling:"取消中…",closeDrawer:"关闭抽屉",collapse:"收起",connectingRuntime:"正在连接 Runtime…",createScheduledTask:"创建定时任务",createTask:"创建任务",delete:"删除",deleteTask:"删除任务",edit:"编辑",enable:"启用",expand:"展开",pause:"暂停",refresh:"刷新",refreshHistory:"刷新执行历史",rerun:"重新执行",retry:"重试",runNow:"立即执行",saveChanges:"保存更改",saving:"保存中…",stop:"终止执行",stopRun:"终止本次执行",stopRunFirst:"请先终止当前执行",stopping:"终止中…",viewDetails:"查看详情"},$ce={cancelDescription:"本次 Session 将被取消,后续计划不会暂停。",cancelTitle:"终止本次执行?",deleteDescription:"“{{name}}”及其全部执行历史将被永久删除。",deleteTitle:"删除定时任务?"},Fce={configuration:"任务配置",nextRun:"下次执行",pageLabel:"定时任务详情",region:"地域",runtime:"运行时",status:"任务状态"},Bce={createTitle:"创建定时任务",description:"每次触发都会为 Runtime Agent 创建独立 Session。",editTitle:"编辑定时任务"},Uce={minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",seconds:"{{count}} 秒"},Qce={cronExpression:"Cron 表达式",cronHelp:"依次填写分钟、小时、日期、月份、星期。",dailyTime:"每天执行时间",enableAfterCreate:"创建后启用",enableHelp:"启用后会从下一个计划时间开始执行。",name:"任务名称",namePlaceholder:"例如:每日生成运营摘要",noRuntime:"暂无可用 Runtime",prompt:"执行文本",promptPlaceholder:"输入每次执行时发送给 Agent 的固定文本",runAt:"执行时间",runtimeAgent:"运行时智能体",runtimeHelp:"任务始终跟随该 Runtime 当前生效版本。",runtimePlaceholder:"选择 Runtime Agent",schedule:"执行计划",scheduleType:"执行计划类型",timezone:"时区",weekday:"星期"},zce={all:"全部"},Vce={description:"每次运行均使用独立 Session,结果与错误会永久保留。",duration:"耗时 {{duration}}",emptyDescription:"任务触发或立即执行后,记录会显示在这里。",emptyTitle:"暂无执行记录",errorDetails:"错误详情",finalAnswer:"最终回答",loadFailed:"无法加载执行历史",loadFailedDescription:"请检查 Studio 服务后重试。",session:"会话",title:"执行历史"},Hce={cancelRequested:"已提交终止请求。",created:"任务已创建。",deleted:"任务及其执行历史已删除。",enabled:"任务已启用。",paused:"任务已暂停。",queued:"任务已排队,将在一分钟内开始执行。",requeued:"任务已重新排队,将在一分钟内开始执行。",updated:"任务已更新。"},qce={filterLabel:"定时任务状态筛选",listLabel:"定时任务列表",loadFailed:"无法加载定时任务",loadFailedDescription:"请检查 Studio 服务后重试。",title:"定时任务"},Wce={cron:"Cron {{cron}}{{zone}}",daily:"每天 {{time}}{{zone}}",once:"一次 · {{date}}{{zone}}",weekly:"{{weekday}} {{time}}{{zone}}"},Gce={daily:"每天",once:"一次性",weekly:"每周"},Kce={cancelled:"已取消",enabled:"已启用",failed:"失败",notRun:"尚未执行",paused:"已暂停",pending:"准备中",queued:"已排队",retrying:"自动重试中",running:"执行中",skipped:"已跳过",success:"成功"},Xce={cronFields:"Cron 表达式需要包含 5 个字段,例如 0 9 * * *。",nameRequired:"请输入任务名称。",promptRequired:"请输入每次执行时发送给 Agent 的文本。",runtimeAppMissing:"Runtime Agent 未返回可调用的 appName,请确认 Runtime 已就绪且版本兼容。",runtimeRequired:"请选择可用的 Runtime Agent。",timeRequired:"请选择执行时间。"},Yce={friday:"周五",monday:"周一",saturday:"周六",sunday:"周日",thursday:"周四",tuesday:"周二",wednesday:"周三"},pMe={actions:Lce,confirm:$ce,detail:Fce,drawer:Bce,duration:Uce,fields:Qce,filters:zce,history:Vce,notices:Hce,page:qce,schedule:Wce,scheduleTypes:Gce,status:Kce,validation:Xce,weekdays:Yce},mMe=Object.freeze(Object.defineProperty({__proto__:null,actions:Lce,confirm:$ce,default:pMe,detail:Fce,drawer:Bce,duration:Uce,fields:Qce,filters:zce,history:Vce,notices:Hce,page:qce,schedule:Wce,scheduleTypes:Gce,status:Kce,validation:Xce,weekdays:Yce},Symbol.toStringTag,{value:"Module"})),Zce="问题反馈",Jce="问题描述",eue="常见问题",tue="取消",nue="完成",iue="提交反馈",rue="正在上报…",sue={title:"上报成功,感谢您的反馈",description:"AgentKit 团队会尽快查看您提交的问题。"},aue={close:"关闭问题反馈",intro:"请选择遇到的问题,也可以补充具体表现。",privacy:"您的对话数据将会上报到 AgentKit 团队,请注意隐私保护。",descriptionPlaceholder:"请描述问题发生时的表现(选填)",issues:{slow:"执行速度慢",crash:"运行崩溃",incorrect:"结果不准确",tool_error:"工具调用失败",other:"其他问题"}},oue={description:"告诉我们您在使用 AgentKit Studio 时遇到的问题。",module:"所属模块",modules:{conversation:"对话",agents:"智能体",applications:"自动化",search:"搜索",other:"其他"},commonIssuesMultiple:"常见问题(可多选)",issueTypes:"问题类型",issues:{page_slow:"页面加载慢",feature_unavailable:"功能无法使用",display_error:"页面显示异常",no_response:"操作无响应",other:"其他问题"},descriptionPlaceholder:"请描述问题发生时的页面、操作和表现",quickAdd:"快捷补充",suggestionsLabel:"问题描述推荐",suggestions:{noResponse:"点击后没有反应",loading:"页面一直处于加载状态",incomplete:"部分内容显示不完整",error:"操作后出现错误提示"},privacy:"您的数据将会上报到 AgentKit 团队,请注意隐私保护。"},gMe={title:Zce,descriptionLabel:Jce,commonIssues:eue,cancel:tue,done:nue,submit:iue,submitting:rue,success:sue,dialog:aue,page:oue},bMe=Object.freeze(Object.defineProperty({__proto__:null,cancel:tue,commonIssues:eue,default:gMe,descriptionLabel:Jce,dialog:aue,done:nue,page:oue,submit:iue,submitting:rue,success:sue,title:Zce},Symbol.toStringTag,{value:"Module"})),lue={back:"返回",close:"关闭"},cue={title:"优化迁移项目",closeAria:"关闭优化窗口"},uue={title:"已迁移项目",description:"管理迁移后的源码版本,也可以选择任一版本继续优化。",libraryTitle:"项目与版本",libraryDescription:"查看、下载、部署或对比源码版本,也可以基于任一版本继续优化。",emptyTitle:"还没有已迁移的项目",emptyDescription:"迁移完成后,源码会自动保存在这里。"},due={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any(通用迁移)"},fue={awaitingUpload:"待上传",analyzing:"分析中",needsInput:"待补充",analysisReady:"待确认",migrating:"迁移中",validating:"校验中",packaging:"打包中",succeeded:"已完成",succeededWithWarnings:"已完成,有提示",partial:"部分完成",failed:"失败",cancelled:"已终止",expired:"已过期"},hue={partialReady:"迁移产物已生成,但交付不完整,请查看迁移提示。",readyWithWarnings:"迁移产物已生成,请查看迁移提示。",ready:"迁移产物已生成。"},pue={passed:"产物校验通过",failed:"产物校验未通过",degraded:"产物校验未完成"},mue={session:"创建迁移环境",upload:"上传项目",analysis:"分析项目"},gue={agentNameRequired:"请输入 Agent 名称",agentNameInvalid:"Agent 名称必须为 1-63 位,只能包含小写字母、数字和连字符,且必须以字母或数字开头和结尾"},bue={seconds:"{{seconds}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},yue={savedUnaffected:"已保存项目不受影响",savingUnaffected:"源码正在保存,完成后不受环境期限影响",activeDetail:"到期后任务记录和临时产物将无法访问",oneHour:"临时迁移环境保留 1 小时",ended:"临时迁移环境已结束",savedAvailable:"已保存项目仍可查看、下载、部署或优化",unavailable:"任务记录和临时产物已无法访问",countdown:"临时迁移环境将在 {{minutes}} 分 {{seconds}} 秒后结束",expiredSavedMessage:"临时迁移环境已结束,已保存项目不受影响。",expiredMessage:"临时迁移环境已结束,任务记录和临时产物无法继续访问。"},vue={recommended:"建议迁移方式",scope:"迁移范围",excluded:"不在本次范围",viewEvidence:"查看分析证据",viewAssumptions:"查看关键假设",viewSourceEvidence:"查看源码证据"},xue={ariaLabel:"Codex 执行动态",title:"Codex 执行动态",startingAnalysis:"Codex 正在开始分析…",startingMigration:"Codex 正在开始迁移…",loadError:"暂时无法读取 Codex 执行动态,不影响当前任务。"},wue={title:"迁移产物",fileTooLarge:"该文件超过 2 MiB,请下载完整产物后查看。",unsupportedPreview:"该文件不支持在线预览,请下载完整产物后查看。",filesAria:"迁移产物文件",searchAria:"搜索产物文件",searchPlaceholder:"搜索文件",limit:"仅展示前 {{count}} 项,请搜索具体文件。",noSelection:"未选择文件",noPreview:"暂无可预览文件。",loadingFile:"正在读取产物文件…",startupFile:"启动文件",fileCountLabel:"文件数",saved:"源码已保存,可继续查看、下载、部署或优化。",saving:"产物已生成,正在保存源码版本。",deployReady:"产物可预览、下载和部署,正在等待源码保存状态。",deployUnavailable:"产物可预览和下载,但当前交付状态不支持部署。",viewProjects:"查看已迁移项目",downloading:"下载中…",downloadZip:"下载 ZIP",deployTitle:"部署迁移产物",deployUnavailableTitle:"当前交付状态不支持部署",deployRuntime:"部署到 Runtime",fileCount:"{{count}} 个文件",startup:"启动文件 {{module}}",loading:"正在读取迁移产物…"},Oue={retiring:"即将下线",currentDefault:"当前默认模型",loadError:"加载模型列表失败",label:"模型",placeholder:"选择模型"},Sue={zipOnly:"请选择 .zip 格式的本地项目文件。",invalidName:"ZIP 文件名无效,请重命名后重新选择。",tooLarge:"项目 ZIP 不能超过 {{size}}。",empty:"项目 ZIP 不能为空。",removeAria:"移除项目 ZIP",reselectPrompt:"重新选择项目 ZIP",selectPrompt:"选择或拖入本地项目 ZIP",reselect:"重新选择",selectZip:"选择 ZIP",continue:"继续上传",start:"开始迁移",inputAria:"选择本地项目 ZIP",retention:"临时迁移环境从创建完成起保留 1 小时;保存成功的源码版本不受影响。"},kue={requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}",notReady:"迁移产物尚未准备完成。",back:"返回迁移结果"},Eue={backToAddAgent:"返回添加 Agent",title:"从存量迁移",newMigration:"新建迁移",recent:"最近迁移",sessionsAria:"迁移会话",loadingSessions:"正在读取迁移会话…",noSessions:"暂无迁移会话",heading:"迁移存量 Agent 项目",intro:"上传本地项目 ZIP,Codex 将先进行只读分析,再由你确认迁移方式。"},Cue={stop:"终止迁移",stopping:"正在终止…",reload:"重新读取",refreshStatus:"刷新状态"},Tue={unavailable:"迁移能力暂不可用",defaultReason:"Dev Sandbox 暂不可用,请联系管理员检查配置。"},Aue={requestZip:"请提供本地项目 ZIP。上传后我会识别框架、入口和迁移边界,并在执行实际迁移前请你确认迁移方式。",zipHint:"仅支持本地 ZIP,最大 {{size}};迁移环境从创建起保留 1 小时。",creatingSandbox:"正在创建 Dev Sandbox",initializing:"正在初始化迁移工作目录,并检查 AgentKit CLI、Codex 和迁移能力。环境就绪后将自动上传项目。",elapsed:"已等待 {{duration}}",uploadThenAnalyze:"ZIP 上传完成后将自动开始只读分析。",analyzing:"Codex 正在识别框架、入口和迁移边界,不会执行实际迁移。",migrationLocked:"迁移执行中不能修改附件或迁移方式。你可以等待当前任务结束,或主动终止。",analysisPaused:"只读分析已暂停。请仅回答下面列出的问题,提交后会在同一迁移环境中重新分析,不会开始实际迁移。",analysisComplete:"只读分析已完成。请检查建议,并确认最终迁移方式。",awaitingUpload:"迁移环境已创建,请重新选择本地 ZIP 继续上传。",expiredTitle:"迁移环境已过期",expiredDescription:"迁移内容和产物已无法预览、下载或部署。如已完成 Runtime 部署,可返回智能体页面继续使用。",unsupportedTitle:"当前 ZIP 暂时无法迁移",unsupportedHint:"请按提示整理项目后,新建迁移并重新上传。",failedTitle:"迁移未完成",cancelled:"当前迁移已终止。你可以新建迁移并重新上传项目。"},_ue={ariaLabel:"补充项目分析信息",title:"补充分析所需信息",description:"附件保持锁定,提交后仅继续只读分析",submitting:"正在继续分析…",submit:"提交并继续分析"},Nue={ariaLabel:"确认迁移方式",title:"确认迁移方式",description:"确认后才会执行实际迁移",framework:"迁移方式",frameworkPlaceholder:"选择迁移方式",agentName:"Agent 名称",entry:"项目入口",entryPlaceholder:"选择项目入口",entryExample:"例如 agent.py:agent",consent:"点击“确认并开始迁移”即确认上述迁移范围、排除项和关键假设。",starting:"正在启动迁移…",start:"确认并开始迁移"},jue={closeAria:"关闭错误提示",loadFailed:"无法读取迁移数据,请重试。",refreshFailed:"无法刷新迁移状态,请重试。"},Rue={title:"终止当前迁移?",description:"终止后,当前分析或迁移进程将停止,已执行的步骤不会继续。"},yMe={common:lue,optimization:cue,projects:uue,framework:due,state:fue,task:hue,verification:pue,transfer:mue,validation:gue,duration:bue,expiry:yue,analysis:vue,activity:xue,artifact:wue,model:Oue,upload:Sue,deployment:kue,workspace:Eue,actions:Cue,capability:Tue,conversation:Aue,questions:_ue,confirmation:Nue,errors:jue,stopDialog:Rue},vMe=Object.freeze(Object.defineProperty({__proto__:null,actions:Cue,activity:xue,analysis:vue,artifact:wue,capability:Tue,common:lue,confirmation:Nue,conversation:Aue,default:yMe,deployment:kue,duration:bue,errors:jue,expiry:yue,framework:due,model:Oue,optimization:cue,projects:uue,questions:_ue,state:fue,stopDialog:Rue,task:hue,transfer:mue,upload:Sue,validation:gue,verification:pue,workspace:Eue},Symbol.toStringTag,{value:"Module"})),Iue={loading:"加载中…",searchLabel:"搜索{{label}}",searchPlaceholder:"搜索{{label}}",retry:"重试",noMatches:"没有匹配项",noOptions:"暂无可选项",selection:"{{label}}:{{value}}"},Pue={badge:"焕然一新",view:"查看新特性",title:"本次更新",defaultNotes:{multiRegion:"多地域智能体:并行加载北京与上海 Runtime,列表下滑即可继续加载。",switchAgent:"会话内切换:在输入框旁选择智能体,并直接开启一段新会话。",visualCanvas:"可视化执行画布:通过横向画布查看多智能体结构,并支持全屏浏览。"}},Due={label:"新会话模式",agent:"智能体",skill:"技能定制",video:"视频创作"},Mue={select:"选择新会话模式",agent:{label:"Agent",description:"与当前选择的 Agent 对话"},builtin:{label:"内置智能体",description:"使用平台提供的智能体"},codex:{label:"Codex 智能体",description:"在沙箱中执行任务"},deepseekHarness:{label:"DeepSeek Harness",description:"打开 DeepSeek Harness 工作区"},arkClaw:"ArkClaw",hermes:"Hermes 智能体",checking:"正在检查配置",notConfigured:"管理员未配置",unavailable:"暂不可用"},Lue={recoveryPaused:"部分历史智能体多次恢复失败,已暂停自动恢复。",restoringHistory:"部分历史智能体正在恢复,恢复后将自动显示。",select:"选择智能体",typesLabel:"智能体类型",listLabel:"{{type}}列表",types:{agent:"智能体",general:"通用智能体",codex:"Codex 智能体",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw 智能体",hermes:"Hermes 智能体"},loading:"正在加载智能体",reload:"重新加载",empty:"暂无{{type}}",emptyLocal:"暂无本地智能体",emptyGeneral:"暂无通用智能体",createHint:"请前往智能体页创建",localHint:"请检查当前 Studio 启动目录",waking:"正在唤醒",opening:"正在打开",connecting:"正在连接",loadingMore:"加载中",loadMore:"加载更多",runtimeTimeout:"加载智能体超时(15 秒),请检查网络或 Runtime 服务后重试",loadGeneral:"加载通用智能体",loadType:"加载 {{type}}",connectGeneral:"连接通用智能体",openLocal:"打开本地智能体",openType:"打开 {{type}}"},$ue={spaceAria:"技能空间",configuration:"技能定制配置",actions:{create:"技能生成",optimize:"技能优化"},selectAction:"选择技能定制方式",actionList:"技能定制方式",style:"风格",selectStyle:"选择风格",model:"模型",selectModel:"选择模型",styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先"},modelLoadFailed:"模型配置加载失败",spaceLoadFailed:"Skill Space 加载失败",skillLoadFailed:"Skill 加载失败",unnamedSpace:"未命名 Skill Space",space:"技能空间",select:"选择 Skill",selectAria:"选择 Skill:{{skill}}",loadingSpaces:"正在加载 Skill Space",reload:"重新加载",emptySpaces:"暂无 Skill Space",skillList:"{{space}} Skill 列表",loadingSkills:"正在加载 Skill",emptySkills:"暂无 Skill"},Fue={modes:{auto:"自动识别",text_to_video:"文生视频",reference_to_video:"参考素材生视频",video_editing:"视频编辑",video_extension:"视频续写",first_last_frame:"首尾帧生成"},taskNames:{auto:"视频生成",text_to_video:"文生视频",reference_to_video:"参考素材生视频",video_editing:"视频编辑",video_extension:"视频续写",first_last_frame:"首尾帧生成"},controls:{label:"视频创作配置",aspectRatio:"比例",selectAspectRatio:"选择比例",resolution:"清晰度",selectResolution:"选择清晰度",duration:"时长",durationShort:"{{count}} 秒",durationAria:"视频时长:{{count}} 秒",lastFrame:"尾帧",lastFrameHelper:"添加视频结束画面",assistImage:"辅助图片",referenceImage:"参考图片",assistImageHelper:"用于补充画面参考",imageHelper:"支持常见图片格式",referenceVideo:"参考视频",videoHelper:"支持常见视频格式",optional:"可选",replace:"更换",add:"添加",upload:"上传{{label}}",replaceFile:"更换{{label}}:{{name}}",removeFile:"移除{{label}} {{name}}",storageUnavailable:"管理员未配置持久化存储",loadingEnhancer:"正在加载增强模型",enhancerHint:"使用 {{model}} 模型进行意图识别和提示词增强",enhancerUnavailable:"增强模型不可用"},task:{title:"视频生成任务",closeAria:"关闭视频生成任务弹窗",progressAria:"视频生成进度",optimizedPrompt:"优化后的提示词",processingAria:"{{task}}处理进度",waitingAria:"{{status}},已等待{{elapsed}}",elapsed:"已等待 {{elapsed}}",previewAria:"生成结果预览",close:"关闭",download:"下载视频",retryOptimization:"重试提示词优化",retryGeneration:"重试视频生成",providerQueued:"等待模型调度",providerRunning:"模型生成中",providerSubmitting:"正在提交任务",queuedHint:"任务已提交,模型开始处理后状态会自动更新",runningHint:"这可能持续数分钟,完成后将在这里显示视频预览",backgroundHint:"可以关闭弹窗,任务会继续在后台运行",successHint:"视频已生成,可预览或下载",activationHint:"请先在模型控制台开通服务,再重试生成",retryHint:"修正问题后可重试当前步骤",steps:{optimizationFailed:"提示词优化失败",optimizationDone:"提示词优化完成",optimizationActive:"提示词优化中",generationDone:"{{task}}已完成",generationFailed:"{{task}}失败",generationQueued:"{{task}}排队中",generationRunning:"{{task}}生成中",generationActive:"{{task}}进行中",generationPending:"等待视频生成",generationComplete:"视频生成完成"},elapsedHours:"{{hours}}小时{{minutes}}分",elapsedMinutes:"{{minutes}}分{{seconds}}秒",elapsedSeconds:"{{seconds}}秒"}},Bue={compactSelect:Iue,featureNotice:Pue,workspace:Due,mode:Mue,agentPicker:Lue,skill:$ue,video:Fue},xMe=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:Lue,compactSelect:Iue,default:Bue,featureNotice:Pue,mode:Mue,skill:$ue,video:Fue,workspace:Due},Symbol.toStringTag,{value:"Module"})),Uue={cancel:"取消",close:"关闭",retry:"重试",tryAgain:"重新尝试",closeDialog:"关闭{{title}}",agentFallback:"{{agent}} 智能体",unknownSource:"未知来源"},Que={terminalTitle:"终端",browserTitle:"沙箱浏览器",terminalSubtitle:"连接当前 AgentKit Session 的交互式终端",browserSubtitle:"在当前 AgentKit Session 中查看与操作浏览器",connecting:"正在连接…",connected:"已连接",notConnected:"尚未连接",opening:"正在打开 {{title}}",connectingSession:"工具正在连接当前 AgentKit Session。",openFailed:"{{title}} 打开失败"},zue={title:"恢复 Codex 对话",subtitle:"选择当前 Sandbox Session 中最近更新的 Thread",loading:"正在读取历史对话",loadFailed:"历史对话读取失败",empty:"暂无可恢复的对话"},Vue={title:"Codex 权限",subtitle:"设置会保存到当前 Sandbox Session,并同步到其中的所有 Thread",sandboxMode:"沙箱模式",approvalPolicy:"审批策略",approvalMethod:"审批方式",networkAccess:"允许网络访问",networkAccessHelp:"控制 workspace-write 与只读模式中的外部网络访问。",fullAccessWarning:"完全访问会关闭文件系统与网络隔离,请只在可信任务中使用。",save:"保存权限",sandboxChoices:{readOnly:{label:"只读",detail:"允许读取文件,不允许写入工作空间。"},workspaceWrite:{label:"工作区写入",detail:"允许在当前工作空间内读取与修改文件。"},fullAccess:{label:"完全访问",detail:"不启用沙箱隔离,适合明确可信的任务。"}},approvalChoices:{untrusted:{label:"仅不可信命令",detail:"只对 Codex 判断为不可信的操作发起审批。"},onRequest:{label:"按需审批",detail:"Codex 可在必要时请求你确认命令或文件修改。"},never:{label:"不审批",detail:"Codex 不会暂停并请求人工批准。"}},reviewerChoices:{user:{label:"由我审批",detail:"审批请求会显示在 Studio 中,由你决定。"},autoReview:{label:"自动审查",detail:"使用 Codex 自动审查流程处理审批请求。"}}},Hue={title:"工作空间",subtitle:"选择当前 Codex Thread 执行命令与修改文件的目录",absolutePath:"绝对路径",browse:"浏览",parent:"上一级",empty:"当前目录没有子目录",locked:"当前对话已经开始,工作空间已锁定。新建 Sandbox 会话后可重新选择。",useDirectory:"使用此目录"},que={fileTitle:"允许修改文件?",commandTitle:"允许执行命令?",subtitle:"Codex 正在等待你的决定",workingDirectory:"执行目录",decline:"拒绝",acceptOnce:"仅本次允许",acceptSession:"本会话允许"},Wue={availableSkills:"可用 Skills",selectModel:"选择模型",commands:"Codex 快捷命令",currentModel:"当前:{{model}}",loadingSkills:"正在发现当前工作区的 Skills…",loadingModels:"正在读取模型…",noSkillMatches:"当前工作区没有匹配的 Skill",noModelMatches:"没有匹配模型,也可以直接输入模型 ID",noCommandMatches:"没有匹配的快捷命令",skillFallback:"加载并执行该 Skill",add:"添加",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",openTerminal:"进入终端",viewBrowser:"查看浏览器",permissions:"Codex 权限",workspaceLocked:"对话已开始,工作空间已锁定",selectWorkspace:"选择工作空间",workspace:"Codex 工作空间",endpointCopied:"Endpoint 已复制",copyEndpoint:"复制 Sandbox Endpoint",continuePlaceholder:"继续说明你想实现或调整的内容",messagePlaceholder:"向 AgentKit 沙箱发送消息,输入 / 查看命令,输入 $ 调用 Skill…",stop:"停止生成",send:"发送"},Gue={defaultName:"我的智能体",namedDefault:"我的 {{agent}}",creatingTitle:"正在创建 {{agent}} 智能体",failedTitle:"启动失败",createTitle:"创建 {{agent}} 智能体",fallbackError:"AgentKit 沙箱初始化失败,请稍后重新尝试。",creatingDescription:"正在创建并等待 {{agent}} 智能体就绪,这通常需要半分钟",name:"智能体名称",storageSize:"存储大小",storageHelp:"数据将持久化保存,可设置 {{min}}–{{max}} GiB。",persistent:"持久化",persistenceUnsupported:"当前环境不支持快照持久化",persistentHelp:"保留智能体数据,后续可继续使用。",temporaryHelp:"智能体将在 8 小时后清空",cancelCreation:"取消创建",confirm:"确认创建",retry:"重新尝试"},Kue={activeAria:"Codex 智能体会话已开启",openAria:"开启 Codex 智能体会话",active:"Codex 智能体会话中",entry:"灵光一现",exit:"退出当前智能体",expired:"已到期",remainingHours:"剩余 {{hours}} 小时 {{minutes}} 分钟",remainingMinutes:"剩余 {{minutes}} 分钟",expiryWarning:"远端开发环境最长保留 8 小时,将于 {{expiry}} 到期({{remaining}});到期后清除对话和文件。",usingAgent:"当前您在使用 {{agent}} 智能体",activityAria:"Sandbox 操作记录",activity:"操作记录",tokenUsageAria:"Codex Token 用量",tokens:"{{label}}:{{value}} tokens",tokenLabels:{total:"总计",input:"输入",cachedInput:"缓存输入",output:"输出",reasoningOutput:"推理输出"}},Xue={back:"返回智能体列表",subtitle:"{{agent}} AgentKit Session 详情",type:"智能体类型",status:"状态",createdBy:"创建人",snapshotStatus:"快照状态",toolType:"工具类型",createdAt:"创建时间",snapshotReason:"快照原因",expiresAt:"过期时间",snapshotId:"快照 ID",sessionId:"会话 ID",sourceSessionId:"来源 Session ID",delete:"删除智能体",waking:"唤醒中…",opening:"打开中…",wake:"唤醒智能体",open:"打开智能体",deleteTitle:"删除智能体?",deleteDescription:"将删除“{{name}}”及其 AgentKit {{resource}},此操作无法撤销。",deleting:"删除中…",confirmDelete:"确认删除"},Yue={back:"返回智能体列表",createdBy:"创建人 {{creator}}",ariaLabel:"智能体工作区",main:"主界面",terminal:"终端",mainTitle:"{{agent}} 主界面",openingTerminal:"正在打开终端…",terminalTitle:"{{agent}} 终端"},Zue={prompt:`使用 AgentKit Studio Plugin 端云接力当前会话、项目和任务。请直接执行,不要让我手动打开终端。 Studio:{{studioUrl}} 配对码:{{pairingCode}}`,installPrompt:`请安装 AgentKit Studio Plugin。请直接执行以下安装命令,不要让我手动打开终端。 安装命令:{{command}}`,title:"接力到云端继续执行",description:"按顺序复制两段提示词,Codex 会通过插件将您的本地任务接力到云端",closeAria:"关闭本地迁移引导",installTitle:"安装插件",installDescription:"首次使用时,请选择一种安装方式。",copied:"已复制",copyInstallPrompt:"复制安装提示词",copyInstallCommand:"复制安装命令",installMethodAria:"插件安装方式",conversationInstall:"与 Codex 对话安装",terminalInstall:"从终端安装",taskTitle:"任务接力",taskDescription:"插件安装完成后复制,Codex 会迁移当前项目并继续执行任务。",copyHandoffPrompt:"复制接力提示词",generatingPairing:"正在生成新的配对码",pairingExpired:"配对码已过期",pairingRemaining:"配对码有效期剩余 {{countdown}}",refreshing:"刷新中",refreshPairing:"刷新配对码",pairingLoading:"正在生成配对码",pairingUnavailable:"配对码尚未生成。",statusAria:"端云接力状态",statusTitle:"接力状态",requestReceivedNamed:"已收到“{{name}}”的端云接力请求",requestReceivedCurrent:"已收到当前项目的端云接力请求",requestHelp:"复制接力提示词后,Codex 的请求会显示在这里。",entering:"正在进入",enterCodex:"进入 Codex",clipboardUnsupported:"当前浏览器不支持写入剪贴板。",steps:{request:"等待端侧请求",session:"创建云端 Session",restore:"恢复项目",continue:"发送续跑任务"},status:{issued:"等待请求",creating:"正在创建 Session",sessionCreated:"正在迁移项目",continuing:"正在启动云端任务",running:"云端执行中",completed:"接力完成",failed:"接力失败"}},Jue={model:{description:"显示或切换当前对话模型",keywords:"模型 switch"},models:{description:"列出 app-server 可用模型",keywords:"模型列表 list"},skill:{description:"浏览并调用当前工作区可用的 Skill",keywords:"技能 workflow"},skills:{description:"浏览并调用当前工作区可用的 Skills",keywords:"技能列表 workflow list"},new:{description:"开始一个新对话",keywords:"新建 对话"},resume:{description:"打开历史会话或恢复指定 Thread",keywords:"历史 恢复 session"},fork:{description:"从当前上下文分叉一个新对话",keywords:"分叉 branch"},compact:{description:"压缩当前对话上下文",keywords:"压缩 上下文"},archive:{description:"归档当前对话并新建对话",keywords:"归档 关闭"},status:{description:"显示当前连接、Thread、模型与 Token 状态",keywords:"状态 连接 token"},clear:{description:"清空当前视图并开始新对话",keywords:"清空 重置"},help:{description:"显示 Sandbox 支持的快捷命令",keywords:"帮助 命令"},currentModel:"当前模型",availableModel:"可用模型",workspace:"工作空间",notSet:"未设置",modelLabel:"模型",statusLabel:"状态",running:"运行中",idle:"空闲",totalTokens:"累计 Token",contextWindow:"上下文窗口",imageFallback:"图片",unknown:"未知快捷命令:{{command}}。输入 /help 查看可用命令。",automaticSkills:"智能开发模式会自动使用开发能力,无需手动选择 Skill。",activity:{new:"已新建 Codex 对话",resumed:"已恢复 Codex 对话",deleted:"已删除 Codex 历史会话",modelChanged:"已切换 Codex 模型",availableModels:"Codex 可用模型",noModels:"当前没有可用模型",forked:"已分叉 Codex 对话",compacting:"已开始压缩当前 Codex 对话",archived:"已归档 Codex 对话",status:"Codex 当前状态",help:"Sandbox 支持的 Codex 快捷命令"}},ede={common:Uue,tool:Que,threads:zue,permissions:Vue,workspace:Hue,approval:que,composer:Wue,launch:Gue,session:Kue,agentDetails:Xue,agentWorkspace:Yue,handoff:Zue,commands:Jue},wMe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:Xue,agentWorkspace:Yue,approval:que,commands:Jue,common:Uue,composer:Wue,default:ede,handoff:Zue,launch:Gue,permissions:Vue,session:Kue,threads:zue,tool:Que,workspace:Hue},Symbol.toStringTag,{value:"Module"})),tde={retry:"重试",signInToContinue:"登录以继续使用",signInWith:"使用 {{provider}} 登录",enterUsername:"输入一个用户名即可开始",usernamePlaceholder:"用户名(字母 + 数字,最多 16 位)",enter:"进入",usernameInvalid:"只能包含大小写字母和数字,最多 16 位。",identityProvider:{volcengine:"火山引擎 Identity",byteplus:"BytePlus Identity"},powered:{volcengine:"火山引擎 AgentKit 提供企业级 Agent 解决方案",byteplus:"BytePlus AgentKit 提供企业级 Agent 解决方案"},legalPrefix:"继续即表示你已阅读并同意 AgentKit",terms:"产品和服务条款",copyright:"© {{year}} VeADK。保留所有权利。"},nde={title:"登录状态已过期",description:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。",waiting:"等待登录完成…",signInAgain:"重新登录"},ide={breadcrumbs:"面包屑",selectAgent:"选择 Agent",switchAgent:"切换智能体"},rde={cancel:"取消",close:"关闭确认框"},OMe={login:tde,authExpired:nde,navbar:ide,confirm:rde},SMe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:nde,confirm:rde,default:OMe,login:tde,navbar:ide},Symbol.toStringTag,{value:"Module"})),sde={defaultUser:"用户",shortcuts:"快捷入口",tryCli:"体验 AgentKit CLI",developerResources:"开发者资源",systemInfo:"系统信息",language:"语言",issueFeedback:"问题反馈",logout:"退出登录",roles:{admin:"管理员",developer:"开发者",user:"普通用户"}},ade={home:"返回首页",expand:"展开侧边栏",collapse:"收起侧边栏",label:"主导航",newChat:"新会话",agents:"智能体",workspaces:"工作区",library:"资源库",cronjobs:"定时任务",automations:"自动化"},ode={title:"历史会话",newConversation:"新会话",create:"新建会话",loading:"正在加载历史会话…",empty:"暂无会话",current:"当前",manage:"管理历史会话:{{title}}",more:"更多",delete:"删除",loadingMore:"加载中…",loadMore:"加载更多",evaluatingTitle:"正在自动评测",evaluating:"评测中",generating:"正在生成"},kMe={account:sde,navigation:ade,history:ode},EMe=Object.freeze(Object.defineProperty({__proto__:null,account:sde,default:kMe,history:ode,navigation:ade},Symbol.toStringTag,{value:"Module"})),lde={placeholder:"请选择",collapseOptions:"收起模型选项",expandOptions:"展开模型选项",noOptions:"暂无可用选项",noMatches:"没有匹配项,可直接使用当前模型 ID"},cde={unsupportedActivity:"不支持的 Skill 对话活动",ariaLabel:"Skill 生成对话"},ude={code:"错误码:{{code}}",type:"错误类型:{{type}}",representation:"异常表示:{{value}}",rawResponse:`服务端原始响应: -{{value}}`,original:"原始错误:{{message}}",details:"详细信息"},dde={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},fde={close:"关闭",name:"名称",region:"地域",optionalDescription:"描述(可选)",cancel:"取消",create:"创建",creating:"创建中…",save:"保存",saving:"保存中…",upload:"上传",uploading:"上传中…",createSpaceTitle:"新建 Skill 空间",editSpaceTitle:"编辑 Skill 空间",uploadTitle:"上传到 {{name}}",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",archiveValidationFailed:"Skill ZIP 格式校验失败",uploadFailed:"上传 Skill 失败",dropzone:"拖拽 Skill ZIP 到这里",chooseLocalFile:"或点击选择本地文件",archiveHelp:"ZIP 根目录需要包含 SKILL.md,也可以只包含一层包装目录。选择后仅检查格式,不会自动上传。",validating:"正在检查文件格式…",validationPassed:"格式检查通过:{{name}},共 {{count}} 个文件"},hde={styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先",custom:"自定义",customFallback:"自定义风格"},stages:{preparing:"正在准备 Dev Sandbox",ready:"Skill 已生成并通过格式校验",failed:"生成失败",cancelled:"已停止",validating:"正在校验 Skill 格式",packaging:"正在整理文件",generating:"正在生成 Skill",repairingAgain:"正在再次修复",autoRepairing:"正在自动修复({{attempt}}/{{max}})"},validation:{fallback:"Skill 格式校验未通过",repairInstruction:"只修复下面列出的 Skill 格式错误,不要改变原有用途和内容范围。",recheckInstruction:"修复后重新检查目录结构、SKILL.md frontmatter 和所有文本文件。",nameTooLong:"Skill 名称不能超过 64 个字符",invalidName:"Skill 名称只能包含小写字母、数字和连字符",modelTooLong:"模型 ID 不能超过 128 个字符",invalidModel:"模型 ID 只能包含字母、数字、点、下划线、连字符、斜杠和冒号"},errors:{loadCapability:"读取 Dev Sandbox 配置失败",autoRepair:"自动修复格式错误失败",pollCandidate:"读取候选方案状态失败,正在重试",createCandidate:"创建候选方案失败",refine:"继续调整失败",repairAgain:"再次修复格式错误失败",selectSpace:"请选择上传的 Skill Space",unsupportedRegion:"当前 Skill 地域不受支持",upload:"上传 Skill 失败",download:"下载失败"},sessionMax:"Session 最长保留 1 小时",remaining:"剩余 {{minutes}}:{{seconds}}",unnamedSpace:"未命名 Skill Space",leaveConfirmation:"离开后将停止并释放正在运行的 Dev Sandbox,确定离开吗?",createTitle:"创建技能",optimizeTitle:"优化 {{name}}",skillFallback:"技能",back:"返回技能空间",home:"主页技能生成",basicInfo:"基本信息",goal:"目标",createIntentPlaceholder:"描述希望这个 Skill 完成什么任务",optimizeIntentPlaceholder:"描述希望如何优化当前 Skill",skillName:"Skill 名称",autoNamePlaceholder:"留空时自动生成",nameHelp:"仅支持小写字母、数字和连字符;留空时自动生成。",createPlans:"生成方案",optimizePlans:"优化方案",createPlansDescription:"按不同方案并行生成多个技能,您可以选择最佳结果",optimizePlansDescription:"按不同方案并行优化当前技能,您可以选择最佳结果",plan:"方案 {{count}}",remove:"移除",model:"模型",modelPlaceholder:"选择或输入模型 ID",style:"风格",customStyle:"自定义风格",customStylePlaceholder:"描述表达方式、严谨程度或输出偏好",addConfiguration:"添加配置",notConfigured:"管理员未配置",generate:"生成",candidates:"候选方案",progress:"进度",retryCandidate:"重试此方案",formatValidationFailed:"格式校验未通过",repairAgain:"再次修复",files:"文件",downloadZip:"下载 ZIP",loadingFiles:"正在读取文件…",filesPending:"生成过程中会在这里显示完整文件树",uploadToSpace:"上传到 Skill Space",loadingSpaces:"正在加载 Skill Space",selectSpace:"选择 Skill Space",continuePlaceholder:"继续调整这个候选方案",continue:"继续调整",uploading:"上传中…",overwrite:"覆盖原 Skill",uploadToSelectedSpace:"上传到 Skill Space",uploadToCurrentSpace:"上传到当前空间",allCandidatesFailed:"所有方案均创建失败,可分别重试。"},pde={invalidFormat:"{{label}}格式错误。",recoveryStatus:"Skill 恢复点状态",errorResponse:"错误响应",errorDetails:"错误详情",missingContentType:"Content-Type 缺失",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},Content-Type: {{contentType}}),请检查代理或网关配置。",activity:"Skill 会话活动",invalidActivity:"Skill 会话活动格式错误。",invalidToolActivity:"Skill 工具活动格式错误。",invalidTextActivity:"Skill 文本活动格式错误。",publication:"Skill 发布结果",task:"Skill 会话",file:"Skill 文件",unknownTaskState:"Skill 会话状态无法识别。",capability:"Skill 工作台能力",loadCapability:"读取 Skill 工作台能力失败",prepareTask:"准备 Skill 会话失败",taskReference:"Skill 会话引用",startOptimization:"开始优化 Skill 失败",startTask:"开始 Skill 会话失败",taskSummary:"Skill 会话摘要",taskList:"Skill 会话列表",loadTaskList:"读取 Skill 会话列表失败",invalidTaskList:"Skill 会话列表格式错误。",loadTask:"读取 Skill 会话失败",artifact:"Skill 产物",artifactFile:"Skill 产物文件",loadArtifact:"读取 Skill 产物失败",refine:"继续调整 Skill 失败",stop:"停止当前 Skill 任务失败",publish:"发布 Skill 失败",nonNdjson:"发布 Skill 失败:服务端返回了非 NDJSON 响应。",missingStream:"发布 Skill 失败:服务端没有返回进度流。",publishProgress:"发布进度",invalidPublishProgress:"发布进度格式错误。",publishError:"发布错误",unknownPublishEvent:"未知的发布进度事件。",publishResult:"发布结果",streamEnded:"发布进度流提前结束,无法确认发布结果。请刷新技能中心确认状态。",deleteTask:"删除 Skill 会话失败",download:"下载 Skill 失败"},mde={configSelect:lde,conversation:cde,errorDetails:ude,fileTree:dde,management:fde,generation:hde,api:pde},CMe=Object.freeze(Object.defineProperty({__proto__:null,api:pde,configSelect:lde,conversation:cde,default:mde,errorDetails:ude,fileTree:dde,generation:hde,management:fde},Symbol.toStringTag,{value:"Module"})),gde={back:"返回上一页",reload:"重新加载",notConfigured:"未配置",name:"名称",description:"描述",delete:"删除",save:"保存",saving:"保存中",add:"添加",manage:"管理",environment:"环境",noDescription:"暂无描述",refresh:"刷新",close:"关闭",retry:"重试",loading:"加载中…",previousPage:"上一页",nextPage:"下一页",edit:"编辑",all:"全部",search:"搜索",cancel:"取消",view:"查看",viewDetails:"查看详情",deleting:"删除中…",create:"创建",creating:"创建中",adding:"添加中",generating:"生成中",uploading:"上传中",preview:"预览",loadFailed:"加载失败",select:"选择",collapse:"收起",expand:"展开",none:"无"},bde={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},yde={checkUpdates:"检查更新",checkingVersions:"正在检查版本…",versionCheckError:"查询沙箱版本失败,请检查凭据、区域及接口权限后重试",sandboxUpdateError:"Sandbox 更新失败,请刷新检查实际状态后重试",modelEnvRepairUnavailable:"无法补齐模型环境变量,请检查 CODEX_API_KEY 和 CODEX_BASE_URL",updateSandbox:"更新{{variant}}{{name}}",updatingSandbox:"更新中",title:"系统信息",description:"查看当前 Studio 版本及关联的基础资源",general:"通用",currentVersion:"当前版本",storage:"存储",loadingStorage:"正在加载存储信息",tosAddress:"TOS 地址",openTosConsole:"在云控制台中打开 TOS 存储桶",environmentBuild:"环境构建",loadingEnvironmentResources:"正在加载环境构建资源",environmentResourcesError:"环境构建资源加载失败,请检查云凭据后重试。",codePipelineWorkspace:"CodePipeline 工作空间",codePipelinePipeline:"CodePipeline 流水线",openCodePipelineWorkspace:"在云控制台中打开 CodePipeline Workspace",createdOnFirstBuild:"首次构建时自动创建",containerRegistryRepository:"Container Registry 仓库",openContainerRegistryRepository:"在云控制台中打开 Container Registry 仓库",sandboxInfo:"沙箱信息",loadingSandboxInfo:"正在加载沙箱信息",sandboxInfoError:"沙箱信息加载失败,请重试。",snapshot:"快照版",snapshotWithSpace:"快照版 ",openToolConsole:"在云控制台中打开{{name}}",updateModelEnv:"更新{{variant}}{{name}}模型环境变量",modelEnvUpdated:"已更新",modelEnvAlreadyCurrent:"无需更新",userPool:"用户池",loadingUserPool:"正在加载用户池",userPoolError:"用户池加载失败,请重试。",modelEnvUpdateError:"模型环境变量更新失败,请重试。",openUserPoolConsole:"在云控制台中打开用户池{{name}}",unnamedUserPool:"未命名用户池",id:"ID",domain:"域名",region:"区域",noLocalUserPool:"本地模式未配置用户池",noUserPool:"当前 Studio 未配置用户池"},vde={workspace:"Agent 工作区",library:"Agent 库",evaluation:"评测",agentList:"Agent 列表",agentDetails:"Agent 详情",newAgent:"新建 Agent",loading:"加载中…",loadingCloudAgents:"正在加载云端 Agent…",noAgentSelected:"请选择一个 Agent",local:"本地",remote:"云端",localAgent:"本地 Agent",remoteAgent:"云端 Agent",agentCount:"{{count}} 个 Agent",agentCountLabel:"Agent 数量",details:"详情",chat:"对话",update:"更新",backToAgentList:"返回 Agent 列表",loadingAgent:"正在加载 Agent",loadingAgentDescription:"正在读取 Agent 配置和 Runtime 信息。",loadingAgentInfo:"正在加载 Agent 信息…",detailLoadFailed:"无法加载 Agent 详情",detailLoadFailedDescription:"请检查 Runtime 状态后重试。",partialInfoUnavailable:"部分信息暂时不可用",upgradeRuntimeForDetails:"请升级 Runtime 以查看完整 Agent 信息。",basicInfo:"基本信息",usageOverview:"使用概览",sections:{basic:"基本信息",usage:"使用概览",evaluations:"评测",optimizations:"优化建议",integrations:"集成",versions:"版本"},evaluationGroup:"评测组",optimizations:"优化建议",optimizationsDescription:"根据评测结果查看可执行的优化建议。",integrations:"集成",githubVersions:"GitHub 版本",githubVersionsDescription:"查看持续交付产生的版本并创建回退 PR。",currentVersionOnly:"当前未启用 GitHub 持续交付,仅展示当前生产版本。",loadingVersions:"正在加载版本…",noVersion:"暂无版本记录",prLink:"Pull Request",viewPr:"查看 PR",author:"提交人",publishStatus:"发布状态",viewRelease:"查看发布记录",rollbackToVersion:"回退到此版本",rollingBack:"正在创建回退…",rollbackEvent:"回退事件",sourceMergedRuntimeStill:"最新源码已合并,但 Runtime 仍处于",currentProductionVersionHint:";当前生产版本保持不变。",usageSummary:"使用统计",totalCalls:"总调用次数",userCount:"用户数",userDetails:"用户明细",usageUserList:"Agent 使用用户列表",user:"用户",callCount:"调用次数",lastUsed:"最近使用",unknownUser:"未知用户",loadingUsage:"正在加载使用数据…",refreshing:"刷新中…",noUsage:"暂无使用记录",usageUnavailable:"当前 Agent 暂无可用的使用统计。",usagePagination:"使用记录分页",pageOf:"第 {{page}} / {{total}} 页",notProvided:"暂未提供",integrationMethods:"集成方式",integrationDescription:"通过 Runtime API 或 A2A 协议集成当前 Agent。",integrationProtocol:"集成协议",runtimeStatus:"Runtime 状态",executionFlow:"执行流程",probingIntegration:"正在检测集成能力",probingIntegrationDescription:"正在读取可用端点和鉴权配置。",configurationStatus:"配置状态",discoveryEndpoint:"发现端点",invocationEndpoint:"调用端点",invocationUrl:"调用地址",authentication:"鉴权方式",networkAccess:"网络访问",notAvailable:"暂无",noAuthentication:"无需鉴权",noApiKeyRequired:"无需 API Key",usesOauthJwt:"使用 OAuth / JWT",showApiKey:"显示 API Key",hideApiKey:"隐藏 API Key",pythonExample:"Python 示例",deploymentConfig:"部署配置",deploymentConfigDescription:"确认实例和运行配置后更新 Runtime。",deploymentRegion:"部署区域",concurrency:"并发数",selectedOptimizations:"已选优化项",selectedOptimizationsDescription:"这些优化会应用到本次更新。",optimizationProfile:"优化方案",updatePending:"等待更新",updatingDeployment:"正在更新部署",restoringUpdateConfig:"正在恢复更新配置…",updateConfigUnavailable:"无法读取更新配置",legacyConfigMissing:"旧版本 Runtime 缺少可恢复的配置,请重新创建。",deploymentFailed:"部署失败",continueEditing:"继续编辑",loadingOptimizations:"正在加载优化建议…",noOptimizations:"暂无优化建议",fixPriority:"优先级",suggestedModule:"建议模块",suggestionAndReason:"建议与原因",priority:{high:"高",medium:"中",low:"低"},modules:{agentStructure:"Agent 结构",prompt:"提示词",tool:"工具",knowledge:"知识库",memory:"记忆",workflow:"工作流",other:"其他"},evaluationGroupList:"评测组列表",newEvaluationGroup:"新建评测组",newEvaluationGroupName:"新评测组 {{count}}",searchEvaluationGroups:"搜索评测组",noMatchingEvaluationGroups:"没有匹配的评测组",noEvaluationGroupSelected:"请选择一个评测组",groupStats:"{{agents}} 个 Agent · {{runs}} 次运行",evaluationGroupDetails:"评测组详情",evaluationGroupStats:"{{agents}} 个 Agent · {{caseSet}} · {{runs}} 次运行",startEvaluation:"开始评测",evaluationConfig:"评测配置",historyResults:"历史结果",participatingAgents:"参与 Agent",selectedCount:"已选择 {{count}} 个",evaluationResources:"评测资源",evaluationSet:"评测集",evaluator:"评估器",caseCount:"{{count}} 条案例",evaluationMetrics:"评测指标",selectedMetricCount:"已选择 {{count}} 项",historyDescription:"查看每次评测的分数和运行状态。",noHistory:"暂无评测历史",noHistoryDescription:"运行一次评测后,结果会显示在这里。",evaluationRun:"第 {{index}} 次评测",evaluationRunMeta:"{{time}} · {{agents}} 个 Agent",overallScore:"综合分",completed:"已完成",evaluationDefaults:{coreRegression:"核心能力回归",safetyCheck:"安全与幻觉检查",coreSet:"核心回归集",safetySet:"安全边界集",toolSet:"工具调用集",qualityEvaluator:"综合质量评估器",factualEvaluator:"事实一致性评估器",toolEvaluator:"工具调用评估器",responseQuality:"回答质量",factualAccuracy:"事实准确性",toolUse:"工具调用",responseEfficiency:"响应效率",todayTime:"今天 10:32",yesterdayTime:"昨天 16:08",julyTime:"7 月 25 日 14:20",justNow:"刚刚"},defaultCases:{agentName:"示例 Agent",goodSetName:"示例正向案例集",badSetName:"示例负向案例集",weeklyFeedback:{input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",tag:"总结",reason:"任务完整覆盖了用户目标,输出结构清晰,并给出了可执行的下一步动作。"},research:{input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",tag:"工具调用"},uncertainConclusion:{input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",tag:"幻觉",reason:"信息不足时仍给出了确定结论,缺少必要的澄清步骤与不确定性说明。"},repeatedTool:{input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",tag:"效率"}},goodCases:"正向案例",badCases:"负向案例",goodCase:"正向案例",badCase:"负向案例",reference:"参考答案",caseResultFilter:"案例结果筛选",feedbackSourceFilter:"反馈来源筛选",searchCases:"搜索案例",searchCasesPlaceholder:"搜索输入、输出或标签",selectCases:"选择案例",selectAll:"全选",selectAllVisible:"选择当前可见案例",selectedCaseCount:"已选择 {{count}} 条",deleteSelected:"删除所选",deleteSelectedTitle:"删除所选 Agent",deleteSelectionDescription:"确定删除所选的 {{count}} 个项目吗?此操作无法撤销。",deleteCasesConfirm:"删除所选案例",deleteOneCaseConfirm:"删除这个案例",deleteFeedbackCase:"删除反馈案例",noFeedbackCases:"暂无反馈案例",noMatchingCases:"没有匹配的案例",loadingEvaluationSet:"正在加载评测集…",userInput:"用户输入",agentOutput:"Agent 输出",score:"得分",scoreReason:"评分原因",noUserInput:"暂无用户输入",noVisibleResponse:"暂无可见回复",note:"备注:",manualFeedback:"人工反馈",automaticFeedback:"自动反馈",scoreValue:"{{score}} 分",unknownTime:"时间未知",deleteAgentTitle:"删除 Agent",deleteAgentDescription:"确定删除 Agent“{{name}}”吗?",deleteDraftDescription:"确定删除草稿“{{name}}”吗?",deleteAgent:"删除 Agent",closeDeleteConfirmation:"关闭删除确认",draftDeletionWarning:"草稿将从当前浏览器中删除。",runtimeDeletionWarning:"Runtime 和相关云端资源将被删除。",noneSelected:"尚未选择",none:"无",notPublished:"未发布",notRecorded:"未记录",noTime:"暂无时间",noPr:"暂无 PR",comingSoon:"评测能力即将开放",preparing:"准备中",cancelled:"已取消",failed:"失败",totalCount:"共 {{count}} 条",deploymentProgress:"部署进度",returnToEdit:"返回编辑",buildLog:"构建日志",githubMountLog:"GitHub 挂载日志",githubDeliveryMountLog:"GitHub 持续交付挂载日志",waitingBuildLog:"正在等待构建日志…",waitingGithubMountLog:"正在等待 GitHub 挂载日志…",copy:"复制",copied:"已复制",copyLabel:"复制{{label}}",copiedLabel:"已复制{{label}}",logLines:"{{count}} 行",logStatus:{synced:"已同步",failed:"读取失败",syncing:"同步中",earlyOmitted:"已省略早期日志",recentOnly:"仅显示最近的构建日志",partiallyOmitted:"已省略部分日志"},deployStatus:{running:"正在部署",unconfirmed:"部署状态待确认",success:"部署完成",error:"部署失败",cancelled:"部署已取消"},deploymentSteps:{prepare:{label:"准备部署",description:"校验配置并创建部署任务"},build:{label:"构建镜像",description:"生成运行环境与智能体代码"},deploy:{label:"部署服务",description:"创建并启动 AgentKit Runtime"},publish:{label:"发布服务",description:"等待服务就绪并生成访问地址"},complete:{label:"部署完成",description:"智能体已可以正常使用"},evaluation:{label:"创建评测集",description:"自动创建 Good Case 和 Bad Case 评测集"},github:{label:"挂载 GitHub 持续交付",description:"初始化目标分支与 GitHub Actions workflow"},update:{label:"更新实例配置",description:"将 Runtime 实例数调整为 {{min}}~{{max}}"}},githubStatus:{published:"已发布",publishing:"发布中",failed:"发布失败",pending:"等待发布",unknown:"未知"},errors:{agentInfoMissing:"Agent 信息不可用",checkUpdateCapability:"无法检查更新能力",checkingUpdateConfig:"正在检查更新配置",cloudOnlyUpdate:"仅云端 Agent 支持更新",deleteDeployedUnsupported:"当前不支持删除已部署 Agent",deleteDraftUnsupported:"当前不支持删除草稿",loadAgentInfo:"无法加载 Agent 信息",loadApiKey:"无法读取 API Key",loadGithubVersions:"无法加载 GitHub 版本",loadEvaluations:"无法加载评测案例",loadOptimizations:"无法加载优化建议",loadRuntimeDetails:"无法加载 Runtime 详情",loadUsage:"无法加载使用数据",noCreatePermission:"当前账号没有创建 Agent 的权限",noManagePermission:"当前账号没有管理此 Agent 的权限",originalConfigUnavailable:"原始配置不可用",probeIntegration:"无法检测集成能力",rollbackVersion:"无法创建版本回退",runtimeRegionMissing:"Runtime 区域信息缺失",updateCapabilityMismatch:"Runtime 更新能力与当前配置不匹配",updateCapabilityPending:"Runtime 更新能力仍在确认中",updateConfigRestoring:"正在恢复更新配置",updateUnsupported:"当前 Runtime 不支持更新",usageMismatch:"返回的使用数据与当前 Agent 不匹配"}},xde={title:"环境",loadFailed:"环境加载失败,请检查存储配置后重试。",create:"新建环境",configure:"配置环境",details:"环境详情",editorDescription:"配置运行环境,或接入代码仓库和已有镜像",backToList:"返回环境列表",save:"保存环境",createAndBuild:"创建并构建",saveAndBuild:"保存并构建",name:"环境名称",namePlaceholder:"Python 数据处理",descriptionPlaceholder:"说明这个环境适合处理的任务",creationMethod:"创建方式",baseConfiguration:"基础配置",baseEnvironment:"基础环境",operatingSystem:"操作系统",pythonVersion:"Python 版本",fixedByBase:"由 {{base}} 固定为 {{value}}",selectUbuntuVersion:"选择基础镜像的 Ubuntu 版本",selectPythonVersion:"选择需要安装的 Python 版本",skills:"技能",addSkill:"添加环境技能",veadkDescription:"Agent 开发与运行框架",customDockerfile:"自定义 Dockerfile",presetEnvironment:"预制环境",presetHint:"选择“无”可自行填写 Dockerfile 第一行的基础镜像。",dockerfileSize:"{{size}} / {{max}} 字节",upload:"上传",reset:"重置",dockerfileBaseImage:"Dockerfile 基础镜像",dockerfileContent:"Dockerfile 内容",region:"区域",search:"搜索环境",manualImport:"手动导入",noMatches:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称",startBuild:"开始构建",build:"构建",unnamed:"未命名环境",listSeparator:"、",clipboardReadError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",creation:{custom:{label:"自定义配置",description:"通过表单选择基础环境、Python、工具和技能"},dockerfile:{label:"自定义 Dockerfile",description:"上传或直接编辑 Dockerfile"},git:{label:"从代码仓库构建",description:"探查公开仓库并通过 CodePipeline 构建"},image:{label:"使用已有镜像",description:"绑定由外部流水线交付的 CR 镜像"}},baseDescriptions:{"aio-sandbox":"内置 Sandbox Shell 能力 · Ubuntu 22.04","codex-sandbox":"内置 Codex CLI、浏览器与代码执行环境",ubuntu:"标准 Linux 基础镜像"},dockerfileValidation:{baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"},presets:{none:"自行填写 Dockerfile 基础镜像",aio:"内置 Sandbox Shell 与常用运行时",codex:"内置 Codex CLI、浏览器与代码执行环境"},categories:{tools:"工具",productivity:"效率",browser:"浏览器自动化",system:"系统与媒体"},options:{"lark-cli":"飞书开放平台命令行工具",pandoc:"文档格式转换工具",opencli:"将网站与桌面应用转换为命令行工具",uv:"快速 Python 包与项目管理器",ripgrep:"高性能文本检索工具",jq:"JSON 查询与转换工具","github-cli":"在终端中管理 GitHub 工作流",playwright:"浏览器自动化与端到端测试",chromium:"无头浏览器运行时",git:"代码版本管理",curl:"网络请求与文件下载",ffmpeg:"音视频转码与处理",imagemagick:"图片转换与批处理"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",hoursMinutes:"{{hours}} 小时 {{minutes}} 分"},buildStatus:{preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"构建失败",notBuilt:"未构建"},manifest:{title:"环境 Manifest",closeLabel:"关闭环境 Manifest",loading:"正在加载 Manifest",editorLabel:"环境 Manifest YAML",copyFailed:"复制失败,请重试",copied:"已复制",copy:"复制 Manifest",view:"查看环境 Manifest",viewShort:"查看 Manifest",unavailable:"尚无可用 Manifest"},buildDetails:{title:"构建详情",closeLabel:"关闭构建详情",currentStep:"当前步骤",waiting:"等待构建信息",elapsed:"已用时",sourceCommit:"源码提交",openCodePipeline:"在 CodePipeline 中查看",starting:"正在启动",rebuild:"重新构建"},git:{sectionLabel:"公开代码仓库",address:"Git 地址",ref:"Branch、Tag 或 Commit",defaultBranch:"默认分支",inspecting:"正在拉取仓库并查找 Dockerfile",foundDockerfiles:"已在提交 {{commit}} 中找到 {{count}} 个 Dockerfile。",savedDockerfileLoaded:"已载入保存的 Dockerfile,可重新探查仓库更新。",noDockerfile:"仓库中未找到 Dockerfile,请检查分支或仓库内容。",inspectAgain:"重新探查",selectDockerfile:"选择 Dockerfile"},repository:{outputSection:"构建输出",type:"镜像仓库类型",managed:"Studio 默认镜像仓库",existing:"已有镜像仓库",managedHint:"构建时自动创建或复用当前区域的 Studio 镜像仓库。"},existingImage:{sectionLabel:"已有镜像",reference:"Tag 或 Digest",placeholder:"latest 或 sha256:...",hint:"填写镜像 Tag,或以 sha256: 开头的完整 Digest。"},share:{action:"分享",title:"分享环境",closeLabel:"关闭分享环境",generating:"正在生成并复制分享码",copied:"分享码已复制",failed:"分享失败",code:"分享码",fullCode:"完整环境分享码",copiedHint:"分享码已自动复制,也可在这里查看或手动复制。",copyFailedHint:"自动复制失败,可手动复制上方分享码,或重试。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅发送给可信对象。",copyAgain:"再次复制"},import:{title:"导入环境",closeLabel:"关闭导入环境",description:"先检测分享码中的环境,再确认添加到当前账号。",code:"环境分享码",tooMany:"最多可一次导入 {{max}} 个环境,当前检测到 {{count}} 个分享码。",multipleHint:"多个分享码可使用英文逗号、中文逗号或换行分隔,重复项会自动忽略。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅导入可信来源的分享码。",inspectingCodes:"正在检测环境分享码",found:"检测到 {{count}} 个环境:{{names}}。",itemError:"第 {{index}} 个分享码:{{error}}",invalidCode:"分享码无效。",noResult:"服务未返回该分享码的导入结果。",partial:"已导入 {{created}} 个环境,{{remaining}} 个未完成,可重试有效失败项。",inspecting:"正在检测",importing:"正在导入",retryImport:"重试导入",confirm:"确认导入",inspectCodes:"检测分享码"},status:{boundImage:"环境“{{name}}”已绑定已有镜像",queued:"环境“{{name}}”已进入构建队列",savedBuildFailed:"环境已保存,但构建未启动:{{error}}",importedFailed:"已导入 {{created}} 个环境,{{failed}} 个失败",importedDuplicate:"已导入 {{created}} 个环境,{{duplicate}} 个分享码已存在",imported:"已导入 {{count}} 个环境",deleted:"已删除环境“{{name}}”"},deleteTitle:"删除环境",deleteDescription:"确定删除环境“{{name}}”吗?删除后无法恢复。",errors:{repositoryRequired:"请输入公开代码仓库地址。",repositoryHttps:"请输入公开仓库的 HTTPS 地址。",repositoryInvalid:"请输入有效的公开仓库 HTTPS 地址。",imageReferenceWhitespace:"Tag 或 Digest 不能包含空格。",imageDigestInvalid:"Digest 必须是完整的 sha256 值。",imageTagOnly:"这里只填写 Tag,不要重复填写镜像仓库路径。"}},wde={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},Ode={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},Sde={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},kde={defaultLabel:"Studio 默认环境",defaultDescription:"使用 Studio 预置的标准运行环境",status:{notBuilt:"未构建",preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"失败"},label:"运行环境",placeholder:"请选择运行环境",search:"搜索运行环境",loading:"正在加载运行环境…",loadFailed:"加载运行环境失败",noMatches:"未找到匹配的运行环境",unavailable:"当前没有可用的运行环境",selectionUnavailable:"所选运行环境当前不可用,请重新选择。",selectionHint:"选择构建完成的运行环境后,部署将使用其镜像和工具配置。",versionChanged:"所选环境版本已更新,请确认后继续。",versionMissing:"所选环境版本已不存在,请重新选择。",operatingSystem:"操作系统",language:"语言",image:"镜像",imageVersion:"镜像版本",skills:"技能",tools:"工具",noSkills:"未配置 Skill",noExtraTools:"未配置额外工具",defaultGuidance:"默认环境由 Studio 管理,无需额外配置。",persistenceFallback:"持久化环境服务暂不可用,当前使用默认环境。",emptyFallback:"当前没有可选择的自定义环境。"},Ede={repository:"GitHub 仓库",githubUrl:"GitHub 地址",token:"访问令牌",sessionToken:"{{provider}} 临时令牌",runtime:"Runtime",commit:"提交",workflow:"工作流",syncFailed:"同步 GitHub 代码失败",status:{mounted:"已挂载",bound:"已绑定",synced:"已同步",created:"已创建"},volcengine:"火山引擎",mountDelivery:"挂载持续交付",selectedForDeployment:"已选择,部署时挂载",mountOnDeploy:"部署时挂载持续交付",syncCode:"同步代码",deliveryMode:"GitHub 交付模式",sourceSync:"GitHub 代码同步",delivery:"GitHub 交付",loading:"读取中",running:"执行中",runtimeDeliveryHint:"写入 AgentKit Runtime GitHub Actions workflow,后续 GitHub 提交会更新绑定 Runtime。",initialDeliveryHint:"首次部署成功后初始化目标分支,后续 GitHub 提交会更新绑定 Runtime。",sourceSyncHint:"Studio 会直接 push 到目标分支;该分支由 Studio 管理,远端冲突时同步会失败。Runtime 仍由部署按钮发布。",tokenPlaceholder:"repo 或 contents write 权限",getToken:"获取 Token",hideToken:"隐藏 Token",showToken:"显示 Token",tokenHelp:"Token 仅用于本次操作,成功后不会保留在表单中。",targetBranch:"目标分支",actionsSecretPlaceholder:"用于写入 GitHub Actions Secret",sessionTokenPlaceholder:"临时凭证可选",syncing:"同步中…",pendingHint:"已选择挂载持续交付。点击部署后,Studio 会等待 Runtime 创建完成并初始化 GitHub 目标分支,初始化成功后才完成部署流程。",result:{deliveryMounted:"已挂载持续交付",deliverySelected:"已选择挂载持续交付",githubBound:"已绑定 GitHub",codeSynced:"代码已同步",deliveryHint:"目标分支提交会触发 Runtime 持续交付。",boundHint:"更新并发布时会先同步当前源码到这个分支。"},branch:"分支",viewPr:"查看 PR",createFailed:"创建失败",phase:"阶段",log:"日志"},Cde={name:"飞书",enabling:"正在启用并更新配置…",description:"接收消息并通过飞书机器人回复",configuration:"飞书配置",configurationMode:"飞书配置方式",automatic:"自动配置",manual:"手动配置",cancelling:"取消中…",scanToCreate:"扫码创建",scanDescription:"授权后自动回填凭据",generateQrCode:"生成二维码",qrCodeAlt:"飞书机器人配置二维码",scanToConfirm:"飞书扫码确认",expiresIn:"{{time}} 后失效",created:"机器人已创建",credentialsFilled:"应用凭据已自动回填",qrCodeExpired:"二维码已失效",automaticFailed:"自动配置失败",regenerateQrCode:"请重新生成二维码。",configuredPlaceholder:"已配置,留空沿用",appSecretPlaceholder:"请输入 App Secret",hideSecret:"隐藏 App Secret",showSecret:"显示 App Secret"},Tde={mode:{auto:"自动创建",autoDescription:"部署时自动创建所需资源",recommended:"推荐",create:"指定名称",createDescription:"使用指定名称创建或复用资源",existing:"选择已有",existingDescription:"从当前账号的已有资源中选择"},selectExisting:"请选择已有资源",searchResource:"搜索资源名称",noMatch:"未找到匹配资源",noAvailable:"暂无可用资源",searching:"正在搜索云资源…",loading:"正在加载云资源…",noMatchSentence:"未找到匹配资源。",noAvailableSentence:"暂无可用资源。",loadedSummary:"实际服务区域:{{region}} · 已加载 {{loaded}}{{total}}",registryInstance:"Registry 实例",registryAriaLabel:"镜像仓库 Registry 实例",namespace:"命名空间",namespaceAriaLabel:"镜像仓库 Namespace",repository:"镜像仓库",existingRepository:"已有镜像仓库",selectRegistryFirst:"请先选择 Registry 实例。",selectNamespaceFirst:"请先选择 Namespace。",configurationMode:"配置方式",configurationModeAriaLabel:"{{resource}}配置方式",selectConfigurationMode:"请选择配置方式",automaticNames:"自动创建名称",validation:{tos:"请填写或选择 TOS 存储桶。",cr:"请完整填写或选择 CR 实例、命名空间和镜像仓库。",codePipeline:"请完整填写或选择 CodePipeline Workspace 和 Pipeline。",existingCodePipeline:"请选择已有的 CodePipeline Workspace 和兼容 Pipeline。"},autoBucketWithRegion:"agentkit-platform-{账号 ID}-{{region}}",autoBucket:"agentkit-platform-{账号 ID}",tosBucket:"TOS 存储桶",bucketName:"存储桶名称",bucketNamePlaceholder:"输入存储桶名称",existingBucket:"已有存储桶",existingTosBucket:"已有 TOS 存储桶",bucket:"存储桶",accountIdResolved:"账号 ID 在部署时按当前云账号解析。",containerRegistry:"容器镜像仓库(CR)",instanceName:"实例名称",crInstance:"CR 实例",existingCrInstance:"已有 CR 实例",existingCrNamespace:"已有 CR 命名空间",existingCrRepository:"已有 CR 镜像仓库",autoRegistry:"agentkit-platform-{账号 ID}",autoRepositoryName:"{{name}}-{4 位随机字符}",registryNameNote:"账号 ID 在部署时解析,镜像仓库的随机字符在部署时生成。",workspace:"工作空间",pipeline:"流水线",workspaceName:"Workspace 名称",pipelineName:"Pipeline 名称",existingWorkspace:"已有 CodePipeline Workspace",compatiblePipeline:"兼容 Pipeline",existingPipeline:"已有 AgentKit CodePipeline",pipelineNameNote:"Pipeline 与 Runtime 名称一致。"},Ade={commit:"提交",steps:{permissions:"预检 OTA 所需权限",resolving:"读取目标版本信息",downloading:"下载并校验完整更新包",preparing:"准备 VeFaaS Function 代码",provisioning:"检查并补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布新 Revision 并重启服务"},stages:{permissions:"预检 OTA 权限",resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",provisioning:"补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},logPermissionPrefix:"无法读取 VeFaaS 发布日志。Function 角色缺少 ",logPermissionSuffix:" 权限,更新会继续。",openIamConsole:"前往 IAM 控制台配置权限",deploymentProgress:"部署进度",live:"实时",completed:"已完成",stopped:"已停止",copied:"已复制",copyFailed:"复制失败",copyLog:"复制日志",waitingForLogs:"等待 VeFaaS 返回更新日志…",noLogs:"本次更新未返回发布日志",messages:{updated:"Studio 已更新,新 Revision 已接管服务",failed:"Studio 更新失败",timeout:"等待 VeFaaS 发布超时,请稍后重新检查版本",submitted:"更新已提交,正在等待 VeFaaS 发布新版本",connectionSwitched:"连接已切换,正在确认新版本状态"},checkingPermissions:"正在检查 OTA 权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",updated:"Studio 已更新",updateToVersion:"更新 Studio 至 {{version}}",checkPermissions:"检查更新权限",authorizationNeeded:"需要授权",updatingShort:"正在更新",refreshForNewVersion:"刷新使用新版",updateFailed:"更新失败",updateNow:"立即更新",newVersionAvailable:"有新版更新",dialog:{failed:"Studio 更新失败",checkingPermissions:"正在检查更新权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",completed:"Studio 更新完成",newVersion:"发现新版本"},permissionCheck:"正在核对 OTA 与定时任务所需的全部 IAM 权限…",permissionCheckHint:"权限全部满足后才会开始下载、更新或发布云资源。",missingPermissionCount:"当前 Function 角色缺少 {{count}} 项 OTA 更新权限,尚未执行任何云资源变更。",functionRole:"Function 角色",currentRole:"当前运行角色",policyToUpdate:"将更新策略",authorizationSteps:{open:"打开授权页面,确认已预填的策略名称和完整策略内容。",debug:"点击页面中的“发起调试”,完成策略更新。",return:"返回此窗口,点击“我已授权,重新检查”。"},missingPermissions:"缺少的权限",openPrefilledAuthorization:"打开已预填的 IAM 授权页面",openIamManually:"前往 IAM 控制台手动配置",noSafePolicy:"当前角色没有唯一可安全更新的自定义策略,请由管理员将上述权限加入该角色。",failedStage:"失败阶段",errorId:"错误 ID",notGenerated:"未生成",openFunctionLogs:"前往 VeFaaS 控制台查看 Function 日志",targetVersion:"目标版本",updateStatus:"更新状态",elapsed:"已用时",progressAriaLabel:"Studio 更新进度",processingUpdate:"正在处理更新",processing:"正在处理",backgroundHint:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。",confirmDescription:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、流式响应或部署任务可能中断,登录态不会受到影响。",selectVersion:"选择版本",currentVersion:"当前版本",changelog:"更新内容",noChangelog:"暂无更新说明",runInBackground:"后台运行",authorizedRecheck:"我已授权,重新检查",tryAgain:"重新尝试"},_de={deploy:"部署",update:"更新",planHash:"方案哈希",backToConfiguration:"返回配置",releaseRegion:"发布区域",deployRegion:"部署区域",regionPreserved:"更新时沿用现有 Runtime 的部署区域,无法修改。",unnamedAgent:"未命名 Agent",deployTitle:"部署 {{name}}",additionalAgentCount:" 等 {{count}} 个智能体",releaseOverview:"发布概览",agentOverview:"Agent 概览",agentCount:"Agent 数量",model:"模型",systemPrompt:"系统提示词",optimizations:"优化选项",notEnabled:"未启用",effectiveCapabilities:"生效能力",automaticProtection:"自动保护",artifactActions:"发布产物操作",exportYaml:"导出 YAML",viewSource:"查看源代码",downloadSource:"下载源代码",expandFlow:"放大查看执行流程",expand:"放大查看",deploymentConfiguration:"部署配置",runtimeName:"Runtime 名称",runtimeNamePreserved:"更新时保持现有 Runtime 名称不变。",runtimeNameHint:"默认根据 Root Agent 名称生成,并添加随机后缀避免重名;支持 4-64 位字母、数字、连字符和下划线",accessAuthentication:"访问鉴权",authenticationPreserved:"更新时保持现有 Runtime 的鉴权方式不变。",authenticationMethod:"鉴权方式",authenticationAriaLabel:"部署鉴权方式",authenticationPlaceholder:"请选择鉴权方式",messageChannels:"消息渠道",instanceSettings:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",sidecarSingleInstance:"Harness Sidecar 首期仅支持单实例,Runtime 固定为 1~1",inMemorySingleInstance:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",network:"网络",networkPreserved:"现有 Runtime 的区域与网络模式保持不变。",networkMode:"网络模式",networkModes:{public:"公网",both:"公网 + VPC"},subnetId:"子网 ID",subnetHint:"可选,多个用逗号分隔",sharedInternetAccess:"VPC 内共享公网出口",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",createEvaluationSetsHint:"部署成功后,自动创建 Good Case 和 Bad Case 评测集。",resourceConfiguration:"资源配置",environmentVariables:"环境变量",environmentVariablesHint:"组件配置会自动同步到这里,部署前可核对最终值。",itemCount:"{{count}} 项",addVariable:"添加变量",componentGenerated:"组件自动生成",injectedByApiKey:"由所选 API Key 注入",envNameAriaLabel:"{{key}} 环境变量名",envDescriptionAriaLabel:"{{key}}说明:{{description}}",openOpenViking:"打开 OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}:打开 OpenViking {{label}}",requiredEmpty:"必填,尚未填写",optionalEmpty:"可选,尚未填写",envValueAriaLabel:"{{key}} 环境变量值",automatic:"自动",synced:"同步",customModelCredentials:"自定义模型凭据",releaseOnlySecret:"必填,仅用于本次发布",thisRelease:"本次发布",customVariables:"自定义变量",value:"值",deleteVariable:"删除变量",deploymentProgress:"部署进度",retryUpdate:"重试更新",retryDeploy:"重试部署",updateSucceeded:"更新成功",deploySucceeded:"部署成功",region:"区域",agentName:"Agent 名称",apiEndpoint:"API 端点",connecting:"连接中…",chatNow:"立即对话",console:"控制台",actionInProgress:"{{action}}中…",checkingName:"正在检查名称…",retryAction:"重试{{action}}",flowPreview:"执行流程预览",executionFlow:"执行流程",flowPreviewHint:"只读预览,可缩放与拖动画布",closeFlowPreview:"关闭执行流程预览",agentAdded:'Agent "{{name}}" 已添加到左上角下拉列表!',files:{preview:"文件预览",new:"新建文件",empty:"暂无文件",noneSelected:"未选择文件",selectToView:"选择左侧文件以查看内容",loadingEditor:"加载编辑器…",rename:"重命名",renamePrompt:"重命名文件"},apiKey:{selectFirst:"请先选择 API Key",revealing:"正在显示 API Key",hide:"隐藏 API Key",retryReveal:"重试显示 API Key",reveal:"显示 API Key"},task:{preparing:"准备部署",waitingBuildLog:"正在等待构建日志…",waitingGithubLog:"正在等待 GitHub 挂载日志…",syncingGithub:"正在同步当前源码到 GitHub",syncGithubCode:"同步 GitHub 代码",githubSynced:"GitHub 代码已同步",githubSubmitted:"GitHub 代码已提交",githubUpdatingRuntime:"代码已提交到 GitHub,GitHub Actions 正在更新同一个 Runtime",initializingGithub:"开始初始化 GitHub main 分支与 Actions workflow",initializingGithubBranch:"正在初始化 GitHub 持续交付目标分支",mountGithubDelivery:"挂载 GitHub 持续交付",githubBranchInitialized:"GitHub 持续交付已初始化目标分支",githubDeliveryMounted:"GitHub 持续交付已挂载",githubMountFailed:"挂载 GitHub 持续交付失败",githubMountFailedDetail:"GitHub 持续交付挂载失败:{{message}}",githubMountFailedHint:"挂载 GitHub 持续交付失败,详见 GitHub 日志。",deploymentComplete:"部署完成",deployedNotConnected:"部署完成,暂未连接",cancelled:"已取消",cancelledHint:"部署已取消,相关 Runtime 资源已请求销毁。",deploymentStatusUnconfirmed:"部署状态待确认",deploymentFailed:"部署失败",buildFailedHint:"构建镜像失败,详见构建日志。"},confirm:{updateTitle:"确认更新",deployTitle:"确认部署",closeLabel:"关闭部署确认",updateDescription:"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?",deployDescription:"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?",update:"确定更新",deploy:"确定部署"},userPool:{label:"用户池",unnamed:"未命名用户池",current:"当前用户池",ariaLabel:"部署用户池",loading:"正在加载用户池…",placeholder:"请选择用户池",loadingIdentity:"正在加载 Identity 用户池…",empty:"当前账号下暂无 Identity 用户池。",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime。",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime。",markedHint:"当前 Studio 使用的用户池已在列表中标注。"},authentication:{apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPool:"用户池",userPoolDescription:"使用 Identity 用户池签发的 JWT"},steps:{buildImage:"构建镜像",deploy:"部署",publish:"发布",syncCode:"同步代码",uploadPackage:"上传代码包",packageImage:"镜像打包",createRuntime:"创建 Runtime",publishService:"发布服务",updateInstances:"更新实例配置",createEvaluationSets:"创建评测集"},errors:{instanceRangeInteger:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数。",instanceRangeOrder:"最小实例数不能大于最大实例数。",selectApiKey:"请先在模型配置中选择 API Key。",loadApiKey:"加载 API Key 失败,请重试。",invalidProject:"项目数据无效",updateFeishu:"更新飞书配置失败:{{message}}",userPoolRequired:"请选择用于 Runtime 鉴权的用户池。",vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",modelSecretRequired:"请填写 {{label}},用于访问对应的自定义模型地址。",managedApiKeyRequired:"{{requirement}},请先返回模型配置选择 API Key。",feishuEnvRequired:"启用飞书后,请填写{{field}}。",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",deployedButGithubMountFailed:"部署成功,但挂载 GitHub 持续交付失败:{{message}}",deployedButGithubBindFailed:"部署成功,但绑定 GitHub 失败:{{message}}",deploymentStatusUnconfirmed:"连接已中断,当前无法确认部署最终状态。任务可能仍在云端运行,请到 AgentKit 或 Code Pipeline 查看同一任务,避免重复部署。",failedAtStage:"{{action}}失败({{stage}}阶段):{{message}}",noAgentAtEndpoint:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",addAgent:"添加 Agent 失败:{{message}}",modelApiKeyRequired:"请填写此模型地址对应的 API Key。"}},Nde={title:"工作区",detail:"工作区详情",create:"新建工作区",editorDescription:"将常用环境组合在一起;同一个环境可以加入多个工作区。",backToList:"返回工作区列表",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",createdAt:"创建时间",updatedAt:"最近更新",basicInfo:"基本信息",namePlaceholder:"例如:内容生产",descriptionPlaceholder:"说明这个工作区的用途",selectedEnvironmentCount:"已选择 {{count}} 个,可在其他工作区中继续复用",searchAvailableEnvironments:"搜索可用环境",searchEnvironments:"搜索环境",noAvailableEnvironments:"还没有可添加的环境",createEnvironmentFirst:"请先在“环境”页面创建并构建环境。",noMatchingEnvironments:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称。",environmentStatus:{available:"可用",building:"构建中",notBuilt:"未构建"},added:"已添加",saved:"已保存工作区“{{name}}”",resourceType:"工作区资源类型",searchWorkspaces:"搜索工作区",loadFailed:"无法加载工作区",noMatchingWorkspaces:"没有匹配的工作区",tryAnotherNameOrEnvironment:"请尝试搜索其他名称或环境",noEnvironmentAdded:"未添加环境",environmentMissing:"环境缺失",availableFraction:"{{available}}/{{total}} 可用",available:"可用",availableCount:"{{count}} 个可用",updated:"更新",addEnvironment:"添加环境",deleteTitle:"删除工作区",deleteDescription:"确定删除工作区“{{name}}”吗?环境本身不会被删除。",deleted:"已删除工作区“{{name}}”",clipboardPermissionError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。"},jde={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},Rde={addSkill:"添加 Skill",remove:"移除 {{name}}",confirmRemoveRuntime:"从新版本中移除运行中的 Skill「{{name}}」?",selectedCount:"已加入技能 · {{count}}",close:"关闭{{label}}",sources:{runtime:"运行中来源 · 原样保留,可移除或用同名 Skill 替换",local:"本地",skillspace:"AgentKit Skills 中心",skillhub:"火山 Find Skill 技能广场"},tabs:{local:"本地文件",localShort:"本地文件",skillspace:"AgentKit Skills 中心",skillspaceShort:"AgentKit",skillhub:"火山 Find Skill 技能广场",skillhubShort:"Find Skill"}},Ide={tasks:{ppt:"PPT",image:"图片生成",video:"视频生成"},prompts:{ppt:{quarterlyReview:"复盘【季度】经营表现,提炼指标差距、原因与行动建议",projectUpdate:"汇报【项目名称】进展:里程碑、风险、预算和资源诉求",solutionProposal:"为【客户行业】输出解决方案:痛点、架构、实施路径与收益",industryAnalysis:"分析【行业主题】趋势,给出竞争格局、机会与战略建议"},image:{launchVisual:"为【品牌或产品】设计【高级科技】风格的发布会主视觉",ecommercePoster:"生成【产品名称】电商海报,突出【核心卖点】与品牌色",conceptRendering:"呈现【产品或空间】在【使用场景】中的写实概念效果图",socialGraphic:"围绕【传播主题】制作简洁专业的企业社媒配图"},video:{brandFilm:"制作【品牌名称】30 秒宣传片,突出【品牌价值】",productLaunch:"为【产品名称】制作 45 秒发布视频:痛点、功能、场景与行动号召",trainingVideo:"制作【培训主题】企业培训视频,讲清【关键操作或规范】",eventTeaser:"生成【活动名称】20 秒预热视频,包含亮点、时间地点和报名信息"}},firstFrame:"首帧",videoToEdit:"待编辑视频",baseVideo:"基础视频",optimizeSkillPlaceholder:"描述你想优化的技能…",createSkillPlaceholder:"描述你想生成的技能…",createVideoPlaceholder:"描述你想创作的视频…",messageAgentPlaceholder:"向 {{name}} 发消息…",selectAgentFirst:"请先选择智能体",selectSkillFirst:"请先选择需要优化的 Skill",availableSkills:"可用技能",availableSubagents:"可用子 Agent",invokeSkill:"调用技能",useSubagent:"使用子 Agent",loadingCapabilities:"正在读取 Agent 能力…",noMatchingSkills:"当前 Agent 没有匹配技能",noMatchingSubagents:"当前 Agent 没有匹配子 Agent",skillFallbackDescription:"加载并执行该技能",agentFallbackDescription:"将本轮交给该 Agent",skill:"技能",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",taskMode:"任务模式",selectTaskMode:"选择任务模式",loadingGenerationModel:"正在加载生成模型",modelUnavailable:"模型不可用",cancelTask:"取消{{task}}任务",stopGenerating:"停止生成",viewVideoProgress:"查看视频生成进度",send:"发送",selectTaskType:"选择任务类型",enterprisePrompts:"{{task}}企业提示词",sessionId:"会话 ID",sessionIdLabel:"会话 ID:",initializing:"初始化中",copied:"已复制",copySessionId:"复制会话 ID",sessionIdCopied:"已复制会话 ID",disclaimer:"回答仅供参考",viewLogs:"查看日志"},Pde={selectAgent:"选择 Agent",noLocalAgents:"暂无本地 Agent。",searchRuntime:"搜索 Runtime 名称",mineOnly:"只看我创建的",noRuntimes:"暂无 Runtime。",unsupported:"不支持",createdByMe:"我创建的",connecting:"连接中…",connected:"已连接",connect:"连接",viewInfoFor:"查看 {{name}} 信息",viewInfo:"查看信息",agentAndRuntimeInfo:"Agent 与 Runtime 信息",detailType:"详情类型",agentInfo:"Agent 信息",runtimeInfo:"Runtime 信息",loadingAgentInfo:"读取 Agent 信息…",cannotLoadAgentInfo:"暂时无法读取 Agent 信息",unnamedAgent:"未命名 Agent",subagents:"子 Agent",tools:"工具",skills:"技能",previewUnsupported:"暂不支持预览",mountedComponents:"挂载组件",noMoreAgentInfo:"暂无更多 Agent 配置信息。",local:"本地",model:"模型",status:"状态",memoryMb:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",resources:"资源",version:"版本",loadingDetails:"读取详情…",environmentVariables:"环境变量",errors:{notFound:"该 Runtime 已不存在或列表信息已过期,请刷新列表后重试。",accessDenied:"当前账号无权访问该 Runtime,请检查所属 Project 和访问权限。",previewUnsupported:"该 Agent Server 版本暂不支持信息预览。",unavailable:"该 Runtime 暂时无法访问,请确认其状态为“就绪”后重试。",timeout:"加载超时,请重试"},componentKinds:{knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"},runtimeStatus:{ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"}},Dde={agent:"智能体",agentTypes:{general:"通用智能体",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"创建人",namedAgent:"{{name}} 智能体",storageLocation:"存储位置",currentBrowser:"当前浏览器",region:"地域",viewDeploymentProgress:"查看 {{name}} 部署进度",viewRuntimeDetails:"查看 {{name}} Runtime 详情",viewDetails:"查看 {{name}} 详情",time:"时间",remainingTime:"剩余时间",expiringSoon:"即将清空",sandboxRemaining:"{{hours}} 小时 {{minutes}} 分钟",wakeable:"可唤醒",neverExpires:"永不过期",editDraftNamed:"编辑草稿 {{name}}",viewProgress:"查看进度",deleteDraftNamed:"删除草稿 {{name}}",recheckCompatibility:"重新检测 {{name}} 的对话兼容性",connectedNamed:"{{name}} 已连接",wakeAndChat:"唤醒 {{name}} 并开始对话",chatWith:"与 {{name}} 对话",waking:"唤醒中",deploying:"部署中",draft:"草稿",checking:"检测中",chatUnsupported:"不支持对话",checkFailed:"检测失败",creatorFilter:"创建人筛选",agentType:"智能体类型",searchAgents:"搜索智能体",handoff:"接力",agentList:"{{type}}列表",noMatchingAgents:"没有匹配的智能体",adjustSearch:"请尝试调整搜索或筛选条件",noAgentType:"暂无 {{type}}",noGeneralAgents:"暂无通用智能体",createGeneralAgentDescription:"创建一个通用智能体,开始构建和对话",createAgentType:"创建{{type}}",createAgent:"创建智能体",loadingMore:"正在加载更多智能体",scrollForMore:"继续下滑加载更多",allLoaded:"已加载全部智能体",deleteDraftTitle:"删除草稿?",deleteDraftDescription:"删除后将无法恢复“{{name}}”。",deleteDraft:"删除草稿",loadGeneralAgents:"加载通用智能体",loadAgentType:"加载 {{type}}",compatibility:{checking:"正在请求 Runtime /list-apps,以确认该智能体是否支持 Studio 对话。",empty:"Runtime /list-apps 未返回可用的 Agent,暂时无法连接对话。",supported:"Runtime 支持 Studio 对话。",unknownError:"Runtime /list-apps 请求失败,未返回可识别的错误信息。"},sandboxStatus:{ready:"就绪",wakeable:"可唤醒",creating:"创建中",starting:"启动中",initializing:"启动中",pending:"等待中",running:"运行中",failed:"异常",error:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"}},Mde={library:"技能库",skill:"技能",skills:"技能",skillSpace:"技能空间",sandboxNotConfigured:"管理员未配置 Dev Sandbox",adminNotConfigured:"管理员未配置",totalItems:"共 {{count}} 项",cannotLoadSpaces:"无法加载技能空间",someSpacesFailed:"部分技能空间加载失败",degradedRelationWarning:"部分关联异常,已恢复可读取技能",downloadZip:"下载 ZIP",optimize:"优化",closeSkillDetails:"关闭技能详情",skillId:"技能 ID",allFiles:"完整文件",loadingSkillContent:"正在读取技能内容…",noSkillContent:"该技能暂无 SKILL.md 内容",addSkill:"添加技能",localUpload:"本地上传",localUploadDescription:"选择 ZIP 文件,校验通过后上传到技能空间",autoCreate:"自动创建",autoCreateDescription:"选择模型和风格,通过对话生成技能",createSkill:"创建技能",optimizeNamed:"优化 {{name}}",deleteSkillConfirm:"确定删除整个 Skill“{{name}}”吗?此操作会影响所有引用它的空间。",deleteSpaceConfirm:"确定删除 Skill 空间“{{name}}”吗?请先确认空间中的技能已删除。",manageSpaceDescription:"管理空间中的技能并创建新的版本",backToSpaces:"返回技能空间列表",overview:"概览",skillCount:"技能数量",skillCountValue_one:"{{count}} 技能",skillCountValue_other:"{{count}} 技能",updatedAt:"更新时间",skillsInSpace:"{{name}}中的技能",searchSkills:"搜索技能",cannotLoadSkills:"无法加载技能",noMatchingSkills:"没有匹配的技能",noSkills:"暂无技能",tryAnotherName:"请尝试搜索其他名称",emptySkillsDescription:"本地上传 Skill,或自动创建",actions:"操作",spaceDetails:"技能空间详情",editSpace:"编辑空间",deleteSpace:"删除空间",searchSpaces:"搜索技能空间",spaceList:"技能空间列表",noMatchingSpaces:"没有匹配的技能空间",createSpace:"新建技能空间",newSpace:"新建空间",loadingMoreSpaces:"正在加载更多技能空间",scrollForMore:"继续下滑加载更多",allSpacesLoaded:"已加载全部技能空间",errors:{loadSpaces:"读取技能空间失败,请稍后重试",loadSkills:"读取技能失败,请稍后重试",loadSkillDetails:"读取技能详情失败,请稍后重试",deleteSkill:"删除 Skill 失败",deleteSpace:"删除 Skill 空间失败",downloadSkill:"下载 Skill 失败"},status:{active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中",unknown:"未知"}},Lde={library:"知识库",createBase:"新建知识库",editBase:"编辑知识库",invalidName:"名称必须以字母开头,且只能包含字母、数字和下划线。",nameHelp:"以字母开头,仅支持字母、数字和下划线,最多 48 个字符。",optionalDescription:"描述(可选)",descriptionOnly:"AgentKit 当前仅支持更新知识库描述。",previewWeb:"预览网页内容",addData:"添加数据",openOriginalWeb:"打开原网页",backToEdit:"返回修改",confirmAdd:"确认添加",source:"知识来源",image:"图片",documentFile:"文档文件",webPage:"在线网页",webUrl:"网页 URL",generatingWebPreview:"正在抓取网页并生成 Markdown 预览",selectFile:"选择知识文件",selectOrDropFile:"选择文件或拖拽到这里",selectedFile:"{{size}} · 点击可重新选择",imageFileHelp:"支持 PNG、JPG 和 JPEG,单个文件不超过 200 MB",documentFileHelp:"支持 PDF、PPTX、DOCX、XLSX 和 TXT,单个文件不超过 200 MB",uploadingFile:"正在上传文件并添加到知识库",optionalName:"名称(可选)",optionalType:"类型(可选)",generatePreview:"生成预览",uploadFile:"上传文件",editMetadata:"编辑知识 Metadata",knowledge:"知识",field:"字段",value:"值",backToList:"返回知识库列表",metadataJson:"元数据(JSON)",provider:"服务提供方",knowledgeId:"知识库 ID",project:"项目",creator:"创建者",data:"数据",deleteInvalidAssociation:"删除失效关联",noData:"这个知识库还没有数据",addFirstData:"添加第一项数据",format:"格式",size:"大小",searchData:"搜索数据",searchLibraryData:"搜索知识库数据",associationInvalid:"关联已失效",providerMissing:"底层 Provider 知识库已不存在",noMatchingData:"没有匹配的数据",loadingMoreData:"正在加载更多数据",retryLoading:"重试加载",details:"知识库详情",searchBases:"搜索知识库",someBasesFailed:"部分知识库暂时无法加载,已展示其余可用内容。",noMatchingBases:"没有匹配的知识库",noManagePermission:"您没有管理此知识库的权限",loadingMoreBases:"正在加载更多知识库",deleteBaseTitle:"删除知识库?",deleteBaseDescription:"将删除 {{name}} 的 AgentKit 关联;如果它由 Studio 创建,也会同时删除 Provider 资源。此操作无法撤销。",deleteDocumentTitle:"删除知识?",deleteDocumentDescription:"将从 Provider 知识库中删除 {{name}},此操作无法撤销。",preview:{processingTitle:"数据正在处理中",processingDetail:"知识库完成解析后即可预览,请稍后重新加载。",failedTitle:"数据解析失败",failedDetail:"请检查源文件或网页地址后重新添加,也可以重新加载最新状态。",noParsedTitle:"暂时没有可预览的解析内容",noParsedDetail:"此类文件会在知识库完成解析后显示文本、表格或页面图片。",noMediaTitle:"暂时没有可预览的媒体内容",noMediaDetail:"知识库尚未返回可访问的媒体预览,请稍后重新加载。",noDataTitle:"暂无可预览的数据内容",noDataDetail:"知识库尚未返回解析结果,请稍后重新加载。",attachmentError:"附件无法预览,请稍后重试。",imageAlt:"知识数据图片",audioUnsupported:"当前浏览器不支持音频预览。",videoUnsupported:"当前浏览器不支持视频预览。",namedPdf:"{{name}} PDF 预览",pdf:"PDF 预览",openPdf:"无法显示时,在新窗口打开 PDF",fileUnsupported:"当前格式暂不支持直接在线预览,已优先显示解析后的内容。",openOriginalFile:"打开原文件",loading:"正在加载数据预览",openOriginalHint:"您可以打开原网页查看来源内容。",chunk:"片段 {{index}}",loadingMore:"正在加载更多",loadMore:"加载更多"},errors:{fileTooLarge:"单个文件不能超过 200 MB",invalidImageType:"请选择 PNG、JPG 或 JPEG 图片",invalidDocumentType:"请选择 PDF、PPTX、DOCX、XLSX 或 TXT 文件",createBase:"创建知识库失败",updateBase:"更新知识库失败",metadataObject:"Metadata 必须是 JSON 对象",metadataFormat:"Metadata 格式错误",noWebPreview:"网页没有可预览的 Markdown 内容",addWeb:"添加网页失败",previewWeb:"生成网页预览失败",uploadFile:"上传文件失败",updateDocument:"更新知识失败",loadPreview:"加载数据预览失败",loadMoreBases:"加载更多知识库失败",loadBases:"加载知识库失败",loadMoreData:"加载更多数据失败",loadData:"加载数据失败",deleteBase:"删除知识库失败",deleteDocument:"删除知识失败"}},TMe={common:gde,agentKitPromo:bde,systemInfo:yde,agentWorkspace:vde,environmentCenter:xde,deploymentSelect:wde,deploymentError:Ode,studioBuildProgress:Sde,cloudEnvironment:kde,githubCicd:Ede,feishuDeployment:Cde,deploymentResources:Tde,studioUpdate:Ade,projectPreview:_de,workspace:Nde,resourceCollection:jde,skillSourcePicker:Rde,composer:Ide,agentSelector:Pde,myAgents:Dde,skillCenter:Mde,knowledge:Lde},AMe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:bde,agentSelector:Pde,agentWorkspace:vde,cloudEnvironment:kde,common:gde,composer:Ide,default:TMe,deploymentError:Ode,deploymentResources:Tde,deploymentSelect:wde,environmentCenter:xde,feishuDeployment:Cde,githubCicd:Ede,knowledge:Lde,myAgents:Dde,projectPreview:_de,resourceCollection:jde,skillCenter:Mde,skillSourcePicker:Rde,studioBuildProgress:Sde,studioUpdate:Ade,systemInfo:yde,workspace:Nde},Symbol.toStringTag,{value:"Module"})),$de="网站集成",Fde="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",Bde="返回自动化列表",Ude="添加网站",Qde="正在加载 Runtime",zde="选择 Runtime",Vde="网站域名",Hde="例如 xxxx.com 或 localhost:5173",qde="正在生成",Wde="生成 Token",Gde="已添加网站",Kde="{{count}} 个",Xde="{{count}} 个",Yde="正在加载网站集成",Zde="还没有网站集成",Jde="选择 Runtime 并输入网站域名即可生成 Token",efe="引入方法",tfe="将下面代码放到网页的 body 结束标签前",nfe="已复制",ife="复制代码",rfe="添加网站后会在这里生成引入代码。",sfe="确定删除 {{domain}} 的网站集成吗?",afe={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},ofe={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},_Me={title:$de,description:Fde,backToAutomations:Bde,addWebsite:Ude,loadingRuntime:Qde,selectRuntime:zde,websiteDomain:Vde,domainPlaceholder:Hde,generating:qde,generateToken:Wde,addedWebsites:Gde,websiteCount_one:Kde,websiteCount_other:Xde,loadingIntegrations:Yde,delete:"删除",emptyTitle:Zde,emptyDescription:Jde,embedMethod:efe,embedInstructions:tfe,copied:nfe,copyCode:ife,embedHint:rfe,confirmDelete:sfe,errors:afe,widget:ofe},NMe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:Ude,addedWebsites:Gde,backToAutomations:Bde,confirmDelete:sfe,copied:nfe,copyCode:ife,default:_Me,description:Fde,domainPlaceholder:Hde,embedHint:rfe,embedInstructions:tfe,embedMethod:efe,emptyDescription:Jde,emptyTitle:Zde,errors:afe,generateToken:Wde,generating:qde,loadingIntegrations:Yde,loadingRuntime:Qde,selectRuntime:zde,title:$de,websiteCount_one:Kde,websiteCount_other:Xde,websiteDomain:Vde,widget:ofe},Symbol.toStringTag,{value:"Module"})),lfe={types:{all:"全部类型",document:"文档",image:"图片",video:"视频"},previewArtifact:"预览 {{name}}",moreActions:"更多操作 {{name}}",actionMenu:"{{name}} 操作",download:"下载",downloading:"下载中",edit:"编辑信息",delete:"删除产物",previewFailed:"无法预览“{{name}}”:{{message}}",downloadStarted:"已开始下载 {{name}}",downloadFailed:"无法下载“{{name}}”:{{message}}",updated:"已更新 {{name}}",deleted:"已删除 {{name}}",deleteFailed:"无法删除“{{name}}”:{{message}}",typeFilter:"产物类型",searchAria:"搜索产物",searchPlaceholder:"搜索产物或会话",retry:"重试",close:"关闭",listAria:"产物列表",loadFailed:"产物加载失败",loadDetailFallback:"请检查存储配置后重试。",reload:"重新加载",noMatch:"没有找到匹配的产物",noArtifacts:"您还没有任何产物",searchHint:"请尝试搜索其他名称或切换类型",emptyHint:"聊天中生成的产物会自动显示在这里",columns:{name:"名称",source:"来源",updatedAt:"修改时间",actions:"操作"},loadingMore:"正在加载更多产物",unknownTime:"时间未知",preview:{close:"关闭预览",meta:"{{type}} / 版本 {{version}}",loading:"正在加载预览",alt:"{{name}} 预览",loadFailed:"预览加载失败,请稍后重试或下载查看",unsupported:"当前格式暂不支持在线预览,请下载查看",sourceAria:"产物来源",agent:"智能体",session:"会话",tool:"生成工具",createdAt:"生成时间",fileSize:"文件大小",tags:"标签",viewSession:"查看会话"},deleteDialog:{title:"删除产物?",description:"“{{name}}”将从产物库永久删除,聊天记录不会受到影响。",deleting:"删除中",confirm:"删除",close:"关闭删除确认框"},api:{withStatus:"{{message}}({{status}})",listFailed:"读取产物库失败",syncFailed:"同步聊天产物失败",updateFailed:"更新产物失败",deleteFailed:"删除产物失败",downloadFailed:"下载产物失败"}},cfe={unknownSource:"未知来源",unknownCreator:"未知创建者"},ufe={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},dfe={change:{added:"新增",modified:"修改",deleted:"删除"},noChanges:"两个版本的源码没有差异",chooseFile:"从左侧选择文件以查看代码",compareTitle:"版本对比",workspaceTitle:"源码工作区",projectFallback:"Agent 项目",switchTheme:"切换源码主题",switchThemeTitle:"切换为{{theme}}主题",themes:{dark:"深色",light:"浅色"},closeWorkspace:"关闭源码工作区",close:"关闭",changedFiles:"变更文件",projectFiles:"项目文件",changes:"变更",files:"文件",openFiles:"打开的文件",noFileSelected:"未选择文件",comparisonDirection:"对比方向",before:"优化前",after:"优化后",loadingEditor:"正在加载编辑器…",changedFileCount_one:"{{count}} 个文件有变更",changedFileCount_other:"{{count}} 个文件有变更",fileCount_one:"{{count}} 个文件",fileCount_other:"{{count}} 个文件",lineCount_one:"{{count}} 行 · UTF-8",lineCount_other:"{{count}} 行 · UTF-8",viewSource:"查看源码",viewSourceAria:"查看和编辑项目源码"},ffe={nav:"搜索",selectAgent:"请选择 Agent",checkingCapabilities:"正在检测 Agent 能力",notMounted:"当前 Agent 未挂载{{label}}",sources:{session:"会话",web:"网络",knowledge:"知识库",memory:"长期记忆"},webDescription:"通过 web_search 工具检索",backendLocal:"本地",failed:"搜索失败:{{message}}",placeholder:{selectAgent:"请先选择 Agent",web:"在网络中检索",knowledge:"在 {{name}} 中检索",knowledgeFallback:"当前 Agent 的知识库",memory:"在 {{name}} 中检索",memoryFallback:"当前用户的长期记忆",session:"在当前 Agent 的会话中检索"},sourceTypeAria:"搜索类型:{{label}}",notSelected:"未选择",sourceType:"搜索类型",selectSource:"选择搜索类型",noAgentHint:"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。",loadingCapabilities:"正在读取当前 Agent 的检索能力…",sourceUnavailable:"当前 Agent 未挂载该数据源",instructions:{web:"输入关键词后回车或点击按钮,通过 web_search 工具检索。",knowledge:"输入问题,检索当前 Agent 挂载的知识库。",memory:"输入线索,检索当前用户跨会话保存的长期记忆。",session:"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"},noResults:"未找到匹配“{{query}}”的结果。",knowledgeFragment:"知识片段 {{index}}",memoryFragment:"记忆片段 {{index}}"},hfe={title:"开发者资源",sections:{documentation:{title:"相关链接",description:"查看开发文档与 AgentKit 常用入口"},bestPractices:{title:"最佳实践",description:"参考开发、调试与部署经验"},showcases:{title:"案例展示",description:"探索 AgentKit 应用案例"}},links:{veadkDocs:"VeADK 文档",cliDocs:"AgentKit CLI 文档",platformDocs:"AgentKit 平台文档",console:"AgentKit 控制台"},articles:{veadkDevelopment:{title:"使用 VeADK 开发并部署智能体",description:"使用 VeADK 构建 Agent,并部署至 AgentKit 智能体运行时。"},cliDevelopment:{title:"使用 AgentKit CLI 开发并部署智能体",description:"通过 AgentKit CLI 创建项目、调试 Agent,并完成部署。"},coverAlt:"{{title}}文章封面"},showcases:{researchAssistant:{title:"多智能体研究助手",description:"由多个专业 Agent 协同完成资料检索、分析和结论整理。"},multimodalAnalysis:{title:"多模态内容分析",description:"在统一会话中理解图片、文档和视频内容。"},customerService:{title:"智能客服工作台",description:"结合知识检索与工具调用处理复杂的客户服务任务。"},webSearch:{title:"联网搜索 Agent",description:"检索实时网页内容,并将信息整理为可追溯的回答。"},a2uiApp:{title:"A2UI 交互应用",description:"让 Agent 根据任务过程生成可交互的前端界面。"},previewAlt:"{{title}}界面预览"}},pfe={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},mfe={title:"管理 Agent",subtitle:"列出你有权管理的 AgentKit Runtime",mainAgentOnly:"仅显示主 Agent(控制面信息)。",deleteConfirm:'确定删除 Agent "{{name}}"?该 Runtime 将被永久删除。',regionFilterTitle:"按区域筛选",regionFilterAria:"区域筛选",regionAria:"区域",refresh:"刷新",loading:"加载中…",empty:"暂无你部署的 Agent。",connected:"已连接",connect:"连接到此 Agent",deleteRuntime:"删除该 Runtime",loadingDetail:"读取详情…",agentStructure:"Agent 结构",secretHidden:"敏感值已隐藏,点击显示",revealSecret:"显示 {{key}} 的值",fields:{model:"模型",description:"描述",status:"状态信息",project:"项目",version:"版本",resources:"资源",memory:"记忆",tool:"工具",knowledge:"知识",mcpToolset:"MCP 工具集",updatedAt:"更新时间"},resource:{memory:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",concurrency:"并发 {{value}}"},environmentVariables:"环境变量",unnamed:"(未命名)"},gfe={mainAgent:"主 Agent",subAgent:"子 Agent {{index}}",itemCount_one:"{{count}} 项",itemCount_other:"{{count}} 项",info:"Agent 信息",infoAndTopology:"Agent 信息与拓扑",loadingInfo:"正在读取 Agent 信息…",unnamedAgent:"未命名 Agent",tools:"工具",toolList:"工具列表",studioTool:"Studio Tool",removeTool:"移除工具 {{name}}",remove:"移除",notConfigured:"未配置",addStudioTool:"添加 Studio 工具",addStudioToolHere:"在此对话中添加 Studio 工具",skills:"技能",skillList:"技能列表",previewUnsupported:"暂不支持预览",sessionEnvironment:"会话环境",environment:"环境",agentCanvas:"Agent 画布",topology:"结构拓扑",viewCanvasFullscreen:"全屏查看 Agent 画布",viewFullscreen:"全屏查看",executionCanvas:"Agent 执行画布",fullscreenExecutionCanvas:"全屏 Agent 执行画布",closeFullscreenCanvas:"关闭全屏画布",close:"关闭",capabilitiesSubtitle:"能力与协作拓扑",closeInfo:"关闭 Agent 信息",infoUnavailable:"暂时无法读取 Agent 信息。"},bfe={mountFailed:"挂载环境失败",closeDialog:"关闭环境弹窗",addTitle:"添加环境",description:"选择当前会话允许 Agent 使用的 Sandbox 环境",closeAdd:"关闭添加环境",searchAria:"搜索环境",searchPlaceholder:"搜索环境名称或能力",availableAria:"可用环境与工作区",loading:"正在读取可用环境…",noMatch:"没有匹配的环境或工作区",workspaces:"工作区",reuseAll:"复用工作区中的全部可用环境",availableEnvironmentCount_one:"{{count}} 个可用环境",availableEnvironmentCount_other:"{{count}} 个可用环境",selectWorkspace:"选择工作区 {{name}}",environments:"环境",includedByWorkspaces:"已由工作区 {{names}} 包含",nameSeparator:"、",selectEnvironment:"选择环境 {{name}}",selectedWorkspaceCount_one:"{{count}} 个工作区",selectedWorkspaceCount_other:"{{count}} 个工作区",coveredEnvironmentCount_one:"{{count}} 个环境",coveredEnvironmentCount_other:"{{count}} 个环境",selectionSummary:"已选择 {{workspaces}},覆盖 {{environments}}",cancel:"取消",mounting:"正在挂载…",confirm:"确认添加",mountedAria:"已挂载环境",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",removeWorkspace:"移除工作区 {{name}}",remove:"移除",removeEnvironment:"移除环境 {{name}}",add:"添加环境",addMore:"添加更多环境",addForSession:"为当前 Session 添加环境",loadingAvailable:"正在加载可用环境…",empty:"暂无可用的 AIO Sandbox 环境。"},yfe={loading:{searching:"正在查找已有环境",creating:"环境初始化中",connecting:"正在连接已有环境"},initializationFailed:"AgentKit CLI 环境初始化失败,当前状态:{{status}}。",sessionExpired:"AgentKit CLI Session 不存在或已过期,请重试。",initializationTimeout:"AgentKit CLI 环境初始化超时,请稍后重试。",nonPersistent:"非持久化环境",recyclingHoursMinutes:"{{hours}} 小时 {{minutes}} 分钟后环境回收",recyclingMinutes:"{{minutes}} 分钟后环境回收",connectionError:`无法连接 Studio 服务,未收到服务端响应。 -原始错误:{{message}}`,unavailable:"连接不可用",requestFailed:"AgentKit CLI 请求失败",retry:"重试",terminalTitle:"AgentKit CLI 终端"},vfe={labels:{coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取"},closeDialog:"关闭弹窗",title:"添加 Studio 工具",description:"由 Studio BFF 为 {{agentName}} 的当前会话执行,Runtime 无需预装",close:"关闭添加 Studio 工具",searchAria:"搜索 Studio 工具",searchPlaceholder:"搜索名称或工具标识",availableAria:"可用 Studio 工具",loading:"正在读取 Studio 工具…",noMatch:"没有匹配的 Studio 工具",remove:"移除",add:"添加"},xfe={artifactLibrary:lfe,resourceMetadata:cfe,artifactEdit:ufe,codeBrowser:dfe,search:ffe,developerResources:hfe,library:pfe,manageAgents:mfe,agentTopology:gfe,sessionEnvironment:bfe,agentKitCli:yfe,studioTools:vfe},jMe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:yfe,agentTopology:gfe,artifactEdit:ufe,artifactLibrary:lfe,codeBrowser:dfe,default:xfe,developerResources:hfe,library:pfe,manageAgents:mfe,resourceMetadata:cfe,search:ffe,sessionEnvironment:bfe,studioTools:vfe},Symbol.toStringTag,{value:"Module"})),G8=["zh-CN","en-US"],xj="en-US",wfe="agentkit.studio.locale",RMe={"zh-CN":{dir:"ltr",nativeName:"简体中文"},"en-US":{dir:"ltr",nativeName:"English"}};function wj(e){if(!e)return null;const t=e.trim().replace(/_/g,"-").toLowerCase(),n=G8.find(i=>i.toLowerCase()===t);return n||(t==="zh"||t.startsWith("zh-")?"zh-CN":t==="en"||t.startsWith("en-")?"en-US":null)}function jd(e,t){const n=(e==null?void 0:e.trim())??"";if(!n)return"";const i=new RegExp("\\p{Script=Han}","u").test(n);return t.toLowerCase().startsWith("zh")===i?n:""}function IMe(){if(typeof window>"u")return null;try{return wj(window.localStorage.getItem(wfe))}catch{return null}}function PMe(){if(typeof window>"u")return[];const e=window.navigator;return e?e.languages.length>0?e.languages:e.language?[e.language]:[]:[]}function DMe(){const e=IMe();if(e)return e;for(const t of PMe()){const n=wj(t);if(n)return n}return xj}function MMe(e){if(!(typeof window>"u"))try{window.localStorage.setItem(wfe,e)}catch{}}function Ofe(e){typeof document>"u"||(document.documentElement.lang=e,document.documentElement.dir=RMe[e].dir)}const Pn=e=>typeof e=="string",T1=()=>{let e,t;const n=new Promise((i,r)=>{e=i,t=r});return n.resolve=e,n.reject=t,n},jP=e=>e==null?"":String(e),LMe=(e,t,n)=>{e.forEach(i=>{t[i]&&(n[i]=t[i])})},$Me=/###/g,uV=e=>e&&e.includes("###")?e.replace($Me,"."):e,dV=e=>!e||Pn(e),Yw=(e,t,n)=>{const i=Pn(t)?t.split("."):t;let r=0;for(;r{const{obj:i,k:r}=Yw(e,t,Object);if(i!==void 0||t.length===1){i[r]=n;return}let s=t[t.length-1],a=t.slice(0,t.length-1),l=Yw(e,a,Object);for(;l.obj===void 0&&a.length;)s=`${a[a.length-1]}.${s}`,a=a.slice(0,a.length-1),l=Yw(e,a,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${s}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${s}`]=n},FMe=(e,t,n,i)=>{const{obj:r,k:s}=Yw(e,t,Object);r[s]=r[s]||[],r[s].push(n)},qA=(e,t)=>{const{obj:n,k:i}=Yw(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,i))return n[i]},BMe=(e,t,n)=>{const i=qA(e,n);return i!==void 0?i:qA(t,n)},Sfe=(e,t,n)=>{for(const i in t)i!=="__proto__"&&i!=="constructor"&&(Object.prototype.hasOwnProperty.call(e,i)?Pn(e[i])||e[i]instanceof String||Pn(t[i])||t[i]instanceof String?n&&(e[i]=t[i]):Sfe(e[i],t[i],n):e[i]=t[i]);return e},pf=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),UMe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},QMe=e=>Pn(e)?e.replace(/[&<>"'\/]/g,t=>UMe[t]):e;class zMe{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const i=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,i),this.regExpQueue.push(t),i}}const VMe=[" ",",","?","!",";"],HMe=new zMe(20),qMe=(e,t,n)=>{t=t||"",n=n||"";const i=VMe.filter(a=>!t.includes(a)&&!n.includes(a));if(i.length===0)return!0;const r=HMe.getRegExp(`(${i.map(a=>a==="?"?"\\?":a).join("|")})`);let s=!r.test(e);if(!s){const a=e.indexOf(n);a>0&&!r.test(e.substring(0,a))&&(s=!0)}return s},GL=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const i=t.split(n);let r=e;for(let s=0;se==null?void 0:e.replace(/_/g,"-"),WMe={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,i;(i=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||i.call(n,console,t)}};class WA{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||WMe,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,i,r){return r&&!this.debug?null:(t=t.map(s=>Pn(s)?s.replace(/[\r\n\x00-\x1F\x7F]/g," "):s),Pn(t[0])&&(t[0]=`${i}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new WA(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new WA(this.logger,t)}}var wd=new WA;class Oj{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const r=this.observers[i].get(n)||0;this.observers[i].set(n,r+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}once(t,n){const i=(...r)=>{n(...r),this.off(t,i)};return this.on(t,i),this}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([r,s])=>{for(let a=0;a{for(let a=0;a-1&&this.options.ns.splice(n,1)}getResource(t,n,i,r={}){var u,d;const s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,a=r.ignoreJSONStructure!==void 0?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.includes(".")?l=t.split("."):(l=[t,n],i&&(Array.isArray(i)?l.push(...i):Pn(i)&&s?l.push(...i.split(s)):l.push(i)));const c=qA(this.data,l);return!c&&!n&&!i&&t.includes(".")&&(t=l[0],n=l[1],i=l.slice(2).join(".")),c||!a||!Pn(i)?c:GL((d=(u=this.data)==null?void 0:u[t])==null?void 0:d[n],i,s)}addResource(t,n,i,r,s={silent:!1}){const a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let l=[t,n];i&&(l=l.concat(a?i.split(a):i)),t.includes(".")&&(l=t.split("."),r=n,n=l[1]),this.addNamespaces(n),fV(this.data,l,r),s.silent||this.emit("added",t,n,i,r)}addResources(t,n,i,r={silent:!1}){for(const s in i)(Pn(i[s])||Array.isArray(i[s]))&&this.addResource(t,n,s,i[s],{silent:!0});r.silent||this.emit("added",t,n,i)}addResourceBundle(t,n,i,r,s,a={silent:!1,skipCopy:!1}){let l=[t,n];t.includes(".")&&(l=t.split("."),r=i,i=n,n=l[1]),this.addNamespaces(n);let c=qA(this.data,l)||{};a.skipCopy||(i=JSON.parse(JSON.stringify(i))),r?Sfe(c,i,s):c={...c,...i},fV(this.data,l,c),a.silent||this.emit("added",t,n,i)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(r=>n[r]&&Object.keys(n[r]).length>0)}toJSON(){return this.data}}var kfe={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,i,r){return e.forEach(s=>{var a;t=((a=this.processors[s])==null?void 0:a.process(t,n,i,r))??t}),t}};const Efe=Symbol("i18next/PATH_KEY");function GMe(){const e=[],t=Object.create(null);let n;return t.get=(i,r)=>{var s;return(s=n==null?void 0:n.revoke)==null||s.call(n),r===Efe?e:(e.push(r),n=Proxy.revocable(i,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Kg(e,t){const{[Efe]:n}=e(GMe()),i=(t==null?void 0:t.keySeparator)??".",r=(t==null?void 0:t.nsSeparator)??":",s=(t==null?void 0:t.enableSelector)==="strict";if(n.length>1&&r){const a=t==null?void 0:t.ns,l=s?Array.isArray(a)?a:a?[a]:null:Array.isArray(a)?a:null;if(l&&(s?l:l.length>1?l.slice(1):[]).includes(n[0]))return`${n[0]}${r}${n.slice(1).join(i)}`}return n.join(i)}const RP=e=>!Pn(e)&&typeof e!="boolean"&&typeof e!="number";class GA extends Oj{constructor(t,n={}){super(),LMe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=wd.create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const i={...n};if(t==null)return!1;const r=this.resolve(t,i);if((r==null?void 0:r.res)===void 0)return!1;const s=RP(r.res);return!(i.returnObjects===!1&&s)}extractFromKey(t,n){let i=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const a=i&&t.includes(i),l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!qMe(t,i,r);if(a&&!l){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:Pn(s)?[s]:s};const u=t.split(i);(i!==r||i===r&&this.options.ns.includes(u[0]))&&(s=u.shift()),t=u.join(r)}return{key:t,namespaces:Pn(s)?[s]:s}}translate(t,n,i){let r=typeof n=="object"?{...n}:n;if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),t==null)return"";typeof t=="function"&&(t=Kg(t,{...this.options,...r})),Array.isArray(t)||(t=[String(t)]),t=t.map(F=>typeof F=="function"?Kg(F,{...this.options,...r}):String(F));const s=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,a=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:l,namespaces:c}=this.extractFromKey(t[t.length-1],r),u=c[c.length-1];let d=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const f=r.lng||this.language,h=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return h?s?{res:`${u}${d}${l}`,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:`${u}${d}${l}`:s?{res:l,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:l;const p=this.resolve(t,r);let g=p==null?void 0:p.res;const b=(p==null?void 0:p.usedKey)||l,v=(p==null?void 0:p.exactUsedKey)||l,y=["[object Number]","[object Function]","[object RegExp]"],x=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,O=!this.i18nFormat||this.i18nFormat.handleAsObject,w=r.count!==void 0&&!Pn(r.count),k=GA.hasDefaultValue(r),S=w?this.pluralResolver.getSuffix(f,r.count,r):"",E=r.ordinal&&w?this.pluralResolver.getSuffix(f,r.count,{ordinal:!1}):"",C=w&&!r.ordinal&&r.count===0,N=C&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${S}`]||r[`defaultValue${E}`]||r.defaultValue;let _=g;O&&!g&&k&&(_=N);const j=RP(_),A=Object.prototype.toString.apply(_);if(O&&_&&j&&!y.includes(A)&&!(Pn(x)&&Array.isArray(_))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const F=this.options.returnedObjectHandler?this.options.returnedObjectHandler(b,_,{...r,ns:c}):`key '${l} (${this.language})' returned an object instead of string.`;return s?(p.res=F,p.usedParams=this.getUsedParamsDetails(r),p):F}if(a){const F=Array.isArray(_),T=F?[]:{},P=F?v:b;for(const R in _)if(Object.prototype.hasOwnProperty.call(_,R)){const L=`${P}${a}${R}`;k&&!g?T[R]=this.translate(L,{...r,defaultValue:RP(N)?N[R]:void 0,joinArrays:!1,ns:c}):T[R]=this.translate(L,{...r,joinArrays:!1,ns:c}),T[R]===L&&(T[R]=_[R])}g=T}}else if(O&&Pn(x)&&Array.isArray(g))g=g.join(x),g&&(g=this.extendTranslation(g,t,r,i));else{let F=!1,T=!1;!this.isValidLookup(g)&&k&&(F=!0,g=N),this.isValidLookup(g)||(T=!0,g=l);const R=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&T?void 0:g,L=k&&N!==g&&this.options.updateMissing;if(T||F||L){if(this.logger.log(L?"updateKey":"missingKey",f,u,w&&!L?`${l}${this.pluralResolver.getSuffix(f,r.count,r)}`:l,L?N:g),a){const H=this.resolve(l,{...r,keySeparator:!1});H&&H.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let M=[];const U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&U&&U[0])for(let H=0;H{var B;const q=k&&Q!==g?Q:R;this.options.missingKeyHandler?this.options.missingKeyHandler(H,u,K,q,L,r):(B=this.backendConnector)!=null&&B.saveMissing&&this.backendConnector.saveMissing(H,u,K,q,L,r),this.emit("missingKey",H,u,K,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?M.forEach(H=>{const K=this.pluralResolver.getSuffixes(H,r);C&&r[`defaultValue${this.options.pluralSeparator}zero`]&&!K.includes(`${this.options.pluralSeparator}zero`)&&K.push(`${this.options.pluralSeparator}zero`),K.forEach(Q=>{I([H],l+Q,r[`defaultValue${Q}`]||N)})}):I(M,l,N))}g=this.extendTranslation(g,t,r,p,i),T&&g===l&&this.options.appendNamespaceToMissingKey&&(g=`${u}${d}${l}`),(T||F)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${l}`:l,F?g:void 0,r))}return s?(p.res=g,p.usedParams=this.getUsedParamsDetails(r),p):g}extendTranslation(t,n,i,r,s){var c,u;if((c=this.i18nFormat)!=null&&c.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const d=Pn(t)&&(((u=i==null?void 0:i.interpolation)==null?void 0:u.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(d){const p=t.match(this.interpolator.nestingRegexp);f=p&&p.length}let h=i.replace&&!Pn(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),t=this.interpolator.interpolate(t,h,i.lng||this.language||r.usedLng,i),d){const p=t.match(this.interpolator.nestingRegexp),g=p&&p.length;f(s==null?void 0:s[0])===p[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${n[0]}`),null):this.translate(...p,n),i)),i.interpolation&&this.interpolator.reset()}const a=i.postProcess||this.options.postProcess,l=Pn(a)?[a]:a;return t!=null&&(l!=null&&l.length)&&i.applyPostProcessor!==!1&&(t=kfe.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),t}resolve(t,n={}){let i,r,s,a,l;return Pn(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(c=>typeof c=="function"?Kg(c,{...this.options,...n}):c)),t.forEach(c=>{if(this.isValidLookup(i))return;const u=this.extractFromKey(c,n),d=u.key;r=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const h=n.count!==void 0&&!Pn(n.count),p=h&&!n.ordinal&&n.count===0,g=n.context!==void 0&&(Pn(n.context)||typeof n.context=="number")&&n.context!=="",b=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(v=>{var y,x;this.isValidLookup(i)||(l=v,!this.checkedLoadedFor[`${b[0]}-${v}`]&&((y=this.utils)!=null&&y.hasLoadedNamespace)&&!((x=this.utils)!=null&&x.hasLoadedNamespace(l))&&(this.checkedLoadedFor[`${b[0]}-${v}`]=!0,this.logger.warn(`key "${r}" for languages "${b.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),b.forEach(O=>{var S;if(this.isValidLookup(i))return;a=O;const w=[d];if((S=this.i18nFormat)!=null&&S.addLookupKeys)this.i18nFormat.addLookupKeys(w,d,O,v,n);else{let E;h&&(E=this.pluralResolver.getSuffix(O,n.count,n));const C=`${this.options.pluralSeparator}zero`,N=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(n.ordinal&&E.startsWith(N)&&w.push(d+E.replace(N,this.options.pluralSeparator)),w.push(d+E),p&&w.push(d+C)),g){const _=`${d}${this.options.contextSeparator||"_"}${n.context}`;w.push(_),h&&(n.ordinal&&E.startsWith(N)&&w.push(_+E.replace(N,this.options.pluralSeparator)),w.push(_+E),p&&w.push(_+C))}}let k;for(;k=w.pop();)this.isValidLookup(i)||(s=k,i=this.getResource(O,v,k,n))}))})}),{res:i,usedKey:r,exactUsedKey:s,usedLng:a,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,i,r={}){var s;return(s=this.i18nFormat)!=null&&s.getResource?this.i18nFormat.getResource(t,n,i,r):this.resourceStore.getResource(t,n,i,r)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=t.replace&&!Pn(t.replace);let r=i?t.replace:t;if(i&&typeof t.count<"u"&&(r={...r,count:t.count}),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!i){r={...r};for(const s of n)delete r[s]}return r}static hasDefaultValue(t){const n="defaultValue";for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&i.startsWith(n)&&t[i]!==void 0)return!0;return!1}}class pV{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=wd.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(t){if(t=GO(t),!t||!t.includes("-"))return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=GO(t),!t||!t.includes("-"))return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Pn(t)&&t.includes("-")){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(t)}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(i=>{if(n)return;const r=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(r))&&(n=r)}),!n&&this.options.supportedLngs&&t.forEach(i=>{if(n)return;const r=this.getScriptPartFromCode(i);if(this.isSupportedCode(r))return n=r;const s=this.getLanguagePartFromCode(i);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(a=>a===s?!0:!a.includes("-")&&!s.includes("-")?!1:!!(a.includes("-")&&!s.includes("-")&&a.slice(0,a.indexOf("-"))===s||a.startsWith(s)&&s.length>1))}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),Pn(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let i=t[n];return i||(i=t[this.getScriptPartFromCode(n)]),i||(i=t[this.formatLanguageCode(n)]),i||(i=t[this.getLanguagePartFromCode(n)]),i||(i=t.default),i||[]}toResolveHierarchy(t,n){const i=this.options.fallbackLng,r=Array.isArray(i)?i.join("|"):i;r!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=r);const s=n===void 0||n===!1||Pn(n),a=n===void 0&&typeof this.options.fallbackLng=="function",l=Pn(t)&&s&&!a;let c=null;if(l){let h;n===void 0?h="undefined":n===!1?h="boolean:false":h=`string:${n}`,c=`${t.length}:${t}|${h}`}if(c!==null){const h=this.resolveHierarchyCache[c];if(h!==void 0)return h.slice()}const u=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),d=[],f=h=>{h&&(this.isSupportedCode(h)?d.push(h):this.logger.warn(`rejecting language code not found in supportedLngs: ${h}`))};return Pn(t)&&(t.includes("-")||t.includes("_"))?(this.options.load!=="languageOnly"&&f(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&f(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&f(this.getLanguagePartFromCode(t))):Pn(t)&&f(this.formatLanguageCode(t)),u.forEach(h=>{d.includes(h)||f(this.formatLanguageCode(h))}),c!==null?(this.resolveHierarchyCache[c]=d,d.slice()):d}}const mV={zero:0,one:1,two:2,few:3,many:4,other:5},gV={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class KMe{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=wd.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const i=GO(t==="dev"?"en":t),r=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:i,type:r});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let a;try{a=new Intl.PluralRules(i,{type:r})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),gV;if(!t.match(/-|_/))return gV;const c=this.languageUtils.getLanguagePartFromCode(t);a=this.getRule(c,n)}return this.pluralRulesCache[s]=a,a}needsPlural(t,n={}){let i=this.getRule(t,n);return i||(i=this.getRule("dev",n)),(i==null?void 0:i.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,i={}){return this.getSuffixes(t,i).map(r=>`${n}${r}`)}getSuffixes(t,n={}){let i=this.getRule(t,n);return i||(i=this.getRule("dev",n)),i?i.resolvedOptions().pluralCategories.sort((r,s)=>mV[r]-mV[s]).map(r=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r}`):[]}getSuffix(t,n,i={}){const r=this.getRule(t,i);return r?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${r.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,i))}}const bV=(e,t,n,i=".",r=!0)=>{let s=BMe(e,t,n);return!s&&r&&Pn(n)&&(s=GL(e,n,i),s===void 0&&(s=GL(t,n,i))),s},yV=e=>e.replace(/\$/g,"$$$$");class vV{constructor(t={}){var n;this.logger=wd.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(i=>i),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:i,useRawValueToEscape:r,prefix:s,prefixEscaped:a,suffix:l,suffixEscaped:c,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:h,nestingPrefixEscaped:p,nestingSuffix:g,nestingSuffixEscaped:b,nestingOptionsSeparator:v,maxReplaces:y,alwaysFormat:x}=t.interpolation;this.escape=n!==void 0?n:QMe,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=r!==void 0?r:!1,this.prefix=s?pf(s):a||"{{",this.suffix=l?pf(l):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f?pf(f):"-",this.unescapeSuffix=this.unescapePrefix?"":d?pf(d):"",this.nestingPrefix=h?pf(h):p||pf("$t("),this.nestingSuffix=g?pf(g):b||pf(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=y||1e3,this.alwaysFormat=x!==void 0?x:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,i)=>(n==null?void 0:n.source)===i?(n.lastIndex=0,n):new RegExp(i,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,i,r){var p;let s,a,l;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const x=bV(n,c,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(x,void 0,i,{...r,...n,interpolationkey:g}):x}const b=g.split(this.formatSeparator),v=b.shift().trim(),y=b.join(this.formatSeparator).trim();return this.format(bV(n,c,v,this.options.keySeparator,this.options.ignoreJSONStructure),y,i,{...r,...n,interpolationkey:v})};this.resetRegExp(),!this.escapeValue&&typeof t=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(t)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const d=(r==null?void 0:r.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((p=r==null?void 0:r.interpolation)==null?void 0:p.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>g},{regex:this.regexp,safeValue:g=>this.escapeValue?this.escape(g):g}].forEach(g=>{for(l=0;s=g.regex.exec(t);){const b=s[1].trim();if(a=u(b),a===void 0)if(typeof d=="function"){const y=d(t,s,r);a=Pn(y)?y:""}else if(r&&Object.prototype.hasOwnProperty.call(r,b))a="";else if(f){a=s[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${t}`),a="";else!Pn(a)&&!this.useRawValueToEscape&&(a=jP(a));const v=g.safeValue(a);if(t=t.replace(s[0],yV(v)),f?(g.regex.lastIndex+=v.length,g.regex.lastIndex-=s[0].length):g.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n,i={}){let r,s,a;const l=(c,u)=>{const d=this.nestingOptionsSeparator;if(!c.includes(d))return c;const f=c.split(new RegExp(`${pf(d)}[ ]*{`));let h=`{${f[1]}`;c=f[0],h=this.interpolate(h,a);const p=h.match(/'/g),g=h.match(/"/g);(((p==null?void 0:p.length)??0)%2===0&&!g||((g==null?void 0:g.length)??0)%2!==0)&&(h=h.replace(/'/g,'"'));try{a=JSON.parse(h),u&&(a={...u,...a})}catch(b){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,b),`${c}${d}${h}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,c};for(;r=this.nestingRegexp.exec(t);){let c=[];a={...i},a=a.replace&&!Pn(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const u=/{.*}/s.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(u!==-1&&(c=r[1].slice(u).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),r[1]=r[1].slice(0,u)),s=n(l.call(this,r[1].trim(),a),a),s&&r[0]===t&&!Pn(s))return s;Pn(s)||(s=jP(s)),s||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${t}`),s=""),c.length&&(s=c.reduce((d,f)=>this.format(d,f,i.lng,{...i,interpolationkey:r[1].trim()}),s.trim())),t=t.replace(r[0],yV(jP(s))),this.regexp.lastIndex=0}return t}}const XMe=e=>{let t=e.toLowerCase().trim();const n={};if(e.includes("(")){const i=e.split("(");t=i[0].toLowerCase().trim();const r=i[1].slice(0,-1);t==="currency"&&!r.includes(":")?n.currency||(n.currency=r.trim()):t==="relativetime"&&!r.includes(":")?n.range||(n.range=r.trim()):r.split(";").forEach(a=>{if(a){const[l,...c]=a.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),d=l.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},xV=e=>{const t={};return(n,i,r)=>{let s=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(s={...s,[r.interpolationkey]:void 0});const a=i+JSON.stringify(s);let l=t[a];return l||(l=e(GO(i),r),t[a]=l),l(n)}},YMe=e=>(t,n,i)=>e(GO(n),i)(t);class ZMe{constructor(t={}){this.logger=wd.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const i=n.cacheInBuiltFormats?xV:YMe;this.formats={number:i((r,s)=>{const a=new Intl.NumberFormat(r,{...s});return l=>a.format(l)}),currency:i((r,s)=>{const a=new Intl.NumberFormat(r,{...s,style:"currency"});return l=>a.format(l)}),datetime:i((r,s)=>{const a=new Intl.DateTimeFormat(r,{...s});return l=>a.format(l)}),relativetime:i((r,s)=>{const a=new Intl.RelativeTimeFormat(r,{...s});return l=>a.format(l,s.range||"day")}),list:i((r,s)=>{const a=new Intl.ListFormat(r,{...s});return l=>a.format(l)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=xV(n)}format(t,n,i,r={}){if(!n||t==null)return t;const s=n.split(this.formatSeparator),a=[];for(let c=0;c-1&&!u.includes(")")&&c+1{var h;const{formatName:d,formatOptions:f}=XMe(u);if(this.formats[d]){let p=c;try{const g=((h=r==null?void 0:r.formatParams)==null?void 0:h[r.interpolationkey])||{},b=g.locale||g.lng||r.locale||r.lng||i;p=this.formats[d](c,b,{...f,...r,...g})}catch(g){this.logger.warn(g)}return p}else this.logger.warn(`there was no format function for ${d}`);return c},t)}}const JMe=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class e5e extends Oj{constructor(t,n,i,r={}){var s,a;super(),this.backend=t,this.store=n,this.services=i,this.languageUtils=i.languageUtils,this.options=r,this.logger=wd.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],(a=(s=this.backend)==null?void 0:s.init)==null||a.call(s,i,r.backend,r)}queueLoad(t,n,i,r){const s={},a={},l={},c={};return t.forEach(u=>{let d=!0;n.forEach(f=>{const h=`${u}|${f}`;!i.reload&&this.store.hasResourceBundle(u,f)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?a[h]===void 0&&(a[h]=!0):(this.state[h]=1,d=!1,a[h]===void 0&&(a[h]=!0),s[h]===void 0&&(s[h]=!0),c[f]===void 0&&(c[f]=!0)))}),d||(l[u]=!0)}),(Object.keys(s).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(s),pending:Object.keys(a),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(c)}}loaded(t,n,i){const r=t.split("|"),s=r[0],a=r[1];n&&this.emit("failedLoading",s,a,n),!n&&i&&this.store.addResourceBundle(s,a,i,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&i&&(this.state[t]=0);const l={};this.queue.forEach(c=>{FMe(c.loaded,[s],a),JMe(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{l[u]||(l[u]={});const d=c.loaded[u];d.length&&d.forEach(f=>{l[u][f]===void 0&&(l[u][f]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(c=>!c.done)}read(t,n,i,r=0,s=this.retryTimeout,a){if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:i,tried:r,wait:s,callback:a});return}this.readingCalls++;const l=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&r{this.read(t,n,i,r+1,s*2,a)},s);return}a(u,d)},c=this.backend[i].bind(this.backend);if(c.length===2){try{const u=c(t,n);u&&typeof u.then=="function"?u.then(d=>l(null,d)).catch(l):l(null,u)}catch(u){l(u)}return}return c(t,n,l)}prepareLoading(t,n,i={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();Pn(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Pn(n)&&(n=[n]);const s=this.queueLoad(t,n,i,r);if(!s.toLoad.length)return s.pending.length||r(),null;s.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,i){this.prepareLoading(t,n,{},i)}reload(t,n,i){this.prepareLoading(t,n,{reload:!0},i)}loadOne(t,n=""){const i=t.split("|"),r=i[0],s=i[1];this.read(r,s,"read",void 0,void 0,(a,l)=>{a&&this.logger.warn(`${n}loading namespace ${s} for language ${r} failed`,a),!a&&l&&this.logger.log(`${n}loaded namespace ${s} for language ${r}`,l),this.loaded(t,a,l)})}saveMissing(t,n,i,r,s,a={},l=()=>{}){var c,u,d,f,h;if((u=(c=this.services)==null?void 0:c.utils)!=null&&u.hasLoadedNamespace&&!((f=(d=this.services)==null?void 0:d.utils)!=null&&f.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${i}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if((h=this.backend)!=null&&h.create){const p={...a,isUpdate:s},g=this.backend.create.bind(this.backend);if(g.length<6)try{let b;g.length===5?b=g(t,n,i,r,p):b=g(t,n,i,r),b&&typeof b.then=="function"?b.then(v=>l(null,v)).catch(l):l(null,b)}catch(b){l(b)}else g(t,n,i,r,l,p)}!t||!t[0]||this.store.addResource(t[0],n,i,r)}}}const IP=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Pn(e[1])&&(t.defaultValue=e[1]),Pn(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(i=>{t[i]=n[i]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),wV=e=>(Pn(e.ns)&&(e.ns=[e.ns]),Pn(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Pn(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),TC=()=>{},t5e=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Zw extends Oj{constructor(t={},n){if(super(),this.options=wV(t),this.services={},this.logger=wd,this.modules={external:[]},t5e(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(Pn(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const i=IP();this.options={...i,...this.options,...wV(t)},this.options.interpolation={...i.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler);const r=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?wd.init(r(this.modules.logger),this.options):wd.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=ZMe;const d=new pV(this.options);this.store=new hV(this.options.resources,this.options);const f=this.services;f.logger=wd,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new KMe(d,{prepend:this.options.pluralSeparator}),u&&(f.formatter=r(u),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new vV(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new e5e(r(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(h,...p)=>{this.emit(h,...p)}),this.modules.languageDetector&&(f.languageDetector=r(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=r(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new GA(this.services,this.options),this.translator.on("*",(h,...p)=>{this.emit(h,...p)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,n||(n=TC),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...d)=>this.store[u](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...d)=>(this.store[u](...d),this)});const l=T1(),c=()=>{const u=(d,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(f),n(d,f)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),l}loadResources(t,n=TC){var s,a;let i=n;const r=Pn(t)?t:this.language;if(typeof t=="function"&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if((r==null?void 0:r.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const l=[],c=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&(l.includes(f)||l.push(f))})};r?c(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>c(d)),(a=(s=this.options.preload)==null?void 0:s.forEach)==null||a.call(s,u=>c(u)),this.services.backendConnector.load(l,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(u)})}else i(null)}reloadResources(t,n,i){const r=T1();return typeof t=="function"&&(i=t,t=void 0),typeof n=="function"&&(i=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),i||(i=TC),this.services.backendConnector.reload(t,n,s=>{r.resolve(),i(s)}),r}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&kfe.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!["cimode","dev"].includes(t)){for(let n=0;n{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},s=(l,c)=>{c?this.isLanguageChangingTo===t&&(r(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,i.resolve((...u)=>this.t(...u)),n&&n(l,(...u)=>this.t(...u))},a=l=>{var d,f;!t&&!l&&this.services.languageDetector&&(l=[]);const c=Pn(l)?l:l&&l[0],u=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(Pn(l)?[l]:l);u&&(this.language||r(u),this.translator.language||this.translator.changeLanguage(u),(f=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||f.call(d,u)),this.loadResources(u,h=>{s(h,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t),i}getFixedT(t,n,i,r){const s=r==null?void 0:r.scopeNs,a=(l,c,...u)=>{let d;typeof c!="object"?d=this.options.overloadTranslationOptionHandler([l,c].concat(u)):d={...c},d.lng=d.lng||a.lng,d.lngs=d.lngs||a.lngs;const f=d.ns!==void 0&&d.ns!==null;d.ns=d.ns||a.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||i||a.keyPrefix);const h={...this.options,...d};Array.isArray(s)&&!f&&(h.ns=s),typeof d.keyPrefix=="function"&&(d.keyPrefix=Kg(d.keyPrefix,h));const p=this.options.keySeparator||".";let g;return d.keyPrefix&&Array.isArray(l)?g=l.map(b=>(typeof b=="function"&&(b=Kg(b,h)),`${d.keyPrefix}${p}${b}`)):(typeof l=="function"&&(l=Kg(l,h)),g=d.keyPrefix?`${d.keyPrefix}${p}${l}`:l),this.t(g,d)};return Pn(t)?a.lng=t:a.lngs=t,a.ns=n,a.keyPrefix=i,a}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=n.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const a=(l,c)=>{const u=this.services.backendConnector.state[`${l}|${c}`];return u===-1||u===0||u===2};if(n.precheck){const l=n.precheck(this,a);if(l!==void 0)return l}return!!(this.hasResourceBundle(i,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(i,t)&&(!r||a(s,t)))}loadNamespaces(t,n){const i=T1();return this.options.ns?(Pn(t)&&(t=[t]),t.forEach(r=>{this.options.ns.includes(r)||this.options.ns.push(r)}),this.loadResources(r=>{i.resolve(),n&&n(r)}),i):(n&&n(),Promise.resolve())}loadLanguages(t,n){const i=T1();Pn(t)&&(t=[t]);const r=this.options.preload||[],s=t.filter(a=>!r.includes(a)&&this.services.languageUtils.isSupportedCode(a));return s.length?(this.options.preload=r.concat(s),this.loadResources(a=>{i.resolve(),n&&n(a)}),i):(n&&n(),Promise.resolve())}dir(t){var r,s;if(t||(t=this.resolvedLanguage||(((r=this.languages)==null?void 0:r.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const a=new Intl.Locale(t);if(a&&a.getTextInfo){const l=a.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=((s=this.services)==null?void 0:s.languageUtils)||new pV(IP());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.includes(i.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const i=new Zw(t,n);return i.createInstance=Zw.createInstance,i}cloneInstance(t={},n=TC){const i=t.forkResourceStore;i&&delete t.forkResourceStore;const r={...this.options,...t,isClone:!0},s=new Zw(r);if((t.debug!==void 0||t.prefix!==void 0)&&(s.logger=s.logger.clone(t)),["store","services","language"].forEach(l=>{s[l]=this[l]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},i){const l=Object.keys(this.store.data).reduce((c,u)=>(c[u]={...this.store.data[u]},c[u]=Object.keys(c[u]).reduce((d,f)=>(d[f]={...c[u][f]},d),c[u]),c),{});s.store=new hV(l,r),s.services.resourceStore=s.store}if(t.interpolation){const c={...IP().interpolation,...this.options.interpolation,...t.interpolation},u={...r,interpolation:c};s.services.interpolator=new vV(u)}return s.translator=new GA(s.services,r),s.translator.on("*",(l,...c)=>{s.emit(l,...c)}),s.init(r,n),s.translator.options=r,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Ho=Zw.createInstance();Ho.createInstance;Ho.dir;Ho.init;Ho.loadResources;Ho.reloadResources;Ho.use;Ho.changeLanguage;Ho.getFixedT;Ho.t;Ho.exists;Ho.setDefaultNamespace;Ho.hasLoadedNamespace;Ho.loadNamespaces;Ho.loadLanguages;var Cfe={exports:{}},Gn={};/** +{{value}}`,original:"原始错误:{{message}}",details:"详细信息"},dde={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},fde={close:"关闭",name:"名称",region:"地域",optionalDescription:"描述(可选)",cancel:"取消",create:"创建",creating:"创建中…",save:"保存",saving:"保存中…",upload:"上传",uploading:"上传中…",createSpaceTitle:"新建 Skill 空间",editSpaceTitle:"编辑 Skill 空间",uploadTitle:"上传到 {{name}}",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",archiveValidationFailed:"Skill ZIP 格式校验失败",uploadFailed:"上传 Skill 失败",dropzone:"拖拽 Skill ZIP 到这里",chooseLocalFile:"或点击选择本地文件",archiveHelp:"ZIP 根目录需要包含 SKILL.md,也可以只包含一层包装目录。选择后仅检查格式,不会自动上传。",validating:"正在检查文件格式…",validationPassed:"格式检查通过:{{name}},共 {{count}} 个文件"},hde={styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先",custom:"自定义",customFallback:"自定义风格"},stages:{preparing:"正在准备 Dev Sandbox",ready:"Skill 已生成并通过格式校验",failed:"生成失败",cancelled:"已停止",validating:"正在校验 Skill 格式",packaging:"正在整理文件",generating:"正在生成 Skill",repairingAgain:"正在再次修复",autoRepairing:"正在自动修复({{attempt}}/{{max}})"},validation:{fallback:"Skill 格式校验未通过",repairInstruction:"只修复下面列出的 Skill 格式错误,不要改变原有用途和内容范围。",recheckInstruction:"修复后重新检查目录结构、SKILL.md frontmatter 和所有文本文件。",nameTooLong:"Skill 名称不能超过 64 个字符",invalidName:"Skill 名称只能包含小写字母、数字和连字符",modelTooLong:"模型 ID 不能超过 128 个字符",invalidModel:"模型 ID 只能包含字母、数字、点、下划线、连字符、斜杠和冒号"},errors:{loadCapability:"读取 Dev Sandbox 配置失败",autoRepair:"自动修复格式错误失败",pollCandidate:"读取候选方案状态失败,正在重试",createCandidate:"创建候选方案失败",refine:"继续调整失败",repairAgain:"再次修复格式错误失败",selectSpace:"请选择上传的 Skill Space",unsupportedRegion:"当前 Skill 地域不受支持",upload:"上传 Skill 失败",download:"下载失败"},sessionMax:"Session 最长保留 1 小时",remaining:"剩余 {{minutes}}:{{seconds}}",unnamedSpace:"未命名 Skill Space",leaveConfirmation:"离开后将停止并释放正在运行的 Dev Sandbox,确定离开吗?",createTitle:"创建技能",optimizeTitle:"优化 {{name}}",skillFallback:"技能",back:"返回技能空间",home:"主页技能生成",basicInfo:"基本信息",goal:"目标",createIntentPlaceholder:"描述希望这个 Skill 完成什么任务",optimizeIntentPlaceholder:"描述希望如何优化当前 Skill",skillName:"Skill 名称",autoNamePlaceholder:"留空时自动生成",nameHelp:"仅支持小写字母、数字和连字符;留空时自动生成。",createPlans:"生成方案",optimizePlans:"优化方案",createPlansDescription:"按不同方案并行生成多个技能,您可以选择最佳结果",optimizePlansDescription:"按不同方案并行优化当前技能,您可以选择最佳结果",plan:"方案 {{count}}",remove:"移除",model:"模型",modelPlaceholder:"选择或输入模型 ID",style:"风格",customStyle:"自定义风格",customStylePlaceholder:"描述表达方式、严谨程度或输出偏好",addConfiguration:"添加配置",notConfigured:"管理员未配置",generate:"生成",candidates:"候选方案",progress:"进度",retryCandidate:"重试此方案",formatValidationFailed:"格式校验未通过",repairAgain:"再次修复",files:"文件",downloadZip:"下载 ZIP",loadingFiles:"正在读取文件…",filesPending:"生成过程中会在这里显示完整文件树",uploadToSpace:"上传到 Skill Space",loadingSpaces:"正在加载 Skill Space",selectSpace:"选择 Skill Space",continuePlaceholder:"继续调整这个候选方案",continue:"继续调整",uploading:"上传中…",overwrite:"覆盖原 Skill",uploadToSelectedSpace:"上传到 Skill Space",uploadToCurrentSpace:"上传到当前空间",allCandidatesFailed:"所有方案均创建失败,可分别重试。"},pde={invalidFormat:"{{label}}格式错误。",recoveryStatus:"Skill 恢复点状态",errorResponse:"错误响应",errorDetails:"错误详情",missingContentType:"Content-Type 缺失",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},Content-Type: {{contentType}}),请检查代理或网关配置。",activity:"Skill 会话活动",invalidActivity:"Skill 会话活动格式错误。",invalidToolActivity:"Skill 工具活动格式错误。",invalidTextActivity:"Skill 文本活动格式错误。",publication:"Skill 发布结果",task:"Skill 会话",file:"Skill 文件",unknownTaskState:"Skill 会话状态无法识别。",capability:"Skill 工作台能力",loadCapability:"读取 Skill 工作台能力失败",prepareTask:"准备 Skill 会话失败",taskReference:"Skill 会话引用",startOptimization:"开始优化 Skill 失败",startTask:"开始 Skill 会话失败",taskSummary:"Skill 会话摘要",taskList:"Skill 会话列表",loadTaskList:"读取 Skill 会话列表失败",invalidTaskList:"Skill 会话列表格式错误。",loadTask:"读取 Skill 会话失败",artifact:"Skill 产物",artifactFile:"Skill 产物文件",loadArtifact:"读取 Skill 产物失败",refine:"继续调整 Skill 失败",stop:"停止当前 Skill 任务失败",publish:"发布 Skill 失败",nonNdjson:"发布 Skill 失败:服务端返回了非 NDJSON 响应。",missingStream:"发布 Skill 失败:服务端没有返回进度流。",publishProgress:"发布进度",invalidPublishProgress:"发布进度格式错误。",publishError:"发布错误",unknownPublishEvent:"未知的发布进度事件。",publishResult:"发布结果",streamEnded:"发布进度流提前结束,无法确认发布结果。请刷新技能中心确认状态。",deleteTask:"删除 Skill 会话失败",download:"下载 Skill 失败"},mde={configSelect:lde,conversation:cde,errorDetails:ude,fileTree:dde,management:fde,generation:hde,api:pde},CMe=Object.freeze(Object.defineProperty({__proto__:null,api:pde,configSelect:lde,conversation:cde,default:mde,errorDetails:ude,fileTree:dde,generation:hde,management:fde},Symbol.toStringTag,{value:"Module"})),gde={back:"返回上一页",reload:"重新加载",notConfigured:"未配置",name:"名称",description:"描述",delete:"删除",save:"保存",saving:"保存中",add:"添加",manage:"管理",environment:"环境",noDescription:"暂无描述",refresh:"刷新",close:"关闭",retry:"重试",loading:"加载中…",previousPage:"上一页",nextPage:"下一页",edit:"编辑",all:"全部",search:"搜索",cancel:"取消",view:"查看",viewDetails:"查看详情",deleting:"删除中…",create:"创建",creating:"创建中",adding:"添加中",generating:"生成中",uploading:"上传中",preview:"预览",loadFailed:"加载失败",select:"选择",collapse:"收起",expand:"展开",none:"无"},bde={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},yde={checkUpdates:"检查更新",checkingVersions:"正在检查版本…",versionCheckError:"查询沙箱版本失败,请检查凭据、区域及接口权限后重试",sandboxUpdateError:"Sandbox 更新失败,请刷新检查实际状态后重试",modelEnvRepairUnavailable:"无法补齐模型环境变量,请检查 CODEX_API_KEY 和 CODEX_BASE_URL",updateSandbox:"更新{{variant}}{{name}}",updatingSandbox:"更新中",title:"系统信息",description:"查看当前 Studio 版本及关联的基础资源",general:"通用",currentVersion:"当前版本",storage:"存储",loadingStorage:"正在加载存储信息",tosAddress:"TOS 地址",openTosConsole:"在云控制台中打开 TOS 存储桶",environmentBuild:"环境构建",loadingEnvironmentResources:"正在加载环境构建资源",environmentResourcesError:"环境构建资源加载失败,请检查云凭据后重试。",codePipelineWorkspace:"CodePipeline 工作空间",codePipelinePipeline:"CodePipeline 流水线",openCodePipelineWorkspace:"在云控制台中打开 CodePipeline Workspace",createdOnFirstBuild:"首次构建时自动创建",containerRegistryRepository:"Container Registry 仓库",openContainerRegistryRepository:"在云控制台中打开 Container Registry 仓库",sandboxInfo:"沙箱信息",loadingSandboxInfo:"正在加载沙箱信息",sandboxInfoError:"沙箱信息加载失败,请重试。",snapshot:"快照版",snapshotWithSpace:"快照版 ",openToolConsole:"在云控制台中打开{{name}}",updateModelEnv:"更新{{variant}}{{name}}模型环境变量",modelEnvUpdated:"已更新",modelEnvAlreadyCurrent:"无需更新",userPool:"用户池",loadingUserPool:"正在加载用户池",userPoolError:"用户池加载失败,请重试。",modelEnvUpdateError:"模型环境变量更新失败,请重试。",openUserPoolConsole:"在云控制台中打开用户池{{name}}",unnamedUserPool:"未命名用户池",id:"ID",domain:"域名",region:"区域",noLocalUserPool:"本地模式未配置用户池",noUserPool:"当前 Studio 未配置用户池"},vde={workspace:"Agent 工作区",library:"Agent 库",evaluation:"评测",agentList:"Agent 列表",agentDetails:"Agent 详情",newAgent:"新建 Agent",loading:"加载中…",loadingCloudAgents:"正在加载云端 Agent…",noAgentSelected:"请选择一个 Agent",local:"本地",remote:"云端",localAgent:"本地 Agent",remoteAgent:"云端 Agent",agentCount:"{{count}} 个 Agent",agentCountLabel:"Agent 数量",details:"详情",chat:"对话",update:"更新",backToAgentList:"返回 Agent 列表",loadingAgent:"正在加载 Agent",loadingAgentDescription:"正在读取 Agent 配置和 Runtime 信息。",loadingAgentInfo:"正在加载 Agent 信息…",detailLoadFailed:"无法加载 Agent 详情",detailLoadFailedDescription:"请检查 Runtime 状态后重试。",partialInfoUnavailable:"部分信息暂时不可用",upgradeRuntimeForDetails:"请升级 Runtime 以查看完整 Agent 信息。",basicInfo:"基本信息",usageOverview:"使用概览",sections:{basic:"基本信息",usage:"使用概览",evaluations:"评测",optimizations:"优化建议",integrations:"集成",versions:"版本"},evaluationGroup:"评测组",optimizations:"优化建议",optimizationsDescription:"根据评测结果查看可执行的优化建议。",integrations:"集成",githubVersions:"GitHub 版本",githubVersionsDescription:"查看持续交付产生的版本并创建回退 PR。",currentVersionOnly:"当前未启用 GitHub 持续交付,仅展示当前生产版本。",loadingVersions:"正在加载版本…",noVersion:"暂无版本记录",prLink:"Pull Request",viewPr:"查看 PR",author:"提交人",publishStatus:"发布状态",viewRelease:"查看发布记录",rollbackToVersion:"回退到此版本",rollingBack:"正在创建回退…",rollbackEvent:"回退事件",sourceMergedRuntimeStill:"最新源码已合并,但 Runtime 仍处于",currentProductionVersionHint:";当前生产版本保持不变。",usageSummary:"使用统计",totalCalls:"总调用次数",userCount:"用户数",userDetails:"用户明细",usageUserList:"Agent 使用用户列表",user:"用户",callCount:"调用次数",lastUsed:"最近使用",unknownUser:"未知用户",loadingUsage:"正在加载使用数据…",refreshing:"刷新中…",noUsage:"暂无使用记录",usageUnavailable:"当前 Agent 暂无可用的使用统计。",usagePagination:"使用记录分页",pageOf:"第 {{page}} / {{total}} 页",notProvided:"暂未提供",integrationMethods:"集成方式",integrationDescription:"通过 Runtime API 或 A2A 协议集成当前 Agent。",integrationProtocol:"集成协议",runtimeStatus:"Runtime 状态",executionFlow:"执行流程",probingIntegration:"正在检测集成能力",probingIntegrationDescription:"正在读取可用端点和鉴权配置。",configurationStatus:"配置状态",discoveryEndpoint:"发现端点",invocationEndpoint:"调用端点",invocationUrl:"调用地址",authentication:"鉴权方式",networkAccess:"网络访问",notAvailable:"暂无",noAuthentication:"无需鉴权",noApiKeyRequired:"无需 API Key",usesOauthJwt:"使用 OAuth / JWT",showApiKey:"显示 API Key",hideApiKey:"隐藏 API Key",pythonExample:"Python 示例",deploymentConfig:"部署配置",deploymentConfigDescription:"确认实例和运行配置后更新 Runtime。",deploymentRegion:"部署区域",concurrency:"并发数",selectedOptimizations:"已选优化项",selectedOptimizationsDescription:"这些优化会应用到本次更新。",optimizationProfile:"优化方案",updatePending:"等待更新",updatingDeployment:"正在更新部署",restoringUpdateConfig:"正在恢复更新配置…",updateConfigUnavailable:"无法读取更新配置",legacyConfigMissing:"旧版本 Runtime 缺少可恢复的配置,请重新创建。",deploymentFailed:"部署失败",continueEditing:"继续编辑",loadingOptimizations:"正在加载优化建议…",noOptimizations:"暂无优化建议",fixPriority:"优先级",suggestedModule:"建议模块",suggestionAndReason:"建议与原因",priority:{high:"高",medium:"中",low:"低"},modules:{agentStructure:"Agent 结构",prompt:"提示词",tool:"工具",knowledge:"知识库",memory:"记忆",workflow:"工作流",other:"其他"},evaluationGroupList:"评测组列表",newEvaluationGroup:"新建评测组",newEvaluationGroupName:"新评测组 {{count}}",searchEvaluationGroups:"搜索评测组",noMatchingEvaluationGroups:"没有匹配的评测组",noEvaluationGroupSelected:"请选择一个评测组",groupStats:"{{agents}} 个 Agent · {{runs}} 次运行",evaluationGroupDetails:"评测组详情",evaluationGroupStats:"{{agents}} 个 Agent · {{caseSet}} · {{runs}} 次运行",startEvaluation:"开始评测",evaluationConfig:"评测配置",historyResults:"历史结果",participatingAgents:"参与 Agent",selectedCount:"已选择 {{count}} 个",evaluationResources:"评测资源",evaluationSet:"评测集",evaluator:"评估器",caseCount:"{{count}} 条案例",evaluationMetrics:"评测指标",selectedMetricCount:"已选择 {{count}} 项",historyDescription:"查看每次评测的分数和运行状态。",noHistory:"暂无评测历史",noHistoryDescription:"运行一次评测后,结果会显示在这里。",evaluationRun:"第 {{index}} 次评测",evaluationRunMeta:"{{time}} · {{agents}} 个 Agent",overallScore:"综合分",completed:"已完成",evaluationDefaults:{coreRegression:"核心能力回归",safetyCheck:"安全与幻觉检查",coreSet:"核心回归集",safetySet:"安全边界集",toolSet:"工具调用集",qualityEvaluator:"综合质量评估器",factualEvaluator:"事实一致性评估器",toolEvaluator:"工具调用评估器",responseQuality:"回答质量",factualAccuracy:"事实准确性",toolUse:"工具调用",responseEfficiency:"响应效率",todayTime:"今天 10:32",yesterdayTime:"昨天 16:08",julyTime:"7 月 25 日 14:20",justNow:"刚刚"},defaultCases:{agentName:"示例 Agent",goodSetName:"示例正向案例集",badSetName:"示例负向案例集",weeklyFeedback:{input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",tag:"总结",reason:"任务完整覆盖了用户目标,输出结构清晰,并给出了可执行的下一步动作。"},research:{input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",tag:"工具调用"},uncertainConclusion:{input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",tag:"幻觉",reason:"信息不足时仍给出了确定结论,缺少必要的澄清步骤与不确定性说明。"},repeatedTool:{input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",tag:"效率"}},goodCases:"正向案例",badCases:"负向案例",goodCase:"正向案例",badCase:"负向案例",reference:"参考答案",caseResultFilter:"案例结果筛选",feedbackSourceFilter:"反馈来源筛选",searchCases:"搜索案例",searchCasesPlaceholder:"搜索输入、输出或标签",selectCases:"选择案例",selectAll:"全选",selectAllVisible:"选择当前可见案例",selectedCaseCount:"已选择 {{count}} 条",deleteSelected:"删除所选",deleteSelectedTitle:"删除所选 Agent",deleteSelectionDescription:"确定删除所选的 {{count}} 个项目吗?此操作无法撤销。",deleteCasesConfirm:"删除所选案例",deleteOneCaseConfirm:"删除这个案例",deleteFeedbackCase:"删除反馈案例",noFeedbackCases:"暂无反馈案例",noMatchingCases:"没有匹配的案例",loadingEvaluationSet:"正在加载评测集…",userInput:"用户输入",agentOutput:"Agent 输出",score:"得分",scoreReason:"评分原因",noUserInput:"暂无用户输入",noVisibleResponse:"暂无可见回复",note:"备注:",manualFeedback:"人工反馈",automaticFeedback:"自动反馈",scoreValue:"{{score}} 分",unknownTime:"时间未知",deleteAgentTitle:"删除 Agent",deleteAgentDescription:"确定删除 Agent“{{name}}”吗?",deleteDraftDescription:"确定删除草稿“{{name}}”吗?",deleteAgent:"删除 Agent",closeDeleteConfirmation:"关闭删除确认",draftDeletionWarning:"草稿将从当前浏览器中删除。",runtimeDeletionWarning:"Runtime 和相关云端资源将被删除。",noneSelected:"尚未选择",none:"无",notPublished:"未发布",notRecorded:"未记录",noTime:"暂无时间",noPr:"暂无 PR",comingSoon:"评测能力即将开放",preparing:"准备中",cancelled:"已取消",failed:"失败",totalCount:"共 {{count}} 条",deploymentProgress:"部署进度",returnToEdit:"返回编辑",buildLog:"构建日志",githubMountLog:"GitHub 挂载日志",githubDeliveryMountLog:"GitHub 持续交付挂载日志",waitingBuildLog:"正在等待构建日志…",waitingGithubMountLog:"正在等待 GitHub 挂载日志…",copy:"复制",copied:"已复制",copyLabel:"复制{{label}}",copiedLabel:"已复制{{label}}",logLines:"{{count}} 行",logStatus:{synced:"已同步",failed:"读取失败",syncing:"同步中",earlyOmitted:"已省略早期日志",recentOnly:"仅显示最近的构建日志",partiallyOmitted:"已省略部分日志"},deployStatus:{running:"正在部署",unconfirmed:"部署状态待确认",success:"部署完成",error:"部署失败",cancelled:"部署已取消"},deploymentSteps:{prepare:{label:"准备部署",description:"校验配置并创建部署任务"},build:{label:"构建镜像",description:"生成运行环境与智能体代码"},deploy:{label:"部署服务",description:"创建并启动 AgentKit Runtime"},publish:{label:"发布服务",description:"等待服务就绪并生成访问地址"},complete:{label:"部署完成",description:"智能体已可以正常使用"},evaluation:{label:"创建评测集",description:"自动创建 Good Case 和 Bad Case 评测集"},github:{label:"挂载 GitHub 持续交付",description:"初始化目标分支与 GitHub Actions workflow"},update:{label:"更新实例配置",description:"将 Runtime 实例数调整为 {{min}}~{{max}}"}},githubStatus:{published:"已发布",publishing:"发布中",failed:"发布失败",pending:"等待发布",unknown:"未知"},errors:{agentInfoMissing:"Agent 信息不可用",checkUpdateCapability:"无法检查更新能力",checkingUpdateConfig:"正在检查更新配置",cloudOnlyUpdate:"仅云端 Agent 支持更新",deleteDeployedUnsupported:"当前不支持删除已部署 Agent",deleteDraftUnsupported:"当前不支持删除草稿",loadAgentInfo:"无法加载 Agent 信息",loadApiKey:"无法读取 API Key",loadGithubVersions:"无法加载 GitHub 版本",loadEvaluations:"无法加载评测案例",loadOptimizations:"无法加载优化建议",loadRuntimeDetails:"无法加载 Runtime 详情",loadUsage:"无法加载使用数据",noCreatePermission:"当前账号没有创建 Agent 的权限",noManagePermission:"当前账号没有管理此 Agent 的权限",originalConfigUnavailable:"原始配置不可用",probeIntegration:"无法检测集成能力",rollbackVersion:"无法创建版本回退",runtimeRegionMissing:"Runtime 区域信息缺失",updateCapabilityMismatch:"Runtime 更新能力与当前配置不匹配",updateCapabilityPending:"Runtime 更新能力仍在确认中",updateConfigRestoring:"正在恢复更新配置",updateUnsupported:"当前 Runtime 不支持更新",usageMismatch:"返回的使用数据与当前 Agent 不匹配"}},xde={title:"环境",loadFailed:"环境加载失败,请检查存储配置后重试。",create:"新建环境",configure:"配置环境",details:"环境详情",editorDescription:"配置运行环境,或接入代码仓库和已有镜像",backToList:"返回环境列表",save:"保存环境",createAndBuild:"创建并构建",saveAndBuild:"保存并构建",name:"环境名称",namePlaceholder:"Python 数据处理",descriptionPlaceholder:"说明这个环境适合处理的任务",creationMethod:"创建方式",baseConfiguration:"基础配置",baseEnvironment:"基础环境",operatingSystem:"操作系统",pythonVersion:"Python 版本",fixedByBase:"由 {{base}} 固定为 {{value}}",selectUbuntuVersion:"选择基础镜像的 Ubuntu 版本",selectPythonVersion:"选择需要安装的 Python 版本",skills:"技能",addSkill:"添加环境技能",veadkDescription:"Agent 开发与运行框架",customDockerfile:"自定义 Dockerfile",presetEnvironment:"预制环境",presetHint:"选择“无”可自行填写 Dockerfile 第一行的基础镜像。",dockerfileSize:"{{size}} / {{max}} 字节",upload:"上传",reset:"重置",dockerfileBaseImage:"Dockerfile 基础镜像",dockerfileContent:"Dockerfile 内容",region:"区域",search:"搜索环境",manualImport:"手动导入",noMatches:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称",startBuild:"开始构建",build:"构建",unnamed:"未命名环境",listSeparator:"、",clipboardReadError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",creation:{custom:{label:"自定义配置",description:"通过表单选择基础环境、Python、工具和技能"},dockerfile:{label:"自定义 Dockerfile",description:"上传或直接编辑 Dockerfile"},git:{label:"从代码仓库构建",description:"探查公开仓库并通过 CodePipeline 构建"},image:{label:"使用已有镜像",description:"绑定由外部流水线交付的 CR 镜像"}},baseDescriptions:{"aio-sandbox":"内置 Sandbox Shell 能力 · Ubuntu 22.04","codex-sandbox":"内置 Codex CLI、浏览器与代码执行环境",ubuntu:"标准 Linux 基础镜像"},dockerfileValidation:{baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"},presets:{none:"自行填写 Dockerfile 基础镜像",aio:"内置 Sandbox Shell 与常用运行时",codex:"内置 Codex CLI、浏览器与代码执行环境"},categories:{tools:"工具",productivity:"效率",browser:"浏览器自动化",system:"系统与媒体"},options:{"lark-cli":"飞书开放平台命令行工具",pandoc:"文档格式转换工具",opencli:"将网站与桌面应用转换为命令行工具",uv:"快速 Python 包与项目管理器",ripgrep:"高性能文本检索工具",jq:"JSON 查询与转换工具","github-cli":"在终端中管理 GitHub 工作流",playwright:"浏览器自动化与端到端测试",chromium:"无头浏览器运行时",git:"代码版本管理",curl:"网络请求与文件下载",ffmpeg:"音视频转码与处理",imagemagick:"图片转换与批处理"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",hoursMinutes:"{{hours}} 小时 {{minutes}} 分"},buildStatus:{preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"构建失败",notBuilt:"未构建"},manifest:{title:"环境 Manifest",closeLabel:"关闭环境 Manifest",loading:"正在加载 Manifest",editorLabel:"环境 Manifest YAML",copyFailed:"复制失败,请重试",copied:"已复制",copy:"复制 Manifest",view:"查看环境 Manifest",viewShort:"查看 Manifest",unavailable:"尚无可用 Manifest"},buildDetails:{title:"构建详情",closeLabel:"关闭构建详情",currentStep:"当前步骤",waiting:"等待构建信息",elapsed:"已用时",sourceCommit:"源码提交",openCodePipeline:"在 CodePipeline 中查看",starting:"正在启动",rebuild:"重新构建"},git:{sectionLabel:"公开代码仓库",address:"Git 地址",ref:"Branch、Tag 或 Commit",defaultBranch:"默认分支",inspecting:"正在拉取仓库并查找 Dockerfile",foundDockerfiles:"已在提交 {{commit}} 中找到 {{count}} 个 Dockerfile。",savedDockerfileLoaded:"已载入保存的 Dockerfile,可重新探查仓库更新。",noDockerfile:"仓库中未找到 Dockerfile,请检查分支或仓库内容。",inspectAgain:"重新探查",selectDockerfile:"选择 Dockerfile"},repository:{outputSection:"构建输出",type:"镜像仓库类型",managed:"Studio 默认镜像仓库",existing:"已有镜像仓库",managedHint:"构建时自动创建或复用当前区域的 Studio 镜像仓库。"},existingImage:{sectionLabel:"已有镜像",reference:"Tag 或 Digest",placeholder:"latest 或 sha256:...",hint:"填写镜像 Tag,或以 sha256: 开头的完整 Digest。"},share:{action:"分享",title:"分享环境",closeLabel:"关闭分享环境",generating:"正在生成并复制分享码",copied:"分享码已复制",failed:"分享失败",code:"分享码",fullCode:"完整环境分享码",copiedHint:"分享码已自动复制,也可在这里查看或手动复制。",copyFailedHint:"自动复制失败,可手动复制上方分享码,或重试。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅发送给可信对象。",copyAgain:"再次复制"},import:{title:"导入环境",closeLabel:"关闭导入环境",description:"先检测分享码中的环境,再确认添加到当前账号。",code:"环境分享码",tooMany:"最多可一次导入 {{max}} 个环境,当前检测到 {{count}} 个分享码。",multipleHint:"多个分享码可使用英文逗号、中文逗号或换行分隔,重复项会自动忽略。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅导入可信来源的分享码。",inspectingCodes:"正在检测环境分享码",found:"检测到 {{count}} 个环境:{{names}}。",itemError:"第 {{index}} 个分享码:{{error}}",invalidCode:"分享码无效。",noResult:"服务未返回该分享码的导入结果。",partial:"已导入 {{created}} 个环境,{{remaining}} 个未完成,可重试有效失败项。",inspecting:"正在检测",importing:"正在导入",retryImport:"重试导入",confirm:"确认导入",inspectCodes:"检测分享码"},status:{boundImage:"环境“{{name}}”已绑定已有镜像",queued:"环境“{{name}}”已进入构建队列",savedBuildFailed:"环境已保存,但构建未启动:{{error}}",importedFailed:"已导入 {{created}} 个环境,{{failed}} 个失败",importedDuplicate:"已导入 {{created}} 个环境,{{duplicate}} 个分享码已存在",imported:"已导入 {{count}} 个环境",deleted:"已删除环境“{{name}}”"},deleteTitle:"删除环境",deleteDescription:"确定删除环境“{{name}}”吗?删除后无法恢复。",errors:{repositoryRequired:"请输入公开代码仓库地址。",repositoryHttps:"请输入公开仓库的 HTTPS 地址。",repositoryInvalid:"请输入有效的公开仓库 HTTPS 地址。",imageReferenceWhitespace:"Tag 或 Digest 不能包含空格。",imageDigestInvalid:"Digest 必须是完整的 sha256 值。",imageTagOnly:"这里只填写 Tag,不要重复填写镜像仓库路径。"}},wde={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},Ode={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},Sde={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},kde={defaultLabel:"Studio 默认环境",defaultDescription:"使用 Studio 预置的标准运行环境",status:{notBuilt:"未构建",preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"失败"},label:"运行环境",placeholder:"请选择运行环境",search:"搜索运行环境",loading:"正在加载运行环境…",loadFailed:"加载运行环境失败",noMatches:"未找到匹配的运行环境",unavailable:"当前没有可用的运行环境",selectionUnavailable:"所选运行环境当前不可用,请重新选择。",selectionHint:"选择构建完成的运行环境后,部署将使用其镜像和工具配置。",versionChanged:"所选环境版本已更新,请确认后继续。",versionMissing:"所选环境版本已不存在,请重新选择。",operatingSystem:"操作系统",language:"语言",image:"镜像",imageVersion:"镜像版本",skills:"技能",tools:"工具",noSkills:"未配置 Skill",noExtraTools:"未配置额外工具",defaultGuidance:"默认环境由 Studio 管理,无需额外配置。",persistenceFallback:"持久化环境服务暂不可用,当前使用默认环境。",emptyFallback:"当前没有可选择的自定义环境。"},Ede={repository:"GitHub 仓库",githubUrl:"GitHub 地址",token:"访问令牌",sessionToken:"{{provider}} 临时令牌",runtime:"Runtime",commit:"提交",workflow:"工作流",syncFailed:"同步 GitHub 代码失败",status:{mounted:"已挂载",bound:"已绑定",synced:"已同步",created:"已创建"},volcengine:"火山引擎",mountDelivery:"挂载持续交付",selectedForDeployment:"已选择,部署时挂载",mountOnDeploy:"部署时挂载持续交付",syncCode:"同步代码",deliveryMode:"GitHub 交付模式",sourceSync:"GitHub 代码同步",delivery:"GitHub 交付",loading:"读取中",running:"执行中",runtimeDeliveryHint:"写入 AgentKit Runtime GitHub Actions workflow,后续 GitHub 提交会更新绑定 Runtime。",initialDeliveryHint:"首次部署成功后初始化目标分支,后续 GitHub 提交会更新绑定 Runtime。",sourceSyncHint:"Studio 会直接 push 到目标分支;该分支由 Studio 管理,远端冲突时同步会失败。Runtime 仍由部署按钮发布。",tokenPlaceholder:"repo 或 contents write 权限",getToken:"获取 Token",hideToken:"隐藏 Token",showToken:"显示 Token",tokenHelp:"Token 仅用于本次操作,成功后不会保留在表单中。",targetBranch:"目标分支",actionsSecretPlaceholder:"用于写入 GitHub Actions Secret",sessionTokenPlaceholder:"临时凭证可选",syncing:"同步中…",pendingHint:"已选择挂载持续交付。点击部署后,Studio 会等待 Runtime 创建完成并初始化 GitHub 目标分支,初始化成功后才完成部署流程。",result:{deliveryMounted:"已挂载持续交付",deliverySelected:"已选择挂载持续交付",githubBound:"已绑定 GitHub",codeSynced:"代码已同步",deliveryHint:"目标分支提交会触发 Runtime 持续交付。",boundHint:"更新并发布时会先同步当前源码到这个分支。"},branch:"分支",viewPr:"查看 PR",createFailed:"创建失败",phase:"阶段",log:"日志"},Cde={name:"飞书",enabling:"正在启用并更新配置…",description:"接收消息并通过飞书机器人回复",configuration:"飞书配置",configurationMode:"飞书配置方式",automatic:"自动配置",manual:"手动配置",cancelling:"取消中…",scanToCreate:"扫码创建",scanDescription:"授权后自动回填凭据",generateQrCode:"生成二维码",qrCodeAlt:"飞书机器人配置二维码",scanToConfirm:"飞书扫码确认",expiresIn:"{{time}} 后失效",created:"机器人已创建",credentialsFilled:"应用凭据已自动回填",qrCodeExpired:"二维码已失效",automaticFailed:"自动配置失败",regenerateQrCode:"请重新生成二维码。",configuredPlaceholder:"已配置,留空沿用",appSecretPlaceholder:"请输入 App Secret",hideSecret:"隐藏 App Secret",showSecret:"显示 App Secret"},Tde={mode:{auto:"自动创建",autoDescription:"部署时自动创建所需资源",recommended:"推荐",create:"指定名称",createDescription:"使用指定名称创建或复用资源",existing:"选择已有",existingDescription:"从当前账号的已有资源中选择"},selectExisting:"请选择已有资源",searchResource:"搜索资源名称",noMatch:"未找到匹配资源",noAvailable:"暂无可用资源",searching:"正在搜索云资源…",loading:"正在加载云资源…",noMatchSentence:"未找到匹配资源。",noAvailableSentence:"暂无可用资源。",loadedSummary:"实际服务区域:{{region}} · 已加载 {{loaded}}{{total}}",registryInstance:"Registry 实例",registryAriaLabel:"镜像仓库 Registry 实例",namespace:"命名空间",namespaceAriaLabel:"镜像仓库 Namespace",repository:"镜像仓库",existingRepository:"已有镜像仓库",selectRegistryFirst:"请先选择 Registry 实例。",selectNamespaceFirst:"请先选择 Namespace。",configurationMode:"配置方式",configurationModeAriaLabel:"{{resource}}配置方式",selectConfigurationMode:"请选择配置方式",automaticNames:"自动创建名称",validation:{tos:"请填写或选择 TOS 存储桶。",cr:"请完整填写或选择 CR 实例、命名空间和镜像仓库。",codePipeline:"请完整填写或选择 CodePipeline Workspace 和 Pipeline。",existingCodePipeline:"请选择已有的 CodePipeline Workspace 和兼容 Pipeline。"},autoBucketWithRegion:"agentkit-platform-{账号 ID}-{{region}}",autoBucket:"agentkit-platform-{账号 ID}",tosBucket:"TOS 存储桶",bucketName:"存储桶名称",bucketNamePlaceholder:"输入存储桶名称",existingBucket:"已有存储桶",existingTosBucket:"已有 TOS 存储桶",bucket:"存储桶",accountIdResolved:"账号 ID 在部署时按当前云账号解析。",containerRegistry:"容器镜像仓库(CR)",instanceName:"实例名称",crInstance:"CR 实例",existingCrInstance:"已有 CR 实例",existingCrNamespace:"已有 CR 命名空间",existingCrRepository:"已有 CR 镜像仓库",autoRegistry:"agentkit-platform-{账号 ID}",autoRepositoryName:"{{name}}-{4 位随机字符}",registryNameNote:"账号 ID 在部署时解析,镜像仓库的随机字符在部署时生成。",workspace:"工作空间",pipeline:"流水线",workspaceName:"Workspace 名称",pipelineName:"Pipeline 名称",existingWorkspace:"已有 CodePipeline Workspace",compatiblePipeline:"兼容 Pipeline",existingPipeline:"已有 AgentKit CodePipeline",pipelineNameNote:"Pipeline 与 Runtime 名称一致。"},Ade={commit:"提交",steps:{permissions:"预检 OTA 所需权限",resolving:"读取目标版本信息",downloading:"下载并校验完整更新包",preparing:"准备 VeFaaS Function 代码",provisioning:"检查并补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布新 Revision 并重启服务"},stages:{permissions:"预检 OTA 权限",resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",provisioning:"补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},logPermissionPrefix:"无法读取 VeFaaS 发布日志。Function 角色缺少 ",logPermissionSuffix:" 权限,更新会继续。",openIamConsole:"前往 IAM 控制台配置权限",deploymentProgress:"部署进度",live:"实时",completed:"已完成",stopped:"已停止",copied:"已复制",copyFailed:"复制失败",copyLog:"复制日志",waitingForLogs:"等待 VeFaaS 返回更新日志…",noLogs:"本次更新未返回发布日志",messages:{updated:"Studio 已更新,新 Revision 已接管服务",failed:"Studio 更新失败",timeout:"等待 VeFaaS 发布超时,请稍后重新检查版本",submitted:"更新已提交,正在等待 VeFaaS 发布新版本",connectionSwitched:"连接已切换,正在确认新版本状态"},checkingPermissions:"正在检查 OTA 权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",updated:"Studio 已更新",updateToVersion:"更新 Studio 至 {{version}}",checkPermissions:"检查更新权限",authorizationNeeded:"需要授权",updatingShort:"正在更新",refreshForNewVersion:"刷新使用新版",updateFailed:"更新失败",updateNow:"立即更新",newVersionAvailable:"有新版更新",dialog:{failed:"Studio 更新失败",checkingPermissions:"正在检查更新权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",completed:"Studio 更新完成",newVersion:"发现新版本"},permissionCheck:"正在核对 OTA 与定时任务所需的全部 IAM 权限…",permissionCheckHint:"权限全部满足后才会开始下载、更新或发布云资源。",missingPermissionCount:"当前 Function 角色缺少 {{count}} 项 OTA 更新权限,尚未执行任何云资源变更。",functionRole:"Function 角色",currentRole:"当前运行角色",policyToUpdate:"将更新策略",authorizationSteps:{open:"打开授权页面,确认已预填的策略名称和完整策略内容。",debug:"点击页面中的“发起调试”,完成策略更新。",return:"返回此窗口,点击“我已授权,重新检查”。"},missingPermissions:"缺少的权限",openPrefilledAuthorization:"打开已预填的 IAM 授权页面",openIamManually:"前往 IAM 控制台手动配置",noSafePolicy:"当前角色没有唯一可安全更新的自定义策略,请由管理员将上述权限加入该角色。",failedStage:"失败阶段",errorId:"错误 ID",notGenerated:"未生成",openFunctionLogs:"前往 VeFaaS 控制台查看 Function 日志",targetVersion:"目标版本",updateStatus:"更新状态",elapsed:"已用时",progressAriaLabel:"Studio 更新进度",processingUpdate:"正在处理更新",processing:"正在处理",backgroundHint:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。",confirmDescription:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、流式响应或部署任务可能中断,登录态不会受到影响。",selectVersion:"选择版本",currentVersion:"当前版本",changelog:"更新内容",noChangelog:"暂无更新说明",runInBackground:"后台运行",authorizedRecheck:"我已授权,重新检查",tryAgain:"重新尝试"},_de={deploy:"部署",update:"更新",planHash:"方案哈希",backToConfiguration:"返回配置",releaseRegion:"发布区域",deployRegion:"部署区域",regionPreserved:"更新时沿用现有 Runtime 的部署区域,无法修改。",unnamedAgent:"未命名 Agent",deployTitle:"部署 {{name}}",additionalAgentCount:" 等 {{count}} 个智能体",releaseOverview:"发布概览",agentOverview:"Agent 概览",agentCount:"Agent 数量",model:"模型",systemPrompt:"系统提示词",optimizations:"优化选项",notEnabled:"未启用",effectiveCapabilities:"生效能力",automaticProtection:"自动保护",artifactActions:"发布产物操作",exportYaml:"导出 YAML",viewSource:"查看源代码",downloadSource:"下载源代码",expandFlow:"放大查看执行流程",expand:"放大查看",deploymentConfiguration:"部署配置",runtimeName:"Runtime 名称",runtimeNamePreserved:"更新时保持现有 Runtime 名称不变。",runtimeNameHint:"默认根据 Root Agent 名称生成,并添加随机后缀避免重名;支持 4-64 位字母、数字、连字符和下划线",accessAuthentication:"访问鉴权",authenticationPreserved:"更新时保持现有 Runtime 的鉴权方式不变。",authenticationMethod:"鉴权方式",authenticationAriaLabel:"部署鉴权方式",authenticationPlaceholder:"请选择鉴权方式",messageChannels:"消息渠道",instanceSettings:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",sidecarSingleInstance:"Harness Sidecar 首期仅支持单实例,Runtime 固定为 1~1",inMemorySingleInstance:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",network:"网络",networkPreserved:"现有 Runtime 的区域与网络模式保持不变。",networkMode:"网络模式",networkModes:{public:"公网",both:"公网 + VPC"},subnetId:"子网 ID",subnetHint:"可选,多个用逗号分隔",sharedInternetAccess:"VPC 内共享公网出口",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",createEvaluationSetsHint:"部署成功后,自动创建 Good Case 和 Bad Case 评测集。",resourceConfiguration:"资源配置",environmentVariables:"环境变量",environmentVariablesHint:"组件配置会自动同步到这里,部署前可核对最终值。",itemCount:"{{count}} 项",addVariable:"添加变量",componentGenerated:"组件自动生成",injectedByApiKey:"由所选 API Key 注入",envNameAriaLabel:"{{key}} 环境变量名",envDescriptionAriaLabel:"{{key}}说明:{{description}}",openOpenViking:"打开 OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}:打开 OpenViking {{label}}",requiredEmpty:"必填,尚未填写",optionalEmpty:"可选,尚未填写",envValueAriaLabel:"{{key}} 环境变量值",automatic:"自动",synced:"同步",customModelCredentials:"自定义模型凭据",releaseOnlySecret:"必填,仅用于本次发布",thisRelease:"本次发布",customVariables:"自定义变量",value:"值",deleteVariable:"删除变量",deploymentProgress:"部署进度",retryUpdate:"重试更新",retryDeploy:"重试部署",updateSucceeded:"更新成功",deploySucceeded:"部署成功",region:"区域",agentName:"Agent 名称",apiEndpoint:"API 端点",connecting:"连接中…",chatNow:"立即对话",console:"控制台",actionInProgress:"{{action}}中…",checkingName:"正在检查名称…",retryAction:"重试{{action}}",flowPreview:"执行流程预览",executionFlow:"执行流程",flowPreviewHint:"只读预览,可缩放与拖动画布",closeFlowPreview:"关闭执行流程预览",agentAdded:'Agent "{{name}}" 已添加到左上角下拉列表!',files:{preview:"文件预览",new:"新建文件",empty:"暂无文件",noneSelected:"未选择文件",selectToView:"选择左侧文件以查看内容",loadingEditor:"加载编辑器…",rename:"重命名",renamePrompt:"重命名文件"},apiKey:{selectFirst:"请先选择 API Key",revealing:"正在显示 API Key",hide:"隐藏 API Key",retryReveal:"重试显示 API Key",reveal:"显示 API Key"},task:{preparing:"准备部署",waitingBuildLog:"正在等待构建日志…",waitingGithubLog:"正在等待 GitHub 挂载日志…",syncingGithub:"正在同步当前源码到 GitHub",syncGithubCode:"同步 GitHub 代码",githubSynced:"GitHub 代码已同步",githubSubmitted:"GitHub 代码已提交",githubUpdatingRuntime:"代码已提交到 GitHub,GitHub Actions 正在更新同一个 Runtime",initializingGithub:"开始初始化 GitHub main 分支与 Actions workflow",initializingGithubBranch:"正在初始化 GitHub 持续交付目标分支",mountGithubDelivery:"挂载 GitHub 持续交付",githubBranchInitialized:"GitHub 持续交付已初始化目标分支",githubDeliveryMounted:"GitHub 持续交付已挂载",githubMountFailed:"挂载 GitHub 持续交付失败",githubMountFailedDetail:"GitHub 持续交付挂载失败:{{message}}",githubMountFailedHint:"挂载 GitHub 持续交付失败,详见 GitHub 日志。",deploymentComplete:"部署完成",deployedNotConnected:"部署完成,暂未连接",cancelled:"已取消",cancelledHint:"部署已取消,相关 Runtime 资源已请求销毁。",deploymentStatusUnconfirmed:"部署状态待确认",deploymentFailed:"部署失败",buildFailedHint:"构建镜像失败,详见构建日志。"},confirm:{updateTitle:"确认更新",deployTitle:"确认部署",closeLabel:"关闭部署确认",updateDescription:"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?",deployDescription:"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?",update:"确定更新",deploy:"确定部署"},userPool:{label:"用户池",unnamed:"未命名用户池",current:"当前用户池",ariaLabel:"部署用户池",loading:"正在加载用户池…",placeholder:"请选择用户池",loadingIdentity:"正在加载 Identity 用户池…",empty:"当前账号下暂无 Identity 用户池。",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime。",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime。",markedHint:"当前 Studio 使用的用户池已在列表中标注。"},authentication:{apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPool:"用户池",userPoolDescription:"使用 Identity 用户池签发的 JWT"},steps:{buildImage:"构建镜像",deploy:"部署",publish:"发布",syncCode:"同步代码",uploadPackage:"上传代码包",packageImage:"镜像打包",createRuntime:"创建 Runtime",publishService:"发布服务",updateInstances:"更新实例配置",createEvaluationSets:"创建评测集"},errors:{instanceRangeInteger:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数。",instanceRangeOrder:"最小实例数不能大于最大实例数。",selectApiKey:"请先在模型配置中选择 API Key。",loadApiKey:"加载 API Key 失败,请重试。",invalidProject:"项目数据无效",updateFeishu:"更新飞书配置失败:{{message}}",userPoolRequired:"请选择用于 Runtime 鉴权的用户池。",vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",modelSecretRequired:"请填写 {{label}},用于访问对应的自定义模型地址。",managedApiKeyRequired:"{{requirement}},请先返回模型配置选择 API Key。",feishuEnvRequired:"启用飞书后,请填写{{field}}。",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",deployedButGithubMountFailed:"部署成功,但挂载 GitHub 持续交付失败:{{message}}",deployedButGithubBindFailed:"部署成功,但绑定 GitHub 失败:{{message}}",deploymentStatusUnconfirmed:"连接已中断,当前无法确认部署最终状态。任务可能仍在云端运行,请到 AgentKit 或 Code Pipeline 查看同一任务,避免重复部署。",failedAtStage:"{{action}}失败({{stage}}阶段):{{message}}",noAgentAtEndpoint:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",addAgent:"添加 Agent 失败:{{message}}",modelApiKeyRequired:"请填写此模型地址对应的 API Key。"}},Nde={title:"工作区",detail:"工作区详情",create:"新建工作区",editorDescription:"将常用环境组合在一起;同一个环境可以加入多个工作区。",backToList:"返回工作区列表",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",createdAt:"创建时间",updatedAt:"最近更新",basicInfo:"基本信息",namePlaceholder:"例如:内容生产",descriptionPlaceholder:"说明这个工作区的用途",selectedEnvironmentCount:"已选择 {{count}} 个,可在其他工作区中继续复用",searchAvailableEnvironments:"搜索可用环境",searchEnvironments:"搜索环境",noAvailableEnvironments:"还没有可添加的环境",createEnvironmentFirst:"请先在“环境”页面创建并构建环境。",noMatchingEnvironments:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称。",environmentStatus:{available:"可用",building:"构建中",notBuilt:"未构建"},added:"已添加",saved:"已保存工作区“{{name}}”",resourceType:"工作区资源类型",searchWorkspaces:"搜索工作区",loadFailed:"无法加载工作区",noMatchingWorkspaces:"没有匹配的工作区",tryAnotherNameOrEnvironment:"请尝试搜索其他名称或环境",noEnvironmentAdded:"未添加环境",environmentMissing:"环境缺失",availableFraction:"{{available}}/{{total}} 可用",available:"可用",availableCount:"{{count}} 个可用",updated:"更新",addEnvironment:"添加环境",deleteTitle:"删除工作区",deleteDescription:"确定删除工作区“{{name}}”吗?环境本身不会被删除。",deleted:"已删除工作区“{{name}}”",clipboardPermissionError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。"},jde={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},Rde={addSkill:"添加 Skill",remove:"移除 {{name}}",confirmRemoveRuntime:"从新版本中移除运行中的 Skill「{{name}}」?",selectedCount:"已加入技能 · {{count}}",close:"关闭{{label}}",sources:{runtime:"运行中来源 · 原样保留,可移除或用同名 Skill 替换",local:"本地",skillspace:"AgentKit Skills 中心",skillhub:"火山 Find Skill 技能广场"},tabs:{local:"本地文件",localShort:"本地文件",skillspace:"AgentKit Skills 中心",skillspaceShort:"AgentKit",skillhub:"火山 Find Skill 技能广场",skillhubShort:"Find Skill"}},Ide={tasks:{ppt:"PPT",image:"图片生成",video:"视频生成"},prompts:{ppt:{quarterlyReview:"复盘【季度】经营表现,提炼指标差距、原因与行动建议",projectUpdate:"汇报【项目名称】进展:里程碑、风险、预算和资源诉求",solutionProposal:"为【客户行业】输出解决方案:痛点、架构、实施路径与收益",industryAnalysis:"分析【行业主题】趋势,给出竞争格局、机会与战略建议"},image:{launchVisual:"为【品牌或产品】设计【高级科技】风格的发布会主视觉",ecommercePoster:"生成【产品名称】电商海报,突出【核心卖点】与品牌色",conceptRendering:"呈现【产品或空间】在【使用场景】中的写实概念效果图",socialGraphic:"围绕【传播主题】制作简洁专业的企业社媒配图"},video:{brandFilm:"制作【品牌名称】30 秒宣传片,突出【品牌价值】",productLaunch:"为【产品名称】制作 45 秒发布视频:痛点、功能、场景与行动号召",trainingVideo:"制作【培训主题】企业培训视频,讲清【关键操作或规范】",eventTeaser:"生成【活动名称】20 秒预热视频,包含亮点、时间地点和报名信息"}},firstFrame:"首帧",videoToEdit:"待编辑视频",baseVideo:"基础视频",optimizeSkillPlaceholder:"描述你想优化的技能…",createSkillPlaceholder:"描述你想生成的技能…",createVideoPlaceholder:"描述你想创作的视频…",messageAgentPlaceholder:"向 {{name}} 发消息…",selectAgentFirst:"请先选择智能体",selectSkillFirst:"请先选择需要优化的 Skill",availableSkills:"可用技能",availableSubagents:"可用子 Agent",invokeSkill:"调用技能",useSubagent:"使用子 Agent",loadingCapabilities:"正在读取 Agent 能力…",noMatchingSkills:"当前 Agent 没有匹配技能",noMatchingSubagents:"当前 Agent 没有匹配子 Agent",skillFallbackDescription:"加载并执行该技能",agentFallbackDescription:"将本轮交给该 Agent",skill:"技能",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",taskMode:"任务模式",selectTaskMode:"选择任务模式",loadingGenerationModel:"正在加载生成模型",modelUnavailable:"模型不可用",cancelTask:"取消{{task}}任务",stopGenerating:"停止生成",viewVideoProgress:"查看视频生成进度",send:"发送",selectTaskType:"选择任务类型",enterprisePrompts:"{{task}}企业提示词",sessionId:"会话 ID",sessionIdLabel:"会话 ID:",initializing:"初始化中",copied:"已复制",copySessionId:"复制会话 ID",sessionIdCopied:"已复制会话 ID",disclaimer:"回答仅供参考",viewLogs:"查看日志"},Pde={selectAgent:"选择 Agent",noLocalAgents:"暂无本地 Agent。",searchRuntime:"搜索 Runtime 名称",mineOnly:"只看我创建的",noRuntimes:"暂无 Runtime。",unsupported:"不支持",createdByMe:"我创建的",connecting:"连接中…",connected:"已连接",connect:"连接",viewInfoFor:"查看 {{name}} 信息",viewInfo:"查看信息",agentAndRuntimeInfo:"Agent 与 Runtime 信息",detailType:"详情类型",agentInfo:"Agent 信息",runtimeInfo:"Runtime 信息",loadingAgentInfo:"读取 Agent 信息…",cannotLoadAgentInfo:"暂时无法读取 Agent 信息",unnamedAgent:"未命名 Agent",subagents:"子 Agent",tools:"工具",skills:"技能",previewUnsupported:"暂不支持预览",mountedComponents:"挂载组件",noMoreAgentInfo:"暂无更多 Agent 配置信息。",local:"本地",model:"模型",status:"状态",memoryMb:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",resources:"资源",version:"版本",loadingDetails:"读取详情…",environmentVariables:"环境变量",errors:{notFound:"该 Runtime 已不存在或列表信息已过期,请刷新列表后重试。",accessDenied:"当前账号无权访问该 Runtime,请检查所属 Project 和访问权限。",previewUnsupported:"该 Agent Server 版本暂不支持信息预览。",unavailable:"该 Runtime 暂时无法访问,请确认其状态为“就绪”后重试。",timeout:"加载超时,请重试"},componentKinds:{knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"},runtimeStatus:{ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"}},Dde={recoveryPaused:"部分历史智能体多次恢复失败,已暂停自动恢复。",restoringHistory:"部分历史智能体正在恢复,恢复后将自动显示。",agent:"智能体",agentTypes:{general:"通用智能体",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"创建人",namedAgent:"{{name}} 智能体",storageLocation:"存储位置",currentBrowser:"当前浏览器",region:"地域",viewDeploymentProgress:"查看 {{name}} 部署进度",viewRuntimeDetails:"查看 {{name}} Runtime 详情",viewDetails:"查看 {{name}} 详情",time:"时间",remainingTime:"剩余时间",expiringSoon:"即将清空",sandboxRemaining:"{{hours}} 小时 {{minutes}} 分钟",wakeable:"可唤醒",neverExpires:"永不过期",editDraftNamed:"编辑草稿 {{name}}",viewProgress:"查看进度",deleteDraftNamed:"删除草稿 {{name}}",recheckCompatibility:"重新检测 {{name}} 的对话兼容性",connectedNamed:"{{name}} 已连接",wakeAndChat:"唤醒 {{name}} 并开始对话",chatWith:"与 {{name}} 对话",waking:"唤醒中",deploying:"部署中",draft:"草稿",checking:"检测中",chatUnsupported:"不支持对话",checkFailed:"检测失败",creatorFilter:"创建人筛选",agentType:"智能体类型",searchAgents:"搜索智能体",handoff:"接力",agentList:"{{type}}列表",noMatchingAgents:"没有匹配的智能体",adjustSearch:"请尝试调整搜索或筛选条件",noAgentType:"暂无 {{type}}",noGeneralAgents:"暂无通用智能体",createGeneralAgentDescription:"创建一个通用智能体,开始构建和对话",createAgentType:"创建{{type}}",createAgent:"创建智能体",loadingMore:"正在加载更多智能体",scrollForMore:"继续下滑加载更多",allLoaded:"已加载全部智能体",deleteDraftTitle:"删除草稿?",deleteDraftDescription:"删除后将无法恢复“{{name}}”。",deleteDraft:"删除草稿",loadGeneralAgents:"加载通用智能体",loadAgentType:"加载 {{type}}",compatibility:{checking:"正在请求 Runtime /list-apps,以确认该智能体是否支持 Studio 对话。",empty:"Runtime /list-apps 未返回可用的 Agent,暂时无法连接对话。",supported:"Runtime 支持 Studio 对话。",unknownError:"Runtime /list-apps 请求失败,未返回可识别的错误信息。"},sandboxStatus:{ready:"就绪",wakeable:"可唤醒",creating:"创建中",starting:"启动中",initializing:"启动中",pending:"等待中",running:"运行中",failed:"异常",error:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"}},Mde={library:"技能库",skill:"技能",skills:"技能",skillSpace:"技能空间",sandboxNotConfigured:"管理员未配置 Dev Sandbox",adminNotConfigured:"管理员未配置",totalItems:"共 {{count}} 项",cannotLoadSpaces:"无法加载技能空间",someSpacesFailed:"部分技能空间加载失败",degradedRelationWarning:"部分关联异常,已恢复可读取技能",downloadZip:"下载 ZIP",optimize:"优化",closeSkillDetails:"关闭技能详情",skillId:"技能 ID",allFiles:"完整文件",loadingSkillContent:"正在读取技能内容…",noSkillContent:"该技能暂无 SKILL.md 内容",addSkill:"添加技能",localUpload:"本地上传",localUploadDescription:"选择 ZIP 文件,校验通过后上传到技能空间",autoCreate:"自动创建",autoCreateDescription:"选择模型和风格,通过对话生成技能",createSkill:"创建技能",optimizeNamed:"优化 {{name}}",deleteSkillConfirm:"确定删除整个 Skill“{{name}}”吗?此操作会影响所有引用它的空间。",deleteSpaceConfirm:"确定删除 Skill 空间“{{name}}”吗?请先确认空间中的技能已删除。",manageSpaceDescription:"管理空间中的技能并创建新的版本",backToSpaces:"返回技能空间列表",overview:"概览",skillCount:"技能数量",skillCountValue_one:"{{count}} 技能",skillCountValue_other:"{{count}} 技能",updatedAt:"更新时间",skillsInSpace:"{{name}}中的技能",searchSkills:"搜索技能",cannotLoadSkills:"无法加载技能",noMatchingSkills:"没有匹配的技能",noSkills:"暂无技能",tryAnotherName:"请尝试搜索其他名称",emptySkillsDescription:"本地上传 Skill,或自动创建",actions:"操作",spaceDetails:"技能空间详情",editSpace:"编辑空间",deleteSpace:"删除空间",searchSpaces:"搜索技能空间",spaceList:"技能空间列表",noMatchingSpaces:"没有匹配的技能空间",createSpace:"新建技能空间",newSpace:"新建空间",loadingMoreSpaces:"正在加载更多技能空间",scrollForMore:"继续下滑加载更多",allSpacesLoaded:"已加载全部技能空间",errors:{loadSpaces:"读取技能空间失败,请稍后重试",loadSkills:"读取技能失败,请稍后重试",loadSkillDetails:"读取技能详情失败,请稍后重试",deleteSkill:"删除 Skill 失败",deleteSpace:"删除 Skill 空间失败",downloadSkill:"下载 Skill 失败"},status:{active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中",unknown:"未知"}},Lde={library:"知识库",createBase:"新建知识库",editBase:"编辑知识库",invalidName:"名称必须以字母开头,且只能包含字母、数字和下划线。",nameHelp:"以字母开头,仅支持字母、数字和下划线,最多 48 个字符。",optionalDescription:"描述(可选)",descriptionOnly:"AgentKit 当前仅支持更新知识库描述。",previewWeb:"预览网页内容",addData:"添加数据",openOriginalWeb:"打开原网页",backToEdit:"返回修改",confirmAdd:"确认添加",source:"知识来源",image:"图片",documentFile:"文档文件",webPage:"在线网页",webUrl:"网页 URL",generatingWebPreview:"正在抓取网页并生成 Markdown 预览",selectFile:"选择知识文件",selectOrDropFile:"选择文件或拖拽到这里",selectedFile:"{{size}} · 点击可重新选择",imageFileHelp:"支持 PNG、JPG 和 JPEG,单个文件不超过 200 MB",documentFileHelp:"支持 PDF、PPTX、DOCX、XLSX 和 TXT,单个文件不超过 200 MB",uploadingFile:"正在上传文件并添加到知识库",optionalName:"名称(可选)",optionalType:"类型(可选)",generatePreview:"生成预览",uploadFile:"上传文件",editMetadata:"编辑知识 Metadata",knowledge:"知识",field:"字段",value:"值",backToList:"返回知识库列表",metadataJson:"元数据(JSON)",provider:"服务提供方",knowledgeId:"知识库 ID",project:"项目",creator:"创建者",data:"数据",deleteInvalidAssociation:"删除失效关联",noData:"这个知识库还没有数据",addFirstData:"添加第一项数据",format:"格式",size:"大小",searchData:"搜索数据",searchLibraryData:"搜索知识库数据",associationInvalid:"关联已失效",providerMissing:"底层 Provider 知识库已不存在",noMatchingData:"没有匹配的数据",loadingMoreData:"正在加载更多数据",retryLoading:"重试加载",details:"知识库详情",searchBases:"搜索知识库",someBasesFailed:"部分知识库暂时无法加载,已展示其余可用内容。",noMatchingBases:"没有匹配的知识库",noManagePermission:"您没有管理此知识库的权限",loadingMoreBases:"正在加载更多知识库",deleteBaseTitle:"删除知识库?",deleteBaseDescription:"将删除 {{name}} 的 AgentKit 关联;如果它由 Studio 创建,也会同时删除 Provider 资源。此操作无法撤销。",deleteDocumentTitle:"删除知识?",deleteDocumentDescription:"将从 Provider 知识库中删除 {{name}},此操作无法撤销。",preview:{processingTitle:"数据正在处理中",processingDetail:"知识库完成解析后即可预览,请稍后重新加载。",failedTitle:"数据解析失败",failedDetail:"请检查源文件或网页地址后重新添加,也可以重新加载最新状态。",noParsedTitle:"暂时没有可预览的解析内容",noParsedDetail:"此类文件会在知识库完成解析后显示文本、表格或页面图片。",noMediaTitle:"暂时没有可预览的媒体内容",noMediaDetail:"知识库尚未返回可访问的媒体预览,请稍后重新加载。",noDataTitle:"暂无可预览的数据内容",noDataDetail:"知识库尚未返回解析结果,请稍后重新加载。",attachmentError:"附件无法预览,请稍后重试。",imageAlt:"知识数据图片",audioUnsupported:"当前浏览器不支持音频预览。",videoUnsupported:"当前浏览器不支持视频预览。",namedPdf:"{{name}} PDF 预览",pdf:"PDF 预览",openPdf:"无法显示时,在新窗口打开 PDF",fileUnsupported:"当前格式暂不支持直接在线预览,已优先显示解析后的内容。",openOriginalFile:"打开原文件",loading:"正在加载数据预览",openOriginalHint:"您可以打开原网页查看来源内容。",chunk:"片段 {{index}}",loadingMore:"正在加载更多",loadMore:"加载更多"},errors:{fileTooLarge:"单个文件不能超过 200 MB",invalidImageType:"请选择 PNG、JPG 或 JPEG 图片",invalidDocumentType:"请选择 PDF、PPTX、DOCX、XLSX 或 TXT 文件",createBase:"创建知识库失败",updateBase:"更新知识库失败",metadataObject:"Metadata 必须是 JSON 对象",metadataFormat:"Metadata 格式错误",noWebPreview:"网页没有可预览的 Markdown 内容",addWeb:"添加网页失败",previewWeb:"生成网页预览失败",uploadFile:"上传文件失败",updateDocument:"更新知识失败",loadPreview:"加载数据预览失败",loadMoreBases:"加载更多知识库失败",loadBases:"加载知识库失败",loadMoreData:"加载更多数据失败",loadData:"加载数据失败",deleteBase:"删除知识库失败",deleteDocument:"删除知识失败"}},TMe={common:gde,agentKitPromo:bde,systemInfo:yde,agentWorkspace:vde,environmentCenter:xde,deploymentSelect:wde,deploymentError:Ode,studioBuildProgress:Sde,cloudEnvironment:kde,githubCicd:Ede,feishuDeployment:Cde,deploymentResources:Tde,studioUpdate:Ade,projectPreview:_de,workspace:Nde,resourceCollection:jde,skillSourcePicker:Rde,composer:Ide,agentSelector:Pde,myAgents:Dde,skillCenter:Mde,knowledge:Lde},AMe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:bde,agentSelector:Pde,agentWorkspace:vde,cloudEnvironment:kde,common:gde,composer:Ide,default:TMe,deploymentError:Ode,deploymentResources:Tde,deploymentSelect:wde,environmentCenter:xde,feishuDeployment:Cde,githubCicd:Ede,knowledge:Lde,myAgents:Dde,projectPreview:_de,resourceCollection:jde,skillCenter:Mde,skillSourcePicker:Rde,studioBuildProgress:Sde,studioUpdate:Ade,systemInfo:yde,workspace:Nde},Symbol.toStringTag,{value:"Module"})),$de="网站集成",Fde="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",Bde="返回自动化列表",Ude="添加网站",Qde="正在加载 Runtime",zde="选择 Runtime",Vde="网站域名",Hde="例如 xxxx.com 或 localhost:5173",qde="正在生成",Wde="生成 Token",Gde="已添加网站",Kde="{{count}} 个",Xde="{{count}} 个",Yde="正在加载网站集成",Zde="还没有网站集成",Jde="选择 Runtime 并输入网站域名即可生成 Token",efe="引入方法",tfe="将下面代码放到网页的 body 结束标签前",nfe="已复制",ife="复制代码",rfe="添加网站后会在这里生成引入代码。",sfe="确定删除 {{domain}} 的网站集成吗?",afe={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},ofe={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},_Me={title:$de,description:Fde,backToAutomations:Bde,addWebsite:Ude,loadingRuntime:Qde,selectRuntime:zde,websiteDomain:Vde,domainPlaceholder:Hde,generating:qde,generateToken:Wde,addedWebsites:Gde,websiteCount_one:Kde,websiteCount_other:Xde,loadingIntegrations:Yde,delete:"删除",emptyTitle:Zde,emptyDescription:Jde,embedMethod:efe,embedInstructions:tfe,copied:nfe,copyCode:ife,embedHint:rfe,confirmDelete:sfe,errors:afe,widget:ofe},NMe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:Ude,addedWebsites:Gde,backToAutomations:Bde,confirmDelete:sfe,copied:nfe,copyCode:ife,default:_Me,description:Fde,domainPlaceholder:Hde,embedHint:rfe,embedInstructions:tfe,embedMethod:efe,emptyDescription:Jde,emptyTitle:Zde,errors:afe,generateToken:Wde,generating:qde,loadingIntegrations:Yde,loadingRuntime:Qde,selectRuntime:zde,title:$de,websiteCount_one:Kde,websiteCount_other:Xde,websiteDomain:Vde,widget:ofe},Symbol.toStringTag,{value:"Module"})),lfe={types:{all:"全部类型",document:"文档",image:"图片",video:"视频"},previewArtifact:"预览 {{name}}",moreActions:"更多操作 {{name}}",actionMenu:"{{name}} 操作",download:"下载",downloading:"下载中",edit:"编辑信息",delete:"删除产物",previewFailed:"无法预览“{{name}}”:{{message}}",downloadStarted:"已开始下载 {{name}}",downloadFailed:"无法下载“{{name}}”:{{message}}",updated:"已更新 {{name}}",deleted:"已删除 {{name}}",deleteFailed:"无法删除“{{name}}”:{{message}}",typeFilter:"产物类型",searchAria:"搜索产物",searchPlaceholder:"搜索产物或会话",retry:"重试",close:"关闭",listAria:"产物列表",loadFailed:"产物加载失败",loadDetailFallback:"请检查存储配置后重试。",reload:"重新加载",noMatch:"没有找到匹配的产物",noArtifacts:"您还没有任何产物",searchHint:"请尝试搜索其他名称或切换类型",emptyHint:"聊天中生成的产物会自动显示在这里",columns:{name:"名称",source:"来源",updatedAt:"修改时间",actions:"操作"},loadingMore:"正在加载更多产物",unknownTime:"时间未知",preview:{close:"关闭预览",meta:"{{type}} / 版本 {{version}}",loading:"正在加载预览",alt:"{{name}} 预览",loadFailed:"预览加载失败,请稍后重试或下载查看",unsupported:"当前格式暂不支持在线预览,请下载查看",sourceAria:"产物来源",agent:"智能体",session:"会话",tool:"生成工具",createdAt:"生成时间",fileSize:"文件大小",tags:"标签",viewSession:"查看会话"},deleteDialog:{title:"删除产物?",description:"“{{name}}”将从产物库永久删除,聊天记录不会受到影响。",deleting:"删除中",confirm:"删除",close:"关闭删除确认框"},api:{withStatus:"{{message}}({{status}})",listFailed:"读取产物库失败",syncFailed:"同步聊天产物失败",updateFailed:"更新产物失败",deleteFailed:"删除产物失败",downloadFailed:"下载产物失败"}},cfe={unknownSource:"未知来源",unknownCreator:"未知创建者"},ufe={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},dfe={change:{added:"新增",modified:"修改",deleted:"删除"},noChanges:"两个版本的源码没有差异",chooseFile:"从左侧选择文件以查看代码",compareTitle:"版本对比",workspaceTitle:"源码工作区",projectFallback:"Agent 项目",switchTheme:"切换源码主题",switchThemeTitle:"切换为{{theme}}主题",themes:{dark:"深色",light:"浅色"},closeWorkspace:"关闭源码工作区",close:"关闭",changedFiles:"变更文件",projectFiles:"项目文件",changes:"变更",files:"文件",openFiles:"打开的文件",noFileSelected:"未选择文件",comparisonDirection:"对比方向",before:"优化前",after:"优化后",loadingEditor:"正在加载编辑器…",changedFileCount_one:"{{count}} 个文件有变更",changedFileCount_other:"{{count}} 个文件有变更",fileCount_one:"{{count}} 个文件",fileCount_other:"{{count}} 个文件",lineCount_one:"{{count}} 行 · UTF-8",lineCount_other:"{{count}} 行 · UTF-8",viewSource:"查看源码",viewSourceAria:"查看和编辑项目源码"},ffe={nav:"搜索",selectAgent:"请选择 Agent",checkingCapabilities:"正在检测 Agent 能力",notMounted:"当前 Agent 未挂载{{label}}",sources:{session:"会话",web:"网络",knowledge:"知识库",memory:"长期记忆"},webDescription:"通过 web_search 工具检索",backendLocal:"本地",failed:"搜索失败:{{message}}",placeholder:{selectAgent:"请先选择 Agent",web:"在网络中检索",knowledge:"在 {{name}} 中检索",knowledgeFallback:"当前 Agent 的知识库",memory:"在 {{name}} 中检索",memoryFallback:"当前用户的长期记忆",session:"在当前 Agent 的会话中检索"},sourceTypeAria:"搜索类型:{{label}}",notSelected:"未选择",sourceType:"搜索类型",selectSource:"选择搜索类型",noAgentHint:"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。",loadingCapabilities:"正在读取当前 Agent 的检索能力…",sourceUnavailable:"当前 Agent 未挂载该数据源",instructions:{web:"输入关键词后回车或点击按钮,通过 web_search 工具检索。",knowledge:"输入问题,检索当前 Agent 挂载的知识库。",memory:"输入线索,检索当前用户跨会话保存的长期记忆。",session:"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"},noResults:"未找到匹配“{{query}}”的结果。",knowledgeFragment:"知识片段 {{index}}",memoryFragment:"记忆片段 {{index}}"},hfe={title:"开发者资源",sections:{documentation:{title:"相关链接",description:"查看开发文档与 AgentKit 常用入口"},bestPractices:{title:"最佳实践",description:"参考开发、调试与部署经验"},showcases:{title:"案例展示",description:"探索 AgentKit 应用案例"}},links:{veadkDocs:"VeADK 文档",cliDocs:"AgentKit CLI 文档",platformDocs:"AgentKit 平台文档",console:"AgentKit 控制台"},articles:{veadkDevelopment:{title:"使用 VeADK 开发并部署智能体",description:"使用 VeADK 构建 Agent,并部署至 AgentKit 智能体运行时。"},cliDevelopment:{title:"使用 AgentKit CLI 开发并部署智能体",description:"通过 AgentKit CLI 创建项目、调试 Agent,并完成部署。"},coverAlt:"{{title}}文章封面"},showcases:{researchAssistant:{title:"多智能体研究助手",description:"由多个专业 Agent 协同完成资料检索、分析和结论整理。"},multimodalAnalysis:{title:"多模态内容分析",description:"在统一会话中理解图片、文档和视频内容。"},customerService:{title:"智能客服工作台",description:"结合知识检索与工具调用处理复杂的客户服务任务。"},webSearch:{title:"联网搜索 Agent",description:"检索实时网页内容,并将信息整理为可追溯的回答。"},a2uiApp:{title:"A2UI 交互应用",description:"让 Agent 根据任务过程生成可交互的前端界面。"},previewAlt:"{{title}}界面预览"}},pfe={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},mfe={title:"管理 Agent",subtitle:"列出你有权管理的 AgentKit Runtime",mainAgentOnly:"仅显示主 Agent(控制面信息)。",deleteConfirm:'确定删除 Agent "{{name}}"?该 Runtime 将被永久删除。',regionFilterTitle:"按区域筛选",regionFilterAria:"区域筛选",regionAria:"区域",refresh:"刷新",loading:"加载中…",empty:"暂无你部署的 Agent。",connected:"已连接",connect:"连接到此 Agent",deleteRuntime:"删除该 Runtime",loadingDetail:"读取详情…",agentStructure:"Agent 结构",secretHidden:"敏感值已隐藏,点击显示",revealSecret:"显示 {{key}} 的值",fields:{model:"模型",description:"描述",status:"状态信息",project:"项目",version:"版本",resources:"资源",memory:"记忆",tool:"工具",knowledge:"知识",mcpToolset:"MCP 工具集",updatedAt:"更新时间"},resource:{memory:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",concurrency:"并发 {{value}}"},environmentVariables:"环境变量",unnamed:"(未命名)"},gfe={mainAgent:"主 Agent",subAgent:"子 Agent {{index}}",itemCount_one:"{{count}} 项",itemCount_other:"{{count}} 项",info:"Agent 信息",infoAndTopology:"Agent 信息与拓扑",loadingInfo:"正在读取 Agent 信息…",unnamedAgent:"未命名 Agent",tools:"工具",toolList:"工具列表",studioTool:"Studio Tool",removeTool:"移除工具 {{name}}",remove:"移除",notConfigured:"未配置",addStudioTool:"添加 Studio 工具",addStudioToolHere:"在此对话中添加 Studio 工具",skills:"技能",skillList:"技能列表",previewUnsupported:"暂不支持预览",sessionEnvironment:"会话环境",environment:"环境",agentCanvas:"Agent 画布",topology:"结构拓扑",viewCanvasFullscreen:"全屏查看 Agent 画布",viewFullscreen:"全屏查看",executionCanvas:"Agent 执行画布",fullscreenExecutionCanvas:"全屏 Agent 执行画布",closeFullscreenCanvas:"关闭全屏画布",close:"关闭",capabilitiesSubtitle:"能力与协作拓扑",closeInfo:"关闭 Agent 信息",infoUnavailable:"暂时无法读取 Agent 信息。"},bfe={mountFailed:"挂载环境失败",closeDialog:"关闭环境弹窗",addTitle:"添加环境",description:"选择当前会话允许 Agent 使用的 Sandbox 环境",closeAdd:"关闭添加环境",searchAria:"搜索环境",searchPlaceholder:"搜索环境名称或能力",availableAria:"可用环境与工作区",loading:"正在读取可用环境…",noMatch:"没有匹配的环境或工作区",workspaces:"工作区",reuseAll:"复用工作区中的全部可用环境",availableEnvironmentCount_one:"{{count}} 个可用环境",availableEnvironmentCount_other:"{{count}} 个可用环境",selectWorkspace:"选择工作区 {{name}}",environments:"环境",includedByWorkspaces:"已由工作区 {{names}} 包含",nameSeparator:"、",selectEnvironment:"选择环境 {{name}}",selectedWorkspaceCount_one:"{{count}} 个工作区",selectedWorkspaceCount_other:"{{count}} 个工作区",coveredEnvironmentCount_one:"{{count}} 个环境",coveredEnvironmentCount_other:"{{count}} 个环境",selectionSummary:"已选择 {{workspaces}},覆盖 {{environments}}",cancel:"取消",mounting:"正在挂载…",confirm:"确认添加",mountedAria:"已挂载环境",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",removeWorkspace:"移除工作区 {{name}}",remove:"移除",removeEnvironment:"移除环境 {{name}}",add:"添加环境",addMore:"添加更多环境",addForSession:"为当前 Session 添加环境",loadingAvailable:"正在加载可用环境…",empty:"暂无可用的 AIO Sandbox 环境。"},yfe={loading:{searching:"正在查找已有环境",creating:"环境初始化中",connecting:"正在连接已有环境"},initializationFailed:"AgentKit CLI 环境初始化失败,当前状态:{{status}}。",sessionExpired:"AgentKit CLI Session 不存在或已过期,请重试。",initializationTimeout:"AgentKit CLI 环境初始化超时,请稍后重试。",nonPersistent:"非持久化环境",recyclingHoursMinutes:"{{hours}} 小时 {{minutes}} 分钟后环境回收",recyclingMinutes:"{{minutes}} 分钟后环境回收",connectionError:`无法连接 Studio 服务,未收到服务端响应。 +原始错误:{{message}}`,unavailable:"连接不可用",requestFailed:"AgentKit CLI 请求失败",retry:"重试",terminalTitle:"AgentKit CLI 终端"},vfe={labels:{coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取"},closeDialog:"关闭弹窗",title:"添加 Studio 工具",description:"由 Studio BFF 为 {{agentName}} 的当前会话执行,Runtime 无需预装",close:"关闭添加 Studio 工具",searchAria:"搜索 Studio 工具",searchPlaceholder:"搜索名称或工具标识",availableAria:"可用 Studio 工具",loading:"正在读取 Studio 工具…",noMatch:"没有匹配的 Studio 工具",remove:"移除",add:"添加"},xfe={artifactLibrary:lfe,resourceMetadata:cfe,artifactEdit:ufe,codeBrowser:dfe,search:ffe,developerResources:hfe,library:pfe,manageAgents:mfe,agentTopology:gfe,sessionEnvironment:bfe,agentKitCli:yfe,studioTools:vfe},jMe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:yfe,agentTopology:gfe,artifactEdit:ufe,artifactLibrary:lfe,codeBrowser:dfe,default:xfe,developerResources:hfe,library:pfe,manageAgents:mfe,resourceMetadata:cfe,search:ffe,sessionEnvironment:bfe,studioTools:vfe},Symbol.toStringTag,{value:"Module"})),G8=["zh-CN","en-US"],xj="en-US",wfe="agentkit.studio.locale",RMe={"zh-CN":{dir:"ltr",nativeName:"简体中文"},"en-US":{dir:"ltr",nativeName:"English"}};function wj(e){if(!e)return null;const t=e.trim().replace(/_/g,"-").toLowerCase(),n=G8.find(i=>i.toLowerCase()===t);return n||(t==="zh"||t.startsWith("zh-")?"zh-CN":t==="en"||t.startsWith("en-")?"en-US":null)}function jd(e,t){const n=(e==null?void 0:e.trim())??"";if(!n)return"";const i=new RegExp("\\p{Script=Han}","u").test(n);return t.toLowerCase().startsWith("zh")===i?n:""}function IMe(){if(typeof window>"u")return null;try{return wj(window.localStorage.getItem(wfe))}catch{return null}}function PMe(){if(typeof window>"u")return[];const e=window.navigator;return e?e.languages.length>0?e.languages:e.language?[e.language]:[]:[]}function DMe(){const e=IMe();if(e)return e;for(const t of PMe()){const n=wj(t);if(n)return n}return xj}function MMe(e){if(!(typeof window>"u"))try{window.localStorage.setItem(wfe,e)}catch{}}function Ofe(e){typeof document>"u"||(document.documentElement.lang=e,document.documentElement.dir=RMe[e].dir)}const Pn=e=>typeof e=="string",T1=()=>{let e,t;const n=new Promise((i,r)=>{e=i,t=r});return n.resolve=e,n.reject=t,n},jP=e=>e==null?"":String(e),LMe=(e,t,n)=>{e.forEach(i=>{t[i]&&(n[i]=t[i])})},$Me=/###/g,uV=e=>e&&e.includes("###")?e.replace($Me,"."):e,dV=e=>!e||Pn(e),Yw=(e,t,n)=>{const i=Pn(t)?t.split("."):t;let r=0;for(;r{const{obj:i,k:r}=Yw(e,t,Object);if(i!==void 0||t.length===1){i[r]=n;return}let s=t[t.length-1],a=t.slice(0,t.length-1),l=Yw(e,a,Object);for(;l.obj===void 0&&a.length;)s=`${a[a.length-1]}.${s}`,a=a.slice(0,a.length-1),l=Yw(e,a,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${s}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${s}`]=n},FMe=(e,t,n,i)=>{const{obj:r,k:s}=Yw(e,t,Object);r[s]=r[s]||[],r[s].push(n)},qA=(e,t)=>{const{obj:n,k:i}=Yw(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,i))return n[i]},BMe=(e,t,n)=>{const i=qA(e,n);return i!==void 0?i:qA(t,n)},Sfe=(e,t,n)=>{for(const i in t)i!=="__proto__"&&i!=="constructor"&&(Object.prototype.hasOwnProperty.call(e,i)?Pn(e[i])||e[i]instanceof String||Pn(t[i])||t[i]instanceof String?n&&(e[i]=t[i]):Sfe(e[i],t[i],n):e[i]=t[i]);return e},pf=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),UMe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},QMe=e=>Pn(e)?e.replace(/[&<>"'\/]/g,t=>UMe[t]):e;class zMe{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const i=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,i),this.regExpQueue.push(t),i}}const VMe=[" ",",","?","!",";"],HMe=new zMe(20),qMe=(e,t,n)=>{t=t||"",n=n||"";const i=VMe.filter(a=>!t.includes(a)&&!n.includes(a));if(i.length===0)return!0;const r=HMe.getRegExp(`(${i.map(a=>a==="?"?"\\?":a).join("|")})`);let s=!r.test(e);if(!s){const a=e.indexOf(n);a>0&&!r.test(e.substring(0,a))&&(s=!0)}return s},GL=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const i=t.split(n);let r=e;for(let s=0;se==null?void 0:e.replace(/_/g,"-"),WMe={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,i;(i=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||i.call(n,console,t)}};class WA{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||WMe,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,i,r){return r&&!this.debug?null:(t=t.map(s=>Pn(s)?s.replace(/[\r\n\x00-\x1F\x7F]/g," "):s),Pn(t[0])&&(t[0]=`${i}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new WA(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new WA(this.logger,t)}}var wd=new WA;class Oj{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const r=this.observers[i].get(n)||0;this.observers[i].set(n,r+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}once(t,n){const i=(...r)=>{n(...r),this.off(t,i)};return this.on(t,i),this}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([r,s])=>{for(let a=0;a{for(let a=0;a-1&&this.options.ns.splice(n,1)}getResource(t,n,i,r={}){var u,d;const s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,a=r.ignoreJSONStructure!==void 0?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.includes(".")?l=t.split("."):(l=[t,n],i&&(Array.isArray(i)?l.push(...i):Pn(i)&&s?l.push(...i.split(s)):l.push(i)));const c=qA(this.data,l);return!c&&!n&&!i&&t.includes(".")&&(t=l[0],n=l[1],i=l.slice(2).join(".")),c||!a||!Pn(i)?c:GL((d=(u=this.data)==null?void 0:u[t])==null?void 0:d[n],i,s)}addResource(t,n,i,r,s={silent:!1}){const a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let l=[t,n];i&&(l=l.concat(a?i.split(a):i)),t.includes(".")&&(l=t.split("."),r=n,n=l[1]),this.addNamespaces(n),fV(this.data,l,r),s.silent||this.emit("added",t,n,i,r)}addResources(t,n,i,r={silent:!1}){for(const s in i)(Pn(i[s])||Array.isArray(i[s]))&&this.addResource(t,n,s,i[s],{silent:!0});r.silent||this.emit("added",t,n,i)}addResourceBundle(t,n,i,r,s,a={silent:!1,skipCopy:!1}){let l=[t,n];t.includes(".")&&(l=t.split("."),r=i,i=n,n=l[1]),this.addNamespaces(n);let c=qA(this.data,l)||{};a.skipCopy||(i=JSON.parse(JSON.stringify(i))),r?Sfe(c,i,s):c={...c,...i},fV(this.data,l,c),a.silent||this.emit("added",t,n,i)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(r=>n[r]&&Object.keys(n[r]).length>0)}toJSON(){return this.data}}var kfe={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,i,r){return e.forEach(s=>{var a;t=((a=this.processors[s])==null?void 0:a.process(t,n,i,r))??t}),t}};const Efe=Symbol("i18next/PATH_KEY");function GMe(){const e=[],t=Object.create(null);let n;return t.get=(i,r)=>{var s;return(s=n==null?void 0:n.revoke)==null||s.call(n),r===Efe?e:(e.push(r),n=Proxy.revocable(i,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Kg(e,t){const{[Efe]:n}=e(GMe()),i=(t==null?void 0:t.keySeparator)??".",r=(t==null?void 0:t.nsSeparator)??":",s=(t==null?void 0:t.enableSelector)==="strict";if(n.length>1&&r){const a=t==null?void 0:t.ns,l=s?Array.isArray(a)?a:a?[a]:null:Array.isArray(a)?a:null;if(l&&(s?l:l.length>1?l.slice(1):[]).includes(n[0]))return`${n[0]}${r}${n.slice(1).join(i)}`}return n.join(i)}const RP=e=>!Pn(e)&&typeof e!="boolean"&&typeof e!="number";class GA extends Oj{constructor(t,n={}){super(),LMe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=wd.create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const i={...n};if(t==null)return!1;const r=this.resolve(t,i);if((r==null?void 0:r.res)===void 0)return!1;const s=RP(r.res);return!(i.returnObjects===!1&&s)}extractFromKey(t,n){let i=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const a=i&&t.includes(i),l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!qMe(t,i,r);if(a&&!l){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:Pn(s)?[s]:s};const u=t.split(i);(i!==r||i===r&&this.options.ns.includes(u[0]))&&(s=u.shift()),t=u.join(r)}return{key:t,namespaces:Pn(s)?[s]:s}}translate(t,n,i){let r=typeof n=="object"?{...n}:n;if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),t==null)return"";typeof t=="function"&&(t=Kg(t,{...this.options,...r})),Array.isArray(t)||(t=[String(t)]),t=t.map(F=>typeof F=="function"?Kg(F,{...this.options,...r}):String(F));const s=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,a=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:l,namespaces:c}=this.extractFromKey(t[t.length-1],r),u=c[c.length-1];let d=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const f=r.lng||this.language,h=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return h?s?{res:`${u}${d}${l}`,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:`${u}${d}${l}`:s?{res:l,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:l;const p=this.resolve(t,r);let g=p==null?void 0:p.res;const b=(p==null?void 0:p.usedKey)||l,v=(p==null?void 0:p.exactUsedKey)||l,y=["[object Number]","[object Function]","[object RegExp]"],x=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,O=!this.i18nFormat||this.i18nFormat.handleAsObject,w=r.count!==void 0&&!Pn(r.count),k=GA.hasDefaultValue(r),S=w?this.pluralResolver.getSuffix(f,r.count,r):"",E=r.ordinal&&w?this.pluralResolver.getSuffix(f,r.count,{ordinal:!1}):"",C=w&&!r.ordinal&&r.count===0,N=C&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${S}`]||r[`defaultValue${E}`]||r.defaultValue;let _=g;O&&!g&&k&&(_=N);const j=RP(_),A=Object.prototype.toString.apply(_);if(O&&_&&j&&!y.includes(A)&&!(Pn(x)&&Array.isArray(_))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const F=this.options.returnedObjectHandler?this.options.returnedObjectHandler(b,_,{...r,ns:c}):`key '${l} (${this.language})' returned an object instead of string.`;return s?(p.res=F,p.usedParams=this.getUsedParamsDetails(r),p):F}if(a){const F=Array.isArray(_),T=F?[]:{},P=F?v:b;for(const R in _)if(Object.prototype.hasOwnProperty.call(_,R)){const L=`${P}${a}${R}`;k&&!g?T[R]=this.translate(L,{...r,defaultValue:RP(N)?N[R]:void 0,joinArrays:!1,ns:c}):T[R]=this.translate(L,{...r,joinArrays:!1,ns:c}),T[R]===L&&(T[R]=_[R])}g=T}}else if(O&&Pn(x)&&Array.isArray(g))g=g.join(x),g&&(g=this.extendTranslation(g,t,r,i));else{let F=!1,T=!1;!this.isValidLookup(g)&&k&&(F=!0,g=N),this.isValidLookup(g)||(T=!0,g=l);const R=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&T?void 0:g,L=k&&N!==g&&this.options.updateMissing;if(T||F||L){if(this.logger.log(L?"updateKey":"missingKey",f,u,w&&!L?`${l}${this.pluralResolver.getSuffix(f,r.count,r)}`:l,L?N:g),a){const H=this.resolve(l,{...r,keySeparator:!1});H&&H.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let M=[];const U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&U&&U[0])for(let H=0;H{var B;const q=k&&Q!==g?Q:R;this.options.missingKeyHandler?this.options.missingKeyHandler(H,u,Z,q,L,r):(B=this.backendConnector)!=null&&B.saveMissing&&this.backendConnector.saveMissing(H,u,Z,q,L,r),this.emit("missingKey",H,u,Z,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?M.forEach(H=>{const Z=this.pluralResolver.getSuffixes(H,r);C&&r[`defaultValue${this.options.pluralSeparator}zero`]&&!Z.includes(`${this.options.pluralSeparator}zero`)&&Z.push(`${this.options.pluralSeparator}zero`),Z.forEach(Q=>{I([H],l+Q,r[`defaultValue${Q}`]||N)})}):I(M,l,N))}g=this.extendTranslation(g,t,r,p,i),T&&g===l&&this.options.appendNamespaceToMissingKey&&(g=`${u}${d}${l}`),(T||F)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${l}`:l,F?g:void 0,r))}return s?(p.res=g,p.usedParams=this.getUsedParamsDetails(r),p):g}extendTranslation(t,n,i,r,s){var c,u;if((c=this.i18nFormat)!=null&&c.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const d=Pn(t)&&(((u=i==null?void 0:i.interpolation)==null?void 0:u.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(d){const p=t.match(this.interpolator.nestingRegexp);f=p&&p.length}let h=i.replace&&!Pn(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),t=this.interpolator.interpolate(t,h,i.lng||this.language||r.usedLng,i),d){const p=t.match(this.interpolator.nestingRegexp),g=p&&p.length;f(s==null?void 0:s[0])===p[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${n[0]}`),null):this.translate(...p,n),i)),i.interpolation&&this.interpolator.reset()}const a=i.postProcess||this.options.postProcess,l=Pn(a)?[a]:a;return t!=null&&(l!=null&&l.length)&&i.applyPostProcessor!==!1&&(t=kfe.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),t}resolve(t,n={}){let i,r,s,a,l;return Pn(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(c=>typeof c=="function"?Kg(c,{...this.options,...n}):c)),t.forEach(c=>{if(this.isValidLookup(i))return;const u=this.extractFromKey(c,n),d=u.key;r=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const h=n.count!==void 0&&!Pn(n.count),p=h&&!n.ordinal&&n.count===0,g=n.context!==void 0&&(Pn(n.context)||typeof n.context=="number")&&n.context!=="",b=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(v=>{var y,x;this.isValidLookup(i)||(l=v,!this.checkedLoadedFor[`${b[0]}-${v}`]&&((y=this.utils)!=null&&y.hasLoadedNamespace)&&!((x=this.utils)!=null&&x.hasLoadedNamespace(l))&&(this.checkedLoadedFor[`${b[0]}-${v}`]=!0,this.logger.warn(`key "${r}" for languages "${b.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),b.forEach(O=>{var S;if(this.isValidLookup(i))return;a=O;const w=[d];if((S=this.i18nFormat)!=null&&S.addLookupKeys)this.i18nFormat.addLookupKeys(w,d,O,v,n);else{let E;h&&(E=this.pluralResolver.getSuffix(O,n.count,n));const C=`${this.options.pluralSeparator}zero`,N=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(n.ordinal&&E.startsWith(N)&&w.push(d+E.replace(N,this.options.pluralSeparator)),w.push(d+E),p&&w.push(d+C)),g){const _=`${d}${this.options.contextSeparator||"_"}${n.context}`;w.push(_),h&&(n.ordinal&&E.startsWith(N)&&w.push(_+E.replace(N,this.options.pluralSeparator)),w.push(_+E),p&&w.push(_+C))}}let k;for(;k=w.pop();)this.isValidLookup(i)||(s=k,i=this.getResource(O,v,k,n))}))})}),{res:i,usedKey:r,exactUsedKey:s,usedLng:a,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,i,r={}){var s;return(s=this.i18nFormat)!=null&&s.getResource?this.i18nFormat.getResource(t,n,i,r):this.resourceStore.getResource(t,n,i,r)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=t.replace&&!Pn(t.replace);let r=i?t.replace:t;if(i&&typeof t.count<"u"&&(r={...r,count:t.count}),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!i){r={...r};for(const s of n)delete r[s]}return r}static hasDefaultValue(t){const n="defaultValue";for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&i.startsWith(n)&&t[i]!==void 0)return!0;return!1}}class pV{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=wd.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(t){if(t=GO(t),!t||!t.includes("-"))return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=GO(t),!t||!t.includes("-"))return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Pn(t)&&t.includes("-")){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(t)}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(i=>{if(n)return;const r=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(r))&&(n=r)}),!n&&this.options.supportedLngs&&t.forEach(i=>{if(n)return;const r=this.getScriptPartFromCode(i);if(this.isSupportedCode(r))return n=r;const s=this.getLanguagePartFromCode(i);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(a=>a===s?!0:!a.includes("-")&&!s.includes("-")?!1:!!(a.includes("-")&&!s.includes("-")&&a.slice(0,a.indexOf("-"))===s||a.startsWith(s)&&s.length>1))}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),Pn(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let i=t[n];return i||(i=t[this.getScriptPartFromCode(n)]),i||(i=t[this.formatLanguageCode(n)]),i||(i=t[this.getLanguagePartFromCode(n)]),i||(i=t.default),i||[]}toResolveHierarchy(t,n){const i=this.options.fallbackLng,r=Array.isArray(i)?i.join("|"):i;r!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=r);const s=n===void 0||n===!1||Pn(n),a=n===void 0&&typeof this.options.fallbackLng=="function",l=Pn(t)&&s&&!a;let c=null;if(l){let h;n===void 0?h="undefined":n===!1?h="boolean:false":h=`string:${n}`,c=`${t.length}:${t}|${h}`}if(c!==null){const h=this.resolveHierarchyCache[c];if(h!==void 0)return h.slice()}const u=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),d=[],f=h=>{h&&(this.isSupportedCode(h)?d.push(h):this.logger.warn(`rejecting language code not found in supportedLngs: ${h}`))};return Pn(t)&&(t.includes("-")||t.includes("_"))?(this.options.load!=="languageOnly"&&f(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&f(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&f(this.getLanguagePartFromCode(t))):Pn(t)&&f(this.formatLanguageCode(t)),u.forEach(h=>{d.includes(h)||f(this.formatLanguageCode(h))}),c!==null?(this.resolveHierarchyCache[c]=d,d.slice()):d}}const mV={zero:0,one:1,two:2,few:3,many:4,other:5},gV={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class KMe{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=wd.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const i=GO(t==="dev"?"en":t),r=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:i,type:r});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let a;try{a=new Intl.PluralRules(i,{type:r})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),gV;if(!t.match(/-|_/))return gV;const c=this.languageUtils.getLanguagePartFromCode(t);a=this.getRule(c,n)}return this.pluralRulesCache[s]=a,a}needsPlural(t,n={}){let i=this.getRule(t,n);return i||(i=this.getRule("dev",n)),(i==null?void 0:i.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,i={}){return this.getSuffixes(t,i).map(r=>`${n}${r}`)}getSuffixes(t,n={}){let i=this.getRule(t,n);return i||(i=this.getRule("dev",n)),i?i.resolvedOptions().pluralCategories.sort((r,s)=>mV[r]-mV[s]).map(r=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r}`):[]}getSuffix(t,n,i={}){const r=this.getRule(t,i);return r?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${r.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,i))}}const bV=(e,t,n,i=".",r=!0)=>{let s=BMe(e,t,n);return!s&&r&&Pn(n)&&(s=GL(e,n,i),s===void 0&&(s=GL(t,n,i))),s},yV=e=>e.replace(/\$/g,"$$$$");class vV{constructor(t={}){var n;this.logger=wd.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(i=>i),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:i,useRawValueToEscape:r,prefix:s,prefixEscaped:a,suffix:l,suffixEscaped:c,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:h,nestingPrefixEscaped:p,nestingSuffix:g,nestingSuffixEscaped:b,nestingOptionsSeparator:v,maxReplaces:y,alwaysFormat:x}=t.interpolation;this.escape=n!==void 0?n:QMe,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=r!==void 0?r:!1,this.prefix=s?pf(s):a||"{{",this.suffix=l?pf(l):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f?pf(f):"-",this.unescapeSuffix=this.unescapePrefix?"":d?pf(d):"",this.nestingPrefix=h?pf(h):p||pf("$t("),this.nestingSuffix=g?pf(g):b||pf(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=y||1e3,this.alwaysFormat=x!==void 0?x:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,i)=>(n==null?void 0:n.source)===i?(n.lastIndex=0,n):new RegExp(i,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,i,r){var p;let s,a,l;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const x=bV(n,c,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(x,void 0,i,{...r,...n,interpolationkey:g}):x}const b=g.split(this.formatSeparator),v=b.shift().trim(),y=b.join(this.formatSeparator).trim();return this.format(bV(n,c,v,this.options.keySeparator,this.options.ignoreJSONStructure),y,i,{...r,...n,interpolationkey:v})};this.resetRegExp(),!this.escapeValue&&typeof t=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(t)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const d=(r==null?void 0:r.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((p=r==null?void 0:r.interpolation)==null?void 0:p.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>g},{regex:this.regexp,safeValue:g=>this.escapeValue?this.escape(g):g}].forEach(g=>{for(l=0;s=g.regex.exec(t);){const b=s[1].trim();if(a=u(b),a===void 0)if(typeof d=="function"){const y=d(t,s,r);a=Pn(y)?y:""}else if(r&&Object.prototype.hasOwnProperty.call(r,b))a="";else if(f){a=s[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${t}`),a="";else!Pn(a)&&!this.useRawValueToEscape&&(a=jP(a));const v=g.safeValue(a);if(t=t.replace(s[0],yV(v)),f?(g.regex.lastIndex+=v.length,g.regex.lastIndex-=s[0].length):g.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n,i={}){let r,s,a;const l=(c,u)=>{const d=this.nestingOptionsSeparator;if(!c.includes(d))return c;const f=c.split(new RegExp(`${pf(d)}[ ]*{`));let h=`{${f[1]}`;c=f[0],h=this.interpolate(h,a);const p=h.match(/'/g),g=h.match(/"/g);(((p==null?void 0:p.length)??0)%2===0&&!g||((g==null?void 0:g.length)??0)%2!==0)&&(h=h.replace(/'/g,'"'));try{a=JSON.parse(h),u&&(a={...u,...a})}catch(b){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,b),`${c}${d}${h}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,c};for(;r=this.nestingRegexp.exec(t);){let c=[];a={...i},a=a.replace&&!Pn(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const u=/{.*}/s.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(u!==-1&&(c=r[1].slice(u).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),r[1]=r[1].slice(0,u)),s=n(l.call(this,r[1].trim(),a),a),s&&r[0]===t&&!Pn(s))return s;Pn(s)||(s=jP(s)),s||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${t}`),s=""),c.length&&(s=c.reduce((d,f)=>this.format(d,f,i.lng,{...i,interpolationkey:r[1].trim()}),s.trim())),t=t.replace(r[0],yV(jP(s))),this.regexp.lastIndex=0}return t}}const XMe=e=>{let t=e.toLowerCase().trim();const n={};if(e.includes("(")){const i=e.split("(");t=i[0].toLowerCase().trim();const r=i[1].slice(0,-1);t==="currency"&&!r.includes(":")?n.currency||(n.currency=r.trim()):t==="relativetime"&&!r.includes(":")?n.range||(n.range=r.trim()):r.split(";").forEach(a=>{if(a){const[l,...c]=a.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),d=l.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},xV=e=>{const t={};return(n,i,r)=>{let s=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(s={...s,[r.interpolationkey]:void 0});const a=i+JSON.stringify(s);let l=t[a];return l||(l=e(GO(i),r),t[a]=l),l(n)}},YMe=e=>(t,n,i)=>e(GO(n),i)(t);class ZMe{constructor(t={}){this.logger=wd.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const i=n.cacheInBuiltFormats?xV:YMe;this.formats={number:i((r,s)=>{const a=new Intl.NumberFormat(r,{...s});return l=>a.format(l)}),currency:i((r,s)=>{const a=new Intl.NumberFormat(r,{...s,style:"currency"});return l=>a.format(l)}),datetime:i((r,s)=>{const a=new Intl.DateTimeFormat(r,{...s});return l=>a.format(l)}),relativetime:i((r,s)=>{const a=new Intl.RelativeTimeFormat(r,{...s});return l=>a.format(l,s.range||"day")}),list:i((r,s)=>{const a=new Intl.ListFormat(r,{...s});return l=>a.format(l)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=xV(n)}format(t,n,i,r={}){if(!n||t==null)return t;const s=n.split(this.formatSeparator),a=[];for(let c=0;c-1&&!u.includes(")")&&c+1{var h;const{formatName:d,formatOptions:f}=XMe(u);if(this.formats[d]){let p=c;try{const g=((h=r==null?void 0:r.formatParams)==null?void 0:h[r.interpolationkey])||{},b=g.locale||g.lng||r.locale||r.lng||i;p=this.formats[d](c,b,{...f,...r,...g})}catch(g){this.logger.warn(g)}return p}else this.logger.warn(`there was no format function for ${d}`);return c},t)}}const JMe=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class e5e extends Oj{constructor(t,n,i,r={}){var s,a;super(),this.backend=t,this.store=n,this.services=i,this.languageUtils=i.languageUtils,this.options=r,this.logger=wd.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],(a=(s=this.backend)==null?void 0:s.init)==null||a.call(s,i,r.backend,r)}queueLoad(t,n,i,r){const s={},a={},l={},c={};return t.forEach(u=>{let d=!0;n.forEach(f=>{const h=`${u}|${f}`;!i.reload&&this.store.hasResourceBundle(u,f)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?a[h]===void 0&&(a[h]=!0):(this.state[h]=1,d=!1,a[h]===void 0&&(a[h]=!0),s[h]===void 0&&(s[h]=!0),c[f]===void 0&&(c[f]=!0)))}),d||(l[u]=!0)}),(Object.keys(s).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(s),pending:Object.keys(a),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(c)}}loaded(t,n,i){const r=t.split("|"),s=r[0],a=r[1];n&&this.emit("failedLoading",s,a,n),!n&&i&&this.store.addResourceBundle(s,a,i,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&i&&(this.state[t]=0);const l={};this.queue.forEach(c=>{FMe(c.loaded,[s],a),JMe(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{l[u]||(l[u]={});const d=c.loaded[u];d.length&&d.forEach(f=>{l[u][f]===void 0&&(l[u][f]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(c=>!c.done)}read(t,n,i,r=0,s=this.retryTimeout,a){if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:i,tried:r,wait:s,callback:a});return}this.readingCalls++;const l=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&r{this.read(t,n,i,r+1,s*2,a)},s);return}a(u,d)},c=this.backend[i].bind(this.backend);if(c.length===2){try{const u=c(t,n);u&&typeof u.then=="function"?u.then(d=>l(null,d)).catch(l):l(null,u)}catch(u){l(u)}return}return c(t,n,l)}prepareLoading(t,n,i={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();Pn(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Pn(n)&&(n=[n]);const s=this.queueLoad(t,n,i,r);if(!s.toLoad.length)return s.pending.length||r(),null;s.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,i){this.prepareLoading(t,n,{},i)}reload(t,n,i){this.prepareLoading(t,n,{reload:!0},i)}loadOne(t,n=""){const i=t.split("|"),r=i[0],s=i[1];this.read(r,s,"read",void 0,void 0,(a,l)=>{a&&this.logger.warn(`${n}loading namespace ${s} for language ${r} failed`,a),!a&&l&&this.logger.log(`${n}loaded namespace ${s} for language ${r}`,l),this.loaded(t,a,l)})}saveMissing(t,n,i,r,s,a={},l=()=>{}){var c,u,d,f,h;if((u=(c=this.services)==null?void 0:c.utils)!=null&&u.hasLoadedNamespace&&!((f=(d=this.services)==null?void 0:d.utils)!=null&&f.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${i}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if((h=this.backend)!=null&&h.create){const p={...a,isUpdate:s},g=this.backend.create.bind(this.backend);if(g.length<6)try{let b;g.length===5?b=g(t,n,i,r,p):b=g(t,n,i,r),b&&typeof b.then=="function"?b.then(v=>l(null,v)).catch(l):l(null,b)}catch(b){l(b)}else g(t,n,i,r,l,p)}!t||!t[0]||this.store.addResource(t[0],n,i,r)}}}const IP=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Pn(e[1])&&(t.defaultValue=e[1]),Pn(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(i=>{t[i]=n[i]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),wV=e=>(Pn(e.ns)&&(e.ns=[e.ns]),Pn(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Pn(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),TC=()=>{},t5e=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Zw extends Oj{constructor(t={},n){if(super(),this.options=wV(t),this.services={},this.logger=wd,this.modules={external:[]},t5e(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(Pn(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const i=IP();this.options={...i,...this.options,...wV(t)},this.options.interpolation={...i.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler);const r=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?wd.init(r(this.modules.logger),this.options):wd.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=ZMe;const d=new pV(this.options);this.store=new hV(this.options.resources,this.options);const f=this.services;f.logger=wd,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new KMe(d,{prepend:this.options.pluralSeparator}),u&&(f.formatter=r(u),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new vV(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new e5e(r(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(h,...p)=>{this.emit(h,...p)}),this.modules.languageDetector&&(f.languageDetector=r(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=r(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new GA(this.services,this.options),this.translator.on("*",(h,...p)=>{this.emit(h,...p)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,n||(n=TC),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...d)=>this.store[u](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...d)=>(this.store[u](...d),this)});const l=T1(),c=()=>{const u=(d,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(f),n(d,f)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),l}loadResources(t,n=TC){var s,a;let i=n;const r=Pn(t)?t:this.language;if(typeof t=="function"&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if((r==null?void 0:r.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const l=[],c=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&(l.includes(f)||l.push(f))})};r?c(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>c(d)),(a=(s=this.options.preload)==null?void 0:s.forEach)==null||a.call(s,u=>c(u)),this.services.backendConnector.load(l,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(u)})}else i(null)}reloadResources(t,n,i){const r=T1();return typeof t=="function"&&(i=t,t=void 0),typeof n=="function"&&(i=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),i||(i=TC),this.services.backendConnector.reload(t,n,s=>{r.resolve(),i(s)}),r}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&kfe.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!["cimode","dev"].includes(t)){for(let n=0;n{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},s=(l,c)=>{c?this.isLanguageChangingTo===t&&(r(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,i.resolve((...u)=>this.t(...u)),n&&n(l,(...u)=>this.t(...u))},a=l=>{var d,f;!t&&!l&&this.services.languageDetector&&(l=[]);const c=Pn(l)?l:l&&l[0],u=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(Pn(l)?[l]:l);u&&(this.language||r(u),this.translator.language||this.translator.changeLanguage(u),(f=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||f.call(d,u)),this.loadResources(u,h=>{s(h,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t),i}getFixedT(t,n,i,r){const s=r==null?void 0:r.scopeNs,a=(l,c,...u)=>{let d;typeof c!="object"?d=this.options.overloadTranslationOptionHandler([l,c].concat(u)):d={...c},d.lng=d.lng||a.lng,d.lngs=d.lngs||a.lngs;const f=d.ns!==void 0&&d.ns!==null;d.ns=d.ns||a.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||i||a.keyPrefix);const h={...this.options,...d};Array.isArray(s)&&!f&&(h.ns=s),typeof d.keyPrefix=="function"&&(d.keyPrefix=Kg(d.keyPrefix,h));const p=this.options.keySeparator||".";let g;return d.keyPrefix&&Array.isArray(l)?g=l.map(b=>(typeof b=="function"&&(b=Kg(b,h)),`${d.keyPrefix}${p}${b}`)):(typeof l=="function"&&(l=Kg(l,h)),g=d.keyPrefix?`${d.keyPrefix}${p}${l}`:l),this.t(g,d)};return Pn(t)?a.lng=t:a.lngs=t,a.ns=n,a.keyPrefix=i,a}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=n.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const a=(l,c)=>{const u=this.services.backendConnector.state[`${l}|${c}`];return u===-1||u===0||u===2};if(n.precheck){const l=n.precheck(this,a);if(l!==void 0)return l}return!!(this.hasResourceBundle(i,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(i,t)&&(!r||a(s,t)))}loadNamespaces(t,n){const i=T1();return this.options.ns?(Pn(t)&&(t=[t]),t.forEach(r=>{this.options.ns.includes(r)||this.options.ns.push(r)}),this.loadResources(r=>{i.resolve(),n&&n(r)}),i):(n&&n(),Promise.resolve())}loadLanguages(t,n){const i=T1();Pn(t)&&(t=[t]);const r=this.options.preload||[],s=t.filter(a=>!r.includes(a)&&this.services.languageUtils.isSupportedCode(a));return s.length?(this.options.preload=r.concat(s),this.loadResources(a=>{i.resolve(),n&&n(a)}),i):(n&&n(),Promise.resolve())}dir(t){var r,s;if(t||(t=this.resolvedLanguage||(((r=this.languages)==null?void 0:r.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const a=new Intl.Locale(t);if(a&&a.getTextInfo){const l=a.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=((s=this.services)==null?void 0:s.languageUtils)||new pV(IP());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.includes(i.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const i=new Zw(t,n);return i.createInstance=Zw.createInstance,i}cloneInstance(t={},n=TC){const i=t.forkResourceStore;i&&delete t.forkResourceStore;const r={...this.options,...t,isClone:!0},s=new Zw(r);if((t.debug!==void 0||t.prefix!==void 0)&&(s.logger=s.logger.clone(t)),["store","services","language"].forEach(l=>{s[l]=this[l]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},i){const l=Object.keys(this.store.data).reduce((c,u)=>(c[u]={...this.store.data[u]},c[u]=Object.keys(c[u]).reduce((d,f)=>(d[f]={...c[u][f]},d),c[u]),c),{});s.store=new hV(l,r),s.services.resourceStore=s.store}if(t.interpolation){const c={...IP().interpolation,...this.options.interpolation,...t.interpolation},u={...r,interpolation:c};s.services.interpolator=new vV(u)}return s.translator=new GA(s.services,r),s.translator.on("*",(l,...c)=>{s.emit(l,...c)}),s.init(r,n),s.translator.options=r,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Ho=Zw.createInstance();Ho.createInstance;Ho.dir;Ho.init;Ho.loadResources;Ho.reloadResources;Ho.use;Ho.changeLanguage;Ho.getFixedT;Ho.t;Ho.exists;Ho.setDefaultNamespace;Ho.hasLoadedNamespace;Ho.loadNamespaces;Ho.loadLanguages;var Cfe={exports:{}},Gn={};/** * @license React * react.production.js * @@ -51,7 +51,7 @@ Studio:{{studioUrl}} * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var K8=Symbol.for("react.transitional.element"),n5e=Symbol.for("react.portal"),i5e=Symbol.for("react.fragment"),r5e=Symbol.for("react.strict_mode"),s5e=Symbol.for("react.profiler"),a5e=Symbol.for("react.consumer"),o5e=Symbol.for("react.context"),l5e=Symbol.for("react.forward_ref"),c5e=Symbol.for("react.suspense"),u5e=Symbol.for("react.memo"),Tfe=Symbol.for("react.lazy"),d5e=Symbol.for("react.activity"),OV=Symbol.iterator;function f5e(e){return e===null||typeof e!="object"?null:(e=OV&&e[OV]||e["@@iterator"],typeof e=="function"?e:null)}var Afe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_fe=Object.assign,Nfe={};function mx(e,t,n){this.props=e,this.context=t,this.refs=Nfe,this.updater=n||Afe}mx.prototype.isReactComponent={};mx.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};mx.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function jfe(){}jfe.prototype=mx.prototype;function X8(e,t,n){this.props=e,this.context=t,this.refs=Nfe,this.updater=n||Afe}var Y8=X8.prototype=new jfe;Y8.constructor=X8;_fe(Y8,mx.prototype);Y8.isPureReactComponent=!0;var SV=Array.isArray;function KL(){}var Gr={H:null,A:null,T:null,S:null},Rfe=Object.prototype.hasOwnProperty;function Z8(e,t,n){var i=n.ref;return{$$typeof:K8,type:e,key:t,ref:i!==void 0?i:null,props:n}}function h5e(e,t){return Z8(e.type,t,e.props)}function J8(e){return typeof e=="object"&&e!==null&&e.$$typeof===K8}function p5e(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var kV=/\/+/g;function PP(e,t){return typeof e=="object"&&e!==null&&e.key!=null?p5e(""+e.key):t.toString(36)}function m5e(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(KL,KL):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function X0(e,t,n,i,r){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(s){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case K8:case n5e:a=!0;break;case Tfe:return a=e._init,X0(a(e._payload),t,n,i,r)}}if(a)return r=r(e),a=i===""?"."+PP(e,0):i,SV(r)?(n="",a!=null&&(n=a.replace(kV,"$&/")+"/"),X0(r,t,n,"",function(u){return u})):r!=null&&(J8(r)&&(r=h5e(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(kV,"$&/")+"/")+a)),t.push(r)),1;a=0;var l=i===""?".":i+":";if(SV(e))for(var c=0;c<]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function CV(e){const t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(y5e[n[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){const s=e.indexOf("-->");return{type:"comment",comment:s!==-1?e.slice(4,s):""}}const i=new RegExp(v5e);let r=null;for(;r=i.exec(e),r!==null;)if(r[0].trim())if(r[1]){const s=r[1].trim();let a=[s,null];const l=s.indexOf("=");l>-1&&(a=[s.slice(0,l),s.slice(l+1)]),t.attrs[a[0]]=a[1],i.lastIndex--}else r[2]&&(t.attrs[r[2]]=r[3].trim().substring(1,r[3].length-1));return t}const _C=/|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,x5e=/<\/?([^\s]+?)[/\s>]/,w5e=/^\s*$/,O5e=/^(script|style)$/i,xw="\0",S5e=Object.create(null);function Ife(e){e.forEach(function(t){if(t.type==="text"){t.content=t.content.split(xw).join("<");return}if(t.type==="comment"){t.comment=t.comment.split(xw).join("<");return}for(const n in t.attrs){const i=t.attrs[n];typeof i=="string"&&i.indexOf(xw)>-1&&(t.attrs[n]=i.split(xw).join("<"))}t.children.length&&Ife(t.children)})}function k5e(e,t){const n=t&&t.components||S5e,i=t&&t.allowedTags;let r=!1;if(i){const g=typeof i=="function"?i:function(x){return i.indexOf(x)>-1};let b="",v=0;_C.lastIndex=0;let y;for(;y=_C.exec(e);){const x=y[0];b+=e.slice(v,y.index);const O=x.match(x5e);x.startsWith("",e}}function C5e(e){return e.reduce(function(t,n){return t+Pfe("",n)},"")}var T5e={parse:k5e,stringify:C5e};const _2=(e,t,n,i)=>{var s,a,l,c;const r=[n,{code:t,...i||{}}];if((a=(s=e==null?void 0:e.services)==null?void 0:s.logger)!=null&&a.forward)return e.services.logger.forward(r,"warn","react-i18next::",!0);ml(r[0])&&(r[0]=`react-i18next:: ${r[0]}`),(c=(l=e==null?void 0:e.services)==null?void 0:l.logger)!=null&&c.warn?e.services.logger.warn(...r):console!=null&&console.warn&&console.warn(...r)},TV={},Uy=(e,t,n,i)=>{ml(n)&&TV[n]||(ml(n)&&(TV[n]=new Date),_2(e,t,n,i))},Dfe=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},XL=(e,t,n)=>{e.loadNamespaces(t,Dfe(e,n))},AV=(e,t,n,i)=>{if(ml(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return XL(e,n,i);n.forEach(r=>{e.options.ns.indexOf(r)<0&&e.options.ns.push(r)}),e.loadLanguages(t,Dfe(e,i))},A5e=(e,t,n={})=>!t.languages||!t.languages.length?(Uy(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(i,r)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!r(i.isLanguageChangingTo,e))return!1}}),ml=e=>typeof e=="string",Hf=e=>typeof e=="object"&&e!==null,_5e=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,N5e={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},j5e=e=>N5e[e],Mfe=e=>e.replace(_5e,j5e);let YL={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Mfe,transDefaultProps:void 0};const R5e=(e={})=>{YL={...YL,...e}},e9=()=>YL;let Lfe;const I5e=e=>{Lfe=e},t9=()=>Lfe,N2=(e,t)=>{var i;if(!e)return!1;const n=((i=e.props)==null?void 0:i.children)??e.children;return t?n.length>0:!!n},ww=e=>{var n,i;if(!e)return[];const t=((n=e.props)==null?void 0:n.children)??e.children;return(i=e.props)!=null&&i.i18nIsDynamicList?Ep(t):t},P5e=e=>Array.isArray(e)&&e.every(m.isValidElement),Ep=e=>Array.isArray(e)?e:[e],D5e=(e,t)=>{const n={...t};return n.props={...t.props,...e.props},n},M5e=e=>{const t={};if(!e)return t;const n=i=>{Ep(i).forEach(s=>{ml(s)||(N2(s)?n(ww(s)):Hf(s)&&!m.isValidElement(s)&&Object.assign(t,s))})};return n(e),t},ZL=(e,t,n,i)=>{if(!e)return"";let r="";const s=Ep(e),a=t!=null&&t.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return s.forEach((l,c)=>{if(ml(l)){r+=`${l}`;return}if(m.isValidElement(l)){const{props:u,type:d}=l,f=Object.keys(u).length,h=a.indexOf(d)>-1,p=u.children;if(!p&&h&&!f){r+=`<${d}/>`;return}if(!p&&(!h||f)||u.i18nIsDynamicList){r+=`<${c}>`;return}if(h&&f<=1){const b=ml(p)?p:ZL(p,t,n,i);r+=`<${d}>${b}`;return}const g=ZL(p,t,n,i);r+=`<${c}>${g}`;return}if(l===null){_2(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:i});return}if(Hf(l)){const{format:u,...d}=l,f=Object.keys(d);if(f.length===1){const h=u?`${f[0]}, ${u}`:f[0];r+=`{{${h}}}`;return}_2(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:i,child:l});return}_2(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:i,child:l})}),r},L5e=(e,t,n,i,r,s,a)=>{if(n==="")return[];const l=r.transKeepBasicHtmlNodesFor||[],c=n&&new RegExp(l.map(O=>`<${O}`).join("|")).test(n);if(!e&&!t&&!c&&!a)return[n];const u=t??{},d=O=>{Ep(O).forEach(k=>{ml(k)||(N2(k)?d(ww(k)):Hf(k)&&!m.isValidElement(k)&&Object.assign(u,k))})};d(e);const f=Object.keys(u),h=O=>/^\d+$/.test(O)||l.indexOf(O)>-1||f.indexOf(O)>-1,p=T5e.parse(`<0>${n}`,{allowedTags:h}),g={...u,...s},b=(O,w,k)=>{var C;const S=ww(O),E=y(S,w.children,k);return P5e(S)&&E.length===0||(C=O.props)!=null&&C.i18nIsDynamicList?S:E},v=(O,w,k,S,E)=>{O.dummy?(O.children=w,k.push(m.cloneElement(O,{key:S},E?void 0:w))):k.push(...m.Children.map([O],C=>{var _;if(C.type===m.Fragment||((_=C.props)==null?void 0:_.i18nIsDynamicList)!==void 0){const j={key:S};return C&&C.props&&Object.keys(C.props).forEach(A=>{A==="children"||A==="i18nIsDynamicList"||(j[A]=C.props[A])}),m.createElement(C.type,j,E?null:w)}const N={key:S};return C&&C.props&&Object.keys(C.props).forEach(j=>{j==="ref"||j==="children"||(N[j]=C.props[j])}),m.cloneElement(C,N,E?null:w)}))},y=(O,w,k)=>{const S=Ep(O),E=Ep(w),C={};return E.reduce((N,_,j)=>{var F,T;const A=((T=(F=_.children)==null?void 0:F[0])==null?void 0:T.content)&&i.services.interpolator.interpolate(_.children[0].content,g,i.language);if(_.type==="tag"){let P=S[parseInt(_.name,10)];!P&&t&&(P=t[_.name]),k.length===1&&!P&&(P=k[0][_.name]),P||(P={});const R={..._.attrs};a&&Object.keys(R).forEach(K=>{const Q=R[K];ml(Q)&&(R[K]=Mfe(Q))});const L=Object.keys(R).length!==0?D5e({props:R},P):P,M=m.isValidElement(L),U=M&&N2(_,!0)&&!_.voidElement,I=c&&Hf(L)&&L.dummy&&!M,H=Hf(t)&&Object.hasOwnProperty.call(t,_.name);if(ml(L)){const K=i.services.interpolator.interpolate(L,g,i.language);N.push(K)}else if(N2(L)||U){const K=b(L,_,k);v(L,K,N,j)}else if(I){const K=y(S,_.children,k);v(L,K,N,j)}else if(Number.isNaN(parseFloat(_.name)))if(H){const K=b(L,_,k);v(L,K,N,j,_.voidElement)}else if(r.transSupportBasicHtmlNodes&&l.indexOf(_.name)>-1)if(_.voidElement)N.push(m.createElement(_.name,{key:`${_.name}-${j}`}));else{const K=C[_.name]||0;C[_.name]=K+1;let Q,q=0;for(let le=0;le`);else{const K=y(S,_.children,k);N.push(`<${_.name}>${K}`)}else if(Hf(L)&&!M){const K=_.children[0]?A:null;K&&N.push(K)}else v(L,A,N,j,_.children.length!==1||!A)}else if(_.type==="text"){const P=r.transWrapTextNodes,R=typeof r.unescape=="function"?r.unescape:e9().unescape,L=a?R(i.services.interpolator.interpolate(_.content,g,i.language)):i.services.interpolator.interpolate(_.content,g,i.language);P?N.push(m.createElement(P,{key:`${_.name}-${j}`},L)):N.push(L)}return N},[])},x=y([{dummy:!0,children:e||[]}],p,Ep(e||[]));return ww(x[0])},$fe=(e,t,n)=>{const i=e.key||t,r=m.cloneElement(e,{key:i});if(!r.props||!r.props.children||n.indexOf(`${t}/>`)<0&&n.indexOf(`${t} />`)<0)return r;function s(){return m.createElement(m.Fragment,null,r)}return m.createElement(s,{key:i})},$5e=(e,t)=>e.map((n,i)=>$fe(n,i,t)),F5e=(e,t)=>{const n={};return Object.keys(e).forEach(i=>{Object.assign(n,{[i]:$fe(e[i],i,t)})}),n},B5e=(e,t,n,i)=>e?Array.isArray(e)?$5e(e,t):Hf(e)?F5e(e,t):(Uy(n,"TRANS_INVALID_COMPONENTS",' "components" prop expects an object or array',{i18nKey:i}),null):null,U5e=e=>!Hf(e)||Array.isArray(e)?!1:Object.keys(e).reduce((t,n)=>t&&Number.isNaN(Number.parseFloat(n)),!0);function Q5e({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s={},values:a,defaults:l,components:c,ns:u,i18n:d,t:f,shouldUnescape:h,...p}){var I,H,K,Q,q,B;const g=d||t9();if(!g)return Uy(g,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.",{i18nKey:i}),e;const b=f||g.t.bind(g)||(ee=>ee),v={...e9(),...(I=g.options)==null?void 0:I.react};let y=u||b.ns||((H=g.options)==null?void 0:H.defaultNS);y=ml(y)?[y]:y||["translation"];const{transDefaultProps:x}=v,O=x!=null&&x.tOptions?{...x.tOptions,...s}:s,w=h??(x==null?void 0:x.shouldUnescape),k=x!=null&&x.values?{...x.values,...a}:a,S=x!=null&&x.components?{...x.components,...c}:c,E=ZL(e,v,g,i),C=l||(O==null?void 0:O.defaultValue)||E||v.transEmptyNodeValue||(typeof i=="function"?Kg(i):i),{hashTransKey:N}=v,_=i||(N?N(E||C):E||C);(Q=(K=g.options)==null?void 0:K.interpolation)!=null&&Q.defaultVariables?a=k&&Object.keys(k).length>0?{...k,...g.options.interpolation.defaultVariables}:{...g.options.interpolation.defaultVariables}:a=k;const j=M5e(e);j&&typeof j.count=="number"&&t===void 0&&(t=j.count);const A=a||t!==void 0&&!((B=(q=g.options)==null?void 0:q.interpolation)!=null&&B.alwaysFormat)||!e?O.interpolation:{interpolation:{...O.interpolation,prefix:"#$?",suffix:"?$#"}},F={...O,context:r||O.context,count:t,...a,...A,defaultValue:C,ns:y};let T=_?b(_,F):C;T===_&&C&&(T=C);const P=B5e(S,T,g,i);let R=P||e,L=null;U5e(P)&&(L=P,R=e);const M=L5e(R,L,T,g,v,F,w),U=n??v.defaultTransParent;return U?m.createElement(U,p,M):M}const z5e={type:"3rdParty",init(e){R5e(e.options.react),I5e(e)}},Ffe=m.createContext();class V5e{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function KA({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s={},values:a,defaults:l,components:c,ns:u,i18n:d,t:f,shouldUnescape:h,...p}){var x;const{i18n:g,defaultNS:b}=m.useContext(Ffe)||{},v=d||g||t9(),y=f||(v==null?void 0:v.t.bind(v));return Q5e({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s,values:a,defaults:l,components:c,ns:u||(y==null?void 0:y.ns)||b||((x=v==null?void 0:v.options)==null?void 0:x.defaultNS),i18n:v,t:f,shouldUnescape:h,...p})}var Bfe={exports:{}},Ufe={};/** + */var K8=Symbol.for("react.transitional.element"),n5e=Symbol.for("react.portal"),i5e=Symbol.for("react.fragment"),r5e=Symbol.for("react.strict_mode"),s5e=Symbol.for("react.profiler"),a5e=Symbol.for("react.consumer"),o5e=Symbol.for("react.context"),l5e=Symbol.for("react.forward_ref"),c5e=Symbol.for("react.suspense"),u5e=Symbol.for("react.memo"),Tfe=Symbol.for("react.lazy"),d5e=Symbol.for("react.activity"),OV=Symbol.iterator;function f5e(e){return e===null||typeof e!="object"?null:(e=OV&&e[OV]||e["@@iterator"],typeof e=="function"?e:null)}var Afe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_fe=Object.assign,Nfe={};function mx(e,t,n){this.props=e,this.context=t,this.refs=Nfe,this.updater=n||Afe}mx.prototype.isReactComponent={};mx.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};mx.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function jfe(){}jfe.prototype=mx.prototype;function X8(e,t,n){this.props=e,this.context=t,this.refs=Nfe,this.updater=n||Afe}var Y8=X8.prototype=new jfe;Y8.constructor=X8;_fe(Y8,mx.prototype);Y8.isPureReactComponent=!0;var SV=Array.isArray;function KL(){}var Gr={H:null,A:null,T:null,S:null},Rfe=Object.prototype.hasOwnProperty;function Z8(e,t,n){var i=n.ref;return{$$typeof:K8,type:e,key:t,ref:i!==void 0?i:null,props:n}}function h5e(e,t){return Z8(e.type,t,e.props)}function J8(e){return typeof e=="object"&&e!==null&&e.$$typeof===K8}function p5e(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var kV=/\/+/g;function PP(e,t){return typeof e=="object"&&e!==null&&e.key!=null?p5e(""+e.key):t.toString(36)}function m5e(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(KL,KL):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function X0(e,t,n,i,r){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(s){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case K8:case n5e:a=!0;break;case Tfe:return a=e._init,X0(a(e._payload),t,n,i,r)}}if(a)return r=r(e),a=i===""?"."+PP(e,0):i,SV(r)?(n="",a!=null&&(n=a.replace(kV,"$&/")+"/"),X0(r,t,n,"",function(u){return u})):r!=null&&(J8(r)&&(r=h5e(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(kV,"$&/")+"/")+a)),t.push(r)),1;a=0;var l=i===""?".":i+":";if(SV(e))for(var c=0;c<]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function CV(e){const t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(y5e[n[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){const s=e.indexOf("-->");return{type:"comment",comment:s!==-1?e.slice(4,s):""}}const i=new RegExp(v5e);let r=null;for(;r=i.exec(e),r!==null;)if(r[0].trim())if(r[1]){const s=r[1].trim();let a=[s,null];const l=s.indexOf("=");l>-1&&(a=[s.slice(0,l),s.slice(l+1)]),t.attrs[a[0]]=a[1],i.lastIndex--}else r[2]&&(t.attrs[r[2]]=r[3].trim().substring(1,r[3].length-1));return t}const _C=/|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,x5e=/<\/?([^\s]+?)[/\s>]/,w5e=/^\s*$/,O5e=/^(script|style)$/i,xw="\0",S5e=Object.create(null);function Ife(e){e.forEach(function(t){if(t.type==="text"){t.content=t.content.split(xw).join("<");return}if(t.type==="comment"){t.comment=t.comment.split(xw).join("<");return}for(const n in t.attrs){const i=t.attrs[n];typeof i=="string"&&i.indexOf(xw)>-1&&(t.attrs[n]=i.split(xw).join("<"))}t.children.length&&Ife(t.children)})}function k5e(e,t){const n=t&&t.components||S5e,i=t&&t.allowedTags;let r=!1;if(i){const g=typeof i=="function"?i:function(x){return i.indexOf(x)>-1};let b="",v=0;_C.lastIndex=0;let y;for(;y=_C.exec(e);){const x=y[0];b+=e.slice(v,y.index);const O=x.match(x5e);x.startsWith("",e}}function C5e(e){return e.reduce(function(t,n){return t+Pfe("",n)},"")}var T5e={parse:k5e,stringify:C5e};const _2=(e,t,n,i)=>{var s,a,l,c;const r=[n,{code:t,...i||{}}];if((a=(s=e==null?void 0:e.services)==null?void 0:s.logger)!=null&&a.forward)return e.services.logger.forward(r,"warn","react-i18next::",!0);ml(r[0])&&(r[0]=`react-i18next:: ${r[0]}`),(c=(l=e==null?void 0:e.services)==null?void 0:l.logger)!=null&&c.warn?e.services.logger.warn(...r):console!=null&&console.warn&&console.warn(...r)},TV={},Uy=(e,t,n,i)=>{ml(n)&&TV[n]||(ml(n)&&(TV[n]=new Date),_2(e,t,n,i))},Dfe=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},XL=(e,t,n)=>{e.loadNamespaces(t,Dfe(e,n))},AV=(e,t,n,i)=>{if(ml(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return XL(e,n,i);n.forEach(r=>{e.options.ns.indexOf(r)<0&&e.options.ns.push(r)}),e.loadLanguages(t,Dfe(e,i))},A5e=(e,t,n={})=>!t.languages||!t.languages.length?(Uy(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(i,r)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!r(i.isLanguageChangingTo,e))return!1}}),ml=e=>typeof e=="string",Hf=e=>typeof e=="object"&&e!==null,_5e=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,N5e={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},j5e=e=>N5e[e],Mfe=e=>e.replace(_5e,j5e);let YL={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Mfe,transDefaultProps:void 0};const R5e=(e={})=>{YL={...YL,...e}},e9=()=>YL;let Lfe;const I5e=e=>{Lfe=e},t9=()=>Lfe,N2=(e,t)=>{var i;if(!e)return!1;const n=((i=e.props)==null?void 0:i.children)??e.children;return t?n.length>0:!!n},ww=e=>{var n,i;if(!e)return[];const t=((n=e.props)==null?void 0:n.children)??e.children;return(i=e.props)!=null&&i.i18nIsDynamicList?Ep(t):t},P5e=e=>Array.isArray(e)&&e.every(m.isValidElement),Ep=e=>Array.isArray(e)?e:[e],D5e=(e,t)=>{const n={...t};return n.props={...t.props,...e.props},n},M5e=e=>{const t={};if(!e)return t;const n=i=>{Ep(i).forEach(s=>{ml(s)||(N2(s)?n(ww(s)):Hf(s)&&!m.isValidElement(s)&&Object.assign(t,s))})};return n(e),t},ZL=(e,t,n,i)=>{if(!e)return"";let r="";const s=Ep(e),a=t!=null&&t.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return s.forEach((l,c)=>{if(ml(l)){r+=`${l}`;return}if(m.isValidElement(l)){const{props:u,type:d}=l,f=Object.keys(u).length,h=a.indexOf(d)>-1,p=u.children;if(!p&&h&&!f){r+=`<${d}/>`;return}if(!p&&(!h||f)||u.i18nIsDynamicList){r+=`<${c}>`;return}if(h&&f<=1){const b=ml(p)?p:ZL(p,t,n,i);r+=`<${d}>${b}`;return}const g=ZL(p,t,n,i);r+=`<${c}>${g}`;return}if(l===null){_2(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:i});return}if(Hf(l)){const{format:u,...d}=l,f=Object.keys(d);if(f.length===1){const h=u?`${f[0]}, ${u}`:f[0];r+=`{{${h}}}`;return}_2(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:i,child:l});return}_2(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:i,child:l})}),r},L5e=(e,t,n,i,r,s,a)=>{if(n==="")return[];const l=r.transKeepBasicHtmlNodesFor||[],c=n&&new RegExp(l.map(O=>`<${O}`).join("|")).test(n);if(!e&&!t&&!c&&!a)return[n];const u=t??{},d=O=>{Ep(O).forEach(k=>{ml(k)||(N2(k)?d(ww(k)):Hf(k)&&!m.isValidElement(k)&&Object.assign(u,k))})};d(e);const f=Object.keys(u),h=O=>/^\d+$/.test(O)||l.indexOf(O)>-1||f.indexOf(O)>-1,p=T5e.parse(`<0>${n}`,{allowedTags:h}),g={...u,...s},b=(O,w,k)=>{var C;const S=ww(O),E=y(S,w.children,k);return P5e(S)&&E.length===0||(C=O.props)!=null&&C.i18nIsDynamicList?S:E},v=(O,w,k,S,E)=>{O.dummy?(O.children=w,k.push(m.cloneElement(O,{key:S},E?void 0:w))):k.push(...m.Children.map([O],C=>{var _;if(C.type===m.Fragment||((_=C.props)==null?void 0:_.i18nIsDynamicList)!==void 0){const j={key:S};return C&&C.props&&Object.keys(C.props).forEach(A=>{A==="children"||A==="i18nIsDynamicList"||(j[A]=C.props[A])}),m.createElement(C.type,j,E?null:w)}const N={key:S};return C&&C.props&&Object.keys(C.props).forEach(j=>{j==="ref"||j==="children"||(N[j]=C.props[j])}),m.cloneElement(C,N,E?null:w)}))},y=(O,w,k)=>{const S=Ep(O),E=Ep(w),C={};return E.reduce((N,_,j)=>{var F,T;const A=((T=(F=_.children)==null?void 0:F[0])==null?void 0:T.content)&&i.services.interpolator.interpolate(_.children[0].content,g,i.language);if(_.type==="tag"){let P=S[parseInt(_.name,10)];!P&&t&&(P=t[_.name]),k.length===1&&!P&&(P=k[0][_.name]),P||(P={});const R={..._.attrs};a&&Object.keys(R).forEach(Z=>{const Q=R[Z];ml(Q)&&(R[Z]=Mfe(Q))});const L=Object.keys(R).length!==0?D5e({props:R},P):P,M=m.isValidElement(L),U=M&&N2(_,!0)&&!_.voidElement,I=c&&Hf(L)&&L.dummy&&!M,H=Hf(t)&&Object.hasOwnProperty.call(t,_.name);if(ml(L)){const Z=i.services.interpolator.interpolate(L,g,i.language);N.push(Z)}else if(N2(L)||U){const Z=b(L,_,k);v(L,Z,N,j)}else if(I){const Z=y(S,_.children,k);v(L,Z,N,j)}else if(Number.isNaN(parseFloat(_.name)))if(H){const Z=b(L,_,k);v(L,Z,N,j,_.voidElement)}else if(r.transSupportBasicHtmlNodes&&l.indexOf(_.name)>-1)if(_.voidElement)N.push(m.createElement(_.name,{key:`${_.name}-${j}`}));else{const Z=C[_.name]||0;C[_.name]=Z+1;let Q,q=0;for(let ce=0;ce`);else{const Z=y(S,_.children,k);N.push(`<${_.name}>${Z}`)}else if(Hf(L)&&!M){const Z=_.children[0]?A:null;Z&&N.push(Z)}else v(L,A,N,j,_.children.length!==1||!A)}else if(_.type==="text"){const P=r.transWrapTextNodes,R=typeof r.unescape=="function"?r.unescape:e9().unescape,L=a?R(i.services.interpolator.interpolate(_.content,g,i.language)):i.services.interpolator.interpolate(_.content,g,i.language);P?N.push(m.createElement(P,{key:`${_.name}-${j}`},L)):N.push(L)}return N},[])},x=y([{dummy:!0,children:e||[]}],p,Ep(e||[]));return ww(x[0])},$fe=(e,t,n)=>{const i=e.key||t,r=m.cloneElement(e,{key:i});if(!r.props||!r.props.children||n.indexOf(`${t}/>`)<0&&n.indexOf(`${t} />`)<0)return r;function s(){return m.createElement(m.Fragment,null,r)}return m.createElement(s,{key:i})},$5e=(e,t)=>e.map((n,i)=>$fe(n,i,t)),F5e=(e,t)=>{const n={};return Object.keys(e).forEach(i=>{Object.assign(n,{[i]:$fe(e[i],i,t)})}),n},B5e=(e,t,n,i)=>e?Array.isArray(e)?$5e(e,t):Hf(e)?F5e(e,t):(Uy(n,"TRANS_INVALID_COMPONENTS",' "components" prop expects an object or array',{i18nKey:i}),null):null,U5e=e=>!Hf(e)||Array.isArray(e)?!1:Object.keys(e).reduce((t,n)=>t&&Number.isNaN(Number.parseFloat(n)),!0);function Q5e({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s={},values:a,defaults:l,components:c,ns:u,i18n:d,t:f,shouldUnescape:h,...p}){var I,H,Z,Q,q,B;const g=d||t9();if(!g)return Uy(g,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.",{i18nKey:i}),e;const b=f||g.t.bind(g)||(te=>te),v={...e9(),...(I=g.options)==null?void 0:I.react};let y=u||b.ns||((H=g.options)==null?void 0:H.defaultNS);y=ml(y)?[y]:y||["translation"];const{transDefaultProps:x}=v,O=x!=null&&x.tOptions?{...x.tOptions,...s}:s,w=h??(x==null?void 0:x.shouldUnescape),k=x!=null&&x.values?{...x.values,...a}:a,S=x!=null&&x.components?{...x.components,...c}:c,E=ZL(e,v,g,i),C=l||(O==null?void 0:O.defaultValue)||E||v.transEmptyNodeValue||(typeof i=="function"?Kg(i):i),{hashTransKey:N}=v,_=i||(N?N(E||C):E||C);(Q=(Z=g.options)==null?void 0:Z.interpolation)!=null&&Q.defaultVariables?a=k&&Object.keys(k).length>0?{...k,...g.options.interpolation.defaultVariables}:{...g.options.interpolation.defaultVariables}:a=k;const j=M5e(e);j&&typeof j.count=="number"&&t===void 0&&(t=j.count);const A=a||t!==void 0&&!((B=(q=g.options)==null?void 0:q.interpolation)!=null&&B.alwaysFormat)||!e?O.interpolation:{interpolation:{...O.interpolation,prefix:"#$?",suffix:"?$#"}},F={...O,context:r||O.context,count:t,...a,...A,defaultValue:C,ns:y};let T=_?b(_,F):C;T===_&&C&&(T=C);const P=B5e(S,T,g,i);let R=P||e,L=null;U5e(P)&&(L=P,R=e);const M=L5e(R,L,T,g,v,F,w),U=n??v.defaultTransParent;return U?m.createElement(U,p,M):M}const z5e={type:"3rdParty",init(e){R5e(e.options.react),I5e(e)}},Ffe=m.createContext();class V5e{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function KA({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s={},values:a,defaults:l,components:c,ns:u,i18n:d,t:f,shouldUnescape:h,...p}){var x;const{i18n:g,defaultNS:b}=m.useContext(Ffe)||{},v=d||g||t9(),y=f||(v==null?void 0:v.t.bind(v));return Q5e({children:e,count:t,parent:n,i18nKey:i,context:r,tOptions:s,values:a,defaults:l,components:c,ns:u||(y==null?void 0:y.ns)||b||((x=v==null?void 0:v.options)==null?void 0:x.defaultNS),i18n:v,t:f,shouldUnescape:h,...p})}var Bfe={exports:{}},Ufe={};/** * @license React * use-sync-external-store-shim.production.js * @@ -59,7 +59,7 @@ Studio:{{studioUrl}} * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Ov=m;function H5e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var q5e=typeof Object.is=="function"?Object.is:H5e,W5e=Ov.useState,G5e=Ov.useEffect,K5e=Ov.useLayoutEffect,X5e=Ov.useDebugValue;function Y5e(e,t){var n=t(),i=W5e({inst:{value:n,getSnapshot:t}}),r=i[0].inst,s=i[1];return K5e(function(){r.value=n,r.getSnapshot=t,DP(r)&&s({inst:r})},[e,n,t]),G5e(function(){return DP(r)&&s({inst:r}),e(function(){DP(r)&&s({inst:r})})},[e]),X5e(n),n}function DP(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!q5e(e,n)}catch{return!0}}function Z5e(e,t){return t()}var J5e=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Z5e:Y5e;Ufe.useSyncExternalStore=Ov.useSyncExternalStore!==void 0?Ov.useSyncExternalStore:J5e;Bfe.exports=Ufe;var Qfe=Bfe.exports;const eLe=(e,t)=>{if(ml(t))return t;if(Hf(t)&&ml(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const n=e[e.length-1];return typeof n=="function"?"":n}return e},tLe={t:eLe,ready:!1},nLe=()=>()=>{},Ae=(e,t={})=>{var N,_,j;const{i18n:n}=t,{i18n:i,defaultNS:r}=m.useContext(Ffe)||{},s=n||i||t9();s&&!s.reportNamespaces&&(s.reportNamespaces=new V5e),s||Uy(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.");const a=m.useMemo(()=>{var A;return{...e9(),...(A=s==null?void 0:s.options)==null?void 0:A.react,...t}},[s,t]),{useSuspense:l,keyPrefix:c}=a,u=e||r||((N=s==null?void 0:s.options)==null?void 0:N.defaultNS),d=ml(u)?[u]:u||["translation"],f=m.useMemo(()=>d,d);(j=(_=s==null?void 0:s.reportNamespaces)==null?void 0:_.addUsedNamespaces)==null||j.call(_,f);const h=m.useRef(0),p=m.useCallback(A=>{if(!s)return nLe;const{bindI18n:F,bindI18nStore:T}=a,P=()=>{h.current+=1,A()};return F&&s.on(F,P),T&&s.store.on(T,P),()=>{F&&F.split(" ").forEach(R=>s.off(R,P)),T&&T.split(" ").forEach(R=>s.store.off(R,P))}},[s,a]),g=m.useRef(),b=m.useCallback(()=>{if(!s)return tLe;const A=!!(s.isInitialized||s.initializedStoreOnce)&&f.every(M=>A5e(M,s,a)),F=t.lng||s.language,T=h.current,P=g.current;if(P&&P.ready===A&&P.lng===F&&P.keyPrefix===c&&P.revision===T)return P;const L={t:s.getFixedT(F,a.nsMode==="fallback"?f:f[0],c,{scopeNs:f}),ready:A,lng:F,keyPrefix:c,revision:T};return g.current=L,L},[s,f,c,a,t.lng]),[v,y]=m.useState(0),{t:x,ready:O}=Qfe.useSyncExternalStore(p,b,b);m.useEffect(()=>{if(s&&!O&&!l){const A=()=>y(F=>F+1);t.lng?AV(s,t.lng,f,A):XL(s,f,A)}},[s,t.lng,f,O,l,v]);const w=s||{},k=m.useRef(null),S=m.useRef(),E=A=>{const F=Object.getOwnPropertyDescriptors(A);F.__original&&delete F.__original;const T=Object.create(Object.getPrototypeOf(A),F);if(!Object.prototype.hasOwnProperty.call(T,"__original"))try{Object.defineProperty(T,"__original",{value:A,writable:!1,enumerable:!1,configurable:!1})}catch{}return T},C=m.useMemo(()=>{const A=w,F=A==null?void 0:A.language;let T=A;A&&(k.current&&k.current.__original===A?S.current!==F?(T=E(A),k.current=T,S.current=F):T=k.current:(T=E(A),k.current=T,S.current=F));const P=!O&&!l?(...L)=>(Uy(s,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),x(...L)):x,R=[P,T,O];return R.t=P,R.i18n=T,R.ready=O,R},[x,w,O,w.resolvedLanguage,w.language,w.languages]);if(s&&l&&!O){let A=!1;try{A=!1}catch{}throw A&&Uy(s,"SUSPENDED_WHILE_LOADING","useTranslation: suspended while translations are loading (useSuspense is true by default). Add a boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook"),new Promise(F=>{const T=()=>F();t.lng?AV(s,t.lng,f,T):XL(s,f,T)})}return C},zfe=DMe(),sn=Ho.createInstance();sn.use(z5e).init({resources:{"en-US":{adk:cre,app:Ere,conversation:tse},"zh-CN":{adk:Cle,app:Qle,conversation:yce}},lng:zfe,fallbackLng:xj,supportedLngs:[...G8],defaultNS:"common",interpolation:{escapeValue:!1},initAsync:!1});Ofe(zfe);sn.on("languageChanged",e=>{const t=wj(e)??xj;Ofe(t)});const iLe=Object.assign({"./resources/en-US/adk.json":MDe,"./resources/en-US/app.json":LDe,"./resources/en-US/automations.json":$De,"./resources/en-US/common.json":BDe,"./resources/en-US/conversation.json":UDe,"./resources/en-US/create.json":QDe,"./resources/en-US/cronjobs.json":VDe,"./resources/en-US/feedback.json":qDe,"./resources/en-US/migrations.json":GDe,"./resources/en-US/newChat.json":KDe,"./resources/en-US/sandbox.json":XDe,"./resources/en-US/shell.json":ZDe,"./resources/en-US/sidebar.json":eMe,"./resources/en-US/skills.json":tMe,"./resources/en-US/ui.json":iMe,"./resources/en-US/websiteIntegration.json":sMe,"./resources/en-US/workspaceTools.json":aMe,"./resources/zh-CN/adk.json":oMe,"./resources/zh-CN/app.json":lMe,"./resources/zh-CN/automations.json":cMe,"./resources/zh-CN/common.json":dMe,"./resources/zh-CN/conversation.json":fMe,"./resources/zh-CN/create.json":hMe,"./resources/zh-CN/cronjobs.json":mMe,"./resources/zh-CN/feedback.json":bMe,"./resources/zh-CN/migrations.json":vMe,"./resources/zh-CN/newChat.json":xMe,"./resources/zh-CN/sandbox.json":wMe,"./resources/zh-CN/shell.json":SMe,"./resources/zh-CN/sidebar.json":EMe,"./resources/zh-CN/skills.json":CMe,"./resources/zh-CN/ui.json":AMe,"./resources/zh-CN/websiteIntegration.json":NMe,"./resources/zh-CN/workspaceTools.json":jMe});function rLe(){const e={};for(const[t,n]of Object.entries(iLe)){const i=t.match(/\/resources\/([^/]+)\/([^/]+)\.json$/);if(!i)continue;const[,r,s]=i;e[r]??(e[r]={}),e[r][s]=n.default}return e}for(const[e,t]of Object.entries(rLe()))for(const[n,i]of Object.entries(t??{}))sn.addResourceBundle(e,n,i,!0,!0);async function sLe(e){MMe(e),await sn.changeLanguage(e)}var Vfe={exports:{}},Sj={},Hfe={exports:{}},qfe={};/** + */var Ov=m;function H5e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var q5e=typeof Object.is=="function"?Object.is:H5e,W5e=Ov.useState,G5e=Ov.useEffect,K5e=Ov.useLayoutEffect,X5e=Ov.useDebugValue;function Y5e(e,t){var n=t(),i=W5e({inst:{value:n,getSnapshot:t}}),r=i[0].inst,s=i[1];return K5e(function(){r.value=n,r.getSnapshot=t,DP(r)&&s({inst:r})},[e,n,t]),G5e(function(){return DP(r)&&s({inst:r}),e(function(){DP(r)&&s({inst:r})})},[e]),X5e(n),n}function DP(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!q5e(e,n)}catch{return!0}}function Z5e(e,t){return t()}var J5e=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Z5e:Y5e;Ufe.useSyncExternalStore=Ov.useSyncExternalStore!==void 0?Ov.useSyncExternalStore:J5e;Bfe.exports=Ufe;var Qfe=Bfe.exports;const eLe=(e,t)=>{if(ml(t))return t;if(Hf(t)&&ml(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const n=e[e.length-1];return typeof n=="function"?"":n}return e},tLe={t:eLe,ready:!1},nLe=()=>()=>{},Ce=(e,t={})=>{var N,_,j;const{i18n:n}=t,{i18n:i,defaultNS:r}=m.useContext(Ffe)||{},s=n||i||t9();s&&!s.reportNamespaces&&(s.reportNamespaces=new V5e),s||Uy(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.");const a=m.useMemo(()=>{var A;return{...e9(),...(A=s==null?void 0:s.options)==null?void 0:A.react,...t}},[s,t]),{useSuspense:l,keyPrefix:c}=a,u=e||r||((N=s==null?void 0:s.options)==null?void 0:N.defaultNS),d=ml(u)?[u]:u||["translation"],f=m.useMemo(()=>d,d);(j=(_=s==null?void 0:s.reportNamespaces)==null?void 0:_.addUsedNamespaces)==null||j.call(_,f);const h=m.useRef(0),p=m.useCallback(A=>{if(!s)return nLe;const{bindI18n:F,bindI18nStore:T}=a,P=()=>{h.current+=1,A()};return F&&s.on(F,P),T&&s.store.on(T,P),()=>{F&&F.split(" ").forEach(R=>s.off(R,P)),T&&T.split(" ").forEach(R=>s.store.off(R,P))}},[s,a]),g=m.useRef(),b=m.useCallback(()=>{if(!s)return tLe;const A=!!(s.isInitialized||s.initializedStoreOnce)&&f.every(M=>A5e(M,s,a)),F=t.lng||s.language,T=h.current,P=g.current;if(P&&P.ready===A&&P.lng===F&&P.keyPrefix===c&&P.revision===T)return P;const L={t:s.getFixedT(F,a.nsMode==="fallback"?f:f[0],c,{scopeNs:f}),ready:A,lng:F,keyPrefix:c,revision:T};return g.current=L,L},[s,f,c,a,t.lng]),[v,y]=m.useState(0),{t:x,ready:O}=Qfe.useSyncExternalStore(p,b,b);m.useEffect(()=>{if(s&&!O&&!l){const A=()=>y(F=>F+1);t.lng?AV(s,t.lng,f,A):XL(s,f,A)}},[s,t.lng,f,O,l,v]);const w=s||{},k=m.useRef(null),S=m.useRef(),E=A=>{const F=Object.getOwnPropertyDescriptors(A);F.__original&&delete F.__original;const T=Object.create(Object.getPrototypeOf(A),F);if(!Object.prototype.hasOwnProperty.call(T,"__original"))try{Object.defineProperty(T,"__original",{value:A,writable:!1,enumerable:!1,configurable:!1})}catch{}return T},C=m.useMemo(()=>{const A=w,F=A==null?void 0:A.language;let T=A;A&&(k.current&&k.current.__original===A?S.current!==F?(T=E(A),k.current=T,S.current=F):T=k.current:(T=E(A),k.current=T,S.current=F));const P=!O&&!l?(...L)=>(Uy(s,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),x(...L)):x,R=[P,T,O];return R.t=P,R.i18n=T,R.ready=O,R},[x,w,O,w.resolvedLanguage,w.language,w.languages]);if(s&&l&&!O){let A=!1;try{A=!1}catch{}throw A&&Uy(s,"SUSPENDED_WHILE_LOADING","useTranslation: suspended while translations are loading (useSuspense is true by default). Add a boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook"),new Promise(F=>{const T=()=>F();t.lng?AV(s,t.lng,f,T):XL(s,f,T)})}return C},zfe=DMe(),ln=Ho.createInstance();ln.use(z5e).init({resources:{"en-US":{adk:cre,app:Ere,conversation:tse},"zh-CN":{adk:Cle,app:Qle,conversation:yce}},lng:zfe,fallbackLng:xj,supportedLngs:[...G8],defaultNS:"common",interpolation:{escapeValue:!1},initAsync:!1});Ofe(zfe);ln.on("languageChanged",e=>{const t=wj(e)??xj;Ofe(t)});const iLe=Object.assign({"./resources/en-US/adk.json":MDe,"./resources/en-US/app.json":LDe,"./resources/en-US/automations.json":$De,"./resources/en-US/common.json":BDe,"./resources/en-US/conversation.json":UDe,"./resources/en-US/create.json":QDe,"./resources/en-US/cronjobs.json":VDe,"./resources/en-US/feedback.json":qDe,"./resources/en-US/migrations.json":GDe,"./resources/en-US/newChat.json":KDe,"./resources/en-US/sandbox.json":XDe,"./resources/en-US/shell.json":ZDe,"./resources/en-US/sidebar.json":eMe,"./resources/en-US/skills.json":tMe,"./resources/en-US/ui.json":iMe,"./resources/en-US/websiteIntegration.json":sMe,"./resources/en-US/workspaceTools.json":aMe,"./resources/zh-CN/adk.json":oMe,"./resources/zh-CN/app.json":lMe,"./resources/zh-CN/automations.json":cMe,"./resources/zh-CN/common.json":dMe,"./resources/zh-CN/conversation.json":fMe,"./resources/zh-CN/create.json":hMe,"./resources/zh-CN/cronjobs.json":mMe,"./resources/zh-CN/feedback.json":bMe,"./resources/zh-CN/migrations.json":vMe,"./resources/zh-CN/newChat.json":xMe,"./resources/zh-CN/sandbox.json":wMe,"./resources/zh-CN/shell.json":SMe,"./resources/zh-CN/sidebar.json":EMe,"./resources/zh-CN/skills.json":CMe,"./resources/zh-CN/ui.json":AMe,"./resources/zh-CN/websiteIntegration.json":NMe,"./resources/zh-CN/workspaceTools.json":jMe});function rLe(){const e={};for(const[t,n]of Object.entries(iLe)){const i=t.match(/\/resources\/([^/]+)\/([^/]+)\.json$/);if(!i)continue;const[,r,s]=i;e[r]??(e[r]={}),e[r][s]=n.default}return e}for(const[e,t]of Object.entries(rLe()))for(const[n,i]of Object.entries(t??{}))ln.addResourceBundle(e,n,i,!0,!0);async function sLe(e){MMe(e),await ln.changeLanguage(e)}var Vfe={exports:{}},Sj={},Hfe={exports:{}},qfe={};/** * @license React * scheduler.production.js * @@ -67,7 +67,7 @@ Studio:{{studioUrl}} * * 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(R,L){var M=R.length;R.push(L);e:for(;0>>1,I=R[U];if(0>>1;Ur(Q,M))qr(B,Q)?(R[U]=B,R[q]=M,U=q):(R[U]=Q,R[K]=M,U=K);else if(qr(B,M))R[U]=B,R[q]=M,U=q;else break e}}return L}function r(R,L){var M=R.sortIndex-L.sortIndex;return M!==0?M:R.id-L.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.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,g=!1,b=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function w(R){for(var L=n(u);L!==null;){if(L.callback===null)i(u);else if(L.startTime<=R)i(u),L.sortIndex=L.expirationTime,t(c,L);else break;L=n(u)}}function k(R){if(b=!1,w(R),!g)if(n(c)!==null)g=!0,S||(S=!0,A());else{var L=n(u);L!==null&&P(k,L.startTime-R)}}var S=!1,E=-1,C=5,N=-1;function _(){return v?!0:!(e.unstable_now()-NR&&_());){var U=f.callback;if(typeof U=="function"){f.callback=null,h=f.priorityLevel;var I=U(f.expirationTime<=R);if(R=e.unstable_now(),typeof I=="function"){f.callback=I,w(R),L=!0;break t}f===n(c)&&i(c),w(R)}else i(c);f=n(c)}if(f!==null)L=!0;else{var H=n(u);H!==null&&P(k,H.startTime-R),L=!1}}break e}finally{f=null,h=M,p=!1}L=void 0}}finally{L?A():S=!1}}}var A;if(typeof O=="function")A=function(){O(j)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,T=F.port2;F.port1.onmessage=j,A=function(){T.postMessage(null)}}else A=function(){y(j,0)};function P(R,L){E=y(function(){R(e.unstable_now())},L)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_forceFrameRate=function(R){0>R||125U?(R.sortIndex=M,t(u,R),n(c)===null&&R===n(u)&&(b?(x(E),E=-1):b=!0,P(k,M-U))):(R.sortIndex=I,t(c,R),g||p||(g=!0,S||(S=!0,A()))),R},e.unstable_shouldYield=_,e.unstable_wrapCallback=function(R){var L=h;return function(){var M=h;h=L;try{return R.apply(this,arguments)}finally{h=M}}}})(qfe);Hfe.exports=qfe;var aLe=Hfe.exports,Wfe={exports:{}},qo={};/** + */(function(e){function t(R,L){var M=R.length;R.push(L);e:for(;0>>1,I=R[U];if(0>>1;Ur(Q,M))qr(B,Q)?(R[U]=B,R[q]=M,U=q):(R[U]=Q,R[Z]=M,U=Z);else if(qr(B,M))R[U]=B,R[q]=M,U=q;else break e}}return L}function r(R,L){var M=R.sortIndex-L.sortIndex;return M!==0?M:R.id-L.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.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,g=!1,b=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function w(R){for(var L=n(u);L!==null;){if(L.callback===null)i(u);else if(L.startTime<=R)i(u),L.sortIndex=L.expirationTime,t(c,L);else break;L=n(u)}}function k(R){if(b=!1,w(R),!g)if(n(c)!==null)g=!0,S||(S=!0,A());else{var L=n(u);L!==null&&P(k,L.startTime-R)}}var S=!1,E=-1,C=5,N=-1;function _(){return v?!0:!(e.unstable_now()-NR&&_());){var U=f.callback;if(typeof U=="function"){f.callback=null,h=f.priorityLevel;var I=U(f.expirationTime<=R);if(R=e.unstable_now(),typeof I=="function"){f.callback=I,w(R),L=!0;break t}f===n(c)&&i(c),w(R)}else i(c);f=n(c)}if(f!==null)L=!0;else{var H=n(u);H!==null&&P(k,H.startTime-R),L=!1}}break e}finally{f=null,h=M,p=!1}L=void 0}}finally{L?A():S=!1}}}var A;if(typeof O=="function")A=function(){O(j)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,T=F.port2;F.port1.onmessage=j,A=function(){T.postMessage(null)}}else A=function(){y(j,0)};function P(R,L){E=y(function(){R(e.unstable_now())},L)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_forceFrameRate=function(R){0>R||125U?(R.sortIndex=M,t(u,R),n(c)===null&&R===n(u)&&(b?(x(E),E=-1):b=!0,P(k,M-U))):(R.sortIndex=I,t(c,R),g||p||(g=!0,S||(S=!0,A()))),R},e.unstable_shouldYield=_,e.unstable_wrapCallback=function(R){var L=h;return function(){var M=h;h=L;try{return R.apply(this,arguments)}finally{h=M}}}})(qfe);Hfe.exports=qfe;var aLe=Hfe.exports,Wfe={exports:{}},qo={};/** * @license React * react-dom.production.js * @@ -83,15 +83,15 @@ Studio:{{studioUrl}} * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var ya=aLe,Xfe=m,uLe=Li;function ft(e){var t="https://react.dev/errors/"+e;if(1fy||(e.current=r3[fy],r3[fy]=null,fy--)}function Dr(e,t){fy++,r3[fy]=e.current,e.current=t}var Rd=Hd(null),KO=Hd(null),Hp=Hd(null),XA=Hd(null);function YA(e,t){switch(Dr(Hp,t),Dr(KO,e),Dr(Rd,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?MH(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=MH(t),e=Ome(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Fa(Rd),Dr(Rd,e)}function Sv(){Fa(Rd),Fa(KO),Fa(Hp)}function s3(e){e.memoizedState!==null&&Dr(XA,e);var t=Rd.current,n=Ome(t,e.type);t!==n&&(Dr(KO,e),Dr(Rd,n))}function ZA(e){KO.current===e&&(Fa(Rd),Fa(KO)),XA.current===e&&(Fa(XA),aS._currentValue=Xg)}var MP,jV;function hg(e){if(MP===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);MP=t&&t[1]||"",jV=-1fy||(e.current=r3[fy],r3[fy]=null,fy--)}function Dr(e,t){fy++,r3[fy]=e.current,e.current=t}var Rd=Hd(null),KO=Hd(null),Hp=Hd(null),XA=Hd(null);function YA(e,t){switch(Dr(Hp,t),Dr(KO,e),Dr(Rd,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?MH(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=MH(t),e=Ome(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Fa(Rd),Dr(Rd,e)}function Sv(){Fa(Rd),Fa(KO),Fa(Hp)}function s3(e){e.memoizedState!==null&&Dr(XA,e);var t=Rd.current,n=Ome(t,e.type);t!==n&&(Dr(KO,e),Dr(Rd,n))}function ZA(e){KO.current===e&&(Fa(Rd),Fa(KO)),XA.current===e&&(Fa(XA),aS._currentValue=Xg)}var MP,jV;function hg(e){if(MP===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);MP=t&&t[1]||"",jV=-1)":-1r||c[i]!==u[r]){var d=` `+c[i].replace(" at new "," at ");return e.displayName&&d.includes("")&&(d=d.replace("",e.displayName)),d}while(1<=i&&0<=r);break}}}finally{LP=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?hg(n):""}function mLe(e,t){switch(e.tag){case 26:case 27:case 5:return hg(e.type);case 16:return hg("Lazy");case 13:return e.child!==t&&t!==null?hg("Suspense Fallback"):hg("Suspense");case 19:return hg("SuspenseList");case 0:case 15:return $P(e.type,!1);case 11:return $P(e.type.render,!1);case 1:return $P(e.type,!0);case 31:return hg("Activity");default:return""}}function RV(e){try{var t="",n=null;do t+=mLe(e,n),n=e,e=e.return;while(e);return t}catch(i){return` Error generating stack: `+i.message+` -`+i.stack}}var a3=Object.prototype.hasOwnProperty,r9=ya.unstable_scheduleCallback,FP=ya.unstable_cancelCallback,gLe=ya.unstable_shouldYield,bLe=ya.unstable_requestPaint,nc=ya.unstable_now,yLe=ya.unstable_getCurrentPriorityLevel,ihe=ya.unstable_ImmediatePriority,rhe=ya.unstable_UserBlockingPriority,JA=ya.unstable_NormalPriority,vLe=ya.unstable_LowPriority,she=ya.unstable_IdlePriority,xLe=ya.log,wLe=ya.unstable_setDisableYieldValue,Ck=null,ic=null;function Pp(e){if(typeof xLe=="function"&&wLe(e),ic&&typeof ic.setStrictMode=="function")try{ic.setStrictMode(Ck,e)}catch{}}var rc=Math.clz32?Math.clz32:kLe,OLe=Math.log,SLe=Math.LN2;function kLe(e){return e>>>=0,e===0?32:31-(OLe(e)/SLe|0)|0}var jC=256,RC=262144,IC=4194304;function pg(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ej(e,t,n){var i=e.pendingLanes;if(i===0)return 0;var r=0,s=e.suspendedLanes,a=e.pingedLanes;e=e.warmLanes;var l=i&134217727;return l!==0?(i=l&~s,i!==0?r=pg(i):(a&=l,a!==0?r=pg(a):n||(n=l&~e,n!==0&&(r=pg(n))))):(l=i&~s,l!==0?r=pg(l):a!==0?r=pg(a):n||(n=i&~e,n!==0&&(r=pg(n)))),r===0?0:t!==0&&t!==r&&!(t&s)&&(s=r&-r,n=t&-t,s>=n||s===32&&(n&4194048)!==0)?t:r}function Tk(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ELe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ahe(){var e=IC;return IC<<=1,!(IC&62914560)&&(IC=4194304),e}function BP(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ak(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function CLe(e,t,n,i,r,s){var a=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,u=e.hiddenUpdates;for(n=a&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var RLe=/[\n"\\]/g;function Fc(e){return e.replace(RLe,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function c3(e,t,n,i,r,s,a,l){e.name="",a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?e.type=a:e.removeAttribute("type"),t!=null?a==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Pc(t)):e.value!==""+Pc(t)&&(e.value=""+Pc(t)):a!=="submit"&&a!=="reset"||e.removeAttribute("value"),t!=null?u3(e,a,Pc(t)):n!=null?u3(e,a,Pc(n)):i!=null&&e.removeAttribute("value"),r==null&&s!=null&&(e.defaultChecked=!!s),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+Pc(l):e.removeAttribute("name")}function mhe(e,t,n,i,r,s,a,l){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){l3(e);return}n=n!=null?""+Pc(n):"",t=t!=null?""+Pc(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=l?e.checked:!!i,e.defaultChecked=!!i,a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.name=a),l3(e)}function u3(e,t,n){t==="number"&&e_(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function zy(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f3=!1;if(ph)try{var _1={};Object.defineProperty(_1,"passive",{get:function(){f3=!0}}),window.addEventListener("test",_1,_1),window.removeEventListener("test",_1,_1)}catch{f3=!1}var Dp=null,u9=null,I2=null;function xhe(){if(I2)return I2;var e,t=u9,n=t.length,i,r="value"in Dp?Dp.value:Dp.textContent,s=r.length;for(e=0;e=eO),zV=" ",VV=!1;function Ohe(e,t){switch(e){case"keyup":return a3e.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function She(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var my=!1;function l3e(e,t){switch(e){case"compositionend":return She(t);case"keypress":return t.which!==32?null:(VV=!0,zV);case"textInput":return e=t.data,e===zV&&VV?null:e;default:return null}}function c3e(e,t){if(my)return e==="compositionend"||!f9&&Ohe(e,t)?(e=xhe(),I2=u9=Dp=null,my=!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=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=KV(n)}}function The(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?The(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ahe(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=e_(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=e_(e.document)}return t}function h9(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var b3e=ph&&"documentMode"in document&&11>=document.documentMode,gy=null,h3=null,nO=null,p3=!1;function YV(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;p3||gy==null||gy!==e_(i)||(i=gy,"selectionStart"in i&&h9(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),nO&&ZO(nO,i)||(nO=i,i=y_(h3,"onSelect"),0>=a,r-=a,Od=1<<32-rc(t)+r|n<C?(N=E,E=null):N=E.sibling;var _=h(y,E,O[C],w);if(_===null){E===null&&(E=N);break}e&&E&&_.alternate===null&&t(y,E),x=s(_,x,C),S===null?k=_:S.sibling=_,S=_,E=N}if(C===O.length)return n(y,E),Mi&&Pf(y,C),k;if(E===null){for(;CC?(N=E,E=null):N=E.sibling;var j=h(y,E,_.value,w);if(j===null){E===null&&(E=N);break}e&&E&&j.alternate===null&&t(y,E),x=s(j,x,C),S===null?k=j:S.sibling=j,S=j,E=N}if(_.done)return n(y,E),Mi&&Pf(y,C),k;if(E===null){for(;!_.done;C++,_=O.next())_=f(y,_.value,w),_!==null&&(x=s(_,x,C),S===null?k=_:S.sibling=_,S=_);return Mi&&Pf(y,C),k}for(E=i(E);!_.done;C++,_=O.next())_=p(E,y,C,_.value,w),_!==null&&(e&&_.alternate!==null&&E.delete(_.key===null?C:_.key),x=s(_,x,C),S===null?k=_:S.sibling=_,S=_);return e&&E.forEach(function(A){return t(y,A)}),Mi&&Pf(y,C),k}function v(y,x,O,w){if(typeof O=="object"&&O!==null&&O.type===dy&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case NC:e:{for(var k=O.key;x!==null;){if(x.key===k){if(k=O.type,k===dy){if(x.tag===7){n(y,x.sibling),w=r(x,O.props.children),w.return=y,y=w;break e}}else if(x.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===vp&&mg(k)===x.type){n(y,x.sibling),w=r(x,O.props),j1(w,O),w.return=y,y=w;break e}n(y,x);break}else t(y,x);x=x.sibling}O.type===dy?(w=Yg(O.props.children,y.mode,w,O.key),w.return=y,y=w):(w=D2(O.type,O.key,O.props,null,y.mode,w),j1(w,O),w.return=y,y=w)}return a(y);case Ow:e:{for(k=O.key;x!==null;){if(x.key===k)if(x.tag===4&&x.stateNode.containerInfo===O.containerInfo&&x.stateNode.implementation===O.implementation){n(y,x.sibling),w=r(x,O.children||[]),w.return=y,y=w;break e}else{n(y,x);break}else t(y,x);x=x.sibling}w=KP(O,y.mode,w),w.return=y,y=w}return a(y);case vp:return O=mg(O),v(y,x,O,w)}if(Sw(O))return g(y,x,O,w);if(A1(O)){if(k=A1(O),typeof k!="function")throw Error(ft(150));return O=k.call(O),b(y,x,O,w)}if(typeof O.then=="function")return v(y,x,LC(O),w);if(O.$$typeof===qf)return v(y,x,MC(y,O),w);$C(y,O)}return typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint"?(O=""+O,x!==null&&x.tag===6?(n(y,x.sibling),w=r(x,O),w.return=y,y=w):(n(y,x),w=GP(O,y.mode,w),w.return=y,y=w),a(y)):n(y,x)}return function(y,x,O,w){try{tS=0;var k=v(y,x,O,w);return qy=null,k}catch(E){if(E===vx||E===jj)throw E;var S=Xl(29,E,null,y.mode);return S.lanes=w,S.return=y,S}finally{}}}var hb=zhe(!0),Vhe=zhe(!1),xp=!1;function O9(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function w3(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Wp(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Gp(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,tr&2){var r=i.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=n_(e),Dhe(e,null,n),t}return Nj(e,i,t,n),n_(e)}function rO(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,lhe(e,n)}}function YP(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?r=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?r=s=t:s=s.next=t}else r=s=t;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,callbacks:i.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var O3=!1;function sO(){if(O3){var e=Hy;if(e!==null)throw e}}function aO(e,t,n,i){O3=!1;var r=e.updateQueue;xp=!1;var s=r.firstBaseUpdate,a=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?s=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(s!==null){var f=r.baseState;a=0,d=u=c=null,l=s;do{var h=l.lane&-536870913,p=h!==l.lane;if(p?(Ai&h)===h:(i&h)===h){h!==0&&h===Cv&&(O3=!0),d!==null&&(d=d.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var g=e,b=l;h=t;var v=n;switch(b.tag){case 1:if(g=b.payload,typeof g=="function"){f=g.call(v,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=b.payload,h=typeof g=="function"?g.call(v,f,h):g,h==null)break e;f=Xr({},f,h);break e;case 2:xp=!0}}h=l.callback,h!==null&&(e.flags|=64,p&&(e.flags|=8192),p=r.callbacks,p===null?r.callbacks=[h]:p.push(h))}else 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=r.shared.pending,l===null)break;p=l,l=p.next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}while(!0);d===null&&(c=f),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=d,s===null&&(r.shared.lanes=0),dm|=a,e.lanes=a,e.memoizedState=f}}function Hhe(e,t){if(typeof e!="function")throw Error(ft(191,e));e.call(t)}function qhe(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;es?s:8;var a=Dn.T,l={};Dn.T=l,D9(e,!1,t,n);try{var c=r(),u=Dn.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=C3e(c,i);oO(e,t,d,sc(e))}else oO(e,t,i,sc(e))}catch(f){oO(e,t,{then:function(){},status:"rejected",reason:f},sc())}finally{nr.p=s,a!==null&&l.types!==null&&(a.types=l.types),Dn.T=a}}function R3e(){}function T3(e,t,n,i){if(e.tag!==5)throw Error(ft(476));var r=bpe(e).queue;gpe(e,r,t,Xg,n===null?R3e:function(){return ype(e),n(i)})}function bpe(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Xg,baseState:Xg,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gh,lastRenderedState:Xg},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gh,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ype(e){var t=bpe(e);t.next===null&&(t=e.alternate.memoizedState),oO(e,t.next.queue,{},sc())}function P9(){return to(aS)}function vpe(){return Bs().memoizedState}function xpe(){return Bs().memoizedState}function I3e(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=sc();e=Wp(n);var i=Gp(t,e,n);i!==null&&(gl(i,t,n),rO(i,t,n)),t={cache:v9()},e.payload=t;return}t=t.return}}function P3e(e,t,n){var i=sc();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Dj(e)?Ope(t,n):(n=m9(e,t,n,i),n!==null&&(gl(n,e,i),Spe(n,t,i)))}function wpe(e,t,n){var i=sc();oO(e,t,n,i)}function oO(e,t,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Dj(e))Ope(t,r);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var a=t.lastRenderedState,l=s(a,n);if(r.hasEagerState=!0,r.eagerState=l,uc(l,a))return Nj(e,t,r,0),Tr===null&&_j(),!1}catch{}finally{}if(n=m9(e,t,r,i),n!==null)return gl(n,e,i),Spe(n,t,i),!0}return!1}function D9(e,t,n,i){if(i={lane:2,revertLane:V9(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Dj(e)){if(t)throw Error(ft(479))}else t=m9(e,n,i,2),t!==null&&gl(t,e,2)}function Dj(e){var t=e.alternate;return e===Zn||t!==null&&t===Zn}function Ope(e,t){Wy=l_=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Spe(e,t,n){if(n&4194048){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,lhe(e,n)}}var iS={readContext:to,use:Ij,useCallback:Os,useContext:Os,useEffect:Os,useImperativeHandle:Os,useLayoutEffect:Os,useInsertionEffect:Os,useMemo:Os,useReducer:Os,useRef:Os,useState:Os,useDebugValue:Os,useDeferredValue:Os,useTransition:Os,useSyncExternalStore:Os,useId:Os,useHostTransitionStatus:Os,useFormState:Os,useActionState:Os,useOptimistic:Os,useMemoCache:Os,useCacheRefresh:Os};iS.useEffectEvent=Os;var kpe={readContext:to,use:Ij,useCallback:function(e,t){return jo().memoizedState=[e,t===void 0?null:t],e},useContext:to,useEffect:fH,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,$2(4194308,4,dpe.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $2(4194308,4,e,t)},useInsertionEffect:function(e,t){$2(4,2,e,t)},useMemo:function(e,t){var n=jo();t=t===void 0?null:t;var i=e();if(pb){Pp(!0);try{e()}finally{Pp(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=jo();if(n!==void 0){var r=n(t);if(pb){Pp(!0);try{n(t)}finally{Pp(!1)}}}else r=t;return i.memoizedState=i.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},i.queue=e,e=e.dispatch=P3e.bind(null,Zn,e),[i.memoizedState,e]},useRef:function(e){var t=jo();return e={current:e},t.memoizedState=e},useState:function(e){e=E3(e);var t=e.queue,n=wpe.bind(null,Zn,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:R9,useDeferredValue:function(e,t){var n=jo();return I9(n,e,t)},useTransition:function(){var e=E3(!1);return e=gpe.bind(null,Zn,e.queue,!0,!1),jo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=Zn,r=jo();if(Mi){if(n===void 0)throw Error(ft(407));n=n()}else{if(n=t(),Tr===null)throw Error(ft(349));Ai&127||Yhe(i,t,n)}r.memoizedState=n;var s={value:n,getSnapshot:t};return r.queue=s,fH(Jhe.bind(null,i,s,e),[e]),i.flags|=2048,Av(9,{destroy:void 0},Zhe.bind(null,i,s,n,t),null),n},useId:function(){var e=jo(),t=Tr.identifierPrefix;if(Mi){var n=Sd,i=Od;n=(i&~(1<<32-rc(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=c_++,0<\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof i.is=="string"?a.createElement("select",{is:i.is}):a.createElement("select"),i.multiple?s.multiple=!0:i.size&&(s.size=i.size);break;default:s=typeof i.is=="string"?a.createElement(r,{is:i.is}):a.createElement(r)}}s[Za]=t,s[vl]=i;e:for(a=t.child;a!==null;){if(a.tag===5||a.tag===6)s.appendChild(a.stateNode);else if(a.tag!==4&&a.tag!==27&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=s;e:switch(no(s,r,i),r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&gf(t)}}return Qr(t),sD(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&gf(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(ft(166));if(e=Hp.current,T0(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,r=Ja,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}e[Za]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||wme(e.nodeValue,n)),e||cm(t,!0)}else e=v_(e).createTextNode(i),e[Za]=t,t.stateNode=e}return Qr(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=T0(t),n!==null){if(e===null){if(!i)throw Error(ft(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ft(557));e[Za]=t}else db(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Qr(t),e=!1}else n=XP(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Gl(t),t):(Gl(t),null);if(t.flags&128)throw Error(ft(558))}return Qr(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=T0(t),i!==null&&i.dehydrated!==null){if(e===null){if(!r)throw Error(ft(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(ft(317));r[Za]=t}else db(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Qr(t),r=!1}else r=XP(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Gl(t),t):(Gl(t),null)}return Gl(t),t.flags&128?(t.lanes=n,t):(n=i!==null,e=e!==null&&e.memoizedState!==null,n&&(i=t.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),s=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==r&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),FC(t,t.updateQueue),Qr(t),null);case 4:return Sv(),e===null&&H9(t.stateNode.containerInfo),Qr(t),null;case 10:return Jf(t.type),Qr(t),null;case 19:if(Fa(Ms),i=t.memoizedState,i===null)return Qr(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)R1(i,!1);else{if(Es!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=o_(e),s!==null){for(t.flags|=128,R1(i,!1),e=s.updateQueue,t.updateQueue=e,FC(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Mhe(n,e),n=n.sibling;return Dr(Ms,Ms.current&1|2),Mi&&Pf(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&nc()>h_&&(t.flags|=128,r=!0,R1(i,!1),t.lanes=4194304)}else{if(!r)if(e=o_(s),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,FC(t,e),R1(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Mi)return Qr(t),null}else 2*nc()-i.renderingStartTime>h_&&n!==536870912&&(t.flags|=128,r=!0,R1(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(e=i.last,e!==null?e.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=nc(),e.sibling=null,n=Ms.current,Dr(Ms,r?n&1|2:n&1),Mi&&Pf(t,i.treeForkCount),e):(Qr(t),null);case 22:case 23:return Gl(t),S9(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?n&536870912&&!(t.flags&128)&&(Qr(t),t.subtreeFlags&6&&(t.flags|=8192)):Qr(t),n=t.updateQueue,n!==null&&FC(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&Fa(Zg),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Jf(Ys),Qr(t),null;case 25:return null;case 30:return null}throw Error(ft(156,t.tag))}function F3e(e,t){switch(y9(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jf(Ys),Sv(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ZA(t),null;case 31:if(t.memoizedState!==null){if(Gl(t),t.alternate===null)throw Error(ft(340));db()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Gl(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ft(340));db()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Fa(Ms),null;case 4:return Sv(),null;case 10:return Jf(t.type),null;case 22:case 23:return Gl(t),S9(),e!==null&&Fa(Zg),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Jf(Ys),null;case 25:return null;default:return null}}function Mpe(e,t){switch(y9(t),t.tag){case 3:Jf(Ys),Sv();break;case 26:case 27:case 5:ZA(t);break;case 4:Sv();break;case 31:t.memoizedState!==null&&Gl(t);break;case 13:Gl(t);break;case 19:Fa(Ms);break;case 10:Jf(t.type);break;case 22:case 23:Gl(t),S9(),e!==null&&Fa(Zg);break;case 24:Jf(Ys)}}function Ik(e,t){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&e)===e){i=void 0;var s=n.create,a=n.inst;i=s(),a.destroy=i}n=n.next}while(n!==r)}}catch(l){hr(t,t.return,l)}}function um(e,t,n){try{var i=t.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var s=r.next;i=s;do{if((i.tag&e)===e){var a=i.inst,l=a.destroy;if(l!==void 0){a.destroy=void 0,r=t;var c=n,u=l;try{u()}catch(d){hr(r,c,d)}}}i=i.next}while(i!==s)}}catch(d){hr(t,t.return,d)}}function Lpe(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{qhe(t,n)}catch(i){hr(e,e.return,i)}}}function $pe(e,t,n){n.props=mb(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){hr(e,t,i)}}function lO(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof n=="function"?e.refCleanup=n(i):n.current=i}}catch(r){hr(e,t,r)}}function kd(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){hr(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){hr(e,t,r)}else n.current=null}function Fpe(e){var t=e.type,n=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){hr(e,e.return,r)}}function aD(e,t,n){try{var i=e.stateNode;o4e(i,e.type,n,t),i[vl]=t}catch(r){hr(e,e.return,r)}}function Bpe(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Dm(e.type)||e.tag===4}function oD(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Bpe(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.tag===27&&Dm(e.type)||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 R3(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Wf));else if(i!==4&&(i===27&&Dm(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(R3(e,t,n),e=e.sibling;e!==null;)R3(e,t,n),e=e.sibling}function f_(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(i===27&&Dm(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(f_(e,t,n),e=e.sibling;e!==null;)f_(e,t,n),e=e.sibling}function Upe(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);no(t,i,n),t[Za]=e,t[vl]=n}catch(s){hr(e,e.return,s)}}var Bf=!1,Xs=!1,lD=!1,EH=typeof WeakSet=="function"?WeakSet:Set,Na=null;function B3e(e,t){if(e=e.containerInfo,F3=S_,e=Ahe(e),h9(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{n.nodeType,s.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||r!==0&&f.nodeType!==3||(l=a+r),f!==s||i!==0&&f.nodeType!==3||(c=a+i),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===r&&(l=a),h===s&&++d===i&&(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(B3={focusedElem:e,selectionRange:n},S_=!1,Na=t;Na!==null;)if(t=Na,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Na=e;else for(;Na!==null;){switch(t=Na,s=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n title"))),no(s,i,n),s[Za]=e,Ia(s),i=s;break e;case"link":var a=HH("link","href",r).get(i+(n.href||""));if(a){for(var l=0;lv&&(a=v,v=b,b=a);var y=XV(l,b),x=XV(l,v);if(y&&x&&(p.rangeCount!==1||p.anchorNode!==y.node||p.anchorOffset!==y.offset||p.focusNode!==x.node||p.focusOffset!==x.offset)){var O=f.createRange();O.setStart(y.node,y.offset),p.removeAllRanges(),b>v?(p.addRange(O),p.extend(x.node,x.offset)):(O.setEnd(x.node,x.offset),p.addRange(O))}}}}for(f=[],p=l;p=p.parentNode;)p.nodeType===1&&f.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;ln?32:n,Dn.T=null,n=D3,D3=null;var s=Xp,a=eh;if(ga=0,Nv=Xp=null,eh=0,tr&6)throw Error(ft(331));var l=tr;if(tr|=4,Zpe(s.current),Kpe(s,s.current,a,n),tr=l,Pk(0,!1),ic&&typeof ic.onPostCommitFiberRoot=="function")try{ic.onPostCommitFiberRoot(Ck,s)}catch{}return!0}finally{nr.p=r,Dn.T=i,hme(e,t)}}function _H(e,t,n){t=Bc(n,t),t=_3(e.stateNode,t,2),e=Gp(e,t,2),e!==null&&(Ak(e,2),qd(e))}function hr(e,t,n){if(e.tag===3)_H(e,e,n);else for(;t!==null;){if(t.tag===3){_H(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Kp===null||!Kp.has(i))){e=Bc(n,e),n=_pe(2),i=Gp(t,n,2),i!==null&&(Npe(n,i,t,e),Ak(i,2),qd(i));break}}t=t.return}}function uD(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new z3e;var r=new Set;i.set(t,r)}else r=i.get(t),r===void 0&&(r=new Set,i.set(t,r));r.has(n)||(U9=!0,r.add(n),e=G3e.bind(null,e,t,n),t.then(e,e))}function G3e(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Tr===e&&(Ai&n)===n&&(Es===4||Es===3&&(Ai&62914560)===Ai&&300>nc()-Mj?!(tr&2)&&jv(e,0):Q9|=n,_v===Ai&&(_v=0)),qd(e)}function mme(e,t){t===0&&(t=ahe()),e=zb(e,t),e!==null&&(Ak(e,t),qd(e))}function K3e(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),mme(e,n)}function X3e(e,t){var n=0;switch(e.tag){case 31:case 13:var i=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(ft(314))}i!==null&&i.delete(t),mme(e,n)}function Y3e(e,t){return r9(e,t)}var g_=null,Z0=null,L3=!1,b_=!1,dD=!1,$p=0;function qd(e){e!==Z0&&e.next===null&&(Z0===null?g_=Z0=e:Z0=Z0.next=e),b_=!0,L3||(L3=!0,J3e())}function Pk(e,t){if(!dD&&b_){dD=!0;do for(var n=!1,i=g_;i!==null;){if(e!==0){var r=i.pendingLanes;if(r===0)var s=0;else{var a=i.suspendedLanes,l=i.pingedLanes;s=(1<<31-rc(42|e)+1)-1,s&=r&~(a&~l),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,NH(i,s))}else s=Ai,s=Ej(i,i===Tr?s:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),!(s&3)||Tk(i,s)||(n=!0,NH(i,s));i=i.next}while(n);dD=!1}}function Z3e(){gme()}function gme(){b_=L3=!1;var e=0;$p!==0&&c4e()&&(e=$p);for(var t=nc(),n=null,i=g_;i!==null;){var r=i.next,s=bme(i,t);s===0?(i.next=null,n===null?g_=r:n.next=r,r===null&&(Z0=n)):(n=i,(e!==0||s&3)&&(b_=!0)),i=r}ga!==0&&ga!==5||Pk(e),$p!==0&&($p=0)}function bme(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,r=e.expirationTimes,s=e.pendingLanes&-62914561;0l)break;var d=c.transferSize,f=c.initiatorType;d&&DH(f)&&(c=c.responseEnd,a+=d*(c"u"?null:document;function Cme(e,t,n){var i=wx;if(i&&typeof t=="string"&&t){var r=Fc(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),QH.has(r)||(QH.add(r),e={rel:e,crossOrigin:n,href:t},i.querySelector(r)===null&&(t=i.createElement("link"),no(t,"link",e),Ia(t),i.head.appendChild(t)))}}function y4e(e){Ph.D(e),Cme("dns-prefetch",e,null)}function v4e(e,t){Ph.C(e,t),Cme("preconnect",e,t)}function x4e(e,t,n){Ph.L(e,t,n);var i=wx;if(i&&e&&t){var r='link[rel="preload"][as="'+Fc(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+Fc(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+Fc(n.imageSizes)+'"]')):r+='[href="'+Fc(e)+'"]';var s=r;switch(t){case"style":s=Rv(e);break;case"script":s=Ox(e)}nu.has(s)||(e=Xr({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),nu.set(s,e),i.querySelector(r)!==null||t==="style"&&i.querySelector(Dk(s))||t==="script"&&i.querySelector(Mk(s))||(t=i.createElement("link"),no(t,"link",e),Ia(t),i.head.appendChild(t)))}}function w4e(e,t){Ph.m(e,t);var n=wx;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Fc(i)+'"][href="'+Fc(e)+'"]',s=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Ox(e)}if(!nu.has(s)&&(e=Xr({rel:"modulepreload",href:e},t),nu.set(s,e),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Mk(s)))return}i=n.createElement("link"),no(i,"link",e),Ia(i),n.head.appendChild(i)}}}function O4e(e,t,n){Ph.S(e,t,n);var i=wx;if(i&&e){var r=Qy(i).hoistableStyles,s=Rv(e);t=t||"default";var a=r.get(s);if(!a){var l={loading:0,preload:null};if(a=i.querySelector(Dk(s)))l.loading=5;else{e=Xr({rel:"stylesheet",href:e,"data-precedence":t},n),(n=nu.get(s))&&q9(e,n);var c=a=i.createElement("link");Ia(c),no(c,"link",e),c._p=new Promise(function(u,d){c.onload=u,c.onerror=d}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Q2(a,t,i)}a={type:"stylesheet",instance:a,count:1,state:l},r.set(s,a)}}}function S4e(e,t){Ph.X(e,t);var n=wx;if(n&&e){var i=Qy(n).hoistableScripts,r=Ox(e),s=i.get(r);s||(s=n.querySelector(Mk(r)),s||(e=Xr({src:e,async:!0},t),(t=nu.get(r))&&W9(e,t),s=n.createElement("script"),Ia(s),no(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function k4e(e,t){Ph.M(e,t);var n=wx;if(n&&e){var i=Qy(n).hoistableScripts,r=Ox(e),s=i.get(r);s||(s=n.querySelector(Mk(r)),s||(e=Xr({src:e,async:!0,type:"module"},t),(t=nu.get(r))&&W9(e,t),s=n.createElement("script"),Ia(s),no(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function zH(e,t,n,i){var r=(r=Hp.current)?x_(r):null;if(!r)throw Error(ft(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Rv(n.href),n=Qy(r).hoistableStyles,i=n.get(t),i||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Rv(n.href);var s=Qy(r).hoistableStyles,a=s.get(e);if(a||(r=r.ownerDocument||r,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,a),(s=r.querySelector(Dk(e)))&&!s._p&&(a.instance=s,a.state.loading=5),nu.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},nu.set(e,n),s||E4e(r,e,n,a.state))),t&&i===null)throw Error(ft(528,""));return a}if(t&&i!==null)throw Error(ft(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ox(n),n=Qy(r).hoistableScripts,i=n.get(t),i||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(ft(444,e))}}function Rv(e){return'href="'+Fc(e)+'"'}function Dk(e){return'link[rel="stylesheet"]['+e+"]"}function Tme(e){return Xr({},e,{"data-precedence":e.precedence,precedence:null})}function E4e(e,t,n,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),no(t,"link",n),Ia(t),e.head.appendChild(t))}function Ox(e){return'[src="'+Fc(e)+'"]'}function Mk(e){return"script[async]"+e}function VH(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Fc(n.href)+'"]');if(i)return t.instance=i,Ia(i),i;var r=Xr({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Ia(i),no(i,"style",r),Q2(i,n.precedence,e),t.instance=i;case"stylesheet":r=Rv(n.href);var s=e.querySelector(Dk(r));if(s)return t.state.loading|=4,t.instance=s,Ia(s),s;i=Tme(n),(r=nu.get(r))&&q9(i,r),s=(e.ownerDocument||e).createElement("link"),Ia(s);var a=s;return a._p=new Promise(function(l,c){a.onload=l,a.onerror=c}),no(s,"link",i),t.state.loading|=4,Q2(s,n.precedence,e),t.instance=s;case"script":return s=Ox(n.src),(r=e.querySelector(Mk(s)))?(t.instance=r,Ia(r),r):(i=n,(r=nu.get(s))&&(i=Xr({},n),W9(i,r)),e=e.ownerDocument||e,r=e.createElement("script"),Ia(r),no(r,"link",i),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(ft(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(i=t.instance,t.state.loading|=4,Q2(i,n.precedence,e));return t.instance}function Q2(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,s=r,a=0;a title"):null)}function C4e(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Ame(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function T4e(e,t,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var r=Rv(i.href),s=t.querySelector(Dk(r));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=w_.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,Ia(s);return}s=t.ownerDocument||t,i=Tme(i),(r=nu.get(r))&&q9(i,r),s=s.createElement("link"),Ia(s);var a=s;a._p=new Promise(function(l,c){a.onload=l,a.onerror=c}),no(s,"link",i),n.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=w_.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var bD=0;function A4e(e,t){return e.stylesheets&&e.count===0&&V2(e,e.stylesheets),0bD?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function w_(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)V2(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var O_=null;function V2(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,O_=new Map,t.forEach(_4e,e),O_=null,w_.call(e))}function _4e(e,t){if(!(t.state.loading&4)){var n=O_.get(e);if(n)var i=n.get(null);else{n=new Map,O_.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Mme)}catch(e){console.error(e)}}Mme(),Vfe.exports=Sj;var L4e=Vfe.exports;const $4e=px(L4e),Z9=m.createContext({});function Uj(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}const Qj=m.createContext(null),cS=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class F4e extends m.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function B4e({children:e,isPresent:t}){const n=m.useId(),i=m.useRef(null),r=m.useRef({width:0,height:0,top:0,left:0}),{nonce:s}=m.useContext(cS);return m.useInsertionEffect(()=>{const{width:a,height:l,top:c,left:u}=r.current;if(t||!i.current||!a||!l)return;i.current.dataset.motionPopId=n;const d=document.createElement("style");return s&&(d.nonce=s),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(` +`+i.stack}}var a3=Object.prototype.hasOwnProperty,r9=ya.unstable_scheduleCallback,FP=ya.unstable_cancelCallback,gLe=ya.unstable_shouldYield,bLe=ya.unstable_requestPaint,nc=ya.unstable_now,yLe=ya.unstable_getCurrentPriorityLevel,ihe=ya.unstable_ImmediatePriority,rhe=ya.unstable_UserBlockingPriority,JA=ya.unstable_NormalPriority,vLe=ya.unstable_LowPriority,she=ya.unstable_IdlePriority,xLe=ya.log,wLe=ya.unstable_setDisableYieldValue,Ck=null,ic=null;function Pp(e){if(typeof xLe=="function"&&wLe(e),ic&&typeof ic.setStrictMode=="function")try{ic.setStrictMode(Ck,e)}catch{}}var rc=Math.clz32?Math.clz32:kLe,OLe=Math.log,SLe=Math.LN2;function kLe(e){return e>>>=0,e===0?32:31-(OLe(e)/SLe|0)|0}var jC=256,RC=262144,IC=4194304;function pg(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ej(e,t,n){var i=e.pendingLanes;if(i===0)return 0;var r=0,s=e.suspendedLanes,a=e.pingedLanes;e=e.warmLanes;var l=i&134217727;return l!==0?(i=l&~s,i!==0?r=pg(i):(a&=l,a!==0?r=pg(a):n||(n=l&~e,n!==0&&(r=pg(n))))):(l=i&~s,l!==0?r=pg(l):a!==0?r=pg(a):n||(n=i&~e,n!==0&&(r=pg(n)))),r===0?0:t!==0&&t!==r&&!(t&s)&&(s=r&-r,n=t&-t,s>=n||s===32&&(n&4194048)!==0)?t:r}function Tk(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ELe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ahe(){var e=IC;return IC<<=1,!(IC&62914560)&&(IC=4194304),e}function BP(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ak(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function CLe(e,t,n,i,r,s){var a=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,u=e.hiddenUpdates;for(n=a&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var RLe=/[\n"\\]/g;function Fc(e){return e.replace(RLe,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function c3(e,t,n,i,r,s,a,l){e.name="",a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?e.type=a:e.removeAttribute("type"),t!=null?a==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Pc(t)):e.value!==""+Pc(t)&&(e.value=""+Pc(t)):a!=="submit"&&a!=="reset"||e.removeAttribute("value"),t!=null?u3(e,a,Pc(t)):n!=null?u3(e,a,Pc(n)):i!=null&&e.removeAttribute("value"),r==null&&s!=null&&(e.defaultChecked=!!s),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+Pc(l):e.removeAttribute("name")}function mhe(e,t,n,i,r,s,a,l){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){l3(e);return}n=n!=null?""+Pc(n):"",t=t!=null?""+Pc(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=l?e.checked:!!i,e.defaultChecked=!!i,a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.name=a),l3(e)}function u3(e,t,n){t==="number"&&e_(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function zy(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f3=!1;if(ph)try{var _1={};Object.defineProperty(_1,"passive",{get:function(){f3=!0}}),window.addEventListener("test",_1,_1),window.removeEventListener("test",_1,_1)}catch{f3=!1}var Dp=null,u9=null,I2=null;function xhe(){if(I2)return I2;var e,t=u9,n=t.length,i,r="value"in Dp?Dp.value:Dp.textContent,s=r.length;for(e=0;e=eO),zV=" ",VV=!1;function Ohe(e,t){switch(e){case"keyup":return a3e.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function She(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var my=!1;function l3e(e,t){switch(e){case"compositionend":return She(t);case"keypress":return t.which!==32?null:(VV=!0,zV);case"textInput":return e=t.data,e===zV&&VV?null:e;default:return null}}function c3e(e,t){if(my)return e==="compositionend"||!f9&&Ohe(e,t)?(e=xhe(),I2=u9=Dp=null,my=!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=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=KV(n)}}function The(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?The(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ahe(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=e_(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=e_(e.document)}return t}function h9(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var b3e=ph&&"documentMode"in document&&11>=document.documentMode,gy=null,h3=null,nO=null,p3=!1;function YV(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;p3||gy==null||gy!==e_(i)||(i=gy,"selectionStart"in i&&h9(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),nO&&ZO(nO,i)||(nO=i,i=y_(h3,"onSelect"),0>=a,r-=a,Od=1<<32-rc(t)+r|n<C?(N=E,E=null):N=E.sibling;var _=h(y,E,O[C],w);if(_===null){E===null&&(E=N);break}e&&E&&_.alternate===null&&t(y,E),x=s(_,x,C),S===null?k=_:S.sibling=_,S=_,E=N}if(C===O.length)return n(y,E),Mi&&Pf(y,C),k;if(E===null){for(;CC?(N=E,E=null):N=E.sibling;var j=h(y,E,_.value,w);if(j===null){E===null&&(E=N);break}e&&E&&j.alternate===null&&t(y,E),x=s(j,x,C),S===null?k=j:S.sibling=j,S=j,E=N}if(_.done)return n(y,E),Mi&&Pf(y,C),k;if(E===null){for(;!_.done;C++,_=O.next())_=f(y,_.value,w),_!==null&&(x=s(_,x,C),S===null?k=_:S.sibling=_,S=_);return Mi&&Pf(y,C),k}for(E=i(E);!_.done;C++,_=O.next())_=p(E,y,C,_.value,w),_!==null&&(e&&_.alternate!==null&&E.delete(_.key===null?C:_.key),x=s(_,x,C),S===null?k=_:S.sibling=_,S=_);return e&&E.forEach(function(A){return t(y,A)}),Mi&&Pf(y,C),k}function v(y,x,O,w){if(typeof O=="object"&&O!==null&&O.type===dy&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case NC:e:{for(var k=O.key;x!==null;){if(x.key===k){if(k=O.type,k===dy){if(x.tag===7){n(y,x.sibling),w=r(x,O.props.children),w.return=y,y=w;break e}}else if(x.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===vp&&mg(k)===x.type){n(y,x.sibling),w=r(x,O.props),j1(w,O),w.return=y,y=w;break e}n(y,x);break}else t(y,x);x=x.sibling}O.type===dy?(w=Yg(O.props.children,y.mode,w,O.key),w.return=y,y=w):(w=D2(O.type,O.key,O.props,null,y.mode,w),j1(w,O),w.return=y,y=w)}return a(y);case Ow:e:{for(k=O.key;x!==null;){if(x.key===k)if(x.tag===4&&x.stateNode.containerInfo===O.containerInfo&&x.stateNode.implementation===O.implementation){n(y,x.sibling),w=r(x,O.children||[]),w.return=y,y=w;break e}else{n(y,x);break}else t(y,x);x=x.sibling}w=KP(O,y.mode,w),w.return=y,y=w}return a(y);case vp:return O=mg(O),v(y,x,O,w)}if(Sw(O))return g(y,x,O,w);if(A1(O)){if(k=A1(O),typeof k!="function")throw Error(ct(150));return O=k.call(O),b(y,x,O,w)}if(typeof O.then=="function")return v(y,x,LC(O),w);if(O.$$typeof===qf)return v(y,x,MC(y,O),w);$C(y,O)}return typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint"?(O=""+O,x!==null&&x.tag===6?(n(y,x.sibling),w=r(x,O),w.return=y,y=w):(n(y,x),w=GP(O,y.mode,w),w.return=y,y=w),a(y)):n(y,x)}return function(y,x,O,w){try{tS=0;var k=v(y,x,O,w);return qy=null,k}catch(E){if(E===vx||E===jj)throw E;var S=Xl(29,E,null,y.mode);return S.lanes=w,S.return=y,S}finally{}}}var hb=zhe(!0),Vhe=zhe(!1),xp=!1;function O9(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function w3(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Wp(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Gp(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,tr&2){var r=i.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=n_(e),Dhe(e,null,n),t}return Nj(e,i,t,n),n_(e)}function rO(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,lhe(e,n)}}function YP(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?r=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?r=s=t:s=s.next=t}else r=s=t;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,callbacks:i.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var O3=!1;function sO(){if(O3){var e=Hy;if(e!==null)throw e}}function aO(e,t,n,i){O3=!1;var r=e.updateQueue;xp=!1;var s=r.firstBaseUpdate,a=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?s=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(s!==null){var f=r.baseState;a=0,d=u=c=null,l=s;do{var h=l.lane&-536870913,p=h!==l.lane;if(p?(Ai&h)===h:(i&h)===h){h!==0&&h===Cv&&(O3=!0),d!==null&&(d=d.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var g=e,b=l;h=t;var v=n;switch(b.tag){case 1:if(g=b.payload,typeof g=="function"){f=g.call(v,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=b.payload,h=typeof g=="function"?g.call(v,f,h):g,h==null)break e;f=Xr({},f,h);break e;case 2:xp=!0}}h=l.callback,h!==null&&(e.flags|=64,p&&(e.flags|=8192),p=r.callbacks,p===null?r.callbacks=[h]:p.push(h))}else 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=r.shared.pending,l===null)break;p=l,l=p.next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}while(!0);d===null&&(c=f),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=d,s===null&&(r.shared.lanes=0),dm|=a,e.lanes=a,e.memoizedState=f}}function Hhe(e,t){if(typeof e!="function")throw Error(ct(191,e));e.call(t)}function qhe(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;es?s:8;var a=Dn.T,l={};Dn.T=l,D9(e,!1,t,n);try{var c=r(),u=Dn.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=C3e(c,i);oO(e,t,d,sc(e))}else oO(e,t,i,sc(e))}catch(f){oO(e,t,{then:function(){},status:"rejected",reason:f},sc())}finally{nr.p=s,a!==null&&l.types!==null&&(a.types=l.types),Dn.T=a}}function R3e(){}function T3(e,t,n,i){if(e.tag!==5)throw Error(ct(476));var r=bpe(e).queue;gpe(e,r,t,Xg,n===null?R3e:function(){return ype(e),n(i)})}function bpe(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Xg,baseState:Xg,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gh,lastRenderedState:Xg},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gh,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ype(e){var t=bpe(e);t.next===null&&(t=e.alternate.memoizedState),oO(e,t.next.queue,{},sc())}function P9(){return to(aS)}function vpe(){return Bs().memoizedState}function xpe(){return Bs().memoizedState}function I3e(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=sc();e=Wp(n);var i=Gp(t,e,n);i!==null&&(gl(i,t,n),rO(i,t,n)),t={cache:v9()},e.payload=t;return}t=t.return}}function P3e(e,t,n){var i=sc();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Dj(e)?Ope(t,n):(n=m9(e,t,n,i),n!==null&&(gl(n,e,i),Spe(n,t,i)))}function wpe(e,t,n){var i=sc();oO(e,t,n,i)}function oO(e,t,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Dj(e))Ope(t,r);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var a=t.lastRenderedState,l=s(a,n);if(r.hasEagerState=!0,r.eagerState=l,uc(l,a))return Nj(e,t,r,0),Tr===null&&_j(),!1}catch{}finally{}if(n=m9(e,t,r,i),n!==null)return gl(n,e,i),Spe(n,t,i),!0}return!1}function D9(e,t,n,i){if(i={lane:2,revertLane:V9(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Dj(e)){if(t)throw Error(ct(479))}else t=m9(e,n,i,2),t!==null&&gl(t,e,2)}function Dj(e){var t=e.alternate;return e===Zn||t!==null&&t===Zn}function Ope(e,t){Wy=l_=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Spe(e,t,n){if(n&4194048){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,lhe(e,n)}}var iS={readContext:to,use:Ij,useCallback:Os,useContext:Os,useEffect:Os,useImperativeHandle:Os,useLayoutEffect:Os,useInsertionEffect:Os,useMemo:Os,useReducer:Os,useRef:Os,useState:Os,useDebugValue:Os,useDeferredValue:Os,useTransition:Os,useSyncExternalStore:Os,useId:Os,useHostTransitionStatus:Os,useFormState:Os,useActionState:Os,useOptimistic:Os,useMemoCache:Os,useCacheRefresh:Os};iS.useEffectEvent=Os;var kpe={readContext:to,use:Ij,useCallback:function(e,t){return jo().memoizedState=[e,t===void 0?null:t],e},useContext:to,useEffect:fH,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,$2(4194308,4,dpe.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $2(4194308,4,e,t)},useInsertionEffect:function(e,t){$2(4,2,e,t)},useMemo:function(e,t){var n=jo();t=t===void 0?null:t;var i=e();if(pb){Pp(!0);try{e()}finally{Pp(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=jo();if(n!==void 0){var r=n(t);if(pb){Pp(!0);try{n(t)}finally{Pp(!1)}}}else r=t;return i.memoizedState=i.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},i.queue=e,e=e.dispatch=P3e.bind(null,Zn,e),[i.memoizedState,e]},useRef:function(e){var t=jo();return e={current:e},t.memoizedState=e},useState:function(e){e=E3(e);var t=e.queue,n=wpe.bind(null,Zn,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:R9,useDeferredValue:function(e,t){var n=jo();return I9(n,e,t)},useTransition:function(){var e=E3(!1);return e=gpe.bind(null,Zn,e.queue,!0,!1),jo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=Zn,r=jo();if(Mi){if(n===void 0)throw Error(ct(407));n=n()}else{if(n=t(),Tr===null)throw Error(ct(349));Ai&127||Yhe(i,t,n)}r.memoizedState=n;var s={value:n,getSnapshot:t};return r.queue=s,fH(Jhe.bind(null,i,s,e),[e]),i.flags|=2048,Av(9,{destroy:void 0},Zhe.bind(null,i,s,n,t),null),n},useId:function(){var e=jo(),t=Tr.identifierPrefix;if(Mi){var n=Sd,i=Od;n=(i&~(1<<32-rc(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=c_++,0<\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof i.is=="string"?a.createElement("select",{is:i.is}):a.createElement("select"),i.multiple?s.multiple=!0:i.size&&(s.size=i.size);break;default:s=typeof i.is=="string"?a.createElement(r,{is:i.is}):a.createElement(r)}}s[Za]=t,s[vl]=i;e:for(a=t.child;a!==null;){if(a.tag===5||a.tag===6)s.appendChild(a.stateNode);else if(a.tag!==4&&a.tag!==27&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=s;e:switch(no(s,r,i),r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&gf(t)}}return Qr(t),sD(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&gf(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(ct(166));if(e=Hp.current,T0(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,r=Ja,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}e[Za]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||wme(e.nodeValue,n)),e||cm(t,!0)}else e=v_(e).createTextNode(i),e[Za]=t,t.stateNode=e}return Qr(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=T0(t),n!==null){if(e===null){if(!i)throw Error(ct(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ct(557));e[Za]=t}else db(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Qr(t),e=!1}else n=XP(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Gl(t),t):(Gl(t),null);if(t.flags&128)throw Error(ct(558))}return Qr(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=T0(t),i!==null&&i.dehydrated!==null){if(e===null){if(!r)throw Error(ct(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(ct(317));r[Za]=t}else db(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Qr(t),r=!1}else r=XP(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Gl(t),t):(Gl(t),null)}return Gl(t),t.flags&128?(t.lanes=n,t):(n=i!==null,e=e!==null&&e.memoizedState!==null,n&&(i=t.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),s=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==r&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),FC(t,t.updateQueue),Qr(t),null);case 4:return Sv(),e===null&&H9(t.stateNode.containerInfo),Qr(t),null;case 10:return Jf(t.type),Qr(t),null;case 19:if(Fa(Ms),i=t.memoizedState,i===null)return Qr(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)R1(i,!1);else{if(Es!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=o_(e),s!==null){for(t.flags|=128,R1(i,!1),e=s.updateQueue,t.updateQueue=e,FC(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Mhe(n,e),n=n.sibling;return Dr(Ms,Ms.current&1|2),Mi&&Pf(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&nc()>h_&&(t.flags|=128,r=!0,R1(i,!1),t.lanes=4194304)}else{if(!r)if(e=o_(s),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,FC(t,e),R1(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Mi)return Qr(t),null}else 2*nc()-i.renderingStartTime>h_&&n!==536870912&&(t.flags|=128,r=!0,R1(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(e=i.last,e!==null?e.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=nc(),e.sibling=null,n=Ms.current,Dr(Ms,r?n&1|2:n&1),Mi&&Pf(t,i.treeForkCount),e):(Qr(t),null);case 22:case 23:return Gl(t),S9(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?n&536870912&&!(t.flags&128)&&(Qr(t),t.subtreeFlags&6&&(t.flags|=8192)):Qr(t),n=t.updateQueue,n!==null&&FC(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&Fa(Zg),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Jf(Ys),Qr(t),null;case 25:return null;case 30:return null}throw Error(ct(156,t.tag))}function F3e(e,t){switch(y9(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jf(Ys),Sv(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ZA(t),null;case 31:if(t.memoizedState!==null){if(Gl(t),t.alternate===null)throw Error(ct(340));db()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Gl(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ct(340));db()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Fa(Ms),null;case 4:return Sv(),null;case 10:return Jf(t.type),null;case 22:case 23:return Gl(t),S9(),e!==null&&Fa(Zg),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Jf(Ys),null;case 25:return null;default:return null}}function Mpe(e,t){switch(y9(t),t.tag){case 3:Jf(Ys),Sv();break;case 26:case 27:case 5:ZA(t);break;case 4:Sv();break;case 31:t.memoizedState!==null&&Gl(t);break;case 13:Gl(t);break;case 19:Fa(Ms);break;case 10:Jf(t.type);break;case 22:case 23:Gl(t),S9(),e!==null&&Fa(Zg);break;case 24:Jf(Ys)}}function Ik(e,t){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&e)===e){i=void 0;var s=n.create,a=n.inst;i=s(),a.destroy=i}n=n.next}while(n!==r)}}catch(l){hr(t,t.return,l)}}function um(e,t,n){try{var i=t.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var s=r.next;i=s;do{if((i.tag&e)===e){var a=i.inst,l=a.destroy;if(l!==void 0){a.destroy=void 0,r=t;var c=n,u=l;try{u()}catch(d){hr(r,c,d)}}}i=i.next}while(i!==s)}}catch(d){hr(t,t.return,d)}}function Lpe(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{qhe(t,n)}catch(i){hr(e,e.return,i)}}}function $pe(e,t,n){n.props=mb(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){hr(e,t,i)}}function lO(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof n=="function"?e.refCleanup=n(i):n.current=i}}catch(r){hr(e,t,r)}}function kd(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){hr(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){hr(e,t,r)}else n.current=null}function Fpe(e){var t=e.type,n=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){hr(e,e.return,r)}}function aD(e,t,n){try{var i=e.stateNode;o4e(i,e.type,n,t),i[vl]=t}catch(r){hr(e,e.return,r)}}function Bpe(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Dm(e.type)||e.tag===4}function oD(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Bpe(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.tag===27&&Dm(e.type)||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 R3(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Wf));else if(i!==4&&(i===27&&Dm(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(R3(e,t,n),e=e.sibling;e!==null;)R3(e,t,n),e=e.sibling}function f_(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(i===27&&Dm(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(f_(e,t,n),e=e.sibling;e!==null;)f_(e,t,n),e=e.sibling}function Upe(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);no(t,i,n),t[Za]=e,t[vl]=n}catch(s){hr(e,e.return,s)}}var Bf=!1,Xs=!1,lD=!1,EH=typeof WeakSet=="function"?WeakSet:Set,Na=null;function B3e(e,t){if(e=e.containerInfo,F3=S_,e=Ahe(e),h9(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{n.nodeType,s.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||r!==0&&f.nodeType!==3||(l=a+r),f!==s||i!==0&&f.nodeType!==3||(c=a+i),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===r&&(l=a),h===s&&++d===i&&(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(B3={focusedElem:e,selectionRange:n},S_=!1,Na=t;Na!==null;)if(t=Na,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Na=e;else for(;Na!==null;){switch(t=Na,s=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n title"))),no(s,i,n),s[Za]=e,Ia(s),i=s;break e;case"link":var a=HH("link","href",r).get(i+(n.href||""));if(a){for(var l=0;lv&&(a=v,v=b,b=a);var y=XV(l,b),x=XV(l,v);if(y&&x&&(p.rangeCount!==1||p.anchorNode!==y.node||p.anchorOffset!==y.offset||p.focusNode!==x.node||p.focusOffset!==x.offset)){var O=f.createRange();O.setStart(y.node,y.offset),p.removeAllRanges(),b>v?(p.addRange(O),p.extend(x.node,x.offset)):(O.setEnd(x.node,x.offset),p.addRange(O))}}}}for(f=[],p=l;p=p.parentNode;)p.nodeType===1&&f.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;ln?32:n,Dn.T=null,n=D3,D3=null;var s=Xp,a=eh;if(ga=0,Nv=Xp=null,eh=0,tr&6)throw Error(ct(331));var l=tr;if(tr|=4,Zpe(s.current),Kpe(s,s.current,a,n),tr=l,Pk(0,!1),ic&&typeof ic.onPostCommitFiberRoot=="function")try{ic.onPostCommitFiberRoot(Ck,s)}catch{}return!0}finally{nr.p=r,Dn.T=i,hme(e,t)}}function _H(e,t,n){t=Bc(n,t),t=_3(e.stateNode,t,2),e=Gp(e,t,2),e!==null&&(Ak(e,2),qd(e))}function hr(e,t,n){if(e.tag===3)_H(e,e,n);else for(;t!==null;){if(t.tag===3){_H(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Kp===null||!Kp.has(i))){e=Bc(n,e),n=_pe(2),i=Gp(t,n,2),i!==null&&(Npe(n,i,t,e),Ak(i,2),qd(i));break}}t=t.return}}function uD(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new z3e;var r=new Set;i.set(t,r)}else r=i.get(t),r===void 0&&(r=new Set,i.set(t,r));r.has(n)||(U9=!0,r.add(n),e=G3e.bind(null,e,t,n),t.then(e,e))}function G3e(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Tr===e&&(Ai&n)===n&&(Es===4||Es===3&&(Ai&62914560)===Ai&&300>nc()-Mj?!(tr&2)&&jv(e,0):Q9|=n,_v===Ai&&(_v=0)),qd(e)}function mme(e,t){t===0&&(t=ahe()),e=zb(e,t),e!==null&&(Ak(e,t),qd(e))}function K3e(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),mme(e,n)}function X3e(e,t){var n=0;switch(e.tag){case 31:case 13:var i=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(ct(314))}i!==null&&i.delete(t),mme(e,n)}function Y3e(e,t){return r9(e,t)}var g_=null,Z0=null,L3=!1,b_=!1,dD=!1,$p=0;function qd(e){e!==Z0&&e.next===null&&(Z0===null?g_=Z0=e:Z0=Z0.next=e),b_=!0,L3||(L3=!0,J3e())}function Pk(e,t){if(!dD&&b_){dD=!0;do for(var n=!1,i=g_;i!==null;){if(e!==0){var r=i.pendingLanes;if(r===0)var s=0;else{var a=i.suspendedLanes,l=i.pingedLanes;s=(1<<31-rc(42|e)+1)-1,s&=r&~(a&~l),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,NH(i,s))}else s=Ai,s=Ej(i,i===Tr?s:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),!(s&3)||Tk(i,s)||(n=!0,NH(i,s));i=i.next}while(n);dD=!1}}function Z3e(){gme()}function gme(){b_=L3=!1;var e=0;$p!==0&&c4e()&&(e=$p);for(var t=nc(),n=null,i=g_;i!==null;){var r=i.next,s=bme(i,t);s===0?(i.next=null,n===null?g_=r:n.next=r,r===null&&(Z0=n)):(n=i,(e!==0||s&3)&&(b_=!0)),i=r}ga!==0&&ga!==5||Pk(e),$p!==0&&($p=0)}function bme(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,r=e.expirationTimes,s=e.pendingLanes&-62914561;0l)break;var d=c.transferSize,f=c.initiatorType;d&&DH(f)&&(c=c.responseEnd,a+=d*(c"u"?null:document;function Cme(e,t,n){var i=wx;if(i&&typeof t=="string"&&t){var r=Fc(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),QH.has(r)||(QH.add(r),e={rel:e,crossOrigin:n,href:t},i.querySelector(r)===null&&(t=i.createElement("link"),no(t,"link",e),Ia(t),i.head.appendChild(t)))}}function y4e(e){Ph.D(e),Cme("dns-prefetch",e,null)}function v4e(e,t){Ph.C(e,t),Cme("preconnect",e,t)}function x4e(e,t,n){Ph.L(e,t,n);var i=wx;if(i&&e&&t){var r='link[rel="preload"][as="'+Fc(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+Fc(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+Fc(n.imageSizes)+'"]')):r+='[href="'+Fc(e)+'"]';var s=r;switch(t){case"style":s=Rv(e);break;case"script":s=Ox(e)}nu.has(s)||(e=Xr({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),nu.set(s,e),i.querySelector(r)!==null||t==="style"&&i.querySelector(Dk(s))||t==="script"&&i.querySelector(Mk(s))||(t=i.createElement("link"),no(t,"link",e),Ia(t),i.head.appendChild(t)))}}function w4e(e,t){Ph.m(e,t);var n=wx;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Fc(i)+'"][href="'+Fc(e)+'"]',s=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Ox(e)}if(!nu.has(s)&&(e=Xr({rel:"modulepreload",href:e},t),nu.set(s,e),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Mk(s)))return}i=n.createElement("link"),no(i,"link",e),Ia(i),n.head.appendChild(i)}}}function O4e(e,t,n){Ph.S(e,t,n);var i=wx;if(i&&e){var r=Qy(i).hoistableStyles,s=Rv(e);t=t||"default";var a=r.get(s);if(!a){var l={loading:0,preload:null};if(a=i.querySelector(Dk(s)))l.loading=5;else{e=Xr({rel:"stylesheet",href:e,"data-precedence":t},n),(n=nu.get(s))&&q9(e,n);var c=a=i.createElement("link");Ia(c),no(c,"link",e),c._p=new Promise(function(u,d){c.onload=u,c.onerror=d}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Q2(a,t,i)}a={type:"stylesheet",instance:a,count:1,state:l},r.set(s,a)}}}function S4e(e,t){Ph.X(e,t);var n=wx;if(n&&e){var i=Qy(n).hoistableScripts,r=Ox(e),s=i.get(r);s||(s=n.querySelector(Mk(r)),s||(e=Xr({src:e,async:!0},t),(t=nu.get(r))&&W9(e,t),s=n.createElement("script"),Ia(s),no(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function k4e(e,t){Ph.M(e,t);var n=wx;if(n&&e){var i=Qy(n).hoistableScripts,r=Ox(e),s=i.get(r);s||(s=n.querySelector(Mk(r)),s||(e=Xr({src:e,async:!0,type:"module"},t),(t=nu.get(r))&&W9(e,t),s=n.createElement("script"),Ia(s),no(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function zH(e,t,n,i){var r=(r=Hp.current)?x_(r):null;if(!r)throw Error(ct(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Rv(n.href),n=Qy(r).hoistableStyles,i=n.get(t),i||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Rv(n.href);var s=Qy(r).hoistableStyles,a=s.get(e);if(a||(r=r.ownerDocument||r,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,a),(s=r.querySelector(Dk(e)))&&!s._p&&(a.instance=s,a.state.loading=5),nu.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},nu.set(e,n),s||E4e(r,e,n,a.state))),t&&i===null)throw Error(ct(528,""));return a}if(t&&i!==null)throw Error(ct(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ox(n),n=Qy(r).hoistableScripts,i=n.get(t),i||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(ct(444,e))}}function Rv(e){return'href="'+Fc(e)+'"'}function Dk(e){return'link[rel="stylesheet"]['+e+"]"}function Tme(e){return Xr({},e,{"data-precedence":e.precedence,precedence:null})}function E4e(e,t,n,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),no(t,"link",n),Ia(t),e.head.appendChild(t))}function Ox(e){return'[src="'+Fc(e)+'"]'}function Mk(e){return"script[async]"+e}function VH(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Fc(n.href)+'"]');if(i)return t.instance=i,Ia(i),i;var r=Xr({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Ia(i),no(i,"style",r),Q2(i,n.precedence,e),t.instance=i;case"stylesheet":r=Rv(n.href);var s=e.querySelector(Dk(r));if(s)return t.state.loading|=4,t.instance=s,Ia(s),s;i=Tme(n),(r=nu.get(r))&&q9(i,r),s=(e.ownerDocument||e).createElement("link"),Ia(s);var a=s;return a._p=new Promise(function(l,c){a.onload=l,a.onerror=c}),no(s,"link",i),t.state.loading|=4,Q2(s,n.precedence,e),t.instance=s;case"script":return s=Ox(n.src),(r=e.querySelector(Mk(s)))?(t.instance=r,Ia(r),r):(i=n,(r=nu.get(s))&&(i=Xr({},n),W9(i,r)),e=e.ownerDocument||e,r=e.createElement("script"),Ia(r),no(r,"link",i),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(ct(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(i=t.instance,t.state.loading|=4,Q2(i,n.precedence,e));return t.instance}function Q2(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,s=r,a=0;a title"):null)}function C4e(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Ame(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function T4e(e,t,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var r=Rv(i.href),s=t.querySelector(Dk(r));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=w_.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,Ia(s);return}s=t.ownerDocument||t,i=Tme(i),(r=nu.get(r))&&q9(i,r),s=s.createElement("link"),Ia(s);var a=s;a._p=new Promise(function(l,c){a.onload=l,a.onerror=c}),no(s,"link",i),n.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=w_.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var bD=0;function A4e(e,t){return e.stylesheets&&e.count===0&&V2(e,e.stylesheets),0bD?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function w_(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)V2(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var O_=null;function V2(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,O_=new Map,t.forEach(_4e,e),O_=null,w_.call(e))}function _4e(e,t){if(!(t.state.loading&4)){var n=O_.get(e);if(n)var i=n.get(null);else{n=new Map,O_.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Mme)}catch(e){console.error(e)}}Mme(),Vfe.exports=Sj;var L4e=Vfe.exports;const $4e=px(L4e),Z9=m.createContext({});function Uj(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}const Qj=m.createContext(null),cS=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class F4e extends m.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function B4e({children:e,isPresent:t}){const n=m.useId(),i=m.useRef(null),r=m.useRef({width:0,height:0,top:0,left:0}),{nonce:s}=m.useContext(cS);return m.useInsertionEffect(()=>{const{width:a,height:l,top:c,left:u}=r.current;if(t||!i.current||!a||!l)return;i.current.dataset.motionPopId=n;const d=document.createElement("style");return s&&(d.nonce=s),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(` [data-motion-pop-id="${n}"] { position: absolute !important; width: ${a}px !important; @@ -99,7 +99,7 @@ Error generating stack: `+i.message+` top: ${c}px !important; left: ${u}px !important; } - `),()=>{document.head.removeChild(d)}},[t]),o.jsx(F4e,{isPresent:t,childRef:i,sizeRef:r,children:m.cloneElement(e,{ref:i})})}const U4e=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:r,presenceAffectsLayout:s,mode:a})=>{const l=Uj(Q4e),c=m.useId(),u=m.useCallback(f=>{l.set(f,!0);for(const h of l.values())if(!h)return;i&&i()},[l,i]),d=m.useMemo(()=>({id:c,initial:t,isPresent:n,custom:r,onExitComplete:u,register:f=>(l.set(f,!1),()=>l.delete(f))}),s?[Math.random(),u]:[n,u]);return m.useMemo(()=>{l.forEach((f,h)=>l.set(h,!1))},[n]),m.useEffect(()=>{!n&&!l.size&&i&&i()},[n]),a==="popLayout"&&(e=o.jsx(B4e,{isPresent:n,children:e})),o.jsx(Qj.Provider,{value:d,children:e})};function Q4e(){return new Map}function Lme(e=!0){const t=m.useContext(Qj);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=t,s=m.useId();m.useEffect(()=>{e&&r(s)},[e]);const a=m.useCallback(()=>e&&i&&i(s),[s,i,e]);return!n&&i?[!1,a]:[!0]}const HC=e=>e.key||"";function JH(e){const t=[];return m.Children.forEach(e,n=>{m.isValidElement(n)&&t.push(n)}),t}const J9=typeof window<"u",$me=J9?m.useLayoutEffect:m.useEffect,Ru=({children:e,custom:t,initial:n=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:s="sync",propagate:a=!1})=>{const[l,c]=Lme(a),u=m.useMemo(()=>JH(e),[e]),d=a&&!l?[]:u.map(HC),f=m.useRef(!0),h=m.useRef(u),p=Uj(()=>new Map),[g,b]=m.useState(u),[v,y]=m.useState(u);$me(()=>{f.current=!1,h.current=u;for(let w=0;w{const k=HC(w),S=a&&!l?!1:u===v||d.includes(k),E=()=>{if(p.has(k))p.set(k,!0);else return;let C=!0;p.forEach(N=>{N||(C=!1)}),C&&(O==null||O(),y(h.current),a&&(c==null||c()),i&&i())};return o.jsx(U4e,{isPresent:S,initial:!f.current||n?void 0:!1,custom:S?void 0:t,presenceAffectsLayout:r,mode:s,onExitComplete:S?void 0:E,children:w},k)})})},ac=e=>e;let Fme=ac;const z4e={useManualTiming:!1};function V4e(e){let t=new Set,n=new Set,i=!1,r=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){s.has(u)&&(c.schedule(u),e()),u(a)}const c={schedule:(u,d=!1,f=!1)=>{const p=f&&i?t:n;return d&&s.add(u),p.has(u)||p.add(u),u},cancel:u=>{n.delete(u),s.delete(u)},process:u=>{if(a=u,i){r=!0;return}i=!0,[t,n]=[n,t],t.forEach(l),t.clear(),i=!1,r&&(r=!1,c.process(u))}};return c}const qC=["read","resolveKeyframes","update","preRender","render","postRender"],H4e=40;function Bme(e,t){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,a=qC.reduce((y,x)=>(y[x]=V4e(s),y),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:h}=a,p=()=>{const y=performance.now();n=!1,r.delta=i?1e3/60:Math.max(Math.min(y-r.timestamp,H4e),1),r.timestamp=y,r.isProcessing=!0,l.process(r),c.process(r),u.process(r),d.process(r),f.process(r),h.process(r),r.isProcessing=!1,n&&t&&(i=!1,e(p))},g=()=>{n=!0,i=!0,r.isProcessing||e(p)};return{schedule:qC.reduce((y,x)=>{const O=a[x];return y[x]=(w,k=!1,S=!1)=>(n||g(),O.schedule(w,k,S)),y},{}),cancel:y=>{for(let x=0;xeq[e].some(n=>!!t[n])};function q4e(e){for(const t in e)Pv[t]={...Pv[t],...e[t]}}const W4e=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 E_(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||W4e.has(e)}let Qme=e=>!E_(e);function zme(e){e&&(Qme=t=>t.startsWith("on")?!E_(t):e(t))}try{zme(require("@emotion/is-prop-valid").default)}catch{}function G4e(e,t,n){const i={};for(const r in e)r==="values"&&typeof e.values=="object"||(Qme(r)||n===!0&&E_(r)||!t&&!E_(r)||e.draggable&&r.startsWith("onDrag"))&&(i[r]=e[r]);return i}function K4e({children:e,isValidProp:t,...n}){t&&zme(t),n={...m.useContext(cS),...n},n.isStatic=Uj(()=>n.isStatic);const i=m.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return o.jsx(cS.Provider,{value:i,children:e})}function X4e(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...i)=>e(...i);return new Proxy(n,{get:(i,r)=>r==="create"?e:(t.has(r)||t.set(r,e(r)),t.get(r))})}const zj=m.createContext({});function uS(e){return typeof e=="string"||Array.isArray(e)}function Vj(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const eF=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],tF=["initial",...eF];function Hj(e){return Vj(e.animate)||tF.some(t=>uS(e[t]))}function Vme(e){return!!(Hj(e)||e.variants)}function Y4e(e,t){if(Hj(e)){const{initial:n,animate:i}=e;return{initial:n===!1||uS(n)?n:void 0,animate:uS(i)?i:void 0}}return e.inherit!==!1?t:{}}function Z4e(e){const{initial:t,animate:n}=Y4e(e,m.useContext(zj));return m.useMemo(()=>({initial:t,animate:n}),[tq(t),tq(n)])}function tq(e){return Array.isArray(e)?e.join(" "):e}const J4e=Symbol.for("motionComponentSymbol");function Sy(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function e6e(e,t,n){return m.useCallback(i=>{i&&e.onMount&&e.onMount(i),t&&(i?t.mount(i):t.unmount()),n&&(typeof n=="function"?n(i):Sy(n)&&(n.current=i))},[t])}const nF=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),t6e="framerAppearId",Hme="data-"+nF(t6e),{schedule:iF}=Bme(queueMicrotask,!1),qme=m.createContext({});function n6e(e,t,n,i,r){var s,a;const{visualElement:l}=m.useContext(zj),c=m.useContext(Ume),u=m.useContext(Qj),d=m.useContext(cS).reducedMotion,f=m.useRef(null);i=i||c.renderer,!f.current&&i&&(f.current=i(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const h=f.current,p=m.useContext(qme);h&&!h.projection&&r&&(h.type==="html"||h.type==="svg")&&i6e(f.current,n,r,p);const g=m.useRef(!1);m.useInsertionEffect(()=>{h&&g.current&&h.update(n,u)});const b=n[Hme],v=m.useRef(!!b&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,b))&&((a=window.MotionHasOptimisedAnimation)===null||a===void 0?void 0:a.call(window,b)));return $me(()=>{h&&(g.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),iF.render(h.render),v.current&&h.animationState&&h.animationState.animateChanges())}),m.useEffect(()=>{h&&(!v.current&&h.animationState&&h.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,b)}),v.current=!1))}),h}function i6e(e,t,n,i){const{layoutId:r,layout:s,drag:a,dragConstraints:l,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Wme(e.parent)),e.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!a||l&&Sy(l),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,layoutScroll:c,layoutRoot:u})}function Wme(e){if(e)return e.options.allowProjection!==!1?e.projection:Wme(e.parent)}function r6e({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:i,Component:r}){var s,a;e&&q4e(e);function l(u,d){let f;const h={...m.useContext(cS),...u,layoutId:s6e(u)},{isStatic:p}=h,g=Z4e(u),b=i(u,p);if(!p&&J9){a6e();const v=o6e(h);f=v.MeasureLayout,g.visualElement=n6e(r,b,h,t,v.ProjectionNode)}return o.jsxs(zj.Provider,{value:g,children:[f&&g.visualElement?o.jsx(f,{visualElement:g.visualElement,...h}):null,n(r,u,e6e(b,g.visualElement,d),b,p,g.visualElement)]})}l.displayName=`motion.${typeof r=="string"?r:`create(${(a=(s=r.displayName)!==null&&s!==void 0?s:r.name)!==null&&a!==void 0?a:""})`}`;const c=m.forwardRef(l);return c[J4e]=r,c}function s6e({layoutId:e}){const t=m.useContext(Z9).id;return t&&e!==void 0?t+"-"+e:e}function a6e(e,t){m.useContext(Ume).strict}function o6e(e){const{drag:t,layout:n}=Pv;if(!t&&!n)return{};const i={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}const l6e=["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 rF(e){return typeof e!="string"||e.includes("-")?!1:!!(l6e.indexOf(e)>-1||/[A-Z]/u.test(e))}function nq(e){const t=[{},{}];return e==null||e.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function sF(e,t,n,i){if(typeof t=="function"){const[r,s]=nq(i);t=t(n!==void 0?n:e.custom,r,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,s]=nq(i);t=t(n!==void 0?n:e.custom,r,s)}return t}const G3=e=>Array.isArray(e),c6e=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),u6e=e=>G3(e)?e[e.length-1]||0:e,mo=e=>!!(e&&e.getVelocity);function q2(e){const t=mo(e)?e.get():e;return c6e(t)?t.toValue():t}function d6e({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},i,r,s){const a={latestValues:f6e(i,r,s,e),renderState:t()};return n&&(a.onMount=l=>n({props:i,current:l,...a}),a.onUpdate=l=>n(l)),a}const Gme=e=>(t,n)=>{const i=m.useContext(zj),r=m.useContext(Qj),s=()=>d6e(e,t,i,r);return n?s():Uj(s)};function f6e(e,t,n,i){const r={},s=i(e,{});for(const h in s)r[h]=q2(s[h]);let{initial:a,animate:l}=e;const c=Hj(e),u=Vme(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"&&!Vj(f)){const h=Array.isArray(f)?f:[f];for(let p=0;pt=>typeof t=="string"&&t.startsWith(e),Xme=Kme("--"),h6e=Kme("var(--"),aF=e=>h6e(e)?p6e.test(e.split("/*")[0].trim()):!1,p6e=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Yme=(e,t)=>t&&typeof e=="number"?t.transform(e):e,vh=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},dS={...kx,transform:e=>vh(0,1,e)},WC={...kx,default:1},Lk=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),mp=Lk("deg"),Id=Lk("%"),Rn=Lk("px"),m6e=Lk("vh"),g6e=Lk("vw"),iq={...Id,parse:e=>Id.parse(e)/100,transform:e=>Id.transform(e*100)},b6e={borderWidth:Rn,borderTopWidth:Rn,borderRightWidth:Rn,borderBottomWidth:Rn,borderLeftWidth:Rn,borderRadius:Rn,radius:Rn,borderTopLeftRadius:Rn,borderTopRightRadius:Rn,borderBottomRightRadius:Rn,borderBottomLeftRadius:Rn,width:Rn,maxWidth:Rn,height:Rn,maxHeight:Rn,top:Rn,right:Rn,bottom:Rn,left:Rn,padding:Rn,paddingTop:Rn,paddingRight:Rn,paddingBottom:Rn,paddingLeft:Rn,margin:Rn,marginTop:Rn,marginRight:Rn,marginBottom:Rn,marginLeft:Rn,backgroundPositionX:Rn,backgroundPositionY:Rn},y6e={rotate:mp,rotateX:mp,rotateY:mp,rotateZ:mp,scale:WC,scaleX:WC,scaleY:WC,scaleZ:WC,skew:mp,skewX:mp,skewY:mp,distance:Rn,translateX:Rn,translateY:Rn,translateZ:Rn,x:Rn,y:Rn,z:Rn,perspective:Rn,transformPerspective:Rn,opacity:dS,originX:iq,originY:iq,originZ:Rn},rq={...kx,transform:Math.round},oF={...b6e,...y6e,zIndex:rq,size:Rn,fillOpacity:dS,strokeOpacity:dS,numOctaves:rq},v6e={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},x6e=Sx.length;function w6e(e,t,n){let i="",r=!0;for(let s=0;s({style:{},transform:{},transformOrigin:{},vars:{}}),Zme=()=>({...uF(),attrs:{}}),dF=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Jme(e,{style:t,vars:n},i,r){Object.assign(e.style,t,r&&r.getProjectionStyles(i));for(const s in n)e.style.setProperty(s,n[s])}const ege=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 tge(e,t,n,i){Jme(e,t,void 0,i);for(const r in t.attrs)e.setAttribute(ege.has(r)?r:nF(r),t.attrs[r])}const C_={};function C6e(e){Object.assign(C_,e)}function nge(e,{layout:t,layoutId:n}){return Hb.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!C_[e]||e==="opacity")}function fF(e,t,n){var i;const{style:r}=e,s={};for(const a in r)(mo(r[a])||t.style&&mo(t.style[a])||nge(a,e)||((i=n==null?void 0:n.getValue(a))===null||i===void 0?void 0:i.liveStyle)!==void 0)&&(s[a]=r[a]);return s}function ige(e,t,n){const i=fF(e,t,n);for(const r in e)if(mo(e[r])||mo(t[r])){const s=Sx.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[s]=e[r]}return i}function T6e(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 aq=["x","y","width","height","cx","cy","r"],A6e={useVisualState:Gme({scrapeMotionValuesFromProps:ige,createRenderState:Zme,onUpdate:({props:e,prevProps:t,current:n,renderState:i,latestValues:r})=>{if(!n)return;let s=!!e.drag;if(!s){for(const l in r)if(Hb.has(l)){s=!0;break}}if(!s)return;let a=!t;if(t)for(let l=0;l{T6e(n,i),Kr.render(()=>{cF(i,r,dF(n.tagName),e.transformTemplate),tge(n,i)})})}})},_6e={useVisualState:Gme({scrapeMotionValuesFromProps:fF,createRenderState:uF})};function rge(e,t,n){for(const i in t)!mo(t[i])&&!nge(i,n)&&(e[i]=t[i])}function N6e({transformTemplate:e},t){return m.useMemo(()=>{const n=uF();return lF(n,t,e),Object.assign({},n.vars,n.style)},[t])}function j6e(e,t){const n=e.style||{},i={};return rge(i,n,e),Object.assign(i,N6e(e,t)),i}function R6e(e,t){const n={},i=j6e(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.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=i,n}function I6e(e,t,n,i){const r=m.useMemo(()=>{const s=Zme();return cF(s,t,dF(i),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};rge(s,e.style,e),r.style={...s,...r.style}}return r}function P6e(e=!1){return(n,i,r,{latestValues:s},a)=>{const c=(rF(n)?I6e:R6e)(i,s,a,n),u=G4e(i,typeof n=="string",e),d=n!==m.Fragment?{...u,...c,ref:r}:{},{children:f}=i,h=m.useMemo(()=>mo(f)?f.get():f,[f]);return m.createElement(n,{...d,children:h})}}function D6e(e,t){return function(i,{forwardMotionProps:r}={forwardMotionProps:!1}){const a={...rF(i)?A6e:_6e,preloadedFeatures:e,useRender:P6e(r),createVisualElement:t,Component:i};return r6e(a)}}function sge(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i(W2===void 0&&Pd.set(qa.isProcessing||z4e.useManualTiming?qa.timestamp:performance.now()),W2),set:e=>{W2=e,queueMicrotask(M6e)}};function pF(e,t){e.indexOf(t)===-1&&e.push(t)}function mF(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class gF{constructor(){this.subscriptions=[]}add(t){return pF(this.subscriptions,t),()=>mF(this.subscriptions,t)}notify(t,n,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,n,i);else for(let s=0;s!isNaN(parseFloat(e));class $6e{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(i,r=!0)=>{const s=Pd.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&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=Pd.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=L6e(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 gF);const i=this.events[t].add(n);return t==="change"?()=>{i(),Kr.read(()=>{this.events.change.getSize()||this.stop()})}:i}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,i){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}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=Pd.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>oq)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,oq);return oge(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 fS(e,t){return new $6e(e,t)}function F6e(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,fS(n))}function B6e(e,t){const n=qj(e,t);let{transitionEnd:i={},transition:r={},...s}=n||{};s={...s,...i};for(const a in s){const l=u6e(s[a]);F6e(e,a,l)}}function U6e(e){return!!(mo(e)&&e.add)}function K3(e,t){const n=e.getValue("willChange");if(U6e(n))return n.add(t)}function lge(e){return e.props[Hme]}function bF(e){let t;return()=>(t===void 0&&(t=e()),t)}const Q6e=bF(()=>window.ScrollTimeline!==void 0);class z6e{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 i=0;i{if(Q6e()&&r.attachTimeline)return r.attachTimeline(t);if(typeof n=="function")return n(r)});return()=>{i.forEach((r,s)=>{r&&r(),this.animations[s].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 V6e extends z6e{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const th=e=>e*1e3,nh=e=>e/1e3;function yF(e){return typeof e=="function"}function lq(e,t){e.timeline=t,e.onfinish=null}const vF=e=>Array.isArray(e)&&typeof e[0]=="number",H6e={linearEasing:void 0};function q6e(e,t){const n=bF(e);return()=>{var i;return(i=H6e[t])!==null&&i!==void 0?i:n()}}const T_=q6e(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Dv=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i},cge=(e,t,n=10)=>{let i="";const r=Math.max(Math.round(t/n),2);for(let s=0;s`cubic-bezier(${e}, ${t}, ${n}, ${i})`,X3={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Tw([0,.65,.55,1]),circOut:Tw([.55,0,1,.45]),backIn:Tw([.31,.01,.66,-.59]),backOut:Tw([.33,1.53,.69,.99])};function dge(e,t){if(e)return typeof e=="function"&&T_()?cge(e,t):vF(e)?Tw(e):Array.isArray(e)?e.map(n=>dge(n,t)||X3.easeOut):X3[e]}const fge=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,W6e=1e-7,G6e=12;function K6e(e,t,n,i,r){let s,a,l=0;do a=t+(n-t)/2,s=fge(a,i,r)-e,s>0?n=a:t=a;while(Math.abs(s)>W6e&&++lK6e(s,0,1,e,n);return s=>s===0||s===1?s:fge(r(s),t,i)}const hge=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,pge=e=>t=>1-e(1-t),mge=$k(.33,1.53,.69,.99),xF=pge(mge),gge=hge(xF),bge=e=>(e*=2)<1?.5*xF(e):.5*(2-Math.pow(2,-10*(e-1))),wF=e=>1-Math.sin(Math.acos(e)),yge=pge(wF),vge=hge(wF),xge=e=>/^0[^.\s]+$/u.test(e);function X6e(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||xge(e):!0}const hO=e=>Math.round(e*1e5)/1e5,OF=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Y6e(e){return e==null}const Z6e=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,SF=(e,t)=>n=>!!(typeof n=="string"&&Z6e.test(n)&&n.startsWith(e)||t&&!Y6e(n)&&Object.prototype.hasOwnProperty.call(n,t)),wge=(e,t,n)=>i=>{if(typeof i!="string")return i;const[r,s,a,l]=i.match(OF);return{[e]:parseFloat(r),[t]:parseFloat(s),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},J6e=e=>vh(0,255,e),vD={...kx,transform:e=>Math.round(J6e(e))},Pg={test:SF("rgb","red"),parse:wge("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+vD.transform(e)+", "+vD.transform(t)+", "+vD.transform(n)+", "+hO(dS.transform(i))+")"};function e$e(e){let t="",n="",i="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,i+=i,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const Y3={test:SF("#"),parse:e$e,transform:Pg.transform},ky={test:SF("hsl","hue"),parse:wge("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+Id.transform(hO(t))+", "+Id.transform(hO(n))+", "+hO(dS.transform(i))+")"},fo={test:e=>Pg.test(e)||Y3.test(e)||ky.test(e),parse:e=>Pg.test(e)?Pg.parse(e):ky.test(e)?ky.parse(e):Y3.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Pg.transform(e):ky.transform(e)},t$e=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function n$e(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(OF))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(t$e))===null||n===void 0?void 0:n.length)||0)>0}const Oge="number",Sge="color",i$e="var",r$e="var(",cq="${}",s$e=/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 hS(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},r=[];let s=0;const l=t.replace(s$e,c=>(fo.test(c)?(i.color.push(s),r.push(Sge),n.push(fo.parse(c))):c.startsWith(r$e)?(i.var.push(s),r.push(i$e),n.push(c)):(i.number.push(s),r.push(Oge),n.push(parseFloat(c))),++s,cq)).split(cq);return{values:n,split:l,indexes:i,types:r}}function kge(e){return hS(e).values}function Ege(e){const{split:t,types:n}=hS(e),i=t.length;return r=>{let s="";for(let a=0;atypeof e=="number"?0:e;function o$e(e){const t=kge(e);return Ege(e)(t.map(a$e))}const hm={test:n$e,parse:kge,createTransformer:Ege,getAnimatableNone:o$e},l$e=new Set(["brightness","contrast","saturate","opacity"]);function c$e(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(OF)||[];if(!i)return e;const r=n.replace(i,"");let s=l$e.has(t)?1:0;return i!==n&&(s*=100),t+"("+s+r+")"}const u$e=/\b([a-z-]*)\(.*?\)/gu,Z3={...hm,getAnimatableNone:e=>{const t=e.match(u$e);return t?t.map(c$e).join(" "):e}},d$e={...oF,color:fo,backgroundColor:fo,outlineColor:fo,fill:fo,stroke:fo,borderColor:fo,borderTopColor:fo,borderRightColor:fo,borderBottomColor:fo,borderLeftColor:fo,filter:Z3,WebkitFilter:Z3},kF=e=>d$e[e];function Cge(e,t){let n=kF(e);return n!==Z3&&(n=hm),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const f$e=new Set(["auto","none","0"]);function h$e(e,t,n){let i=0,r;for(;ie===kx||e===Rn,dq=(e,t)=>parseFloat(e.split(", ")[t]),fq=(e,t)=>(n,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/u);if(r)return dq(r[1],t);{const s=i.match(/^matrix\((.+)\)$/u);return s?dq(s[1],e):0}},p$e=new Set(["x","y","z"]),m$e=Sx.filter(e=>!p$e.has(e));function g$e(e){const t=[];return m$e.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}const Mv={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:fq(4,13),y:fq(5,14)};Mv.translateX=Mv.x;Mv.translateY=Mv.y;const tb=new Set;let J3=!1,e4=!1;function Tge(){if(e4){const e=Array.from(tb).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),n=new Map;t.forEach(i=>{const r=g$e(i);r.length&&(n.set(i,r),i.render())}),e.forEach(i=>i.measureInitialState()),t.forEach(i=>{i.render();const r=n.get(i);r&&r.forEach(([s,a])=>{var l;(l=i.getValue(s))===null||l===void 0||l.set(a)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}e4=!1,J3=!1,tb.forEach(e=>e.complete()),tb.clear()}function Age(){tb.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(e4=!0)})}function b$e(){Age(),Tge()}class EF{constructor(t,n,i,r,s,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=i,this.motionValue=r,this.element=s,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(tb.add(this),J3||(J3=!0,Kr.read(Age),Kr.resolveKeyframes(Tge))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:i,motionValue:r}=this;for(let s=0;s/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),y$e=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function v$e(e){const t=y$e.exec(e);if(!t)return[,];const[,n,i,r]=t;return[`--${n??i}`,r]}function Nge(e,t,n=1){const[i,r]=v$e(e);if(!i)return;const s=window.getComputedStyle(t).getPropertyValue(i);if(s){const a=s.trim();return _ge(a)?parseFloat(a):a}return aF(r)?Nge(r,t,n+1):r}const jge=e=>t=>t.test(e),x$e={test:e=>e==="auto",parse:e=>e},Rge=[kx,Rn,Id,mp,g6e,m6e,x$e],hq=e=>Rge.find(jge(e));class Ige extends EF{constructor(t,n,i,r,s){super(t,n,i,r,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c{n.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const pq=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(hm.test(e)||e==="0")&&!e.startsWith("url("));function w$e(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function Wj(e,{repeat:t,repeatType:n="loop"},i){const r=e.filter(S$e),s=t&&n!=="loop"&&t%2===1?0:r.length-1;return!s||i===void 0?r[s]:i}const k$e=40;class Pge{constructor({autoplay:t=!0,delay:n=0,type:i="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:a="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Pd.now(),this.options={autoplay:t,delay:n,type:i,repeat:r,repeatDelay:s,repeatType:a,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>k$e?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&b$e(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Pd.now(),this.hasAttemptedResolve=!0;const{name:i,type:r,velocity:s,delay:a,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!O$e(t,i,r,s))if(a)this.options.duration=0;else{c&&c(Wj(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 t4=2e4;function Dge(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t=t4?1/0:t}const vs=(e,t,n)=>e+(t-e)*n;function xD(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 E$e({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let r=0,s=0,a=0;if(!t)r=s=a=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;r=xD(c,l,e+1/3),s=xD(c,l,e),a=xD(c,l,e-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:i}}function A_(e,t){return n=>n>0?t:e}const wD=(e,t,n)=>{const i=e*e,r=n*(t*t-i)+i;return r<0?0:Math.sqrt(r)},C$e=[Y3,Pg,ky],T$e=e=>C$e.find(t=>t.test(e));function mq(e){const t=T$e(e);if(!t)return!1;let n=t.parse(e);return t===ky&&(n=E$e(n)),n}const gq=(e,t)=>{const n=mq(e),i=mq(t);if(!n||!i)return A_(e,t);const r={...n};return s=>(r.red=wD(n.red,i.red,s),r.green=wD(n.green,i.green,s),r.blue=wD(n.blue,i.blue,s),r.alpha=vs(n.alpha,i.alpha,s),Pg.transform(r))},A$e=(e,t)=>n=>t(e(n)),Fk=(...e)=>e.reduce(A$e),n4=new Set(["none","hidden"]);function _$e(e,t){return n4.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function N$e(e,t){return n=>vs(e,t,n)}function CF(e){return typeof e=="number"?N$e:typeof e=="string"?aF(e)?A_:fo.test(e)?gq:I$e:Array.isArray(e)?Mge:typeof e=="object"?fo.test(e)?gq:j$e:A_}function Mge(e,t){const n=[...e],i=n.length,r=e.map((s,a)=>CF(s)(s,t[a]));return s=>{for(let a=0;a{for(const s in i)n[s]=i[s](r);return n}}function R$e(e,t){var n;const i=[],r={color:0,var:0,number:0};for(let s=0;s{const n=hm.createTransformer(t),i=hS(e),r=hS(t);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?n4.has(e)&&!r.values.length||n4.has(t)&&!i.values.length?_$e(e,t):Fk(Mge(R$e(i,r),r.values),n):A_(e,t)};function Lge(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?vs(e,t,n):CF(e)(e,t)}const P$e=5;function $ge(e,t,n){const i=Math.max(t-P$e,0);return oge(n-e(i),t-i)}const Ss={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},OD=.001;function D$e({duration:e=Ss.duration,bounce:t=Ss.bounce,velocity:n=Ss.velocity,mass:i=Ss.mass}){let r,s,a=1-t;a=vh(Ss.minDamping,Ss.maxDamping,a),e=vh(Ss.minDuration,Ss.maxDuration,nh(e)),a<1?(r=u=>{const d=u*a,f=d*e,h=d-n,p=i4(u,a),g=Math.exp(-f);return OD-h/p*g},s=u=>{const f=u*a*e,h=f*n+n,p=Math.pow(a,2)*Math.pow(u,2)*e,g=Math.exp(-f),b=i4(Math.pow(u,2),a);return(-r(u)+OD>0?-1:1)*((h-p)*g)/b}):(r=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-OD+d*f},s=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=L$e(r,s,l);if(e=th(e),isNaN(c))return{stiffness:Ss.stiffness,damping:Ss.damping,duration:e};{const u=Math.pow(c,2)*i;return{stiffness:u,damping:a*2*Math.sqrt(i*u),duration:e}}}const M$e=12;function L$e(e,t,n){let i=n;for(let r=1;re[n]!==void 0)}function B$e(e){let t={velocity:Ss.velocity,stiffness:Ss.stiffness,damping:Ss.damping,mass:Ss.mass,isResolvedFromDuration:!1,...e};if(!bq(e,F$e)&&bq(e,$$e))if(e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(n*1.2),r=i*i,s=2*vh(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:Ss.mass,stiffness:r,damping:s}}else{const n=D$e(e);t={...t,...n,mass:Ss.mass},t.isResolvedFromDuration=!0}return t}function Fge(e=Ss.visualDuration,t=Ss.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:i,restDelta:r}=n;const s=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:s},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:p}=B$e({...n,velocity:-nh(n.velocity||0)}),g=h||0,b=u/(2*Math.sqrt(c*d)),v=a-s,y=nh(Math.sqrt(c/d)),x=Math.abs(v)<5;i||(i=x?Ss.restSpeed.granular:Ss.restSpeed.default),r||(r=x?Ss.restDelta.granular:Ss.restDelta.default);let O;if(b<1){const k=i4(y,b);O=S=>{const E=Math.exp(-b*y*S);return a-E*((g+b*y*v)/k*Math.sin(k*S)+v*Math.cos(k*S))}}else if(b===1)O=k=>a-Math.exp(-y*k)*(v+(g+y*v)*k);else{const k=y*Math.sqrt(b*b-1);O=S=>{const E=Math.exp(-b*y*S),C=Math.min(k*S,300);return a-E*((g+b*y*v)*Math.sinh(C)+k*v*Math.cosh(C))/k}}const w={calculatedDuration:p&&f||null,next:k=>{const S=O(k);if(p)l.done=k>=f;else{let E=0;b<1&&(E=k===0?th(g):$ge(O,k,S));const C=Math.abs(E)<=i,N=Math.abs(a-S)<=r;l.done=C&&N}return l.value=l.done?a:S,l},toString:()=>{const k=Math.min(Dge(w),t4),S=cge(E=>w.next(k*E).value,k,30);return k+"ms "+S}};return w}function yq({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:a,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},p=C=>l!==void 0&&Cc,g=C=>l===void 0?c:c===void 0||Math.abs(l-C)-b*Math.exp(-C/i),O=C=>y+x(C),w=C=>{const N=x(C),_=O(C);h.done=Math.abs(N)<=u,h.value=h.done?y:_};let k,S;const E=C=>{p(h.value)&&(k=C,S=Fge({keyframes:[h.value,g(h.value)],velocity:$ge(O,C,h.value),damping:r,stiffness:s,restDelta:u,restSpeed:d}))};return E(0),{calculatedDuration:null,next:C=>{let N=!1;return!S&&k===void 0&&(N=!0,w(C),E(C)),k!==void 0&&C>=k?S.next(C-k):(!N&&w(C),h)}}}const U$e=$k(.42,0,1,1),Q$e=$k(0,0,.58,1),Bge=$k(.42,0,.58,1),z$e=e=>Array.isArray(e)&&typeof e[0]!="number",V$e={linear:ac,easeIn:U$e,easeInOut:Bge,easeOut:Q$e,circIn:wF,circInOut:vge,circOut:yge,backIn:xF,backInOut:gge,backOut:mge,anticipate:bge},vq=e=>{if(vF(e)){Fme(e.length===4);const[t,n,i,r]=e;return $k(t,n,i,r)}else if(typeof e=="string")return V$e[e];return e};function H$e(e,t,n){const i=[],r=n||Lge,s=e.length-1;for(let a=0;at[0];if(s===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=H$e(t,i,r),c=l.length,u=d=>{if(a&&d1)for(;fu(vh(e[0],e[s-1],d)):u}function W$e(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const r=Dv(0,t,i);e.push(vs(n,1,r))}}function G$e(e){const t=[0];return W$e(t,e.length-1),t}function K$e(e,t){return e.map(n=>n*t)}function X$e(e,t){return e.map(()=>t||Bge).splice(0,e.length-1)}function __({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const r=z$e(i)?i.map(vq):vq(i),s={done:!1,value:t[0]},a=K$e(n&&n.length===t.length?n:G$e(t),e),l=q$e(a,t,{ease:Array.isArray(r)?r:X$e(t,r)});return{calculatedDuration:e,next:c=>(s.value=l(c),s.done=c>=e,s)}}const Y$e=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Kr.update(t,!0),stop:()=>fm(t),now:()=>qa.isProcessing?qa.timestamp:Pd.now()}},Z$e={decay:yq,inertia:yq,tween:__,keyframes:__,spring:Fge},J$e=e=>e/100;class TF extends Pge{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:i,element:r,keyframes:s}=this.options,a=(r==null?void 0:r.KeyframeResolver)||EF,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new a(s,l,n,i,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:s,velocity:a=0}=this.options,l=yF(n)?n:Z$e[n]||__;let c,u;l!==__&&typeof t[0]!="number"&&(c=Fk(J$e,Lge(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});s==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=Dge(d));const{calculatedDuration:f}=d,h=f+r,p=h*(i+1)-r;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:i}=this;if(!i){const{keyframes:C}=this.options;return{done:!0,value:C[C.length-1]}}const{finalKeyframe:r,generator:s,mirroredGenerator:a,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:u,totalDuration:d,resolvedDuration:f}=i;if(this.startTime===null)return s.next(0);const{delay:h,repeat:p,repeatType:g,repeatDelay:b,onUpdate:v}=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),x=this.speed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let O=this.currentTime,w=s;if(p){const C=Math.min(this.currentTime,d)/f;let N=Math.floor(C),_=C%1;!_&&C>=1&&(_=1),_===1&&N--,N=Math.min(N,p+1),!!(N%2)&&(g==="reverse"?(_=1-_,b&&(_-=b/f)):g==="mirror"&&(w=a)),O=vh(0,1,_)*f}const k=x?{done:!1,value:c[0]}:w.next(O);l&&(k.value=l(k.value));let{done:S}=k;!x&&u!==null&&(S=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return E&&r!==void 0&&(k.value=Wj(c,this.options,r)),v&&v(k.value),E&&this.finish(),k}get duration(){const{resolved:t}=this;return t?nh(t.calculatedDuration):0}get time(){return nh(this.currentTime)}set time(t){t=th(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=nh(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=Y$e,onPlay:n,startTime:i}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=i??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 e8e=new Set(["opacity","clipPath","filter","transform"]);function t8e(e,t,n,{delay:i=0,duration:r=300,repeat:s=0,repeatType:a="loop",ease:l="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=dge(l,r);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:i,duration:r,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:a==="reverse"?"alternate":"normal"})}const n8e=bF(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),N_=10,i8e=2e4;function r8e(e){return yF(e.type)||e.type==="spring"||!uge(e.ease)}function s8e(e,t){const n=new TF({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:e[0]};const r=[];let s=0;for(;!i.done&&sthis.onKeyframesResolved(a,l),n,i,r),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:i=300,times:r,ease:s,type:a,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof s=="string"&&T_()&&a8e(s)&&(s=Uge[s]),r8e(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:g,...b}=this.options,v=s8e(t,b);t=v.keyframes,t.length===1&&(t[1]=t[0]),i=v.duration,r=v.times,s=v.ease,a="keyframes"}const d=t8e(l.owner.current,c,t,{...this.options,duration:i,times:r,ease:s});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(lq(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(Wj(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:i,times:r,type:a,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return nh(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return nh(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:i}=n;i.currentTime=th(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:i}=n;i.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 ac;const{animation:i}=n;lq(i,t)}return ac}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:i,duration:r,type:s,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,g=new TF({...p,keyframes:i,duration:r,type:s,ease:a,times:l,isGenerator:!0}),b=th(this.time);u.setWithVelocity(g.sample(b-N_).value,g.sample(b).value,N_)}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:i,repeatDelay:r,repeatType:s,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 n8e()&&i&&e8e.has(i)&&!c&&!u&&!r&&s!=="mirror"&&a!==0&&l!=="inertia"}}const o8e={type:"spring",stiffness:500,damping:25,restSpeed:10},l8e=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),c8e={type:"keyframes",duration:.8},u8e={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},d8e=(e,{keyframes:t})=>t.length>2?c8e:Hb.has(e)?e.startsWith("scale")?l8e(t[1]):o8e:u8e;function f8e({when:e,delay:t,delayChildren:n,staggerChildren:i,staggerDirection:r,repeat:s,repeatType:a,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const AF=(e,t,n,i={},r,s)=>a=>{const l=hF(i,e)||{},c=l.delay||i.delay||0;let{elapsed:u=0}=i;u=u-th(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:s?void 0:r};f8e(l)||(d={...d,...d8e(e,d)}),d.duration&&(d.duration=th(d.duration)),d.repeatDelay&&(d.repeatDelay=th(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&&!s&&t.get()!==void 0){const h=Wj(d.keyframes,l);if(h!==void 0)return Kr.update(()=>{d.onUpdate(h),d.onComplete()}),new V6e([])}return!s&&xq.supports(d)?new xq(d):new TF(d)};function h8e({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function Qge(e,t,{delay:n=0,transitionOverride:i,type:r}={}){var s;let{transition:a=e.getDefaultTransition(),transitionEnd:l,...c}=t;i&&(a=i);const u=[],d=r&&e.animationState&&e.animationState.getState()[r];for(const f in c){const h=e.getValue(f,(s=e.latestValues[f])!==null&&s!==void 0?s:null),p=c[f];if(p===void 0||d&&h8e(d,f))continue;const g={delay:n,...hF(a||{},f)};let b=!1;if(window.MotionHandoffAnimation){const y=lge(e);if(y){const x=window.MotionHandoffAnimation(y,f,Kr);x!==null&&(g.startTime=x,b=!0)}}K3(e,f),h.start(AF(f,h,p,e.shouldReduceMotion&&age.has(f)?{type:!1}:g,e,b));const v=h.animation;v&&u.push(v)}return l&&Promise.all(u).then(()=>{Kr.update(()=>{l&&B6e(e,l)})}),u}function r4(e,t,n={}){var i;const r=qj(e,t,n.type==="exit"?(i=e.presenceContext)===null||i===void 0?void 0:i.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const a=r?()=>Promise.all(Qge(e,r,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=s;return p8e(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:c}=s;if(c){const[u,d]=c==="beforeChildren"?[a,l]:[l,a];return u().then(()=>d())}else return Promise.all([a(),l(n.delay)])}function p8e(e,t,n=0,i=0,r=1,s){const a=[],l=(e.variantChildren.size-1)*i,c=r===1?(u=0)=>u*i:(u=0)=>l-u*i;return Array.from(e.variantChildren).sort(m8e).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(r4(u,t,{...s,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function m8e(e,t){return e.sortNodePosition(t)}function g8e(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const r=t.map(s=>r4(e,s,n));i=Promise.all(r)}else if(typeof t=="string")i=r4(e,t,n);else{const r=typeof t=="function"?qj(e,t,n.custom):t;i=Promise.all(Qge(e,r,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const b8e=tF.length;function zge(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?zge(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:i})=>g8e(e,n,i)))}function w8e(e){let t=x8e(e),n=wq(),i=!0;const r=c=>(u,d)=>{var f;const h=qj(e,d,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:p,transitionEnd:g,...b}=h;u={...u,...b,...g}}return u};function s(c){t=c(e)}function a(c){const{props:u}=e,d=zge(e.parent)||{},f=[],h=new Set;let p={},g=1/0;for(let v=0;vg&&w,N=!1;const _=Array.isArray(O)?O:[O];let j=_.reduce(r(y),{});k===!1&&(j={});const{prevResolvedValues:A={}}=x,F={...A,...j},T=L=>{C=!0,h.has(L)&&(N=!0,h.delete(L)),x.needsAnimating[L]=!0;const M=e.getValue(L);M&&(M.liveStyle=!1)};for(const L in F){const M=j[L],U=A[L];if(p.hasOwnProperty(L))continue;let I=!1;G3(M)&&G3(U)?I=!sge(M,U):I=M!==U,I?M!=null?T(L):h.add(L):M!==void 0&&h.has(L)?T(L):x.protectedKeys[L]=!0}x.prevProp=O,x.prevResolvedValues=j,x.isActive&&(p={...p,...j}),i&&e.blockInitialAnimation&&(C=!1),C&&(!(S&&E)||N)&&f.push(..._.map(L=>({animation:L,options:{type:y}})))}if(h.size){const v={};h.forEach(y=>{const x=e.getBaseTarget(y),O=e.getValue(y);O&&(O.liveStyle=!0),v[y]=x??null}),f.push({animation:v})}let b=!!f.length;return i&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(b=!1),i=!1,b?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:s,getState:()=>n,reset:()=>{n=wq(),i=!0}}}function O8e(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!sge(t,e):!1}function eg(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function wq(){return{animate:eg(!0),whileInView:eg(),whileHover:eg(),whileTap:eg(),whileDrag:eg(),whileFocus:eg(),exit:eg()}}class Mm{constructor(t){this.isMounted=!1,this.node=t}update(){}}class S8e extends Mm{constructor(t){super(t),t.animationState||(t.animationState=w8e(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Vj(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 k8e=0;class E8e extends Mm{constructor(){super(...arguments),this.id=k8e++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const r=this.node.animationState.setActive("exit",!t);n&&!t&&r.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const C8e={animation:{Feature:S8e},exit:{Feature:E8e}},vu={x:!1,y:!1};function Vge(){return vu.x||vu.y}function T8e(e){return e==="x"||e==="y"?vu[e]?null:(vu[e]=!0,()=>{vu[e]=!1}):vu.x||vu.y?null:(vu.x=vu.y=!0,()=>{vu.x=vu.y=!1})}const _F=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function pS(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}function Bk(e){return{point:{x:e.pageX,y:e.pageY}}}const A8e=e=>t=>_F(t)&&e(t,Bk(t));function pO(e,t,n,i){return pS(e,t,A8e(n),i)}const Oq=(e,t)=>Math.abs(e-t);function _8e(e,t){const n=Oq(e.x,t.x),i=Oq(e.y,t.y);return Math.sqrt(n**2+i**2)}class Hge{constructor(t,n,{transformPagePoint:i,contextWindow:r,dragSnapToOrigin:s=!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=kD(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=_8e(f.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:g}=f,{timestamp:b}=qa;this.history.push({...g,timestamp:b});const{onStart:v,onMove:y}=this.handlers;h||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=SD(h,this.transformPagePoint),Kr.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:p,onSessionEnd:g,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=kD(f.type==="pointercancel"?this.lastMoveEventInfo:SD(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,v),g&&g(f,v)},!_F(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=i,this.contextWindow=r||window;const a=Bk(t),l=SD(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=qa;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,kD(l,this.history)),this.removeListeners=Fk(pO(this.contextWindow,"pointermove",this.handlePointerMove),pO(this.contextWindow,"pointerup",this.handlePointerUp),pO(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),fm(this.updatePoint)}}function SD(e,t){return t?{point:t(e.point)}:e}function Sq(e,t){return{x:e.x-t.x,y:e.y-t.y}}function kD({point:e},t){return{point:e,delta:Sq(e,qge(t)),offset:Sq(e,N8e(t)),velocity:j8e(t,.1)}}function N8e(e){return e[0]}function qge(e){return e[e.length-1]}function j8e(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const r=qge(e);for(;n>=0&&(i=e[n],!(r.timestamp-i.timestamp>th(t)));)n--;if(!i)return{x:0,y:0};const s=nh(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const a={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}const Wge=1e-4,R8e=1-Wge,I8e=1+Wge,Gge=.01,P8e=0-Gge,D8e=0+Gge;function fc(e){return e.max-e.min}function M8e(e,t,n){return Math.abs(e-t)<=n}function kq(e,t,n,i=.5){e.origin=i,e.originPoint=vs(t.min,t.max,e.origin),e.scale=fc(n)/fc(t),e.translate=vs(n.min,n.max,e.origin)-e.originPoint,(e.scale>=R8e&&e.scale<=I8e||isNaN(e.scale))&&(e.scale=1),(e.translate>=P8e&&e.translate<=D8e||isNaN(e.translate))&&(e.translate=0)}function mO(e,t,n,i){kq(e.x,t.x,n.x,i?i.originX:void 0),kq(e.y,t.y,n.y,i?i.originY:void 0)}function Eq(e,t,n){e.min=n.min+t.min,e.max=e.min+fc(t)}function L8e(e,t,n){Eq(e.x,t.x,n.x),Eq(e.y,t.y,n.y)}function Cq(e,t,n){e.min=t.min-n.min,e.max=e.min+fc(t)}function gO(e,t,n){Cq(e.x,t.x,n.x),Cq(e.y,t.y,n.y)}function $8e(e,{min:t,max:n},i){return t!==void 0&&en&&(e=i?vs(n,e,i.max):Math.min(e,n)),e}function Tq(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 F8e(e,{top:t,left:n,bottom:i,right:r}){return{x:Tq(e.x,n,r),y:Tq(e.y,t,i)}}function Aq(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.mini?n=Dv(t.min,t.max-i,e.min):i>r&&(n=Dv(e.min,e.max-r,t.min)),vh(0,1,n)}function Q8e(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 s4=.35;function z8e(e=s4){return e===!1?e=0:e===!0&&(e=s4),{x:_q(e,"left","right"),y:_q(e,"top","bottom")}}function _q(e,t,n){return{min:Nq(e,t),max:Nq(e,n)}}function Nq(e,t){return typeof e=="number"?e:e[t]||0}const jq=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ey=()=>({x:jq(),y:jq()}),Rq=()=>({min:0,max:0}),Rs=()=>({x:Rq(),y:Rq()});function Rc(e){return[e("x"),e("y")]}function Kge({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function V8e({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function H8e(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function ED(e){return e===void 0||e===1}function a4({scale:e,scaleX:t,scaleY:n}){return!ED(e)||!ED(t)||!ED(n)}function bg(e){return a4(e)||Xge(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Xge(e){return Iq(e.x)||Iq(e.y)}function Iq(e){return e&&e!=="0%"}function j_(e,t,n){const i=e-n,r=t*i;return n+r}function Pq(e,t,n,i,r){return r!==void 0&&(e=j_(e,r,i)),j_(e,n,i)+t}function o4(e,t=0,n=1,i,r){e.min=Pq(e.min,t,n,i,r),e.max=Pq(e.max,t,n,i,r)}function Yge(e,{x:t,y:n}){o4(e.x,t.translate,t.scale,t.originPoint),o4(e.y,n.translate,n.scale,n.originPoint)}const Dq=.999999999999,Mq=1.0000000000001;function q8e(e,t,n,i=!1){const r=n.length;if(!r)return;t.x=t.y=1;let s,a;for(let l=0;lDq&&(t.x=1),t.yDq&&(t.y=1)}function Cy(e,t){e.min=e.min+t,e.max=e.max+t}function Lq(e,t,n,i,r=.5){const s=vs(e.min,e.max,r);o4(e,t,n,s,i)}function Ty(e,t){Lq(e.x,t.x,t.scaleX,t.scale,t.originX),Lq(e.y,t.y,t.scaleY,t.scale,t.originY)}function Zge(e,t){return Kge(H8e(e.getBoundingClientRect(),t))}function W8e(e,t,n){const i=Zge(e,n),{scroll:r}=t;return r&&(Cy(i.x,r.offset.x),Cy(i.y,r.offset.y)),i}const Jge=({current:e})=>e?e.ownerDocument.defaultView:null,G8e=new WeakMap;class K8e{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=Rs(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Bk(d).point)},s=(d,f)=>{const{drag:h,dragPropagation:p,onDragStart:g}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=T8e(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),Rc(v=>{let y=this.getAxisMotionValue(v).get()||0;if(Id.test(y)){const{projection:x}=this.visualElement;if(x&&x.layout){const O=x.layout.layoutBox[v];O&&(y=fc(O)*(parseFloat(y)/100))}}this.originPoint[v]=y}),g&&Kr.postRender(()=>g(d,f)),K3(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},a=(d,f)=>{const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:g,onDrag:b}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=f;if(p&&this.currentDirection===null){this.currentDirection=X8e(v),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),b&&b(d,f)},l=(d,f)=>this.stop(d,f),c=()=>Rc(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 Hge(t,{onSessionStart:r,onStart:s,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:Jge(this.visualElement)})}stop(t,n){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:r}=n;this.startAnimation(r);const{onDragEnd:s}=this.getProps();s&&Kr.postRender(()=>s(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:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,i){const{drag:r}=this.getProps();if(!i||!GC(t,r,this.currentDirection))return;const s=this.getAxisMotionValue(t);let a=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(a=$8e(a,this.constraints[t],this.elastic[t])),s.set(a)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:i}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;n&&Sy(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&r?this.constraints=F8e(r.layoutBox,n):this.constraints=!1,this.elastic=z8e(i),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Rc(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=Q8e(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Sy(t))return!1;const i=t.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=W8e(i,r.root,this.visualElement.getTransformPagePoint());let a=B8e(r.layout.layoutBox,s);if(n){const l=n(V8e(a));this.hasMutatedConstraints=!!l,l&&(a=Kge(l))}return a}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Rc(d=>{if(!GC(d,n,this.currentDirection))return;let f=c&&c[d]||{};a&&(f={min:0,max:0});const h=r?200:1e6,p=r?40:1e7,g={type:"inertia",velocity:i?t[d]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(d,g)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return K3(this.visualElement,t),i.start(AF(t,i,0,n,this.visualElement,!1))}stopAnimation(){Rc(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Rc(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()}`,i=this.visualElement.getProps(),r=i[n];return r||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){Rc(n=>{const{drag:i}=this.getProps();if(!GC(n,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(n);if(r&&r.layout){const{min:a,max:l}=r.layout.layoutBox[n];s.set(t[n]-vs(a,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Sy(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Rc(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const c=l.get();r[a]=U8e({min:c,max:c},this.constraints[a])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),Rc(a=>{if(!GC(a,t,null))return;const l=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];l.set(vs(c,u,r[a]))})}addListeners(){if(!this.visualElement.current)return;G8e.set(this.visualElement,this);const t=this.visualElement.current,n=pO(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),i=()=>{const{dragConstraints:c}=this.getProps();Sy(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,s=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),Kr.read(i);const a=pS(window,"resize",()=>this.scalePositionWithinConstraints()),l=r.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Rc(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(),s(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:a=s4,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:a,dragMomentum:l}}}function GC(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function X8e(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Y8e extends Mm{constructor(t){super(t),this.removeGroupControls=ac,this.removeListeners=ac,this.controls=new K8e(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ac}unmount(){this.removeGroupControls(),this.removeListeners()}}const $q=e=>(t,n)=>{e&&Kr.postRender(()=>e(t,n))};class Z8e extends Mm{constructor(){super(...arguments),this.removePointerDownListener=ac}onPointerDown(t){this.session=new Hge(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Jge(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:$q(t),onStart:$q(n),onMove:i,onEnd:(s,a)=>{delete this.session,r&&Kr.postRender(()=>r(s,a))}}}mount(){this.removePointerDownListener=pO(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 G2={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Fq(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const D1={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Rn.test(e))e=parseFloat(e);else return e;const n=Fq(e,t.target.x),i=Fq(e,t.target.y);return`${n}% ${i}%`}},J8e={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,r=hm.parse(e);if(r.length>5)return i;const s=hm.createTransformer(e),a=typeof r[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;r[0+a]/=l,r[1+a]/=c;const u=vs(l,c,.5);return typeof r[2+a]=="number"&&(r[2+a]/=u),typeof r[3+a]=="number"&&(r[3+a]/=u),s(r)}};class e9e extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=t;C6e(t9e),s&&(n.group&&n.group.add(s),i&&i.register&&r&&i.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),G2.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:r,isPresent:s}=this.props,a=i.projection;return a&&(a.isPresent=s,r||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?a.promote():a.relegate()||Kr.postRender(()=>{const l=a.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),iF.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:r}=t;r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function ebe(e){const[t,n]=Lme(),i=m.useContext(Z9);return o.jsx(e9e,{...e,layoutGroup:i,switchLayoutGroup:m.useContext(qme),isPresent:t,safeToRemove:n})}const t9e={borderRadius:{...D1,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:D1,borderTopRightRadius:D1,borderBottomLeftRadius:D1,borderBottomRightRadius:D1,boxShadow:J8e};function n9e(e,t,n){const i=mo(e)?e:fS(e);return i.start(AF("",i,t,n)),i.animation}function i9e(e){return e instanceof SVGElement&&e.tagName!=="svg"}const r9e=(e,t)=>e.depth-t.depth;class s9e{constructor(){this.children=[],this.isDirty=!1}add(t){pF(this.children,t),this.isDirty=!0}remove(t){mF(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(r9e),this.isDirty=!1,this.children.forEach(t)}}function a9e(e,t){const n=Pd.now(),i=({timestamp:r})=>{const s=r-n;s>=t&&(fm(i),e(s-t))};return Kr.read(i,!0),()=>fm(i)}const tbe=["TopLeft","TopRight","BottomLeft","BottomRight"],o9e=tbe.length,Bq=e=>typeof e=="string"?parseFloat(e):e,Uq=e=>typeof e=="number"||Rn.test(e);function l9e(e,t,n,i,r,s){r?(e.opacity=vs(0,n.opacity!==void 0?n.opacity:1,c9e(i)),e.opacityExit=vs(t.opacity!==void 0?t.opacity:1,0,u9e(i))):s&&(e.opacity=vs(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,i));for(let a=0;ait?1:n(Dv(e,t,i))}function zq(e,t){e.min=t.min,e.max=t.max}function jc(e,t){zq(e.x,t.x),zq(e.y,t.y)}function Vq(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Hq(e,t,n,i,r){return e-=t,e=j_(e,1/n,i),r!==void 0&&(e=j_(e,1/r,i)),e}function d9e(e,t=0,n=1,i=.5,r,s=e,a=e){if(Id.test(t)&&(t=parseFloat(t),t=vs(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=vs(s.min,s.max,i);e===s&&(l-=t),e.min=Hq(e.min,t,n,l,r),e.max=Hq(e.max,t,n,l,r)}function qq(e,t,[n,i,r],s,a){d9e(e,t[n],t[i],t[r],t.scale,s,a)}const f9e=["x","scaleX","originX"],h9e=["y","scaleY","originY"];function Wq(e,t,n,i){qq(e.x,t,f9e,n?n.x:void 0,i?i.x:void 0),qq(e.y,t,h9e,n?n.y:void 0,i?i.y:void 0)}function Gq(e){return e.translate===0&&e.scale===1}function ibe(e){return Gq(e.x)&&Gq(e.y)}function Kq(e,t){return e.min===t.min&&e.max===t.max}function p9e(e,t){return Kq(e.x,t.x)&&Kq(e.y,t.y)}function Xq(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function rbe(e,t){return Xq(e.x,t.x)&&Xq(e.y,t.y)}function Yq(e){return fc(e.x)/fc(e.y)}function Zq(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class m9e{constructor(){this.members=[]}add(t){pF(this.members,t),t.scheduleRender()}remove(t){if(mF(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(r=>t===r);if(n===0)return!1;let i;for(let r=n;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1){i=s;break}}return i?(this.promote(i),!0):!1}promote(t,n){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:r}=t.options;r===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:i}=t;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function g9e(e,t,n){let i="";const r=e.x.translate/t.x,s=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((r||s||a)&&(i=`translate3d(${r}px, ${s}px, ${a}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:p,skewY:g}=n;u&&(i=`perspective(${u}px) ${i}`),d&&(i+=`rotate(${d}deg) `),f&&(i+=`rotateX(${f}deg) `),h&&(i+=`rotateY(${h}deg) `),p&&(i+=`skewX(${p}deg) `),g&&(i+=`skewY(${g}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(i+=`scale(${l}, ${c})`),i||"none"}const yg={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Aw=typeof window<"u"&&window.MotionDebug!==void 0,CD=["","X","Y","Z"],b9e={visibility:"hidden"},Jq=1e3;let y9e=0;function TD(e,t,n,i){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),i&&(i[e]=0))}function sbe(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=lge(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Kr,!(r||s))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&sbe(i)}function abe({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(a={},l=t==null?void 0:t()){this.id=y9e++,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,Aw&&(yg.totalNodes=yg.resolvedTargetDeltas=yg.recalculatedProjection=0),this.nodes.forEach(w9e),this.nodes.forEach(C9e),this.nodes.forEach(T9e),this.nodes.forEach(O9e),Aw&&window.MotionDebug.record(yg)},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=a9e(h,250),G2.hasAnimatedSinceResize&&(G2.hasAnimatedSinceResize=!1,this.nodes.forEach(tW))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeTargetChanged:p,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||d.getDefaultTransition()||R9e,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=d.getProps(),x=!this.targetLayout||!rbe(this.targetLayout,g)||p,O=!h&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||O||h&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,O);const w={...hF(b,"layout"),onPlay:v,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w)}else h||tW(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}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,fm(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(A9e),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&&sbe(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=w/1e3;nW(f.x,a.x,k),nW(f.y,a.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(gO(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),N9e(this.relativeTarget,this.relativeTargetOrigin,h,k),O&&p9e(this.relativeTarget,O)&&(this.isProjectionDirty=!1),O||(O=Rs()),jc(O,this.relativeTarget)),b&&(this.animationValues=d,l9e(d,u,this.latestValues,k,x,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&&(fm(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Kr.update(()=>{G2.hasAnimatedSinceResize=!0,this.currentAnimation=n9e(0,Jq,{...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(Jq),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&&obe(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Rs();const f=fc(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+f;const h=fc(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+h}jc(l,c),Ty(l,d),mO(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new m9e),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&&TD("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(eW),this.root.sharedNodes.clear()}}}function v9e(e){e.updateLayout()}function x9e(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:i,measuredBox:r}=e.layout,{animationType:s}=e.options,a=n.source!==e.layout.source;s==="size"?Rc(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=fc(h);h.min=i[f].min,h.max=h.min+p}):obe(s,n.layoutBox,i)&&Rc(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=fc(i[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const l=Ey();mO(l,i,n.layoutBox);const c=Ey();a?mO(c,e.applyTransform(r,!0),n.measuredBox):mO(c,i,n.layoutBox);const u=!ibe(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 g=Rs();gO(g,n.layoutBox,h.layoutBox);const b=Rs();gO(b,i,p.layoutBox),rbe(g,b)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function w9e(e){Aw&&yg.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 O9e(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function S9e(e){e.clearSnapshot()}function eW(e){e.clearMeasurements()}function k9e(e){e.isLayoutDirty=!1}function E9e(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function tW(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function C9e(e){e.resolveTargetDelta()}function T9e(e){e.calcProjection()}function A9e(e){e.resetSkewAndRotation()}function _9e(e){e.removeLeadSnapshot()}function nW(e,t,n){e.translate=vs(t.translate,0,n),e.scale=vs(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function iW(e,t,n,i){e.min=vs(t.min,n.min,i),e.max=vs(t.max,n.max,i)}function N9e(e,t,n,i){iW(e.x,t.x,n.x,i),iW(e.y,t.y,n.y,i)}function j9e(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const R9e={duration:.45,ease:[.4,0,.1,1]},rW=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),sW=rW("applewebkit/")&&!rW("chrome/")?Math.round:ac;function aW(e){e.min=sW(e.min),e.max=sW(e.max)}function I9e(e){aW(e.x),aW(e.y)}function obe(e,t,n){return e==="position"||e==="preserve-aspect"&&!M8e(Yq(t),Yq(n),.2)}function P9e(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const D9e=abe({attachResizeListener:(e,t)=>pS(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),AD={current:void 0},lbe=abe({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!AD.current){const e=new D9e({});e.mount(window),e.setOptions({layoutScroll:!0}),AD.current=e}return AD.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),M9e={pan:{Feature:Z8e},drag:{Feature:Y8e,ProjectionNode:lbe,MeasureLayout:ebe}};function L9e(e,t,n){var i;if(e instanceof Element)return[e];if(typeof e=="string"){let r=document;const s=(i=void 0)!==null&&i!==void 0?i:r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function cbe(e,t){const n=L9e(e),i=new AbortController,r={passive:!0,...t,signal:i.signal};return[n,r,()=>i.abort()]}function oW(e){return t=>{t.pointerType==="touch"||Vge()||e(t)}}function $9e(e,t,n={}){const[i,r,s]=cbe(e,n),a=oW(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const d=oW(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,r)});return i.forEach(l=>{l.addEventListener("pointerenter",a,r)}),s}function lW(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,s=i[r];s&&Kr.postRender(()=>s(t,Bk(t)))}class F9e extends Mm{mount(){const{current:t}=this.node;t&&(this.unmount=$9e(t,n=>(lW(this.node,n,"Start"),i=>lW(this.node,i,"End"))))}unmount(){}}class B9e extends Mm{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=Fk(pS(this.node.current,"focus",()=>this.onFocus()),pS(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const ube=(e,t)=>t?e===t?!0:ube(e,t.parentElement):!1,U9e=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Q9e(e){return U9e.has(e.tagName)||e.tabIndex!==-1}const _w=new WeakSet;function cW(e){return t=>{t.key==="Enter"&&e(t)}}function _D(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const z9e=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=cW(()=>{if(_w.has(n))return;_D(n,"down");const r=cW(()=>{_D(n,"up")}),s=()=>_D(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",i,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),t)};function uW(e){return _F(e)&&!Vge()}function V9e(e,t,n={}){const[i,r,s]=cbe(e,n),a=l=>{const c=l.currentTarget;if(!uW(l)||_w.has(c))return;_w.add(c);const u=t(l),d=(p,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!uW(p)||!_w.has(c))&&(_w.delete(c),typeof u=="function"&&u(p,{success:g}))},f=p=>{d(p,n.useGlobalTarget||ube(c,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",h,r)};return i.forEach(l=>{!Q9e(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",a,r),l.addEventListener("focus",u=>z9e(u,r),r)}),s}function dW(e,t,n){const{props:i}=e;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),s=i[r];s&&Kr.postRender(()=>s(t,Bk(t)))}class H9e extends Mm{mount(){const{current:t}=this.node;t&&(this.unmount=V9e(t,n=>(dW(this.node,n,"Start"),(i,{success:r})=>dW(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const l4=new WeakMap,ND=new WeakMap,q9e=e=>{const t=l4.get(e.target);t&&t(e)},W9e=e=>{e.forEach(q9e)};function G9e({root:e,...t}){const n=e||document;ND.has(n)||ND.set(n,{});const i=ND.get(n),r=JSON.stringify(t);return i[r]||(i[r]=new IntersectionObserver(W9e,{root:e,...t})),i[r]}function K9e(e,t,n){const i=G9e(t);return l4.set(e,n),i.observe(e),()=>{l4.delete(e),i.unobserve(e)}}const X9e={some:0,all:1};class Y9e extends Mm{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:r="some",once:s}=t,a={root:n?n.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:X9e[r]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,s&&!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 K9e(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(Z9e(t,n))&&this.startObserver()}unmount(){}}function Z9e({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const J9e={inView:{Feature:Y9e},tap:{Feature:H9e},focus:{Feature:B9e},hover:{Feature:F9e}},eFe={layout:{ProjectionNode:lbe,MeasureLayout:ebe}},R_={current:null},NF={current:!1};function dbe(){if(NF.current=!0,!!J9)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>R_.current=e.matches;e.addListener(t),t()}else R_.current=!1}const tFe=[...Rge,fo,hm],nFe=e=>tFe.find(jge(e)),fW=new WeakMap;function iFe(e,t,n){for(const i in t){const r=t[i],s=n[i];if(mo(r))e.addValue(i,r);else if(mo(s))e.addValue(i,fS(r,{owner:e}));else if(s!==r)if(e.hasValue(i)){const a=e.getValue(i);a.liveStyle===!0?a.jump(r):a.hasAnimated||a.set(r)}else{const a=e.getStaticValue(i);e.addValue(i,fS(a!==void 0?a:r,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const hW=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class rFe{scrapeMotionValuesFromProps(t,n,i){return{}}constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:r,blockInitialAnimation:s,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=EF,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=Pd.now();this.renderScheduledAtthis.bindToMotionValue(i,n)),NF.current||dbe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:R_.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){fW.delete(this.current),this.projection&&this.projection.unmount(),fm(this.notifyUpdate),fm(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 i=Hb.has(t),r=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&Kr.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),s(),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 Pv){const n=Pv[t];if(!n)continue;const{isEnabled:i,Feature:r}=n;if(!this.features[t]&&r&&i(this.props)&&(this.features[t]=new r(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Rs()}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 i=0;in.variantChildren.delete(t)}addValue(t,n){const i=this.values.get(t);n!==i&&(i&&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 i=this.values.get(t);return i===void 0&&n!==void 0&&(i=fS(n===null?void 0:n,{owner:this}),this.addValue(t,i)),i}readValue(t,n){var i;let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(i=this.getBaseTargetFromProps(this.props,t))!==null&&i!==void 0?i:this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(_ge(r)||xge(r))?r=parseFloat(r):!nFe(r)&&hm.test(n)&&(r=Cge(t,n)),this.setBaseTarget(t,mo(r)?r.get():r)),mo(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:i}=this.props;let r;if(typeof i=="string"||typeof i=="object"){const a=sF(this.props,i,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);a&&(r=a[t])}if(i&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!mo(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new gF),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class fbe extends rFe{constructor(){super(...arguments),this.KeyframeResolver=Ige}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:i}){delete n[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;mo(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function sFe(e){return window.getComputedStyle(e)}class aFe extends fbe{constructor(){super(...arguments),this.type="html",this.renderInstance=Jme}readValueFromInstance(t,n){if(Hb.has(n)){const i=kF(n);return i&&i.default||0}else{const i=sFe(t),r=(Xme(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Zge(t,n)}build(t,n,i){lF(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return fF(t,n,i)}}class oFe extends fbe{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Rs}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Hb.has(n)){const i=kF(n);return i&&i.default||0}return n=ege.has(n)?n:nF(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return ige(t,n,i)}build(t,n,i){cF(t,n,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,i,r){tge(t,n,i,r)}mount(t){this.isSVGTag=dF(t.tagName),super.mount(t)}}const lFe=(e,t)=>rF(e)?new oFe(t):new aFe(t,{allowProjection:e!==m.Fragment}),cFe=D6e({...C8e,...J9e,...M9e,...eFe},lFe),pr=X4e(cFe);function jF(){!NF.current&&dbe();const[e]=m.useState(R_.current);return e}function pa(){return pa=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?m.useEffect:m.useLayoutEffect;function J0(e,t,n){var i=m.useRef(t);i.current=t,m.useEffect(function(){function r(s){i.current(s)}return e&&window.addEventListener(e,r,n),function(){e&&window.removeEventListener(e,r)}},[e])}var uFe=["container"];function dFe(e){var t=e.container,n=t===void 0?document.body:t,i=Gj(e,uFe);return Li.createPortal(ii.createElement("div",pa({},i)),n)}function fFe(e){return ii.createElement("svg",pa({width:"44",height:"44",viewBox:"0 0 768 768"},e),ii.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 hFe(e){return ii.createElement("svg",pa({width:"44",height:"44",viewBox:"0 0 768 768"},e),ii.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 pFe(e){return ii.createElement("svg",pa({width:"44",height:"44",viewBox:"0 0 768 768"},e),ii.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function mFe(){return m.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function mW(e){var t=e.touches[0],n=t.clientX,i=t.clientY;if(e.touches.length>=2){var r=e.touches[1],s=r.clientX,a=r.clientY;return[(n+s)/2,(i+a)/2,Math.sqrt(Math.pow(s-n,2)+Math.pow(a-i,2))]}return[n,i,0]}var wp=function(e,t,n,i){var r,s=n*t,a=(s-i)/2,l=e;return s<=i?(r=1,l=0):e>0&&a-e<=0?(r=2,l=a):e<0&&a+e<=0&&(r=3,l=-a),[r,l]};function jD(e,t,n,i,r,s,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=wp(e,s,n,innerWidth)[0],f=wp(t,s,i,innerHeight),h=innerWidth/2,p=innerHeight/2;return{x:a-s/r*(a-(h+e))-h+(i/n>=3&&n*s===innerWidth?0:d?c/2:c),y:l-s/r*(l-(p+t))-p+(f[0]?u/2:u),lastCX:a,lastCY:l}}function d4(e,t,n){var i=e%180!=0;return i?[n,t,i]:[t,n,i]}function RD(e,t,n){var i=d4(n,innerWidth,innerHeight),r=i[0],s=i[1],a=0,l=r,c=s,u=e/t*s,d=t/e*r;return e=s?l=u:e>=r&&tr/s?c=d:t/e>=3&&!i[2]?a=((c=d)-s)/2:l=u,{width:l,height:c,x:0,y:a,pause:!0}}function XC(e,t){var n=t.leading,i=n!==void 0&&n,r=t.maxWait,s=t.wait,a=s===void 0?r||0:s,l=m.useRef(e);l.current=e;var c=m.useRef(0),u=m.useRef(),d=function(){return u.current&&clearTimeout(u.current)},f=m.useCallback(function(){var h=[].slice.call(arguments),p=Date.now();function g(){c.current=p,d(),l.current.apply(null,h)}var b=c.current,v=p-b;if(b===0&&(i&&g(),c.current=p),r!==void 0){if(v>r)return void g()}else v=1&&s&&s())};d()}function d(){c=requestAnimationFrame(u)}}var bFe={T:0,L:0,W:0,H:0,FIT:void 0},pbe=function(){var e=m.useRef(!1);return m.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},yFe=["className"];function vFe(e){var t=e.className,n=t===void 0?"":t,i=Gj(e,yFe);return ii.createElement("div",pa({className:"PhotoView__Spinner "+n},i),ii.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},ii.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"}),ii.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var xFe=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function wFe(e){var t=e.src,n=e.loaded,i=e.broken,r=e.className,s=e.onPhotoLoad,a=e.loadingElement,l=e.brokenElement,c=Gj(e,xFe),u=pbe();return t&&!i?ii.createElement(ii.Fragment,null,ii.createElement("img",pa({className:"PhotoView__Photo"+(r?" "+r:""),src:t,onLoad:function(d){var f=d.target;u.current&&s({loaded:!0,naturalWidth:f.naturalWidth,naturalHeight:f.naturalHeight})},onError:function(){u.current&&s({broken:!0})},draggable:!1,alt:""},c)),!n&&(a?ii.createElement("span",{className:"PhotoView__icon"},a):ii.createElement(vFe,{className:"PhotoView__icon"}))):l?ii.createElement("span",{className:"PhotoView__icon"},typeof l=="function"?l({src:t}):l):null}var OFe={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 SFe(e){var t=e.item,n=t.src,i=t.render,r=t.width,s=r===void 0?0:r,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,g=e.style,b=e.loadingElement,v=e.brokenElement,y=e.onPhotoTap,x=e.onMaskTap,O=e.onReachMove,w=e.onReachUp,k=e.onPhotoResize,S=e.isActive,E=e.expose,C=I_(OFe),N=C[0],_=C[1],j=m.useRef(0),A=pbe(),F=N.naturalWidth,T=F===void 0?s:F,P=N.naturalHeight,R=P===void 0?l:P,L=N.width,M=L===void 0?s:L,U=N.height,I=U===void 0?l:U,H=N.loaded,K=H===void 0?!n:H,Q=N.broken,q=N.x,B=N.y,ee=N.touched,le=N.stopRaf,se=N.maskTouched,re=N.rotate,ge=N.scale,W=N.CX,X=N.CY,ae=N.lastX,ue=N.lastY,Oe=N.lastCX,Se=N.lastCY,lt=N.lastScale,$e=N.touchTime,Le=N.touchLength,Ne=N.pause,qe=N.reach,Re=nb({onScale:function(Pe){return ze(KC(Pe))},onRotate:function(Pe){re!==Pe&&(E({rotate:Pe}),_(pa({rotate:Pe},RD(T,R,Pe))))}});function ze(Pe,kt,Me){ge!==Pe&&(E({scale:Pe}),_(pa({scale:Pe},jD(q,B,M,I,ge,Pe,kt,Me),Pe<=1&&{x:0,y:0})))}var Ee=XC(function(Pe,kt,Me){if(Me===void 0&&(Me=0),(ee||se)&&S){var Ye=d4(re,M,I),et=Ye[0],xe=Ye[1];if(Me===0&&j.current===0){var He=Math.abs(Pe-W)<=20,Ke=Math.abs(kt-X)<=20;if(He&&Ke)return void _({lastCX:Pe,lastCY:kt});j.current=He?kt>X?3:2:1}var yt,Dt=Pe-Oe,ln=kt-Se;if(Me===0){var Xt=wp(Dt+ae,ge,et,innerWidth)[0],dn=wp(ln+ue,ge,xe,innerHeight);yt=function(Ft,Ue,it,ht){return Ue&&Ft===1||ht==="x"?"x":it&&Ft>1||ht==="y"?"y":void 0}(j.current,Xt,dn[0],qe),yt!==void 0&&O(yt,Pe,kt,ge)}if(yt==="x"||se)return void _({reach:"x"});var Z=KC(ge+(Me-Le)/100/2*ge,T/M,.2);E({scale:Z}),_(pa({touchLength:Me,reach:yt,scale:Z},jD(q,B,M,I,ge,Z,Pe,kt,Dt,ln)))}},{maxWait:8});function De(Pe){return!le&&!ee&&(A.current&&_(pa({},Pe,{pause:u})),A.current)}var J,he,Ce,Ze,at,St,Te,ye,Ve=(at=function(Pe){return De({x:Pe})},St=function(Pe){return De({y:Pe})},Te=function(Pe){return A.current&&(E({scale:Pe}),_({scale:Pe})),!ee&&A.current},ye=nb({X:function(Pe){return at(Pe)},Y:function(Pe){return St(Pe)},S:function(Pe){return Te(Pe)}}),function(Pe,kt,Me,Ye,et,xe,He,Ke,yt,Dt,ln){var Xt=d4(Dt,et,xe),dn=Xt[0],Z=Xt[1],Ft=wp(Pe,Ke,dn,innerWidth),Ue=Ft[0],it=Ft[1],ht=wp(kt,Ke,Z,innerHeight),pe=ht[0],We=ht[1],vt=Date.now()-ln;if(vt>=200||Ke!==He||Math.abs(yt-He)>1){var vn=jD(Pe,kt,et,xe,He,Ke),Ki=vn.x,Fe=vn.y,Rt=Ue?it:Ki!==Pe?Ki:null,pn=pe?We:Fe!==kt?Fe:null;return Rt!==null&&Cg(Pe,Rt,ye.X),pn!==null&&Cg(kt,pn,ye.Y),void(Ke!==He&&Cg(He,Ke,ye.S))}var Zt=(Pe-Me)/vt,Jt=(kt-Ye)/vt,Un=Math.sqrt(Math.pow(Zt,2)+Math.pow(Jt,2)),xn=!1,oi=!1;(function(Oi,mi){var bn,qi=Oi,ri=0,zi=0,as=function(xs){bn||(bn=xs);var os=xs-bn,ia=Math.sign(Oi),Nr=-.001*ia,As=Math.sign(-qi)*Math.pow(qi,2)*2e-4,Vs=qi*os+(Nr+As)*Math.pow(os,2)/2;ri+=Vs,bn=xs,ia*(qi+=(Nr+As)*os)<=0?_r():mi(ri)?Lr():_r()};function Lr(){zi=requestAnimationFrame(as)}function _r(){cancelAnimationFrame(zi)}Lr()})(Un,function(Oi){var mi=Pe+Oi*(Zt/Un),bn=kt+Oi*(Jt/Un),qi=wp(mi,He,dn,innerWidth),ri=qi[0],zi=qi[1],as=wp(bn,He,Z,innerHeight),Lr=as[0],_r=as[1];if(ri&&!xn&&(xn=!0,Ue?Cg(mi,zi,ye.X):gW(zi,mi+(mi-zi),ye.X)),Lr&&!oi&&(oi=!0,pe?Cg(bn,_r,ye.Y):gW(_r,bn+(bn-_r),ye.Y)),xn&&oi)return!1;var xs=xn||ye.X(zi),os=oi||ye.Y(_r);return xs&&os})}),nt=(J=y,he=function(Pe,kt){qe||ze(ge!==1?1:Math.max(2,T/M),Pe,kt)},Ce=m.useRef(0),Ze=XC(function(){Ce.current=0,J.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var Pe=[].slice.call(arguments);Ce.current+=1,Ze.apply(void 0,Pe),Ce.current>=2&&(Ze.cancel(),Ce.current=0,he.apply(void 0,Pe))});function ke(Pe,kt){if(j.current=0,(ee||se)&&S){_({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var Me=KC(ge,T/M);if(Ve(q,B,ae,ue,M,I,ge,Me,lt,re,$e),w(Pe,kt),W===Pe&&X===kt){if(ee)return void nt(Pe,kt);se&&x(Pe,kt)}}}function Ht(Pe,kt,Me){Me===void 0&&(Me=0),_({touched:!0,CX:Pe,CY:kt,lastCX:Pe,lastCY:kt,lastX:q,lastY:B,lastScale:ge,touchLength:Me,touchTime:Date.now()})}function on(Pe){_({maskTouched:!0,CX:Pe.clientX,CY:Pe.clientY,lastX:q,lastY:B})}J0(Ef?void 0:"mousemove",function(Pe){Pe.preventDefault(),Ee(Pe.clientX,Pe.clientY)}),J0(Ef?void 0:"mouseup",function(Pe){ke(Pe.clientX,Pe.clientY)}),J0(Ef?"touchmove":void 0,function(Pe){Pe.preventDefault();var kt=mW(Pe);Ee.apply(void 0,kt)},{passive:!1}),J0(Ef?"touchend":void 0,function(Pe){var kt=Pe.changedTouches[0];ke(kt.clientX,kt.clientY)},{passive:!1}),J0("resize",XC(function(){K&&!ee&&(_(RD(T,R,re)),k())},{maxWait:8})),u4(function(){S&&E(pa({scale:ge,rotate:re},Re))},[S]);var Yt=function(Pe,kt,Me,Ye,et,xe,He,Ke,yt,Dt){var ln=function(Ki,Fe,Rt,pn,Zt){var Jt=m.useRef(!1),Un=I_({lead:!0,scale:Rt}),xn=Un[0],oi=xn.lead,Oi=xn.scale,mi=Un[1],bn=XC(function(qi){try{return Zt(!0),mi({lead:!1,scale:qi}),Promise.resolve()}catch(ri){return Promise.reject(ri)}},{wait:pn});return u4(function(){Jt.current?(Zt(!1),mi({lead:!0}),bn(Rt)):Jt.current=!0},[Rt]),oi?[Ki*Oi,Fe*Oi,Rt/Oi]:[Ki*Rt,Fe*Rt,1]}(xe,He,Ke,yt,Dt),Xt=ln[0],dn=ln[1],Z=ln[2],Ft=function(Ki,Fe,Rt,pn,Zt){var Jt=m.useState(bFe),Un=Jt[0],xn=Jt[1],oi=m.useState(0),Oi=oi[0],mi=oi[1],bn=m.useRef(),qi=nb({OK:function(){return Ki&&mi(4)}});function ri(zi){Zt(!1),mi(zi)}return m.useEffect(function(){if(bn.current||(bn.current=Date.now()),Rt){if(function(zi,as){var Lr=zi&&zi.current;if(Lr&&Lr.nodeType===1){var _r=Lr.getBoundingClientRect();as({T:_r.top,L:_r.left,W:_r.width,H:_r.height,FIT:Lr.tagName==="IMG"?getComputedStyle(Lr).objectFit:void 0})}}(Fe,xn),Ki)return Date.now()-bn.current<250?(mi(1),requestAnimationFrame(function(){mi(2),requestAnimationFrame(function(){return ri(3)})}),void setTimeout(qi.OK,pn)):void mi(4);ri(5)}},[Ki,Rt]),[Oi,Un]}(Pe,kt,Me,yt,Dt),Ue=Ft[0],it=Ft[1],ht=it.W,pe=it.FIT,We=innerWidth/2,vt=innerHeight/2,vn=Ue<3||Ue>4;return[vn?ht?it.L:We:Ye+(We-xe*Ke/2),vn?ht?it.T:vt:et+(vt-He*Ke/2),Xt,vn&&pe?Xt*(it.H/ht):dn,Ue===0?Z:vn?ht/(xe*Ke)||.01:Z,vn?pe?1:0:1,Ue,pe]}(u,c,K,q,B,M,I,ge,d,function(Pe){return _({pause:Pe})}),xt=Yt[4],Pt=Yt[6],ct="transform "+d+"ms "+f,gt={className:p,onMouseDown:Ef?void 0:function(Pe){Pe.stopPropagation(),Pe.button===0&&Ht(Pe.clientX,Pe.clientY,0)},onTouchStart:Ef?function(Pe){Pe.stopPropagation(),Ht.apply(void 0,mW(Pe))}:void 0,onWheel:function(Pe){if(!qe){var kt=KC(ge-Pe.deltaY/100/2,T/M);_({stopRaf:!0}),ze(kt,Pe.clientX,Pe.clientY)}},style:{width:Yt[2]+"px",height:Yt[3]+"px",opacity:Yt[5],objectFit:Pt===4?void 0:Yt[7],transform:re?"rotate("+re+"deg)":void 0,transition:Pt>2?ct+", opacity "+d+"ms ease, height "+(Pt<4?d/2:Pt>4?d:0)+"ms "+f:void 0}};return ii.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:g,onMouseDown:!Ef&&S?on:void 0,onTouchStart:Ef&&S?function(Pe){return on(Pe.touches[0])}:void 0},ii.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+xt+", 0, 0, "+xt+", "+Yt[0]+", "+Yt[1]+")",transition:ee||Ne?void 0:ct,willChange:S?"transform":void 0}},n?ii.createElement(wFe,pa({src:n,loaded:K,broken:Q},gt,{onPhotoLoad:function(Pe){_(pa({},Pe,Pe.loaded&&RD(Pe.naturalWidth||0,Pe.naturalHeight||0,re)))},loadingElement:b,brokenElement:v})):i&&i({attrs:gt,scale:xt,rotate:re})))}var bW={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 kFe(e){var t=e.loop,n=t===void 0?3:t,i=e.speed,r=e.easing,s=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,g=e.overlayRender,b=e.toolbarRender,v=e.className,y=e.maskClassName,x=e.photoClassName,O=e.photoWrapClassName,w=e.loadingElement,k=e.brokenElement,S=e.images,E=e.index,C=E===void 0?0:E,N=e.onIndexChange,_=e.visible,j=e.onClose,A=e.afterClose,F=e.portalContainer,T=I_(bW),P=T[0],R=T[1],L=m.useState(0),M=L[0],U=L[1],I=P.x,H=P.touched,K=P.pause,Q=P.lastCX,q=P.lastCY,B=P.bg,ee=B===void 0?u:B,le=P.lastBg,se=P.overlay,re=P.minimal,ge=P.scale,W=P.rotate,X=P.onScale,ae=P.onRotate,ue=e.hasOwnProperty("index"),Oe=ue?C:M,Se=ue?N:U,lt=m.useRef(Oe),$e=S.length,Le=S[Oe],Ne=typeof n=="boolean"?n:$e>n,qe=function(xt,Pt){var ct=m.useReducer(function(Me){return!Me},!1)[1],gt=m.useRef(0),Pe=function(Me){var Ye=m.useRef(Me);function et(xe){Ye.current=xe}return m.useMemo(function(){(function(xe){xt?(xe(xt),gt.current=1):gt.current=2})(et)},[Me]),[Ye.current,et]}(xt),kt=Pe[1];return[Pe[0],gt.current,function(){ct(),gt.current===2&&(kt(!1),Pt&&Pt()),gt.current=0}]}(_,A),Re=qe[0],ze=qe[1],Ee=qe[2];u4(function(){if(Re)return R({pause:!0,x:Oe*-(innerWidth+_0)}),void(lt.current=Oe);R(bW)},[Re]);var De=nb({close:function(xt){ae&&ae(0),R({overlay:!0,lastBg:ee}),j(xt)},changeIndex:function(xt,Pt){Pt===void 0&&(Pt=!1);var ct=Ne?lt.current+(xt-Oe):xt,gt=$e-1,Pe=c4(ct,0,gt),kt=Ne?ct:Pe,Me=innerWidth+_0;R({touched:!1,lastCX:void 0,lastCY:void 0,x:-Me*kt,pause:Pt}),lt.current=kt,Se&&Se(Ne?xt<0?gt:xt>gt?0:xt:Pe)}}),J=De.close,he=De.changeIndex;function Ce(xt){return xt?J():R({overlay:!se})}function Ze(){R({x:-(innerWidth+_0)*Oe,lastCX:void 0,lastCY:void 0,pause:!0}),lt.current=Oe}function at(xt,Pt,ct,gt){xt==="x"?function(Pe){if(Q!==void 0){var kt=Pe-Q,Me=kt;!Ne&&(Oe===0&&kt>0||Oe===$e-1&&kt<0)&&(Me=kt/2),R({touched:!0,lastCX:Q,x:-(innerWidth+_0)*lt.current+Me,pause:!1})}else R({touched:!0,lastCX:Pe,x:I,pause:!1})}(Pt):xt==="y"&&function(Pe,kt){if(q!==void 0){var Me=u===null?null:c4(u,.01,u-Math.abs(Pe-q)/100/4);R({touched:!0,lastCY:q,bg:kt===1?Me:u,minimal:kt===1})}else R({touched:!0,lastCY:Pe,bg:ee,minimal:!0})}(ct,gt)}function St(xt,Pt){var ct=xt-(Q??xt),gt=Pt-(q??Pt),Pe=!1;if(ct<-40)he(Oe+1);else if(ct>40)he(Oe-1);else{var kt=-(innerWidth+_0)*lt.current;Math.abs(gt)>100&&re&&f&&(Pe=!0,J()),R({touched:!1,x:kt,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!Pe||se})}}J0("keydown",function(xt){if(_)switch(xt.key){case"ArrowLeft":he(Oe-1,!0);break;case"ArrowRight":he(Oe+1,!0);break;case"Escape":J()}});var Te=function(xt,Pt,ct){return m.useMemo(function(){var gt=xt.length;return ct?xt.concat(xt).concat(xt).slice(gt+Pt-1,gt+Pt+2):xt.slice(Math.max(Pt-1,0),Math.min(Pt+2,gt+1))},[xt,Pt,ct])}(S,Oe,Ne);if(!Re)return null;var ye=se&&!ze,Ve=_?ee:le,nt=X&&ae&&{images:S,index:Oe,visible:_,onClose:J,onIndexChange:he,overlayVisible:ye,overlay:Le&&Le.overlay,scale:ge,rotate:W,onScale:X,onRotate:ae},ke=i?i(ze):400,Ht=r?r(ze):pW,on=i?i(3):600,Yt=r?r(3):pW;return ii.createElement(dFe,{className:"PhotoView-Portal"+(ye?"":" PhotoView-Slider__clean")+(_?"":" PhotoView-Slider__willClose")+(v?" "+v:""),role:"dialog",onClick:function(xt){return xt.stopPropagation()},container:F},_&&ii.createElement(mFe,null),ii.createElement("div",{className:"PhotoView-Slider__Backdrop"+(y?" "+y:"")+(ze===1?" PhotoView-Slider__fadeIn":ze===2?" PhotoView-Slider__fadeOut":""),style:{background:Ve?"rgba(0, 0, 0, "+Ve+")":void 0,transitionTimingFunction:Ht,transitionDuration:(H?0:ke)+"ms",animationDuration:ke+"ms"},onAnimationEnd:Ee}),p&&ii.createElement("div",{className:"PhotoView-Slider__BannerWrap"},ii.createElement("div",{className:"PhotoView-Slider__Counter"},Oe+1," / ",$e),ii.createElement("div",{className:"PhotoView-Slider__BannerRight"},b&&nt&&b(nt),ii.createElement(fFe,{className:"PhotoView-Slider__toolbarIcon",onClick:J}))),Te.map(function(xt,Pt){var ct=Ne||Oe!==0?lt.current-1+Pt:Oe+Pt;return ii.createElement(SFe,{key:Ne?xt.key+"/"+xt.src+"/"+ct:xt.key,item:xt,speed:ke,easing:Ht,visible:_,onReachMove:at,onReachUp:St,onPhotoTap:function(){return Ce(s)},onMaskTap:function(){return Ce(l)},wrapClassName:O,className:x,style:{left:(innerWidth+_0)*ct+"px",transform:"translate3d("+I+"px, 0px, 0)",transition:H||K?void 0:"transform "+on+"ms "+Yt},loadingElement:w,brokenElement:k,onPhotoResize:Ze,isActive:lt.current===ct,expose:R})}),!Ef&&p&&ii.createElement(ii.Fragment,null,(Ne||Oe!==0)&&ii.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return he(Oe-1,!0)}},ii.createElement(hFe,null)),(Ne||Oe+1<$e)&&ii.createElement("div",{className:"PhotoView-Slider__ArrowRight",onClick:function(){return he(Oe+1,!0)}},ii.createElement(pFe,null))),g&&nt&&ii.createElement("div",{className:"PhotoView-Slider__Overlay"},g(nt)))}var EFe=["children","onIndexChange","onVisibleChange"],CFe={images:[],visible:!1,index:0};function TFe(e){var t=e.children,n=e.onIndexChange,i=e.onVisibleChange,r=Gj(e,EFe),s=I_(CFe),a=s[0],l=s[1],c=m.useRef(0),u=a.images,d=a.visible,f=a.index,h=nb({nextId:function(){return c.current+=1},update:function(b){var v=u.findIndex(function(x){return x.key===b.key});if(v>-1){var y=u.slice();return y.splice(v,1,b),void l({images:y})}l(function(x){return{images:x.images.concat(b)}})},remove:function(b){l(function(v){var y=v.images.filter(function(x){return x.key!==b});return{images:y,index:Math.min(y.length-1,f)}})},show:function(b){var v=u.findIndex(function(y){return y.key===b});l({visible:!0,index:v}),i&&i(!0,v,a)}}),p=nb({close:function(){l({visible:!1}),i&&i(!1,f,a)},changeIndex:function(b){l({index:b}),n&&n(b,a)}}),g=m.useMemo(function(){return pa({},a,h)},[a,h]);return ii.createElement(hbe.Provider,{value:g},t,ii.createElement(kFe,pa({images:u,visible:d,index:f,onIndexChange:p.changeIndex,onClose:p.close},r)))}var mbe=function(e){var t,n,i=e.src,r=e.render,s=e.overlay,a=e.width,l=e.height,c=e.triggers,u=c===void 0?["onClick"]:c,d=e.children,f=m.useContext(hbe),h=(t=function(){return f.nextId()},(n=m.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=t()),n.fn),p=m.useRef(null);m.useImperativeHandle(d==null?void 0:d.ref,function(){return p.current}),m.useEffect(function(){return function(){f.remove(h)}},[]);var g=nb({render:function(v){return r&&r(v)},show:function(v,y){f.show(h),function(x,O){if(d){var w=d.props[x];w&&w(O)}}(v,y)}}),b=m.useMemo(function(){var v={};return u.forEach(function(y){v[y]=g.show.bind(null,y)}),v},[]);return m.useEffect(function(){f.update({key:h,src:i,originRef:p,render:g.render,overlay:s,width:a,height:l})},[i]),d?m.Children.only(m.cloneElement(d,pa({},b,{ref:p}))):null};const AFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M5.293 12.707a1 1 0 0 1 0-1.414l5-5a1 1 0 1 1 1.414 1.414L8.414 11H18a1 1 0 1 1 0 2H8.414l3.293 3.293a1 1 0 0 1-1.414 1.414l-5-5Z",clipRule:"evenodd"})}),_Fe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M18.707 12.707a1 1 0 0 0 0-1.414l-5-5a1 1 0 1 0-1.414 1.414L15.586 11H6a1 1 0 1 0 0 2h9.586l-3.293 3.293a1 1 0 0 0 1.414 1.414l5-5Z",clipRule:"evenodd"})}),NFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M4.47192 2.5C5.02421 2.5 5.47192 2.94772 5.47192 3.5V5.07196C7.17065 3.47759 9.45675 2.5 11.9719 2.5C17.2186 2.5 21.4719 6.75329 21.4719 12C21.4719 17.2467 17.2186 21.5 11.9719 21.5C7.10262 21.5 3.0902 17.8375 2.53692 13.1164C2.47264 12.5679 2.8652 12.0711 3.41373 12.0068C3.96226 11.9425 4.45904 12.3351 4.52333 12.8836C4.95991 16.6089 8.12901 19.5 11.9719 19.5C16.1141 19.5 19.4719 16.1421 19.4719 12C19.4719 7.85786 16.1141 4.5 11.9719 4.5C9.75153 4.5 7.75552 5.46469 6.38146 7H9.00003C9.55232 7 10 7.44772 10 8C10 8.55228 9.55232 9 9.00003 9H4.47192C3.93256 9 3.49293 8.57299 3.47265 8.03859C3.47175 8.01771 3.47151 7.99677 3.47192 7.9758V3.5C3.47192 2.94772 3.91964 2.5 4.47192 2.5Z",fill:"currentColor"})}),Kj=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M2.55823 12C2.55823 6.75329 6.81152 2.5 12.0582 2.5C14.5734 2.5 16.8595 3.47759 18.5582 5.07197V3.5C18.5582 2.94772 19.0059 2.5 19.5582 2.5C20.1105 2.5 20.5582 2.94772 20.5582 3.5V7.97591C20.5586 7.99622 20.5584 8.01651 20.5576 8.03674C20.5382 8.572 20.0982 9 19.5582 9H15.0582C14.5059 9 14.0582 8.55228 14.0582 8C14.0582 7.44772 14.5059 7 15.0582 7H17.6487C16.2746 5.46469 14.2786 4.5 12.0582 4.5C7.91609 4.5 4.55823 7.85786 4.55823 12C4.55823 16.1421 7.91609 19.5 12.0582 19.5C15.9011 19.5 19.0702 16.6089 19.5068 12.8836C19.5711 12.3351 20.0679 11.9425 20.6164 12.0068C21.165 12.0711 21.5575 12.5679 21.4932 13.1164C20.94 17.8375 16.9275 21.5 12.0582 21.5C6.81152 21.5 2.55823 17.2467 2.55823 12Z",fill:"currentColor"})}),YC=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M16.243 6.757a1 1 0 0 1 1 1v7.072a1 1 0 0 1-2 0v-4.657L8.464 16.95a1 1 0 0 1-1.414-1.414l6.778-6.779H9.172a1 1 0 0 1 0-2h7.07Z",clipRule:"evenodd"})}),jFe=e=>o.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[o.jsx("path",{d:"M10.663 6.3872C10.8152 6.29068 11 6.40984 11 6.59007V8C11 8.55229 11.4477 9 12 9C12.5523 9 13 8.55229 13 8V6.59007C13 6.40984 13.1848 6.29068 13.337 6.3872C14.036 6.83047 14.5 7.61105 14.5 8.5C14.5 9.53284 13.8737 10.4194 12.9801 10.8006C12.9932 10.865 13 10.9317 13 11V13C13 13.5523 12.5523 14 12 14C11.4477 14 11 13.5523 11 13V11C11 10.9317 11.0068 10.865 11.0199 10.8006C10.1263 10.4194 9.5 9.53284 9.5 8.5C9.5 7.61105 9.96397 6.83047 10.663 6.3872Z",fill:"currentColor"}),o.jsx("path",{d:"M17.9754 4.01031C17.8588 4.00078 17.6965 4.00001 17.4 4.00001H9.8C8.94342 4.00001 8.36113 4.00078 7.91104 4.03756C7.47262 4.07338 7.24842 4.1383 7.09202 4.21799C6.7157 4.40974 6.40973 4.7157 6.21799 5.09202C6.1383 5.24842 6.07337 5.47263 6.03755 5.91104C6.00078 6.36113 6 6.94343 6 7.80001V16.1707C6.31278 16.0602 6.64937 16 7 16H18L18 4.60001C18 4.30348 17.9992 4.14122 17.9897 4.02464C17.9893 4.02 17.9889 4.0156 17.9886 4.01145C17.9844 4.01107 17.98 4.01069 17.9754 4.01031ZM17.657 18H7C6.44772 18 6 18.4477 6 19C6 19.5523 6.44772 20 7 20H17.657C17.5343 19.3301 17.5343 18.6699 17.657 18ZM4 19L4 7.75871C3.99999 6.95374 3.99998 6.28937 4.04419 5.74818C4.09012 5.18608 4.18868 4.66938 4.43597 4.18404C4.81947 3.43139 5.43139 2.81947 6.18404 2.43598C6.66937 2.18869 7.18608 2.09012 7.74818 2.0442C8.28937 1.99998 8.95373 1.99999 9.7587 2L17.4319 2C17.6843 1.99997 17.9301 1.99994 18.1382 2.01695C18.3668 2.03563 18.6366 2.07969 18.908 2.21799C19.2843 2.40974 19.5903 2.7157 19.782 3.09203C19.9203 3.36345 19.9644 3.63318 19.9831 3.86178C20.0001 4.06994 20 4.31574 20 4.56812L20 17C20 17.1325 19.9736 17.2638 19.9225 17.386C19.4458 18.5253 19.4458 19.4747 19.9225 20.614C20.0517 20.9227 20.0179 21.2755 19.8325 21.5541C19.6471 21.8326 19.3346 22 19 22H7C5.34315 22 4 20.6569 4 19Z",fill:"currentColor"})]}),Lv=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M18.063 5.674a1 1 0 0 1 .263 1.39l-7.5 11a1 1 0 0 1-1.533.143l-4.5-4.5a1 1 0 1 1 1.414-1.414l3.647 3.647 6.82-10.003a1 1 0 0 1 1.39-.263Z",clipRule:"evenodd"})}),gbe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM16.0755 7.93219C16.5272 8.25003 16.6356 8.87383 16.3178 9.32549L11.5678 16.0755C11.3931 16.3237 11.1152 16.4792 10.8123 16.4981C10.5093 16.517 10.2142 16.3973 10.0101 16.1727L7.51006 13.4227C7.13855 13.014 7.16867 12.3816 7.57733 12.0101C7.98598 11.6386 8.61843 11.6687 8.98994 12.0773L10.6504 13.9039L14.6822 8.17451C15 7.72284 15.6238 7.61436 16.0755 7.93219Z",fill:"currentColor"})}),RFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 9",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.292893 0.292893C0.683418 -0.0976311 1.31658 -0.0976311 1.70711 0.292893L8 6.58579L14.2929 0.292894C14.6834 -0.0976305 15.3166 -0.0976304 15.7071 0.292894C16.0976 0.683418 16.0976 1.31658 15.7071 1.70711L8.70711 8.70711C8.31658 9.09763 7.68342 9.09763 7.29289 8.70711L0.292893 1.70711C-0.0976311 1.31658 -0.0976311 0.683417 0.292893 0.292893Z"})}),IFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M15.707 4.293a1 1 0 0 1 0 1.414L9.414 12l6.293 6.293a1 1 0 0 1-1.414 1.414l-7-7a1 1 0 0 1 0-1.414l7-7a1 1 0 0 1 1.414 0Z",clipRule:"evenodd"})}),PFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M8.293 4.293a1 1 0 0 1 1.414 0l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L14.586 12 8.293 5.707a1 1 0 0 1 0-1.414Z",clipRule:"evenodd"})}),RF=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM12 6C12.5523 6 13 6.44772 13 7V12C13 12.2652 12.8946 12.5196 12.7071 12.7071L10.2071 15.2071C9.81658 15.5976 9.18342 15.5976 8.79289 15.2071C8.40237 14.8166 8.40237 14.1834 8.79289 13.7929L11 11.5858V7C11 6.44772 11.4477 6 12 6Z",fill:"currentColor"})}),DFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M12.659 9.753a1 1 0 0 1-1.318 0l-4-3.5A1 1 0 1 1 8.66 4.747L12 7.671l3.341-2.924a1 1 0 1 1 1.318 1.506l-4 3.5Zm-4.002 9.501a1 1 0 1 1-1.314-1.508l4-3.485a1 1 0 0 1 1.314 0l4 3.485a1 1 0 1 1-1.314 1.508L12 16.34l-3.343 2.913Z"})}),IF=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M12.7587 2H16.2413C17.0463 1.99999 17.7106 1.99998 18.2518 2.04419C18.8139 2.09012 19.3306 2.18868 19.816 2.43597C20.5686 2.81947 21.1805 3.43139 21.564 4.18404C21.8113 4.66937 21.9099 5.18608 21.9558 5.74817C22 6.28936 22 6.95372 22 7.75868V11.2413C22 12.0463 22 12.7106 21.9558 13.2518C21.9099 13.8139 21.8113 14.3306 21.564 14.816C21.1805 15.5686 20.5686 16.1805 19.816 16.564C19.3306 16.8113 18.8139 16.9099 18.2518 16.9558C17.8906 16.9853 17.4745 16.9951 16.9984 16.9984C16.9951 17.4745 16.9853 17.8906 16.9558 18.2518C16.9099 18.8139 16.8113 19.3306 16.564 19.816C16.1805 20.5686 15.5686 21.1805 14.816 21.564C14.3306 21.8113 13.8139 21.9099 13.2518 21.9558C12.7106 22 12.0463 22 11.2413 22H7.75868C6.95372 22 6.28936 22 5.74818 21.9558C5.18608 21.9099 4.66937 21.8113 4.18404 21.564C3.43139 21.1805 2.81947 20.5686 2.43597 19.816C2.18868 19.3306 2.09012 18.8139 2.04419 18.2518C1.99998 17.7106 1.99999 17.0463 2 16.2413V12.7587C1.99999 11.9537 1.99998 11.2894 2.04419 10.7482C2.09012 10.1861 2.18868 9.66937 2.43597 9.18404C2.81947 8.43139 3.43139 7.81947 4.18404 7.43598C4.66937 7.18868 5.18608 7.09012 5.74817 7.04419C6.10939 7.01468 6.52548 7.00487 7.00162 7.00162C7.00487 6.52548 7.01468 6.10939 7.04419 5.74817C7.09012 5.18608 7.18868 4.66937 7.43598 4.18404C7.81947 3.43139 8.43139 2.81947 9.18404 2.43597C9.66937 2.18868 10.1861 2.09012 10.7482 2.04419C11.2894 1.99998 11.9537 1.99999 12.7587 2ZM9.00176 7L11.2413 7C12.0463 6.99999 12.7106 6.99998 13.2518 7.04419C13.8139 7.09012 14.3306 7.18868 14.816 7.43598C15.5686 7.81947 16.1805 8.43139 16.564 9.18404C16.8113 9.66937 16.9099 10.1861 16.9558 10.7482C17 11.2894 17 11.9537 17 12.7587V14.9982C17.4455 14.9951 17.7954 14.9864 18.089 14.9624C18.5274 14.9266 18.7516 14.8617 18.908 14.782C19.2843 14.5903 19.5903 14.2843 19.782 13.908C19.8617 13.7516 19.9266 13.5274 19.9624 13.089C19.9992 12.6389 20 12.0566 20 11.2V7.8C20 6.94342 19.9992 6.36113 19.9624 5.91104C19.9266 5.47262 19.8617 5.24842 19.782 5.09202C19.5903 4.7157 19.2843 4.40973 18.908 4.21799C18.7516 4.1383 18.5274 4.07337 18.089 4.03755C17.6389 4.00078 17.0566 4 16.2 4H12.8C11.9434 4 11.3611 4.00078 10.911 4.03755C10.4726 4.07337 10.2484 4.1383 10.092 4.21799C9.7157 4.40973 9.40973 4.7157 9.21799 5.09202C9.1383 5.24842 9.07337 5.47262 9.03755 5.91104C9.01357 6.20463 9.00489 6.55447 9.00176 7ZM5.91104 9.03755C5.47262 9.07337 5.24842 9.1383 5.09202 9.21799C4.7157 9.40973 4.40973 9.7157 4.21799 10.092C4.1383 10.2484 4.07337 10.4726 4.03755 10.911C4.00078 11.3611 4 11.9434 4 12.8V16.2C4 17.0566 4.00078 17.6389 4.03755 18.089C4.07337 18.5274 4.1383 18.7516 4.21799 18.908C4.40973 19.2843 4.7157 19.5903 5.09202 19.782C5.24842 19.8617 5.47262 19.9266 5.91104 19.9624C6.36113 19.9992 6.94342 20 7.8 20H11.2C12.0566 20 12.6389 19.9992 13.089 19.9624C13.5274 19.9266 13.7516 19.8617 13.908 19.782C14.2843 19.5903 14.5903 19.2843 14.782 18.908C14.8617 18.7516 14.9266 18.5274 14.9624 18.089C14.9992 17.6389 15 17.0566 15 16.2V12.8C15 11.9434 14.9992 11.3611 14.9624 10.911C14.9266 10.4726 14.8617 10.2484 14.782 10.092C14.5903 9.7157 14.2843 9.40973 13.908 9.21799C13.7516 9.1383 13.5274 9.07337 13.089 9.03755C12.6389 9.00078 12.0566 9 11.2 9H7.8C6.94342 9 6.36113 9.00078 5.91104 9.03755Z",fill:"currentColor"})}),MFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M10.556 4a1 1 0 0 0-.97.751l-.292 1.14h5.421l-.293-1.14A1 1 0 0 0 13.453 4h-2.897Zm6.224 1.892-.421-1.639A3 3 0 0 0 13.453 2h-2.897A3 3 0 0 0 7.65 4.253l-.421 1.639H4a1 1 0 1 0 0 2h.1l1.215 11.425A3 3 0 0 0 8.3 22h7.4a3 3 0 0 0 2.984-2.683l1.214-11.425H20a1 1 0 1 0 0-2h-3.22Zm1.108 2H6.112l1.192 11.214A1 1 0 0 0 8.3 20h7.4a1 1 0 0 0 .995-.894l1.192-11.214ZM10 10a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Zm4 0a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),LFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M3 12a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm7 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm7 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0Z"})}),$Fe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 10 16",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.34151 0.747423C4.71854 0.417526 5.28149 0.417526 5.65852 0.747423L9.65852 4.24742C10.0742 4.61111 10.1163 5.24287 9.75259 5.6585C9.38891 6.07414 8.75715 6.11626 8.34151 5.75258L5.00001 2.82877L1.65852 5.75258C1.24288 6.11626 0.61112 6.07414 0.247438 5.6585C-0.116244 5.24287 -0.0741267 4.61111 0.34151 4.24742L4.34151 0.747423ZM0.246065 10.3578C0.608879 9.94139 1.24055 9.89795 1.65695 10.2608L5.00001 13.1737L8.34308 10.2608C8.75948 9.89795 9.39115 9.94139 9.75396 10.3578C10.1168 10.7742 10.0733 11.4058 9.65695 11.7687L5.65695 15.2539C5.28043 15.582 4.7196 15.582 4.34308 15.2539L0.343082 11.7687C-0.0733128 11.4058 -0.116749 10.7742 0.246065 10.3578Z"})}),FFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M16.793 2.793a3.121 3.121 0 1 1 4.414 4.414l-8.5 8.5A1 1 0 0 1 12 16H9a1 1 0 0 1-1-1v-3a1 1 0 0 1 .293-.707l8.5-8.5Zm3 1.414a1.121 1.121 0 0 0-1.586 0L10 12.414V14h1.586l8.207-8.207a1.121 1.121 0 0 0 0-1.586ZM6 5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-4a1 1 0 1 1 2 0v4a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h4a1 1 0 1 1 0 2H6Z",clipRule:"evenodd"})}),BFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M12 7a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0V8h-3a1 1 0 0 1-1-1Zm-5 5a1 1 0 0 1 1 1v3h3a1 1 0 1 1 0 2H7a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),UFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8-10C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm4.465 6.763a1 1 0 0 0-1.228-1.228l-5.5 1.5a1 1 0 0 0-.702.702l-1.5 5.5a1 1 0 0 0 1.228 1.228l5.5-1.5a1 1 0 0 0 .702-.702l1.5-5.5Zm-6.54 5.312.89-3.26 3.26-.89-.89 3.26-3.26.89Z",clipRule:"evenodd"})}),QFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M14.4472 7.10558C14.9412 7.35257 15.1414 7.95324 14.8944 8.44722L10.8944 16.4472C10.6474 16.9412 10.0468 17.1414 9.55279 16.8944C9.05881 16.6474 8.85858 16.0468 9.10557 15.5528L13.1056 7.55279C13.3526 7.05881 13.9532 6.85859 14.4472 7.10558ZM6.6 7.20001C7.04183 7.53138 7.13137 8.15818 6.8 8.60001L4.25 12L6.8 15.4C7.13137 15.8418 7.04183 16.4686 6.6 16.8C6.15817 17.1314 5.53137 17.0418 5.2 16.6L2.2 12.6C1.93333 12.2444 1.93333 11.7556 2.2 11.4L5.2 7.40001C5.53137 6.95818 6.15817 6.86863 6.6 7.20001ZM17.4 7.20001C17.8418 6.86863 18.4686 6.95818 18.8 7.40001L21.8 11.4C22.0667 11.7556 22.0667 12.2444 21.8 12.6L18.8 16.6C18.4686 17.0418 17.8418 17.1314 17.4 16.8C16.9582 16.4686 16.8686 15.8418 17.2 15.4L19.75 12L17.2 8.60001C16.8686 8.15818 16.9582 7.53138 17.4 7.20001Z",fill:"currentColor"})}),bbe=e=>o.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[o.jsx("path",{d:"M13 12a1 1 0 1 0-2 0v4a1 1 0 1 0 2 0v-4Zm-1-2.5A1.25 1.25 0 1 0 12 7a1.25 1.25 0 0 0 0 2.5Z"}),o.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z",clipRule:"evenodd"})]}),zFe=e=>o.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[o.jsx("path",{d:"M7.79289 9.04289C8.18342 8.65237 8.81658 8.65237 9.20711 9.04289L11.4571 11.2929C11.8476 11.6834 11.8476 12.3166 11.4571 12.7071L9.20711 14.9571C8.81658 15.3476 8.18342 15.3476 7.79289 14.9571C7.40237 14.5666 7.40237 13.9334 7.79289 13.5429L9.33579 12L7.79289 10.4571C7.40237 10.0666 7.40237 9.43342 7.79289 9.04289ZM12.25 14.25C12.25 13.6977 12.6977 13.25 13.25 13.25H15.5C16.0523 13.25 16.5 13.6977 16.5 14.25C16.5 14.8023 16.0523 15.25 15.5 15.25H13.25C12.6977 15.25 12.25 14.8023 12.25 14.25Z",fill:"currentColor"}),o.jsx("path",{d:"M2 8C2 5.79086 3.79086 4 6 4C6.55228 4 7 4.44772 7 5C7 5.55228 6.55228 6 6 6C4.89543 6 4 6.89543 4 8V16C4 17.1046 4.89543 18 6 18C6.55228 18 7 18.4477 7 19C7 19.5523 6.55228 20 6 20C3.79086 20 2 18.2091 2 16V8ZM17 5C17 4.44772 17.4477 4 18 4C20.2091 4 22 5.79086 22 8V16C22 18.2091 20.2091 20 18 20C17.4477 20 17 19.5523 17 19C17 18.4477 17.4477 18 18 18C19.1046 18 20 17.1046 20 16V8C20 6.89543 19.1046 6 18 6C17.4477 6 17 5.55228 17 5Z",fill:"currentColor"})]}),VFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M6 12C6 11.4477 6.44772 11 7 11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H7C6.44772 13 6 12.5523 6 12Z",fill:"currentColor"})}),HFe=e=>o.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[o.jsx("path",{d:"M12.75 9.50001C12.75 9.08579 13.0858 8.75001 13.5 8.75001H14.5C14.9142 8.75001 15.25 9.08579 15.25 9.50001V14.5C15.25 14.9142 14.9142 15.25 14.5 15.25H13.5C13.0858 15.25 12.75 14.9142 12.75 14.5V9.50001Z",fill:"currentColor"}),o.jsx("path",{d:"M9.50001 8.75001C9.08579 8.75001 8.75001 9.08579 8.75001 9.50001V14.5C8.75001 14.9142 9.08579 15.25 9.50001 15.25H10.5C10.9142 15.25 11.25 14.9142 11.25 14.5V9.50001C11.25 9.08579 10.9142 8.75001 10.5 8.75001H9.50001Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.97144 12C1.97144 6.46138 6.46138 1.97144 12 1.97144C17.5386 1.97144 22.0286 6.46138 22.0286 12C22.0286 17.5386 17.5386 22.0286 12 22.0286C6.46138 22.0286 1.97144 17.5386 1.97144 12ZM12 4.02858C7.59751 4.02858 4.02858 7.59751 4.02858 12C4.02858 16.4025 7.59751 19.9714 12 19.9714C16.4025 19.9714 19.9714 16.4025 19.9714 12C19.9714 7.59751 16.4025 4.02858 12 4.02858Z",fill:"currentColor"})]}),yW=e=>o.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[o.jsx("path",{d:"M9.5 9.33165V14.6683C9.5 15.4595 10.3752 15.9373 11.0408 15.5095L15.1915 12.8412C15.8038 12.4475 15.8038 11.5524 15.1915 11.1588L11.0408 8.49047C10.3752 8.06265 9.5 8.54049 9.5 9.33165Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12Z",fill:"currentColor"})]}),qFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M8 16.7229V7.27711C8 6.29075 9.08894 5.69298 9.9211 6.22254L17.3428 10.9454C18.1147 11.4366 18.1147 12.5634 17.3428 13.0546L9.92109 17.7775C9.08894 18.3071 8 17.7093 8 16.7229Z",fill:"currentColor"})}),ybe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M12 5a1 1 0 0 1 1 1v5h5a1 1 0 1 1 0 2h-5v5a1 1 0 1 1-2 0v-5H6a1 1 0 1 1 0-2h5V6a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),vbe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M12 3C12.5523 3 13 3.44772 13 4L13 11H20C20.5523 11 21 11.4477 21 12C21 12.5523 20.5523 13 20 13L13 13L13 20C13 20.5523 12.5523 21 12 21C11.4477 21 11 20.5523 11 20L11 13L4 13C3.44772 13 3 12.5523 3 12C3 11.4477 3.44772 11 4 11L11 11L11 4C11 3.44772 11.4477 3 12 3Z",fill:"currentColor"})}),WFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M12 6C12.5523 6 13 6.44772 13 7V11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H13V17C13 17.5523 12.5523 18 12 18C11.4477 18 11 17.5523 11 17V13H7C6.44772 13 6 12.5523 6 12C6 11.4477 6.44772 11 7 11H11V7C11 6.44772 11.4477 6 12 6Z",fill:"currentColor"})}),GFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.875 4.5C7.35418 4.5 4.5 7.35418 4.5 10.875C4.5 14.3958 7.35418 17.25 10.875 17.25C14.3958 17.25 17.25 14.3958 17.25 10.875C17.25 7.35418 14.3958 4.5 10.875 4.5ZM2.5 10.875C2.5 6.24962 6.24962 2.5 10.875 2.5C15.5004 2.5 19.25 6.24962 19.25 10.875C19.25 12.8273 18.582 14.6236 17.462 16.0478L21.2071 19.7929C21.5976 20.1834 21.5976 20.8166 21.2071 21.2071C20.8166 21.5976 20.1834 21.5976 19.7929 21.2071L16.0478 17.462C14.6236 18.582 12.8273 19.25 10.875 19.25C6.24962 19.25 2.5 15.5004 2.5 10.875Z",fill:"currentColor"})}),KFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M11.2929 3.29289C11.6834 2.90237 12.3166 2.90237 12.7071 3.29289L16.7071 7.29289C17.0976 7.68342 17.0976 8.31658 16.7071 8.70711C16.3166 9.09763 15.6834 9.09763 15.2929 8.70711L13 6.41421V15C13 15.5523 12.5523 16 12 16C11.4477 16 11 15.5523 11 15V6.41421L8.70711 8.70711C8.31658 9.09763 7.68342 9.09763 7.29289 8.70711C6.90237 8.31658 6.90237 7.68342 7.29289 7.29289L11.2929 3.29289ZM4 14C4.55229 14 5 14.4477 5 15V15.2C5 16.0566 5.00078 16.6389 5.03755 17.089C5.07337 17.5274 5.1383 17.7516 5.21799 17.908C5.40973 18.2843 5.7157 18.5903 6.09202 18.782C6.24842 18.8617 6.47262 18.9266 6.91104 18.9624C7.36113 18.9992 7.94342 19 8.8 19H15.2C16.0566 19 16.6389 18.9992 17.089 18.9624C17.5274 18.9266 17.7516 18.8617 17.908 18.782C18.2843 18.5903 18.5903 18.2843 18.782 17.908C18.8617 17.7516 18.9266 17.5274 18.9624 17.089C18.9992 16.6389 19 16.0566 19 15.2V15C19 14.4477 19.4477 14 20 14C20.5523 14 21 14.4477 21 15V15.2413C21 16.0463 21 16.7106 20.9558 17.2518C20.9099 17.8139 20.8113 18.3306 20.564 18.816C20.1805 19.5686 19.5686 20.1805 18.816 20.564C18.3306 20.8113 17.8139 20.9099 17.2518 20.9558C16.7106 21 16.0463 21 15.2413 21H8.75868C7.95372 21 7.28936 21 6.74817 20.9558C6.18608 20.9099 5.66937 20.8113 5.18404 20.564C4.43139 20.1805 3.81947 19.5686 3.43597 18.816C3.18868 18.3306 3.09012 17.8139 3.04419 17.2518C2.99998 16.7106 2.99999 16.0463 3 15.2413L3 15C3 14.4477 3.44772 14 4 14Z",fill:"currentColor"})}),XFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M6 8C6 6.89543 6.89543 6 8 6H16C17.1046 6 18 6.89543 18 8V16C18 17.1046 17.1046 18 16 18H8C6.89543 18 6 17.1046 6 16V8Z",fill:"currentColor"})}),YFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M14.5 4a5.5 5.5 0 0 0-5.078 7.616 1 1 0 0 1-.216 1.092l-4.749 4.75a1.475 1.475 0 0 0 2.086 2.085l4.749-4.749a1 1 0 0 1 1.092-.216A5.5 5.5 0 0 0 20 9.414l-1.293 1.293a3.828 3.828 0 1 1-5.414-5.414L14.585 4H14.5ZM7 9.5a7.5 7.5 0 0 1 9.969-7.084 1 1 0 0 1 .378 1.651l-2.64 2.64a1.829 1.829 0 0 0 2.586 2.586l2.64-2.64a1 1 0 0 1 1.651.378 7.5 7.5 0 0 1-9.328 9.627l-4.299 4.3a3.475 3.475 0 0 1-4.914-4.915l4.299-4.299A7.497 7.497 0 0 1 7 9.5Z"})}),K2=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M8.99805 16.796C8.99805 15.4164 7.87961 14.2979 6.5 14.2979C5.12039 14.2979 4.00195 15.4164 4.00195 16.796C4.00196 18.1756 5.1204 19.294 6.5 19.294C7.8796 19.294 8.99804 18.1756 8.99805 16.796ZM19.748 15.0479C19.748 14.7729 19.525 14.5499 19.25 14.5499H15.75C15.475 14.5499 15.252 14.7729 15.252 15.0479V18.5479C15.252 18.823 15.475 19.046 15.75 19.046H19.25C19.525 19.046 19.748 18.823 19.748 18.5479V15.0479ZM10.0469 3.45125C11.077 2.15921 13.0849 2.20276 14.0498 3.58113L16.4189 6.96492L16.5205 7.12215C17.5046 8.76341 16.3301 10.9023 14.3691 10.9024H9.63086C7.60676 10.9023 6.42029 8.62316 7.58105 6.96492L9.9502 3.58113L10.0469 3.45125ZM12.4082 4.73055C12.2223 4.46497 11.842 4.44826 11.6318 4.68074L11.5918 4.73055L9.22266 8.11433C8.99176 8.44435 9.22808 8.89744 9.63086 8.89754H14.3691C14.7468 8.89745 14.9774 8.49957 14.8145 8.17781L14.7773 8.11433L12.4082 4.73055ZM11.002 16.796C11.0019 19.2824 8.98638 21.2979 6.5 21.2979C4.01362 21.2979 1.99806 19.2824 1.99805 16.796C1.99805 14.3096 4.01361 12.294 6.5 12.294C8.98639 12.294 11.002 14.3096 11.002 16.796ZM21.752 18.5479C21.752 19.9297 20.6318 21.0499 19.25 21.0499H15.75C14.3682 21.0499 13.248 19.9297 13.248 18.5479V15.0479C13.2481 13.6662 14.3682 12.546 15.75 12.546H19.25C20.6318 12.546 21.7519 13.6662 21.752 15.0479V18.5479Z",fill:"currentColor"})}),ZFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5555 4C10.099 4 9.70052 4.30906 9.58693 4.75114L9.29382 5.8919H14.715L14.4219 4.75114C14.3083 4.30906 13.9098 4 13.4533 4H10.5555ZM16.7799 5.8919L16.3589 4.25342C16.0182 2.92719 14.8226 2 13.4533 2H10.5555C9.18616 2 7.99062 2.92719 7.64985 4.25342L7.22886 5.8919H4C3.44772 5.8919 3 6.33961 3 6.8919C3 7.44418 3.44772 7.8919 4 7.8919H4.10069L5.31544 19.3172C5.47763 20.8427 6.76455 22 8.29863 22H15.7014C17.2354 22 18.5224 20.8427 18.6846 19.3172L19.8993 7.8919H20C20.5523 7.8919 21 7.44418 21 6.8919C21 6.33961 20.5523 5.8919 20 5.8919H16.7799ZM17.888 7.8919H6.11196L7.30423 19.1057C7.3583 19.6142 7.78727 20 8.29863 20H15.7014C16.2127 20 16.6417 19.6142 16.6958 19.1057L17.888 7.8919ZM10 10C10.5523 10 11 10.4477 11 11V16C11 16.5523 10.5523 17 10 17C9.44772 17 9 16.5523 9 16V11C9 10.4477 9.44772 10 10 10ZM14 10C14.5523 10 15 10.4477 15 11V16C15 16.5523 14.5523 17 14 17C13.4477 17 13 16.5523 13 16V11C13 10.4477 13.4477 10 14 10Z"})}),JFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M7.5 5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5ZM3 7.5a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM17 6a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm-4 2a4 4 0 1 1 8 0 4 4 0 0 1-8 0Zm-8.96 8.247C3.137 17.048 2.5 18.271 2.5 20a1 1 0 1 1-2 0c0-2.271.862-4.049 2.21-5.248C4.042 13.57 5.788 13 7.5 13s3.459.57 4.79 1.752c1.348 1.2 2.21 2.977 2.21 5.248a1 1 0 1 1-2 0c0-1.729-.638-2.952-1.54-3.753C10.042 15.43 8.788 15 7.5 15s-2.541.43-3.46 1.247Zm15.757-.607c-1.009-.638-2.338-.807-3.526-.472a1 1 0 0 1-.542-1.925c1.695-.478 3.616-.255 5.136.706 1.558.984 2.635 2.707 2.635 5.051a1 1 0 1 1-2 0c0-1.665-.732-2.746-1.703-3.36Z",clipRule:"evenodd"})}),xbe=e=>o.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[o.jsx("path",{d:"M10.42 2.006a4 4 0 0 1 3.159 0c.674.29 1.188.822 1.667 1.456.474.627 1 1.473 1.653 2.523l3.542 5.696c.72 1.16 1.3 2.09 1.682 2.854.384.766.654 1.517.59 2.292a4 4 0 0 1-1.604 2.886c-.625.463-1.405.63-2.258.709-.85.078-1.945.078-3.311.078H8.46c-1.366 0-2.46 0-3.31-.078-.854-.078-1.634-.246-2.26-.71a4 4 0 0 1-1.603-2.885c-.064-.775.206-1.526.59-2.292.383-.764.961-1.694 1.682-2.854l3.542-5.696c.653-1.05 1.18-1.896 1.653-2.523.48-.634.993-1.166 1.667-1.456Zm2.37 1.838a2 2 0 0 0-1.58 0c-.192.083-.448.28-.86.825-.413.544-.891 1.312-1.577 2.415l-3.488 5.61c-.755 1.214-1.283 2.066-1.62 2.737-.34.678-.402 1.02-.385 1.232a2 2 0 0 0 .802 1.443c.171.127.494.255 1.25.324.748.069 1.75.07 3.18.07h6.976c1.43 0 2.432-.001 3.18-.07.756-.069 1.079-.197 1.25-.324a2 2 0 0 0 .802-1.443c.017-.212-.045-.554-.385-1.232-.337-.671-.865-1.523-1.62-2.737l-3.488-5.61c-.686-1.103-1.164-1.87-1.576-2.415-.413-.546-.67-.742-.861-.825"}),o.jsx("path",{d:"M12 7.5a1 1 0 0 1 1 1v3a1 1 0 1 1-2 0v-3a1 1 0 0 1 1-1M10.851 15a1.15 1.15 0 1 1 2.3 0 1.15 1.15 0 0 1-2.3 0"})]}),PF=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M5.636 5.636a1 1 0 0 1 1.414 0l4.95 4.95 4.95-4.95a1 1 0 0 1 1.414 1.414L13.414 12l4.95 4.95a1 1 0 0 1-1.414 1.414L12 13.414l-4.95 4.95a1 1 0 0 1-1.414-1.414l4.95-4.95-4.95-4.95a1 1 0 0 1 0-1.414Z",clipRule:"evenodd"})});/** + `),()=>{document.head.removeChild(d)}},[t]),o.jsx(F4e,{isPresent:t,childRef:i,sizeRef:r,children:m.cloneElement(e,{ref:i})})}const U4e=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:r,presenceAffectsLayout:s,mode:a})=>{const l=Uj(Q4e),c=m.useId(),u=m.useCallback(f=>{l.set(f,!0);for(const h of l.values())if(!h)return;i&&i()},[l,i]),d=m.useMemo(()=>({id:c,initial:t,isPresent:n,custom:r,onExitComplete:u,register:f=>(l.set(f,!1),()=>l.delete(f))}),s?[Math.random(),u]:[n,u]);return m.useMemo(()=>{l.forEach((f,h)=>l.set(h,!1))},[n]),m.useEffect(()=>{!n&&!l.size&&i&&i()},[n]),a==="popLayout"&&(e=o.jsx(B4e,{isPresent:n,children:e})),o.jsx(Qj.Provider,{value:d,children:e})};function Q4e(){return new Map}function Lme(e=!0){const t=m.useContext(Qj);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=t,s=m.useId();m.useEffect(()=>{e&&r(s)},[e]);const a=m.useCallback(()=>e&&i&&i(s),[s,i,e]);return!n&&i?[!1,a]:[!0]}const HC=e=>e.key||"";function JH(e){const t=[];return m.Children.forEach(e,n=>{m.isValidElement(n)&&t.push(n)}),t}const J9=typeof window<"u",$me=J9?m.useLayoutEffect:m.useEffect,Ru=({children:e,custom:t,initial:n=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:s="sync",propagate:a=!1})=>{const[l,c]=Lme(a),u=m.useMemo(()=>JH(e),[e]),d=a&&!l?[]:u.map(HC),f=m.useRef(!0),h=m.useRef(u),p=Uj(()=>new Map),[g,b]=m.useState(u),[v,y]=m.useState(u);$me(()=>{f.current=!1,h.current=u;for(let w=0;w{const k=HC(w),S=a&&!l?!1:u===v||d.includes(k),E=()=>{if(p.has(k))p.set(k,!0);else return;let C=!0;p.forEach(N=>{N||(C=!1)}),C&&(O==null||O(),y(h.current),a&&(c==null||c()),i&&i())};return o.jsx(U4e,{isPresent:S,initial:!f.current||n?void 0:!1,custom:S?void 0:t,presenceAffectsLayout:r,mode:s,onExitComplete:S?void 0:E,children:w},k)})})},ac=e=>e;let Fme=ac;const z4e={useManualTiming:!1};function V4e(e){let t=new Set,n=new Set,i=!1,r=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){s.has(u)&&(c.schedule(u),e()),u(a)}const c={schedule:(u,d=!1,f=!1)=>{const p=f&&i?t:n;return d&&s.add(u),p.has(u)||p.add(u),u},cancel:u=>{n.delete(u),s.delete(u)},process:u=>{if(a=u,i){r=!0;return}i=!0,[t,n]=[n,t],t.forEach(l),t.clear(),i=!1,r&&(r=!1,c.process(u))}};return c}const qC=["read","resolveKeyframes","update","preRender","render","postRender"],H4e=40;function Bme(e,t){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,a=qC.reduce((y,x)=>(y[x]=V4e(s),y),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:h}=a,p=()=>{const y=performance.now();n=!1,r.delta=i?1e3/60:Math.max(Math.min(y-r.timestamp,H4e),1),r.timestamp=y,r.isProcessing=!0,l.process(r),c.process(r),u.process(r),d.process(r),f.process(r),h.process(r),r.isProcessing=!1,n&&t&&(i=!1,e(p))},g=()=>{n=!0,i=!0,r.isProcessing||e(p)};return{schedule:qC.reduce((y,x)=>{const O=a[x];return y[x]=(w,k=!1,S=!1)=>(n||g(),O.schedule(w,k,S)),y},{}),cancel:y=>{for(let x=0;xeq[e].some(n=>!!t[n])};function q4e(e){for(const t in e)Pv[t]={...Pv[t],...e[t]}}const W4e=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 E_(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||W4e.has(e)}let Qme=e=>!E_(e);function zme(e){e&&(Qme=t=>t.startsWith("on")?!E_(t):e(t))}try{zme(require("@emotion/is-prop-valid").default)}catch{}function G4e(e,t,n){const i={};for(const r in e)r==="values"&&typeof e.values=="object"||(Qme(r)||n===!0&&E_(r)||!t&&!E_(r)||e.draggable&&r.startsWith("onDrag"))&&(i[r]=e[r]);return i}function K4e({children:e,isValidProp:t,...n}){t&&zme(t),n={...m.useContext(cS),...n},n.isStatic=Uj(()=>n.isStatic);const i=m.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return o.jsx(cS.Provider,{value:i,children:e})}function X4e(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...i)=>e(...i);return new Proxy(n,{get:(i,r)=>r==="create"?e:(t.has(r)||t.set(r,e(r)),t.get(r))})}const zj=m.createContext({});function uS(e){return typeof e=="string"||Array.isArray(e)}function Vj(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const eF=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],tF=["initial",...eF];function Hj(e){return Vj(e.animate)||tF.some(t=>uS(e[t]))}function Vme(e){return!!(Hj(e)||e.variants)}function Y4e(e,t){if(Hj(e)){const{initial:n,animate:i}=e;return{initial:n===!1||uS(n)?n:void 0,animate:uS(i)?i:void 0}}return e.inherit!==!1?t:{}}function Z4e(e){const{initial:t,animate:n}=Y4e(e,m.useContext(zj));return m.useMemo(()=>({initial:t,animate:n}),[tq(t),tq(n)])}function tq(e){return Array.isArray(e)?e.join(" "):e}const J4e=Symbol.for("motionComponentSymbol");function Sy(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function e6e(e,t,n){return m.useCallback(i=>{i&&e.onMount&&e.onMount(i),t&&(i?t.mount(i):t.unmount()),n&&(typeof n=="function"?n(i):Sy(n)&&(n.current=i))},[t])}const nF=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),t6e="framerAppearId",Hme="data-"+nF(t6e),{schedule:iF}=Bme(queueMicrotask,!1),qme=m.createContext({});function n6e(e,t,n,i,r){var s,a;const{visualElement:l}=m.useContext(zj),c=m.useContext(Ume),u=m.useContext(Qj),d=m.useContext(cS).reducedMotion,f=m.useRef(null);i=i||c.renderer,!f.current&&i&&(f.current=i(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const h=f.current,p=m.useContext(qme);h&&!h.projection&&r&&(h.type==="html"||h.type==="svg")&&i6e(f.current,n,r,p);const g=m.useRef(!1);m.useInsertionEffect(()=>{h&&g.current&&h.update(n,u)});const b=n[Hme],v=m.useRef(!!b&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,b))&&((a=window.MotionHasOptimisedAnimation)===null||a===void 0?void 0:a.call(window,b)));return $me(()=>{h&&(g.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),iF.render(h.render),v.current&&h.animationState&&h.animationState.animateChanges())}),m.useEffect(()=>{h&&(!v.current&&h.animationState&&h.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,b)}),v.current=!1))}),h}function i6e(e,t,n,i){const{layoutId:r,layout:s,drag:a,dragConstraints:l,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Wme(e.parent)),e.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!a||l&&Sy(l),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,layoutScroll:c,layoutRoot:u})}function Wme(e){if(e)return e.options.allowProjection!==!1?e.projection:Wme(e.parent)}function r6e({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:i,Component:r}){var s,a;e&&q4e(e);function l(u,d){let f;const h={...m.useContext(cS),...u,layoutId:s6e(u)},{isStatic:p}=h,g=Z4e(u),b=i(u,p);if(!p&&J9){a6e();const v=o6e(h);f=v.MeasureLayout,g.visualElement=n6e(r,b,h,t,v.ProjectionNode)}return o.jsxs(zj.Provider,{value:g,children:[f&&g.visualElement?o.jsx(f,{visualElement:g.visualElement,...h}):null,n(r,u,e6e(b,g.visualElement,d),b,p,g.visualElement)]})}l.displayName=`motion.${typeof r=="string"?r:`create(${(a=(s=r.displayName)!==null&&s!==void 0?s:r.name)!==null&&a!==void 0?a:""})`}`;const c=m.forwardRef(l);return c[J4e]=r,c}function s6e({layoutId:e}){const t=m.useContext(Z9).id;return t&&e!==void 0?t+"-"+e:e}function a6e(e,t){m.useContext(Ume).strict}function o6e(e){const{drag:t,layout:n}=Pv;if(!t&&!n)return{};const i={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}const l6e=["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 rF(e){return typeof e!="string"||e.includes("-")?!1:!!(l6e.indexOf(e)>-1||/[A-Z]/u.test(e))}function nq(e){const t=[{},{}];return e==null||e.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function sF(e,t,n,i){if(typeof t=="function"){const[r,s]=nq(i);t=t(n!==void 0?n:e.custom,r,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,s]=nq(i);t=t(n!==void 0?n:e.custom,r,s)}return t}const G3=e=>Array.isArray(e),c6e=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),u6e=e=>G3(e)?e[e.length-1]||0:e,mo=e=>!!(e&&e.getVelocity);function q2(e){const t=mo(e)?e.get():e;return c6e(t)?t.toValue():t}function d6e({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},i,r,s){const a={latestValues:f6e(i,r,s,e),renderState:t()};return n&&(a.onMount=l=>n({props:i,current:l,...a}),a.onUpdate=l=>n(l)),a}const Gme=e=>(t,n)=>{const i=m.useContext(zj),r=m.useContext(Qj),s=()=>d6e(e,t,i,r);return n?s():Uj(s)};function f6e(e,t,n,i){const r={},s=i(e,{});for(const h in s)r[h]=q2(s[h]);let{initial:a,animate:l}=e;const c=Hj(e),u=Vme(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"&&!Vj(f)){const h=Array.isArray(f)?f:[f];for(let p=0;pt=>typeof t=="string"&&t.startsWith(e),Xme=Kme("--"),h6e=Kme("var(--"),aF=e=>h6e(e)?p6e.test(e.split("/*")[0].trim()):!1,p6e=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Yme=(e,t)=>t&&typeof e=="number"?t.transform(e):e,vh=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},dS={...kx,transform:e=>vh(0,1,e)},WC={...kx,default:1},Lk=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),mp=Lk("deg"),Id=Lk("%"),Rn=Lk("px"),m6e=Lk("vh"),g6e=Lk("vw"),iq={...Id,parse:e=>Id.parse(e)/100,transform:e=>Id.transform(e*100)},b6e={borderWidth:Rn,borderTopWidth:Rn,borderRightWidth:Rn,borderBottomWidth:Rn,borderLeftWidth:Rn,borderRadius:Rn,radius:Rn,borderTopLeftRadius:Rn,borderTopRightRadius:Rn,borderBottomRightRadius:Rn,borderBottomLeftRadius:Rn,width:Rn,maxWidth:Rn,height:Rn,maxHeight:Rn,top:Rn,right:Rn,bottom:Rn,left:Rn,padding:Rn,paddingTop:Rn,paddingRight:Rn,paddingBottom:Rn,paddingLeft:Rn,margin:Rn,marginTop:Rn,marginRight:Rn,marginBottom:Rn,marginLeft:Rn,backgroundPositionX:Rn,backgroundPositionY:Rn},y6e={rotate:mp,rotateX:mp,rotateY:mp,rotateZ:mp,scale:WC,scaleX:WC,scaleY:WC,scaleZ:WC,skew:mp,skewX:mp,skewY:mp,distance:Rn,translateX:Rn,translateY:Rn,translateZ:Rn,x:Rn,y:Rn,z:Rn,perspective:Rn,transformPerspective:Rn,opacity:dS,originX:iq,originY:iq,originZ:Rn},rq={...kx,transform:Math.round},oF={...b6e,...y6e,zIndex:rq,size:Rn,fillOpacity:dS,strokeOpacity:dS,numOctaves:rq},v6e={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},x6e=Sx.length;function w6e(e,t,n){let i="",r=!0;for(let s=0;s({style:{},transform:{},transformOrigin:{},vars:{}}),Zme=()=>({...uF(),attrs:{}}),dF=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Jme(e,{style:t,vars:n},i,r){Object.assign(e.style,t,r&&r.getProjectionStyles(i));for(const s in n)e.style.setProperty(s,n[s])}const ege=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 tge(e,t,n,i){Jme(e,t,void 0,i);for(const r in t.attrs)e.setAttribute(ege.has(r)?r:nF(r),t.attrs[r])}const C_={};function C6e(e){Object.assign(C_,e)}function nge(e,{layout:t,layoutId:n}){return Hb.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!C_[e]||e==="opacity")}function fF(e,t,n){var i;const{style:r}=e,s={};for(const a in r)(mo(r[a])||t.style&&mo(t.style[a])||nge(a,e)||((i=n==null?void 0:n.getValue(a))===null||i===void 0?void 0:i.liveStyle)!==void 0)&&(s[a]=r[a]);return s}function ige(e,t,n){const i=fF(e,t,n);for(const r in e)if(mo(e[r])||mo(t[r])){const s=Sx.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[s]=e[r]}return i}function T6e(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 aq=["x","y","width","height","cx","cy","r"],A6e={useVisualState:Gme({scrapeMotionValuesFromProps:ige,createRenderState:Zme,onUpdate:({props:e,prevProps:t,current:n,renderState:i,latestValues:r})=>{if(!n)return;let s=!!e.drag;if(!s){for(const l in r)if(Hb.has(l)){s=!0;break}}if(!s)return;let a=!t;if(t)for(let l=0;l{T6e(n,i),Kr.render(()=>{cF(i,r,dF(n.tagName),e.transformTemplate),tge(n,i)})})}})},_6e={useVisualState:Gme({scrapeMotionValuesFromProps:fF,createRenderState:uF})};function rge(e,t,n){for(const i in t)!mo(t[i])&&!nge(i,n)&&(e[i]=t[i])}function N6e({transformTemplate:e},t){return m.useMemo(()=>{const n=uF();return lF(n,t,e),Object.assign({},n.vars,n.style)},[t])}function j6e(e,t){const n=e.style||{},i={};return rge(i,n,e),Object.assign(i,N6e(e,t)),i}function R6e(e,t){const n={},i=j6e(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.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=i,n}function I6e(e,t,n,i){const r=m.useMemo(()=>{const s=Zme();return cF(s,t,dF(i),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};rge(s,e.style,e),r.style={...s,...r.style}}return r}function P6e(e=!1){return(n,i,r,{latestValues:s},a)=>{const c=(rF(n)?I6e:R6e)(i,s,a,n),u=G4e(i,typeof n=="string",e),d=n!==m.Fragment?{...u,...c,ref:r}:{},{children:f}=i,h=m.useMemo(()=>mo(f)?f.get():f,[f]);return m.createElement(n,{...d,children:h})}}function D6e(e,t){return function(i,{forwardMotionProps:r}={forwardMotionProps:!1}){const a={...rF(i)?A6e:_6e,preloadedFeatures:e,useRender:P6e(r),createVisualElement:t,Component:i};return r6e(a)}}function sge(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i(W2===void 0&&Pd.set(qa.isProcessing||z4e.useManualTiming?qa.timestamp:performance.now()),W2),set:e=>{W2=e,queueMicrotask(M6e)}};function pF(e,t){e.indexOf(t)===-1&&e.push(t)}function mF(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class gF{constructor(){this.subscriptions=[]}add(t){return pF(this.subscriptions,t),()=>mF(this.subscriptions,t)}notify(t,n,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,n,i);else for(let s=0;s!isNaN(parseFloat(e));class $6e{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(i,r=!0)=>{const s=Pd.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&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=Pd.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=L6e(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 gF);const i=this.events[t].add(n);return t==="change"?()=>{i(),Kr.read(()=>{this.events.change.getSize()||this.stop()})}:i}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,i){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}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=Pd.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>oq)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,oq);return oge(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 fS(e,t){return new $6e(e,t)}function F6e(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,fS(n))}function B6e(e,t){const n=qj(e,t);let{transitionEnd:i={},transition:r={},...s}=n||{};s={...s,...i};for(const a in s){const l=u6e(s[a]);F6e(e,a,l)}}function U6e(e){return!!(mo(e)&&e.add)}function K3(e,t){const n=e.getValue("willChange");if(U6e(n))return n.add(t)}function lge(e){return e.props[Hme]}function bF(e){let t;return()=>(t===void 0&&(t=e()),t)}const Q6e=bF(()=>window.ScrollTimeline!==void 0);class z6e{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 i=0;i{if(Q6e()&&r.attachTimeline)return r.attachTimeline(t);if(typeof n=="function")return n(r)});return()=>{i.forEach((r,s)=>{r&&r(),this.animations[s].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 V6e extends z6e{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const th=e=>e*1e3,nh=e=>e/1e3;function yF(e){return typeof e=="function"}function lq(e,t){e.timeline=t,e.onfinish=null}const vF=e=>Array.isArray(e)&&typeof e[0]=="number",H6e={linearEasing:void 0};function q6e(e,t){const n=bF(e);return()=>{var i;return(i=H6e[t])!==null&&i!==void 0?i:n()}}const T_=q6e(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Dv=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i},cge=(e,t,n=10)=>{let i="";const r=Math.max(Math.round(t/n),2);for(let s=0;s`cubic-bezier(${e}, ${t}, ${n}, ${i})`,X3={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Tw([0,.65,.55,1]),circOut:Tw([.55,0,1,.45]),backIn:Tw([.31,.01,.66,-.59]),backOut:Tw([.33,1.53,.69,.99])};function dge(e,t){if(e)return typeof e=="function"&&T_()?cge(e,t):vF(e)?Tw(e):Array.isArray(e)?e.map(n=>dge(n,t)||X3.easeOut):X3[e]}const fge=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,W6e=1e-7,G6e=12;function K6e(e,t,n,i,r){let s,a,l=0;do a=t+(n-t)/2,s=fge(a,i,r)-e,s>0?n=a:t=a;while(Math.abs(s)>W6e&&++lK6e(s,0,1,e,n);return s=>s===0||s===1?s:fge(r(s),t,i)}const hge=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,pge=e=>t=>1-e(1-t),mge=$k(.33,1.53,.69,.99),xF=pge(mge),gge=hge(xF),bge=e=>(e*=2)<1?.5*xF(e):.5*(2-Math.pow(2,-10*(e-1))),wF=e=>1-Math.sin(Math.acos(e)),yge=pge(wF),vge=hge(wF),xge=e=>/^0[^.\s]+$/u.test(e);function X6e(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||xge(e):!0}const hO=e=>Math.round(e*1e5)/1e5,OF=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Y6e(e){return e==null}const Z6e=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,SF=(e,t)=>n=>!!(typeof n=="string"&&Z6e.test(n)&&n.startsWith(e)||t&&!Y6e(n)&&Object.prototype.hasOwnProperty.call(n,t)),wge=(e,t,n)=>i=>{if(typeof i!="string")return i;const[r,s,a,l]=i.match(OF);return{[e]:parseFloat(r),[t]:parseFloat(s),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},J6e=e=>vh(0,255,e),vD={...kx,transform:e=>Math.round(J6e(e))},Pg={test:SF("rgb","red"),parse:wge("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+vD.transform(e)+", "+vD.transform(t)+", "+vD.transform(n)+", "+hO(dS.transform(i))+")"};function e$e(e){let t="",n="",i="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,i+=i,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const Y3={test:SF("#"),parse:e$e,transform:Pg.transform},ky={test:SF("hsl","hue"),parse:wge("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+Id.transform(hO(t))+", "+Id.transform(hO(n))+", "+hO(dS.transform(i))+")"},fo={test:e=>Pg.test(e)||Y3.test(e)||ky.test(e),parse:e=>Pg.test(e)?Pg.parse(e):ky.test(e)?ky.parse(e):Y3.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Pg.transform(e):ky.transform(e)},t$e=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function n$e(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(OF))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(t$e))===null||n===void 0?void 0:n.length)||0)>0}const Oge="number",Sge="color",i$e="var",r$e="var(",cq="${}",s$e=/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 hS(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},r=[];let s=0;const l=t.replace(s$e,c=>(fo.test(c)?(i.color.push(s),r.push(Sge),n.push(fo.parse(c))):c.startsWith(r$e)?(i.var.push(s),r.push(i$e),n.push(c)):(i.number.push(s),r.push(Oge),n.push(parseFloat(c))),++s,cq)).split(cq);return{values:n,split:l,indexes:i,types:r}}function kge(e){return hS(e).values}function Ege(e){const{split:t,types:n}=hS(e),i=t.length;return r=>{let s="";for(let a=0;atypeof e=="number"?0:e;function o$e(e){const t=kge(e);return Ege(e)(t.map(a$e))}const hm={test:n$e,parse:kge,createTransformer:Ege,getAnimatableNone:o$e},l$e=new Set(["brightness","contrast","saturate","opacity"]);function c$e(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(OF)||[];if(!i)return e;const r=n.replace(i,"");let s=l$e.has(t)?1:0;return i!==n&&(s*=100),t+"("+s+r+")"}const u$e=/\b([a-z-]*)\(.*?\)/gu,Z3={...hm,getAnimatableNone:e=>{const t=e.match(u$e);return t?t.map(c$e).join(" "):e}},d$e={...oF,color:fo,backgroundColor:fo,outlineColor:fo,fill:fo,stroke:fo,borderColor:fo,borderTopColor:fo,borderRightColor:fo,borderBottomColor:fo,borderLeftColor:fo,filter:Z3,WebkitFilter:Z3},kF=e=>d$e[e];function Cge(e,t){let n=kF(e);return n!==Z3&&(n=hm),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const f$e=new Set(["auto","none","0"]);function h$e(e,t,n){let i=0,r;for(;ie===kx||e===Rn,dq=(e,t)=>parseFloat(e.split(", ")[t]),fq=(e,t)=>(n,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/u);if(r)return dq(r[1],t);{const s=i.match(/^matrix\((.+)\)$/u);return s?dq(s[1],e):0}},p$e=new Set(["x","y","z"]),m$e=Sx.filter(e=>!p$e.has(e));function g$e(e){const t=[];return m$e.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}const Mv={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:fq(4,13),y:fq(5,14)};Mv.translateX=Mv.x;Mv.translateY=Mv.y;const tb=new Set;let J3=!1,e4=!1;function Tge(){if(e4){const e=Array.from(tb).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),n=new Map;t.forEach(i=>{const r=g$e(i);r.length&&(n.set(i,r),i.render())}),e.forEach(i=>i.measureInitialState()),t.forEach(i=>{i.render();const r=n.get(i);r&&r.forEach(([s,a])=>{var l;(l=i.getValue(s))===null||l===void 0||l.set(a)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}e4=!1,J3=!1,tb.forEach(e=>e.complete()),tb.clear()}function Age(){tb.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(e4=!0)})}function b$e(){Age(),Tge()}class EF{constructor(t,n,i,r,s,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=i,this.motionValue=r,this.element=s,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(tb.add(this),J3||(J3=!0,Kr.read(Age),Kr.resolveKeyframes(Tge))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:i,motionValue:r}=this;for(let s=0;s/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),y$e=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function v$e(e){const t=y$e.exec(e);if(!t)return[,];const[,n,i,r]=t;return[`--${n??i}`,r]}function Nge(e,t,n=1){const[i,r]=v$e(e);if(!i)return;const s=window.getComputedStyle(t).getPropertyValue(i);if(s){const a=s.trim();return _ge(a)?parseFloat(a):a}return aF(r)?Nge(r,t,n+1):r}const jge=e=>t=>t.test(e),x$e={test:e=>e==="auto",parse:e=>e},Rge=[kx,Rn,Id,mp,g6e,m6e,x$e],hq=e=>Rge.find(jge(e));class Ige extends EF{constructor(t,n,i,r,s){super(t,n,i,r,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c{n.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const pq=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(hm.test(e)||e==="0")&&!e.startsWith("url("));function w$e(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function Wj(e,{repeat:t,repeatType:n="loop"},i){const r=e.filter(S$e),s=t&&n!=="loop"&&t%2===1?0:r.length-1;return!s||i===void 0?r[s]:i}const k$e=40;class Pge{constructor({autoplay:t=!0,delay:n=0,type:i="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:a="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Pd.now(),this.options={autoplay:t,delay:n,type:i,repeat:r,repeatDelay:s,repeatType:a,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>k$e?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&b$e(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Pd.now(),this.hasAttemptedResolve=!0;const{name:i,type:r,velocity:s,delay:a,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!O$e(t,i,r,s))if(a)this.options.duration=0;else{c&&c(Wj(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 t4=2e4;function Dge(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t=t4?1/0:t}const vs=(e,t,n)=>e+(t-e)*n;function xD(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 E$e({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let r=0,s=0,a=0;if(!t)r=s=a=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;r=xD(c,l,e+1/3),s=xD(c,l,e),a=xD(c,l,e-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:i}}function A_(e,t){return n=>n>0?t:e}const wD=(e,t,n)=>{const i=e*e,r=n*(t*t-i)+i;return r<0?0:Math.sqrt(r)},C$e=[Y3,Pg,ky],T$e=e=>C$e.find(t=>t.test(e));function mq(e){const t=T$e(e);if(!t)return!1;let n=t.parse(e);return t===ky&&(n=E$e(n)),n}const gq=(e,t)=>{const n=mq(e),i=mq(t);if(!n||!i)return A_(e,t);const r={...n};return s=>(r.red=wD(n.red,i.red,s),r.green=wD(n.green,i.green,s),r.blue=wD(n.blue,i.blue,s),r.alpha=vs(n.alpha,i.alpha,s),Pg.transform(r))},A$e=(e,t)=>n=>t(e(n)),Fk=(...e)=>e.reduce(A$e),n4=new Set(["none","hidden"]);function _$e(e,t){return n4.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function N$e(e,t){return n=>vs(e,t,n)}function CF(e){return typeof e=="number"?N$e:typeof e=="string"?aF(e)?A_:fo.test(e)?gq:I$e:Array.isArray(e)?Mge:typeof e=="object"?fo.test(e)?gq:j$e:A_}function Mge(e,t){const n=[...e],i=n.length,r=e.map((s,a)=>CF(s)(s,t[a]));return s=>{for(let a=0;a{for(const s in i)n[s]=i[s](r);return n}}function R$e(e,t){var n;const i=[],r={color:0,var:0,number:0};for(let s=0;s{const n=hm.createTransformer(t),i=hS(e),r=hS(t);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?n4.has(e)&&!r.values.length||n4.has(t)&&!i.values.length?_$e(e,t):Fk(Mge(R$e(i,r),r.values),n):A_(e,t)};function Lge(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?vs(e,t,n):CF(e)(e,t)}const P$e=5;function $ge(e,t,n){const i=Math.max(t-P$e,0);return oge(n-e(i),t-i)}const Ss={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},OD=.001;function D$e({duration:e=Ss.duration,bounce:t=Ss.bounce,velocity:n=Ss.velocity,mass:i=Ss.mass}){let r,s,a=1-t;a=vh(Ss.minDamping,Ss.maxDamping,a),e=vh(Ss.minDuration,Ss.maxDuration,nh(e)),a<1?(r=u=>{const d=u*a,f=d*e,h=d-n,p=i4(u,a),g=Math.exp(-f);return OD-h/p*g},s=u=>{const f=u*a*e,h=f*n+n,p=Math.pow(a,2)*Math.pow(u,2)*e,g=Math.exp(-f),b=i4(Math.pow(u,2),a);return(-r(u)+OD>0?-1:1)*((h-p)*g)/b}):(r=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-OD+d*f},s=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=L$e(r,s,l);if(e=th(e),isNaN(c))return{stiffness:Ss.stiffness,damping:Ss.damping,duration:e};{const u=Math.pow(c,2)*i;return{stiffness:u,damping:a*2*Math.sqrt(i*u),duration:e}}}const M$e=12;function L$e(e,t,n){let i=n;for(let r=1;re[n]!==void 0)}function B$e(e){let t={velocity:Ss.velocity,stiffness:Ss.stiffness,damping:Ss.damping,mass:Ss.mass,isResolvedFromDuration:!1,...e};if(!bq(e,F$e)&&bq(e,$$e))if(e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(n*1.2),r=i*i,s=2*vh(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:Ss.mass,stiffness:r,damping:s}}else{const n=D$e(e);t={...t,...n,mass:Ss.mass},t.isResolvedFromDuration=!0}return t}function Fge(e=Ss.visualDuration,t=Ss.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:i,restDelta:r}=n;const s=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:s},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:p}=B$e({...n,velocity:-nh(n.velocity||0)}),g=h||0,b=u/(2*Math.sqrt(c*d)),v=a-s,y=nh(Math.sqrt(c/d)),x=Math.abs(v)<5;i||(i=x?Ss.restSpeed.granular:Ss.restSpeed.default),r||(r=x?Ss.restDelta.granular:Ss.restDelta.default);let O;if(b<1){const k=i4(y,b);O=S=>{const E=Math.exp(-b*y*S);return a-E*((g+b*y*v)/k*Math.sin(k*S)+v*Math.cos(k*S))}}else if(b===1)O=k=>a-Math.exp(-y*k)*(v+(g+y*v)*k);else{const k=y*Math.sqrt(b*b-1);O=S=>{const E=Math.exp(-b*y*S),C=Math.min(k*S,300);return a-E*((g+b*y*v)*Math.sinh(C)+k*v*Math.cosh(C))/k}}const w={calculatedDuration:p&&f||null,next:k=>{const S=O(k);if(p)l.done=k>=f;else{let E=0;b<1&&(E=k===0?th(g):$ge(O,k,S));const C=Math.abs(E)<=i,N=Math.abs(a-S)<=r;l.done=C&&N}return l.value=l.done?a:S,l},toString:()=>{const k=Math.min(Dge(w),t4),S=cge(E=>w.next(k*E).value,k,30);return k+"ms "+S}};return w}function yq({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:a,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},p=C=>l!==void 0&&Cc,g=C=>l===void 0?c:c===void 0||Math.abs(l-C)-b*Math.exp(-C/i),O=C=>y+x(C),w=C=>{const N=x(C),_=O(C);h.done=Math.abs(N)<=u,h.value=h.done?y:_};let k,S;const E=C=>{p(h.value)&&(k=C,S=Fge({keyframes:[h.value,g(h.value)],velocity:$ge(O,C,h.value),damping:r,stiffness:s,restDelta:u,restSpeed:d}))};return E(0),{calculatedDuration:null,next:C=>{let N=!1;return!S&&k===void 0&&(N=!0,w(C),E(C)),k!==void 0&&C>=k?S.next(C-k):(!N&&w(C),h)}}}const U$e=$k(.42,0,1,1),Q$e=$k(0,0,.58,1),Bge=$k(.42,0,.58,1),z$e=e=>Array.isArray(e)&&typeof e[0]!="number",V$e={linear:ac,easeIn:U$e,easeInOut:Bge,easeOut:Q$e,circIn:wF,circInOut:vge,circOut:yge,backIn:xF,backInOut:gge,backOut:mge,anticipate:bge},vq=e=>{if(vF(e)){Fme(e.length===4);const[t,n,i,r]=e;return $k(t,n,i,r)}else if(typeof e=="string")return V$e[e];return e};function H$e(e,t,n){const i=[],r=n||Lge,s=e.length-1;for(let a=0;at[0];if(s===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=H$e(t,i,r),c=l.length,u=d=>{if(a&&d1)for(;fu(vh(e[0],e[s-1],d)):u}function W$e(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const r=Dv(0,t,i);e.push(vs(n,1,r))}}function G$e(e){const t=[0];return W$e(t,e.length-1),t}function K$e(e,t){return e.map(n=>n*t)}function X$e(e,t){return e.map(()=>t||Bge).splice(0,e.length-1)}function __({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const r=z$e(i)?i.map(vq):vq(i),s={done:!1,value:t[0]},a=K$e(n&&n.length===t.length?n:G$e(t),e),l=q$e(a,t,{ease:Array.isArray(r)?r:X$e(t,r)});return{calculatedDuration:e,next:c=>(s.value=l(c),s.done=c>=e,s)}}const Y$e=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Kr.update(t,!0),stop:()=>fm(t),now:()=>qa.isProcessing?qa.timestamp:Pd.now()}},Z$e={decay:yq,inertia:yq,tween:__,keyframes:__,spring:Fge},J$e=e=>e/100;class TF extends Pge{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:i,element:r,keyframes:s}=this.options,a=(r==null?void 0:r.KeyframeResolver)||EF,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new a(s,l,n,i,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:s,velocity:a=0}=this.options,l=yF(n)?n:Z$e[n]||__;let c,u;l!==__&&typeof t[0]!="number"&&(c=Fk(J$e,Lge(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});s==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=Dge(d));const{calculatedDuration:f}=d,h=f+r,p=h*(i+1)-r;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:i}=this;if(!i){const{keyframes:C}=this.options;return{done:!0,value:C[C.length-1]}}const{finalKeyframe:r,generator:s,mirroredGenerator:a,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:u,totalDuration:d,resolvedDuration:f}=i;if(this.startTime===null)return s.next(0);const{delay:h,repeat:p,repeatType:g,repeatDelay:b,onUpdate:v}=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),x=this.speed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let O=this.currentTime,w=s;if(p){const C=Math.min(this.currentTime,d)/f;let N=Math.floor(C),_=C%1;!_&&C>=1&&(_=1),_===1&&N--,N=Math.min(N,p+1),!!(N%2)&&(g==="reverse"?(_=1-_,b&&(_-=b/f)):g==="mirror"&&(w=a)),O=vh(0,1,_)*f}const k=x?{done:!1,value:c[0]}:w.next(O);l&&(k.value=l(k.value));let{done:S}=k;!x&&u!==null&&(S=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return E&&r!==void 0&&(k.value=Wj(c,this.options,r)),v&&v(k.value),E&&this.finish(),k}get duration(){const{resolved:t}=this;return t?nh(t.calculatedDuration):0}get time(){return nh(this.currentTime)}set time(t){t=th(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=nh(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=Y$e,onPlay:n,startTime:i}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=i??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 e8e=new Set(["opacity","clipPath","filter","transform"]);function t8e(e,t,n,{delay:i=0,duration:r=300,repeat:s=0,repeatType:a="loop",ease:l="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=dge(l,r);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:i,duration:r,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:a==="reverse"?"alternate":"normal"})}const n8e=bF(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),N_=10,i8e=2e4;function r8e(e){return yF(e.type)||e.type==="spring"||!uge(e.ease)}function s8e(e,t){const n=new TF({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:e[0]};const r=[];let s=0;for(;!i.done&&sthis.onKeyframesResolved(a,l),n,i,r),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:i=300,times:r,ease:s,type:a,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof s=="string"&&T_()&&a8e(s)&&(s=Uge[s]),r8e(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:g,...b}=this.options,v=s8e(t,b);t=v.keyframes,t.length===1&&(t[1]=t[0]),i=v.duration,r=v.times,s=v.ease,a="keyframes"}const d=t8e(l.owner.current,c,t,{...this.options,duration:i,times:r,ease:s});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(lq(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(Wj(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:i,times:r,type:a,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return nh(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return nh(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:i}=n;i.currentTime=th(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:i}=n;i.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 ac;const{animation:i}=n;lq(i,t)}return ac}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:i,duration:r,type:s,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,g=new TF({...p,keyframes:i,duration:r,type:s,ease:a,times:l,isGenerator:!0}),b=th(this.time);u.setWithVelocity(g.sample(b-N_).value,g.sample(b).value,N_)}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:i,repeatDelay:r,repeatType:s,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 n8e()&&i&&e8e.has(i)&&!c&&!u&&!r&&s!=="mirror"&&a!==0&&l!=="inertia"}}const o8e={type:"spring",stiffness:500,damping:25,restSpeed:10},l8e=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),c8e={type:"keyframes",duration:.8},u8e={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},d8e=(e,{keyframes:t})=>t.length>2?c8e:Hb.has(e)?e.startsWith("scale")?l8e(t[1]):o8e:u8e;function f8e({when:e,delay:t,delayChildren:n,staggerChildren:i,staggerDirection:r,repeat:s,repeatType:a,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const AF=(e,t,n,i={},r,s)=>a=>{const l=hF(i,e)||{},c=l.delay||i.delay||0;let{elapsed:u=0}=i;u=u-th(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:s?void 0:r};f8e(l)||(d={...d,...d8e(e,d)}),d.duration&&(d.duration=th(d.duration)),d.repeatDelay&&(d.repeatDelay=th(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&&!s&&t.get()!==void 0){const h=Wj(d.keyframes,l);if(h!==void 0)return Kr.update(()=>{d.onUpdate(h),d.onComplete()}),new V6e([])}return!s&&xq.supports(d)?new xq(d):new TF(d)};function h8e({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function Qge(e,t,{delay:n=0,transitionOverride:i,type:r}={}){var s;let{transition:a=e.getDefaultTransition(),transitionEnd:l,...c}=t;i&&(a=i);const u=[],d=r&&e.animationState&&e.animationState.getState()[r];for(const f in c){const h=e.getValue(f,(s=e.latestValues[f])!==null&&s!==void 0?s:null),p=c[f];if(p===void 0||d&&h8e(d,f))continue;const g={delay:n,...hF(a||{},f)};let b=!1;if(window.MotionHandoffAnimation){const y=lge(e);if(y){const x=window.MotionHandoffAnimation(y,f,Kr);x!==null&&(g.startTime=x,b=!0)}}K3(e,f),h.start(AF(f,h,p,e.shouldReduceMotion&&age.has(f)?{type:!1}:g,e,b));const v=h.animation;v&&u.push(v)}return l&&Promise.all(u).then(()=>{Kr.update(()=>{l&&B6e(e,l)})}),u}function r4(e,t,n={}){var i;const r=qj(e,t,n.type==="exit"?(i=e.presenceContext)===null||i===void 0?void 0:i.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const a=r?()=>Promise.all(Qge(e,r,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=s;return p8e(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:c}=s;if(c){const[u,d]=c==="beforeChildren"?[a,l]:[l,a];return u().then(()=>d())}else return Promise.all([a(),l(n.delay)])}function p8e(e,t,n=0,i=0,r=1,s){const a=[],l=(e.variantChildren.size-1)*i,c=r===1?(u=0)=>u*i:(u=0)=>l-u*i;return Array.from(e.variantChildren).sort(m8e).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(r4(u,t,{...s,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function m8e(e,t){return e.sortNodePosition(t)}function g8e(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const r=t.map(s=>r4(e,s,n));i=Promise.all(r)}else if(typeof t=="string")i=r4(e,t,n);else{const r=typeof t=="function"?qj(e,t,n.custom):t;i=Promise.all(Qge(e,r,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const b8e=tF.length;function zge(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?zge(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:i})=>g8e(e,n,i)))}function w8e(e){let t=x8e(e),n=wq(),i=!0;const r=c=>(u,d)=>{var f;const h=qj(e,d,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:p,transitionEnd:g,...b}=h;u={...u,...b,...g}}return u};function s(c){t=c(e)}function a(c){const{props:u}=e,d=zge(e.parent)||{},f=[],h=new Set;let p={},g=1/0;for(let v=0;vg&&w,N=!1;const _=Array.isArray(O)?O:[O];let j=_.reduce(r(y),{});k===!1&&(j={});const{prevResolvedValues:A={}}=x,F={...A,...j},T=L=>{C=!0,h.has(L)&&(N=!0,h.delete(L)),x.needsAnimating[L]=!0;const M=e.getValue(L);M&&(M.liveStyle=!1)};for(const L in F){const M=j[L],U=A[L];if(p.hasOwnProperty(L))continue;let I=!1;G3(M)&&G3(U)?I=!sge(M,U):I=M!==U,I?M!=null?T(L):h.add(L):M!==void 0&&h.has(L)?T(L):x.protectedKeys[L]=!0}x.prevProp=O,x.prevResolvedValues=j,x.isActive&&(p={...p,...j}),i&&e.blockInitialAnimation&&(C=!1),C&&(!(S&&E)||N)&&f.push(..._.map(L=>({animation:L,options:{type:y}})))}if(h.size){const v={};h.forEach(y=>{const x=e.getBaseTarget(y),O=e.getValue(y);O&&(O.liveStyle=!0),v[y]=x??null}),f.push({animation:v})}let b=!!f.length;return i&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(b=!1),i=!1,b?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:s,getState:()=>n,reset:()=>{n=wq(),i=!0}}}function O8e(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!sge(t,e):!1}function eg(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function wq(){return{animate:eg(!0),whileInView:eg(),whileHover:eg(),whileTap:eg(),whileDrag:eg(),whileFocus:eg(),exit:eg()}}class Mm{constructor(t){this.isMounted=!1,this.node=t}update(){}}class S8e extends Mm{constructor(t){super(t),t.animationState||(t.animationState=w8e(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Vj(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 k8e=0;class E8e extends Mm{constructor(){super(...arguments),this.id=k8e++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const r=this.node.animationState.setActive("exit",!t);n&&!t&&r.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const C8e={animation:{Feature:S8e},exit:{Feature:E8e}},vu={x:!1,y:!1};function Vge(){return vu.x||vu.y}function T8e(e){return e==="x"||e==="y"?vu[e]?null:(vu[e]=!0,()=>{vu[e]=!1}):vu.x||vu.y?null:(vu.x=vu.y=!0,()=>{vu.x=vu.y=!1})}const _F=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function pS(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}function Bk(e){return{point:{x:e.pageX,y:e.pageY}}}const A8e=e=>t=>_F(t)&&e(t,Bk(t));function pO(e,t,n,i){return pS(e,t,A8e(n),i)}const Oq=(e,t)=>Math.abs(e-t);function _8e(e,t){const n=Oq(e.x,t.x),i=Oq(e.y,t.y);return Math.sqrt(n**2+i**2)}class Hge{constructor(t,n,{transformPagePoint:i,contextWindow:r,dragSnapToOrigin:s=!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=kD(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=_8e(f.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:g}=f,{timestamp:b}=qa;this.history.push({...g,timestamp:b});const{onStart:v,onMove:y}=this.handlers;h||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=SD(h,this.transformPagePoint),Kr.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:p,onSessionEnd:g,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=kD(f.type==="pointercancel"?this.lastMoveEventInfo:SD(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,v),g&&g(f,v)},!_F(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=i,this.contextWindow=r||window;const a=Bk(t),l=SD(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=qa;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,kD(l,this.history)),this.removeListeners=Fk(pO(this.contextWindow,"pointermove",this.handlePointerMove),pO(this.contextWindow,"pointerup",this.handlePointerUp),pO(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),fm(this.updatePoint)}}function SD(e,t){return t?{point:t(e.point)}:e}function Sq(e,t){return{x:e.x-t.x,y:e.y-t.y}}function kD({point:e},t){return{point:e,delta:Sq(e,qge(t)),offset:Sq(e,N8e(t)),velocity:j8e(t,.1)}}function N8e(e){return e[0]}function qge(e){return e[e.length-1]}function j8e(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const r=qge(e);for(;n>=0&&(i=e[n],!(r.timestamp-i.timestamp>th(t)));)n--;if(!i)return{x:0,y:0};const s=nh(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const a={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}const Wge=1e-4,R8e=1-Wge,I8e=1+Wge,Gge=.01,P8e=0-Gge,D8e=0+Gge;function fc(e){return e.max-e.min}function M8e(e,t,n){return Math.abs(e-t)<=n}function kq(e,t,n,i=.5){e.origin=i,e.originPoint=vs(t.min,t.max,e.origin),e.scale=fc(n)/fc(t),e.translate=vs(n.min,n.max,e.origin)-e.originPoint,(e.scale>=R8e&&e.scale<=I8e||isNaN(e.scale))&&(e.scale=1),(e.translate>=P8e&&e.translate<=D8e||isNaN(e.translate))&&(e.translate=0)}function mO(e,t,n,i){kq(e.x,t.x,n.x,i?i.originX:void 0),kq(e.y,t.y,n.y,i?i.originY:void 0)}function Eq(e,t,n){e.min=n.min+t.min,e.max=e.min+fc(t)}function L8e(e,t,n){Eq(e.x,t.x,n.x),Eq(e.y,t.y,n.y)}function Cq(e,t,n){e.min=t.min-n.min,e.max=e.min+fc(t)}function gO(e,t,n){Cq(e.x,t.x,n.x),Cq(e.y,t.y,n.y)}function $8e(e,{min:t,max:n},i){return t!==void 0&&en&&(e=i?vs(n,e,i.max):Math.min(e,n)),e}function Tq(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 F8e(e,{top:t,left:n,bottom:i,right:r}){return{x:Tq(e.x,n,r),y:Tq(e.y,t,i)}}function Aq(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.mini?n=Dv(t.min,t.max-i,e.min):i>r&&(n=Dv(e.min,e.max-r,t.min)),vh(0,1,n)}function Q8e(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 s4=.35;function z8e(e=s4){return e===!1?e=0:e===!0&&(e=s4),{x:_q(e,"left","right"),y:_q(e,"top","bottom")}}function _q(e,t,n){return{min:Nq(e,t),max:Nq(e,n)}}function Nq(e,t){return typeof e=="number"?e:e[t]||0}const jq=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ey=()=>({x:jq(),y:jq()}),Rq=()=>({min:0,max:0}),Rs=()=>({x:Rq(),y:Rq()});function Rc(e){return[e("x"),e("y")]}function Kge({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function V8e({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function H8e(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function ED(e){return e===void 0||e===1}function a4({scale:e,scaleX:t,scaleY:n}){return!ED(e)||!ED(t)||!ED(n)}function bg(e){return a4(e)||Xge(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Xge(e){return Iq(e.x)||Iq(e.y)}function Iq(e){return e&&e!=="0%"}function j_(e,t,n){const i=e-n,r=t*i;return n+r}function Pq(e,t,n,i,r){return r!==void 0&&(e=j_(e,r,i)),j_(e,n,i)+t}function o4(e,t=0,n=1,i,r){e.min=Pq(e.min,t,n,i,r),e.max=Pq(e.max,t,n,i,r)}function Yge(e,{x:t,y:n}){o4(e.x,t.translate,t.scale,t.originPoint),o4(e.y,n.translate,n.scale,n.originPoint)}const Dq=.999999999999,Mq=1.0000000000001;function q8e(e,t,n,i=!1){const r=n.length;if(!r)return;t.x=t.y=1;let s,a;for(let l=0;lDq&&(t.x=1),t.yDq&&(t.y=1)}function Cy(e,t){e.min=e.min+t,e.max=e.max+t}function Lq(e,t,n,i,r=.5){const s=vs(e.min,e.max,r);o4(e,t,n,s,i)}function Ty(e,t){Lq(e.x,t.x,t.scaleX,t.scale,t.originX),Lq(e.y,t.y,t.scaleY,t.scale,t.originY)}function Zge(e,t){return Kge(H8e(e.getBoundingClientRect(),t))}function W8e(e,t,n){const i=Zge(e,n),{scroll:r}=t;return r&&(Cy(i.x,r.offset.x),Cy(i.y,r.offset.y)),i}const Jge=({current:e})=>e?e.ownerDocument.defaultView:null,G8e=new WeakMap;class K8e{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=Rs(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Bk(d).point)},s=(d,f)=>{const{drag:h,dragPropagation:p,onDragStart:g}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=T8e(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),Rc(v=>{let y=this.getAxisMotionValue(v).get()||0;if(Id.test(y)){const{projection:x}=this.visualElement;if(x&&x.layout){const O=x.layout.layoutBox[v];O&&(y=fc(O)*(parseFloat(y)/100))}}this.originPoint[v]=y}),g&&Kr.postRender(()=>g(d,f)),K3(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},a=(d,f)=>{const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:g,onDrag:b}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=f;if(p&&this.currentDirection===null){this.currentDirection=X8e(v),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),b&&b(d,f)},l=(d,f)=>this.stop(d,f),c=()=>Rc(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 Hge(t,{onSessionStart:r,onStart:s,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:Jge(this.visualElement)})}stop(t,n){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:r}=n;this.startAnimation(r);const{onDragEnd:s}=this.getProps();s&&Kr.postRender(()=>s(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:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,i){const{drag:r}=this.getProps();if(!i||!GC(t,r,this.currentDirection))return;const s=this.getAxisMotionValue(t);let a=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(a=$8e(a,this.constraints[t],this.elastic[t])),s.set(a)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:i}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;n&&Sy(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&r?this.constraints=F8e(r.layoutBox,n):this.constraints=!1,this.elastic=z8e(i),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Rc(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=Q8e(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Sy(t))return!1;const i=t.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=W8e(i,r.root,this.visualElement.getTransformPagePoint());let a=B8e(r.layout.layoutBox,s);if(n){const l=n(V8e(a));this.hasMutatedConstraints=!!l,l&&(a=Kge(l))}return a}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Rc(d=>{if(!GC(d,n,this.currentDirection))return;let f=c&&c[d]||{};a&&(f={min:0,max:0});const h=r?200:1e6,p=r?40:1e7,g={type:"inertia",velocity:i?t[d]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(d,g)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return K3(this.visualElement,t),i.start(AF(t,i,0,n,this.visualElement,!1))}stopAnimation(){Rc(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Rc(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()}`,i=this.visualElement.getProps(),r=i[n];return r||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){Rc(n=>{const{drag:i}=this.getProps();if(!GC(n,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(n);if(r&&r.layout){const{min:a,max:l}=r.layout.layoutBox[n];s.set(t[n]-vs(a,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Sy(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Rc(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const c=l.get();r[a]=U8e({min:c,max:c},this.constraints[a])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),Rc(a=>{if(!GC(a,t,null))return;const l=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];l.set(vs(c,u,r[a]))})}addListeners(){if(!this.visualElement.current)return;G8e.set(this.visualElement,this);const t=this.visualElement.current,n=pO(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),i=()=>{const{dragConstraints:c}=this.getProps();Sy(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,s=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),Kr.read(i);const a=pS(window,"resize",()=>this.scalePositionWithinConstraints()),l=r.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Rc(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(),s(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:a=s4,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:a,dragMomentum:l}}}function GC(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function X8e(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Y8e extends Mm{constructor(t){super(t),this.removeGroupControls=ac,this.removeListeners=ac,this.controls=new K8e(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ac}unmount(){this.removeGroupControls(),this.removeListeners()}}const $q=e=>(t,n)=>{e&&Kr.postRender(()=>e(t,n))};class Z8e extends Mm{constructor(){super(...arguments),this.removePointerDownListener=ac}onPointerDown(t){this.session=new Hge(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Jge(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:$q(t),onStart:$q(n),onMove:i,onEnd:(s,a)=>{delete this.session,r&&Kr.postRender(()=>r(s,a))}}}mount(){this.removePointerDownListener=pO(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 G2={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Fq(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const D1={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Rn.test(e))e=parseFloat(e);else return e;const n=Fq(e,t.target.x),i=Fq(e,t.target.y);return`${n}% ${i}%`}},J8e={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,r=hm.parse(e);if(r.length>5)return i;const s=hm.createTransformer(e),a=typeof r[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;r[0+a]/=l,r[1+a]/=c;const u=vs(l,c,.5);return typeof r[2+a]=="number"&&(r[2+a]/=u),typeof r[3+a]=="number"&&(r[3+a]/=u),s(r)}};class e9e extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=t;C6e(t9e),s&&(n.group&&n.group.add(s),i&&i.register&&r&&i.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),G2.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:r,isPresent:s}=this.props,a=i.projection;return a&&(a.isPresent=s,r||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?a.promote():a.relegate()||Kr.postRender(()=>{const l=a.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),iF.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:r}=t;r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function ebe(e){const[t,n]=Lme(),i=m.useContext(Z9);return o.jsx(e9e,{...e,layoutGroup:i,switchLayoutGroup:m.useContext(qme),isPresent:t,safeToRemove:n})}const t9e={borderRadius:{...D1,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:D1,borderTopRightRadius:D1,borderBottomLeftRadius:D1,borderBottomRightRadius:D1,boxShadow:J8e};function n9e(e,t,n){const i=mo(e)?e:fS(e);return i.start(AF("",i,t,n)),i.animation}function i9e(e){return e instanceof SVGElement&&e.tagName!=="svg"}const r9e=(e,t)=>e.depth-t.depth;class s9e{constructor(){this.children=[],this.isDirty=!1}add(t){pF(this.children,t),this.isDirty=!0}remove(t){mF(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(r9e),this.isDirty=!1,this.children.forEach(t)}}function a9e(e,t){const n=Pd.now(),i=({timestamp:r})=>{const s=r-n;s>=t&&(fm(i),e(s-t))};return Kr.read(i,!0),()=>fm(i)}const tbe=["TopLeft","TopRight","BottomLeft","BottomRight"],o9e=tbe.length,Bq=e=>typeof e=="string"?parseFloat(e):e,Uq=e=>typeof e=="number"||Rn.test(e);function l9e(e,t,n,i,r,s){r?(e.opacity=vs(0,n.opacity!==void 0?n.opacity:1,c9e(i)),e.opacityExit=vs(t.opacity!==void 0?t.opacity:1,0,u9e(i))):s&&(e.opacity=vs(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,i));for(let a=0;ait?1:n(Dv(e,t,i))}function zq(e,t){e.min=t.min,e.max=t.max}function jc(e,t){zq(e.x,t.x),zq(e.y,t.y)}function Vq(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Hq(e,t,n,i,r){return e-=t,e=j_(e,1/n,i),r!==void 0&&(e=j_(e,1/r,i)),e}function d9e(e,t=0,n=1,i=.5,r,s=e,a=e){if(Id.test(t)&&(t=parseFloat(t),t=vs(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=vs(s.min,s.max,i);e===s&&(l-=t),e.min=Hq(e.min,t,n,l,r),e.max=Hq(e.max,t,n,l,r)}function qq(e,t,[n,i,r],s,a){d9e(e,t[n],t[i],t[r],t.scale,s,a)}const f9e=["x","scaleX","originX"],h9e=["y","scaleY","originY"];function Wq(e,t,n,i){qq(e.x,t,f9e,n?n.x:void 0,i?i.x:void 0),qq(e.y,t,h9e,n?n.y:void 0,i?i.y:void 0)}function Gq(e){return e.translate===0&&e.scale===1}function ibe(e){return Gq(e.x)&&Gq(e.y)}function Kq(e,t){return e.min===t.min&&e.max===t.max}function p9e(e,t){return Kq(e.x,t.x)&&Kq(e.y,t.y)}function Xq(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function rbe(e,t){return Xq(e.x,t.x)&&Xq(e.y,t.y)}function Yq(e){return fc(e.x)/fc(e.y)}function Zq(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class m9e{constructor(){this.members=[]}add(t){pF(this.members,t),t.scheduleRender()}remove(t){if(mF(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(r=>t===r);if(n===0)return!1;let i;for(let r=n;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1){i=s;break}}return i?(this.promote(i),!0):!1}promote(t,n){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:r}=t.options;r===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:i}=t;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function g9e(e,t,n){let i="";const r=e.x.translate/t.x,s=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((r||s||a)&&(i=`translate3d(${r}px, ${s}px, ${a}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:p,skewY:g}=n;u&&(i=`perspective(${u}px) ${i}`),d&&(i+=`rotate(${d}deg) `),f&&(i+=`rotateX(${f}deg) `),h&&(i+=`rotateY(${h}deg) `),p&&(i+=`skewX(${p}deg) `),g&&(i+=`skewY(${g}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(i+=`scale(${l}, ${c})`),i||"none"}const yg={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Aw=typeof window<"u"&&window.MotionDebug!==void 0,CD=["","X","Y","Z"],b9e={visibility:"hidden"},Jq=1e3;let y9e=0;function TD(e,t,n,i){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),i&&(i[e]=0))}function sbe(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=lge(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Kr,!(r||s))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&sbe(i)}function abe({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(a={},l=t==null?void 0:t()){this.id=y9e++,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,Aw&&(yg.totalNodes=yg.resolvedTargetDeltas=yg.recalculatedProjection=0),this.nodes.forEach(w9e),this.nodes.forEach(C9e),this.nodes.forEach(T9e),this.nodes.forEach(O9e),Aw&&window.MotionDebug.record(yg)},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=a9e(h,250),G2.hasAnimatedSinceResize&&(G2.hasAnimatedSinceResize=!1,this.nodes.forEach(tW))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeTargetChanged:p,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||d.getDefaultTransition()||R9e,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=d.getProps(),x=!this.targetLayout||!rbe(this.targetLayout,g)||p,O=!h&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||O||h&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,O);const w={...hF(b,"layout"),onPlay:v,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w)}else h||tW(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}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,fm(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(A9e),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&&sbe(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=w/1e3;nW(f.x,a.x,k),nW(f.y,a.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(gO(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),N9e(this.relativeTarget,this.relativeTargetOrigin,h,k),O&&p9e(this.relativeTarget,O)&&(this.isProjectionDirty=!1),O||(O=Rs()),jc(O,this.relativeTarget)),b&&(this.animationValues=d,l9e(d,u,this.latestValues,k,x,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&&(fm(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Kr.update(()=>{G2.hasAnimatedSinceResize=!0,this.currentAnimation=n9e(0,Jq,{...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(Jq),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&&obe(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Rs();const f=fc(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+f;const h=fc(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+h}jc(l,c),Ty(l,d),mO(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new m9e),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&&TD("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(eW),this.root.sharedNodes.clear()}}}function v9e(e){e.updateLayout()}function x9e(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:i,measuredBox:r}=e.layout,{animationType:s}=e.options,a=n.source!==e.layout.source;s==="size"?Rc(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=fc(h);h.min=i[f].min,h.max=h.min+p}):obe(s,n.layoutBox,i)&&Rc(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=fc(i[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const l=Ey();mO(l,i,n.layoutBox);const c=Ey();a?mO(c,e.applyTransform(r,!0),n.measuredBox):mO(c,i,n.layoutBox);const u=!ibe(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 g=Rs();gO(g,n.layoutBox,h.layoutBox);const b=Rs();gO(b,i,p.layoutBox),rbe(g,b)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function w9e(e){Aw&&yg.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 O9e(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function S9e(e){e.clearSnapshot()}function eW(e){e.clearMeasurements()}function k9e(e){e.isLayoutDirty=!1}function E9e(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function tW(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function C9e(e){e.resolveTargetDelta()}function T9e(e){e.calcProjection()}function A9e(e){e.resetSkewAndRotation()}function _9e(e){e.removeLeadSnapshot()}function nW(e,t,n){e.translate=vs(t.translate,0,n),e.scale=vs(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function iW(e,t,n,i){e.min=vs(t.min,n.min,i),e.max=vs(t.max,n.max,i)}function N9e(e,t,n,i){iW(e.x,t.x,n.x,i),iW(e.y,t.y,n.y,i)}function j9e(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const R9e={duration:.45,ease:[.4,0,.1,1]},rW=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),sW=rW("applewebkit/")&&!rW("chrome/")?Math.round:ac;function aW(e){e.min=sW(e.min),e.max=sW(e.max)}function I9e(e){aW(e.x),aW(e.y)}function obe(e,t,n){return e==="position"||e==="preserve-aspect"&&!M8e(Yq(t),Yq(n),.2)}function P9e(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const D9e=abe({attachResizeListener:(e,t)=>pS(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),AD={current:void 0},lbe=abe({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!AD.current){const e=new D9e({});e.mount(window),e.setOptions({layoutScroll:!0}),AD.current=e}return AD.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),M9e={pan:{Feature:Z8e},drag:{Feature:Y8e,ProjectionNode:lbe,MeasureLayout:ebe}};function L9e(e,t,n){var i;if(e instanceof Element)return[e];if(typeof e=="string"){let r=document;const s=(i=void 0)!==null&&i!==void 0?i:r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function cbe(e,t){const n=L9e(e),i=new AbortController,r={passive:!0,...t,signal:i.signal};return[n,r,()=>i.abort()]}function oW(e){return t=>{t.pointerType==="touch"||Vge()||e(t)}}function $9e(e,t,n={}){const[i,r,s]=cbe(e,n),a=oW(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const d=oW(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,r)});return i.forEach(l=>{l.addEventListener("pointerenter",a,r)}),s}function lW(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,s=i[r];s&&Kr.postRender(()=>s(t,Bk(t)))}class F9e extends Mm{mount(){const{current:t}=this.node;t&&(this.unmount=$9e(t,n=>(lW(this.node,n,"Start"),i=>lW(this.node,i,"End"))))}unmount(){}}class B9e extends Mm{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=Fk(pS(this.node.current,"focus",()=>this.onFocus()),pS(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const ube=(e,t)=>t?e===t?!0:ube(e,t.parentElement):!1,U9e=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Q9e(e){return U9e.has(e.tagName)||e.tabIndex!==-1}const _w=new WeakSet;function cW(e){return t=>{t.key==="Enter"&&e(t)}}function _D(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const z9e=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=cW(()=>{if(_w.has(n))return;_D(n,"down");const r=cW(()=>{_D(n,"up")}),s=()=>_D(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",i,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),t)};function uW(e){return _F(e)&&!Vge()}function V9e(e,t,n={}){const[i,r,s]=cbe(e,n),a=l=>{const c=l.currentTarget;if(!uW(l)||_w.has(c))return;_w.add(c);const u=t(l),d=(p,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!uW(p)||!_w.has(c))&&(_w.delete(c),typeof u=="function"&&u(p,{success:g}))},f=p=>{d(p,n.useGlobalTarget||ube(c,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",h,r)};return i.forEach(l=>{!Q9e(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",a,r),l.addEventListener("focus",u=>z9e(u,r),r)}),s}function dW(e,t,n){const{props:i}=e;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),s=i[r];s&&Kr.postRender(()=>s(t,Bk(t)))}class H9e extends Mm{mount(){const{current:t}=this.node;t&&(this.unmount=V9e(t,n=>(dW(this.node,n,"Start"),(i,{success:r})=>dW(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const l4=new WeakMap,ND=new WeakMap,q9e=e=>{const t=l4.get(e.target);t&&t(e)},W9e=e=>{e.forEach(q9e)};function G9e({root:e,...t}){const n=e||document;ND.has(n)||ND.set(n,{});const i=ND.get(n),r=JSON.stringify(t);return i[r]||(i[r]=new IntersectionObserver(W9e,{root:e,...t})),i[r]}function K9e(e,t,n){const i=G9e(t);return l4.set(e,n),i.observe(e),()=>{l4.delete(e),i.unobserve(e)}}const X9e={some:0,all:1};class Y9e extends Mm{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:r="some",once:s}=t,a={root:n?n.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:X9e[r]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,s&&!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 K9e(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(Z9e(t,n))&&this.startObserver()}unmount(){}}function Z9e({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const J9e={inView:{Feature:Y9e},tap:{Feature:H9e},focus:{Feature:B9e},hover:{Feature:F9e}},eFe={layout:{ProjectionNode:lbe,MeasureLayout:ebe}},R_={current:null},NF={current:!1};function dbe(){if(NF.current=!0,!!J9)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>R_.current=e.matches;e.addListener(t),t()}else R_.current=!1}const tFe=[...Rge,fo,hm],nFe=e=>tFe.find(jge(e)),fW=new WeakMap;function iFe(e,t,n){for(const i in t){const r=t[i],s=n[i];if(mo(r))e.addValue(i,r);else if(mo(s))e.addValue(i,fS(r,{owner:e}));else if(s!==r)if(e.hasValue(i)){const a=e.getValue(i);a.liveStyle===!0?a.jump(r):a.hasAnimated||a.set(r)}else{const a=e.getStaticValue(i);e.addValue(i,fS(a!==void 0?a:r,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const hW=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class rFe{scrapeMotionValuesFromProps(t,n,i){return{}}constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:r,blockInitialAnimation:s,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=EF,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=Pd.now();this.renderScheduledAtthis.bindToMotionValue(i,n)),NF.current||dbe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:R_.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){fW.delete(this.current),this.projection&&this.projection.unmount(),fm(this.notifyUpdate),fm(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 i=Hb.has(t),r=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&Kr.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),s(),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 Pv){const n=Pv[t];if(!n)continue;const{isEnabled:i,Feature:r}=n;if(!this.features[t]&&r&&i(this.props)&&(this.features[t]=new r(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Rs()}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 i=0;in.variantChildren.delete(t)}addValue(t,n){const i=this.values.get(t);n!==i&&(i&&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 i=this.values.get(t);return i===void 0&&n!==void 0&&(i=fS(n===null?void 0:n,{owner:this}),this.addValue(t,i)),i}readValue(t,n){var i;let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(i=this.getBaseTargetFromProps(this.props,t))!==null&&i!==void 0?i:this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(_ge(r)||xge(r))?r=parseFloat(r):!nFe(r)&&hm.test(n)&&(r=Cge(t,n)),this.setBaseTarget(t,mo(r)?r.get():r)),mo(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:i}=this.props;let r;if(typeof i=="string"||typeof i=="object"){const a=sF(this.props,i,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);a&&(r=a[t])}if(i&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!mo(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new gF),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class fbe extends rFe{constructor(){super(...arguments),this.KeyframeResolver=Ige}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:i}){delete n[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;mo(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function sFe(e){return window.getComputedStyle(e)}class aFe extends fbe{constructor(){super(...arguments),this.type="html",this.renderInstance=Jme}readValueFromInstance(t,n){if(Hb.has(n)){const i=kF(n);return i&&i.default||0}else{const i=sFe(t),r=(Xme(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Zge(t,n)}build(t,n,i){lF(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return fF(t,n,i)}}class oFe extends fbe{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Rs}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Hb.has(n)){const i=kF(n);return i&&i.default||0}return n=ege.has(n)?n:nF(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return ige(t,n,i)}build(t,n,i){cF(t,n,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,i,r){tge(t,n,i,r)}mount(t){this.isSVGTag=dF(t.tagName),super.mount(t)}}const lFe=(e,t)=>rF(e)?new oFe(t):new aFe(t,{allowProjection:e!==m.Fragment}),cFe=D6e({...C8e,...J9e,...M9e,...eFe},lFe),pr=X4e(cFe);function jF(){!NF.current&&dbe();const[e]=m.useState(R_.current);return e}function pa(){return pa=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?m.useEffect:m.useLayoutEffect;function J0(e,t,n){var i=m.useRef(t);i.current=t,m.useEffect(function(){function r(s){i.current(s)}return e&&window.addEventListener(e,r,n),function(){e&&window.removeEventListener(e,r)}},[e])}var uFe=["container"];function dFe(e){var t=e.container,n=t===void 0?document.body:t,i=Gj(e,uFe);return Li.createPortal(ii.createElement("div",pa({},i)),n)}function fFe(e){return ii.createElement("svg",pa({width:"44",height:"44",viewBox:"0 0 768 768"},e),ii.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 hFe(e){return ii.createElement("svg",pa({width:"44",height:"44",viewBox:"0 0 768 768"},e),ii.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 pFe(e){return ii.createElement("svg",pa({width:"44",height:"44",viewBox:"0 0 768 768"},e),ii.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function mFe(){return m.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function mW(e){var t=e.touches[0],n=t.clientX,i=t.clientY;if(e.touches.length>=2){var r=e.touches[1],s=r.clientX,a=r.clientY;return[(n+s)/2,(i+a)/2,Math.sqrt(Math.pow(s-n,2)+Math.pow(a-i,2))]}return[n,i,0]}var wp=function(e,t,n,i){var r,s=n*t,a=(s-i)/2,l=e;return s<=i?(r=1,l=0):e>0&&a-e<=0?(r=2,l=a):e<0&&a+e<=0&&(r=3,l=-a),[r,l]};function jD(e,t,n,i,r,s,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=wp(e,s,n,innerWidth)[0],f=wp(t,s,i,innerHeight),h=innerWidth/2,p=innerHeight/2;return{x:a-s/r*(a-(h+e))-h+(i/n>=3&&n*s===innerWidth?0:d?c/2:c),y:l-s/r*(l-(p+t))-p+(f[0]?u/2:u),lastCX:a,lastCY:l}}function d4(e,t,n){var i=e%180!=0;return i?[n,t,i]:[t,n,i]}function RD(e,t,n){var i=d4(n,innerWidth,innerHeight),r=i[0],s=i[1],a=0,l=r,c=s,u=e/t*s,d=t/e*r;return e=s?l=u:e>=r&&tr/s?c=d:t/e>=3&&!i[2]?a=((c=d)-s)/2:l=u,{width:l,height:c,x:0,y:a,pause:!0}}function XC(e,t){var n=t.leading,i=n!==void 0&&n,r=t.maxWait,s=t.wait,a=s===void 0?r||0:s,l=m.useRef(e);l.current=e;var c=m.useRef(0),u=m.useRef(),d=function(){return u.current&&clearTimeout(u.current)},f=m.useCallback(function(){var h=[].slice.call(arguments),p=Date.now();function g(){c.current=p,d(),l.current.apply(null,h)}var b=c.current,v=p-b;if(b===0&&(i&&g(),c.current=p),r!==void 0){if(v>r)return void g()}else v=1&&s&&s())};d()}function d(){c=requestAnimationFrame(u)}}var bFe={T:0,L:0,W:0,H:0,FIT:void 0},pbe=function(){var e=m.useRef(!1);return m.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},yFe=["className"];function vFe(e){var t=e.className,n=t===void 0?"":t,i=Gj(e,yFe);return ii.createElement("div",pa({className:"PhotoView__Spinner "+n},i),ii.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},ii.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"}),ii.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var xFe=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function wFe(e){var t=e.src,n=e.loaded,i=e.broken,r=e.className,s=e.onPhotoLoad,a=e.loadingElement,l=e.brokenElement,c=Gj(e,xFe),u=pbe();return t&&!i?ii.createElement(ii.Fragment,null,ii.createElement("img",pa({className:"PhotoView__Photo"+(r?" "+r:""),src:t,onLoad:function(d){var f=d.target;u.current&&s({loaded:!0,naturalWidth:f.naturalWidth,naturalHeight:f.naturalHeight})},onError:function(){u.current&&s({broken:!0})},draggable:!1,alt:""},c)),!n&&(a?ii.createElement("span",{className:"PhotoView__icon"},a):ii.createElement(vFe,{className:"PhotoView__icon"}))):l?ii.createElement("span",{className:"PhotoView__icon"},typeof l=="function"?l({src:t}):l):null}var OFe={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 SFe(e){var t=e.item,n=t.src,i=t.render,r=t.width,s=r===void 0?0:r,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,g=e.style,b=e.loadingElement,v=e.brokenElement,y=e.onPhotoTap,x=e.onMaskTap,O=e.onReachMove,w=e.onReachUp,k=e.onPhotoResize,S=e.isActive,E=e.expose,C=I_(OFe),N=C[0],_=C[1],j=m.useRef(0),A=pbe(),F=N.naturalWidth,T=F===void 0?s:F,P=N.naturalHeight,R=P===void 0?l:P,L=N.width,M=L===void 0?s:L,U=N.height,I=U===void 0?l:U,H=N.loaded,Z=H===void 0?!n:H,Q=N.broken,q=N.x,B=N.y,te=N.touched,ce=N.stopRaf,se=N.maskTouched,re=N.rotate,ge=N.scale,G=N.CX,K=N.CY,ae=N.lastX,ue=N.lastY,xe=N.lastCX,Ee=N.lastCY,Je=N.lastScale,De=N.touchTime,Pe=N.touchLength,Ne=N.pause,Ke=N.reach,wt=nb({onScale:function(je){return ot(KC(je))},onRotate:function(je){re!==je&&(E({rotate:je}),_(pa({rotate:je},RD(T,R,je))))}});function ot(je,Ot,yt){ge!==je&&(E({scale:je}),_(pa({scale:je},jD(q,B,M,I,ge,je,Ot,yt),je<=1&&{x:0,y:0})))}var Ie=XC(function(je,Ot,yt){if(yt===void 0&&(yt=0),(te||se)&&S){var Dt=d4(re,M,I),Ft=Dt[0],Fe=Dt[1];if(yt===0&&j.current===0){var dt=Math.abs(je-G)<=20,$t=Math.abs(Ot-K)<=20;if(dt&&$t)return void _({lastCX:je,lastCY:Ot});j.current=dt?Ot>K?3:2:1}var Qe,ut=je-xe,bt=Ot-Ee;if(yt===0){var it=wp(ut+ae,ge,Ft,innerWidth)[0],xt=wp(bt+ue,ge,Fe,innerHeight);Qe=function(pt,Re,ze,st){return Re&&pt===1||st==="x"?"x":ze&&pt>1||st==="y"?"y":void 0}(j.current,it,xt[0],Ke),Qe!==void 0&&O(Qe,je,Ot,ge)}if(Qe==="x"||se)return void _({reach:"x"});var W=KC(ge+(yt-Pe)/100/2*ge,T/M,.2);E({scale:W}),_(pa({touchLength:yt,reach:Qe,scale:W},jD(q,B,M,I,ge,W,je,Ot,ut,bt)))}},{maxWait:8});function Be(je){return!ce&&!te&&(A.current&&_(pa({},je,{pause:u})),A.current)}var J,pe,oe,Me,Ve,ht,Se,ve,$e=(Ve=function(je){return Be({x:je})},ht=function(je){return Be({y:je})},Se=function(je){return A.current&&(E({scale:je}),_({scale:je})),!te&&A.current},ve=nb({X:function(je){return Ve(je)},Y:function(je){return ht(je)},S:function(je){return Se(je)}}),function(je,Ot,yt,Dt,Ft,Fe,dt,$t,Qe,ut,bt){var it=d4(ut,Ft,Fe),xt=it[0],W=it[1],pt=wp(je,$t,xt,innerWidth),Re=pt[0],ze=pt[1],st=wp(Ot,$t,W,innerHeight),me=st[0],We=st[1],St=Date.now()-bt;if(St>=200||$t!==dt||Math.abs(Qe-dt)>1){var vn=jD(je,Ot,Ft,Fe,dt,$t),Ki=vn.x,Le=vn.y,Mt=Re?ze:Ki!==je?Ki:null,pn=me?We:Le!==Ot?Le:null;return Mt!==null&&Cg(je,Mt,ve.X),pn!==null&&Cg(Ot,pn,ve.Y),void($t!==dt&&Cg(dt,$t,ve.S))}var en=(je-yt)/St,tn=(Ot-Dt)/St,Un=Math.sqrt(Math.pow(en,2)+Math.pow(tn,2)),xn=!1,oi=!1;(function(Oi,mi){var bn,qi=Oi,ri=0,zi=0,as=function(xs){bn||(bn=xs);var os=xs-bn,ia=Math.sign(Oi),Nr=-.001*ia,As=Math.sign(-qi)*Math.pow(qi,2)*2e-4,Vs=qi*os+(Nr+As)*Math.pow(os,2)/2;ri+=Vs,bn=xs,ia*(qi+=(Nr+As)*os)<=0?_r():mi(ri)?Lr():_r()};function Lr(){zi=requestAnimationFrame(as)}function _r(){cancelAnimationFrame(zi)}Lr()})(Un,function(Oi){var mi=je+Oi*(en/Un),bn=Ot+Oi*(tn/Un),qi=wp(mi,dt,xt,innerWidth),ri=qi[0],zi=qi[1],as=wp(bn,dt,W,innerHeight),Lr=as[0],_r=as[1];if(ri&&!xn&&(xn=!0,Re?Cg(mi,zi,ve.X):gW(zi,mi+(mi-zi),ve.X)),Lr&&!oi&&(oi=!0,me?Cg(bn,_r,ve.Y):gW(_r,bn+(bn-_r),ve.Y)),xn&&oi)return!1;var xs=xn||ve.X(zi),os=oi||ve.Y(_r);return xs&&os})}),qe=(J=y,pe=function(je,Ot){Ke||ot(ge!==1?1:Math.max(2,T/M),je,Ot)},oe=m.useRef(0),Me=XC(function(){oe.current=0,J.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var je=[].slice.call(arguments);oe.current+=1,Me.apply(void 0,je),oe.current>=2&&(Me.cancel(),oe.current=0,pe.apply(void 0,je))});function ke(je,Ot){if(j.current=0,(te||se)&&S){_({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var yt=KC(ge,T/M);if($e(q,B,ae,ue,M,I,ge,yt,Je,re,De),w(je,Ot),G===je&&K===Ot){if(te)return void qe(je,Ot);se&&x(je,Ot)}}}function Tt(je,Ot,yt){yt===void 0&&(yt=0),_({touched:!0,CX:je,CY:Ot,lastCX:je,lastCY:Ot,lastX:q,lastY:B,lastScale:ge,touchLength:yt,touchTime:Date.now()})}function Jt(je){_({maskTouched:!0,CX:je.clientX,CY:je.clientY,lastX:q,lastY:B})}J0(Ef?void 0:"mousemove",function(je){je.preventDefault(),Ie(je.clientX,je.clientY)}),J0(Ef?void 0:"mouseup",function(je){ke(je.clientX,je.clientY)}),J0(Ef?"touchmove":void 0,function(je){je.preventDefault();var Ot=mW(je);Ie.apply(void 0,Ot)},{passive:!1}),J0(Ef?"touchend":void 0,function(je){var Ot=je.changedTouches[0];ke(Ot.clientX,Ot.clientY)},{passive:!1}),J0("resize",XC(function(){Z&&!te&&(_(RD(T,R,re)),k())},{maxWait:8})),u4(function(){S&&E(pa({scale:ge,rotate:re},wt))},[S]);var on=function(je,Ot,yt,Dt,Ft,Fe,dt,$t,Qe,ut){var bt=function(Ki,Le,Mt,pn,en){var tn=m.useRef(!1),Un=I_({lead:!0,scale:Mt}),xn=Un[0],oi=xn.lead,Oi=xn.scale,mi=Un[1],bn=XC(function(qi){try{return en(!0),mi({lead:!1,scale:qi}),Promise.resolve()}catch(ri){return Promise.reject(ri)}},{wait:pn});return u4(function(){tn.current?(en(!1),mi({lead:!0}),bn(Mt)):tn.current=!0},[Mt]),oi?[Ki*Oi,Le*Oi,Mt/Oi]:[Ki*Mt,Le*Mt,1]}(Fe,dt,$t,Qe,ut),it=bt[0],xt=bt[1],W=bt[2],pt=function(Ki,Le,Mt,pn,en){var tn=m.useState(bFe),Un=tn[0],xn=tn[1],oi=m.useState(0),Oi=oi[0],mi=oi[1],bn=m.useRef(),qi=nb({OK:function(){return Ki&&mi(4)}});function ri(zi){en(!1),mi(zi)}return m.useEffect(function(){if(bn.current||(bn.current=Date.now()),Mt){if(function(zi,as){var Lr=zi&&zi.current;if(Lr&&Lr.nodeType===1){var _r=Lr.getBoundingClientRect();as({T:_r.top,L:_r.left,W:_r.width,H:_r.height,FIT:Lr.tagName==="IMG"?getComputedStyle(Lr).objectFit:void 0})}}(Le,xn),Ki)return Date.now()-bn.current<250?(mi(1),requestAnimationFrame(function(){mi(2),requestAnimationFrame(function(){return ri(3)})}),void setTimeout(qi.OK,pn)):void mi(4);ri(5)}},[Ki,Mt]),[Oi,Un]}(je,Ot,yt,Qe,ut),Re=pt[0],ze=pt[1],st=ze.W,me=ze.FIT,We=innerWidth/2,St=innerHeight/2,vn=Re<3||Re>4;return[vn?st?ze.L:We:Dt+(We-Fe*$t/2),vn?st?ze.T:St:Ft+(St-dt*$t/2),it,vn&&me?it*(ze.H/st):xt,Re===0?W:vn?st/(Fe*$t)||.01:W,vn?me?1:0:1,Re,me]}(u,c,Z,q,B,M,I,ge,d,function(je){return _({pause:je})}),Et=on[4],Bt=on[6],rt="transform "+d+"ms "+f,gt={className:p,onMouseDown:Ef?void 0:function(je){je.stopPropagation(),je.button===0&&Tt(je.clientX,je.clientY,0)},onTouchStart:Ef?function(je){je.stopPropagation(),Tt.apply(void 0,mW(je))}:void 0,onWheel:function(je){if(!Ke){var Ot=KC(ge-je.deltaY/100/2,T/M);_({stopRaf:!0}),ot(Ot,je.clientX,je.clientY)}},style:{width:on[2]+"px",height:on[3]+"px",opacity:on[5],objectFit:Bt===4?void 0:on[7],transform:re?"rotate("+re+"deg)":void 0,transition:Bt>2?rt+", opacity "+d+"ms ease, height "+(Bt<4?d/2:Bt>4?d:0)+"ms "+f:void 0}};return ii.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:g,onMouseDown:!Ef&&S?Jt:void 0,onTouchStart:Ef&&S?function(je){return Jt(je.touches[0])}:void 0},ii.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+Et+", 0, 0, "+Et+", "+on[0]+", "+on[1]+")",transition:te||Ne?void 0:rt,willChange:S?"transform":void 0}},n?ii.createElement(wFe,pa({src:n,loaded:Z,broken:Q},gt,{onPhotoLoad:function(je){_(pa({},je,je.loaded&&RD(je.naturalWidth||0,je.naturalHeight||0,re)))},loadingElement:b,brokenElement:v})):i&&i({attrs:gt,scale:Et,rotate:re})))}var bW={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 kFe(e){var t=e.loop,n=t===void 0?3:t,i=e.speed,r=e.easing,s=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,g=e.overlayRender,b=e.toolbarRender,v=e.className,y=e.maskClassName,x=e.photoClassName,O=e.photoWrapClassName,w=e.loadingElement,k=e.brokenElement,S=e.images,E=e.index,C=E===void 0?0:E,N=e.onIndexChange,_=e.visible,j=e.onClose,A=e.afterClose,F=e.portalContainer,T=I_(bW),P=T[0],R=T[1],L=m.useState(0),M=L[0],U=L[1],I=P.x,H=P.touched,Z=P.pause,Q=P.lastCX,q=P.lastCY,B=P.bg,te=B===void 0?u:B,ce=P.lastBg,se=P.overlay,re=P.minimal,ge=P.scale,G=P.rotate,K=P.onScale,ae=P.onRotate,ue=e.hasOwnProperty("index"),xe=ue?C:M,Ee=ue?N:U,Je=m.useRef(xe),De=S.length,Pe=S[xe],Ne=typeof n=="boolean"?n:De>n,Ke=function(Et,Bt){var rt=m.useReducer(function(yt){return!yt},!1)[1],gt=m.useRef(0),je=function(yt){var Dt=m.useRef(yt);function Ft(Fe){Dt.current=Fe}return m.useMemo(function(){(function(Fe){Et?(Fe(Et),gt.current=1):gt.current=2})(Ft)},[yt]),[Dt.current,Ft]}(Et),Ot=je[1];return[je[0],gt.current,function(){rt(),gt.current===2&&(Ot(!1),Bt&&Bt()),gt.current=0}]}(_,A),wt=Ke[0],ot=Ke[1],Ie=Ke[2];u4(function(){if(wt)return R({pause:!0,x:xe*-(innerWidth+_0)}),void(Je.current=xe);R(bW)},[wt]);var Be=nb({close:function(Et){ae&&ae(0),R({overlay:!0,lastBg:te}),j(Et)},changeIndex:function(Et,Bt){Bt===void 0&&(Bt=!1);var rt=Ne?Je.current+(Et-xe):Et,gt=De-1,je=c4(rt,0,gt),Ot=Ne?rt:je,yt=innerWidth+_0;R({touched:!1,lastCX:void 0,lastCY:void 0,x:-yt*Ot,pause:Bt}),Je.current=Ot,Ee&&Ee(Ne?Et<0?gt:Et>gt?0:Et:je)}}),J=Be.close,pe=Be.changeIndex;function oe(Et){return Et?J():R({overlay:!se})}function Me(){R({x:-(innerWidth+_0)*xe,lastCX:void 0,lastCY:void 0,pause:!0}),Je.current=xe}function Ve(Et,Bt,rt,gt){Et==="x"?function(je){if(Q!==void 0){var Ot=je-Q,yt=Ot;!Ne&&(xe===0&&Ot>0||xe===De-1&&Ot<0)&&(yt=Ot/2),R({touched:!0,lastCX:Q,x:-(innerWidth+_0)*Je.current+yt,pause:!1})}else R({touched:!0,lastCX:je,x:I,pause:!1})}(Bt):Et==="y"&&function(je,Ot){if(q!==void 0){var yt=u===null?null:c4(u,.01,u-Math.abs(je-q)/100/4);R({touched:!0,lastCY:q,bg:Ot===1?yt:u,minimal:Ot===1})}else R({touched:!0,lastCY:je,bg:te,minimal:!0})}(rt,gt)}function ht(Et,Bt){var rt=Et-(Q??Et),gt=Bt-(q??Bt),je=!1;if(rt<-40)pe(xe+1);else if(rt>40)pe(xe-1);else{var Ot=-(innerWidth+_0)*Je.current;Math.abs(gt)>100&&re&&f&&(je=!0,J()),R({touched:!1,x:Ot,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!je||se})}}J0("keydown",function(Et){if(_)switch(Et.key){case"ArrowLeft":pe(xe-1,!0);break;case"ArrowRight":pe(xe+1,!0);break;case"Escape":J()}});var Se=function(Et,Bt,rt){return m.useMemo(function(){var gt=Et.length;return rt?Et.concat(Et).concat(Et).slice(gt+Bt-1,gt+Bt+2):Et.slice(Math.max(Bt-1,0),Math.min(Bt+2,gt+1))},[Et,Bt,rt])}(S,xe,Ne);if(!wt)return null;var ve=se&&!ot,$e=_?te:ce,qe=K&&ae&&{images:S,index:xe,visible:_,onClose:J,onIndexChange:pe,overlayVisible:ve,overlay:Pe&&Pe.overlay,scale:ge,rotate:G,onScale:K,onRotate:ae},ke=i?i(ot):400,Tt=r?r(ot):pW,Jt=i?i(3):600,on=r?r(3):pW;return ii.createElement(dFe,{className:"PhotoView-Portal"+(ve?"":" PhotoView-Slider__clean")+(_?"":" PhotoView-Slider__willClose")+(v?" "+v:""),role:"dialog",onClick:function(Et){return Et.stopPropagation()},container:F},_&&ii.createElement(mFe,null),ii.createElement("div",{className:"PhotoView-Slider__Backdrop"+(y?" "+y:"")+(ot===1?" PhotoView-Slider__fadeIn":ot===2?" PhotoView-Slider__fadeOut":""),style:{background:$e?"rgba(0, 0, 0, "+$e+")":void 0,transitionTimingFunction:Tt,transitionDuration:(H?0:ke)+"ms",animationDuration:ke+"ms"},onAnimationEnd:Ie}),p&&ii.createElement("div",{className:"PhotoView-Slider__BannerWrap"},ii.createElement("div",{className:"PhotoView-Slider__Counter"},xe+1," / ",De),ii.createElement("div",{className:"PhotoView-Slider__BannerRight"},b&&qe&&b(qe),ii.createElement(fFe,{className:"PhotoView-Slider__toolbarIcon",onClick:J}))),Se.map(function(Et,Bt){var rt=Ne||xe!==0?Je.current-1+Bt:xe+Bt;return ii.createElement(SFe,{key:Ne?Et.key+"/"+Et.src+"/"+rt:Et.key,item:Et,speed:ke,easing:Tt,visible:_,onReachMove:Ve,onReachUp:ht,onPhotoTap:function(){return oe(s)},onMaskTap:function(){return oe(l)},wrapClassName:O,className:x,style:{left:(innerWidth+_0)*rt+"px",transform:"translate3d("+I+"px, 0px, 0)",transition:H||Z?void 0:"transform "+Jt+"ms "+on},loadingElement:w,brokenElement:k,onPhotoResize:Me,isActive:Je.current===rt,expose:R})}),!Ef&&p&&ii.createElement(ii.Fragment,null,(Ne||xe!==0)&&ii.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return pe(xe-1,!0)}},ii.createElement(hFe,null)),(Ne||xe+1-1){var y=u.slice();return y.splice(v,1,b),void l({images:y})}l(function(x){return{images:x.images.concat(b)}})},remove:function(b){l(function(v){var y=v.images.filter(function(x){return x.key!==b});return{images:y,index:Math.min(y.length-1,f)}})},show:function(b){var v=u.findIndex(function(y){return y.key===b});l({visible:!0,index:v}),i&&i(!0,v,a)}}),p=nb({close:function(){l({visible:!1}),i&&i(!1,f,a)},changeIndex:function(b){l({index:b}),n&&n(b,a)}}),g=m.useMemo(function(){return pa({},a,h)},[a,h]);return ii.createElement(hbe.Provider,{value:g},t,ii.createElement(kFe,pa({images:u,visible:d,index:f,onIndexChange:p.changeIndex,onClose:p.close},r)))}var mbe=function(e){var t,n,i=e.src,r=e.render,s=e.overlay,a=e.width,l=e.height,c=e.triggers,u=c===void 0?["onClick"]:c,d=e.children,f=m.useContext(hbe),h=(t=function(){return f.nextId()},(n=m.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=t()),n.fn),p=m.useRef(null);m.useImperativeHandle(d==null?void 0:d.ref,function(){return p.current}),m.useEffect(function(){return function(){f.remove(h)}},[]);var g=nb({render:function(v){return r&&r(v)},show:function(v,y){f.show(h),function(x,O){if(d){var w=d.props[x];w&&w(O)}}(v,y)}}),b=m.useMemo(function(){var v={};return u.forEach(function(y){v[y]=g.show.bind(null,y)}),v},[]);return m.useEffect(function(){f.update({key:h,src:i,originRef:p,render:g.render,overlay:s,width:a,height:l})},[i]),d?m.Children.only(m.cloneElement(d,pa({},b,{ref:p}))):null};const AFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M5.293 12.707a1 1 0 0 1 0-1.414l5-5a1 1 0 1 1 1.414 1.414L8.414 11H18a1 1 0 1 1 0 2H8.414l3.293 3.293a1 1 0 0 1-1.414 1.414l-5-5Z",clipRule:"evenodd"})}),_Fe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M18.707 12.707a1 1 0 0 0 0-1.414l-5-5a1 1 0 1 0-1.414 1.414L15.586 11H6a1 1 0 1 0 0 2h9.586l-3.293 3.293a1 1 0 0 0 1.414 1.414l5-5Z",clipRule:"evenodd"})}),NFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M4.47192 2.5C5.02421 2.5 5.47192 2.94772 5.47192 3.5V5.07196C7.17065 3.47759 9.45675 2.5 11.9719 2.5C17.2186 2.5 21.4719 6.75329 21.4719 12C21.4719 17.2467 17.2186 21.5 11.9719 21.5C7.10262 21.5 3.0902 17.8375 2.53692 13.1164C2.47264 12.5679 2.8652 12.0711 3.41373 12.0068C3.96226 11.9425 4.45904 12.3351 4.52333 12.8836C4.95991 16.6089 8.12901 19.5 11.9719 19.5C16.1141 19.5 19.4719 16.1421 19.4719 12C19.4719 7.85786 16.1141 4.5 11.9719 4.5C9.75153 4.5 7.75552 5.46469 6.38146 7H9.00003C9.55232 7 10 7.44772 10 8C10 8.55228 9.55232 9 9.00003 9H4.47192C3.93256 9 3.49293 8.57299 3.47265 8.03859C3.47175 8.01771 3.47151 7.99677 3.47192 7.9758V3.5C3.47192 2.94772 3.91964 2.5 4.47192 2.5Z",fill:"currentColor"})}),Kj=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M2.55823 12C2.55823 6.75329 6.81152 2.5 12.0582 2.5C14.5734 2.5 16.8595 3.47759 18.5582 5.07197V3.5C18.5582 2.94772 19.0059 2.5 19.5582 2.5C20.1105 2.5 20.5582 2.94772 20.5582 3.5V7.97591C20.5586 7.99622 20.5584 8.01651 20.5576 8.03674C20.5382 8.572 20.0982 9 19.5582 9H15.0582C14.5059 9 14.0582 8.55228 14.0582 8C14.0582 7.44772 14.5059 7 15.0582 7H17.6487C16.2746 5.46469 14.2786 4.5 12.0582 4.5C7.91609 4.5 4.55823 7.85786 4.55823 12C4.55823 16.1421 7.91609 19.5 12.0582 19.5C15.9011 19.5 19.0702 16.6089 19.5068 12.8836C19.5711 12.3351 20.0679 11.9425 20.6164 12.0068C21.165 12.0711 21.5575 12.5679 21.4932 13.1164C20.94 17.8375 16.9275 21.5 12.0582 21.5C6.81152 21.5 2.55823 17.2467 2.55823 12Z",fill:"currentColor"})}),YC=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M16.243 6.757a1 1 0 0 1 1 1v7.072a1 1 0 0 1-2 0v-4.657L8.464 16.95a1 1 0 0 1-1.414-1.414l6.778-6.779H9.172a1 1 0 0 1 0-2h7.07Z",clipRule:"evenodd"})}),jFe=e=>o.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[o.jsx("path",{d:"M10.663 6.3872C10.8152 6.29068 11 6.40984 11 6.59007V8C11 8.55229 11.4477 9 12 9C12.5523 9 13 8.55229 13 8V6.59007C13 6.40984 13.1848 6.29068 13.337 6.3872C14.036 6.83047 14.5 7.61105 14.5 8.5C14.5 9.53284 13.8737 10.4194 12.9801 10.8006C12.9932 10.865 13 10.9317 13 11V13C13 13.5523 12.5523 14 12 14C11.4477 14 11 13.5523 11 13V11C11 10.9317 11.0068 10.865 11.0199 10.8006C10.1263 10.4194 9.5 9.53284 9.5 8.5C9.5 7.61105 9.96397 6.83047 10.663 6.3872Z",fill:"currentColor"}),o.jsx("path",{d:"M17.9754 4.01031C17.8588 4.00078 17.6965 4.00001 17.4 4.00001H9.8C8.94342 4.00001 8.36113 4.00078 7.91104 4.03756C7.47262 4.07338 7.24842 4.1383 7.09202 4.21799C6.7157 4.40974 6.40973 4.7157 6.21799 5.09202C6.1383 5.24842 6.07337 5.47263 6.03755 5.91104C6.00078 6.36113 6 6.94343 6 7.80001V16.1707C6.31278 16.0602 6.64937 16 7 16H18L18 4.60001C18 4.30348 17.9992 4.14122 17.9897 4.02464C17.9893 4.02 17.9889 4.0156 17.9886 4.01145C17.9844 4.01107 17.98 4.01069 17.9754 4.01031ZM17.657 18H7C6.44772 18 6 18.4477 6 19C6 19.5523 6.44772 20 7 20H17.657C17.5343 19.3301 17.5343 18.6699 17.657 18ZM4 19L4 7.75871C3.99999 6.95374 3.99998 6.28937 4.04419 5.74818C4.09012 5.18608 4.18868 4.66938 4.43597 4.18404C4.81947 3.43139 5.43139 2.81947 6.18404 2.43598C6.66937 2.18869 7.18608 2.09012 7.74818 2.0442C8.28937 1.99998 8.95373 1.99999 9.7587 2L17.4319 2C17.6843 1.99997 17.9301 1.99994 18.1382 2.01695C18.3668 2.03563 18.6366 2.07969 18.908 2.21799C19.2843 2.40974 19.5903 2.7157 19.782 3.09203C19.9203 3.36345 19.9644 3.63318 19.9831 3.86178C20.0001 4.06994 20 4.31574 20 4.56812L20 17C20 17.1325 19.9736 17.2638 19.9225 17.386C19.4458 18.5253 19.4458 19.4747 19.9225 20.614C20.0517 20.9227 20.0179 21.2755 19.8325 21.5541C19.6471 21.8326 19.3346 22 19 22H7C5.34315 22 4 20.6569 4 19Z",fill:"currentColor"})]}),Lv=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M18.063 5.674a1 1 0 0 1 .263 1.39l-7.5 11a1 1 0 0 1-1.533.143l-4.5-4.5a1 1 0 1 1 1.414-1.414l3.647 3.647 6.82-10.003a1 1 0 0 1 1.39-.263Z",clipRule:"evenodd"})}),gbe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM16.0755 7.93219C16.5272 8.25003 16.6356 8.87383 16.3178 9.32549L11.5678 16.0755C11.3931 16.3237 11.1152 16.4792 10.8123 16.4981C10.5093 16.517 10.2142 16.3973 10.0101 16.1727L7.51006 13.4227C7.13855 13.014 7.16867 12.3816 7.57733 12.0101C7.98598 11.6386 8.61843 11.6687 8.98994 12.0773L10.6504 13.9039L14.6822 8.17451C15 7.72284 15.6238 7.61436 16.0755 7.93219Z",fill:"currentColor"})}),RFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 9",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.292893 0.292893C0.683418 -0.0976311 1.31658 -0.0976311 1.70711 0.292893L8 6.58579L14.2929 0.292894C14.6834 -0.0976305 15.3166 -0.0976304 15.7071 0.292894C16.0976 0.683418 16.0976 1.31658 15.7071 1.70711L8.70711 8.70711C8.31658 9.09763 7.68342 9.09763 7.29289 8.70711L0.292893 1.70711C-0.0976311 1.31658 -0.0976311 0.683417 0.292893 0.292893Z"})}),IFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M15.707 4.293a1 1 0 0 1 0 1.414L9.414 12l6.293 6.293a1 1 0 0 1-1.414 1.414l-7-7a1 1 0 0 1 0-1.414l7-7a1 1 0 0 1 1.414 0Z",clipRule:"evenodd"})}),PFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M8.293 4.293a1 1 0 0 1 1.414 0l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L14.586 12 8.293 5.707a1 1 0 0 1 0-1.414Z",clipRule:"evenodd"})}),RF=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM12 6C12.5523 6 13 6.44772 13 7V12C13 12.2652 12.8946 12.5196 12.7071 12.7071L10.2071 15.2071C9.81658 15.5976 9.18342 15.5976 8.79289 15.2071C8.40237 14.8166 8.40237 14.1834 8.79289 13.7929L11 11.5858V7C11 6.44772 11.4477 6 12 6Z",fill:"currentColor"})}),DFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M12.659 9.753a1 1 0 0 1-1.318 0l-4-3.5A1 1 0 1 1 8.66 4.747L12 7.671l3.341-2.924a1 1 0 1 1 1.318 1.506l-4 3.5Zm-4.002 9.501a1 1 0 1 1-1.314-1.508l4-3.485a1 1 0 0 1 1.314 0l4 3.485a1 1 0 1 1-1.314 1.508L12 16.34l-3.343 2.913Z"})}),IF=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M12.7587 2H16.2413C17.0463 1.99999 17.7106 1.99998 18.2518 2.04419C18.8139 2.09012 19.3306 2.18868 19.816 2.43597C20.5686 2.81947 21.1805 3.43139 21.564 4.18404C21.8113 4.66937 21.9099 5.18608 21.9558 5.74817C22 6.28936 22 6.95372 22 7.75868V11.2413C22 12.0463 22 12.7106 21.9558 13.2518C21.9099 13.8139 21.8113 14.3306 21.564 14.816C21.1805 15.5686 20.5686 16.1805 19.816 16.564C19.3306 16.8113 18.8139 16.9099 18.2518 16.9558C17.8906 16.9853 17.4745 16.9951 16.9984 16.9984C16.9951 17.4745 16.9853 17.8906 16.9558 18.2518C16.9099 18.8139 16.8113 19.3306 16.564 19.816C16.1805 20.5686 15.5686 21.1805 14.816 21.564C14.3306 21.8113 13.8139 21.9099 13.2518 21.9558C12.7106 22 12.0463 22 11.2413 22H7.75868C6.95372 22 6.28936 22 5.74818 21.9558C5.18608 21.9099 4.66937 21.8113 4.18404 21.564C3.43139 21.1805 2.81947 20.5686 2.43597 19.816C2.18868 19.3306 2.09012 18.8139 2.04419 18.2518C1.99998 17.7106 1.99999 17.0463 2 16.2413V12.7587C1.99999 11.9537 1.99998 11.2894 2.04419 10.7482C2.09012 10.1861 2.18868 9.66937 2.43597 9.18404C2.81947 8.43139 3.43139 7.81947 4.18404 7.43598C4.66937 7.18868 5.18608 7.09012 5.74817 7.04419C6.10939 7.01468 6.52548 7.00487 7.00162 7.00162C7.00487 6.52548 7.01468 6.10939 7.04419 5.74817C7.09012 5.18608 7.18868 4.66937 7.43598 4.18404C7.81947 3.43139 8.43139 2.81947 9.18404 2.43597C9.66937 2.18868 10.1861 2.09012 10.7482 2.04419C11.2894 1.99998 11.9537 1.99999 12.7587 2ZM9.00176 7L11.2413 7C12.0463 6.99999 12.7106 6.99998 13.2518 7.04419C13.8139 7.09012 14.3306 7.18868 14.816 7.43598C15.5686 7.81947 16.1805 8.43139 16.564 9.18404C16.8113 9.66937 16.9099 10.1861 16.9558 10.7482C17 11.2894 17 11.9537 17 12.7587V14.9982C17.4455 14.9951 17.7954 14.9864 18.089 14.9624C18.5274 14.9266 18.7516 14.8617 18.908 14.782C19.2843 14.5903 19.5903 14.2843 19.782 13.908C19.8617 13.7516 19.9266 13.5274 19.9624 13.089C19.9992 12.6389 20 12.0566 20 11.2V7.8C20 6.94342 19.9992 6.36113 19.9624 5.91104C19.9266 5.47262 19.8617 5.24842 19.782 5.09202C19.5903 4.7157 19.2843 4.40973 18.908 4.21799C18.7516 4.1383 18.5274 4.07337 18.089 4.03755C17.6389 4.00078 17.0566 4 16.2 4H12.8C11.9434 4 11.3611 4.00078 10.911 4.03755C10.4726 4.07337 10.2484 4.1383 10.092 4.21799C9.7157 4.40973 9.40973 4.7157 9.21799 5.09202C9.1383 5.24842 9.07337 5.47262 9.03755 5.91104C9.01357 6.20463 9.00489 6.55447 9.00176 7ZM5.91104 9.03755C5.47262 9.07337 5.24842 9.1383 5.09202 9.21799C4.7157 9.40973 4.40973 9.7157 4.21799 10.092C4.1383 10.2484 4.07337 10.4726 4.03755 10.911C4.00078 11.3611 4 11.9434 4 12.8V16.2C4 17.0566 4.00078 17.6389 4.03755 18.089C4.07337 18.5274 4.1383 18.7516 4.21799 18.908C4.40973 19.2843 4.7157 19.5903 5.09202 19.782C5.24842 19.8617 5.47262 19.9266 5.91104 19.9624C6.36113 19.9992 6.94342 20 7.8 20H11.2C12.0566 20 12.6389 19.9992 13.089 19.9624C13.5274 19.9266 13.7516 19.8617 13.908 19.782C14.2843 19.5903 14.5903 19.2843 14.782 18.908C14.8617 18.7516 14.9266 18.5274 14.9624 18.089C14.9992 17.6389 15 17.0566 15 16.2V12.8C15 11.9434 14.9992 11.3611 14.9624 10.911C14.9266 10.4726 14.8617 10.2484 14.782 10.092C14.5903 9.7157 14.2843 9.40973 13.908 9.21799C13.7516 9.1383 13.5274 9.07337 13.089 9.03755C12.6389 9.00078 12.0566 9 11.2 9H7.8C6.94342 9 6.36113 9.00078 5.91104 9.03755Z",fill:"currentColor"})}),MFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M10.556 4a1 1 0 0 0-.97.751l-.292 1.14h5.421l-.293-1.14A1 1 0 0 0 13.453 4h-2.897Zm6.224 1.892-.421-1.639A3 3 0 0 0 13.453 2h-2.897A3 3 0 0 0 7.65 4.253l-.421 1.639H4a1 1 0 1 0 0 2h.1l1.215 11.425A3 3 0 0 0 8.3 22h7.4a3 3 0 0 0 2.984-2.683l1.214-11.425H20a1 1 0 1 0 0-2h-3.22Zm1.108 2H6.112l1.192 11.214A1 1 0 0 0 8.3 20h7.4a1 1 0 0 0 .995-.894l1.192-11.214ZM10 10a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Zm4 0a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),LFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M3 12a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm7 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm7 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0Z"})}),$Fe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 10 16",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.34151 0.747423C4.71854 0.417526 5.28149 0.417526 5.65852 0.747423L9.65852 4.24742C10.0742 4.61111 10.1163 5.24287 9.75259 5.6585C9.38891 6.07414 8.75715 6.11626 8.34151 5.75258L5.00001 2.82877L1.65852 5.75258C1.24288 6.11626 0.61112 6.07414 0.247438 5.6585C-0.116244 5.24287 -0.0741267 4.61111 0.34151 4.24742L4.34151 0.747423ZM0.246065 10.3578C0.608879 9.94139 1.24055 9.89795 1.65695 10.2608L5.00001 13.1737L8.34308 10.2608C8.75948 9.89795 9.39115 9.94139 9.75396 10.3578C10.1168 10.7742 10.0733 11.4058 9.65695 11.7687L5.65695 15.2539C5.28043 15.582 4.7196 15.582 4.34308 15.2539L0.343082 11.7687C-0.0733128 11.4058 -0.116749 10.7742 0.246065 10.3578Z"})}),FFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M16.793 2.793a3.121 3.121 0 1 1 4.414 4.414l-8.5 8.5A1 1 0 0 1 12 16H9a1 1 0 0 1-1-1v-3a1 1 0 0 1 .293-.707l8.5-8.5Zm3 1.414a1.121 1.121 0 0 0-1.586 0L10 12.414V14h1.586l8.207-8.207a1.121 1.121 0 0 0 0-1.586ZM6 5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-4a1 1 0 1 1 2 0v4a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h4a1 1 0 1 1 0 2H6Z",clipRule:"evenodd"})}),BFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M12 7a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0V8h-3a1 1 0 0 1-1-1Zm-5 5a1 1 0 0 1 1 1v3h3a1 1 0 1 1 0 2H7a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),UFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8-10C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm4.465 6.763a1 1 0 0 0-1.228-1.228l-5.5 1.5a1 1 0 0 0-.702.702l-1.5 5.5a1 1 0 0 0 1.228 1.228l5.5-1.5a1 1 0 0 0 .702-.702l1.5-5.5Zm-6.54 5.312.89-3.26 3.26-.89-.89 3.26-3.26.89Z",clipRule:"evenodd"})}),QFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M14.4472 7.10558C14.9412 7.35257 15.1414 7.95324 14.8944 8.44722L10.8944 16.4472C10.6474 16.9412 10.0468 17.1414 9.55279 16.8944C9.05881 16.6474 8.85858 16.0468 9.10557 15.5528L13.1056 7.55279C13.3526 7.05881 13.9532 6.85859 14.4472 7.10558ZM6.6 7.20001C7.04183 7.53138 7.13137 8.15818 6.8 8.60001L4.25 12L6.8 15.4C7.13137 15.8418 7.04183 16.4686 6.6 16.8C6.15817 17.1314 5.53137 17.0418 5.2 16.6L2.2 12.6C1.93333 12.2444 1.93333 11.7556 2.2 11.4L5.2 7.40001C5.53137 6.95818 6.15817 6.86863 6.6 7.20001ZM17.4 7.20001C17.8418 6.86863 18.4686 6.95818 18.8 7.40001L21.8 11.4C22.0667 11.7556 22.0667 12.2444 21.8 12.6L18.8 16.6C18.4686 17.0418 17.8418 17.1314 17.4 16.8C16.9582 16.4686 16.8686 15.8418 17.2 15.4L19.75 12L17.2 8.60001C16.8686 8.15818 16.9582 7.53138 17.4 7.20001Z",fill:"currentColor"})}),bbe=e=>o.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[o.jsx("path",{d:"M13 12a1 1 0 1 0-2 0v4a1 1 0 1 0 2 0v-4Zm-1-2.5A1.25 1.25 0 1 0 12 7a1.25 1.25 0 0 0 0 2.5Z"}),o.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z",clipRule:"evenodd"})]}),zFe=e=>o.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[o.jsx("path",{d:"M7.79289 9.04289C8.18342 8.65237 8.81658 8.65237 9.20711 9.04289L11.4571 11.2929C11.8476 11.6834 11.8476 12.3166 11.4571 12.7071L9.20711 14.9571C8.81658 15.3476 8.18342 15.3476 7.79289 14.9571C7.40237 14.5666 7.40237 13.9334 7.79289 13.5429L9.33579 12L7.79289 10.4571C7.40237 10.0666 7.40237 9.43342 7.79289 9.04289ZM12.25 14.25C12.25 13.6977 12.6977 13.25 13.25 13.25H15.5C16.0523 13.25 16.5 13.6977 16.5 14.25C16.5 14.8023 16.0523 15.25 15.5 15.25H13.25C12.6977 15.25 12.25 14.8023 12.25 14.25Z",fill:"currentColor"}),o.jsx("path",{d:"M2 8C2 5.79086 3.79086 4 6 4C6.55228 4 7 4.44772 7 5C7 5.55228 6.55228 6 6 6C4.89543 6 4 6.89543 4 8V16C4 17.1046 4.89543 18 6 18C6.55228 18 7 18.4477 7 19C7 19.5523 6.55228 20 6 20C3.79086 20 2 18.2091 2 16V8ZM17 5C17 4.44772 17.4477 4 18 4C20.2091 4 22 5.79086 22 8V16C22 18.2091 20.2091 20 18 20C17.4477 20 17 19.5523 17 19C17 18.4477 17.4477 18 18 18C19.1046 18 20 17.1046 20 16V8C20 6.89543 19.1046 6 18 6C17.4477 6 17 5.55228 17 5Z",fill:"currentColor"})]}),VFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M6 12C6 11.4477 6.44772 11 7 11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H7C6.44772 13 6 12.5523 6 12Z",fill:"currentColor"})}),HFe=e=>o.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[o.jsx("path",{d:"M12.75 9.50001C12.75 9.08579 13.0858 8.75001 13.5 8.75001H14.5C14.9142 8.75001 15.25 9.08579 15.25 9.50001V14.5C15.25 14.9142 14.9142 15.25 14.5 15.25H13.5C13.0858 15.25 12.75 14.9142 12.75 14.5V9.50001Z",fill:"currentColor"}),o.jsx("path",{d:"M9.50001 8.75001C9.08579 8.75001 8.75001 9.08579 8.75001 9.50001V14.5C8.75001 14.9142 9.08579 15.25 9.50001 15.25H10.5C10.9142 15.25 11.25 14.9142 11.25 14.5V9.50001C11.25 9.08579 10.9142 8.75001 10.5 8.75001H9.50001Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.97144 12C1.97144 6.46138 6.46138 1.97144 12 1.97144C17.5386 1.97144 22.0286 6.46138 22.0286 12C22.0286 17.5386 17.5386 22.0286 12 22.0286C6.46138 22.0286 1.97144 17.5386 1.97144 12ZM12 4.02858C7.59751 4.02858 4.02858 7.59751 4.02858 12C4.02858 16.4025 7.59751 19.9714 12 19.9714C16.4025 19.9714 19.9714 16.4025 19.9714 12C19.9714 7.59751 16.4025 4.02858 12 4.02858Z",fill:"currentColor"})]}),yW=e=>o.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[o.jsx("path",{d:"M9.5 9.33165V14.6683C9.5 15.4595 10.3752 15.9373 11.0408 15.5095L15.1915 12.8412C15.8038 12.4475 15.8038 11.5524 15.1915 11.1588L11.0408 8.49047C10.3752 8.06265 9.5 8.54049 9.5 9.33165Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12Z",fill:"currentColor"})]}),qFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M8 16.7229V7.27711C8 6.29075 9.08894 5.69298 9.9211 6.22254L17.3428 10.9454C18.1147 11.4366 18.1147 12.5634 17.3428 13.0546L9.92109 17.7775C9.08894 18.3071 8 17.7093 8 16.7229Z",fill:"currentColor"})}),ybe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M12 5a1 1 0 0 1 1 1v5h5a1 1 0 1 1 0 2h-5v5a1 1 0 1 1-2 0v-5H6a1 1 0 1 1 0-2h5V6a1 1 0 0 1 1-1Z",clipRule:"evenodd"})}),vbe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M12 3C12.5523 3 13 3.44772 13 4L13 11H20C20.5523 11 21 11.4477 21 12C21 12.5523 20.5523 13 20 13L13 13L13 20C13 20.5523 12.5523 21 12 21C11.4477 21 11 20.5523 11 20L11 13L4 13C3.44772 13 3 12.5523 3 12C3 11.4477 3.44772 11 4 11L11 11L11 4C11 3.44772 11.4477 3 12 3Z",fill:"currentColor"})}),WFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M12 6C12.5523 6 13 6.44772 13 7V11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H13V17C13 17.5523 12.5523 18 12 18C11.4477 18 11 17.5523 11 17V13H7C6.44772 13 6 12.5523 6 12C6 11.4477 6.44772 11 7 11H11V7C11 6.44772 11.4477 6 12 6Z",fill:"currentColor"})}),GFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.875 4.5C7.35418 4.5 4.5 7.35418 4.5 10.875C4.5 14.3958 7.35418 17.25 10.875 17.25C14.3958 17.25 17.25 14.3958 17.25 10.875C17.25 7.35418 14.3958 4.5 10.875 4.5ZM2.5 10.875C2.5 6.24962 6.24962 2.5 10.875 2.5C15.5004 2.5 19.25 6.24962 19.25 10.875C19.25 12.8273 18.582 14.6236 17.462 16.0478L21.2071 19.7929C21.5976 20.1834 21.5976 20.8166 21.2071 21.2071C20.8166 21.5976 20.1834 21.5976 19.7929 21.2071L16.0478 17.462C14.6236 18.582 12.8273 19.25 10.875 19.25C6.24962 19.25 2.5 15.5004 2.5 10.875Z",fill:"currentColor"})}),KFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M11.2929 3.29289C11.6834 2.90237 12.3166 2.90237 12.7071 3.29289L16.7071 7.29289C17.0976 7.68342 17.0976 8.31658 16.7071 8.70711C16.3166 9.09763 15.6834 9.09763 15.2929 8.70711L13 6.41421V15C13 15.5523 12.5523 16 12 16C11.4477 16 11 15.5523 11 15V6.41421L8.70711 8.70711C8.31658 9.09763 7.68342 9.09763 7.29289 8.70711C6.90237 8.31658 6.90237 7.68342 7.29289 7.29289L11.2929 3.29289ZM4 14C4.55229 14 5 14.4477 5 15V15.2C5 16.0566 5.00078 16.6389 5.03755 17.089C5.07337 17.5274 5.1383 17.7516 5.21799 17.908C5.40973 18.2843 5.7157 18.5903 6.09202 18.782C6.24842 18.8617 6.47262 18.9266 6.91104 18.9624C7.36113 18.9992 7.94342 19 8.8 19H15.2C16.0566 19 16.6389 18.9992 17.089 18.9624C17.5274 18.9266 17.7516 18.8617 17.908 18.782C18.2843 18.5903 18.5903 18.2843 18.782 17.908C18.8617 17.7516 18.9266 17.5274 18.9624 17.089C18.9992 16.6389 19 16.0566 19 15.2V15C19 14.4477 19.4477 14 20 14C20.5523 14 21 14.4477 21 15V15.2413C21 16.0463 21 16.7106 20.9558 17.2518C20.9099 17.8139 20.8113 18.3306 20.564 18.816C20.1805 19.5686 19.5686 20.1805 18.816 20.564C18.3306 20.8113 17.8139 20.9099 17.2518 20.9558C16.7106 21 16.0463 21 15.2413 21H8.75868C7.95372 21 7.28936 21 6.74817 20.9558C6.18608 20.9099 5.66937 20.8113 5.18404 20.564C4.43139 20.1805 3.81947 19.5686 3.43597 18.816C3.18868 18.3306 3.09012 17.8139 3.04419 17.2518C2.99998 16.7106 2.99999 16.0463 3 15.2413L3 15C3 14.4477 3.44772 14 4 14Z",fill:"currentColor"})}),XFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M6 8C6 6.89543 6.89543 6 8 6H16C17.1046 6 18 6.89543 18 8V16C18 17.1046 17.1046 18 16 18H8C6.89543 18 6 17.1046 6 16V8Z",fill:"currentColor"})}),YFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M14.5 4a5.5 5.5 0 0 0-5.078 7.616 1 1 0 0 1-.216 1.092l-4.749 4.75a1.475 1.475 0 0 0 2.086 2.085l4.749-4.749a1 1 0 0 1 1.092-.216A5.5 5.5 0 0 0 20 9.414l-1.293 1.293a3.828 3.828 0 1 1-5.414-5.414L14.585 4H14.5ZM7 9.5a7.5 7.5 0 0 1 9.969-7.084 1 1 0 0 1 .378 1.651l-2.64 2.64a1.829 1.829 0 0 0 2.586 2.586l2.64-2.64a1 1 0 0 1 1.651.378 7.5 7.5 0 0 1-9.328 9.627l-4.299 4.3a3.475 3.475 0 0 1-4.914-4.915l4.299-4.299A7.497 7.497 0 0 1 7 9.5Z"})}),K2=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{d:"M8.99805 16.796C8.99805 15.4164 7.87961 14.2979 6.5 14.2979C5.12039 14.2979 4.00195 15.4164 4.00195 16.796C4.00196 18.1756 5.1204 19.294 6.5 19.294C7.8796 19.294 8.99804 18.1756 8.99805 16.796ZM19.748 15.0479C19.748 14.7729 19.525 14.5499 19.25 14.5499H15.75C15.475 14.5499 15.252 14.7729 15.252 15.0479V18.5479C15.252 18.823 15.475 19.046 15.75 19.046H19.25C19.525 19.046 19.748 18.823 19.748 18.5479V15.0479ZM10.0469 3.45125C11.077 2.15921 13.0849 2.20276 14.0498 3.58113L16.4189 6.96492L16.5205 7.12215C17.5046 8.76341 16.3301 10.9023 14.3691 10.9024H9.63086C7.60676 10.9023 6.42029 8.62316 7.58105 6.96492L9.9502 3.58113L10.0469 3.45125ZM12.4082 4.73055C12.2223 4.46497 11.842 4.44826 11.6318 4.68074L11.5918 4.73055L9.22266 8.11433C8.99176 8.44435 9.22808 8.89744 9.63086 8.89754H14.3691C14.7468 8.89745 14.9774 8.49957 14.8145 8.17781L14.7773 8.11433L12.4082 4.73055ZM11.002 16.796C11.0019 19.2824 8.98638 21.2979 6.5 21.2979C4.01362 21.2979 1.99806 19.2824 1.99805 16.796C1.99805 14.3096 4.01361 12.294 6.5 12.294C8.98639 12.294 11.002 14.3096 11.002 16.796ZM21.752 18.5479C21.752 19.9297 20.6318 21.0499 19.25 21.0499H15.75C14.3682 21.0499 13.248 19.9297 13.248 18.5479V15.0479C13.2481 13.6662 14.3682 12.546 15.75 12.546H19.25C20.6318 12.546 21.7519 13.6662 21.752 15.0479V18.5479Z",fill:"currentColor"})}),ZFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5555 4C10.099 4 9.70052 4.30906 9.58693 4.75114L9.29382 5.8919H14.715L14.4219 4.75114C14.3083 4.30906 13.9098 4 13.4533 4H10.5555ZM16.7799 5.8919L16.3589 4.25342C16.0182 2.92719 14.8226 2 13.4533 2H10.5555C9.18616 2 7.99062 2.92719 7.64985 4.25342L7.22886 5.8919H4C3.44772 5.8919 3 6.33961 3 6.8919C3 7.44418 3.44772 7.8919 4 7.8919H4.10069L5.31544 19.3172C5.47763 20.8427 6.76455 22 8.29863 22H15.7014C17.2354 22 18.5224 20.8427 18.6846 19.3172L19.8993 7.8919H20C20.5523 7.8919 21 7.44418 21 6.8919C21 6.33961 20.5523 5.8919 20 5.8919H16.7799ZM17.888 7.8919H6.11196L7.30423 19.1057C7.3583 19.6142 7.78727 20 8.29863 20H15.7014C16.2127 20 16.6417 19.6142 16.6958 19.1057L17.888 7.8919ZM10 10C10.5523 10 11 10.4477 11 11V16C11 16.5523 10.5523 17 10 17C9.44772 17 9 16.5523 9 16V11C9 10.4477 9.44772 10 10 10ZM14 10C14.5523 10 15 10.4477 15 11V16C15 16.5523 14.5523 17 14 17C13.4477 17 13 16.5523 13 16V11C13 10.4477 13.4477 10 14 10Z"})}),JFe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M7.5 5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5ZM3 7.5a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM17 6a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm-4 2a4 4 0 1 1 8 0 4 4 0 0 1-8 0Zm-8.96 8.247C3.137 17.048 2.5 18.271 2.5 20a1 1 0 1 1-2 0c0-2.271.862-4.049 2.21-5.248C4.042 13.57 5.788 13 7.5 13s3.459.57 4.79 1.752c1.348 1.2 2.21 2.977 2.21 5.248a1 1 0 1 1-2 0c0-1.729-.638-2.952-1.54-3.753C10.042 15.43 8.788 15 7.5 15s-2.541.43-3.46 1.247Zm15.757-.607c-1.009-.638-2.338-.807-3.526-.472a1 1 0 0 1-.542-1.925c1.695-.478 3.616-.255 5.136.706 1.558.984 2.635 2.707 2.635 5.051a1 1 0 1 1-2 0c0-1.665-.732-2.746-1.703-3.36Z",clipRule:"evenodd"})}),xbe=e=>o.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[o.jsx("path",{d:"M10.42 2.006a4 4 0 0 1 3.159 0c.674.29 1.188.822 1.667 1.456.474.627 1 1.473 1.653 2.523l3.542 5.696c.72 1.16 1.3 2.09 1.682 2.854.384.766.654 1.517.59 2.292a4 4 0 0 1-1.604 2.886c-.625.463-1.405.63-2.258.709-.85.078-1.945.078-3.311.078H8.46c-1.366 0-2.46 0-3.31-.078-.854-.078-1.634-.246-2.26-.71a4 4 0 0 1-1.603-2.885c-.064-.775.206-1.526.59-2.292.383-.764.961-1.694 1.682-2.854l3.542-5.696c.653-1.05 1.18-1.896 1.653-2.523.48-.634.993-1.166 1.667-1.456Zm2.37 1.838a2 2 0 0 0-1.58 0c-.192.083-.448.28-.86.825-.413.544-.891 1.312-1.577 2.415l-3.488 5.61c-.755 1.214-1.283 2.066-1.62 2.737-.34.678-.402 1.02-.385 1.232a2 2 0 0 0 .802 1.443c.171.127.494.255 1.25.324.748.069 1.75.07 3.18.07h6.976c1.43 0 2.432-.001 3.18-.07.756-.069 1.079-.197 1.25-.324a2 2 0 0 0 .802-1.443c.017-.212-.045-.554-.385-1.232-.337-.671-.865-1.523-1.62-2.737l-3.488-5.61c-.686-1.103-1.164-1.87-1.576-2.415-.413-.546-.67-.742-.861-.825"}),o.jsx("path",{d:"M12 7.5a1 1 0 0 1 1 1v3a1 1 0 1 1-2 0v-3a1 1 0 0 1 1-1M10.851 15a1.15 1.15 0 1 1 2.3 0 1.15 1.15 0 0 1-2.3 0"})]}),PF=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M5.636 5.636a1 1 0 0 1 1.414 0l4.95 4.95 4.95-4.95a1 1 0 0 1 1.414 1.414L13.414 12l4.95 4.95a1 1 0 0 1-1.414 1.414L12 13.414l-4.95 4.95a1 1 0 0 1-1.414-1.414l4.95-4.95-4.95-4.95a1 1 0 0 1 0-1.414Z",clipRule:"evenodd"})});/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -434,7 +434,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 Ba=hn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),wW="veadk_auth_qs",M7e=new Set(["view","source","sessionId","artifactSha256","validationReportSha256","projectId","versionId"]);let M1=null;function L7e(){if(M1!==null)return M1;const e=new URLSearchParams(window.location.search),t=new URLSearchParams,n=new URLSearchParams,i=e.get("view")==="runtime-deploy"&&e.get("source")==="intelligent-development";e.forEach((s,a)=>{(i&&M7e.has(a)?n:t).append(a,s)});const r=t.toString();if(r?(sessionStorage.setItem(wW,r),M1=r):M1=sessionStorage.getItem(wW)??"",r){const s=n.toString();window.history.replaceState(null,"",window.location.pathname+(s?`?${s}`:"")+window.location.hash)}return M1}function Bo(e){const t=L7e();if(!t)return e;const n=new URL(e,window.location.origin);return new URLSearchParams(t).forEach((i,r)=>{n.searchParams.has(r)||n.searchParams.set(r,i)}),/^https?:\/\//i.test(e)?n.toString():n.pathname+n.search+n.hash}function V(e,t={}){return sn.t(e,{...t,ns:"adk"})}function Hu(e){const t=new Headers(e);return t.has("Accept-Language")||t.set("Accept-Language",sn.resolvedLanguage||sn.language),t}function $7e(){return sn.resolvedLanguage||sn.language}const Wo=3e4,is=12e4,$F=1e4;function Ol(e,t=Wo){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const D_="veadk_local_user",M_="veadk_local_user_tab",F7e="X-VeADK-OAuth-Refresh-Retry",B7e=[50,250],U7e=/^[A-Za-z0-9]{1,16}$/;function _be(){try{const e=sessionStorage.getItem(M_);if(e)return e;const t=localStorage.getItem(D_);return t&&sessionStorage.setItem(M_,t),t}catch{try{return localStorage.getItem(D_)}catch{return null}}}function OW(e){try{sessionStorage.setItem(M_,e)}catch{}try{localStorage.setItem(D_,e)}catch{}}function Q7e(){try{sessionStorage.removeItem(M_)}catch{}try{localStorage.removeItem(D_)}catch{}}function Dh(e){const t=new Headers(e),n=_be();return n&&t.set("X-VeADK-Local-User",n),t}async function Nbe(){let e;try{e=await fetch("/web/auth-config",{headers:Hu({Accept:"application/json"}),signal:Ol(void 0,$F)})}catch(t){throw console.warn("[identity] /web/auth-config is unreachable:",t),new Error(V("identity.loadConfigNetworkFailed"))}if(!e.ok)throw new Error(V("identity.configServiceFailed",{status: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(V("identity.invalidConfigResponse"))}}function z7e(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function V7e(){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 H7e(){const[e,t]=await Promise.all([h4(),Nbe()]);return e.status==="unauthenticated"&&t.length>0}function q7e(){window.location.assign("/oauth2/logout")}async function W7e(){for(let e=0;;e+=1){let t;try{t=await fetch("/oauth2/userinfo",{headers:Hu({Accept:"application/json"}),signal:Ol(void 0,$F)})}catch(i){throw console.warn("[identity] /oauth2/userinfo is unreachable:",i),new Error(V("identity.serviceNetworkFailed"))}const n=B7e[e];if(t.status!==401||t.headers.get(F7e)!=="1"||n===void 0)return t;await new Promise(i=>window.setTimeout(i,n))}}async function h4(){const e=await W7e();if(e.ok){let n;try{n=await e.json()}catch(r){throw console.warn("[identity] /oauth2/userinfo returned a non-JSON response:",r),new Error(V("identity.invalidServiceResponse"))}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(V("identity.serviceFailed",{status:e.status}));const t=_be();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function G7e(e){if(!e)return"";for(const t of[e.name,e.preferred_username,e.username,e.email])if(typeof t=="string"&&t.trim())return t.trim();return""}function K7e(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const p4="veadk:authentication-required";let yO=null,Nw=null;function X7e(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 Y7e(e){yO||(yO=new Promise(n=>{Nw=n}),window.dispatchEvent(new Event(p4)));const t=yO;return e?e.aborted?Promise.reject(e.reason??new Error("Request aborted")):new Promise((n,i)=>{const r=()=>i(e.reason??new Error("Request aborted"));e.addEventListener("abort",r,{once:!0}),t.then(()=>{e.removeEventListener("abort",r),n()},s=>{e.removeEventListener("abort",r),i(s)})}):t}function Z7e(){return yO!==null}function J7e(){Nw==null||Nw(),Nw=null,yO=null}async function Jj(e,t){var i;const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{const r=((i=e.headers.get("content-type"))==null?void 0:i.split(";",1)[0])||V("common.contentTypeMissing"),s=n.trim().slice(0,2e3),a=s?` + */const Ba=hn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),wW="veadk_auth_qs",M7e=new Set(["view","source","sessionId","artifactSha256","validationReportSha256","projectId","versionId"]);let M1=null;function L7e(){if(M1!==null)return M1;const e=new URLSearchParams(window.location.search),t=new URLSearchParams,n=new URLSearchParams,i=e.get("view")==="runtime-deploy"&&e.get("source")==="intelligent-development";e.forEach((s,a)=>{(i&&M7e.has(a)?n:t).append(a,s)});const r=t.toString();if(r?(sessionStorage.setItem(wW,r),M1=r):M1=sessionStorage.getItem(wW)??"",r){const s=n.toString();window.history.replaceState(null,"",window.location.pathname+(s?`?${s}`:"")+window.location.hash)}return M1}function Bo(e){const t=L7e();if(!t)return e;const n=new URL(e,window.location.origin);return new URLSearchParams(t).forEach((i,r)=>{n.searchParams.has(r)||n.searchParams.set(r,i)}),/^https?:\/\//i.test(e)?n.toString():n.pathname+n.search+n.hash}function V(e,t={}){return ln.t(e,{...t,ns:"adk"})}function Hu(e){const t=new Headers(e);return t.has("Accept-Language")||t.set("Accept-Language",ln.resolvedLanguage||ln.language),t}function $7e(){return ln.resolvedLanguage||ln.language}const Wo=3e4,is=12e4,$F=1e4;function Ol(e,t=Wo){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const D_="veadk_local_user",M_="veadk_local_user_tab",F7e="X-VeADK-OAuth-Refresh-Retry",B7e=[50,250],U7e=/^[A-Za-z0-9]{1,16}$/;function _be(){try{const e=sessionStorage.getItem(M_);if(e)return e;const t=localStorage.getItem(D_);return t&&sessionStorage.setItem(M_,t),t}catch{try{return localStorage.getItem(D_)}catch{return null}}}function OW(e){try{sessionStorage.setItem(M_,e)}catch{}try{localStorage.setItem(D_,e)}catch{}}function Q7e(){try{sessionStorage.removeItem(M_)}catch{}try{localStorage.removeItem(D_)}catch{}}function Dh(e){const t=new Headers(e),n=_be();return n&&t.set("X-VeADK-Local-User",n),t}async function Nbe(){let e;try{e=await fetch("/web/auth-config",{headers:Hu({Accept:"application/json"}),signal:Ol(void 0,$F)})}catch(t){throw console.warn("[identity] /web/auth-config is unreachable:",t),new Error(V("identity.loadConfigNetworkFailed"))}if(!e.ok)throw new Error(V("identity.configServiceFailed",{status: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(V("identity.invalidConfigResponse"))}}function z7e(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function V7e(){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 H7e(){const[e,t]=await Promise.all([h4(),Nbe()]);return e.status==="unauthenticated"&&t.length>0}function q7e(){window.location.assign("/oauth2/logout")}async function W7e(){for(let e=0;;e+=1){let t;try{t=await fetch("/oauth2/userinfo",{headers:Hu({Accept:"application/json"}),signal:Ol(void 0,$F)})}catch(i){throw console.warn("[identity] /oauth2/userinfo is unreachable:",i),new Error(V("identity.serviceNetworkFailed"))}const n=B7e[e];if(t.status!==401||t.headers.get(F7e)!=="1"||n===void 0)return t;await new Promise(i=>window.setTimeout(i,n))}}async function h4(){const e=await W7e();if(e.ok){let n;try{n=await e.json()}catch(r){throw console.warn("[identity] /oauth2/userinfo returned a non-JSON response:",r),new Error(V("identity.invalidServiceResponse"))}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(V("identity.serviceFailed",{status:e.status}));const t=_be();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function G7e(e){if(!e)return"";for(const t of[e.name,e.preferred_username,e.username,e.email])if(typeof t=="string"&&t.trim())return t.trim();return""}function K7e(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const p4="veadk:authentication-required";let yO=null,Nw=null;function X7e(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 Y7e(e){yO||(yO=new Promise(n=>{Nw=n}),window.dispatchEvent(new Event(p4)));const t=yO;return e?e.aborted?Promise.reject(e.reason??new Error("Request aborted")):new Promise((n,i)=>{const r=()=>i(e.reason??new Error("Request aborted"));e.addEventListener("abort",r,{once:!0}),t.then(()=>{e.removeEventListener("abort",r),n()},s=>{e.removeEventListener("abort",r),i(s)})}):t}function Z7e(){return yO!==null}function J7e(){Nw==null||Nw(),Nw=null,yO=null}async function Jj(e,t){var i;const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{const r=((i=e.headers.get("content-type"))==null?void 0:i.split(";",1)[0])||V("common.contentTypeMissing"),s=n.trim().slice(0,2e3),a=s?` ${V("common.response",{response:s})}`:"";throw new Error(V("jsonResponse.nonJson",{fallback:t,status:e.status,contentType:r,detail:a}))}}const eBe=/\brun_sse\s*failed\s*:\s*404\b/i,tBe=/session not found/i,nBe=/(?:^|[::\s])not found\s*$/i,iBe=/Expecting (?:'[^']+'|\w+)(?: delimiter)?: line \d+ column \d+ \(char \d+\)/i,rBe=/Unknown or expired collection_id\s+'[^']+'\.\s*Call collect_resources first\./i,sBe=/(?:RateLimitError|\bTPM\b|\bRPM\b|tokens? per minute|requests? per minute)[\s\S]*(?:\b429\b|limit|quota)|\b429\b[\s\S]*(?:model|RateLimitError|\bTPM\b|\bRPM\b)/i;function N0(e,t){return e.includes(t)?e:`${e} ${t}`}function Df(e){const t=String(e),n=V("runSse.rawResponseLabel");let i=t.includes(n)?t:`${n}${t}`;if(iBe.test(t))i=N0(i,V("runSse.toolArgumentHint"));else{if(rBe.test(t))return N0(i,V("runSse.resourceCollectionExpiredHint"));if(sBe.test(t))return N0(i,V("runSse.modelQuotaHint"));eBe.test(t)&&(tBe.test(t)?i=N0(i,V("runSse.persistentMemoryHint")):nBe.test(t)&&(i=N0(i,V("runSse.unsupportedRouteHint"))))}return N0(i,V("runSse.networkConfigurationHint"))}async function*eR(e){if(!e.body)throw new Error("Response has no body");const t=e.body.getReader(),n=new TextDecoder;let i="";const r=a=>a.length>500?V("sse.truncatedData",{data:a.slice(0,500),count:a.length}):a,s=(a,l=!1)=>{const c=a.split(/\r?\n/).filter(u=>u.startsWith("data:")).map(u=>u.slice(5).trimStart()).join(` @@ -447,8 +447,8 @@ ${i.detail}`;if(i.detail&&typeof i.detail=="object"){const r=i.detail;if(typeof ${JSON.stringify(i,null,2)}`}catch{return`${t} -${n}`}}async function*fBe({runtimeId:e,region:t,instanceName:n,sessionId:i,follow:r=!0,signal:s}){const a=new URLSearchParams({region:t,follow:String(r)});n&&a.set("instance_name",n),i&&a.set("session_id",i);const l=await fetch(Bo(`/web/runtime-logs/${encodeURIComponent(e)}/stream?${a.toString()}`),{headers:Hu(Dh({Accept:"text/event-stream"})),cache:"no-store",signal:s});if(!l.ok)throw new Error(V("runtimeLogs.loadFailedWithDetail",{detail:await dBe(l)}));for await(const c of eR(l)){if(!uBe(c))throw new Error(V("runtimeLogs.invalidFormat"));yield c}}const hBe=255,pBe=/[\p{L}\p{M}\p{N}\p{P}\p{Zs}]/u;function mBe(e){const t=e.normalize("NFKC").replace(/\s+/gu," ").trim(),n=new TextEncoder;let i=0,r="";for(const s of t){if(!pBe.test(s))continue;const a=n.encode(s).byteLength;if(i+a>hBe)break;r+=s,i+=a}return r.replace(/ +/g," ").trimEnd()}const gBe=/RunPipeline result could not be reconciled|Polling build status failed/i;class jw extends Error{constructor({taskId:n,cause:i}={}){super("The deployment request may still be running, but its status could not be confirmed.");ki(this,"taskId");this.name="DeploymentStatusUnconfirmedError",this.taskId=n}}function Rbe(e){if(e instanceof jw)return!0;const t=e instanceof Error?e.message:String(e??"");return gBe.test(t)}function kW(e){return!!(e&&typeof e=="object"&&"name"in e&&e.name==="AbortError")}const m4="ap-southeast-1",FF="cn-beijing",bBe="https://ark.ap-southeast.bytepluses.com/api/v3",yBe="https://ark.cn-beijing.volces.com/api/v3/",vBe="https://console.byteplus.com/ark/region:ark+ap-southeast-1/openManagement",xBe="https://console.volcengine.com/ark/region:ark+cn-beijing/openManagement",wBe="dola-seed-2-1-turbo-260628",OBe="doubao-seed-2-1-pro-260628",SBe="skylark-embedding-vision-250615",kBe="doubao-embedding-vision-250615",EBe="seed-2-0-lite-260228",CBe="doubao-seed-2-0-lite-260428",TBe="dola-seedream-5-0-pro-260628",ABe="doubao-seedream-5-0-260128",_Be="seededit-3-0-i2i-250628",NBe="doubao-seededit-3-0-i2i-250628",jBe="dreamina-seedance-2-0-260128",RBe="doubao-seedance-2-0-260128";function Iu(e){return e==="byteplus"?[{value:m4,label:m4}]:[{value:"cn-beijing",label:V("cloudRegion.cnBeijing")},{value:"cn-shanghai",label:V("cloudRegion.cnShanghai")}]}function Ji(e){var t;return((t=Iu(e)[0])==null?void 0:t.value)||FF}const IBe=new Set(["cn-beijing","cn-shanghai","ap-southeast-1"]);function tR(e){return typeof e=="string"&&IBe.has(e)}function xh(e,t){var i;return((i=(t?Iu(t):[...Iu("volcengine"),...Iu("byteplus")]).find(r=>r.value===e))==null?void 0:i.label)||e||"-"}function wh(e){return e==="byteplus"?wBe:OBe}function xl(e){return e==="byteplus"?bBe:yBe}function PBe(e){return e==="byteplus"?vBe:xBe}function DBe(e){return e==="byteplus"?SBe:kBe}function MBe(e){return e==="byteplus"?EBe:CBe}function LBe(e){return e==="byteplus"?TBe:ABe}function $Be(e){return e==="byteplus"?_Be:NBe}function FBe(e){return e==="byteplus"?jBe:RBe}const BF="veadk.messageFeedback.v1";function UF(e,t,n,i){return[e,t,n,i].join(":")}function QF(){if(typeof window>"u")return{};try{const e=JSON.parse(localStorage.getItem(BF)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function BBe(e,t,n){if(typeof window>"u")return;const i=QF();i[e]={...i[e]??{},[`veadk_feedback:${t}`]:n},localStorage.setItem(BF,JSON.stringify(i))}function Ibe(e){if(typeof window>"u")return;const t=UF(e.runtimeId,e.appName,e.userId,e.sessionId),n=QF(),i=n[t];if(i){for(const r of e.eventIds)delete i[`veadk_feedback:${r}`];Object.keys(i).length===0?delete n[t]:n[t]=i,localStorage.setItem(BF,JSON.stringify(n))}}const Z2="",zF=new Map;function Pbe(e,t){zF.set(e,t)}function Dbe(){zF.clear()}function Sl(e){const t=zF.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 Et(e,t={},n={},i=Wo){const r=Ol(t.signal,i),s=!!n.runtimeId&&String(t.method??"GET").toUpperCase()==="DELETE",a={...t,...s?{method:"POST"}:{},headers:Hu(Dh(t.headers))},l=()=>{const d={...a,signal:r};if(n.runtimeId){const f=new URLSearchParams;n.region&&f.set("_runtime_region",n.region),n.retryProbe&&f.set("probe_retry","connect"),s&&f.set("_method","DELETE");const h=f.toString()?`${e.includes("?")?"&":"?"}${f.toString()}`:"";return fetch(Bo(`${Z2}/web/runtime-proxy/${n.runtimeId}${e}${h}`),d)}if(n.base){const f=new Headers(d.headers);return f.set("X-AgentKit-Base",n.base),n.apiKey&&f.set("X-AgentKit-Key",n.apiKey),fetch(Bo(`${Z2}/agentkit-proxy${e}`),{...d,headers:f})}return fetch(Bo(`${Z2}${e}`),d)},c=async d=>{if(X7e(d))return!0;if(d.status!==401)return!1;try{return await H7e()}catch{return!1}};let u=await l();for(;await c(u);)await Y7e(r),u=await l();return u}function Tn(e,t={},n=Wo){return Et(e,t,{},n)}function UBe(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>{var n;if(t&&typeof t=="object"&&"msg"in t){const i=Array.isArray(t.loc)?(n=t.loc)==null?void 0:n.join("."):"",r=String(t.msg??"");return i?`${i}: ${r}`:r}return String(t)}).filter(Boolean).join(` -`):e&&typeof e=="object"?JSON.stringify(e):""}async function an(e,t){const n=V("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),i=await e.text().catch(()=>"");if(!i)return n;try{const r=JSON.parse(i),s=UBe(r.detail??r.error);return s?V("client.errorWithDetailAndRawResponse",{context:n,detail:s,response:i}):V("client.errorWithRawResponse",{context:n,response:i})}catch{return V("client.errorWithRawResponse",{context:n,response:i})}}async function VF(e,t=!1){const n=await Et(`/web/model-api-keys${t?"?refresh=true":""}`,{signal:e,cache:"no-store"});if(!n.ok)throw new Error(await an(n,V("client.loadArkApiKeysFailed")));return await n.json()}async function Mbe(e,t){const n=await Et(`/web/model-api-keys/${encodeURIComponent(e)}/value`,{method:"POST",signal:t,cache:"no-store"});if(!n.ok)throw new Error(await an(n,V("client.loadArkApiKeysFailed")));return await n.json()}async function Ex(e){const t=new URLSearchParams;e!=null&&e.apiKeyId&&t.set("apiKeyId",e.apiKeyId),e!=null&&e.refresh&&t.set("refresh","true");const n=t.toString(),i=await Et(`/web/model-options${n?`?${n}`:""}`,{signal:e==null?void 0:e.signal,cache:"no-store"});if(!i.ok)throw new Error(await an(i,V("client.loadModelsFailed")));return await i.json()}async function Lbe(){const e=await Et("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class Cx extends Error{constructor(){super(V("client.runtimeAccessDenied")),this.name="RuntimeAccessDeniedError"}}class Ds extends Error{constructor(t,n=!1,i=!1){super(t),this.unsupported=n,this.retryable=i,this.name="RuntimeProbeError"}}const $be=()=>V("client.privateRuntimeUnavailable"),Fbe=()=>V("client.runtimeTemporarilyUnavailable"),EW=["cn-beijing","cn-shanghai"],QBe=3e4,Tx=5*60*1e3,Bbe=60*1e3;let gS="volcengine";const Xy=new Map,vg=new Map,xg=new Map,Su=new Map,kr=new Map;function HF(e,t,n){return`${t}:${e}:${n??""}`}function Ube(e){e!==gS&&kr.clear(),gS=e}function Qk(e){const t=(e||"").trim();if(gS==="byteplus")return[t&&!t.startsWith("cn-")?t:m4];const n=t&&!t.startsWith("ap-")?t:FF;return EW.includes(n)?[n,...EW.filter(i=>i!==n)]:[n]}function nR(e){const t=(e||"").trim();return t?[t]:Qk()}function qb(...e){return e.map(t=>String(t??"")).join("")}function Lm(e,t,n){const i=e.get(t);return i!=null&&i.value&&Date.now()-i.updatedAt<=n?i.value:null}function qF(e,t,n){return e.set(t,{value:n,updatedAt:Date.now()}),n}function ZC(e,t){return t?t.aborted?Promise.reject(new DOMException("The operation was aborted.","AbortError")):new Promise((n,i)=>{const r=()=>{i(new DOMException("The operation was aborted.","AbortError"))};t.addEventListener("abort",r,{once:!0}),e.then(s=>{t.removeEventListener("abort",r),n(s)},s=>{t.removeEventListener("abort",r),i(s)})}):e}async function Qbe(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function zk(e,t,n,i,r=Wo){const s=await Et("/list-apps",{signal:i},n??{base:e,apiKey:t},r),a=n!=null&&n.runtimeId?await Qbe(s):"";if(n!=null&&n.runtimeId&&a==="runtime_access_denied")throw new Cx;if(n!=null&&n.runtimeId&&a==="runtime_private_endpoint_unreachable")throw new Ds($be());if(n!=null&&n.runtimeId&&["runtime_proxy_connect_error","runtime_proxy_timeout","runtime_json_connect_error","runtime_json_timeout"].includes(a))throw new Ds(Fbe(),!1,!0);if(n!=null&&n.runtimeId&&s.status===404)throw new Ds(V("client.runtimeConnectionUnsupported"),!0,!0);if(n!=null&&n.runtimeId&&(s.status===401||s.status===403))throw new Ds(V("client.runtimeConnectionDenied"));if(!s.ok)throw new Error(await an(s,V("client.listAgentsFailed")));let l;try{l=await s.json()}catch{throw new Ds(V("client.invalidListAppsJson"))}if(!Array.isArray(l)||l.some(u=>typeof u!="string"||!u.trim()))throw new Ds(V("client.invalidListAppsFormat"));const c=l.map(u=>u.trim());return n!=null&&n.runtimeId&&Xy.set(HF(n.runtimeId,n.region??"",n.runtimeVersion),{apps:c,expiresAt:Date.now()+QBe}),c}async function zbe(e,t){const{app:n,ep:i}=Sl(e),r=await Et(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},i);if(!r.ok){const a=V("client.createSessionFailedWithStatus",{status:r.status}),l=await an(r,V("client.createSessionFailed"));throw new Error(l===a?a:V("common.fallbackWithDetail",{fallback:a,detail:l}))}return(await r.json()).id}async function WF(e,t){const{app:n,ep:i}=Sl(e),r=await Et(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},i);if(!r.ok)throw new Error(`list sessions failed: ${r.status}`);return r.json()}async function iR(e,t,n){const{app:i,ep:r}=Sl(e),s=await Et(`/apps/${i}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}`,{},r);if(!s.ok){const l=await an(s,V("client.getSessionFailed"));throw new Error(V("client.getSessionFailedWithDetail",{status:s.status,detail:l}))}const a=await s.json();if(r.runtimeId){const l=UF(r.runtimeId,i,t,n);a.state={...QF()[l]??{},...a.state??{}}}return a}async function Vbe(e){const{app:t,ep:n}=Sl(e.appName);if(!n.runtimeId)throw new Error(V("client.feedbackRuntimeOnly"));if(!n.region)throw new Error(V("client.feedbackRegionMissing"));const i=await Et("/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??""})},{},is);if(!i.ok)throw new Error(await an(i,V("client.submitFeedbackFailed")));const r=await i.json(),s=UF(n.runtimeId,t,e.userId,e.sessionId);return BBe(s,e.eventId,r),r}async function rR(e,t={}){const n=qb(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),i=Lm(Su,n,Bbe);if(!t.force&&i)return i;const r=Su.get(n);if(!t.force&&(r!=null&&r.promise))return r.promise;let s=null;const a=(async()=>{for(const l of nR(e.region)){const c=new URLSearchParams({runtimeId:e.runtimeId,region:l,appName:e.appName,page_size:String(e.pageSize??100)}),u=await Et(`/web/evaluation/feedback-cases?${c.toString()}`);if(u.ok)return qF(Su,n,await u.json());s=new Error(await an(u,V("client.loadEvaluationSetsFailed")))}throw s??new Error(V("client.loadEvaluationSetsFailed"))})();Su.set(n,{...r,promise:a,updatedAt:(r==null?void 0:r.updatedAt)??0});try{return await a}finally{const l=Su.get(n);(l==null?void 0:l.promise)===a&&Su.set(n,{value:l.value,updatedAt:l.updatedAt})}}async function g4(e){let t=null;for(const n of nR(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName,userId:e.userId}),r=await Et(`/web/evaluation/statuses?${i.toString()}`);if(r.ok)return r.json();t=new Error(await an(r,V("client.loadAutoEvaluationStatusFailed")))}throw t??new Error(V("client.loadAutoEvaluationStatusFailed"))}async function Hbe(e){let t=null;for(const n of nR(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName}),r=await Et(`/web/evaluation/optimizations?${i.toString()}`);if(r.ok)return r.json();t=new Error(await an(r,V("client.loadOptimizationsFailed")))}throw t??new Error(V("client.loadOptimizationsFailed"))}function qbe(e){return Lm(Su,qb(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),Bbe)}function zBe(e){rR(e).catch(()=>{})}function Wbe(e){rR(e,{force:!0}).catch(()=>{})}function Gbe(e,t){return["good","bad"].map(n=>{const i=e.find(r=>r.kind===n);return{kind:n,evaluationSetId:(i==null?void 0:i.evaluationSetId)??null,evaluationSetName:(i==null?void 0:i.evaluationSetName)??null,workspaceId:(i==null?void 0:i.workspaceId)??null,itemCount:t.filter(r=>r.kind===n).length}})}function J2(e){const t=e.comment??"",n=e.rating==="bad"&&!!t.trim();for(const[i,r]of Su.entries()){const s=r.value;if(!s||s.runtimeId!==e.runtimeId||s.agentName!==e.appName)continue;const a=s.items.filter(c=>c.sessionId!==e.sessionId||c.messageId!==e.messageId),l=e.rating?[{id:`local:${e.runtimeId}:${e.sessionId}:${e.messageId}`,itemKey:`local:${e.messageId}`,kind:e.rating,input:e.input,output:e.output,referenceOutput:e.referenceOutput??e.output,comment:t,agentName:e.appName,sessionId:e.sessionId,messageId:e.messageId,runtimeId:e.runtimeId,invocationId:e.invocationId??"",userId:e.userId,createdAt:e.createdAt??new Date().toISOString(),evaluationSetId:"",evaluationSetName:"",workspaceId:"",source:"user",score:n?0:null,reason:n?t:""},...a]:a;Su.set(i,{value:{...s,sets:Gbe(s.sets,l),items:l},updatedAt:Date.now(),promise:r.promise})}}async function Kbe(e){let t=null;for(const n of nR(e.region)){const i=await Et("/web/evaluation/feedback-cases/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,region:n,appName:e.appName,itemIds:e.itemIds})},{},is);if(i.ok){const r=await i.json(),s=new Set(e.itemIds);for(const[a,l]of Su.entries()){const c=l.value;if(!c||c.runtimeId!==e.runtimeId||c.agentName!==e.appName)continue;const u=c.items.filter(d=>!s.has(d.id));Su.set(a,{value:{...c,sets:Gbe(c.sets,u),items:u},updatedAt:Date.now()})}return r}t=new Error(await an(i,V("client.deleteEvaluationCaseFailed")))}throw t??new Error(V("client.deleteEvaluationCaseFailed"))}async function b4(e,t,n){const{app:i,ep:r}=Sl(e),s=await Et(`/apps/${i}/users/${encodeURIComponent(t)}/sessions/${n}`,{method:"DELETE"},r);if(!s.ok&&s.status!==404)throw new Error(`delete session failed: ${s.status}`)}function VBe(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"="),i=window.atob(n),r=new Uint8Array(i.length);for(let s=0;sURL.revokeObjectURL(l),0)}async function Xbe(e,t,n,i,r){const{app:s,ep:a}=Sl(e),l=r==null?"":`?version=${encodeURIComponent(r)}`,c=`/apps/${encodeURIComponent(s)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/artifacts/${encodeURIComponent(i)}${l}`,u=await Et(c,{},a,is);if(!u.ok)throw new Error(await an(u,V("client.downloadFileFailed")));const d=await u.json(),f=d.inlineData??d.inline_data;if(!(f!=null&&f.data))throw new Error(V("client.fileUnavailable"));const h=VBe(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??i}}async function KF(e,t,n,i,r){const{blob:s}=await Xbe(e,t,n,i,r);return URL.createObjectURL(s)}async function HBe(e){const t=await Et("/web/media/capabilities");if(!t.ok)throw new Error(await an(t,"media capabilities failed"));return t.json()}async function Ybe(e,t,n,i){const{app:r}=Sl(e),s=new FormData;s.set("app_name",r),s.set("user_id",t),s.set("session_id",n),s.set("file",i);const a=await Et("/web/media",{method:"POST",body:s},{},is);if(!a.ok)throw new Error(await an(a,V("client.uploadFileFailed")));return{...await a.json(),status:"ready"}}async function y4(e,t,n){const{app:i}=Sl(e),r=`/web/media/${encodeURIComponent(i)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}/delete`,s=await Et(r,{method:"POST"});if(!s.ok&&s.status!==404)throw new Error(await an(s,"media cleanup failed"))}function Zbe(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((i,r)=>![1,3,5].includes(r)).join("/")}`}catch{return}}async function eA(e,t){const n=Zbe(t);if(!n)throw new Error("Invalid VeADK media URI");const i=await Et(`${n}/delete`,{method:"POST"});if(!i.ok&&i.status!==404)throw new Error(await an(i,"media cleanup failed"))}function Jbe(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=Zbe(t);if(!n)return t;const i=`${n}/content`;return Bo(`${Z2}${i}`)}async function L_(e,t,n){const{app:i,ep:r}=Sl(e);let s;if(r.runtimeId){const c=new URLSearchParams({runtimeId:r.runtimeId,sessionId:t,region:r.region??"cn-beijing"});if(n&&c.set("endTimeMs",String(Math.round(n))),s=await Et(`/web/runtime-trace?${c.toString()}`),s.status===404)throw new Error(V("client.traceDisabled"))}else s=await Et(`/dev/apps/${encodeURIComponent(i)}/debug/trace/session/${encodeURIComponent(t)}`,{},r);if(!s.ok)throw new Error(await an(s,V("client.loadTraceFailed")));const a=s.headers.get("content-type")??"";if(!a.includes("application/json")){const c=a.split(";",1)[0]||V("client.contentTypeMissing");throw new Error(V("client.traceNonJson",{contentType:c}))}const l=await s.json();if(!Array.isArray(l))throw new Error(V("client.invalidTraceFormat"));return l}async function v4(e){const t=await Et("/web/issue-feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await an(t,V("client.submitIssueFeedbackFailed")));if((await t.json()).submitted!==!0)throw new Error(V("client.issueFeedbackNotConfirmed"));return{submitted:!0}}async function e0e(e,t,n=!0){const i=await Et(`/web/agent-info/${e}`,{},t);if(!i.ok)throw new Error(`agent-info failed: ${i.status}`);const r=await i.json();if(n&&!r.draft)try{const s=await Et(`/web/agent-draft/${e}`,{},t);if(s.ok){const a=await s.json();r.draft=a.draft}}catch{}return{appName:e,name:r.name??e,description:r.description??"",type:r.type,model:r.model??"",tools:r.tools??[],skillsPreviewSupported:Array.isArray(r.skills),skills:r.skills??[],subAgents:r.subAgents??[],components:r.components??[],searchSources:r.searchSources??[],graph:r.graph,draft:r.draft}}async function x4(e){const{app:t,ep:n}=Sl(e);return e0e(t,n,!1)}async function qBe(e,t,n){let i=null;for(const r of Qk(t)){const s={runtimeId:e,region:r};try{const a=HF(e,r),l=Xy.get(a);l&&l.expiresAt<=Date.now()&&Xy.delete(a);const c=Xy.get(a),u=n||(c==null?void 0:c.apps[0])||(await zk("","",s))[0];if(!u)throw new Error(V("client.noPreviewableAgent"));return e0e(u,s)}catch(a){if(a instanceof Cx||a instanceof Ds&&!a.unsupported)throw a;i=a instanceof Error?a:new Error(String(a))}}throw i??new Error(V("client.noPreviewableAgent"))}async function XF(e,t,n={},i={}){const r=typeof n=="string"?n:void 0,s=typeof n=="string"?i:n,a=qb(e,t||"cn-beijing",r??""),l=Lm(vg,a,Tx);if(!s.force&&l)return l;const c=vg.get(a);if(!s.force&&(c!=null&&c.promise))return c.promise;const u=qBe(e,t,r).then(d=>qF(vg,a,d));vg.set(a,{...c,promise:u,updatedAt:(c==null?void 0:c.updatedAt)??0});try{return await u}finally{const d=vg.get(a);(d==null?void 0:d.promise)===u&&vg.set(a,{value:d.value,updatedAt:d.updatedAt})}}function t0e(e,t,n=""){return Lm(vg,qb(e,t||"cn-beijing",n),Tx)}function n0e(e,t,n=""){XF(e,t,n).catch(()=>{})}async function i0e(e,t,n,i){const{app:r,ep:s}=Sl(e),a=new URLSearchParams({source:t,app_name:r,q:n,user_id:i}),l=await Et(`/web/search?${a.toString()}`,{},s);if(!l.ok)throw new Error(await an(l,V("client.agentSearchFailed")));return l.json()}async function r0e(e,t){const{app:n}=Sl(e),i=await Et(`/web/search?source=web&app_name=${encodeURIComponent(n)}&q=${encodeURIComponent(t)}`);if(!i.ok)throw new Error(`web search failed: ${i.status}`);return i.json()}function s0e(){return Df(V("client.emptySseBody"))}function tA(){return Df(V("client.noDisplayableSseReply"))}const WBe=3e4;function $v(){return Df(V("client.firstSseEventTimeout"))}function a0e(e){if(e!=null&&e.aborted)return{signal:e,clearDeadline:()=>{},cleanup:()=>{},timedOut:()=>!1};const t=new AbortController;let n=!1,i=!1;const r=()=>{i||(i=!0,clearTimeout(a))},s=()=>{t.signal.aborted||t.abort((e==null?void 0:e.reason)??new DOMException("Aborted","AbortError"))},a=setTimeout(()=>{i||t.signal.aborted||(n=!0,i=!0,t.abort(new Error($v())))},WBe);return e==null||e.addEventListener("abort",s,{once:!0}),{signal:t.signal,clearDeadline:r,cleanup:()=>{r(),e==null||e.removeEventListener("abort",s)},timedOut:()=>n}}async function*w4({appName:e,userId:t,sessionId:n,text:i,attachments:r=[],invocation:s,platformTools:a,environmentMounts:l,environmentMount:c,functionResponses:u=[],signal:d,onRuntimeContext:f}){const{app:h,ep:p}=Sl(e),g=r.flatMap(k=>k.status&&k.status!=="ready"?[]:k.uri?[{fileData:{mimeType:k.mimeType,fileUri:k.uri,displayName:k.name},partMetadata:{veadkMedia:{id:k.id,uri:k.uri,name:k.name,mimeType:k.mimeType,sizeBytes:k.sizeBytes}}}]:k.data?[{inlineData:{mimeType:k.mimeType,data:k.data,displayName:k.name}}]:[]),b=s&&(s.skills.length>0||s.targetAgent)?s:void 0,v=[...g,...u.map(k=>({functionResponse:{id:k.id,name:k.name,response:k.response}})),...i.trim()?[{text:i}]:[]];if(b&&v.length>0){const k=v[0],S=k.partMetadata;v[0]={...k,partMetadata:{...S,veadkInvocation:b}}}let y;const x=a0e(d);try{y=await Et("/run_sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:h,user_id:t,session_id:n,new_message:{role:"user",parts:v},streaming:!0,...a!==void 0?{platform_tools:[...a]}:{},...l!==void 0?{environment_mounts:[...l]}:c?{environment_mount:c}:{},custom_metadata:b?{veadkInvocation:b}:void 0}),signal:x.signal},p,0)}catch(k){throw x.cleanup(),x.timedOut()?new Error($v()):d!=null&&d.aborted||(k==null?void 0:k.name)==="AbortError"?k:new Error(Df(k))}const O=lBe(y,p.runtimeId??"",p.region??"");if(O&&(f==null||f(O)),!y.ok){x.cleanup();const k=await an(y,V("client.runSessionFailed"));throw new Error(Df(V("client.runSseFailedWithDetail",{status:y.status,detail:k})))}let w=!1;try{for await(const k of eR(y)){w=!0,x.clearDeadline();const S=k;typeof S.error=="string"&&(S.error=Df(S.error)),typeof S.errorMessage=="string"&&(S.errorMessage=Df(S.errorMessage)),typeof S.error_message=="string"&&(S.error_message=Df(S.error_message)),yield S}}catch(k){throw x.timedOut()?new Error($v()):d!=null&&d.aborted||(k==null?void 0:k.name)==="AbortError"?k:new Error(Df(k))}finally{x.cleanup()}if(!w)throw new Error(s0e())}async function sR(e,t){const n=new URLSearchParams({name:e,region:t}),i=await Et(`/web/runtime-name-availability?${n.toString()}`,{cache:"no-store"});if(!i.ok)throw new Error(await an(i,V("client.checkRuntimeNameFailed")));const r=await i.json();if(typeof r.available!="boolean")throw new Error(V("client.invalidRuntimeNameCheck"));return{available:r.available}}async function o0e(e,t){const n=new URLSearchParams({kind:e.kind,region:e.region});e.registry&&n.set("registry",e.registry),e.namespace&&n.set("namespace",e.namespace),e.workspaceId&&n.set("workspaceId",e.workspaceId),e.search&&n.set("search",e.search),e.pageNumber&&n.set("pageNumber",String(e.pageNumber)),e.pageSize&&n.set("pageSize",String(e.pageSize));const i=await Et(`/web/deployment-resources?${n.toString()}`,{signal:t});if(!i.ok)throw new Error(await an(i,V("client.loadCloudResourcesFailed")));const r=await i.json();if(typeof r.serviceRegion!="string"||!Array.isArray(r.items)||typeof r.pageNumber!="number"||typeof r.pageSize!="number"||typeof r.totalCount!="number"||typeof r.hasMore!="boolean")throw new Error(V("client.invalidCloudResources"));const s=r.items.map(a=>{if(!a||typeof a!="object"||typeof a.id!="string"||typeof a.name!="string"||typeof a.region!="string"||typeof a.status!="string")throw new Error(V("client.invalidCloudResources"));return a});return{serviceRegion:r.serviceRegion,items:s,pageNumber:r.pageNumber,pageSize:r.pageSize,totalCount:r.totalCount,hasMore:r.hasMore}}function l0e(e,t){const n=e;if(!n||typeof n!="object"||!Array.isArray(n.mounts))throw new Error(V("client.invalidEnvironmentMount"));if(n.mounts.length!==t.length)throw new Error(V("client.environmentMountMismatch"));return n.mounts.map((i,r)=>{const s=t[r];if(!i||typeof i!="object"||typeof i.environment_id!="string"||typeof i.environment_version_id!="string"||typeof i.mount_instance_id!="string"||typeof i.sandbox_session_id!="string"||!i.environment_id||!i.environment_version_id||!i.mount_instance_id||!i.sandbox_session_id)throw new Error(V("client.invalidEnvironmentMount"));if(i.environment_id!==s.environment_id||i.environment_version_id!==s.environment_version_id||s.mount_instance_id!==void 0&&i.mount_instance_id!==s.mount_instance_id)throw new Error(V("client.environmentMountMismatch"));return i})}async function c0e({runtimeId:e,appName:t,userId:n,sessionId:i,environmentMounts:r}){const{app:s}=Sl(t);let a;try{a=await Et("/web/v3/session-environment-mounts/prepare",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtime_id:e,app_name:s,user_id:n,session_id:i,environment_mounts:[...r]})})}catch(l){throw l instanceof TypeError?new Error(V("client.environmentMountNetworkFailed")):l}if(!a.ok)throw new Error(await an(a,V("client.environmentMountFailed")));return l0e(await a.json(),r)}function YF(e){const t=new Set,n=[];for(const i of e.split(/[,,\n\r]+/)){const r=i.trim();!r||t.has(r)||(t.add(r),n.push(r))}return n}async function u0e(e,t=typeof navigator>"u"?void 0:navigator.clipboard){if(!(t!=null&&t.writeText))throw new Error(V("client.clipboardUnsupported"));try{await t.writeText(e)}catch{throw new Error(V("client.clipboardWriteFailed"))}}const CW={codex:0,codex_snapshot:1,deepseek_harness:2,deepseek_harness_snapshot:3,openclaw:4,openclaw_snapshot:5,hermes:6,hermes_snapshot:7,dev:8};async function d0e(e){var r;const t=await Et("/web/system-info",{signal:e});if(!t.ok)throw new Error(await an(t,V("client.loadSystemInfoFailed")));const n=await t.json();if(typeof((r=n.storage)==null?void 0:r.tosAddress)!="string"||!Array.isArray(n.sandboxTools))throw new Error(V("client.invalidSystemInfo"));const i=n.sandboxTools.map(s=>{if(!s||typeof s!="object"||typeof s.kind!="string"||typeof s.label!="string"||typeof s.toolId!="string"||typeof s.snapshot!="boolean"||typeof s.needsModelEnvUpdate!="boolean"||typeof s.canUpdateModelEnv!="boolean"||typeof s.modelEnvError!="string"||typeof s.modelEnvErrorCode!="string")throw new Error(V("client.invalidSystemInfo"));return s}).sort((s,a)=>(CW[s.kind]??Number.MAX_SAFE_INTEGER)-(CW[a.kind]??Number.MAX_SAFE_INTEGER));return{storage:{tosAddress:n.storage.tosAddress},sandboxTools:i}}const f0e=new Set(["preparing","queued","building","scanning","available","failed"]);function ZF(e){if(e===null)return null;if(!e||typeof e!="object")throw new Error(V("client.invalidEnvironmentBuild"));const t=e;if(typeof t.versionId!="string"||!f0e.has(t.status)||typeof t.image!="string"||typeof t.error!="string"||typeof t.createdAt!="string"||typeof t.updatedAt!="string"||t.resources!==null&&typeof t.resources!="object")throw new Error(V("client.invalidEnvironmentBuild"));const n=Array.isArray(t.steps)?t.steps.map(i=>{if(!i||typeof i!="object"||typeof i.key!="string"||typeof i.label!="string"||!["pending","running","succeeded","failed"].includes(i.status)||i.startedAt!==null&&typeof i.startedAt!="string"||i.finishedAt!==null&&typeof i.finishedAt!="string")throw new Error(V("client.invalidEnvironmentBuildStep"));return i}):[];return{...t,toolId:typeof t.toolId=="string"?t.toolId:"",toolStatus:["creating","ready","failed"].includes(t.toolStatus)?t.toolStatus:"",runId:typeof t.runId=="string"?t.runId:"",currentStep:typeof t.currentStep=="string"?t.currentStep:"",sourceCommitSha:typeof t.sourceCommitSha=="string"?t.sourceCommitSha:"",steps:n,progressError:typeof t.progressError=="string"?t.progressError:"",logTail:typeof t.logTail=="string"?t.logTail:"",logTruncated:t.logTruncated===!0,logUpdatedAt:typeof t.logUpdatedAt=="string"?t.logUpdatedAt:null,logError:typeof t.logError=="string"?t.logError:""}}function h0e(e){if(!e||typeof e!="object")throw new Error(V("client.invalidEnvironmentManifest"));const t=e;if(!["agentkit.studio/v3","agentkit.studio/v1alpha1"].includes(t.apiVersion)||t.kind!=="Environment"||!t.metadata||typeof t.metadata.id!="string"||typeof t.metadata.name!="string"||typeof t.metadata.version!="string"||typeof t.metadata.description!="string"||!t.spec||typeof t.spec.image!="string"||!["ubuntu","aio-sandbox","codex-sandbox"].includes(t.spec.baseEnvironment)||typeof t.spec.baseImage!="string"||!["ubuntu-22.04","ubuntu-24.04"].includes(t.spec.operatingSystem)||!["python-3.10","python-3.12"].includes(t.spec.language)||t.spec.executionRuntime!=="veadk"||!Array.isArray(t.spec.packages)||!t.spec.packages.every(n=>typeof n=="string")||!Array.isArray(t.spec.capabilities)||!t.spec.capabilities.every(n=>typeof n=="string")||!Array.isArray(t.spec.skills)||!t.status||!f0e.has(t.status.phase)||typeof t.status.createdAt!="string"||typeof t.status.updatedAt!="string")throw new Error(V("client.invalidEnvironmentManifest"));return t}function p0e(e){if(e==null)return;if(!e||typeof e!="object")throw new Error(V("client.invalidImageRepository"));const t=e;if(typeof t.region!="string"||typeof t.registry!="string"||typeof t.namespace!="string"||typeof t.repository!="string")throw new Error(V("client.invalidImageRepository"));return t}function GBe(e){if(e==null)return;if(!e||typeof e!="object")throw new Error(V("client.invalidCodeRepository"));const t=e;if(typeof t.repositoryUrl!="string"||t.ref!==void 0&&typeof t.ref!="string"||typeof t.dockerfilePath!="string")throw new Error(V("client.invalidCodeRepository"));return t}function KBe(e){const t=p0e(e);if(!t)return;const n=e;if(typeof n.reference!="string")throw new Error(V("client.invalidImageSource"));return{...t,reference:n.reference}}function JF(e){if(!e||typeof e!="object")throw new Error(V("client.invalidEnvironment"));const t=e;if(typeof t.id!="string"||typeof t.name!="string"||typeof t.description!="string"||t.baseEnvironment!==void 0&&t.baseEnvironment!=="ubuntu"&&t.baseEnvironment!=="aio-sandbox"&&t.baseEnvironment!=="codex-sandbox"||t.operatingSystem!=="ubuntu-22.04"&&t.operatingSystem!=="ubuntu-24.04"||t.language!=="python-3.10"&&t.language!=="python-3.12"||!Array.isArray(t.optionIds)||!t.optionIds.every(n=>typeof n=="string")||t.selectedSkills!==void 0&&!Array.isArray(t.selectedSkills)||typeof t.dockerfile!="string"||typeof t.createdAt!="string"||typeof t.updatedAt!="string")throw new Error(V("client.invalidEnvironment"));return{...t,baseEnvironment:t.baseEnvironment==="aio-sandbox"?"aio-sandbox":t.baseEnvironment==="codex-sandbox"?"codex-sandbox":"ubuntu",selectedSkills:t.selectedSkills??[],gitSource:GBe(t.gitSource),containerRepository:p0e(t.containerRepository),imageSource:KBe(t.imageSource),latestVersion:ZF(t.latestVersion)}}function m0e(e){if(!e||typeof e!="object")throw new Error(V("client.invalidWorkspace"));const t=e;if(typeof t.id!="string"||typeof t.name!="string"||typeof t.description!="string"||!Array.isArray(t.environmentIds)||!t.environmentIds.every(n=>typeof n=="string")||typeof t.createdAt!="string"||typeof t.updatedAt!="string")throw new Error(V("client.invalidWorkspace"));return t}async function e7(e){const t=await Et("/web/workspaces",{signal:e});if(!t.ok)throw new Error(await an(t,V("client.loadWorkspacesFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(V("client.invalidWorkspaceList"));return n.items.map(m0e)}async function g0e(e,t,n,i){const r=await Et(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i});if(!r.ok)throw new Error(await an(r,V("client.saveWorkspaceFailed")));return m0e(await r.json())}function b0e(e,t){return g0e("/web/workspaces","POST",e,t)}function y0e(e,t,n){return g0e(`/web/workspaces/${encodeURIComponent(e)}`,"PATCH",t,n)}async function v0e(e,t){const n=await Et(`/web/workspaces/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await an(n,V("client.deleteWorkspaceFailed")))}async function Vk(e){const t=await Et("/web/v3/environments",{signal:e});if(!t.ok)throw new Error(await an(t,V("client.loadEnvironmentsFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(V("client.invalidEnvironmentList"));return n.items.map(JF)}async function x0e(e,t){const n=await Et("/web/v3/environment-repositories/inspect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw new Error(await an(n,V("client.probeRepositoryFailed")));const i=await n.json();if(typeof i.repositoryUrl!="string"||typeof i.ref!="string"||typeof i.commitSha!="string"||!Array.isArray(i.dockerfiles)||!i.dockerfiles.every(r=>typeof r=="string"))throw new Error(V("client.invalidRepositoryProbe"));return i}async function w0e(e,t){const n=await Et(`/web/v3/environments/${encodeURIComponent(e)}/share-code`,{method:"POST",signal:t});if(!n.ok)throw new Error(await an(n,V("client.exportEnvironmentCodeFailed")));const i=await n.json();if(typeof i.shareCode!="string"||typeof i.name!="string")throw new Error(V("client.invalidEnvironmentCode"));return i}async function O0e(e,t){const n=await Et("/web/v3/environment-share-codes/inspect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shareCodes:e}),signal:t});if(!n.ok)throw new Error(await an(n,V("client.inspectEnvironmentCodeFailed")));const i=await n.json();if(!Array.isArray(i.items))throw new Error(V("client.invalidEnvironmentCodeInspection"));return i.items.map(r=>{if(!r||typeof r!="object")throw new Error(V("client.invalidEnvironmentCodeInspection"));const s=r,a=s.status==="valid"||s.valid===!0?"valid":s.status==="invalid"||s.valid===!1?"invalid":null;if(!Number.isInteger(s.index)||a===null||s.name!==void 0&&typeof s.name!="string"||s.error!==void 0&&typeof s.error!="string")throw new Error(V("client.invalidEnvironmentCodeInspection"));return{index:s.index,status:a,name:s.name??"",error:s.error??""}})}async function S0e(e,t){const n=await Et("/web/v3/environment-share-codes/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shareCodes:e}),signal:t});if(!n.ok)throw new Error(await an(n,V("client.importEnvironmentCodeFailed")));const i=await n.json();if(!Array.isArray(i.items))throw new Error(V("client.invalidEnvironmentCodeImport"));return i.items.map(r=>{if(!r||typeof r!="object")throw new Error(V("client.invalidEnvironmentCodeImport"));const s=r;if(!Number.isInteger(s.index)||!(s.status==="created"||s.status==="duplicate"||s.status==="failed")||s.name!==void 0&&typeof s.name!="string"||s.error!==void 0&&typeof s.error!="string")throw new Error(V("client.invalidEnvironmentCodeImport"));return{index:s.index,status:s.status,name:s.name??"",environment:s.environment===void 0||s.environment===null?void 0:JF(s.environment),error:s.error??""}})}async function k0e(e,t,n,i){let r;try{r=await Et(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i})}catch(s){throw s instanceof DOMException&&s.name==="AbortError"?s:s instanceof TypeError?new Error(V("client.studioUnavailable")):s}if(!r.ok)throw new Error(await an(r,V("client.saveEnvironmentFailed")));return JF(await r.json())}function E0e(e,t){return k0e("/web/v3/environments","POST",e,t)}function C0e(e,t,n){return k0e(`/web/v3/environments/${encodeURIComponent(e)}`,"PATCH",t,n)}async function T0e(e,t){const n=await Et(`/web/v3/environments/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await an(n,V("client.deleteEnvironmentFailed")))}async function O4(e,t){const n=await Et(`/web/v3/environments/${encodeURIComponent(e)}/build`,{method:"POST",signal:t});if(!n.ok)throw new Error(await an(n,V("client.startEnvironmentBuildFailed")));const i=ZF(await n.json());if(!i)throw new Error(V("client.invalidEnvironmentBuild"));return i}async function A0e(e,t,n={}){const i=n.includeLogs?"?includeLogs=true":"",r=await Et(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}${i}`,{signal:n.signal});if(!r.ok)throw new Error(await an(r,V("client.loadEnvironmentBuildFailed")));const s=ZF(await r.json());if(!s)throw new Error(V("client.invalidEnvironmentBuild"));return s}async function _0e(e,t,n){const i=await Et(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}/manifest`,{signal:n});if(!i.ok)throw new Error(await an(i,V("client.loadEnvironmentManifestFailed")));return h0e(await i.json())}function TW(e){if(!e||typeof e!="object")throw new Error(V("client.invalidEnvironmentResource"));const t=e;if(t.source!=="provided"&&t.source!=="managed"||typeof t.consoleUrl!="string")throw new Error(V("client.invalidEnvironmentResource"));return t}async function N0e(e){const t=await Et("/web/v3/environment-resources",{signal:e});if(!t.ok)throw new Error(await an(t,V("client.loadEnvironmentResourcesFailed")));const n=await t.json();if(n.provider!=="volcengine"&&n.provider!=="byteplus"||typeof n.region!="string")throw new Error(V("client.invalidEnvironmentResource"));return{provider:n.provider,region:n.region,codePipeline:TW(n.codePipeline),containerRegistry:TW(n.containerRegistry)}}async function XBe(e,t){const n=await Et(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/model-env`,{method:"POST",signal:t});if(!n.ok)throw new Error(await an(n,V("client.updateCodexSandboxFailed")));const i=await n.json();if(i.kind!=="codex"&&i.kind!=="codex_snapshot"||typeof i.toolId!="string"||typeof i.updated!="boolean")throw new Error(V("client.invalidCodexSandboxUpdate"));return i}async function aR(e){const t=await Et("/web/identity/user-pools",{signal:e});if(!t.ok)throw new Error(await an(t,V("client.loadUserPoolsFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(V("client.invalidUserPoolList"));return n.items.map(i=>{if(!i||typeof i!="object"||typeof i.uid!="string"||typeof i.name!="string"||typeof i.domain!="string"||typeof i.region!="string"||typeof i.isCurrent!="boolean")throw new Error(V("client.invalidUserPoolList"));return i})}const vO=new Map;function YBe(e){if(typeof e=="string")return e?{message:e}:null;if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=typeof t.message=="string"?t.message:typeof t.error=="string"?t.error:"";return n?{message:n,phase:typeof t.phase=="string"?t.phase:void 0,runtimeId:typeof t.runtimeId=="string"?t.runtimeId:void 0,logPath:typeof t.logPath=="string"?t.logPath:void 0}:null}class xO extends Error{constructor(t){super(t.message),this.detail=t,this.name="GithubCicdPipelineError"}}async function Mh(e){const t=await e.text().catch(()=>"");if(t)try{const n=JSON.parse(t),i=YBe(n.detail??n.error);if(i)return new xO(i)}catch{return new xO({message:t})}return new xO({message:V("client.syncGithubFailed",{status:e.status})})}async function j0e(e){const t=await Et("/web/github-delivery/source-sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.project,githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,region:e.region,cloudProvider:e.cloudProvider})},{},0);if(!t.ok)throw await Mh(t);return t.json()}async function R0e(e){const t=await Et("/web/github-delivery/cicd-pipeline",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await Mh(t);return t.json()}async function I0e(e){const t=await Et("/web/github-delivery/init-main",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.project,githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await Mh(t);return t.json()}async function ZBe(e){const t=await Et("/web/github-delivery/source-sync/cicd",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pipelineId:e.pipelineId,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await Mh(t);return t.json()}async function P0e(e){const t=await Et(`/web/github-cicd/runtime-binding?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await Mh(t);const n=await t.json();return n.pipelineId?n:null}async function nA(e){const t=await Et(`/web/github-delivery/versions?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await Mh(t);return t.json()}async function D0e(e){const t=await Et("/web/github-delivery/rollback-pr",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await Mh(t);return t.json()}async function t7(e){const t=await Et("/web/github-cicd/runtime-binding",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await Mh(t);return t.json()}async function M0e(e){const t=await Et("/web/github-cicd/runtime-sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,project:e.project})},{},0);if(!t.ok)throw await Mh(t);return t.json()}async function Ax(e,t,n,i){var f,h,p,g,b;const r=i==null?void 0:i.taskId,s=r?new AbortController:void 0;r&&s&&vO.set(r,s);const a=()=>{r&&vO.get(r)===s&&vO.delete(r)};let l;try{const v=!!(i!=null&&i.migrationTaskId);(f=i==null?void 0:i.onStage)==null||f.call(i,{level:"info",phase:"upload",message:V(v?"client.validatingMigrationArtifact":"client.uploadingCodePackage"),pct:0}),l=await Et("/web/deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},signal:s==null?void 0:s.signal,body:JSON.stringify({name:e,files:v?[]:t,config:n,taskId:r,migrationTaskId:i==null?void 0:i.migrationTaskId,runtimeId:i==null?void 0:i.runtimeId,runtimeName:i==null?void 0:i.runtimeName,appName:i==null?void 0:i.appName,editMode:i==null?void 0:i.editMode,draft:i==null?void 0:i.draft,updateEtag:i==null?void 0:i.updateEtag,baseRuntimeVersion:i==null?void 0:i.baseRuntimeVersion,removeRuntimeEnvKeys:i==null?void 0:i.removeRuntimeEnvKeys,mcpSecretValues:i==null?void 0:i.mcpSecretValues,mcpCredentialReuses:i==null?void 0:i.mcpCredentialReuses,sessionStorage:i==null?void 0:i.sessionStorage,minInstance:i==null?void 0:i.minInstance,maxInstance:i==null?void 0:i.maxInstance,createEvaluationSets:i==null?void 0:i.createEvaluationSets,description:mBe((i==null?void 0:i.description)??""),authentication:i==null?void 0:i.authentication,im:i==null?void 0:i.im,envs:i==null?void 0:i.envs,resources:i==null?void 0:i.resources,source:(i==null?void 0:i.source)??(i!=null&&i.migrationTaskId?{kind:"migration",migrationId:i.migrationTaskId}:{kind:"inlineFiles"}),harnessSidecar:i==null?void 0:i.harnessSidecar,environment:i==null?void 0:i.environment})},{},0),(h=i==null?void 0:i.onStage)==null||h.call(i,{level:"success",phase:"upload",message:V(v?"client.migrationArtifactValidated":"client.codePackageUploaded"),pct:100})}catch(v){throw a(),kW(v)?v:new jw({taskId:r,cause:v})}if(!l.ok){const v=await an(l,V("client.deploymentFailed"));throw a(),new Error(v)}let c=null;try{for await(const v of eR(l)){const y=v;if(y&&y.done){c=y;break}y&&y.message&&((p=i==null?void 0:i.onStage)==null||p.call(i,y))}}catch(v){throw a(),kW(v)?v:new jw({taskId:r,cause:v})}if(a(),!c)throw new jw({taskId:r});if(!c.success){const v=new Error(c.error||V("client.deploymentFailed"));throw Rbe(v)?new jw({taskId:r,cause:v}):v}if(!c.agentName)throw new Error(V("client.deploymentMissingAgentName"));if(!c.runtimeId&&!c.url)throw new Error(V("client.deploymentMissingConnection"));const u=(g=c.runtimeName)!=null&&g.trim()?c.agentName:e,d=((b=c.runtimeName)==null?void 0:b.trim())||c.agentName;return{apikey:c.apikey??"",url:c.url??"",agentName:u,runtimeName:d,runtimeId:c.runtimeId,consoleUrl:c.consoleUrl,region:c.region,version:c.version,warnings:c.warnings,feishuChannel:c.feishuChannel}}async function L0e(e){var n;const t=await Et("/web/cancel-deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});if(!t.ok){const i=await t.text().catch(()=>"");throw new Error(i||V("client.cancelDeploymentFailed",{status:t.status}))}(n=vO.get(e))==null||n.abort(),vO.delete(e)}async function JBe(e=FF){const t=await Et(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(V("client.loadFailed",{status:t.status}));return(await t.json()).runtimes??[]}const bS={title:"AgentKit Studio",logoUrl:""},S4={enabled:!1},ID={studio:!1,version:"",provider:"volcengine",branding:bS,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,agentUsage:!1,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local",telemetry:S4};function eUe(e){if(!e||typeof e!="object")return S4;const t=e;if(t.enabled!==!0||!t.studio||typeof t.studio!="object")return S4;const n=t.studio;return{enabled:!0,studio:{deployId:typeof n.deployId=="string"?n.deployId:"",userPoolId:typeof n.userPoolId=="string"?n.userPoolId:"",applicationId:typeof n.applicationId=="string"?n.applicationId:"",functionId:typeof n.functionId=="string"?n.functionId:"",region:typeof n.region=="string"?n.region:"",project:typeof n.project=="string"?n.project:"",version:typeof n.version=="string"?n.version:"",accountId:typeof n.accountId=="string"?n.accountId:"",accountIdResolutionError:typeof n.accountIdResolutionError=="string"?n.accountIdResolutionError:""}}}async function $0e(){var e,t;try{const n=await Et("/web/ui-config");if(!n.ok)return ID;const i=await n.json(),r=typeof((e=i.branding)==null?void 0:e.logoUrl)=="string"?i.branding.logoUrl:bS.logoUrl,s=i.provider==="byteplus"?"byteplus":"volcengine";return Ube(s),{studio:i.studio??!1,version:typeof i.version=="string"?i.version:"",provider:s,branding:{title:typeof((t=i.branding)==null?void 0:t.title)=="string"?i.branding.title:bS.title,logoUrl:r?Bo(r):""},features:{...ID.features,...i.features??{}},defaultView:i.defaultView??"chat",agentsSource:i.agentsSource==="cloud"?"cloud":"local",telemetry:eUe(i.telemetry)}}catch{return ID}}const F0e={role:"user",telemetry:{userId:"",accountId:""},capabilities:{createAgents:!1,createPersonalAgents:!1,manageAgents:!1,runtimeScope:"mine"}};async function B0e(){var n,i,r,s,a;const e=await Et("/web/access");if(!e.ok)throw new Error(V("client.loadPermissionsFailed",{status:e.status}));const t=await e.json();if(!["admin","developer","user"].includes(t.role)||typeof((n=t.telemetry)==null?void 0:n.userId)!="string"||t.telemetry.accountId!==void 0&&typeof t.telemetry.accountId!="string"||typeof((i=t.capabilities)==null?void 0:i.createAgents)!="boolean"||typeof((r=t.capabilities)==null?void 0:r.createPersonalAgents)!="boolean"||typeof((s=t.capabilities)==null?void 0:s.manageAgents)!="boolean"||!["all","mine"].includes((a=t.capabilities)==null?void 0:a.runtimeScope))throw new Error(V("client.invalidPermissionResponse"));return t}async function U0e(e,t){const n=new URLSearchParams;e&&n.set("targetVersion",e),t&&n.set("startedAt",String(t));const i=n.size?`?${n.toString()}`:"",r=await Et(`/web/studio-update${i}`);if(!r.ok)throw new Error(V("client.checkStudioUpdateFailed",{status:r.status}));return await r.json()}async function Q0e(){const e=await Et("/web/studio-update/permissions");if(!e.ok){let t="";try{const n=await e.json();t=typeof n.detail=="string"?n.detail:""}catch{t=""}throw new Error(t||V("client.studioUpdatePreflightFailed",{status:e.status}))}return await e.json()}async function z0e(e){const t=await Et("/web/studio-update",{method:"POST",headers:{"Content-Type":"application/json","X-VeADK-Studio-Update":"1"},body:JSON.stringify({version:e})},{},is);if(!t.ok){let n="";try{const i=await t.json();n=typeof i.detail=="string"?i.detail:""}catch{n=""}throw new Error(n||V("client.submitStudioUpdateFailed",{status:t.status}))}return await t.json()}async function V0e({runtimeId:e,region:t,appName:n,page:i=1,pageSize:r=20,signal:s}){const a=new URLSearchParams({runtimeId:e,region:t,appName:n,page:String(i),pageSize:String(r)}),l=await Et(`/web/agent-usage?${a.toString()}`,{signal:s});if(!l.ok)throw new Error(await an(l,V("client.loadAgentUsageFailed")));const c=l.headers.get("content-type")||V("client.notProvided"),u=c.toLowerCase();if(!u.includes("application/json")&&!u.includes("+json"))throw new Error(V("client.agentUsageNonJson",{status:l.status,contentType:c})+V("client.checkStudioGateway"));try{return await l.json()}catch{throw new Error(V("client.agentUsageInvalidJson",{status:l.status,contentType:c})+V("client.retryCheckGateway"))}}function Lh(e=""){return`/web/cronjobs${e?`/${encodeURIComponent(e)}`:""}`}async function k4(e){const t=await Et(Lh(),{signal:e});if(!t.ok)throw new Error(await an(t,V("client.loadCronJobsFailed")));const n=await t.json();return Array.isArray(n)?n:n.items??[]}async function tUe(e,t){const n=await Et(Lh(e),{signal:t});if(!n.ok)throw new Error(await an(n,V("client.loadCronJobFailed")));return await n.json()}async function H0e(e){const t=await Et(Lh(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await an(t,V("client.createCronJobFailed")));return await t.json()}async function q0e(e,t){const n=await Et(`${Lh(e)}/update`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(await an(n,V("client.updateCronJobFailed")));return await n.json()}async function W0e(e,t){const n=t?"enable":"disable",i=await Et(`${Lh(e)}/${n}`,{method:"POST"});if(!i.ok)throw new Error(await an(i,V(t?"client.enableCronJobFailed":"client.pauseCronJobFailed")));return await i.json()}async function G0e(e){const t=await Et(`${Lh(e)}/run`,{method:"POST"});if(!t.ok)throw new Error(await an(t,V("client.runCronJobFailed")));return await t.json()}async function E4(e,t){const n=await Et(`${Lh(e)}/runs`,{signal:t});if(!n.ok)throw new Error(await an(n,V("client.loadCronHistoryFailed")));const i=await n.json();return Array.isArray(i)?i:i.items??[]}async function K0e(e,t){const n=await Et(`${Lh(e)}/runs/${encodeURIComponent(t)}/cancel`,{method:"POST"});if(!n.ok)throw new Error(await an(n,V("client.stopCronRunFailed")));return await n.json()}async function X0e(e){const t=await Et(Lh(e),{method:"DELETE"});if(!t.ok)throw new Error(await an(t,V("client.deleteCronJobFailed")))}class n7 extends Error{constructor(t,n){super(t),this.status=n,this.name="RuntimeListError"}}async function _x(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 Et(`/web/runtimes?${t.toString()}`,{signal:e.signal});if(!n.ok){const r=await an(n,V("client.loadRuntimeFailed"));throw new n7(r,n.status)}const i=await n.json();return{runtimes:i.runtimes??[],nextToken:i.nextToken??""}}async function Fv(e,t,n={}){if(n.preferCached){const i=HF(e,t,n.currentVersion),r=Xy.get(i);if(r&&r.expiresAt>Date.now())return[...r.apps];r&&Xy.delete(i)}try{const i={runtimeId:e,region:t,runtimeVersion:n.currentVersion};return n.retryProbe&&(i.retryProbe=!0),await zk("","",i,n.signal,n.timeoutMs)}catch(i){if(i instanceof Cx||i instanceof Ds||i instanceof Error)throw i;return null}}async function Y0e(e,t){const n=new URLSearchParams({region:t}),i=await Et(`/web/runtime-tool-channel/${encodeURIComponent(e)}/capabilities?${n.toString()}`);if(!i.ok)throw new Ds(await an(i,V("client.loadLocalToolsFailed")),!1,!0);return await i.json()}async function Z0e(e,t){const n=new URLSearchParams({region:t}),i=await Et(`/web/runtime-route-channel/${encodeURIComponent(e)}/connect?${n.toString()}`,{method:"POST"});if(!i.ok)throw new Ds(await an(i,V("client.connectDynamicRouteFailed")),!1,!0);return await i.json()}async function J0e(e,t,n={}){const i={runtimeId:e,region:t};n.retryProbe&&(i.retryProbe=!0);const r=await Et("/.well-known/agent-card.json",{},i),s=await Qbe(r);if(s==="runtime_access_denied")throw new Cx;if(s==="runtime_private_endpoint_unreachable")throw new Ds($be());if(["runtime_proxy_connect_error","runtime_proxy_timeout"].includes(s))throw new Ds(Fbe());if(r.status===404)return null;if(r.status===401||r.status===403)throw new Ds(V("client.a2aProbeDenied"));if(!r.ok)throw new Error(await an(r,V("client.loadA2aCardFailed")));const a=await r.json().catch(()=>null),l=typeof(a==null?void 0:a.url)=="string"?a.url.trim():"";return l?{name:typeof(a==null?void 0:a.name)=="string"?a.name:"",description:typeof(a==null?void 0:a.description)=="string"?a.description:"",endpoint:l}:null}async function eye(e,t){const n=new URLSearchParams({runtimeId:e,region:t}),i=await Et(`/web/runtime-api-key/reveal?${n.toString()}`,{method:"POST",cache:"no-store"});if(!i.ok)throw new Error(await an(i,V("client.loadRuntimeApiKeyFailed")));const r=await i.json();if(typeof r.apiKey!="string"||!r.apiKey)throw new Error(V("client.runtimeApiKeyMissing"));return r.apiKey}async function tye(e,t){const n=await Et("/web/delete-runtime",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t})});if(!n.ok){const i=await n.text().catch(()=>"");throw new Error(i||V("client.deleteFailed",{status:n.status}))}}function iA({runtimeId:e,region:t,appName:n,currentVersion:i}){return qb(gS,t,e,i??"",(n==null?void 0:n.trim())??"")}async function nUe({runtimeId:e,region:t,appName:n,currentVersion:i,force:r=!1}){const s=new URLSearchParams({runtimeId:e,region:t});n&&s.set("appName",n),i!=null&&s.set("currentVersion",String(i)),r&&s.set("refresh","true");const a=await Et(`/web/runtime-update-capability?${s.toString()}`);if(!a.ok)throw new Error(await iUe(a));return await a.json()}function oR({runtimeId:e,region:t,appName:n,currentVersion:i,signal:r,force:s=!1}){var u,d;const a={runtimeId:e,region:t,appName:n,currentVersion:i},l=iA(a);if(s&&kr.delete(l),!s){const f=Lm(kr,l,Tx);if(f)return ZC(Promise.resolve(f),r);const h=(u=kr.get(l))==null?void 0:u.promise;if(h)return ZC(h,r);if(n){const p=iA({...a,appName:""}),g=(d=kr.get(p))==null?void 0:d.promise;if(g){let b;return b=g.then(v=>{var x,O,w,k,S;if(v.recoveryStatus==="preparing")return((x=kr.get(l))==null?void 0:x.promise)===b&&kr.delete(l),v;const y=((w=(O=v.agent)==null?void 0:O.appName)==null?void 0:w.trim())??"";return y&&y!==n.trim()?(((k=kr.get(l))==null?void 0:k.promise)===b&&kr.delete(l),oR(a)):(((S=kr.get(l))==null?void 0:S.promise)===b&&kr.set(l,{value:v,updatedAt:Date.now()}),v)},v=>{var y;throw((y=kr.get(l))==null?void 0:y.promise)===b&&kr.delete(l),v}),kr.set(l,{promise:b,updatedAt:0}),ZC(b,r)}}}let c;return c=nUe({...a,force:s}).then(f=>{var h,p,g,b,v;if(f.recoveryStatus==="preparing")return((h=kr.get(l))==null?void 0:h.promise)===c&&kr.delete(l),f;if(((p=kr.get(l))==null?void 0:p.promise)===c){kr.set(l,{value:f,updatedAt:Date.now()});const y=new Set(["",((b=(g=f.agent)==null?void 0:g.appName)==null?void 0:b.trim())??""]);for(const x of y){const O=iA({...a,appName:x});O!==l&&!((v=kr.get(O))!=null&&v.promise)&&kr.set(O,{value:f,updatedAt:Date.now()})}}return f},f=>{var h;throw((h=kr.get(l))==null?void 0:h.promise)===c&&kr.delete(l),f}),kr.set(l,{promise:c,updatedAt:0}),ZC(c,r)}function C4({runtimeId:e,region:t,appName:n,currentVersion:i}){return Lm(kr,iA({runtimeId:e,region:t,appName:n,currentVersion:i}),Tx)}function T4(e){return oR(e).then(()=>{},()=>{})}function A4(e,t){if(!e){kr.clear();return}for(const n of kr.keys()){const[i,r,s]=n.split("");i===gS&&s===e&&(!t||r===t)&&kr.delete(n)}}async function iUe(e){const t=await e.json().catch(()=>null),n=typeof(t==null?void 0:t.detail)=="string"?t.detail:"";return e.status===403?V("client.runtimeManageForbidden"):e.status===404?V(n==="runtime_not_found"?"client.runtimeNotFound":"client.runtimeUnavailable"):V("client.checkRuntimeUpdateFailed",{status:e.status})}async function rUe(e,t){let n=null;for(const i of Qk(t)){const r=await Et(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(i)}`);if(r.ok)return r.json();n=new Error(await an(r,V("client.loadRuntimeDetailFailed")))}throw n??new Error(V("client.loadRuntimeDetailFailed"))}async function i7(e,t="cn-beijing",n={}){const i=qb(e,t||"cn-beijing"),r=Lm(xg,i,Tx);if(!n.force&&r)return r;const s=xg.get(i);if(!n.force&&(s!=null&&s.promise))return s.promise;const a=rUe(e,t).then(l=>qF(xg,i,l));xg.set(i,{...s,promise:a,updatedAt:(s==null?void 0:s.updatedAt)??0});try{return await a}finally{const l=xg.get(i);(l==null?void 0:l.promise)===a&&xg.set(i,{value:l.value,updatedAt:l.updatedAt})}}function nye(e,t="cn-beijing"){return Lm(xg,qb(e,t||"cn-beijing"),Tx)}function iye(e,t="cn-beijing"){i7(e,t).catch(()=>{})}async function wO(e){const t=await Et("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await an(t,V("client.generateProjectFailed")));return t.json()}const sUe=19e4;async function rye(e){const t=await Et("/web/generated-agent-drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requirement:e})},{},sUe);if(!t.ok)throw new Error(await an(t,V("client.generateAgentConfigFailed")));return Jj(t,V("client.generateAgentConfigFailed"))}async function sye(e,t){const n=await Et("/web/generated-agent-test-runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e,runtimeId:t==null?void 0:t.runtimeId,runtimeRegion:t==null?void 0:t.region})});if(!n.ok)throw new Error(await an(n,V("client.createDebugRunFailed")));return Jj(n,V("client.createDebugRunFailed"))}async function aye(e,t){const n=await Et(`/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 an(n,V("client.createDebugSessionFailed")));return(await Jj(n,V("client.createDebugSessionFailed"))).id}async function oye(e,t){const n=await Et(`/web/generated-agent-test-runs/${encodeURIComponent(e)}/trace/session/${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await an(n,V("client.loadDebugTraceFailed")));const i=await Jj(n,V("client.loadDebugTraceFailed"));if(!Array.isArray(i))throw new Error(V("client.invalidDebugTrace"));return i}async function*lye({runId:e,userId:t,sessionId:n,text:i,signal:r}){const s=i.trim()?[{text:i}]:[],a=a0e(r);let l;try{l=await Et(`/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:s},streaming:!0}),signal:a.signal},{},0)}catch(c){throw a.cleanup(),a.timedOut()?new Error($v()):c}if(!l.ok)throw a.cleanup(),new Error(await an(l,V("client.debugRunFailed")));try{for await(const c of eR(l))a.clearDeadline(),yield c}catch(c){throw a.timedOut()?new Error($v()):c}finally{a.cleanup()}}async function ey(e){const t=await Et(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await an(t,V("client.cleanupDebugRunFailed")))}function cye(e){if(!e||typeof e!="object")throw new Error(V("client.invalidSandboxVersion"));const t=e;if(typeof t.toolId!="string"||typeof t.error!="string")throw new Error(V("client.invalidSandboxVersion"));if(!t.error&&(t.provider!=="volcengine"&&t.provider!=="byteplus"||typeof t.region!="string"||typeof t.status!="string"||typeof t.currentImage!="string"||typeof t.latestImage!="string"||typeof t.needsImageUpdate!="boolean"||typeof t.canUpdate!="boolean"||typeof t.needsModelEnvUpdate!="boolean"||typeof t.canUpdateModelEnv!="boolean"||typeof t.modelEnvError!="string"))throw new Error(V("client.invalidSandboxVersion"));return t}async function uye(e){const t=await Et("/web/system-info/sandbox-tools/updates",{signal:e});if(!t.ok)throw new Error(await an(t,V("client.loadSandboxVersionsFailed")));const n=await t.json();if(!Array.isArray(n.tools))throw new Error(V("client.invalidSandboxVersion"));return n.tools.map(cye)}async function dye(e){const t=await Et(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/update`,{method:"POST"},{},33e4);if(!t.ok)throw new Error(await an(t,V("client.updateSandboxFailed")));const n=await t.json();if(typeof n.updated!="boolean")throw new Error(V("client.invalidSandboxUpdate"));return{updated:n.updated,state:cye(n.state)}}const aUe=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_SITE_BRANDING:bS,DEFAULT_STUDIO_ACCESS:F0e,GithubCicdPipelineError:xO,RuntimeAccessDeniedError:Cx,RuntimeListError:n7,RuntimeProbeError:Ds,attachGithubDeliveryCicdToSourceSync:ZBe,bindGithubCicdRuntime:t7,buildEnvironment:O4,cancelAgentkitDeployment:L0e,cancelCronJobRun:K0e,checkRuntimeNameAvailability:sR,clearMessageFeedbackCache:Ibe,clearRemoteApps:Dbe,componentSearch:i0e,createCronJob:H0e,createEnvironment:E0e,createGeneratedAgentTestRun:sye,createGeneratedAgentTestSession:aye,createGithubCicdPipeline:j0e,createGithubDeliveryCicdPipeline:R0e,createGithubDeliveryRollbackPr:D0e,createSession:zbe,createWorkspace:b0e,deleteAgentFeedbackCases:Kbe,deleteCronJob:X0e,deleteEnvironment:T0e,deleteGeneratedAgentTestRun:ey,deleteMedia:eA,deleteRuntime:tye,deleteSession:b4,deleteSessionMedia:y4,deleteWorkspace:v0e,deployAgentkitProject:Ax,downloadArtifact:GF,ensureRuntimeRouteChannel:Z0e,exportEnvironmentShareCode:w0e,fetchRemoteApps:zk,generateAgentDraftFromRequirement:rye,generateAgentProject:wO,getAgentFeedbackCases:rR,getAgentInfo:x4,getAgentOptimizations:Hbe,getAgentUsage:V0e,getAutomaticEvaluationStatuses:g4,getCachedAgentFeedbackCases:qbe,getCachedRuntimeAgentInfo:t0e,getCachedRuntimeDetail:nye,getCachedRuntimeUpdateCapability:C4,getCronJob:tUe,getEnvironmentBuild:A0e,getEnvironmentManifest:_0e,getEnvironmentResources:N0e,getGeneratedAgentTestTrace:oye,getGithubCicdRuntimeBinding:P0e,getGithubDeliveryVersions:nA,getMediaCapabilities:HBe,getMyRuntimes:JBe,getRuntimeAgentInfo:XF,getRuntimeDetail:i7,getRuntimeStudioToolCapabilities:Y0e,getRuntimeUpdateCapability:oR,getRuntimes:_x,getSandboxImageUpdates:uye,getSession:iR,getSessionTrace:L_,getStudioAccess:B0e,getStudioUpdatePermissions:Q0e,getStudioUpdateStatus:U0e,getSystemInfo:d0e,getUiConfig:$0e,httpErrorMessage:an,importEnvironmentShareCodes:S0e,initializeGithubDeliveryMain:I0e,inspectEnvironmentRepository:x0e,inspectEnvironmentShareCodes:O0e,invalidateRuntimeUpdateCapabilityCache:A4,listApps:Lbe,listCronJobRuns:E4,listCronJobs:k4,listDeploymentResources:o0e,listEnvironments:Vk,listIdentityUserPools:aR,listModelApiKeys:VF,listModelOptions:Ex,listSessions:WF,listWorkspaces:e7,mediaContentUrl:Jbe,parseEnvironmentManifest:h0e,parseEnvironmentShareCodes:YF,parsePreparedSessionEnvironmentMounts:l0e,prefetchAgentFeedbackCases:zBe,prefetchRuntimeAgentInfo:n0e,prefetchRuntimeDetail:iye,prefetchRuntimeUpdateCapability:T4,prepareSessionEnvironmentMounts:c0e,previewArtifact:KF,probeRuntimeA2a:J0e,probeRuntimeApps:Fv,refreshAgentFeedbackCases:Wbe,registerRemoteApp:Pbe,revealModelApiKey:Mbe,revealRuntimeApiKey:eye,runCronJobNow:G0e,runGeneratedAgentTestSSE:lye,runSSE:w4,runSseEmptyResponseError:s0e,runSseFirstEventTimeoutError:$v,runSseIncompleteResponseError:tA,runtimeRegionCandidates:Qk,setClientCloudProvider:Ube,setCronJobEnabled:W0e,startStudioUpdate:z0e,studioFetch:Tn,submitIssueFeedback:v4,submitMessageFeedback:Vbe,syncGithubCicdRuntime:M0e,updateCodexSandboxToolModelEnv:XBe,updateCronJob:q0e,updateEnvironment:C0e,updateSandboxTool:dye,updateWorkspace:y0e,uploadMedia:Ybe,upsertCachedAgentFeedbackCase:J2,webSearch:r0e,writeEnvironmentShareCode:u0e},Symbol.toStringTag,{value:"Module"})),AW=Object.freeze({totalTokenCount:0,promptTokenCount:0,candidatesTokenCount:0,thoughtsTokenCount:0,cachedContentTokenCount:0}),rA=Object.freeze({modelName:"",current:AW,cumulative:AW}),oUe={totalTokenCount:"total_token_count",promptTokenCount:"prompt_token_count",candidatesTokenCount:"candidates_token_count",thoughtsTokenCount:"thoughts_token_count",cachedContentTokenCount:"cached_content_token_count"},lUe=24,cUe=64,uUe=16;function JC(e){var l,c;const t=e.trim();if(!t)return 0;const n=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/gu,i=((l=t.match(n))==null?void 0:l.length)??0,r=t.replace(n," "),s=(r.match(/[A-Za-z0-9_]+/g)??[]).reduce((u,d)=>u+Math.max(1,Math.ceil(d.length/4)),0),a=((c=r.match(/[^\sA-Za-z0-9_]/g))==null?void 0:c.length)??0;return i+s+a}function dUe(e){var l,c,u;const t=((l=e.instruction)==null?void 0:l.trim())??"",n=((c=e.tools)==null?void 0:c.filter(d=>d.trim()))??[],i=((u=e.skills)==null?void 0:u.filter(d=>d.name.trim()))??[],r=JC(t),s=n.reduce((d,f)=>d+cUe+JC(f),0),a=i.reduce((d,f)=>d+uUe+JC(f.name)+JC(f.description??""),0);return lUe+r+s+a}function fUe({usage:e,contextWindow:t,estimatedSystemTokens:n}){const i=Math.max(1,Math.round(t)),r=Math.max(0,e.current.promptTokenCount),s=Math.max(r,e.current.totalTokenCount),a=Math.min(i,r>0?Math.min(r,Math.max(0,n??0)):Math.max(0,n??0)),l=Math.max(0,r-a),c=r>0?Math.max(0,s-r):Math.max(0,s),u=r>0?s:a+c;return{systemTokens:a,inputTokens:l,outputTokens:c,remainingTokens:Math.max(0,i-u),usedTokens:u,contextWindow:i}}function hUe(e){const t=[{kind:"system",tokens:e.systemTokens},{kind:"input",tokens:e.inputTokens},{kind:"output",tokens:e.outputTokens},{kind:"remaining",tokens:e.remainingTokens}],n=e.contextWindow/100;let i=0;const r=t.map(s=>{const a=i;return i+=s.tokens,{...s,start:a,end:i}});return Array.from({length:100},(s,a)=>{const l=a*n,c=l+n,u=r.flatMap(d=>{const f=Math.max(0,Math.min(c,d.end)-Math.max(l,d.start));return f>0?[{kind:d.kind,share:f/n}]:[]});return{index:a,slices:u}})}function L1(e,t){const n=e,i=n[t]??n[oUe[t]];return typeof i=="number"&&Number.isFinite(i)&&i>0?Math.round(i):0}function pUe(e){const t=L1(e,"promptTokenCount"),n=L1(e,"candidatesTokenCount"),i=L1(e,"thoughtsTokenCount");return{totalTokenCount:L1(e,"totalTokenCount")||t+n+i,promptTokenCount:t,candidatesTokenCount:n,thoughtsTokenCount:i,cachedContentTokenCount:L1(e,"cachedContentTokenCount")}}function mUe(e,t){return{totalTokenCount:e.totalTokenCount+t.totalTokenCount,promptTokenCount:e.promptTokenCount+t.promptTokenCount,candidatesTokenCount:e.candidatesTokenCount+t.candidatesTokenCount,thoughtsTokenCount:e.thoughtsTokenCount+t.thoughtsTokenCount,cachedContentTokenCount:e.cachedContentTokenCount+t.cachedContentTokenCount}}function fye(e,t){if(!t)return e;const n=typeof t.modelVersion=="string"?t.modelVersion.trim():"",i=typeof t.model_version=="string"?t.model_version.trim():"",r=n||i||e.modelName,s=t.usageMetadata??t.usage_metadata;if(!s)return r===e.modelName?e:{...e,modelName:r};const a=pUe(s);return a.totalTokenCount===0?r===e.modelName?e:{...e,modelName:r}:{modelName:r,current:a,cumulative:mUe(e.cumulative,a)}}function _W(e){return e.reduce((t,n)=>fye(t,n),rA)}function NW(e){return e.blocks.flatMap(t=>t.kind==="tool"?[{name:t.name,args:t.args,response:t.response,done:t.done}]:[])}function gUe(e){const t=e.attributes;return String(t["invocation.id"]??t["gen_ai.invocation.id"]??t["gcp.vertex.agent.invocation_id"]??"")}function bUe(e,t){if(!t)return e;const n=new Set(e.filter(r=>gUe(r)===t).map(r=>r.trace_id)),i=e.filter(r=>n.has(r.trace_id));return i.length>0?i:e}function bb(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Fp(e){return typeof e=="string"?e:""}function hye(e,t){return e==="pending"||e==="running"||e==="completed"||e==="failed"?e:t}function yUe(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=bb(t)??{};return bb(n.result)??n}function vUe(e){var n;const t=(n=bb(e))==null?void 0:n.branches;return Array.isArray(t)?t.map(i=>{var r;return Fp((r=bb(i))==null?void 0:r.label)}):[]}function pye(e,t,n){const i=vUe(e),r=yUe(t),s=Array.isArray(r.branches)?r.branches:[],a=n==="running"?"running":"pending";return{branches:[0,1].map(c=>{const u=bb(s[c])??{};return{label:Fp(u.label)||i[c]||`方向 ${c+1}`,content:Fp(u.content),status:hye(u.status,a),error:Fp(u.error)}})}}function xUe(e){const t=bb(e),n=bb(t==null?void 0:t.veadkStudioToolProgress);return!n||n.toolName!=="branch_compare"||typeof n.branchIndex!="number"||n.branchIndex<0||n.branchIndex>1?null:{toolName:"branch_compare",requestId:Fp(n.requestId),branchIndex:n.branchIndex,label:Fp(n.label),delta:Fp(n.delta),status:hye(n.status,"running"),error:Fp(n.error)||void 0}}function wUe(e,t,n){return{branches:pye(e,t,"running").branches.map((s,a)=>a===n.branchIndex?{...s,label:n.label||s.label,content:s.content+n.delta,status:n.status,error:n.error??s.error}:s)}}function Ha(e,t){return sn.t(`blocks.codexProgress.${e}`,{ns:"conversation",...t})}const mye=28e4;function jW(e){try{return JSON.stringify(e).length}catch{return mye}}function OUe(e){const t=e.slice(-200);let n=t.reduce((i,r)=>i+jW(r),0);for(;t.length>1&&n>mye;)n-=jW(t.shift());return t}function Jl(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Ci(e){return typeof e=="string"?e:""}function r7(e,t=""){const n=Ci(e).toLowerCase();return t.endsWith(".failed")||["failed","error","declined","cancelled"].includes(n)?"failed":t.endsWith(".completed")||["completed","done","success"].includes(n)?"completed":"running"}function gye(e){if(e.response!==void 0)return e.response;if(e.result!==void 0)return e.result;const t=e.aggregatedOutput??e.aggregated_output??e.output,n=e.exitCode??e.exit_code;if(!(t===void 0&&n===void 0))return{...t!==void 0?{output:t}:{},...n!==void 0?{exitCode:n}:{}}}function bye(e){if(e.args!==void 0)return e.args;if(e.arguments!==void 0)return e.arguments;if(e.input!==void 0)return e.input;const t=Ci(e.command),n=Ci(e.cwd);if(t||n)return{...t?{command:t}:{},...n?{cwd:n}:{}};if(e.changes!==void 0)return{changes:e.changes};if(e.approval!==void 0)return e.approval}function wg(e,t,n,i,r){return{kind:"tool",name:e,callId:t,args:i,response:r,done:n!=="running",status:n,...n==="failed"?{defaultOpen:!0}:{}}}function yye(e){const t=Ci(e.id||e.itemId||e.item_id),n=Ci(e.kind);if(!t||!n)return null;const i=r7(e.status),r=Ci(e.text||e.detail||e.delta),s=!Ci(e.text||e.detail)&&typeof e.delta=="string";if(n==="thinking"||n==="reasoning")return r?{id:t,block:{kind:"thinking",text:r,done:i!=="running"},appendText:s}:null;if(n==="commentary")return r?{id:t,block:{kind:"text",text:r},appendText:s}:null;if(["message","text","assistant_final","final"].includes(n))return r?{id:t,block:{kind:"text",text:r},appendText:s,finalAnswer:!0}:null;if(n==="plan"){const a=Array.isArray(e.plan)?e.plan:[];return{id:t,block:{kind:"plan",title:Ci(e.title)||Ha("planTitle"),summary:r||void 0,items:a.flatMap(l=>{const c=Jl(l),u=Ci(c==null?void 0:c.text);if(!u)return[];const d=Ci(c==null?void 0:c.status);return[{text:u,status:["pending","in_progress","completed","failed"].includes(d)?d:"pending"}]}),done:i!=="running"}}}if(["tool","command","command_execution","commandExecution","file_change","fileChange","mcp_tool_call","mcpToolCall","collab_tool_call","web_search","approval","status"].includes(n)){const a=Ha(n==="file_change"||n==="fileChange"?"fallback.fileChange":n==="approval"?"fallback.approval":n==="status"?"fallback.status":"fallback.command"),l=bye(e),c=gye(e)??(n==="status"&&r||void 0);return{id:t,block:wg(Ci(e.name||e.title)||a,t,i,l,c)}}return null}function vye(e){const t=Ci(e.type),n=Jl(e.item),i=Ci(n==null?void 0:n.type),r=Ci((n==null?void 0:n.id)||e.id)||(t==="turn.failed"?"turn":"");if(!r)return null;const s=r7(n==null?void 0:n.status,t);if(i==="reasoning"||i==="agent_message"){const a=Ci(n==null?void 0:n.text);return a?{id:r,block:i==="reasoning"?{kind:"thinking",text:a,done:s!=="running"}:{kind:"text",text:a},...i==="agent_message"&&(n==null?void 0:n.phase)!=="commentary"?{finalAnswer:!0}:{}}:null}if(i==="todo_list"){const l=(Array.isArray(n==null?void 0:n.items)?n.items:[]).flatMap(c=>{const u=Jl(c),d=Ci(u==null?void 0:u.text);if(!d)return[];const f=Ci(u==null?void 0:u.status).toLowerCase(),h=(u==null?void 0:u.completed)===!0||["completed","done"].includes(f)?"completed":["failed","error"].includes(f)?"failed":["in_progress","running"].includes(f)?"in_progress":"pending";return[{text:d,status:h}]});return l.length?{id:r,block:{kind:"plan",title:Ha("planTitle"),summary:Ha("planSummary",{completed:l.filter(c=>c.status==="completed").length,total:l.length}),items:l,done:s!=="running"}}:null}if(i==="command_execution"){const a=Ha(`command.${s}`);return{id:r,block:wg(a,r,s,bye(n??{}),gye(n??{}))}}if(i==="file_change"){const a=Array.isArray(n==null?void 0:n.changes)?n.changes:[],l=a.length?Ha("projectFiles",{count:a.length}):Ha("projectFile"),c=Ha(`fileChange.${s}`,{subject:l});return{id:r,block:wg(c,r,s,a.length?{changes:a}:void 0)}}if(i==="mcp_tool_call"){const a=[Ci(n==null?void 0:n.server),Ci(n==null?void 0:n.tool)].filter(Boolean).join("/")||Ha("externalTool"),l=Ha(`mcp.${s}`,{tool:a}),c=Jl(n==null?void 0:n.error),u=(n==null?void 0:n.result)!==void 0?n.result:Ci(c==null?void 0:c.message)||void 0;return{id:r,block:wg(l,r,s,n==null?void 0:n.arguments,u)}}if(i==="collab_tool_call"){const a=Ci(n==null?void 0:n.tool),l=["spawn_agent","send_input","wait","close_agent"].includes(a)?a:"default",c=Ha(`collaboration.${l}.${s}`),u=Object.fromEntries(["tool","receiver_thread_ids","prompt"].filter(d=>(n==null?void 0:n[d])!==void 0).map(d=>[d,n==null?void 0:n[d]]));return{id:r,block:wg(c,r,s,Object.keys(u).length?u:void 0,n==null?void 0:n.agents_states)}}if(i==="web_search"){const a=Ha(`webSearch.${s}`),l=Object.fromEntries(["query","action"].filter(c=>(n==null?void 0:n[c])!==void 0).map(c=>[c,n==null?void 0:n[c]]));return{id:r,block:wg(a,r,s,Object.keys(l).length?l:void 0)}}if(i==="error"||t==="error"||t==="turn.failed"){const a=Jl(e.error),l=Ci((n==null?void 0:n.message)||e.message||(a==null?void 0:a.message))||Ha("errorDetail");return{id:r,block:wg(Ha("errorTitle"),r,"failed",void 0,l)}}return null}function SUe(e){const t=Jl(e),n=Jl(t==null?void 0:t.veadkStudioToolProgress);if(!n||n.kind!=="codex")return null;const i=Ci(n.toolName),r=Ci(n.requestId);if(!i||!r)return null;const s=Jl(n.event??n.activity);if(!s)return null;const a=Jl(s.item)||Ci(s.type)?vye(s):yye(s);if(!a)return null;const l=Ci(n.title||n.label),c=Ci(s.agentSessionId??s.agent_session_id),u=Ci(s.sandboxSessionId??s.sandbox_session_id),d=Ci(s.threadId??s.thread_id),f=r7(s.status,Ci(s.type)),p=Ci(s.kind)==="status"&&f!=="running"?f:void 0;return{toolName:i,requestId:r,...l?{title:l}:{},...c?{agentSessionId:c}:{},...u?{sandboxSessionId:u}:{},...d?{threadId:d}:{},...p?{terminalStatus:p}:{},event:a}}function kUe(e,t){const n=Jl(t),i=Jl((n==null?void 0:n.codexActivity)??(n==null?void 0:n.codex_activity));if(!i)return e;const r=Ci(i.title)||(e==null?void 0:e.title)||"Codex Sandbox",s=Ci(i.agentSessionId??i.agent_session_id)||(e==null?void 0:e.agentSessionId),a=Ci(i.sandboxSessionId??i.sandbox_session_id)||(e==null?void 0:e.sandboxSessionId),l=Ci(i.threadId??i.thread_id)||(e==null?void 0:e.threadId);let c={title:r,...s?{agentSessionId:s}:{},...a?{sandboxSessionId:a}:{},...l?{threadId:l}:{},items:(e==null?void 0:e.items.slice())??[]};const u=Array.isArray(i.events)?i.events:[];for(const d of u){const f=Jl(d);if(!f)continue;const h=Jl(f.item)||Ci(f.type)?vye(f):yye(f);h&&(h.finalAnswer||(c=_4(c,{title:r,...s?{agentSessionId:s}:{},...a?{sandboxSessionId:a}:{},...l?{threadId:l}:{},event:h})))}return c}function _4(e,t){const n=(e==null?void 0:e.items.slice())??[],i=n.findIndex(r=>r.id===t.event.id);if(i>=0){const r=n[i].block,s=t.event.block;t.event.appendText&&r.kind==="text"&&s.kind==="text"?n[i]={id:t.event.id,block:{...s,text:r.text+s.text}}:t.event.appendText&&r.kind==="thinking"&&s.kind==="thinking"?n[i]={id:t.event.id,block:{...s,text:r.text+s.text}}:n[i]={id:t.event.id,block:s}}else n.push({id:t.event.id,block:t.event.block});return{title:t.title||(e==null?void 0:e.title)||"Codex Sandbox",...t.agentSessionId||e!=null&&e.agentSessionId?{agentSessionId:t.agentSessionId||(e==null?void 0:e.agentSessionId)}:{},...t.sandboxSessionId||e!=null&&e.sandboxSessionId?{sandboxSessionId:t.sandboxSessionId||(e==null?void 0:e.sandboxSessionId)}:{},...t.threadId||e!=null&&e.threadId?{threadId:t.threadId||(e==null?void 0:e.threadId)}:{},items:OUe(n)}}const xye="send_a2ui_json_to_client",N4="validated_a2ui_json",j4="adk_request_credential",RW="transfer_to_agent";function EUe(e){var i,r,s,a;const t=e,n=((i=t==null?void 0:t.exchangedAuthCredential)==null?void 0:i.oauth2)??((r=t==null?void 0:t.exchanged_auth_credential)==null?void 0:r.oauth2)??((s=t==null?void 0:t.rawAuthCredential)==null?void 0:s.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 R4(){return{blocks:[],liveStart:0,pendingCodexProgress:[]}}function IW(e,t){if(t.event.finalAnswer)return"applied";let n=-1;for(let i=e.length-1;i>=0;i-=1){const r=e[i];if(!(r.kind!=="tool"||r.name!==t.toolName)){if(r.callId===t.requestId)return r.done?"completed":(r.codexActivity=_4(r.codexActivity,t),r.status=t.terminalStatus??"running",t.terminalStatus&&(r.done=!0),"applied");if(!r.done){if(n>=0)return"unmatched";n=i}}}if(n>=0){const i=e[n];return i.kind!=="tool"?"unmatched":(i.codexActivity=_4(i.codexActivity,t),i.status=t.terminalStatus??"running",t.terminalStatus&&(i.done=!0),"applied")}return"unmatched"}function CUe(e){if(!e||typeof e!="object"||Array.isArray(e))return"completed";const t=e,n=typeof t.status=="string"?t.status.toLowerCase():"";return t.ok===!1||["error","failed","denied","declined","cancelled","timeout"].includes(n)?"failed":"completed"}function PW(e){if(!e||typeof e!="object"||Array.isArray(e))return"";const t=e;return t.ok!==!0||typeof t.message!="string"?"":t.message.trim()}const I4=e=>e.functionCall??e.function_call,yS=e=>e.functionResponse??e.function_response;function TUe(e){if(!e||typeof e!="object")return"";const t=e,n=t.agentName??t.agent_name;return typeof n=="string"?n:""}function AUe(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function lR(e){const t=[];for(const[n,i]of e.entries()){const r=i.partMetadata??i.part_metadata,s=r==null?void 0:r.veadkTransport;if((s==null?void 0:s.hidden)===!0)continue;const a=r==null?void 0:r.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=i.inlineData??i.inline_data;if(l&&l.data){t.push({id:`inline-${n}-${l.displayName??l.display_name??"media"}`,mimeType:l.mimeType??l.mime_type,data:AUe(l.data),name:l.displayName??l.display_name});continue}const c=i.fileData??i.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 vS(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 _Ue=new Set(["llm","sequential","parallel","loop","a2a"]);function NUe(e){var t;for(const n of e){const i=(t=n.partMetadata??n.part_metadata)==null?void 0:t.veadkInvocation;if(!i||typeof i!="object")continue;const r=i,s=Array.isArray(r.skills)?r.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=r.targetAgent;if(l&&typeof l=="object"){const c=l,u=c.type;typeof c.name=="string"&&typeof u=="string"&&_Ue.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(s.length>0||a)return{skills:s,targetAgent:a}}}function jUe(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 RUe(e,t){if(!t.length)return;const n=e[e.length-1];if((n==null?void 0:n.kind)==="artifact"){for(const i of t)n.files.some(r=>r.filename===i.filename&&r.version===i.version)||n.files.push(i);return}e.push({kind:"artifact",files:t})}function PD(e,t,n){const i=e[e.length-1];i&&i.kind===t?i.text+=n:e.push(t==="thinking"?{kind:t,text:n,done:!1}:{kind:t,text:n})}function eT(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function wye(e,t){var d,f,h,p,g,b;const n=e.blocks.map(v=>({...v}));let i=e.liveStart,r=e.pendingCodexProgress.slice();const s=((d=t.content)==null?void 0:d.parts)??[],a=s.flatMap(v=>{const y=xUe(v.partMetadata??v.part_metadata);return y?[y]:[]}),l=s.flatMap(v=>{const y=SUe(v.partMetadata??v.part_metadata);return y?[y]:[]});if(a.length>0||l.length>0){for(const v of a)for(let y=n.length-1;y>=0;y-=1){const x=n[y];if(!(x.kind!=="tool"||x.done||x.name!==v.toolName||v.requestId&&x.callId&&x.callId!==v.requestId)){x.response=wUe(x.args,x.response,v),x.status="running";break}}for(const v of l)IW(n,v)==="unmatched"&&(r=[...r,v].slice(-64));return{blocks:n,liveStart:i,pendingCodexProgress:r}}const c=s.some(v=>I4(v)||yS(v));if(t.partial&&!c){for(const v of s){const y=vS(v);typeof y=="string"&&y&&PD(n,v.thought?"thinking":"text",y)}return{blocks:n,liveStart:i,pendingCodexProgress:r}}n.length=i;for(const v of s){const y=I4(v),x=yS(v),O=lR([v]),w=vS(v);if(typeof w=="string"&&w)PD(n,v.thought?"thinking":"text",w);else if(O.length)eT(n),jUe(n,O);else if(y)if(eT(n),y.name===RW){const k=TUe(y.args)||((f=t.actions)==null?void 0:f.transferToAgent)||((h=t.actions)==null?void 0:h.transfer_to_agent)||sn.t("app:common.unknownAgent");n.push({kind:"agent-transfer",agentName:k,done:!1})}else if(y.name===j4){const k=y.args??{},S=k.authConfig??k.auth_config??k,C=String(k.functionCallId??k.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;n.push({kind:"auth",callId:y.id??"",label:C,authUri:EUe(S),authConfig:S,done:!1})}else{const k={kind:"tool",name:y.name??"",callId:y.id,args:y.args,done:!1};if(n.push(k),k.callId){const S=[];for(const E of r)E.toolName===k.name&&E.requestId===k.callId?IW(n,E):S.push(E);r=S}}else if(x){if(eT(n),x.name===RW)for(let k=n.length-1;k>=0;k--){const S=n[k];if(S.kind==="agent-transfer"&&!S.done){S.done=!0;break}}if(x.name===j4)for(let k=n.length-1;k>=0;k--){const S=n[k];if(S.kind==="auth"&&!S.done){S.done=!0;break}}for(let k=n.length-1;k>=0;k--){const S=n[k],E=S.kind==="tool"&&S.name==="delegate_to_codex_sandbox";if(S.kind==="tool"&&(!S.done||E)&&S.name===x.name&&(!x.id||!S.callId||S.callId===x.id)){const C=E?PW(S.response):"";if(S.done=!0,S.response=x.response,E){S.codexActivity=kUe(S.codexActivity,x.response),S.status=CUe(x.response);const N=PW(x.response);N&&N!==C&&PD(n,"text",N)}break}}if(x.name===xye){const k=((p=x.response)==null?void 0:p[N4])??[];if(k.length){const S=n[n.length-1];S&&S.kind==="a2ui"?S.messages.push(...k):n.push({kind:"a2ui",messages:k})}}}}const u=((g=t.actions)==null?void 0:g.artifactDelta)??((b=t.actions)==null?void 0:b.artifact_delta);return u&&RUe(n,Object.entries(u).map(([v,y])=>({filename:v,version:y}))),eT(n),i=n.length,{blocks:n,liveStart:i,pendingCodexProgress:r}}function IUe(e,t){var u,d,f,h,p,g;if(e.partial===!0)return!1;const n=((u=e.content)==null?void 0:u.parts)??[],i=n.some(b=>{const v=vS(b);return!b.thought&&typeof v=="string"&&v.trim().length>0||lR([b]).length>0}),r=n.some(b=>{var y;const v=yS(b);return(v==null?void 0:v.name)===xye&&Array.isArray((y=v.response)==null?void 0:y[N4])&&v.response[N4].length>0}),s=((d=e.actions)==null?void 0:d.artifactDelta)??((f=e.actions)==null?void 0:f.artifact_delta),a=!!(s&&Object.keys(s).length>0),l=!!(((h=e.actions)==null?void 0:h.endOfAgent)??((p=e.actions)==null?void 0:p.end_of_agent)??((g=e.actions)==null?void 0:g.escalate)),c=t.some(b=>b.kind==="text"||b.kind==="attachment"||b.kind==="artifact"||b.kind==="a2ui"||b.kind==="delivery");return i||r||a||l&&c}function PUe(e){var n,i,r;const t=((n=e.actions)==null?void 0:n.artifactDelta)??((i=e.actions)==null?void 0:i.artifact_delta);return t&&Object.keys(t).length>0?!0:(((r=e.content)==null?void 0:r.parts)??[]).some(s=>!!(vS(s)||lR([s]).length>0||I4(s)||yS(s)))}function $_(e="adk-stream",t){var a,l,c;let n=0;const i=new Map;let r;const s=(u,d)=>`${d}\0${u}`;if((t==null?void 0:t.role)==="assistant"){const u=((a=t.meta)==null?void 0:a.author)??"",d=((l=t.meta)==null?void 0:l.invocationId)??"",f=((c=t.meta)==null?void 0:c.localId)??`${e}-${n++}`,h=R4();h.blocks=t.blocks,h.liveStart=t.blocks.length,r=s(u,d),i.set(r,{acc:h,localId:f,meta:{...t.meta,localId:f,streaming:!0,eventId:void 0}})}return{project(u){const d=u.author&&u.author!=="user"?u.author:"",f=u.invocationId??u.invocation_id??"",h=s(d,f);let p=i.get(h);if(!p&&r){const y=i.get(r);y&&(!y.meta.author||y.meta.author===d)&&(i.delete(r),r=void 0,p=y)}if(!p&&!PUe(u))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(!p){const y=`${e}-${n++}`;p={acc:R4(),localId:y,meta:{author:d||void 0,invocationId:f||void 0}}}p.acc=wye(p.acc,u);const g=u.usageMetadata??u.usage_metadata,b=IUe(u,p.acc.blocks);p.meta={...p.meta,author:d||p.meta.author,localId:p.localId,streaming:!b,tokens:(g==null?void 0:g.totalTokenCount)||p.meta.tokens,ts:u.timestamp||p.meta.ts,invocationId:f||p.meta.invocationId,eventId:b&&u.id?u.id:p.meta.eventId};const v={role:"assistant",blocks:p.acc.blocks,meta:p.meta};return b?(i.delete(h),r=void 0):i.set(h,p),{turn:v,completed:b}},finish(){const u=[...i.values()].map(d=>({role:"assistant",blocks:d.acc.blocks,meta:{...d.meta,streaming:!1}}));return i.clear(),u}}}function Dg(e,t){var s;const n=(s=t.meta)==null?void 0:s.localId;if(!n)return[...e,t];const i=e.findIndex(a=>{var l;return((l=a.meta)==null?void 0:l.localId)===n});if(i<0)return[...e,t];const r=e.slice();return r[i]=t,r}function DUe(e,t={}){var r;let n=[],i=$_("adk-history");for(const s of e)if(s.author==="user"){const l=((r=s.content)==null?void 0:r.parts)??[];if(l.some(h=>{var p;return((p=yS(h))==null?void 0:p.name)===j4})){for(let h=n.length-1;h>=0;h--)if(n[h].role==="assistant"){for(let p=n[h].blocks.length-1;p>=0;p--){const g=n[h].blocks[p];if(g.kind==="auth"){g.done=!0;break}}break}}const c=l.map(vS).filter(h=>!!h).join(""),u=lR(l),d=NUe(l);if(!c&&!u.length&&!d)continue;for(const h of i.finish())n=Dg(n,h);const f=[];d&&f.push({kind:"invocation",value:d}),u.length&&f.push({kind:"attachment",files:u}),c&&f.push({kind:"text",text:c}),n.push({role:"user",blocks:f,meta:{ts:s.timestamp}}),i=$_("adk-history")}else{const l=i.project(s);l.ignored||(n=Dg(n,l.turn))}for(const s of i.finish())n=Dg(n,s);for(const s of n){const a=s.meta,l=a==null?void 0:a.eventId;if(!l)continue;const c=t[`veadk_feedback:${l}`];if(!c||typeof c!="object")continue;const u=c;u.rating!=="good"&&u.rating!=="bad"||(a.feedback=c)}return n}function cR(e,t=sn.t("app:titles.newConversation")){var n,i;for(const r of e??[])if(r.author==="user"||((n=r.content)==null?void 0:n.role)==="user"){const s=(((i=r.content)==null?void 0:i.parts)??[]).map(a=>a.text).find(Boolean);if(s)return s}return t}function Oye(e,t,n){if(e.name===t||e.id===t)return(n==null?void 0:n.type)==="parallel"?n:void 0;for(const i of e.children){const r=Oye(i,t,e);if(r)return r}}function MUe(e,t){var a,l;if(e.role!=="assistant"||!t)return;const n=(a=e.meta)==null?void 0:a.author;if(!n)return;const i=Oye(t,n);if(!i)return;const r=i.id||i.path.join("/")||i.name;return{key:`${((l=e.meta)==null?void 0:l.invocationId)??""}::${r}`,parent:i.name}}function LUe(e,t){const n=[];return e.forEach((i,r)=>{const s=MUe(i,t),a=n[n.length-1];if(s&&(a==null?void 0:a.groupKey)===s.key){a.turnIndexes.push(r);return}n.push({key:s?`parallel-${s.key}-${r}`:`turn-${r}`,turnIndexes:[r],parallelParent:s==null?void 0:s.parent,groupKey:s==null?void 0:s.key})}),n.map(({groupKey:i,...r})=>r)}function Sye(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t{const t=m.Children.toArray(e),n=[];let i="";const r=()=>{i!==""&&(n.push(i),i="")};for(const s of t)if(!(s==null||typeof s=="boolean")){if(typeof s=="string"||typeof s=="number"){i+=String(s);continue}r(),n.push(s)}return r(),n},s7=e=>{const t=$Ue(e),n=m.Children.count(t);return m.Children.map(t,i=>{if(typeof i=="string"&&i.trim())return n<=1?i:o.jsx("span",{children:i});if(m.isValidElement(i)){const r=i,{children:s,...a}=r.props;return s!=null?m.cloneElement(r,a,s7(s)):r}return i})},FUe="_Badge_1viyg_1",BUe={Badge:FUe},ba=({children:e,className:t,variant:n="soft",color:i="secondary",size:r="sm",pill:s,...a})=>o.jsx("div",{className:pi(BUe.Badge,t),"data-color":i,"data-size":r,"data-pill":s?"":void 0,"data-variant":n,...a,children:s7(e)});var UUe=typeof Ip=="object"&&Ip&&Ip.Object===Object&&Ip,QUe=typeof self=="object"&&self&&self.Object===Object&&self;UUe||QUe||Function("return this")();var zUe=typeof window<"u"?m.useLayoutEffect:m.useEffect;function VUe(){const e=m.useRef(!1);return m.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),m.useCallback(()=>e.current,[])}var DW={width:void 0,height:void 0};function kye(e){const{ref:t,box:n="content-box"}=e,[{width:i,height:r},s]=m.useState(DW),a=VUe(),l=m.useRef({...DW}),c=m.useRef(void 0);return c.current=e.onResize,m.useEffect(()=>{if(!t.current||typeof window>"u"||!("ResizeObserver"in window))return;const u=new ResizeObserver(([d])=>{const f=n==="border-box"?"borderBoxSize":n==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",h=MW(d,f,"inlineSize"),p=MW(d,f,"blockSize");if(l.current.width!==h||l.current.height!==p){const b={width:h,height:p};l.current.width=h,l.current.height=p,c.current?c.current(b):a()&&s(b)}});return u.observe(t.current,{box:n}),()=>{u.disconnect()}},[n,t,a]),{width:i,height:r}}function MW(e,t,n){return e[t]?Array.isArray(e[t])?e[t][0][n]:e[t][n]:t==="contentBoxSize"?e.contentRect[n==="inlineSize"?"width":"height"]:void 0}function a7(e,t){const n=m.useRef(e);zUe(()=>{n.current=e},[e]),m.useEffect(()=>{if(!t&&t!==0)return;const i=setTimeout(()=>{n.current()},t);return()=>{clearTimeout(i)}},[t])}const HUe={DEV:!1,MODE:"production"},Yy=typeof import.meta<"u"?HUe:void 0,qUe=!!(Yy!=null&&Yy.DEV),WUe=typeof navigator<"u"&&/(jsdom|happy-dom)/i.test(navigator.userAgent)||typeof globalThis.happyDOM=="object",Eye=(Yy==null?void 0:Yy.MODE)==="test"||WUe,GUe=typeof window<"u",Cye=typeof document<"u",KUe=GUe&&Cye,o7=e=>{const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const n=t.offsetWidth;let i=.985;n<=80?i=.96:n<=150?i=.97:n<=220?i=.98:n>600&&(i=.995),t.style.setProperty("--scale",i.toString())},F_=(e,t)=>{const n=()=>{const a=setTimeout(e);return()=>{clearTimeout(a)}};if(!KUe||typeof window.requestAnimationFrame!="function"||Cye&&document.visibilityState==="hidden")return n();let r=2,s=window.requestAnimationFrame(function a(){r-=1,r===0?e():s=window.requestAnimationFrame(a)});return()=>{typeof window.cancelAnimationFrame=="function"&&window.cancelAnimationFrame(s)}},Wb=e=>Object.keys(e).reduce((n,i)=>{const r=e[i];if(r||r===0){const s=i.startsWith("--")?"":"--",a=typeof r=="number"?`${r}px`:r;n[`${s}${i}`]=a}return n},{}),DD=e=>typeof e=="number"?`${e}deg`:e,MD=e=>String(e),tT=e=>`${e}ms`,LD=({x:e,y:t,scale:n,rotate:i,skewX:r,skewY:s}={})=>{const a=[e==null?null:`translateX(${e}px)`,t==null?null:`translateY(${t}px)`,n==null?null:`scale(${n})`,i==null?null:`rotate(${DD(i)})`,r==null?null:`skewX(${DD(r)})`,s==null?null:`skewY(${DD(s)})`].filter(Boolean);return a.length?a.join(" "):"none"},$D=({blur:e}={})=>{const t=[e==null?null:`blur(${e}px)`].filter(Boolean);return t.length?t.join(" "):"none"},ih=e=>{e.preventDefault()},Tye=e=>e.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex^="-"]), [contenteditable]'),XUe="_LoadingIndicator_7yl6f_1",YUe={LoadingIndicator:XUe},Hk=({className:e,size:t,strokeWidth:n,style:i,...r})=>o.jsx("div",{...r,className:pi(YUe.LoadingIndicator,e),style:i||Wb({"indicator-size":t,"indicator-stroke":n})});var ZUe=Object.defineProperty,l7=(e,t)=>ZUe(e,"name",{value:t,configurable:!0});function P4(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}l7(P4,"setRef");function Aye(...e){return t=>{let n=!1;const i=e.map(r=>{const s=P4(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;rJUe(e,"name",{value:t,configurable:!0});function Oh(e){const t=m.forwardRef((n,i)=>{let{children:r,...s}=n,a=null,l=!1;const c=[];D4(r)&&typeof nT=="function"&&(r=nT(r._payload)),m.Children.forEach(r,h=>{var p;if(Pye(h)){l=!0;const g=h;let b="child"in g.props?g.props.child:g.props.children;D4(b)&&typeof nT=="function"&&(b=nT(b._payload)),a=eQe(g,b),c.push((p=a==null?void 0:a.props)==null?void 0:p.children)}else c.push(h)}),a?a=m.cloneElement(a,void 0,c):!l&&m.Children.count(r)===1&&m.isValidElement(r)&&(a=r);const u=a?Iye(a):void 0,d=ir(i,u);if(!a){if(r||r===0)throw new Error(l?iQe(e):nQe(e));return r}const f=Rye(s,a.props??{});return a.type!==m.Fragment&&(f.ref=i?d:u),m.cloneElement(a,f)});return t.displayName=`${e}.Slot`,t}qu(Oh,"createSlot");var _ye=Oh("Slot"),Nye=Symbol.for("radix.slottable");function jye(e){const t=qu(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=Nye,t}qu(jye,"createSlottable");var eQe=qu((e,t)=>{if("child"in e.props){const n=e.props.child;return m.isValidElement(n)?m.cloneElement(n,void 0,e.props.children(n.props.children)):null}return m.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function Rye(e,t){const n={...t};for(const i in t){const r=e[i],s=t[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...l)=>{const c=s(...l);return r(...l),c}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}qu(Rye,"mergeProps");function Iye(e){var i,r;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}qu(Iye,"getElementRef");function Pye(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Nye}qu(Pye,"isSlottable");var tQe=Symbol.for("react.lazy");function D4(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===tQe&&"_payload"in e&&Dye(e._payload)}qu(D4,"isLazyComponent");function Dye(e){return typeof e=="object"&&e!==null&&"then"in e}qu(Dye,"isPromiseLike");var nQe=qu(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),iQe=qu(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),nT=Fb[" use ".trim().toString()],rQe=Object.defineProperty,sQe=(e,t)=>rQe(e,"name",{value:t,configurable:!0}),aQe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],wr=aQe.reduce((e,t)=>{const n=Oh(`Primitive.${t}`),i=m.forwardRef((r,s)=>{const{asChild:a,...l}=r,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:s})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function c7(e,t){e&&Li.flushSync(()=>e.dispatchEvent(t))}sQe(c7,"dispatchDiscreteCustomEvent");var oQe=Object.defineProperty,lQe=(e,t)=>oQe(e,"name",{value:t,configurable:!0}),cQe=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),uQe=m.forwardRef(lQe(function(t,n){return o.jsx(wr.span,{...t,ref:n,style:{...cQe,...t.style}})},"VisuallyHidden")),dQe=uQe,fQe=Object.defineProperty,Qc=(e,t)=>fQe(e,"name",{value:t,configurable:!0});function hQe(e,t){const n=m.createContext(t);n.displayName=e+"Context";const i=Qc(s=>{const{children:a,...l}=s,c=m.useMemo(()=>l,Object.values(l));return o.jsx(n.Provider,{value:c,children:a})},"Provider");i.displayName=e+"Provider";function r(s,a={}){const{optional:l=!1}=a,c=m.useContext(n);if(c)return c;if(t!==void 0)return t;if(!l)throw new Error(`\`${s}\` must be used within \`${e}\``)}return Qc(r,"useContext"),[i,r]}Qc(hQe,"createContext");function kl(e,t=[]){let n=[];function i(s,a){const l=m.createContext(a);l.displayName=s+"Context";const c=n.length;n=[...n,a];const u=Qc(f=>{var y;const{scope:h,children:p,...g}=f,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=m.useMemo(()=>g,Object.values(g));return o.jsx(b.Provider,{value:v,children:p})},"Provider");u.displayName=s+"Provider";function d(f,h,p={}){var y;const{optional:g=!1}=p,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=m.useContext(b);if(v)return v;if(a!==void 0)return a;if(!g)throw new Error(`\`${f}\` must be used within \`${s}\``)}return Qc(d,"useContext"),[u,d]}Qc(i,"createContext");const r=Qc(()=>{const s=n.map(a=>m.createContext(a));return Qc(function(l){const c=(l==null?void 0:l[e])||s;return m.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])},"useScope")},"createScope");return r.scopeName=e,[i,Mye(r,...t)]}Qc(kl,"createContextScope");function Mye(...e){const t=e[0];if(e.length===1)return t;const n=Qc(()=>{const i=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return Qc(function(s){const a=i.reduce((l,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...l,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}Qc(Mye,"composeContextScopes");var pQe=Object.defineProperty,Pa=(e,t)=>pQe(e,"name",{value:t,configurable:!0});function u7(e){const t=e+"CollectionProvider",[n,i]=kl(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=Pa(b=>{const{scope:v,children:y}=b,x=m.useRef(null),O=m.useRef(new Map).current;return o.jsx(r,{scope:v,itemMap:O,collectionRef:x,children:y})},"CollectionProvider");a.displayName=t;const l=e+"CollectionSlot",c=Oh(l),u=m.forwardRef((b,v)=>{const{scope:y,children:x}=b,O=s(l,y),w=ir(v,O.collectionRef);return o.jsx(c,{ref:w,children:x})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=Oh(d),p=m.forwardRef((b,v)=>{const{scope:y,children:x,...O}=b,w=m.useRef(null),k=ir(v,w),S=s(d,y);return m.useEffect(()=>(S.itemMap.set(w,{ref:w,...O}),()=>void S.itemMap.delete(w))),o.jsx(h,{[f]:"",ref:k,children:x})});p.displayName=d;function g(b){const v=s(e+"CollectionConsumer",b);return m.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const O=Array.from(x.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((S,E)=>O.indexOf(S.ref.current)-O.indexOf(E.ref.current))},[v.collectionRef,v.itemMap])}return Pa(g,"useCollection"),[{Provider:a,Slot:u,ItemSlot:p},g,i]}Pa(u7,"createCollection");var LW=new WeakMap,Ws,Wl,FD=(Wl=class extends Map{constructor(n){super(n);cV(this,Ws);NP(this,Ws,[...super.keys()]),LW.set(this,!0)}set(n,i){return LW.get(this)&&(this.has(n)?uo(this,Ws)[uo(this,Ws).indexOf(n)]=n:uo(this,Ws).push(n)),super.set(n,i),this}insert(n,i,r){const s=this.has(i),a=uo(this,Ws).length,l=d7(n);let c=l>=0?l:a+l;const u=c<0||c>=a?-1:c;if(u===this.size||s&&u===this.size-1||u===-1)return this.set(i,r),this;const d=this.size+(s?0:1);l<0&&c++;const f=[...uo(this,Ws)];let h,p=!1;for(let g=c;g=this.size&&(s=this.size-1),this.at(s)}keyFrom(n,i){const r=this.indexOf(n);if(r===-1)return;let s=r+i;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return s;r++}}findIndex(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return r;r++}return-1}filter(n,i){const r=[];let s=0;for(const a of this)Reflect.apply(n,i,[a,s,this])&&r.push(a),s++;return new Wl(r)}map(n,i){const r=[];let s=0;for(const a of this)r.push([a[0],Reflect.apply(n,i,[a,s,this])]),s++;return new Wl(r)}reduce(...n){const[i,r]=n;let s=0,a=r??this.at(0);for(const l of this)s===0&&n.length===1?a=l:a=Reflect.apply(i,this,[a,l,s,this]),s++;return a}reduceRight(...n){const[i,r]=n;let s=r??this.at(-1);for(let a=this.size-1;a>=0;a--){const l=this.at(a);a===this.size-1&&n.length===1?s=l:s=Reflect.apply(i,this,[s,l,a,this])}return s}toSorted(n){const i=[...this.entries()].sort(n);return new Wl(i)}toReversed(){const n=new Wl;for(let i=this.size-1;i>=0;i--){const r=this.keyAt(i),s=this.get(r);n.set(r,s)}return n}toSpliced(...n){const i=[...this.entries()];return i.splice(...n),new Wl(i)}slice(n,i){const r=new Wl;let s=this.size-1;if(n===void 0)return r;n<0&&(n=n+this.size),i!==void 0&&i>0&&(s=i-1);for(let a=n;a<=s;a++){const l=this.keyAt(a),c=this.get(l);r.set(l,c)}return r}every(n,i){let r=0;for(const s of this){if(!Reflect.apply(n,i,[s,r,this]))return!1;r++}return!0}some(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return!0;r++}return!1}},Ws=new WeakMap,Pa(Wl,"OrderedDict"),Wl);function sA(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=Lye(e,t);return n===-1?void 0:e[n]}Pa(sA,"at");function Lye(e,t){const n=e.length,i=d7(t),r=i>=0?i:n+i;return r<0||r>=n?-1:r}Pa(Lye,"toSafeIndex");function d7(e){return e!==e||e===0?0:Math.trunc(e)}Pa(d7,"toSafeInteger");function mQe(e){const t=e+"CollectionProvider",[n,i]=kl(t),[r,s]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new FD,setItemMap:Pa(()=>{},"setItemMap")}),a=Pa(({state:O,...w})=>O?o.jsx(c,{...w,state:O}):o.jsx(l,{...w}),"CollectionProvider");a.displayName=t;const l=Pa(O=>{const w=v();return o.jsx(c,{...O,state:w})},"CollectionInit");l.displayName=t+"Init";const c=Pa(O=>{const{scope:w,children:k,state:S}=O,E=m.useRef(null),[C,N]=m.useState(null),_=ir(E,N),[j,A]=S;return m.useEffect(()=>{if(!C)return;const F=Bye(()=>{});return F.observe(C,{childList:!0,subtree:!0}),()=>{F.disconnect()}},[C]),o.jsx(r,{scope:w,itemMap:j,setItemMap:A,collectionRef:_,collectionRefObject:E,collectionElement:C,children:k})},"CollectionProviderImpl");c.displayName=t+"Impl";const u=e+"CollectionSlot",d=Oh(u),f=m.forwardRef((O,w)=>{const{scope:k,children:S}=O,E=s(u,k),C=ir(w,E.collectionRef);return o.jsx(d,{ref:C,children:S})});f.displayName=u;const h=e+"CollectionItemSlot",p="data-radix-collection-item",g=Oh(h),b=m.forwardRef((O,w)=>{const{scope:k,children:S,...E}=O,C=m.useRef(null),[N,_]=m.useState(null),j=ir(w,C,_),A=s(h,k),{setItemMap:F}=A,T=m.useRef(E);$ye(T.current,E)||(T.current=E);const P=T.current;return m.useEffect(()=>{const R=P;return F(L=>N?L.has(N)?L.set(N,{...R,element:N}).toSorted(M4):(L.set(N,{...R,element:N}),L.toSorted(M4)):L),()=>{F(L=>!N||!L.has(N)?L:(L.delete(N),new FD(L)))}},[N,P,F]),o.jsx(g,{[p]:"",ref:j,children:S})});b.displayName=h;function v(){return m.useState(new FD)}Pa(v,"useInitCollection");function y(O){const{itemMap:w}=s(e+"CollectionConsumer",O);return w}return Pa(y,"useCollection"),[{Provider:a,Slot:f,ItemSlot:b},{createCollectionScope:i,useCollection:y,useInitCollection:v}]}Pa(mQe,"createCollection");function $ye(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Pa($ye,"shallowEqual");function Fye(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Pa(Fye,"isElementPreceding");function M4(e,t){return!e[1].element||!t[1].element?0:Fye(e[1].element,t[1].element)?-1:1}Pa(M4,"sortByDocumentPosition");function Bye(e){return new MutationObserver(n=>{for(const i of n)if(i.type==="childList"){e();return}})}Pa(Bye,"getChildListObserver");var gQe=Object.defineProperty,Nx=(e,t)=>gQe(e,"name",{value:t,configurable:!0}),Uye=!!(typeof window<"u"&&window.document&&window.document.createElement);function yn(e,t,{checkForDefaultPrevented:n=!0}={}){return Nx(function(r){if(e==null||e(r),n===!1||!r||!r.defaultPrevented)return t==null?void 0:t(r)},"handleEvent")}Nx(yn,"composeEventHandlers");function bQe(e){var t;if(!Uye)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}Nx(bQe,"getOwnerWindow");function L4(e){if(!Uye)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}Nx(L4,"getOwnerDocument");function Qye(e,t=!1){const{activeElement:n}=L4(e);if(!(n!=null&&n.nodeName))return null;if(zye(n)&&n.contentDocument)return Qye(n.contentDocument.body,t);if(t){const i=n.getAttribute("aria-activedescendant");if(i){const r=L4(n).getElementById(i);if(r)return r}}return n}Nx(Qye,"getActiveElement");function zye(e){return e.tagName==="IFRAME"}Nx(zye,"isFrame");var Jc=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},yQe=Object.defineProperty,vQe=(e,t)=>yQe(e,"name",{value:t,configurable:!0}),$W=Fb[" useEffectEvent ".trim().toString()],FW=Fb[" useInsertionEffect ".trim().toString()];function Vye(e){if(typeof $W=="function")return $W(e);const t=m.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof FW=="function"?FW(()=>{t.current=e}):Jc(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}vQe(Vye,"useEffectEvent");var xQe=Object.defineProperty,qk=(e,t)=>xQe(e,"name",{value:t,configurable:!0}),wQe=Fb[" useInsertionEffect ".trim().toString()]||Jc;function su({prop:e,defaultProp:t,onChange:n=qk(()=>{},"onChange"),caller:i}){const[r,s,a]=Hye({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:r,u=m.useCallback(d=>{var f;if(l){const h=qye(d)?d(e):d;h!==e&&((f=a.current)==null||f.call(a,h))}else s(d)},[l,e,s,a]);return[c,u]}qk(su,"useControllableState");function Hye({defaultProp:e,onChange:t}){const[n,i]=m.useState(e),r=m.useRef(n),s=m.useRef(t);return wQe(()=>{s.current=t},[t]),m.useEffect(()=>{var a;r.current!==n&&((a=s.current)==null||a.call(s,n),r.current=n)},[n,r]),[n,i,s]}qk(Hye,"useUncontrolledState");function qye(e){return typeof e=="function"}qk(qye,"isFunction");var BW=Symbol("RADIX:SYNC_STATE");function OQe(e,t,n,i){const{prop:r,defaultProp:s,onChange:a,caller:l}=t,c=r!==void 0,u=Vye(a),d=[{...n,state:s}];i&&d.push(i);const[f,h]=m.useReducer((v,y)=>{if(y.type===BW)return{...v,state:y.state};const x=e(v,y);return c&&!Object.is(x.state,v.state)&&u(x.state),x},...d),p=f.state,g=m.useRef(p);m.useEffect(()=>{g.current!==p&&(g.current=p,c||u(p))},[p,g,c]);const b=m.useMemo(()=>r!==void 0?{...f,state:r}:f,[f,r]);return m.useEffect(()=>{c&&!Object.is(r,f.state)&&h({type:BW,state:r})},[r,f.state,c]),[b,h]}qk(OQe,"useControllableStateReducer");var SQe=Object.defineProperty,Sh=(e,t)=>SQe(e,"name",{value:t,configurable:!0});function Wye(e,t){return m.useReducer((n,i)=>t[n][i]??n,e)}Sh(Wye,"useStateMachine");var Gd=Sh(e=>{const{present:t,children:n}=e,i=Gye(t),r=typeof n=="function"?n({present:i.isPresent}):m.Children.only(n),s=Kye(i.ref,Xye(r));return typeof n=="function"||i.isPresent?m.cloneElement(r,{ref:s}):null},"Presence");function Gye(e){const[t,n]=m.useState(),i=m.useRef(null),r=m.useRef(e),s=m.useRef("none"),a=m.useRef(void 0),l=e?"mounted":"unmounted",[c,u]=Wye(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{c==="mounted"?(s.current=a.current??ty(i.current),a.current=void 0):s.current="none"},[c]),Jc(()=>{const d=i.current,f=r.current;if(f!==e){const p=s.current,g=ty(d);e?(a.current=g,u("MOUNT")):g==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&p!==g?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,u]),Jc(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,h=Sh(g=>{const v=ty(i.current).includes(CSS.escape(g.animationName));if(g.target===t&&v&&(u("ANIMATION_END"),!r.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},"handleAnimationEnd"),p=Sh(g=>{g.target===t&&(s.current=ty(i.current))},"handleAnimationStart");return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:m.useCallback(d=>{if(d){const f=getComputedStyle(d);i.current=f,a.current=ty(f)}else i.current=null;n(d)},[])}}Sh(Gye,"usePresence");function $4(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Sh($4,"setRef");function Kye(...e){const t=m.useRef(e);return t.current=e,m.useCallback(n=>{const i=t.current;let r=!1;const s=i.map(a=>{const l=$4(a,n);return!r&&typeof l=="function"&&(r=!0),l});if(r)return()=>{for(let a=0;akQe(e,"name",{value:t,configurable:!0}),CQe=Fb[" useId ".trim().toString()]||(()=>{}),TQe=0;function mm(e){const[t,n]=m.useState(CQe());return Jc(()=>{e||n(i=>i??String(TQe++))},[e]),e||(t?`radix-${t}`:"")}EQe(mm,"useId");var AQe=Object.defineProperty,_Qe=(e,t)=>AQe(e,"name",{value:t,configurable:!0}),NQe=m.createContext(void 0);function Wk(e){const t=m.useContext(NQe);return e||t||"ltr"}_Qe(Wk,"useDirection");var jQe=Object.defineProperty,RQe=(e,t)=>jQe(e,"name",{value:t,configurable:!0});function $u(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}RQe($u,"useCallbackRef");var IQe=Object.defineProperty,Ra=(e,t)=>IQe(e,"name",{value:t,configurable:!0}),F4="dismissableLayer.update",PQe="dismissableLayer.pointerDownOutside",DQe="dismissableLayer.focusOutside",UW,Yye=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),f7=m.forwardRef(Ra(function(t,n){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:l,onInteractOutside:c,onDismiss:u,...d}=t,f=m.useContext(Yye),[h,p]=m.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=m.useState({}),v=ir(n,p),y=Array.from(f.layers),[x]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),O=x?y.indexOf(x):-1,w=h?y.indexOf(h):-1,k=f.layersWithOutsidePointerEventsDisabled.size>0,S=w>=O,E=m.useRef(!1),C=Zye(A=>{a==null||a(A),c==null||c(A),A.defaultPrevented||u==null||u()},{ownerDocument:g,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:E,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(A=>{if(!(A instanceof Node))return!1;const F=[...f.branches].some(T=>T.contains(A));return S&&!F},[f.branches,S])}),N=Jye(A=>{if(r&&E.current)return;const F=A.target;[...f.branches].some(P=>P.contains(F))||(l==null||l(A),c==null||c(A),A.defaultPrevented||u==null||u())},g),_=h?w===y.length-1:!1,j=$u(A=>{A.key==="Escape"&&(s==null||s(A),!A.defaultPrevented&&u&&(A.preventDefault(),u()))});return m.useEffect(()=>{if(_)return g.addEventListener("keydown",j,{capture:!0}),()=>g.removeEventListener("keydown",j,{capture:!0})},[g,_,j]),m.useEffect(()=>{if(h)return i&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(UW=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),B4(),()=>{i&&(f.layersWithOutsidePointerEventsDisabled.delete(h),f.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=UW))}},[h,g,i,f]),m.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),B4())},[h,f]),m.useEffect(()=>{const A=Ra(()=>b({}),"handleUpdate");return document.addEventListener(F4,A),()=>document.removeEventListener(F4,A)},[]),o.jsx(wr.div,{...d,ref:v,style:{pointerEvents:k?S?"auto":"none":void 0,...t.style},onFocusCapture:yn(t.onFocusCapture,N.onFocusCapture),onBlurCapture:yn(t.onBlurCapture,N.onBlurCapture),onPointerDownCapture:yn(t.onPointerDownCapture,C.onPointerDownCapture)})},"DismissableLayer"));function MQe(){const e=m.useContext(Yye),[t,n]=m.useState(null);return m.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Ra(MQe,"useDismissableLayerSurface");var LQe=Ra(()=>!0,"IS_TRUE");function Zye(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:s,shouldHandlePointerDownOutside:a=LQe}=t,l=$u(e),c=m.useRef(!1),u=m.useRef(!1),d=m.useRef(new Map),f=m.useRef(()=>{});return m.useEffect(()=>{function h(){u.current=!1,r.current=!1,d.current.clear()}Ra(h,"resetOutsideInteraction");function p(){return Array.from(d.current.values()).some(Boolean)}Ra(p,"isOutsideInteractionIntercepted");function g(O){if(!u.current)return;const w=O.target;w instanceof Node&&[...s].some(S=>S.contains(w))||d.current.set(O.type,!0),O.type==="click"&&window.setTimeout(()=>{u.current&&f.current()},0)}Ra(g,"handleInteractionCapture");function b(O){u.current&&d.current.set(O.type,!1)}Ra(b,"handleInteractionBubble");const v=Ra(O=>{if(O.target&&!c.current){let w=function(){n.removeEventListener("click",f.current);const S=p();h(),S||h7(PQe,l,k,{discrete:!0})};if(Ra(w,"handleAndDispatchPointerDownOutsideEvent"),!a(O.target)){n.removeEventListener("click",f.current),h(),c.current=!1;return}const k={originalEvent:O};u.current=!0,r.current=i&&O.button===0,d.current.clear(),!i||O.button!==0?w():(n.removeEventListener("click",f.current),f.current=w,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),h();c.current=!1},"handlePointerDown"),y=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const O of y)n.addEventListener(O,g,!0),n.addEventListener(O,b);const x=window.setTimeout(()=>{n.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(x),n.removeEventListener("pointerdown",v),n.removeEventListener("click",f.current);for(const O of y)n.removeEventListener(O,g,!0),n.removeEventListener(O,b)}},[n,l,i,r,s,a]),{onPointerDownCapture:Ra(()=>c.current=!0,"onPointerDownCapture")}}Ra(Zye,"usePointerDownOutside");function Jye(e,t=globalThis==null?void 0:globalThis.document){const n=$u(e),i=m.useRef(!1);return m.useEffect(()=>{const r=Ra(s=>{s.target&&!i.current&&h7(DQe,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:Ra(()=>i.current=!0,"onFocusCapture"),onBlurCapture:Ra(()=>i.current=!1,"onBlurCapture")}}Ra(Jye,"useFocusOutside");function B4(){const e=new CustomEvent(F4);document.dispatchEvent(e)}Ra(B4,"dispatchUpdate");function h7(e,t,n,{discrete:i}){const r=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),i?c7(r,s):r.dispatchEvent(s)}Ra(h7,"handleAndDispatchCustomEvent");var $Qe=Object.defineProperty,Fo=(e,t)=>$Qe(e,"name",{value:t,configurable:!0}),BD="focusScope.autoFocusOnMount",UD="focusScope.autoFocusOnUnmount",QW={bubbles:!1,cancelable:!0},eve=m.forwardRef(Fo(function(t,n){const{loop:i=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=t,[c,u]=m.useState(null),d=$u(s),f=$u(a),h=m.useRef(null),p=ir(n,u),g=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let v=function(w){if(g.paused||!c)return;const k=w.target;c.contains(k)?h.current=k:jf(h.current,{select:!0})},y=function(w){if(g.paused||!c)return;const k=w.relatedTarget;k!==null&&(c.contains(k)||jf(h.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const S of w)S.removedNodes.length>0&&jf(c)};Fo(v,"handleFocusIn"),Fo(y,"handleFocusOut"),Fo(x,"handleMutations"),document.addEventListener("focusin",v),document.addEventListener("focusout",y);const O=new MutationObserver(x);return c&&O.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),O.disconnect()}}},[r,c,g.paused]),m.useEffect(()=>{if(c){zW.add(g);const v=document.activeElement;if(!c.contains(v)){const x=new CustomEvent(BD,QW);c.addEventListener(BD,d),c.dispatchEvent(x),x.defaultPrevented||(tve(ave(p7(c)),{select:!0}),document.activeElement===v&&jf(c))}return()=>{c.removeEventListener(BD,d),setTimeout(()=>{const x=new CustomEvent(UD,QW);c.addEventListener(UD,f),c.dispatchEvent(x),x.defaultPrevented||jf(v??document.body,{select:!0}),c.removeEventListener(UD,f),zW.remove(g)},0)}}},[c,d,f,g]);const b=m.useCallback(v=>{if(!i&&!r||g.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,x=document.activeElement;if(y&&x){const O=v.currentTarget,[w,k]=nve(O);w&&k?!v.shiftKey&&x===k?(v.preventDefault(),i&&jf(w,{select:!0})):v.shiftKey&&x===w&&(v.preventDefault(),i&&jf(k,{select:!0})):x===O&&v.preventDefault()}},[i,r,g.paused]);return o.jsx(wr.div,{tabIndex:-1,...l,ref:p,onKeyDown:b})},"FocusScope"));function tve(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(jf(i,{select:t}),document.activeElement!==n)return}Fo(tve,"focusFirst");function nve(e){const t=p7(e),n=U4(t,e),i=U4(t.reverse(),e);return[n,i]}Fo(nve,"getTabbableEdges");function p7(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Fo(i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}Fo(p7,"getTabbableCandidates");function U4(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const i of e)if(!(n?!i.checkVisibility({checkVisibilityCSS:!0}):ive(i,{upTo:t})))return i}Fo(U4,"findVisible");function ive(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}Fo(ive,"isHidden");function rve(e){return e instanceof HTMLInputElement&&"select"in e}Fo(rve,"isSelectableInput");function jf(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&rve(e)&&t&&e.select()}}Fo(jf,"focus");var zW=sve();function sve(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Q4(e,t),e.unshift(t)},remove(t){var n;e=Q4(e,t),(n=e[0])==null||n.resume()}}}Fo(sve,"createFocusScopesStack");function Q4(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}Fo(Q4,"arrayRemove");function ave(e){return e.filter(t=>t.tagName!=="A")}Fo(ave,"removeLinks");var FQe=Object.defineProperty,BQe=(e,t)=>FQe(e,"name",{value:t,configurable:!0}),m7=m.forwardRef(BQe(function(t,n){var c;const{container:i,...r}=t,[s,a]=m.useState(!1);Jc(()=>a(!0),[]);const l=i||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return l?Li.createPortal(o.jsx(wr.div,{...r,ref:n}),l):null},"Portal")),UQe=Object.defineProperty,g7=(e,t)=>UQe(e,"name",{value:t,configurable:!0}),iT=0,ad=null;function QQe(e){return uR(),e.children}g7(QQe,"FocusGuards");function uR(){m.useEffect(()=>{ad||(ad={start:z4(),end:z4()});const{start:e,end:t}=ad;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),iT++,()=>{iT===1&&(ad==null||ad.start.remove(),ad==null||ad.end.remove(),ad=null),iT=Math.max(0,iT-1)}},[])}g7(uR,"useFocusGuards");function z4(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}g7(z4,"createFocusGuard");var bd=function(){return bd=Object.assign||function(t){for(var n,i=1,r=arguments.length;i"u")return sze;var t=aze(e),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-n+t[2]-t[0])}},lze=uve(),Zy="data-scroll-locked",cze=function(e,t,n,i){var r=e.left,s=e.top,a=e.right,l=e.gap;return n===void 0&&(n="margin"),` +${n}`}}async function*fBe({runtimeId:e,region:t,instanceName:n,sessionId:i,follow:r=!0,signal:s}){const a=new URLSearchParams({region:t,follow:String(r)});n&&a.set("instance_name",n),i&&a.set("session_id",i);const l=await fetch(Bo(`/web/runtime-logs/${encodeURIComponent(e)}/stream?${a.toString()}`),{headers:Hu(Dh({Accept:"text/event-stream"})),cache:"no-store",signal:s});if(!l.ok)throw new Error(V("runtimeLogs.loadFailedWithDetail",{detail:await dBe(l)}));for await(const c of eR(l)){if(!uBe(c))throw new Error(V("runtimeLogs.invalidFormat"));yield c}}const hBe=255,pBe=/[\p{L}\p{M}\p{N}\p{P}\p{Zs}]/u;function mBe(e){const t=e.normalize("NFKC").replace(/\s+/gu," ").trim(),n=new TextEncoder;let i=0,r="";for(const s of t){if(!pBe.test(s))continue;const a=n.encode(s).byteLength;if(i+a>hBe)break;r+=s,i+=a}return r.replace(/ +/g," ").trimEnd()}const gBe=/RunPipeline result could not be reconciled|Polling build status failed/i;class jw extends Error{constructor({taskId:n,cause:i}={}){super("The deployment request may still be running, but its status could not be confirmed.");ki(this,"taskId");this.name="DeploymentStatusUnconfirmedError",this.taskId=n}}function Rbe(e){if(e instanceof jw)return!0;const t=e instanceof Error?e.message:String(e??"");return gBe.test(t)}function kW(e){return!!(e&&typeof e=="object"&&"name"in e&&e.name==="AbortError")}const m4="ap-southeast-1",FF="cn-beijing",bBe="https://ark.ap-southeast.bytepluses.com/api/v3",yBe="https://ark.cn-beijing.volces.com/api/v3/",vBe="https://console.byteplus.com/ark/region:ark+ap-southeast-1/openManagement",xBe="https://console.volcengine.com/ark/region:ark+cn-beijing/openManagement",wBe="dola-seed-2-1-turbo-260628",OBe="doubao-seed-2-1-pro-260628",SBe="skylark-embedding-vision-250615",kBe="doubao-embedding-vision-250615",EBe="seed-2-0-lite-260228",CBe="doubao-seed-2-0-lite-260428",TBe="dola-seedream-5-0-pro-260628",ABe="doubao-seedream-5-0-260128",_Be="seededit-3-0-i2i-250628",NBe="doubao-seededit-3-0-i2i-250628",jBe="dreamina-seedance-2-0-260128",RBe="doubao-seedance-2-0-260128";function Iu(e){return e==="byteplus"?[{value:m4,label:m4}]:[{value:"cn-beijing",label:V("cloudRegion.cnBeijing")},{value:"cn-shanghai",label:V("cloudRegion.cnShanghai")}]}function Ji(e){var t;return((t=Iu(e)[0])==null?void 0:t.value)||FF}const IBe=new Set(["cn-beijing","cn-shanghai","ap-southeast-1"]);function tR(e){return typeof e=="string"&&IBe.has(e)}function xh(e,t){var i;return((i=(t?Iu(t):[...Iu("volcengine"),...Iu("byteplus")]).find(r=>r.value===e))==null?void 0:i.label)||e||"-"}function wh(e){return e==="byteplus"?wBe:OBe}function xl(e){return e==="byteplus"?bBe:yBe}function PBe(e){return e==="byteplus"?vBe:xBe}function DBe(e){return e==="byteplus"?SBe:kBe}function MBe(e){return e==="byteplus"?EBe:CBe}function LBe(e){return e==="byteplus"?TBe:ABe}function $Be(e){return e==="byteplus"?_Be:NBe}function FBe(e){return e==="byteplus"?jBe:RBe}const BF="veadk.messageFeedback.v1";function UF(e,t,n,i){return[e,t,n,i].join(":")}function QF(){if(typeof window>"u")return{};try{const e=JSON.parse(localStorage.getItem(BF)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function BBe(e,t,n){if(typeof window>"u")return;const i=QF();i[e]={...i[e]??{},[`veadk_feedback:${t}`]:n},localStorage.setItem(BF,JSON.stringify(i))}function Ibe(e){if(typeof window>"u")return;const t=UF(e.runtimeId,e.appName,e.userId,e.sessionId),n=QF(),i=n[t];if(i){for(const r of e.eventIds)delete i[`veadk_feedback:${r}`];Object.keys(i).length===0?delete n[t]:n[t]=i,localStorage.setItem(BF,JSON.stringify(n))}}const Z2="",zF=new Map;function Pbe(e,t){zF.set(e,t)}function Dbe(){zF.clear()}function Sl(e){const t=zF.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 At(e,t={},n={},i=Wo){const r=Ol(t.signal,i),s=!!n.runtimeId&&String(t.method??"GET").toUpperCase()==="DELETE",a={...t,...s?{method:"POST"}:{},headers:Hu(Dh(t.headers))},l=()=>{const d={...a,signal:r};if(n.runtimeId){const f=new URLSearchParams;n.region&&f.set("_runtime_region",n.region),n.retryProbe&&f.set("probe_retry","connect"),s&&f.set("_method","DELETE");const h=f.toString()?`${e.includes("?")?"&":"?"}${f.toString()}`:"";return fetch(Bo(`${Z2}/web/runtime-proxy/${n.runtimeId}${e}${h}`),d)}if(n.base){const f=new Headers(d.headers);return f.set("X-AgentKit-Base",n.base),n.apiKey&&f.set("X-AgentKit-Key",n.apiKey),fetch(Bo(`${Z2}/agentkit-proxy${e}`),{...d,headers:f})}return fetch(Bo(`${Z2}${e}`),d)},c=async d=>{if(X7e(d))return!0;if(d.status!==401)return!1;try{return await H7e()}catch{return!1}};let u=await l();for(;await c(u);)await Y7e(r),u=await l();return u}function Tn(e,t={},n=Wo){return At(e,t,{},n)}function UBe(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>{var n;if(t&&typeof t=="object"&&"msg"in t){const i=Array.isArray(t.loc)?(n=t.loc)==null?void 0:n.join("."):"",r=String(t.msg??"");return i?`${i}: ${r}`:r}return String(t)}).filter(Boolean).join(` +`):e&&typeof e=="object"?JSON.stringify(e):""}async function cn(e,t){const n=V("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),i=await e.text().catch(()=>"");if(!i)return n;try{const r=JSON.parse(i),s=UBe(r.detail??r.error);return s?V("client.errorWithDetailAndRawResponse",{context:n,detail:s,response:i}):V("client.errorWithRawResponse",{context:n,response:i})}catch{return V("client.errorWithRawResponse",{context:n,response:i})}}async function VF(e,t=!1){const n=await At(`/web/model-api-keys${t?"?refresh=true":""}`,{signal:e,cache:"no-store"});if(!n.ok)throw new Error(await cn(n,V("client.loadArkApiKeysFailed")));return await n.json()}async function Mbe(e,t){const n=await At(`/web/model-api-keys/${encodeURIComponent(e)}/value`,{method:"POST",signal:t,cache:"no-store"});if(!n.ok)throw new Error(await cn(n,V("client.loadArkApiKeysFailed")));return await n.json()}async function Ex(e){const t=new URLSearchParams;e!=null&&e.apiKeyId&&t.set("apiKeyId",e.apiKeyId),e!=null&&e.refresh&&t.set("refresh","true");const n=t.toString(),i=await At(`/web/model-options${n?`?${n}`:""}`,{signal:e==null?void 0:e.signal,cache:"no-store"});if(!i.ok)throw new Error(await cn(i,V("client.loadModelsFailed")));return await i.json()}async function Lbe(){const e=await At("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class Cx extends Error{constructor(){super(V("client.runtimeAccessDenied")),this.name="RuntimeAccessDeniedError"}}class Ds extends Error{constructor(t,n=!1,i=!1){super(t),this.unsupported=n,this.retryable=i,this.name="RuntimeProbeError"}}const $be=()=>V("client.privateRuntimeUnavailable"),Fbe=()=>V("client.runtimeTemporarilyUnavailable"),EW=["cn-beijing","cn-shanghai"],QBe=3e4,Tx=5*60*1e3,Bbe=60*1e3;let gS="volcengine";const Xy=new Map,vg=new Map,xg=new Map,Su=new Map,kr=new Map;function HF(e,t,n){return`${t}:${e}:${n??""}`}function Ube(e){e!==gS&&kr.clear(),gS=e}function Qk(e){const t=(e||"").trim();if(gS==="byteplus")return[t&&!t.startsWith("cn-")?t:m4];const n=t&&!t.startsWith("ap-")?t:FF;return EW.includes(n)?[n,...EW.filter(i=>i!==n)]:[n]}function nR(e){const t=(e||"").trim();return t?[t]:Qk()}function qb(...e){return e.map(t=>String(t??"")).join("")}function Lm(e,t,n){const i=e.get(t);return i!=null&&i.value&&Date.now()-i.updatedAt<=n?i.value:null}function qF(e,t,n){return e.set(t,{value:n,updatedAt:Date.now()}),n}function ZC(e,t){return t?t.aborted?Promise.reject(new DOMException("The operation was aborted.","AbortError")):new Promise((n,i)=>{const r=()=>{i(new DOMException("The operation was aborted.","AbortError"))};t.addEventListener("abort",r,{once:!0}),e.then(s=>{t.removeEventListener("abort",r),n(s)},s=>{t.removeEventListener("abort",r),i(s)})}):e}async function Qbe(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function zk(e,t,n,i,r=Wo){const s=await At("/list-apps",{signal:i},n??{base:e,apiKey:t},r),a=n!=null&&n.runtimeId?await Qbe(s):"";if(n!=null&&n.runtimeId&&a==="runtime_access_denied")throw new Cx;if(n!=null&&n.runtimeId&&a==="runtime_private_endpoint_unreachable")throw new Ds($be());if(n!=null&&n.runtimeId&&["runtime_proxy_connect_error","runtime_proxy_timeout","runtime_json_connect_error","runtime_json_timeout"].includes(a))throw new Ds(Fbe(),!1,!0);if(n!=null&&n.runtimeId&&s.status===404)throw new Ds(V("client.runtimeConnectionUnsupported"),!0,!0);if(n!=null&&n.runtimeId&&(s.status===401||s.status===403))throw new Ds(V("client.runtimeConnectionDenied"));if(!s.ok)throw new Error(await cn(s,V("client.listAgentsFailed")));let l;try{l=await s.json()}catch{throw new Ds(V("client.invalidListAppsJson"))}if(!Array.isArray(l)||l.some(u=>typeof u!="string"||!u.trim()))throw new Ds(V("client.invalidListAppsFormat"));const c=l.map(u=>u.trim());return n!=null&&n.runtimeId&&Xy.set(HF(n.runtimeId,n.region??"",n.runtimeVersion),{apps:c,expiresAt:Date.now()+QBe}),c}async function zbe(e,t){const{app:n,ep:i}=Sl(e),r=await At(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},i);if(!r.ok){const a=V("client.createSessionFailedWithStatus",{status:r.status}),l=await cn(r,V("client.createSessionFailed"));throw new Error(l===a?a:V("common.fallbackWithDetail",{fallback:a,detail:l}))}return(await r.json()).id}async function WF(e,t){const{app:n,ep:i}=Sl(e),r=await At(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},i);if(!r.ok)throw new Error(`list sessions failed: ${r.status}`);return r.json()}async function iR(e,t,n){const{app:i,ep:r}=Sl(e),s=await At(`/apps/${i}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}`,{},r);if(!s.ok){const l=await cn(s,V("client.getSessionFailed"));throw new Error(V("client.getSessionFailedWithDetail",{status:s.status,detail:l}))}const a=await s.json();if(r.runtimeId){const l=UF(r.runtimeId,i,t,n);a.state={...QF()[l]??{},...a.state??{}}}return a}async function Vbe(e){const{app:t,ep:n}=Sl(e.appName);if(!n.runtimeId)throw new Error(V("client.feedbackRuntimeOnly"));if(!n.region)throw new Error(V("client.feedbackRegionMissing"));const i=await At("/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??""})},{},is);if(!i.ok)throw new Error(await cn(i,V("client.submitFeedbackFailed")));const r=await i.json(),s=UF(n.runtimeId,t,e.userId,e.sessionId);return BBe(s,e.eventId,r),r}async function rR(e,t={}){const n=qb(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),i=Lm(Su,n,Bbe);if(!t.force&&i)return i;const r=Su.get(n);if(!t.force&&(r!=null&&r.promise))return r.promise;let s=null;const a=(async()=>{for(const l of nR(e.region)){const c=new URLSearchParams({runtimeId:e.runtimeId,region:l,appName:e.appName,page_size:String(e.pageSize??100)}),u=await At(`/web/evaluation/feedback-cases?${c.toString()}`);if(u.ok)return qF(Su,n,await u.json());s=new Error(await cn(u,V("client.loadEvaluationSetsFailed")))}throw s??new Error(V("client.loadEvaluationSetsFailed"))})();Su.set(n,{...r,promise:a,updatedAt:(r==null?void 0:r.updatedAt)??0});try{return await a}finally{const l=Su.get(n);(l==null?void 0:l.promise)===a&&Su.set(n,{value:l.value,updatedAt:l.updatedAt})}}async function g4(e){let t=null;for(const n of nR(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName,userId:e.userId}),r=await At(`/web/evaluation/statuses?${i.toString()}`);if(r.ok)return r.json();t=new Error(await cn(r,V("client.loadAutoEvaluationStatusFailed")))}throw t??new Error(V("client.loadAutoEvaluationStatusFailed"))}async function Hbe(e){let t=null;for(const n of nR(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName}),r=await At(`/web/evaluation/optimizations?${i.toString()}`);if(r.ok)return r.json();t=new Error(await cn(r,V("client.loadOptimizationsFailed")))}throw t??new Error(V("client.loadOptimizationsFailed"))}function qbe(e){return Lm(Su,qb(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),Bbe)}function zBe(e){rR(e).catch(()=>{})}function Wbe(e){rR(e,{force:!0}).catch(()=>{})}function Gbe(e,t){return["good","bad"].map(n=>{const i=e.find(r=>r.kind===n);return{kind:n,evaluationSetId:(i==null?void 0:i.evaluationSetId)??null,evaluationSetName:(i==null?void 0:i.evaluationSetName)??null,workspaceId:(i==null?void 0:i.workspaceId)??null,itemCount:t.filter(r=>r.kind===n).length}})}function J2(e){const t=e.comment??"",n=e.rating==="bad"&&!!t.trim();for(const[i,r]of Su.entries()){const s=r.value;if(!s||s.runtimeId!==e.runtimeId||s.agentName!==e.appName)continue;const a=s.items.filter(c=>c.sessionId!==e.sessionId||c.messageId!==e.messageId),l=e.rating?[{id:`local:${e.runtimeId}:${e.sessionId}:${e.messageId}`,itemKey:`local:${e.messageId}`,kind:e.rating,input:e.input,output:e.output,referenceOutput:e.referenceOutput??e.output,comment:t,agentName:e.appName,sessionId:e.sessionId,messageId:e.messageId,runtimeId:e.runtimeId,invocationId:e.invocationId??"",userId:e.userId,createdAt:e.createdAt??new Date().toISOString(),evaluationSetId:"",evaluationSetName:"",workspaceId:"",source:"user",score:n?0:null,reason:n?t:""},...a]:a;Su.set(i,{value:{...s,sets:Gbe(s.sets,l),items:l},updatedAt:Date.now(),promise:r.promise})}}async function Kbe(e){let t=null;for(const n of nR(e.region)){const i=await At("/web/evaluation/feedback-cases/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,region:n,appName:e.appName,itemIds:e.itemIds})},{},is);if(i.ok){const r=await i.json(),s=new Set(e.itemIds);for(const[a,l]of Su.entries()){const c=l.value;if(!c||c.runtimeId!==e.runtimeId||c.agentName!==e.appName)continue;const u=c.items.filter(d=>!s.has(d.id));Su.set(a,{value:{...c,sets:Gbe(c.sets,u),items:u},updatedAt:Date.now()})}return r}t=new Error(await cn(i,V("client.deleteEvaluationCaseFailed")))}throw t??new Error(V("client.deleteEvaluationCaseFailed"))}async function b4(e,t,n){const{app:i,ep:r}=Sl(e),s=await At(`/apps/${i}/users/${encodeURIComponent(t)}/sessions/${n}`,{method:"DELETE"},r);if(!s.ok&&s.status!==404)throw new Error(`delete session failed: ${s.status}`)}function VBe(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"="),i=window.atob(n),r=new Uint8Array(i.length);for(let s=0;sURL.revokeObjectURL(l),0)}async function Xbe(e,t,n,i,r){const{app:s,ep:a}=Sl(e),l=r==null?"":`?version=${encodeURIComponent(r)}`,c=`/apps/${encodeURIComponent(s)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/artifacts/${encodeURIComponent(i)}${l}`,u=await At(c,{},a,is);if(!u.ok)throw new Error(await cn(u,V("client.downloadFileFailed")));const d=await u.json(),f=d.inlineData??d.inline_data;if(!(f!=null&&f.data))throw new Error(V("client.fileUnavailable"));const h=VBe(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??i}}async function KF(e,t,n,i,r){const{blob:s}=await Xbe(e,t,n,i,r);return URL.createObjectURL(s)}async function HBe(e){const t=await At("/web/media/capabilities");if(!t.ok)throw new Error(await cn(t,"media capabilities failed"));return t.json()}async function Ybe(e,t,n,i){const{app:r}=Sl(e),s=new FormData;s.set("app_name",r),s.set("user_id",t),s.set("session_id",n),s.set("file",i);const a=await At("/web/media",{method:"POST",body:s},{},is);if(!a.ok)throw new Error(await cn(a,V("client.uploadFileFailed")));return{...await a.json(),status:"ready"}}async function y4(e,t,n){const{app:i}=Sl(e),r=`/web/media/${encodeURIComponent(i)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}/delete`,s=await At(r,{method:"POST"});if(!s.ok&&s.status!==404)throw new Error(await cn(s,"media cleanup failed"))}function Zbe(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((i,r)=>![1,3,5].includes(r)).join("/")}`}catch{return}}async function eA(e,t){const n=Zbe(t);if(!n)throw new Error("Invalid VeADK media URI");const i=await At(`${n}/delete`,{method:"POST"});if(!i.ok&&i.status!==404)throw new Error(await cn(i,"media cleanup failed"))}function Jbe(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=Zbe(t);if(!n)return t;const i=`${n}/content`;return Bo(`${Z2}${i}`)}async function L_(e,t,n){const{app:i,ep:r}=Sl(e);let s;if(r.runtimeId){const c=new URLSearchParams({runtimeId:r.runtimeId,sessionId:t,region:r.region??"cn-beijing"});if(n&&c.set("endTimeMs",String(Math.round(n))),s=await At(`/web/runtime-trace?${c.toString()}`),s.status===404)throw new Error(V("client.traceDisabled"))}else s=await At(`/dev/apps/${encodeURIComponent(i)}/debug/trace/session/${encodeURIComponent(t)}`,{},r);if(!s.ok)throw new Error(await cn(s,V("client.loadTraceFailed")));const a=s.headers.get("content-type")??"";if(!a.includes("application/json")){const c=a.split(";",1)[0]||V("client.contentTypeMissing");throw new Error(V("client.traceNonJson",{contentType:c}))}const l=await s.json();if(!Array.isArray(l))throw new Error(V("client.invalidTraceFormat"));return l}async function v4(e){const t=await At("/web/issue-feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await cn(t,V("client.submitIssueFeedbackFailed")));if((await t.json()).submitted!==!0)throw new Error(V("client.issueFeedbackNotConfirmed"));return{submitted:!0}}async function e0e(e,t,n=!0){const i=await At(`/web/agent-info/${e}`,{},t);if(!i.ok)throw new Error(`agent-info failed: ${i.status}`);const r=await i.json();if(n&&!r.draft)try{const s=await At(`/web/agent-draft/${e}`,{},t);if(s.ok){const a=await s.json();r.draft=a.draft}}catch{}return{appName:e,name:r.name??e,description:r.description??"",type:r.type,model:r.model??"",tools:r.tools??[],skillsPreviewSupported:Array.isArray(r.skills),skills:r.skills??[],subAgents:r.subAgents??[],components:r.components??[],searchSources:r.searchSources??[],graph:r.graph,draft:r.draft}}async function x4(e){const{app:t,ep:n}=Sl(e);return e0e(t,n,!1)}async function qBe(e,t,n){let i=null;for(const r of Qk(t)){const s={runtimeId:e,region:r};try{const a=HF(e,r),l=Xy.get(a);l&&l.expiresAt<=Date.now()&&Xy.delete(a);const c=Xy.get(a),u=n||(c==null?void 0:c.apps[0])||(await zk("","",s))[0];if(!u)throw new Error(V("client.noPreviewableAgent"));return e0e(u,s)}catch(a){if(a instanceof Cx||a instanceof Ds&&!a.unsupported)throw a;i=a instanceof Error?a:new Error(String(a))}}throw i??new Error(V("client.noPreviewableAgent"))}async function XF(e,t,n={},i={}){const r=typeof n=="string"?n:void 0,s=typeof n=="string"?i:n,a=qb(e,t||"cn-beijing",r??""),l=Lm(vg,a,Tx);if(!s.force&&l)return l;const c=vg.get(a);if(!s.force&&(c!=null&&c.promise))return c.promise;const u=qBe(e,t,r).then(d=>qF(vg,a,d));vg.set(a,{...c,promise:u,updatedAt:(c==null?void 0:c.updatedAt)??0});try{return await u}finally{const d=vg.get(a);(d==null?void 0:d.promise)===u&&vg.set(a,{value:d.value,updatedAt:d.updatedAt})}}function t0e(e,t,n=""){return Lm(vg,qb(e,t||"cn-beijing",n),Tx)}function n0e(e,t,n=""){XF(e,t,n).catch(()=>{})}async function i0e(e,t,n,i){const{app:r,ep:s}=Sl(e),a=new URLSearchParams({source:t,app_name:r,q:n,user_id:i}),l=await At(`/web/search?${a.toString()}`,{},s);if(!l.ok)throw new Error(await cn(l,V("client.agentSearchFailed")));return l.json()}async function r0e(e,t){const{app:n}=Sl(e),i=await At(`/web/search?source=web&app_name=${encodeURIComponent(n)}&q=${encodeURIComponent(t)}`);if(!i.ok)throw new Error(`web search failed: ${i.status}`);return i.json()}function s0e(){return Df(V("client.emptySseBody"))}function tA(){return Df(V("client.noDisplayableSseReply"))}const WBe=3e4;function $v(){return Df(V("client.firstSseEventTimeout"))}function a0e(e){if(e!=null&&e.aborted)return{signal:e,clearDeadline:()=>{},cleanup:()=>{},timedOut:()=>!1};const t=new AbortController;let n=!1,i=!1;const r=()=>{i||(i=!0,clearTimeout(a))},s=()=>{t.signal.aborted||t.abort((e==null?void 0:e.reason)??new DOMException("Aborted","AbortError"))},a=setTimeout(()=>{i||t.signal.aborted||(n=!0,i=!0,t.abort(new Error($v())))},WBe);return e==null||e.addEventListener("abort",s,{once:!0}),{signal:t.signal,clearDeadline:r,cleanup:()=>{r(),e==null||e.removeEventListener("abort",s)},timedOut:()=>n}}async function*w4({appName:e,userId:t,sessionId:n,text:i,attachments:r=[],invocation:s,platformTools:a,environmentMounts:l,environmentMount:c,functionResponses:u=[],signal:d,onRuntimeContext:f}){const{app:h,ep:p}=Sl(e),g=r.flatMap(k=>k.status&&k.status!=="ready"?[]:k.uri?[{fileData:{mimeType:k.mimeType,fileUri:k.uri,displayName:k.name},partMetadata:{veadkMedia:{id:k.id,uri:k.uri,name:k.name,mimeType:k.mimeType,sizeBytes:k.sizeBytes}}}]:k.data?[{inlineData:{mimeType:k.mimeType,data:k.data,displayName:k.name}}]:[]),b=s&&(s.skills.length>0||s.targetAgent)?s:void 0,v=[...g,...u.map(k=>({functionResponse:{id:k.id,name:k.name,response:k.response}})),...i.trim()?[{text:i}]:[]];if(b&&v.length>0){const k=v[0],S=k.partMetadata;v[0]={...k,partMetadata:{...S,veadkInvocation:b}}}let y;const x=a0e(d);try{y=await At("/run_sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:h,user_id:t,session_id:n,new_message:{role:"user",parts:v},streaming:!0,...a!==void 0?{platform_tools:[...a]}:{},...l!==void 0?{environment_mounts:[...l]}:c?{environment_mount:c}:{},custom_metadata:b?{veadkInvocation:b}:void 0}),signal:x.signal},p,0)}catch(k){throw x.cleanup(),x.timedOut()?new Error($v()):d!=null&&d.aborted||(k==null?void 0:k.name)==="AbortError"?k:new Error(Df(k))}const O=lBe(y,p.runtimeId??"",p.region??"");if(O&&(f==null||f(O)),!y.ok){x.cleanup();const k=await cn(y,V("client.runSessionFailed"));throw new Error(Df(V("client.runSseFailedWithDetail",{status:y.status,detail:k})))}let w=!1;try{for await(const k of eR(y)){w=!0,x.clearDeadline();const S=k;typeof S.error=="string"&&(S.error=Df(S.error)),typeof S.errorMessage=="string"&&(S.errorMessage=Df(S.errorMessage)),typeof S.error_message=="string"&&(S.error_message=Df(S.error_message)),yield S}}catch(k){throw x.timedOut()?new Error($v()):d!=null&&d.aborted||(k==null?void 0:k.name)==="AbortError"?k:new Error(Df(k))}finally{x.cleanup()}if(!w)throw new Error(s0e())}async function sR(e,t){const n=new URLSearchParams({name:e,region:t}),i=await At(`/web/runtime-name-availability?${n.toString()}`,{cache:"no-store"});if(!i.ok)throw new Error(await cn(i,V("client.checkRuntimeNameFailed")));const r=await i.json();if(typeof r.available!="boolean")throw new Error(V("client.invalidRuntimeNameCheck"));return{available:r.available}}async function o0e(e,t){const n=new URLSearchParams({kind:e.kind,region:e.region});e.registry&&n.set("registry",e.registry),e.namespace&&n.set("namespace",e.namespace),e.workspaceId&&n.set("workspaceId",e.workspaceId),e.search&&n.set("search",e.search),e.pageNumber&&n.set("pageNumber",String(e.pageNumber)),e.pageSize&&n.set("pageSize",String(e.pageSize));const i=await At(`/web/deployment-resources?${n.toString()}`,{signal:t});if(!i.ok)throw new Error(await cn(i,V("client.loadCloudResourcesFailed")));const r=await i.json();if(typeof r.serviceRegion!="string"||!Array.isArray(r.items)||typeof r.pageNumber!="number"||typeof r.pageSize!="number"||typeof r.totalCount!="number"||typeof r.hasMore!="boolean")throw new Error(V("client.invalidCloudResources"));const s=r.items.map(a=>{if(!a||typeof a!="object"||typeof a.id!="string"||typeof a.name!="string"||typeof a.region!="string"||typeof a.status!="string")throw new Error(V("client.invalidCloudResources"));return a});return{serviceRegion:r.serviceRegion,items:s,pageNumber:r.pageNumber,pageSize:r.pageSize,totalCount:r.totalCount,hasMore:r.hasMore}}function l0e(e,t){const n=e;if(!n||typeof n!="object"||!Array.isArray(n.mounts))throw new Error(V("client.invalidEnvironmentMount"));if(n.mounts.length!==t.length)throw new Error(V("client.environmentMountMismatch"));return n.mounts.map((i,r)=>{const s=t[r];if(!i||typeof i!="object"||typeof i.environment_id!="string"||typeof i.environment_version_id!="string"||typeof i.mount_instance_id!="string"||typeof i.sandbox_session_id!="string"||!i.environment_id||!i.environment_version_id||!i.mount_instance_id||!i.sandbox_session_id)throw new Error(V("client.invalidEnvironmentMount"));if(i.environment_id!==s.environment_id||i.environment_version_id!==s.environment_version_id||s.mount_instance_id!==void 0&&i.mount_instance_id!==s.mount_instance_id)throw new Error(V("client.environmentMountMismatch"));return i})}async function c0e({runtimeId:e,appName:t,userId:n,sessionId:i,environmentMounts:r}){const{app:s}=Sl(t);let a;try{a=await At("/web/v3/session-environment-mounts/prepare",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtime_id:e,app_name:s,user_id:n,session_id:i,environment_mounts:[...r]})})}catch(l){throw l instanceof TypeError?new Error(V("client.environmentMountNetworkFailed")):l}if(!a.ok)throw new Error(await cn(a,V("client.environmentMountFailed")));return l0e(await a.json(),r)}function YF(e){const t=new Set,n=[];for(const i of e.split(/[,,\n\r]+/)){const r=i.trim();!r||t.has(r)||(t.add(r),n.push(r))}return n}async function u0e(e,t=typeof navigator>"u"?void 0:navigator.clipboard){if(!(t!=null&&t.writeText))throw new Error(V("client.clipboardUnsupported"));try{await t.writeText(e)}catch{throw new Error(V("client.clipboardWriteFailed"))}}const CW={codex:0,codex_snapshot:1,deepseek_harness:2,deepseek_harness_snapshot:3,openclaw:4,openclaw_snapshot:5,hermes:6,hermes_snapshot:7,dev:8};async function d0e(e){var r;const t=await At("/web/system-info",{signal:e});if(!t.ok)throw new Error(await cn(t,V("client.loadSystemInfoFailed")));const n=await t.json();if(typeof((r=n.storage)==null?void 0:r.tosAddress)!="string"||!Array.isArray(n.sandboxTools))throw new Error(V("client.invalidSystemInfo"));const i=n.sandboxTools.map(s=>{if(!s||typeof s!="object"||typeof s.kind!="string"||typeof s.label!="string"||typeof s.toolId!="string"||typeof s.snapshot!="boolean"||typeof s.needsModelEnvUpdate!="boolean"||typeof s.canUpdateModelEnv!="boolean"||typeof s.modelEnvError!="string"||typeof s.modelEnvErrorCode!="string")throw new Error(V("client.invalidSystemInfo"));return s}).sort((s,a)=>(CW[s.kind]??Number.MAX_SAFE_INTEGER)-(CW[a.kind]??Number.MAX_SAFE_INTEGER));return{storage:{tosAddress:n.storage.tosAddress},sandboxTools:i}}const f0e=new Set(["preparing","queued","building","scanning","available","failed"]);function ZF(e){if(e===null)return null;if(!e||typeof e!="object")throw new Error(V("client.invalidEnvironmentBuild"));const t=e;if(typeof t.versionId!="string"||!f0e.has(t.status)||typeof t.image!="string"||typeof t.error!="string"||typeof t.createdAt!="string"||typeof t.updatedAt!="string"||t.resources!==null&&typeof t.resources!="object")throw new Error(V("client.invalidEnvironmentBuild"));const n=Array.isArray(t.steps)?t.steps.map(i=>{if(!i||typeof i!="object"||typeof i.key!="string"||typeof i.label!="string"||!["pending","running","succeeded","failed"].includes(i.status)||i.startedAt!==null&&typeof i.startedAt!="string"||i.finishedAt!==null&&typeof i.finishedAt!="string")throw new Error(V("client.invalidEnvironmentBuildStep"));return i}):[];return{...t,toolId:typeof t.toolId=="string"?t.toolId:"",toolStatus:["creating","ready","failed"].includes(t.toolStatus)?t.toolStatus:"",runId:typeof t.runId=="string"?t.runId:"",currentStep:typeof t.currentStep=="string"?t.currentStep:"",sourceCommitSha:typeof t.sourceCommitSha=="string"?t.sourceCommitSha:"",steps:n,progressError:typeof t.progressError=="string"?t.progressError:"",logTail:typeof t.logTail=="string"?t.logTail:"",logTruncated:t.logTruncated===!0,logUpdatedAt:typeof t.logUpdatedAt=="string"?t.logUpdatedAt:null,logError:typeof t.logError=="string"?t.logError:""}}function h0e(e){if(!e||typeof e!="object")throw new Error(V("client.invalidEnvironmentManifest"));const t=e;if(!["agentkit.studio/v3","agentkit.studio/v1alpha1"].includes(t.apiVersion)||t.kind!=="Environment"||!t.metadata||typeof t.metadata.id!="string"||typeof t.metadata.name!="string"||typeof t.metadata.version!="string"||typeof t.metadata.description!="string"||!t.spec||typeof t.spec.image!="string"||!["ubuntu","aio-sandbox","codex-sandbox"].includes(t.spec.baseEnvironment)||typeof t.spec.baseImage!="string"||!["ubuntu-22.04","ubuntu-24.04"].includes(t.spec.operatingSystem)||!["python-3.10","python-3.12"].includes(t.spec.language)||t.spec.executionRuntime!=="veadk"||!Array.isArray(t.spec.packages)||!t.spec.packages.every(n=>typeof n=="string")||!Array.isArray(t.spec.capabilities)||!t.spec.capabilities.every(n=>typeof n=="string")||!Array.isArray(t.spec.skills)||!t.status||!f0e.has(t.status.phase)||typeof t.status.createdAt!="string"||typeof t.status.updatedAt!="string")throw new Error(V("client.invalidEnvironmentManifest"));return t}function p0e(e){if(e==null)return;if(!e||typeof e!="object")throw new Error(V("client.invalidImageRepository"));const t=e;if(typeof t.region!="string"||typeof t.registry!="string"||typeof t.namespace!="string"||typeof t.repository!="string")throw new Error(V("client.invalidImageRepository"));return t}function GBe(e){if(e==null)return;if(!e||typeof e!="object")throw new Error(V("client.invalidCodeRepository"));const t=e;if(typeof t.repositoryUrl!="string"||t.ref!==void 0&&typeof t.ref!="string"||typeof t.dockerfilePath!="string")throw new Error(V("client.invalidCodeRepository"));return t}function KBe(e){const t=p0e(e);if(!t)return;const n=e;if(typeof n.reference!="string")throw new Error(V("client.invalidImageSource"));return{...t,reference:n.reference}}function JF(e){if(!e||typeof e!="object")throw new Error(V("client.invalidEnvironment"));const t=e;if(typeof t.id!="string"||typeof t.name!="string"||typeof t.description!="string"||t.baseEnvironment!==void 0&&t.baseEnvironment!=="ubuntu"&&t.baseEnvironment!=="aio-sandbox"&&t.baseEnvironment!=="codex-sandbox"||t.operatingSystem!=="ubuntu-22.04"&&t.operatingSystem!=="ubuntu-24.04"||t.language!=="python-3.10"&&t.language!=="python-3.12"||!Array.isArray(t.optionIds)||!t.optionIds.every(n=>typeof n=="string")||t.selectedSkills!==void 0&&!Array.isArray(t.selectedSkills)||typeof t.dockerfile!="string"||typeof t.createdAt!="string"||typeof t.updatedAt!="string")throw new Error(V("client.invalidEnvironment"));return{...t,baseEnvironment:t.baseEnvironment==="aio-sandbox"?"aio-sandbox":t.baseEnvironment==="codex-sandbox"?"codex-sandbox":"ubuntu",selectedSkills:t.selectedSkills??[],gitSource:GBe(t.gitSource),containerRepository:p0e(t.containerRepository),imageSource:KBe(t.imageSource),latestVersion:ZF(t.latestVersion)}}function m0e(e){if(!e||typeof e!="object")throw new Error(V("client.invalidWorkspace"));const t=e;if(typeof t.id!="string"||typeof t.name!="string"||typeof t.description!="string"||!Array.isArray(t.environmentIds)||!t.environmentIds.every(n=>typeof n=="string")||typeof t.createdAt!="string"||typeof t.updatedAt!="string")throw new Error(V("client.invalidWorkspace"));return t}async function e7(e){const t=await At("/web/workspaces",{signal:e});if(!t.ok)throw new Error(await cn(t,V("client.loadWorkspacesFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(V("client.invalidWorkspaceList"));return n.items.map(m0e)}async function g0e(e,t,n,i){const r=await At(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i});if(!r.ok)throw new Error(await cn(r,V("client.saveWorkspaceFailed")));return m0e(await r.json())}function b0e(e,t){return g0e("/web/workspaces","POST",e,t)}function y0e(e,t,n){return g0e(`/web/workspaces/${encodeURIComponent(e)}`,"PATCH",t,n)}async function v0e(e,t){const n=await At(`/web/workspaces/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await cn(n,V("client.deleteWorkspaceFailed")))}async function Vk(e){const t=await At("/web/v3/environments",{signal:e});if(!t.ok)throw new Error(await cn(t,V("client.loadEnvironmentsFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(V("client.invalidEnvironmentList"));return n.items.map(JF)}async function x0e(e,t){const n=await At("/web/v3/environment-repositories/inspect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw new Error(await cn(n,V("client.probeRepositoryFailed")));const i=await n.json();if(typeof i.repositoryUrl!="string"||typeof i.ref!="string"||typeof i.commitSha!="string"||!Array.isArray(i.dockerfiles)||!i.dockerfiles.every(r=>typeof r=="string"))throw new Error(V("client.invalidRepositoryProbe"));return i}async function w0e(e,t){const n=await At(`/web/v3/environments/${encodeURIComponent(e)}/share-code`,{method:"POST",signal:t});if(!n.ok)throw new Error(await cn(n,V("client.exportEnvironmentCodeFailed")));const i=await n.json();if(typeof i.shareCode!="string"||typeof i.name!="string")throw new Error(V("client.invalidEnvironmentCode"));return i}async function O0e(e,t){const n=await At("/web/v3/environment-share-codes/inspect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shareCodes:e}),signal:t});if(!n.ok)throw new Error(await cn(n,V("client.inspectEnvironmentCodeFailed")));const i=await n.json();if(!Array.isArray(i.items))throw new Error(V("client.invalidEnvironmentCodeInspection"));return i.items.map(r=>{if(!r||typeof r!="object")throw new Error(V("client.invalidEnvironmentCodeInspection"));const s=r,a=s.status==="valid"||s.valid===!0?"valid":s.status==="invalid"||s.valid===!1?"invalid":null;if(!Number.isInteger(s.index)||a===null||s.name!==void 0&&typeof s.name!="string"||s.error!==void 0&&typeof s.error!="string")throw new Error(V("client.invalidEnvironmentCodeInspection"));return{index:s.index,status:a,name:s.name??"",error:s.error??""}})}async function S0e(e,t){const n=await At("/web/v3/environment-share-codes/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shareCodes:e}),signal:t});if(!n.ok)throw new Error(await cn(n,V("client.importEnvironmentCodeFailed")));const i=await n.json();if(!Array.isArray(i.items))throw new Error(V("client.invalidEnvironmentCodeImport"));return i.items.map(r=>{if(!r||typeof r!="object")throw new Error(V("client.invalidEnvironmentCodeImport"));const s=r;if(!Number.isInteger(s.index)||!(s.status==="created"||s.status==="duplicate"||s.status==="failed")||s.name!==void 0&&typeof s.name!="string"||s.error!==void 0&&typeof s.error!="string")throw new Error(V("client.invalidEnvironmentCodeImport"));return{index:s.index,status:s.status,name:s.name??"",environment:s.environment===void 0||s.environment===null?void 0:JF(s.environment),error:s.error??""}})}async function k0e(e,t,n,i){let r;try{r=await At(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i})}catch(s){throw s instanceof DOMException&&s.name==="AbortError"?s:s instanceof TypeError?new Error(V("client.studioUnavailable")):s}if(!r.ok)throw new Error(await cn(r,V("client.saveEnvironmentFailed")));return JF(await r.json())}function E0e(e,t){return k0e("/web/v3/environments","POST",e,t)}function C0e(e,t,n){return k0e(`/web/v3/environments/${encodeURIComponent(e)}`,"PATCH",t,n)}async function T0e(e,t){const n=await At(`/web/v3/environments/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await cn(n,V("client.deleteEnvironmentFailed")))}async function O4(e,t){const n=await At(`/web/v3/environments/${encodeURIComponent(e)}/build`,{method:"POST",signal:t});if(!n.ok)throw new Error(await cn(n,V("client.startEnvironmentBuildFailed")));const i=ZF(await n.json());if(!i)throw new Error(V("client.invalidEnvironmentBuild"));return i}async function A0e(e,t,n={}){const i=n.includeLogs?"?includeLogs=true":"",r=await At(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}${i}`,{signal:n.signal});if(!r.ok)throw new Error(await cn(r,V("client.loadEnvironmentBuildFailed")));const s=ZF(await r.json());if(!s)throw new Error(V("client.invalidEnvironmentBuild"));return s}async function _0e(e,t,n){const i=await At(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}/manifest`,{signal:n});if(!i.ok)throw new Error(await cn(i,V("client.loadEnvironmentManifestFailed")));return h0e(await i.json())}function TW(e){if(!e||typeof e!="object")throw new Error(V("client.invalidEnvironmentResource"));const t=e;if(t.source!=="provided"&&t.source!=="managed"||typeof t.consoleUrl!="string")throw new Error(V("client.invalidEnvironmentResource"));return t}async function N0e(e){const t=await At("/web/v3/environment-resources",{signal:e});if(!t.ok)throw new Error(await cn(t,V("client.loadEnvironmentResourcesFailed")));const n=await t.json();if(n.provider!=="volcengine"&&n.provider!=="byteplus"||typeof n.region!="string")throw new Error(V("client.invalidEnvironmentResource"));return{provider:n.provider,region:n.region,codePipeline:TW(n.codePipeline),containerRegistry:TW(n.containerRegistry)}}async function XBe(e,t){const n=await At(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/model-env`,{method:"POST",signal:t});if(!n.ok)throw new Error(await cn(n,V("client.updateCodexSandboxFailed")));const i=await n.json();if(i.kind!=="codex"&&i.kind!=="codex_snapshot"||typeof i.toolId!="string"||typeof i.updated!="boolean")throw new Error(V("client.invalidCodexSandboxUpdate"));return i}async function aR(e){const t=await At("/web/identity/user-pools",{signal:e});if(!t.ok)throw new Error(await cn(t,V("client.loadUserPoolsFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(V("client.invalidUserPoolList"));return n.items.map(i=>{if(!i||typeof i!="object"||typeof i.uid!="string"||typeof i.name!="string"||typeof i.domain!="string"||typeof i.region!="string"||typeof i.isCurrent!="boolean")throw new Error(V("client.invalidUserPoolList"));return i})}const vO=new Map;function YBe(e){if(typeof e=="string")return e?{message:e}:null;if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=typeof t.message=="string"?t.message:typeof t.error=="string"?t.error:"";return n?{message:n,phase:typeof t.phase=="string"?t.phase:void 0,runtimeId:typeof t.runtimeId=="string"?t.runtimeId:void 0,logPath:typeof t.logPath=="string"?t.logPath:void 0}:null}class xO extends Error{constructor(t){super(t.message),this.detail=t,this.name="GithubCicdPipelineError"}}async function Mh(e){const t=await e.text().catch(()=>"");if(t)try{const n=JSON.parse(t),i=YBe(n.detail??n.error);if(i)return new xO(i)}catch{return new xO({message:t})}return new xO({message:V("client.syncGithubFailed",{status:e.status})})}async function j0e(e){const t=await At("/web/github-delivery/source-sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.project,githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,region:e.region,cloudProvider:e.cloudProvider})},{},0);if(!t.ok)throw await Mh(t);return t.json()}async function R0e(e){const t=await At("/web/github-delivery/cicd-pipeline",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await Mh(t);return t.json()}async function I0e(e){const t=await At("/web/github-delivery/init-main",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.project,githubUrl:e.githubUrl,githubToken:e.githubToken,baseBranch:e.baseBranch,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await Mh(t);return t.json()}async function ZBe(e){const t=await At("/web/github-delivery/source-sync/cicd",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pipelineId:e.pipelineId,runtimeName:e.runtimeName,runtimeId:e.runtimeId,region:e.region,cloudProvider:e.cloudProvider,projectPath:e.projectPath??".",volcengineAccessKey:e.volcengineAccessKey,volcengineSecretKey:e.volcengineSecretKey,volcengineSessionToken:e.volcengineSessionToken??""})},{},0);if(!t.ok)throw await Mh(t);return t.json()}async function P0e(e){const t=await At(`/web/github-cicd/runtime-binding?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await Mh(t);const n=await t.json();return n.pipelineId?n:null}async function nA(e){const t=await At(`/web/github-delivery/versions?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await Mh(t);return t.json()}async function D0e(e){const t=await At("/web/github-delivery/rollback-pr",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await Mh(t);return t.json()}async function t7(e){const t=await At("/web/github-cicd/runtime-binding",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await Mh(t);return t.json()}async function M0e(e){const t=await At("/web/github-cicd/runtime-sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,project:e.project})},{},0);if(!t.ok)throw await Mh(t);return t.json()}async function Ax(e,t,n,i){var f,h,p,g,b;const r=i==null?void 0:i.taskId,s=r?new AbortController:void 0;r&&s&&vO.set(r,s);const a=()=>{r&&vO.get(r)===s&&vO.delete(r)};let l;try{const v=!!(i!=null&&i.migrationTaskId);(f=i==null?void 0:i.onStage)==null||f.call(i,{level:"info",phase:"upload",message:V(v?"client.validatingMigrationArtifact":"client.uploadingCodePackage"),pct:0}),l=await At("/web/deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},signal:s==null?void 0:s.signal,body:JSON.stringify({name:e,files:v?[]:t,config:n,taskId:r,migrationTaskId:i==null?void 0:i.migrationTaskId,runtimeId:i==null?void 0:i.runtimeId,runtimeName:i==null?void 0:i.runtimeName,appName:i==null?void 0:i.appName,editMode:i==null?void 0:i.editMode,draft:i==null?void 0:i.draft,updateEtag:i==null?void 0:i.updateEtag,baseRuntimeVersion:i==null?void 0:i.baseRuntimeVersion,removeRuntimeEnvKeys:i==null?void 0:i.removeRuntimeEnvKeys,mcpSecretValues:i==null?void 0:i.mcpSecretValues,mcpCredentialReuses:i==null?void 0:i.mcpCredentialReuses,sessionStorage:i==null?void 0:i.sessionStorage,minInstance:i==null?void 0:i.minInstance,maxInstance:i==null?void 0:i.maxInstance,createEvaluationSets:i==null?void 0:i.createEvaluationSets,description:mBe((i==null?void 0:i.description)??""),authentication:i==null?void 0:i.authentication,im:i==null?void 0:i.im,envs:i==null?void 0:i.envs,resources:i==null?void 0:i.resources,source:(i==null?void 0:i.source)??(i!=null&&i.migrationTaskId?{kind:"migration",migrationId:i.migrationTaskId}:{kind:"inlineFiles"}),harnessSidecar:i==null?void 0:i.harnessSidecar,environment:i==null?void 0:i.environment})},{},0),(h=i==null?void 0:i.onStage)==null||h.call(i,{level:"success",phase:"upload",message:V(v?"client.migrationArtifactValidated":"client.codePackageUploaded"),pct:100})}catch(v){throw a(),kW(v)?v:new jw({taskId:r,cause:v})}if(!l.ok){const v=await cn(l,V("client.deploymentFailed"));throw a(),new Error(v)}let c=null;try{for await(const v of eR(l)){const y=v;if(y&&y.done){c=y;break}y&&y.message&&((p=i==null?void 0:i.onStage)==null||p.call(i,y))}}catch(v){throw a(),kW(v)?v:new jw({taskId:r,cause:v})}if(a(),!c)throw new jw({taskId:r});if(!c.success){const v=new Error(c.error||V("client.deploymentFailed"));throw Rbe(v)?new jw({taskId:r,cause:v}):v}if(!c.agentName)throw new Error(V("client.deploymentMissingAgentName"));if(!c.runtimeId&&!c.url)throw new Error(V("client.deploymentMissingConnection"));const u=(g=c.runtimeName)!=null&&g.trim()?c.agentName:e,d=((b=c.runtimeName)==null?void 0:b.trim())||c.agentName;return{apikey:c.apikey??"",url:c.url??"",agentName:u,runtimeName:d,runtimeId:c.runtimeId,consoleUrl:c.consoleUrl,region:c.region,version:c.version,warnings:c.warnings,feishuChannel:c.feishuChannel}}async function L0e(e){var n;const t=await At("/web/cancel-deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});if(!t.ok){const i=await t.text().catch(()=>"");throw new Error(i||V("client.cancelDeploymentFailed",{status:t.status}))}(n=vO.get(e))==null||n.abort(),vO.delete(e)}async function JBe(e=FF){const t=await At(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(V("client.loadFailed",{status:t.status}));return(await t.json()).runtimes??[]}const bS={title:"AgentKit Studio",logoUrl:""},S4={enabled:!1},ID={studio:!1,version:"",provider:"volcengine",branding:bS,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,agentUsage:!1,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local",telemetry:S4};function eUe(e){if(!e||typeof e!="object")return S4;const t=e;if(t.enabled!==!0||!t.studio||typeof t.studio!="object")return S4;const n=t.studio;return{enabled:!0,studio:{deployId:typeof n.deployId=="string"?n.deployId:"",userPoolId:typeof n.userPoolId=="string"?n.userPoolId:"",applicationId:typeof n.applicationId=="string"?n.applicationId:"",functionId:typeof n.functionId=="string"?n.functionId:"",region:typeof n.region=="string"?n.region:"",project:typeof n.project=="string"?n.project:"",version:typeof n.version=="string"?n.version:"",accountId:typeof n.accountId=="string"?n.accountId:"",accountIdResolutionError:typeof n.accountIdResolutionError=="string"?n.accountIdResolutionError:""}}}async function $0e(){var e,t;try{const n=await At("/web/ui-config");if(!n.ok)return ID;const i=await n.json(),r=typeof((e=i.branding)==null?void 0:e.logoUrl)=="string"?i.branding.logoUrl:bS.logoUrl,s=i.provider==="byteplus"?"byteplus":"volcengine";return Ube(s),{studio:i.studio??!1,version:typeof i.version=="string"?i.version:"",provider:s,branding:{title:typeof((t=i.branding)==null?void 0:t.title)=="string"?i.branding.title:bS.title,logoUrl:r?Bo(r):""},features:{...ID.features,...i.features??{}},defaultView:i.defaultView??"chat",agentsSource:i.agentsSource==="cloud"?"cloud":"local",telemetry:eUe(i.telemetry)}}catch{return ID}}const F0e={role:"user",telemetry:{userId:"",accountId:""},capabilities:{createAgents:!1,createPersonalAgents:!1,manageAgents:!1,runtimeScope:"mine"}};async function B0e(){var n,i,r,s,a;const e=await At("/web/access");if(!e.ok)throw new Error(V("client.loadPermissionsFailed",{status:e.status}));const t=await e.json();if(!["admin","developer","user"].includes(t.role)||typeof((n=t.telemetry)==null?void 0:n.userId)!="string"||t.telemetry.accountId!==void 0&&typeof t.telemetry.accountId!="string"||typeof((i=t.capabilities)==null?void 0:i.createAgents)!="boolean"||typeof((r=t.capabilities)==null?void 0:r.createPersonalAgents)!="boolean"||typeof((s=t.capabilities)==null?void 0:s.manageAgents)!="boolean"||!["all","mine"].includes((a=t.capabilities)==null?void 0:a.runtimeScope))throw new Error(V("client.invalidPermissionResponse"));return t}async function U0e(e,t){const n=new URLSearchParams;e&&n.set("targetVersion",e),t&&n.set("startedAt",String(t));const i=n.size?`?${n.toString()}`:"",r=await At(`/web/studio-update${i}`);if(!r.ok)throw new Error(V("client.checkStudioUpdateFailed",{status:r.status}));return await r.json()}async function Q0e(){const e=await At("/web/studio-update/permissions");if(!e.ok){let t="";try{const n=await e.json();t=typeof n.detail=="string"?n.detail:""}catch{t=""}throw new Error(t||V("client.studioUpdatePreflightFailed",{status:e.status}))}return await e.json()}async function z0e(e){const t=await At("/web/studio-update",{method:"POST",headers:{"Content-Type":"application/json","X-VeADK-Studio-Update":"1"},body:JSON.stringify({version:e})},{},is);if(!t.ok){let n="";try{const i=await t.json();n=typeof i.detail=="string"?i.detail:""}catch{n=""}throw new Error(n||V("client.submitStudioUpdateFailed",{status:t.status}))}return await t.json()}async function V0e({runtimeId:e,region:t,appName:n,page:i=1,pageSize:r=20,signal:s}){const a=new URLSearchParams({runtimeId:e,region:t,appName:n,page:String(i),pageSize:String(r)}),l=await At(`/web/agent-usage?${a.toString()}`,{signal:s});if(!l.ok)throw new Error(await cn(l,V("client.loadAgentUsageFailed")));const c=l.headers.get("content-type")||V("client.notProvided"),u=c.toLowerCase();if(!u.includes("application/json")&&!u.includes("+json"))throw new Error(V("client.agentUsageNonJson",{status:l.status,contentType:c})+V("client.checkStudioGateway"));try{return await l.json()}catch{throw new Error(V("client.agentUsageInvalidJson",{status:l.status,contentType:c})+V("client.retryCheckGateway"))}}function Lh(e=""){return`/web/cronjobs${e?`/${encodeURIComponent(e)}`:""}`}async function k4(e){const t=await At(Lh(),{signal:e});if(!t.ok)throw new Error(await cn(t,V("client.loadCronJobsFailed")));const n=await t.json();return Array.isArray(n)?n:n.items??[]}async function tUe(e,t){const n=await At(Lh(e),{signal:t});if(!n.ok)throw new Error(await cn(n,V("client.loadCronJobFailed")));return await n.json()}async function H0e(e){const t=await At(Lh(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await cn(t,V("client.createCronJobFailed")));return await t.json()}async function q0e(e,t){const n=await At(`${Lh(e)}/update`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(await cn(n,V("client.updateCronJobFailed")));return await n.json()}async function W0e(e,t){const n=t?"enable":"disable",i=await At(`${Lh(e)}/${n}`,{method:"POST"});if(!i.ok)throw new Error(await cn(i,V(t?"client.enableCronJobFailed":"client.pauseCronJobFailed")));return await i.json()}async function G0e(e){const t=await At(`${Lh(e)}/run`,{method:"POST"});if(!t.ok)throw new Error(await cn(t,V("client.runCronJobFailed")));return await t.json()}async function E4(e,t){const n=await At(`${Lh(e)}/runs`,{signal:t});if(!n.ok)throw new Error(await cn(n,V("client.loadCronHistoryFailed")));const i=await n.json();return Array.isArray(i)?i:i.items??[]}async function K0e(e,t){const n=await At(`${Lh(e)}/runs/${encodeURIComponent(t)}/cancel`,{method:"POST"});if(!n.ok)throw new Error(await cn(n,V("client.stopCronRunFailed")));return await n.json()}async function X0e(e){const t=await At(Lh(e),{method:"DELETE"});if(!t.ok)throw new Error(await cn(t,V("client.deleteCronJobFailed")))}class n7 extends Error{constructor(t,n){super(t),this.status=n,this.name="RuntimeListError"}}async function _x(e={}){const t=new URLSearchParams({scope:e.scope??"all",page_size:String(e.pageSize??30),region:e.region??"all"});e.nextToken&&t.set("next_token",e.nextToken);const n=await At(`/web/runtimes?${t.toString()}`,{signal:e.signal});if(!n.ok){const r=await cn(n,V("client.loadRuntimeFailed"));throw new n7(r,n.status)}const i=await n.json();return{runtimes:i.runtimes??[],nextToken:i.nextToken??""}}async function Fv(e,t,n={}){if(n.preferCached){const i=HF(e,t,n.currentVersion),r=Xy.get(i);if(r&&r.expiresAt>Date.now())return[...r.apps];r&&Xy.delete(i)}try{const i={runtimeId:e,region:t,runtimeVersion:n.currentVersion};return n.retryProbe&&(i.retryProbe=!0),await zk("","",i,n.signal,n.timeoutMs)}catch(i){if(i instanceof Cx||i instanceof Ds||i instanceof Error)throw i;return null}}async function Y0e(e,t){const n=new URLSearchParams({region:t}),i=await At(`/web/runtime-tool-channel/${encodeURIComponent(e)}/capabilities?${n.toString()}`);if(!i.ok)throw new Ds(await cn(i,V("client.loadLocalToolsFailed")),!1,!0);return await i.json()}async function Z0e(e,t){const n=new URLSearchParams({region:t}),i=await At(`/web/runtime-route-channel/${encodeURIComponent(e)}/connect?${n.toString()}`,{method:"POST"});if(!i.ok)throw new Ds(await cn(i,V("client.connectDynamicRouteFailed")),!1,!0);return await i.json()}async function J0e(e,t,n={}){const i={runtimeId:e,region:t};n.retryProbe&&(i.retryProbe=!0);const r=await At("/.well-known/agent-card.json",{},i),s=await Qbe(r);if(s==="runtime_access_denied")throw new Cx;if(s==="runtime_private_endpoint_unreachable")throw new Ds($be());if(["runtime_proxy_connect_error","runtime_proxy_timeout"].includes(s))throw new Ds(Fbe());if(r.status===404)return null;if(r.status===401||r.status===403)throw new Ds(V("client.a2aProbeDenied"));if(!r.ok)throw new Error(await cn(r,V("client.loadA2aCardFailed")));const a=await r.json().catch(()=>null),l=typeof(a==null?void 0:a.url)=="string"?a.url.trim():"";return l?{name:typeof(a==null?void 0:a.name)=="string"?a.name:"",description:typeof(a==null?void 0:a.description)=="string"?a.description:"",endpoint:l}:null}async function eye(e,t){const n=new URLSearchParams({runtimeId:e,region:t}),i=await At(`/web/runtime-api-key/reveal?${n.toString()}`,{method:"POST",cache:"no-store"});if(!i.ok)throw new Error(await cn(i,V("client.loadRuntimeApiKeyFailed")));const r=await i.json();if(typeof r.apiKey!="string"||!r.apiKey)throw new Error(V("client.runtimeApiKeyMissing"));return r.apiKey}async function tye(e,t){const n=await At("/web/delete-runtime",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t})});if(!n.ok){const i=await n.text().catch(()=>"");throw new Error(i||V("client.deleteFailed",{status:n.status}))}}function iA({runtimeId:e,region:t,appName:n,currentVersion:i}){return qb(gS,t,e,i??"",(n==null?void 0:n.trim())??"")}async function nUe({runtimeId:e,region:t,appName:n,currentVersion:i,force:r=!1}){const s=new URLSearchParams({runtimeId:e,region:t});n&&s.set("appName",n),i!=null&&s.set("currentVersion",String(i)),r&&s.set("refresh","true");const a=await At(`/web/runtime-update-capability?${s.toString()}`);if(!a.ok)throw new Error(await iUe(a));return await a.json()}function oR({runtimeId:e,region:t,appName:n,currentVersion:i,signal:r,force:s=!1}){var u,d;const a={runtimeId:e,region:t,appName:n,currentVersion:i},l=iA(a);if(s&&kr.delete(l),!s){const f=Lm(kr,l,Tx);if(f)return ZC(Promise.resolve(f),r);const h=(u=kr.get(l))==null?void 0:u.promise;if(h)return ZC(h,r);if(n){const p=iA({...a,appName:""}),g=(d=kr.get(p))==null?void 0:d.promise;if(g){let b;return b=g.then(v=>{var x,O,w,k,S;if(v.recoveryStatus==="preparing")return((x=kr.get(l))==null?void 0:x.promise)===b&&kr.delete(l),v;const y=((w=(O=v.agent)==null?void 0:O.appName)==null?void 0:w.trim())??"";return y&&y!==n.trim()?(((k=kr.get(l))==null?void 0:k.promise)===b&&kr.delete(l),oR(a)):(((S=kr.get(l))==null?void 0:S.promise)===b&&kr.set(l,{value:v,updatedAt:Date.now()}),v)},v=>{var y;throw((y=kr.get(l))==null?void 0:y.promise)===b&&kr.delete(l),v}),kr.set(l,{promise:b,updatedAt:0}),ZC(b,r)}}}let c;return c=nUe({...a,force:s}).then(f=>{var h,p,g,b,v;if(f.recoveryStatus==="preparing")return((h=kr.get(l))==null?void 0:h.promise)===c&&kr.delete(l),f;if(((p=kr.get(l))==null?void 0:p.promise)===c){kr.set(l,{value:f,updatedAt:Date.now()});const y=new Set(["",((b=(g=f.agent)==null?void 0:g.appName)==null?void 0:b.trim())??""]);for(const x of y){const O=iA({...a,appName:x});O!==l&&!((v=kr.get(O))!=null&&v.promise)&&kr.set(O,{value:f,updatedAt:Date.now()})}}return f},f=>{var h;throw((h=kr.get(l))==null?void 0:h.promise)===c&&kr.delete(l),f}),kr.set(l,{promise:c,updatedAt:0}),ZC(c,r)}function C4({runtimeId:e,region:t,appName:n,currentVersion:i}){return Lm(kr,iA({runtimeId:e,region:t,appName:n,currentVersion:i}),Tx)}function T4(e){return oR(e).then(()=>{},()=>{})}function A4(e,t){if(!e){kr.clear();return}for(const n of kr.keys()){const[i,r,s]=n.split("");i===gS&&s===e&&(!t||r===t)&&kr.delete(n)}}async function iUe(e){const t=await e.json().catch(()=>null),n=typeof(t==null?void 0:t.detail)=="string"?t.detail:"";return e.status===403?V("client.runtimeManageForbidden"):e.status===404?V(n==="runtime_not_found"?"client.runtimeNotFound":"client.runtimeUnavailable"):V("client.checkRuntimeUpdateFailed",{status:e.status})}async function rUe(e,t){let n=null;for(const i of Qk(t)){const r=await At(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(i)}`);if(r.ok)return r.json();n=new Error(await cn(r,V("client.loadRuntimeDetailFailed")))}throw n??new Error(V("client.loadRuntimeDetailFailed"))}async function i7(e,t="cn-beijing",n={}){const i=qb(e,t||"cn-beijing"),r=Lm(xg,i,Tx);if(!n.force&&r)return r;const s=xg.get(i);if(!n.force&&(s!=null&&s.promise))return s.promise;const a=rUe(e,t).then(l=>qF(xg,i,l));xg.set(i,{...s,promise:a,updatedAt:(s==null?void 0:s.updatedAt)??0});try{return await a}finally{const l=xg.get(i);(l==null?void 0:l.promise)===a&&xg.set(i,{value:l.value,updatedAt:l.updatedAt})}}function nye(e,t="cn-beijing"){return Lm(xg,qb(e,t||"cn-beijing"),Tx)}function iye(e,t="cn-beijing"){i7(e,t).catch(()=>{})}async function wO(e){const t=await At("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await cn(t,V("client.generateProjectFailed")));return t.json()}const sUe=19e4;async function rye(e){const t=await At("/web/generated-agent-drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requirement:e})},{},sUe);if(!t.ok)throw new Error(await cn(t,V("client.generateAgentConfigFailed")));return Jj(t,V("client.generateAgentConfigFailed"))}async function sye(e,t){const n=await At("/web/generated-agent-test-runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e,runtimeId:t==null?void 0:t.runtimeId,runtimeRegion:t==null?void 0:t.region})});if(!n.ok)throw new Error(await cn(n,V("client.createDebugRunFailed")));return Jj(n,V("client.createDebugRunFailed"))}async function aye(e,t){const n=await At(`/web/generated-agent-test-runs/${e}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:t})});if(!n.ok)throw new Error(await cn(n,V("client.createDebugSessionFailed")));return(await Jj(n,V("client.createDebugSessionFailed"))).id}async function oye(e,t){const n=await At(`/web/generated-agent-test-runs/${encodeURIComponent(e)}/trace/session/${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await cn(n,V("client.loadDebugTraceFailed")));const i=await Jj(n,V("client.loadDebugTraceFailed"));if(!Array.isArray(i))throw new Error(V("client.invalidDebugTrace"));return i}async function*lye({runId:e,userId:t,sessionId:n,text:i,signal:r}){const s=i.trim()?[{text:i}]:[],a=a0e(r);let l;try{l=await At(`/web/generated-agent-test-runs/${e}/run_sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_id:t,session_id:n,new_message:{role:"user",parts:s},streaming:!0}),signal:a.signal},{},0)}catch(c){throw a.cleanup(),a.timedOut()?new Error($v()):c}if(!l.ok)throw a.cleanup(),new Error(await cn(l,V("client.debugRunFailed")));try{for await(const c of eR(l))a.clearDeadline(),yield c}catch(c){throw a.timedOut()?new Error($v()):c}finally{a.cleanup()}}async function ey(e){const t=await At(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await cn(t,V("client.cleanupDebugRunFailed")))}function cye(e){if(!e||typeof e!="object")throw new Error(V("client.invalidSandboxVersion"));const t=e;if(typeof t.toolId!="string"||typeof t.error!="string")throw new Error(V("client.invalidSandboxVersion"));if(!t.error&&(t.provider!=="volcengine"&&t.provider!=="byteplus"||typeof t.region!="string"||typeof t.status!="string"||typeof t.currentImage!="string"||typeof t.latestImage!="string"||typeof t.needsImageUpdate!="boolean"||typeof t.canUpdate!="boolean"||typeof t.needsModelEnvUpdate!="boolean"||typeof t.canUpdateModelEnv!="boolean"||typeof t.modelEnvError!="string"))throw new Error(V("client.invalidSandboxVersion"));return t}async function uye(e){const t=await At("/web/system-info/sandbox-tools/updates",{signal:e});if(!t.ok)throw new Error(await cn(t,V("client.loadSandboxVersionsFailed")));const n=await t.json();if(!Array.isArray(n.tools))throw new Error(V("client.invalidSandboxVersion"));return n.tools.map(cye)}async function dye(e){const t=await At(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/update`,{method:"POST"},{},33e4);if(!t.ok)throw new Error(await cn(t,V("client.updateSandboxFailed")));const n=await t.json();if(typeof n.updated!="boolean")throw new Error(V("client.invalidSandboxUpdate"));return{updated:n.updated,state:cye(n.state)}}const aUe=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_SITE_BRANDING:bS,DEFAULT_STUDIO_ACCESS:F0e,GithubCicdPipelineError:xO,RuntimeAccessDeniedError:Cx,RuntimeListError:n7,RuntimeProbeError:Ds,attachGithubDeliveryCicdToSourceSync:ZBe,bindGithubCicdRuntime:t7,buildEnvironment:O4,cancelAgentkitDeployment:L0e,cancelCronJobRun:K0e,checkRuntimeNameAvailability:sR,clearMessageFeedbackCache:Ibe,clearRemoteApps:Dbe,componentSearch:i0e,createCronJob:H0e,createEnvironment:E0e,createGeneratedAgentTestRun:sye,createGeneratedAgentTestSession:aye,createGithubCicdPipeline:j0e,createGithubDeliveryCicdPipeline:R0e,createGithubDeliveryRollbackPr:D0e,createSession:zbe,createWorkspace:b0e,deleteAgentFeedbackCases:Kbe,deleteCronJob:X0e,deleteEnvironment:T0e,deleteGeneratedAgentTestRun:ey,deleteMedia:eA,deleteRuntime:tye,deleteSession:b4,deleteSessionMedia:y4,deleteWorkspace:v0e,deployAgentkitProject:Ax,downloadArtifact:GF,ensureRuntimeRouteChannel:Z0e,exportEnvironmentShareCode:w0e,fetchRemoteApps:zk,generateAgentDraftFromRequirement:rye,generateAgentProject:wO,getAgentFeedbackCases:rR,getAgentInfo:x4,getAgentOptimizations:Hbe,getAgentUsage:V0e,getAutomaticEvaluationStatuses:g4,getCachedAgentFeedbackCases:qbe,getCachedRuntimeAgentInfo:t0e,getCachedRuntimeDetail:nye,getCachedRuntimeUpdateCapability:C4,getCronJob:tUe,getEnvironmentBuild:A0e,getEnvironmentManifest:_0e,getEnvironmentResources:N0e,getGeneratedAgentTestTrace:oye,getGithubCicdRuntimeBinding:P0e,getGithubDeliveryVersions:nA,getMediaCapabilities:HBe,getMyRuntimes:JBe,getRuntimeAgentInfo:XF,getRuntimeDetail:i7,getRuntimeStudioToolCapabilities:Y0e,getRuntimeUpdateCapability:oR,getRuntimes:_x,getSandboxImageUpdates:uye,getSession:iR,getSessionTrace:L_,getStudioAccess:B0e,getStudioUpdatePermissions:Q0e,getStudioUpdateStatus:U0e,getSystemInfo:d0e,getUiConfig:$0e,httpErrorMessage:cn,importEnvironmentShareCodes:S0e,initializeGithubDeliveryMain:I0e,inspectEnvironmentRepository:x0e,inspectEnvironmentShareCodes:O0e,invalidateRuntimeUpdateCapabilityCache:A4,listApps:Lbe,listCronJobRuns:E4,listCronJobs:k4,listDeploymentResources:o0e,listEnvironments:Vk,listIdentityUserPools:aR,listModelApiKeys:VF,listModelOptions:Ex,listSessions:WF,listWorkspaces:e7,mediaContentUrl:Jbe,parseEnvironmentManifest:h0e,parseEnvironmentShareCodes:YF,parsePreparedSessionEnvironmentMounts:l0e,prefetchAgentFeedbackCases:zBe,prefetchRuntimeAgentInfo:n0e,prefetchRuntimeDetail:iye,prefetchRuntimeUpdateCapability:T4,prepareSessionEnvironmentMounts:c0e,previewArtifact:KF,probeRuntimeA2a:J0e,probeRuntimeApps:Fv,refreshAgentFeedbackCases:Wbe,registerRemoteApp:Pbe,revealModelApiKey:Mbe,revealRuntimeApiKey:eye,runCronJobNow:G0e,runGeneratedAgentTestSSE:lye,runSSE:w4,runSseEmptyResponseError:s0e,runSseFirstEventTimeoutError:$v,runSseIncompleteResponseError:tA,runtimeRegionCandidates:Qk,setClientCloudProvider:Ube,setCronJobEnabled:W0e,startStudioUpdate:z0e,studioFetch:Tn,submitIssueFeedback:v4,submitMessageFeedback:Vbe,syncGithubCicdRuntime:M0e,updateCodexSandboxToolModelEnv:XBe,updateCronJob:q0e,updateEnvironment:C0e,updateSandboxTool:dye,updateWorkspace:y0e,uploadMedia:Ybe,upsertCachedAgentFeedbackCase:J2,webSearch:r0e,writeEnvironmentShareCode:u0e},Symbol.toStringTag,{value:"Module"})),AW=Object.freeze({totalTokenCount:0,promptTokenCount:0,candidatesTokenCount:0,thoughtsTokenCount:0,cachedContentTokenCount:0}),rA=Object.freeze({modelName:"",current:AW,cumulative:AW}),oUe={totalTokenCount:"total_token_count",promptTokenCount:"prompt_token_count",candidatesTokenCount:"candidates_token_count",thoughtsTokenCount:"thoughts_token_count",cachedContentTokenCount:"cached_content_token_count"},lUe=24,cUe=64,uUe=16;function JC(e){var l,c;const t=e.trim();if(!t)return 0;const n=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/gu,i=((l=t.match(n))==null?void 0:l.length)??0,r=t.replace(n," "),s=(r.match(/[A-Za-z0-9_]+/g)??[]).reduce((u,d)=>u+Math.max(1,Math.ceil(d.length/4)),0),a=((c=r.match(/[^\sA-Za-z0-9_]/g))==null?void 0:c.length)??0;return i+s+a}function dUe(e){var l,c,u;const t=((l=e.instruction)==null?void 0:l.trim())??"",n=((c=e.tools)==null?void 0:c.filter(d=>d.trim()))??[],i=((u=e.skills)==null?void 0:u.filter(d=>d.name.trim()))??[],r=JC(t),s=n.reduce((d,f)=>d+cUe+JC(f),0),a=i.reduce((d,f)=>d+uUe+JC(f.name)+JC(f.description??""),0);return lUe+r+s+a}function fUe({usage:e,contextWindow:t,estimatedSystemTokens:n}){const i=Math.max(1,Math.round(t)),r=Math.max(0,e.current.promptTokenCount),s=Math.max(r,e.current.totalTokenCount),a=Math.min(i,r>0?Math.min(r,Math.max(0,n??0)):Math.max(0,n??0)),l=Math.max(0,r-a),c=r>0?Math.max(0,s-r):Math.max(0,s),u=r>0?s:a+c;return{systemTokens:a,inputTokens:l,outputTokens:c,remainingTokens:Math.max(0,i-u),usedTokens:u,contextWindow:i}}function hUe(e){const t=[{kind:"system",tokens:e.systemTokens},{kind:"input",tokens:e.inputTokens},{kind:"output",tokens:e.outputTokens},{kind:"remaining",tokens:e.remainingTokens}],n=e.contextWindow/100;let i=0;const r=t.map(s=>{const a=i;return i+=s.tokens,{...s,start:a,end:i}});return Array.from({length:100},(s,a)=>{const l=a*n,c=l+n,u=r.flatMap(d=>{const f=Math.max(0,Math.min(c,d.end)-Math.max(l,d.start));return f>0?[{kind:d.kind,share:f/n}]:[]});return{index:a,slices:u}})}function L1(e,t){const n=e,i=n[t]??n[oUe[t]];return typeof i=="number"&&Number.isFinite(i)&&i>0?Math.round(i):0}function pUe(e){const t=L1(e,"promptTokenCount"),n=L1(e,"candidatesTokenCount"),i=L1(e,"thoughtsTokenCount");return{totalTokenCount:L1(e,"totalTokenCount")||t+n+i,promptTokenCount:t,candidatesTokenCount:n,thoughtsTokenCount:i,cachedContentTokenCount:L1(e,"cachedContentTokenCount")}}function mUe(e,t){return{totalTokenCount:e.totalTokenCount+t.totalTokenCount,promptTokenCount:e.promptTokenCount+t.promptTokenCount,candidatesTokenCount:e.candidatesTokenCount+t.candidatesTokenCount,thoughtsTokenCount:e.thoughtsTokenCount+t.thoughtsTokenCount,cachedContentTokenCount:e.cachedContentTokenCount+t.cachedContentTokenCount}}function fye(e,t){if(!t)return e;const n=typeof t.modelVersion=="string"?t.modelVersion.trim():"",i=typeof t.model_version=="string"?t.model_version.trim():"",r=n||i||e.modelName,s=t.usageMetadata??t.usage_metadata;if(!s)return r===e.modelName?e:{...e,modelName:r};const a=pUe(s);return a.totalTokenCount===0?r===e.modelName?e:{...e,modelName:r}:{modelName:r,current:a,cumulative:mUe(e.cumulative,a)}}function _W(e){return e.reduce((t,n)=>fye(t,n),rA)}function NW(e){return e.blocks.flatMap(t=>t.kind==="tool"?[{name:t.name,args:t.args,response:t.response,done:t.done}]:[])}function gUe(e){const t=e.attributes;return String(t["invocation.id"]??t["gen_ai.invocation.id"]??t["gcp.vertex.agent.invocation_id"]??"")}function bUe(e,t){if(!t)return e;const n=new Set(e.filter(r=>gUe(r)===t).map(r=>r.trace_id)),i=e.filter(r=>n.has(r.trace_id));return i.length>0?i:e}function bb(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Fp(e){return typeof e=="string"?e:""}function hye(e,t){return e==="pending"||e==="running"||e==="completed"||e==="failed"?e:t}function yUe(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=bb(t)??{};return bb(n.result)??n}function vUe(e){var n;const t=(n=bb(e))==null?void 0:n.branches;return Array.isArray(t)?t.map(i=>{var r;return Fp((r=bb(i))==null?void 0:r.label)}):[]}function pye(e,t,n){const i=vUe(e),r=yUe(t),s=Array.isArray(r.branches)?r.branches:[],a=n==="running"?"running":"pending";return{branches:[0,1].map(c=>{const u=bb(s[c])??{};return{label:Fp(u.label)||i[c]||`方向 ${c+1}`,content:Fp(u.content),status:hye(u.status,a),error:Fp(u.error)}})}}function xUe(e){const t=bb(e),n=bb(t==null?void 0:t.veadkStudioToolProgress);return!n||n.toolName!=="branch_compare"||typeof n.branchIndex!="number"||n.branchIndex<0||n.branchIndex>1?null:{toolName:"branch_compare",requestId:Fp(n.requestId),branchIndex:n.branchIndex,label:Fp(n.label),delta:Fp(n.delta),status:hye(n.status,"running"),error:Fp(n.error)||void 0}}function wUe(e,t,n){return{branches:pye(e,t,"running").branches.map((s,a)=>a===n.branchIndex?{...s,label:n.label||s.label,content:s.content+n.delta,status:n.status,error:n.error??s.error}:s)}}function Ha(e,t){return ln.t(`blocks.codexProgress.${e}`,{ns:"conversation",...t})}const mye=28e4;function jW(e){try{return JSON.stringify(e).length}catch{return mye}}function OUe(e){const t=e.slice(-200);let n=t.reduce((i,r)=>i+jW(r),0);for(;t.length>1&&n>mye;)n-=jW(t.shift());return t}function Jl(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Ci(e){return typeof e=="string"?e:""}function r7(e,t=""){const n=Ci(e).toLowerCase();return t.endsWith(".failed")||["failed","error","declined","cancelled"].includes(n)?"failed":t.endsWith(".completed")||["completed","done","success"].includes(n)?"completed":"running"}function gye(e){if(e.response!==void 0)return e.response;if(e.result!==void 0)return e.result;const t=e.aggregatedOutput??e.aggregated_output??e.output,n=e.exitCode??e.exit_code;if(!(t===void 0&&n===void 0))return{...t!==void 0?{output:t}:{},...n!==void 0?{exitCode:n}:{}}}function bye(e){if(e.args!==void 0)return e.args;if(e.arguments!==void 0)return e.arguments;if(e.input!==void 0)return e.input;const t=Ci(e.command),n=Ci(e.cwd);if(t||n)return{...t?{command:t}:{},...n?{cwd:n}:{}};if(e.changes!==void 0)return{changes:e.changes};if(e.approval!==void 0)return e.approval}function wg(e,t,n,i,r){return{kind:"tool",name:e,callId:t,args:i,response:r,done:n!=="running",status:n,...n==="failed"?{defaultOpen:!0}:{}}}function yye(e){const t=Ci(e.id||e.itemId||e.item_id),n=Ci(e.kind);if(!t||!n)return null;const i=r7(e.status),r=Ci(e.text||e.detail||e.delta),s=!Ci(e.text||e.detail)&&typeof e.delta=="string";if(n==="thinking"||n==="reasoning")return r?{id:t,block:{kind:"thinking",text:r,done:i!=="running"},appendText:s}:null;if(n==="commentary")return r?{id:t,block:{kind:"text",text:r},appendText:s}:null;if(["message","text","assistant_final","final"].includes(n))return r?{id:t,block:{kind:"text",text:r},appendText:s,finalAnswer:!0}:null;if(n==="plan"){const a=Array.isArray(e.plan)?e.plan:[];return{id:t,block:{kind:"plan",title:Ci(e.title)||Ha("planTitle"),summary:r||void 0,items:a.flatMap(l=>{const c=Jl(l),u=Ci(c==null?void 0:c.text);if(!u)return[];const d=Ci(c==null?void 0:c.status);return[{text:u,status:["pending","in_progress","completed","failed"].includes(d)?d:"pending"}]}),done:i!=="running"}}}if(["tool","command","command_execution","commandExecution","file_change","fileChange","mcp_tool_call","mcpToolCall","collab_tool_call","web_search","approval","status"].includes(n)){const a=Ha(n==="file_change"||n==="fileChange"?"fallback.fileChange":n==="approval"?"fallback.approval":n==="status"?"fallback.status":"fallback.command"),l=bye(e),c=gye(e)??(n==="status"&&r||void 0);return{id:t,block:wg(Ci(e.name||e.title)||a,t,i,l,c)}}return null}function vye(e){const t=Ci(e.type),n=Jl(e.item),i=Ci(n==null?void 0:n.type),r=Ci((n==null?void 0:n.id)||e.id)||(t==="turn.failed"?"turn":"");if(!r)return null;const s=r7(n==null?void 0:n.status,t);if(i==="reasoning"||i==="agent_message"){const a=Ci(n==null?void 0:n.text);return a?{id:r,block:i==="reasoning"?{kind:"thinking",text:a,done:s!=="running"}:{kind:"text",text:a},...i==="agent_message"&&(n==null?void 0:n.phase)!=="commentary"?{finalAnswer:!0}:{}}:null}if(i==="todo_list"){const l=(Array.isArray(n==null?void 0:n.items)?n.items:[]).flatMap(c=>{const u=Jl(c),d=Ci(u==null?void 0:u.text);if(!d)return[];const f=Ci(u==null?void 0:u.status).toLowerCase(),h=(u==null?void 0:u.completed)===!0||["completed","done"].includes(f)?"completed":["failed","error"].includes(f)?"failed":["in_progress","running"].includes(f)?"in_progress":"pending";return[{text:d,status:h}]});return l.length?{id:r,block:{kind:"plan",title:Ha("planTitle"),summary:Ha("planSummary",{completed:l.filter(c=>c.status==="completed").length,total:l.length}),items:l,done:s!=="running"}}:null}if(i==="command_execution"){const a=Ha(`command.${s}`);return{id:r,block:wg(a,r,s,bye(n??{}),gye(n??{}))}}if(i==="file_change"){const a=Array.isArray(n==null?void 0:n.changes)?n.changes:[],l=a.length?Ha("projectFiles",{count:a.length}):Ha("projectFile"),c=Ha(`fileChange.${s}`,{subject:l});return{id:r,block:wg(c,r,s,a.length?{changes:a}:void 0)}}if(i==="mcp_tool_call"){const a=[Ci(n==null?void 0:n.server),Ci(n==null?void 0:n.tool)].filter(Boolean).join("/")||Ha("externalTool"),l=Ha(`mcp.${s}`,{tool:a}),c=Jl(n==null?void 0:n.error),u=(n==null?void 0:n.result)!==void 0?n.result:Ci(c==null?void 0:c.message)||void 0;return{id:r,block:wg(l,r,s,n==null?void 0:n.arguments,u)}}if(i==="collab_tool_call"){const a=Ci(n==null?void 0:n.tool),l=["spawn_agent","send_input","wait","close_agent"].includes(a)?a:"default",c=Ha(`collaboration.${l}.${s}`),u=Object.fromEntries(["tool","receiver_thread_ids","prompt"].filter(d=>(n==null?void 0:n[d])!==void 0).map(d=>[d,n==null?void 0:n[d]]));return{id:r,block:wg(c,r,s,Object.keys(u).length?u:void 0,n==null?void 0:n.agents_states)}}if(i==="web_search"){const a=Ha(`webSearch.${s}`),l=Object.fromEntries(["query","action"].filter(c=>(n==null?void 0:n[c])!==void 0).map(c=>[c,n==null?void 0:n[c]]));return{id:r,block:wg(a,r,s,Object.keys(l).length?l:void 0)}}if(i==="error"||t==="error"||t==="turn.failed"){const a=Jl(e.error),l=Ci((n==null?void 0:n.message)||e.message||(a==null?void 0:a.message))||Ha("errorDetail");return{id:r,block:wg(Ha("errorTitle"),r,"failed",void 0,l)}}return null}function SUe(e){const t=Jl(e),n=Jl(t==null?void 0:t.veadkStudioToolProgress);if(!n||n.kind!=="codex")return null;const i=Ci(n.toolName),r=Ci(n.requestId);if(!i||!r)return null;const s=Jl(n.event??n.activity);if(!s)return null;const a=Jl(s.item)||Ci(s.type)?vye(s):yye(s);if(!a)return null;const l=Ci(n.title||n.label),c=Ci(s.agentSessionId??s.agent_session_id),u=Ci(s.sandboxSessionId??s.sandbox_session_id),d=Ci(s.threadId??s.thread_id),f=r7(s.status,Ci(s.type)),p=Ci(s.kind)==="status"&&f!=="running"?f:void 0;return{toolName:i,requestId:r,...l?{title:l}:{},...c?{agentSessionId:c}:{},...u?{sandboxSessionId:u}:{},...d?{threadId:d}:{},...p?{terminalStatus:p}:{},event:a}}function kUe(e,t){const n=Jl(t),i=Jl((n==null?void 0:n.codexActivity)??(n==null?void 0:n.codex_activity));if(!i)return e;const r=Ci(i.title)||(e==null?void 0:e.title)||"Codex Sandbox",s=Ci(i.agentSessionId??i.agent_session_id)||(e==null?void 0:e.agentSessionId),a=Ci(i.sandboxSessionId??i.sandbox_session_id)||(e==null?void 0:e.sandboxSessionId),l=Ci(i.threadId??i.thread_id)||(e==null?void 0:e.threadId);let c={title:r,...s?{agentSessionId:s}:{},...a?{sandboxSessionId:a}:{},...l?{threadId:l}:{},items:(e==null?void 0:e.items.slice())??[]};const u=Array.isArray(i.events)?i.events:[];for(const d of u){const f=Jl(d);if(!f)continue;const h=Jl(f.item)||Ci(f.type)?vye(f):yye(f);h&&(h.finalAnswer||(c=_4(c,{title:r,...s?{agentSessionId:s}:{},...a?{sandboxSessionId:a}:{},...l?{threadId:l}:{},event:h})))}return c}function _4(e,t){const n=(e==null?void 0:e.items.slice())??[],i=n.findIndex(r=>r.id===t.event.id);if(i>=0){const r=n[i].block,s=t.event.block;t.event.appendText&&r.kind==="text"&&s.kind==="text"?n[i]={id:t.event.id,block:{...s,text:r.text+s.text}}:t.event.appendText&&r.kind==="thinking"&&s.kind==="thinking"?n[i]={id:t.event.id,block:{...s,text:r.text+s.text}}:n[i]={id:t.event.id,block:s}}else n.push({id:t.event.id,block:t.event.block});return{title:t.title||(e==null?void 0:e.title)||"Codex Sandbox",...t.agentSessionId||e!=null&&e.agentSessionId?{agentSessionId:t.agentSessionId||(e==null?void 0:e.agentSessionId)}:{},...t.sandboxSessionId||e!=null&&e.sandboxSessionId?{sandboxSessionId:t.sandboxSessionId||(e==null?void 0:e.sandboxSessionId)}:{},...t.threadId||e!=null&&e.threadId?{threadId:t.threadId||(e==null?void 0:e.threadId)}:{},items:OUe(n)}}const xye="send_a2ui_json_to_client",N4="validated_a2ui_json",j4="adk_request_credential",RW="transfer_to_agent";function EUe(e){var i,r,s,a;const t=e,n=((i=t==null?void 0:t.exchangedAuthCredential)==null?void 0:i.oauth2)??((r=t==null?void 0:t.exchanged_auth_credential)==null?void 0:r.oauth2)??((s=t==null?void 0:t.rawAuthCredential)==null?void 0:s.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 R4(){return{blocks:[],liveStart:0,pendingCodexProgress:[]}}function IW(e,t){if(t.event.finalAnswer)return"applied";let n=-1;for(let i=e.length-1;i>=0;i-=1){const r=e[i];if(!(r.kind!=="tool"||r.name!==t.toolName)){if(r.callId===t.requestId)return r.done?"completed":(r.codexActivity=_4(r.codexActivity,t),r.status=t.terminalStatus??"running",t.terminalStatus&&(r.done=!0),"applied");if(!r.done){if(n>=0)return"unmatched";n=i}}}if(n>=0){const i=e[n];return i.kind!=="tool"?"unmatched":(i.codexActivity=_4(i.codexActivity,t),i.status=t.terminalStatus??"running",t.terminalStatus&&(i.done=!0),"applied")}return"unmatched"}function CUe(e){if(!e||typeof e!="object"||Array.isArray(e))return"completed";const t=e,n=typeof t.status=="string"?t.status.toLowerCase():"";return t.ok===!1||["error","failed","denied","declined","cancelled","timeout"].includes(n)?"failed":"completed"}function PW(e){if(!e||typeof e!="object"||Array.isArray(e))return"";const t=e;return t.ok!==!0||typeof t.message!="string"?"":t.message.trim()}const I4=e=>e.functionCall??e.function_call,yS=e=>e.functionResponse??e.function_response;function TUe(e){if(!e||typeof e!="object")return"";const t=e,n=t.agentName??t.agent_name;return typeof n=="string"?n:""}function AUe(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function lR(e){const t=[];for(const[n,i]of e.entries()){const r=i.partMetadata??i.part_metadata,s=r==null?void 0:r.veadkTransport;if((s==null?void 0:s.hidden)===!0)continue;const a=r==null?void 0:r.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=i.inlineData??i.inline_data;if(l&&l.data){t.push({id:`inline-${n}-${l.displayName??l.display_name??"media"}`,mimeType:l.mimeType??l.mime_type,data:AUe(l.data),name:l.displayName??l.display_name});continue}const c=i.fileData??i.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 vS(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 _Ue=new Set(["llm","sequential","parallel","loop","a2a"]);function NUe(e){var t;for(const n of e){const i=(t=n.partMetadata??n.part_metadata)==null?void 0:t.veadkInvocation;if(!i||typeof i!="object")continue;const r=i,s=Array.isArray(r.skills)?r.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=r.targetAgent;if(l&&typeof l=="object"){const c=l,u=c.type;typeof c.name=="string"&&typeof u=="string"&&_Ue.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(s.length>0||a)return{skills:s,targetAgent:a}}}function jUe(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 RUe(e,t){if(!t.length)return;const n=e[e.length-1];if((n==null?void 0:n.kind)==="artifact"){for(const i of t)n.files.some(r=>r.filename===i.filename&&r.version===i.version)||n.files.push(i);return}e.push({kind:"artifact",files:t})}function PD(e,t,n){const i=e[e.length-1];i&&i.kind===t?i.text+=n:e.push(t==="thinking"?{kind:t,text:n,done:!1}:{kind:t,text:n})}function eT(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function wye(e,t){var d,f,h,p,g,b;const n=e.blocks.map(v=>({...v}));let i=e.liveStart,r=e.pendingCodexProgress.slice();const s=((d=t.content)==null?void 0:d.parts)??[],a=s.flatMap(v=>{const y=xUe(v.partMetadata??v.part_metadata);return y?[y]:[]}),l=s.flatMap(v=>{const y=SUe(v.partMetadata??v.part_metadata);return y?[y]:[]});if(a.length>0||l.length>0){for(const v of a)for(let y=n.length-1;y>=0;y-=1){const x=n[y];if(!(x.kind!=="tool"||x.done||x.name!==v.toolName||v.requestId&&x.callId&&x.callId!==v.requestId)){x.response=wUe(x.args,x.response,v),x.status="running";break}}for(const v of l)IW(n,v)==="unmatched"&&(r=[...r,v].slice(-64));return{blocks:n,liveStart:i,pendingCodexProgress:r}}const c=s.some(v=>I4(v)||yS(v));if(t.partial&&!c){for(const v of s){const y=vS(v);typeof y=="string"&&y&&PD(n,v.thought?"thinking":"text",y)}return{blocks:n,liveStart:i,pendingCodexProgress:r}}n.length=i;for(const v of s){const y=I4(v),x=yS(v),O=lR([v]),w=vS(v);if(typeof w=="string"&&w)PD(n,v.thought?"thinking":"text",w);else if(O.length)eT(n),jUe(n,O);else if(y)if(eT(n),y.name===RW){const k=TUe(y.args)||((f=t.actions)==null?void 0:f.transferToAgent)||((h=t.actions)==null?void 0:h.transfer_to_agent)||ln.t("app:common.unknownAgent");n.push({kind:"agent-transfer",agentName:k,done:!1})}else if(y.name===j4){const k=y.args??{},S=k.authConfig??k.auth_config??k,C=String(k.functionCallId??k.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;n.push({kind:"auth",callId:y.id??"",label:C,authUri:EUe(S),authConfig:S,done:!1})}else{const k={kind:"tool",name:y.name??"",callId:y.id,args:y.args,done:!1};if(n.push(k),k.callId){const S=[];for(const E of r)E.toolName===k.name&&E.requestId===k.callId?IW(n,E):S.push(E);r=S}}else if(x){if(eT(n),x.name===RW)for(let k=n.length-1;k>=0;k--){const S=n[k];if(S.kind==="agent-transfer"&&!S.done){S.done=!0;break}}if(x.name===j4)for(let k=n.length-1;k>=0;k--){const S=n[k];if(S.kind==="auth"&&!S.done){S.done=!0;break}}for(let k=n.length-1;k>=0;k--){const S=n[k],E=S.kind==="tool"&&S.name==="delegate_to_codex_sandbox";if(S.kind==="tool"&&(!S.done||E)&&S.name===x.name&&(!x.id||!S.callId||S.callId===x.id)){const C=E?PW(S.response):"";if(S.done=!0,S.response=x.response,E){S.codexActivity=kUe(S.codexActivity,x.response),S.status=CUe(x.response);const N=PW(x.response);N&&N!==C&&PD(n,"text",N)}break}}if(x.name===xye){const k=((p=x.response)==null?void 0:p[N4])??[];if(k.length){const S=n[n.length-1];S&&S.kind==="a2ui"?S.messages.push(...k):n.push({kind:"a2ui",messages:k})}}}}const u=((g=t.actions)==null?void 0:g.artifactDelta)??((b=t.actions)==null?void 0:b.artifact_delta);return u&&RUe(n,Object.entries(u).map(([v,y])=>({filename:v,version:y}))),eT(n),i=n.length,{blocks:n,liveStart:i,pendingCodexProgress:r}}function IUe(e,t){var u,d,f,h,p,g;if(e.partial===!0)return!1;const n=((u=e.content)==null?void 0:u.parts)??[],i=n.some(b=>{const v=vS(b);return!b.thought&&typeof v=="string"&&v.trim().length>0||lR([b]).length>0}),r=n.some(b=>{var y;const v=yS(b);return(v==null?void 0:v.name)===xye&&Array.isArray((y=v.response)==null?void 0:y[N4])&&v.response[N4].length>0}),s=((d=e.actions)==null?void 0:d.artifactDelta)??((f=e.actions)==null?void 0:f.artifact_delta),a=!!(s&&Object.keys(s).length>0),l=!!(((h=e.actions)==null?void 0:h.endOfAgent)??((p=e.actions)==null?void 0:p.end_of_agent)??((g=e.actions)==null?void 0:g.escalate)),c=t.some(b=>b.kind==="text"||b.kind==="attachment"||b.kind==="artifact"||b.kind==="a2ui"||b.kind==="delivery");return i||r||a||l&&c}function PUe(e){var n,i,r;const t=((n=e.actions)==null?void 0:n.artifactDelta)??((i=e.actions)==null?void 0:i.artifact_delta);return t&&Object.keys(t).length>0?!0:(((r=e.content)==null?void 0:r.parts)??[]).some(s=>!!(vS(s)||lR([s]).length>0||I4(s)||yS(s)))}function $_(e="adk-stream",t){var a,l,c;let n=0;const i=new Map;let r;const s=(u,d)=>`${d}\0${u}`;if((t==null?void 0:t.role)==="assistant"){const u=((a=t.meta)==null?void 0:a.author)??"",d=((l=t.meta)==null?void 0:l.invocationId)??"",f=((c=t.meta)==null?void 0:c.localId)??`${e}-${n++}`,h=R4();h.blocks=t.blocks,h.liveStart=t.blocks.length,r=s(u,d),i.set(r,{acc:h,localId:f,meta:{...t.meta,localId:f,streaming:!0,eventId:void 0}})}return{project(u){const d=u.author&&u.author!=="user"?u.author:"",f=u.invocationId??u.invocation_id??"",h=s(d,f);let p=i.get(h);if(!p&&r){const y=i.get(r);y&&(!y.meta.author||y.meta.author===d)&&(i.delete(r),r=void 0,p=y)}if(!p&&!PUe(u))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(!p){const y=`${e}-${n++}`;p={acc:R4(),localId:y,meta:{author:d||void 0,invocationId:f||void 0}}}p.acc=wye(p.acc,u);const g=u.usageMetadata??u.usage_metadata,b=IUe(u,p.acc.blocks);p.meta={...p.meta,author:d||p.meta.author,localId:p.localId,streaming:!b,tokens:(g==null?void 0:g.totalTokenCount)||p.meta.tokens,ts:u.timestamp||p.meta.ts,invocationId:f||p.meta.invocationId,eventId:b&&u.id?u.id:p.meta.eventId};const v={role:"assistant",blocks:p.acc.blocks,meta:p.meta};return b?(i.delete(h),r=void 0):i.set(h,p),{turn:v,completed:b}},finish(){const u=[...i.values()].map(d=>({role:"assistant",blocks:d.acc.blocks,meta:{...d.meta,streaming:!1}}));return i.clear(),u}}}function Dg(e,t){var s;const n=(s=t.meta)==null?void 0:s.localId;if(!n)return[...e,t];const i=e.findIndex(a=>{var l;return((l=a.meta)==null?void 0:l.localId)===n});if(i<0)return[...e,t];const r=e.slice();return r[i]=t,r}function DUe(e,t={}){var r;let n=[],i=$_("adk-history");for(const s of e)if(s.author==="user"){const l=((r=s.content)==null?void 0:r.parts)??[];if(l.some(h=>{var p;return((p=yS(h))==null?void 0:p.name)===j4})){for(let h=n.length-1;h>=0;h--)if(n[h].role==="assistant"){for(let p=n[h].blocks.length-1;p>=0;p--){const g=n[h].blocks[p];if(g.kind==="auth"){g.done=!0;break}}break}}const c=l.map(vS).filter(h=>!!h).join(""),u=lR(l),d=NUe(l);if(!c&&!u.length&&!d)continue;for(const h of i.finish())n=Dg(n,h);const f=[];d&&f.push({kind:"invocation",value:d}),u.length&&f.push({kind:"attachment",files:u}),c&&f.push({kind:"text",text:c}),n.push({role:"user",blocks:f,meta:{ts:s.timestamp}}),i=$_("adk-history")}else{const l=i.project(s);l.ignored||(n=Dg(n,l.turn))}for(const s of i.finish())n=Dg(n,s);for(const s of n){const a=s.meta,l=a==null?void 0:a.eventId;if(!l)continue;const c=t[`veadk_feedback:${l}`];if(!c||typeof c!="object")continue;const u=c;u.rating!=="good"&&u.rating!=="bad"||(a.feedback=c)}return n}function cR(e,t=ln.t("app:titles.newConversation")){var n,i;for(const r of e??[])if(r.author==="user"||((n=r.content)==null?void 0:n.role)==="user"){const s=(((i=r.content)==null?void 0:i.parts)??[]).map(a=>a.text).find(Boolean);if(s)return s}return t}function Oye(e,t,n){if(e.name===t||e.id===t)return(n==null?void 0:n.type)==="parallel"?n:void 0;for(const i of e.children){const r=Oye(i,t,e);if(r)return r}}function MUe(e,t){var a,l;if(e.role!=="assistant"||!t)return;const n=(a=e.meta)==null?void 0:a.author;if(!n)return;const i=Oye(t,n);if(!i)return;const r=i.id||i.path.join("/")||i.name;return{key:`${((l=e.meta)==null?void 0:l.invocationId)??""}::${r}`,parent:i.name}}function LUe(e,t){const n=[];return e.forEach((i,r)=>{const s=MUe(i,t),a=n[n.length-1];if(s&&(a==null?void 0:a.groupKey)===s.key){a.turnIndexes.push(r);return}n.push({key:s?`parallel-${s.key}-${r}`:`turn-${r}`,turnIndexes:[r],parallelParent:s==null?void 0:s.parent,groupKey:s==null?void 0:s.key})}),n.map(({groupKey:i,...r})=>r)}function Sye(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t{const t=m.Children.toArray(e),n=[];let i="";const r=()=>{i!==""&&(n.push(i),i="")};for(const s of t)if(!(s==null||typeof s=="boolean")){if(typeof s=="string"||typeof s=="number"){i+=String(s);continue}r(),n.push(s)}return r(),n},s7=e=>{const t=$Ue(e),n=m.Children.count(t);return m.Children.map(t,i=>{if(typeof i=="string"&&i.trim())return n<=1?i:o.jsx("span",{children:i});if(m.isValidElement(i)){const r=i,{children:s,...a}=r.props;return s!=null?m.cloneElement(r,a,s7(s)):r}return i})},FUe="_Badge_1viyg_1",BUe={Badge:FUe},ba=({children:e,className:t,variant:n="soft",color:i="secondary",size:r="sm",pill:s,...a})=>o.jsx("div",{className:pi(BUe.Badge,t),"data-color":i,"data-size":r,"data-pill":s?"":void 0,"data-variant":n,...a,children:s7(e)});var UUe=typeof Ip=="object"&&Ip&&Ip.Object===Object&&Ip,QUe=typeof self=="object"&&self&&self.Object===Object&&self;UUe||QUe||Function("return this")();var zUe=typeof window<"u"?m.useLayoutEffect:m.useEffect;function VUe(){const e=m.useRef(!1);return m.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),m.useCallback(()=>e.current,[])}var DW={width:void 0,height:void 0};function kye(e){const{ref:t,box:n="content-box"}=e,[{width:i,height:r},s]=m.useState(DW),a=VUe(),l=m.useRef({...DW}),c=m.useRef(void 0);return c.current=e.onResize,m.useEffect(()=>{if(!t.current||typeof window>"u"||!("ResizeObserver"in window))return;const u=new ResizeObserver(([d])=>{const f=n==="border-box"?"borderBoxSize":n==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",h=MW(d,f,"inlineSize"),p=MW(d,f,"blockSize");if(l.current.width!==h||l.current.height!==p){const b={width:h,height:p};l.current.width=h,l.current.height=p,c.current?c.current(b):a()&&s(b)}});return u.observe(t.current,{box:n}),()=>{u.disconnect()}},[n,t,a]),{width:i,height:r}}function MW(e,t,n){return e[t]?Array.isArray(e[t])?e[t][0][n]:e[t][n]:t==="contentBoxSize"?e.contentRect[n==="inlineSize"?"width":"height"]:void 0}function a7(e,t){const n=m.useRef(e);zUe(()=>{n.current=e},[e]),m.useEffect(()=>{if(!t&&t!==0)return;const i=setTimeout(()=>{n.current()},t);return()=>{clearTimeout(i)}},[t])}const HUe={DEV:!1,MODE:"production"},Yy=typeof import.meta<"u"?HUe:void 0,qUe=!!(Yy!=null&&Yy.DEV),WUe=typeof navigator<"u"&&/(jsdom|happy-dom)/i.test(navigator.userAgent)||typeof globalThis.happyDOM=="object",Eye=(Yy==null?void 0:Yy.MODE)==="test"||WUe,GUe=typeof window<"u",Cye=typeof document<"u",KUe=GUe&&Cye,o7=e=>{const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const n=t.offsetWidth;let i=.985;n<=80?i=.96:n<=150?i=.97:n<=220?i=.98:n>600&&(i=.995),t.style.setProperty("--scale",i.toString())},F_=(e,t)=>{const n=()=>{const a=setTimeout(e);return()=>{clearTimeout(a)}};if(!KUe||typeof window.requestAnimationFrame!="function"||Cye&&document.visibilityState==="hidden")return n();let r=2,s=window.requestAnimationFrame(function a(){r-=1,r===0?e():s=window.requestAnimationFrame(a)});return()=>{typeof window.cancelAnimationFrame=="function"&&window.cancelAnimationFrame(s)}},Wb=e=>Object.keys(e).reduce((n,i)=>{const r=e[i];if(r||r===0){const s=i.startsWith("--")?"":"--",a=typeof r=="number"?`${r}px`:r;n[`${s}${i}`]=a}return n},{}),DD=e=>typeof e=="number"?`${e}deg`:e,MD=e=>String(e),tT=e=>`${e}ms`,LD=({x:e,y:t,scale:n,rotate:i,skewX:r,skewY:s}={})=>{const a=[e==null?null:`translateX(${e}px)`,t==null?null:`translateY(${t}px)`,n==null?null:`scale(${n})`,i==null?null:`rotate(${DD(i)})`,r==null?null:`skewX(${DD(r)})`,s==null?null:`skewY(${DD(s)})`].filter(Boolean);return a.length?a.join(" "):"none"},$D=({blur:e}={})=>{const t=[e==null?null:`blur(${e}px)`].filter(Boolean);return t.length?t.join(" "):"none"},ih=e=>{e.preventDefault()},Tye=e=>e.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex^="-"]), [contenteditable]'),XUe="_LoadingIndicator_7yl6f_1",YUe={LoadingIndicator:XUe},Hk=({className:e,size:t,strokeWidth:n,style:i,...r})=>o.jsx("div",{...r,className:pi(YUe.LoadingIndicator,e),style:i||Wb({"indicator-size":t,"indicator-stroke":n})});var ZUe=Object.defineProperty,l7=(e,t)=>ZUe(e,"name",{value:t,configurable:!0});function P4(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}l7(P4,"setRef");function Aye(...e){return t=>{let n=!1;const i=e.map(r=>{const s=P4(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;rJUe(e,"name",{value:t,configurable:!0});function Oh(e){const t=m.forwardRef((n,i)=>{let{children:r,...s}=n,a=null,l=!1;const c=[];D4(r)&&typeof nT=="function"&&(r=nT(r._payload)),m.Children.forEach(r,h=>{var p;if(Pye(h)){l=!0;const g=h;let b="child"in g.props?g.props.child:g.props.children;D4(b)&&typeof nT=="function"&&(b=nT(b._payload)),a=eQe(g,b),c.push((p=a==null?void 0:a.props)==null?void 0:p.children)}else c.push(h)}),a?a=m.cloneElement(a,void 0,c):!l&&m.Children.count(r)===1&&m.isValidElement(r)&&(a=r);const u=a?Iye(a):void 0,d=ir(i,u);if(!a){if(r||r===0)throw new Error(l?iQe(e):nQe(e));return r}const f=Rye(s,a.props??{});return a.type!==m.Fragment&&(f.ref=i?d:u),m.cloneElement(a,f)});return t.displayName=`${e}.Slot`,t}qu(Oh,"createSlot");var _ye=Oh("Slot"),Nye=Symbol.for("radix.slottable");function jye(e){const t=qu(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=Nye,t}qu(jye,"createSlottable");var eQe=qu((e,t)=>{if("child"in e.props){const n=e.props.child;return m.isValidElement(n)?m.cloneElement(n,void 0,e.props.children(n.props.children)):null}return m.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function Rye(e,t){const n={...t};for(const i in t){const r=e[i],s=t[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...l)=>{const c=s(...l);return r(...l),c}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}qu(Rye,"mergeProps");function Iye(e){var i,r;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}qu(Iye,"getElementRef");function Pye(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Nye}qu(Pye,"isSlottable");var tQe=Symbol.for("react.lazy");function D4(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===tQe&&"_payload"in e&&Dye(e._payload)}qu(D4,"isLazyComponent");function Dye(e){return typeof e=="object"&&e!==null&&"then"in e}qu(Dye,"isPromiseLike");var nQe=qu(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),iQe=qu(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),nT=Fb[" use ".trim().toString()],rQe=Object.defineProperty,sQe=(e,t)=>rQe(e,"name",{value:t,configurable:!0}),aQe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],wr=aQe.reduce((e,t)=>{const n=Oh(`Primitive.${t}`),i=m.forwardRef((r,s)=>{const{asChild:a,...l}=r,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:s})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function c7(e,t){e&&Li.flushSync(()=>e.dispatchEvent(t))}sQe(c7,"dispatchDiscreteCustomEvent");var oQe=Object.defineProperty,lQe=(e,t)=>oQe(e,"name",{value:t,configurable:!0}),cQe=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),uQe=m.forwardRef(lQe(function(t,n){return o.jsx(wr.span,{...t,ref:n,style:{...cQe,...t.style}})},"VisuallyHidden")),dQe=uQe,fQe=Object.defineProperty,Qc=(e,t)=>fQe(e,"name",{value:t,configurable:!0});function hQe(e,t){const n=m.createContext(t);n.displayName=e+"Context";const i=Qc(s=>{const{children:a,...l}=s,c=m.useMemo(()=>l,Object.values(l));return o.jsx(n.Provider,{value:c,children:a})},"Provider");i.displayName=e+"Provider";function r(s,a={}){const{optional:l=!1}=a,c=m.useContext(n);if(c)return c;if(t!==void 0)return t;if(!l)throw new Error(`\`${s}\` must be used within \`${e}\``)}return Qc(r,"useContext"),[i,r]}Qc(hQe,"createContext");function kl(e,t=[]){let n=[];function i(s,a){const l=m.createContext(a);l.displayName=s+"Context";const c=n.length;n=[...n,a];const u=Qc(f=>{var y;const{scope:h,children:p,...g}=f,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=m.useMemo(()=>g,Object.values(g));return o.jsx(b.Provider,{value:v,children:p})},"Provider");u.displayName=s+"Provider";function d(f,h,p={}){var y;const{optional:g=!1}=p,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=m.useContext(b);if(v)return v;if(a!==void 0)return a;if(!g)throw new Error(`\`${f}\` must be used within \`${s}\``)}return Qc(d,"useContext"),[u,d]}Qc(i,"createContext");const r=Qc(()=>{const s=n.map(a=>m.createContext(a));return Qc(function(l){const c=(l==null?void 0:l[e])||s;return m.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])},"useScope")},"createScope");return r.scopeName=e,[i,Mye(r,...t)]}Qc(kl,"createContextScope");function Mye(...e){const t=e[0];if(e.length===1)return t;const n=Qc(()=>{const i=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return Qc(function(s){const a=i.reduce((l,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...l,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}Qc(Mye,"composeContextScopes");var pQe=Object.defineProperty,Pa=(e,t)=>pQe(e,"name",{value:t,configurable:!0});function u7(e){const t=e+"CollectionProvider",[n,i]=kl(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=Pa(b=>{const{scope:v,children:y}=b,x=m.useRef(null),O=m.useRef(new Map).current;return o.jsx(r,{scope:v,itemMap:O,collectionRef:x,children:y})},"CollectionProvider");a.displayName=t;const l=e+"CollectionSlot",c=Oh(l),u=m.forwardRef((b,v)=>{const{scope:y,children:x}=b,O=s(l,y),w=ir(v,O.collectionRef);return o.jsx(c,{ref:w,children:x})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=Oh(d),p=m.forwardRef((b,v)=>{const{scope:y,children:x,...O}=b,w=m.useRef(null),k=ir(v,w),S=s(d,y);return m.useEffect(()=>(S.itemMap.set(w,{ref:w,...O}),()=>void S.itemMap.delete(w))),o.jsx(h,{[f]:"",ref:k,children:x})});p.displayName=d;function g(b){const v=s(e+"CollectionConsumer",b);return m.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const O=Array.from(x.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((S,E)=>O.indexOf(S.ref.current)-O.indexOf(E.ref.current))},[v.collectionRef,v.itemMap])}return Pa(g,"useCollection"),[{Provider:a,Slot:u,ItemSlot:p},g,i]}Pa(u7,"createCollection");var LW=new WeakMap,Ws,Wl,FD=(Wl=class extends Map{constructor(n){super(n);cV(this,Ws);NP(this,Ws,[...super.keys()]),LW.set(this,!0)}set(n,i){return LW.get(this)&&(this.has(n)?uo(this,Ws)[uo(this,Ws).indexOf(n)]=n:uo(this,Ws).push(n)),super.set(n,i),this}insert(n,i,r){const s=this.has(i),a=uo(this,Ws).length,l=d7(n);let c=l>=0?l:a+l;const u=c<0||c>=a?-1:c;if(u===this.size||s&&u===this.size-1||u===-1)return this.set(i,r),this;const d=this.size+(s?0:1);l<0&&c++;const f=[...uo(this,Ws)];let h,p=!1;for(let g=c;g=this.size&&(s=this.size-1),this.at(s)}keyFrom(n,i){const r=this.indexOf(n);if(r===-1)return;let s=r+i;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return s;r++}}findIndex(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return r;r++}return-1}filter(n,i){const r=[];let s=0;for(const a of this)Reflect.apply(n,i,[a,s,this])&&r.push(a),s++;return new Wl(r)}map(n,i){const r=[];let s=0;for(const a of this)r.push([a[0],Reflect.apply(n,i,[a,s,this])]),s++;return new Wl(r)}reduce(...n){const[i,r]=n;let s=0,a=r??this.at(0);for(const l of this)s===0&&n.length===1?a=l:a=Reflect.apply(i,this,[a,l,s,this]),s++;return a}reduceRight(...n){const[i,r]=n;let s=r??this.at(-1);for(let a=this.size-1;a>=0;a--){const l=this.at(a);a===this.size-1&&n.length===1?s=l:s=Reflect.apply(i,this,[s,l,a,this])}return s}toSorted(n){const i=[...this.entries()].sort(n);return new Wl(i)}toReversed(){const n=new Wl;for(let i=this.size-1;i>=0;i--){const r=this.keyAt(i),s=this.get(r);n.set(r,s)}return n}toSpliced(...n){const i=[...this.entries()];return i.splice(...n),new Wl(i)}slice(n,i){const r=new Wl;let s=this.size-1;if(n===void 0)return r;n<0&&(n=n+this.size),i!==void 0&&i>0&&(s=i-1);for(let a=n;a<=s;a++){const l=this.keyAt(a),c=this.get(l);r.set(l,c)}return r}every(n,i){let r=0;for(const s of this){if(!Reflect.apply(n,i,[s,r,this]))return!1;r++}return!0}some(n,i){let r=0;for(const s of this){if(Reflect.apply(n,i,[s,r,this]))return!0;r++}return!1}},Ws=new WeakMap,Pa(Wl,"OrderedDict"),Wl);function sA(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=Lye(e,t);return n===-1?void 0:e[n]}Pa(sA,"at");function Lye(e,t){const n=e.length,i=d7(t),r=i>=0?i:n+i;return r<0||r>=n?-1:r}Pa(Lye,"toSafeIndex");function d7(e){return e!==e||e===0?0:Math.trunc(e)}Pa(d7,"toSafeInteger");function mQe(e){const t=e+"CollectionProvider",[n,i]=kl(t),[r,s]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new FD,setItemMap:Pa(()=>{},"setItemMap")}),a=Pa(({state:O,...w})=>O?o.jsx(c,{...w,state:O}):o.jsx(l,{...w}),"CollectionProvider");a.displayName=t;const l=Pa(O=>{const w=v();return o.jsx(c,{...O,state:w})},"CollectionInit");l.displayName=t+"Init";const c=Pa(O=>{const{scope:w,children:k,state:S}=O,E=m.useRef(null),[C,N]=m.useState(null),_=ir(E,N),[j,A]=S;return m.useEffect(()=>{if(!C)return;const F=Bye(()=>{});return F.observe(C,{childList:!0,subtree:!0}),()=>{F.disconnect()}},[C]),o.jsx(r,{scope:w,itemMap:j,setItemMap:A,collectionRef:_,collectionRefObject:E,collectionElement:C,children:k})},"CollectionProviderImpl");c.displayName=t+"Impl";const u=e+"CollectionSlot",d=Oh(u),f=m.forwardRef((O,w)=>{const{scope:k,children:S}=O,E=s(u,k),C=ir(w,E.collectionRef);return o.jsx(d,{ref:C,children:S})});f.displayName=u;const h=e+"CollectionItemSlot",p="data-radix-collection-item",g=Oh(h),b=m.forwardRef((O,w)=>{const{scope:k,children:S,...E}=O,C=m.useRef(null),[N,_]=m.useState(null),j=ir(w,C,_),A=s(h,k),{setItemMap:F}=A,T=m.useRef(E);$ye(T.current,E)||(T.current=E);const P=T.current;return m.useEffect(()=>{const R=P;return F(L=>N?L.has(N)?L.set(N,{...R,element:N}).toSorted(M4):(L.set(N,{...R,element:N}),L.toSorted(M4)):L),()=>{F(L=>!N||!L.has(N)?L:(L.delete(N),new FD(L)))}},[N,P,F]),o.jsx(g,{[p]:"",ref:j,children:S})});b.displayName=h;function v(){return m.useState(new FD)}Pa(v,"useInitCollection");function y(O){const{itemMap:w}=s(e+"CollectionConsumer",O);return w}return Pa(y,"useCollection"),[{Provider:a,Slot:f,ItemSlot:b},{createCollectionScope:i,useCollection:y,useInitCollection:v}]}Pa(mQe,"createCollection");function $ye(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Pa($ye,"shallowEqual");function Fye(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Pa(Fye,"isElementPreceding");function M4(e,t){return!e[1].element||!t[1].element?0:Fye(e[1].element,t[1].element)?-1:1}Pa(M4,"sortByDocumentPosition");function Bye(e){return new MutationObserver(n=>{for(const i of n)if(i.type==="childList"){e();return}})}Pa(Bye,"getChildListObserver");var gQe=Object.defineProperty,Nx=(e,t)=>gQe(e,"name",{value:t,configurable:!0}),Uye=!!(typeof window<"u"&&window.document&&window.document.createElement);function yn(e,t,{checkForDefaultPrevented:n=!0}={}){return Nx(function(r){if(e==null||e(r),n===!1||!r||!r.defaultPrevented)return t==null?void 0:t(r)},"handleEvent")}Nx(yn,"composeEventHandlers");function bQe(e){var t;if(!Uye)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}Nx(bQe,"getOwnerWindow");function L4(e){if(!Uye)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}Nx(L4,"getOwnerDocument");function Qye(e,t=!1){const{activeElement:n}=L4(e);if(!(n!=null&&n.nodeName))return null;if(zye(n)&&n.contentDocument)return Qye(n.contentDocument.body,t);if(t){const i=n.getAttribute("aria-activedescendant");if(i){const r=L4(n).getElementById(i);if(r)return r}}return n}Nx(Qye,"getActiveElement");function zye(e){return e.tagName==="IFRAME"}Nx(zye,"isFrame");var Jc=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},yQe=Object.defineProperty,vQe=(e,t)=>yQe(e,"name",{value:t,configurable:!0}),$W=Fb[" useEffectEvent ".trim().toString()],FW=Fb[" useInsertionEffect ".trim().toString()];function Vye(e){if(typeof $W=="function")return $W(e);const t=m.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof FW=="function"?FW(()=>{t.current=e}):Jc(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}vQe(Vye,"useEffectEvent");var xQe=Object.defineProperty,qk=(e,t)=>xQe(e,"name",{value:t,configurable:!0}),wQe=Fb[" useInsertionEffect ".trim().toString()]||Jc;function su({prop:e,defaultProp:t,onChange:n=qk(()=>{},"onChange"),caller:i}){const[r,s,a]=Hye({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:r,u=m.useCallback(d=>{var f;if(l){const h=qye(d)?d(e):d;h!==e&&((f=a.current)==null||f.call(a,h))}else s(d)},[l,e,s,a]);return[c,u]}qk(su,"useControllableState");function Hye({defaultProp:e,onChange:t}){const[n,i]=m.useState(e),r=m.useRef(n),s=m.useRef(t);return wQe(()=>{s.current=t},[t]),m.useEffect(()=>{var a;r.current!==n&&((a=s.current)==null||a.call(s,n),r.current=n)},[n,r]),[n,i,s]}qk(Hye,"useUncontrolledState");function qye(e){return typeof e=="function"}qk(qye,"isFunction");var BW=Symbol("RADIX:SYNC_STATE");function OQe(e,t,n,i){const{prop:r,defaultProp:s,onChange:a,caller:l}=t,c=r!==void 0,u=Vye(a),d=[{...n,state:s}];i&&d.push(i);const[f,h]=m.useReducer((v,y)=>{if(y.type===BW)return{...v,state:y.state};const x=e(v,y);return c&&!Object.is(x.state,v.state)&&u(x.state),x},...d),p=f.state,g=m.useRef(p);m.useEffect(()=>{g.current!==p&&(g.current=p,c||u(p))},[p,g,c]);const b=m.useMemo(()=>r!==void 0?{...f,state:r}:f,[f,r]);return m.useEffect(()=>{c&&!Object.is(r,f.state)&&h({type:BW,state:r})},[r,f.state,c]),[b,h]}qk(OQe,"useControllableStateReducer");var SQe=Object.defineProperty,Sh=(e,t)=>SQe(e,"name",{value:t,configurable:!0});function Wye(e,t){return m.useReducer((n,i)=>t[n][i]??n,e)}Sh(Wye,"useStateMachine");var Gd=Sh(e=>{const{present:t,children:n}=e,i=Gye(t),r=typeof n=="function"?n({present:i.isPresent}):m.Children.only(n),s=Kye(i.ref,Xye(r));return typeof n=="function"||i.isPresent?m.cloneElement(r,{ref:s}):null},"Presence");function Gye(e){const[t,n]=m.useState(),i=m.useRef(null),r=m.useRef(e),s=m.useRef("none"),a=m.useRef(void 0),l=e?"mounted":"unmounted",[c,u]=Wye(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{c==="mounted"?(s.current=a.current??ty(i.current),a.current=void 0):s.current="none"},[c]),Jc(()=>{const d=i.current,f=r.current;if(f!==e){const p=s.current,g=ty(d);e?(a.current=g,u("MOUNT")):g==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&p!==g?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,u]),Jc(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,h=Sh(g=>{const v=ty(i.current).includes(CSS.escape(g.animationName));if(g.target===t&&v&&(u("ANIMATION_END"),!r.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},"handleAnimationEnd"),p=Sh(g=>{g.target===t&&(s.current=ty(i.current))},"handleAnimationStart");return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:m.useCallback(d=>{if(d){const f=getComputedStyle(d);i.current=f,a.current=ty(f)}else i.current=null;n(d)},[])}}Sh(Gye,"usePresence");function $4(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Sh($4,"setRef");function Kye(...e){const t=m.useRef(e);return t.current=e,m.useCallback(n=>{const i=t.current;let r=!1;const s=i.map(a=>{const l=$4(a,n);return!r&&typeof l=="function"&&(r=!0),l});if(r)return()=>{for(let a=0;akQe(e,"name",{value:t,configurable:!0}),CQe=Fb[" useId ".trim().toString()]||(()=>{}),TQe=0;function mm(e){const[t,n]=m.useState(CQe());return Jc(()=>{e||n(i=>i??String(TQe++))},[e]),e||(t?`radix-${t}`:"")}EQe(mm,"useId");var AQe=Object.defineProperty,_Qe=(e,t)=>AQe(e,"name",{value:t,configurable:!0}),NQe=m.createContext(void 0);function Wk(e){const t=m.useContext(NQe);return e||t||"ltr"}_Qe(Wk,"useDirection");var jQe=Object.defineProperty,RQe=(e,t)=>jQe(e,"name",{value:t,configurable:!0});function $u(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}RQe($u,"useCallbackRef");var IQe=Object.defineProperty,Ra=(e,t)=>IQe(e,"name",{value:t,configurable:!0}),F4="dismissableLayer.update",PQe="dismissableLayer.pointerDownOutside",DQe="dismissableLayer.focusOutside",UW,Yye=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),f7=m.forwardRef(Ra(function(t,n){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:l,onInteractOutside:c,onDismiss:u,...d}=t,f=m.useContext(Yye),[h,p]=m.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=m.useState({}),v=ir(n,p),y=Array.from(f.layers),[x]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),O=x?y.indexOf(x):-1,w=h?y.indexOf(h):-1,k=f.layersWithOutsidePointerEventsDisabled.size>0,S=w>=O,E=m.useRef(!1),C=Zye(A=>{a==null||a(A),c==null||c(A),A.defaultPrevented||u==null||u()},{ownerDocument:g,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:E,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(A=>{if(!(A instanceof Node))return!1;const F=[...f.branches].some(T=>T.contains(A));return S&&!F},[f.branches,S])}),N=Jye(A=>{if(r&&E.current)return;const F=A.target;[...f.branches].some(P=>P.contains(F))||(l==null||l(A),c==null||c(A),A.defaultPrevented||u==null||u())},g),_=h?w===y.length-1:!1,j=$u(A=>{A.key==="Escape"&&(s==null||s(A),!A.defaultPrevented&&u&&(A.preventDefault(),u()))});return m.useEffect(()=>{if(_)return g.addEventListener("keydown",j,{capture:!0}),()=>g.removeEventListener("keydown",j,{capture:!0})},[g,_,j]),m.useEffect(()=>{if(h)return i&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(UW=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),B4(),()=>{i&&(f.layersWithOutsidePointerEventsDisabled.delete(h),f.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=UW))}},[h,g,i,f]),m.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),B4())},[h,f]),m.useEffect(()=>{const A=Ra(()=>b({}),"handleUpdate");return document.addEventListener(F4,A),()=>document.removeEventListener(F4,A)},[]),o.jsx(wr.div,{...d,ref:v,style:{pointerEvents:k?S?"auto":"none":void 0,...t.style},onFocusCapture:yn(t.onFocusCapture,N.onFocusCapture),onBlurCapture:yn(t.onBlurCapture,N.onBlurCapture),onPointerDownCapture:yn(t.onPointerDownCapture,C.onPointerDownCapture)})},"DismissableLayer"));function MQe(){const e=m.useContext(Yye),[t,n]=m.useState(null);return m.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Ra(MQe,"useDismissableLayerSurface");var LQe=Ra(()=>!0,"IS_TRUE");function Zye(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:s,shouldHandlePointerDownOutside:a=LQe}=t,l=$u(e),c=m.useRef(!1),u=m.useRef(!1),d=m.useRef(new Map),f=m.useRef(()=>{});return m.useEffect(()=>{function h(){u.current=!1,r.current=!1,d.current.clear()}Ra(h,"resetOutsideInteraction");function p(){return Array.from(d.current.values()).some(Boolean)}Ra(p,"isOutsideInteractionIntercepted");function g(O){if(!u.current)return;const w=O.target;w instanceof Node&&[...s].some(S=>S.contains(w))||d.current.set(O.type,!0),O.type==="click"&&window.setTimeout(()=>{u.current&&f.current()},0)}Ra(g,"handleInteractionCapture");function b(O){u.current&&d.current.set(O.type,!1)}Ra(b,"handleInteractionBubble");const v=Ra(O=>{if(O.target&&!c.current){let w=function(){n.removeEventListener("click",f.current);const S=p();h(),S||h7(PQe,l,k,{discrete:!0})};if(Ra(w,"handleAndDispatchPointerDownOutsideEvent"),!a(O.target)){n.removeEventListener("click",f.current),h(),c.current=!1;return}const k={originalEvent:O};u.current=!0,r.current=i&&O.button===0,d.current.clear(),!i||O.button!==0?w():(n.removeEventListener("click",f.current),f.current=w,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),h();c.current=!1},"handlePointerDown"),y=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const O of y)n.addEventListener(O,g,!0),n.addEventListener(O,b);const x=window.setTimeout(()=>{n.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(x),n.removeEventListener("pointerdown",v),n.removeEventListener("click",f.current);for(const O of y)n.removeEventListener(O,g,!0),n.removeEventListener(O,b)}},[n,l,i,r,s,a]),{onPointerDownCapture:Ra(()=>c.current=!0,"onPointerDownCapture")}}Ra(Zye,"usePointerDownOutside");function Jye(e,t=globalThis==null?void 0:globalThis.document){const n=$u(e),i=m.useRef(!1);return m.useEffect(()=>{const r=Ra(s=>{s.target&&!i.current&&h7(DQe,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:Ra(()=>i.current=!0,"onFocusCapture"),onBlurCapture:Ra(()=>i.current=!1,"onBlurCapture")}}Ra(Jye,"useFocusOutside");function B4(){const e=new CustomEvent(F4);document.dispatchEvent(e)}Ra(B4,"dispatchUpdate");function h7(e,t,n,{discrete:i}){const r=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),i?c7(r,s):r.dispatchEvent(s)}Ra(h7,"handleAndDispatchCustomEvent");var $Qe=Object.defineProperty,Fo=(e,t)=>$Qe(e,"name",{value:t,configurable:!0}),BD="focusScope.autoFocusOnMount",UD="focusScope.autoFocusOnUnmount",QW={bubbles:!1,cancelable:!0},eve=m.forwardRef(Fo(function(t,n){const{loop:i=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=t,[c,u]=m.useState(null),d=$u(s),f=$u(a),h=m.useRef(null),p=ir(n,u),g=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let v=function(w){if(g.paused||!c)return;const k=w.target;c.contains(k)?h.current=k:jf(h.current,{select:!0})},y=function(w){if(g.paused||!c)return;const k=w.relatedTarget;k!==null&&(c.contains(k)||jf(h.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const S of w)S.removedNodes.length>0&&jf(c)};Fo(v,"handleFocusIn"),Fo(y,"handleFocusOut"),Fo(x,"handleMutations"),document.addEventListener("focusin",v),document.addEventListener("focusout",y);const O=new MutationObserver(x);return c&&O.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),O.disconnect()}}},[r,c,g.paused]),m.useEffect(()=>{if(c){zW.add(g);const v=document.activeElement;if(!c.contains(v)){const x=new CustomEvent(BD,QW);c.addEventListener(BD,d),c.dispatchEvent(x),x.defaultPrevented||(tve(ave(p7(c)),{select:!0}),document.activeElement===v&&jf(c))}return()=>{c.removeEventListener(BD,d),setTimeout(()=>{const x=new CustomEvent(UD,QW);c.addEventListener(UD,f),c.dispatchEvent(x),x.defaultPrevented||jf(v??document.body,{select:!0}),c.removeEventListener(UD,f),zW.remove(g)},0)}}},[c,d,f,g]);const b=m.useCallback(v=>{if(!i&&!r||g.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,x=document.activeElement;if(y&&x){const O=v.currentTarget,[w,k]=nve(O);w&&k?!v.shiftKey&&x===k?(v.preventDefault(),i&&jf(w,{select:!0})):v.shiftKey&&x===w&&(v.preventDefault(),i&&jf(k,{select:!0})):x===O&&v.preventDefault()}},[i,r,g.paused]);return o.jsx(wr.div,{tabIndex:-1,...l,ref:p,onKeyDown:b})},"FocusScope"));function tve(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(jf(i,{select:t}),document.activeElement!==n)return}Fo(tve,"focusFirst");function nve(e){const t=p7(e),n=U4(t,e),i=U4(t.reverse(),e);return[n,i]}Fo(nve,"getTabbableEdges");function p7(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Fo(i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}Fo(p7,"getTabbableCandidates");function U4(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const i of e)if(!(n?!i.checkVisibility({checkVisibilityCSS:!0}):ive(i,{upTo:t})))return i}Fo(U4,"findVisible");function ive(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}Fo(ive,"isHidden");function rve(e){return e instanceof HTMLInputElement&&"select"in e}Fo(rve,"isSelectableInput");function jf(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&rve(e)&&t&&e.select()}}Fo(jf,"focus");var zW=sve();function sve(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Q4(e,t),e.unshift(t)},remove(t){var n;e=Q4(e,t),(n=e[0])==null||n.resume()}}}Fo(sve,"createFocusScopesStack");function Q4(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}Fo(Q4,"arrayRemove");function ave(e){return e.filter(t=>t.tagName!=="A")}Fo(ave,"removeLinks");var FQe=Object.defineProperty,BQe=(e,t)=>FQe(e,"name",{value:t,configurable:!0}),m7=m.forwardRef(BQe(function(t,n){var c;const{container:i,...r}=t,[s,a]=m.useState(!1);Jc(()=>a(!0),[]);const l=i||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return l?Li.createPortal(o.jsx(wr.div,{...r,ref:n}),l):null},"Portal")),UQe=Object.defineProperty,g7=(e,t)=>UQe(e,"name",{value:t,configurable:!0}),iT=0,ad=null;function QQe(e){return uR(),e.children}g7(QQe,"FocusGuards");function uR(){m.useEffect(()=>{ad||(ad={start:z4(),end:z4()});const{start:e,end:t}=ad;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),iT++,()=>{iT===1&&(ad==null||ad.start.remove(),ad==null||ad.end.remove(),ad=null),iT=Math.max(0,iT-1)}},[])}g7(uR,"useFocusGuards");function z4(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}g7(z4,"createFocusGuard");var bd=function(){return bd=Object.assign||function(t){for(var n,i=1,r=arguments.length;i"u")return sze;var t=aze(e),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-n+t[2]-t[0])}},lze=uve(),Zy="data-scroll-locked",cze=function(e,t,n,i){var r=e.left,s=e.top,a=e.right,l=e.gap;return n===void 0&&(n="margin"),` .`.concat(VQe,` { overflow: hidden `).concat(i,`; padding-right: `).concat(l,"px ").concat(i,`; @@ -488,7 +488,7 @@ ${n}`}}async function*fBe({runtimeId:e,region:t,instanceName:n,sessionId:i,follo `)},HW=function(){var e=parseInt(document.body.getAttribute(Zy)||"0",10);return isFinite(e)?e:0},uze=function(){m.useEffect(function(){return document.body.setAttribute(Zy,(HW()+1).toString()),function(){var e=HW()-1;e<=0?document.body.removeAttribute(Zy):document.body.setAttribute(Zy,e.toString())}},[])},dze=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,r=i===void 0?"margin":i;uze();var s=m.useMemo(function(){return oze(r)},[r]);return m.createElement(lze,{styles:cze(s,!t,r,n?"":"!important")})},V4=!1;if(typeof window<"u")try{var rT=Object.defineProperty({},"passive",{get:function(){return V4=!0,!0}});window.addEventListener("test",rT,rT),window.removeEventListener("test",rT,rT)}catch{V4=!1}var j0=V4?{passive:!1}:!1,fze=function(e){return e.tagName==="TEXTAREA"},dve=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!fze(e)&&n[t]==="visible")},hze=function(e){return dve(e,"overflowY")},pze=function(e){return dve(e,"overflowX")},qW=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=fve(e,i);if(r){var s=hve(e,i),a=s[1],l=s[2];if(a>l)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},mze=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},gze=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},fve=function(e,t){return e==="v"?hze(t):pze(t)},hve=function(e,t){return e==="v"?mze(t):gze(t)},bze=function(e,t){return e==="h"&&t==="rtl"?-1:1},yze=function(e,t,n,i,r){var s=bze(e,window.getComputedStyle(t).direction),a=s*i,l=n.target,c=t.contains(l),u=!1,d=a>0,f=0,h=0;do{if(!l)break;var p=hve(e,l),g=p[0],b=p[1],v=p[2],y=b-v-s*g;(g||y)&&fve(e,l)&&(f+=y,h+=g);var x=l.parentNode;l=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&Math.abs(f)<1||!d&&Math.abs(h)<1)&&(u=!0),u},sT=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},WW=function(e){return[e.deltaX,e.deltaY]},GW=function(e){return e&&"current"in e?e.current:e},vze=function(e,t){return e[0]===t[0]&&e[1]===t[1]},xze=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},wze=0,R0=[];function Oze(e){var t=m.useRef([]),n=m.useRef([0,0]),i=m.useRef(),r=m.useState(wze++)[0],s=m.useState(uve)[0],a=m.useRef(e);m.useEffect(function(){a.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var b=zQe([e.lockRef.current],(e.shards||[]).map(GW),!0).filter(Boolean);return b.forEach(function(v){return v.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),b.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var l=m.useCallback(function(b,v){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!a.current.allowPinchZoom;var y=sT(b),x=n.current,O="deltaX"in b?b.deltaX:x[0]-y[0],w="deltaY"in b?b.deltaY:x[1]-y[1],k,S=b.target,E=Math.abs(O)>Math.abs(w)?"h":"v";if("touches"in b&&E==="h"&&S.type==="range")return!1;var C=window.getSelection(),N=C&&C.anchorNode,_=N?N===S||N.contains(S):!1;if(_)return!1;var j=qW(E,S);if(!j)return!0;if(j?k=E:(k=E==="v"?"h":"v",j=qW(E,S)),!j)return!1;if(!i.current&&"changedTouches"in b&&(O||w)&&(i.current=k),!k)return!0;var A=i.current||k;return yze(A,v,b,A==="h"?O:w)},[]),c=m.useCallback(function(b){var v=b;if(!(!R0.length||R0[R0.length-1]!==s)){var y="deltaY"in v?WW(v):sT(v),x=t.current.filter(function(k){return k.name===v.type&&(k.target===v.target||v.target===k.shadowParent)&&vze(k.delta,y)})[0];if(x&&x.should){v.cancelable&&v.preventDefault();return}if(!x){var O=(a.current.shards||[]).map(GW).filter(Boolean).filter(function(k){return k.contains(v.target)}),w=O.length>0?l(v,O[0]):!a.current.noIsolation;w&&v.cancelable&&v.preventDefault()}}},[]),u=m.useCallback(function(b,v,y,x){var O={name:b,delta:v,target:y,should:x,shadowParent:Sze(y)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(w){return w!==O})},1)},[]),d=m.useCallback(function(b){n.current=sT(b),i.current=void 0},[]),f=m.useCallback(function(b){u(b.type,WW(b),b.target,l(b,e.lockRef.current))},[]),h=m.useCallback(function(b){u(b.type,sT(b),b.target,l(b,e.lockRef.current))},[]);m.useEffect(function(){return R0.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,j0),document.addEventListener("touchmove",c,j0),document.addEventListener("touchstart",d,j0),function(){R0=R0.filter(function(b){return b!==s}),document.removeEventListener("wheel",c,j0),document.removeEventListener("touchmove",c,j0),document.removeEventListener("touchstart",d,j0)}},[]);var p=e.removeScrollBar,g=e.inert;return m.createElement(m.Fragment,null,g?m.createElement(s,{styles:xze(r)}):null,p?m.createElement(dze,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Sze(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const kze=ZQe(cve,Oze);var b7=m.forwardRef(function(e,t){return m.createElement(dR,bd({},e,{ref:t,sideCar:kze}))});b7.classNames=dR.classNames;var Eze=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},I0=new WeakMap,aT=new WeakMap,oT={},HD=0,pve=function(e){return e&&(e.host||pve(e.parentNode))},Cze=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=pve(n);return i&&e.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Tze=function(e,t,n,i){var r=Cze(t,Array.isArray(e)?e:[e]);oT[n]||(oT[n]=new WeakMap);var s=oT[n],a=[],l=new Set,c=new Set(r),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};r.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(l.has(h))d(h);else try{var p=h.getAttribute(i),g=p!==null&&p!=="false",b=(I0.get(h)||0)+1,v=(s.get(h)||0)+1;I0.set(h,b),s.set(h,v),a.push(h),b===1&&g&&aT.set(h,!0),v===1&&h.setAttribute(n,"true"),g||h.setAttribute(i,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return d(t),l.clear(),HD++,function(){a.forEach(function(f){var h=I0.get(f)-1,p=s.get(f)-1;I0.set(f,h),s.set(f,p),h||(aT.has(f)||f.removeAttribute(i),aT.delete(f)),p||f.removeAttribute(n)}),HD--,HD||(I0=new WeakMap,I0=new WeakMap,aT=new WeakMap,oT={})}},mve=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),r=Eze(e);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live], script"))),Tze(i,r,n,"aria-hidden")):function(){return null}},Aze=Object.defineProperty,_ze=(e,t)=>Aze(e,"name",{value:t,configurable:!0});function Gk(e){const[t,n]=m.useState(void 0);return Jc(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let a,l;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;a=u.inlineSize,l=u.blockSize}else a=e.offsetWidth,l=e.offsetHeight;n({width:a,height:l})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else n(void 0)},[e]),t}_ze(Gk,"useSize");var Nze=Object.defineProperty,kh=(e,t)=>Nze(e,"name",{value:t,configurable:!0}),y7="Checkbox",[jze,XVt]=kl(y7),[Rze,v7]=jze(y7);function gve(e){const{__scopeCheckbox:t,checked:n,children:i,defaultChecked:r,disabled:s,form:a,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,p]=su({prop:n,defaultProp:r??!1,onChange:c,caller:y7}),[g,b]=m.useState(null),[v,y]=m.useState(null),x=m.useRef(!1),[O,w]=m.useReducer(E=>E+1,0),k=g?!!a||!!g.closest("form"):!0,S={checked:h,disabled:s,setChecked:p,control:g,setControl:b,name:l,form:a,value:d,hasConsumerStoppedPropagationRef:x,userInteractionCount:O,onUserInteraction:w,required:u,defaultChecked:rh(r)?!1:r,isFormControl:k,bubbleInput:v,setBubbleInput:y};return o.jsx(Rze,{scope:t,...S,children:bve(f)?f(S):i})}kh(gve,"CheckboxProvider");var Ize="CheckboxTrigger",Pze=m.forwardRef(kh(function({__scopeCheckbox:t,onKeyDown:n,onClick:i,...r},s){const{control:a,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:p,onUserInteraction:g,isFormControl:b,bubbleInput:v}=v7(Ize,t),y=ir(s,f),x=m.useRef(u);return m.useEffect(()=>{const O=a==null?void 0:a.form;if(O){const w=kh(()=>h(x.current),"reset");return O.addEventListener("reset",w),()=>O.removeEventListener("reset",w)}},[a,h]),o.jsx(wr.button,{type:"button",role:"checkbox","aria-checked":rh(u)?"mixed":u,"aria-required":d,"data-state":x7(u),"data-disabled":c?"":void 0,disabled:c,value:l,...r,ref:y,onKeyDown:yn(n,O=>{O.key==="Enter"&&O.preventDefault()}),onClick:yn(i,O=>{g(),h(w=>rh(w)?!0:!w),v&&b&&(p.current=O.isPropagationStopped(),p.current||O.stopPropagation())})})},"CheckboxTrigger")),Dze=m.forwardRef(kh(function(t,n){const{__scopeCheckbox:i,name:r,checked:s,defaultChecked:a,required:l,disabled:c,value:u,onCheckedChange:d,form:f,...h}=t;return o.jsx(gve,{__scopeCheckbox:i,checked:s,defaultChecked:a,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:p})=>o.jsxs(o.Fragment,{children:[o.jsx(Pze,{...h,ref:n,__scopeCheckbox:i}),p&&o.jsx(Fze,{__scopeCheckbox:i})]})})},"Checkbox")),Mze="CheckboxIndicator",Lze=m.forwardRef(kh(function(t,n){const{__scopeCheckbox:i,forceMount:r,...s}=t,a=v7(Mze,i);return o.jsx(Gd,{present:r||rh(a.checked)||a.checked===!0,children:o.jsx(wr.span,{"data-state":x7(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...t.style}})})},"CheckboxIndicator")),$ze="CheckboxBubbleInput",Fze=m.forwardRef(kh(function({__scopeCheckbox:t,onClick:n,...i},r){const{control:s,hasConsumerStoppedPropagationRef:a,userInteractionCount:l,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:p,form:g,bubbleInput:b,setBubbleInput:v}=v7($ze,t),y=ir(r,v),x=Gk(s),O=m.useRef(!1),w=m.useRef(c),k=m.useRef(l);m.useEffect(()=>{const E=b;if(!E)return;const C=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(C,"checked").set,j=l!==k.current;k.current=l;const A=w.current!==c;w.current=c;const F=!(j&&a.current);if(A&&_){O.current=!j;const T=new Event("click",{bubbles:F});E.indeterminate=rh(c),_.call(E,rh(c)?!1:c),E.dispatchEvent(T),O.current=!1}},[b,c,a,l]);const S=m.useRef(rh(c)?!1:c);return o.jsx(wr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??S.current,required:d,disabled:f,name:h,value:p,form:g,...i,tabIndex:-1,ref:y,onClick:yn(n,E=>{O.current&&E.stopPropagation()}),style:{...i.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function bve(e){return typeof e=="function"}kh(bve,"isFunction");function rh(e){return e==="indeterminate"}kh(rh,"isIndeterminate");function x7(e){return rh(e)?"indeterminate":e?"checked":"unchecked"}kh(x7,"getState");const Bze=["top","right","bottom","left"],gm=Math.min,sh=Math.max,B_=Math.round,lT=Math.floor,ah=e=>({x:e,y:e}),Uze={left:"right",right:"left",bottom:"top",top:"bottom"};function yve(e,t,n){return sh(e,gm(t,n))}function Eh(e,t){return typeof e=="function"?e(t):e}function bm(e){return e.split("-")[0]}function jx(e){return e.split("-")[1]}function w7(e){return e==="x"?"y":"x"}function O7(e){return e==="y"?"height":"width"}function Ed(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function S7(e){return w7(Ed(e))}function Qze(e,t,n){n===void 0&&(n=!1);const i=jx(e),r=S7(e),s=O7(r);let a=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=U_(a)),[a,U_(a)]}function zze(e){const t=U_(e);return[H4(e),t,H4(t)]}function H4(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const KW=["left","right"],XW=["right","left"],Vze=["top","bottom"],Hze=["bottom","top"];function qze(e,t,n){switch(e){case"top":case"bottom":return n?t?XW:KW:t?KW:XW;case"left":case"right":return t?Vze:Hze;default:return[]}}function Wze(e,t,n,i){const r=jx(e);let s=qze(bm(e),n==="start",i);return r&&(s=s.map(a=>a+"-"+r),t&&(s=s.concat(s.map(H4)))),s}function U_(e){const t=bm(e);return Uze[t]+e.slice(t.length)}function Gze(e){var t,n,i,r;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(i=e.bottom)!=null?i:0,left:(r=e.left)!=null?r:0}}function vve(e){return typeof e!="number"?Gze(e):{top:e,right:e,bottom:e,left:e}}function Q_(e){const{x:t,y:n,width:i,height:r}=e;return{width:i,height:r,top:n,left:t,right:t+i,bottom:n+r,x:t,y:n}}function YW(e,t,n){let{reference:i,floating:r}=e;const s=Ed(t),a=S7(t),l=O7(a),c=bm(t),u=s==="y",d=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,h=i[l]/2-r[l]/2;let p;switch(c){case"top":p={x:d,y:i.y-r.height};break;case"bottom":p={x:d,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:f};break;case"left":p={x:i.x-r.width,y:f};break;default:p={x:i.x,y:i.y}}const g=jx(t);return g&&(p[a]+=h*(g==="end"?1:-1)*(n&&u?-1:1)),p}async function Kze(e,t){var n;t===void 0&&(t={});const{x:i,y:r,platform:s,rects:a,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=Eh(t,e),g=vve(p),v=l[h?f==="floating"?"reference":"floating":f],y=Q_(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),x=f==="floating"?{x:i,y:r,width:a.floating.width,height:a.floating.height}:a.reference,O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),w=await(s.isElement==null?void 0:s.isElement(O))&&await(s.getScale==null?void 0:s.getScale(O))||{x:1,y:1},k=Q_(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:O,strategy:c}):x);return{top:(y.top-k.top+g.top)/w.y,bottom:(k.bottom-y.bottom+g.bottom)/w.y,left:(y.left-k.left+g.left)/w.x,right:(k.right-y.right+g.right)/w.x}}const Xze=50,Yze=async(e,t,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:a}=n,l=a.detectOverflow?a:{...a,detectOverflow:Kze},c=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:f}=YW(u,i,c),h=i,p=0;const g={};for(let b=0;b({name:"arrow",options:e,async fn(t){const{x:n,y:i,placement:r,rects:s,platform:a,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=Eh(e,t)||{};if(u==null)return{};const f=vve(d),h={x:n,y:i},p=S7(r),g=O7(p),b=await a.getDimensions(u),v=p==="y",y=v?"top":"left",x=v?"bottom":"right",O=v?"clientHeight":"clientWidth",w=s.reference[g]+s.reference[p]-h[p]-s.floating[g],k=h[p]-s.reference[p],S=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let E=S?S[O]:0;(!E||!await(a.isElement==null?void 0:a.isElement(S)))&&(E=l.floating[O]||s.floating[g]);const C=w/2-k/2,N=E/2-b[g]/2-1,_=gm(f[y],N),j=gm(f[x],N),A=E-b[g]-j,F=E/2-b[g]/2+C,T=yve(_,F,A),P=!c.arrow&&jx(r)!=null&&F!==T&&s.reference[g]/2-(F<_?_:j)-b[g]/2<0,R=P?F<_?F-_:F-A:0;return{[p]:h[p]+R,data:{[p]:T,centerOffset:F-T-R,...P&&{alignmentOffset:R}},reset:P}}}),Jze=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,i;const{placement:r,middlewareData:s,rects:a,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:b=!0,...v}=Eh(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=bm(r),x=Ed(l),O=bm(l)===l,w=await(c.isRTL==null?void 0:c.isRTL(u.floating)),k=h||(O||!b?[U_(l)]:zze(l)),S=g!=="none";!h&&S&&k.push(...Wze(l,b,g,w));const E=[l,...k],C=await c.detectOverflow(t,v),N=[];let _=((i=s.flip)==null?void 0:i.overflows)||[];if(d&&N.push(C[y]),f){const T=Qze(r,a,w);N.push(C[T[0]],C[T[1]])}if(_=[..._,{placement:r,overflows:N}],!N.every(T=>T<=0)){var j,A;const T=(((j=s.flip)==null?void 0:j.index)||0)+1,P=E[T];if(P&&(!(f==="alignment"?x!==Ed(P):!1)||_.every(M=>Ed(M.placement)===x?M.overflows[0]>0:!0)))return{data:{index:T,overflows:_},reset:{placement:P}};let R=(A=_.filter(L=>L.overflows[0]<=0).sort((L,M)=>L.overflows[1]-M.overflows[1])[0])==null?void 0:A.placement;if(!R)switch(p){case"bestFit":{var F;const L=(F=_.filter(M=>{if(S){const U=Ed(M.placement);return U===x||U==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(U=>U>0).reduce((U,I)=>U+I,0)]).sort((M,U)=>M[1]-U[1])[0])==null?void 0:F[0];L&&(R=L);break}case"initialPlacement":R=l;break}if(r!==R)return{reset:{placement:R}}}return{}}}};function ZW(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function JW(e){return Bze.some(t=>e[t]>=0)}const eVe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:i}=t,{strategy:r="referenceHidden",...s}=Eh(e,t);switch(r){case"referenceHidden":{const a=await i.detectOverflow(t,{...s,elementContext:"reference"}),l=ZW(a,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:JW(l)}}}case"escaped":{const a=await i.detectOverflow(t,{...s,altBoundary:!0}),l=ZW(a,n.floating);return{data:{escapedOffsets:l,escaped:JW(l)}}}default:return{}}}}},xve=new Set(["left","top"]);async function tVe(e,t){const{placement:n,platform:i,elements:r}=e,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),a=bm(n),l=jx(n),c=Ed(n)==="y",u=xve.has(a)?-1:1,d=s&&c?-1:1,f=Eh(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(p=l==="end"?g*-1:g),c?{x:p*d,y:h*u}:{x:h*u,y:p*d}}const nVe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:r,y:s,placement:a,middlewareData:l}=t,c=await tVe(t,e);return a===((n=l.offset)==null?void 0:n.placement)&&(i=l.arrow)!=null&&i.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:a}}}}},iVe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:r,platform:s}=t,{mainAxis:a=!0,crossAxis:l=!1,limiter:c={fn:x=>{let{x:O,y:w}=x;return{x:O,y:w}}},...u}=Eh(e,t),d={x:n,y:i},f=await s.detectOverflow(t,u),h=Ed(r),p=w7(h);let g=d[p],b=d[h];const v=(x,O)=>yve(O+f[x==="y"?"top":"left"],O,O-f[x==="y"?"bottom":"right"]);a&&(g=v(p,g)),l&&(b=v(h,b));const y=c.fn({...t,[p]:g,[h]:b});return{...y,data:{x:y.x-n,y:y.y-i,enabled:{[p]:a,[h]:l}}}}}},rVe=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,i;const{x:r,y:s,placement:a,rects:l,middlewareData:c}=t,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=Eh(e,t),h={x:r,y:s},p=Ed(a),g=w7(p);let b=h[g],v=h[p];const y=Eh(u,t),x=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:(n=y.mainAxis)!=null?n:0,crossAxis:(i=y.crossAxis)!=null?i:0};if(d){const k=g==="y"?"height":"width",S=l.reference[g]-l.floating[k]+x.mainAxis,E=l.reference[g]+l.reference[k]-x.mainAxis;bE&&(b=E)}if(f){var O,w;const k=g==="y"?"width":"height",S=xve.has(bm(a)),E=l.reference[p]-l.floating[k]+(S&&((O=c.offset)==null?void 0:O[p])||0)+(S?0:x.crossAxis),C=l.reference[p]+l.reference[k]+(S?0:((w=c.offset)==null?void 0:w[p])||0)-(S?x.crossAxis:0);vC&&(v=C)}return{[g]:b,[p]:v}}}},sVe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:i,platform:r,elements:s}=t,{apply:a=()=>{},...l}=Eh(e,t),c=await r.detectOverflow(t,l),u=bm(n),d=jx(n),f=Ed(n)==="y",{width:h,height:p}=i.floating;let g,b;u==="top"||u==="bottom"?(g=u,b=d===(await(r.isRTL==null?void 0:r.isRTL(s.floating))?"start":"end")?"left":"right"):(b=u,g=d==="end"?"top":"bottom");const v=p-c.top-c.bottom,y=h-c.left-c.right,x=gm(p-c[g],v),O=gm(h-c[b],y),w=t.middlewareData.shift,k=!w;let S=x,E=O;w!=null&&w.enabled.x&&(E=y),w!=null&&w.enabled.y&&(S=v),k&&!d&&(f?E=h-2*sh(c.left,c.right):S=p-2*sh(c.top,c.bottom)),await a({...t,availableWidth:E,availableHeight:S});const C=await r.getDimensions(s.floating);return h!==C.width||p!==C.height?{reset:{rects:!0}}:{}}}};function fR(){return typeof window<"u"}function Rx(e){return wve(e)?(e.nodeName||"").toLowerCase():"#document"}function bo(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function $h(e){var t;return(t=(wve(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function wve(e){return fR()?e instanceof Node||e instanceof bo(e).Node:!1}function Fd(e){return fR()?e instanceof Element||e instanceof bo(e).Element:!1}function Kd(e){return fR()?e instanceof HTMLElement||e instanceof bo(e).HTMLElement:!1}function eG(e){return!fR()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof bo(e).ShadowRoot}function hR(e){const{overflow:t,overflowX:n,overflowY:i,display:r}=Bd(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&r!=="inline"&&r!=="contents"}function aVe(e){return/^(table|td|th)$/.test(Rx(e))}function pR(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const oVe=/transform|translate|scale|rotate|perspective|filter/,lVe=/paint|layout|strict|content/,tg=e=>!!e&&e!=="none";let qD;function k7(e){const t=Fd(e)?Bd(e):e;return tg(t.transform)||tg(t.translate)||tg(t.scale)||tg(t.rotate)||tg(t.perspective)||!E7()&&(tg(t.backdropFilter)||tg(t.filter))||oVe.test(t.willChange||"")||lVe.test(t.contain||"")}function cVe(e){let t=yb(e);for(;Kd(t)&&!xS(t);){if(k7(t))return t;if(pR(t))return null;t=yb(t)}return null}function E7(){return qD==null&&(qD=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),qD}function xS(e){return/^(html|body|#document)$/.test(Rx(e))}function Bd(e){return bo(e).getComputedStyle(e)}function mR(e){return Fd(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function yb(e){if(Rx(e)==="html")return e;const t=e.assignedSlot||e.parentNode||eG(e)&&e.host||$h(e);return eG(t)?t.host:t}function Ove(e){const t=yb(e);return xS(t)?(e.ownerDocument||e).body:Kd(t)&&hR(t)?t:Ove(t)}function wS(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Ove(e),s=r===((i=e.ownerDocument)==null?void 0:i.body),a=bo(r);if(s){const l=q4(a);return t.concat(a,a.visualViewport||[],hR(r)?r:[],l&&n?wS(l):[])}else return t.concat(r,wS(r,[],n))}function q4(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Sve(e){const t=Bd(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=Kd(e),s=r?e.offsetWidth:n,a=r?e.offsetHeight:i,l=B_(n)!==s||B_(i)!==a;return l&&(n=s,i=a),{width:n,height:i,$:l}}function C7(e){return Fd(e)?e:e.contextElement}function Jy(e){const t=C7(e);if(!Kd(t))return ah(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:s}=Sve(t);let a=(s?B_(n.width):n.width)/i,l=(s?B_(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const uVe=ah(0);function kve(e){const t=bo(e);return!E7()||!t.visualViewport?uVe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dVe(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===bo(e)}function vb(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=C7(e);let a=ah(1);t&&(i?Fd(i)&&(a=Jy(i)):a=Jy(e));const l=dVe(s,n,i)?kve(s):ah(0);let c=(r.left+l.x)/a.x,u=(r.top+l.y)/a.y,d=r.width/a.x,f=r.height/a.y;if(s&&i){const h=bo(s),p=Fd(i)?bo(i):i;let g=h,b=q4(g);for(;b&&p!==g;){const v=Jy(b),y=b.getBoundingClientRect(),x=Bd(b),O=y.left+(b.clientLeft+parseFloat(x.paddingLeft))*v.x,w=y.top+(b.clientTop+parseFloat(x.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,f*=v.y,c+=O,u+=w,g=bo(b),b=q4(g)}}return Q_({width:d,height:f,x:c,y:u})}function gR(e,t){const n=mR(e).scrollLeft;return t?t.left+n:vb($h(e)).left+n}function Eve(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-gR(e,n),r=n.top+t.scrollTop;return{x:i,y:r}}function fVe(e){let{elements:t,rect:n,offsetParent:i,strategy:r}=e;const s=r==="fixed",a=$h(i),l=t?pR(t.floating):!1;if(i===a||l&&s)return n;let c={scrollLeft:0,scrollTop:0},u=ah(1);const d=ah(0),f=Kd(i);if((f||!s)&&((Rx(i)!=="body"||hR(a))&&(c=mR(i)),f)){const p=vb(i);u=Jy(i),d.x=p.x+i.clientLeft,d.y=p.y+i.clientTop}const h=a&&!f&&!s?Eve(a,c):ah(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-c.scrollTop*u.y+d.y+h.y}}function hVe(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function pVe(e){const t=mR(e),n=e.ownerDocument.body,i=sh(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=sh(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+gR(e);const a=-t.scrollTop;return Bd(n).direction==="rtl"&&(s+=sh(e.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:a}}const mVe=25;function gVe(e,t,n){n===void 0&&(n="viewport");const i=n==="layoutViewport",r=bo(e),s=$h(e),a=r.visualViewport;let l=s.clientWidth,c=s.clientHeight,u=0,d=0;if(a){const h=!E7()||t==="fixed";i?h||(u=-a.offsetLeft,d=-a.offsetTop):(l=a.width,c=a.height,h&&(u=a.offsetLeft,d=a.offsetTop))}if(gR(s)<=0){const h=s.ownerDocument,p=h.body,g=getComputedStyle(p),b=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,v=Math.abs(s.clientWidth-p.clientWidth-b),y=getComputedStyle(s).scrollbarGutter==="stable both-edges"?v/2:v;y<=mVe&&(l-=y)}return{width:l,height:c,x:u,y:d}}function bVe(e,t){const n=vb(e,!0,t==="fixed"),i=n.top+e.clientTop,r=n.left+e.clientLeft,s=Jy(e),a=e.clientWidth*s.x,l=e.clientHeight*s.y,c=r*s.x,u=i*s.y;return{width:a,height:l,x:c,y:u}}function tG(e,t,n){let i;if(t==="viewport"||t==="layoutViewport")i=gVe(e,n,t);else if(t==="document")i=pVe($h(e));else if(Fd(t))i=bVe(t,n);else{const r=kve(e);i={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Q_(i)}function yVe(e,t){const n=t.get(e);if(n)return n;let i=wS(e,[],!1).filter(l=>Fd(l)&&Rx(l)!=="body"),r=null;const s=Bd(e).position==="fixed";let a=s?yb(e):e;for(;Fd(a)&&!xS(a);){const l=Bd(a),c=k7(a),u=r?r.position:s?"fixed":"";!c&&(u==="fixed"||u==="absolute"&&l.position==="static")?i=i.filter(f=>f!==a):r=l,a=yb(a)}return t.set(e,i),i}function vVe(e){let{element:t,boundary:n,rootBoundary:i,strategy:r}=e;const a=[...n==="clippingAncestors"?pR(t)?[]:yVe(t,this._c):[].concat(n),i],l=tG(t,a[0],r);let c=l.top,u=l.right,d=l.bottom,f=l.left;for(let h=1;h{l(!1,1e-7)},1e3)}E=!1}try{i=new IntersectionObserver(C,{...S,root:s.ownerDocument})}catch{i=new IntersectionObserver(C,S)}i.observe(e)}const c=bo(e),u=()=>l(n);return c.addEventListener("resize",u),l(!0),()=>{c.removeEventListener("resize",u),a()}}function CVe(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=i,u=C7(e),d=r||s?[...u?wS(u):[],...t?wS(t):[]]:[];d.forEach(y=>{r&&y.addEventListener("scroll",n),s&&y.addEventListener("resize",n)});const f=u&&l?EVe(u,n,s):null;let h=-1,p=null;a&&(p=new ResizeObserver(y=>{let[x]=y;x&&x.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var O;(O=p)==null||O.observe(t)})),n()}),u&&!c&&p.observe(u),t&&p.observe(t));let g,b=c?vb(e):null;c&&v();function v(){const y=vb(e);b&&!Tve(b,y)&&n(),b=y,g=requestAnimationFrame(v)}return n(),()=>{var y;d.forEach(x=>{r&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),f==null||f(),(y=p)==null||y.disconnect(),p=null,c&&cancelAnimationFrame(g)}}const TVe=nVe,AVe=iVe,_Ve=Jze,NVe=sVe,jVe=eVe,iG=Zze,RVe=rVe,IVe=(e,t,n)=>{const i=new Map,r=n??{},s={...kVe,...r.platform,_c:i};return Yze(e,t,{...r,platform:s})};var PVe=typeof document<"u",DVe=function(){},lA=PVe?m.useLayoutEffect:DVe;function z_(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,i,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(i=n;i--!==0;)if(!z_(e[i],t[i]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const s=r[i];if(!(s==="_owner"&&e.$$typeof)&&!z_(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ave(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rG(e,t){const n=Ave(e);return Math.round(t*n)/n}function GD(e){const t=m.useRef(e);return lA(()=>{t.current=e}),t}function MVe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:s,floating:a}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=m.useState(i);z_(h,i)||p(i);const[g,b]=m.useState(null),[v,y]=m.useState(null),x=m.useCallback(M=>{M!==S.current&&(S.current=M,b(M))},[]),O=m.useCallback(M=>{M!==E.current&&(E.current=M,y(M))},[]),w=s||g,k=a||v,S=m.useRef(null),E=m.useRef(null),C=m.useRef(d),N=c!=null,_=GD(c),j=GD(r),A=GD(u),F=m.useCallback(()=>{if(!S.current||!E.current)return;const M={placement:t,strategy:n,middleware:h};j.current&&(M.platform=j.current),IVe(S.current,E.current,M).then(U=>{const I={...U,isPositioned:A.current!==!1};T.current&&!z_(C.current,I)&&(C.current=I,Li.flushSync(()=>{f(I)}))})},[h,t,n,j,A]);lA(()=>{u===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,f(M=>({...M,isPositioned:!1})))},[u]);const T=m.useRef(!1);lA(()=>(T.current=!0,()=>{T.current=!1}),[]),lA(()=>{if(w&&(S.current=w),k&&(E.current=k),w&&k){if(_.current)return _.current(w,k,F);F()}},[w,k,F,_,N]);const P=m.useMemo(()=>({reference:S,floating:E,setReference:x,setFloating:O}),[x,O]),R=m.useMemo(()=>({reference:w,floating:k}),[w,k]),L=m.useMemo(()=>{const M={position:n,left:0,top:0};if(!R.floating)return M;const U=rG(R.floating,d.x),I=rG(R.floating,d.y);return l?{...M,transform:"translate("+U+"px, "+I+"px)",...Ave(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:U,top:I}},[n,l,R.floating,d.x,d.y]);return m.useMemo(()=>({...d,update:F,refs:P,elements:R,floatingStyles:L}),[d,F,P,R,L])}const LVe=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:i,padding:r}=typeof e=="function"?e(n):e;return i&&t(i)?i.current!=null?iG({element:i.current,padding:r}).fn(n):{}:i?iG({element:i,padding:r}).fn(n):{}}}},$Ve=(e,t)=>{const n=TVe(e);return{name:n.name,fn:n.fn,options:[e,t]}},FVe=(e,t)=>{const n=AVe(e);return{name:n.name,fn:n.fn,options:[e,t]}},BVe=(e,t)=>({fn:RVe(e).fn,options:[e,t]}),UVe=(e,t)=>{const n=_Ve(e);return{name:n.name,fn:n.fn,options:[e,t]}},QVe=(e,t)=>{const n=NVe(e);return{name:n.name,fn:n.fn,options:[e,t]}},zVe=(e,t)=>{const n=jVe(e);return{name:n.name,fn:n.fn,options:[e,t]}},VVe=(e,t)=>{const n=LVe(e);return{name:n.name,fn:n.fn,options:[e,t]}};var HVe=Object.defineProperty,em=(e,t)=>HVe(e,"name",{value:t,configurable:!0}),_ve="Popper",[Nve,Ix]=kl(_ve),[qVe,jve]=Nve(_ve),WVe=em(e=>{const{__scopePopper:t,children:n}=e,[i,r]=m.useState(null),[s,a]=m.useState(void 0);return o.jsx(qVe,{scope:t,anchor:i,onAnchorChange:r,placementState:s,setPlacementState:a,children:n})},"Popper"),GVe="PopperAnchor",KVe=m.forwardRef(em(function(t,n){const{__scopePopper:i,virtualRef:r,...s}=t,a=jve(GVe,i),l=m.useRef(null),c=a.onAnchorChange,u=m.useCallback(b=>{l.current=b,b&&c(b)},[c]),d=ir(n,u),f=m.useRef(null);m.useEffect(()=>{if(!r)return;const b=f.current;f.current=r.current,b!==f.current&&c(f.current)});const h=a.placementState&&bR(a.placementState),p=h==null?void 0:h[0],g=h==null?void 0:h[1];return r?null:o.jsx(wr.div,{"data-radix-popper-side":p,"data-radix-popper-align":g,...s,ref:d})},"PopperAnchor")),Rve="PopperContent",[XVe,YVt]=Nve(Rve),YVe=m.forwardRef(em(function(t,n){var re,ge,W,X,ae,ue,Oe;const{__scopePopper:i,side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:p=!1,updatePositionStrategy:g="optimized",onPlaced:b,...v}=t,y=jve(Rve,i),[x,O]=m.useState(null),w=ir(n,O),[k,S]=m.useState(null),E=Gk(k),C=(E==null?void 0:E.width)??0,N=(E==null?void 0:E.height)??0,_=r+(a!=="center"?"-"+a:""),j=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},A=Array.isArray(d)?d:[d],F=A.length>0,T={padding:j,boundary:A.filter(Ive),altBoundary:F},{refs:P,floatingStyles:R,placement:L,isPositioned:M,middlewareData:U}=MVe({strategy:"fixed",placement:_,whileElementsMounted:em((...Se)=>CVe(...Se,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:y.anchor},middleware:[$Ve({mainAxis:s+N,alignmentAxis:l}),u&&FVe({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?BVe():void 0,...T}),u&&UVe({...T}),QVe({...T,apply:em(({elements:Se,rects:lt,availableWidth:$e,availableHeight:Le})=>{const{width:Ne,height:qe}=lt.reference,Re=Se.floating.style;Re.setProperty("--radix-popper-available-width",`${$e}px`),Re.setProperty("--radix-popper-available-height",`${Le}px`),Re.setProperty("--radix-popper-anchor-width",`${Ne}px`),Re.setProperty("--radix-popper-anchor-height",`${qe}px`)},"apply")}),k&&VVe({element:k,padding:c}),ZVe({arrowWidth:C,arrowHeight:N}),p&&zVe({strategy:"referenceHidden",...T,boundary:F?T.boundary:void 0})]}),I=y.setPlacementState;Jc(()=>(I(L),()=>{I(void 0)}),[L,I]);const[H,K]=bR(L),Q=$u(b);Jc(()=>{M&&(Q==null||Q())},[M,Q]);const q=(re=U.arrow)==null?void 0:re.x,B=(ge=U.arrow)==null?void 0:ge.y,ee=((W=U.arrow)==null?void 0:W.centerOffset)!==0,[le,se]=m.useState();return Jc(()=>{x&&se(window.getComputedStyle(x).zIndex)},[x]),o.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:M?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:le,"--radix-popper-transform-origin":[(X=U.transformOrigin)==null?void 0:X.x,(ae=U.transformOrigin)==null?void 0:ae.y].join(" "),...((ue=U.hide)==null?void 0:ue.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:o.jsx(XVe,{scope:i,placedSide:H,placedAlign:K,onArrowChange:S,arrowX:q,arrowY:B,shouldHideArrow:ee,children:o.jsx(wr.div,{"data-side":H,"data-align":K,...v,ref:w,style:{...v.style,animation:M?(Oe=v.style)==null?void 0:Oe.animation:"none"}})})})},"PopperContent"));function Ive(e){return e!==null}em(Ive,"isNotNull");var ZVe=em(e=>({name:"transformOrigin",options:e,fn(t){var v,y,x;const{placement:n,rects:i,middlewareData:r}=t,a=((v=r.arrow)==null?void 0:v.centerOffset)!==0,l=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[u,d]=bR(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((y=r.arrow)==null?void 0:y.x)??0)+l/2,p=(((x=r.arrow)==null?void 0:x.y)??0)+c/2;let g="",b="";return u==="bottom"?(g=a?f:`${h}px`,b=`${-c}px`):u==="top"?(g=a?f:`${h}px`,b=`${i.floating.height+c}px`):u==="right"?(g=`${-c}px`,b=a?f:`${p}px`):u==="left"&&(g=`${i.floating.width+c}px`,b=a?f:`${p}px`),{data:{x:g,y:b}}}}),"transformOrigin");function bR(e){const[t,n="center"]=e.split("-");return[t,n]}em(bR,"getSideAndAlignFromPlacement");var yR=WVe,T7=KVe,A7=YVe,JVe=Object.defineProperty,_7=(e,t)=>JVe(e,"name",{value:t,configurable:!0}),KD=!1;function Pve(){const[e,t]=m.useState(KD);return m.useEffect(()=>{KD||(KD=!0,t(!0))},[]),e}_7(Pve,"useIsHydrated");var Dve=Fb[" useSyncExternalStore ".trim().toString()];function Mve(){return()=>{}}_7(Mve,"subscribe");function Lve(){return Dve(Mve,()=>!0,()=>!1)}_7(Lve,"useIsHydratedModern");var eHe=typeof Dve=="function"?Lve:Pve,tHe=Object.defineProperty,Gb=(e,t)=>tHe(e,"name",{value:t,configurable:!0}),XD="rovingFocusGroup.onEntryFocus",nHe={bubbles:!1,cancelable:!0},vR="RovingFocusGroup",[W4,$ve,iHe]=u7(vR),[rHe,Px]=kl(vR,[iHe]),[sHe,aHe]=rHe(vR),oHe=m.forwardRef(Gb(function(t,n){return o.jsx(W4.Provider,{scope:t.__scopeRovingFocusGroup,children:o.jsx(W4.Slot,{scope:t.__scopeRovingFocusGroup,children:o.jsx(lHe,{...t,ref:n})})})},"RovingFocusGroup")),lHe=m.forwardRef(Gb(function(t,n){const{__scopeRovingFocusGroup:i,orientation:r,loop:s=!1,dir:a,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...h}=t,p=m.useRef(null),g=ir(n,p),b=Wk(a),[v,y]=su({prop:l,defaultProp:c??null,onChange:u,caller:vR}),[x,O]=m.useState(!1),w=$u(d),k=$ve(i),S=m.useRef(!1),[E,C]=m.useState(0);return m.useEffect(()=>{const N=p.current;if(N)return N.addEventListener(XD,w),()=>N.removeEventListener(XD,w)},[w]),o.jsx(sHe,{scope:i,orientation:r,dir:b,loop:s,currentTabStopId:v,onItemFocus:m.useCallback(N=>y(N),[y]),onItemShiftTab:m.useCallback(()=>O(!0),[]),onFocusableItemAdd:m.useCallback(()=>C(N=>N+1),[]),onFocusableItemRemove:m.useCallback(()=>C(N=>N-1),[]),children:o.jsx(wr.div,{tabIndex:x||E===0?-1:0,"data-orientation":r,...h,ref:g,style:{outline:"none",...t.style},onMouseDown:yn(t.onMouseDown,()=>{S.current=!0}),onFocus:yn(t.onFocus,N=>{const _=!S.current;if(N.target===N.currentTarget&&_&&!x){const j=new CustomEvent(XD,nHe);if(N.currentTarget.dispatchEvent(j),!j.defaultPrevented){const A=k().filter(L=>L.focusable),F=A.find(L=>L.active),T=A.find(L=>L.id===v),R=[F,T,...A].filter(Boolean).map(L=>L.ref.current);N7(R,f)}}S.current=!1}),onBlur:yn(t.onBlur,()=>O(!1))})})},"RovingFocusGroupImpl")),cHe="RovingFocusGroupItem",uHe=m.forwardRef(Gb(function(t,n){const{__scopeRovingFocusGroup:i,focusable:r=!0,active:s=!1,tabStopId:a,children:l,...c}=t,u=mm(),d=a||u,f=aHe(cHe,i),h=f.currentTabStopId===d,p=$ve(i),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:v}=f,y=eHe();return Jc(()=>{if(!(!y||!r))return g(),()=>b()},[y,r,g,b]),m.useEffect(()=>{if(!(y||!r))return g(),()=>b()},[y,r,g,b]),o.jsx(W4.ItemSlot,{scope:i,id:d,focusable:r,active:s,children:o.jsx(wr.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:yn(t.onMouseDown,x=>{r?f.onItemFocus(d):x.preventDefault()}),onFocus:yn(t.onFocus,()=>f.onItemFocus(d)),onKeyDown:yn(t.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){f.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const O=Bve(x,f.orientation,f.dir);if(O!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let k=p().filter(S=>S.focusable).map(S=>S.ref.current);if(O==="last")k.reverse();else if(O==="prev"||O==="next"){O==="prev"&&k.reverse();const S=k.indexOf(x.currentTarget);k=f.loop?Uve(k,S+1):k.slice(S+1)}setTimeout(()=>N7(k))}}),children:typeof l=="function"?l({isCurrentTabStop:h,hasTabStop:v!=null}):l})})},"RovingFocusGroupItem")),dHe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Fve(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Gb(Fve,"getDirectionAwareKey");function Bve(e,t,n){const i=Fve(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return dHe[i]}Gb(Bve,"getFocusIntent");function N7(e,t=!1){const n=document.activeElement;for(const i of e)if(i===n||(i.focus({preventScroll:t}),document.activeElement!==n))return}Gb(N7,"focusFirst");function Uve(e,t){return e.map((n,i)=>e[(t+i)%e.length])}Gb(Uve,"wrapArray");var j7=oHe,R7=uHe,fHe=Object.defineProperty,Qi=(e,t)=>fHe(e,"name",{value:t,configurable:!0}),G4=["Enter"," "],hHe=["ArrowDown","PageUp","Home"],Qve=["ArrowUp","PageDown","End"],pHe=[...hHe,...Qve],mHe={ltr:[...G4,"ArrowRight"],rtl:[...G4,"ArrowLeft"]},gHe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},xR="Menu",[OS,bHe,yHe]=u7(xR),[Kb,zve]=kl(xR,[yHe,Ix,Px]),wR=Ix(),Vve=Px(),[Hve,$m]=Kb(xR),[vHe,Kk]=Kb(xR),xHe=Qi(e=>{const{__scopeMenu:t,open:n=!1,children:i,dir:r,onOpenChange:s,modal:a=!0}=e,l=wR(t),[c,u]=m.useState(null),d=m.useRef(!1),f=$u(s),h=Wk(r);return m.useEffect(()=>{const p=Qi(()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},"handleKeyDown"),g=Qi(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),m.useEffect(()=>{if(!n)return;const p=Qi(()=>f(!1),"handleBlur");return window.addEventListener("blur",p),()=>window.removeEventListener("blur",p)},[n,f]),o.jsx(yR,{...l,children:o.jsx(Hve,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:o.jsx(vHe,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:a,children:i})})})},"Menu"),qve=m.forwardRef(Qi(function(t,n){const{__scopeMenu:i,...r}=t,s=wR(i);return o.jsx(T7,{...s,...r,ref:n})},"MenuAnchor")),Wve="MenuPortal",[wHe,Gve]=Kb(Wve,{forceMount:void 0}),OHe=Qi(e=>{const{__scopeMenu:t,forceMount:n,children:i,container:r}=e,s=$m(Wve,t);return o.jsx(wHe,{scope:t,forceMount:n,children:o.jsx(Gd,{present:n||s.open,children:o.jsx(m7,{asChild:!0,container:r,children:i})})})},"MenuPortal"),Pu="MenuContent",[SHe,I7]=Kb(Pu),kHe=m.forwardRef(Qi(function(t,n){const i=Gve(Pu,t.__scopeMenu),{forceMount:r=i.forceMount,...s}=t,a=$m(Pu,t.__scopeMenu),l=Kk(Pu,t.__scopeMenu);return o.jsx(OS.Provider,{scope:t.__scopeMenu,children:o.jsx(Gd,{present:r||a.open,children:o.jsx(OS.Slot,{scope:t.__scopeMenu,children:l.modal?o.jsx(EHe,{...s,ref:n}):o.jsx(CHe,{...s,ref:n})})})})},"MenuContent")),EHe=m.forwardRef(Qi(function(t,n){const i=$m(Pu,t.__scopeMenu),r=m.useRef(null),s=ir(n,r);return m.useEffect(()=>{const a=r.current;if(a)return mve(a)},[]),o.jsx(P7,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:i.open,disableOutsideScroll:!0,onFocusOutside:yn(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentModal")),CHe=m.forwardRef(Qi(function(t,n){const i=$m(Pu,t.__scopeMenu);return o.jsx(P7,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentNonModal")),THe=Oh("MenuContent.ScrollLock"),P7=m.forwardRef(Qi(function(t,n){const{__scopeMenu:i,loop:r=!1,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:p,onDismiss:g,disableOutsideScroll:b,...v}=t,y=$m(Pu,i),x=Kk(Pu,i),O=wR(i),w=Vve(i),k=bHe(i),[S,E]=m.useState(null),C=m.useRef(null),N=ir(n,C,y.onContentChange),_=m.useRef(0),j=m.useRef(""),A=m.useRef(0),F=m.useRef(null),T=m.useRef("right"),P=m.useRef(0),R=b?b7:m.Fragment,L=b?{as:THe,allowPinchZoom:!0}:void 0,M=Qi(I=>{var se,re;const H=j.current+I,K=k().filter(ge=>!ge.disabled),Q=document.activeElement,q=(se=K.find(ge=>ge.ref.current===Q))==null?void 0:se.textValue,B=K.map(ge=>ge.textValue),ee=nxe(B,H,q),le=(re=K.find(ge=>ge.textValue===ee))==null?void 0:re.ref.current;Qi(function ge(W){j.current=W,window.clearTimeout(_.current),W!==""&&(_.current=window.setTimeout(()=>ge(""),1e3))},"updateSearch")(H),le&&setTimeout(()=>le.focus())},"handleTypeaheadSearch");m.useEffect(()=>()=>window.clearTimeout(_.current),[]),uR();const U=m.useCallback(I=>{var K,Q;return T.current===((K=F.current)==null?void 0:K.side)&&rxe(I,(Q=F.current)==null?void 0:Q.area)},[]);return o.jsx(SHe,{scope:i,searchRef:j,onItemEnter:m.useCallback(I=>{U(I)&&I.preventDefault()},[U]),onItemLeave:m.useCallback(I=>{var H;U(I)||((H=C.current)==null||H.focus(),E(null))},[U]),onTriggerLeave:m.useCallback(I=>{U(I)&&I.preventDefault()},[U]),pointerGraceTimerRef:A,onPointerGraceIntentChange:m.useCallback(I=>{F.current=I},[]),children:o.jsx(R,{...L,children:o.jsx(eve,{asChild:!0,trapped:s,onMountAutoFocus:yn(a,I=>{var H;I.preventDefault(),(H=C.current)==null||H.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:o.jsx(f7,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:p,onDismiss:g,children:o.jsx(j7,{asChild:!0,...w,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:E,onEntryFocus:yn(u,I=>{x.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(A7,{role:"menu","aria-orientation":"vertical","data-state":M7(y.open),"data-radix-menu-content":"",dir:x.dir,...O,...v,ref:N,style:{outline:"none",...v.style},onKeyDown:yn(v.onKeyDown,I=>{const K=I.target.closest("[data-radix-menu-content]")===I.currentTarget,Q=I.ctrlKey||I.altKey||I.metaKey,q=I.key.length===1;K&&(I.key==="Tab"&&I.preventDefault(),!Q&&q&&M(I.key));const B=C.current;if(I.target!==B||!pHe.includes(I.key))return;I.preventDefault();const le=k().filter(se=>!se.disabled).map(se=>se.ref.current);Qve.includes(I.key)&&le.reverse(),exe(le)}),onBlur:yn(t.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(_.current),j.current="")}),onPointerMove:yn(t.onPointerMove,Bv(I=>{const H=I.target,K=P.current!==I.clientX;if(I.currentTarget.contains(H)&&K){const Q=I.clientX>P.current?"right":"left";T.current=Q,P.current=I.clientX}}))})})})})})})},"MenuContentImpl")),AHe=m.forwardRef(Qi(function(t,n){const{__scopeMenu:i,...r}=t;return o.jsx(wr.div,{role:"group",...r,ref:n})},"MenuGroup")),K4="MenuItem",sG="menu.itemSelect",D7=m.forwardRef(Qi(function(t,n){const{disabled:i=!1,onSelect:r,...s}=t,a=m.useRef(null),l=Kk(K4,t.__scopeMenu),c=I7(K4,t.__scopeMenu),u=ir(n,a),d=m.useRef(!1),f=Qi(()=>{const h=a.current;if(!i&&h){const p=new CustomEvent(sG,{bubbles:!0,cancelable:!0});h.addEventListener(sG,g=>r==null?void 0:r(g),{once:!0}),c7(h,p),p.defaultPrevented?d.current=!1:l.onClose()}},"handleSelect");return o.jsx(Kve,{...s,ref:u,disabled:i,onClick:yn(t.onClick,f),onPointerDown:h=>{var p;(p=t.onPointerDown)==null||p.call(t,h),d.current=!0},onPointerUp:yn(t.onPointerUp,h=>{var p;d.current||(p=h.currentTarget)==null||p.click()}),onKeyDown:yn(t.onKeyDown,h=>{i||h.target!==h.currentTarget||c.searchRef.current!==""&&h.key===" "||G4.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})},"MenuItem")),Kve=m.forwardRef(Qi(function(t,n){const{__scopeMenu:i,disabled:r=!1,textValue:s,...a}=t,l=I7(K4,i),c=Vve(i),u=m.useRef(null),d=ir(n,u),[f,h]=m.useState(!1),[p,g]=m.useState("");return m.useEffect(()=>{const b=u.current;b&&g((b.textContent??"").trim())},[a.children]),o.jsx(OS.ItemSlot,{scope:i,disabled:r,textValue:s??p,children:o.jsx(R7,{asChild:!0,...c,focusable:!r,children:o.jsx(wr.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:d,onPointerMove:yn(t.onPointerMove,Bv(b=>{r?l.onItemLeave(b):(l.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:yn(t.onPointerLeave,Bv(b=>l.onItemLeave(b))),onFocus:yn(t.onFocus,()=>h(!0)),onBlur:yn(t.onBlur,()=>h(!1))})})})},"MenuItemImpl")),_He=m.forwardRef(Qi(function(t,n){const{checked:i=!1,onCheckedChange:r,...s}=t;return o.jsx(Yve,{scope:t.__scopeMenu,checked:i,children:o.jsx(D7,{role:"menuitemcheckbox","aria-checked":SS(i)?"mixed":i,...s,ref:n,"data-state":OR(i),onSelect:yn(s.onSelect,()=>r==null?void 0:r(SS(i)?!0:!i),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),NHe="MenuRadioGroup",[jHe,RHe]=Kb(NHe,{value:void 0,onValueChange:Qi(()=>{},"onValueChange")}),IHe=m.forwardRef(Qi(function(t,n){const{value:i,onValueChange:r,...s}=t,a=$u(r);return o.jsx(jHe,{scope:t.__scopeMenu,value:i,onValueChange:a,children:o.jsx(AHe,{...s,ref:n})})},"MenuRadioGroup")),PHe="MenuRadioItem",DHe=m.forwardRef(Qi(function(t,n){const{value:i,...r}=t,s=RHe(PHe,t.__scopeMenu),a=i===s.value;return o.jsx(Yve,{scope:t.__scopeMenu,checked:a,children:o.jsx(D7,{role:"menuitemradio","aria-checked":a,...r,ref:n,"data-state":OR(a),onSelect:yn(r.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,i)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),Xve="MenuItemIndicator",[Yve,MHe]=Kb(Xve,{checked:!1}),LHe=m.forwardRef(Qi(function(t,n){const{__scopeMenu:i,forceMount:r,...s}=t,a=MHe(Xve,i);return o.jsx(Gd,{present:r||SS(a.checked)||a.checked===!0,children:o.jsx(wr.span,{...s,ref:n,"data-state":OR(a.checked)})})},"MenuItemIndicator")),$He=m.forwardRef(Qi(function(t,n){const{__scopeMenu:i,...r}=t;return o.jsx(wr.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})},"MenuSeparator")),Zve="MenuSub",[FHe,Jve]=Kb(Zve),BHe=Qi(e=>{const{__scopeMenu:t,children:n,open:i=!1,onOpenChange:r}=e,s=$m(Zve,t),a=wR(t),[l,c]=m.useState(null),[u,d]=m.useState(null),f=$u(r);return m.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),o.jsx(yR,{...a,children:o.jsx(Hve,{scope:t,open:i,onOpenChange:f,content:u,onContentChange:d,children:o.jsx(FHe,{scope:t,contentId:mm(),triggerId:mm(),trigger:l,onTriggerChange:c,children:n})})})},"MenuSub"),cT="MenuSubTrigger",UHe=m.forwardRef(Qi(function(t,n){const i=$m(cT,t.__scopeMenu),r=Kk(cT,t.__scopeMenu),s=Jve(cT,t.__scopeMenu),a=I7(cT,t.__scopeMenu),l=m.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=a,d={__scopeMenu:t.__scopeMenu},f=m.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);m.useEffect(()=>f,[f]),m.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),u(null)}},[c,u]);const h=ir(n,s.onTriggerChange);return o.jsx(qve,{asChild:!0,...d,children:o.jsx(Kve,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?s.contentId:void 0,"data-state":M7(i.open),...t,ref:h,onClick:p=>{var g;(g=t.onClick)==null||g.call(t,p),!(t.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),i.open||i.onOpenChange(!0))},onPointerMove:yn(t.onPointerMove,Bv(p=>{a.onItemEnter(p),!p.defaultPrevented&&!t.disabled&&!i.open&&!l.current&&(a.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{i.onOpenChange(!0),f()},100))})),onPointerLeave:yn(t.onPointerLeave,Bv(p=>{var b,v;f();const g=(b=i.content)==null?void 0:b.getBoundingClientRect();if(g){const y=(v=i.content)==null?void 0:v.dataset.side,x=y==="right",O=x?-5:5,w=g[x?"left":"right"],k=g[x?"right":"left"];a.onPointerGraceIntentChange({area:[{x:p.clientX+O,y:p.clientY},{x:w,y:g.top},{x:k,y:g.top},{x:k,y:g.bottom},{x:w,y:g.bottom}],side:y}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(p),p.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:yn(t.onKeyDown,p=>{var b;t.disabled||p.target!==p.currentTarget||a.searchRef.current!==""&&p.key===" "||mHe[r.dir].includes(p.key)&&(i.onOpenChange(!0),(b=i.content)==null||b.focus(),p.preventDefault())})})})},"MenuSubTrigger")),QHe="MenuSubContent",zHe=m.forwardRef(Qi(function(t,n){const i=Gve(Pu,t.__scopeMenu),{forceMount:r=i.forceMount,align:s="start",...a}=t,l=$m(Pu,t.__scopeMenu),c=Kk(Pu,t.__scopeMenu),u=Jve(QHe,t.__scopeMenu),d=m.useRef(null),f=ir(n,d);return o.jsx(OS.Provider,{scope:t.__scopeMenu,children:o.jsx(Gd,{present:r||l.open,children:o.jsx(OS.Slot,{scope:t.__scopeMenu,children:o.jsx(P7,{id:u.contentId,"aria-labelledby":u.triggerId,...a,ref:f,align:s,side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var p;c.isUsingKeyboardRef.current&&((p=d.current)==null||p.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:yn(t.onFocusOutside,h=>{h.target!==u.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:yn(t.onEscapeKeyDown,h=>{c.onClose(),h.preventDefault()}),onKeyDown:yn(t.onKeyDown,h=>{var b;const p=h.currentTarget.contains(h.target),g=gHe[c.dir].includes(h.key);p&&g&&(l.onOpenChange(!1),(b=u.trigger)==null||b.focus(),h.preventDefault())})})})})})},"MenuSubContent"));function M7(e){return e?"open":"closed"}Qi(M7,"getOpenState");function SS(e){return e==="indeterminate"}Qi(SS,"isIndeterminate");function OR(e){return SS(e)?"indeterminate":e?"checked":"unchecked"}Qi(OR,"getCheckedState");function exe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}Qi(exe,"focusFirst");function txe(e,t){return e.map((n,i)=>e[(t+i)%e.length])}Qi(txe,"wrapArray");function nxe(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=txe(e,Math.max(s,0));r.length===1&&(a=a.filter(u=>u!==n));const c=a.find(u=>u.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}Qi(nxe,"getNextMatch");function ixe(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,a=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}Qi(ixe,"isPointInPolygon");function rxe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return ixe(n,t)}Qi(rxe,"isPointerInGraceArea");function Bv(e){return t=>t.pointerType==="mouse"?e(t):void 0}Qi(Bv,"whenMouse");var VHe=xHe,HHe=qve,qHe=OHe,WHe=kHe,GHe=D7,KHe=_He,XHe=IHe,YHe=DHe,ZHe=LHe,JHe=$He,eqe=BHe,tqe=UHe,nqe=zHe,iqe=Object.defineProperty,mc=(e,t)=>iqe(e,"name",{value:t,configurable:!0}),L7="DropdownMenu",[rqe,ZVt]=kl(L7,[zve]),gc=zve(),[sqe,sxe]=rqe(L7),aqe=mc(e=>{const{__scopeDropdownMenu:t,children:n,dir:i,open:r,defaultOpen:s,onOpenChange:a,modal:l=!0}=e,c=gc(t),u=m.useRef(null),[d,f]=su({prop:r,defaultProp:s??!1,onChange:a,caller:L7});return o.jsx(sqe,{scope:t,triggerId:mm(),triggerRef:u,contentId:mm(),open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(h=>!h),[f]),modal:l,children:o.jsx(VHe,{...c,open:d,onOpenChange:f,dir:i,modal:l,children:n})})},"DropdownMenu"),oqe="DropdownMenuTrigger",lqe=m.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,disabled:r=!1,...s}=t,a=sxe(oqe,i),l=gc(i),c=ir(n,a.triggerRef);return o.jsx(HHe,{asChild:!0,...l,children:o.jsx(wr.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:c,onPointerDown:yn(t.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(a.onOpenToggle(),a.open||u.preventDefault())}),onKeyDown:yn(t.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&a.onOpenToggle(),u.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),cqe=mc(e=>{const{__scopeDropdownMenu:t,...n}=e,i=gc(t);return o.jsx(qHe,{...i,...n})},"DropdownMenuPortal"),uqe="DropdownMenuContent",dqe=m.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=sxe(uqe,i),a=gc(i),l=m.useRef(!1);return o.jsx(WHe,{id:s.contentId,"aria-labelledby":s.triggerId,...a,...r,ref:n,onCloseAutoFocus:yn(t.onCloseAutoFocus,c=>{var u;l.current||(u=s.triggerRef.current)==null||u.focus(),l.current=!1,c.preventDefault()}),onInteractOutside:yn(t.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;(!s.modal||f)&&(l.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),fqe=m.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(GHe,{...s,...r,ref:n})},"DropdownMenuItem")),hqe=m.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(KHe,{...s,...r,ref:n})},"DropdownMenuCheckboxItem")),pqe=m.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(XHe,{...s,...r,ref:n})},"DropdownMenuRadioGroup")),mqe=m.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(YHe,{...s,...r,ref:n})},"DropdownMenuRadioItem")),gqe=m.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(ZHe,{...s,...r,ref:n})},"DropdownMenuItemIndicator")),bqe=m.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(JHe,{...s,...r,ref:n})},"DropdownMenuSeparator")),yqe=mc(e=>{const{__scopeDropdownMenu:t,children:n,open:i,onOpenChange:r,defaultOpen:s}=e,a=gc(t),[l,c]=su({prop:i,defaultProp:s??!1,onChange:r,caller:"DropdownMenuSub"});return o.jsx(eqe,{...a,open:l,onOpenChange:c,children:n})},"DropdownMenuSub"),vqe=m.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(tqe,{...s,...r,ref:n})},"DropdownMenuSubTrigger")),xqe=m.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(nqe,{...s,...r,ref:n,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent")),wqe=aqe,Oqe=lqe,axe=cqe,Sqe=dqe,oxe=fqe,kqe=hqe,Eqe=pqe,Cqe=mqe,lxe=gqe,Tqe=bqe,Aqe=yqe,_qe=vqe,Nqe=xqe,jqe=Object.defineProperty,Fm=(e,t)=>jqe(e,"name",{value:t,configurable:!0}),$7="Popover",[cxe,JVt]=kl($7,[Ix]),F7=Ix(),[Rqe,Dx]=cxe($7),Iqe=Fm(e=>{const{__scopePopover:t,children:n,open:i,defaultOpen:r,onOpenChange:s,modal:a=!1}=e,l=F7(t),c=m.useRef(null),[u,d]=m.useState(!1),[f,h]=su({prop:i,defaultProp:r??!1,onChange:s,caller:$7});return o.jsx(yR,{...l,children:o.jsx(Rqe,{scope:t,contentId:mm(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:u,onCustomAnchorAdd:m.useCallback(()=>d(!0),[]),onCustomAnchorRemove:m.useCallback(()=>d(!1),[]),modal:a,children:n})})},"Popover"),Pqe="PopoverTrigger",Dqe=m.forwardRef(Fm(function(t,n){const{__scopePopover:i,...r}=t,s=Dx(Pqe,i),a=F7(i),l=ir(n,s.triggerRef),c=o.jsx(wr.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":B7(s.open),...r,ref:l,onClick:yn(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:o.jsx(T7,{asChild:!0,...a,children:c})},"PopoverTrigger")),uxe="PopoverPortal",[Mqe,Lqe]=cxe(uxe,{forceMount:void 0}),$qe=Fm(e=>{const{__scopePopover:t,forceMount:n,children:i,container:r}=e,s=Dx(uxe,t);return o.jsx(Mqe,{scope:t,forceMount:n,children:o.jsx(Gd,{present:n||s.open,children:o.jsx(m7,{asChild:!0,container:r,children:i})})})},"PopoverPortal"),kS="PopoverContent",Fqe=m.forwardRef(Fm(function(t,n){const i=Lqe(kS,t.__scopePopover),{forceMount:r=i.forceMount,...s}=t,a=Dx(kS,t.__scopePopover);return o.jsx(Gd,{present:r||a.open,children:a.modal?o.jsx(Uqe,{...s,ref:n}):o.jsx(Qqe,{...s,ref:n})})},"PopoverContent")),Bqe=Oh("PopoverContent.RemoveScroll"),Uqe=m.forwardRef(Fm(function(t,n){const i=Dx(kS,t.__scopePopover),r=m.useRef(null),s=ir(n,r),a=m.useRef(!1);return m.useEffect(()=>{const l=r.current;if(l)return mve(l)},[]),o.jsx(b7,{as:Bqe,allowPinchZoom:!0,children:o.jsx(dxe,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:yn(t.onCloseAutoFocus,l=>{var c;l.preventDefault(),a.current||(c=i.triggerRef.current)==null||c.focus()}),onPointerDownOutside:yn(t.onPointerDownOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;a.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:yn(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),Qqe=m.forwardRef(Fm(function(t,n){const i=Dx(kS,t.__scopePopover),r=m.useRef(!1),s=m.useRef(!1);return o.jsx(dxe,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var l,c;(l=t.onCloseAutoFocus)==null||l.call(t,a),a.defaultPrevented||(r.current||(c=i.triggerRef.current)==null||c.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=a.target;((d=i.triggerRef.current)==null?void 0:d.contains(l))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})},"PopoverContentNonModal")),dxe=m.forwardRef(Fm(function(t,n){const{__scopePopover:i,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,...h}=t,p=Dx(kS,i),g=F7(i);return uR(),o.jsx(eve,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:o.jsx(f7,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>p.onOpenChange(!1),deferPointerDownOutside:!0,children:o.jsx(A7,{"data-state":B7(p.open),role:"dialog",id:p.contentId,...g,...h,ref:n,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl"));function B7(e){return e?"open":"closed"}Fm(B7,"getState");var fxe=Iqe,hxe=Dqe,pxe=$qe,mxe=Fqe,zqe=Object.defineProperty,yo=(e,t)=>zqe(e,"name",{value:t,configurable:!0}),gxe="Radio",[Vqe,bxe]=kl(gxe),[Hqe,SR]=Vqe(gxe);function yxe(e){const{__scopeRadio:t,checked:n=!1,children:i,disabled:r,form:s,name:a,onCheck:l,required:c,value:u="on",internal_do_not_use_render:d}=e,[f,h]=m.useState(null),[p,g]=m.useState(null),b=m.useRef(!1),[v,y]=m.useReducer(w=>w+1,0),x=f?!!s||!!f.closest("form"):!0,O={checked:n,disabled:r,required:c,name:a,form:s,value:u,control:f,setControl:h,hasConsumerStoppedPropagationRef:b,userInteractionCount:v,onUserInteraction:y,isFormControl:x,bubbleInput:p,setBubbleInput:g,onCheck:yo(()=>l==null?void 0:l(),"onCheck")};return o.jsx(Hqe,{scope:t,...O,children:vxe(d)?d(O):i})}yo(yxe,"RadioProvider");var qqe="RadioTrigger",Wqe=m.forwardRef(yo(function({__scopeRadio:t,onClick:n,...i},r){const{checked:s,disabled:a,value:l,setControl:c,onCheck:u,hasConsumerStoppedPropagationRef:d,onUserInteraction:f,isFormControl:h,bubbleInput:p}=SR(qqe,t),g=ir(r,c);return o.jsx(wr.button,{type:"button",role:"radio","aria-checked":s,"data-state":U7(s),"data-disabled":a?"":void 0,disabled:a,value:l,...i,ref:g,onClick:yn(n,b=>{s||(f(),u()),p&&h&&(d.current=b.isPropagationStopped(),d.current||b.stopPropagation())})})},"RadioTrigger")),Gqe="RadioIndicator",Kqe=m.forwardRef(yo(function(t,n){const{__scopeRadio:i,forceMount:r,...s}=t,a=SR(Gqe,i);return o.jsx(Gd,{present:r||a.checked,children:o.jsx(wr.span,{"data-state":U7(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:n})})},"RadioIndicator")),Xqe="RadioBubbleInput",Yqe=m.forwardRef(yo(function({__scopeRadio:t,onClick:n,...i},r){const{control:s,checked:a,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:p,hasConsumerStoppedPropagationRef:g,userInteractionCount:b}=SR(Xqe,t),v=ir(r,p),y=Gk(s),x=m.useRef(!1),O=m.useRef(a),w=m.useRef(b);m.useEffect(()=>{const S=h;if(!S)return;const E=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(E,"checked").set,_=b!==w.current;w.current=b;const j=O.current!==a;O.current=a;const A=!(_&&g.current);if(j&&N){x.current=!_;const F=new Event("click",{bubbles:A});N.call(S,a),S.dispatchEvent(F),x.current=!1}},[h,a,g,b]);const k=m.useRef(a);return o.jsx(wr.input,{type:"radio","aria-hidden":!0,defaultChecked:k.current,required:l,disabled:c,name:u,value:d,form:f,...i,tabIndex:-1,ref:v,onClick:yn(n,S=>{x.current&&S.stopPropagation()}),style:{...i.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function vxe(e){return typeof e=="function"}yo(vxe,"isFunction");function U7(e){return e?"checked":"unchecked"}yo(U7,"getState");var Zqe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Q7="RadioGroup",[Jqe,eHt]=kl(Q7,[Px,bxe]),xxe=Px(),kR=bxe(),[eWe,tWe]=Jqe(Q7),nWe=m.forwardRef(yo(function(t,n){const{__scopeRadioGroup:i,name:r,form:s,defaultValue:a,value:l,required:c=!1,disabled:u=!1,orientation:d,dir:f,loop:h=!0,onValueChange:p,...g}=t,b=xxe(i),v=Wk(f),[y,x]=su({prop:l,defaultProp:a??null,onChange:p,caller:Q7}),[O,w]=m.useState(null),k=ir(n,w),S=m.useRef(y);return m.useEffect(()=>{const E=s?O==null?void 0:O.ownerDocument.getElementById(s):O==null?void 0:O.closest("form");if(E instanceof HTMLFormElement){const C=yo(()=>x(S.current),"reset");return E.addEventListener("reset",C),()=>E.removeEventListener("reset",C)}},[O,s,x]),o.jsx(eWe,{scope:i,name:r,form:s,required:c,disabled:u,value:y,onValueChange:x,children:o.jsx(j7,{asChild:!0,...b,orientation:d,dir:v,loop:h,children:o.jsx(wr.div,{role:"radiogroup","aria-required":c,"aria-orientation":d,"data-disabled":u?"":void 0,dir:v,...g,ref:k})})})},"RadioGroup")),iWe="RadioGroupItemProvider",rWe="RadioGroupItemTrigger";function wxe(e){const{__scopeRadioGroup:t,value:n,disabled:i,children:r,internal_do_not_use_render:s}=e,a=tWe(iWe,t),l=kR(t),c=a.disabled||i;return o.jsx(yxe,{...l,checked:a.value===n,disabled:c,required:a.required,name:a.name,form:a.form,value:n,onCheck:()=>a.onValueChange(n),internal_do_not_use_render:s,children:r})}yo(wxe,"RadioGroupItemProvider");var sWe=m.forwardRef(yo(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=xxe(i),a=kR(i),{checked:l,disabled:c}=SR(rWe,a.__scopeRadio),u=m.useRef(null),d=ir(n,u),f=m.useRef(!1);return m.useEffect(()=>{const h=yo(g=>{Zqe.includes(g.key)&&(f.current=!0)},"handleKeyDown"),p=yo(()=>f.current=!1,"handleKeyUp");return document.addEventListener("keydown",h),document.addEventListener("keyup",p),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",p)}},[]),o.jsx(R7,{asChild:!0,...s,focusable:!c,active:l,children:o.jsx(Wqe,{...a,...r,ref:d,onKeyDown:yn(r.onKeyDown,h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:yn(r.onFocus,()=>{var h;f.current&&((h=u.current)==null||h.click())})})})},"RadioGroupItemTrigger")),aWe=m.forwardRef(yo(function(t,n){const{__scopeRadioGroup:i,value:r,disabled:s,...a}=t;return o.jsx(wxe,{__scopeRadioGroup:i,value:r,disabled:s,internal_do_not_use_render:({isFormControl:l})=>o.jsxs(o.Fragment,{children:[o.jsx(sWe,{...a,ref:n,__scopeRadioGroup:i}),l&&o.jsx(oWe,{__scopeRadioGroup:i})]})})},"RadioGroupItem")),oWe=m.forwardRef(yo(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=kR(i);return o.jsx(Yqe,{...s,...r,ref:n})},"RadioGroupItemBubbleInput")),lWe=m.forwardRef(yo(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=kR(i);return o.jsx(Kqe,{...s,...r,ref:n})},"RadioGroupIndicator")),cWe=Object.defineProperty,ym=(e,t)=>cWe(e,"name",{value:t,configurable:!0}),z7="Switch",[uWe,tHt]=kl(z7),[dWe,V7]=uWe(z7);function Oxe(e){const{__scopeSwitch:t,checked:n,children:i,defaultChecked:r,disabled:s,form:a,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,p]=su({prop:n,defaultProp:r??!1,onChange:c,caller:z7}),[g,b]=m.useState(null),[v,y]=m.useState(null),x=m.useRef(!1),[O,w]=m.useReducer(E=>E+1,0),k=g?!!a||!!g.closest("form"):!0,S={checked:h,setChecked:p,disabled:s,control:g,setControl:b,name:l,form:a,value:d,hasConsumerStoppedPropagationRef:x,userInteractionCount:O,onUserInteraction:w,required:u,defaultChecked:r,isFormControl:k,bubbleInput:v,setBubbleInput:y};return o.jsx(dWe,{scope:t,...S,children:Sxe(f)?f(S):i})}ym(Oxe,"SwitchProvider");var fWe="SwitchTrigger",hWe=m.forwardRef(ym(function({__scopeSwitch:t,onClick:n,...i},r){const{control:s,form:a,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:p,onUserInteraction:g,isFormControl:b,bubbleInput:v}=V7(fWe,t),y=ir(r,f),x=m.useRef(u);return m.useEffect(()=>{const O=a?s==null?void 0:s.ownerDocument.getElementById(a):s==null?void 0:s.form;if(O instanceof HTMLFormElement){const w=ym(()=>h(x.current),"reset");return O.addEventListener("reset",w),()=>O.removeEventListener("reset",w)}},[s,a,h]),o.jsx(wr.button,{type:"button",role:"switch","aria-checked":u,"aria-required":d,"data-state":H7(u),"data-disabled":c?"":void 0,disabled:c,value:l,...i,ref:y,onClick:yn(n,O=>{g(),h(w=>!w),v&&b&&(p.current=O.isPropagationStopped(),p.current||O.stopPropagation())})})},"SwitchTrigger")),pWe=m.forwardRef(ym(function(t,n){const{__scopeSwitch:i,name:r,checked:s,defaultChecked:a,required:l,disabled:c,value:u,onCheckedChange:d,form:f,...h}=t;return o.jsx(Oxe,{__scopeSwitch:i,checked:s,defaultChecked:a,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:p})=>o.jsxs(o.Fragment,{children:[o.jsx(hWe,{...h,ref:n,__scopeSwitch:i}),p&&o.jsx(yWe,{__scopeSwitch:i})]})})},"Switch")),mWe="SwitchThumb",gWe=m.forwardRef(ym(function(t,n){const{__scopeSwitch:i,...r}=t,s=V7(mWe,i);return o.jsx(wr.span,{"data-state":H7(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:n})},"SwitchThumb")),bWe="SwitchBubbleInput",yWe=m.forwardRef(ym(function({__scopeSwitch:t,onClick:n,...i},r){const{control:s,hasConsumerStoppedPropagationRef:a,userInteractionCount:l,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:p,form:g,bubbleInput:b,setBubbleInput:v}=V7(bWe,t),y=ir(r,v),x=Gk(s),O=m.useRef(!1),w=m.useRef(c),k=m.useRef(l);m.useEffect(()=>{const E=b;if(!E)return;const C=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(C,"checked").set,j=l!==k.current;k.current=l;const A=w.current!==c;w.current=c;const F=!(j&&a.current);if(A&&_){O.current=!j;const T=new Event("click",{bubbles:F});_.call(E,c),E.dispatchEvent(T),O.current=!1}},[b,c,a,l]);const S=m.useRef(c);return o.jsx(wr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??S.current,required:d,disabled:f,name:h,value:p,form:g,...i,tabIndex:-1,ref:y,onClick:yn(n,E=>{O.current&&E.stopPropagation()}),style:{...i.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function Sxe(e){return typeof e=="function"}ym(Sxe,"isFunction");function H7(e){return e?"checked":"unchecked"}ym(H7,"getState");var vWe=Object.defineProperty,xWe=(e,t)=>vWe(e,"name",{value:t,configurable:!0}),wWe="Toggle",OWe=m.forwardRef(xWe(function(t,n){const{pressed:i,defaultPressed:r,onPressedChange:s,...a}=t,[l,c]=su({prop:i,onChange:s,defaultProp:r??!1,caller:wWe});return o.jsx(wr.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":t.disabled?"":void 0,...a,ref:n,onClick:yn(t.onClick,()=>{t.disabled||c(!l)})})},"Toggle")),SWe=Object.defineProperty,vm=(e,t)=>SWe(e,"name",{value:t,configurable:!0}),Mx="ToggleGroup",[kxe,nHt]=kl(Mx,[Px]),Exe=Px(),kWe=m.forwardRef(vm(function(t,n){const{type:i,...r}=t;if(i==="single"){const s=r;return o.jsx(EWe,{role:"radiogroup",...s,ref:n})}if(i==="multiple"){const s=r;return o.jsx(CWe,{role:"toolbar",...s,ref:n})}throw new Error(`Missing prop \`type\` expected on \`${Mx}\``)},"ToggleGroup")),[Cxe,Txe]=kxe(Mx),EWe=m.forwardRef(vm(function(t,n){const{value:i,defaultValue:r,onValueChange:s=vm(()=>{},"onValueChange"),...a}=t,[l,c]=su({prop:i,defaultProp:r??"",onChange:s,caller:Mx});return o.jsx(Cxe,{scope:t.__scopeToggleGroup,type:"single",value:m.useMemo(()=>l?[l]:[],[l]),onItemActivate:c,onItemDeactivate:m.useCallback(()=>c(""),[c]),children:o.jsx(Axe,{...a,ref:n})})},"ToggleGroupImplSingle")),CWe=m.forwardRef(vm(function(t,n){const{value:i,defaultValue:r,onValueChange:s=vm(()=>{},"onValueChange"),...a}=t,[l,c]=su({prop:i,defaultProp:r??[],onChange:s,caller:Mx}),u=m.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=m.useCallback(f=>c((h=[])=>h.filter(p=>p!==f)),[c]);return o.jsx(Cxe,{scope:t.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:u,onItemDeactivate:d,children:o.jsx(Axe,{...a,ref:n})})},"ToggleGroupImplMultiple")),[TWe,AWe]=kxe(Mx),Axe=m.forwardRef(vm(function(t,n){const{__scopeToggleGroup:i,disabled:r=!1,rovingFocus:s=!0,orientation:a,dir:l,loop:c=!0,...u}=t,d=Exe(i),f=Wk(l),h={dir:f,...u};return o.jsx(TWe,{scope:i,rovingFocus:s,disabled:r,children:s?o.jsx(j7,{asChild:!0,...d,orientation:a,dir:f,loop:c,children:o.jsx(wr.div,{...h,ref:n})}):o.jsx(wr.div,{...h,ref:n})})},"ToggleGroupImpl")),X4="ToggleGroupItem",_We=m.forwardRef(vm(function(t,n){const i=Txe(X4,t.__scopeToggleGroup),r=AWe(X4,t.__scopeToggleGroup),s=Exe(t.__scopeToggleGroup),a=i.value.includes(t.value),l=r.disabled||t.disabled,c={...t,pressed:a,disabled:l},u=m.useRef(null);return r.rovingFocus?o.jsx(R7,{asChild:!0,...s,focusable:!l,active:a,ref:u,children:o.jsx(aG,{...c,ref:n})}):o.jsx(aG,{...c,ref:n})},"ToggleGroupItem")),aG=m.forwardRef(vm(function(t,n){const{__scopeToggleGroup:i,value:r,...s}=t,a=Txe(X4,i),l={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},c=a.type==="single"?l:void 0;return o.jsx(OWe,{...c,...s,ref:n,onPressedChange:u=>{u?a.onItemActivate(r):a.onItemDeactivate(r)}})},"ToggleGroupItemImpl")),NWe=Object.defineProperty,La=(e,t)=>NWe(e,"name",{value:t,configurable:!0}),[q7,iHt]=kl("Tooltip",[Ix]),W7=Ix(),jWe="TooltipProvider",RWe=700,Y4="tooltip.open",[IWe,G7]=q7(jWe),PWe=La(e=>{const{__scopeTooltip:t,delayDuration:n=RWe,skipDelayDuration:i=300,disableHoverableContent:r=!1,children:s}=e,a=m.useRef(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),o.jsx(IWe,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:m.useCallback(()=>{i<=0||(window.clearTimeout(c.current),a.current=!1)},[i]),onClose:m.useCallback(()=>{i<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,i))},[i]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(u=>{l.current=u},[]),disableHoverableContent:r,children:s})},"TooltipProvider"),Z4="Tooltip",[DWe,Xk]=q7(Z4),MWe=La(e=>{const{__scopeTooltip:t,children:n,open:i,defaultOpen:r,onOpenChange:s,disableHoverableContent:a,delayDuration:l}=e,c=G7(Z4,e.__scopeTooltip),u=W7(t),[d,f]=m.useState(null),[h,p]=m.useState(void 0),g=mm(),b=m.useRef(0),v=a??c.disableHoverableContent,y=l??c.delayDuration,x=m.useRef(!1),[O,w]=su({prop:i,defaultProp:r??!1,onChange:La(_=>{_?(c.onOpen(),document.dispatchEvent(new CustomEvent(Y4))):c.onClose(),s==null||s(_)},"onChange"),caller:Z4}),k=m.useMemo(()=>O?x.current?"delayed-open":"instant-open":"closed",[O]),S=m.useCallback(()=>{window.clearTimeout(b.current),b.current=0,x.current=!1,w(!0)},[w]),E=m.useCallback(()=>{window.clearTimeout(b.current),b.current=0,w(!1)},[w]),C=m.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{x.current=!0,w(!0),b.current=0},y)},[y,w]);m.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]);const N=h??g;return o.jsx(yR,{...u,children:o.jsx(DWe,{scope:t,contentId:N,setContentId:p,open:O,stateAttribute:k,trigger:d,onTriggerChange:f,onTriggerEnter:m.useCallback(()=>{c.isOpenDelayedRef.current?C():S()},[c.isOpenDelayedRef,C,S]),onTriggerLeave:m.useCallback(()=>{v?E():(window.clearTimeout(b.current),b.current=0)},[E,v]),onOpen:S,onClose:E,disableHoverableContent:v,children:n})})},"Tooltip"),oG="TooltipTrigger",LWe=m.forwardRef(La(function(t,n){const{__scopeTooltip:i,...r}=t,s=Xk(oG,i),a=G7(oG,i),l=W7(i),c=m.useRef(null),u=ir(n,c,s.onTriggerChange),d=m.useRef(!1),f=m.useRef(!1),h=m.useCallback(()=>d.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),o.jsx(T7,{asChild:!0,...l,children:o.jsx(wr.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:u,onPointerMove:yn(t.onPointerMove,p=>{p.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:yn(t.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:yn(t.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:yn(t.onFocus,()=>{d.current||s.onOpen()}),onBlur:yn(t.onBlur,s.onClose),onClick:yn(t.onClick,s.onClose)})})},"TooltipTrigger")),_xe="TooltipPortal",[$We,FWe]=q7(_xe,{forceMount:void 0}),BWe=La(e=>{const{__scopeTooltip:t,forceMount:n,children:i,container:r}=e,s=Xk(_xe,t);return o.jsx($We,{scope:t,forceMount:n,children:o.jsx(Gd,{present:n||s.open,children:o.jsx(m7,{asChild:!0,container:r,children:i})})})},"TooltipPortal"),ES="TooltipContent",UWe=m.forwardRef(La(function(t,n){const i=FWe(ES,t.__scopeTooltip),{forceMount:r=i.forceMount,side:s="top",...a}=t,l=Xk(ES,t.__scopeTooltip);return o.jsx(Gd,{present:r||l.open,children:l.disableHoverableContent?o.jsx(Nxe,{side:s,...a,ref:n}):o.jsx(QWe,{side:s,...a,ref:n})})},"TooltipContent")),QWe=m.forwardRef(La(function(t,n){const i=Xk(ES,t.__scopeTooltip),r=G7(ES,t.__scopeTooltip),s=m.useRef(null),a=ir(n,s),[l,c]=m.useState(null),{trigger:u,onClose:d}=i,f=s.current,{onPointerInTransitChange:h}=r,p=m.useCallback(()=>{c(null),h(!1)},[h]),g=m.useCallback((b,v)=>{const y=b.currentTarget,x={x:b.clientX,y:b.clientY},O=jxe(x,y.getBoundingClientRect()),w=Rxe(x,O),k=Ixe(v.getBoundingClientRect()),S=Dxe([...w,...k]);c(S),h(!0)},[h]);return m.useEffect(()=>()=>p(),[p]),m.useEffect(()=>{if(u&&f){const b=La(y=>g(y,f),"handleTriggerLeave"),v=La(y=>g(y,u),"handleContentLeave");return u.addEventListener("pointerleave",b),f.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",v)}}},[u,f,g,p]),m.useEffect(()=>{if(l){const b=La(v=>{const y=v.target,x={x:v.clientX,y:v.clientY},O=(u==null?void 0:u.contains(y))||(f==null?void 0:f.contains(y)),w=!Pxe(x,l);O?p():w&&(p(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,f,l,d,p]),o.jsx(Nxe,{...t,ref:a})},"TooltipContentHoverable")),zWe=jye("TooltipContent"),Nxe=m.forwardRef(La(function(t,n){const{__scopeTooltip:i,children:r,"aria-label":s,id:a,onEscapeKeyDown:l,onPointerDownOutside:c,...u}=t,d=Xk(ES,i),f=W7(i),{onClose:h}=d;m.useEffect(()=>(document.addEventListener(Y4,h),()=>document.removeEventListener(Y4,h)),[h]),m.useEffect(()=>{if(d.trigger){const g=La(b=>{b.target instanceof Node&&b.target.contains(d.trigger)&&h()},"handleScroll");return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[d.trigger,h]);const{setContentId:p}=d;return Jc(()=>(p(a),()=>{p(void 0)}),[a,p]),o.jsx(f7,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:h,children:o.jsxs(A7,{"data-state":d.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:d.contentId,...f,...u,ref:n,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(zWe,{children:r}),s?o.jsx(dQe,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl"));function jxe(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,i,r,s)){case s:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}La(jxe,"getExitSideFromRect");function Rxe(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}La(Rxe,"getPaddedExitPoints");function Ixe(e){const{top:t,right:n,bottom:i,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:i},{x:r,y:i}]}La(Ixe,"getPointsFromRect");function Pxe(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,a=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}La(Pxe,"isPointInPolygon");function Dxe(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),Mxe(t)}La(Dxe,"getHull");function Mxe(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}La(Mxe,"getHullPresorted");var VWe=PWe,HWe=MWe,Lxe=LWe,qWe=BWe,WWe=UWe;function xm(e){const t=m.useRef(e);return t.current=e,t}let Uv=[],uT=!1;const lG=e=>{var t,n;if(e.key==="Escape"){const[i]=Uv;i&&(e.preventDefault(),(n=(t=i.callback).current)==null||n.call(t))}},$xe=()=>{Uv.length>0&&!uT?(document.body.addEventListener("keydown",lG),uT=!0):Uv.length===0&&uT&&(document.body.removeEventListener("keydown",lG),uT=!1)},GWe=e=>{Uv.unshift(e),$xe()},KWe=({id:e})=>{Uv=Uv.filter(t=>t.id!==e),$xe()},Yk=(e,t)=>{const n=m.useId(),i=xm(t);m.useEffect(()=>{if(!e)return;const r={id:n,callback:i};return GWe(r),()=>KWe(r)},[n,e,i])},XWe=m.createContext(null);function Fxe(){const e=m.useContext(XWe);return(e==null?void 0:e.linkComponent)??"a"}function Zk(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}const YWe=()=>Eye,cG=(e,t=!1,n="TransitionGroup")=>{const i=[];return m.Children.forEach(e,r=>{if(r&&typeof r=="object"&&"key"in r&&r.key)i.push(r);else if(t)throw new Error(`Child elements of <${n} /> must include a \`key\``)}),i},P0=()=>{},D0=e=>{const t=m.useRef(e);return t.current=e,m.useCallback(n=>t.current(n),[])};function ZWe(e,t,n,i){const r=e.reduce((c,u)=>({...c,[u.key]:1}),{}),s=t.reduce((c,u)=>({...c,[u.component.key]:1}),{}),a=e.filter(c=>!s[c.key]).map(n),l=t.map(c=>({...c,component:e.find(({key:u})=>u===c.component.key)||c.component,shouldRender:!!r[c.component.key]}));return i==="append"?l.concat(a):a.concat(l)}function JWe(e,t,n){if((Eye||qUe)&&t&&n>1)throw new Error(`Cannot use forwardRef with multiple children in <${e} />`)}const eGe="_TransitionGroupChild_1hv1z_1",tGe={TransitionGroupChild:eGe},Bxe={enter:!1,enterActive:!1,exit:!1,exitActive:!1,interrupted:!1},nGe=e=>({...Bxe,enter:!e}),iGe=(e,t)=>{switch(t.type){case"enter-before":return{enter:!0,enterActive:!1,exit:!1,exitActive:!1,interrupted:e.interrupted||e.exit};case"enter-active":return{enter:!0,enterActive:!0,exit:!1,exitActive:!1,interrupted:!1};case"exit-before":return{enter:!1,enterActive:!1,exit:!0,exitActive:!1,interrupted:e.interrupted||e.enter};case"exit-active":return{enter:!1,enterActive:!1,exit:!0,exitActive:!0,interrupted:!1};case"done":default:return Bxe}},rGe=({ref:e,as:t,children:n,className:i,transitionId:r,style:s,preventMountTransition:a,shouldRender:l,enterDuration:c,exitDuration:u,removeChild:d,onEnter:f,onEnterActive:h,onEnterComplete:p,onExit:g,onExitActive:b,onExitComplete:v})=>{const[y,x]=m.useReducer(iGe,nGe(a||!1)),O=m.useRef(!1),w=m.useRef(null),k=m.useRef(c);k.current=c;const S=m.useRef(u);S.current=u;const E=m.useRef(null),C=m.useCallback(N=>{const _=w.current;if(!(!_||N===E.current))switch(E.current=N,N){case"enter":f(_);break;case"enter-active":h(_);break;case"enter-complete":p(_);break;case"exit":g(_);break;case"exit-active":b(_);break;case"exit-complete":v(_);break}},[f,h,p,g,b,v]);return ii.useLayoutEffect(()=>{if(!l){let j;x({type:"exit-before"}),C("exit");const A=F_(()=>{x({type:"exit-active"}),C("exit-active"),j=window.setTimeout(()=>{C("exit-complete"),d()},S.current)});return()=>{A(),j!==void 0&&clearTimeout(j)}}if(a&&!O.current){O.current=!0;return}let N;x({type:"enter-before"}),C("enter");const _=F_(()=>{x({type:"enter-active"}),C("enter-active"),N=window.setTimeout(()=>{x({type:"done"}),C("enter-complete")},k.current)});return()=>{_(),N!==void 0&&clearTimeout(N)}},[l,a,d,C]),m.useEffect(()=>()=>{O.current=!1},[]),o.jsx(t,{ref:Zk([w,e]),className:pi(i,tGe.TransitionGroupChild),"data-transition-id":r,style:s,"data-entering":y.enter?"":void 0,"data-entering-active":y.enterActive?"":void 0,"data-exiting":y.exit?"":void 0,"data-exiting-active":y.exitActive?"":void 0,"data-interrupted":y.interrupted?"":void 0,children:n})},sGe=e=>{const{enterMountDelay:t,preventMountTransition:n}=e,i=!n&&t!=null?t:null,[r,s]=m.useState(i==null);return a7(()=>s(!0),r?null:i),r?o.jsx(rGe,{...e}):null},Lx=e=>{const{ref:t,as:n="span",children:i,className:r,transitionId:s,style:a,enterDuration:l=0,exitDuration:c=0,preventInitialTransition:u=!0,enterMountDelay:d,insertMethod:f="append",disableAnimations:h=YWe()}=e,p=D0(e.onEnter??P0),g=D0(e.onEnterActive??P0),b=D0(e.onEnterComplete??P0),v=D0(e.onExit??P0),y=D0(e.onExitActive??P0),x=D0(e.onExitComplete??P0);m.Children.forEach(i,S=>{if(S&&!S.key)throw new Error("Child elements of must include a `key`")});const O=m.useCallback(S=>({component:S,shouldRender:!0,removeChild:()=>{k(E=>E.filter(C=>S.key!==C.component.key))},onEnter:p,onEnterActive:g,onEnterComplete:b,onExit:v,onExitActive:y,onExitComplete:x}),[p,g,b,v,y,x]),[w,k]=m.useState(()=>cG(i).map(S=>({...O(S),preventMountTransition:u})));return m.useLayoutEffect(()=>{k(S=>{const E=cG(i);return ZWe(E,S,O,f)})},[i,f,O]),JWe("TransitionGroup",t,m.Children.count(i)),h?o.jsx(o.Fragment,{children:m.Children.map(i,S=>o.jsx(n,{ref:t,className:r,style:a,"data-transition-id":s,children:S}))}):o.jsx(o.Fragment,{children:w.map(({component:S,...E})=>o.jsx(sGe,{...E,as:n,className:r,transitionId:s,enterDuration:l,exitDuration:c,enterMountDelay:d,style:a,ref:t,children:S},S.key))})},aGe="_Button_1864l_1",oGe="_ButtonInner_1864l_4",lGe="_ButtonLoader_1864l_749",YD={Button:aGe,ButtonInner:oGe,ButtonLoader:lGe},zt=e=>{const{type:t="button",color:n="primary",variant:i="solid",pill:r=!0,uniform:s=!1,size:a="md",iconSize:l,gutterSize:c,loading:u,selected:d,block:f,opticallyAlign:h,children:p,className:g,onClick:b,disabled:v,disabledTone:y,inert:x=u,...O}=e,w=v||x,k=m.useCallback(S=>{v||b==null||b(S)},[b,v]);return o.jsxs("button",{type:t,className:pi(YD.Button,g),"data-color":n,"data-variant":i,"data-pill":r?"":void 0,"data-uniform":s?"":void 0,"data-size":a,"data-gutter-size":c,"data-icon-size":l,"data-loading":u?"":void 0,"data-selected":d?"":void 0,"data-block":f?"":void 0,"data-optically-align":h,onPointerEnter:o7,disabled:w,"aria-disabled":w,tabIndex:w?-1:void 0,"data-disabled":v?"":void 0,"data-disabled-tone":v?y:void 0,onClick:k,...O,children:[o.jsx(Lx,{className:YD.ButtonLoader,enterDuration:250,exitDuration:150,children:u&&o.jsx(Hk,{},"loader")}),o.jsx("span",{className:YD.ButtonInner,children:s7(p)})]})},cGe=()=>{var e;return typeof ClipboardItem<"u"&&!!((e=navigator.clipboard)!=null&&e.write)};function uGe(e){const{"text/plain":t,...n}=e;return new ClipboardItem({...n,...t?{"text/plain":new Blob([t],{type:"text/plain"})}:null})}async function dGe(e,t=document.body){if(typeof e=="string")return uG(e,t);try{return cGe()?(await navigator.clipboard.write([uGe(e)]),!0):e["text/plain"]?uG(e["text/plain"],t):!1}catch{return!1}}async function uG(e,t=document.body){if(navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}const n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.top="0",n.style.left="0",n.style.opacity="0",t.appendChild(n),n.focus(),n.select();let i=!1;try{i=document.execCommand("copy")}catch{}return t.removeChild(n),i}const fGe="_TransitionItem_1o7b1_1",hGe={TransitionItem:fGe},pGe=e=>{const{as:t="span",className:n,children:i,preventInitialTransition:r,insertMethod:s,transitionClassName:a,transitionPosition:l="absolute"}=e,{enterTotalDuration:c,exitTotalDuration:u,variables:d}=vGe(e);return o.jsx(t,{className:pi("block",l==="absolute"&&"relative",n),"data-transition-position":l,style:d,children:o.jsx(Lx,{as:t,className:pi(hGe.TransitionItem,a),enterDuration:c,exitDuration:u,insertMethod:s,preventInitialTransition:r,children:i})})},mGe=400,gGe=500,bGe=200,yGe=300;function vGe({initial:e,enter:t,exit:n,forceCompositeLayer:i}){const r=LD(e),s=LD(t),a=LD(n),l=[r,a,s].some(b=>b!=="none"),c=(t==null?void 0:t.duration)??(l?gGe:mGe),u=(t==null?void 0:t.timingFunction)??(l?"var(--cubic-enter)":"ease"),d=(n==null?void 0:n.duration)??(l?yGe:bGe),f=(n==null?void 0:n.timingFunction)??(l?"var(--cubic-exit)":"ease"),h=Wb({"tg-will-change":i?"transform, opacity":"auto","tg-enter-opacity":MD((t==null?void 0:t.opacity)??1),"tg-enter-transform":s,"tg-enter-filter":$D(t),"tg-enter-duration":tT(c),"tg-enter-delay":tT((t==null?void 0:t.delay)??0),"tg-enter-timing-function":u,"tg-exit-opacity":MD((n==null?void 0:n.opacity)??0),"tg-exit-transform":a,"tg-exit-filter":$D(n),"tg-exit-duration":tT(d),"tg-exit-delay":tT((n==null?void 0:n.delay)??0),"tg-exit-timing-function":f,"tg-initial-opacity":MD((e==null?void 0:e.opacity)??(n==null?void 0:n.opacity)??0),"tg-initial-transform":r==="none"?a:r,"tg-initial-filter":$D(e??n??{})}),p=((t==null?void 0:t.delay)??0)+c,g=((n==null?void 0:n.delay)??0)+d;return{enterTotalDuration:p,exitTotalDuration:g,variables:h}}const K7=({children:e,copyValue:t,onClick:n,...i})=>{const[r,s]=m.useState(!1),a=m.useRef(null),l=c=>{r||(s(!0),n==null||n(c),dGe(typeof t=="function"?t():t),a.current=window.setTimeout(()=>{s(!1)},1300))};return m.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]),o.jsxs(zt,{...i,onClick:l,children:[o.jsx(pGe,{className:"w-[var(--button-icon-size)] h-[var(--button-icon-size)]",initial:{scale:.6},enter:{scale:1,delay:150,duration:300},exit:{scale:.6,duration:150},forceCompositeLayer:!0,children:r?o.jsx(Lv,{},"copied-icon"):o.jsx(IF,{},"copy-icon")}),typeof e=="function"?e({copied:r}):e]})},xGe="_Menu_1t4b0_1",wGe="_MenuList_1t4b0_3",OGe="_MenuItemContent_1t4b0_53",SGe="_MenuItem_1t4b0_53",kGe="_ItemActions_1t4b0_98",EGe="_PressableInner_1t4b0_117",CGe="_Separator_1t4b0_135",TGe="_SubMenuItem_1t4b0_139",AGe="_SubTriggerIcon_1t4b0_141",_Ge="_RadioItem_1t4b0_151",NGe="_RadioIndicatorActive_1t4b0_158",jGe="_RadioIndicator_1t4b0_158",RGe="_CheckboxItem_1t4b0_249",IGe="_CheckboxIndicator_1t4b0_256",PGe="_CheckboxCircle_1t4b0_269",Wr={Menu:xGe,MenuList:wGe,MenuItemContent:OGe,MenuItem:SGe,ItemActions:kGe,PressableInner:EGe,Separator:CGe,SubMenuItem:TGe,SubTriggerIcon:AGe,RadioItem:_Ge,RadioIndicatorActive:NGe,RadioIndicator:jGe,CheckboxItem:RGe,CheckboxIndicator:IGe,CheckboxCircle:PGe},Uxe=m.createContext(null),Jk=()=>{const e=m.useContext(Uxe);if(!e)throw new Error("Menu components must be wrapped in ");return e},vr=({children:e,forceOpen:t,onOpen:n,onClose:i,modal:r=!1})=>{const[s,a]=m.useState(!1),l=t??s,c=xm(n),u=xm(i),d=m.useCallback(h=>{var p,g;a(h),h?(p=c.current)==null||p.call(c):(g=u.current)==null||g.call(u)},[c,u]);Yk(s,()=>{d(!1)});const f=m.useMemo(()=>({open:l,setOpen:d}),[l,d]);return o.jsx(Uxe.Provider,{value:f,children:o.jsx(wqe,{open:l,onOpenChange:d,modal:r,children:e})})},DGe=({className:e,children:t,disabled:n,onSelect:i,onClick:r})=>{const{open:s}=Jk(),a=l=>{s||l.preventDefault()};return i?o.jsx(oxe,{className:pi(Wr.MenuItem,e),onSelect:i,onClick:r,disabled:n,onPointerMove:a,onPointerLeave:a,children:o.jsx("div",{className:Wr.PressableInner,children:t})}):o.jsx("div",{className:pi(Wr.MenuItemContent,e),children:t})},MGe=({className:e,children:t})=>o.jsx("div",{className:pi(Wr.ItemActions,e),children:t}),LGe=({children:e,onClick:t})=>{const{setOpen:n}=Jk();return o.jsx(zt,{className:"rounded-sm",color:"secondary",size:"xs",uniform:!0,iconSize:"sm",variant:"ghost",onClick:i=>{i.stopPropagation(),n(!1),t(i)},children:e})},$Ge=e=>{const{className:t,children:n,href:i,to:r,disabled:s,as:a,...l}=e,{open:c}=Jk(),u=i||r,d=u?/^https?:\/\//.test(u):!0,f=Fxe(),h=a||(d?"a":f),p=b=>{c||b.preventDefault()},g=d?{target:"_blank",rel:"noopener noreferrer",href:i??r}:{href:i,to:r};return o.jsx(oxe,{asChild:!0,className:pi(Wr.MenuItem,t),disabled:s,onPointerMove:d?void 0:p,onPointerLeave:d?void 0:p,children:o.jsx(h,{...g,...l,children:o.jsx("span",{className:Wr.PressableInner,children:n})})})},FGe=({className:e})=>o.jsx(Tqe,{className:pi(Wr.Separator,e),role:"separator"}),BGe=({children:e,side:t,sideOffset:n=5,align:i,alignOffset:r,width:s,minWidth:a,maxHeight:l})=>{const{open:c}=Jk();return o.jsx(axe,{forceMount:!0,children:o.jsx(Lx,{className:Wr.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:c&&o.jsx(Sqe,{forceMount:!0,className:Wr.MenuList,side:t,sideOffset:n,align:i,alignOffset:r??(i==="center"?0:-5),avoidCollisions:!0,collisionPadding:{bottom:30,top:30,left:12,right:12},onEscapeKeyDown:ih,style:Wb({"menu-width":s,"menu-min-width":a,"menu-max-height":l}),children:e},"dropdown")})})},UGe=({children:e,disabled:t})=>o.jsx(Oqe,{asChild:!0,disabled:t,children:e}),Qxe=m.createContext(null),zxe=()=>{const e=m.useContext(Qxe);if(!e)throw new Error("Submenu components must be wrapped in ");return e},QGe=({children:e,forceOpen:t,onOpen:n,onClose:i})=>{const[r,s]=m.useState(!1),a=m.useRef(null),l=t??r,c=xm(n),u=xm(i),d=m.useCallback(h=>{var p,g;s(h),h?(p=c.current)==null||p.call(c):(g=u.current)==null||g.call(u)},[c,u]);Yk(r,()=>{var h;d(!1),(h=a.current)==null||h.focus()});const f=m.useMemo(()=>({open:l,setOpen:d,triggerRef:a}),[l,d]);return o.jsx(Qxe.Provider,{value:f,children:o.jsx(Aqe,{open:l,onOpenChange:d,children:e})})},zGe=({className:e,children:t,disabled:n})=>{const{open:i}=Jk(),{triggerRef:r}=zxe(),s=a=>{i||a.preventDefault()};return o.jsx(_qe,{ref:r,className:pi(Wr.MenuItem,Wr.SubMenuItem,e),disabled:n,onPointerMove:s,onPointerLeave:s,children:o.jsxs("div",{className:Wr.PressableInner,children:[t,o.jsx(PFe,{width:"16",height:"16",className:Wr.SubTriggerIcon})]})})},VGe=({children:e,sideOffset:t=4,alignOffset:n=-6,width:i="auto",minWidth:r="auto",maxHeight:s})=>{const{open:a}=zxe();return o.jsx(axe,{forceMount:!0,children:o.jsx(Lx,{className:Wr.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:a&&o.jsx(Nqe,{className:Wr.MenuList,sideOffset:t,alignOffset:n,avoidCollisions:!0,collisionPadding:{bottom:30,top:30,left:12,right:12},onEscapeKeyDown:ih,style:Wb({"menu-width":i,"menu-min-width":r,"menu-max-height":s}),children:e},"submenu")})})},HGe=({children:e,value:t,onChange:n,indicatorPosition:i="end",...r})=>o.jsx(Eqe,{...r,value:t,onValueChange:s=>n(s),"data-indicator-position":i,children:e}),qGe=({className:e,children:t,...n})=>o.jsx(Cqe,{className:pi(Wr.MenuItem,Wr.RadioItem,e),...n,children:o.jsxs("div",{className:Wr.PressableInner,children:[o.jsx("div",{className:Wr.RadioIndicator,children:o.jsx(lxe,{className:Wr.RadioIndicatorActive})}),t]})}),WGe=({className:e,children:t,indicatorPosition:n="end",indicatorVariant:i="solid",...r})=>o.jsx(kqe,{className:pi(Wr.MenuItem,Wr.CheckboxItem,e),...r,"data-indicator-position":n,"data-indicator-variant":i,children:o.jsxs("div",{className:Wr.PressableInner,children:[o.jsx("div",{className:Wr.CheckboxIndicator,children:o.jsx(lxe,{children:i==="ghost"?o.jsx(Lv,{className:"size-4"}):o.jsx("div",{className:Wr.CheckboxCircle,children:o.jsx(Lv,{className:"size-4"})})})}),t]})});vr.Content=BGe;vr.Item=DGe;vr.ItemActions=MGe;vr.ItemAction=LGe;vr.Link=$Ge;vr.Separator=FGe;vr.Trigger=UGe;vr.Sub=QGe;vr.SubTrigger=zGe;vr.SubContent=VGe;vr.CheckboxItem=WGe;vr.RadioGroup=HGe;vr.RadioItem=qGe;const GGe="_Tooltip_16g2y_1",KGe="_TriggerDecorator_16g2y_73",Vxe={Tooltip:GGe,TriggerDecorator:KGe},Uo=e=>{const{ref:t,children:n,content:i,forceOpen:r=i===null?!1:void 0,maxWidth:s=300,openDelay:a=150,interactive:l=!1,compact:c=!1,preventUnintentionalClickToClose:u,align:d,alignOffset:f=0,side:h,sideOffset:p=5,gutterSize:g="md",contentClassName:b,onPointerDown:v,onClick:y,...x}=e,[O,w]=m.useState(!1),[k,S]=m.useState(!1);a7(()=>S(!1),k?400:null);const E=r??O,C=_=>{typeof r!="boolean"&&(w(_),u&&S(_))},N=_=>{u&&k&&(_.preventDefault(),_.stopPropagation())};return o.jsxs(Hxe,{open:E,delayDuration:a,onOpenChange:C,disableHoverableContent:!l,children:[o.jsx(Lxe,{asChild:!0,children:o.jsx(_ye,{...x,ref:t,onPointerDown:_=>{N(_),v==null||v(_)},onClick:_=>{N(_),y==null||y(_)},children:n})}),o.jsx(qxe,{maxWidth:s,compact:c,align:d,alignOffset:f,side:h,sideOffset:p,gutterSize:g,className:b,children:i})]})},Hxe=({children:e,open:t,onOpenChange:n,...i})=>(Yk(t,()=>{n(!1)}),o.jsx(VWe,{children:o.jsx(HWe,{open:t,onOpenChange:n,...i,children:e})})),qxe=({children:e,maxWidth:t=300,compact:n=!1,clickable:i=void 0,alignOffset:r=0,sideOffset:s=5,gutterSize:a="md",className:l,style:c,...u})=>o.jsx(qWe,{children:o.jsx(WWe,{...u,className:pi(Vxe.Tooltip,l),"data-compact":n,"data-clickable":i,"data-gutter-size":a,alignOffset:r,sideOffset:s,collisionPadding:15,hideWhenDetached:!0,style:{...c,maxWidth:t},onEscapeKeyDown:ih,children:e})}),XGe=({children:e,asChild:t=!0,...n})=>o.jsx(Lxe,{asChild:t,...n,children:e}),YGe=e=>{const{children:t,className:n,focusable:i=!0,ref:r,...s}=e,a=typeof t=="string";return o.jsx(_ye,{ref:r,...s,className:pi(Vxe.TriggerDecorator,n),tabIndex:i?0:void 0,children:a?o.jsx("span",{children:t}):t})};Uo.Root=Hxe;Uo.Content=qxe;Uo.Trigger=XGe;Uo.TriggerDecorator=YGe;const ZGe=50,dG=48;function JGe(e){return(e.events??[]).flatMap(t=>{var r,s;const i=(((r=t.content)==null?void 0:r.parts)??[]).map(a=>typeof a.text=="string"?a.text:"").filter(Boolean).join("");return i?[{text:i,role:t.author??((s=t.content)==null?void 0:s.role)??"",ts:t.timestamp}]:[]})}function eKe(e){var t,n;for(const i of e.events??[])if(i.author==="user"||((t=i.content)==null?void 0:t.role)==="user"){const r=(((n=i.content)==null?void 0:n.parts)??[]).map(s=>s.text).find(Boolean);if(r)return r}return V("search.untitledSession")}function tKe(e,t,n){const i=Math.max(0,t-dG),r=Math.min(e.length,t+n+dG);return(i>0?"…":"")+e.slice(i,r).trim()+(r{var c;if((c=l.events)!=null&&c.length)return l;try{return await iR(t,e,l.id)}catch{return l}})),a=[];for(const l of s)for(const{text:c,role:u,ts:d}of JGe(l)){const f=c.toLowerCase().indexOf(i);if(f!==-1){a.push({type:"session",appId:t,sessionId:l.id,title:eKe(l),snippet:tKe(c,f,i.length),role:u,ts:d??l.lastUpdateTime});break}}return a.sort((l,c)=>(c.ts??0)-(l.ts??0)),a.slice(0,ZGe)}async function iKe(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await r0e(e,t.trim())}catch(a){const l=String(a);return{results:[],note:l.includes("404")?V("search.webUnavailable"):V("search.webFailed",{message:l})}}const{mounted:i,results:r,error:s}=n;return i?s?{results:[],note:s}:{results:r.map((a,l)=>({type:"web",index:l,title:a.title,url:a.url,siteName:a.siteName,summary:a.summary}))}:{results:[],note:V("search.webNotMounted")}}async function rKe(e,t,n,i){if(!t||!i.trim())return{results:[]};const r=await i0e(t,e,i.trim(),n);if(!r.mounted)return{results:[],note:V(e==="knowledge"?"search.knowledgeNotMounted":"search.memoryNotMounted")};if(r.error)return{results:[],note:r.error};const s=r.sourceName??V(e==="knowledge"?"search.knowledge":"search.longTermMemory");return{results:r.results.map((a,l)=>e==="knowledge"?{type:"knowledge",index:l,content:a.content,sourceName:s,sourceType:r.sourceType}:{type:"memory",index:l,content:a.content,sourceName:s,sourceType:r.sourceType,author:a.author,ts:a.timestamp})}}async function sKe(e,t,n){return e==="session"?{results:await nKe(n.userId,n.appId,t)}:e==="web"?iKe(n.appId,t):rKe(e,n.appId,n.userId,t)}function Wxe({mirrored:e=!1}){return o.jsxs("g",{opacity:"0.5",transform:e?"translate(20 0) scale(-1 1)":void 0,children:[o.jsx("path",{className:"sidebar-panel-glyph__divider",d:"M5.938 6.833c.11 0 .249.102.249.292v6.042c0 .19-.14.291-.249.291s-.248-.101-.248-.291V7.125c0-.19.139-.292.248-.292Z",strokeWidth:"1.167"}),o.jsx("path",{className:"sidebar-panel-glyph__frame",d:"M14.5 3.75h-9a3 3 0 0 0-3 3v6.857a3 3 0 0 0 3 3h9a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3Z",strokeWidth:"1.667",strokeLinecap:"round",strokeLinejoin:"round"})]})}function aKe(e){return o.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:o.jsx(Wxe,{})})}function oKe(e){return o.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:o.jsx(Wxe,{mirrored:!0})})}function lKe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M12 8.333c.368 0 .667.299.667.667v2h2a.667.667 0 0 1 0 1.333h-2v2a.667.667 0 0 1-1.334 0v-2h-2a.667.667 0 0 1 0-1.333h2V9c0-.368.299-.667.667-.667ZM7.667 1c3.49 0 6.383 2.554 6.913 5.896a.667.667 0 0 1-1.317.208 5.667 5.667 0 1 0-9.708 4.424.67.67 0 0 1 .07.12.667.667 0 0 1-.13.834l-.95.853 4.788-.002a.667.667 0 0 1 0 1.334l-5.657.002c-.917 0-1.35-1.131-.67-1.744l1.163-1.045A6.97 6.97 0 0 1 .667 8c0-3.866 3.134-7 7-7Z",fill:"currentColor"})})}function cKe(e){return o.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"7.333",cy:"7.333",r:"5.333"}),o.jsx("path",{d:"m11.133 11.133 2.867 2.867"})]})}function uKe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M8 0.667c4.05 0 7.334 3.283 7.334 7.333 0 4.05-3.284 7.334-7.334 7.334S0.667 12.05 0.667 8 3.95 0.667 8 0.667Zm0 1.333a6 6 0 1 0 0 12A6 6 0 0 0 8 2ZM6.167 6c.368 0 .667.299.667.667v2a.667.667 0 0 1-1.334 0v-2c0-.368.299-.667.667-.667Zm3.666 0c.368 0 .667.299.667.667v2a.667.667 0 0 1-1.333 0v-2c0-.368.298-.667.666-.667Z",fill:"currentColor"})})}function Gxe(e){return o.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M7.58 2.6a.667.667 0 0 0-.667-.667h-.666a.667.667 0 0 0-.667.667v10.667c0 .368.299.666.667.666h.666a.667.667 0 0 0 .667-.666V2.6Zm1.333 10.667A2 2 0 0 1 6.913 15.267h-.666a2 2 0 0 1-2-2V2.6a2 2 0 0 1 2-2h.666a2 2 0 0 1 2 2v10.667Z",fill:"currentColor"}),o.jsx("path",{d:"M11.88 5.045a.667.667 0 0 0-.801-.514l-.653.136a.667.667 0 0 0-.504.786l1.85 8.092c.081.358.44.589.8.514l.653-.137a.667.667 0 0 0 .504-.786L11.88 5.045Zm3.155 7.82a2 2 0 0 1-1.512 2.358l-.653.136a2 2 0 0 1-2.403-1.541L8.617 5.726a2 2 0 0 1 1.513-2.358l.652-.136a2 2 0 0 1 2.404 1.541l1.849 8.092Z",fill:"currentColor"}),o.jsx("path",{d:"M4.247 2.6a.667.667 0 0 0-.667-.667h-.667a.667.667 0 0 0-.666.667v10.667c0 .368.298.666.666.666h.667a.667.667 0 0 0 .667-.666V2.6ZM5.58 13.267a2 2 0 0 1-2 2h-.667a2 2 0 0 1-2-2V2.6a2 2 0 0 1 2-2h.667a2 2 0 0 1 2 2v10.667Z",fill:"currentColor"})]})}function dKe({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 fKe({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 hKe({active:e=!1,onClick:t}){const{t:n}=Ae("workspaceTools");return o.jsxs("button",{className:`new-chat${e?" is-active":""}`,onClick:t,"aria-label":n("search.nav"),"aria-current":e?"page":void 0,title:n("search.nav"),children:[o.jsx(cKe,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:n("search.nav")})]})}function pKe(e,t,n,i){const r=!!e,s=new Set((t==null?void 0:t.searchSources)??[]),a=l=>r?n?i("search.checkingCapabilities"):i("search.notMounted",{label:l}):i("search.selectAgent");return[{id:"session",label:i("search.sources.session"),ready:r,unavailableLabel:i("search.selectAgent")},{id:"web",label:i("search.sources.web"),ready:r&&s.has("web"),description:i("search.webDescription"),unavailableLabel:a(" web_search")},{id:"knowledge",label:i("search.sources.knowledge"),ready:r&&s.has("knowledge"),unavailableLabel:a(i("search.sources.knowledge"))},{id:"memory",label:i("search.sources.memory"),ready:r&&s.has("memory"),unavailableLabel:a(i("search.sources.memory"))}]}function V_(e,t){return{context_search:"Context Search",local:t("search.backendLocal"),mem0:"Mem0",milvus:"Milvus",opensearch:"OpenSearch",openviking:"OpenViking",redis:"Redis",tos_vector:"TOS Vector",viking:"VikingDB"}[e.toLowerCase()]??e}function fG(e,t){return e?new Date(e*1e3).toLocaleString(t,{timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):""}function mKe({userId:e,appId:t,agentInfo:n,capabilitiesLoading:i,agentLabel:r,onOpenSession:s}){var M,U;const{t:a,i18n:l}=Ae("workspaceTools"),c=l.resolvedLanguage||l.language,[u,d]=m.useState("session"),[f,h]=m.useState(""),[p,g]=m.useState([]),[b,v]=m.useState(),[y,x]=m.useState(!1),[O,w]=m.useState(!1),[k,S]=m.useState(!1),E=m.useRef(0),C=m.useRef(null),N=pKe(t,n,i,a),_=N.find(I=>I.id===u),j=u==="knowledge"?(M=n==null?void 0:n.components)==null?void 0:M.find(I=>I.source==="knowledgebase"||I.kind==="knowledgebase"):u==="memory"?(U=n==null?void 0:n.components)==null?void 0:U.find(I=>I.source==="long_term_memory"||I.kind==="memory"):void 0;m.useEffect(()=>{E.current+=1,d("session"),g([]),v(void 0),w(!1),x(!1),S(!1)},[t]),m.useEffect(()=>{if(!k)return;function I(H){var K;(K=C.current)!=null&&K.contains(H.target)||S(!1)}return document.addEventListener("pointerdown",I),()=>document.removeEventListener("pointerdown",I)},[k]);async function A(I,H){var B;const K=I.trim();if(!K||!((B=N.find(ee=>ee.id===H))!=null&&B.ready))return;const Q=++E.current;x(!0),w(!0);let q;try{q=await sKe(H,K,{userId:e,appId:t})}catch(ee){const le=ee instanceof Error?ee.message:String(ee);q={results:[],note:a("search.failed",{message:le})}}Q===E.current&&(g(q.results),v(q.note),x(!1))}function F(I){E.current+=1,h(I),g([]),v(void 0),w(!1),x(!1)}function T(I){E.current+=1,d(I),S(!1),g([]),v(void 0),w(!1),x(!1)}const P=!!(_!=null&&_.ready),R=t?u==="web"?a("search.placeholder.web"):u==="knowledge"?a("search.placeholder.knowledge",{name:(j==null?void 0:j.name)??a("search.placeholder.knowledgeFallback")}):u==="memory"?a("search.placeholder.memory",{name:(j==null?void 0:j.name)??a("search.placeholder.memoryFallback")}):a("search.placeholder.session"):a("search.placeholder.selectAgent"),L=j!=null&&j.backend?V_(j.backend,a):"";return o.jsxs("div",{className:"search",children:[o.jsxs("div",{className:"search-box",children:[o.jsxs("div",{className:"search-source-picker-wrap",ref:C,children:[o.jsxs("button",{className:"search-source-picker",type:"button","aria-label":a("search.sourceTypeAria",{label:(_==null?void 0:_.label)??a("search.notSelected")}),"aria-haspopup":"listbox","aria-expanded":k,onClick:()=>S(I=>!I),children:[o.jsx("span",{children:(_==null?void 0:_.label)??a("search.sourceType")}),L&&o.jsx("small",{children:L}),o.jsx(fKe,{open:k})]}),k&&o.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":a("search.selectSource"),children:N.map(I=>{var Q,q;const H=I.id==="knowledge"?(Q=n==null?void 0:n.components)==null?void 0:Q.find(B=>B.source==="knowledgebase"||B.kind==="knowledgebase"):I.id==="memory"?(q=n==null?void 0:n.components)==null?void 0:q.find(B=>B.source==="long_term_memory"||B.kind==="memory"):void 0,K=H?[H.name,H.backend?V_(H.backend,a):""].filter(Boolean).join(" · "):I.ready?I.description:I.unavailableLabel;return o.jsxs("button",{type:"button",role:"option","aria-selected":u===I.id,disabled:!I.ready,onClick:()=>T(I.id),children:[o.jsx("span",{children:I.label}),K&&o.jsx("small",{children:K})]},I.id)})})]}),o.jsx("span",{className:"search-box-divider","aria-hidden":!0}),o.jsx("input",{className:"search-input",value:f,onChange:I=>F(I.target.value),onKeyDown:I=>{I.key==="Enter"&&(I.preventDefault(),A(f,u))},placeholder:R,disabled:!P,autoFocus:!0}),o.jsx("button",{className:"search-go",onClick:()=>void A(f,u),disabled:!f.trim()||y,"aria-label":a("search.nav"),children:y?o.jsx(fi,{className:"icon spin"}):o.jsx(dKe,{className:"icon"})})]}),o.jsx("div",{className:"search-results",children:P?O?y?null:b?o.jsx("div",{className:"search-empty",children:b}):p.length===0&&O?o.jsx("div",{className:"search-empty",children:a("search.noResults",{query:f.trim()})}):p.map((I,H)=>o.jsx(gKe,{result:I,agentLabel:r,onOpen:s,locale:c},H)):o.jsx("div",{className:"search-empty",children:a(u==="web"?"search.instructions.web":u==="knowledge"?"search.instructions.knowledge":u==="memory"?"search.instructions.memory":"search.instructions.session")}):o.jsx("div",{className:"search-empty",children:t?i?a("search.loadingCapabilities"):(_==null?void 0:_.unavailableLabel)??a("search.sourceUnavailable"):a("search.noAgentHint")})})]})}function gKe({result:e,agentLabel:t,onOpen:n,locale:i}){const{t:r}=Ae("workspaceTools");switch(e.type){case"session":return o.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[o.jsx(Tbe,{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?` · ${fG(e.ts,i)}`:""]})]}),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(Zj,{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(gb,{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(hG,{source:"knowledge"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:r("search.knowledgeFragment",{index:e.index+1})}),o.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${V_(e.sourceType,r)}`:""]})]}),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(hG,{source:"memory"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:r("search.memoryFragment",{index:e.index+1})}),o.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${V_(e.sourceType,r)}`:"",e.ts?` · ${fG(e.ts,i)}`:""]})]}),o.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function hG({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"})]})}function bKe({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 yKe({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 Kxe(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.25 4.25h9.5a2.5 2.5 0 0 1 2.5 2.5v3.5"}),o.jsx("path",{d:"M13.25 17.75h-8a2.5 2.5 0 0 1-2.5-2.5v-8a3 3 0 0 1 3-3"}),o.jsx("path",{d:"M7 8.25h5.5M7 11.75h3.25"}),o.jsx("path",{d:"m13.35 16.65.42-2.16 4.76-4.76a1.35 1.35 0 0 1 1.91 1.91l-4.76 4.76-2.33.25Z"}),o.jsx("path",{d:"m17.65 10.6 1.9 1.9"})]})}const ER="/assets/media/logo-DCsNZy-k.svg",X7="data:image/svg+xml,%3csvg%20width='28'%20height='23'%20viewBox='0%200%2028%2023'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.1957%209.44218C17.0253%209.58161%2016.7774%209.47317%2016.7774%209.24079V8.01696V0.611967C16.7774%200.395085%2016.514%200.271152%2016.3591%200.410576L6.04172%209.16334C5.87132%209.30276%205.62345%209.19432%205.62345%208.96194V2.98218C5.62345%202.81178%205.48403%202.67235%205.31362%202.67235H0.309832C0.139424%202.67235%200%202.81178%200%202.98218V21.7115C0%2021.9284%200.263357%2022.0524%200.418273%2021.9129L10.7202%2013.1602C10.8906%2013.0207%2011.1385%2013.1292%2011.1385%2013.3616V22.0059C11.1385%2022.2228%2011.4018%2022.3467%2011.5567%2022.2073L21.8586%2013.4545C22.0291%2013.3151%2022.2769%2013.4235%2022.2769%2013.6559V19.6357C22.2769%2019.8061%2022.4163%2019.9455%2022.5868%2019.9455H27.5905C27.7609%2019.9455%2027.9004%2019.8061%2027.9004%2019.6357V0.890816C27.9004%200.673934%2027.637%200.550001%2027.4821%200.689425L17.1957%209.44218Z'%20fill='%230066FC'/%3e%3c/svg%3e",pG="(max-width: 860px)";function mG({title:e}){const t=m.useRef(null),n=m.useRef(null),[i,r]=m.useState(0);m.useLayoutEffect(()=>{const l=t.current,c=n.current;if(!l||!c)return;const u=()=>{const f=Math.max(0,Math.ceil(c.scrollWidth-l.clientWidth));r(h=>h===f?h:f)};u();const d=new ResizeObserver(u);return d.observe(l),d.observe(c),()=>d.disconnect()},[e]);const s=Math.min(12,Math.max(4.8,3.6+i/36)),a={"--history-title-translate":`-${i}px`,"--history-title-duration":`${s.toFixed(2)}s`};return o.jsx("span",{ref:t,className:`history-title${i>0?" is-overflowing":""}`,style:a,children:o.jsx("span",{ref:n,className:"history-title-text",children:e})})}function vKe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"7",cy:"7",r:"2.25"}),o.jsx("circle",{cx:"17",cy:"7",r:"2.25"}),o.jsx("circle",{cx:"7",cy:"17",r:"2.25"}),o.jsx("circle",{cx:"17",cy:"17",r:"2.25"})]})}function xKe(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:"12",cy:"12",r:"8.25"}),o.jsx("path",{d:"M3.75 12h16.5M12 3.75c2.1 2.2 3.2 4.95 3.2 8.25S14.1 18.05 12 20.25M12 3.75C9.9 5.95 8.8 8.7 8.8 12s1.1 6.05 3.2 8.25"})]})}function wKe(e){let t=2166136261;for(const i of e)t^=i.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 OKe={admin:"account.roles.admin",developer:"account.roles.developer",user:"account.roles.user"};function SKe({activePage:e,access:t,userInfo:n,onAgentKitCli:i,onDeveloperResources:r,onSystemInfo:s,onIssueFeedback:a,onLogout:l}){const{t:c,i18n:u}=Ae(["sidebar","common"]),[d,f]=m.useState("");if(!n)return null;const h=G7e(n)||c("sidebar:account.defaultUser"),p=typeof n.email=="string"?n.email.trim():"",g=wKe(h),b=K7e(n),v=b===d?"":b,y=wj(u.resolvedLanguage??u.language)??xj;return o.jsx("div",{className:"sidebar-user",children:o.jsxs("div",{className:"sidebar-user-row",children:[o.jsxs(vr,{modal:!0,children:[o.jsx(vr.Trigger,{children:o.jsxs("button",{type:"button",className:"sidebar-user-btn",title:h,children:[o.jsx("span",{className:`account-avatar${v?" has-image":""}`,style:g,"aria-hidden":"true",children:v?o.jsx("img",{className:"account-avatar-image",src:v,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>f(v)}):null}),o.jsx("span",{className:"sidebar-user-identity",children:o.jsx("span",{className:"sidebar-user-name",children:h})})]})}),o.jsxs(vr.Content,{side:"top",align:"start",sideOffset:4,minWidth:216,children:[o.jsxs("div",{className:"account-menu-head",children:[o.jsx("span",{className:`account-avatar account-avatar--lg${v?" has-image":""}`,style:g,"aria-hidden":"true",children:v?o.jsx("img",{className:"account-avatar-image",src:v,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>f(v)}):null}),o.jsxs("div",{className:"account-id",children:[o.jsxs("div",{className:"account-name-row",children:[o.jsx("div",{className:"account-name",children:h}),o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",pill:!0,children:c(`sidebar:${OKe[t.role]}`)})]}),p&&p!==h&&o.jsx("div",{className:"account-sub",children:p})]})]}),o.jsxs(vr.Item,{className:"account-menu-action",onSelect:s,children:[o.jsx(Wd,{className:"icon","aria-hidden":"true"}),c("sidebar:account.systemInfo")]}),o.jsxs(vr.Sub,{children:[o.jsx(vr.SubTrigger,{className:"account-menu-action",children:o.jsxs("span",{className:"account-menu-action__label",children:[o.jsx(xKe,{className:"icon"}),c("sidebar:account.language")]})}),o.jsx(vr.SubContent,{sideOffset:6,minWidth:136,children:o.jsx(vr.RadioGroup,{value:y,onChange:x=>{sLe(x)},indicatorPosition:"end",children:G8.map(x=>o.jsx(vr.RadioItem,{value:x,children:c(`common:languageNames.${x}`)},x))})})]}),o.jsxs(vr.Item,{className:"account-menu-action",onSelect:a,children:[o.jsx(Kxe,{className:"icon"}),c("sidebar:account.issueFeedback")]}),o.jsxs(vr.Item,{className:"account-menu-action",onSelect:l,children:[o.jsx(E7e,{className:"icon","aria-hidden":"true"}),c("sidebar:account.logout")]})]})]}),o.jsxs("div",{className:"sidebar-user-shortcuts","aria-label":c("sidebar:account.shortcuts"),children:[o.jsx(Uo,{compact:!0,content:c("sidebar:account.tryCli"),children:o.jsx("button",{type:"button",className:"sidebar-user-shortcut",onClick:i,"aria-label":c("sidebar:account.tryCli"),children:o.jsx(zFe,{className:"icon"})})}),o.jsx(Uo,{compact:!0,content:c("sidebar:account.developerResources"),children:o.jsx("button",{type:"button",className:`sidebar-user-shortcut${e==="developer-resources"?" is-active":""}`,onClick:r,"aria-label":c("sidebar:account.developerResources"),"aria-current":e==="developer-resources"?"page":void 0,children:o.jsx(jFe,{className:"icon"})})})]})]})})}function kKe({branding:e,cloudProvider:t,sessions:n,currentSessionId:i,activePage:r,features:s,access:a,streamingSids:l,evaluatingSids:c,sandboxHistory:u,onNewChat:d,onSearch:f,onQuickCreate:h,onLibrary:p,onAddAgent:g,onMyAgents:b,onWorkspace:v,onApplications:y,onCronJobs:x,onAgentKitCli:O,onDeveloperResources:w,onSystemInfo:k,onIssueFeedback:S,onPickSession:E,onDeleteSession:C,userInfo:N,onLogout:_}){const{t:j}=Ae("sidebar"),A=H=>(s==null?void 0:s[H])!==!1,[F,T]=m.useState(null),P=m.useRef(typeof window<"u"&&window.matchMedia(pG).matches),[R,L]=m.useState(P.current),M=n.map(H=>({id:H.id,title:cR(H.events,j("history.newConversation")),createdAt:(H.lastUpdateTime??0)*1e3})).sort((H,K)=>K.createdAt-H.createdAt),U=()=>{P.current=!1,L(H=>!H),T(null)};m.useEffect(()=>{const H=window.matchMedia(pG),K=Q=>{Q.matches?L(q=>q||(P.current=!0,!0)):P.current&&(P.current=!1,L(!1))};return H.addEventListener("change",K),()=>H.removeEventListener("change",K)},[]);const I=t==="byteplus"?X7:ER;return o.jsxs("aside",{className:`sidebar ${R?"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:d,"aria-label":j("navigation.home"),title:j("navigation.home"),children:[o.jsx("img",{className:"brand-logo",src:e.logoUrl||I,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:U,"aria-label":j(R?"navigation.expand":"navigation.collapse"),title:j(R?"navigation.expand":"navigation.collapse"),children:R?o.jsx(oKe,{className:"icon"}):o.jsx(aKe,{className:"icon"})})]}),o.jsxs("nav",{className:"sidebar-nav","aria-label":j("navigation.label"),children:[A("newChat")&&o.jsxs("button",{className:`new-chat new-chat--conversation${r==="new-chat"?" is-active":""}`,onClick:d,"aria-label":j("navigation.newChat"),"aria-current":r==="new-chat"?"page":void 0,title:j("navigation.newChat"),children:[o.jsx(lKe,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.newChat")})]}),A("search")&&o.jsx(hKe,{active:r==="search",onClick:f}),o.jsxs("button",{className:`new-chat new-chat--agents${r==="agents"?" is-active":""}`,onClick:b,"aria-label":j("navigation.agents"),"aria-current":r==="agents"?"page":void 0,title:j("navigation.agents"),children:[o.jsx(uKe,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.agents")})]}),o.jsxs("button",{className:`new-chat new-chat--workspaces${r==="workspaces"?" is-active":""}`,onClick:v,"aria-label":j("navigation.workspaces"),"aria-current":r==="workspaces"?"page":void 0,title:j("navigation.workspaces"),children:[o.jsx(s7e,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.workspaces")})]}),o.jsxs("button",{className:`new-chat new-chat--library${r==="library"?" is-active":""}`,onClick:p,"aria-label":j("navigation.library"),"aria-current":r==="library"?"page":void 0,title:j("navigation.library"),children:[o.jsx(Gxe,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.library")})]}),o.jsxs("button",{className:`new-chat new-chat--cronjobs${r==="cronjobs"?" is-active":""}`,onClick:x,"aria-label":j("navigation.cronjobs"),"aria-current":r==="cronjobs"?"page":void 0,title:j("navigation.cronjobs"),children:[o.jsx(RF,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.cronjobs")})]}),o.jsxs("button",{className:`new-chat new-chat--applications${r==="applications"?" is-active":""}`,onClick:y,"aria-label":j("navigation.automations"),"aria-current":r==="applications"?"page":void 0,title:j("navigation.automations"),children:[o.jsx(vKe,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.automations")})]})]})]}),A("history")&&o.jsxs("div",{className:"sidebar-history",children:[o.jsxs("div",{className:"history-head",children:[o.jsx("span",{children:j("history.title")}),A("newChat")&&o.jsx("button",{type:"button",className:"history-new-chat",onClick:(u==null?void 0:u.onNew)??d,disabled:u==null?void 0:u.newDisabled,"aria-label":j("history.create"),title:j("history.create"),children:o.jsx($o,{className:"icon"})})]}),o.jsx("div",{className:"history-list",children:u?o.jsxs(o.Fragment,{children:[u.loading&&u.threads.length===0?o.jsx("div",{className:"history-empty",role:"status",children:j("history.loading")}):null,u.error?o.jsx("div",{className:"history-error",role:"alert",children:u.error}):null,!u.loading&&!u.error&&u.threads.length===0?o.jsx("div",{className:"history-empty",children:j("history.empty")}):null,u.threads.map(H=>{const K=H.id===u.currentThreadId,Q=H.name||H.preview||`Thread ${H.id.slice(0,8)}`,q=H.id===u.busyThreadId;return o.jsxs("div",{className:`history-item ${K?"active":""}`,children:[o.jsxs("button",{type:"button",className:"history-item-btn",onClick:()=>u.onSelect(H.id),"aria-current":K?"page":void 0,title:Q,disabled:q,children:[o.jsx(mG,{title:Q}),K?o.jsx("span",{className:"history-current-badge",children:j("history.current")}):null]}),o.jsx("button",{type:"button",className:"history-more","aria-label":j("history.manage",{title:Q}),title:j("history.more"),disabled:q,onClick:()=>T(B=>B===H.id?null:H.id),children:o.jsx(vW,{className:"icon"})}),F===H.id?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>T(null)}),o.jsx("div",{className:"history-menu",children:o.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{T(null),u.onDelete(H)},children:[o.jsx(pm,{className:"icon"})," ",j("history.delete")]})})]}):null]},H.id)}),u.hasMore?o.jsx("button",{type:"button",className:"history-load-more",disabled:u.loading,onClick:u.onLoadMore,children:u.loading?j("history.loadingMore"):j("history.loadMore")}):null]}):o.jsxs(o.Fragment,{children:[M.length===0?o.jsx("div",{className:"history-empty",children:j("history.empty")}):null,M.map(H=>{const K=H.id===i,Q=(l==null?void 0:l.has(H.id))===!0,q=!Q&&(c==null?void 0:c.has(H.id))===!0;return o.jsxs("div",{className:`history-item ${K?"active":""}`,children:[o.jsxs("button",{className:"history-item-btn",onClick:()=>E(H.id),"aria-current":K?"page":void 0,title:H.title,children:[o.jsx(mG,{title:H.title}),q&&o.jsxs("span",{className:"history-evaluating-status",title:j("history.evaluatingTitle"),children:[o.jsx("span",{className:"history-evaluating","aria-hidden":"true"}),j("history.evaluating")]})]}),o.jsxs("div",{className:"history-action-slot",children:[Q?o.jsx(Hk,{className:"history-streaming-indicator",size:12,role:"status","aria-label":j("history.generating")}):null,o.jsx("button",{type:"button",className:"history-more","aria-label":j("history.manage",{title:H.title}),title:j("history.more"),onClick:()=>T(B=>B===H.id?null:H.id),children:o.jsx(vW,{className:"icon"})})]}),F===H.id&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>T(null)}),o.jsx("div",{className:"history-menu",children:o.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{T(null),C(H.id)},children:[o.jsx(pm,{className:"icon"})," ",j("history.delete")]})})]})]},H.id)})]})})]}),o.jsx("div",{className:"sidebar-footer",children:o.jsx(SKe,{activePage:r,access:a,userInfo:N,onAgentKitCli:O,onDeveloperResources:w,onSystemInfo:k,onIssueFeedback:S,onLogout:_})})]})}function ta(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,i;n{}};function CR(){for(var e=0,t=arguments.length,n={},i;e=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}cA.prototype=CR.prototype={constructor:cA,on:function(e,t){var n=this._,i=CKe(e+"",n),r,s=-1,a=i.length;if(arguments.length<2){for(;++s0)for(var n=new Array(r),i=0,r,s;i=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),bG.hasOwnProperty(t)?{space:bG[t],local:e}:e}function AKe(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===J4&&t.documentElement.namespaceURI===J4?t.createElement(e):t.createElementNS(n,e)}}function _Ke(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Xxe(e){var t=TR(e);return(t.local?_Ke:AKe)(t)}function NKe(){}function Y7(e){return e==null?NKe:function(){return this.querySelector(e)}}function jKe(e){typeof e!="function"&&(e=Y7(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r=O&&(O=x+1);!(k=v[O])&&++O=0;)(a=i[r])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function nXe(e){e||(e=iXe);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,i=n.length,r=new Array(i),s=0;st?1:e>=t?0:NaN}function rXe(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function sXe(){return Array.from(this)}function aXe(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?bXe:typeof t=="function"?vXe:yXe)(e,t,n??"")):Qv(this.node(),e)}function Qv(e,t){return e.style.getPropertyValue(t)||t1e(e).getComputedStyle(e,null).getPropertyValue(t)}function wXe(e){return function(){delete this[e]}}function OXe(e,t){return function(){this[e]=t}}function SXe(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function kXe(e,t){return arguments.length>1?this.each((t==null?wXe:typeof t=="function"?SXe:OXe)(e,t)):this.node()[e]}function n1e(e){return e.trim().split(/^|\s+/)}function Z7(e){return e.classList||new i1e(e)}function i1e(e){this._node=e,this._names=n1e(e.getAttribute("class")||"")}i1e.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 r1e(e,t){for(var n=Z7(e),i=-1,r=t.length;++i=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function ZXe(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,r=t.length,s;n()=>e;function e6(e,{sourceEvent:t,subject:n,target:i,identifier:r,active:s,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:i,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:s,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}})}e6.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function lYe(e){return!e.ctrlKey&&!e.button}function cYe(){return this.parentNode}function uYe(e,t){return t??{x:e.x,y:e.y}}function dYe(){return navigator.maxTouchPoints||"ontouchstart"in this}function u1e(){var e=lYe,t=cYe,n=uYe,i=dYe,r={},s=CR("start","drag","end"),a=0,l,c,u,d,f=0;function h(w){w.on("mousedown.drag",p).filter(i).on("touchstart.drag",v).on("touchmove.drag",y,oYe).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(w,k){if(!(d||!e.call(this,w,k))){var S=O(this,t.call(this,w,k),w,k,"mouse");S&&(Yl(w.view).on("mousemove.drag",g,CS).on("mouseup.drag",b,CS),l1e(w.view),ZD(w),u=!1,l=w.clientX,c=w.clientY,S("start",w))}}function g(w){if(ev(w),!u){var k=w.clientX-l,S=w.clientY-c;u=k*k+S*S>f}r.mouse("drag",w)}function b(w){Yl(w.view).on("mousemove.drag mouseup.drag",null),c1e(w.view,u),ev(w),r.mouse("end",w)}function v(w,k){if(e.call(this,w,k)){var S=w.changedTouches,E=t.call(this,w,k),C=S.length,N,_;for(N=0;N>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?fT(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?fT(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=hYe.exec(e))?new dl(t[1],t[2],t[3],1):(t=pYe.exec(e))?new dl(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=mYe.exec(e))?fT(t[1],t[2],t[3],t[4]):(t=gYe.exec(e))?fT(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=bYe.exec(e))?kG(t[1],t[2]/100,t[3]/100,1):(t=yYe.exec(e))?kG(t[1],t[2]/100,t[3]/100,t[4]):yG.hasOwnProperty(e)?wG(yG[e]):e==="transparent"?new dl(NaN,NaN,NaN,0):null}function wG(e){return new dl(e>>16&255,e>>8&255,e&255,1)}function fT(e,t,n,i){return i<=0&&(e=t=n=NaN),new dl(e,t,n,i)}function wYe(e){return e instanceof tE||(e=xb(e)),e?(e=e.rgb(),new dl(e.r,e.g,e.b,e.opacity)):new dl}function t6(e,t,n,i){return arguments.length===1?wYe(e):new dl(e,t,n,i??1)}function dl(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}J7(dl,t6,d1e(tE,{brighter(e){return e=e==null?q_:Math.pow(q_,e),new dl(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?TS:Math.pow(TS,e),new dl(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new dl(ib(this.r),ib(this.g),ib(this.b),W_(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:OG,formatHex:OG,formatHex8:OYe,formatRgb:SG,toString:SG}));function OG(){return`#${Mg(this.r)}${Mg(this.g)}${Mg(this.b)}`}function OYe(){return`#${Mg(this.r)}${Mg(this.g)}${Mg(this.b)}${Mg((isNaN(this.opacity)?1:this.opacity)*255)}`}function SG(){const e=W_(this.opacity);return`${e===1?"rgb(":"rgba("}${ib(this.r)}, ${ib(this.g)}, ${ib(this.b)}${e===1?")":`, ${e})`}`}function W_(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ib(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Mg(e){return e=ib(e),(e<16?"0":"")+e.toString(16)}function kG(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Cu(e,t,n,i)}function f1e(e){if(e instanceof Cu)return new Cu(e.h,e.s,e.l,e.opacity);if(e instanceof tE||(e=xb(e)),!e)return new Cu;if(e instanceof Cu)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),s=Math.max(t,n,i),a=NaN,l=s-r,c=(s+r)/2;return l?(t===s?a=(n-i)/l+(n0&&c<1?0:a,new Cu(a,l,c,e.opacity)}function SYe(e,t,n,i){return arguments.length===1?f1e(e):new Cu(e,t,n,i??1)}function Cu(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}J7(Cu,SYe,d1e(tE,{brighter(e){return e=e==null?q_:Math.pow(q_,e),new Cu(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?TS:Math.pow(TS,e),new Cu(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,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new dl(JD(e>=240?e-240:e+120,r,i),JD(e,r,i),JD(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new Cu(EG(this.h),hT(this.s),hT(this.l),W_(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=W_(this.opacity);return`${e===1?"hsl(":"hsla("}${EG(this.h)}, ${hT(this.s)*100}%, ${hT(this.l)*100}%${e===1?")":`, ${e})`}`}}));function EG(e){return e=(e||0)%360,e<0?e+360:e}function hT(e){return Math.max(0,Math.min(1,e||0))}function JD(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 AR=e=>()=>e;function h1e(e,t){return function(n){return e+n*t}}function kYe(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function rHt(e,t){var n=t-e;return n?h1e(e,n>180||n<-180?n-360*Math.round(n/360):n):AR(isNaN(e)?t:e)}function EYe(e){return(e=+e)==1?p1e:function(t,n){return n-t?kYe(t,n,e):AR(isNaN(t)?n:t)}}function p1e(e,t){var n=t-e;return n?h1e(e,n):AR(isNaN(e)?t:e)}const G_=function e(t){var n=EYe(t);function i(r,s){var a=n((r=t6(r)).r,(s=t6(s)).r),l=n(r.g,s.g),c=n(r.b,s.b),u=p1e(r.opacity,s.opacity);return function(d){return r.r=a(d),r.g=l(d),r.b=c(d),r.opacity=u(d),r+""}}return i.gamma=e,i}(1);function CYe(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),r;return function(s){for(r=0;rn&&(s=t.slice(n,s),l[a]?l[a]+=s:l[++a]=s),(i=i[0])===(r=r[0])?l[a]?l[a]+=r:l[++a]=r:(l[++a]=null,c.push({i:a,x:pd(i,r)})),n=eM.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(r(f)+"rotate(",null,i)-2,x:pd(u,d)})):d&&f.push(r(f)+"rotate("+d+i)}function l(u,d,f,h){u!==d?h.push({i:f.push(r(f)+"skewX(",null,i)-2,x:pd(u,d)}):d&&f.push(r(f)+"skewX("+d+i)}function c(u,d,f,h,p,g){if(u!==f||d!==h){var b=p.push(r(p)+"scale(",null,",",null,")");g.push({i:b-4,x:pd(u,f)},{i:b-2,x:pd(d,h)})}else(f!==1||h!==1)&&p.push(r(p)+"scale("+f+","+h+")")}return function(u,d){var f=[],h=[];return u=e(u),d=e(d),s(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 g=-1,b=h.length,v;++g=0&&e._call.call(void 0,t),e=e._next;--zv}function AG(){wb=(X_=_S.now())+_R,zv=Rw=0;try{UYe()}finally{zv=0,zYe(),wb=0}}function QYe(){var e=_S.now(),t=e-X_;t>y1e&&(_R-=t,X_=e)}function zYe(){for(var e,t=K_,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:K_=n);Iw=e,r6(i)}function r6(e){if(!zv){Rw&&(Rw=clearTimeout(Rw));var t=e-wb;t>24?(e<1/0&&(Rw=setTimeout(AG,e-_S.now()-_R)),$1&&($1=clearInterval($1))):($1||(X_=_S.now(),$1=setInterval(QYe,y1e)),zv=1,v1e(AG))}}function _G(e,t,n){var i=new Y_;return t=t==null?0:+t,i.restart(r=>{i.stop(),e(r+t)},t,n),i}var VYe=CR("start","end","cancel","interrupt"),HYe=[],w1e=0,NG=1,s6=2,dA=3,jG=4,a6=5,fA=6;function NR(e,t,n,i,r,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;qYe(e,n,{name:t,index:i,group:r,on:VYe,tween:HYe,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:w1e})}function tB(e,t){var n=Wu(e,t);if(n.state>w1e)throw new Error("too late; already scheduled");return n}function Xd(e,t){var n=Wu(e,t);if(n.state>dA)throw new Error("too late; already running");return n}function Wu(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function qYe(e,t,n){var i=e.__transition,r;i[t]=n,n.timer=x1e(s,0,n.time);function s(u){n.state=NG,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!==NG)return c();for(d in i)if(p=i[d],p.name===n.name){if(p.state===dA)return _G(a);p.state===jG?(p.state=fA,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete i[d]):+ds6&&i.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function OZe(e,t,n){var i,r,s=wZe(t)?tB:Xd;return function(){var a=s(this,e),l=a.on;l!==i&&(r=(i=l).copy()).on(t,n),a.on=r}}function SZe(e,t){var n=this._id;return arguments.length<2?Wu(this.node(),n).on.on(e):this.each(OZe(n,e,t))}function kZe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function EZe(){return this.on("end.remove",kZe(this._id))}function CZe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Y7(e));for(var i=this._groups,r=i.length,s=new Array(r),a=0;a()=>e;function YZe(e,{sourceEvent:t,target:n,transform:i,dispatch:r}){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:i,enumerable:!0,configurable:!0},_:{value:r}})}function Kf(e,t,n){this.k=e,this.x=t,this.y=n}Kf.prototype={constructor:Kf,scale:function(e){return e===1?this:new Kf(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Kf(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 jR=new Kf(1,0,0);E1e.prototype=Kf.prototype;function E1e(e){for(;!e.__zoom;)if(!(e=e.parentNode))return jR;return e.__zoom}function tM(e){e.stopImmediatePropagation()}function F1(e){e.preventDefault(),e.stopImmediatePropagation()}function ZZe(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function JZe(){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 RG(){return this.__zoom||jR}function eJe(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function tJe(){return navigator.maxTouchPoints||"ontouchstart"in this}function nJe(e,t,n){var i=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function C1e(){var e=ZZe,t=JZe,n=nJe,i=eJe,r=tJe,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=uA,u=CR("start","zoom","end"),d,f,h,p=500,g=150,b=0,v=10;function y(T){T.property("__zoom",RG).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",_).filter(r).on("touchstart.zoom",j).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(T,P,R,L){var M=T.selection?T.selection():T;M.property("__zoom",RG),T!==M?k(T,P,R,L):M.interrupt().each(function(){S(this,arguments).event(L).start().zoom(null,typeof P=="function"?P.apply(this,arguments):P).end()})},y.scaleBy=function(T,P,R,L){y.scaleTo(T,function(){var M=this.__zoom.k,U=typeof P=="function"?P.apply(this,arguments):P;return M*U},R,L)},y.scaleTo=function(T,P,R,L){y.transform(T,function(){var M=t.apply(this,arguments),U=this.__zoom,I=R==null?w(M):typeof R=="function"?R.apply(this,arguments):R,H=U.invert(I),K=typeof P=="function"?P.apply(this,arguments):P;return n(O(x(U,K),I,H),M,a)},R,L)},y.translateBy=function(T,P,R,L){y.transform(T,function(){return n(this.__zoom.translate(typeof P=="function"?P.apply(this,arguments):P,typeof R=="function"?R.apply(this,arguments):R),t.apply(this,arguments),a)},null,L)},y.translateTo=function(T,P,R,L,M){y.transform(T,function(){var U=t.apply(this,arguments),I=this.__zoom,H=L==null?w(U):typeof L=="function"?L.apply(this,arguments):L;return n(jR.translate(H[0],H[1]).scale(I.k).translate(typeof P=="function"?-P.apply(this,arguments):-P,typeof R=="function"?-R.apply(this,arguments):-R),U,a)},L,M)};function x(T,P){return P=Math.max(s[0],Math.min(s[1],P)),P===T.k?T:new Kf(P,T.x,T.y)}function O(T,P,R){var L=P[0]-R[0]*T.k,M=P[1]-R[1]*T.k;return L===T.x&&M===T.y?T:new Kf(T.k,L,M)}function w(T){return[(+T[0][0]+ +T[1][0])/2,(+T[0][1]+ +T[1][1])/2]}function k(T,P,R,L){T.on("start.zoom",function(){S(this,arguments).event(L).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(L).end()}).tween("zoom",function(){var M=this,U=arguments,I=S(M,U).event(L),H=t.apply(M,U),K=R==null?w(H):typeof R=="function"?R.apply(M,U):R,Q=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),q=M.__zoom,B=typeof P=="function"?P.apply(M,U):P,ee=c(q.invert(K).concat(Q/q.k),B.invert(K).concat(Q/B.k));return function(le){if(le===1)le=B;else{var se=ee(le),re=Q/se[2];le=new Kf(re,K[0]-se[0]*re,K[1]-se[1]*re)}I.zoom(null,le)}})}function S(T,P,R){return!R&&T.__zooming||new E(T,P)}function E(T,P){this.that=T,this.args=P,this.active=0,this.sourceEvent=null,this.extent=t.apply(T,P),this.taps=0}E.prototype={event:function(T){return T&&(this.sourceEvent=T),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(T,P){return this.mouse&&T!=="mouse"&&(this.mouse[1]=P.invert(this.mouse[0])),this.touch0&&T!=="touch"&&(this.touch0[1]=P.invert(this.touch0[0])),this.touch1&&T!=="touch"&&(this.touch1[1]=P.invert(this.touch1[0])),this.that.__zoom=P,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(T){var P=Yl(this.that).datum();u.call(T,this.that,new YZe(T,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:u}),P)}};function C(T,...P){if(!e.apply(this,arguments))return;var R=S(this,P).event(T),L=this.__zoom,M=Math.max(s[0],Math.min(s[1],L.k*Math.pow(2,i.apply(this,arguments)))),U=Ou(T);if(R.wheel)(R.mouse[0][0]!==U[0]||R.mouse[0][1]!==U[1])&&(R.mouse[1]=L.invert(R.mouse[0]=U)),clearTimeout(R.wheel);else{if(L.k===M)return;R.mouse=[U,L.invert(U)],hA(this),R.start()}F1(T),R.wheel=setTimeout(I,g),R.zoom("mouse",n(O(x(L,M),R.mouse[0],R.mouse[1]),R.extent,a));function I(){R.wheel=null,R.end()}}function N(T,...P){if(h||!e.apply(this,arguments))return;var R=T.currentTarget,L=S(this,P,!0).event(T),M=Yl(T.view).on("mousemove.zoom",K,!0).on("mouseup.zoom",Q,!0),U=Ou(T,R),I=T.clientX,H=T.clientY;l1e(T.view),tM(T),L.mouse=[U,this.__zoom.invert(U)],hA(this),L.start();function K(q){if(F1(q),!L.moved){var B=q.clientX-I,ee=q.clientY-H;L.moved=B*B+ee*ee>b}L.event(q).zoom("mouse",n(O(L.that.__zoom,L.mouse[0]=Ou(q,R),L.mouse[1]),L.extent,a))}function Q(q){M.on("mousemove.zoom mouseup.zoom",null),c1e(q.view,L.moved),F1(q),L.event(q).end()}}function _(T,...P){if(e.apply(this,arguments)){var R=this.__zoom,L=Ou(T.changedTouches?T.changedTouches[0]:T,this),M=R.invert(L),U=R.k*(T.shiftKey?.5:2),I=n(O(x(R,U),L,M),t.apply(this,P),a);F1(T),l>0?Yl(this).transition().duration(l).call(k,I,L,T):Yl(this).call(y.transform,I,L,T)}}function j(T,...P){if(e.apply(this,arguments)){var R=T.touches,L=R.length,M=S(this,P,T.changedTouches.length===L).event(T),U,I,H,K;for(tM(T),I=0;I`Seems like you have not used zustand provider as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:i})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:i}", 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.`},NS=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],T1e=["Enter"," ","Escape"],A1e={"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 Vv;(function(e){e.Strict="strict",e.Loose="loose"})(Vv||(Vv={}));var rb;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(rb||(rb={}));var jS;(function(e){e.Partial="partial",e.Full="full"})(jS||(jS={}));const _1e={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Np;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Np||(Np={}));var RS;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(RS||(RS={}));var rn;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(rn||(rn={}));const IG={[rn.Left]:rn.Right,[rn.Right]:rn.Left,[rn.Top]:rn.Bottom,[rn.Bottom]:rn.Top};function N1e(e){return e===null?null:e?"valid":"invalid"}const j1e=e=>"id"in e&&"source"in e&&"target"in e,iJe=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),iB=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),nE=(e,t=[0,0])=>{const{width:n,height:i}=Fh(e),r=e.origin??t,s=n*r[0],a=i*r[1];return{x:e.position.x-s,y:e.position.y-a}},rJe=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((i,r)=>{const s=typeof r=="string";let a=!t.nodeLookup&&!s?r:void 0;t.nodeLookup&&(a=s?t.nodeLookup.get(r):iB(r)?r:t.nodeLookup.get(r.id));const l=a?Z_(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return RR(i,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return IR(n)},iE=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=RR(n,Z_(r)),i=!0)}),i?IR(n):{x:0,y:0,width:0,height:0}},rB=(e,t,[n,i,r]=[0,0,1],s=!1,a=!1)=>{const l={...$x(t,[n,i,r]),width:t.width/r,height:t.height/r},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,g=d.height??u.height??u.initialHeight??null,b=IS(l,qv(u)),v=(p??0)*(g??0),y=s&&b>0;(!u.internals.handleBounds||y||b>=v||u.dragging)&&c.push(u)}return c},sJe=(e,t)=>{const n=new Set;return e.forEach(i=>{n.add(i.id)}),t.filter(i=>n.has(i.source)||n.has(i.target))};function aJe(e,t){const n=new Map,i=t!=null&&t.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!r.hidden)&&(!i||i.has(r.id))&&n.set(r.id,r)}),n}async function oJe({nodes:e,width:t,height:n,panZoom:i,minZoom:r,maxZoom:s},a){if(e.size===0)return!0;const l=aJe(e,a),c=iE(l),u=aB(c,t,n,(a==null?void 0:a.minZoom)??r,(a==null?void 0:a.maxZoom)??s,(a==null?void 0:a.padding)??.1);return await i.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 R1e({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:r,onError:s}){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??i;let f=a.extent||r;if(a.extent==="parent"&&!a.expandParent)if(!l)s==null||s("005",Fu.error005());else{const p=l.measured.width,g=l.measured.height;p&&g&&(f=[[c,u],[c+p,u+g]])}else l&&Sb(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=Sb(f)?Ob(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(s==null||s("015",Fu.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 lJe({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:i,onBeforeDelete:r}){const s=new Set(e.map(h=>h.id)),a=[];for(const h of n){if(h.deletable===!1)continue;const p=s.has(h.id),g=!p&&h.parentId&&a.find(b=>b.id===h.parentId);(p||g)&&a.push(h)}const l=new Set(t.map(h=>h.id)),c=i.filter(h=>h.deletable!==!1),d=sJe(a,c);for(const h of c)l.has(h.id)&&!d.find(g=>g.id===h.id)&&d.push(h);if(!r)return{edges:d,nodes:a};const f=await r({nodes:a,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:a}:{edges:[],nodes:[]}:f}const Hv=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ob=(e={x:0,y:0},t,n)=>({x:Hv(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Hv(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function I1e(e,t,n){const{width:i,height:r}=Fh(n),{x:s,y:a}=n.internals.positionAbsolute;return Ob(e,[[s,a],[s+i,a+r]],t)}const PG=(e,t,n)=>en?-Hv(Math.abs(e-n),1,t)/t:0,sB=(e,t,n=15,i=40)=>{const r=PG(e.x,i,t.width-i)*n,s=PG(e.y,i,t.height-i)*n;return[r,s]},RR=(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)}),o6=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),IR=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),qv=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=iB(e)?e.internals.positionAbsolute:nE(e,t);return{x:n,y:i,width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0}},Z_=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=iB(e)?e.internals.positionAbsolute:nE(e,t);return{x:n,y:i,x2:n+(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0),y2:i+(((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0)}},P1e=(e,t)=>IR(RR(o6(e),o6(t))),IS=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),i=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*i)},DG=e=>Au(e.width)&&Au(e.height)&&Au(e.x)&&Au(e.y),Au=e=>!isNaN(e)&&isFinite(e),D1e=(e,t)=>(n,i)=>{},rE=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),$x=({x:e,y:t},[n,i,r],s=!1,a=[1,1])=>{const l={x:(e-n)/r,y:(t-i)/r};return s?rE(l,a):l},Wv=({x:e,y:t},[n,i,r])=>({x:e*r+n,y:t*r+i});function M0(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 cJe(e,t,n){if(typeof e=="string"||typeof e=="number"){const i=M0(e,n),r=M0(e,t);return{top:i,right:r,bottom:i,left:r,x:r*2,y:i*2}}if(typeof e=="object"){const i=M0(e.top??e.y??0,n),r=M0(e.bottom??e.y??0,n),s=M0(e.left??e.x??0,t),a=M0(e.right??e.x??0,t);return{top:i,right:a,bottom:r,left:s,x:s+a,y:i+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function uJe(e,t,n,i,r,s){const{x:a,y:l}=Wv(e,[t,n,i]),{x:c,y:u}=Wv({x:e.x+e.width,y:e.y+e.height},[t,n,i]),d=r-c,f=s-u;return{left:Math.floor(a),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(f)}}const aB=(e,t,n,i,r,s)=>{const a=cJe(s,t,n),l=(t-a.x)/e.width,c=(n-a.y)/e.height,u=Math.min(l,c),d=Hv(u,i,r),f=e.x+e.width/2,h=e.y+e.height/2,p=t/2-f*d,g=n/2-h*d,b=uJe(e,p,g,d,t,n),v={left:Math.min(b.left-a.left,0),top:Math.min(b.top-a.top,0),right:Math.min(b.right-a.right,0),bottom:Math.min(b.bottom-a.bottom,0)};return{x:p-v.left+v.right,y:g-v.top+v.bottom,zoom:d}},PS=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Sb(e){return e!=null&&e!=="parent"}function Fh(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 oB(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 M1e(e,t={width:0,height:0},n,i,r){const s={...e},a=i.get(n);if(a){const l=a.origin||r;s.x+=a.internals.positionAbsolute.x-(t.width??0)*l[0],s.y+=a.internals.positionAbsolute.y-(t.height??0)*l[1]}return s}function MG(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function dJe(){let e,t;return{promise:new Promise((i,r)=>{e=i,t=r}),resolve:e,reject:t}}function fJe(e){return{...A1e,...e||{}}}function SO(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:r}){const{x:s,y:a}=_u(e),l=$x({x:s-((r==null?void 0:r.left)??0),y:a-((r==null?void 0:r.top)??0)},i),{x:c,y:u}=n?rE(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const lB=e=>({width:e.offsetWidth,height:e.offsetHeight}),L1e=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},hJe=["INPUT","SELECT","TEXTAREA"];function $1e(e){var i,r;const t=((r=(i=e.composedPath)==null?void 0:i.call(e))==null?void 0:r[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:hJe.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const F1e=e=>"clientX"in e,_u=(e,t)=>{var s,a;const n=F1e(e),i=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,r=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:i-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},LG=(e,t,n,i,r)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(a=>{const l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:r,position:a.getAttribute("data-handlepos"),x:(l.left-n.left)/i,y:(l.top-n.top)/i,...lB(a)}})};function B1e({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:r,sourceControlY:s,targetControlX:a,targetControlY:l}){const c=e*.125+r*.375+a*.375+n*.125,u=t*.125+s*.375+l*.375+i*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}function gT(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function $G({pos:e,x1:t,y1:n,x2:i,y2:r,c:s}){switch(e){case rn.Left:return[t-gT(t-i,s),n];case rn.Right:return[t+gT(i-t,s),n];case rn.Top:return[t,n-gT(n-r,s)];case rn.Bottom:return[t,n+gT(r-n,s)]}}function U1e({sourceX:e,sourceY:t,sourcePosition:n=rn.Bottom,targetX:i,targetY:r,targetPosition:s=rn.Top,curvature:a=.25}){const[l,c]=$G({pos:n,x1:e,y1:t,x2:i,y2:r,c:a}),[u,d]=$G({pos:s,x1:i,y1:r,x2:e,y2:t,c:a}),[f,h,p,g]=B1e({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${i},${r}`,f,h,p,g]}function Q1e({sourceX:e,sourceY:t,targetX:n,targetY:i}){const r=Math.abs(n-e)/2,s=n0}const gJe=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,bJe=(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)),yJe=(e,t,n={})=>{var s;if(!e.source||!e.target)return(s=n.onError)==null||s.call(n,"006",Fu.error006()),t;const i=n.getEdgeId||gJe;let r;return j1e(e)?r={...e}:r={...e,id:i(e)},bJe(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function z1e({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[r,s,a,l]=Q1e({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,r,s,a,l]}const FG={[rn.Left]:{x:-1,y:0},[rn.Right]:{x:1,y:0},[rn.Top]:{x:0,y:-1},[rn.Bottom]:{x:0,y:1}},vJe=({source:e,sourcePosition:t=rn.Bottom,target:n})=>t===rn.Left||t===rn.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function xJe({source:e,sourcePosition:t=rn.Bottom,target:n,targetPosition:i=rn.Top,center:r,offset:s,stepPosition:a}){const l=FG[t],c=FG[i],u={x:e.x+l.x*s,y:e.y+l.y*s},d={x:n.x+c.x*s,y:n.y+c.y*s},f=vJe({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",p=f[h];let g=[],b,v;const y={x:0,y:0},x={x:0,y:0},[,,O,w]=Q1e({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*c[h]===-1){h==="x"?(b=r.x??u.x+(d.x-u.x)*a,v=r.y??(u.y+d.y)/2):(b=r.x??(u.x+d.x)/2,v=r.y??u.y+(d.y-u.y)*a);const C=[{x:b,y:u.y},{x:b,y:d.y}],N=[{x:u.x,y:v},{x:d.x,y:v}];l[h]===p?g=h==="x"?C:N:g=h==="x"?N:C}else{const C=[{x:u.x,y:d.y}],N=[{x:d.x,y:u.y}];if(h==="x"?g=l.x===p?N:C:g=l.y===p?C:N,t===i){const T=Math.abs(e[h]-n[h]);if(T<=s){const P=Math.min(s-1,s-T);l[h]===p?y[h]=(u[h]>e[h]?-1:1)*P:x[h]=(d[h]>n[h]?-1:1)*P}}if(t!==i){const T=h==="x"?"y":"x",P=l[h]===c[T],R=u[T]>d[T],L=u[T]=F?(b=(_.x+j.x)/2,v=g[0].y):(b=g[0].x,v=(_.y+j.y)/2)}const k={x:u.x+y.x,y:u.y+y.y},S={x:d.x+x.x,y:d.y+x.y};return[[e,...k.x!==g[0].x||k.y!==g[0].y?[k]:[],...g,...S.x!==g[g.length-1].x||S.y!==g[g.length-1].y?[S]:[],n],b,v,O,w]}function wJe(e,t,n,i){const r=Math.min(BG(e,t)/2,BG(t,n)/2,i),{x:s,y:a}=t;if(e.x===s&&s===n.x||e.y===a&&a===n.y)return`L${s} ${a}`;if(e.y===a){const u=e.xn.id===t):e[0])||null}function l6(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function SJe(e,{id:t,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:r}){const s=new Set;return e.reduce((a,l)=>([l.markerStart||i,l.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const u=l6(c,t);s.has(u)||(a.push({id:u,color:c.color||n,...c}),s.add(u))}}),a),[]).sort((a,l)=>a.id.localeCompare(l.id))}const V1e=1e3,kJe=10,cB={nodeOrigin:[0,0],nodeExtent:NS,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},EJe={...cB,checkEquality:!0};function uB(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function CJe(e,t,n){const i=uB(cB,n);for(const r of e.values())if(r.parentId)fB(r,e,t,i);else{const s=nE(r,i.nodeOrigin),a=Sb(r.extent)?r.extent:i.nodeExtent,l=Ob(s,a,Fh(r));r.internals.positionAbsolute=l}}function TJe(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],i=[];for(const r of e.handles){const s={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(s):r.type==="target"&&i.push(s)}return{source:n,target:i}}function dB(e){return e==="manual"}function c6(e,t,n,i={}){var d,f;const r=uB(EJe,i),s={i:0},a=new Map(t),l=r!=null&&r.elevateNodesOnSelect&&!dB(r.zIndexMode)?V1e:0;let c=e.length>0,u=!1;t.clear(),n.clear();for(const h of e){let p=a.get(h.id);if(r.checkEquality&&h===(p==null?void 0:p.internals.userNode))t.set(h.id,p);else{const g=nE(h,r.nodeOrigin),b=Sb(h.extent)?h.extent:r.nodeExtent,v=Ob(g,b,Fh(h));p={...r.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(f=h.measured)==null?void 0:f.height},internals:{positionAbsolute:v,handleBounds:TJe(h,p),z:H1e(h,l,r.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&&fB(p,t,n,i,s),u||(u=h.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function AJe(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 fB(e,t,n,i,r){const{elevateNodesOnSelect:s,nodeOrigin:a,nodeExtent:l,zIndexMode:c}=uB(cB,i),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}AJe(e,n),r&&!d.parentId&&d.internals.rootParentIndex===void 0&&c==="auto"&&(d.internals.rootParentIndex=++r.i,d.internals.z=d.internals.z+r.i*kJe),r&&d.internals.rootParentIndex!==void 0&&(r.i=d.internals.rootParentIndex);const f=s&&!dB(c)?V1e:0,{x:h,y:p,z:g}=_Je(e,d,a,l,f,c),{positionAbsolute:b}=e.internals,v=h!==b.x||p!==b.y;(v||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:h,y:p}:b,z:g}})}function H1e(e,t,n){const i=Au(e.zIndex)?e.zIndex:0;return dB(n)?i:i+(e.selected?t:0)}function _Je(e,t,n,i,r,s){const{x:a,y:l}=t.internals.positionAbsolute,c=Fh(e),u=nE(e,n),d=Sb(e.extent)?Ob(u,e.extent,c):u;let f=Ob({x:a+d.x,y:l+d.y},i,c);e.extent==="parent"&&(f=I1e(f,c,t));const h=H1e(e,r,s),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>=h?p+1:h}}function hB(e,t,n,i=[0,0]){var a;const r=[],s=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((a=s.get(l.parentId))==null?void 0:a.expandedRect)??qv(c),d=P1e(u,l.rect);s.set(l.parentId,{expandedRect:d,parent:c})}return s.size>0&&s.forEach(({expandedRect:l,parent:c},u)=>{var O;const d=c.internals.positionAbsolute,f=Fh(c),h=c.origin??i,p=l.x0||g>0||y||x)&&(r.push({id:u,type:"position",position:{x:c.position.x-p+y,y:c.position.y-g+x}}),(O=n.get(u))==null||O.forEach(w=>{e.some(k=>k.id===w.id)||r.push({id:w.id,type:"position",position:{x:w.position.x+p,y:w.position.y+g}})})),(f.width0){const p=hB(h,t,n,r);u.push(...p)}return{changes:u,updatedInternals:c}}async function jJe({delta:e,panZoom:t,transform:n,translateExtent:i,width:r,height:s}){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],[r,s]],i);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}function VG(e,t,n,i,r,s){let a=r;const l=i.get(a)||new Map;i.set(a,l.set(n,t)),a=`${r}-${e}`;const c=i.get(a)||new Map;if(i.set(a,c.set(n,t)),s){a=`${r}-${e}-${s}`;const u=i.get(a)||new Map;i.set(a,u.set(n,t))}}function q1e(e,t,n){e.clear(),t.clear();for(const i of n){const{source:r,target:s,sourceHandle:a=null,targetHandle:l=null}=i,c={edgeId:i.id,source:r,target:s,sourceHandle:a,targetHandle:l},u=`${r}-${a}--${s}-${l}`,d=`${s}-${l}--${r}-${a}`;VG("source",c,d,e,r,a),VG("target",c,u,e,s,l),t.set(i.id,i)}}function W1e(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:W1e(n,t):!1}function HG(e,t,n){var r;let i=e;do{if((r=i==null?void 0:i.matches)!=null&&r.call(i,t))return!0;if(i===n)return!1;i=i==null?void 0:i.parentElement}while(i);return!1}function RJe(e,t,n,i){const r=new Map;for(const[s,a]of e)if((a.selected||a.id===i)&&(!a.parentId||!W1e(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const l=e.get(s);l&&r.set(s,{id:s,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 r}function nM({nodeId:e,dragItems:t,nodeLookup:n,dragging:i=!0}){var a,l,c;const r=[];for(const[u,d]of t){const f=(a=n.get(u))==null?void 0:a.internals.userNode;f&&r.push({...f,position:d.position,dragging:i})}if(!e)return[r[0],r];const s=(l=n.get(e))==null?void 0:l.internals.userNode;return[s?{...s,position:((c=t.get(e))==null?void 0:c.position)||s.position,dragging:i}:r[0],r]}function IJe({dragItems:e,snapGrid:t,x:n,y:i}){const r=e.values().next().value;if(!r)return null;const s={x:n-r.distance.x,y:i-r.distance.y},a=rE(s,t);return{x:a.x-s.x,y:a.y-s.y}}function PJe({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:i,onDragStop:r}){let s={x:null,y:null},a=0,l=new Map,c=!1,u={x:0,y:0},d=null,f=!1,h=null,p=!1,g=!1,b=null;function v({noDragClassName:x,handleSelector:O,domNode:w,isSelectable:k,nodeId:S,nodeClickDistance:E=0}){h=Yl(w);function C({x:A,y:F}){const{nodeLookup:T,nodeExtent:P,snapGrid:R,snapToGrid:L,nodeOrigin:M,onNodeDrag:U,onSelectionDrag:I,onError:H,updateNodePositions:K}=t();s={x:A,y:F};let Q=!1;const q=l.size>1,B=q&&P?o6(iE(l)):null,ee=q&&L?IJe({dragItems:l,snapGrid:R,x:A,y:F}):null;for(const[le,se]of l){if(!T.has(le))continue;let re={x:A-se.distance.x,y:F-se.distance.y};L&&(re=ee?{x:Math.round(re.x+ee.x),y:Math.round(re.y+ee.y)}:rE(re,R));let ge=null;if(q&&P&&!se.extent&&B){const{positionAbsolute:ae}=se.internals,ue=ae.x-B.x+P[0][0],Oe=ae.x+se.measured.width-B.x2+P[1][0],Se=ae.y-B.y+P[0][1],lt=ae.y+se.measured.height-B.y2+P[1][1];ge=[[ue,Se],[Oe,lt]]}const{position:W,positionAbsolute:X}=R1e({nodeId:le,nextPosition:re,nodeLookup:T,nodeExtent:ge||P,nodeOrigin:M,onError:H});Q=Q||se.position.x!==W.x||se.position.y!==W.y,se.position=W,se.internals.positionAbsolute=X}if(g=g||Q,!!Q&&(K(l,!0),b&&(i||U||!S&&I))){const[le,se]=nM({nodeId:S,dragItems:l,nodeLookup:T});i==null||i(b,l,le,se),U==null||U(b,le,se),S||I==null||I(b,se)}}async function N(){if(!d)return;const{transform:A,panBy:F,autoPanSpeed:T,autoPanOnNodeDrag:P}=t();if(!P){c=!1,cancelAnimationFrame(a);return}const[R,L]=sB(u,d,T);(R!==0||L!==0)&&(s.x=(s.x??0)-R/A[2],s.y=(s.y??0)-L/A[2],await F({x:R,y:L})&&C(s)),a=requestAnimationFrame(N)}function _(A){var q;const{nodeLookup:F,multiSelectionActive:T,nodesDraggable:P,transform:R,snapGrid:L,snapToGrid:M,selectNodesOnDrag:U,onNodeDragStart:I,onSelectionDragStart:H,unselectNodesAndEdges:K}=t();f=!0,(!U||!k)&&!T&&S&&((q=F.get(S))!=null&&q.selected||K()),k&&U&&S&&(e==null||e(S));const Q=SO(A.sourceEvent,{transform:R,snapGrid:L,snapToGrid:M,containerBounds:d});if(s=Q,l=RJe(F,P,Q,S),l.size>0&&(n||I||!S&&H)){const[B,ee]=nM({nodeId:S,dragItems:l,nodeLookup:F});n==null||n(A.sourceEvent,l,B,ee),I==null||I(A.sourceEvent,B,ee),S||H==null||H(A.sourceEvent,ee)}}const j=u1e().clickDistance(E).on("start",A=>{const{domNode:F,nodeDragThreshold:T,transform:P,snapGrid:R,snapToGrid:L}=t();d=(F==null?void 0:F.getBoundingClientRect())||null,p=!1,g=!1,b=A.sourceEvent,T===0&&_(A),s=SO(A.sourceEvent,{transform:P,snapGrid:R,snapToGrid:L,containerBounds:d}),u=_u(A.sourceEvent,d)}).on("drag",A=>{const{autoPanOnNodeDrag:F,transform:T,snapGrid:P,snapToGrid:R,nodeDragThreshold:L,nodeLookup:M}=t(),U=SO(A.sourceEvent,{transform:T,snapGrid:P,snapToGrid:R,containerBounds:d});if(b=A.sourceEvent,(A.sourceEvent.type==="touchmove"&&A.sourceEvent.touches.length>1||S&&!M.has(S))&&(p=!0),!p){if(!c&&F&&f&&(c=!0,N()),!f){const I=_u(A.sourceEvent,d),H=I.x-u.x,K=I.y-u.y;Math.sqrt(H*H+K*K)>L&&_(A)}(s.x!==U.xSnapped||s.y!==U.ySnapped)&&l&&f&&(u=_u(A.sourceEvent,d),C(U))}}).on("end",A=>{if(!f||p){p&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(a),l.size>0){const{nodeLookup:F,updateNodePositions:T,onNodeDragStop:P,onSelectionDragStop:R}=t();if(g&&(T(l,!1),g=!1),r||P||!S&&R){const[L,M]=nM({nodeId:S,dragItems:l,nodeLookup:F,dragging:!1});r==null||r(A.sourceEvent,l,L,M),P==null||P(A.sourceEvent,L,M),S||R==null||R(A.sourceEvent,M)}}}).filter(A=>{const F=A.target;return!A.button&&(!x||!HG(F,`.${x}`,w))&&(!O||HG(F,O,w))});h.call(j)}function y(){h==null||h.on(".drag",null)}return{update:v,destroy:y}}function DJe(e,t,n){const i=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const s of t.values())IS(r,qv(s))>0&&i.push(s);return i}const MJe=250;function LJe(e,t,n,i){var l,c;let r=[],s=1/0;const a=DJe(e,n,t+MJe);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(i.nodeId===f.nodeId&&i.type===f.type&&i.id===f.id)continue;const{x:h,y:p}=kb(u,f,f.position,!0),g=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(p-e.y,2));g>t||(g1){const u=i.type==="source"?"target":"source";return r.find(d=>d.type===u)??r[0]}return r[0]}function G1e(e,t,n,i,r,s=!1){var u,d,f;const a=i.get(e);if(!a)return null;const l=r==="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&&s?{...c,...kb(a,c,c.position,!0)}:c}function K1e(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function $Je(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const X1e=()=>!0;function FJe(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:r,edgeUpdaterType:s,isTarget:a,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:p,onConnectStart:g,onConnect:b,onConnectEnd:v,isValidConnection:y=X1e,onReconnectEnd:x,updateConnection:O,getTransform:w,getFromHandle:k,autoPanSpeed:S,dragThreshold:E=1,handleDomNode:C}){const N=L1e(e.target);let _=0,j;const{x:A,y:F}=_u(e),T=K1e(s,C),P=l==null?void 0:l.getBoundingClientRect();let R=!1;if(!P||!T)return;const L=G1e(r,T,i,c,t);if(!L)return;let M=_u(e,P),U=!1,I=null,H=!1,K=null;function Q(){if(!d||!P)return;const[W,X]=sB(M,P,S);h({x:W,y:X}),_=requestAnimationFrame(Q)}const q={...L,nodeId:r,type:T,position:L.position},B=c.get(r);let le={inProgress:!0,isValid:null,from:kb(B,q,rn.Left,!0),fromHandle:q,fromPosition:q.position,fromNode:B,to:M,toHandle:null,toPosition:IG[q.position],toNode:null,pointer:M};function se(){R=!0,O(le),g==null||g(e,{nodeId:r,handleId:i,handleType:T})}E===0&&se();function re(W){if(!R){const{x:lt,y:$e}=_u(W),Le=lt-A,Ne=$e-F;if(!(Le*Le+Ne*Ne>E*E))return;se()}if(!k()||!q){ge(W);return}const X=w();M=_u(W,P),j=LJe($x(M,X,!1,[1,1]),n,c,q),U||(Q(),U=!0);const ae=Y1e(W,{handle:j,connectionMode:t,fromNodeId:r,fromHandleId:i,fromType:a?"target":"source",isValidConnection:y,doc:N,lib:u,flowId:f,nodeLookup:c});K=ae.handleDomNode,I=ae.connection,H=$Je(!!j,ae.isValid);const ue=c.get(r),Oe=ue?kb(ue,q,rn.Left,!0):le.from,Se={...le,from:Oe,isValid:H,to:ae.toHandle&&H?Wv({x:ae.toHandle.x,y:ae.toHandle.y},X):M,toHandle:ae.toHandle,toPosition:H&&ae.toHandle?ae.toHandle.position:IG[q.position],toNode:ae.toHandle?c.get(ae.toHandle.nodeId):null,pointer:M};O(Se),le=Se}function ge(W){if(!("touches"in W&&W.touches.length>0)){if(R){(j||K)&&I&&H&&(b==null||b(I));const{inProgress:X,...ae}=le,ue={...ae,toPosition:le.toHandle?le.toPosition:null};v==null||v(W,ue),s&&(x==null||x(W,ue))}p(),cancelAnimationFrame(_),U=!1,H=!1,I=null,K=null,N.removeEventListener("mousemove",re),N.removeEventListener("mouseup",ge),N.removeEventListener("touchmove",re),N.removeEventListener("touchend",ge)}}N.addEventListener("mousemove",re),N.addEventListener("mouseup",ge),N.addEventListener("touchmove",re),N.addEventListener("touchend",ge)}function Y1e(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:r,fromType:s,doc:a,lib:l,flowId:c,isValidConnection:u=X1e,nodeLookup:d}){const f=s==="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:g}=_u(e),b=a.elementFromPoint(p,g),v=b!=null&&b.classList.contains(`${l}-flow__handle`)?b:h,y={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const x=K1e(void 0,v),O=v.getAttribute("data-nodeid"),w=v.getAttribute("data-handleid"),k=v.classList.contains("connectable"),S=v.classList.contains("connectableend");if(!O||!x)return y;const E={source:f?O:i,sourceHandle:f?w:r,target:f?i:O,targetHandle:f?r:w};y.connection=E;const N=k&&S&&(n===Vv.Strict?f&&x==="source"||!f&&x==="target":O!==i||w!==r);y.isValid=N&&u(E),y.toHandle=G1e(O,x,w,d,n,!0)}return y}const u6={onPointerDown:FJe,isValid:Y1e};function BJe({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const r=Yl(e);function s({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:p=!1}){const g=O=>{if(O.sourceEvent.type!=="wheel"||!t)return;const w=n(),k=O.sourceEvent.ctrlKey&&PS()?10:1,S=-O.sourceEvent.deltaY*(O.sourceEvent.deltaMode===1?.05:O.sourceEvent.deltaMode?1:.002)*d,E=w[2]*Math.pow(2,S*k);t.scaleTo(E)};let b=[0,0];const v=O=>{(O.sourceEvent.type==="mousedown"||O.sourceEvent.type==="touchstart")&&(b=[O.sourceEvent.clientX??O.sourceEvent.touches[0].clientX,O.sourceEvent.clientY??O.sourceEvent.touches[0].clientY])},y=O=>{const w=n();if(O.sourceEvent.type!=="mousemove"&&O.sourceEvent.type!=="touchmove"||!t)return;const k=[O.sourceEvent.clientX??O.sourceEvent.touches[0].clientX,O.sourceEvent.clientY??O.sourceEvent.touches[0].clientY],S=[k[0]-b[0],k[1]-b[1]];b=k;const E=i()*Math.max(w[2],Math.log(w[2]))*(p?-1:1),C={x:w[0]-S[0]*E,y:w[1]-S[1]*E},N=[[0,0],[c,u]];t.setViewportConstrained({x:C.x,y:C.y,zoom:w[2]},N,l)},x=C1e().on("start",v).on("zoom",f?y:null).on("zoom.wheel",h?g:null);r.call(x,{})}function a(){r.on("zoom",null)}return{update:s,destroy:a,pointer:Ou}}const PR=e=>({x:e.x,y:e.y,zoom:e.k}),iM=({x:e,y:t,zoom:n})=>jR.translate(e,t).scale(n),Ay=(e,t)=>e.target.closest(`.${t}`),Z1e=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),UJe=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,rM=(e,t=0,n=UJe,i=()=>{})=>{const r=typeof t=="number"&&t>0;return r||i(),r?e.transition().duration(t).ease(n).on("end",i):e},J1e=e=>{const t=e.ctrlKey&&PS()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function QJe({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:r,panOnScrollSpeed:s,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(Ay(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&a){const v=Ou(d),y=J1e(d),x=f*Math.pow(2,y);i.scaleTo(n,x,v,d);return}const h=d.deltaMode===1?20:1;let p=r===rb.Vertical?0:d.deltaX*h,g=r===rb.Horizontal?0:d.deltaY*h;!PS()&&d.shiftKey&&r!==rb.Vertical&&(p=d.deltaY*h,g=0),i.translateBy(n,-(p/f)*s,-(g/f)*s,{internal:!0});const b=PR(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(d,b),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,b),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(d,b))}}function zJe({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(i,r){const s=i.type==="wheel",a=!t&&s&&!i.ctrlKey,l=Ay(i,e);if(i.ctrlKey&&s&&l&&i.preventDefault(),a||l)return null;i.preventDefault(),n.call(this,i,r)}}function VJe({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var s,a,l;if((s=i.sourceEvent)!=null&&s.internal)return;const r=PR(i.transform);e.mouseButton=((a=i.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=r,((l=i.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(i.sourceEvent,r))}}function HJe({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:r}){return s=>{var a,l;e.usedRightMouseButton=!!(n&&Z1e(t,e.mouseButton??0)),(a=s.sourceEvent)!=null&&a.sync||i([s.transform.x,s.transform.y,s.transform.k]),r&&!((l=s.sourceEvent)!=null&&l.internal)&&(r==null||r(s.sourceEvent,PR(s.transform)))}}function qJe({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:i,onPanZoomEnd:r,onPaneContextMenu:s}){return a=>{var l;if(!((l=a.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,s&&Z1e(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&s(a.sourceEvent),e.usedRightMouseButton=!1,i(!1),r)){const c=PR(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(a.sourceEvent,c)},n?150:0)}}}function WJe({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:i,panOnScroll:r,zoomOnDoubleClick:s,userSelectionActive:a,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{var v;const h=e||t,p=n&&f.ctrlKey,g=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Ay(f,`${u}-flow__node`)||Ay(f,`${u}-flow__edge`)))return!0;if(!i&&!h&&!r&&!s&&!n||a||d&&!g||Ay(f,l)&&g||Ay(f,c)&&(!g||r&&g&&!e)||!n&&f.ctrlKey&&g)return!1;if(!n&&f.type==="touchstart"&&((v=f.touches)==null?void 0:v.length)>1)return f.preventDefault(),!1;if(!h&&!r&&!p&&g||!i&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(i)&&!i.includes(f.button)&&f.type==="mousedown")return!1;const b=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||g)&&b}}function GJe({domNode:e,minZoom:t,maxZoom:n,translateExtent:i,viewport:r,onPanZoom:s,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=C1e().scaleExtent([t,n]).translateExtent(i),h=Yl(e).call(f);x({x:r.x,y:r.y,zoom:Hv(r.zoom,t,n)},[[0,0],[d.width,d.height]],i);const p=h.on("wheel.zoom"),g=h.on("dblclick.zoom");f.wheelDelta(J1e);async function b(j,A){return h?new Promise(F=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?OO:uA).transform(rM(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>F(!0)),j)}):!1}function v({noWheelClassName:j,noPanClassName:A,onPaneContextMenu:F,userSelectionActive:T,panOnScroll:P,panOnDrag:R,panOnScrollMode:L,panOnScrollSpeed:M,preventScrolling:U,zoomOnPinch:I,zoomOnScroll:H,zoomOnDoubleClick:K,zoomActivationKeyPressed:Q,lib:q,onTransformChange:B,connectionInProgress:ee,paneClickDistance:le,selectionOnDrag:se}){T&&!u.isZoomingOrPanning&&y();const re=P&&!Q&&!T;f.clickDistance(se?1/0:!Au(le)||le<0?0:le);const ge=re?QJe({zoomPanValues:u,noWheelClassName:j,d3Selection:h,d3Zoom:f,panOnScrollMode:L,panOnScrollSpeed:M,zoomOnPinch:I,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:l}):zJe({noWheelClassName:j,preventScrolling:U,d3ZoomHandler:p});h.on("wheel.zoom",ge,{passive:!1});const W=VJe({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});f.on("start",W);const X=HJe({zoomPanValues:u,panOnDrag:R,onPaneContextMenu:!!F,onPanZoom:s,onTransformChange:B});f.on("zoom",X);const ae=qJe({zoomPanValues:u,panOnDrag:R,panOnScroll:P,onPaneContextMenu:F,onPanZoomEnd:l,onDraggingChange:c});f.on("end",ae);const ue=WJe({zoomActivationKeyPressed:Q,panOnDrag:R,zoomOnScroll:H,panOnScroll:P,zoomOnDoubleClick:K,zoomOnPinch:I,userSelectionActive:T,noPanClassName:A,noWheelClassName:j,lib:q,connectionInProgress:ee});f.filter(ue),K?h.on("dblclick.zoom",g):h.on("dblclick.zoom",null)}function y(){f.on("zoom",null)}async function x(j,A,F){const T=iM(j),P=f==null?void 0:f.constrain()(T,A,F);return P&&await b(P),P}async function O(j,A){const F=iM(j);return await b(F,A),F}function w(j){if(h){const A=iM(j),F=h.property("__zoom");(F.k!==j.zoom||F.x!==j.x||F.y!==j.y)&&(f==null||f.transform(h,A,null,{sync:!0}))}}function k(){const j=h?E1e(h.node()):{x:0,y:0,k:1};return{x:j.x,y:j.y,zoom:j.k}}async function S(j,A){return h?new Promise(F=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?OO:uA).scaleTo(rM(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>F(!0)),j)}):!1}async function E(j,A){return h?new Promise(F=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?OO:uA).scaleBy(rM(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>F(!0)),j)}):!1}function C(j){f==null||f.scaleExtent(j)}function N(j){f==null||f.translateExtent(j)}function _(j){const A=!Au(j)||j<0?0:j;f==null||f.clickDistance(A)}return{update:v,destroy:y,setViewport:O,setViewportConstrained:x,getViewport:k,scaleTo:S,scaleBy:E,setScaleExtent:C,setTranslateExtent:N,syncViewport:w,setClickDistance:_}}var Gv;(function(e){e.Line="line",e.Handle="handle"})(Gv||(Gv={}));function KJe({width:e,prevWidth:t,height:n,prevHeight:i,affectsX:r,affectsY:s}){const a=e-t,l=n-i,c=[a>0?1:a<0?-1:0,l>0?1:l<0?-1:0];return a&&r&&(c[0]=c[0]*-1),l&&s&&(c[1]=c[1]*-1),c}function qG(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),i=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:i,affectsY:r}}function lp(e,t){return Math.max(0,t-e)}function cp(e,t){return Math.max(0,e-t)}function bT(e,t,n){return Math.max(0,t-e,e-n)}function WG(e,t){return e?!t:t}function XJe(e,t,n,i,r,s,a,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:p,ySnapped:g}=n,{minWidth:b,maxWidth:v,minHeight:y,maxHeight:x}=i,{x:O,y:w,width:k,height:S,aspectRatio:E}=e;let C=Math.floor(d?p-e.pointerX:0),N=Math.floor(f?g-e.pointerY:0);const _=k+(c?-C:C),j=S+(u?-N:N),A=-s[0]*k,F=-s[1]*S;let T=bT(_,b,v),P=bT(j,y,x);if(a){let M=0,U=0;c&&C<0?M=lp(O+C+A,a[0][0]):!c&&C>0&&(M=cp(O+_+A,a[1][0])),u&&N<0?U=lp(w+N+F,a[0][1]):!u&&N>0&&(U=cp(w+j+F,a[1][1])),T=Math.max(T,M),P=Math.max(P,U)}if(l){let M=0,U=0;c&&C>0?M=cp(O+C,l[0][0]):!c&&C<0&&(M=lp(O+_,l[1][0])),u&&N>0?U=cp(w+N,l[0][1]):!u&&N<0&&(U=lp(w+j,l[1][1])),T=Math.max(T,M),P=Math.max(P,U)}if(r){if(d){const M=bT(_/E,y,x)*E;if(T=Math.max(T,M),a){let U=0;!c&&!u||c&&!u&&h?U=cp(w+F+_/E,a[1][1])*E:U=lp(w+F+(c?C:-C)/E,a[0][1])*E,T=Math.max(T,U)}if(l){let U=0;!c&&!u||c&&!u&&h?U=lp(w+_/E,l[1][1])*E:U=cp(w+(c?C:-C)/E,l[0][1])*E,T=Math.max(T,U)}}if(f){const M=bT(j*E,b,v)/E;if(P=Math.max(P,M),a){let U=0;!c&&!u||u&&!c&&h?U=cp(O+j*E+A,a[1][0])/E:U=lp(O+(u?N:-N)*E+A,a[0][0])/E,P=Math.max(P,U)}if(l){let U=0;!c&&!u||u&&!c&&h?U=lp(O+j*E,l[1][0])/E:U=cp(O+(u?N:-N)*E,l[0][0])/E,P=Math.max(P,U)}}}N=N+(N<0?P:-P),C=C+(C<0?T:-T),r&&(h?_>j*E?N=(WG(c,u)?-C:C)/E:C=(WG(c,u)?-N:N)*E:d?(N=C/E,u=c):(C=N*E,c=u));const R=c?O+C:O,L=u?w+N:w;return{width:k+(c?-C:C),height:S+(u?-N:N),x:s[0]*C*(c?-1:1)+R,y:s[1]*N*(u?-1:1)+L}}const ewe={width:0,height:0,x:0,y:0},YJe={...ewe,pointerX:0,pointerY:0,aspectRatio:1};function ZJe(e,t,n){const i=t.position.x+e.position.x,r=t.position.y+e.position.y,s=e.measured.width??0,a=e.measured.height??0,l=n[0]*s,c=n[1]*a;return[[i-l,r-c],[i+s-l,r+a-c]]}function JJe({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:r}){const s=Yl(e);let a={controlDirection:qG("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:g,onResizeEnd:b,shouldResize:v}){let y={...ewe},x={...YJe};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:qG(u)};let O,w=null,k=[],S,E,C,N=!1;const _=u1e().on("start",j=>{const{nodeLookup:A,transform:F,snapGrid:T,snapToGrid:P,nodeOrigin:R,paneDomNode:L}=n();if(O=A.get(t),!O)return;w=(L==null?void 0:L.getBoundingClientRect())??null;const{xSnapped:M,ySnapped:U}=SO(j.sourceEvent,{transform:F,snapGrid:T,snapToGrid:P,containerBounds:w});y={width:O.measured.width??0,height:O.measured.height??0,x:O.position.x??0,y:O.position.y??0},x={...y,pointerX:M,pointerY:U,aspectRatio:y.width/y.height},S=void 0,E=Sb(O.extent)?O.extent:void 0,O.parentId&&(O.extent==="parent"||O.expandParent)&&(S=A.get(O.parentId)),S&&O.extent==="parent"&&(E=[[0,0],[S.measured.width,S.measured.height]]),k=[],C=void 0;for(const[I,H]of A)if(H.parentId===t&&(k.push({id:I,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const K=ZJe(H,O,H.origin??R);C?C=[[Math.min(K[0][0],C[0][0]),Math.min(K[0][1],C[0][1])],[Math.max(K[1][0],C[1][0]),Math.max(K[1][1],C[1][1])]]:C=K}p==null||p(j,{...y})}).on("drag",j=>{const{transform:A,snapGrid:F,snapToGrid:T,nodeOrigin:P}=n(),R=SO(j.sourceEvent,{transform:A,snapGrid:F,snapToGrid:T,containerBounds:w}),L=[];if(!O)return;const{x:M,y:U,width:I,height:H}=y,K={},Q=O.origin??P,{width:q,height:B,x:ee,y:le}=XJe(x,a.controlDirection,R,a.boundaries,a.keepAspectRatio,Q,E,C),se=q!==I,re=B!==H,ge=ee!==M&&se,W=le!==U&&re;if(!ge&&!W&&!se&&!re)return;if((ge||W||Q[0]===1||Q[1]===1)&&(K.x=ge?ee:y.x,K.y=W?le:y.y,y.x=K.x,y.y=K.y,k.length>0)){const Oe=ee-M,Se=le-U;for(const lt of k)lt.position={x:lt.position.x-Oe+Q[0]*(q-I),y:lt.position.y-Se+Q[1]*(B-H)},L.push(lt)}if((se||re)&&(K.width=se&&(!a.resizeDirection||a.resizeDirection==="horizontal")?q:y.width,K.height=re&&(!a.resizeDirection||a.resizeDirection==="vertical")?B:y.height,y.width=K.width,y.height=K.height),S&&O.expandParent){const Oe=Q[0]*(K.width??0);K.x&&K.x{N&&(b==null||b(j,{...y}),r==null||r({...y}),N=!1)});s.call(_)}function c(){s.on(".drag",null)}return{update:l,destroy:c}}var twe={exports:{}},nwe={};/** +`)},wze=0,R0=[];function Oze(e){var t=m.useRef([]),n=m.useRef([0,0]),i=m.useRef(),r=m.useState(wze++)[0],s=m.useState(uve)[0],a=m.useRef(e);m.useEffect(function(){a.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var b=zQe([e.lockRef.current],(e.shards||[]).map(GW),!0).filter(Boolean);return b.forEach(function(v){return v.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),b.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var l=m.useCallback(function(b,v){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!a.current.allowPinchZoom;var y=sT(b),x=n.current,O="deltaX"in b?b.deltaX:x[0]-y[0],w="deltaY"in b?b.deltaY:x[1]-y[1],k,S=b.target,E=Math.abs(O)>Math.abs(w)?"h":"v";if("touches"in b&&E==="h"&&S.type==="range")return!1;var C=window.getSelection(),N=C&&C.anchorNode,_=N?N===S||N.contains(S):!1;if(_)return!1;var j=qW(E,S);if(!j)return!0;if(j?k=E:(k=E==="v"?"h":"v",j=qW(E,S)),!j)return!1;if(!i.current&&"changedTouches"in b&&(O||w)&&(i.current=k),!k)return!0;var A=i.current||k;return yze(A,v,b,A==="h"?O:w)},[]),c=m.useCallback(function(b){var v=b;if(!(!R0.length||R0[R0.length-1]!==s)){var y="deltaY"in v?WW(v):sT(v),x=t.current.filter(function(k){return k.name===v.type&&(k.target===v.target||v.target===k.shadowParent)&&vze(k.delta,y)})[0];if(x&&x.should){v.cancelable&&v.preventDefault();return}if(!x){var O=(a.current.shards||[]).map(GW).filter(Boolean).filter(function(k){return k.contains(v.target)}),w=O.length>0?l(v,O[0]):!a.current.noIsolation;w&&v.cancelable&&v.preventDefault()}}},[]),u=m.useCallback(function(b,v,y,x){var O={name:b,delta:v,target:y,should:x,shadowParent:Sze(y)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(w){return w!==O})},1)},[]),d=m.useCallback(function(b){n.current=sT(b),i.current=void 0},[]),f=m.useCallback(function(b){u(b.type,WW(b),b.target,l(b,e.lockRef.current))},[]),h=m.useCallback(function(b){u(b.type,sT(b),b.target,l(b,e.lockRef.current))},[]);m.useEffect(function(){return R0.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,j0),document.addEventListener("touchmove",c,j0),document.addEventListener("touchstart",d,j0),function(){R0=R0.filter(function(b){return b!==s}),document.removeEventListener("wheel",c,j0),document.removeEventListener("touchmove",c,j0),document.removeEventListener("touchstart",d,j0)}},[]);var p=e.removeScrollBar,g=e.inert;return m.createElement(m.Fragment,null,g?m.createElement(s,{styles:xze(r)}):null,p?m.createElement(dze,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Sze(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const kze=ZQe(cve,Oze);var b7=m.forwardRef(function(e,t){return m.createElement(dR,bd({},e,{ref:t,sideCar:kze}))});b7.classNames=dR.classNames;var Eze=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},I0=new WeakMap,aT=new WeakMap,oT={},HD=0,pve=function(e){return e&&(e.host||pve(e.parentNode))},Cze=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=pve(n);return i&&e.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Tze=function(e,t,n,i){var r=Cze(t,Array.isArray(e)?e:[e]);oT[n]||(oT[n]=new WeakMap);var s=oT[n],a=[],l=new Set,c=new Set(r),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};r.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(l.has(h))d(h);else try{var p=h.getAttribute(i),g=p!==null&&p!=="false",b=(I0.get(h)||0)+1,v=(s.get(h)||0)+1;I0.set(h,b),s.set(h,v),a.push(h),b===1&&g&&aT.set(h,!0),v===1&&h.setAttribute(n,"true"),g||h.setAttribute(i,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return d(t),l.clear(),HD++,function(){a.forEach(function(f){var h=I0.get(f)-1,p=s.get(f)-1;I0.set(f,h),s.set(f,p),h||(aT.has(f)||f.removeAttribute(i),aT.delete(f)),p||f.removeAttribute(n)}),HD--,HD||(I0=new WeakMap,I0=new WeakMap,aT=new WeakMap,oT={})}},mve=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),r=Eze(e);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live], script"))),Tze(i,r,n,"aria-hidden")):function(){return null}},Aze=Object.defineProperty,_ze=(e,t)=>Aze(e,"name",{value:t,configurable:!0});function Gk(e){const[t,n]=m.useState(void 0);return Jc(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let a,l;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;a=u.inlineSize,l=u.blockSize}else a=e.offsetWidth,l=e.offsetHeight;n({width:a,height:l})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else n(void 0)},[e]),t}_ze(Gk,"useSize");var Nze=Object.defineProperty,kh=(e,t)=>Nze(e,"name",{value:t,configurable:!0}),y7="Checkbox",[jze,XVt]=kl(y7),[Rze,v7]=jze(y7);function gve(e){const{__scopeCheckbox:t,checked:n,children:i,defaultChecked:r,disabled:s,form:a,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,p]=su({prop:n,defaultProp:r??!1,onChange:c,caller:y7}),[g,b]=m.useState(null),[v,y]=m.useState(null),x=m.useRef(!1),[O,w]=m.useReducer(E=>E+1,0),k=g?!!a||!!g.closest("form"):!0,S={checked:h,disabled:s,setChecked:p,control:g,setControl:b,name:l,form:a,value:d,hasConsumerStoppedPropagationRef:x,userInteractionCount:O,onUserInteraction:w,required:u,defaultChecked:rh(r)?!1:r,isFormControl:k,bubbleInput:v,setBubbleInput:y};return o.jsx(Rze,{scope:t,...S,children:bve(f)?f(S):i})}kh(gve,"CheckboxProvider");var Ize="CheckboxTrigger",Pze=m.forwardRef(kh(function({__scopeCheckbox:t,onKeyDown:n,onClick:i,...r},s){const{control:a,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:p,onUserInteraction:g,isFormControl:b,bubbleInput:v}=v7(Ize,t),y=ir(s,f),x=m.useRef(u);return m.useEffect(()=>{const O=a==null?void 0:a.form;if(O){const w=kh(()=>h(x.current),"reset");return O.addEventListener("reset",w),()=>O.removeEventListener("reset",w)}},[a,h]),o.jsx(wr.button,{type:"button",role:"checkbox","aria-checked":rh(u)?"mixed":u,"aria-required":d,"data-state":x7(u),"data-disabled":c?"":void 0,disabled:c,value:l,...r,ref:y,onKeyDown:yn(n,O=>{O.key==="Enter"&&O.preventDefault()}),onClick:yn(i,O=>{g(),h(w=>rh(w)?!0:!w),v&&b&&(p.current=O.isPropagationStopped(),p.current||O.stopPropagation())})})},"CheckboxTrigger")),Dze=m.forwardRef(kh(function(t,n){const{__scopeCheckbox:i,name:r,checked:s,defaultChecked:a,required:l,disabled:c,value:u,onCheckedChange:d,form:f,...h}=t;return o.jsx(gve,{__scopeCheckbox:i,checked:s,defaultChecked:a,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:p})=>o.jsxs(o.Fragment,{children:[o.jsx(Pze,{...h,ref:n,__scopeCheckbox:i}),p&&o.jsx(Fze,{__scopeCheckbox:i})]})})},"Checkbox")),Mze="CheckboxIndicator",Lze=m.forwardRef(kh(function(t,n){const{__scopeCheckbox:i,forceMount:r,...s}=t,a=v7(Mze,i);return o.jsx(Gd,{present:r||rh(a.checked)||a.checked===!0,children:o.jsx(wr.span,{"data-state":x7(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...t.style}})})},"CheckboxIndicator")),$ze="CheckboxBubbleInput",Fze=m.forwardRef(kh(function({__scopeCheckbox:t,onClick:n,...i},r){const{control:s,hasConsumerStoppedPropagationRef:a,userInteractionCount:l,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:p,form:g,bubbleInput:b,setBubbleInput:v}=v7($ze,t),y=ir(r,v),x=Gk(s),O=m.useRef(!1),w=m.useRef(c),k=m.useRef(l);m.useEffect(()=>{const E=b;if(!E)return;const C=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(C,"checked").set,j=l!==k.current;k.current=l;const A=w.current!==c;w.current=c;const F=!(j&&a.current);if(A&&_){O.current=!j;const T=new Event("click",{bubbles:F});E.indeterminate=rh(c),_.call(E,rh(c)?!1:c),E.dispatchEvent(T),O.current=!1}},[b,c,a,l]);const S=m.useRef(rh(c)?!1:c);return o.jsx(wr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??S.current,required:d,disabled:f,name:h,value:p,form:g,...i,tabIndex:-1,ref:y,onClick:yn(n,E=>{O.current&&E.stopPropagation()}),style:{...i.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function bve(e){return typeof e=="function"}kh(bve,"isFunction");function rh(e){return e==="indeterminate"}kh(rh,"isIndeterminate");function x7(e){return rh(e)?"indeterminate":e?"checked":"unchecked"}kh(x7,"getState");const Bze=["top","right","bottom","left"],gm=Math.min,sh=Math.max,B_=Math.round,lT=Math.floor,ah=e=>({x:e,y:e}),Uze={left:"right",right:"left",bottom:"top",top:"bottom"};function yve(e,t,n){return sh(e,gm(t,n))}function Eh(e,t){return typeof e=="function"?e(t):e}function bm(e){return e.split("-")[0]}function jx(e){return e.split("-")[1]}function w7(e){return e==="x"?"y":"x"}function O7(e){return e==="y"?"height":"width"}function Ed(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function S7(e){return w7(Ed(e))}function Qze(e,t,n){n===void 0&&(n=!1);const i=jx(e),r=S7(e),s=O7(r);let a=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=U_(a)),[a,U_(a)]}function zze(e){const t=U_(e);return[H4(e),t,H4(t)]}function H4(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const KW=["left","right"],XW=["right","left"],Vze=["top","bottom"],Hze=["bottom","top"];function qze(e,t,n){switch(e){case"top":case"bottom":return n?t?XW:KW:t?KW:XW;case"left":case"right":return t?Vze:Hze;default:return[]}}function Wze(e,t,n,i){const r=jx(e);let s=qze(bm(e),n==="start",i);return r&&(s=s.map(a=>a+"-"+r),t&&(s=s.concat(s.map(H4)))),s}function U_(e){const t=bm(e);return Uze[t]+e.slice(t.length)}function Gze(e){var t,n,i,r;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(i=e.bottom)!=null?i:0,left:(r=e.left)!=null?r:0}}function vve(e){return typeof e!="number"?Gze(e):{top:e,right:e,bottom:e,left:e}}function Q_(e){const{x:t,y:n,width:i,height:r}=e;return{width:i,height:r,top:n,left:t,right:t+i,bottom:n+r,x:t,y:n}}function YW(e,t,n){let{reference:i,floating:r}=e;const s=Ed(t),a=S7(t),l=O7(a),c=bm(t),u=s==="y",d=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,h=i[l]/2-r[l]/2;let p;switch(c){case"top":p={x:d,y:i.y-r.height};break;case"bottom":p={x:d,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:f};break;case"left":p={x:i.x-r.width,y:f};break;default:p={x:i.x,y:i.y}}const g=jx(t);return g&&(p[a]+=h*(g==="end"?1:-1)*(n&&u?-1:1)),p}async function Kze(e,t){var n;t===void 0&&(t={});const{x:i,y:r,platform:s,rects:a,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=Eh(t,e),g=vve(p),v=l[h?f==="floating"?"reference":"floating":f],y=Q_(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),x=f==="floating"?{x:i,y:r,width:a.floating.width,height:a.floating.height}:a.reference,O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),w=await(s.isElement==null?void 0:s.isElement(O))&&await(s.getScale==null?void 0:s.getScale(O))||{x:1,y:1},k=Q_(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:O,strategy:c}):x);return{top:(y.top-k.top+g.top)/w.y,bottom:(k.bottom-y.bottom+g.bottom)/w.y,left:(y.left-k.left+g.left)/w.x,right:(k.right-y.right+g.right)/w.x}}const Xze=50,Yze=async(e,t,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:a}=n,l=a.detectOverflow?a:{...a,detectOverflow:Kze},c=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:f}=YW(u,i,c),h=i,p=0;const g={};for(let b=0;b({name:"arrow",options:e,async fn(t){const{x:n,y:i,placement:r,rects:s,platform:a,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=Eh(e,t)||{};if(u==null)return{};const f=vve(d),h={x:n,y:i},p=S7(r),g=O7(p),b=await a.getDimensions(u),v=p==="y",y=v?"top":"left",x=v?"bottom":"right",O=v?"clientHeight":"clientWidth",w=s.reference[g]+s.reference[p]-h[p]-s.floating[g],k=h[p]-s.reference[p],S=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let E=S?S[O]:0;(!E||!await(a.isElement==null?void 0:a.isElement(S)))&&(E=l.floating[O]||s.floating[g]);const C=w/2-k/2,N=E/2-b[g]/2-1,_=gm(f[y],N),j=gm(f[x],N),A=E-b[g]-j,F=E/2-b[g]/2+C,T=yve(_,F,A),P=!c.arrow&&jx(r)!=null&&F!==T&&s.reference[g]/2-(F<_?_:j)-b[g]/2<0,R=P?F<_?F-_:F-A:0;return{[p]:h[p]+R,data:{[p]:T,centerOffset:F-T-R,...P&&{alignmentOffset:R}},reset:P}}}),Jze=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,i;const{placement:r,middlewareData:s,rects:a,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:b=!0,...v}=Eh(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=bm(r),x=Ed(l),O=bm(l)===l,w=await(c.isRTL==null?void 0:c.isRTL(u.floating)),k=h||(O||!b?[U_(l)]:zze(l)),S=g!=="none";!h&&S&&k.push(...Wze(l,b,g,w));const E=[l,...k],C=await c.detectOverflow(t,v),N=[];let _=((i=s.flip)==null?void 0:i.overflows)||[];if(d&&N.push(C[y]),f){const T=Qze(r,a,w);N.push(C[T[0]],C[T[1]])}if(_=[..._,{placement:r,overflows:N}],!N.every(T=>T<=0)){var j,A;const T=(((j=s.flip)==null?void 0:j.index)||0)+1,P=E[T];if(P&&(!(f==="alignment"?x!==Ed(P):!1)||_.every(M=>Ed(M.placement)===x?M.overflows[0]>0:!0)))return{data:{index:T,overflows:_},reset:{placement:P}};let R=(A=_.filter(L=>L.overflows[0]<=0).sort((L,M)=>L.overflows[1]-M.overflows[1])[0])==null?void 0:A.placement;if(!R)switch(p){case"bestFit":{var F;const L=(F=_.filter(M=>{if(S){const U=Ed(M.placement);return U===x||U==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(U=>U>0).reduce((U,I)=>U+I,0)]).sort((M,U)=>M[1]-U[1])[0])==null?void 0:F[0];L&&(R=L);break}case"initialPlacement":R=l;break}if(r!==R)return{reset:{placement:R}}}return{}}}};function ZW(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function JW(e){return Bze.some(t=>e[t]>=0)}const eVe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:i}=t,{strategy:r="referenceHidden",...s}=Eh(e,t);switch(r){case"referenceHidden":{const a=await i.detectOverflow(t,{...s,elementContext:"reference"}),l=ZW(a,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:JW(l)}}}case"escaped":{const a=await i.detectOverflow(t,{...s,altBoundary:!0}),l=ZW(a,n.floating);return{data:{escapedOffsets:l,escaped:JW(l)}}}default:return{}}}}},xve=new Set(["left","top"]);async function tVe(e,t){const{placement:n,platform:i,elements:r}=e,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),a=bm(n),l=jx(n),c=Ed(n)==="y",u=xve.has(a)?-1:1,d=s&&c?-1:1,f=Eh(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(p=l==="end"?g*-1:g),c?{x:p*d,y:h*u}:{x:h*u,y:p*d}}const nVe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:r,y:s,placement:a,middlewareData:l}=t,c=await tVe(t,e);return a===((n=l.offset)==null?void 0:n.placement)&&(i=l.arrow)!=null&&i.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:a}}}}},iVe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:r,platform:s}=t,{mainAxis:a=!0,crossAxis:l=!1,limiter:c={fn:x=>{let{x:O,y:w}=x;return{x:O,y:w}}},...u}=Eh(e,t),d={x:n,y:i},f=await s.detectOverflow(t,u),h=Ed(r),p=w7(h);let g=d[p],b=d[h];const v=(x,O)=>yve(O+f[x==="y"?"top":"left"],O,O-f[x==="y"?"bottom":"right"]);a&&(g=v(p,g)),l&&(b=v(h,b));const y=c.fn({...t,[p]:g,[h]:b});return{...y,data:{x:y.x-n,y:y.y-i,enabled:{[p]:a,[h]:l}}}}}},rVe=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,i;const{x:r,y:s,placement:a,rects:l,middlewareData:c}=t,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=Eh(e,t),h={x:r,y:s},p=Ed(a),g=w7(p);let b=h[g],v=h[p];const y=Eh(u,t),x=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:(n=y.mainAxis)!=null?n:0,crossAxis:(i=y.crossAxis)!=null?i:0};if(d){const k=g==="y"?"height":"width",S=l.reference[g]-l.floating[k]+x.mainAxis,E=l.reference[g]+l.reference[k]-x.mainAxis;bE&&(b=E)}if(f){var O,w;const k=g==="y"?"width":"height",S=xve.has(bm(a)),E=l.reference[p]-l.floating[k]+(S&&((O=c.offset)==null?void 0:O[p])||0)+(S?0:x.crossAxis),C=l.reference[p]+l.reference[k]+(S?0:((w=c.offset)==null?void 0:w[p])||0)-(S?x.crossAxis:0);vC&&(v=C)}return{[g]:b,[p]:v}}}},sVe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:i,platform:r,elements:s}=t,{apply:a=()=>{},...l}=Eh(e,t),c=await r.detectOverflow(t,l),u=bm(n),d=jx(n),f=Ed(n)==="y",{width:h,height:p}=i.floating;let g,b;u==="top"||u==="bottom"?(g=u,b=d===(await(r.isRTL==null?void 0:r.isRTL(s.floating))?"start":"end")?"left":"right"):(b=u,g=d==="end"?"top":"bottom");const v=p-c.top-c.bottom,y=h-c.left-c.right,x=gm(p-c[g],v),O=gm(h-c[b],y),w=t.middlewareData.shift,k=!w;let S=x,E=O;w!=null&&w.enabled.x&&(E=y),w!=null&&w.enabled.y&&(S=v),k&&!d&&(f?E=h-2*sh(c.left,c.right):S=p-2*sh(c.top,c.bottom)),await a({...t,availableWidth:E,availableHeight:S});const C=await r.getDimensions(s.floating);return h!==C.width||p!==C.height?{reset:{rects:!0}}:{}}}};function fR(){return typeof window<"u"}function Rx(e){return wve(e)?(e.nodeName||"").toLowerCase():"#document"}function bo(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function $h(e){var t;return(t=(wve(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function wve(e){return fR()?e instanceof Node||e instanceof bo(e).Node:!1}function Fd(e){return fR()?e instanceof Element||e instanceof bo(e).Element:!1}function Kd(e){return fR()?e instanceof HTMLElement||e instanceof bo(e).HTMLElement:!1}function eG(e){return!fR()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof bo(e).ShadowRoot}function hR(e){const{overflow:t,overflowX:n,overflowY:i,display:r}=Bd(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&r!=="inline"&&r!=="contents"}function aVe(e){return/^(table|td|th)$/.test(Rx(e))}function pR(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const oVe=/transform|translate|scale|rotate|perspective|filter/,lVe=/paint|layout|strict|content/,tg=e=>!!e&&e!=="none";let qD;function k7(e){const t=Fd(e)?Bd(e):e;return tg(t.transform)||tg(t.translate)||tg(t.scale)||tg(t.rotate)||tg(t.perspective)||!E7()&&(tg(t.backdropFilter)||tg(t.filter))||oVe.test(t.willChange||"")||lVe.test(t.contain||"")}function cVe(e){let t=yb(e);for(;Kd(t)&&!xS(t);){if(k7(t))return t;if(pR(t))return null;t=yb(t)}return null}function E7(){return qD==null&&(qD=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),qD}function xS(e){return/^(html|body|#document)$/.test(Rx(e))}function Bd(e){return bo(e).getComputedStyle(e)}function mR(e){return Fd(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function yb(e){if(Rx(e)==="html")return e;const t=e.assignedSlot||e.parentNode||eG(e)&&e.host||$h(e);return eG(t)?t.host:t}function Ove(e){const t=yb(e);return xS(t)?(e.ownerDocument||e).body:Kd(t)&&hR(t)?t:Ove(t)}function wS(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Ove(e),s=r===((i=e.ownerDocument)==null?void 0:i.body),a=bo(r);if(s){const l=q4(a);return t.concat(a,a.visualViewport||[],hR(r)?r:[],l&&n?wS(l):[])}else return t.concat(r,wS(r,[],n))}function q4(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Sve(e){const t=Bd(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=Kd(e),s=r?e.offsetWidth:n,a=r?e.offsetHeight:i,l=B_(n)!==s||B_(i)!==a;return l&&(n=s,i=a),{width:n,height:i,$:l}}function C7(e){return Fd(e)?e:e.contextElement}function Jy(e){const t=C7(e);if(!Kd(t))return ah(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:s}=Sve(t);let a=(s?B_(n.width):n.width)/i,l=(s?B_(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const uVe=ah(0);function kve(e){const t=bo(e);return!E7()||!t.visualViewport?uVe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dVe(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===bo(e)}function vb(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=C7(e);let a=ah(1);t&&(i?Fd(i)&&(a=Jy(i)):a=Jy(e));const l=dVe(s,n,i)?kve(s):ah(0);let c=(r.left+l.x)/a.x,u=(r.top+l.y)/a.y,d=r.width/a.x,f=r.height/a.y;if(s&&i){const h=bo(s),p=Fd(i)?bo(i):i;let g=h,b=q4(g);for(;b&&p!==g;){const v=Jy(b),y=b.getBoundingClientRect(),x=Bd(b),O=y.left+(b.clientLeft+parseFloat(x.paddingLeft))*v.x,w=y.top+(b.clientTop+parseFloat(x.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,f*=v.y,c+=O,u+=w,g=bo(b),b=q4(g)}}return Q_({width:d,height:f,x:c,y:u})}function gR(e,t){const n=mR(e).scrollLeft;return t?t.left+n:vb($h(e)).left+n}function Eve(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-gR(e,n),r=n.top+t.scrollTop;return{x:i,y:r}}function fVe(e){let{elements:t,rect:n,offsetParent:i,strategy:r}=e;const s=r==="fixed",a=$h(i),l=t?pR(t.floating):!1;if(i===a||l&&s)return n;let c={scrollLeft:0,scrollTop:0},u=ah(1);const d=ah(0),f=Kd(i);if((f||!s)&&((Rx(i)!=="body"||hR(a))&&(c=mR(i)),f)){const p=vb(i);u=Jy(i),d.x=p.x+i.clientLeft,d.y=p.y+i.clientTop}const h=a&&!f&&!s?Eve(a,c):ah(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-c.scrollTop*u.y+d.y+h.y}}function hVe(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function pVe(e){const t=mR(e),n=e.ownerDocument.body,i=sh(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=sh(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+gR(e);const a=-t.scrollTop;return Bd(n).direction==="rtl"&&(s+=sh(e.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:a}}const mVe=25;function gVe(e,t,n){n===void 0&&(n="viewport");const i=n==="layoutViewport",r=bo(e),s=$h(e),a=r.visualViewport;let l=s.clientWidth,c=s.clientHeight,u=0,d=0;if(a){const h=!E7()||t==="fixed";i?h||(u=-a.offsetLeft,d=-a.offsetTop):(l=a.width,c=a.height,h&&(u=a.offsetLeft,d=a.offsetTop))}if(gR(s)<=0){const h=s.ownerDocument,p=h.body,g=getComputedStyle(p),b=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,v=Math.abs(s.clientWidth-p.clientWidth-b),y=getComputedStyle(s).scrollbarGutter==="stable both-edges"?v/2:v;y<=mVe&&(l-=y)}return{width:l,height:c,x:u,y:d}}function bVe(e,t){const n=vb(e,!0,t==="fixed"),i=n.top+e.clientTop,r=n.left+e.clientLeft,s=Jy(e),a=e.clientWidth*s.x,l=e.clientHeight*s.y,c=r*s.x,u=i*s.y;return{width:a,height:l,x:c,y:u}}function tG(e,t,n){let i;if(t==="viewport"||t==="layoutViewport")i=gVe(e,n,t);else if(t==="document")i=pVe($h(e));else if(Fd(t))i=bVe(t,n);else{const r=kve(e);i={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Q_(i)}function yVe(e,t){const n=t.get(e);if(n)return n;let i=wS(e,[],!1).filter(l=>Fd(l)&&Rx(l)!=="body"),r=null;const s=Bd(e).position==="fixed";let a=s?yb(e):e;for(;Fd(a)&&!xS(a);){const l=Bd(a),c=k7(a),u=r?r.position:s?"fixed":"";!c&&(u==="fixed"||u==="absolute"&&l.position==="static")?i=i.filter(f=>f!==a):r=l,a=yb(a)}return t.set(e,i),i}function vVe(e){let{element:t,boundary:n,rootBoundary:i,strategy:r}=e;const a=[...n==="clippingAncestors"?pR(t)?[]:yVe(t,this._c):[].concat(n),i],l=tG(t,a[0],r);let c=l.top,u=l.right,d=l.bottom,f=l.left;for(let h=1;h{l(!1,1e-7)},1e3)}E=!1}try{i=new IntersectionObserver(C,{...S,root:s.ownerDocument})}catch{i=new IntersectionObserver(C,S)}i.observe(e)}const c=bo(e),u=()=>l(n);return c.addEventListener("resize",u),l(!0),()=>{c.removeEventListener("resize",u),a()}}function CVe(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=i,u=C7(e),d=r||s?[...u?wS(u):[],...t?wS(t):[]]:[];d.forEach(y=>{r&&y.addEventListener("scroll",n),s&&y.addEventListener("resize",n)});const f=u&&l?EVe(u,n,s):null;let h=-1,p=null;a&&(p=new ResizeObserver(y=>{let[x]=y;x&&x.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var O;(O=p)==null||O.observe(t)})),n()}),u&&!c&&p.observe(u),t&&p.observe(t));let g,b=c?vb(e):null;c&&v();function v(){const y=vb(e);b&&!Tve(b,y)&&n(),b=y,g=requestAnimationFrame(v)}return n(),()=>{var y;d.forEach(x=>{r&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),f==null||f(),(y=p)==null||y.disconnect(),p=null,c&&cancelAnimationFrame(g)}}const TVe=nVe,AVe=iVe,_Ve=Jze,NVe=sVe,jVe=eVe,iG=Zze,RVe=rVe,IVe=(e,t,n)=>{const i=new Map,r=n??{},s={...kVe,...r.platform,_c:i};return Yze(e,t,{...r,platform:s})};var PVe=typeof document<"u",DVe=function(){},lA=PVe?m.useLayoutEffect:DVe;function z_(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,i,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(i=n;i--!==0;)if(!z_(e[i],t[i]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const s=r[i];if(!(s==="_owner"&&e.$$typeof)&&!z_(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ave(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rG(e,t){const n=Ave(e);return Math.round(t*n)/n}function GD(e){const t=m.useRef(e);return lA(()=>{t.current=e}),t}function MVe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:s,floating:a}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=m.useState(i);z_(h,i)||p(i);const[g,b]=m.useState(null),[v,y]=m.useState(null),x=m.useCallback(M=>{M!==S.current&&(S.current=M,b(M))},[]),O=m.useCallback(M=>{M!==E.current&&(E.current=M,y(M))},[]),w=s||g,k=a||v,S=m.useRef(null),E=m.useRef(null),C=m.useRef(d),N=c!=null,_=GD(c),j=GD(r),A=GD(u),F=m.useCallback(()=>{if(!S.current||!E.current)return;const M={placement:t,strategy:n,middleware:h};j.current&&(M.platform=j.current),IVe(S.current,E.current,M).then(U=>{const I={...U,isPositioned:A.current!==!1};T.current&&!z_(C.current,I)&&(C.current=I,Li.flushSync(()=>{f(I)}))})},[h,t,n,j,A]);lA(()=>{u===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,f(M=>({...M,isPositioned:!1})))},[u]);const T=m.useRef(!1);lA(()=>(T.current=!0,()=>{T.current=!1}),[]),lA(()=>{if(w&&(S.current=w),k&&(E.current=k),w&&k){if(_.current)return _.current(w,k,F);F()}},[w,k,F,_,N]);const P=m.useMemo(()=>({reference:S,floating:E,setReference:x,setFloating:O}),[x,O]),R=m.useMemo(()=>({reference:w,floating:k}),[w,k]),L=m.useMemo(()=>{const M={position:n,left:0,top:0};if(!R.floating)return M;const U=rG(R.floating,d.x),I=rG(R.floating,d.y);return l?{...M,transform:"translate("+U+"px, "+I+"px)",...Ave(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:U,top:I}},[n,l,R.floating,d.x,d.y]);return m.useMemo(()=>({...d,update:F,refs:P,elements:R,floatingStyles:L}),[d,F,P,R,L])}const LVe=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:i,padding:r}=typeof e=="function"?e(n):e;return i&&t(i)?i.current!=null?iG({element:i.current,padding:r}).fn(n):{}:i?iG({element:i,padding:r}).fn(n):{}}}},$Ve=(e,t)=>{const n=TVe(e);return{name:n.name,fn:n.fn,options:[e,t]}},FVe=(e,t)=>{const n=AVe(e);return{name:n.name,fn:n.fn,options:[e,t]}},BVe=(e,t)=>({fn:RVe(e).fn,options:[e,t]}),UVe=(e,t)=>{const n=_Ve(e);return{name:n.name,fn:n.fn,options:[e,t]}},QVe=(e,t)=>{const n=NVe(e);return{name:n.name,fn:n.fn,options:[e,t]}},zVe=(e,t)=>{const n=jVe(e);return{name:n.name,fn:n.fn,options:[e,t]}},VVe=(e,t)=>{const n=LVe(e);return{name:n.name,fn:n.fn,options:[e,t]}};var HVe=Object.defineProperty,em=(e,t)=>HVe(e,"name",{value:t,configurable:!0}),_ve="Popper",[Nve,Ix]=kl(_ve),[qVe,jve]=Nve(_ve),WVe=em(e=>{const{__scopePopper:t,children:n}=e,[i,r]=m.useState(null),[s,a]=m.useState(void 0);return o.jsx(qVe,{scope:t,anchor:i,onAnchorChange:r,placementState:s,setPlacementState:a,children:n})},"Popper"),GVe="PopperAnchor",KVe=m.forwardRef(em(function(t,n){const{__scopePopper:i,virtualRef:r,...s}=t,a=jve(GVe,i),l=m.useRef(null),c=a.onAnchorChange,u=m.useCallback(b=>{l.current=b,b&&c(b)},[c]),d=ir(n,u),f=m.useRef(null);m.useEffect(()=>{if(!r)return;const b=f.current;f.current=r.current,b!==f.current&&c(f.current)});const h=a.placementState&&bR(a.placementState),p=h==null?void 0:h[0],g=h==null?void 0:h[1];return r?null:o.jsx(wr.div,{"data-radix-popper-side":p,"data-radix-popper-align":g,...s,ref:d})},"PopperAnchor")),Rve="PopperContent",[XVe,YVt]=Nve(Rve),YVe=m.forwardRef(em(function(t,n){var re,ge,G,K,ae,ue,xe;const{__scopePopper:i,side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:p=!1,updatePositionStrategy:g="optimized",onPlaced:b,...v}=t,y=jve(Rve,i),[x,O]=m.useState(null),w=ir(n,O),[k,S]=m.useState(null),E=Gk(k),C=(E==null?void 0:E.width)??0,N=(E==null?void 0:E.height)??0,_=r+(a!=="center"?"-"+a:""),j=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},A=Array.isArray(d)?d:[d],F=A.length>0,T={padding:j,boundary:A.filter(Ive),altBoundary:F},{refs:P,floatingStyles:R,placement:L,isPositioned:M,middlewareData:U}=MVe({strategy:"fixed",placement:_,whileElementsMounted:em((...Ee)=>CVe(...Ee,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:y.anchor},middleware:[$Ve({mainAxis:s+N,alignmentAxis:l}),u&&FVe({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?BVe():void 0,...T}),u&&UVe({...T}),QVe({...T,apply:em(({elements:Ee,rects:Je,availableWidth:De,availableHeight:Pe})=>{const{width:Ne,height:Ke}=Je.reference,wt=Ee.floating.style;wt.setProperty("--radix-popper-available-width",`${De}px`),wt.setProperty("--radix-popper-available-height",`${Pe}px`),wt.setProperty("--radix-popper-anchor-width",`${Ne}px`),wt.setProperty("--radix-popper-anchor-height",`${Ke}px`)},"apply")}),k&&VVe({element:k,padding:c}),ZVe({arrowWidth:C,arrowHeight:N}),p&&zVe({strategy:"referenceHidden",...T,boundary:F?T.boundary:void 0})]}),I=y.setPlacementState;Jc(()=>(I(L),()=>{I(void 0)}),[L,I]);const[H,Z]=bR(L),Q=$u(b);Jc(()=>{M&&(Q==null||Q())},[M,Q]);const q=(re=U.arrow)==null?void 0:re.x,B=(ge=U.arrow)==null?void 0:ge.y,te=((G=U.arrow)==null?void 0:G.centerOffset)!==0,[ce,se]=m.useState();return Jc(()=>{x&&se(window.getComputedStyle(x).zIndex)},[x]),o.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:M?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[(K=U.transformOrigin)==null?void 0:K.x,(ae=U.transformOrigin)==null?void 0:ae.y].join(" "),...((ue=U.hide)==null?void 0:ue.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:o.jsx(XVe,{scope:i,placedSide:H,placedAlign:Z,onArrowChange:S,arrowX:q,arrowY:B,shouldHideArrow:te,children:o.jsx(wr.div,{"data-side":H,"data-align":Z,...v,ref:w,style:{...v.style,animation:M?(xe=v.style)==null?void 0:xe.animation:"none"}})})})},"PopperContent"));function Ive(e){return e!==null}em(Ive,"isNotNull");var ZVe=em(e=>({name:"transformOrigin",options:e,fn(t){var v,y,x;const{placement:n,rects:i,middlewareData:r}=t,a=((v=r.arrow)==null?void 0:v.centerOffset)!==0,l=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[u,d]=bR(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((y=r.arrow)==null?void 0:y.x)??0)+l/2,p=(((x=r.arrow)==null?void 0:x.y)??0)+c/2;let g="",b="";return u==="bottom"?(g=a?f:`${h}px`,b=`${-c}px`):u==="top"?(g=a?f:`${h}px`,b=`${i.floating.height+c}px`):u==="right"?(g=`${-c}px`,b=a?f:`${p}px`):u==="left"&&(g=`${i.floating.width+c}px`,b=a?f:`${p}px`),{data:{x:g,y:b}}}}),"transformOrigin");function bR(e){const[t,n="center"]=e.split("-");return[t,n]}em(bR,"getSideAndAlignFromPlacement");var yR=WVe,T7=KVe,A7=YVe,JVe=Object.defineProperty,_7=(e,t)=>JVe(e,"name",{value:t,configurable:!0}),KD=!1;function Pve(){const[e,t]=m.useState(KD);return m.useEffect(()=>{KD||(KD=!0,t(!0))},[]),e}_7(Pve,"useIsHydrated");var Dve=Fb[" useSyncExternalStore ".trim().toString()];function Mve(){return()=>{}}_7(Mve,"subscribe");function Lve(){return Dve(Mve,()=>!0,()=>!1)}_7(Lve,"useIsHydratedModern");var eHe=typeof Dve=="function"?Lve:Pve,tHe=Object.defineProperty,Gb=(e,t)=>tHe(e,"name",{value:t,configurable:!0}),XD="rovingFocusGroup.onEntryFocus",nHe={bubbles:!1,cancelable:!0},vR="RovingFocusGroup",[W4,$ve,iHe]=u7(vR),[rHe,Px]=kl(vR,[iHe]),[sHe,aHe]=rHe(vR),oHe=m.forwardRef(Gb(function(t,n){return o.jsx(W4.Provider,{scope:t.__scopeRovingFocusGroup,children:o.jsx(W4.Slot,{scope:t.__scopeRovingFocusGroup,children:o.jsx(lHe,{...t,ref:n})})})},"RovingFocusGroup")),lHe=m.forwardRef(Gb(function(t,n){const{__scopeRovingFocusGroup:i,orientation:r,loop:s=!1,dir:a,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...h}=t,p=m.useRef(null),g=ir(n,p),b=Wk(a),[v,y]=su({prop:l,defaultProp:c??null,onChange:u,caller:vR}),[x,O]=m.useState(!1),w=$u(d),k=$ve(i),S=m.useRef(!1),[E,C]=m.useState(0);return m.useEffect(()=>{const N=p.current;if(N)return N.addEventListener(XD,w),()=>N.removeEventListener(XD,w)},[w]),o.jsx(sHe,{scope:i,orientation:r,dir:b,loop:s,currentTabStopId:v,onItemFocus:m.useCallback(N=>y(N),[y]),onItemShiftTab:m.useCallback(()=>O(!0),[]),onFocusableItemAdd:m.useCallback(()=>C(N=>N+1),[]),onFocusableItemRemove:m.useCallback(()=>C(N=>N-1),[]),children:o.jsx(wr.div,{tabIndex:x||E===0?-1:0,"data-orientation":r,...h,ref:g,style:{outline:"none",...t.style},onMouseDown:yn(t.onMouseDown,()=>{S.current=!0}),onFocus:yn(t.onFocus,N=>{const _=!S.current;if(N.target===N.currentTarget&&_&&!x){const j=new CustomEvent(XD,nHe);if(N.currentTarget.dispatchEvent(j),!j.defaultPrevented){const A=k().filter(L=>L.focusable),F=A.find(L=>L.active),T=A.find(L=>L.id===v),R=[F,T,...A].filter(Boolean).map(L=>L.ref.current);N7(R,f)}}S.current=!1}),onBlur:yn(t.onBlur,()=>O(!1))})})},"RovingFocusGroupImpl")),cHe="RovingFocusGroupItem",uHe=m.forwardRef(Gb(function(t,n){const{__scopeRovingFocusGroup:i,focusable:r=!0,active:s=!1,tabStopId:a,children:l,...c}=t,u=mm(),d=a||u,f=aHe(cHe,i),h=f.currentTabStopId===d,p=$ve(i),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:v}=f,y=eHe();return Jc(()=>{if(!(!y||!r))return g(),()=>b()},[y,r,g,b]),m.useEffect(()=>{if(!(y||!r))return g(),()=>b()},[y,r,g,b]),o.jsx(W4.ItemSlot,{scope:i,id:d,focusable:r,active:s,children:o.jsx(wr.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:yn(t.onMouseDown,x=>{r?f.onItemFocus(d):x.preventDefault()}),onFocus:yn(t.onFocus,()=>f.onItemFocus(d)),onKeyDown:yn(t.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){f.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const O=Bve(x,f.orientation,f.dir);if(O!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let k=p().filter(S=>S.focusable).map(S=>S.ref.current);if(O==="last")k.reverse();else if(O==="prev"||O==="next"){O==="prev"&&k.reverse();const S=k.indexOf(x.currentTarget);k=f.loop?Uve(k,S+1):k.slice(S+1)}setTimeout(()=>N7(k))}}),children:typeof l=="function"?l({isCurrentTabStop:h,hasTabStop:v!=null}):l})})},"RovingFocusGroupItem")),dHe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Fve(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Gb(Fve,"getDirectionAwareKey");function Bve(e,t,n){const i=Fve(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return dHe[i]}Gb(Bve,"getFocusIntent");function N7(e,t=!1){const n=document.activeElement;for(const i of e)if(i===n||(i.focus({preventScroll:t}),document.activeElement!==n))return}Gb(N7,"focusFirst");function Uve(e,t){return e.map((n,i)=>e[(t+i)%e.length])}Gb(Uve,"wrapArray");var j7=oHe,R7=uHe,fHe=Object.defineProperty,Qi=(e,t)=>fHe(e,"name",{value:t,configurable:!0}),G4=["Enter"," "],hHe=["ArrowDown","PageUp","Home"],Qve=["ArrowUp","PageDown","End"],pHe=[...hHe,...Qve],mHe={ltr:[...G4,"ArrowRight"],rtl:[...G4,"ArrowLeft"]},gHe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},xR="Menu",[OS,bHe,yHe]=u7(xR),[Kb,zve]=kl(xR,[yHe,Ix,Px]),wR=Ix(),Vve=Px(),[Hve,$m]=Kb(xR),[vHe,Kk]=Kb(xR),xHe=Qi(e=>{const{__scopeMenu:t,open:n=!1,children:i,dir:r,onOpenChange:s,modal:a=!0}=e,l=wR(t),[c,u]=m.useState(null),d=m.useRef(!1),f=$u(s),h=Wk(r);return m.useEffect(()=>{const p=Qi(()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},"handleKeyDown"),g=Qi(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),m.useEffect(()=>{if(!n)return;const p=Qi(()=>f(!1),"handleBlur");return window.addEventListener("blur",p),()=>window.removeEventListener("blur",p)},[n,f]),o.jsx(yR,{...l,children:o.jsx(Hve,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:o.jsx(vHe,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:a,children:i})})})},"Menu"),qve=m.forwardRef(Qi(function(t,n){const{__scopeMenu:i,...r}=t,s=wR(i);return o.jsx(T7,{...s,...r,ref:n})},"MenuAnchor")),Wve="MenuPortal",[wHe,Gve]=Kb(Wve,{forceMount:void 0}),OHe=Qi(e=>{const{__scopeMenu:t,forceMount:n,children:i,container:r}=e,s=$m(Wve,t);return o.jsx(wHe,{scope:t,forceMount:n,children:o.jsx(Gd,{present:n||s.open,children:o.jsx(m7,{asChild:!0,container:r,children:i})})})},"MenuPortal"),Pu="MenuContent",[SHe,I7]=Kb(Pu),kHe=m.forwardRef(Qi(function(t,n){const i=Gve(Pu,t.__scopeMenu),{forceMount:r=i.forceMount,...s}=t,a=$m(Pu,t.__scopeMenu),l=Kk(Pu,t.__scopeMenu);return o.jsx(OS.Provider,{scope:t.__scopeMenu,children:o.jsx(Gd,{present:r||a.open,children:o.jsx(OS.Slot,{scope:t.__scopeMenu,children:l.modal?o.jsx(EHe,{...s,ref:n}):o.jsx(CHe,{...s,ref:n})})})})},"MenuContent")),EHe=m.forwardRef(Qi(function(t,n){const i=$m(Pu,t.__scopeMenu),r=m.useRef(null),s=ir(n,r);return m.useEffect(()=>{const a=r.current;if(a)return mve(a)},[]),o.jsx(P7,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:i.open,disableOutsideScroll:!0,onFocusOutside:yn(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentModal")),CHe=m.forwardRef(Qi(function(t,n){const i=$m(Pu,t.__scopeMenu);return o.jsx(P7,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentNonModal")),THe=Oh("MenuContent.ScrollLock"),P7=m.forwardRef(Qi(function(t,n){const{__scopeMenu:i,loop:r=!1,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:p,onDismiss:g,disableOutsideScroll:b,...v}=t,y=$m(Pu,i),x=Kk(Pu,i),O=wR(i),w=Vve(i),k=bHe(i),[S,E]=m.useState(null),C=m.useRef(null),N=ir(n,C,y.onContentChange),_=m.useRef(0),j=m.useRef(""),A=m.useRef(0),F=m.useRef(null),T=m.useRef("right"),P=m.useRef(0),R=b?b7:m.Fragment,L=b?{as:THe,allowPinchZoom:!0}:void 0,M=Qi(I=>{var se,re;const H=j.current+I,Z=k().filter(ge=>!ge.disabled),Q=document.activeElement,q=(se=Z.find(ge=>ge.ref.current===Q))==null?void 0:se.textValue,B=Z.map(ge=>ge.textValue),te=nxe(B,H,q),ce=(re=Z.find(ge=>ge.textValue===te))==null?void 0:re.ref.current;Qi(function ge(G){j.current=G,window.clearTimeout(_.current),G!==""&&(_.current=window.setTimeout(()=>ge(""),1e3))},"updateSearch")(H),ce&&setTimeout(()=>ce.focus())},"handleTypeaheadSearch");m.useEffect(()=>()=>window.clearTimeout(_.current),[]),uR();const U=m.useCallback(I=>{var Z,Q;return T.current===((Z=F.current)==null?void 0:Z.side)&&rxe(I,(Q=F.current)==null?void 0:Q.area)},[]);return o.jsx(SHe,{scope:i,searchRef:j,onItemEnter:m.useCallback(I=>{U(I)&&I.preventDefault()},[U]),onItemLeave:m.useCallback(I=>{var H;U(I)||((H=C.current)==null||H.focus(),E(null))},[U]),onTriggerLeave:m.useCallback(I=>{U(I)&&I.preventDefault()},[U]),pointerGraceTimerRef:A,onPointerGraceIntentChange:m.useCallback(I=>{F.current=I},[]),children:o.jsx(R,{...L,children:o.jsx(eve,{asChild:!0,trapped:s,onMountAutoFocus:yn(a,I=>{var H;I.preventDefault(),(H=C.current)==null||H.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:o.jsx(f7,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:p,onDismiss:g,children:o.jsx(j7,{asChild:!0,...w,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:E,onEntryFocus:yn(u,I=>{x.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(A7,{role:"menu","aria-orientation":"vertical","data-state":M7(y.open),"data-radix-menu-content":"",dir:x.dir,...O,...v,ref:N,style:{outline:"none",...v.style},onKeyDown:yn(v.onKeyDown,I=>{const Z=I.target.closest("[data-radix-menu-content]")===I.currentTarget,Q=I.ctrlKey||I.altKey||I.metaKey,q=I.key.length===1;Z&&(I.key==="Tab"&&I.preventDefault(),!Q&&q&&M(I.key));const B=C.current;if(I.target!==B||!pHe.includes(I.key))return;I.preventDefault();const ce=k().filter(se=>!se.disabled).map(se=>se.ref.current);Qve.includes(I.key)&&ce.reverse(),exe(ce)}),onBlur:yn(t.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(_.current),j.current="")}),onPointerMove:yn(t.onPointerMove,Bv(I=>{const H=I.target,Z=P.current!==I.clientX;if(I.currentTarget.contains(H)&&Z){const Q=I.clientX>P.current?"right":"left";T.current=Q,P.current=I.clientX}}))})})})})})})},"MenuContentImpl")),AHe=m.forwardRef(Qi(function(t,n){const{__scopeMenu:i,...r}=t;return o.jsx(wr.div,{role:"group",...r,ref:n})},"MenuGroup")),K4="MenuItem",sG="menu.itemSelect",D7=m.forwardRef(Qi(function(t,n){const{disabled:i=!1,onSelect:r,...s}=t,a=m.useRef(null),l=Kk(K4,t.__scopeMenu),c=I7(K4,t.__scopeMenu),u=ir(n,a),d=m.useRef(!1),f=Qi(()=>{const h=a.current;if(!i&&h){const p=new CustomEvent(sG,{bubbles:!0,cancelable:!0});h.addEventListener(sG,g=>r==null?void 0:r(g),{once:!0}),c7(h,p),p.defaultPrevented?d.current=!1:l.onClose()}},"handleSelect");return o.jsx(Kve,{...s,ref:u,disabled:i,onClick:yn(t.onClick,f),onPointerDown:h=>{var p;(p=t.onPointerDown)==null||p.call(t,h),d.current=!0},onPointerUp:yn(t.onPointerUp,h=>{var p;d.current||(p=h.currentTarget)==null||p.click()}),onKeyDown:yn(t.onKeyDown,h=>{i||h.target!==h.currentTarget||c.searchRef.current!==""&&h.key===" "||G4.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})},"MenuItem")),Kve=m.forwardRef(Qi(function(t,n){const{__scopeMenu:i,disabled:r=!1,textValue:s,...a}=t,l=I7(K4,i),c=Vve(i),u=m.useRef(null),d=ir(n,u),[f,h]=m.useState(!1),[p,g]=m.useState("");return m.useEffect(()=>{const b=u.current;b&&g((b.textContent??"").trim())},[a.children]),o.jsx(OS.ItemSlot,{scope:i,disabled:r,textValue:s??p,children:o.jsx(R7,{asChild:!0,...c,focusable:!r,children:o.jsx(wr.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:d,onPointerMove:yn(t.onPointerMove,Bv(b=>{r?l.onItemLeave(b):(l.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:yn(t.onPointerLeave,Bv(b=>l.onItemLeave(b))),onFocus:yn(t.onFocus,()=>h(!0)),onBlur:yn(t.onBlur,()=>h(!1))})})})},"MenuItemImpl")),_He=m.forwardRef(Qi(function(t,n){const{checked:i=!1,onCheckedChange:r,...s}=t;return o.jsx(Yve,{scope:t.__scopeMenu,checked:i,children:o.jsx(D7,{role:"menuitemcheckbox","aria-checked":SS(i)?"mixed":i,...s,ref:n,"data-state":OR(i),onSelect:yn(s.onSelect,()=>r==null?void 0:r(SS(i)?!0:!i),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),NHe="MenuRadioGroup",[jHe,RHe]=Kb(NHe,{value:void 0,onValueChange:Qi(()=>{},"onValueChange")}),IHe=m.forwardRef(Qi(function(t,n){const{value:i,onValueChange:r,...s}=t,a=$u(r);return o.jsx(jHe,{scope:t.__scopeMenu,value:i,onValueChange:a,children:o.jsx(AHe,{...s,ref:n})})},"MenuRadioGroup")),PHe="MenuRadioItem",DHe=m.forwardRef(Qi(function(t,n){const{value:i,...r}=t,s=RHe(PHe,t.__scopeMenu),a=i===s.value;return o.jsx(Yve,{scope:t.__scopeMenu,checked:a,children:o.jsx(D7,{role:"menuitemradio","aria-checked":a,...r,ref:n,"data-state":OR(a),onSelect:yn(r.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,i)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),Xve="MenuItemIndicator",[Yve,MHe]=Kb(Xve,{checked:!1}),LHe=m.forwardRef(Qi(function(t,n){const{__scopeMenu:i,forceMount:r,...s}=t,a=MHe(Xve,i);return o.jsx(Gd,{present:r||SS(a.checked)||a.checked===!0,children:o.jsx(wr.span,{...s,ref:n,"data-state":OR(a.checked)})})},"MenuItemIndicator")),$He=m.forwardRef(Qi(function(t,n){const{__scopeMenu:i,...r}=t;return o.jsx(wr.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})},"MenuSeparator")),Zve="MenuSub",[FHe,Jve]=Kb(Zve),BHe=Qi(e=>{const{__scopeMenu:t,children:n,open:i=!1,onOpenChange:r}=e,s=$m(Zve,t),a=wR(t),[l,c]=m.useState(null),[u,d]=m.useState(null),f=$u(r);return m.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),o.jsx(yR,{...a,children:o.jsx(Hve,{scope:t,open:i,onOpenChange:f,content:u,onContentChange:d,children:o.jsx(FHe,{scope:t,contentId:mm(),triggerId:mm(),trigger:l,onTriggerChange:c,children:n})})})},"MenuSub"),cT="MenuSubTrigger",UHe=m.forwardRef(Qi(function(t,n){const i=$m(cT,t.__scopeMenu),r=Kk(cT,t.__scopeMenu),s=Jve(cT,t.__scopeMenu),a=I7(cT,t.__scopeMenu),l=m.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=a,d={__scopeMenu:t.__scopeMenu},f=m.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);m.useEffect(()=>f,[f]),m.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),u(null)}},[c,u]);const h=ir(n,s.onTriggerChange);return o.jsx(qve,{asChild:!0,...d,children:o.jsx(Kve,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?s.contentId:void 0,"data-state":M7(i.open),...t,ref:h,onClick:p=>{var g;(g=t.onClick)==null||g.call(t,p),!(t.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),i.open||i.onOpenChange(!0))},onPointerMove:yn(t.onPointerMove,Bv(p=>{a.onItemEnter(p),!p.defaultPrevented&&!t.disabled&&!i.open&&!l.current&&(a.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{i.onOpenChange(!0),f()},100))})),onPointerLeave:yn(t.onPointerLeave,Bv(p=>{var b,v;f();const g=(b=i.content)==null?void 0:b.getBoundingClientRect();if(g){const y=(v=i.content)==null?void 0:v.dataset.side,x=y==="right",O=x?-5:5,w=g[x?"left":"right"],k=g[x?"right":"left"];a.onPointerGraceIntentChange({area:[{x:p.clientX+O,y:p.clientY},{x:w,y:g.top},{x:k,y:g.top},{x:k,y:g.bottom},{x:w,y:g.bottom}],side:y}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(p),p.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:yn(t.onKeyDown,p=>{var b;t.disabled||p.target!==p.currentTarget||a.searchRef.current!==""&&p.key===" "||mHe[r.dir].includes(p.key)&&(i.onOpenChange(!0),(b=i.content)==null||b.focus(),p.preventDefault())})})})},"MenuSubTrigger")),QHe="MenuSubContent",zHe=m.forwardRef(Qi(function(t,n){const i=Gve(Pu,t.__scopeMenu),{forceMount:r=i.forceMount,align:s="start",...a}=t,l=$m(Pu,t.__scopeMenu),c=Kk(Pu,t.__scopeMenu),u=Jve(QHe,t.__scopeMenu),d=m.useRef(null),f=ir(n,d);return o.jsx(OS.Provider,{scope:t.__scopeMenu,children:o.jsx(Gd,{present:r||l.open,children:o.jsx(OS.Slot,{scope:t.__scopeMenu,children:o.jsx(P7,{id:u.contentId,"aria-labelledby":u.triggerId,...a,ref:f,align:s,side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var p;c.isUsingKeyboardRef.current&&((p=d.current)==null||p.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:yn(t.onFocusOutside,h=>{h.target!==u.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:yn(t.onEscapeKeyDown,h=>{c.onClose(),h.preventDefault()}),onKeyDown:yn(t.onKeyDown,h=>{var b;const p=h.currentTarget.contains(h.target),g=gHe[c.dir].includes(h.key);p&&g&&(l.onOpenChange(!1),(b=u.trigger)==null||b.focus(),h.preventDefault())})})})})})},"MenuSubContent"));function M7(e){return e?"open":"closed"}Qi(M7,"getOpenState");function SS(e){return e==="indeterminate"}Qi(SS,"isIndeterminate");function OR(e){return SS(e)?"indeterminate":e?"checked":"unchecked"}Qi(OR,"getCheckedState");function exe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}Qi(exe,"focusFirst");function txe(e,t){return e.map((n,i)=>e[(t+i)%e.length])}Qi(txe,"wrapArray");function nxe(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=txe(e,Math.max(s,0));r.length===1&&(a=a.filter(u=>u!==n));const c=a.find(u=>u.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}Qi(nxe,"getNextMatch");function ixe(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,a=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}Qi(ixe,"isPointInPolygon");function rxe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return ixe(n,t)}Qi(rxe,"isPointerInGraceArea");function Bv(e){return t=>t.pointerType==="mouse"?e(t):void 0}Qi(Bv,"whenMouse");var VHe=xHe,HHe=qve,qHe=OHe,WHe=kHe,GHe=D7,KHe=_He,XHe=IHe,YHe=DHe,ZHe=LHe,JHe=$He,eqe=BHe,tqe=UHe,nqe=zHe,iqe=Object.defineProperty,mc=(e,t)=>iqe(e,"name",{value:t,configurable:!0}),L7="DropdownMenu",[rqe,ZVt]=kl(L7,[zve]),gc=zve(),[sqe,sxe]=rqe(L7),aqe=mc(e=>{const{__scopeDropdownMenu:t,children:n,dir:i,open:r,defaultOpen:s,onOpenChange:a,modal:l=!0}=e,c=gc(t),u=m.useRef(null),[d,f]=su({prop:r,defaultProp:s??!1,onChange:a,caller:L7});return o.jsx(sqe,{scope:t,triggerId:mm(),triggerRef:u,contentId:mm(),open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(h=>!h),[f]),modal:l,children:o.jsx(VHe,{...c,open:d,onOpenChange:f,dir:i,modal:l,children:n})})},"DropdownMenu"),oqe="DropdownMenuTrigger",lqe=m.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,disabled:r=!1,...s}=t,a=sxe(oqe,i),l=gc(i),c=ir(n,a.triggerRef);return o.jsx(HHe,{asChild:!0,...l,children:o.jsx(wr.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:c,onPointerDown:yn(t.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(a.onOpenToggle(),a.open||u.preventDefault())}),onKeyDown:yn(t.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&a.onOpenToggle(),u.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),cqe=mc(e=>{const{__scopeDropdownMenu:t,...n}=e,i=gc(t);return o.jsx(qHe,{...i,...n})},"DropdownMenuPortal"),uqe="DropdownMenuContent",dqe=m.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=sxe(uqe,i),a=gc(i),l=m.useRef(!1);return o.jsx(WHe,{id:s.contentId,"aria-labelledby":s.triggerId,...a,...r,ref:n,onCloseAutoFocus:yn(t.onCloseAutoFocus,c=>{var u;l.current||(u=s.triggerRef.current)==null||u.focus(),l.current=!1,c.preventDefault()}),onInteractOutside:yn(t.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;(!s.modal||f)&&(l.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),fqe=m.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(GHe,{...s,...r,ref:n})},"DropdownMenuItem")),hqe=m.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(KHe,{...s,...r,ref:n})},"DropdownMenuCheckboxItem")),pqe=m.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(XHe,{...s,...r,ref:n})},"DropdownMenuRadioGroup")),mqe=m.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(YHe,{...s,...r,ref:n})},"DropdownMenuRadioItem")),gqe=m.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(ZHe,{...s,...r,ref:n})},"DropdownMenuItemIndicator")),bqe=m.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(JHe,{...s,...r,ref:n})},"DropdownMenuSeparator")),yqe=mc(e=>{const{__scopeDropdownMenu:t,children:n,open:i,onOpenChange:r,defaultOpen:s}=e,a=gc(t),[l,c]=su({prop:i,defaultProp:s??!1,onChange:r,caller:"DropdownMenuSub"});return o.jsx(eqe,{...a,open:l,onOpenChange:c,children:n})},"DropdownMenuSub"),vqe=m.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(tqe,{...s,...r,ref:n})},"DropdownMenuSubTrigger")),xqe=m.forwardRef(mc(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gc(i);return o.jsx(nqe,{...s,...r,ref:n,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent")),wqe=aqe,Oqe=lqe,axe=cqe,Sqe=dqe,oxe=fqe,kqe=hqe,Eqe=pqe,Cqe=mqe,lxe=gqe,Tqe=bqe,Aqe=yqe,_qe=vqe,Nqe=xqe,jqe=Object.defineProperty,Fm=(e,t)=>jqe(e,"name",{value:t,configurable:!0}),$7="Popover",[cxe,JVt]=kl($7,[Ix]),F7=Ix(),[Rqe,Dx]=cxe($7),Iqe=Fm(e=>{const{__scopePopover:t,children:n,open:i,defaultOpen:r,onOpenChange:s,modal:a=!1}=e,l=F7(t),c=m.useRef(null),[u,d]=m.useState(!1),[f,h]=su({prop:i,defaultProp:r??!1,onChange:s,caller:$7});return o.jsx(yR,{...l,children:o.jsx(Rqe,{scope:t,contentId:mm(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:u,onCustomAnchorAdd:m.useCallback(()=>d(!0),[]),onCustomAnchorRemove:m.useCallback(()=>d(!1),[]),modal:a,children:n})})},"Popover"),Pqe="PopoverTrigger",Dqe=m.forwardRef(Fm(function(t,n){const{__scopePopover:i,...r}=t,s=Dx(Pqe,i),a=F7(i),l=ir(n,s.triggerRef),c=o.jsx(wr.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":B7(s.open),...r,ref:l,onClick:yn(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:o.jsx(T7,{asChild:!0,...a,children:c})},"PopoverTrigger")),uxe="PopoverPortal",[Mqe,Lqe]=cxe(uxe,{forceMount:void 0}),$qe=Fm(e=>{const{__scopePopover:t,forceMount:n,children:i,container:r}=e,s=Dx(uxe,t);return o.jsx(Mqe,{scope:t,forceMount:n,children:o.jsx(Gd,{present:n||s.open,children:o.jsx(m7,{asChild:!0,container:r,children:i})})})},"PopoverPortal"),kS="PopoverContent",Fqe=m.forwardRef(Fm(function(t,n){const i=Lqe(kS,t.__scopePopover),{forceMount:r=i.forceMount,...s}=t,a=Dx(kS,t.__scopePopover);return o.jsx(Gd,{present:r||a.open,children:a.modal?o.jsx(Uqe,{...s,ref:n}):o.jsx(Qqe,{...s,ref:n})})},"PopoverContent")),Bqe=Oh("PopoverContent.RemoveScroll"),Uqe=m.forwardRef(Fm(function(t,n){const i=Dx(kS,t.__scopePopover),r=m.useRef(null),s=ir(n,r),a=m.useRef(!1);return m.useEffect(()=>{const l=r.current;if(l)return mve(l)},[]),o.jsx(b7,{as:Bqe,allowPinchZoom:!0,children:o.jsx(dxe,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:yn(t.onCloseAutoFocus,l=>{var c;l.preventDefault(),a.current||(c=i.triggerRef.current)==null||c.focus()}),onPointerDownOutside:yn(t.onPointerDownOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;a.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:yn(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),Qqe=m.forwardRef(Fm(function(t,n){const i=Dx(kS,t.__scopePopover),r=m.useRef(!1),s=m.useRef(!1);return o.jsx(dxe,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var l,c;(l=t.onCloseAutoFocus)==null||l.call(t,a),a.defaultPrevented||(r.current||(c=i.triggerRef.current)==null||c.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=a.target;((d=i.triggerRef.current)==null?void 0:d.contains(l))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})},"PopoverContentNonModal")),dxe=m.forwardRef(Fm(function(t,n){const{__scopePopover:i,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,...h}=t,p=Dx(kS,i),g=F7(i);return uR(),o.jsx(eve,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:o.jsx(f7,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>p.onOpenChange(!1),deferPointerDownOutside:!0,children:o.jsx(A7,{"data-state":B7(p.open),role:"dialog",id:p.contentId,...g,...h,ref:n,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl"));function B7(e){return e?"open":"closed"}Fm(B7,"getState");var fxe=Iqe,hxe=Dqe,pxe=$qe,mxe=Fqe,zqe=Object.defineProperty,yo=(e,t)=>zqe(e,"name",{value:t,configurable:!0}),gxe="Radio",[Vqe,bxe]=kl(gxe),[Hqe,SR]=Vqe(gxe);function yxe(e){const{__scopeRadio:t,checked:n=!1,children:i,disabled:r,form:s,name:a,onCheck:l,required:c,value:u="on",internal_do_not_use_render:d}=e,[f,h]=m.useState(null),[p,g]=m.useState(null),b=m.useRef(!1),[v,y]=m.useReducer(w=>w+1,0),x=f?!!s||!!f.closest("form"):!0,O={checked:n,disabled:r,required:c,name:a,form:s,value:u,control:f,setControl:h,hasConsumerStoppedPropagationRef:b,userInteractionCount:v,onUserInteraction:y,isFormControl:x,bubbleInput:p,setBubbleInput:g,onCheck:yo(()=>l==null?void 0:l(),"onCheck")};return o.jsx(Hqe,{scope:t,...O,children:vxe(d)?d(O):i})}yo(yxe,"RadioProvider");var qqe="RadioTrigger",Wqe=m.forwardRef(yo(function({__scopeRadio:t,onClick:n,...i},r){const{checked:s,disabled:a,value:l,setControl:c,onCheck:u,hasConsumerStoppedPropagationRef:d,onUserInteraction:f,isFormControl:h,bubbleInput:p}=SR(qqe,t),g=ir(r,c);return o.jsx(wr.button,{type:"button",role:"radio","aria-checked":s,"data-state":U7(s),"data-disabled":a?"":void 0,disabled:a,value:l,...i,ref:g,onClick:yn(n,b=>{s||(f(),u()),p&&h&&(d.current=b.isPropagationStopped(),d.current||b.stopPropagation())})})},"RadioTrigger")),Gqe="RadioIndicator",Kqe=m.forwardRef(yo(function(t,n){const{__scopeRadio:i,forceMount:r,...s}=t,a=SR(Gqe,i);return o.jsx(Gd,{present:r||a.checked,children:o.jsx(wr.span,{"data-state":U7(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:n})})},"RadioIndicator")),Xqe="RadioBubbleInput",Yqe=m.forwardRef(yo(function({__scopeRadio:t,onClick:n,...i},r){const{control:s,checked:a,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:p,hasConsumerStoppedPropagationRef:g,userInteractionCount:b}=SR(Xqe,t),v=ir(r,p),y=Gk(s),x=m.useRef(!1),O=m.useRef(a),w=m.useRef(b);m.useEffect(()=>{const S=h;if(!S)return;const E=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(E,"checked").set,_=b!==w.current;w.current=b;const j=O.current!==a;O.current=a;const A=!(_&&g.current);if(j&&N){x.current=!_;const F=new Event("click",{bubbles:A});N.call(S,a),S.dispatchEvent(F),x.current=!1}},[h,a,g,b]);const k=m.useRef(a);return o.jsx(wr.input,{type:"radio","aria-hidden":!0,defaultChecked:k.current,required:l,disabled:c,name:u,value:d,form:f,...i,tabIndex:-1,ref:v,onClick:yn(n,S=>{x.current&&S.stopPropagation()}),style:{...i.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function vxe(e){return typeof e=="function"}yo(vxe,"isFunction");function U7(e){return e?"checked":"unchecked"}yo(U7,"getState");var Zqe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Q7="RadioGroup",[Jqe,eHt]=kl(Q7,[Px,bxe]),xxe=Px(),kR=bxe(),[eWe,tWe]=Jqe(Q7),nWe=m.forwardRef(yo(function(t,n){const{__scopeRadioGroup:i,name:r,form:s,defaultValue:a,value:l,required:c=!1,disabled:u=!1,orientation:d,dir:f,loop:h=!0,onValueChange:p,...g}=t,b=xxe(i),v=Wk(f),[y,x]=su({prop:l,defaultProp:a??null,onChange:p,caller:Q7}),[O,w]=m.useState(null),k=ir(n,w),S=m.useRef(y);return m.useEffect(()=>{const E=s?O==null?void 0:O.ownerDocument.getElementById(s):O==null?void 0:O.closest("form");if(E instanceof HTMLFormElement){const C=yo(()=>x(S.current),"reset");return E.addEventListener("reset",C),()=>E.removeEventListener("reset",C)}},[O,s,x]),o.jsx(eWe,{scope:i,name:r,form:s,required:c,disabled:u,value:y,onValueChange:x,children:o.jsx(j7,{asChild:!0,...b,orientation:d,dir:v,loop:h,children:o.jsx(wr.div,{role:"radiogroup","aria-required":c,"aria-orientation":d,"data-disabled":u?"":void 0,dir:v,...g,ref:k})})})},"RadioGroup")),iWe="RadioGroupItemProvider",rWe="RadioGroupItemTrigger";function wxe(e){const{__scopeRadioGroup:t,value:n,disabled:i,children:r,internal_do_not_use_render:s}=e,a=tWe(iWe,t),l=kR(t),c=a.disabled||i;return o.jsx(yxe,{...l,checked:a.value===n,disabled:c,required:a.required,name:a.name,form:a.form,value:n,onCheck:()=>a.onValueChange(n),internal_do_not_use_render:s,children:r})}yo(wxe,"RadioGroupItemProvider");var sWe=m.forwardRef(yo(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=xxe(i),a=kR(i),{checked:l,disabled:c}=SR(rWe,a.__scopeRadio),u=m.useRef(null),d=ir(n,u),f=m.useRef(!1);return m.useEffect(()=>{const h=yo(g=>{Zqe.includes(g.key)&&(f.current=!0)},"handleKeyDown"),p=yo(()=>f.current=!1,"handleKeyUp");return document.addEventListener("keydown",h),document.addEventListener("keyup",p),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",p)}},[]),o.jsx(R7,{asChild:!0,...s,focusable:!c,active:l,children:o.jsx(Wqe,{...a,...r,ref:d,onKeyDown:yn(r.onKeyDown,h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:yn(r.onFocus,()=>{var h;f.current&&((h=u.current)==null||h.click())})})})},"RadioGroupItemTrigger")),aWe=m.forwardRef(yo(function(t,n){const{__scopeRadioGroup:i,value:r,disabled:s,...a}=t;return o.jsx(wxe,{__scopeRadioGroup:i,value:r,disabled:s,internal_do_not_use_render:({isFormControl:l})=>o.jsxs(o.Fragment,{children:[o.jsx(sWe,{...a,ref:n,__scopeRadioGroup:i}),l&&o.jsx(oWe,{__scopeRadioGroup:i})]})})},"RadioGroupItem")),oWe=m.forwardRef(yo(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=kR(i);return o.jsx(Yqe,{...s,...r,ref:n})},"RadioGroupItemBubbleInput")),lWe=m.forwardRef(yo(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=kR(i);return o.jsx(Kqe,{...s,...r,ref:n})},"RadioGroupIndicator")),cWe=Object.defineProperty,ym=(e,t)=>cWe(e,"name",{value:t,configurable:!0}),z7="Switch",[uWe,tHt]=kl(z7),[dWe,V7]=uWe(z7);function Oxe(e){const{__scopeSwitch:t,checked:n,children:i,defaultChecked:r,disabled:s,form:a,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,p]=su({prop:n,defaultProp:r??!1,onChange:c,caller:z7}),[g,b]=m.useState(null),[v,y]=m.useState(null),x=m.useRef(!1),[O,w]=m.useReducer(E=>E+1,0),k=g?!!a||!!g.closest("form"):!0,S={checked:h,setChecked:p,disabled:s,control:g,setControl:b,name:l,form:a,value:d,hasConsumerStoppedPropagationRef:x,userInteractionCount:O,onUserInteraction:w,required:u,defaultChecked:r,isFormControl:k,bubbleInput:v,setBubbleInput:y};return o.jsx(dWe,{scope:t,...S,children:Sxe(f)?f(S):i})}ym(Oxe,"SwitchProvider");var fWe="SwitchTrigger",hWe=m.forwardRef(ym(function({__scopeSwitch:t,onClick:n,...i},r){const{control:s,form:a,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:p,onUserInteraction:g,isFormControl:b,bubbleInput:v}=V7(fWe,t),y=ir(r,f),x=m.useRef(u);return m.useEffect(()=>{const O=a?s==null?void 0:s.ownerDocument.getElementById(a):s==null?void 0:s.form;if(O instanceof HTMLFormElement){const w=ym(()=>h(x.current),"reset");return O.addEventListener("reset",w),()=>O.removeEventListener("reset",w)}},[s,a,h]),o.jsx(wr.button,{type:"button",role:"switch","aria-checked":u,"aria-required":d,"data-state":H7(u),"data-disabled":c?"":void 0,disabled:c,value:l,...i,ref:y,onClick:yn(n,O=>{g(),h(w=>!w),v&&b&&(p.current=O.isPropagationStopped(),p.current||O.stopPropagation())})})},"SwitchTrigger")),pWe=m.forwardRef(ym(function(t,n){const{__scopeSwitch:i,name:r,checked:s,defaultChecked:a,required:l,disabled:c,value:u,onCheckedChange:d,form:f,...h}=t;return o.jsx(Oxe,{__scopeSwitch:i,checked:s,defaultChecked:a,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:p})=>o.jsxs(o.Fragment,{children:[o.jsx(hWe,{...h,ref:n,__scopeSwitch:i}),p&&o.jsx(yWe,{__scopeSwitch:i})]})})},"Switch")),mWe="SwitchThumb",gWe=m.forwardRef(ym(function(t,n){const{__scopeSwitch:i,...r}=t,s=V7(mWe,i);return o.jsx(wr.span,{"data-state":H7(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:n})},"SwitchThumb")),bWe="SwitchBubbleInput",yWe=m.forwardRef(ym(function({__scopeSwitch:t,onClick:n,...i},r){const{control:s,hasConsumerStoppedPropagationRef:a,userInteractionCount:l,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:p,form:g,bubbleInput:b,setBubbleInput:v}=V7(bWe,t),y=ir(r,v),x=Gk(s),O=m.useRef(!1),w=m.useRef(c),k=m.useRef(l);m.useEffect(()=>{const E=b;if(!E)return;const C=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(C,"checked").set,j=l!==k.current;k.current=l;const A=w.current!==c;w.current=c;const F=!(j&&a.current);if(A&&_){O.current=!j;const T=new Event("click",{bubbles:F});_.call(E,c),E.dispatchEvent(T),O.current=!1}},[b,c,a,l]);const S=m.useRef(c);return o.jsx(wr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??S.current,required:d,disabled:f,name:h,value:p,form:g,...i,tabIndex:-1,ref:y,onClick:yn(n,E=>{O.current&&E.stopPropagation()}),style:{...i.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function Sxe(e){return typeof e=="function"}ym(Sxe,"isFunction");function H7(e){return e?"checked":"unchecked"}ym(H7,"getState");var vWe=Object.defineProperty,xWe=(e,t)=>vWe(e,"name",{value:t,configurable:!0}),wWe="Toggle",OWe=m.forwardRef(xWe(function(t,n){const{pressed:i,defaultPressed:r,onPressedChange:s,...a}=t,[l,c]=su({prop:i,onChange:s,defaultProp:r??!1,caller:wWe});return o.jsx(wr.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":t.disabled?"":void 0,...a,ref:n,onClick:yn(t.onClick,()=>{t.disabled||c(!l)})})},"Toggle")),SWe=Object.defineProperty,vm=(e,t)=>SWe(e,"name",{value:t,configurable:!0}),Mx="ToggleGroup",[kxe,nHt]=kl(Mx,[Px]),Exe=Px(),kWe=m.forwardRef(vm(function(t,n){const{type:i,...r}=t;if(i==="single"){const s=r;return o.jsx(EWe,{role:"radiogroup",...s,ref:n})}if(i==="multiple"){const s=r;return o.jsx(CWe,{role:"toolbar",...s,ref:n})}throw new Error(`Missing prop \`type\` expected on \`${Mx}\``)},"ToggleGroup")),[Cxe,Txe]=kxe(Mx),EWe=m.forwardRef(vm(function(t,n){const{value:i,defaultValue:r,onValueChange:s=vm(()=>{},"onValueChange"),...a}=t,[l,c]=su({prop:i,defaultProp:r??"",onChange:s,caller:Mx});return o.jsx(Cxe,{scope:t.__scopeToggleGroup,type:"single",value:m.useMemo(()=>l?[l]:[],[l]),onItemActivate:c,onItemDeactivate:m.useCallback(()=>c(""),[c]),children:o.jsx(Axe,{...a,ref:n})})},"ToggleGroupImplSingle")),CWe=m.forwardRef(vm(function(t,n){const{value:i,defaultValue:r,onValueChange:s=vm(()=>{},"onValueChange"),...a}=t,[l,c]=su({prop:i,defaultProp:r??[],onChange:s,caller:Mx}),u=m.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=m.useCallback(f=>c((h=[])=>h.filter(p=>p!==f)),[c]);return o.jsx(Cxe,{scope:t.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:u,onItemDeactivate:d,children:o.jsx(Axe,{...a,ref:n})})},"ToggleGroupImplMultiple")),[TWe,AWe]=kxe(Mx),Axe=m.forwardRef(vm(function(t,n){const{__scopeToggleGroup:i,disabled:r=!1,rovingFocus:s=!0,orientation:a,dir:l,loop:c=!0,...u}=t,d=Exe(i),f=Wk(l),h={dir:f,...u};return o.jsx(TWe,{scope:i,rovingFocus:s,disabled:r,children:s?o.jsx(j7,{asChild:!0,...d,orientation:a,dir:f,loop:c,children:o.jsx(wr.div,{...h,ref:n})}):o.jsx(wr.div,{...h,ref:n})})},"ToggleGroupImpl")),X4="ToggleGroupItem",_We=m.forwardRef(vm(function(t,n){const i=Txe(X4,t.__scopeToggleGroup),r=AWe(X4,t.__scopeToggleGroup),s=Exe(t.__scopeToggleGroup),a=i.value.includes(t.value),l=r.disabled||t.disabled,c={...t,pressed:a,disabled:l},u=m.useRef(null);return r.rovingFocus?o.jsx(R7,{asChild:!0,...s,focusable:!l,active:a,ref:u,children:o.jsx(aG,{...c,ref:n})}):o.jsx(aG,{...c,ref:n})},"ToggleGroupItem")),aG=m.forwardRef(vm(function(t,n){const{__scopeToggleGroup:i,value:r,...s}=t,a=Txe(X4,i),l={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},c=a.type==="single"?l:void 0;return o.jsx(OWe,{...c,...s,ref:n,onPressedChange:u=>{u?a.onItemActivate(r):a.onItemDeactivate(r)}})},"ToggleGroupItemImpl")),NWe=Object.defineProperty,La=(e,t)=>NWe(e,"name",{value:t,configurable:!0}),[q7,iHt]=kl("Tooltip",[Ix]),W7=Ix(),jWe="TooltipProvider",RWe=700,Y4="tooltip.open",[IWe,G7]=q7(jWe),PWe=La(e=>{const{__scopeTooltip:t,delayDuration:n=RWe,skipDelayDuration:i=300,disableHoverableContent:r=!1,children:s}=e,a=m.useRef(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),o.jsx(IWe,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:m.useCallback(()=>{i<=0||(window.clearTimeout(c.current),a.current=!1)},[i]),onClose:m.useCallback(()=>{i<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,i))},[i]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(u=>{l.current=u},[]),disableHoverableContent:r,children:s})},"TooltipProvider"),Z4="Tooltip",[DWe,Xk]=q7(Z4),MWe=La(e=>{const{__scopeTooltip:t,children:n,open:i,defaultOpen:r,onOpenChange:s,disableHoverableContent:a,delayDuration:l}=e,c=G7(Z4,e.__scopeTooltip),u=W7(t),[d,f]=m.useState(null),[h,p]=m.useState(void 0),g=mm(),b=m.useRef(0),v=a??c.disableHoverableContent,y=l??c.delayDuration,x=m.useRef(!1),[O,w]=su({prop:i,defaultProp:r??!1,onChange:La(_=>{_?(c.onOpen(),document.dispatchEvent(new CustomEvent(Y4))):c.onClose(),s==null||s(_)},"onChange"),caller:Z4}),k=m.useMemo(()=>O?x.current?"delayed-open":"instant-open":"closed",[O]),S=m.useCallback(()=>{window.clearTimeout(b.current),b.current=0,x.current=!1,w(!0)},[w]),E=m.useCallback(()=>{window.clearTimeout(b.current),b.current=0,w(!1)},[w]),C=m.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{x.current=!0,w(!0),b.current=0},y)},[y,w]);m.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]);const N=h??g;return o.jsx(yR,{...u,children:o.jsx(DWe,{scope:t,contentId:N,setContentId:p,open:O,stateAttribute:k,trigger:d,onTriggerChange:f,onTriggerEnter:m.useCallback(()=>{c.isOpenDelayedRef.current?C():S()},[c.isOpenDelayedRef,C,S]),onTriggerLeave:m.useCallback(()=>{v?E():(window.clearTimeout(b.current),b.current=0)},[E,v]),onOpen:S,onClose:E,disableHoverableContent:v,children:n})})},"Tooltip"),oG="TooltipTrigger",LWe=m.forwardRef(La(function(t,n){const{__scopeTooltip:i,...r}=t,s=Xk(oG,i),a=G7(oG,i),l=W7(i),c=m.useRef(null),u=ir(n,c,s.onTriggerChange),d=m.useRef(!1),f=m.useRef(!1),h=m.useCallback(()=>d.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),o.jsx(T7,{asChild:!0,...l,children:o.jsx(wr.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:u,onPointerMove:yn(t.onPointerMove,p=>{p.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:yn(t.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:yn(t.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:yn(t.onFocus,()=>{d.current||s.onOpen()}),onBlur:yn(t.onBlur,s.onClose),onClick:yn(t.onClick,s.onClose)})})},"TooltipTrigger")),_xe="TooltipPortal",[$We,FWe]=q7(_xe,{forceMount:void 0}),BWe=La(e=>{const{__scopeTooltip:t,forceMount:n,children:i,container:r}=e,s=Xk(_xe,t);return o.jsx($We,{scope:t,forceMount:n,children:o.jsx(Gd,{present:n||s.open,children:o.jsx(m7,{asChild:!0,container:r,children:i})})})},"TooltipPortal"),ES="TooltipContent",UWe=m.forwardRef(La(function(t,n){const i=FWe(ES,t.__scopeTooltip),{forceMount:r=i.forceMount,side:s="top",...a}=t,l=Xk(ES,t.__scopeTooltip);return o.jsx(Gd,{present:r||l.open,children:l.disableHoverableContent?o.jsx(Nxe,{side:s,...a,ref:n}):o.jsx(QWe,{side:s,...a,ref:n})})},"TooltipContent")),QWe=m.forwardRef(La(function(t,n){const i=Xk(ES,t.__scopeTooltip),r=G7(ES,t.__scopeTooltip),s=m.useRef(null),a=ir(n,s),[l,c]=m.useState(null),{trigger:u,onClose:d}=i,f=s.current,{onPointerInTransitChange:h}=r,p=m.useCallback(()=>{c(null),h(!1)},[h]),g=m.useCallback((b,v)=>{const y=b.currentTarget,x={x:b.clientX,y:b.clientY},O=jxe(x,y.getBoundingClientRect()),w=Rxe(x,O),k=Ixe(v.getBoundingClientRect()),S=Dxe([...w,...k]);c(S),h(!0)},[h]);return m.useEffect(()=>()=>p(),[p]),m.useEffect(()=>{if(u&&f){const b=La(y=>g(y,f),"handleTriggerLeave"),v=La(y=>g(y,u),"handleContentLeave");return u.addEventListener("pointerleave",b),f.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",v)}}},[u,f,g,p]),m.useEffect(()=>{if(l){const b=La(v=>{const y=v.target,x={x:v.clientX,y:v.clientY},O=(u==null?void 0:u.contains(y))||(f==null?void 0:f.contains(y)),w=!Pxe(x,l);O?p():w&&(p(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,f,l,d,p]),o.jsx(Nxe,{...t,ref:a})},"TooltipContentHoverable")),zWe=jye("TooltipContent"),Nxe=m.forwardRef(La(function(t,n){const{__scopeTooltip:i,children:r,"aria-label":s,id:a,onEscapeKeyDown:l,onPointerDownOutside:c,...u}=t,d=Xk(ES,i),f=W7(i),{onClose:h}=d;m.useEffect(()=>(document.addEventListener(Y4,h),()=>document.removeEventListener(Y4,h)),[h]),m.useEffect(()=>{if(d.trigger){const g=La(b=>{b.target instanceof Node&&b.target.contains(d.trigger)&&h()},"handleScroll");return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[d.trigger,h]);const{setContentId:p}=d;return Jc(()=>(p(a),()=>{p(void 0)}),[a,p]),o.jsx(f7,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:h,children:o.jsxs(A7,{"data-state":d.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:d.contentId,...f,...u,ref:n,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(zWe,{children:r}),s?o.jsx(dQe,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl"));function jxe(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,i,r,s)){case s:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}La(jxe,"getExitSideFromRect");function Rxe(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}La(Rxe,"getPaddedExitPoints");function Ixe(e){const{top:t,right:n,bottom:i,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:i},{x:r,y:i}]}La(Ixe,"getPointsFromRect");function Pxe(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,a=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}La(Pxe,"isPointInPolygon");function Dxe(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),Mxe(t)}La(Dxe,"getHull");function Mxe(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}La(Mxe,"getHullPresorted");var VWe=PWe,HWe=MWe,Lxe=LWe,qWe=BWe,WWe=UWe;function xm(e){const t=m.useRef(e);return t.current=e,t}let Uv=[],uT=!1;const lG=e=>{var t,n;if(e.key==="Escape"){const[i]=Uv;i&&(e.preventDefault(),(n=(t=i.callback).current)==null||n.call(t))}},$xe=()=>{Uv.length>0&&!uT?(document.body.addEventListener("keydown",lG),uT=!0):Uv.length===0&&uT&&(document.body.removeEventListener("keydown",lG),uT=!1)},GWe=e=>{Uv.unshift(e),$xe()},KWe=({id:e})=>{Uv=Uv.filter(t=>t.id!==e),$xe()},Yk=(e,t)=>{const n=m.useId(),i=xm(t);m.useEffect(()=>{if(!e)return;const r={id:n,callback:i};return GWe(r),()=>KWe(r)},[n,e,i])},XWe=m.createContext(null);function Fxe(){const e=m.useContext(XWe);return(e==null?void 0:e.linkComponent)??"a"}function Zk(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}const YWe=()=>Eye,cG=(e,t=!1,n="TransitionGroup")=>{const i=[];return m.Children.forEach(e,r=>{if(r&&typeof r=="object"&&"key"in r&&r.key)i.push(r);else if(t)throw new Error(`Child elements of <${n} /> must include a \`key\``)}),i},P0=()=>{},D0=e=>{const t=m.useRef(e);return t.current=e,m.useCallback(n=>t.current(n),[])};function ZWe(e,t,n,i){const r=e.reduce((c,u)=>({...c,[u.key]:1}),{}),s=t.reduce((c,u)=>({...c,[u.component.key]:1}),{}),a=e.filter(c=>!s[c.key]).map(n),l=t.map(c=>({...c,component:e.find(({key:u})=>u===c.component.key)||c.component,shouldRender:!!r[c.component.key]}));return i==="append"?l.concat(a):a.concat(l)}function JWe(e,t,n){if((Eye||qUe)&&t&&n>1)throw new Error(`Cannot use forwardRef with multiple children in <${e} />`)}const eGe="_TransitionGroupChild_1hv1z_1",tGe={TransitionGroupChild:eGe},Bxe={enter:!1,enterActive:!1,exit:!1,exitActive:!1,interrupted:!1},nGe=e=>({...Bxe,enter:!e}),iGe=(e,t)=>{switch(t.type){case"enter-before":return{enter:!0,enterActive:!1,exit:!1,exitActive:!1,interrupted:e.interrupted||e.exit};case"enter-active":return{enter:!0,enterActive:!0,exit:!1,exitActive:!1,interrupted:!1};case"exit-before":return{enter:!1,enterActive:!1,exit:!0,exitActive:!1,interrupted:e.interrupted||e.enter};case"exit-active":return{enter:!1,enterActive:!1,exit:!0,exitActive:!0,interrupted:!1};case"done":default:return Bxe}},rGe=({ref:e,as:t,children:n,className:i,transitionId:r,style:s,preventMountTransition:a,shouldRender:l,enterDuration:c,exitDuration:u,removeChild:d,onEnter:f,onEnterActive:h,onEnterComplete:p,onExit:g,onExitActive:b,onExitComplete:v})=>{const[y,x]=m.useReducer(iGe,nGe(a||!1)),O=m.useRef(!1),w=m.useRef(null),k=m.useRef(c);k.current=c;const S=m.useRef(u);S.current=u;const E=m.useRef(null),C=m.useCallback(N=>{const _=w.current;if(!(!_||N===E.current))switch(E.current=N,N){case"enter":f(_);break;case"enter-active":h(_);break;case"enter-complete":p(_);break;case"exit":g(_);break;case"exit-active":b(_);break;case"exit-complete":v(_);break}},[f,h,p,g,b,v]);return ii.useLayoutEffect(()=>{if(!l){let j;x({type:"exit-before"}),C("exit");const A=F_(()=>{x({type:"exit-active"}),C("exit-active"),j=window.setTimeout(()=>{C("exit-complete"),d()},S.current)});return()=>{A(),j!==void 0&&clearTimeout(j)}}if(a&&!O.current){O.current=!0;return}let N;x({type:"enter-before"}),C("enter");const _=F_(()=>{x({type:"enter-active"}),C("enter-active"),N=window.setTimeout(()=>{x({type:"done"}),C("enter-complete")},k.current)});return()=>{_(),N!==void 0&&clearTimeout(N)}},[l,a,d,C]),m.useEffect(()=>()=>{O.current=!1},[]),o.jsx(t,{ref:Zk([w,e]),className:pi(i,tGe.TransitionGroupChild),"data-transition-id":r,style:s,"data-entering":y.enter?"":void 0,"data-entering-active":y.enterActive?"":void 0,"data-exiting":y.exit?"":void 0,"data-exiting-active":y.exitActive?"":void 0,"data-interrupted":y.interrupted?"":void 0,children:n})},sGe=e=>{const{enterMountDelay:t,preventMountTransition:n}=e,i=!n&&t!=null?t:null,[r,s]=m.useState(i==null);return a7(()=>s(!0),r?null:i),r?o.jsx(rGe,{...e}):null},Lx=e=>{const{ref:t,as:n="span",children:i,className:r,transitionId:s,style:a,enterDuration:l=0,exitDuration:c=0,preventInitialTransition:u=!0,enterMountDelay:d,insertMethod:f="append",disableAnimations:h=YWe()}=e,p=D0(e.onEnter??P0),g=D0(e.onEnterActive??P0),b=D0(e.onEnterComplete??P0),v=D0(e.onExit??P0),y=D0(e.onExitActive??P0),x=D0(e.onExitComplete??P0);m.Children.forEach(i,S=>{if(S&&!S.key)throw new Error("Child elements of must include a `key`")});const O=m.useCallback(S=>({component:S,shouldRender:!0,removeChild:()=>{k(E=>E.filter(C=>S.key!==C.component.key))},onEnter:p,onEnterActive:g,onEnterComplete:b,onExit:v,onExitActive:y,onExitComplete:x}),[p,g,b,v,y,x]),[w,k]=m.useState(()=>cG(i).map(S=>({...O(S),preventMountTransition:u})));return m.useLayoutEffect(()=>{k(S=>{const E=cG(i);return ZWe(E,S,O,f)})},[i,f,O]),JWe("TransitionGroup",t,m.Children.count(i)),h?o.jsx(o.Fragment,{children:m.Children.map(i,S=>o.jsx(n,{ref:t,className:r,style:a,"data-transition-id":s,children:S}))}):o.jsx(o.Fragment,{children:w.map(({component:S,...E})=>o.jsx(sGe,{...E,as:n,className:r,transitionId:s,enterDuration:l,exitDuration:c,enterMountDelay:d,style:a,ref:t,children:S},S.key))})},aGe="_Button_1864l_1",oGe="_ButtonInner_1864l_4",lGe="_ButtonLoader_1864l_749",YD={Button:aGe,ButtonInner:oGe,ButtonLoader:lGe},Wt=e=>{const{type:t="button",color:n="primary",variant:i="solid",pill:r=!0,uniform:s=!1,size:a="md",iconSize:l,gutterSize:c,loading:u,selected:d,block:f,opticallyAlign:h,children:p,className:g,onClick:b,disabled:v,disabledTone:y,inert:x=u,...O}=e,w=v||x,k=m.useCallback(S=>{v||b==null||b(S)},[b,v]);return o.jsxs("button",{type:t,className:pi(YD.Button,g),"data-color":n,"data-variant":i,"data-pill":r?"":void 0,"data-uniform":s?"":void 0,"data-size":a,"data-gutter-size":c,"data-icon-size":l,"data-loading":u?"":void 0,"data-selected":d?"":void 0,"data-block":f?"":void 0,"data-optically-align":h,onPointerEnter:o7,disabled:w,"aria-disabled":w,tabIndex:w?-1:void 0,"data-disabled":v?"":void 0,"data-disabled-tone":v?y:void 0,onClick:k,...O,children:[o.jsx(Lx,{className:YD.ButtonLoader,enterDuration:250,exitDuration:150,children:u&&o.jsx(Hk,{},"loader")}),o.jsx("span",{className:YD.ButtonInner,children:s7(p)})]})},cGe=()=>{var e;return typeof ClipboardItem<"u"&&!!((e=navigator.clipboard)!=null&&e.write)};function uGe(e){const{"text/plain":t,...n}=e;return new ClipboardItem({...n,...t?{"text/plain":new Blob([t],{type:"text/plain"})}:null})}async function dGe(e,t=document.body){if(typeof e=="string")return uG(e,t);try{return cGe()?(await navigator.clipboard.write([uGe(e)]),!0):e["text/plain"]?uG(e["text/plain"],t):!1}catch{return!1}}async function uG(e,t=document.body){if(navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}const n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.top="0",n.style.left="0",n.style.opacity="0",t.appendChild(n),n.focus(),n.select();let i=!1;try{i=document.execCommand("copy")}catch{}return t.removeChild(n),i}const fGe="_TransitionItem_1o7b1_1",hGe={TransitionItem:fGe},pGe=e=>{const{as:t="span",className:n,children:i,preventInitialTransition:r,insertMethod:s,transitionClassName:a,transitionPosition:l="absolute"}=e,{enterTotalDuration:c,exitTotalDuration:u,variables:d}=vGe(e);return o.jsx(t,{className:pi("block",l==="absolute"&&"relative",n),"data-transition-position":l,style:d,children:o.jsx(Lx,{as:t,className:pi(hGe.TransitionItem,a),enterDuration:c,exitDuration:u,insertMethod:s,preventInitialTransition:r,children:i})})},mGe=400,gGe=500,bGe=200,yGe=300;function vGe({initial:e,enter:t,exit:n,forceCompositeLayer:i}){const r=LD(e),s=LD(t),a=LD(n),l=[r,a,s].some(b=>b!=="none"),c=(t==null?void 0:t.duration)??(l?gGe:mGe),u=(t==null?void 0:t.timingFunction)??(l?"var(--cubic-enter)":"ease"),d=(n==null?void 0:n.duration)??(l?yGe:bGe),f=(n==null?void 0:n.timingFunction)??(l?"var(--cubic-exit)":"ease"),h=Wb({"tg-will-change":i?"transform, opacity":"auto","tg-enter-opacity":MD((t==null?void 0:t.opacity)??1),"tg-enter-transform":s,"tg-enter-filter":$D(t),"tg-enter-duration":tT(c),"tg-enter-delay":tT((t==null?void 0:t.delay)??0),"tg-enter-timing-function":u,"tg-exit-opacity":MD((n==null?void 0:n.opacity)??0),"tg-exit-transform":a,"tg-exit-filter":$D(n),"tg-exit-duration":tT(d),"tg-exit-delay":tT((n==null?void 0:n.delay)??0),"tg-exit-timing-function":f,"tg-initial-opacity":MD((e==null?void 0:e.opacity)??(n==null?void 0:n.opacity)??0),"tg-initial-transform":r==="none"?a:r,"tg-initial-filter":$D(e??n??{})}),p=((t==null?void 0:t.delay)??0)+c,g=((n==null?void 0:n.delay)??0)+d;return{enterTotalDuration:p,exitTotalDuration:g,variables:h}}const K7=({children:e,copyValue:t,onClick:n,...i})=>{const[r,s]=m.useState(!1),a=m.useRef(null),l=c=>{r||(s(!0),n==null||n(c),dGe(typeof t=="function"?t():t),a.current=window.setTimeout(()=>{s(!1)},1300))};return m.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]),o.jsxs(Wt,{...i,onClick:l,children:[o.jsx(pGe,{className:"w-[var(--button-icon-size)] h-[var(--button-icon-size)]",initial:{scale:.6},enter:{scale:1,delay:150,duration:300},exit:{scale:.6,duration:150},forceCompositeLayer:!0,children:r?o.jsx(Lv,{},"copied-icon"):o.jsx(IF,{},"copy-icon")}),typeof e=="function"?e({copied:r}):e]})},xGe="_Menu_1t4b0_1",wGe="_MenuList_1t4b0_3",OGe="_MenuItemContent_1t4b0_53",SGe="_MenuItem_1t4b0_53",kGe="_ItemActions_1t4b0_98",EGe="_PressableInner_1t4b0_117",CGe="_Separator_1t4b0_135",TGe="_SubMenuItem_1t4b0_139",AGe="_SubTriggerIcon_1t4b0_141",_Ge="_RadioItem_1t4b0_151",NGe="_RadioIndicatorActive_1t4b0_158",jGe="_RadioIndicator_1t4b0_158",RGe="_CheckboxItem_1t4b0_249",IGe="_CheckboxIndicator_1t4b0_256",PGe="_CheckboxCircle_1t4b0_269",Wr={Menu:xGe,MenuList:wGe,MenuItemContent:OGe,MenuItem:SGe,ItemActions:kGe,PressableInner:EGe,Separator:CGe,SubMenuItem:TGe,SubTriggerIcon:AGe,RadioItem:_Ge,RadioIndicatorActive:NGe,RadioIndicator:jGe,CheckboxItem:RGe,CheckboxIndicator:IGe,CheckboxCircle:PGe},Uxe=m.createContext(null),Jk=()=>{const e=m.useContext(Uxe);if(!e)throw new Error("Menu components must be wrapped in ");return e},vr=({children:e,forceOpen:t,onOpen:n,onClose:i,modal:r=!1})=>{const[s,a]=m.useState(!1),l=t??s,c=xm(n),u=xm(i),d=m.useCallback(h=>{var p,g;a(h),h?(p=c.current)==null||p.call(c):(g=u.current)==null||g.call(u)},[c,u]);Yk(s,()=>{d(!1)});const f=m.useMemo(()=>({open:l,setOpen:d}),[l,d]);return o.jsx(Uxe.Provider,{value:f,children:o.jsx(wqe,{open:l,onOpenChange:d,modal:r,children:e})})},DGe=({className:e,children:t,disabled:n,onSelect:i,onClick:r})=>{const{open:s}=Jk(),a=l=>{s||l.preventDefault()};return i?o.jsx(oxe,{className:pi(Wr.MenuItem,e),onSelect:i,onClick:r,disabled:n,onPointerMove:a,onPointerLeave:a,children:o.jsx("div",{className:Wr.PressableInner,children:t})}):o.jsx("div",{className:pi(Wr.MenuItemContent,e),children:t})},MGe=({className:e,children:t})=>o.jsx("div",{className:pi(Wr.ItemActions,e),children:t}),LGe=({children:e,onClick:t})=>{const{setOpen:n}=Jk();return o.jsx(Wt,{className:"rounded-sm",color:"secondary",size:"xs",uniform:!0,iconSize:"sm",variant:"ghost",onClick:i=>{i.stopPropagation(),n(!1),t(i)},children:e})},$Ge=e=>{const{className:t,children:n,href:i,to:r,disabled:s,as:a,...l}=e,{open:c}=Jk(),u=i||r,d=u?/^https?:\/\//.test(u):!0,f=Fxe(),h=a||(d?"a":f),p=b=>{c||b.preventDefault()},g=d?{target:"_blank",rel:"noopener noreferrer",href:i??r}:{href:i,to:r};return o.jsx(oxe,{asChild:!0,className:pi(Wr.MenuItem,t),disabled:s,onPointerMove:d?void 0:p,onPointerLeave:d?void 0:p,children:o.jsx(h,{...g,...l,children:o.jsx("span",{className:Wr.PressableInner,children:n})})})},FGe=({className:e})=>o.jsx(Tqe,{className:pi(Wr.Separator,e),role:"separator"}),BGe=({children:e,side:t,sideOffset:n=5,align:i,alignOffset:r,width:s,minWidth:a,maxHeight:l})=>{const{open:c}=Jk();return o.jsx(axe,{forceMount:!0,children:o.jsx(Lx,{className:Wr.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:c&&o.jsx(Sqe,{forceMount:!0,className:Wr.MenuList,side:t,sideOffset:n,align:i,alignOffset:r??(i==="center"?0:-5),avoidCollisions:!0,collisionPadding:{bottom:30,top:30,left:12,right:12},onEscapeKeyDown:ih,style:Wb({"menu-width":s,"menu-min-width":a,"menu-max-height":l}),children:e},"dropdown")})})},UGe=({children:e,disabled:t})=>o.jsx(Oqe,{asChild:!0,disabled:t,children:e}),Qxe=m.createContext(null),zxe=()=>{const e=m.useContext(Qxe);if(!e)throw new Error("Submenu components must be wrapped in ");return e},QGe=({children:e,forceOpen:t,onOpen:n,onClose:i})=>{const[r,s]=m.useState(!1),a=m.useRef(null),l=t??r,c=xm(n),u=xm(i),d=m.useCallback(h=>{var p,g;s(h),h?(p=c.current)==null||p.call(c):(g=u.current)==null||g.call(u)},[c,u]);Yk(r,()=>{var h;d(!1),(h=a.current)==null||h.focus()});const f=m.useMemo(()=>({open:l,setOpen:d,triggerRef:a}),[l,d]);return o.jsx(Qxe.Provider,{value:f,children:o.jsx(Aqe,{open:l,onOpenChange:d,children:e})})},zGe=({className:e,children:t,disabled:n})=>{const{open:i}=Jk(),{triggerRef:r}=zxe(),s=a=>{i||a.preventDefault()};return o.jsx(_qe,{ref:r,className:pi(Wr.MenuItem,Wr.SubMenuItem,e),disabled:n,onPointerMove:s,onPointerLeave:s,children:o.jsxs("div",{className:Wr.PressableInner,children:[t,o.jsx(PFe,{width:"16",height:"16",className:Wr.SubTriggerIcon})]})})},VGe=({children:e,sideOffset:t=4,alignOffset:n=-6,width:i="auto",minWidth:r="auto",maxHeight:s})=>{const{open:a}=zxe();return o.jsx(axe,{forceMount:!0,children:o.jsx(Lx,{className:Wr.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:a&&o.jsx(Nqe,{className:Wr.MenuList,sideOffset:t,alignOffset:n,avoidCollisions:!0,collisionPadding:{bottom:30,top:30,left:12,right:12},onEscapeKeyDown:ih,style:Wb({"menu-width":i,"menu-min-width":r,"menu-max-height":s}),children:e},"submenu")})})},HGe=({children:e,value:t,onChange:n,indicatorPosition:i="end",...r})=>o.jsx(Eqe,{...r,value:t,onValueChange:s=>n(s),"data-indicator-position":i,children:e}),qGe=({className:e,children:t,...n})=>o.jsx(Cqe,{className:pi(Wr.MenuItem,Wr.RadioItem,e),...n,children:o.jsxs("div",{className:Wr.PressableInner,children:[o.jsx("div",{className:Wr.RadioIndicator,children:o.jsx(lxe,{className:Wr.RadioIndicatorActive})}),t]})}),WGe=({className:e,children:t,indicatorPosition:n="end",indicatorVariant:i="solid",...r})=>o.jsx(kqe,{className:pi(Wr.MenuItem,Wr.CheckboxItem,e),...r,"data-indicator-position":n,"data-indicator-variant":i,children:o.jsxs("div",{className:Wr.PressableInner,children:[o.jsx("div",{className:Wr.CheckboxIndicator,children:o.jsx(lxe,{children:i==="ghost"?o.jsx(Lv,{className:"size-4"}):o.jsx("div",{className:Wr.CheckboxCircle,children:o.jsx(Lv,{className:"size-4"})})})}),t]})});vr.Content=BGe;vr.Item=DGe;vr.ItemActions=MGe;vr.ItemAction=LGe;vr.Link=$Ge;vr.Separator=FGe;vr.Trigger=UGe;vr.Sub=QGe;vr.SubTrigger=zGe;vr.SubContent=VGe;vr.CheckboxItem=WGe;vr.RadioGroup=HGe;vr.RadioItem=qGe;const GGe="_Tooltip_16g2y_1",KGe="_TriggerDecorator_16g2y_73",Vxe={Tooltip:GGe,TriggerDecorator:KGe},Uo=e=>{const{ref:t,children:n,content:i,forceOpen:r=i===null?!1:void 0,maxWidth:s=300,openDelay:a=150,interactive:l=!1,compact:c=!1,preventUnintentionalClickToClose:u,align:d,alignOffset:f=0,side:h,sideOffset:p=5,gutterSize:g="md",contentClassName:b,onPointerDown:v,onClick:y,...x}=e,[O,w]=m.useState(!1),[k,S]=m.useState(!1);a7(()=>S(!1),k?400:null);const E=r??O,C=_=>{typeof r!="boolean"&&(w(_),u&&S(_))},N=_=>{u&&k&&(_.preventDefault(),_.stopPropagation())};return o.jsxs(Hxe,{open:E,delayDuration:a,onOpenChange:C,disableHoverableContent:!l,children:[o.jsx(Lxe,{asChild:!0,children:o.jsx(_ye,{...x,ref:t,onPointerDown:_=>{N(_),v==null||v(_)},onClick:_=>{N(_),y==null||y(_)},children:n})}),o.jsx(qxe,{maxWidth:s,compact:c,align:d,alignOffset:f,side:h,sideOffset:p,gutterSize:g,className:b,children:i})]})},Hxe=({children:e,open:t,onOpenChange:n,...i})=>(Yk(t,()=>{n(!1)}),o.jsx(VWe,{children:o.jsx(HWe,{open:t,onOpenChange:n,...i,children:e})})),qxe=({children:e,maxWidth:t=300,compact:n=!1,clickable:i=void 0,alignOffset:r=0,sideOffset:s=5,gutterSize:a="md",className:l,style:c,...u})=>o.jsx(qWe,{children:o.jsx(WWe,{...u,className:pi(Vxe.Tooltip,l),"data-compact":n,"data-clickable":i,"data-gutter-size":a,alignOffset:r,sideOffset:s,collisionPadding:15,hideWhenDetached:!0,style:{...c,maxWidth:t},onEscapeKeyDown:ih,children:e})}),XGe=({children:e,asChild:t=!0,...n})=>o.jsx(Lxe,{asChild:t,...n,children:e}),YGe=e=>{const{children:t,className:n,focusable:i=!0,ref:r,...s}=e,a=typeof t=="string";return o.jsx(_ye,{ref:r,...s,className:pi(Vxe.TriggerDecorator,n),tabIndex:i?0:void 0,children:a?o.jsx("span",{children:t}):t})};Uo.Root=Hxe;Uo.Content=qxe;Uo.Trigger=XGe;Uo.TriggerDecorator=YGe;const ZGe=50,dG=48;function JGe(e){return(e.events??[]).flatMap(t=>{var r,s;const i=(((r=t.content)==null?void 0:r.parts)??[]).map(a=>typeof a.text=="string"?a.text:"").filter(Boolean).join("");return i?[{text:i,role:t.author??((s=t.content)==null?void 0:s.role)??"",ts:t.timestamp}]:[]})}function eKe(e){var t,n;for(const i of e.events??[])if(i.author==="user"||((t=i.content)==null?void 0:t.role)==="user"){const r=(((n=i.content)==null?void 0:n.parts)??[]).map(s=>s.text).find(Boolean);if(r)return r}return V("search.untitledSession")}function tKe(e,t,n){const i=Math.max(0,t-dG),r=Math.min(e.length,t+n+dG);return(i>0?"…":"")+e.slice(i,r).trim()+(r{var c;if((c=l.events)!=null&&c.length)return l;try{return await iR(t,e,l.id)}catch{return l}})),a=[];for(const l of s)for(const{text:c,role:u,ts:d}of JGe(l)){const f=c.toLowerCase().indexOf(i);if(f!==-1){a.push({type:"session",appId:t,sessionId:l.id,title:eKe(l),snippet:tKe(c,f,i.length),role:u,ts:d??l.lastUpdateTime});break}}return a.sort((l,c)=>(c.ts??0)-(l.ts??0)),a.slice(0,ZGe)}async function iKe(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await r0e(e,t.trim())}catch(a){const l=String(a);return{results:[],note:l.includes("404")?V("search.webUnavailable"):V("search.webFailed",{message:l})}}const{mounted:i,results:r,error:s}=n;return i?s?{results:[],note:s}:{results:r.map((a,l)=>({type:"web",index:l,title:a.title,url:a.url,siteName:a.siteName,summary:a.summary}))}:{results:[],note:V("search.webNotMounted")}}async function rKe(e,t,n,i){if(!t||!i.trim())return{results:[]};const r=await i0e(t,e,i.trim(),n);if(!r.mounted)return{results:[],note:V(e==="knowledge"?"search.knowledgeNotMounted":"search.memoryNotMounted")};if(r.error)return{results:[],note:r.error};const s=r.sourceName??V(e==="knowledge"?"search.knowledge":"search.longTermMemory");return{results:r.results.map((a,l)=>e==="knowledge"?{type:"knowledge",index:l,content:a.content,sourceName:s,sourceType:r.sourceType}:{type:"memory",index:l,content:a.content,sourceName:s,sourceType:r.sourceType,author:a.author,ts:a.timestamp})}}async function sKe(e,t,n){return e==="session"?{results:await nKe(n.userId,n.appId,t)}:e==="web"?iKe(n.appId,t):rKe(e,n.appId,n.userId,t)}function Wxe({mirrored:e=!1}){return o.jsxs("g",{opacity:"0.5",transform:e?"translate(20 0) scale(-1 1)":void 0,children:[o.jsx("path",{className:"sidebar-panel-glyph__divider",d:"M5.938 6.833c.11 0 .249.102.249.292v6.042c0 .19-.14.291-.249.291s-.248-.101-.248-.291V7.125c0-.19.139-.292.248-.292Z",strokeWidth:"1.167"}),o.jsx("path",{className:"sidebar-panel-glyph__frame",d:"M14.5 3.75h-9a3 3 0 0 0-3 3v6.857a3 3 0 0 0 3 3h9a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3Z",strokeWidth:"1.667",strokeLinecap:"round",strokeLinejoin:"round"})]})}function aKe(e){return o.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:o.jsx(Wxe,{})})}function oKe(e){return o.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:o.jsx(Wxe,{mirrored:!0})})}function lKe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M12 8.333c.368 0 .667.299.667.667v2h2a.667.667 0 0 1 0 1.333h-2v2a.667.667 0 0 1-1.334 0v-2h-2a.667.667 0 0 1 0-1.333h2V9c0-.368.299-.667.667-.667ZM7.667 1c3.49 0 6.383 2.554 6.913 5.896a.667.667 0 0 1-1.317.208 5.667 5.667 0 1 0-9.708 4.424.67.67 0 0 1 .07.12.667.667 0 0 1-.13.834l-.95.853 4.788-.002a.667.667 0 0 1 0 1.334l-5.657.002c-.917 0-1.35-1.131-.67-1.744l1.163-1.045A6.97 6.97 0 0 1 .667 8c0-3.866 3.134-7 7-7Z",fill:"currentColor"})})}function cKe(e){return o.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"7.333",cy:"7.333",r:"5.333"}),o.jsx("path",{d:"m11.133 11.133 2.867 2.867"})]})}function uKe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M8 0.667c4.05 0 7.334 3.283 7.334 7.333 0 4.05-3.284 7.334-7.334 7.334S0.667 12.05 0.667 8 3.95 0.667 8 0.667Zm0 1.333a6 6 0 1 0 0 12A6 6 0 0 0 8 2ZM6.167 6c.368 0 .667.299.667.667v2a.667.667 0 0 1-1.334 0v-2c0-.368.299-.667.667-.667Zm3.666 0c.368 0 .667.299.667.667v2a.667.667 0 0 1-1.333 0v-2c0-.368.298-.667.666-.667Z",fill:"currentColor"})})}function Gxe(e){return o.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M7.58 2.6a.667.667 0 0 0-.667-.667h-.666a.667.667 0 0 0-.667.667v10.667c0 .368.299.666.667.666h.666a.667.667 0 0 0 .667-.666V2.6Zm1.333 10.667A2 2 0 0 1 6.913 15.267h-.666a2 2 0 0 1-2-2V2.6a2 2 0 0 1 2-2h.666a2 2 0 0 1 2 2v10.667Z",fill:"currentColor"}),o.jsx("path",{d:"M11.88 5.045a.667.667 0 0 0-.801-.514l-.653.136a.667.667 0 0 0-.504.786l1.85 8.092c.081.358.44.589.8.514l.653-.137a.667.667 0 0 0 .504-.786L11.88 5.045Zm3.155 7.82a2 2 0 0 1-1.512 2.358l-.653.136a2 2 0 0 1-2.403-1.541L8.617 5.726a2 2 0 0 1 1.513-2.358l.652-.136a2 2 0 0 1 2.404 1.541l1.849 8.092Z",fill:"currentColor"}),o.jsx("path",{d:"M4.247 2.6a.667.667 0 0 0-.667-.667h-.667a.667.667 0 0 0-.666.667v10.667c0 .368.298.666.666.666h.667a.667.667 0 0 0 .667-.666V2.6ZM5.58 13.267a2 2 0 0 1-2 2h-.667a2 2 0 0 1-2-2V2.6a2 2 0 0 1 2-2h.667a2 2 0 0 1 2 2v10.667Z",fill:"currentColor"})]})}function dKe({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 fKe({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 hKe({active:e=!1,onClick:t}){const{t:n}=Ce("workspaceTools");return o.jsxs("button",{className:`new-chat${e?" is-active":""}`,onClick:t,"aria-label":n("search.nav"),"aria-current":e?"page":void 0,title:n("search.nav"),children:[o.jsx(cKe,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:n("search.nav")})]})}function pKe(e,t,n,i){const r=!!e,s=new Set((t==null?void 0:t.searchSources)??[]),a=l=>r?n?i("search.checkingCapabilities"):i("search.notMounted",{label:l}):i("search.selectAgent");return[{id:"session",label:i("search.sources.session"),ready:r,unavailableLabel:i("search.selectAgent")},{id:"web",label:i("search.sources.web"),ready:r&&s.has("web"),description:i("search.webDescription"),unavailableLabel:a(" web_search")},{id:"knowledge",label:i("search.sources.knowledge"),ready:r&&s.has("knowledge"),unavailableLabel:a(i("search.sources.knowledge"))},{id:"memory",label:i("search.sources.memory"),ready:r&&s.has("memory"),unavailableLabel:a(i("search.sources.memory"))}]}function V_(e,t){return{context_search:"Context Search",local:t("search.backendLocal"),mem0:"Mem0",milvus:"Milvus",opensearch:"OpenSearch",openviking:"OpenViking",redis:"Redis",tos_vector:"TOS Vector",viking:"VikingDB"}[e.toLowerCase()]??e}function fG(e,t){return e?new Date(e*1e3).toLocaleString(t,{timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):""}function mKe({userId:e,appId:t,agentInfo:n,capabilitiesLoading:i,agentLabel:r,onOpenSession:s}){var M,U;const{t:a,i18n:l}=Ce("workspaceTools"),c=l.resolvedLanguage||l.language,[u,d]=m.useState("session"),[f,h]=m.useState(""),[p,g]=m.useState([]),[b,v]=m.useState(),[y,x]=m.useState(!1),[O,w]=m.useState(!1),[k,S]=m.useState(!1),E=m.useRef(0),C=m.useRef(null),N=pKe(t,n,i,a),_=N.find(I=>I.id===u),j=u==="knowledge"?(M=n==null?void 0:n.components)==null?void 0:M.find(I=>I.source==="knowledgebase"||I.kind==="knowledgebase"):u==="memory"?(U=n==null?void 0:n.components)==null?void 0:U.find(I=>I.source==="long_term_memory"||I.kind==="memory"):void 0;m.useEffect(()=>{E.current+=1,d("session"),g([]),v(void 0),w(!1),x(!1),S(!1)},[t]),m.useEffect(()=>{if(!k)return;function I(H){var Z;(Z=C.current)!=null&&Z.contains(H.target)||S(!1)}return document.addEventListener("pointerdown",I),()=>document.removeEventListener("pointerdown",I)},[k]);async function A(I,H){var B;const Z=I.trim();if(!Z||!((B=N.find(te=>te.id===H))!=null&&B.ready))return;const Q=++E.current;x(!0),w(!0);let q;try{q=await sKe(H,Z,{userId:e,appId:t})}catch(te){const ce=te instanceof Error?te.message:String(te);q={results:[],note:a("search.failed",{message:ce})}}Q===E.current&&(g(q.results),v(q.note),x(!1))}function F(I){E.current+=1,h(I),g([]),v(void 0),w(!1),x(!1)}function T(I){E.current+=1,d(I),S(!1),g([]),v(void 0),w(!1),x(!1)}const P=!!(_!=null&&_.ready),R=t?u==="web"?a("search.placeholder.web"):u==="knowledge"?a("search.placeholder.knowledge",{name:(j==null?void 0:j.name)??a("search.placeholder.knowledgeFallback")}):u==="memory"?a("search.placeholder.memory",{name:(j==null?void 0:j.name)??a("search.placeholder.memoryFallback")}):a("search.placeholder.session"):a("search.placeholder.selectAgent"),L=j!=null&&j.backend?V_(j.backend,a):"";return o.jsxs("div",{className:"search",children:[o.jsxs("div",{className:"search-box",children:[o.jsxs("div",{className:"search-source-picker-wrap",ref:C,children:[o.jsxs("button",{className:"search-source-picker",type:"button","aria-label":a("search.sourceTypeAria",{label:(_==null?void 0:_.label)??a("search.notSelected")}),"aria-haspopup":"listbox","aria-expanded":k,onClick:()=>S(I=>!I),children:[o.jsx("span",{children:(_==null?void 0:_.label)??a("search.sourceType")}),L&&o.jsx("small",{children:L}),o.jsx(fKe,{open:k})]}),k&&o.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":a("search.selectSource"),children:N.map(I=>{var Q,q;const H=I.id==="knowledge"?(Q=n==null?void 0:n.components)==null?void 0:Q.find(B=>B.source==="knowledgebase"||B.kind==="knowledgebase"):I.id==="memory"?(q=n==null?void 0:n.components)==null?void 0:q.find(B=>B.source==="long_term_memory"||B.kind==="memory"):void 0,Z=H?[H.name,H.backend?V_(H.backend,a):""].filter(Boolean).join(" · "):I.ready?I.description:I.unavailableLabel;return o.jsxs("button",{type:"button",role:"option","aria-selected":u===I.id,disabled:!I.ready,onClick:()=>T(I.id),children:[o.jsx("span",{children:I.label}),Z&&o.jsx("small",{children:Z})]},I.id)})})]}),o.jsx("span",{className:"search-box-divider","aria-hidden":!0}),o.jsx("input",{className:"search-input",value:f,onChange:I=>F(I.target.value),onKeyDown:I=>{I.key==="Enter"&&(I.preventDefault(),A(f,u))},placeholder:R,disabled:!P,autoFocus:!0}),o.jsx("button",{className:"search-go",onClick:()=>void A(f,u),disabled:!f.trim()||y,"aria-label":a("search.nav"),children:y?o.jsx(fi,{className:"icon spin"}):o.jsx(dKe,{className:"icon"})})]}),o.jsx("div",{className:"search-results",children:P?O?y?null:b?o.jsx("div",{className:"search-empty",children:b}):p.length===0&&O?o.jsx("div",{className:"search-empty",children:a("search.noResults",{query:f.trim()})}):p.map((I,H)=>o.jsx(gKe,{result:I,agentLabel:r,onOpen:s,locale:c},H)):o.jsx("div",{className:"search-empty",children:a(u==="web"?"search.instructions.web":u==="knowledge"?"search.instructions.knowledge":u==="memory"?"search.instructions.memory":"search.instructions.session")}):o.jsx("div",{className:"search-empty",children:t?i?a("search.loadingCapabilities"):(_==null?void 0:_.unavailableLabel)??a("search.sourceUnavailable"):a("search.noAgentHint")})})]})}function gKe({result:e,agentLabel:t,onOpen:n,locale:i}){const{t:r}=Ce("workspaceTools");switch(e.type){case"session":return o.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[o.jsx(Tbe,{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?` · ${fG(e.ts,i)}`:""]})]}),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(Zj,{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(gb,{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(hG,{source:"knowledge"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:r("search.knowledgeFragment",{index:e.index+1})}),o.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${V_(e.sourceType,r)}`:""]})]}),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(hG,{source:"memory"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:r("search.memoryFragment",{index:e.index+1})}),o.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${V_(e.sourceType,r)}`:"",e.ts?` · ${fG(e.ts,i)}`:""]})]}),o.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function hG({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"})]})}function bKe({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 yKe({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 Kxe(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.25 4.25h9.5a2.5 2.5 0 0 1 2.5 2.5v3.5"}),o.jsx("path",{d:"M13.25 17.75h-8a2.5 2.5 0 0 1-2.5-2.5v-8a3 3 0 0 1 3-3"}),o.jsx("path",{d:"M7 8.25h5.5M7 11.75h3.25"}),o.jsx("path",{d:"m13.35 16.65.42-2.16 4.76-4.76a1.35 1.35 0 0 1 1.91 1.91l-4.76 4.76-2.33.25Z"}),o.jsx("path",{d:"m17.65 10.6 1.9 1.9"})]})}const ER="/assets/media/logo-DCsNZy-k.svg",X7="data:image/svg+xml,%3csvg%20width='28'%20height='23'%20viewBox='0%200%2028%2023'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.1957%209.44218C17.0253%209.58161%2016.7774%209.47317%2016.7774%209.24079V8.01696V0.611967C16.7774%200.395085%2016.514%200.271152%2016.3591%200.410576L6.04172%209.16334C5.87132%209.30276%205.62345%209.19432%205.62345%208.96194V2.98218C5.62345%202.81178%205.48403%202.67235%205.31362%202.67235H0.309832C0.139424%202.67235%200%202.81178%200%202.98218V21.7115C0%2021.9284%200.263357%2022.0524%200.418273%2021.9129L10.7202%2013.1602C10.8906%2013.0207%2011.1385%2013.1292%2011.1385%2013.3616V22.0059C11.1385%2022.2228%2011.4018%2022.3467%2011.5567%2022.2073L21.8586%2013.4545C22.0291%2013.3151%2022.2769%2013.4235%2022.2769%2013.6559V19.6357C22.2769%2019.8061%2022.4163%2019.9455%2022.5868%2019.9455H27.5905C27.7609%2019.9455%2027.9004%2019.8061%2027.9004%2019.6357V0.890816C27.9004%200.673934%2027.637%200.550001%2027.4821%200.689425L17.1957%209.44218Z'%20fill='%230066FC'/%3e%3c/svg%3e",pG="(max-width: 860px)";function mG({title:e}){const t=m.useRef(null),n=m.useRef(null),[i,r]=m.useState(0);m.useLayoutEffect(()=>{const l=t.current,c=n.current;if(!l||!c)return;const u=()=>{const f=Math.max(0,Math.ceil(c.scrollWidth-l.clientWidth));r(h=>h===f?h:f)};u();const d=new ResizeObserver(u);return d.observe(l),d.observe(c),()=>d.disconnect()},[e]);const s=Math.min(12,Math.max(4.8,3.6+i/36)),a={"--history-title-translate":`-${i}px`,"--history-title-duration":`${s.toFixed(2)}s`};return o.jsx("span",{ref:t,className:`history-title${i>0?" is-overflowing":""}`,style:a,children:o.jsx("span",{ref:n,className:"history-title-text",children:e})})}function vKe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"7",cy:"7",r:"2.25"}),o.jsx("circle",{cx:"17",cy:"7",r:"2.25"}),o.jsx("circle",{cx:"7",cy:"17",r:"2.25"}),o.jsx("circle",{cx:"17",cy:"17",r:"2.25"})]})}function xKe(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:"12",cy:"12",r:"8.25"}),o.jsx("path",{d:"M3.75 12h16.5M12 3.75c2.1 2.2 3.2 4.95 3.2 8.25S14.1 18.05 12 20.25M12 3.75C9.9 5.95 8.8 8.7 8.8 12s1.1 6.05 3.2 8.25"})]})}function wKe(e){let t=2166136261;for(const i of e)t^=i.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 OKe={admin:"account.roles.admin",developer:"account.roles.developer",user:"account.roles.user"};function SKe({activePage:e,access:t,userInfo:n,onAgentKitCli:i,onDeveloperResources:r,onSystemInfo:s,onIssueFeedback:a,onLogout:l}){const{t:c,i18n:u}=Ce(["sidebar","common"]),[d,f]=m.useState("");if(!n)return null;const h=G7e(n)||c("sidebar:account.defaultUser"),p=typeof n.email=="string"?n.email.trim():"",g=wKe(h),b=K7e(n),v=b===d?"":b,y=wj(u.resolvedLanguage??u.language)??xj;return o.jsx("div",{className:"sidebar-user",children:o.jsxs("div",{className:"sidebar-user-row",children:[o.jsxs(vr,{modal:!0,children:[o.jsx(vr.Trigger,{children:o.jsxs("button",{type:"button",className:"sidebar-user-btn",title:h,children:[o.jsx("span",{className:`account-avatar${v?" has-image":""}`,style:g,"aria-hidden":"true",children:v?o.jsx("img",{className:"account-avatar-image",src:v,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>f(v)}):null}),o.jsx("span",{className:"sidebar-user-identity",children:o.jsx("span",{className:"sidebar-user-name",children:h})})]})}),o.jsxs(vr.Content,{side:"top",align:"start",sideOffset:4,minWidth:216,children:[o.jsxs("div",{className:"account-menu-head",children:[o.jsx("span",{className:`account-avatar account-avatar--lg${v?" has-image":""}`,style:g,"aria-hidden":"true",children:v?o.jsx("img",{className:"account-avatar-image",src:v,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>f(v)}):null}),o.jsxs("div",{className:"account-id",children:[o.jsxs("div",{className:"account-name-row",children:[o.jsx("div",{className:"account-name",children:h}),o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",pill:!0,children:c(`sidebar:${OKe[t.role]}`)})]}),p&&p!==h&&o.jsx("div",{className:"account-sub",children:p})]})]}),o.jsxs(vr.Item,{className:"account-menu-action",onSelect:s,children:[o.jsx(Wd,{className:"icon","aria-hidden":"true"}),c("sidebar:account.systemInfo")]}),o.jsxs(vr.Sub,{children:[o.jsx(vr.SubTrigger,{className:"account-menu-action",children:o.jsxs("span",{className:"account-menu-action__label",children:[o.jsx(xKe,{className:"icon"}),c("sidebar:account.language")]})}),o.jsx(vr.SubContent,{sideOffset:6,minWidth:136,children:o.jsx(vr.RadioGroup,{value:y,onChange:x=>{sLe(x)},indicatorPosition:"end",children:G8.map(x=>o.jsx(vr.RadioItem,{value:x,children:c(`common:languageNames.${x}`)},x))})})]}),o.jsxs(vr.Item,{className:"account-menu-action",onSelect:a,children:[o.jsx(Kxe,{className:"icon"}),c("sidebar:account.issueFeedback")]}),o.jsxs(vr.Item,{className:"account-menu-action",onSelect:l,children:[o.jsx(E7e,{className:"icon","aria-hidden":"true"}),c("sidebar:account.logout")]})]})]}),o.jsxs("div",{className:"sidebar-user-shortcuts","aria-label":c("sidebar:account.shortcuts"),children:[o.jsx(Uo,{compact:!0,content:c("sidebar:account.tryCli"),children:o.jsx("button",{type:"button",className:"sidebar-user-shortcut",onClick:i,"aria-label":c("sidebar:account.tryCli"),children:o.jsx(zFe,{className:"icon"})})}),o.jsx(Uo,{compact:!0,content:c("sidebar:account.developerResources"),children:o.jsx("button",{type:"button",className:`sidebar-user-shortcut${e==="developer-resources"?" is-active":""}`,onClick:r,"aria-label":c("sidebar:account.developerResources"),"aria-current":e==="developer-resources"?"page":void 0,children:o.jsx(jFe,{className:"icon"})})})]})]})})}function kKe({branding:e,cloudProvider:t,sessions:n,currentSessionId:i,activePage:r,features:s,access:a,streamingSids:l,evaluatingSids:c,sandboxHistory:u,onNewChat:d,onSearch:f,onQuickCreate:h,onLibrary:p,onAddAgent:g,onMyAgents:b,onWorkspace:v,onApplications:y,onCronJobs:x,onAgentKitCli:O,onDeveloperResources:w,onSystemInfo:k,onIssueFeedback:S,onPickSession:E,onDeleteSession:C,userInfo:N,onLogout:_}){const{t:j}=Ce("sidebar"),A=H=>(s==null?void 0:s[H])!==!1,[F,T]=m.useState(null),P=m.useRef(typeof window<"u"&&window.matchMedia(pG).matches),[R,L]=m.useState(P.current),M=n.map(H=>({id:H.id,title:cR(H.events,j("history.newConversation")),createdAt:(H.lastUpdateTime??0)*1e3})).sort((H,Z)=>Z.createdAt-H.createdAt),U=()=>{P.current=!1,L(H=>!H),T(null)};m.useEffect(()=>{const H=window.matchMedia(pG),Z=Q=>{Q.matches?L(q=>q||(P.current=!0,!0)):P.current&&(P.current=!1,L(!1))};return H.addEventListener("change",Z),()=>H.removeEventListener("change",Z)},[]);const I=t==="byteplus"?X7:ER;return o.jsxs("aside",{className:`sidebar ${R?"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:d,"aria-label":j("navigation.home"),title:j("navigation.home"),children:[o.jsx("img",{className:"brand-logo",src:e.logoUrl||I,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:U,"aria-label":j(R?"navigation.expand":"navigation.collapse"),title:j(R?"navigation.expand":"navigation.collapse"),children:R?o.jsx(oKe,{className:"icon"}):o.jsx(aKe,{className:"icon"})})]}),o.jsxs("nav",{className:"sidebar-nav","aria-label":j("navigation.label"),children:[A("newChat")&&o.jsxs("button",{className:`new-chat new-chat--conversation${r==="new-chat"?" is-active":""}`,onClick:d,"aria-label":j("navigation.newChat"),"aria-current":r==="new-chat"?"page":void 0,title:j("navigation.newChat"),children:[o.jsx(lKe,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.newChat")})]}),A("search")&&o.jsx(hKe,{active:r==="search",onClick:f}),o.jsxs("button",{className:`new-chat new-chat--agents${r==="agents"?" is-active":""}`,onClick:b,"aria-label":j("navigation.agents"),"aria-current":r==="agents"?"page":void 0,title:j("navigation.agents"),children:[o.jsx(uKe,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.agents")})]}),o.jsxs("button",{className:`new-chat new-chat--workspaces${r==="workspaces"?" is-active":""}`,onClick:v,"aria-label":j("navigation.workspaces"),"aria-current":r==="workspaces"?"page":void 0,title:j("navigation.workspaces"),children:[o.jsx(s7e,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.workspaces")})]}),o.jsxs("button",{className:`new-chat new-chat--library${r==="library"?" is-active":""}`,onClick:p,"aria-label":j("navigation.library"),"aria-current":r==="library"?"page":void 0,title:j("navigation.library"),children:[o.jsx(Gxe,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.library")})]}),o.jsxs("button",{className:`new-chat new-chat--cronjobs${r==="cronjobs"?" is-active":""}`,onClick:x,"aria-label":j("navigation.cronjobs"),"aria-current":r==="cronjobs"?"page":void 0,title:j("navigation.cronjobs"),children:[o.jsx(RF,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.cronjobs")})]}),o.jsxs("button",{className:`new-chat new-chat--applications${r==="applications"?" is-active":""}`,onClick:y,"aria-label":j("navigation.automations"),"aria-current":r==="applications"?"page":void 0,title:j("navigation.automations"),children:[o.jsx(vKe,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.automations")})]})]})]}),A("history")&&o.jsxs("div",{className:"sidebar-history",children:[o.jsxs("div",{className:"history-head",children:[o.jsx("span",{children:j("history.title")}),A("newChat")&&o.jsx("button",{type:"button",className:"history-new-chat",onClick:(u==null?void 0:u.onNew)??d,disabled:u==null?void 0:u.newDisabled,"aria-label":j("history.create"),title:j("history.create"),children:o.jsx($o,{className:"icon"})})]}),o.jsx("div",{className:"history-list",children:u?o.jsxs(o.Fragment,{children:[u.loading&&u.threads.length===0?o.jsx("div",{className:"history-empty",role:"status",children:j("history.loading")}):null,u.error?o.jsx("div",{className:"history-error",role:"alert",children:u.error}):null,!u.loading&&!u.error&&u.threads.length===0?o.jsx("div",{className:"history-empty",children:j("history.empty")}):null,u.threads.map(H=>{const Z=H.id===u.currentThreadId,Q=H.name||H.preview||`Thread ${H.id.slice(0,8)}`,q=H.id===u.busyThreadId;return o.jsxs("div",{className:`history-item ${Z?"active":""}`,children:[o.jsxs("button",{type:"button",className:"history-item-btn",onClick:()=>u.onSelect(H.id),"aria-current":Z?"page":void 0,title:Q,disabled:q,children:[o.jsx(mG,{title:Q}),Z?o.jsx("span",{className:"history-current-badge",children:j("history.current")}):null]}),o.jsx("button",{type:"button",className:"history-more","aria-label":j("history.manage",{title:Q}),title:j("history.more"),disabled:q,onClick:()=>T(B=>B===H.id?null:H.id),children:o.jsx(vW,{className:"icon"})}),F===H.id?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>T(null)}),o.jsx("div",{className:"history-menu",children:o.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{T(null),u.onDelete(H)},children:[o.jsx(pm,{className:"icon"})," ",j("history.delete")]})})]}):null]},H.id)}),u.hasMore?o.jsx("button",{type:"button",className:"history-load-more",disabled:u.loading,onClick:u.onLoadMore,children:u.loading?j("history.loadingMore"):j("history.loadMore")}):null]}):o.jsxs(o.Fragment,{children:[M.length===0?o.jsx("div",{className:"history-empty",children:j("history.empty")}):null,M.map(H=>{const Z=H.id===i,Q=(l==null?void 0:l.has(H.id))===!0,q=!Q&&(c==null?void 0:c.has(H.id))===!0;return o.jsxs("div",{className:`history-item ${Z?"active":""}`,children:[o.jsxs("button",{className:"history-item-btn",onClick:()=>E(H.id),"aria-current":Z?"page":void 0,title:H.title,children:[o.jsx(mG,{title:H.title}),q&&o.jsxs("span",{className:"history-evaluating-status",title:j("history.evaluatingTitle"),children:[o.jsx("span",{className:"history-evaluating","aria-hidden":"true"}),j("history.evaluating")]})]}),o.jsxs("div",{className:"history-action-slot",children:[Q?o.jsx(Hk,{className:"history-streaming-indicator",size:12,role:"status","aria-label":j("history.generating")}):null,o.jsx("button",{type:"button",className:"history-more","aria-label":j("history.manage",{title:H.title}),title:j("history.more"),onClick:()=>T(B=>B===H.id?null:H.id),children:o.jsx(vW,{className:"icon"})})]}),F===H.id&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>T(null)}),o.jsx("div",{className:"history-menu",children:o.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{T(null),C(H.id)},children:[o.jsx(pm,{className:"icon"})," ",j("history.delete")]})})]})]},H.id)})]})})]}),o.jsx("div",{className:"sidebar-footer",children:o.jsx(SKe,{activePage:r,access:a,userInfo:N,onAgentKitCli:O,onDeveloperResources:w,onSystemInfo:k,onIssueFeedback:S,onLogout:_})})]})}function ta(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,i;n{}};function CR(){for(var e=0,t=arguments.length,n={},i;e=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}cA.prototype=CR.prototype={constructor:cA,on:function(e,t){var n=this._,i=CKe(e+"",n),r,s=-1,a=i.length;if(arguments.length<2){for(;++s0)for(var n=new Array(r),i=0,r,s;i=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),bG.hasOwnProperty(t)?{space:bG[t],local:e}:e}function AKe(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===J4&&t.documentElement.namespaceURI===J4?t.createElement(e):t.createElementNS(n,e)}}function _Ke(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Xxe(e){var t=TR(e);return(t.local?_Ke:AKe)(t)}function NKe(){}function Y7(e){return e==null?NKe:function(){return this.querySelector(e)}}function jKe(e){typeof e!="function"&&(e=Y7(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r=O&&(O=x+1);!(k=v[O])&&++O=0;)(a=i[r])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function nXe(e){e||(e=iXe);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,i=n.length,r=new Array(i),s=0;st?1:e>=t?0:NaN}function rXe(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function sXe(){return Array.from(this)}function aXe(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?bXe:typeof t=="function"?vXe:yXe)(e,t,n??"")):Qv(this.node(),e)}function Qv(e,t){return e.style.getPropertyValue(t)||t1e(e).getComputedStyle(e,null).getPropertyValue(t)}function wXe(e){return function(){delete this[e]}}function OXe(e,t){return function(){this[e]=t}}function SXe(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function kXe(e,t){return arguments.length>1?this.each((t==null?wXe:typeof t=="function"?SXe:OXe)(e,t)):this.node()[e]}function n1e(e){return e.trim().split(/^|\s+/)}function Z7(e){return e.classList||new i1e(e)}function i1e(e){this._node=e,this._names=n1e(e.getAttribute("class")||"")}i1e.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 r1e(e,t){for(var n=Z7(e),i=-1,r=t.length;++i=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function ZXe(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,r=t.length,s;n()=>e;function e6(e,{sourceEvent:t,subject:n,target:i,identifier:r,active:s,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:i,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:s,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}})}e6.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function lYe(e){return!e.ctrlKey&&!e.button}function cYe(){return this.parentNode}function uYe(e,t){return t??{x:e.x,y:e.y}}function dYe(){return navigator.maxTouchPoints||"ontouchstart"in this}function u1e(){var e=lYe,t=cYe,n=uYe,i=dYe,r={},s=CR("start","drag","end"),a=0,l,c,u,d,f=0;function h(w){w.on("mousedown.drag",p).filter(i).on("touchstart.drag",v).on("touchmove.drag",y,oYe).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(w,k){if(!(d||!e.call(this,w,k))){var S=O(this,t.call(this,w,k),w,k,"mouse");S&&(Yl(w.view).on("mousemove.drag",g,CS).on("mouseup.drag",b,CS),l1e(w.view),ZD(w),u=!1,l=w.clientX,c=w.clientY,S("start",w))}}function g(w){if(ev(w),!u){var k=w.clientX-l,S=w.clientY-c;u=k*k+S*S>f}r.mouse("drag",w)}function b(w){Yl(w.view).on("mousemove.drag mouseup.drag",null),c1e(w.view,u),ev(w),r.mouse("end",w)}function v(w,k){if(e.call(this,w,k)){var S=w.changedTouches,E=t.call(this,w,k),C=S.length,N,_;for(N=0;N>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?fT(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?fT(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=hYe.exec(e))?new dl(t[1],t[2],t[3],1):(t=pYe.exec(e))?new dl(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=mYe.exec(e))?fT(t[1],t[2],t[3],t[4]):(t=gYe.exec(e))?fT(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=bYe.exec(e))?kG(t[1],t[2]/100,t[3]/100,1):(t=yYe.exec(e))?kG(t[1],t[2]/100,t[3]/100,t[4]):yG.hasOwnProperty(e)?wG(yG[e]):e==="transparent"?new dl(NaN,NaN,NaN,0):null}function wG(e){return new dl(e>>16&255,e>>8&255,e&255,1)}function fT(e,t,n,i){return i<=0&&(e=t=n=NaN),new dl(e,t,n,i)}function wYe(e){return e instanceof tE||(e=xb(e)),e?(e=e.rgb(),new dl(e.r,e.g,e.b,e.opacity)):new dl}function t6(e,t,n,i){return arguments.length===1?wYe(e):new dl(e,t,n,i??1)}function dl(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}J7(dl,t6,d1e(tE,{brighter(e){return e=e==null?q_:Math.pow(q_,e),new dl(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?TS:Math.pow(TS,e),new dl(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new dl(ib(this.r),ib(this.g),ib(this.b),W_(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:OG,formatHex:OG,formatHex8:OYe,formatRgb:SG,toString:SG}));function OG(){return`#${Mg(this.r)}${Mg(this.g)}${Mg(this.b)}`}function OYe(){return`#${Mg(this.r)}${Mg(this.g)}${Mg(this.b)}${Mg((isNaN(this.opacity)?1:this.opacity)*255)}`}function SG(){const e=W_(this.opacity);return`${e===1?"rgb(":"rgba("}${ib(this.r)}, ${ib(this.g)}, ${ib(this.b)}${e===1?")":`, ${e})`}`}function W_(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ib(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Mg(e){return e=ib(e),(e<16?"0":"")+e.toString(16)}function kG(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Cu(e,t,n,i)}function f1e(e){if(e instanceof Cu)return new Cu(e.h,e.s,e.l,e.opacity);if(e instanceof tE||(e=xb(e)),!e)return new Cu;if(e instanceof Cu)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),s=Math.max(t,n,i),a=NaN,l=s-r,c=(s+r)/2;return l?(t===s?a=(n-i)/l+(n0&&c<1?0:a,new Cu(a,l,c,e.opacity)}function SYe(e,t,n,i){return arguments.length===1?f1e(e):new Cu(e,t,n,i??1)}function Cu(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}J7(Cu,SYe,d1e(tE,{brighter(e){return e=e==null?q_:Math.pow(q_,e),new Cu(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?TS:Math.pow(TS,e),new Cu(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,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new dl(JD(e>=240?e-240:e+120,r,i),JD(e,r,i),JD(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new Cu(EG(this.h),hT(this.s),hT(this.l),W_(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=W_(this.opacity);return`${e===1?"hsl(":"hsla("}${EG(this.h)}, ${hT(this.s)*100}%, ${hT(this.l)*100}%${e===1?")":`, ${e})`}`}}));function EG(e){return e=(e||0)%360,e<0?e+360:e}function hT(e){return Math.max(0,Math.min(1,e||0))}function JD(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 AR=e=>()=>e;function h1e(e,t){return function(n){return e+n*t}}function kYe(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function rHt(e,t){var n=t-e;return n?h1e(e,n>180||n<-180?n-360*Math.round(n/360):n):AR(isNaN(e)?t:e)}function EYe(e){return(e=+e)==1?p1e:function(t,n){return n-t?kYe(t,n,e):AR(isNaN(t)?n:t)}}function p1e(e,t){var n=t-e;return n?h1e(e,n):AR(isNaN(e)?t:e)}const G_=function e(t){var n=EYe(t);function i(r,s){var a=n((r=t6(r)).r,(s=t6(s)).r),l=n(r.g,s.g),c=n(r.b,s.b),u=p1e(r.opacity,s.opacity);return function(d){return r.r=a(d),r.g=l(d),r.b=c(d),r.opacity=u(d),r+""}}return i.gamma=e,i}(1);function CYe(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),r;return function(s){for(r=0;rn&&(s=t.slice(n,s),l[a]?l[a]+=s:l[++a]=s),(i=i[0])===(r=r[0])?l[a]?l[a]+=r:l[++a]=r:(l[++a]=null,c.push({i:a,x:pd(i,r)})),n=eM.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(r(f)+"rotate(",null,i)-2,x:pd(u,d)})):d&&f.push(r(f)+"rotate("+d+i)}function l(u,d,f,h){u!==d?h.push({i:f.push(r(f)+"skewX(",null,i)-2,x:pd(u,d)}):d&&f.push(r(f)+"skewX("+d+i)}function c(u,d,f,h,p,g){if(u!==f||d!==h){var b=p.push(r(p)+"scale(",null,",",null,")");g.push({i:b-4,x:pd(u,f)},{i:b-2,x:pd(d,h)})}else(f!==1||h!==1)&&p.push(r(p)+"scale("+f+","+h+")")}return function(u,d){var f=[],h=[];return u=e(u),d=e(d),s(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 g=-1,b=h.length,v;++g=0&&e._call.call(void 0,t),e=e._next;--zv}function AG(){wb=(X_=_S.now())+_R,zv=Rw=0;try{UYe()}finally{zv=0,zYe(),wb=0}}function QYe(){var e=_S.now(),t=e-X_;t>y1e&&(_R-=t,X_=e)}function zYe(){for(var e,t=K_,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:K_=n);Iw=e,r6(i)}function r6(e){if(!zv){Rw&&(Rw=clearTimeout(Rw));var t=e-wb;t>24?(e<1/0&&(Rw=setTimeout(AG,e-_S.now()-_R)),$1&&($1=clearInterval($1))):($1||(X_=_S.now(),$1=setInterval(QYe,y1e)),zv=1,v1e(AG))}}function _G(e,t,n){var i=new Y_;return t=t==null?0:+t,i.restart(r=>{i.stop(),e(r+t)},t,n),i}var VYe=CR("start","end","cancel","interrupt"),HYe=[],w1e=0,NG=1,s6=2,dA=3,jG=4,a6=5,fA=6;function NR(e,t,n,i,r,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;qYe(e,n,{name:t,index:i,group:r,on:VYe,tween:HYe,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:w1e})}function tB(e,t){var n=Wu(e,t);if(n.state>w1e)throw new Error("too late; already scheduled");return n}function Xd(e,t){var n=Wu(e,t);if(n.state>dA)throw new Error("too late; already running");return n}function Wu(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function qYe(e,t,n){var i=e.__transition,r;i[t]=n,n.timer=x1e(s,0,n.time);function s(u){n.state=NG,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!==NG)return c();for(d in i)if(p=i[d],p.name===n.name){if(p.state===dA)return _G(a);p.state===jG?(p.state=fA,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete i[d]):+ds6&&i.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function OZe(e,t,n){var i,r,s=wZe(t)?tB:Xd;return function(){var a=s(this,e),l=a.on;l!==i&&(r=(i=l).copy()).on(t,n),a.on=r}}function SZe(e,t){var n=this._id;return arguments.length<2?Wu(this.node(),n).on.on(e):this.each(OZe(n,e,t))}function kZe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function EZe(){return this.on("end.remove",kZe(this._id))}function CZe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Y7(e));for(var i=this._groups,r=i.length,s=new Array(r),a=0;a()=>e;function YZe(e,{sourceEvent:t,target:n,transform:i,dispatch:r}){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:i,enumerable:!0,configurable:!0},_:{value:r}})}function Kf(e,t,n){this.k=e,this.x=t,this.y=n}Kf.prototype={constructor:Kf,scale:function(e){return e===1?this:new Kf(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Kf(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 jR=new Kf(1,0,0);E1e.prototype=Kf.prototype;function E1e(e){for(;!e.__zoom;)if(!(e=e.parentNode))return jR;return e.__zoom}function tM(e){e.stopImmediatePropagation()}function F1(e){e.preventDefault(),e.stopImmediatePropagation()}function ZZe(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function JZe(){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 RG(){return this.__zoom||jR}function eJe(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function tJe(){return navigator.maxTouchPoints||"ontouchstart"in this}function nJe(e,t,n){var i=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function C1e(){var e=ZZe,t=JZe,n=nJe,i=eJe,r=tJe,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=uA,u=CR("start","zoom","end"),d,f,h,p=500,g=150,b=0,v=10;function y(T){T.property("__zoom",RG).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",_).filter(r).on("touchstart.zoom",j).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(T,P,R,L){var M=T.selection?T.selection():T;M.property("__zoom",RG),T!==M?k(T,P,R,L):M.interrupt().each(function(){S(this,arguments).event(L).start().zoom(null,typeof P=="function"?P.apply(this,arguments):P).end()})},y.scaleBy=function(T,P,R,L){y.scaleTo(T,function(){var M=this.__zoom.k,U=typeof P=="function"?P.apply(this,arguments):P;return M*U},R,L)},y.scaleTo=function(T,P,R,L){y.transform(T,function(){var M=t.apply(this,arguments),U=this.__zoom,I=R==null?w(M):typeof R=="function"?R.apply(this,arguments):R,H=U.invert(I),Z=typeof P=="function"?P.apply(this,arguments):P;return n(O(x(U,Z),I,H),M,a)},R,L)},y.translateBy=function(T,P,R,L){y.transform(T,function(){return n(this.__zoom.translate(typeof P=="function"?P.apply(this,arguments):P,typeof R=="function"?R.apply(this,arguments):R),t.apply(this,arguments),a)},null,L)},y.translateTo=function(T,P,R,L,M){y.transform(T,function(){var U=t.apply(this,arguments),I=this.__zoom,H=L==null?w(U):typeof L=="function"?L.apply(this,arguments):L;return n(jR.translate(H[0],H[1]).scale(I.k).translate(typeof P=="function"?-P.apply(this,arguments):-P,typeof R=="function"?-R.apply(this,arguments):-R),U,a)},L,M)};function x(T,P){return P=Math.max(s[0],Math.min(s[1],P)),P===T.k?T:new Kf(P,T.x,T.y)}function O(T,P,R){var L=P[0]-R[0]*T.k,M=P[1]-R[1]*T.k;return L===T.x&&M===T.y?T:new Kf(T.k,L,M)}function w(T){return[(+T[0][0]+ +T[1][0])/2,(+T[0][1]+ +T[1][1])/2]}function k(T,P,R,L){T.on("start.zoom",function(){S(this,arguments).event(L).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(L).end()}).tween("zoom",function(){var M=this,U=arguments,I=S(M,U).event(L),H=t.apply(M,U),Z=R==null?w(H):typeof R=="function"?R.apply(M,U):R,Q=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),q=M.__zoom,B=typeof P=="function"?P.apply(M,U):P,te=c(q.invert(Z).concat(Q/q.k),B.invert(Z).concat(Q/B.k));return function(ce){if(ce===1)ce=B;else{var se=te(ce),re=Q/se[2];ce=new Kf(re,Z[0]-se[0]*re,Z[1]-se[1]*re)}I.zoom(null,ce)}})}function S(T,P,R){return!R&&T.__zooming||new E(T,P)}function E(T,P){this.that=T,this.args=P,this.active=0,this.sourceEvent=null,this.extent=t.apply(T,P),this.taps=0}E.prototype={event:function(T){return T&&(this.sourceEvent=T),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(T,P){return this.mouse&&T!=="mouse"&&(this.mouse[1]=P.invert(this.mouse[0])),this.touch0&&T!=="touch"&&(this.touch0[1]=P.invert(this.touch0[0])),this.touch1&&T!=="touch"&&(this.touch1[1]=P.invert(this.touch1[0])),this.that.__zoom=P,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(T){var P=Yl(this.that).datum();u.call(T,this.that,new YZe(T,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:u}),P)}};function C(T,...P){if(!e.apply(this,arguments))return;var R=S(this,P).event(T),L=this.__zoom,M=Math.max(s[0],Math.min(s[1],L.k*Math.pow(2,i.apply(this,arguments)))),U=Ou(T);if(R.wheel)(R.mouse[0][0]!==U[0]||R.mouse[0][1]!==U[1])&&(R.mouse[1]=L.invert(R.mouse[0]=U)),clearTimeout(R.wheel);else{if(L.k===M)return;R.mouse=[U,L.invert(U)],hA(this),R.start()}F1(T),R.wheel=setTimeout(I,g),R.zoom("mouse",n(O(x(L,M),R.mouse[0],R.mouse[1]),R.extent,a));function I(){R.wheel=null,R.end()}}function N(T,...P){if(h||!e.apply(this,arguments))return;var R=T.currentTarget,L=S(this,P,!0).event(T),M=Yl(T.view).on("mousemove.zoom",Z,!0).on("mouseup.zoom",Q,!0),U=Ou(T,R),I=T.clientX,H=T.clientY;l1e(T.view),tM(T),L.mouse=[U,this.__zoom.invert(U)],hA(this),L.start();function Z(q){if(F1(q),!L.moved){var B=q.clientX-I,te=q.clientY-H;L.moved=B*B+te*te>b}L.event(q).zoom("mouse",n(O(L.that.__zoom,L.mouse[0]=Ou(q,R),L.mouse[1]),L.extent,a))}function Q(q){M.on("mousemove.zoom mouseup.zoom",null),c1e(q.view,L.moved),F1(q),L.event(q).end()}}function _(T,...P){if(e.apply(this,arguments)){var R=this.__zoom,L=Ou(T.changedTouches?T.changedTouches[0]:T,this),M=R.invert(L),U=R.k*(T.shiftKey?.5:2),I=n(O(x(R,U),L,M),t.apply(this,P),a);F1(T),l>0?Yl(this).transition().duration(l).call(k,I,L,T):Yl(this).call(y.transform,I,L,T)}}function j(T,...P){if(e.apply(this,arguments)){var R=T.touches,L=R.length,M=S(this,P,T.changedTouches.length===L).event(T),U,I,H,Z;for(tM(T),I=0;I`Seems like you have not used zustand provider as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:i})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:i}", 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.`},NS=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],T1e=["Enter"," ","Escape"],A1e={"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 Vv;(function(e){e.Strict="strict",e.Loose="loose"})(Vv||(Vv={}));var rb;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(rb||(rb={}));var jS;(function(e){e.Partial="partial",e.Full="full"})(jS||(jS={}));const _1e={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Np;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Np||(Np={}));var RS;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(RS||(RS={}));var an;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(an||(an={}));const IG={[an.Left]:an.Right,[an.Right]:an.Left,[an.Top]:an.Bottom,[an.Bottom]:an.Top};function N1e(e){return e===null?null:e?"valid":"invalid"}const j1e=e=>"id"in e&&"source"in e&&"target"in e,iJe=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),iB=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),nE=(e,t=[0,0])=>{const{width:n,height:i}=Fh(e),r=e.origin??t,s=n*r[0],a=i*r[1];return{x:e.position.x-s,y:e.position.y-a}},rJe=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((i,r)=>{const s=typeof r=="string";let a=!t.nodeLookup&&!s?r:void 0;t.nodeLookup&&(a=s?t.nodeLookup.get(r):iB(r)?r:t.nodeLookup.get(r.id));const l=a?Z_(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return RR(i,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return IR(n)},iE=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=RR(n,Z_(r)),i=!0)}),i?IR(n):{x:0,y:0,width:0,height:0}},rB=(e,t,[n,i,r]=[0,0,1],s=!1,a=!1)=>{const l={...$x(t,[n,i,r]),width:t.width/r,height:t.height/r},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,g=d.height??u.height??u.initialHeight??null,b=IS(l,qv(u)),v=(p??0)*(g??0),y=s&&b>0;(!u.internals.handleBounds||y||b>=v||u.dragging)&&c.push(u)}return c},sJe=(e,t)=>{const n=new Set;return e.forEach(i=>{n.add(i.id)}),t.filter(i=>n.has(i.source)||n.has(i.target))};function aJe(e,t){const n=new Map,i=t!=null&&t.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!r.hidden)&&(!i||i.has(r.id))&&n.set(r.id,r)}),n}async function oJe({nodes:e,width:t,height:n,panZoom:i,minZoom:r,maxZoom:s},a){if(e.size===0)return!0;const l=aJe(e,a),c=iE(l),u=aB(c,t,n,(a==null?void 0:a.minZoom)??r,(a==null?void 0:a.maxZoom)??s,(a==null?void 0:a.padding)??.1);return await i.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 R1e({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:r,onError:s}){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??i;let f=a.extent||r;if(a.extent==="parent"&&!a.expandParent)if(!l)s==null||s("005",Fu.error005());else{const p=l.measured.width,g=l.measured.height;p&&g&&(f=[[c,u],[c+p,u+g]])}else l&&Sb(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=Sb(f)?Ob(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(s==null||s("015",Fu.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 lJe({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:i,onBeforeDelete:r}){const s=new Set(e.map(h=>h.id)),a=[];for(const h of n){if(h.deletable===!1)continue;const p=s.has(h.id),g=!p&&h.parentId&&a.find(b=>b.id===h.parentId);(p||g)&&a.push(h)}const l=new Set(t.map(h=>h.id)),c=i.filter(h=>h.deletable!==!1),d=sJe(a,c);for(const h of c)l.has(h.id)&&!d.find(g=>g.id===h.id)&&d.push(h);if(!r)return{edges:d,nodes:a};const f=await r({nodes:a,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:a}:{edges:[],nodes:[]}:f}const Hv=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ob=(e={x:0,y:0},t,n)=>({x:Hv(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Hv(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function I1e(e,t,n){const{width:i,height:r}=Fh(n),{x:s,y:a}=n.internals.positionAbsolute;return Ob(e,[[s,a],[s+i,a+r]],t)}const PG=(e,t,n)=>en?-Hv(Math.abs(e-n),1,t)/t:0,sB=(e,t,n=15,i=40)=>{const r=PG(e.x,i,t.width-i)*n,s=PG(e.y,i,t.height-i)*n;return[r,s]},RR=(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)}),o6=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),IR=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),qv=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=iB(e)?e.internals.positionAbsolute:nE(e,t);return{x:n,y:i,width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0}},Z_=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=iB(e)?e.internals.positionAbsolute:nE(e,t);return{x:n,y:i,x2:n+(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0),y2:i+(((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0)}},P1e=(e,t)=>IR(RR(o6(e),o6(t))),IS=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),i=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*i)},DG=e=>Au(e.width)&&Au(e.height)&&Au(e.x)&&Au(e.y),Au=e=>!isNaN(e)&&isFinite(e),D1e=(e,t)=>(n,i)=>{},rE=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),$x=({x:e,y:t},[n,i,r],s=!1,a=[1,1])=>{const l={x:(e-n)/r,y:(t-i)/r};return s?rE(l,a):l},Wv=({x:e,y:t},[n,i,r])=>({x:e*r+n,y:t*r+i});function M0(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 cJe(e,t,n){if(typeof e=="string"||typeof e=="number"){const i=M0(e,n),r=M0(e,t);return{top:i,right:r,bottom:i,left:r,x:r*2,y:i*2}}if(typeof e=="object"){const i=M0(e.top??e.y??0,n),r=M0(e.bottom??e.y??0,n),s=M0(e.left??e.x??0,t),a=M0(e.right??e.x??0,t);return{top:i,right:a,bottom:r,left:s,x:s+a,y:i+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function uJe(e,t,n,i,r,s){const{x:a,y:l}=Wv(e,[t,n,i]),{x:c,y:u}=Wv({x:e.x+e.width,y:e.y+e.height},[t,n,i]),d=r-c,f=s-u;return{left:Math.floor(a),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(f)}}const aB=(e,t,n,i,r,s)=>{const a=cJe(s,t,n),l=(t-a.x)/e.width,c=(n-a.y)/e.height,u=Math.min(l,c),d=Hv(u,i,r),f=e.x+e.width/2,h=e.y+e.height/2,p=t/2-f*d,g=n/2-h*d,b=uJe(e,p,g,d,t,n),v={left:Math.min(b.left-a.left,0),top:Math.min(b.top-a.top,0),right:Math.min(b.right-a.right,0),bottom:Math.min(b.bottom-a.bottom,0)};return{x:p-v.left+v.right,y:g-v.top+v.bottom,zoom:d}},PS=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Sb(e){return e!=null&&e!=="parent"}function Fh(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 oB(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 M1e(e,t={width:0,height:0},n,i,r){const s={...e},a=i.get(n);if(a){const l=a.origin||r;s.x+=a.internals.positionAbsolute.x-(t.width??0)*l[0],s.y+=a.internals.positionAbsolute.y-(t.height??0)*l[1]}return s}function MG(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function dJe(){let e,t;return{promise:new Promise((i,r)=>{e=i,t=r}),resolve:e,reject:t}}function fJe(e){return{...A1e,...e||{}}}function SO(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:r}){const{x:s,y:a}=_u(e),l=$x({x:s-((r==null?void 0:r.left)??0),y:a-((r==null?void 0:r.top)??0)},i),{x:c,y:u}=n?rE(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const lB=e=>({width:e.offsetWidth,height:e.offsetHeight}),L1e=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},hJe=["INPUT","SELECT","TEXTAREA"];function $1e(e){var i,r;const t=((r=(i=e.composedPath)==null?void 0:i.call(e))==null?void 0:r[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:hJe.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const F1e=e=>"clientX"in e,_u=(e,t)=>{var s,a;const n=F1e(e),i=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,r=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:i-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},LG=(e,t,n,i,r)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(a=>{const l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:r,position:a.getAttribute("data-handlepos"),x:(l.left-n.left)/i,y:(l.top-n.top)/i,...lB(a)}})};function B1e({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:r,sourceControlY:s,targetControlX:a,targetControlY:l}){const c=e*.125+r*.375+a*.375+n*.125,u=t*.125+s*.375+l*.375+i*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}function gT(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function $G({pos:e,x1:t,y1:n,x2:i,y2:r,c:s}){switch(e){case an.Left:return[t-gT(t-i,s),n];case an.Right:return[t+gT(i-t,s),n];case an.Top:return[t,n-gT(n-r,s)];case an.Bottom:return[t,n+gT(r-n,s)]}}function U1e({sourceX:e,sourceY:t,sourcePosition:n=an.Bottom,targetX:i,targetY:r,targetPosition:s=an.Top,curvature:a=.25}){const[l,c]=$G({pos:n,x1:e,y1:t,x2:i,y2:r,c:a}),[u,d]=$G({pos:s,x1:i,y1:r,x2:e,y2:t,c:a}),[f,h,p,g]=B1e({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${i},${r}`,f,h,p,g]}function Q1e({sourceX:e,sourceY:t,targetX:n,targetY:i}){const r=Math.abs(n-e)/2,s=n0}const gJe=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,bJe=(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)),yJe=(e,t,n={})=>{var s;if(!e.source||!e.target)return(s=n.onError)==null||s.call(n,"006",Fu.error006()),t;const i=n.getEdgeId||gJe;let r;return j1e(e)?r={...e}:r={...e,id:i(e)},bJe(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function z1e({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[r,s,a,l]=Q1e({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,r,s,a,l]}const FG={[an.Left]:{x:-1,y:0},[an.Right]:{x:1,y:0},[an.Top]:{x:0,y:-1},[an.Bottom]:{x:0,y:1}},vJe=({source:e,sourcePosition:t=an.Bottom,target:n})=>t===an.Left||t===an.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function xJe({source:e,sourcePosition:t=an.Bottom,target:n,targetPosition:i=an.Top,center:r,offset:s,stepPosition:a}){const l=FG[t],c=FG[i],u={x:e.x+l.x*s,y:e.y+l.y*s},d={x:n.x+c.x*s,y:n.y+c.y*s},f=vJe({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",p=f[h];let g=[],b,v;const y={x:0,y:0},x={x:0,y:0},[,,O,w]=Q1e({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*c[h]===-1){h==="x"?(b=r.x??u.x+(d.x-u.x)*a,v=r.y??(u.y+d.y)/2):(b=r.x??(u.x+d.x)/2,v=r.y??u.y+(d.y-u.y)*a);const C=[{x:b,y:u.y},{x:b,y:d.y}],N=[{x:u.x,y:v},{x:d.x,y:v}];l[h]===p?g=h==="x"?C:N:g=h==="x"?N:C}else{const C=[{x:u.x,y:d.y}],N=[{x:d.x,y:u.y}];if(h==="x"?g=l.x===p?N:C:g=l.y===p?C:N,t===i){const T=Math.abs(e[h]-n[h]);if(T<=s){const P=Math.min(s-1,s-T);l[h]===p?y[h]=(u[h]>e[h]?-1:1)*P:x[h]=(d[h]>n[h]?-1:1)*P}}if(t!==i){const T=h==="x"?"y":"x",P=l[h]===c[T],R=u[T]>d[T],L=u[T]=F?(b=(_.x+j.x)/2,v=g[0].y):(b=g[0].x,v=(_.y+j.y)/2)}const k={x:u.x+y.x,y:u.y+y.y},S={x:d.x+x.x,y:d.y+x.y};return[[e,...k.x!==g[0].x||k.y!==g[0].y?[k]:[],...g,...S.x!==g[g.length-1].x||S.y!==g[g.length-1].y?[S]:[],n],b,v,O,w]}function wJe(e,t,n,i){const r=Math.min(BG(e,t)/2,BG(t,n)/2,i),{x:s,y:a}=t;if(e.x===s&&s===n.x||e.y===a&&a===n.y)return`L${s} ${a}`;if(e.y===a){const u=e.xn.id===t):e[0])||null}function l6(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function SJe(e,{id:t,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:r}){const s=new Set;return e.reduce((a,l)=>([l.markerStart||i,l.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const u=l6(c,t);s.has(u)||(a.push({id:u,color:c.color||n,...c}),s.add(u))}}),a),[]).sort((a,l)=>a.id.localeCompare(l.id))}const V1e=1e3,kJe=10,cB={nodeOrigin:[0,0],nodeExtent:NS,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},EJe={...cB,checkEquality:!0};function uB(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function CJe(e,t,n){const i=uB(cB,n);for(const r of e.values())if(r.parentId)fB(r,e,t,i);else{const s=nE(r,i.nodeOrigin),a=Sb(r.extent)?r.extent:i.nodeExtent,l=Ob(s,a,Fh(r));r.internals.positionAbsolute=l}}function TJe(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],i=[];for(const r of e.handles){const s={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(s):r.type==="target"&&i.push(s)}return{source:n,target:i}}function dB(e){return e==="manual"}function c6(e,t,n,i={}){var d,f;const r=uB(EJe,i),s={i:0},a=new Map(t),l=r!=null&&r.elevateNodesOnSelect&&!dB(r.zIndexMode)?V1e:0;let c=e.length>0,u=!1;t.clear(),n.clear();for(const h of e){let p=a.get(h.id);if(r.checkEquality&&h===(p==null?void 0:p.internals.userNode))t.set(h.id,p);else{const g=nE(h,r.nodeOrigin),b=Sb(h.extent)?h.extent:r.nodeExtent,v=Ob(g,b,Fh(h));p={...r.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(f=h.measured)==null?void 0:f.height},internals:{positionAbsolute:v,handleBounds:TJe(h,p),z:H1e(h,l,r.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&&fB(p,t,n,i,s),u||(u=h.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function AJe(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 fB(e,t,n,i,r){const{elevateNodesOnSelect:s,nodeOrigin:a,nodeExtent:l,zIndexMode:c}=uB(cB,i),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}AJe(e,n),r&&!d.parentId&&d.internals.rootParentIndex===void 0&&c==="auto"&&(d.internals.rootParentIndex=++r.i,d.internals.z=d.internals.z+r.i*kJe),r&&d.internals.rootParentIndex!==void 0&&(r.i=d.internals.rootParentIndex);const f=s&&!dB(c)?V1e:0,{x:h,y:p,z:g}=_Je(e,d,a,l,f,c),{positionAbsolute:b}=e.internals,v=h!==b.x||p!==b.y;(v||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:h,y:p}:b,z:g}})}function H1e(e,t,n){const i=Au(e.zIndex)?e.zIndex:0;return dB(n)?i:i+(e.selected?t:0)}function _Je(e,t,n,i,r,s){const{x:a,y:l}=t.internals.positionAbsolute,c=Fh(e),u=nE(e,n),d=Sb(e.extent)?Ob(u,e.extent,c):u;let f=Ob({x:a+d.x,y:l+d.y},i,c);e.extent==="parent"&&(f=I1e(f,c,t));const h=H1e(e,r,s),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>=h?p+1:h}}function hB(e,t,n,i=[0,0]){var a;const r=[],s=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((a=s.get(l.parentId))==null?void 0:a.expandedRect)??qv(c),d=P1e(u,l.rect);s.set(l.parentId,{expandedRect:d,parent:c})}return s.size>0&&s.forEach(({expandedRect:l,parent:c},u)=>{var O;const d=c.internals.positionAbsolute,f=Fh(c),h=c.origin??i,p=l.x0||g>0||y||x)&&(r.push({id:u,type:"position",position:{x:c.position.x-p+y,y:c.position.y-g+x}}),(O=n.get(u))==null||O.forEach(w=>{e.some(k=>k.id===w.id)||r.push({id:w.id,type:"position",position:{x:w.position.x+p,y:w.position.y+g}})})),(f.width0){const p=hB(h,t,n,r);u.push(...p)}return{changes:u,updatedInternals:c}}async function jJe({delta:e,panZoom:t,transform:n,translateExtent:i,width:r,height:s}){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],[r,s]],i);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}function VG(e,t,n,i,r,s){let a=r;const l=i.get(a)||new Map;i.set(a,l.set(n,t)),a=`${r}-${e}`;const c=i.get(a)||new Map;if(i.set(a,c.set(n,t)),s){a=`${r}-${e}-${s}`;const u=i.get(a)||new Map;i.set(a,u.set(n,t))}}function q1e(e,t,n){e.clear(),t.clear();for(const i of n){const{source:r,target:s,sourceHandle:a=null,targetHandle:l=null}=i,c={edgeId:i.id,source:r,target:s,sourceHandle:a,targetHandle:l},u=`${r}-${a}--${s}-${l}`,d=`${s}-${l}--${r}-${a}`;VG("source",c,d,e,r,a),VG("target",c,u,e,s,l),t.set(i.id,i)}}function W1e(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:W1e(n,t):!1}function HG(e,t,n){var r;let i=e;do{if((r=i==null?void 0:i.matches)!=null&&r.call(i,t))return!0;if(i===n)return!1;i=i==null?void 0:i.parentElement}while(i);return!1}function RJe(e,t,n,i){const r=new Map;for(const[s,a]of e)if((a.selected||a.id===i)&&(!a.parentId||!W1e(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const l=e.get(s);l&&r.set(s,{id:s,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 r}function nM({nodeId:e,dragItems:t,nodeLookup:n,dragging:i=!0}){var a,l,c;const r=[];for(const[u,d]of t){const f=(a=n.get(u))==null?void 0:a.internals.userNode;f&&r.push({...f,position:d.position,dragging:i})}if(!e)return[r[0],r];const s=(l=n.get(e))==null?void 0:l.internals.userNode;return[s?{...s,position:((c=t.get(e))==null?void 0:c.position)||s.position,dragging:i}:r[0],r]}function IJe({dragItems:e,snapGrid:t,x:n,y:i}){const r=e.values().next().value;if(!r)return null;const s={x:n-r.distance.x,y:i-r.distance.y},a=rE(s,t);return{x:a.x-s.x,y:a.y-s.y}}function PJe({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:i,onDragStop:r}){let s={x:null,y:null},a=0,l=new Map,c=!1,u={x:0,y:0},d=null,f=!1,h=null,p=!1,g=!1,b=null;function v({noDragClassName:x,handleSelector:O,domNode:w,isSelectable:k,nodeId:S,nodeClickDistance:E=0}){h=Yl(w);function C({x:A,y:F}){const{nodeLookup:T,nodeExtent:P,snapGrid:R,snapToGrid:L,nodeOrigin:M,onNodeDrag:U,onSelectionDrag:I,onError:H,updateNodePositions:Z}=t();s={x:A,y:F};let Q=!1;const q=l.size>1,B=q&&P?o6(iE(l)):null,te=q&&L?IJe({dragItems:l,snapGrid:R,x:A,y:F}):null;for(const[ce,se]of l){if(!T.has(ce))continue;let re={x:A-se.distance.x,y:F-se.distance.y};L&&(re=te?{x:Math.round(re.x+te.x),y:Math.round(re.y+te.y)}:rE(re,R));let ge=null;if(q&&P&&!se.extent&&B){const{positionAbsolute:ae}=se.internals,ue=ae.x-B.x+P[0][0],xe=ae.x+se.measured.width-B.x2+P[1][0],Ee=ae.y-B.y+P[0][1],Je=ae.y+se.measured.height-B.y2+P[1][1];ge=[[ue,Ee],[xe,Je]]}const{position:G,positionAbsolute:K}=R1e({nodeId:ce,nextPosition:re,nodeLookup:T,nodeExtent:ge||P,nodeOrigin:M,onError:H});Q=Q||se.position.x!==G.x||se.position.y!==G.y,se.position=G,se.internals.positionAbsolute=K}if(g=g||Q,!!Q&&(Z(l,!0),b&&(i||U||!S&&I))){const[ce,se]=nM({nodeId:S,dragItems:l,nodeLookup:T});i==null||i(b,l,ce,se),U==null||U(b,ce,se),S||I==null||I(b,se)}}async function N(){if(!d)return;const{transform:A,panBy:F,autoPanSpeed:T,autoPanOnNodeDrag:P}=t();if(!P){c=!1,cancelAnimationFrame(a);return}const[R,L]=sB(u,d,T);(R!==0||L!==0)&&(s.x=(s.x??0)-R/A[2],s.y=(s.y??0)-L/A[2],await F({x:R,y:L})&&C(s)),a=requestAnimationFrame(N)}function _(A){var q;const{nodeLookup:F,multiSelectionActive:T,nodesDraggable:P,transform:R,snapGrid:L,snapToGrid:M,selectNodesOnDrag:U,onNodeDragStart:I,onSelectionDragStart:H,unselectNodesAndEdges:Z}=t();f=!0,(!U||!k)&&!T&&S&&((q=F.get(S))!=null&&q.selected||Z()),k&&U&&S&&(e==null||e(S));const Q=SO(A.sourceEvent,{transform:R,snapGrid:L,snapToGrid:M,containerBounds:d});if(s=Q,l=RJe(F,P,Q,S),l.size>0&&(n||I||!S&&H)){const[B,te]=nM({nodeId:S,dragItems:l,nodeLookup:F});n==null||n(A.sourceEvent,l,B,te),I==null||I(A.sourceEvent,B,te),S||H==null||H(A.sourceEvent,te)}}const j=u1e().clickDistance(E).on("start",A=>{const{domNode:F,nodeDragThreshold:T,transform:P,snapGrid:R,snapToGrid:L}=t();d=(F==null?void 0:F.getBoundingClientRect())||null,p=!1,g=!1,b=A.sourceEvent,T===0&&_(A),s=SO(A.sourceEvent,{transform:P,snapGrid:R,snapToGrid:L,containerBounds:d}),u=_u(A.sourceEvent,d)}).on("drag",A=>{const{autoPanOnNodeDrag:F,transform:T,snapGrid:P,snapToGrid:R,nodeDragThreshold:L,nodeLookup:M}=t(),U=SO(A.sourceEvent,{transform:T,snapGrid:P,snapToGrid:R,containerBounds:d});if(b=A.sourceEvent,(A.sourceEvent.type==="touchmove"&&A.sourceEvent.touches.length>1||S&&!M.has(S))&&(p=!0),!p){if(!c&&F&&f&&(c=!0,N()),!f){const I=_u(A.sourceEvent,d),H=I.x-u.x,Z=I.y-u.y;Math.sqrt(H*H+Z*Z)>L&&_(A)}(s.x!==U.xSnapped||s.y!==U.ySnapped)&&l&&f&&(u=_u(A.sourceEvent,d),C(U))}}).on("end",A=>{if(!f||p){p&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(a),l.size>0){const{nodeLookup:F,updateNodePositions:T,onNodeDragStop:P,onSelectionDragStop:R}=t();if(g&&(T(l,!1),g=!1),r||P||!S&&R){const[L,M]=nM({nodeId:S,dragItems:l,nodeLookup:F,dragging:!1});r==null||r(A.sourceEvent,l,L,M),P==null||P(A.sourceEvent,L,M),S||R==null||R(A.sourceEvent,M)}}}).filter(A=>{const F=A.target;return!A.button&&(!x||!HG(F,`.${x}`,w))&&(!O||HG(F,O,w))});h.call(j)}function y(){h==null||h.on(".drag",null)}return{update:v,destroy:y}}function DJe(e,t,n){const i=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const s of t.values())IS(r,qv(s))>0&&i.push(s);return i}const MJe=250;function LJe(e,t,n,i){var l,c;let r=[],s=1/0;const a=DJe(e,n,t+MJe);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(i.nodeId===f.nodeId&&i.type===f.type&&i.id===f.id)continue;const{x:h,y:p}=kb(u,f,f.position,!0),g=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(p-e.y,2));g>t||(g1){const u=i.type==="source"?"target":"source";return r.find(d=>d.type===u)??r[0]}return r[0]}function G1e(e,t,n,i,r,s=!1){var u,d,f;const a=i.get(e);if(!a)return null;const l=r==="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&&s?{...c,...kb(a,c,c.position,!0)}:c}function K1e(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function $Je(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const X1e=()=>!0;function FJe(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:r,edgeUpdaterType:s,isTarget:a,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:p,onConnectStart:g,onConnect:b,onConnectEnd:v,isValidConnection:y=X1e,onReconnectEnd:x,updateConnection:O,getTransform:w,getFromHandle:k,autoPanSpeed:S,dragThreshold:E=1,handleDomNode:C}){const N=L1e(e.target);let _=0,j;const{x:A,y:F}=_u(e),T=K1e(s,C),P=l==null?void 0:l.getBoundingClientRect();let R=!1;if(!P||!T)return;const L=G1e(r,T,i,c,t);if(!L)return;let M=_u(e,P),U=!1,I=null,H=!1,Z=null;function Q(){if(!d||!P)return;const[G,K]=sB(M,P,S);h({x:G,y:K}),_=requestAnimationFrame(Q)}const q={...L,nodeId:r,type:T,position:L.position},B=c.get(r);let ce={inProgress:!0,isValid:null,from:kb(B,q,an.Left,!0),fromHandle:q,fromPosition:q.position,fromNode:B,to:M,toHandle:null,toPosition:IG[q.position],toNode:null,pointer:M};function se(){R=!0,O(ce),g==null||g(e,{nodeId:r,handleId:i,handleType:T})}E===0&&se();function re(G){if(!R){const{x:Je,y:De}=_u(G),Pe=Je-A,Ne=De-F;if(!(Pe*Pe+Ne*Ne>E*E))return;se()}if(!k()||!q){ge(G);return}const K=w();M=_u(G,P),j=LJe($x(M,K,!1,[1,1]),n,c,q),U||(Q(),U=!0);const ae=Y1e(G,{handle:j,connectionMode:t,fromNodeId:r,fromHandleId:i,fromType:a?"target":"source",isValidConnection:y,doc:N,lib:u,flowId:f,nodeLookup:c});Z=ae.handleDomNode,I=ae.connection,H=$Je(!!j,ae.isValid);const ue=c.get(r),xe=ue?kb(ue,q,an.Left,!0):ce.from,Ee={...ce,from:xe,isValid:H,to:ae.toHandle&&H?Wv({x:ae.toHandle.x,y:ae.toHandle.y},K):M,toHandle:ae.toHandle,toPosition:H&&ae.toHandle?ae.toHandle.position:IG[q.position],toNode:ae.toHandle?c.get(ae.toHandle.nodeId):null,pointer:M};O(Ee),ce=Ee}function ge(G){if(!("touches"in G&&G.touches.length>0)){if(R){(j||Z)&&I&&H&&(b==null||b(I));const{inProgress:K,...ae}=ce,ue={...ae,toPosition:ce.toHandle?ce.toPosition:null};v==null||v(G,ue),s&&(x==null||x(G,ue))}p(),cancelAnimationFrame(_),U=!1,H=!1,I=null,Z=null,N.removeEventListener("mousemove",re),N.removeEventListener("mouseup",ge),N.removeEventListener("touchmove",re),N.removeEventListener("touchend",ge)}}N.addEventListener("mousemove",re),N.addEventListener("mouseup",ge),N.addEventListener("touchmove",re),N.addEventListener("touchend",ge)}function Y1e(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:r,fromType:s,doc:a,lib:l,flowId:c,isValidConnection:u=X1e,nodeLookup:d}){const f=s==="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:g}=_u(e),b=a.elementFromPoint(p,g),v=b!=null&&b.classList.contains(`${l}-flow__handle`)?b:h,y={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const x=K1e(void 0,v),O=v.getAttribute("data-nodeid"),w=v.getAttribute("data-handleid"),k=v.classList.contains("connectable"),S=v.classList.contains("connectableend");if(!O||!x)return y;const E={source:f?O:i,sourceHandle:f?w:r,target:f?i:O,targetHandle:f?r:w};y.connection=E;const N=k&&S&&(n===Vv.Strict?f&&x==="source"||!f&&x==="target":O!==i||w!==r);y.isValid=N&&u(E),y.toHandle=G1e(O,x,w,d,n,!0)}return y}const u6={onPointerDown:FJe,isValid:Y1e};function BJe({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const r=Yl(e);function s({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:p=!1}){const g=O=>{if(O.sourceEvent.type!=="wheel"||!t)return;const w=n(),k=O.sourceEvent.ctrlKey&&PS()?10:1,S=-O.sourceEvent.deltaY*(O.sourceEvent.deltaMode===1?.05:O.sourceEvent.deltaMode?1:.002)*d,E=w[2]*Math.pow(2,S*k);t.scaleTo(E)};let b=[0,0];const v=O=>{(O.sourceEvent.type==="mousedown"||O.sourceEvent.type==="touchstart")&&(b=[O.sourceEvent.clientX??O.sourceEvent.touches[0].clientX,O.sourceEvent.clientY??O.sourceEvent.touches[0].clientY])},y=O=>{const w=n();if(O.sourceEvent.type!=="mousemove"&&O.sourceEvent.type!=="touchmove"||!t)return;const k=[O.sourceEvent.clientX??O.sourceEvent.touches[0].clientX,O.sourceEvent.clientY??O.sourceEvent.touches[0].clientY],S=[k[0]-b[0],k[1]-b[1]];b=k;const E=i()*Math.max(w[2],Math.log(w[2]))*(p?-1:1),C={x:w[0]-S[0]*E,y:w[1]-S[1]*E},N=[[0,0],[c,u]];t.setViewportConstrained({x:C.x,y:C.y,zoom:w[2]},N,l)},x=C1e().on("start",v).on("zoom",f?y:null).on("zoom.wheel",h?g:null);r.call(x,{})}function a(){r.on("zoom",null)}return{update:s,destroy:a,pointer:Ou}}const PR=e=>({x:e.x,y:e.y,zoom:e.k}),iM=({x:e,y:t,zoom:n})=>jR.translate(e,t).scale(n),Ay=(e,t)=>e.target.closest(`.${t}`),Z1e=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),UJe=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,rM=(e,t=0,n=UJe,i=()=>{})=>{const r=typeof t=="number"&&t>0;return r||i(),r?e.transition().duration(t).ease(n).on("end",i):e},J1e=e=>{const t=e.ctrlKey&&PS()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function QJe({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:r,panOnScrollSpeed:s,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(Ay(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&a){const v=Ou(d),y=J1e(d),x=f*Math.pow(2,y);i.scaleTo(n,x,v,d);return}const h=d.deltaMode===1?20:1;let p=r===rb.Vertical?0:d.deltaX*h,g=r===rb.Horizontal?0:d.deltaY*h;!PS()&&d.shiftKey&&r!==rb.Vertical&&(p=d.deltaY*h,g=0),i.translateBy(n,-(p/f)*s,-(g/f)*s,{internal:!0});const b=PR(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(d,b),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,b),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(d,b))}}function zJe({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(i,r){const s=i.type==="wheel",a=!t&&s&&!i.ctrlKey,l=Ay(i,e);if(i.ctrlKey&&s&&l&&i.preventDefault(),a||l)return null;i.preventDefault(),n.call(this,i,r)}}function VJe({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var s,a,l;if((s=i.sourceEvent)!=null&&s.internal)return;const r=PR(i.transform);e.mouseButton=((a=i.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=r,((l=i.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(i.sourceEvent,r))}}function HJe({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:r}){return s=>{var a,l;e.usedRightMouseButton=!!(n&&Z1e(t,e.mouseButton??0)),(a=s.sourceEvent)!=null&&a.sync||i([s.transform.x,s.transform.y,s.transform.k]),r&&!((l=s.sourceEvent)!=null&&l.internal)&&(r==null||r(s.sourceEvent,PR(s.transform)))}}function qJe({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:i,onPanZoomEnd:r,onPaneContextMenu:s}){return a=>{var l;if(!((l=a.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,s&&Z1e(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&s(a.sourceEvent),e.usedRightMouseButton=!1,i(!1),r)){const c=PR(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(a.sourceEvent,c)},n?150:0)}}}function WJe({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:i,panOnScroll:r,zoomOnDoubleClick:s,userSelectionActive:a,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{var v;const h=e||t,p=n&&f.ctrlKey,g=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Ay(f,`${u}-flow__node`)||Ay(f,`${u}-flow__edge`)))return!0;if(!i&&!h&&!r&&!s&&!n||a||d&&!g||Ay(f,l)&&g||Ay(f,c)&&(!g||r&&g&&!e)||!n&&f.ctrlKey&&g)return!1;if(!n&&f.type==="touchstart"&&((v=f.touches)==null?void 0:v.length)>1)return f.preventDefault(),!1;if(!h&&!r&&!p&&g||!i&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(i)&&!i.includes(f.button)&&f.type==="mousedown")return!1;const b=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||g)&&b}}function GJe({domNode:e,minZoom:t,maxZoom:n,translateExtent:i,viewport:r,onPanZoom:s,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=C1e().scaleExtent([t,n]).translateExtent(i),h=Yl(e).call(f);x({x:r.x,y:r.y,zoom:Hv(r.zoom,t,n)},[[0,0],[d.width,d.height]],i);const p=h.on("wheel.zoom"),g=h.on("dblclick.zoom");f.wheelDelta(J1e);async function b(j,A){return h?new Promise(F=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?OO:uA).transform(rM(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>F(!0)),j)}):!1}function v({noWheelClassName:j,noPanClassName:A,onPaneContextMenu:F,userSelectionActive:T,panOnScroll:P,panOnDrag:R,panOnScrollMode:L,panOnScrollSpeed:M,preventScrolling:U,zoomOnPinch:I,zoomOnScroll:H,zoomOnDoubleClick:Z,zoomActivationKeyPressed:Q,lib:q,onTransformChange:B,connectionInProgress:te,paneClickDistance:ce,selectionOnDrag:se}){T&&!u.isZoomingOrPanning&&y();const re=P&&!Q&&!T;f.clickDistance(se?1/0:!Au(ce)||ce<0?0:ce);const ge=re?QJe({zoomPanValues:u,noWheelClassName:j,d3Selection:h,d3Zoom:f,panOnScrollMode:L,panOnScrollSpeed:M,zoomOnPinch:I,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:l}):zJe({noWheelClassName:j,preventScrolling:U,d3ZoomHandler:p});h.on("wheel.zoom",ge,{passive:!1});const G=VJe({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});f.on("start",G);const K=HJe({zoomPanValues:u,panOnDrag:R,onPaneContextMenu:!!F,onPanZoom:s,onTransformChange:B});f.on("zoom",K);const ae=qJe({zoomPanValues:u,panOnDrag:R,panOnScroll:P,onPaneContextMenu:F,onPanZoomEnd:l,onDraggingChange:c});f.on("end",ae);const ue=WJe({zoomActivationKeyPressed:Q,panOnDrag:R,zoomOnScroll:H,panOnScroll:P,zoomOnDoubleClick:Z,zoomOnPinch:I,userSelectionActive:T,noPanClassName:A,noWheelClassName:j,lib:q,connectionInProgress:te});f.filter(ue),Z?h.on("dblclick.zoom",g):h.on("dblclick.zoom",null)}function y(){f.on("zoom",null)}async function x(j,A,F){const T=iM(j),P=f==null?void 0:f.constrain()(T,A,F);return P&&await b(P),P}async function O(j,A){const F=iM(j);return await b(F,A),F}function w(j){if(h){const A=iM(j),F=h.property("__zoom");(F.k!==j.zoom||F.x!==j.x||F.y!==j.y)&&(f==null||f.transform(h,A,null,{sync:!0}))}}function k(){const j=h?E1e(h.node()):{x:0,y:0,k:1};return{x:j.x,y:j.y,zoom:j.k}}async function S(j,A){return h?new Promise(F=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?OO:uA).scaleTo(rM(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>F(!0)),j)}):!1}async function E(j,A){return h?new Promise(F=>{f==null||f.interpolate((A==null?void 0:A.interpolate)==="linear"?OO:uA).scaleBy(rM(h,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>F(!0)),j)}):!1}function C(j){f==null||f.scaleExtent(j)}function N(j){f==null||f.translateExtent(j)}function _(j){const A=!Au(j)||j<0?0:j;f==null||f.clickDistance(A)}return{update:v,destroy:y,setViewport:O,setViewportConstrained:x,getViewport:k,scaleTo:S,scaleBy:E,setScaleExtent:C,setTranslateExtent:N,syncViewport:w,setClickDistance:_}}var Gv;(function(e){e.Line="line",e.Handle="handle"})(Gv||(Gv={}));function KJe({width:e,prevWidth:t,height:n,prevHeight:i,affectsX:r,affectsY:s}){const a=e-t,l=n-i,c=[a>0?1:a<0?-1:0,l>0?1:l<0?-1:0];return a&&r&&(c[0]=c[0]*-1),l&&s&&(c[1]=c[1]*-1),c}function qG(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),i=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:i,affectsY:r}}function lp(e,t){return Math.max(0,t-e)}function cp(e,t){return Math.max(0,e-t)}function bT(e,t,n){return Math.max(0,t-e,e-n)}function WG(e,t){return e?!t:t}function XJe(e,t,n,i,r,s,a,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:p,ySnapped:g}=n,{minWidth:b,maxWidth:v,minHeight:y,maxHeight:x}=i,{x:O,y:w,width:k,height:S,aspectRatio:E}=e;let C=Math.floor(d?p-e.pointerX:0),N=Math.floor(f?g-e.pointerY:0);const _=k+(c?-C:C),j=S+(u?-N:N),A=-s[0]*k,F=-s[1]*S;let T=bT(_,b,v),P=bT(j,y,x);if(a){let M=0,U=0;c&&C<0?M=lp(O+C+A,a[0][0]):!c&&C>0&&(M=cp(O+_+A,a[1][0])),u&&N<0?U=lp(w+N+F,a[0][1]):!u&&N>0&&(U=cp(w+j+F,a[1][1])),T=Math.max(T,M),P=Math.max(P,U)}if(l){let M=0,U=0;c&&C>0?M=cp(O+C,l[0][0]):!c&&C<0&&(M=lp(O+_,l[1][0])),u&&N>0?U=cp(w+N,l[0][1]):!u&&N<0&&(U=lp(w+j,l[1][1])),T=Math.max(T,M),P=Math.max(P,U)}if(r){if(d){const M=bT(_/E,y,x)*E;if(T=Math.max(T,M),a){let U=0;!c&&!u||c&&!u&&h?U=cp(w+F+_/E,a[1][1])*E:U=lp(w+F+(c?C:-C)/E,a[0][1])*E,T=Math.max(T,U)}if(l){let U=0;!c&&!u||c&&!u&&h?U=lp(w+_/E,l[1][1])*E:U=cp(w+(c?C:-C)/E,l[0][1])*E,T=Math.max(T,U)}}if(f){const M=bT(j*E,b,v)/E;if(P=Math.max(P,M),a){let U=0;!c&&!u||u&&!c&&h?U=cp(O+j*E+A,a[1][0])/E:U=lp(O+(u?N:-N)*E+A,a[0][0])/E,P=Math.max(P,U)}if(l){let U=0;!c&&!u||u&&!c&&h?U=lp(O+j*E,l[1][0])/E:U=cp(O+(u?N:-N)*E,l[0][0])/E,P=Math.max(P,U)}}}N=N+(N<0?P:-P),C=C+(C<0?T:-T),r&&(h?_>j*E?N=(WG(c,u)?-C:C)/E:C=(WG(c,u)?-N:N)*E:d?(N=C/E,u=c):(C=N*E,c=u));const R=c?O+C:O,L=u?w+N:w;return{width:k+(c?-C:C),height:S+(u?-N:N),x:s[0]*C*(c?-1:1)+R,y:s[1]*N*(u?-1:1)+L}}const ewe={width:0,height:0,x:0,y:0},YJe={...ewe,pointerX:0,pointerY:0,aspectRatio:1};function ZJe(e,t,n){const i=t.position.x+e.position.x,r=t.position.y+e.position.y,s=e.measured.width??0,a=e.measured.height??0,l=n[0]*s,c=n[1]*a;return[[i-l,r-c],[i+s-l,r+a-c]]}function JJe({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:r}){const s=Yl(e);let a={controlDirection:qG("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:g,onResizeEnd:b,shouldResize:v}){let y={...ewe},x={...YJe};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:qG(u)};let O,w=null,k=[],S,E,C,N=!1;const _=u1e().on("start",j=>{const{nodeLookup:A,transform:F,snapGrid:T,snapToGrid:P,nodeOrigin:R,paneDomNode:L}=n();if(O=A.get(t),!O)return;w=(L==null?void 0:L.getBoundingClientRect())??null;const{xSnapped:M,ySnapped:U}=SO(j.sourceEvent,{transform:F,snapGrid:T,snapToGrid:P,containerBounds:w});y={width:O.measured.width??0,height:O.measured.height??0,x:O.position.x??0,y:O.position.y??0},x={...y,pointerX:M,pointerY:U,aspectRatio:y.width/y.height},S=void 0,E=Sb(O.extent)?O.extent:void 0,O.parentId&&(O.extent==="parent"||O.expandParent)&&(S=A.get(O.parentId)),S&&O.extent==="parent"&&(E=[[0,0],[S.measured.width,S.measured.height]]),k=[],C=void 0;for(const[I,H]of A)if(H.parentId===t&&(k.push({id:I,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const Z=ZJe(H,O,H.origin??R);C?C=[[Math.min(Z[0][0],C[0][0]),Math.min(Z[0][1],C[0][1])],[Math.max(Z[1][0],C[1][0]),Math.max(Z[1][1],C[1][1])]]:C=Z}p==null||p(j,{...y})}).on("drag",j=>{const{transform:A,snapGrid:F,snapToGrid:T,nodeOrigin:P}=n(),R=SO(j.sourceEvent,{transform:A,snapGrid:F,snapToGrid:T,containerBounds:w}),L=[];if(!O)return;const{x:M,y:U,width:I,height:H}=y,Z={},Q=O.origin??P,{width:q,height:B,x:te,y:ce}=XJe(x,a.controlDirection,R,a.boundaries,a.keepAspectRatio,Q,E,C),se=q!==I,re=B!==H,ge=te!==M&&se,G=ce!==U&&re;if(!ge&&!G&&!se&&!re)return;if((ge||G||Q[0]===1||Q[1]===1)&&(Z.x=ge?te:y.x,Z.y=G?ce:y.y,y.x=Z.x,y.y=Z.y,k.length>0)){const xe=te-M,Ee=ce-U;for(const Je of k)Je.position={x:Je.position.x-xe+Q[0]*(q-I),y:Je.position.y-Ee+Q[1]*(B-H)},L.push(Je)}if((se||re)&&(Z.width=se&&(!a.resizeDirection||a.resizeDirection==="horizontal")?q:y.width,Z.height=re&&(!a.resizeDirection||a.resizeDirection==="vertical")?B:y.height,y.width=Z.width,y.height=Z.height),S&&O.expandParent){const xe=Q[0]*(Z.width??0);Z.x&&Z.x{N&&(b==null||b(j,{...y}),r==null||r({...y}),N=!1)});s.call(_)}function c(){s.on(".drag",null)}return{update:l,destroy:c}}var twe={exports:{}},nwe={};/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -501,22 +501,22 @@ ${n}`}}async function*fBe({runtimeId:e,region:t,instanceName:n,sessionId:i,follo `,` +`).split(` -`)),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return m.useEffect(()=>{const c=(t==null?void 0:t.target)??eK,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=p=>{var v,y;if(r.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!r.current||r.current&&!u)&&$1e(p))return!1;const b=nK(p.code,l);if(s.current.add(p[b]),tK(a,s.current,!1)){const x=((y=(v=p.composedPath)==null?void 0:v.call(p))==null?void 0:y[0])||p.target,O=(x==null?void 0:x.nodeName)==="BUTTON"||(x==null?void 0:x.nodeName)==="A";t.preventDefault!==!1&&(r.current||!O)&&p.preventDefault(),i(!0)}},f=p=>{const g=nK(p.code,l);tK(a,s.current,!0)?(i(!1),s.current.clear()):s.current.delete(p[g]),p.key==="Meta"&&s.current.clear(),r.current=!1},h=()=>{s.current.clear(),i(!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,i]),n}function tK(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(r=>t.has(r)))}function nK(e,t){return t.includes(e)?"code":"key"}const Met=()=>{const e=ss();return m.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:i}=e.getState();return i?i.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[i,r,s],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??i,y:t.y??r,zoom:t.zoom??s},n),!0):!1},getViewport:()=>{const[t,n,i]=e.getState().transform;return{x:t,y:n,zoom:i}},setCenter:async(t,n,i)=>e.getState().setCenter(t,n,i),fitBounds:async(t,n)=>{const{width:i,height:r,minZoom:s,maxZoom:a,panZoom:l}=e.getState(),c=aB(t,i,r,s,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:i,snapGrid:r,snapToGrid:s,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??r,f=n.snapToGrid??s;return $x(u,i,f,d)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:r,y:s}=i.getBoundingClientRect(),a=Wv(t,n);return{x:a.x+r,y:a.y+s}}}),[])};function lwe(e,t){const n=[],i=new Map,r=[];for(const s of e)if(s.type==="add"){r.push(s);continue}else if(s.type==="remove"||s.type==="replace")i.set(s.id,[s]);else{const a=i.get(s.id);a?a.push(s):i.set(s.id,[s])}for(const s of t){const a=i.get(s.id);if(!a){n.push(s);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const l={...s};for(const c of a)Let(c,l);n.push(l)}return r.length&&r.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function Let(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 cwe(e,t){return lwe(e,t)}function uwe(e,t){return lwe(e,t)}function Og(e,t){return{id:e,type:"select",selected:t}}function _y(e,t=new Set,n=!1){const i=[];for(const[r,s]of e){const a=t.has(r);!(s.selected===void 0&&!a)&&s.selected!==a&&(n&&(s.selected=a),i.push(Og(s.id,a)))}return i}function iK({items:e=[],lookup:t}){var r;const n=[],i=new Map(e.map(s=>[s.id,s]));for(const[s,a]of e.entries()){const l=t.get(a.id),c=((r=l==null?void 0:l.internals)==null?void 0:r.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:s})}for(const[s]of t)i.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function rK(e){return{id:e.id,type:"remove"}}const $et=D1e();function Fet(e,t,n={}){return yJe(e,t,{...n,onError:n.onError??$et})}const sK=e=>iJe(e),Bet=e=>j1e(e);function dwe(e){return m.forwardRef(e)}const Uet=typeof window<"u"?m.useLayoutEffect:m.useEffect;function aK(e){const[t,n]=m.useState(BigInt(0)),[i]=m.useState(()=>Qet(()=>n(r=>r+BigInt(1))));return Uet(()=>{const r=i.get();r.length&&(e(r),i.reset())},[t]),i}function Qet(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const fwe=m.createContext(null);function zet({children:e}){const t=ss(),n=m.useCallback(l=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:p,onNodesChangeMiddlewareMap:g}=t.getState();let b=c;for(const y of l)b=typeof y=="function"?y(b):y;let v=iK({items:b,lookup:h});for(const y of g.values())v=y(v);d&&u(b),v.length>0?f==null||f(v):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:y,nodes:x,setNodes:O}=t.getState();y&&O(x)})},[]),i=aK(n),r=m.useCallback(l=>{const{edges:c=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let p=c;for(const g of l)p=typeof g=="function"?g(p):g;d?u(p):f&&f(iK({items:p,lookup:h}))},[]),s=aK(r),a=m.useMemo(()=>({nodeQueue:i,edgeQueue:s}),[]);return o.jsx(fwe.Provider,{value:a,children:e})}function Vet(){const e=m.useContext(fwe);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Het=e=>!!e.panZoom;function $R(){const e=Met(),t=ss(),n=Vet(),i=_i(Het),r=m.useMemo(()=>{const s=f=>t.getState().nodeLookup.get(f),a=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var y,x;const{nodeLookup:h,nodeOrigin:p}=t.getState(),g=sK(f)?f:h.get(f.id),b=g.parentId?M1e(g.position,g.measured,g.parentId,h,p):g.position,v={...g,position:b,width:((y=g.measured)==null?void 0:y.width)??g.width,height:((x=g.measured)==null?void 0:x.height)??g.height};return qv(v)},u=(f,h,p={replace:!1})=>{a(g=>g.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return p.replace&&sK(v)?v:{...b,...v}}return b}))},d=(f,h,p={replace:!1})=>{l(g=>g.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return p.replace&&Bet(v)?v:{...b,...v}}return b}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var h;return(h=s(f))==null?void 0:h.internals.userNode},getInternalNode:s,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(),[g,b,v]=p;return{nodes:f.map(y=>({...y})),edges:h.map(y=>({...y})),viewport:{x:g,y:b,zoom:v}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:p,edges:g,onNodesDelete:b,onEdgesDelete:v,triggerNodeChanges:y,triggerEdgeChanges:x,onDelete:O,onBeforeDelete:w}=t.getState(),{nodes:k,edges:S}=await lJe({nodesToRemove:f,edgesToRemove:h,nodes:p,edges:g,onBeforeDelete:w}),E=S.length>0,C=k.length>0;if(E){const N=S.map(rK);v==null||v(S),x(N)}if(C){const N=k.map(rK);b==null||b(k),y(N)}return(C||E)&&(O==null||O({nodes:k,edges:S})),{deletedNodes:k,deletedEdges:S}},getIntersectingNodes:(f,h=!0,p)=>{const g=DG(f),b=g?f:c(f),v=p!==void 0;return b?(p||t.getState().nodes).filter(y=>{const x=t.getState().nodeLookup.get(y.id);if(x&&!g&&(y.id===f.id||!x.internals.positionAbsolute))return!1;const O=qv(v?y:x),w=IS(O,b);return h&&w>0||w>=O.width*O.height||w>=b.width*b.height}):[]},isNodeIntersecting:(f,h,p=!0)=>{const b=DG(f)?f:c(f);if(!b)return!1;const v=IS(b,h);return p&&v>0||v>=h.width*h.height||v>=b.width*b.height},updateNode:u,updateNodeData:(f,h,p={replace:!1})=>{u(f,g=>{const b=typeof h=="function"?h(g):h;return p.replace?{...g,data:b}:{...g,data:{...g.data,...b}}},p)},updateEdge:d,updateEdgeData:(f,h,p={replace:!1})=>{d(f,g=>{const b=typeof h=="function"?h(g):h;return p.replace?{...g,data:b}:{...g,data:{...g.data,...b}}},p)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:p}=t.getState();return rJe(f,{nodeLookup:h,nodeOrigin:p})},getHandleConnections:({type:f,id:h,nodeId:p})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${p}-${f}${h?`-${h}`:""}`))==null?void 0:g.values())??[])},getNodeConnections:({type:f,handleId:h,nodeId:p})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${p}${f?h?`-${f}-${h}`:`-${f}`:""}`))==null?void 0:g.values())??[])},fitView:async f=>{const h=t.getState().fitViewResolver??dJe();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(p=>[...p]),h.promise}}},[]);return m.useMemo(()=>({...r,...e,viewportInitialized:i}),[i])}const oK=e=>e.selected,qet=typeof window<"u"?window:void 0;function Wet({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ss(),{deleteElements:i}=$R(),r=DS(e,{actInsideInputWithModifier:!1}),s=DS(t,{target:qet});m.useEffect(()=>{if(r){const{edges:a,nodes:l}=n.getState();i({nodes:l.filter(oK),edges:a.filter(oK)}),n.setState({nodesSelectionActive:!1})}},[r]),m.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function Get(e){const t=ss();m.useEffect(()=>{const n=()=>{var r,s,a,l;if(!e.current||!(((s=(r=e.current).checkVisibility)==null?void 0:s.call(r))??!0))return!1;const i=lB(e.current);(i.height===0||i.width===0)&&((l=(a=t.getState()).onError)==null||l.call(a,"004",Fu.error004())),t.setState({width:i.width||500,height:i.height||500})};if(e.current){n(),window.addEventListener("resize",n);const i=new ResizeObserver(()=>n());return i.observe(e.current),()=>{window.removeEventListener("resize",n),i&&e.current&&i.unobserve(e.current)}}},[])}const FR={position:"absolute",width:"100%",height:"100%",top:0,left:0},Ket=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Xet({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:r=.5,panOnScrollMode:s=rb.Free,zoomOnDoubleClick:a=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:p=!0,children:g,noWheelClassName:b,noPanClassName:v,onViewportChange:y,isControlledViewport:x,paneClickDistance:O,selectionOnDrag:w}){const k=ss(),S=m.useRef(null),{userSelectionActive:E,lib:C,connectionInProgress:N}=_i(Ket,rs),_=DS(h),j=m.useRef();Get(S);const A=m.useCallback(F=>{y==null||y({x:F[0],y:F[1],zoom:F[2]}),x||k.setState({transform:F})},[y,x]);return m.useEffect(()=>{if(S.current){j.current=GJe({domNode:S.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:R=>k.setState(L=>L.paneDragging===R?L:{paneDragging:R}),onPanZoomStart:(R,L)=>{const{onViewportChangeStart:M,onMoveStart:U}=k.getState();U==null||U(R,L),M==null||M(L)},onPanZoom:(R,L)=>{const{onViewportChange:M,onMove:U}=k.getState();U==null||U(R,L),M==null||M(L)},onPanZoomEnd:(R,L)=>{const{onViewportChangeEnd:M,onMoveEnd:U}=k.getState();U==null||U(R,L),M==null||M(L)}});const{x:F,y:T,zoom:P}=j.current.getViewport();return k.setState({panZoom:j.current,transform:[F,T,P],domNode:S.current.closest(".react-flow")}),()=>{var R;(R=j.current)==null||R.destroy()}}},[]),m.useEffect(()=>{var F;(F=j.current)==null||F.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:r,panOnScrollMode:s,zoomOnDoubleClick:a,panOnDrag:l,zoomActivationKeyPressed:_,preventScrolling:p,noPanClassName:v,userSelectionActive:E,noWheelClassName:b,lib:C,onTransformChange:A,connectionInProgress:N,selectionOnDrag:w,paneClickDistance:O})},[e,t,n,i,r,s,a,l,_,p,v,E,b,C,A,N,w,O]),o.jsx("div",{className:"react-flow__renderer",ref:S,style:FR,children:g})}const Yet=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Zet(){const{userSelectionActive:e,userSelectionRect:t}=_i(Yet,rs);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 sM=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Jet=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function ett({isSelecting:e,selectionKeyPressed:t,selectionMode:n=jS.Full,panOnDrag:i,autoPanOnSelection:r,paneClickDistance:s,selectionOnDrag:a,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:p,onPaneMouseLeave:g,children:b}){const v=m.useRef(0),y=ss(),{userSelectionActive:x,elementsSelectable:O,dragging:w,connectionInProgress:k,panBy:S,autoPanSpeed:E}=_i(Jet,rs),C=O&&(e||x),N=m.useRef(null),_=m.useRef(),j=m.useRef(new Set),A=m.useRef(new Set),F=m.useRef(!1),T=m.useRef({x:0,y:0}),P=m.useRef(!1),R=se=>{if(F.current||k){F.current=!1;return}u==null||u(se),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},L=se=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){se.preventDefault();return}d==null||d(se)},M=f?se=>f(se):void 0,U=se=>{F.current&&(se.stopPropagation(),F.current=!1)},I=se=>{var lt,$e;const{domNode:re,transform:ge}=y.getState();if(_.current=re==null?void 0:re.getBoundingClientRect(),!_.current)return;const W=se.target===N.current;if(!W&&!!se.target.closest(".nokey")||!e||!(a&&W||t)||se.button!==0||!se.isPrimary)return;($e=(lt=se.target)==null?void 0:lt.setPointerCapture)==null||$e.call(lt,se.pointerId),F.current=!1;const{x:ue,y:Oe}=_u(se.nativeEvent,_.current),Se=$x({x:ue,y:Oe},ge);y.setState({userSelectionRect:{width:0,height:0,startX:Se.x,startY:Se.y,x:ue,y:Oe}}),W||(se.stopPropagation(),se.preventDefault())};function H(se,re){const{userSelectionRect:ge}=y.getState();if(!ge)return;const{transform:W,nodeLookup:X,edgeLookup:ae,connectionLookup:ue,triggerNodeChanges:Oe,triggerEdgeChanges:Se,defaultEdgeOptions:lt}=y.getState(),$e={x:ge.startX,y:ge.startY},{x:Le,y:Ne}=Wv($e,W),qe={startX:$e.x,startY:$e.y,x:seDe.id)),A.current=new Set;const Ee=(lt==null?void 0:lt.selectable)??!0;for(const De of j.current){const J=ue.get(De);if(J)for(const{edgeId:he}of J.values()){const Ce=ae.get(he);Ce&&(Ce.selectable??Ee)&&A.current.add(he)}}if(!MG(Re,j.current)){const De=_y(X,j.current,!0);Oe(De)}if(!MG(ze,A.current)){const De=_y(ae,A.current);Se(De)}y.setState({userSelectionRect:qe,userSelectionActive:!0,nodesSelectionActive:!1})}function K(){if(!r||!_.current)return;const[se,re]=sB(T.current,_.current,E);S({x:se,y:re}).then(ge=>{if(!F.current||!ge){v.current=requestAnimationFrame(K);return}const{x:W,y:X}=T.current;H(W,X),v.current=requestAnimationFrame(K)})}const Q=()=>{cancelAnimationFrame(v.current),v.current=0,P.current=!1};m.useEffect(()=>()=>Q(),[]);const q=se=>{const{userSelectionRect:re,transform:ge,resetSelectedElements:W}=y.getState();if(!_.current||!re)return;const{x:X,y:ae}=_u(se.nativeEvent,_.current);T.current={x:X,y:ae};const ue=Wv({x:re.startX,y:re.startY},ge);if(!F.current){const Oe=t?0:s;if(Math.hypot(X-ue.x,ae-ue.y)<=Oe)return;W(),l==null||l(se)}F.current=!0,P.current||(K(),P.current=!0),H(X,ae)},B=se=>{var re,ge;se.button===0&&((ge=(re=se.target)==null?void 0:re.releasePointerCapture)==null||ge.call(re,se.pointerId),!x&&se.target===N.current&&y.getState().userSelectionRect&&(R==null||R(se)),y.setState({userSelectionActive:!1,userSelectionRect:null}),F.current&&(c==null||c(se),y.setState({nodesSelectionActive:j.current.size>0})),Q())},ee=se=>{var re,ge;(ge=(re=se.target)==null?void 0:re.releasePointerCapture)==null||ge.call(re,se.pointerId),Q()},le=i===!0||Array.isArray(i)&&i.includes(0);return o.jsxs("div",{className:ta(["react-flow__pane",{draggable:le,dragging:w,selection:e}]),onClick:C?void 0:sM(R,N),onContextMenu:sM(L,N),onWheel:sM(M,N),onPointerEnter:C?void 0:h,onPointerMove:C?q:p,onPointerUp:C?B:void 0,onPointerCancel:C?ee:void 0,onPointerDownCapture:C?I:void 0,onClickCapture:C?U:void 0,onPointerLeave:g,ref:N,style:FR,children:[b,o.jsx(Zet,{})]})}function d6({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:r,unselectNodesAndEdges:s,multiSelectionActive:a,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",Fu.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&a)&&(s({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=i==null?void 0:i.current)==null?void 0:d.blur()})):r([e])}function hwe({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:r,isSelectable:s,nodeClickDistance:a}){const l=ss(),[c,u]=m.useState(!1),d=m.useRef();return m.useEffect(()=>{d.current=PJe({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{d6({id:f,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),m.useEffect(()=>{if(!(t||!e.current||!d.current))return d.current.update({noDragClassName:n,handleSelector:i,domNode:e.current,isSelectable:s,nodeId:r,nodeClickDistance:a}),()=>{var f;(f=d.current)==null||f.destroy()}},[n,i,t,s,e,r,a]),c}const ttt=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function pwe(){const e=ss();return m.useCallback(n=>{const{nodeExtent:i,snapToGrid:r,snapGrid:s,nodesDraggable:a,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=ttt(a),p=r?s[0]:5,g=r?s[1]:5,b=n.direction.x*p*n.factor,v=n.direction.y*g*n.factor;for(const[,y]of u){if(!h(y))continue;let x={x:y.internals.positionAbsolute.x+b,y:y.internals.positionAbsolute.y+v};r&&(x=rE(x,s));const{position:O,positionAbsolute:w}=R1e({nodeId:y.id,nextPosition:x,nodeLookup:u,nodeExtent:i,nodeOrigin:d,onError:l});y.position=O,y.internals.positionAbsolute=w,f.set(y.id,y)}c(f)},[])}const pB=m.createContext(null),ntt=pB.Provider;pB.Consumer;const mwe=()=>m.useContext(pB),itt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),rtt=(e,t,n)=>i=>{const{connectionClickStartHandle:r,connectionMode:s,connection:a}=i,{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:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.id)===t&&(r==null?void 0:r.type)===n,isPossibleEndHandle:s===Vv.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:!!r,valid:d&&u}};function stt({type:e="source",position:t=rn.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:r=!0,isConnectableEnd:s=!0,id:a,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},p){var P,R;const g=a||null,b=e==="target",v=ss(),y=mwe(),{connectOnClick:x,noPanClassName:O,rfId:w}=_i(itt,rs),{connectingFrom:k,connectingTo:S,clickConnecting:E,isPossibleEndHandle:C,connectionInProcess:N,clickConnectionInProcess:_,valid:j}=_i(rtt(y,g,e),rs);y||(R=(P=v.getState()).onError)==null||R.call(P,"010",Fu.error010());const A=L=>{const{defaultEdgeOptions:M,onConnect:U,hasDefaultEdges:I}=v.getState(),H={...M,...L};if(I){const{edges:K,setEdges:Q,onError:q}=v.getState();Q(Fet(H,K,{onError:q}))}U==null||U(H),l==null||l(H)},F=L=>{if(!y)return;const M=F1e(L.nativeEvent);if(r&&(M&&L.button===0||!M)){const U=v.getState();u6.onPointerDown(L.nativeEvent,{handleDomNode:L.currentTarget,autoPanOnConnect:U.autoPanOnConnect,connectionMode:U.connectionMode,connectionRadius:U.connectionRadius,domNode:U.domNode,nodeLookup:U.nodeLookup,lib:U.lib,isTarget:b,handleId:g,nodeId:y,flowId:U.rfId,panBy:U.panBy,cancelConnection:U.cancelConnection,onConnectStart:U.onConnectStart,onConnectEnd:(...I)=>{var H,K;return(K=(H=v.getState()).onConnectEnd)==null?void 0:K.call(H,...I)},updateConnection:U.updateConnection,onConnect:A,isValidConnection:n||((...I)=>{var H,K;return((K=(H=v.getState()).isValidConnection)==null?void 0:K.call(H,...I))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:U.autoPanSpeed,dragThreshold:U.connectionDragThreshold})}M?d==null||d(L):f==null||f(L)},T=L=>{const{onClickConnectStart:M,onClickConnectEnd:U,connectionClickStartHandle:I,connectionMode:H,isValidConnection:K,lib:Q,rfId:q,nodeLookup:B,connection:ee}=v.getState();if(!y||!I&&!r)return;if(!I){M==null||M(L.nativeEvent,{nodeId:y,handleId:g,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:y,type:e,id:g}});return}const le=L1e(L.target),se=n||K,{connection:re,isValid:ge}=u6.isValid(L.nativeEvent,{handle:{nodeId:y,id:g,type:e},connectionMode:H,fromNodeId:I.nodeId,fromHandleId:I.id||null,fromType:I.type,isValidConnection:se,flowId:q,doc:le,lib:Q,nodeLookup:B});ge&&re&&A(re);const W=structuredClone(ee);delete W.inProgress,W.toPosition=W.toHandle?W.toHandle.position:null,U==null||U(L,W),v.setState({connectionClickStartHandle:null})};return o.jsx("div",{"data-handleid":g,"data-nodeid":y,"data-handlepos":t,"data-id":`${w}-${y}-${g}-${e}`,className:ta(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",O,u,{source:!b,target:b,connectable:i,connectablestart:r,connectableend:s,clickconnecting:E,connectingfrom:k,connectingto:S,valid:j,connectionindicator:i&&(!N||C)&&(N||_?s:r)}]),onMouseDown:F,onTouchStart:F,onClick:x?T:void 0,ref:p,...h,children:c})}const fl=m.memo(dwe(stt));function att({data:e,isConnectable:t,sourcePosition:n=rn.Bottom}){return o.jsxs(o.Fragment,{children:[e==null?void 0:e.label,o.jsx(fl,{type:"source",position:n,isConnectable:t})]})}function ott({data:e,isConnectable:t,targetPosition:n=rn.Top,sourcePosition:i=rn.Bottom}){return o.jsxs(o.Fragment,{children:[o.jsx(fl,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,o.jsx(fl,{type:"source",position:i,isConnectable:t})]})}function ltt(){return null}function ctt({data:e,isConnectable:t,targetPosition:n=rn.Top}){return o.jsxs(o.Fragment,{children:[o.jsx(fl,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const eN={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},lK={input:att,default:ott,output:ctt,group:ltt};function utt(e){var t,n,i,r;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??((i=e.style)==null?void 0:i.width),height:e.height??((r=e.style)==null?void 0:r.height)}}const dtt=e=>{const{width:t,height:n,x:i,y:r}=iE(e.nodeLookup,{filter:s=>!!s.selected});return{width:Au(t)?t:null,height:Au(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${i}px,${r}px)`}};function ftt({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=ss(),{width:r,height:s,transformString:a,userSelectionActive:l}=_i(dtt,rs),c=pwe(),u=m.useRef(null);m.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]);const d=!l&&r!==null&&s!==null;if(hwe({nodeRef:u,disabled:!d}),!d)return null;const f=e?p=>{const g=i.getState().nodes.filter(b=>b.selected);e(p,g)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(eN,p.key)&&(p.preventDefault(),c({direction:eN[p.key],factor:p.shiftKey?4:1}))};return o.jsx("div",{className:ta(["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:r,height:s}})})}const cK=typeof window<"u"?window:void 0,htt=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function gwe({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:a,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:g,panActivationKeyCode:b,zoomActivationKeyCode:v,elementsSelectable:y,zoomOnScroll:x,zoomOnPinch:O,panOnScroll:w,panOnScrollSpeed:k,panOnScrollMode:S,zoomOnDoubleClick:E,panOnDrag:C,autoPanOnSelection:N,defaultViewport:_,translateExtent:j,minZoom:A,maxZoom:F,preventScrolling:T,onSelectionContextMenu:P,noWheelClassName:R,noPanClassName:L,disableKeyboardA11y:M,onViewportChange:U,isControlledViewport:I}){const{nodesSelectionActive:H,userSelectionActive:K}=_i(htt,rs),Q=DS(u,{target:cK}),q=DS(b,{target:cK}),B=q||C,ee=q||w,le=d&&B!==!0,se=Q||K||le;return Wet({deleteKeyCode:c,multiSelectionKeyCode:g}),o.jsx(Xet,{onPaneContextMenu:s,elementsSelectable:y,zoomOnScroll:x,zoomOnPinch:O,panOnScroll:ee,panOnScrollSpeed:k,panOnScrollMode:S,zoomOnDoubleClick:E,panOnDrag:!Q&&B,defaultViewport:_,translateExtent:j,minZoom:A,maxZoom:F,zoomActivationKeyCode:v,preventScrolling:T,noWheelClassName:R,noPanClassName:L,onViewportChange:U,isControlledViewport:I,paneClickDistance:l,selectionOnDrag:le,children:o.jsxs(ett,{onSelectionStart:h,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:a,panOnDrag:B,autoPanOnSelection:N,isSelecting:!!se,selectionMode:f,selectionKeyPressed:Q,paneClickDistance:l,selectionOnDrag:le,children:[e,H&&o.jsx(ftt,{onSelectionContextMenu:P,noPanClassName:L,disableKeyboardA11y:M})]})})}gwe.displayName="FlowRenderer";const ptt=m.memo(gwe),mtt=e=>t=>e?rB(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 gtt(e){return _i(m.useCallback(mtt(e),[e]),rs)}const btt=e=>e.updateNodeInternals;function ytt(){const e=_i(btt),[t]=m.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const i=new Map;n.forEach(r=>{const s=r.target.getAttribute("data-id");i.set(s,{id:s,nodeElement:r.target,force:!0})}),e(i)}));return m.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function vtt({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const r=ss(),s=m.useRef(null),a=m.useRef(null),l=m.useRef(e.sourcePosition),c=m.useRef(e.targetPosition),u=m.useRef(t),d=n&&!!e.internals.handleBounds;return m.useEffect(()=>{s.current&&!e.hidden&&(!d||a.current!==s.current)&&(a.current&&(i==null||i.unobserve(a.current)),i==null||i.observe(s.current),a.current=s.current)},[d,e.hidden]),m.useEffect(()=>()=>{a.current&&(i==null||i.unobserve(a.current),a.current=null)},[]),m.useEffect(()=>{if(s.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,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}function xtt({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:r,onContextMenu:s,onDoubleClick:a,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:p,disableKeyboardA11y:g,rfId:b,nodeTypes:v,nodeClickDistance:y,onError:x}){const{node:O,internals:w,isParent:k}=_i(se=>{const re=se.nodeLookup.get(e),ge=se.parentLookup.has(e);return{node:re,internals:re.internals,isParent:ge}},rs);let S=O.type||"default",E=(v==null?void 0:v[S])||lK[S];E===void 0&&(x==null||x("003",Fu.error003(S)),S="default",E=(v==null?void 0:v.default)||lK.default);const C=!!(O.draggable||l&&typeof O.draggable>"u"),N=!!(O.selectable||c&&typeof O.selectable>"u"),_=!!(O.connectable||u&&typeof O.connectable>"u"),j=!!(O.focusable||d&&typeof O.focusable>"u"),A=ss(),F=oB(O),T=vtt({node:O,nodeType:S,hasDimensions:F,resizeObserver:f}),P=hwe({nodeRef:T,disabled:O.hidden||!C,noDragClassName:h,handleSelector:O.dragHandle,nodeId:e,isSelectable:N,nodeClickDistance:y}),R=pwe();if(O.hidden)return null;const L=Fh(O),M=utt(O),U=N||C||t||n||i||r,I=n?se=>n(se,{...w.userNode}):void 0,H=i?se=>i(se,{...w.userNode}):void 0,K=r?se=>r(se,{...w.userNode}):void 0,Q=s?se=>s(se,{...w.userNode}):void 0,q=a?se=>a(se,{...w.userNode}):void 0,B=se=>{const{selectNodesOnDrag:re,nodeDragThreshold:ge}=A.getState();N&&(!re||!C||ge>0)&&d6({id:e,store:A,nodeRef:T}),t&&t(se,{...w.userNode})},ee=se=>{if(!($1e(se.nativeEvent)||g)){if(T1e.includes(se.key)&&N){const re=se.key==="Escape";d6({id:e,store:A,unselect:re,nodeRef:T})}else if(C&&O.selected&&Object.prototype.hasOwnProperty.call(eN,se.key)){se.preventDefault();const{ariaLabelConfig:re}=A.getState();A.setState({ariaLiveMessage:re["node.a11yDescription.ariaLiveMessage"]({direction:se.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),R({direction:eN[se.key],factor:se.shiftKey?4:1})}}},le=()=>{var ue;if(g||!((ue=T.current)!=null&&ue.matches(":focus-visible")))return;const{transform:se,width:re,height:ge,autoPanOnNodeFocus:W,setCenter:X}=A.getState();if(!W)return;rB(new Map([[e,O]]),{x:0,y:0,width:re,height:ge},se,!0).length>0||X(O.position.x+L.width/2,O.position.y+L.height/2,{zoom:se[2]})};return o.jsx("div",{className:ta(["react-flow__node",`react-flow__node-${S}`,{[p]:C},O.className,{selected:O.selected,selectable:N,parent:k,draggable:C,dragging:P}]),ref:T,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:U?"all":"none",visibility:F?"visible":"hidden",...O.style,...M},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:I,onMouseMove:H,onMouseLeave:K,onContextMenu:Q,onClick:B,onDoubleClick:q,onKeyDown:j?ee:void 0,tabIndex:j?0:void 0,onFocus:j?le:void 0,role:O.ariaRole??(j?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${swe}-${b}`,"aria-label":O.ariaLabel,...O.domAttributes,children:o.jsx(ntt,{value:e,children:o.jsx(E,{id:e,data:O.data,type:S,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:O.selected??!1,selectable:N,draggable:C,deletable:O.deletable??!0,isConnectable:_,sourcePosition:O.sourcePosition,targetPosition:O.targetPosition,dragging:P,dragHandle:O.dragHandle,zIndex:w.z,parentId:O.parentId,...L})})})}var wtt=m.memo(xtt);const Ott=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function bwe(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,onError:s}=_i(Ott,rs),a=gtt(e.onlyRenderVisibleElements),l=ytt();return o.jsx("div",{className:"react-flow__nodes",style:FR,children:a.map(c=>o.jsx(wtt,{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:i,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:s},c))})}bwe.displayName="NodeRenderer";const Stt=m.memo(bwe);function ktt(e){return _i(m.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const i=[];if(n.width&&n.height)for(const r of n.edges){const s=n.nodeLookup.get(r.source),a=n.nodeLookup.get(r.target);s&&a&&mJe({sourceNode:s,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&i.push(r.id)}return i},[e]),rs)}const Ett=({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"})},Ctt=({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"})},uK={[RS.Arrow]:Ett,[RS.ArrowClosed]:Ctt};function Ttt(e){const t=ss();return m.useMemo(()=>{var r,s;return Object.prototype.hasOwnProperty.call(uK,e)?uK[e]:((s=(r=t.getState()).onError)==null||s.call(r,"009",Fu.error009(e)),null)},[e])}const Att=({id:e,type:t,color:n,width:i=12.5,height:r=12.5,markerUnits:s="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{const c=Ttt(t);return c?o.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:l,refX:"0",refY:"0",children:o.jsx(c,{color:n,strokeWidth:a})}):null},ywe=({defaultColor:e,rfId:t})=>{const n=_i(s=>s.edges),i=_i(s=>s.defaultEdgeOptions),r=m.useMemo(()=>SJe(n,{id:t,defaultColor:e,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[n,i,t,e]);return r.length?o.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:o.jsx("defs",{children:r.map(s=>o.jsx(Att,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};ywe.displayName="MarkerDefinitions";var _tt=m.memo(ywe);function vwe({x:e,y:t,label:n,labelStyle:i,labelShowBg:r=!0,labelBgStyle:s,labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){const[f,h]=m.useState({x:1,y:0,width:0,height:0}),p=ta(["react-flow__edge-textwrapper",u]),g=m.useRef(null);return m.useEffect(()=>{if(g.current){const b=g.current.getBBox();h({x:b.x,y:b.y,width:b.width,height:b.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:[r&&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:s,rx:l,ry:l}),o.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:g,style:i,children:n}),c]}):null}vwe.displayName="EdgeText";const Ntt=m.memo(vwe);function sE({path:e,labelX:t,labelY:n,label:i,labelStyle:r,labelShowBg:s,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:ta(["react-flow__edge-path",d.className])}),u?o.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,i&&Au(t)&&Au(n)?o.jsx(Ntt,{x:t,y:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function dK({pos:e,x1:t,y1:n,x2:i,y2:r}){return e===rn.Left||e===rn.Right?[.5*(t+i),n]:[t,.5*(n+r)]}function xwe({sourceX:e,sourceY:t,sourcePosition:n=rn.Bottom,targetX:i,targetY:r,targetPosition:s=rn.Top}){const[a,l]=dK({pos:n,x1:e,y1:t,x2:i,y2:r}),[c,u]=dK({pos:s,x1:i,y1:r,x2:e,y2:t}),[d,f,h,p]=B1e({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${l} ${c},${u} ${i},${r}`,d,f,h,p]}function wwe(e){return m.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:a,targetPosition:l,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:b,markerStart:v,interactionWidth:y})=>{const[x,O,w]=xwe({sourceX:n,sourceY:i,sourcePosition:a,targetX:r,targetY:s,targetPosition:l}),k=e.isInternal?void 0:t;return o.jsx(sE,{id:k,path:x,labelX:O,labelY:w,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:b,markerStart:v,interactionWidth:y})})}const jtt=wwe({isInternal:!1}),Owe=wwe({isInternal:!0});jtt.displayName="SimpleBezierEdge";Owe.displayName="SimpleBezierEdgeInternal";function Swe(e){return m.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:p=rn.Bottom,targetPosition:g=rn.Top,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:x})=>{const[O,w,k]=J_({sourceX:n,sourceY:i,sourcePosition:p,targetX:r,targetY:s,targetPosition:g,borderRadius:y==null?void 0:y.borderRadius,offset:y==null?void 0:y.offset,stepPosition:y==null?void 0:y.stepPosition}),S=e.isInternal?void 0:t;return o.jsx(sE,{id:S,path:O,labelX:w,labelY:k,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:b,markerStart:v,interactionWidth:x})})}const kwe=Swe({isInternal:!1}),Ewe=Swe({isInternal:!0});kwe.displayName="SmoothStepEdge";Ewe.displayName="SmoothStepEdgeInternal";function Cwe(e){return m.memo(({id:t,...n})=>{var r;const i=e.isInternal?void 0:t;return o.jsx(kwe,{...n,id:i,pathOptions:m.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const Rtt=Cwe({isInternal:!1}),Twe=Cwe({isInternal:!0});Rtt.displayName="StepEdge";Twe.displayName="StepEdgeInternal";function Awe(e){return m.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:g,interactionWidth:b})=>{const[v,y,x]=z1e({sourceX:n,sourceY:i,targetX:r,targetY:s}),O=e.isInternal?void 0:t;return o.jsx(sE,{id:O,path:v,labelX:y,labelY:x,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:g,interactionWidth:b})})}const Itt=Awe({isInternal:!1}),_we=Awe({isInternal:!0});Itt.displayName="StraightEdge";_we.displayName="StraightEdgeInternal";function Nwe(e){return m.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:a=rn.Bottom,targetPosition:l=rn.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:x})=>{const[O,w,k]=U1e({sourceX:n,sourceY:i,sourcePosition:a,targetX:r,targetY:s,targetPosition:l,curvature:y==null?void 0:y.curvature}),S=e.isInternal?void 0:t;return o.jsx(sE,{id:S,path:O,labelX:w,labelY:k,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:b,markerStart:v,interactionWidth:x})})}const Ptt=Nwe({isInternal:!1}),jwe=Nwe({isInternal:!0});Ptt.displayName="BezierEdge";jwe.displayName="BezierEdgeInternal";const fK={default:jwe,straight:_we,step:Twe,smoothstep:Ewe,simplebezier:Owe},hK={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Dtt=(e,t,n)=>n===rn.Left?e-t:n===rn.Right?e+t:e,Mtt=(e,t,n)=>n===rn.Top?e-t:n===rn.Bottom?e+t:e,pK="react-flow__edgeupdater";function mK({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:r,onMouseEnter:s,onMouseOut:a,type:l}){return o.jsx("circle",{onMouseDown:r,onMouseEnter:s,onMouseOut:a,className:ta([pK,`${pK}-${l}`]),cx:Dtt(t,i,e),cy:Mtt(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function Ltt({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:r,targetX:s,targetY:a,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:p}){const g=ss(),b=(w,k)=>{if(w.button!==0)return;const{autoPanOnConnect:S,domNode:E,connectionMode:C,connectionRadius:N,lib:_,onConnectStart:j,cancelConnection:A,nodeLookup:F,rfId:T,panBy:P,updateConnection:R}=g.getState(),L=k.type==="target",M=(H,K)=>{h(!1),f==null||f(H,n,k.type,K)},U=H=>u==null?void 0:u(n,H),I=(H,K)=>{h(!0),d==null||d(w,n,k.type),j==null||j(H,K)};u6.onPointerDown(w.nativeEvent,{autoPanOnConnect:S,connectionMode:C,connectionRadius:N,domNode:E,handleId:k.id,nodeId:k.nodeId,nodeLookup:F,isTarget:L,edgeUpdaterType:k.type,lib:_,flowId:T,cancelConnection:A,panBy:P,isValidConnection:(...H)=>{var K,Q;return((Q=(K=g.getState()).isValidConnection)==null?void 0:Q.call(K,...H))??!0},onConnect:U,onConnectStart:I,onConnectEnd:(...H)=>{var K,Q;return(Q=(K=g.getState()).onConnectEnd)==null?void 0:Q.call(K,...H)},onReconnectEnd:M,updateConnection:R,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:w.currentTarget})},v=w=>b(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),y=w=>b(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),x=()=>p(!0),O=()=>p(!1);return o.jsxs(o.Fragment,{children:[(e===!0||e==="source")&&o.jsx(mK,{position:l,centerX:i,centerY:r,radius:t,onMouseDown:v,onMouseEnter:x,onMouseOut:O,type:"source"}),(e===!0||e==="target")&&o.jsx(mK,{position:c,centerX:s,centerY:a,radius:t,onMouseDown:y,onMouseEnter:x,onMouseOut:O,type:"target"})]})}function $tt({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:r,onDoubleClick:s,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,rfId:g,edgeTypes:b,noPanClassName:v,onError:y,disableKeyboardA11y:x}){let O=_i(X=>X.edgeLookup.get(e));const w=_i(X=>X.defaultEdgeOptions);O=w?{...w,...O}:O;let k=O.type||"default",S=(b==null?void 0:b[k])||fK[k];S===void 0&&(y==null||y("011",Fu.error011(k)),k="default",S=(b==null?void 0:b.default)||fK.default);const E=!!(O.focusable||t&&typeof O.focusable>"u"),C=typeof f<"u"&&(O.reconnectable||n&&typeof O.reconnectable>"u"),N=!!(O.selectable||i&&typeof O.selectable>"u"),_=m.useRef(null),[j,A]=m.useState(!1),[F,T]=m.useState(!1),P=ss(),{zIndex:R,sourceX:L,sourceY:M,targetX:U,targetY:I,sourcePosition:H,targetPosition:K}=_i(m.useCallback(X=>{const ae=X.nodeLookup.get(O.source),ue=X.nodeLookup.get(O.target);if(!ae||!ue)return{zIndex:O.zIndex,...hK};const Oe=OJe({id:e,sourceNode:ae,targetNode:ue,sourceHandle:O.sourceHandle||null,targetHandle:O.targetHandle||null,connectionMode:X.connectionMode,onError:y});return{zIndex:pJe({selected:O.selected,zIndex:O.zIndex,sourceNode:ae,targetNode:ue,elevateOnSelect:X.elevateEdgesOnSelect,zIndexMode:X.zIndexMode}),...Oe||hK}},[O.source,O.target,O.sourceHandle,O.targetHandle,O.selected,O.zIndex]),rs),Q=m.useMemo(()=>O.markerStart?`url('#${l6(O.markerStart,g)}')`:void 0,[O.markerStart,g]),q=m.useMemo(()=>O.markerEnd?`url('#${l6(O.markerEnd,g)}')`:void 0,[O.markerEnd,g]);if(O.hidden||L===null||M===null||U===null||I===null)return null;const B=X=>{var Se;const{addSelectedEdges:ae,unselectNodesAndEdges:ue,multiSelectionActive:Oe}=P.getState();N&&(P.setState({nodesSelectionActive:!1}),O.selected&&Oe?(ue({nodes:[],edges:[O]}),(Se=_.current)==null||Se.blur()):ae([e])),r&&r(X,O)},ee=s?X=>{s(X,{...O})}:void 0,le=a?X=>{a(X,{...O})}:void 0,se=l?X=>{l(X,{...O})}:void 0,re=c?X=>{c(X,{...O})}:void 0,ge=u?X=>{u(X,{...O})}:void 0,W=X=>{var ae;if(!x&&T1e.includes(X.key)&&N){const{unselectNodesAndEdges:ue,addSelectedEdges:Oe}=P.getState();X.key==="Escape"?((ae=_.current)==null||ae.blur(),ue({edges:[O]})):Oe([e])}};return o.jsx("svg",{style:{zIndex:R},children:o.jsxs("g",{className:ta(["react-flow__edge",`react-flow__edge-${k}`,O.className,v,{selected:O.selected,animated:O.animated,inactive:!N&&!r,updating:j,selectable:N}]),onClick:B,onDoubleClick:ee,onContextMenu:le,onMouseEnter:se,onMouseMove:re,onMouseLeave:ge,onKeyDown:E?W:void 0,tabIndex:E?0:void 0,role:O.ariaRole??(E?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":O.ariaLabel===null?void 0:O.ariaLabel||`Edge from ${O.source} to ${O.target}`,"aria-describedby":E?`${awe}-${g}`:void 0,ref:_,...O.domAttributes,children:[!F&&o.jsx(S,{id:e,source:O.source,target:O.target,type:O.type,selected:O.selected,animated:O.animated,selectable:N,deletable:O.deletable??!0,label:O.label,labelStyle:O.labelStyle,labelShowBg:O.labelShowBg,labelBgStyle:O.labelBgStyle,labelBgPadding:O.labelBgPadding,labelBgBorderRadius:O.labelBgBorderRadius,sourceX:L,sourceY:M,targetX:U,targetY:I,sourcePosition:H,targetPosition:K,data:O.data,style:O.style,sourceHandleId:O.sourceHandle,targetHandleId:O.targetHandle,markerStart:Q,markerEnd:q,pathOptions:"pathOptions"in O?O.pathOptions:void 0,interactionWidth:O.interactionWidth}),C&&o.jsx(Ltt,{edge:O,isReconnectable:C,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,sourceX:L,sourceY:M,targetX:U,targetY:I,sourcePosition:H,targetPosition:K,setUpdateHover:A,setReconnecting:T})]})})}var Ftt=m.memo($tt);const Btt=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Rwe({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:r,onReconnect:s,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:p,onReconnectEnd:g,disableKeyboardA11y:b}){const{edgesFocusable:v,edgesReconnectable:y,elementsSelectable:x,onError:O}=_i(Btt,rs),w=ktt(t);return o.jsxs("div",{className:"react-flow__edges",children:[o.jsx(_tt,{defaultColor:e,rfId:n}),w.map(k=>o.jsx(Ftt,{id:k,edgesFocusable:v,edgesReconnectable:y,elementsSelectable:x,noPanClassName:r,onReconnect:s,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:p,onReconnectEnd:g,rfId:n,onError:O,edgeTypes:i,disableKeyboardA11y:b},k))]})}Rwe.displayName="EdgeRenderer";const Utt=m.memo(Rwe),Qtt=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function ztt({children:e}){const t=_i(Qtt);return o.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Vtt(e){const t=$R(),n=m.useRef(!1);m.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Htt=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function qtt(e){const t=_i(Htt),n=ss();return m.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Wtt(e){return e.connection.inProgress?{...e.connection,to:$x(e.connection.to,e.transform)}:{...e.connection}}function Gtt(e){return Wtt}function Ktt(e){const t=Gtt();return _i(t,rs)}const Xtt=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Ytt({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:r,width:s,height:a,isValid:l,inProgress:c}=_i(Xtt,rs);return!(s&&r&&c)?null:o.jsx("svg",{style:e,width:s,height:a,className:"react-flow__connectionline react-flow__container",children:o.jsx("g",{className:ta(["react-flow__connection",N1e(l)]),children:o.jsx(Iwe,{style:t,type:n,CustomComponent:i,isValid:l})})})}const Iwe=({style:e,type:t=Np.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:r,from:s,fromNode:a,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h,pointer:p}=Ktt();if(!r)return;if(n)return o.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:l,fromX:s.x,fromY:s.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:N1e(i),toNode:d,toHandle:f,pointer:p});let g="";const b={sourceX:s.x,sourceY:s.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case Np.Bezier:[g]=U1e(b);break;case Np.SimpleBezier:[g]=xwe(b);break;case Np.Step:[g]=J_({...b,borderRadius:0});break;case Np.SmoothStep:[g]=J_(b);break;default:[g]=z1e(b)}return o.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};Iwe.displayName="ConnectionLine";const Ztt={};function gK(e=Ztt){m.useRef(e),ss(),m.useEffect(()=>{},[e])}function Jtt(){ss(),m.useRef(!1),m.useEffect(()=>{},[])}function Pwe({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:r,onNodeDoubleClick:s,onEdgeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:p,connectionLineType:g,connectionLineStyle:b,connectionLineComponent:v,connectionLineContainerStyle:y,selectionKeyCode:x,selectionOnDrag:O,selectionMode:w,multiSelectionKeyCode:k,panActivationKeyCode:S,zoomActivationKeyCode:E,deleteKeyCode:C,onlyRenderVisibleElements:N,elementsSelectable:_,defaultViewport:j,translateExtent:A,minZoom:F,maxZoom:T,preventScrolling:P,defaultMarkerColor:R,zoomOnScroll:L,zoomOnPinch:M,panOnScroll:U,panOnScrollSpeed:I,panOnScrollMode:H,zoomOnDoubleClick:K,panOnDrag:Q,autoPanOnSelection:q,onPaneClick:B,onPaneMouseEnter:ee,onPaneMouseMove:le,onPaneMouseLeave:se,onPaneScroll:re,onPaneContextMenu:ge,paneClickDistance:W,nodeClickDistance:X,onEdgeContextMenu:ae,onEdgeMouseEnter:ue,onEdgeMouseMove:Oe,onEdgeMouseLeave:Se,reconnectRadius:lt,onReconnect:$e,onReconnectStart:Le,onReconnectEnd:Ne,noDragClassName:qe,noWheelClassName:Re,noPanClassName:ze,disableKeyboardA11y:Ee,nodeExtent:De,rfId:J,viewport:he,onViewportChange:Ce}){return gK(e),gK(t),Jtt(),Vtt(n),qtt(he),o.jsx(ptt,{onPaneClick:B,onPaneMouseEnter:ee,onPaneMouseMove:le,onPaneMouseLeave:se,onPaneContextMenu:ge,onPaneScroll:re,paneClickDistance:W,deleteKeyCode:C,selectionKeyCode:x,selectionOnDrag:O,selectionMode:w,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:k,panActivationKeyCode:S,zoomActivationKeyCode:E,elementsSelectable:_,zoomOnScroll:L,zoomOnPinch:M,zoomOnDoubleClick:K,panOnScroll:U,panOnScrollSpeed:I,panOnScrollMode:H,panOnDrag:Q,autoPanOnSelection:q,defaultViewport:j,translateExtent:A,minZoom:F,maxZoom:T,onSelectionContextMenu:f,preventScrolling:P,noDragClassName:qe,noWheelClassName:Re,noPanClassName:ze,disableKeyboardA11y:Ee,onViewportChange:Ce,isControlledViewport:!!he,children:o.jsxs(ztt,{children:[o.jsx(Utt,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:a,onReconnect:$e,onReconnectStart:Le,onReconnectEnd:Ne,onlyRenderVisibleElements:N,onEdgeContextMenu:ae,onEdgeMouseEnter:ue,onEdgeMouseMove:Oe,onEdgeMouseLeave:Se,reconnectRadius:lt,defaultMarkerColor:R,noPanClassName:ze,disableKeyboardA11y:Ee,rfId:J}),o.jsx(Ytt,{style:b,type:g,component:v,containerStyle:y}),o.jsx("div",{className:"react-flow__edgelabel-renderer"}),o.jsx(Stt,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:X,onlyRenderVisibleElements:N,noPanClassName:ze,noDragClassName:qe,disableKeyboardA11y:Ee,nodeExtent:De,rfId:J}),o.jsx("div",{className:"react-flow__viewport-portal"})]})})}Pwe.displayName="GraphView";const ent=m.memo(Pwe),tnt=D1e(),bK=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:a,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const p=new Map,g=new Map,b=new Map,v=new Map,y=i??t??[],x=n??e??[],O=d??[0,0],w=f??NS;q1e(b,v,y);const{nodesInitialized:k}=c6(x,p,g,{nodeOrigin:O,nodeExtent:w,zIndexMode:h});let S=[0,0,1];if(a&&r&&s){const E=iE(p,{filter:j=>!!((j.width||j.initialWidth)&&(j.height||j.initialHeight))}),{x:C,y:N,zoom:_}=aB(E,r,s,c,u,(l==null?void 0:l.padding)??.1);S=[C,N,_]}return{rfId:"1",width:r??0,height:s??0,transform:S,nodes:x,nodesInitialized:k,nodeLookup:p,parentLookup:g,edges:y,edgeLookup:v,connectionLookup:b,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:NS,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Vv.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:O,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:{..._1e},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:tnt,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:A1e,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},nnt=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>get((p,g)=>{async function b(){const{nodeLookup:v,panZoom:y,fitViewOptions:x,fitViewResolver:O,width:w,height:k,minZoom:S,maxZoom:E}=g();y&&(await oJe({nodes:v,width:w,height:k,panZoom:y,minZoom:S,maxZoom:E},x),O==null||O.resolve(!0),p({fitViewResolver:null}))}return{...bK({nodes:e,edges:t,width:r,height:s,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:i,zIndexMode:h}),setNodes:v=>{const{nodeLookup:y,parentLookup:x,nodeOrigin:O,elevateNodesOnSelect:w,fitViewQueued:k,zIndexMode:S,nodesSelectionActive:E}=g(),{nodesInitialized:C,hasSelectedNodes:N}=c6(v,y,x,{nodeOrigin:O,nodeExtent:f,elevateNodesOnSelect:w,checkEquality:!0,zIndexMode:S}),_=E&&N;k&&C?(b(),p({nodes:v,nodesInitialized:C,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:_})):p({nodes:v,nodesInitialized:C,nodesSelectionActive:_})},setEdges:v=>{const{connectionLookup:y,edgeLookup:x}=g();q1e(y,x,v),p({edges:v})},setDefaultNodesAndEdges:(v,y)=>{if(v){const{setNodes:x}=g();x(v),p({hasDefaultNodes:!0})}if(y){const{setEdges:x}=g();x(y),p({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:y,nodeLookup:x,parentLookup:O,domNode:w,nodeOrigin:k,nodeExtent:S,debug:E,fitViewQueued:C,zIndexMode:N}=g(),{changes:_,updatedInternals:j}=NJe(v,x,O,w,k,S,N);j&&(CJe(x,O,{nodeOrigin:k,nodeExtent:S,zIndexMode:N}),C?(b(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(_==null?void 0:_.length)>0&&(E&&console.log("React Flow: trigger node changes",_),y==null||y(_)))},updateNodePositions:(v,y=!1)=>{const x=[];let O=[];const{nodeLookup:w,triggerNodeChanges:k,connection:S,updateConnection:E,onNodesChangeMiddlewareMap:C}=g();for(const[N,_]of v){const j=w.get(N),A=!!(j!=null&&j.expandParent&&(j!=null&&j.parentId)&&(_!=null&&_.position)),F={id:N,type:"position",position:A?{x:Math.max(0,_.position.x),y:Math.max(0,_.position.y)}:_.position,dragging:y};if(j&&S.inProgress&&S.fromNode.id===j.id){const T=kb(j,S.fromHandle,rn.Left,!0);E({...S,from:T})}A&&j.parentId&&x.push({id:N,parentId:j.parentId,rect:{..._.internals.positionAbsolute,width:_.measured.width??0,height:_.measured.height??0}}),O.push(F)}if(x.length>0){const{parentLookup:N,nodeOrigin:_}=g(),j=hB(x,w,N,_);O.push(...j)}for(const N of C.values())O=N(O);k(O)},triggerNodeChanges:v=>{const{onNodesChange:y,setNodes:x,nodes:O,hasDefaultNodes:w,debug:k}=g();if(v!=null&&v.length){if(w){const S=cwe(v,O);x(S)}k&&console.log("React Flow: trigger node changes",v),y==null||y(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:y,setEdges:x,edges:O,hasDefaultEdges:w,debug:k}=g();if(v!=null&&v.length){if(w){const S=uwe(v,O);x(S)}k&&console.log("React Flow: trigger edge changes",v),y==null||y(v)}},addSelectedNodes:v=>{const{multiSelectionActive:y,edgeLookup:x,nodeLookup:O,triggerNodeChanges:w,triggerEdgeChanges:k}=g();if(y){const S=v.map(E=>Og(E,!0));w(S);return}w(_y(O,new Set([...v]),!0)),k(_y(x))},addSelectedEdges:v=>{const{multiSelectionActive:y,edgeLookup:x,nodeLookup:O,triggerNodeChanges:w,triggerEdgeChanges:k}=g();if(y){const S=v.map(E=>Og(E,!0));k(S);return}k(_y(x,new Set([...v]))),w(_y(O,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:y}={})=>{const{edges:x,nodes:O,nodeLookup:w,triggerNodeChanges:k,triggerEdgeChanges:S}=g(),E=v||O,C=y||x,N=[];for(const j of E){if(!j.selected)continue;const A=w.get(j.id);A&&(A.selected=!1),N.push(Og(j.id,!1))}const _=[];for(const j of C)j.selected&&_.push(Og(j.id,!1));k(N),S(_)},setMinZoom:v=>{const{panZoom:y,maxZoom:x}=g();y==null||y.setScaleExtent([v,x]),p({minZoom:v})},setMaxZoom:v=>{const{panZoom:y,minZoom:x}=g();y==null||y.setScaleExtent([x,v]),p({maxZoom:v})},setTranslateExtent:v=>{var y;(y=g().panZoom)==null||y.setTranslateExtent(v),p({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:y,triggerNodeChanges:x,triggerEdgeChanges:O,elementsSelectable:w}=g();if(!w)return;const k=y.reduce((E,C)=>C.selected?[...E,Og(C.id,!1)]:E,[]),S=v.reduce((E,C)=>C.selected?[...E,Og(C.id,!1)]:E,[]);x(k),O(S)},setNodeExtent:v=>{const{nodes:y,nodeLookup:x,parentLookup:O,nodeOrigin:w,elevateNodesOnSelect:k,nodeExtent:S,zIndexMode:E}=g();v[0][0]===S[0][0]&&v[0][1]===S[0][1]&&v[1][0]===S[1][0]&&v[1][1]===S[1][1]||(c6(y,x,O,{nodeOrigin:w,nodeExtent:v,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:E}),p({nodeExtent:v}))},panBy:v=>{const{transform:y,width:x,height:O,panZoom:w,translateExtent:k}=g();return jJe({delta:v,panZoom:w,transform:y,translateExtent:k,width:x,height:O})},setCenter:async(v,y,x)=>{const{width:O,height:w,maxZoom:k,panZoom:S}=g();if(!S)return!1;const E=typeof(x==null?void 0:x.zoom)<"u"?x.zoom:k;return await S.setViewport({x:O/2-v*E,y:w/2-y*E,zoom:E},{duration:x==null?void 0:x.duration,ease:x==null?void 0:x.ease,interpolate:x==null?void 0:x.interpolate}),!0},cancelConnection:()=>{p({connection:{..._1e}})},updateConnection:v=>{p({connection:v})},reset:()=>p({...bK()})}},Object.is);function Dwe({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:r,initialHeight:s,initialMinZoom:a,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:p}){const[g]=m.useState(()=>nnt({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:u,minZoom:a,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return o.jsx(bet,{value:g,children:o.jsx(zet,{children:p})})}function int({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:r,width:s,height:a,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p}){return m.useContext(MR)?o.jsx(o.Fragment,{children:e}):o.jsx(Dwe,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:r,initialWidth:s,initialHeight:a,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p,children:e})}const rnt={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function snt({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:r,nodeTypes:s,edgeTypes:a,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:p,onConnectStart:g,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,onNodeMouseEnter:x,onNodeMouseMove:O,onNodeMouseLeave:w,onNodeContextMenu:k,onNodeDoubleClick:S,onNodeDragStart:E,onNodeDrag:C,onNodeDragStop:N,onNodesDelete:_,onEdgesDelete:j,onDelete:A,onSelectionChange:F,onSelectionDragStart:T,onSelectionDrag:P,onSelectionDragStop:R,onSelectionContextMenu:L,onSelectionStart:M,onSelectionEnd:U,onBeforeDelete:I,connectionMode:H,connectionLineType:K=Np.Bezier,connectionLineStyle:Q,connectionLineComponent:q,connectionLineContainerStyle:B,deleteKeyCode:ee="Backspace",selectionKeyCode:le="Shift",selectionOnDrag:se=!1,selectionMode:re=jS.Full,panActivationKeyCode:ge="Space",multiSelectionKeyCode:W=PS()?"Meta":"Control",zoomActivationKeyCode:X=PS()?"Meta":"Control",snapToGrid:ae,snapGrid:ue,onlyRenderVisibleElements:Oe=!1,selectNodesOnDrag:Se,nodesDraggable:lt,autoPanOnNodeFocus:$e,nodesConnectable:Le,nodesFocusable:Ne,nodeOrigin:qe=owe,edgesFocusable:Re,edgesReconnectable:ze,elementsSelectable:Ee=!0,defaultViewport:De=jet,minZoom:J=.5,maxZoom:he=2,translateExtent:Ce=NS,preventScrolling:Ze=!0,nodeExtent:at,defaultMarkerColor:St="#b1b1b7",zoomOnScroll:Te=!0,zoomOnPinch:ye=!0,panOnScroll:Ve=!1,panOnScrollSpeed:nt=.5,panOnScrollMode:ke=rb.Free,zoomOnDoubleClick:Ht=!0,panOnDrag:on=!0,onPaneClick:Yt,onPaneMouseEnter:xt,onPaneMouseMove:Pt,onPaneMouseLeave:ct,onPaneScroll:gt,onPaneContextMenu:Pe,paneClickDistance:kt=1,nodeClickDistance:Me=0,children:Ye,onReconnect:et,onReconnectStart:xe,onReconnectEnd:He,onEdgeContextMenu:Ke,onEdgeDoubleClick:yt,onEdgeMouseEnter:Dt,onEdgeMouseMove:ln,onEdgeMouseLeave:Xt,reconnectRadius:dn=10,onNodesChange:Z,onEdgesChange:Ft,noDragClassName:Ue="nodrag",noWheelClassName:it="nowheel",noPanClassName:ht="nopan",fitView:pe,fitViewOptions:We,connectOnClick:vt,attributionPosition:vn,proOptions:Ki,defaultEdgeOptions:Fe,elevateNodesOnSelect:Rt=!0,elevateEdgesOnSelect:pn=!1,disableKeyboardA11y:Zt=!1,autoPanOnConnect:Jt,autoPanOnNodeDrag:Un,autoPanOnSelection:xn=!0,autoPanSpeed:oi,connectionRadius:Oi,isValidConnection:mi,onError:bn,style:qi,id:ri,nodeDragThreshold:zi,connectionDragThreshold:as,viewport:Lr,onViewportChange:_r,width:xs,height:os,colorMode:ia="light",debug:Nr,onScroll:As,ariaLabelConfig:Vs,zIndexMode:Yr="basic",...ra},sa){const ls=ri||"1",va=Det(ia),aa=m.useCallback(ws=>{ws.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),As==null||As(ws)},[As]);return o.jsx("div",{"data-testid":"rf__wrapper",...ra,onScroll:aa,style:{...qi,...rnt},ref:sa,className:ta(["react-flow",r,va]),id:ri,role:"application",children:o.jsxs(int,{nodes:e,edges:t,width:xs,height:os,fitView:pe,fitViewOptions:We,minZoom:J,maxZoom:he,nodeOrigin:qe,nodeExtent:at,zIndexMode:Yr,children:[o.jsx(Pet,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:p,onConnectStart:g,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,nodesDraggable:lt,autoPanOnNodeFocus:$e,nodesConnectable:Le,nodesFocusable:Ne,edgesFocusable:Re,edgesReconnectable:ze,elementsSelectable:Ee,elevateNodesOnSelect:Rt,elevateEdgesOnSelect:pn,minZoom:J,maxZoom:he,nodeExtent:at,onNodesChange:Z,onEdgesChange:Ft,snapToGrid:ae,snapGrid:ue,connectionMode:H,translateExtent:Ce,connectOnClick:vt,defaultEdgeOptions:Fe,fitView:pe,fitViewOptions:We,onNodesDelete:_,onEdgesDelete:j,onDelete:A,onNodeDragStart:E,onNodeDrag:C,onNodeDragStop:N,onSelectionDrag:P,onSelectionDragStart:T,onSelectionDragStop:R,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:ht,nodeOrigin:qe,rfId:ls,autoPanOnConnect:Jt,autoPanOnNodeDrag:Un,autoPanSpeed:oi,onError:bn,connectionRadius:Oi,isValidConnection:mi,selectNodesOnDrag:Se,nodeDragThreshold:zi,connectionDragThreshold:as,onBeforeDelete:I,debug:Nr,ariaLabelConfig:Vs,zIndexMode:Yr}),o.jsx(ent,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:x,onNodeMouseMove:O,onNodeMouseLeave:w,onNodeContextMenu:k,onNodeDoubleClick:S,nodeTypes:s,edgeTypes:a,connectionLineType:K,connectionLineStyle:Q,connectionLineComponent:q,connectionLineContainerStyle:B,selectionKeyCode:le,selectionOnDrag:se,selectionMode:re,deleteKeyCode:ee,multiSelectionKeyCode:W,panActivationKeyCode:ge,zoomActivationKeyCode:X,onlyRenderVisibleElements:Oe,defaultViewport:De,translateExtent:Ce,minZoom:J,maxZoom:he,preventScrolling:Ze,zoomOnScroll:Te,zoomOnPinch:ye,zoomOnDoubleClick:Ht,panOnScroll:Ve,panOnScrollSpeed:nt,panOnScrollMode:ke,panOnDrag:on,autoPanOnSelection:xn,onPaneClick:Yt,onPaneMouseEnter:xt,onPaneMouseMove:Pt,onPaneMouseLeave:ct,onPaneScroll:gt,onPaneContextMenu:Pe,paneClickDistance:kt,nodeClickDistance:Me,onSelectionContextMenu:L,onSelectionStart:M,onSelectionEnd:U,onReconnect:et,onReconnectStart:xe,onReconnectEnd:He,onEdgeContextMenu:Ke,onEdgeDoubleClick:yt,onEdgeMouseEnter:Dt,onEdgeMouseMove:ln,onEdgeMouseLeave:Xt,reconnectRadius:dn,defaultMarkerColor:St,noDragClassName:Ue,noWheelClassName:it,noPanClassName:ht,rfId:ls,disableKeyboardA11y:Zt,nodeExtent:at,viewport:Lr,onViewportChange:_r}),o.jsx(Net,{onSelectionChange:F}),Ye,o.jsx(Eet,{proOptions:Ki,position:vn}),o.jsx(ket,{rfId:ls,disableKeyboardA11y:Zt})]})})}var ant=dwe(snt);const ont=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function lnt({children:e}){const t=_i(ont);return t?Li.createPortal(e,t):null}function cnt(e){const[t,n]=m.useState(e),i=m.useCallback(r=>n(s=>cwe(r,s)),[]);return[t,n,i]}function unt(e){const[t,n]=m.useState(e),i=m.useCallback(r=>n(s=>uwe(r,s)),[]);return[t,n,i]}const dnt=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||!oB(n.userNode))return!1;return!0};function fnt(e={includeHiddenNodes:!1}){return _i(dnt(e))}function hnt({dimensions:e,lineWidth:t,variant:n,className:i}){return o.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ta(["react-flow__background-pattern",n,i])})}function pnt({radius:e,className:t}){return o.jsx("circle",{cx:e,cy:e,r:e,className:ta(["react-flow__background-pattern","dots",t])})}var tm;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(tm||(tm={}));const mnt={[tm.Dots]:1,[tm.Lines]:1,[tm.Cross]:6},gnt=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Mwe({id:e,variant:t=tm.Dots,gap:n=20,size:i,lineWidth:r=1,offset:s=0,color:a,bgColor:l,style:c,className:u,patternClassName:d}){const f=m.useRef(null),{transform:h,patternId:p}=_i(gnt,rs),g=i||mnt[t],b=t===tm.Dots,v=t===tm.Cross,y=Array.isArray(n)?n:[n,n],x=[y[0]*h[2]||1,y[1]*h[2]||1],O=g*h[2],w=Array.isArray(s)?s:[s,s],k=v?[O,O]:x,S=[w[0]*h[2]||1+k[0]/2,w[1]*h[2]||1+k[1]/2],E=`${p}${e||""}`;return o.jsxs("svg",{className:ta(["react-flow__background",u]),style:{...c,...FR,"--xy-background-color-props":l,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[o.jsx("pattern",{id:E,x:h[0]%x[0],y:h[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:b?o.jsx(pnt,{radius:O/2,className:d}):o.jsx(hnt,{dimensions:k,lineWidth:r,variant:t,className:d})}),o.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${E})`})]})}Mwe.displayName="Background";const bnt=m.memo(Mwe);function ynt(){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 vnt(){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 xnt(){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 wnt(){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 Ont(){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 vT({children:e,className:t,...n}){return o.jsx("button",{type:"button",className:ta(["react-flow__controls-button",t]),...n,children:e})}const Snt=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Lwe({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:r,onZoomIn:s,onZoomOut:a,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":p}){const g=ss(),{isInteractive:b,minZoomReached:v,maxZoomReached:y,ariaLabelConfig:x}=_i(Snt,rs),{zoomIn:O,zoomOut:w,fitView:k}=$R(),S=()=>{O(),s==null||s()},E=()=>{w(),a==null||a()},C=()=>{k(r),l==null||l()},N=()=>{g.setState({nodesDraggable:!b,nodesConnectable:!b,elementsSelectable:!b}),c==null||c(!b)},_=h==="horizontal"?"horizontal":"vertical";return o.jsxs(LR,{className:ta(["react-flow__controls",_,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":p??x["controls.ariaLabel"],children:[t&&o.jsxs(o.Fragment,{children:[o.jsx(vT,{onClick:S,className:"react-flow__controls-zoomin",title:x["controls.zoomIn.ariaLabel"],"aria-label":x["controls.zoomIn.ariaLabel"],disabled:y,children:o.jsx(ynt,{})}),o.jsx(vT,{onClick:E,className:"react-flow__controls-zoomout",title:x["controls.zoomOut.ariaLabel"],"aria-label":x["controls.zoomOut.ariaLabel"],disabled:v,children:o.jsx(vnt,{})})]}),n&&o.jsx(vT,{className:"react-flow__controls-fitview",onClick:C,title:x["controls.fitView.ariaLabel"],"aria-label":x["controls.fitView.ariaLabel"],children:o.jsx(xnt,{})}),i&&o.jsx(vT,{className:"react-flow__controls-interactive",onClick:N,title:x["controls.interactive.ariaLabel"],"aria-label":x["controls.interactive.ariaLabel"],children:b?o.jsx(Ont,{}):o.jsx(wnt,{})}),d]})}Lwe.displayName="Controls";const knt=m.memo(Lwe);function Ent({id:e,x:t,y:n,width:i,height:r,style:s,color:a,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:p}){const{background:g,backgroundColor:b}=s||{},v=a||g||b;return o.jsx("rect",{className:ta(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:i,height:r,style:{fill:v,stroke:l,strokeWidth:c},shapeRendering:f,onClick:p?y=>p(y,e):void 0})}const Cnt=m.memo(Ent),Tnt=e=>e.nodes.map(t=>t.id),aM=e=>e instanceof Function?e:()=>e;function Ant({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:r,nodeComponent:s=Cnt,onClick:a}){const l=_i(Tnt,rs),c=aM(t),u=aM(e),d=aM(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return o.jsx(o.Fragment,{children:l.map(h=>o.jsx(Nnt,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:i,nodeStrokeWidth:r,NodeComponent:s,onClick:a,shapeRendering:f},h))})}function _nt({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:r,nodeStrokeWidth:s,shapeRendering:a,NodeComponent:l,onClick:c}){const{node:u,x:d,y:f,width:h,height:p}=_i(g=>{const b=g.nodeLookup.get(e);if(!b)return{node:void 0,x:0,y:0,width:0,height:0};const v=b.internals.userNode,{x:y,y:x}=b.internals.positionAbsolute,{width:O,height:w}=Fh(v);return{node:v,x:y,y:x,width:O,height:w}},rs);return!u||u.hidden||!oB(u)?null:o.jsx(l,{x:d,y:f,width:h,height:p,style:u.style,selected:!!u.selected,className:i(u),color:t(u),borderRadius:r,strokeColor:n(u),strokeWidth:s,shapeRendering:a,onClick:c,id:u.id})}const Nnt=m.memo(_nt);var jnt=m.memo(Ant);const Rnt=200,Int=150,Pnt=e=>!e.hidden,Dnt=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?P1e(iE(e.nodeLookup,{filter:Pnt}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Mnt="react-flow__minimap-desc";function $we({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:r="",nodeBorderRadius:s=5,nodeStrokeWidth:a,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:p,onNodeClick:g,pannable:b=!1,zoomable:v=!1,ariaLabel:y,inversePan:x,zoomStep:O=1,offsetScale:w=5}){const k=ss(),S=m.useRef(null),{boundingRect:E,viewBB:C,rfId:N,panZoom:_,translateExtent:j,flowWidth:A,flowHeight:F,ariaLabelConfig:T}=_i(Dnt,rs),P=(e==null?void 0:e.width)??Rnt,R=(e==null?void 0:e.height)??Int,L=E.width/P,M=E.height/R,U=Math.max(L,M),I=U*P,H=U*R,K=w*U,Q=E.x-(I-E.width)/2-K,q=E.y-(H-E.height)/2-K,B=I+K*2,ee=H+K*2,le=`${Mnt}-${N}`,se=m.useRef(0),re=m.useRef();se.current=U,m.useEffect(()=>{if(S.current&&_)return re.current=BJe({domNode:S.current,panZoom:_,getTransform:()=>k.getState().transform,getViewScale:()=>se.current}),()=>{var ae;(ae=re.current)==null||ae.destroy()}},[_]),m.useEffect(()=>{var ae;(ae=re.current)==null||ae.update({translateExtent:j,width:A,height:F,inversePan:x,pannable:b,zoomStep:O,zoomable:v})},[b,v,x,O,j,A,F]);const ge=p?ae=>{var Se;const[ue,Oe]=((Se=re.current)==null?void 0:Se.pointer(ae))||[0,0];p(ae,{x:ue,y:Oe})}:void 0,W=g?m.useCallback((ae,ue)=>{const Oe=k.getState().nodeLookup.get(ue).internals.userNode;g(ae,Oe)},[]):void 0,X=y??T["minimap.ariaLabel"];return o.jsx(LR,{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*U:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i: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:ta(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:o.jsxs("svg",{width:P,height:R,viewBox:`${Q} ${q} ${B} ${ee}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":le,ref:S,onClick:ge,children:[X&&o.jsx("title",{id:le,children:X}),o.jsx(jnt,{onClick:W,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:r,nodeStrokeWidth:a,nodeComponent:l}),o.jsx("path",{className:"react-flow__minimap-mask",d:`M${Q-K},${q-K}h${B+K*2}v${ee+K*2}h${-B-K*2}z - M${C.x},${C.y}h${C.width}v${C.height}h${-C.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}$we.displayName="MiniMap";m.memo($we);const Lnt=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,$nt={[Gv.Line]:"right",[Gv.Handle]:"bottom-right"};function Fnt({nodeId:e,position:t,variant:n=Gv.Handle,className:i,style:r=void 0,children:s,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:g,onResizeStart:b,onResize:v,onResizeEnd:y}){const x=mwe(),O=typeof e=="string"?e:x,w=ss(),k=m.useRef(null),S=n===Gv.Handle,E=_i(m.useCallback(Lnt(S&&p),[S,p]),rs),C=m.useRef(null),N=t??$nt[n];m.useEffect(()=>{if(!(!k.current||!O))return C.current||(C.current=JJe({domNode:k.current,nodeId:O,getStoreItems:()=>{const{nodeLookup:j,transform:A,snapGrid:F,snapToGrid:T,nodeOrigin:P,domNode:R}=w.getState();return{nodeLookup:j,transform:A,snapGrid:F,snapToGrid:T,nodeOrigin:P,paneDomNode:R}},onChange:(j,A)=>{const{triggerNodeChanges:F,nodeLookup:T,parentLookup:P,nodeOrigin:R}=w.getState(),L=[],M={x:j.x,y:j.y},U=T.get(O);if(U&&U.expandParent&&U.parentId){const I=U.origin??R,H=j.width??U.measured.width??0,K=j.height??U.measured.height??0,Q={id:U.id,parentId:U.parentId,rect:{width:H,height:K,...M1e({x:j.x??U.position.x,y:j.y??U.position.y},{width:H,height:K},U.parentId,T,I)}},q=hB([Q],T,P,R);L.push(...q),M.x=j.x?Math.max(I[0]*H,j.x):void 0,M.y=j.y?Math.max(I[1]*K,j.y):void 0}if(M.x!==void 0&&M.y!==void 0){const I={id:O,type:"position",position:{...M}};L.push(I)}if(j.width!==void 0&&j.height!==void 0){const H={id:O,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:j.width,height:j.height}};L.push(H)}for(const I of A){const H={...I,type:"position"};L.push(H)}F(L)},onEnd:({width:j,height:A})=>{const F={id:O,type:"dimensions",resizing:!1,dimensions:{width:j,height:A}};w.getState().triggerNodeChanges([F])}})),C.current.update({controlPosition:N,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:b,onResize:v,onResizeEnd:y,shouldResize:g}),()=>{var j;(j=C.current)==null||j.destroy()}},[N,l,c,u,d,f,b,v,y,g]);const _=N.split("-");return o.jsx("div",{className:ta(["react-flow__resize-control","nodrag",..._,n,i]),ref:k,style:{...r,scale:E,...a&&{[S?"backgroundColor":"borderColor"]:a}},children:s})}m.memo(Fnt);var Fwe=Object.defineProperty,Bnt=(e,t,n)=>t in e?Fwe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Unt=(e,t)=>{for(var n in t)Fwe(e,n,{get:t[n],enumerable:!0})},Qnt=(e,t,n)=>Bnt(e,t+"",n),Bwe={};Unt(Bwe,{Graph:()=>au,alg:()=>mB,json:()=>Qwe,version:()=>Hnt});var znt=Object.defineProperty,Uwe=(e,t)=>{for(var n in t)znt(e,n,{get:t[n],enumerable:!0})},au=class{constructor(t){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=()=>{},t&&(this._isDirected="directed"in t?t.directed:!0,this._isMultigraph="multigraph"in t?t.multigraph:!1,this._isCompound="compound"in t?t.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return typeof t!="function"?this._defaultNodeLabelFn=()=>t:this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(t=>Object.keys(this._in[t]).length===0)}sinks(){return this.nodes().filter(t=>Object.keys(this._out[t]).length===0)}setNodes(t,n){return t.forEach(i=>{n!==void 0?this.setNode(i,n):this.setNode(i)}),this}setNode(t,n){return t in this._nodes?(arguments.length>1&&(this._nodes[t]=n),this):(this._nodes[t]=arguments.length>1?n:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return t in this._nodes}removeNode(t){if(t in this._nodes){let n=i=>this.removeEdge(this._edgeObjs[i]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],this.children(t).forEach(i=>{this.setParent(i)}),delete this._children[t]),Object.keys(this._in[t]).forEach(n),delete this._in[t],delete this._preds[t],Object.keys(this._out[t]).forEach(n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,n){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(n===void 0)n="\0";else{n+="";for(let i=n;i!==void 0;i=this.parent(i))if(i===t)throw new Error("Setting "+n+" as parent of "+t+" would create a cycle");this.setNode(n)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=n,this._children[n][t]=!0,this}parent(t){if(this._isCompound){let n=this._parent[t];if(n!=="\0")return n}}children(t="\0"){if(this._isCompound){let n=this._children[t];if(n)return Object.keys(n)}else{if(t==="\0")return this.nodes();if(this.hasNode(t))return[]}return[]}predecessors(t){let n=this._preds[t];if(n)return Object.keys(n)}successors(t){let n=this._sucs[t];if(n)return Object.keys(n)}neighbors(t){let n=this.predecessors(t);if(n){let i=new Set(n);for(let r of this.successors(t))i.add(r);return Array.from(i.values())}}isLeaf(t){let n;return this.isDirected()?n=this.successors(t):n=this.neighbors(t),n.length===0}filterNodes(t){let n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph()),Object.entries(this._nodes).forEach(([s,a])=>{t(s)&&n.setNode(s,a)}),Object.values(this._edgeObjs).forEach(s=>{n.hasNode(s.v)&&n.hasNode(s.w)&&n.setEdge(s,this.edge(s))});let i={},r=s=>{let a=this.parent(s);return!a||n.hasNode(a)?(i[s]=a??void 0,a??void 0):a in i?i[a]:r(a)};return this._isCompound&&n.nodes().forEach(s=>n.setParent(s,r(s))),n}setDefaultEdgeLabel(t){return typeof t!="function"?this._defaultEdgeLabelFn=()=>t:this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(t,n){return t.reduce((i,r)=>(n!==void 0?this.setEdge(i,r,n):this.setEdge(i,r),r)),this}setEdge(t,n,i,r){let s,a,l,c,u=!1;typeof t=="object"&&t!==null&&"v"in t?(s=t.v,a=t.w,l=t.name,arguments.length===2&&(c=n,u=!0)):(s=t,a=n,l=r,arguments.length>2&&(c=i,u=!0)),s=""+s,a=""+a,l!==void 0&&(l=""+l);let d=Pw(this._isDirected,s,a,l);if(d in this._edgeLabels)return u&&(this._edgeLabels[d]=c),this;if(l!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(s),this.setNode(a),this._edgeLabels[d]=u?c:this._defaultEdgeLabelFn(s,a,l);let f=Vnt(this._isDirected,s,a,l);return s=f.v,a=f.w,Object.freeze(f),this._edgeObjs[d]=f,yK(this._preds[a],s),yK(this._sucs[s],a),this._in[a][d]=f,this._out[s][d]=f,this._edgeCount++,this}edge(t,n,i){let r=arguments.length===1?oM(this._isDirected,t):Pw(this._isDirected,t,n,i);return this._edgeLabels[r]}edgeAsObj(t,n,i){let r=arguments.length===1?this.edge(t):this.edge(t,n,i);return typeof r!="object"?{label:r}:r}hasEdge(t,n,i){return(arguments.length===1?oM(this._isDirected,t):Pw(this._isDirected,t,n,i))in this._edgeLabels}removeEdge(t,n,i){let r=arguments.length===1?oM(this._isDirected,t):Pw(this._isDirected,t,n,i),s=this._edgeObjs[r];if(s){let a=s.v,l=s.w;delete this._edgeLabels[r],delete this._edgeObjs[r],vK(this._preds[l],a),vK(this._sucs[a],l),delete this._in[l][r],delete this._out[a][r],this._edgeCount--}return this}inEdges(t,n){return this.isDirected()?this.filterEdges(this._in[t],t,n):this.nodeEdges(t,n)}outEdges(t,n){return this.isDirected()?this.filterEdges(this._out[t],t,n):this.nodeEdges(t,n)}nodeEdges(t,n){if(t in this._nodes)return this.filterEdges({...this._in[t],...this._out[t]},t,n)}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}filterEdges(t,n,i){if(!t)return;let r=Object.values(t);return i?r.filter(s=>s.v===n&&s.w===i||s.v===i&&s.w===n):r}};function yK(e,t){e[t]?e[t]++:e[t]=1}function vK(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function Pw(e,t,n,i){let r=""+t,s=""+n;if(!e&&r>s){let a=r;r=s,s=a}return r+""+s+""+(i===void 0?"\0":i)}function Vnt(e,t,n,i){let r=""+t,s=""+n;if(!e&&r>s){let l=r;r=s,s=l}let a={v:r,w:s};return i&&(a.name=i),a}function oM(e,t){return Pw(e,t.v,t.w,t.name)}var Hnt="4.0.1",Qwe={};Uwe(Qwe,{read:()=>Knt,write:()=>qnt});function qnt(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:Wnt(e),edges:Gnt(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function Wnt(e){return e.nodes().map(t=>{let n=e.node(t),i=e.parent(t),r={v:t};return n!==void 0&&(r.value=n),i!==void 0&&(r.parent=i),r})}function Gnt(e){return e.edges().map(t=>{let n=e.edge(t),i={v:t.v,w:t.w};return t.name!==void 0&&(i.name=t.name),n!==void 0&&(i.value=n),i})}function Knt(e){let t=new au(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 mB={};Uwe(mB,{CycleException:()=>nN,bellmanFord:()=>zwe,components:()=>Znt,dijkstra:()=>tN,dijkstraAll:()=>tit,findCycles:()=>nit,floydWarshall:()=>rit,isAcyclic:()=>ait,postorder:()=>lit,preorder:()=>cit,prim:()=>uit,shortestPaths:()=>dit,tarjan:()=>Hwe,topsort:()=>qwe});var Xnt=()=>1;function zwe(e,t,n,i){return Ynt(e,String(t),n||Xnt,i||function(r){return e.outEdges(r)})}function Ynt(e,t,n,i){let r={},s,a=0,l=e.nodes(),c=function(f){let h=n(f);r[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,i=String(e);if(!(i in n)){let r=this._arr,s=r.length;return n[i]=s,r.push({key:i,priority:t}),this._decrease(s),!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 i=this._arr[n].priority;if(t>i)throw new Error(`New priority is greater than current priority. Key: ${e} Old: ${i} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,i=n+1,r=e;n>1,!(t[i].priority1;function tN(e,t,n,i){let r=function(s){return e.outEdges(s)};return eit(e,String(t),n||Jnt,i||r)}function eit(e,t,n,i){let r={},s=new Vwe,a,l,c=function(u){let d=u.v!==a?u.v:u.w,f=r[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=s.removeMin(),l=r[a],l.distance!==Number.POSITIVE_INFINITY);)i(a).forEach(c);return r}function tit(e,t,n){return e.nodes().reduce(function(i,r){return i[r]=tN(e,r,t,n),i},{})}function Hwe(e){let t=0,n=[],i={},r=[];function s(a){let l=i[a]={onStack:!0,lowlink:t,index:t++};if(n.push(a),e.successors(a).forEach(function(c){c in i?i[c].onStack&&(l.lowlink=Math.min(l.lowlink,i[c].index)):(s(c),l.lowlink=Math.min(l.lowlink,i[c].lowlink))}),l.lowlink===l.index){let c=[],u;do u=n.pop(),i[u].onStack=!1,c.push(u);while(a!==u);r.push(c)}}return e.nodes().forEach(function(a){a in i||s(a)}),r}function nit(e){return Hwe(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var iit=()=>1;function rit(e,t,n){return sit(e,t||iit,n||function(i){return e.outEdges(i)})}function sit(e,t,n){let i={},r=e.nodes();return r.forEach(function(s){i[s]={},i[s][s]={distance:0,predecessor:""},r.forEach(function(a){s!==a&&(i[s][a]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),n(s).forEach(function(a){let l=a.v===s?a.w:a.v,c=t(a);i[s][l]={distance:c,predecessor:s}})}),r.forEach(function(s){let a=i[s];r.forEach(function(l){let c=i[l];r.forEach(function(u){let d=c[s],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);r=Wwe(e,l,n==="post",a,s,i,r)}),r}function Wwe(e,t,n,i,r,s,a){return t in i||(i[t]=!0,n||(a=s(a,t)),r(t).forEach(function(l){a=Wwe(e,l,n,i,r,s,a)}),n&&(a=s(a,t))),a}function Gwe(e,t,n){return oit(e,t,n,function(i,r){return i.push(r),i},[])}function lit(e,t){return Gwe(e,t,"post")}function cit(e,t){return Gwe(e,t,"pre")}function uit(e,t){let n=new au,i={},r=new Vwe,s;function a(c){let u=c.v===s?c.w:c.v,d=r.priority(u);if(d!==void 0){let f=t(c);f0;){if(s=r.removeMin(),s in i)n.setEdge(s,i[s]);else{if(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(s).forEach(a)}return n}function dit(e,t,n,i){return fit(e,t,n,i??(r=>{let s=e.outEdges(r);return s??[]}))}function fit(e,t,n,i){if(n===void 0)return tN(e,t,n,i);let r=!1,s=e.nodes();for(let a=0;at.setNode(n,e.node(n))),e.edges().forEach(n=>{let i=t.edge(n.v,n.w)||{weight:0,minlen:1},r=e.edge(n);t.setEdge(n.v,n.w,{weight:i.weight+r.weight,minlen:Math.max(i.minlen,r.minlen)})}),t}function Kwe(e){let t=new au({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 xK(e,t){let n=e.x,i=e.y,r=t.x-n,s=t.y-i,a=e.width/2,l=e.height/2;if(!r&&!s)throw new Error("Not possible to find intersection inside of the rectangle");let c,u;return Math.abs(s)*a>Math.abs(r)*l?(s<0&&(l=-l),c=l*r/s,u=l):(r<0&&(a=-a),c=a,u=a*s/r),{x:n+c,y:i+u}}function aE(e){let t=MS(Ywe(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let i=e.node(n),r=i.rank;r!==void 0&&(t[r]||(t[r]=[]),t[r][i.order]=n)}),t}function pit(e){let t=e.nodes().map(i=>{let r=e.node(i).rank;return r===void 0?Number.MAX_VALUE:r}),n=Cd(Math.min,t);e.nodes().forEach(i=>{let r=e.node(i);Object.hasOwn(r,"rank")&&(r.rank-=n)})}function mit(e){let t=e.nodes().map(a=>e.node(a).rank).filter(a=>a!==void 0),n=Cd(Math.min,t),i=[];e.nodes().forEach(a=>{let l=e.node(a).rank-n;i[l]||(i[l]=[]),i[l].push(a)});let r=0,s=e.graph().nodeRankFactor;Array.from(i).forEach((a,l)=>{a===void 0&&l%s!==0?--r:a!==void 0&&r&&a.forEach(c=>e.node(c).rank+=r)})}function wK(e,t,n,i){let r={width:0,height:0};return arguments.length>=4&&(r.rank=n,r.order=i),Fx(e,"border",r,t)}function git(e,t=Xwe){let n=[];for(let i=0;iXwe){let n=git(t);return e(...n.map(i=>e(...i)))}else return e(...t)}function Ywe(e){let t=e.nodes().map(n=>{let i=e.node(n).rank;return i===void 0?Number.MIN_VALUE:i});return Cd(Math.max,t)}function bit(e,t){let n={lhs:[],rhs:[]};return e.forEach(i=>{t(i)?n.lhs.push(i):n.rhs.push(i)}),n}function Zwe(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function Jwe(e,t){return t()}var yit=0;function gB(e){let t=++yit;return e+(""+t)}function MS(e,t,n=1){t==null&&(t=e,e=0);let i=s=>sti[t]:n=t,Object.entries(e).reduce((i,[r,s])=>(i[r]=n(s,r),i),{})}function vit(e,t){return e.reduce((n,i,r)=>(n[i]=t[r],n),{})}var UR="\0",xit="3.0.0",wit=class{constructor(){Qnt(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return OK(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&OK(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,Oit)),n=n._prev;return"["+e.join(", ")+"]"}};function OK(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Oit(e,t){if(e!=="_next"&&e!=="_prev")return t}var Sit=wit,kit=()=>1;function Eit(e,t){if(e.nodeCount()<=1)return[];let n=Tit(e,t||kit);return Cit(n.graph,n.buckets,n.zeroIdx).flatMap(i=>e.outEdges(i.v,i.w)||[])}function Cit(e,t,n){var i;let r=[],s=t[t.length-1],a=t[0],l;for(;e.nodeCount();){for(;l=a.dequeue();)lM(e,t,n,l);for(;l=s.dequeue();)lM(e,t,n,l);if(e.nodeCount()){for(let c=t.length-2;c>0;--c)if(l=(i=t[c])==null?void 0:i.dequeue(),l){r=r.concat(lM(e,t,n,l,!0)||[]);break}}}return r}function lM(e,t,n,i,r){let s=[],a=r?s:void 0;return(e.inEdges(i.v)||[]).forEach(l=>{let c=e.edge(l),u=e.node(l.v);r&&s.push({v:l.v,w:l.w}),u.out-=c,f6(t,n,u)}),(e.outEdges(i.v)||[]).forEach(l=>{let c=e.edge(l),u=l.w,d=e.node(u);d.in-=c,f6(t,n,d)}),e.removeNode(i.v),a}function Tit(e,t){let n=new au,i=0,r=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);r=Math.max(r,f.out+=u),i=Math.max(i,h.in+=u)});let s=Ait(r+i+3).map(()=>new Sit),a=i+1;return n.nodes().forEach(l=>{f6(s,a,n.node(l))}),{graph:n,buckets:s,zeroIdx:a}}function f6(e,t,n){var i,r,s;n.out?n.in?(s=e[n.out-n.in+t])==null||s.enqueue(n):(r=e[e.length-1])==null||r.enqueue(n):(i=e[0])==null||i.enqueue(n)}function Ait(e){let t=[];for(let n=0;n{let i=e.edge(n);e.removeEdge(n),i.forwardName=n.name,i.reversed=!0,e.setEdge(n.w,n.v,i,gB("rev"))});function t(n){return i=>n.edge(i).weight}}function Nit(e){let t=[],n={},i={};function r(s){Object.hasOwn(i,s)||(i[s]=!0,n[s]=!0,e.outEdges(s).forEach(a=>{Object.hasOwn(n,a.w)?t.push(a):r(a.w)}),delete n[s])}return e.nodes().forEach(r),t}function jit(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let i=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,i)}})}function Rit(e){e.graph().dummyChains=[],e.edges().forEach(t=>Iit(e,t))}function Iit(e,t){let n=t.v,i=e.node(n).rank,r=t.w,s=e.node(r).rank,a=t.name,l=e.edge(t),c=l.labelRank;if(s===i+1)return;e.removeEdge(t);let u,d,f;for(f=0,++i;i{let n=e.node(t),i=n.edgeLabel,r;for(e.setEdge(n.edgeObj,i);n.dummy;)r=e.successors(t)[0],e.removeNode(t),i.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height),t=r,n=e.node(t)})}function bB(e){let t={};function n(i){let r=e.node(i);if(Object.hasOwn(t,i))return r.rank;t[i]=!0;let s=e.outEdges(i),a=s?s.map(c=>c==null?Number.POSITIVE_INFINITY:n(c.w)-e.edge(c).minlen):[],l=Cd(Math.min,a);return l===Number.POSITIVE_INFINITY&&(l=0),r.rank=l}e.sources().forEach(n)}function Kv(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var eOe=Dit;function Dit(e){let t=new au({directed:!1}),n=e.nodes();if(n.length===0)throw new Error("Graph must have at least one node");let i=n[0],r=e.nodeCount();t.setNode(i,{});let s,a;for(;Mit(t,e){let a=s.v,l=i===a?s.w:a;!e.hasNode(l)&&!Kv(t,s)&&(e.setNode(l,{}),e.setEdge(i,l,{}),n(l))})}return e.nodes().forEach(n),e.nodeCount()}function Lit(e,t){return t.edges().reduce((n,i)=>{let r=Number.POSITIVE_INFINITY;return e.hasNode(i.v)!==e.hasNode(i.w)&&(r=Kv(t,i)),rt.node(i).rank+=n)}var{preorder:Fit,postorder:Bit}=mB,Uit=Xb;Xb.initLowLimValues=vB;Xb.initCutValues=yB;Xb.calcCutValue=tOe;Xb.leaveEdge=iOe;Xb.enterEdge=rOe;Xb.exchangeEdges=sOe;function Xb(e){e=hit(e),bB(e);let t=eOe(e);vB(t),yB(t,e);let n,i;for(;n=iOe(t);)i=rOe(t,e,n),sOe(t,e,n,i)}function yB(e,t){let n=Bit(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(i=>Qit(e,t,i))}function Qit(e,t,n){let i=e.node(n).parent,r=e.edge(n,i);r.cutvalue=tOe(e,t,n)}function tOe(e,t,n){let i=e.node(n).parent,r=!0,s=t.edge(n,i),a=0;s||(r=!1,s=t.edge(i,n)),a=s.weight;let l=t.nodeEdges(n);return l&&l.forEach(c=>{let u=c.v===n,d=u?c.w:c.v;if(d!==i){let f=u===r,h=t.edge(c).weight;if(a+=f?h:-h,Vit(e,n,d)){let p=e.edge(n,d).cutvalue;a+=f?-p:p}}}),a}function vB(e,t){arguments.length<2&&(t=e.nodes()[0]),nOe(e,{},1,t)}function nOe(e,t,n,i,r){let s=n,a=e.node(i);t[i]=!0;let l=e.neighbors(i);return l&&l.forEach(c=>{Object.hasOwn(t,c)||(n=nOe(e,t,n,c,i))}),a.low=s,a.lim=n++,r?a.parent=r:delete a.parent,n}function iOe(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function rOe(e,t,n){let i=n.v,r=n.w;t.hasEdge(i,r)||(i=n.w,r=n.v);let s=e.node(i),a=e.node(r),l=s,c=!1;return s.lim>a.lim&&(l=a,c=!0),t.edges().filter(u=>c===SK(e,e.node(u.v),l)&&c!==SK(e,e.node(u.w),l)).reduce((u,d)=>Kv(t,d)!e.node(r).parent);if(!n)return;let i=Fit(e,[n]);i=i.slice(1),i.forEach(r=>{let s=e.node(r).parent,a=t.edge(r,s),l=!1;a||(a=t.edge(s,r),l=!0),t.node(r).rank=t.node(s).rank+(l?a.minlen:-a.minlen)})}function Vit(e,t,n){return e.hasEdge(t,n)}function SK(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var Hit=qit;function qit(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":kK(e);break;case"tight-tree":Git(e);break;case"longest-path":Wit(e);break;case"none":break;default:kK(e)}}var Wit=bB;function Git(e){bB(e),eOe(e)}function kK(e){Uit(e)}var Kit=Xit;function Xit(e){let t=Zit(e);e.graph().dummyChains.forEach(n=>{let i=e.node(n),r=i.edgeObj,s=Yit(e,t,r.v,r.w),a=s.path,l=s.lca,c=0,u=a[c],d=!0;for(;n!==r.w;){if(i=e.node(n),d){for(;(u=a[c])!==l&&e.node(u).maxRanka||l>t[c].lim));let u=c,d=i;for(;(d=e.parent(d))!==u;)s.push(d);return{path:r.concat(s.reverse()),lca:u}}function Zit(e){let t={},n=0;function i(r){let s=n;e.children(r).forEach(i),t[r]={low:s,lim:n++}}return e.children(UR).forEach(i),t}function Jit(e){let t=Fx(e,"root",{},"_root"),n=ert(e),i=Object.values(n),r=Cd(Math.max,i)-1,s=2*r+1;e.graph().nestingRoot=t,e.edges().forEach(l=>e.edge(l).minlen*=s);let a=trt(e)+1;e.children(UR).forEach(l=>aOe(e,t,s,a,r,n,l)),e.graph().nodeRankFactor=s}function aOe(e,t,n,i,r,s,a){var l;let c=e.children(a);if(!c.length){a!==t&&e.setEdge(t,a,{weight:0,minlen:n});return}let u=wK(e,"_bt"),d=wK(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;aOe(e,t,n,i,r,s,h);let g=e.node(h),b=g.borderTop?g.borderTop:h,v=g.borderBottom?g.borderBottom:h,y=g.borderTop?i:2*i,x=b!==v?1:r-((p=s[a])!=null?p:0)+1;e.setEdge(u,b,{weight:y,minlen:x,nestingEdge:!0}),e.setEdge(v,d,{weight:y,minlen:x,nestingEdge:!0})}),e.parent(a)||e.setEdge(t,u,{weight:0,minlen:r+((l=s[a])!=null?l:0)})}function ert(e){let t={};function n(i,r){let s=e.children(i);s&&s.length&&s.forEach(a=>n(a,r+1)),t[i]=r}return e.children(UR).forEach(i=>n(i,1)),t}function trt(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function nrt(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var irt=rrt;function rrt(e){function t(n){let i=e.children(n),r=e.node(n);if(i.length&&i.forEach(t),Object.hasOwn(r,"minRank")){r.borderLeft=[],r.borderRight=[];for(let s=r.minRank,a=r.maxRank+1;sCK(e.node(t))),e.edges().forEach(t=>CK(e.edge(t)))}function CK(e){let t=e.width;e.width=e.height,e.height=t}function ort(e){e.nodes().forEach(t=>cM(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(cM),Object.hasOwn(i,"y")&&cM(i)})}function cM(e){e.y=-e.y}function lrt(e){e.nodes().forEach(t=>uM(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(uM),Object.hasOwn(i,"x")&&uM(i)})}function uM(e){let t=e.x;e.x=e.y,e.y=t}function crt(e){let t={},n=e.nodes().filter(l=>!e.children(l).length),i=n.map(l=>e.node(l).rank),r=Cd(Math.max,i),s=MS(r+1).map(()=>[]);function a(l){if(t[l])return;t[l]=!0;let c=e.node(l);s[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),s}function urt(e,t){let n=0;for(let i=1;id)),r=t.flatMap(u=>{let d=e.outEdges(u);return d?d.map(f=>({pos:i[f.w],weight:e.edge(f).weight})).sort((f,h)=>f.pos-h.pos):[]}),s=1;for(;s{let d=u.pos+s;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 frt(e,t=[]){return t.map(n=>{let i=e.inEdges(n);if(!i||!i.length)return{v:n};{let r=i.reduce((s,a)=>{let l=e.edge(a),c=e.node(a.v);return{sum:s.sum+l.weight*c.order,weight:s.weight+l.weight}},{sum:0,weight:0});return{v:n,barycenter:r.sum/r.weight,weight:r.weight}}})}function hrt(e,t){let n={};e.forEach((r,s)=>{let a={indegree:0,in:[],out:[],vs:[r.v],i:s};r.barycenter!==void 0&&(a.barycenter=r.barycenter,a.weight=r.weight),n[r.v]=a}),t.edges().forEach(r=>{let s=n[r.v],a=n[r.w];s!==void 0&&a!==void 0&&(a.indegree++,s.out.push(a))});let i=Object.values(n).filter(r=>!r.indegree);return prt(i)}function prt(e){let t=[];function n(r){return s=>{s.merged||(s.barycenter===void 0||r.barycenter===void 0||s.barycenter>=r.barycenter)&&mrt(r,s)}}function i(r){return s=>{s.in.push(r),--s.indegree===0&&e.push(s)}}for(;e.length;){let r=e.pop();t.push(r),r.in.reverse().forEach(n(r)),r.out.forEach(i(r))}return t.filter(r=>!r.merged).map(r=>iN(r,["vs","i","barycenter","weight"]))}function mrt(e,t){let n=0,i=0;e.weight&&(n+=e.barycenter*e.weight,i+=e.weight),t.weight&&(n+=t.barycenter*t.weight,i+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/i,e.weight=i,e.i=Math.min(t.i,e.i),t.merged=!0}function grt(e,t){let n=bit(e,d=>Object.hasOwn(d,"barycenter")),i=n.lhs,r=n.rhs.sort((d,f)=>f.i-d.i),s=[],a=0,l=0,c=0;i.sort(brt(!!t)),c=TK(s,r,c),i.forEach(d=>{c+=d.vs.length,s.push(d.vs),a+=d.barycenter*d.weight,l+=d.weight,c=TK(s,r,c)});let u={vs:s.flat(1)};return l&&(u.barycenter=a/l,u.weight=l),u}function TK(e,t,n){let i;for(;t.length&&(i=t[t.length-1]).i<=n;)t.pop(),e.push(i.vs),n++;return n}function brt(e){return(t,n)=>t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}function lOe(e,t,n,i){let r=e.children(t),s=e.node(t),a=s?s.borderLeft:void 0,l=s?s.borderRight:void 0,c={};a&&(r=r.filter(h=>h!==a&&h!==l));let u=frt(e,r);u.forEach(h=>{if(e.children(h.v).length){let p=lOe(e,h.v,n,i);c[h.v]=p,Object.hasOwn(p,"barycenter")&&vrt(h,p)}});let d=hrt(u,n);yrt(d,c);let f=grt(d,i);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]),g=e.predecessors(l),b=e.node(g[0]);Object.hasOwn(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+p.order+b.order)/(f.weight+2),f.weight+=2}}return f}function yrt(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(i=>t[i]?t[i].vs:i)})}function vrt(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 xrt(e,t,n,i){i||(i=e.nodes());let r=wrt(e),s=new au({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(a=>e.node(a));return i.forEach(a=>{let l=e.node(a),c=e.parent(a);if(l.rank===t||l.minRank<=t&&t<=l.maxRank){s.setNode(a),s.setParent(a,c||r);let u=e[n](a);u&&u.forEach(d=>{let f=d.v===a?d.w:d.v,h=s.edge(f,a),p=h!==void 0?h.weight:0;s.setEdge(f,a,{weight:e.edge(d).weight+p})}),Object.hasOwn(l,"minRank")&&s.setNode(a,{borderLeft:l.borderLeft[t],borderRight:l.borderRight[t]})}}),s}function wrt(e){let t;for(;e.hasNode(t=gB("_root")););return t}function Ort(e,t,n){let i={},r;n.forEach(s=>{let a=e.parent(s),l,c;for(;a;){if(l=e.parent(a),l?(c=i[l],i[l]=a):(c=r,r=a),c&&c!==a){t.setEdge(c,a);return}a=l}})}function cOe(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,cOe);return}let n=Ywe(e),i=AK(e,MS(1,n+1),"inEdges"),r=AK(e,MS(n-1,-1,-1),"outEdges"),s=crt(e);if(_K(e,s),t.disableOptimalOrderHeuristic)return;let a=Number.POSITIVE_INFINITY,l,c=t.constraints||[];for(let u=0,d=0;d<4;++u,++d){Srt(u%2?i:r,u%4>=2,c),s=aE(e);let f=urt(e,s);f{i.has(s)||i.set(s,[]),i.get(s).push(a)};for(let s of e.nodes()){let a=e.node(s);if(typeof a.rank=="number"&&r(a.rank,s),typeof a.minRank=="number"&&typeof a.maxRank=="number")for(let l=a.minRank;l<=a.maxRank;l++)l!==a.rank&&r(l,s)}return t.map(function(s){return xrt(e,s,n,i.get(s)||[])})}function Srt(e,t,n){let i=new au;e.forEach(function(r){n.forEach(l=>i.setEdge(l.left,l.right));let s=r.graph().root,a=lOe(r,s,i,t);a.vs.forEach((l,c)=>r.node(l).order=c),Ort(r,i,a.vs)})}function _K(e,t){Object.values(t).forEach(n=>n.forEach((i,r)=>e.node(i).order=r))}function krt(e,t){let n={};function i(r,s){let a=0,l=0,c=r.length,u=s[s.length-1];return s.forEach((d,f)=>{let h=Crt(e,d),p=h?e.node(h).order:c;(h||d===u)&&(s.slice(l,f+1).forEach(g=>{let b=e.predecessors(g);b&&b.forEach(v=>{let y=e.node(v),x=y.order;(x{let f=s[d];if(f!==void 0&&e.node(f).dummy){let h=e.predecessors(f);h&&h.forEach(p=>{if(p===void 0)return;let g=e.node(p);g.dummy&&(g.orderu)&&uOe(n,p,f)})}})}function r(s,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,i(a,u,f,l,c),u=f,l=c}}i(a,u,a.length,c,s.length)}),a}return t.length&&t.reduce(r),n}function Crt(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(i=>e.node(i).dummy)}}function uOe(e,t,n){if(t>n){let r=t;t=n,n=r}let i=e[t];i||(e[t]=i={}),i[n]=!0}function Trt(e,t,n){if(t>n){let r=t;t=n,n=r}let i=e[t];return i!==void 0&&Object.hasOwn(i,n)}function Art(e,t,n,i){let r={},s={},a={};return t.forEach(l=>{l.forEach((c,u)=>{r[c]=c,s[c]=c,a[c]=u})}),t.forEach(l=>{let c=-1;l.forEach(u=>{let d=i(u);if(d&&d.length){let f=d.sort((p,g)=>{let b=a[p],v=a[g];return(b!==void 0?b:0)-(v!==void 0?v:0)}),h=(f.length-1)/2;for(let p=Math.floor(h),g=Math.ceil(h);p<=g;++p){let b=f[p];if(b===void 0)continue;let v=a[b];if(v!==void 0&&s[u]===u&&c{var y;let x=(y=s[v.v])!=null?y:0,O=a.edge(v);return Math.max(b,x+(O!==void 0?O:0))},0):s[p]=0}function d(p){let g=a.outEdges(p),b=Number.POSITIVE_INFINITY;g&&(b=g.reduce((y,x)=>{let O=s[x.w],w=a.edge(x);return Math.min(y,(O!==void 0?O:0)-(w!==void 0?w:0))},Number.POSITIVE_INFINITY));let v=e.node(p);b!==Number.POSITIVE_INFINITY&&v.borderType!==l&&(s[p]=Math.max(s[p]!==void 0?s[p]:0,b))}function f(p){return a.predecessors(p)||[]}function h(p){return a.successors(p)||[]}return c(u,f),c(d,h),Object.keys(i).forEach(p=>{var g;let b=n[p];b!==void 0&&(s[p]=(g=s[b])!=null?g:0)}),s}function Nrt(e,t,n,i){let r=new au,s=e.graph(),a=Drt(s.nodesep,s.edgesep,i);return t.forEach(l=>{let c;l.forEach(u=>{let d=n[u];if(d!==void 0){if(r.setNode(d),c!==void 0){let f=n[c];if(f!==void 0){let h=r.edge(f,d);r.setEdge(f,d,Math.max(a(e,u,c),h||0))}}c=u}})}),r}function jrt(e,t){return Object.values(t).reduce((n,i)=>{let r=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;Object.entries(i).forEach(([l,c])=>{let u=Mrt(e,l)/2;r=Math.max(c+u,r),s=Math.min(c-u,s)});let a=r-s;return a{["l","r"].forEach(a=>{let l=s+a,c=e[l];if(!c||c===t)return;let u=Object.values(c),d=i-Cd(Math.min,u);a!=="l"&&(d=r-Cd(Math.max,u)),d&&(e[l]=BR(c,f=>f+d))})})}function Irt(e,t=void 0){let n=e.ul;return n?BR(n,(i,r)=>{var s,a;if(t){let c=t.toLowerCase(),u=e[c];if(u&&u[r]!==void 0)return u[r]}let l=Object.values(e).map(c=>{let u=c[r];return u!==void 0?u:0}).sort((c,u)=>c-u);return(((s=l[1])!=null?s:0)+((a=l[2])!=null?a:0))/2}):{}}function Prt(e){let t=aE(e),n=Object.assign(krt(e,t),Ert(e,t)),i={},r;["u","d"].forEach(a=>{r=a==="u"?t:Object.values(t).reverse(),["l","r"].forEach(l=>{l==="r"&&(r=r.map(d=>Object.values(d).reverse()));let c=Art(e,r,n,d=>(a==="u"?e.predecessors(d):e.successors(d))||[]),u=_rt(e,r,c.root,c.align,l==="r");l==="r"&&(u=BR(u,d=>-d)),i[a+l]=u})});let s=jrt(e,i);return Rrt(i,s),Irt(i,e.graph().align)}function Drt(e,t,n){return(i,r,s)=>{let a=i.node(r),l=i.node(s),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 Mrt(e,t){return e.node(t).width}function Lrt(e){e=Kwe(e),$rt(e),Object.entries(Prt(e)).forEach(([t,n])=>e.node(t).x=n)}function $rt(e){let t=aE(e),n=e.graph(),i=n.ranksep,r=n.rankalign,s=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);r==="top"?u.y=s+u.height/2:r==="bottom"?u.y=s+l-u.height/2:u.y=s+l/2}),s+=l+i})}function Frt(e,t={}){let n=t.debugTiming?Zwe:Jwe;return n("layout",()=>{let i=n(" buildLayoutGraph",()=>Krt(e));return n(" runLayout",()=>Brt(i,n,t)),n(" updateInputGraph",()=>Urt(e,i)),i})}function Brt(e,t,n){t(" makeSpaceForEdgeLabels",()=>Xrt(e)),t(" removeSelfEdges",()=>sst(e)),t(" acyclic",()=>_it(e)),t(" nestingGraph.run",()=>Jit(e)),t(" rank",()=>Hit(Kwe(e))),t(" injectEdgeLabelProxies",()=>Yrt(e)),t(" removeEmptyRanks",()=>mit(e)),t(" nestingGraph.cleanup",()=>nrt(e)),t(" normalizeRanks",()=>pit(e)),t(" assignRankMinMax",()=>Zrt(e)),t(" removeEdgeLabelProxies",()=>Jrt(e)),t(" normalize.run",()=>Rit(e)),t(" parentDummyChains",()=>Kit(e)),t(" addBorderSegments",()=>irt(e)),t(" order",()=>cOe(e,n)),t(" insertSelfEdges",()=>ast(e)),t(" adjustCoordinateSystem",()=>srt(e)),t(" position",()=>Lrt(e)),t(" positionSelfEdges",()=>ost(e)),t(" removeBorderNodes",()=>rst(e)),t(" normalize.undo",()=>Pit(e)),t(" fixupEdgeLabelCoords",()=>nst(e)),t(" undoCoordinateSystem",()=>art(e)),t(" translateGraph",()=>est(e)),t(" assignNodeIntersects",()=>tst(e)),t(" reversePoints",()=>ist(e)),t(" acyclic.undo",()=>jit(e))}function Urt(e,t){e.nodes().forEach(n=>{let i=e.node(n),r=t.node(n);i&&(i.x=r.x,i.y=r.y,i.order=r.order,i.rank=r.rank,t.children(n).length&&(i.width=r.width,i.height=r.height))}),e.edges().forEach(n=>{let i=e.edge(n),r=t.edge(n);i.points=r.points,Object.hasOwn(r,"x")&&(i.x=r.x,i.y=r.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var Qrt=["nodesep","edgesep","ranksep","marginx","marginy"],zrt={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},Vrt=["acyclicer","ranker","rankdir","align","rankalign"],Hrt=["width","height","rank"],NK={width:0,height:0},qrt=["minlen","weight","width","height","labeloffset"],Wrt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Grt=["labelpos"];function Krt(e){let t=new au({multigraph:!0,compound:!0}),n=fM(e.graph());return t.setGraph(Object.assign({},zrt,dM(n,Qrt),iN(n,Vrt))),e.nodes().forEach(i=>{let r=fM(e.node(i)),s=dM(r,Hrt);Object.keys(NK).forEach(l=>{s[l]===void 0&&(s[l]=NK[l])}),t.setNode(i,s);let a=e.parent(i);a!==void 0&&t.setParent(i,a)}),e.edges().forEach(i=>{let r=fM(e.edge(i));t.setEdge(i,Object.assign({},Wrt,dM(r,qrt),iN(r,Grt)))}),t}function Xrt(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let i=e.edge(n);i.minlen*=2,i.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?i.width+=i.labeloffset:i.height+=i.labeloffset)})}function Yrt(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let i=e.node(t.v),r={rank:(e.node(t.w).rank-i.rank)/2+i.rank,e:t};Fx(e,"edge-proxy",r,"_ep")}})}function Zrt(e){let t=0;e.nodes().forEach(n=>{let i=e.node(n);i.borderTop&&(i.minRank=e.node(i.borderTop).rank,i.maxRank=e.node(i.borderBottom).rank,t=Math.max(t,i.maxRank))}),e.graph().maxRank=t}function Jrt(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="edge-proxy"){let i=n;e.edge(i.e).labelRank=n.rank,e.removeNode(t)}})}function est(e){let t=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,r=0,s=e.graph(),a=s.marginx||0,l=s.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),i=Math.min(i,f-p/2),r=Math.max(r,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,i-=l,e.nodes().forEach(u=>{let d=e.node(u);d.x-=t,d.y-=i}),e.edges().forEach(u=>{let d=e.edge(u);d.points.forEach(f=>{f.x-=t,f.y-=i}),Object.hasOwn(d,"x")&&(d.x-=t),Object.hasOwn(d,"y")&&(d.y-=i)}),s.width=n-t+a,s.height=r-i+l}function tst(e){e.edges().forEach(t=>{let n=e.edge(t),i=e.node(t.v),r=e.node(t.w),s,a;n.points?(s=n.points[0],a=n.points[n.points.length-1]):(n.points=[],s=r,a=i),n.points.unshift(xK(i,s)),n.points.push(xK(r,a))})}function nst(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 ist(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function rst(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),i=e.node(n.borderTop),r=e.node(n.borderBottom),s=e.node(n.borderLeft[n.borderLeft.length-1]),a=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(a.x-s.x),n.height=Math.abs(r.y-i.y),n.x=s.x+n.width/2,n.y=i.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy==="border"&&e.removeNode(t)})}function sst(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 ast(e){aE(e).forEach(t=>{let n=0;t.forEach((i,r)=>{let s=e.node(i);s.order=r+n,(s.selfEdges||[]).forEach(a=>{Fx(e,"selfedge",{width:a.label.width,height:a.label.height,rank:s.rank,order:r+ ++n,e:a.e,label:a.label},"_se")}),delete s.selfEdges})})}function ost(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="selfedge"){let i=n,r=e.node(i.e.v),s=r.x+r.width/2,a=r.y,l=n.x-s,c=r.height/2;e.setEdge(i.e,i.label),e.removeNode(t),i.label.points=[{x:s+2*l/3,y:a-c},{x:s+5*l/6,y:a-c},{x:s+l,y:a},{x:s+5*l/6,y:a+c},{x:s+2*l/3,y:a+c}],i.label.x=n.x,i.label.y=n.y}})}function dM(e,t){return BR(iN(e,t),Number)}function fM(e){let t={};return e&&Object.entries(e).forEach(([n,i])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=i}),t}function lst(e){let t=aE(e),n=new au({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(i=>{n.setNode(i,{label:i}),n.setParent(i,"layer"+e.node(i).rank)}),e.edges().forEach(i=>n.setEdge(i.v,i.w,{},i.name)),t.forEach((i,r)=>{let s="layer"+r;n.setNode(s,{rank:"same"}),i.reduce((a,l)=>(n.setEdge(a,l,{style:"invis"}),l))}),n}var cst={graphlib:Bwe,version:xit,layout:Frt,debug:lst,util:{time:Zwe,notime:Jwe}},jK=cst;/*! For license information please see dagre.esm.js.LEGAL.txt */const Dw={llm:{labelKey:"buildCanvas.patterns.llm.label",descriptionKey:"buildCanvas.patterns.llm.description",icon:kbe},sequential:{labelKey:"buildCanvas.patterns.sequential.label",descriptionKey:"buildCanvas.patterns.sequential.description",icon:S7e},parallel:{labelKey:"buildCanvas.patterns.parallel.label",descriptionKey:"buildCanvas.patterns.parallel.description",icon:i7e},loop:{labelKey:"buildCanvas.patterns.loop.label",descriptionKey:"buildCanvas.patterns.loop.description",icon:Abe},a2a:{labelKey:"buildCanvas.patterns.a2a.label",descriptionKey:"buildCanvas.patterns.a2a.description",icon:Zj}},h6=220,p6=88,RK=96,IK=34,kO=64,hM=310,Ny=24,dOe=56,m6=40,PK=40,ust=18,dst=58,fst=!1,hst=e=>e==="sequential"||e==="parallel"||e==="loop";function g6(e,t){const n=e.agentType??"llm";return hst(n)||n==="llm"&&(t.length===0||e.subAgents.length>0)}function b6(e,t=[],n="horizontal",i=!1){const r=e.agentType??"llm";if(!g6(e,t))return{width:h6,height:p6};if(i&&e.subAgents.length===0)return{width:hM,height:kO};const s=e.subAgents.map((f,h)=>b6(f,[...t,h],n,i)),a=s.length?Math.max(...s.map(f=>f.width)):0,l=s.length?Math.max(...s.map(f=>f.height)):0,c=s.length&&r!=="parallel"?dOe:Ny,u=n==="horizontal"?r!=="parallel":r==="parallel",d=s.length?r==="parallel"?ust+PK:r==="loop"?dst:0:PK;return u?{width:Math.max(hM,s.reduce((f,h)=>f+h.width,0)+m6*Math.max(0,s.length-1)+c*2),height:kO+Ny+l+d+Ny}:{width:Math.max(hM,a+Ny*2),height:kO+c+s.reduce((f,h)=>f+h.height,0)+m6*Math.max(0,s.length-1)+d+c}}function B1(e){return e.length===0?"agent-root":`agent-${e.join("-")}`}function pst(e,t){return e.length===t.length&&e.every((n,i)=>n===t[i])}function DK(e){const t=n=>[n.agentType??"llm",n.subAgents.map(t)];return JSON.stringify(t(e))}function U1(e,t,n,i){const r=(i==null?void 0:i.tone)==="sequential"?"hsl(213 40% 40%)":(i==null?void 0:i.tone)==="loop"?"hsl(151 34% 34%)":"hsl(220 9% 38%)";return{id:`${e}-${t}${i!=null&&i.loop?"-loop":""}`,source:e,target:t,sourceHandle:i!=null&&i.loop?"loop-source":void 0,targetHandle:i!=null&&i.loop?"loop-target":void 0,label:n,type:"insertStep",data:i?{insert:i.insert,loop:i.loop,tone:i.tone}:void 0,animated:i==null?void 0:i.loop,markerEnd:{type:RS.ArrowClosed,width:16,height:16,color:r},style:{stroke:r,strokeWidth:1.5},labelStyle:{fill:"hsl(215 14% 42%)",fontSize:10,fontWeight:600},labelBgStyle:{fill:"hsl(var(--background))",fillOpacity:.92}}}function MK(e,t,n=!1,i){const r=[{id:"terminal-input",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:i("buildCanvas.terminals.input")},selectable:!1,draggable:!1},{id:"terminal-output",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:i("buildCanvas.terminals.output")},selectable:!1,draggable:!1}],s=[];function a(f,h,p,g,b){const v=f.agentType??"llm",y=B1(h);return g6(f,h)?(l(f,h,p,g,b),y):(r.push({id:y,type:"agent",parentId:p,extent:"parent",position:g,data:{kind:"agent",path:h,agent:f,title:v==="a2a"?i("buildCanvas.patterns.a2a.label"):f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i("buildCanvas.unnamedStep")),pattern:v,description:f.description.trim()||i(Dw[v].descriptionKey),childCount:f.subAgents.length,containedIn:b}}),y)}function l(f,h,p,g={x:0,y:0},b){const v=f.agentType??"sequential",y=B1(h),x=b6(f,h,t,n);r.push({id:y,type:"group",parentId:p,extent:p?"parent":void 0,position:g,style:{width:x.width,height:x.height},data:{kind:"agent",path:h,agent:f,title:f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i(Dw[v].labelKey)),pattern:v,description:f.description.trim()||i(Dw[v].descriptionKey),childCount:f.subAgents.length,containedIn:b,layoutWidth:x.width,layoutHeight:x.height,compactEmptyGroup:n&&f.subAgents.length===0}});const O=f.subAgents.map((C,N)=>b6(C,[...h,N],t,n)),w=O.length&&v!=="parallel"?dOe:Ny,k=t==="horizontal"?v!=="parallel":v==="parallel";let S=w;const E=f.subAgents.map((C,N)=>{const _=O[N],j=k?{x:S,y:kO+Ny}:{x:(x.width-_.width)/2,y:kO+S};return S+=(k?_.width:_.height)+m6,a(C,[...h,N],y,j,v)});if(v==="sequential"||v==="loop"){for(let C=0;C1&&s.push(U1(E[E.length-1],E[0],i("buildCanvas.edges.continueLoop"),{loop:!0,tone:"loop"}))}return y}const c=(f,h)=>{const p=f.agentType??"llm",g=B1(h);if(g6(f,h))return l(f,h),[g];if(r.push({id:g,type:"agent",position:{x:0,y:0},data:{kind:"agent",path:h,agent:f,title:p==="a2a"?i("buildCanvas.patterns.a2a.label"):f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i("buildCanvas.unnamedStep")),pattern:p,description:f.description.trim()||i(Dw[p].descriptionKey),childCount:f.subAgents.length}}),f.subAgents.length===0)return[g];const b=[];return f.subAgents.forEach((v,y)=>{const x=[...h,y],O=B1(x);s.push(U1(g,O,i("buildCanvas.edges.call"),{insert:{parentPath:h,index:y}})),b.push(...c(v,x))}),b},u=B1([]),d=c(e,[]);return s.push(U1("terminal-input",u)),d.forEach(f=>s.push(U1(f,"terminal-output"))),mst(r,s,t)}function mst(e,t,n){const i=new jK.graphlib.Graph().setDefaultEdgeLabel(()=>({}));i.setGraph({rankdir:n==="vertical"?"TB":"LR",ranksep:50,nodesep:34,edgesep:14,marginx:24,marginy:24});const r=new Set(e.filter(s=>!s.parentId).map(s=>s.id));return e.filter(s=>!s.parentId).forEach(s=>{const a=s.data.kind==="terminal";i.setNode(s.id,{width:a?RK:s.data.layoutWidth??h6,height:a?IK:s.data.layoutHeight??p6})}),t.filter(s=>r.has(s.source)&&r.has(s.target)).forEach(s=>i.setEdge(s.source,s.target)),jK.layout(i),{nodes:e.map(s=>{if(s.parentId)return s;const a=i.node(s.id),l=s.data.kind==="terminal",c=l?RK:s.data.layoutWidth??h6,u=l?IK:s.data.layoutHeight??p6;return{...s,position:{x:a.x-c/2,y:a.y-u/2}}}),edges:t}}const QR=m.createContext(null),zR=m.createContext("horizontal");function gst({id:e,sourceX:t,sourceY:n,targetX:i,targetY:r,sourcePosition:s,targetPosition:a,markerEnd:l,style:c,label:u,data:d}){const{t:f}=Ae("create"),h=m.useContext(QR),[p,g]=m.useState(!1),[b,v,y]=J_({sourceX:t,sourceY:n,targetX:i,targetY:r,sourcePosition:s,targetPosition:a,offset:d!=null&&d.loop?28:20});return o.jsxs(o.Fragment,{children:[o.jsx(sE,{id:e,path:b,markerEnd:l,style:c}),h&&(d==null?void 0:d.insert)&&o.jsx("path",{d:b,className:"abc-edge-hover-path",onPointerEnter:()=>g(!0),onPointerLeave:()=>g(!1)}),(u||h&&(d==null?void 0:d.insert))&&o.jsx(lnt,{children:o.jsxs("div",{className:`abc-edge-tools${h&&(d!=null&&d.insert)?" can-insert":""}${p?" is-visible":""}`,style:{transform:`translate(-50%, -50%) translate(${v}px, ${y}px)`},onPointerEnter:()=>g(!0),onPointerLeave:()=>g(!1),children:[u&&o.jsx("span",{className:"abc-edge-label",children:u}),h&&(d==null?void 0:d.insert)&&o.jsx("button",{type:"button",className:"abc-edge-add nodrag nopan","aria-label":f("buildCanvas.actions.insertHere"),title:f("buildCanvas.actions.insertHere"),onClick:x=>{x.stopPropagation(),h==null||h.onInsert(d.insert.parentPath,d.insert.index)},children:o.jsx($o,{})})]})})]})}function bst({data:e,selected:t}){const{t:n}=Ae("create"),i=m.useContext(QR),r=m.useContext(zR),s=r==="vertical"?rn.Top:rn.Left,a=r==="vertical"?rn.Bottom:rn.Right,l=r==="vertical"?rn.Right:rn.Bottom,c=e.pattern??"llm",u=Dw[c],d=u.icon;return o.jsxs("div",{className:`abc-node is-${c}${e.containedIn?` is-contained-in-${e.containedIn}`:""}${t?" is-selected":""}`,children:[o.jsx(fl,{type:"target",position:s,className:"abc-handle"}),c!=="llm"&&o.jsx("span",{className:"abc-node-icon",children:o.jsx(d,{})}),o.jsxs("span",{className:"abc-node-copy",children:[o.jsx("span",{className:"abc-node-meta",children:o.jsx("span",{children:n(u.labelKey)})}),o.jsx("strong",{children:e.title}),o.jsx("small",{children:e.description})]}),i&&e.path!==void 0&&e.path.length>0&&o.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":n("buildCanvas.actions.deleteNamed",{name:e.title}),title:n("buildCanvas.actions.deleteNode"),onClick:f=>{f.stopPropagation(),i==null||i.onDelete(e.path)},children:o.jsx(pm,{})}),o.jsx(fl,{type:"source",position:a,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(fl,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),o.jsx(fl,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function yst({data:e,selected:t}){const{t:n}=Ae("create"),i=m.useContext(QR),r=m.useContext(zR),s=r==="vertical"?rn.Top:rn.Left,a=r==="vertical"?rn.Bottom:rn.Right,l=r==="vertical"?rn.Right:rn.Bottom,c=e.pattern??"sequential",u=e.childCount??0,d=n(c==="llm"?"buildCanvas.actions.addSubagent":c==="parallel"?"buildCanvas.actions.addParallelStep":c==="loop"?"buildCanvas.actions.addLoopStep":"buildCanvas.actions.addNextStep");return o.jsxs("div",{className:`abc-group is-${c}${e.compactEmptyGroup?" is-compact-empty":""}${t?" is-selected":""}`,children:[o.jsx(fl,{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})]})}),i&&e.path!==void 0&&u>0&&c!=="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":n("buildCanvas.actions.addFirst"),title:n("buildCanvas.actions.addFirst"),onClick:f=>{f.stopPropagation(),i.onInsert(e.path,0)},children:o.jsx($o,{})}),o.jsx("button",{type:"button",className:"abc-group-boundary-add is-end nodrag nopan","aria-label":n("buildCanvas.actions.addLast"),title:n("buildCanvas.actions.addLast"),onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:o.jsx($o,{})})]}),i&&e.path!==void 0&&u>0&&c==="parallel"&&o.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-bottom nodrag nopan",onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:[o.jsx($o,{}),o.jsx("span",{children:d})]}),i&&e.path!==void 0&&u===0&&o.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-empty nodrag nopan",onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:[o.jsx($o,{}),o.jsx("span",{children:d})]}),i&&e.path!==void 0&&e.path.length>0&&o.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":n("buildCanvas.actions.deleteNamed",{name:e.title}),title:n("buildCanvas.actions.deleteNode"),onClick:f=>{f.stopPropagation(),i==null||i.onDelete(e.path)},children:o.jsx(pm,{})}),o.jsx(fl,{type:"source",position:a,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(fl,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),o.jsx(fl,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function vst({data:e}){const t=m.useContext(zR);return o.jsxs("div",{className:"abc-terminal",children:[o.jsx(fl,{type:"target",position:t==="vertical"?rn.Top:rn.Left,className:"abc-handle"}),o.jsx("span",{children:e.title}),o.jsx(fl,{type:"source",position:t==="vertical"?rn.Bottom:rn.Right,className:"abc-handle"})]})}const xst={agent:bst,group:yst,terminal:vst},wst={insertStep:gst};function Ost({draft:e,selectedPath:t,onSelect:n,onAdd:i,onInsert:r,onDelete:s,readOnly:a=!1,interactivePreview:l=!1,direction:c="horizontal"}){const{t:u}=Ae("create"),d=m.useMemo(()=>MK(e,c,a,u),[]),[f,h,p]=cnt(d.nodes),[g,b,v]=unt(d.edges),y=fnt(),x=m.useRef(`${c}:${a?"readonly":"editable"}:${DK(e)}`),O=m.useRef(null),{fitView:w}=$R(),k=m.useMemo(()=>MK(e,c,a,u),[c,e,a,u]),[S,E]=m.useState(()=>window.matchMedia("(max-width: 860px)").matches),C=m.useMemo(()=>a?{padding:.16,minZoom:.05,maxZoom:.9}:S?{padding:.08,minZoom:.35,maxZoom:.9}:{padding:.14,minZoom:.42,maxZoom:1.1},[S,a]),N=m.useCallback((j=0)=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const A=O.current;if(A&&(A.clientWidth===0||A.clientHeight===0)&&j<8){N(j+1);return}w(C)})})},[C,w]);m.useEffect(()=>{const j=window.matchMedia("(max-width: 860px)"),A=F=>E(F.matches);return j.addEventListener("change",A),()=>j.removeEventListener("change",A)},[]),m.useEffect(()=>{const j=`${c}:${a?"readonly":"editable"}:${DK(e)}`,A=j!==x.current;x.current=j,b(k.edges),h(F=>{const T=new Map(F.map(P=>[P.id,P]));return k.nodes.map(P=>{const R=T.get(P.id);return{...P,measured:!A&&R&&R.type===P.type?R.measured:void 0,position:!A&&R?R.position:P.position,selected:P.data.kind==="agent"&&!!P.data.path&&pst(P.data.path,t)}})}),A&&N()},[k,e,N,t,b,h]),m.useEffect(()=>{N()},[S,N]),m.useEffect(()=>{y&&N()},[k,N,y]),m.useEffect(()=>{if(!a||!O.current)return;const j=new ResizeObserver(()=>N());return j.observe(O.current),N(),()=>j.disconnect()},[N,a]);const _=m.useMemo(()=>a?null:{onAdd:i,onInsert:r,onDelete:s},[i,s,r,a]);return o.jsx(zR.Provider,{value:c,children:o.jsx(QR.Provider,{value:_,children:o.jsx("section",{className:`abc-root is-${c}${a?" is-readonly":""}`,"aria-label":u(a?"buildCanvas.readOnlyLabel":"buildCanvas.label"),children:o.jsx("div",{ref:O,className:"abc-canvas",children:o.jsxs(ant,{nodes:f,edges:g,nodeTypes:xst,edgeTypes:wst,onNodesChange:p,onEdgesChange:v,onNodeClick:(j,A)=>{!a&&A.data.kind==="agent"&&A.data.path&&n(A.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:C,onInit:()=>N(),minZoom:a?.05:.35,maxZoom:1.6,proOptions:{hideAttribution:!0},ariaLabelConfig:{"controls.ariaLabel":u("buildCanvas.controls.ariaLabel"),"controls.zoomIn.ariaLabel":u("buildCanvas.controls.zoomIn"),"controls.zoomOut.ariaLabel":u("buildCanvas.controls.zoomOut"),"controls.fitView.ariaLabel":u("buildCanvas.controls.fitView")},children:[o.jsx(bnt,{gap:20,size:1.2,color:"hsl(34 20% 82%)"}),(!a||l)&&o.jsx(knt,{showInteractive:!1}),fst]})})})})})}function LS(e){return o.jsx(Dwe,{children:o.jsx(Ost,{...e})})}sn.hasResourceBundle("en-US","create")||sn.addResourceBundle("en-US","create",vse,!0,!0);sn.hasResourceBundle("zh-CN","create")||sn.addResourceBundle("zh-CN","create",Mce,!0,!0);function Lt(e,t={}){return sn.t(e,{...t,ns:"create"})}function oE(e,t){return e.map(n=>({...n,get label(){return Lt(`${t}.${n.id}.label`)},get desc(){return Lt(`${t}.${n.id}.description`)}}))}function qc(e,t){const n={...e};for(const[i,r]of Object.entries(t))Object.defineProperty(n,i,{configurable:!0,enumerable:!0,get:()=>Lt(r)});return n}const fOe="https://ark.cn-beijing.volces.com/api/v3/";qc({key:"MODEL_AGENT_NAME",required:!1,placeholder:"doubao-seed-1-6-250615"},{comment:"traditional.catalog.env.modelAgentName.comment"});const pA=[qc({key:"MODEL_EMBEDDING_NAME",required:!1,placeholder:"doubao-embedding-vision-250615"},{comment:"traditional.catalog.env.embeddingModelName.comment"}),{key:"MODEL_EMBEDDING_DIM",required:!1,placeholder:"2048"},{key:"MODEL_EMBEDDING_API_BASE",required:!1,placeholder:fOe}],rN=[],sN={get label(){return Lt("traditional.catalog.links.console")},url:"https://console.volcengine.com/vikingdb/openviking"},Sst={get label(){return Lt("traditional.catalog.links.documentation")},url:"https://github.com/volcengine/OpenViking/blob/main/docs/zh/api/05-sessions.md"},hOe="https://api.vikingdb.cn-beijing.volces.com/openviking",kst=`{ +`)),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return m.useEffect(()=>{const c=(t==null?void 0:t.target)??eK,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=p=>{var v,y;if(r.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!r.current||r.current&&!u)&&$1e(p))return!1;const b=nK(p.code,l);if(s.current.add(p[b]),tK(a,s.current,!1)){const x=((y=(v=p.composedPath)==null?void 0:v.call(p))==null?void 0:y[0])||p.target,O=(x==null?void 0:x.nodeName)==="BUTTON"||(x==null?void 0:x.nodeName)==="A";t.preventDefault!==!1&&(r.current||!O)&&p.preventDefault(),i(!0)}},f=p=>{const g=nK(p.code,l);tK(a,s.current,!0)?(i(!1),s.current.clear()):s.current.delete(p[g]),p.key==="Meta"&&s.current.clear(),r.current=!1},h=()=>{s.current.clear(),i(!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,i]),n}function tK(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(r=>t.has(r)))}function nK(e,t){return t.includes(e)?"code":"key"}const Met=()=>{const e=ss();return m.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:i}=e.getState();return i?i.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[i,r,s],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??i,y:t.y??r,zoom:t.zoom??s},n),!0):!1},getViewport:()=>{const[t,n,i]=e.getState().transform;return{x:t,y:n,zoom:i}},setCenter:async(t,n,i)=>e.getState().setCenter(t,n,i),fitBounds:async(t,n)=>{const{width:i,height:r,minZoom:s,maxZoom:a,panZoom:l}=e.getState(),c=aB(t,i,r,s,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:i,snapGrid:r,snapToGrid:s,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??r,f=n.snapToGrid??s;return $x(u,i,f,d)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:r,y:s}=i.getBoundingClientRect(),a=Wv(t,n);return{x:a.x+r,y:a.y+s}}}),[])};function lwe(e,t){const n=[],i=new Map,r=[];for(const s of e)if(s.type==="add"){r.push(s);continue}else if(s.type==="remove"||s.type==="replace")i.set(s.id,[s]);else{const a=i.get(s.id);a?a.push(s):i.set(s.id,[s])}for(const s of t){const a=i.get(s.id);if(!a){n.push(s);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const l={...s};for(const c of a)Let(c,l);n.push(l)}return r.length&&r.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function Let(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 cwe(e,t){return lwe(e,t)}function uwe(e,t){return lwe(e,t)}function Og(e,t){return{id:e,type:"select",selected:t}}function _y(e,t=new Set,n=!1){const i=[];for(const[r,s]of e){const a=t.has(r);!(s.selected===void 0&&!a)&&s.selected!==a&&(n&&(s.selected=a),i.push(Og(s.id,a)))}return i}function iK({items:e=[],lookup:t}){var r;const n=[],i=new Map(e.map(s=>[s.id,s]));for(const[s,a]of e.entries()){const l=t.get(a.id),c=((r=l==null?void 0:l.internals)==null?void 0:r.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:s})}for(const[s]of t)i.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function rK(e){return{id:e.id,type:"remove"}}const $et=D1e();function Fet(e,t,n={}){return yJe(e,t,{...n,onError:n.onError??$et})}const sK=e=>iJe(e),Bet=e=>j1e(e);function dwe(e){return m.forwardRef(e)}const Uet=typeof window<"u"?m.useLayoutEffect:m.useEffect;function aK(e){const[t,n]=m.useState(BigInt(0)),[i]=m.useState(()=>Qet(()=>n(r=>r+BigInt(1))));return Uet(()=>{const r=i.get();r.length&&(e(r),i.reset())},[t]),i}function Qet(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const fwe=m.createContext(null);function zet({children:e}){const t=ss(),n=m.useCallback(l=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:p,onNodesChangeMiddlewareMap:g}=t.getState();let b=c;for(const y of l)b=typeof y=="function"?y(b):y;let v=iK({items:b,lookup:h});for(const y of g.values())v=y(v);d&&u(b),v.length>0?f==null||f(v):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:y,nodes:x,setNodes:O}=t.getState();y&&O(x)})},[]),i=aK(n),r=m.useCallback(l=>{const{edges:c=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let p=c;for(const g of l)p=typeof g=="function"?g(p):g;d?u(p):f&&f(iK({items:p,lookup:h}))},[]),s=aK(r),a=m.useMemo(()=>({nodeQueue:i,edgeQueue:s}),[]);return o.jsx(fwe.Provider,{value:a,children:e})}function Vet(){const e=m.useContext(fwe);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Het=e=>!!e.panZoom;function $R(){const e=Met(),t=ss(),n=Vet(),i=_i(Het),r=m.useMemo(()=>{const s=f=>t.getState().nodeLookup.get(f),a=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var y,x;const{nodeLookup:h,nodeOrigin:p}=t.getState(),g=sK(f)?f:h.get(f.id),b=g.parentId?M1e(g.position,g.measured,g.parentId,h,p):g.position,v={...g,position:b,width:((y=g.measured)==null?void 0:y.width)??g.width,height:((x=g.measured)==null?void 0:x.height)??g.height};return qv(v)},u=(f,h,p={replace:!1})=>{a(g=>g.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return p.replace&&sK(v)?v:{...b,...v}}return b}))},d=(f,h,p={replace:!1})=>{l(g=>g.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return p.replace&&Bet(v)?v:{...b,...v}}return b}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var h;return(h=s(f))==null?void 0:h.internals.userNode},getInternalNode:s,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(),[g,b,v]=p;return{nodes:f.map(y=>({...y})),edges:h.map(y=>({...y})),viewport:{x:g,y:b,zoom:v}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:p,edges:g,onNodesDelete:b,onEdgesDelete:v,triggerNodeChanges:y,triggerEdgeChanges:x,onDelete:O,onBeforeDelete:w}=t.getState(),{nodes:k,edges:S}=await lJe({nodesToRemove:f,edgesToRemove:h,nodes:p,edges:g,onBeforeDelete:w}),E=S.length>0,C=k.length>0;if(E){const N=S.map(rK);v==null||v(S),x(N)}if(C){const N=k.map(rK);b==null||b(k),y(N)}return(C||E)&&(O==null||O({nodes:k,edges:S})),{deletedNodes:k,deletedEdges:S}},getIntersectingNodes:(f,h=!0,p)=>{const g=DG(f),b=g?f:c(f),v=p!==void 0;return b?(p||t.getState().nodes).filter(y=>{const x=t.getState().nodeLookup.get(y.id);if(x&&!g&&(y.id===f.id||!x.internals.positionAbsolute))return!1;const O=qv(v?y:x),w=IS(O,b);return h&&w>0||w>=O.width*O.height||w>=b.width*b.height}):[]},isNodeIntersecting:(f,h,p=!0)=>{const b=DG(f)?f:c(f);if(!b)return!1;const v=IS(b,h);return p&&v>0||v>=h.width*h.height||v>=b.width*b.height},updateNode:u,updateNodeData:(f,h,p={replace:!1})=>{u(f,g=>{const b=typeof h=="function"?h(g):h;return p.replace?{...g,data:b}:{...g,data:{...g.data,...b}}},p)},updateEdge:d,updateEdgeData:(f,h,p={replace:!1})=>{d(f,g=>{const b=typeof h=="function"?h(g):h;return p.replace?{...g,data:b}:{...g,data:{...g.data,...b}}},p)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:p}=t.getState();return rJe(f,{nodeLookup:h,nodeOrigin:p})},getHandleConnections:({type:f,id:h,nodeId:p})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${p}-${f}${h?`-${h}`:""}`))==null?void 0:g.values())??[])},getNodeConnections:({type:f,handleId:h,nodeId:p})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${p}${f?h?`-${f}-${h}`:`-${f}`:""}`))==null?void 0:g.values())??[])},fitView:async f=>{const h=t.getState().fitViewResolver??dJe();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(p=>[...p]),h.promise}}},[]);return m.useMemo(()=>({...r,...e,viewportInitialized:i}),[i])}const oK=e=>e.selected,qet=typeof window<"u"?window:void 0;function Wet({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ss(),{deleteElements:i}=$R(),r=DS(e,{actInsideInputWithModifier:!1}),s=DS(t,{target:qet});m.useEffect(()=>{if(r){const{edges:a,nodes:l}=n.getState();i({nodes:l.filter(oK),edges:a.filter(oK)}),n.setState({nodesSelectionActive:!1})}},[r]),m.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function Get(e){const t=ss();m.useEffect(()=>{const n=()=>{var r,s,a,l;if(!e.current||!(((s=(r=e.current).checkVisibility)==null?void 0:s.call(r))??!0))return!1;const i=lB(e.current);(i.height===0||i.width===0)&&((l=(a=t.getState()).onError)==null||l.call(a,"004",Fu.error004())),t.setState({width:i.width||500,height:i.height||500})};if(e.current){n(),window.addEventListener("resize",n);const i=new ResizeObserver(()=>n());return i.observe(e.current),()=>{window.removeEventListener("resize",n),i&&e.current&&i.unobserve(e.current)}}},[])}const FR={position:"absolute",width:"100%",height:"100%",top:0,left:0},Ket=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Xet({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:r=.5,panOnScrollMode:s=rb.Free,zoomOnDoubleClick:a=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:p=!0,children:g,noWheelClassName:b,noPanClassName:v,onViewportChange:y,isControlledViewport:x,paneClickDistance:O,selectionOnDrag:w}){const k=ss(),S=m.useRef(null),{userSelectionActive:E,lib:C,connectionInProgress:N}=_i(Ket,rs),_=DS(h),j=m.useRef();Get(S);const A=m.useCallback(F=>{y==null||y({x:F[0],y:F[1],zoom:F[2]}),x||k.setState({transform:F})},[y,x]);return m.useEffect(()=>{if(S.current){j.current=GJe({domNode:S.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:R=>k.setState(L=>L.paneDragging===R?L:{paneDragging:R}),onPanZoomStart:(R,L)=>{const{onViewportChangeStart:M,onMoveStart:U}=k.getState();U==null||U(R,L),M==null||M(L)},onPanZoom:(R,L)=>{const{onViewportChange:M,onMove:U}=k.getState();U==null||U(R,L),M==null||M(L)},onPanZoomEnd:(R,L)=>{const{onViewportChangeEnd:M,onMoveEnd:U}=k.getState();U==null||U(R,L),M==null||M(L)}});const{x:F,y:T,zoom:P}=j.current.getViewport();return k.setState({panZoom:j.current,transform:[F,T,P],domNode:S.current.closest(".react-flow")}),()=>{var R;(R=j.current)==null||R.destroy()}}},[]),m.useEffect(()=>{var F;(F=j.current)==null||F.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:r,panOnScrollMode:s,zoomOnDoubleClick:a,panOnDrag:l,zoomActivationKeyPressed:_,preventScrolling:p,noPanClassName:v,userSelectionActive:E,noWheelClassName:b,lib:C,onTransformChange:A,connectionInProgress:N,selectionOnDrag:w,paneClickDistance:O})},[e,t,n,i,r,s,a,l,_,p,v,E,b,C,A,N,w,O]),o.jsx("div",{className:"react-flow__renderer",ref:S,style:FR,children:g})}const Yet=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Zet(){const{userSelectionActive:e,userSelectionRect:t}=_i(Yet,rs);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 sM=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Jet=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function ett({isSelecting:e,selectionKeyPressed:t,selectionMode:n=jS.Full,panOnDrag:i,autoPanOnSelection:r,paneClickDistance:s,selectionOnDrag:a,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:p,onPaneMouseLeave:g,children:b}){const v=m.useRef(0),y=ss(),{userSelectionActive:x,elementsSelectable:O,dragging:w,connectionInProgress:k,panBy:S,autoPanSpeed:E}=_i(Jet,rs),C=O&&(e||x),N=m.useRef(null),_=m.useRef(),j=m.useRef(new Set),A=m.useRef(new Set),F=m.useRef(!1),T=m.useRef({x:0,y:0}),P=m.useRef(!1),R=se=>{if(F.current||k){F.current=!1;return}u==null||u(se),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},L=se=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){se.preventDefault();return}d==null||d(se)},M=f?se=>f(se):void 0,U=se=>{F.current&&(se.stopPropagation(),F.current=!1)},I=se=>{var Je,De;const{domNode:re,transform:ge}=y.getState();if(_.current=re==null?void 0:re.getBoundingClientRect(),!_.current)return;const G=se.target===N.current;if(!G&&!!se.target.closest(".nokey")||!e||!(a&&G||t)||se.button!==0||!se.isPrimary)return;(De=(Je=se.target)==null?void 0:Je.setPointerCapture)==null||De.call(Je,se.pointerId),F.current=!1;const{x:ue,y:xe}=_u(se.nativeEvent,_.current),Ee=$x({x:ue,y:xe},ge);y.setState({userSelectionRect:{width:0,height:0,startX:Ee.x,startY:Ee.y,x:ue,y:xe}}),G||(se.stopPropagation(),se.preventDefault())};function H(se,re){const{userSelectionRect:ge}=y.getState();if(!ge)return;const{transform:G,nodeLookup:K,edgeLookup:ae,connectionLookup:ue,triggerNodeChanges:xe,triggerEdgeChanges:Ee,defaultEdgeOptions:Je}=y.getState(),De={x:ge.startX,y:ge.startY},{x:Pe,y:Ne}=Wv(De,G),Ke={startX:De.x,startY:De.y,x:seBe.id)),A.current=new Set;const Ie=(Je==null?void 0:Je.selectable)??!0;for(const Be of j.current){const J=ue.get(Be);if(J)for(const{edgeId:pe}of J.values()){const oe=ae.get(pe);oe&&(oe.selectable??Ie)&&A.current.add(pe)}}if(!MG(wt,j.current)){const Be=_y(K,j.current,!0);xe(Be)}if(!MG(ot,A.current)){const Be=_y(ae,A.current);Ee(Be)}y.setState({userSelectionRect:Ke,userSelectionActive:!0,nodesSelectionActive:!1})}function Z(){if(!r||!_.current)return;const[se,re]=sB(T.current,_.current,E);S({x:se,y:re}).then(ge=>{if(!F.current||!ge){v.current=requestAnimationFrame(Z);return}const{x:G,y:K}=T.current;H(G,K),v.current=requestAnimationFrame(Z)})}const Q=()=>{cancelAnimationFrame(v.current),v.current=0,P.current=!1};m.useEffect(()=>()=>Q(),[]);const q=se=>{const{userSelectionRect:re,transform:ge,resetSelectedElements:G}=y.getState();if(!_.current||!re)return;const{x:K,y:ae}=_u(se.nativeEvent,_.current);T.current={x:K,y:ae};const ue=Wv({x:re.startX,y:re.startY},ge);if(!F.current){const xe=t?0:s;if(Math.hypot(K-ue.x,ae-ue.y)<=xe)return;G(),l==null||l(se)}F.current=!0,P.current||(Z(),P.current=!0),H(K,ae)},B=se=>{var re,ge;se.button===0&&((ge=(re=se.target)==null?void 0:re.releasePointerCapture)==null||ge.call(re,se.pointerId),!x&&se.target===N.current&&y.getState().userSelectionRect&&(R==null||R(se)),y.setState({userSelectionActive:!1,userSelectionRect:null}),F.current&&(c==null||c(se),y.setState({nodesSelectionActive:j.current.size>0})),Q())},te=se=>{var re,ge;(ge=(re=se.target)==null?void 0:re.releasePointerCapture)==null||ge.call(re,se.pointerId),Q()},ce=i===!0||Array.isArray(i)&&i.includes(0);return o.jsxs("div",{className:ta(["react-flow__pane",{draggable:ce,dragging:w,selection:e}]),onClick:C?void 0:sM(R,N),onContextMenu:sM(L,N),onWheel:sM(M,N),onPointerEnter:C?void 0:h,onPointerMove:C?q:p,onPointerUp:C?B:void 0,onPointerCancel:C?te:void 0,onPointerDownCapture:C?I:void 0,onClickCapture:C?U:void 0,onPointerLeave:g,ref:N,style:FR,children:[b,o.jsx(Zet,{})]})}function d6({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:r,unselectNodesAndEdges:s,multiSelectionActive:a,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",Fu.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&a)&&(s({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=i==null?void 0:i.current)==null?void 0:d.blur()})):r([e])}function hwe({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:r,isSelectable:s,nodeClickDistance:a}){const l=ss(),[c,u]=m.useState(!1),d=m.useRef();return m.useEffect(()=>{d.current=PJe({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{d6({id:f,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),m.useEffect(()=>{if(!(t||!e.current||!d.current))return d.current.update({noDragClassName:n,handleSelector:i,domNode:e.current,isSelectable:s,nodeId:r,nodeClickDistance:a}),()=>{var f;(f=d.current)==null||f.destroy()}},[n,i,t,s,e,r,a]),c}const ttt=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function pwe(){const e=ss();return m.useCallback(n=>{const{nodeExtent:i,snapToGrid:r,snapGrid:s,nodesDraggable:a,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=ttt(a),p=r?s[0]:5,g=r?s[1]:5,b=n.direction.x*p*n.factor,v=n.direction.y*g*n.factor;for(const[,y]of u){if(!h(y))continue;let x={x:y.internals.positionAbsolute.x+b,y:y.internals.positionAbsolute.y+v};r&&(x=rE(x,s));const{position:O,positionAbsolute:w}=R1e({nodeId:y.id,nextPosition:x,nodeLookup:u,nodeExtent:i,nodeOrigin:d,onError:l});y.position=O,y.internals.positionAbsolute=w,f.set(y.id,y)}c(f)},[])}const pB=m.createContext(null),ntt=pB.Provider;pB.Consumer;const mwe=()=>m.useContext(pB),itt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),rtt=(e,t,n)=>i=>{const{connectionClickStartHandle:r,connectionMode:s,connection:a}=i,{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:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.id)===t&&(r==null?void 0:r.type)===n,isPossibleEndHandle:s===Vv.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:!!r,valid:d&&u}};function stt({type:e="source",position:t=an.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:r=!0,isConnectableEnd:s=!0,id:a,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},p){var P,R;const g=a||null,b=e==="target",v=ss(),y=mwe(),{connectOnClick:x,noPanClassName:O,rfId:w}=_i(itt,rs),{connectingFrom:k,connectingTo:S,clickConnecting:E,isPossibleEndHandle:C,connectionInProcess:N,clickConnectionInProcess:_,valid:j}=_i(rtt(y,g,e),rs);y||(R=(P=v.getState()).onError)==null||R.call(P,"010",Fu.error010());const A=L=>{const{defaultEdgeOptions:M,onConnect:U,hasDefaultEdges:I}=v.getState(),H={...M,...L};if(I){const{edges:Z,setEdges:Q,onError:q}=v.getState();Q(Fet(H,Z,{onError:q}))}U==null||U(H),l==null||l(H)},F=L=>{if(!y)return;const M=F1e(L.nativeEvent);if(r&&(M&&L.button===0||!M)){const U=v.getState();u6.onPointerDown(L.nativeEvent,{handleDomNode:L.currentTarget,autoPanOnConnect:U.autoPanOnConnect,connectionMode:U.connectionMode,connectionRadius:U.connectionRadius,domNode:U.domNode,nodeLookup:U.nodeLookup,lib:U.lib,isTarget:b,handleId:g,nodeId:y,flowId:U.rfId,panBy:U.panBy,cancelConnection:U.cancelConnection,onConnectStart:U.onConnectStart,onConnectEnd:(...I)=>{var H,Z;return(Z=(H=v.getState()).onConnectEnd)==null?void 0:Z.call(H,...I)},updateConnection:U.updateConnection,onConnect:A,isValidConnection:n||((...I)=>{var H,Z;return((Z=(H=v.getState()).isValidConnection)==null?void 0:Z.call(H,...I))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:U.autoPanSpeed,dragThreshold:U.connectionDragThreshold})}M?d==null||d(L):f==null||f(L)},T=L=>{const{onClickConnectStart:M,onClickConnectEnd:U,connectionClickStartHandle:I,connectionMode:H,isValidConnection:Z,lib:Q,rfId:q,nodeLookup:B,connection:te}=v.getState();if(!y||!I&&!r)return;if(!I){M==null||M(L.nativeEvent,{nodeId:y,handleId:g,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:y,type:e,id:g}});return}const ce=L1e(L.target),se=n||Z,{connection:re,isValid:ge}=u6.isValid(L.nativeEvent,{handle:{nodeId:y,id:g,type:e},connectionMode:H,fromNodeId:I.nodeId,fromHandleId:I.id||null,fromType:I.type,isValidConnection:se,flowId:q,doc:ce,lib:Q,nodeLookup:B});ge&&re&&A(re);const G=structuredClone(te);delete G.inProgress,G.toPosition=G.toHandle?G.toHandle.position:null,U==null||U(L,G),v.setState({connectionClickStartHandle:null})};return o.jsx("div",{"data-handleid":g,"data-nodeid":y,"data-handlepos":t,"data-id":`${w}-${y}-${g}-${e}`,className:ta(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",O,u,{source:!b,target:b,connectable:i,connectablestart:r,connectableend:s,clickconnecting:E,connectingfrom:k,connectingto:S,valid:j,connectionindicator:i&&(!N||C)&&(N||_?s:r)}]),onMouseDown:F,onTouchStart:F,onClick:x?T:void 0,ref:p,...h,children:c})}const fl=m.memo(dwe(stt));function att({data:e,isConnectable:t,sourcePosition:n=an.Bottom}){return o.jsxs(o.Fragment,{children:[e==null?void 0:e.label,o.jsx(fl,{type:"source",position:n,isConnectable:t})]})}function ott({data:e,isConnectable:t,targetPosition:n=an.Top,sourcePosition:i=an.Bottom}){return o.jsxs(o.Fragment,{children:[o.jsx(fl,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,o.jsx(fl,{type:"source",position:i,isConnectable:t})]})}function ltt(){return null}function ctt({data:e,isConnectable:t,targetPosition:n=an.Top}){return o.jsxs(o.Fragment,{children:[o.jsx(fl,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const eN={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},lK={input:att,default:ott,output:ctt,group:ltt};function utt(e){var t,n,i,r;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??((i=e.style)==null?void 0:i.width),height:e.height??((r=e.style)==null?void 0:r.height)}}const dtt=e=>{const{width:t,height:n,x:i,y:r}=iE(e.nodeLookup,{filter:s=>!!s.selected});return{width:Au(t)?t:null,height:Au(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${i}px,${r}px)`}};function ftt({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=ss(),{width:r,height:s,transformString:a,userSelectionActive:l}=_i(dtt,rs),c=pwe(),u=m.useRef(null);m.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]);const d=!l&&r!==null&&s!==null;if(hwe({nodeRef:u,disabled:!d}),!d)return null;const f=e?p=>{const g=i.getState().nodes.filter(b=>b.selected);e(p,g)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(eN,p.key)&&(p.preventDefault(),c({direction:eN[p.key],factor:p.shiftKey?4:1}))};return o.jsx("div",{className:ta(["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:r,height:s}})})}const cK=typeof window<"u"?window:void 0,htt=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function gwe({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:a,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:g,panActivationKeyCode:b,zoomActivationKeyCode:v,elementsSelectable:y,zoomOnScroll:x,zoomOnPinch:O,panOnScroll:w,panOnScrollSpeed:k,panOnScrollMode:S,zoomOnDoubleClick:E,panOnDrag:C,autoPanOnSelection:N,defaultViewport:_,translateExtent:j,minZoom:A,maxZoom:F,preventScrolling:T,onSelectionContextMenu:P,noWheelClassName:R,noPanClassName:L,disableKeyboardA11y:M,onViewportChange:U,isControlledViewport:I}){const{nodesSelectionActive:H,userSelectionActive:Z}=_i(htt,rs),Q=DS(u,{target:cK}),q=DS(b,{target:cK}),B=q||C,te=q||w,ce=d&&B!==!0,se=Q||Z||ce;return Wet({deleteKeyCode:c,multiSelectionKeyCode:g}),o.jsx(Xet,{onPaneContextMenu:s,elementsSelectable:y,zoomOnScroll:x,zoomOnPinch:O,panOnScroll:te,panOnScrollSpeed:k,panOnScrollMode:S,zoomOnDoubleClick:E,panOnDrag:!Q&&B,defaultViewport:_,translateExtent:j,minZoom:A,maxZoom:F,zoomActivationKeyCode:v,preventScrolling:T,noWheelClassName:R,noPanClassName:L,onViewportChange:U,isControlledViewport:I,paneClickDistance:l,selectionOnDrag:ce,children:o.jsxs(ett,{onSelectionStart:h,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:a,panOnDrag:B,autoPanOnSelection:N,isSelecting:!!se,selectionMode:f,selectionKeyPressed:Q,paneClickDistance:l,selectionOnDrag:ce,children:[e,H&&o.jsx(ftt,{onSelectionContextMenu:P,noPanClassName:L,disableKeyboardA11y:M})]})})}gwe.displayName="FlowRenderer";const ptt=m.memo(gwe),mtt=e=>t=>e?rB(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 gtt(e){return _i(m.useCallback(mtt(e),[e]),rs)}const btt=e=>e.updateNodeInternals;function ytt(){const e=_i(btt),[t]=m.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const i=new Map;n.forEach(r=>{const s=r.target.getAttribute("data-id");i.set(s,{id:s,nodeElement:r.target,force:!0})}),e(i)}));return m.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function vtt({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const r=ss(),s=m.useRef(null),a=m.useRef(null),l=m.useRef(e.sourcePosition),c=m.useRef(e.targetPosition),u=m.useRef(t),d=n&&!!e.internals.handleBounds;return m.useEffect(()=>{s.current&&!e.hidden&&(!d||a.current!==s.current)&&(a.current&&(i==null||i.unobserve(a.current)),i==null||i.observe(s.current),a.current=s.current)},[d,e.hidden]),m.useEffect(()=>()=>{a.current&&(i==null||i.unobserve(a.current),a.current=null)},[]),m.useEffect(()=>{if(s.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,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}function xtt({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:r,onContextMenu:s,onDoubleClick:a,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:p,disableKeyboardA11y:g,rfId:b,nodeTypes:v,nodeClickDistance:y,onError:x}){const{node:O,internals:w,isParent:k}=_i(se=>{const re=se.nodeLookup.get(e),ge=se.parentLookup.has(e);return{node:re,internals:re.internals,isParent:ge}},rs);let S=O.type||"default",E=(v==null?void 0:v[S])||lK[S];E===void 0&&(x==null||x("003",Fu.error003(S)),S="default",E=(v==null?void 0:v.default)||lK.default);const C=!!(O.draggable||l&&typeof O.draggable>"u"),N=!!(O.selectable||c&&typeof O.selectable>"u"),_=!!(O.connectable||u&&typeof O.connectable>"u"),j=!!(O.focusable||d&&typeof O.focusable>"u"),A=ss(),F=oB(O),T=vtt({node:O,nodeType:S,hasDimensions:F,resizeObserver:f}),P=hwe({nodeRef:T,disabled:O.hidden||!C,noDragClassName:h,handleSelector:O.dragHandle,nodeId:e,isSelectable:N,nodeClickDistance:y}),R=pwe();if(O.hidden)return null;const L=Fh(O),M=utt(O),U=N||C||t||n||i||r,I=n?se=>n(se,{...w.userNode}):void 0,H=i?se=>i(se,{...w.userNode}):void 0,Z=r?se=>r(se,{...w.userNode}):void 0,Q=s?se=>s(se,{...w.userNode}):void 0,q=a?se=>a(se,{...w.userNode}):void 0,B=se=>{const{selectNodesOnDrag:re,nodeDragThreshold:ge}=A.getState();N&&(!re||!C||ge>0)&&d6({id:e,store:A,nodeRef:T}),t&&t(se,{...w.userNode})},te=se=>{if(!($1e(se.nativeEvent)||g)){if(T1e.includes(se.key)&&N){const re=se.key==="Escape";d6({id:e,store:A,unselect:re,nodeRef:T})}else if(C&&O.selected&&Object.prototype.hasOwnProperty.call(eN,se.key)){se.preventDefault();const{ariaLabelConfig:re}=A.getState();A.setState({ariaLiveMessage:re["node.a11yDescription.ariaLiveMessage"]({direction:se.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),R({direction:eN[se.key],factor:se.shiftKey?4:1})}}},ce=()=>{var ue;if(g||!((ue=T.current)!=null&&ue.matches(":focus-visible")))return;const{transform:se,width:re,height:ge,autoPanOnNodeFocus:G,setCenter:K}=A.getState();if(!G)return;rB(new Map([[e,O]]),{x:0,y:0,width:re,height:ge},se,!0).length>0||K(O.position.x+L.width/2,O.position.y+L.height/2,{zoom:se[2]})};return o.jsx("div",{className:ta(["react-flow__node",`react-flow__node-${S}`,{[p]:C},O.className,{selected:O.selected,selectable:N,parent:k,draggable:C,dragging:P}]),ref:T,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:U?"all":"none",visibility:F?"visible":"hidden",...O.style,...M},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:I,onMouseMove:H,onMouseLeave:Z,onContextMenu:Q,onClick:B,onDoubleClick:q,onKeyDown:j?te:void 0,tabIndex:j?0:void 0,onFocus:j?ce:void 0,role:O.ariaRole??(j?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${swe}-${b}`,"aria-label":O.ariaLabel,...O.domAttributes,children:o.jsx(ntt,{value:e,children:o.jsx(E,{id:e,data:O.data,type:S,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:O.selected??!1,selectable:N,draggable:C,deletable:O.deletable??!0,isConnectable:_,sourcePosition:O.sourcePosition,targetPosition:O.targetPosition,dragging:P,dragHandle:O.dragHandle,zIndex:w.z,parentId:O.parentId,...L})})})}var wtt=m.memo(xtt);const Ott=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function bwe(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,onError:s}=_i(Ott,rs),a=gtt(e.onlyRenderVisibleElements),l=ytt();return o.jsx("div",{className:"react-flow__nodes",style:FR,children:a.map(c=>o.jsx(wtt,{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:i,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:s},c))})}bwe.displayName="NodeRenderer";const Stt=m.memo(bwe);function ktt(e){return _i(m.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const i=[];if(n.width&&n.height)for(const r of n.edges){const s=n.nodeLookup.get(r.source),a=n.nodeLookup.get(r.target);s&&a&&mJe({sourceNode:s,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&i.push(r.id)}return i},[e]),rs)}const Ett=({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"})},Ctt=({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"})},uK={[RS.Arrow]:Ett,[RS.ArrowClosed]:Ctt};function Ttt(e){const t=ss();return m.useMemo(()=>{var r,s;return Object.prototype.hasOwnProperty.call(uK,e)?uK[e]:((s=(r=t.getState()).onError)==null||s.call(r,"009",Fu.error009(e)),null)},[e])}const Att=({id:e,type:t,color:n,width:i=12.5,height:r=12.5,markerUnits:s="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{const c=Ttt(t);return c?o.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:l,refX:"0",refY:"0",children:o.jsx(c,{color:n,strokeWidth:a})}):null},ywe=({defaultColor:e,rfId:t})=>{const n=_i(s=>s.edges),i=_i(s=>s.defaultEdgeOptions),r=m.useMemo(()=>SJe(n,{id:t,defaultColor:e,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[n,i,t,e]);return r.length?o.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:o.jsx("defs",{children:r.map(s=>o.jsx(Att,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};ywe.displayName="MarkerDefinitions";var _tt=m.memo(ywe);function vwe({x:e,y:t,label:n,labelStyle:i,labelShowBg:r=!0,labelBgStyle:s,labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){const[f,h]=m.useState({x:1,y:0,width:0,height:0}),p=ta(["react-flow__edge-textwrapper",u]),g=m.useRef(null);return m.useEffect(()=>{if(g.current){const b=g.current.getBBox();h({x:b.x,y:b.y,width:b.width,height:b.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:[r&&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:s,rx:l,ry:l}),o.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:g,style:i,children:n}),c]}):null}vwe.displayName="EdgeText";const Ntt=m.memo(vwe);function sE({path:e,labelX:t,labelY:n,label:i,labelStyle:r,labelShowBg:s,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:ta(["react-flow__edge-path",d.className])}),u?o.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,i&&Au(t)&&Au(n)?o.jsx(Ntt,{x:t,y:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function dK({pos:e,x1:t,y1:n,x2:i,y2:r}){return e===an.Left||e===an.Right?[.5*(t+i),n]:[t,.5*(n+r)]}function xwe({sourceX:e,sourceY:t,sourcePosition:n=an.Bottom,targetX:i,targetY:r,targetPosition:s=an.Top}){const[a,l]=dK({pos:n,x1:e,y1:t,x2:i,y2:r}),[c,u]=dK({pos:s,x1:i,y1:r,x2:e,y2:t}),[d,f,h,p]=B1e({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${l} ${c},${u} ${i},${r}`,d,f,h,p]}function wwe(e){return m.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:a,targetPosition:l,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:b,markerStart:v,interactionWidth:y})=>{const[x,O,w]=xwe({sourceX:n,sourceY:i,sourcePosition:a,targetX:r,targetY:s,targetPosition:l}),k=e.isInternal?void 0:t;return o.jsx(sE,{id:k,path:x,labelX:O,labelY:w,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:b,markerStart:v,interactionWidth:y})})}const jtt=wwe({isInternal:!1}),Owe=wwe({isInternal:!0});jtt.displayName="SimpleBezierEdge";Owe.displayName="SimpleBezierEdgeInternal";function Swe(e){return m.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:p=an.Bottom,targetPosition:g=an.Top,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:x})=>{const[O,w,k]=J_({sourceX:n,sourceY:i,sourcePosition:p,targetX:r,targetY:s,targetPosition:g,borderRadius:y==null?void 0:y.borderRadius,offset:y==null?void 0:y.offset,stepPosition:y==null?void 0:y.stepPosition}),S=e.isInternal?void 0:t;return o.jsx(sE,{id:S,path:O,labelX:w,labelY:k,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:b,markerStart:v,interactionWidth:x})})}const kwe=Swe({isInternal:!1}),Ewe=Swe({isInternal:!0});kwe.displayName="SmoothStepEdge";Ewe.displayName="SmoothStepEdgeInternal";function Cwe(e){return m.memo(({id:t,...n})=>{var r;const i=e.isInternal?void 0:t;return o.jsx(kwe,{...n,id:i,pathOptions:m.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const Rtt=Cwe({isInternal:!1}),Twe=Cwe({isInternal:!0});Rtt.displayName="StepEdge";Twe.displayName="StepEdgeInternal";function Awe(e){return m.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:g,interactionWidth:b})=>{const[v,y,x]=z1e({sourceX:n,sourceY:i,targetX:r,targetY:s}),O=e.isInternal?void 0:t;return o.jsx(sE,{id:O,path:v,labelX:y,labelY:x,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:g,interactionWidth:b})})}const Itt=Awe({isInternal:!1}),_we=Awe({isInternal:!0});Itt.displayName="StraightEdge";_we.displayName="StraightEdgeInternal";function Nwe(e){return m.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:a=an.Bottom,targetPosition:l=an.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:x})=>{const[O,w,k]=U1e({sourceX:n,sourceY:i,sourcePosition:a,targetX:r,targetY:s,targetPosition:l,curvature:y==null?void 0:y.curvature}),S=e.isInternal?void 0:t;return o.jsx(sE,{id:S,path:O,labelX:w,labelY:k,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:b,markerStart:v,interactionWidth:x})})}const Ptt=Nwe({isInternal:!1}),jwe=Nwe({isInternal:!0});Ptt.displayName="BezierEdge";jwe.displayName="BezierEdgeInternal";const fK={default:jwe,straight:_we,step:Twe,smoothstep:Ewe,simplebezier:Owe},hK={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Dtt=(e,t,n)=>n===an.Left?e-t:n===an.Right?e+t:e,Mtt=(e,t,n)=>n===an.Top?e-t:n===an.Bottom?e+t:e,pK="react-flow__edgeupdater";function mK({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:r,onMouseEnter:s,onMouseOut:a,type:l}){return o.jsx("circle",{onMouseDown:r,onMouseEnter:s,onMouseOut:a,className:ta([pK,`${pK}-${l}`]),cx:Dtt(t,i,e),cy:Mtt(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function Ltt({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:r,targetX:s,targetY:a,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:p}){const g=ss(),b=(w,k)=>{if(w.button!==0)return;const{autoPanOnConnect:S,domNode:E,connectionMode:C,connectionRadius:N,lib:_,onConnectStart:j,cancelConnection:A,nodeLookup:F,rfId:T,panBy:P,updateConnection:R}=g.getState(),L=k.type==="target",M=(H,Z)=>{h(!1),f==null||f(H,n,k.type,Z)},U=H=>u==null?void 0:u(n,H),I=(H,Z)=>{h(!0),d==null||d(w,n,k.type),j==null||j(H,Z)};u6.onPointerDown(w.nativeEvent,{autoPanOnConnect:S,connectionMode:C,connectionRadius:N,domNode:E,handleId:k.id,nodeId:k.nodeId,nodeLookup:F,isTarget:L,edgeUpdaterType:k.type,lib:_,flowId:T,cancelConnection:A,panBy:P,isValidConnection:(...H)=>{var Z,Q;return((Q=(Z=g.getState()).isValidConnection)==null?void 0:Q.call(Z,...H))??!0},onConnect:U,onConnectStart:I,onConnectEnd:(...H)=>{var Z,Q;return(Q=(Z=g.getState()).onConnectEnd)==null?void 0:Q.call(Z,...H)},onReconnectEnd:M,updateConnection:R,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:w.currentTarget})},v=w=>b(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),y=w=>b(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),x=()=>p(!0),O=()=>p(!1);return o.jsxs(o.Fragment,{children:[(e===!0||e==="source")&&o.jsx(mK,{position:l,centerX:i,centerY:r,radius:t,onMouseDown:v,onMouseEnter:x,onMouseOut:O,type:"source"}),(e===!0||e==="target")&&o.jsx(mK,{position:c,centerX:s,centerY:a,radius:t,onMouseDown:y,onMouseEnter:x,onMouseOut:O,type:"target"})]})}function $tt({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:r,onDoubleClick:s,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,rfId:g,edgeTypes:b,noPanClassName:v,onError:y,disableKeyboardA11y:x}){let O=_i(K=>K.edgeLookup.get(e));const w=_i(K=>K.defaultEdgeOptions);O=w?{...w,...O}:O;let k=O.type||"default",S=(b==null?void 0:b[k])||fK[k];S===void 0&&(y==null||y("011",Fu.error011(k)),k="default",S=(b==null?void 0:b.default)||fK.default);const E=!!(O.focusable||t&&typeof O.focusable>"u"),C=typeof f<"u"&&(O.reconnectable||n&&typeof O.reconnectable>"u"),N=!!(O.selectable||i&&typeof O.selectable>"u"),_=m.useRef(null),[j,A]=m.useState(!1),[F,T]=m.useState(!1),P=ss(),{zIndex:R,sourceX:L,sourceY:M,targetX:U,targetY:I,sourcePosition:H,targetPosition:Z}=_i(m.useCallback(K=>{const ae=K.nodeLookup.get(O.source),ue=K.nodeLookup.get(O.target);if(!ae||!ue)return{zIndex:O.zIndex,...hK};const xe=OJe({id:e,sourceNode:ae,targetNode:ue,sourceHandle:O.sourceHandle||null,targetHandle:O.targetHandle||null,connectionMode:K.connectionMode,onError:y});return{zIndex:pJe({selected:O.selected,zIndex:O.zIndex,sourceNode:ae,targetNode:ue,elevateOnSelect:K.elevateEdgesOnSelect,zIndexMode:K.zIndexMode}),...xe||hK}},[O.source,O.target,O.sourceHandle,O.targetHandle,O.selected,O.zIndex]),rs),Q=m.useMemo(()=>O.markerStart?`url('#${l6(O.markerStart,g)}')`:void 0,[O.markerStart,g]),q=m.useMemo(()=>O.markerEnd?`url('#${l6(O.markerEnd,g)}')`:void 0,[O.markerEnd,g]);if(O.hidden||L===null||M===null||U===null||I===null)return null;const B=K=>{var Ee;const{addSelectedEdges:ae,unselectNodesAndEdges:ue,multiSelectionActive:xe}=P.getState();N&&(P.setState({nodesSelectionActive:!1}),O.selected&&xe?(ue({nodes:[],edges:[O]}),(Ee=_.current)==null||Ee.blur()):ae([e])),r&&r(K,O)},te=s?K=>{s(K,{...O})}:void 0,ce=a?K=>{a(K,{...O})}:void 0,se=l?K=>{l(K,{...O})}:void 0,re=c?K=>{c(K,{...O})}:void 0,ge=u?K=>{u(K,{...O})}:void 0,G=K=>{var ae;if(!x&&T1e.includes(K.key)&&N){const{unselectNodesAndEdges:ue,addSelectedEdges:xe}=P.getState();K.key==="Escape"?((ae=_.current)==null||ae.blur(),ue({edges:[O]})):xe([e])}};return o.jsx("svg",{style:{zIndex:R},children:o.jsxs("g",{className:ta(["react-flow__edge",`react-flow__edge-${k}`,O.className,v,{selected:O.selected,animated:O.animated,inactive:!N&&!r,updating:j,selectable:N}]),onClick:B,onDoubleClick:te,onContextMenu:ce,onMouseEnter:se,onMouseMove:re,onMouseLeave:ge,onKeyDown:E?G:void 0,tabIndex:E?0:void 0,role:O.ariaRole??(E?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":O.ariaLabel===null?void 0:O.ariaLabel||`Edge from ${O.source} to ${O.target}`,"aria-describedby":E?`${awe}-${g}`:void 0,ref:_,...O.domAttributes,children:[!F&&o.jsx(S,{id:e,source:O.source,target:O.target,type:O.type,selected:O.selected,animated:O.animated,selectable:N,deletable:O.deletable??!0,label:O.label,labelStyle:O.labelStyle,labelShowBg:O.labelShowBg,labelBgStyle:O.labelBgStyle,labelBgPadding:O.labelBgPadding,labelBgBorderRadius:O.labelBgBorderRadius,sourceX:L,sourceY:M,targetX:U,targetY:I,sourcePosition:H,targetPosition:Z,data:O.data,style:O.style,sourceHandleId:O.sourceHandle,targetHandleId:O.targetHandle,markerStart:Q,markerEnd:q,pathOptions:"pathOptions"in O?O.pathOptions:void 0,interactionWidth:O.interactionWidth}),C&&o.jsx(Ltt,{edge:O,isReconnectable:C,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,sourceX:L,sourceY:M,targetX:U,targetY:I,sourcePosition:H,targetPosition:Z,setUpdateHover:A,setReconnecting:T})]})})}var Ftt=m.memo($tt);const Btt=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Rwe({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:r,onReconnect:s,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:p,onReconnectEnd:g,disableKeyboardA11y:b}){const{edgesFocusable:v,edgesReconnectable:y,elementsSelectable:x,onError:O}=_i(Btt,rs),w=ktt(t);return o.jsxs("div",{className:"react-flow__edges",children:[o.jsx(_tt,{defaultColor:e,rfId:n}),w.map(k=>o.jsx(Ftt,{id:k,edgesFocusable:v,edgesReconnectable:y,elementsSelectable:x,noPanClassName:r,onReconnect:s,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:p,onReconnectEnd:g,rfId:n,onError:O,edgeTypes:i,disableKeyboardA11y:b},k))]})}Rwe.displayName="EdgeRenderer";const Utt=m.memo(Rwe),Qtt=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function ztt({children:e}){const t=_i(Qtt);return o.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Vtt(e){const t=$R(),n=m.useRef(!1);m.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Htt=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function qtt(e){const t=_i(Htt),n=ss();return m.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Wtt(e){return e.connection.inProgress?{...e.connection,to:$x(e.connection.to,e.transform)}:{...e.connection}}function Gtt(e){return Wtt}function Ktt(e){const t=Gtt();return _i(t,rs)}const Xtt=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Ytt({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:r,width:s,height:a,isValid:l,inProgress:c}=_i(Xtt,rs);return!(s&&r&&c)?null:o.jsx("svg",{style:e,width:s,height:a,className:"react-flow__connectionline react-flow__container",children:o.jsx("g",{className:ta(["react-flow__connection",N1e(l)]),children:o.jsx(Iwe,{style:t,type:n,CustomComponent:i,isValid:l})})})}const Iwe=({style:e,type:t=Np.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:r,from:s,fromNode:a,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h,pointer:p}=Ktt();if(!r)return;if(n)return o.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:l,fromX:s.x,fromY:s.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:N1e(i),toNode:d,toHandle:f,pointer:p});let g="";const b={sourceX:s.x,sourceY:s.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case Np.Bezier:[g]=U1e(b);break;case Np.SimpleBezier:[g]=xwe(b);break;case Np.Step:[g]=J_({...b,borderRadius:0});break;case Np.SmoothStep:[g]=J_(b);break;default:[g]=z1e(b)}return o.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};Iwe.displayName="ConnectionLine";const Ztt={};function gK(e=Ztt){m.useRef(e),ss(),m.useEffect(()=>{},[e])}function Jtt(){ss(),m.useRef(!1),m.useEffect(()=>{},[])}function Pwe({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:r,onNodeDoubleClick:s,onEdgeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:p,connectionLineType:g,connectionLineStyle:b,connectionLineComponent:v,connectionLineContainerStyle:y,selectionKeyCode:x,selectionOnDrag:O,selectionMode:w,multiSelectionKeyCode:k,panActivationKeyCode:S,zoomActivationKeyCode:E,deleteKeyCode:C,onlyRenderVisibleElements:N,elementsSelectable:_,defaultViewport:j,translateExtent:A,minZoom:F,maxZoom:T,preventScrolling:P,defaultMarkerColor:R,zoomOnScroll:L,zoomOnPinch:M,panOnScroll:U,panOnScrollSpeed:I,panOnScrollMode:H,zoomOnDoubleClick:Z,panOnDrag:Q,autoPanOnSelection:q,onPaneClick:B,onPaneMouseEnter:te,onPaneMouseMove:ce,onPaneMouseLeave:se,onPaneScroll:re,onPaneContextMenu:ge,paneClickDistance:G,nodeClickDistance:K,onEdgeContextMenu:ae,onEdgeMouseEnter:ue,onEdgeMouseMove:xe,onEdgeMouseLeave:Ee,reconnectRadius:Je,onReconnect:De,onReconnectStart:Pe,onReconnectEnd:Ne,noDragClassName:Ke,noWheelClassName:wt,noPanClassName:ot,disableKeyboardA11y:Ie,nodeExtent:Be,rfId:J,viewport:pe,onViewportChange:oe}){return gK(e),gK(t),Jtt(),Vtt(n),qtt(pe),o.jsx(ptt,{onPaneClick:B,onPaneMouseEnter:te,onPaneMouseMove:ce,onPaneMouseLeave:se,onPaneContextMenu:ge,onPaneScroll:re,paneClickDistance:G,deleteKeyCode:C,selectionKeyCode:x,selectionOnDrag:O,selectionMode:w,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:k,panActivationKeyCode:S,zoomActivationKeyCode:E,elementsSelectable:_,zoomOnScroll:L,zoomOnPinch:M,zoomOnDoubleClick:Z,panOnScroll:U,panOnScrollSpeed:I,panOnScrollMode:H,panOnDrag:Q,autoPanOnSelection:q,defaultViewport:j,translateExtent:A,minZoom:F,maxZoom:T,onSelectionContextMenu:f,preventScrolling:P,noDragClassName:Ke,noWheelClassName:wt,noPanClassName:ot,disableKeyboardA11y:Ie,onViewportChange:oe,isControlledViewport:!!pe,children:o.jsxs(ztt,{children:[o.jsx(Utt,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:a,onReconnect:De,onReconnectStart:Pe,onReconnectEnd:Ne,onlyRenderVisibleElements:N,onEdgeContextMenu:ae,onEdgeMouseEnter:ue,onEdgeMouseMove:xe,onEdgeMouseLeave:Ee,reconnectRadius:Je,defaultMarkerColor:R,noPanClassName:ot,disableKeyboardA11y:Ie,rfId:J}),o.jsx(Ytt,{style:b,type:g,component:v,containerStyle:y}),o.jsx("div",{className:"react-flow__edgelabel-renderer"}),o.jsx(Stt,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:K,onlyRenderVisibleElements:N,noPanClassName:ot,noDragClassName:Ke,disableKeyboardA11y:Ie,nodeExtent:Be,rfId:J}),o.jsx("div",{className:"react-flow__viewport-portal"})]})})}Pwe.displayName="GraphView";const ent=m.memo(Pwe),tnt=D1e(),bK=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:a,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const p=new Map,g=new Map,b=new Map,v=new Map,y=i??t??[],x=n??e??[],O=d??[0,0],w=f??NS;q1e(b,v,y);const{nodesInitialized:k}=c6(x,p,g,{nodeOrigin:O,nodeExtent:w,zIndexMode:h});let S=[0,0,1];if(a&&r&&s){const E=iE(p,{filter:j=>!!((j.width||j.initialWidth)&&(j.height||j.initialHeight))}),{x:C,y:N,zoom:_}=aB(E,r,s,c,u,(l==null?void 0:l.padding)??.1);S=[C,N,_]}return{rfId:"1",width:r??0,height:s??0,transform:S,nodes:x,nodesInitialized:k,nodeLookup:p,parentLookup:g,edges:y,edgeLookup:v,connectionLookup:b,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:NS,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Vv.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:O,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:{..._1e},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:tnt,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:A1e,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},nnt=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>get((p,g)=>{async function b(){const{nodeLookup:v,panZoom:y,fitViewOptions:x,fitViewResolver:O,width:w,height:k,minZoom:S,maxZoom:E}=g();y&&(await oJe({nodes:v,width:w,height:k,panZoom:y,minZoom:S,maxZoom:E},x),O==null||O.resolve(!0),p({fitViewResolver:null}))}return{...bK({nodes:e,edges:t,width:r,height:s,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:i,zIndexMode:h}),setNodes:v=>{const{nodeLookup:y,parentLookup:x,nodeOrigin:O,elevateNodesOnSelect:w,fitViewQueued:k,zIndexMode:S,nodesSelectionActive:E}=g(),{nodesInitialized:C,hasSelectedNodes:N}=c6(v,y,x,{nodeOrigin:O,nodeExtent:f,elevateNodesOnSelect:w,checkEquality:!0,zIndexMode:S}),_=E&&N;k&&C?(b(),p({nodes:v,nodesInitialized:C,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:_})):p({nodes:v,nodesInitialized:C,nodesSelectionActive:_})},setEdges:v=>{const{connectionLookup:y,edgeLookup:x}=g();q1e(y,x,v),p({edges:v})},setDefaultNodesAndEdges:(v,y)=>{if(v){const{setNodes:x}=g();x(v),p({hasDefaultNodes:!0})}if(y){const{setEdges:x}=g();x(y),p({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:y,nodeLookup:x,parentLookup:O,domNode:w,nodeOrigin:k,nodeExtent:S,debug:E,fitViewQueued:C,zIndexMode:N}=g(),{changes:_,updatedInternals:j}=NJe(v,x,O,w,k,S,N);j&&(CJe(x,O,{nodeOrigin:k,nodeExtent:S,zIndexMode:N}),C?(b(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(_==null?void 0:_.length)>0&&(E&&console.log("React Flow: trigger node changes",_),y==null||y(_)))},updateNodePositions:(v,y=!1)=>{const x=[];let O=[];const{nodeLookup:w,triggerNodeChanges:k,connection:S,updateConnection:E,onNodesChangeMiddlewareMap:C}=g();for(const[N,_]of v){const j=w.get(N),A=!!(j!=null&&j.expandParent&&(j!=null&&j.parentId)&&(_!=null&&_.position)),F={id:N,type:"position",position:A?{x:Math.max(0,_.position.x),y:Math.max(0,_.position.y)}:_.position,dragging:y};if(j&&S.inProgress&&S.fromNode.id===j.id){const T=kb(j,S.fromHandle,an.Left,!0);E({...S,from:T})}A&&j.parentId&&x.push({id:N,parentId:j.parentId,rect:{..._.internals.positionAbsolute,width:_.measured.width??0,height:_.measured.height??0}}),O.push(F)}if(x.length>0){const{parentLookup:N,nodeOrigin:_}=g(),j=hB(x,w,N,_);O.push(...j)}for(const N of C.values())O=N(O);k(O)},triggerNodeChanges:v=>{const{onNodesChange:y,setNodes:x,nodes:O,hasDefaultNodes:w,debug:k}=g();if(v!=null&&v.length){if(w){const S=cwe(v,O);x(S)}k&&console.log("React Flow: trigger node changes",v),y==null||y(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:y,setEdges:x,edges:O,hasDefaultEdges:w,debug:k}=g();if(v!=null&&v.length){if(w){const S=uwe(v,O);x(S)}k&&console.log("React Flow: trigger edge changes",v),y==null||y(v)}},addSelectedNodes:v=>{const{multiSelectionActive:y,edgeLookup:x,nodeLookup:O,triggerNodeChanges:w,triggerEdgeChanges:k}=g();if(y){const S=v.map(E=>Og(E,!0));w(S);return}w(_y(O,new Set([...v]),!0)),k(_y(x))},addSelectedEdges:v=>{const{multiSelectionActive:y,edgeLookup:x,nodeLookup:O,triggerNodeChanges:w,triggerEdgeChanges:k}=g();if(y){const S=v.map(E=>Og(E,!0));k(S);return}k(_y(x,new Set([...v]))),w(_y(O,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:y}={})=>{const{edges:x,nodes:O,nodeLookup:w,triggerNodeChanges:k,triggerEdgeChanges:S}=g(),E=v||O,C=y||x,N=[];for(const j of E){if(!j.selected)continue;const A=w.get(j.id);A&&(A.selected=!1),N.push(Og(j.id,!1))}const _=[];for(const j of C)j.selected&&_.push(Og(j.id,!1));k(N),S(_)},setMinZoom:v=>{const{panZoom:y,maxZoom:x}=g();y==null||y.setScaleExtent([v,x]),p({minZoom:v})},setMaxZoom:v=>{const{panZoom:y,minZoom:x}=g();y==null||y.setScaleExtent([x,v]),p({maxZoom:v})},setTranslateExtent:v=>{var y;(y=g().panZoom)==null||y.setTranslateExtent(v),p({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:y,triggerNodeChanges:x,triggerEdgeChanges:O,elementsSelectable:w}=g();if(!w)return;const k=y.reduce((E,C)=>C.selected?[...E,Og(C.id,!1)]:E,[]),S=v.reduce((E,C)=>C.selected?[...E,Og(C.id,!1)]:E,[]);x(k),O(S)},setNodeExtent:v=>{const{nodes:y,nodeLookup:x,parentLookup:O,nodeOrigin:w,elevateNodesOnSelect:k,nodeExtent:S,zIndexMode:E}=g();v[0][0]===S[0][0]&&v[0][1]===S[0][1]&&v[1][0]===S[1][0]&&v[1][1]===S[1][1]||(c6(y,x,O,{nodeOrigin:w,nodeExtent:v,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:E}),p({nodeExtent:v}))},panBy:v=>{const{transform:y,width:x,height:O,panZoom:w,translateExtent:k}=g();return jJe({delta:v,panZoom:w,transform:y,translateExtent:k,width:x,height:O})},setCenter:async(v,y,x)=>{const{width:O,height:w,maxZoom:k,panZoom:S}=g();if(!S)return!1;const E=typeof(x==null?void 0:x.zoom)<"u"?x.zoom:k;return await S.setViewport({x:O/2-v*E,y:w/2-y*E,zoom:E},{duration:x==null?void 0:x.duration,ease:x==null?void 0:x.ease,interpolate:x==null?void 0:x.interpolate}),!0},cancelConnection:()=>{p({connection:{..._1e}})},updateConnection:v=>{p({connection:v})},reset:()=>p({...bK()})}},Object.is);function Dwe({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:r,initialHeight:s,initialMinZoom:a,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:p}){const[g]=m.useState(()=>nnt({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:u,minZoom:a,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return o.jsx(bet,{value:g,children:o.jsx(zet,{children:p})})}function int({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:r,width:s,height:a,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p}){return m.useContext(MR)?o.jsx(o.Fragment,{children:e}):o.jsx(Dwe,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:r,initialWidth:s,initialHeight:a,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p,children:e})}const rnt={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function snt({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:r,nodeTypes:s,edgeTypes:a,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:p,onConnectStart:g,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,onNodeMouseEnter:x,onNodeMouseMove:O,onNodeMouseLeave:w,onNodeContextMenu:k,onNodeDoubleClick:S,onNodeDragStart:E,onNodeDrag:C,onNodeDragStop:N,onNodesDelete:_,onEdgesDelete:j,onDelete:A,onSelectionChange:F,onSelectionDragStart:T,onSelectionDrag:P,onSelectionDragStop:R,onSelectionContextMenu:L,onSelectionStart:M,onSelectionEnd:U,onBeforeDelete:I,connectionMode:H,connectionLineType:Z=Np.Bezier,connectionLineStyle:Q,connectionLineComponent:q,connectionLineContainerStyle:B,deleteKeyCode:te="Backspace",selectionKeyCode:ce="Shift",selectionOnDrag:se=!1,selectionMode:re=jS.Full,panActivationKeyCode:ge="Space",multiSelectionKeyCode:G=PS()?"Meta":"Control",zoomActivationKeyCode:K=PS()?"Meta":"Control",snapToGrid:ae,snapGrid:ue,onlyRenderVisibleElements:xe=!1,selectNodesOnDrag:Ee,nodesDraggable:Je,autoPanOnNodeFocus:De,nodesConnectable:Pe,nodesFocusable:Ne,nodeOrigin:Ke=owe,edgesFocusable:wt,edgesReconnectable:ot,elementsSelectable:Ie=!0,defaultViewport:Be=jet,minZoom:J=.5,maxZoom:pe=2,translateExtent:oe=NS,preventScrolling:Me=!0,nodeExtent:Ve,defaultMarkerColor:ht="#b1b1b7",zoomOnScroll:Se=!0,zoomOnPinch:ve=!0,panOnScroll:$e=!1,panOnScrollSpeed:qe=.5,panOnScrollMode:ke=rb.Free,zoomOnDoubleClick:Tt=!0,panOnDrag:Jt=!0,onPaneClick:on,onPaneMouseEnter:Et,onPaneMouseMove:Bt,onPaneMouseLeave:rt,onPaneScroll:gt,onPaneContextMenu:je,paneClickDistance:Ot=1,nodeClickDistance:yt=0,children:Dt,onReconnect:Ft,onReconnectStart:Fe,onReconnectEnd:dt,onEdgeContextMenu:$t,onEdgeDoubleClick:Qe,onEdgeMouseEnter:ut,onEdgeMouseMove:bt,onEdgeMouseLeave:it,reconnectRadius:xt=10,onNodesChange:W,onEdgesChange:pt,noDragClassName:Re="nodrag",noWheelClassName:ze="nowheel",noPanClassName:st="nopan",fitView:me,fitViewOptions:We,connectOnClick:St,attributionPosition:vn,proOptions:Ki,defaultEdgeOptions:Le,elevateNodesOnSelect:Mt=!0,elevateEdgesOnSelect:pn=!1,disableKeyboardA11y:en=!1,autoPanOnConnect:tn,autoPanOnNodeDrag:Un,autoPanOnSelection:xn=!0,autoPanSpeed:oi,connectionRadius:Oi,isValidConnection:mi,onError:bn,style:qi,id:ri,nodeDragThreshold:zi,connectionDragThreshold:as,viewport:Lr,onViewportChange:_r,width:xs,height:os,colorMode:ia="light",debug:Nr,onScroll:As,ariaLabelConfig:Vs,zIndexMode:Yr="basic",...ra},sa){const ls=ri||"1",va=Det(ia),aa=m.useCallback(ws=>{ws.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),As==null||As(ws)},[As]);return o.jsx("div",{"data-testid":"rf__wrapper",...ra,onScroll:aa,style:{...qi,...rnt},ref:sa,className:ta(["react-flow",r,va]),id:ri,role:"application",children:o.jsxs(int,{nodes:e,edges:t,width:xs,height:os,fitView:me,fitViewOptions:We,minZoom:J,maxZoom:pe,nodeOrigin:Ke,nodeExtent:Ve,zIndexMode:Yr,children:[o.jsx(Pet,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:p,onConnectStart:g,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,nodesDraggable:Je,autoPanOnNodeFocus:De,nodesConnectable:Pe,nodesFocusable:Ne,edgesFocusable:wt,edgesReconnectable:ot,elementsSelectable:Ie,elevateNodesOnSelect:Mt,elevateEdgesOnSelect:pn,minZoom:J,maxZoom:pe,nodeExtent:Ve,onNodesChange:W,onEdgesChange:pt,snapToGrid:ae,snapGrid:ue,connectionMode:H,translateExtent:oe,connectOnClick:St,defaultEdgeOptions:Le,fitView:me,fitViewOptions:We,onNodesDelete:_,onEdgesDelete:j,onDelete:A,onNodeDragStart:E,onNodeDrag:C,onNodeDragStop:N,onSelectionDrag:P,onSelectionDragStart:T,onSelectionDragStop:R,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:st,nodeOrigin:Ke,rfId:ls,autoPanOnConnect:tn,autoPanOnNodeDrag:Un,autoPanSpeed:oi,onError:bn,connectionRadius:Oi,isValidConnection:mi,selectNodesOnDrag:Ee,nodeDragThreshold:zi,connectionDragThreshold:as,onBeforeDelete:I,debug:Nr,ariaLabelConfig:Vs,zIndexMode:Yr}),o.jsx(ent,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:x,onNodeMouseMove:O,onNodeMouseLeave:w,onNodeContextMenu:k,onNodeDoubleClick:S,nodeTypes:s,edgeTypes:a,connectionLineType:Z,connectionLineStyle:Q,connectionLineComponent:q,connectionLineContainerStyle:B,selectionKeyCode:ce,selectionOnDrag:se,selectionMode:re,deleteKeyCode:te,multiSelectionKeyCode:G,panActivationKeyCode:ge,zoomActivationKeyCode:K,onlyRenderVisibleElements:xe,defaultViewport:Be,translateExtent:oe,minZoom:J,maxZoom:pe,preventScrolling:Me,zoomOnScroll:Se,zoomOnPinch:ve,zoomOnDoubleClick:Tt,panOnScroll:$e,panOnScrollSpeed:qe,panOnScrollMode:ke,panOnDrag:Jt,autoPanOnSelection:xn,onPaneClick:on,onPaneMouseEnter:Et,onPaneMouseMove:Bt,onPaneMouseLeave:rt,onPaneScroll:gt,onPaneContextMenu:je,paneClickDistance:Ot,nodeClickDistance:yt,onSelectionContextMenu:L,onSelectionStart:M,onSelectionEnd:U,onReconnect:Ft,onReconnectStart:Fe,onReconnectEnd:dt,onEdgeContextMenu:$t,onEdgeDoubleClick:Qe,onEdgeMouseEnter:ut,onEdgeMouseMove:bt,onEdgeMouseLeave:it,reconnectRadius:xt,defaultMarkerColor:ht,noDragClassName:Re,noWheelClassName:ze,noPanClassName:st,rfId:ls,disableKeyboardA11y:en,nodeExtent:Ve,viewport:Lr,onViewportChange:_r}),o.jsx(Net,{onSelectionChange:F}),Dt,o.jsx(Eet,{proOptions:Ki,position:vn}),o.jsx(ket,{rfId:ls,disableKeyboardA11y:en})]})})}var ant=dwe(snt);const ont=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function lnt({children:e}){const t=_i(ont);return t?Li.createPortal(e,t):null}function cnt(e){const[t,n]=m.useState(e),i=m.useCallback(r=>n(s=>cwe(r,s)),[]);return[t,n,i]}function unt(e){const[t,n]=m.useState(e),i=m.useCallback(r=>n(s=>uwe(r,s)),[]);return[t,n,i]}const dnt=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||!oB(n.userNode))return!1;return!0};function fnt(e={includeHiddenNodes:!1}){return _i(dnt(e))}function hnt({dimensions:e,lineWidth:t,variant:n,className:i}){return o.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ta(["react-flow__background-pattern",n,i])})}function pnt({radius:e,className:t}){return o.jsx("circle",{cx:e,cy:e,r:e,className:ta(["react-flow__background-pattern","dots",t])})}var tm;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(tm||(tm={}));const mnt={[tm.Dots]:1,[tm.Lines]:1,[tm.Cross]:6},gnt=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Mwe({id:e,variant:t=tm.Dots,gap:n=20,size:i,lineWidth:r=1,offset:s=0,color:a,bgColor:l,style:c,className:u,patternClassName:d}){const f=m.useRef(null),{transform:h,patternId:p}=_i(gnt,rs),g=i||mnt[t],b=t===tm.Dots,v=t===tm.Cross,y=Array.isArray(n)?n:[n,n],x=[y[0]*h[2]||1,y[1]*h[2]||1],O=g*h[2],w=Array.isArray(s)?s:[s,s],k=v?[O,O]:x,S=[w[0]*h[2]||1+k[0]/2,w[1]*h[2]||1+k[1]/2],E=`${p}${e||""}`;return o.jsxs("svg",{className:ta(["react-flow__background",u]),style:{...c,...FR,"--xy-background-color-props":l,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[o.jsx("pattern",{id:E,x:h[0]%x[0],y:h[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:b?o.jsx(pnt,{radius:O/2,className:d}):o.jsx(hnt,{dimensions:k,lineWidth:r,variant:t,className:d})}),o.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${E})`})]})}Mwe.displayName="Background";const bnt=m.memo(Mwe);function ynt(){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 vnt(){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 xnt(){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 wnt(){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 Ont(){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 vT({children:e,className:t,...n}){return o.jsx("button",{type:"button",className:ta(["react-flow__controls-button",t]),...n,children:e})}const Snt=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Lwe({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:r,onZoomIn:s,onZoomOut:a,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":p}){const g=ss(),{isInteractive:b,minZoomReached:v,maxZoomReached:y,ariaLabelConfig:x}=_i(Snt,rs),{zoomIn:O,zoomOut:w,fitView:k}=$R(),S=()=>{O(),s==null||s()},E=()=>{w(),a==null||a()},C=()=>{k(r),l==null||l()},N=()=>{g.setState({nodesDraggable:!b,nodesConnectable:!b,elementsSelectable:!b}),c==null||c(!b)},_=h==="horizontal"?"horizontal":"vertical";return o.jsxs(LR,{className:ta(["react-flow__controls",_,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":p??x["controls.ariaLabel"],children:[t&&o.jsxs(o.Fragment,{children:[o.jsx(vT,{onClick:S,className:"react-flow__controls-zoomin",title:x["controls.zoomIn.ariaLabel"],"aria-label":x["controls.zoomIn.ariaLabel"],disabled:y,children:o.jsx(ynt,{})}),o.jsx(vT,{onClick:E,className:"react-flow__controls-zoomout",title:x["controls.zoomOut.ariaLabel"],"aria-label":x["controls.zoomOut.ariaLabel"],disabled:v,children:o.jsx(vnt,{})})]}),n&&o.jsx(vT,{className:"react-flow__controls-fitview",onClick:C,title:x["controls.fitView.ariaLabel"],"aria-label":x["controls.fitView.ariaLabel"],children:o.jsx(xnt,{})}),i&&o.jsx(vT,{className:"react-flow__controls-interactive",onClick:N,title:x["controls.interactive.ariaLabel"],"aria-label":x["controls.interactive.ariaLabel"],children:b?o.jsx(Ont,{}):o.jsx(wnt,{})}),d]})}Lwe.displayName="Controls";const knt=m.memo(Lwe);function Ent({id:e,x:t,y:n,width:i,height:r,style:s,color:a,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:p}){const{background:g,backgroundColor:b}=s||{},v=a||g||b;return o.jsx("rect",{className:ta(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:i,height:r,style:{fill:v,stroke:l,strokeWidth:c},shapeRendering:f,onClick:p?y=>p(y,e):void 0})}const Cnt=m.memo(Ent),Tnt=e=>e.nodes.map(t=>t.id),aM=e=>e instanceof Function?e:()=>e;function Ant({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:r,nodeComponent:s=Cnt,onClick:a}){const l=_i(Tnt,rs),c=aM(t),u=aM(e),d=aM(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return o.jsx(o.Fragment,{children:l.map(h=>o.jsx(Nnt,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:i,nodeStrokeWidth:r,NodeComponent:s,onClick:a,shapeRendering:f},h))})}function _nt({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:r,nodeStrokeWidth:s,shapeRendering:a,NodeComponent:l,onClick:c}){const{node:u,x:d,y:f,width:h,height:p}=_i(g=>{const b=g.nodeLookup.get(e);if(!b)return{node:void 0,x:0,y:0,width:0,height:0};const v=b.internals.userNode,{x:y,y:x}=b.internals.positionAbsolute,{width:O,height:w}=Fh(v);return{node:v,x:y,y:x,width:O,height:w}},rs);return!u||u.hidden||!oB(u)?null:o.jsx(l,{x:d,y:f,width:h,height:p,style:u.style,selected:!!u.selected,className:i(u),color:t(u),borderRadius:r,strokeColor:n(u),strokeWidth:s,shapeRendering:a,onClick:c,id:u.id})}const Nnt=m.memo(_nt);var jnt=m.memo(Ant);const Rnt=200,Int=150,Pnt=e=>!e.hidden,Dnt=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?P1e(iE(e.nodeLookup,{filter:Pnt}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Mnt="react-flow__minimap-desc";function $we({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:r="",nodeBorderRadius:s=5,nodeStrokeWidth:a,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:p,onNodeClick:g,pannable:b=!1,zoomable:v=!1,ariaLabel:y,inversePan:x,zoomStep:O=1,offsetScale:w=5}){const k=ss(),S=m.useRef(null),{boundingRect:E,viewBB:C,rfId:N,panZoom:_,translateExtent:j,flowWidth:A,flowHeight:F,ariaLabelConfig:T}=_i(Dnt,rs),P=(e==null?void 0:e.width)??Rnt,R=(e==null?void 0:e.height)??Int,L=E.width/P,M=E.height/R,U=Math.max(L,M),I=U*P,H=U*R,Z=w*U,Q=E.x-(I-E.width)/2-Z,q=E.y-(H-E.height)/2-Z,B=I+Z*2,te=H+Z*2,ce=`${Mnt}-${N}`,se=m.useRef(0),re=m.useRef();se.current=U,m.useEffect(()=>{if(S.current&&_)return re.current=BJe({domNode:S.current,panZoom:_,getTransform:()=>k.getState().transform,getViewScale:()=>se.current}),()=>{var ae;(ae=re.current)==null||ae.destroy()}},[_]),m.useEffect(()=>{var ae;(ae=re.current)==null||ae.update({translateExtent:j,width:A,height:F,inversePan:x,pannable:b,zoomStep:O,zoomable:v})},[b,v,x,O,j,A,F]);const ge=p?ae=>{var Ee;const[ue,xe]=((Ee=re.current)==null?void 0:Ee.pointer(ae))||[0,0];p(ae,{x:ue,y:xe})}:void 0,G=g?m.useCallback((ae,ue)=>{const xe=k.getState().nodeLookup.get(ue).internals.userNode;g(ae,xe)},[]):void 0,K=y??T["minimap.ariaLabel"];return o.jsx(LR,{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*U:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i: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:ta(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:o.jsxs("svg",{width:P,height:R,viewBox:`${Q} ${q} ${B} ${te}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ce,ref:S,onClick:ge,children:[K&&o.jsx("title",{id:ce,children:K}),o.jsx(jnt,{onClick:G,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:r,nodeStrokeWidth:a,nodeComponent:l}),o.jsx("path",{className:"react-flow__minimap-mask",d:`M${Q-Z},${q-Z}h${B+Z*2}v${te+Z*2}h${-B-Z*2}z + M${C.x},${C.y}h${C.width}v${C.height}h${-C.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}$we.displayName="MiniMap";m.memo($we);const Lnt=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,$nt={[Gv.Line]:"right",[Gv.Handle]:"bottom-right"};function Fnt({nodeId:e,position:t,variant:n=Gv.Handle,className:i,style:r=void 0,children:s,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:g,onResizeStart:b,onResize:v,onResizeEnd:y}){const x=mwe(),O=typeof e=="string"?e:x,w=ss(),k=m.useRef(null),S=n===Gv.Handle,E=_i(m.useCallback(Lnt(S&&p),[S,p]),rs),C=m.useRef(null),N=t??$nt[n];m.useEffect(()=>{if(!(!k.current||!O))return C.current||(C.current=JJe({domNode:k.current,nodeId:O,getStoreItems:()=>{const{nodeLookup:j,transform:A,snapGrid:F,snapToGrid:T,nodeOrigin:P,domNode:R}=w.getState();return{nodeLookup:j,transform:A,snapGrid:F,snapToGrid:T,nodeOrigin:P,paneDomNode:R}},onChange:(j,A)=>{const{triggerNodeChanges:F,nodeLookup:T,parentLookup:P,nodeOrigin:R}=w.getState(),L=[],M={x:j.x,y:j.y},U=T.get(O);if(U&&U.expandParent&&U.parentId){const I=U.origin??R,H=j.width??U.measured.width??0,Z=j.height??U.measured.height??0,Q={id:U.id,parentId:U.parentId,rect:{width:H,height:Z,...M1e({x:j.x??U.position.x,y:j.y??U.position.y},{width:H,height:Z},U.parentId,T,I)}},q=hB([Q],T,P,R);L.push(...q),M.x=j.x?Math.max(I[0]*H,j.x):void 0,M.y=j.y?Math.max(I[1]*Z,j.y):void 0}if(M.x!==void 0&&M.y!==void 0){const I={id:O,type:"position",position:{...M}};L.push(I)}if(j.width!==void 0&&j.height!==void 0){const H={id:O,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:j.width,height:j.height}};L.push(H)}for(const I of A){const H={...I,type:"position"};L.push(H)}F(L)},onEnd:({width:j,height:A})=>{const F={id:O,type:"dimensions",resizing:!1,dimensions:{width:j,height:A}};w.getState().triggerNodeChanges([F])}})),C.current.update({controlPosition:N,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:b,onResize:v,onResizeEnd:y,shouldResize:g}),()=>{var j;(j=C.current)==null||j.destroy()}},[N,l,c,u,d,f,b,v,y,g]);const _=N.split("-");return o.jsx("div",{className:ta(["react-flow__resize-control","nodrag",..._,n,i]),ref:k,style:{...r,scale:E,...a&&{[S?"backgroundColor":"borderColor"]:a}},children:s})}m.memo(Fnt);var Fwe=Object.defineProperty,Bnt=(e,t,n)=>t in e?Fwe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Unt=(e,t)=>{for(var n in t)Fwe(e,n,{get:t[n],enumerable:!0})},Qnt=(e,t,n)=>Bnt(e,t+"",n),Bwe={};Unt(Bwe,{Graph:()=>au,alg:()=>mB,json:()=>Qwe,version:()=>Hnt});var znt=Object.defineProperty,Uwe=(e,t)=>{for(var n in t)znt(e,n,{get:t[n],enumerable:!0})},au=class{constructor(t){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=()=>{},t&&(this._isDirected="directed"in t?t.directed:!0,this._isMultigraph="multigraph"in t?t.multigraph:!1,this._isCompound="compound"in t?t.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return typeof t!="function"?this._defaultNodeLabelFn=()=>t:this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(t=>Object.keys(this._in[t]).length===0)}sinks(){return this.nodes().filter(t=>Object.keys(this._out[t]).length===0)}setNodes(t,n){return t.forEach(i=>{n!==void 0?this.setNode(i,n):this.setNode(i)}),this}setNode(t,n){return t in this._nodes?(arguments.length>1&&(this._nodes[t]=n),this):(this._nodes[t]=arguments.length>1?n:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return t in this._nodes}removeNode(t){if(t in this._nodes){let n=i=>this.removeEdge(this._edgeObjs[i]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],this.children(t).forEach(i=>{this.setParent(i)}),delete this._children[t]),Object.keys(this._in[t]).forEach(n),delete this._in[t],delete this._preds[t],Object.keys(this._out[t]).forEach(n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,n){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(n===void 0)n="\0";else{n+="";for(let i=n;i!==void 0;i=this.parent(i))if(i===t)throw new Error("Setting "+n+" as parent of "+t+" would create a cycle");this.setNode(n)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=n,this._children[n][t]=!0,this}parent(t){if(this._isCompound){let n=this._parent[t];if(n!=="\0")return n}}children(t="\0"){if(this._isCompound){let n=this._children[t];if(n)return Object.keys(n)}else{if(t==="\0")return this.nodes();if(this.hasNode(t))return[]}return[]}predecessors(t){let n=this._preds[t];if(n)return Object.keys(n)}successors(t){let n=this._sucs[t];if(n)return Object.keys(n)}neighbors(t){let n=this.predecessors(t);if(n){let i=new Set(n);for(let r of this.successors(t))i.add(r);return Array.from(i.values())}}isLeaf(t){let n;return this.isDirected()?n=this.successors(t):n=this.neighbors(t),n.length===0}filterNodes(t){let n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph()),Object.entries(this._nodes).forEach(([s,a])=>{t(s)&&n.setNode(s,a)}),Object.values(this._edgeObjs).forEach(s=>{n.hasNode(s.v)&&n.hasNode(s.w)&&n.setEdge(s,this.edge(s))});let i={},r=s=>{let a=this.parent(s);return!a||n.hasNode(a)?(i[s]=a??void 0,a??void 0):a in i?i[a]:r(a)};return this._isCompound&&n.nodes().forEach(s=>n.setParent(s,r(s))),n}setDefaultEdgeLabel(t){return typeof t!="function"?this._defaultEdgeLabelFn=()=>t:this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(t,n){return t.reduce((i,r)=>(n!==void 0?this.setEdge(i,r,n):this.setEdge(i,r),r)),this}setEdge(t,n,i,r){let s,a,l,c,u=!1;typeof t=="object"&&t!==null&&"v"in t?(s=t.v,a=t.w,l=t.name,arguments.length===2&&(c=n,u=!0)):(s=t,a=n,l=r,arguments.length>2&&(c=i,u=!0)),s=""+s,a=""+a,l!==void 0&&(l=""+l);let d=Pw(this._isDirected,s,a,l);if(d in this._edgeLabels)return u&&(this._edgeLabels[d]=c),this;if(l!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(s),this.setNode(a),this._edgeLabels[d]=u?c:this._defaultEdgeLabelFn(s,a,l);let f=Vnt(this._isDirected,s,a,l);return s=f.v,a=f.w,Object.freeze(f),this._edgeObjs[d]=f,yK(this._preds[a],s),yK(this._sucs[s],a),this._in[a][d]=f,this._out[s][d]=f,this._edgeCount++,this}edge(t,n,i){let r=arguments.length===1?oM(this._isDirected,t):Pw(this._isDirected,t,n,i);return this._edgeLabels[r]}edgeAsObj(t,n,i){let r=arguments.length===1?this.edge(t):this.edge(t,n,i);return typeof r!="object"?{label:r}:r}hasEdge(t,n,i){return(arguments.length===1?oM(this._isDirected,t):Pw(this._isDirected,t,n,i))in this._edgeLabels}removeEdge(t,n,i){let r=arguments.length===1?oM(this._isDirected,t):Pw(this._isDirected,t,n,i),s=this._edgeObjs[r];if(s){let a=s.v,l=s.w;delete this._edgeLabels[r],delete this._edgeObjs[r],vK(this._preds[l],a),vK(this._sucs[a],l),delete this._in[l][r],delete this._out[a][r],this._edgeCount--}return this}inEdges(t,n){return this.isDirected()?this.filterEdges(this._in[t],t,n):this.nodeEdges(t,n)}outEdges(t,n){return this.isDirected()?this.filterEdges(this._out[t],t,n):this.nodeEdges(t,n)}nodeEdges(t,n){if(t in this._nodes)return this.filterEdges({...this._in[t],...this._out[t]},t,n)}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}filterEdges(t,n,i){if(!t)return;let r=Object.values(t);return i?r.filter(s=>s.v===n&&s.w===i||s.v===i&&s.w===n):r}};function yK(e,t){e[t]?e[t]++:e[t]=1}function vK(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function Pw(e,t,n,i){let r=""+t,s=""+n;if(!e&&r>s){let a=r;r=s,s=a}return r+""+s+""+(i===void 0?"\0":i)}function Vnt(e,t,n,i){let r=""+t,s=""+n;if(!e&&r>s){let l=r;r=s,s=l}let a={v:r,w:s};return i&&(a.name=i),a}function oM(e,t){return Pw(e,t.v,t.w,t.name)}var Hnt="4.0.1",Qwe={};Uwe(Qwe,{read:()=>Knt,write:()=>qnt});function qnt(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:Wnt(e),edges:Gnt(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function Wnt(e){return e.nodes().map(t=>{let n=e.node(t),i=e.parent(t),r={v:t};return n!==void 0&&(r.value=n),i!==void 0&&(r.parent=i),r})}function Gnt(e){return e.edges().map(t=>{let n=e.edge(t),i={v:t.v,w:t.w};return t.name!==void 0&&(i.name=t.name),n!==void 0&&(i.value=n),i})}function Knt(e){let t=new au(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 mB={};Uwe(mB,{CycleException:()=>nN,bellmanFord:()=>zwe,components:()=>Znt,dijkstra:()=>tN,dijkstraAll:()=>tit,findCycles:()=>nit,floydWarshall:()=>rit,isAcyclic:()=>ait,postorder:()=>lit,preorder:()=>cit,prim:()=>uit,shortestPaths:()=>dit,tarjan:()=>Hwe,topsort:()=>qwe});var Xnt=()=>1;function zwe(e,t,n,i){return Ynt(e,String(t),n||Xnt,i||function(r){return e.outEdges(r)})}function Ynt(e,t,n,i){let r={},s,a=0,l=e.nodes(),c=function(f){let h=n(f);r[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,i=String(e);if(!(i in n)){let r=this._arr,s=r.length;return n[i]=s,r.push({key:i,priority:t}),this._decrease(s),!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 i=this._arr[n].priority;if(t>i)throw new Error(`New priority is greater than current priority. Key: ${e} Old: ${i} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,i=n+1,r=e;n>1,!(t[i].priority1;function tN(e,t,n,i){let r=function(s){return e.outEdges(s)};return eit(e,String(t),n||Jnt,i||r)}function eit(e,t,n,i){let r={},s=new Vwe,a,l,c=function(u){let d=u.v!==a?u.v:u.w,f=r[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=s.removeMin(),l=r[a],l.distance!==Number.POSITIVE_INFINITY);)i(a).forEach(c);return r}function tit(e,t,n){return e.nodes().reduce(function(i,r){return i[r]=tN(e,r,t,n),i},{})}function Hwe(e){let t=0,n=[],i={},r=[];function s(a){let l=i[a]={onStack:!0,lowlink:t,index:t++};if(n.push(a),e.successors(a).forEach(function(c){c in i?i[c].onStack&&(l.lowlink=Math.min(l.lowlink,i[c].index)):(s(c),l.lowlink=Math.min(l.lowlink,i[c].lowlink))}),l.lowlink===l.index){let c=[],u;do u=n.pop(),i[u].onStack=!1,c.push(u);while(a!==u);r.push(c)}}return e.nodes().forEach(function(a){a in i||s(a)}),r}function nit(e){return Hwe(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var iit=()=>1;function rit(e,t,n){return sit(e,t||iit,n||function(i){return e.outEdges(i)})}function sit(e,t,n){let i={},r=e.nodes();return r.forEach(function(s){i[s]={},i[s][s]={distance:0,predecessor:""},r.forEach(function(a){s!==a&&(i[s][a]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),n(s).forEach(function(a){let l=a.v===s?a.w:a.v,c=t(a);i[s][l]={distance:c,predecessor:s}})}),r.forEach(function(s){let a=i[s];r.forEach(function(l){let c=i[l];r.forEach(function(u){let d=c[s],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);r=Wwe(e,l,n==="post",a,s,i,r)}),r}function Wwe(e,t,n,i,r,s,a){return t in i||(i[t]=!0,n||(a=s(a,t)),r(t).forEach(function(l){a=Wwe(e,l,n,i,r,s,a)}),n&&(a=s(a,t))),a}function Gwe(e,t,n){return oit(e,t,n,function(i,r){return i.push(r),i},[])}function lit(e,t){return Gwe(e,t,"post")}function cit(e,t){return Gwe(e,t,"pre")}function uit(e,t){let n=new au,i={},r=new Vwe,s;function a(c){let u=c.v===s?c.w:c.v,d=r.priority(u);if(d!==void 0){let f=t(c);f0;){if(s=r.removeMin(),s in i)n.setEdge(s,i[s]);else{if(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(s).forEach(a)}return n}function dit(e,t,n,i){return fit(e,t,n,i??(r=>{let s=e.outEdges(r);return s??[]}))}function fit(e,t,n,i){if(n===void 0)return tN(e,t,n,i);let r=!1,s=e.nodes();for(let a=0;at.setNode(n,e.node(n))),e.edges().forEach(n=>{let i=t.edge(n.v,n.w)||{weight:0,minlen:1},r=e.edge(n);t.setEdge(n.v,n.w,{weight:i.weight+r.weight,minlen:Math.max(i.minlen,r.minlen)})}),t}function Kwe(e){let t=new au({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 xK(e,t){let n=e.x,i=e.y,r=t.x-n,s=t.y-i,a=e.width/2,l=e.height/2;if(!r&&!s)throw new Error("Not possible to find intersection inside of the rectangle");let c,u;return Math.abs(s)*a>Math.abs(r)*l?(s<0&&(l=-l),c=l*r/s,u=l):(r<0&&(a=-a),c=a,u=a*s/r),{x:n+c,y:i+u}}function aE(e){let t=MS(Ywe(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let i=e.node(n),r=i.rank;r!==void 0&&(t[r]||(t[r]=[]),t[r][i.order]=n)}),t}function pit(e){let t=e.nodes().map(i=>{let r=e.node(i).rank;return r===void 0?Number.MAX_VALUE:r}),n=Cd(Math.min,t);e.nodes().forEach(i=>{let r=e.node(i);Object.hasOwn(r,"rank")&&(r.rank-=n)})}function mit(e){let t=e.nodes().map(a=>e.node(a).rank).filter(a=>a!==void 0),n=Cd(Math.min,t),i=[];e.nodes().forEach(a=>{let l=e.node(a).rank-n;i[l]||(i[l]=[]),i[l].push(a)});let r=0,s=e.graph().nodeRankFactor;Array.from(i).forEach((a,l)=>{a===void 0&&l%s!==0?--r:a!==void 0&&r&&a.forEach(c=>e.node(c).rank+=r)})}function wK(e,t,n,i){let r={width:0,height:0};return arguments.length>=4&&(r.rank=n,r.order=i),Fx(e,"border",r,t)}function git(e,t=Xwe){let n=[];for(let i=0;iXwe){let n=git(t);return e(...n.map(i=>e(...i)))}else return e(...t)}function Ywe(e){let t=e.nodes().map(n=>{let i=e.node(n).rank;return i===void 0?Number.MIN_VALUE:i});return Cd(Math.max,t)}function bit(e,t){let n={lhs:[],rhs:[]};return e.forEach(i=>{t(i)?n.lhs.push(i):n.rhs.push(i)}),n}function Zwe(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function Jwe(e,t){return t()}var yit=0;function gB(e){let t=++yit;return e+(""+t)}function MS(e,t,n=1){t==null&&(t=e,e=0);let i=s=>sti[t]:n=t,Object.entries(e).reduce((i,[r,s])=>(i[r]=n(s,r),i),{})}function vit(e,t){return e.reduce((n,i,r)=>(n[i]=t[r],n),{})}var UR="\0",xit="3.0.0",wit=class{constructor(){Qnt(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return OK(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&OK(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,Oit)),n=n._prev;return"["+e.join(", ")+"]"}};function OK(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Oit(e,t){if(e!=="_next"&&e!=="_prev")return t}var Sit=wit,kit=()=>1;function Eit(e,t){if(e.nodeCount()<=1)return[];let n=Tit(e,t||kit);return Cit(n.graph,n.buckets,n.zeroIdx).flatMap(i=>e.outEdges(i.v,i.w)||[])}function Cit(e,t,n){var i;let r=[],s=t[t.length-1],a=t[0],l;for(;e.nodeCount();){for(;l=a.dequeue();)lM(e,t,n,l);for(;l=s.dequeue();)lM(e,t,n,l);if(e.nodeCount()){for(let c=t.length-2;c>0;--c)if(l=(i=t[c])==null?void 0:i.dequeue(),l){r=r.concat(lM(e,t,n,l,!0)||[]);break}}}return r}function lM(e,t,n,i,r){let s=[],a=r?s:void 0;return(e.inEdges(i.v)||[]).forEach(l=>{let c=e.edge(l),u=e.node(l.v);r&&s.push({v:l.v,w:l.w}),u.out-=c,f6(t,n,u)}),(e.outEdges(i.v)||[]).forEach(l=>{let c=e.edge(l),u=l.w,d=e.node(u);d.in-=c,f6(t,n,d)}),e.removeNode(i.v),a}function Tit(e,t){let n=new au,i=0,r=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);r=Math.max(r,f.out+=u),i=Math.max(i,h.in+=u)});let s=Ait(r+i+3).map(()=>new Sit),a=i+1;return n.nodes().forEach(l=>{f6(s,a,n.node(l))}),{graph:n,buckets:s,zeroIdx:a}}function f6(e,t,n){var i,r,s;n.out?n.in?(s=e[n.out-n.in+t])==null||s.enqueue(n):(r=e[e.length-1])==null||r.enqueue(n):(i=e[0])==null||i.enqueue(n)}function Ait(e){let t=[];for(let n=0;n{let i=e.edge(n);e.removeEdge(n),i.forwardName=n.name,i.reversed=!0,e.setEdge(n.w,n.v,i,gB("rev"))});function t(n){return i=>n.edge(i).weight}}function Nit(e){let t=[],n={},i={};function r(s){Object.hasOwn(i,s)||(i[s]=!0,n[s]=!0,e.outEdges(s).forEach(a=>{Object.hasOwn(n,a.w)?t.push(a):r(a.w)}),delete n[s])}return e.nodes().forEach(r),t}function jit(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let i=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,i)}})}function Rit(e){e.graph().dummyChains=[],e.edges().forEach(t=>Iit(e,t))}function Iit(e,t){let n=t.v,i=e.node(n).rank,r=t.w,s=e.node(r).rank,a=t.name,l=e.edge(t),c=l.labelRank;if(s===i+1)return;e.removeEdge(t);let u,d,f;for(f=0,++i;i{let n=e.node(t),i=n.edgeLabel,r;for(e.setEdge(n.edgeObj,i);n.dummy;)r=e.successors(t)[0],e.removeNode(t),i.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height),t=r,n=e.node(t)})}function bB(e){let t={};function n(i){let r=e.node(i);if(Object.hasOwn(t,i))return r.rank;t[i]=!0;let s=e.outEdges(i),a=s?s.map(c=>c==null?Number.POSITIVE_INFINITY:n(c.w)-e.edge(c).minlen):[],l=Cd(Math.min,a);return l===Number.POSITIVE_INFINITY&&(l=0),r.rank=l}e.sources().forEach(n)}function Kv(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var eOe=Dit;function Dit(e){let t=new au({directed:!1}),n=e.nodes();if(n.length===0)throw new Error("Graph must have at least one node");let i=n[0],r=e.nodeCount();t.setNode(i,{});let s,a;for(;Mit(t,e){let a=s.v,l=i===a?s.w:a;!e.hasNode(l)&&!Kv(t,s)&&(e.setNode(l,{}),e.setEdge(i,l,{}),n(l))})}return e.nodes().forEach(n),e.nodeCount()}function Lit(e,t){return t.edges().reduce((n,i)=>{let r=Number.POSITIVE_INFINITY;return e.hasNode(i.v)!==e.hasNode(i.w)&&(r=Kv(t,i)),rt.node(i).rank+=n)}var{preorder:Fit,postorder:Bit}=mB,Uit=Xb;Xb.initLowLimValues=vB;Xb.initCutValues=yB;Xb.calcCutValue=tOe;Xb.leaveEdge=iOe;Xb.enterEdge=rOe;Xb.exchangeEdges=sOe;function Xb(e){e=hit(e),bB(e);let t=eOe(e);vB(t),yB(t,e);let n,i;for(;n=iOe(t);)i=rOe(t,e,n),sOe(t,e,n,i)}function yB(e,t){let n=Bit(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(i=>Qit(e,t,i))}function Qit(e,t,n){let i=e.node(n).parent,r=e.edge(n,i);r.cutvalue=tOe(e,t,n)}function tOe(e,t,n){let i=e.node(n).parent,r=!0,s=t.edge(n,i),a=0;s||(r=!1,s=t.edge(i,n)),a=s.weight;let l=t.nodeEdges(n);return l&&l.forEach(c=>{let u=c.v===n,d=u?c.w:c.v;if(d!==i){let f=u===r,h=t.edge(c).weight;if(a+=f?h:-h,Vit(e,n,d)){let p=e.edge(n,d).cutvalue;a+=f?-p:p}}}),a}function vB(e,t){arguments.length<2&&(t=e.nodes()[0]),nOe(e,{},1,t)}function nOe(e,t,n,i,r){let s=n,a=e.node(i);t[i]=!0;let l=e.neighbors(i);return l&&l.forEach(c=>{Object.hasOwn(t,c)||(n=nOe(e,t,n,c,i))}),a.low=s,a.lim=n++,r?a.parent=r:delete a.parent,n}function iOe(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function rOe(e,t,n){let i=n.v,r=n.w;t.hasEdge(i,r)||(i=n.w,r=n.v);let s=e.node(i),a=e.node(r),l=s,c=!1;return s.lim>a.lim&&(l=a,c=!0),t.edges().filter(u=>c===SK(e,e.node(u.v),l)&&c!==SK(e,e.node(u.w),l)).reduce((u,d)=>Kv(t,d)!e.node(r).parent);if(!n)return;let i=Fit(e,[n]);i=i.slice(1),i.forEach(r=>{let s=e.node(r).parent,a=t.edge(r,s),l=!1;a||(a=t.edge(s,r),l=!0),t.node(r).rank=t.node(s).rank+(l?a.minlen:-a.minlen)})}function Vit(e,t,n){return e.hasEdge(t,n)}function SK(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var Hit=qit;function qit(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":kK(e);break;case"tight-tree":Git(e);break;case"longest-path":Wit(e);break;case"none":break;default:kK(e)}}var Wit=bB;function Git(e){bB(e),eOe(e)}function kK(e){Uit(e)}var Kit=Xit;function Xit(e){let t=Zit(e);e.graph().dummyChains.forEach(n=>{let i=e.node(n),r=i.edgeObj,s=Yit(e,t,r.v,r.w),a=s.path,l=s.lca,c=0,u=a[c],d=!0;for(;n!==r.w;){if(i=e.node(n),d){for(;(u=a[c])!==l&&e.node(u).maxRanka||l>t[c].lim));let u=c,d=i;for(;(d=e.parent(d))!==u;)s.push(d);return{path:r.concat(s.reverse()),lca:u}}function Zit(e){let t={},n=0;function i(r){let s=n;e.children(r).forEach(i),t[r]={low:s,lim:n++}}return e.children(UR).forEach(i),t}function Jit(e){let t=Fx(e,"root",{},"_root"),n=ert(e),i=Object.values(n),r=Cd(Math.max,i)-1,s=2*r+1;e.graph().nestingRoot=t,e.edges().forEach(l=>e.edge(l).minlen*=s);let a=trt(e)+1;e.children(UR).forEach(l=>aOe(e,t,s,a,r,n,l)),e.graph().nodeRankFactor=s}function aOe(e,t,n,i,r,s,a){var l;let c=e.children(a);if(!c.length){a!==t&&e.setEdge(t,a,{weight:0,minlen:n});return}let u=wK(e,"_bt"),d=wK(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;aOe(e,t,n,i,r,s,h);let g=e.node(h),b=g.borderTop?g.borderTop:h,v=g.borderBottom?g.borderBottom:h,y=g.borderTop?i:2*i,x=b!==v?1:r-((p=s[a])!=null?p:0)+1;e.setEdge(u,b,{weight:y,minlen:x,nestingEdge:!0}),e.setEdge(v,d,{weight:y,minlen:x,nestingEdge:!0})}),e.parent(a)||e.setEdge(t,u,{weight:0,minlen:r+((l=s[a])!=null?l:0)})}function ert(e){let t={};function n(i,r){let s=e.children(i);s&&s.length&&s.forEach(a=>n(a,r+1)),t[i]=r}return e.children(UR).forEach(i=>n(i,1)),t}function trt(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function nrt(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var irt=rrt;function rrt(e){function t(n){let i=e.children(n),r=e.node(n);if(i.length&&i.forEach(t),Object.hasOwn(r,"minRank")){r.borderLeft=[],r.borderRight=[];for(let s=r.minRank,a=r.maxRank+1;sCK(e.node(t))),e.edges().forEach(t=>CK(e.edge(t)))}function CK(e){let t=e.width;e.width=e.height,e.height=t}function ort(e){e.nodes().forEach(t=>cM(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(cM),Object.hasOwn(i,"y")&&cM(i)})}function cM(e){e.y=-e.y}function lrt(e){e.nodes().forEach(t=>uM(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(uM),Object.hasOwn(i,"x")&&uM(i)})}function uM(e){let t=e.x;e.x=e.y,e.y=t}function crt(e){let t={},n=e.nodes().filter(l=>!e.children(l).length),i=n.map(l=>e.node(l).rank),r=Cd(Math.max,i),s=MS(r+1).map(()=>[]);function a(l){if(t[l])return;t[l]=!0;let c=e.node(l);s[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),s}function urt(e,t){let n=0;for(let i=1;id)),r=t.flatMap(u=>{let d=e.outEdges(u);return d?d.map(f=>({pos:i[f.w],weight:e.edge(f).weight})).sort((f,h)=>f.pos-h.pos):[]}),s=1;for(;s{let d=u.pos+s;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 frt(e,t=[]){return t.map(n=>{let i=e.inEdges(n);if(!i||!i.length)return{v:n};{let r=i.reduce((s,a)=>{let l=e.edge(a),c=e.node(a.v);return{sum:s.sum+l.weight*c.order,weight:s.weight+l.weight}},{sum:0,weight:0});return{v:n,barycenter:r.sum/r.weight,weight:r.weight}}})}function hrt(e,t){let n={};e.forEach((r,s)=>{let a={indegree:0,in:[],out:[],vs:[r.v],i:s};r.barycenter!==void 0&&(a.barycenter=r.barycenter,a.weight=r.weight),n[r.v]=a}),t.edges().forEach(r=>{let s=n[r.v],a=n[r.w];s!==void 0&&a!==void 0&&(a.indegree++,s.out.push(a))});let i=Object.values(n).filter(r=>!r.indegree);return prt(i)}function prt(e){let t=[];function n(r){return s=>{s.merged||(s.barycenter===void 0||r.barycenter===void 0||s.barycenter>=r.barycenter)&&mrt(r,s)}}function i(r){return s=>{s.in.push(r),--s.indegree===0&&e.push(s)}}for(;e.length;){let r=e.pop();t.push(r),r.in.reverse().forEach(n(r)),r.out.forEach(i(r))}return t.filter(r=>!r.merged).map(r=>iN(r,["vs","i","barycenter","weight"]))}function mrt(e,t){let n=0,i=0;e.weight&&(n+=e.barycenter*e.weight,i+=e.weight),t.weight&&(n+=t.barycenter*t.weight,i+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/i,e.weight=i,e.i=Math.min(t.i,e.i),t.merged=!0}function grt(e,t){let n=bit(e,d=>Object.hasOwn(d,"barycenter")),i=n.lhs,r=n.rhs.sort((d,f)=>f.i-d.i),s=[],a=0,l=0,c=0;i.sort(brt(!!t)),c=TK(s,r,c),i.forEach(d=>{c+=d.vs.length,s.push(d.vs),a+=d.barycenter*d.weight,l+=d.weight,c=TK(s,r,c)});let u={vs:s.flat(1)};return l&&(u.barycenter=a/l,u.weight=l),u}function TK(e,t,n){let i;for(;t.length&&(i=t[t.length-1]).i<=n;)t.pop(),e.push(i.vs),n++;return n}function brt(e){return(t,n)=>t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}function lOe(e,t,n,i){let r=e.children(t),s=e.node(t),a=s?s.borderLeft:void 0,l=s?s.borderRight:void 0,c={};a&&(r=r.filter(h=>h!==a&&h!==l));let u=frt(e,r);u.forEach(h=>{if(e.children(h.v).length){let p=lOe(e,h.v,n,i);c[h.v]=p,Object.hasOwn(p,"barycenter")&&vrt(h,p)}});let d=hrt(u,n);yrt(d,c);let f=grt(d,i);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]),g=e.predecessors(l),b=e.node(g[0]);Object.hasOwn(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+p.order+b.order)/(f.weight+2),f.weight+=2}}return f}function yrt(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(i=>t[i]?t[i].vs:i)})}function vrt(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 xrt(e,t,n,i){i||(i=e.nodes());let r=wrt(e),s=new au({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(a=>e.node(a));return i.forEach(a=>{let l=e.node(a),c=e.parent(a);if(l.rank===t||l.minRank<=t&&t<=l.maxRank){s.setNode(a),s.setParent(a,c||r);let u=e[n](a);u&&u.forEach(d=>{let f=d.v===a?d.w:d.v,h=s.edge(f,a),p=h!==void 0?h.weight:0;s.setEdge(f,a,{weight:e.edge(d).weight+p})}),Object.hasOwn(l,"minRank")&&s.setNode(a,{borderLeft:l.borderLeft[t],borderRight:l.borderRight[t]})}}),s}function wrt(e){let t;for(;e.hasNode(t=gB("_root")););return t}function Ort(e,t,n){let i={},r;n.forEach(s=>{let a=e.parent(s),l,c;for(;a;){if(l=e.parent(a),l?(c=i[l],i[l]=a):(c=r,r=a),c&&c!==a){t.setEdge(c,a);return}a=l}})}function cOe(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,cOe);return}let n=Ywe(e),i=AK(e,MS(1,n+1),"inEdges"),r=AK(e,MS(n-1,-1,-1),"outEdges"),s=crt(e);if(_K(e,s),t.disableOptimalOrderHeuristic)return;let a=Number.POSITIVE_INFINITY,l,c=t.constraints||[];for(let u=0,d=0;d<4;++u,++d){Srt(u%2?i:r,u%4>=2,c),s=aE(e);let f=urt(e,s);f{i.has(s)||i.set(s,[]),i.get(s).push(a)};for(let s of e.nodes()){let a=e.node(s);if(typeof a.rank=="number"&&r(a.rank,s),typeof a.minRank=="number"&&typeof a.maxRank=="number")for(let l=a.minRank;l<=a.maxRank;l++)l!==a.rank&&r(l,s)}return t.map(function(s){return xrt(e,s,n,i.get(s)||[])})}function Srt(e,t,n){let i=new au;e.forEach(function(r){n.forEach(l=>i.setEdge(l.left,l.right));let s=r.graph().root,a=lOe(r,s,i,t);a.vs.forEach((l,c)=>r.node(l).order=c),Ort(r,i,a.vs)})}function _K(e,t){Object.values(t).forEach(n=>n.forEach((i,r)=>e.node(i).order=r))}function krt(e,t){let n={};function i(r,s){let a=0,l=0,c=r.length,u=s[s.length-1];return s.forEach((d,f)=>{let h=Crt(e,d),p=h?e.node(h).order:c;(h||d===u)&&(s.slice(l,f+1).forEach(g=>{let b=e.predecessors(g);b&&b.forEach(v=>{let y=e.node(v),x=y.order;(x{let f=s[d];if(f!==void 0&&e.node(f).dummy){let h=e.predecessors(f);h&&h.forEach(p=>{if(p===void 0)return;let g=e.node(p);g.dummy&&(g.orderu)&&uOe(n,p,f)})}})}function r(s,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,i(a,u,f,l,c),u=f,l=c}}i(a,u,a.length,c,s.length)}),a}return t.length&&t.reduce(r),n}function Crt(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(i=>e.node(i).dummy)}}function uOe(e,t,n){if(t>n){let r=t;t=n,n=r}let i=e[t];i||(e[t]=i={}),i[n]=!0}function Trt(e,t,n){if(t>n){let r=t;t=n,n=r}let i=e[t];return i!==void 0&&Object.hasOwn(i,n)}function Art(e,t,n,i){let r={},s={},a={};return t.forEach(l=>{l.forEach((c,u)=>{r[c]=c,s[c]=c,a[c]=u})}),t.forEach(l=>{let c=-1;l.forEach(u=>{let d=i(u);if(d&&d.length){let f=d.sort((p,g)=>{let b=a[p],v=a[g];return(b!==void 0?b:0)-(v!==void 0?v:0)}),h=(f.length-1)/2;for(let p=Math.floor(h),g=Math.ceil(h);p<=g;++p){let b=f[p];if(b===void 0)continue;let v=a[b];if(v!==void 0&&s[u]===u&&c{var y;let x=(y=s[v.v])!=null?y:0,O=a.edge(v);return Math.max(b,x+(O!==void 0?O:0))},0):s[p]=0}function d(p){let g=a.outEdges(p),b=Number.POSITIVE_INFINITY;g&&(b=g.reduce((y,x)=>{let O=s[x.w],w=a.edge(x);return Math.min(y,(O!==void 0?O:0)-(w!==void 0?w:0))},Number.POSITIVE_INFINITY));let v=e.node(p);b!==Number.POSITIVE_INFINITY&&v.borderType!==l&&(s[p]=Math.max(s[p]!==void 0?s[p]:0,b))}function f(p){return a.predecessors(p)||[]}function h(p){return a.successors(p)||[]}return c(u,f),c(d,h),Object.keys(i).forEach(p=>{var g;let b=n[p];b!==void 0&&(s[p]=(g=s[b])!=null?g:0)}),s}function Nrt(e,t,n,i){let r=new au,s=e.graph(),a=Drt(s.nodesep,s.edgesep,i);return t.forEach(l=>{let c;l.forEach(u=>{let d=n[u];if(d!==void 0){if(r.setNode(d),c!==void 0){let f=n[c];if(f!==void 0){let h=r.edge(f,d);r.setEdge(f,d,Math.max(a(e,u,c),h||0))}}c=u}})}),r}function jrt(e,t){return Object.values(t).reduce((n,i)=>{let r=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;Object.entries(i).forEach(([l,c])=>{let u=Mrt(e,l)/2;r=Math.max(c+u,r),s=Math.min(c-u,s)});let a=r-s;return a{["l","r"].forEach(a=>{let l=s+a,c=e[l];if(!c||c===t)return;let u=Object.values(c),d=i-Cd(Math.min,u);a!=="l"&&(d=r-Cd(Math.max,u)),d&&(e[l]=BR(c,f=>f+d))})})}function Irt(e,t=void 0){let n=e.ul;return n?BR(n,(i,r)=>{var s,a;if(t){let c=t.toLowerCase(),u=e[c];if(u&&u[r]!==void 0)return u[r]}let l=Object.values(e).map(c=>{let u=c[r];return u!==void 0?u:0}).sort((c,u)=>c-u);return(((s=l[1])!=null?s:0)+((a=l[2])!=null?a:0))/2}):{}}function Prt(e){let t=aE(e),n=Object.assign(krt(e,t),Ert(e,t)),i={},r;["u","d"].forEach(a=>{r=a==="u"?t:Object.values(t).reverse(),["l","r"].forEach(l=>{l==="r"&&(r=r.map(d=>Object.values(d).reverse()));let c=Art(e,r,n,d=>(a==="u"?e.predecessors(d):e.successors(d))||[]),u=_rt(e,r,c.root,c.align,l==="r");l==="r"&&(u=BR(u,d=>-d)),i[a+l]=u})});let s=jrt(e,i);return Rrt(i,s),Irt(i,e.graph().align)}function Drt(e,t,n){return(i,r,s)=>{let a=i.node(r),l=i.node(s),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 Mrt(e,t){return e.node(t).width}function Lrt(e){e=Kwe(e),$rt(e),Object.entries(Prt(e)).forEach(([t,n])=>e.node(t).x=n)}function $rt(e){let t=aE(e),n=e.graph(),i=n.ranksep,r=n.rankalign,s=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);r==="top"?u.y=s+u.height/2:r==="bottom"?u.y=s+l-u.height/2:u.y=s+l/2}),s+=l+i})}function Frt(e,t={}){let n=t.debugTiming?Zwe:Jwe;return n("layout",()=>{let i=n(" buildLayoutGraph",()=>Krt(e));return n(" runLayout",()=>Brt(i,n,t)),n(" updateInputGraph",()=>Urt(e,i)),i})}function Brt(e,t,n){t(" makeSpaceForEdgeLabels",()=>Xrt(e)),t(" removeSelfEdges",()=>sst(e)),t(" acyclic",()=>_it(e)),t(" nestingGraph.run",()=>Jit(e)),t(" rank",()=>Hit(Kwe(e))),t(" injectEdgeLabelProxies",()=>Yrt(e)),t(" removeEmptyRanks",()=>mit(e)),t(" nestingGraph.cleanup",()=>nrt(e)),t(" normalizeRanks",()=>pit(e)),t(" assignRankMinMax",()=>Zrt(e)),t(" removeEdgeLabelProxies",()=>Jrt(e)),t(" normalize.run",()=>Rit(e)),t(" parentDummyChains",()=>Kit(e)),t(" addBorderSegments",()=>irt(e)),t(" order",()=>cOe(e,n)),t(" insertSelfEdges",()=>ast(e)),t(" adjustCoordinateSystem",()=>srt(e)),t(" position",()=>Lrt(e)),t(" positionSelfEdges",()=>ost(e)),t(" removeBorderNodes",()=>rst(e)),t(" normalize.undo",()=>Pit(e)),t(" fixupEdgeLabelCoords",()=>nst(e)),t(" undoCoordinateSystem",()=>art(e)),t(" translateGraph",()=>est(e)),t(" assignNodeIntersects",()=>tst(e)),t(" reversePoints",()=>ist(e)),t(" acyclic.undo",()=>jit(e))}function Urt(e,t){e.nodes().forEach(n=>{let i=e.node(n),r=t.node(n);i&&(i.x=r.x,i.y=r.y,i.order=r.order,i.rank=r.rank,t.children(n).length&&(i.width=r.width,i.height=r.height))}),e.edges().forEach(n=>{let i=e.edge(n),r=t.edge(n);i.points=r.points,Object.hasOwn(r,"x")&&(i.x=r.x,i.y=r.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var Qrt=["nodesep","edgesep","ranksep","marginx","marginy"],zrt={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},Vrt=["acyclicer","ranker","rankdir","align","rankalign"],Hrt=["width","height","rank"],NK={width:0,height:0},qrt=["minlen","weight","width","height","labeloffset"],Wrt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Grt=["labelpos"];function Krt(e){let t=new au({multigraph:!0,compound:!0}),n=fM(e.graph());return t.setGraph(Object.assign({},zrt,dM(n,Qrt),iN(n,Vrt))),e.nodes().forEach(i=>{let r=fM(e.node(i)),s=dM(r,Hrt);Object.keys(NK).forEach(l=>{s[l]===void 0&&(s[l]=NK[l])}),t.setNode(i,s);let a=e.parent(i);a!==void 0&&t.setParent(i,a)}),e.edges().forEach(i=>{let r=fM(e.edge(i));t.setEdge(i,Object.assign({},Wrt,dM(r,qrt),iN(r,Grt)))}),t}function Xrt(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let i=e.edge(n);i.minlen*=2,i.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?i.width+=i.labeloffset:i.height+=i.labeloffset)})}function Yrt(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let i=e.node(t.v),r={rank:(e.node(t.w).rank-i.rank)/2+i.rank,e:t};Fx(e,"edge-proxy",r,"_ep")}})}function Zrt(e){let t=0;e.nodes().forEach(n=>{let i=e.node(n);i.borderTop&&(i.minRank=e.node(i.borderTop).rank,i.maxRank=e.node(i.borderBottom).rank,t=Math.max(t,i.maxRank))}),e.graph().maxRank=t}function Jrt(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="edge-proxy"){let i=n;e.edge(i.e).labelRank=n.rank,e.removeNode(t)}})}function est(e){let t=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,r=0,s=e.graph(),a=s.marginx||0,l=s.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),i=Math.min(i,f-p/2),r=Math.max(r,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,i-=l,e.nodes().forEach(u=>{let d=e.node(u);d.x-=t,d.y-=i}),e.edges().forEach(u=>{let d=e.edge(u);d.points.forEach(f=>{f.x-=t,f.y-=i}),Object.hasOwn(d,"x")&&(d.x-=t),Object.hasOwn(d,"y")&&(d.y-=i)}),s.width=n-t+a,s.height=r-i+l}function tst(e){e.edges().forEach(t=>{let n=e.edge(t),i=e.node(t.v),r=e.node(t.w),s,a;n.points?(s=n.points[0],a=n.points[n.points.length-1]):(n.points=[],s=r,a=i),n.points.unshift(xK(i,s)),n.points.push(xK(r,a))})}function nst(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 ist(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function rst(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),i=e.node(n.borderTop),r=e.node(n.borderBottom),s=e.node(n.borderLeft[n.borderLeft.length-1]),a=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(a.x-s.x),n.height=Math.abs(r.y-i.y),n.x=s.x+n.width/2,n.y=i.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy==="border"&&e.removeNode(t)})}function sst(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 ast(e){aE(e).forEach(t=>{let n=0;t.forEach((i,r)=>{let s=e.node(i);s.order=r+n,(s.selfEdges||[]).forEach(a=>{Fx(e,"selfedge",{width:a.label.width,height:a.label.height,rank:s.rank,order:r+ ++n,e:a.e,label:a.label},"_se")}),delete s.selfEdges})})}function ost(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="selfedge"){let i=n,r=e.node(i.e.v),s=r.x+r.width/2,a=r.y,l=n.x-s,c=r.height/2;e.setEdge(i.e,i.label),e.removeNode(t),i.label.points=[{x:s+2*l/3,y:a-c},{x:s+5*l/6,y:a-c},{x:s+l,y:a},{x:s+5*l/6,y:a+c},{x:s+2*l/3,y:a+c}],i.label.x=n.x,i.label.y=n.y}})}function dM(e,t){return BR(iN(e,t),Number)}function fM(e){let t={};return e&&Object.entries(e).forEach(([n,i])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=i}),t}function lst(e){let t=aE(e),n=new au({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(i=>{n.setNode(i,{label:i}),n.setParent(i,"layer"+e.node(i).rank)}),e.edges().forEach(i=>n.setEdge(i.v,i.w,{},i.name)),t.forEach((i,r)=>{let s="layer"+r;n.setNode(s,{rank:"same"}),i.reduce((a,l)=>(n.setEdge(a,l,{style:"invis"}),l))}),n}var cst={graphlib:Bwe,version:xit,layout:Frt,debug:lst,util:{time:Zwe,notime:Jwe}},jK=cst;/*! For license information please see dagre.esm.js.LEGAL.txt */const Dw={llm:{labelKey:"buildCanvas.patterns.llm.label",descriptionKey:"buildCanvas.patterns.llm.description",icon:kbe},sequential:{labelKey:"buildCanvas.patterns.sequential.label",descriptionKey:"buildCanvas.patterns.sequential.description",icon:S7e},parallel:{labelKey:"buildCanvas.patterns.parallel.label",descriptionKey:"buildCanvas.patterns.parallel.description",icon:i7e},loop:{labelKey:"buildCanvas.patterns.loop.label",descriptionKey:"buildCanvas.patterns.loop.description",icon:Abe},a2a:{labelKey:"buildCanvas.patterns.a2a.label",descriptionKey:"buildCanvas.patterns.a2a.description",icon:Zj}},h6=220,p6=88,RK=96,IK=34,kO=64,hM=310,Ny=24,dOe=56,m6=40,PK=40,ust=18,dst=58,fst=!1,hst=e=>e==="sequential"||e==="parallel"||e==="loop";function g6(e,t){const n=e.agentType??"llm";return hst(n)||n==="llm"&&(t.length===0||e.subAgents.length>0)}function b6(e,t=[],n="horizontal",i=!1){const r=e.agentType??"llm";if(!g6(e,t))return{width:h6,height:p6};if(i&&e.subAgents.length===0)return{width:hM,height:kO};const s=e.subAgents.map((f,h)=>b6(f,[...t,h],n,i)),a=s.length?Math.max(...s.map(f=>f.width)):0,l=s.length?Math.max(...s.map(f=>f.height)):0,c=s.length&&r!=="parallel"?dOe:Ny,u=n==="horizontal"?r!=="parallel":r==="parallel",d=s.length?r==="parallel"?ust+PK:r==="loop"?dst:0:PK;return u?{width:Math.max(hM,s.reduce((f,h)=>f+h.width,0)+m6*Math.max(0,s.length-1)+c*2),height:kO+Ny+l+d+Ny}:{width:Math.max(hM,a+Ny*2),height:kO+c+s.reduce((f,h)=>f+h.height,0)+m6*Math.max(0,s.length-1)+d+c}}function B1(e){return e.length===0?"agent-root":`agent-${e.join("-")}`}function pst(e,t){return e.length===t.length&&e.every((n,i)=>n===t[i])}function DK(e){const t=n=>[n.agentType??"llm",n.subAgents.map(t)];return JSON.stringify(t(e))}function U1(e,t,n,i){const r=(i==null?void 0:i.tone)==="sequential"?"hsl(213 40% 40%)":(i==null?void 0:i.tone)==="loop"?"hsl(151 34% 34%)":"hsl(220 9% 38%)";return{id:`${e}-${t}${i!=null&&i.loop?"-loop":""}`,source:e,target:t,sourceHandle:i!=null&&i.loop?"loop-source":void 0,targetHandle:i!=null&&i.loop?"loop-target":void 0,label:n,type:"insertStep",data:i?{insert:i.insert,loop:i.loop,tone:i.tone}:void 0,animated:i==null?void 0:i.loop,markerEnd:{type:RS.ArrowClosed,width:16,height:16,color:r},style:{stroke:r,strokeWidth:1.5},labelStyle:{fill:"hsl(215 14% 42%)",fontSize:10,fontWeight:600},labelBgStyle:{fill:"hsl(var(--background))",fillOpacity:.92}}}function MK(e,t,n=!1,i){const r=[{id:"terminal-input",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:i("buildCanvas.terminals.input")},selectable:!1,draggable:!1},{id:"terminal-output",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:i("buildCanvas.terminals.output")},selectable:!1,draggable:!1}],s=[];function a(f,h,p,g,b){const v=f.agentType??"llm",y=B1(h);return g6(f,h)?(l(f,h,p,g,b),y):(r.push({id:y,type:"agent",parentId:p,extent:"parent",position:g,data:{kind:"agent",path:h,agent:f,title:v==="a2a"?i("buildCanvas.patterns.a2a.label"):f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i("buildCanvas.unnamedStep")),pattern:v,description:f.description.trim()||i(Dw[v].descriptionKey),childCount:f.subAgents.length,containedIn:b}}),y)}function l(f,h,p,g={x:0,y:0},b){const v=f.agentType??"sequential",y=B1(h),x=b6(f,h,t,n);r.push({id:y,type:"group",parentId:p,extent:p?"parent":void 0,position:g,style:{width:x.width,height:x.height},data:{kind:"agent",path:h,agent:f,title:f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i(Dw[v].labelKey)),pattern:v,description:f.description.trim()||i(Dw[v].descriptionKey),childCount:f.subAgents.length,containedIn:b,layoutWidth:x.width,layoutHeight:x.height,compactEmptyGroup:n&&f.subAgents.length===0}});const O=f.subAgents.map((C,N)=>b6(C,[...h,N],t,n)),w=O.length&&v!=="parallel"?dOe:Ny,k=t==="horizontal"?v!=="parallel":v==="parallel";let S=w;const E=f.subAgents.map((C,N)=>{const _=O[N],j=k?{x:S,y:kO+Ny}:{x:(x.width-_.width)/2,y:kO+S};return S+=(k?_.width:_.height)+m6,a(C,[...h,N],y,j,v)});if(v==="sequential"||v==="loop"){for(let C=0;C1&&s.push(U1(E[E.length-1],E[0],i("buildCanvas.edges.continueLoop"),{loop:!0,tone:"loop"}))}return y}const c=(f,h)=>{const p=f.agentType??"llm",g=B1(h);if(g6(f,h))return l(f,h),[g];if(r.push({id:g,type:"agent",position:{x:0,y:0},data:{kind:"agent",path:h,agent:f,title:p==="a2a"?i("buildCanvas.patterns.a2a.label"):f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i("buildCanvas.unnamedStep")),pattern:p,description:f.description.trim()||i(Dw[p].descriptionKey),childCount:f.subAgents.length}}),f.subAgents.length===0)return[g];const b=[];return f.subAgents.forEach((v,y)=>{const x=[...h,y],O=B1(x);s.push(U1(g,O,i("buildCanvas.edges.call"),{insert:{parentPath:h,index:y}})),b.push(...c(v,x))}),b},u=B1([]),d=c(e,[]);return s.push(U1("terminal-input",u)),d.forEach(f=>s.push(U1(f,"terminal-output"))),mst(r,s,t)}function mst(e,t,n){const i=new jK.graphlib.Graph().setDefaultEdgeLabel(()=>({}));i.setGraph({rankdir:n==="vertical"?"TB":"LR",ranksep:50,nodesep:34,edgesep:14,marginx:24,marginy:24});const r=new Set(e.filter(s=>!s.parentId).map(s=>s.id));return e.filter(s=>!s.parentId).forEach(s=>{const a=s.data.kind==="terminal";i.setNode(s.id,{width:a?RK:s.data.layoutWidth??h6,height:a?IK:s.data.layoutHeight??p6})}),t.filter(s=>r.has(s.source)&&r.has(s.target)).forEach(s=>i.setEdge(s.source,s.target)),jK.layout(i),{nodes:e.map(s=>{if(s.parentId)return s;const a=i.node(s.id),l=s.data.kind==="terminal",c=l?RK:s.data.layoutWidth??h6,u=l?IK:s.data.layoutHeight??p6;return{...s,position:{x:a.x-c/2,y:a.y-u/2}}}),edges:t}}const QR=m.createContext(null),zR=m.createContext("horizontal");function gst({id:e,sourceX:t,sourceY:n,targetX:i,targetY:r,sourcePosition:s,targetPosition:a,markerEnd:l,style:c,label:u,data:d}){const{t:f}=Ce("create"),h=m.useContext(QR),[p,g]=m.useState(!1),[b,v,y]=J_({sourceX:t,sourceY:n,targetX:i,targetY:r,sourcePosition:s,targetPosition:a,offset:d!=null&&d.loop?28:20});return o.jsxs(o.Fragment,{children:[o.jsx(sE,{id:e,path:b,markerEnd:l,style:c}),h&&(d==null?void 0:d.insert)&&o.jsx("path",{d:b,className:"abc-edge-hover-path",onPointerEnter:()=>g(!0),onPointerLeave:()=>g(!1)}),(u||h&&(d==null?void 0:d.insert))&&o.jsx(lnt,{children:o.jsxs("div",{className:`abc-edge-tools${h&&(d!=null&&d.insert)?" can-insert":""}${p?" is-visible":""}`,style:{transform:`translate(-50%, -50%) translate(${v}px, ${y}px)`},onPointerEnter:()=>g(!0),onPointerLeave:()=>g(!1),children:[u&&o.jsx("span",{className:"abc-edge-label",children:u}),h&&(d==null?void 0:d.insert)&&o.jsx("button",{type:"button",className:"abc-edge-add nodrag nopan","aria-label":f("buildCanvas.actions.insertHere"),title:f("buildCanvas.actions.insertHere"),onClick:x=>{x.stopPropagation(),h==null||h.onInsert(d.insert.parentPath,d.insert.index)},children:o.jsx($o,{})})]})})]})}function bst({data:e,selected:t}){const{t:n}=Ce("create"),i=m.useContext(QR),r=m.useContext(zR),s=r==="vertical"?an.Top:an.Left,a=r==="vertical"?an.Bottom:an.Right,l=r==="vertical"?an.Right:an.Bottom,c=e.pattern??"llm",u=Dw[c],d=u.icon;return o.jsxs("div",{className:`abc-node is-${c}${e.containedIn?` is-contained-in-${e.containedIn}`:""}${t?" is-selected":""}`,children:[o.jsx(fl,{type:"target",position:s,className:"abc-handle"}),c!=="llm"&&o.jsx("span",{className:"abc-node-icon",children:o.jsx(d,{})}),o.jsxs("span",{className:"abc-node-copy",children:[o.jsx("span",{className:"abc-node-meta",children:o.jsx("span",{children:n(u.labelKey)})}),o.jsx("strong",{children:e.title}),o.jsx("small",{children:e.description})]}),i&&e.path!==void 0&&e.path.length>0&&o.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":n("buildCanvas.actions.deleteNamed",{name:e.title}),title:n("buildCanvas.actions.deleteNode"),onClick:f=>{f.stopPropagation(),i==null||i.onDelete(e.path)},children:o.jsx(pm,{})}),o.jsx(fl,{type:"source",position:a,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(fl,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),o.jsx(fl,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function yst({data:e,selected:t}){const{t:n}=Ce("create"),i=m.useContext(QR),r=m.useContext(zR),s=r==="vertical"?an.Top:an.Left,a=r==="vertical"?an.Bottom:an.Right,l=r==="vertical"?an.Right:an.Bottom,c=e.pattern??"sequential",u=e.childCount??0,d=n(c==="llm"?"buildCanvas.actions.addSubagent":c==="parallel"?"buildCanvas.actions.addParallelStep":c==="loop"?"buildCanvas.actions.addLoopStep":"buildCanvas.actions.addNextStep");return o.jsxs("div",{className:`abc-group is-${c}${e.compactEmptyGroup?" is-compact-empty":""}${t?" is-selected":""}`,children:[o.jsx(fl,{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})]})}),i&&e.path!==void 0&&u>0&&c!=="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":n("buildCanvas.actions.addFirst"),title:n("buildCanvas.actions.addFirst"),onClick:f=>{f.stopPropagation(),i.onInsert(e.path,0)},children:o.jsx($o,{})}),o.jsx("button",{type:"button",className:"abc-group-boundary-add is-end nodrag nopan","aria-label":n("buildCanvas.actions.addLast"),title:n("buildCanvas.actions.addLast"),onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:o.jsx($o,{})})]}),i&&e.path!==void 0&&u>0&&c==="parallel"&&o.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-bottom nodrag nopan",onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:[o.jsx($o,{}),o.jsx("span",{children:d})]}),i&&e.path!==void 0&&u===0&&o.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-empty nodrag nopan",onClick:f=>{f.stopPropagation(),i.onAdd(e.path)},children:[o.jsx($o,{}),o.jsx("span",{children:d})]}),i&&e.path!==void 0&&e.path.length>0&&o.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":n("buildCanvas.actions.deleteNamed",{name:e.title}),title:n("buildCanvas.actions.deleteNode"),onClick:f=>{f.stopPropagation(),i==null||i.onDelete(e.path)},children:o.jsx(pm,{})}),o.jsx(fl,{type:"source",position:a,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(fl,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),o.jsx(fl,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function vst({data:e}){const t=m.useContext(zR);return o.jsxs("div",{className:"abc-terminal",children:[o.jsx(fl,{type:"target",position:t==="vertical"?an.Top:an.Left,className:"abc-handle"}),o.jsx("span",{children:e.title}),o.jsx(fl,{type:"source",position:t==="vertical"?an.Bottom:an.Right,className:"abc-handle"})]})}const xst={agent:bst,group:yst,terminal:vst},wst={insertStep:gst};function Ost({draft:e,selectedPath:t,onSelect:n,onAdd:i,onInsert:r,onDelete:s,readOnly:a=!1,interactivePreview:l=!1,direction:c="horizontal"}){const{t:u}=Ce("create"),d=m.useMemo(()=>MK(e,c,a,u),[]),[f,h,p]=cnt(d.nodes),[g,b,v]=unt(d.edges),y=fnt(),x=m.useRef(`${c}:${a?"readonly":"editable"}:${DK(e)}`),O=m.useRef(null),{fitView:w}=$R(),k=m.useMemo(()=>MK(e,c,a,u),[c,e,a,u]),[S,E]=m.useState(()=>window.matchMedia("(max-width: 860px)").matches),C=m.useMemo(()=>a?{padding:.16,minZoom:.05,maxZoom:.9}:S?{padding:.08,minZoom:.35,maxZoom:.9}:{padding:.14,minZoom:.42,maxZoom:1.1},[S,a]),N=m.useCallback((j=0)=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const A=O.current;if(A&&(A.clientWidth===0||A.clientHeight===0)&&j<8){N(j+1);return}w(C)})})},[C,w]);m.useEffect(()=>{const j=window.matchMedia("(max-width: 860px)"),A=F=>E(F.matches);return j.addEventListener("change",A),()=>j.removeEventListener("change",A)},[]),m.useEffect(()=>{const j=`${c}:${a?"readonly":"editable"}:${DK(e)}`,A=j!==x.current;x.current=j,b(k.edges),h(F=>{const T=new Map(F.map(P=>[P.id,P]));return k.nodes.map(P=>{const R=T.get(P.id);return{...P,measured:!A&&R&&R.type===P.type?R.measured:void 0,position:!A&&R?R.position:P.position,selected:P.data.kind==="agent"&&!!P.data.path&&pst(P.data.path,t)}})}),A&&N()},[k,e,N,t,b,h]),m.useEffect(()=>{N()},[S,N]),m.useEffect(()=>{y&&N()},[k,N,y]),m.useEffect(()=>{if(!a||!O.current)return;const j=new ResizeObserver(()=>N());return j.observe(O.current),N(),()=>j.disconnect()},[N,a]);const _=m.useMemo(()=>a?null:{onAdd:i,onInsert:r,onDelete:s},[i,s,r,a]);return o.jsx(zR.Provider,{value:c,children:o.jsx(QR.Provider,{value:_,children:o.jsx("section",{className:`abc-root is-${c}${a?" is-readonly":""}`,"aria-label":u(a?"buildCanvas.readOnlyLabel":"buildCanvas.label"),children:o.jsx("div",{ref:O,className:"abc-canvas",children:o.jsxs(ant,{nodes:f,edges:g,nodeTypes:xst,edgeTypes:wst,onNodesChange:p,onEdgesChange:v,onNodeClick:(j,A)=>{!a&&A.data.kind==="agent"&&A.data.path&&n(A.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:C,onInit:()=>N(),minZoom:a?.05:.35,maxZoom:1.6,proOptions:{hideAttribution:!0},ariaLabelConfig:{"controls.ariaLabel":u("buildCanvas.controls.ariaLabel"),"controls.zoomIn.ariaLabel":u("buildCanvas.controls.zoomIn"),"controls.zoomOut.ariaLabel":u("buildCanvas.controls.zoomOut"),"controls.fitView.ariaLabel":u("buildCanvas.controls.fitView")},children:[o.jsx(bnt,{gap:20,size:1.2,color:"hsl(34 20% 82%)"}),(!a||l)&&o.jsx(knt,{showInteractive:!1}),fst]})})})})})}function LS(e){return o.jsx(Dwe,{children:o.jsx(Ost,{...e})})}ln.hasResourceBundle("en-US","create")||ln.addResourceBundle("en-US","create",vse,!0,!0);ln.hasResourceBundle("zh-CN","create")||ln.addResourceBundle("zh-CN","create",Mce,!0,!0);function Qt(e,t={}){return ln.t(e,{...t,ns:"create"})}function oE(e,t){return e.map(n=>({...n,get label(){return Qt(`${t}.${n.id}.label`)},get desc(){return Qt(`${t}.${n.id}.description`)}}))}function qc(e,t){const n={...e};for(const[i,r]of Object.entries(t))Object.defineProperty(n,i,{configurable:!0,enumerable:!0,get:()=>Qt(r)});return n}const fOe="https://ark.cn-beijing.volces.com/api/v3/";qc({key:"MODEL_AGENT_NAME",required:!1,placeholder:"doubao-seed-1-6-250615"},{comment:"traditional.catalog.env.modelAgentName.comment"});const pA=[qc({key:"MODEL_EMBEDDING_NAME",required:!1,placeholder:"doubao-embedding-vision-250615"},{comment:"traditional.catalog.env.embeddingModelName.comment"}),{key:"MODEL_EMBEDDING_DIM",required:!1,placeholder:"2048"},{key:"MODEL_EMBEDDING_API_BASE",required:!1,placeholder:fOe}],rN=[],sN={get label(){return Qt("traditional.catalog.links.console")},url:"https://console.volcengine.com/vikingdb/openviking"},Sst={get label(){return Qt("traditional.catalog.links.documentation")},url:"https://github.com/volcengine/OpenViking/blob/main/docs/zh/api/05-sessions.md"},hOe="https://api.vikingdb.cn-beijing.volces.com/openviking",kst=`{ "self": {"enabled": true}, "peer": {"enabled": true}, "working_memory": {"enabled": true}, "memory_types": null -}`,Est=[{key:"DATABASE_VIKING_PROJECT",required:!1,placeholder:"default"},{key:"DATABASE_VIKING_REGION",required:!1},{key:"DATABASE_VIKING_COLLECTION_KIND",required:!1},{key:"DATABASE_VIKING_RESOURCE_ID",required:!1}],Cst=[qc({key:"DATABASE_VIKINGMEM_PROJECT",required:!1,placeholder:"default",hidden:!0},{comment:"traditional.catalog.env.vikingMemoryProject.comment"}),qc({key:"DATABASE_VIKING_REGION",required:!1,hidden:!0},{comment:"traditional.catalog.env.vikingMemoryRegion.comment"}),qc({key:"DATABASE_VIKINGMEM_MEMORY_TYPE",required:!1,placeholder:"sys_event_v1,sys_profile_v1",hidden:!0},{comment:"traditional.catalog.env.vikingMemoryType.comment"})],Mw=[qc({key:"FEISHU_APP_ID",required:!0,placeholder:"cli_xxx"},{comment:"traditional.catalog.env.feishuAppId.comment"}),qc({key:"FEISHU_APP_SECRET",required:!0,secret:!0},{placeholder:"traditional.catalog.env.feishuAppSecret.placeholder",comment:"traditional.catalog.env.feishuAppSecret.comment"})],nv={topK:"3",region:"cn-beijing",endpoint:"https://open.volcengineapi.com/"};function VR(e){if(e==="byteplus"){const t="ap-southeast-1";return{topK:nv.topK,region:t,endpoint:`https://agentkit.${t}.byteplusapi.com/`}}return nv}const pOe=[qc({key:"REGISTRY_SPACE_ID",required:!0},{placeholder:"traditional.catalog.env.registrySpaceId.placeholder",comment:"traditional.catalog.env.registrySpaceId.comment"}),qc({key:"REGISTRY_TOP_K",required:!1,placeholder:nv.topK},{comment:"traditional.catalog.env.registryTopK.comment"}),qc({key:"REGISTRY_REGION",required:!1,placeholder:nv.region},{comment:"traditional.catalog.env.registryRegion.comment"}),qc({key:"REGISTRY_ENDPOINT",required:!1,placeholder:nv.endpoint},{comment:"traditional.catalog.env.registryEndpoint.comment"})],Bx=oE([{id:"web_search",importLine:"from veadk.tools.builtin_tools.web_search import web_search",toolNames:["web_search"],env:rN},{id:"parallel_web_search",importLine:"from veadk.tools.builtin_tools.parallel_web_search import parallel_web_search",toolNames:["parallel_web_search"],env:rN},{id:"link_reader",importLine:"from veadk.tools.builtin_tools.link_reader import link_reader",toolNames:["link_reader"],env:[]},{id:"web_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",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",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",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",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",importLine:"from veadk.tools.builtin_tools.run_code import run_code",toolNames:["run_code"],env:[{key:"AGENTKIT_TOOL_ID",required:!0,placeholder:"t-xxxx",get comment(){return Lt("traditional.catalog.env.agentKitToolId.comment")}},{key:"AGENTKIT_TOOL_REGION",required:!1,placeholder:"cn-beijing",get comment(){return Lt("traditional.catalog.env.agentKitToolRegion.comment")}}]},{id:"vesearch",importLine:"from veadk.tools.builtin_tools.vesearch import vesearch",toolNames:["vesearch"],env:[{key:"TOOL_VESEARCH_ENDPOINT",required:!0,comment:"VeSearch bot_id"}]}],"traditional.catalog"),Tst=new Set(["web_scraper","text_to_speech","vesearch"]),Ast=new Set(["web_search","parallel_web_search"]),_st=Bx.filter(e=>!Tst.has(e.id));function mOe(e="volcengine"){const t=e==="byteplus"?Ast:new Set;return _st.filter(n=>!t.has(n.id))}const iv=oE([{id:"local",env:[]},{id:"sqlite",extraArgs:'local_database_path="./short_term_memory.db"',env:[]},{id:"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",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}]}],"traditional.backends.shortTerm"),y6=oE([{id:"local",env:pA,pipExtra:"extensions",needsEmbedding:!0},{id:"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},...pA],pipExtra:"extensions",needsEmbedding:!0},{id:"redis",env:[{key:"DATABASE_REDIS_HOST",required:!0},{key:"DATABASE_REDIS_PORT",required:!1,placeholder:"6379"},{key:"DATABASE_REDIS_PASSWORD",required:!1},...pA],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",env:Cst},{id:"openviking",env:[{key:"DATABASE_OPENVIKING_URL",required:!0,placeholder:hOe,get comment(){return Lt("traditional.catalog.env.openVikingUrl.comment")},link:sN},{key:"DATABASE_OPENVIKING_API_KEY",required:!0,comment:"OpenViking API Key",link:sN},{key:"DATABASE_OPENVIKING_USER_ID",required:!1,placeholder:"default",get comment(){return Lt("traditional.catalog.env.openVikingMemoryUserId.comment")},get help(){return Lt("traditional.catalog.env.openVikingMemoryUserId.help")}},{key:"DATABASE_OPENVIKING_MEMORY_POLICY",required:!1,placeholder:kst,get comment(){return Lt("traditional.catalog.env.openVikingMemoryPolicy.comment")},multiline:!0,format:"json",get help(){return Lt("traditional.catalog.env.openVikingMemoryPolicy.help")},link:Sst}]},{id:"mem0",env:[{key:"DATABASE_MEM0_API_KEY",required:!0},{key:"DATABASE_MEM0_BASE_URL",required:!1}],pipExtra:"database"}],"traditional.backends.longTerm"),nm="viking",v6=oE([{id:"viking",env:Est},{id:"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},...pA],pipExtra:"extensions",needsEmbedding:!0},{id:"context_search",env:[...rN,{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ID",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ENDPOINT",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_APIKEY",required:!0}]},{id:"openviking",env:[{key:"DATABASE_OPENVIKING_URL",required:!0,placeholder:hOe,get comment(){return Lt("traditional.catalog.env.openVikingUrl.comment")},link:sN},{key:"DATABASE_OPENVIKING_API_KEY",required:!0,comment:"OpenViking API Key",link:sN},{key:"DATABASE_OPENVIKING_USER_ID",required:!1,placeholder:"default",get comment(){return Lt("traditional.catalog.env.openVikingKnowledgeUserId.comment")},get help(){return Lt("traditional.catalog.env.openVikingKnowledgeUserId.help")}},{key:"DATABASE_OPENVIKING_TARGET_URI",required:!1,placeholder:"viking://user/default/resources//",get comment(){return Lt("traditional.catalog.env.openVikingTargetUri.comment")},get help(){return Lt("traditional.catalog.env.openVikingTargetUri.help")}}]}],"traditional.backends.knowledge"),Nst=oE([{id:"apmplus",enableFlag:"ENABLE_APMPLUS",env:[{key:"OBSERVABILITY_OPENTELEMETRY_APMPLUS_SERVICE_NAME",required:!1}]},{id:"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",enableFlag:"ENABLE_TLS",env:[...rN,qc({key:"OBSERVABILITY_OPENTELEMETRY_TLS_SERVICE_NAME",required:!1},{comment:"traditional.catalog.env.tlsServiceName.comment"})]}],"traditional.exporters");function oc(e="volcengine"){return{name:"",description:Lt("defaults.description"),instruction:Lt("defaults.instruction"),dynamicAgentDelegation:!1,agentType:"llm",cloudProvider:e,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:wh(e),modelSource:"ark",modelProvider:"",modelApiBase:"",shortTermBackend:"local",longTermBackend:"local",longTermMemoryIndex:"",autoSaveSession:!1,knowledgebaseBackend:nm,knowledgebaseIndex:"",tracingExporters:[],selectedSkills:[],cloudEnvironment:{environmentId:"",environmentVersionId:""},deployment:{feishuEnabled:!1,modelApiKeyId:"",modelApiKeyName:""}}}function Q1(e){return{id:e,get displayName(){return Lt(`traditional.optimization.options.${e}.label`)},get description(){return Lt(`traditional.optimization.options.${e}.description`)}}}const xB=[Q1("context_engine"),Q1("compressor"),Q1("verifier"),Q1("long_run_control"),Q1("mcp_resilience")],jst=[{id:"quality",get displayName(){return Lt("traditional.optimization.groups.quality")},componentIds:["context_engine","verifier"]},{id:"cost",get displayName(){return Lt("traditional.optimization.groups.cost")},componentIds:["compressor"]},{id:"stability",get displayName(){return Lt("traditional.optimization.groups.stability")},componentIds:["long_run_control","mcp_resilience"]}],Ux=xB.map(e=>e.id);function Rst(e){return e==="byteplus"?Lt("traditional.optimization.bytePlusUnavailable"):null}const gOe=["context_engine","compressor","verifier","long_run_control"],Ist=new Set(["1","true","yes","on"]),wB=[{id:"default",get displayName(){return Lt("traditional.optimization.profiles.default.label")},get description(){return Lt("traditional.optimization.profiles.default.description")},defaultComponents:[],autoAddedComponents:[]},{id:"ops",get displayName(){return Lt("traditional.optimization.profiles.ops.label")},get description(){return Lt("traditional.optimization.profiles.ops.description")},defaultComponents:["context_engine","verifier","long_run_control","mcp_resilience"],autoAddedComponents:["sql_readonly"]}];function mA(e){var t;return((t=xB.find(n=>n.id===e))==null?void 0:t.displayName)??e}function Pst(e){var t;return((t=wB.find(n=>n.id===e))==null?void 0:t.displayName)??e}function OB(e){const t=wB.find(n=>n.id===e);return t?[...t.defaultComponents]:[]}function Lg(e,t="default"){const n=new Set(e);return{enabled:n.size>0,profile:t,componentOverrides:Object.fromEntries(Ux.map(r=>[r,n.has(r)]))}}function SB(e){if(!e)return;const t=e.profile==="ops"?"ops":"default",n=t==="ops"?OB(t):Ux.filter(i=>{var r;return((r=e.componentOverrides)==null?void 0:r[i])===!0});return{...Lg(n,t),...e.catalogVersion?{catalogVersion:e.catalogVersion}:{},...e.planHash?{planHash:e.planHash}:{}}}function pM(e){return Ist.has((e==null?void 0:e.trim().toLowerCase())??"")}function Dst(e){if(!e)return null;try{const t=JSON.parse(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:null}catch{return null}}function Mst(e){var a;const t=new Map((e==null?void 0:e.map(({key:l,value:c})=>[l,c]))??[]),n=t.get("HARNESS_SIDECAR_ENABLED");if(n===void 0)return null;const i=((a=t.get("HARNESS_PROFILE"))==null?void 0:a.trim())==="ops"?"ops":"default";if(!pM(n))return Lg([],i);const r=Dst(t.get("HARNESS_SIDECAR_COMPONENT_OVERRIDES"));if(r){const l={...Lg(Ux.filter(c=>r[c]===!0),i),enabled:!0};return i==="ops"?SB(l)??l:l}if(i==="ops")return Lg(OB(i),i);const s=[...pM(t.get("HARNESS_MODEL_PROXY_ENABLED"))?gOe:[],...pM(t.get("HARNESS_MCP_GATEWAY_ENABLED"))?["mcp_resilience"]:[]];return{...Lg(s,i),enabled:!0}}function Lst(e,t){return{...e,modelName:t.modelName||e.modelName,description:t.description,instruction:t.instruction}}function $st(e){var t;return((t=e.harnessSidecar)==null?void 0:t.profile)??"default"}function aN(e){var n;const t=(n=e.harnessSidecar)==null?void 0:n.componentOverrides;return t?Ux.filter(i=>t[i]):[]}function Fst(e){const t=new Set(aN(e));return gOe.filter(n=>t.has(n))}function Bst(e,t){const n=i=>({...i,mcpTools:(i.mcpTools??[]).map(r=>{var a,l;const s=!!(r.authTokenEnv&&(t.has(r.authTokenEnv)||r.authToken));return{...r,credentialConfigured:s,...s?{credentialSourceUrl:((a=r.url)==null?void 0:a.trim())??"",credentialSourceAuthTokenEnv:((l=r.authTokenEnv)==null?void 0:l.trim())??""}:{}}}),subAgents:i.subAgents.map(n),...i.workflow?{workflow:{...i.workflow,nodes:i.workflow.nodes.map(r=>({...r,agent:n(r.agent)}))}}:{}});return n(e)}function Yb(e){const t=(e==null?void 0:e.trim())??"",n=t.indexOf("/");return n<=0||n===t.length-1?{modelName:t,modelProvider:""}:{modelName:t.slice(n+1),modelProvider:t.slice(0,n)}}function kB(e){return Yb(e).modelName}function bOe(e,t,n,i=!1){var c,u,d,f;const r=Yb((t==null?void 0:t.model)||(n==null?void 0:n.model)),s=(t==null?void 0:t.children)??[],a=t==null?void 0:t.type,l=e.agentType==="a2a"&&((c=e.a2aRegistry)!=null&&c.enabled)&&a==="llm"?"a2a":a??e.agentType;return{...e,name:((u=t==null?void 0:t.name)==null?void 0:u.trim())||((d=n==null?void 0:n.name)==null?void 0:d.trim())||e.name,description:(t==null?void 0:t.description)??e.description,instruction:i?e.instruction:(t==null?void 0:t.instruction)??e.instruction,agentType:l,modelName:r.modelName||e.modelName,modelProvider:r.modelProvider||e.modelProvider,skills:((f=t==null?void 0:t.skills)==null?void 0:f.map(h=>h.name))??e.skills,subAgents:e.subAgents.map((h,p)=>bOe(h,s[p],void 0,i))}}function Ust(e,t){const n=new Map(t.map(({key:a,value:l})=>[a,l]));if(!["REGISTRY_SPACE_ID","REGISTRY_TOP_K","REGISTRY_REGION","REGISTRY_ENDPOINT"].some(a=>n.has(a)))return e;const r=(a,l)=>n.has(a)?n.get(a)??"":l??"",s=a=>{var l;return{...a,...(l=a.a2aRegistry)!=null&&l.enabled?{a2aRegistry:{...a.a2aRegistry,registrySpaceId:r("REGISTRY_SPACE_ID",a.a2aRegistry.registrySpaceId),registryTopK:r("REGISTRY_TOP_K",a.a2aRegistry.registryTopK),registryRegion:r("REGISTRY_REGION",a.a2aRegistry.registryRegion),registryEndpoint:r("REGISTRY_ENDPOINT",a.a2aRegistry.registryEndpoint)}}:{},subAgents:a.subAgents.map(s)}};return s(e)}function x6(e,t){var c,u,d;const n=e.cloudProvider??t,i=oc(n),r=e.deployment,s=r==null?void 0:r.network,a=e.cloudEnvironment,l=e.a2aRegistry;return{...i,...e,name:e.name??i.name,description:e.description??i.description,instruction:e.instruction??i.instruction,agentType:e.agentType??i.agentType,cloudProvider:n,maxIterations:e.maxIterations??i.maxIterations,a2aUrl:e.a2aUrl??i.a2aUrl,model:e.model??void 0,modelSource:e.modelSource==="ark"||e.modelSource==="custom"?e.modelSource:void 0,modelName:e.modelName??i.modelName,modelProvider:e.modelProvider??i.modelProvider,modelApiBase:e.modelApiBase??i.modelApiBase,memory:{shortTerm:((c=e.memory)==null?void 0:c.shortTerm)??i.memory.shortTerm,longTerm:((u=e.memory)==null?void 0:u.longTerm)??i.memory.longTerm},tools:[...e.tools??[]],skills:[...e.skills??[]],knowledgebase:e.knowledgebase??i.knowledgebase,tracing:e.tracing??i.tracing,harnessSidecar:SB(e.harnessSidecar),subAgents:(e.subAgents??[]).map(f=>x6(f,n)),builtinTools:[...e.builtinTools??[]],customTools:[...e.customTools??[]],mcpTools:[...e.mcpTools??[]],a2aRegistry:{...i.a2aRegistry,...l??{},enabled:(l==null?void 0:l.enabled)??!1,registrySpaceId:(l==null?void 0:l.registrySpaceId)??"",registryTopK:(l==null?void 0:l.registryTopK)??"",registryRegion:(l==null?void 0:l.registryRegion)??"",registryEndpoint:(l==null?void 0:l.registryEndpoint)??""},shortTermBackend:e.shortTermBackend??i.shortTermBackend,longTermBackend:e.longTermBackend??i.longTermBackend,longTermMemoryIndex:e.longTermMemoryIndex??i.longTermMemoryIndex,autoSaveSession:e.autoSaveSession??i.autoSaveSession,knowledgebaseBackend:e.knowledgebaseBackend??i.knowledgebaseBackend,knowledgebaseIndex:e.knowledgebaseIndex??i.knowledgebaseIndex,tracingExporters:[...e.tracingExporters??[]],selectedSkills:[...e.selectedSkills??[]],cloudEnvironment:{...i.cloudEnvironment,...a??{},cliTools:[...(a==null?void 0:a.cliTools)??[]],dockerfile:typeof(a==null?void 0:a.dockerfile)=="string"?a.dockerfile:void 0},deployment:{...i.deployment,...r??{},feishuEnabled:(r==null?void 0:r.feishuEnabled)??!1,runtimeName:(r==null?void 0:r.runtimeName)??void 0,runtimeNameCustomized:(r==null?void 0:r.runtimeNameCustomized)??((d=i.deployment)==null?void 0:d.runtimeNameCustomized),network:s?{...s,vpcId:s.vpcId??"",subnetIds:s.subnetIds??"",enableSharedInternetAccess:s.enableSharedInternetAccess??!1}:void 0,modelApiKeyId:(r==null?void 0:r.modelApiKeyId)??"",modelApiKeyName:(r==null?void 0:r.modelApiKeyName)??"",envValues:(r==null?void 0:r.envValues)??void 0},...e.workflow?{workflow:{...e.workflow,nodes:e.workflow.nodes.map(f=>({...f,agent:x6(f.agent,n)}))}}:{}}}const Qst=["动态子智能体协作规则:","Dynamic sub-agent collaboration rules:"],zst=["collect_resources","create_agents","handoff_to"];function Vst(e){return e.replace(/\\([\\`*_[\]{}()<>#+\-.!|])/g,"$1")}function Hst(e){const t=Qst.flatMap(i=>{const r=[];let s=0;for(;si-r),n=t.find((i,r)=>{const s=t[r+1]??e.length,a=Vst(e.slice(i,s));return zst.every(l=>a.includes(l))});return n===void 0?e:e.slice(0,n).trimEnd()}function qst(e){const t=n=>({...n,instruction:n.dynamicAgentDelegation===!0?Hst(n.instruction):n.instruction,subAgents:n.subAgents.map(t),...n.workflow?{workflow:{...n.workflow,nodes:n.workflow.nodes.map(i=>({...i,agent:t(i.agent)}))}}:{}});return t(e)}function yOe(e,t){var l,c;const n=oc(t),i=[...e.tools??[]],r=Bx.filter(u=>u.toolNames.some(d=>i.includes(d))),s=new Set(r.flatMap(u=>u.toolNames)),a=Yb(e.model);return{...n,modelSource:void 0,name:((l=e.name)==null?void 0:l.trim())??"",description:e.description??"",instruction:e.instruction||n.instruction,agentType:e.type??"llm",modelName:a.modelName,modelProvider:a.modelProvider,tools:i.filter(u=>!s.has(u)),builtinTools:r.map(u=>u.id),skills:((c=e.skills)==null?void 0:c.map(u=>u.name))??[],subAgents:(e.children??[]).map(u=>yOe(u,t))}}function EB(e,t,n=[]){var l,c,u,d;const i=((l=e.draft)==null?void 0:l.cloudProvider)??t,r=Yb(e.model),s=e.draft?x6(e.draft,i):e.graph?yOe(e.graph,i):{...oc(i),modelSource:void 0,name:((c=e.name)==null?void 0:c.trim())||e.appName.trim(),description:e.description??"",instruction:e.instruction||oc(i).instruction,agentType:e.type??"llm",modelName:r.modelName,modelProvider:r.modelProvider,tools:[...e.tools??[]],skills:((u=e.skills)==null?void 0:u.map(f=>f.name))??[]},a=e.draft&&s.dynamicAgentDelegation===!0?qst(s):s;return Bst(bOe(a,e.graph,{name:((d=e.name)==null?void 0:d.trim())||e.appName.trim(),model:e.model},!!e.draft),new Set(n))}function Wst(e,t){const n=i=>{var s;const r=((s=i.modelName)==null?void 0:s.trim())??"";return{...i,modelSource:i.agentType==="llm"||!i.agentType?t.has(r)?"ark":"custom":i.modelSource,subAgents:i.subAgents.map(n),...i.workflow?{workflow:{...i.workflow,nodes:i.workflow.nodes.map(a=>({...a,agent:n(a.agent)}))}}:{}}};return n(e)}function LK({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"})]})}const Gst={coding:"studioTools.labels.coding",get_city_weather:"studioTools.labels.get_city_weather",get_location_weather:"studioTools.labels.get_location_weather",web_fetch:"studioTools.labels.web_fetch"};function vOe(e,t){const n=Bx.find(r=>r.id===e||r.toolNames.includes(e)),i=Gst[e];return i?t(i):(n==null?void 0:n.label)??e}function Kst(){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 Xst(){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 Yst({agentName:e,tools:t,selectedIds:n,loading:i,disabled:r,unavailableReason:s,onChange:a,onClose:l}){const{t:c}=Ae("workspaceTools"),[u,d]=m.useState(""),f=m.useMemo(()=>new Set(n),[n]),h=m.useRef(`studio-tool-${Math.random().toString(36).slice(2)}`),p=m.useMemo(()=>{const b=u.trim().toLowerCase();return b?t.filter(v=>`${v.name} ${v.id} ${v.description}`.toLowerCase().includes(b)):t},[u,t]);m.useEffect(()=>{const b=document.body.style.overflow;document.body.style.overflow="hidden";const v=y=>{y.key==="Escape"&&l()};return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v),document.body.style.overflow=b}},[l]);const g=b=>{const v=new Set(f);v.has(b)?v.delete(b):v.add(b),a([...v])};return Li.createPortal(o.jsxs("div",{className:"studio-tool-dialog-layer",children:[o.jsx("button",{type:"button",className:"studio-tool-dialog-scrim","aria-label":c("studioTools.closeDialog"),onClick:l}),o.jsxs("section",{className:"studio-tool-dialog",role:"dialog","aria-modal":"true","aria-labelledby":h.current,children:[o.jsxs("header",{className:"studio-tool-dialog-head",children:[o.jsx("span",{className:"studio-tool-dialog-mark",children:o.jsx(LK,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:h.current,children:c("studioTools.title")}),o.jsx("p",{children:c("studioTools.description",{agentName:e})})]}),o.jsx("button",{type:"button",className:"studio-tool-dialog-close","aria-label":c("studioTools.close"),onClick:l,children:o.jsx(Kst,{})})]}),o.jsxs("div",{className:"studio-tool-dialog-body",children:[o.jsxs("label",{className:"studio-tool-search",children:[o.jsx(Xst,{}),o.jsx("input",{value:u,"aria-label":c("studioTools.searchAria"),placeholder:c("studioTools.searchPlaceholder"),autoFocus:!0,onChange:b=>d(b.target.value)})]}),o.jsx("div",{className:"studio-tool-picker",role:"list","aria-label":c("studioTools.availableAria"),children:i?o.jsx("div",{className:"studio-tool-empty",children:c("studioTools.loading")}):s?o.jsx("div",{className:"studio-tool-empty",children:s}):p.length===0?o.jsx("div",{className:"studio-tool-empty",children:c("studioTools.noMatch")}):p.map(b=>{const v=f.has(b.id);return o.jsxs("article",{className:"studio-tool-option",role:"listitem",children:[o.jsx("span",{className:"studio-tool-option-icon",children:o.jsx(LK,{})}),o.jsxs("span",{className:"studio-tool-option-copy",children:[o.jsx("strong",{children:b.name||vOe(b.id,c)}),o.jsx("code",{children:b.id}),o.jsx("span",{children:b.description})]}),o.jsx("button",{type:"button",disabled:r,"aria-pressed":v,onClick:()=>g(b.id),children:c(v?"studioTools.remove":"studioTools.add")})]},b.id)})})]})]})]}),document.body)}function An({as:e="span",className:t="",duration:n=4,spread:i=20,children:r,style:s,...a}){const l=Math.min(Math.max(i,5),45);return o.jsx(e,{className:`text-shimmer${t?` ${t}`:""}`,style:{...s,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:r})}const oN=[{id:"ubuntu-22.04",label:"Ubuntu 22.04",image:"ubuntu:22.04"},{id:"ubuntu-24.04",label:"Ubuntu 24.04",image:"ubuntu:24.04"}],xOe=[{id:"aio-sandbox",label:"AIO Sandbox",description:"内置 Sandbox Shell 能力 · Ubuntu 22.04"},{id:"codex-sandbox",label:"Codex Sandbox",description:"内置 Codex CLI、浏览器与代码执行环境"},{id:"ubuntu",label:"Ubuntu",description:"标准 Linux 基础镜像"}],CB="agentkit-cli-2107625663-cn-beijing.cr.volces.com/agentkit/agent-native-requirements-aio:0.2.1-20260831",wOe={volcengine:"enterprise-public-cn-beijing.cr.volces.com/vefaas-public/codexenv:1.1.0",byteplus:"enterprise-public-ap-southeast-1.cr.volces.com/vefaas-public/codexenv:1.1.0"},OOe=[{id:"python-3.10",label:"Python 3.10"},{id:"python-3.12",label:"Python 3.12"}],Zst={"python-3.10":"3.10.18","python-3.12":"3.12.11"},TB=[{id:"tools",label:"工具",description:"常用 CLI 与内容处理工具",options:[{id:"lark-cli",label:"lark-cli",description:"飞书开放平台命令行工具",installer:"pip",packageName:"lark-cli"},{id:"pandoc",label:"pandoc",description:"文档格式转换工具",installer:"apt",packageName:"pandoc"},{id:"opencli",label:"opencli",description:"将网站与桌面应用转换为命令行工具",installer:"npm",packageName:"@jackwener/opencli@1.8.7"}]},{id:"productivity",label:"效率",description:"加速依赖安装、检索和协作",options:[{id:"uv",label:"uv",description:"快速 Python 包与项目管理器",installer:"pip",packageName:"uv"},{id:"ripgrep",label:"ripgrep",description:"高性能文本检索工具",installer:"apt",packageName:"ripgrep"},{id:"jq",label:"jq",description:"JSON 查询与转换工具",installer:"apt",packageName:"jq"},{id:"github-cli",label:"GitHub CLI",description:"在终端中管理 GitHub 工作流",installer:"apt",packageName:"gh"}]},{id:"browser",label:"浏览器自动化",description:"网页操作、测试与内容采集",options:[{id:"playwright",label:"Playwright",description:"浏览器自动化与端到端测试",installer:"pip",packageName:"playwright"},{id:"chromium",label:"Chromium",description:"无头浏览器运行时",installer:"apt",packageName:"chromium"}]},{id:"system",label:"系统与媒体",description:"基础开发、网络和媒体处理能力",options:[{id:"git",label:"Git",description:"代码版本管理",installer:"apt",packageName:"git"},{id:"curl",label:"curl",description:"网络请求与文件下载",installer:"apt",packageName:"curl"},{id:"ffmpeg",label:"FFmpeg",description:"音视频转码与处理",installer:"apt",packageName:"ffmpeg"},{id:"imagemagick",label:"ImageMagick",description:"图片转换与批处理",installer:"apt",packageName:"imagemagick"}]}],Jst=TB.flatMap(e=>e.options),eat=["build-essential","curl","libbz2-dev","libffi-dev","libgdbm-dev","liblzma-dev","libncursesw5-dev","libreadline-dev","libsqlite3-dev","libssl-dev","tk-dev","uuid-dev","zlib1g-dev"],tat=["xvfb","fonts-noto-color-emoji","fonts-unifont","libfontconfig1","libfreetype6","xfonts-cyrillic","xfonts-scalable","fonts-liberation","fonts-ipafont-gothic","fonts-wqy-zenhei","fonts-tlwg-loma-otf","fonts-freefont-ttf"],nat={"ubuntu-22.04":["libasound2","libatk-bridge2.0-0","libatk1.0-0","libatspi2.0-0","libcairo2","libcups2","libdbus-1-3","libdrm2","libgbm1","libglib2.0-0","libnspr4","libnss3","libpango-1.0-0","libwayland-client0","libx11-6","libxcb1","libxcomposite1","libxdamage1","libxext6","libxfixes3","libxkbcommon0","libxrandr2"],"ubuntu-24.04":["libasound2t64","libatk-bridge2.0-0t64","libatk1.0-0t64","libatspi2.0-0t64","libcairo2","libcups2t64","libdbus-1-3","libdrm2","libgbm1","libglib2.0-0t64","libnspr4","libnss3","libpango-1.0-0","libx11-6","libxcb1","libxcomposite1","libxdamage1","libxext6","libxfixes3","libxkbcommon0","libxrandr2"]};function z1(e,t){for(const n of t)e.includes(n)||e.push(n)}function iat(e,t,n,i,r){const s=["ca-certificates"];r||z1(s,i?[`python${n}`,`python${n}-venv`]:eat);for(const a of t)a.id==="playwright"||a.id==="chromium"||(a.installer==="apt"&&z1(s,[a.packageName]),a.id==="opencli"&&z1(s,["curl","xz-utils"]));return e.optionIds.some(a=>a==="playwright"||a==="chromium")&&(z1(s,tat),z1(s,nat[e.operatingSystem])),s}const mM={name:"",description:"",baseEnvironment:"aio-sandbox",operatingSystem:"ubuntu-22.04",language:"python-3.12",optionIds:[],selectedSkills:[]};function oh(e){var t;return((t=OOe.find(n=>n.id===e))==null?void 0:t.label)??e}function w6(e){var t;return((t=oN.find(n=>n.id===e))==null?void 0:t.label)??e}function O6(e){var t;return((t=xOe.find(n=>n.id===e))==null?void 0:t.label)??e}function rat(e){var n;const t=((n=e.match(/^\s*FROM\s+(.+)$/im))==null?void 0:n[1])??"";return{baseEnvironment:/\/codexenv:/i.test(t)?"codex-sandbox":/aio\.sandbox/i.test(e)?"aio-sandbox":"ubuntu",operatingSystem:/ubuntu:24\.04/i.test(t)?"ubuntu-24.04":"ubuntu-22.04"}}function AB(e,t="volcengine"){const n=Jst.filter(b=>e.optionIds.includes(b.id)),i=e.baseEnvironment==="aio-sandbox",r=e.baseEnvironment==="codex-sandbox",s=i||r,a=s?"python-3.12":e.language,l=a.replace("python-",""),c=Zst[a],u=oN.find(b=>b.id===e.operatingSystem)??oN[0],d=e.operatingSystem==="ubuntu-22.04"&&l==="3.10"||e.operatingSystem==="ubuntu-24.04"&&l==="3.12",f=iat(e,n,l,d,s),h=i?[`ARG AIO_BASE_IMAGE=${CB}`,"ARG AIO_BASE_PLATFORM=linux/amd64","",`# Base environment: AIO Sandbox (${u.label})`,"FROM --platform=${AIO_BASE_PLATFORM} ${AIO_BASE_IMAGE}"]:r?[`ARG CODEX_BASE_IMAGE=${wOe[t]}`,"ARG CODEX_BASE_PLATFORM=linux/amd64","","# Base environment: Codex Sandbox","FROM --platform=${CODEX_BASE_PLATFORM} ${CODEX_BASE_IMAGE}"]:[`# Operating system: ${u.label}`,`FROM ${u.image}`];h.push("","ARG DEBIAN_FRONTEND=noninteractive","ARG APT_MIRROR_URL=http://archive.ubuntu.com/ubuntu","ARG PIP_INDEX_URL=https://pypi.org/simple","ARG PYTHON_SOURCE_BASE_URL=https://www.python.org/ftp/python","ARG PLAYWRIGHT_DOWNLOAD_HOST=https://cdn.playwright.dev","ARG PIP_DEFAULT_TIMEOUT=300","ARG PIP_RETRIES=10","","# Install all system dependencies in one transaction from the provider-local mirror.","RUN set -eux; \\",' mirror="${APT_MIRROR_URL%/}"; \\'," for source_file in /etc/apt/sources.list /etc/apt/sources.list.d/*.sources; do \\",' [ -f "$source_file" ] || continue; \\',' sed -i -E "s#https?://(archive|security).ubuntu.com/ubuntu/?#${mirror}#g" "$source_file"; \\'," done; \\",` printf 'Acquire::Retries "5";\\nAcquire::ForceIPv4 "true";\\nAcquire::http::Timeout "60";\\nAcquire::https::Timeout "60";\\n' > /etc/apt/apt.conf.d/80-veadk-network; \\`," apt-get update; \\"," apt-get install -y --no-install-recommends \\",...f.map(b=>" "+b+" \\")," ; rm -rf /var/lib/apt/lists/*","","ENV PYTHONDONTWRITEBYTECODE=1 \\"," PYTHONUNBUFFERED=1 \\"," PIP_NO_CACHE_DIR=1","",`# Python ${l}`),i?h.push("# Keep Studio dependencies isolated from AIO's system interpreter.","RUN /opt/python3.12/bin/python -m venv /opt/veadk-environment/.venv","","ENV VIRTUAL_ENV=/opt/veadk-environment/.venv \\"," BASH_VENV_PATH=/opt/veadk-environment/.venv \\",' PATH="/opt/veadk-environment/.venv/bin:$PATH"'):r?h.push("# Keep Studio dependencies isolated from the Codex runtime.","RUN python3 -m venv /opt/veadk-environment/.venv","","ENV VIRTUAL_ENV=/opt/veadk-environment/.venv \\",' PATH="/opt/veadk-environment/.venv/bin:$PATH"'):d?h.push(`RUN python${l} -m venv /opt/venv`):h.push(`RUN curl --retry 5 --retry-all-errors --connect-timeout 30 -fsSL "\${PYTHON_SOURCE_BASE_URL}/${c}/Python-${c}.tgz" -o /tmp/python.tgz \\`," && mkdir -p /tmp/python-source \\"," && tar -xzf /tmp/python.tgz --strip-components=1 -C /tmp/python-source \\"," && cd /tmp/python-source \\"," && ./configure --prefix=/opt/python --with-ensurepip=install \\",' && make -j"$(nproc)" \\'," && make install \\",` && /opt/python/bin/python${l} -m venv /opt/venv \\`," && rm -rf /tmp/python-source /tmp/python.tgz"),s||h.push("",'ENV PATH="/opt/venv/bin:$PATH"');const p=new Set(e.optionIds);(p.has("playwright")||p.has("chromium"))&&h.push("","ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright \\"," PLAYWRIGHT_DOWNLOAD_CONNECTION_TIMEOUT=300000"),h.push("","WORKDIR /workspace","","# VeADK","RUN python -m pip install --upgrade veadk-python");let g=!1;for(const b of n)h.push("",`# ${b.label}`),b.id==="opencli"?h.push('RUN node_arch="$(dpkg --print-architecture)" \\',' && case "$node_arch" in amd64) node_arch=x64 ;; arm64) node_arch=arm64 ;; *) echo "Unsupported architecture: $node_arch" >&2; exit 1 ;; esac \\',' && curl --retry 5 --connect-timeout 30 -fsSL "https://nodejs.org/dist/v22.18.0/node-v22.18.0-linux-${node_arch}.tar.xz" -o /tmp/node.tar.xz \\'," && tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1 \\",` && npm install --global ${b.packageName} \\`," && npm cache clean --force \\"," && rm -f /tmp/node.tar.xz"):b.id==="playwright"||b.id==="chromium"?g||(h.push("RUN python -m pip install --upgrade playwright"),h.push("RUN python -m playwright install chromium"),g=!0):b.installer!=="apt"&&h.push(`RUN python -m pip install --upgrade ${b.packageName}`);return i?h.push("","# Keep AIO's inherited /opt/gem/run.sh startup chain and shell API.","EXPOSE 8080"):r||h.push("",'CMD ["/bin/bash"]'),h.join(` -`)}function sat(){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 aat(){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 S6(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[o.jsx("path",{d:"M5 7.25A2.25 2.25 0 0 1 7.25 5h9.5A2.25 2.25 0 0 1 19 7.25v9.5A2.25 2.25 0 0 1 16.75 19h-9.5A2.25 2.25 0 0 1 5 16.75v-9.5Z",stroke:"currentColor",strokeWidth:"1.6"}),o.jsx("path",{d:"M8.5 9.25 11 12l-2.5 2.75M12.75 14.75h2.75",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})}function SOe(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[o.jsx("path",{d:"M4.75 7.25A2.25 2.25 0 0 1 7 5h3l1.5 2h5.5a2.25 2.25 0 0 1 2.25 2.25v7.5A2.25 2.25 0 0 1 17 19H7a2.25 2.25 0 0 1-2.25-2.25v-9.5Z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),o.jsx("path",{d:"M8 11.25h8M8 14.75h5.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function oat(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"M12 6.5v11M6.5 12h11",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function $K(){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 FK(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m3.5 8.25 2.75 2.75 6.25-6.25",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}function rl(e){return`${e.environment_id}\0${e.environment_version_id}`}function EO(e){return e.latestVersion?{environment_id:e.id,environment_version_id:e.latestVersion.versionId}:null}function gA(e,t){return e.environmentIds.flatMap(n=>{const i=t.get(n),r=i?EO(i):null;return r?[r]:[]})}function lat({environments:e,workspaces:t,value:n,selectedWorkspaceIds:i,loading:r,error:s,onConfirm:a,onClose:l}){const{t:c}=Ae("workspaceTools"),[u,d]=m.useState(""),[f,h]=m.useState(!1),[p,g]=m.useState(""),b=m.useId(),v=m.useMemo(()=>new Map(e.map(A=>[A.id,A])),[e]),[y,x]=m.useState(()=>new Set(i)),[O,w]=m.useState(()=>{const A=new Set(t.filter(F=>i.includes(F.id)).flatMap(F=>F.environmentIds));return new Set(n.filter(F=>!A.has(F.environment_id)).map(rl))}),k=m.useMemo(()=>new Set(t.filter(A=>y.has(A.id)).flatMap(A=>A.environmentIds)),[y,t]),S=m.useMemo(()=>{const A=new Set(O);for(const F of t)if(y.has(F.id))for(const T of gA(F,v))A.add(rl(T));return A},[O,y,v,t]),E=m.useMemo(()=>{const A=u.trim().toLocaleLowerCase();return A?e.filter(F=>`${F.name} ${F.description} ${oh(F.language)}`.toLocaleLowerCase().includes(A)):e},[e,u]),C=m.useMemo(()=>{const A=u.trim().toLocaleLowerCase();return A?t.filter(F=>{const T=F.environmentIds.map(P=>{var R;return((R=v.get(P))==null?void 0:R.name)??""}).join(" ");return`${F.name} ${F.description} ${T}`.toLocaleLowerCase().includes(A)}):t},[v,u,t]);m.useEffect(()=>{const A=document.body.style.overflow,F=T=>{T.key==="Escape"&&!f&&l()};return document.body.style.overflow="hidden",document.addEventListener("keydown",F),()=>{document.body.style.overflow=A,document.removeEventListener("keydown",F)}},[l,f]);const N=A=>{const F=EO(A);if(!F)return;const T=rl(F);k.has(A.id)||w(P=>{const R=new Set(P);return R.has(T)?R.delete(T):R.add(T),R})},_=A=>{const F=gA(A,v);F.length!==0&&(x(T=>{const P=new Set(T);return P.has(A.id)?P.delete(A.id):P.add(A.id),P}),w(T=>{const P=new Set(T);for(const R of F)P.delete(rl(R));return P}))},j=async()=>{const A=new Map(n.map(T=>[rl(T),T])),F=e.flatMap(T=>{const P=EO(T);if(!P||!S.has(rl(P)))return[];const R=A.get(rl(P));return[{...P,mount_instance_id:(R==null?void 0:R.mount_instance_id)||crypto.randomUUID()}]});h(!0),g("");try{await a(F,[...y]),l()}catch(T){g(T instanceof Error?T.message:c("sessionEnvironment.mountFailed"))}finally{h(!1)}};return Li.createPortal(o.jsxs("div",{className:"studio-tool-dialog-layer",children:[o.jsx("button",{type:"button",className:"studio-tool-dialog-scrim","aria-label":c("sessionEnvironment.closeDialog"),disabled:f,onClick:l}),o.jsxs("section",{className:"studio-tool-dialog session-environment-dialog",role:"dialog","aria-modal":"true","aria-labelledby":b,children:[o.jsxs("header",{className:"studio-tool-dialog-head",children:[o.jsx("span",{className:"studio-tool-dialog-mark",children:o.jsx(S6,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:b,children:c("sessionEnvironment.addTitle")}),o.jsx("p",{children:c("sessionEnvironment.description")})]}),o.jsx("button",{type:"button",className:"studio-tool-dialog-close","aria-label":c("sessionEnvironment.closeAdd"),disabled:f,onClick:l,children:o.jsx(sat,{})})]}),o.jsxs("div",{className:"studio-tool-dialog-body",children:[o.jsxs("label",{className:"studio-tool-search",children:[o.jsx(aat,{}),o.jsx("input",{value:u,"aria-label":c("sessionEnvironment.searchAria"),placeholder:c("sessionEnvironment.searchPlaceholder"),autoFocus:!0,onChange:A=>d(A.target.value)})]}),o.jsx("div",{className:"studio-tool-picker session-environment-picker",role:"group","aria-label":c("sessionEnvironment.availableAria"),children:r?o.jsx("div",{className:"studio-tool-empty",children:c("sessionEnvironment.loading")}):s?o.jsx("div",{className:"studio-tool-empty",children:s}):E.length===0&&C.length===0?o.jsx("div",{className:"studio-tool-empty",children:c("sessionEnvironment.noMatch")}):o.jsxs(o.Fragment,{children:[C.length>0&&o.jsxs("section",{className:"session-environment-picker__group","aria-labelledby":`${b}-workspaces`,children:[o.jsx("h3",{id:`${b}-workspaces`,children:c("sessionEnvironment.workspaces")}),C.map(A=>{const F=gA(A,v),T=y.has(A.id),P=F.length===0;return o.jsxs("label",{className:`studio-tool-option session-environment-option is-workspace${T?" is-selected":""}${P?" is-disabled":""}`,children:[o.jsx("span",{className:"studio-tool-option-icon",children:o.jsx(SOe,{})}),o.jsxs("span",{className:"studio-tool-option-copy",children:[o.jsx("strong",{children:A.name}),o.jsx("span",{children:A.description||c("sessionEnvironment.reuseAll")}),o.jsx("small",{children:c("sessionEnvironment.availableEnvironmentCount",{count:F.length})})]}),o.jsx("input",{type:"checkbox",checked:T,disabled:P,"aria-label":c("sessionEnvironment.selectWorkspace",{name:A.name}),onChange:()=>_(A)}),o.jsx("span",{className:"session-environment-check","aria-hidden":"true",children:o.jsx(FK,{})})]},A.id)})]}),E.length>0&&o.jsxs("section",{className:"session-environment-picker__group","aria-labelledby":`${b}-environments`,children:[o.jsx("h3",{id:`${b}-environments`,children:c("sessionEnvironment.environments")}),E.map(A=>{const F=EO(A);if(!F)return null;const T=t.filter(L=>y.has(L.id)&&L.environmentIds.includes(A.id)),P=T.length>0,R=S.has(rl(F));return o.jsxs("label",{className:`studio-tool-option session-environment-option${R?" is-selected":""}${P?" is-covered":""}`,children:[o.jsx("span",{className:"studio-tool-option-icon",children:o.jsx(S6,{})}),o.jsxs("span",{className:"studio-tool-option-copy",children:[o.jsx("strong",{children:A.name}),o.jsx("span",{children:P?c("sessionEnvironment.includedByWorkspaces",{names:T.map(L=>L.name).join(c("sessionEnvironment.nameSeparator"))}):A.description||oh(A.language)}),o.jsxs("small",{children:[oh(A.language)," · ",F.environment_version_id]})]}),o.jsx("input",{type:"checkbox",checked:R,disabled:P,"aria-label":c("sessionEnvironment.selectEnvironment",{name:A.name}),onChange:()=>N(A)}),o.jsx("span",{className:"session-environment-check","aria-hidden":"true",children:o.jsx(FK,{})})]},rl(F))})]})]})})]}),o.jsxs("footer",{className:"session-environment-dialog__footer",children:[o.jsx("span",{className:p?"is-error":"",role:p?"alert":void 0,children:p||c("sessionEnvironment.selectionSummary",{workspaces:c("sessionEnvironment.selectedWorkspaceCount",{count:y.size}),environments:c("sessionEnvironment.coveredEnvironmentCount",{count:S.size})})}),o.jsxs("div",{children:[o.jsx("button",{type:"button",disabled:f,onClick:l,children:c("sessionEnvironment.cancel")}),o.jsx("button",{type:"button",className:"is-primary",disabled:r||f||!!s,onClick:()=>void j(),children:c(f?"sessionEnvironment.mounting":"sessionEnvironment.confirm")})]})]})]})]}),document.body)}function cat({environments:e,workspaces:t,value:n,selectedWorkspaceIds:i,loading:r,disabled:s=!1,error:a="",onChange:l,onRefresh:c}){const{t:u}=Ae("workspaceTools"),[d,f]=m.useState(!1),[h,p]=m.useState(!1),[g,b]=m.useState(""),v=m.useRef(null),y=m.useMemo(()=>new Map(e.flatMap(C=>{const N=EO(C);return N?[[rl(N),C]]:[]})),[e]),x=m.useMemo(()=>new Map(e.map(C=>[C.id,C])),[e]),O=t.filter(C=>i.includes(C.id)),w=new Set(O.flatMap(C=>C.environmentIds)),k=n.filter(C=>!w.has(C.environment_id)),S=()=>{f(!1),requestAnimationFrame(()=>{var C;return(C=v.current)==null?void 0:C.focus()})},E=async(C,N)=>{if(l){p(!0),b("");try{await l(C,N)}catch(_){b(_ instanceof Error?_.message:u("sessionEnvironment.mountFailed"))}finally{p(!1)}}};return o.jsxs("div",{className:"session-environment-select",children:[n.length>0&&o.jsxs("div",{className:"session-environment-list",role:"list","aria-label":u("sessionEnvironment.mountedAria"),children:[O.map(C=>{const N=new Set(gA(C,x).map(_=>_.environment_id));return o.jsxs("div",{className:"session-environment-item is-workspace",role:"listitem",children:[o.jsx("span",{className:"session-environment-item__icon",children:o.jsx(SOe,{})}),o.jsxs("span",{className:"session-environment-item__copy",children:[o.jsx("strong",{children:C.name}),o.jsx("small",{children:u("sessionEnvironment.environmentCount",{count:N.size})})]}),l&&o.jsx("button",{type:"button",className:"topo-remove-capability","aria-label":u("sessionEnvironment.removeWorkspace",{name:C.name}),title:u("sessionEnvironment.remove"),disabled:s||h,onClick:()=>{const _=i.filter(A=>A!==C.id),j=new Set(t.filter(A=>_.includes(A.id)).flatMap(A=>A.environmentIds));E(n.filter(A=>!N.has(A.environment_id)||j.has(A.environment_id)),_)},children:o.jsx($K,{})})]},`workspace:${C.id}`)}),k.map(C=>{const N=y.get(rl(C));return o.jsxs("div",{className:"session-environment-item",role:"listitem",children:[o.jsx("span",{className:"session-environment-item__icon",children:o.jsx(S6,{})}),o.jsxs("span",{className:"session-environment-item__copy",children:[o.jsx("strong",{children:(N==null?void 0:N.name)??C.environment_id}),o.jsx("small",{children:N?oh(N.language):C.environment_version_id})]}),l&&o.jsx("button",{type:"button",className:"topo-remove-capability","aria-label":u("sessionEnvironment.removeEnvironment",{name:(N==null?void 0:N.name)??C.environment_id}),title:u("sessionEnvironment.remove"),disabled:s||h,onClick:()=>void E(n.filter(_=>rl(_)!==rl(C)),[...i]),children:o.jsx($K,{})})]},rl(C))})]}),l&&o.jsxs("button",{ref:v,type:"button",className:"topo-capability-add-slot","aria-label":u("sessionEnvironment.add"),disabled:s||r||h,onClick:()=>{b(""),f(!0),c==null||c()},children:[o.jsx(oat,{}),o.jsx("span",{children:n.length>0?u("sessionEnvironment.addMore"):u("sessionEnvironment.addForSession")})]}),g&&o.jsx("p",{className:"is-error",role:"alert",children:g}),(r||a||e.length===0)&&o.jsx("p",{className:a?"is-error":void 0,role:a?"alert":void 0,children:r?u("sessionEnvironment.loadingAvailable"):a||u("sessionEnvironment.empty")}),d&&o.jsx(lat,{environments:e,workspaces:t,value:n,selectedWorkspaceIds:i,loading:r,error:a,onConfirm:(C,N)=>l==null?void 0:l(C,N),onClose:S})]})}function kOe(e){return 1+e.children.reduce((t,n)=>t+kOe(n),0)}function EOe(e){return e.id||e.name}function uat(e,t,n){const i=EOe(e);if(e.id&&e.name&&e.name!==i)return e.name;if(t&&i==="agent")return n("agentTopology.mainAgent");const r=/^agent_sub_(\d+)$/.exec(i);return r?n("agentTopology.subAgent",{index:r[1]}):e.name||i}function COe(e,t,n=!0){return{...e,id:EOe(e),name:uat(e,n,t),children:e.children.map(i=>COe(i,t,!1))}}function TOe(e){const t=oc(),n=Yb(e.model);return{...t,name:e.name,description:e.description,instruction:e.instruction||t.instruction,agentType:e.type,modelName:n.modelName,modelProvider:n.modelProvider,tools:e.tools??[],skills:(e.skills??[]).map(i=>i.name),subAgents:e.children.map(TOe)}}function dat(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))]}const fat=new Set(["StudioExternalToolset"]);function hat(e){return[...new Map(e.filter(t=>t.name.trim()).map(t=>[t.name.trim(),{...t,name:t.name.trim()}])).values()]}function xT({title:e,count:t}){const{t:n}=Ae("workspaceTools");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":n("agentTopology.itemCount",{count:t}),children:t})]})}function pat({appName:e,info:t,loading:n,variant:i="rail",studioTools:r=[],selectedStudioToolIds:s=[],managedStudioToolIds:a=[],studioToolsLoading:l=!1,studioToolsDisabled:c=!1,studioToolsUnavailableReason:u="",onStudioToolsChange:d,environments:f=[],workspaces:h=[],selectedEnvironments:p=[],selectedEnvironmentWorkspaceIds:g=[],environmentsLoading:b=!1,environmentsDisabled:v=!1,environmentsError:y="",onEnvironmentsChange:x,onEnvironmentsRefresh:O}){const{t:w}=Ae("workspaceTools"),[k,S]=m.useState(null),[E,C]=m.useState(!1),N=m.useRef(null),_=()=>{C(!1),window.requestAnimationFrame(()=>{var Q;return(Q=N.current)==null?void 0:Q.focus()})};if(m.useEffect(()=>{if(!E)return;const Q=document.body.style.overflow,q=B=>{B.key==="Escape"&&_()};return document.body.style.overflow="hidden",document.addEventListener("keydown",q),()=>{document.body.style.overflow=Q,document.removeEventListener("keydown",q)}},[E]),n&&!t)return o.jsx("aside",{className:`topo is-loading${i==="drawer"?" is-drawer":""}`,"aria-label":w("agentTopology.info"),"aria-live":"polite",children:o.jsx(An,{as:"span",className:"topo-loading-label",duration:2.2,children:w("agentTopology.loadingInfo")})});if(!t)return null;const j=kB(t.model),A=COe(t.graph??{id:t.name,name:t.name,description:t.description,type:t.type??"llm",model:j,tools:t.tools,skills:t.skills,path:[t.name],mentionable:!1,children:[]},w),F=dat(t.tools).filter(Q=>!fat.has(Q)).map(Q=>({id:`base:tool:${Q}`,name:Q,label:vOe(Q,w),custom:!1,removable:!1})),T=new Set(F.map(Q=>Q.name)),P=new Set(s),R=new Set(a),L=r.filter(Q=>P.has(Q.id)&&!T.has(Q.id)).map(Q=>({id:`studio:tool:${Q.id}`,name:Q.id,label:Q.name,custom:!0,removable:!R.has(Q.id)})),M=[...F,...L],U=hat(t.skills),I=!!d,H=TOe(A),K=Q=>o.jsx(LS,{draft:H,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},Q);return o.jsxs(o.Fragment,{children:[o.jsxs("aside",{className:`topo${i==="drawer"?" is-drawer":""}`,"aria-label":w("agentTopology.infoAndTopology"),children:[o.jsxs("section",{className:"topo-agent-card","aria-label":w("agentTopology.info"),children:[o.jsxs("div",{className:"topo-agent-heading",children:[o.jsx("h2",{title:t.name,children:t.name||w("agentTopology.unnamedAgent")}),j&&o.jsx("span",{title:j,children:j})]}),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":w("agentTopology.tools"),children:[o.jsx(xT,{title:w("agentTopology.tools"),count:M.length}),o.jsx("div",{className:"topo-module-scroll topo-tools-scroll",role:"region","aria-label":w("agentTopology.toolList"),tabIndex:0,children:M.length>0?o.jsx("div",{className:"topo-tool-list",children:M.map(Q=>o.jsxs("div",{className:"topo-tool",title:Q.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:Q.label}),o.jsx("code",{children:Q.name})]}),Q.custom&&o.jsx("span",{className:"topo-custom-badge",children:w("agentTopology.studioTool")})]}),Q.custom&&Q.removable&&o.jsx("button",{type:"button",className:"topo-remove-capability","aria-label":w("agentTopology.removeTool",{name:Q.name}),title:w("agentTopology.remove"),disabled:c,onClick:()=>d==null?void 0:d(s.filter(q=>q!==Q.name)),children:"×"})]},Q.id))}):o.jsx("div",{className:"topo-empty",children:w("agentTopology.notConfigured")})}),I&&o.jsx("div",{className:"topo-capability-add-dock",children:o.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":w("agentTopology.addStudioTool"),disabled:c,onClick:()=>S("tool"),children:[o.jsx("span",{"aria-hidden":"true",children:"+"}),o.jsx("span",{children:w("agentTopology.addStudioToolHere")})]})})]}),o.jsxs("section",{className:"topo-module-card topo-skills-card","aria-label":w("agentTopology.skills"),children:[o.jsx(xT,{title:w("agentTopology.skills"),count:t.skillsPreviewSupported?U.length:void 0}),o.jsx("div",{className:"topo-module-scroll topo-skills-scroll",role:"region","aria-label":w("agentTopology.skillList"),tabIndex:0,children:t.skillsPreviewSupported?U.length>0?o.jsx("div",{className:"topo-skill-list",children:U.map(Q=>o.jsxs("div",{className:"topo-skill",title:Q.description||Q.name,children:[o.jsx("div",{className:"topo-skill-title",children:o.jsx("span",{className:"topo-skill-name",children:Q.name})}),Q.description&&o.jsx("span",{className:"topo-skill-description",children:Q.description})]},`${Q.name}:${Q.description}`))}):o.jsx("div",{className:"topo-empty",children:w("agentTopology.notConfigured")}):o.jsx("div",{className:"topo-empty",children:w("agentTopology.previewUnsupported")})})]}),(x||p.length>0)&&o.jsxs("section",{className:"topo-module-card topo-environment-card","aria-label":w("agentTopology.sessionEnvironment"),children:[o.jsx(xT,{title:w("agentTopology.environment"),count:p.length}),o.jsx(cat,{environments:f,workspaces:h,value:p,selectedWorkspaceIds:g,loading:b,disabled:v,error:y,onChange:x,onRefresh:O})]}),o.jsxs("section",{className:"topo-module-card topo-topology","aria-label":w("agentTopology.agentCanvas"),children:[o.jsxs("div",{className:"topo-canvas-heading",children:[o.jsx(xT,{title:w("agentTopology.topology"),count:kOe(A)}),o.jsx("button",{ref:N,type:"button",className:"topo-canvas-expand","aria-label":w("agentTopology.viewCanvasFullscreen"),title:w("agentTopology.viewFullscreen"),onClick:()=>C(!0),children:o.jsx(Ky,{"aria-hidden":"true"})})]}),o.jsx("div",{className:"topo-canvas-preview",role:"region","aria-label":w("agentTopology.executionCanvas"),children:K(`conversation-canvas:${e}`)})]})]}),k==="tool"&&d&&o.jsx(Yst,{agentName:t.name,tools:r.filter(Q=>!T.has(Q.id)&&!R.has(Q.id)),selectedIds:s,loading:l,disabled:c,unavailableReason:u,onChange:d,onClose:()=>S(null)})]}),E&&Li.createPortal(o.jsxs("section",{className:"topo-canvas-dialog",role:"dialog","aria-modal":"true","aria-label":w("agentTopology.fullscreenExecutionCanvas"),children:[o.jsxs("header",{className:"topo-canvas-dialog-header",children:[o.jsxs("div",{children:[o.jsx("strong",{children:w("agentTopology.executionCanvas")}),o.jsx("span",{children:t.name})]}),o.jsx("button",{type:"button","aria-label":w("agentTopology.closeFullscreenCanvas"),title:w("agentTopology.close"),onClick:_,autoFocus:!0,children:o.jsx(Ba,{"aria-hidden":"true"})})]}),o.jsx("div",{className:"topo-canvas-dialog-body",children:K(`conversation-canvas-fullscreen:${e}`)})]}),document.body)]})}const lE={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};function BK(e){return o.jsxs("svg",{...lE,...e,children:[o.jsx("rect",{x:"3.75",y:"5.25",width:"16.5",height:"13.5",rx:"2"}),o.jsx("path",{d:"m10.25 9 4.8 3-4.8 3V9Z"})]})}function mat(e){return o.jsxs("svg",{...lE,...e,children:[o.jsx("path",{d:"M12 3.75v10.5M8.4 10.8 12 14.4l3.6-3.6"}),o.jsx("path",{d:"M5 17.25v2h14v-2"})]})}function gat(e){return o.jsxs("svg",{...lE,...e,children:[o.jsx("path",{d:"M8.75 8.75 6.9 10.6a3.4 3.4 0 0 0 4.8 4.8l1.85-1.85"}),o.jsx("path",{d:"m15.25 15.25 1.85-1.85a3.4 3.4 0 0 0-4.8-4.8l-1.85 1.85"}),o.jsx("path",{d:"m9.4 14.6 5.2-5.2"})]})}function bat(e){return o.jsxs("svg",{...lE,...e,children:[o.jsx("path",{d:"M5 19h3.2L18.6 8.6a1.7 1.7 0 0 0 0-2.4l-.8-.8a1.7 1.7 0 0 0-2.4 0L5 15.8V19Z"}),o.jsx("path",{d:"m13.9 6.9 3.2 3.2M5 15.8 8.2 19"})]})}function AOe(e){return o.jsx("svg",{...lE,...e,children:o.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}const yat=180,UK=500,gM=10,QK=32;function vat(e){return Array.from(new Set(e.split(/[,,]/).map(t=>t.trim()).filter(Boolean)))}function xat({artifact:e,busy:t,error:n,onClose:i,onSave:r}){const{t:s}=Ae("workspaceTools"),[a,l]=m.useState(e.name),[c,u]=m.useState(e.description??""),[d,f]=m.useState((e.tags??[]).join(",")),[h,p]=m.useState(""),g=m.useId(),b=m.useId(),v=m.useRef(null),y=m.useRef(null),x=m.useRef(t),O=m.useRef(i);m.useEffect(()=>{x.current=t,O.current=i},[t,i]),m.useEffect(()=>{var N,_;const S=document.body.style.overflow,E=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(N=y.current)==null||N.focus(),(_=y.current)==null||_.select();const C=j=>{if(j.key==="Escape"&&!x.current){j.preventDefault(),O.current();return}if(j.key!=="Tab")return;const A=v.current;if(!A)return;const F=Array.from(A.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter(R=>R.getClientRects().length>0);if(F.length===0){j.preventDefault();return}const T=F[0],P=F[F.length-1];j.shiftKey&&document.activeElement===T?(j.preventDefault(),P.focus()):!j.shiftKey&&document.activeElement===P&&(j.preventDefault(),T.focus())};return window.addEventListener("keydown",C),()=>{window.removeEventListener("keydown",C),document.body.style.overflow=S,E!=null&&E.isConnected&&E.focus()}},[]);const w=S=>{var N;S.preventDefault();const E=a.trim(),C=vat(d);if(!E){p(s("artifactEdit.nameRequired")),(N=y.current)==null||N.focus();return}if(C.length>gM){p(s("artifactEdit.tooManyTags",{max:gM}));return}if(C.some(_=>_.length>QK)){p(s("artifactEdit.tagTooLong",{max:QK}));return}p(""),r({name:E,description:c.trim(),tags:C})},k=h||n;return Li.createPortal(o.jsx("div",{className:"artifact-edit-backdrop",onMouseDown:S=>{S.target===S.currentTarget&&!t&&i()},children:o.jsxs("section",{ref:v,className:"artifact-edit-dialog",role:"dialog","aria-modal":"true","aria-labelledby":g,"aria-describedby":b,"aria-busy":t||void 0,children:[o.jsxs("header",{className:"artifact-edit-dialog__header",children:[o.jsxs("div",{children:[o.jsx("h2",{id:g,children:s("artifactEdit.title")}),o.jsx("p",{id:b,children:s("artifactEdit.subtitle")})]}),o.jsx("button",{type:"button",onClick:i,disabled:t,"aria-label":s("artifactEdit.close"),children:o.jsx(AOe,{})})]}),o.jsxs("form",{onSubmit:w,children:[o.jsxs("div",{className:"artifact-edit-dialog__body",children:[o.jsxs("label",{className:"artifact-edit-field",children:[o.jsx("span",{children:s("artifactEdit.name")}),o.jsx("input",{ref:y,value:a,maxLength:yat,disabled:t,"aria-invalid":!!k||void 0,onChange:S=>{l(S.target.value),p("")}})]}),o.jsxs("label",{className:"artifact-edit-field",children:[o.jsx("span",{children:s("artifactEdit.description")}),o.jsx("textarea",{value:c,maxLength:UK,disabled:t,rows:4,placeholder:s("artifactEdit.descriptionPlaceholder"),onChange:S=>u(S.target.value)}),o.jsxs("small",{children:[c.length,"/",UK]})]}),o.jsxs("label",{className:"artifact-edit-field",children:[o.jsx("span",{children:s("artifactEdit.tags")}),o.jsx("input",{value:d,disabled:t,placeholder:s("artifactEdit.tagsPlaceholder",{max:gM}),onChange:S=>{f(S.target.value),p("")}})]}),k?o.jsx("div",{className:"artifact-edit-error",role:"alert",children:k}):null]}),o.jsxs("footer",{className:"artifact-edit-dialog__actions",children:[o.jsx("button",{type:"button",onClick:i,disabled:t,children:s("artifactEdit.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:t,children:s(t?"artifactEdit.saving":"artifactEdit.save")})]})]})]})}),document.body)}function _Oe({label:e,menuLabel:t,items:n,placement:i="bottom-end"}){return o.jsxs(vr,{children:[o.jsx(vr.Trigger,{children:o.jsx(zt,{type:"button",color:"secondary",variant:"ghost",size:"md",iconSize:"sm",uniform:!0,"aria-label":e,title:e,disabled:n.length===0,children:o.jsx(LFe,{"aria-hidden":"true"})})}),o.jsxs(vr.Content,{side:i==="top-end"?"top":"bottom",align:"end",minWidth:148,children:[o.jsx("span",{className:"sr-only",children:t}),n.map(r=>o.jsx(vr.Item,{disabled:r.disabled,onSelect:r.onSelect,children:o.jsx("span",{title:r.title,children:r.label})},r.label))]})]})}const wat="_Alert_1tr02_1",Oat="_Content_1tr02_145",Sat="_Indicator_1tr02_156",kat="_Message_1tr02_159",Eat="_Title_1tr02_162",Cat="_Description_1tr02_168",Tat="_Actions_1tr02_173",ng={Alert:wat,Content:Oat,Indicator:Sat,Message:kat,Title:Eat,Description:Cat,Actions:Tat},Eb=({color:e="primary",variant:t="outline",title:n,description:i,actions:r,actionsPlacement:s,indicator:a,className:l,actionsClassName:c,ref:u,...d})=>{const f=m.useRef(null),h=m.useRef(null),[p,g]=m.useState("end"),{width:b}=kye({ref:f});return m.useEffect(()=>{var y;const v=((y=h.current)==null?void 0:y.clientWidth)??0;if(v&&b){const x=v>b/3?"bottom":"end";g(x)}},[b]),o.jsxs("div",{ref:Zk([u,f]),className:pi(ng.Alert,l),"data-variant":t,"data-color":e,role:e==="danger"?"alert":void 0,"data-actions-placement":s??p,...d,children:[a===!1?null:o.jsx("div",{className:ng.Indicator,children:a??o.jsx(Aat,{color:e})}),o.jsxs("div",{className:ng.Content,children:[o.jsxs("div",{className:ng.Message,children:[n&&o.jsx("div",{className:ng.Title,children:n}),i&&o.jsx("div",{className:ng.Description,children:i})]}),r&&o.jsx("div",{className:pi(ng.Actions,c),ref:h,children:r})]})]})},Aat=({color:e})=>{switch(e){case"warning":case"caution":case"danger":return o.jsx(xbe,{});case"success":return o.jsx(gbe,{});default:return o.jsx(bbe,{})}};function pc({title:e,description:t,error:n,confirmLabel:i,cancelLabel:r,closeLabel:s,variant:a="warning",busy:l=!1,onCancel:c,onConfirm:u}){const{t:d}=Ae("shell"),f=r??d("confirm.cancel"),h=s??d("confirm.close"),p=m.useId(),g=m.useId(),b=m.useRef(null),v=m.useRef(l),y=m.useRef(c);return m.useEffect(()=>{v.current=l,y.current=c},[l,c]),m.useEffect(()=>{var k;const x=document.body.style.overflow,O=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(k=b.current)==null||k.focus();const w=S=>{S.key==="Escape"&&!v.current&&y.current()};return window.addEventListener("keydown",w),()=>{document.body.style.overflow=x,window.removeEventListener("keydown",w),O!=null&&O.isConnected&&O.focus()}},[]),Li.createPortal(o.jsx("div",{className:"studio-confirm-backdrop",onMouseDown:x=>{x.target===x.currentTarget&&!l&&c()},children:o.jsxs("section",{className:`studio-confirm-dialog studio-confirm-dialog--${a}`,role:"alertdialog","aria-modal":"true","aria-labelledby":p,"aria-describedby":g,"aria-busy":l||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(xbe,{})}),o.jsx("h2",{id:p,children:e})]}),o.jsx(zt,{type:"button",className:"studio-confirm-close",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:c,disabled:l,"aria-label":h,children:o.jsx(PF,{})})]}),o.jsxs("div",{className:"studio-confirm-body",children:[o.jsx("p",{id:g,children:t}),n?o.jsx(Eb,{className:"studio-confirm-error",color:"danger",variant:"soft",description:n}):null]}),o.jsxs("footer",{className:"studio-confirm-actions",children:[o.jsx(zt,{ref:b,type:"button",color:"secondary",variant:"ghost",size:"lg",pill:!1,onClick:c,disabled:l,children:f}),o.jsx(zt,{type:"button",className:"studio-confirm-primary",color:a==="danger"?"danger":"primary",size:"lg",pill:!1,loading:l,onClick:u,disabled:l,children:i})]})]})}),document.body)}const _at="_Container_1a6nz_1",Nat="_Input_1a6nz_229",zK={Container:_at,Input:Nat},qr=e=>{const t=m.useRef(null),i=`search-ui-input-${m.useId()}`,{id:r,name:s,type:a="text",variant:l="outline",size:c="md",gutterSize:u,className:d,autoComplete:f,disabled:h=!1,readOnly:p=!1,invalid:g=!1,allowAutofillExtensions:b=a==="password"||!!s||!!f&&f!=="off",onFocus:v,onBlur:y,onAnimationStart:x,onAutofill:O,autoSelect:w,startAdornment:k,endAdornment:S,pill:E,opticallyAlign:C,ref:N,..._}=e,j=P=>{const R=t.current;if(!P.target||!(P.target instanceof Element)||!R||R.contains(P.target)||P.target.closest("button, [type='button'], [role='button'], [role='menuitem']"))return;P.preventDefault(),document.activeElement!==R&&R.focus();const{left:L,top:M}=R.getBoundingClientRect(),{clientX:U,clientY:I}=P,H=I{var P;w&&((P=t.current)==null||P.select())},[w]);const T=P=>{x==null||x(P),P.animationName==="native-autofill-in"&&(O==null||O())};return o.jsxs("div",{className:pi(zK.Container,d),"data-variant":l,"data-size":c,"data-gutter-size":u,"data-focused":A,"data-disabled":h?"":void 0,"data-readonly":p?"":void 0,"data-invalid":g?"":void 0,"data-pill":E?"":void 0,"data-optically-align":C,"data-has-start-adornment":k?"":void 0,"data-has-end-adornment":S?"":void 0,onMouseDown:j,children:[k,o.jsx("input",{..._,ref:Zk([N,t]),id:r||(b?void 0:i),className:zK.Input,type:a,name:s,autoComplete:f,readOnly:p,disabled:h,onFocus:P=>{F(!0),v==null||v(P)},onBlur:P=>{F(!1),y==null||y(P)},onAnimationStart:T,"data-lpignore":b?void 0:!0,"data-1p-ignore":b?void 0:!0}),S]})},jat="_SelectControl_1tyi7_1",Rat="_Clear_1tyi7_436",Iat="_DropdownIcon_1tyi7_437",Pat="_TriggerText_1tyi7_468",Dat="_IndicatorWrapper_1tyi7_476",Mat="_StartIcon_1tyi7_482",Lat="_DropdownIconChevron_1tyi7_534",$at="_LoadingIndicator_1tyi7_537",Mf={SelectControl:jat,Clear:Rat,DropdownIcon:Iat,TriggerText:Pat,IndicatorWrapper:Dat,StartIcon:Mat,DropdownIconChevron:Lat,LoadingIndicator:$at},Fat=({ref:e,onPointerDown:t,onKeyDown:n,onPointerEnter:i,onInteract:r,invalid:s,disabled:a,children:l,className:c,variant:u="outline",size:d="md",block:f,opticallyAlign:h,pill:p=!0,loading:g,onClearClick:b,selected:v=!1,StartIcon:y,dropdownIconType:x="dropdown",...O})=>{const w=m.useRef(null),S=!!b&&v&&!g&&!a,E=x&&x!=="none"&&!g,C=S||g||E,N=!g&&!a,_=A=>{var F;switch(A.key){case"ArrowDown":case"ArrowUp":case" ":A.stopPropagation(),A.preventDefault(),r?r():(F=w.current)==null||F.dispatchEvent(new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0,pointerType:"mouse"}));break;case"Enter":break;default:n==null||n(A)}},j=A=>{var F;A.button!==2&&(A.stopPropagation(),r?(A.preventDefault(),r()):(t==null||t(A),(F=O.onClick)==null||F.call(O,A)))};return o.jsxs("span",{ref:Zk([w,e]),className:pi(Mf.SelectControl,c),role:"button",tabIndex:a?-1:0,onPointerEnter:A=>{o7(A),i==null||i(A)},onPointerDown:N?j:void 0,onKeyDown:N?_:void 0,"data-variant":u,"data-block":f?"":void 0,"data-pill":p?"":void 0,"data-size":d,"data-optically-align":h,"aria-busy":g?"true":void 0,"data-selected":v,"data-loading":g?"":void 0,"data-invalid":s?"":void 0,"data-disabled":a?"":void 0,"aria-disabled":a,...O,onClick:void 0,children:[y&&o.jsx(y,{className:Mf.StartIcon}),o.jsx("span",{className:Mf.TriggerText,children:l}),C&&o.jsxs("div",{className:Mf.IndicatorWrapper,children:[S&&o.jsx(zt,{"aria-label":"Clear current value",className:Mf.Clear,onPointerDown:A=>{A.stopPropagation()},onClick:A=>{A.stopPropagation(),A.preventDefault(),b()},color:"secondary",variant:E?"ghost":"solid",size:"3xs",uniform:!0,pill:p,"data-only-child":E?void 0:"",children:o.jsx(PF,{})}),g&&o.jsx(Hk,{className:Mf.LoadingIndicator}),E&&o.jsx(Bat,{iconType:x})]})]})},Bat=({iconType:e})=>e==="chevronDown"?o.jsx(RFe,{className:pi(Mf.DropdownIcon,Mf.DropdownIconChevron)}):o.jsx($Fe,{className:Mf.DropdownIcon}),Uat="_Menu_n4tw6_3",Qat="_MenuList_n4tw6_5",zat="_MenuInner_n4tw6_50",Vat="_OptionsList_n4tw6_64",Hat="_Option_n4tw6_64",qat="_PressableInner_n4tw6_111",Wat="_OptionInner_n4tw6_113",Gat="_OptionCheck_n4tw6_118",Kat="_OptionIndicatorSlot_n4tw6_123",Xat="_OptionGroupHeading_n4tw6_128",Yat="_OptionHardLimitHeading_n4tw6_140",Zat="_OptionsLimit_n4tw6_147",Jat="_Action_n4tw6_152",eot="_ActionInner_n4tw6_218",tot="_ActionsContainer_n4tw6_224",not="_Search_n4tw6_244",iot="_SearchEmpty_n4tw6_247",Pr={Menu:Uat,MenuList:Qat,MenuInner:zat,OptionsList:Vat,Option:Hat,PressableInner:qat,OptionInner:Wat,OptionCheck:Gat,OptionIndicatorSlot:Kat,OptionGroupHeading:Xat,OptionHardLimitHeading:Yat,OptionsLimit:Zat,Action:Jat,ActionInner:eot,ActionsContainer:tot,Search:not,SearchEmpty:iot},NOe=m.createContext(null),Bm=()=>{const e=m.use(NOe);if(!e)throw new Error("Select components must be wrapped in ");return e},rot=({label:e})=>o.jsx(o.Fragment,{children:e}),sot=({label:e})=>o.jsx(o.Fragment,{children:e}),aot=({values:e,selectedAll:t})=>{const n=t?"All selected":e.length===0?"Select...":e.length===1?e[0].label:`${e.length} selected`;return o.jsx(o.Fragment,{children:n})},Ls=e=>{const{id:t,required:n,value:i,name:r,multiple:s,variant:a="outline",size:l="md",dropdownIconType:c="dropdown",loading:u=!1,clearable:d=!1,disabled:f=!1,placeholder:h="Select...",loadingPlaceholder:p="Loading...",pill:g=!0,listWidth:b,options:v,actions:y=[],side:x="bottom",avoidCollisions:O=!0,onChange:w,optionClassName:k,OptionView:S=rot,TriggerStartIcon:E,triggerClassName:C,opticallyAlign:N,TriggerView:_,searchPlaceholder:j="",searchPredicate:A=yot,searchEmptyMessage:F="No results found.",listMaxWidth:T="auto"}=e,P=e.block??a!=="ghost",R=e.align??(P?"center":"start"),L=e.alignOffset??(R==="center"?0:-5),M=e.listMinWidth??(P?"auto":300),U=xm((ge,G)=>{if(s){if(!ge.value){w([]);return}if(G){const K=i.filter(ue=>ue!==ge.value),ae=k6(v,K);w(ae)}else{const K=k6(v,i);w(K.concat(ge))}}else w(ge)}),I=m.useRef(A);I.current=A;const H=m.useMemo(()=>y,[y.length]),Z=m.useRef(y);Z.current=y;const Q=m.useCallback(ge=>{var G;(G=Z.current.find(K=>K.id===ge))==null||G.onSelect(ge)},[]),q=m.useMemo(()=>_B(v)?v.reduce((ge,G)=>ge+G.options.length,0):v.length,[v]),te=`select-trigger-${m.useId()}`,ce=q>15,se=m.useMemo(()=>s?{multiple:!0,value:i,TriggerView:_??aot}:{multiple:!1,value:i,TriggerView:_??sot},[s,i,_]),re=m.useMemo(()=>({...se,triggerId:te,id:t,name:r,required:n,options:v,placeholder:h,loadingPlaceholder:p,loading:u,clearable:d,variant:a,pill:g,size:l,dropdownIconType:c,block:P,align:R,alignOffset:L,side:x,avoidCollisions:O,listWidth:b,listMinWidth:M,listMaxWidth:T,searchPlaceholder:j,searchEmptyMessage:F,TriggerStartIcon:E,triggerClassName:C,opticallyAlign:N,optionClassName:k,OptionView:S,actions:H,onActionSelect:Q,onSelectRef:U,searchPredicateRef:I,searchable:ce,disabled:f}),[se,te,t,n,r,v,h,p,u,d,a,g,l,c,P,R,L,x,O,b,M,T,j,F,E,C,N,k,S,H,Q,U,ce,f]);return o.jsx(NOe.Provider,{value:re,children:o.jsx(lot,{})})},oot=e=>{const{triggerId:t,id:n,required:i,value:r,multiple:s,options:a,loading:l,disabled:c,clearable:u,name:d,variant:f,pill:h,size:p,dropdownIconType:g,placeholder:b,loadingPlaceholder:v,block:y,opticallyAlign:x,triggerClassName:O,TriggerStartIcon:w,TriggerView:k,onSelectRef:S}=Bm(),{onOpenChange:E,...C}=e,N=s?r[0]:r,_=l?v:b,j=m.useMemo(()=>xot(a,N)||{value:"",label:_},[N,a,_]),A=s?r.length>0:!!r,F=l||!A,T=m.useMemo(()=>MOe(),[]),P=m.useMemo(()=>{if(!s)return{values:[],selectedAll:!1};const M=k6(a,r),U=a.flatMap(I=>"options"in I?I.options:I);return{values:M.length?M:[{value:"",label:_}],selectedAll:U.length<=r.length}},[s,a,r,_]),R=M=>{const U=M.key;if(!s&&LOe(U)){const I=T(U);M.stopPropagation();const H=$Oe(a,I,N);H&&S.current(H)}},L=()=>{S.current({value:"",label:""}),E==null||E(!1)};return o.jsxs(Fat,{id:t,className:O,selected:!F,variant:f,pill:h,block:y,size:p,disabled:c,loading:l,StartIcon:w,opticallyAlign:x,dropdownIconType:g,onClearClick:u?L:void 0,onInteract:E,onKeyDown:R,...C,children:[s?o.jsx(k,{...P}):o.jsx(k,{...j}),(d||n)&&o.jsx("input",{id:n,name:d,value:N,tabIndex:-1,onFocus:()=>{var M;(M=document.getElementById(t))==null||M.focus()},onChange:()=>{},required:i,className:"sr-only w-full h-0 left-0 bottom-0 pointer-events-none","aria-hidden":"true"})]})},lot=()=>{const{triggerId:e,loading:t,side:n,align:i,alignOffset:r,avoidCollisions:s,listWidth:a,listMinWidth:l,listMaxWidth:c}=Bm(),[u,d]=m.useState(!1),f=m.useRef(null),h=p=>{const g=p===void 0?!u:p;d(g),g||setTimeout(()=>{var v;if(!f.current)return;const b=document.activeElement;b&&!f.current.contains(b)||(v=document.getElementById(e))==null||v.focus()})};return Yk(u,()=>{h(!1)}),o.jsxs(fxe,{open:u,onOpenChange:p=>{t&&p||h(p)},modal:!1,children:[o.jsx(hxe,{asChild:!0,children:o.jsx(oot,{onOpenChange:h})}),o.jsx(pxe,{forceMount:!0,children:o.jsx(Lx,{className:Pr.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:u&&o.jsx(mxe,{ref:f,forceMount:!0,className:Pr.MenuList,side:n,sideOffset:5,align:i,alignOffset:r,avoidCollisions:s,collisionPadding:{bottom:30,top:30},onOpenAutoFocus:ih,onCloseAutoFocus:ih,onEscapeKeyDown:ih,style:Wb({"select-list-width":a,"select-list-min-width":l,"select-list-max-width":c}),children:o.jsx(cot,{onOpenChange:h})},"dropdown")})})]})},jOe=m.createContext(null),Qx=()=>{const e=m.use(jOe);if(!e)throw new Error("CustomSelectMenu components must be wrapped in ");return e},cot=({onOpenChange:e})=>{const{multiple:t,value:n,options:i,searchable:r,searchPredicateRef:s}=Bm(),a=m.useRef(()=>e(!1)),l=m.useRef(null),c=m.useRef(null),u=m.useRef(null),[d,f]=m.useState(""),[h,p]=m.useState(()=>{var N;return((t?n[0]:n)||((N=wT(i))==null?void 0:N.value))??""}),g=m.useMemo(()=>MOe(),[]),v=`select-list-${m.useId()}`,y=m.useRef(t?"":n),x=m.useMemo(()=>d.trim().toLocaleLowerCase(),[d]),O=m.useMemo(()=>vot(i,x,s.current),[i,x,s]),w=m.useMemo(()=>wT(O),[O]),k=m.useRef(!1),S=C=>{const N=C.key,_=t?n[0]:n,j=h||(w==null?void 0:w.value)||_,A=document.activeElement===u.current,F=l.current;if(!F)return;const T=()=>{const L=new PointerEvent("pointerup",{bubbles:!0,cancelable:!0,pointerType:"mouse"}),M=Rf(h,F);M==null||M.dispatchEvent(L)},P=(L,M)=>{p(L),M.scrollIntoView({block:"nearest"})},R=()=>{const L=t?n[0]:n;if(L){const U=Rf(L,F);if(U){P(L,U);return}}const M=wT(i);if(M){const U=Rf(M.value,F);U&&P(M.value,U)}};switch(N){case"ArrowDown":{if(C.preventDefault(),!h||!Rf(h,F)){R();return}const L=wot(h,F),M=L==null?void 0:L.getAttribute("data-option-id");L&&M&&P(M,L);return}case"ArrowUp":{if(C.preventDefault(),!h||!Rf(h,F)){R();return}const L=Oot(j,F),M=L==null?void 0:L.getAttribute("data-option-id");L&&M&&P(M,L);return}case"Enter":C.preventDefault(),T();return;case" ":if(x&&A)return;C.preventDefault(),T();return}if(LOe(N)){if(A)return;const L=g(N);C.stopPropagation();const M=$Oe(i,L,h);if(M){const U=Rf(M.value,F);U&&(p(M.value),U.scrollIntoView({block:"nearest"}))}}},E=m.useMemo(()=>({valueRef:y,listId:v,highlightedValue:h,setHighlightedValue:p,requestCloseRef:a,searchTerm:d,setSearchTerm:f,searchInputRef:u,listRef:c}),[v,h,p,d,f]);return m.useEffect(()=>{F_(()=>{if(!l.current)return;const N=Rf(h,l.current);N==null||N.scrollIntoView({block:"center"})});const C=u.current||l.current;return C==null||C.focus({preventScroll:!0}),()=>{k.current=!1}},[]),m.useLayoutEffect(()=>{if(!k.current){k.current=!0;return}if(!c.current)return;c.current.scrollTop=0;const C=wT(O);C&&p(C.value)},[O]),o.jsx(jOe,{value:E,children:o.jsxs("div",{id:v,className:Pr.MenuInner,onKeyDown:S,ref:l,tabIndex:0,children:[r&&o.jsx(uot,{value:d,onChange:f}),o.jsx(dot,{filteredOptions:O}),o.jsx(got,{})]})})},uot=({value:e,onChange:t})=>{const{searchPlaceholder:n}=Bm(),{listId:i,searchInputRef:r}=Qx(),s=a=>{t(a.target.value)};return o.jsx("div",{className:Pr.Search,children:o.jsx(qr,{startAdornment:o.jsx(GFe,{width:16,height:16,className:"fill-secondary"}),ref:r,value:e,placeholder:n,onChange:s,autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-controls":i,"aria-expanded":!0})})},cE=e=>"options"in e,_B=e=>e[0]&&cE(e[0]),rv=300,dot=({filteredOptions:e})=>{const{searchEmptyMessage:t}=Bm(),{listRef:n}=Qx();if(!e.length)return typeof t=="string"?o.jsx("p",{className:Pr.SearchEmpty,"data-text-only":!0,children:t}):o.jsx("div",{className:Pr.SearchEmpty,children:t});const i=_B(e),r=!i&&e.length>rv,s=i?e.map(a=>o.jsx(hot,{...a},a.label)):e.slice(0,rv).map(a=>o.jsx(IOe,{...a},a.value));return o.jsxs("div",{className:Pr.OptionsList,ref:n,children:[s,r&&o.jsx(ROe,{numHidden:e.length-rv})]})},fot={limit:100,label:"Show all"},hot=({label:e,options:t,optionsLimit:n=fot})=>{const i=m.useId(),{searchTerm:r,setHighlightedValue:s}=Qx(),[a,l]=m.useState(!1),c=n.limit{l(!0),s(t[n.limit].value)};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:Pr.OptionGroupHeading,children:[o.jsx("div",{className:Pr.OptionIndicatorSlot}),e]}),d.map(h=>o.jsx(IOe,{...h},h.value)),c&&o.jsx(pot,{value:`group-limit-${i}`,label:n.label,onPointerUp:f}),u&&o.jsx(ROe,{numHidden:t.length-rv})]})},ROe=({numHidden:e})=>o.jsxs("div",{className:Pr.OptionHardLimitHeading,children:[o.jsx("div",{className:Pr.OptionIndicatorSlot}),`…and ${e.toLocaleString()} more options. Use search to refine results further.`]}),pot=({value:e,label:t,onPointerUp:n})=>{const{highlightedValue:i,setHighlightedValue:r}=Qx(),s=e===i,a=()=>{s||r(e)},l=()=>{r(c=>c!==e?c:"")};return o.jsx("div",{className:pi(Pr.Option,Pr.OptionsLimit),"data-option-id":e,"data-highlight":s?"":void 0,role:"option","aria-selected":s,onPointerUp:n,onPointerMove:a,onPointerLeave:l,children:o.jsxs("div",{className:pi(Pr.PressableInner,Pr.OptionInner),children:[o.jsx("div",{className:Pr.OptionIndicatorSlot}),t]})})},mot="data-option-id",IOe=e=>{const{optionClassName:t,OptionView:n,value:i,multiple:r,onSelectRef:s}=Bm(),{valueRef:a,requestCloseRef:l,highlightedValue:c,setHighlightedValue:u}=Qx(),{value:d,disabled:f,tooltip:h}=e,p=a.current,g=r?i.includes(d):d===p,b=d===c,v=()=>{var O;r?s.current(e,g):(s.current(e),(O=l.current)==null||O.call(l))},y=()=>{b||u(d)},x=()=>{u(O=>O!==d?O:"")};return o.jsx("div",{className:pi(Pr.Option,t),"data-highlight":b?"":void 0,role:"option","aria-selected":b,"data-selected":g?"":void 0,[mot]:d,onPointerUp:f?void 0:v,onPointerMove:f?void 0:y,onPointerLeave:f?void 0:x,"aria-disabled":f,"data-disabled":f?"":void 0,children:o.jsxs("div",{className:Pr.PressableInner,children:[o.jsxs("div",{className:Pr.OptionInner,children:[o.jsx("div",{className:Pr.OptionIndicatorSlot,children:g&&o.jsx(Lv,{className:Pr.OptionCheck})}),o.jsx(n,{...e}),h&&o.jsx(Uo,{content:h.content,maxWidth:h.maxWidth,side:"right",children:o.jsx(bbe,{})})]}),e.description&&o.jsxs("div",{className:Pr.OptionInner,children:[o.jsx("div",{className:Pr.OptionIndicatorSlot}),e.description]})]})})},got=()=>{const{actions:e}=Bm();return e.length===0?null:o.jsx("div",{className:Pr.ActionsContainer,children:e.map(t=>o.jsx(bot,{...t},t.id))})},bot=({id:e,label:t,Icon:n,className:i})=>{const{onActionSelect:r}=Bm(),{requestCloseRef:s}=Qx(),a=c=>{switch(c.key){case"Tab":break;case"Enter":case" ":c.stopPropagation(),l();break;default:c.stopPropagation()}},l=()=>{var c;r(e),(c=s.current)==null||c.call(s)};return o.jsx("div",{className:Pr.Action,onPointerUp:l,onKeyDown:a,tabIndex:0,children:o.jsxs("div",{className:pi(Pr.ActionInner,i),children:[n&&o.jsx(n,{role:"presentation"}),t]})})},yot=(e,t)=>e.label.toLowerCase().includes(t),vot=(e,t,n)=>{const i=t.trim().toLocaleLowerCase();if(!i)return e;const r=s=>n(s,i);return _B(e)?e.reduce((s,a)=>{const l=a.options.filter(r);return l.length&&s.push({...a,options:l}),s},[]):e.reduce((s,a)=>(r(a)&&s.push(a),s),[])},wT=e=>{if(!e.length)return;let t;for(const n of e)if(cE(n)){const i=n.options.find(r=>!r.disabled);if(i){t=i;break}}else if(!n.disabled){t=n;break}return t},xot=(e,t)=>{let n;for(const i of e)if(cE(i)){const r=i.options.find(s=>s.value===t);if(r){n=r;break}}else if(i.value===t){n=i;break}return n},k6=(e,t)=>{let n=[];const i=new Set(t);for(const r of e)if(cE(r)){const s=r.options.filter(a=>i.has(a.value));n=n.concat(s)}else i.has(r.value)&&n.push(r);return n},POe=40,Rf=(e,t)=>t.querySelector(`[data-option-id="${e}"]`),DOe=e=>e.matches("[data-option-id]:not([data-disabled])"),wot=(e,t)=>{const n=Rf(e,t);let i=n==null?void 0:n.nextElementSibling,r=0;for(;i&&r{const n=Rf(e,t);let i=n==null?void 0:n.previousElementSibling,r=0;for(;i&&r{let e="",t;return n=>(n=n.toLowerCase(),e+=n,t&&clearTimeout(t),t=setTimeout(()=>{e=""},500),n.repeat(e.length)===e?n:e)},LOe=e=>/^[a-zA-Z0-9]$/.test(e),$Oe=(e,t,n)=>{if(!e.length)return;let i,r,s=!n;const a=({disabled:l,label:c,value:u})=>u===n?(s=!0,!1):!l&&c.toLowerCase().startsWith(t);for(const l of e)if(cE(l)){for(const c of l.options)if(a(c))if(s){r=c;break}else i=i||c}else if(a(l))if(s){r=l;break}else i=i||l;return r||i};function na(...e){return e.filter(Boolean).join(" ")}const VK=[["14 90% 62%","28 96% 80%","3 44% 24%"],["198 72% 56%","217 88% 79%","189 42% 24%"],["263 66% 63%","291 72% 81%","242 39% 25%"],["146 49% 52%","169 66% 78%","158 38% 23%"],["334 72% 63%","15 87% 80%","350 41% 25%"]];function Sot(e){let t=2166136261;for(const a of e)t^=a.charCodeAt(0),t=Math.imul(t,16777619);const n=t>>>0,[i,r,s]=VK[n%VK.length];return{"--resource-identity-accent":i,"--resource-identity-glow":r,"--resource-identity-shadow":s,"--resource-identity-x":`${20+(n>>>7)%61}%`,"--resource-identity-y":`${18+(n>>>15)%57}%`}}function Xv({seed:e,className:t}){return o.jsx("span",{className:na("resource-card__identity-mark",t),style:Sot(e),"aria-hidden":"true"})}function kot(e){return o.jsx("svg",{viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",...e,children:o.jsxs("g",{transform:"translate(0.875 0.875)",children:[o.jsx("path",{d:"M5.869 10.719a4.849 4.849 0 1 0 0-9.698 4.849 4.849 0 0 0 0 9.698Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("path",{d:"m11.229 11.229-1.021-1.021",stroke:"currentColor",strokeWidth:"0.984375",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function Th({className:e,...t}){return o.jsx("section",{className:na("resource-page",e),...t})}function zx({title:e,description:t,className:n}){return o.jsxs("header",{className:na("resource-page__header",n),children:[o.jsx("h1",{children:e}),t?o.jsx("p",{children:t}):null]})}function Eot({className:e,...t}){return o.jsx("div",{className:na("resource-detail",e),...t})}function Cot({className:e,...t}){return o.jsx("header",{className:na("resource-detail__header",e),...t})}function Tot({title:e,description:t,identitySeed:n,meta:i,backLabel:r,onBack:s}){const{t:a}=Ce("ui"),l=r??a("resourceCollection.back");return o.jsxs("div",{className:"resource-detail__heading",children:[s?o.jsx("button",{type:"button",className:"resource-detail__back",onClick:s,"aria-label":l,title:l,children:o.jsx(l7e,{"aria-hidden":"true"})}):null,o.jsxs("div",{className:"resource-detail__heading-copy",children:[o.jsxs("div",{className:"resource-detail__title-row",children:[o.jsx("span",{className:"resource-detail__identity",children:o.jsx(Xv,{seed:n})}),o.jsx("h1",{children:e}),i?o.jsx("div",{className:"resource-detail__meta",children:i}):null]}),t?o.jsx("p",{children:t}):null]})]})}function Aot({className:e,...t}){return o.jsx("div",{className:na("resource-detail__actions",e),...t})}function _ot({className:e,...t}){return o.jsx("div",{className:na("resource-detail__body",e),...t})}function uE({title:e,description:t,identitySeed:n,meta:i,backLabel:r,onBack:s,actions:a,className:l,actionsClassName:c,bodyClassName:u,sections:d,activeSectionKey:f,navigationLabel:h,onSectionChange:p,children:g}){var O;const{t:b}=Ce("ui"),v=!!(d!=null&&d.length),y=(O=d==null?void 0:d.find(w=>w.key===f))==null?void 0:O.content,x=h??b("resourceCollection.detailNavigation");return o.jsxs(Eot,{className:l,children:[o.jsxs(Cot,{children:[o.jsx(Tot,{title:e,description:t,identitySeed:n,meta:i,backLabel:r,onBack:s}),a?o.jsx(Aot,{className:c,children:a}):null]}),o.jsx(_ot,{className:na(v&&"is-split",u),children:v?o.jsxs(o.Fragment,{children:[o.jsx("nav",{className:"resource-detail__navigation","aria-label":x,children:d==null?void 0:d.map(w=>o.jsx(Wt,{type:"button",color:"secondary",variant:w.key===f?"soft":"ghost",size:"lg",pill:!1,block:!0,"aria-current":w.key===f?"page":void 0,disabled:w.disabled,onClick:()=>p==null?void 0:p(w.key),children:o.jsx("span",{className:"resource-detail__navigation-label",children:w.label})},w.key))}),o.jsx("div",{className:"resource-detail__content",children:y})]}):g})]})}function NB({className:e,...t}){return o.jsx("dl",{className:na("resource-detail__summary",e),...t})}function FOe({title:e,description:t,actions:n,className:i}){return o.jsxs("header",{className:na("resource-detail__section-header",i),children:[o.jsxs("div",{children:[o.jsx("h2",{children:e}),t?o.jsx("p",{children:t}):null]}),n]})}function Not({rows:e,rowKey:t,rowLabel:n,columns:i,searchValue:r,onSearchChange:s,searchPlaceholder:a,searchLabel:l,primaryAction:c,rowActions:u,scrollRef:d,onScroll:f,busy:h,footer:p,emptyLabel:g}){const{t:b}=Ce("ui"),v=!!u,y=g??b("resourceCollection.noData");return o.jsxs("div",{className:"resource-data-table",children:[o.jsxs("div",{className:"resource-data-table__toolbar",children:[o.jsx("div",{className:"resource-data-table__search",children:o.jsx(qr,{type:"search",value:r,onChange:x=>s(x.target.value),placeholder:a,"aria-label":l})}),c?o.jsx(Wt,{type:"button",color:"primary",disabled:c.disabled,title:c.title,onClick:c.onClick,children:c.label}):null]}),o.jsxs("div",{ref:d,className:"resource-data-table__frame","aria-busy":h||void 0,onScroll:f,children:[o.jsxs("table",{className:"resource-data-table__table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[i.map(x=>o.jsx("th",{scope:"col",className:x.className,children:x.header},x.key)),v?o.jsx("th",{scope:"col",className:"resource-data-table__actions-heading",children:o.jsx("span",{className:"sr-only",children:b("resourceCollection.actions")})}):null]})}),o.jsx("tbody",{children:e.length===0?o.jsx("tr",{children:o.jsx("td",{className:"resource-data-table__empty",colSpan:i.length+(v?1:0),children:y})}):e.map(x=>{const O=t(x),w=(n==null?void 0:n(x))??O;return o.jsxs("tr",{children:[i.map(k=>o.jsx("td",{className:k.className,children:k.render(x)},k.key)),u?o.jsx("td",{className:"resource-data-table__actions",children:o.jsx(_Oe,{label:b("resourceCollection.moreActions",{label:w}),menuLabel:b("resourceCollection.actionsFor",{label:w}),items:u(x)})}):null]},O)})})]}),p]})]})}function Zb({className:e,...t}){return o.jsx("div",{className:na("resource-toolbar",e),...t})}function dE({items:e,value:t,onChange:n,ariaLabel:i,idPrefix:r,className:s}){const a=c=>{c.disabled||n(c.id)},l=(c,u)=>{var g;if(!["ArrowLeft","ArrowRight","Home","End"].includes(c.key))return;c.preventDefault();const d=e.filter(b=>!b.disabled),f=d.findIndex(b=>b.id===u.id),h=c.key==="Home"?0:c.key==="End"?d.length-1:(f+(c.key==="ArrowRight"?1:-1)+d.length)%d.length,p=d[h];p&&(n(p.id),(g=document.getElementById(`${r}-${p.id}-tab`))==null||g.focus())};return o.jsx("nav",{className:na("resource-tabs",s),"aria-label":i,role:"tablist",children:e.map(c=>o.jsx("button",{type:"button",id:`${r}-${c.id}-tab`,className:t===c.id?"is-active":void 0,role:"tab","aria-selected":t===c.id,"aria-controls":c.panelId,tabIndex:t===c.id?0:-1,disabled:c.disabled,onClick:()=>a(c),onKeyDown:u=>l(u,c),children:c.label},c.id))})}function wm({className:e,...t}){return o.jsxs("label",{className:na("resource-search",e),children:[o.jsx(kot,{}),o.jsx("input",{type:"search",...t})]})}const jot=150,Rot=200;function HK(e){e.dispatchEvent(new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0,pointerType:"mouse",button:0}))}function lN({id:e,ariaLabel:t,value:n,options:i,onChange:r,className:s,disabled:a=!1}){const l=m.useRef(null),c=m.useRef(null),u=m.useRef(null),d=m.useRef(!1),f=m.useCallback(()=>{c.current!==null&&(window.clearTimeout(c.current),c.current=null)},[]),h=m.useCallback(()=>{u.current!==null&&(window.clearTimeout(u.current),u.current=null)},[]),p=m.useCallback(()=>{var y;return((y=l.current)==null?void 0:y.querySelector(".resource-filter-select__trigger"))??null},[]),g=m.useCallback(()=>{h();const y=p();d.current&&(y==null?void 0:y.getAttribute("data-state"))==="open"&&HK(y),d.current=!1},[h,p]),b=m.useCallback(()=>{d.current&&(h(),u.current=window.setTimeout(g,Rot))},[h,g]),v=m.useCallback(y=>{var w;if(a||!window.matchMedia("(hover: hover) and (pointer: fine)").matches)return;h();const x=p();if(!x||x.getAttribute("data-state")==="open")return;const O=document.activeElement;O instanceof HTMLElement&&O!==x&&!((w=l.current)!=null&&w.contains(O))&&O.matches("input, textarea, [contenteditable='true']")||(f(),c.current=window.setTimeout(()=>{const k=p();!k||k.getAttribute("data-state")==="open"||(d.current=!0,HK(k))},jot))},[h,f,a,p]);return m.useEffect(()=>{const y=x=>{var E;if(!d.current)return;const O=p();if(!O||O.getAttribute("data-state")!=="open"){d.current=!1,h();return}const w=x.target;if(!(w instanceof Node))return;const k=O.getAttribute("aria-controls"),S=k?document.getElementById(k):null;if((E=l.current)!=null&&E.contains(w)||S!=null&&S.contains(w)){h();return}b()};return document.addEventListener("pointermove",y,{passive:!0}),()=>{document.removeEventListener("pointermove",y),f(),h()}},[h,f,p,b]),o.jsxs("div",{ref:l,className:na("resource-filter-select",s),onMouseEnter:v,onMouseLeave:()=>{f(),b()},children:[o.jsx("label",{className:"sr-only",htmlFor:e,children:t}),o.jsx(Ls,{id:e,value:n,options:i,size:"md",variant:"ghost",pill:!1,block:!1,align:"end",listMinWidth:160,disabled:a,triggerClassName:"resource-filter-select__trigger",onChange:y=>r(y.value)})]})}const Jb=m.forwardRef(function({className:t,...n},i){return o.jsx("section",{ref:i,className:na("resource-results",t),...n})});function Ud(){const{t:e}=Ce("ui");return o.jsxs("div",{className:"resource-loading-state",role:"status","aria-live":"polite","aria-busy":"true",children:[o.jsx(Hk,{size:16}),o.jsx(An,{as:"span",duration:2.4,children:e("resourceCollection.loading")})]})}function Vx({className:e,...t}){return o.jsx("div",{className:na("resource-grid",e),...t})}function jB({className:e,footer:t,actions:n,activateLabel:i,onActivate:r,children:s,...a}){return o.jsxs("article",{className:na("resource-card",r&&"is-interactive",e),...a,children:[r&&i?o.jsx("button",{type:"button",className:"resource-card__target","aria-label":i,title:i,onClick:r}):null,o.jsx("div",{className:"resource-card__content",children:s}),t||n?o.jsxs("footer",{className:"resource-card__footer",children:[t,n?o.jsx("div",{className:"resource-card__actions",children:n}):null]}):null]})}function E6({className:e,iconOnly:t=!1,tone:n="secondary",...i}){return o.jsx("button",{type:"button",className:na("resource-card__action",`is-${n}`,t&&"is-icon-only",e),...i})}function C6({label:e,icon:t="arrow",tone:n="primary",className:i,children:r,title:s,...a}){const l=t==="play"?o.jsx(qFe,{}):t==="plus"?o.jsx(vbe,{}):o.jsx(_Fe,{});return o.jsx(E6,{className:i,iconOnly:!0,tone:n,"aria-label":e,title:s??e,...a,children:r??l})}function RB({leading:e,title:t,titleText:n,subtitle:i,status:r}){return o.jsxs("div",{className:"resource-card__header",children:[o.jsxs("div",{className:"resource-card__identity",children:[e,o.jsxs("div",{className:"resource-card__title-copy",children:[o.jsx("h3",{title:n,children:t}),i]})]}),r]})}function IB({children:e,title:t}){return o.jsx("p",{className:"resource-card__description",title:t,children:e})}function BOe({items:e,className:t}){return o.jsx("dl",{className:na("resource-card__metadata",t),children:e.map((n,i)=>o.jsxs("div",{className:n.className,children:[o.jsx("dt",{className:n.hideLabel?"sr-only":void 0,children:n.label}),o.jsx("dd",{title:n.title,children:n.value})]},`${String(n.label)}:${i}`))})}function Cb({className:e,icon:t,children:n,...i}){return o.jsxs("button",{type:"button",className:na("resource-create-card",e),...i,children:[o.jsx("span",{className:"resource-create-card__icon","aria-hidden":"true",children:t}),o.jsx("span",{children:n})]})}const Iot=new Set(["avif","bmp","gif","heic","jpeg","jpg","png","svg","tif","tiff","webp"]),Pot=new Set(["avi","m4v","mkv","mov","mp4","mpeg","mpg","webm"]),Dot=new Set(["csv","htm","html","json","md","pdf","svg","txt","xml","yaml","yml"]);function UOe(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t+1).toLocaleLowerCase()}function cN(e,t){if(!Number.isFinite(e))return t;const n=e;return n>1e10?n:n*1e3}function Mot(e){var t,n;return((t=e.actions)==null?void 0:t.artifactDelta)??((n=e.actions)==null?void 0:n.artifact_delta)}function Lot(e){return`${e.replace(/\.pptx$/i,"")}.preview.webp`}function $ot(e){var t;return(((t=e.content)==null?void 0:t.parts)??[]).map(n=>n.functionResponse??n.function_response).filter(n=>!!n)}function Fot(e){if(!e)return{};const t=e.result;return t&&typeof t=="object"&&!Array.isArray(t)?t:e}function qK(e,t,n){var i;if(/\.[A-Za-z0-9]{2,8}$/.test(e))return e;try{const r=new URL(t).pathname.split("/").filter(Boolean),a=((i=(r[r.length-1]??"").match(/\.[A-Za-z0-9]{2,8}$/))==null?void 0:i[0])??"";if(a)return`${e}${a}`}catch{}return`${e}.${n==="image"?"png":"mp4"}`}function Bot(e,t){const n=Fot(t),i=e==="image_generate"||e.endsWith("_image_generate"),r=["video_generate","video_task_query"].some(u=>e===u||e.endsWith(`_${u}`));if(!i&&!r)return[];const s=i?"image":"video",a=[],l=n.success_list;if(Array.isArray(l)){for(const u of l)if(!(!u||typeof u!="object"||Array.isArray(u)))for(const[d,f]of Object.entries(u))typeof f=="string"&&f.startsWith("https://")&&a.push({name:qK(d,f,s),url:f,type:s})}const c=n.video_url;if(r&&typeof c=="string"&&c.startsWith("https://")){const u=typeof n.task_id=="string"?n.task_id:void 0;a.push({name:qK(u||"generated-video",c,s),url:c,type:s,taskId:u})}return a}function WK(e,t){return new Date(cN(e,t)||Date.now()).toISOString()}function Uot(e,t){var r;const n=[],i=new Set;for(const s of e)for(const a of s.sessions){const l=cN(a.lastUpdateTime,Date.now()),c=cR(a.events,t);for(const u of a.events??[])for(const d of $ot(u)){const f=(d==null?void 0:d.name)??"";for(const h of Bot(f,d==null?void 0:d.response)){const p=`${a.id}:${u.id??""}:${f}:${h.url}`;i.has(p)||(i.add(p),n.push({sourceUrl:h.url,name:h.name,mimeType:h.type==="image"?"image/png":"video/mp4",appName:s.appName,agentId:s.agentId,agentName:((r=s.agentName)==null?void 0:r.trim())||s.appName,sessionId:a.id,sessionTitle:c,sessionUpdatedAt:WK(a.lastUpdateTime,l),createdAt:WK(u.timestamp,l),origin:{runtimeId:s.runtimeId,region:s.region,eventId:u.id,invocationId:u.invocationId??u.invocation_id,toolName:f,taskId:h.taskId}}))}}}return n}function QOe(e){const t=UOe(e);return Iot.has(t)?"image":Pot.has(t)?"video":"document"}function Qot(e){const t=QOe(e);return t==="image"?"image":t==="video"?"video":Dot.has(UOe(e))?"frame":"unavailable"}function zot(e,t,n="en-US"){var r;const i=[];for(const s of e)for(const a of s.sessions){const l=cN(a.lastUpdateTime,0),c=new Map;for(const u of a.events??[]){const d=Mot(u);if(!d)continue;const f=cN(u.timestamp,l);for(const[h,p]of Object.entries(d)){if(!h||!Number.isFinite(p))continue;const g=c.get(h);(!g||p>=g.version)&&c.set(h,{filename:h,version:p,createdAt:f})}}for(const u of c.values()){if(/\.preview\.webp$/i.test(u.filename))continue;const d=c.get(Lot(u.filename)),f=d??u,h=d?"image":Qot(u.filename);i.push({id:`${s.appName}:${a.id}:${u.filename}:${u.version}`,appName:s.appName,agentId:s.agentId,sessionId:a.id,sessionTitle:cR(a.events,t),agentName:((r=s.agentName)==null?void 0:r.trim())||s.appName,sessionUpdatedAt:l,name:u.filename,version:u.version,type:QOe(u.filename),createdAt:u.createdAt||l,origin:{runtimeId:s.runtimeId,region:s.region},preview:{filename:f.filename,version:f.version,mode:h}})}}return i.sort((s,a)=>a.createdAt-s.createdAt||s.name.localeCompare(a.name,n))}function zOe(e,t,n){if(!e)return n;const i=new Date(e);if(Number.isNaN(i.getTime()))return n;const r=new Date;return i.getFullYear()===r.getFullYear()&&i.getMonth()===r.getMonth()&&i.getDate()===r.getDate()?new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit",hour12:!1}).format(i):new Intl.DateTimeFormat(t,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(i)}function VOe(e){return!e||e<=0?"":e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(e<10*1024*1024?1:0)} MB`:`${(e/(1024*1024*1024)).toFixed(1)} GB`}const bM=40;function Vot(e){return[{value:"all",label:e("artifactLibrary.types.all")},{value:"document",label:e("artifactLibrary.types.document")},{value:"image",label:e("artifactLibrary.types.image")},{value:"video",label:e("artifactLibrary.types.video")}]}function Hot(e,t){return e(`artifactLibrary.types.${t}`)}function OT(e){return e instanceof Error?e.message:String(e)}function HOe({artifact:e,large:t=!1}){return o.jsx("div",{className:`library-artifact-preview library-artifact-preview--${e.type}${t?" is-large":""}`,children:e.thumbnailUrl?o.jsxs(o.Fragment,{children:[o.jsx("img",{className:"library-artifact-preview-media",src:e.thumbnailUrl,alt:"",loading:"lazy"}),e.type==="video"?o.jsx("span",{className:"artifact-video-play is-overlay","aria-hidden":"true",children:o.jsx(BK,{})}):null]}):e.type==="document"?o.jsxs("div",{className:"artifact-document-sheet","aria-hidden":"true",children:[o.jsx("span",{className:"is-title"}),o.jsx("span",{}),o.jsx("span",{}),o.jsx("span",{className:"is-short"})]}):e.type==="image"?o.jsxs("div",{className:"artifact-image-scene","aria-hidden":"true",children:[o.jsx("span",{className:"artifact-image-sun"}),o.jsx("span",{className:"artifact-image-plane artifact-image-plane--back"}),o.jsx("span",{className:"artifact-image-plane artifact-image-plane--front"})]}):o.jsxs("div",{className:"artifact-video-frame","aria-hidden":"true",children:[o.jsx("span",{className:"artifact-video-orbit"}),o.jsx("span",{className:"artifact-video-node artifact-video-node--one"}),o.jsx("span",{className:"artifact-video-node artifact-video-node--two"}),o.jsx("span",{className:"artifact-video-play",children:o.jsx(BK,{})})]})})}function qot({artifact:e,pendingAction:t,disabled:n,onPreview:i,onDownload:r,onEdit:s,onDelete:a,onOpenSource:l,t:c,locale:u}){const d=t===`download:${e.id}`;return o.jsxs("tr",{className:"library-artifact-row",children:[o.jsx("td",{className:"library-artifact-file",children:o.jsxs("button",{type:"button",className:"library-artifact-preview-trigger","aria-label":c("artifactLibrary.previewArtifact",{name:e.name}),disabled:n||!!t,onClick:()=>i(e),children:[o.jsx("div",{className:"library-artifact-thumbnail",children:o.jsx(HOe,{artifact:e})}),o.jsxs("div",{className:"library-artifact-row-title",children:[o.jsx("span",{className:"library-artifact-row-name",title:e.name,children:e.name}),o.jsx("span",{className:"library-artifact-row-size",children:VOe(e.sizeBytes)||"—"})]})]})}),o.jsx("td",{className:"library-artifact-source-cell",children:l?o.jsxs("button",{type:"button",className:"library-artifact-source-link",title:`${e.agentName} / ${e.sessionTitle}`,onClick:()=>l(e),children:[o.jsx("span",{children:e.agentName}),o.jsx("span",{"aria-hidden":"true",children:"/"}),o.jsx("span",{children:e.sessionTitle})]}):o.jsxs("span",{title:`${e.agentName} / ${e.sessionTitle}`,children:[e.agentName," / ",e.sessionTitle]})}),o.jsx("td",{className:"library-artifact-time",children:zOe(e.updatedAt??e.createdAt,u,c("artifactLibrary.unknownTime"))}),o.jsx("td",{className:"library-artifact-actions-cell",children:o.jsx("div",{className:"library-artifact-actions",children:o.jsx(_Oe,{label:c("artifactLibrary.moreActions",{name:e.name}),menuLabel:c("artifactLibrary.actionMenu",{name:e.name}),placement:"bottom-end",items:[{label:c(d?"artifactLibrary.downloading":"artifactLibrary.download"),onSelect:()=>r(e),disabled:n||!!t},...s?[{label:c("artifactLibrary.edit"),onSelect:()=>s(e),disabled:n||!!t||e.canManage===!1}]:[],...a?[{label:c("artifactLibrary.delete"),onSelect:()=>a(e),disabled:n||!!t||e.canManage===!1,danger:!0}]:[]]})})})]})}function Wot({sources:e=[],items:t,userId:n="",active:i=!0,activationRevision:r=0,loading:s=!1,error:a="",onRetry:l,onEdit:c,onDelete:u,onDownload:d,onOpenSource:f,region:h,toolbarLeading:p,toolbarFilters:g}){var ht,Se;const{t:b,i18n:v}=Ce("workspaceTools"),y=v.resolvedLanguage||v.language,[x,O]=m.useState("all"),[w,k]=m.useState(""),[S,E]=m.useState(null),[C,N]=m.useState(""),[_,j]=m.useState(""),[A,F]=m.useState(""),[T,P]=m.useState(""),[R,L]=m.useState({}),[M,U]=m.useState(()=>new Set),[I,H]=m.useState(null),[Z,Q]=m.useState(!1),[q,B]=m.useState(""),[te,ce]=m.useState(null),[se,re]=m.useState(!1),[ge,G]=m.useState(bM),K=m.useRef(null),ae=m.useRef(null),ue=m.useRef(0),xe=m.useRef(null),Ee=m.useRef(null),Je=m.useRef(!1),De=m.useCallback(()=>{ue.current+=1,E(null),N(""),j("")},[]),Pe=m.useMemo(()=>t?[...t]:zot(e,b("library.untitledSession"),y),[t,y,e,b]),Ne=m.useMemo(()=>Pe.filter(ve=>!M.has(ve.id)).map(ve=>R[ve.id]??ve),[Pe,R,M]);m.useEffect(()=>()=>{ue.current+=1},[]),m.useEffect(()=>()=>{C&&URL.revokeObjectURL(C)},[C]),m.useEffect(()=>{var ke;if(!S)return;const ve=document.activeElement,$e=document.body.style.overflow;document.body.style.overflow="hidden",(ke=K.current)==null||ke.focus();const qe=Tt=>{if(Tt.key==="Escape"){Tt.preventDefault(),De();return}if(Tt.key!=="Tab")return;const Jt=ae.current;if(!Jt)return;const on=Array.from(Jt.querySelectorAll('button:not([disabled]), video[controls], iframe, [tabindex]:not([tabindex="-1"])')).filter(rt=>rt.getClientRects().length>0);if(on.length===0){Tt.preventDefault();return}const Et=on[0],Bt=on[on.length-1];Tt.shiftKey&&document.activeElement===Et?(Tt.preventDefault(),Bt.focus()):!Tt.shiftKey&&document.activeElement===Bt&&(Tt.preventDefault(),Et.focus())};return document.addEventListener("keydown",qe),()=>{document.removeEventListener("keydown",qe),document.body.style.overflow=$e,ve!=null&&ve.isConnected&&ve.focus()}},[De,S]);const Ke=async ve=>{const $e=ue.current+1;if(ue.current=$e,F(""),N(""),E(ve),ve.preview.mode!=="unavailable"){if(ve.contentUrl){N(ve.contentUrl);return}j(`preview:${ve.id}`);try{const qe=await KF(ve.appName,n,ve.sessionId,ve.preview.filename,ve.preview.version);if(ue.current!==$e){URL.revokeObjectURL(qe);return}N(qe)}catch(qe){ue.current===$e&&F(b("artifactLibrary.previewFailed",{name:ve.name,message:OT(qe)}))}finally{ue.current===$e&&j("")}}},wt=async ve=>{F(""),j(`download:${ve.id}`);try{d?await d(ve):await GF(ve.appName,n,ve.sessionId,ve.name,ve.version),P(b("artifactLibrary.downloadStarted",{name:ve.name}))}catch($e){F(b("artifactLibrary.downloadFailed",{name:ve.name,message:OT($e)}))}finally{j("")}},ot=async ve=>{if(!(!I||!c)){Q(!0),B("");try{const qe=await c(I,ve)??{...I,...ve,updatedAt:Date.now()};L(ke=>({...ke,[I.id]:qe})),P(b("artifactLibrary.updated",{name:qe.name})),H(null)}catch($e){B(OT($e))}finally{Q(!1)}}},Ie=async()=>{if(!(!te||!u)){re(!0),F("");try{await u(te),U(ve=>new Set([...ve,te.id])),P(b("artifactLibrary.deleted",{name:te.name})),(S==null?void 0:S.id)===te.id&&De(),ce(null)}catch(ve){F(b("artifactLibrary.deleteFailed",{name:te.name,message:OT(ve)})),ce(null)}finally{re(!1)}}},Be=m.useMemo(()=>{const ve=w.trim().toLocaleLowerCase();return Ne.filter($e=>{var qe;return(qe=$e.origin)!=null&&qe.region&&$e.origin.region!==h||x!=="all"&&$e.type!==x?!1:ve?[$e.name,$e.sessionTitle,$e.agentName].some(ke=>ke.toLocaleLowerCase().includes(ve)):!0})},[x,Ne,w,h]),J=m.useMemo(()=>Be.slice(0,ge),[Be,ge]),pe=ge{Je.current||(Je.current=!0,G(ve=>ve+bM))},[]);m.useEffect(()=>{G(bM)},[r,x,w,Be.length]),m.useEffect(()=>{Je.current=!1},[ge]),m.useEffect(()=>{const ve=Ee.current,$e=xe.current;if(!i||!ve||!$e||!pe)return;const qe=new IntersectionObserver(([ke])=>{ke.isIntersecting&&oe()},{root:$e,rootMargin:"240px 0px",threshold:.01});return qe.observe(ve),()=>qe.disconnect()},[i,pe,oe,ge]);const Me=()=>{const ve=xe.current;!i||!ve||!pe||ve.scrollHeight-ve.scrollTop-ve.clientHeight<=240&&oe()},Ve=!!w.trim()||x!=="all"||Ne.some(ve=>{var $e;return(($e=ve.origin)==null?void 0:$e.region)&&ve.origin.region!==h});return o.jsxs("div",{className:"artifact-library-page resource-collection",children:[o.jsxs(Zb,{className:"artifact-library-toolbar library-resource-toolbar",children:[p,o.jsxs("div",{className:"resource-toolbar__actions",children:[o.jsx(lN,{id:"artifact-type-filter",ariaLabel:b("artifactLibrary.typeFilter"),value:x,options:Vot(b),onChange:O}),g,o.jsx(wm,{"aria-label":b("artifactLibrary.searchAria"),value:w,onChange:ve=>k(ve.target.value),placeholder:b("artifactLibrary.searchPlaceholder")})]})]}),a&&Ne.length>0?o.jsxs("div",{className:"artifact-library-banner",role:"alert",children:[o.jsx("span",{children:a}),l?o.jsx("button",{type:"button",onClick:l,children:b("artifactLibrary.retry")}):null]}):null,A?o.jsxs("div",{className:"artifact-library-banner",role:"alert",children:[o.jsx("span",{children:A}),o.jsx("button",{type:"button",onClick:()=>F(""),children:b("artifactLibrary.close")})]}):null,o.jsx(Jb,{ref:xe,className:"artifact-library-results","aria-label":b("artifactLibrary.listAria"),onScroll:Me,children:o.jsxs("div",{className:"artifact-library-panel",children:[s&&Ne.length===0?o.jsx(Ud,{}):a&&Ne.length===0?o.jsxs("div",{className:"artifact-library-empty is-error",role:"alert",children:[o.jsx("p",{children:b("artifactLibrary.loadFailed")}),o.jsx("span",{children:a}),l?o.jsx("button",{type:"button",onClick:l,children:b("artifactLibrary.reload")}):null]}):Be.length===0?o.jsxs("div",{className:"artifact-library-empty",children:[o.jsx("p",{children:b(Ve?"artifactLibrary.noMatch":"artifactLibrary.noArtifacts")}),o.jsx("span",{children:b(Ve?"artifactLibrary.searchHint":"artifactLibrary.emptyHint")})]}):o.jsx("div",{className:"artifact-library-list",children:o.jsxs("table",{className:"artifact-library-table",children:[o.jsxs("colgroup",{children:[o.jsx("col",{className:"artifact-library-table__file-column"}),o.jsx("col",{className:"artifact-library-table__source-column"}),o.jsx("col",{className:"artifact-library-table__time-column"}),o.jsx("col",{className:"artifact-library-table__actions-column"})]}),o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"col",children:b("artifactLibrary.columns.name")}),o.jsx("th",{scope:"col",children:b("artifactLibrary.columns.source")}),o.jsx("th",{scope:"col",children:b("artifactLibrary.columns.updatedAt")}),o.jsx("th",{scope:"col",className:"artifact-library-table__actions-heading",children:b("artifactLibrary.columns.actions")})]})}),o.jsx("tbody",{children:J.map(ve=>o.jsx(qot,{artifact:ve,pendingAction:_,disabled:!n&&!t,onPreview:$e=>void Ke($e),onDownload:$e=>void wt($e),onEdit:c?$e=>{B(""),H($e)}:void 0,onDelete:u?ce:void 0,onOpenSource:f,t:b,locale:y},ve.id))})]})}),pe?o.jsx("div",{ref:Ee,className:"artifact-library-load-more",role:"status","aria-live":"polite",children:o.jsx(An,{as:"span",duration:2.4,children:b("artifactLibrary.loadingMore")})}):null]})}),o.jsx("p",{className:"artifact-library-status","aria-live":"polite",children:T}),S?o.jsxs("div",{className:"artifact-library-preview-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"artifact-library-preview-title",children:[o.jsx("button",{type:"button",className:"artifact-library-preview-backdrop","aria-label":b("artifactLibrary.preview.close"),onClick:De}),o.jsxs("div",{ref:ae,className:"artifact-library-preview-panel",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("h2",{id:"artifact-library-preview-title",children:S.name}),o.jsx("p",{children:b("artifactLibrary.preview.meta",{type:Hot(b,S.type),version:S.version})})]}),o.jsx("button",{ref:K,type:"button","aria-label":b("artifactLibrary.preview.close"),onClick:De,children:o.jsx(AOe,{})})]}),o.jsxs("div",{className:"artifact-library-preview-content",children:[o.jsx("div",{className:"artifact-library-preview-canvas",children:_===`preview:${S.id}`?o.jsx(An,{as:"span",duration:2.4,children:b("artifactLibrary.preview.loading")}):C&&S.preview.mode==="image"?o.jsx("img",{src:C,alt:b("artifactLibrary.preview.alt",{name:S.name})}):C&&S.preview.mode==="video"?o.jsx("video",{src:C,controls:!0,"aria-label":b("artifactLibrary.preview.alt",{name:S.name})}):C&&S.preview.mode==="frame"?o.jsx("iframe",{src:C,title:b("artifactLibrary.preview.alt",{name:S.name})}):o.jsxs("div",{className:"artifact-library-preview-unavailable",children:[o.jsx(HOe,{artifact:S,large:!0}),o.jsx("p",{children:b(A?"artifactLibrary.preview.loadFailed":"artifactLibrary.preview.unsupported")})]})}),o.jsxs("aside",{className:"artifact-library-preview-details","aria-label":b("artifactLibrary.preview.sourceAria"),children:[S.description?o.jsx("p",{className:"artifact-library-preview-description",children:S.description}):null,o.jsxs("dl",{children:[o.jsxs("div",{children:[o.jsx("dt",{children:b("artifactLibrary.preview.agent")}),o.jsx("dd",{title:S.agentName,children:S.agentName})]}),o.jsxs("div",{children:[o.jsx("dt",{children:b("artifactLibrary.preview.session")}),o.jsx("dd",{title:S.sessionTitle,children:S.sessionTitle})]}),(ht=S.origin)!=null&&ht.toolName?o.jsxs("div",{children:[o.jsx("dt",{children:b("artifactLibrary.preview.tool")}),o.jsx("dd",{children:S.origin.toolName})]}):null,o.jsxs("div",{children:[o.jsx("dt",{children:b("artifactLibrary.preview.createdAt")}),o.jsx("dd",{children:zOe(S.createdAt,y,b("artifactLibrary.unknownTime"))})]}),S.sizeBytes?o.jsxs("div",{children:[o.jsx("dt",{children:b("artifactLibrary.preview.fileSize")}),o.jsx("dd",{children:VOe(S.sizeBytes)})]}):null]}),(Se=S.tags)!=null&&Se.length?o.jsx("div",{className:"artifact-library-preview-tags","aria-label":b("artifactLibrary.preview.tags"),children:S.tags.map(ve=>o.jsx("span",{children:ve},ve))}):null]})]}),o.jsxs("footer",{children:[o.jsxs("div",{className:"artifact-library-preview-footer-start",children:[f?o.jsxs("button",{type:"button",className:"is-secondary",onClick:()=>{const ve=S;De(),f(ve)},children:[o.jsx(gat,{}),b("artifactLibrary.preview.viewSession")]}):null,c?o.jsxs("button",{type:"button",className:"is-secondary",disabled:S.canManage===!1,onClick:()=>{const ve=S;De(),B(""),H(ve)},children:[o.jsx(bat,{}),b("artifactLibrary.edit")]}):null]}),o.jsxs("button",{type:"button",disabled:_.startsWith("download:")||!n&&!t,onClick:()=>void wt(S),children:[o.jsx(mat,{}),b("artifactLibrary.download")]})]})]})]}):null,I?o.jsx(xat,{artifact:I,busy:Z,error:q,onClose:()=>{Z||H(null)},onSave:ve=>void ot(ve)}):null,te?o.jsx(pc,{title:b("artifactLibrary.deleteDialog.title"),description:b("artifactLibrary.deleteDialog.description",{name:te.name}),confirmLabel:b(se?"artifactLibrary.deleteDialog.deleting":"artifactLibrary.deleteDialog.confirm"),closeLabel:b("artifactLibrary.deleteDialog.close"),variant:"danger",busy:se,onCancel:()=>{se||ce(null)},onConfirm:()=>void Ie()}):null]})}ln.hasResourceBundle("en-US","workspaceTools")||ln.addResourceBundle("en-US","workspaceTools",ile,!0,!0);ln.hasResourceBundle("zh-CN","workspaceTools")||ln.addResourceBundle("zh-CN","workspaceTools",xfe,!0,!0);function Um(e,t={}){return ln.t(e,{...t,ns:"workspaceTools"})}function Got(e,t){if(e&&typeof e=="object"&&"detail"in e){const n=e.detail;if(typeof n=="string"&&n.trim())return n}return t}async function fE(e,t){if(e.ok)return e;let n;try{n=await e.json()}catch{n=void 0}throw new Error(Got(n,Um("artifactLibrary.api.withStatus",{message:t,status:e.status})))}function yM(e){if(typeof e=="number")return e;if(typeof e!="string")return 0;const t=Date.parse(e);return Number.isFinite(t)?t:0}function qOe(e){const t=e;return{...t,createdAt:yM(t.createdAt),updatedAt:yM(t.updatedAt),sessionUpdatedAt:yM(t.sessionUpdatedAt)}}async function WOe(e){const t=await e.json();return Array.isArray(t.items)?t.items.map(qOe):[]}async function Kot(){const e=await fE(await Tn("/web/artifacts"),Um("artifactLibrary.api.listFailed"));return WOe(e)}async function Xot(e){if(e.length===0)return Kot();const t=await fE(await Tn("/web/artifacts/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({candidates:e})},24e4),Um("artifactLibrary.api.syncFailed"));return WOe(t)}async function Yot(e,t){const n=await fE(await Tn(`/web/artifacts/${encodeURIComponent(e.id)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),Um("artifactLibrary.api.updateFailed"));return qOe(await n.json())}async function Zot(e){await fE(await Tn(`/web/artifacts/${encodeURIComponent(e.id)}`,{method:"DELETE"}),Um("artifactLibrary.api.deleteFailed"))}async function Jot(e){const n=await(await fE(await Tn(`/web/artifacts/${encodeURIComponent(e.id)}/content?download=true`,{},24e4),Um("artifactLibrary.api.downloadFailed"))).blob(),i=URL.createObjectURL(n),r=document.createElement("a");r.href=i,r.download=e.name,document.body.appendChild(r),r.click(),r.remove(),window.setTimeout(()=>URL.revokeObjectURL(i),0)}const GOe="KNOWLEDGE_PROVIDER_ASSOCIATION_INVALID";class HR extends Error{constructor(n,i,r={}){super(n);ki(this,"status");ki(this,"errorCode");ki(this,"requestId");ki(this,"diagnostics");ki(this,"detail");ki(this,"payload");ki(this,"rawBody");this.name="KnowledgeRequestError",this.status=i;const s=typeof r=="string"?{errorCode:r}:r;this.errorCode=s.errorCode||"",this.requestId=s.requestId||"",this.diagnostics=s.diagnostics,this.detail=s.detail,this.payload=s.payload,this.rawBody=s.rawBody||""}}class KOe extends Error{constructor(n){super(n.map(({region:i,error:r})=>`${i}: ${r.message||V("knowledge.loadFailed")}`).join(` `));ki(this,"failures");this.name="KnowledgeRegionAggregateError",this.failures=n}}const elt=new Set(["ak","apikey","sk","accesskey","accesskeyid","authorization","authkey","clientsecret","cookie","credential","credentials","password","passwd","privatekey","secret","secretaccesskey","secretkey","securitytoken","sessiontoken","setcookie","token"]),tlt=6,GK=50,XOe=4e3;function nlt(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}function ilt(e){const t=nlt(e);return elt.has(t)||t.endsWith("password")||t.endsWith("secret")||t.endsWith("token")||t.endsWith("credential")}function rlt(e){return/<\s*(?:!doctype|html|head|body|script|style)\b/i.test(e)}function Lw(e){if(rlt(e))return V("knowledge.htmlHidden");const t=V("knowledge.redacted");return e.replace(/\bBearer\s+[^\s,;]+/gi,`Bearer ${t}`).replace(/\b(?:set-)?cookie\s*:\s*[^\r\n]*/gi,`cookie: ${t}`).replace(/\bAKLT[A-Za-z0-9_-]{6,}\b/g,t).replace(/((?:access[_-]?key(?:[_-]?id)?|secret(?:[_-]?(?:access)?[_-]?key)?|session[_-]?token|security[_-]?token|client[_-]?secret|api[_-]?key|authorization|cookie|[a-z0-9_-]*(?:password|secret|token)|credential|ak|sk)\s*[:=]\s*)(?:"[^"]*"|'[^']*'|[^\s,;&]+)/gi,`$1${t}`).replace(/([?&](?:access[_-]?key|api[_-]?key|client[_-]?secret|security[_-]?token|session[_-]?token|secret|token|password|authorization|cookie|credential)=)[^&#\s]+/gi,`$1${t}`)}function T6(e,t=0,n=new WeakSet){if(e===null||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="string")return Lw(e).slice(0,XOe);if(typeof e!="object")return;if(t>=tlt)return V("knowledge.depthTruncated");if(n.has(e))return V("knowledge.circularReference");if(n.add(e),Array.isArray(e))return e.slice(0,GK).map(r=>T6(r,t+1,n));const i={};return Object.entries(e).slice(0,GK).forEach(([r,s])=>{i[r]=ilt(r)?V("knowledge.redacted"):T6(s,t+1,n)}),i}function KK(e){if(e===void 0)return"";const t=T6(e);if(typeof t=="string")return t;if(t===void 0)return"";try{return JSON.stringify(t).slice(0,XOe)}catch{return V("knowledge.diagnosticsUnavailable")}}function ho(e,t){if(e instanceof KOe)return e.failures.map(({region:a,error:l})=>`${a} ${ho(l,t)}`).join(` `);if(!(e instanceof HR))return(e instanceof Error?Lw(e.message):"")||t;const n=Lw(e.message)||t,i=[Number.isFinite(e.status)?V("knowledge.statusCode",{status:e.status}):"",e.errorCode?V("knowledge.errorCode",{code:Lw(e.errorCode)}):"",e.requestId?V("knowledge.requestId",{requestId:Lw(e.requestId)}):""].filter(Boolean).join(" · "),r=KK(e.diagnostics),s=KK(e.detail);return[n,i,r?V("knowledge.diagnostics",{diagnostics:r}):"",s&&s!==n?V("knowledge.detail",{detail:s}):""].filter(Boolean).join(` -`)}function bA(...e){for(const t of e)if(typeof t=="string"&&t.trim())return t.trim();return""}function slt(e){return Array.isArray(e)?e.map(t=>{const n=iu(t),i=bA(n.msg,n.message);if(!i)return"";const r=Array.isArray(n.loc)?n.loc.filter(s=>typeof s=="string"||typeof s=="number").map(String).join("."):"";return r?`${r}: ${i}`:i}).filter(Boolean).join("; "):""}function alt(e,t=!0){const n=iu(e),i=Object.prototype.hasOwnProperty.call(n,"detail")?n.detail:typeof e=="string"?e:void 0,r=iu(i);return{message:typeof i=="string"?t?i.trim():"":bA(r.message,n.message,slt(i)),errorCode:bA(r.errorCode,n.errorCode),requestId:bA(r.requestId,r.request_id,r.RequestId,n.requestId,n.request_id),diagnostics:r.diagnostics??n.diagnostics,detail:i,payload:e}}function iu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function Di(e){return typeof e=="string"?e:""}function $S(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function PB(e){const t=iu(e);return{id:Di(t.id),name:Di(t.name),description:Di(t.description),providerType:Di(t.providerType),providerKnowledgeId:Di(t.providerKnowledgeId),projectName:Di(t.projectName),region:Di(t.region),status:Di(t.status),createdAt:Di(t.createdAt),updatedAt:Di(t.updatedAt),ownerId:Di(t.ownerId),ownerLabel:Di(t.ownerLabel),canManage:t.canManage===!0}}function hE(e){const t=iu(e);return{id:Di(t.id),name:Di(t.name),type:Di(t.type),sizeBytes:$S(t.sizeBytes,0),status:Di(t.status),url:Di(t.url),tosPath:Di(t.tosPath),metadata:iu(t.metadata),createdAt:Di(t.createdAt),updatedAt:Di(t.updatedAt),sourceMarkdown:Di(t.sourceMarkdown)}}function olt(e){const t=iu(e),n=t.attachment,i=iu(n);return{id:Di(t.id),title:Di(t.title),content:Di(t.content),attachmentUrl:Di(t.attachmentUrl)||Di(i.url)||Di(i.previewUrl),attachmentType:Di(t.attachmentType)||Di(i.type)||Di(i.mimeType),attachment:n,tableFields:t.tableFields}}async function Gu(e,t={},n=Wo){var f;const i=Hu(Dh(t.headers));i.set("accept","application/json"),t.body&&!(t.body instanceof FormData)&&i.set("content-type","application/json");const r=await fetch(e,{...t,headers:i,signal:Ol(t.signal,n)});if(r.ok)return r.status===204?void 0:r.json();const s=await r.text();let a=s,l=!1;if(s)try{a=JSON.parse(s),l=!0}catch{}const c=((f=r.headers.get("content-type"))==null?void 0:f.toLowerCase())||"",u=alt(a,l||c.startsWith("text/plain")),d=r.status===401?V("knowledge.signInRequired"):r.status===403?V("knowledge.forbidden"):r.status===404?V("knowledge.notFound"):r.status===409?V("knowledge.conflict"):V("knowledge.requestFailed",{status:r.status});throw new HR(u.message||d,r.status,{errorCode:u.errorCode,requestId:u.requestId,diagnostics:u.diagnostics,detail:u.detail,payload:u.payload,rawBody:s})}function e0(e){const t=new URLSearchParams;e.trim()&&t.set("region",e.trim());const n=t.toString();return n?`?${n}`:""}async function llt(e){var r;const t=new URLSearchParams({region:e.region,pageSize:String(e.pageSize??30)});(r=e.projectName)!=null&&r.trim()&&t.set("projectName",e.projectName.trim()),e.nextToken&&t.set("nextToken",e.nextToken);const n=await Gu(`/web/knowledge-bases?${t.toString()}`,{signal:e.signal}),i=iu(n);return{items:Array.isArray(i.items)?i.items.map(PB):[],nextToken:Di(i.nextToken)}}function clt(e){return`${e.region}\0${e.id}`}async function ult(e){var l;const t=[...new Set(e.regions.map(c=>c.trim()).filter(Boolean))],n=e.nextTokens?t.filter(c=>{var u;return!!((u=e.nextTokens)!=null&&u[c])}):t;if(n.length===0)return{items:[],nextTokens:{},failures:[]};const i=await Promise.allSettled(n.map(async c=>{var u;return{region:c,page:await llt({region:c,projectName:e.projectName,nextToken:(u=e.nextTokens)==null?void 0:u[c],pageSize:e.pageSize,signal:e.signal})}}));if((l=e.signal)!=null&&l.aborted)throw new DOMException("Aborted","AbortError");const r=[],s={},a=new Map;if(i.forEach((c,u)=>{var f;const d=n[u];if(c.status==="rejected"){const h=(f=e.nextTokens)==null?void 0:f[d];h&&(s[d]=h),r.push({region:d,error:c.reason instanceof Error?c.reason:new Error(V("knowledge.loadFailed"))});return}c.value.page.nextToken&&(s[d]=c.value.page.nextToken),c.value.page.items.forEach(h=>{const p=h.region?h:{...h,region:d};a.set(clt(p),p)})}),r.length===n.length)throw new KOe(r);return{items:[...a.values()],nextTokens:s,failures:r}}function dlt(e){return Gu("/web/knowledge-bases",{method:"POST",body:JSON.stringify(e)},is).then(PB)}function flt(e,t,n){return Gu(`/web/knowledge-bases/${encodeURIComponent(e)}${e0(t)}`,{method:"PATCH",body:JSON.stringify(n)}).then(PB)}function hlt(e,t){return Gu(`/web/knowledge-bases/${encodeURIComponent(e)}${e0(t)}`,{method:"DELETE"},is)}async function plt(e,t){var s;const n=new URLSearchParams({region:t.region,offset:String(t.offset??0),limit:String(t.limit??30)});(s=t.documentType)!=null&&s.trim()&&n.set("documentType",t.documentType.trim());const i=await Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents?${n.toString()}`,{signal:t.signal}),r=iu(i);return{items:Array.isArray(r.items)?r.items.map(hE):[],offset:$S(r.offset,0),limit:$S(r.limit,t.limit??30),hasMore:r.hasMore===!0}}async function mlt(e,t,n){const i=new URLSearchParams({region:n.region,offset:String(n.offset??0),limit:String(n.limit??20)}),r=await Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}/preview?${i.toString()}`,{signal:n.signal}),s=iu(r);return{document:hE(s.document),chunks:Array.isArray(s.chunks)?s.chunks.map(olt):[],sourceMarkdown:Di(s.sourceMarkdown),offset:$S(s.offset,0),limit:$S(s.limit,n.limit??20),hasMore:s.hasMore===!0}}function glt(e,t,n){return Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents${e0(t)}`,{method:"POST",body:JSON.stringify(n)},is).then(hE)}async function blt(e,t,n){const i=await Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/web-preview${e0(t)}`,{method:"POST",body:JSON.stringify({sourceType:"url",url:n.url})},is),r=iu(i);return{name:Di(r.name),url:Di(r.url),sourceMarkdown:Di(r.sourceMarkdown)}}function ylt(e,t,n){var r,s;const i=new FormData;return i.set("file",n.file),(r=n.name)!=null&&r.trim()&&i.set("name",n.name.trim()),(s=n.documentType)!=null&&s.trim()&&i.set("documentType",n.documentType.trim()),n.metadata&&i.set("metadata",JSON.stringify(n.metadata)),Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/upload${e0(t)}`,{method:"POST",body:i},is).then(hE)}function vlt(e,t,n,i){return Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}${e0(n)}`,{method:"PATCH",body:JSON.stringify(i)}).then(hE)}function xlt(e,t,n){return Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}${e0(n)}`,{method:"DELETE"},is)}function pE({className:e="",title:t,status:n,description:i,metadata:r,detailAction:s,action:a,auxiliaryAction:l}){return o.jsxs(jB,{className:`library-resource-card ${e}`.trim(),activateLabel:`${s.label} ${t}`,onActivate:s.disabled?void 0:s.onClick,footer:o.jsx(BOe,{items:r.map(c=>({label:c.label,value:c.value,title:c.title,hideLabel:!0}))}),actions:o.jsxs(o.Fragment,{children:[l?o.jsx(C6,{className:"library-resource-card__auxiliary-action",label:`${l.label} ${t}`,tone:"secondary",disabled:l.disabled,title:l.title??l.label,onClick:l.onClick,children:l.icon}):null,a?o.jsx(C6,{label:`${a.label} ${t}`,icon:a.icon,disabled:a.disabled,title:a.title,onClick:a.onClick}):null]}),children:[o.jsx(RB,{leading:o.jsx(Xv,{seed:t}),title:t,titleText:t,status:n}),o.jsx(IB,{title:i,children:i})]})}function aHt(){}function XK(e){const t=[],n=String(e||"");let i=n.indexOf(","),r=0,s=!1;for(;!s;){i===-1&&(i=n.length,s=!0);const a=n.slice(r,i).trim();(a||!s)&&t.push(a),r=i+1,i=n.indexOf(",",r)}return t}function YOe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const wlt=/[$_\p{ID_Start}]/u,Olt=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,Slt=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,klt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Elt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ZOe={};function oHt(e){return e?wlt.test(String.fromCodePoint(e)):!1}function lHt(e,t){const i=(t||ZOe).jsx?Slt:Olt;return e?i.test(String.fromCodePoint(e)):!1}function YK(e,t){return(ZOe.jsx?Elt:klt).test(e)}const Clt=/[ \t\n\f\r]/g;function Tlt(e){return typeof e=="object"?e.type==="text"?ZK(e.value):!1:ZK(e)}function ZK(e){return e.replace(Clt,"")===""}let mE=class{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}};mE.prototype.normal={};mE.prototype.property={};mE.prototype.space=void 0;function JOe(e,t){const n={},i={};for(const r of e)Object.assign(n,r.property),Object.assign(i,r.normal);return new mE(n,i,t)}function FS(e){return e.toLowerCase()}class El{constructor(t,n){this.attribute=n,this.property=t}}El.prototype.attribute="";El.prototype.booleanish=!1;El.prototype.boolean=!1;El.prototype.commaOrSpaceSeparated=!1;El.prototype.commaSeparated=!1;El.prototype.defined=!1;El.prototype.mustUseProperty=!1;El.prototype.number=!1;El.prototype.overloadedBoolean=!1;El.prototype.property="";El.prototype.spaceSeparated=!1;El.prototype.space=void 0;let Alt=0;const ni=t0(),Gs=t0(),A6=t0(),At=t0(),Rr=t0(),sv=t0(),Ql=t0();function t0(){return 2**++Alt}const _6=Object.freeze(Object.defineProperty({__proto__:null,boolean:ni,booleanish:Gs,commaOrSpaceSeparated:Ql,commaSeparated:sv,number:At,overloadedBoolean:A6,spaceSeparated:Rr},Symbol.toStringTag,{value:"Module"})),vM=Object.keys(_6);class DB extends El{constructor(t,n,i,r){let s=-1;if(super(t,n),JK(this,"space",r),typeof i=="number")for(;++s4&&n.slice(0,4)==="data"&&Ilt.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(eX,Dlt);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!eX.test(s)){let a=s.replace(Rlt,Plt);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}r=DB}return new r(i,t)}function Plt(e){return"-"+e.toLowerCase()}function Dlt(e){return e.charAt(1).toUpperCase()}const gE=JOe([eSe,_lt,iSe,rSe,sSe],"html"),Qm=JOe([eSe,Nlt,iSe,rSe,sSe],"svg");function tX(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function aSe(e){return e.join(" ").trim()}var MB={},nX=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Mlt=/\n/g,Llt=/^\s*/,$lt=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Flt=/^:\s*/,Blt=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Ult=/^[;\s]*/,Qlt=/^\s+|\s+$/g,zlt=` -`,iX="/",rX="*",Tg="",Vlt="comment",Hlt="declaration";function qlt(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,i=1;function r(g){var b=g.match(Mlt);b&&(n+=b.length);var v=g.lastIndexOf(zlt);i=~v?g.length-v:i+g.length}function s(){var g={line:n,column:i};return function(b){return b.position=new a(g),u(),b}}function a(g){this.start=g,this.end={line:n,column:i},this.source=t.source}a.prototype.content=e;function l(g){var b=new Error(t.source+":"+n+":"+i+": "+g);if(b.reason=g,b.filename=t.source,b.line=n,b.column=i,b.source=e,!t.silent)throw b}function c(g){var b=g.exec(e);if(b){var v=b[0];return r(v),e=e.slice(v.length),b}}function u(){c(Llt)}function d(g){var b;for(g=g||[];b=f();)b!==!1&&g.push(b);return g}function f(){var g=s();if(!(iX!=e.charAt(0)||rX!=e.charAt(1))){for(var b=2;Tg!=e.charAt(b)&&(rX!=e.charAt(b)||iX!=e.charAt(b+1));)++b;if(b+=2,Tg===e.charAt(b-1))return l("End of comment missing");var v=e.slice(2,b-2);return i+=2,r(v),e=e.slice(b),i+=2,g({type:Vlt,comment:v})}}function h(){var g=s(),b=c($lt);if(b){if(f(),!c(Flt))return l("property missing ':'");var v=c(Blt),y=g({type:Hlt,property:sX(b[0].replace(nX,Tg)),value:v?sX(v[0].replace(nX,Tg)):Tg});return c(Ult),y}}function p(){var g=[];d(g);for(var b;b=h();)b!==!1&&(g.push(b),d(g));return g}return u(),p()}function sX(e){return e?e.replace(Qlt,Tg):Tg}var Wlt=qlt,Glt=Ip&&Ip.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(MB,"__esModule",{value:!0});MB.default=Xlt;const Klt=Glt(Wlt);function Xlt(e,t){let n=null;if(!e||typeof e!="string")return n;const i=(0,Klt.default)(e),r=typeof t=="function";return i.forEach(s=>{if(s.type!=="declaration")return;const{property:a,value:l}=s;r?t(a,l,s):l&&(n=n||{},n[a]=l)}),n}var WR={};Object.defineProperty(WR,"__esModule",{value:!0});WR.camelCase=void 0;var Ylt=/^--[a-zA-Z0-9_-]+$/,Zlt=/-([a-z])/g,Jlt=/^[^-]+$/,ect=/^-(webkit|moz|ms|o|khtml)-/,tct=/^-(ms)-/,nct=function(e){return!e||Jlt.test(e)||Ylt.test(e)},ict=function(e,t){return t.toUpperCase()},aX=function(e,t){return"".concat(t,"-")},rct=function(e,t){return t===void 0&&(t={}),nct(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(tct,aX):e=e.replace(ect,aX),e.replace(Zlt,ict))};WR.camelCase=rct;var sct=Ip&&Ip.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},act=sct(MB),oct=WR;function N6(e,t){var n={};return!e||typeof e!="string"||(0,act.default)(e,function(i,r){i&&r&&(n[(0,oct.camelCase)(i,t)]=r)}),n}N6.default=N6;var lct=N6;const cct=px(lct),GR=oSe("end"),Yd=oSe("start");function oSe(e){return t;function t(n){const i=n&&n.position&&n.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function uct(e){const t=Yd(e),n=GR(e);if(t&&n)return{start:t,end:n}}function CO(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?oX(e.position):"start"in e||"end"in e?oX(e):"line"in e||"column"in e?j6(e):""}function j6(e){return lX(e&&e.line)+":"+lX(e&&e.column)}function oX(e){return j6(e&&e.start)+"-"+j6(e&&e.end)}function lX(e){return e&&typeof e=="number"?e:1}class wo extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let r="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?r=t:!s.cause&&t&&(a=!0,r=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof i=="string"){const c=i.indexOf(":");c===-1?s.ruleId=i:(s.source=i.slice(0,c),s.ruleId=i.slice(c+1))}if(!s.place&&s.ancestors&&s.ancestors){const c=s.ancestors[s.ancestors.length-1];c&&(s.place=c.position)}const l=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=CO(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}wo.prototype.file="";wo.prototype.name="";wo.prototype.reason="";wo.prototype.message="";wo.prototype.stack="";wo.prototype.column=void 0;wo.prototype.line=void 0;wo.prototype.ancestors=void 0;wo.prototype.cause=void 0;wo.prototype.fatal=void 0;wo.prototype.place=void 0;wo.prototype.ruleId=void 0;wo.prototype.source=void 0;const LB={}.hasOwnProperty,dct=new Map,fct=/[A-Z]/g,hct=new Set(["table","tbody","thead","tfoot","tr"]),pct=new Set(["td","th"]),lSe="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function mct(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=Sct(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");i=Oct(n,t.jsx,t.jsxs)}const r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,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"?Qm:gE,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=cSe(r,e,void 0);return s&&typeof s!="string"?s:r.create(e,r.Fragment,{children:s||void 0},void 0)}function cSe(e,t,n){if(t.type==="element")return gct(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return bct(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return vct(e,t,n);if(t.type==="mdxjsEsm")return yct(e,t);if(t.type==="root")return xct(e,t,n);if(t.type==="text")return wct(e,t)}function gct(e,t,n){const i=e.schema;let r=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=Qm,e.schema=r),e.ancestors.push(t);const s=dSe(e,t.tagName,!1),a=kct(e,t);let l=FB(e,t);return hct.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!Tlt(c):!0})),uSe(e,a,s,t),$B(a,l),e.ancestors.pop(),e.schema=i,e.create(t,s,a,n)}function bct(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}BS(e,t.position)}function yct(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);BS(e,t.position)}function vct(e,t,n){const i=e.schema;let r=i;t.name==="svg"&&i.space==="html"&&(r=Qm,e.schema=r),e.ancestors.push(t);const s=t.name===null?e.Fragment:dSe(e,t.name,!0),a=Ect(e,t),l=FB(e,t);return uSe(e,a,s,t),$B(a,l),e.ancestors.pop(),e.schema=i,e.create(t,s,a,n)}function xct(e,t,n){const i={};return $B(i,FB(e,t)),e.create(t,e.Fragment,i,n)}function wct(e,t){return t.value}function uSe(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function $B(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Oct(e,t,n){return i;function i(r,s,a,l){const u=Array.isArray(a.children)?n:t;return l?u(s,a,l):u(s,a)}}function Sct(e,t){return n;function n(i,r,s,a){const l=Array.isArray(s.children),c=Yd(i);return t(r,s,a,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function kct(e,t){const n={};let i,r;for(r in t.properties)if(r!=="children"&&LB.call(t.properties,r)){const s=Cct(e,r,t.properties[r]);if(s){const[a,l]=s;e.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&pct.has(t.tagName)?i=l:n[a]=l}}if(i){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function Ect(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const s=i.data.estree.body[0];s.type;const a=s.expression;a.type;const l=a.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else BS(e,t.position);else{const r=i.name;let s;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const l=i.value.data.estree.body[0];l.type,s=e.evaluater.evaluateExpression(l.expression)}else BS(e,t.position);else s=i.value===null?!0:i.value;n[r]=s}return n}function FB(e,t){const n=[];let i=-1;const r=e.passKeys?new Map:dct;for(;++ir?0:r+t:t=t>r?r:t,n=n>0?n:0,i.length<1e4)a=Array.from(i),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s0?(lc(e,e.length,0,t),e):t}const dX={}.hasOwnProperty;function hSe(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 Du(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Do=zm(/[A-Za-z]/),go=zm(/[\dA-Za-z]/),Dct=zm(/[#-'*+\--9=?A-Z^-~]/);function uN(e){return e!==null&&(e<32||e===127)}const R6=zm(/\d/),Mct=zm(/[\dA-Fa-f]/),Lct=zm(/[!-/:-@[-`{-~]/);function Cn(e){return e!==null&&e<-2}function Ar(e){return e!==null&&(e<0||e===32)}function wi(e){return e===-2||e===-1||e===32}const KR=zm(new RegExp("\\p{P}|\\p{S}","u")),Tb=zm(/\s/);function zm(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function qx(e){const t=[];let n=-1,i=0,r=0;for(;++n55295&&s<57344){const l=e.charCodeAt(n+1);s<56320&&l>56319&&l<57344?(a=String.fromCharCode(s,l),r=1):a="�"}else a=String.fromCharCode(s);a&&(t.push(e.slice(i,n),encodeURIComponent(a)),i=n+r+1,a=""),r&&(n+=r,r=0)}return t.join("")+e.slice(i)}function Ui(e,t,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(c){return wi(c)?(e.enter(n),l(c)):t(c)}function l(c){return wi(c)&&s++a))return;const E=t.events.length;let C=E,N,_;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){if(N){_=t.events[C][1].end;break}N=!0}for(y(i),S=E;SO;){const k=n[w];t.containerState=k[1],k[0].exit.call(t,e)}n.length=O}function x(){r.write([null]),s=void 0,r=void 0,t.containerState._closeFlow=void 0}}function Qct(e,t,n){return Ui(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Yv(e){if(e===null||Ar(e)||Tb(e))return 1;if(KR(e))return 2}function XR(e,t,n){const i=[];let r=-1;for(;++r1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[i][1].end},h={...e[n][1].start};hX(f,-c),hX(h,c),a={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[i][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:c>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},r={type:c>1?"strong":"emphasis",start:{...a.start},end:{...l.end}},e[i][1].end={...a.start},e[n][1].start={...l.end},u=[],e[i][1].end.offset-e[i][1].start.offset&&(u=Lc(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=Lc(u,[["enter",r,t],["enter",a,t],["exit",a,t],["enter",s,t]]),u=Lc(u,XR(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=Lc(u,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",r,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Lc(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,lc(e,i-1,n-i+3,u),n=i+u.length-d-2;break}}for(n=-1;++n0&&wi(S)?Ui(e,x,"linePrefix",s+1)(S):x(S)}function x(S){return S===null||Cn(S)?e.check(pX,b,w)(S):(e.enter("codeFlowValue"),O(S))}function O(S){return S===null||Cn(S)?(e.exit("codeFlowValue"),x(S)):(e.consume(S),O)}function w(S){return e.exit("codeFenced"),t(S)}function k(S,E,C){let N=0;return _;function _(P){return S.enter("lineEnding"),S.consume(P),S.exit("lineEnding"),j}function j(P){return S.enter("codeFencedFence"),wi(P)?Ui(S,A,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):A(P)}function A(P){return P===l?(S.enter("codeFencedFenceSequence"),F(P)):C(P)}function F(P){return P===l?(N++,S.consume(P),F):N>=a?(S.exit("codeFencedFenceSequence"),wi(P)?Ui(S,T,"whitespace")(P):T(P)):C(P)}function T(P){return P===null||Cn(P)?(S.exit("codeFencedFence"),E(P)):C(P)}}}function eut(e,t,n){const i=this;return r;function r(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s)}function s(a){return i.parser.lazy[i.now().line]?n(a):t(a)}}const wM={name:"codeIndented",tokenize:nut},tut={partial:!0,tokenize:iut};function nut(e,t,n){const i=this;return r;function r(u){return e.enter("codeIndented"),Ui(e,s,"linePrefix",5)(u)}function s(u){const d=i.events[i.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):Cn(u)?e.attempt(tut,a,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Cn(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function iut(e,t,n){const i=this;return r;function r(a){return i.parser.lazy[i.now().line]?n(a):Cn(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),r):Ui(e,s,"linePrefix",5)(a)}function s(a){const l=i.events[i.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):Cn(a)?r(a):n(a)}}const rut={name:"codeText",previous:aut,resolve:sut,tokenize:out};function sut(e){let t=e.length-4,n=3,i,r;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i=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-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const r=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&V1(this.left,i),s.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),V1(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),V1(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(i.parser.constructs.flow,n,t)(a)}}function vSe(e,t,n,i,r,s,a,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(y){return y===60?(e.enter(i),e.enter(r),e.enter(s),e.consume(y),e.exit(s),h):y===null||y===32||y===41||uN(y)?n(y):(e.enter(i),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),b(y))}function h(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(r),e.exit(i),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||Cn(y)?n(y):(e.consume(y),y===92?g:p)}function g(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function b(y){return!d&&(y===null||y===41||Ar(y))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(i),t(y)):d999||p===null||p===91||p===93&&!c||p===94&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(p):p===93?(e.exit(s),e.enter(r),e.consume(p),e.exit(r),e.exit(i),t):Cn(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||Cn(p)||l++>999?(e.exit("chunkString"),d(p)):(e.consume(p),c||(c=!wi(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),l++,f):f(p)}}function wSe(e,t,n,i,r,s){let a;return l;function l(h){return h===34||h===39||h===40?(e.enter(i),e.enter(r),e.consume(h),e.exit(r),a=h===40?41:h,c):n(h)}function c(h){return h===a?(e.enter(r),e.consume(h),e.exit(r),e.exit(i),t):(e.enter(s),u(h))}function u(h){return h===a?(e.exit(s),c(a)):h===null?n(h):Cn(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Ui(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||Cn(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 TO(e,t){let n;return i;function i(r){return Cn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,i):wi(r)?Ui(e,i,n?"linePrefix":"lineSuffix")(r):t(r)}}const mut={name:"definition",tokenize:but},gut={partial:!0,tokenize:yut};function but(e,t,n){const i=this;let r;return s;function s(p){return e.enter("definition"),a(p)}function a(p){return xSe.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return r=Du(i.sliceSerialize(i.events[i.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 Ar(p)?TO(e,u)(p):u(p)}function u(p){return vSe(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(gut,f,f)(p)}function f(p){return wi(p)?Ui(e,h,"whitespace")(p):h(p)}function h(p){return p===null||Cn(p)?(e.exit("definition"),i.parser.defined.push(r),t(p)):n(p)}}function yut(e,t,n){return i;function i(l){return Ar(l)?TO(e,r)(l):n(l)}function r(l){return wSe(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return wi(l)?Ui(e,a,"whitespace")(l):a(l)}function a(l){return l===null||Cn(l)?t(l):n(l)}}const vut={name:"hardBreakEscape",tokenize:xut};function xut(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),r}function r(s){return Cn(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const wut={name:"headingAtx",resolve:Out,tokenize:Sut};function Out(e,t){let n=e.length-2,i=3,r,s;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(r={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},lc(e,i,n-i+1,[["enter",r,t],["enter",s,t],["exit",s,t],["exit",r,t]])),e}function Sut(e,t,n){let i=0;return r;function r(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&i++<6?(e.consume(d),a):d===null||Ar(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||Cn(d)?(e.exit("atxHeading"),t(d)):wi(d)?Ui(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||Ar(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const kut=["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"],gX=["pre","script","style","textarea"],Eut={concrete:!0,name:"htmlFlow",resolveTo:Aut,tokenize:_ut},Cut={partial:!0,tokenize:jut},Tut={partial:!0,tokenize:Nut};function Aut(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 _ut(e,t,n){const i=this;let r,s,a,l,c;return u;function u(Q){return d(Q)}function d(Q){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(Q),f}function f(Q){return Q===33?(e.consume(Q),h):Q===47?(e.consume(Q),s=!0,b):Q===63?(e.consume(Q),r=3,i.interrupt?t:I):Do(Q)?(e.consume(Q),a=String.fromCharCode(Q),v):n(Q)}function h(Q){return Q===45?(e.consume(Q),r=2,p):Q===91?(e.consume(Q),r=5,l=0,g):Do(Q)?(e.consume(Q),r=4,i.interrupt?t:I):n(Q)}function p(Q){return Q===45?(e.consume(Q),i.interrupt?t:I):n(Q)}function g(Q){const q="CDATA[";return Q===q.charCodeAt(l++)?(e.consume(Q),l===q.length?i.interrupt?t:A:g):n(Q)}function b(Q){return Do(Q)?(e.consume(Q),a=String.fromCharCode(Q),v):n(Q)}function v(Q){if(Q===null||Q===47||Q===62||Ar(Q)){const q=Q===47,B=a.toLowerCase();return!q&&!s&&gX.includes(B)?(r=1,i.interrupt?t(Q):A(Q)):kut.includes(a.toLowerCase())?(r=6,q?(e.consume(Q),y):i.interrupt?t(Q):A(Q)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(Q):s?x(Q):O(Q))}return Q===45||go(Q)?(e.consume(Q),a+=String.fromCharCode(Q),v):n(Q)}function y(Q){return Q===62?(e.consume(Q),i.interrupt?t:A):n(Q)}function x(Q){return wi(Q)?(e.consume(Q),x):_(Q)}function O(Q){return Q===47?(e.consume(Q),_):Q===58||Q===95||Do(Q)?(e.consume(Q),w):wi(Q)?(e.consume(Q),O):_(Q)}function w(Q){return Q===45||Q===46||Q===58||Q===95||go(Q)?(e.consume(Q),w):k(Q)}function k(Q){return Q===61?(e.consume(Q),S):wi(Q)?(e.consume(Q),k):O(Q)}function S(Q){return Q===null||Q===60||Q===61||Q===62||Q===96?n(Q):Q===34||Q===39?(e.consume(Q),c=Q,E):wi(Q)?(e.consume(Q),S):C(Q)}function E(Q){return Q===c?(e.consume(Q),c=null,N):Q===null||Cn(Q)?n(Q):(e.consume(Q),E)}function C(Q){return Q===null||Q===34||Q===39||Q===47||Q===60||Q===61||Q===62||Q===96||Ar(Q)?k(Q):(e.consume(Q),C)}function N(Q){return Q===47||Q===62||wi(Q)?O(Q):n(Q)}function _(Q){return Q===62?(e.consume(Q),j):n(Q)}function j(Q){return Q===null||Cn(Q)?A(Q):wi(Q)?(e.consume(Q),j):n(Q)}function A(Q){return Q===45&&r===2?(e.consume(Q),R):Q===60&&r===1?(e.consume(Q),L):Q===62&&r===4?(e.consume(Q),H):Q===63&&r===3?(e.consume(Q),I):Q===93&&r===5?(e.consume(Q),U):Cn(Q)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(Cut,K,F)(Q)):Q===null||Cn(Q)?(e.exit("htmlFlowData"),F(Q)):(e.consume(Q),A)}function F(Q){return e.check(Tut,T,K)(Q)}function T(Q){return e.enter("lineEnding"),e.consume(Q),e.exit("lineEnding"),P}function P(Q){return Q===null||Cn(Q)?F(Q):(e.enter("htmlFlowData"),A(Q))}function R(Q){return Q===45?(e.consume(Q),I):A(Q)}function L(Q){return Q===47?(e.consume(Q),a="",M):A(Q)}function M(Q){if(Q===62){const q=a.toLowerCase();return gX.includes(q)?(e.consume(Q),H):A(Q)}return Do(Q)&&a.length<8?(e.consume(Q),a+=String.fromCharCode(Q),M):A(Q)}function U(Q){return Q===93?(e.consume(Q),I):A(Q)}function I(Q){return Q===62?(e.consume(Q),H):Q===45&&r===2?(e.consume(Q),I):A(Q)}function H(Q){return Q===null||Cn(Q)?(e.exit("htmlFlowData"),K(Q)):(e.consume(Q),H)}function K(Q){return e.exit("htmlFlow"),t(Q)}}function Nut(e,t,n){const i=this;return r;function r(a){return Cn(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):n(a)}function s(a){return i.parser.lazy[i.now().line]?n(a):t(a)}}function jut(e,t,n){return i;function i(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(bE,t,n)}}const Rut={name:"htmlText",tokenize:Iut};function Iut(e,t,n){const i=this;let r,s,a;return l;function l(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),c}function c(I){return I===33?(e.consume(I),u):I===47?(e.consume(I),k):I===63?(e.consume(I),O):Do(I)?(e.consume(I),C):n(I)}function u(I){return I===45?(e.consume(I),d):I===91?(e.consume(I),s=0,g):Do(I)?(e.consume(I),x):n(I)}function d(I){return I===45?(e.consume(I),p):n(I)}function f(I){return I===null?n(I):I===45?(e.consume(I),h):Cn(I)?(a=f,L(I)):(e.consume(I),f)}function h(I){return I===45?(e.consume(I),p):f(I)}function p(I){return I===62?R(I):I===45?h(I):f(I)}function g(I){const H="CDATA[";return I===H.charCodeAt(s++)?(e.consume(I),s===H.length?b:g):n(I)}function b(I){return I===null?n(I):I===93?(e.consume(I),v):Cn(I)?(a=b,L(I)):(e.consume(I),b)}function v(I){return I===93?(e.consume(I),y):b(I)}function y(I){return I===62?R(I):I===93?(e.consume(I),y):b(I)}function x(I){return I===null||I===62?R(I):Cn(I)?(a=x,L(I)):(e.consume(I),x)}function O(I){return I===null?n(I):I===63?(e.consume(I),w):Cn(I)?(a=O,L(I)):(e.consume(I),O)}function w(I){return I===62?R(I):O(I)}function k(I){return Do(I)?(e.consume(I),S):n(I)}function S(I){return I===45||go(I)?(e.consume(I),S):E(I)}function E(I){return Cn(I)?(a=E,L(I)):wi(I)?(e.consume(I),E):R(I)}function C(I){return I===45||go(I)?(e.consume(I),C):I===47||I===62||Ar(I)?N(I):n(I)}function N(I){return I===47?(e.consume(I),R):I===58||I===95||Do(I)?(e.consume(I),_):Cn(I)?(a=N,L(I)):wi(I)?(e.consume(I),N):R(I)}function _(I){return I===45||I===46||I===58||I===95||go(I)?(e.consume(I),_):j(I)}function j(I){return I===61?(e.consume(I),A):Cn(I)?(a=j,L(I)):wi(I)?(e.consume(I),j):N(I)}function A(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),r=I,F):Cn(I)?(a=A,L(I)):wi(I)?(e.consume(I),A):(e.consume(I),T)}function F(I){return I===r?(e.consume(I),r=void 0,P):I===null?n(I):Cn(I)?(a=F,L(I)):(e.consume(I),F)}function T(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||Ar(I)?N(I):(e.consume(I),T)}function P(I){return I===47||I===62||Ar(I)?N(I):n(I)}function R(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function L(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),M}function M(I){return wi(I)?Ui(e,U,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):U(I)}function U(I){return e.enter("htmlTextData"),a(I)}}const QB={name:"labelEnd",resolveAll:Lut,resolveTo:$ut,tokenize:Fut},Put={tokenize:But},Dut={tokenize:Uut},Mut={tokenize:Qut};function Lut(e){let t=-1;const n=[];for(;++t=3&&(u===null||Cn(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===r?(e.consume(u),i++,c):(e.exit("thematicBreakSequence"),wi(u)?Ui(e,l,"whitespace")(u):l(u))}}const tl={continuation:{tokenize:Zut},exit:edt,name:"list",tokenize:Yut},Kut={partial:!0,tokenize:tdt},Xut={partial:!0,tokenize:Jut};function Yut(e,t,n){const i=this,r=i.events[i.events.length-1];let s=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,a=0;return l;function l(p){const g=i.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!i.containerState.marker||p===i.containerState.marker:R6(p)){if(i.containerState.type||(i.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(yA,n,u)(p):u(p);if(!i.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(p)}return n(p)}function c(p){return R6(p)&&++a<10?(e.consume(p),c):(!i.interrupt||a<2)&&(i.containerState.marker?p===i.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"),i.containerState.marker=i.containerState.marker||p,e.check(bE,i.interrupt?n:d,e.attempt(Kut,h,f))}function d(p){return i.containerState.initialBlankLine=!0,s++,h(p)}function f(p){return wi(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function Zut(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(bE,r,s);function r(l){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Ui(e,t,"listItemIndent",i.containerState.size+1)(l)}function s(l){return i.containerState.furtherBlankLines||!wi(l)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,a(l)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(Xut,t,a)(l))}function a(l){return i.containerState._closeFlow=!0,i.interrupt=void 0,Ui(e,e.attempt(tl,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function Jut(e,t,n){const i=this;return Ui(e,r,"listItemIndent",i.containerState.size+1);function r(s){const a=i.events[i.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===i.containerState.size?t(s):n(s)}}function edt(e){e.exit(this.containerState.type)}function tdt(e,t,n){const i=this;return Ui(e,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(s){const a=i.events[i.events.length-1];return!wi(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const bX={name:"setextUnderline",resolveTo:ndt,tokenize:idt};function ndt(e,t){let n=e.length,i,r,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(r=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",s?(e.splice(r,0,["enter",a,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=a,e.push(["exit",a,t]),e}function idt(e,t,n){const i=this;let r;return s;function s(u){let d=i.events.length,f;for(;d--;)if(i.events[d][1].type!=="lineEnding"&&i.events[d][1].type!=="linePrefix"&&i.events[d][1].type!=="content"){f=i.events[d][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||f)?(e.enter("setextHeadingLine"),r=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===r?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),wi(u)?Ui(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Cn(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const rdt={tokenize:sdt};function sdt(e){const t=this,n=e.attempt(bE,i,e.attempt(this.parser.constructs.flowInitial,r,Ui(e,e.attempt(this.parser.constructs.flow,r,e.attempt(uut,r)),"linePrefix")));return n;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const adt={resolveAll:SSe()},odt=OSe("string"),ldt=OSe("text");function OSe(e){return{resolveAll:SSe(e==="text"?cdt:void 0),tokenize:t};function t(n){const i=this,r=this.parser.constructs[e],s=n.attempt(r,a,l);return a;function a(d){return u(d)?s(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"),s(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const f=r[d];let h=-1;if(f)for(;++h-1){const l=a[0];typeof l=="string"?a[0]=l.slice(i):a.shift()}s>0&&a.push(e[r].slice(0,s))}return a}function Odt(e,t){let n=-1;const i=[];let r;for(;++n{const n=iu(t),i=bA(n.msg,n.message);if(!i)return"";const r=Array.isArray(n.loc)?n.loc.filter(s=>typeof s=="string"||typeof s=="number").map(String).join("."):"";return r?`${r}: ${i}`:i}).filter(Boolean).join("; "):""}function alt(e,t=!0){const n=iu(e),i=Object.prototype.hasOwnProperty.call(n,"detail")?n.detail:typeof e=="string"?e:void 0,r=iu(i);return{message:typeof i=="string"?t?i.trim():"":bA(r.message,n.message,slt(i)),errorCode:bA(r.errorCode,n.errorCode),requestId:bA(r.requestId,r.request_id,r.RequestId,n.requestId,n.request_id),diagnostics:r.diagnostics??n.diagnostics,detail:i,payload:e}}function iu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function Di(e){return typeof e=="string"?e:""}function $S(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function PB(e){const t=iu(e);return{id:Di(t.id),name:Di(t.name),description:Di(t.description),providerType:Di(t.providerType),providerKnowledgeId:Di(t.providerKnowledgeId),projectName:Di(t.projectName),region:Di(t.region),status:Di(t.status),createdAt:Di(t.createdAt),updatedAt:Di(t.updatedAt),ownerId:Di(t.ownerId),ownerLabel:Di(t.ownerLabel),canManage:t.canManage===!0}}function hE(e){const t=iu(e);return{id:Di(t.id),name:Di(t.name),type:Di(t.type),sizeBytes:$S(t.sizeBytes,0),status:Di(t.status),url:Di(t.url),tosPath:Di(t.tosPath),metadata:iu(t.metadata),createdAt:Di(t.createdAt),updatedAt:Di(t.updatedAt),sourceMarkdown:Di(t.sourceMarkdown)}}function olt(e){const t=iu(e),n=t.attachment,i=iu(n);return{id:Di(t.id),title:Di(t.title),content:Di(t.content),attachmentUrl:Di(t.attachmentUrl)||Di(i.url)||Di(i.previewUrl),attachmentType:Di(t.attachmentType)||Di(i.type)||Di(i.mimeType),attachment:n,tableFields:t.tableFields}}async function Gu(e,t={},n=Wo){var f;const i=Hu(Dh(t.headers));i.set("accept","application/json"),t.body&&!(t.body instanceof FormData)&&i.set("content-type","application/json");const r=await fetch(e,{...t,headers:i,signal:Ol(t.signal,n)});if(r.ok)return r.status===204?void 0:r.json();const s=await r.text();let a=s,l=!1;if(s)try{a=JSON.parse(s),l=!0}catch{}const c=((f=r.headers.get("content-type"))==null?void 0:f.toLowerCase())||"",u=alt(a,l||c.startsWith("text/plain")),d=r.status===401?V("knowledge.signInRequired"):r.status===403?V("knowledge.forbidden"):r.status===404?V("knowledge.notFound"):r.status===409?V("knowledge.conflict"):V("knowledge.requestFailed",{status:r.status});throw new HR(u.message||d,r.status,{errorCode:u.errorCode,requestId:u.requestId,diagnostics:u.diagnostics,detail:u.detail,payload:u.payload,rawBody:s})}function e0(e){const t=new URLSearchParams;e.trim()&&t.set("region",e.trim());const n=t.toString();return n?`?${n}`:""}async function llt(e){var r;const t=new URLSearchParams({region:e.region,pageSize:String(e.pageSize??30)});(r=e.projectName)!=null&&r.trim()&&t.set("projectName",e.projectName.trim()),e.nextToken&&t.set("nextToken",e.nextToken);const n=await Gu(`/web/knowledge-bases?${t.toString()}`,{signal:e.signal}),i=iu(n);return{items:Array.isArray(i.items)?i.items.map(PB):[],nextToken:Di(i.nextToken)}}function clt(e){return`${e.region}\0${e.id}`}async function ult(e){var l;const t=[...new Set(e.regions.map(c=>c.trim()).filter(Boolean))],n=e.nextTokens?t.filter(c=>{var u;return!!((u=e.nextTokens)!=null&&u[c])}):t;if(n.length===0)return{items:[],nextTokens:{},failures:[]};const i=await Promise.allSettled(n.map(async c=>{var u;return{region:c,page:await llt({region:c,projectName:e.projectName,nextToken:(u=e.nextTokens)==null?void 0:u[c],pageSize:e.pageSize,signal:e.signal})}}));if((l=e.signal)!=null&&l.aborted)throw new DOMException("Aborted","AbortError");const r=[],s={},a=new Map;if(i.forEach((c,u)=>{var f;const d=n[u];if(c.status==="rejected"){const h=(f=e.nextTokens)==null?void 0:f[d];h&&(s[d]=h),r.push({region:d,error:c.reason instanceof Error?c.reason:new Error(V("knowledge.loadFailed"))});return}c.value.page.nextToken&&(s[d]=c.value.page.nextToken),c.value.page.items.forEach(h=>{const p=h.region?h:{...h,region:d};a.set(clt(p),p)})}),r.length===n.length)throw new KOe(r);return{items:[...a.values()],nextTokens:s,failures:r}}function dlt(e){return Gu("/web/knowledge-bases",{method:"POST",body:JSON.stringify(e)},is).then(PB)}function flt(e,t,n){return Gu(`/web/knowledge-bases/${encodeURIComponent(e)}${e0(t)}`,{method:"PATCH",body:JSON.stringify(n)}).then(PB)}function hlt(e,t){return Gu(`/web/knowledge-bases/${encodeURIComponent(e)}${e0(t)}`,{method:"DELETE"},is)}async function plt(e,t){var s;const n=new URLSearchParams({region:t.region,offset:String(t.offset??0),limit:String(t.limit??30)});(s=t.documentType)!=null&&s.trim()&&n.set("documentType",t.documentType.trim());const i=await Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents?${n.toString()}`,{signal:t.signal}),r=iu(i);return{items:Array.isArray(r.items)?r.items.map(hE):[],offset:$S(r.offset,0),limit:$S(r.limit,t.limit??30),hasMore:r.hasMore===!0}}async function mlt(e,t,n){const i=new URLSearchParams({region:n.region,offset:String(n.offset??0),limit:String(n.limit??20)}),r=await Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}/preview?${i.toString()}`,{signal:n.signal}),s=iu(r);return{document:hE(s.document),chunks:Array.isArray(s.chunks)?s.chunks.map(olt):[],sourceMarkdown:Di(s.sourceMarkdown),offset:$S(s.offset,0),limit:$S(s.limit,n.limit??20),hasMore:s.hasMore===!0}}function glt(e,t,n){return Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents${e0(t)}`,{method:"POST",body:JSON.stringify(n)},is).then(hE)}async function blt(e,t,n){const i=await Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/web-preview${e0(t)}`,{method:"POST",body:JSON.stringify({sourceType:"url",url:n.url})},is),r=iu(i);return{name:Di(r.name),url:Di(r.url),sourceMarkdown:Di(r.sourceMarkdown)}}function ylt(e,t,n){var r,s;const i=new FormData;return i.set("file",n.file),(r=n.name)!=null&&r.trim()&&i.set("name",n.name.trim()),(s=n.documentType)!=null&&s.trim()&&i.set("documentType",n.documentType.trim()),n.metadata&&i.set("metadata",JSON.stringify(n.metadata)),Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/upload${e0(t)}`,{method:"POST",body:i},is).then(hE)}function vlt(e,t,n,i){return Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}${e0(n)}`,{method:"PATCH",body:JSON.stringify(i)}).then(hE)}function xlt(e,t,n){return Gu(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}${e0(n)}`,{method:"DELETE"},is)}function pE({className:e="",title:t,status:n,description:i,metadata:r,detailAction:s,action:a,auxiliaryAction:l}){return o.jsxs(jB,{className:`library-resource-card ${e}`.trim(),activateLabel:`${s.label} ${t}`,onActivate:s.disabled?void 0:s.onClick,footer:o.jsx(BOe,{items:r.map(c=>({label:c.label,value:c.value,title:c.title,hideLabel:!0}))}),actions:o.jsxs(o.Fragment,{children:[l?o.jsx(C6,{className:"library-resource-card__auxiliary-action",label:`${l.label} ${t}`,tone:"secondary",disabled:l.disabled,title:l.title??l.label,onClick:l.onClick,children:l.icon}):null,a?o.jsx(C6,{label:`${a.label} ${t}`,icon:a.icon,disabled:a.disabled,title:a.title,onClick:a.onClick}):null]}),children:[o.jsx(RB,{leading:o.jsx(Xv,{seed:t}),title:t,titleText:t,status:n}),o.jsx(IB,{title:i,children:i})]})}function aHt(){}function XK(e){const t=[],n=String(e||"");let i=n.indexOf(","),r=0,s=!1;for(;!s;){i===-1&&(i=n.length,s=!0);const a=n.slice(r,i).trim();(a||!s)&&t.push(a),r=i+1,i=n.indexOf(",",r)}return t}function YOe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const wlt=/[$_\p{ID_Start}]/u,Olt=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,Slt=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,klt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Elt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ZOe={};function oHt(e){return e?wlt.test(String.fromCodePoint(e)):!1}function lHt(e,t){const i=(t||ZOe).jsx?Slt:Olt;return e?i.test(String.fromCodePoint(e)):!1}function YK(e,t){return(ZOe.jsx?Elt:klt).test(e)}const Clt=/[ \t\n\f\r]/g;function Tlt(e){return typeof e=="object"?e.type==="text"?ZK(e.value):!1:ZK(e)}function ZK(e){return e.replace(Clt,"")===""}let mE=class{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}};mE.prototype.normal={};mE.prototype.property={};mE.prototype.space=void 0;function JOe(e,t){const n={},i={};for(const r of e)Object.assign(n,r.property),Object.assign(i,r.normal);return new mE(n,i,t)}function FS(e){return e.toLowerCase()}class El{constructor(t,n){this.attribute=n,this.property=t}}El.prototype.attribute="";El.prototype.booleanish=!1;El.prototype.boolean=!1;El.prototype.commaOrSpaceSeparated=!1;El.prototype.commaSeparated=!1;El.prototype.defined=!1;El.prototype.mustUseProperty=!1;El.prototype.number=!1;El.prototype.overloadedBoolean=!1;El.prototype.property="";El.prototype.spaceSeparated=!1;El.prototype.space=void 0;let Alt=0;const ni=t0(),Gs=t0(),A6=t0(),jt=t0(),Rr=t0(),sv=t0(),Ql=t0();function t0(){return 2**++Alt}const _6=Object.freeze(Object.defineProperty({__proto__:null,boolean:ni,booleanish:Gs,commaOrSpaceSeparated:Ql,commaSeparated:sv,number:jt,overloadedBoolean:A6,spaceSeparated:Rr},Symbol.toStringTag,{value:"Module"})),vM=Object.keys(_6);class DB extends El{constructor(t,n,i,r){let s=-1;if(super(t,n),JK(this,"space",r),typeof i=="number")for(;++s4&&n.slice(0,4)==="data"&&Ilt.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(eX,Dlt);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!eX.test(s)){let a=s.replace(Rlt,Plt);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}r=DB}return new r(i,t)}function Plt(e){return"-"+e.toLowerCase()}function Dlt(e){return e.charAt(1).toUpperCase()}const gE=JOe([eSe,_lt,iSe,rSe,sSe],"html"),Qm=JOe([eSe,Nlt,iSe,rSe,sSe],"svg");function tX(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function aSe(e){return e.join(" ").trim()}var MB={},nX=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Mlt=/\n/g,Llt=/^\s*/,$lt=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Flt=/^:\s*/,Blt=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Ult=/^[;\s]*/,Qlt=/^\s+|\s+$/g,zlt=` +`,iX="/",rX="*",Tg="",Vlt="comment",Hlt="declaration";function qlt(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,i=1;function r(g){var b=g.match(Mlt);b&&(n+=b.length);var v=g.lastIndexOf(zlt);i=~v?g.length-v:i+g.length}function s(){var g={line:n,column:i};return function(b){return b.position=new a(g),u(),b}}function a(g){this.start=g,this.end={line:n,column:i},this.source=t.source}a.prototype.content=e;function l(g){var b=new Error(t.source+":"+n+":"+i+": "+g);if(b.reason=g,b.filename=t.source,b.line=n,b.column=i,b.source=e,!t.silent)throw b}function c(g){var b=g.exec(e);if(b){var v=b[0];return r(v),e=e.slice(v.length),b}}function u(){c(Llt)}function d(g){var b;for(g=g||[];b=f();)b!==!1&&g.push(b);return g}function f(){var g=s();if(!(iX!=e.charAt(0)||rX!=e.charAt(1))){for(var b=2;Tg!=e.charAt(b)&&(rX!=e.charAt(b)||iX!=e.charAt(b+1));)++b;if(b+=2,Tg===e.charAt(b-1))return l("End of comment missing");var v=e.slice(2,b-2);return i+=2,r(v),e=e.slice(b),i+=2,g({type:Vlt,comment:v})}}function h(){var g=s(),b=c($lt);if(b){if(f(),!c(Flt))return l("property missing ':'");var v=c(Blt),y=g({type:Hlt,property:sX(b[0].replace(nX,Tg)),value:v?sX(v[0].replace(nX,Tg)):Tg});return c(Ult),y}}function p(){var g=[];d(g);for(var b;b=h();)b!==!1&&(g.push(b),d(g));return g}return u(),p()}function sX(e){return e?e.replace(Qlt,Tg):Tg}var Wlt=qlt,Glt=Ip&&Ip.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(MB,"__esModule",{value:!0});MB.default=Xlt;const Klt=Glt(Wlt);function Xlt(e,t){let n=null;if(!e||typeof e!="string")return n;const i=(0,Klt.default)(e),r=typeof t=="function";return i.forEach(s=>{if(s.type!=="declaration")return;const{property:a,value:l}=s;r?t(a,l,s):l&&(n=n||{},n[a]=l)}),n}var WR={};Object.defineProperty(WR,"__esModule",{value:!0});WR.camelCase=void 0;var Ylt=/^--[a-zA-Z0-9_-]+$/,Zlt=/-([a-z])/g,Jlt=/^[^-]+$/,ect=/^-(webkit|moz|ms|o|khtml)-/,tct=/^-(ms)-/,nct=function(e){return!e||Jlt.test(e)||Ylt.test(e)},ict=function(e,t){return t.toUpperCase()},aX=function(e,t){return"".concat(t,"-")},rct=function(e,t){return t===void 0&&(t={}),nct(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(tct,aX):e=e.replace(ect,aX),e.replace(Zlt,ict))};WR.camelCase=rct;var sct=Ip&&Ip.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},act=sct(MB),oct=WR;function N6(e,t){var n={};return!e||typeof e!="string"||(0,act.default)(e,function(i,r){i&&r&&(n[(0,oct.camelCase)(i,t)]=r)}),n}N6.default=N6;var lct=N6;const cct=px(lct),GR=oSe("end"),Yd=oSe("start");function oSe(e){return t;function t(n){const i=n&&n.position&&n.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function uct(e){const t=Yd(e),n=GR(e);if(t&&n)return{start:t,end:n}}function CO(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?oX(e.position):"start"in e||"end"in e?oX(e):"line"in e||"column"in e?j6(e):""}function j6(e){return lX(e&&e.line)+":"+lX(e&&e.column)}function oX(e){return j6(e&&e.start)+"-"+j6(e&&e.end)}function lX(e){return e&&typeof e=="number"?e:1}class wo extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let r="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?r=t:!s.cause&&t&&(a=!0,r=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof i=="string"){const c=i.indexOf(":");c===-1?s.ruleId=i:(s.source=i.slice(0,c),s.ruleId=i.slice(c+1))}if(!s.place&&s.ancestors&&s.ancestors){const c=s.ancestors[s.ancestors.length-1];c&&(s.place=c.position)}const l=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=CO(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}wo.prototype.file="";wo.prototype.name="";wo.prototype.reason="";wo.prototype.message="";wo.prototype.stack="";wo.prototype.column=void 0;wo.prototype.line=void 0;wo.prototype.ancestors=void 0;wo.prototype.cause=void 0;wo.prototype.fatal=void 0;wo.prototype.place=void 0;wo.prototype.ruleId=void 0;wo.prototype.source=void 0;const LB={}.hasOwnProperty,dct=new Map,fct=/[A-Z]/g,hct=new Set(["table","tbody","thead","tfoot","tr"]),pct=new Set(["td","th"]),lSe="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function mct(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=Sct(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");i=Oct(n,t.jsx,t.jsxs)}const r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,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"?Qm:gE,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=cSe(r,e,void 0);return s&&typeof s!="string"?s:r.create(e,r.Fragment,{children:s||void 0},void 0)}function cSe(e,t,n){if(t.type==="element")return gct(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return bct(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return vct(e,t,n);if(t.type==="mdxjsEsm")return yct(e,t);if(t.type==="root")return xct(e,t,n);if(t.type==="text")return wct(e,t)}function gct(e,t,n){const i=e.schema;let r=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=Qm,e.schema=r),e.ancestors.push(t);const s=dSe(e,t.tagName,!1),a=kct(e,t);let l=FB(e,t);return hct.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!Tlt(c):!0})),uSe(e,a,s,t),$B(a,l),e.ancestors.pop(),e.schema=i,e.create(t,s,a,n)}function bct(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}BS(e,t.position)}function yct(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);BS(e,t.position)}function vct(e,t,n){const i=e.schema;let r=i;t.name==="svg"&&i.space==="html"&&(r=Qm,e.schema=r),e.ancestors.push(t);const s=t.name===null?e.Fragment:dSe(e,t.name,!0),a=Ect(e,t),l=FB(e,t);return uSe(e,a,s,t),$B(a,l),e.ancestors.pop(),e.schema=i,e.create(t,s,a,n)}function xct(e,t,n){const i={};return $B(i,FB(e,t)),e.create(t,e.Fragment,i,n)}function wct(e,t){return t.value}function uSe(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function $B(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Oct(e,t,n){return i;function i(r,s,a,l){const u=Array.isArray(a.children)?n:t;return l?u(s,a,l):u(s,a)}}function Sct(e,t){return n;function n(i,r,s,a){const l=Array.isArray(s.children),c=Yd(i);return t(r,s,a,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function kct(e,t){const n={};let i,r;for(r in t.properties)if(r!=="children"&&LB.call(t.properties,r)){const s=Cct(e,r,t.properties[r]);if(s){const[a,l]=s;e.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&pct.has(t.tagName)?i=l:n[a]=l}}if(i){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function Ect(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const s=i.data.estree.body[0];s.type;const a=s.expression;a.type;const l=a.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else BS(e,t.position);else{const r=i.name;let s;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const l=i.value.data.estree.body[0];l.type,s=e.evaluater.evaluateExpression(l.expression)}else BS(e,t.position);else s=i.value===null?!0:i.value;n[r]=s}return n}function FB(e,t){const n=[];let i=-1;const r=e.passKeys?new Map:dct;for(;++ir?0:r+t:t=t>r?r:t,n=n>0?n:0,i.length<1e4)a=Array.from(i),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s0?(lc(e,e.length,0,t),e):t}const dX={}.hasOwnProperty;function hSe(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 Du(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Do=zm(/[A-Za-z]/),go=zm(/[\dA-Za-z]/),Dct=zm(/[#-'*+\--9=?A-Z^-~]/);function uN(e){return e!==null&&(e<32||e===127)}const R6=zm(/\d/),Mct=zm(/[\dA-Fa-f]/),Lct=zm(/[!-/:-@[-`{-~]/);function Cn(e){return e!==null&&e<-2}function Ar(e){return e!==null&&(e<0||e===32)}function wi(e){return e===-2||e===-1||e===32}const KR=zm(new RegExp("\\p{P}|\\p{S}","u")),Tb=zm(/\s/);function zm(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function qx(e){const t=[];let n=-1,i=0,r=0;for(;++n55295&&s<57344){const l=e.charCodeAt(n+1);s<56320&&l>56319&&l<57344?(a=String.fromCharCode(s,l),r=1):a="�"}else a=String.fromCharCode(s);a&&(t.push(e.slice(i,n),encodeURIComponent(a)),i=n+r+1,a=""),r&&(n+=r,r=0)}return t.join("")+e.slice(i)}function Ui(e,t,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(c){return wi(c)?(e.enter(n),l(c)):t(c)}function l(c){return wi(c)&&s++a))return;const E=t.events.length;let C=E,N,_;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){if(N){_=t.events[C][1].end;break}N=!0}for(y(i),S=E;SO;){const k=n[w];t.containerState=k[1],k[0].exit.call(t,e)}n.length=O}function x(){r.write([null]),s=void 0,r=void 0,t.containerState._closeFlow=void 0}}function Qct(e,t,n){return Ui(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Yv(e){if(e===null||Ar(e)||Tb(e))return 1;if(KR(e))return 2}function XR(e,t,n){const i=[];let r=-1;for(;++r1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[i][1].end},h={...e[n][1].start};hX(f,-c),hX(h,c),a={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[i][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:c>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},r={type:c>1?"strong":"emphasis",start:{...a.start},end:{...l.end}},e[i][1].end={...a.start},e[n][1].start={...l.end},u=[],e[i][1].end.offset-e[i][1].start.offset&&(u=Lc(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=Lc(u,[["enter",r,t],["enter",a,t],["exit",a,t],["enter",s,t]]),u=Lc(u,XR(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=Lc(u,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",r,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Lc(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,lc(e,i-1,n-i+3,u),n=i+u.length-d-2;break}}for(n=-1;++n0&&wi(S)?Ui(e,x,"linePrefix",s+1)(S):x(S)}function x(S){return S===null||Cn(S)?e.check(pX,b,w)(S):(e.enter("codeFlowValue"),O(S))}function O(S){return S===null||Cn(S)?(e.exit("codeFlowValue"),x(S)):(e.consume(S),O)}function w(S){return e.exit("codeFenced"),t(S)}function k(S,E,C){let N=0;return _;function _(P){return S.enter("lineEnding"),S.consume(P),S.exit("lineEnding"),j}function j(P){return S.enter("codeFencedFence"),wi(P)?Ui(S,A,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):A(P)}function A(P){return P===l?(S.enter("codeFencedFenceSequence"),F(P)):C(P)}function F(P){return P===l?(N++,S.consume(P),F):N>=a?(S.exit("codeFencedFenceSequence"),wi(P)?Ui(S,T,"whitespace")(P):T(P)):C(P)}function T(P){return P===null||Cn(P)?(S.exit("codeFencedFence"),E(P)):C(P)}}}function eut(e,t,n){const i=this;return r;function r(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s)}function s(a){return i.parser.lazy[i.now().line]?n(a):t(a)}}const wM={name:"codeIndented",tokenize:nut},tut={partial:!0,tokenize:iut};function nut(e,t,n){const i=this;return r;function r(u){return e.enter("codeIndented"),Ui(e,s,"linePrefix",5)(u)}function s(u){const d=i.events[i.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):Cn(u)?e.attempt(tut,a,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Cn(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function iut(e,t,n){const i=this;return r;function r(a){return i.parser.lazy[i.now().line]?n(a):Cn(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),r):Ui(e,s,"linePrefix",5)(a)}function s(a){const l=i.events[i.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):Cn(a)?r(a):n(a)}}const rut={name:"codeText",previous:aut,resolve:sut,tokenize:out};function sut(e){let t=e.length-4,n=3,i,r;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i=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-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const r=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&V1(this.left,i),s.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),V1(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),V1(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(i.parser.constructs.flow,n,t)(a)}}function vSe(e,t,n,i,r,s,a,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(y){return y===60?(e.enter(i),e.enter(r),e.enter(s),e.consume(y),e.exit(s),h):y===null||y===32||y===41||uN(y)?n(y):(e.enter(i),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),b(y))}function h(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(r),e.exit(i),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||Cn(y)?n(y):(e.consume(y),y===92?g:p)}function g(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function b(y){return!d&&(y===null||y===41||Ar(y))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(i),t(y)):d999||p===null||p===91||p===93&&!c||p===94&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(p):p===93?(e.exit(s),e.enter(r),e.consume(p),e.exit(r),e.exit(i),t):Cn(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||Cn(p)||l++>999?(e.exit("chunkString"),d(p)):(e.consume(p),c||(c=!wi(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),l++,f):f(p)}}function wSe(e,t,n,i,r,s){let a;return l;function l(h){return h===34||h===39||h===40?(e.enter(i),e.enter(r),e.consume(h),e.exit(r),a=h===40?41:h,c):n(h)}function c(h){return h===a?(e.enter(r),e.consume(h),e.exit(r),e.exit(i),t):(e.enter(s),u(h))}function u(h){return h===a?(e.exit(s),c(a)):h===null?n(h):Cn(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Ui(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||Cn(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 TO(e,t){let n;return i;function i(r){return Cn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,i):wi(r)?Ui(e,i,n?"linePrefix":"lineSuffix")(r):t(r)}}const mut={name:"definition",tokenize:but},gut={partial:!0,tokenize:yut};function but(e,t,n){const i=this;let r;return s;function s(p){return e.enter("definition"),a(p)}function a(p){return xSe.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return r=Du(i.sliceSerialize(i.events[i.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 Ar(p)?TO(e,u)(p):u(p)}function u(p){return vSe(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(gut,f,f)(p)}function f(p){return wi(p)?Ui(e,h,"whitespace")(p):h(p)}function h(p){return p===null||Cn(p)?(e.exit("definition"),i.parser.defined.push(r),t(p)):n(p)}}function yut(e,t,n){return i;function i(l){return Ar(l)?TO(e,r)(l):n(l)}function r(l){return wSe(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return wi(l)?Ui(e,a,"whitespace")(l):a(l)}function a(l){return l===null||Cn(l)?t(l):n(l)}}const vut={name:"hardBreakEscape",tokenize:xut};function xut(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),r}function r(s){return Cn(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const wut={name:"headingAtx",resolve:Out,tokenize:Sut};function Out(e,t){let n=e.length-2,i=3,r,s;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(r={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},lc(e,i,n-i+1,[["enter",r,t],["enter",s,t],["exit",s,t],["exit",r,t]])),e}function Sut(e,t,n){let i=0;return r;function r(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&i++<6?(e.consume(d),a):d===null||Ar(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||Cn(d)?(e.exit("atxHeading"),t(d)):wi(d)?Ui(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||Ar(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const kut=["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"],gX=["pre","script","style","textarea"],Eut={concrete:!0,name:"htmlFlow",resolveTo:Aut,tokenize:_ut},Cut={partial:!0,tokenize:jut},Tut={partial:!0,tokenize:Nut};function Aut(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 _ut(e,t,n){const i=this;let r,s,a,l,c;return u;function u(Q){return d(Q)}function d(Q){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(Q),f}function f(Q){return Q===33?(e.consume(Q),h):Q===47?(e.consume(Q),s=!0,b):Q===63?(e.consume(Q),r=3,i.interrupt?t:I):Do(Q)?(e.consume(Q),a=String.fromCharCode(Q),v):n(Q)}function h(Q){return Q===45?(e.consume(Q),r=2,p):Q===91?(e.consume(Q),r=5,l=0,g):Do(Q)?(e.consume(Q),r=4,i.interrupt?t:I):n(Q)}function p(Q){return Q===45?(e.consume(Q),i.interrupt?t:I):n(Q)}function g(Q){const q="CDATA[";return Q===q.charCodeAt(l++)?(e.consume(Q),l===q.length?i.interrupt?t:A:g):n(Q)}function b(Q){return Do(Q)?(e.consume(Q),a=String.fromCharCode(Q),v):n(Q)}function v(Q){if(Q===null||Q===47||Q===62||Ar(Q)){const q=Q===47,B=a.toLowerCase();return!q&&!s&&gX.includes(B)?(r=1,i.interrupt?t(Q):A(Q)):kut.includes(a.toLowerCase())?(r=6,q?(e.consume(Q),y):i.interrupt?t(Q):A(Q)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(Q):s?x(Q):O(Q))}return Q===45||go(Q)?(e.consume(Q),a+=String.fromCharCode(Q),v):n(Q)}function y(Q){return Q===62?(e.consume(Q),i.interrupt?t:A):n(Q)}function x(Q){return wi(Q)?(e.consume(Q),x):_(Q)}function O(Q){return Q===47?(e.consume(Q),_):Q===58||Q===95||Do(Q)?(e.consume(Q),w):wi(Q)?(e.consume(Q),O):_(Q)}function w(Q){return Q===45||Q===46||Q===58||Q===95||go(Q)?(e.consume(Q),w):k(Q)}function k(Q){return Q===61?(e.consume(Q),S):wi(Q)?(e.consume(Q),k):O(Q)}function S(Q){return Q===null||Q===60||Q===61||Q===62||Q===96?n(Q):Q===34||Q===39?(e.consume(Q),c=Q,E):wi(Q)?(e.consume(Q),S):C(Q)}function E(Q){return Q===c?(e.consume(Q),c=null,N):Q===null||Cn(Q)?n(Q):(e.consume(Q),E)}function C(Q){return Q===null||Q===34||Q===39||Q===47||Q===60||Q===61||Q===62||Q===96||Ar(Q)?k(Q):(e.consume(Q),C)}function N(Q){return Q===47||Q===62||wi(Q)?O(Q):n(Q)}function _(Q){return Q===62?(e.consume(Q),j):n(Q)}function j(Q){return Q===null||Cn(Q)?A(Q):wi(Q)?(e.consume(Q),j):n(Q)}function A(Q){return Q===45&&r===2?(e.consume(Q),R):Q===60&&r===1?(e.consume(Q),L):Q===62&&r===4?(e.consume(Q),H):Q===63&&r===3?(e.consume(Q),I):Q===93&&r===5?(e.consume(Q),U):Cn(Q)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(Cut,Z,F)(Q)):Q===null||Cn(Q)?(e.exit("htmlFlowData"),F(Q)):(e.consume(Q),A)}function F(Q){return e.check(Tut,T,Z)(Q)}function T(Q){return e.enter("lineEnding"),e.consume(Q),e.exit("lineEnding"),P}function P(Q){return Q===null||Cn(Q)?F(Q):(e.enter("htmlFlowData"),A(Q))}function R(Q){return Q===45?(e.consume(Q),I):A(Q)}function L(Q){return Q===47?(e.consume(Q),a="",M):A(Q)}function M(Q){if(Q===62){const q=a.toLowerCase();return gX.includes(q)?(e.consume(Q),H):A(Q)}return Do(Q)&&a.length<8?(e.consume(Q),a+=String.fromCharCode(Q),M):A(Q)}function U(Q){return Q===93?(e.consume(Q),I):A(Q)}function I(Q){return Q===62?(e.consume(Q),H):Q===45&&r===2?(e.consume(Q),I):A(Q)}function H(Q){return Q===null||Cn(Q)?(e.exit("htmlFlowData"),Z(Q)):(e.consume(Q),H)}function Z(Q){return e.exit("htmlFlow"),t(Q)}}function Nut(e,t,n){const i=this;return r;function r(a){return Cn(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):n(a)}function s(a){return i.parser.lazy[i.now().line]?n(a):t(a)}}function jut(e,t,n){return i;function i(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(bE,t,n)}}const Rut={name:"htmlText",tokenize:Iut};function Iut(e,t,n){const i=this;let r,s,a;return l;function l(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),c}function c(I){return I===33?(e.consume(I),u):I===47?(e.consume(I),k):I===63?(e.consume(I),O):Do(I)?(e.consume(I),C):n(I)}function u(I){return I===45?(e.consume(I),d):I===91?(e.consume(I),s=0,g):Do(I)?(e.consume(I),x):n(I)}function d(I){return I===45?(e.consume(I),p):n(I)}function f(I){return I===null?n(I):I===45?(e.consume(I),h):Cn(I)?(a=f,L(I)):(e.consume(I),f)}function h(I){return I===45?(e.consume(I),p):f(I)}function p(I){return I===62?R(I):I===45?h(I):f(I)}function g(I){const H="CDATA[";return I===H.charCodeAt(s++)?(e.consume(I),s===H.length?b:g):n(I)}function b(I){return I===null?n(I):I===93?(e.consume(I),v):Cn(I)?(a=b,L(I)):(e.consume(I),b)}function v(I){return I===93?(e.consume(I),y):b(I)}function y(I){return I===62?R(I):I===93?(e.consume(I),y):b(I)}function x(I){return I===null||I===62?R(I):Cn(I)?(a=x,L(I)):(e.consume(I),x)}function O(I){return I===null?n(I):I===63?(e.consume(I),w):Cn(I)?(a=O,L(I)):(e.consume(I),O)}function w(I){return I===62?R(I):O(I)}function k(I){return Do(I)?(e.consume(I),S):n(I)}function S(I){return I===45||go(I)?(e.consume(I),S):E(I)}function E(I){return Cn(I)?(a=E,L(I)):wi(I)?(e.consume(I),E):R(I)}function C(I){return I===45||go(I)?(e.consume(I),C):I===47||I===62||Ar(I)?N(I):n(I)}function N(I){return I===47?(e.consume(I),R):I===58||I===95||Do(I)?(e.consume(I),_):Cn(I)?(a=N,L(I)):wi(I)?(e.consume(I),N):R(I)}function _(I){return I===45||I===46||I===58||I===95||go(I)?(e.consume(I),_):j(I)}function j(I){return I===61?(e.consume(I),A):Cn(I)?(a=j,L(I)):wi(I)?(e.consume(I),j):N(I)}function A(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),r=I,F):Cn(I)?(a=A,L(I)):wi(I)?(e.consume(I),A):(e.consume(I),T)}function F(I){return I===r?(e.consume(I),r=void 0,P):I===null?n(I):Cn(I)?(a=F,L(I)):(e.consume(I),F)}function T(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||Ar(I)?N(I):(e.consume(I),T)}function P(I){return I===47||I===62||Ar(I)?N(I):n(I)}function R(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function L(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),M}function M(I){return wi(I)?Ui(e,U,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):U(I)}function U(I){return e.enter("htmlTextData"),a(I)}}const QB={name:"labelEnd",resolveAll:Lut,resolveTo:$ut,tokenize:Fut},Put={tokenize:But},Dut={tokenize:Uut},Mut={tokenize:Qut};function Lut(e){let t=-1;const n=[];for(;++t=3&&(u===null||Cn(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===r?(e.consume(u),i++,c):(e.exit("thematicBreakSequence"),wi(u)?Ui(e,l,"whitespace")(u):l(u))}}const tl={continuation:{tokenize:Zut},exit:edt,name:"list",tokenize:Yut},Kut={partial:!0,tokenize:tdt},Xut={partial:!0,tokenize:Jut};function Yut(e,t,n){const i=this,r=i.events[i.events.length-1];let s=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,a=0;return l;function l(p){const g=i.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!i.containerState.marker||p===i.containerState.marker:R6(p)){if(i.containerState.type||(i.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(yA,n,u)(p):u(p);if(!i.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(p)}return n(p)}function c(p){return R6(p)&&++a<10?(e.consume(p),c):(!i.interrupt||a<2)&&(i.containerState.marker?p===i.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"),i.containerState.marker=i.containerState.marker||p,e.check(bE,i.interrupt?n:d,e.attempt(Kut,h,f))}function d(p){return i.containerState.initialBlankLine=!0,s++,h(p)}function f(p){return wi(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function Zut(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(bE,r,s);function r(l){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Ui(e,t,"listItemIndent",i.containerState.size+1)(l)}function s(l){return i.containerState.furtherBlankLines||!wi(l)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,a(l)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(Xut,t,a)(l))}function a(l){return i.containerState._closeFlow=!0,i.interrupt=void 0,Ui(e,e.attempt(tl,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function Jut(e,t,n){const i=this;return Ui(e,r,"listItemIndent",i.containerState.size+1);function r(s){const a=i.events[i.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===i.containerState.size?t(s):n(s)}}function edt(e){e.exit(this.containerState.type)}function tdt(e,t,n){const i=this;return Ui(e,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(s){const a=i.events[i.events.length-1];return!wi(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const bX={name:"setextUnderline",resolveTo:ndt,tokenize:idt};function ndt(e,t){let n=e.length,i,r,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(r=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",s?(e.splice(r,0,["enter",a,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=a,e.push(["exit",a,t]),e}function idt(e,t,n){const i=this;let r;return s;function s(u){let d=i.events.length,f;for(;d--;)if(i.events[d][1].type!=="lineEnding"&&i.events[d][1].type!=="linePrefix"&&i.events[d][1].type!=="content"){f=i.events[d][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||f)?(e.enter("setextHeadingLine"),r=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===r?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),wi(u)?Ui(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Cn(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const rdt={tokenize:sdt};function sdt(e){const t=this,n=e.attempt(bE,i,e.attempt(this.parser.constructs.flowInitial,r,Ui(e,e.attempt(this.parser.constructs.flow,r,e.attempt(uut,r)),"linePrefix")));return n;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const adt={resolveAll:SSe()},odt=OSe("string"),ldt=OSe("text");function OSe(e){return{resolveAll:SSe(e==="text"?cdt:void 0),tokenize:t};function t(n){const i=this,r=this.parser.constructs[e],s=n.attempt(r,a,l);return a;function a(d){return u(d)?s(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"),s(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const f=r[d];let h=-1;if(f)for(;++h-1){const l=a[0];typeof l=="string"?a[0]=l.slice(i):a.shift()}s>0&&a.push(e[r].slice(0,s))}return a}function Odt(e,t){let n=-1;const i=[];let r;for(;++n0){const St=Ce.tokenStack[Ce.tokenStack.length-1];(St[1]||vX).call(Ce,void 0,St[0])}for(he.position={start:up(J.length>0?J[0][1].start:{line:1,column:1,offset:0}),end:up(J.length>0?J[J.length-2][1].end:{line:1,column:1,offset:0})},at=-1;++at0){const ht=oe.tokenStack[oe.tokenStack.length-1];(ht[1]||vX).call(oe,void 0,ht[0])}for(pe.position={start:up(J.length>0?J[0][1].start:{line:1,column:1,offset:0}),end:up(J.length>0?J[J.length-2][1].end:{line:1,column:1,offset:0})},Ve=-1;++Ve0&&(i.className=["language-"+r[0]]);let s={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function Mdt(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ldt(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $dt(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),r=qx(i.toLowerCase()),s=e.footnoteOrder.indexOf(i);let a,l=e.footnoteCounts.get(i);l===void 0?(l=0,e.footnoteOrder.push(i),a=e.footnoteOrder.length):a=s+1,l+=1,e.footnoteCounts.set(i,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(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 Fdt(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 Bdt(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function CSe(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const r=e.all(t),s=r[0];s&&s.type==="text"?s.value="["+s.value:r.unshift({type:"text",value:"["});const a=r[r.length-1];return a&&a.type==="text"?a.value+=i:r.push({type:"text",value:i}),r}function Udt(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return CSe(e,t);const r={src:qx(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,s),e.applyData(t,s)}function Qdt(e,t){const n={src:qx(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 i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function zdt(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)}function Vdt(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return CSe(e,t);const r={href:qx(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function Hdt(e,t){const n={href:qx(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function qdt(e,t,n){const i=e.all(t),r=n?Wdt(n):TSe(t),s={},a=[];if(typeof t.checked=="boolean"){const d=i[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},i.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:[]}),s.className=["task-list-item"]}let l=-1;for(;++l0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Qpt={tokenize:Xpt,partial:!0};function zpt(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Wpt,continuation:{tokenize:Gpt},exit:Kpt}},text:{91:{name:"gfmFootnoteCall",tokenize:qpt},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Vpt,resolveTo:Hpt}}}}function Vpt(e,t,n){const i=this;let r=i.events.length;const s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a;for(;r--;){const c=i.events[r][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=Du(i.sliceSerialize({start:a.end,end:i.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function Hpt(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 i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",r,t],["exit",r,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...l),e}function qpt(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s=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(s>999||f===93&&!a||f===null||f===91||Ar(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return r.includes(Du(i.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Ar(f)||(a=!0),s++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),s++,u):u(f)}}function Wpt(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s,a=0,l;return c;function c(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(g)}function d(g){if(a>999||g===93&&!l||g===null||g===91||Ar(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return s=Du(i.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Ar(g)||(l=!0),a++,e.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(e.consume(g),a++,d):d(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),r.includes(s)||r.push(s),Ui(e,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return t(g)}}function Gpt(e,t,n){return e.check(bE,t,e.attempt(Qpt,t,n))}function Kpt(e){e.exit("gfmFootnoteDefinition")}function Xpt(e,t,n){const i=this;return Ui(e,r,"gfmFootnoteDefinitionIndent",5);function r(s){const a=i.events[i.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(s):n(s)}}function Ypt(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:s,resolveAll:r};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function r(a,l){let c=-1;for(;++c1?c(g):(a.consume(g),f++,p);if(f<2&&!n)return c(g);const v=a.exit("strikethroughSequenceTemporary"),y=Yv(g);return v._open=!y||y===2&&!!b,v._close=!b||b===2&&!!y,l(g)}}}class Zpt{constructor(){this.map=[]}add(t,n,i){Jpt(this,t,n,i)}consume(t){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let r=i.pop();for(;r;){for(const s of r)t.push(s);r=i.pop()}this.map.length=0}}function Jpt(e,t,n,i){let r=0;if(!(n===0&&i.length===0)){for(;r-1;){const T=i.events[j][1].type;if(T==="lineEnding"||T==="linePrefix")j--;else break}const A=j>-1?i.events[j][1].type:null,F=A==="tableHead"||A==="tableRow"?S:c;return F===S&&i.parser.lazy[i.now().line]?n(_):F(_)}function c(_){return e.enter("tableHead"),e.enter("tableRow"),u(_)}function u(_){return _===124||(a=!0,s+=1),d(_)}function d(_){return _===null?n(_):Cn(_)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),p):n(_):wi(_)?Ui(e,d,"whitespace")(_):(s+=1,a&&(a=!1,r+=1),_===124?(e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(_)))}function f(_){return _===null||_===124||Ar(_)?(e.exit("data"),d(_)):(e.consume(_),_===92?h:f)}function h(_){return _===92||_===124?(e.consume(_),f):f(_)}function p(_){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(_):(e.enter("tableDelimiterRow"),a=!1,wi(_)?Ui(e,g,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):g(_))}function g(_){return _===45||_===58?v(_):_===124?(a=!0,e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),b):k(_)}function b(_){return wi(_)?Ui(e,v,"whitespace")(_):v(_)}function v(_){return _===58?(s+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(_),e.exit("tableDelimiterMarker"),y):_===45?(s+=1,y(_)):_===null||Cn(_)?w(_):k(_)}function y(_){return _===45?(e.enter("tableDelimiterFiller"),x(_)):k(_)}function x(_){return _===45?(e.consume(_),x):_===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(_),e.exit("tableDelimiterMarker"),O):(e.exit("tableDelimiterFiller"),O(_))}function O(_){return wi(_)?Ui(e,w,"whitespace")(_):w(_)}function w(_){return _===124?g(_):_===null||Cn(_)?!a||r!==s?k(_):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(_)):k(_)}function k(_){return n(_)}function S(_){return e.enter("tableRow"),E(_)}function E(_){return _===124?(e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),E):_===null||Cn(_)?(e.exit("tableRow"),t(_)):wi(_)?Ui(e,E,"whitespace")(_):(e.enter("data"),C(_))}function C(_){return _===null||_===124||Ar(_)?(e.exit("data"),E(_)):(e.consume(_),_===92?N:C)}function N(_){return _===92||_===124?(e.consume(_),C):C(_)}}function imt(e,t){let n=-1,i=!0,r=0,s=[0,0,0,0],a=[0,0,0,0],l=!1,c=0,u,d,f;const h=new Zpt;for(;++nn[2]+1){const g=n[2]+1,b=n[3]-n[2]-1;e.add(g,b,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return r!==void 0&&(s.end=Object.assign({},ny(t.events,r)),e.add(r,0,[["exit",s,t]]),s=void 0),s}function WX(e,t,n,i,r){const s=[],a=ny(t.events,n);r&&(r.end=Object.assign({},a),s.push(["exit",r,t])),i.end=Object.assign({},a),s.push(["exit",i,t]),e.add(n+1,0,s)}function ny(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const rmt={name:"tasklistCheck",tokenize:amt};function smt(){return{text:{91:rmt}}}function amt(e,t,n){const i=this;return r;function r(c){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),s)}function s(c){return Ar(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 Cn(c)?t(c):wi(c)?e.check({tokenize:omt},t,n)(c):n(c)}}function omt(e,t,n){return Ui(e,i,"whitespace");function i(r){return r===null?n(r):t(r)}}function lmt(e){return hSe([Ipt(),zpt(),Ypt(e),tmt(),smt()])}const cmt={};function umt(e){const t=this,n=e||cmt,i=t.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),s=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),a=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(lmt(n)),s.push(_pt()),a.push(Npt(n))}const GX=function(e,t,n){const i=yE(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 ake(e,t,n){return e.type==="element"?ymt(e,t,n):e.type==="text"?n.whitespace==="normal"?oke(e,n):vmt(e):[]}function ymt(e,t,n){const i=lke(e,n),r=e.children||[];let s=-1,a=[];if(gmt(e))return a;let l,c;for(F6(e)||ZX(e)&&GX(t,e,ZX)?c=` -`:mmt(e)?(l=2,c=2):ske(e)&&(l=1,c=1);++s]+>")+")",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(r)+e.IDENT_RE,relevance:0},p=t.optional(r)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["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"],w={type:b,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},S=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:S.concat([{begin:/\(/,end:/\)/,keywords:w,contains:S.concat(["self"]),relevance:0}]),relevance:0},C={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:w,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: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:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:w,illegal:"",keywords:w,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:w},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Cmt(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=Emt(e),i=n.keywords;return i.type=[...i.type,...t.type],i.literal=[...i.literal,...t.literal],i.built_in=[...i.built_in,...t.built_in],i._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function ZB(e){const t=e.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s=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,r]};r.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}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},b=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],y={match:/(\/[a-z._-]+)+/},x=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],O=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],w=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],k=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:b,literal:v,built_in:[...x,...O,"set","shopt",...w,...k]},contains:[p,e.SHEBANG(),g,f,s,a,y,l,c,u,d,n]}}function Tmt(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",a="("+i+"|"+t.optional(r)+"[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(r)+e.IDENT_RE,relevance:0},p=t.optional(r)+e.IDENT_RE+"\\s*\\(",v={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],x={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:y.concat([{begin:/\(/,end:/\)/,keywords:v,contains:y.concat(["self"]),relevance:0}]),relevance:0},O={begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:v,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:v,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:v,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:v}}}function Amt(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",a="(?!struct)("+i+"|"+t.optional(r)+"[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(r)+e.IDENT_RE,relevance:0},p=t.optional(r)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["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"],w={type:b,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},S=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:S.concat([{begin:/\(/,end:/\)/,keywords:w,contains:S.concat(["self"]),relevance:0}]),relevance:0},C={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:w,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: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:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:w,illegal:"",keywords:w,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:w},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function _mt(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"],i=["default","false","null","true"],r=["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"],s=["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:r.concat(s),built_in:t,literal:i},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/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,p]},b={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},v=e.inherit(b,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});h.contains=[b,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],p.contains=[v,g,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[u,b,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},x={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},O=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",w={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,x,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,x,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+O+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,x],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[y,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},w]}}const Nmt=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_-]*/}}),jmt=["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"],Rmt=["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"],Imt=[...jmt,...Rmt],Pmt=["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(),Dmt=["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(),Mmt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Lmt=["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 $mt(e){const t=e.regex,n=Nmt(e),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",s=/@-?\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,i,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:":("+Dmt.join("|")+")"},{begin:":(:)?("+Mmt.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Lmt.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:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:Pmt.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Imt.join("|")+")\\b"}]}}function Fmt(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 Bmt(e){const s={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:s,illegal:"uke(e,t,n-1))}function Qmt(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+uke("(?:<"+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:["(?:"+i+"\\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,JX,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},JX,u]}}const eY="[A-Za-z$_][0-9A-Za-z$_]*",zmt=["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"],Vmt=["true","false","null","undefined","NaN","Infinity"],dke=["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"],fke=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],hke=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Hmt=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],qmt=[].concat(hke,dke,fke);function pke(e){const t=e.regex,n=(M,{after:U})=>{const I="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,U)=>{const I=M[0].length+M.index,H=M.input[I];if(H==="<"||H===","){U.ignoreMatch();return}H===">"&&(n(M,{after:I})||U.ignoreMatch());let K;const Q=M.input.substring(I);if(K=Q.match(/^\s*=/)){U.ignoreMatch();return}if((K=Q.match(/^\s+extends\s+/))&&K.index===0){U.ignoreMatch();return}}},l={$pattern:eY,keyword:zmt,literal:Vmt,built_in:qmt,"variable.language":Hmt},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"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},x={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},O=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,b,v,{match:/\$\d+/},f];h.contains=O.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(O)});const w=[].concat(x,h.contains),k=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(w)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},E={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},C={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:{_:[...dke,...fke]}},N={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},_={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function A(M){return t.concat("(?!",M.join("|"),")")}const F={match:t.concat(/\b/,A([...hke,"super","import"].map(M=>`${M}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},T={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},P={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},S]},R="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",L={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(R)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),N,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,b,v,x,{match:/\$\d+/},f,C,{scope:"attr",match:i+t.lookahead(":"),relevance:0},L,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,e.REGEXP_MODE,{className:"function",begin:R,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:r.begin,end:r.end},{match:s},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},_,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[S,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},T,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[S]},F,j,E,P,{match:/\$[(.]/}]}}function mke(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],r={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[t,n,e.QUOTE_STRING_MODE,r,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var ry="[0-9](_*[0-9])*",_T=`\\.(${ry})`,NT="[0-9a-fA-F](_*[0-9a-fA-F])*",Wmt={className:"number",variants:[{begin:`(\\b(${ry})((${_T})|\\.)?|(${_T}))[eE][+-]?(${ry})[fFdD]?\\b`},{begin:`\\b(${ry})((${_T})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${_T})[fFdD]?\\b`},{begin:`\\b(${ry})[fFdD]\\b`},{begin:`\\b0[xX]((${NT})\\.?|(${NT})?\\.(${NT}))[pP][+-]?(${ry})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${NT})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Gmt(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+/}]}},i={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,r]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,r]}]};r.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=Wmt,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,i,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:` +`:mmt(e)?(l=2,c=2):ske(e)&&(l=1,c=1);++s]+>")+")",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(r)+e.IDENT_RE,relevance:0},p=t.optional(r)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["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"],w={type:b,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},S=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:S.concat([{begin:/\(/,end:/\)/,keywords:w,contains:S.concat(["self"]),relevance:0}]),relevance:0},C={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:w,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: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:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:w,illegal:"",keywords:w,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:w},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Cmt(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=Emt(e),i=n.keywords;return i.type=[...i.type,...t.type],i.literal=[...i.literal,...t.literal],i.built_in=[...i.built_in,...t.built_in],i._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function ZB(e){const t=e.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s=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,r]};r.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}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},b=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],y={match:/(\/[a-z._-]+)+/},x=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],O=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],w=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],k=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:b,literal:v,built_in:[...x,...O,"set","shopt",...w,...k]},contains:[p,e.SHEBANG(),g,f,s,a,y,l,c,u,d,n]}}function Tmt(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",a="("+i+"|"+t.optional(r)+"[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(r)+e.IDENT_RE,relevance:0},p=t.optional(r)+e.IDENT_RE+"\\s*\\(",v={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],x={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:y.concat([{begin:/\(/,end:/\)/,keywords:v,contains:y.concat(["self"]),relevance:0}]),relevance:0},O={begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:v,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:v,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:v,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:v}}}function Amt(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",a="(?!struct)("+i+"|"+t.optional(r)+"[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(r)+e.IDENT_RE,relevance:0},p=t.optional(r)+e.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["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"],w={type:b,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},S=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:S.concat([{begin:/\(/,end:/\)/,keywords:w,contains:S.concat(["self"]),relevance:0}]),relevance:0},C={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:w,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: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:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:w,illegal:"",keywords:w,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:w},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function _mt(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"],i=["default","false","null","true"],r=["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"],s=["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:r.concat(s),built_in:t,literal:i},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/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,p]},b={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},v=e.inherit(b,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});h.contains=[b,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],p.contains=[v,g,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[u,b,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},x={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},O=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",w={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,x,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,x,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+O+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,x],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[y,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},w]}}const Nmt=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_-]*/}}),jmt=["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"],Rmt=["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"],Imt=[...jmt,...Rmt],Pmt=["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(),Dmt=["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(),Mmt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Lmt=["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 $mt(e){const t=e.regex,n=Nmt(e),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",s=/@-?\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,i,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:":("+Dmt.join("|")+")"},{begin:":(:)?("+Mmt.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Lmt.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:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:Pmt.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Imt.join("|")+")\\b"}]}}function Fmt(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 Bmt(e){const s={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:s,illegal:"uke(e,t,n-1))}function Qmt(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+uke("(?:<"+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:["(?:"+i+"\\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,JX,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},JX,u]}}const eY="[A-Za-z$_][0-9A-Za-z$_]*",zmt=["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"],Vmt=["true","false","null","undefined","NaN","Infinity"],dke=["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"],fke=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],hke=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Hmt=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],qmt=[].concat(hke,dke,fke);function pke(e){const t=e.regex,n=(M,{after:U})=>{const I="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,U)=>{const I=M[0].length+M.index,H=M.input[I];if(H==="<"||H===","){U.ignoreMatch();return}H===">"&&(n(M,{after:I})||U.ignoreMatch());let Z;const Q=M.input.substring(I);if(Z=Q.match(/^\s*=/)){U.ignoreMatch();return}if((Z=Q.match(/^\s+extends\s+/))&&Z.index===0){U.ignoreMatch();return}}},l={$pattern:eY,keyword:zmt,literal:Vmt,built_in:qmt,"variable.language":Hmt},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"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},x={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},O=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,b,v,{match:/\$\d+/},f];h.contains=O.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(O)});const w=[].concat(x,h.contains),k=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(w)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},E={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},C={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:{_:[...dke,...fke]}},N={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},_={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function A(M){return t.concat("(?!",M.join("|"),")")}const F={match:t.concat(/\b/,A([...hke,"super","import"].map(M=>`${M}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},T={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},P={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},S]},R="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",L={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(R)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),N,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,b,v,x,{match:/\$\d+/},f,C,{scope:"attr",match:i+t.lookahead(":"),relevance:0},L,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,e.REGEXP_MODE,{className:"function",begin:R,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:r.begin,end:r.end},{match:s},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},_,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[S,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},T,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[S]},F,j,E,P,{match:/\$[(.]/}]}}function mke(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],r={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[t,n,e.QUOTE_STRING_MODE,r,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var ry="[0-9](_*[0-9])*",_T=`\\.(${ry})`,NT="[0-9a-fA-F](_*[0-9a-fA-F])*",Wmt={className:"number",variants:[{begin:`(\\b(${ry})((${_T})|\\.)?|(${_T}))[eE][+-]?(${ry})[fFdD]?\\b`},{begin:`\\b(${ry})((${_T})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${_T})[fFdD]?\\b`},{begin:`\\b(${ry})[fFdD]\\b`},{begin:`\\b0[xX]((${NT})\\.?|(${NT})?\\.(${NT}))[pP][+-]?(${ry})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${NT})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Gmt(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+/}]}},i={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,r]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,r]}]};r.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=Wmt,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,i,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 Kmt=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_-]*/}}),Xmt=["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"],Ymt=["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"],Zmt=[...Xmt,...Ymt],Jmt=["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(),gke=["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(),bke=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),egt=["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(),tgt=gke.concat(bke).sort().reverse();function ngt(e){const t=Kmt(e),n=tgt,i="and or not only",r="[\\w-]+",s="("+r+"|@\\{"+r+"\\})",a=[],l=[],c=function(O){return{className:"string",begin:"~?"+O+".*?"+O}},u=function(O,w,k){return{className:O,begin:w,relevance:k}},d={$pattern:/[a-z-]+/,keyword:i,attribute:Jmt.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","@@?"+r,10),u("variable","@\\{"+r+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:r+"\\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)},g={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+egt.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},b={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:l,relevance:0}},v={className:"variable",variants:[{begin:"@"+r+"\\s*:",relevance:15},{begin:"@"+r}],starts:{end:"[;}]",returnEnd:!0,contains:h}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,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","@\\{"+r+"\\}"),{begin:"\\b("+Zmt.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,u("selector-tag",s,0),u("selector-id","#"+s),u("selector-class","\\."+s,0),u("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+gke.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+bke.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},x={begin:r+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,v,x,g,y,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function igt(e){const t="\\[=*\\[",n="\\]=*\\]",i={begin:t,end:n,contains:["self"]},r=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[i],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:r.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:r}].concat(r)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[i],relevance:5}])}}function yke(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},r={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}]},s={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,s,u,d,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},r,i,c,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function rgt(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 sgt(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"],i=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},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,s,c],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(b,v,y="\\1")=>{const x=y==="\\1"?y:t.concat(y,v);return t.concat(t.concat("(?:",b,")"),v,/(?:\\.|[^\\\/])*?/,x,/(?:\\.|[^\\\/])*?/,y,i)},p=(b,v,y)=>t.concat(t.concat("(?:",b,")"),v,/(?:\\.|[^\\\/])*?/,y,i),g=[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 s.contains=g,a.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:g}}function agt(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,i=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),r=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),s=t.concat(/[A-Z]+/,n),a={scope:"variable",match:"\\$+"+i},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":(T,P)=>{P.data._beginMatch=T[1]||T[2]},"on:end":(T,P)=>{P.data._beginMatch!==T[1]&&P.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[ -]`,g={scope:"string",variants:[d,u,f,h]},b={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},v=["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"],x=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],w={keyword:y,literal:(T=>{const P=[];return T.forEach(R=>{P.push(R),R.toLowerCase()===R?P.push(R.toUpperCase()):P.push(R.toLowerCase())}),P})(v),built_in:x},k=T=>T.map(P=>P.replace(/\|\d+$/,"")),S={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",k(x).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},E=t.concat(i,"\\b(?!\\()"),C={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),E],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat(/::/,t.lookahead(/(?!class\b)/)),E],scope:{1:"title.class",3:"variable.constant"}},{match:[r,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},N={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},_={relevance:0,begin:/\(/,end:/\)/,keywords:w,contains:[N,a,C,e.C_BLOCK_COMMENT_MODE,g,b,S]},j={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",k(y).join("\\b|"),"|",k(x).join("\\b|"),"\\b)"),i,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[_]};_.contains.push(j);const A=[N,C,e.C_BLOCK_COMMENT_MODE,g,b,S],F={begin:t.concat(/#\[\s*\\?/,t.either(r,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...A]},...A,{scope:"meta",variants:[{match:r},{match:s}]}]};return{case_insensitive:!1,keywords:w,contains:[F,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,C,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},S,{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:w,contains:["self",F,a,C,e.C_BLOCK_COMMENT_MODE,g,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},g,b]}}function ogt(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 lgt(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function xke(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["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:i,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})\\.`,g=`\\b|${i.join("|")}`,b={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${p}))[eE][+-]?(${h})[jJ]?(?=${g})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${h})[jJ](?=${g})`}]},v={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,b,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,b,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,b,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,v,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:[b,y,f]}]}}function cgt(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function ugt(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,i=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]?/),r=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=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:[r,i]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,i]},{scope:{1:"punctuation",2:"number"},match:[s,i]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,i]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:r},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function dgt(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),r=t.concat(i,/(::\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])*",g={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},b={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},S=[f,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:a},{relevance:0,match:[r,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:i,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[b]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},g,{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=S,b.contains=S;const _=[{begin:/^\s*=>/,starts:{end:"$",contains:S}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:S}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(_).concat(u).concat(S)}}function fgt(e){const t=e.regex,n=/(r#)?/,i=t.concat(n,e.UNDERSCORE_IDENT_RE),r=t.concat(n,e.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,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:""},s]}}const hgt=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_-]*/}}),pgt=["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"],mgt=["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"],ggt=[...pgt,...mgt],bgt=["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(),ygt=["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(),vgt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),xgt=["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 wgt(e){const t=hgt(e),n=vgt,i=ygt,r="@[a-z-]+",s="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("+ggt.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+xgt.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:r,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:bgt.join(" ")},contains:[{begin:r,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 Ogt(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function Sgt(e){const t=e.regex,n=e.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["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,g=[...u,...c].filter(k=>!d.includes(k)),b={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function x(k){return t.concat(/\b/,t.either(...k.map(S=>S.replace(/\s+/,"\\s+"))),/\b/)}const O={scope:"keyword",match:x(h),relevance:0};function w(k,{exceptions:S,when:E}={}){const C=E;return S=S||[],k.map(N=>N.match(/\|\d+$/)||S.includes(N)?N:C(N)?`${N}|0`:N)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:w(g,{when:k=>k.length<3}),literal:s,type:l,built_in:f},contains:[{scope:"type",match:x(a)},O,y,b,i,r,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function wke(e){return e?typeof e=="string"?e:e.source:null}function q1(e){return gr("(?=",e,")")}function gr(...e){return e.map(n=>wke(n)).join("")}function kgt(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Ro(...e){return"("+(kgt(e).capture?"":"?:")+e.map(i=>wke(i)).join("|")+")"}const JB=e=>gr(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Egt=["Protocol","Type"].map(JB),tY=["init","self"].map(JB),Cgt=["Any","Self"],PM=["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"],nY=["false","nil","true"],Tgt=["assignment","associativity","higherThan","left","lowerThan","none","right"],Agt=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],iY=["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"],Oke=Ro(/[/=\-+!*%<>&|^~?]/,/[\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]/),Ske=Ro(Oke,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),DM=gr(Oke,Ske,"*"),kke=Ro(/[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]/),hN=Ro(kke,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),dd=gr(kke,hN,"*"),jT=gr(/[A-Z]/,hN,"*"),_gt=["attached","autoclosure",gr(/convention\(/,Ro("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",gr(/objc\(/,dd,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Ngt=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function jgt(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,n],r={match:[/\./,Ro(...Egt,...tY)],className:{2:"keyword"}},s={match:gr(/\./,Ro(...PM)),relevance:0},a=PM.filter(Se=>typeof Se=="string").concat(["_|0"]),l=PM.filter(Se=>typeof Se!="string").concat(Cgt).map(JB),c={variants:[{className:"keyword",match:Ro(...l,...tY)}]},u={$pattern:Ro(/\b\w+/,/#\w+/),keyword:a.concat(Agt),literal:nY},d=[r,s,c],f={match:gr(/\./,Ro(...iY)),relevance:0},h={className:"built_in",match:gr(/\b/,Ro(...iY),/(?=\()/)},p=[f,h],g={match:/->/,relevance:0},b={className:"operator",relevance:0,variants:[{match:DM},{match:`\\.(\\.|${Ske})+`}]},v=[g,b],y="([0-9]_*)+",x="([0-9a-fA-F]_*)+",O={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${x})(\\.(${x}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},w=(Se="")=>({className:"subst",variants:[{match:gr(/\\/,Se,/[0\\tnr"']/)},{match:gr(/\\/,Se,/u\{[0-9a-fA-F]{1,8}\}/)}]}),k=(Se="")=>({className:"subst",match:gr(/\\/,Se,/[\t ]*(?:[\r\n]|\r\n)/)}),S=(Se="")=>({className:"subst",label:"interpol",begin:gr(/\\/,Se,/\(/),end:/\)/}),E=(Se="")=>({begin:gr(Se,/"""/),end:gr(/"""/,Se),contains:[w(Se),k(Se),S(Se)]}),C=(Se="")=>({begin:gr(Se,/"/),end:gr(/"/,Se),contains:[w(Se),S(Se)]}),N={className:"string",variants:[E(),E("#"),E("##"),E("###"),C(),C("#"),C("##"),C("###")]},_=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],j={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:_},A=Se=>{const lt=gr(Se,/\//),$e=gr(/\//,Se);return{begin:lt,end:$e,contains:[..._,{scope:"comment",begin:`#(?!.*${$e})`,end:/$/}]}},F={scope:"regexp",variants:[A("###"),A("##"),A("#"),j]},T={match:gr(/`/,dd,/`/)},P={className:"variable",match:/\$\d+/},R={className:"variable",match:`\\$${hN}+`},L=[T,P,R],M={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Ngt,contains:[...v,O,N]}]}},U={scope:"keyword",match:gr(/@/,Ro(..._gt),q1(Ro(/\(/,/\s+/)))},I={scope:"meta",match:gr(/@/,dd)},H=[M,U,I],K={match:q1(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:gr(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,hN,"+")},{className:"type",match:jT,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:gr(/\s+&\s+/,q1(jT)),relevance:0}]},Q={begin://,keywords:u,contains:[...i,...d,...H,g,K]};K.contains.push(Q);const q={match:gr(dd,/\s*:/),keywords:"_|0",relevance:0},B={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",q,...i,F,...d,...p,...v,O,N,...L,...H,K]},ee={begin://,keywords:"repeat each",contains:[...i,K]},le={begin:Ro(q1(gr(dd,/\s*:/)),q1(gr(dd,/\s+/,dd,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:dd}]},se={begin:/\(/,end:/\)/,keywords:u,contains:[le,...i,...d,...v,O,N,...H,K,B],endsParent:!0,illegal:/["']/},re={match:[/(func|macro)/,/\s+/,Ro(T.match,dd,DM)],className:{1:"keyword",3:"title.function"},contains:[ee,se,t],illegal:[/\[/,/%/]},ge={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ee,se,t],illegal:/\[|%/},W={match:[/operator/,/\s+/,DM],className:{1:"keyword",3:"title"}},X={begin:[/precedencegroup/,/\s+/,jT],className:{1:"keyword",3:"title"},contains:[K],keywords:[...Tgt,...nY],end:/}/},ae={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},ue={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Oe={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,dd,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[ee,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:jT},...d],relevance:0}]};for(const Se of N.variants){const lt=Se.contains.find(Le=>Le.label==="interpol");lt.keywords=u;const $e=[...d,...p,...v,O,N,...L];lt.contains=[...$e,{begin:/\(/,end:/\)/,contains:["self",...$e]}]}return{name:"Swift",keywords:u,contains:[...i,re,ge,ae,ue,Oe,W,X,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},F,...d,...p,...v,O,N,...L,...H,K,B]}}const pN="[A-Za-z$_][0-9A-Za-z$_]*",Eke=["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"],Cke=["true","false","null","undefined","NaN","Infinity"],Tke=["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"],Ake=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],_ke=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Nke=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],jke=[].concat(_ke,Tke,Ake);function Rgt(e){const t=e.regex,n=(M,{after:U})=>{const I="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,U)=>{const I=M[0].length+M.index,H=M.input[I];if(H==="<"||H===","){U.ignoreMatch();return}H===">"&&(n(M,{after:I})||U.ignoreMatch());let K;const Q=M.input.substring(I);if(K=Q.match(/^\s*=/)){U.ignoreMatch();return}if((K=Q.match(/^\s+extends\s+/))&&K.index===0){U.ignoreMatch();return}}},l={$pattern:pN,keyword:Eke,literal:Cke,built_in:jke,"variable.language":Nke},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"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},x={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},O=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,b,v,{match:/\$\d+/},f];h.contains=O.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(O)});const w=[].concat(x,h.contains),k=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(w)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},E={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},C={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:{_:[...Tke,...Ake]}},N={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},_={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function A(M){return t.concat("(?!",M.join("|"),")")}const F={match:t.concat(/\b/,A([..._ke,"super","import"].map(M=>`${M}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},T={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},P={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},S]},R="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",L={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(R)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),N,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,b,v,x,{match:/\$\d+/},f,C,{scope:"attr",match:i+t.lookahead(":"),relevance:0},L,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,e.REGEXP_MODE,{className:"function",begin:R,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:r.begin,end:r.end},{match:s},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},_,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[S,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},T,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[S]},F,j,E,P,{match:/\$[(.]/}]}}function Rke(e){const t=e.regex,n=Rgt(e),i=pN,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},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:pN,keyword:Eke.concat(c),literal:Cke,built_in:jke.concat(r),"variable.language":Nke},d={className:"meta",begin:"@"+i},f=(b,v,y)=>{const x=b.contains.findIndex(O=>O.label===v);if(x===-1)throw new Error("can not find mode to replace");b.contains.splice(x,1,y)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(b=>b.scope==="attr"),p=Object.assign({},h,{match:t.concat(i,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,p]),n.contains=n.contains.concat([d,s,a,p]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",l);const g=n.contains.find(b=>b.label==="func.def");return g.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Igt(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},i={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},r=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\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(s,r),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(s,r),/ +/,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,i,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 Pgt(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),i=["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"],r={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={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:i},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,a,r,e.QUOTE_STRING_MODE,c,u,l]}}function Dgt(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(s,{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:[s,c,l,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[s,a,c,l]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},r,{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 Ike(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={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,r]},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},g={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},v=[i,{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},g,b,s,a],y=[...v];return y.pop(),y.push(l),p.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const Mgt={arduino:Cmt,bash:ZB,c:Tmt,cpp:Amt,csharp:_mt,css:$mt,diff:Fmt,go:Bmt,graphql:Umt,ini:cke,java:Qmt,javascript:pke,json:mke,kotlin:Gmt,less:ngt,lua:igt,makefile:yke,markdown:vke,objectivec:rgt,perl:sgt,php:agt,"php-template":ogt,plaintext:lgt,python:xke,"python-repl":cgt,r:ugt,ruby:dgt,rust:fgt,scss:wgt,shell:Ogt,sql:Sgt,swift:jgt,typescript:Rke,vbnet:Igt,wasm:Pgt,xml:Dgt,yaml:Ike};function Pke(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],i=typeof n;(i==="object"||i==="function")&&!Object.isFrozen(n)&&Pke(n)}),e}let rY=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function Dke(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Bp(e,...t){const n=Object.create(null);for(const i in e)n[i]=e[i];return t.forEach(function(i){for(const r in i)n[r]=i[r]}),n}const Lgt="",sY=e=>!!e.scope,$gt=(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((i,r)=>`${i}${"_".repeat(r+1)}`)].join(" ")}return`${t}${e}`};class Fgt{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=Dke(t)}openNode(t){if(!sY(t))return;const n=$gt(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){sY(t)&&(this.buffer+=Lgt)}value(){return this.buffer}span(t){this.buffer+=``}}const aY=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class eU{constructor(){this.rootNode=aY(),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=aY({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(i=>this._walk(t,i)),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=>{eU._collapse(n)}))}}class Bgt extends eU{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const i=t.root;n&&(i.scope=`language:${n}`),this.add(i)}toHTML(){return new Fgt(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function QS(e){return e?typeof e=="string"?e:e.source:null}function Mke(e){return i0("(?=",e,")")}function Ugt(e){return i0("(?:",e,")*")}function Qgt(e){return i0("(?:",e,")?")}function i0(...e){return e.map(n=>QS(n)).join("")}function zgt(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function tU(...e){return"("+(zgt(e).capture?"":"?:")+e.map(i=>QS(i)).join("|")+")"}function Lke(e){return new RegExp(e.toString()+"|").exec("").length-1}function Vgt(e,t){const n=e&&e.exec(t);return n&&n.index===0}const Hgt=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function nU(e,{joinWith:t}){let n=0;return e.map(i=>{n+=1;const r=n;let s=QS(i),a="";for(;s.length>0;){const l=Hgt.exec(s);if(!l){a+=s;break}a+=s.substring(0,l.index),s=s.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?a+="\\"+String(Number(l[1])+r):(a+=l[0],l[0]==="("&&n++)}return a}).map(i=>`(${i})`).join(t)}const qgt=/\b\B/,$ke="[a-zA-Z]\\w*",iU="[a-zA-Z_]\\w*",Fke="\\b\\d+(\\.\\d+)?",Bke="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Uke="\\b(0b[01]+)",Wgt="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Ggt=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=i0(t,/.*\b/,e.binary,/\b.*/)),Bp({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},e)},zS={begin:"\\\\[\\s\\S]",relevance:0},Kgt={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[zS]},Xgt={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[zS]},Ygt={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/},JR=function(e,t,n={}){const i=Bp({scope:"comment",begin:e,end:t,contains:[]},n);i.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 r=tU("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 i.contains.push({begin:i0(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},Zgt=JR("//","$"),Jgt=JR("/\\*","\\*/"),ebt=JR("#","$"),tbt={scope:"number",begin:Fke,relevance:0},nbt={scope:"number",begin:Bke,relevance:0},ibt={scope:"number",begin:Uke,relevance:0},rbt={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[zS,{begin:/\[/,end:/\]/,relevance:0,contains:[zS]}]},sbt={scope:"title",begin:$ke,relevance:0},abt={scope:"title",begin:iU,relevance:0},obt={begin:"\\.\\s*"+iU,relevance:0},lbt=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 RT=Object.freeze({__proto__:null,APOS_STRING_MODE:Kgt,BACKSLASH_ESCAPE:zS,BINARY_NUMBER_MODE:ibt,BINARY_NUMBER_RE:Uke,COMMENT:JR,C_BLOCK_COMMENT_MODE:Jgt,C_LINE_COMMENT_MODE:Zgt,C_NUMBER_MODE:nbt,C_NUMBER_RE:Bke,END_SAME_AS_BEGIN:lbt,HASH_COMMENT_MODE:ebt,IDENT_RE:$ke,MATCH_NOTHING_RE:qgt,METHOD_GUARD:obt,NUMBER_MODE:tbt,NUMBER_RE:Fke,PHRASAL_WORDS_MODE:Ygt,QUOTE_STRING_MODE:Xgt,REGEXP_MODE:rbt,RE_STARTERS_RE:Wgt,SHEBANG:Ggt,TITLE_MODE:sbt,UNDERSCORE_IDENT_RE:iU,UNDERSCORE_TITLE_MODE:abt});function cbt(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function ubt(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function dbt(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=cbt,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function fbt(e,t){Array.isArray(e.illegal)&&(e.illegal=tU(...e.illegal))}function hbt(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 pbt(e,t){e.relevance===void 0&&(e.relevance=1)}const mbt=(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(i=>{delete e[i]}),e.keywords=n.keywords,e.begin=i0(n.beforeMatch,Mke(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},gbt=["of","and","for","in","not","or","if","then","parent","list","value"],bbt="keyword";function Qke(e,t,n=bbt){const i=Object.create(null);return typeof e=="string"?r(n,e.split(" ")):Array.isArray(e)?r(n,e):Object.keys(e).forEach(function(s){Object.assign(i,Qke(e[s],t,s))}),i;function r(s,a){t&&(a=a.map(l=>l.toLowerCase())),a.forEach(function(l){const c=l.split("|");i[c[0]]=[s,ybt(c[0],c[1])]})}}function ybt(e,t){return t?Number(t):vbt(e)?0:1}function vbt(e){return gbt.includes(e.toLowerCase())}const oY={},sb=e=>{console.error(e)},lY=(e,...t)=>{console.log(`WARN: ${e}`,...t)},$0=(e,t)=>{oY[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),oY[`${e}/${t}`]=!0)},mN=new Error;function zke(e,t,{key:n}){let i=0;const r=e[n],s={},a={};for(let l=1;l<=t.length;l++)a[l+i]=r[l],s[l+i]=!0,i+=Lke(t[l-1]);e[n]=a,e[n]._emit=s,e[n]._multi=!0}function xbt(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw sb("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),mN;if(typeof e.beginScope!="object"||e.beginScope===null)throw sb("beginScope must be object"),mN;zke(e,e.begin,{key:"beginScope"}),e.begin=nU(e.begin,{joinWith:""})}}function wbt(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw sb("skip, excludeEnd, returnEnd not compatible with endScope: {}"),mN;if(typeof e.endScope!="object"||e.endScope===null)throw sb("endScope must be object"),mN;zke(e,e.end,{key:"endScope"}),e.end=nU(e.end,{joinWith:""})}}function Obt(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Sbt(e){Obt(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),xbt(e),wbt(e)}function kbt(e){function t(a,l){return new RegExp(QS(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+=Lke(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(nU(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 i{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 r(a){const l=new i;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 s(a,l){const c=a;if(a.isCompiled)return c;[ubt,hbt,Sbt,mbt].forEach(d=>d(a,l)),e.compilerExtensions.forEach(d=>d(a,l)),a.__beforeBegin=null,[dbt,fbt,pbt].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=Qke(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=QS(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 Ebt(d==="self"?a:d)})),a.contains.forEach(function(d){s(d,c)}),a.starts&&s(a.starts,l),c.matcher=r(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=Bp(e.classNameAliases||{}),s(e)}function Vke(e){return e?e.endsWithParent||Vke(e.starts):!1}function Ebt(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Bp(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Vke(e)?Bp(e,{starts:e.starts?Bp(e.starts):null}):Object.isFrozen(e)?Bp(e):e}var Cbt="11.11.1";class Tbt extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const MM=Dke,cY=Bp,uY=Symbol("nomatch"),Abt=7,Hke=function(e){const t=Object.create(null),n=Object.create(null),i=[];let r=!0;const s="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:Bgt};function c(R){return l.noHighlightRe.test(R)}function u(R){let L=R.className+" ";L+=R.parentNode?R.parentNode.className:"";const M=l.languageDetectRe.exec(L);if(M){const U=C(M[1]);return U||(lY(s.replace("{}",M[1])),lY("Falling back to no-highlight mode for this block.",R)),U?M[1]:"no-highlight"}return L.split(/\s+/).find(U=>c(U)||C(U))}function d(R,L,M){let U="",I="";typeof L=="object"?(U=R,M=L.ignoreIllegals,I=L.language):($0("10.7.0","highlight(lang, code, ...args) has been deprecated."),$0("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),I=R,U=L),M===void 0&&(M=!0);const H={code:U,language:I};T("before:highlight",H);const K=H.result?H.result:f(H.language,H.code,M);return K.code=H.code,T("after:highlight",K),K}function f(R,L,M,U){const I=Object.create(null);function H(J,he){return J.keywords[he]}function K(){if(!$e.keywords){Ne.addText(qe);return}let J=0;$e.keywordPatternRe.lastIndex=0;let he=$e.keywordPatternRe.exec(qe),Ce="";for(;he;){Ce+=qe.substring(J,he.index);const Ze=Oe.case_insensitive?he[0].toLowerCase():he[0],at=H($e,Ze);if(at){const[St,Te]=at;if(Ne.addText(Ce),Ce="",I[Ze]=(I[Ze]||0)+1,I[Ze]<=Abt&&(Re+=Te),St.startsWith("_"))Ce+=he[0];else{const ye=Oe.classNameAliases[St]||St;B(he[0],ye)}}else Ce+=he[0];J=$e.keywordPatternRe.lastIndex,he=$e.keywordPatternRe.exec(qe)}Ce+=qe.substring(J),Ne.addText(Ce)}function Q(){if(qe==="")return;let J=null;if(typeof $e.subLanguage=="string"){if(!t[$e.subLanguage]){Ne.addText(qe);return}J=f($e.subLanguage,qe,!0,Le[$e.subLanguage]),Le[$e.subLanguage]=J._top}else J=p(qe,$e.subLanguage.length?$e.subLanguage:null);$e.relevance>0&&(Re+=J.relevance),Ne.__addSublanguage(J._emitter,J.language)}function q(){$e.subLanguage!=null?Q():K(),qe=""}function B(J,he){J!==""&&(Ne.startScope(he),Ne.addText(J),Ne.endScope())}function ee(J,he){let Ce=1;const Ze=he.length-1;for(;Ce<=Ze;){if(!J._emit[Ce]){Ce++;continue}const at=Oe.classNameAliases[J[Ce]]||J[Ce],St=he[Ce];at?B(St,at):(qe=St,K(),qe=""),Ce++}}function le(J,he){return J.scope&&typeof J.scope=="string"&&Ne.openNode(Oe.classNameAliases[J.scope]||J.scope),J.beginScope&&(J.beginScope._wrap?(B(qe,Oe.classNameAliases[J.beginScope._wrap]||J.beginScope._wrap),qe=""):J.beginScope._multi&&(ee(J.beginScope,he),qe="")),$e=Object.create(J,{parent:{value:$e}}),$e}function se(J,he,Ce){let Ze=Vgt(J.endRe,Ce);if(Ze){if(J["on:end"]){const at=new rY(J);J["on:end"](he,at),at.isMatchIgnored&&(Ze=!1)}if(Ze){for(;J.endsParent&&J.parent;)J=J.parent;return J}}if(J.endsWithParent)return se(J.parent,he,Ce)}function re(J){return $e.matcher.regexIndex===0?(qe+=J[0],1):(De=!0,0)}function ge(J){const he=J[0],Ce=J.rule,Ze=new rY(Ce),at=[Ce.__beforeBegin,Ce["on:begin"]];for(const St of at)if(St&&(St(J,Ze),Ze.isMatchIgnored))return re(he);return Ce.skip?qe+=he:(Ce.excludeBegin&&(qe+=he),q(),!Ce.returnBegin&&!Ce.excludeBegin&&(qe=he)),le(Ce,J),Ce.returnBegin?0:he.length}function W(J){const he=J[0],Ce=L.substring(J.index),Ze=se($e,J,Ce);if(!Ze)return uY;const at=$e;$e.endScope&&$e.endScope._wrap?(q(),B(he,$e.endScope._wrap)):$e.endScope&&$e.endScope._multi?(q(),ee($e.endScope,J)):at.skip?qe+=he:(at.returnEnd||at.excludeEnd||(qe+=he),q(),at.excludeEnd&&(qe=he));do $e.scope&&Ne.closeNode(),!$e.skip&&!$e.subLanguage&&(Re+=$e.relevance),$e=$e.parent;while($e!==Ze.parent);return Ze.starts&&le(Ze.starts,J),at.returnEnd?0:he.length}function X(){const J=[];for(let he=$e;he!==Oe;he=he.parent)he.scope&&J.unshift(he.scope);J.forEach(he=>Ne.openNode(he))}let ae={};function ue(J,he){const Ce=he&&he[0];if(qe+=J,Ce==null)return q(),0;if(ae.type==="begin"&&he.type==="end"&&ae.index===he.index&&Ce===""){if(qe+=L.slice(he.index,he.index+1),!r){const Ze=new Error(`0 width match regex (${R})`);throw Ze.languageName=R,Ze.badRule=ae.rule,Ze}return 1}if(ae=he,he.type==="begin")return ge(he);if(he.type==="illegal"&&!M){const Ze=new Error('Illegal lexeme "'+Ce+'" for mode "'+($e.scope||"")+'"');throw Ze.mode=$e,Ze}else if(he.type==="end"){const Ze=W(he);if(Ze!==uY)return Ze}if(he.type==="illegal"&&Ce==="")return qe+=` -`,1;if(Ee>1e5&&Ee>he.index*3)throw new Error("potential infinite loop, way more iterations than matches");return qe+=Ce,Ce.length}const Oe=C(R);if(!Oe)throw sb(s.replace("{}",R)),new Error('Unknown language: "'+R+'"');const Se=kbt(Oe);let lt="",$e=U||Se;const Le={},Ne=new l.__emitter(l);X();let qe="",Re=0,ze=0,Ee=0,De=!1;try{if(Oe.__emitTokens)Oe.__emitTokens(L,Ne);else{for($e.matcher.considerAll();;){Ee++,De?De=!1:$e.matcher.considerAll(),$e.matcher.lastIndex=ze;const J=$e.matcher.exec(L);if(!J)break;const he=L.substring(ze,J.index),Ce=ue(he,J);ze=J.index+Ce}ue(L.substring(ze))}return Ne.finalize(),lt=Ne.toHTML(),{language:R,value:lt,relevance:Re,illegal:!1,_emitter:Ne,_top:$e}}catch(J){if(J.message&&J.message.includes("Illegal"))return{language:R,value:MM(L),illegal:!0,relevance:0,_illegalBy:{message:J.message,index:ze,context:L.slice(ze-100,ze+100),mode:J.mode,resultSoFar:lt},_emitter:Ne};if(r)return{language:R,value:MM(L),illegal:!1,relevance:0,errorRaised:J,_emitter:Ne,_top:$e};throw J}}function h(R){const L={value:MM(R),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return L._emitter.addText(R),L}function p(R,L){L=L||l.languages||Object.keys(t);const M=h(R),U=L.filter(C).filter(_).map(q=>f(q,R,!1));U.unshift(M);const I=U.sort((q,B)=>{if(q.relevance!==B.relevance)return B.relevance-q.relevance;if(q.language&&B.language){if(C(q.language).supersetOf===B.language)return 1;if(C(B.language).supersetOf===q.language)return-1}return 0}),[H,K]=I,Q=H;return Q.secondBest=K,Q}function g(R,L,M){const U=L&&n[L]||M;R.classList.add("hljs"),R.classList.add(`language-${U}`)}function b(R){let L=null;const M=u(R);if(c(M))return;if(T("before:highlightElement",{el:R,language:M}),R.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",R);return}if(R.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(R)),l.throwUnescapedHTML))throw new Tbt("One of your code blocks includes unescaped HTML.",R.innerHTML);L=R;const U=L.textContent,I=M?d(U,{language:M,ignoreIllegals:!0}):p(U);R.innerHTML=I.value,R.dataset.highlighted="yes",g(R,M,I.language),R.result={language:I.language,re:I.relevance,relevance:I.relevance},I.secondBest&&(R.secondBest={language:I.secondBest.language,relevance:I.secondBest.relevance}),T("after:highlightElement",{el:R,result:I,text:U})}function v(R){l=cY(l,R)}const y=()=>{w(),$0("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function x(){w(),$0("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let O=!1;function w(){function R(){w()}if(document.readyState==="loading"){O||window.addEventListener("DOMContentLoaded",R,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(b)}function k(R,L){let M=null;try{M=L(e)}catch(U){if(sb("Language definition for '{}' could not be registered.".replace("{}",R)),r)sb(U);else throw U;M=a}M.name||(M.name=R),t[R]=M,M.rawDefinition=L.bind(null,e),M.aliases&&N(M.aliases,{languageName:R})}function S(R){delete t[R];for(const L of Object.keys(n))n[L]===R&&delete n[L]}function E(){return Object.keys(t)}function C(R){return R=(R||"").toLowerCase(),t[R]||t[n[R]]}function N(R,{languageName:L}){typeof R=="string"&&(R=[R]),R.forEach(M=>{n[M.toLowerCase()]=L})}function _(R){const L=C(R);return L&&!L.disableAutodetect}function j(R){R["before:highlightBlock"]&&!R["before:highlightElement"]&&(R["before:highlightElement"]=L=>{R["before:highlightBlock"](Object.assign({block:L.el},L))}),R["after:highlightBlock"]&&!R["after:highlightElement"]&&(R["after:highlightElement"]=L=>{R["after:highlightBlock"](Object.assign({block:L.el},L))})}function A(R){j(R),i.push(R)}function F(R){const L=i.indexOf(R);L!==-1&&i.splice(L,1)}function T(R,L){const M=R;i.forEach(function(U){U[M]&&U[M](L)})}function P(R){return $0("10.7.0","highlightBlock will be removed entirely in v12.0"),$0("10.7.0","Please use highlightElement now."),b(R)}Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:w,highlightElement:b,highlightBlock:P,configure:v,initHighlighting:y,initHighlightingOnLoad:x,registerLanguage:k,unregisterLanguage:S,listLanguages:E,getLanguage:C,registerAliases:N,autoDetection:_,inherit:cY,addPlugin:A,removePlugin:F}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=Cbt,e.regex={concat:i0,lookahead:Mke,either:tU,optional:Qgt,anyNumberOfTimes:Ugt};for(const R in RT)typeof RT[R]=="object"&&Pke(RT[R]);return Object.assign(e,RT),e},Jv=Hke({});Jv.newInstance=()=>Hke({});var _bt=Jv;Jv.HighlightJS=Jv;Jv.default=Jv;const vo=px(_bt),dY={},Nbt="hljs-";function jbt(e){const t=vo.newInstance();return e&&s(e),{highlight:n,highlightAuto:i,listLanguages:r,register:s,registerAlias:a,registered:l};function n(c,u,d){const f=d||dY,h=typeof f.prefix=="string"?f.prefix:Nbt;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:Rbt,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 g=p._emitter.root,b=g.data;return b.language=p.language,b.relevance=p.relevance,g}function i(c,u){const f=(u||dY).subset||r();let h=-1,p=0,g;for(;++hp&&(p=v.data.relevance,g=v)}return g||{type:"root",children:[],data:{language:void 0,relevance:p}}}function r(){return t.listLanguages()}function s(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 Rbt{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],i=n.children[n.children.length-1];i&&i.type==="text"?i.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const i=this.stack[this.stack.length-1],r=t.root.children;n?i.children.push({type:"element",tagName:"span",properties:{className:[n]},children:r}):i.children.push(...r)}openNode(t){const n=this,i=t.split(".").map(function(a,l){return l?a+"_".repeat(l):n.options.classPrefix+a}),r=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:i},children:[]};r.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const Ibt={};function fY(e){const t=e||Ibt,n=t.aliases,i=t.detect||!1,r=t.languages||Mgt,s=t.plainText,a=t.prefix,l=t.subset;let c="hljs";const u=jbt(r);if(n&&u.registerAlias(n),a){const d=a.indexOf("-");c=d===-1?a:a.slice(0,d)}return function(d,f){vE(d,"element",function(h,p,g){if(h.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const b=Pbt(h);if(b===!1||!b&&!i||b&&s&&s.includes(b))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(c)||h.properties.className.unshift(c);const v=bmt(h,{whitespace:"pre"});let y;try{y=b?u.highlight(b,v,{prefix:a}):u.highlightAuto(v,{prefix:a,subset:l})}catch(x){const O=x;if(b&&/Unknown language/.test(O.message)){f.message("Cannot highlight as `"+b+"`, it’s not registered",{ancestors:[g,h],cause:O,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw O}!b&&y.data&&y.data.language&&h.properties.className.push("language-"+y.data.language),y.children.length>0&&(h.children=y.children)})}}function Pbt(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let i;for(;++n-1&&s<=t.length){let a=0;for(;;){let l=n[a];if(l===void 0){const c=mY(t,n[a-1]);l=c===-1?t.length+1:c+1,n[a]=l}if(l>s)return{line:a+1,column:s-(a>0?n[a-1]:0)+1,offset:s};a++}}}function r(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length1?n[s.line-2]:0)+s.column-1;if(a=55296&&e<=57343}function a0t(e){return e>=56320&&e<=57343}function o0t(e,t){return(e-55296)*1024+9216+t}function Yke(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Zke(e){return e>=64976&&e<=65007||s0t.has(e)}var tt;(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"})(tt||(tt={}));const l0t=65536;class c0t{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=l0t,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:i,col:r,offset:s}=this,a=r+n,l=s+n;return{code:t,startLine:i,endLine:i,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(a0t(n))return this.pos++,this._addGap(),o0t(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,oe.EOF;return this._err(tt.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 i=0;i=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,oe.EOF;const i=this.html.charCodeAt(n);return i===oe.CARRIAGE_RETURN?oe.LINE_FEED:i}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,oe.EOF;let t=this.html.charCodeAt(this.pos);return t===oe.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,oe.LINE_FEED):t===oe.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Xke(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===oe.LINE_FEED||t===oe.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){Yke(t)?this._err(tt.controlCharacterInInputStream):Zke(t)&&this._err(tt.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 u0t=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))),d0t=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 f0t(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=d0t.get(e))!==null&&t!==void 0?t:e}var Da;(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"})(Da||(Da={}));const h0t=32;var Up;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Up||(Up={}));function U6(e){return e>=Da.ZERO&&e<=Da.NINE}function p0t(e){return e>=Da.UPPER_A&&e<=Da.UPPER_F||e>=Da.LOWER_A&&e<=Da.LOWER_F}function m0t(e){return e>=Da.UPPER_A&&e<=Da.UPPER_Z||e>=Da.LOWER_A&&e<=Da.LOWER_Z||U6(e)}function g0t(e){return e===Da.EQUALS||m0t(e)}var Ta;(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"})(Ta||(Ta={}));var Uf;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Uf||(Uf={}));class b0t{constructor(t,n,i){this.decodeTree=t,this.emitCodePoint=n,this.errors=i,this.state=Ta.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Uf.Strict}startEntity(t){this.decodeMode=t,this.state=Ta.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Ta.EntityStart:return t.charCodeAt(n)===Da.NUM?(this.state=Ta.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Ta.NamedEntity,this.stateNamedEntity(t,n));case Ta.NumericStart:return this.stateNumericStart(t,n);case Ta.NumericDecimal:return this.stateNumericDecimal(t,n);case Ta.NumericHex:return this.stateNumericHex(t,n);case Ta.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|h0t)===Da.LOWER_X?(this.state=Ta.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Ta.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,i,r){if(n!==i){const s=i-n;this.result=this.result*Math.pow(r,s)+Number.parseInt(t.substr(n,s),r),this.consumed+=s}}stateNumericHex(t,n){const i=n;for(;n>14;for(;n>14,s!==0){if(a===Da.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Uf.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:i}=this,r=(i[n]&Up.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,r,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,i){const{decodeTree:r}=this;return this.emitCodePoint(n===1?r[t]&~Up.VALUE_LENGTH:r[t+1],i),n===3&&this.emitCodePoint(r[t+2],i),i}end(){var t;switch(this.state){case Ta.NamedEntity:return this.result!==0&&(this.decodeMode!==Uf.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ta.NumericDecimal:return this.emitNumericEntity(0,2);case Ta.NumericHex:return this.emitNumericEntity(0,3);case Ta.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ta.EntityStart:return 0}}}function y0t(e,t,n,i){const r=(t&Up.BRANCH_LENGTH)>>7,s=t&Up.JUMP_TABLE;if(r===0)return s!==0&&i===s?n:-1;if(s){const c=i-s;return c<0||c>=r?-1:e[n+c]-1}let a=n,l=a+r-1;for(;a<=l;){const c=a+l>>>1,u=e[c];if(ui)l=c-1;else return e[c+r]}return-1}var bt;(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/"})(bt||(bt={}));var ab;(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"})(ab||(ab={}));var $c;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})($c||($c={}));var Be;(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"})(Be||(Be={}));var D;(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"})(D||(D={}));const v0t=new Map([[Be.A,D.A],[Be.ADDRESS,D.ADDRESS],[Be.ANNOTATION_XML,D.ANNOTATION_XML],[Be.APPLET,D.APPLET],[Be.AREA,D.AREA],[Be.ARTICLE,D.ARTICLE],[Be.ASIDE,D.ASIDE],[Be.B,D.B],[Be.BASE,D.BASE],[Be.BASEFONT,D.BASEFONT],[Be.BGSOUND,D.BGSOUND],[Be.BIG,D.BIG],[Be.BLOCKQUOTE,D.BLOCKQUOTE],[Be.BODY,D.BODY],[Be.BR,D.BR],[Be.BUTTON,D.BUTTON],[Be.CAPTION,D.CAPTION],[Be.CENTER,D.CENTER],[Be.CODE,D.CODE],[Be.COL,D.COL],[Be.COLGROUP,D.COLGROUP],[Be.DD,D.DD],[Be.DESC,D.DESC],[Be.DETAILS,D.DETAILS],[Be.DIALOG,D.DIALOG],[Be.DIR,D.DIR],[Be.DIV,D.DIV],[Be.DL,D.DL],[Be.DT,D.DT],[Be.EM,D.EM],[Be.EMBED,D.EMBED],[Be.FIELDSET,D.FIELDSET],[Be.FIGCAPTION,D.FIGCAPTION],[Be.FIGURE,D.FIGURE],[Be.FONT,D.FONT],[Be.FOOTER,D.FOOTER],[Be.FOREIGN_OBJECT,D.FOREIGN_OBJECT],[Be.FORM,D.FORM],[Be.FRAME,D.FRAME],[Be.FRAMESET,D.FRAMESET],[Be.H1,D.H1],[Be.H2,D.H2],[Be.H3,D.H3],[Be.H4,D.H4],[Be.H5,D.H5],[Be.H6,D.H6],[Be.HEAD,D.HEAD],[Be.HEADER,D.HEADER],[Be.HGROUP,D.HGROUP],[Be.HR,D.HR],[Be.HTML,D.HTML],[Be.I,D.I],[Be.IMG,D.IMG],[Be.IMAGE,D.IMAGE],[Be.INPUT,D.INPUT],[Be.IFRAME,D.IFRAME],[Be.KEYGEN,D.KEYGEN],[Be.LABEL,D.LABEL],[Be.LI,D.LI],[Be.LINK,D.LINK],[Be.LISTING,D.LISTING],[Be.MAIN,D.MAIN],[Be.MALIGNMARK,D.MALIGNMARK],[Be.MARQUEE,D.MARQUEE],[Be.MATH,D.MATH],[Be.MENU,D.MENU],[Be.META,D.META],[Be.MGLYPH,D.MGLYPH],[Be.MI,D.MI],[Be.MO,D.MO],[Be.MN,D.MN],[Be.MS,D.MS],[Be.MTEXT,D.MTEXT],[Be.NAV,D.NAV],[Be.NOBR,D.NOBR],[Be.NOFRAMES,D.NOFRAMES],[Be.NOEMBED,D.NOEMBED],[Be.NOSCRIPT,D.NOSCRIPT],[Be.OBJECT,D.OBJECT],[Be.OL,D.OL],[Be.OPTGROUP,D.OPTGROUP],[Be.OPTION,D.OPTION],[Be.P,D.P],[Be.PARAM,D.PARAM],[Be.PLAINTEXT,D.PLAINTEXT],[Be.PRE,D.PRE],[Be.RB,D.RB],[Be.RP,D.RP],[Be.RT,D.RT],[Be.RTC,D.RTC],[Be.RUBY,D.RUBY],[Be.S,D.S],[Be.SCRIPT,D.SCRIPT],[Be.SEARCH,D.SEARCH],[Be.SECTION,D.SECTION],[Be.SELECT,D.SELECT],[Be.SOURCE,D.SOURCE],[Be.SMALL,D.SMALL],[Be.SPAN,D.SPAN],[Be.STRIKE,D.STRIKE],[Be.STRONG,D.STRONG],[Be.STYLE,D.STYLE],[Be.SUB,D.SUB],[Be.SUMMARY,D.SUMMARY],[Be.SUP,D.SUP],[Be.TABLE,D.TABLE],[Be.TBODY,D.TBODY],[Be.TEMPLATE,D.TEMPLATE],[Be.TEXTAREA,D.TEXTAREA],[Be.TFOOT,D.TFOOT],[Be.TD,D.TD],[Be.TH,D.TH],[Be.THEAD,D.THEAD],[Be.TITLE,D.TITLE],[Be.TR,D.TR],[Be.TRACK,D.TRACK],[Be.TT,D.TT],[Be.U,D.U],[Be.UL,D.UL],[Be.SVG,D.SVG],[Be.VAR,D.VAR],[Be.WBR,D.WBR],[Be.XMP,D.XMP]]);function Gx(e){var t;return(t=v0t.get(e))!==null&&t!==void 0?t:D.UNKNOWN}const wt=D,x0t={[bt.HTML]:new Set([wt.ADDRESS,wt.APPLET,wt.AREA,wt.ARTICLE,wt.ASIDE,wt.BASE,wt.BASEFONT,wt.BGSOUND,wt.BLOCKQUOTE,wt.BODY,wt.BR,wt.BUTTON,wt.CAPTION,wt.CENTER,wt.COL,wt.COLGROUP,wt.DD,wt.DETAILS,wt.DIR,wt.DIV,wt.DL,wt.DT,wt.EMBED,wt.FIELDSET,wt.FIGCAPTION,wt.FIGURE,wt.FOOTER,wt.FORM,wt.FRAME,wt.FRAMESET,wt.H1,wt.H2,wt.H3,wt.H4,wt.H5,wt.H6,wt.HEAD,wt.HEADER,wt.HGROUP,wt.HR,wt.HTML,wt.IFRAME,wt.IMG,wt.INPUT,wt.LI,wt.LINK,wt.LISTING,wt.MAIN,wt.MARQUEE,wt.MENU,wt.META,wt.NAV,wt.NOEMBED,wt.NOFRAMES,wt.NOSCRIPT,wt.OBJECT,wt.OL,wt.P,wt.PARAM,wt.PLAINTEXT,wt.PRE,wt.SCRIPT,wt.SECTION,wt.SELECT,wt.SOURCE,wt.STYLE,wt.SUMMARY,wt.TABLE,wt.TBODY,wt.TD,wt.TEMPLATE,wt.TEXTAREA,wt.TFOOT,wt.TH,wt.THEAD,wt.TITLE,wt.TR,wt.TRACK,wt.UL,wt.WBR,wt.XMP]),[bt.MATHML]:new Set([wt.MI,wt.MO,wt.MN,wt.MS,wt.MTEXT,wt.ANNOTATION_XML]),[bt.SVG]:new Set([wt.TITLE,wt.FOREIGN_OBJECT,wt.DESC]),[bt.XLINK]:new Set,[bt.XML]:new Set,[bt.XMLNS]:new Set},Q6=new Set([wt.H1,wt.H2,wt.H3,wt.H4,wt.H5,wt.H6]);Be.STYLE,Be.SCRIPT,Be.XMP,Be.IFRAME,Be.NOEMBED,Be.NOFRAMES,Be.PLAINTEXT;var de;(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"})(de||(de={}));const $s={DATA:de.DATA,RCDATA:de.RCDATA,RAWTEXT:de.RAWTEXT,SCRIPT_DATA:de.SCRIPT_DATA,PLAINTEXT:de.PLAINTEXT,CDATA_SECTION:de.CDATA_SECTION};function w0t(e){return e>=oe.DIGIT_0&&e<=oe.DIGIT_9}function $w(e){return e>=oe.LATIN_CAPITAL_A&&e<=oe.LATIN_CAPITAL_Z}function O0t(e){return e>=oe.LATIN_SMALL_A&&e<=oe.LATIN_SMALL_Z}function gp(e){return O0t(e)||$w(e)}function bY(e){return gp(e)||w0t(e)}function IT(e){return e+32}function eEe(e){return e===oe.SPACE||e===oe.LINE_FEED||e===oe.TABULATION||e===oe.FORM_FEED}function yY(e){return eEe(e)||e===oe.SOLIDUS||e===oe.GREATER_THAN_SIGN}function S0t(e){return e===oe.NULL?tt.nullCharacterReference:e>1114111?tt.characterReferenceOutsideUnicodeRange:Xke(e)?tt.surrogateCharacterReference:Zke(e)?tt.noncharacterCharacterReference:Yke(e)||e===oe.CARRIAGE_RETURN?tt.controlCharacterReference:null}class k0t{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=de.DATA,this.returnState=de.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new c0t(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new b0t(u0t,(i,r)=>{this.preprocessor.pos=this.entityStartPos+r-1,this._flushCodePointConsumedAsCharacterReference(i)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(tt.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:i=>{this._err(tt.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+i)},validateNumericCharacterReference:i=>{const r=S0t(i);r&&this._err(r,1)}}:void 0)}_err(t,n=0){var i,r;(r=(i=this.handler).onParseError)===null||r===void 0||r.call(i,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,i){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||i==null||i()}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(tt.endTagWithAttributes),t.selfClosing&&this._err(tt.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 di.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case di.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case di.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:di.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=eEe(t)?di.WHITESPACE_CHARACTER:t===oe.NULL?di.NULL_CHARACTER:di.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(di.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=de.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Uf.Attribute:Uf.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===de.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===de.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===de.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case de.DATA:{this._stateData(t);break}case de.RCDATA:{this._stateRcdata(t);break}case de.RAWTEXT:{this._stateRawtext(t);break}case de.SCRIPT_DATA:{this._stateScriptData(t);break}case de.PLAINTEXT:{this._statePlaintext(t);break}case de.TAG_OPEN:{this._stateTagOpen(t);break}case de.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case de.TAG_NAME:{this._stateTagName(t);break}case de.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case de.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case de.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case de.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case de.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case de.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case de.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case de.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case de.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case de.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case de.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case de.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case de.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case de.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case de.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case de.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case de.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case de.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case de.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case de.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case de.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case de.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case de.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case de.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case de.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case de.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case de.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case de.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case de.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case de.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case de.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case de.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case de.BOGUS_COMMENT:{this._stateBogusComment(t);break}case de.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case de.COMMENT_START:{this._stateCommentStart(t);break}case de.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case de.COMMENT:{this._stateComment(t);break}case de.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case de.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case de.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case de.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case de.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case de.COMMENT_END:{this._stateCommentEnd(t);break}case de.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case de.DOCTYPE:{this._stateDoctype(t);break}case de.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case de.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case de.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case de.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case de.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case de.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case de.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case de.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case de.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case de.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case de.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case de.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case de.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case de.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case de.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case de.CDATA_SECTION:{this._stateCdataSection(t);break}case de.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case de.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case de.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case de.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case oe.LESS_THAN_SIGN:{this.state=de.TAG_OPEN;break}case oe.AMPERSAND:{this._startCharacterReference();break}case oe.NULL:{this._err(tt.unexpectedNullCharacter),this._emitCodePoint(t);break}case oe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case oe.AMPERSAND:{this._startCharacterReference();break}case oe.LESS_THAN_SIGN:{this.state=de.RCDATA_LESS_THAN_SIGN;break}case oe.NULL:{this._err(tt.unexpectedNullCharacter),this._emitChars(Zr);break}case oe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case oe.LESS_THAN_SIGN:{this.state=de.RAWTEXT_LESS_THAN_SIGN;break}case oe.NULL:{this._err(tt.unexpectedNullCharacter),this._emitChars(Zr);break}case oe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case oe.LESS_THAN_SIGN:{this.state=de.SCRIPT_DATA_LESS_THAN_SIGN;break}case oe.NULL:{this._err(tt.unexpectedNullCharacter),this._emitChars(Zr);break}case oe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case oe.NULL:{this._err(tt.unexpectedNullCharacter),this._emitChars(Zr);break}case oe.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(gp(t))this._createStartTagToken(),this.state=de.TAG_NAME,this._stateTagName(t);else switch(t){case oe.EXCLAMATION_MARK:{this.state=de.MARKUP_DECLARATION_OPEN;break}case oe.SOLIDUS:{this.state=de.END_TAG_OPEN;break}case oe.QUESTION_MARK:{this._err(tt.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=de.BOGUS_COMMENT,this._stateBogusComment(t);break}case oe.EOF:{this._err(tt.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(tt.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=de.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(gp(t))this._createEndTagToken(),this.state=de.TAG_NAME,this._stateTagName(t);else switch(t){case oe.GREATER_THAN_SIGN:{this._err(tt.missingEndTagName),this.state=de.DATA;break}case oe.EOF:{this._err(tt.eofBeforeTagName),this._emitChars("");break}case oe.NULL:{this._err(tt.unexpectedNullCharacter),this.state=de.SCRIPT_DATA_ESCAPED,this._emitChars(Zr);break}case oe.EOF:{this._err(tt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=de.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===oe.SOLIDUS?this.state=de.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:gp(t)?(this._emitChars("<"),this.state=de.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=de.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){gp(t)?(this.state=de.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case oe.NULL:{this._err(tt.unexpectedNullCharacter),this.state=de.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Zr);break}case oe.EOF:{this._err(tt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=de.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===oe.SOLIDUS?(this.state=de.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=de.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(el.SCRIPT,!1)&&yY(this.preprocessor.peek(el.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 i=this._indexOf(t);this.items[i]=n,i===this.stackTop&&(this.current=n)}insertAfter(t,n,i){const r=this._indexOf(t)+1;this.items.splice(r,0,n),this.tagIDs.splice(r,0,i),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===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])!==bt.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;i--)if(t.has(this.tagIDs[i])&&this.treeAdapter.getNamespaceURI(this.items[i])===n)return i;return-1}clearBackTo(t,n){const i=this._indexOfTagNames(t,n);this.shortenToLength(i+1)}clearBackToTableContext(){this.clearBackTo(_0t,bt.HTML)}clearBackToTableBodyContext(){this.clearBackTo(A0t,bt.HTML)}clearBackToTableRowContext(){this.clearBackTo(T0t,bt.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]===D.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]===D.HTML}hasInDynamicScope(t,n){for(let i=this.stackTop;i>=0;i--){const r=this.tagIDs[i];switch(this.treeAdapter.getNamespaceURI(this.items[i])){case bt.HTML:{if(r===t)return!0;if(n.has(r))return!1;break}case bt.SVG:{if(wY.has(r))return!1;break}case bt.MATHML:{if(xY.has(r))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,gN)}hasInListItemScope(t){return this.hasInDynamicScope(t,E0t)}hasInButtonScope(t){return this.hasInDynamicScope(t,C0t)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case bt.HTML:{if(Q6.has(n))return!0;if(gN.has(n))return!1;break}case bt.SVG:{if(wY.has(n))return!1;break}case bt.MATHML:{if(xY.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===bt.HTML)switch(this.tagIDs[n]){case t:return!0;case D.TABLE:case D.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===bt.HTML)switch(this.tagIDs[t]){case D.TBODY:case D.THEAD:case D.TFOOT:return!0;case D.TABLE:case D.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===bt.HTML)switch(this.tagIDs[n]){case t:return!0;case D.OPTION:case D.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&tEe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&vY.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&vY.has(this.currentTagId);)this.pop()}}const LM=3;var md;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(md||(md={}));const OY={type:md.Marker};class R0t{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const i=[],r=n.length,s=this.treeAdapter.getTagName(t),a=this.treeAdapter.getNamespaceURI(t);for(let l=0;l[a.name,a.value]));let s=0;for(let a=0;ar.get(c.name)===c.value)&&(s+=1,s>=LM&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(OY)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:md.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const i=this.entries.indexOf(this.bookmark);this.entries.splice(i,0,{type:md.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(OY);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(i=>i.type===md.Marker||this.treeAdapter.getTagName(i.element)===t);return n&&n.type===md.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===md.Element&&n.element===t)}}const bp={createDocument(){return{nodeName:"#document",mode:$c.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 i=e.childNodes.indexOf(n);e.childNodes.splice(i,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,i){const r=e.childNodes.find(s=>s.nodeName==="#documentType");if(r)r.name=t,r.publicId=n,r.systemId=i;else{const s={nodeName:"#documentType",name:t,publicId:n,systemId:i,parentNode:null};bp.appendChild(e,s)}},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(bp.isTextNode(n)){n.value+=t;return}}bp.appendChild(e,bp.createTextNode(t))},insertTextBefore(e,t,n){const i=e.childNodes[e.childNodes.indexOf(n)-1];i&&bp.isTextNode(i)?i.value+=t:bp.insertBefore(e,bp.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(i=>i.name));for(let i=0;ie.startsWith(n))}function $0t(e){return e.name===nEe&&e.publicId===null&&(e.systemId===null||e.systemId===I0t)}function F0t(e){if(e.name!==nEe)return $c.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===P0t)return $c.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),M0t.has(n))return $c.QUIRKS;let i=t===null?D0t:iEe;if(SY(n,i))return $c.QUIRKS;if(i=t===null?rEe:L0t,SY(n,i))return $c.LIMITED_QUIRKS}return $c.NO_QUIRKS}const kY={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},B0t="definitionurl",U0t="definitionURL",Q0t=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])),z0t=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:bt.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:bt.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:bt.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:bt.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:bt.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:bt.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:bt.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:bt.XML}],["xml:space",{prefix:"xml",name:"space",namespace:bt.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:bt.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:bt.XMLNS}]]),V0t=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])),H0t=new Set([D.B,D.BIG,D.BLOCKQUOTE,D.BODY,D.BR,D.CENTER,D.CODE,D.DD,D.DIV,D.DL,D.DT,D.EM,D.EMBED,D.H1,D.H2,D.H3,D.H4,D.H5,D.H6,D.HEAD,D.HR,D.I,D.IMG,D.LI,D.LISTING,D.MENU,D.META,D.NOBR,D.OL,D.P,D.PRE,D.RUBY,D.S,D.SMALL,D.SPAN,D.STRONG,D.STRIKE,D.SUB,D.SUP,D.TABLE,D.TT,D.U,D.UL,D.VAR]);function q0t(e){const t=e.tagID;return t===D.FONT&&e.attrs.some(({name:i})=>i===ab.COLOR||i===ab.SIZE||i===ab.FACE)||H0t.has(t)}function sEe(e){for(let t=0;t0&&this._setContextModes(t,n)}onItemPop(t,n){var i,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(r=(i=this.treeAdapter).onItemPop)===null||r===void 0||r.call(i,t,this.openElements.current),n){let s,a;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,a=this.fragmentContextID):{current:s,currentTagId:a}=this.openElements,this._setContextModes(s,a)}}_setContextModes(t,n){const i=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===bt.HTML;this.currentNotInHTML=!i,this.tokenizer.inForeignNode=!i&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,bt.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=me.TEXT}switchToPlaintextParsing(){this.insertionMode=me.TEXT,this.originalInsertionMode=me.IN_BODY,this.tokenizer.state=$s.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)===Be.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==bt.HTML))switch(this.fragmentContextID){case D.TITLE:case D.TEXTAREA:{this.tokenizer.state=$s.RCDATA;break}case D.STYLE:case D.XMP:case D.IFRAME:case D.NOEMBED:case D.NOFRAMES:case D.NOSCRIPT:{this.tokenizer.state=$s.RAWTEXT;break}case D.SCRIPT:{this.tokenizer.state=$s.SCRIPT_DATA;break}case D.PLAINTEXT:{this.tokenizer.state=$s.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",i=t.publicId||"",r=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,i,r),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 i=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,i)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const i=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(i??this.document,t)}}_appendElement(t,n){const i=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(i,t.location)}_insertElement(t,n){const i=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(i,t.location),this.openElements.push(i,t.tagID)}_insertFakeElement(t,n){const i=this.treeAdapter.createElement(t,bt.HTML,[]);this._attachElementToTree(i,null),this.openElements.push(i,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,bt.HTML,t.attrs),i=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,i),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(Be.HTML,bt.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,D.HTML)}_appendCommentNode(t,n){const i=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,i),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,t.location)}_insertCharacters(t){let n,i;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:i}=this._findFosterParentingLocation(),i?this.treeAdapter.insertTextBefore(n,t.chars,i):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const r=this.treeAdapter.getChildNodes(n),s=i?r.lastIndexOf(i):r.length,a=r[s-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 i=this.treeAdapter.getFirstChild(t);i;i=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(i),this.treeAdapter.appendChild(n,i)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const i=n.location,r=this.treeAdapter.getTagName(t),s=n.type===di.END_TAG&&r===n.tagName?{endTag:{...i},endLine:i.endLine,endCol:i.endCol,endOffset:i.endOffset}:{endLine:i.startLine,endCol:i.startCol,endOffset:i.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,s)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,i;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,i=this.fragmentContextID):{current:n,currentTagId:i}=this.openElements,t.tagID===D.SVG&&this.treeAdapter.getTagName(n)===Be.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===bt.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===D.MGLYPH||t.tagID===D.MALIGNMARK)&&i!==void 0&&!this._isIntegrationPoint(i,n,bt.HTML)}_processToken(t){switch(t.type){case di.CHARACTER:{this.onCharacter(t);break}case di.NULL_CHARACTER:{this.onNullCharacter(t);break}case di.COMMENT:{this.onComment(t);break}case di.DOCTYPE:{this.onDoctype(t);break}case di.START_TAG:{this._processStartTag(t);break}case di.END_TAG:{this.onEndTag(t);break}case di.EOF:{this.onEof(t);break}case di.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,i){const r=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return X0t(t,r,s,i)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(r=>r.type===md.Marker||this.openElements.contains(r.element)),i=n===-1?t-1:n-1;for(let r=i;r>=0;r--){const s=this.activeFormattingElements.entries[r];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=me.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(D.P),this.openElements.popUntilTagNamePopped(D.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case D.TR:{this.insertionMode=me.IN_ROW;return}case D.TBODY:case D.THEAD:case D.TFOOT:{this.insertionMode=me.IN_TABLE_BODY;return}case D.CAPTION:{this.insertionMode=me.IN_CAPTION;return}case D.COLGROUP:{this.insertionMode=me.IN_COLUMN_GROUP;return}case D.TABLE:{this.insertionMode=me.IN_TABLE;return}case D.BODY:{this.insertionMode=me.IN_BODY;return}case D.FRAMESET:{this.insertionMode=me.IN_FRAMESET;return}case D.SELECT:{this._resetInsertionModeForSelect(t);return}case D.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case D.HTML:{this.insertionMode=this.headElement?me.AFTER_HEAD:me.BEFORE_HEAD;return}case D.TD:case D.TH:{if(t>0){this.insertionMode=me.IN_CELL;return}break}case D.HEAD:{if(t>0){this.insertionMode=me.IN_HEAD;return}break}}this.insertionMode=me.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const i=this.openElements.tagIDs[n];if(i===D.TEMPLATE)break;if(i===D.TABLE){this.insertionMode=me.IN_SELECT_IN_TABLE;return}}this.insertionMode=me.IN_SELECT}_isElementCausesFosterParenting(t){return oEe.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 D.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===bt.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case D.TABLE:{const i=this.treeAdapter.getParentNode(n);return i?{parent:i,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 i=this.treeAdapter.getNamespaceURI(t);return x0t[i].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Nvt(this,t);return}switch(this.insertionMode){case me.INITIAL:{W1(this,t);break}case me.BEFORE_HTML:{_O(this,t);break}case me.BEFORE_HEAD:{NO(this,t);break}case me.IN_HEAD:{jO(this,t);break}case me.IN_HEAD_NO_SCRIPT:{RO(this,t);break}case me.AFTER_HEAD:{IO(this,t);break}case me.IN_BODY:case me.IN_CAPTION:case me.IN_CELL:case me.IN_TEMPLATE:{cEe(this,t);break}case me.TEXT:case me.IN_SELECT:case me.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case me.IN_TABLE:case me.IN_TABLE_BODY:case me.IN_ROW:{$M(this,t);break}case me.IN_TABLE_TEXT:{mEe(this,t);break}case me.IN_COLUMN_GROUP:{bN(this,t);break}case me.AFTER_BODY:{yN(this,t);break}case me.AFTER_AFTER_BODY:{wA(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){_vt(this,t);return}switch(this.insertionMode){case me.INITIAL:{W1(this,t);break}case me.BEFORE_HTML:{_O(this,t);break}case me.BEFORE_HEAD:{NO(this,t);break}case me.IN_HEAD:{jO(this,t);break}case me.IN_HEAD_NO_SCRIPT:{RO(this,t);break}case me.AFTER_HEAD:{IO(this,t);break}case me.TEXT:{this._insertCharacters(t);break}case me.IN_TABLE:case me.IN_TABLE_BODY:case me.IN_ROW:{$M(this,t);break}case me.IN_COLUMN_GROUP:{bN(this,t);break}case me.AFTER_BODY:{yN(this,t);break}case me.AFTER_AFTER_BODY:{wA(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){z6(this,t);return}switch(this.insertionMode){case me.INITIAL:case me.BEFORE_HTML:case me.BEFORE_HEAD:case me.IN_HEAD:case me.IN_HEAD_NO_SCRIPT:case me.AFTER_HEAD:case me.IN_BODY:case me.IN_TABLE:case me.IN_CAPTION:case me.IN_COLUMN_GROUP:case me.IN_TABLE_BODY:case me.IN_ROW:case me.IN_CELL:case me.IN_SELECT:case me.IN_SELECT_IN_TABLE:case me.IN_TEMPLATE:case me.IN_FRAMESET:case me.AFTER_FRAMESET:{z6(this,t);break}case me.IN_TABLE_TEXT:{G1(this,t);break}case me.AFTER_BODY:{oyt(this,t);break}case me.AFTER_AFTER_BODY:case me.AFTER_AFTER_FRAMESET:{lyt(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case me.INITIAL:{cyt(this,t);break}case me.BEFORE_HEAD:case me.IN_HEAD:case me.IN_HEAD_NO_SCRIPT:case me.AFTER_HEAD:{this._err(t,tt.misplacedDoctype);break}case me.IN_TABLE_TEXT:{G1(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,tt.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?jvt(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case me.INITIAL:{W1(this,t);break}case me.BEFORE_HTML:{uyt(this,t);break}case me.BEFORE_HEAD:{fyt(this,t);break}case me.IN_HEAD:{Ku(this,t);break}case me.IN_HEAD_NO_SCRIPT:{myt(this,t);break}case me.AFTER_HEAD:{byt(this,t);break}case me.IN_BODY:{Oo(this,t);break}case me.IN_TABLE:{ex(this,t);break}case me.IN_TABLE_TEXT:{G1(this,t);break}case me.IN_CAPTION:{hvt(this,t);break}case me.IN_COLUMN_GROUP:{cU(this,t);break}case me.IN_TABLE_BODY:{nI(this,t);break}case me.IN_ROW:{iI(this,t);break}case me.IN_CELL:{gvt(this,t);break}case me.IN_SELECT:{yEe(this,t);break}case me.IN_SELECT_IN_TABLE:{yvt(this,t);break}case me.IN_TEMPLATE:{xvt(this,t);break}case me.AFTER_BODY:{Ovt(this,t);break}case me.IN_FRAMESET:{Svt(this,t);break}case me.AFTER_FRAMESET:{Evt(this,t);break}case me.AFTER_AFTER_BODY:{Tvt(this,t);break}case me.AFTER_AFTER_FRAMESET:{Avt(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?Rvt(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case me.INITIAL:{W1(this,t);break}case me.BEFORE_HTML:{dyt(this,t);break}case me.BEFORE_HEAD:{hyt(this,t);break}case me.IN_HEAD:{pyt(this,t);break}case me.IN_HEAD_NO_SCRIPT:{gyt(this,t);break}case me.AFTER_HEAD:{yyt(this,t);break}case me.IN_BODY:{tI(this,t);break}case me.TEXT:{ivt(this,t);break}case me.IN_TABLE:{VS(this,t);break}case me.IN_TABLE_TEXT:{G1(this,t);break}case me.IN_CAPTION:{pvt(this,t);break}case me.IN_COLUMN_GROUP:{mvt(this,t);break}case me.IN_TABLE_BODY:{V6(this,t);break}case me.IN_ROW:{bEe(this,t);break}case me.IN_CELL:{bvt(this,t);break}case me.IN_SELECT:{vEe(this,t);break}case me.IN_SELECT_IN_TABLE:{vvt(this,t);break}case me.IN_TEMPLATE:{wvt(this,t);break}case me.AFTER_BODY:{wEe(this,t);break}case me.IN_FRAMESET:{kvt(this,t);break}case me.AFTER_FRAMESET:{Cvt(this,t);break}case me.AFTER_AFTER_BODY:{wA(this,t);break}}}onEof(t){switch(this.insertionMode){case me.INITIAL:{W1(this,t);break}case me.BEFORE_HTML:{_O(this,t);break}case me.BEFORE_HEAD:{NO(this,t);break}case me.IN_HEAD:{jO(this,t);break}case me.IN_HEAD_NO_SCRIPT:{RO(this,t);break}case me.AFTER_HEAD:{IO(this,t);break}case me.IN_BODY:case me.IN_TABLE:case me.IN_CAPTION:case me.IN_COLUMN_GROUP:case me.IN_TABLE_BODY:case me.IN_ROW:case me.IN_CELL:case me.IN_SELECT:case me.IN_SELECT_IN_TABLE:{hEe(this,t);break}case me.TEXT:{rvt(this,t);break}case me.IN_TABLE_TEXT:{G1(this,t);break}case me.IN_TEMPLATE:{xEe(this,t);break}case me.AFTER_BODY:case me.IN_FRAMESET:case me.AFTER_FRAMESET:case me.AFTER_AFTER_BODY:case me.AFTER_AFTER_FRAMESET:{lU(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===oe.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 me.IN_HEAD:case me.IN_HEAD_NO_SCRIPT:case me.AFTER_HEAD:case me.TEXT:case me.IN_COLUMN_GROUP:case me.IN_SELECT:case me.IN_SELECT_IN_TABLE:case me.IN_FRAMESET:case me.AFTER_FRAMESET:{this._insertCharacters(t);break}case me.IN_BODY:case me.IN_CAPTION:case me.IN_CELL:case me.IN_TEMPLATE:case me.AFTER_BODY:case me.AFTER_AFTER_BODY:case me.AFTER_AFTER_FRAMESET:{lEe(this,t);break}case me.IN_TABLE:case me.IN_TABLE_BODY:case me.IN_ROW:{$M(this,t);break}case me.IN_TABLE_TEXT:{pEe(this,t);break}}}};function tyt(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):fEe(e,t),n}function nyt(e,t){let n=null,i=e.openElements.stackTop;for(;i>=0;i--){const r=e.openElements.items[i];if(r===t.element)break;e._isSpecialElement(r,e.openElements.tagIDs[i])&&(n=r)}return n||(e.openElements.shortenToLength(Math.max(i,0)),e.activeFormattingElements.removeEntry(t)),n}function iyt(e,t,n){let i=t,r=e.openElements.getCommonAncestor(t);for(let s=0,a=r;a!==n;s++,a=r){r=e.openElements.getCommonAncestor(a);const l=e.activeFormattingElements.getElementEntry(a),c=l&&s>=J0t;!l||c?(c&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(a)):(a=ryt(e,l),i===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(i),e.treeAdapter.appendChild(a,i),i=a)}return i}function ryt(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),i=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,i),t.element=i,i}function syt(e,t,n){const i=e.treeAdapter.getTagName(t),r=Gx(i);if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);r===D.TEMPLATE&&s===bt.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function ayt(e,t,n){const i=e.treeAdapter.getNamespaceURI(n.element),{token:r}=n,s=e.treeAdapter.createElement(r.tagName,i,r.attrs);e._adoptNodes(t,s),e.treeAdapter.appendChild(t,s),e.activeFormattingElements.insertElementAfterBookmark(s,r),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,s,r.tagID)}function oU(e,t){for(let n=0;n=n;i--)e._setEndLocation(e.openElements.items[i],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const i=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(i);if(r&&!r.endTag&&(e._setEndLocation(i,t),e.openElements.stackTop>=1)){const s=e.openElements.items[1],a=e.treeAdapter.getNodeSourceCodeLocation(s);a&&!a.endTag&&e._setEndLocation(s,t)}}}}function cyt(e,t){e._setDocumentType(t);const n=t.forceQuirks?$c.QUIRKS:F0t(t);$0t(t)||e._err(t,tt.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=me.BEFORE_HTML}function W1(e,t){e._err(t,tt.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,$c.QUIRKS),e.insertionMode=me.BEFORE_HTML,e._processToken(t)}function uyt(e,t){t.tagID===D.HTML?(e._insertElement(t,bt.HTML),e.insertionMode=me.BEFORE_HEAD):_O(e,t)}function dyt(e,t){const n=t.tagID;(n===D.HTML||n===D.HEAD||n===D.BODY||n===D.BR)&&_O(e,t)}function _O(e,t){e._insertFakeRootElement(),e.insertionMode=me.BEFORE_HEAD,e._processToken(t)}function fyt(e,t){switch(t.tagID){case D.HTML:{Oo(e,t);break}case D.HEAD:{e._insertElement(t,bt.HTML),e.headElement=e.openElements.current,e.insertionMode=me.IN_HEAD;break}default:NO(e,t)}}function hyt(e,t){const n=t.tagID;n===D.HEAD||n===D.BODY||n===D.HTML||n===D.BR?NO(e,t):e._err(t,tt.endTagWithoutMatchingOpenElement)}function NO(e,t){e._insertFakeElement(Be.HEAD,D.HEAD),e.headElement=e.openElements.current,e.insertionMode=me.IN_HEAD,e._processToken(t)}function Ku(e,t){switch(t.tagID){case D.HTML:{Oo(e,t);break}case D.BASE:case D.BASEFONT:case D.BGSOUND:case D.LINK:case D.META:{e._appendElement(t,bt.HTML),t.ackSelfClosing=!0;break}case D.TITLE:{e._switchToTextParsing(t,$s.RCDATA);break}case D.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,$s.RAWTEXT):(e._insertElement(t,bt.HTML),e.insertionMode=me.IN_HEAD_NO_SCRIPT);break}case D.NOFRAMES:case D.STYLE:{e._switchToTextParsing(t,$s.RAWTEXT);break}case D.SCRIPT:{e._switchToTextParsing(t,$s.SCRIPT_DATA);break}case D.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=me.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(me.IN_TEMPLATE);break}case D.HEAD:{e._err(t,tt.misplacedStartTagForHeadElement);break}default:jO(e,t)}}function pyt(e,t){switch(t.tagID){case D.HEAD:{e.openElements.pop(),e.insertionMode=me.AFTER_HEAD;break}case D.BODY:case D.BR:case D.HTML:{jO(e,t);break}case D.TEMPLATE:{r0(e,t);break}default:e._err(t,tt.endTagWithoutMatchingOpenElement)}}function r0(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==D.TEMPLATE&&e._err(t,tt.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(D.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,tt.endTagWithoutMatchingOpenElement)}function jO(e,t){e.openElements.pop(),e.insertionMode=me.AFTER_HEAD,e._processToken(t)}function myt(e,t){switch(t.tagID){case D.HTML:{Oo(e,t);break}case D.BASEFONT:case D.BGSOUND:case D.HEAD:case D.LINK:case D.META:case D.NOFRAMES:case D.STYLE:{Ku(e,t);break}case D.NOSCRIPT:{e._err(t,tt.nestedNoscriptInHead);break}default:RO(e,t)}}function gyt(e,t){switch(t.tagID){case D.NOSCRIPT:{e.openElements.pop(),e.insertionMode=me.IN_HEAD;break}case D.BR:{RO(e,t);break}default:e._err(t,tt.endTagWithoutMatchingOpenElement)}}function RO(e,t){const n=t.type===di.EOF?tt.openElementsLeftAfterEof:tt.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=me.IN_HEAD,e._processToken(t)}function byt(e,t){switch(t.tagID){case D.HTML:{Oo(e,t);break}case D.BODY:{e._insertElement(t,bt.HTML),e.framesetOk=!1,e.insertionMode=me.IN_BODY;break}case D.FRAMESET:{e._insertElement(t,bt.HTML),e.insertionMode=me.IN_FRAMESET;break}case D.BASE:case D.BASEFONT:case D.BGSOUND:case D.LINK:case D.META:case D.NOFRAMES:case D.SCRIPT:case D.STYLE:case D.TEMPLATE:case D.TITLE:{e._err(t,tt.abandonedHeadElementChild),e.openElements.push(e.headElement,D.HEAD),Ku(e,t),e.openElements.remove(e.headElement);break}case D.HEAD:{e._err(t,tt.misplacedStartTagForHeadElement);break}default:IO(e,t)}}function yyt(e,t){switch(t.tagID){case D.BODY:case D.HTML:case D.BR:{IO(e,t);break}case D.TEMPLATE:{r0(e,t);break}default:e._err(t,tt.endTagWithoutMatchingOpenElement)}}function IO(e,t){e._insertFakeElement(Be.BODY,D.BODY),e.insertionMode=me.IN_BODY,eI(e,t)}function eI(e,t){switch(t.type){case di.CHARACTER:{cEe(e,t);break}case di.WHITESPACE_CHARACTER:{lEe(e,t);break}case di.COMMENT:{z6(e,t);break}case di.START_TAG:{Oo(e,t);break}case di.END_TAG:{tI(e,t);break}case di.EOF:{hEe(e,t);break}}}function lEe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function cEe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function vyt(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function xyt(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function wyt(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,bt.HTML),e.insertionMode=me.IN_FRAMESET)}function Oyt(e,t){e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._insertElement(t,bt.HTML)}function Syt(e,t){e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Q6.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,bt.HTML)}function kyt(e,t){e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._insertElement(t,bt.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function Eyt(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._insertElement(t,bt.HTML),n||(e.formElement=e.openElements.current))}function Cyt(e,t){e.framesetOk=!1;const n=t.tagID;for(let i=e.openElements.stackTop;i>=0;i--){const r=e.openElements.tagIDs[i];if(n===D.LI&&r===D.LI||(n===D.DD||n===D.DT)&&(r===D.DD||r===D.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==D.ADDRESS&&r!==D.DIV&&r!==D.P&&e._isSpecialElement(e.openElements.items[i],r))break}e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._insertElement(t,bt.HTML)}function Tyt(e,t){e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._insertElement(t,bt.HTML),e.tokenizer.state=$s.PLAINTEXT}function Ayt(e,t){e.openElements.hasInScope(D.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(D.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,bt.HTML),e.framesetOk=!1}function _yt(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Be.A);n&&(oU(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,bt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Nyt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,bt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function jyt(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(D.NOBR)&&(oU(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,bt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Ryt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,bt.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Iyt(e,t){e.treeAdapter.getDocumentMode(e.document)!==$c.QUIRKS&&e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._insertElement(t,bt.HTML),e.framesetOk=!1,e.insertionMode=me.IN_TABLE}function uEe(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,bt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function dEe(e){const t=Jke(e,ab.TYPE);return t!=null&&t.toLowerCase()===Y0t}function Pyt(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,bt.HTML),dEe(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Dyt(e,t){e._appendElement(t,bt.HTML),t.ackSelfClosing=!0}function Myt(e,t){e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._appendElement(t,bt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Lyt(e,t){t.tagName=Be.IMG,t.tagID=D.IMG,uEe(e,t)}function $yt(e,t){e._insertElement(t,bt.HTML),e.skipNextNewLine=!0,e.tokenizer.state=$s.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=me.TEXT}function Fyt(e,t){e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,$s.RAWTEXT)}function Byt(e,t){e.framesetOk=!1,e._switchToTextParsing(t,$s.RAWTEXT)}function TY(e,t){e._switchToTextParsing(t,$s.RAWTEXT)}function Uyt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,bt.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===me.IN_TABLE||e.insertionMode===me.IN_CAPTION||e.insertionMode===me.IN_TABLE_BODY||e.insertionMode===me.IN_ROW||e.insertionMode===me.IN_CELL?me.IN_SELECT_IN_TABLE:me.IN_SELECT}function Qyt(e,t){e.openElements.currentTagId===D.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,bt.HTML)}function zyt(e,t){e.openElements.hasInScope(D.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,bt.HTML)}function Vyt(e,t){e.openElements.hasInScope(D.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(D.RTC),e._insertElement(t,bt.HTML)}function Hyt(e,t){e._reconstructActiveFormattingElements(),sEe(t),aU(t),t.selfClosing?e._appendElement(t,bt.MATHML):e._insertElement(t,bt.MATHML),t.ackSelfClosing=!0}function qyt(e,t){e._reconstructActiveFormattingElements(),aEe(t),aU(t),t.selfClosing?e._appendElement(t,bt.SVG):e._insertElement(t,bt.SVG),t.ackSelfClosing=!0}function AY(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,bt.HTML)}function Oo(e,t){switch(t.tagID){case D.I:case D.S:case D.B:case D.U:case D.EM:case D.TT:case D.BIG:case D.CODE:case D.FONT:case D.SMALL:case D.STRIKE:case D.STRONG:{Nyt(e,t);break}case D.A:{_yt(e,t);break}case D.H1:case D.H2:case D.H3:case D.H4:case D.H5:case D.H6:{Syt(e,t);break}case D.P:case D.DL:case D.OL:case D.UL:case D.DIV:case D.DIR:case D.NAV:case D.MAIN:case D.MENU:case D.ASIDE:case D.CENTER:case D.FIGURE:case D.FOOTER:case D.HEADER:case D.HGROUP:case D.DIALOG:case D.DETAILS:case D.ADDRESS:case D.ARTICLE:case D.SEARCH:case D.SECTION:case D.SUMMARY:case D.FIELDSET:case D.BLOCKQUOTE:case D.FIGCAPTION:{Oyt(e,t);break}case D.LI:case D.DD:case D.DT:{Cyt(e,t);break}case D.BR:case D.IMG:case D.WBR:case D.AREA:case D.EMBED:case D.KEYGEN:{uEe(e,t);break}case D.HR:{Myt(e,t);break}case D.RB:case D.RTC:{zyt(e,t);break}case D.RT:case D.RP:{Vyt(e,t);break}case D.PRE:case D.LISTING:{kyt(e,t);break}case D.XMP:{Fyt(e,t);break}case D.SVG:{qyt(e,t);break}case D.HTML:{vyt(e,t);break}case D.BASE:case D.LINK:case D.META:case D.STYLE:case D.TITLE:case D.SCRIPT:case D.BGSOUND:case D.BASEFONT:case D.TEMPLATE:{Ku(e,t);break}case D.BODY:{xyt(e,t);break}case D.FORM:{Eyt(e,t);break}case D.NOBR:{jyt(e,t);break}case D.MATH:{Hyt(e,t);break}case D.TABLE:{Iyt(e,t);break}case D.INPUT:{Pyt(e,t);break}case D.PARAM:case D.TRACK:case D.SOURCE:{Dyt(e,t);break}case D.IMAGE:{Lyt(e,t);break}case D.BUTTON:{Ayt(e,t);break}case D.APPLET:case D.OBJECT:case D.MARQUEE:{Ryt(e,t);break}case D.IFRAME:{Byt(e,t);break}case D.SELECT:{Uyt(e,t);break}case D.OPTION:case D.OPTGROUP:{Qyt(e,t);break}case D.NOEMBED:case D.NOFRAMES:{TY(e,t);break}case D.FRAMESET:{wyt(e,t);break}case D.TEXTAREA:{$yt(e,t);break}case D.NOSCRIPT:{e.options.scriptingEnabled?TY(e,t):AY(e,t);break}case D.PLAINTEXT:{Tyt(e,t);break}case D.COL:case D.TH:case D.TD:case D.TR:case D.HEAD:case D.FRAME:case D.TBODY:case D.TFOOT:case D.THEAD:case D.CAPTION:case D.COLGROUP:break;default:AY(e,t)}}function Wyt(e,t){if(e.openElements.hasInScope(D.BODY)&&(e.insertionMode=me.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function Gyt(e,t){e.openElements.hasInScope(D.BODY)&&(e.insertionMode=me.AFTER_BODY,wEe(e,t))}function Kyt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Xyt(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(D.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(D.FORM):n&&e.openElements.remove(n))}function Yyt(e){e.openElements.hasInButtonScope(D.P)||e._insertFakeElement(Be.P,D.P),e._closePElement()}function Zyt(e){e.openElements.hasInListItemScope(D.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(D.LI),e.openElements.popUntilTagNamePopped(D.LI))}function Jyt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function evt(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function tvt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function nvt(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Be.BR,D.BR),e.openElements.pop(),e.framesetOk=!1}function fEe(e,t){const n=t.tagName,i=t.tagID;for(let r=e.openElements.stackTop;r>0;r--){const s=e.openElements.items[r],a=e.openElements.tagIDs[r];if(i===a&&(i!==D.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.stackTop>=r&&e.openElements.shortenToLength(r);break}if(e._isSpecialElement(s,a))break}}function tI(e,t){switch(t.tagID){case D.A:case D.B:case D.I:case D.S:case D.U:case D.EM:case D.TT:case D.BIG:case D.CODE:case D.FONT:case D.NOBR:case D.SMALL:case D.STRIKE:case D.STRONG:{oU(e,t);break}case D.P:{Yyt(e);break}case D.DL:case D.UL:case D.OL:case D.DIR:case D.DIV:case D.NAV:case D.PRE:case D.MAIN:case D.MENU:case D.ASIDE:case D.BUTTON:case D.CENTER:case D.FIGURE:case D.FOOTER:case D.HEADER:case D.HGROUP:case D.DIALOG:case D.ADDRESS:case D.ARTICLE:case D.DETAILS:case D.SEARCH:case D.SECTION:case D.SUMMARY:case D.LISTING:case D.FIELDSET:case D.BLOCKQUOTE:case D.FIGCAPTION:{Kyt(e,t);break}case D.LI:{Zyt(e);break}case D.DD:case D.DT:{Jyt(e,t);break}case D.H1:case D.H2:case D.H3:case D.H4:case D.H5:case D.H6:{evt(e);break}case D.BR:{nvt(e);break}case D.BODY:{Wyt(e,t);break}case D.HTML:{Gyt(e,t);break}case D.FORM:{Xyt(e);break}case D.APPLET:case D.OBJECT:case D.MARQUEE:{tvt(e,t);break}case D.TEMPLATE:{r0(e,t);break}default:fEe(e,t)}}function hEe(e,t){e.tmplInsertionModeStack.length>0?xEe(e,t):lU(e,t)}function ivt(e,t){var n;t.tagID===D.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function rvt(e,t){e._err(t,tt.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function $M(e,t){if(e.openElements.currentTagId!==void 0&&oEe.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=me.IN_TABLE_TEXT,t.type){case di.CHARACTER:{mEe(e,t);break}case di.WHITESPACE_CHARACTER:{pEe(e,t);break}}else wE(e,t)}function svt(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,bt.HTML),e.insertionMode=me.IN_CAPTION}function avt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,bt.HTML),e.insertionMode=me.IN_COLUMN_GROUP}function ovt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Be.COLGROUP,D.COLGROUP),e.insertionMode=me.IN_COLUMN_GROUP,cU(e,t)}function lvt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,bt.HTML),e.insertionMode=me.IN_TABLE_BODY}function cvt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Be.TBODY,D.TBODY),e.insertionMode=me.IN_TABLE_BODY,nI(e,t)}function uvt(e,t){e.openElements.hasInTableScope(D.TABLE)&&(e.openElements.popUntilTagNamePopped(D.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function dvt(e,t){dEe(t)?e._appendElement(t,bt.HTML):wE(e,t),t.ackSelfClosing=!0}function fvt(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,bt.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function ex(e,t){switch(t.tagID){case D.TD:case D.TH:case D.TR:{cvt(e,t);break}case D.STYLE:case D.SCRIPT:case D.TEMPLATE:{Ku(e,t);break}case D.COL:{ovt(e,t);break}case D.FORM:{fvt(e,t);break}case D.TABLE:{uvt(e,t);break}case D.TBODY:case D.TFOOT:case D.THEAD:{lvt(e,t);break}case D.INPUT:{dvt(e,t);break}case D.CAPTION:{svt(e,t);break}case D.COLGROUP:{avt(e,t);break}default:wE(e,t)}}function VS(e,t){switch(t.tagID){case D.TABLE:{e.openElements.hasInTableScope(D.TABLE)&&(e.openElements.popUntilTagNamePopped(D.TABLE),e._resetInsertionMode());break}case D.TEMPLATE:{r0(e,t);break}case D.BODY:case D.CAPTION:case D.COL:case D.COLGROUP:case D.HTML:case D.TBODY:case D.TD:case D.TFOOT:case D.TH:case D.THEAD:case D.TR:break;default:wE(e,t)}}function wE(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,eI(e,t),e.fosterParentingEnabled=n}function pEe(e,t){e.pendingCharacterTokens.push(t)}function mEe(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function G1(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===D.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===D.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===D.OPTGROUP&&e.openElements.pop();break}case D.OPTION:{e.openElements.currentTagId===D.OPTION&&e.openElements.pop();break}case D.SELECT:{e.openElements.hasInSelectScope(D.SELECT)&&(e.openElements.popUntilTagNamePopped(D.SELECT),e._resetInsertionMode());break}case D.TEMPLATE:{r0(e,t);break}}}function yvt(e,t){const n=t.tagID;n===D.CAPTION||n===D.TABLE||n===D.TBODY||n===D.TFOOT||n===D.THEAD||n===D.TR||n===D.TD||n===D.TH?(e.openElements.popUntilTagNamePopped(D.SELECT),e._resetInsertionMode(),e._processStartTag(t)):yEe(e,t)}function vvt(e,t){const n=t.tagID;n===D.CAPTION||n===D.TABLE||n===D.TBODY||n===D.TFOOT||n===D.THEAD||n===D.TR||n===D.TD||n===D.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(D.SELECT),e._resetInsertionMode(),e.onEndTag(t)):vEe(e,t)}function xvt(e,t){switch(t.tagID){case D.BASE:case D.BASEFONT:case D.BGSOUND:case D.LINK:case D.META:case D.NOFRAMES:case D.SCRIPT:case D.STYLE:case D.TEMPLATE:case D.TITLE:{Ku(e,t);break}case D.CAPTION:case D.COLGROUP:case D.TBODY:case D.TFOOT:case D.THEAD:{e.tmplInsertionModeStack[0]=me.IN_TABLE,e.insertionMode=me.IN_TABLE,ex(e,t);break}case D.COL:{e.tmplInsertionModeStack[0]=me.IN_COLUMN_GROUP,e.insertionMode=me.IN_COLUMN_GROUP,cU(e,t);break}case D.TR:{e.tmplInsertionModeStack[0]=me.IN_TABLE_BODY,e.insertionMode=me.IN_TABLE_BODY,nI(e,t);break}case D.TD:case D.TH:{e.tmplInsertionModeStack[0]=me.IN_ROW,e.insertionMode=me.IN_ROW,iI(e,t);break}default:e.tmplInsertionModeStack[0]=me.IN_BODY,e.insertionMode=me.IN_BODY,Oo(e,t)}}function wvt(e,t){t.tagID===D.TEMPLATE&&r0(e,t)}function xEe(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(D.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):lU(e,t)}function Ovt(e,t){t.tagID===D.HTML?Oo(e,t):yN(e,t)}function wEe(e,t){var n;if(t.tagID===D.HTML){if(e.fragmentContext||(e.insertionMode=me.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===D.HTML){e._setEndLocation(e.openElements.items[0],t);const i=e.openElements.items[1];i&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(i))===null||n===void 0)&&n.endTag)&&e._setEndLocation(i,t)}}else yN(e,t)}function yN(e,t){e.insertionMode=me.IN_BODY,eI(e,t)}function Svt(e,t){switch(t.tagID){case D.HTML:{Oo(e,t);break}case D.FRAMESET:{e._insertElement(t,bt.HTML);break}case D.FRAME:{e._appendElement(t,bt.HTML),t.ackSelfClosing=!0;break}case D.NOFRAMES:{Ku(e,t);break}}}function kvt(e,t){t.tagID===D.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==D.FRAMESET&&(e.insertionMode=me.AFTER_FRAMESET))}function Evt(e,t){switch(t.tagID){case D.HTML:{Oo(e,t);break}case D.NOFRAMES:{Ku(e,t);break}}}function Cvt(e,t){t.tagID===D.HTML&&(e.insertionMode=me.AFTER_AFTER_FRAMESET)}function Tvt(e,t){t.tagID===D.HTML?Oo(e,t):wA(e,t)}function wA(e,t){e.insertionMode=me.IN_BODY,eI(e,t)}function Avt(e,t){switch(t.tagID){case D.HTML:{Oo(e,t);break}case D.NOFRAMES:{Ku(e,t);break}}}function _vt(e,t){t.chars=Zr,e._insertCharacters(t)}function Nvt(e,t){e._insertCharacters(t),e.framesetOk=!1}function OEe(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==bt.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function jvt(e,t){if(q0t(t))OEe(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),i=e.treeAdapter.getNamespaceURI(n);i===bt.MATHML?sEe(t):i===bt.SVG&&(W0t(t),aEe(t)),aU(t),t.selfClosing?e._appendElement(t,i):e._insertElement(t,i),t.ackSelfClosing=!0}}function Rvt(e,t){if(t.tagID===D.P||t.tagID===D.BR){OEe(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const i=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(i)===bt.HTML){e._endTagOutsideForeignContent(t);break}const r=e.treeAdapter.getTagName(i);if(r.toLowerCase()===t.tagName){t.tagName=r,e.openElements.shortenToLength(n);break}}}Be.AREA,Be.BASE,Be.BASEFONT,Be.BGSOUND,Be.BR,Be.COL,Be.EMBED,Be.FRAME,Be.HR,Be.IMG,Be.INPUT,Be.KEYGEN,Be.LINK,Be.META,Be.PARAM,Be.SOURCE,Be.TRACK,Be.WBR;const Ivt=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,Pvt=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),_Y={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function SEe(e,t){const n=Vvt(e),i=FSe("type",{handlers:{root:Dvt,element:Mvt,text:Lvt,comment:EEe,doctype:$vt,raw:Bvt},unknown:Uvt}),r={parser:n?new CY(_Y):CY.getFragmentParser(void 0,_Y),handle(l){i(l,r)},stitches:!1,options:t||{}};i(e,r),Kx(r,Yd());const s=n?r.parser.document:r.parser.getFragment(),a=Hbt(s,{file:r.options.file});return r.stitches&&vE(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 kEe(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:di.CHARACTER,chars:e.value,location:OE(e)};Kx(t,Yd(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function $vt(e,t){const n={type:di.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:OE(e)};Kx(t,Yd(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Fvt(e,t){t.stitches=!0;const n=Hvt(e);if("children"in e&&"children"in n){const i=SEe({type:"root",children:e.children},t.options);n.children=i.children}EEe({type:"comment",value:{stitch:n}},t)}function EEe(e,t){const n=e.value,i={type:di.COMMENT,data:n,location:OE(e)};Kx(t,Yd(e)),t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken)}function Bvt(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,CEe(t,Yd(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(Ivt,"<$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 Uvt(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))Fvt(n,t);else{let i="";throw Pvt.has(n.type)&&(i=". 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"+i)}}function Kx(e,t){CEe(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=$s.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 CEe(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 Qvt(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===$s.PLAINTEXT)return;Kx(t,Yd(e));const i=t.parser.openElements.current;let r="namespaceURI"in i?i.namespaceURI:$g.html;r===$g.html&&n==="svg"&&(r=$g.svg);const s=Xbt({...e,children:[]},{space:r===$g.svg?"svg":"html"}),a={type:di.START_TAG,tagName:n,tagID:Gx(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:OE(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function zvt(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&r0t.includes(n)||t.parser.tokenizer.state===$s.PLAINTEXT)return;Kx(t,GR(e));const i={type:di.END_TAG,tagName:n,tagID:Gx(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:OE(e)};t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===$s.RCDATA||t.parser.tokenizer.state===$s.RAWTEXT||t.parser.tokenizer.state===$s.SCRIPT_DATA)&&(t.parser.tokenizer.state=$s.DATA)}function Vvt(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function OE(e){const t=Yd(e)||{line:void 0,column:void 0,offset:void 0},n=GR(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 Hvt(e){return"children"in e?Zv({...e,children:[]}):Zv(e)}function qvt(e){return function(t,n){return SEe(t,{...e,file:n})}}const Wvt="modulepreload",Gvt=function(e){return"/"+e},NY={},Md=function(t,n,i){let r=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"));r=Promise.allSettled(n.map(c=>{if(c=Gvt(c),c in NY)return;NY[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":Wvt,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 s(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return r.then(a=>{for(const l of a||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};var Kvt=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,Xvt=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,Yvt=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,FM={Space_Separator:Kvt,ID_Start:Xvt,ID_Continue:Yvt},Is={isSpaceSeparator(e){return typeof e=="string"&&FM.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||FM.ID_Start.test(e))},isIdContinueChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="$"||e==="_"||e==="‌"||e==="‍"||FM.ID_Continue.test(e))},isDigit(e){return typeof e=="string"&&/[0-9]/.test(e)},isHexDigit(e){return typeof e=="string"&&/[0-9A-Fa-f]/.test(e)}};let H6,Mo,Qf,vN,Om,Mu,Aa,uU,PO;var Zvt=function(t,n){H6=String(t),Mo="start",Qf=[],vN=0,Om=1,Mu=0,Aa=void 0,uU=void 0,PO=void 0;do Aa=Jvt(),nxt[Mo]();while(Aa.type!=="eof");return typeof n=="function"?q6({"":PO},"",n):PO};function q6(e,t,n){const i=e[t];if(i!=null&&typeof i=="object")if(Array.isArray(i))for(let r=0;r{const P=[];return T.forEach(R=>{P.push(R),R.toLowerCase()===R?P.push(R.toUpperCase()):P.push(R.toLowerCase())}),P})(v),built_in:x},k=T=>T.map(P=>P.replace(/\|\d+$/,"")),S={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",k(x).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},E=t.concat(i,"\\b(?!\\()"),C={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),E],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat(/::/,t.lookahead(/(?!class\b)/)),E],scope:{1:"title.class",3:"variable.constant"}},{match:[r,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},N={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},_={relevance:0,begin:/\(/,end:/\)/,keywords:w,contains:[N,a,C,e.C_BLOCK_COMMENT_MODE,g,b,S]},j={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",k(y).join("\\b|"),"|",k(x).join("\\b|"),"\\b)"),i,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[_]};_.contains.push(j);const A=[N,C,e.C_BLOCK_COMMENT_MODE,g,b,S],F={begin:t.concat(/#\[\s*\\?/,t.either(r,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...A]},...A,{scope:"meta",variants:[{match:r},{match:s}]}]};return{case_insensitive:!1,keywords:w,contains:[F,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,C,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},S,{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:w,contains:["self",F,a,C,e.C_BLOCK_COMMENT_MODE,g,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},g,b]}}function ogt(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 lgt(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function xke(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["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:i,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})\\.`,g=`\\b|${i.join("|")}`,b={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${p}))[eE][+-]?(${h})[jJ]?(?=${g})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${h})[jJ](?=${g})`}]},v={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,b,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,b,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,b,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,v,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:[b,y,f]}]}}function cgt(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function ugt(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,i=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]?/),r=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=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:[r,i]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,i]},{scope:{1:"punctuation",2:"number"},match:[s,i]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,i]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:r},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function dgt(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),r=t.concat(i,/(::\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])*",g={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},b={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},S=[f,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:a},{relevance:0,match:[r,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:i,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[b]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},g,{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=S,b.contains=S;const _=[{begin:/^\s*=>/,starts:{end:"$",contains:S}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:S}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(_).concat(u).concat(S)}}function fgt(e){const t=e.regex,n=/(r#)?/,i=t.concat(n,e.UNDERSCORE_IDENT_RE),r=t.concat(n,e.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,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:""},s]}}const hgt=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_-]*/}}),pgt=["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"],mgt=["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"],ggt=[...pgt,...mgt],bgt=["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(),ygt=["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(),vgt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),xgt=["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 wgt(e){const t=hgt(e),n=vgt,i=ygt,r="@[a-z-]+",s="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("+ggt.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+xgt.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:r,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:bgt.join(" ")},contains:[{begin:r,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 Ogt(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function Sgt(e){const t=e.regex,n=e.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["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,g=[...u,...c].filter(k=>!d.includes(k)),b={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function x(k){return t.concat(/\b/,t.either(...k.map(S=>S.replace(/\s+/,"\\s+"))),/\b/)}const O={scope:"keyword",match:x(h),relevance:0};function w(k,{exceptions:S,when:E}={}){const C=E;return S=S||[],k.map(N=>N.match(/\|\d+$/)||S.includes(N)?N:C(N)?`${N}|0`:N)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:w(g,{when:k=>k.length<3}),literal:s,type:l,built_in:f},contains:[{scope:"type",match:x(a)},O,y,b,i,r,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function wke(e){return e?typeof e=="string"?e:e.source:null}function q1(e){return gr("(?=",e,")")}function gr(...e){return e.map(n=>wke(n)).join("")}function kgt(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Ro(...e){return"("+(kgt(e).capture?"":"?:")+e.map(i=>wke(i)).join("|")+")"}const JB=e=>gr(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Egt=["Protocol","Type"].map(JB),tY=["init","self"].map(JB),Cgt=["Any","Self"],PM=["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"],nY=["false","nil","true"],Tgt=["assignment","associativity","higherThan","left","lowerThan","none","right"],Agt=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],iY=["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"],Oke=Ro(/[/=\-+!*%<>&|^~?]/,/[\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]/),Ske=Ro(Oke,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),DM=gr(Oke,Ske,"*"),kke=Ro(/[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]/),hN=Ro(kke,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),dd=gr(kke,hN,"*"),jT=gr(/[A-Z]/,hN,"*"),_gt=["attached","autoclosure",gr(/convention\(/,Ro("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",gr(/objc\(/,dd,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Ngt=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function jgt(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,n],r={match:[/\./,Ro(...Egt,...tY)],className:{2:"keyword"}},s={match:gr(/\./,Ro(...PM)),relevance:0},a=PM.filter(Ee=>typeof Ee=="string").concat(["_|0"]),l=PM.filter(Ee=>typeof Ee!="string").concat(Cgt).map(JB),c={variants:[{className:"keyword",match:Ro(...l,...tY)}]},u={$pattern:Ro(/\b\w+/,/#\w+/),keyword:a.concat(Agt),literal:nY},d=[r,s,c],f={match:gr(/\./,Ro(...iY)),relevance:0},h={className:"built_in",match:gr(/\b/,Ro(...iY),/(?=\()/)},p=[f,h],g={match:/->/,relevance:0},b={className:"operator",relevance:0,variants:[{match:DM},{match:`\\.(\\.|${Ske})+`}]},v=[g,b],y="([0-9]_*)+",x="([0-9a-fA-F]_*)+",O={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${x})(\\.(${x}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},w=(Ee="")=>({className:"subst",variants:[{match:gr(/\\/,Ee,/[0\\tnr"']/)},{match:gr(/\\/,Ee,/u\{[0-9a-fA-F]{1,8}\}/)}]}),k=(Ee="")=>({className:"subst",match:gr(/\\/,Ee,/[\t ]*(?:[\r\n]|\r\n)/)}),S=(Ee="")=>({className:"subst",label:"interpol",begin:gr(/\\/,Ee,/\(/),end:/\)/}),E=(Ee="")=>({begin:gr(Ee,/"""/),end:gr(/"""/,Ee),contains:[w(Ee),k(Ee),S(Ee)]}),C=(Ee="")=>({begin:gr(Ee,/"/),end:gr(/"/,Ee),contains:[w(Ee),S(Ee)]}),N={className:"string",variants:[E(),E("#"),E("##"),E("###"),C(),C("#"),C("##"),C("###")]},_=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],j={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:_},A=Ee=>{const Je=gr(Ee,/\//),De=gr(/\//,Ee);return{begin:Je,end:De,contains:[..._,{scope:"comment",begin:`#(?!.*${De})`,end:/$/}]}},F={scope:"regexp",variants:[A("###"),A("##"),A("#"),j]},T={match:gr(/`/,dd,/`/)},P={className:"variable",match:/\$\d+/},R={className:"variable",match:`\\$${hN}+`},L=[T,P,R],M={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Ngt,contains:[...v,O,N]}]}},U={scope:"keyword",match:gr(/@/,Ro(..._gt),q1(Ro(/\(/,/\s+/)))},I={scope:"meta",match:gr(/@/,dd)},H=[M,U,I],Z={match:q1(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:gr(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,hN,"+")},{className:"type",match:jT,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:gr(/\s+&\s+/,q1(jT)),relevance:0}]},Q={begin://,keywords:u,contains:[...i,...d,...H,g,Z]};Z.contains.push(Q);const q={match:gr(dd,/\s*:/),keywords:"_|0",relevance:0},B={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",q,...i,F,...d,...p,...v,O,N,...L,...H,Z]},te={begin://,keywords:"repeat each",contains:[...i,Z]},ce={begin:Ro(q1(gr(dd,/\s*:/)),q1(gr(dd,/\s+/,dd,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:dd}]},se={begin:/\(/,end:/\)/,keywords:u,contains:[ce,...i,...d,...v,O,N,...H,Z,B],endsParent:!0,illegal:/["']/},re={match:[/(func|macro)/,/\s+/,Ro(T.match,dd,DM)],className:{1:"keyword",3:"title.function"},contains:[te,se,t],illegal:[/\[/,/%/]},ge={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[te,se,t],illegal:/\[|%/},G={match:[/operator/,/\s+/,DM],className:{1:"keyword",3:"title"}},K={begin:[/precedencegroup/,/\s+/,jT],className:{1:"keyword",3:"title"},contains:[Z],keywords:[...Tgt,...nY],end:/}/},ae={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},ue={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},xe={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,dd,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[te,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:jT},...d],relevance:0}]};for(const Ee of N.variants){const Je=Ee.contains.find(Pe=>Pe.label==="interpol");Je.keywords=u;const De=[...d,...p,...v,O,N,...L];Je.contains=[...De,{begin:/\(/,end:/\)/,contains:["self",...De]}]}return{name:"Swift",keywords:u,contains:[...i,re,ge,ae,ue,xe,G,K,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},F,...d,...p,...v,O,N,...L,...H,Z,B]}}const pN="[A-Za-z$_][0-9A-Za-z$_]*",Eke=["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"],Cke=["true","false","null","undefined","NaN","Infinity"],Tke=["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"],Ake=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],_ke=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Nke=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],jke=[].concat(_ke,Tke,Ake);function Rgt(e){const t=e.regex,n=(M,{after:U})=>{const I="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,U)=>{const I=M[0].length+M.index,H=M.input[I];if(H==="<"||H===","){U.ignoreMatch();return}H===">"&&(n(M,{after:I})||U.ignoreMatch());let Z;const Q=M.input.substring(I);if(Z=Q.match(/^\s*=/)){U.ignoreMatch();return}if((Z=Q.match(/^\s+extends\s+/))&&Z.index===0){U.ignoreMatch();return}}},l={$pattern:pN,keyword:Eke,literal:Cke,built_in:jke,"variable.language":Nke},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"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},x={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},O=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,b,v,{match:/\$\d+/},f];h.contains=O.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(O)});const w=[].concat(x,h.contains),k=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(w)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},E={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},C={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:{_:[...Tke,...Ake]}},N={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},_={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function A(M){return t.concat("(?!",M.join("|"),")")}const F={match:t.concat(/\b/,A([..._ke,"super","import"].map(M=>`${M}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},T={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},P={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},S]},R="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",L={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(R)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),N,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,g,b,v,x,{match:/\$\d+/},f,C,{scope:"attr",match:i+t.lookahead(":"),relevance:0},L,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,e.REGEXP_MODE,{className:"function",begin:R,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:r.begin,end:r.end},{match:s},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},_,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[S,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},T,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[S]},F,j,E,P,{match:/\$[(.]/}]}}function Rke(e){const t=e.regex,n=Rgt(e),i=pN,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},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:pN,keyword:Eke.concat(c),literal:Cke,built_in:jke.concat(r),"variable.language":Nke},d={className:"meta",begin:"@"+i},f=(b,v,y)=>{const x=b.contains.findIndex(O=>O.label===v);if(x===-1)throw new Error("can not find mode to replace");b.contains.splice(x,1,y)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(b=>b.scope==="attr"),p=Object.assign({},h,{match:t.concat(i,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,p]),n.contains=n.contains.concat([d,s,a,p]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",l);const g=n.contains.find(b=>b.label==="func.def");return g.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Igt(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},i={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},r=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\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(s,r),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(s,r),/ +/,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,i,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 Pgt(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),i=["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"],r={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={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:i},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,a,r,e.QUOTE_STRING_MODE,c,u,l]}}function Dgt(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(s,{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:[s,c,l,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[s,a,c,l]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},r,{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 Ike(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={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,r]},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},g={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},v=[i,{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},g,b,s,a],y=[...v];return y.pop(),y.push(l),p.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const Mgt={arduino:Cmt,bash:ZB,c:Tmt,cpp:Amt,csharp:_mt,css:$mt,diff:Fmt,go:Bmt,graphql:Umt,ini:cke,java:Qmt,javascript:pke,json:mke,kotlin:Gmt,less:ngt,lua:igt,makefile:yke,markdown:vke,objectivec:rgt,perl:sgt,php:agt,"php-template":ogt,plaintext:lgt,python:xke,"python-repl":cgt,r:ugt,ruby:dgt,rust:fgt,scss:wgt,shell:Ogt,sql:Sgt,swift:jgt,typescript:Rke,vbnet:Igt,wasm:Pgt,xml:Dgt,yaml:Ike};function Pke(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],i=typeof n;(i==="object"||i==="function")&&!Object.isFrozen(n)&&Pke(n)}),e}let rY=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function Dke(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Bp(e,...t){const n=Object.create(null);for(const i in e)n[i]=e[i];return t.forEach(function(i){for(const r in i)n[r]=i[r]}),n}const Lgt="",sY=e=>!!e.scope,$gt=(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((i,r)=>`${i}${"_".repeat(r+1)}`)].join(" ")}return`${t}${e}`};class Fgt{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=Dke(t)}openNode(t){if(!sY(t))return;const n=$gt(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){sY(t)&&(this.buffer+=Lgt)}value(){return this.buffer}span(t){this.buffer+=``}}const aY=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class eU{constructor(){this.rootNode=aY(),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=aY({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(i=>this._walk(t,i)),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=>{eU._collapse(n)}))}}class Bgt extends eU{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const i=t.root;n&&(i.scope=`language:${n}`),this.add(i)}toHTML(){return new Fgt(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function QS(e){return e?typeof e=="string"?e:e.source:null}function Mke(e){return i0("(?=",e,")")}function Ugt(e){return i0("(?:",e,")*")}function Qgt(e){return i0("(?:",e,")?")}function i0(...e){return e.map(n=>QS(n)).join("")}function zgt(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function tU(...e){return"("+(zgt(e).capture?"":"?:")+e.map(i=>QS(i)).join("|")+")"}function Lke(e){return new RegExp(e.toString()+"|").exec("").length-1}function Vgt(e,t){const n=e&&e.exec(t);return n&&n.index===0}const Hgt=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function nU(e,{joinWith:t}){let n=0;return e.map(i=>{n+=1;const r=n;let s=QS(i),a="";for(;s.length>0;){const l=Hgt.exec(s);if(!l){a+=s;break}a+=s.substring(0,l.index),s=s.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?a+="\\"+String(Number(l[1])+r):(a+=l[0],l[0]==="("&&n++)}return a}).map(i=>`(${i})`).join(t)}const qgt=/\b\B/,$ke="[a-zA-Z]\\w*",iU="[a-zA-Z_]\\w*",Fke="\\b\\d+(\\.\\d+)?",Bke="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Uke="\\b(0b[01]+)",Wgt="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Ggt=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=i0(t,/.*\b/,e.binary,/\b.*/)),Bp({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},e)},zS={begin:"\\\\[\\s\\S]",relevance:0},Kgt={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[zS]},Xgt={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[zS]},Ygt={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/},JR=function(e,t,n={}){const i=Bp({scope:"comment",begin:e,end:t,contains:[]},n);i.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 r=tU("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 i.contains.push({begin:i0(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},Zgt=JR("//","$"),Jgt=JR("/\\*","\\*/"),ebt=JR("#","$"),tbt={scope:"number",begin:Fke,relevance:0},nbt={scope:"number",begin:Bke,relevance:0},ibt={scope:"number",begin:Uke,relevance:0},rbt={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[zS,{begin:/\[/,end:/\]/,relevance:0,contains:[zS]}]},sbt={scope:"title",begin:$ke,relevance:0},abt={scope:"title",begin:iU,relevance:0},obt={begin:"\\.\\s*"+iU,relevance:0},lbt=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 RT=Object.freeze({__proto__:null,APOS_STRING_MODE:Kgt,BACKSLASH_ESCAPE:zS,BINARY_NUMBER_MODE:ibt,BINARY_NUMBER_RE:Uke,COMMENT:JR,C_BLOCK_COMMENT_MODE:Jgt,C_LINE_COMMENT_MODE:Zgt,C_NUMBER_MODE:nbt,C_NUMBER_RE:Bke,END_SAME_AS_BEGIN:lbt,HASH_COMMENT_MODE:ebt,IDENT_RE:$ke,MATCH_NOTHING_RE:qgt,METHOD_GUARD:obt,NUMBER_MODE:tbt,NUMBER_RE:Fke,PHRASAL_WORDS_MODE:Ygt,QUOTE_STRING_MODE:Xgt,REGEXP_MODE:rbt,RE_STARTERS_RE:Wgt,SHEBANG:Ggt,TITLE_MODE:sbt,UNDERSCORE_IDENT_RE:iU,UNDERSCORE_TITLE_MODE:abt});function cbt(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function ubt(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function dbt(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=cbt,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function fbt(e,t){Array.isArray(e.illegal)&&(e.illegal=tU(...e.illegal))}function hbt(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 pbt(e,t){e.relevance===void 0&&(e.relevance=1)}const mbt=(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(i=>{delete e[i]}),e.keywords=n.keywords,e.begin=i0(n.beforeMatch,Mke(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},gbt=["of","and","for","in","not","or","if","then","parent","list","value"],bbt="keyword";function Qke(e,t,n=bbt){const i=Object.create(null);return typeof e=="string"?r(n,e.split(" ")):Array.isArray(e)?r(n,e):Object.keys(e).forEach(function(s){Object.assign(i,Qke(e[s],t,s))}),i;function r(s,a){t&&(a=a.map(l=>l.toLowerCase())),a.forEach(function(l){const c=l.split("|");i[c[0]]=[s,ybt(c[0],c[1])]})}}function ybt(e,t){return t?Number(t):vbt(e)?0:1}function vbt(e){return gbt.includes(e.toLowerCase())}const oY={},sb=e=>{console.error(e)},lY=(e,...t)=>{console.log(`WARN: ${e}`,...t)},$0=(e,t)=>{oY[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),oY[`${e}/${t}`]=!0)},mN=new Error;function zke(e,t,{key:n}){let i=0;const r=e[n],s={},a={};for(let l=1;l<=t.length;l++)a[l+i]=r[l],s[l+i]=!0,i+=Lke(t[l-1]);e[n]=a,e[n]._emit=s,e[n]._multi=!0}function xbt(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw sb("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),mN;if(typeof e.beginScope!="object"||e.beginScope===null)throw sb("beginScope must be object"),mN;zke(e,e.begin,{key:"beginScope"}),e.begin=nU(e.begin,{joinWith:""})}}function wbt(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw sb("skip, excludeEnd, returnEnd not compatible with endScope: {}"),mN;if(typeof e.endScope!="object"||e.endScope===null)throw sb("endScope must be object"),mN;zke(e,e.end,{key:"endScope"}),e.end=nU(e.end,{joinWith:""})}}function Obt(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Sbt(e){Obt(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),xbt(e),wbt(e)}function kbt(e){function t(a,l){return new RegExp(QS(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+=Lke(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(nU(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 i{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 r(a){const l=new i;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 s(a,l){const c=a;if(a.isCompiled)return c;[ubt,hbt,Sbt,mbt].forEach(d=>d(a,l)),e.compilerExtensions.forEach(d=>d(a,l)),a.__beforeBegin=null,[dbt,fbt,pbt].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=Qke(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=QS(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 Ebt(d==="self"?a:d)})),a.contains.forEach(function(d){s(d,c)}),a.starts&&s(a.starts,l),c.matcher=r(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=Bp(e.classNameAliases||{}),s(e)}function Vke(e){return e?e.endsWithParent||Vke(e.starts):!1}function Ebt(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Bp(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Vke(e)?Bp(e,{starts:e.starts?Bp(e.starts):null}):Object.isFrozen(e)?Bp(e):e}var Cbt="11.11.1";class Tbt extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const MM=Dke,cY=Bp,uY=Symbol("nomatch"),Abt=7,Hke=function(e){const t=Object.create(null),n=Object.create(null),i=[];let r=!0;const s="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:Bgt};function c(R){return l.noHighlightRe.test(R)}function u(R){let L=R.className+" ";L+=R.parentNode?R.parentNode.className:"";const M=l.languageDetectRe.exec(L);if(M){const U=C(M[1]);return U||(lY(s.replace("{}",M[1])),lY("Falling back to no-highlight mode for this block.",R)),U?M[1]:"no-highlight"}return L.split(/\s+/).find(U=>c(U)||C(U))}function d(R,L,M){let U="",I="";typeof L=="object"?(U=R,M=L.ignoreIllegals,I=L.language):($0("10.7.0","highlight(lang, code, ...args) has been deprecated."),$0("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),I=R,U=L),M===void 0&&(M=!0);const H={code:U,language:I};T("before:highlight",H);const Z=H.result?H.result:f(H.language,H.code,M);return Z.code=H.code,T("after:highlight",Z),Z}function f(R,L,M,U){const I=Object.create(null);function H(J,pe){return J.keywords[pe]}function Z(){if(!De.keywords){Ne.addText(Ke);return}let J=0;De.keywordPatternRe.lastIndex=0;let pe=De.keywordPatternRe.exec(Ke),oe="";for(;pe;){oe+=Ke.substring(J,pe.index);const Me=xe.case_insensitive?pe[0].toLowerCase():pe[0],Ve=H(De,Me);if(Ve){const[ht,Se]=Ve;if(Ne.addText(oe),oe="",I[Me]=(I[Me]||0)+1,I[Me]<=Abt&&(wt+=Se),ht.startsWith("_"))oe+=pe[0];else{const ve=xe.classNameAliases[ht]||ht;B(pe[0],ve)}}else oe+=pe[0];J=De.keywordPatternRe.lastIndex,pe=De.keywordPatternRe.exec(Ke)}oe+=Ke.substring(J),Ne.addText(oe)}function Q(){if(Ke==="")return;let J=null;if(typeof De.subLanguage=="string"){if(!t[De.subLanguage]){Ne.addText(Ke);return}J=f(De.subLanguage,Ke,!0,Pe[De.subLanguage]),Pe[De.subLanguage]=J._top}else J=p(Ke,De.subLanguage.length?De.subLanguage:null);De.relevance>0&&(wt+=J.relevance),Ne.__addSublanguage(J._emitter,J.language)}function q(){De.subLanguage!=null?Q():Z(),Ke=""}function B(J,pe){J!==""&&(Ne.startScope(pe),Ne.addText(J),Ne.endScope())}function te(J,pe){let oe=1;const Me=pe.length-1;for(;oe<=Me;){if(!J._emit[oe]){oe++;continue}const Ve=xe.classNameAliases[J[oe]]||J[oe],ht=pe[oe];Ve?B(ht,Ve):(Ke=ht,Z(),Ke=""),oe++}}function ce(J,pe){return J.scope&&typeof J.scope=="string"&&Ne.openNode(xe.classNameAliases[J.scope]||J.scope),J.beginScope&&(J.beginScope._wrap?(B(Ke,xe.classNameAliases[J.beginScope._wrap]||J.beginScope._wrap),Ke=""):J.beginScope._multi&&(te(J.beginScope,pe),Ke="")),De=Object.create(J,{parent:{value:De}}),De}function se(J,pe,oe){let Me=Vgt(J.endRe,oe);if(Me){if(J["on:end"]){const Ve=new rY(J);J["on:end"](pe,Ve),Ve.isMatchIgnored&&(Me=!1)}if(Me){for(;J.endsParent&&J.parent;)J=J.parent;return J}}if(J.endsWithParent)return se(J.parent,pe,oe)}function re(J){return De.matcher.regexIndex===0?(Ke+=J[0],1):(Be=!0,0)}function ge(J){const pe=J[0],oe=J.rule,Me=new rY(oe),Ve=[oe.__beforeBegin,oe["on:begin"]];for(const ht of Ve)if(ht&&(ht(J,Me),Me.isMatchIgnored))return re(pe);return oe.skip?Ke+=pe:(oe.excludeBegin&&(Ke+=pe),q(),!oe.returnBegin&&!oe.excludeBegin&&(Ke=pe)),ce(oe,J),oe.returnBegin?0:pe.length}function G(J){const pe=J[0],oe=L.substring(J.index),Me=se(De,J,oe);if(!Me)return uY;const Ve=De;De.endScope&&De.endScope._wrap?(q(),B(pe,De.endScope._wrap)):De.endScope&&De.endScope._multi?(q(),te(De.endScope,J)):Ve.skip?Ke+=pe:(Ve.returnEnd||Ve.excludeEnd||(Ke+=pe),q(),Ve.excludeEnd&&(Ke=pe));do De.scope&&Ne.closeNode(),!De.skip&&!De.subLanguage&&(wt+=De.relevance),De=De.parent;while(De!==Me.parent);return Me.starts&&ce(Me.starts,J),Ve.returnEnd?0:pe.length}function K(){const J=[];for(let pe=De;pe!==xe;pe=pe.parent)pe.scope&&J.unshift(pe.scope);J.forEach(pe=>Ne.openNode(pe))}let ae={};function ue(J,pe){const oe=pe&&pe[0];if(Ke+=J,oe==null)return q(),0;if(ae.type==="begin"&&pe.type==="end"&&ae.index===pe.index&&oe===""){if(Ke+=L.slice(pe.index,pe.index+1),!r){const Me=new Error(`0 width match regex (${R})`);throw Me.languageName=R,Me.badRule=ae.rule,Me}return 1}if(ae=pe,pe.type==="begin")return ge(pe);if(pe.type==="illegal"&&!M){const Me=new Error('Illegal lexeme "'+oe+'" for mode "'+(De.scope||"")+'"');throw Me.mode=De,Me}else if(pe.type==="end"){const Me=G(pe);if(Me!==uY)return Me}if(pe.type==="illegal"&&oe==="")return Ke+=` +`,1;if(Ie>1e5&&Ie>pe.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ke+=oe,oe.length}const xe=C(R);if(!xe)throw sb(s.replace("{}",R)),new Error('Unknown language: "'+R+'"');const Ee=kbt(xe);let Je="",De=U||Ee;const Pe={},Ne=new l.__emitter(l);K();let Ke="",wt=0,ot=0,Ie=0,Be=!1;try{if(xe.__emitTokens)xe.__emitTokens(L,Ne);else{for(De.matcher.considerAll();;){Ie++,Be?Be=!1:De.matcher.considerAll(),De.matcher.lastIndex=ot;const J=De.matcher.exec(L);if(!J)break;const pe=L.substring(ot,J.index),oe=ue(pe,J);ot=J.index+oe}ue(L.substring(ot))}return Ne.finalize(),Je=Ne.toHTML(),{language:R,value:Je,relevance:wt,illegal:!1,_emitter:Ne,_top:De}}catch(J){if(J.message&&J.message.includes("Illegal"))return{language:R,value:MM(L),illegal:!0,relevance:0,_illegalBy:{message:J.message,index:ot,context:L.slice(ot-100,ot+100),mode:J.mode,resultSoFar:Je},_emitter:Ne};if(r)return{language:R,value:MM(L),illegal:!1,relevance:0,errorRaised:J,_emitter:Ne,_top:De};throw J}}function h(R){const L={value:MM(R),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return L._emitter.addText(R),L}function p(R,L){L=L||l.languages||Object.keys(t);const M=h(R),U=L.filter(C).filter(_).map(q=>f(q,R,!1));U.unshift(M);const I=U.sort((q,B)=>{if(q.relevance!==B.relevance)return B.relevance-q.relevance;if(q.language&&B.language){if(C(q.language).supersetOf===B.language)return 1;if(C(B.language).supersetOf===q.language)return-1}return 0}),[H,Z]=I,Q=H;return Q.secondBest=Z,Q}function g(R,L,M){const U=L&&n[L]||M;R.classList.add("hljs"),R.classList.add(`language-${U}`)}function b(R){let L=null;const M=u(R);if(c(M))return;if(T("before:highlightElement",{el:R,language:M}),R.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",R);return}if(R.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(R)),l.throwUnescapedHTML))throw new Tbt("One of your code blocks includes unescaped HTML.",R.innerHTML);L=R;const U=L.textContent,I=M?d(U,{language:M,ignoreIllegals:!0}):p(U);R.innerHTML=I.value,R.dataset.highlighted="yes",g(R,M,I.language),R.result={language:I.language,re:I.relevance,relevance:I.relevance},I.secondBest&&(R.secondBest={language:I.secondBest.language,relevance:I.secondBest.relevance}),T("after:highlightElement",{el:R,result:I,text:U})}function v(R){l=cY(l,R)}const y=()=>{w(),$0("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function x(){w(),$0("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let O=!1;function w(){function R(){w()}if(document.readyState==="loading"){O||window.addEventListener("DOMContentLoaded",R,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(b)}function k(R,L){let M=null;try{M=L(e)}catch(U){if(sb("Language definition for '{}' could not be registered.".replace("{}",R)),r)sb(U);else throw U;M=a}M.name||(M.name=R),t[R]=M,M.rawDefinition=L.bind(null,e),M.aliases&&N(M.aliases,{languageName:R})}function S(R){delete t[R];for(const L of Object.keys(n))n[L]===R&&delete n[L]}function E(){return Object.keys(t)}function C(R){return R=(R||"").toLowerCase(),t[R]||t[n[R]]}function N(R,{languageName:L}){typeof R=="string"&&(R=[R]),R.forEach(M=>{n[M.toLowerCase()]=L})}function _(R){const L=C(R);return L&&!L.disableAutodetect}function j(R){R["before:highlightBlock"]&&!R["before:highlightElement"]&&(R["before:highlightElement"]=L=>{R["before:highlightBlock"](Object.assign({block:L.el},L))}),R["after:highlightBlock"]&&!R["after:highlightElement"]&&(R["after:highlightElement"]=L=>{R["after:highlightBlock"](Object.assign({block:L.el},L))})}function A(R){j(R),i.push(R)}function F(R){const L=i.indexOf(R);L!==-1&&i.splice(L,1)}function T(R,L){const M=R;i.forEach(function(U){U[M]&&U[M](L)})}function P(R){return $0("10.7.0","highlightBlock will be removed entirely in v12.0"),$0("10.7.0","Please use highlightElement now."),b(R)}Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:w,highlightElement:b,highlightBlock:P,configure:v,initHighlighting:y,initHighlightingOnLoad:x,registerLanguage:k,unregisterLanguage:S,listLanguages:E,getLanguage:C,registerAliases:N,autoDetection:_,inherit:cY,addPlugin:A,removePlugin:F}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=Cbt,e.regex={concat:i0,lookahead:Mke,either:tU,optional:Qgt,anyNumberOfTimes:Ugt};for(const R in RT)typeof RT[R]=="object"&&Pke(RT[R]);return Object.assign(e,RT),e},Jv=Hke({});Jv.newInstance=()=>Hke({});var _bt=Jv;Jv.HighlightJS=Jv;Jv.default=Jv;const vo=px(_bt),dY={},Nbt="hljs-";function jbt(e){const t=vo.newInstance();return e&&s(e),{highlight:n,highlightAuto:i,listLanguages:r,register:s,registerAlias:a,registered:l};function n(c,u,d){const f=d||dY,h=typeof f.prefix=="string"?f.prefix:Nbt;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:Rbt,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 g=p._emitter.root,b=g.data;return b.language=p.language,b.relevance=p.relevance,g}function i(c,u){const f=(u||dY).subset||r();let h=-1,p=0,g;for(;++hp&&(p=v.data.relevance,g=v)}return g||{type:"root",children:[],data:{language:void 0,relevance:p}}}function r(){return t.listLanguages()}function s(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 Rbt{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],i=n.children[n.children.length-1];i&&i.type==="text"?i.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const i=this.stack[this.stack.length-1],r=t.root.children;n?i.children.push({type:"element",tagName:"span",properties:{className:[n]},children:r}):i.children.push(...r)}openNode(t){const n=this,i=t.split(".").map(function(a,l){return l?a+"_".repeat(l):n.options.classPrefix+a}),r=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:i},children:[]};r.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const Ibt={};function fY(e){const t=e||Ibt,n=t.aliases,i=t.detect||!1,r=t.languages||Mgt,s=t.plainText,a=t.prefix,l=t.subset;let c="hljs";const u=jbt(r);if(n&&u.registerAlias(n),a){const d=a.indexOf("-");c=d===-1?a:a.slice(0,d)}return function(d,f){vE(d,"element",function(h,p,g){if(h.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const b=Pbt(h);if(b===!1||!b&&!i||b&&s&&s.includes(b))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(c)||h.properties.className.unshift(c);const v=bmt(h,{whitespace:"pre"});let y;try{y=b?u.highlight(b,v,{prefix:a}):u.highlightAuto(v,{prefix:a,subset:l})}catch(x){const O=x;if(b&&/Unknown language/.test(O.message)){f.message("Cannot highlight as `"+b+"`, it’s not registered",{ancestors:[g,h],cause:O,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw O}!b&&y.data&&y.data.language&&h.properties.className.push("language-"+y.data.language),y.children.length>0&&(h.children=y.children)})}}function Pbt(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let i;for(;++n-1&&s<=t.length){let a=0;for(;;){let l=n[a];if(l===void 0){const c=mY(t,n[a-1]);l=c===-1?t.length+1:c+1,n[a]=l}if(l>s)return{line:a+1,column:s-(a>0?n[a-1]:0)+1,offset:s};a++}}}function r(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length1?n[s.line-2]:0)+s.column-1;if(a=55296&&e<=57343}function a0t(e){return e>=56320&&e<=57343}function o0t(e,t){return(e-55296)*1024+9216+t}function Yke(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Zke(e){return e>=64976&&e<=65007||s0t.has(e)}var Ze;(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"})(Ze||(Ze={}));const l0t=65536;class c0t{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=l0t,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:i,col:r,offset:s}=this,a=r+n,l=s+n;return{code:t,startLine:i,endLine:i,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(a0t(n))return this.pos++,this._addGap(),o0t(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,le.EOF;return this._err(Ze.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 i=0;i=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,le.EOF;const i=this.html.charCodeAt(n);return i===le.CARRIAGE_RETURN?le.LINE_FEED:i}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,le.EOF;let t=this.html.charCodeAt(this.pos);return t===le.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,le.LINE_FEED):t===le.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Xke(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===le.LINE_FEED||t===le.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){Yke(t)?this._err(Ze.controlCharacterInInputStream):Zke(t)&&this._err(Ze.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 u0t=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))),d0t=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 f0t(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=d0t.get(e))!==null&&t!==void 0?t:e}var Da;(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"})(Da||(Da={}));const h0t=32;var Up;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Up||(Up={}));function U6(e){return e>=Da.ZERO&&e<=Da.NINE}function p0t(e){return e>=Da.UPPER_A&&e<=Da.UPPER_F||e>=Da.LOWER_A&&e<=Da.LOWER_F}function m0t(e){return e>=Da.UPPER_A&&e<=Da.UPPER_Z||e>=Da.LOWER_A&&e<=Da.LOWER_Z||U6(e)}function g0t(e){return e===Da.EQUALS||m0t(e)}var Ta;(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"})(Ta||(Ta={}));var Uf;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Uf||(Uf={}));class b0t{constructor(t,n,i){this.decodeTree=t,this.emitCodePoint=n,this.errors=i,this.state=Ta.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Uf.Strict}startEntity(t){this.decodeMode=t,this.state=Ta.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Ta.EntityStart:return t.charCodeAt(n)===Da.NUM?(this.state=Ta.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Ta.NamedEntity,this.stateNamedEntity(t,n));case Ta.NumericStart:return this.stateNumericStart(t,n);case Ta.NumericDecimal:return this.stateNumericDecimal(t,n);case Ta.NumericHex:return this.stateNumericHex(t,n);case Ta.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|h0t)===Da.LOWER_X?(this.state=Ta.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Ta.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,i,r){if(n!==i){const s=i-n;this.result=this.result*Math.pow(r,s)+Number.parseInt(t.substr(n,s),r),this.consumed+=s}}stateNumericHex(t,n){const i=n;for(;n>14;for(;n>14,s!==0){if(a===Da.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Uf.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:i}=this,r=(i[n]&Up.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,r,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,i){const{decodeTree:r}=this;return this.emitCodePoint(n===1?r[t]&~Up.VALUE_LENGTH:r[t+1],i),n===3&&this.emitCodePoint(r[t+2],i),i}end(){var t;switch(this.state){case Ta.NamedEntity:return this.result!==0&&(this.decodeMode!==Uf.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ta.NumericDecimal:return this.emitNumericEntity(0,2);case Ta.NumericHex:return this.emitNumericEntity(0,3);case Ta.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ta.EntityStart:return 0}}}function y0t(e,t,n,i){const r=(t&Up.BRANCH_LENGTH)>>7,s=t&Up.JUMP_TABLE;if(r===0)return s!==0&&i===s?n:-1;if(s){const c=i-s;return c<0||c>=r?-1:e[n+c]-1}let a=n,l=a+r-1;for(;a<=l;){const c=a+l>>>1,u=e[c];if(ui)l=c-1;else return e[c+r]}return-1}var vt;(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/"})(vt||(vt={}));var ab;(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"})(ab||(ab={}));var $c;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})($c||($c={}));var Ue;(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"})(Ue||(Ue={}));var D;(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"})(D||(D={}));const v0t=new Map([[Ue.A,D.A],[Ue.ADDRESS,D.ADDRESS],[Ue.ANNOTATION_XML,D.ANNOTATION_XML],[Ue.APPLET,D.APPLET],[Ue.AREA,D.AREA],[Ue.ARTICLE,D.ARTICLE],[Ue.ASIDE,D.ASIDE],[Ue.B,D.B],[Ue.BASE,D.BASE],[Ue.BASEFONT,D.BASEFONT],[Ue.BGSOUND,D.BGSOUND],[Ue.BIG,D.BIG],[Ue.BLOCKQUOTE,D.BLOCKQUOTE],[Ue.BODY,D.BODY],[Ue.BR,D.BR],[Ue.BUTTON,D.BUTTON],[Ue.CAPTION,D.CAPTION],[Ue.CENTER,D.CENTER],[Ue.CODE,D.CODE],[Ue.COL,D.COL],[Ue.COLGROUP,D.COLGROUP],[Ue.DD,D.DD],[Ue.DESC,D.DESC],[Ue.DETAILS,D.DETAILS],[Ue.DIALOG,D.DIALOG],[Ue.DIR,D.DIR],[Ue.DIV,D.DIV],[Ue.DL,D.DL],[Ue.DT,D.DT],[Ue.EM,D.EM],[Ue.EMBED,D.EMBED],[Ue.FIELDSET,D.FIELDSET],[Ue.FIGCAPTION,D.FIGCAPTION],[Ue.FIGURE,D.FIGURE],[Ue.FONT,D.FONT],[Ue.FOOTER,D.FOOTER],[Ue.FOREIGN_OBJECT,D.FOREIGN_OBJECT],[Ue.FORM,D.FORM],[Ue.FRAME,D.FRAME],[Ue.FRAMESET,D.FRAMESET],[Ue.H1,D.H1],[Ue.H2,D.H2],[Ue.H3,D.H3],[Ue.H4,D.H4],[Ue.H5,D.H5],[Ue.H6,D.H6],[Ue.HEAD,D.HEAD],[Ue.HEADER,D.HEADER],[Ue.HGROUP,D.HGROUP],[Ue.HR,D.HR],[Ue.HTML,D.HTML],[Ue.I,D.I],[Ue.IMG,D.IMG],[Ue.IMAGE,D.IMAGE],[Ue.INPUT,D.INPUT],[Ue.IFRAME,D.IFRAME],[Ue.KEYGEN,D.KEYGEN],[Ue.LABEL,D.LABEL],[Ue.LI,D.LI],[Ue.LINK,D.LINK],[Ue.LISTING,D.LISTING],[Ue.MAIN,D.MAIN],[Ue.MALIGNMARK,D.MALIGNMARK],[Ue.MARQUEE,D.MARQUEE],[Ue.MATH,D.MATH],[Ue.MENU,D.MENU],[Ue.META,D.META],[Ue.MGLYPH,D.MGLYPH],[Ue.MI,D.MI],[Ue.MO,D.MO],[Ue.MN,D.MN],[Ue.MS,D.MS],[Ue.MTEXT,D.MTEXT],[Ue.NAV,D.NAV],[Ue.NOBR,D.NOBR],[Ue.NOFRAMES,D.NOFRAMES],[Ue.NOEMBED,D.NOEMBED],[Ue.NOSCRIPT,D.NOSCRIPT],[Ue.OBJECT,D.OBJECT],[Ue.OL,D.OL],[Ue.OPTGROUP,D.OPTGROUP],[Ue.OPTION,D.OPTION],[Ue.P,D.P],[Ue.PARAM,D.PARAM],[Ue.PLAINTEXT,D.PLAINTEXT],[Ue.PRE,D.PRE],[Ue.RB,D.RB],[Ue.RP,D.RP],[Ue.RT,D.RT],[Ue.RTC,D.RTC],[Ue.RUBY,D.RUBY],[Ue.S,D.S],[Ue.SCRIPT,D.SCRIPT],[Ue.SEARCH,D.SEARCH],[Ue.SECTION,D.SECTION],[Ue.SELECT,D.SELECT],[Ue.SOURCE,D.SOURCE],[Ue.SMALL,D.SMALL],[Ue.SPAN,D.SPAN],[Ue.STRIKE,D.STRIKE],[Ue.STRONG,D.STRONG],[Ue.STYLE,D.STYLE],[Ue.SUB,D.SUB],[Ue.SUMMARY,D.SUMMARY],[Ue.SUP,D.SUP],[Ue.TABLE,D.TABLE],[Ue.TBODY,D.TBODY],[Ue.TEMPLATE,D.TEMPLATE],[Ue.TEXTAREA,D.TEXTAREA],[Ue.TFOOT,D.TFOOT],[Ue.TD,D.TD],[Ue.TH,D.TH],[Ue.THEAD,D.THEAD],[Ue.TITLE,D.TITLE],[Ue.TR,D.TR],[Ue.TRACK,D.TRACK],[Ue.TT,D.TT],[Ue.U,D.U],[Ue.UL,D.UL],[Ue.SVG,D.SVG],[Ue.VAR,D.VAR],[Ue.WBR,D.WBR],[Ue.XMP,D.XMP]]);function Gx(e){var t;return(t=v0t.get(e))!==null&&t!==void 0?t:D.UNKNOWN}const kt=D,x0t={[vt.HTML]:new Set([kt.ADDRESS,kt.APPLET,kt.AREA,kt.ARTICLE,kt.ASIDE,kt.BASE,kt.BASEFONT,kt.BGSOUND,kt.BLOCKQUOTE,kt.BODY,kt.BR,kt.BUTTON,kt.CAPTION,kt.CENTER,kt.COL,kt.COLGROUP,kt.DD,kt.DETAILS,kt.DIR,kt.DIV,kt.DL,kt.DT,kt.EMBED,kt.FIELDSET,kt.FIGCAPTION,kt.FIGURE,kt.FOOTER,kt.FORM,kt.FRAME,kt.FRAMESET,kt.H1,kt.H2,kt.H3,kt.H4,kt.H5,kt.H6,kt.HEAD,kt.HEADER,kt.HGROUP,kt.HR,kt.HTML,kt.IFRAME,kt.IMG,kt.INPUT,kt.LI,kt.LINK,kt.LISTING,kt.MAIN,kt.MARQUEE,kt.MENU,kt.META,kt.NAV,kt.NOEMBED,kt.NOFRAMES,kt.NOSCRIPT,kt.OBJECT,kt.OL,kt.P,kt.PARAM,kt.PLAINTEXT,kt.PRE,kt.SCRIPT,kt.SECTION,kt.SELECT,kt.SOURCE,kt.STYLE,kt.SUMMARY,kt.TABLE,kt.TBODY,kt.TD,kt.TEMPLATE,kt.TEXTAREA,kt.TFOOT,kt.TH,kt.THEAD,kt.TITLE,kt.TR,kt.TRACK,kt.UL,kt.WBR,kt.XMP]),[vt.MATHML]:new Set([kt.MI,kt.MO,kt.MN,kt.MS,kt.MTEXT,kt.ANNOTATION_XML]),[vt.SVG]:new Set([kt.TITLE,kt.FOREIGN_OBJECT,kt.DESC]),[vt.XLINK]:new Set,[vt.XML]:new Set,[vt.XMLNS]:new Set},Q6=new Set([kt.H1,kt.H2,kt.H3,kt.H4,kt.H5,kt.H6]);Ue.STYLE,Ue.SCRIPT,Ue.XMP,Ue.IFRAME,Ue.NOEMBED,Ue.NOFRAMES,Ue.PLAINTEXT;var fe;(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"})(fe||(fe={}));const $s={DATA:fe.DATA,RCDATA:fe.RCDATA,RAWTEXT:fe.RAWTEXT,SCRIPT_DATA:fe.SCRIPT_DATA,PLAINTEXT:fe.PLAINTEXT,CDATA_SECTION:fe.CDATA_SECTION};function w0t(e){return e>=le.DIGIT_0&&e<=le.DIGIT_9}function $w(e){return e>=le.LATIN_CAPITAL_A&&e<=le.LATIN_CAPITAL_Z}function O0t(e){return e>=le.LATIN_SMALL_A&&e<=le.LATIN_SMALL_Z}function gp(e){return O0t(e)||$w(e)}function bY(e){return gp(e)||w0t(e)}function IT(e){return e+32}function eEe(e){return e===le.SPACE||e===le.LINE_FEED||e===le.TABULATION||e===le.FORM_FEED}function yY(e){return eEe(e)||e===le.SOLIDUS||e===le.GREATER_THAN_SIGN}function S0t(e){return e===le.NULL?Ze.nullCharacterReference:e>1114111?Ze.characterReferenceOutsideUnicodeRange:Xke(e)?Ze.surrogateCharacterReference:Zke(e)?Ze.noncharacterCharacterReference:Yke(e)||e===le.CARRIAGE_RETURN?Ze.controlCharacterReference:null}class k0t{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=fe.DATA,this.returnState=fe.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new c0t(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new b0t(u0t,(i,r)=>{this.preprocessor.pos=this.entityStartPos+r-1,this._flushCodePointConsumedAsCharacterReference(i)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(Ze.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:i=>{this._err(Ze.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+i)},validateNumericCharacterReference:i=>{const r=S0t(i);r&&this._err(r,1)}}:void 0)}_err(t,n=0){var i,r;(r=(i=this.handler).onParseError)===null||r===void 0||r.call(i,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,i){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||i==null||i()}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(Ze.endTagWithAttributes),t.selfClosing&&this._err(Ze.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 di.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case di.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case di.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:di.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=eEe(t)?di.WHITESPACE_CHARACTER:t===le.NULL?di.NULL_CHARACTER:di.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(di.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=fe.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Uf.Attribute:Uf.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===fe.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===fe.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===fe.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case fe.DATA:{this._stateData(t);break}case fe.RCDATA:{this._stateRcdata(t);break}case fe.RAWTEXT:{this._stateRawtext(t);break}case fe.SCRIPT_DATA:{this._stateScriptData(t);break}case fe.PLAINTEXT:{this._statePlaintext(t);break}case fe.TAG_OPEN:{this._stateTagOpen(t);break}case fe.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case fe.TAG_NAME:{this._stateTagName(t);break}case fe.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case fe.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case fe.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case fe.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case fe.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case fe.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case fe.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case fe.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case fe.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case fe.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case fe.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case fe.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case fe.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case fe.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case fe.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case fe.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case fe.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case fe.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case fe.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case fe.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case fe.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case fe.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case fe.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case fe.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case fe.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case fe.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case fe.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case fe.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case fe.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case fe.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case fe.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case fe.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case fe.BOGUS_COMMENT:{this._stateBogusComment(t);break}case fe.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case fe.COMMENT_START:{this._stateCommentStart(t);break}case fe.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case fe.COMMENT:{this._stateComment(t);break}case fe.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case fe.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case fe.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case fe.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case fe.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case fe.COMMENT_END:{this._stateCommentEnd(t);break}case fe.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case fe.DOCTYPE:{this._stateDoctype(t);break}case fe.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case fe.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case fe.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case fe.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case fe.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case fe.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case fe.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case fe.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case fe.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case fe.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case fe.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case fe.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case fe.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case fe.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case fe.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case fe.CDATA_SECTION:{this._stateCdataSection(t);break}case fe.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case fe.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case fe.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case fe.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case le.LESS_THAN_SIGN:{this.state=fe.TAG_OPEN;break}case le.AMPERSAND:{this._startCharacterReference();break}case le.NULL:{this._err(Ze.unexpectedNullCharacter),this._emitCodePoint(t);break}case le.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case le.AMPERSAND:{this._startCharacterReference();break}case le.LESS_THAN_SIGN:{this.state=fe.RCDATA_LESS_THAN_SIGN;break}case le.NULL:{this._err(Ze.unexpectedNullCharacter),this._emitChars(Zr);break}case le.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case le.LESS_THAN_SIGN:{this.state=fe.RAWTEXT_LESS_THAN_SIGN;break}case le.NULL:{this._err(Ze.unexpectedNullCharacter),this._emitChars(Zr);break}case le.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case le.LESS_THAN_SIGN:{this.state=fe.SCRIPT_DATA_LESS_THAN_SIGN;break}case le.NULL:{this._err(Ze.unexpectedNullCharacter),this._emitChars(Zr);break}case le.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case le.NULL:{this._err(Ze.unexpectedNullCharacter),this._emitChars(Zr);break}case le.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(gp(t))this._createStartTagToken(),this.state=fe.TAG_NAME,this._stateTagName(t);else switch(t){case le.EXCLAMATION_MARK:{this.state=fe.MARKUP_DECLARATION_OPEN;break}case le.SOLIDUS:{this.state=fe.END_TAG_OPEN;break}case le.QUESTION_MARK:{this._err(Ze.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=fe.BOGUS_COMMENT,this._stateBogusComment(t);break}case le.EOF:{this._err(Ze.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(Ze.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=fe.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(gp(t))this._createEndTagToken(),this.state=fe.TAG_NAME,this._stateTagName(t);else switch(t){case le.GREATER_THAN_SIGN:{this._err(Ze.missingEndTagName),this.state=fe.DATA;break}case le.EOF:{this._err(Ze.eofBeforeTagName),this._emitChars("");break}case le.NULL:{this._err(Ze.unexpectedNullCharacter),this.state=fe.SCRIPT_DATA_ESCAPED,this._emitChars(Zr);break}case le.EOF:{this._err(Ze.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=fe.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===le.SOLIDUS?this.state=fe.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:gp(t)?(this._emitChars("<"),this.state=fe.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=fe.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){gp(t)?(this.state=fe.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case le.NULL:{this._err(Ze.unexpectedNullCharacter),this.state=fe.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Zr);break}case le.EOF:{this._err(Ze.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=fe.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===le.SOLIDUS?(this.state=fe.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=fe.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(el.SCRIPT,!1)&&yY(this.preprocessor.peek(el.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 i=this._indexOf(t);this.items[i]=n,i===this.stackTop&&(this.current=n)}insertAfter(t,n,i){const r=this._indexOf(t)+1;this.items.splice(r,0,n),this.tagIDs.splice(r,0,i),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===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])!==vt.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;i--)if(t.has(this.tagIDs[i])&&this.treeAdapter.getNamespaceURI(this.items[i])===n)return i;return-1}clearBackTo(t,n){const i=this._indexOfTagNames(t,n);this.shortenToLength(i+1)}clearBackToTableContext(){this.clearBackTo(_0t,vt.HTML)}clearBackToTableBodyContext(){this.clearBackTo(A0t,vt.HTML)}clearBackToTableRowContext(){this.clearBackTo(T0t,vt.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]===D.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]===D.HTML}hasInDynamicScope(t,n){for(let i=this.stackTop;i>=0;i--){const r=this.tagIDs[i];switch(this.treeAdapter.getNamespaceURI(this.items[i])){case vt.HTML:{if(r===t)return!0;if(n.has(r))return!1;break}case vt.SVG:{if(wY.has(r))return!1;break}case vt.MATHML:{if(xY.has(r))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,gN)}hasInListItemScope(t){return this.hasInDynamicScope(t,E0t)}hasInButtonScope(t){return this.hasInDynamicScope(t,C0t)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case vt.HTML:{if(Q6.has(n))return!0;if(gN.has(n))return!1;break}case vt.SVG:{if(wY.has(n))return!1;break}case vt.MATHML:{if(xY.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===vt.HTML)switch(this.tagIDs[n]){case t:return!0;case D.TABLE:case D.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===vt.HTML)switch(this.tagIDs[t]){case D.TBODY:case D.THEAD:case D.TFOOT:return!0;case D.TABLE:case D.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===vt.HTML)switch(this.tagIDs[n]){case t:return!0;case D.OPTION:case D.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&tEe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&vY.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&vY.has(this.currentTagId);)this.pop()}}const LM=3;var md;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(md||(md={}));const OY={type:md.Marker};class R0t{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const i=[],r=n.length,s=this.treeAdapter.getTagName(t),a=this.treeAdapter.getNamespaceURI(t);for(let l=0;l[a.name,a.value]));let s=0;for(let a=0;ar.get(c.name)===c.value)&&(s+=1,s>=LM&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(OY)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:md.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const i=this.entries.indexOf(this.bookmark);this.entries.splice(i,0,{type:md.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(OY);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(i=>i.type===md.Marker||this.treeAdapter.getTagName(i.element)===t);return n&&n.type===md.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===md.Element&&n.element===t)}}const bp={createDocument(){return{nodeName:"#document",mode:$c.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 i=e.childNodes.indexOf(n);e.childNodes.splice(i,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,i){const r=e.childNodes.find(s=>s.nodeName==="#documentType");if(r)r.name=t,r.publicId=n,r.systemId=i;else{const s={nodeName:"#documentType",name:t,publicId:n,systemId:i,parentNode:null};bp.appendChild(e,s)}},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(bp.isTextNode(n)){n.value+=t;return}}bp.appendChild(e,bp.createTextNode(t))},insertTextBefore(e,t,n){const i=e.childNodes[e.childNodes.indexOf(n)-1];i&&bp.isTextNode(i)?i.value+=t:bp.insertBefore(e,bp.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(i=>i.name));for(let i=0;ie.startsWith(n))}function $0t(e){return e.name===nEe&&e.publicId===null&&(e.systemId===null||e.systemId===I0t)}function F0t(e){if(e.name!==nEe)return $c.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===P0t)return $c.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),M0t.has(n))return $c.QUIRKS;let i=t===null?D0t:iEe;if(SY(n,i))return $c.QUIRKS;if(i=t===null?rEe:L0t,SY(n,i))return $c.LIMITED_QUIRKS}return $c.NO_QUIRKS}const kY={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},B0t="definitionurl",U0t="definitionURL",Q0t=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])),z0t=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:vt.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:vt.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:vt.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:vt.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:vt.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:vt.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:vt.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:vt.XML}],["xml:space",{prefix:"xml",name:"space",namespace:vt.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:vt.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:vt.XMLNS}]]),V0t=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])),H0t=new Set([D.B,D.BIG,D.BLOCKQUOTE,D.BODY,D.BR,D.CENTER,D.CODE,D.DD,D.DIV,D.DL,D.DT,D.EM,D.EMBED,D.H1,D.H2,D.H3,D.H4,D.H5,D.H6,D.HEAD,D.HR,D.I,D.IMG,D.LI,D.LISTING,D.MENU,D.META,D.NOBR,D.OL,D.P,D.PRE,D.RUBY,D.S,D.SMALL,D.SPAN,D.STRONG,D.STRIKE,D.SUB,D.SUP,D.TABLE,D.TT,D.U,D.UL,D.VAR]);function q0t(e){const t=e.tagID;return t===D.FONT&&e.attrs.some(({name:i})=>i===ab.COLOR||i===ab.SIZE||i===ab.FACE)||H0t.has(t)}function sEe(e){for(let t=0;t0&&this._setContextModes(t,n)}onItemPop(t,n){var i,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(r=(i=this.treeAdapter).onItemPop)===null||r===void 0||r.call(i,t,this.openElements.current),n){let s,a;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,a=this.fragmentContextID):{current:s,currentTagId:a}=this.openElements,this._setContextModes(s,a)}}_setContextModes(t,n){const i=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===vt.HTML;this.currentNotInHTML=!i,this.tokenizer.inForeignNode=!i&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,vt.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=be.TEXT}switchToPlaintextParsing(){this.insertionMode=be.TEXT,this.originalInsertionMode=be.IN_BODY,this.tokenizer.state=$s.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)===Ue.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==vt.HTML))switch(this.fragmentContextID){case D.TITLE:case D.TEXTAREA:{this.tokenizer.state=$s.RCDATA;break}case D.STYLE:case D.XMP:case D.IFRAME:case D.NOEMBED:case D.NOFRAMES:case D.NOSCRIPT:{this.tokenizer.state=$s.RAWTEXT;break}case D.SCRIPT:{this.tokenizer.state=$s.SCRIPT_DATA;break}case D.PLAINTEXT:{this.tokenizer.state=$s.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",i=t.publicId||"",r=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,i,r),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 i=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,i)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const i=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(i??this.document,t)}}_appendElement(t,n){const i=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(i,t.location)}_insertElement(t,n){const i=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(i,t.location),this.openElements.push(i,t.tagID)}_insertFakeElement(t,n){const i=this.treeAdapter.createElement(t,vt.HTML,[]);this._attachElementToTree(i,null),this.openElements.push(i,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,vt.HTML,t.attrs),i=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,i),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(Ue.HTML,vt.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,D.HTML)}_appendCommentNode(t,n){const i=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,i),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,t.location)}_insertCharacters(t){let n,i;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:i}=this._findFosterParentingLocation(),i?this.treeAdapter.insertTextBefore(n,t.chars,i):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const r=this.treeAdapter.getChildNodes(n),s=i?r.lastIndexOf(i):r.length,a=r[s-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 i=this.treeAdapter.getFirstChild(t);i;i=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(i),this.treeAdapter.appendChild(n,i)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const i=n.location,r=this.treeAdapter.getTagName(t),s=n.type===di.END_TAG&&r===n.tagName?{endTag:{...i},endLine:i.endLine,endCol:i.endCol,endOffset:i.endOffset}:{endLine:i.startLine,endCol:i.startCol,endOffset:i.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,s)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,i;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,i=this.fragmentContextID):{current:n,currentTagId:i}=this.openElements,t.tagID===D.SVG&&this.treeAdapter.getTagName(n)===Ue.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===vt.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===D.MGLYPH||t.tagID===D.MALIGNMARK)&&i!==void 0&&!this._isIntegrationPoint(i,n,vt.HTML)}_processToken(t){switch(t.type){case di.CHARACTER:{this.onCharacter(t);break}case di.NULL_CHARACTER:{this.onNullCharacter(t);break}case di.COMMENT:{this.onComment(t);break}case di.DOCTYPE:{this.onDoctype(t);break}case di.START_TAG:{this._processStartTag(t);break}case di.END_TAG:{this.onEndTag(t);break}case di.EOF:{this.onEof(t);break}case di.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,i){const r=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return X0t(t,r,s,i)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(r=>r.type===md.Marker||this.openElements.contains(r.element)),i=n===-1?t-1:n-1;for(let r=i;r>=0;r--){const s=this.activeFormattingElements.entries[r];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=be.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(D.P),this.openElements.popUntilTagNamePopped(D.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case D.TR:{this.insertionMode=be.IN_ROW;return}case D.TBODY:case D.THEAD:case D.TFOOT:{this.insertionMode=be.IN_TABLE_BODY;return}case D.CAPTION:{this.insertionMode=be.IN_CAPTION;return}case D.COLGROUP:{this.insertionMode=be.IN_COLUMN_GROUP;return}case D.TABLE:{this.insertionMode=be.IN_TABLE;return}case D.BODY:{this.insertionMode=be.IN_BODY;return}case D.FRAMESET:{this.insertionMode=be.IN_FRAMESET;return}case D.SELECT:{this._resetInsertionModeForSelect(t);return}case D.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case D.HTML:{this.insertionMode=this.headElement?be.AFTER_HEAD:be.BEFORE_HEAD;return}case D.TD:case D.TH:{if(t>0){this.insertionMode=be.IN_CELL;return}break}case D.HEAD:{if(t>0){this.insertionMode=be.IN_HEAD;return}break}}this.insertionMode=be.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const i=this.openElements.tagIDs[n];if(i===D.TEMPLATE)break;if(i===D.TABLE){this.insertionMode=be.IN_SELECT_IN_TABLE;return}}this.insertionMode=be.IN_SELECT}_isElementCausesFosterParenting(t){return oEe.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 D.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===vt.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case D.TABLE:{const i=this.treeAdapter.getParentNode(n);return i?{parent:i,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 i=this.treeAdapter.getNamespaceURI(t);return x0t[i].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Nvt(this,t);return}switch(this.insertionMode){case be.INITIAL:{W1(this,t);break}case be.BEFORE_HTML:{_O(this,t);break}case be.BEFORE_HEAD:{NO(this,t);break}case be.IN_HEAD:{jO(this,t);break}case be.IN_HEAD_NO_SCRIPT:{RO(this,t);break}case be.AFTER_HEAD:{IO(this,t);break}case be.IN_BODY:case be.IN_CAPTION:case be.IN_CELL:case be.IN_TEMPLATE:{cEe(this,t);break}case be.TEXT:case be.IN_SELECT:case be.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case be.IN_TABLE:case be.IN_TABLE_BODY:case be.IN_ROW:{$M(this,t);break}case be.IN_TABLE_TEXT:{mEe(this,t);break}case be.IN_COLUMN_GROUP:{bN(this,t);break}case be.AFTER_BODY:{yN(this,t);break}case be.AFTER_AFTER_BODY:{wA(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){_vt(this,t);return}switch(this.insertionMode){case be.INITIAL:{W1(this,t);break}case be.BEFORE_HTML:{_O(this,t);break}case be.BEFORE_HEAD:{NO(this,t);break}case be.IN_HEAD:{jO(this,t);break}case be.IN_HEAD_NO_SCRIPT:{RO(this,t);break}case be.AFTER_HEAD:{IO(this,t);break}case be.TEXT:{this._insertCharacters(t);break}case be.IN_TABLE:case be.IN_TABLE_BODY:case be.IN_ROW:{$M(this,t);break}case be.IN_COLUMN_GROUP:{bN(this,t);break}case be.AFTER_BODY:{yN(this,t);break}case be.AFTER_AFTER_BODY:{wA(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){z6(this,t);return}switch(this.insertionMode){case be.INITIAL:case be.BEFORE_HTML:case be.BEFORE_HEAD:case be.IN_HEAD:case be.IN_HEAD_NO_SCRIPT:case be.AFTER_HEAD:case be.IN_BODY:case be.IN_TABLE:case be.IN_CAPTION:case be.IN_COLUMN_GROUP:case be.IN_TABLE_BODY:case be.IN_ROW:case be.IN_CELL:case be.IN_SELECT:case be.IN_SELECT_IN_TABLE:case be.IN_TEMPLATE:case be.IN_FRAMESET:case be.AFTER_FRAMESET:{z6(this,t);break}case be.IN_TABLE_TEXT:{G1(this,t);break}case be.AFTER_BODY:{oyt(this,t);break}case be.AFTER_AFTER_BODY:case be.AFTER_AFTER_FRAMESET:{lyt(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case be.INITIAL:{cyt(this,t);break}case be.BEFORE_HEAD:case be.IN_HEAD:case be.IN_HEAD_NO_SCRIPT:case be.AFTER_HEAD:{this._err(t,Ze.misplacedDoctype);break}case be.IN_TABLE_TEXT:{G1(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,Ze.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?jvt(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case be.INITIAL:{W1(this,t);break}case be.BEFORE_HTML:{uyt(this,t);break}case be.BEFORE_HEAD:{fyt(this,t);break}case be.IN_HEAD:{Ku(this,t);break}case be.IN_HEAD_NO_SCRIPT:{myt(this,t);break}case be.AFTER_HEAD:{byt(this,t);break}case be.IN_BODY:{Oo(this,t);break}case be.IN_TABLE:{ex(this,t);break}case be.IN_TABLE_TEXT:{G1(this,t);break}case be.IN_CAPTION:{hvt(this,t);break}case be.IN_COLUMN_GROUP:{cU(this,t);break}case be.IN_TABLE_BODY:{nI(this,t);break}case be.IN_ROW:{iI(this,t);break}case be.IN_CELL:{gvt(this,t);break}case be.IN_SELECT:{yEe(this,t);break}case be.IN_SELECT_IN_TABLE:{yvt(this,t);break}case be.IN_TEMPLATE:{xvt(this,t);break}case be.AFTER_BODY:{Ovt(this,t);break}case be.IN_FRAMESET:{Svt(this,t);break}case be.AFTER_FRAMESET:{Evt(this,t);break}case be.AFTER_AFTER_BODY:{Tvt(this,t);break}case be.AFTER_AFTER_FRAMESET:{Avt(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?Rvt(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case be.INITIAL:{W1(this,t);break}case be.BEFORE_HTML:{dyt(this,t);break}case be.BEFORE_HEAD:{hyt(this,t);break}case be.IN_HEAD:{pyt(this,t);break}case be.IN_HEAD_NO_SCRIPT:{gyt(this,t);break}case be.AFTER_HEAD:{yyt(this,t);break}case be.IN_BODY:{tI(this,t);break}case be.TEXT:{ivt(this,t);break}case be.IN_TABLE:{VS(this,t);break}case be.IN_TABLE_TEXT:{G1(this,t);break}case be.IN_CAPTION:{pvt(this,t);break}case be.IN_COLUMN_GROUP:{mvt(this,t);break}case be.IN_TABLE_BODY:{V6(this,t);break}case be.IN_ROW:{bEe(this,t);break}case be.IN_CELL:{bvt(this,t);break}case be.IN_SELECT:{vEe(this,t);break}case be.IN_SELECT_IN_TABLE:{vvt(this,t);break}case be.IN_TEMPLATE:{wvt(this,t);break}case be.AFTER_BODY:{wEe(this,t);break}case be.IN_FRAMESET:{kvt(this,t);break}case be.AFTER_FRAMESET:{Cvt(this,t);break}case be.AFTER_AFTER_BODY:{wA(this,t);break}}}onEof(t){switch(this.insertionMode){case be.INITIAL:{W1(this,t);break}case be.BEFORE_HTML:{_O(this,t);break}case be.BEFORE_HEAD:{NO(this,t);break}case be.IN_HEAD:{jO(this,t);break}case be.IN_HEAD_NO_SCRIPT:{RO(this,t);break}case be.AFTER_HEAD:{IO(this,t);break}case be.IN_BODY:case be.IN_TABLE:case be.IN_CAPTION:case be.IN_COLUMN_GROUP:case be.IN_TABLE_BODY:case be.IN_ROW:case be.IN_CELL:case be.IN_SELECT:case be.IN_SELECT_IN_TABLE:{hEe(this,t);break}case be.TEXT:{rvt(this,t);break}case be.IN_TABLE_TEXT:{G1(this,t);break}case be.IN_TEMPLATE:{xEe(this,t);break}case be.AFTER_BODY:case be.IN_FRAMESET:case be.AFTER_FRAMESET:case be.AFTER_AFTER_BODY:case be.AFTER_AFTER_FRAMESET:{lU(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===le.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 be.IN_HEAD:case be.IN_HEAD_NO_SCRIPT:case be.AFTER_HEAD:case be.TEXT:case be.IN_COLUMN_GROUP:case be.IN_SELECT:case be.IN_SELECT_IN_TABLE:case be.IN_FRAMESET:case be.AFTER_FRAMESET:{this._insertCharacters(t);break}case be.IN_BODY:case be.IN_CAPTION:case be.IN_CELL:case be.IN_TEMPLATE:case be.AFTER_BODY:case be.AFTER_AFTER_BODY:case be.AFTER_AFTER_FRAMESET:{lEe(this,t);break}case be.IN_TABLE:case be.IN_TABLE_BODY:case be.IN_ROW:{$M(this,t);break}case be.IN_TABLE_TEXT:{pEe(this,t);break}}}};function tyt(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):fEe(e,t),n}function nyt(e,t){let n=null,i=e.openElements.stackTop;for(;i>=0;i--){const r=e.openElements.items[i];if(r===t.element)break;e._isSpecialElement(r,e.openElements.tagIDs[i])&&(n=r)}return n||(e.openElements.shortenToLength(Math.max(i,0)),e.activeFormattingElements.removeEntry(t)),n}function iyt(e,t,n){let i=t,r=e.openElements.getCommonAncestor(t);for(let s=0,a=r;a!==n;s++,a=r){r=e.openElements.getCommonAncestor(a);const l=e.activeFormattingElements.getElementEntry(a),c=l&&s>=J0t;!l||c?(c&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(a)):(a=ryt(e,l),i===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(i),e.treeAdapter.appendChild(a,i),i=a)}return i}function ryt(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),i=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,i),t.element=i,i}function syt(e,t,n){const i=e.treeAdapter.getTagName(t),r=Gx(i);if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);r===D.TEMPLATE&&s===vt.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function ayt(e,t,n){const i=e.treeAdapter.getNamespaceURI(n.element),{token:r}=n,s=e.treeAdapter.createElement(r.tagName,i,r.attrs);e._adoptNodes(t,s),e.treeAdapter.appendChild(t,s),e.activeFormattingElements.insertElementAfterBookmark(s,r),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,s,r.tagID)}function oU(e,t){for(let n=0;n=n;i--)e._setEndLocation(e.openElements.items[i],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const i=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(i);if(r&&!r.endTag&&(e._setEndLocation(i,t),e.openElements.stackTop>=1)){const s=e.openElements.items[1],a=e.treeAdapter.getNodeSourceCodeLocation(s);a&&!a.endTag&&e._setEndLocation(s,t)}}}}function cyt(e,t){e._setDocumentType(t);const n=t.forceQuirks?$c.QUIRKS:F0t(t);$0t(t)||e._err(t,Ze.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=be.BEFORE_HTML}function W1(e,t){e._err(t,Ze.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,$c.QUIRKS),e.insertionMode=be.BEFORE_HTML,e._processToken(t)}function uyt(e,t){t.tagID===D.HTML?(e._insertElement(t,vt.HTML),e.insertionMode=be.BEFORE_HEAD):_O(e,t)}function dyt(e,t){const n=t.tagID;(n===D.HTML||n===D.HEAD||n===D.BODY||n===D.BR)&&_O(e,t)}function _O(e,t){e._insertFakeRootElement(),e.insertionMode=be.BEFORE_HEAD,e._processToken(t)}function fyt(e,t){switch(t.tagID){case D.HTML:{Oo(e,t);break}case D.HEAD:{e._insertElement(t,vt.HTML),e.headElement=e.openElements.current,e.insertionMode=be.IN_HEAD;break}default:NO(e,t)}}function hyt(e,t){const n=t.tagID;n===D.HEAD||n===D.BODY||n===D.HTML||n===D.BR?NO(e,t):e._err(t,Ze.endTagWithoutMatchingOpenElement)}function NO(e,t){e._insertFakeElement(Ue.HEAD,D.HEAD),e.headElement=e.openElements.current,e.insertionMode=be.IN_HEAD,e._processToken(t)}function Ku(e,t){switch(t.tagID){case D.HTML:{Oo(e,t);break}case D.BASE:case D.BASEFONT:case D.BGSOUND:case D.LINK:case D.META:{e._appendElement(t,vt.HTML),t.ackSelfClosing=!0;break}case D.TITLE:{e._switchToTextParsing(t,$s.RCDATA);break}case D.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,$s.RAWTEXT):(e._insertElement(t,vt.HTML),e.insertionMode=be.IN_HEAD_NO_SCRIPT);break}case D.NOFRAMES:case D.STYLE:{e._switchToTextParsing(t,$s.RAWTEXT);break}case D.SCRIPT:{e._switchToTextParsing(t,$s.SCRIPT_DATA);break}case D.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=be.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(be.IN_TEMPLATE);break}case D.HEAD:{e._err(t,Ze.misplacedStartTagForHeadElement);break}default:jO(e,t)}}function pyt(e,t){switch(t.tagID){case D.HEAD:{e.openElements.pop(),e.insertionMode=be.AFTER_HEAD;break}case D.BODY:case D.BR:case D.HTML:{jO(e,t);break}case D.TEMPLATE:{r0(e,t);break}default:e._err(t,Ze.endTagWithoutMatchingOpenElement)}}function r0(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==D.TEMPLATE&&e._err(t,Ze.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(D.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,Ze.endTagWithoutMatchingOpenElement)}function jO(e,t){e.openElements.pop(),e.insertionMode=be.AFTER_HEAD,e._processToken(t)}function myt(e,t){switch(t.tagID){case D.HTML:{Oo(e,t);break}case D.BASEFONT:case D.BGSOUND:case D.HEAD:case D.LINK:case D.META:case D.NOFRAMES:case D.STYLE:{Ku(e,t);break}case D.NOSCRIPT:{e._err(t,Ze.nestedNoscriptInHead);break}default:RO(e,t)}}function gyt(e,t){switch(t.tagID){case D.NOSCRIPT:{e.openElements.pop(),e.insertionMode=be.IN_HEAD;break}case D.BR:{RO(e,t);break}default:e._err(t,Ze.endTagWithoutMatchingOpenElement)}}function RO(e,t){const n=t.type===di.EOF?Ze.openElementsLeftAfterEof:Ze.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=be.IN_HEAD,e._processToken(t)}function byt(e,t){switch(t.tagID){case D.HTML:{Oo(e,t);break}case D.BODY:{e._insertElement(t,vt.HTML),e.framesetOk=!1,e.insertionMode=be.IN_BODY;break}case D.FRAMESET:{e._insertElement(t,vt.HTML),e.insertionMode=be.IN_FRAMESET;break}case D.BASE:case D.BASEFONT:case D.BGSOUND:case D.LINK:case D.META:case D.NOFRAMES:case D.SCRIPT:case D.STYLE:case D.TEMPLATE:case D.TITLE:{e._err(t,Ze.abandonedHeadElementChild),e.openElements.push(e.headElement,D.HEAD),Ku(e,t),e.openElements.remove(e.headElement);break}case D.HEAD:{e._err(t,Ze.misplacedStartTagForHeadElement);break}default:IO(e,t)}}function yyt(e,t){switch(t.tagID){case D.BODY:case D.HTML:case D.BR:{IO(e,t);break}case D.TEMPLATE:{r0(e,t);break}default:e._err(t,Ze.endTagWithoutMatchingOpenElement)}}function IO(e,t){e._insertFakeElement(Ue.BODY,D.BODY),e.insertionMode=be.IN_BODY,eI(e,t)}function eI(e,t){switch(t.type){case di.CHARACTER:{cEe(e,t);break}case di.WHITESPACE_CHARACTER:{lEe(e,t);break}case di.COMMENT:{z6(e,t);break}case di.START_TAG:{Oo(e,t);break}case di.END_TAG:{tI(e,t);break}case di.EOF:{hEe(e,t);break}}}function lEe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function cEe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function vyt(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function xyt(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function wyt(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,vt.HTML),e.insertionMode=be.IN_FRAMESET)}function Oyt(e,t){e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._insertElement(t,vt.HTML)}function Syt(e,t){e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Q6.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,vt.HTML)}function kyt(e,t){e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._insertElement(t,vt.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function Eyt(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._insertElement(t,vt.HTML),n||(e.formElement=e.openElements.current))}function Cyt(e,t){e.framesetOk=!1;const n=t.tagID;for(let i=e.openElements.stackTop;i>=0;i--){const r=e.openElements.tagIDs[i];if(n===D.LI&&r===D.LI||(n===D.DD||n===D.DT)&&(r===D.DD||r===D.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==D.ADDRESS&&r!==D.DIV&&r!==D.P&&e._isSpecialElement(e.openElements.items[i],r))break}e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._insertElement(t,vt.HTML)}function Tyt(e,t){e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._insertElement(t,vt.HTML),e.tokenizer.state=$s.PLAINTEXT}function Ayt(e,t){e.openElements.hasInScope(D.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(D.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,vt.HTML),e.framesetOk=!1}function _yt(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Ue.A);n&&(oU(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,vt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Nyt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,vt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function jyt(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(D.NOBR)&&(oU(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,vt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Ryt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,vt.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Iyt(e,t){e.treeAdapter.getDocumentMode(e.document)!==$c.QUIRKS&&e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._insertElement(t,vt.HTML),e.framesetOk=!1,e.insertionMode=be.IN_TABLE}function uEe(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,vt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function dEe(e){const t=Jke(e,ab.TYPE);return t!=null&&t.toLowerCase()===Y0t}function Pyt(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,vt.HTML),dEe(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Dyt(e,t){e._appendElement(t,vt.HTML),t.ackSelfClosing=!0}function Myt(e,t){e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._appendElement(t,vt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Lyt(e,t){t.tagName=Ue.IMG,t.tagID=D.IMG,uEe(e,t)}function $yt(e,t){e._insertElement(t,vt.HTML),e.skipNextNewLine=!0,e.tokenizer.state=$s.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=be.TEXT}function Fyt(e,t){e.openElements.hasInButtonScope(D.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,$s.RAWTEXT)}function Byt(e,t){e.framesetOk=!1,e._switchToTextParsing(t,$s.RAWTEXT)}function TY(e,t){e._switchToTextParsing(t,$s.RAWTEXT)}function Uyt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,vt.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===be.IN_TABLE||e.insertionMode===be.IN_CAPTION||e.insertionMode===be.IN_TABLE_BODY||e.insertionMode===be.IN_ROW||e.insertionMode===be.IN_CELL?be.IN_SELECT_IN_TABLE:be.IN_SELECT}function Qyt(e,t){e.openElements.currentTagId===D.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,vt.HTML)}function zyt(e,t){e.openElements.hasInScope(D.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,vt.HTML)}function Vyt(e,t){e.openElements.hasInScope(D.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(D.RTC),e._insertElement(t,vt.HTML)}function Hyt(e,t){e._reconstructActiveFormattingElements(),sEe(t),aU(t),t.selfClosing?e._appendElement(t,vt.MATHML):e._insertElement(t,vt.MATHML),t.ackSelfClosing=!0}function qyt(e,t){e._reconstructActiveFormattingElements(),aEe(t),aU(t),t.selfClosing?e._appendElement(t,vt.SVG):e._insertElement(t,vt.SVG),t.ackSelfClosing=!0}function AY(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,vt.HTML)}function Oo(e,t){switch(t.tagID){case D.I:case D.S:case D.B:case D.U:case D.EM:case D.TT:case D.BIG:case D.CODE:case D.FONT:case D.SMALL:case D.STRIKE:case D.STRONG:{Nyt(e,t);break}case D.A:{_yt(e,t);break}case D.H1:case D.H2:case D.H3:case D.H4:case D.H5:case D.H6:{Syt(e,t);break}case D.P:case D.DL:case D.OL:case D.UL:case D.DIV:case D.DIR:case D.NAV:case D.MAIN:case D.MENU:case D.ASIDE:case D.CENTER:case D.FIGURE:case D.FOOTER:case D.HEADER:case D.HGROUP:case D.DIALOG:case D.DETAILS:case D.ADDRESS:case D.ARTICLE:case D.SEARCH:case D.SECTION:case D.SUMMARY:case D.FIELDSET:case D.BLOCKQUOTE:case D.FIGCAPTION:{Oyt(e,t);break}case D.LI:case D.DD:case D.DT:{Cyt(e,t);break}case D.BR:case D.IMG:case D.WBR:case D.AREA:case D.EMBED:case D.KEYGEN:{uEe(e,t);break}case D.HR:{Myt(e,t);break}case D.RB:case D.RTC:{zyt(e,t);break}case D.RT:case D.RP:{Vyt(e,t);break}case D.PRE:case D.LISTING:{kyt(e,t);break}case D.XMP:{Fyt(e,t);break}case D.SVG:{qyt(e,t);break}case D.HTML:{vyt(e,t);break}case D.BASE:case D.LINK:case D.META:case D.STYLE:case D.TITLE:case D.SCRIPT:case D.BGSOUND:case D.BASEFONT:case D.TEMPLATE:{Ku(e,t);break}case D.BODY:{xyt(e,t);break}case D.FORM:{Eyt(e,t);break}case D.NOBR:{jyt(e,t);break}case D.MATH:{Hyt(e,t);break}case D.TABLE:{Iyt(e,t);break}case D.INPUT:{Pyt(e,t);break}case D.PARAM:case D.TRACK:case D.SOURCE:{Dyt(e,t);break}case D.IMAGE:{Lyt(e,t);break}case D.BUTTON:{Ayt(e,t);break}case D.APPLET:case D.OBJECT:case D.MARQUEE:{Ryt(e,t);break}case D.IFRAME:{Byt(e,t);break}case D.SELECT:{Uyt(e,t);break}case D.OPTION:case D.OPTGROUP:{Qyt(e,t);break}case D.NOEMBED:case D.NOFRAMES:{TY(e,t);break}case D.FRAMESET:{wyt(e,t);break}case D.TEXTAREA:{$yt(e,t);break}case D.NOSCRIPT:{e.options.scriptingEnabled?TY(e,t):AY(e,t);break}case D.PLAINTEXT:{Tyt(e,t);break}case D.COL:case D.TH:case D.TD:case D.TR:case D.HEAD:case D.FRAME:case D.TBODY:case D.TFOOT:case D.THEAD:case D.CAPTION:case D.COLGROUP:break;default:AY(e,t)}}function Wyt(e,t){if(e.openElements.hasInScope(D.BODY)&&(e.insertionMode=be.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function Gyt(e,t){e.openElements.hasInScope(D.BODY)&&(e.insertionMode=be.AFTER_BODY,wEe(e,t))}function Kyt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Xyt(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(D.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(D.FORM):n&&e.openElements.remove(n))}function Yyt(e){e.openElements.hasInButtonScope(D.P)||e._insertFakeElement(Ue.P,D.P),e._closePElement()}function Zyt(e){e.openElements.hasInListItemScope(D.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(D.LI),e.openElements.popUntilTagNamePopped(D.LI))}function Jyt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function evt(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function tvt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function nvt(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Ue.BR,D.BR),e.openElements.pop(),e.framesetOk=!1}function fEe(e,t){const n=t.tagName,i=t.tagID;for(let r=e.openElements.stackTop;r>0;r--){const s=e.openElements.items[r],a=e.openElements.tagIDs[r];if(i===a&&(i!==D.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.stackTop>=r&&e.openElements.shortenToLength(r);break}if(e._isSpecialElement(s,a))break}}function tI(e,t){switch(t.tagID){case D.A:case D.B:case D.I:case D.S:case D.U:case D.EM:case D.TT:case D.BIG:case D.CODE:case D.FONT:case D.NOBR:case D.SMALL:case D.STRIKE:case D.STRONG:{oU(e,t);break}case D.P:{Yyt(e);break}case D.DL:case D.UL:case D.OL:case D.DIR:case D.DIV:case D.NAV:case D.PRE:case D.MAIN:case D.MENU:case D.ASIDE:case D.BUTTON:case D.CENTER:case D.FIGURE:case D.FOOTER:case D.HEADER:case D.HGROUP:case D.DIALOG:case D.ADDRESS:case D.ARTICLE:case D.DETAILS:case D.SEARCH:case D.SECTION:case D.SUMMARY:case D.LISTING:case D.FIELDSET:case D.BLOCKQUOTE:case D.FIGCAPTION:{Kyt(e,t);break}case D.LI:{Zyt(e);break}case D.DD:case D.DT:{Jyt(e,t);break}case D.H1:case D.H2:case D.H3:case D.H4:case D.H5:case D.H6:{evt(e);break}case D.BR:{nvt(e);break}case D.BODY:{Wyt(e,t);break}case D.HTML:{Gyt(e,t);break}case D.FORM:{Xyt(e);break}case D.APPLET:case D.OBJECT:case D.MARQUEE:{tvt(e,t);break}case D.TEMPLATE:{r0(e,t);break}default:fEe(e,t)}}function hEe(e,t){e.tmplInsertionModeStack.length>0?xEe(e,t):lU(e,t)}function ivt(e,t){var n;t.tagID===D.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function rvt(e,t){e._err(t,Ze.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function $M(e,t){if(e.openElements.currentTagId!==void 0&&oEe.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=be.IN_TABLE_TEXT,t.type){case di.CHARACTER:{mEe(e,t);break}case di.WHITESPACE_CHARACTER:{pEe(e,t);break}}else wE(e,t)}function svt(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,vt.HTML),e.insertionMode=be.IN_CAPTION}function avt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,vt.HTML),e.insertionMode=be.IN_COLUMN_GROUP}function ovt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Ue.COLGROUP,D.COLGROUP),e.insertionMode=be.IN_COLUMN_GROUP,cU(e,t)}function lvt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,vt.HTML),e.insertionMode=be.IN_TABLE_BODY}function cvt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Ue.TBODY,D.TBODY),e.insertionMode=be.IN_TABLE_BODY,nI(e,t)}function uvt(e,t){e.openElements.hasInTableScope(D.TABLE)&&(e.openElements.popUntilTagNamePopped(D.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function dvt(e,t){dEe(t)?e._appendElement(t,vt.HTML):wE(e,t),t.ackSelfClosing=!0}function fvt(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,vt.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function ex(e,t){switch(t.tagID){case D.TD:case D.TH:case D.TR:{cvt(e,t);break}case D.STYLE:case D.SCRIPT:case D.TEMPLATE:{Ku(e,t);break}case D.COL:{ovt(e,t);break}case D.FORM:{fvt(e,t);break}case D.TABLE:{uvt(e,t);break}case D.TBODY:case D.TFOOT:case D.THEAD:{lvt(e,t);break}case D.INPUT:{dvt(e,t);break}case D.CAPTION:{svt(e,t);break}case D.COLGROUP:{avt(e,t);break}default:wE(e,t)}}function VS(e,t){switch(t.tagID){case D.TABLE:{e.openElements.hasInTableScope(D.TABLE)&&(e.openElements.popUntilTagNamePopped(D.TABLE),e._resetInsertionMode());break}case D.TEMPLATE:{r0(e,t);break}case D.BODY:case D.CAPTION:case D.COL:case D.COLGROUP:case D.HTML:case D.TBODY:case D.TD:case D.TFOOT:case D.TH:case D.THEAD:case D.TR:break;default:wE(e,t)}}function wE(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,eI(e,t),e.fosterParentingEnabled=n}function pEe(e,t){e.pendingCharacterTokens.push(t)}function mEe(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function G1(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===D.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===D.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===D.OPTGROUP&&e.openElements.pop();break}case D.OPTION:{e.openElements.currentTagId===D.OPTION&&e.openElements.pop();break}case D.SELECT:{e.openElements.hasInSelectScope(D.SELECT)&&(e.openElements.popUntilTagNamePopped(D.SELECT),e._resetInsertionMode());break}case D.TEMPLATE:{r0(e,t);break}}}function yvt(e,t){const n=t.tagID;n===D.CAPTION||n===D.TABLE||n===D.TBODY||n===D.TFOOT||n===D.THEAD||n===D.TR||n===D.TD||n===D.TH?(e.openElements.popUntilTagNamePopped(D.SELECT),e._resetInsertionMode(),e._processStartTag(t)):yEe(e,t)}function vvt(e,t){const n=t.tagID;n===D.CAPTION||n===D.TABLE||n===D.TBODY||n===D.TFOOT||n===D.THEAD||n===D.TR||n===D.TD||n===D.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(D.SELECT),e._resetInsertionMode(),e.onEndTag(t)):vEe(e,t)}function xvt(e,t){switch(t.tagID){case D.BASE:case D.BASEFONT:case D.BGSOUND:case D.LINK:case D.META:case D.NOFRAMES:case D.SCRIPT:case D.STYLE:case D.TEMPLATE:case D.TITLE:{Ku(e,t);break}case D.CAPTION:case D.COLGROUP:case D.TBODY:case D.TFOOT:case D.THEAD:{e.tmplInsertionModeStack[0]=be.IN_TABLE,e.insertionMode=be.IN_TABLE,ex(e,t);break}case D.COL:{e.tmplInsertionModeStack[0]=be.IN_COLUMN_GROUP,e.insertionMode=be.IN_COLUMN_GROUP,cU(e,t);break}case D.TR:{e.tmplInsertionModeStack[0]=be.IN_TABLE_BODY,e.insertionMode=be.IN_TABLE_BODY,nI(e,t);break}case D.TD:case D.TH:{e.tmplInsertionModeStack[0]=be.IN_ROW,e.insertionMode=be.IN_ROW,iI(e,t);break}default:e.tmplInsertionModeStack[0]=be.IN_BODY,e.insertionMode=be.IN_BODY,Oo(e,t)}}function wvt(e,t){t.tagID===D.TEMPLATE&&r0(e,t)}function xEe(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(D.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):lU(e,t)}function Ovt(e,t){t.tagID===D.HTML?Oo(e,t):yN(e,t)}function wEe(e,t){var n;if(t.tagID===D.HTML){if(e.fragmentContext||(e.insertionMode=be.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===D.HTML){e._setEndLocation(e.openElements.items[0],t);const i=e.openElements.items[1];i&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(i))===null||n===void 0)&&n.endTag)&&e._setEndLocation(i,t)}}else yN(e,t)}function yN(e,t){e.insertionMode=be.IN_BODY,eI(e,t)}function Svt(e,t){switch(t.tagID){case D.HTML:{Oo(e,t);break}case D.FRAMESET:{e._insertElement(t,vt.HTML);break}case D.FRAME:{e._appendElement(t,vt.HTML),t.ackSelfClosing=!0;break}case D.NOFRAMES:{Ku(e,t);break}}}function kvt(e,t){t.tagID===D.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==D.FRAMESET&&(e.insertionMode=be.AFTER_FRAMESET))}function Evt(e,t){switch(t.tagID){case D.HTML:{Oo(e,t);break}case D.NOFRAMES:{Ku(e,t);break}}}function Cvt(e,t){t.tagID===D.HTML&&(e.insertionMode=be.AFTER_AFTER_FRAMESET)}function Tvt(e,t){t.tagID===D.HTML?Oo(e,t):wA(e,t)}function wA(e,t){e.insertionMode=be.IN_BODY,eI(e,t)}function Avt(e,t){switch(t.tagID){case D.HTML:{Oo(e,t);break}case D.NOFRAMES:{Ku(e,t);break}}}function _vt(e,t){t.chars=Zr,e._insertCharacters(t)}function Nvt(e,t){e._insertCharacters(t),e.framesetOk=!1}function OEe(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==vt.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function jvt(e,t){if(q0t(t))OEe(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),i=e.treeAdapter.getNamespaceURI(n);i===vt.MATHML?sEe(t):i===vt.SVG&&(W0t(t),aEe(t)),aU(t),t.selfClosing?e._appendElement(t,i):e._insertElement(t,i),t.ackSelfClosing=!0}}function Rvt(e,t){if(t.tagID===D.P||t.tagID===D.BR){OEe(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const i=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(i)===vt.HTML){e._endTagOutsideForeignContent(t);break}const r=e.treeAdapter.getTagName(i);if(r.toLowerCase()===t.tagName){t.tagName=r,e.openElements.shortenToLength(n);break}}}Ue.AREA,Ue.BASE,Ue.BASEFONT,Ue.BGSOUND,Ue.BR,Ue.COL,Ue.EMBED,Ue.FRAME,Ue.HR,Ue.IMG,Ue.INPUT,Ue.KEYGEN,Ue.LINK,Ue.META,Ue.PARAM,Ue.SOURCE,Ue.TRACK,Ue.WBR;const Ivt=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,Pvt=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),_Y={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function SEe(e,t){const n=Vvt(e),i=FSe("type",{handlers:{root:Dvt,element:Mvt,text:Lvt,comment:EEe,doctype:$vt,raw:Bvt},unknown:Uvt}),r={parser:n?new CY(_Y):CY.getFragmentParser(void 0,_Y),handle(l){i(l,r)},stitches:!1,options:t||{}};i(e,r),Kx(r,Yd());const s=n?r.parser.document:r.parser.getFragment(),a=Hbt(s,{file:r.options.file});return r.stitches&&vE(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 kEe(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:di.CHARACTER,chars:e.value,location:OE(e)};Kx(t,Yd(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function $vt(e,t){const n={type:di.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:OE(e)};Kx(t,Yd(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Fvt(e,t){t.stitches=!0;const n=Hvt(e);if("children"in e&&"children"in n){const i=SEe({type:"root",children:e.children},t.options);n.children=i.children}EEe({type:"comment",value:{stitch:n}},t)}function EEe(e,t){const n=e.value,i={type:di.COMMENT,data:n,location:OE(e)};Kx(t,Yd(e)),t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken)}function Bvt(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,CEe(t,Yd(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(Ivt,"<$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 Uvt(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))Fvt(n,t);else{let i="";throw Pvt.has(n.type)&&(i=". 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"+i)}}function Kx(e,t){CEe(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=$s.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 CEe(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 Qvt(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===$s.PLAINTEXT)return;Kx(t,Yd(e));const i=t.parser.openElements.current;let r="namespaceURI"in i?i.namespaceURI:$g.html;r===$g.html&&n==="svg"&&(r=$g.svg);const s=Xbt({...e,children:[]},{space:r===$g.svg?"svg":"html"}),a={type:di.START_TAG,tagName:n,tagID:Gx(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:OE(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function zvt(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&r0t.includes(n)||t.parser.tokenizer.state===$s.PLAINTEXT)return;Kx(t,GR(e));const i={type:di.END_TAG,tagName:n,tagID:Gx(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:OE(e)};t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===$s.RCDATA||t.parser.tokenizer.state===$s.RAWTEXT||t.parser.tokenizer.state===$s.SCRIPT_DATA)&&(t.parser.tokenizer.state=$s.DATA)}function Vvt(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function OE(e){const t=Yd(e)||{line:void 0,column:void 0,offset:void 0},n=GR(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 Hvt(e){return"children"in e?Zv({...e,children:[]}):Zv(e)}function qvt(e){return function(t,n){return SEe(t,{...e,file:n})}}const Wvt="modulepreload",Gvt=function(e){return"/"+e},NY={},Md=function(t,n,i){let r=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"));r=Promise.allSettled(n.map(c=>{if(c=Gvt(c),c in NY)return;NY[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":Wvt,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 s(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return r.then(a=>{for(const l of a||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};var Kvt=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,Xvt=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,Yvt=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,FM={Space_Separator:Kvt,ID_Start:Xvt,ID_Continue:Yvt},Is={isSpaceSeparator(e){return typeof e=="string"&&FM.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||FM.ID_Start.test(e))},isIdContinueChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="$"||e==="_"||e==="‌"||e==="‍"||FM.ID_Continue.test(e))},isDigit(e){return typeof e=="string"&&/[0-9]/.test(e)},isHexDigit(e){return typeof e=="string"&&/[0-9A-Fa-f]/.test(e)}};let H6,Mo,Qf,vN,Om,Mu,Aa,uU,PO;var Zvt=function(t,n){H6=String(t),Mo="start",Qf=[],vN=0,Om=1,Mu=0,Aa=void 0,uU=void 0,PO=void 0;do Aa=Jvt(),nxt[Mo]();while(Aa.type!=="eof");return typeof n=="function"?q6({"":PO},"",n):PO};function q6(e,t,n){const i=e[t];if(i!=null&&typeof i=="object")if(Array.isArray(i))for(let r=0;r0;){const n=lh();if(!Is.isHexDigit(n))throw Vr(pt());e+=pt()}return String.fromCodePoint(parseInt(e,16))}const nxt={start(){if(Aa.type==="eof")throw sg();BM()},beforePropertyName(){switch(Aa.type){case"identifier":case"string":uU=Aa.value,Mo="afterPropertyName";return;case"punctuator":PT();return;case"eof":throw sg()}},afterPropertyName(){if(Aa.type==="eof")throw sg();Mo="beforePropertyValue"},beforePropertyValue(){if(Aa.type==="eof")throw sg();BM()},beforeArrayValue(){if(Aa.type==="eof")throw sg();if(Aa.type==="punctuator"&&Aa.value==="]"){PT();return}BM()},afterPropertyValue(){if(Aa.type==="eof")throw sg();switch(Aa.value){case",":Mo="beforePropertyName";return;case"}":PT()}},afterArrayValue(){if(Aa.type==="eof")throw sg();switch(Aa.value){case",":Mo="beforeArrayValue";return;case"]":PT()}},end(){}};function BM(){let e;switch(Aa.type){case"punctuator":switch(Aa.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=Aa.value;break}if(PO===void 0)PO=e;else{const t=Qf[Qf.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,uU,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(e!==null&&typeof e=="object")Qf.push(e),Array.isArray(e)?Mo="beforeArrayValue":Mo="beforePropertyName";else{const t=Qf[Qf.length-1];t==null?Mo="end":Array.isArray(t)?Mo="afterArrayValue":Mo="afterPropertyValue"}}function PT(){Qf.pop();const e=Qf[Qf.length-1];e==null?Mo="end":Array.isArray(e)?Mo="afterArrayValue":Mo="afterPropertyValue"}function Vr(e){return xN(e===void 0?`JSON5: invalid end of input at ${Om}:${Mu}`:`JSON5: invalid character '${AEe(e)}' at ${Om}:${Mu}`)}function sg(){return xN(`JSON5: invalid end of input at ${Om}:${Mu}`)}function jY(){return Mu-=5,xN(`JSON5: invalid identifier character at ${Om}:${Mu}`)}function ixt(e){console.warn(`JSON5: '${AEe(e)}' in strings is not valid ECMAScript; consider escaping`)}function AEe(e){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){const n=e.charCodeAt(0).toString(16);return"\\x"+("00"+n).substring(n.length)}return e}function xN(e){const t=new SyntaxError(e);return t.lineNumber=Om,t.columnNumber=Mu,t}var rxt=function(t,n,i){const r=[];let s="",a,l,c="",u;if(n!=null&&typeof n=="object"&&!Array.isArray(n)&&(i=n.space,u=n.quote,n=n.replacer),typeof n=="function")l=n;else if(Array.isArray(n)){a=[];for(const b of n){let v;typeof b=="string"?v=b:(typeof b=="number"||b instanceof String||b instanceof Number)&&(v=String(b)),v!==void 0&&a.indexOf(v)<0&&a.push(v)}}return i instanceof Number?i=Number(i):i instanceof String&&(i=String(i)),typeof i=="number"?i>0&&(i=Math.min(10,Math.floor(i)),c=" ".substr(0,i)):typeof i=="string"&&(c=i.substr(0,10)),d("",{"":t});function d(b,v){let y=v[b];switch(y!=null&&(typeof y.toJSON5=="function"?y=y.toJSON5(b):typeof y.toJSON=="function"&&(y=y.toJSON(b))),l&&(y=l.call(v,b,y)),y instanceof Number?y=Number(y):y instanceof String?y=String(y):y instanceof Boolean&&(y=y.valueOf()),y){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof y=="string")return f(y);if(typeof y=="number")return String(y);if(typeof y=="object")return Array.isArray(y)?g(y):h(y)}function f(b){const v={"'":.1,'"':.2},y={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let x="";for(let w=0;wv[w]=0)throw TypeError("Converting circular structure to JSON5");r.push(b);let v=s;s=s+c;let y=a||Object.keys(b),x=[];for(const w of y){const k=d(w,b);if(k!==void 0){let S=p(w)+":";c!==""&&(S+=" "),S+=k,x.push(S)}}let O;if(x.length===0)O="{}";else{let w;if(c==="")w=x.join(","),O="{"+w+"}";else{let k=`, +`:case"\r":case"\u2028":case"\u2029":ft();return;case"/":ft(),ai="comment";return;case void 0:return ft(),zr("eof")}if(Is.isSpaceSeparator(Ei)){ft();return}return TEe[Mo]()},comment(){switch(Ei){case"*":ft(),ai="multiLineComment";return;case"/":ft(),ai="singleLineComment";return}throw Vr(ft())},multiLineComment(){switch(Ei){case"*":ft(),ai="multiLineCommentAsterisk";return;case void 0:throw Vr(ft())}ft()},multiLineCommentAsterisk(){switch(Ei){case"*":ft();return;case"/":ft(),ai="default";return;case void 0:throw Vr(ft())}ft(),ai="multiLineComment"},singleLineComment(){switch(Ei){case` +`:case"\r":case"\u2028":case"\u2029":ft(),ai="default";return;case void 0:return ft(),zr("eof")}ft()},value(){switch(Ei){case"{":case"[":return zr("punctuator",ft());case"n":return ft(),rg("ull"),zr("null",null);case"t":return ft(),rg("rue"),zr("boolean",!0);case"f":return ft(),rg("alse"),zr("boolean",!1);case"-":case"+":ft()==="-"&&(Cf=-1),ai="sign";return;case".":qn=ft(),ai="decimalPointLeading";return;case"0":qn=ft(),ai="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":qn=ft(),ai="decimalInteger";return;case"I":return ft(),rg("nfinity"),zr("numeric",1/0);case"N":return ft(),rg("aN"),zr("numeric",NaN);case'"':case"'":Fw=ft()==='"',qn="",ai="string";return}throw Vr(ft())},identifierNameStartEscape(){if(Ei!=="u")throw Vr(ft());ft();const e=W6();switch(e){case"$":case"_":break;default:if(!Is.isIdStartChar(e))throw jY();break}qn+=e,ai="identifierName"},identifierName(){switch(Ei){case"$":case"_":case"‌":case"‍":qn+=ft();return;case"\\":ft(),ai="identifierNameEscape";return}if(Is.isIdContinueChar(Ei)){qn+=ft();return}return zr("identifier",qn)},identifierNameEscape(){if(Ei!=="u")throw Vr(ft());ft();const e=W6();switch(e){case"$":case"_":case"‌":case"‍":break;default:if(!Is.isIdContinueChar(e))throw jY();break}qn+=e,ai="identifierName"},sign(){switch(Ei){case".":qn=ft(),ai="decimalPointLeading";return;case"0":qn=ft(),ai="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":qn=ft(),ai="decimalInteger";return;case"I":return ft(),rg("nfinity"),zr("numeric",Cf*(1/0));case"N":return ft(),rg("aN"),zr("numeric",NaN)}throw Vr(ft())},zero(){switch(Ei){case".":qn+=ft(),ai="decimalPoint";return;case"e":case"E":qn+=ft(),ai="decimalExponent";return;case"x":case"X":qn+=ft(),ai="hexadecimal";return}return zr("numeric",Cf*0)},decimalInteger(){switch(Ei){case".":qn+=ft(),ai="decimalPoint";return;case"e":case"E":qn+=ft(),ai="decimalExponent";return}if(Is.isDigit(Ei)){qn+=ft();return}return zr("numeric",Cf*Number(qn))},decimalPointLeading(){if(Is.isDigit(Ei)){qn+=ft(),ai="decimalFraction";return}throw Vr(ft())},decimalPoint(){switch(Ei){case"e":case"E":qn+=ft(),ai="decimalExponent";return}if(Is.isDigit(Ei)){qn+=ft(),ai="decimalFraction";return}return zr("numeric",Cf*Number(qn))},decimalFraction(){switch(Ei){case"e":case"E":qn+=ft(),ai="decimalExponent";return}if(Is.isDigit(Ei)){qn+=ft();return}return zr("numeric",Cf*Number(qn))},decimalExponent(){switch(Ei){case"+":case"-":qn+=ft(),ai="decimalExponentSign";return}if(Is.isDigit(Ei)){qn+=ft(),ai="decimalExponentInteger";return}throw Vr(ft())},decimalExponentSign(){if(Is.isDigit(Ei)){qn+=ft(),ai="decimalExponentInteger";return}throw Vr(ft())},decimalExponentInteger(){if(Is.isDigit(Ei)){qn+=ft();return}return zr("numeric",Cf*Number(qn))},hexadecimal(){if(Is.isHexDigit(Ei)){qn+=ft(),ai="hexadecimalInteger";return}throw Vr(ft())},hexadecimalInteger(){if(Is.isHexDigit(Ei)){qn+=ft();return}return zr("numeric",Cf*Number(qn))},string(){switch(Ei){case"\\":ft(),qn+=ext();return;case'"':if(Fw)return ft(),zr("string",qn);qn+=ft();return;case"'":if(!Fw)return ft(),zr("string",qn);qn+=ft();return;case` +`:case"\r":throw Vr(ft());case"\u2028":case"\u2029":ixt(Ei);break;case void 0:throw Vr(ft())}qn+=ft()},start(){switch(Ei){case"{":case"[":return zr("punctuator",ft())}ai="value"},beforePropertyName(){switch(Ei){case"$":case"_":qn=ft(),ai="identifierName";return;case"\\":ft(),ai="identifierNameStartEscape";return;case"}":return zr("punctuator",ft());case'"':case"'":Fw=ft()==='"',ai="string";return}if(Is.isIdStartChar(Ei)){qn+=ft(),ai="identifierName";return}throw Vr(ft())},afterPropertyName(){if(Ei===":")return zr("punctuator",ft());throw Vr(ft())},beforePropertyValue(){ai="value"},afterPropertyValue(){switch(Ei){case",":case"}":return zr("punctuator",ft())}throw Vr(ft())},beforeArrayValue(){if(Ei==="]")return zr("punctuator",ft());ai="value"},afterArrayValue(){switch(Ei){case",":case"]":return zr("punctuator",ft())}throw Vr(ft())},end(){throw Vr(ft())}};function zr(e,t){return{type:e,value:t,line:Om,column:Mu}}function rg(e){for(const t of e){if(lh()!==t)throw Vr(ft());ft()}}function ext(){switch(lh()){case"b":return ft(),"\b";case"f":return ft(),"\f";case"n":return ft(),` +`;case"r":return ft(),"\r";case"t":return ft()," ";case"v":return ft(),"\v";case"0":if(ft(),Is.isDigit(lh()))throw Vr(ft());return"\0";case"x":return ft(),txt();case"u":return ft(),W6();case` +`:case"\u2028":case"\u2029":return ft(),"";case"\r":return ft(),lh()===` +`&&ft(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw Vr(ft());case void 0:throw Vr(ft())}return ft()}function txt(){let e="",t=lh();if(!Is.isHexDigit(t)||(e+=ft(),t=lh(),!Is.isHexDigit(t)))throw Vr(ft());return e+=ft(),String.fromCodePoint(parseInt(e,16))}function W6(){let e="",t=4;for(;t-- >0;){const n=lh();if(!Is.isHexDigit(n))throw Vr(ft());e+=ft()}return String.fromCodePoint(parseInt(e,16))}const nxt={start(){if(Aa.type==="eof")throw sg();BM()},beforePropertyName(){switch(Aa.type){case"identifier":case"string":uU=Aa.value,Mo="afterPropertyName";return;case"punctuator":PT();return;case"eof":throw sg()}},afterPropertyName(){if(Aa.type==="eof")throw sg();Mo="beforePropertyValue"},beforePropertyValue(){if(Aa.type==="eof")throw sg();BM()},beforeArrayValue(){if(Aa.type==="eof")throw sg();if(Aa.type==="punctuator"&&Aa.value==="]"){PT();return}BM()},afterPropertyValue(){if(Aa.type==="eof")throw sg();switch(Aa.value){case",":Mo="beforePropertyName";return;case"}":PT()}},afterArrayValue(){if(Aa.type==="eof")throw sg();switch(Aa.value){case",":Mo="beforeArrayValue";return;case"]":PT()}},end(){}};function BM(){let e;switch(Aa.type){case"punctuator":switch(Aa.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=Aa.value;break}if(PO===void 0)PO=e;else{const t=Qf[Qf.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,uU,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(e!==null&&typeof e=="object")Qf.push(e),Array.isArray(e)?Mo="beforeArrayValue":Mo="beforePropertyName";else{const t=Qf[Qf.length-1];t==null?Mo="end":Array.isArray(t)?Mo="afterArrayValue":Mo="afterPropertyValue"}}function PT(){Qf.pop();const e=Qf[Qf.length-1];e==null?Mo="end":Array.isArray(e)?Mo="afterArrayValue":Mo="afterPropertyValue"}function Vr(e){return xN(e===void 0?`JSON5: invalid end of input at ${Om}:${Mu}`:`JSON5: invalid character '${AEe(e)}' at ${Om}:${Mu}`)}function sg(){return xN(`JSON5: invalid end of input at ${Om}:${Mu}`)}function jY(){return Mu-=5,xN(`JSON5: invalid identifier character at ${Om}:${Mu}`)}function ixt(e){console.warn(`JSON5: '${AEe(e)}' in strings is not valid ECMAScript; consider escaping`)}function AEe(e){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){const n=e.charCodeAt(0).toString(16);return"\\x"+("00"+n).substring(n.length)}return e}function xN(e){const t=new SyntaxError(e);return t.lineNumber=Om,t.columnNumber=Mu,t}var rxt=function(t,n,i){const r=[];let s="",a,l,c="",u;if(n!=null&&typeof n=="object"&&!Array.isArray(n)&&(i=n.space,u=n.quote,n=n.replacer),typeof n=="function")l=n;else if(Array.isArray(n)){a=[];for(const b of n){let v;typeof b=="string"?v=b:(typeof b=="number"||b instanceof String||b instanceof Number)&&(v=String(b)),v!==void 0&&a.indexOf(v)<0&&a.push(v)}}return i instanceof Number?i=Number(i):i instanceof String&&(i=String(i)),typeof i=="number"?i>0&&(i=Math.min(10,Math.floor(i)),c=" ".substr(0,i)):typeof i=="string"&&(c=i.substr(0,10)),d("",{"":t});function d(b,v){let y=v[b];switch(y!=null&&(typeof y.toJSON5=="function"?y=y.toJSON5(b):typeof y.toJSON=="function"&&(y=y.toJSON(b))),l&&(y=l.call(v,b,y)),y instanceof Number?y=Number(y):y instanceof String?y=String(y):y instanceof Boolean&&(y=y.valueOf()),y){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof y=="string")return f(y);if(typeof y=="number")return String(y);if(typeof y=="object")return Array.isArray(y)?g(y):h(y)}function f(b){const v={"'":.1,'"':.2},y={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let x="";for(let w=0;wv[w]=0)throw TypeError("Converting circular structure to JSON5");r.push(b);let v=s;s=s+c;let y=a||Object.keys(b),x=[];for(const w of y){const k=d(w,b);if(k!==void 0){let S=p(w)+":";c!==""&&(S+=" "),S+=k,x.push(S)}}let O;if(x.length===0)O="{}";else{let w;if(c==="")w=x.join(","),O="{"+w+"}";else{let k=`, `+s;w=x.join(k),O=`{ `+s+w+`, `+v+"}"}}return r.pop(),s=v,O}function p(b){if(b.length===0)return f(b);const v=String.fromCodePoint(b.codePointAt(0));if(!Is.isIdStartChar(v))return f(b);for(let y=v.length;y=0)throw TypeError("Converting circular structure to JSON5");r.push(b);let v=s;s=s+c;let y=[];for(let O=0;O30)throw new Error("ECharts option nesting is too deep");if(typeof e=="number"&&!Number.isFinite(e))throw new Error("ECharts option contains a non-finite number");if(typeof e=="string"&&lxt.test(e.trim()))throw new Error("ECharts option contains an external resource");if(Array.isArray(e)){for(const n of e)wN(n,t+1);return}if(Bw(e))for(const[n,i]of Object.entries(e)){if(oxt.has(n))throw new Error("ECharts option contains an unsafe key");wN(i,t+1)}}function cxt(e){var i;const t=e.trim(),n=t.match(/^(?:(?:const|let|var)\s+)?option\s*=\s*([\s\S]*?)\s*;?$/);return((i=n==null?void 0:n[1])==null?void 0:i.trim())||t}function uxt(e,t){let n=1,i="",r=!1,s=!1,a=!1;for(let l=t+1;li+2)throw new Error("Invalid ECharts gradient argument count");const r=n.slice(0,i).map(dxt),s=n[i],a=n[i+1]??!1;if(!Array.isArray(s)||typeof a!="boolean")throw new Error("Invalid ECharts gradient data");return e==="linear"?{type:e,x:r[0],y:r[1],x2:r[2],y2:r[3],colorStops:s,global:a}:{type:e,x:r[0],y:r[1],r:r[2],colorStops:s,global:a}}function hxt(e,t){const n=/^(?:new\s+)?echarts\.graphic\.(LinearGradient|RadialGradient)\s*\(/;let i="",r=!1,s=!1,a=!1;for(let l=t;laxt)throw new Error("ECharts option is too large");const n=pxt(cxt(e));let i;try{i=_Ee.parse(n)}catch(a){throw/\bfunction\s*\(|=>/.test(n)?new Error("ECharts function callbacks are not supported"):a}if(!Bw(i))throw new Error("ECharts option must be a data object");wN(i);const r={...i};r.aria={...Bw(r.aria)?r.aria:{},enabled:!0};const s=r.tooltip;return Bw(s)?r.tooltip={...s,renderMode:"richText"}:Array.isArray(s)&&(r.tooltip=s.map(a=>Bw(a)?{...a,renderMode:"richText"}:a)),t&&(r.animation=!1),r}let UM;function gxt(){return UM??(UM=Md(()=>import("../visualizations/echarts/index-CGT341lL.js"),[]).catch(e=>{throw UM=void 0,e})),UM}function bxt({source:e}){const{t}=Ae("conversation"),n=m.useRef(null),[i,r]=m.useState(!1),[s,a]=m.useState("");return m.useEffect(()=>{let l=!1,c,u,d;r(!1);try{d=mxt(e,window.matchMedia("(prefers-reduced-motion: reduce)").matches),a("")}catch{a("invalid");return}return gxt().then(f=>{const h=n.current;l||!h||(c=f.init(h,void 0,{renderer:"svg"}),c.setOption(d,{notMerge:!0}),typeof ResizeObserver<"u"&&(u=new ResizeObserver(()=>c==null?void 0:c.resize()),u.observe(h)),r(!0))}).catch(()=>{c==null||c.dispose(),c=void 0,l||a("render")}),()=>{l=!0,u==null||u.disconnect(),c==null||c.dispose()}},[e]),o.jsxs("div",{className:`echarts-diagram${s?" echarts-diagram--error":""}`,role:"img","aria-label":t("visualization.echartsAria"),"aria-busy":!i&&!s,children:[o.jsx("div",{ref:n,className:"echarts-diagram__canvas",hidden:!!s}),!i&&!s?o.jsx("div",{className:"echarts-diagram__state","aria-live":"polite",children:o.jsx(An,{duration:2.2,spread:15,children:t("visualization.rendering")})}):null,s?o.jsx("p",{className:"echarts-diagram__error",role:"alert",children:t(s==="invalid"?"visualization.invalidEcharts":"visualization.renderFailed")}):null]})}const yxt=m.memo(bxt);let RY,IY=Promise.resolve(),vxt=0;function xxt(){return RY??(RY=Md(async()=>{const{default:e}=await import("../visualizations/mermaid/mermaid.core-CbFLL6RY.js").then(t=>t.ay);return{default:e}},__vite__mapDeps([0,1])).then(({default:e})=>(e.initialize({startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,theme:"neutral"}),e))),RY}function wxt(e){const t=IY.then(async()=>{const n=await xxt(),i=`mermaid-diagram-${vxt+=1}`;return n.render(i,e)});return IY=t.then(()=>{},()=>{}),t}function Oxt({source:e}){const{t}=Ae("conversation"),n=m.useRef(null),[i,r]=m.useState(null),[s,a]=m.useState(!1);return m.useEffect(()=>{let l=!1;return r(null),a(!1),wxt(e).then(c=>{l||r(c)}).catch(()=>{l||a(!0)}),()=>{l=!0}},[e]),m.useEffect(()=>{!(i!=null&&i.bindFunctions)||!n.current||i.bindFunctions(n.current)},[i]),s?o.jsx("div",{className:"mermaid-diagram mermaid-diagram--error",children:o.jsx("p",{className:"mermaid-diagram__error",role:"alert",children:t("visualization.mermaidFailed")})}):i?o.jsx("div",{ref:n,className:"mermaid-diagram",role:"img","aria-label":t("visualization.mermaidAria"),dangerouslySetInnerHTML:{__html:i.svg}}):o.jsx("div",{className:"mermaid-diagram mermaid-diagram--loading","aria-live":"polite",children:o.jsx(An,{duration:2.2,spread:15,children:t("visualization.rendering")})})}const Sxt=m.memo(Oxt),kxt="_SegmentedControl_1sl7d_1",Ext="_SegmentedControlOption_1sl7d_140",Cxt="_SegmentedControlThumb_1sl7d_219",G6={SegmentedControl:kxt,SegmentedControlOption:Ext,SegmentedControlThumb:Cxt},zc=({value:e,onChange:t,children:n,block:i,pill:r=!0,size:s="md",gutterSize:a,className:l,onClick:c,...u})=>{const d=m.useRef(null),f=m.useRef(null),h=m.useCallback(g=>{const b=d.current,v=f.current;if(!b||!v)return;const y=b==null?void 0:b.querySelector('[data-state="on"]');if(!y)return;const x=b.clientWidth;let O=Math.floor(y.clientWidth);const w=y.offsetLeft;if(x-(O+w)<2&&(O=O-1),v.style.width=`${Math.floor(O)}px`,v.style.transform=`translateX(${w}px)`,b.scrollWidth>x){const k=x*.15,S=b.scrollLeft,E=y.offsetLeft,C=E+O;(ES+x-k)&&g&&y.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"})}},[]);kye({ref:d,onResize:()=>{const g=f.current;if(!g)return;const b=g.style.transition;g.style.transition="",h(!1),g.style.transition=b}}),m.useLayoutEffect(()=>{const g=d.current,b=f.current;!g||!b||(h(!!b.style.transition),b.style.transition||F_(()=>{b.style.transition="width 300ms var(--cubic-enter), transform 300ms var(--cubic-enter)"}))},[h,e,s,a,r]);const p=g=>{g&&t&&t(g)};return o.jsxs(kWe,{ref:d,className:pi(G6.SegmentedControl,l),type:"single",value:e,loop:!1,onValueChange:p,onClick:c,"data-block":i?"":void 0,"data-pill":r?"":void 0,"data-size":s,"data-gutter-size":a,...u,children:[o.jsx("div",{className:G6.SegmentedControlThumb,ref:f}),n]})},Txt=({children:e,...t})=>o.jsx(_We,{className:G6.SegmentedControlOption,...t,onPointerEnter:o7,children:o.jsx("span",{className:"relative",children:e})});zc.Option=Txt;function Axt({children:e,label:t,language:n,source:i,streaming:r=!1}){const{t:s}=Ae("conversation"),[a,l]=m.useState("preview"),c=r?"code":a;return o.jsxs("section",{className:"visualization-card","aria-label":s("visualization.cardAria",{label:t}),children:[o.jsx("div",{className:"visualization-card__toolbar",children:o.jsxs(zc,{className:"visualization-card__tabs",value:c,size:"sm",gutterSize:"sm",pill:!1,"aria-label":s("visualization.viewAria",{label:t}),onChange:u=>{r||l(u)},children:[o.jsx(zc.Option,{value:"preview",disabled:r,children:s("visualization.preview")}),o.jsx(zc.Option,{value:"code",children:s("visualization.code")})]})}),o.jsx("div",{className:"visualization-card__body",children:c==="code"?o.jsx("pre",{className:"visualization-card__code",children:o.jsx("code",{className:`language-${n}`,children:i})}):e})]})}const _xt=m.memo(Axt);function Nxt(e){const t=e==null?void 0:e.trim().toLowerCase();if(t==="mermaid")return"mermaid";if(t==="echart"||t==="echarts")return"echarts"}const NEe=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function K6(e){return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(K6).join(""):m.isValidElement(e)?K6(e.props.children):""}function jxt(e){var i;const t=m.Children.toArray(e)[0];if(!m.isValidElement(t))return;const n=(i=t.props.className)==null?void 0:i.split(/\s+/).find(r=>r.startsWith("language-"));return Nxt(n==null?void 0:n.slice(9))}function jEe(e){if(!e)return!1;try{const t=e.toLowerCase();return NEe.some(n=>t.includes(n))}catch{return!1}}function Rxt(e){var i;const t=(i=e==null?void 0:e.properties)==null?void 0:i.href;if(!t)return!1;if(jEe(t))return!0;const n=e==null?void 0:e.children;if(n&&Array.isArray(n)){const r=n.map(s=>(s==null?void 0:s.value)||"").join("").toLowerCase();return NEe.some(s=>r.includes(s))}return!1}function Ixt({text:e,className:t,allowRawHtml:n=!0,streaming:i=!1}){const{t:r}=Ae("conversation"),[s,a]=m.useState(null),l=(d,f)=>{if(d.src)return d.src;if(f){const h=g=>{var b;if(!g)return null;if(g.type==="source"&&((b=g.properties)!=null&&b.src))return g.properties.src;if(g.children)for(const v of g.children){const y=h(v);if(y)return y}return null},p=h({children:f});if(p)return p}return""},c=d=>{try{const h=new URL(d).pathname.split("/");return h[h.length-1]||"video.mp4"}catch{return"video.mp4"}},u=d=>d?Array.isArray(d)?d.map(f=>(f==null?void 0:f.value)||"").join("")||"video":(d==null?void 0:d.value)||"video":"video";return o.jsxs("div",{className:t?`md ${t}`:"md",children:[o.jsx(Yft,{remarkPlugins:[umt],rehypePlugins:n?[qvt,fY]:[fY],components:{pre:({node:d,children:f,...h})=>{const p=jxt(f);if(p==="mermaid"||p==="echarts"){const g=K6(f).replace(/\n$/,"");return o.jsx(_xt,{label:p==="mermaid"?"Mermaid":"ECharts",language:p,source:g,streaming:i,children:p==="mermaid"?o.jsx(Sxt,{source:g}):o.jsx(yxt,{source:g})})}return o.jsx("pre",{...h,children:f})},a:({node:d,...f})=>{const h=f.href;if(h&&(jEe(h)||Rxt(d))){const p=h,g=u(d==null?void 0:d.children);return o.jsxs("div",{className:"video-container",children:[o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.playVideo",{name:g}),onClick:()=>a({src:p,title:g}),children:[o.jsx("video",{src:p,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(Ky,{})})]}),o.jsx("div",{className:"video-caption",children:o.jsx("a",{href:p,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:g})})]})}return o.jsx("a",{...f,target:"_blank",rel:"noopener noreferrer"})},img:({node:d,src:f,alt:h,...p})=>{const g=o.jsx("img",{...p,src:f,alt:h??"",loading:"lazy"});return f?o.jsx(mbe,{src:f,children:o.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":r("markdown.enlargeImage",{name:h||r("markdown.image")}),children:[g,o.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:o.jsx(Ky,{})})]})}):g},video:({node:d,src:f,children:h,...p})=>{const g=l({src:f},h);return g?o.jsx("div",{className:"video-container",children:o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.enlargeVideo"),onClick:()=>a({src:g}),children:[o.jsx("video",{src:g,...p,playsInline:!0,className:"video-thumbnail",children:h}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(Ky,{})})]})}):o.jsx("video",{src:f,controls:!0,playsInline:!0,className:"video-inline",...p,children:h})}},children:e}),s&&o.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":r("markdown.videoPreview"),onClick:()=>a(null),children:o.jsxs("div",{className:"video-viewer",onClick:d=>d.stopPropagation(),children:[o.jsxs("div",{className:"video-viewer-header",children:[o.jsx("div",{className:"video-viewer-title",children:s.title||c(s.src)}),o.jsxs("nav",{className:"video-viewer-nav",children:[o.jsx("a",{href:s.src,download:s.title||c(s.src),"aria-label":r("markdown.downloadVideo"),title:r("markdown.downloadVideo"),className:"video-viewer-download",children:o.jsx(Yj,{})}),o.jsx("button",{type:"button",className:"video-viewer-close","aria-label":r("markdown.close"),onClick:()=>a(null),children:o.jsx(Ba,{})})]})]}),o.jsx("div",{className:"video-viewer-body",children:o.jsx("video",{src:s.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const Bu=m.memo(Ixt);function QM(e){return(e==null?void 0:e.trim())||Um("resourceMetadata.unknownSource")}function REe(e){return(e==null?void 0:e.trim())||Um("resourceMetadata.unknownCreator")}function Pxt(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 5.5A2.5 2.5 0 0 1 7.5 3H19v16H7.5A2.5 2.5 0 0 0 5 21.5v-16Z"}),o.jsx("path",{d:"M5 18.5A2.5 2.5 0 0 1 7.5 16H19"}),o.jsx("path",{d:"M9 7h6M9 10h4"})]})}function Dxt(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:"M6 3h8l4 4v14H6V3Z"}),o.jsx("path",{d:"M14 3v5h5M9 12h6M9 16h6"})]})}function Mxt(e){return o.jsx("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 10M17 7 7 17"})})}function Lxt(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"M12 5v14M5 12h14"})})}function SE({title:e,children:t,onClose:n,busy:i=!1,className:r=""}){const{t:s}=Ae("ui"),a=m.useId(),l=m.useRef(null),c=m.useRef(null),u=m.useRef(i),d=m.useRef(n);return m.useEffect(()=>{u.current=i,d.current=n},[i,n]),m.useEffect(()=>{var g;const f=document.activeElement instanceof HTMLElement?document.activeElement:null,h=document.body.style.overflow;document.body.style.overflow="hidden",(g=l.current)==null||g.focus();const p=b=>{if(b.key==="Escape"&&!u.current){d.current();return}if(b.key!=="Tab")return;const v=c.current;if(!v)return;const y=Array.from(v.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), a[href], audio[controls], video[controls], iframe, [tabindex]:not([tabindex="-1"])')).filter(w=>w.getClientRects().length>0);if(y.length===0){b.preventDefault();return}const x=y[0],O=y[y.length-1];b.shiftKey&&(document.activeElement===x||!v.contains(document.activeElement))?(b.preventDefault(),O.focus()):!b.shiftKey&&(document.activeElement===O||!v.contains(document.activeElement))&&(b.preventDefault(),x.focus())};return window.addEventListener("keydown",p),()=>{window.removeEventListener("keydown",p),document.body.style.overflow=h,f!=null&&f.isConnected&&f.focus()}},[]),Li.createPortal(o.jsx("div",{className:"knowledge-dialog-backdrop",onMouseDown:f=>{f.target===f.currentTarget&&!i&&n()},children:o.jsxs("section",{ref:c,className:`knowledge-dialog${r?` ${r}`:""}`,role:"dialog","aria-modal":"true","aria-labelledby":a,"aria-busy":i||void 0,children:[o.jsxs("header",{className:"knowledge-dialog__header",children:[o.jsx("h2",{id:a,children:e}),o.jsx("button",{ref:l,type:"button",onClick:n,disabled:i,"aria-label":s("common.close"),children:o.jsx(Mxt,{})})]}),t]})}),document.body)}function HS({message:e}){return e?o.jsx("div",{className:"knowledge-form-error",role:"alert",children:e}):null}function X6(e){return e instanceof DOMException&&e.name==="AbortError"}function $xt(e,t){if(!e)return"";const n=Date.parse(e);return Number.isFinite(n)?new Intl.DateTimeFormat(t,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(n):e}const IEe=[".jpg",".jpeg",".png"].join(","),Fxt=new Set(IEe.split(",")),PEe=[".pdf",".pptx",".docx",".xlsx",".txt"].join(","),Bxt=new Set(PEe.split(",")),Uxt=200*1024*1024;function Y6(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t).toLocaleLowerCase()}function Qxt(e,t,n){return e.size>Uxt?n("knowledge.errors.fileTooLarge"):t==="image"?Fxt.has(Y6(e.name))?"":n("knowledge.errors.invalidImageType"):Bxt.has(Y6(e.name))?"":n("knowledge.errors.invalidDocumentType")}function dU(e){return e<=0?"-":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Z6(e){var r;const t=e.type.trim().replace(/^\./,"");if(t)return t.toUpperCase();const n=e.name.trim(),i=n.includes(".")?(r=n.split(".").pop())==null?void 0:r.trim():"";return i?i.toUpperCase():"-"}function zxt({region:e,onClose:t,onCreated:n}){const{t:i}=Ae("ui"),[r,s]=m.useState(""),[a,l]=m.useState(""),[c,u]=m.useState(!1),[d,f]=m.useState(!1),[h,p]=m.useState(""),g=r.trim(),b=!!(g&&!/^[A-Za-z][A-Za-z0-9_]{0,47}$/.test(g)),v=async y=>{if(y.preventDefault(),u(!0),!g||b)return;f(!0),p("");const x={name:g,description:a.trim()||void 0,region:e};try{n(await dlt(x))}catch(O){p(ho(O,i("knowledge.errors.createBase")))}finally{f(!1)}};return o.jsx(SE,{title:i("knowledge.createBase"),onClose:t,busy:d,children:o.jsxs("form",{onSubmit:y=>void v(y),children:[o.jsxs("div",{className:"knowledge-dialog__body",children:[o.jsxs("label",{children:[o.jsx("span",{children:i("common.name")}),o.jsx("input",{autoFocus:!0,value:r,maxLength:48,"aria-invalid":c&&b||void 0,"aria-describedby":"knowledge-name-help",onBlur:()=>u(!0),onChange:y=>s(y.target.value)})]}),o.jsx("p",{id:"knowledge-name-help",className:`knowledge-dialog__note${c&&b?" is-error":""}`,role:c&&b?"alert":void 0,children:i(c&&b?"knowledge.invalidName":"knowledge.nameHelp")}),o.jsxs("label",{children:[o.jsx("span",{children:i("knowledge.optionalDescription")}),o.jsx("textarea",{value:a,maxLength:80,onChange:y=>l(y.target.value)})]}),o.jsx(HS,{message:h})]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",onClick:t,disabled:d,children:i("common.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:d||!g||b,children:i(d?"common.creating":"common.create")})]})]})})}function Vxt({item:e,onClose:t,onUpdated:n}){const{t:i}=Ae("ui"),[r,s]=m.useState(e.description),[a,l]=m.useState(!1),[c,u]=m.useState(""),d=async f=>{f.preventDefault(),l(!0),u("");try{n(await flt(e.id,e.region,{description:r.trim()}))}catch(h){u(ho(h,i("knowledge.errors.updateBase")))}finally{l(!1)}};return o.jsx(SE,{title:i("knowledge.editBase"),onClose:t,busy:a,children:o.jsxs("form",{onSubmit:f=>void d(f),children:[o.jsxs("div",{className:"knowledge-dialog__body",children:[o.jsxs("label",{children:[o.jsx("span",{children:i("common.name")}),o.jsx("input",{value:e.name,disabled:!0})]}),o.jsxs("label",{children:[o.jsx("span",{children:i("common.description")}),o.jsx("textarea",{autoFocus:!0,value:r,maxLength:80,onChange:f=>s(f.target.value)})]}),o.jsx("p",{className:"knowledge-dialog__note",children:i("knowledge.descriptionOnly")}),o.jsx(HS,{message:c})]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",onClick:t,disabled:a,children:i("common.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:a,children:i(a?"common.saving":"common.save")})]})]})})}function DEe(e,t){if(!e.trim())return{};const n=JSON.parse(e);if(!n||Array.isArray(n)||typeof n!="object")throw new Error(t);return n}function Hxt({base:e,onClose:t,onCreated:n,onAssociationInvalid:i}){const{t:r}=Ae("ui"),[s,a]=m.useState("document"),[l,c]=m.useState(""),[u,d]=m.useState(""),[f,h]=m.useState(""),[p,g]=m.useState(null),[b,v]=m.useState(!1),[y,x]=m.useState("{}"),[O,w]=m.useState(""),[k,S]=m.useState(""),[E,C]=m.useState(null),N=m.useRef(null),_=m.useRef(null),j=m.useRef(null),A=m.useRef(0),F=!!O;m.useEffect(()=>{var M;E&&!F&&((M=j.current)==null||M.focus())},[F,E]);const T=M=>{F||M===s||(a(M),g(null),h(""),c(""),d(""),S(""),C(null),v(!1),A.current=0,N.current&&(N.current.value=""))},P=M=>{if(!M||s==="web")return;const U=Qxt(M,s,r);if(U){g(null),c(""),d(""),S(U);return}g(M),S(""),c(M.name.replace(/\.[^.]+$/,"")),d(Y6(M.name).slice(1))},R=async M=>{if(M.preventDefault(),s==="web"?!f.trim():!p)return;let U;try{U=DEe(y,r("knowledge.errors.metadataObject"))}catch(I){S(ho(I,r("knowledge.errors.metadataFormat")));return}w(s==="web"?E?"save":"preview":"upload"),S("");try{if(s==="web")if(E){const I={sourceType:"url",metadata:E.metadata,url:E.preview.url,sourceTitle:E.preview.name,sourceMarkdown:E.preview.sourceMarkdown};await glt(e.id,e.region,I),n()}else{const I=await blt(e.id,e.region,{url:f.trim()});if(!I.sourceMarkdown.trim())throw new Error(r("knowledge.errors.noWebPreview"));C({preview:I,metadata:U})}else p&&(await ylt(e.id,e.region,{file:p,name:l.trim()||void 0,documentType:u.trim()||void 0,metadata:U}),n())}catch(I){I instanceof HR&&I.errorCode===GOe?i(I):S(ho(I,r(s==="web"?E?"knowledge.errors.addWeb":"knowledge.errors.previewWeb":"knowledge.errors.uploadFile")))}finally{w("")}},L=()=>{F||(C(null),S(""),requestAnimationFrame(()=>{var M;return(M=_.current)==null?void 0:M.focus()}))};return o.jsx(SE,{title:r(E?"knowledge.previewWeb":"knowledge.addData"),onClose:t,busy:F,className:E?"knowledge-dialog--preview knowledge-dialog--web-confirm":"",children:o.jsx("form",{onSubmit:M=>void R(M),children:E?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"knowledge-preview knowledge-web-preview",children:[o.jsxs("div",{className:"knowledge-preview__meta",children:[o.jsx("strong",{title:E.preview.name,children:E.preview.name}),o.jsx("a",{href:E.preview.url,target:"_blank",rel:"noopener noreferrer",children:r("knowledge.openOriginalWeb")})]}),o.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:o.jsx("div",{className:"knowledge-preview__markdown-shell",children:o.jsx(Bu,{text:E.preview.sourceMarkdown,allowRawHtml:!1,className:"knowledge-preview__markdown"})})}),k?o.jsx("div",{className:"knowledge-web-preview__error",children:o.jsx(HS,{message:k})}):null]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",className:"is-back",onClick:L,disabled:F,children:r("knowledge.backToEdit")}),o.jsx("button",{type:"button",onClick:t,disabled:F,children:r("common.cancel")}),o.jsx("button",{ref:j,type:"submit",className:"is-primary",disabled:F,children:r(O==="save"?"common.adding":"knowledge.confirmAdd")})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"knowledge-dialog__body",children:[o.jsx("div",{className:"knowledge-source-tabs",role:"tablist","aria-label":r("knowledge.source"),children:[["image",r("knowledge.image")],["document",r("knowledge.documentFile")],["web",r("knowledge.webPage")]].map(([M,U])=>o.jsx("button",{type:"button",role:"tab",id:`knowledge-source-${M}-tab`,"aria-controls":`knowledge-source-${M}-panel`,"aria-selected":s===M,tabIndex:s===M?0:-1,className:s===M?"is-active":"",disabled:F,onClick:()=>T(M),onKeyDown:I=>{const H=["image","document","web"];if(!["ArrowLeft","ArrowRight","Home","End"].includes(I.key))return;I.preventDefault();const K=H.indexOf(M),Q=I.key==="Home"?H[0]:I.key==="End"?H[H.length-1]:H[(K+(I.key==="ArrowRight"?1:-1)+H.length)%H.length];T(Q),requestAnimationFrame(()=>{var q;return(q=document.getElementById(`knowledge-source-${Q}-tab`))==null?void 0:q.focus()})},children:U},M))}),o.jsx("div",{id:`knowledge-source-${s}-panel`,className:"knowledge-source-panel",role:"tabpanel","aria-labelledby":`knowledge-source-${s}-tab`,children:s==="web"?o.jsxs(o.Fragment,{children:[o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.webUrl")}),o.jsx("input",{ref:_,autoFocus:!0,type:"url",value:f,disabled:F,onChange:M=>{h(M.target.value),S("")},placeholder:"https://example.com/article"})]}),o.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:O==="preview"?o.jsx(An,{children:r("knowledge.generatingWebPreview")}):null})]}):o.jsxs(o.Fragment,{children:[o.jsx("input",{ref:N,className:"knowledge-upload-input",type:"file","aria-label":r("knowledge.selectFile"),accept:s==="image"?IEe:PEe,disabled:F,onChange:M=>{var U;P(((U=M.currentTarget.files)==null?void 0:U[0])??null),M.currentTarget.value=""}}),o.jsxs("button",{type:"button",className:`knowledge-upload-dropzone${b?" is-dragging":""}${p?" is-ready":""}`,disabled:F,onClick:()=>{var M;return(M=N.current)==null?void 0:M.click()},onDragEnter:M=>{M.preventDefault(),!F&&(A.current+=1,v(!0))},onDragOver:M=>{M.preventDefault(),F||(M.dataTransfer.dropEffect="copy")},onDragLeave:M=>{M.preventDefault(),A.current=Math.max(0,A.current-1),A.current===0&&v(!1)},onDrop:M=>{var U;M.preventDefault(),A.current=0,v(!1),F||P(((U=M.dataTransfer.files)==null?void 0:U[0])??null)},children:[o.jsx("strong",{children:p?p.name:r("knowledge.selectOrDropFile")}),o.jsx("span",{children:p?r("knowledge.selectedFile",{size:dU(p.size)}):r(s==="image"?"knowledge.imageFileHelp":"knowledge.documentFileHelp")})]}),o.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:F?o.jsx(An,{children:r("knowledge.uploadingFile")}):null})]})}),s!=="web"?o.jsxs("div",{className:"knowledge-dialog__fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.optionalName")}),o.jsx("input",{value:l,disabled:F,maxLength:256,onChange:M=>c(M.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.optionalType")}),o.jsx("input",{value:u,disabled:F,maxLength:64,onChange:M=>d(M.target.value),placeholder:"pdf, docx, png"})]})]}):null,o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.metadataJson")}),o.jsx("textarea",{className:"is-code",value:y,disabled:F,onChange:M=>x(M.target.value),spellCheck:!1})]}),o.jsx(HS,{message:k})]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",onClick:t,disabled:F,children:r("common.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:F||(s==="web"?!f.trim():!p),children:r(F?s==="web"?"common.generating":"common.uploading":s==="web"?"knowledge.generatePreview":"knowledge.uploadFile")})]})]})})})}function qxt({base:e,item:t,onClose:n,onUpdated:i}){const{t:r}=Ae("ui"),[s,a]=m.useState(()=>JSON.stringify(t.metadata??{},null,2)),[l,c]=m.useState(!1),[u,d]=m.useState(""),f=async h=>{h.preventDefault();let p;try{p=DEe(s,r("knowledge.errors.metadataObject"))}catch(g){d(ho(g,r("knowledge.errors.metadataFormat")));return}c(!0),d("");try{i(await vlt(e.id,t.id,e.region,{metadata:p}))}catch(g){d(ho(g,r("knowledge.errors.updateDocument")))}finally{c(!1)}};return o.jsx(SE,{title:r("knowledge.editMetadata"),onClose:n,busy:l,children:o.jsxs("form",{onSubmit:h=>void f(h),children:[o.jsxs("div",{className:"knowledge-dialog__body",children:[o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.knowledge")}),o.jsx("input",{value:t.name||t.id,disabled:!0})]}),o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.metadataJson")}),o.jsx("textarea",{autoFocus:!0,className:"is-code knowledge-metadata-editor",value:s,onChange:h=>a(h.target.value),spellCheck:!1})]}),o.jsx(HS,{message:u})]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",onClick:n,disabled:l,children:r("common.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:l,children:r(l?"common.saving":"common.save")})]})]})})}const MEe=new Set(["avif","bmp","gif","jpeg","jpg","png","svg","webp"]),LEe=new Set(["aac","flac","m4a","mp3","ogg","wav","webm"]),$Ee=new Set(["m4v","mov","mp4","mpeg","mpg","ogg","webm"]),Wxt=new Set(["pdf"]),Gxt=new Set(["doc","docx","ppt","pptx","xls","xlsx"]),Kxt=new Set(["creating","indexing","pending","processing","queued","submitted"]),Xxt=new Set(["error","failed","unavailable"]);function PY(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function DT(e){if(e==null||e==="")return"-";if(["string","number","boolean"].includes(typeof e))return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function Yxt(e,t){if(Array.isArray(e)){if(e.length===0)return null;const r=e.map(PY);if(r.some(s=>Object.keys(s).length>0)){const s=[...new Set(r.flatMap(a=>Object.keys(a)))];return{columns:s,rows:r.map(a=>s.map(l=>DT(a[l])))}}return{columns:[t("knowledge.value")],rows:e.map(s=>[DT(s)])}}const n=PY(e),i=Object.entries(n);if(i.length===0)return null;if(i.every(([,r])=>Array.isArray(r))){const r=i.map(([a])=>a),s=Math.max(...i.map(([,a])=>a.length));return{columns:r,rows:Array.from({length:s},(a,l)=>i.map(([,c])=>DT(c[l])))}}return{columns:[t("knowledge.field"),t("knowledge.value")],rows:i.map(([r,s])=>[r,DT(s)])}}function FEe(e){const t=e.trim();if(!t||t.startsWith("//"))return"";if(t.startsWith("/"))return t;try{const n=new URL(t);return["http:","https:"].includes(n.protocol)?n.href:""}catch{return""}}function Zxt(e){const t=FEe(e);return t.startsWith("http://")||t.startsWith("https://")?t:""}function Jxt(e){var r;const t=e.attachmentType.trim().toLocaleLowerCase();if(t==="image"||t==="doc-image"||t.startsWith("image/"))return"image";if(t==="audio"||t.startsWith("audio/"))return"audio";if(t==="video"||t.startsWith("video/"))return"video";if(t==="pdf"||t==="application/pdf")return"pdf";const n=e.attachmentUrl.split(/[?#]/,1)[0],i=n.includes(".")?((r=n.split(".").pop())==null?void 0:r.toLocaleLowerCase())??"":"";return MEe.has(i)?"image":LEe.has(i)?"audio":$Ee.has(i)?"video":Wxt.has(i)?"pdf":t||i?"file":"none"}function e1t(e,t){const n=e.status.trim().toLocaleLowerCase();if(Kxt.has(n))return{title:t("knowledge.preview.processingTitle"),detail:t("knowledge.preview.processingDetail")};if(Xxt.has(n))return{title:t("knowledge.preview.failedTitle"),detail:t("knowledge.preview.failedDetail")};const i=Z6(e).toLocaleLowerCase();return i==="pdf"||Gxt.has(i)?{title:t("knowledge.preview.noParsedTitle"),detail:t("knowledge.preview.noParsedDetail")}:MEe.has(i)||LEe.has(i)||$Ee.has(i)?{title:t("knowledge.preview.noMediaTitle"),detail:t("knowledge.preview.noMediaDetail")}:{title:t("knowledge.preview.noDataTitle"),detail:t("knowledge.preview.noDataDetail")}}function t1t({chunk:e}){const{t}=Ae("ui"),[n,i]=m.useState(!1),r=FEe(e.attachmentUrl),s=Jxt(e);return!r||s==="none"?null:n?o.jsx("div",{className:"knowledge-preview__attachment-error",children:t("knowledge.preview.attachmentError")}):s==="image"?o.jsx("img",{className:"knowledge-preview__image",src:r,alt:e.title||t("knowledge.preview.imageAlt"),loading:"lazy",onError:()=>i(!0)}):s==="audio"?o.jsx("audio",{className:"knowledge-preview__audio",src:r,controls:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.audioUnsupported")}):s==="video"?o.jsx("video",{className:"knowledge-preview__video",src:r,controls:!0,playsInline:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.videoUnsupported")}):s==="pdf"?o.jsxs("div",{className:"knowledge-preview__pdf",children:[o.jsx("iframe",{src:r,title:e.title?t("knowledge.preview.namedPdf",{name:e.title}):t("knowledge.preview.pdf"),sandbox:"",referrerPolicy:"no-referrer",onError:()=>i(!0)}),o.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openPdf")})]}):o.jsxs("div",{className:"knowledge-preview__file-fallback",children:[o.jsx("p",{children:t("knowledge.preview.fileUnsupported")}),o.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openOriginalFile")})]})}function n1t({base:e,item:t,onClose:n}){const{t:i}=Ae("ui"),[r,s]=m.useState([]),[a,l]=m.useState(t),[c,u]=m.useState(""),[d,f]=m.useState(!0),[h,p]=m.useState(!1),[g,b]=m.useState(!1),[v,y]=m.useState(""),x=m.useRef(0),O=m.useRef(null),w=m.useCallback(async(C=0)=>{var j;(j=O.current)==null||j.abort();const N=new AbortController;O.current=N;const _=x.current+1;x.current=_,C>0?p(!0):f(!0),y(""),C===0&&(s([]),b(!1));try{const A=await mlt(e.id,t.id,{region:e.region,offset:C,signal:N.signal});if(x.current!==_)return;l(A.document.id?A.document:t),u(A.sourceMarkdown||A.document.sourceMarkdown),s(F=>C>0?[...F,...A.chunks]:A.chunks),b(A.hasMore)}catch(A){!X6(A)&&x.current===_&&y(ho(A,i("knowledge.errors.loadPreview")))}finally{x.current===_&&(f(!1),p(!1))}},[e.id,e.region,t,i]);m.useEffect(()=>(w(),()=>{var C;(C=O.current)==null||C.abort(),x.current+=1}),[w]);const k=Zxt(a.url||t.url),S=e1t(a,i),E=a.metadata._veadk_content_format==="markdown";return o.jsx(SE,{title:a.name||t.name||t.id,onClose:n,className:"knowledge-dialog--preview",children:o.jsxs("div",{className:"knowledge-preview",children:[a.sizeBytes>0||k?o.jsxs("div",{className:"knowledge-preview__meta",children:[a.sizeBytes>0?o.jsx("span",{children:dU(a.sizeBytes)}):null,k?o.jsx("a",{href:k,target:"_blank",rel:"noopener noreferrer",children:i("knowledge.openOriginalWeb")}):null]}):null,o.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:c?o.jsx("div",{className:"knowledge-preview__markdown-shell",children:o.jsx(Bu,{text:c,allowRawHtml:!1,className:"knowledge-preview__markdown"})}):d?o.jsx("div",{className:"knowledge-preview__state",role:"status",children:o.jsx(An,{as:"span",duration:2.4,children:i("knowledge.preview.loading")})}):v&&r.length===0?o.jsxs("div",{className:"knowledge-preview__state is-error",role:"alert",children:[o.jsx("p",{children:v}),o.jsx("button",{type:"button",onClick:()=>void w(),children:i("common.retry")})]}):r.length===0?o.jsxs("div",{className:"knowledge-preview__state",children:[o.jsx("p",{children:S.title}),o.jsx("span",{children:k?i("knowledge.preview.openOriginalHint"):S.detail}),o.jsx("button",{type:"button",onClick:()=>void w(),children:i("common.reload")})]}):o.jsxs("div",{className:"knowledge-preview__chunks",children:[r.map((C,N)=>{const _=Yxt(C.tableFields,i),j=C.id||`${N}:${C.title}`;return o.jsxs("article",{className:"knowledge-preview__chunk",children:[o.jsx("header",{children:o.jsx("h3",{children:C.title||i("knowledge.preview.chunk",{index:N+1})})}),C.content?E?o.jsx(Bu,{text:C.content,allowRawHtml:!1,className:"knowledge-preview__markdown"}):o.jsx("p",{className:"knowledge-preview__content",children:C.content}):null,_?o.jsx("div",{className:"knowledge-preview__table-wrap",children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsx("tr",{children:_.columns.map((A,F)=>o.jsx("th",{scope:"col",children:A},`${A}:${F}`))})}),o.jsx("tbody",{children:_.rows.map((A,F)=>o.jsx("tr",{children:A.map((T,P)=>o.jsx("td",{children:T},P))},F))})]})}):null,o.jsx(t1t,{chunk:C})]},j)}),v?o.jsx("div",{className:"knowledge-preview__more-error",role:"alert",children:v}):null,g?o.jsx("button",{type:"button",className:"knowledge-preview__load-more",disabled:h,onClick:()=>void w(r.length),children:h?o.jsx(An,{as:"span",duration:2.4,children:i("knowledge.preview.loadingMore")}):i("knowledge.preview.loadMore")}):null]})})]})})}function i1t({cloudProvider:e,region:t,active:n=!0,activationRevision:i=0,onDetailChange:r,toolbarLeading:s,toolbarFilters:a}){const{t:l,i18n:c}=Ae("ui"),[u,d]=m.useState([]),[f,h]=m.useState({}),[p,g]=m.useState([]),[b,v]=m.useState(""),[y,x]=m.useState("overview"),[O,w]=m.useState(""),[k,S]=m.useState(""),[E,C]=m.useState(!0),[N,_]=m.useState(!1),[j,A]=m.useState(""),[F,T]=m.useState([]),[P,R]=m.useState(!1),[L,M]=m.useState(""),[U,I]=m.useState(""),[H,K]=m.useState(""),[Q,q]=m.useState(!1),[B,ee]=m.useState(!1),[le,se]=m.useState(!1),[re,ge]=m.useState(null),[W,X]=m.useState(null),[ae,ue]=m.useState(null),[Oe,Se]=m.useState(null),[lt,$e]=m.useState(null),[Le,Ne]=m.useState(!1),qe=m.useRef(0),Re=m.useRef(0),ze=m.useRef([]),Ee=m.useRef(!1),De=m.useRef(!1),J=m.useRef(null),he=m.useRef(null),Ce=m.useRef({}),Ze=m.useRef(!1),at=m.useRef(null),St=m.useRef(null),Te=m.useRef(null),ye=m.useRef(null),Ve=m.useMemo(()=>[t],[t]),nt=m.useCallback(xe=>`${xe.region}\0${xe.id}`,[]),ke=u.find(xe=>nt(xe)===b)??null,Ht=!!(ke&&H===nt(ke));m.useEffect(()=>{r==null||r(!!ke)},[r,ke]),m.useEffect(()=>{x("overview"),S("")},[b]);const on=m.useMemo(()=>{const xe=O.trim().toLocaleLowerCase();return xe?u.filter(He=>[He.name,He.description,He.ownerLabel,He.providerKnowledgeId].some(Ke=>Ke.toLocaleLowerCase().includes(xe))):u},[u,O]),Yt=m.useMemo(()=>{const xe=k.trim().toLocaleLowerCase();return xe?F.filter(He=>[He.name,He.id,Z6(He)].some(Ke=>Ke.toLocaleLowerCase().includes(xe))):F},[k,F]);m.useEffect(()=>{X(null)},[ke==null?void 0:ke.id,ke==null?void 0:ke.region]);const xt=m.useCallback(async(xe=!1)=>{var yt;if(xe&&(Ze.current||Object.keys(Ce.current).length===0))return;(yt=J.current)==null||yt.abort();const He=new AbortController;J.current=He;const Ke=qe.current+1;qe.current=Ke,Ze.current=!0,xe?_(!0):C(!0),A(""),xe||g([]);try{const Dt=await ult({regions:Ve,nextTokens:xe?Ce.current:void 0,signal:He.signal});if(qe.current!==Ke)return;d(Xt=>xe?[...Xt,...Dt.items.filter(dn=>!Xt.some(Z=>nt(Z)===nt(dn)))]:Dt.items),Ce.current=Dt.nextTokens,h(Dt.nextTokens);const ln=Dt.failures.map(({region:Xt,error:dn})=>`${xh(Xt,e)}: ${ho(dn,l("common.loadFailed"))}`);g(Xt=>xe?[...new Set([...Xt,...ln])]:ln),xe||v(Xt=>Dt.items.some(dn=>nt(dn)===Xt)?Xt:"")}catch(Dt){if(X6(Dt))return;qe.current===Ke&&(xe?g(ln=>[...new Set([...ln,ho(Dt,l("knowledge.errors.loadMoreBases"))])]):A(ho(Dt,l("knowledge.errors.loadBases"))))}finally{qe.current===Ke&&(Ze.current=!1,C(!1),_(!1))}},[nt,e,Ve,l]),Pt=m.useCallback(async(xe,He=!1)=>{var Dt;if(He&&Ee.current)return;(Dt=he.current)==null||Dt.abort();const Ke=new AbortController;he.current=Ke;const yt=Re.current+1;Re.current=yt,He||(ze.current=[],De.current=!1,T([]),q(!1),I("")),Ee.current=!0,R(!0),He?I(""):M("");try{const ln=await plt(xe.id,{region:xe.region,offset:He?ze.current.length:0,signal:Ke.signal});if(Re.current!==yt)return;K(Ft=>Ft===nt(xe)?"":Ft);const Xt=ze.current,dn=He?[...Xt,...ln.items.filter(Ft=>!Ft.id||!Xt.some(Ue=>Ue.id===Ft.id))]:ln.items,Z=ln.hasMore&&(!He||dn.length>Xt.length);ze.current=dn,De.current=Z,T(dn),q(Z)}catch(ln){if(X6(ln))return;Re.current===yt&&(ln instanceof HR&&ln.errorCode===GOe&&(K(nt(xe)),ge(dn=>dn&&nt(dn)===nt(xe)?null:dn)),He?I(ho(ln,l("knowledge.errors.loadMoreData"))):M(ho(ln,l("knowledge.errors.loadData"))))}finally{Re.current===yt&&(Ee.current=!1,R(!1))}},[nt,l]);m.useEffect(()=>{var xe;(xe=J.current)==null||xe.abort(),qe.current+=1,Ze.current=!1,Ce.current={},d([]),h({}),g([]),v(""),K(""),A(""),C(!0)},[e]),m.useEffect(()=>{if(n)return xt(),()=>{var xe;(xe=J.current)==null||xe.abort(),qe.current+=1,Ze.current=!1}},[n,i,xt]),m.useEffect(()=>{var xe,He;if(!n){(xe=he.current)==null||xe.abort(),Re.current+=1,Ee.current=!1;return}if(!ke){(He=he.current)==null||He.abort(),Re.current+=1,ze.current=[],Ee.current=!1,De.current=!1,T([]),q(!1),I("");return}return Pt(ke),()=>{var Ke;(Ke=he.current)==null||Ke.abort(),Re.current+=1,Ee.current=!1}},[n,i,ke==null?void 0:ke.id,ke==null?void 0:ke.region]);const ct=n&&!ke&&!O.trim()&&!E&&!N&&!j&&Object.keys(f).length>0;m.useEffect(()=>{const xe=St.current,He=at.current;if(!xe||!He||!ct)return;const Ke=new IntersectionObserver(([yt])=>{yt.isIntersecting&&xt(!0)},{root:He,rootMargin:"240px 0px",threshold:.01});return Ke.observe(xe),()=>Ke.disconnect()},[ct,xt]);const gt=()=>{const xe=at.current;!xe||!ct||xe.scrollHeight-xe.scrollTop-xe.clientHeight<=240&&xt(!0)},Pe=!!(ke&&F.length>0&&Q&&!P&&!U);m.useEffect(()=>{const xe=ye.current,He=Te.current;if(!ke||!xe||!He||!Pe)return;const Ke=new IntersectionObserver(([yt])=>{yt.isIntersecting&&Pt(ke,!0)},{root:Te.current,rootMargin:"240px 0px",threshold:.01});return Ke.observe(xe),()=>Ke.disconnect()},[Pe,Pt,ke==null?void 0:ke.id,ke==null?void 0:ke.region]);const kt=()=>{const xe=Te.current;if(!ke||!xe||!De.current||Ee.current||U)return;const{scrollHeight:He,scrollTop:Ke,clientHeight:yt}=xe;He-Ke-yt<=240&&Pt(ke,!0)},Me=xe=>{d(He=>He.map(Ke=>nt(Ke)===nt(xe)?xe:Ke))},Ye=async()=>{if(Oe){Ne(!0);try{await hlt(Oe.id,Oe.region),d(xe=>xe.filter(He=>nt(He)!==nt(Oe))),K(xe=>xe===nt(Oe)?"":xe),b===nt(Oe)&&v(""),Se(null)}catch(xe){A(ho(xe,l("knowledge.errors.deleteBase"))),Se(null)}finally{Ne(!1)}}},et=async()=>{if(!(!ke||!lt)){Ne(!0);try{await xlt(ke.id,lt.id,ke.region);const xe=ze.current.filter(He=>He.id!==lt.id);ze.current=xe,T(xe),$e(null)}catch(xe){M(ho(xe,l("knowledge.errors.deleteDocument"))),$e(null)}finally{Ne(!1)}}};return o.jsxs("section",{className:`knowledge-library${ke?" is-detail":" resource-collection"}`,"aria-label":l("knowledge.library"),children:[ke?o.jsx(uE,{className:"knowledge-library__detail",title:ke.name,description:ke.description||l("common.noDescription"),identitySeed:ke.name,backLabel:l("knowledge.backToList"),onBack:()=>v(""),sections:[{key:"overview",label:l("skillCenter.overview"),content:o.jsx("section",{className:"knowledge-overview",children:o.jsxs(NB,{className:"knowledge-overview__summary",children:[o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.provider")}),o.jsx("dd",{children:ke.providerType||"-"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.knowledgeId")}),o.jsx("dd",{className:"knowledge-keyboard-reveal",tabIndex:0,title:ke.providerKnowledgeId,children:ke.providerKnowledgeId||"-"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.project")}),o.jsx("dd",{children:ke.projectName||"default"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.creator")}),o.jsx("dd",{children:QM(ke.ownerLabel)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("skillCenter.updatedAt")}),o.jsx("dd",{children:$xt(ke.updatedAt,c.resolvedLanguage??c.language)||"-"})]})]})})},{key:"data",label:l("knowledge.data"),content:o.jsx("section",{className:"knowledge-documents",children:o.jsx("div",{className:`knowledge-documents__body${F.length>0?" is-table":""}`,"aria-live":"polite",children:P&&F.length===0?o.jsx(Ud,{}):L&&F.length===0?o.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[o.jsx("p",{children:L}),Ht&&ke.canManage?o.jsx("button",{type:"button",onClick:()=>Se(ke),children:l("knowledge.deleteInvalidAssociation")}):o.jsx("button",{type:"button",onClick:()=>void Pt(ke),children:l("common.retry")})]}):F.length===0?o.jsxs("div",{className:"knowledge-library__state",children:[o.jsx(Dxt,{}),o.jsx("p",{children:l("knowledge.noData")}),ke.canManage&&o.jsx("button",{type:"button",onClick:()=>ge(ke),children:l("knowledge.addFirstData")})]}):o.jsx(Not,{rows:Yt,rowKey:xe=>xe.id,rowLabel:xe=>xe.name||xe.id,columns:[{key:"name",header:l("common.name"),className:"is-primary-column",render:xe=>o.jsx("span",{title:xe.name||xe.id,children:xe.name||xe.id})},{key:"format",header:l("knowledge.format"),className:"is-compact-column",render:xe=>Z6(xe)},{key:"size",header:l("knowledge.size"),className:"is-compact-column",render:xe=>dU(xe.sizeBytes)}],searchValue:k,onSearchChange:S,searchPlaceholder:l("knowledge.searchData"),searchLabel:l("knowledge.searchLibraryData"),primaryAction:ke.canManage?{label:l(Ht?"knowledge.associationInvalid":"knowledge.addData"),disabled:Ht,title:Ht?l("knowledge.providerMissing"):void 0,onClick:()=>ge(ke)}:void 0,rowActions:xe=>[{label:l("common.preview"),onSelect:()=>X(xe)},...ke.canManage?[{label:l("common.edit"),onSelect:()=>ue(xe)},{label:l("common.delete"),onSelect:()=>$e(xe),danger:!0}]:[]],scrollRef:Te,onScroll:kt,busy:P,emptyLabel:l("knowledge.noMatchingData"),footer:P?o.jsxs("div",{className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:l("knowledge.loadingMoreData")})]}):U?o.jsxs("div",{className:"knowledge-document-pagination is-error",role:"alert",children:[o.jsx("span",{children:U}),o.jsx("button",{type:"button",onClick:()=>void Pt(ke,!0),children:l("knowledge.retryLoading")})]}):Q?o.jsx("div",{ref:ye,className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:l("skillCenter.scrollForMore")}):null})})})}],activeSectionKey:y,navigationLabel:l("knowledge.details"),onSectionChange:x,actions:ke.canManage?o.jsxs(o.Fragment,{children:[o.jsx(zt,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>Se(ke),children:l("common.delete")}),o.jsx(zt,{type:"button",color:"primary",size:"lg",pill:!1,onClick:()=>se(!0),children:l("common.edit")})]}):void 0}):o.jsxs(o.Fragment,{children:[o.jsxs(Zb,{className:"knowledge-library__toolbar library-resource-toolbar",children:[s,o.jsxs("div",{className:"resource-toolbar__actions",children:[a,o.jsx(wm,{value:O,onChange:xe=>w(xe.target.value),placeholder:l("knowledge.searchBases"),"aria-label":l("knowledge.searchBases")})]})]}),o.jsxs(Jb,{ref:at,"aria-live":"polite",onScroll:gt,children:[p.length>0&&!E&&o.jsxs("div",{className:"knowledge-region-warning",role:"status",children:[o.jsx("span",{children:l("knowledge.someBasesFailed")}),o.jsx("button",{type:"button",onClick:()=>void xt(),children:l("common.retry")})]}),E&&u.length===0?o.jsx(Ud,{}):j?o.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[o.jsx("p",{children:j}),o.jsx("button",{type:"button",onClick:()=>void xt(),children:l("common.retry")})]}):on.length===0&&O.trim()?o.jsxs("div",{className:"knowledge-library__state",children:[o.jsx(Pxt,{}),o.jsx("p",{children:l("knowledge.noMatchingBases")})]}):o.jsxs(Vx,{children:[O.trim()?null:o.jsx(Cb,{"aria-label":l("knowledge.createBase"),icon:o.jsx(Lxt,{}),onClick:()=>ee(!0),children:l("knowledge.createBase")}),on.map(xe=>o.jsx(pE,{className:"knowledge-card",title:xe.name,description:xe.description||l("common.noDescription"),metadata:[{label:l("knowledge.creator"),value:QM(xe.ownerLabel),title:QM(xe.ownerLabel)},{label:l("knowledge.project"),value:xe.projectName||"default",title:xe.projectName||"default"}],action:{label:H===nt(xe)?l("knowledge.associationInvalid"):l("knowledge.addData"),icon:"plus",disabled:!xe.canManage||H===nt(xe),title:xe.canManage?H===nt(xe)?l("knowledge.providerMissing"):void 0:l("knowledge.noManagePermission"),onClick:()=>ge(xe)},detailAction:{label:l("common.viewDetails"),onClick:()=>v(nt(xe))}},nt(xe)))]}),ct||N?o.jsx("div",{ref:St,className:"my-agent-load-more",role:"status","aria-live":"polite",children:N?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:l("knowledge.loadingMoreBases")})]}):ct?o.jsx("span",{children:l("skillCenter.scrollForMore")}):null}):null]})]}),B&&o.jsx(zxt,{region:t,onClose:()=>ee(!1),onCreated:xe=>{d(He=>[xe,...He]),v(nt(xe)),ee(!1)}}),ke&&le&&o.jsx(Vxt,{item:ke,onClose:()=>se(!1),onUpdated:xe=>{Me(xe),se(!1)}}),ke&&W&&o.jsx(n1t,{base:ke,item:W,onClose:()=>X(null)}),re&&o.jsx(Hxt,{base:re,onClose:()=>ge(null),onAssociationInvalid:xe=>{K(nt(re)),ke&&nt(ke)===nt(re)&&M(ho(xe,l("knowledge.associationInvalid"))),ge(null)},onCreated:()=>{ke&&nt(ke)===nt(re)&&Pt(ke),ge(null)}}),ke&&ae&&o.jsx(qxt,{base:ke,item:ae,onClose:()=>ue(null),onUpdated:xe=>{const He=ze.current.map(Ke=>Ke.id===xe.id?xe:Ke);ze.current=He,T(He),ue(null)}}),Oe&&o.jsx(pc,{title:l("knowledge.deleteBaseTitle"),description:l("knowledge.deleteBaseDescription",{name:Oe.name}),confirmLabel:l(Le?"common.deleting":"common.delete"),variant:"danger",busy:Le,onCancel:()=>Se(null),onConfirm:()=>void Ye()}),lt&&o.jsx(pc,{title:l("knowledge.deleteDocumentTitle"),description:l("knowledge.deleteDocumentDescription",{name:lt.name||lt.id}),confirmLabel:l(Le?"common.deleting":"common.delete"),variant:"danger",busy:Le,onCancel:()=>$e(null),onConfirm:()=>void et()})]})}const r1t="_EmptyMessage_1r5gu_1",s1t="_IconBadge_1r5gu_16",a1t="_Title_1r5gu_54",o1t="_Description_1r5gu_69",l1t="_ActionRow_1r5gu_77",kE={EmptyMessage:r1t,IconBadge:s1t,Title:a1t,Description:o1t,ActionRow:l1t},En=({children:e,className:t,fill:n="static"})=>o.jsx("div",{className:pi(kE.EmptyMessage,t),"data-fill":n,children:e}),c1t=({size:e="md",color:t="secondary",children:n,className:i})=>o.jsx("div",{className:pi(kE.IconBadge,i),"data-size":e,"data-color":t,children:n}),u1t=({children:e,className:t,color:n="secondary"})=>o.jsx("div",{className:pi(kE.Title,t),"data-color":n,children:e}),d1t=({children:e,className:t})=>o.jsx("div",{className:pi(kE.Description,t),children:e}),f1t=({children:e,className:t})=>o.jsx("div",{className:pi(kE.ActionRow,t),children:e});En.Icon=c1t;En.Title=u1t;En.Description=d1t;En.ActionRow=f1t;const h1t="/web/skill-management";class p1t extends Error{constructor(t,n,i="SKILL_MANAGEMENT_ERROR",r="",s,a=""){super(t),this.status=n,this.code=i,this.statusText=r,this.originalError=s,this.rawResponse=a,this.name="SkillManagementApiError"}}async function Uh(e,t={},n=Wo){return fetch(Bo(`${h1t}${e}`),{...t,headers:Hu(Dh(t.headers)),signal:Ol(t.signal,n)})}async function BEe(e,t){let n=t,i="SKILL_MANAGEMENT_ERROR",r;const s=await e.text().catch(()=>"");try{const a=JSON.parse(s);typeof a.detail=="string"?n=a.detail:a.detail&&(n=a.detail.message||t,i=a.detail.code||i,r=a.detail.originalError)}catch{s.trim()&&(n=V("common.fallbackWithDetail",{fallback:t,detail:s.trim()}))}return new p1t(n,e.status,i,e.statusText,r,s)}async function Qh(e,t){if(!e.ok)throw await BEe(e,t);return e.json()}async function m1t(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),Qh(await Uh(`/spaces?${t}`,{signal:e.signal}),V("skills.listSpacesFailed"))}async function g1t(e){return Qh(await Uh("/spaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),V("skills.createSpaceFailed"))}async function b1t(e){return Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.name,description:e.description,region:e.region})}),V("skills.updateSpaceFailed"))}async function y1t(e){const t=new URLSearchParams({region:e.region});await Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}?${t}`,{method:"DELETE"}),V("skills.deleteSpaceFailed"))}async function v1t(e){const t=new URLSearchParams({region:e.region});return e.project&&t.set("project",e.project),Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}/skills?${t}`,{method:"POST",headers:{"Content-Type":"application/zip"},body:e.file},is),V("skills.uploadFailed"))}async function x1t(e){return Qh(await Uh("/validate",{method:"POST",headers:{"Content-Type":"application/zip"},body:e},is),V("skills.validateFailed"))}async function w1t(e){const t=new URLSearchParams({region:e.region});await Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}?${t}`,{method:"DELETE"}),V("skills.deleteFailed"))}async function O1t(e){const t=new URLSearchParams({region:e.region});e.version&&t.set("version",e.version),e.skillSpaceName&&t.set("skill_space_name",e.skillSpaceName),e.skillName&&t.set("skill_name",e.skillName);const n=await Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/files?${t}`),V("skills.listFilesFailed"));return Array.isArray(n.files)?n.files:[]}async function S1t(e){var l;const t=new URLSearchParams({region:e.region});e.version&&t.set("version",e.version),e.skillSpaceName&&t.set("skill_space_name",e.skillSpaceName),e.skillName&&t.set("skill_name",e.skillName);const n=await Uh(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/archive?${t}`,{},is);n.ok||await Qh(n,V("skills.downloadFailed"));const r=((l=(n.headers.get("content-disposition")||"").match(/filename="([^"]+)"/))==null?void 0:l[1])||`${e.fallbackName}.zip`,s=URL.createObjectURL(await n.blob()),a=document.createElement("a");a.href=s,a.download=r,a.click(),URL.revokeObjectURL(s)}async function rI(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Ol(void 0,Wo)});if(!t.ok)throw await BEe(t,Lt("helpers.skills.agentKitRequestFailed"));return t.json()}async function UEe(){return(await rI("/web/skill-spaces")).items||[]}async function QEe(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await rI(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function k1t(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),rI(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`)}async function E1t(e,t,n,i,r,s,a){const l=[];n&&l.push(`version=${encodeURIComponent(n)}`),i&&l.push(`region=${encodeURIComponent(i)}`),r&&l.push(`project=${encodeURIComponent(r)}`),s&&l.push(`skill_name=${encodeURIComponent(s)}`),a&&l.push(`skill_space_name=${encodeURIComponent(a)}`);const c=l.length>0?`?${l.join("&")}`:"";return rI(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${c}`)}function C1t(e,t){const n=Fg(t);return{source:"skillspace",id:`ss:${e.id}/${n}/${t.version}`,name:t.skillName,description:t.skillDescription,folder:t.skillName,skillSpaceId:e.id,skillSpaceName:e.name,skillSpaceRegion:e.region,skillId:n,version:t.version}}function Fg(e){return e.skillId||e.skillName}function T1t(e,t,n="volcengine"){return n==="byteplus"?"":`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}sn.hasResourceBundle("en-US","skills")||sn.addResourceBundle("en-US","skills",Zae,!0,!0);sn.hasResourceBundle("zh-CN","skills")||sn.addResourceBundle("zh-CN","skills",mde,!0,!0);function Bt(e,t={}){return sn.t(e,{...t,ns:"skills"})}const A1t="/web/skill-workbench";class J6 extends Error{constructor(t,n,i="SKILL_WORKBENCH_ERROR",r=!1,s="",a,l=""){super(t),this.status=n,this.code=i,this.retryable=r,this.statusText=s,this.originalError=a,this.rawResponse=l,this.name="SkillWorkbenchApiError"}}function eu(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(Bt("api.invalidFormat",{label:t}));return e}function DY(e,t){if(e!=null){if(typeof e!="string"||!e.trim()||e.trim().length>256)throw new Error(Bt("api.invalidFormat",{label:t}));return e.trim()}}function _1t(e){if(e!=null){if(e==="pending"||e==="ready"||e==="failed"||e==="unknown")return e;throw new Error(Bt("api.invalidFormat",{label:Bt("api.recoveryStatus")}))}}async function Qd(e,t={},n=Wo){return fetch(Bo(`${A1t}${e}`),{...t,headers:Dh(t.headers),signal:Ol(t.signal,n)})}async function fU(e,t){var i;const n=await e.text().catch(()=>"");try{const r=eu(JSON.parse(n),Bt("api.errorResponse")),s=r.detail&&typeof r.detail=="object"?eu(r.detail,Bt("api.errorDetails")):r;return new J6(typeof s.message=="string"?s.message:t,e.status,typeof s.code=="string"?s.code:"SKILL_WORKBENCH_ERROR",s.retryable===!0,e.statusText,s.originalError&&typeof s.originalError=="object"?s.originalError:void 0,n)}catch{const r=((i=e.headers.get("content-type"))==null?void 0:i.split(";",1)[0])||Bt("api.missingContentType");return new J6(Bt("api.gatewayError",{fallback:t,status:e.status,contentType:r}),e.status,"SKILL_WORKBENCH_ERROR",!1,e.statusText,void 0,n)}}async function Sm(e,t){if(!e.ok)throw await fU(e,t);const n=e.headers.get("content-type")??"";if(!n.includes("application/json")){const i=n.split(";",1)[0]||Bt("api.missingContentType");throw new Error(Bt("api.nonJson",{fallback:t,status:e.status,contentType:i}))}return e.json()}function N1t(e){return Array.isArray(e)?e.map(t=>{const n=eu(t,Bt("api.activity")),i=n.kind,r=n.status;if(typeof n.id!="string"||!["status","thinking","message","tool"].includes(String(i))||!["running","done"].includes(String(r)))throw new Error(Bt("api.invalidActivity"));if(i==="tool"){if(typeof n.name!="string")throw new Error(Bt("api.invalidToolActivity"));return{id:n.id,kind:i,status:r,name:n.name,...n.input!==void 0?{args:n.input}:{},...n.output!==void 0?{response:n.output}:{}}}if(typeof n.text!="string")throw new Error(Bt("api.invalidTextActivity"));return{id:n.id,kind:i,status:r,text:n.text}}):[]}function j1t(e){if(e==null)return;const t=eu(e,Bt("api.publication"));if(typeof t.revision!="number"||typeof t.skillId!="string"||typeof t.version!="string"||!Array.isArray(t.skillSpaceIds)||!t.skillSpaceIds.every(n=>typeof n=="string")||t.disposition!=="create-new"&&t.disposition!=="update-source"||!tR(t.region)||typeof t.projectName!="string")throw new Error(Bt("api.invalidFormat",{label:Bt("api.publication")}));return{revision:t.revision,skillId:t.skillId,version:t.version,skillSpaceIds:t.skillSpaceIds,disposition:t.disposition,region:t.region,projectName:t.projectName}}function qS(e){const t=eu(e,Bt("api.task"));if(typeof t.jobId!="string"||t.operation!=="create"&&t.operation!=="optimize"||typeof t.intent!="string"||typeof t.revision!="number"||typeof t.state!="string")throw new Error(Bt("api.invalidFormat",{label:Bt("api.task")}));const n=Array.isArray(t.files)?t.files.flatMap(l=>{const c=eu(l,Bt("api.file"));return typeof c.path=="string"&&typeof c.size=="number"?[{path:c.path,size:c.size}]:[]}):[];if(!["running","ready","failed","cancelled","expired","published"].includes(t.state))throw new Error(Bt("api.unknownTaskState"));const r=DY(t.toolId,"Tool ID"),s=DY(t.sessionId,"Session ID"),a=_1t(t.recoveryStatus);return{jobId:t.jobId,operation:t.operation,intent:t.intent,...typeof t.model=="string"?{model:t.model}:{},...typeof t.style=="string"?{style:t.style}:{},...typeof t.requestedName=="string"?{requestedName:t.requestedName}:{},revision:t.revision,...r?{toolId:r}:{},...s?{sessionId:s}:{},...typeof t.sessionTtlSeconds=="number"?{sessionTtlSeconds:t.sessionTtlSeconds}:{},...typeof t.expiresAt=="string"?{expiresAt:t.expiresAt}:{},...typeof t.recoveryAvailable=="boolean"?{recoveryAvailable:t.recoveryAvailable}:{},...a?{recoveryStatus:a}:{},...typeof t.recoveredFromSnapshot=="boolean"?{recoveredFromSnapshot:t.recoveredFromSnapshot}:{},state:t.state,stage:typeof t.stage=="string"?t.stage:"generating",activities:N1t(t.activities),files:n,...t.source&&typeof t.source=="object"?{source:t.source}:{},...typeof t.name=="string"?{name:t.name}:{},...typeof t.description=="string"?{description:t.description}:{},...typeof t.skillMd=="string"?{skillMd:t.skillMd}:{},...typeof t.error=="string"?{error:t.error}:{},...t.validation&&typeof t.validation=="object"?{validation:t.validation}:{},...t.publication?{publication:j1t(t.publication)}:{}}}async function sI(e){const t=eu(await Sm(await Qd("/capabilities",{signal:e}),Bt("api.loadCapability")),Bt("api.capability"));return{enabled:t.enabled===!0,reason:typeof t.reason=="string"?t.reason:"",operations:Array.isArray(t.operations)?t.operations.filter(n=>n==="create"||n==="optimize"):[],models:Array.isArray(t.models)?t.models.flatMap(n=>{if(!n||typeof n!="object")return[];const i=n;return typeof i.id=="string"&&typeof i.label=="string"?[{id:i.id,label:i.label}]:[]}):[],styles:t.styles&&typeof t.styles=="object"&&!Array.isArray(t.styles)?Object.fromEntries(Object.entries(t.styles).filter(n=>typeof n[1]=="string")):{},...typeof t.maxUploadBytes=="number"?{maxUploadBytes:t.maxUploadBytes}:{}}}async function R1t(e){if(e.file){const n=new URLSearchParams({operation:"optimize",intent:e.intent});e.jobId&&n.set("job_id",e.jobId),e.model&&n.set("model",e.model),e.style&&n.set("style",e.style),e.name&&n.set("name",e.name);const i=await Qd(`/tasks/from-upload?${n}`,{method:"POST",body:e.file,headers:{"Content-Type":"application/zip"},signal:e.signal},is);return qS(await Sm(i,Bt("api.startOptimization")))}const t=await Qd("/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operation:e.operation,intent:e.intent,...e.model?{model:e.model}:{},...e.style?{style:e.style}:{},...e.name?{name:e.name}:{},...e.jobId?{jobId:e.jobId}:{},...e.source?{source:{kind:"skill-center",skillId:e.source.skillId,skillName:e.source.name,version:e.source.version,region:e.source.region,projectName:e.source.projectName,skillSpaceId:e.source.skillSpaceId,skillSpaceName:e.source.skillSpaceName}}:{}}),signal:e.signal},is);return qS(await Sm(t,Bt("api.startTask")))}async function I1t(e,t){return qS(await Sm(await Qd(`/tasks/${encodeURIComponent(e)}`,{signal:t}),Bt("api.loadTask")))}async function zM(e,t,n){const i=new URLSearchParams;i.set("expected_revision",String(t));const r=eu(await Sm(await Qd(`/tasks/${encodeURIComponent(e)}/artifact?${i.toString()}`,{signal:n}),Bt("api.loadArtifact")),Bt("api.artifact"));if(r.jobId!==e||r.revision!==t||!Number.isSafeInteger(r.revision)||r.revision<1||typeof r.sha256!="string"||!/^[0-9a-f]{64}$/.test(r.sha256)||typeof r.name!="string"||typeof r.description!="string"||!Array.isArray(r.files))throw new Error(Bt("api.invalidFormat",{label:Bt("api.artifact")}));const s=r.files.map(a=>{const l=eu(a,Bt("api.artifactFile"));if(typeof l.path!="string"||typeof l.size!="number"||typeof l.content!="string")throw new Error(Bt("api.invalidFormat",{label:Bt("api.artifactFile")}));return{path:l.path,size:l.size,content:l.content}});return{jobId:r.jobId,revision:r.revision,sha256:r.sha256,name:r.name,description:r.description,files:s}}async function VM(e){const t=await Qd(`/tasks/${encodeURIComponent(e.jobId)}/refinements`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({intent:e.intent,expectedRevision:e.expectedRevision})},is);return qS(await Sm(t,Bt("api.refine")))}async function P1t(e){const t=await Qd(`/tasks/${encodeURIComponent(e.jobId)}/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedRevision:e.expectedRevision})});return qS(await Sm(t,Bt("api.stop")))}async function D1t(e){const t=await Qd(`/tasks/${encodeURIComponent(e.jobId)}/publish-stream`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/x-ndjson"},body:JSON.stringify({disposition:e.disposition,expectedRevision:e.expectedRevision,expectedArtifactSha256:e.expectedArtifactSha256,skillSpaceIds:e.skillSpaceIds??[],projectName:e.projectName,region:e.region}),signal:e.signal},0);if(!t.ok)throw await fU(t,Bt("api.publish"));if(!(t.headers.get("content-type")??"").includes("application/x-ndjson"))throw new Error(Bt("api.nonNdjson"));if(!t.body)throw new Error(Bt("api.missingStream"));const i=new Set(["preparing","uploading","registering","activating","publishing"]);let r=null,s="";const a=new TextDecoder,l=t.body.getReader(),c=u=>{var h;if(!u.trim())return;const d=eu(JSON.parse(u),Bt("api.publishProgress"));if(d.type==="progress"){if(typeof d.phase!="string"||!i.has(d.phase)||typeof d.message!="string")throw new Error(Bt("api.invalidPublishProgress"));(h=e.onProgress)==null||h.call(e,{phase:d.phase,message:d.message});return}if(d.type==="error"){const p=eu(d.error,Bt("api.publishError"));throw new J6(typeof p.message=="string"?p.message:Bt("api.publish"),500,typeof p.code=="string"?p.code:"SKILL_PUBLISH_FAILED",p.retryable===!0,"",p.originalError&&typeof p.originalError=="object"?p.originalError:void 0,JSON.stringify(d.error))}if(d.type!=="complete")throw new Error(Bt("api.unknownPublishEvent"));const f=eu(d.result,Bt("api.publishResult"));if(typeof f.skillId!="string"||typeof f.version!="string"||!Array.isArray(f.skillSpaceIds)||!f.skillSpaceIds.every(p=>typeof p=="string")||f.disposition!=="create-new"&&f.disposition!=="update-source"||!tR(f.region)||typeof f.projectName!="string")throw new Error(Bt("api.invalidFormat",{label:Bt("api.publishResult")}));r={skillId:f.skillId,version:f.version,skillSpaceIds:f.skillSpaceIds,disposition:f.disposition,region:f.region,projectName:f.projectName}};for(;;){const{value:u,done:d}=await l.read();s+=a.decode(u,{stream:!d});const f=s.split(` -`);if(s=f.pop()??"",f.forEach(c),d)break}if(c(s),!r)throw new Error(Bt("api.streamEnded"));return r}async function M1t(e){await Sm(await Qd(`/tasks/${encodeURIComponent(e)}`,{method:"DELETE"}),Bt("api.deleteTask"))}async function L1t(e,t,n){var c;const i=new URLSearchParams;i.set("expected_revision",String(t)),i.set("expected_sha256",n);const r=await Qd(`/tasks/${encodeURIComponent(e)}/download?${i.toString()}`,{},is);if(!r.ok)throw await fU(r,Bt("api.download"));const a=((c=(r.headers.get("content-disposition")??"").match(/filename="([^"]+)"/))==null?void 0:c[1])??"skill.zip",l=URL.createObjectURL(await r.blob());try{const u=document.createElement("a");u.href=l,u.download=a,u.click()}finally{URL.revokeObjectURL(l)}}const $1t={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 F1t(e,t){if(!t||t==="/")return e;const n=t.replace(/^\//,"").split("/").map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"));let i=e;for(const r of n){if(i==null||typeof i!="object")return;i=i[r]}return i}function B1t(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function U1t(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function hU(e,t){if(B1t(e))return F1t(t,e.path);if(U1t(e)){const n=$1t[e.call],i={};for(const[r,s]of Object.entries(e.args??{}))i[r]=hU(s,t);return n?n(i):`[unknown fn: ${e.call}]`}return e}function Q1t(e,t){const n=hU(e,t);return n==null?"":typeof n=="string"?n:String(n)}const zEe=new Map;function s0(e,t){zEe.set(e,t)}function z1t(e){return zEe.get(e)}function V1t(e,t,n){const i=t.replace(/^\//,"").split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let r=e;for(let s=0;shU(i,e.dataModel),resolveString:i=>Q1t(i,e.dataModel),dispatchAction:t,render:i=>{if(!i)return null;const r=e.components[i];if(!r)return null;const s=z1t(r.component)??H1t;return o.jsx(s,{node:r,ctx:n},i)}};return o.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function HEe(e){const t=m.useRef(null),n=m.useRef(!0),i=28,r=m.useCallback(()=>{const s=t.current;s&&(n.current=s.scrollHeight-s.scrollTop-s.clientHeight{const s=t.current;s&&n.current&&(s.scrollTop=s.scrollHeight)},[e]),{ref:t,onScroll:r}}function aI({value:e,skillPrefix:t="/",onRemoveSkill:n,onRemoveAgent:i}){const{t:r}=Ae("conversation");return e.skills.length===0&&!e.targetAgent?null:o.jsxs("div",{className:"invocation-chips","aria-label":r("invocation.ariaLabel"),children:[e.skills.map(s=>o.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:s.description,children:[o.jsx(mS,{"aria-hidden":!0}),o.jsxs("span",{children:[t,s.name]}),n?o.jsx("button",{type:"button",onClick:()=>n(s.name),"aria-label":r("invocation.removeSkill",{name:s.name}),children:o.jsx(Ba,{})}):null]},s.name)),e.targetAgent?o.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[o.jsx(Sbe,{"aria-hidden":!0}),o.jsx("span",{children:e.targetAgent.name}),i?o.jsx("button",{type:"button",onClick:i,"aria-label":r("invocation.removeAgent",{name:e.targetAgent.name}),children:o.jsx(Ba,{})}):null]}):null]})}function pU(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function qEe(e){var n,i,r,s;const t=pU(e.mimeType);return t==="pdf"?"PDF":t==="markdown"?"MD":t==="video"?((i=(n=e.mimeType)==null?void 0:n.split("/")[1])==null?void 0:i.toUpperCase())??"VIDEO":t==="image"?((s=(r=e.mimeType)==null?void 0:r.split("/")[1])==null?void 0:s.toUpperCase())??"IMAGE":"TXT"}function WEe(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function GEe(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?Jbe(t,e.uri):""}function W1t({kind:e}){return e==="image"?o.jsx(LF,{}):e==="video"?o.jsx(Ebe,{}):e==="pdf"?o.jsx(b7e,{}):o.jsx(DF,{})}function oI({appName:e,items:t,compact:n=!1,onRemove:i}){const{t:r}=Ae("conversation"),[s,a]=m.useState(null);return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(l=>{const c=pU(l.mimeType),u=GEe(l,e),d=l.status==="uploading"||l.status==="error"||!u,f=o.jsxs("button",{type:"button",className:"media-card-main",disabled:d,onClick:c==="image"?void 0:()=>a(l),"aria-label":r("media.preview",{name:l.name??r("media.attachment")}),children:[c==="image"&&u?o.jsx("img",{className:"media-card-image",src:u,alt:l.name??r("media.image"),loading:"lazy"}):c==="video"&&u?o.jsxs("div",{className:"media-card-video-container",children:[o.jsx("video",{className:"media-card-video",src:u,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),o.jsx("span",{className:"media-card-video-play",children:o.jsx(_7e,{})})]}):o.jsx("span",{className:"media-card-icon",children:o.jsx(W1t,{kind:c})}),o.jsxs("span",{className:"media-card-copy",children:[o.jsx("span",{className:"media-card-name",children:l.name??r("media.attachment")}),o.jsxs("span",{className:"media-card-meta",children:[o.jsx("span",{className:"media-card-type",children:qEe(l)}),l.status==="uploading"?o.jsxs(o.Fragment,{children:[o.jsx(fi,{className:"media-card-spinner"})," ",r("media.uploading")]}):l.status==="error"?l.error??r("media.uploadFailed"):WEe(l.sizeBytes)]})]}),!n&&l.status!=="uploading"&&l.status!=="error"?o.jsx(Ky,{className:"media-card-open"}):null]});return o.jsxs(pr.div,{className:`media-card media-card--${c}${l.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[c==="image"&&!d?o.jsx(mbe,{src:u,children:f}):f,i?o.jsx("button",{type:"button",className:"media-card-remove","aria-label":r("media.remove",{name:l.name??r("media.attachment")}),onClick:()=>i(l.id),children:o.jsx(Ba,{})}):null]},l.id)})}),o.jsx(Ru,{children:s?o.jsx(G1t,{appName:e,item:s,onClose:()=>a(null)}):null})]})}function G1t({appName:e,item:t,onClose:n}){const{t:i}=Ae("conversation"),r=m.useMemo(()=>GEe(t,e),[e,t]),s=pU(t.mimeType),[a,l]=m.useState(""),[c,u]=m.useState(s==="text"||s==="markdown"),[d,f]=m.useState("");return m.useEffect(()=>{const h=p=>{p.key==="Escape"&&n()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[n]),m.useEffect(()=>{if(s!=="text"&&s!=="markdown")return;const h=new AbortController;return u(!0),f(""),fetch(r,{signal:h.signal}).then(p=>{if(!p.ok)throw new Error(`HTTP ${p.status}`);return p.text()}).then(l).catch(p=>{h.signal.aborted||f(p instanceof Error?p.message:String(p))}).finally(()=>{h.signal.aborted||u(!1)}),()=>h.abort()},[s,r]),o.jsx(pr.div,{className:"media-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":i("media.previewDialog",{name:t.name??i("media.attachment")}),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:h=>{h.target===h.currentTarget&&n()},children:o.jsxs(pr.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??i("media.attachment")}),o.jsxs("span",{children:[qEe(t),t.sizeBytes?` · ${WEe(t.sizeBytes)}`:""]})]}),o.jsxs("nav",{children:[o.jsx("a",{href:r,download:t.name,"aria-label":i("media.download"),children:o.jsx(Yj,{})}),o.jsx("button",{type:"button",onClick:n,"aria-label":i("media.close"),children:o.jsx(Ba,{})})]})]}),o.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?o.jsx("img",{src:r,alt:t.name??i("media.image")}):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,c?o.jsxs("div",{className:"media-viewer-loading",children:[o.jsx(fi,{})," ",i("media.reading")]}):null,!c&&d?o.jsx("div",{className:"media-viewer-loading",children:i("media.loadFailed",{error:d})}):null,!c&&s==="markdown"?o.jsx("div",{className:"media-document",children:o.jsx(Bu,{text:a})}):null,!c&&s==="text"?o.jsx("pre",{className:"media-document media-document--plain",children:a}):null]})]})})}function MY(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 K1t(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 mU(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",{className:"video-generate-icon__body",d:"M3.25 9h17.5v7.35a2.4 2.4 0 0 1-2.4 2.4H5.65a2.4 2.4 0 0 1-2.4-2.4V9Z"}),o.jsxs("g",{className:"video-generate-icon__clapper",children:[o.jsx("path",{d:"M3.25 9V7.65a2.4 2.4 0 0 1 2.4-2.4h12.7a2.4 2.4 0 0 1 2.4 2.4V9H3.25Z"}),o.jsx("path",{d:"M6.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 X1t(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 Y1t(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 Z1t(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 J1t(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 ewt(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 twt(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:"6",cy:"6.25",r:"2.25"}),o.jsx("circle",{cx:"18",cy:"6.25",r:"2.25"}),o.jsx("circle",{cx:"12",cy:"17.75",r:"2.25"}),o.jsx("path",{d:"m7.7 7.75 2.7 7.55M16.3 7.75l-2.7 7.55M8.25 6.25h7.5"})]})}function LY(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:"9",cy:"8",r:"3"}),o.jsx("path",{d:"M3.75 18.75c.45-3.05 2.2-4.65 5.25-4.65s4.8 1.6 5.25 4.65"}),o.jsx("path",{d:"M17.75 4.25v5.5M15 7h5.5M16 13.25h4.25M18.125 11.125v4.25"})]})}function nwt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"4",y:"4.25",width:"16",height:"5",rx:"1.5"}),o.jsx("rect",{x:"4",y:"14.75",width:"16",height:"5",rx:"1.5"}),o.jsx("path",{d:"M7.25 6.75h.01M7.25 17.25h.01M10 6.75h6.5M10 17.25h6.5"})]})}function iwt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M6 3.75h8l4 4v12.5H6V3.75Z"}),o.jsx("path",{d:"M14 3.75v4h4M8.75 11h6.5M8.75 14.25h6.5M8.75 17.5h4"})]})}function $Y(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.75",y:"4.5",width:"16.5",height:"15",rx:"2.5"}),o.jsx("path",{d:"m7.5 9 2.75 2.5L7.5 14M12.5 14h4"}),o.jsx("path",{d:"M3.75 7.5h16.5",opacity:".62"})]})}function gU(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 rwt({definition:e,label:t,done:n,open:i,onToggle:r}){const{t:s}=Ae("conversation"),a=e.icon,l=n?e.doneLabel:e.runningLabel,c=t??s(`blocks.tools.${e.name}.${n?"done":"running"}`,{defaultValue:l});return o.jsxs("button",{type:"button",className:`builtin-tool-head${n?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:r,"aria-expanded":i,children:[o.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:o.jsx(a,{})}),n?o.jsx("span",{className:"builtin-tool-label",children:c}):o.jsx(An,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:c}),o.jsx(gU,{className:`builtin-tool-chevron${i?" is-open":""}`})]})}function cc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Sn(e){return typeof e=="string"?e:""}function FY(e){return typeof e=="number"&&Number.isFinite(e)?e:0}function Vc(e){return Array.isArray(e)?e:[]}function e$(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=cc(t)??{};return cc(n.result)??n}function lI(e){if(typeof e=="string")try{return lI(JSON.parse(e))}catch{return e}const t=cc(e);if(!t)return"";const n=cc(t.result);return Sn(t.error)||Sn(t.message)||Sn(n==null?void 0:n.error)||Sn(n==null?void 0:n.message)}function swt(e){if(e.kind==="tool")return"tool";if(e.kind==="knowledge_base")return"knowledge_base";const t=cc(e.metadata),n=Sn(t==null?void 0:t.source_type).toLowerCase(),i=Sn(e.source).toLowerCase();return n==="skillhub"||i.startsWith("skill_hub:")?"skill_hub":"skill_space"}const KEe={tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknownSource:"Unknown source",unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"};function awt(e,t){return e==="veadk_builtin_tools"?t.tool:e==="agentkit_knowledge"?t.knowledge:e.startsWith("skill_hub:")?`Skill Hub ${e.slice(10)}`:e.startsWith("skill_space:")?`${t.skillCenter} ${e.slice(12)}`:e||t.unknownSource}function owt(e){return e==="veadk_builtin_tools"?"tool":e==="agentkit_knowledge"?"knowledge_base":e.startsWith("skill_hub:")?"skill_hub":"skill_space"}function lwt(e,t=KEe){const n=e$(e),i=cc(n.capabilities)??{},r=Vc(n.resources).flatMap(a=>{const l=cc(a);if(!l)return[];const c=l.kind==="tool"?"tool":l.kind==="knowledge_base"?"knowledge_base":"skill";return[{ref:Sn(l.ref),kind:c,category:swt(l),name:Sn(l.name)||Sn(l.ref)||t.unnamedResource,description:Sn(l.description),source:Sn(l.source),version:Sn(l.version)}]}),s=Vc(n.sources).flatMap(a=>{const l=cc(a);if(!l)return[];const c=Sn(l.source),u=Sn(l.status),d=u==="error"?"error":u==="skipped"?"skipped":"ok";return[{source:c,category:owt(c),label:awt(c,t),status:d,count:FY(l.count),message:Sn(l.message),searchKeywords:Vc(l.search_keywords).map(Sn).filter(Boolean)}]});return{collectionId:Sn(n.collection_id),capabilities:{googleAdkVersion:Sn(i.google_adk_version),agentTypes:Vc(i.agent_types).map(Sn).filter(Boolean),maxOrchestrationDepth:FY(i.max_orchestration_depth)},resources:r,sources:s,counts:{all:r.length,skill_hub:r.filter(a=>a.category==="skill_hub").length,skill_space:r.filter(a=>a.category==="skill_space").length,knowledge_base:r.filter(a=>a.category==="knowledge_base").length,tool:r.filter(a=>a.category==="tool").length}}}function cwt(e,t){return{resources:e.resources.filter(n=>n.category===t),sources:e.sources.filter(n=>n.category===t)}}function XEe(e,t,n=KEe){const i=e$(e),r=e$(t),s=new Map(Vc(r.results).flatMap(d=>{const f=cc(d),h=Sn(f==null?void 0:f.name);return f&&h?[[h,f]]:[]})),a=Vc(i.agents).flatMap(d=>{const f=cc(d),h=Sn(f==null?void 0:f.name);return f&&h?[f]:[]}),l=new Set(a.map(d=>Sn(d.name))),c=[...s.entries()].filter(([d])=>!l.has(d)).map(([d])=>({name:d})),u=[...a,...c].map(d=>{const f=Sn(d.name),h=Vc(d.nodes).flatMap(E=>{const C=cc(E);return C?[C]:[]}),p=Sn(d.root_node),g=h.find(E=>Sn(E.id)===p),b=h.filter(E=>Sn(E.id)!==p).map(E=>({id:Sn(E.id)||n.unnamedAgent,type:Sn(E.type)||"llm",description:Sn(E.description)})),v=s.get(f),y=Sn(v==null?void 0:v.status),x=y==="failed"?"failed":y==="completed"?"completed":"running",O=BY(v==null?void 0:v.resources),w=O.length>0?O:BY(h.flatMap(E=>Vc(E.resources))),k=UY(v==null?void 0:v.python_tools),S=k.length>0?k:UY(h.flatMap(E=>Vc(E.python_tools)));return{name:f,description:Sn(v==null?void 0:v.description)||Sn(g==null?void 0:g.description)||Sn(d.task),task:Sn(d.task),rootType:Sn(v==null?void 0:v.root_type)||Sn(g==null?void 0:g.type)||"llm",nodeCount:h.length,subAgentCount:b.length,resourceCount:w.length,pythonToolCount:S.length,skills:w.filter(E=>E.kind==="skill"),knowledgeBases:w.filter(E=>E.kind==="knowledge_base"),builtinTools:w.filter(E=>E.kind==="tool"),pythonTools:S,subAgents:b,status:x,output:Sn(v==null?void 0:v.output),error:Sn(v==null?void 0:v.error)}});return{collectionId:Sn(r.collection_id)||Sn(i.collection_id),agents:u,completedCount:u.filter(d=>d.status==="completed").length,failedCount:u.filter(d=>d.status==="failed").length,runningCount:u.filter(d=>d.status==="running").length}}function uwt(e,t){return!!lI(t)||XEe(e,t).failedCount>0}function BY(e){const t=new Set;return Vc(e).flatMap(n=>{const i=cc(n),r=Sn(i?i.ref:n);if(!r||t.has(r))return[];t.add(r);const s=Sn(i==null?void 0:i.kind),a=s==="tool"||r.startsWith("veadk_tool:")?"tool":s==="knowledge_base"||r.startsWith("agentkit_kb:")?"knowledge_base":"skill",l=r.split(":");return[{ref:r,kind:a,name:Sn(i==null?void 0:i.name)||l[l.length-1]||r,description:Sn(i==null?void 0:i.description),version:Sn(i==null?void 0:i.version),source:Sn(i==null?void 0:i.source)}]})}function UY(e){const t=new Set;return Vc(e).flatMap(n=>{const i=cc(n),r=Sn(i==null?void 0:i.name),s=Sn(i==null?void 0:i.code),a=`${r}\0${s}`;return!i||!r||t.has(a)?[]:(t.add(a),[{name:r,description:Sn(i.description),code:s,entrypoint:Sn(i.entrypoint)||r,dependencies:Vc(i.dependencies).map(Sn).filter(Boolean)}])})}function dwt({branch:e}){return o.jsxs("div",{className:`branch-compare__body${e.status==="running"?" is-streaming":""}`,"aria-live":"polite",children:[e.content?o.jsx(Bu,{text:e.content,streaming:e.status==="running"}):null,e.status==="running"?o.jsx("span",{className:"branch-compare__caret","aria-hidden":"true"}):null,e.error?o.jsx("p",{className:"branch-compare__error",children:e.error}):null]})}function fwt({args:e,response:t,status:n,onBranchSelect:i}){const{t:r}=Ae("conversation"),s=m.useMemo(()=>pye(e,t,n),[e,t,n]),[a,l]=m.useState(0);return o.jsxs("section",{className:"branch-compare","aria-label":r("blocks.branchCompare.ariaLabel"),children:[o.jsx("div",{className:"branch-compare__tabs",role:"tablist","aria-label":r("blocks.branchCompare.selectDirection"),children:s.branches.map((c,u)=>o.jsx("button",{className:`branch-compare__tab${a===u?" is-active":""}`,type:"button",role:"tab","aria-selected":a===u,"aria-controls":`branch-compare-panel-${u}`,onClick:()=>l(u),children:o.jsx(ba,{color:"info",size:"sm",variant:"soft",children:c.label})},`${c.label}:${u}`))}),o.jsx("div",{className:"branch-compare__branches",children:s.branches.map((c,u)=>o.jsxs("article",{className:`branch-compare__branch${a===u?" is-active":""}`,id:`branch-compare-panel-${u}`,role:"tabpanel",children:[o.jsx("header",{className:"branch-compare__head",children:o.jsx(ba,{color:"info",size:"sm",variant:"soft",children:c.label})}),o.jsx(dwt,{branch:c}),o.jsx("footer",{className:"branch-compare__footer",children:o.jsx(zt,{type:"button",color:"info",variant:"ghost",size:"sm",pill:!1,disabled:c.status!=="completed",onClick:()=>i==null?void 0:i(c),children:r("blocks.branchCompare.continue")})})]},`${c.label}:${u}`))})]})}function YEe({controlled:e,default:t,name:n,state:i="value"}){const{current:r}=m.useRef(e!==void 0),[s,a]=m.useState(t),l=r?e:s,c=m.useCallback(u=>{r||a(u)},[]);return[l,c]}const bU={...Fb},QY={};function Ab(e,t){const n=m.useRef(QY);return n.current===QY&&(n.current=e(t)),n}const HM=bU.useInsertionEffect,hwt=HM&&HM!==bU.useLayoutEffect?HM:e=>e();function Xa(e){const t=Ab(pwt).current;return t.next=e,hwt(t.effect),t.trampoline}function pwt(){const e={next:void 0,callback:mwt,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function mwt(){}const gwt=()=>{},bl=typeof document<"u"?m.useLayoutEffect:gwt,ZEe=m.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function bwt(){return m.useContext(ZEe)}function ywt(e){const{children:t,elementsRef:n,labelsRef:i,onMapChange:r}=e,s=Xa(r),[,a]=m.useState(!1),l=Ab(xwt).current,c=Ab(vwt).current,u=m.useRef(0),d=m.useRef(!0),f=m.useRef([]),h=m.useRef(null),p=Xa(()=>{d.current||(d.current=!0,a(k=>!k))}),g=Xa((k,S)=>{c.set(k,S),p()}),b=Xa(k=>{c.delete(k),p()}),v=Xa(k=>{const S=new Map;return n.current.length=0,i&&(i.current.length=0),k.forEach(E=>{var C,N;S.set(E.element,{...E.registration.metadata??{},index:E.index}),n.current[E.index]=E.element,i&&(i.current[E.index]=E.registration.label!==void 0?E.registration.label:((N=(C=E.registration.textRef)==null?void 0:C.current)==null?void 0:N.textContent)??E.element.textContent)}),u.current=n.current.length,S});function y(k){var C;if((C=h.current)==null||C.disconnect(),h.current=null,typeof MutationObserver!="function"||k.length<2)return;const S=new MutationObserver(N=>{if(!Swt(N))return;let _=null;for(const j of k)if(j.isConnected){if(_&&JEe(_,j)>0){S.disconnect(),p();return}_=j}});h.current=S;const E=new Set;for(let N=1;NS.observe(N,{childList:!0}))}const x=Xa(()=>{const[k,S]=wwt(c),E=v(k);y(S),f.current=k,d.current=!1,l.forEach(C=>C(E)),s(E)});bl(()=>(d.current||v(f.current),()=>{n.current=[],i&&(i.current=[])}),[n,i,v]),bl(()=>{d.current&&x()}),bl(()=>()=>{var k;(k=h.current)==null||k.disconnect(),d.current=!0},[]);const O=Xa(k=>(l.add(k),()=>{l.delete(k)})),w=m.useMemo(()=>({register:g,unregister:b,subscribeMapChange:O,nextIndexRef:u}),[g,b,O,u]);return o.jsx(ZEe.Provider,{value:w,children:t})}function vwt(){return new Map}function xwt(){return new Set}function wwt(e){const t=new Set,n=[],i=[];e.forEach((s,a)=>{if(!a.isConnected)return;const l=s.index,c={index:l??-1,element:a,registration:s};l===null?i.push(c):l>=0&&(t.add(l),n.push(c))});let r=0;return i.sort((s,a)=>JEe(s.element,a.element)),i.forEach(s=>{for(;t.has(r);)r+=1;s.index=r,n.push(s),r+=1}),t.size>0&&n.sort((s,a)=>s.index-a.index),[n,i.map(s=>s.element)]}function Owt(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function Swt(e){for(const t of e)for(let n=0;ns.searchParams.append("args[]",a)),`${t} error #${i}; visit ${s} for the full message.`}}const EE=kwt("https://base-ui.com/production-error","Base UI"),eCe=m.createContext(void 0);function tCe(){const e=m.useContext(eCe);if(e===void 0)throw new Error(EE(10));return e}function ON(e,t,n,i){const r=Ab(nCe).current;return Cwt(r,e,t,n,i)&&iCe(r,[e,t,n,i]),r.callback}function Ewt(e){const t=Ab(nCe).current;return Twt(t,e)&&iCe(t,e),t.callback}function nCe(){return{callback:null,cleanup:null,refs:[]}}function Cwt(e,t,n,i,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==i||e.refs[3]!==r}function Twt(e,t){return e.refs.length!==t.length||e.refs.some((n,i)=>n!==t[i])}function iCe(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const i=Array(t.length).fill(null);for(let r=0;r{for(let r=0;r=e}function zY(e){if(!m.isValidElement(e))return null;const t=e,n=t.props;return(_wt(19)?n==null?void 0:n.ref:t.ref)??null}function t$(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const Nwt=Object.freeze([]),Ry=Object.freeze({});function jwt(e,t){const n={};for(const i in e){const r=e[i];if(t!=null&&t.hasOwnProperty(i)){const s=t[i](r);s!=null&&Object.assign(n,s);continue}r===!0?n[`data-${i.toLowerCase()}`]="":r&&(n[`data-${i.toLowerCase()}`]=r.toString())}return n}function Rwt(e,t){return typeof e=="function"?e(t):e}function rCe(e,t){return typeof e=="function"?e(t):e}const yU={};function vU(e,t,n,i,r){if(!n&&!i&&!e)return SN(t);let s=SN(e);return t&&(s=OA(s,t)),n&&(s=OA(s,n)),i&&(s=OA(s,i)),s}function Iwt(e){if(e.length===0)return yU;if(e.length===1)return SN(e[0]);let t=SN(e[0]);for(let n=1;n=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function xU(e){return typeof e=="function"}function aCe(e,t){return xU(e)?e(t):e??yU}function Mwt(e,t){return t?e?(...n)=>{const i=n[0];if(cCe(i)){const s=i;kN(s);const a=t(...n);return s.baseUIHandlerPrevented||e==null||e(...n),a}const r=t(...n);return e==null||e(...n),r}:oCe(t):e}function oCe(e){return e&&((...t)=>{const n=t[0];return cCe(n)&&kN(n),e(...t)})}function kN(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function lCe(e,t){return t?e?t+" "+e:t:e}function cCe(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function CE(e,t,n={}){const i=t.render,r=Lwt(t,n);if(n.enabled===!1)return null;const s=n.state??Ry;return Bwt(e,i,r,s)}function Lwt(e,t={}){const{className:n,style:i,render:r}=e,{state:s=Ry,ref:a,props:l,stateAttributesMapping:c,enabled:u=!0}=t,d=u?Rwt(n,s):void 0,f=u?rCe(i,s):void 0,h=u?jwt(s,c):Ry,p=u&&l?$wt(l):void 0,g=u?t$(h,p)??{}:Ry;return typeof document<"u"&&(u?Array.isArray(a)?g.ref=Ewt([g.ref,zY(r),...a]):g.ref=ON(g.ref,zY(r),a):ON(null,null)),u?(d!==void 0&&(g.className=lCe(g.className,d)),f!==void 0&&(g.style=t$(g.style,f)),g):Ry}function $wt(e){return Array.isArray(e)?Iwt(e):vU(void 0,e)}const Fwt=Symbol.for("react.lazy");function Bwt(e,t,n,i){if(t){if(typeof t=="function")return t(n,i);const r=vU(n,t.props);r.ref=n.ref;let s=t;return(s==null?void 0:s.$$typeof)===Fwt&&(s=m.Children.toArray(t)[0]),m.cloneElement(s,r)}if(e&&typeof e=="string")return Uwt(e,n);throw new Error(EE(8))}function Uwt(e,t){return e==="button"?m.createElement("button",{type:"button",...t,key:t.key}):e==="img"?m.createElement("img",{alt:"",...t,key:t.key}):m.createElement(e,t)}const Qwt={value:()=>null},uCe=m.forwardRef(function(t,n){const{render:i,className:r,disabled:s=!1,hiddenUntilFound:a,keepMounted:l,loopFocus:c,onValueChange:u,multiple:d=!1,orientation:f="vertical",value:h,defaultValue:p,style:g,...b}=t,v=m.useMemo(()=>{if(h===void 0)return p??[]},[h,p]),y=m.useRef([]),[x,O]=YEe({controlled:h,default:v,name:"Accordion",state:"value"}),w=Xa((C,N,_)=>{if(d)if(N){const j=x.slice();if(j.push(C),u==null||u(j,_),_.isCanceled)return;O(j)}else{const j=x.filter(A=>A!==C);if(u==null||u(j,_),_.isCanceled)return;O(j)}else{const j=x[0]===C?[]:[C];if(u==null||u(j,_),_.isCanceled)return;O(j)}}),k=m.useMemo(()=>({value:x,disabled:s,orientation:f}),[x,s,f]),S=m.useMemo(()=>({disabled:s,handleValueChange:w,hiddenUntilFound:a??!1,keepMounted:l??!1,state:k,value:x}),[s,w,a,l,k,x]),E=CE("div",t,{state:k,ref:n,props:b,stateAttributesMapping:Qwt});return o.jsx(eCe.Provider,{value:S,children:o.jsx(ywt,{elementsRef:y,children:E})})});let VY=0;function zwt(e,t="mui"){const[n,i]=m.useState(e),r=e||n;return m.useEffect(()=>{n==null&&(VY+=1,i(`${t}-${VY}`))},[n,t]),r}const HY=bU.useId;function Vwt(e,t){if(HY!==void 0){const n=HY();return`${t}-${n}`}return zwt(e,t)}function n$(e){return Vwt(e,"base-ui")}const Hwt="none",qwt="trigger-press";function dCe(e,t,n,i){let r=!1,s=!1;const a=Ry;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...a}}function Wwt(e){m.useEffect(e,Nwt)}const MT=null;let Gwt=class{constructor(){ki(this,"callbacks",[]);ki(this,"callbacksCount",0);ki(this,"nextId",1);ki(this,"startId",1);ki(this,"isScheduled",!1);ki(this,"tick",t=>{var r;this.isScheduled=!1;const n=this.callbacks,i=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,i>0)for(let s=0;s=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}},LT=new Gwt;class Kl{constructor(){ki(this,"currentId",MT);ki(this,"cancel",()=>{this.currentId!==MT&&(LT.cancel(this.currentId),this.currentId=MT)});ki(this,"disposeEffect",()=>this.cancel)}static create(){return new Kl}static request(t){return LT.request(t)}static cancel(t){return LT.cancel(t)}request(t){this.cancel(),this.currentId=LT.request(()=>{this.currentId=MT,t()})}}function Kwt(){const e=Ab(Kl.create).current;return Wwt(e.disposeEffect),e}function Xwt(e,t=!1,n=!1){const[i,r]=m.useState(e&&t?"idle":void 0),[s,a]=m.useState(e);return e&&!s&&(a(!0),r("starting")),!e&&s&&i!=="ending"&&!n&&r("ending"),!e&&!s&&i==="ending"&&r(void 0),bl(()=>{if(!e&&s&&i!=="ending"&&n){const l=Kl.request(()=>{r("ending")});return()=>{Kl.cancel(l)}}},[e,s,i,n]),bl(()=>{if(!e||t)return;const l=Kl.request(()=>{r(void 0)});return()=>{Kl.cancel(l)}},[t,e]),bl(()=>{if(!e||!t)return;e&&s&&i!=="idle"&&r("starting");const l=Kl.request(()=>{r("idle")});return()=>{Kl.cancel(l)}},[t,e,s,i]),{mounted:s,setMounted:a,transitionStatus:i}}function Ywt(e){const{open:t,defaultOpen:n,onOpenChange:i,disabled:r}=e,[s,a]=YEe({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:l,setMounted:c,transitionStatus:u}=Xwt(s,!0,!0),d=n$(),[f,h]=m.useState(),p=f===null?void 0:f??d,g=Xa(b=>{const v=!s,y=dCe(qwt,b.nativeEvent);i(v,y),!y.isCanceled&&a(v)});return m.useMemo(()=>({defaultPanelId:d,disabled:r,handleTrigger:g,mounted:l,open:s,panelId:p,setMounted:c,setOpen:a,setPanelIdState:h,transitionStatus:u}),[d,r,g,l,s,p,c,a,h,u])}const fCe=m.createContext(void 0);function hCe(){const e=m.useContext(fCe);if(e===void 0)throw new Error(EE(15));return e}function Zwt(e={}){const{guess:t,label:n,metadata:i,textRef:r,index:s}=e,{register:a,unregister:l,subscribeMapChange:c,nextIndexRef:u}=bwt(),d=m.useRef(-1),[f,h]=m.useState(s==null&&t?()=>{if(d.current===-1){const v=u.current;u.current+=1,d.current=v}return d.current}:-1),p=s??f,g=m.useRef(null),b=m.useCallback(v=>{const y=g.current;y&&l(y),g.current=v,v&&a(v,{metadata:i??null,index:s??null,label:n,textRef:r})},[s,a,l,i,n,r]);return bl(()=>{if(s==null)return c(v=>{var x;const y=g.current?(x=v.get(g.current))==null?void 0:x.index:null;y!=null&&h(y)})},[s,c]),{ref:b,index:p}}const pCe=m.createContext(void 0);function wU(){const e=m.useContext(pCe);if(e===void 0)throw new Error(EE(9));return e}let qY=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const Jwt={"data-starting-style":""},eOt={"data-ending-style":""},tOt={transitionStatus(e){return e==="starting"?Jwt:e==="ending"?eOt:null}};let OU=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=qY.startingStyle]="startingStyle",e[e.endingStyle=qY.endingStyle]="endingStyle",e}({}),nOt=function(e){return e.panelOpen="data-panel-open",e}({});const iOt={[OU.open]:""},rOt={[OU.closed]:""},sOt={open(e){return e?{[nOt.panelOpen]:""}:null}},aOt={open(e){return e?iOt:rOt}};let oOt=function(e){return e.index="data-index",e.disabled="data-disabled",e.open="data-open",e}({});const SU={...aOt,index:e=>({[oOt.index]:String(e)}),...tOt,value:()=>null},mCe=m.forwardRef(function(t,n){const{className:i,disabled:r=!1,onOpenChange:s,render:a,value:l,style:c,...u}=t,{ref:d,index:f}=Zwt(),h=ON(n,d),{disabled:p,handleValueChange:g,state:b,value:v}=tCe(),y=n$(),x=l??y,O=r||p,w=v.indexOf(x)!==-1,k=Xa((R,L)=>{s==null||s(R,L),!L.isCanceled&&g(x,R,L)}),S=Ywt({open:w,onOpenChange:k,disabled:O}),E=m.useMemo(()=>({open:S.open,disabled:S.disabled,transitionStatus:S.transitionStatus}),[S.open,S.disabled,S.transitionStatus]),C=m.useMemo(()=>({...S,onOpenChange:k,state:E}),[S,E,k]),N=m.useMemo(()=>({...b,hidden:!w&&!S.mounted,index:f,disabled:O,open:w}),[S.mounted,O,f,w,b]),_=n$(),[j,A]=m.useState(),F=j===null?void 0:j??_,T=m.useMemo(()=>({defaultTriggerId:_,open:w,state:N,setTriggerId:A,triggerId:F}),[_,w,N,A,F]),P=CE("div",t,{state:N,ref:h,props:u,stateAttributesMapping:SU});return o.jsx(fCe.Provider,{value:C,children:o.jsx(pCe.Provider,{value:T,children:P})})}),gCe=m.forwardRef(function(t,n){const{render:i,className:r,style:s,...a}=t,{state:l}=wU();return CE("h3",t,{state:l,ref:n,props:a,stateAttributesMapping:SU})}),lOt=m.createContext(void 0);function cOt(e=!1){const t=m.useContext(lOt);if(t===void 0&&!e)throw new Error(EE(16));return t}function uOt(e){const{focusableWhenDisabled:t,disabled:n,composite:i=!1,tabIndex:r=0,isNativeButton:s}=e,a=i&&t!==!1,l=i&&t===!1;return{props:m.useMemo(()=>{const u={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return i||(u.tabIndex=r,!s&&n&&(u.tabIndex=t?r:-1)),(s&&(t||a)||!s&&n)&&(u["aria-disabled"]=n),s&&(!t||l)&&(u.disabled=n),u},[i,n,t,a,l,s,r])}}function qM(e,t,{detail:n=0}={}){e.dispatchEvent(new(bo(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function dOt(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:i=0,native:r=!0,composite:s}=e,a=m.useRef(null),l=cOt(!0),c=s??l!==void 0,{props:u}=uOt({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:i,isNativeButton:r}),d=m.useCallback(()=>{const p=a.current;WM(p)&&c&&t&&u.disabled===void 0&&p.disabled&&(p.disabled=!1)},[t,u.disabled,c]);bl(d,[d]);const f=m.useCallback((p={})=>{const{onClick:g,onMouseDown:b,onKeyUp:v,onKeyDown:y,onPointerDown:x,...O}=p;return vU({onClick(w){if(t){w.preventDefault();return}g==null||g(w)},onMouseDown(w){t||b==null||b(w)},onKeyDown(w){if(t||(kN(w),y==null||y(w),w.baseUIHandlerPrevented))return;const k=w.target===w.currentTarget,S=w.currentTarget,E=WM(S),C=!r&&fOt(S),N=k&&(r?E:!C),_=w.key==="Enter",j=w.key===" ",A=S.getAttribute("role"),F=(A==null?void 0:A.startsWith("menuitem"))||A==="option"||A==="gridcell";if(k&&c&&j){if(w.defaultPrevented&&F)return;w.preventDefault(),(!r||E)&&(w.preventBaseUIHandler(),qM(S,w));return}if(!N||r||!j&&!_){k&&C&&j&&w.preventDefault();return}w.defaultPrevented||(w.preventDefault(),_&&(w.preventBaseUIHandler(),qM(S,w)))},onKeyUp(w){if(!t){if(kN(w),v==null||v(w),w.target===w.currentTarget&&r&&c&&WM(w.currentTarget)&&w.key===" "){w.preventDefault();return}w.baseUIHandlerPrevented||w.target===w.currentTarget&&!r&&!c&&!w.defaultPrevented&&w.key===" "&&(w.preventBaseUIHandler(),qM(w.currentTarget,w))}},onPointerDown(w){if(t){w.preventDefault();return}x==null||x(w)}},r?{type:"button"}:{role:"button"},u,O)},[t,u,c,r]),h=Xa(p=>{a.current=p,d()});return{getButtonProps:f,buttonRef:h}}function WM(e){return Kd(e)&&e.tagName==="BUTTON"}function fOt(e){return Kd(e)&&e.tagName==="A"&&!!e.href}const bCe=m.forwardRef(function(t,n){const{disabled:i,className:r,id:s,render:a,nativeButton:l=!0,style:c,...u}=t,{panelId:d,open:f,handleTrigger:h,disabled:p}=hCe(),g=i||p,{getButtonProps:b,buttonRef:v}=dOt({disabled:g,focusableWhenDisabled:!0,native:l}),{defaultTriggerId:y,state:x,setTriggerId:O}=wU(),w=s||void 0,k=w??y;return bl(()=>(O(C=>w??(C===null?void 0:C)),()=>{O(C=>C===w?null:C)}),[w,O]),CE("button",t,{state:x,ref:[n,v],props:[{"aria-controls":f?d:void 0,"aria-expanded":f,id:k,onClick:h},u,b],stateAttributesMapping:sOt})});function hOt(e,t,n,i){return e.addEventListener(t,n,i),()=>{e.removeEventListener(t,n,i)}}function pOt(e){const t=Ab(mOt,e).current;return t.next=e,bl(t.effect),t}function mOt(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function gOt(e){return e==null?e:"current"in e?e.current:e}function yCe(e,t=!1){const n=Kwt();return Xa((i,r=null)=>{n.cancel();const s=gOt(e);if(s==null)return;const a=s,l=()=>{Li.flushSync(i)};if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function c(){Promise.all(a.getAnimations().map(u=>u.finished)).then(()=>{r!=null&&r.aborted||l()},()=>{if(r!=null&&r.aborted)return;if(a.getAnimations().some(d=>d.pending||d.playState!=="finished")){c();return}l()})}if(t){const u="data-starting-style";if(!a.hasAttribute(u)){n.request(c);return}const d=new MutationObserver(()=>{a.hasAttribute(u)||(d.disconnect(),c())});d.observe(a,{attributes:!0,attributeFilter:[u]}),r==null||r.addEventListener("abort",()=>d.disconnect(),{once:!0});return}n.request(c)})}function bOt(e){const{enabled:t=!0,open:n,ref:i,onComplete:r}=e,s=Xa(r),a=yCe(i,n);m.useEffect(()=>{if(!t)return;const l=new AbortController;return a(s,l.signal),()=>{l.abort()}},[t,n,s,a])}const K1={height:void 0,width:void 0};function yOt(e){const{externalRef:t,hiddenUntilFound:n,id:i,keepMounted:r,mounted:s,onOpenChange:a,open:l,setMounted:c,setOpen:u,transitionStatus:d}=e,f=m.useRef(null),h=m.useRef(null),[p,g]=m.useState(K1),b=m.useRef(K1),v=m.useRef(!1),y=m.useRef(l),x=m.useRef(!1),[O,w]=m.useState(!1),k=m.useRef(null),S=ON(t,f),E=pOt(l),C=yCe(f),N=!l&&!s,_=O?"idle":d,j=l&&(y.current||x.current),A=!l&&s&&h.current==="css-animation"&&p.height===void 0&&p.width===void 0?b.current:p,F=n&&N&&h.current!=="css-animation",T=Xa((U,I=!0)=>{I&&(b.current=U),g(U)}),P=Xa(()=>{var U;(U=k.current)==null||U.call(k),k.current=null}),R=Xa(U=>{P(),k.current=()=>{k.current=null,U()}}),L=Xa(()=>{l&&s&&h.current==="css-animation"&&(x.current=!0)});bl(()=>{!O||d==="starting"||w(!1)},[O,d]),m.useEffect(()=>()=>{L(),P()},[L,P]),bl(()=>{const U=f.current;if(!U)return;!l&&k.current&&P();const I=vOt(U,j);if(h.current=I,l&&d==="idle"&&y.current&&I==="css-animation"){b.current=F0(U);return}if(l&&d==="starting"){const Q=v.current;if(v.current=!1,I==="none"){T(F0(U)),w(!0);return}if(I==="css-transition"){const ee=xOt(U);if(T(F0(U)),!Q)return ee;const le=$T(U,"transition-duration","0s");return R(le),w(!0),ee}T(F0(U));const q=$T(U,"animation-name","none");if(!Q){q();return}const B=$T(U,"animation-duration","0s");q(),R(B),w(!0);return}if(!l&&s&&(d==="idle"||d==="starting")){if(y.current=!1,x.current=!1,I==="none"){T(K1,!1),c(!1);return}T(F0(U));return}if(d!=="ending")return;if(I==="none"){c(!1);return}const H=F0(U);if(!(H.height>0||H.width>0)){c(!1);return}T(H),I==="css-animation"&&$T(U,"animation-name","none")()},[s,l,P,T,c,R,j,d]),bOt({enabled:l&&s&&_==="idle",open:!0,ref:f,onComplete(){l&&T(K1,!1)}}),m.useEffect(()=>{if(l||!s||_!=="ending"||!f.current)return;const I=new AbortController;let H=-1;function K(){E.current||(c(!1),T(K1,!1))}return H=Kl.request(()=>{C(K,I.signal)}),()=>{Kl.cancel(H),I.abort()}},[E,s,l,_,C,T,c]),bl(()=>{const U=f.current;!U||!n||!N||U.setAttribute("hidden","until-found")},[N,n]),m.useEffect(function(){const I=f.current;if(!I)return;function H(K){const Q=dCe(Hwt,K);a(!0,Q),!Q.isCanceled&&(v.current=!0,u(!0))}return hOt(I,"beforematch",H)},[a,u]);const M=r||n||s||l;return{height:A.height,props:{...F?{[OU.startingStyle]:""}:void 0,hidden:N,id:i},ref:S,shouldPreventOpenAnimation:j,shouldRender:M,transitionStatus:_,width:A.width}}function F0(e){return{height:e.scrollHeight,width:e.scrollWidth}}function vOt(e,t){const n=bo(e).getComputedStyle(e),i=(n.animationName.split(",").map(s=>s.trim()).some(s=>s!==""&&s!=="none")||t)&&WY(n.animationDuration),r=WY(n.transitionDuration);return i&&r||r?"css-transition":i?"css-animation":"none"}function WY(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function $T(e,t,n){const i=e.style.getPropertyValue(t),r=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(i===""){e.style.removeProperty(t);return}e.style.setProperty(t,i,r)}}function xOt(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(r=>{e.style.setProperty(r,"initial","important")});function n(){Object.entries(t).forEach(([r,s])=>{if(s===""){e.style.removeProperty(r);return}e.style.setProperty(r,s)})}const i=Kl.request(n);return()=>{Kl.cancel(i),n()}}let GY=function(e){return e.accordionPanelHeight="--accordion-panel-height",e.accordionPanelWidth="--accordion-panel-width",e}({});const vCe=m.forwardRef(function(t,n){const{className:i,hiddenUntilFound:r,keepMounted:s,id:a,render:l,style:c,...u}=t,{hiddenUntilFound:d,keepMounted:f}=tCe(),{defaultPanelId:h,mounted:p,onOpenChange:g,open:b,setMounted:v,setOpen:y,setPanelIdState:x,transitionStatus:O}=hCe(),w=r??d,k=s??f,S=a||void 0,E=a??h;bl(()=>(x(I=>S??(I===null?void 0:I)),()=>{x(I=>I===S?null:I)}),[S,x]);const{height:C,props:N,ref:_,shouldPreventOpenAnimation:j,shouldRender:A,transitionStatus:F,width:T}=yOt({externalRef:n,hiddenUntilFound:w,id:E,keepMounted:k,mounted:p,onOpenChange:g,open:b,setMounted:v,setOpen:y,transitionStatus:O}),{state:P,triggerId:R}=wU(),L={...P,transitionStatus:F},M=rCe(c,L),U=CE("div",{...t,style:void 0},{state:L,ref:_,props:[N,{"aria-labelledby":R,role:"region",style:{[GY.accordionPanelHeight]:C===void 0?"auto":`${C}px`,[GY.accordionPanelWidth]:T===void 0?"auto":`${T}px`}},u,M?{style:M}:void 0,j?{style:{animationName:"none"}}:void 0],stateAttributesMapping:SU});return A?U:null}),wOt=(e,t)=>{const n=e.currentTarget,i={x:e.clientX,y:e.clientY},r=OOt(i,n.getBoundingClientRect()),s=SOt(i,r),a=kOt(t.getBoundingClientRect());return COt([...s,...a])};function OOt(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,i,r,s)){case s:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function SOt(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}function kOt(e){const{top:t,right:n,bottom:i,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:i},{x:r,y:i}]}function EOt(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,a=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}function COt(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),TOt(t)}function TOt(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const AOt="_Transition_1wdpp_1",_Ot="_Popover_1wdpp_3",xCe={Transition:AOt,Popover:_Ot},wCe=m.createContext(null),cI=()=>{const e=m.use(wCe);if(!e)throw new Error("Popover components must be wrapped in ");return e},im=({open:e,onOpenChange:t,showOnHover:n=!1,hoverOpenDelay:i=150,children:r})=>{const[s,a]=m.useState(!1),[l,c]=m.useState(!1),u=m.useRef(null),d=m.useRef(null),f=m.useRef(void 0),h=m.useRef(!1),p=m.useRef(!1),g=e??s,[b,v]=m.useState(!1);a7(()=>v(!1),b?500:null);const y=xm(t),x=xm(E=>{var C,N;clearTimeout(f.current),g!==E&&(E||(c(!1),n&&h.current&&((C=u.current)==null||C.focus()),h.current=!1),(N=y.current)==null||N.call(y,E),a(E),n&&v(E))}),O=m.useCallback(E=>{x.current(E)},[x]),w=m.useCallback(()=>{f.current=setTimeout(()=>O(!0),i)},[O,i]),k=m.useCallback(()=>{clearTimeout(f.current)},[]);m.useEffect(()=>()=>{clearTimeout(f.current)},[]);const S=m.useMemo(()=>({open:g,setOpen:O,shake:l,setShake:c,showOnHover:n,temporarilyPreventClickToClose:b,onTriggerEnter:w,onTriggerLeave:k,isPointerInTransitRef:p,triggerRef:u,contentRef:d,hoverOpenFocusedWithTab:h}),[g,O,l,c,n,b,h,p,w,k]);return o.jsx(wCe,{value:S,children:o.jsx(fxe,{open:g,onOpenChange:O,modal:!1,children:r})})},NOt=({children:e,onPointerDown:t,onClick:n})=>{const{setOpen:i,showOnHover:r,temporarilyPreventClickToClose:s,onTriggerEnter:a,onTriggerLeave:l,isPointerInTransitRef:c,triggerRef:u,contentRef:d}=cI(),f=m.useRef(!1),h=b=>{!(b.currentTarget.nodeName.toLocaleLowerCase()==="a")&&s&&(b.preventDefault(),b.stopPropagation())},p=b=>{b.pointerType!=="touch"&&!f.current&&!c.current&&(a(),f.current=!0)},g=()=>{f.current&&(l(),f.current=!1)};return o.jsx(hxe,{asChild:!0,ref:u,onPointerDown:b=>{h(b),t==null||t(b)},onClick:b=>{h(b),n==null||n(b)},onPointerMove:r?p:void 0,onPointerLeave:r?g:void 0,onFocus:r?()=>i(!0):void 0,onBlur:r?()=>{setTimeout(()=>{var b;(b=d.current)!=null&&b.contains(document.activeElement)||i(!1)},50)}:void 0,children:e})},OCe=({children:e,avoidCollisions:t,width:n,minWidth:i,maxWidth:r,side:s,sideOffset:a=8,align:l,alignOffset:c,translucent:u,className:d,autoFocus:f=!0})=>{const{showOnHover:h,shake:p,contentRef:g}=cI(),b=v=>{const y=g.current;if(y&&v.target===y&&v.key==="Tab"&&v.shiftKey){v.preventDefault(),v.stopPropagation();const x=Tye(y),O=x[x.length-1];O==null||O.focus()}};return m.useEffect(()=>{const v=g.current;!v||!f||v!=null&&v.contains(document.activeElement)||h||v.focus({preventScroll:!0})},[g,h,f]),o.jsx(mxe,{forceMount:!0,ref:g,className:pi(xCe.Popover,d),style:Wb({"popover-width":n,"popover-min-width":i,"popover-max-width":r}),onCloseAutoFocus:h?ih:void 0,"data-animate":p?"shake":void 0,"data-translucent":u?"true":void 0,side:s,sideOffset:a,align:l,alignOffset:c??(l==="center"?0:-5),avoidCollisions:t??!0,hideWhenDetached:!0,collisionPadding:20,onOpenAutoFocus:ih,onEscapeKeyDown:ih,onKeyDown:b,children:e})},jOt=e=>{const{setOpen:t,triggerRef:n,contentRef:i,isPointerInTransitRef:r,hoverOpenFocusedWithTab:s}=cI(),[a,l]=m.useState(null),c=m.useCallback(()=>{l(null),r.current=!1},[r]),u=m.useCallback((d,f)=>{const h=wOt(d,f);l(h),r.current=!0},[r]);return m.useEffect(()=>()=>c(),[c]),m.useEffect(()=>{const d=n.current,f=i.current;if(!d||!f)return;const h=g=>u(g,f),p=g=>u(g,d);return d.addEventListener("pointerleave",h),f.addEventListener("pointerleave",p),()=>{d.removeEventListener("pointerleave",h),f.removeEventListener("pointerleave",p)}},[i,n,u,c]),m.useEffect(()=>{if(!a)return;const d=f=>{const h=n.current,p=i.current,g=f.target,b={x:f.clientX,y:f.clientY},v=(h==null?void 0:h.contains(g))||(p==null?void 0:p.contains(g)),y=!EOt(b,a),x=g.hasAttribute("aria-haspopup");v?c():(y||x)&&(c(),t(!1))};return document.addEventListener("pointermove",d),()=>document.removeEventListener("pointermove",d)},[a,t,c,n,i]),m.useEffect(()=>{const d=f=>{if(i.current&&f.key==="Tab"&&!f.shiftKey){const[h]=Tye(i.current);h&&(f.preventDefault(),h.focus(),s.current=!0,document.removeEventListener("keydown",d))}};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[i,s]),o.jsx(OCe,{...e})},ROt=e=>{const{open:t,showOnHover:n,setOpen:i}=cI();return Yk(t,()=>{i(!1)}),o.jsx(pxe,{forceMount:!0,children:o.jsx(Lx,{enterDuration:600,exitDuration:300,className:xCe.Transition,disableAnimations:!0,children:t&&(n?o.jsx(jOt,{...e},"popover-hover"):o.jsx(OCe,{...e},"popover"))})})};im.Trigger=NOt;im.Content=ROt;const IOt=["skill_hub","skill_space","knowledge_base","tool"];function SCe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m4 6 4 4 4-4"})})}function kCe({label:e}){return o.jsx("div",{className:"create-agent-card__loading",role:"status","aria-label":e,children:[0,1,2].map(t=>o.jsxs("div",{className:"create-agent-card__skeleton-row","aria-hidden":"true",children:[o.jsx("span",{}),o.jsx("span",{})]},t))})}function POt(e,t){return e.kind==="tool"?t("blocks.createAgents.builtinTool"):e.kind==="knowledge_base"?t("blocks.createAgents.knowledgeBase"):e.source.startsWith("skill_hub:")?"Skill Hub":e.source.startsWith("skill_space:")?t("blocks.createAgents.skillCenter"):"Skill"}function GM({label:e,resources:t}){const{t:n}=Ae("conversation");return t.length===0?null:o.jsxs("section",{className:"create-agent-card__popover-section",children:[o.jsx("h4",{children:e}),o.jsx("div",{className:"create-agent-card__popover-list",children:t.map(i=>o.jsxs("div",{className:"create-agent-card__popover-item",children:[o.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[o.jsx("strong",{children:i.name}),o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:POt(i,n)})]}),i.description?o.jsx("p",{children:i.description}):null]},i.ref))})]})}function DOt({tools:e}){const{t}=Ae("conversation");return e.length===0?null:o.jsxs("section",{className:"create-agent-card__popover-section",children:[o.jsx("h4",{children:t("blocks.createAgents.selfAuthoredTools")}),o.jsx(uCe,{children:e.map((n,i)=>o.jsxs(mCe,{className:"create-agent-card__python-tool",value:`${n.name}:${i}`,children:[o.jsx(gCe,{className:"create-agent-card__python-tool-header",children:o.jsxs(bCe,{className:"create-agent-card__python-tool-trigger",children:[o.jsxs("span",{children:[o.jsx("strong",{children:n.name}),n.description?o.jsx("small",{children:n.description}):null]}),o.jsxs("span",{className:"create-agent-card__python-tool-meta",children:[o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:t("blocks.createAgents.selfAuthoredTools")}),o.jsx(SCe,{className:"create-agent-card__python-tool-chevron"})]})]})}),o.jsxs(vCe,{className:"create-agent-card__python-tool-panel",children:[n.dependencies.length>0?o.jsx("div",{className:"create-agent-card__python-tool-dependencies",children:t("blocks.createAgents.dependencies",{items:n.dependencies.join(", ")})}):null,o.jsx("pre",{tabIndex:0,"aria-label":t("blocks.createAgents.fullCode",{name:n.name}),children:o.jsx("code",{children:n.code})})]})]},`${n.name}:${i}`))})]})}function MOt({agents:e}){const{t}=Ae("conversation");return e.length===0?null:o.jsxs("section",{className:"create-agent-card__popover-section",children:[o.jsx("h4",{children:t("blocks.createAgents.subAgents")}),o.jsx("div",{className:"create-agent-card__popover-list",children:e.map(n=>o.jsxs("div",{className:"create-agent-card__popover-item",children:[o.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[o.jsx("strong",{children:n.id}),o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:t(`blocks.createAgents.agentTypes.${n.type}`,{defaultValue:n.type})})]}),n.description?o.jsx("p",{children:n.description}):null]},n.id))})]})}function FT({label:e,count:t,icon:n,children:i}){const{t:r}=Ae("conversation"),s=o.jsxs("button",{className:"create-agent-card__resource-metric",type:"button",disabled:t===0,"aria-label":r("blocks.createAgents.itemCount",{label:e,count:t}),children:[n,o.jsx("span",{children:t})]});return t===0?s:o.jsxs(im,{showOnHover:!0,hoverOpenDelay:120,children:[o.jsx(im.Trigger,{children:s}),o.jsx(im.Content,{side:"top",align:"start",minWidth:"auto",maxWidth:360,className:"create-agent-card__resource-popover",children:i})]})}function LOt({response:e,status:t}){const{t:n}=Ae("conversation"),i=m.useMemo(()=>({tool:n("blocks.createAgents.sourceLabels.tool"),knowledge:n("blocks.createAgents.sourceLabels.knowledge"),skillCenter:n("blocks.createAgents.sourceLabels.skillCenter"),unknownSource:n("blocks.createAgents.sourceLabels.unknown"),unnamedResource:n("blocks.createAgents.unnamedResource"),unnamedAgent:n("blocks.createAgents.unnamedAgent")}),[n]),r=m.useMemo(()=>lwt(e,i),[i,e]),s=m.useMemo(()=>IOt.map(c=>{const u=cwt(r,c);return{value:c,label:n(`blocks.createAgents.categories.${c}`),...u,searchKeywords:[...new Set(u.sources.flatMap(d=>d.searchKeywords))]}}),[r,n]),a=t==="failed",l=a?lI(e):"";return o.jsx("section",{className:"create-agent-tool-card","aria-label":n("blocks.createAgents.collectionAria"),children:t==="running"?o.jsx(kCe,{label:n("blocks.createAgents.retrieving")}):a?o.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[o.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.retrievalFailed")}),o.jsx("span",{children:l||n("blocks.createAgents.checkConfig")})]}):o.jsx(uCe,{className:"create-agent-card__accordion",children:s.map(c=>o.jsxs(mCe,{className:"create-agent-card__accordion-item",value:c.value,children:[o.jsx(gCe,{className:"create-agent-card__accordion-header",children:o.jsxs(bCe,{className:"create-agent-card__accordion-trigger",children:[o.jsx("span",{children:c.label}),o.jsxs("span",{className:"create-agent-card__accordion-meta",children:[o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.notSearched"):n("blocks.createAgents.notConfigured"):c.resources.length}),o.jsx(SCe,{className:"create-agent-card__accordion-chevron"})]})]})}),o.jsx(vCe,{className:"create-agent-card__accordion-content",children:o.jsxs("div",{className:"create-agent-card__accordion-scroll",role:"region","aria-label":n("blocks.createAgents.resourceList",{label:c.label}),tabIndex:0,children:[c.value==="skill_hub"&&c.searchKeywords.length>0?o.jsxs("div",{className:"create-agent-card__search-keywords",children:[o.jsx("span",{children:n("blocks.createAgents.searchKeywords")}),o.jsx("span",{children:c.searchKeywords.join("、")})]}):null,c.resources.length>0?o.jsx("div",{className:"create-agent-card__resource-list",children:c.resources.map(u=>o.jsx("div",{className:"create-agent-card__resource",children:o.jsxs("div",{className:"create-agent-card__resource-main",children:[o.jsxs("div",{className:"create-agent-card__resource-title",children:[o.jsx("span",{className:"create-agent-card__resource-name",children:u.name}),u.version?o.jsx(ba,{className:"create-agent-card__resource-version",color:"secondary",size:"sm",variant:"soft",children:u.version}):null]}),u.description?o.jsx("p",{children:u.description}):null]})},u.ref))}):o.jsxs("div",{className:"create-agent-card__empty-category",children:[o.jsx("p",{children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.skillHubSkipped"):n("blocks.createAgents.sourceSkipped",{label:c.label}):n("blocks.createAgents.noResources")}),c.sources.filter(u=>u.message).map(u=>o.jsx("p",{className:"create-agent-card__raw-source-error",children:u.message},u.source))]})]})})]},c.value))},r.collectionId||"collected-resources")})}function $Ot({args:e,response:t,status:n}){const{t:i}=Ae("conversation"),r=m.useMemo(()=>({tool:i("blocks.createAgents.sourceLabels.tool"),knowledge:i("blocks.createAgents.sourceLabels.knowledge"),skillCenter:i("blocks.createAgents.sourceLabels.skillCenter"),unknownSource:i("blocks.createAgents.sourceLabels.unknown"),unnamedResource:i("blocks.createAgents.unnamedResource"),unnamedAgent:i("blocks.createAgents.unnamedAgent")}),[i]),s=m.useMemo(()=>XEe(e,t,r),[e,r,t]),a=n==="failed"?lI(t):"";return o.jsxs("section",{className:"create-agent-tool-card is-agent-results","aria-label":i("blocks.createAgents.resultAria"),children:[a?o.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[o.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.creationFailed")}),o.jsx("span",{children:a})]}):null,s.agents.length>0?o.jsx("div",{className:"create-agent-card__agent-grid",children:s.agents.map(l=>{const c=n==="failed"?"failed":l.status,u=l.error||c==="failed"&&a,d=l.builtinTools.length+l.pythonTools.length;return o.jsxs(jB,{className:`create-agent-card__agent-card${u?" is-error":""}`,children:[o.jsx(RB,{leading:o.jsx(Xv,{seed:l.name}),title:l.name,titleText:l.name,status:o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:i(`blocks.createAgents.agentTypes.${l.rootType}`,{defaultValue:l.rootType})})}),l.description?o.jsx(IB,{children:l.description}):null,u?o.jsx("div",{className:"create-agent-card__agent-result is-error",role:"alert",children:u}):null,o.jsxs("div",{className:"create-agent-card__agent-resources","aria-label":i("blocks.createAgents.agentResources",{name:l.name}),children:[o.jsx(FT,{label:i("blocks.createAgents.skill"),count:l.skills.length,icon:o.jsx(K2,{"aria-hidden":"true"}),children:o.jsx(GM,{label:i("blocks.createAgents.skill"),resources:l.skills})}),o.jsx(FT,{label:i("blocks.createAgents.knowledgeBase"),count:l.knowledgeBases.length,icon:o.jsx(Gxe,{"aria-hidden":"true"}),children:o.jsx(GM,{label:i("blocks.createAgents.knowledgeBase"),resources:l.knowledgeBases})}),o.jsxs(FT,{label:i("blocks.createAgents.toolsLabel"),count:d,icon:o.jsx(YFe,{"aria-hidden":"true"}),children:[o.jsx(GM,{label:i("blocks.createAgents.builtinTool"),resources:l.builtinTools}),o.jsx(DOt,{tools:l.pythonTools})]}),o.jsx(FT,{label:i("blocks.createAgents.subAgents"),count:l.subAgentCount,icon:o.jsx(JFe,{"aria-hidden":"true"}),children:o.jsx(MOt,{agents:l.subAgents})})]})]},l.name)})}):n==="running"?o.jsx(kCe,{label:i("blocks.createAgents.creating")}):o.jsxs("div",{className:"create-agent-card__message",children:[o.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.noAgents")}),o.jsx("span",{children:i("blocks.createAgents.noAgentResult")})]})]})}const FOt={web_search:{name:"web_search",runningLabel:"Searching the web",doneLabel:"Web search complete",tone:"search",icon:MY},link_reader:{name:"link_reader",runningLabel:"Reading webpage",doneLabel:"Webpage read complete",tone:"search",icon:MY},run_code:{name:"run_code",runningLabel:"Running code in the AgentKit sandbox",doneLabel:"Code execution completed in the AgentKit sandbox",tone:"sandbox",icon:ewt},list_envs:{name:"list_envs",runningLabel:"Checking available environments",doneLabel:"Available environments loaded",tone:"resources",icon:nwt},get_env_manifest:{name:"get_env_manifest",runningLabel:"Loading the environment manifest",doneLabel:"Environment manifest loaded",tone:"knowledge",icon:iwt},execute_in_sandbox:{name:"execute_in_sandbox",runningLabel:"Running a command in the environment",doneLabel:"Command completed in the environment",tone:"sandbox",icon:$Y},delegate_to_codex_sandbox:{name:"delegate_to_codex_sandbox",runningLabel:"Codex Sandbox is running",doneLabel:"Codex Sandbox completed",failedLabel:"Codex Sandbox failed",tone:"sandbox",icon:$Y},image_generate:{name:"image_generate",runningLabel:"Generating image",doneLabel:"Image generated",tone:"image",icon:K1t},video_generate:{name:"video_generate",runningLabel:"Generating video",doneLabel:"Video generated",tone:"video",icon:mU},ppt_generate:{name:"ppt_generate",runningLabel:"Generating presentation",doneLabel:"Presentation generated",tone:"presentation",icon:X1t},load_memory:{name:"load_memory",runningLabel:"Searching long-term memory",doneLabel:"Memory search complete",tone:"memory",icon:Y1t},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"Searching the knowledge base",doneLabel:"Knowledge base search complete",tone:"knowledge",icon:Z1t},load_skill:{name:"load_skill",runningLabel:"Loading skill",doneLabel:"Skill loaded",tone:"skill",icon:J1t},collect_resources:{name:"collect_resources",runningLabel:"Collecting available resources",doneLabel:"Resource collection complete",failedLabel:"Resource collection failed",tone:"resources",icon:twt,detailRenderer:LOt},create_agents:{name:"create_agents",runningLabel:"Creating and running agents",doneLabel:"Agent creation complete",failedLabel:"Agent creation failed",tone:"agent",icon:LY,detailRenderer:$Ot},branch_compare:{name:"branch_compare",runningLabel:"",doneLabel:"",failedLabel:"",tone:"search",icon:LY,detailRenderer:fwt,hideHeader:!0}};function BOt(e){return FOt[e]}function ECe(e){return o.jsx("svg",{viewBox:"0 0 111 117",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M0 5.6016C7.82288e-05 0.621244 6.02226 -1.87314 9.54395 1.64847L40.1289 32.2334L68.5732 3.7891C69.5834 2.77903 70.9533 2.21099 72.3818 2.21097H82.7031C82.7917 2.20658 82.8806 2.20414 82.9697 2.20414H104.775C109.574 2.20427 111.977 8.00691 108.584 11.4004L64.916 55.0664C64.3075 55.8528 63.9436 56.7647 63.8242 57.6993C63.7142 56.4884 63.1964 55.3069 62.2695 54.3799L45.4082 37.5186H45.4072L40.124 32.2354L17.832 54.5284C16.7671 55.5933 16.2416 56.993 16.2549 58.3887C16.2417 59.7843 16.7672 61.1842 17.832 62.2491L39.9287 84.3467L9.54395 114.733C6.0223 118.255 0.000223474 115.761 0 110.78V5.6016ZM63.8018 58.8702C63.8962 59.9086 64.2936 60.9229 64.9961 61.7735L108.591 105.368C111.984 108.762 109.58 114.564 104.781 114.564H94.4336C94.3543 114.568 94.274 114.569 94.1934 114.569H72.3877C70.9592 114.569 69.5892 114.002 68.5791 112.992L39.9336 84.3467L58.4531 65.8282L58.4453 65.8203L62.2695 61.9981C63.1476 61.12 63.6567 60.0136 63.8018 58.8702Z",fill:"currentColor"})})}function UOt(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:"M6 3h8l4 4v14H6Z"}),o.jsx("path",{d:"M14 3v5h5"}),o.jsx("path",{d:"m10 12-2 2 2 2M14 12l2 2-2 2"})]})}function QOt(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 19 6v5c0 4.6-2.8 7.8-7 10-4.2-2.2-7-5.4-7-10V6l7-3Z"}),o.jsx("path",{d:"m9 12 2 2 4-4"})]})}function zOt(e,t){const n=new Map(e.map(a=>[a.path,a.content])),i=new Map(t.map(a=>[a.path,a.content])),r=new Set([...n.keys(),...i.keys()]),s=[];for(const a of[...r].sort((l,c)=>l.localeCompare(c))){const l=n.get(a),c=i.get(a);l!==c&&s.push({path:a,status:l===void 0?"added":c===void 0?"deleted":"modified",before:l??"",after:c??""})}return s}function Vm(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function CCe(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"m9 7-5 5 5 5M15 7l5 5-5 5M13.5 4l-3 16"})})}function KM(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"M6.5 3.75h7l4 4V20.25h-11zM13.5 3.75v4h4M9 12h6M9 15.5h4.5"})})}function VOt(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"M3.75 7.25h6l1.75 2h8.75v9.25H3.75zM3.75 7.25V5.5h5l1.5 1.75"})})}function HOt(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"m9 5 7 7-7 7"})})}function TCe(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function qOt(e){return o.jsxs("svg",{...Vm(e),children:[o.jsx("circle",{cx:"12",cy:"12",r:"3.25"}),o.jsx("path",{d:"M12 2.75v2M12 19.25v2M2.75 12h2M19.25 12h2M5.45 5.45l1.4 1.4M17.15 17.15l1.4 1.4M18.55 5.45l-1.4 1.4M6.85 17.15l-1.4 1.4"})]})}function WOt(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"M19.25 15.25A8 8 0 0 1 8.75 4.75a8 8 0 1 0 10.5 10.5Z"})})}function GOt(e){return o.jsxs("svg",{...Vm(e),children:[o.jsx("path",{d:"M19.25 8.25V4.5l-1.8 1.8a7.5 7.5 0 1 0 1.8 7.65"}),o.jsx("path",{d:"M19.25 4.5H15.5"})]})}const KOt=m.lazy(()=>Md(()=>Promise.resolve().then(()=>ije),void 0)),XOt=m.lazy(()=>Md(()=>import("../chunks/CodeDiffEditor-CDk5_bn9.js"),[])),ACe="veadk-code-workspace-theme";function YOt(e){const t={name:"",children:new Map};for(const n of e){const i=n.path.split("/").filter(Boolean);let r=t;i.forEach((s,a)=>{let l=r.children.get(s);l||(l={name:s,children:new Map},r.children.set(s,l)),a===i.length-1&&(l.path=n.path),r=l})}return t}function ZOt(e,t=!1){return[...e.children.values()].sort((n,i)=>{const r=n.children.size>0&&n.path===void 0,s=i.children.size>0&&i.path===void 0;return r!==s?t?r?1:-1:r?-1:1:n.name.localeCompare(i.name)})}function JOt(){if(typeof window>"u")return"light";try{return window.localStorage.getItem(ACe)==="dark"?"dark":"light"}catch{return"light"}}function eSt(e){return e===""?0:e.split(` -`).length}function WS({project:e,open:t,onClose:n,onChange:i,readOnly:r=!1,comparison:s}){var F;const{t:a}=Ae("workspaceTools"),l=m.useId(),c=m.useRef(null),u=m.useRef(null),d=m.useRef(n),[f,h]=m.useState(JOt),p=m.useMemo(()=>s?zOt(s.baseProject.files,e.files):[],[s,e.files]),g=m.useMemo(()=>s?p.map(T=>({path:T.path,content:T.status==="deleted"?T.before:T.after})):e.files,[p,s,e.files]),b=m.useMemo(()=>new Map(p.map(T=>[T.path,T.status])),[p]),[v,y]=m.useState(((F=g[0])==null?void 0:F.path)??null),[x,O]=m.useState(new Set),w=m.useMemo(()=>YOt(g),[g]),k=g.find(T=>T.path===v)??null,S=p.find(T=>T.path===v)??null;if(d.current=n,m.useEffect(()=>{try{window.localStorage.setItem(ACe,f)}catch{}},[f]),m.useEffect(()=>{var L;if(!t)return;const T=document.body.style.overflow,P=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(L=u.current)==null||L.focus();const R=M=>{if(M.key==="Escape"){M.preventDefault(),d.current();return}if(M.key!=="Tab"||!c.current)return;const U=[...c.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')].filter(K=>K.offsetParent!==null);if(U.length===0)return;const I=U[0],H=U[U.length-1];M.shiftKey&&document.activeElement===I?(M.preventDefault(),H.focus()):!M.shiftKey&&document.activeElement===H&&(M.preventDefault(),I.focus())};return window.addEventListener("keydown",R),()=>{document.body.style.overflow=T,window.removeEventListener("keydown",R),P!=null&&P.isConnected&&P.focus()}},[t]),m.useEffect(()=>{k||g.length===0||y(g[0].path)},[g,k]),!t)return null;function E(T){O(P=>{const R=new Set(P);return R.has(T)?R.delete(T):R.add(T),R})}function C(T){return T?o.jsx("span",{className:`code-browser-change is-${T}`,children:a(`codeBrowser.change.${T}`)}):null}function N(T,P,R){return ZOt(T,P===0).map(L=>{const M=R?`${R}/${L.name}`:L.name;if(!(L.children.size>0&&L.path===void 0)&&L.path){const H=b.get(L.path);return o.jsxs("button",{type:"button",className:`code-browser-file${v===L.path?" is-active":""}`,style:{paddingLeft:`${12+P*16}px`},onClick:()=>y(L.path??null),title:L.path,"aria-pressed":v===L.path,children:[o.jsx(KM,{}),o.jsx("span",{children:L.name}),C(H)]},M)}const I=x.has(M);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+P*16}px`},onClick:()=>E(M),"aria-expanded":!I,children:[o.jsx(HOt,{className:I?"":"is-open"}),o.jsx(VOt,{}),o.jsx("span",{children:L.name})]}),!I&&N(L,P+1,M)]},M)})}function _(T){!k||s||i({...e,files:e.files.map(P=>P.path===k.path?{...P,content:T}:P)})}const j=f==="light"?"dark":"light",A=a(s?"codeBrowser.noChanges":"codeBrowser.chooseFile");return Li.createPortal(o.jsx("div",{className:"code-browser-backdrop",onMouseDown:T=>{T.target===T.currentTarget&&n()},children:o.jsxs("section",{ref:c,className:`code-browser-dialog is-${f}`,role:"dialog","aria-modal":"true","aria-labelledby":l,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",children:o.jsx(CCe,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:l,children:a(s?"codeBrowser.compareTitle":"codeBrowser.workspaceTitle")}),o.jsx("p",{title:e.name,children:e.name||a("codeBrowser.projectFallback")})]})]}),o.jsxs("div",{className:"code-browser-head-actions",children:[o.jsx("button",{type:"button",className:"code-browser-icon-button",onClick:()=>h(j),"aria-label":a("codeBrowser.switchTheme"),title:a("codeBrowser.switchThemeTitle",{theme:a(`codeBrowser.themes.${j}`)}),children:f==="light"?o.jsx(WOt,{}):o.jsx(qOt,{})}),o.jsx("button",{ref:u,type:"button",className:"code-browser-icon-button",onClick:n,"aria-label":a("codeBrowser.closeWorkspace"),title:a("codeBrowser.close"),children:o.jsx(TCe,{})})]})]}),o.jsxs("div",{className:"code-browser-workspace",children:[o.jsxs("aside",{className:"code-browser-sidebar","aria-label":a(s?"codeBrowser.changedFiles":"codeBrowser.projectFiles"),children:[o.jsxs("div",{className:"code-browser-sidebar-head",children:[o.jsx("span",{children:a(s?"codeBrowser.changes":"codeBrowser.files")}),o.jsx("span",{children:g.length})]}),o.jsx("div",{className:"code-browser-tree",children:g.length>0?N(w,0,""):o.jsx("div",{className:"code-browser-empty",children:A})})]}),o.jsxs("main",{className:"code-browser-main",children:[o.jsx("div",{className:"code-browser-tabs",role:"tablist","aria-label":a("codeBrowser.openFiles"),children:k?o.jsxs("div",{className:"code-browser-tab",role:"tab","aria-selected":"true",children:[o.jsx(KM,{}),o.jsx("span",{children:k.path.split("/").pop()}),C(S==null?void 0:S.status)]}):null}),o.jsxs("div",{className:"code-browser-path",children:[o.jsx(KM,{}),o.jsx("span",{children:(k==null?void 0:k.path)??a("codeBrowser.noFileSelected")})]}),s?o.jsxs("div",{className:"code-browser-diff-labels","aria-label":a("codeBrowser.comparisonDirection"),children:[o.jsx("span",{children:s.baseLabel??a("codeBrowser.before")}),o.jsx("span",{children:s.targetLabel??a("codeBrowser.after")})]}):null,o.jsx("div",{className:"code-browser-editor",children:k?o.jsx(m.Suspense,{fallback:o.jsx("div",{className:"code-browser-empty",children:a("codeBrowser.loadingEditor")}),children:S?o.jsx(XOt,{before:S.before,after:S.after,path:S.path,theme:f}):o.jsx(KOt,{value:k.content,path:k.path,onChange:_,readOnly:r,theme:f})}):o.jsx("div",{className:"code-browser-empty",children:A})}),o.jsxs("footer",{className:"code-browser-statusbar",children:[o.jsx("span",{children:s?a("codeBrowser.changedFileCount",{count:p.length}):a("codeBrowser.fileCount",{count:e.files.length})}),o.jsx("span",{children:k?a("codeBrowser.lineCount",{count:eSt(k.content)}):"UTF-8"})]})]})]})]})}),document.body)}function tSt({project:e,onChange:t,className:n="",label:i}){const{t:r}=Ae("workspaceTools"),[s,a]=m.useState(!1),l=i??r("codeBrowser.viewSource");return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>a(!0),"aria-label":r("codeBrowser.viewSourceAria"),title:l,children:[o.jsx(CCe,{}),o.jsx("span",{children:l})]}),o.jsx(WS,{project:e,open:s,onClose:()=>a(!1),onChange:t})]})}const _Ce="send_a2ui_json_to_client",nSt=28,iSt=3e3;function rSt(e,t,n){let i=t;for(let r=0;r65535?2:1}return i}function sSt(e){return e<=4?1:Math.min(18,Math.max(2,Math.ceil(e/6)))}function NCe(e,t,n,i){const[r,s]=m.useState(()=>t?"":e),a=m.useRef(r),l=m.useRef(e),c=m.useRef(null),u=m.useRef(0),d=m.useRef(n);return l.current=e,d.current=n,m.useEffect(()=>{const f=a.current,h=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!t||h||!e.startsWith(f)){c.current!==null&&window.cancelAnimationFrame(c.current),c.current=null,f!==e&&(a.current=e,s(e));return}if(f===e||c.current!==null)return;const p=g=>{const b=l.current,v=a.current;if(!b.startsWith(v)){a.current=b,s(b),c.current=null;return}if(g-u.current{var f;(f=d.current)==null||f.call(d)},[r]),m.useEffect(()=>{r===e&&(i==null||i())},[r,i,e]),m.useEffect(()=>()=>{c.current!==null&&(window.cancelAnimationFrame(c.current),c.current=null)},[]),r}function aSt(){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 oSt(){return o.jsxs("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:"m4.5 7 1.8 1.8L9.5 5.5"}),o.jsx("path",{d:"M12 7h7.5"}),o.jsx("path",{d:"m4.5 13 1.8 1.8 3.2-3.3"}),o.jsx("path",{d:"M12 13h7.5"}),o.jsx("path",{d:"M5 19h4"}),o.jsx("path",{d:"M12 19h7.5"})]})}function lSt(){return o.jsxs("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:"M5 5v7.25A3.75 3.75 0 0 0 8.75 16H19"}),o.jsx("path",{d:"m15.5 12.5 3.5 3.5-3.5 3.5"})]})}function cSt({activity:e}){const{t}=Ae("conversation"),n=[["Agent Session",e.agentSessionId],["Sandbox Session",e.sandboxSessionId],["Codex Thread",e.threadId]].filter(i=>!!i[1]);return n.length?o.jsx("dl",{className:"codex-sandbox-run__identity","aria-label":t("blocks.sandboxIdentity"),children:n.map(([i,r])=>o.jsxs("div",{children:[o.jsx("dt",{children:i}),o.jsx("dd",{title:r,children:r})]},i))}):null}function uSt(e,t,n){if(e!=="load_skill"||t==null||typeof t!="object"||Array.isArray(t))return;const i=t.skill_name;if(!(typeof i!="string"||!i.trim()))return n("blocks.useSkill",{name:i.trim()})}function jCe({text:e,done:t,answerStarted:n=!1,streaming:i=!1,onStreamFrame:r}){const{t:s}=Ae("conversation"),[a,l]=m.useState(!(t||n)),c=m.useRef(!1);m.useEffect(()=>{c.current||l(!(t||n))},[n,t]);const u=()=>{c.current=!0,l(g=>!g)},d=e.replace(/\r\n?/g,` +`||c==="\r")&&(s=!1);continue}if(a){c==="*"&&u==="/"&&(a=!1,l+=1);continue}if(i){r?r=!1:c==="\\"?r=!0:c===i&&(i="");continue}if(c==="/"&&u==="/"){s=!0,l+=1;continue}if(c==="/"&&u==="*"){a=!0,l+=1;continue}if(c==="'"||c==='"'){i=c;continue}const d=e.slice(l).match(n);if(d)return{index:l,openingIndex:l+d[0].lastIndexOf("("),type:d[1]==="LinearGradient"?"linear":"radial"}}}function pxt(e){let t=e,n=0;for(;;){const i=hxt(t,n);if(!i)return t;const r=uxt(t,i.openingIndex),s=t.slice(i.openingIndex+1,r),a=JSON.stringify(fxt(i.type,s));t=`${t.slice(0,i.index)}${a}${t.slice(r+1)}`,n=i.index+a.length}}function mxt(e,t=!1){if(e.length>axt)throw new Error("ECharts option is too large");const n=pxt(cxt(e));let i;try{i=_Ee.parse(n)}catch(a){throw/\bfunction\s*\(|=>/.test(n)?new Error("ECharts function callbacks are not supported"):a}if(!Bw(i))throw new Error("ECharts option must be a data object");wN(i);const r={...i};r.aria={...Bw(r.aria)?r.aria:{},enabled:!0};const s=r.tooltip;return Bw(s)?r.tooltip={...s,renderMode:"richText"}:Array.isArray(s)&&(r.tooltip=s.map(a=>Bw(a)?{...a,renderMode:"richText"}:a)),t&&(r.animation=!1),r}let UM;function gxt(){return UM??(UM=Md(()=>import("../visualizations/echarts/index-CGT341lL.js"),[]).catch(e=>{throw UM=void 0,e})),UM}function bxt({source:e}){const{t}=Ce("conversation"),n=m.useRef(null),[i,r]=m.useState(!1),[s,a]=m.useState("");return m.useEffect(()=>{let l=!1,c,u,d;r(!1);try{d=mxt(e,window.matchMedia("(prefers-reduced-motion: reduce)").matches),a("")}catch{a("invalid");return}return gxt().then(f=>{const h=n.current;l||!h||(c=f.init(h,void 0,{renderer:"svg"}),c.setOption(d,{notMerge:!0}),typeof ResizeObserver<"u"&&(u=new ResizeObserver(()=>c==null?void 0:c.resize()),u.observe(h)),r(!0))}).catch(()=>{c==null||c.dispose(),c=void 0,l||a("render")}),()=>{l=!0,u==null||u.disconnect(),c==null||c.dispose()}},[e]),o.jsxs("div",{className:`echarts-diagram${s?" echarts-diagram--error":""}`,role:"img","aria-label":t("visualization.echartsAria"),"aria-busy":!i&&!s,children:[o.jsx("div",{ref:n,className:"echarts-diagram__canvas",hidden:!!s}),!i&&!s?o.jsx("div",{className:"echarts-diagram__state","aria-live":"polite",children:o.jsx(An,{duration:2.2,spread:15,children:t("visualization.rendering")})}):null,s?o.jsx("p",{className:"echarts-diagram__error",role:"alert",children:t(s==="invalid"?"visualization.invalidEcharts":"visualization.renderFailed")}):null]})}const yxt=m.memo(bxt);let RY,IY=Promise.resolve(),vxt=0;function xxt(){return RY??(RY=Md(async()=>{const{default:e}=await import("../visualizations/mermaid/mermaid.core-DDCDq-1V.js").then(t=>t.ay);return{default:e}},__vite__mapDeps([0,1])).then(({default:e})=>(e.initialize({startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,theme:"neutral"}),e))),RY}function wxt(e){const t=IY.then(async()=>{const n=await xxt(),i=`mermaid-diagram-${vxt+=1}`;return n.render(i,e)});return IY=t.then(()=>{},()=>{}),t}function Oxt({source:e}){const{t}=Ce("conversation"),n=m.useRef(null),[i,r]=m.useState(null),[s,a]=m.useState(!1);return m.useEffect(()=>{let l=!1;return r(null),a(!1),wxt(e).then(c=>{l||r(c)}).catch(()=>{l||a(!0)}),()=>{l=!0}},[e]),m.useEffect(()=>{!(i!=null&&i.bindFunctions)||!n.current||i.bindFunctions(n.current)},[i]),s?o.jsx("div",{className:"mermaid-diagram mermaid-diagram--error",children:o.jsx("p",{className:"mermaid-diagram__error",role:"alert",children:t("visualization.mermaidFailed")})}):i?o.jsx("div",{ref:n,className:"mermaid-diagram",role:"img","aria-label":t("visualization.mermaidAria"),dangerouslySetInnerHTML:{__html:i.svg}}):o.jsx("div",{className:"mermaid-diagram mermaid-diagram--loading","aria-live":"polite",children:o.jsx(An,{duration:2.2,spread:15,children:t("visualization.rendering")})})}const Sxt=m.memo(Oxt),kxt="_SegmentedControl_1sl7d_1",Ext="_SegmentedControlOption_1sl7d_140",Cxt="_SegmentedControlThumb_1sl7d_219",G6={SegmentedControl:kxt,SegmentedControlOption:Ext,SegmentedControlThumb:Cxt},zc=({value:e,onChange:t,children:n,block:i,pill:r=!0,size:s="md",gutterSize:a,className:l,onClick:c,...u})=>{const d=m.useRef(null),f=m.useRef(null),h=m.useCallback(g=>{const b=d.current,v=f.current;if(!b||!v)return;const y=b==null?void 0:b.querySelector('[data-state="on"]');if(!y)return;const x=b.clientWidth;let O=Math.floor(y.clientWidth);const w=y.offsetLeft;if(x-(O+w)<2&&(O=O-1),v.style.width=`${Math.floor(O)}px`,v.style.transform=`translateX(${w}px)`,b.scrollWidth>x){const k=x*.15,S=b.scrollLeft,E=y.offsetLeft,C=E+O;(ES+x-k)&&g&&y.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"})}},[]);kye({ref:d,onResize:()=>{const g=f.current;if(!g)return;const b=g.style.transition;g.style.transition="",h(!1),g.style.transition=b}}),m.useLayoutEffect(()=>{const g=d.current,b=f.current;!g||!b||(h(!!b.style.transition),b.style.transition||F_(()=>{b.style.transition="width 300ms var(--cubic-enter), transform 300ms var(--cubic-enter)"}))},[h,e,s,a,r]);const p=g=>{g&&t&&t(g)};return o.jsxs(kWe,{ref:d,className:pi(G6.SegmentedControl,l),type:"single",value:e,loop:!1,onValueChange:p,onClick:c,"data-block":i?"":void 0,"data-pill":r?"":void 0,"data-size":s,"data-gutter-size":a,...u,children:[o.jsx("div",{className:G6.SegmentedControlThumb,ref:f}),n]})},Txt=({children:e,...t})=>o.jsx(_We,{className:G6.SegmentedControlOption,...t,onPointerEnter:o7,children:o.jsx("span",{className:"relative",children:e})});zc.Option=Txt;function Axt({children:e,label:t,language:n,source:i,streaming:r=!1}){const{t:s}=Ce("conversation"),[a,l]=m.useState("preview"),c=r?"code":a;return o.jsxs("section",{className:"visualization-card","aria-label":s("visualization.cardAria",{label:t}),children:[o.jsx("div",{className:"visualization-card__toolbar",children:o.jsxs(zc,{className:"visualization-card__tabs",value:c,size:"sm",gutterSize:"sm",pill:!1,"aria-label":s("visualization.viewAria",{label:t}),onChange:u=>{r||l(u)},children:[o.jsx(zc.Option,{value:"preview",disabled:r,children:s("visualization.preview")}),o.jsx(zc.Option,{value:"code",children:s("visualization.code")})]})}),o.jsx("div",{className:"visualization-card__body",children:c==="code"?o.jsx("pre",{className:"visualization-card__code",children:o.jsx("code",{className:`language-${n}`,children:i})}):e})]})}const _xt=m.memo(Axt);function Nxt(e){const t=e==null?void 0:e.trim().toLowerCase();if(t==="mermaid")return"mermaid";if(t==="echart"||t==="echarts")return"echarts"}const NEe=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function K6(e){return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(K6).join(""):m.isValidElement(e)?K6(e.props.children):""}function jxt(e){var i;const t=m.Children.toArray(e)[0];if(!m.isValidElement(t))return;const n=(i=t.props.className)==null?void 0:i.split(/\s+/).find(r=>r.startsWith("language-"));return Nxt(n==null?void 0:n.slice(9))}function jEe(e){if(!e)return!1;try{const t=e.toLowerCase();return NEe.some(n=>t.includes(n))}catch{return!1}}function Rxt(e){var i;const t=(i=e==null?void 0:e.properties)==null?void 0:i.href;if(!t)return!1;if(jEe(t))return!0;const n=e==null?void 0:e.children;if(n&&Array.isArray(n)){const r=n.map(s=>(s==null?void 0:s.value)||"").join("").toLowerCase();return NEe.some(s=>r.includes(s))}return!1}function Ixt({text:e,className:t,allowRawHtml:n=!0,streaming:i=!1}){const{t:r}=Ce("conversation"),[s,a]=m.useState(null),l=(d,f)=>{if(d.src)return d.src;if(f){const h=g=>{var b;if(!g)return null;if(g.type==="source"&&((b=g.properties)!=null&&b.src))return g.properties.src;if(g.children)for(const v of g.children){const y=h(v);if(y)return y}return null},p=h({children:f});if(p)return p}return""},c=d=>{try{const h=new URL(d).pathname.split("/");return h[h.length-1]||"video.mp4"}catch{return"video.mp4"}},u=d=>d?Array.isArray(d)?d.map(f=>(f==null?void 0:f.value)||"").join("")||"video":(d==null?void 0:d.value)||"video":"video";return o.jsxs("div",{className:t?`md ${t}`:"md",children:[o.jsx(Yft,{remarkPlugins:[umt],rehypePlugins:n?[qvt,fY]:[fY],components:{pre:({node:d,children:f,...h})=>{const p=jxt(f);if(p==="mermaid"||p==="echarts"){const g=K6(f).replace(/\n$/,"");return o.jsx(_xt,{label:p==="mermaid"?"Mermaid":"ECharts",language:p,source:g,streaming:i,children:p==="mermaid"?o.jsx(Sxt,{source:g}):o.jsx(yxt,{source:g})})}return o.jsx("pre",{...h,children:f})},a:({node:d,...f})=>{const h=f.href;if(h&&(jEe(h)||Rxt(d))){const p=h,g=u(d==null?void 0:d.children);return o.jsxs("div",{className:"video-container",children:[o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.playVideo",{name:g}),onClick:()=>a({src:p,title:g}),children:[o.jsx("video",{src:p,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(Ky,{})})]}),o.jsx("div",{className:"video-caption",children:o.jsx("a",{href:p,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:g})})]})}return o.jsx("a",{...f,target:"_blank",rel:"noopener noreferrer"})},img:({node:d,src:f,alt:h,...p})=>{const g=o.jsx("img",{...p,src:f,alt:h??"",loading:"lazy"});return f?o.jsx(mbe,{src:f,children:o.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":r("markdown.enlargeImage",{name:h||r("markdown.image")}),children:[g,o.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:o.jsx(Ky,{})})]})}):g},video:({node:d,src:f,children:h,...p})=>{const g=l({src:f},h);return g?o.jsx("div",{className:"video-container",children:o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":r("markdown.enlargeVideo"),onClick:()=>a({src:g}),children:[o.jsx("video",{src:g,...p,playsInline:!0,className:"video-thumbnail",children:h}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(Ky,{})})]})}):o.jsx("video",{src:f,controls:!0,playsInline:!0,className:"video-inline",...p,children:h})}},children:e}),s&&o.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":r("markdown.videoPreview"),onClick:()=>a(null),children:o.jsxs("div",{className:"video-viewer",onClick:d=>d.stopPropagation(),children:[o.jsxs("div",{className:"video-viewer-header",children:[o.jsx("div",{className:"video-viewer-title",children:s.title||c(s.src)}),o.jsxs("nav",{className:"video-viewer-nav",children:[o.jsx("a",{href:s.src,download:s.title||c(s.src),"aria-label":r("markdown.downloadVideo"),title:r("markdown.downloadVideo"),className:"video-viewer-download",children:o.jsx(Yj,{})}),o.jsx("button",{type:"button",className:"video-viewer-close","aria-label":r("markdown.close"),onClick:()=>a(null),children:o.jsx(Ba,{})})]})]}),o.jsx("div",{className:"video-viewer-body",children:o.jsx("video",{src:s.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const Bu=m.memo(Ixt);function QM(e){return(e==null?void 0:e.trim())||Um("resourceMetadata.unknownSource")}function REe(e){return(e==null?void 0:e.trim())||Um("resourceMetadata.unknownCreator")}function Pxt(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 5.5A2.5 2.5 0 0 1 7.5 3H19v16H7.5A2.5 2.5 0 0 0 5 21.5v-16Z"}),o.jsx("path",{d:"M5 18.5A2.5 2.5 0 0 1 7.5 16H19"}),o.jsx("path",{d:"M9 7h6M9 10h4"})]})}function Dxt(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:"M6 3h8l4 4v14H6V3Z"}),o.jsx("path",{d:"M14 3v5h5M9 12h6M9 16h6"})]})}function Mxt(e){return o.jsx("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 10M17 7 7 17"})})}function Lxt(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"M12 5v14M5 12h14"})})}function SE({title:e,children:t,onClose:n,busy:i=!1,className:r=""}){const{t:s}=Ce("ui"),a=m.useId(),l=m.useRef(null),c=m.useRef(null),u=m.useRef(i),d=m.useRef(n);return m.useEffect(()=>{u.current=i,d.current=n},[i,n]),m.useEffect(()=>{var g;const f=document.activeElement instanceof HTMLElement?document.activeElement:null,h=document.body.style.overflow;document.body.style.overflow="hidden",(g=l.current)==null||g.focus();const p=b=>{if(b.key==="Escape"&&!u.current){d.current();return}if(b.key!=="Tab")return;const v=c.current;if(!v)return;const y=Array.from(v.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), a[href], audio[controls], video[controls], iframe, [tabindex]:not([tabindex="-1"])')).filter(w=>w.getClientRects().length>0);if(y.length===0){b.preventDefault();return}const x=y[0],O=y[y.length-1];b.shiftKey&&(document.activeElement===x||!v.contains(document.activeElement))?(b.preventDefault(),O.focus()):!b.shiftKey&&(document.activeElement===O||!v.contains(document.activeElement))&&(b.preventDefault(),x.focus())};return window.addEventListener("keydown",p),()=>{window.removeEventListener("keydown",p),document.body.style.overflow=h,f!=null&&f.isConnected&&f.focus()}},[]),Li.createPortal(o.jsx("div",{className:"knowledge-dialog-backdrop",onMouseDown:f=>{f.target===f.currentTarget&&!i&&n()},children:o.jsxs("section",{ref:c,className:`knowledge-dialog${r?` ${r}`:""}`,role:"dialog","aria-modal":"true","aria-labelledby":a,"aria-busy":i||void 0,children:[o.jsxs("header",{className:"knowledge-dialog__header",children:[o.jsx("h2",{id:a,children:e}),o.jsx("button",{ref:l,type:"button",onClick:n,disabled:i,"aria-label":s("common.close"),children:o.jsx(Mxt,{})})]}),t]})}),document.body)}function HS({message:e}){return e?o.jsx("div",{className:"knowledge-form-error",role:"alert",children:e}):null}function X6(e){return e instanceof DOMException&&e.name==="AbortError"}function $xt(e,t){if(!e)return"";const n=Date.parse(e);return Number.isFinite(n)?new Intl.DateTimeFormat(t,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(n):e}const IEe=[".jpg",".jpeg",".png"].join(","),Fxt=new Set(IEe.split(",")),PEe=[".pdf",".pptx",".docx",".xlsx",".txt"].join(","),Bxt=new Set(PEe.split(",")),Uxt=200*1024*1024;function Y6(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t).toLocaleLowerCase()}function Qxt(e,t,n){return e.size>Uxt?n("knowledge.errors.fileTooLarge"):t==="image"?Fxt.has(Y6(e.name))?"":n("knowledge.errors.invalidImageType"):Bxt.has(Y6(e.name))?"":n("knowledge.errors.invalidDocumentType")}function dU(e){return e<=0?"-":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Z6(e){var r;const t=e.type.trim().replace(/^\./,"");if(t)return t.toUpperCase();const n=e.name.trim(),i=n.includes(".")?(r=n.split(".").pop())==null?void 0:r.trim():"";return i?i.toUpperCase():"-"}function zxt({region:e,onClose:t,onCreated:n}){const{t:i}=Ce("ui"),[r,s]=m.useState(""),[a,l]=m.useState(""),[c,u]=m.useState(!1),[d,f]=m.useState(!1),[h,p]=m.useState(""),g=r.trim(),b=!!(g&&!/^[A-Za-z][A-Za-z0-9_]{0,47}$/.test(g)),v=async y=>{if(y.preventDefault(),u(!0),!g||b)return;f(!0),p("");const x={name:g,description:a.trim()||void 0,region:e};try{n(await dlt(x))}catch(O){p(ho(O,i("knowledge.errors.createBase")))}finally{f(!1)}};return o.jsx(SE,{title:i("knowledge.createBase"),onClose:t,busy:d,children:o.jsxs("form",{onSubmit:y=>void v(y),children:[o.jsxs("div",{className:"knowledge-dialog__body",children:[o.jsxs("label",{children:[o.jsx("span",{children:i("common.name")}),o.jsx("input",{autoFocus:!0,value:r,maxLength:48,"aria-invalid":c&&b||void 0,"aria-describedby":"knowledge-name-help",onBlur:()=>u(!0),onChange:y=>s(y.target.value)})]}),o.jsx("p",{id:"knowledge-name-help",className:`knowledge-dialog__note${c&&b?" is-error":""}`,role:c&&b?"alert":void 0,children:i(c&&b?"knowledge.invalidName":"knowledge.nameHelp")}),o.jsxs("label",{children:[o.jsx("span",{children:i("knowledge.optionalDescription")}),o.jsx("textarea",{value:a,maxLength:80,onChange:y=>l(y.target.value)})]}),o.jsx(HS,{message:h})]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",onClick:t,disabled:d,children:i("common.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:d||!g||b,children:i(d?"common.creating":"common.create")})]})]})})}function Vxt({item:e,onClose:t,onUpdated:n}){const{t:i}=Ce("ui"),[r,s]=m.useState(e.description),[a,l]=m.useState(!1),[c,u]=m.useState(""),d=async f=>{f.preventDefault(),l(!0),u("");try{n(await flt(e.id,e.region,{description:r.trim()}))}catch(h){u(ho(h,i("knowledge.errors.updateBase")))}finally{l(!1)}};return o.jsx(SE,{title:i("knowledge.editBase"),onClose:t,busy:a,children:o.jsxs("form",{onSubmit:f=>void d(f),children:[o.jsxs("div",{className:"knowledge-dialog__body",children:[o.jsxs("label",{children:[o.jsx("span",{children:i("common.name")}),o.jsx("input",{value:e.name,disabled:!0})]}),o.jsxs("label",{children:[o.jsx("span",{children:i("common.description")}),o.jsx("textarea",{autoFocus:!0,value:r,maxLength:80,onChange:f=>s(f.target.value)})]}),o.jsx("p",{className:"knowledge-dialog__note",children:i("knowledge.descriptionOnly")}),o.jsx(HS,{message:c})]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",onClick:t,disabled:a,children:i("common.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:a,children:i(a?"common.saving":"common.save")})]})]})})}function DEe(e,t){if(!e.trim())return{};const n=JSON.parse(e);if(!n||Array.isArray(n)||typeof n!="object")throw new Error(t);return n}function Hxt({base:e,onClose:t,onCreated:n,onAssociationInvalid:i}){const{t:r}=Ce("ui"),[s,a]=m.useState("document"),[l,c]=m.useState(""),[u,d]=m.useState(""),[f,h]=m.useState(""),[p,g]=m.useState(null),[b,v]=m.useState(!1),[y,x]=m.useState("{}"),[O,w]=m.useState(""),[k,S]=m.useState(""),[E,C]=m.useState(null),N=m.useRef(null),_=m.useRef(null),j=m.useRef(null),A=m.useRef(0),F=!!O;m.useEffect(()=>{var M;E&&!F&&((M=j.current)==null||M.focus())},[F,E]);const T=M=>{F||M===s||(a(M),g(null),h(""),c(""),d(""),S(""),C(null),v(!1),A.current=0,N.current&&(N.current.value=""))},P=M=>{if(!M||s==="web")return;const U=Qxt(M,s,r);if(U){g(null),c(""),d(""),S(U);return}g(M),S(""),c(M.name.replace(/\.[^.]+$/,"")),d(Y6(M.name).slice(1))},R=async M=>{if(M.preventDefault(),s==="web"?!f.trim():!p)return;let U;try{U=DEe(y,r("knowledge.errors.metadataObject"))}catch(I){S(ho(I,r("knowledge.errors.metadataFormat")));return}w(s==="web"?E?"save":"preview":"upload"),S("");try{if(s==="web")if(E){const I={sourceType:"url",metadata:E.metadata,url:E.preview.url,sourceTitle:E.preview.name,sourceMarkdown:E.preview.sourceMarkdown};await glt(e.id,e.region,I),n()}else{const I=await blt(e.id,e.region,{url:f.trim()});if(!I.sourceMarkdown.trim())throw new Error(r("knowledge.errors.noWebPreview"));C({preview:I,metadata:U})}else p&&(await ylt(e.id,e.region,{file:p,name:l.trim()||void 0,documentType:u.trim()||void 0,metadata:U}),n())}catch(I){I instanceof HR&&I.errorCode===GOe?i(I):S(ho(I,r(s==="web"?E?"knowledge.errors.addWeb":"knowledge.errors.previewWeb":"knowledge.errors.uploadFile")))}finally{w("")}},L=()=>{F||(C(null),S(""),requestAnimationFrame(()=>{var M;return(M=_.current)==null?void 0:M.focus()}))};return o.jsx(SE,{title:r(E?"knowledge.previewWeb":"knowledge.addData"),onClose:t,busy:F,className:E?"knowledge-dialog--preview knowledge-dialog--web-confirm":"",children:o.jsx("form",{onSubmit:M=>void R(M),children:E?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"knowledge-preview knowledge-web-preview",children:[o.jsxs("div",{className:"knowledge-preview__meta",children:[o.jsx("strong",{title:E.preview.name,children:E.preview.name}),o.jsx("a",{href:E.preview.url,target:"_blank",rel:"noopener noreferrer",children:r("knowledge.openOriginalWeb")})]}),o.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:o.jsx("div",{className:"knowledge-preview__markdown-shell",children:o.jsx(Bu,{text:E.preview.sourceMarkdown,allowRawHtml:!1,className:"knowledge-preview__markdown"})})}),k?o.jsx("div",{className:"knowledge-web-preview__error",children:o.jsx(HS,{message:k})}):null]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",className:"is-back",onClick:L,disabled:F,children:r("knowledge.backToEdit")}),o.jsx("button",{type:"button",onClick:t,disabled:F,children:r("common.cancel")}),o.jsx("button",{ref:j,type:"submit",className:"is-primary",disabled:F,children:r(O==="save"?"common.adding":"knowledge.confirmAdd")})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"knowledge-dialog__body",children:[o.jsx("div",{className:"knowledge-source-tabs",role:"tablist","aria-label":r("knowledge.source"),children:[["image",r("knowledge.image")],["document",r("knowledge.documentFile")],["web",r("knowledge.webPage")]].map(([M,U])=>o.jsx("button",{type:"button",role:"tab",id:`knowledge-source-${M}-tab`,"aria-controls":`knowledge-source-${M}-panel`,"aria-selected":s===M,tabIndex:s===M?0:-1,className:s===M?"is-active":"",disabled:F,onClick:()=>T(M),onKeyDown:I=>{const H=["image","document","web"];if(!["ArrowLeft","ArrowRight","Home","End"].includes(I.key))return;I.preventDefault();const Z=H.indexOf(M),Q=I.key==="Home"?H[0]:I.key==="End"?H[H.length-1]:H[(Z+(I.key==="ArrowRight"?1:-1)+H.length)%H.length];T(Q),requestAnimationFrame(()=>{var q;return(q=document.getElementById(`knowledge-source-${Q}-tab`))==null?void 0:q.focus()})},children:U},M))}),o.jsx("div",{id:`knowledge-source-${s}-panel`,className:"knowledge-source-panel",role:"tabpanel","aria-labelledby":`knowledge-source-${s}-tab`,children:s==="web"?o.jsxs(o.Fragment,{children:[o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.webUrl")}),o.jsx("input",{ref:_,autoFocus:!0,type:"url",value:f,disabled:F,onChange:M=>{h(M.target.value),S("")},placeholder:"https://example.com/article"})]}),o.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:O==="preview"?o.jsx(An,{children:r("knowledge.generatingWebPreview")}):null})]}):o.jsxs(o.Fragment,{children:[o.jsx("input",{ref:N,className:"knowledge-upload-input",type:"file","aria-label":r("knowledge.selectFile"),accept:s==="image"?IEe:PEe,disabled:F,onChange:M=>{var U;P(((U=M.currentTarget.files)==null?void 0:U[0])??null),M.currentTarget.value=""}}),o.jsxs("button",{type:"button",className:`knowledge-upload-dropzone${b?" is-dragging":""}${p?" is-ready":""}`,disabled:F,onClick:()=>{var M;return(M=N.current)==null?void 0:M.click()},onDragEnter:M=>{M.preventDefault(),!F&&(A.current+=1,v(!0))},onDragOver:M=>{M.preventDefault(),F||(M.dataTransfer.dropEffect="copy")},onDragLeave:M=>{M.preventDefault(),A.current=Math.max(0,A.current-1),A.current===0&&v(!1)},onDrop:M=>{var U;M.preventDefault(),A.current=0,v(!1),F||P(((U=M.dataTransfer.files)==null?void 0:U[0])??null)},children:[o.jsx("strong",{children:p?p.name:r("knowledge.selectOrDropFile")}),o.jsx("span",{children:p?r("knowledge.selectedFile",{size:dU(p.size)}):r(s==="image"?"knowledge.imageFileHelp":"knowledge.documentFileHelp")})]}),o.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:F?o.jsx(An,{children:r("knowledge.uploadingFile")}):null})]})}),s!=="web"?o.jsxs("div",{className:"knowledge-dialog__fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.optionalName")}),o.jsx("input",{value:l,disabled:F,maxLength:256,onChange:M=>c(M.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.optionalType")}),o.jsx("input",{value:u,disabled:F,maxLength:64,onChange:M=>d(M.target.value),placeholder:"pdf, docx, png"})]})]}):null,o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.metadataJson")}),o.jsx("textarea",{className:"is-code",value:y,disabled:F,onChange:M=>x(M.target.value),spellCheck:!1})]}),o.jsx(HS,{message:k})]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",onClick:t,disabled:F,children:r("common.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:F||(s==="web"?!f.trim():!p),children:r(F?s==="web"?"common.generating":"common.uploading":s==="web"?"knowledge.generatePreview":"knowledge.uploadFile")})]})]})})})}function qxt({base:e,item:t,onClose:n,onUpdated:i}){const{t:r}=Ce("ui"),[s,a]=m.useState(()=>JSON.stringify(t.metadata??{},null,2)),[l,c]=m.useState(!1),[u,d]=m.useState(""),f=async h=>{h.preventDefault();let p;try{p=DEe(s,r("knowledge.errors.metadataObject"))}catch(g){d(ho(g,r("knowledge.errors.metadataFormat")));return}c(!0),d("");try{i(await vlt(e.id,t.id,e.region,{metadata:p}))}catch(g){d(ho(g,r("knowledge.errors.updateDocument")))}finally{c(!1)}};return o.jsx(SE,{title:r("knowledge.editMetadata"),onClose:n,busy:l,children:o.jsxs("form",{onSubmit:h=>void f(h),children:[o.jsxs("div",{className:"knowledge-dialog__body",children:[o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.knowledge")}),o.jsx("input",{value:t.name||t.id,disabled:!0})]}),o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.metadataJson")}),o.jsx("textarea",{autoFocus:!0,className:"is-code knowledge-metadata-editor",value:s,onChange:h=>a(h.target.value),spellCheck:!1})]}),o.jsx(HS,{message:u})]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",onClick:n,disabled:l,children:r("common.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:l,children:r(l?"common.saving":"common.save")})]})]})})}const MEe=new Set(["avif","bmp","gif","jpeg","jpg","png","svg","webp"]),LEe=new Set(["aac","flac","m4a","mp3","ogg","wav","webm"]),$Ee=new Set(["m4v","mov","mp4","mpeg","mpg","ogg","webm"]),Wxt=new Set(["pdf"]),Gxt=new Set(["doc","docx","ppt","pptx","xls","xlsx"]),Kxt=new Set(["creating","indexing","pending","processing","queued","submitted"]),Xxt=new Set(["error","failed","unavailable"]);function PY(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function DT(e){if(e==null||e==="")return"-";if(["string","number","boolean"].includes(typeof e))return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function Yxt(e,t){if(Array.isArray(e)){if(e.length===0)return null;const r=e.map(PY);if(r.some(s=>Object.keys(s).length>0)){const s=[...new Set(r.flatMap(a=>Object.keys(a)))];return{columns:s,rows:r.map(a=>s.map(l=>DT(a[l])))}}return{columns:[t("knowledge.value")],rows:e.map(s=>[DT(s)])}}const n=PY(e),i=Object.entries(n);if(i.length===0)return null;if(i.every(([,r])=>Array.isArray(r))){const r=i.map(([a])=>a),s=Math.max(...i.map(([,a])=>a.length));return{columns:r,rows:Array.from({length:s},(a,l)=>i.map(([,c])=>DT(c[l])))}}return{columns:[t("knowledge.field"),t("knowledge.value")],rows:i.map(([r,s])=>[r,DT(s)])}}function FEe(e){const t=e.trim();if(!t||t.startsWith("//"))return"";if(t.startsWith("/"))return t;try{const n=new URL(t);return["http:","https:"].includes(n.protocol)?n.href:""}catch{return""}}function Zxt(e){const t=FEe(e);return t.startsWith("http://")||t.startsWith("https://")?t:""}function Jxt(e){var r;const t=e.attachmentType.trim().toLocaleLowerCase();if(t==="image"||t==="doc-image"||t.startsWith("image/"))return"image";if(t==="audio"||t.startsWith("audio/"))return"audio";if(t==="video"||t.startsWith("video/"))return"video";if(t==="pdf"||t==="application/pdf")return"pdf";const n=e.attachmentUrl.split(/[?#]/,1)[0],i=n.includes(".")?((r=n.split(".").pop())==null?void 0:r.toLocaleLowerCase())??"":"";return MEe.has(i)?"image":LEe.has(i)?"audio":$Ee.has(i)?"video":Wxt.has(i)?"pdf":t||i?"file":"none"}function e1t(e,t){const n=e.status.trim().toLocaleLowerCase();if(Kxt.has(n))return{title:t("knowledge.preview.processingTitle"),detail:t("knowledge.preview.processingDetail")};if(Xxt.has(n))return{title:t("knowledge.preview.failedTitle"),detail:t("knowledge.preview.failedDetail")};const i=Z6(e).toLocaleLowerCase();return i==="pdf"||Gxt.has(i)?{title:t("knowledge.preview.noParsedTitle"),detail:t("knowledge.preview.noParsedDetail")}:MEe.has(i)||LEe.has(i)||$Ee.has(i)?{title:t("knowledge.preview.noMediaTitle"),detail:t("knowledge.preview.noMediaDetail")}:{title:t("knowledge.preview.noDataTitle"),detail:t("knowledge.preview.noDataDetail")}}function t1t({chunk:e}){const{t}=Ce("ui"),[n,i]=m.useState(!1),r=FEe(e.attachmentUrl),s=Jxt(e);return!r||s==="none"?null:n?o.jsx("div",{className:"knowledge-preview__attachment-error",children:t("knowledge.preview.attachmentError")}):s==="image"?o.jsx("img",{className:"knowledge-preview__image",src:r,alt:e.title||t("knowledge.preview.imageAlt"),loading:"lazy",onError:()=>i(!0)}):s==="audio"?o.jsx("audio",{className:"knowledge-preview__audio",src:r,controls:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.audioUnsupported")}):s==="video"?o.jsx("video",{className:"knowledge-preview__video",src:r,controls:!0,playsInline:!0,preload:"metadata",onError:()=>i(!0),children:t("knowledge.preview.videoUnsupported")}):s==="pdf"?o.jsxs("div",{className:"knowledge-preview__pdf",children:[o.jsx("iframe",{src:r,title:e.title?t("knowledge.preview.namedPdf",{name:e.title}):t("knowledge.preview.pdf"),sandbox:"",referrerPolicy:"no-referrer",onError:()=>i(!0)}),o.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openPdf")})]}):o.jsxs("div",{className:"knowledge-preview__file-fallback",children:[o.jsx("p",{children:t("knowledge.preview.fileUnsupported")}),o.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:t("knowledge.preview.openOriginalFile")})]})}function n1t({base:e,item:t,onClose:n}){const{t:i}=Ce("ui"),[r,s]=m.useState([]),[a,l]=m.useState(t),[c,u]=m.useState(""),[d,f]=m.useState(!0),[h,p]=m.useState(!1),[g,b]=m.useState(!1),[v,y]=m.useState(""),x=m.useRef(0),O=m.useRef(null),w=m.useCallback(async(C=0)=>{var j;(j=O.current)==null||j.abort();const N=new AbortController;O.current=N;const _=x.current+1;x.current=_,C>0?p(!0):f(!0),y(""),C===0&&(s([]),b(!1));try{const A=await mlt(e.id,t.id,{region:e.region,offset:C,signal:N.signal});if(x.current!==_)return;l(A.document.id?A.document:t),u(A.sourceMarkdown||A.document.sourceMarkdown),s(F=>C>0?[...F,...A.chunks]:A.chunks),b(A.hasMore)}catch(A){!X6(A)&&x.current===_&&y(ho(A,i("knowledge.errors.loadPreview")))}finally{x.current===_&&(f(!1),p(!1))}},[e.id,e.region,t,i]);m.useEffect(()=>(w(),()=>{var C;(C=O.current)==null||C.abort(),x.current+=1}),[w]);const k=Zxt(a.url||t.url),S=e1t(a,i),E=a.metadata._veadk_content_format==="markdown";return o.jsx(SE,{title:a.name||t.name||t.id,onClose:n,className:"knowledge-dialog--preview",children:o.jsxs("div",{className:"knowledge-preview",children:[a.sizeBytes>0||k?o.jsxs("div",{className:"knowledge-preview__meta",children:[a.sizeBytes>0?o.jsx("span",{children:dU(a.sizeBytes)}):null,k?o.jsx("a",{href:k,target:"_blank",rel:"noopener noreferrer",children:i("knowledge.openOriginalWeb")}):null]}):null,o.jsx("div",{className:"knowledge-preview__body","aria-live":"polite",children:c?o.jsx("div",{className:"knowledge-preview__markdown-shell",children:o.jsx(Bu,{text:c,allowRawHtml:!1,className:"knowledge-preview__markdown"})}):d?o.jsx("div",{className:"knowledge-preview__state",role:"status",children:o.jsx(An,{as:"span",duration:2.4,children:i("knowledge.preview.loading")})}):v&&r.length===0?o.jsxs("div",{className:"knowledge-preview__state is-error",role:"alert",children:[o.jsx("p",{children:v}),o.jsx("button",{type:"button",onClick:()=>void w(),children:i("common.retry")})]}):r.length===0?o.jsxs("div",{className:"knowledge-preview__state",children:[o.jsx("p",{children:S.title}),o.jsx("span",{children:k?i("knowledge.preview.openOriginalHint"):S.detail}),o.jsx("button",{type:"button",onClick:()=>void w(),children:i("common.reload")})]}):o.jsxs("div",{className:"knowledge-preview__chunks",children:[r.map((C,N)=>{const _=Yxt(C.tableFields,i),j=C.id||`${N}:${C.title}`;return o.jsxs("article",{className:"knowledge-preview__chunk",children:[o.jsx("header",{children:o.jsx("h3",{children:C.title||i("knowledge.preview.chunk",{index:N+1})})}),C.content?E?o.jsx(Bu,{text:C.content,allowRawHtml:!1,className:"knowledge-preview__markdown"}):o.jsx("p",{className:"knowledge-preview__content",children:C.content}):null,_?o.jsx("div",{className:"knowledge-preview__table-wrap",children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsx("tr",{children:_.columns.map((A,F)=>o.jsx("th",{scope:"col",children:A},`${A}:${F}`))})}),o.jsx("tbody",{children:_.rows.map((A,F)=>o.jsx("tr",{children:A.map((T,P)=>o.jsx("td",{children:T},P))},F))})]})}):null,o.jsx(t1t,{chunk:C})]},j)}),v?o.jsx("div",{className:"knowledge-preview__more-error",role:"alert",children:v}):null,g?o.jsx("button",{type:"button",className:"knowledge-preview__load-more",disabled:h,onClick:()=>void w(r.length),children:h?o.jsx(An,{as:"span",duration:2.4,children:i("knowledge.preview.loadingMore")}):i("knowledge.preview.loadMore")}):null]})})]})})}function i1t({cloudProvider:e,region:t,active:n=!0,activationRevision:i=0,onDetailChange:r,toolbarLeading:s,toolbarFilters:a}){const{t:l,i18n:c}=Ce("ui"),[u,d]=m.useState([]),[f,h]=m.useState({}),[p,g]=m.useState([]),[b,v]=m.useState(""),[y,x]=m.useState("overview"),[O,w]=m.useState(""),[k,S]=m.useState(""),[E,C]=m.useState(!0),[N,_]=m.useState(!1),[j,A]=m.useState(""),[F,T]=m.useState([]),[P,R]=m.useState(!1),[L,M]=m.useState(""),[U,I]=m.useState(""),[H,Z]=m.useState(""),[Q,q]=m.useState(!1),[B,te]=m.useState(!1),[ce,se]=m.useState(!1),[re,ge]=m.useState(null),[G,K]=m.useState(null),[ae,ue]=m.useState(null),[xe,Ee]=m.useState(null),[Je,De]=m.useState(null),[Pe,Ne]=m.useState(!1),Ke=m.useRef(0),wt=m.useRef(0),ot=m.useRef([]),Ie=m.useRef(!1),Be=m.useRef(!1),J=m.useRef(null),pe=m.useRef(null),oe=m.useRef({}),Me=m.useRef(!1),Ve=m.useRef(null),ht=m.useRef(null),Se=m.useRef(null),ve=m.useRef(null),$e=m.useMemo(()=>[t],[t]),qe=m.useCallback(Fe=>`${Fe.region}\0${Fe.id}`,[]),ke=u.find(Fe=>qe(Fe)===b)??null,Tt=!!(ke&&H===qe(ke));m.useEffect(()=>{r==null||r(!!ke)},[r,ke]),m.useEffect(()=>{x("overview"),S("")},[b]);const Jt=m.useMemo(()=>{const Fe=O.trim().toLocaleLowerCase();return Fe?u.filter(dt=>[dt.name,dt.description,dt.ownerLabel,dt.providerKnowledgeId].some($t=>$t.toLocaleLowerCase().includes(Fe))):u},[u,O]),on=m.useMemo(()=>{const Fe=k.trim().toLocaleLowerCase();return Fe?F.filter(dt=>[dt.name,dt.id,Z6(dt)].some($t=>$t.toLocaleLowerCase().includes(Fe))):F},[k,F]);m.useEffect(()=>{K(null)},[ke==null?void 0:ke.id,ke==null?void 0:ke.region]);const Et=m.useCallback(async(Fe=!1)=>{var Qe;if(Fe&&(Me.current||Object.keys(oe.current).length===0))return;(Qe=J.current)==null||Qe.abort();const dt=new AbortController;J.current=dt;const $t=Ke.current+1;Ke.current=$t,Me.current=!0,Fe?_(!0):C(!0),A(""),Fe||g([]);try{const ut=await ult({regions:$e,nextTokens:Fe?oe.current:void 0,signal:dt.signal});if(Ke.current!==$t)return;d(it=>Fe?[...it,...ut.items.filter(xt=>!it.some(W=>qe(W)===qe(xt)))]:ut.items),oe.current=ut.nextTokens,h(ut.nextTokens);const bt=ut.failures.map(({region:it,error:xt})=>`${xh(it,e)}: ${ho(xt,l("common.loadFailed"))}`);g(it=>Fe?[...new Set([...it,...bt])]:bt),Fe||v(it=>ut.items.some(xt=>qe(xt)===it)?it:"")}catch(ut){if(X6(ut))return;Ke.current===$t&&(Fe?g(bt=>[...new Set([...bt,ho(ut,l("knowledge.errors.loadMoreBases"))])]):A(ho(ut,l("knowledge.errors.loadBases"))))}finally{Ke.current===$t&&(Me.current=!1,C(!1),_(!1))}},[qe,e,$e,l]),Bt=m.useCallback(async(Fe,dt=!1)=>{var ut;if(dt&&Ie.current)return;(ut=pe.current)==null||ut.abort();const $t=new AbortController;pe.current=$t;const Qe=wt.current+1;wt.current=Qe,dt||(ot.current=[],Be.current=!1,T([]),q(!1),I("")),Ie.current=!0,R(!0),dt?I(""):M("");try{const bt=await plt(Fe.id,{region:Fe.region,offset:dt?ot.current.length:0,signal:$t.signal});if(wt.current!==Qe)return;Z(pt=>pt===qe(Fe)?"":pt);const it=ot.current,xt=dt?[...it,...bt.items.filter(pt=>!pt.id||!it.some(Re=>Re.id===pt.id))]:bt.items,W=bt.hasMore&&(!dt||xt.length>it.length);ot.current=xt,Be.current=W,T(xt),q(W)}catch(bt){if(X6(bt))return;wt.current===Qe&&(bt instanceof HR&&bt.errorCode===GOe&&(Z(qe(Fe)),ge(xt=>xt&&qe(xt)===qe(Fe)?null:xt)),dt?I(ho(bt,l("knowledge.errors.loadMoreData"))):M(ho(bt,l("knowledge.errors.loadData"))))}finally{wt.current===Qe&&(Ie.current=!1,R(!1))}},[qe,l]);m.useEffect(()=>{var Fe;(Fe=J.current)==null||Fe.abort(),Ke.current+=1,Me.current=!1,oe.current={},d([]),h({}),g([]),v(""),Z(""),A(""),C(!0)},[e]),m.useEffect(()=>{if(n)return Et(),()=>{var Fe;(Fe=J.current)==null||Fe.abort(),Ke.current+=1,Me.current=!1}},[n,i,Et]),m.useEffect(()=>{var Fe,dt;if(!n){(Fe=pe.current)==null||Fe.abort(),wt.current+=1,Ie.current=!1;return}if(!ke){(dt=pe.current)==null||dt.abort(),wt.current+=1,ot.current=[],Ie.current=!1,Be.current=!1,T([]),q(!1),I("");return}return Bt(ke),()=>{var $t;($t=pe.current)==null||$t.abort(),wt.current+=1,Ie.current=!1}},[n,i,ke==null?void 0:ke.id,ke==null?void 0:ke.region]);const rt=n&&!ke&&!O.trim()&&!E&&!N&&!j&&Object.keys(f).length>0;m.useEffect(()=>{const Fe=ht.current,dt=Ve.current;if(!Fe||!dt||!rt)return;const $t=new IntersectionObserver(([Qe])=>{Qe.isIntersecting&&Et(!0)},{root:dt,rootMargin:"240px 0px",threshold:.01});return $t.observe(Fe),()=>$t.disconnect()},[rt,Et]);const gt=()=>{const Fe=Ve.current;!Fe||!rt||Fe.scrollHeight-Fe.scrollTop-Fe.clientHeight<=240&&Et(!0)},je=!!(ke&&F.length>0&&Q&&!P&&!U);m.useEffect(()=>{const Fe=ve.current,dt=Se.current;if(!ke||!Fe||!dt||!je)return;const $t=new IntersectionObserver(([Qe])=>{Qe.isIntersecting&&Bt(ke,!0)},{root:Se.current,rootMargin:"240px 0px",threshold:.01});return $t.observe(Fe),()=>$t.disconnect()},[je,Bt,ke==null?void 0:ke.id,ke==null?void 0:ke.region]);const Ot=()=>{const Fe=Se.current;if(!ke||!Fe||!Be.current||Ie.current||U)return;const{scrollHeight:dt,scrollTop:$t,clientHeight:Qe}=Fe;dt-$t-Qe<=240&&Bt(ke,!0)},yt=Fe=>{d(dt=>dt.map($t=>qe($t)===qe(Fe)?Fe:$t))},Dt=async()=>{if(xe){Ne(!0);try{await hlt(xe.id,xe.region),d(Fe=>Fe.filter(dt=>qe(dt)!==qe(xe))),Z(Fe=>Fe===qe(xe)?"":Fe),b===qe(xe)&&v(""),Ee(null)}catch(Fe){A(ho(Fe,l("knowledge.errors.deleteBase"))),Ee(null)}finally{Ne(!1)}}},Ft=async()=>{if(!(!ke||!Je)){Ne(!0);try{await xlt(ke.id,Je.id,ke.region);const Fe=ot.current.filter(dt=>dt.id!==Je.id);ot.current=Fe,T(Fe),De(null)}catch(Fe){M(ho(Fe,l("knowledge.errors.deleteDocument"))),De(null)}finally{Ne(!1)}}};return o.jsxs("section",{className:`knowledge-library${ke?" is-detail":" resource-collection"}`,"aria-label":l("knowledge.library"),children:[ke?o.jsx(uE,{className:"knowledge-library__detail",title:ke.name,description:ke.description||l("common.noDescription"),identitySeed:ke.name,backLabel:l("knowledge.backToList"),onBack:()=>v(""),sections:[{key:"overview",label:l("skillCenter.overview"),content:o.jsx("section",{className:"knowledge-overview",children:o.jsxs(NB,{className:"knowledge-overview__summary",children:[o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.provider")}),o.jsx("dd",{children:ke.providerType||"-"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.knowledgeId")}),o.jsx("dd",{className:"knowledge-keyboard-reveal",tabIndex:0,title:ke.providerKnowledgeId,children:ke.providerKnowledgeId||"-"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.project")}),o.jsx("dd",{children:ke.projectName||"default"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.creator")}),o.jsx("dd",{children:QM(ke.ownerLabel)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("skillCenter.updatedAt")}),o.jsx("dd",{children:$xt(ke.updatedAt,c.resolvedLanguage??c.language)||"-"})]})]})})},{key:"data",label:l("knowledge.data"),content:o.jsx("section",{className:"knowledge-documents",children:o.jsx("div",{className:`knowledge-documents__body${F.length>0?" is-table":""}`,"aria-live":"polite",children:P&&F.length===0?o.jsx(Ud,{}):L&&F.length===0?o.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[o.jsx("p",{children:L}),Tt&&ke.canManage?o.jsx("button",{type:"button",onClick:()=>Ee(ke),children:l("knowledge.deleteInvalidAssociation")}):o.jsx("button",{type:"button",onClick:()=>void Bt(ke),children:l("common.retry")})]}):F.length===0?o.jsxs("div",{className:"knowledge-library__state",children:[o.jsx(Dxt,{}),o.jsx("p",{children:l("knowledge.noData")}),ke.canManage&&o.jsx("button",{type:"button",onClick:()=>ge(ke),children:l("knowledge.addFirstData")})]}):o.jsx(Not,{rows:on,rowKey:Fe=>Fe.id,rowLabel:Fe=>Fe.name||Fe.id,columns:[{key:"name",header:l("common.name"),className:"is-primary-column",render:Fe=>o.jsx("span",{title:Fe.name||Fe.id,children:Fe.name||Fe.id})},{key:"format",header:l("knowledge.format"),className:"is-compact-column",render:Fe=>Z6(Fe)},{key:"size",header:l("knowledge.size"),className:"is-compact-column",render:Fe=>dU(Fe.sizeBytes)}],searchValue:k,onSearchChange:S,searchPlaceholder:l("knowledge.searchData"),searchLabel:l("knowledge.searchLibraryData"),primaryAction:ke.canManage?{label:l(Tt?"knowledge.associationInvalid":"knowledge.addData"),disabled:Tt,title:Tt?l("knowledge.providerMissing"):void 0,onClick:()=>ge(ke)}:void 0,rowActions:Fe=>[{label:l("common.preview"),onSelect:()=>K(Fe)},...ke.canManage?[{label:l("common.edit"),onSelect:()=>ue(Fe)},{label:l("common.delete"),onSelect:()=>De(Fe),danger:!0}]:[]],scrollRef:Se,onScroll:Ot,busy:P,emptyLabel:l("knowledge.noMatchingData"),footer:P?o.jsxs("div",{className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:l("knowledge.loadingMoreData")})]}):U?o.jsxs("div",{className:"knowledge-document-pagination is-error",role:"alert",children:[o.jsx("span",{children:U}),o.jsx("button",{type:"button",onClick:()=>void Bt(ke,!0),children:l("knowledge.retryLoading")})]}):Q?o.jsx("div",{ref:ve,className:"knowledge-document-pagination",role:"status","aria-live":"polite",children:l("skillCenter.scrollForMore")}):null})})})}],activeSectionKey:y,navigationLabel:l("knowledge.details"),onSectionChange:x,actions:ke.canManage?o.jsxs(o.Fragment,{children:[o.jsx(Wt,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>Ee(ke),children:l("common.delete")}),o.jsx(Wt,{type:"button",color:"primary",size:"lg",pill:!1,onClick:()=>se(!0),children:l("common.edit")})]}):void 0}):o.jsxs(o.Fragment,{children:[o.jsxs(Zb,{className:"knowledge-library__toolbar library-resource-toolbar",children:[s,o.jsxs("div",{className:"resource-toolbar__actions",children:[a,o.jsx(wm,{value:O,onChange:Fe=>w(Fe.target.value),placeholder:l("knowledge.searchBases"),"aria-label":l("knowledge.searchBases")})]})]}),o.jsxs(Jb,{ref:Ve,"aria-live":"polite",onScroll:gt,children:[p.length>0&&!E&&o.jsxs("div",{className:"knowledge-region-warning",role:"status",children:[o.jsx("span",{children:l("knowledge.someBasesFailed")}),o.jsx("button",{type:"button",onClick:()=>void Et(),children:l("common.retry")})]}),E&&u.length===0?o.jsx(Ud,{}):j?o.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[o.jsx("p",{children:j}),o.jsx("button",{type:"button",onClick:()=>void Et(),children:l("common.retry")})]}):Jt.length===0&&O.trim()?o.jsxs("div",{className:"knowledge-library__state",children:[o.jsx(Pxt,{}),o.jsx("p",{children:l("knowledge.noMatchingBases")})]}):o.jsxs(Vx,{children:[O.trim()?null:o.jsx(Cb,{"aria-label":l("knowledge.createBase"),icon:o.jsx(Lxt,{}),onClick:()=>te(!0),children:l("knowledge.createBase")}),Jt.map(Fe=>o.jsx(pE,{className:"knowledge-card",title:Fe.name,description:Fe.description||l("common.noDescription"),metadata:[{label:l("knowledge.creator"),value:QM(Fe.ownerLabel),title:QM(Fe.ownerLabel)},{label:l("knowledge.project"),value:Fe.projectName||"default",title:Fe.projectName||"default"}],action:{label:H===qe(Fe)?l("knowledge.associationInvalid"):l("knowledge.addData"),icon:"plus",disabled:!Fe.canManage||H===qe(Fe),title:Fe.canManage?H===qe(Fe)?l("knowledge.providerMissing"):void 0:l("knowledge.noManagePermission"),onClick:()=>ge(Fe)},detailAction:{label:l("common.viewDetails"),onClick:()=>v(qe(Fe))}},qe(Fe)))]}),rt||N?o.jsx("div",{ref:ht,className:"my-agent-load-more",role:"status","aria-live":"polite",children:N?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:l("knowledge.loadingMoreBases")})]}):rt?o.jsx("span",{children:l("skillCenter.scrollForMore")}):null}):null]})]}),B&&o.jsx(zxt,{region:t,onClose:()=>te(!1),onCreated:Fe=>{d(dt=>[Fe,...dt]),v(qe(Fe)),te(!1)}}),ke&&ce&&o.jsx(Vxt,{item:ke,onClose:()=>se(!1),onUpdated:Fe=>{yt(Fe),se(!1)}}),ke&&G&&o.jsx(n1t,{base:ke,item:G,onClose:()=>K(null)}),re&&o.jsx(Hxt,{base:re,onClose:()=>ge(null),onAssociationInvalid:Fe=>{Z(qe(re)),ke&&qe(ke)===qe(re)&&M(ho(Fe,l("knowledge.associationInvalid"))),ge(null)},onCreated:()=>{ke&&qe(ke)===qe(re)&&Bt(ke),ge(null)}}),ke&&ae&&o.jsx(qxt,{base:ke,item:ae,onClose:()=>ue(null),onUpdated:Fe=>{const dt=ot.current.map($t=>$t.id===Fe.id?Fe:$t);ot.current=dt,T(dt),ue(null)}}),xe&&o.jsx(pc,{title:l("knowledge.deleteBaseTitle"),description:l("knowledge.deleteBaseDescription",{name:xe.name}),confirmLabel:l(Pe?"common.deleting":"common.delete"),variant:"danger",busy:Pe,onCancel:()=>Ee(null),onConfirm:()=>void Dt()}),Je&&o.jsx(pc,{title:l("knowledge.deleteDocumentTitle"),description:l("knowledge.deleteDocumentDescription",{name:Je.name||Je.id}),confirmLabel:l(Pe?"common.deleting":"common.delete"),variant:"danger",busy:Pe,onCancel:()=>De(null),onConfirm:()=>void Ft()})]})}const r1t="_EmptyMessage_1r5gu_1",s1t="_IconBadge_1r5gu_16",a1t="_Title_1r5gu_54",o1t="_Description_1r5gu_69",l1t="_ActionRow_1r5gu_77",kE={EmptyMessage:r1t,IconBadge:s1t,Title:a1t,Description:o1t,ActionRow:l1t},En=({children:e,className:t,fill:n="static"})=>o.jsx("div",{className:pi(kE.EmptyMessage,t),"data-fill":n,children:e}),c1t=({size:e="md",color:t="secondary",children:n,className:i})=>o.jsx("div",{className:pi(kE.IconBadge,i),"data-size":e,"data-color":t,children:n}),u1t=({children:e,className:t,color:n="secondary"})=>o.jsx("div",{className:pi(kE.Title,t),"data-color":n,children:e}),d1t=({children:e,className:t})=>o.jsx("div",{className:pi(kE.Description,t),children:e}),f1t=({children:e,className:t})=>o.jsx("div",{className:pi(kE.ActionRow,t),children:e});En.Icon=c1t;En.Title=u1t;En.Description=d1t;En.ActionRow=f1t;const h1t="/web/skill-management";class p1t extends Error{constructor(t,n,i="SKILL_MANAGEMENT_ERROR",r="",s,a=""){super(t),this.status=n,this.code=i,this.statusText=r,this.originalError=s,this.rawResponse=a,this.name="SkillManagementApiError"}}async function Uh(e,t={},n=Wo){return fetch(Bo(`${h1t}${e}`),{...t,headers:Hu(Dh(t.headers)),signal:Ol(t.signal,n)})}async function BEe(e,t){let n=t,i="SKILL_MANAGEMENT_ERROR",r;const s=await e.text().catch(()=>"");try{const a=JSON.parse(s);typeof a.detail=="string"?n=a.detail:a.detail&&(n=a.detail.message||t,i=a.detail.code||i,r=a.detail.originalError)}catch{s.trim()&&(n=V("common.fallbackWithDetail",{fallback:t,detail:s.trim()}))}return new p1t(n,e.status,i,e.statusText,r,s)}async function Qh(e,t){if(!e.ok)throw await BEe(e,t);return e.json()}async function m1t(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),Qh(await Uh(`/spaces?${t}`,{signal:e.signal}),V("skills.listSpacesFailed"))}async function g1t(e){return Qh(await Uh("/spaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),V("skills.createSpaceFailed"))}async function b1t(e){return Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.name,description:e.description,region:e.region})}),V("skills.updateSpaceFailed"))}async function y1t(e){const t=new URLSearchParams({region:e.region});await Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}?${t}`,{method:"DELETE"}),V("skills.deleteSpaceFailed"))}async function v1t(e){const t=new URLSearchParams({region:e.region});return e.project&&t.set("project",e.project),Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}/skills?${t}`,{method:"POST",headers:{"Content-Type":"application/zip"},body:e.file},is),V("skills.uploadFailed"))}async function x1t(e){return Qh(await Uh("/validate",{method:"POST",headers:{"Content-Type":"application/zip"},body:e},is),V("skills.validateFailed"))}async function w1t(e){const t=new URLSearchParams({region:e.region});await Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}?${t}`,{method:"DELETE"}),V("skills.deleteFailed"))}async function O1t(e){const t=new URLSearchParams({region:e.region});e.version&&t.set("version",e.version),e.skillSpaceName&&t.set("skill_space_name",e.skillSpaceName),e.skillName&&t.set("skill_name",e.skillName);const n=await Qh(await Uh(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/files?${t}`),V("skills.listFilesFailed"));return Array.isArray(n.files)?n.files:[]}async function S1t(e){var l;const t=new URLSearchParams({region:e.region});e.version&&t.set("version",e.version),e.skillSpaceName&&t.set("skill_space_name",e.skillSpaceName),e.skillName&&t.set("skill_name",e.skillName);const n=await Uh(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/archive?${t}`,{},is);n.ok||await Qh(n,V("skills.downloadFailed"));const r=((l=(n.headers.get("content-disposition")||"").match(/filename="([^"]+)"/))==null?void 0:l[1])||`${e.fallbackName}.zip`,s=URL.createObjectURL(await n.blob()),a=document.createElement("a");a.href=s,a.download=r,a.click(),URL.revokeObjectURL(s)}async function rI(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Ol(void 0,Wo)});if(!t.ok)throw await BEe(t,Qt("helpers.skills.agentKitRequestFailed"));return t.json()}async function UEe(){return(await rI("/web/skill-spaces")).items||[]}async function QEe(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await rI(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function k1t(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),rI(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`)}async function E1t(e,t,n,i,r,s,a){const l=[];n&&l.push(`version=${encodeURIComponent(n)}`),i&&l.push(`region=${encodeURIComponent(i)}`),r&&l.push(`project=${encodeURIComponent(r)}`),s&&l.push(`skill_name=${encodeURIComponent(s)}`),a&&l.push(`skill_space_name=${encodeURIComponent(a)}`);const c=l.length>0?`?${l.join("&")}`:"";return rI(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${c}`)}function C1t(e,t){const n=Fg(t);return{source:"skillspace",id:`ss:${e.id}/${n}/${t.version}`,name:t.skillName,description:t.skillDescription,folder:t.skillName,skillSpaceId:e.id,skillSpaceName:e.name,skillSpaceRegion:e.region,skillId:n,version:t.version}}function Fg(e){return e.skillId||e.skillName}function T1t(e,t,n="volcengine"){return n==="byteplus"?"":`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}ln.hasResourceBundle("en-US","skills")||ln.addResourceBundle("en-US","skills",Zae,!0,!0);ln.hasResourceBundle("zh-CN","skills")||ln.addResourceBundle("zh-CN","skills",mde,!0,!0);function Vt(e,t={}){return ln.t(e,{...t,ns:"skills"})}const A1t="/web/skill-workbench";class J6 extends Error{constructor(t,n,i="SKILL_WORKBENCH_ERROR",r=!1,s="",a,l=""){super(t),this.status=n,this.code=i,this.retryable=r,this.statusText=s,this.originalError=a,this.rawResponse=l,this.name="SkillWorkbenchApiError"}}function eu(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(Vt("api.invalidFormat",{label:t}));return e}function DY(e,t){if(e!=null){if(typeof e!="string"||!e.trim()||e.trim().length>256)throw new Error(Vt("api.invalidFormat",{label:t}));return e.trim()}}function _1t(e){if(e!=null){if(e==="pending"||e==="ready"||e==="failed"||e==="unknown")return e;throw new Error(Vt("api.invalidFormat",{label:Vt("api.recoveryStatus")}))}}async function Qd(e,t={},n=Wo){return fetch(Bo(`${A1t}${e}`),{...t,headers:Dh(t.headers),signal:Ol(t.signal,n)})}async function fU(e,t){var i;const n=await e.text().catch(()=>"");try{const r=eu(JSON.parse(n),Vt("api.errorResponse")),s=r.detail&&typeof r.detail=="object"?eu(r.detail,Vt("api.errorDetails")):r;return new J6(typeof s.message=="string"?s.message:t,e.status,typeof s.code=="string"?s.code:"SKILL_WORKBENCH_ERROR",s.retryable===!0,e.statusText,s.originalError&&typeof s.originalError=="object"?s.originalError:void 0,n)}catch{const r=((i=e.headers.get("content-type"))==null?void 0:i.split(";",1)[0])||Vt("api.missingContentType");return new J6(Vt("api.gatewayError",{fallback:t,status:e.status,contentType:r}),e.status,"SKILL_WORKBENCH_ERROR",!1,e.statusText,void 0,n)}}async function Sm(e,t){if(!e.ok)throw await fU(e,t);const n=e.headers.get("content-type")??"";if(!n.includes("application/json")){const i=n.split(";",1)[0]||Vt("api.missingContentType");throw new Error(Vt("api.nonJson",{fallback:t,status:e.status,contentType:i}))}return e.json()}function N1t(e){return Array.isArray(e)?e.map(t=>{const n=eu(t,Vt("api.activity")),i=n.kind,r=n.status;if(typeof n.id!="string"||!["status","thinking","message","tool"].includes(String(i))||!["running","done"].includes(String(r)))throw new Error(Vt("api.invalidActivity"));if(i==="tool"){if(typeof n.name!="string")throw new Error(Vt("api.invalidToolActivity"));return{id:n.id,kind:i,status:r,name:n.name,...n.input!==void 0?{args:n.input}:{},...n.output!==void 0?{response:n.output}:{}}}if(typeof n.text!="string")throw new Error(Vt("api.invalidTextActivity"));return{id:n.id,kind:i,status:r,text:n.text}}):[]}function j1t(e){if(e==null)return;const t=eu(e,Vt("api.publication"));if(typeof t.revision!="number"||typeof t.skillId!="string"||typeof t.version!="string"||!Array.isArray(t.skillSpaceIds)||!t.skillSpaceIds.every(n=>typeof n=="string")||t.disposition!=="create-new"&&t.disposition!=="update-source"||!tR(t.region)||typeof t.projectName!="string")throw new Error(Vt("api.invalidFormat",{label:Vt("api.publication")}));return{revision:t.revision,skillId:t.skillId,version:t.version,skillSpaceIds:t.skillSpaceIds,disposition:t.disposition,region:t.region,projectName:t.projectName}}function qS(e){const t=eu(e,Vt("api.task"));if(typeof t.jobId!="string"||t.operation!=="create"&&t.operation!=="optimize"||typeof t.intent!="string"||typeof t.revision!="number"||typeof t.state!="string")throw new Error(Vt("api.invalidFormat",{label:Vt("api.task")}));const n=Array.isArray(t.files)?t.files.flatMap(l=>{const c=eu(l,Vt("api.file"));return typeof c.path=="string"&&typeof c.size=="number"?[{path:c.path,size:c.size}]:[]}):[];if(!["running","ready","failed","cancelled","expired","published"].includes(t.state))throw new Error(Vt("api.unknownTaskState"));const r=DY(t.toolId,"Tool ID"),s=DY(t.sessionId,"Session ID"),a=_1t(t.recoveryStatus);return{jobId:t.jobId,operation:t.operation,intent:t.intent,...typeof t.model=="string"?{model:t.model}:{},...typeof t.style=="string"?{style:t.style}:{},...typeof t.requestedName=="string"?{requestedName:t.requestedName}:{},revision:t.revision,...r?{toolId:r}:{},...s?{sessionId:s}:{},...typeof t.sessionTtlSeconds=="number"?{sessionTtlSeconds:t.sessionTtlSeconds}:{},...typeof t.expiresAt=="string"?{expiresAt:t.expiresAt}:{},...typeof t.recoveryAvailable=="boolean"?{recoveryAvailable:t.recoveryAvailable}:{},...a?{recoveryStatus:a}:{},...typeof t.recoveredFromSnapshot=="boolean"?{recoveredFromSnapshot:t.recoveredFromSnapshot}:{},state:t.state,stage:typeof t.stage=="string"?t.stage:"generating",activities:N1t(t.activities),files:n,...t.source&&typeof t.source=="object"?{source:t.source}:{},...typeof t.name=="string"?{name:t.name}:{},...typeof t.description=="string"?{description:t.description}:{},...typeof t.skillMd=="string"?{skillMd:t.skillMd}:{},...typeof t.error=="string"?{error:t.error}:{},...t.validation&&typeof t.validation=="object"?{validation:t.validation}:{},...t.publication?{publication:j1t(t.publication)}:{}}}async function sI(e){const t=eu(await Sm(await Qd("/capabilities",{signal:e}),Vt("api.loadCapability")),Vt("api.capability"));return{enabled:t.enabled===!0,reason:typeof t.reason=="string"?t.reason:"",operations:Array.isArray(t.operations)?t.operations.filter(n=>n==="create"||n==="optimize"):[],models:Array.isArray(t.models)?t.models.flatMap(n=>{if(!n||typeof n!="object")return[];const i=n;return typeof i.id=="string"&&typeof i.label=="string"?[{id:i.id,label:i.label}]:[]}):[],styles:t.styles&&typeof t.styles=="object"&&!Array.isArray(t.styles)?Object.fromEntries(Object.entries(t.styles).filter(n=>typeof n[1]=="string")):{},...typeof t.maxUploadBytes=="number"?{maxUploadBytes:t.maxUploadBytes}:{}}}async function R1t(e){if(e.file){const n=new URLSearchParams({operation:"optimize",intent:e.intent});e.jobId&&n.set("job_id",e.jobId),e.model&&n.set("model",e.model),e.style&&n.set("style",e.style),e.name&&n.set("name",e.name);const i=await Qd(`/tasks/from-upload?${n}`,{method:"POST",body:e.file,headers:{"Content-Type":"application/zip"},signal:e.signal},is);return qS(await Sm(i,Vt("api.startOptimization")))}const t=await Qd("/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operation:e.operation,intent:e.intent,...e.model?{model:e.model}:{},...e.style?{style:e.style}:{},...e.name?{name:e.name}:{},...e.jobId?{jobId:e.jobId}:{},...e.source?{source:{kind:"skill-center",skillId:e.source.skillId,skillName:e.source.name,version:e.source.version,region:e.source.region,projectName:e.source.projectName,skillSpaceId:e.source.skillSpaceId,skillSpaceName:e.source.skillSpaceName}}:{}}),signal:e.signal},is);return qS(await Sm(t,Vt("api.startTask")))}async function I1t(e,t){return qS(await Sm(await Qd(`/tasks/${encodeURIComponent(e)}`,{signal:t}),Vt("api.loadTask")))}async function zM(e,t,n){const i=new URLSearchParams;i.set("expected_revision",String(t));const r=eu(await Sm(await Qd(`/tasks/${encodeURIComponent(e)}/artifact?${i.toString()}`,{signal:n}),Vt("api.loadArtifact")),Vt("api.artifact"));if(r.jobId!==e||r.revision!==t||!Number.isSafeInteger(r.revision)||r.revision<1||typeof r.sha256!="string"||!/^[0-9a-f]{64}$/.test(r.sha256)||typeof r.name!="string"||typeof r.description!="string"||!Array.isArray(r.files))throw new Error(Vt("api.invalidFormat",{label:Vt("api.artifact")}));const s=r.files.map(a=>{const l=eu(a,Vt("api.artifactFile"));if(typeof l.path!="string"||typeof l.size!="number"||typeof l.content!="string")throw new Error(Vt("api.invalidFormat",{label:Vt("api.artifactFile")}));return{path:l.path,size:l.size,content:l.content}});return{jobId:r.jobId,revision:r.revision,sha256:r.sha256,name:r.name,description:r.description,files:s}}async function VM(e){const t=await Qd(`/tasks/${encodeURIComponent(e.jobId)}/refinements`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({intent:e.intent,expectedRevision:e.expectedRevision})},is);return qS(await Sm(t,Vt("api.refine")))}async function P1t(e){const t=await Qd(`/tasks/${encodeURIComponent(e.jobId)}/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedRevision:e.expectedRevision})});return qS(await Sm(t,Vt("api.stop")))}async function D1t(e){const t=await Qd(`/tasks/${encodeURIComponent(e.jobId)}/publish-stream`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/x-ndjson"},body:JSON.stringify({disposition:e.disposition,expectedRevision:e.expectedRevision,expectedArtifactSha256:e.expectedArtifactSha256,skillSpaceIds:e.skillSpaceIds??[],projectName:e.projectName,region:e.region}),signal:e.signal},0);if(!t.ok)throw await fU(t,Vt("api.publish"));if(!(t.headers.get("content-type")??"").includes("application/x-ndjson"))throw new Error(Vt("api.nonNdjson"));if(!t.body)throw new Error(Vt("api.missingStream"));const i=new Set(["preparing","uploading","registering","activating","publishing"]);let r=null,s="";const a=new TextDecoder,l=t.body.getReader(),c=u=>{var h;if(!u.trim())return;const d=eu(JSON.parse(u),Vt("api.publishProgress"));if(d.type==="progress"){if(typeof d.phase!="string"||!i.has(d.phase)||typeof d.message!="string")throw new Error(Vt("api.invalidPublishProgress"));(h=e.onProgress)==null||h.call(e,{phase:d.phase,message:d.message});return}if(d.type==="error"){const p=eu(d.error,Vt("api.publishError"));throw new J6(typeof p.message=="string"?p.message:Vt("api.publish"),500,typeof p.code=="string"?p.code:"SKILL_PUBLISH_FAILED",p.retryable===!0,"",p.originalError&&typeof p.originalError=="object"?p.originalError:void 0,JSON.stringify(d.error))}if(d.type!=="complete")throw new Error(Vt("api.unknownPublishEvent"));const f=eu(d.result,Vt("api.publishResult"));if(typeof f.skillId!="string"||typeof f.version!="string"||!Array.isArray(f.skillSpaceIds)||!f.skillSpaceIds.every(p=>typeof p=="string")||f.disposition!=="create-new"&&f.disposition!=="update-source"||!tR(f.region)||typeof f.projectName!="string")throw new Error(Vt("api.invalidFormat",{label:Vt("api.publishResult")}));r={skillId:f.skillId,version:f.version,skillSpaceIds:f.skillSpaceIds,disposition:f.disposition,region:f.region,projectName:f.projectName}};for(;;){const{value:u,done:d}=await l.read();s+=a.decode(u,{stream:!d});const f=s.split(` +`);if(s=f.pop()??"",f.forEach(c),d)break}if(c(s),!r)throw new Error(Vt("api.streamEnded"));return r}async function M1t(e){await Sm(await Qd(`/tasks/${encodeURIComponent(e)}`,{method:"DELETE"}),Vt("api.deleteTask"))}async function L1t(e,t,n){var c;const i=new URLSearchParams;i.set("expected_revision",String(t)),i.set("expected_sha256",n);const r=await Qd(`/tasks/${encodeURIComponent(e)}/download?${i.toString()}`,{},is);if(!r.ok)throw await fU(r,Vt("api.download"));const a=((c=(r.headers.get("content-disposition")??"").match(/filename="([^"]+)"/))==null?void 0:c[1])??"skill.zip",l=URL.createObjectURL(await r.blob());try{const u=document.createElement("a");u.href=l,u.download=a,u.click()}finally{URL.revokeObjectURL(l)}}const $1t={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 F1t(e,t){if(!t||t==="/")return e;const n=t.replace(/^\//,"").split("/").map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"));let i=e;for(const r of n){if(i==null||typeof i!="object")return;i=i[r]}return i}function B1t(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function U1t(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function hU(e,t){if(B1t(e))return F1t(t,e.path);if(U1t(e)){const n=$1t[e.call],i={};for(const[r,s]of Object.entries(e.args??{}))i[r]=hU(s,t);return n?n(i):`[unknown fn: ${e.call}]`}return e}function Q1t(e,t){const n=hU(e,t);return n==null?"":typeof n=="string"?n:String(n)}const zEe=new Map;function s0(e,t){zEe.set(e,t)}function z1t(e){return zEe.get(e)}function V1t(e,t,n){const i=t.replace(/^\//,"").split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let r=e;for(let s=0;shU(i,e.dataModel),resolveString:i=>Q1t(i,e.dataModel),dispatchAction:t,render:i=>{if(!i)return null;const r=e.components[i];if(!r)return null;const s=z1t(r.component)??H1t;return o.jsx(s,{node:r,ctx:n},i)}};return o.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function HEe(e){const t=m.useRef(null),n=m.useRef(!0),i=28,r=m.useCallback(()=>{const s=t.current;s&&(n.current=s.scrollHeight-s.scrollTop-s.clientHeight{const s=t.current;s&&n.current&&(s.scrollTop=s.scrollHeight)},[e]),{ref:t,onScroll:r}}function aI({value:e,skillPrefix:t="/",onRemoveSkill:n,onRemoveAgent:i}){const{t:r}=Ce("conversation");return e.skills.length===0&&!e.targetAgent?null:o.jsxs("div",{className:"invocation-chips","aria-label":r("invocation.ariaLabel"),children:[e.skills.map(s=>o.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:s.description,children:[o.jsx(mS,{"aria-hidden":!0}),o.jsxs("span",{children:[t,s.name]}),n?o.jsx("button",{type:"button",onClick:()=>n(s.name),"aria-label":r("invocation.removeSkill",{name:s.name}),children:o.jsx(Ba,{})}):null]},s.name)),e.targetAgent?o.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[o.jsx(Sbe,{"aria-hidden":!0}),o.jsx("span",{children:e.targetAgent.name}),i?o.jsx("button",{type:"button",onClick:i,"aria-label":r("invocation.removeAgent",{name:e.targetAgent.name}),children:o.jsx(Ba,{})}):null]}):null]})}function pU(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function qEe(e){var n,i,r,s;const t=pU(e.mimeType);return t==="pdf"?"PDF":t==="markdown"?"MD":t==="video"?((i=(n=e.mimeType)==null?void 0:n.split("/")[1])==null?void 0:i.toUpperCase())??"VIDEO":t==="image"?((s=(r=e.mimeType)==null?void 0:r.split("/")[1])==null?void 0:s.toUpperCase())??"IMAGE":"TXT"}function WEe(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function GEe(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?Jbe(t,e.uri):""}function W1t({kind:e}){return e==="image"?o.jsx(LF,{}):e==="video"?o.jsx(Ebe,{}):e==="pdf"?o.jsx(b7e,{}):o.jsx(DF,{})}function oI({appName:e,items:t,compact:n=!1,onRemove:i}){const{t:r}=Ce("conversation"),[s,a]=m.useState(null);return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(l=>{const c=pU(l.mimeType),u=GEe(l,e),d=l.status==="uploading"||l.status==="error"||!u,f=o.jsxs("button",{type:"button",className:"media-card-main",disabled:d,onClick:c==="image"?void 0:()=>a(l),"aria-label":r("media.preview",{name:l.name??r("media.attachment")}),children:[c==="image"&&u?o.jsx("img",{className:"media-card-image",src:u,alt:l.name??r("media.image"),loading:"lazy"}):c==="video"&&u?o.jsxs("div",{className:"media-card-video-container",children:[o.jsx("video",{className:"media-card-video",src:u,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),o.jsx("span",{className:"media-card-video-play",children:o.jsx(_7e,{})})]}):o.jsx("span",{className:"media-card-icon",children:o.jsx(W1t,{kind:c})}),o.jsxs("span",{className:"media-card-copy",children:[o.jsx("span",{className:"media-card-name",children:l.name??r("media.attachment")}),o.jsxs("span",{className:"media-card-meta",children:[o.jsx("span",{className:"media-card-type",children:qEe(l)}),l.status==="uploading"?o.jsxs(o.Fragment,{children:[o.jsx(fi,{className:"media-card-spinner"})," ",r("media.uploading")]}):l.status==="error"?l.error??r("media.uploadFailed"):WEe(l.sizeBytes)]})]}),!n&&l.status!=="uploading"&&l.status!=="error"?o.jsx(Ky,{className:"media-card-open"}):null]});return o.jsxs(pr.div,{className:`media-card media-card--${c}${l.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[c==="image"&&!d?o.jsx(mbe,{src:u,children:f}):f,i?o.jsx("button",{type:"button",className:"media-card-remove","aria-label":r("media.remove",{name:l.name??r("media.attachment")}),onClick:()=>i(l.id),children:o.jsx(Ba,{})}):null]},l.id)})}),o.jsx(Ru,{children:s?o.jsx(G1t,{appName:e,item:s,onClose:()=>a(null)}):null})]})}function G1t({appName:e,item:t,onClose:n}){const{t:i}=Ce("conversation"),r=m.useMemo(()=>GEe(t,e),[e,t]),s=pU(t.mimeType),[a,l]=m.useState(""),[c,u]=m.useState(s==="text"||s==="markdown"),[d,f]=m.useState("");return m.useEffect(()=>{const h=p=>{p.key==="Escape"&&n()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[n]),m.useEffect(()=>{if(s!=="text"&&s!=="markdown")return;const h=new AbortController;return u(!0),f(""),fetch(r,{signal:h.signal}).then(p=>{if(!p.ok)throw new Error(`HTTP ${p.status}`);return p.text()}).then(l).catch(p=>{h.signal.aborted||f(p instanceof Error?p.message:String(p))}).finally(()=>{h.signal.aborted||u(!1)}),()=>h.abort()},[s,r]),o.jsx(pr.div,{className:"media-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":i("media.previewDialog",{name:t.name??i("media.attachment")}),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:h=>{h.target===h.currentTarget&&n()},children:o.jsxs(pr.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??i("media.attachment")}),o.jsxs("span",{children:[qEe(t),t.sizeBytes?` · ${WEe(t.sizeBytes)}`:""]})]}),o.jsxs("nav",{children:[o.jsx("a",{href:r,download:t.name,"aria-label":i("media.download"),children:o.jsx(Yj,{})}),o.jsx("button",{type:"button",onClick:n,"aria-label":i("media.close"),children:o.jsx(Ba,{})})]})]}),o.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?o.jsx("img",{src:r,alt:t.name??i("media.image")}):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,c?o.jsxs("div",{className:"media-viewer-loading",children:[o.jsx(fi,{})," ",i("media.reading")]}):null,!c&&d?o.jsx("div",{className:"media-viewer-loading",children:i("media.loadFailed",{error:d})}):null,!c&&s==="markdown"?o.jsx("div",{className:"media-document",children:o.jsx(Bu,{text:a})}):null,!c&&s==="text"?o.jsx("pre",{className:"media-document media-document--plain",children:a}):null]})]})})}function MY(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 K1t(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 mU(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",{className:"video-generate-icon__body",d:"M3.25 9h17.5v7.35a2.4 2.4 0 0 1-2.4 2.4H5.65a2.4 2.4 0 0 1-2.4-2.4V9Z"}),o.jsxs("g",{className:"video-generate-icon__clapper",children:[o.jsx("path",{d:"M3.25 9V7.65a2.4 2.4 0 0 1 2.4-2.4h12.7a2.4 2.4 0 0 1 2.4 2.4V9H3.25Z"}),o.jsx("path",{d:"M6.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 X1t(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 Y1t(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 Z1t(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 J1t(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 ewt(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 twt(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:"6",cy:"6.25",r:"2.25"}),o.jsx("circle",{cx:"18",cy:"6.25",r:"2.25"}),o.jsx("circle",{cx:"12",cy:"17.75",r:"2.25"}),o.jsx("path",{d:"m7.7 7.75 2.7 7.55M16.3 7.75l-2.7 7.55M8.25 6.25h7.5"})]})}function LY(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:"9",cy:"8",r:"3"}),o.jsx("path",{d:"M3.75 18.75c.45-3.05 2.2-4.65 5.25-4.65s4.8 1.6 5.25 4.65"}),o.jsx("path",{d:"M17.75 4.25v5.5M15 7h5.5M16 13.25h4.25M18.125 11.125v4.25"})]})}function nwt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"4",y:"4.25",width:"16",height:"5",rx:"1.5"}),o.jsx("rect",{x:"4",y:"14.75",width:"16",height:"5",rx:"1.5"}),o.jsx("path",{d:"M7.25 6.75h.01M7.25 17.25h.01M10 6.75h6.5M10 17.25h6.5"})]})}function iwt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M6 3.75h8l4 4v12.5H6V3.75Z"}),o.jsx("path",{d:"M14 3.75v4h4M8.75 11h6.5M8.75 14.25h6.5M8.75 17.5h4"})]})}function $Y(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.75",y:"4.5",width:"16.5",height:"15",rx:"2.5"}),o.jsx("path",{d:"m7.5 9 2.75 2.5L7.5 14M12.5 14h4"}),o.jsx("path",{d:"M3.75 7.5h16.5",opacity:".62"})]})}function gU(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 rwt({definition:e,label:t,done:n,open:i,onToggle:r}){const{t:s}=Ce("conversation"),a=e.icon,l=n?e.doneLabel:e.runningLabel,c=t??s(`blocks.tools.${e.name}.${n?"done":"running"}`,{defaultValue:l});return o.jsxs("button",{type:"button",className:`builtin-tool-head${n?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:r,"aria-expanded":i,children:[o.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:o.jsx(a,{})}),n?o.jsx("span",{className:"builtin-tool-label",children:c}):o.jsx(An,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:c}),o.jsx(gU,{className:`builtin-tool-chevron${i?" is-open":""}`})]})}function cc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Sn(e){return typeof e=="string"?e:""}function FY(e){return typeof e=="number"&&Number.isFinite(e)?e:0}function Vc(e){return Array.isArray(e)?e:[]}function e$(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=cc(t)??{};return cc(n.result)??n}function lI(e){if(typeof e=="string")try{return lI(JSON.parse(e))}catch{return e}const t=cc(e);if(!t)return"";const n=cc(t.result);return Sn(t.error)||Sn(t.message)||Sn(n==null?void 0:n.error)||Sn(n==null?void 0:n.message)}function swt(e){if(e.kind==="tool")return"tool";if(e.kind==="knowledge_base")return"knowledge_base";const t=cc(e.metadata),n=Sn(t==null?void 0:t.source_type).toLowerCase(),i=Sn(e.source).toLowerCase();return n==="skillhub"||i.startsWith("skill_hub:")?"skill_hub":"skill_space"}const KEe={tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknownSource:"Unknown source",unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"};function awt(e,t){return e==="veadk_builtin_tools"?t.tool:e==="agentkit_knowledge"?t.knowledge:e.startsWith("skill_hub:")?`Skill Hub ${e.slice(10)}`:e.startsWith("skill_space:")?`${t.skillCenter} ${e.slice(12)}`:e||t.unknownSource}function owt(e){return e==="veadk_builtin_tools"?"tool":e==="agentkit_knowledge"?"knowledge_base":e.startsWith("skill_hub:")?"skill_hub":"skill_space"}function lwt(e,t=KEe){const n=e$(e),i=cc(n.capabilities)??{},r=Vc(n.resources).flatMap(a=>{const l=cc(a);if(!l)return[];const c=l.kind==="tool"?"tool":l.kind==="knowledge_base"?"knowledge_base":"skill";return[{ref:Sn(l.ref),kind:c,category:swt(l),name:Sn(l.name)||Sn(l.ref)||t.unnamedResource,description:Sn(l.description),source:Sn(l.source),version:Sn(l.version)}]}),s=Vc(n.sources).flatMap(a=>{const l=cc(a);if(!l)return[];const c=Sn(l.source),u=Sn(l.status),d=u==="error"?"error":u==="skipped"?"skipped":"ok";return[{source:c,category:owt(c),label:awt(c,t),status:d,count:FY(l.count),message:Sn(l.message),searchKeywords:Vc(l.search_keywords).map(Sn).filter(Boolean)}]});return{collectionId:Sn(n.collection_id),capabilities:{googleAdkVersion:Sn(i.google_adk_version),agentTypes:Vc(i.agent_types).map(Sn).filter(Boolean),maxOrchestrationDepth:FY(i.max_orchestration_depth)},resources:r,sources:s,counts:{all:r.length,skill_hub:r.filter(a=>a.category==="skill_hub").length,skill_space:r.filter(a=>a.category==="skill_space").length,knowledge_base:r.filter(a=>a.category==="knowledge_base").length,tool:r.filter(a=>a.category==="tool").length}}}function cwt(e,t){return{resources:e.resources.filter(n=>n.category===t),sources:e.sources.filter(n=>n.category===t)}}function XEe(e,t,n=KEe){const i=e$(e),r=e$(t),s=new Map(Vc(r.results).flatMap(d=>{const f=cc(d),h=Sn(f==null?void 0:f.name);return f&&h?[[h,f]]:[]})),a=Vc(i.agents).flatMap(d=>{const f=cc(d),h=Sn(f==null?void 0:f.name);return f&&h?[f]:[]}),l=new Set(a.map(d=>Sn(d.name))),c=[...s.entries()].filter(([d])=>!l.has(d)).map(([d])=>({name:d})),u=[...a,...c].map(d=>{const f=Sn(d.name),h=Vc(d.nodes).flatMap(E=>{const C=cc(E);return C?[C]:[]}),p=Sn(d.root_node),g=h.find(E=>Sn(E.id)===p),b=h.filter(E=>Sn(E.id)!==p).map(E=>({id:Sn(E.id)||n.unnamedAgent,type:Sn(E.type)||"llm",description:Sn(E.description)})),v=s.get(f),y=Sn(v==null?void 0:v.status),x=y==="failed"?"failed":y==="completed"?"completed":"running",O=BY(v==null?void 0:v.resources),w=O.length>0?O:BY(h.flatMap(E=>Vc(E.resources))),k=UY(v==null?void 0:v.python_tools),S=k.length>0?k:UY(h.flatMap(E=>Vc(E.python_tools)));return{name:f,description:Sn(v==null?void 0:v.description)||Sn(g==null?void 0:g.description)||Sn(d.task),task:Sn(d.task),rootType:Sn(v==null?void 0:v.root_type)||Sn(g==null?void 0:g.type)||"llm",nodeCount:h.length,subAgentCount:b.length,resourceCount:w.length,pythonToolCount:S.length,skills:w.filter(E=>E.kind==="skill"),knowledgeBases:w.filter(E=>E.kind==="knowledge_base"),builtinTools:w.filter(E=>E.kind==="tool"),pythonTools:S,subAgents:b,status:x,output:Sn(v==null?void 0:v.output),error:Sn(v==null?void 0:v.error)}});return{collectionId:Sn(r.collection_id)||Sn(i.collection_id),agents:u,completedCount:u.filter(d=>d.status==="completed").length,failedCount:u.filter(d=>d.status==="failed").length,runningCount:u.filter(d=>d.status==="running").length}}function uwt(e,t){return!!lI(t)||XEe(e,t).failedCount>0}function BY(e){const t=new Set;return Vc(e).flatMap(n=>{const i=cc(n),r=Sn(i?i.ref:n);if(!r||t.has(r))return[];t.add(r);const s=Sn(i==null?void 0:i.kind),a=s==="tool"||r.startsWith("veadk_tool:")?"tool":s==="knowledge_base"||r.startsWith("agentkit_kb:")?"knowledge_base":"skill",l=r.split(":");return[{ref:r,kind:a,name:Sn(i==null?void 0:i.name)||l[l.length-1]||r,description:Sn(i==null?void 0:i.description),version:Sn(i==null?void 0:i.version),source:Sn(i==null?void 0:i.source)}]})}function UY(e){const t=new Set;return Vc(e).flatMap(n=>{const i=cc(n),r=Sn(i==null?void 0:i.name),s=Sn(i==null?void 0:i.code),a=`${r}\0${s}`;return!i||!r||t.has(a)?[]:(t.add(a),[{name:r,description:Sn(i.description),code:s,entrypoint:Sn(i.entrypoint)||r,dependencies:Vc(i.dependencies).map(Sn).filter(Boolean)}])})}function dwt({branch:e}){return o.jsxs("div",{className:`branch-compare__body${e.status==="running"?" is-streaming":""}`,"aria-live":"polite",children:[e.content?o.jsx(Bu,{text:e.content,streaming:e.status==="running"}):null,e.status==="running"?o.jsx("span",{className:"branch-compare__caret","aria-hidden":"true"}):null,e.error?o.jsx("p",{className:"branch-compare__error",children:e.error}):null]})}function fwt({args:e,response:t,status:n,onBranchSelect:i}){const{t:r}=Ce("conversation"),s=m.useMemo(()=>pye(e,t,n),[e,t,n]),[a,l]=m.useState(0);return o.jsxs("section",{className:"branch-compare","aria-label":r("blocks.branchCompare.ariaLabel"),children:[o.jsx("div",{className:"branch-compare__tabs",role:"tablist","aria-label":r("blocks.branchCompare.selectDirection"),children:s.branches.map((c,u)=>o.jsx("button",{className:`branch-compare__tab${a===u?" is-active":""}`,type:"button",role:"tab","aria-selected":a===u,"aria-controls":`branch-compare-panel-${u}`,onClick:()=>l(u),children:o.jsx(ba,{color:"info",size:"sm",variant:"soft",children:c.label})},`${c.label}:${u}`))}),o.jsx("div",{className:"branch-compare__branches",children:s.branches.map((c,u)=>o.jsxs("article",{className:`branch-compare__branch${a===u?" is-active":""}`,id:`branch-compare-panel-${u}`,role:"tabpanel",children:[o.jsx("header",{className:"branch-compare__head",children:o.jsx(ba,{color:"info",size:"sm",variant:"soft",children:c.label})}),o.jsx(dwt,{branch:c}),o.jsx("footer",{className:"branch-compare__footer",children:o.jsx(Wt,{type:"button",color:"info",variant:"ghost",size:"sm",pill:!1,disabled:c.status!=="completed",onClick:()=>i==null?void 0:i(c),children:r("blocks.branchCompare.continue")})})]},`${c.label}:${u}`))})]})}function YEe({controlled:e,default:t,name:n,state:i="value"}){const{current:r}=m.useRef(e!==void 0),[s,a]=m.useState(t),l=r?e:s,c=m.useCallback(u=>{r||a(u)},[]);return[l,c]}const bU={...Fb},QY={};function Ab(e,t){const n=m.useRef(QY);return n.current===QY&&(n.current=e(t)),n}const HM=bU.useInsertionEffect,hwt=HM&&HM!==bU.useLayoutEffect?HM:e=>e();function Xa(e){const t=Ab(pwt).current;return t.next=e,hwt(t.effect),t.trampoline}function pwt(){const e={next:void 0,callback:mwt,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function mwt(){}const gwt=()=>{},bl=typeof document<"u"?m.useLayoutEffect:gwt,ZEe=m.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function bwt(){return m.useContext(ZEe)}function ywt(e){const{children:t,elementsRef:n,labelsRef:i,onMapChange:r}=e,s=Xa(r),[,a]=m.useState(!1),l=Ab(xwt).current,c=Ab(vwt).current,u=m.useRef(0),d=m.useRef(!0),f=m.useRef([]),h=m.useRef(null),p=Xa(()=>{d.current||(d.current=!0,a(k=>!k))}),g=Xa((k,S)=>{c.set(k,S),p()}),b=Xa(k=>{c.delete(k),p()}),v=Xa(k=>{const S=new Map;return n.current.length=0,i&&(i.current.length=0),k.forEach(E=>{var C,N;S.set(E.element,{...E.registration.metadata??{},index:E.index}),n.current[E.index]=E.element,i&&(i.current[E.index]=E.registration.label!==void 0?E.registration.label:((N=(C=E.registration.textRef)==null?void 0:C.current)==null?void 0:N.textContent)??E.element.textContent)}),u.current=n.current.length,S});function y(k){var C;if((C=h.current)==null||C.disconnect(),h.current=null,typeof MutationObserver!="function"||k.length<2)return;const S=new MutationObserver(N=>{if(!Swt(N))return;let _=null;for(const j of k)if(j.isConnected){if(_&&JEe(_,j)>0){S.disconnect(),p();return}_=j}});h.current=S;const E=new Set;for(let N=1;NS.observe(N,{childList:!0}))}const x=Xa(()=>{const[k,S]=wwt(c),E=v(k);y(S),f.current=k,d.current=!1,l.forEach(C=>C(E)),s(E)});bl(()=>(d.current||v(f.current),()=>{n.current=[],i&&(i.current=[])}),[n,i,v]),bl(()=>{d.current&&x()}),bl(()=>()=>{var k;(k=h.current)==null||k.disconnect(),d.current=!0},[]);const O=Xa(k=>(l.add(k),()=>{l.delete(k)})),w=m.useMemo(()=>({register:g,unregister:b,subscribeMapChange:O,nextIndexRef:u}),[g,b,O,u]);return o.jsx(ZEe.Provider,{value:w,children:t})}function vwt(){return new Map}function xwt(){return new Set}function wwt(e){const t=new Set,n=[],i=[];e.forEach((s,a)=>{if(!a.isConnected)return;const l=s.index,c={index:l??-1,element:a,registration:s};l===null?i.push(c):l>=0&&(t.add(l),n.push(c))});let r=0;return i.sort((s,a)=>JEe(s.element,a.element)),i.forEach(s=>{for(;t.has(r);)r+=1;s.index=r,n.push(s),r+=1}),t.size>0&&n.sort((s,a)=>s.index-a.index),[n,i.map(s=>s.element)]}function Owt(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function Swt(e){for(const t of e)for(let n=0;ns.searchParams.append("args[]",a)),`${t} error #${i}; visit ${s} for the full message.`}}const EE=kwt("https://base-ui.com/production-error","Base UI"),eCe=m.createContext(void 0);function tCe(){const e=m.useContext(eCe);if(e===void 0)throw new Error(EE(10));return e}function ON(e,t,n,i){const r=Ab(nCe).current;return Cwt(r,e,t,n,i)&&iCe(r,[e,t,n,i]),r.callback}function Ewt(e){const t=Ab(nCe).current;return Twt(t,e)&&iCe(t,e),t.callback}function nCe(){return{callback:null,cleanup:null,refs:[]}}function Cwt(e,t,n,i,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==i||e.refs[3]!==r}function Twt(e,t){return e.refs.length!==t.length||e.refs.some((n,i)=>n!==t[i])}function iCe(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const i=Array(t.length).fill(null);for(let r=0;r{for(let r=0;r=e}function zY(e){if(!m.isValidElement(e))return null;const t=e,n=t.props;return(_wt(19)?n==null?void 0:n.ref:t.ref)??null}function t$(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const Nwt=Object.freeze([]),Ry=Object.freeze({});function jwt(e,t){const n={};for(const i in e){const r=e[i];if(t!=null&&t.hasOwnProperty(i)){const s=t[i](r);s!=null&&Object.assign(n,s);continue}r===!0?n[`data-${i.toLowerCase()}`]="":r&&(n[`data-${i.toLowerCase()}`]=r.toString())}return n}function Rwt(e,t){return typeof e=="function"?e(t):e}function rCe(e,t){return typeof e=="function"?e(t):e}const yU={};function vU(e,t,n,i,r){if(!n&&!i&&!e)return SN(t);let s=SN(e);return t&&(s=OA(s,t)),n&&(s=OA(s,n)),i&&(s=OA(s,i)),s}function Iwt(e){if(e.length===0)return yU;if(e.length===1)return SN(e[0]);let t=SN(e[0]);for(let n=1;n=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function xU(e){return typeof e=="function"}function aCe(e,t){return xU(e)?e(t):e??yU}function Mwt(e,t){return t?e?(...n)=>{const i=n[0];if(cCe(i)){const s=i;kN(s);const a=t(...n);return s.baseUIHandlerPrevented||e==null||e(...n),a}const r=t(...n);return e==null||e(...n),r}:oCe(t):e}function oCe(e){return e&&((...t)=>{const n=t[0];return cCe(n)&&kN(n),e(...t)})}function kN(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function lCe(e,t){return t?e?t+" "+e:t:e}function cCe(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function CE(e,t,n={}){const i=t.render,r=Lwt(t,n);if(n.enabled===!1)return null;const s=n.state??Ry;return Bwt(e,i,r,s)}function Lwt(e,t={}){const{className:n,style:i,render:r}=e,{state:s=Ry,ref:a,props:l,stateAttributesMapping:c,enabled:u=!0}=t,d=u?Rwt(n,s):void 0,f=u?rCe(i,s):void 0,h=u?jwt(s,c):Ry,p=u&&l?$wt(l):void 0,g=u?t$(h,p)??{}:Ry;return typeof document<"u"&&(u?Array.isArray(a)?g.ref=Ewt([g.ref,zY(r),...a]):g.ref=ON(g.ref,zY(r),a):ON(null,null)),u?(d!==void 0&&(g.className=lCe(g.className,d)),f!==void 0&&(g.style=t$(g.style,f)),g):Ry}function $wt(e){return Array.isArray(e)?Iwt(e):vU(void 0,e)}const Fwt=Symbol.for("react.lazy");function Bwt(e,t,n,i){if(t){if(typeof t=="function")return t(n,i);const r=vU(n,t.props);r.ref=n.ref;let s=t;return(s==null?void 0:s.$$typeof)===Fwt&&(s=m.Children.toArray(t)[0]),m.cloneElement(s,r)}if(e&&typeof e=="string")return Uwt(e,n);throw new Error(EE(8))}function Uwt(e,t){return e==="button"?m.createElement("button",{type:"button",...t,key:t.key}):e==="img"?m.createElement("img",{alt:"",...t,key:t.key}):m.createElement(e,t)}const Qwt={value:()=>null},uCe=m.forwardRef(function(t,n){const{render:i,className:r,disabled:s=!1,hiddenUntilFound:a,keepMounted:l,loopFocus:c,onValueChange:u,multiple:d=!1,orientation:f="vertical",value:h,defaultValue:p,style:g,...b}=t,v=m.useMemo(()=>{if(h===void 0)return p??[]},[h,p]),y=m.useRef([]),[x,O]=YEe({controlled:h,default:v,name:"Accordion",state:"value"}),w=Xa((C,N,_)=>{if(d)if(N){const j=x.slice();if(j.push(C),u==null||u(j,_),_.isCanceled)return;O(j)}else{const j=x.filter(A=>A!==C);if(u==null||u(j,_),_.isCanceled)return;O(j)}else{const j=x[0]===C?[]:[C];if(u==null||u(j,_),_.isCanceled)return;O(j)}}),k=m.useMemo(()=>({value:x,disabled:s,orientation:f}),[x,s,f]),S=m.useMemo(()=>({disabled:s,handleValueChange:w,hiddenUntilFound:a??!1,keepMounted:l??!1,state:k,value:x}),[s,w,a,l,k,x]),E=CE("div",t,{state:k,ref:n,props:b,stateAttributesMapping:Qwt});return o.jsx(eCe.Provider,{value:S,children:o.jsx(ywt,{elementsRef:y,children:E})})});let VY=0;function zwt(e,t="mui"){const[n,i]=m.useState(e),r=e||n;return m.useEffect(()=>{n==null&&(VY+=1,i(`${t}-${VY}`))},[n,t]),r}const HY=bU.useId;function Vwt(e,t){if(HY!==void 0){const n=HY();return`${t}-${n}`}return zwt(e,t)}function n$(e){return Vwt(e,"base-ui")}const Hwt="none",qwt="trigger-press";function dCe(e,t,n,i){let r=!1,s=!1;const a=Ry;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...a}}function Wwt(e){m.useEffect(e,Nwt)}const MT=null;let Gwt=class{constructor(){ki(this,"callbacks",[]);ki(this,"callbacksCount",0);ki(this,"nextId",1);ki(this,"startId",1);ki(this,"isScheduled",!1);ki(this,"tick",t=>{var r;this.isScheduled=!1;const n=this.callbacks,i=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,i>0)for(let s=0;s=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}},LT=new Gwt;class Kl{constructor(){ki(this,"currentId",MT);ki(this,"cancel",()=>{this.currentId!==MT&&(LT.cancel(this.currentId),this.currentId=MT)});ki(this,"disposeEffect",()=>this.cancel)}static create(){return new Kl}static request(t){return LT.request(t)}static cancel(t){return LT.cancel(t)}request(t){this.cancel(),this.currentId=LT.request(()=>{this.currentId=MT,t()})}}function Kwt(){const e=Ab(Kl.create).current;return Wwt(e.disposeEffect),e}function Xwt(e,t=!1,n=!1){const[i,r]=m.useState(e&&t?"idle":void 0),[s,a]=m.useState(e);return e&&!s&&(a(!0),r("starting")),!e&&s&&i!=="ending"&&!n&&r("ending"),!e&&!s&&i==="ending"&&r(void 0),bl(()=>{if(!e&&s&&i!=="ending"&&n){const l=Kl.request(()=>{r("ending")});return()=>{Kl.cancel(l)}}},[e,s,i,n]),bl(()=>{if(!e||t)return;const l=Kl.request(()=>{r(void 0)});return()=>{Kl.cancel(l)}},[t,e]),bl(()=>{if(!e||!t)return;e&&s&&i!=="idle"&&r("starting");const l=Kl.request(()=>{r("idle")});return()=>{Kl.cancel(l)}},[t,e,s,i]),{mounted:s,setMounted:a,transitionStatus:i}}function Ywt(e){const{open:t,defaultOpen:n,onOpenChange:i,disabled:r}=e,[s,a]=YEe({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:l,setMounted:c,transitionStatus:u}=Xwt(s,!0,!0),d=n$(),[f,h]=m.useState(),p=f===null?void 0:f??d,g=Xa(b=>{const v=!s,y=dCe(qwt,b.nativeEvent);i(v,y),!y.isCanceled&&a(v)});return m.useMemo(()=>({defaultPanelId:d,disabled:r,handleTrigger:g,mounted:l,open:s,panelId:p,setMounted:c,setOpen:a,setPanelIdState:h,transitionStatus:u}),[d,r,g,l,s,p,c,a,h,u])}const fCe=m.createContext(void 0);function hCe(){const e=m.useContext(fCe);if(e===void 0)throw new Error(EE(15));return e}function Zwt(e={}){const{guess:t,label:n,metadata:i,textRef:r,index:s}=e,{register:a,unregister:l,subscribeMapChange:c,nextIndexRef:u}=bwt(),d=m.useRef(-1),[f,h]=m.useState(s==null&&t?()=>{if(d.current===-1){const v=u.current;u.current+=1,d.current=v}return d.current}:-1),p=s??f,g=m.useRef(null),b=m.useCallback(v=>{const y=g.current;y&&l(y),g.current=v,v&&a(v,{metadata:i??null,index:s??null,label:n,textRef:r})},[s,a,l,i,n,r]);return bl(()=>{if(s==null)return c(v=>{var x;const y=g.current?(x=v.get(g.current))==null?void 0:x.index:null;y!=null&&h(y)})},[s,c]),{ref:b,index:p}}const pCe=m.createContext(void 0);function wU(){const e=m.useContext(pCe);if(e===void 0)throw new Error(EE(9));return e}let qY=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const Jwt={"data-starting-style":""},eOt={"data-ending-style":""},tOt={transitionStatus(e){return e==="starting"?Jwt:e==="ending"?eOt:null}};let OU=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=qY.startingStyle]="startingStyle",e[e.endingStyle=qY.endingStyle]="endingStyle",e}({}),nOt=function(e){return e.panelOpen="data-panel-open",e}({});const iOt={[OU.open]:""},rOt={[OU.closed]:""},sOt={open(e){return e?{[nOt.panelOpen]:""}:null}},aOt={open(e){return e?iOt:rOt}};let oOt=function(e){return e.index="data-index",e.disabled="data-disabled",e.open="data-open",e}({});const SU={...aOt,index:e=>({[oOt.index]:String(e)}),...tOt,value:()=>null},mCe=m.forwardRef(function(t,n){const{className:i,disabled:r=!1,onOpenChange:s,render:a,value:l,style:c,...u}=t,{ref:d,index:f}=Zwt(),h=ON(n,d),{disabled:p,handleValueChange:g,state:b,value:v}=tCe(),y=n$(),x=l??y,O=r||p,w=v.indexOf(x)!==-1,k=Xa((R,L)=>{s==null||s(R,L),!L.isCanceled&&g(x,R,L)}),S=Ywt({open:w,onOpenChange:k,disabled:O}),E=m.useMemo(()=>({open:S.open,disabled:S.disabled,transitionStatus:S.transitionStatus}),[S.open,S.disabled,S.transitionStatus]),C=m.useMemo(()=>({...S,onOpenChange:k,state:E}),[S,E,k]),N=m.useMemo(()=>({...b,hidden:!w&&!S.mounted,index:f,disabled:O,open:w}),[S.mounted,O,f,w,b]),_=n$(),[j,A]=m.useState(),F=j===null?void 0:j??_,T=m.useMemo(()=>({defaultTriggerId:_,open:w,state:N,setTriggerId:A,triggerId:F}),[_,w,N,A,F]),P=CE("div",t,{state:N,ref:h,props:u,stateAttributesMapping:SU});return o.jsx(fCe.Provider,{value:C,children:o.jsx(pCe.Provider,{value:T,children:P})})}),gCe=m.forwardRef(function(t,n){const{render:i,className:r,style:s,...a}=t,{state:l}=wU();return CE("h3",t,{state:l,ref:n,props:a,stateAttributesMapping:SU})}),lOt=m.createContext(void 0);function cOt(e=!1){const t=m.useContext(lOt);if(t===void 0&&!e)throw new Error(EE(16));return t}function uOt(e){const{focusableWhenDisabled:t,disabled:n,composite:i=!1,tabIndex:r=0,isNativeButton:s}=e,a=i&&t!==!1,l=i&&t===!1;return{props:m.useMemo(()=>{const u={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return i||(u.tabIndex=r,!s&&n&&(u.tabIndex=t?r:-1)),(s&&(t||a)||!s&&n)&&(u["aria-disabled"]=n),s&&(!t||l)&&(u.disabled=n),u},[i,n,t,a,l,s,r])}}function qM(e,t,{detail:n=0}={}){e.dispatchEvent(new(bo(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function dOt(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:i=0,native:r=!0,composite:s}=e,a=m.useRef(null),l=cOt(!0),c=s??l!==void 0,{props:u}=uOt({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:i,isNativeButton:r}),d=m.useCallback(()=>{const p=a.current;WM(p)&&c&&t&&u.disabled===void 0&&p.disabled&&(p.disabled=!1)},[t,u.disabled,c]);bl(d,[d]);const f=m.useCallback((p={})=>{const{onClick:g,onMouseDown:b,onKeyUp:v,onKeyDown:y,onPointerDown:x,...O}=p;return vU({onClick(w){if(t){w.preventDefault();return}g==null||g(w)},onMouseDown(w){t||b==null||b(w)},onKeyDown(w){if(t||(kN(w),y==null||y(w),w.baseUIHandlerPrevented))return;const k=w.target===w.currentTarget,S=w.currentTarget,E=WM(S),C=!r&&fOt(S),N=k&&(r?E:!C),_=w.key==="Enter",j=w.key===" ",A=S.getAttribute("role"),F=(A==null?void 0:A.startsWith("menuitem"))||A==="option"||A==="gridcell";if(k&&c&&j){if(w.defaultPrevented&&F)return;w.preventDefault(),(!r||E)&&(w.preventBaseUIHandler(),qM(S,w));return}if(!N||r||!j&&!_){k&&C&&j&&w.preventDefault();return}w.defaultPrevented||(w.preventDefault(),_&&(w.preventBaseUIHandler(),qM(S,w)))},onKeyUp(w){if(!t){if(kN(w),v==null||v(w),w.target===w.currentTarget&&r&&c&&WM(w.currentTarget)&&w.key===" "){w.preventDefault();return}w.baseUIHandlerPrevented||w.target===w.currentTarget&&!r&&!c&&!w.defaultPrevented&&w.key===" "&&(w.preventBaseUIHandler(),qM(w.currentTarget,w))}},onPointerDown(w){if(t){w.preventDefault();return}x==null||x(w)}},r?{type:"button"}:{role:"button"},u,O)},[t,u,c,r]),h=Xa(p=>{a.current=p,d()});return{getButtonProps:f,buttonRef:h}}function WM(e){return Kd(e)&&e.tagName==="BUTTON"}function fOt(e){return Kd(e)&&e.tagName==="A"&&!!e.href}const bCe=m.forwardRef(function(t,n){const{disabled:i,className:r,id:s,render:a,nativeButton:l=!0,style:c,...u}=t,{panelId:d,open:f,handleTrigger:h,disabled:p}=hCe(),g=i||p,{getButtonProps:b,buttonRef:v}=dOt({disabled:g,focusableWhenDisabled:!0,native:l}),{defaultTriggerId:y,state:x,setTriggerId:O}=wU(),w=s||void 0,k=w??y;return bl(()=>(O(C=>w??(C===null?void 0:C)),()=>{O(C=>C===w?null:C)}),[w,O]),CE("button",t,{state:x,ref:[n,v],props:[{"aria-controls":f?d:void 0,"aria-expanded":f,id:k,onClick:h},u,b],stateAttributesMapping:sOt})});function hOt(e,t,n,i){return e.addEventListener(t,n,i),()=>{e.removeEventListener(t,n,i)}}function pOt(e){const t=Ab(mOt,e).current;return t.next=e,bl(t.effect),t}function mOt(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function gOt(e){return e==null?e:"current"in e?e.current:e}function yCe(e,t=!1){const n=Kwt();return Xa((i,r=null)=>{n.cancel();const s=gOt(e);if(s==null)return;const a=s,l=()=>{Li.flushSync(i)};if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function c(){Promise.all(a.getAnimations().map(u=>u.finished)).then(()=>{r!=null&&r.aborted||l()},()=>{if(r!=null&&r.aborted)return;if(a.getAnimations().some(d=>d.pending||d.playState!=="finished")){c();return}l()})}if(t){const u="data-starting-style";if(!a.hasAttribute(u)){n.request(c);return}const d=new MutationObserver(()=>{a.hasAttribute(u)||(d.disconnect(),c())});d.observe(a,{attributes:!0,attributeFilter:[u]}),r==null||r.addEventListener("abort",()=>d.disconnect(),{once:!0});return}n.request(c)})}function bOt(e){const{enabled:t=!0,open:n,ref:i,onComplete:r}=e,s=Xa(r),a=yCe(i,n);m.useEffect(()=>{if(!t)return;const l=new AbortController;return a(s,l.signal),()=>{l.abort()}},[t,n,s,a])}const K1={height:void 0,width:void 0};function yOt(e){const{externalRef:t,hiddenUntilFound:n,id:i,keepMounted:r,mounted:s,onOpenChange:a,open:l,setMounted:c,setOpen:u,transitionStatus:d}=e,f=m.useRef(null),h=m.useRef(null),[p,g]=m.useState(K1),b=m.useRef(K1),v=m.useRef(!1),y=m.useRef(l),x=m.useRef(!1),[O,w]=m.useState(!1),k=m.useRef(null),S=ON(t,f),E=pOt(l),C=yCe(f),N=!l&&!s,_=O?"idle":d,j=l&&(y.current||x.current),A=!l&&s&&h.current==="css-animation"&&p.height===void 0&&p.width===void 0?b.current:p,F=n&&N&&h.current!=="css-animation",T=Xa((U,I=!0)=>{I&&(b.current=U),g(U)}),P=Xa(()=>{var U;(U=k.current)==null||U.call(k),k.current=null}),R=Xa(U=>{P(),k.current=()=>{k.current=null,U()}}),L=Xa(()=>{l&&s&&h.current==="css-animation"&&(x.current=!0)});bl(()=>{!O||d==="starting"||w(!1)},[O,d]),m.useEffect(()=>()=>{L(),P()},[L,P]),bl(()=>{const U=f.current;if(!U)return;!l&&k.current&&P();const I=vOt(U,j);if(h.current=I,l&&d==="idle"&&y.current&&I==="css-animation"){b.current=F0(U);return}if(l&&d==="starting"){const Q=v.current;if(v.current=!1,I==="none"){T(F0(U)),w(!0);return}if(I==="css-transition"){const te=xOt(U);if(T(F0(U)),!Q)return te;const ce=$T(U,"transition-duration","0s");return R(ce),w(!0),te}T(F0(U));const q=$T(U,"animation-name","none");if(!Q){q();return}const B=$T(U,"animation-duration","0s");q(),R(B),w(!0);return}if(!l&&s&&(d==="idle"||d==="starting")){if(y.current=!1,x.current=!1,I==="none"){T(K1,!1),c(!1);return}T(F0(U));return}if(d!=="ending")return;if(I==="none"){c(!1);return}const H=F0(U);if(!(H.height>0||H.width>0)){c(!1);return}T(H),I==="css-animation"&&$T(U,"animation-name","none")()},[s,l,P,T,c,R,j,d]),bOt({enabled:l&&s&&_==="idle",open:!0,ref:f,onComplete(){l&&T(K1,!1)}}),m.useEffect(()=>{if(l||!s||_!=="ending"||!f.current)return;const I=new AbortController;let H=-1;function Z(){E.current||(c(!1),T(K1,!1))}return H=Kl.request(()=>{C(Z,I.signal)}),()=>{Kl.cancel(H),I.abort()}},[E,s,l,_,C,T,c]),bl(()=>{const U=f.current;!U||!n||!N||U.setAttribute("hidden","until-found")},[N,n]),m.useEffect(function(){const I=f.current;if(!I)return;function H(Z){const Q=dCe(Hwt,Z);a(!0,Q),!Q.isCanceled&&(v.current=!0,u(!0))}return hOt(I,"beforematch",H)},[a,u]);const M=r||n||s||l;return{height:A.height,props:{...F?{[OU.startingStyle]:""}:void 0,hidden:N,id:i},ref:S,shouldPreventOpenAnimation:j,shouldRender:M,transitionStatus:_,width:A.width}}function F0(e){return{height:e.scrollHeight,width:e.scrollWidth}}function vOt(e,t){const n=bo(e).getComputedStyle(e),i=(n.animationName.split(",").map(s=>s.trim()).some(s=>s!==""&&s!=="none")||t)&&WY(n.animationDuration),r=WY(n.transitionDuration);return i&&r||r?"css-transition":i?"css-animation":"none"}function WY(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function $T(e,t,n){const i=e.style.getPropertyValue(t),r=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(i===""){e.style.removeProperty(t);return}e.style.setProperty(t,i,r)}}function xOt(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(r=>{e.style.setProperty(r,"initial","important")});function n(){Object.entries(t).forEach(([r,s])=>{if(s===""){e.style.removeProperty(r);return}e.style.setProperty(r,s)})}const i=Kl.request(n);return()=>{Kl.cancel(i),n()}}let GY=function(e){return e.accordionPanelHeight="--accordion-panel-height",e.accordionPanelWidth="--accordion-panel-width",e}({});const vCe=m.forwardRef(function(t,n){const{className:i,hiddenUntilFound:r,keepMounted:s,id:a,render:l,style:c,...u}=t,{hiddenUntilFound:d,keepMounted:f}=tCe(),{defaultPanelId:h,mounted:p,onOpenChange:g,open:b,setMounted:v,setOpen:y,setPanelIdState:x,transitionStatus:O}=hCe(),w=r??d,k=s??f,S=a||void 0,E=a??h;bl(()=>(x(I=>S??(I===null?void 0:I)),()=>{x(I=>I===S?null:I)}),[S,x]);const{height:C,props:N,ref:_,shouldPreventOpenAnimation:j,shouldRender:A,transitionStatus:F,width:T}=yOt({externalRef:n,hiddenUntilFound:w,id:E,keepMounted:k,mounted:p,onOpenChange:g,open:b,setMounted:v,setOpen:y,transitionStatus:O}),{state:P,triggerId:R}=wU(),L={...P,transitionStatus:F},M=rCe(c,L),U=CE("div",{...t,style:void 0},{state:L,ref:_,props:[N,{"aria-labelledby":R,role:"region",style:{[GY.accordionPanelHeight]:C===void 0?"auto":`${C}px`,[GY.accordionPanelWidth]:T===void 0?"auto":`${T}px`}},u,M?{style:M}:void 0,j?{style:{animationName:"none"}}:void 0],stateAttributesMapping:SU});return A?U:null}),wOt=(e,t)=>{const n=e.currentTarget,i={x:e.clientX,y:e.clientY},r=OOt(i,n.getBoundingClientRect()),s=SOt(i,r),a=kOt(t.getBoundingClientRect());return COt([...s,...a])};function OOt(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,i,r,s)){case s:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function SOt(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}function kOt(e){const{top:t,right:n,bottom:i,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:i},{x:r,y:i}]}function EOt(e,t){const{x:n,y:i}=e;let r=!1;for(let s=0,a=t.length-1;si!=h>i&&n<(f-u)*(i-d)/(h-d)+u&&(r=!r)}return r}function COt(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),TOt(t)}function TOt(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const AOt="_Transition_1wdpp_1",_Ot="_Popover_1wdpp_3",xCe={Transition:AOt,Popover:_Ot},wCe=m.createContext(null),cI=()=>{const e=m.use(wCe);if(!e)throw new Error("Popover components must be wrapped in ");return e},im=({open:e,onOpenChange:t,showOnHover:n=!1,hoverOpenDelay:i=150,children:r})=>{const[s,a]=m.useState(!1),[l,c]=m.useState(!1),u=m.useRef(null),d=m.useRef(null),f=m.useRef(void 0),h=m.useRef(!1),p=m.useRef(!1),g=e??s,[b,v]=m.useState(!1);a7(()=>v(!1),b?500:null);const y=xm(t),x=xm(E=>{var C,N;clearTimeout(f.current),g!==E&&(E||(c(!1),n&&h.current&&((C=u.current)==null||C.focus()),h.current=!1),(N=y.current)==null||N.call(y,E),a(E),n&&v(E))}),O=m.useCallback(E=>{x.current(E)},[x]),w=m.useCallback(()=>{f.current=setTimeout(()=>O(!0),i)},[O,i]),k=m.useCallback(()=>{clearTimeout(f.current)},[]);m.useEffect(()=>()=>{clearTimeout(f.current)},[]);const S=m.useMemo(()=>({open:g,setOpen:O,shake:l,setShake:c,showOnHover:n,temporarilyPreventClickToClose:b,onTriggerEnter:w,onTriggerLeave:k,isPointerInTransitRef:p,triggerRef:u,contentRef:d,hoverOpenFocusedWithTab:h}),[g,O,l,c,n,b,h,p,w,k]);return o.jsx(wCe,{value:S,children:o.jsx(fxe,{open:g,onOpenChange:O,modal:!1,children:r})})},NOt=({children:e,onPointerDown:t,onClick:n})=>{const{setOpen:i,showOnHover:r,temporarilyPreventClickToClose:s,onTriggerEnter:a,onTriggerLeave:l,isPointerInTransitRef:c,triggerRef:u,contentRef:d}=cI(),f=m.useRef(!1),h=b=>{!(b.currentTarget.nodeName.toLocaleLowerCase()==="a")&&s&&(b.preventDefault(),b.stopPropagation())},p=b=>{b.pointerType!=="touch"&&!f.current&&!c.current&&(a(),f.current=!0)},g=()=>{f.current&&(l(),f.current=!1)};return o.jsx(hxe,{asChild:!0,ref:u,onPointerDown:b=>{h(b),t==null||t(b)},onClick:b=>{h(b),n==null||n(b)},onPointerMove:r?p:void 0,onPointerLeave:r?g:void 0,onFocus:r?()=>i(!0):void 0,onBlur:r?()=>{setTimeout(()=>{var b;(b=d.current)!=null&&b.contains(document.activeElement)||i(!1)},50)}:void 0,children:e})},OCe=({children:e,avoidCollisions:t,width:n,minWidth:i,maxWidth:r,side:s,sideOffset:a=8,align:l,alignOffset:c,translucent:u,className:d,autoFocus:f=!0})=>{const{showOnHover:h,shake:p,contentRef:g}=cI(),b=v=>{const y=g.current;if(y&&v.target===y&&v.key==="Tab"&&v.shiftKey){v.preventDefault(),v.stopPropagation();const x=Tye(y),O=x[x.length-1];O==null||O.focus()}};return m.useEffect(()=>{const v=g.current;!v||!f||v!=null&&v.contains(document.activeElement)||h||v.focus({preventScroll:!0})},[g,h,f]),o.jsx(mxe,{forceMount:!0,ref:g,className:pi(xCe.Popover,d),style:Wb({"popover-width":n,"popover-min-width":i,"popover-max-width":r}),onCloseAutoFocus:h?ih:void 0,"data-animate":p?"shake":void 0,"data-translucent":u?"true":void 0,side:s,sideOffset:a,align:l,alignOffset:c??(l==="center"?0:-5),avoidCollisions:t??!0,hideWhenDetached:!0,collisionPadding:20,onOpenAutoFocus:ih,onEscapeKeyDown:ih,onKeyDown:b,children:e})},jOt=e=>{const{setOpen:t,triggerRef:n,contentRef:i,isPointerInTransitRef:r,hoverOpenFocusedWithTab:s}=cI(),[a,l]=m.useState(null),c=m.useCallback(()=>{l(null),r.current=!1},[r]),u=m.useCallback((d,f)=>{const h=wOt(d,f);l(h),r.current=!0},[r]);return m.useEffect(()=>()=>c(),[c]),m.useEffect(()=>{const d=n.current,f=i.current;if(!d||!f)return;const h=g=>u(g,f),p=g=>u(g,d);return d.addEventListener("pointerleave",h),f.addEventListener("pointerleave",p),()=>{d.removeEventListener("pointerleave",h),f.removeEventListener("pointerleave",p)}},[i,n,u,c]),m.useEffect(()=>{if(!a)return;const d=f=>{const h=n.current,p=i.current,g=f.target,b={x:f.clientX,y:f.clientY},v=(h==null?void 0:h.contains(g))||(p==null?void 0:p.contains(g)),y=!EOt(b,a),x=g.hasAttribute("aria-haspopup");v?c():(y||x)&&(c(),t(!1))};return document.addEventListener("pointermove",d),()=>document.removeEventListener("pointermove",d)},[a,t,c,n,i]),m.useEffect(()=>{const d=f=>{if(i.current&&f.key==="Tab"&&!f.shiftKey){const[h]=Tye(i.current);h&&(f.preventDefault(),h.focus(),s.current=!0,document.removeEventListener("keydown",d))}};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[i,s]),o.jsx(OCe,{...e})},ROt=e=>{const{open:t,showOnHover:n,setOpen:i}=cI();return Yk(t,()=>{i(!1)}),o.jsx(pxe,{forceMount:!0,children:o.jsx(Lx,{enterDuration:600,exitDuration:300,className:xCe.Transition,disableAnimations:!0,children:t&&(n?o.jsx(jOt,{...e},"popover-hover"):o.jsx(OCe,{...e},"popover"))})})};im.Trigger=NOt;im.Content=ROt;const IOt=["skill_hub","skill_space","knowledge_base","tool"];function SCe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m4 6 4 4 4-4"})})}function kCe({label:e}){return o.jsx("div",{className:"create-agent-card__loading",role:"status","aria-label":e,children:[0,1,2].map(t=>o.jsxs("div",{className:"create-agent-card__skeleton-row","aria-hidden":"true",children:[o.jsx("span",{}),o.jsx("span",{})]},t))})}function POt(e,t){return e.kind==="tool"?t("blocks.createAgents.builtinTool"):e.kind==="knowledge_base"?t("blocks.createAgents.knowledgeBase"):e.source.startsWith("skill_hub:")?"Skill Hub":e.source.startsWith("skill_space:")?t("blocks.createAgents.skillCenter"):"Skill"}function GM({label:e,resources:t}){const{t:n}=Ce("conversation");return t.length===0?null:o.jsxs("section",{className:"create-agent-card__popover-section",children:[o.jsx("h4",{children:e}),o.jsx("div",{className:"create-agent-card__popover-list",children:t.map(i=>o.jsxs("div",{className:"create-agent-card__popover-item",children:[o.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[o.jsx("strong",{children:i.name}),o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:POt(i,n)})]}),i.description?o.jsx("p",{children:i.description}):null]},i.ref))})]})}function DOt({tools:e}){const{t}=Ce("conversation");return e.length===0?null:o.jsxs("section",{className:"create-agent-card__popover-section",children:[o.jsx("h4",{children:t("blocks.createAgents.selfAuthoredTools")}),o.jsx(uCe,{children:e.map((n,i)=>o.jsxs(mCe,{className:"create-agent-card__python-tool",value:`${n.name}:${i}`,children:[o.jsx(gCe,{className:"create-agent-card__python-tool-header",children:o.jsxs(bCe,{className:"create-agent-card__python-tool-trigger",children:[o.jsxs("span",{children:[o.jsx("strong",{children:n.name}),n.description?o.jsx("small",{children:n.description}):null]}),o.jsxs("span",{className:"create-agent-card__python-tool-meta",children:[o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:t("blocks.createAgents.selfAuthoredTools")}),o.jsx(SCe,{className:"create-agent-card__python-tool-chevron"})]})]})}),o.jsxs(vCe,{className:"create-agent-card__python-tool-panel",children:[n.dependencies.length>0?o.jsx("div",{className:"create-agent-card__python-tool-dependencies",children:t("blocks.createAgents.dependencies",{items:n.dependencies.join(", ")})}):null,o.jsx("pre",{tabIndex:0,"aria-label":t("blocks.createAgents.fullCode",{name:n.name}),children:o.jsx("code",{children:n.code})})]})]},`${n.name}:${i}`))})]})}function MOt({agents:e}){const{t}=Ce("conversation");return e.length===0?null:o.jsxs("section",{className:"create-agent-card__popover-section",children:[o.jsx("h4",{children:t("blocks.createAgents.subAgents")}),o.jsx("div",{className:"create-agent-card__popover-list",children:e.map(n=>o.jsxs("div",{className:"create-agent-card__popover-item",children:[o.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[o.jsx("strong",{children:n.id}),o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:t(`blocks.createAgents.agentTypes.${n.type}`,{defaultValue:n.type})})]}),n.description?o.jsx("p",{children:n.description}):null]},n.id))})]})}function FT({label:e,count:t,icon:n,children:i}){const{t:r}=Ce("conversation"),s=o.jsxs("button",{className:"create-agent-card__resource-metric",type:"button",disabled:t===0,"aria-label":r("blocks.createAgents.itemCount",{label:e,count:t}),children:[n,o.jsx("span",{children:t})]});return t===0?s:o.jsxs(im,{showOnHover:!0,hoverOpenDelay:120,children:[o.jsx(im.Trigger,{children:s}),o.jsx(im.Content,{side:"top",align:"start",minWidth:"auto",maxWidth:360,className:"create-agent-card__resource-popover",children:i})]})}function LOt({response:e,status:t}){const{t:n}=Ce("conversation"),i=m.useMemo(()=>({tool:n("blocks.createAgents.sourceLabels.tool"),knowledge:n("blocks.createAgents.sourceLabels.knowledge"),skillCenter:n("blocks.createAgents.sourceLabels.skillCenter"),unknownSource:n("blocks.createAgents.sourceLabels.unknown"),unnamedResource:n("blocks.createAgents.unnamedResource"),unnamedAgent:n("blocks.createAgents.unnamedAgent")}),[n]),r=m.useMemo(()=>lwt(e,i),[i,e]),s=m.useMemo(()=>IOt.map(c=>{const u=cwt(r,c);return{value:c,label:n(`blocks.createAgents.categories.${c}`),...u,searchKeywords:[...new Set(u.sources.flatMap(d=>d.searchKeywords))]}}),[r,n]),a=t==="failed",l=a?lI(e):"";return o.jsx("section",{className:"create-agent-tool-card","aria-label":n("blocks.createAgents.collectionAria"),children:t==="running"?o.jsx(kCe,{label:n("blocks.createAgents.retrieving")}):a?o.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[o.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.retrievalFailed")}),o.jsx("span",{children:l||n("blocks.createAgents.checkConfig")})]}):o.jsx(uCe,{className:"create-agent-card__accordion",children:s.map(c=>o.jsxs(mCe,{className:"create-agent-card__accordion-item",value:c.value,children:[o.jsx(gCe,{className:"create-agent-card__accordion-header",children:o.jsxs(bCe,{className:"create-agent-card__accordion-trigger",children:[o.jsx("span",{children:c.label}),o.jsxs("span",{className:"create-agent-card__accordion-meta",children:[o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.notSearched"):n("blocks.createAgents.notConfigured"):c.resources.length}),o.jsx(SCe,{className:"create-agent-card__accordion-chevron"})]})]})}),o.jsx(vCe,{className:"create-agent-card__accordion-content",children:o.jsxs("div",{className:"create-agent-card__accordion-scroll",role:"region","aria-label":n("blocks.createAgents.resourceList",{label:c.label}),tabIndex:0,children:[c.value==="skill_hub"&&c.searchKeywords.length>0?o.jsxs("div",{className:"create-agent-card__search-keywords",children:[o.jsx("span",{children:n("blocks.createAgents.searchKeywords")}),o.jsx("span",{children:c.searchKeywords.join("、")})]}):null,c.resources.length>0?o.jsx("div",{className:"create-agent-card__resource-list",children:c.resources.map(u=>o.jsx("div",{className:"create-agent-card__resource",children:o.jsxs("div",{className:"create-agent-card__resource-main",children:[o.jsxs("div",{className:"create-agent-card__resource-title",children:[o.jsx("span",{className:"create-agent-card__resource-name",children:u.name}),u.version?o.jsx(ba,{className:"create-agent-card__resource-version",color:"secondary",size:"sm",variant:"soft",children:u.version}):null]}),u.description?o.jsx("p",{children:u.description}):null]})},u.ref))}):o.jsxs("div",{className:"create-agent-card__empty-category",children:[o.jsx("p",{children:c.sources.length===0?c.value==="skill_hub"?n("blocks.createAgents.skillHubSkipped"):n("blocks.createAgents.sourceSkipped",{label:c.label}):n("blocks.createAgents.noResources")}),c.sources.filter(u=>u.message).map(u=>o.jsx("p",{className:"create-agent-card__raw-source-error",children:u.message},u.source))]})]})})]},c.value))},r.collectionId||"collected-resources")})}function $Ot({args:e,response:t,status:n}){const{t:i}=Ce("conversation"),r=m.useMemo(()=>({tool:i("blocks.createAgents.sourceLabels.tool"),knowledge:i("blocks.createAgents.sourceLabels.knowledge"),skillCenter:i("blocks.createAgents.sourceLabels.skillCenter"),unknownSource:i("blocks.createAgents.sourceLabels.unknown"),unnamedResource:i("blocks.createAgents.unnamedResource"),unnamedAgent:i("blocks.createAgents.unnamedAgent")}),[i]),s=m.useMemo(()=>XEe(e,t,r),[e,r,t]),a=n==="failed"?lI(t):"";return o.jsxs("section",{className:"create-agent-tool-card is-agent-results","aria-label":i("blocks.createAgents.resultAria"),children:[a?o.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[o.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.creationFailed")}),o.jsx("span",{children:a})]}):null,s.agents.length>0?o.jsx("div",{className:"create-agent-card__agent-grid",children:s.agents.map(l=>{const c=n==="failed"?"failed":l.status,u=l.error||c==="failed"&&a,d=l.builtinTools.length+l.pythonTools.length;return o.jsxs(jB,{className:`create-agent-card__agent-card${u?" is-error":""}`,children:[o.jsx(RB,{leading:o.jsx(Xv,{seed:l.name}),title:l.name,titleText:l.name,status:o.jsx(ba,{color:"secondary",size:"sm",variant:"soft",children:i(`blocks.createAgents.agentTypes.${l.rootType}`,{defaultValue:l.rootType})})}),l.description?o.jsx(IB,{children:l.description}):null,u?o.jsx("div",{className:"create-agent-card__agent-result is-error",role:"alert",children:u}):null,o.jsxs("div",{className:"create-agent-card__agent-resources","aria-label":i("blocks.createAgents.agentResources",{name:l.name}),children:[o.jsx(FT,{label:i("blocks.createAgents.skill"),count:l.skills.length,icon:o.jsx(K2,{"aria-hidden":"true"}),children:o.jsx(GM,{label:i("blocks.createAgents.skill"),resources:l.skills})}),o.jsx(FT,{label:i("blocks.createAgents.knowledgeBase"),count:l.knowledgeBases.length,icon:o.jsx(Gxe,{"aria-hidden":"true"}),children:o.jsx(GM,{label:i("blocks.createAgents.knowledgeBase"),resources:l.knowledgeBases})}),o.jsxs(FT,{label:i("blocks.createAgents.toolsLabel"),count:d,icon:o.jsx(YFe,{"aria-hidden":"true"}),children:[o.jsx(GM,{label:i("blocks.createAgents.builtinTool"),resources:l.builtinTools}),o.jsx(DOt,{tools:l.pythonTools})]}),o.jsx(FT,{label:i("blocks.createAgents.subAgents"),count:l.subAgentCount,icon:o.jsx(JFe,{"aria-hidden":"true"}),children:o.jsx(MOt,{agents:l.subAgents})})]})]},l.name)})}):n==="running"?o.jsx(kCe,{label:i("blocks.createAgents.creating")}):o.jsxs("div",{className:"create-agent-card__message",children:[o.jsx("span",{className:"create-agent-card__message-title",children:i("blocks.createAgents.noAgents")}),o.jsx("span",{children:i("blocks.createAgents.noAgentResult")})]})]})}const FOt={web_search:{name:"web_search",runningLabel:"Searching the web",doneLabel:"Web search complete",tone:"search",icon:MY},link_reader:{name:"link_reader",runningLabel:"Reading webpage",doneLabel:"Webpage read complete",tone:"search",icon:MY},run_code:{name:"run_code",runningLabel:"Running code in the AgentKit sandbox",doneLabel:"Code execution completed in the AgentKit sandbox",tone:"sandbox",icon:ewt},list_envs:{name:"list_envs",runningLabel:"Checking available environments",doneLabel:"Available environments loaded",tone:"resources",icon:nwt},get_env_manifest:{name:"get_env_manifest",runningLabel:"Loading the environment manifest",doneLabel:"Environment manifest loaded",tone:"knowledge",icon:iwt},execute_in_sandbox:{name:"execute_in_sandbox",runningLabel:"Running a command in the environment",doneLabel:"Command completed in the environment",tone:"sandbox",icon:$Y},delegate_to_codex_sandbox:{name:"delegate_to_codex_sandbox",runningLabel:"Codex Sandbox is running",doneLabel:"Codex Sandbox completed",failedLabel:"Codex Sandbox failed",tone:"sandbox",icon:$Y},image_generate:{name:"image_generate",runningLabel:"Generating image",doneLabel:"Image generated",tone:"image",icon:K1t},video_generate:{name:"video_generate",runningLabel:"Generating video",doneLabel:"Video generated",tone:"video",icon:mU},ppt_generate:{name:"ppt_generate",runningLabel:"Generating presentation",doneLabel:"Presentation generated",tone:"presentation",icon:X1t},load_memory:{name:"load_memory",runningLabel:"Searching long-term memory",doneLabel:"Memory search complete",tone:"memory",icon:Y1t},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"Searching the knowledge base",doneLabel:"Knowledge base search complete",tone:"knowledge",icon:Z1t},load_skill:{name:"load_skill",runningLabel:"Loading skill",doneLabel:"Skill loaded",tone:"skill",icon:J1t},collect_resources:{name:"collect_resources",runningLabel:"Collecting available resources",doneLabel:"Resource collection complete",failedLabel:"Resource collection failed",tone:"resources",icon:twt,detailRenderer:LOt},create_agents:{name:"create_agents",runningLabel:"Creating and running agents",doneLabel:"Agent creation complete",failedLabel:"Agent creation failed",tone:"agent",icon:LY,detailRenderer:$Ot},branch_compare:{name:"branch_compare",runningLabel:"",doneLabel:"",failedLabel:"",tone:"search",icon:LY,detailRenderer:fwt,hideHeader:!0}};function BOt(e){return FOt[e]}function ECe(e){return o.jsx("svg",{viewBox:"0 0 111 117",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M0 5.6016C7.82288e-05 0.621244 6.02226 -1.87314 9.54395 1.64847L40.1289 32.2334L68.5732 3.7891C69.5834 2.77903 70.9533 2.21099 72.3818 2.21097H82.7031C82.7917 2.20658 82.8806 2.20414 82.9697 2.20414H104.775C109.574 2.20427 111.977 8.00691 108.584 11.4004L64.916 55.0664C64.3075 55.8528 63.9436 56.7647 63.8242 57.6993C63.7142 56.4884 63.1964 55.3069 62.2695 54.3799L45.4082 37.5186H45.4072L40.124 32.2354L17.832 54.5284C16.7671 55.5933 16.2416 56.993 16.2549 58.3887C16.2417 59.7843 16.7672 61.1842 17.832 62.2491L39.9287 84.3467L9.54395 114.733C6.0223 118.255 0.000223474 115.761 0 110.78V5.6016ZM63.8018 58.8702C63.8962 59.9086 64.2936 60.9229 64.9961 61.7735L108.591 105.368C111.984 108.762 109.58 114.564 104.781 114.564H94.4336C94.3543 114.568 94.274 114.569 94.1934 114.569H72.3877C70.9592 114.569 69.5892 114.002 68.5791 112.992L39.9336 84.3467L58.4531 65.8282L58.4453 65.8203L62.2695 61.9981C63.1476 61.12 63.6567 60.0136 63.8018 58.8702Z",fill:"currentColor"})})}function UOt(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:"M6 3h8l4 4v14H6Z"}),o.jsx("path",{d:"M14 3v5h5"}),o.jsx("path",{d:"m10 12-2 2 2 2M14 12l2 2-2 2"})]})}function QOt(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 19 6v5c0 4.6-2.8 7.8-7 10-4.2-2.2-7-5.4-7-10V6l7-3Z"}),o.jsx("path",{d:"m9 12 2 2 4-4"})]})}function zOt(e,t){const n=new Map(e.map(a=>[a.path,a.content])),i=new Map(t.map(a=>[a.path,a.content])),r=new Set([...n.keys(),...i.keys()]),s=[];for(const a of[...r].sort((l,c)=>l.localeCompare(c))){const l=n.get(a),c=i.get(a);l!==c&&s.push({path:a,status:l===void 0?"added":c===void 0?"deleted":"modified",before:l??"",after:c??""})}return s}function Vm(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function CCe(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"m9 7-5 5 5 5M15 7l5 5-5 5M13.5 4l-3 16"})})}function KM(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"M6.5 3.75h7l4 4V20.25h-11zM13.5 3.75v4h4M9 12h6M9 15.5h4.5"})})}function VOt(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"M3.75 7.25h6l1.75 2h8.75v9.25H3.75zM3.75 7.25V5.5h5l1.5 1.75"})})}function HOt(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"m9 5 7 7-7 7"})})}function TCe(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function qOt(e){return o.jsxs("svg",{...Vm(e),children:[o.jsx("circle",{cx:"12",cy:"12",r:"3.25"}),o.jsx("path",{d:"M12 2.75v2M12 19.25v2M2.75 12h2M19.25 12h2M5.45 5.45l1.4 1.4M17.15 17.15l1.4 1.4M18.55 5.45l-1.4 1.4M6.85 17.15l-1.4 1.4"})]})}function WOt(e){return o.jsx("svg",{...Vm(e),children:o.jsx("path",{d:"M19.25 15.25A8 8 0 0 1 8.75 4.75a8 8 0 1 0 10.5 10.5Z"})})}function GOt(e){return o.jsxs("svg",{...Vm(e),children:[o.jsx("path",{d:"M19.25 8.25V4.5l-1.8 1.8a7.5 7.5 0 1 0 1.8 7.65"}),o.jsx("path",{d:"M19.25 4.5H15.5"})]})}const KOt=m.lazy(()=>Md(()=>Promise.resolve().then(()=>ije),void 0)),XOt=m.lazy(()=>Md(()=>import("../chunks/CodeDiffEditor-rfXXFF-S.js"),[])),ACe="veadk-code-workspace-theme";function YOt(e){const t={name:"",children:new Map};for(const n of e){const i=n.path.split("/").filter(Boolean);let r=t;i.forEach((s,a)=>{let l=r.children.get(s);l||(l={name:s,children:new Map},r.children.set(s,l)),a===i.length-1&&(l.path=n.path),r=l})}return t}function ZOt(e,t=!1){return[...e.children.values()].sort((n,i)=>{const r=n.children.size>0&&n.path===void 0,s=i.children.size>0&&i.path===void 0;return r!==s?t?r?1:-1:r?-1:1:n.name.localeCompare(i.name)})}function JOt(){if(typeof window>"u")return"light";try{return window.localStorage.getItem(ACe)==="dark"?"dark":"light"}catch{return"light"}}function eSt(e){return e===""?0:e.split(` +`).length}function WS({project:e,open:t,onClose:n,onChange:i,readOnly:r=!1,comparison:s}){var F;const{t:a}=Ce("workspaceTools"),l=m.useId(),c=m.useRef(null),u=m.useRef(null),d=m.useRef(n),[f,h]=m.useState(JOt),p=m.useMemo(()=>s?zOt(s.baseProject.files,e.files):[],[s,e.files]),g=m.useMemo(()=>s?p.map(T=>({path:T.path,content:T.status==="deleted"?T.before:T.after})):e.files,[p,s,e.files]),b=m.useMemo(()=>new Map(p.map(T=>[T.path,T.status])),[p]),[v,y]=m.useState(((F=g[0])==null?void 0:F.path)??null),[x,O]=m.useState(new Set),w=m.useMemo(()=>YOt(g),[g]),k=g.find(T=>T.path===v)??null,S=p.find(T=>T.path===v)??null;if(d.current=n,m.useEffect(()=>{try{window.localStorage.setItem(ACe,f)}catch{}},[f]),m.useEffect(()=>{var L;if(!t)return;const T=document.body.style.overflow,P=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(L=u.current)==null||L.focus();const R=M=>{if(M.key==="Escape"){M.preventDefault(),d.current();return}if(M.key!=="Tab"||!c.current)return;const U=[...c.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')].filter(Z=>Z.offsetParent!==null);if(U.length===0)return;const I=U[0],H=U[U.length-1];M.shiftKey&&document.activeElement===I?(M.preventDefault(),H.focus()):!M.shiftKey&&document.activeElement===H&&(M.preventDefault(),I.focus())};return window.addEventListener("keydown",R),()=>{document.body.style.overflow=T,window.removeEventListener("keydown",R),P!=null&&P.isConnected&&P.focus()}},[t]),m.useEffect(()=>{k||g.length===0||y(g[0].path)},[g,k]),!t)return null;function E(T){O(P=>{const R=new Set(P);return R.has(T)?R.delete(T):R.add(T),R})}function C(T){return T?o.jsx("span",{className:`code-browser-change is-${T}`,children:a(`codeBrowser.change.${T}`)}):null}function N(T,P,R){return ZOt(T,P===0).map(L=>{const M=R?`${R}/${L.name}`:L.name;if(!(L.children.size>0&&L.path===void 0)&&L.path){const H=b.get(L.path);return o.jsxs("button",{type:"button",className:`code-browser-file${v===L.path?" is-active":""}`,style:{paddingLeft:`${12+P*16}px`},onClick:()=>y(L.path??null),title:L.path,"aria-pressed":v===L.path,children:[o.jsx(KM,{}),o.jsx("span",{children:L.name}),C(H)]},M)}const I=x.has(M);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+P*16}px`},onClick:()=>E(M),"aria-expanded":!I,children:[o.jsx(HOt,{className:I?"":"is-open"}),o.jsx(VOt,{}),o.jsx("span",{children:L.name})]}),!I&&N(L,P+1,M)]},M)})}function _(T){!k||s||i({...e,files:e.files.map(P=>P.path===k.path?{...P,content:T}:P)})}const j=f==="light"?"dark":"light",A=a(s?"codeBrowser.noChanges":"codeBrowser.chooseFile");return Li.createPortal(o.jsx("div",{className:"code-browser-backdrop",onMouseDown:T=>{T.target===T.currentTarget&&n()},children:o.jsxs("section",{ref:c,className:`code-browser-dialog is-${f}`,role:"dialog","aria-modal":"true","aria-labelledby":l,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",children:o.jsx(CCe,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:l,children:a(s?"codeBrowser.compareTitle":"codeBrowser.workspaceTitle")}),o.jsx("p",{title:e.name,children:e.name||a("codeBrowser.projectFallback")})]})]}),o.jsxs("div",{className:"code-browser-head-actions",children:[o.jsx("button",{type:"button",className:"code-browser-icon-button",onClick:()=>h(j),"aria-label":a("codeBrowser.switchTheme"),title:a("codeBrowser.switchThemeTitle",{theme:a(`codeBrowser.themes.${j}`)}),children:f==="light"?o.jsx(WOt,{}):o.jsx(qOt,{})}),o.jsx("button",{ref:u,type:"button",className:"code-browser-icon-button",onClick:n,"aria-label":a("codeBrowser.closeWorkspace"),title:a("codeBrowser.close"),children:o.jsx(TCe,{})})]})]}),o.jsxs("div",{className:"code-browser-workspace",children:[o.jsxs("aside",{className:"code-browser-sidebar","aria-label":a(s?"codeBrowser.changedFiles":"codeBrowser.projectFiles"),children:[o.jsxs("div",{className:"code-browser-sidebar-head",children:[o.jsx("span",{children:a(s?"codeBrowser.changes":"codeBrowser.files")}),o.jsx("span",{children:g.length})]}),o.jsx("div",{className:"code-browser-tree",children:g.length>0?N(w,0,""):o.jsx("div",{className:"code-browser-empty",children:A})})]}),o.jsxs("main",{className:"code-browser-main",children:[o.jsx("div",{className:"code-browser-tabs",role:"tablist","aria-label":a("codeBrowser.openFiles"),children:k?o.jsxs("div",{className:"code-browser-tab",role:"tab","aria-selected":"true",children:[o.jsx(KM,{}),o.jsx("span",{children:k.path.split("/").pop()}),C(S==null?void 0:S.status)]}):null}),o.jsxs("div",{className:"code-browser-path",children:[o.jsx(KM,{}),o.jsx("span",{children:(k==null?void 0:k.path)??a("codeBrowser.noFileSelected")})]}),s?o.jsxs("div",{className:"code-browser-diff-labels","aria-label":a("codeBrowser.comparisonDirection"),children:[o.jsx("span",{children:s.baseLabel??a("codeBrowser.before")}),o.jsx("span",{children:s.targetLabel??a("codeBrowser.after")})]}):null,o.jsx("div",{className:"code-browser-editor",children:k?o.jsx(m.Suspense,{fallback:o.jsx("div",{className:"code-browser-empty",children:a("codeBrowser.loadingEditor")}),children:S?o.jsx(XOt,{before:S.before,after:S.after,path:S.path,theme:f}):o.jsx(KOt,{value:k.content,path:k.path,onChange:_,readOnly:r,theme:f})}):o.jsx("div",{className:"code-browser-empty",children:A})}),o.jsxs("footer",{className:"code-browser-statusbar",children:[o.jsx("span",{children:s?a("codeBrowser.changedFileCount",{count:p.length}):a("codeBrowser.fileCount",{count:e.files.length})}),o.jsx("span",{children:k?a("codeBrowser.lineCount",{count:eSt(k.content)}):"UTF-8"})]})]})]})]})}),document.body)}function tSt({project:e,onChange:t,className:n="",label:i}){const{t:r}=Ce("workspaceTools"),[s,a]=m.useState(!1),l=i??r("codeBrowser.viewSource");return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>a(!0),"aria-label":r("codeBrowser.viewSourceAria"),title:l,children:[o.jsx(CCe,{}),o.jsx("span",{children:l})]}),o.jsx(WS,{project:e,open:s,onClose:()=>a(!1),onChange:t})]})}const _Ce="send_a2ui_json_to_client",nSt=28,iSt=3e3;function rSt(e,t,n){let i=t;for(let r=0;r65535?2:1}return i}function sSt(e){return e<=4?1:Math.min(18,Math.max(2,Math.ceil(e/6)))}function NCe(e,t,n,i){const[r,s]=m.useState(()=>t?"":e),a=m.useRef(r),l=m.useRef(e),c=m.useRef(null),u=m.useRef(0),d=m.useRef(n);return l.current=e,d.current=n,m.useEffect(()=>{const f=a.current,h=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!t||h||!e.startsWith(f)){c.current!==null&&window.cancelAnimationFrame(c.current),c.current=null,f!==e&&(a.current=e,s(e));return}if(f===e||c.current!==null)return;const p=g=>{const b=l.current,v=a.current;if(!b.startsWith(v)){a.current=b,s(b),c.current=null;return}if(g-u.current{var f;(f=d.current)==null||f.call(d)},[r]),m.useEffect(()=>{r===e&&(i==null||i())},[r,i,e]),m.useEffect(()=>()=>{c.current!==null&&(window.cancelAnimationFrame(c.current),c.current=null)},[]),r}function aSt(){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 oSt(){return o.jsxs("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:"m4.5 7 1.8 1.8L9.5 5.5"}),o.jsx("path",{d:"M12 7h7.5"}),o.jsx("path",{d:"m4.5 13 1.8 1.8 3.2-3.3"}),o.jsx("path",{d:"M12 13h7.5"}),o.jsx("path",{d:"M5 19h4"}),o.jsx("path",{d:"M12 19h7.5"})]})}function lSt(){return o.jsxs("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:"M5 5v7.25A3.75 3.75 0 0 0 8.75 16H19"}),o.jsx("path",{d:"m15.5 12.5 3.5 3.5-3.5 3.5"})]})}function cSt({activity:e}){const{t}=Ce("conversation"),n=[["Agent Session",e.agentSessionId],["Sandbox Session",e.sandboxSessionId],["Codex Thread",e.threadId]].filter(i=>!!i[1]);return n.length?o.jsx("dl",{className:"codex-sandbox-run__identity","aria-label":t("blocks.sandboxIdentity"),children:n.map(([i,r])=>o.jsxs("div",{children:[o.jsx("dt",{children:i}),o.jsx("dd",{title:r,children:r})]},i))}):null}function uSt(e,t,n){if(e!=="load_skill"||t==null||typeof t!="object"||Array.isArray(t))return;const i=t.skill_name;if(!(typeof i!="string"||!i.trim()))return n("blocks.useSkill",{name:i.trim()})}function jCe({text:e,done:t,answerStarted:n=!1,streaming:i=!1,onStreamFrame:r}){const{t:s}=Ce("conversation"),[a,l]=m.useState(!(t||n)),c=m.useRef(!1);m.useEffect(()=>{c.current||l(!(t||n))},[n,t]);const u=()=>{c.current=!0,l(g=>!g)},d=e.replace(/\r\n?/g,` `).trimStart().split(/\n{2,}/).map(g=>g.replace(/[^\S\n]*\n[^\S\n]*/g,(b,v,y)=>{const x=y[v-1]??"",O=y[v+b.length]??"";return!x||!O||new RegExp("\\p{Script=Han}","u").test(x)&&new RegExp("\\p{Script=Han}","u").test(O)||/[(\[{“‘/]/u.test(x)||/[),.\]},。!?;:、”’]/u.test(O)?"":" "})).join(` -`),f=NCe(d,!t||i,r),{ref:h,onScroll:p}=HEe(f);return o.jsxs("div",{className:"block-thinking",children:[o.jsxs("button",{className:"think-head",onClick:u,type:"button",children:[o.jsx("span",{className:"think-icon","aria-hidden":"true",children:o.jsx(ECe,{className:`thinking-logo ${t?"":"is-active"}`})}),t?o.jsx("span",{className:"think-label think-label--done",children:s("blocks.thinkingDone")}):o.jsx(An,{className:"think-label",duration:2.4,spread:18,children:s("blocks.thinking")}),o.jsx(Uk,{className:`chev ${a?"open":""}`})]}),o.jsx("div",{className:`think-collapse ${a&&f?"open":""}`,children:o.jsx("div",{className:"think-collapse-inner",children:o.jsx("div",{className:"think-body scroll",ref:h,onScroll:p,children:f})})})]})}function dSt({text:e}){return o.jsx("div",{className:"block-progress",role:"status","aria-live":"polite","aria-atomic":"true",children:o.jsxs("div",{className:"think-head progress-head",children:[o.jsx("span",{className:"think-icon","aria-hidden":"true",children:o.jsx(ECe,{className:"thinking-logo is-active"})}),o.jsx(An,{className:"think-label",duration:2.4,spread:18,children:e})]})})}function fSt({value:e,onResolve:t,onResolveComparison:n,onDownload:i,onDeploy:r}){const{t:s,i18n:a}=Ae("conversation"),[l,c]=m.useState(e.files?e:null),[u,d]=m.useState(!1),[f,h]=m.useState(!1),[p,g]=m.useState(null),[b,v]=m.useState(null),[y,x]=m.useState(""),[O,w]=m.useState(null),k=new Date(e.validatedAt),S=e.validatedAt?Number.isNaN(k.getTime())?e.validatedAt:k.toLocaleString(a.resolvedLanguage??a.language,{hour12:!1}):s("blocks.justNow");m.useEffect(()=>{if(!O)return;const A=window.setTimeout(()=>w(null),iSt);return()=>window.clearTimeout(A)},[O]);async function E(){if(l)return l;if(!t)throw new Error(s("blocks.sourceUnavailable"));const A=await t(e);return c(A),A}async function C(){v("source"),x(""),w(null);try{await E(),d(!0)}catch(A){x(A instanceof Error?A.message:String(A))}finally{v(null)}}async function N(){if(i){v("download"),x(""),w(null);try{await i(e),w({message:s("blocks.downloadStarted")})}catch(A){x(A instanceof Error?A.message:String(A))}finally{v(null)}}}async function _(){if(n){v("compare"),x(""),w(null);try{const A=p??await n(e);g(A),h(!0)}catch(A){x(A instanceof Error?A.message:String(A))}finally{v(null)}}}async function j(){v("deploy"),x(""),w(null);try{r==null||r(await E())}catch(A){x(A instanceof Error?A.message:String(A))}finally{v(null)}}return o.jsxs(o.Fragment,{children:[o.jsxs("section",{className:`delivery-card${e.verified?" is-verified":" is-unverified"}`,"aria-label":e.verified?s("blocks.verifiedDelivery"):s("blocks.generatedSource"),children:[o.jsxs("header",{className:"delivery-card-header",children:[o.jsx("span",{className:"delivery-card-icon",children:e.verified?o.jsx(QOt,{}):o.jsx(UOt,{})}),o.jsxs("div",{children:[o.jsx("strong",{children:e.verified?s("blocks.verifiedDelivery"):s("blocks.generatedSource")}),o.jsx("span",{children:e.agentName})]})]}),o.jsxs("dl",{className:"delivery-card-grid",children:[o.jsxs("div",{children:[o.jsx("dt",{children:s("blocks.entryPoint")}),o.jsx("dd",{children:o.jsx("code",{children:e.entryPoint})})]}),o.jsxs("div",{children:[o.jsx("dt",{children:s("blocks.fileCount")}),o.jsx("dd",{children:e.fileCount})]}),o.jsxs("div",{children:[o.jsx("dt",{children:s("blocks.size")}),o.jsxs("dd",{children:[(e.artifactSize/1024).toFixed(1)," KiB"]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:e.verified?s("blocks.validationTime"):s("blocks.generationTime")}),o.jsx("dd",{children:S})]})]}),o.jsxs("p",{className:"delivery-card-gates",children:[e.verified?s("blocks.checksPassed",{count:e.gateSummary.length}):s("blocks.sourceReady")," ","· ",o.jsx("code",{children:e.artifactSha256.slice(0,12)})]}),e.verified?null:o.jsx("p",{className:"delivery-card-guidance",children:s("blocks.sourceGuidance")}),o.jsxs("div",{className:"delivery-card-actions",children:[o.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void C(),disabled:!t||b!==null,children:[b==="source"?o.jsx(fi,{className:"spin","aria-hidden":"true"}):null,s("blocks.viewSource")]}),e.projectId&&e.versionId&&e.parentVersionId?o.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void _(),disabled:!n||b!==null,children:[b==="compare"?o.jsx(fi,{className:"spin","aria-hidden":"true"}):null,s(b==="compare"?"blocks.preparing":"blocks.viewChanges")]}):null,o.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void N(),disabled:!i||b!==null,"aria-busy":b==="download",children:[b==="download"?o.jsx(fi,{className:"spin","aria-hidden":"true"}):null,s(b==="download"?"blocks.preparing":"blocks.downloadSource")]}),o.jsxs("button",{type:"button",onClick:()=>void j(),disabled:!e.deployable||!r||!t||b!==null,title:e.deployable?void 0:s("blocks.sourceNotReady"),children:[b==="deploy"?o.jsx(fi,{className:"spin","aria-hidden":"true"}):null,s("blocks.manualDeploy")]})]}),y?o.jsx("p",{className:"delivery-card-error",role:"alert",children:y}):null,O?o.jsx("p",{className:"delivery-card-status",role:"status","aria-live":"polite",children:O.message}):null]}),o.jsx(WS,{project:{name:e.agentName,files:(l==null?void 0:l.files)??[]},open:u,onClose:()=>d(!1),onChange:()=>{},readOnly:!0}),o.jsx(WS,{project:{name:(p==null?void 0:p.target.agentName)??e.agentName,files:(p==null?void 0:p.target.files)??[]},comparison:p?{baseProject:{name:p.base.agentName,files:p.base.files??[]},baseLabel:s("blocks.beforeOptimization"),targetLabel:s("blocks.afterOptimization")}:void 0,open:f,onClose:()=>h(!1),onChange:()=>{},readOnly:!0})]})}function RCe(){return o.jsx(jCe,{text:"",done:!1})}const hSt=m.memo(function({text:t,streaming:n,onStreamFrame:i,onStreamComplete:r}){const s=NCe(t,n,i,r);return s?o.jsx("div",{className:"bubble",children:o.jsx(Bu,{text:s,streaming:n})}):null});function pSt({title:e,summary:t,items:n,done:i}){const{t:r}=Ae("conversation"),[s,a]=m.useState(!i),l=m.useRef(!1);m.useEffect(()=>{l.current||a(!i)},[i]);const c=()=>{l.current=!0,a(u=>!u)};return o.jsxs("div",{className:"block-plan",children:[o.jsxs("button",{className:"plan-head",type:"button",onClick:c,"aria-expanded":n.length>0?s:void 0,disabled:n.length===0,children:[o.jsx("span",{className:"plan-icon","aria-hidden":"true",children:o.jsx(oSt,{})}),i?o.jsx("span",{className:"plan-title",children:e}):o.jsx(An,{className:"plan-title",duration:2.2,spread:15,children:e}),t?o.jsx("span",{className:"plan-summary",children:t}):null,n.length>0?o.jsx(gU,{className:`plan-chevron${s?" is-open":""}`}):null]}),o.jsx("div",{className:`think-collapse ${s&&n.length>0?"open":""}`,children:o.jsx("div",{className:"think-collapse-inner",children:n.length>0?o.jsx("ol",{className:"plan-items",children:n.map((u,d)=>o.jsxs("li",{"data-status":u.status,children:[o.jsx("span",{className:"plan-item-marker","aria-hidden":"true"}),o.jsx("span",{className:"plan-item-text",children:u.text}),o.jsx("small",{children:r(`blocks.planStatuses.${u.status}`)})]},`${d}:${u.text}`))}):null})})]})}function mSt(e){if(!e||typeof e!="object")return[];const t=e,n=t.result;let i=[];if(Array.isArray(t.studio_artifacts))i=t.studio_artifacts;else if(n&&typeof n=="object"){const r=n.studio_artifacts;Array.isArray(r)&&(i=r)}return i.flatMap(r=>{if(!r||typeof r!="object")return[];const s=r;return typeof s.name=="string"&&typeof s.contentUrl=="string"?[{name:s.name,contentUrl:s.contentUrl}]:[]})}function gSt({name:e,args:t,response:n,done:i,status:r,defaultOpen:s=!1,retrying:a=!1,codexActivity:l,onBranchSelect:c,onAction:u}){const{t:d}=Ae("conversation"),h=e==="create_agents"&&i&&uwt(t,n)?"failed":r??(i?"completed":"running"),p=e==="create_agents"&&h==="failed"&&a,g=BOt(e),b=g==null?void 0:g.detailRenderer,v=(g==null?void 0:g.hideHeader)===!0,y=v||s||!!b||!!l,[x,O]=m.useState(y),w=m.useRef(!1);m.useEffect(()=>{!w.current&&y&&O(!0)},[y]);const k=()=>{w.current=!0,O(_=>!_)},S=e===_Ce?d("blocks.renderUi"):e,E=mSt(n),C=n==null?null:typeof n=="string"?n:JSON.stringify(n,null,2),N=C&&C.length>2e3?`${C.slice(0,2e3)} -${d("blocks.truncated")}`:C;return o.jsxs(pr.div,{className:`block-tool${g?" block-tool--builtin":""}`,"data-status":h,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[g&&!v?o.jsx(rwt,{definition:g,label:p?d("blocks.agentAdjusting"):h==="failed"?d(`blocks.tools.${g.name}.failed`,{defaultValue:g.failedLabel??g.doneLabel}):uSt(e,t,d),done:i,open:x,onToggle:k}):g?null:o.jsxs("button",{className:"tool-head tool-head--generic",onClick:k,type:"button","aria-expanded":x,children:[o.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:o.jsx(aSt,{})}),i?o.jsx("span",{className:"tool-name",children:S}):o.jsx(An,{className:"tool-name",duration:2.2,spread:15,children:S}),o.jsx(gU,{className:`tool-chevron${x?" is-open":""}`})]}),o.jsx("div",{className:`${v?"":"think-collapse "}${x?"open":""}`,children:o.jsxs("div",{className:"think-collapse-inner",children:[l?o.jsxs("section",{className:"codex-sandbox-run","aria-label":d("blocks.sandboxDetails"),children:[o.jsxs("div",{className:"codex-sandbox-run__label",children:[o.jsxs("span",{className:"codex-sandbox-run__badge",children:[o.jsx(lSt,{}),o.jsx("span",{children:"Codex Sandbox"})]}),o.jsx("span",{className:"codex-sandbox-run__title",children:l.title})]}),o.jsx(cSt,{activity:l}),o.jsx("div",{className:"codex-sandbox-run__stream",children:l.items.length>0?o.jsx(TE,{blocks:l.items.map(_=>_.block),streaming:!i,onAction:u}):o.jsx(An,{className:"codex-sandbox-run__empty",children:d("blocks.waitingCodex")})})]}):null,b?o.jsx(b,{args:t,response:n,status:h,onBranchSelect:c}):l?null:o.jsxs("div",{className:"tool-detail",children:[t!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:d("blocks.arguments")}),o.jsx("pre",{className:"tool-args",children:JSON.stringify(t,null,2)})]}),N!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:d("blocks.result")}),o.jsx("pre",{className:"tool-args tool-result",children:N})]}),E.length>0&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:d("blocks.artifacts")}),o.jsx("div",{className:"studio-tool-artifacts",children:E.map(_=>o.jsx("a",{href:_.contentUrl,download:_.name,children:d("blocks.downloadNamed",{name:_.name})},`${_.contentUrl}:${_.name}`))})]})]})]})})]})}function bSt({block:e,onDownload:t,onPreview:n}){const{t:i}=Ae("conversation"),[r,s]=m.useState(""),[a,l]=m.useState(""),[c,u]=m.useState(null);m.useEffect(()=>()=>{c&&URL.revokeObjectURL(c.url)},[c]);const d=()=>u(null),f=async(g,b)=>{if(t){s(`download:${g}`),l("");try{await t(g,b)}catch(v){l(v instanceof Error?v.message:String(v))}finally{s("")}}},h=async(g,b,v)=>{if(n){s(`preview:${v}`),l("");try{const y=await n(g,b);u({name:v,url:y})}catch(y){l(y instanceof Error?y.message:String(y))}finally{s("")}}},p=e.files.filter(g=>!g.filename.endsWith(".preview.webp"));return o.jsxs("div",{className:"artifact-list",children:[p.map(g=>{const b=`${g.filename.replace(/\.pptx$/i,"")}.preview.webp`,v=e.files.find(y=>y.filename===b);return o.jsxs("div",{className:"artifact-card",children:[o.jsx("span",{className:"artifact-card__icon","aria-hidden":"true",children:o.jsx(DF,{})}),o.jsxs("span",{className:"artifact-card__copy",children:[o.jsx("span",{className:"artifact-card__name",children:g.filename}),o.jsx("span",{className:"artifact-card__hint",children:i("blocks.powerpoint")})]}),o.jsxs("span",{className:"artifact-card__actions",children:[v&&o.jsxs("button",{className:"artifact-card__action",type:"button",disabled:!n||r!=="",onClick:()=>void h(v.filename,v.version,g.filename),children:[r===`preview:${g.filename}`?o.jsx(fi,{className:"spin"}):o.jsx(p7e,{}),i("blocks.preview")]}),o.jsxs("button",{className:"artifact-card__action artifact-card__action--primary",type:"button",disabled:!t||r!=="",onClick:()=>void f(g.filename,g.version),children:[r===`download:${g.filename}`?o.jsx(fi,{className:"spin"}):o.jsx(Yj,{}),i("blocks.download")]})]})]},`${g.filename}:${g.version}`)}),a&&o.jsx("div",{className:"artifact-card__error",children:a}),c&&o.jsxs("div",{className:"artifact-preview",role:"dialog","aria-modal":"true","aria-label":i("blocks.previewDialog",{name:c.name}),children:[o.jsx("button",{className:"artifact-preview__backdrop",type:"button","aria-label":i("blocks.closePreview"),onClick:d}),o.jsxs("div",{className:"artifact-preview__panel",children:[o.jsxs("div",{className:"artifact-preview__header",children:[o.jsx("span",{children:c.name}),o.jsx("button",{type:"button","aria-label":i("blocks.closePreview"),onClick:d,children:o.jsx(Ba,{})})]}),o.jsx("div",{className:"artifact-preview__canvas",children:o.jsx("img",{src:c.url,alt:i("blocks.slidePreview",{name:c.name})})})]})]})]})}function ySt({block:e,onAuth:t}){const{t:n}=Ae("conversation"),[i,r]=m.useState(e.done?"done":"idle"),[s,a]=m.useState(""),l=e.label||n("blocks.mcpToolset"),c=(()=>{try{return e.authUri?new URL(e.authUri).host:""}catch{return""}})(),u=async()=>{if(t){a(""),r("authorizing");try{await t(e),r("done")}catch(f){a(f instanceof Error?f.message:String(f)),r("idle")}}};return e.done||i==="done"?o.jsxs(pr.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[o.jsx(xW,{className:"auth-card-icon auth-card-icon--done"}),o.jsx("span",{children:n("blocks.authorized",{tool:l})})]}):o.jsxs(pr.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(xW,{className:"auth-card-icon"}),o.jsx("span",{className:"auth-card-title",children:n("blocks.authorizationRequired",{tool:l})})]}),o.jsxs("p",{className:"auth-card-desc",children:[o.jsx(KA,{t:n,i18nKey:"blocks.oauthDescription",values:{tool:l},components:{code:o.jsx("code",{className:"auth-card-code"})}}),c&&o.jsxs(o.Fragment,{children:[" ",o.jsx(KA,{t:n,i18nKey:"blocks.oauthProvider",values:{provider:c},components:{code:o.jsx("code",{className:"auth-card-code"})}})," "]}),n("blocks.oauthContinue")]}),o.jsx("button",{className:"auth-card-btn",onClick:u,disabled:i==="authorizing"||!e.authUri,children:i==="authorizing"?o.jsxs(o.Fragment,{children:[o.jsx(fi,{className:"cw-i spin"})," ",n("blocks.waitingAuthorization")]}):o.jsx(o.Fragment,{children:n("blocks.authorize")})}),!e.authUri&&o.jsx("div",{className:"auth-card-err",children:n("blocks.missingAuthorizationUrl")}),s&&o.jsx("div",{className:"auth-card-err",children:s})]})}function TE({blocks:e,appName:t="",streaming:n=!1,onStreamFrame:i,onStreamComplete:r,onAction:s,onAuth:a,onArtifactDownload:l,onArtifactPreview:c,onResolveDelivery:u,onResolveDeliveryComparison:d,onDownloadDelivery:f,onDeployDelivery:h,onBranchSelect:p}){const g=e.reduce((b,v,y)=>v.kind==="text"?y:b,-1);return o.jsx(o.Fragment,{children:e.map((b,v)=>{switch(b.kind){case"progress":return o.jsx(dSt,{text:b.text},"build-progress");case"thinking":{const y=e.slice(v+1).some(x=>x.kind==="text"&&!!x.text.trim());return o.jsx(jCe,{text:b.text,done:b.done,answerStarted:y,streaming:n,onStreamFrame:i},v)}case"text":{const y=b.text.replace(/^\s+/,"");return y?o.jsx(hSt,{text:y,streaming:n,onStreamFrame:i,onStreamComplete:v===g?r:void 0},v):null}case"plan":return o.jsx(pSt,{title:b.title,summary:b.summary,items:b.items,done:b.done},v);case"attachment":return o.jsx(oI,{appName:t,items:b.files},v);case"artifact":return o.jsx(bSt,{block:b,onDownload:l,onPreview:c},v);case"delivery":return o.jsx(fSt,{value:b.value,onResolve:u,onResolveComparison:d,onDownload:f,onDeploy:h},v);case"invocation":return o.jsx(aI,{value:b.value},v);case"tool":{if(b.name===_Ce&&b.done)return null;const y=b.name==="create_agents"&&e.slice(v+1).some(x=>x.kind==="tool"&&x.name==="create_agents");return o.jsx(gSt,{name:b.name,args:b.args,response:b.response,done:b.done,status:b.status,defaultOpen:b.defaultOpen,retrying:b.name==="create_agents"&&(n||y),codexActivity:b.codexActivity,onBranchSelect:p,onAction:s},v)}case"agent-transfer":return null;case"auth":return o.jsx(ySt,{block:b,onAuth:a},v);case"a2ui":return VEe(b.messages).filter(y=>y.components[y.rootId]).map(y=>o.jsx(pr.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(q1t,{surface:y,onAction:s})},`${v}-${y.surfaceId}`));default:return null}})})}const vSt=()=>{};function xSt(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(Bt("conversation.unsupportedActivity"))}function wSt({activities:e}){const{t}=Ae("skills"),n=m.useMemo(()=>e.filter(i=>i.kind!=="status").map(xSt),[e]);return n.length===0?null:o.jsx("div",{className:"skill-conversation","aria-label":t("conversation.ariaLabel"),"aria-live":"polite",children:o.jsx(TE,{blocks:n,onAction:vSt})})}function KY(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m7 9 5 5 5-5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function SA({label:e,value:t,options:n,onChange:i,disabled:r=!1,allowCustom:s=!1,required:a=!1,placeholder:l,error:c}){const{t:u}=Ae("skills"),d=l??u("configSelect.placeholder"),f=m.useId(),h=m.useId(),p=m.useId(),g=m.useRef(null),b=m.useRef(null),v=m.useRef(null),y=m.useRef(null),x=m.useRef([]),O=n.findIndex(P=>P.value===t),w=t.trim().toLocaleLowerCase(),k=s&&w?n.filter(P=>P.value.toLocaleLowerCase().includes(w)||P.label.toLocaleLowerCase().includes(w)):n,[S,E]=m.useState(!1),[C,N]=m.useState(Math.max(0,O)),_=O>=0?n[O]:void 0,j=r||!s&&n.length===0,A=(P=!1)=>{E(!1),P&&window.requestAnimationFrame(()=>{var R,L;return s?(R=v.current)==null?void 0:R.focus():(L=b.current)==null?void 0:L.focus()})},F=P=>{j||k.length!==0&&(N(Math.min(Math.max(P,0),k.length-1)),E(!0))};m.useEffect(()=>{if(!S)return;const P=y.current,R=s?void 0:window.requestAnimationFrame(()=>{var I;(I=x.current[C])==null||I.focus()}),L=I=>{if(!P)return;const H=P.scrollTop<=0,K=P.scrollTop+P.clientHeight>=P.scrollHeight-1;(P.scrollHeight<=P.clientHeight||I.deltaY<0&&H||I.deltaY>0&&K)&&I.preventDefault(),I.stopPropagation()},M=I=>{var H;I.target instanceof Node&&!((H=g.current)!=null&&H.contains(I.target))&&A()},U=I=>{I.key==="Escape"&&A(!0)};return P==null||P.addEventListener("wheel",L,{passive:!1}),window.addEventListener("pointerdown",M),window.addEventListener("keydown",U),()=>{R!==void 0&&window.cancelAnimationFrame(R),P==null||P.removeEventListener("wheel",L),window.removeEventListener("pointerdown",M),window.removeEventListener("keydown",U)}},[C,s,S]);const T=P=>{var L;if(k.length===0)return;const R=(P+k.length)%k.length;N(R),(L=x.current[R])==null||L.focus()};return o.jsxs("div",{ref:g,className:`skill-config-select${S?" is-open":""}`,onBlur:P=>{var R;(!P.relatedTarget||!((R=g.current)!=null&&R.contains(P.relatedTarget)))&&A()},children:[o.jsxs("span",{id:h,className:"skill-config-select__label",children:[e,a?o.jsx("span",{className:"skill-required-mark","aria-hidden":"true",children:"*"}):null]}),s?o.jsxs("div",{className:`skill-config-select__trigger is-editable${r?" is-disabled":""}`,"aria-expanded":S,children:[o.jsx("input",{ref:v,value:t,disabled:r,role:"combobox","aria-autocomplete":"list","aria-expanded":S,"aria-controls":S?f:void 0,"aria-labelledby":h,"aria-required":a,"aria-invalid":!!c,"aria-describedby":c?p:void 0,placeholder:d,onChange:P=>{i(P.target.value),N(0),n.length>0&&E(!0)},onClick:()=>{!S&&k.length>0&&F(0)},onKeyDown:P=>{var R,L;if(!(P.nativeEvent.isComposing||P.keyCode===229))if(P.key==="ArrowDown")P.preventDefault(),S?(R=x.current[C])==null||R.focus():F(0);else if(P.key==="ArrowUp")P.preventDefault(),S?(L=x.current[k.length-1])==null||L.focus():F(k.length-1);else if(P.key==="Enter"&&S){P.preventDefault();const M=k[C];M&&i(M.value),A()}else P.key==="Escape"&&(P.preventDefault(),A())}}),o.jsx("button",{type:"button",className:"skill-config-select__toggle",disabled:r||n.length===0,"aria-label":u(S?"configSelect.collapseOptions":"configSelect.expandOptions"),onClick:()=>{S?A():F(0)},children:o.jsx(KY,{})})]}):o.jsxs("button",{ref:b,type:"button",className:"skill-config-select__trigger",disabled:j,"aria-haspopup":"listbox","aria-expanded":S,"aria-controls":S?f:void 0,"aria-labelledby":h,"aria-required":a,onClick:()=>{S?A():F(O>=0?O:0)},onKeyDown:P=>{P.key==="ArrowDown"?(P.preventDefault(),F(O>=0?O:0)):P.key==="ArrowUp"&&(P.preventDefault(),F(O>=0?O:n.length-1))},children:[o.jsx("span",{className:_?void 0:"is-placeholder",title:_==null?void 0:_.label,children:(_==null?void 0:_.label)||(n.length===0?u("configSelect.noOptions"):d)}),o.jsx(KY,{})]}),S?o.jsxs("div",{ref:y,id:f,className:"skill-config-select__menu",role:"listbox","aria-labelledby":h,children:[k.length===0?o.jsx("div",{className:"skill-config-select__empty",role:"status",children:u("configSelect.noMatches")}):null,k.map((P,R)=>{const L=P.value===t;return o.jsx("button",{ref:M=>{x.current[R]=M},type:"button",role:"option","aria-selected":L,tabIndex:R===C?0:-1,className:`skill-config-select__option${L?" is-selected":""}`,title:P.label,onFocus:()=>N(R),onClick:()=>{i(P.value),A(!0)},onKeyDown:M=>{M.key==="Enter"||M.key===" "?(M.preventDefault(),i(P.value),A(!0)):M.key==="ArrowDown"?(M.preventDefault(),T(R+1)):M.key==="ArrowUp"?(M.preventDefault(),T(R-1)):M.key==="Home"?(M.preventDefault(),T(0)):M.key==="End"&&(M.preventDefault(),T(n.length-1))},children:P.label},P.value)})]}):null,c?o.jsx("span",{id:p,className:"skill-config-select__error",role:"alert",children:c}):null]})}function ja(e,t){return e instanceof Error?e:typeof e=="string"&&e.trim()?new Error(e.trim()):new Error(t)}function cl({error:e}){var s,a,l,c,u;const{t}=Ae("skills"),n=e,i=(a=(s=n.originalError)==null?void 0:s.message)==null?void 0:a.trim(),r=[typeof n.status=="number"?`HTTP ${n.status}${n.statusText?` ${n.statusText}`:""}`:"",n.code?t("errorDetails.code",{code:n.code}):"",(l=n.originalError)!=null&&l.type?t("errorDetails.type",{type:n.originalError.type}):"",(c=n.originalError)!=null&&c.repr&&n.originalError.repr!==i?t("errorDetails.representation",{value:n.originalError.repr}):"",(u=n.rawResponse)!=null&&u.trim()?t("errorDetails.rawResponse",{value:n.rawResponse.trim()}):""].filter(Boolean);return o.jsxs("div",{className:"skill-error-details",children:[o.jsx("div",{className:"skill-error-details__summary",children:e.message}),i?o.jsx("div",{className:"skill-error-details__original",children:t("errorDetails.original",{message:i})}):null,r.length>0?o.jsxs("details",{children:[o.jsx("summary",{children:t("errorDetails.details")}),o.jsx("pre",{children:r.join(` +`),f=NCe(d,!t||i,r),{ref:h,onScroll:p}=HEe(f);return o.jsxs("div",{className:"block-thinking",children:[o.jsxs("button",{className:"think-head",onClick:u,type:"button",children:[o.jsx("span",{className:"think-icon","aria-hidden":"true",children:o.jsx(ECe,{className:`thinking-logo ${t?"":"is-active"}`})}),t?o.jsx("span",{className:"think-label think-label--done",children:s("blocks.thinkingDone")}):o.jsx(An,{className:"think-label",duration:2.4,spread:18,children:s("blocks.thinking")}),o.jsx(Uk,{className:`chev ${a?"open":""}`})]}),o.jsx("div",{className:`think-collapse ${a&&f?"open":""}`,children:o.jsx("div",{className:"think-collapse-inner",children:o.jsx("div",{className:"think-body scroll",ref:h,onScroll:p,children:f})})})]})}function dSt({text:e}){return o.jsx("div",{className:"block-progress",role:"status","aria-live":"polite","aria-atomic":"true",children:o.jsxs("div",{className:"think-head progress-head",children:[o.jsx("span",{className:"think-icon","aria-hidden":"true",children:o.jsx(ECe,{className:"thinking-logo is-active"})}),o.jsx(An,{className:"think-label",duration:2.4,spread:18,children:e})]})})}function fSt({value:e,onResolve:t,onResolveComparison:n,onDownload:i,onDeploy:r}){const{t:s,i18n:a}=Ce("conversation"),[l,c]=m.useState(e.files?e:null),[u,d]=m.useState(!1),[f,h]=m.useState(!1),[p,g]=m.useState(null),[b,v]=m.useState(null),[y,x]=m.useState(""),[O,w]=m.useState(null),k=new Date(e.validatedAt),S=e.validatedAt?Number.isNaN(k.getTime())?e.validatedAt:k.toLocaleString(a.resolvedLanguage??a.language,{hour12:!1}):s("blocks.justNow");m.useEffect(()=>{if(!O)return;const A=window.setTimeout(()=>w(null),iSt);return()=>window.clearTimeout(A)},[O]);async function E(){if(l)return l;if(!t)throw new Error(s("blocks.sourceUnavailable"));const A=await t(e);return c(A),A}async function C(){v("source"),x(""),w(null);try{await E(),d(!0)}catch(A){x(A instanceof Error?A.message:String(A))}finally{v(null)}}async function N(){if(i){v("download"),x(""),w(null);try{await i(e),w({message:s("blocks.downloadStarted")})}catch(A){x(A instanceof Error?A.message:String(A))}finally{v(null)}}}async function _(){if(n){v("compare"),x(""),w(null);try{const A=p??await n(e);g(A),h(!0)}catch(A){x(A instanceof Error?A.message:String(A))}finally{v(null)}}}async function j(){v("deploy"),x(""),w(null);try{r==null||r(await E())}catch(A){x(A instanceof Error?A.message:String(A))}finally{v(null)}}return o.jsxs(o.Fragment,{children:[o.jsxs("section",{className:`delivery-card${e.verified?" is-verified":" is-unverified"}`,"aria-label":e.verified?s("blocks.verifiedDelivery"):s("blocks.generatedSource"),children:[o.jsxs("header",{className:"delivery-card-header",children:[o.jsx("span",{className:"delivery-card-icon",children:e.verified?o.jsx(QOt,{}):o.jsx(UOt,{})}),o.jsxs("div",{children:[o.jsx("strong",{children:e.verified?s("blocks.verifiedDelivery"):s("blocks.generatedSource")}),o.jsx("span",{children:e.agentName})]})]}),o.jsxs("dl",{className:"delivery-card-grid",children:[o.jsxs("div",{children:[o.jsx("dt",{children:s("blocks.entryPoint")}),o.jsx("dd",{children:o.jsx("code",{children:e.entryPoint})})]}),o.jsxs("div",{children:[o.jsx("dt",{children:s("blocks.fileCount")}),o.jsx("dd",{children:e.fileCount})]}),o.jsxs("div",{children:[o.jsx("dt",{children:s("blocks.size")}),o.jsxs("dd",{children:[(e.artifactSize/1024).toFixed(1)," KiB"]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:e.verified?s("blocks.validationTime"):s("blocks.generationTime")}),o.jsx("dd",{children:S})]})]}),o.jsxs("p",{className:"delivery-card-gates",children:[e.verified?s("blocks.checksPassed",{count:e.gateSummary.length}):s("blocks.sourceReady")," ","· ",o.jsx("code",{children:e.artifactSha256.slice(0,12)})]}),e.verified?null:o.jsx("p",{className:"delivery-card-guidance",children:s("blocks.sourceGuidance")}),o.jsxs("div",{className:"delivery-card-actions",children:[o.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void C(),disabled:!t||b!==null,children:[b==="source"?o.jsx(fi,{className:"spin","aria-hidden":"true"}):null,s("blocks.viewSource")]}),e.projectId&&e.versionId&&e.parentVersionId?o.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void _(),disabled:!n||b!==null,children:[b==="compare"?o.jsx(fi,{className:"spin","aria-hidden":"true"}):null,s(b==="compare"?"blocks.preparing":"blocks.viewChanges")]}):null,o.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void N(),disabled:!i||b!==null,"aria-busy":b==="download",children:[b==="download"?o.jsx(fi,{className:"spin","aria-hidden":"true"}):null,s(b==="download"?"blocks.preparing":"blocks.downloadSource")]}),o.jsxs("button",{type:"button",onClick:()=>void j(),disabled:!e.deployable||!r||!t||b!==null,title:e.deployable?void 0:s("blocks.sourceNotReady"),children:[b==="deploy"?o.jsx(fi,{className:"spin","aria-hidden":"true"}):null,s("blocks.manualDeploy")]})]}),y?o.jsx("p",{className:"delivery-card-error",role:"alert",children:y}):null,O?o.jsx("p",{className:"delivery-card-status",role:"status","aria-live":"polite",children:O.message}):null]}),o.jsx(WS,{project:{name:e.agentName,files:(l==null?void 0:l.files)??[]},open:u,onClose:()=>d(!1),onChange:()=>{},readOnly:!0}),o.jsx(WS,{project:{name:(p==null?void 0:p.target.agentName)??e.agentName,files:(p==null?void 0:p.target.files)??[]},comparison:p?{baseProject:{name:p.base.agentName,files:p.base.files??[]},baseLabel:s("blocks.beforeOptimization"),targetLabel:s("blocks.afterOptimization")}:void 0,open:f,onClose:()=>h(!1),onChange:()=>{},readOnly:!0})]})}function RCe(){return o.jsx(jCe,{text:"",done:!1})}const hSt=m.memo(function({text:t,streaming:n,onStreamFrame:i,onStreamComplete:r}){const s=NCe(t,n,i,r);return s?o.jsx("div",{className:"bubble",children:o.jsx(Bu,{text:s,streaming:n})}):null});function pSt({title:e,summary:t,items:n,done:i}){const{t:r}=Ce("conversation"),[s,a]=m.useState(!i),l=m.useRef(!1);m.useEffect(()=>{l.current||a(!i)},[i]);const c=()=>{l.current=!0,a(u=>!u)};return o.jsxs("div",{className:"block-plan",children:[o.jsxs("button",{className:"plan-head",type:"button",onClick:c,"aria-expanded":n.length>0?s:void 0,disabled:n.length===0,children:[o.jsx("span",{className:"plan-icon","aria-hidden":"true",children:o.jsx(oSt,{})}),i?o.jsx("span",{className:"plan-title",children:e}):o.jsx(An,{className:"plan-title",duration:2.2,spread:15,children:e}),t?o.jsx("span",{className:"plan-summary",children:t}):null,n.length>0?o.jsx(gU,{className:`plan-chevron${s?" is-open":""}`}):null]}),o.jsx("div",{className:`think-collapse ${s&&n.length>0?"open":""}`,children:o.jsx("div",{className:"think-collapse-inner",children:n.length>0?o.jsx("ol",{className:"plan-items",children:n.map((u,d)=>o.jsxs("li",{"data-status":u.status,children:[o.jsx("span",{className:"plan-item-marker","aria-hidden":"true"}),o.jsx("span",{className:"plan-item-text",children:u.text}),o.jsx("small",{children:r(`blocks.planStatuses.${u.status}`)})]},`${d}:${u.text}`))}):null})})]})}function mSt(e){if(!e||typeof e!="object")return[];const t=e,n=t.result;let i=[];if(Array.isArray(t.studio_artifacts))i=t.studio_artifacts;else if(n&&typeof n=="object"){const r=n.studio_artifacts;Array.isArray(r)&&(i=r)}return i.flatMap(r=>{if(!r||typeof r!="object")return[];const s=r;return typeof s.name=="string"&&typeof s.contentUrl=="string"?[{name:s.name,contentUrl:s.contentUrl}]:[]})}function gSt({name:e,args:t,response:n,done:i,status:r,defaultOpen:s=!1,retrying:a=!1,codexActivity:l,onBranchSelect:c,onAction:u}){const{t:d}=Ce("conversation"),h=e==="create_agents"&&i&&uwt(t,n)?"failed":r??(i?"completed":"running"),p=e==="create_agents"&&h==="failed"&&a,g=BOt(e),b=g==null?void 0:g.detailRenderer,v=(g==null?void 0:g.hideHeader)===!0,y=v||s||!!b||!!l,[x,O]=m.useState(y),w=m.useRef(!1);m.useEffect(()=>{!w.current&&y&&O(!0)},[y]);const k=()=>{w.current=!0,O(_=>!_)},S=e===_Ce?d("blocks.renderUi"):e,E=mSt(n),C=n==null?null:typeof n=="string"?n:JSON.stringify(n,null,2),N=C&&C.length>2e3?`${C.slice(0,2e3)} +${d("blocks.truncated")}`:C;return o.jsxs(pr.div,{className:`block-tool${g?" block-tool--builtin":""}`,"data-status":h,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[g&&!v?o.jsx(rwt,{definition:g,label:p?d("blocks.agentAdjusting"):h==="failed"?d(`blocks.tools.${g.name}.failed`,{defaultValue:g.failedLabel??g.doneLabel}):uSt(e,t,d),done:i,open:x,onToggle:k}):g?null:o.jsxs("button",{className:"tool-head tool-head--generic",onClick:k,type:"button","aria-expanded":x,children:[o.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:o.jsx(aSt,{})}),i?o.jsx("span",{className:"tool-name",children:S}):o.jsx(An,{className:"tool-name",duration:2.2,spread:15,children:S}),o.jsx(gU,{className:`tool-chevron${x?" is-open":""}`})]}),o.jsx("div",{className:`${v?"":"think-collapse "}${x?"open":""}`,children:o.jsxs("div",{className:"think-collapse-inner",children:[l?o.jsxs("section",{className:"codex-sandbox-run","aria-label":d("blocks.sandboxDetails"),children:[o.jsxs("div",{className:"codex-sandbox-run__label",children:[o.jsxs("span",{className:"codex-sandbox-run__badge",children:[o.jsx(lSt,{}),o.jsx("span",{children:"Codex Sandbox"})]}),o.jsx("span",{className:"codex-sandbox-run__title",children:l.title})]}),o.jsx(cSt,{activity:l}),o.jsx("div",{className:"codex-sandbox-run__stream",children:l.items.length>0?o.jsx(TE,{blocks:l.items.map(_=>_.block),streaming:!i,onAction:u}):o.jsx(An,{className:"codex-sandbox-run__empty",children:d("blocks.waitingCodex")})})]}):null,b?o.jsx(b,{args:t,response:n,status:h,onBranchSelect:c}):l?null:o.jsxs("div",{className:"tool-detail",children:[t!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:d("blocks.arguments")}),o.jsx("pre",{className:"tool-args",children:JSON.stringify(t,null,2)})]}),N!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:d("blocks.result")}),o.jsx("pre",{className:"tool-args tool-result",children:N})]}),E.length>0&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:d("blocks.artifacts")}),o.jsx("div",{className:"studio-tool-artifacts",children:E.map(_=>o.jsx("a",{href:_.contentUrl,download:_.name,children:d("blocks.downloadNamed",{name:_.name})},`${_.contentUrl}:${_.name}`))})]})]})]})})]})}function bSt({block:e,onDownload:t,onPreview:n}){const{t:i}=Ce("conversation"),[r,s]=m.useState(""),[a,l]=m.useState(""),[c,u]=m.useState(null);m.useEffect(()=>()=>{c&&URL.revokeObjectURL(c.url)},[c]);const d=()=>u(null),f=async(g,b)=>{if(t){s(`download:${g}`),l("");try{await t(g,b)}catch(v){l(v instanceof Error?v.message:String(v))}finally{s("")}}},h=async(g,b,v)=>{if(n){s(`preview:${v}`),l("");try{const y=await n(g,b);u({name:v,url:y})}catch(y){l(y instanceof Error?y.message:String(y))}finally{s("")}}},p=e.files.filter(g=>!g.filename.endsWith(".preview.webp"));return o.jsxs("div",{className:"artifact-list",children:[p.map(g=>{const b=`${g.filename.replace(/\.pptx$/i,"")}.preview.webp`,v=e.files.find(y=>y.filename===b);return o.jsxs("div",{className:"artifact-card",children:[o.jsx("span",{className:"artifact-card__icon","aria-hidden":"true",children:o.jsx(DF,{})}),o.jsxs("span",{className:"artifact-card__copy",children:[o.jsx("span",{className:"artifact-card__name",children:g.filename}),o.jsx("span",{className:"artifact-card__hint",children:i("blocks.powerpoint")})]}),o.jsxs("span",{className:"artifact-card__actions",children:[v&&o.jsxs("button",{className:"artifact-card__action",type:"button",disabled:!n||r!=="",onClick:()=>void h(v.filename,v.version,g.filename),children:[r===`preview:${g.filename}`?o.jsx(fi,{className:"spin"}):o.jsx(p7e,{}),i("blocks.preview")]}),o.jsxs("button",{className:"artifact-card__action artifact-card__action--primary",type:"button",disabled:!t||r!=="",onClick:()=>void f(g.filename,g.version),children:[r===`download:${g.filename}`?o.jsx(fi,{className:"spin"}):o.jsx(Yj,{}),i("blocks.download")]})]})]},`${g.filename}:${g.version}`)}),a&&o.jsx("div",{className:"artifact-card__error",children:a}),c&&o.jsxs("div",{className:"artifact-preview",role:"dialog","aria-modal":"true","aria-label":i("blocks.previewDialog",{name:c.name}),children:[o.jsx("button",{className:"artifact-preview__backdrop",type:"button","aria-label":i("blocks.closePreview"),onClick:d}),o.jsxs("div",{className:"artifact-preview__panel",children:[o.jsxs("div",{className:"artifact-preview__header",children:[o.jsx("span",{children:c.name}),o.jsx("button",{type:"button","aria-label":i("blocks.closePreview"),onClick:d,children:o.jsx(Ba,{})})]}),o.jsx("div",{className:"artifact-preview__canvas",children:o.jsx("img",{src:c.url,alt:i("blocks.slidePreview",{name:c.name})})})]})]})]})}function ySt({block:e,onAuth:t}){const{t:n}=Ce("conversation"),[i,r]=m.useState(e.done?"done":"idle"),[s,a]=m.useState(""),l=e.label||n("blocks.mcpToolset"),c=(()=>{try{return e.authUri?new URL(e.authUri).host:""}catch{return""}})(),u=async()=>{if(t){a(""),r("authorizing");try{await t(e),r("done")}catch(f){a(f instanceof Error?f.message:String(f)),r("idle")}}};return e.done||i==="done"?o.jsxs(pr.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[o.jsx(xW,{className:"auth-card-icon auth-card-icon--done"}),o.jsx("span",{children:n("blocks.authorized",{tool:l})})]}):o.jsxs(pr.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(xW,{className:"auth-card-icon"}),o.jsx("span",{className:"auth-card-title",children:n("blocks.authorizationRequired",{tool:l})})]}),o.jsxs("p",{className:"auth-card-desc",children:[o.jsx(KA,{t:n,i18nKey:"blocks.oauthDescription",values:{tool:l},components:{code:o.jsx("code",{className:"auth-card-code"})}}),c&&o.jsxs(o.Fragment,{children:[" ",o.jsx(KA,{t:n,i18nKey:"blocks.oauthProvider",values:{provider:c},components:{code:o.jsx("code",{className:"auth-card-code"})}})," "]}),n("blocks.oauthContinue")]}),o.jsx("button",{className:"auth-card-btn",onClick:u,disabled:i==="authorizing"||!e.authUri,children:i==="authorizing"?o.jsxs(o.Fragment,{children:[o.jsx(fi,{className:"cw-i spin"})," ",n("blocks.waitingAuthorization")]}):o.jsx(o.Fragment,{children:n("blocks.authorize")})}),!e.authUri&&o.jsx("div",{className:"auth-card-err",children:n("blocks.missingAuthorizationUrl")}),s&&o.jsx("div",{className:"auth-card-err",children:s})]})}function TE({blocks:e,appName:t="",streaming:n=!1,onStreamFrame:i,onStreamComplete:r,onAction:s,onAuth:a,onArtifactDownload:l,onArtifactPreview:c,onResolveDelivery:u,onResolveDeliveryComparison:d,onDownloadDelivery:f,onDeployDelivery:h,onBranchSelect:p}){const g=e.reduce((b,v,y)=>v.kind==="text"?y:b,-1);return o.jsx(o.Fragment,{children:e.map((b,v)=>{switch(b.kind){case"progress":return o.jsx(dSt,{text:b.text},"build-progress");case"thinking":{const y=e.slice(v+1).some(x=>x.kind==="text"&&!!x.text.trim());return o.jsx(jCe,{text:b.text,done:b.done,answerStarted:y,streaming:n,onStreamFrame:i},v)}case"text":{const y=b.text.replace(/^\s+/,"");return y?o.jsx(hSt,{text:y,streaming:n,onStreamFrame:i,onStreamComplete:v===g?r:void 0},v):null}case"plan":return o.jsx(pSt,{title:b.title,summary:b.summary,items:b.items,done:b.done},v);case"attachment":return o.jsx(oI,{appName:t,items:b.files},v);case"artifact":return o.jsx(bSt,{block:b,onDownload:l,onPreview:c},v);case"delivery":return o.jsx(fSt,{value:b.value,onResolve:u,onResolveComparison:d,onDownload:f,onDeploy:h},v);case"invocation":return o.jsx(aI,{value:b.value},v);case"tool":{if(b.name===_Ce&&b.done)return null;const y=b.name==="create_agents"&&e.slice(v+1).some(x=>x.kind==="tool"&&x.name==="create_agents");return o.jsx(gSt,{name:b.name,args:b.args,response:b.response,done:b.done,status:b.status,defaultOpen:b.defaultOpen,retrying:b.name==="create_agents"&&(n||y),codexActivity:b.codexActivity,onBranchSelect:p,onAction:s},v)}case"agent-transfer":return null;case"auth":return o.jsx(ySt,{block:b,onAuth:a},v);case"a2ui":return VEe(b.messages).filter(y=>y.components[y.rootId]).map(y=>o.jsx(pr.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(q1t,{surface:y,onAction:s})},`${v}-${y.surfaceId}`));default:return null}})})}const vSt=()=>{};function xSt(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(Vt("conversation.unsupportedActivity"))}function wSt({activities:e}){const{t}=Ce("skills"),n=m.useMemo(()=>e.filter(i=>i.kind!=="status").map(xSt),[e]);return n.length===0?null:o.jsx("div",{className:"skill-conversation","aria-label":t("conversation.ariaLabel"),"aria-live":"polite",children:o.jsx(TE,{blocks:n,onAction:vSt})})}function KY(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m7 9 5 5 5-5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function SA({label:e,value:t,options:n,onChange:i,disabled:r=!1,allowCustom:s=!1,required:a=!1,placeholder:l,error:c}){const{t:u}=Ce("skills"),d=l??u("configSelect.placeholder"),f=m.useId(),h=m.useId(),p=m.useId(),g=m.useRef(null),b=m.useRef(null),v=m.useRef(null),y=m.useRef(null),x=m.useRef([]),O=n.findIndex(P=>P.value===t),w=t.trim().toLocaleLowerCase(),k=s&&w?n.filter(P=>P.value.toLocaleLowerCase().includes(w)||P.label.toLocaleLowerCase().includes(w)):n,[S,E]=m.useState(!1),[C,N]=m.useState(Math.max(0,O)),_=O>=0?n[O]:void 0,j=r||!s&&n.length===0,A=(P=!1)=>{E(!1),P&&window.requestAnimationFrame(()=>{var R,L;return s?(R=v.current)==null?void 0:R.focus():(L=b.current)==null?void 0:L.focus()})},F=P=>{j||k.length!==0&&(N(Math.min(Math.max(P,0),k.length-1)),E(!0))};m.useEffect(()=>{if(!S)return;const P=y.current,R=s?void 0:window.requestAnimationFrame(()=>{var I;(I=x.current[C])==null||I.focus()}),L=I=>{if(!P)return;const H=P.scrollTop<=0,Z=P.scrollTop+P.clientHeight>=P.scrollHeight-1;(P.scrollHeight<=P.clientHeight||I.deltaY<0&&H||I.deltaY>0&&Z)&&I.preventDefault(),I.stopPropagation()},M=I=>{var H;I.target instanceof Node&&!((H=g.current)!=null&&H.contains(I.target))&&A()},U=I=>{I.key==="Escape"&&A(!0)};return P==null||P.addEventListener("wheel",L,{passive:!1}),window.addEventListener("pointerdown",M),window.addEventListener("keydown",U),()=>{R!==void 0&&window.cancelAnimationFrame(R),P==null||P.removeEventListener("wheel",L),window.removeEventListener("pointerdown",M),window.removeEventListener("keydown",U)}},[C,s,S]);const T=P=>{var L;if(k.length===0)return;const R=(P+k.length)%k.length;N(R),(L=x.current[R])==null||L.focus()};return o.jsxs("div",{ref:g,className:`skill-config-select${S?" is-open":""}`,onBlur:P=>{var R;(!P.relatedTarget||!((R=g.current)!=null&&R.contains(P.relatedTarget)))&&A()},children:[o.jsxs("span",{id:h,className:"skill-config-select__label",children:[e,a?o.jsx("span",{className:"skill-required-mark","aria-hidden":"true",children:"*"}):null]}),s?o.jsxs("div",{className:`skill-config-select__trigger is-editable${r?" is-disabled":""}`,"aria-expanded":S,children:[o.jsx("input",{ref:v,value:t,disabled:r,role:"combobox","aria-autocomplete":"list","aria-expanded":S,"aria-controls":S?f:void 0,"aria-labelledby":h,"aria-required":a,"aria-invalid":!!c,"aria-describedby":c?p:void 0,placeholder:d,onChange:P=>{i(P.target.value),N(0),n.length>0&&E(!0)},onClick:()=>{!S&&k.length>0&&F(0)},onKeyDown:P=>{var R,L;if(!(P.nativeEvent.isComposing||P.keyCode===229))if(P.key==="ArrowDown")P.preventDefault(),S?(R=x.current[C])==null||R.focus():F(0);else if(P.key==="ArrowUp")P.preventDefault(),S?(L=x.current[k.length-1])==null||L.focus():F(k.length-1);else if(P.key==="Enter"&&S){P.preventDefault();const M=k[C];M&&i(M.value),A()}else P.key==="Escape"&&(P.preventDefault(),A())}}),o.jsx("button",{type:"button",className:"skill-config-select__toggle",disabled:r||n.length===0,"aria-label":u(S?"configSelect.collapseOptions":"configSelect.expandOptions"),onClick:()=>{S?A():F(0)},children:o.jsx(KY,{})})]}):o.jsxs("button",{ref:b,type:"button",className:"skill-config-select__trigger",disabled:j,"aria-haspopup":"listbox","aria-expanded":S,"aria-controls":S?f:void 0,"aria-labelledby":h,"aria-required":a,onClick:()=>{S?A():F(O>=0?O:0)},onKeyDown:P=>{P.key==="ArrowDown"?(P.preventDefault(),F(O>=0?O:0)):P.key==="ArrowUp"&&(P.preventDefault(),F(O>=0?O:n.length-1))},children:[o.jsx("span",{className:_?void 0:"is-placeholder",title:_==null?void 0:_.label,children:(_==null?void 0:_.label)||(n.length===0?u("configSelect.noOptions"):d)}),o.jsx(KY,{})]}),S?o.jsxs("div",{ref:y,id:f,className:"skill-config-select__menu",role:"listbox","aria-labelledby":h,children:[k.length===0?o.jsx("div",{className:"skill-config-select__empty",role:"status",children:u("configSelect.noMatches")}):null,k.map((P,R)=>{const L=P.value===t;return o.jsx("button",{ref:M=>{x.current[R]=M},type:"button",role:"option","aria-selected":L,tabIndex:R===C?0:-1,className:`skill-config-select__option${L?" is-selected":""}`,title:P.label,onFocus:()=>N(R),onClick:()=>{i(P.value),A(!0)},onKeyDown:M=>{M.key==="Enter"||M.key===" "?(M.preventDefault(),i(P.value),A(!0)):M.key==="ArrowDown"?(M.preventDefault(),T(R+1)):M.key==="ArrowUp"?(M.preventDefault(),T(R-1)):M.key==="Home"?(M.preventDefault(),T(0)):M.key==="End"&&(M.preventDefault(),T(n.length-1))},children:P.label},P.value)})]}):null,c?o.jsx("span",{id:p,className:"skill-config-select__error",role:"alert",children:c}):null]})}function ja(e,t){return e instanceof Error?e:typeof e=="string"&&e.trim()?new Error(e.trim()):new Error(t)}function cl({error:e}){var s,a,l,c,u;const{t}=Ce("skills"),n=e,i=(a=(s=n.originalError)==null?void 0:s.message)==null?void 0:a.trim(),r=[typeof n.status=="number"?`HTTP ${n.status}${n.statusText?` ${n.statusText}`:""}`:"",n.code?t("errorDetails.code",{code:n.code}):"",(l=n.originalError)!=null&&l.type?t("errorDetails.type",{type:n.originalError.type}):"",(c=n.originalError)!=null&&c.repr&&n.originalError.repr!==i?t("errorDetails.representation",{value:n.originalError.repr}):"",(u=n.rawResponse)!=null&&u.trim()?t("errorDetails.rawResponse",{value:n.rawResponse.trim()}):""].filter(Boolean);return o.jsxs("div",{className:"skill-error-details",children:[o.jsx("div",{className:"skill-error-details__summary",children:e.message}),i?o.jsx("div",{className:"skill-error-details__original",children:t("errorDetails.original",{message:i})}):null,r.length>0?o.jsxs("details",{children:[o.jsx("summary",{children:t("errorDetails.details")}),o.jsx("pre",{children:r.join(` `)})]}):null]})}const kU=Symbol.for("yaml.alias"),i$=Symbol.for("yaml.document"),rm=Symbol.for("yaml.map"),ICe=Symbol.for("yaml.pair"),zd=Symbol.for("yaml.scalar"),Xx=Symbol.for("yaml.seq"),ru=Symbol.for("yaml.node.type"),Yx=e=>!!e&&typeof e=="object"&&e[ru]===kU,AE=e=>!!e&&typeof e=="object"&&e[ru]===i$,_E=e=>!!e&&typeof e=="object"&&e[ru]===rm,Qs=e=>!!e&&typeof e=="object"&&e[ru]===ICe,Mr=e=>!!e&&typeof e=="object"&&e[ru]===zd,NE=e=>!!e&&typeof e=="object"&&e[ru]===Xx;function Fs(e){if(e&&typeof e=="object")switch(e[ru]){case rm:case Xx:return!0}return!1}function Us(e){if(e&&typeof e=="object")switch(e[ru]){case kU:case rm:case zd:case Xx:return!0}return!1}const PCe=e=>(Mr(e)||Fs(e))&&!!e.anchor,Sg=Symbol("break visit"),OSt=Symbol("skip children"),DO=Symbol("remove node");function Zx(e,t){const n=SSt(t);AE(e)?Iy(null,e.contents,n,Object.freeze([e]))===DO&&(e.contents=null):Iy(null,e,n,Object.freeze([]))}Zx.BREAK=Sg;Zx.SKIP=OSt;Zx.REMOVE=DO;function Iy(e,t,n,i){const r=kSt(e,t,n,i);if(Us(r)||Qs(r))return ESt(e,i,r),Iy(e,r,n,i);if(typeof r!="symbol"){if(Fs(t)){i=Object.freeze(i.concat(t));for(let s=0;se.replace(/[!,[\]{}]/g,t=>CSt[t]);class Io{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Io.defaultYaml,t),this.tags=Object.assign({},Io.defaultTags,n)}clone(){const t=new Io(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Io(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Io.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Io.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Io.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Io.defaultTags),this.atNextDocument=!1);const i=t.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;const[s,a]=i;return this.tags[s]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[s]=i;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const a=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,a),!1}}default:return n(0,`Unknown directive ${r}`,!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[,i,r]=t.match(/^(.*!)([^!]*)$/s);r||n(`The ${t} tag has no suffix`);const s=this.tags[i];if(s)try{return s+decodeURIComponent(r)}catch(a){return n(String(a)),null}return i==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,i]of Object.entries(this.tags))if(t.startsWith(i))return n+TSt(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags);let r;if(t&&i.length>0&&Us(t.contents)){const s={};Zx(t.contents,(a,l)=>{Us(l)&&l.tag&&(s[l.tag]=!0)}),r=Object.keys(s)}else r=[];for(const[s,a]of i)s==="!!"&&a==="tag:yaml.org,2002:"||(!t||r.some(l=>l.startsWith(a)))&&n.push(`%TAG ${s} ${a}`);return n.join(` `)}}Io.defaultYaml={explicit:!1,version:"1.2"};Io.defaultTags={"!!":"tag:yaml.org,2002:"};function DCe(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 MCe(e){const t=new Set;return Zx(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function LCe(e,t){for(let n=1;;++n){const i=`${e}${n}`;if(!t.has(i))return i}}function ASt(e,t){const n=[],i=new Map;let r=null;return{onAnchor:s=>{n.push(s),r??(r=MCe(e));const a=LCe(t,r);return r.add(a),a},setAnchors:()=>{for(const s of n){const a=i.get(s);if(typeof a=="object"&&a.anchor&&(Mr(a.node)||Fs(a.node)))a.node.anchor=a.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:i}}function Py(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;rtu(i,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!PCe(e))return e.toJSON(t,n);const i={aliasCount:0,count:1,res:void 0};n.anchors.set(e,i),n.onCreate=s=>{i.res=s,delete n.onCreate};const r=e.toJSON(t,n);return n.onCreate&&n.onCreate(r),r}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class EU{constructor(t){Object.defineProperty(this,ru,{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:i,onAnchor:r,reviver:s}={}){if(!AE(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 i=="number"?i:100},l=tu(this,"",a);if(typeof r=="function")for(const{count:c,res:u}of a.anchors.values())r(u,c);return typeof s=="function"?Py(s,{"":l},"",l):l}}let CU=class extends EU{constructor(t){super(kU),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 i;n!=null&&n.aliasResolveCache?i=n.aliasResolveCache:(i=[],Zx(t,{Node:(s,a)=>{(Yx(a)||PCe(a))&&i.push(a)}}),n&&(n.aliasResolveCache=i));let r;for(const s of i){if(s===this)break;s.anchor===this.source&&(r=s)}return r}toJSON(t,n){if(!n)return{source:this.source};const{anchors:i,doc:r,maxAliasCount:s}=n,a=this.resolve(r,n);if(!a){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let l=i.get(a);if(l||(tu(a,null,n),l=i.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(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=kA(r,a,i)),l.count*l.aliasCount>s)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return l.res}toString(t,n,i){const r=`*${this.source}`;if(t){if(DCe(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(t.implicitKey)return`${r} `}return r}};function kA(e,t,n){if(Yx(t)){const i=t.resolve(e),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(Fs(t)){let i=0;for(const r of t.items){const s=kA(e,r,n);s>i&&(i=s)}return i}else if(Qs(t)){const i=kA(e,t.key,n),r=kA(e,t.value,n);return Math.max(i,r)}return 1}const $Ce=e=>!e||typeof e!="function"&&typeof e!="object";class Wn extends EU{constructor(t){super(zd),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:tu(this.value,t,n)}toString(){return String(this.value)}}Wn.BLOCK_FOLDED="BLOCK_FOLDED";Wn.BLOCK_LITERAL="BLOCK_LITERAL";Wn.PLAIN="PLAIN";Wn.QUOTE_DOUBLE="QUOTE_DOUBLE";Wn.QUOTE_SINGLE="QUOTE_SINGLE";const _St="tag:yaml.org,2002:";function NSt(e,t,n){if(t){const i=n.filter(s=>s.tag===t),r=i.find(s=>!s.format)??i[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(i=>{var r;return((r=i.identify)==null?void 0:r.call(i,e))&&!i.format})}function GS(e,t,n){var f,h,p;if(AE(e)&&(e=e.contents),Us(e))return e;if(Qs(e)){const g=(h=(f=n.schema[rm]).createNode)==null?void 0:h.call(f,n.schema,null,n);return g.items.push(e),g}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:i,onAnchor:r,onTagObj:s,schema:a,sourceObjects:l}=n;let c;if(i&&e&&typeof e=="object"){if(c=l.get(e),c)return c.anchor??(c.anchor=r(e)),new CU(c.anchor);c={anchor:null,node:null},l.set(e,c)}t!=null&&t.startsWith("!!")&&(t=_St+t.slice(2));let u=NSt(e,t,a.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const g=new Wn(e);return c&&(c.node=g),g}u=e instanceof Map?a[rm]:Symbol.iterator in Object(e)?a[Xx]:a[rm]}s&&(s(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 Wn(e);return t?d.tag=t:u.default||(d.tag=u.tag),c&&(c.node=d),d}function EN(e,t,n){let i=n;for(let r=t.length-1;r>=0;--r){const s=t[r];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const a=[];a[s]=i,i=a}else i=new Map([[s,i]])}return GS(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Uw=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class FCe extends EU{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(i=>Us(i)||Qs(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Uw(t))this.add(n);else{const[i,...r]=t,s=this.get(i,!0);if(Fs(s))s.addIn(r,n);else if(s===void 0&&this.schema)this.set(i,EN(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(t){const[n,...i]=t;if(i.length===0)return this.delete(n);const r=this.get(n,!0);if(Fs(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(t,n){const[i,...r]=t,s=this.get(i,!0);return r.length===0?!n&&Mr(s)?s.value:s:Fs(s)?s.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Qs(n))return!1;const i=n.value;return i==null||t&&Mr(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(t){const[n,...i]=t;if(i.length===0)return this.has(n);const r=this.get(n,!0);return Fs(r)?r.hasIn(i):!1}setIn(t,n){const[i,...r]=t;if(r.length===0)this.set(i,n);else{const s=this.get(i,!0);if(Fs(s))s.setIn(r,n);else if(s===void 0&&this.schema)this.set(i,EN(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}}const jSt=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Xf(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Bg=(e,t,n)=>e.endsWith(` `)?Xf(n,t):n.includes(` @@ -700,19 +700,19 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(` `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var i;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const r="end"in n.value?n.value.end:void 0,s=Array.isArray(r)?r[r.length-1]:void 0;(s==null?void 0:s.type)==="comment"?r==null||r.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const r=t.items[t.items.length-2],s=(i=r==null?void 0:r.value)==null?void 0:i.end;if(Array.isArray(s)){TN(s,n.start),s.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,s=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(s&&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":s||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):s||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(Op(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(bTe(n.key)&&!Op(n.sep,"newline")){const l=U0(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(Op(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=U0(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||s?t.items.push({start:a,key:null,sep:[this.sourceToken]}):Op(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);s||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&&!Op(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 r&&t.items.push({start:a});this.stack.push(l);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var i;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0,s=Array.isArray(r)?r[r.length-1]:void 0;(s==null?void 0:s.type)==="comment"?r==null||r.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 r=t.items[t.items.length-2],s=(i=r==null?void 0:r.value)==null?void 0:i.end;if(Array.isArray(s)){TN(s,n.start),s.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||Op(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while((i==null?void 0:i.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 r=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const i=this.startBlockValue(t);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{const i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===t.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){const r=VT(i),s=U0(r);aZ(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:s,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=VT(t),i=U0(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=VT(t),i=U0(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.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 Nkt(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Akt||null,prettyErrors:t}}function yTe(e,t={}){const{lineCounter:n,prettyErrors:i}=Nkt(t),r=new _kt(n==null?void 0:n.addNewLine),s=new Skt(t);let a=null;for(const l of s.compose(r.parse(e),!0,e.length))if(!a)a=l;else if(a.options.logLevel!=="silent"){a.errors.push(new Qw(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(a.errors.forEach(tZ(e,n)),a.warnings.forEach(tZ(e,n))),a}function jkt(e,t,n){let i;const r=yTe(e,n);if(!r)return null;if(r.warnings.forEach(s=>QCe(r.options.logLevel,s)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},n))}function $U(e,t,n){let i=null;if(typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){const r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(e===void 0){const{keepUndefined:r}=n??t??{};if(!r)return}return AE(e)&&!i?e.toString(n):new RE(e,i,n).toString(n)}const vTe=1024;let Rkt=0,Wc=class{constructor(t,n){this.from=t,this.to=n}};class Ln{constructor(t={}){this.id=Rkt++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=ea.match(t)),n=>{let i=t(n);return i===void 0?null:[this,i]}}}Ln.closedBy=new Ln({deserialize:e=>e.split(" ")});Ln.openedBy=new Ln({deserialize:e=>e.split(" ")});Ln.group=new Ln({deserialize:e=>e.split(" ")});Ln.isolate=new Ln({deserialize:e=>{if(e&&e!="rtl"&&e!="ltr"&&e!="auto")throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}});Ln.contextHash=new Ln({perNode:!0});Ln.lookAhead=new Ln({perNode:!0});Ln.mounted=new Ln({perNode:!0});class lv{constructor(t,n,i,r=!1){this.tree=t,this.overlay=n,this.parser=i,this.bracketed=r}static get(t){return t&&t.props&&t.props[Ln.mounted.id]}}const Ikt=Object.create(null);class ea{constructor(t,n,i,r=0){this.name=t,this.props=n,this.id=i,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):Ikt,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),r=new ea(t.name||"",n,t.id,i);if(t.props){for(let s of t.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");n[s[0].id]=s[1]}}return r}prop(t){return this.props[t.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(t){if(typeof t=="string"){if(this.name==t)return!0;let n=this.prop(Ln.group);return n?n.indexOf(t)>-1:!1}return this.id==t}static match(t){let n=Object.create(null);for(let i in t)for(let r of i.split(" "))n[r]=t[i];return i=>{for(let r=i.prop(Ln.group),s=-1;s<(r?r.length:0);s++){let a=n[s<0?i.name:r[s]];if(a)return a}}}}ea.none=new ea("",Object.create(null),0,8);class t1{constructor(t){this.types=t;for(let n=0;n0;for(let c=this.cursor(a|er.IncludeAnonymous);;){let u=!1;if(c.from<=s&&c.to>=r&&(!l&&c.type.isAnonymous||n(c)!==!1)){if(c.firstChild())continue;u=!0}for(;u&&i&&(l||!c.type.isAnonymous)&&i(c),!c.nextSibling();){if(!c.parent())return;u=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let n in this.props)t.push([+n,this.props[n]]);return t}balance(t={}){return this.children.length<=8?this:UU(ea.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,r)=>new hi(this.type,n,i,r,this.propValues),t.makeTree||((n,i,r)=>new hi(ea.none,n,i,r)))}static build(t){return Lkt(t)}}hi.empty=new hi(ea.none,[],[],0);class FU{constructor(t,n){this.buffer=t,this.index=n}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 FU(this.buffer,this.index)}}class km{constructor(t,n,i){this.buffer=t,this.length=n,this.set=i}get type(){return ea.none}toString(){let t=[];for(let n=0;n0));c=a[c+3]);return l}slice(t,n,i){let r=this.buffer,s=new Uint16Array(n-t),a=0;for(let l=t,c=0;l=t&&nt;case 1:return n<=t&&i>t;case 2:return i>t;case 4:return!0}}function XS(e,t,n,i){for(var r;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to0?l.length:-1;t!=u;t+=n){let d=l[t],f=c[t]+a.from,h;if(!(!(s&er.EnterBracketed&&d instanceof hi&&(h=lv.get(d))&&!h.overlay&&h.bracketed&&i>=f&&i<=f+d.length)&&!xTe(r,i,f,f+d.length))){if(d instanceof km){if(s&er.ExcludeBuffers)continue;let p=d.findChild(0,d.buffer.length,n,i-f,r);if(p>-1)return new Td(new Pkt(a,d,t,f),null,p)}else if(s&er.IncludeAnonymous||!d.type.isAnonymous||BU(d)){let p;if(!(s&er.IgnoreMounts)&&(p=lv.get(d))&&!p.overlay)return new xo(p.tree,f,t,a);let g=new xo(d,f,t,a);return s&er.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(n<0?d.children.length-1:0,n,i,r,s)}}}if(s&er.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?t=a.index+n:t=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))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(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,n,i=0){let r;if(!(i&er.IgnoreOverlays)&&(r=lv.get(this._tree))&&r.overlay){let s=t-this.from,a=i&er.EnterBracketed&&r.bracketed;for(let{from:l,to:c}of r.overlay)if((n>0||a?l<=s:l=s:c>s))return new xo(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}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 lZ(e,t,n,i){let r=e.cursor(),s=[];if(!r.firstChild())return s;if(n!=null){for(let a=!1;!a;)if(a=r.type.is(n),!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(t)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function c$(e,t,n=t.length-1){for(let i=e;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[n]&&t[n]!=i.name)return!1;n--}}return!0}class Pkt{constructor(t,n,i,r){this.parent=t,this.buffer=n,this.index=i,this.start=r}}class Td extends wTe{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(t,n,i){super(),this.context=t,this._parent=n,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,n,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t,n-this.context.start,i);return s<0?null:new Td(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,n,i=0){if(i&er.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return s<0?null:new Td(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new Td(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Td(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],n=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let a=i.buffer[this.index+1];t.push(i.slice(r,s,a)),n.push(0)}return new hi(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function OTe(e){if(!e.length)return null;let t=0,n=e[0];for(let s=1;sn.from||a.to=t){let l=new xo(a.tree,a.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(XS(l,t,n,!1))}}return r?OTe(r):i}class AN{get name(){return this.type.name}constructor(t,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~er.EnterBracketed,t instanceof xo)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let i=t._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,n){this.index=t;let{start:i,buffer:r}=this.buffer;return this.type=n||r.set.types[r.buffer[t]],this.from=i+r.buffer[t+1],this.to=i+r.buffer[t+2],!0}yield(t){return t?t instanceof xo?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,n,i){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,n,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],t,n-this.buffer.start,i);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(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,n,i=this.mode){return this.buffer?i&er.ExcludeBuffers?!1:this.enterChild(1,t,n):this.yield(this._tree.enter(t,n,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&er.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&er.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:n}=this.buffer,i=this.stack.length-1;if(t<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(n.findChild(r,this.index,-1,0,4))}else{let r=n.buffer[this.index+3];if(r<(i<0?n.buffer.length:n.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let n,i,{buffer:r}=this;if(r){if(t>0){if(this.index-1)for(let s=n+t,a=t<0?-1:i._tree.children.length;s!=a;s+=t){let l=i._tree.children[s];if(this.mode&er.IncludeAnonymous||l instanceof km||!l.type.isAnonymous||BU(l))return!1}return!0}move(t,n){if(n&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,n=0){for(;(this.from==this.to||(n<1?this.from>=t:this.from>t)||(n>-1?this.to<=t:this.to=0;){for(let a=t;a;a=a._parent)if(a.index==r){if(r==this.index)return a;n=a,i=s+1;break e}r=this.stack[--s]}for(let r=i;r=0;s--){if(s<0)return c$(this._tree,t,r);let a=i[n.buffer[this.stack[s]]];if(!a.isAnonymous){if(t[r]&&t[r]!=a.name)return!1;r--}}return!0}}function BU(e){return e.children.some(t=>t instanceof km||!t.type.isAnonymous||BU(t))}function Lkt(e){var t;let{buffer:n,nodeSet:i,maxBufferLength:r=vTe,reused:s=[],minRepeatType:a=i.types.length}=e,l=Array.isArray(n)?new FU(n,n.length):n,c=i.types,u=0,d=0;function f(k,S,E,C,N,_){let{id:j,start:A,end:F,size:T}=l,P=d,R=u;if(T<0)if(l.next(),T==-1){let H=s[j];E.push(H),C.push(A-k);return}else if(T==-3){u=j;return}else if(T==-4){d=j;return}else throw new RangeError(`Unrecognized record size: ${T}`);let L=c[j],M,U,I=A-k;if(F-A<=r&&(U=v(l.pos-S,N))){let H=new Uint16Array(U.size-U.skip),K=l.pos-U.size,Q=H.length;for(;l.pos>K;)Q=y(U.start,H,Q);M=new km(H,F-U.start,i),I=U.start-k}else{let H=l.pos-T;l.next();let K=[],Q=[],q=j>=a?j:-1,B=0,ee=F;for(;l.pos>H;)q>=0&&l.id==q&&l.size>=0?(l.end<=ee-r&&(g(K,Q,A,B,l.end,ee,q,P,R),B=K.length,ee=l.end),l.next()):_>2500?h(A,H,K,Q):f(A,H,K,Q,q,_+1);if(q>=0&&B>0&&B-1&&B>0){let le=p(L,R);M=UU(L,K,Q,0,K.length,0,F-A,le,le)}else M=b(L,K,Q,F-A,P-F,R)}E.push(M),C.push(I)}function h(k,S,E,C){let N=[],_=0,j=-1;for(;l.pos>S;){let{id:A,start:F,end:T,size:P}=l;if(P>4)l.next();else{if(j>-1&&F=0;T-=3)A[P++]=N[T],A[P++]=N[T+1]-F,A[P++]=N[T+2]-F,A[P++]=P;E.push(new km(A,N[2]-F,i)),C.push(F-k)}}function p(k,S){return(E,C,N)=>{let _=0,j=E.length-1,A,F;if(j>=0&&(A=E[j])instanceof hi){if(!j&&A.type==k&&A.length==N)return A;(F=A.prop(Ln.lookAhead))&&(_=C[j]+A.length+F)}return b(k,E,C,N,_,S)}}function g(k,S,E,C,N,_,j,A,F){let T=[],P=[];for(;k.length>C;)T.push(k.pop()),P.push(S.pop()+E-N);k.push(b(i.types[j],T,P,_-N,A-_,F)),S.push(N-E)}function b(k,S,E,C,N,_,j){if(_){let A=[Ln.contextHash,_];j=j?[A].concat(j):[A]}if(N>25){let A=[Ln.lookAhead,N];j=j?[A].concat(j):[A]}return new hi(k,S,E,C,j)}function v(k,S){let E=l.fork(),C=0,N=0,_=0,j=E.end-r,A={size:0,start:0,skip:0};e:for(let F=E.pos-k;E.pos>F;){let T=E.size;if(E.id==S&&T>=0){A.size=C,A.start=N,A.skip=_,_+=4,C+=4,E.next();continue}let P=E.pos-T;if(T<0||P=a?4:0,L=E.start;for(E.next();E.pos>P;){if(E.size<0)if(E.size==-3||E.size==-4)R+=4;else break e;else E.id>=a&&(R+=4);E.next()}N=L,C+=T,_+=R}return(S<0||C==k)&&(A.size=C,A.start=N,A.skip=_),A.size>4?A:void 0}function y(k,S,E){let{id:C,start:N,end:_,size:j}=l;if(l.next(),j>=0&&C4){let F=l.pos-(j-4);for(;l.pos>F;)E=y(k,S,E)}S[--E]=A,S[--E]=_-k,S[--E]=N-k,S[--E]=C}else j==-3?u=C:j==-4&&(d=C);return E}let x=[],O=[];for(;l.pos>0;)f(e.start||0,e.bufferStart||0,x,O,-1,0);let w=(t=e.length)!==null&&t!==void 0?t:x.length?O[0]+x[0].length:0;return new hi(c[e.topID],x.reverse(),O.reverse(),w)}const cZ=new WeakMap;function TA(e,t){if(!e.isAnonymous||t instanceof km||t.type!=e)return 1;let n=cZ.get(t);if(n==null){n=1;for(let i of t.children){if(i.type!=e||!(i instanceof hi)){n=1;break}n+=TA(e,i)}cZ.set(t,n)}return n}function UU(e,t,n,i,r,s,a,l,c){let u=0;for(let g=i;g=d)break;S+=E}if(O==w+1){if(S>d){let E=g[w];p(E.children,E.positions,0,E.children.length,b[w]+x);continue}f.push(g[w])}else{let E=b[O-1]+g[O-1].length-k;f.push(UU(e,g,b,w,O,k,E,null,c))}h.push(k+x-s)}}return p(t,n,i,r,0),(l||c)(f,h,a)}class QU{constructor(){this.map=new WeakMap}setBuffer(t,n,i){let r=this.map.get(t);r||this.map.set(t,r=new Map),r.set(n,i)}getBuffer(t,n){let i=this.map.get(t);return i&&i.get(n)}set(t,n){t instanceof Td?this.setBuffer(t.context.buffer,t.index,n):t instanceof xo&&this.map.set(t.tree,n)}get(t){return t instanceof Td?this.getBuffer(t.context.buffer,t.index):t instanceof xo?this.map.get(t.tree):void 0}cursorSet(t,n){t.buffer?this.setBuffer(t.buffer.buffer,t.index,n):this.map.set(t.tree,n)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class uh{constructor(t,n,i,r,s=!1,a=!1){this.from=t,this.to=n,this.tree=i,this.offset=r,this.open=(s?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],i=!1){let r=[new uh(0,t.length,t,0,!1,i)];for(let s of n)s.to>t.length&&r.push(s);return r}static applyChanges(t,n,i=128){if(!n.length)return t;let r=[],s=1,a=t.length?t[0]:null;for(let l=0,c=0,u=0;;l++){let d=l=i)for(;a&&a.from=h.from||f<=h.to||u){let p=Math.max(h.from,c)-u,g=Math.min(h.to,f)-u;h=p>=g?null:new uh(p,g,h.tree,h.offset+u,l>0,!!d)}if(h&&r.push(h),a.to>f)break;a=snew Wc(r.from,r.to)):[new Wc(0,0)]:[new Wc(0,t.length)],this.createParse(t,n||[],i)}parse(t,n,i){let r=this.startParse(t,n,i);for(;;){let s=r.advance();if(s)return s}}}class $kt{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,n){return this.string.slice(t,n)}}function STe(e){return(t,n,i,r)=>new Bkt(t,e,n,i,r)}class uZ{constructor(t,n,i,r,s,a){this.parser=t,this.parse=n,this.overlay=i,this.bracketed=r,this.target=s,this.from=a}}function dZ(e){if(!e.length||e.some(t=>t.from>=t.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(e))}class Fkt{constructor(t,n,i,r,s,a,l,c){this.parser=t,this.predicate=n,this.mounts=i,this.index=r,this.start=s,this.bracketed=a,this.target=l,this.prev=c,this.depth=0,this.ranges=[]}}const u$=new Ln({perNode:!0});class Bkt{constructor(t,n,i,r,s){this.nest=n,this.input=i,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new hi(i.type,i.children,i.positions,i.length,i.propValues.concat([[u$,this.stoppedAt]]))),i}let t=this.inner[this.innerDone],n=t.parse.advance();if(n){this.innerDone++;let i=Object.assign(Object.create(null),t.target.props);i[Ln.mounted.id]=new lv(n,t.overlay,t.parser,t.bracketed),t.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let t=this.input.length;for(let n=this.innerDone;n=this.stoppedAt)l=!1;else if(t.hasNode(r)){if(n){let u=n.mounts.find(d=>d.frag.from<=r.from&&d.frag.to>=r.to&&d.mount.overlay);if(u)for(let d of u.mount.overlay){let f=d.from+u.pos,h=d.to+u.pos;f>=r.from&&h<=r.to&&!n.ranges.some(p=>p.fromf)&&n.ranges.push({from:f,to:h})}}l=!1}else if(i&&(a=Ukt(i.ranges,r.from,r.to)))l=a!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew Wc(f.from-r.from,f.to-r.from)):null,!!s.bracketed,r.tree,d.length?d[0].from:r.from)),s.overlay?d.length&&(i={ranges:d,depth:0,prev:i}):l=!1}}else if(n&&(c=n.predicate(r))&&(c===!0&&(c=new Wc(r.from,r.to)),c.from=0&&n.ranges[u].to==c.from?n.ranges[u]={from:n.ranges[u].from,to:c.to}:n.ranges.push(c)}if(l&&r.firstChild())n&&n.depth++,i&&i.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(n&&!--n.depth){let u=pZ(this.ranges,n.ranges);u.length&&(dZ(u),this.inner.splice(n.index,0,new uZ(n.parser,n.parser.startParse(this.input,mZ(n.mounts,u),u),n.ranges.map(d=>new Wc(d.from-n.start,d.to-n.start)),n.bracketed,n.target,u[0].from))),n=n.prev}i&&!--i.depth&&(i=i.prev)}}}}function Ukt(e,t,n){for(let i of e){if(i.from>=n)break;if(i.to>t)return i.from<=t&&i.to>=n?2:1}return 0}function fZ(e,t,n,i,r,s){if(t=t&&n.enter(i,1,er.IgnoreOverlays|er.ExcludeBuffers)))if(n.to<=t)n.next(!1)||(this.done=!0);else break}hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==t.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof hi)n=n.children[0];else break}return!1}}let zkt=class{constructor(t){var n;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){let i=this.curFrag=t[0];this.curTo=(n=i.tree.prop(u$))!==null&&n!==void 0?n:i.to,this.inner=new hZ(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t)}nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(t=n.tree.prop(u$))!==null&&t!==void 0?t:n.to,this.inner=new hZ(n.tree,-n.offset)}}findMounts(t,n){var i;let r=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let s=this.inner.cursor.node;s;s=s.parent){let a=(i=s.tree)===null||i===void 0?void 0:i.prop(Ln.mounted);if(a&&a.parser==n)for(let l=this.fragI;l=s.to)break;c.tree==this.curFrag.tree&&r.push({frag:c,pos:s.from-c.offset,mount:a})}}}return r}};function pZ(e,t){let n=null,i=t;for(let r=1,s=0;r=l)break;c.to<=a||(n||(i=n=t.slice()),c.froml&&n.splice(s+1,0,new Wc(l,c.to))):c.to>l?n[s--]=new Wc(l,c.to):n.splice(s--,1))}}return i}function Vkt(e,t,n,i){let r=0,s=0,a=!1,l=!1,c=-1e9,u=[];for(;;){let d=r==e.length?1e9:a?e[r].to:e[r].from,f=s==t.length?1e9:l?t[s].to:t[s].from;if(a!=l){let h=Math.max(c,n),p=Math.min(d,f,i);hnew Wc(h.from+i,h.to+i)),f=Vkt(t,d,c,u);for(let h=0,p=c;;h++){let g=h==f.length,b=g?u:f[h].from;if(b>p&&n.push(new uh(p,b,r.tree,-a,s.from>=p||s.openStart,s.to<=b||s.openEnd)),g)break;p=f[h].to}}else n.push(new uh(c,u,r.tree,-a,s.from>=a||s.openStart,s.to<=l||s.openEnd))}return n}let d$=[],kTe=[];(()=>{let e="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(t=>t?parseInt(t,36):1);for(let t=0,n=0;t>1;if(e=kTe[i])t=i+1;else return!0;if(t==n)return!1}}function gZ(e){return e>=127462&&e<=127487}const bZ=8205;function qkt(e,t,n=!0,i=!0){return(n?ETe:Wkt)(e,t,i)}function ETe(e,t,n){if(t==e.length)return t;t&&CTe(e.charCodeAt(t))&&TTe(e.charCodeAt(t-1))&&t--;let i=n5(e,t);for(t+=yZ(i);t=0&&gZ(n5(e,a));)s++,a-=2;if(s%2==0)break;t+=2}else break}return t}function Wkt(e,t,n){for(;t>1;){let i=ETe(e,t-2,n);if(i=56320&&e<57344}function TTe(e){return e>=55296&&e<56320}function yZ(e){return e<65536?1:2}let Gi=class ATe{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,n,i){[t,n]=ix(this,t,n);let r=[];return this.decompose(0,t,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(n,this.length,r,1),yd.from(r,this.length-(n-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,n=this.length){[t,n]=ix(this,t,n);let i=[];return this.decompose(t,n,i,0),yd.from(i,n-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let n=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),r=new LO(this),s=new LO(t);for(let a=n,l=n;;){if(r.next(a),s.next(a),a=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=i)return!0}}iter(t=1){return new LO(this,t)}iterRange(t,n=this.length){return new _Te(this,t,n)}iterLines(t,n){let i;if(t==null)i=this.iter();else{n==null&&(n=this.lines+1);let r=this.line(t).from;i=this.iterRange(r,Math.max(r,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new NTe(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?ATe.empty:t.length<=32?new Ps(t):yd.from(Ps.split(t,[]))}};class Ps extends Gi{constructor(t,n=Gkt(t)){super(),this.text=t,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(t,n,i,r){for(let s=0;;s++){let a=this.text[s],l=r+a.length;if((n?i:l)>=t)return new Kkt(r,l,i,a);r=l+1,i++}}decompose(t,n,i,r){let s=t<=0&&n>=this.length?this:new Ps(vZ(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(r&1){let a=i.pop(),l=AA(s.text,a.text.slice(),0,s.length);if(l.length<=32)i.push(new Ps(l,a.length+s.length));else{let c=l.length>>1;i.push(new Ps(l.slice(0,c)),new Ps(l.slice(c)))}}else i.push(s)}replace(t,n,i){if(!(i instanceof Ps))return super.replace(t,n,i);[t,n]=ix(this,t,n);let r=AA(this.text,AA(i.text,vZ(this.text,0,t)),n),s=this.length+i.length-(n-t);return r.length<=32?new Ps(r,s):yd.from(Ps.split(r,[]),s)}sliceString(t,n=this.length,i=` +`,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=VT(t),i=U0(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=VT(t),i=U0(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.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 Nkt(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Akt||null,prettyErrors:t}}function yTe(e,t={}){const{lineCounter:n,prettyErrors:i}=Nkt(t),r=new _kt(n==null?void 0:n.addNewLine),s=new Skt(t);let a=null;for(const l of s.compose(r.parse(e),!0,e.length))if(!a)a=l;else if(a.options.logLevel!=="silent"){a.errors.push(new Qw(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(a.errors.forEach(tZ(e,n)),a.warnings.forEach(tZ(e,n))),a}function jkt(e,t,n){let i;const r=yTe(e,n);if(!r)return null;if(r.warnings.forEach(s=>QCe(r.options.logLevel,s)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},n))}function $U(e,t,n){let i=null;if(typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){const r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(e===void 0){const{keepUndefined:r}=n??t??{};if(!r)return}return AE(e)&&!i?e.toString(n):new RE(e,i,n).toString(n)}const vTe=1024;let Rkt=0,Wc=class{constructor(t,n){this.from=t,this.to=n}};class Ln{constructor(t={}){this.id=Rkt++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=ea.match(t)),n=>{let i=t(n);return i===void 0?null:[this,i]}}}Ln.closedBy=new Ln({deserialize:e=>e.split(" ")});Ln.openedBy=new Ln({deserialize:e=>e.split(" ")});Ln.group=new Ln({deserialize:e=>e.split(" ")});Ln.isolate=new Ln({deserialize:e=>{if(e&&e!="rtl"&&e!="ltr"&&e!="auto")throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}});Ln.contextHash=new Ln({perNode:!0});Ln.lookAhead=new Ln({perNode:!0});Ln.mounted=new Ln({perNode:!0});class lv{constructor(t,n,i,r=!1){this.tree=t,this.overlay=n,this.parser=i,this.bracketed=r}static get(t){return t&&t.props&&t.props[Ln.mounted.id]}}const Ikt=Object.create(null);class ea{constructor(t,n,i,r=0){this.name=t,this.props=n,this.id=i,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):Ikt,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),r=new ea(t.name||"",n,t.id,i);if(t.props){for(let s of t.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");n[s[0].id]=s[1]}}return r}prop(t){return this.props[t.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(t){if(typeof t=="string"){if(this.name==t)return!0;let n=this.prop(Ln.group);return n?n.indexOf(t)>-1:!1}return this.id==t}static match(t){let n=Object.create(null);for(let i in t)for(let r of i.split(" "))n[r]=t[i];return i=>{for(let r=i.prop(Ln.group),s=-1;s<(r?r.length:0);s++){let a=n[s<0?i.name:r[s]];if(a)return a}}}}ea.none=new ea("",Object.create(null),0,8);class t1{constructor(t){this.types=t;for(let n=0;n0;for(let c=this.cursor(a|er.IncludeAnonymous);;){let u=!1;if(c.from<=s&&c.to>=r&&(!l&&c.type.isAnonymous||n(c)!==!1)){if(c.firstChild())continue;u=!0}for(;u&&i&&(l||!c.type.isAnonymous)&&i(c),!c.nextSibling();){if(!c.parent())return;u=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let n in this.props)t.push([+n,this.props[n]]);return t}balance(t={}){return this.children.length<=8?this:UU(ea.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,r)=>new hi(this.type,n,i,r,this.propValues),t.makeTree||((n,i,r)=>new hi(ea.none,n,i,r)))}static build(t){return Lkt(t)}}hi.empty=new hi(ea.none,[],[],0);class FU{constructor(t,n){this.buffer=t,this.index=n}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 FU(this.buffer,this.index)}}class km{constructor(t,n,i){this.buffer=t,this.length=n,this.set=i}get type(){return ea.none}toString(){let t=[];for(let n=0;n0));c=a[c+3]);return l}slice(t,n,i){let r=this.buffer,s=new Uint16Array(n-t),a=0;for(let l=t,c=0;l=t&&nt;case 1:return n<=t&&i>t;case 2:return i>t;case 4:return!0}}function XS(e,t,n,i){for(var r;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to0?l.length:-1;t!=u;t+=n){let d=l[t],f=c[t]+a.from,h;if(!(!(s&er.EnterBracketed&&d instanceof hi&&(h=lv.get(d))&&!h.overlay&&h.bracketed&&i>=f&&i<=f+d.length)&&!xTe(r,i,f,f+d.length))){if(d instanceof km){if(s&er.ExcludeBuffers)continue;let p=d.findChild(0,d.buffer.length,n,i-f,r);if(p>-1)return new Td(new Pkt(a,d,t,f),null,p)}else if(s&er.IncludeAnonymous||!d.type.isAnonymous||BU(d)){let p;if(!(s&er.IgnoreMounts)&&(p=lv.get(d))&&!p.overlay)return new xo(p.tree,f,t,a);let g=new xo(d,f,t,a);return s&er.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(n<0?d.children.length-1:0,n,i,r,s)}}}if(s&er.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?t=a.index+n:t=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))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(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,n,i=0){let r;if(!(i&er.IgnoreOverlays)&&(r=lv.get(this._tree))&&r.overlay){let s=t-this.from,a=i&er.EnterBracketed&&r.bracketed;for(let{from:l,to:c}of r.overlay)if((n>0||a?l<=s:l=s:c>s))return new xo(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}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 lZ(e,t,n,i){let r=e.cursor(),s=[];if(!r.firstChild())return s;if(n!=null){for(let a=!1;!a;)if(a=r.type.is(n),!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(t)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function c$(e,t,n=t.length-1){for(let i=e;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[n]&&t[n]!=i.name)return!1;n--}}return!0}class Pkt{constructor(t,n,i,r){this.parent=t,this.buffer=n,this.index=i,this.start=r}}class Td extends wTe{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(t,n,i){super(),this.context=t,this._parent=n,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,n,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t,n-this.context.start,i);return s<0?null:new Td(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,n,i=0){if(i&er.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return s<0?null:new Td(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new Td(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Td(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],n=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let a=i.buffer[this.index+1];t.push(i.slice(r,s,a)),n.push(0)}return new hi(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function OTe(e){if(!e.length)return null;let t=0,n=e[0];for(let s=1;sn.from||a.to=t){let l=new xo(a.tree,a.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(XS(l,t,n,!1))}}return r?OTe(r):i}class AN{get name(){return this.type.name}constructor(t,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~er.EnterBracketed,t instanceof xo)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let i=t._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,n){this.index=t;let{start:i,buffer:r}=this.buffer;return this.type=n||r.set.types[r.buffer[t]],this.from=i+r.buffer[t+1],this.to=i+r.buffer[t+2],!0}yield(t){return t?t instanceof xo?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,n,i){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,n,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],t,n-this.buffer.start,i);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(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,n,i=this.mode){return this.buffer?i&er.ExcludeBuffers?!1:this.enterChild(1,t,n):this.yield(this._tree.enter(t,n,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&er.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&er.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:n}=this.buffer,i=this.stack.length-1;if(t<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(n.findChild(r,this.index,-1,0,4))}else{let r=n.buffer[this.index+3];if(r<(i<0?n.buffer.length:n.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let n,i,{buffer:r}=this;if(r){if(t>0){if(this.index-1)for(let s=n+t,a=t<0?-1:i._tree.children.length;s!=a;s+=t){let l=i._tree.children[s];if(this.mode&er.IncludeAnonymous||l instanceof km||!l.type.isAnonymous||BU(l))return!1}return!0}move(t,n){if(n&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,n=0){for(;(this.from==this.to||(n<1?this.from>=t:this.from>t)||(n>-1?this.to<=t:this.to=0;){for(let a=t;a;a=a._parent)if(a.index==r){if(r==this.index)return a;n=a,i=s+1;break e}r=this.stack[--s]}for(let r=i;r=0;s--){if(s<0)return c$(this._tree,t,r);let a=i[n.buffer[this.stack[s]]];if(!a.isAnonymous){if(t[r]&&t[r]!=a.name)return!1;r--}}return!0}}function BU(e){return e.children.some(t=>t instanceof km||!t.type.isAnonymous||BU(t))}function Lkt(e){var t;let{buffer:n,nodeSet:i,maxBufferLength:r=vTe,reused:s=[],minRepeatType:a=i.types.length}=e,l=Array.isArray(n)?new FU(n,n.length):n,c=i.types,u=0,d=0;function f(k,S,E,C,N,_){let{id:j,start:A,end:F,size:T}=l,P=d,R=u;if(T<0)if(l.next(),T==-1){let H=s[j];E.push(H),C.push(A-k);return}else if(T==-3){u=j;return}else if(T==-4){d=j;return}else throw new RangeError(`Unrecognized record size: ${T}`);let L=c[j],M,U,I=A-k;if(F-A<=r&&(U=v(l.pos-S,N))){let H=new Uint16Array(U.size-U.skip),Z=l.pos-U.size,Q=H.length;for(;l.pos>Z;)Q=y(U.start,H,Q);M=new km(H,F-U.start,i),I=U.start-k}else{let H=l.pos-T;l.next();let Z=[],Q=[],q=j>=a?j:-1,B=0,te=F;for(;l.pos>H;)q>=0&&l.id==q&&l.size>=0?(l.end<=te-r&&(g(Z,Q,A,B,l.end,te,q,P,R),B=Z.length,te=l.end),l.next()):_>2500?h(A,H,Z,Q):f(A,H,Z,Q,q,_+1);if(q>=0&&B>0&&B-1&&B>0){let ce=p(L,R);M=UU(L,Z,Q,0,Z.length,0,F-A,ce,ce)}else M=b(L,Z,Q,F-A,P-F,R)}E.push(M),C.push(I)}function h(k,S,E,C){let N=[],_=0,j=-1;for(;l.pos>S;){let{id:A,start:F,end:T,size:P}=l;if(P>4)l.next();else{if(j>-1&&F=0;T-=3)A[P++]=N[T],A[P++]=N[T+1]-F,A[P++]=N[T+2]-F,A[P++]=P;E.push(new km(A,N[2]-F,i)),C.push(F-k)}}function p(k,S){return(E,C,N)=>{let _=0,j=E.length-1,A,F;if(j>=0&&(A=E[j])instanceof hi){if(!j&&A.type==k&&A.length==N)return A;(F=A.prop(Ln.lookAhead))&&(_=C[j]+A.length+F)}return b(k,E,C,N,_,S)}}function g(k,S,E,C,N,_,j,A,F){let T=[],P=[];for(;k.length>C;)T.push(k.pop()),P.push(S.pop()+E-N);k.push(b(i.types[j],T,P,_-N,A-_,F)),S.push(N-E)}function b(k,S,E,C,N,_,j){if(_){let A=[Ln.contextHash,_];j=j?[A].concat(j):[A]}if(N>25){let A=[Ln.lookAhead,N];j=j?[A].concat(j):[A]}return new hi(k,S,E,C,j)}function v(k,S){let E=l.fork(),C=0,N=0,_=0,j=E.end-r,A={size:0,start:0,skip:0};e:for(let F=E.pos-k;E.pos>F;){let T=E.size;if(E.id==S&&T>=0){A.size=C,A.start=N,A.skip=_,_+=4,C+=4,E.next();continue}let P=E.pos-T;if(T<0||P=a?4:0,L=E.start;for(E.next();E.pos>P;){if(E.size<0)if(E.size==-3||E.size==-4)R+=4;else break e;else E.id>=a&&(R+=4);E.next()}N=L,C+=T,_+=R}return(S<0||C==k)&&(A.size=C,A.start=N,A.skip=_),A.size>4?A:void 0}function y(k,S,E){let{id:C,start:N,end:_,size:j}=l;if(l.next(),j>=0&&C4){let F=l.pos-(j-4);for(;l.pos>F;)E=y(k,S,E)}S[--E]=A,S[--E]=_-k,S[--E]=N-k,S[--E]=C}else j==-3?u=C:j==-4&&(d=C);return E}let x=[],O=[];for(;l.pos>0;)f(e.start||0,e.bufferStart||0,x,O,-1,0);let w=(t=e.length)!==null&&t!==void 0?t:x.length?O[0]+x[0].length:0;return new hi(c[e.topID],x.reverse(),O.reverse(),w)}const cZ=new WeakMap;function TA(e,t){if(!e.isAnonymous||t instanceof km||t.type!=e)return 1;let n=cZ.get(t);if(n==null){n=1;for(let i of t.children){if(i.type!=e||!(i instanceof hi)){n=1;break}n+=TA(e,i)}cZ.set(t,n)}return n}function UU(e,t,n,i,r,s,a,l,c){let u=0;for(let g=i;g=d)break;S+=E}if(O==w+1){if(S>d){let E=g[w];p(E.children,E.positions,0,E.children.length,b[w]+x);continue}f.push(g[w])}else{let E=b[O-1]+g[O-1].length-k;f.push(UU(e,g,b,w,O,k,E,null,c))}h.push(k+x-s)}}return p(t,n,i,r,0),(l||c)(f,h,a)}class QU{constructor(){this.map=new WeakMap}setBuffer(t,n,i){let r=this.map.get(t);r||this.map.set(t,r=new Map),r.set(n,i)}getBuffer(t,n){let i=this.map.get(t);return i&&i.get(n)}set(t,n){t instanceof Td?this.setBuffer(t.context.buffer,t.index,n):t instanceof xo&&this.map.set(t.tree,n)}get(t){return t instanceof Td?this.getBuffer(t.context.buffer,t.index):t instanceof xo?this.map.get(t.tree):void 0}cursorSet(t,n){t.buffer?this.setBuffer(t.buffer.buffer,t.index,n):this.map.set(t.tree,n)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class uh{constructor(t,n,i,r,s=!1,a=!1){this.from=t,this.to=n,this.tree=i,this.offset=r,this.open=(s?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],i=!1){let r=[new uh(0,t.length,t,0,!1,i)];for(let s of n)s.to>t.length&&r.push(s);return r}static applyChanges(t,n,i=128){if(!n.length)return t;let r=[],s=1,a=t.length?t[0]:null;for(let l=0,c=0,u=0;;l++){let d=l=i)for(;a&&a.from=h.from||f<=h.to||u){let p=Math.max(h.from,c)-u,g=Math.min(h.to,f)-u;h=p>=g?null:new uh(p,g,h.tree,h.offset+u,l>0,!!d)}if(h&&r.push(h),a.to>f)break;a=snew Wc(r.from,r.to)):[new Wc(0,0)]:[new Wc(0,t.length)],this.createParse(t,n||[],i)}parse(t,n,i){let r=this.startParse(t,n,i);for(;;){let s=r.advance();if(s)return s}}}class $kt{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,n){return this.string.slice(t,n)}}function STe(e){return(t,n,i,r)=>new Bkt(t,e,n,i,r)}class uZ{constructor(t,n,i,r,s,a){this.parser=t,this.parse=n,this.overlay=i,this.bracketed=r,this.target=s,this.from=a}}function dZ(e){if(!e.length||e.some(t=>t.from>=t.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(e))}class Fkt{constructor(t,n,i,r,s,a,l,c){this.parser=t,this.predicate=n,this.mounts=i,this.index=r,this.start=s,this.bracketed=a,this.target=l,this.prev=c,this.depth=0,this.ranges=[]}}const u$=new Ln({perNode:!0});class Bkt{constructor(t,n,i,r,s){this.nest=n,this.input=i,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new hi(i.type,i.children,i.positions,i.length,i.propValues.concat([[u$,this.stoppedAt]]))),i}let t=this.inner[this.innerDone],n=t.parse.advance();if(n){this.innerDone++;let i=Object.assign(Object.create(null),t.target.props);i[Ln.mounted.id]=new lv(n,t.overlay,t.parser,t.bracketed),t.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let t=this.input.length;for(let n=this.innerDone;n=this.stoppedAt)l=!1;else if(t.hasNode(r)){if(n){let u=n.mounts.find(d=>d.frag.from<=r.from&&d.frag.to>=r.to&&d.mount.overlay);if(u)for(let d of u.mount.overlay){let f=d.from+u.pos,h=d.to+u.pos;f>=r.from&&h<=r.to&&!n.ranges.some(p=>p.fromf)&&n.ranges.push({from:f,to:h})}}l=!1}else if(i&&(a=Ukt(i.ranges,r.from,r.to)))l=a!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew Wc(f.from-r.from,f.to-r.from)):null,!!s.bracketed,r.tree,d.length?d[0].from:r.from)),s.overlay?d.length&&(i={ranges:d,depth:0,prev:i}):l=!1}}else if(n&&(c=n.predicate(r))&&(c===!0&&(c=new Wc(r.from,r.to)),c.from=0&&n.ranges[u].to==c.from?n.ranges[u]={from:n.ranges[u].from,to:c.to}:n.ranges.push(c)}if(l&&r.firstChild())n&&n.depth++,i&&i.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(n&&!--n.depth){let u=pZ(this.ranges,n.ranges);u.length&&(dZ(u),this.inner.splice(n.index,0,new uZ(n.parser,n.parser.startParse(this.input,mZ(n.mounts,u),u),n.ranges.map(d=>new Wc(d.from-n.start,d.to-n.start)),n.bracketed,n.target,u[0].from))),n=n.prev}i&&!--i.depth&&(i=i.prev)}}}}function Ukt(e,t,n){for(let i of e){if(i.from>=n)break;if(i.to>t)return i.from<=t&&i.to>=n?2:1}return 0}function fZ(e,t,n,i,r,s){if(t=t&&n.enter(i,1,er.IgnoreOverlays|er.ExcludeBuffers)))if(n.to<=t)n.next(!1)||(this.done=!0);else break}hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==t.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof hi)n=n.children[0];else break}return!1}}let zkt=class{constructor(t){var n;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){let i=this.curFrag=t[0];this.curTo=(n=i.tree.prop(u$))!==null&&n!==void 0?n:i.to,this.inner=new hZ(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t)}nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(t=n.tree.prop(u$))!==null&&t!==void 0?t:n.to,this.inner=new hZ(n.tree,-n.offset)}}findMounts(t,n){var i;let r=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let s=this.inner.cursor.node;s;s=s.parent){let a=(i=s.tree)===null||i===void 0?void 0:i.prop(Ln.mounted);if(a&&a.parser==n)for(let l=this.fragI;l=s.to)break;c.tree==this.curFrag.tree&&r.push({frag:c,pos:s.from-c.offset,mount:a})}}}return r}};function pZ(e,t){let n=null,i=t;for(let r=1,s=0;r=l)break;c.to<=a||(n||(i=n=t.slice()),c.froml&&n.splice(s+1,0,new Wc(l,c.to))):c.to>l?n[s--]=new Wc(l,c.to):n.splice(s--,1))}}return i}function Vkt(e,t,n,i){let r=0,s=0,a=!1,l=!1,c=-1e9,u=[];for(;;){let d=r==e.length?1e9:a?e[r].to:e[r].from,f=s==t.length?1e9:l?t[s].to:t[s].from;if(a!=l){let h=Math.max(c,n),p=Math.min(d,f,i);hnew Wc(h.from+i,h.to+i)),f=Vkt(t,d,c,u);for(let h=0,p=c;;h++){let g=h==f.length,b=g?u:f[h].from;if(b>p&&n.push(new uh(p,b,r.tree,-a,s.from>=p||s.openStart,s.to<=b||s.openEnd)),g)break;p=f[h].to}}else n.push(new uh(c,u,r.tree,-a,s.from>=a||s.openStart,s.to<=l||s.openEnd))}return n}let d$=[],kTe=[];(()=>{let e="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(t=>t?parseInt(t,36):1);for(let t=0,n=0;t>1;if(e=kTe[i])t=i+1;else return!0;if(t==n)return!1}}function gZ(e){return e>=127462&&e<=127487}const bZ=8205;function qkt(e,t,n=!0,i=!0){return(n?ETe:Wkt)(e,t,i)}function ETe(e,t,n){if(t==e.length)return t;t&&CTe(e.charCodeAt(t))&&TTe(e.charCodeAt(t-1))&&t--;let i=n5(e,t);for(t+=yZ(i);t=0&&gZ(n5(e,a));)s++,a-=2;if(s%2==0)break;t+=2}else break}return t}function Wkt(e,t,n){for(;t>1;){let i=ETe(e,t-2,n);if(i=56320&&e<57344}function TTe(e){return e>=55296&&e<56320}function yZ(e){return e<65536?1:2}let Gi=class ATe{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,n,i){[t,n]=ix(this,t,n);let r=[];return this.decompose(0,t,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(n,this.length,r,1),yd.from(r,this.length-(n-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,n=this.length){[t,n]=ix(this,t,n);let i=[];return this.decompose(t,n,i,0),yd.from(i,n-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let n=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),r=new LO(this),s=new LO(t);for(let a=n,l=n;;){if(r.next(a),s.next(a),a=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=i)return!0}}iter(t=1){return new LO(this,t)}iterRange(t,n=this.length){return new _Te(this,t,n)}iterLines(t,n){let i;if(t==null)i=this.iter();else{n==null&&(n=this.lines+1);let r=this.line(t).from;i=this.iterRange(r,Math.max(r,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new NTe(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?ATe.empty:t.length<=32?new Ps(t):yd.from(Ps.split(t,[]))}};class Ps extends Gi{constructor(t,n=Gkt(t)){super(),this.text=t,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(t,n,i,r){for(let s=0;;s++){let a=this.text[s],l=r+a.length;if((n?i:l)>=t)return new Kkt(r,l,i,a);r=l+1,i++}}decompose(t,n,i,r){let s=t<=0&&n>=this.length?this:new Ps(vZ(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(r&1){let a=i.pop(),l=AA(s.text,a.text.slice(),0,s.length);if(l.length<=32)i.push(new Ps(l,a.length+s.length));else{let c=l.length>>1;i.push(new Ps(l.slice(0,c)),new Ps(l.slice(c)))}}else i.push(s)}replace(t,n,i){if(!(i instanceof Ps))return super.replace(t,n,i);[t,n]=ix(this,t,n);let r=AA(this.text,AA(i.text,vZ(this.text,0,t)),n),s=this.length+i.length-(n-t);return r.length<=32?new Ps(r,s):yd.from(Ps.split(r,[]),s)}sliceString(t,n=this.length,i=` `){[t,n]=ix(this,t,n);let r="";for(let s=0,a=0;s<=n&&at&&a&&(r+=i),ts&&(r+=l.slice(Math.max(0,t-s),n-s)),s=c+1}return r}flatten(t){for(let n of this.text)t.push(n)}scanIdentical(){return 0}static split(t,n){let i=[],r=-1;for(let s of t)i.push(s),r+=s.length+1,i.length==32&&(n.push(new Ps(i,r)),i=[],r=-1);return r>-1&&n.push(new Ps(i,r)),n}}class yd extends Gi{constructor(t,n){super(),this.children=t,this.length=n,this.lines=0;for(let i of t)this.lines+=i.lines}lineInner(t,n,i,r){for(let s=0;;s++){let a=this.children[s],l=r+a.length,c=i+a.lines-1;if((n?c:l)>=t)return a.lineInner(t,n,i,r);r=l+1,i=c+1}}decompose(t,n,i,r){for(let s=0,a=0;a<=n&&s=a){let u=r&((a<=t?1:0)|(c>=n?2:0));a>=t&&c<=n&&!u?i.push(l):l.decompose(t-a,n-a,i,u)}a=c+1}}replace(t,n,i){if([t,n]=ix(this,t,n),i.lines=s&&n<=l){let c=a.replace(t-s,n-s,i),u=this.lines-a.lines+c.lines;if(c.lines>4&&c.lines>u>>6){let d=this.children.slice();return d[r]=c,new yd(d,this.length-(n-t)+i.length)}return super.replace(s,l,c)}s=l+1}return super.replace(t,n,i)}sliceString(t,n=this.length,i=` `){[t,n]=ix(this,t,n);let r="";for(let s=0,a=0;st&&s&&(r+=i),ta&&(r+=l.sliceString(t-a,n-a,i)),a=c+1}return r}flatten(t){for(let n of this.children)n.flatten(t)}scanIdentical(t,n){if(!(t instanceof yd))return 0;let i=0,[r,s,a,l]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;r+=n,s+=n){if(r==a||s==l)return i;let c=this.children[r],u=t.children[s];if(c!=u)return i+c.scanIdentical(u,n);i+=c.length+1}}static from(t,n=t.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let p of t)i+=p.lines;if(i<32){let p=[];for(let g of t)g.flatten(p);return new Ps(p,n)}let r=Math.max(32,i>>5),s=r<<1,a=r>>1,l=[],c=0,u=-1,d=[];function f(p){let g;if(p.lines>s&&p instanceof yd)for(let b of p.children)f(b);else p.lines>a&&(c>a||!c)?(h(),l.push(p)):p instanceof Ps&&c&&(g=d[d.length-1])instanceof Ps&&p.lines+g.lines<=32?(c+=p.lines,u+=p.length+1,d[d.length-1]=new Ps(g.text.concat(p.text),g.length+1+p.length)):(c+p.lines>r&&h(),c+=p.lines,u+=p.length+1,d.push(p))}function h(){c!=0&&(l.push(d.length==1?d[0]:yd.from(d,u)),u=-1,c=d.length=0)}for(let p of t)f(p);return h(),l.length==1?l[0]:new yd(l,n)}}Gi.empty=new Ps([""],0);function Gkt(e){let t=-1;for(let n of e)t+=n.length+1;return t}function AA(e,t,n=0,i=1e9){for(let r=0,s=0,a=!0;s=n&&(c>i&&(l=l.slice(0,i-r)),r0?1:(t instanceof Ps?t.text.length:t.children.length)<<1]}nextInner(t,n){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],a=s>>1,l=r instanceof Ps?r.text.length:r.children.length;if(a==(n>0?l:0)){if(i==0)return this.done=!0,this.value="",this;n>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[i]+=n,t==0)return this.lineBreak=!0,this.value=` -`,this;t--}else if(r instanceof Ps){let c=r.text[a+(n<0?-1:0)];if(this.offsets[i]+=n,c.length>Math.max(0,t))return this.value=t==0?c:n>0?c.slice(t):c.slice(0,c.length-t),this;t-=c.length}else{let c=r.children[a+(n<0?-1:0)];t>c.length?(t-=c.length,this.offsets[i]+=n):(n<0&&this.offsets[i]--,this.nodes.push(c),this.offsets.push(n>0?1:(c instanceof Ps?c.text.length:c.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class _Te{constructor(t,n,i){this.value="",this.done=!1,this.cursor=new LO(t,n>i?-1:1),this.pos=n>i?t.length:0,this.from=Math.min(n,i),this.to=Math.max(n,i)}nextInner(t,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let i=n<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:r}=this.cursor.next(t);return this.pos+=(r.length+t)*n,this.value=r.length<=i?r:n<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class NTe{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:n,lineBreak:i,value:r}=this.inner.next(t);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Gi.prototype[Symbol.iterator]=function(){return this.iter()},LO.prototype[Symbol.iterator]=_Te.prototype[Symbol.iterator]=NTe.prototype[Symbol.iterator]=function(){return this});let Kkt=class{constructor(t,n,i,r){this.from=t,this.to=n,this.number=i,this.text=r}get length(){return this.to-this.from}};function ix(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function $a(e,t,n=!0,i=!0){return qkt(e,t,n,i)}function Xkt(e){return e>=56320&&e<57344}function Ykt(e){return e>=55296&&e<56320}function ol(e,t){let n=e.charCodeAt(t);if(!Ykt(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return Xkt(i)?(n-55296<<10)+(i-56320)+65536:n}function zU(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function vd(e){return e<65536?1:2}const f$=/\r\n?|\n/;var eo=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(eo||(eo={}));class Ld{constructor(t){this.sections=t}get length(){let t=0;for(let n=0;nt)return s+(t-r);s+=l}else{if(i!=eo.Simple&&u>=t&&(i==eo.TrackDel&&rt||i==eo.TrackBefore&&rt))return null;if(u>t||u==t&&n<0&&!l)return t==r||n<0?s:s+c;s+=c}r=u}if(t>r)throw new RangeError(`Position ${t} is out of range for changeset of length ${r}`);return s}touchesRange(t,n=t){for(let i=0,r=0;i=0&&r<=n&&l>=t)return rn?"cover":!0;r=l}return!1}toString(){let t="";for(let n=0;n=0?":"+r:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ld(t)}static create(t){return new Ld(t)}}class ma extends Ld{constructor(t,n){super(t),this.inserted=n}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return h$(this,(n,i,r,s,a)=>t=t.replace(r,r+(i-n),a),!1),t}mapDesc(t,n=!1){return p$(this,t,n,!0)}invert(t){let n=this.sections.slice(),i=[];for(let r=0,s=0;r=0){n[r]=l,n[r+1]=a;let c=r>>1;for(;i.length0&&Qp(i,n,s.text),s.forward(d),l+=d}let u=t[a++];for(;l>1].toJSON()))}return t}static of(t,n,i){let r=[],s=[],a=0,l=null;function c(d=!1){if(!d&&!r.length)return;ah||f<0||h>n)throw new RangeError(`Invalid change range ${f} to ${h} (in doc of length ${n})`);let g=p?typeof p=="string"?Gi.of(p.split(i||f$)):p:Gi.empty,b=g.length;if(f==h&&b==0)return;fa&&po(r,f-a,-1),po(r,h-f,b),Qp(s,r,g),a=h}}return u(t),c(!l),l}static empty(t){return new ma(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],i=[];for(let r=0;rl&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;i.length=0&&n<=0&&n==e[r+1]?e[r]+=t:r>=0&&t==0&&e[r]==0?e[r+1]+=n:i?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function Qp(e,t,n){if(n.length==0)return;let i=t.length-2>>1;if(i>1])),!(n||a==e.sections.length||e.sections[a+1]<0);)l=e.sections[a++],c=e.sections[a++];t(r,u,s,d,f),r=u,s=d}}}function p$(e,t,n,i=!1){let r=[],s=i?[]:null,a=new YS(e),l=new YS(t);for(let c=-1;;){if(a.done&&l.len||l.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&l.ins==-1){let u=Math.min(a.len,l.len);po(r,u,-1),a.forward(u),l.forward(u)}else if(l.ins>=0&&(a.ins<0||c==a.i||a.off==0&&(l.len=0&&c=0){let u=0,d=a.len;for(;d;)if(l.ins==-1){let f=Math.min(d,l.len);u+=f,d-=f,l.forward(f)}else if(l.ins==0&&l.lenc||a.ins>=0&&a.len>c)&&(l||i.length>u),s.forward2(c),a.forward(c)}}}}class YS{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return n>=t.length?Gi.empty:t[n]}textBit(t){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!t?Gi.empty:n[i].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class jp{constructor(t,n,i,r){this.from=t,this.to=n,this.flags=i,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 t=this.flags&7;return t==7?null:t}map(t,n=-1){let i,r;return this.empty?i=r=t.mapPos(this.from,n):(i=t.mapPos(this.from,1),r=t.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new jp(i,r,this.flags,this.goalColumn)}extend(t,n=t,i=0){if(t<=this.anchor&&n>=this.anchor)return st.range(t,n,void 0,void 0,i);let r=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return st.range(this.anchor,r,void 0,void 0,i)}eq(t,n=!1){return this.anchor==t.anchor&&this.head==t.head&&this.goalColumn==t.goalColumn&&(!n||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return st.range(t.anchor,t.head)}static create(t,n,i,r){return new jp(t,n,i,r)}}class st{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:st.create(this.ranges.map(i=>i.map(t,n)),this.mainIndex)}eq(t,n=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;it.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new st(t.ranges.map(n=>jp.fromJSON(n)),t.main)}static single(t,n=t){return new st([st.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,r=0;rr.from-s.from),n=t.indexOf(i);for(let r=1;rs.head?st.range(c,l):st.range(l,c))}}return new st(t,n)}}function RTe(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let VU=0;class Kt{constructor(t,n,i,r,s){this.combine=t,this.compareInput=n,this.compare=i,this.isStatic=r,this.id=VU++,this.default=t([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(t={}){return new Kt(t.combine||(n=>n),t.compareInput||((n,i)=>n===i),t.compare||(t.combine?(n,i)=>n===i:HU),!!t.static,t.enables)}of(t){return new _A([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new _A(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new _A(t,this,2,n)}from(t,n){return n||(n=i=>i),this.compute([t],i=>n(i.field(t)))}}function HU(e,t){return e==t||e.length==t.length&&e.every((n,i)=>n===t[i])}class _A{constructor(t,n,i,r){this.dependencies=t,this.facet=n,this.type=i,this.value=r,this.id=VU++}dynamicSlot(t){var n;let i=this.value,r=this.facet.compareInput,s=this.id,a=t[s]>>1,l=this.type==2,c=!1,u=!1,d=[];for(let f of this.dependencies)f=="doc"?c=!0:f=="selection"?u=!0:((n=t[f.id])!==null&&n!==void 0?n:1)&1||d.push(t[f.id]);return{create(f){return f.values[a]=i(f),1},update(f,h){if(c&&h.docChanged||u&&(h.docChanged||h.selection)||m$(f,d)){let p=i(f);if(l?!xZ(p,f.values[a],r):!r(p,f.values[a]))return f.values[a]=p,1}return 0},reconfigure:(f,h)=>{let p,g=h.config.address[s];if(g!=null){let b=NN(h,g);if(this.dependencies.every(v=>v instanceof Kt?h.facet(v)===f.facet(v):v instanceof ro?h.field(v,!1)==f.field(v,!1):!0)||(l?xZ(p=i(f),b,r):r(p=i(f),b)))return f.values[a]=b,0}else p=i(f);return f.values[a]=p,1}}}get extension(){return this}}function xZ(e,t,n){if(e.length!=t.length)return!1;for(let i=0;ie[c.id]),r=n.map(c=>c.type),s=i.filter(c=>!(c&1)),a=e[t.id]>>1;function l(c){let u=[];for(let d=0;di===r),t);return t.provide&&(n.provides=t.provide(n)),n}create(t){let n=t.facet(qT).find(i=>i.field==this);return((n==null?void 0:n.create)||this.createF)(t)}slot(t){let n=t[this.id]>>1;return{create:i=>(i.values[n]=this.create(i),1),update:(i,r)=>{let s=i.values[n],a=this.updateF(s,r);return this.compareF(s,a)?0:(i.values[n]=a,1)},reconfigure:(i,r)=>{let s=i.facet(qT),a=r.facet(qT),l;return(l=s.find(c=>c.field==this))&&l!=a.find(c=>c.field==this)?(i.values[n]=l.create(i),1):r.config.address[this.id]!=null?(i.values[n]=r.field(this),0):(i.values[n]=this.create(i),1)}}}init(t){return[this,qT.of({field:this,create:t})]}get extension(){return this}}const Ag={lowest:4,low:3,default:2,high:1,highest:0};function Y1(e){return t=>new ITe(t,e)}const zh={highest:Y1(Ag.highest),high:Y1(Ag.high),default:Y1(Ag.default),low:Y1(Ag.low),lowest:Y1(Ag.lowest)};class ITe{constructor(t,n){this.inner=t,this.prec=n}get extension(){return this}}class vI{of(t){return new g$(this,t)}reconfigure(t){return vI.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class g${constructor(t,n){this.compartment=t,this.inner=n}get extension(){return this}}class _N{constructor(t,n,i,r,s,a){for(this.base=t,this.compartments=n,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=a,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,n,i){let r=[],s=Object.create(null),a=new Map;for(let h of Jkt(t,n,a))h instanceof ro?r.push(h):(s[h.facet.id]||(s[h.facet.id]=[])).push(h);let l=Object.create(null),c=[],u=[];for(let h of r)l[h.id]=u.length<<1,u.push(p=>h.slot(p));let d=i==null?void 0:i.config.facets;for(let h in s){let p=s[h],g=p[0].facet,b=d&&d[h]||[];if(p.every(v=>v.type==0))if(l[g.id]=c.length<<1|1,HU(b,p))c.push(i.facet(g));else{let v=g.combine(p.map(y=>y.value));c.push(i&&g.compare(v,i.facet(g))?i.facet(g):v)}else{for(let v of p)v.type==0?(l[v.id]=c.length<<1|1,c.push(v.value)):(l[v.id]=u.length<<1,u.push(y=>v.dynamicSlot(y)));l[g.id]=u.length<<1,u.push(v=>Zkt(v,g,p))}}let f=u.map(h=>h(l));return new _N(t,a,f,l,c,s)}}function Jkt(e,t,n){let i=[[],[],[],[],[]],r=new Map;function s(a,l){let c=r.get(a);if(c!=null){if(c<=l)return;let u=i[c].indexOf(a);u>-1&&i[c].splice(u,1),a instanceof g$&&n.delete(a.compartment)}if(r.set(a,l),Array.isArray(a))for(let u of a)s(u,l);else if(a instanceof g$){if(n.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=t.get(a.compartment)||a.inner;n.set(a.compartment,u),s(u,l)}else if(a instanceof ITe)s(a.inner,a.prec);else if(a instanceof ro)i[l].push(a),a.provides&&s(a.provides,l);else if(a instanceof _A)i[l].push(a),a.facet.extensions&&s(a.facet.extensions,Ag.default);else{let u=a.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${a}).`);if(u==a)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(u,l)}}return s(e,Ag.default),i.reduce((a,l)=>a.concat(l))}function $O(e,t){if(t&1)return 2;let n=t>>1,i=e.status[n];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function NN(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const PTe=Kt.define(),b$=Kt.define({combine:e=>e.some(t=>t),static:!0}),DTe=Kt.define({combine:e=>e.length?e[0]:void 0,static:!0}),MTe=Kt.define(),LTe=Kt.define(),$Te=Kt.define(),FTe=Kt.define({combine:e=>e.length?e[0]:!1});class Jd{constructor(t,n){this.type=t,this.value=n}static define(){return new eEt}}class eEt{of(t){return new Jd(this,t)}}class tEt{constructor(t){this.map=t}of(t){return new Fn(this,t)}}class Fn{constructor(t,n){this.type=t,this.value=n}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new Fn(this.type,n)}is(t){return this.type==t}static define(t={}){return new tEt(t.map||(n=>n))}static mapEffects(t,n){if(!t.length)return t;let i=[];for(let r of t){let s=r.map(n);s&&i.push(s)}return i}}Fn.reconfigure=Fn.define();Fn.appendConfig=Fn.define();class Js{constructor(t,n,i,r,s,a){this.startState=t,this.changes=n,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=a,this._doc=null,this._state=null,i&&RTe(i,n.newLength),s.some(l=>l.type==Js.time)||(this.annotations=s.concat(Js.time.of(Date.now())))}static create(t,n,i,r,s,a){return new Js(t,n,i,r,s,a)}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(t){for(let n of this.annotations)if(n.type==t)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(Js.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}Js.time=Jd.define();Js.userEvent=Jd.define();Js.addToHistory=Jd.define();Js.remote=Jd.define();function nEt(e,t){let n=[];for(let i=0,r=0;;){let s,a;if(i=e[i]))s=e[i++],a=e[i++];else if(r=0;r--){let s=i[r](e);s instanceof Js?e=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Js?e=s[0]:e=UTe(t,cv(s),!1)}return e}function rEt(e){let t=e.startState,n=t.facet($Te),i=e;for(let r=n.length-1;r>=0;r--){let s=n[r](e);s&&Object.keys(s).length&&(i=BTe(i,y$(t,s,e.changes.newLength),!0))}return i==e?e:Js.create(t,e.changes,e.selection,i.effects,i.annotations,i.scrollIntoView)}const sEt=[];function cv(e){return e==null?sEt:Array.isArray(e)?e:[e]}var ns=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(ns||(ns={}));const aEt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let v$;try{v$=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function oEt(e){if(v$)return v$.test(e);for(let t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||aEt.test(n)))return!0}return!1}function lEt(e){return t=>{if(!/\S/.test(t))return ns.Space;if(oEt(t))return ns.Word;for(let n=0;n-1)return ns.Word;return ns.Other}}class Ti{constructor(t,n,i,r,s,a){this.config=t,this.doc=n,this.selection=i,this.values=r,this.status=t.statusTemplate.slice(),this.computeSlot=s,a&&(a._state=this);for(let l=0;lr.set(u,c)),n=null),r.set(l.value.compartment,l.value.extension)):l.is(Fn.reconfigure)?(n=null,i=l.value):l.is(Fn.appendConfig)&&(n=null,i=cv(i).concat(l.value));let s;n?s=t.startState.values.slice():(n=_N.resolve(i,r,this),s=new Ti(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(c,u)=>u.reconfigure(c,this),null).values);let a=t.startState.facet(b$)?t.newSelection:t.newSelection.asSingle();new Ti(n,t.newDoc,a,s,(l,c)=>c.update(l,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:t},range:st.cursor(n.from+t.length)}))}changeByRange(t){let n=this.selection,i=t(n.ranges[0]),r=this.changes(i.changes),s=[i.range],a=cv(i.effects);for(let l=1;la.spec.fromJSON(l,c)))}}return Ti.create({doc:t.doc,selection:st.fromJSON(t.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(t={}){let n=_N.resolve(t.extensions||[],new Map),i=t.doc instanceof Gi?t.doc:Gi.of((t.doc||"").split(n.staticFacet(Ti.lineSeparator)||f$)),r=t.selection?t.selection instanceof st?t.selection:st.single(t.selection.anchor,t.selection.head):st.single(0);return RTe(r,i.length),n.staticFacet(b$)||(r=r.asSingle()),new Ti(n,i,r,n.dynamicSlots.map(()=>null),(s,a)=>a.create(s),null)}get tabSize(){return this.facet(Ti.tabSize)}get lineBreak(){return this.facet(Ti.lineSeparator)||` -`}get readOnly(){return this.facet(FTe)}phrase(t,...n){for(let i of this.facet(Ti.phrases))if(Object.prototype.hasOwnProperty.call(i,t)){t=i[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>n.length?i:n[s-1]})),t}languageDataAt(t,n,i=-1){let r=[];for(let s of this.facet(PTe))for(let a of s(this,n,i))Object.prototype.hasOwnProperty.call(a,t)&&r.push(a[t]);return r}charCategorizer(t){let n=this.languageDataAt("wordChars",t);return lEt(n.length?n[0]:"")}wordAt(t){let{text:n,from:i,length:r}=this.doc.lineAt(t),s=this.charCategorizer(t),a=t-i,l=t-i;for(;a>0;){let c=$a(n,a,!1);if(s(n.slice(c,a))!=ns.Word)break;a=c}for(;le.length?e[0]:4});Ti.lineSeparator=DTe;Ti.readOnly=FTe;Ti.phrases=Kt.define({compare(e,t){let n=Object.keys(e),i=Object.keys(t);return n.length==i.length&&n.every(r=>e[r]==t[r])}});Ti.languageData=PTe;Ti.changeFilter=MTe;Ti.transactionFilter=LTe;Ti.transactionExtender=$Te;vI.reconfigure=Fn.define();function ef(e,t,n={}){let i={};for(let r of e)for(let s of Object.keys(r)){let a=r[s],l=i[s];if(l===void 0)i[s]=a;else if(!(l===a||a===void 0))if(Object.hasOwnProperty.call(n,s))i[s]=n[s](l,a);else throw new Error("Config merge conflict for field "+s)}for(let r in t)i[r]===void 0&&(i[r]=t[r]);return i}class Em{eq(t){return this==t}range(t,n=t){return ZS.create(t,n,this)}}Em.prototype.startSide=Em.prototype.endSide=0;Em.prototype.point=!1;Em.prototype.mapMode=eo.TrackDel;function qU(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}class ZS{constructor(t,n,i){this.from=t,this.to=n,this.value=i}static create(t,n,i){return new ZS(t,n,i)}}function x$(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class WU{constructor(t,n,i,r){this.from=t,this.to=n,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(t,n,i,r=0){let s=i?this.to:this.from;for(let a=r,l=s.length;;){if(a==l)return a;let c=a+l>>1,u=s[c]-t||(i?this.value[c].endSide:this.value[c].startSide)-n;if(c==a)return u>=0?a:l;u>=0?l=c:a=c+1}}between(t,n,i,r){for(let s=this.findIndex(n,-1e9,!0),a=this.findIndex(i,1e9,!1,s);sp||h==p&&u.startSide>0&&u.endSide<=0)continue;(p-h||u.endSide-u.startSide)<0||(a<0&&(a=h),u.point&&(l=Math.max(l,p-h)),i.push(u),r.push(h-a),s.push(p-a))}return{mapped:i.length?new WU(r,s,i,l):null,pos:a}}}class xi{constructor(t,n,i,r){this.chunkPos=t,this.chunk=n,this.nextLayer=i,this.maxPoint=r}static create(t,n,i,r){return new xi(t,n,i,r)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let n of this.chunk)t+=n.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:n=[],sort:i=!1,filterFrom:r=0,filterTo:s=this.length}=t,a=t.filter;if(n.length==0&&!a)return this;if(i&&(n=n.slice().sort(x$)),this.isEmpty)return n.length?xi.of(n):this;let l=new QTe(this,null,-1).goto(0),c=0,u=[],d=new Ah;for(;l.value||c=0){let f=n[c++];d.addInner(f.from,f.to,f.value)||u.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||sl.to||s=s&&t<=s+a.length&&a.between(s,t-s,n-s,i)===!1)return}this.nextLayer.between(t,n,i)}}iter(t=0){return JS.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,n=0){return JS.from(t).goto(n)}static compare(t,n,i,r,s=-1){let a=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),c=wZ(a,l,i),u=new Z1(a,c,s),d=new Z1(l,c,s);i.iterGaps((f,h,p)=>OZ(u,f,d,h,p,r)),i.empty&&i.length==0&&OZ(u,0,d,0,0,r)}static eq(t,n,i=0,r){r==null&&(r=999999999);let s=t.filter(d=>!d.isEmpty&&n.indexOf(d)<0),a=n.filter(d=>!d.isEmpty&&t.indexOf(d)<0);if(s.length!=a.length)return!1;if(!s.length)return!0;let l=wZ(s,a),c=new Z1(s,l,0).goto(i),u=new Z1(a,l,0).goto(i);for(;;){if(c.to!=u.to||!w$(c.active,u.active)||c.point&&(!u.point||!qU(c.point,u.point)))return!1;if(c.to>r)return!0;c.next(),u.next()}}static spans(t,n,i,r,s=-1){let a=new Z1(t,null,s).goto(n),l=n,c=a.openStart;for(;;){let u=Math.min(a.to,i);if(a.point){let d=a.activeForPoint(a.to),f=a.pointFroml&&(r.span(l,u,a.active,c),c=a.openEnd(u));if(a.to>i)return c+(a.point&&a.to>i?1:0);l=a.to,a.next()}}static of(t,n=!1){let i=new Ah;for(let r of t instanceof ZS?[t]:n?cEt(t):t)i.add(r.from,r.to,r.value);return i.finish()}static join(t){if(!t.length)return xi.empty;let n=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let r=t[i];r!=xi.empty;r=r.nextLayer)n=new xi(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}}xi.empty=new xi([],[],null,-1);function cEt(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(x$);t=i}return e}xi.empty.nextLayer=xi.empty;class Ah{finishChunk(t){this.chunks.push(new WU(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,i){this.addInner(t,n,i)||(this.nextLayer||(this.nextLayer=new Ah)).add(t,n,i)}addInner(t,n,i){let r=t-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(n-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=n,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,n-t)),!0)}addChunk(t,n){if((t-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(t);let i=n.value.length-1;return this.last=n.value[i],this.lastFrom=n.from[i]+t,this.lastTo=n.to[i]+t,!0}finish(){return this.finishInner(xi.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let n=xi.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,n}}function wZ(e,t,n){let i=new Map;for(let s of e)for(let a=0;a=this.minPoint)break}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&r.push(new QTe(a,n,i,s));return r.length==1?r[0]:new JS(r)}get startSide(){return this.value?this.value.startSide:0}goto(t,n=-1e9){for(let i of this.heap)i.goto(t,n);for(let i=this.heap.length>>1;i>=0;i--)i5(this.heap,i);return this.next(),this}forward(t,n){for(let i of this.heap)i.forward(t,n);for(let i=this.heap.length>>1;i>=0;i--)i5(this.heap,i);(this.to-t||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),i5(this.heap,0)}}}function i5(e,t){for(let n=e[t];;){let i=(t<<1)+1;if(i>=e.length)break;let r=e[i];if(i+1=0&&(r=e[i+1],i++),n.compare(r)<0)break;e[i]=n,e[t]=r,t=i}}class Z1{constructor(t,n,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=JS.from(t,n,i)}goto(t,n=-1e9){return this.cursor.goto(t,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=n,this.openStart=-1,this.next(),this}forward(t,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(t,n)}removeActive(t){WT(this.active,t),WT(this.activeTo,t),WT(this.activeRank,t),this.minActive=SZ(this.active,this.activeTo)}addActive(t){let n=0,{value:i,to:r,rank:s}=this.cursor;for(;n0;)n++;GT(this.active,n,i),GT(this.activeTo,n,r),GT(this.activeRank,n,s),t&>(t,n,this.cursor.from),this.minActive=SZ(this.active,this.activeTo)}next(){let t=this.to,n=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>t){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&WT(i,r)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from=0&&i[r]=0&&!(this.activeRank[i]t||this.activeTo[i]==t&&this.active[i].endSide>=this.point.endSide)&&n.push(this.active[i]);return n.reverse()}openEnd(t){let n=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>t;i--)n++;return n}}function OZ(e,t,n,i,r,s){e.goto(t),n.goto(i);let a=i+r,l=i,c=i-t,u=!!s.boundChange;for(let d=!1;;){let f=e.to+c-n.to,h=f||e.endSide-n.endSide,p=h<0?e.to+c:n.to,g=Math.min(p,a);if(e.point||n.point?(e.point&&n.point&&qU(e.point,n.point)&&w$(e.activeForPoint(e.to),n.activeForPoint(n.to))||s.comparePoint(l,g,e.point,n.point),d=!1):(d&&s.boundChange(l),g>l&&!w$(e.active,n.active)&&s.compareRange(l,g,e.active,n.active),u&&ga)break;l=p,h<=0&&e.next(),h>=0&&n.next()}}function w$(e,t){if(e.length!=t.length)return!1;for(let n=0;n=t;i--)e[i+1]=e[i];e[t]=n}function SZ(e,t){let n=-1,i=1e9;for(let r=0;r=t)return r;if(r==e.length)break;s+=e.charCodeAt(r)==9?n-s%n:1,r=$a(e,r)}return i===!0?-1:e.length}const S$="ͼ",kZ=typeof Symbol>"u"?"__"+S$:Symbol.for(S$),k$=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),EZ=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Cm{constructor(t,n){this.rules=[];let{finish:i}=n||{};function r(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function s(a,l,c,u){let d=[],f=/^@(\w+)\b/.exec(a[0]),h=f&&f[1]=="keyframes";if(f&&l==null)return c.push(a[0]+";");for(let p in l){let g=l[p];if(/&/.test(p))s(p.split(/,\s*/).map(b=>a.map(v=>b.replace(/&/,v))).reduce((b,v)=>b.concat(v)),g,c);else if(g&&typeof g=="object"){if(!f)throw new RangeError("The value of a property ("+p+") should be a primitive value.");s(r(p),g,d,h)}else g!=null&&d.push(p.replace(/_.*/,"").replace(/[A-Z]/g,b=>"-"+b.toLowerCase())+": "+g+";")}(d.length||h)&&c.push((i&&!f&&!u?a.map(i):a).join(", ")+" {"+d.join(" ")+"}")}for(let a in t)s(r(a),t[a],this.rules)}getRules(){return this.rules.join(` +`,this;t--}else if(r instanceof Ps){let c=r.text[a+(n<0?-1:0)];if(this.offsets[i]+=n,c.length>Math.max(0,t))return this.value=t==0?c:n>0?c.slice(t):c.slice(0,c.length-t),this;t-=c.length}else{let c=r.children[a+(n<0?-1:0)];t>c.length?(t-=c.length,this.offsets[i]+=n):(n<0&&this.offsets[i]--,this.nodes.push(c),this.offsets.push(n>0?1:(c instanceof Ps?c.text.length:c.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class _Te{constructor(t,n,i){this.value="",this.done=!1,this.cursor=new LO(t,n>i?-1:1),this.pos=n>i?t.length:0,this.from=Math.min(n,i),this.to=Math.max(n,i)}nextInner(t,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let i=n<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:r}=this.cursor.next(t);return this.pos+=(r.length+t)*n,this.value=r.length<=i?r:n<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class NTe{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:n,lineBreak:i,value:r}=this.inner.next(t);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Gi.prototype[Symbol.iterator]=function(){return this.iter()},LO.prototype[Symbol.iterator]=_Te.prototype[Symbol.iterator]=NTe.prototype[Symbol.iterator]=function(){return this});let Kkt=class{constructor(t,n,i,r){this.from=t,this.to=n,this.number=i,this.text=r}get length(){return this.to-this.from}};function ix(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function $a(e,t,n=!0,i=!0){return qkt(e,t,n,i)}function Xkt(e){return e>=56320&&e<57344}function Ykt(e){return e>=55296&&e<56320}function ol(e,t){let n=e.charCodeAt(t);if(!Ykt(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return Xkt(i)?(n-55296<<10)+(i-56320)+65536:n}function zU(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function vd(e){return e<65536?1:2}const f$=/\r\n?|\n/;var eo=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(eo||(eo={}));class Ld{constructor(t){this.sections=t}get length(){let t=0;for(let n=0;nt)return s+(t-r);s+=l}else{if(i!=eo.Simple&&u>=t&&(i==eo.TrackDel&&rt||i==eo.TrackBefore&&rt))return null;if(u>t||u==t&&n<0&&!l)return t==r||n<0?s:s+c;s+=c}r=u}if(t>r)throw new RangeError(`Position ${t} is out of range for changeset of length ${r}`);return s}touchesRange(t,n=t){for(let i=0,r=0;i=0&&r<=n&&l>=t)return rn?"cover":!0;r=l}return!1}toString(){let t="";for(let n=0;n=0?":"+r:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ld(t)}static create(t){return new Ld(t)}}class ma extends Ld{constructor(t,n){super(t),this.inserted=n}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return h$(this,(n,i,r,s,a)=>t=t.replace(r,r+(i-n),a),!1),t}mapDesc(t,n=!1){return p$(this,t,n,!0)}invert(t){let n=this.sections.slice(),i=[];for(let r=0,s=0;r=0){n[r]=l,n[r+1]=a;let c=r>>1;for(;i.length0&&Qp(i,n,s.text),s.forward(d),l+=d}let u=t[a++];for(;l>1].toJSON()))}return t}static of(t,n,i){let r=[],s=[],a=0,l=null;function c(d=!1){if(!d&&!r.length)return;ah||f<0||h>n)throw new RangeError(`Invalid change range ${f} to ${h} (in doc of length ${n})`);let g=p?typeof p=="string"?Gi.of(p.split(i||f$)):p:Gi.empty,b=g.length;if(f==h&&b==0)return;fa&&po(r,f-a,-1),po(r,h-f,b),Qp(s,r,g),a=h}}return u(t),c(!l),l}static empty(t){return new ma(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],i=[];for(let r=0;rl&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;i.length=0&&n<=0&&n==e[r+1]?e[r]+=t:r>=0&&t==0&&e[r]==0?e[r+1]+=n:i?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function Qp(e,t,n){if(n.length==0)return;let i=t.length-2>>1;if(i>1])),!(n||a==e.sections.length||e.sections[a+1]<0);)l=e.sections[a++],c=e.sections[a++];t(r,u,s,d,f),r=u,s=d}}}function p$(e,t,n,i=!1){let r=[],s=i?[]:null,a=new YS(e),l=new YS(t);for(let c=-1;;){if(a.done&&l.len||l.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&l.ins==-1){let u=Math.min(a.len,l.len);po(r,u,-1),a.forward(u),l.forward(u)}else if(l.ins>=0&&(a.ins<0||c==a.i||a.off==0&&(l.len=0&&c=0){let u=0,d=a.len;for(;d;)if(l.ins==-1){let f=Math.min(d,l.len);u+=f,d-=f,l.forward(f)}else if(l.ins==0&&l.lenc||a.ins>=0&&a.len>c)&&(l||i.length>u),s.forward2(c),a.forward(c)}}}}class YS{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return n>=t.length?Gi.empty:t[n]}textBit(t){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!t?Gi.empty:n[i].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class jp{constructor(t,n,i,r){this.from=t,this.to=n,this.flags=i,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 t=this.flags&7;return t==7?null:t}map(t,n=-1){let i,r;return this.empty?i=r=t.mapPos(this.from,n):(i=t.mapPos(this.from,1),r=t.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new jp(i,r,this.flags,this.goalColumn)}extend(t,n=t,i=0){if(t<=this.anchor&&n>=this.anchor)return tt.range(t,n,void 0,void 0,i);let r=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return tt.range(this.anchor,r,void 0,void 0,i)}eq(t,n=!1){return this.anchor==t.anchor&&this.head==t.head&&this.goalColumn==t.goalColumn&&(!n||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return tt.range(t.anchor,t.head)}static create(t,n,i,r){return new jp(t,n,i,r)}}class tt{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:tt.create(this.ranges.map(i=>i.map(t,n)),this.mainIndex)}eq(t,n=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;it.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new tt(t.ranges.map(n=>jp.fromJSON(n)),t.main)}static single(t,n=t){return new tt([tt.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,r=0;rr.from-s.from),n=t.indexOf(i);for(let r=1;rs.head?tt.range(c,l):tt.range(l,c))}}return new tt(t,n)}}function RTe(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let VU=0;class Zt{constructor(t,n,i,r,s){this.combine=t,this.compareInput=n,this.compare=i,this.isStatic=r,this.id=VU++,this.default=t([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(t={}){return new Zt(t.combine||(n=>n),t.compareInput||((n,i)=>n===i),t.compare||(t.combine?(n,i)=>n===i:HU),!!t.static,t.enables)}of(t){return new _A([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new _A(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new _A(t,this,2,n)}from(t,n){return n||(n=i=>i),this.compute([t],i=>n(i.field(t)))}}function HU(e,t){return e==t||e.length==t.length&&e.every((n,i)=>n===t[i])}class _A{constructor(t,n,i,r){this.dependencies=t,this.facet=n,this.type=i,this.value=r,this.id=VU++}dynamicSlot(t){var n;let i=this.value,r=this.facet.compareInput,s=this.id,a=t[s]>>1,l=this.type==2,c=!1,u=!1,d=[];for(let f of this.dependencies)f=="doc"?c=!0:f=="selection"?u=!0:((n=t[f.id])!==null&&n!==void 0?n:1)&1||d.push(t[f.id]);return{create(f){return f.values[a]=i(f),1},update(f,h){if(c&&h.docChanged||u&&(h.docChanged||h.selection)||m$(f,d)){let p=i(f);if(l?!xZ(p,f.values[a],r):!r(p,f.values[a]))return f.values[a]=p,1}return 0},reconfigure:(f,h)=>{let p,g=h.config.address[s];if(g!=null){let b=NN(h,g);if(this.dependencies.every(v=>v instanceof Zt?h.facet(v)===f.facet(v):v instanceof ro?h.field(v,!1)==f.field(v,!1):!0)||(l?xZ(p=i(f),b,r):r(p=i(f),b)))return f.values[a]=b,0}else p=i(f);return f.values[a]=p,1}}}get extension(){return this}}function xZ(e,t,n){if(e.length!=t.length)return!1;for(let i=0;ie[c.id]),r=n.map(c=>c.type),s=i.filter(c=>!(c&1)),a=e[t.id]>>1;function l(c){let u=[];for(let d=0;di===r),t);return t.provide&&(n.provides=t.provide(n)),n}create(t){let n=t.facet(qT).find(i=>i.field==this);return((n==null?void 0:n.create)||this.createF)(t)}slot(t){let n=t[this.id]>>1;return{create:i=>(i.values[n]=this.create(i),1),update:(i,r)=>{let s=i.values[n],a=this.updateF(s,r);return this.compareF(s,a)?0:(i.values[n]=a,1)},reconfigure:(i,r)=>{let s=i.facet(qT),a=r.facet(qT),l;return(l=s.find(c=>c.field==this))&&l!=a.find(c=>c.field==this)?(i.values[n]=l.create(i),1):r.config.address[this.id]!=null?(i.values[n]=r.field(this),0):(i.values[n]=this.create(i),1)}}}init(t){return[this,qT.of({field:this,create:t})]}get extension(){return this}}const Ag={lowest:4,low:3,default:2,high:1,highest:0};function Y1(e){return t=>new ITe(t,e)}const zh={highest:Y1(Ag.highest),high:Y1(Ag.high),default:Y1(Ag.default),low:Y1(Ag.low),lowest:Y1(Ag.lowest)};class ITe{constructor(t,n){this.inner=t,this.prec=n}get extension(){return this}}class vI{of(t){return new g$(this,t)}reconfigure(t){return vI.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class g${constructor(t,n){this.compartment=t,this.inner=n}get extension(){return this}}class _N{constructor(t,n,i,r,s,a){for(this.base=t,this.compartments=n,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=a,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,n,i){let r=[],s=Object.create(null),a=new Map;for(let h of Jkt(t,n,a))h instanceof ro?r.push(h):(s[h.facet.id]||(s[h.facet.id]=[])).push(h);let l=Object.create(null),c=[],u=[];for(let h of r)l[h.id]=u.length<<1,u.push(p=>h.slot(p));let d=i==null?void 0:i.config.facets;for(let h in s){let p=s[h],g=p[0].facet,b=d&&d[h]||[];if(p.every(v=>v.type==0))if(l[g.id]=c.length<<1|1,HU(b,p))c.push(i.facet(g));else{let v=g.combine(p.map(y=>y.value));c.push(i&&g.compare(v,i.facet(g))?i.facet(g):v)}else{for(let v of p)v.type==0?(l[v.id]=c.length<<1|1,c.push(v.value)):(l[v.id]=u.length<<1,u.push(y=>v.dynamicSlot(y)));l[g.id]=u.length<<1,u.push(v=>Zkt(v,g,p))}}let f=u.map(h=>h(l));return new _N(t,a,f,l,c,s)}}function Jkt(e,t,n){let i=[[],[],[],[],[]],r=new Map;function s(a,l){let c=r.get(a);if(c!=null){if(c<=l)return;let u=i[c].indexOf(a);u>-1&&i[c].splice(u,1),a instanceof g$&&n.delete(a.compartment)}if(r.set(a,l),Array.isArray(a))for(let u of a)s(u,l);else if(a instanceof g$){if(n.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=t.get(a.compartment)||a.inner;n.set(a.compartment,u),s(u,l)}else if(a instanceof ITe)s(a.inner,a.prec);else if(a instanceof ro)i[l].push(a),a.provides&&s(a.provides,l);else if(a instanceof _A)i[l].push(a),a.facet.extensions&&s(a.facet.extensions,Ag.default);else{let u=a.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${a}).`);if(u==a)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(u,l)}}return s(e,Ag.default),i.reduce((a,l)=>a.concat(l))}function $O(e,t){if(t&1)return 2;let n=t>>1,i=e.status[n];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function NN(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const PTe=Zt.define(),b$=Zt.define({combine:e=>e.some(t=>t),static:!0}),DTe=Zt.define({combine:e=>e.length?e[0]:void 0,static:!0}),MTe=Zt.define(),LTe=Zt.define(),$Te=Zt.define(),FTe=Zt.define({combine:e=>e.length?e[0]:!1});class Jd{constructor(t,n){this.type=t,this.value=n}static define(){return new eEt}}class eEt{of(t){return new Jd(this,t)}}class tEt{constructor(t){this.map=t}of(t){return new Fn(this,t)}}class Fn{constructor(t,n){this.type=t,this.value=n}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new Fn(this.type,n)}is(t){return this.type==t}static define(t={}){return new tEt(t.map||(n=>n))}static mapEffects(t,n){if(!t.length)return t;let i=[];for(let r of t){let s=r.map(n);s&&i.push(s)}return i}}Fn.reconfigure=Fn.define();Fn.appendConfig=Fn.define();class Js{constructor(t,n,i,r,s,a){this.startState=t,this.changes=n,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=a,this._doc=null,this._state=null,i&&RTe(i,n.newLength),s.some(l=>l.type==Js.time)||(this.annotations=s.concat(Js.time.of(Date.now())))}static create(t,n,i,r,s,a){return new Js(t,n,i,r,s,a)}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(t){for(let n of this.annotations)if(n.type==t)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(Js.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}Js.time=Jd.define();Js.userEvent=Jd.define();Js.addToHistory=Jd.define();Js.remote=Jd.define();function nEt(e,t){let n=[];for(let i=0,r=0;;){let s,a;if(i=e[i]))s=e[i++],a=e[i++];else if(r=0;r--){let s=i[r](e);s instanceof Js?e=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Js?e=s[0]:e=UTe(t,cv(s),!1)}return e}function rEt(e){let t=e.startState,n=t.facet($Te),i=e;for(let r=n.length-1;r>=0;r--){let s=n[r](e);s&&Object.keys(s).length&&(i=BTe(i,y$(t,s,e.changes.newLength),!0))}return i==e?e:Js.create(t,e.changes,e.selection,i.effects,i.annotations,i.scrollIntoView)}const sEt=[];function cv(e){return e==null?sEt:Array.isArray(e)?e:[e]}var ns=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(ns||(ns={}));const aEt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let v$;try{v$=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function oEt(e){if(v$)return v$.test(e);for(let t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||aEt.test(n)))return!0}return!1}function lEt(e){return t=>{if(!/\S/.test(t))return ns.Space;if(oEt(t))return ns.Word;for(let n=0;n-1)return ns.Word;return ns.Other}}class Ti{constructor(t,n,i,r,s,a){this.config=t,this.doc=n,this.selection=i,this.values=r,this.status=t.statusTemplate.slice(),this.computeSlot=s,a&&(a._state=this);for(let l=0;lr.set(u,c)),n=null),r.set(l.value.compartment,l.value.extension)):l.is(Fn.reconfigure)?(n=null,i=l.value):l.is(Fn.appendConfig)&&(n=null,i=cv(i).concat(l.value));let s;n?s=t.startState.values.slice():(n=_N.resolve(i,r,this),s=new Ti(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(c,u)=>u.reconfigure(c,this),null).values);let a=t.startState.facet(b$)?t.newSelection:t.newSelection.asSingle();new Ti(n,t.newDoc,a,s,(l,c)=>c.update(l,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:t},range:tt.cursor(n.from+t.length)}))}changeByRange(t){let n=this.selection,i=t(n.ranges[0]),r=this.changes(i.changes),s=[i.range],a=cv(i.effects);for(let l=1;la.spec.fromJSON(l,c)))}}return Ti.create({doc:t.doc,selection:tt.fromJSON(t.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(t={}){let n=_N.resolve(t.extensions||[],new Map),i=t.doc instanceof Gi?t.doc:Gi.of((t.doc||"").split(n.staticFacet(Ti.lineSeparator)||f$)),r=t.selection?t.selection instanceof tt?t.selection:tt.single(t.selection.anchor,t.selection.head):tt.single(0);return RTe(r,i.length),n.staticFacet(b$)||(r=r.asSingle()),new Ti(n,i,r,n.dynamicSlots.map(()=>null),(s,a)=>a.create(s),null)}get tabSize(){return this.facet(Ti.tabSize)}get lineBreak(){return this.facet(Ti.lineSeparator)||` +`}get readOnly(){return this.facet(FTe)}phrase(t,...n){for(let i of this.facet(Ti.phrases))if(Object.prototype.hasOwnProperty.call(i,t)){t=i[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>n.length?i:n[s-1]})),t}languageDataAt(t,n,i=-1){let r=[];for(let s of this.facet(PTe))for(let a of s(this,n,i))Object.prototype.hasOwnProperty.call(a,t)&&r.push(a[t]);return r}charCategorizer(t){let n=this.languageDataAt("wordChars",t);return lEt(n.length?n[0]:"")}wordAt(t){let{text:n,from:i,length:r}=this.doc.lineAt(t),s=this.charCategorizer(t),a=t-i,l=t-i;for(;a>0;){let c=$a(n,a,!1);if(s(n.slice(c,a))!=ns.Word)break;a=c}for(;le.length?e[0]:4});Ti.lineSeparator=DTe;Ti.readOnly=FTe;Ti.phrases=Zt.define({compare(e,t){let n=Object.keys(e),i=Object.keys(t);return n.length==i.length&&n.every(r=>e[r]==t[r])}});Ti.languageData=PTe;Ti.changeFilter=MTe;Ti.transactionFilter=LTe;Ti.transactionExtender=$Te;vI.reconfigure=Fn.define();function ef(e,t,n={}){let i={};for(let r of e)for(let s of Object.keys(r)){let a=r[s],l=i[s];if(l===void 0)i[s]=a;else if(!(l===a||a===void 0))if(Object.hasOwnProperty.call(n,s))i[s]=n[s](l,a);else throw new Error("Config merge conflict for field "+s)}for(let r in t)i[r]===void 0&&(i[r]=t[r]);return i}class Em{eq(t){return this==t}range(t,n=t){return ZS.create(t,n,this)}}Em.prototype.startSide=Em.prototype.endSide=0;Em.prototype.point=!1;Em.prototype.mapMode=eo.TrackDel;function qU(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}class ZS{constructor(t,n,i){this.from=t,this.to=n,this.value=i}static create(t,n,i){return new ZS(t,n,i)}}function x$(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class WU{constructor(t,n,i,r){this.from=t,this.to=n,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(t,n,i,r=0){let s=i?this.to:this.from;for(let a=r,l=s.length;;){if(a==l)return a;let c=a+l>>1,u=s[c]-t||(i?this.value[c].endSide:this.value[c].startSide)-n;if(c==a)return u>=0?a:l;u>=0?l=c:a=c+1}}between(t,n,i,r){for(let s=this.findIndex(n,-1e9,!0),a=this.findIndex(i,1e9,!1,s);sp||h==p&&u.startSide>0&&u.endSide<=0)continue;(p-h||u.endSide-u.startSide)<0||(a<0&&(a=h),u.point&&(l=Math.max(l,p-h)),i.push(u),r.push(h-a),s.push(p-a))}return{mapped:i.length?new WU(r,s,i,l):null,pos:a}}}class xi{constructor(t,n,i,r){this.chunkPos=t,this.chunk=n,this.nextLayer=i,this.maxPoint=r}static create(t,n,i,r){return new xi(t,n,i,r)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let n of this.chunk)t+=n.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:n=[],sort:i=!1,filterFrom:r=0,filterTo:s=this.length}=t,a=t.filter;if(n.length==0&&!a)return this;if(i&&(n=n.slice().sort(x$)),this.isEmpty)return n.length?xi.of(n):this;let l=new QTe(this,null,-1).goto(0),c=0,u=[],d=new Ah;for(;l.value||c=0){let f=n[c++];d.addInner(f.from,f.to,f.value)||u.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||sl.to||s=s&&t<=s+a.length&&a.between(s,t-s,n-s,i)===!1)return}this.nextLayer.between(t,n,i)}}iter(t=0){return JS.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,n=0){return JS.from(t).goto(n)}static compare(t,n,i,r,s=-1){let a=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),c=wZ(a,l,i),u=new Z1(a,c,s),d=new Z1(l,c,s);i.iterGaps((f,h,p)=>OZ(u,f,d,h,p,r)),i.empty&&i.length==0&&OZ(u,0,d,0,0,r)}static eq(t,n,i=0,r){r==null&&(r=999999999);let s=t.filter(d=>!d.isEmpty&&n.indexOf(d)<0),a=n.filter(d=>!d.isEmpty&&t.indexOf(d)<0);if(s.length!=a.length)return!1;if(!s.length)return!0;let l=wZ(s,a),c=new Z1(s,l,0).goto(i),u=new Z1(a,l,0).goto(i);for(;;){if(c.to!=u.to||!w$(c.active,u.active)||c.point&&(!u.point||!qU(c.point,u.point)))return!1;if(c.to>r)return!0;c.next(),u.next()}}static spans(t,n,i,r,s=-1){let a=new Z1(t,null,s).goto(n),l=n,c=a.openStart;for(;;){let u=Math.min(a.to,i);if(a.point){let d=a.activeForPoint(a.to),f=a.pointFroml&&(r.span(l,u,a.active,c),c=a.openEnd(u));if(a.to>i)return c+(a.point&&a.to>i?1:0);l=a.to,a.next()}}static of(t,n=!1){let i=new Ah;for(let r of t instanceof ZS?[t]:n?cEt(t):t)i.add(r.from,r.to,r.value);return i.finish()}static join(t){if(!t.length)return xi.empty;let n=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let r=t[i];r!=xi.empty;r=r.nextLayer)n=new xi(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}}xi.empty=new xi([],[],null,-1);function cEt(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(x$);t=i}return e}xi.empty.nextLayer=xi.empty;class Ah{finishChunk(t){this.chunks.push(new WU(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,i){this.addInner(t,n,i)||(this.nextLayer||(this.nextLayer=new Ah)).add(t,n,i)}addInner(t,n,i){let r=t-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(n-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=n,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,n-t)),!0)}addChunk(t,n){if((t-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(t);let i=n.value.length-1;return this.last=n.value[i],this.lastFrom=n.from[i]+t,this.lastTo=n.to[i]+t,!0}finish(){return this.finishInner(xi.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let n=xi.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,n}}function wZ(e,t,n){let i=new Map;for(let s of e)for(let a=0;a=this.minPoint)break}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&r.push(new QTe(a,n,i,s));return r.length==1?r[0]:new JS(r)}get startSide(){return this.value?this.value.startSide:0}goto(t,n=-1e9){for(let i of this.heap)i.goto(t,n);for(let i=this.heap.length>>1;i>=0;i--)i5(this.heap,i);return this.next(),this}forward(t,n){for(let i of this.heap)i.forward(t,n);for(let i=this.heap.length>>1;i>=0;i--)i5(this.heap,i);(this.to-t||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),i5(this.heap,0)}}}function i5(e,t){for(let n=e[t];;){let i=(t<<1)+1;if(i>=e.length)break;let r=e[i];if(i+1=0&&(r=e[i+1],i++),n.compare(r)<0)break;e[i]=n,e[t]=r,t=i}}class Z1{constructor(t,n,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=JS.from(t,n,i)}goto(t,n=-1e9){return this.cursor.goto(t,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=n,this.openStart=-1,this.next(),this}forward(t,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(t,n)}removeActive(t){WT(this.active,t),WT(this.activeTo,t),WT(this.activeRank,t),this.minActive=SZ(this.active,this.activeTo)}addActive(t){let n=0,{value:i,to:r,rank:s}=this.cursor;for(;n0;)n++;GT(this.active,n,i),GT(this.activeTo,n,r),GT(this.activeRank,n,s),t&>(t,n,this.cursor.from),this.minActive=SZ(this.active,this.activeTo)}next(){let t=this.to,n=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>t){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&WT(i,r)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from=0&&i[r]=0&&!(this.activeRank[i]t||this.activeTo[i]==t&&this.active[i].endSide>=this.point.endSide)&&n.push(this.active[i]);return n.reverse()}openEnd(t){let n=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>t;i--)n++;return n}}function OZ(e,t,n,i,r,s){e.goto(t),n.goto(i);let a=i+r,l=i,c=i-t,u=!!s.boundChange;for(let d=!1;;){let f=e.to+c-n.to,h=f||e.endSide-n.endSide,p=h<0?e.to+c:n.to,g=Math.min(p,a);if(e.point||n.point?(e.point&&n.point&&qU(e.point,n.point)&&w$(e.activeForPoint(e.to),n.activeForPoint(n.to))||s.comparePoint(l,g,e.point,n.point),d=!1):(d&&s.boundChange(l),g>l&&!w$(e.active,n.active)&&s.compareRange(l,g,e.active,n.active),u&&ga)break;l=p,h<=0&&e.next(),h>=0&&n.next()}}function w$(e,t){if(e.length!=t.length)return!1;for(let n=0;n=t;i--)e[i+1]=e[i];e[t]=n}function SZ(e,t){let n=-1,i=1e9;for(let r=0;r=t)return r;if(r==e.length)break;s+=e.charCodeAt(r)==9?n-s%n:1,r=$a(e,r)}return i===!0?-1:e.length}const S$="ͼ",kZ=typeof Symbol>"u"?"__"+S$:Symbol.for(S$),k$=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),EZ=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Cm{constructor(t,n){this.rules=[];let{finish:i}=n||{};function r(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function s(a,l,c,u){let d=[],f=/^@(\w+)\b/.exec(a[0]),h=f&&f[1]=="keyframes";if(f&&l==null)return c.push(a[0]+";");for(let p in l){let g=l[p];if(/&/.test(p))s(p.split(/,\s*/).map(b=>a.map(v=>b.replace(/&/,v))).reduce((b,v)=>b.concat(v)),g,c);else if(g&&typeof g=="object"){if(!f)throw new RangeError("The value of a property ("+p+") should be a primitive value.");s(r(p),g,d,h)}else g!=null&&d.push(p.replace(/_.*/,"").replace(/[A-Z]/g,b=>"-"+b.toLowerCase())+": "+g+";")}(d.length||h)&&c.push((i&&!f&&!u?a.map(i):a).join(", ")+" {"+d.join(" ")+"}")}for(let a in t)s(r(a),t[a],this.rules)}getRules(){return this.rules.join(` `)}static newName(){let t=EZ[kZ]||1;return EZ[kZ]=t+1,S$+t.toString(36)}static mount(t,n,i){let r=t[k$],s=i&&i.nonce;r?s&&r.setNonce(s):r=new uEt(t,s),r.mount(Array.isArray(n)?n:[n],t)}}let CZ=new Map;class uEt{constructor(t,n){let i=t.ownerDocument||t,r=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&r.CSSStyleSheet){let s=CZ.get(i);if(s)return t[k$]=s;this.sheet=new r.CSSStyleSheet,CZ.set(i,this)}else this.styleTag=i.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],t[k$]=this}mount(t,n){let i=this.sheet,r=0,s=0;for(let a=0;a-1&&(this.modules.splice(c,1),s--,c=-1),c==-1){if(this.modules.splice(s++,0,l),i)for(let u=0;u",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},dEt=typeof navigator<"u"&&/Mac/.test(navigator.platform),fEt=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ya=0;Ya<10;Ya++)Tm[48+Ya]=Tm[96+Ya]=String(Ya);for(var Ya=1;Ya<=24;Ya++)Tm[Ya+111]="F"+Ya;for(var Ya=65;Ya<=90;Ya++)Tm[Ya]=String.fromCharCode(Ya+32),ek[Ya]=String.fromCharCode(Ya);for(var r5 in Tm)ek.hasOwnProperty(r5)||(ek[r5]=Tm[r5]);function hEt(e){var t=dEt&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||fEt&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?ek:Tm)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function yr(){var e=arguments[0];typeof e=="string"&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];typeof r=="string"?e.setAttribute(i,r):r!=null&&(e[i]=r)}t++}for(;t2);var Wt={mac:_Z||/Mac/.test(Po.platform),windows:/Win/.test(Po.platform),linux:/Linux|X11/.test(Po.platform),ie:xI,ie_version:VTe?E$.documentMode||6:T$?+T$[1]:C$?+C$[1]:0,gecko:TZ,gecko_version:TZ?+(/Firefox\/(\d+)/.exec(Po.userAgent)||[0,0])[1]:0,chrome:!!s5,chrome_version:s5?+s5[1]:0,ios:_Z,android:/Android\b/.test(Po.userAgent),webkit:AZ,webkit_version:AZ?+(/\bAppleWebKit\/(\d+)/.exec(Po.userAgent)||[0,0])[1]:0,safari:A$,safari_version:A$?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Po.userAgent)||[0,0])[1]:0,tabSize:E$.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function GU(e,t){for(let n in e)n=="class"&&t.class?t.class+=" "+e.class:n=="style"&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}const jN=Object.create(null);function KU(e,t,n){if(e==t)return!0;e||(e=jN),t||(t=jN);let i=Object.keys(e),r=Object.keys(t);if(i.length-0!=r.length-0)return!1;for(let s of i)if(s!=n&&(r.indexOf(s)==-1||e[s]!==t[s]))return!1;return!0}function pEt(e,t){for(let n=e.attributes.length-1;n>=0;n--){let i=e.attributes[n].name;t[i]==null&&e.removeAttribute(i)}for(let n in t){let i=t[n];n=="style"?e.style.cssText=i:e.getAttribute(n)!=i&&e.setAttribute(n,i)}}function NZ(e,t,n){let i=!1;if(t)for(let r in t)n&&r in n||(i=!0,r=="style"?e.style.cssText="":e.removeAttribute(r));if(n)for(let r in n)t&&t[r]==n[r]||(i=!0,r=="style"?e.style.cssText=n[r]:e.setAttribute(r,n[r]));return i}function mEt(e){let t=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new Nb(t,n,n,i,t.widget||null,!1)}static replace(t){let n=!!t.block,i,r;if(t.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:a}=HTe(t,n);i=(s?n?-3e8:-1:5e8)-1,r=(a?n?2e8:1:-6e8)+1}return new Nb(t,i,r,n,t.widget||null,!0)}static line(t){return new DE(t)}static set(t,n=!1){return xi.of(t,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}gn.none=xi.empty;class PE extends gn{constructor(t){let{start:n,end:i}=HTe(t);super(n?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.attrs=t.class&&t.attributes?GU(t.attributes,{class:t.class}):t.class?{class:t.class}:t.attributes||jN}eq(t){return this==t||t instanceof PE&&this.tagName==t.tagName&&KU(this.attrs,t.attrs)}range(t,n=t){if(t>=n)throw new RangeError("Mark decorations may not be empty");return super.range(t,n)}}PE.prototype.point=!1;class DE extends gn{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof DE&&this.spec.class==t.spec.class&&KU(this.spec.attributes,t.spec.attributes)}range(t,n=t){if(n!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,n)}}DE.prototype.mapMode=eo.TrackBefore;DE.prototype.point=!0;class Nb extends gn{constructor(t,n,i,r,s,a){super(n,i,s,t),this.block=r,this.isReplace=a,this.mapMode=r?n<=0?eo.TrackBefore:eo.TrackAfter:eo.TrackDel}get type(){return this.startSide!=this.endSide?io.WidgetRange:this.startSide<=0?io.WidgetBefore:io.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof Nb&&gEt(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,n=t){if(this.isReplace&&(t>n||t==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,n)}}Nb.prototype.point=!0;function HTe(e,t=!1){let{inclusiveStart:n,inclusiveEnd:i}=e;return n==null&&(n=e.inclusive),i==null&&(i=e.inclusive),{start:n??t,end:i??t}}function gEt(e,t){return e==t||!!(e&&t&&e.compare(t))}function uv(e,t,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=e?n[r]=Math.max(n[r],t):n.push(e,t)}class tk extends Em{constructor(t,n,i){super(),this.tagName=t,this.attributes=n,this.rank=i}eq(t){return t==this||t instanceof tk&&this.tagName==t.tagName&&KU(this.attributes,t.attributes)}static create(t){return new tk(t.tagName,t.attributes||jN,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(t,n=!1){return xi.of(t,n)}}tk.prototype.startSide=tk.prototype.endSide=-1;function nk(e){let t;return e.nodeType==11?t=e.getSelection?e:e.ownerDocument:t=e,t.getSelection()}function _$(e,t){return t?e==t||e.contains(t.nodeType!=1?t.parentNode:t):!1}function FO(e,t){if(!t.anchorNode)return!1;try{return _$(e,t.anchorNode)}catch{return!1}}function BO(e){return e.nodeType==3?rk(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function UO(e,t,n,i){return n?jZ(e,t,n,i,-1)||jZ(e,t,n,i,1):!1}function Am(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function RN(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function jZ(e,t,n,i,r){for(;;){if(e==n&&t==i)return!0;if(t==(r<0?0:_h(e))){if(e.nodeName=="DIV")return!1;let s=e.parentNode;if(!s||s.nodeType!=1)return!1;t=Am(e)+(r<0?0:1),e=s}else if(e.nodeType==1){if(e=e.childNodes[t+(r<0?-1:0)],e.nodeType==1&&e.contentEditable=="false")return!1;t=r<0?_h(e):0}else return!1}}function _h(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function ik(e,t){let{left:n,right:i}=e;if(n==i)return e;let r=t?n:i;return{left:r,right:r,top:e.top,bottom:e.bottom}}function bEt(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function qTe(e,t){let n=t.width/e.offsetWidth,i=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.height-e.offsetHeight)<1)&&(i=1),{scaleX:n,scaleY:i}}function yEt(e,t,n,i,r,s,a,l){let c=e.ownerDocument,u=c.defaultView||window;for(let d=e,f=!1;d&&!f;)if(d.nodeType==1){let h,p=d==c.body,g=1,b=1;if(p)h=bEt(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(d).position)&&(f=!0),d.scrollHeight<=d.clientHeight&&d.scrollWidth<=d.clientWidth){d=d.assignedSlot||d.parentNode;continue}let x=d.getBoundingClientRect();({scaleX:g,scaleY:b}=qTe(d,x)),h={left:x.left,right:x.left+d.clientWidth*g,top:x.top,bottom:x.top+d.clientHeight*b}}let v=0,y=0;if(r=="nearest")t.top0&&t.bottom>h.bottom+y&&(y=t.bottom-h.bottom+a)):t.bottom>h.bottom-a&&(y=t.bottom-h.bottom+a,n<0&&t.top-y0&&t.right>h.right+v&&(v=t.right-h.right+s)):t.right>h.right-s&&(v=t.right-h.right+s,n<0&&t.lefth.bottom||t.lefth.right)&&(t={left:Math.max(t.left,h.left),right:Math.min(t.right,h.right),top:Math.max(t.top,h.top),bottom:Math.min(t.bottom,h.bottom)}),d=d.assignedSlot||d.parentNode}else if(d.nodeType==11)d=d.host;else break}function WTe(e,t=!0){let n=e.ownerDocument,i=null,r=null;for(let s=e.parentNode;s&&!(s==n.body||(!t||i)&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),t&&!i&&s.scrollWidth>s.clientWidth&&(i=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:i,y:r}}class vEt{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:n,focusNode:i}=t;this.set(n,Math.min(t.anchorOffset,n?_h(n):0),i,Math.min(t.focusOffset,i?_h(i):0))}set(t,n,i,r){this.anchorNode=t,this.anchorOffset=n,this.focusNode=i,this.focusOffset=r}}let kg=null;Wt.safari&&Wt.safari_version>=26&&(kg=!1);function GTe(e){if(e.setActive)return e.setActive();if(kg)return e.focus(kg);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(kg==null?{get preventScroll(){return kg={preventScroll:!0},!0}}:void 0),!kg){kg=!1;for(let n=0;nMath.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function XTe(e,t){for(let n=e,i=t;;){if(n.nodeType==3&&i>0)return{node:n,offset:i};if(n.nodeType==1&&i>0){if(n.contentEditable=="false")return null;n=n.childNodes[i-1],i=_h(n)}else if(n.parentNode&&!RN(n))i=Am(n),n=n.parentNode;else return null}}function YTe(e,t){for(let n=e,i=t;;){if(n.nodeType==3&&i=n){if(l.level==i)return a;(s<0||(r!=0?r<0?l.fromn:t[s].level>l.level))&&(s=a)}}if(s<0)throw new RangeError("Index out of range");return s}}function e2e(e,t){if(e.length!=t.length)return!1;for(let n=0;n=0;b-=3)if(od[b+1]==-p){let v=od[b+2],y=v&2?r:v&4?v&1?s:r:0;y&&(Er[f]=Er[od[b]]=y),l=b;break}}else{if(od.length==189)break;od[l++]=f,od[l++]=h,od[l++]=c}else if((g=Er[f])==2||g==1){let b=g==r;c=b?0:1;for(let v=l-3;v>=0;v-=3){let y=od[v+2];if(y&2)break;if(b)od[v+2]|=2;else{if(y&4)break;od[v+2]|=4}}}}}function TEt(e,t,n,i){for(let r=0,s=i;r<=n.length;r++){let a=r?n[r-1].to:e,l=rc;)g==v&&(g=n[--b].from,v=b?n[b-1].to:e),Er[--g]=p;c=d}else s=u,c++}}}function j$(e,t,n,i,r,s,a){let l=i%2?2:1;if(i%2==r%2)for(let c=t,u=0;cc&&a.push(new Ad(c,b.from,p));let v=b.direction==jb!=!(p%2);R$(e,v?i+1:i,r,b.inner,b.from,b.to,a),c=b.to}g=b.to}else{if(g==n||(d?Er[g]!=l:Er[g]==l))break;g++}h?j$(e,c,g,i+1,r,h,a):ct;){let d=!0,f=!1;if(!u||c>s[u-1].to){let b=Er[c-1];b!=l&&(d=!1,f=b==16)}let h=!d&&l==1?[]:null,p=d?i:i+1,g=c;e:for(;;)if(u&&g==s[u-1].to){if(f)break e;let b=s[--u];if(!d)for(let v=b.from,y=u;;){if(v==t)break e;if(y&&s[y-1].to==v)v=s[--y].from;else{if(Er[v-1]==l)break e;break}}if(h)h.push(b);else{b.toEr.length;)Er[Er.length]=256;let i=[],r=t==jb?0:1;return R$(e,r,r,n,0,e.length,i),i}function t2e(e){return[new Ad(0,e,0)]}let n2e="";function _Et(e,t,n,i,r){var s;let a=i.head-e.from,l=Ad.find(t,a,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),c=t[l],u=c.side(r,n);if(a==u){let h=l+=r?1:-1;if(h<0||h>=t.length)return null;c=t[l=h],a=c.side(!r,n),u=c.side(r,n)}let d=$a(e.text,a,c.forward(r,n));(dc.to)&&(d=u),n2e=e.text.slice(Math.min(a,d),Math.max(a,d));let f=l==(r?t.length-1:0)?null:t[l+(r?1:-1)];return f&&d==u&&f.level+(r?0:1)e.some(t=>t)}),u2e=Kt.define({combine:e=>e.some(t=>t)}),d2e=Kt.define();class fv{constructor(t,n,i,r,s,a=!1){this.range=t,this.y=n,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=a}map(t){return t.empty?this:new fv(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new fv(st.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const KT=Fn.define({map:(e,t)=>e.map(t)}),f2e=Fn.define();function hl(e,t,n){let i=e.facet(a2e);i.length?i[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}const zf=Kt.define({combine:e=>e.length?e[0]:!0});let jEt=0;const My=Kt.define({combine(e){return e.filter((t,n)=>{for(let i=0;i{let c=[];return a&&c.push(wI.of(u=>{let d=u.plugin(l);return d?a(d):gn.none})),s&&c.push(s(l)),c})}static fromClass(t,n){return Ts.define((i,r)=>new t(i,r),n)}}class a5{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(t){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(i){if(hl(n.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(t,this.spec.arg)}catch(n){hl(t.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(i){hl(t.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const h2e=Kt.define(),JU=Kt.define(),wI=Kt.define(),p2e=Kt.define(),eQ=Kt.define(),ME=Kt.define(),m2e=Kt.define();function IZ(e,t){let n=e.state.facet(m2e);if(!n.length)return n;let i=n.map(s=>s instanceof Function?s(e):s),r=[];return xi.spans(i,t.from,t.to,{point(){},span(s,a,l,c){let u=s-t.from,d=a-t.from,f=r;for(let h=l.length-1;h>=0;h--,c--){let p=l[h].spec.bidiIsolate,g;if(p==null&&(p=NEt(t.text,u,d)),c>0&&f.length&&(g=f[f.length-1]).to==u&&g.direction==p)g.to=d,f=g.inner;else{let b={from:u,to:d,direction:p,inner:[]};f.push(b),f=b.inner}}}}),r}const g2e=Kt.define();function tQ(e){let t=0,n=0,i=0,r=0;for(let s of e.state.facet(g2e)){let a=s(e);a&&(a.left!=null&&(t=Math.max(t,a.left)),a.right!=null&&(n=Math.max(n,a.right)),a.top!=null&&(i=Math.max(i,a.top)),a.bottom!=null&&(r=Math.max(r,a.bottom)))}return{left:t,right:n,top:i,bottom:r}}const zw=Kt.define();class Gc{constructor(t,n,i,r){this.fromA=t,this.toA=n,this.fromB=i,this.toB=r}join(t){return new Gc(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let n=t.length,i=this;for(;n>0;n--){let r=t[n-1];if(!(r.fromA>i.toA)){if(r.toAr.push(new Gc(s,a,l,c))),this.changedRanges=r}static create(t,n,i){return new IN(t,n,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const REt=[];class Cs{constructor(t,n,i=0){this.dom=t,this.length=n,this.flags=i,this.parent=null,t.cmTile=this}get breakAfter(){return this.flags&1}get children(){return REt}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(t){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&pEt(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(t){this.dom=t,t.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t,n=this.posAtStart){let i=n;for(let r of this.children){if(r==t)return i;i+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}covers(t){return!0}coordsIn(t,n,i){return null}domPosFor(t,n){let i=Am(this.dom),r=this.length?t>0:n>0;return new Nu(this.parent.dom,i+(r?1:0),t==0||t==this.length)}markDirty(t){this.flags&=-3,t&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let t=this;t;t=t.parent)if(t instanceof SI)return t;return null}static get(t){return t.cmTile}}class OI extends Cs{constructor(t){super(t,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(t){this.children.push(t),t.parent=this}sync(t){if(this.flags&2)return;super.sync(t);let n=this.dom,i=null,r,s=(t==null?void 0:t.node)==n?t:null,a=0;for(let l of this.children){if(l.sync(t),a+=l.length+l.breakAfter,r=i?i.nextSibling:n.firstChild,s&&r!=l.dom&&(s.written=!0),l.dom.parentNode==n)for(;r&&r!=l.dom;)r=PZ(r);else n.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:n.firstChild,s&&r&&(s.written=!0);r;)r=PZ(r);this.length=a}}function PZ(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class SI extends OI{constructor(t,n){super(n),this.view=t}owns(t){for(;t;t=t.parent)if(t==this)return!0;return!1}isBlock(){return!0}nearest(t){for(;;){if(!t)return null;let n=Cs.get(t);if(n&&this.owns(n))return n;t=t.parentNode}}blockTiles(t){for(let n=[],i=this,r=0,s=0;;)if(r==i.children.length){if(!n.length)return;i=i.parent,i.breakAfter&&s++,r=n.pop()}else{let a=i.children[r++];if(a instanceof dh)n.push(r),i=a,r=0;else{let l=s+a.length,c=t(a,s);if(c!==void 0)return c;s=l+a.breakAfter}}}resolveBlock(t,n){let i,r=-1,s,a=-1;if(this.blockTiles((l,c)=>{let u=c+l.length;if(t>=c&&t<=u){if(l.isWidget()&&n>=-1&&n<=1){if(l.flags&32)return!0;l.flags&16&&(i=void 0)}(ct||t==c&&(n>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,a=t-c)}}),!i&&!s)throw new Error("No tile at position "+t);return i&&n<0||!s?{tile:i,offset:r}:{tile:s,offset:a}}}class dh extends OI{constructor(t,n){super(t),this.wrapper=n}isBlock(){return!0}covers(t){return this.children.length?t<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let i=new dh(n||document.createElement(t.tagName),t);return n||(i.flags|=4),i}}class rx extends OI{constructor(t,n){super(t),this.attrs=n}isLine(){return!0}static start(t,n,i){let r=new rx(n||document.createElement("div"),t);return(!n||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(t,n,i){let r=null,s=-1,a=null,l=-1;function c(d,f){for(let h=0,p=0;h=f&&(g.isComposite()?c(g,f-p):(!a||a.isHidden&&(n>0&&!(a.flags&32)||i&&PEt(a,g)))&&(b>f||g.flags&32)?(a=g,l=f-p):(pr&&(t=r);let s=t,a=t,l=0;t==0&&n<0||t==r&&n>=0?Wt.chrome||Wt.gecko||(t?(s--,l=1):a=0)?0:c.length-1];return Wt.safari&&!l&&u.width==0&&(u=Array.prototype.find.call(c,d=>d.width)||u),i==null?u:ik(u,(l?l>0:n<0)==i)}static of(t,n){let i=new Qg(n||document.createTextNode(t),t);return n||(i.flags|=2),i}}class Rb extends Cs{constructor(t,n,i,r){super(t,n,r),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(t){return this.flags&48?!1:(this.flags&(t<0?64:128))>0}coordsIn(t,n){return this.coordsInWidget(t,n,!1)}coordsInWidget(t,n,i){let r=this.widget.coordsAt(this.dom,t,n);if(r)return r;if(i)return ik(this.dom.getBoundingClientRect(),this.length?t==0:n<=0);{let s=this.dom.getClientRects(),a=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:t>0;for(let c=l?s.length-1:0;a=s[c],!(t>0?c==0:c==s.length-1||a.top0==i)}}class DEt{constructor(t){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=t}advance(t,n,i){let{tile:r,index:s,beforeBreak:a,parents:l}=this;for(;t||n>0;)if(r.isComposite())if(a){if(!t)break;i&&i.break(),t--,a=!1}else if(s==r.children.length){if(!t&&!l.length)break;i&&i.leave(r),a=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++}else{let c=r.children[s],u=c.breakAfter;(n>0?c.length<=t:c.length=0;l--){let c=n.marks[l],u=r.lastChild;if(u instanceof ul&&u.mark.eq(c.mark))u.dom!=c.dom&&u.setDOM(o5(c.dom)),r=u;else{if(this.cache.reused.get(c)){let f=Cs.get(c.dom);f&&f.setDOM(o5(c.dom))}let d=ul.of(c.mark,c.dom);r.append(d),r=d}this.cache.reused.set(c,2)}let s=Cs.get(t.text);s&&this.cache.reused.set(s,2);let a=new Qg(t.text,t.text.nodeValue);a.flags|=8,this.pos=t.range.toB,r.append(a)}addInlineWidget(t,n,i){let r=this.afterWidget&&t.flags&48&&(this.afterWidget.flags&48)==(t.flags&48);r||this.flushBuffer();let s=this.ensureMarks(n,i);!r&&!(t.flags&16)&&s.append(this.getBuffer(1)),s.append(t),this.pos+=t.length,this.afterWidget=t}addMark(t,n,i){this.flushBuffer(),this.ensureMarks(n,i).append(t),this.pos+=t.length,this.afterWidget=null}addBlockWidget(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}continueWidget(t){let n=this.afterWidget||this.lastBlock;n.length+=t,this.pos+=t}addLineStart(t,n){var i;t||(t=b2e);let r=rx.start(t,n||((i=this.cache.find(rx))===null||i===void 0?void 0:i.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(t){this.blockPosCovered()||this.addLineStart(t)}ensureLine(t){this.curLine||this.addLineStart(t)}ensureMarks(t,n){var i;let r=this.curLine;for(let s=t.length-1;s>=0;s--){let a=t[s],l;if(n>0&&(l=r.lastChild)&&l instanceof ul&&l.mark.eq(a))r=l,n--;else{let c=ul.of(a,(i=this.cache.find(ul,u=>u.mark.eq(a)))===null||i===void 0?void 0:i.dom);r.append(c),r=c,n=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let t=this.curLine.lastChild;(!t||!DZ(this.curLine,!1)||t.dom.nodeName!="BR"&&t.isWidget()&&!(Wt.ios&&DZ(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(l5,0,32)||new Rb(l5.toDOM(),0,l5,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let t=this.wrappers.length-1;t>=0;t--)this.wrappers[t].to=this.pos){let n=t.rank*102+t.value.rank,i=new MEt(t.from,t.to,t.value,n),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-i.rank||this.wrappers[r-1].to-i.to)<0;)r--;this.wrappers.splice(r,0,i)}this.wrapperPos=this.pos}getBlockPos(){var t;this.updateBlockWrappers();let n=this.root;for(let i of this.wrappers){let r=n.lastChild;if(i.froma.wrapper.eq(i.wrapper)))===null||t===void 0?void 0:t.dom);n.append(s),n=s}}return n}blockPosCovered(){let t=this.lastBlock;return t!=null&&!t.breakAfter&&(!t.isWidget()||(t.flags&160)>0)}getBuffer(t){let n=2|(t<0?16:32),i=this.cache.find(PN,void 0,1);return i&&(i.flags=n),i||new PN(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class $Et{constructor(t){this.skipCount=0,this.text="",this.textOff=0,this.cursor=t.iter()}skip(t){this.textOff+t<=this.text.length?this.textOff+=t:(this.skipCount+=t-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(t){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:a}=this.cursor.next(this.skipCount);if(this.skipCount=0,a)throw new Error("Ran out of text content when drawing inline views");this.text=r;let l=this.textOff=Math.min(t,r.length);return s?null:r.slice(0,l)}let n=Math.min(this.text.length,this.textOff+t),i=this.text.slice(this.textOff,n);return this.textOff=n,i}}const DN=[Rb,rx,Qg,ul,PN,dh,SI];for(let e=0;e[]),this.index=DN.map(()=>0),this.reused=new Map}add(t){let n=t.constructor.bucket,i=this.buckets[n];i.length<6?i.push(t):i[this.index[n]=(this.index[n]+1)%6]=t}find(t,n,i=2){let r=t.bucket,s=this.buckets[r],a=this.index[r];for(let l=0;l{if(this.cache.add(a),a.isComposite())return!1},enter:a=>this.cache.add(a),leave:()=>{},break:()=>{}}}run(t,n){let i=n&&this.getCompositionContext(n.text);for(let r=0,s=0,a=0;;){let l=ar){let u=c-r;this.preserve(u,!a,!l),r=c,s+=u}if(!l)break;n&&l.fromA<=n.range.fromA&&l.toA>=n.range.toA?(this.forward(l.fromA,n.range.fromA,n.range.fromA{if(a.isWidget())if(this.openWidget)this.builder.continueWidget(c-l);else{let u=c>0||l{a.isLine()?this.builder.addLineStart(a.attrs,this.cache.maybeReuse(a)):(this.cache.add(a),a instanceof ul&&r.unshift(a.mark)),this.openWidget=!1},leave:a=>{a.isLine()?r.length&&(r.length=s=0):a instanceof ul&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(t)}emit(t,n){let i=null,r=this.builder,s=-1,a=xi.spans(this.decorations,t,n,{point:(l,c,u,d,f,h)=>{if(u instanceof Nb){if(this.disallowBlockEffectsFor[h]){if(u.block)throw new RangeError("Block decorations may not be specified via plugins");if(c>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=d.length,f>d.length)r.continueWidget(c-l);else{let p=u.widget||(u.block?sx.block:sx.inline),g=UEt(u),b=this.cache.findWidget(p,c-l,g)||Rb.of(p,this.view,c-l,g);u.block?(u.startSide>0&&r.addLineStartIfNotCovered(i),r.addBlockWidget(b)):(r.ensureLine(i),r.addInlineWidget(b,d,f))}i=null}else i=QEt(i,u);c>l&&this.text.skip(c-l)},span:(l,c,u,d)=>{for(let f=l;f-1&&(this.openWidget=a>s),this.openWidget||r.addLineStartIfNotCovered(i),this.openMarks=a}forward(t,n,i=1){n-t<=10?this.old.advance(n-t,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-t-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(t){let n=[],i=null;for(let r=t.parentNode;;r=r.parentNode){let s=Cs.get(r);if(r==this.view.contentDOM)break;s instanceof ul?n.push(s):s!=null&&s.isLine()?i=s:s instanceof dh||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new rx(r,b2e):i||n.push(ul.of(new PE({tagName:r.nodeName.toLowerCase(),attributes:mEt(r)}),r)))}return{line:i,marks:n}}}function DZ(e,t){let n=i=>{for(let r of i.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}function UEt(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}const b2e={class:"cm-line"};function QEt(e,t){let n=t.spec.attributes,i=t.spec.class;return!n&&!i||(e||(e={class:"cm-line"}),n&&GU(n,e),i&&(e.class+=" "+i)),e}function zEt(e){let t=[];for(let n=e.parents.length;n>1;n--){let i=n==e.parents.length?e.tile:e.parents[n].tile;i instanceof ul&&t.push(i.mark)}return t}function o5(e){let t=Cs.get(e);return t&&t.setDOM(e.cloneNode()),e}class sx extends Yu{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}sx.inline=new sx("span");sx.block=new sx("div");const l5=new class extends Yu{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class MZ{constructor(t){this.view=t,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=gn.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new SI(t,t.contentDOM),this.updateInner([new Gc(0,0,0,t.state.doc.length)],null)}update(t){var n;let i=t.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:d,toA:f})=>fthis.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?r=this.domChanged.newSel.head:!ZEt(t.changes,this.hasComposition)&&!t.selectionSet&&(r=t.state.selection.main.head));let s=r>-1?HEt(this.view,t.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:f}=this.hasComposition;i=new Gc(d,f,t.changes.mapPos(d,-1),t.changes.mapPos(f,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(Wt.ie||Wt.chrome)&&!s&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,l=this.blockWrappers;this.updateDeco();let c=GEt(a,this.decorations,t.changes);c.length&&(i=Gc.extendWithRanges(i,c));let u=XEt(l,this.blockWrappers,t.changes);return u.length&&(i=Gc.extendWithRanges(i,u)),s&&!i.some(d=>d.fromA<=s.range.fromA&&d.toA>=s.range.toA)&&(i=s.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,s),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,n){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(n||t.length){let a=this.tile,l=new BEt(this.view,a,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&Cs.get(n.text)&&l.cache.reused.set(Cs.get(n.text),2),this.tile=l.run(t,n),P$(a,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=Wt.chrome||Wt.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||i.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to-1)&&FO(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(s||n||a))return;let l=this.forceSelection;this.forceSelection=!1;let c=this.view.state.selection.main,u,d;if(c.empty?d=u=this.inlineDOMNearPos(c.anchor,c.assoc||1):(d=this.inlineDOMNearPos(c.head,c.head==c.from?1:-1),u=this.inlineDOMNearPos(c.anchor,c.anchor==c.from?1:-1)),Wt.gecko&&c.empty&&!this.hasComposition&&VEt(u)){let h=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(h,u.node.childNodes[u.offset]||null)),u=d=new Nu(h,0),l=!0}let f=this.view.observer.selectionRange;(l||!f.focusNode||(!UO(u.node,u.offset,f.anchorNode,f.anchorOffset)||!UO(d.node,d.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,c))&&(this.view.observer.ignore(()=>{Wt.android&&Wt.chrome&&i.contains(f.focusNode)&&YEt(f.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let h=nk(this.view.root);if(h)if(c.empty){if(Wt.gecko){let p=qEt(u.node,u.offset);if(p&&p!=3){let g=(p==1?XTe:YTe)(u.node,u.offset);g&&(u=new Nu(g.node,g.offset))}}h.collapse(u.node,u.offset),c.bidiLevel!=null&&h.caretBidiLevel!==void 0&&(h.caretBidiLevel=c.bidiLevel)}else if(h.extend){h.collapse(u.node,u.offset);try{h.extend(d.node,d.offset)}catch{}}else{let p=document.createRange();c.anchor>c.head&&([u,d]=[d,u]),p.setEnd(d.node,d.offset),p.setStart(u.node,u.offset),h.removeAllRanges(),h.addRange(p)}a&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(u,d)),this.impreciseAnchor=u.precise?null:new Nu(f.anchorNode,f.anchorOffset),this.impreciseHead=d.precise?null:new Nu(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(t,n){return this.hasComposition&&n.empty&&UO(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,n=t.state.selection.main,i=nk(t.root),{anchorNode:r,anchorOffset:s}=t.observer.selectionRange;if(!i||!n.empty||!n.assoc||!i.modify)return;let a=this.lineAt(n.head,n.assoc);if(!a)return;let l=a.posAtStart;if(n.head==l||n.head==l+a.length)return;let c=this.coordsAt(n.head,-1),u=this.coordsAt(n.head,1);if(!c||!u||c.bottom>u.top)return;let d=this.domAtPos(n.head+n.assoc,n.assoc);i.collapse(d.node,d.offset),i.modify("move",n.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let f=t.observer.selectionRange;t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&i.collapse(r,s)}posFromDOM(t,n){let i=this.tile.nearest(t);if(!i)return this.tile.dom.compareDocumentPosition(t)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let s;if(t==i.dom)s=i.dom.childNodes[n];else{let a=_h(t)==0?0:n==0?-1:1;for(;;){let l=t.parentNode;if(l==i.dom)break;a==0&&l.firstChild!=l.lastChild&&(t==l.firstChild?a=-1:a=1),t=l}a<0?s=t:s=t.nextSibling}if(s==i.dom.firstChild)return r;for(;s&&!Cs.get(s);)s=s.nextSibling;if(!s)return r+i.length;for(let a=0,l=r;;a++){let c=i.children[a];if(c.dom==s)return l;l+=c.length+c.breakAfter}}else return i.isText()?t==i.dom?r+n:r+(n?i.length:0):r}domAtPos(t,n){let{tile:i,offset:r}=this.tile.resolveBlock(t,n);return i.isWidget()?i.domPosFor(r,n):i.domIn(r,n)}inlineDOMNearPos(t,n){let i,r=-1,s=!1,a,l=-1,c=!1;return this.tile.blockTiles((u,d)=>{if(u.isWidget()){if(u.flags&32&&d>=t)return!0;u.flags&16&&(s=!0)}else{let f=d+u.length;if(d<=t&&(i=u,r=t-d,s=f=t&&!a&&(a=u,l=t-d,c=d>t),d>t&&a)return!0}}),!i&&!a?this.domAtPos(t,n):(s&&a?i=null:c&&i&&(a=null),i&&n<0||!a?i.domIn(r,n):a.domIn(l,n))}coordsAt(t,n,i){let{tile:r,offset:s}=this.tile.resolveBlock(t,n);return r.isWidget()?r.widget instanceof c5?null:r.coordsInWidget(s,n,!0):r.coordsIn(s,n,i)}lineAt(t,n){let{tile:i}=this.tile.resolveBlock(t,n);return i.isLine()?i:null}coordsForChar(t){let{tile:n,offset:i}=this.tile.resolveBlock(t,1);if(!n.isLine())return null;function r(s,a){if(s.isComposite())for(let l of s.children){if(l.length>=a){let c=r(l,a);if(c)return c}if(a-=l.length,a<0)break}else if(s.isText()&&aMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,c=this.view.textDirection==Cr.LTR,u=0,d=(f,h,p)=>{for(let g=0;gr);g++){let b=f.children[g],v=h+b.length,y=b.dom.getBoundingClientRect(),{height:x}=y;if(p&&!g&&(u+=y.top-p.top),b instanceof dh)v>i&&d(b,h,y);else if(h>=i&&(u>0&&n.push(-u),n.push(x+u),u=0,a)){let O=b.dom.lastChild,w=O?BO(O):[];if(w.length){let k=w[w.length-1],S=c?k.right-y.left:y.right-k.left;S>l&&(l=S,this.minWidth=s,this.minWidthFrom=h,this.minWidthTo=v)}}p&&g==f.children.length-1&&(u+=p.bottom-y.bottom),h=v+b.breakAfter}};return d(this.tile,0,null),n}textDirectionAt(t){let{tile:n}=this.tile.resolveBlock(t,1);return getComputedStyle(n.dom).direction=="rtl"?Cr.RTL:Cr.LTR}measureTextSize(){let t=this.tile.blockTiles(a=>{if(a.isLine()&&a.children.length&&a.length<=20){let l=0,c;for(let u of a.children){if(!u.isText()||/[^ -~]/.test(u.text))return;let d=BO(u.dom);if(d.length!=1)return;l+=d[0].width,c=d[0].height}if(l)return{lineHeight:a.dom.getBoundingClientRect().height,charWidth:l/a.length,textHeight:c}}});if(t)return t;let n=document.createElement("div"),i,r,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let a=BO(n.firstChild)[0];i=n.getBoundingClientRect().height,r=a&&a.width?a.width/27:7,s=a&&a.height?a.height:i,n.remove()}),{lineHeight:i,charWidth:r,textHeight:s}}computeBlockGapDeco(){let t=[],n=this.view.viewState;for(let i=0,r=0;;r++){let s=r==n.viewports.length?null:n.viewports[r],a=s?s.from-1:this.view.state.doc.length;if(a>i){let l=(n.lineBlockAt(a).bottom-n.lineBlockAt(i).top)/this.view.scaleY;t.push(gn.replace({widget:new c5(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,a))}if(!s)break;i=s.to+1}return gn.set(t)}updateDeco(){let t=1,n=this.view.state.facet(wI).map(s=>(this.dynamicDecorationMap[t++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(eQ).map((s,a)=>{let l=typeof s=="function";return l&&(i=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[t++]=i,n.push(xi.join(r))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];ttypeof s=="function"?s(this.view):s)}scrollIntoView(t){if(t.isSnapshot){let u=this.view.viewState.lineBlockAt(t.range.head);this.view.scrollDOM.scrollTop=u.top-t.yMargin,this.view.scrollDOM.scrollLeft=t.xMargin;return}for(let u of this.view.state.facet(d2e))try{if(u(this.view,t.range,t))return!0}catch(d){hl(this.view.state,d,"scroll handler")}let{range:n}=t,i=this.coordsAt(n.head,n.assoc||(n.head>n.anchor?-1:1)),r;if(!i)return;!n.empty&&(r=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let s=tQ(this.view),a={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:l,offsetHeight:c}=this.view.scrollDOM;if(yEt(this.view.scrollDOM,a,n.head1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottomi.isWidget()||i.children.some(n);return n(this.tile.resolveBlock(t,1).tile)}destroy(){P$(this.tile)}}function P$(e,t){let n=t==null?void 0:t.get(e);if(n!=1){n==null&&e.destroy();for(let i of e.children)P$(i,t)}}function VEt(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable=="false")&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable=="false")}function y2e(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let i=XTe(n.focusNode,n.focusOffset),r=YTe(n.focusNode,n.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let l=Cs.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(e.docView.lastCompositionAfterCursor){let c=Cs.get(i.node);!c||c.isText()&&c.text!=i.node.nodeValue||(s=r)}}if(e.docView.lastCompositionAfterCursor=s!=i,!s)return null;let a=t-s.offset;return{from:a,to:a+s.node.nodeValue.length,node:s.node}}function HEt(e,t,n){let i=y2e(e,n);if(!i)return null;let{node:r,from:s,to:a}=i,l=r.nodeValue;if(/[\n\r]/.test(l)||e.state.doc.sliceString(i.from,i.to)!=l)return null;let c=t.invertedDesc;return{range:new Gc(c.mapPos(s),c.mapPos(a),s,a),text:r}}function qEt(e,t){return e.nodeType!=1?0:(t&&e.childNodes[t-1].contentEditable=="false"?1:0)|(t{it.from&&(n=!0)}),n}class c5 extends Yu{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function JEt(e,t,n=1){let i=e.charCategorizer(t),r=e.doc.lineAt(t),s=t-r.from;if(r.length==0)return st.cursor(t);s==0?n=1:s==r.length&&(n=-1);let a=s,l=s;n<0?a=$a(r.text,s,!1):l=$a(r.text,s);let c=i(r.text.slice(a,l));for(;a>0;){let u=$a(r.text,a,!1);if(i(r.text.slice(u,a))!=c)break;a=u}for(;le.defaultLineHeight*1.5){let l=e.viewState.heightOracle.textHeight,c=Math.floor((r-n.top-(e.defaultLineHeight-l)*.5)/l);s+=c*e.viewState.heightOracle.lineLength}let a=e.state.sliceDoc(n.from,n.to);return n.from+O$(a,s,e.state.tabSize)}function D$(e,t,n){let i=e.lineBlockAt(t);if(Array.isArray(i.type)){let r;for(let s of i.type){if(s.from>t)break;if(!(s.tot)return s;(!r||s.type==io.Text&&(r.type!=s.type||(n<0?s.fromt)))&&(r=s)}}return r||i}return i}function tCt(e,t,n,i){let r=D$(e,t.head,t.assoc||-1),s=!i||r.type!=io.Text||!(e.lineWrapping||r.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head);if(s){let a=e.dom.getBoundingClientRect(),l=e.textDirectionAt(r.from),c=e.posAtCoords({x:n==(l==Cr.LTR)?a.right-1:a.left+1,y:(s.top+s.bottom)/2});if(c!=null)return st.cursor(c,n?-1:1)}return st.cursor(n?r.to:r.from,n?-1:1)}function LZ(e,t,n,i){let r=e.state.doc.lineAt(t.head),s=e.bidiSpans(r),a=e.textDirectionAt(r.from);for(let l=t,c=null;;){let u=_Et(r,s,a,l,n),d=n2e;if(!u){if(r.number==(n?e.state.doc.lines:1))return l;d=` -`,r=e.state.doc.line(r.number+(n?1:-1)),s=e.bidiSpans(r),u=e.visualLineSide(r,!n)}if(c){if(!c(d))return l}else{if(!i)return u;c=i(d)}l=u}}function nCt(e,t,n){let i=e.state.charCategorizer(t),r=i(n);return s=>{let a=i(s);return r==ns.Space&&(r=a),r==a}}function iCt(e,t,n,i){let r=t.head,s=n?1:-1;if(r==(n?e.state.doc.length:0))return st.cursor(r,t.assoc);let a=t.goalColumn,l,c=e.contentDOM.getBoundingClientRect(),u=e.coordsAtPos(r,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),d=e.documentTop;if(u)a==null&&(a=u.left-c.left),l=s<0?u.top:u.bottom;else{let g=e.viewState.lineBlockAt(r);a==null&&(a=Math.min(c.right-c.left,e.defaultCharacterWidth*(r-g.from))),l=(s<0?g.top:g.bottom)+d}let f=c.left+a,h=e.viewState.heightOracle.textHeight>>1,p=i??h;for(let g=0;;g+=h){let b=l+(p+g)*s,v=M$(e,{x:f,y:b},!1,s);if(n?b>c.bottom:bl:x{if(t>s&&tr(e)),n.from,t.head>n.from?-1:1);return i==n.from?n:st.cursor(i,ie.viewState.docHeight)return new xd(e.state.doc.length,-1);if(u=e.elementAtHeight(c),i==null)break;if(u.type==io.Text){if(i<0?u.toe.viewport.to)break;let h=e.docView.coordsAt(i<0?u.from:u.to,i>0?-1:1);if(h&&(i<0?h.top<=c+s:h.bottom>=c+s))break}let f=e.viewState.heightOracle.textHeight/2;c=i>0?u.bottom+f:u.top-f}if(e.viewport.from>=u.to||e.viewport.to<=u.from){if(n)return null;if(u.type==io.Text){let f=eCt(e,r,u,a,l);return new xd(f,f==u.from?1:-1)}}if(u.type!=io.Text)return c<(u.top+u.bottom)/2?new xd(u.from,1):new xd(u.to,-1);let d=e.docView.lineAt(u.from,2);return(!d||d.length!=u.length)&&(d=e.docView.lineAt(u.from,-2)),new rCt(e,a,l,e.textDirectionAt(u.from)).scanTile(d,u.from)}class rCt{constructor(t,n,i,r){this.view=t,this.x=n,this.y=i,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(t){return(!this.line||this.line.from>t||this.line.to1||i.length&&(i[0].level!=this.baseDir||i[0].to+r.from>1;t:if(a.has(b)){let y=r+Math.floor(Math.random()*g);for(let x=0;x1)){if(x.bottomthis.y)(!u||u.top>x.top)&&(u=x),O=-1;else{let w=x.left>this.x?this.x-x.left:x.right(g+g+b)/3)return this.y=c.bottom-1,this.scan(t,n,!0);if(u&&u.top<(g+b+b)/3)return this.y=u.top+1,this.scan(t,n,!0)}let p=(l?this.dirAt(t[d],1):this.baseDir)==Cr.LTR;return{i:d,after:this.x>(h.left+h.right)/2==p}}scanText(t,n){let i=[];for(let s=0;s{let a=i[s]-n,l=i[s+1]-n;return rk(t.dom,a,l).getClientRects()});return r.after?new xd(i[r.i+1],-1):new xd(i[r.i],1)}scanTile(t,n){if(!t.length)return new xd(n,1);if(t.children.length==1){let l=t.children[0];if(l.isText())return this.scanText(l,n);if(l.isComposite())return this.scanTile(l,n)}let i=[n];for(let l=0,c=n;l{let c=t.children[l];return c.flags&48?null:(c.dom.nodeType==1?c.dom:rk(c.dom,0,c.length)).getClientRects()}),s=t.children[r.i],a=i[r.i];return s.isText()?this.scanText(s,a):s.isComposite()?this.scanTile(s,a):r.after?new xd(i[r.i+1],-1):new xd(a,1)}}const sy="￿";class sCt{constructor(t,n){this.points=t,this.view=n,this.text="",this.lineSeparator=n.state.facet(Ti.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=sy}readRange(t,n){if(!t)return this;let i=t.parentNode;for(let r=t;;){this.findPointBefore(i,r);let s=this.text.length;this.readNode(r);let a=Cs.get(r),l=r.nextSibling;if(l==n){a!=null&&a.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let c=Cs.get(l);(a&&c?a.breakAfter:(a?a.breakAfter:RN(r))||RN(l)&&(r.nodeName!="BR"||a!=null&&a.isWidget())&&this.text.length>s)&&!oCt(l,n)&&this.lineBreak(),r=l}return this.findPointBefore(i,n),this}readTextNode(t){let n=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,n.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,a=1,l;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,i),a=this.lineSeparator.length):(l=r.exec(n))&&(s=l.index,a=l[0].length),this.append(n.slice(i,s<0?n.length:s)),s<0)break;if(this.lineBreak(),a>1)for(let c of this.points)c.node==t&&c.pos>this.text.length&&(c.pos-=a-1);i=s+a}}readNode(t){let n=Cs.get(t),i=n&&n.overrideDOMText;if(i!=null){this.findPointInside(t,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,n){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==n&&(i.pos=this.text.length)}findPointInside(t,n){for(let i of this.points)(t.nodeType==3?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+(aCt(t,i.node,i.offset)?n:0))}}function aCt(e,t,n){for(;;){if(!t||n<_h(t))return!1;if(t==e)return!0;n=Am(t)+1,t=t.parentNode}}function oCt(e,t){let n;for(;!(e==t||!e);e=e.nextSibling){let i=Cs.get(e);if(!(i!=null&&i.isWidget()))return!1;i&&(n||(n=[])).push(i)}if(n)for(let i of n){let r=i.overrideDOMText;if(r!=null&&r.length)return!1}return!0}class $Z{constructor(t,n){this.node=t,this.offset=n,this.pos=-1}}class lCt{constructor(t,n,i,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:s,impreciseAnchor:a}=t.docView,l=t.state.selection;if(t.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=x2e(t.docView.tile,n,i,0))){let c=s||a?[]:uCt(t),u=new sCt(c,t);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=dCt(c,this.bounds.from)}else{let c=t.observer.selectionRange,u=s&&s.node==c.focusNode&&s.offset==c.focusOffset||!_$(t.contentDOM,c.focusNode)?l.main.head:t.docView.posFromDOM(c.focusNode,c.focusOffset),d=a&&a.node==c.anchorNode&&a.offset==c.anchorOffset||!_$(t.contentDOM,c.anchorNode)?l.main.anchor:t.docView.posFromDOM(c.anchorNode,c.anchorOffset),f=t.viewport;if((Wt.ios||Wt.chrome)&&u!=d&&Math.min(u,d)<=l.main.from&&Math.max(u,d)>=l.main.to&&(f.from>0||f.to-1&&l.ranges.length>1)this.newSel=l.replaceRange(st.range(d,u));else if(t.lineWrapping&&d==u&&!(l.main.empty&&l.main.head==u)&&t.inputState.lastTouchTime>Date.now()-100){let h=t.coordsAtPos(u,-1),p=0;h&&(p=t.inputState.lastTouchY<=h.bottom?-1:1),this.newSel=st.create([st.cursor(u,p)])}else this.newSel=st.single(d,u)}}}function x2e(e,t,n,i){if(e.isComposite()){let r=-1,s=-1,a=-1,l=-1;for(let c=0,u=i,d=i;cn)return x2e(f,t,n,u);if(h>=t&&r==-1&&(r=c,s=u),u>n&&f.dom.parentNode==e.dom){a=c,l=d;break}d=h,u=h+f.breakAfter}return{from:s,to:l<0?i+e.length:l,startDOM:(r?e.children[r-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:a=0?e.children[a].dom:null}}else return e.isText()?{from:i,to:i+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function w2e(e,t){let n,{newSel:i}=t,{state:r}=e,s=r.selection.main,a=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:l,to:c}=t.bounds,u=s.from,d=null;(a===8||Wt.android&&t.text.length=l&&s.to<=c&&(t.typeOver||f!=t.text)&&f.slice(0,s.from-l)==t.text.slice(0,s.from-l)&&f.slice(s.to-l)==t.text.slice(h=t.text.length-(f.length-(s.to-l)))?n={from:s.from,to:s.to,insert:Gi.of(t.text.slice(s.from-l,h).split(sy))}:(p=O2e(f,t.text,u-l,d))&&(Wt.chrome&&a==13&&p.toB==p.from+2&&t.text.slice(p.from,p.toB)==sy+sy&&p.toB--,n={from:l+p.from,to:l+p.toA,insert:Gi.of(t.text.slice(p.from,p.toB).split(sy))})}else i&&(!e.hasFocus&&r.facet(zf)||MN(i,s))&&(i=null);if(!n&&!i)return!1;if((Wt.mac||Wt.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute("autocorrect")=="off"?(i&&n.insert.length==2&&(i=st.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:Gi.of([n.insert.toString().replace("."," ")])}):r.doc.lineAt(s.from).toDate.now()-50?n={from:s.from,to:s.to,insert:r.toText(e.inputState.insertingText)}:Wt.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==` - `&&e.lineWrapping&&(i&&(i=st.single(i.main.anchor-1,i.main.head-1)),n={from:s.from,to:s.to,insert:Gi.of([" "])}),n)return nQ(e,n,i,a);if(i&&!MN(i,s)){let l=!1,c="select";return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin=="select"&&(l=!0),c=e.inputState.lastSelectionOrigin,c=="select.pointer"&&(i=v2e(r.facet(ME).map(u=>u(e)),i))),e.dispatch({selection:i,scrollIntoView:l,userEvent:c}),!0}else return!1}function nQ(e,t,n,i=-1){if(Wt.ios&&e.inputState.flushIOSKey(t))return!0;let r=e.state.selection.main;if(Wt.android&&(t.to==r.to&&(t.from==r.from||t.from==r.from-1&&e.state.sliceDoc(t.from,r.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&dv(e.contentDOM,"Enter",13)||(t.from==r.from-1&&t.to==r.to&&t.insert.length==0||i==8&&t.insert.lengthr.head)&&dv(e.contentDOM,"Backspace",8)||t.from==r.from&&t.to==r.to+1&&t.insert.length==0&&dv(e.contentDOM,"Delete",46)))return!0;let s=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let a,l=()=>a||(a=cCt(e,t,n));return e.state.facet(o2e).some(c=>c(e,t.from,t.to,s,l))||e.dispatch(l()),!0}function cCt(e,t,n){let i,r=e.state,s=r.selection.main,a=-1;if(t.from==t.to&&t.froms.to){let c=t.fromf(e)),u,c);t.from==d&&(a=d)}if(a>-1)i={changes:t,selection:st.cursor(t.from+t.insert.length,-1)};else if(t.from>=s.from&&t.to<=s.to&&t.to-t.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let c=s.fromt.to?r.sliceDoc(t.to,s.to):"";i=r.replaceSelection(e.state.toText(c+t.insert.sliceString(0,void 0,e.state.lineBreak)+u))}else{let c=r.changes(t),u=n&&n.main.to<=c.newLength?n.main:void 0;if(r.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=s.to+10&&t.to>=s.to-10){let d=e.state.sliceDoc(t.from,t.to),f,h=n&&y2e(e,n.main.head);if(h){let g=t.insert.length-(t.to-t.from);f={from:h.from,to:h.to-g}}else f=e.state.doc.lineAt(s.head);let p=s.to-t.to;i=r.changeByRange(g=>{if(g.from==s.from&&g.to==s.to)return{changes:c,range:u||g.map(c)};let b=g.to-p,v=b-d.length;if(e.state.sliceDoc(v,b)!=d||b>=f.from&&v<=f.to)return{range:g};let y=r.changes({from:v,to:b,insert:t.insert}),x=g.to-s.to;return{changes:y,range:u?st.range(Math.max(0,u.anchor+x),Math.max(0,u.head+x)):g.map(y)}})}else i={changes:c,selection:u&&r.selection.replaceRange(u)}}let l="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,l+=".compose",e.inputState.compositionFirstChange&&(l+=".start",e.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:l,scrollIntoView:!0})}function O2e(e,t,n,i){let r=Math.min(e.length,t.length),s=0;for(;s0&&l>0&&e.charCodeAt(a-1)==t.charCodeAt(l-1);)a--,l--;if(i=="end"){let c=Math.max(0,s-Math.min(a,l));n-=a+c-s}if(a=a?s-n:0;s-=c,l=s+(l-a),a=s}else if(l=l?s-n:0;s-=c,a=s+(a-l),l=s}return{from:s,toA:a,toB:l}}function uCt(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}=e.observer.selectionRange;return n&&(t.push(new $Z(n,i)),(r!=n||s!=i)&&t.push(new $Z(r,s))),t}function dCt(e,t){if(e.length==0)return null;let n=e[0].pos,i=e.length==2?e[1].pos:n;return n>-1&&i>-1?st.single(n+t,i+t):null}function MN(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class fCt{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,Wt.safari&&t.contentDOM.addEventListener("input",()=>null),Wt.gecko&&ACt(t.contentDOM.ownerDocument)}handleEvent(t){!wCt(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(t.type,t)):this.runHandlers(t.type,t))}runHandlers(t,n){let i=this.handlers[t];if(i){for(let r of i.observers)r(this.view,n);for(let r of i.handlers){if(n.defaultPrevented)break;if(r(this.view,n)){n.preventDefault();break}}}}ensureHandlers(t){let n=pCt(t),i=this.handlers,r=this.view.contentDOM;for(let s in n)if(s!="scroll"){let a=!n[s].handlers.length,l=i[s];l&&a!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:a})}for(let s in i)s!="scroll"&&!n[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&k2e.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),Wt.android&&Wt.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;if(Wt.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&(S2e.some(n=>n.keyCode==t.keyCode)&&!t.ctrlKey||mCt.indexOf(t.key)>-1&&t.ctrlKey)){let n={ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey,shiftKey:t.shiftKey};return n.shiftKey&&Wt.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&hCt(this.view.win)&&(n.shiftKey=!1),this.pendingIOSKey={key:t.key,keyCode:t.keyCode,mods:n},setTimeout(()=>this.flushIOSKey(),250),!0}return t.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(t){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&t&&t.from0?!0:Wt.safari&&!Wt.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function hCt(e){return e.visualViewport?e.visualViewport.height*e.visualViewport.scale/e.document.documentElement.clientHeight<.85:!1}function FZ(e,t){return(n,i)=>{try{return t.call(e,i,n)}catch(r){hl(n.state,r)}}}function pCt(e){let t=Object.create(null);function n(i){return t[i]||(t[i]={observers:[],handlers:[]})}for(let i of e){let r=i.spec,s=r&&r.plugin.domEventHandlers,a=r&&r.plugin.domEventObservers;if(s)for(let l in s){let c=s[l];c&&n(l).handlers.push(FZ(i.value,c))}if(a)for(let l in a){let c=a[l];c&&n(l).observers.push(FZ(i.value,c))}}for(let i in Qu)n(i).handlers.push(Qu[i]);for(let i in Vo)n(i).observers.push(Vo[i]);return t}const S2e=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],mCt="dthko",k2e=[16,17,18,20,91,92,224,225],XT=6;function YT(e){return Math.max(0,e)*.7+8}function gCt(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}class bCt{constructor(t,n,i,r){this.view=t,this.startEvent=n,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=WTe(t.contentDOM),this.atoms=t.state.facet(ME).map(a=>a(t));let s=t.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=t.state.facet(Ti.allowMultipleSelections)&&yCt(t,n),this.dragging=xCt(t,n)&&T2e(n)==1?null:!1}start(t){this.dragging===!1&&this.select(t)}move(t){if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&gCt(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let n=0,i=0,r=0,s=0,a=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let c=tQ(this.view);t.clientX-c.left<=r+XT?n=-YT(r-t.clientX):t.clientX+c.right>=a-XT&&(n=YT(t.clientX-a)),t.clientY-c.top<=s+XT?i=-YT(s-t.clientY):t.clientY+c.bottom>=l-XT&&(i=YT(t.clientY-l)),this.setScrollSpeed(n,i)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,n){this.scrollSpeed={x:t,y:n},t||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:n}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(t||n)&&this.view.win.scrollBy(t,n),this.dragging===!1&&this.select(this.lastEvent)}select(t){let{view:n}=this,i=v2e(this.atoms,this.style.get(t,this.extend,this.multiple));(this.mustSelect||!i.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){t.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function yCt(e,t){let n=e.state.facet(i2e);return n.length?n[0](t):Wt.mac?t.metaKey:t.ctrlKey}function vCt(e,t){let n=e.state.facet(r2e);return n.length?n[0](t):Wt.mac?!t.altKey:!t.ctrlKey}function xCt(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let i=nk(e.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s=t.clientX&&a.top<=t.clientY&&a.bottom>=t.clientY)return!0}return!1}function wCt(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,i;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(i=Cs.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(t))return!1;return!0}const Qu=Object.create(null),Vo=Object.create(null),E2e=Wt.ie&&Wt.ie_version<15||Wt.ios&&Wt.webkit_version<604;function OCt(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),C2e(e,n.value)},50)}function kI(e,t,n){for(let i of e.facet(t))n=i(n,e);return n}function C2e(e,t){t=kI(e.state,YU,t);let{state:n}=e,i,r=1,s=n.toText(t),a=s.lines==n.selection.ranges.length;if(L$!=null&&n.selection.ranges.every(c=>c.empty)&&L$==s.toString()){let c=-1;i=n.changeByRange(u=>{let d=n.doc.lineAt(u.from);if(d.from==c)return{range:u};c=d.from;let f=n.toText((a?s.line(r++).text:t)+n.lineBreak);return{changes:{from:d.from,insert:f},range:st.cursor(u.from+f.length)}})}else a?i=n.changeByRange(c=>{let u=s.line(r++);return{changes:{from:c.from,to:c.to,insert:u.text},range:st.cursor(c.from+u.length)}}):i=n.replaceSelection(s);e.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Vo.scroll=e=>{let t=e.inputState;t.lastScrollTop=e.scrollDOM.scrollTop,t.lastScrollLeft=e.scrollDOM.scrollLeft,Wt.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())};Vo.wheel=Vo.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()};Qu.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1);Vo.touchstart=(e,t)=>{let n=e.inputState,i=t.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),i&&(n.lastTouchX=i.clientX,n.lastTouchY=i.clientY),n.setSelectionOrigin("select.pointer")};Vo.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")};Vo.touchend=(e,t)=>{e.inputState.touchActive=!1};Qu.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of e.state.facet(s2e))if(n=i(e,t),n)break;if(!n&&t.button==0&&(n=kCt(e,t)),n){let i=!e.hasFocus;e.inputState.startMouseSelection(new bCt(e,t,n,i)),i&&e.observer.ignore(()=>{GTe(e.contentDOM);let s=e.root.activeElement;s&&!s.contains(e.contentDOM)&&s.blur()});let r=e.inputState.mouseSelection;if(r)return r.start(t),r.dragging===!1}else e.inputState.setSelectionOrigin("select.pointer");return!1};function BZ(e,t,n,i){if(i==1)return st.cursor(t,n);if(i==2)return JEt(e.state,t,n);{let r=e.docView.lineAt(t,n),s=e.state.doc.lineAt(r?r.posAtEnd:t),a=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return lDate.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(QZ+1)%3:1}function kCt(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),i=T2e(t),r=e.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),r=r.map(s.changes))},get(s,a,l){let c=e.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),u,d=BZ(e,c.pos,c.assoc,i);if(n.pos!=c.pos&&!a){let f=BZ(e,n.pos,n.assoc,i),h=Math.min(f.from,d.from),p=Math.max(f.to,d.to);d=h1&&(u=ECt(r,c.pos))?u:l?r.addRange(d):st.create([d])}}}function ECt(e,t){for(let n=0;n=t)return st.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}Qu.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let s=r.posAtStart,a=s+r.length;(s>=n.to||a<=n.from)&&(n=st.undirectionalRange(s,a))}}let{inputState:i}=e;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",kI(e.state,ZU,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1};Qu.dragend=e=>(e.inputState.draggedContent=null,!1);function VZ(e,t,n,i){if(n=kI(e.state,YU,n),!n)return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:s}=e.inputState,a=i&&s&&vCt(e,t)?{from:s.from,to:s.to}:null,l={from:r,insert:n},c=e.state.changes(a?[a,l]:l);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(r,-1),head:c.mapPos(r,1)},userEvent:a?"move.drop":"input.drop"}),e.inputState.draggedContent=null}Qu.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,s=()=>{++r==n.length&&VZ(e,t,i.filter(a=>a!=null).join(e.state.lineBreak),!1)};for(let a=0;a{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[a]=l.result),s()},l.readAsText(n[a])}return!0}else{let i=t.dataTransfer.getData("Text");if(i)return VZ(e,t,i,!0),!0}return!1};Qu.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=E2e?null:t.clipboardData;return n?(C2e(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(OCt(e),!1)};function CCt(e,t){let n=e.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=t,i.focus(),i.selectionEnd=t.length,i.selectionStart=0,setTimeout(()=>{i.remove(),e.focus()},50)}function TCt(e){let t=[],n=[],i=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let r=-1;for(let{from:s}of e.selection.ranges){let a=e.doc.lineAt(s);a.number>r&&(t.push(a.text),n.push({from:a.from,to:Math.min(e.doc.length,a.to+1)})),r=a.number}i=!0}return{text:kI(e,ZU,t.join(e.lineBreak)),ranges:n,linewise:i}}let L$=null;Qu.copy=Qu.cut=(e,t)=>{if(!FO(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=TCt(e.state);if(!n&&!r)return!1;L$=r?n:null,t.type=="cut"&&!e.state.readOnly&&e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=E2e?null:t.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(CCt(e,n),!1)};const A2e=Jd.define();function _2e(e,t){let n=[];for(let i of e.facet(l2e)){let r=i(e,t);r&&n.push(r)}return n.length?e.update({effects:n,annotations:A2e.of(!0)}):null}function N2e(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=_2e(e.state,t);n?e.dispatch(n):e.update([])}},10)}Vo.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),N2e(e)};Vo.blur=e=>{e.observer.clearSelectionRange(),N2e(e)};Vo.compositionstart=Vo.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange==null&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))};Vo.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,Wt.chrome&&Wt.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))};Vo.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()};Qu.beforeinput=(e,t)=>{var n,i;if((t.inputType=="insertText"||t.inputType=="insertCompositionText")&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType=="insertReplacementText"&&e.observer.editContext){let s=(n=t.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),a=t.getTargetRanges();if(s&&a.length){let l=a[0],c=e.posAtDOM(l.startContainer,l.startOffset),u=e.posAtDOM(l.endContainer,l.endOffset);return nQ(e,{from:c,to:u,insert:e.state.toText(s)},null),!0}}let r;if(Wt.chrome&&Wt.android&&(r=S2e.find(s=>s.inputType==t.inputType))&&(e.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>s+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return Wt.ios&&t.inputType=="deleteContentForward"&&e.observer.flushSoon(),Wt.safari&&t.inputType=="insertText"&&e.inputState.composing>=0&&setTimeout(()=>Vo.compositionend(e,t),20),!1};const HZ=new Set;function ACt(e){HZ.has(e)||(HZ.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}const qZ=["pre-wrap","normal","pre-line","break-spaces"];let ax=!1;function WZ(){ax=!1}class _Ct{constructor(t){this.lineWrapping=t,this.doc=Gi.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,n){let i=this.doc.lineAt(n).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((n-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return qZ.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let n=!1;for(let i=0;i-1,c=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=i,this.textHeight=r,this.lineLength=s,c){this.heightSamples={};for(let u=0;u0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>NA&&(ax=!0),this.height=t)}replace(t,n,i){return zo.of(i)}decomposeLeft(t,n){n.push(this)}decomposeRight(t,n){n.push(this)}applyChanges(t,n,i,r){let s=this,a=i.doc;for(let l=r.length-1;l>=0;l--){let{fromA:c,toA:u,fromB:d,toB:f}=r[l],h=s.lineAt(c,Ir.ByPosNoHeight,i.setDoc(n),0,0),p=h.to>=u?h:s.lineAt(u,Ir.ByPosNoHeight,i,0,0);for(f+=p.to-u,u=p.to;l>0&&h.from<=r[l-1].toA;)c=r[l-1].fromA,d=r[l-1].fromB,l--,cs*2){let l=t[n-1];l.break?t.splice(--n,1,l.left,null,l.right):t.splice(--n,1,l.left,l.right),i+=1+l.break,r-=l.size}else if(s>r*2){let l=t[i];l.break?t.splice(i,1,l.left,null,l.right):t.splice(i,1,l.left,l.right),i+=2+l.break,s-=l.size}else break;else if(r=s&&a(this.lineAt(0,Ir.ByPos,i,r,s))}setMeasuredHeight(t){let n=t.heights[t.index++];n<0?(this.spaceAbove=-n,n=t.heights[t.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(t,n=0,i=!1,r){return r&&r.from<=n&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Hl extends j2e{constructor(t,n,i){super(t,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(t,n){return new Tu(n,this.length,t+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,i){let r=i[0];return i.length==1&&(r instanceof Hl||r instanceof Ka&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof Ka?r=new Hl(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):zo.of(i)}updateHeight(t,n=0,i=!1,r){return r&&r.from<=n&&r.more?this.setMeasuredHeight(r):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Ka extends zo{constructor(t){super(t,0)}heightMetrics(t,n){let i=t.doc.lineAt(n).number,r=t.doc.lineAt(n+this.length).number,s=r-i+1,a,l=0;if(t.lineWrapping){let c=Math.min(this.height,t.lineHeight*s);a=c/s,this.length>s+1&&(l=(this.height-c)/(this.length-s-1))}else a=this.height/s;return{firstLine:i,lastLine:r,perLine:a,perChar:l}}blockAt(t,n,i,r){let{firstLine:s,lastLine:a,perLine:l,perChar:c}=this.heightMetrics(n,r);if(n.lineWrapping){let u=r+(t0){let s=i[i.length-1];s instanceof Ka?i[i.length-1]=new Ka(s.length+r):i.push(null,new Ka(r-1))}if(t>0){let s=i[0];s instanceof Ka?i[0]=new Ka(t+s.length):i.unshift(new Ka(t-1),null)}return zo.of(i)}decomposeLeft(t,n){n.push(new Ka(t-1),null)}decomposeRight(t,n){n.push(null,new Ka(this.length-t-1))}updateHeight(t,n=0,i=!1,r){let s=n+this.length;if(r&&r.from<=n+this.length&&r.more){let a=[],l=Math.max(n,r.from),c=-1;for(r.from>n&&a.push(new Ka(r.from-n-1).updateHeight(t,n));l<=s&&r.more;){let d=t.doc.lineAt(l).length;a.length&&a.push(null);let f=r.heights[r.index++],h=0;f<0&&(h=-f,f=r.heights[r.index++]),c==-1?c=f:Math.abs(f-c)>=NA&&(c=-2);let p=new Hl(d,f,h);p.outdated=!1,a.push(p),l+=d+1}l<=s&&a.push(null,new Ka(s-l).updateHeight(t,l));let u=zo.of(a);return(c<0||Math.abs(u.height-this.height)>=NA||Math.abs(c-this.heightMetrics(t,n).perLine)>=NA)&&(ax=!0),LN(this,u)}else(i||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class RCt extends zo{constructor(t,n,i){super(t.length+n+i.length,t.height+i.height,n|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return this.flags&1}blockAt(t,n,i,r){let s=i+this.left.height;return tl))return u;let d=n==Ir.ByPosNoHeight?Ir.ByPosNoHeight:Ir.ByPos;return c?u.join(this.right.lineAt(l,d,i,a,l)):this.left.lineAt(l,d,i,r,s).join(u)}forEachLine(t,n,i,r,s,a){let l=r+this.left.height,c=s+this.left.length+this.break;if(this.break)t=c&&this.right.forEachLine(t,n,i,l,c,a);else{let u=this.lineAt(c,Ir.ByPos,i,r,s);t=t&&u.from<=n&&a(u),n>u.to&&this.right.forEachLine(u.to+1,n,i,l,c,a)}}replace(t,n,i){let r=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(t-r,n-r,i));let s=[];t>0&&this.decomposeLeft(t,s);let a=s.length;for(let l of i)s.push(l);if(t>0&&GZ(s,a-1),n=i&&n.push(null)),t>i&&this.right.decomposeLeft(t-i,n)}decomposeRight(t,n){let i=this.left.length,r=i+this.break;if(t>=r)return this.right.decomposeRight(t-r,n);t2*n.size||n.size>2*t.size?zo.of(this.break?[t,null,n]:[t,n]):(this.left=LN(this.left,t),this.right=LN(this.right,n),this.setHeight(t.height+n.height),this.outdated=t.outdated||n.outdated,this.size=t.size+n.size,this.length=t.length+this.break+n.length,this)}updateHeight(t,n=0,i=!1,r){let{left:s,right:a}=this,l=n+s.length+this.break,c=null;return r&&r.from<=n+s.length&&r.more?c=s=s.updateHeight(t,n,i,r):s.updateHeight(t,n,i),r&&r.from<=l+a.length&&r.more?c=a=a.updateHeight(t,l,i,r):a.updateHeight(t,l,i),c?this.balanced(s,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function GZ(e,t){let n,i;e[t]==null&&(n=e[t-1])instanceof Ka&&(i=e[t+1])instanceof Ka&&e.splice(t-1,3,new Ka(n.length+1+i.length))}const ICt=5;class iQ{constructor(t,n){this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,n){if(this.lineStart>-1){let i=Math.min(n,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof Hl?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Hl(i-this.pos,-1,0)),this.writtenTo=i,n>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(t,n,i){if(t=ICt)&&this.addLineDeco(r,s,a)}else n>t&&this.span(t,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=n,this.writtenTot&&this.nodes.push(new Hl(this.pos-t,-1,0)),this.writtenTo=this.pos}blankContent(t,n){let i=new Ka(n-t);return this.oracle.doc.lineAt(t).to==n&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof Hl)return t;let n=new Hl(0,-1,0);return this.nodes.push(n),n}addBlock(t){this.enterLine();let n=t.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,n&&n.endSide>0&&(this.covering=t)}addLineDeco(t,n,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,t),r.breaks+=n,this.writtenTo=this.pos=this.pos+i}finish(t){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Hl)&&!this.isCovered?this.nodes.push(new Hl(0,-1,0)):(this.writtenTod.clientHeight||d.scrollWidth>d.clientWidth)&&f.overflow!="visible"){let h=d.getBoundingClientRect();s=Math.max(s,h.left),a=Math.min(a,h.right),l=Math.max(l,h.top),c=Math.min(u==e.parentNode?r.innerHeight:c,h.bottom)}u=f.position=="absolute"||f.position=="fixed"?d.offsetParent:d.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:s-n.left,right:Math.max(s,a)-n.left,top:l-(n.top+t),bottom:Math.max(l,c)-(n.top+t)}}function LCt(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left0&&t.top0}function $Ct(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class d5{constructor(t,n,i,r){this.from=t,this.to=n,this.size=i,this.displaySize=r}static same(t,n){if(t.length!=n.length)return!1;for(let i=0;itypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new _Ct(i),this.stateDeco=YZ(n),this.heightMap=zo.empty().applyChanges(this.stateDeco,Gi.empty,this.heightOracle.setDoc(n.doc),[new Gc(0,0,0,n.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=gn.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=t.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:n}=this.state.selection;for(let i=0;i<=1;i++){let r=i?n.head:n.anchor;if(!t.some(({from:s,to:a})=>r>=s&&r<=a)){let{from:s,to:a}=this.lineBlockAt(r);t.push(new ZT(s,a))}}return this.viewports=t.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?XZ:new rQ(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(Vw(t,this.scaler))})}update(t,n=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=YZ(this.state);let r=t.changedRanges,s=Gc.extendWithRanges(r,PCt(i,this.stateDeco,t?t.changes:ma.empty(this.state.doc.length))),a=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);WZ(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=a||ax)&&(t.flags|=2),l?(this.scrollAnchorPos=t.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let c=s.length?this.mapViewport(this.viewport,t.changes):this.viewport;(n&&(n.range.headc.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,n));let u=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,t.flags|=this.updateForViewport(),(u||!t.changes.empty||t.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(t.selectionSet||t.focusChanged)&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(u2e)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:t}=this,n=t.contentDOM,i=window.getComputedStyle(n),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?Cr.RTL:Cr.LTR;let a=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=n.getBoundingClientRect(),c=a||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let u=0,d=0;if(l.width&&l.height){let{scaleX:k,scaleY:S}=qTe(n,l);(k>.005&&Math.abs(this.scaleX-k)>.005||S>.005&&Math.abs(this.scaleY-S)>.005)&&(this.scaleX=k,this.scaleY=S,u|=16,a=c=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,h=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=h)&&(this.paddingTop=f,this.paddingBottom=h,u|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(r.lineWrapping&&(c=!0),this.editorWidth=t.scrollDOM.clientWidth,u|=16);let p=WTe(this.view.contentDOM,!1).y;p!=this.scrollParent&&(this.scrollParent=p,this.scrollAnchorHeight=-1,this.scrollOffset=0);let g=this.getScrollOffset();this.scrollOffset!=g&&(this.scrollAnchorHeight=-1,this.scrollOffset=g),this.scrolledToBottom=KTe(this.scrollParent||t.win);let b=(this.printing?$Ct:MCt)(n,this.paddingTop),v=b.top-this.pixelViewport.top,y=b.bottom-this.pixelViewport.bottom;this.pixelViewport=b;let x=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(x!=this.inView&&(this.inView=x,x&&(c=!0)),!this.inView&&!this.scrollTarget&&!LCt(t.dom))return 0;let O=l.width;if((this.contentDOMWidth!=O||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=t.scrollDOM.clientHeight,u|=16),c){let k=t.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(k)&&(a=!0),a||r.lineWrapping&&Math.abs(O-this.contentDOMWidth)>r.charWidth){let{lineHeight:S,charWidth:E,textHeight:C}=t.docView.measureTextSize();a=S>0&&r.refresh(s,S,E,C,Math.max(5,O/E),k),a&&(t.docView.minWidth=0,u|=16)}v>0&&y>0?d=Math.max(v,y):v<0&&y<0&&(d=Math.min(v,y)),WZ();for(let S of this.viewports){let E=S.from==this.viewport.from?k:t.docView.measureVisibleLineHeights(S);this.heightMap=(a?zo.empty().applyChanges(this.stateDeco,Gi.empty,this.heightOracle,[new Gc(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new NCt(S.from,E))}ax&&(u|=2)}let w=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return w&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),u|=this.updateForViewport()),(u&2||w)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,t)),u|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),u}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,n){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:a,visibleBottom:l}=this,c=new ZT(r.lineAt(a-i*1e3,Ir.ByHeight,s,0,0).from,r.lineAt(l+(1-i)*1e3,Ir.ByHeight,s,0,0).to);if(n){let{head:u}=n.range;if(uc.to){let d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=r.lineAt(u,Ir.ByPos,s,0,0),h;n.y=="center"?h=(f.top+f.bottom)/2-d/2:n.y=="start"||n.y=="nearest"&&u=l+Math.max(10,Math.min(i,250)))&&r>a-2*1e3&&s>1,a=r<<1;if(this.defaultTextDirection!=Cr.LTR&&!i)return[];let l=[],c=(d,f,h,p)=>{if(f-dd&&yy.from>=h.from&&y.to<=h.to&&Math.abs(y.from-d)y.fromx));if(!v){if(fO.from<=f&&O.to>=f)){let O=n.moveToLineBoundary(st.cursor(f),!1,!0).head;O>d&&(f=O)}let y=this.gapSize(h,d,f,p),x=i||y<2e6?y:2e6;v=new d5(d,f,y,x)}l.push(v)},u=d=>{if(d.length2e6)for(let S of t)S.from>=d.from&&S.fromd.from&&c(d.from,p,d,f),gn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(t){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let i=[];xi.spans(n,this.viewport.from,this.viewport.to,{span(s,a){i.push({from:s,to:a})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let s=0;s=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(n=>n.from<=t&&n.to>=t)||Vw(this.heightMap.lineAt(t,Ir.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=t&&n.bottom>=t)||Vw(this.heightMap.lineAt(this.scaler.fromDOM(t),Ir.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(t){let n=this.lineBlockAtHeight(t+8);return n.from>=this.viewport.from||this.viewportLines[0].top-t>200?n:this.viewportLines[0]}elementAtHeight(t){return Vw(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class ZT{constructor(t,n){this.from=t,this.to=n}}function BCt(e,t,n){let i=[],r=e,s=0;return xi.spans(n,e,t,{span(){},point(a,l){a>r&&(i.push({from:r,to:a}),s+=a-r),r=l}},20),r=1)return t[t.length-1].to;let i=Math.floor(e*n);for(let r=0;;r++){let{from:s,to:a}=t[r],l=a-s;if(i<=l)return s+i;i-=l}}function e2(e,t){let n=0;for(let{from:i,to:r}of e.ranges){if(t<=r){n+=t-i;break}n+=r-i}return n/e.total}function UCt(e,t){for(let n of e)if(t(n))return n}const XZ={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function YZ(e){let t=e.facet(wI).filter(i=>typeof i!="function"),n=e.facet(eQ).filter(i=>typeof i!="function");return n.length&&t.push(xi.join(n)),t}class rQ{constructor(t,n,i){let r=0,s=0,a=0;this.viewports=i.map(({from:l,to:c})=>{let u=n.lineAt(l,Ir.ByPos,t,0,0).top,d=n.lineAt(c,Ir.ByPos,t,0,0).bottom;return r+=d-u,{from:l,to:c,top:u,bottom:d,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(n.height-r);for(let l of this.viewports)l.domTop=a+(l.top-s)*this.scale,a=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(t){for(let n=0,i=0,r=0;;n++){let s=nn.from==t.viewports[i].from&&n.to==t.viewports[i].to):!1}}function Vw(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),i=t.toDOM(e.bottom);return new Tu(e.from,e.length,n,i-n,Array.isArray(e._content)?e._content.map(r=>Vw(r,t)):e._content)}const t2=Kt.define({combine:e=>e.join(" ")}),$$=Kt.define({combine:e=>e.indexOf(!0)>-1}),F$=Cm.newName(),R2e=Cm.newName(),I2e=Cm.newName(),P2e={"&light":"."+R2e,"&dark":"."+I2e};function B$(e,t,n){return new Cm(t,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return e;if(!n||!n[r])throw new RangeError(`Unsupported selector: ${r}`);return n[r]}):e+" "+i}})}const QCt=B$("."+F$,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},P2e),zCt={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},f5=Wt.ie&&Wt.ie_version<=11;class VCt{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new vEt,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(n=>{for(let i of n)this.queue.push(i);(Wt.ie&&Wt.ie_version<=11||Wt.ios&&t.composing)&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Wt.android&&t.constructor.EDIT_CONTEXT!==!1&&!(Wt.chrome&&Wt.chrome_version<126)&&(this.editContext=new qCt(t),t.state.facet(zf)&&(t.contentDOM.editContext=this.editContext.editContext)),f5&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){(t.type=="change"||!t.type)&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((n,i)=>n!=t[i]))){this.gapIntersection.disconnect();for(let n of t)this.gapIntersection.observe(n);this.gaps=t}}onSelectionChange(t){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,r=this.selectionRange;if(i.state.facet(zf)?i.root.activeElement!=this.dom:!FO(this.dom,r))return;let s=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(t)){n||(this.selectionChanged=!1);return}(Wt.ie&&Wt.ie_version<=11||Wt.android&&Wt.chrome)&&!i.state.selection.main.empty&&r.focusNode&&UO(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,n=nk(t.root);if(!n)return!1;let i=Wt.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&HCt(this.view,n)||n;if(!i||this.selectionRange.eq(i))return!1;let r=FO(this.dom,i);return r&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&dv(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:n,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let n=-1,i=-1,r=!1;for(let s of t){let a=this.readMutation(s);a&&(a.typeOver&&(r=!0),n==-1?{from:n,to:i}=a:(n=Math.min(a.from,n),i=Math.max(a.to,i)))}return{from:n,to:i,typeOver:r}}readChange(){let{from:t,to:n,typeOver:i}=this.processRecords(),r=this.selectionChanged&&FO(this.dom,this.selectionRange);if(t<0&&!r)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new lCt(this.view,t,n,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let i=this.view.state,r=w2e(this.view,n);return this.view.state==i&&(n.domChanged||n.newSel&&!MN(this.view.state.selection,n.newSel.main))&&this.view.update([]),r}readMutation(t){let n=this.view.docView.tile.nearest(t.target);if(!n||n.isWidget())return null;if(n.markDirty(t.type=="attributes"),t.type=="childList"){let i=ZZ(n,t.previousSibling||t.target.previousSibling,-1),r=ZZ(n,t.nextSibling||t.target.nextSibling,1);return{from:i?n.posAfter(i):n.posAtStart,to:r?n.posBefore(r):n.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(zf)!=t.state.facet(zf)&&(t.view.contentDOM.editContext=t.state.facet(zf)?this.editContext.editContext:null))}destroy(){var t,n,i;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function ZZ(e,t,n){for(;t;){let i=Cs.get(t);if(i&&i.parent==e)return i;let r=t.parentNode;t=r!=e.dom?r:n>0?t.nextSibling:t.previousSibling}return null}function JZ(e,t){let n=t.startContainer,i=t.startOffset,r=t.endContainer,s=t.endOffset,a=e.docView.domAtPos(e.state.selection.main.anchor,1);return UO(a.node,a.offset,r,s)&&([n,i,r,s]=[r,s,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}}function HCt(e,t){if(t.getComposedRanges){let r=t.getComposedRanges(e.root)[0];if(r)return JZ(e,r)}let n=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",i,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",i,!0),n?JZ(e,n):null}class qCt{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let n=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=i=>{let r=t.state.selection.main,{anchor:s,head:a}=r,l=this.toEditorPos(i.updateRangeStart),c=this.toEditorPos(i.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:l,drifted:!1});let u=c-l>i.text.length;l==this.from&&sthis.to&&(c=s);let d=O2e(t.state.sliceDoc(l,c),i.text,(u?r.from:r.to)-l,u?"end":null);if(!d){let h=st.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));MN(h,r)||t.dispatch({selection:h,userEvent:"select"});return}let f={from:d.from+l,to:d.toA+l,insert:Gi.of(i.text.slice(d.from,d.toB).split(` -`))};if((Wt.mac||Wt.android)&&f.from==a-1&&/^\. ?$/.test(i.text)&&t.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:c,insert:Gi.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!t.state.readOnly){let h=this.to-this.from+(f.to-f.from+f.insert.length);nQ(t,f,st.single(this.toEditorPos(i.selectionStart,h),this.toEditorPos(i.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)),f.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(n.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let a=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);a{let r=[];for(let s of i.getTextFormats()){let a=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(a)&&!/none/i.test(l)){let c=this.toEditorPos(s.rangeStart),u=this.toEditorPos(s.rangeEnd);if(c{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(t.state)}};for(let i in this.handlers)n.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{let r=nk(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let n=0,i=!1,r=this.pendingContextChange;return t.changes.iterChanges((s,a,l,c,u)=>{if(i)return;let d=u.length-(a-s);if(r&&a>=r.to)if(r.from==s&&r.to==a&&r.insert.eq(u)){r=this.pendingContextChange=null,n+=d,this.to+=d;return}else r=null,this.revertPending(t.state);if(s+=n,a+=n,a<=this.from)this.from+=d,this.to+=d;else if(sthis.to||this.to-this.from+u.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(a),u.toString()),this.to+=d}n+=d}),r&&!i&&this.revertPending(t.state),!i}update(t){let n=this.pendingContextChange,i=t.startState.selection.main;this.composing&&(this.composing.drifted||!t.changes.touchesRange(i.from,i.to)&&t.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.reset(t.state)):(t.docChanged||t.selectionSet||n)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:n}=t.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(t.doc.length,n+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),t.doc.sliceString(n.from,n.to))}setSelection(t){let{main:n}=t.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),r=this.toContextPos(n.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(t){let{head:n}=t.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(t,n=this.to-this.from){t=Math.min(t,n);let i=this.composing;return i&&i.drifted?i.editorBase+(t-i.contextBase):t+this.from}toContextPos(t){let n=this.composing;return n&&n.drifted?n.contextBase+(t-n.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class $t{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:i}=t;this.dispatchTransactions=t.dispatchTransactions||i&&(r=>r.forEach(s=>i(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=t.root||xEt(t.parent)||document,this.viewState=new KZ(this,t.state||Ti.create(t)),t.scrollTo&&t.scrollTo.is(KT)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(My).map(r=>new a5(r));for(let r of this.plugins)r.update(this);this.observer=new VCt(this),this.inputState=new fCt(this),this.inputState.ensureHandlers(this.plugins),this.docView=new MZ(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...t){let n=t.length==1&&t[0]instanceof Js?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(n,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,i=!1,r,s=this.state;for(let h of t){if(h.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=h.state}if(this.destroyed){this.viewState.state=s;return}let a=this.hasFocus,l=0,c=null;t.some(h=>h.annotation(A2e))?(this.inputState.notifiedFocused=a,l=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,c=_2e(s,a),c||(l=1));let u=this.observer.delayedAndroidKey,d=null;if(u?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(d=null)):this.observer.clear(),s.facet(Ti.phrases)!=this.state.facet(Ti.phrases))return this.setState(s);r=IN.create(this,s,t),r.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let h of t){if(f&&(f=f.map(h.changes)),h.scrollIntoView){let{main:p}=h.state.selection,{x:g,y:b}=this.state.facet($t.cursorScrollMargin);f=new fv(p.empty?p:st.cursor(p.head,p.head>p.anchor?-1:1),"nearest","nearest",b,g)}for(let p of h.effects)p.is(KT)&&(f=p.value.clip(this.state))}this.viewState.update(r,f),this.bidiCache=$N.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(zw)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(h=>h.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(t2)!=r.state.facet(t2)&&(this.viewState.mustMeasureContent=!0),(n||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!r.empty)for(let h of this.state.facet(I$))try{h(r)}catch(p){hl(this.state,p,"update listener")}(c||d)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),d&&!w2e(this,d)&&u.force&&dv(this.contentDOM,u.key,u.keyCode)})}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let n=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new KZ(this,t),this.plugins=t.facet(My).map(i=>new a5(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new MZ(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(t){let n=t.startState.facet(My),i=t.state.facet(My);if(n!=i){let r=[];for(let s of i){let a=n.indexOf(s);if(a<0)r.push(new a5(s));else{let l=this.plugins[a];l.mustUpdate=t,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=t&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=t;for(let r=0;r-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let n=null,i=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:a}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(a<0)if(KTe(i||this.win))s=-1,a=this.viewState.heightMap.height;else{let p=this.viewState.scrollAnchorAt(r);s=p.from,a=p.top}this.updateState=1;let c=this.viewState.measure();if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];c&4||([this.measureRequests,u]=[u,this.measureRequests]);let d=u.map(p=>{try{return p.read(this)}catch(g){return hl(this.state,g),eJ}}),f=IN.create(this,this.state,[]),h=!1;f.flags|=c,n?n.flags|=c:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),h=this.docView.update(f),h&&this.docViewUpdate());for(let p=0;p1||g<-1)&&!(Wt.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+g,i?i.scrollTop+=g:this.win.scrollBy(0,g),a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(I$))l(n)}get themeClasses(){return F$+" "+(this.state.facet($$)?I2e:R2e)+" "+this.state.facet(t2)}updateAttrs(){let t=tJ(this,h2e,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(zf)?"true":"false",class:"cm-content",style:`${Wt.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),tJ(this,JU,n);let i=this.observer.ignore(()=>{let r=NZ(this.contentDOM,this.contentAttrs,n),s=NZ(this.dom,this.editorAttrs,t);return r||s});return this.editorAttrs=t,this.contentAttrs=n,i}showAnnouncements(t){let n=!0;for(let i of t)for(let r of i.effects)if(r.is($t.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(zw);let t=this.state.facet($t.cspNonce);Cm.mount(this.root,this.styleModules.concat(QCt).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let n=0;ni.plugin==t)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,n,i){return u5(this,t,LZ(this,t,n,i))}moveByGroup(t,n){return u5(this,t,LZ(this,t,n,i=>nCt(this,t.head,i)))}visualLineSide(t,n){let i=this.bidiSpans(t),r=this.textDirectionAt(t.from),s=i[n?i.length-1:0];return st.cursor(s.side(n,r)+t.from,s.forward(!n,r)?1:-1)}moveToLineBoundary(t,n,i=!0){return tCt(this,t,n,i)}moveVertically(t,n,i){return u5(this,t,iCt(this,t,n,i))}domAtPos(t,n=1){return this.docView.domAtPos(t,n)}posAtDOM(t,n=0){return this.docView.posFromDOM(t,n)}posAtCoords(t,n=!0){this.readMeasured();let i=M$(this,t,n);return i&&i.pos}posAndSideAtCoords(t,n=!0){return this.readMeasured(),M$(this,t,n)}coordsAtPos(t,n=1){this.readMeasured();let i=this.state.doc.lineAt(t),r=this.bidiSpans(i),s=r[Ad.find(r,t-i.from,-1,n)];return this.docView.coordsAt(t,n,s.dir==Cr.RTL)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(c2e)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>WCt)return t2e(t.length);let n=this.textDirectionAt(t.from),i;for(let s of this.bidiCache)if(s.from==t.from&&s.dir==n&&(s.fresh||e2e(s.isolates,i=IZ(this,t))))return s.order;i||(i=IZ(this,t));let r=AEt(t.text,n,i);return this.bidiCache.push(new $N(t.from,t.to,n,i,!0,r)),r}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||Wt.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{GTe(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,n={}){var i,r,s,a;return KT.of(new fv(typeof t=="number"?st.cursor(t):t,(i=n.y)!==null&&i!==void 0?i:"nearest",(r=n.x)!==null&&r!==void 0?r:"nearest",(s=n.yMargin)!==null&&s!==void 0?s:5,(a=n.xMargin)!==null&&a!==void 0?a:5))}scrollSnapshot(){let{scrollTop:t,scrollLeft:n}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return KT.of(new fv(st.cursor(i.from),"start","start",i.top-t,n,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return Ts.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return Ts.define(()=>({}),{eventObservers:t})}static theme(t,n){let i=Cm.newName(),r=[t2.of(i),zw.of(B$(`.${i}`,t))];return n&&n.dark&&r.push($$.of(!0)),r}static baseTheme(t){return zh.lowest(zw.of(B$("."+F$,t,P2e)))}static findFromDOM(t){var n;let i=t.querySelector(".cm-content"),r=i&&Cs.get(i)||Cs.get(t);return((n=r==null?void 0:r.root)===null||n===void 0?void 0:n.view)||null}}$t.styleModule=zw;$t.inputHandler=o2e;$t.clipboardInputFilter=YU;$t.clipboardOutputFilter=ZU;$t.scrollHandler=d2e;$t.focusChangeEffect=l2e;$t.perLineTextDirection=c2e;$t.exceptionSink=a2e;$t.updateListener=I$;$t.editable=zf;$t.mouseSelectionStyle=s2e;$t.dragMovesSelection=r2e;$t.clickAddsSelectionRange=i2e;$t.decorations=wI;$t.blockWrappers=p2e;$t.outerDecorations=eQ;$t.atomicRanges=ME;$t.bidiIsolatedRanges=m2e;$t.cursorScrollMargin=Kt.define({combine:e=>{let t=5,n=5;for(let i of e)typeof i=="number"?t=n=i:{x:t,y:n}=i;return{x:t,y:n}}});$t.scrollMargins=g2e;$t.darkTheme=$$;$t.cspNonce=Kt.define({combine:e=>e.length?e[0]:""});$t.contentAttributes=JU;$t.editorAttributes=h2e;$t.lineWrapping=$t.contentAttributes.of({class:"cm-lineWrapping"});$t.announce=Fn.define();const WCt=4096,eJ={};class $N{constructor(t,n,i,r,s,a){this.from=t,this.to=n,this.dir=i,this.isolates=r,this.fresh=s,this.order=a}static update(t,n){if(n.empty&&!t.some(s=>s.fresh))return t;let i=[],r=t.length?t[t.length-1].dir:Cr.LTR;for(let s=Math.max(0,t.length-10);s=0;r--){let s=i[r],a=typeof s=="function"?s(e):s;a&&GU(a,n)}return n}const GCt=Wt.mac?"mac":Wt.windows?"win":Wt.linux?"linux":"key";function KCt(e,t){const n=e.split(/-(?!$)/);let i=n[n.length-1];i=="Space"&&(i=" ");let r,s,a,l;for(let c=0;ci.concat(r),[]))),n}function YCt(e,t,n){return M2e(D2e(e.state),t,e,n)}let Rp=null;const ZCt=4e3;function JCt(e,t=GCt){let n=Object.create(null),i=Object.create(null),r=(a,l)=>{let c=i[a];if(c==null)i[a]=l;else if(c!=l)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},s=(a,l,c,u,d)=>{var f,h;let p=n[a]||(n[a]=Object.create(null)),g=l.split(/ (?!$)/).map(y=>KCt(y,t));for(let y=1;y{let w=Rp={view:O,prefix:x,scope:a};return setTimeout(()=>{Rp==w&&(Rp=null)},ZCt),!0}]})}let b=g.join(" ");r(b,!1);let v=p[b]||(p[b]={preventDefault:!1,stopPropagation:!1,run:((h=(f=p._any)===null||f===void 0?void 0:f.run)===null||h===void 0?void 0:h.slice())||[]});c&&v.run.push(c),u&&(v.preventDefault=!0),d&&(v.stopPropagation=!0)};for(let a of e){let l=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let u of l){let d=n[u]||(n[u]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=a;for(let h in d)d[h].run.push(p=>f(p,U$))}let c=a[t]||a.key;if(c)for(let u of l)s(u,c,a.run,a.preventDefault,a.stopPropagation),a.shift&&s(u,"Shift-"+c,a.shift,a.preventDefault,a.stopPropagation)}return n}let U$=null;function M2e(e,t,n,i){U$=t;let r=hEt(t),s=ol(r,0),a=vd(s)==r.length&&r!=" ",l="",c=!1,u=!1,d=!1;Rp&&Rp.view==n&&Rp.scope==i&&(l=Rp.prefix+" ",k2e.indexOf(t.keyCode)<0&&(u=!0,Rp=null));let f=new Set,h=v=>{if(v){for(let y of v.run)if(!f.has(y)&&(f.add(y),y(n)))return v.stopPropagation&&(d=!0),!0;v.preventDefault&&(v.stopPropagation&&(d=!0),u=!0)}return!1},p=e[i],g,b;return p&&(h(p[l+n2(r,t,!a)])?c=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(Wt.windows&&t.ctrlKey&&t.altKey)&&!(Wt.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(g=Tm[t.keyCode])&&g!=r?(h(p[l+n2(g,t,!0)])||t.shiftKey&&(b=ek[t.keyCode])!=r&&b!=g&&h(p[l+n2(b,t,!1)]))&&(c=!0):a&&t.shiftKey&&h(p[l+n2(r,t,!0)])&&(c=!0),!c&&h(p._any)&&(c=!0)),u&&(c=!0),c&&d&&t.stopPropagation(),U$=null,c}class ob{constructor(t,n,i,r,s){this.className=t,this.left=n,this.top=i,this.width=r,this.height=s}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,n){return n.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,n,i){if(i.empty){let r=t.coordsAtPos(i.head,i.assoc||1);if(!r)return[];let s=L2e(t);return[new ob(n,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return eTt(t,n,i)}}function L2e(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==Cr.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function iJ(e,t,n,i){let r=e.coordsAtPos(t,n*2);if(!r)return i;let s=e.dom.getBoundingClientRect(),a=(r.top+r.bottom)/2,l=e.posAtCoords({x:s.left+1,y:a}),c=e.posAtCoords({x:s.right-1,y:a});return l==null||c==null?i:{from:Math.max(i.from,Math.min(l,c)),to:Math.min(i.to,Math.max(l,c))}}function eTt(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let i=Math.max(n.from,e.viewport.from),r=Math.min(n.to,e.viewport.to),s=e.textDirection==Cr.LTR,a=e.contentDOM,l=a.getBoundingClientRect(),c=L2e(e),u=a.querySelector(".cm-line"),d=u&&window.getComputedStyle(u),f=l.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),h=l.right-(d?parseInt(d.paddingRight):0),p=D$(e,i,1),g=D$(e,r,-1),b=p.type==io.Text?p:null,v=g.type==io.Text?g:null;if(b&&(e.lineWrapping||p.widgetLineBreaks)&&(b=iJ(e,i,1,b)),v&&(e.lineWrapping||g.widgetLineBreaks)&&(v=iJ(e,r,-1,v)),b&&v&&b.from==v.from&&b.to==v.to)return x(O(n.from,n.to,b));{let k=b?O(n.from,null,b):w(p,!1),S=v?O(null,n.to,v):w(g,!0),E=[];return(b||p).to<(v||g).from-(b&&v?1:0)||p.widgetLineBreaks>1&&k.bottom+e.defaultLineHeight/2A&&T.from=R)break;I>P&&j(Math.max(U,P),k==null&&U<=A,Math.min(I,R),S==null&&I>=F,M.dir)}if(P=L.to+1,P>=R)break}return _.length==0&&j(A,k==null,F,S==null,e.textDirection),{top:C,bottom:N,horizontal:_}}function w(k,S){let E=l.top+(S?k.top:k.bottom);return{top:E,bottom:E,horizontal:[]}}}function tTt(e,t){return e.constructor==t.constructor&&e.eq(t)}class nTt{constructor(t,n){this.view=t,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,t)}update(t){t.startState.facet(jA)!=t.state.facet(jA)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){this.layer.updateOnDocViewUpdate!==!1&&t.requestMeasure(this.measureReq)}setOrder(t){let n=0,i=t.facet(jA);for(;n!tTt(n,this.drawn[i]))){let n=this.dom.firstChild,i=0;for(let r of t)r.update&&n&&r.constructor&&this.drawn[i].constructor&&r.update(n,this.drawn[i])?(n=n.nextSibling,i++):this.dom.insertBefore(r.draw(),n);for(;n;){let r=n.nextSibling;n.remove(),n=r}this.drawn=t,Wt.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const jA=Kt.define();function $2e(e){return[Ts.define(t=>new nTt(t,e)),jA.of(e)]}const ox=Kt.define({combine(e){return ef(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(t,n)=>Math.min(t,n),drawRangeCursor:(t,n)=>t||n})}});function iTt(e={}){return[ox.of(e),rTt,sTt,aTt,u2e.of(!0)]}function F2e(e){return e.startState.facet(ox)!=e.state.facet(ox)}const rTt=$2e({above:!0,markers(e){let{state:t}=e,n=t.facet(ox),i=[];for(let r of t.selection.ranges){let s=r==t.selection.main;if(r.empty||n.drawRangeCursor&&!(s&&Wt.ios&&n.iosSelectionHandles)){let a=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=r.empty?r:st.cursor(r.head,r.assoc);for(let c of ob.forRange(e,a,l))i.push(c)}}return i},update(e,t){e.transactions.some(i=>i.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=F2e(e);return n&&rJ(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){rJ(t.state,e)},class:"cm-cursorLayer"});function rJ(e,t){t.style.animationDuration=e.facet(ox).cursorBlinkRate+"ms"}const sTt=$2e({above:!1,markers(e){let t=[],{main:n,ranges:i}=e.state.selection;for(let r of i)if(!r.empty)for(let s of ob.forRange(e,"cm-selectionBackground",r))t.push(s);if(Wt.ios&&!n.empty&&e.state.facet(ox).iosSelectionHandles){for(let r of ob.forRange(e,"cm-selectionHandle cm-selectionHandle-start",st.cursor(n.from,1)))t.push(r);for(let r of ob.forRange(e,"cm-selectionHandle cm-selectionHandle-end",st.cursor(n.to,1)))t.push(r)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||F2e(e)},class:"cm-selectionLayer"}),aTt=zh.highest($t.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),B2e=Fn.define({map(e,t){return e==null?null:t.mapPos(e)}}),Hw=ro.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((n,i)=>i.is(B2e)?i.value:n,e)}}),oTt=Ts.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(Hw);n==null?this.cursor!=null&&((t=this.cursor)===null||t===void 0||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(Hw)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(Hw),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let i=e.scrollDOM.getBoundingClientRect();return{left:n.left-i.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-i.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(Hw)!=e&&this.view.dispatch({effects:B2e.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){(e.target==this.view.contentDOM||!this.view.contentDOM.contains(e.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function lTt(){return[Hw,oTt]}function sJ(e,t,n,i,r){t.lastIndex=0;for(let s=e.iterRange(n,i),a=n,l;!s.next().done;a+=s.value.length)if(!s.lineBreak)for(;l=t.exec(s.value);)r(a+l.index,l)}function cTt(e,t){let n=e.visibleRanges;if(n.length==1&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let i=[];for(let{from:r,to:s}of n)r=Math.max(e.state.doc.lineAt(r).from,r-t),s=Math.min(e.state.doc.lineAt(s).to,s+t),i.length&&i[i.length-1].to>=r?i[i.length-1].to=s:i.push({from:r,to:s});return i}class uTt{constructor(t){const{regexp:n,decoration:i,decorate:r,boundary:s,maxLength:a=1e3}=t;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,r)this.addMatch=(l,c,u,d)=>r(d,u,u+l[0].length,l,c);else if(typeof i=="function")this.addMatch=(l,c,u,d)=>{let f=i(l,c,u);f&&d(u,u+l[0].length,f)};else if(i)this.addMatch=(l,c,u,d)=>d(u,u+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=a}createDeco(t){let n=new Ah,i=n.add.bind(n);for(let{from:r,to:s}of cTt(t,this.maxLength))sJ(t.state.doc,this.regexp,r,s,(a,l)=>this.addMatch(l,t,a,i));return n.finish()}updateDeco(t,n){let i=1e9,r=-1;return t.docChanged&&t.changes.iterChanges((s,a,l,c)=>{c>=t.view.viewport.from&&l<=t.view.viewport.to&&(i=Math.min(l,i),r=Math.max(c,r))}),t.viewportMoved||r-i>1e3?this.createDeco(t.view):r>-1?this.updateRange(t.view,n.map(t.changes),i,r):n}updateRange(t,n,i,r){for(let s of t.visibleRanges){let a=Math.max(s.from,i),l=Math.min(s.to,r);if(l>=a){let c=t.state.doc.lineAt(a),u=c.toc.from;a--)if(this.boundary.test(c.text[a-1-c.from])){d=a;break}for(;lh.push(y.range(b,v));if(c==u)for(this.regexp.lastIndex=d-c.from;(p=this.regexp.exec(c.text))&&p.indexthis.addMatch(v,t,b,g));n=n.update({filterFrom:d,filterTo:f,filter:(b,v)=>bf,add:h})}}return n}}const Q$=/x/.unicode!=null?"gu":"g",dTt=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Q$),fTt={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let h5=null;function hTt(){var e;if(h5==null&&typeof document<"u"&&document.body){let t=document.body.style;h5=((e=t.tabSize)!==null&&e!==void 0?e:t.MozTabSize)!=null}return h5||!1}const RA=Kt.define({combine(e){let t=ef(e,{render:null,specialChars:dTt,addSpecialChars:null});return(t.replaceTabs=!hTt())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,Q$)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,Q$)),t}});function pTt(e={}){return[RA.of(e),mTt()]}let aJ=null;function mTt(){return aJ||(aJ=Ts.fromClass(class{constructor(e){this.view=e,this.decorations=gn.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(RA)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new uTt({regexp:e.specialChars,decoration:(t,n,i)=>{let{doc:r}=n.state,s=ol(t[0],0);if(s==9){let a=r.lineAt(i),l=n.state.tabSize,c=Uu(a.text,l,i-a.from);return gn.replace({widget:new vTt((l-c%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=gn.replace({widget:new yTt(e,s)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(RA);e.startState.facet(RA)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))}const gTt="•";function bTt(e){return e>=32?gTt:e==10?"␤":String.fromCharCode(9216+e)}class yTt extends Yu{constructor(t,n){super(),this.options=t,this.code=n}eq(t){return t.code==this.code}toDOM(t){let n=bTt(this.code),i=t.state.phrase("Control character")+" "+(fTt[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,n);if(r)return r;let s=document.createElement("span");return s.textContent=n,s.title=i,s.setAttribute("aria-label",i),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class vTt extends Yu{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent=" ",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}function xTt(){return OTt}const wTt=gn.line({class:"cm-activeLine"}),OTt=Ts.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let i of e.state.selection.ranges){let r=e.lineBlockAt(i.head);r.from>t&&(n.push(wTt.range(r.from)),t=r.from)}return gn.set(n)}},{decorations:e=>e.decorations});class STt extends Yu{constructor(t){super(),this.content=t}toDOM(t){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(t):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(t){let n=t.firstChild?BO(t.firstChild):[];if(!n.length)return null;let i=window.getComputedStyle(t.parentNode),r=ik(n[0],i.direction!="rtl"),s=parseInt(i.lineHeight);return r.bottom-r.top>s*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+s}:r}ignoreEvent(){return!1}}function kTt(e){let t=Ts.fromClass(class{constructor(n){this.view=n,this.placeholder=e?gn.set([gn.widget({widget:new STt(e),side:1}).range(0)]):gn.none}get decorations(){return this.view.state.doc.length?gn.none:this.placeholder}},{decorations:n=>n.decorations});return typeof e=="string"?[t,$t.contentAttributes.of({"aria-placeholder":e})]:t}const z$=2e3;function ETt(e,t,n){let i=Math.min(t.line,n.line),r=Math.max(t.line,n.line),s=[];if(t.off>z$||n.off>z$||t.col<0||n.col<0){let a=Math.min(t.off,n.off),l=Math.max(t.off,n.off);for(let c=i;c<=r;c++){let u=e.doc.line(c);u.length<=l&&s.push(st.range(u.from+a,u.to+l))}}else{let a=Math.min(t.col,n.col),l=Math.max(t.col,n.col);for(let c=i;c<=r;c++){let u=e.doc.line(c),d=O$(u.text,a,e.tabSize,!0);if(d<0)s.push(st.cursor(u.to));else{let f=O$(u.text,l,e.tabSize);s.push(st.range(u.from+d,u.from+f))}}}return s}function CTt(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function oJ(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),i=e.state.doc.lineAt(n),r=n-i.from,s=r>z$?-1:r==i.length?CTt(e,t.clientX):Uu(i.text,e.state.tabSize,n-i.from);return{line:i.number,col:s,off:r}}function TTt(e,t){let n=oJ(e,t),i=e.state.selection;return n?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(n.line).from),a=r.state.doc.lineAt(s);n={line:a.number,col:n.col,off:Math.min(n.off,a.length)},i=i.map(r.changes)}},get(r,s,a){let l=oJ(e,r);if(!l)return i;let c=ETt(e.state,n,l);return c.length?a?st.create(c.concat(i.ranges)):st.create(c):i}}:null}function ATt(e){let t=n=>n.altKey&&n.button==0;return $t.mouseSelectionStyle.of((n,i)=>t(i)?TTt(n,i):null)}const _Tt={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},NTt={style:"cursor: crosshair"};function jTt(e={}){let[t,n]=_Tt[e.key||"Alt"],i=Ts.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==t||n(r))},keyup(r){(r.keyCode==t||!n(r))&&this.set(!1)},mousemove(r){this.set(n(r))}}});return[i,$t.contentAttributes.of(r=>{var s;return!((s=r.plugin(i))===null||s===void 0)&&s.isDown?NTt:null})]}const i2="-10000px";class U2e{constructor(t,n,i,r){this.facet=n,this.createTooltipView=i,this.removeTooltipView=r,this.input=t.state.facet(n),this.tooltips=this.input.filter(a=>a);let s=null;this.tooltipViews=this.tooltips.map(a=>s=i(a,s))}update(t,n){var i;let r=t.state.facet(this.facet),s=r.filter(c=>c);if(r===this.input){for(let c of this.tooltipViews)c.update&&c.update(t);return!1}let a=[],l=n?[]:null;for(let c=0;cn[u]=c),n.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=a,!0}}function RTt(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const p5=Kt.define({combine:e=>{var t,n,i;return{position:Wt.ios?"absolute":((t=e.find(r=>r.position))===null||t===void 0?void 0:t.position)||"fixed",parent:((n=e.find(r=>r.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((i=e.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||RTt}}}),lJ=new WeakMap,sQ=Ts.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(p5);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new U2e(e,aQ,(n,i)=>this.createTooltip(n,i),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,i=e.state.facet(p5);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),i=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",n.dom.appendChild(r)}return n.dom.style.position=this.position,n.dom.style.top=i2,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(e=i.destroy)===null||e===void 0||e.call(i);this.parent&&this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(Wt.safari){let a=s.getBoundingClientRect();n=Math.abs(a.top+1e4)>1||Math.abs(a.left)>1}else n=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(e=s.width/this.parent.offsetWidth,t=s.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=tQ(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,a)=>{let l=this.manager.tooltipViews[a];return l.getCoords?l.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(p5).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:n,space:i,scaleX:r,scaleY:s}=e,a=[];for(let l=0;l=Math.min(n.bottom,i.bottom)||f.rightMath.min(n.right,i.right)+.1)){d.style.top=i2;continue}let p=c.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,g=p?7:0,b=h.right-h.left,v=(t=lJ.get(u))!==null&&t!==void 0?t:h.bottom-h.top,y=u.offset||PTt,x=this.view.textDirection==Cr.LTR,O=h.width>i.right-i.left?x?i.left:i.right-h.width:x?Math.max(i.left,Math.min(f.left-(p?14:0)+y.x,i.right-b)):Math.min(Math.max(i.left,f.left-b+(p?14:0)-y.x),i.right-b),w=this.above[l];!c.strictSide&&(w?f.top-v-g-y.yi.bottom)&&w==i.bottom-f.bottom>f.top-i.top&&(w=this.above[l]=!w);let k=(w?f.top-i.top:i.bottom-f.bottom)-g;if(kO&&C.topS&&(S=w?C.top-v-2-g:C.bottom+g+2);if(this.position=="absolute"?(d.style.top=(S-e.parent.top)/s+"px",cJ(d,(O-e.parent.left)/r)):(d.style.top=S/s+"px",cJ(d,O/r)),p){let C=f.left+(x?y.x:-y.x)-(O+14-7);p.style.left=C/r+"px"}u.overlap!==!0&&a.push({left:O,top:S,right:E,bottom:S+v}),d.classList.toggle("cm-tooltip-above",w),d.classList.toggle("cm-tooltip-below",!w),u.positioned&&u.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=i2}},{eventObservers:{scroll(){this.maybeMeasure()}}});function cJ(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const ITt=$t.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),PTt={x:0,y:0},aQ=Kt.define({enables:[sQ,ITt]}),FN=Kt.define({combine:e=>e.reduce((t,n)=>t.concat(n),[])});class EI{static create(t){return new EI(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new U2e(t,FN,(n,i)=>this.createHostedView(n,i),n=>n.dom.remove())}createHostedView(t,n){let i=t.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(t){for(let n of this.manager.tooltipViews)n.mount&&n.mount(t);this.mounted=!0}positioned(t){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(t)}update(t){this.manager.update(t)}destroy(){var t;for(let n of this.manager.tooltipViews)(t=n.destroy)===null||t===void 0||t.call(n)}passProp(t){let n;for(let i of this.manager.tooltipViews){let r=i[t];if(r!==void 0){if(n===void 0)n=r;else if(n!==r)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const DTt=aQ.compute([FN],e=>{let t=e.facet(FN);return t.length===0?null:{pos:Math.min(...t.map(n=>n.pos)),end:Math.max(...t.map(n=>{var i;return(i=n.end)!==null&&i!==void 0?i:n.pos})),create:EI.create,above:t[0].above,arrow:t.some(n=>n.arrow)}}),Q2e=Kt.define();class MTt{constructor(t,n,i,r,s,a){this.view=t,this.source=n,this.field=i,this.locked=r,this.setHover=s,this.hoverTime=a,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(t){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let t=Date.now()-this.lastMove.time;ta.bottom||n.xa.right+t.defaultCharacterWidth)return;let l=t.bidiSpans(t.state.doc.lineAt(r)).find(u=>u.from<=r&&u.to>=r),c=l&&l.dir==Cr.RTL?-1:1;s=n.x{if(l&&!(Array.isArray(l)&&!l.length)){let c=Array.isArray(l)?l:[l];r&&this.locked.set(c,r),t.dispatch({effects:this.setHover.of(c)})}};if(s&&"then"in s){let l=this.pending={pos:n};s.then(c=>{this.pending==l&&(this.pending=null,a(c))},c=>hl(t.state,c,"hover tooltip"))}else a(s)}get tooltip(){let t=this.view.plugin(sQ),n=t?t.manager.tooltips.findIndex(i=>i.create==EI.create):-1;return n>-1?t.manager.tooltipViews[n]:null}mousemove(t){var n,i;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&!this.locked.has(r)&&s&&!LTt(s.dom,t)||this.pending){let{pos:a}=r[0]||this.pending,l=(i=(n=r[0])===null||n===void 0?void 0:n.end)!==null&&i!==void 0?i:a;(a==l?this.view.posAtCoords(this.lastMove)!=a:!$Tt(this.view,a,l,t.clientX,t.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length&&!this.locked.has(n)){let{tooltip:i}=this;i&&i.dom.contains(t.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(t){let n=i=>{t.removeEventListener("mouseleave",n);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const r2=4;function LTt(e,t){let{left:n,right:i,top:r,bottom:s}=e.getBoundingClientRect(),a;if(a=e.querySelector(".cm-tooltip-arrow")){let l=a.getBoundingClientRect();r=Math.min(l.top,r),s=Math.max(l.bottom,s)}return t.clientX>=n-r2&&t.clientX<=i+r2&&t.clientY>=r-r2&&t.clientY<=s+r2}function $Tt(e,t,n,i,r,s){let a=e.scrollDOM.getBoundingClientRect(),l=e.documentTop+e.documentPadding.top+e.contentHeight;if(a.left>i||a.rightr||Math.min(a.bottom,l)=t&&c<=n}function FTt(e,t={}){let n=Fn.define(),i=new WeakMap,r=ro.define({create(){return[]},update(a,l){let c=i.get(a);if(a.length&&(t.hideOnChange&&(l.docChanged||l.selection)?a=[]:c&&c(l)?a=[]:t.hideOn&&(a=a.filter(u=>!t.hideOn(l,u)))),l.docChanged&&a.length){let u=[];for(let d of a){let f=l.changes.mapPos(d.pos,-1,eo.TrackDel);if(f!=null){let h=Object.assign(Object.create(null),d);h.pos=f,h.end!=null&&(h.end=l.changes.mapPos(h.end)),u.push(h)}}a=u}for(let u of l.effects)u.is(n)&&(a=u.value,c=void 0),(u.is(UTt)&&!u.value||u.value==r)&&(a=[]);return a.length&&c&&i.set(a,c),a},provide:a=>FN.from(a)});const s=Ts.define(a=>new MTt(a,e,r,i,n,t.hoverTime||300));return{active:r,extension:[r,s,Q2e.of(s),DTt]}}function BTt(e,t,n,i={}){var r;let s=e.state.facet(Q2e).map(a=>e.plugin(a)).filter(a=>!!a);if(i.tooltip&&i.tooltip.active){let a=s.find(l=>l.field==i.tooltip.active);a&&(s=[a])}for(let a of s)a.activateHover(e,t,n,(r=i.until)!==null&&r!==void 0?r:()=>!1)}function z2e(e,t){let n=e.plugin(sQ);if(!n)return null;let i=n.manager.tooltips.indexOf(t);return i<0?null:n.manager.tooltipViews[i]}const UTt=Fn.define(),uJ=Kt.define({combine(e){let t,n;for(let i of e)t=t||i.topContainer,n=n||i.bottomContainer;return{topContainer:t,bottomContainer:n}}});function oQ(e,t){let n=e.plugin(V2e),i=n?n.specs.indexOf(t):-1;return i>-1?n.panels[i]:null}const V2e=Ts.fromClass(class{constructor(e){this.input=e.state.facet(sk),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(e));let t=e.state.facet(uJ);this.top=new s2(e,!0,t.topContainer),this.bottom=new s2(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(uJ);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new s2(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new s2(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(sk);if(n!=this.input){let i=n.filter(c=>c),r=[],s=[],a=[],l=[];for(let c of i){let u=this.specs.indexOf(c),d;u<0?(d=c(e.view),l.push(d)):(d=this.panels[u],d.update&&d.update(e)),r.push(d),(d.top?s:a).push(d)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(a);for(let c of l)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let i of this.panels)i.update&&i.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>$t.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class s2{constructor(t,n,i){this.view=t,this.top=n,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let n of this.panels)n.destroy&&t.indexOf(n)<0&&n.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let t=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;t!=n.dom;)t=dJ(t);t=t.nextSibling}else this.dom.insertBefore(n.dom,t);for(;t;)t=dJ(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function dJ(e){let t=e.nextSibling;return e.remove(),t}const sk=Kt.define({enables:V2e});function QTt(e,t){let n,i=new Promise(a=>n=a),r=a=>zTt(a,t,n);e.state.field(m5,!1)?e.dispatch({effects:H2e.of(r)}):e.dispatch({effects:Fn.appendConfig.of(m5.init(()=>[r]))});let s=q2e.of(r);return{close:s,result:i.then(a=>((e.win.queueMicrotask||(c=>e.win.setTimeout(c,10)))(()=>{e.state.field(m5).indexOf(r)>-1&&e.dispatch({effects:s})}),a))}}const m5=ro.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(H2e)?e=[n.value].concat(e):n.is(q2e)&&(e=e.filter(i=>i!=n.value));return e},provide:e=>sk.computeN([e],t=>t.field(e))}),H2e=Fn.define(),q2e=Fn.define();function zTt(e,t,n){let i=t.content?t.content(e,()=>a(null)):null;if(!i){if(i=yr("form"),t.input){let l=yr("input",t.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),i.appendChild(yr("label",(t.label||"")+": ",l))}else i.appendChild(document.createTextNode(t.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(yr("button",{class:"cm-button",type:"submit"},t.submitLabel||"OK"))}let r=i.nodeName=="FORM"?[i]:i.querySelectorAll("form");for(let l=0;l{u.keyCode==27?(u.preventDefault(),a(null)):u.keyCode==13&&(u.preventDefault(),a(c))}),c.addEventListener("submit",u=>{u.preventDefault(),a(c)})}let s=yr("div",i,yr("button",{onclick:()=>a(null),"aria-label":e.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));t.class&&(s.className=t.class),s.classList.add("cm-dialog");function a(l){s.contains(s.ownerDocument.activeElement)&&e.focus(),n(l)}return{dom:s,top:t.top,mount:()=>{if(t.focus){let l;typeof t.focus=="string"?l=i.querySelector(t.focus):l=i.querySelector("input")||i.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class Nh extends Em{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}Nh.prototype.elementClass="";Nh.prototype.toDOM=void 0;Nh.prototype.mapMode=eo.TrackBefore;Nh.prototype.startSide=Nh.prototype.endSide=-1;Nh.prototype.point=!0;const IA=Kt.define(),VTt=Kt.define(),HTt={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>xi.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},zO=Kt.define();function qTt(e){return[W2e(),zO.of({...HTt,...e})]}const fJ=Kt.define({combine:e=>e.some(t=>t)});function W2e(e){return[WTt]}const WTt=Ts.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(zO).map(t=>new pJ(e,t)),this.fixed=!e.state.facet(fJ);for(let t of this.gutters)t.config.side=="after"?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,i=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(i<(n.to-n.from)*.8)}if(e.geometryChanged){let t=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=t,this.domAfter&&(this.domAfter.style.minHeight=t)}this.view.state.facet(fJ)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=xi.iter(this.view.state.facet(IA),this.view.viewport.from),i=[],r=this.gutters.map(s=>new GTt(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let a=!0;for(let l of s.type)if(l.type==io.Text&&a){V$(n,i,l.from);for(let c of r)c.line(this.view,l,i);a=!1}else if(l.widget)for(let c of r)c.widget(this.view,l)}else if(s.type==io.Text){V$(n,i,s.from);for(let a of r)a.line(this.view,s,i)}else if(s.widget)for(let a of r)a.widget(this.view,s);for(let s of r)s.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(zO),n=e.state.facet(zO),i=e.docChanged||e.heightChanged||e.viewportChanged||!xi.eq(e.startState.facet(IA),e.state.facet(IA),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let r of this.gutters)r.update(e)&&(i=!0);else{i=!0;let r=[];for(let s of n){let a=t.indexOf(s);a<0?r.push(new pJ(this.view,s)):(this.gutters[a].update(e),r.push(this.gutters[a]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>$t.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let i=n.dom.offsetWidth*t.scaleX,r=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==Cr.LTR?{left:i,right:r}:{right:i,left:r}})});function hJ(e){return Array.isArray(e)?e:[e]}function V$(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class GTt{constructor(t,n,i){this.gutter=t,this.height=i,this.i=0,this.cursor=xi.iter(t.markers,n.from)}addElement(t,n,i){let{gutter:r}=this,s=(n.top-this.height)/t.scaleY,a=n.height/t.scaleY;if(this.i==r.elements.length){let l=new G2e(t,a,s,i);r.elements.push(l),r.dom.appendChild(l.dom)}else r.elements[this.i].update(t,a,s,i);this.height=n.bottom,this.i++}line(t,n,i){let r=[];V$(this.cursor,r,n.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(t,n,r);s&&r.unshift(s);let a=this.gutter;r.length==0&&!a.config.renderEmptyElements||this.addElement(t,n,r)}widget(t,n){let i=this.gutter.config.widgetMarker(t,n.widget,n),r=i?[i]:null;for(let s of t.state.facet(VTt)){let a=s(t,n.widget,n);a&&(r||(r=[])).push(a)}r&&this.addElement(t,n,r)}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let n=t.elements.pop();t.dom.removeChild(n.dom),n.destroy()}}}class pJ{constructor(t,n){this.view=t,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in n.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,a;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let c=s.getBoundingClientRect();a=(c.top+c.bottom)/2}else a=r.clientY;let l=t.lineBlockAtHeight(a-t.documentTop);n.domEventHandlers[i](t,l,r)&&r.preventDefault()});this.markers=hJ(n.markers(t)),n.initialSpacer&&(this.spacer=new G2e(t,0,0,[n.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let n=this.markers;if(this.markers=hJ(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],t);r!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[r])}let i=t.view.viewport;return!xi.eq(this.markers,n,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(t):!1)}destroy(){for(let t of this.elements)t.destroy()}}class G2e{constructor(t,n,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,n,i,r)}update(t,n,i,r){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),KTt(this.markers,r)||this.setMarkers(t,r)}setMarkers(t,n){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,a=0;;){let l=a,c=ss(l,c,u)||a(l,c,u):a}return i}})}});class g5 extends Nh{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function b5(e,t){return e.state.facet(Ly).formatNumber(t,e.state)}const ZTt=zO.compute([Ly],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(t){return t.state.facet(XTt)},lineMarker(t,n,i){return i.some(r=>r.toDOM)?null:new g5(b5(t,t.state.doc.lineAt(n.from).number))},widgetMarker:(t,n,i)=>{for(let r of t.state.facet(YTt)){let s=r(t,n,i);if(s)return s}return null},lineMarkerChange:t=>t.startState.facet(Ly)!=t.state.facet(Ly),initialSpacer(t){return new g5(b5(t,mJ(t.state.doc.lines)))},updateSpacer(t,n){let i=b5(n.view,mJ(n.view.state.doc.lines));return i==t.number?t:new g5(i)},domEventHandlers:e.facet(Ly).domEventHandlers,side:"before"}));function K2e(e={}){return[Ly.of(e),W2e(),ZTt]}function mJ(e){let t=9;for(;t{let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.head).from;r>n&&(n=r,t.push(JTt.range(r)))}return xi.of(t)});function t2t(){return e2t}let n2t=0,gd=class H${constructor(t,n,i,r){this.name=t,this.set=n,this.base=i,this.modified=r,this.id=n2t++}toString(){let{name:t}=this;for(let n of this.modified)n.name&&(t=`${n.name}(${t})`);return t}static define(t,n){let i=typeof t=="string"?t:"?";if(t instanceof H$&&(n=t),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let r=new H$(i,[],null,[]);if(r.set.push(r),n)for(let s of n.set)r.set.push(s);return r}static defineModifier(t){let n=new BN(t);return i=>i.modified.indexOf(n)>-1?i:BN.get(i.base||i,i.modified.concat(n).sort((r,s)=>r.id-s.id))}},i2t=0;class BN{constructor(t){this.name=t,this.instances=[],this.id=i2t++}static get(t,n){if(!n.length)return t;let i=n[0].instances.find(l=>l.base==t&&r2t(n,l.modified));if(i)return i;let r=[],s=new gd(t.name,r,t,n);for(let l of n)l.instances.push(s);let a=s2t(n);for(let l of t.set)if(!l.modified.length)for(let c of a)r.push(BN.get(l,c));return s}}function r2t(e,t){return e.length==t.length&&e.every((n,i)=>n==t[i])}function s2t(e){let t=[[]];for(let n=0;ni.length-n.length)}function Vh(e){let t=Object.create(null);for(let n in e){let i=e[n];Array.isArray(i)||(i=[i]);for(let r of n.split(" "))if(r){let s=[],a=2,l=r;for(let f=0;;){if(l=="..."&&f>0&&f+3==r.length){a=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!h)throw new RangeError("Invalid path: "+r);if(s.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==r.length)break;let p=r[f++];if(f==r.length&&p=="!"){a=0;break}if(p!="/")throw new RangeError("Invalid path: "+r);l=r.slice(f)}let c=s.length-1,u=s[c];if(!u)throw new RangeError("Invalid path: "+r);let d=new ak(i,a,c>0?s.slice(0,c):null);t[u]=d.sort(t[u])}}return X2e.add(t)}const X2e=new Ln({combine(e,t){let n,i,r;for(;e||t;){if(!e||t&&e.depth>=t.depth?(r=t,t=t.next):(r=e,e=e.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let s=new ak(r.tags,r.mode,r.context);n?n.next=s:i=s,n=s}return i}});let ak=class{constructor(t,n,i,r){this.tags=t,this.mode=n,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth{let a=r;for(let l of s)for(let c of l.set){let u=n[c.id];if(u){a=a?a+" "+u:u;break}}return a},scope:i}}function a2t(e,t){let n=null;for(let i of e){let r=i.style(t);r&&(n=n?n+" "+r:r)}return n}function o2t(e,t,n,i=0,r=e.length){let s=new l2t(i,Array.isArray(t)?t:[t],n);s.highlightRange(e.cursor(),i,r,"",s.highlighters),s.flush(r)}class l2t{constructor(t,n,i){this.at=t,this.highlighters=n,this.span=i,this.class=""}startSpan(t,n){n!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=n)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,n,i,r,s){let{type:a,from:l,to:c}=t;if(l>=i||c<=n)return;a.isTop&&(s=this.highlighters.filter(p=>!p.scope||p.scope(a)));let u=r,d=c2t(t)||ak.empty,f=a2t(s,d.tags);if(f&&(u&&(u+=" "),u+=f,d.mode==1&&(r+=(r?" ":"")+f)),this.startSpan(Math.max(n,l),u),d.opaque)return;let h=t.tree&&t.tree.prop(Ln.mounted);if(h&&h.overlay){let p=t.node.enter(h.overlay[0].from+l,1),g=this.highlighters.filter(v=>!v.scope||v.scope(h.tree.type)),b=t.firstChild();for(let v=0,y=l;;v++){let x=v=O||!t.nextSibling())););if(!x||O>i)break;y=x.to+l,y>n&&(this.highlightRange(p.cursor(),Math.max(n,x.from+l),Math.min(i,y),"",g),this.startSpan(Math.min(i,y),u))}b&&t.parent()}else if(t.firstChild()){h&&(r="");do if(!(t.to<=n)){if(t.from>=i)break;this.highlightRange(t,n,i,r,s),this.startSpan(Math.min(i,t.to),u)}while(t.nextSibling());t.parent()}}}function c2t(e){let t=e.type.prop(X2e);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const Qt=gd.define,a2=Qt(),Sp=Qt(),gJ=Qt(Sp),bJ=Qt(Sp),kp=Qt(),o2=Qt(kp),y5=Qt(kp),fd=Qt(),ag=Qt(fd),ld=Qt(),cd=Qt(),q$=Qt(),J1=Qt(q$),l2=Qt(),ne={comment:a2,lineComment:Qt(a2),blockComment:Qt(a2),docComment:Qt(a2),name:Sp,variableName:Qt(Sp),typeName:gJ,tagName:Qt(gJ),propertyName:bJ,attributeName:Qt(bJ),className:Qt(Sp),labelName:Qt(Sp),namespace:Qt(Sp),macroName:Qt(Sp),literal:kp,string:o2,docString:Qt(o2),character:Qt(o2),attributeValue:Qt(o2),number:y5,integer:Qt(y5),float:Qt(y5),bool:Qt(kp),regexp:Qt(kp),escape:Qt(kp),color:Qt(kp),url:Qt(kp),keyword:ld,self:Qt(ld),null:Qt(ld),atom:Qt(ld),unit:Qt(ld),modifier:Qt(ld),operatorKeyword:Qt(ld),controlKeyword:Qt(ld),definitionKeyword:Qt(ld),moduleKeyword:Qt(ld),operator:cd,derefOperator:Qt(cd),arithmeticOperator:Qt(cd),logicOperator:Qt(cd),bitwiseOperator:Qt(cd),compareOperator:Qt(cd),updateOperator:Qt(cd),definitionOperator:Qt(cd),typeOperator:Qt(cd),controlOperator:Qt(cd),punctuation:q$,separator:Qt(q$),bracket:J1,angleBracket:Qt(J1),squareBracket:Qt(J1),paren:Qt(J1),brace:Qt(J1),content:fd,heading:ag,heading1:Qt(ag),heading2:Qt(ag),heading3:Qt(ag),heading4:Qt(ag),heading5:Qt(ag),heading6:Qt(ag),contentSeparator:Qt(fd),list:Qt(fd),quote:Qt(fd),emphasis:Qt(fd),strong:Qt(fd),link:Qt(fd),monospace:Qt(fd),strikethrough:Qt(fd),inserted:Qt(),deleted:Qt(),changed:Qt(),invalid:Qt(),meta:l2,documentMeta:Qt(l2),annotation:Qt(l2),processingInstruction:Qt(l2),definition:gd.defineModifier("definition"),constant:gd.defineModifier("constant"),function:gd.defineModifier("function"),standard:gd.defineModifier("standard"),local:gd.defineModifier("local"),special:gd.defineModifier("special")};for(let e in ne){let t=ne[e];t instanceof gd&&(t.name=e)}Y2e([{tag:ne.link,class:"tok-link"},{tag:ne.heading,class:"tok-heading"},{tag:ne.emphasis,class:"tok-emphasis"},{tag:ne.strong,class:"tok-strong"},{tag:ne.keyword,class:"tok-keyword"},{tag:ne.atom,class:"tok-atom"},{tag:ne.bool,class:"tok-bool"},{tag:ne.url,class:"tok-url"},{tag:ne.labelName,class:"tok-labelName"},{tag:ne.inserted,class:"tok-inserted"},{tag:ne.deleted,class:"tok-deleted"},{tag:ne.literal,class:"tok-literal"},{tag:ne.string,class:"tok-string"},{tag:ne.number,class:"tok-number"},{tag:[ne.regexp,ne.escape,ne.special(ne.string)],class:"tok-string2"},{tag:ne.variableName,class:"tok-variableName"},{tag:ne.local(ne.variableName),class:"tok-variableName tok-local"},{tag:ne.definition(ne.variableName),class:"tok-variableName tok-definition"},{tag:ne.special(ne.variableName),class:"tok-variableName2"},{tag:ne.definition(ne.propertyName),class:"tok-propertyName tok-definition"},{tag:ne.typeName,class:"tok-typeName"},{tag:ne.namespace,class:"tok-namespace"},{tag:ne.className,class:"tok-className"},{tag:ne.macroName,class:"tok-macroName"},{tag:ne.propertyName,class:"tok-propertyName"},{tag:ne.operator,class:"tok-operator"},{tag:ne.comment,class:"tok-comment"},{tag:ne.meta,class:"tok-meta"},{tag:ne.invalid,class:"tok-invalid"},{tag:ne.punctuation,class:"tok-punctuation"}]);var v5;const zp=new Ln;function CI(e){return Kt.define({combine:e?t=>t.concat(e):void 0})}const lQ=new Ln;class ec{constructor(t,n,i=[],r=""){this.data=t,this.name=r,Ti.prototype.hasOwnProperty("tree")||Object.defineProperty(Ti.prototype,"tree",{get(){return Or(this)}}),this.parser=n,this.extension=[_m.of(this),Ti.languageData.of((s,a,l)=>{let c=yJ(s,a,l),u=c.type.prop(zp);if(!u)return[];let d=s.facet(u),f=c.type.prop(lQ);if(f){let h=c.resolve(a-c.from,l);for(let p of f)if(p.test(h,s)){let g=s.facet(p.facet);return p.type=="replace"?g:g.concat(d)}}return d})].concat(i)}isActiveAt(t,n,i=-1){return yJ(t,n,i).type.prop(zp)==this.data}findRegions(t){let n=t.facet(_m);if((n==null?void 0:n.data)==this.data)return[{from:0,to:t.doc.length}];if(!n||!n.allowsNesting)return[];let i=[],r=(s,a)=>{if(s.prop(zp)==this.data){i.push({from:a,to:a+s.length});return}let l=s.prop(Ln.mounted);if(l){if(l.tree.prop(zp)==this.data){if(l.overlay)for(let c of l.overlay)i.push({from:c.from+a,to:c.to+a});else i.push({from:a,to:a+s.length});return}else if(l.overlay){let c=i.length;if(r(l.tree,l.overlay[0].from+a),i.length>c)return}}for(let c=0;ci.isTop?n:void 0)]}),t.name)}configure(t,n){return new jh(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Or(e){let t=e.field(ec.state,!1);return t?t.tree:hi.empty}class u2t{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,n){let i=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,n):this.string.slice(t-i,n-i)}}let ew=null;class Ib{constructor(t,n,i=[],r,s,a,l,c){this.parser=t,this.state=n,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=a,this.skipped=l,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(t,n,i){return new Ib(t,n,[],hi.empty,0,i,[],null)}startParse(){return this.parser.startParse(new u2t(this.state.doc),this.fragments)}work(t,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=hi.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof t=="number"){let r=Date.now()+t;t=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=t,this.tree=n,this.fragments=this.withoutTempSkipped(uh.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let n=ew;ew=this;try{return t()}finally{ew=n}}withoutTempSkipped(t){for(let n;n=this.tempSkipped.pop();)t=vJ(t,n.from,n.to);return t}changes(t,n){let{fragments:i,tree:r,treeLen:s,viewport:a,skipped:l}=this;if(this.takeTree(),!t.empty){let c=[];if(t.iterChangedRanges((u,d,f,h)=>c.push({fromA:u,toA:d,fromB:f,toB:h})),i=uh.applyChanges(i,c),r=hi.empty,s=0,a={from:t.mapPos(a.from,-1),to:t.mapPos(a.to,1)},this.skipped.length){l=[];for(let u of this.skipped){let d=t.mapPos(u.from,1),f=t.mapPos(u.to,-1);dt.from&&(this.fragments=vJ(this.fragments,r,s),this.skipped.splice(i--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,n){this.skipped.push({from:t,to:n})}static getSkippingParser(t){return new class extends yI{createParse(n,i,r){let s=r[0].from,a=r[r.length-1].to;return{parsedPos:s,advance(){let c=ew;if(c){for(let u of r)c.tempSkipped.push(u);t&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,t]):t)}return this.parsedPos=a,new hi(ea.none,[],[],a-s)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let n=this.fragments;return this.treeLen>=t&&n.length&&n[0].from==0&&n[0].to>=t}static get(){return ew}}function vJ(e,t,n){return uh.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class lx{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,i)||n.takeTree(),new lx(n)}static init(t){let n=Math.min(3e3,t.doc.length),i=Ib.create(t.facet(_m).parser,t,{from:0,to:n});return i.work(20,n)||i.takeTree(),new lx(i)}}ec.state=ro.define({create:lx.init,update(e,t){for(let n of t.effects)if(n.is(ec.setState))return n.value;return t.startState.facet(_m)!=t.state.facet(_m)?lx.init(t.state):e.apply(t)}});let Z2e=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(Z2e=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const x5=typeof navigator<"u"&&(!((v5=navigator.scheduling)===null||v5===void 0)&&v5.isInputPending)?()=>navigator.scheduling.isInputPending():null,d2t=Ts.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let n=this.view.state.field(ec.state).context;(n.updateViewport(t.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:t}=this.view,n=t.field(ec.state);(n.tree!=n.context.tree||!n.context.isDone(t.doc.length))&&(this.working=Z2e(this.work))}work(t){this.working=null;let n=Date.now();if(this.chunkEndr+1e3,c=s.context.work(()=>x5&&x5()||Date.now()>a,r+(l?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:ec.setState.of(new lx(s.context))})),this.chunkBudget>0&&!(c&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(n=>hl(this.view.state,n)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),_m=Kt.define({combine(e){return e.length?e[0]:null},enables:e=>[ec.state,d2t,$t.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class Nm{constructor(t,n=[]){this.language=t,this.support=n,this.extension=[t,n]}}class UN{constructor(t,n,i,r,s,a=void 0){this.name=t,this.alias=n,this.extensions=i,this.filename=r,this.loadFunc=s,this.support=a,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(t=>this.support=t,t=>{throw this.loading=null,t}))}static of(t){let{load:n,support:i}=t;if(!n){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");n=()=>Promise.resolve(i)}return new UN(t.name,(t.alias||[]).concat(t.name).map(r=>r.toLowerCase()),t.extensions||[],t.filename,n,i)}static matchFilename(t,n){for(let r of t)if(r.filename&&r.filename.test(n))return r;let i=/\.([^.]+)$/.exec(n);if(i){for(let r of t)if(r.extensions.indexOf(i[1])>-1)return r}return null}static matchLanguageName(t,n,i=!0){n=n.toLowerCase();for(let r of t)if(r.alias.some(s=>s==n))return r;if(i)for(let r of t)for(let s of r.alias){let a=n.indexOf(s);if(a>-1&&(s.length>2||!/\w/.test(n[a-1])&&!/\w/.test(n[a+s.length])))return r}return null}}const f2t=Kt.define(),i1=Kt.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(n=>n!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function Pb(e){let t=e.facet(i1);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function ok(e,t){let n="",i=e.tabSize,r=e.facet(i1)[0];if(r==" "){for(;t>=i;)n+=" ",t-=i;r=" "}for(let s=0;s=t?h2t(e,n,t):null}class TI{constructor(t,n={}){this.state=t,this.options=n,this.unit=Pb(t)}lineAt(t,n=1){let i=this.state.doc.lineAt(t),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==t?{text:"",from:t}:(n<0?r-1&&(s+=a-this.countColumn(i,i.search(/\S|$/))),s}countColumn(t,n=t.length){return Uu(t,this.state.tabSize,n)}lineIndent(t,n=1){let{text:i,from:r}=this.lineAt(t,n),s=this.options.overrideIndentation;if(s){let a=s(r);if(a>-1)return a}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Hh=new Ln;function h2t(e,t,n){let i=t.resolveStack(n),r=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let s=[];for(let a=r;a&&!(a.fromi.node.to||a.from==i.node.from&&a.type==i.node.type);a=a.parent)s.push(a);for(let a=s.length-1;a>=0;a--)i={node:s[a],next:i}}return J2e(i,e,n)}function J2e(e,t,n){for(let i=e;i;i=i.next){let r=m2t(i.node);if(r)return r(uQ.create(t,n,i))}return 0}function p2t(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function m2t(e){let t=e.type.prop(Hh);if(t)return t;let n=e.firstChild,i;if(n&&(i=n.type.prop(Ln.closedBy))){let r=e.lastChild,s=r&&i.indexOf(r.name)>-1;return a=>eAe(a,!0,1,void 0,s&&!p2t(a)?r.from:void 0)}return e.parent==null?g2t:null}function g2t(){return 0}class uQ extends TI{constructor(t,n,i){super(t.state,t.options),this.base=t,this.pos=n,this.context=i}get node(){return this.context.node}static create(t,n,i){return new uQ(t,n,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let n=this.state.doc.lineAt(t.from);for(;;){let i=t.resolve(n.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(b2t(i,t))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return J2e(this.context.next,this.base,this.pos)}}function b2t(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function y2t(e){let t=e.node,n=t.childAfter(t.from),i=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,s=e.state.doc.lineAt(n.from),a=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=n.to;;){let c=t.childAfter(l);if(!c||c==i)return null;if(!c.type.isSkipped){if(c.from>=a)return null;let u=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+u}}l=c.to}}function hv({closing:e,align:t=!0,units:n=1}){return i=>eAe(i,t,n,e)}function eAe(e,t,n,i,r){let s=e.textAfter,a=s.match(/^\s*/)[0].length,l=i&&s.slice(a,a+i.length)==i||r==e.pos+a,c=t?y2t(e):null;return c?l?e.column(c.from):e.column(c.to):e.baseIndent+(l?0:e.unit*n)}const v2t=e=>e.baseIndent;function pv({except:e,units:t=1}={}){return n=>{let i=e&&e.test(n.textAfter);return n.baseIndent+(i?0:t*n.unit)}}const x2t=200;function w2t(){return Ti.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:i}=e.newSelection.main,r=n.lineAt(i);if(i>r.from+x2t)return e;let s=n.sliceString(r.from,i);if(!t.some(u=>u.test(s)))return e;let{state:a}=e,l=-1,c=[];for(let{head:u}of a.selection.ranges){let d=a.doc.lineAt(u);if(d.from==l)continue;l=d.from;let f=cQ(a,d.from);if(f==null)continue;let h=/^\s*/.exec(d.text)[0],p=ok(a,f);h!=p&&c.push({from:d.from,to:d.from+h.length,insert:p})}return c.length?[e,{changes:c,sequential:!0}]:e})}const tAe=Kt.define(),qh=new Ln;function LE(e){let t=e.firstChild,n=e.lastChild;return t&&t.ton)continue;if(s&&l.from=t&&u.to>n&&(s=u)}}return s}function S2t(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function QN(e,t,n){for(let i of e.facet(tAe)){let r=i(e,t,n);if(r)return r}return O2t(e,t,n)}function nAe(e,t){let n=t.mapPos(e.from,1),i=t.mapPos(e.to,-1);return n>=i?void 0:{from:n,to:i}}const AI=Fn.define({map:nAe}),$E=Fn.define({map:nAe});function iAe(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(i=>i.from<=n&&i.to>=n)||t.push(e.lineBlockAt(n));return t}const Db=ro.define({create(){return gn.none},update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((i,r)=>e=xJ(e,i,r)),e=e.map(t.changes);let n=[];for(let i of t.effects)i.is(AI)&&!k2t(e,i.value.from,i.value.to)?n.push(i.value):i.is($E)&&(e=e.update({filter:(r,s)=>i.value.from!=r||i.value.to!=s,filterFrom:i.value.from,filterTo:i.value.to}));if(n.length){let{preparePlaceholder:i}=t.state.facet(aAe),r=n.map(s=>(i?gn.replace({widget:new j2t(i(t.state,s))}):wJ).range(s.from,s.to));e=e.update({add:r})}return t.selection&&(e=xJ(e,t.selection.main.head)),e},provide:e=>$t.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(i,r)=>{n.push(i,r)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n{rt&&(i=!0)}),i?e.update({filterFrom:t,filterTo:n,filter:(r,s)=>r>=n||s<=t}):e}function zN(e,t,n){var i;let r=null;return(i=e.field(Db,!1))===null||i===void 0||i.between(t,n,(s,a)=>{(!r||r.from>s)&&(r={from:s,to:a})}),r}function k2t(e,t,n){let i=!1;return e.between(t,t,(r,s)=>{r==t&&s==n&&(i=!0)}),i}function rAe(e,t){return e.field(Db,!1)?t:t.concat(Fn.appendConfig.of(oAe()))}const E2t=e=>{for(let t of iAe(e)){let n=QN(e.state,t.from,t.to);if(n)return e.dispatch({effects:rAe(e.state,[AI.of(n),sAe(e,n)])}),!0}return!1},C2t=e=>{if(!e.state.field(Db,!1))return!1;let t=[];for(let n of iAe(e)){let i=zN(e.state,n.from,n.to);i&&t.push($E.of(i),sAe(e,i,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function sAe(e,t,n=!0){let i=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return $t.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${e.state.phrase("to")} ${r}.`)}const T2t=e=>{let{state:t}=e,n=[];for(let i=0;i{let t=e.state.field(Db,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(i,r)=>{n.push($E.of({from:i,to:r}))}),e.dispatch({effects:n}),!0},_2t=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:E2t},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:C2t},{key:"Ctrl-Alt-[",run:T2t},{key:"Ctrl-Alt-]",run:A2t}],N2t={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},aAe=Kt.define({combine(e){return ef(e,N2t)}});function oAe(e){return[Db,P2t]}function lAe(e,t){let{state:n}=e,i=n.facet(aAe),r=a=>{let l=e.lineBlockAt(e.posAtDOM(a.target)),c=zN(e.state,l.from,l.to);c&&e.dispatch({effects:$E.of(c)}),a.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(e,r,t);let s=document.createElement("span");return s.textContent=i.placeholderText,s.setAttribute("aria-label",n.phrase("folded code")),s.title=n.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}const wJ=gn.replace({widget:new class extends Yu{toDOM(e){return lAe(e,null)}}});class j2t extends Yu{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return lAe(t,this.value)}}const R2t={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class w5 extends Nh{constructor(t,n){super(),this.config=t,this.open=n}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=t.state.phrase(this.open?"Fold line":"Unfold line"),n}}function I2t(e={}){let t={...R2t,...e},n=new w5(t,!0),i=new w5(t,!1),r=Ts.fromClass(class{constructor(a){this.from=a.viewport.from,this.markers=this.buildMarkers(a)}update(a){(a.docChanged||a.viewportChanged||a.startState.facet(_m)!=a.state.facet(_m)||a.startState.field(Db,!1)!=a.state.field(Db,!1)||Or(a.startState)!=Or(a.state)||t.foldingChanged(a))&&(this.markers=this.buildMarkers(a.view))}buildMarkers(a){let l=new Ah;for(let c of a.viewportLineBlocks){let u=zN(a.state,c.from,c.to)?i:QN(a.state,c.from,c.to)?n:null;u&&l.add(c.from,c.from,u)}return l.finish()}}),{domEventHandlers:s}=t;return[r,qTt({class:"cm-foldGutter",markers(a){var l;return((l=a.plugin(r))===null||l===void 0?void 0:l.markers)||xi.empty},initialSpacer(){return new w5(t,!1)},domEventHandlers:{...s,click:(a,l,c)=>{if(s.click&&s.click(a,l,c))return!0;let u=zN(a.state,l.from,l.to);if(u)return a.dispatch({effects:$E.of(u)}),!0;let d=QN(a.state,l.from,l.to);return d?(a.dispatch({effects:AI.of(d)}),!0):!1}}}),oAe()]}const P2t=$t.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class FE{constructor(t,n){this.specs=t;let i;function r(l){let c=Cm.newName();return(i||(i=Object.create(null)))["."+c]=l,c}const s=typeof n.all=="string"?n.all:n.all?r(n.all):void 0,a=n.scope;this.scope=a instanceof ec?l=>l.prop(zp)==a.data:a?l=>l==a:void 0,this.style=Y2e(t.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=i?new Cm(i):null,this.themeType=n.themeType}static define(t,n){return new FE(t,n||{})}}const W$=Kt.define(),cAe=Kt.define({combine(e){return e.length?[e[0]]:null}});function PA(e){let t=e.facet(W$);return t.length?t:e.facet(cAe)}function uAe(e,t){let n=[M2t],i;return e instanceof FE&&(e.module&&n.push($t.styleModule.of(e.module)),i=e.themeType),t!=null&&t.fallback?n.push(cAe.of(e)):i?n.push(W$.computeN([$t.darkTheme],r=>r.facet($t.darkTheme)==(i=="dark")?[e]:[])):n.push(W$.of(e)),n}function OHt(e,t,n){let i=PA(e),r=null;if(i){for(let s of i)if(!s.scope||n){let a=s.style(t);a&&(r=r?r+" "+a:a)}}return r}class D2t{constructor(t){this.markCache=Object.create(null),this.tree=Or(t.state),this.decorations=this.buildDeco(t,PA(t.state)),this.decoratedTo=t.viewport.to}update(t){let n=Or(t.state),i=PA(t.state),r=i!=PA(t.startState),{viewport:s}=t.view,a=t.changes.mapPos(this.decoratedTo,1);n.length=s.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=a):(n!=this.tree||t.viewportChanged||r)&&(this.tree=n,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=s.to)}buildDeco(t,n){if(!n||!this.tree.length)return gn.none;let i=new Ah;for(let{from:r,to:s}of t.visibleRanges)o2t(this.tree,n,(a,l,c)=>{i.add(a,l,this.markCache[c]||(this.markCache[c]=gn.mark({class:c})))},r,s);return i.finish()}}const M2t=zh.high(Ts.fromClass(D2t,{decorations:e=>e.decorations})),L2t=FE.define([{tag:ne.meta,color:"#404740"},{tag:ne.link,textDecoration:"underline"},{tag:ne.heading,textDecoration:"underline",fontWeight:"bold"},{tag:ne.emphasis,fontStyle:"italic"},{tag:ne.strong,fontWeight:"bold"},{tag:ne.strikethrough,textDecoration:"line-through"},{tag:ne.keyword,color:"#708"},{tag:[ne.atom,ne.bool,ne.url,ne.contentSeparator,ne.labelName],color:"#219"},{tag:[ne.literal,ne.inserted],color:"#164"},{tag:[ne.string,ne.deleted],color:"#a11"},{tag:[ne.regexp,ne.escape,ne.special(ne.string)],color:"#e40"},{tag:ne.definition(ne.variableName),color:"#00f"},{tag:ne.local(ne.variableName),color:"#30a"},{tag:[ne.typeName,ne.namespace],color:"#085"},{tag:ne.className,color:"#167"},{tag:[ne.special(ne.variableName),ne.macroName],color:"#256"},{tag:ne.definition(ne.propertyName),color:"#00c"},{tag:ne.comment,color:"#940"},{tag:ne.invalid,color:"#f00"}]),$2t=$t.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),dAe=1e4,fAe="()[]{}",hAe=Kt.define({combine(e){return ef(e,{afterCursor:!0,brackets:fAe,maxScanDistance:dAe,renderMatch:U2t})}}),F2t=gn.mark({class:"cm-matchingBracket"}),B2t=gn.mark({class:"cm-nonmatchingBracket"});function U2t(e){let t=[],n=e.matched?F2t:B2t;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function OJ(e){let t=[],n=e.facet(hAe);for(let i of e.selection.ranges){if(!i.empty)continue;let r=_d(e,i.head,-1,n)||i.head>0&&_d(e,i.head-1,1,n)||n.afterCursor&&(_d(e,i.head,1,n)||i.heade.decorations}),z2t=[Q2t,$2t];function V2t(e={}){return[hAe.of(e),z2t]}const pAe=new Ln;function G$(e,t,n){let i=e.prop(t<0?Ln.openedBy:Ln.closedBy);if(i)return i;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==(t<0?1:0))return[n[r+t]]}return null}function K$(e){let t=e.type.prop(pAe);return t?t(e.node):e}function _d(e,t,n,i={}){let r=i.maxScanDistance||dAe,s=i.brackets||fAe,a=Or(e),l=a.resolveInner(t,n);for(let c=l;c;c=c.parent){let u=G$(c.type,n,s);if(u&&c.from0?t>=d.from&&td.from&&t<=d.to))return H2t(e,t,n,c,d,u,s)}}return q2t(e,t,n,a,l.type,r,s)}function H2t(e,t,n,i,r,s,a){let l=i.parent,c={from:r.from,to:r.to},u=0,d=l==null?void 0:l.cursor();if(d&&(n<0?d.childBefore(i.from):d.childAfter(i.to)))do if(n<0?d.to<=i.from:d.from>=i.to){if(u==0&&s.indexOf(d.type.name)>-1&&d.from0)return null;let u={from:n<0?t-1:t,to:n>0?t+1:t},d=e.doc.iterRange(t,n>0?e.doc.length:0),f=0;for(let h=0;!d.next().done&&h<=s;){let p=d.value;n<0&&(h+=p.length);let g=t+h*n;for(let b=n>0?0:p.length-1,v=n>0?p.length:-1;b!=v;b+=n){let y=a.indexOf(p[b]);if(!(y<0||i.resolveInner(g+b,1).type!=r))if(y%2==0==n>0)f++;else{if(f==1)return{start:u,end:{from:g+b,to:g+b+1},matched:y>>1==c>>1};f--}}n>0&&(h+=p.length)}return d.done?{start:u,matched:!1}:null}function SJ(e,t,n,i=0,r=0){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));let s=r;for(let a=i;a=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.posn}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let n=this.string.indexOf(t,this.pos);if(n>-1)return this.pos=n,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPosi?a.toLowerCase():a,s=this.string.substr(this.pos,t.length);return r(s)==r(t)?(n!==!1&&(this.pos+=t.length),!0):null}else{let r=this.string.slice(this.pos).match(t);return r&&r.index>0?null:(r&&n!==!1&&(this.pos+=r[0].length),r)}}current(){return this.string.slice(this.start,this.pos)}}function W2t(e){return{name:e.name||"",token:e.token,blankLine:e.blankLine||(()=>{}),startState:e.startState||(()=>!0),copyState:e.copyState||G2t,indent:e.indent||(()=>null),languageData:e.languageData||{},tokenTable:e.tokenTable||hQ,mergeTokens:e.mergeTokens!==!1}}function G2t(e){if(typeof e!="object")return e;let t={};for(let n in e){let i=e[n];t[n]=i instanceof Array?i.slice():i}return t}const kJ=new WeakMap;class dQ extends ec{constructor(t){let n=CI(t.languageData),i=W2t(t),r,s=new class extends yI{createParse(a,l,c){return new X2t(r,a,l,c)}};super(n,s,[],t.name),this.topNode=J2t(n,this),r=this,this.streamParser=i,this.stateAfter=new Ln({perNode:!0}),this.tokenTable=t.tokenTable?new vAe(i.tokenTable):Z2t}static define(t){return new dQ(t)}getIndent(t){let n,{overrideIndentation:i}=t.options;i&&(n=kJ.get(t.state),n!=null&&n1e4)return null;for(;s=i&&n+t.length<=r&&t.prop(e.stateAfter);if(s)return{state:e.streamParser.copyState(s),pos:n+t.length};for(let a=t.children.length-1;a>=0;a--){let l=t.children[a],c=n+t.positions[a],u=l instanceof hi&&c=t.length)return t;!r&&n==0&&t.type==e.topNode&&(r=!0);for(let s=t.children.length-1;s>=0;s--){let a=t.positions[s],l=t.children[s],c;if(an&&fQ(e,s.tree,0-s.offset,n,l),u;if(c&&c.pos<=i&&(u=gAe(e,s.tree,n+s.offset,c.pos+s.offset,!1)))return{state:c.state,tree:u}}return{state:e.streamParser.startState(r?Pb(r):4),tree:hi.empty}}let X2t=class{constructor(t,n,i,r){this.lang=t,this.input=n,this.fragments=i,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let s=Ib.get(),a=r[0].from,{state:l,tree:c}=K2t(t,i,a,this.to,s==null?void 0:s.state);this.state=l,this.parsedPos=this.chunkStart=a+c.length;for(let u=0;uu.from<=s.viewport.from&&u.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(Pb(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let t=Ib.get(),n=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(n,this.chunkStart+512);for(t&&(i=Math.min(i,t.viewport.to));this.parsedPos=n?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,n),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let n=this.input.chunk(t);if(this.input.lineChunks)n==` +`;this.styleTag.textContent=a;let l=n.head||n;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(t){this.styleTag&&this.styleTag.getAttribute("nonce")!=t&&this.styleTag.setAttribute("nonce",t)}}var Tm={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ek={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},dEt=typeof navigator<"u"&&/Mac/.test(navigator.platform),fEt=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ya=0;Ya<10;Ya++)Tm[48+Ya]=Tm[96+Ya]=String(Ya);for(var Ya=1;Ya<=24;Ya++)Tm[Ya+111]="F"+Ya;for(var Ya=65;Ya<=90;Ya++)Tm[Ya]=String.fromCharCode(Ya+32),ek[Ya]=String.fromCharCode(Ya);for(var r5 in Tm)ek.hasOwnProperty(r5)||(ek[r5]=Tm[r5]);function hEt(e){var t=dEt&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||fEt&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?ek:Tm)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function yr(){var e=arguments[0];typeof e=="string"&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];typeof r=="string"?e.setAttribute(i,r):r!=null&&(e[i]=r)}t++}for(;t2);var Xt={mac:_Z||/Mac/.test(Po.platform),windows:/Win/.test(Po.platform),linux:/Linux|X11/.test(Po.platform),ie:xI,ie_version:VTe?E$.documentMode||6:T$?+T$[1]:C$?+C$[1]:0,gecko:TZ,gecko_version:TZ?+(/Firefox\/(\d+)/.exec(Po.userAgent)||[0,0])[1]:0,chrome:!!s5,chrome_version:s5?+s5[1]:0,ios:_Z,android:/Android\b/.test(Po.userAgent),webkit:AZ,webkit_version:AZ?+(/\bAppleWebKit\/(\d+)/.exec(Po.userAgent)||[0,0])[1]:0,safari:A$,safari_version:A$?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Po.userAgent)||[0,0])[1]:0,tabSize:E$.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function GU(e,t){for(let n in e)n=="class"&&t.class?t.class+=" "+e.class:n=="style"&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}const jN=Object.create(null);function KU(e,t,n){if(e==t)return!0;e||(e=jN),t||(t=jN);let i=Object.keys(e),r=Object.keys(t);if(i.length-0!=r.length-0)return!1;for(let s of i)if(s!=n&&(r.indexOf(s)==-1||e[s]!==t[s]))return!1;return!0}function pEt(e,t){for(let n=e.attributes.length-1;n>=0;n--){let i=e.attributes[n].name;t[i]==null&&e.removeAttribute(i)}for(let n in t){let i=t[n];n=="style"?e.style.cssText=i:e.getAttribute(n)!=i&&e.setAttribute(n,i)}}function NZ(e,t,n){let i=!1;if(t)for(let r in t)n&&r in n||(i=!0,r=="style"?e.style.cssText="":e.removeAttribute(r));if(n)for(let r in n)t&&t[r]==n[r]||(i=!0,r=="style"?e.style.cssText=n[r]:e.setAttribute(r,n[r]));return i}function mEt(e){let t=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new Nb(t,n,n,i,t.widget||null,!1)}static replace(t){let n=!!t.block,i,r;if(t.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:a}=HTe(t,n);i=(s?n?-3e8:-1:5e8)-1,r=(a?n?2e8:1:-6e8)+1}return new Nb(t,i,r,n,t.widget||null,!0)}static line(t){return new DE(t)}static set(t,n=!1){return xi.of(t,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}gn.none=xi.empty;class PE extends gn{constructor(t){let{start:n,end:i}=HTe(t);super(n?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.attrs=t.class&&t.attributes?GU(t.attributes,{class:t.class}):t.class?{class:t.class}:t.attributes||jN}eq(t){return this==t||t instanceof PE&&this.tagName==t.tagName&&KU(this.attrs,t.attrs)}range(t,n=t){if(t>=n)throw new RangeError("Mark decorations may not be empty");return super.range(t,n)}}PE.prototype.point=!1;class DE extends gn{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof DE&&this.spec.class==t.spec.class&&KU(this.spec.attributes,t.spec.attributes)}range(t,n=t){if(n!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,n)}}DE.prototype.mapMode=eo.TrackBefore;DE.prototype.point=!0;class Nb extends gn{constructor(t,n,i,r,s,a){super(n,i,s,t),this.block=r,this.isReplace=a,this.mapMode=r?n<=0?eo.TrackBefore:eo.TrackAfter:eo.TrackDel}get type(){return this.startSide!=this.endSide?io.WidgetRange:this.startSide<=0?io.WidgetBefore:io.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof Nb&&gEt(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,n=t){if(this.isReplace&&(t>n||t==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,n)}}Nb.prototype.point=!0;function HTe(e,t=!1){let{inclusiveStart:n,inclusiveEnd:i}=e;return n==null&&(n=e.inclusive),i==null&&(i=e.inclusive),{start:n??t,end:i??t}}function gEt(e,t){return e==t||!!(e&&t&&e.compare(t))}function uv(e,t,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=e?n[r]=Math.max(n[r],t):n.push(e,t)}class tk extends Em{constructor(t,n,i){super(),this.tagName=t,this.attributes=n,this.rank=i}eq(t){return t==this||t instanceof tk&&this.tagName==t.tagName&&KU(this.attributes,t.attributes)}static create(t){return new tk(t.tagName,t.attributes||jN,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(t,n=!1){return xi.of(t,n)}}tk.prototype.startSide=tk.prototype.endSide=-1;function nk(e){let t;return e.nodeType==11?t=e.getSelection?e:e.ownerDocument:t=e,t.getSelection()}function _$(e,t){return t?e==t||e.contains(t.nodeType!=1?t.parentNode:t):!1}function FO(e,t){if(!t.anchorNode)return!1;try{return _$(e,t.anchorNode)}catch{return!1}}function BO(e){return e.nodeType==3?rk(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function UO(e,t,n,i){return n?jZ(e,t,n,i,-1)||jZ(e,t,n,i,1):!1}function Am(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function RN(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function jZ(e,t,n,i,r){for(;;){if(e==n&&t==i)return!0;if(t==(r<0?0:_h(e))){if(e.nodeName=="DIV")return!1;let s=e.parentNode;if(!s||s.nodeType!=1)return!1;t=Am(e)+(r<0?0:1),e=s}else if(e.nodeType==1){if(e=e.childNodes[t+(r<0?-1:0)],e.nodeType==1&&e.contentEditable=="false")return!1;t=r<0?_h(e):0}else return!1}}function _h(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function ik(e,t){let{left:n,right:i}=e;if(n==i)return e;let r=t?n:i;return{left:r,right:r,top:e.top,bottom:e.bottom}}function bEt(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function qTe(e,t){let n=t.width/e.offsetWidth,i=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.height-e.offsetHeight)<1)&&(i=1),{scaleX:n,scaleY:i}}function yEt(e,t,n,i,r,s,a,l){let c=e.ownerDocument,u=c.defaultView||window;for(let d=e,f=!1;d&&!f;)if(d.nodeType==1){let h,p=d==c.body,g=1,b=1;if(p)h=bEt(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(d).position)&&(f=!0),d.scrollHeight<=d.clientHeight&&d.scrollWidth<=d.clientWidth){d=d.assignedSlot||d.parentNode;continue}let x=d.getBoundingClientRect();({scaleX:g,scaleY:b}=qTe(d,x)),h={left:x.left,right:x.left+d.clientWidth*g,top:x.top,bottom:x.top+d.clientHeight*b}}let v=0,y=0;if(r=="nearest")t.top0&&t.bottom>h.bottom+y&&(y=t.bottom-h.bottom+a)):t.bottom>h.bottom-a&&(y=t.bottom-h.bottom+a,n<0&&t.top-y0&&t.right>h.right+v&&(v=t.right-h.right+s)):t.right>h.right-s&&(v=t.right-h.right+s,n<0&&t.lefth.bottom||t.lefth.right)&&(t={left:Math.max(t.left,h.left),right:Math.min(t.right,h.right),top:Math.max(t.top,h.top),bottom:Math.min(t.bottom,h.bottom)}),d=d.assignedSlot||d.parentNode}else if(d.nodeType==11)d=d.host;else break}function WTe(e,t=!0){let n=e.ownerDocument,i=null,r=null;for(let s=e.parentNode;s&&!(s==n.body||(!t||i)&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),t&&!i&&s.scrollWidth>s.clientWidth&&(i=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:i,y:r}}class vEt{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:n,focusNode:i}=t;this.set(n,Math.min(t.anchorOffset,n?_h(n):0),i,Math.min(t.focusOffset,i?_h(i):0))}set(t,n,i,r){this.anchorNode=t,this.anchorOffset=n,this.focusNode=i,this.focusOffset=r}}let kg=null;Xt.safari&&Xt.safari_version>=26&&(kg=!1);function GTe(e){if(e.setActive)return e.setActive();if(kg)return e.focus(kg);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(kg==null?{get preventScroll(){return kg={preventScroll:!0},!0}}:void 0),!kg){kg=!1;for(let n=0;nMath.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function XTe(e,t){for(let n=e,i=t;;){if(n.nodeType==3&&i>0)return{node:n,offset:i};if(n.nodeType==1&&i>0){if(n.contentEditable=="false")return null;n=n.childNodes[i-1],i=_h(n)}else if(n.parentNode&&!RN(n))i=Am(n),n=n.parentNode;else return null}}function YTe(e,t){for(let n=e,i=t;;){if(n.nodeType==3&&i=n){if(l.level==i)return a;(s<0||(r!=0?r<0?l.fromn:t[s].level>l.level))&&(s=a)}}if(s<0)throw new RangeError("Index out of range");return s}}function e2e(e,t){if(e.length!=t.length)return!1;for(let n=0;n=0;b-=3)if(od[b+1]==-p){let v=od[b+2],y=v&2?r:v&4?v&1?s:r:0;y&&(Er[f]=Er[od[b]]=y),l=b;break}}else{if(od.length==189)break;od[l++]=f,od[l++]=h,od[l++]=c}else if((g=Er[f])==2||g==1){let b=g==r;c=b?0:1;for(let v=l-3;v>=0;v-=3){let y=od[v+2];if(y&2)break;if(b)od[v+2]|=2;else{if(y&4)break;od[v+2]|=4}}}}}function TEt(e,t,n,i){for(let r=0,s=i;r<=n.length;r++){let a=r?n[r-1].to:e,l=rc;)g==v&&(g=n[--b].from,v=b?n[b-1].to:e),Er[--g]=p;c=d}else s=u,c++}}}function j$(e,t,n,i,r,s,a){let l=i%2?2:1;if(i%2==r%2)for(let c=t,u=0;cc&&a.push(new Ad(c,b.from,p));let v=b.direction==jb!=!(p%2);R$(e,v?i+1:i,r,b.inner,b.from,b.to,a),c=b.to}g=b.to}else{if(g==n||(d?Er[g]!=l:Er[g]==l))break;g++}h?j$(e,c,g,i+1,r,h,a):ct;){let d=!0,f=!1;if(!u||c>s[u-1].to){let b=Er[c-1];b!=l&&(d=!1,f=b==16)}let h=!d&&l==1?[]:null,p=d?i:i+1,g=c;e:for(;;)if(u&&g==s[u-1].to){if(f)break e;let b=s[--u];if(!d)for(let v=b.from,y=u;;){if(v==t)break e;if(y&&s[y-1].to==v)v=s[--y].from;else{if(Er[v-1]==l)break e;break}}if(h)h.push(b);else{b.toEr.length;)Er[Er.length]=256;let i=[],r=t==jb?0:1;return R$(e,r,r,n,0,e.length,i),i}function t2e(e){return[new Ad(0,e,0)]}let n2e="";function _Et(e,t,n,i,r){var s;let a=i.head-e.from,l=Ad.find(t,a,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),c=t[l],u=c.side(r,n);if(a==u){let h=l+=r?1:-1;if(h<0||h>=t.length)return null;c=t[l=h],a=c.side(!r,n),u=c.side(r,n)}let d=$a(e.text,a,c.forward(r,n));(dc.to)&&(d=u),n2e=e.text.slice(Math.min(a,d),Math.max(a,d));let f=l==(r?t.length-1:0)?null:t[l+(r?1:-1)];return f&&d==u&&f.level+(r?0:1)e.some(t=>t)}),u2e=Zt.define({combine:e=>e.some(t=>t)}),d2e=Zt.define();class fv{constructor(t,n,i,r,s,a=!1){this.range=t,this.y=n,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=a}map(t){return t.empty?this:new fv(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new fv(tt.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const KT=Fn.define({map:(e,t)=>e.map(t)}),f2e=Fn.define();function hl(e,t,n){let i=e.facet(a2e);i.length?i[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}const zf=Zt.define({combine:e=>e.length?e[0]:!0});let jEt=0;const My=Zt.define({combine(e){return e.filter((t,n)=>{for(let i=0;i{let c=[];return a&&c.push(wI.of(u=>{let d=u.plugin(l);return d?a(d):gn.none})),s&&c.push(s(l)),c})}static fromClass(t,n){return Ts.define((i,r)=>new t(i,r),n)}}class a5{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(t){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(i){if(hl(n.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(t,this.spec.arg)}catch(n){hl(t.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(i){hl(t.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const h2e=Zt.define(),JU=Zt.define(),wI=Zt.define(),p2e=Zt.define(),eQ=Zt.define(),ME=Zt.define(),m2e=Zt.define();function IZ(e,t){let n=e.state.facet(m2e);if(!n.length)return n;let i=n.map(s=>s instanceof Function?s(e):s),r=[];return xi.spans(i,t.from,t.to,{point(){},span(s,a,l,c){let u=s-t.from,d=a-t.from,f=r;for(let h=l.length-1;h>=0;h--,c--){let p=l[h].spec.bidiIsolate,g;if(p==null&&(p=NEt(t.text,u,d)),c>0&&f.length&&(g=f[f.length-1]).to==u&&g.direction==p)g.to=d,f=g.inner;else{let b={from:u,to:d,direction:p,inner:[]};f.push(b),f=b.inner}}}}),r}const g2e=Zt.define();function tQ(e){let t=0,n=0,i=0,r=0;for(let s of e.state.facet(g2e)){let a=s(e);a&&(a.left!=null&&(t=Math.max(t,a.left)),a.right!=null&&(n=Math.max(n,a.right)),a.top!=null&&(i=Math.max(i,a.top)),a.bottom!=null&&(r=Math.max(r,a.bottom)))}return{left:t,right:n,top:i,bottom:r}}const zw=Zt.define();class Gc{constructor(t,n,i,r){this.fromA=t,this.toA=n,this.fromB=i,this.toB=r}join(t){return new Gc(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let n=t.length,i=this;for(;n>0;n--){let r=t[n-1];if(!(r.fromA>i.toA)){if(r.toAr.push(new Gc(s,a,l,c))),this.changedRanges=r}static create(t,n,i){return new IN(t,n,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const REt=[];class Cs{constructor(t,n,i=0){this.dom=t,this.length=n,this.flags=i,this.parent=null,t.cmTile=this}get breakAfter(){return this.flags&1}get children(){return REt}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(t){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&pEt(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(t){this.dom=t,t.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t,n=this.posAtStart){let i=n;for(let r of this.children){if(r==t)return i;i+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}covers(t){return!0}coordsIn(t,n,i){return null}domPosFor(t,n){let i=Am(this.dom),r=this.length?t>0:n>0;return new Nu(this.parent.dom,i+(r?1:0),t==0||t==this.length)}markDirty(t){this.flags&=-3,t&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let t=this;t;t=t.parent)if(t instanceof SI)return t;return null}static get(t){return t.cmTile}}class OI extends Cs{constructor(t){super(t,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(t){this.children.push(t),t.parent=this}sync(t){if(this.flags&2)return;super.sync(t);let n=this.dom,i=null,r,s=(t==null?void 0:t.node)==n?t:null,a=0;for(let l of this.children){if(l.sync(t),a+=l.length+l.breakAfter,r=i?i.nextSibling:n.firstChild,s&&r!=l.dom&&(s.written=!0),l.dom.parentNode==n)for(;r&&r!=l.dom;)r=PZ(r);else n.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:n.firstChild,s&&r&&(s.written=!0);r;)r=PZ(r);this.length=a}}function PZ(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class SI extends OI{constructor(t,n){super(n),this.view=t}owns(t){for(;t;t=t.parent)if(t==this)return!0;return!1}isBlock(){return!0}nearest(t){for(;;){if(!t)return null;let n=Cs.get(t);if(n&&this.owns(n))return n;t=t.parentNode}}blockTiles(t){for(let n=[],i=this,r=0,s=0;;)if(r==i.children.length){if(!n.length)return;i=i.parent,i.breakAfter&&s++,r=n.pop()}else{let a=i.children[r++];if(a instanceof dh)n.push(r),i=a,r=0;else{let l=s+a.length,c=t(a,s);if(c!==void 0)return c;s=l+a.breakAfter}}}resolveBlock(t,n){let i,r=-1,s,a=-1;if(this.blockTiles((l,c)=>{let u=c+l.length;if(t>=c&&t<=u){if(l.isWidget()&&n>=-1&&n<=1){if(l.flags&32)return!0;l.flags&16&&(i=void 0)}(ct||t==c&&(n>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,a=t-c)}}),!i&&!s)throw new Error("No tile at position "+t);return i&&n<0||!s?{tile:i,offset:r}:{tile:s,offset:a}}}class dh extends OI{constructor(t,n){super(t),this.wrapper=n}isBlock(){return!0}covers(t){return this.children.length?t<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let i=new dh(n||document.createElement(t.tagName),t);return n||(i.flags|=4),i}}class rx extends OI{constructor(t,n){super(t),this.attrs=n}isLine(){return!0}static start(t,n,i){let r=new rx(n||document.createElement("div"),t);return(!n||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(t,n,i){let r=null,s=-1,a=null,l=-1;function c(d,f){for(let h=0,p=0;h=f&&(g.isComposite()?c(g,f-p):(!a||a.isHidden&&(n>0&&!(a.flags&32)||i&&PEt(a,g)))&&(b>f||g.flags&32)?(a=g,l=f-p):(pr&&(t=r);let s=t,a=t,l=0;t==0&&n<0||t==r&&n>=0?Xt.chrome||Xt.gecko||(t?(s--,l=1):a=0)?0:c.length-1];return Xt.safari&&!l&&u.width==0&&(u=Array.prototype.find.call(c,d=>d.width)||u),i==null?u:ik(u,(l?l>0:n<0)==i)}static of(t,n){let i=new Qg(n||document.createTextNode(t),t);return n||(i.flags|=2),i}}class Rb extends Cs{constructor(t,n,i,r){super(t,n,r),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(t){return this.flags&48?!1:(this.flags&(t<0?64:128))>0}coordsIn(t,n){return this.coordsInWidget(t,n,!1)}coordsInWidget(t,n,i){let r=this.widget.coordsAt(this.dom,t,n);if(r)return r;if(i)return ik(this.dom.getBoundingClientRect(),this.length?t==0:n<=0);{let s=this.dom.getClientRects(),a=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:t>0;for(let c=l?s.length-1:0;a=s[c],!(t>0?c==0:c==s.length-1||a.top0==i)}}class DEt{constructor(t){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=t}advance(t,n,i){let{tile:r,index:s,beforeBreak:a,parents:l}=this;for(;t||n>0;)if(r.isComposite())if(a){if(!t)break;i&&i.break(),t--,a=!1}else if(s==r.children.length){if(!t&&!l.length)break;i&&i.leave(r),a=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++}else{let c=r.children[s],u=c.breakAfter;(n>0?c.length<=t:c.length=0;l--){let c=n.marks[l],u=r.lastChild;if(u instanceof ul&&u.mark.eq(c.mark))u.dom!=c.dom&&u.setDOM(o5(c.dom)),r=u;else{if(this.cache.reused.get(c)){let f=Cs.get(c.dom);f&&f.setDOM(o5(c.dom))}let d=ul.of(c.mark,c.dom);r.append(d),r=d}this.cache.reused.set(c,2)}let s=Cs.get(t.text);s&&this.cache.reused.set(s,2);let a=new Qg(t.text,t.text.nodeValue);a.flags|=8,this.pos=t.range.toB,r.append(a)}addInlineWidget(t,n,i){let r=this.afterWidget&&t.flags&48&&(this.afterWidget.flags&48)==(t.flags&48);r||this.flushBuffer();let s=this.ensureMarks(n,i);!r&&!(t.flags&16)&&s.append(this.getBuffer(1)),s.append(t),this.pos+=t.length,this.afterWidget=t}addMark(t,n,i){this.flushBuffer(),this.ensureMarks(n,i).append(t),this.pos+=t.length,this.afterWidget=null}addBlockWidget(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}continueWidget(t){let n=this.afterWidget||this.lastBlock;n.length+=t,this.pos+=t}addLineStart(t,n){var i;t||(t=b2e);let r=rx.start(t,n||((i=this.cache.find(rx))===null||i===void 0?void 0:i.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(t){this.blockPosCovered()||this.addLineStart(t)}ensureLine(t){this.curLine||this.addLineStart(t)}ensureMarks(t,n){var i;let r=this.curLine;for(let s=t.length-1;s>=0;s--){let a=t[s],l;if(n>0&&(l=r.lastChild)&&l instanceof ul&&l.mark.eq(a))r=l,n--;else{let c=ul.of(a,(i=this.cache.find(ul,u=>u.mark.eq(a)))===null||i===void 0?void 0:i.dom);r.append(c),r=c,n=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let t=this.curLine.lastChild;(!t||!DZ(this.curLine,!1)||t.dom.nodeName!="BR"&&t.isWidget()&&!(Xt.ios&&DZ(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(l5,0,32)||new Rb(l5.toDOM(),0,l5,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let t=this.wrappers.length-1;t>=0;t--)this.wrappers[t].to=this.pos){let n=t.rank*102+t.value.rank,i=new MEt(t.from,t.to,t.value,n),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-i.rank||this.wrappers[r-1].to-i.to)<0;)r--;this.wrappers.splice(r,0,i)}this.wrapperPos=this.pos}getBlockPos(){var t;this.updateBlockWrappers();let n=this.root;for(let i of this.wrappers){let r=n.lastChild;if(i.froma.wrapper.eq(i.wrapper)))===null||t===void 0?void 0:t.dom);n.append(s),n=s}}return n}blockPosCovered(){let t=this.lastBlock;return t!=null&&!t.breakAfter&&(!t.isWidget()||(t.flags&160)>0)}getBuffer(t){let n=2|(t<0?16:32),i=this.cache.find(PN,void 0,1);return i&&(i.flags=n),i||new PN(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class $Et{constructor(t){this.skipCount=0,this.text="",this.textOff=0,this.cursor=t.iter()}skip(t){this.textOff+t<=this.text.length?this.textOff+=t:(this.skipCount+=t-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(t){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:a}=this.cursor.next(this.skipCount);if(this.skipCount=0,a)throw new Error("Ran out of text content when drawing inline views");this.text=r;let l=this.textOff=Math.min(t,r.length);return s?null:r.slice(0,l)}let n=Math.min(this.text.length,this.textOff+t),i=this.text.slice(this.textOff,n);return this.textOff=n,i}}const DN=[Rb,rx,Qg,ul,PN,dh,SI];for(let e=0;e[]),this.index=DN.map(()=>0),this.reused=new Map}add(t){let n=t.constructor.bucket,i=this.buckets[n];i.length<6?i.push(t):i[this.index[n]=(this.index[n]+1)%6]=t}find(t,n,i=2){let r=t.bucket,s=this.buckets[r],a=this.index[r];for(let l=0;l{if(this.cache.add(a),a.isComposite())return!1},enter:a=>this.cache.add(a),leave:()=>{},break:()=>{}}}run(t,n){let i=n&&this.getCompositionContext(n.text);for(let r=0,s=0,a=0;;){let l=ar){let u=c-r;this.preserve(u,!a,!l),r=c,s+=u}if(!l)break;n&&l.fromA<=n.range.fromA&&l.toA>=n.range.toA?(this.forward(l.fromA,n.range.fromA,n.range.fromA{if(a.isWidget())if(this.openWidget)this.builder.continueWidget(c-l);else{let u=c>0||l{a.isLine()?this.builder.addLineStart(a.attrs,this.cache.maybeReuse(a)):(this.cache.add(a),a instanceof ul&&r.unshift(a.mark)),this.openWidget=!1},leave:a=>{a.isLine()?r.length&&(r.length=s=0):a instanceof ul&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(t)}emit(t,n){let i=null,r=this.builder,s=-1,a=xi.spans(this.decorations,t,n,{point:(l,c,u,d,f,h)=>{if(u instanceof Nb){if(this.disallowBlockEffectsFor[h]){if(u.block)throw new RangeError("Block decorations may not be specified via plugins");if(c>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=d.length,f>d.length)r.continueWidget(c-l);else{let p=u.widget||(u.block?sx.block:sx.inline),g=UEt(u),b=this.cache.findWidget(p,c-l,g)||Rb.of(p,this.view,c-l,g);u.block?(u.startSide>0&&r.addLineStartIfNotCovered(i),r.addBlockWidget(b)):(r.ensureLine(i),r.addInlineWidget(b,d,f))}i=null}else i=QEt(i,u);c>l&&this.text.skip(c-l)},span:(l,c,u,d)=>{for(let f=l;f-1&&(this.openWidget=a>s),this.openWidget||r.addLineStartIfNotCovered(i),this.openMarks=a}forward(t,n,i=1){n-t<=10?this.old.advance(n-t,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-t-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(t){let n=[],i=null;for(let r=t.parentNode;;r=r.parentNode){let s=Cs.get(r);if(r==this.view.contentDOM)break;s instanceof ul?n.push(s):s!=null&&s.isLine()?i=s:s instanceof dh||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new rx(r,b2e):i||n.push(ul.of(new PE({tagName:r.nodeName.toLowerCase(),attributes:mEt(r)}),r)))}return{line:i,marks:n}}}function DZ(e,t){let n=i=>{for(let r of i.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}function UEt(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}const b2e={class:"cm-line"};function QEt(e,t){let n=t.spec.attributes,i=t.spec.class;return!n&&!i||(e||(e={class:"cm-line"}),n&&GU(n,e),i&&(e.class+=" "+i)),e}function zEt(e){let t=[];for(let n=e.parents.length;n>1;n--){let i=n==e.parents.length?e.tile:e.parents[n].tile;i instanceof ul&&t.push(i.mark)}return t}function o5(e){let t=Cs.get(e);return t&&t.setDOM(e.cloneNode()),e}class sx extends Yu{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}sx.inline=new sx("span");sx.block=new sx("div");const l5=new class extends Yu{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class MZ{constructor(t){this.view=t,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=gn.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new SI(t,t.contentDOM),this.updateInner([new Gc(0,0,0,t.state.doc.length)],null)}update(t){var n;let i=t.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:d,toA:f})=>fthis.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?r=this.domChanged.newSel.head:!ZEt(t.changes,this.hasComposition)&&!t.selectionSet&&(r=t.state.selection.main.head));let s=r>-1?HEt(this.view,t.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:f}=this.hasComposition;i=new Gc(d,f,t.changes.mapPos(d,-1),t.changes.mapPos(f,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(Xt.ie||Xt.chrome)&&!s&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,l=this.blockWrappers;this.updateDeco();let c=GEt(a,this.decorations,t.changes);c.length&&(i=Gc.extendWithRanges(i,c));let u=XEt(l,this.blockWrappers,t.changes);return u.length&&(i=Gc.extendWithRanges(i,u)),s&&!i.some(d=>d.fromA<=s.range.fromA&&d.toA>=s.range.toA)&&(i=s.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,s),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,n){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(n||t.length){let a=this.tile,l=new BEt(this.view,a,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&Cs.get(n.text)&&l.cache.reused.set(Cs.get(n.text),2),this.tile=l.run(t,n),P$(a,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=Xt.chrome||Xt.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||i.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to-1)&&FO(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(s||n||a))return;let l=this.forceSelection;this.forceSelection=!1;let c=this.view.state.selection.main,u,d;if(c.empty?d=u=this.inlineDOMNearPos(c.anchor,c.assoc||1):(d=this.inlineDOMNearPos(c.head,c.head==c.from?1:-1),u=this.inlineDOMNearPos(c.anchor,c.anchor==c.from?1:-1)),Xt.gecko&&c.empty&&!this.hasComposition&&VEt(u)){let h=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(h,u.node.childNodes[u.offset]||null)),u=d=new Nu(h,0),l=!0}let f=this.view.observer.selectionRange;(l||!f.focusNode||(!UO(u.node,u.offset,f.anchorNode,f.anchorOffset)||!UO(d.node,d.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,c))&&(this.view.observer.ignore(()=>{Xt.android&&Xt.chrome&&i.contains(f.focusNode)&&YEt(f.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let h=nk(this.view.root);if(h)if(c.empty){if(Xt.gecko){let p=qEt(u.node,u.offset);if(p&&p!=3){let g=(p==1?XTe:YTe)(u.node,u.offset);g&&(u=new Nu(g.node,g.offset))}}h.collapse(u.node,u.offset),c.bidiLevel!=null&&h.caretBidiLevel!==void 0&&(h.caretBidiLevel=c.bidiLevel)}else if(h.extend){h.collapse(u.node,u.offset);try{h.extend(d.node,d.offset)}catch{}}else{let p=document.createRange();c.anchor>c.head&&([u,d]=[d,u]),p.setEnd(d.node,d.offset),p.setStart(u.node,u.offset),h.removeAllRanges(),h.addRange(p)}a&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(u,d)),this.impreciseAnchor=u.precise?null:new Nu(f.anchorNode,f.anchorOffset),this.impreciseHead=d.precise?null:new Nu(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(t,n){return this.hasComposition&&n.empty&&UO(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,n=t.state.selection.main,i=nk(t.root),{anchorNode:r,anchorOffset:s}=t.observer.selectionRange;if(!i||!n.empty||!n.assoc||!i.modify)return;let a=this.lineAt(n.head,n.assoc);if(!a)return;let l=a.posAtStart;if(n.head==l||n.head==l+a.length)return;let c=this.coordsAt(n.head,-1),u=this.coordsAt(n.head,1);if(!c||!u||c.bottom>u.top)return;let d=this.domAtPos(n.head+n.assoc,n.assoc);i.collapse(d.node,d.offset),i.modify("move",n.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let f=t.observer.selectionRange;t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&i.collapse(r,s)}posFromDOM(t,n){let i=this.tile.nearest(t);if(!i)return this.tile.dom.compareDocumentPosition(t)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let s;if(t==i.dom)s=i.dom.childNodes[n];else{let a=_h(t)==0?0:n==0?-1:1;for(;;){let l=t.parentNode;if(l==i.dom)break;a==0&&l.firstChild!=l.lastChild&&(t==l.firstChild?a=-1:a=1),t=l}a<0?s=t:s=t.nextSibling}if(s==i.dom.firstChild)return r;for(;s&&!Cs.get(s);)s=s.nextSibling;if(!s)return r+i.length;for(let a=0,l=r;;a++){let c=i.children[a];if(c.dom==s)return l;l+=c.length+c.breakAfter}}else return i.isText()?t==i.dom?r+n:r+(n?i.length:0):r}domAtPos(t,n){let{tile:i,offset:r}=this.tile.resolveBlock(t,n);return i.isWidget()?i.domPosFor(r,n):i.domIn(r,n)}inlineDOMNearPos(t,n){let i,r=-1,s=!1,a,l=-1,c=!1;return this.tile.blockTiles((u,d)=>{if(u.isWidget()){if(u.flags&32&&d>=t)return!0;u.flags&16&&(s=!0)}else{let f=d+u.length;if(d<=t&&(i=u,r=t-d,s=f=t&&!a&&(a=u,l=t-d,c=d>t),d>t&&a)return!0}}),!i&&!a?this.domAtPos(t,n):(s&&a?i=null:c&&i&&(a=null),i&&n<0||!a?i.domIn(r,n):a.domIn(l,n))}coordsAt(t,n,i){let{tile:r,offset:s}=this.tile.resolveBlock(t,n);return r.isWidget()?r.widget instanceof c5?null:r.coordsInWidget(s,n,!0):r.coordsIn(s,n,i)}lineAt(t,n){let{tile:i}=this.tile.resolveBlock(t,n);return i.isLine()?i:null}coordsForChar(t){let{tile:n,offset:i}=this.tile.resolveBlock(t,1);if(!n.isLine())return null;function r(s,a){if(s.isComposite())for(let l of s.children){if(l.length>=a){let c=r(l,a);if(c)return c}if(a-=l.length,a<0)break}else if(s.isText()&&aMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,c=this.view.textDirection==Cr.LTR,u=0,d=(f,h,p)=>{for(let g=0;gr);g++){let b=f.children[g],v=h+b.length,y=b.dom.getBoundingClientRect(),{height:x}=y;if(p&&!g&&(u+=y.top-p.top),b instanceof dh)v>i&&d(b,h,y);else if(h>=i&&(u>0&&n.push(-u),n.push(x+u),u=0,a)){let O=b.dom.lastChild,w=O?BO(O):[];if(w.length){let k=w[w.length-1],S=c?k.right-y.left:y.right-k.left;S>l&&(l=S,this.minWidth=s,this.minWidthFrom=h,this.minWidthTo=v)}}p&&g==f.children.length-1&&(u+=p.bottom-y.bottom),h=v+b.breakAfter}};return d(this.tile,0,null),n}textDirectionAt(t){let{tile:n}=this.tile.resolveBlock(t,1);return getComputedStyle(n.dom).direction=="rtl"?Cr.RTL:Cr.LTR}measureTextSize(){let t=this.tile.blockTiles(a=>{if(a.isLine()&&a.children.length&&a.length<=20){let l=0,c;for(let u of a.children){if(!u.isText()||/[^ -~]/.test(u.text))return;let d=BO(u.dom);if(d.length!=1)return;l+=d[0].width,c=d[0].height}if(l)return{lineHeight:a.dom.getBoundingClientRect().height,charWidth:l/a.length,textHeight:c}}});if(t)return t;let n=document.createElement("div"),i,r,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let a=BO(n.firstChild)[0];i=n.getBoundingClientRect().height,r=a&&a.width?a.width/27:7,s=a&&a.height?a.height:i,n.remove()}),{lineHeight:i,charWidth:r,textHeight:s}}computeBlockGapDeco(){let t=[],n=this.view.viewState;for(let i=0,r=0;;r++){let s=r==n.viewports.length?null:n.viewports[r],a=s?s.from-1:this.view.state.doc.length;if(a>i){let l=(n.lineBlockAt(a).bottom-n.lineBlockAt(i).top)/this.view.scaleY;t.push(gn.replace({widget:new c5(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,a))}if(!s)break;i=s.to+1}return gn.set(t)}updateDeco(){let t=1,n=this.view.state.facet(wI).map(s=>(this.dynamicDecorationMap[t++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(eQ).map((s,a)=>{let l=typeof s=="function";return l&&(i=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[t++]=i,n.push(xi.join(r))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];ttypeof s=="function"?s(this.view):s)}scrollIntoView(t){if(t.isSnapshot){let u=this.view.viewState.lineBlockAt(t.range.head);this.view.scrollDOM.scrollTop=u.top-t.yMargin,this.view.scrollDOM.scrollLeft=t.xMargin;return}for(let u of this.view.state.facet(d2e))try{if(u(this.view,t.range,t))return!0}catch(d){hl(this.view.state,d,"scroll handler")}let{range:n}=t,i=this.coordsAt(n.head,n.assoc||(n.head>n.anchor?-1:1)),r;if(!i)return;!n.empty&&(r=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let s=tQ(this.view),a={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:l,offsetHeight:c}=this.view.scrollDOM;if(yEt(this.view.scrollDOM,a,n.head1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottomi.isWidget()||i.children.some(n);return n(this.tile.resolveBlock(t,1).tile)}destroy(){P$(this.tile)}}function P$(e,t){let n=t==null?void 0:t.get(e);if(n!=1){n==null&&e.destroy();for(let i of e.children)P$(i,t)}}function VEt(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable=="false")&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable=="false")}function y2e(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let i=XTe(n.focusNode,n.focusOffset),r=YTe(n.focusNode,n.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let l=Cs.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(e.docView.lastCompositionAfterCursor){let c=Cs.get(i.node);!c||c.isText()&&c.text!=i.node.nodeValue||(s=r)}}if(e.docView.lastCompositionAfterCursor=s!=i,!s)return null;let a=t-s.offset;return{from:a,to:a+s.node.nodeValue.length,node:s.node}}function HEt(e,t,n){let i=y2e(e,n);if(!i)return null;let{node:r,from:s,to:a}=i,l=r.nodeValue;if(/[\n\r]/.test(l)||e.state.doc.sliceString(i.from,i.to)!=l)return null;let c=t.invertedDesc;return{range:new Gc(c.mapPos(s),c.mapPos(a),s,a),text:r}}function qEt(e,t){return e.nodeType!=1?0:(t&&e.childNodes[t-1].contentEditable=="false"?1:0)|(t{it.from&&(n=!0)}),n}class c5 extends Yu{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function JEt(e,t,n=1){let i=e.charCategorizer(t),r=e.doc.lineAt(t),s=t-r.from;if(r.length==0)return tt.cursor(t);s==0?n=1:s==r.length&&(n=-1);let a=s,l=s;n<0?a=$a(r.text,s,!1):l=$a(r.text,s);let c=i(r.text.slice(a,l));for(;a>0;){let u=$a(r.text,a,!1);if(i(r.text.slice(u,a))!=c)break;a=u}for(;le.defaultLineHeight*1.5){let l=e.viewState.heightOracle.textHeight,c=Math.floor((r-n.top-(e.defaultLineHeight-l)*.5)/l);s+=c*e.viewState.heightOracle.lineLength}let a=e.state.sliceDoc(n.from,n.to);return n.from+O$(a,s,e.state.tabSize)}function D$(e,t,n){let i=e.lineBlockAt(t);if(Array.isArray(i.type)){let r;for(let s of i.type){if(s.from>t)break;if(!(s.tot)return s;(!r||s.type==io.Text&&(r.type!=s.type||(n<0?s.fromt)))&&(r=s)}}return r||i}return i}function tCt(e,t,n,i){let r=D$(e,t.head,t.assoc||-1),s=!i||r.type!=io.Text||!(e.lineWrapping||r.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head);if(s){let a=e.dom.getBoundingClientRect(),l=e.textDirectionAt(r.from),c=e.posAtCoords({x:n==(l==Cr.LTR)?a.right-1:a.left+1,y:(s.top+s.bottom)/2});if(c!=null)return tt.cursor(c,n?-1:1)}return tt.cursor(n?r.to:r.from,n?-1:1)}function LZ(e,t,n,i){let r=e.state.doc.lineAt(t.head),s=e.bidiSpans(r),a=e.textDirectionAt(r.from);for(let l=t,c=null;;){let u=_Et(r,s,a,l,n),d=n2e;if(!u){if(r.number==(n?e.state.doc.lines:1))return l;d=` +`,r=e.state.doc.line(r.number+(n?1:-1)),s=e.bidiSpans(r),u=e.visualLineSide(r,!n)}if(c){if(!c(d))return l}else{if(!i)return u;c=i(d)}l=u}}function nCt(e,t,n){let i=e.state.charCategorizer(t),r=i(n);return s=>{let a=i(s);return r==ns.Space&&(r=a),r==a}}function iCt(e,t,n,i){let r=t.head,s=n?1:-1;if(r==(n?e.state.doc.length:0))return tt.cursor(r,t.assoc);let a=t.goalColumn,l,c=e.contentDOM.getBoundingClientRect(),u=e.coordsAtPos(r,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),d=e.documentTop;if(u)a==null&&(a=u.left-c.left),l=s<0?u.top:u.bottom;else{let g=e.viewState.lineBlockAt(r);a==null&&(a=Math.min(c.right-c.left,e.defaultCharacterWidth*(r-g.from))),l=(s<0?g.top:g.bottom)+d}let f=c.left+a,h=e.viewState.heightOracle.textHeight>>1,p=i??h;for(let g=0;;g+=h){let b=l+(p+g)*s,v=M$(e,{x:f,y:b},!1,s);if(n?b>c.bottom:bl:x{if(t>s&&tr(e)),n.from,t.head>n.from?-1:1);return i==n.from?n:tt.cursor(i,ie.viewState.docHeight)return new xd(e.state.doc.length,-1);if(u=e.elementAtHeight(c),i==null)break;if(u.type==io.Text){if(i<0?u.toe.viewport.to)break;let h=e.docView.coordsAt(i<0?u.from:u.to,i>0?-1:1);if(h&&(i<0?h.top<=c+s:h.bottom>=c+s))break}let f=e.viewState.heightOracle.textHeight/2;c=i>0?u.bottom+f:u.top-f}if(e.viewport.from>=u.to||e.viewport.to<=u.from){if(n)return null;if(u.type==io.Text){let f=eCt(e,r,u,a,l);return new xd(f,f==u.from?1:-1)}}if(u.type!=io.Text)return c<(u.top+u.bottom)/2?new xd(u.from,1):new xd(u.to,-1);let d=e.docView.lineAt(u.from,2);return(!d||d.length!=u.length)&&(d=e.docView.lineAt(u.from,-2)),new rCt(e,a,l,e.textDirectionAt(u.from)).scanTile(d,u.from)}class rCt{constructor(t,n,i,r){this.view=t,this.x=n,this.y=i,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(t){return(!this.line||this.line.from>t||this.line.to1||i.length&&(i[0].level!=this.baseDir||i[0].to+r.from>1;t:if(a.has(b)){let y=r+Math.floor(Math.random()*g);for(let x=0;x1)){if(x.bottomthis.y)(!u||u.top>x.top)&&(u=x),O=-1;else{let w=x.left>this.x?this.x-x.left:x.right(g+g+b)/3)return this.y=c.bottom-1,this.scan(t,n,!0);if(u&&u.top<(g+b+b)/3)return this.y=u.top+1,this.scan(t,n,!0)}let p=(l?this.dirAt(t[d],1):this.baseDir)==Cr.LTR;return{i:d,after:this.x>(h.left+h.right)/2==p}}scanText(t,n){let i=[];for(let s=0;s{let a=i[s]-n,l=i[s+1]-n;return rk(t.dom,a,l).getClientRects()});return r.after?new xd(i[r.i+1],-1):new xd(i[r.i],1)}scanTile(t,n){if(!t.length)return new xd(n,1);if(t.children.length==1){let l=t.children[0];if(l.isText())return this.scanText(l,n);if(l.isComposite())return this.scanTile(l,n)}let i=[n];for(let l=0,c=n;l{let c=t.children[l];return c.flags&48?null:(c.dom.nodeType==1?c.dom:rk(c.dom,0,c.length)).getClientRects()}),s=t.children[r.i],a=i[r.i];return s.isText()?this.scanText(s,a):s.isComposite()?this.scanTile(s,a):r.after?new xd(i[r.i+1],-1):new xd(a,1)}}const sy="￿";class sCt{constructor(t,n){this.points=t,this.view=n,this.text="",this.lineSeparator=n.state.facet(Ti.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=sy}readRange(t,n){if(!t)return this;let i=t.parentNode;for(let r=t;;){this.findPointBefore(i,r);let s=this.text.length;this.readNode(r);let a=Cs.get(r),l=r.nextSibling;if(l==n){a!=null&&a.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let c=Cs.get(l);(a&&c?a.breakAfter:(a?a.breakAfter:RN(r))||RN(l)&&(r.nodeName!="BR"||a!=null&&a.isWidget())&&this.text.length>s)&&!oCt(l,n)&&this.lineBreak(),r=l}return this.findPointBefore(i,n),this}readTextNode(t){let n=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,n.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,a=1,l;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,i),a=this.lineSeparator.length):(l=r.exec(n))&&(s=l.index,a=l[0].length),this.append(n.slice(i,s<0?n.length:s)),s<0)break;if(this.lineBreak(),a>1)for(let c of this.points)c.node==t&&c.pos>this.text.length&&(c.pos-=a-1);i=s+a}}readNode(t){let n=Cs.get(t),i=n&&n.overrideDOMText;if(i!=null){this.findPointInside(t,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,n){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==n&&(i.pos=this.text.length)}findPointInside(t,n){for(let i of this.points)(t.nodeType==3?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+(aCt(t,i.node,i.offset)?n:0))}}function aCt(e,t,n){for(;;){if(!t||n<_h(t))return!1;if(t==e)return!0;n=Am(t)+1,t=t.parentNode}}function oCt(e,t){let n;for(;!(e==t||!e);e=e.nextSibling){let i=Cs.get(e);if(!(i!=null&&i.isWidget()))return!1;i&&(n||(n=[])).push(i)}if(n)for(let i of n){let r=i.overrideDOMText;if(r!=null&&r.length)return!1}return!0}class $Z{constructor(t,n){this.node=t,this.offset=n,this.pos=-1}}class lCt{constructor(t,n,i,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:s,impreciseAnchor:a}=t.docView,l=t.state.selection;if(t.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=x2e(t.docView.tile,n,i,0))){let c=s||a?[]:uCt(t),u=new sCt(c,t);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=dCt(c,this.bounds.from)}else{let c=t.observer.selectionRange,u=s&&s.node==c.focusNode&&s.offset==c.focusOffset||!_$(t.contentDOM,c.focusNode)?l.main.head:t.docView.posFromDOM(c.focusNode,c.focusOffset),d=a&&a.node==c.anchorNode&&a.offset==c.anchorOffset||!_$(t.contentDOM,c.anchorNode)?l.main.anchor:t.docView.posFromDOM(c.anchorNode,c.anchorOffset),f=t.viewport;if((Xt.ios||Xt.chrome)&&u!=d&&Math.min(u,d)<=l.main.from&&Math.max(u,d)>=l.main.to&&(f.from>0||f.to-1&&l.ranges.length>1)this.newSel=l.replaceRange(tt.range(d,u));else if(t.lineWrapping&&d==u&&!(l.main.empty&&l.main.head==u)&&t.inputState.lastTouchTime>Date.now()-100){let h=t.coordsAtPos(u,-1),p=0;h&&(p=t.inputState.lastTouchY<=h.bottom?-1:1),this.newSel=tt.create([tt.cursor(u,p)])}else this.newSel=tt.single(d,u)}}}function x2e(e,t,n,i){if(e.isComposite()){let r=-1,s=-1,a=-1,l=-1;for(let c=0,u=i,d=i;cn)return x2e(f,t,n,u);if(h>=t&&r==-1&&(r=c,s=u),u>n&&f.dom.parentNode==e.dom){a=c,l=d;break}d=h,u=h+f.breakAfter}return{from:s,to:l<0?i+e.length:l,startDOM:(r?e.children[r-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:a=0?e.children[a].dom:null}}else return e.isText()?{from:i,to:i+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function w2e(e,t){let n,{newSel:i}=t,{state:r}=e,s=r.selection.main,a=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:l,to:c}=t.bounds,u=s.from,d=null;(a===8||Xt.android&&t.text.length=l&&s.to<=c&&(t.typeOver||f!=t.text)&&f.slice(0,s.from-l)==t.text.slice(0,s.from-l)&&f.slice(s.to-l)==t.text.slice(h=t.text.length-(f.length-(s.to-l)))?n={from:s.from,to:s.to,insert:Gi.of(t.text.slice(s.from-l,h).split(sy))}:(p=O2e(f,t.text,u-l,d))&&(Xt.chrome&&a==13&&p.toB==p.from+2&&t.text.slice(p.from,p.toB)==sy+sy&&p.toB--,n={from:l+p.from,to:l+p.toA,insert:Gi.of(t.text.slice(p.from,p.toB).split(sy))})}else i&&(!e.hasFocus&&r.facet(zf)||MN(i,s))&&(i=null);if(!n&&!i)return!1;if((Xt.mac||Xt.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute("autocorrect")=="off"?(i&&n.insert.length==2&&(i=tt.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:Gi.of([n.insert.toString().replace("."," ")])}):r.doc.lineAt(s.from).toDate.now()-50?n={from:s.from,to:s.to,insert:r.toText(e.inputState.insertingText)}:Xt.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==` + `&&e.lineWrapping&&(i&&(i=tt.single(i.main.anchor-1,i.main.head-1)),n={from:s.from,to:s.to,insert:Gi.of([" "])}),n)return nQ(e,n,i,a);if(i&&!MN(i,s)){let l=!1,c="select";return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin=="select"&&(l=!0),c=e.inputState.lastSelectionOrigin,c=="select.pointer"&&(i=v2e(r.facet(ME).map(u=>u(e)),i))),e.dispatch({selection:i,scrollIntoView:l,userEvent:c}),!0}else return!1}function nQ(e,t,n,i=-1){if(Xt.ios&&e.inputState.flushIOSKey(t))return!0;let r=e.state.selection.main;if(Xt.android&&(t.to==r.to&&(t.from==r.from||t.from==r.from-1&&e.state.sliceDoc(t.from,r.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&dv(e.contentDOM,"Enter",13)||(t.from==r.from-1&&t.to==r.to&&t.insert.length==0||i==8&&t.insert.lengthr.head)&&dv(e.contentDOM,"Backspace",8)||t.from==r.from&&t.to==r.to+1&&t.insert.length==0&&dv(e.contentDOM,"Delete",46)))return!0;let s=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let a,l=()=>a||(a=cCt(e,t,n));return e.state.facet(o2e).some(c=>c(e,t.from,t.to,s,l))||e.dispatch(l()),!0}function cCt(e,t,n){let i,r=e.state,s=r.selection.main,a=-1;if(t.from==t.to&&t.froms.to){let c=t.fromf(e)),u,c);t.from==d&&(a=d)}if(a>-1)i={changes:t,selection:tt.cursor(t.from+t.insert.length,-1)};else if(t.from>=s.from&&t.to<=s.to&&t.to-t.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let c=s.fromt.to?r.sliceDoc(t.to,s.to):"";i=r.replaceSelection(e.state.toText(c+t.insert.sliceString(0,void 0,e.state.lineBreak)+u))}else{let c=r.changes(t),u=n&&n.main.to<=c.newLength?n.main:void 0;if(r.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=s.to+10&&t.to>=s.to-10){let d=e.state.sliceDoc(t.from,t.to),f,h=n&&y2e(e,n.main.head);if(h){let g=t.insert.length-(t.to-t.from);f={from:h.from,to:h.to-g}}else f=e.state.doc.lineAt(s.head);let p=s.to-t.to;i=r.changeByRange(g=>{if(g.from==s.from&&g.to==s.to)return{changes:c,range:u||g.map(c)};let b=g.to-p,v=b-d.length;if(e.state.sliceDoc(v,b)!=d||b>=f.from&&v<=f.to)return{range:g};let y=r.changes({from:v,to:b,insert:t.insert}),x=g.to-s.to;return{changes:y,range:u?tt.range(Math.max(0,u.anchor+x),Math.max(0,u.head+x)):g.map(y)}})}else i={changes:c,selection:u&&r.selection.replaceRange(u)}}let l="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,l+=".compose",e.inputState.compositionFirstChange&&(l+=".start",e.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:l,scrollIntoView:!0})}function O2e(e,t,n,i){let r=Math.min(e.length,t.length),s=0;for(;s0&&l>0&&e.charCodeAt(a-1)==t.charCodeAt(l-1);)a--,l--;if(i=="end"){let c=Math.max(0,s-Math.min(a,l));n-=a+c-s}if(a=a?s-n:0;s-=c,l=s+(l-a),a=s}else if(l=l?s-n:0;s-=c,a=s+(a-l),l=s}return{from:s,toA:a,toB:l}}function uCt(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}=e.observer.selectionRange;return n&&(t.push(new $Z(n,i)),(r!=n||s!=i)&&t.push(new $Z(r,s))),t}function dCt(e,t){if(e.length==0)return null;let n=e[0].pos,i=e.length==2?e[1].pos:n;return n>-1&&i>-1?tt.single(n+t,i+t):null}function MN(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class fCt{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,Xt.safari&&t.contentDOM.addEventListener("input",()=>null),Xt.gecko&&ACt(t.contentDOM.ownerDocument)}handleEvent(t){!wCt(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(t.type,t)):this.runHandlers(t.type,t))}runHandlers(t,n){let i=this.handlers[t];if(i){for(let r of i.observers)r(this.view,n);for(let r of i.handlers){if(n.defaultPrevented)break;if(r(this.view,n)){n.preventDefault();break}}}}ensureHandlers(t){let n=pCt(t),i=this.handlers,r=this.view.contentDOM;for(let s in n)if(s!="scroll"){let a=!n[s].handlers.length,l=i[s];l&&a!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:a})}for(let s in i)s!="scroll"&&!n[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&k2e.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),Xt.android&&Xt.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;if(Xt.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&(S2e.some(n=>n.keyCode==t.keyCode)&&!t.ctrlKey||mCt.indexOf(t.key)>-1&&t.ctrlKey)){let n={ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey,shiftKey:t.shiftKey};return n.shiftKey&&Xt.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&hCt(this.view.win)&&(n.shiftKey=!1),this.pendingIOSKey={key:t.key,keyCode:t.keyCode,mods:n},setTimeout(()=>this.flushIOSKey(),250),!0}return t.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(t){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&t&&t.from0?!0:Xt.safari&&!Xt.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function hCt(e){return e.visualViewport?e.visualViewport.height*e.visualViewport.scale/e.document.documentElement.clientHeight<.85:!1}function FZ(e,t){return(n,i)=>{try{return t.call(e,i,n)}catch(r){hl(n.state,r)}}}function pCt(e){let t=Object.create(null);function n(i){return t[i]||(t[i]={observers:[],handlers:[]})}for(let i of e){let r=i.spec,s=r&&r.plugin.domEventHandlers,a=r&&r.plugin.domEventObservers;if(s)for(let l in s){let c=s[l];c&&n(l).handlers.push(FZ(i.value,c))}if(a)for(let l in a){let c=a[l];c&&n(l).observers.push(FZ(i.value,c))}}for(let i in Qu)n(i).handlers.push(Qu[i]);for(let i in Vo)n(i).observers.push(Vo[i]);return t}const S2e=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],mCt="dthko",k2e=[16,17,18,20,91,92,224,225],XT=6;function YT(e){return Math.max(0,e)*.7+8}function gCt(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}class bCt{constructor(t,n,i,r){this.view=t,this.startEvent=n,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=WTe(t.contentDOM),this.atoms=t.state.facet(ME).map(a=>a(t));let s=t.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=t.state.facet(Ti.allowMultipleSelections)&&yCt(t,n),this.dragging=xCt(t,n)&&T2e(n)==1?null:!1}start(t){this.dragging===!1&&this.select(t)}move(t){if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&gCt(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let n=0,i=0,r=0,s=0,a=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let c=tQ(this.view);t.clientX-c.left<=r+XT?n=-YT(r-t.clientX):t.clientX+c.right>=a-XT&&(n=YT(t.clientX-a)),t.clientY-c.top<=s+XT?i=-YT(s-t.clientY):t.clientY+c.bottom>=l-XT&&(i=YT(t.clientY-l)),this.setScrollSpeed(n,i)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,n){this.scrollSpeed={x:t,y:n},t||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:n}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(t||n)&&this.view.win.scrollBy(t,n),this.dragging===!1&&this.select(this.lastEvent)}select(t){let{view:n}=this,i=v2e(this.atoms,this.style.get(t,this.extend,this.multiple));(this.mustSelect||!i.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){t.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function yCt(e,t){let n=e.state.facet(i2e);return n.length?n[0](t):Xt.mac?t.metaKey:t.ctrlKey}function vCt(e,t){let n=e.state.facet(r2e);return n.length?n[0](t):Xt.mac?!t.altKey:!t.ctrlKey}function xCt(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let i=nk(e.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s=t.clientX&&a.top<=t.clientY&&a.bottom>=t.clientY)return!0}return!1}function wCt(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,i;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(i=Cs.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(t))return!1;return!0}const Qu=Object.create(null),Vo=Object.create(null),E2e=Xt.ie&&Xt.ie_version<15||Xt.ios&&Xt.webkit_version<604;function OCt(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),C2e(e,n.value)},50)}function kI(e,t,n){for(let i of e.facet(t))n=i(n,e);return n}function C2e(e,t){t=kI(e.state,YU,t);let{state:n}=e,i,r=1,s=n.toText(t),a=s.lines==n.selection.ranges.length;if(L$!=null&&n.selection.ranges.every(c=>c.empty)&&L$==s.toString()){let c=-1;i=n.changeByRange(u=>{let d=n.doc.lineAt(u.from);if(d.from==c)return{range:u};c=d.from;let f=n.toText((a?s.line(r++).text:t)+n.lineBreak);return{changes:{from:d.from,insert:f},range:tt.cursor(u.from+f.length)}})}else a?i=n.changeByRange(c=>{let u=s.line(r++);return{changes:{from:c.from,to:c.to,insert:u.text},range:tt.cursor(c.from+u.length)}}):i=n.replaceSelection(s);e.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Vo.scroll=e=>{let t=e.inputState;t.lastScrollTop=e.scrollDOM.scrollTop,t.lastScrollLeft=e.scrollDOM.scrollLeft,Xt.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())};Vo.wheel=Vo.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()};Qu.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1);Vo.touchstart=(e,t)=>{let n=e.inputState,i=t.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),i&&(n.lastTouchX=i.clientX,n.lastTouchY=i.clientY),n.setSelectionOrigin("select.pointer")};Vo.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")};Vo.touchend=(e,t)=>{e.inputState.touchActive=!1};Qu.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of e.state.facet(s2e))if(n=i(e,t),n)break;if(!n&&t.button==0&&(n=kCt(e,t)),n){let i=!e.hasFocus;e.inputState.startMouseSelection(new bCt(e,t,n,i)),i&&e.observer.ignore(()=>{GTe(e.contentDOM);let s=e.root.activeElement;s&&!s.contains(e.contentDOM)&&s.blur()});let r=e.inputState.mouseSelection;if(r)return r.start(t),r.dragging===!1}else e.inputState.setSelectionOrigin("select.pointer");return!1};function BZ(e,t,n,i){if(i==1)return tt.cursor(t,n);if(i==2)return JEt(e.state,t,n);{let r=e.docView.lineAt(t,n),s=e.state.doc.lineAt(r?r.posAtEnd:t),a=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return lDate.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(QZ+1)%3:1}function kCt(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),i=T2e(t),r=e.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),r=r.map(s.changes))},get(s,a,l){let c=e.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),u,d=BZ(e,c.pos,c.assoc,i);if(n.pos!=c.pos&&!a){let f=BZ(e,n.pos,n.assoc,i),h=Math.min(f.from,d.from),p=Math.max(f.to,d.to);d=h1&&(u=ECt(r,c.pos))?u:l?r.addRange(d):tt.create([d])}}}function ECt(e,t){for(let n=0;n=t)return tt.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}Qu.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let s=r.posAtStart,a=s+r.length;(s>=n.to||a<=n.from)&&(n=tt.undirectionalRange(s,a))}}let{inputState:i}=e;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",kI(e.state,ZU,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1};Qu.dragend=e=>(e.inputState.draggedContent=null,!1);function VZ(e,t,n,i){if(n=kI(e.state,YU,n),!n)return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:s}=e.inputState,a=i&&s&&vCt(e,t)?{from:s.from,to:s.to}:null,l={from:r,insert:n},c=e.state.changes(a?[a,l]:l);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(r,-1),head:c.mapPos(r,1)},userEvent:a?"move.drop":"input.drop"}),e.inputState.draggedContent=null}Qu.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,s=()=>{++r==n.length&&VZ(e,t,i.filter(a=>a!=null).join(e.state.lineBreak),!1)};for(let a=0;a{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[a]=l.result),s()},l.readAsText(n[a])}return!0}else{let i=t.dataTransfer.getData("Text");if(i)return VZ(e,t,i,!0),!0}return!1};Qu.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=E2e?null:t.clipboardData;return n?(C2e(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(OCt(e),!1)};function CCt(e,t){let n=e.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=t,i.focus(),i.selectionEnd=t.length,i.selectionStart=0,setTimeout(()=>{i.remove(),e.focus()},50)}function TCt(e){let t=[],n=[],i=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let r=-1;for(let{from:s}of e.selection.ranges){let a=e.doc.lineAt(s);a.number>r&&(t.push(a.text),n.push({from:a.from,to:Math.min(e.doc.length,a.to+1)})),r=a.number}i=!0}return{text:kI(e,ZU,t.join(e.lineBreak)),ranges:n,linewise:i}}let L$=null;Qu.copy=Qu.cut=(e,t)=>{if(!FO(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=TCt(e.state);if(!n&&!r)return!1;L$=r?n:null,t.type=="cut"&&!e.state.readOnly&&e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=E2e?null:t.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(CCt(e,n),!1)};const A2e=Jd.define();function _2e(e,t){let n=[];for(let i of e.facet(l2e)){let r=i(e,t);r&&n.push(r)}return n.length?e.update({effects:n,annotations:A2e.of(!0)}):null}function N2e(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=_2e(e.state,t);n?e.dispatch(n):e.update([])}},10)}Vo.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),N2e(e)};Vo.blur=e=>{e.observer.clearSelectionRange(),N2e(e)};Vo.compositionstart=Vo.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange==null&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))};Vo.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,Xt.chrome&&Xt.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))};Vo.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()};Qu.beforeinput=(e,t)=>{var n,i;if((t.inputType=="insertText"||t.inputType=="insertCompositionText")&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType=="insertReplacementText"&&e.observer.editContext){let s=(n=t.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),a=t.getTargetRanges();if(s&&a.length){let l=a[0],c=e.posAtDOM(l.startContainer,l.startOffset),u=e.posAtDOM(l.endContainer,l.endOffset);return nQ(e,{from:c,to:u,insert:e.state.toText(s)},null),!0}}let r;if(Xt.chrome&&Xt.android&&(r=S2e.find(s=>s.inputType==t.inputType))&&(e.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>s+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return Xt.ios&&t.inputType=="deleteContentForward"&&e.observer.flushSoon(),Xt.safari&&t.inputType=="insertText"&&e.inputState.composing>=0&&setTimeout(()=>Vo.compositionend(e,t),20),!1};const HZ=new Set;function ACt(e){HZ.has(e)||(HZ.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}const qZ=["pre-wrap","normal","pre-line","break-spaces"];let ax=!1;function WZ(){ax=!1}class _Ct{constructor(t){this.lineWrapping=t,this.doc=Gi.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,n){let i=this.doc.lineAt(n).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((n-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return qZ.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let n=!1;for(let i=0;i-1,c=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=i,this.textHeight=r,this.lineLength=s,c){this.heightSamples={};for(let u=0;u0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>NA&&(ax=!0),this.height=t)}replace(t,n,i){return zo.of(i)}decomposeLeft(t,n){n.push(this)}decomposeRight(t,n){n.push(this)}applyChanges(t,n,i,r){let s=this,a=i.doc;for(let l=r.length-1;l>=0;l--){let{fromA:c,toA:u,fromB:d,toB:f}=r[l],h=s.lineAt(c,Ir.ByPosNoHeight,i.setDoc(n),0,0),p=h.to>=u?h:s.lineAt(u,Ir.ByPosNoHeight,i,0,0);for(f+=p.to-u,u=p.to;l>0&&h.from<=r[l-1].toA;)c=r[l-1].fromA,d=r[l-1].fromB,l--,cs*2){let l=t[n-1];l.break?t.splice(--n,1,l.left,null,l.right):t.splice(--n,1,l.left,l.right),i+=1+l.break,r-=l.size}else if(s>r*2){let l=t[i];l.break?t.splice(i,1,l.left,null,l.right):t.splice(i,1,l.left,l.right),i+=2+l.break,s-=l.size}else break;else if(r=s&&a(this.lineAt(0,Ir.ByPos,i,r,s))}setMeasuredHeight(t){let n=t.heights[t.index++];n<0?(this.spaceAbove=-n,n=t.heights[t.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(t,n=0,i=!1,r){return r&&r.from<=n&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Hl extends j2e{constructor(t,n,i){super(t,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(t,n){return new Tu(n,this.length,t+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,i){let r=i[0];return i.length==1&&(r instanceof Hl||r instanceof Ka&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof Ka?r=new Hl(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):zo.of(i)}updateHeight(t,n=0,i=!1,r){return r&&r.from<=n&&r.more?this.setMeasuredHeight(r):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Ka extends zo{constructor(t){super(t,0)}heightMetrics(t,n){let i=t.doc.lineAt(n).number,r=t.doc.lineAt(n+this.length).number,s=r-i+1,a,l=0;if(t.lineWrapping){let c=Math.min(this.height,t.lineHeight*s);a=c/s,this.length>s+1&&(l=(this.height-c)/(this.length-s-1))}else a=this.height/s;return{firstLine:i,lastLine:r,perLine:a,perChar:l}}blockAt(t,n,i,r){let{firstLine:s,lastLine:a,perLine:l,perChar:c}=this.heightMetrics(n,r);if(n.lineWrapping){let u=r+(t0){let s=i[i.length-1];s instanceof Ka?i[i.length-1]=new Ka(s.length+r):i.push(null,new Ka(r-1))}if(t>0){let s=i[0];s instanceof Ka?i[0]=new Ka(t+s.length):i.unshift(new Ka(t-1),null)}return zo.of(i)}decomposeLeft(t,n){n.push(new Ka(t-1),null)}decomposeRight(t,n){n.push(null,new Ka(this.length-t-1))}updateHeight(t,n=0,i=!1,r){let s=n+this.length;if(r&&r.from<=n+this.length&&r.more){let a=[],l=Math.max(n,r.from),c=-1;for(r.from>n&&a.push(new Ka(r.from-n-1).updateHeight(t,n));l<=s&&r.more;){let d=t.doc.lineAt(l).length;a.length&&a.push(null);let f=r.heights[r.index++],h=0;f<0&&(h=-f,f=r.heights[r.index++]),c==-1?c=f:Math.abs(f-c)>=NA&&(c=-2);let p=new Hl(d,f,h);p.outdated=!1,a.push(p),l+=d+1}l<=s&&a.push(null,new Ka(s-l).updateHeight(t,l));let u=zo.of(a);return(c<0||Math.abs(u.height-this.height)>=NA||Math.abs(c-this.heightMetrics(t,n).perLine)>=NA)&&(ax=!0),LN(this,u)}else(i||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class RCt extends zo{constructor(t,n,i){super(t.length+n+i.length,t.height+i.height,n|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return this.flags&1}blockAt(t,n,i,r){let s=i+this.left.height;return tl))return u;let d=n==Ir.ByPosNoHeight?Ir.ByPosNoHeight:Ir.ByPos;return c?u.join(this.right.lineAt(l,d,i,a,l)):this.left.lineAt(l,d,i,r,s).join(u)}forEachLine(t,n,i,r,s,a){let l=r+this.left.height,c=s+this.left.length+this.break;if(this.break)t=c&&this.right.forEachLine(t,n,i,l,c,a);else{let u=this.lineAt(c,Ir.ByPos,i,r,s);t=t&&u.from<=n&&a(u),n>u.to&&this.right.forEachLine(u.to+1,n,i,l,c,a)}}replace(t,n,i){let r=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(t-r,n-r,i));let s=[];t>0&&this.decomposeLeft(t,s);let a=s.length;for(let l of i)s.push(l);if(t>0&&GZ(s,a-1),n=i&&n.push(null)),t>i&&this.right.decomposeLeft(t-i,n)}decomposeRight(t,n){let i=this.left.length,r=i+this.break;if(t>=r)return this.right.decomposeRight(t-r,n);t2*n.size||n.size>2*t.size?zo.of(this.break?[t,null,n]:[t,n]):(this.left=LN(this.left,t),this.right=LN(this.right,n),this.setHeight(t.height+n.height),this.outdated=t.outdated||n.outdated,this.size=t.size+n.size,this.length=t.length+this.break+n.length,this)}updateHeight(t,n=0,i=!1,r){let{left:s,right:a}=this,l=n+s.length+this.break,c=null;return r&&r.from<=n+s.length&&r.more?c=s=s.updateHeight(t,n,i,r):s.updateHeight(t,n,i),r&&r.from<=l+a.length&&r.more?c=a=a.updateHeight(t,l,i,r):a.updateHeight(t,l,i),c?this.balanced(s,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function GZ(e,t){let n,i;e[t]==null&&(n=e[t-1])instanceof Ka&&(i=e[t+1])instanceof Ka&&e.splice(t-1,3,new Ka(n.length+1+i.length))}const ICt=5;class iQ{constructor(t,n){this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,n){if(this.lineStart>-1){let i=Math.min(n,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof Hl?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Hl(i-this.pos,-1,0)),this.writtenTo=i,n>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(t,n,i){if(t=ICt)&&this.addLineDeco(r,s,a)}else n>t&&this.span(t,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=n,this.writtenTot&&this.nodes.push(new Hl(this.pos-t,-1,0)),this.writtenTo=this.pos}blankContent(t,n){let i=new Ka(n-t);return this.oracle.doc.lineAt(t).to==n&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof Hl)return t;let n=new Hl(0,-1,0);return this.nodes.push(n),n}addBlock(t){this.enterLine();let n=t.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,n&&n.endSide>0&&(this.covering=t)}addLineDeco(t,n,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,t),r.breaks+=n,this.writtenTo=this.pos=this.pos+i}finish(t){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Hl)&&!this.isCovered?this.nodes.push(new Hl(0,-1,0)):(this.writtenTod.clientHeight||d.scrollWidth>d.clientWidth)&&f.overflow!="visible"){let h=d.getBoundingClientRect();s=Math.max(s,h.left),a=Math.min(a,h.right),l=Math.max(l,h.top),c=Math.min(u==e.parentNode?r.innerHeight:c,h.bottom)}u=f.position=="absolute"||f.position=="fixed"?d.offsetParent:d.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:s-n.left,right:Math.max(s,a)-n.left,top:l-(n.top+t),bottom:Math.max(l,c)-(n.top+t)}}function LCt(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left0&&t.top0}function $Ct(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class d5{constructor(t,n,i,r){this.from=t,this.to=n,this.size=i,this.displaySize=r}static same(t,n){if(t.length!=n.length)return!1;for(let i=0;itypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new _Ct(i),this.stateDeco=YZ(n),this.heightMap=zo.empty().applyChanges(this.stateDeco,Gi.empty,this.heightOracle.setDoc(n.doc),[new Gc(0,0,0,n.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=gn.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=t.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:n}=this.state.selection;for(let i=0;i<=1;i++){let r=i?n.head:n.anchor;if(!t.some(({from:s,to:a})=>r>=s&&r<=a)){let{from:s,to:a}=this.lineBlockAt(r);t.push(new ZT(s,a))}}return this.viewports=t.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?XZ:new rQ(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(Vw(t,this.scaler))})}update(t,n=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=YZ(this.state);let r=t.changedRanges,s=Gc.extendWithRanges(r,PCt(i,this.stateDeco,t?t.changes:ma.empty(this.state.doc.length))),a=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);WZ(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=a||ax)&&(t.flags|=2),l?(this.scrollAnchorPos=t.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let c=s.length?this.mapViewport(this.viewport,t.changes):this.viewport;(n&&(n.range.headc.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,n));let u=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,t.flags|=this.updateForViewport(),(u||!t.changes.empty||t.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(t.selectionSet||t.focusChanged)&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(u2e)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:t}=this,n=t.contentDOM,i=window.getComputedStyle(n),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?Cr.RTL:Cr.LTR;let a=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=n.getBoundingClientRect(),c=a||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let u=0,d=0;if(l.width&&l.height){let{scaleX:k,scaleY:S}=qTe(n,l);(k>.005&&Math.abs(this.scaleX-k)>.005||S>.005&&Math.abs(this.scaleY-S)>.005)&&(this.scaleX=k,this.scaleY=S,u|=16,a=c=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,h=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=h)&&(this.paddingTop=f,this.paddingBottom=h,u|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(r.lineWrapping&&(c=!0),this.editorWidth=t.scrollDOM.clientWidth,u|=16);let p=WTe(this.view.contentDOM,!1).y;p!=this.scrollParent&&(this.scrollParent=p,this.scrollAnchorHeight=-1,this.scrollOffset=0);let g=this.getScrollOffset();this.scrollOffset!=g&&(this.scrollAnchorHeight=-1,this.scrollOffset=g),this.scrolledToBottom=KTe(this.scrollParent||t.win);let b=(this.printing?$Ct:MCt)(n,this.paddingTop),v=b.top-this.pixelViewport.top,y=b.bottom-this.pixelViewport.bottom;this.pixelViewport=b;let x=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(x!=this.inView&&(this.inView=x,x&&(c=!0)),!this.inView&&!this.scrollTarget&&!LCt(t.dom))return 0;let O=l.width;if((this.contentDOMWidth!=O||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=t.scrollDOM.clientHeight,u|=16),c){let k=t.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(k)&&(a=!0),a||r.lineWrapping&&Math.abs(O-this.contentDOMWidth)>r.charWidth){let{lineHeight:S,charWidth:E,textHeight:C}=t.docView.measureTextSize();a=S>0&&r.refresh(s,S,E,C,Math.max(5,O/E),k),a&&(t.docView.minWidth=0,u|=16)}v>0&&y>0?d=Math.max(v,y):v<0&&y<0&&(d=Math.min(v,y)),WZ();for(let S of this.viewports){let E=S.from==this.viewport.from?k:t.docView.measureVisibleLineHeights(S);this.heightMap=(a?zo.empty().applyChanges(this.stateDeco,Gi.empty,this.heightOracle,[new Gc(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new NCt(S.from,E))}ax&&(u|=2)}let w=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return w&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),u|=this.updateForViewport()),(u&2||w)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,t)),u|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),u}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,n){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:a,visibleBottom:l}=this,c=new ZT(r.lineAt(a-i*1e3,Ir.ByHeight,s,0,0).from,r.lineAt(l+(1-i)*1e3,Ir.ByHeight,s,0,0).to);if(n){let{head:u}=n.range;if(uc.to){let d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=r.lineAt(u,Ir.ByPos,s,0,0),h;n.y=="center"?h=(f.top+f.bottom)/2-d/2:n.y=="start"||n.y=="nearest"&&u=l+Math.max(10,Math.min(i,250)))&&r>a-2*1e3&&s>1,a=r<<1;if(this.defaultTextDirection!=Cr.LTR&&!i)return[];let l=[],c=(d,f,h,p)=>{if(f-dd&&yy.from>=h.from&&y.to<=h.to&&Math.abs(y.from-d)y.fromx));if(!v){if(fO.from<=f&&O.to>=f)){let O=n.moveToLineBoundary(tt.cursor(f),!1,!0).head;O>d&&(f=O)}let y=this.gapSize(h,d,f,p),x=i||y<2e6?y:2e6;v=new d5(d,f,y,x)}l.push(v)},u=d=>{if(d.length2e6)for(let S of t)S.from>=d.from&&S.fromd.from&&c(d.from,p,d,f),gn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(t){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let i=[];xi.spans(n,this.viewport.from,this.viewport.to,{span(s,a){i.push({from:s,to:a})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let s=0;s=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(n=>n.from<=t&&n.to>=t)||Vw(this.heightMap.lineAt(t,Ir.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=t&&n.bottom>=t)||Vw(this.heightMap.lineAt(this.scaler.fromDOM(t),Ir.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(t){let n=this.lineBlockAtHeight(t+8);return n.from>=this.viewport.from||this.viewportLines[0].top-t>200?n:this.viewportLines[0]}elementAtHeight(t){return Vw(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class ZT{constructor(t,n){this.from=t,this.to=n}}function BCt(e,t,n){let i=[],r=e,s=0;return xi.spans(n,e,t,{span(){},point(a,l){a>r&&(i.push({from:r,to:a}),s+=a-r),r=l}},20),r=1)return t[t.length-1].to;let i=Math.floor(e*n);for(let r=0;;r++){let{from:s,to:a}=t[r],l=a-s;if(i<=l)return s+i;i-=l}}function e2(e,t){let n=0;for(let{from:i,to:r}of e.ranges){if(t<=r){n+=t-i;break}n+=r-i}return n/e.total}function UCt(e,t){for(let n of e)if(t(n))return n}const XZ={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function YZ(e){let t=e.facet(wI).filter(i=>typeof i!="function"),n=e.facet(eQ).filter(i=>typeof i!="function");return n.length&&t.push(xi.join(n)),t}class rQ{constructor(t,n,i){let r=0,s=0,a=0;this.viewports=i.map(({from:l,to:c})=>{let u=n.lineAt(l,Ir.ByPos,t,0,0).top,d=n.lineAt(c,Ir.ByPos,t,0,0).bottom;return r+=d-u,{from:l,to:c,top:u,bottom:d,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(n.height-r);for(let l of this.viewports)l.domTop=a+(l.top-s)*this.scale,a=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(t){for(let n=0,i=0,r=0;;n++){let s=nn.from==t.viewports[i].from&&n.to==t.viewports[i].to):!1}}function Vw(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),i=t.toDOM(e.bottom);return new Tu(e.from,e.length,n,i-n,Array.isArray(e._content)?e._content.map(r=>Vw(r,t)):e._content)}const t2=Zt.define({combine:e=>e.join(" ")}),$$=Zt.define({combine:e=>e.indexOf(!0)>-1}),F$=Cm.newName(),R2e=Cm.newName(),I2e=Cm.newName(),P2e={"&light":"."+R2e,"&dark":"."+I2e};function B$(e,t,n){return new Cm(t,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return e;if(!n||!n[r])throw new RangeError(`Unsupported selector: ${r}`);return n[r]}):e+" "+i}})}const QCt=B$("."+F$,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},P2e),zCt={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},f5=Xt.ie&&Xt.ie_version<=11;class VCt{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new vEt,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(n=>{for(let i of n)this.queue.push(i);(Xt.ie&&Xt.ie_version<=11||Xt.ios&&t.composing)&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Xt.android&&t.constructor.EDIT_CONTEXT!==!1&&!(Xt.chrome&&Xt.chrome_version<126)&&(this.editContext=new qCt(t),t.state.facet(zf)&&(t.contentDOM.editContext=this.editContext.editContext)),f5&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){(t.type=="change"||!t.type)&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((n,i)=>n!=t[i]))){this.gapIntersection.disconnect();for(let n of t)this.gapIntersection.observe(n);this.gaps=t}}onSelectionChange(t){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,r=this.selectionRange;if(i.state.facet(zf)?i.root.activeElement!=this.dom:!FO(this.dom,r))return;let s=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(t)){n||(this.selectionChanged=!1);return}(Xt.ie&&Xt.ie_version<=11||Xt.android&&Xt.chrome)&&!i.state.selection.main.empty&&r.focusNode&&UO(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,n=nk(t.root);if(!n)return!1;let i=Xt.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&HCt(this.view,n)||n;if(!i||this.selectionRange.eq(i))return!1;let r=FO(this.dom,i);return r&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&dv(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:n,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let n=-1,i=-1,r=!1;for(let s of t){let a=this.readMutation(s);a&&(a.typeOver&&(r=!0),n==-1?{from:n,to:i}=a:(n=Math.min(a.from,n),i=Math.max(a.to,i)))}return{from:n,to:i,typeOver:r}}readChange(){let{from:t,to:n,typeOver:i}=this.processRecords(),r=this.selectionChanged&&FO(this.dom,this.selectionRange);if(t<0&&!r)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new lCt(this.view,t,n,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let i=this.view.state,r=w2e(this.view,n);return this.view.state==i&&(n.domChanged||n.newSel&&!MN(this.view.state.selection,n.newSel.main))&&this.view.update([]),r}readMutation(t){let n=this.view.docView.tile.nearest(t.target);if(!n||n.isWidget())return null;if(n.markDirty(t.type=="attributes"),t.type=="childList"){let i=ZZ(n,t.previousSibling||t.target.previousSibling,-1),r=ZZ(n,t.nextSibling||t.target.nextSibling,1);return{from:i?n.posAfter(i):n.posAtStart,to:r?n.posBefore(r):n.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(zf)!=t.state.facet(zf)&&(t.view.contentDOM.editContext=t.state.facet(zf)?this.editContext.editContext:null))}destroy(){var t,n,i;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function ZZ(e,t,n){for(;t;){let i=Cs.get(t);if(i&&i.parent==e)return i;let r=t.parentNode;t=r!=e.dom?r:n>0?t.nextSibling:t.previousSibling}return null}function JZ(e,t){let n=t.startContainer,i=t.startOffset,r=t.endContainer,s=t.endOffset,a=e.docView.domAtPos(e.state.selection.main.anchor,1);return UO(a.node,a.offset,r,s)&&([n,i,r,s]=[r,s,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}}function HCt(e,t){if(t.getComposedRanges){let r=t.getComposedRanges(e.root)[0];if(r)return JZ(e,r)}let n=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",i,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",i,!0),n?JZ(e,n):null}class qCt{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let n=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=i=>{let r=t.state.selection.main,{anchor:s,head:a}=r,l=this.toEditorPos(i.updateRangeStart),c=this.toEditorPos(i.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:l,drifted:!1});let u=c-l>i.text.length;l==this.from&&sthis.to&&(c=s);let d=O2e(t.state.sliceDoc(l,c),i.text,(u?r.from:r.to)-l,u?"end":null);if(!d){let h=tt.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));MN(h,r)||t.dispatch({selection:h,userEvent:"select"});return}let f={from:d.from+l,to:d.toA+l,insert:Gi.of(i.text.slice(d.from,d.toB).split(` +`))};if((Xt.mac||Xt.android)&&f.from==a-1&&/^\. ?$/.test(i.text)&&t.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:c,insert:Gi.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!t.state.readOnly){let h=this.to-this.from+(f.to-f.from+f.insert.length);nQ(t,f,tt.single(this.toEditorPos(i.selectionStart,h),this.toEditorPos(i.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)),f.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(n.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let a=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);a{let r=[];for(let s of i.getTextFormats()){let a=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(a)&&!/none/i.test(l)){let c=this.toEditorPos(s.rangeStart),u=this.toEditorPos(s.rangeEnd);if(c{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(t.state)}};for(let i in this.handlers)n.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{let r=nk(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let n=0,i=!1,r=this.pendingContextChange;return t.changes.iterChanges((s,a,l,c,u)=>{if(i)return;let d=u.length-(a-s);if(r&&a>=r.to)if(r.from==s&&r.to==a&&r.insert.eq(u)){r=this.pendingContextChange=null,n+=d,this.to+=d;return}else r=null,this.revertPending(t.state);if(s+=n,a+=n,a<=this.from)this.from+=d,this.to+=d;else if(sthis.to||this.to-this.from+u.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(a),u.toString()),this.to+=d}n+=d}),r&&!i&&this.revertPending(t.state),!i}update(t){let n=this.pendingContextChange,i=t.startState.selection.main;this.composing&&(this.composing.drifted||!t.changes.touchesRange(i.from,i.to)&&t.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.reset(t.state)):(t.docChanged||t.selectionSet||n)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:n}=t.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(t.doc.length,n+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),t.doc.sliceString(n.from,n.to))}setSelection(t){let{main:n}=t.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),r=this.toContextPos(n.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(t){let{head:n}=t.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(t,n=this.to-this.from){t=Math.min(t,n);let i=this.composing;return i&&i.drifted?i.editorBase+(t-i.contextBase):t+this.from}toContextPos(t){let n=this.composing;return n&&n.drifted?n.contextBase+(t-n.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class zt{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:i}=t;this.dispatchTransactions=t.dispatchTransactions||i&&(r=>r.forEach(s=>i(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=t.root||xEt(t.parent)||document,this.viewState=new KZ(this,t.state||Ti.create(t)),t.scrollTo&&t.scrollTo.is(KT)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(My).map(r=>new a5(r));for(let r of this.plugins)r.update(this);this.observer=new VCt(this),this.inputState=new fCt(this),this.inputState.ensureHandlers(this.plugins),this.docView=new MZ(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...t){let n=t.length==1&&t[0]instanceof Js?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(n,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,i=!1,r,s=this.state;for(let h of t){if(h.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=h.state}if(this.destroyed){this.viewState.state=s;return}let a=this.hasFocus,l=0,c=null;t.some(h=>h.annotation(A2e))?(this.inputState.notifiedFocused=a,l=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,c=_2e(s,a),c||(l=1));let u=this.observer.delayedAndroidKey,d=null;if(u?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(d=null)):this.observer.clear(),s.facet(Ti.phrases)!=this.state.facet(Ti.phrases))return this.setState(s);r=IN.create(this,s,t),r.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let h of t){if(f&&(f=f.map(h.changes)),h.scrollIntoView){let{main:p}=h.state.selection,{x:g,y:b}=this.state.facet(zt.cursorScrollMargin);f=new fv(p.empty?p:tt.cursor(p.head,p.head>p.anchor?-1:1),"nearest","nearest",b,g)}for(let p of h.effects)p.is(KT)&&(f=p.value.clip(this.state))}this.viewState.update(r,f),this.bidiCache=$N.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(zw)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(h=>h.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(t2)!=r.state.facet(t2)&&(this.viewState.mustMeasureContent=!0),(n||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!r.empty)for(let h of this.state.facet(I$))try{h(r)}catch(p){hl(this.state,p,"update listener")}(c||d)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),d&&!w2e(this,d)&&u.force&&dv(this.contentDOM,u.key,u.keyCode)})}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let n=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new KZ(this,t),this.plugins=t.facet(My).map(i=>new a5(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new MZ(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(t){let n=t.startState.facet(My),i=t.state.facet(My);if(n!=i){let r=[];for(let s of i){let a=n.indexOf(s);if(a<0)r.push(new a5(s));else{let l=this.plugins[a];l.mustUpdate=t,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=t&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=t;for(let r=0;r-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let n=null,i=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:a}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(a<0)if(KTe(i||this.win))s=-1,a=this.viewState.heightMap.height;else{let p=this.viewState.scrollAnchorAt(r);s=p.from,a=p.top}this.updateState=1;let c=this.viewState.measure();if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];c&4||([this.measureRequests,u]=[u,this.measureRequests]);let d=u.map(p=>{try{return p.read(this)}catch(g){return hl(this.state,g),eJ}}),f=IN.create(this,this.state,[]),h=!1;f.flags|=c,n?n.flags|=c:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),h=this.docView.update(f),h&&this.docViewUpdate());for(let p=0;p1||g<-1)&&!(Xt.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+g,i?i.scrollTop+=g:this.win.scrollBy(0,g),a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(I$))l(n)}get themeClasses(){return F$+" "+(this.state.facet($$)?I2e:R2e)+" "+this.state.facet(t2)}updateAttrs(){let t=tJ(this,h2e,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(zf)?"true":"false",class:"cm-content",style:`${Xt.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),tJ(this,JU,n);let i=this.observer.ignore(()=>{let r=NZ(this.contentDOM,this.contentAttrs,n),s=NZ(this.dom,this.editorAttrs,t);return r||s});return this.editorAttrs=t,this.contentAttrs=n,i}showAnnouncements(t){let n=!0;for(let i of t)for(let r of i.effects)if(r.is(zt.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(zw);let t=this.state.facet(zt.cspNonce);Cm.mount(this.root,this.styleModules.concat(QCt).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let n=0;ni.plugin==t)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,n,i){return u5(this,t,LZ(this,t,n,i))}moveByGroup(t,n){return u5(this,t,LZ(this,t,n,i=>nCt(this,t.head,i)))}visualLineSide(t,n){let i=this.bidiSpans(t),r=this.textDirectionAt(t.from),s=i[n?i.length-1:0];return tt.cursor(s.side(n,r)+t.from,s.forward(!n,r)?1:-1)}moveToLineBoundary(t,n,i=!0){return tCt(this,t,n,i)}moveVertically(t,n,i){return u5(this,t,iCt(this,t,n,i))}domAtPos(t,n=1){return this.docView.domAtPos(t,n)}posAtDOM(t,n=0){return this.docView.posFromDOM(t,n)}posAtCoords(t,n=!0){this.readMeasured();let i=M$(this,t,n);return i&&i.pos}posAndSideAtCoords(t,n=!0){return this.readMeasured(),M$(this,t,n)}coordsAtPos(t,n=1){this.readMeasured();let i=this.state.doc.lineAt(t),r=this.bidiSpans(i),s=r[Ad.find(r,t-i.from,-1,n)];return this.docView.coordsAt(t,n,s.dir==Cr.RTL)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(c2e)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>WCt)return t2e(t.length);let n=this.textDirectionAt(t.from),i;for(let s of this.bidiCache)if(s.from==t.from&&s.dir==n&&(s.fresh||e2e(s.isolates,i=IZ(this,t))))return s.order;i||(i=IZ(this,t));let r=AEt(t.text,n,i);return this.bidiCache.push(new $N(t.from,t.to,n,i,!0,r)),r}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||Xt.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{GTe(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,n={}){var i,r,s,a;return KT.of(new fv(typeof t=="number"?tt.cursor(t):t,(i=n.y)!==null&&i!==void 0?i:"nearest",(r=n.x)!==null&&r!==void 0?r:"nearest",(s=n.yMargin)!==null&&s!==void 0?s:5,(a=n.xMargin)!==null&&a!==void 0?a:5))}scrollSnapshot(){let{scrollTop:t,scrollLeft:n}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return KT.of(new fv(tt.cursor(i.from),"start","start",i.top-t,n,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return Ts.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return Ts.define(()=>({}),{eventObservers:t})}static theme(t,n){let i=Cm.newName(),r=[t2.of(i),zw.of(B$(`.${i}`,t))];return n&&n.dark&&r.push($$.of(!0)),r}static baseTheme(t){return zh.lowest(zw.of(B$("."+F$,t,P2e)))}static findFromDOM(t){var n;let i=t.querySelector(".cm-content"),r=i&&Cs.get(i)||Cs.get(t);return((n=r==null?void 0:r.root)===null||n===void 0?void 0:n.view)||null}}zt.styleModule=zw;zt.inputHandler=o2e;zt.clipboardInputFilter=YU;zt.clipboardOutputFilter=ZU;zt.scrollHandler=d2e;zt.focusChangeEffect=l2e;zt.perLineTextDirection=c2e;zt.exceptionSink=a2e;zt.updateListener=I$;zt.editable=zf;zt.mouseSelectionStyle=s2e;zt.dragMovesSelection=r2e;zt.clickAddsSelectionRange=i2e;zt.decorations=wI;zt.blockWrappers=p2e;zt.outerDecorations=eQ;zt.atomicRanges=ME;zt.bidiIsolatedRanges=m2e;zt.cursorScrollMargin=Zt.define({combine:e=>{let t=5,n=5;for(let i of e)typeof i=="number"?t=n=i:{x:t,y:n}=i;return{x:t,y:n}}});zt.scrollMargins=g2e;zt.darkTheme=$$;zt.cspNonce=Zt.define({combine:e=>e.length?e[0]:""});zt.contentAttributes=JU;zt.editorAttributes=h2e;zt.lineWrapping=zt.contentAttributes.of({class:"cm-lineWrapping"});zt.announce=Fn.define();const WCt=4096,eJ={};class $N{constructor(t,n,i,r,s,a){this.from=t,this.to=n,this.dir=i,this.isolates=r,this.fresh=s,this.order=a}static update(t,n){if(n.empty&&!t.some(s=>s.fresh))return t;let i=[],r=t.length?t[t.length-1].dir:Cr.LTR;for(let s=Math.max(0,t.length-10);s=0;r--){let s=i[r],a=typeof s=="function"?s(e):s;a&&GU(a,n)}return n}const GCt=Xt.mac?"mac":Xt.windows?"win":Xt.linux?"linux":"key";function KCt(e,t){const n=e.split(/-(?!$)/);let i=n[n.length-1];i=="Space"&&(i=" ");let r,s,a,l;for(let c=0;ci.concat(r),[]))),n}function YCt(e,t,n){return M2e(D2e(e.state),t,e,n)}let Rp=null;const ZCt=4e3;function JCt(e,t=GCt){let n=Object.create(null),i=Object.create(null),r=(a,l)=>{let c=i[a];if(c==null)i[a]=l;else if(c!=l)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},s=(a,l,c,u,d)=>{var f,h;let p=n[a]||(n[a]=Object.create(null)),g=l.split(/ (?!$)/).map(y=>KCt(y,t));for(let y=1;y{let w=Rp={view:O,prefix:x,scope:a};return setTimeout(()=>{Rp==w&&(Rp=null)},ZCt),!0}]})}let b=g.join(" ");r(b,!1);let v=p[b]||(p[b]={preventDefault:!1,stopPropagation:!1,run:((h=(f=p._any)===null||f===void 0?void 0:f.run)===null||h===void 0?void 0:h.slice())||[]});c&&v.run.push(c),u&&(v.preventDefault=!0),d&&(v.stopPropagation=!0)};for(let a of e){let l=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let u of l){let d=n[u]||(n[u]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=a;for(let h in d)d[h].run.push(p=>f(p,U$))}let c=a[t]||a.key;if(c)for(let u of l)s(u,c,a.run,a.preventDefault,a.stopPropagation),a.shift&&s(u,"Shift-"+c,a.shift,a.preventDefault,a.stopPropagation)}return n}let U$=null;function M2e(e,t,n,i){U$=t;let r=hEt(t),s=ol(r,0),a=vd(s)==r.length&&r!=" ",l="",c=!1,u=!1,d=!1;Rp&&Rp.view==n&&Rp.scope==i&&(l=Rp.prefix+" ",k2e.indexOf(t.keyCode)<0&&(u=!0,Rp=null));let f=new Set,h=v=>{if(v){for(let y of v.run)if(!f.has(y)&&(f.add(y),y(n)))return v.stopPropagation&&(d=!0),!0;v.preventDefault&&(v.stopPropagation&&(d=!0),u=!0)}return!1},p=e[i],g,b;return p&&(h(p[l+n2(r,t,!a)])?c=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(Xt.windows&&t.ctrlKey&&t.altKey)&&!(Xt.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(g=Tm[t.keyCode])&&g!=r?(h(p[l+n2(g,t,!0)])||t.shiftKey&&(b=ek[t.keyCode])!=r&&b!=g&&h(p[l+n2(b,t,!1)]))&&(c=!0):a&&t.shiftKey&&h(p[l+n2(r,t,!0)])&&(c=!0),!c&&h(p._any)&&(c=!0)),u&&(c=!0),c&&d&&t.stopPropagation(),U$=null,c}class ob{constructor(t,n,i,r,s){this.className=t,this.left=n,this.top=i,this.width=r,this.height=s}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,n){return n.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,n,i){if(i.empty){let r=t.coordsAtPos(i.head,i.assoc||1);if(!r)return[];let s=L2e(t);return[new ob(n,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return eTt(t,n,i)}}function L2e(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==Cr.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function iJ(e,t,n,i){let r=e.coordsAtPos(t,n*2);if(!r)return i;let s=e.dom.getBoundingClientRect(),a=(r.top+r.bottom)/2,l=e.posAtCoords({x:s.left+1,y:a}),c=e.posAtCoords({x:s.right-1,y:a});return l==null||c==null?i:{from:Math.max(i.from,Math.min(l,c)),to:Math.min(i.to,Math.max(l,c))}}function eTt(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let i=Math.max(n.from,e.viewport.from),r=Math.min(n.to,e.viewport.to),s=e.textDirection==Cr.LTR,a=e.contentDOM,l=a.getBoundingClientRect(),c=L2e(e),u=a.querySelector(".cm-line"),d=u&&window.getComputedStyle(u),f=l.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),h=l.right-(d?parseInt(d.paddingRight):0),p=D$(e,i,1),g=D$(e,r,-1),b=p.type==io.Text?p:null,v=g.type==io.Text?g:null;if(b&&(e.lineWrapping||p.widgetLineBreaks)&&(b=iJ(e,i,1,b)),v&&(e.lineWrapping||g.widgetLineBreaks)&&(v=iJ(e,r,-1,v)),b&&v&&b.from==v.from&&b.to==v.to)return x(O(n.from,n.to,b));{let k=b?O(n.from,null,b):w(p,!1),S=v?O(null,n.to,v):w(g,!0),E=[];return(b||p).to<(v||g).from-(b&&v?1:0)||p.widgetLineBreaks>1&&k.bottom+e.defaultLineHeight/2A&&T.from=R)break;I>P&&j(Math.max(U,P),k==null&&U<=A,Math.min(I,R),S==null&&I>=F,M.dir)}if(P=L.to+1,P>=R)break}return _.length==0&&j(A,k==null,F,S==null,e.textDirection),{top:C,bottom:N,horizontal:_}}function w(k,S){let E=l.top+(S?k.top:k.bottom);return{top:E,bottom:E,horizontal:[]}}}function tTt(e,t){return e.constructor==t.constructor&&e.eq(t)}class nTt{constructor(t,n){this.view=t,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,t)}update(t){t.startState.facet(jA)!=t.state.facet(jA)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){this.layer.updateOnDocViewUpdate!==!1&&t.requestMeasure(this.measureReq)}setOrder(t){let n=0,i=t.facet(jA);for(;n!tTt(n,this.drawn[i]))){let n=this.dom.firstChild,i=0;for(let r of t)r.update&&n&&r.constructor&&this.drawn[i].constructor&&r.update(n,this.drawn[i])?(n=n.nextSibling,i++):this.dom.insertBefore(r.draw(),n);for(;n;){let r=n.nextSibling;n.remove(),n=r}this.drawn=t,Xt.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const jA=Zt.define();function $2e(e){return[Ts.define(t=>new nTt(t,e)),jA.of(e)]}const ox=Zt.define({combine(e){return ef(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(t,n)=>Math.min(t,n),drawRangeCursor:(t,n)=>t||n})}});function iTt(e={}){return[ox.of(e),rTt,sTt,aTt,u2e.of(!0)]}function F2e(e){return e.startState.facet(ox)!=e.state.facet(ox)}const rTt=$2e({above:!0,markers(e){let{state:t}=e,n=t.facet(ox),i=[];for(let r of t.selection.ranges){let s=r==t.selection.main;if(r.empty||n.drawRangeCursor&&!(s&&Xt.ios&&n.iosSelectionHandles)){let a=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=r.empty?r:tt.cursor(r.head,r.assoc);for(let c of ob.forRange(e,a,l))i.push(c)}}return i},update(e,t){e.transactions.some(i=>i.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=F2e(e);return n&&rJ(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){rJ(t.state,e)},class:"cm-cursorLayer"});function rJ(e,t){t.style.animationDuration=e.facet(ox).cursorBlinkRate+"ms"}const sTt=$2e({above:!1,markers(e){let t=[],{main:n,ranges:i}=e.state.selection;for(let r of i)if(!r.empty)for(let s of ob.forRange(e,"cm-selectionBackground",r))t.push(s);if(Xt.ios&&!n.empty&&e.state.facet(ox).iosSelectionHandles){for(let r of ob.forRange(e,"cm-selectionHandle cm-selectionHandle-start",tt.cursor(n.from,1)))t.push(r);for(let r of ob.forRange(e,"cm-selectionHandle cm-selectionHandle-end",tt.cursor(n.to,1)))t.push(r)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||F2e(e)},class:"cm-selectionLayer"}),aTt=zh.highest(zt.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),B2e=Fn.define({map(e,t){return e==null?null:t.mapPos(e)}}),Hw=ro.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((n,i)=>i.is(B2e)?i.value:n,e)}}),oTt=Ts.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(Hw);n==null?this.cursor!=null&&((t=this.cursor)===null||t===void 0||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(Hw)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(Hw),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let i=e.scrollDOM.getBoundingClientRect();return{left:n.left-i.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-i.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(Hw)!=e&&this.view.dispatch({effects:B2e.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){(e.target==this.view.contentDOM||!this.view.contentDOM.contains(e.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function lTt(){return[Hw,oTt]}function sJ(e,t,n,i,r){t.lastIndex=0;for(let s=e.iterRange(n,i),a=n,l;!s.next().done;a+=s.value.length)if(!s.lineBreak)for(;l=t.exec(s.value);)r(a+l.index,l)}function cTt(e,t){let n=e.visibleRanges;if(n.length==1&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let i=[];for(let{from:r,to:s}of n)r=Math.max(e.state.doc.lineAt(r).from,r-t),s=Math.min(e.state.doc.lineAt(s).to,s+t),i.length&&i[i.length-1].to>=r?i[i.length-1].to=s:i.push({from:r,to:s});return i}class uTt{constructor(t){const{regexp:n,decoration:i,decorate:r,boundary:s,maxLength:a=1e3}=t;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,r)this.addMatch=(l,c,u,d)=>r(d,u,u+l[0].length,l,c);else if(typeof i=="function")this.addMatch=(l,c,u,d)=>{let f=i(l,c,u);f&&d(u,u+l[0].length,f)};else if(i)this.addMatch=(l,c,u,d)=>d(u,u+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=a}createDeco(t){let n=new Ah,i=n.add.bind(n);for(let{from:r,to:s}of cTt(t,this.maxLength))sJ(t.state.doc,this.regexp,r,s,(a,l)=>this.addMatch(l,t,a,i));return n.finish()}updateDeco(t,n){let i=1e9,r=-1;return t.docChanged&&t.changes.iterChanges((s,a,l,c)=>{c>=t.view.viewport.from&&l<=t.view.viewport.to&&(i=Math.min(l,i),r=Math.max(c,r))}),t.viewportMoved||r-i>1e3?this.createDeco(t.view):r>-1?this.updateRange(t.view,n.map(t.changes),i,r):n}updateRange(t,n,i,r){for(let s of t.visibleRanges){let a=Math.max(s.from,i),l=Math.min(s.to,r);if(l>=a){let c=t.state.doc.lineAt(a),u=c.toc.from;a--)if(this.boundary.test(c.text[a-1-c.from])){d=a;break}for(;lh.push(y.range(b,v));if(c==u)for(this.regexp.lastIndex=d-c.from;(p=this.regexp.exec(c.text))&&p.indexthis.addMatch(v,t,b,g));n=n.update({filterFrom:d,filterTo:f,filter:(b,v)=>bf,add:h})}}return n}}const Q$=/x/.unicode!=null?"gu":"g",dTt=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Q$),fTt={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let h5=null;function hTt(){var e;if(h5==null&&typeof document<"u"&&document.body){let t=document.body.style;h5=((e=t.tabSize)!==null&&e!==void 0?e:t.MozTabSize)!=null}return h5||!1}const RA=Zt.define({combine(e){let t=ef(e,{render:null,specialChars:dTt,addSpecialChars:null});return(t.replaceTabs=!hTt())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,Q$)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,Q$)),t}});function pTt(e={}){return[RA.of(e),mTt()]}let aJ=null;function mTt(){return aJ||(aJ=Ts.fromClass(class{constructor(e){this.view=e,this.decorations=gn.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(RA)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new uTt({regexp:e.specialChars,decoration:(t,n,i)=>{let{doc:r}=n.state,s=ol(t[0],0);if(s==9){let a=r.lineAt(i),l=n.state.tabSize,c=Uu(a.text,l,i-a.from);return gn.replace({widget:new vTt((l-c%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=gn.replace({widget:new yTt(e,s)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(RA);e.startState.facet(RA)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))}const gTt="•";function bTt(e){return e>=32?gTt:e==10?"␤":String.fromCharCode(9216+e)}class yTt extends Yu{constructor(t,n){super(),this.options=t,this.code=n}eq(t){return t.code==this.code}toDOM(t){let n=bTt(this.code),i=t.state.phrase("Control character")+" "+(fTt[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,n);if(r)return r;let s=document.createElement("span");return s.textContent=n,s.title=i,s.setAttribute("aria-label",i),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class vTt extends Yu{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent=" ",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}function xTt(){return OTt}const wTt=gn.line({class:"cm-activeLine"}),OTt=Ts.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let i of e.state.selection.ranges){let r=e.lineBlockAt(i.head);r.from>t&&(n.push(wTt.range(r.from)),t=r.from)}return gn.set(n)}},{decorations:e=>e.decorations});class STt extends Yu{constructor(t){super(),this.content=t}toDOM(t){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(t):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(t){let n=t.firstChild?BO(t.firstChild):[];if(!n.length)return null;let i=window.getComputedStyle(t.parentNode),r=ik(n[0],i.direction!="rtl"),s=parseInt(i.lineHeight);return r.bottom-r.top>s*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+s}:r}ignoreEvent(){return!1}}function kTt(e){let t=Ts.fromClass(class{constructor(n){this.view=n,this.placeholder=e?gn.set([gn.widget({widget:new STt(e),side:1}).range(0)]):gn.none}get decorations(){return this.view.state.doc.length?gn.none:this.placeholder}},{decorations:n=>n.decorations});return typeof e=="string"?[t,zt.contentAttributes.of({"aria-placeholder":e})]:t}const z$=2e3;function ETt(e,t,n){let i=Math.min(t.line,n.line),r=Math.max(t.line,n.line),s=[];if(t.off>z$||n.off>z$||t.col<0||n.col<0){let a=Math.min(t.off,n.off),l=Math.max(t.off,n.off);for(let c=i;c<=r;c++){let u=e.doc.line(c);u.length<=l&&s.push(tt.range(u.from+a,u.to+l))}}else{let a=Math.min(t.col,n.col),l=Math.max(t.col,n.col);for(let c=i;c<=r;c++){let u=e.doc.line(c),d=O$(u.text,a,e.tabSize,!0);if(d<0)s.push(tt.cursor(u.to));else{let f=O$(u.text,l,e.tabSize);s.push(tt.range(u.from+d,u.from+f))}}}return s}function CTt(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function oJ(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),i=e.state.doc.lineAt(n),r=n-i.from,s=r>z$?-1:r==i.length?CTt(e,t.clientX):Uu(i.text,e.state.tabSize,n-i.from);return{line:i.number,col:s,off:r}}function TTt(e,t){let n=oJ(e,t),i=e.state.selection;return n?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(n.line).from),a=r.state.doc.lineAt(s);n={line:a.number,col:n.col,off:Math.min(n.off,a.length)},i=i.map(r.changes)}},get(r,s,a){let l=oJ(e,r);if(!l)return i;let c=ETt(e.state,n,l);return c.length?a?tt.create(c.concat(i.ranges)):tt.create(c):i}}:null}function ATt(e){let t=n=>n.altKey&&n.button==0;return zt.mouseSelectionStyle.of((n,i)=>t(i)?TTt(n,i):null)}const _Tt={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},NTt={style:"cursor: crosshair"};function jTt(e={}){let[t,n]=_Tt[e.key||"Alt"],i=Ts.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==t||n(r))},keyup(r){(r.keyCode==t||!n(r))&&this.set(!1)},mousemove(r){this.set(n(r))}}});return[i,zt.contentAttributes.of(r=>{var s;return!((s=r.plugin(i))===null||s===void 0)&&s.isDown?NTt:null})]}const i2="-10000px";class U2e{constructor(t,n,i,r){this.facet=n,this.createTooltipView=i,this.removeTooltipView=r,this.input=t.state.facet(n),this.tooltips=this.input.filter(a=>a);let s=null;this.tooltipViews=this.tooltips.map(a=>s=i(a,s))}update(t,n){var i;let r=t.state.facet(this.facet),s=r.filter(c=>c);if(r===this.input){for(let c of this.tooltipViews)c.update&&c.update(t);return!1}let a=[],l=n?[]:null;for(let c=0;cn[u]=c),n.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=a,!0}}function RTt(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const p5=Zt.define({combine:e=>{var t,n,i;return{position:Xt.ios?"absolute":((t=e.find(r=>r.position))===null||t===void 0?void 0:t.position)||"fixed",parent:((n=e.find(r=>r.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((i=e.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||RTt}}}),lJ=new WeakMap,sQ=Ts.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(p5);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new U2e(e,aQ,(n,i)=>this.createTooltip(n,i),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,i=e.state.facet(p5);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),i=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",n.dom.appendChild(r)}return n.dom.style.position=this.position,n.dom.style.top=i2,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(e=i.destroy)===null||e===void 0||e.call(i);this.parent&&this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(Xt.safari){let a=s.getBoundingClientRect();n=Math.abs(a.top+1e4)>1||Math.abs(a.left)>1}else n=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(e=s.width/this.parent.offsetWidth,t=s.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=tQ(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,a)=>{let l=this.manager.tooltipViews[a];return l.getCoords?l.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(p5).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:n,space:i,scaleX:r,scaleY:s}=e,a=[];for(let l=0;l=Math.min(n.bottom,i.bottom)||f.rightMath.min(n.right,i.right)+.1)){d.style.top=i2;continue}let p=c.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,g=p?7:0,b=h.right-h.left,v=(t=lJ.get(u))!==null&&t!==void 0?t:h.bottom-h.top,y=u.offset||PTt,x=this.view.textDirection==Cr.LTR,O=h.width>i.right-i.left?x?i.left:i.right-h.width:x?Math.max(i.left,Math.min(f.left-(p?14:0)+y.x,i.right-b)):Math.min(Math.max(i.left,f.left-b+(p?14:0)-y.x),i.right-b),w=this.above[l];!c.strictSide&&(w?f.top-v-g-y.yi.bottom)&&w==i.bottom-f.bottom>f.top-i.top&&(w=this.above[l]=!w);let k=(w?f.top-i.top:i.bottom-f.bottom)-g;if(kO&&C.topS&&(S=w?C.top-v-2-g:C.bottom+g+2);if(this.position=="absolute"?(d.style.top=(S-e.parent.top)/s+"px",cJ(d,(O-e.parent.left)/r)):(d.style.top=S/s+"px",cJ(d,O/r)),p){let C=f.left+(x?y.x:-y.x)-(O+14-7);p.style.left=C/r+"px"}u.overlap!==!0&&a.push({left:O,top:S,right:E,bottom:S+v}),d.classList.toggle("cm-tooltip-above",w),d.classList.toggle("cm-tooltip-below",!w),u.positioned&&u.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=i2}},{eventObservers:{scroll(){this.maybeMeasure()}}});function cJ(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const ITt=zt.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),PTt={x:0,y:0},aQ=Zt.define({enables:[sQ,ITt]}),FN=Zt.define({combine:e=>e.reduce((t,n)=>t.concat(n),[])});class EI{static create(t){return new EI(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new U2e(t,FN,(n,i)=>this.createHostedView(n,i),n=>n.dom.remove())}createHostedView(t,n){let i=t.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(t){for(let n of this.manager.tooltipViews)n.mount&&n.mount(t);this.mounted=!0}positioned(t){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(t)}update(t){this.manager.update(t)}destroy(){var t;for(let n of this.manager.tooltipViews)(t=n.destroy)===null||t===void 0||t.call(n)}passProp(t){let n;for(let i of this.manager.tooltipViews){let r=i[t];if(r!==void 0){if(n===void 0)n=r;else if(n!==r)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const DTt=aQ.compute([FN],e=>{let t=e.facet(FN);return t.length===0?null:{pos:Math.min(...t.map(n=>n.pos)),end:Math.max(...t.map(n=>{var i;return(i=n.end)!==null&&i!==void 0?i:n.pos})),create:EI.create,above:t[0].above,arrow:t.some(n=>n.arrow)}}),Q2e=Zt.define();class MTt{constructor(t,n,i,r,s,a){this.view=t,this.source=n,this.field=i,this.locked=r,this.setHover=s,this.hoverTime=a,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(t){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let t=Date.now()-this.lastMove.time;ta.bottom||n.xa.right+t.defaultCharacterWidth)return;let l=t.bidiSpans(t.state.doc.lineAt(r)).find(u=>u.from<=r&&u.to>=r),c=l&&l.dir==Cr.RTL?-1:1;s=n.x{if(l&&!(Array.isArray(l)&&!l.length)){let c=Array.isArray(l)?l:[l];r&&this.locked.set(c,r),t.dispatch({effects:this.setHover.of(c)})}};if(s&&"then"in s){let l=this.pending={pos:n};s.then(c=>{this.pending==l&&(this.pending=null,a(c))},c=>hl(t.state,c,"hover tooltip"))}else a(s)}get tooltip(){let t=this.view.plugin(sQ),n=t?t.manager.tooltips.findIndex(i=>i.create==EI.create):-1;return n>-1?t.manager.tooltipViews[n]:null}mousemove(t){var n,i;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&!this.locked.has(r)&&s&&!LTt(s.dom,t)||this.pending){let{pos:a}=r[0]||this.pending,l=(i=(n=r[0])===null||n===void 0?void 0:n.end)!==null&&i!==void 0?i:a;(a==l?this.view.posAtCoords(this.lastMove)!=a:!$Tt(this.view,a,l,t.clientX,t.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length&&!this.locked.has(n)){let{tooltip:i}=this;i&&i.dom.contains(t.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(t){let n=i=>{t.removeEventListener("mouseleave",n);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const r2=4;function LTt(e,t){let{left:n,right:i,top:r,bottom:s}=e.getBoundingClientRect(),a;if(a=e.querySelector(".cm-tooltip-arrow")){let l=a.getBoundingClientRect();r=Math.min(l.top,r),s=Math.max(l.bottom,s)}return t.clientX>=n-r2&&t.clientX<=i+r2&&t.clientY>=r-r2&&t.clientY<=s+r2}function $Tt(e,t,n,i,r,s){let a=e.scrollDOM.getBoundingClientRect(),l=e.documentTop+e.documentPadding.top+e.contentHeight;if(a.left>i||a.rightr||Math.min(a.bottom,l)=t&&c<=n}function FTt(e,t={}){let n=Fn.define(),i=new WeakMap,r=ro.define({create(){return[]},update(a,l){let c=i.get(a);if(a.length&&(t.hideOnChange&&(l.docChanged||l.selection)?a=[]:c&&c(l)?a=[]:t.hideOn&&(a=a.filter(u=>!t.hideOn(l,u)))),l.docChanged&&a.length){let u=[];for(let d of a){let f=l.changes.mapPos(d.pos,-1,eo.TrackDel);if(f!=null){let h=Object.assign(Object.create(null),d);h.pos=f,h.end!=null&&(h.end=l.changes.mapPos(h.end)),u.push(h)}}a=u}for(let u of l.effects)u.is(n)&&(a=u.value,c=void 0),(u.is(UTt)&&!u.value||u.value==r)&&(a=[]);return a.length&&c&&i.set(a,c),a},provide:a=>FN.from(a)});const s=Ts.define(a=>new MTt(a,e,r,i,n,t.hoverTime||300));return{active:r,extension:[r,s,Q2e.of(s),DTt]}}function BTt(e,t,n,i={}){var r;let s=e.state.facet(Q2e).map(a=>e.plugin(a)).filter(a=>!!a);if(i.tooltip&&i.tooltip.active){let a=s.find(l=>l.field==i.tooltip.active);a&&(s=[a])}for(let a of s)a.activateHover(e,t,n,(r=i.until)!==null&&r!==void 0?r:()=>!1)}function z2e(e,t){let n=e.plugin(sQ);if(!n)return null;let i=n.manager.tooltips.indexOf(t);return i<0?null:n.manager.tooltipViews[i]}const UTt=Fn.define(),uJ=Zt.define({combine(e){let t,n;for(let i of e)t=t||i.topContainer,n=n||i.bottomContainer;return{topContainer:t,bottomContainer:n}}});function oQ(e,t){let n=e.plugin(V2e),i=n?n.specs.indexOf(t):-1;return i>-1?n.panels[i]:null}const V2e=Ts.fromClass(class{constructor(e){this.input=e.state.facet(sk),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(e));let t=e.state.facet(uJ);this.top=new s2(e,!0,t.topContainer),this.bottom=new s2(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(uJ);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new s2(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new s2(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(sk);if(n!=this.input){let i=n.filter(c=>c),r=[],s=[],a=[],l=[];for(let c of i){let u=this.specs.indexOf(c),d;u<0?(d=c(e.view),l.push(d)):(d=this.panels[u],d.update&&d.update(e)),r.push(d),(d.top?s:a).push(d)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(a);for(let c of l)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let i of this.panels)i.update&&i.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>zt.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class s2{constructor(t,n,i){this.view=t,this.top=n,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let n of this.panels)n.destroy&&t.indexOf(n)<0&&n.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let t=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;t!=n.dom;)t=dJ(t);t=t.nextSibling}else this.dom.insertBefore(n.dom,t);for(;t;)t=dJ(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function dJ(e){let t=e.nextSibling;return e.remove(),t}const sk=Zt.define({enables:V2e});function QTt(e,t){let n,i=new Promise(a=>n=a),r=a=>zTt(a,t,n);e.state.field(m5,!1)?e.dispatch({effects:H2e.of(r)}):e.dispatch({effects:Fn.appendConfig.of(m5.init(()=>[r]))});let s=q2e.of(r);return{close:s,result:i.then(a=>((e.win.queueMicrotask||(c=>e.win.setTimeout(c,10)))(()=>{e.state.field(m5).indexOf(r)>-1&&e.dispatch({effects:s})}),a))}}const m5=ro.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(H2e)?e=[n.value].concat(e):n.is(q2e)&&(e=e.filter(i=>i!=n.value));return e},provide:e=>sk.computeN([e],t=>t.field(e))}),H2e=Fn.define(),q2e=Fn.define();function zTt(e,t,n){let i=t.content?t.content(e,()=>a(null)):null;if(!i){if(i=yr("form"),t.input){let l=yr("input",t.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),i.appendChild(yr("label",(t.label||"")+": ",l))}else i.appendChild(document.createTextNode(t.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(yr("button",{class:"cm-button",type:"submit"},t.submitLabel||"OK"))}let r=i.nodeName=="FORM"?[i]:i.querySelectorAll("form");for(let l=0;l{u.keyCode==27?(u.preventDefault(),a(null)):u.keyCode==13&&(u.preventDefault(),a(c))}),c.addEventListener("submit",u=>{u.preventDefault(),a(c)})}let s=yr("div",i,yr("button",{onclick:()=>a(null),"aria-label":e.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));t.class&&(s.className=t.class),s.classList.add("cm-dialog");function a(l){s.contains(s.ownerDocument.activeElement)&&e.focus(),n(l)}return{dom:s,top:t.top,mount:()=>{if(t.focus){let l;typeof t.focus=="string"?l=i.querySelector(t.focus):l=i.querySelector("input")||i.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class Nh extends Em{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}Nh.prototype.elementClass="";Nh.prototype.toDOM=void 0;Nh.prototype.mapMode=eo.TrackBefore;Nh.prototype.startSide=Nh.prototype.endSide=-1;Nh.prototype.point=!0;const IA=Zt.define(),VTt=Zt.define(),HTt={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>xi.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},zO=Zt.define();function qTt(e){return[W2e(),zO.of({...HTt,...e})]}const fJ=Zt.define({combine:e=>e.some(t=>t)});function W2e(e){return[WTt]}const WTt=Ts.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(zO).map(t=>new pJ(e,t)),this.fixed=!e.state.facet(fJ);for(let t of this.gutters)t.config.side=="after"?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,i=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(i<(n.to-n.from)*.8)}if(e.geometryChanged){let t=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=t,this.domAfter&&(this.domAfter.style.minHeight=t)}this.view.state.facet(fJ)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=xi.iter(this.view.state.facet(IA),this.view.viewport.from),i=[],r=this.gutters.map(s=>new GTt(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let a=!0;for(let l of s.type)if(l.type==io.Text&&a){V$(n,i,l.from);for(let c of r)c.line(this.view,l,i);a=!1}else if(l.widget)for(let c of r)c.widget(this.view,l)}else if(s.type==io.Text){V$(n,i,s.from);for(let a of r)a.line(this.view,s,i)}else if(s.widget)for(let a of r)a.widget(this.view,s);for(let s of r)s.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(zO),n=e.state.facet(zO),i=e.docChanged||e.heightChanged||e.viewportChanged||!xi.eq(e.startState.facet(IA),e.state.facet(IA),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let r of this.gutters)r.update(e)&&(i=!0);else{i=!0;let r=[];for(let s of n){let a=t.indexOf(s);a<0?r.push(new pJ(this.view,s)):(this.gutters[a].update(e),r.push(this.gutters[a]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>zt.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let i=n.dom.offsetWidth*t.scaleX,r=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==Cr.LTR?{left:i,right:r}:{right:i,left:r}})});function hJ(e){return Array.isArray(e)?e:[e]}function V$(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class GTt{constructor(t,n,i){this.gutter=t,this.height=i,this.i=0,this.cursor=xi.iter(t.markers,n.from)}addElement(t,n,i){let{gutter:r}=this,s=(n.top-this.height)/t.scaleY,a=n.height/t.scaleY;if(this.i==r.elements.length){let l=new G2e(t,a,s,i);r.elements.push(l),r.dom.appendChild(l.dom)}else r.elements[this.i].update(t,a,s,i);this.height=n.bottom,this.i++}line(t,n,i){let r=[];V$(this.cursor,r,n.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(t,n,r);s&&r.unshift(s);let a=this.gutter;r.length==0&&!a.config.renderEmptyElements||this.addElement(t,n,r)}widget(t,n){let i=this.gutter.config.widgetMarker(t,n.widget,n),r=i?[i]:null;for(let s of t.state.facet(VTt)){let a=s(t,n.widget,n);a&&(r||(r=[])).push(a)}r&&this.addElement(t,n,r)}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let n=t.elements.pop();t.dom.removeChild(n.dom),n.destroy()}}}class pJ{constructor(t,n){this.view=t,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in n.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,a;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let c=s.getBoundingClientRect();a=(c.top+c.bottom)/2}else a=r.clientY;let l=t.lineBlockAtHeight(a-t.documentTop);n.domEventHandlers[i](t,l,r)&&r.preventDefault()});this.markers=hJ(n.markers(t)),n.initialSpacer&&(this.spacer=new G2e(t,0,0,[n.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let n=this.markers;if(this.markers=hJ(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],t);r!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[r])}let i=t.view.viewport;return!xi.eq(this.markers,n,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(t):!1)}destroy(){for(let t of this.elements)t.destroy()}}class G2e{constructor(t,n,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,n,i,r)}update(t,n,i,r){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),KTt(this.markers,r)||this.setMarkers(t,r)}setMarkers(t,n){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,a=0;;){let l=a,c=ss(l,c,u)||a(l,c,u):a}return i}})}});class g5 extends Nh{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function b5(e,t){return e.state.facet(Ly).formatNumber(t,e.state)}const ZTt=zO.compute([Ly],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(t){return t.state.facet(XTt)},lineMarker(t,n,i){return i.some(r=>r.toDOM)?null:new g5(b5(t,t.state.doc.lineAt(n.from).number))},widgetMarker:(t,n,i)=>{for(let r of t.state.facet(YTt)){let s=r(t,n,i);if(s)return s}return null},lineMarkerChange:t=>t.startState.facet(Ly)!=t.state.facet(Ly),initialSpacer(t){return new g5(b5(t,mJ(t.state.doc.lines)))},updateSpacer(t,n){let i=b5(n.view,mJ(n.view.state.doc.lines));return i==t.number?t:new g5(i)},domEventHandlers:e.facet(Ly).domEventHandlers,side:"before"}));function K2e(e={}){return[Ly.of(e),W2e(),ZTt]}function mJ(e){let t=9;for(;t{let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.head).from;r>n&&(n=r,t.push(JTt.range(r)))}return xi.of(t)});function t2t(){return e2t}let n2t=0,gd=class H${constructor(t,n,i,r){this.name=t,this.set=n,this.base=i,this.modified=r,this.id=n2t++}toString(){let{name:t}=this;for(let n of this.modified)n.name&&(t=`${n.name}(${t})`);return t}static define(t,n){let i=typeof t=="string"?t:"?";if(t instanceof H$&&(n=t),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let r=new H$(i,[],null,[]);if(r.set.push(r),n)for(let s of n.set)r.set.push(s);return r}static defineModifier(t){let n=new BN(t);return i=>i.modified.indexOf(n)>-1?i:BN.get(i.base||i,i.modified.concat(n).sort((r,s)=>r.id-s.id))}},i2t=0;class BN{constructor(t){this.name=t,this.instances=[],this.id=i2t++}static get(t,n){if(!n.length)return t;let i=n[0].instances.find(l=>l.base==t&&r2t(n,l.modified));if(i)return i;let r=[],s=new gd(t.name,r,t,n);for(let l of n)l.instances.push(s);let a=s2t(n);for(let l of t.set)if(!l.modified.length)for(let c of a)r.push(BN.get(l,c));return s}}function r2t(e,t){return e.length==t.length&&e.every((n,i)=>n==t[i])}function s2t(e){let t=[[]];for(let n=0;ni.length-n.length)}function Vh(e){let t=Object.create(null);for(let n in e){let i=e[n];Array.isArray(i)||(i=[i]);for(let r of n.split(" "))if(r){let s=[],a=2,l=r;for(let f=0;;){if(l=="..."&&f>0&&f+3==r.length){a=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!h)throw new RangeError("Invalid path: "+r);if(s.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==r.length)break;let p=r[f++];if(f==r.length&&p=="!"){a=0;break}if(p!="/")throw new RangeError("Invalid path: "+r);l=r.slice(f)}let c=s.length-1,u=s[c];if(!u)throw new RangeError("Invalid path: "+r);let d=new ak(i,a,c>0?s.slice(0,c):null);t[u]=d.sort(t[u])}}return X2e.add(t)}const X2e=new Ln({combine(e,t){let n,i,r;for(;e||t;){if(!e||t&&e.depth>=t.depth?(r=t,t=t.next):(r=e,e=e.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let s=new ak(r.tags,r.mode,r.context);n?n.next=s:i=s,n=s}return i}});let ak=class{constructor(t,n,i,r){this.tags=t,this.mode=n,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth{let a=r;for(let l of s)for(let c of l.set){let u=n[c.id];if(u){a=a?a+" "+u:u;break}}return a},scope:i}}function a2t(e,t){let n=null;for(let i of e){let r=i.style(t);r&&(n=n?n+" "+r:r)}return n}function o2t(e,t,n,i=0,r=e.length){let s=new l2t(i,Array.isArray(t)?t:[t],n);s.highlightRange(e.cursor(),i,r,"",s.highlighters),s.flush(r)}class l2t{constructor(t,n,i){this.at=t,this.highlighters=n,this.span=i,this.class=""}startSpan(t,n){n!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=n)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,n,i,r,s){let{type:a,from:l,to:c}=t;if(l>=i||c<=n)return;a.isTop&&(s=this.highlighters.filter(p=>!p.scope||p.scope(a)));let u=r,d=c2t(t)||ak.empty,f=a2t(s,d.tags);if(f&&(u&&(u+=" "),u+=f,d.mode==1&&(r+=(r?" ":"")+f)),this.startSpan(Math.max(n,l),u),d.opaque)return;let h=t.tree&&t.tree.prop(Ln.mounted);if(h&&h.overlay){let p=t.node.enter(h.overlay[0].from+l,1),g=this.highlighters.filter(v=>!v.scope||v.scope(h.tree.type)),b=t.firstChild();for(let v=0,y=l;;v++){let x=v=O||!t.nextSibling())););if(!x||O>i)break;y=x.to+l,y>n&&(this.highlightRange(p.cursor(),Math.max(n,x.from+l),Math.min(i,y),"",g),this.startSpan(Math.min(i,y),u))}b&&t.parent()}else if(t.firstChild()){h&&(r="");do if(!(t.to<=n)){if(t.from>=i)break;this.highlightRange(t,n,i,r,s),this.startSpan(Math.min(i,t.to),u)}while(t.nextSibling());t.parent()}}}function c2t(e){let t=e.type.prop(X2e);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const qt=gd.define,a2=qt(),Sp=qt(),gJ=qt(Sp),bJ=qt(Sp),kp=qt(),o2=qt(kp),y5=qt(kp),fd=qt(),ag=qt(fd),ld=qt(),cd=qt(),q$=qt(),J1=qt(q$),l2=qt(),ne={comment:a2,lineComment:qt(a2),blockComment:qt(a2),docComment:qt(a2),name:Sp,variableName:qt(Sp),typeName:gJ,tagName:qt(gJ),propertyName:bJ,attributeName:qt(bJ),className:qt(Sp),labelName:qt(Sp),namespace:qt(Sp),macroName:qt(Sp),literal:kp,string:o2,docString:qt(o2),character:qt(o2),attributeValue:qt(o2),number:y5,integer:qt(y5),float:qt(y5),bool:qt(kp),regexp:qt(kp),escape:qt(kp),color:qt(kp),url:qt(kp),keyword:ld,self:qt(ld),null:qt(ld),atom:qt(ld),unit:qt(ld),modifier:qt(ld),operatorKeyword:qt(ld),controlKeyword:qt(ld),definitionKeyword:qt(ld),moduleKeyword:qt(ld),operator:cd,derefOperator:qt(cd),arithmeticOperator:qt(cd),logicOperator:qt(cd),bitwiseOperator:qt(cd),compareOperator:qt(cd),updateOperator:qt(cd),definitionOperator:qt(cd),typeOperator:qt(cd),controlOperator:qt(cd),punctuation:q$,separator:qt(q$),bracket:J1,angleBracket:qt(J1),squareBracket:qt(J1),paren:qt(J1),brace:qt(J1),content:fd,heading:ag,heading1:qt(ag),heading2:qt(ag),heading3:qt(ag),heading4:qt(ag),heading5:qt(ag),heading6:qt(ag),contentSeparator:qt(fd),list:qt(fd),quote:qt(fd),emphasis:qt(fd),strong:qt(fd),link:qt(fd),monospace:qt(fd),strikethrough:qt(fd),inserted:qt(),deleted:qt(),changed:qt(),invalid:qt(),meta:l2,documentMeta:qt(l2),annotation:qt(l2),processingInstruction:qt(l2),definition:gd.defineModifier("definition"),constant:gd.defineModifier("constant"),function:gd.defineModifier("function"),standard:gd.defineModifier("standard"),local:gd.defineModifier("local"),special:gd.defineModifier("special")};for(let e in ne){let t=ne[e];t instanceof gd&&(t.name=e)}Y2e([{tag:ne.link,class:"tok-link"},{tag:ne.heading,class:"tok-heading"},{tag:ne.emphasis,class:"tok-emphasis"},{tag:ne.strong,class:"tok-strong"},{tag:ne.keyword,class:"tok-keyword"},{tag:ne.atom,class:"tok-atom"},{tag:ne.bool,class:"tok-bool"},{tag:ne.url,class:"tok-url"},{tag:ne.labelName,class:"tok-labelName"},{tag:ne.inserted,class:"tok-inserted"},{tag:ne.deleted,class:"tok-deleted"},{tag:ne.literal,class:"tok-literal"},{tag:ne.string,class:"tok-string"},{tag:ne.number,class:"tok-number"},{tag:[ne.regexp,ne.escape,ne.special(ne.string)],class:"tok-string2"},{tag:ne.variableName,class:"tok-variableName"},{tag:ne.local(ne.variableName),class:"tok-variableName tok-local"},{tag:ne.definition(ne.variableName),class:"tok-variableName tok-definition"},{tag:ne.special(ne.variableName),class:"tok-variableName2"},{tag:ne.definition(ne.propertyName),class:"tok-propertyName tok-definition"},{tag:ne.typeName,class:"tok-typeName"},{tag:ne.namespace,class:"tok-namespace"},{tag:ne.className,class:"tok-className"},{tag:ne.macroName,class:"tok-macroName"},{tag:ne.propertyName,class:"tok-propertyName"},{tag:ne.operator,class:"tok-operator"},{tag:ne.comment,class:"tok-comment"},{tag:ne.meta,class:"tok-meta"},{tag:ne.invalid,class:"tok-invalid"},{tag:ne.punctuation,class:"tok-punctuation"}]);var v5;const zp=new Ln;function CI(e){return Zt.define({combine:e?t=>t.concat(e):void 0})}const lQ=new Ln;class ec{constructor(t,n,i=[],r=""){this.data=t,this.name=r,Ti.prototype.hasOwnProperty("tree")||Object.defineProperty(Ti.prototype,"tree",{get(){return Or(this)}}),this.parser=n,this.extension=[_m.of(this),Ti.languageData.of((s,a,l)=>{let c=yJ(s,a,l),u=c.type.prop(zp);if(!u)return[];let d=s.facet(u),f=c.type.prop(lQ);if(f){let h=c.resolve(a-c.from,l);for(let p of f)if(p.test(h,s)){let g=s.facet(p.facet);return p.type=="replace"?g:g.concat(d)}}return d})].concat(i)}isActiveAt(t,n,i=-1){return yJ(t,n,i).type.prop(zp)==this.data}findRegions(t){let n=t.facet(_m);if((n==null?void 0:n.data)==this.data)return[{from:0,to:t.doc.length}];if(!n||!n.allowsNesting)return[];let i=[],r=(s,a)=>{if(s.prop(zp)==this.data){i.push({from:a,to:a+s.length});return}let l=s.prop(Ln.mounted);if(l){if(l.tree.prop(zp)==this.data){if(l.overlay)for(let c of l.overlay)i.push({from:c.from+a,to:c.to+a});else i.push({from:a,to:a+s.length});return}else if(l.overlay){let c=i.length;if(r(l.tree,l.overlay[0].from+a),i.length>c)return}}for(let c=0;ci.isTop?n:void 0)]}),t.name)}configure(t,n){return new jh(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Or(e){let t=e.field(ec.state,!1);return t?t.tree:hi.empty}class u2t{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,n){let i=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,n):this.string.slice(t-i,n-i)}}let ew=null;class Ib{constructor(t,n,i=[],r,s,a,l,c){this.parser=t,this.state=n,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=a,this.skipped=l,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(t,n,i){return new Ib(t,n,[],hi.empty,0,i,[],null)}startParse(){return this.parser.startParse(new u2t(this.state.doc),this.fragments)}work(t,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=hi.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof t=="number"){let r=Date.now()+t;t=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=t,this.tree=n,this.fragments=this.withoutTempSkipped(uh.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let n=ew;ew=this;try{return t()}finally{ew=n}}withoutTempSkipped(t){for(let n;n=this.tempSkipped.pop();)t=vJ(t,n.from,n.to);return t}changes(t,n){let{fragments:i,tree:r,treeLen:s,viewport:a,skipped:l}=this;if(this.takeTree(),!t.empty){let c=[];if(t.iterChangedRanges((u,d,f,h)=>c.push({fromA:u,toA:d,fromB:f,toB:h})),i=uh.applyChanges(i,c),r=hi.empty,s=0,a={from:t.mapPos(a.from,-1),to:t.mapPos(a.to,1)},this.skipped.length){l=[];for(let u of this.skipped){let d=t.mapPos(u.from,1),f=t.mapPos(u.to,-1);dt.from&&(this.fragments=vJ(this.fragments,r,s),this.skipped.splice(i--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,n){this.skipped.push({from:t,to:n})}static getSkippingParser(t){return new class extends yI{createParse(n,i,r){let s=r[0].from,a=r[r.length-1].to;return{parsedPos:s,advance(){let c=ew;if(c){for(let u of r)c.tempSkipped.push(u);t&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,t]):t)}return this.parsedPos=a,new hi(ea.none,[],[],a-s)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let n=this.fragments;return this.treeLen>=t&&n.length&&n[0].from==0&&n[0].to>=t}static get(){return ew}}function vJ(e,t,n){return uh.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class lx{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,i)||n.takeTree(),new lx(n)}static init(t){let n=Math.min(3e3,t.doc.length),i=Ib.create(t.facet(_m).parser,t,{from:0,to:n});return i.work(20,n)||i.takeTree(),new lx(i)}}ec.state=ro.define({create:lx.init,update(e,t){for(let n of t.effects)if(n.is(ec.setState))return n.value;return t.startState.facet(_m)!=t.state.facet(_m)?lx.init(t.state):e.apply(t)}});let Z2e=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(Z2e=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const x5=typeof navigator<"u"&&(!((v5=navigator.scheduling)===null||v5===void 0)&&v5.isInputPending)?()=>navigator.scheduling.isInputPending():null,d2t=Ts.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let n=this.view.state.field(ec.state).context;(n.updateViewport(t.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:t}=this.view,n=t.field(ec.state);(n.tree!=n.context.tree||!n.context.isDone(t.doc.length))&&(this.working=Z2e(this.work))}work(t){this.working=null;let n=Date.now();if(this.chunkEndr+1e3,c=s.context.work(()=>x5&&x5()||Date.now()>a,r+(l?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:ec.setState.of(new lx(s.context))})),this.chunkBudget>0&&!(c&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(n=>hl(this.view.state,n)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),_m=Zt.define({combine(e){return e.length?e[0]:null},enables:e=>[ec.state,d2t,zt.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class Nm{constructor(t,n=[]){this.language=t,this.support=n,this.extension=[t,n]}}class UN{constructor(t,n,i,r,s,a=void 0){this.name=t,this.alias=n,this.extensions=i,this.filename=r,this.loadFunc=s,this.support=a,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(t=>this.support=t,t=>{throw this.loading=null,t}))}static of(t){let{load:n,support:i}=t;if(!n){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");n=()=>Promise.resolve(i)}return new UN(t.name,(t.alias||[]).concat(t.name).map(r=>r.toLowerCase()),t.extensions||[],t.filename,n,i)}static matchFilename(t,n){for(let r of t)if(r.filename&&r.filename.test(n))return r;let i=/\.([^.]+)$/.exec(n);if(i){for(let r of t)if(r.extensions.indexOf(i[1])>-1)return r}return null}static matchLanguageName(t,n,i=!0){n=n.toLowerCase();for(let r of t)if(r.alias.some(s=>s==n))return r;if(i)for(let r of t)for(let s of r.alias){let a=n.indexOf(s);if(a>-1&&(s.length>2||!/\w/.test(n[a-1])&&!/\w/.test(n[a+s.length])))return r}return null}}const f2t=Zt.define(),i1=Zt.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(n=>n!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function Pb(e){let t=e.facet(i1);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function ok(e,t){let n="",i=e.tabSize,r=e.facet(i1)[0];if(r==" "){for(;t>=i;)n+=" ",t-=i;r=" "}for(let s=0;s=t?h2t(e,n,t):null}class TI{constructor(t,n={}){this.state=t,this.options=n,this.unit=Pb(t)}lineAt(t,n=1){let i=this.state.doc.lineAt(t),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==t?{text:"",from:t}:(n<0?r-1&&(s+=a-this.countColumn(i,i.search(/\S|$/))),s}countColumn(t,n=t.length){return Uu(t,this.state.tabSize,n)}lineIndent(t,n=1){let{text:i,from:r}=this.lineAt(t,n),s=this.options.overrideIndentation;if(s){let a=s(r);if(a>-1)return a}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Hh=new Ln;function h2t(e,t,n){let i=t.resolveStack(n),r=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let s=[];for(let a=r;a&&!(a.fromi.node.to||a.from==i.node.from&&a.type==i.node.type);a=a.parent)s.push(a);for(let a=s.length-1;a>=0;a--)i={node:s[a],next:i}}return J2e(i,e,n)}function J2e(e,t,n){for(let i=e;i;i=i.next){let r=m2t(i.node);if(r)return r(uQ.create(t,n,i))}return 0}function p2t(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function m2t(e){let t=e.type.prop(Hh);if(t)return t;let n=e.firstChild,i;if(n&&(i=n.type.prop(Ln.closedBy))){let r=e.lastChild,s=r&&i.indexOf(r.name)>-1;return a=>eAe(a,!0,1,void 0,s&&!p2t(a)?r.from:void 0)}return e.parent==null?g2t:null}function g2t(){return 0}class uQ extends TI{constructor(t,n,i){super(t.state,t.options),this.base=t,this.pos=n,this.context=i}get node(){return this.context.node}static create(t,n,i){return new uQ(t,n,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let n=this.state.doc.lineAt(t.from);for(;;){let i=t.resolve(n.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(b2t(i,t))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return J2e(this.context.next,this.base,this.pos)}}function b2t(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function y2t(e){let t=e.node,n=t.childAfter(t.from),i=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,s=e.state.doc.lineAt(n.from),a=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=n.to;;){let c=t.childAfter(l);if(!c||c==i)return null;if(!c.type.isSkipped){if(c.from>=a)return null;let u=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+u}}l=c.to}}function hv({closing:e,align:t=!0,units:n=1}){return i=>eAe(i,t,n,e)}function eAe(e,t,n,i,r){let s=e.textAfter,a=s.match(/^\s*/)[0].length,l=i&&s.slice(a,a+i.length)==i||r==e.pos+a,c=t?y2t(e):null;return c?l?e.column(c.from):e.column(c.to):e.baseIndent+(l?0:e.unit*n)}const v2t=e=>e.baseIndent;function pv({except:e,units:t=1}={}){return n=>{let i=e&&e.test(n.textAfter);return n.baseIndent+(i?0:t*n.unit)}}const x2t=200;function w2t(){return Ti.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:i}=e.newSelection.main,r=n.lineAt(i);if(i>r.from+x2t)return e;let s=n.sliceString(r.from,i);if(!t.some(u=>u.test(s)))return e;let{state:a}=e,l=-1,c=[];for(let{head:u}of a.selection.ranges){let d=a.doc.lineAt(u);if(d.from==l)continue;l=d.from;let f=cQ(a,d.from);if(f==null)continue;let h=/^\s*/.exec(d.text)[0],p=ok(a,f);h!=p&&c.push({from:d.from,to:d.from+h.length,insert:p})}return c.length?[e,{changes:c,sequential:!0}]:e})}const tAe=Zt.define(),qh=new Ln;function LE(e){let t=e.firstChild,n=e.lastChild;return t&&t.ton)continue;if(s&&l.from=t&&u.to>n&&(s=u)}}return s}function S2t(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function QN(e,t,n){for(let i of e.facet(tAe)){let r=i(e,t,n);if(r)return r}return O2t(e,t,n)}function nAe(e,t){let n=t.mapPos(e.from,1),i=t.mapPos(e.to,-1);return n>=i?void 0:{from:n,to:i}}const AI=Fn.define({map:nAe}),$E=Fn.define({map:nAe});function iAe(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(i=>i.from<=n&&i.to>=n)||t.push(e.lineBlockAt(n));return t}const Db=ro.define({create(){return gn.none},update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((i,r)=>e=xJ(e,i,r)),e=e.map(t.changes);let n=[];for(let i of t.effects)i.is(AI)&&!k2t(e,i.value.from,i.value.to)?n.push(i.value):i.is($E)&&(e=e.update({filter:(r,s)=>i.value.from!=r||i.value.to!=s,filterFrom:i.value.from,filterTo:i.value.to}));if(n.length){let{preparePlaceholder:i}=t.state.facet(aAe),r=n.map(s=>(i?gn.replace({widget:new j2t(i(t.state,s))}):wJ).range(s.from,s.to));e=e.update({add:r})}return t.selection&&(e=xJ(e,t.selection.main.head)),e},provide:e=>zt.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(i,r)=>{n.push(i,r)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n{rt&&(i=!0)}),i?e.update({filterFrom:t,filterTo:n,filter:(r,s)=>r>=n||s<=t}):e}function zN(e,t,n){var i;let r=null;return(i=e.field(Db,!1))===null||i===void 0||i.between(t,n,(s,a)=>{(!r||r.from>s)&&(r={from:s,to:a})}),r}function k2t(e,t,n){let i=!1;return e.between(t,t,(r,s)=>{r==t&&s==n&&(i=!0)}),i}function rAe(e,t){return e.field(Db,!1)?t:t.concat(Fn.appendConfig.of(oAe()))}const E2t=e=>{for(let t of iAe(e)){let n=QN(e.state,t.from,t.to);if(n)return e.dispatch({effects:rAe(e.state,[AI.of(n),sAe(e,n)])}),!0}return!1},C2t=e=>{if(!e.state.field(Db,!1))return!1;let t=[];for(let n of iAe(e)){let i=zN(e.state,n.from,n.to);i&&t.push($E.of(i),sAe(e,i,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function sAe(e,t,n=!0){let i=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return zt.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${e.state.phrase("to")} ${r}.`)}const T2t=e=>{let{state:t}=e,n=[];for(let i=0;i{let t=e.state.field(Db,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(i,r)=>{n.push($E.of({from:i,to:r}))}),e.dispatch({effects:n}),!0},_2t=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:E2t},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:C2t},{key:"Ctrl-Alt-[",run:T2t},{key:"Ctrl-Alt-]",run:A2t}],N2t={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},aAe=Zt.define({combine(e){return ef(e,N2t)}});function oAe(e){return[Db,P2t]}function lAe(e,t){let{state:n}=e,i=n.facet(aAe),r=a=>{let l=e.lineBlockAt(e.posAtDOM(a.target)),c=zN(e.state,l.from,l.to);c&&e.dispatch({effects:$E.of(c)}),a.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(e,r,t);let s=document.createElement("span");return s.textContent=i.placeholderText,s.setAttribute("aria-label",n.phrase("folded code")),s.title=n.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}const wJ=gn.replace({widget:new class extends Yu{toDOM(e){return lAe(e,null)}}});class j2t extends Yu{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return lAe(t,this.value)}}const R2t={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class w5 extends Nh{constructor(t,n){super(),this.config=t,this.open=n}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=t.state.phrase(this.open?"Fold line":"Unfold line"),n}}function I2t(e={}){let t={...R2t,...e},n=new w5(t,!0),i=new w5(t,!1),r=Ts.fromClass(class{constructor(a){this.from=a.viewport.from,this.markers=this.buildMarkers(a)}update(a){(a.docChanged||a.viewportChanged||a.startState.facet(_m)!=a.state.facet(_m)||a.startState.field(Db,!1)!=a.state.field(Db,!1)||Or(a.startState)!=Or(a.state)||t.foldingChanged(a))&&(this.markers=this.buildMarkers(a.view))}buildMarkers(a){let l=new Ah;for(let c of a.viewportLineBlocks){let u=zN(a.state,c.from,c.to)?i:QN(a.state,c.from,c.to)?n:null;u&&l.add(c.from,c.from,u)}return l.finish()}}),{domEventHandlers:s}=t;return[r,qTt({class:"cm-foldGutter",markers(a){var l;return((l=a.plugin(r))===null||l===void 0?void 0:l.markers)||xi.empty},initialSpacer(){return new w5(t,!1)},domEventHandlers:{...s,click:(a,l,c)=>{if(s.click&&s.click(a,l,c))return!0;let u=zN(a.state,l.from,l.to);if(u)return a.dispatch({effects:$E.of(u)}),!0;let d=QN(a.state,l.from,l.to);return d?(a.dispatch({effects:AI.of(d)}),!0):!1}}}),oAe()]}const P2t=zt.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class FE{constructor(t,n){this.specs=t;let i;function r(l){let c=Cm.newName();return(i||(i=Object.create(null)))["."+c]=l,c}const s=typeof n.all=="string"?n.all:n.all?r(n.all):void 0,a=n.scope;this.scope=a instanceof ec?l=>l.prop(zp)==a.data:a?l=>l==a:void 0,this.style=Y2e(t.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=i?new Cm(i):null,this.themeType=n.themeType}static define(t,n){return new FE(t,n||{})}}const W$=Zt.define(),cAe=Zt.define({combine(e){return e.length?[e[0]]:null}});function PA(e){let t=e.facet(W$);return t.length?t:e.facet(cAe)}function uAe(e,t){let n=[M2t],i;return e instanceof FE&&(e.module&&n.push(zt.styleModule.of(e.module)),i=e.themeType),t!=null&&t.fallback?n.push(cAe.of(e)):i?n.push(W$.computeN([zt.darkTheme],r=>r.facet(zt.darkTheme)==(i=="dark")?[e]:[])):n.push(W$.of(e)),n}function OHt(e,t,n){let i=PA(e),r=null;if(i){for(let s of i)if(!s.scope||n){let a=s.style(t);a&&(r=r?r+" "+a:a)}}return r}class D2t{constructor(t){this.markCache=Object.create(null),this.tree=Or(t.state),this.decorations=this.buildDeco(t,PA(t.state)),this.decoratedTo=t.viewport.to}update(t){let n=Or(t.state),i=PA(t.state),r=i!=PA(t.startState),{viewport:s}=t.view,a=t.changes.mapPos(this.decoratedTo,1);n.length=s.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=a):(n!=this.tree||t.viewportChanged||r)&&(this.tree=n,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=s.to)}buildDeco(t,n){if(!n||!this.tree.length)return gn.none;let i=new Ah;for(let{from:r,to:s}of t.visibleRanges)o2t(this.tree,n,(a,l,c)=>{i.add(a,l,this.markCache[c]||(this.markCache[c]=gn.mark({class:c})))},r,s);return i.finish()}}const M2t=zh.high(Ts.fromClass(D2t,{decorations:e=>e.decorations})),L2t=FE.define([{tag:ne.meta,color:"#404740"},{tag:ne.link,textDecoration:"underline"},{tag:ne.heading,textDecoration:"underline",fontWeight:"bold"},{tag:ne.emphasis,fontStyle:"italic"},{tag:ne.strong,fontWeight:"bold"},{tag:ne.strikethrough,textDecoration:"line-through"},{tag:ne.keyword,color:"#708"},{tag:[ne.atom,ne.bool,ne.url,ne.contentSeparator,ne.labelName],color:"#219"},{tag:[ne.literal,ne.inserted],color:"#164"},{tag:[ne.string,ne.deleted],color:"#a11"},{tag:[ne.regexp,ne.escape,ne.special(ne.string)],color:"#e40"},{tag:ne.definition(ne.variableName),color:"#00f"},{tag:ne.local(ne.variableName),color:"#30a"},{tag:[ne.typeName,ne.namespace],color:"#085"},{tag:ne.className,color:"#167"},{tag:[ne.special(ne.variableName),ne.macroName],color:"#256"},{tag:ne.definition(ne.propertyName),color:"#00c"},{tag:ne.comment,color:"#940"},{tag:ne.invalid,color:"#f00"}]),$2t=zt.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),dAe=1e4,fAe="()[]{}",hAe=Zt.define({combine(e){return ef(e,{afterCursor:!0,brackets:fAe,maxScanDistance:dAe,renderMatch:U2t})}}),F2t=gn.mark({class:"cm-matchingBracket"}),B2t=gn.mark({class:"cm-nonmatchingBracket"});function U2t(e){let t=[],n=e.matched?F2t:B2t;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function OJ(e){let t=[],n=e.facet(hAe);for(let i of e.selection.ranges){if(!i.empty)continue;let r=_d(e,i.head,-1,n)||i.head>0&&_d(e,i.head-1,1,n)||n.afterCursor&&(_d(e,i.head,1,n)||i.heade.decorations}),z2t=[Q2t,$2t];function V2t(e={}){return[hAe.of(e),z2t]}const pAe=new Ln;function G$(e,t,n){let i=e.prop(t<0?Ln.openedBy:Ln.closedBy);if(i)return i;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==(t<0?1:0))return[n[r+t]]}return null}function K$(e){let t=e.type.prop(pAe);return t?t(e.node):e}function _d(e,t,n,i={}){let r=i.maxScanDistance||dAe,s=i.brackets||fAe,a=Or(e),l=a.resolveInner(t,n);for(let c=l;c;c=c.parent){let u=G$(c.type,n,s);if(u&&c.from0?t>=d.from&&td.from&&t<=d.to))return H2t(e,t,n,c,d,u,s)}}return q2t(e,t,n,a,l.type,r,s)}function H2t(e,t,n,i,r,s,a){let l=i.parent,c={from:r.from,to:r.to},u=0,d=l==null?void 0:l.cursor();if(d&&(n<0?d.childBefore(i.from):d.childAfter(i.to)))do if(n<0?d.to<=i.from:d.from>=i.to){if(u==0&&s.indexOf(d.type.name)>-1&&d.from0)return null;let u={from:n<0?t-1:t,to:n>0?t+1:t},d=e.doc.iterRange(t,n>0?e.doc.length:0),f=0;for(let h=0;!d.next().done&&h<=s;){let p=d.value;n<0&&(h+=p.length);let g=t+h*n;for(let b=n>0?0:p.length-1,v=n>0?p.length:-1;b!=v;b+=n){let y=a.indexOf(p[b]);if(!(y<0||i.resolveInner(g+b,1).type!=r))if(y%2==0==n>0)f++;else{if(f==1)return{start:u,end:{from:g+b,to:g+b+1},matched:y>>1==c>>1};f--}}n>0&&(h+=p.length)}return d.done?{start:u,matched:!1}:null}function SJ(e,t,n,i=0,r=0){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));let s=r;for(let a=i;a=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.posn}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let n=this.string.indexOf(t,this.pos);if(n>-1)return this.pos=n,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPosi?a.toLowerCase():a,s=this.string.substr(this.pos,t.length);return r(s)==r(t)?(n!==!1&&(this.pos+=t.length),!0):null}else{let r=this.string.slice(this.pos).match(t);return r&&r.index>0?null:(r&&n!==!1&&(this.pos+=r[0].length),r)}}current(){return this.string.slice(this.start,this.pos)}}function W2t(e){return{name:e.name||"",token:e.token,blankLine:e.blankLine||(()=>{}),startState:e.startState||(()=>!0),copyState:e.copyState||G2t,indent:e.indent||(()=>null),languageData:e.languageData||{},tokenTable:e.tokenTable||hQ,mergeTokens:e.mergeTokens!==!1}}function G2t(e){if(typeof e!="object")return e;let t={};for(let n in e){let i=e[n];t[n]=i instanceof Array?i.slice():i}return t}const kJ=new WeakMap;class dQ extends ec{constructor(t){let n=CI(t.languageData),i=W2t(t),r,s=new class extends yI{createParse(a,l,c){return new X2t(r,a,l,c)}};super(n,s,[],t.name),this.topNode=J2t(n,this),r=this,this.streamParser=i,this.stateAfter=new Ln({perNode:!0}),this.tokenTable=t.tokenTable?new vAe(i.tokenTable):Z2t}static define(t){return new dQ(t)}getIndent(t){let n,{overrideIndentation:i}=t.options;i&&(n=kJ.get(t.state),n!=null&&n1e4)return null;for(;s=i&&n+t.length<=r&&t.prop(e.stateAfter);if(s)return{state:e.streamParser.copyState(s),pos:n+t.length};for(let a=t.children.length-1;a>=0;a--){let l=t.children[a],c=n+t.positions[a],u=l instanceof hi&&c=t.length)return t;!r&&n==0&&t.type==e.topNode&&(r=!0);for(let s=t.children.length-1;s>=0;s--){let a=t.positions[s],l=t.children[s],c;if(an&&fQ(e,s.tree,0-s.offset,n,l),u;if(c&&c.pos<=i&&(u=gAe(e,s.tree,n+s.offset,c.pos+s.offset,!1)))return{state:c.state,tree:u}}return{state:e.streamParser.startState(r?Pb(r):4),tree:hi.empty}}let X2t=class{constructor(t,n,i,r){this.lang=t,this.input=n,this.fragments=i,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let s=Ib.get(),a=r[0].from,{state:l,tree:c}=K2t(t,i,a,this.to,s==null?void 0:s.state);this.state=l,this.parsedPos=this.chunkStart=a+c.length;for(let u=0;uu.from<=s.viewport.from&&u.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(Pb(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let t=Ib.get(),n=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(n,this.chunkStart+512);for(t&&(i=Math.min(i,t.viewport.to));this.parsedPos=n?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,n),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let n=this.input.chunk(t);if(this.input.lineChunks)n==` `&&(n="");else{let i=n.indexOf(` -`);i>-1&&(n=n.slice(0,i))}return t+n.length<=this.to?n:n.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,n=this.lineAfter(t),i=t+n.length;for(let r=this.rangeIndex;;){let s=this.ranges[r].to;if(s>=i||(n=n.slice(0,s-(i-n.length)),r++,r==this.ranges.length))break;let a=this.ranges[r].from,l=this.lineAfter(a);n+=l,i=a+l.length}return{line:n,end:i}}skipGapsTo(t,n,i){for(;;){let r=this.ranges[this.rangeIndex].to,s=t+n;if(i>0?r>s:r>=s)break;let a=this.ranges[++this.rangeIndex].from;n+=a-r}return n}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(n,r,1),n+=r;let l=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-l}let a=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&a>=0&&this.chunk[a]==t&&this.chunk[a+2]==n?this.chunk[a+2]=i:this.chunk.push(t,n,i,s),r}parseLine(t){let{line:n,end:i}=this.nextLine(),r=0,{streamParser:s}=this.lang,a=new mAe(n,t?t.state.tabSize:4,t?Pb(t.state):2);if(a.eol())s.blankLine(this.state,a.indentUnit);else for(;!a.eol();){let l=bAe(s.token,a,this.state);if(l&&(r=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+a.start,this.parsedPos+a.pos,r)),a.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPost.start)return r}throw new Error("Stream parser failed to advance stream.")}const hQ=Object.create(null),lk=[ea.none],Y2t=new t1(lk),EJ=[],CJ=Object.create(null),yAe=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])yAe[e]=xAe(hQ,t);class vAe{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),yAe)}resolve(t){return t?this.table[t]||(this.table[t]=xAe(this.extra,t)):0}}const Z2t=new vAe(hQ);function O5(e,t){EJ.indexOf(e)>-1||(EJ.push(e),console.warn(t))}function xAe(e,t){let n=[];for(let l of t.split(" ")){let c=[];for(let u of l.split(".")){let d=e[u]||ne[u];d?typeof d=="function"?c.length?c=c.map(d):O5(u,`Modifier ${u} used at start of tag`):c.length?O5(u,`Tag ${u} used as modifier`):c=Array.isArray(d)?d:[d]:O5(u,`Unknown highlighting tag ${u}`)}for(let u of c)n.push(u)}if(!n.length)return 0;let i=t.replace(/ /g,"_"),r=i+" "+n.map(l=>l.id),s=CJ[r];if(s)return s.id;let a=CJ[r]=ea.define({id:lk.length,name:i,props:[Vh({[i]:n})]});return lk.push(a),a.id}function J2t(e,t){let n=ea.define({id:lk.length,name:"Document",props:[zp.add(()=>e),Hh.add(()=>i=>t.getIndent(i))],top:!0});return lk.push(n),n}Cr.RTL,Cr.LTR;var TJ={};class VN{constructor(t,n,i,r,s,a,l,c,u,d=0,f){this.p=t,this.stack=n,this.state=i,this.reducePos=r,this.pos=s,this.score=a,this.buffer=l,this.bufferBase=c,this.curContext=u,this.lookAhead=d,this.parent=f}toString(){return`[${this.stack.filter((t,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,n,i=0){let r=t.parser.context;return new VN(t,[],n,i,i,0,[],0,r?new AJ(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var n;let i=t>>19,r=t&65535,{parser:s}=this.p,a=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[r])===null||n===void 0)&&n.isAnonymous)&&(u==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSizec;)this.stack.pop();this.reduceContext(r,u)}storeNode(t,n,i,r=4,s=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[a-4]==0&&this.buffer[a-1]>-1){if(n==i)return;if(this.buffer[a-2]>=n){this.buffer[a-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(t,n,i,r);else{let a=this.buffer.length;if(a>0&&(this.buffer[a-4]!=0||this.buffer[a-1]<0)){let l=!1;for(let c=a;c>0&&this.buffer[c-2]>i;c-=4)if(this.buffer[c-1]>=0){l=!0;break}if(l)for(;a>0&&this.buffer[a-2]>i;)this.buffer[a]=this.buffer[a-4],this.buffer[a+1]=this.buffer[a-3],this.buffer[a+2]=this.buffer[a-2],this.buffer[a+3]=this.buffer[a-1],a-=4,r>4&&(r-=4)}this.buffer[a]=t,this.buffer[a+1]=n,this.buffer[a+2]=i,this.buffer[a+3]=r}}shift(t,n,i,r){if(t&131072)this.pushState(t&65535,this.pos);else if(t&262144)this.pos=r,this.shiftContext(n,i),n<=this.p.parser.maxNode&&this.buffer.push(n,i,r,4);else{let s=t,{parser:a}=this.p;this.pos=r;let l=a.stateFlag(s,1);!l&&(r>i||n<=a.maxNode)&&(this.reducePos=r),this.pushState(s,l?i:Math.min(i,this.reducePos)),this.shiftContext(n,i),n<=a.maxNode&&this.buffer.push(n,i,r,4)}}apply(t,n,i,r){t&65536?this.reduce(t):this.shift(t,n,i,r)}useNode(t,n){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=t)&&(this.p.reused.push(t),i++);let r=this.pos;this.reducePos=this.pos=r+t.length,this.pushState(n,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let i=t.buffer.slice(n),r=t.bufferBase+n;for(;t&&r==t.bufferBase;)t=t.parent;return new VN(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,t)}recoverByDelete(t,n){let i=t<=this.p.parser.maxNode;i&&this.storeNode(t,this.pos,n,4),this.storeNode(0,this.pos,n,i?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(t){for(let n=new eAt(this);;){let i=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,t);if(i==0)return!1;if(!(i&65536))return!0;n.reduce(i)}}recoverByInsert(t){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let r=[];for(let s=0,a;sc&1&&l==a)||r.push(n[s],a)}n=r}let i=[];for(let r=0;r>19,r=n&65535,s=this.stack.length-i*3;if(s<0||t.getGoto(this.stack[s],r,!1)<0){let a=this.findForcedReduction();if(a==null)return!1;n=a}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:t}=this.p,n=[],i=(r,s)=>{if(!n.includes(r))return n.push(r),t.allActions(r,a=>{if(!(a&393216))if(a&65536){let l=(a>>19)-s;if(l>1){let c=a&65535,u=this.stack.length-l*3;if(u>=0&&t.getGoto(this.stack[u],c,!1)>=0)return l<<19|65536|c}}else{let l=i(a,s+1);if(l!=null)return l}})};return i(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:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let n=0;n0&&this.emitLookAhead()}}class AJ{constructor(t,n){this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}}class eAt{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let n=t&65535,i=t>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=r}}class HN{constructor(t,n,i){this.stack=t,this.pos=n,this.index=i,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new HN(t,n,n-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.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 HN(this.stack,this.pos,this.index)}}function qw(e,t=Uint16Array){if(typeof e!="string")return e;let n=null;for(let i=0,r=0;i=92&&a--,a>=34&&a--;let c=a-32;if(c>=46&&(c-=46,l=!0),s+=c,l)break;s*=46}n?n[r++]=s:n=new t(s)}return n}class DA{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const _J=new DA;class tAt{constructor(t,n){this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=_J,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(t,n){let i=this.range,r=this.rangeIndex,s=this.pos+t;for(;si.to:s>=i.to;){if(r==this.ranges.length-1)return null;let a=this.ranges[++r];s+=a.from-i.to,i=a}return s}clipPos(t){if(t>=this.range.from&&tt)return Math.max(t,n.from);return this.end}peek(t){let n=this.chunkOff+t,i,r;if(n>=0&&n=this.chunk2Pos&&il.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(t,n=0){let i=n?this.resolveOffset(n,-1):this.pos;if(i==null||i=this.chunk2Pos&&this.posthis.range.to?t.slice(0,this.range.to-this.pos):t,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(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,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(t,n){if(n?(this.token=n,n.start=t,n.lookAhead=t+1,n.value=n.extended=-1):this.token=_J,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,n-this.chunkPos);if(t>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,n-this.chunk2Pos);if(t>=this.range.from&&n<=this.range.to)return this.input.read(t,n);let i="";for(let r of this.ranges){if(r.from>=n)break;r.to>t&&(i+=this.input.read(Math.max(r.from,t),Math.min(r.to,n)))}return i}}class mv{constructor(t,n){this.data=t,this.id=n}token(t,n){let{parser:i}=n.p;wAe(this.data,t,n,this.id,i.data,i.tokenPrecTable)}}mv.prototype.contextual=mv.prototype.fallback=mv.prototype.extend=!1;class qN{constructor(t,n,i){this.precTable=n,this.elseToken=i,this.data=typeof t=="string"?qw(t):t}token(t,n){let i=t.pos,r=0;for(;;){let s=t.next<0,a=t.resolveOffset(1,1);if(wAe(this.data,t,n,0,this.data,this.precTable),t.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,a==null)break;t.reset(a,t.token)}r&&(t.reset(i,t.token),t.acceptToken(this.elseToken,r))}}qN.prototype.contextual=mv.prototype.fallback=mv.prototype.extend=!1;class zs{constructor(t,n={}){this.token=t,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function wAe(e,t,n,i,r,s){let a=0,l=1<0){let g=e[p];if(c.allows(g)&&(t.token.value==-1||t.token.value==g||nAt(g,t.token.value,r,s))){t.acceptToken(g);break}}let d=t.next,f=0,h=e[a+2];if(t.next<0&&h>f&&e[u+h*3-3]==65535){a=e[u+h*3-1];continue e}for(;f>1,g=u+p+(p<<1),b=e[g],v=e[g+1]||65536;if(d=v)f=p+1;else{a=e[g+2],t.advance();continue e}}break}}function NJ(e,t,n){for(let i=t,r;(r=e[i])!=65535;i++)if(r==n)return i-t;return-1}function nAt(e,t,n,i){let r=NJ(n,i,t);return r<0||NJ(n,i,e)t)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,t-25)):Math.min(e.length,Math.max(i.from+1,t+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:e.length}}let iAt=class{constructor(t,n){this.fragments=t,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?jJ(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?jJ(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(tt)return this.nextStart=a,null;if(s instanceof hi){if(a==t){if(a=Math.max(this.safeFrom,t)&&(this.trees.push(s),this.start.push(a),this.index.push(0))}else this.index[n]++,this.nextStart=a+s.length}}};class rAt{constructor(t,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(i=>new DA)}getActions(t){let n=0,i=null,{parser:r}=t.p,{tokenizers:s}=r,a=r.stateSlot(t.state,3),l=t.curContext?t.curContext.hash:0,c=0;for(let u=0;uf.end+25&&(c=Math.max(f.lookAhead,c)),f.value!=0)){let h=n;if(f.extended>-1&&(n=this.addActions(t,f.extended,f.end,n)),n=this.addActions(t,f.value,f.end,n),!d.extend&&(i=f,n>h))break}}for(;this.actions.length>n;)this.actions.pop();return c&&t.setLookAhead(c),!i&&t.pos==this.stream.end&&(i=new DA,i.value=t.p.parser.eofTerm,i.start=i.end=t.pos,n=this.addActions(t,i.value,i.end,n)),this.mainToken=i,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let n=new DA,{pos:i,p:r}=t;return n.start=i,n.end=Math.min(i+1,r.stream.end),n.value=i==r.stream.end?r.parser.eofTerm:0,n}updateCachedToken(t,n,i){let r=this.stream.clipPos(i.pos);if(n.token(this.stream.reset(r,t),i),t.value>-1){let{parser:s}=i.p;for(let a=0;a=0&&i.p.parser.dialect.allows(l>>1)){l&1?t.extended=l>>1:t.value=l>>1;break}}}else t.value=0,t.end=this.stream.clipPos(r+1)}putAction(t,n,i,r){for(let s=0;st.bufferLength*4?new iAt(i,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,n=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&t.length==1){let[a]=t;for(;a.forceReduce()&&a.stack.length&&a.stack[a.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;an)i.push(l);else{if(this.advanceStack(l,i,t))continue;{r||(r=[],s=[]),r.push(l);let c=this.tokens.getMainToken(l);s.push(c.value,c.end)}}break}}if(!i.length){let a=r&&oAt(r);if(a)return Dl&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw Dl&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&r){let a=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(a)return Dl&&console.log("Force-finish "+this.stackID(a)),this.stackToTree(a.forceAll())}if(this.recovering){let a=this.recovering==1?1:this.recovering*3;if(i.length>a)for(i.sort((l,c)=>c.score-l.score);i.length>a;)i.pop();i.some(l=>l.reducePos>n)&&this.recovering--}else if(i.length>1){e:for(let a=0;a500&&u.buffer.length>500)if((l.score-u.score||l.buffer.length-u.buffer.length)>0)i.splice(c--,1);else{i.splice(a--,1);continue e}}}i.length>12&&(i.sort((a,l)=>l.score-a.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let a=1;a ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let u=t.curContext&&t.curContext.tracker.strict,d=u?t.curContext.hash:0;for(let f=this.fragments.nodeAt(r);f;){let h=this.parser.nodeSet.types[f.type.id]==f.type?s.getGoto(t.state,f.type.id):-1;if(h>-1&&f.length&&(!u||(f.prop(Ln.contextHash)||0)==d))return t.useNode(f,h),Dl&&console.log(a+this.stackID(t)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof hi)||f.children.length==0||f.positions[0]>0)break;let p=f.children[0];if(p instanceof hi&&f.positions[0]==0)f=p;else break}}let l=s.stateSlot(t.state,4);if(l>0)return t.reduce(l),Dl&&console.log(a+this.stackID(t)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let c=this.tokens.getActions(t);for(let u=0;ur?n.push(g):i.push(g)}return!1}advanceFully(t,n){let i=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>i)return RJ(t,n),!0}}runRecovery(t,n,i){let r=null,s=!1;for(let a=0;a ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Dl&&console.log(d+this.stackID(l)+" (restarted)"),this.advanceFully(l,i))))continue;let f=l.split(),h=d;for(let p=0;p<10&&f.forceReduce()&&(Dl&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,i));p++)Dl&&(h=this.stackID(f)+" -> ");for(let p of l.recoverByInsert(c))Dl&&console.log(d+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,i);this.stream.end>l.pos?(u==l.pos&&(u++,c=0),l.recoverByDelete(c,u),Dl&&console.log(d+this.stackID(l)+` (via recover-delete ${this.parser.getName(c)})`),RJ(l,i)):(!r||r.scoree;class _I{constructor(t){this.start=t.start,this.shift=t.shift||k5,this.reduce=t.reduce||k5,this.reuse=t.reuse||k5,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class Rh extends yI{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let n=t.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let l=0;lt.topRules[l][1]),r=[];for(let l=0;l=0)s(d,c,l[u++]);else{let f=l[u+-d];for(let h=-d;h>0;h--)s(l[u++],c,f);u++}}}this.nodeSet=new t1(n.map((l,c)=>ea.define({name:c>=this.minRepeatTerm?void 0:l,id:c,props:r[c],top:i.indexOf(c)>-1,error:c==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(c)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=vTe;let a=qw(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new mv(a,l):l),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,n,i){let r=new sAt(this,t,n,i);for(let s of this.wrappers)r=s(r,t,n,i);return r}getGoto(t,n,i=!1){let r=this.goto;if(n>=r[0])return-1;for(let s=r[n+1];;){let a=r[s++],l=a&1,c=r[s++];if(l&&i)return c;for(let u=s+(a>>1);s0}validAction(t,n){return!!this.allActions(t,i=>i==n?!0:null)}allActions(t,n){let i=this.stateSlot(t,4),r=i?n(i):void 0;for(let s=this.stateSlot(t,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=Lf(this.data,s+2);else break;r=n(Lf(this.data,s+1))}return r}nextStates(t){let n=[];for(let i=this.stateSlot(t,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Lf(this.data,i+2);else break;if(!(this.data[i+2]&1)){let r=this.data[i+1];n.some((s,a)=>a&1&&s==r)||n.push(this.data[i],r)}}return n}configure(t){let n=Object.assign(Object.create(Rh.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let i=this.topRules[t.top];if(!i)throw new RangeError(`Invalid top rule name ${t.top}`);n.top=i}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(i=>{let r=t.tokenizers.find(s=>s.from==i);return r?r.to:i})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=t.specializers.find(l=>l.from==i.external);if(!s)return i;let a=Object.assign(Object.assign({},i),{external:s.to});return n.specializers[r]=IJ(a),a})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let n=this.dynamicPrecedences;return n==null?0:n[t]||0}parseDialect(t){let n=Object.keys(this.dialects),i=n.map(()=>!1);if(t)for(let s of t.split(" ")){let a=n.indexOf(s);a>=0&&(i[a]=!0)}let r=null;for(let s=0;si)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.scoree.external(n,i)<<1|t}return e.get}const lAt=316,cAt=317,PJ=1,uAt=2,dAt=3,fAt=4,hAt=318,pAt=320,mAt=321,gAt=5,bAt=6,yAt=0,X$=[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],OAe=125,vAt=59,Y$=47,xAt=42,wAt=43,OAt=45,SAt=60,kAt=44,EAt=63,CAt=46,TAt=91,AAt=new _I({start:!1,shift(e,t){return t==gAt||t==bAt||t==pAt?e:t==mAt},strict:!1}),_At=new zs((e,t)=>{let{next:n}=e;(n==OAe||n==-1||t.context)&&e.acceptToken(hAt)},{contextual:!0,fallback:!0}),NAt=new zs((e,t)=>{let{next:n}=e,i;X$.indexOf(n)>-1||n==Y$&&((i=e.peek(1))==Y$||i==xAt)||n!=OAe&&n!=vAt&&n!=-1&&!t.context&&e.acceptToken(lAt)},{contextual:!0}),jAt=new zs((e,t)=>{e.next==TAt&&!t.context&&e.acceptToken(cAt)},{contextual:!0}),RAt=new zs((e,t)=>{let{next:n}=e;if(n==wAt||n==OAt){if(e.advance(),n==e.next){e.advance();let i=!t.context&&t.canShift(PJ);e.acceptToken(i?PJ:uAt)}}else n==EAt&&e.peek(1)==CAt&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(dAt))},{contextual:!0});function E5(e,t){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!t&&e>=48&&e<=57}const IAt=new zs((e,t)=>{if(e.next!=SAt||!t.dialectEnabled(yAt)||(e.advance(),e.next==Y$))return;let n=0;for(;X$.indexOf(e.next)>-1;)e.advance(),n++;if(E5(e.next,!0)){for(e.advance(),n++;E5(e.next,!1);)e.advance(),n++;for(;X$.indexOf(e.next)>-1;)e.advance(),n++;if(e.next==kAt)return;for(let i=0;;i++){if(i==7){if(!E5(e.next,!0))return;break}if(e.next!="extends".charCodeAt(i))break;e.advance(),n++}}e.acceptToken(fAt,-n)}),PAt=Vh({"get set async static":ne.modifier,"for while do if else switch try catch finally return throw break continue default case defer":ne.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":ne.operatorKeyword,"let var const using function class extends":ne.definitionKeyword,"import export from":ne.moduleKeyword,"with debugger new":ne.keyword,TemplateString:ne.special(ne.string),super:ne.atom,BooleanLiteral:ne.bool,this:ne.self,null:ne.null,Star:ne.modifier,VariableName:ne.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":ne.function(ne.variableName),VariableDefinition:ne.definition(ne.variableName),Label:ne.labelName,PropertyName:ne.propertyName,PrivatePropertyName:ne.special(ne.propertyName),"CallExpression/MemberExpression/PropertyName":ne.function(ne.propertyName),"FunctionDeclaration/VariableDefinition":ne.function(ne.definition(ne.variableName)),"ClassDeclaration/VariableDefinition":ne.definition(ne.className),"NewExpression/VariableName":ne.className,PropertyDefinition:ne.definition(ne.propertyName),PrivatePropertyDefinition:ne.definition(ne.special(ne.propertyName)),UpdateOp:ne.updateOperator,"LineComment Hashbang":ne.lineComment,BlockComment:ne.blockComment,Number:ne.number,String:ne.string,Escape:ne.escape,ArithOp:ne.arithmeticOperator,LogicOp:ne.logicOperator,BitOp:ne.bitwiseOperator,CompareOp:ne.compareOperator,RegExp:ne.regexp,Equals:ne.definitionOperator,Arrow:ne.function(ne.punctuation),": Spread":ne.punctuation,"( )":ne.paren,"[ ]":ne.squareBracket,"{ }":ne.brace,"InterpolationStart InterpolationEnd":ne.special(ne.brace),".":ne.derefOperator,", ;":ne.separator,"@":ne.meta,TypeName:ne.typeName,TypeDefinition:ne.definition(ne.typeName),"type enum interface implements namespace module declare":ne.definitionKeyword,"abstract global Privacy readonly override":ne.modifier,"is keyof unique infer asserts":ne.operatorKeyword,JSXAttributeValue:ne.attributeValue,JSXText:ne.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":ne.angleBracket,"JSXIdentifier JSXNameSpacedName":ne.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":ne.attributeName,"JSXBuiltin/JSXIdentifier":ne.standard(ne.tagName)}),DAt={__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},MAt={__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},LAt={__proto__:null,"<":193},$At=Rh.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:AAt,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:[PAt],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:[NAt,jAt,RAt,IAt,2,3,4,5,6,7,8,9,10,11,12,13,14,_At,new qN("$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 qN("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:e=>DAt[e]||-1},{term:343,get:e=>MAt[e]||-1},{term:95,get:e=>LAt[e]||-1}],tokenPrec:15201});class pQ{constructor(t,n,i,r){this.state=t,this.pos=n,this.explicit=i,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let n=Or(this.state).resolveInner(this.pos,-1);for(;n&&t.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(t){let n=this.state.doc.lineAt(this.pos),i=Math.max(n.from,this.pos-250),r=n.text.slice(i-n.from,this.pos-n.from),s=r.search(kAe(t,!1));return s<0?null:{from:i+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(t,n,i){t=="abort"&&this.abortListeners&&(this.abortListeners.push(n),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function DJ(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function FAt(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let s=1;stypeof r=="string"?{label:r}:r),[n,i]=t.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:FAt(t);return r=>{let s=r.matchBefore(i);return s||r.explicit?{from:s?s.from:r.pos,options:t,validFor:n}:null}}function SAe(e,t){return n=>{for(let i=Or(n.state).resolveInner(n.pos,-1);i;i=i.parent){if(e.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return t(n)}}class MJ{constructor(t,n,i,r){this.completion=t,this.source=n,this.match=i,this.score=r}}function lb(e){return e.selection.main.from}function kAe(e,t){var n;let{source:i}=e,r=t&&i[0]!="^",s=i[i.length-1]!="$";return!r&&!s?e:new RegExp(`${r?"^":""}(?:${i})${s?"$":""}`,(n=e.flags)!==null&&n!==void 0?n:e.ignoreCase?"i":"")}const gQ=Jd.define();function BAt(e,t,n,i){let{main:r}=e.selection,s=n-r.from,a=i-r.from;return{...e.changeByRange(l=>{if(l!=r&&n!=i&&e.sliceDoc(l.from+s,l.from+a)!=e.sliceDoc(n,i))return{range:l};let c=e.toText(t);return{changes:{from:l.from+s,to:i==r.from?l.to:l.from+a,insert:c},range:st.cursor(l.from+s+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const LJ=new WeakMap;function UAt(e){if(!Array.isArray(e))return e;let t=LJ.get(e);return t||LJ.set(e,t=mQ(e)),t}const WN=Fn.define(),ck=Fn.define();class QAt{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n=48&&k<=57||k>=97&&k<=122?2:k>=65&&k<=90?1:0:(S=zU(k))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(!x||E==1&&v||w==0&&E!=0)&&(n[f]==k||i[f]==k&&(h=!0)?a[f++]=x:a.length&&(y=!1)),w=E,x+=vd(k)}return f==c&&a[0]==0&&y?this.result(-100+(h?-200:0),a,t):p==c&&g==0?this.ret(-200-t.length+(b==t.length?0:-100),[0,b]):l>-1?this.ret(-700-t.length,[l,l+this.pattern.length]):p==c?this.ret(-900-t.length,[g,b]):f==c?this.result(-100+(h?-200:0)+-700+(y?0:-1100),a,t):n.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,t)}result(t,n,i){let r=[],s=0;for(let a of n){let l=a+(this.astral?vd(ol(i,a)):1);s&&r[s-1]==a?r[s-1]=l:(r[s++]=a,r[s++]=l)}return this.ret(t-i.length,r)}}class zAt{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:VAt,filterStrict:!1,compareCompletions:(t,n)=>(t.sortText||t.label).localeCompare(n.sortText||n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,n)=>t&&n,closeOnBlur:(t,n)=>t&&n,icons:(t,n)=>t&&n,tooltipClass:(t,n)=>i=>$J(t(i),n(i)),optionClass:(t,n)=>i=>$J(t(i),n(i)),addToOptions:(t,n)=>t.concat(n),filterStrict:(t,n)=>t||n})}});function $J(e,t){return e?t?e+" "+t:e:t}function VAt(e,t,n,i,r,s){let a=e.textDirection==Cr.RTL,l=a,c=!1,u="top",d,f,h=t.left-r.left,p=r.right-t.right,g=i.right-i.left,b=i.bottom-i.top;if(l&&h=b||x>t.top?d=n.bottom-t.top:(u="bottom",d=t.bottom-n.top)}let v=(t.bottom-t.top)/s.offsetHeight,y=(t.right-t.left)/s.offsetWidth;return{style:`${u}: ${d/v}px; max-width: ${f/y}px`,class:"cm-completionInfo-"+(c?a?"left-narrow":"right-narrow":l?"left":"right")}}const bQ=Fn.define();function HAt(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(n){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),n.type&&i.classList.add(...n.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),i.setAttribute("aria-hidden","true"),i},position:20}),t.push({render(n,i,r,s){let a=document.createElement("span");a.className="cm-completionLabel";let l=n.displayLabel||n.label,c=0;for(let u=0;uc&&a.appendChild(document.createTextNode(l.slice(c,d)));let h=a.appendChild(document.createElement("span"));h.appendChild(document.createTextNode(l.slice(d,f))),h.className="cm-completionMatchedText",c=f}return cn.position-i.position).map(n=>n.render)}function C5(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let r=Math.floor(t/n);return{from:r*n,to:(r+1)*n}}let i=Math.ceil((e-t)/n);return{from:e-i*n,to:e-(i-1)*n}}class qAt{constructor(t,n,i){this.view=t,this.stateField=n,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:c=>this.placeInfo(c),key:this},this.space=null,this.currentClass="";let r=t.state.field(n),{options:s,selected:a}=r.open,l=t.state.facet(Ma);this.optionContent=HAt(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=C5(s.length,a,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",c=>{let{options:u}=t.state.field(n).open;for(let d=c.target,f;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(f=/-(\d+)$/.exec(d.id))&&+f[1]this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;d!=null&&(t.dispatch({effects:bQ.of(d)}),c.preventDefault())}}),this.dom.addEventListener("focusout",c=>{let u=t.state.field(this.stateField,!1);u&&u.tooltip&&t.state.facet(Ma).closeOnBlur&&c.relatedTarget!=t.contentDOM&&t.dispatch({effects:ck.of(null)})}),this.showOptions(s,r.id)}mount(){this.updateSel()}showOptions(t,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var n;let i=t.state.field(this.stateField),r=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=r){let{options:s,selected:a,disabled:l}=i.open;(!r.open||r.open.options!=s)&&(this.range=C5(s.length,a,t.state.facet(Ma).maxRenderedOptions),this.showOptions(s,i.id)),this.updateSel(),l!=((n=r.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(t){let n=this.tooltipClass(t);if(n!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of n.split(" "))i&&this.dom.classList.add(i);this.currentClass=n}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),n=t.open;(n.selected>-1&&n.selected=this.range.to)&&(this.range=C5(n.options.length,n.selected,this.view.state.facet(Ma).maxRenderedOptions),this.showOptions(n.options,t.id));let i=this.updateSelectedOption(n.selected);if(i){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:s}=r;if(!s)return;let a=typeof s=="string"?document.createTextNode(s):s(r);if(!a)return;"then"in a?a.then(l=>{l&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(l,r)}).catch(l=>hl(this.view.state,l,"completion info")):(this.addInfoPane(a,r),i.setAttribute("aria-describedby",this.info.id))}}addInfoPane(t,n){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",i.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),t.nodeType!=null)i.appendChild(t),this.infoDestroy=null;else{let{dom:r,destroy:s}=t;i.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let n=null;for(let i=this.list.firstChild,r=this.range.from;i;i=i.nextSibling,r++)i.nodeName!="LI"||!i.id?r--:r==t?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),n=i):i.hasAttribute("aria-selected")&&(i.removeAttribute("aria-selected"),i.removeAttribute("aria-describedby"));return n&&GAt(this.list,n),n}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let n=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),r=t.getBoundingClientRect(),s=this.space;if(!s){let a=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:a.clientWidth,bottom:a.clientHeight}}return r.top>Math.min(s.bottom,n.bottom)-10||r.bottom{a.target==r&&a.preventDefault()});let s=null;for(let a=i.from;ai.from||i.from==0))if(s=h,typeof u!="string"&&u.header)r.appendChild(u.header(u));else{let p=r.appendChild(document.createElement("completion-section"));p.textContent=h}}const d=r.appendChild(document.createElement("li"));d.id=n+"-"+a,d.setAttribute("role","option");let f=this.optionClass(l);f&&(d.className=f);for(let h of this.optionContent){let p=h(l,this.view.state,this.view,c);p&&d.appendChild(p)}}return i.from&&r.classList.add("cm-completionListIncompleteTop"),i.tonew qAt(n,e,t)}function GAt(e,t){let n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),r=n.height/e.offsetHeight;i.topn.bottom&&(e.scrollTop+=(i.bottom-n.bottom)/r)}function FJ(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function KAt(e,t){let n=[],i=null,r=null,s=d=>{n.push(d);let{section:f}=d.completion;if(f){i||(i=[]);let h=typeof f=="string"?f:f.name;i.some(p=>p.name==h)||i.push(typeof f=="string"?{name:h}:f)}},a=t.facet(Ma);for(let d of e)if(d.hasResult()){let f=d.result.getMatch;if(d.result.filter===!1)for(let h of d.result.options)s(new MJ(h,d.source,f?f(h):[],1e9-n.length));else{let h=t.sliceDoc(d.from,d.to),p,g=a.filterStrict?new zAt(h):new QAt(h);for(let b of d.result.options)if(p=g.match(b.label)){let v=b.displayLabel?f?f(b,p.matched):[]:p.matched,y=p.score+(b.boost||0);if(s(new MJ(b,d.source,v,y)),typeof b.section=="object"&&b.section.rank==="dynamic"){let{name:x}=b.section;r||(r=Object.create(null)),r[x]=Math.max(y,r[x]||-1e9)}}}}if(i){let d=Object.create(null),f=0,h=(p,g)=>(p.rank==="dynamic"&&g.rank==="dynamic"?r[g.name]-r[p.name]:0)||(typeof p.rank=="number"?p.rank:1e9)-(typeof g.rank=="number"?g.rank:1e9)||(p.nameh.score-f.score||u(f.completion,h.completion))){let f=d.completion;!c||c.label!=f.label||c.detail!=f.detail||c.type!=null&&f.type!=null&&c.type!=f.type||c.apply!=f.apply||c.boost!=f.boost?l.push(d):FJ(d.completion)>FJ(c)&&(l[l.length-1]=d),c=d.completion}return l}class $y{constructor(t,n,i,r,s,a){this.options=t,this.attrs=n,this.tooltip=i,this.timestamp=r,this.selected=s,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new $y(this.options,BJ(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,i,r,s,a){if(r&&!a&&t.some(u=>u.isPending))return r.setDisabled();let l=KAt(t,n);if(!l.length)return r&&t.some(u=>u.isPending)?r.setDisabled():null;let c=n.facet(Ma).selectOnOpen?0:-1;if(r&&r.selected!=c&&r.selected!=-1){let u=r.options[r.selected].completion;for(let d=0;dd.hasResult()?Math.min(u,d.from):u,1e8),create:t_t,above:s.aboveCursor},r?r.timestamp:Date.now(),c,!1)}map(t){return new $y(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new $y(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class GN{constructor(t,n,i){this.active=t,this.id=n,this.open=i}static start(){return new GN(JAt,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,i=n.facet(Ma),s=(i.override||n.languageDataAt("autocomplete",lb(n)).map(UAt)).map(c=>(this.active.find(d=>d.source==c)||new Kc(c,this.active.some(d=>d.state!=0)?1:0)).update(t,i));s.length==this.active.length&&s.every((c,u)=>c==this.active[u])&&(s=this.active);let a=this.open,l=t.effects.some(c=>c.is(yQ));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||s.some(c=>c.hasResult()&&t.changes.touchesRange(c.from,c.to))||!XAt(s,this.active)||l?a=$y.build(s,n,this.id,a,i,l):a&&a.disabled&&!s.some(c=>c.isPending)&&(a=null),!a&&s.every(c=>!c.isPending)&&s.some(c=>c.hasResult())&&(s=s.map(c=>c.hasResult()?new Kc(c.source,0):c));for(let c of t.effects)c.is(bQ)&&(a=a&&a.setSelected(c.value,this.id));return s==this.active&&a==this.open?this:new GN(s,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?YAt:ZAt}}function XAt(e,t){if(e==t)return!0;for(let n=0,i=0;;){for(;n-1&&(n["aria-activedescendant"]=e+"-"+t),n}const JAt=[];function EAe(e,t){if(e.isUserEvent("input.complete")){let i=e.annotation(gQ);if(i&&t.activateOnCompletion(i))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}class Kc{constructor(t,n,i=!1){this.source=t,this.state=n,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let i=EAe(t,n),r=this;(i&8||i&16&&this.touches(t))&&(r=new Kc(r.source,0)),i&4&&r.state==0&&(r=new Kc(this.source,1)),r=r.updateFor(t,i);for(let s of t.effects)if(s.is(WN))r=new Kc(r.source,1,s.value);else if(s.is(ck))r=new Kc(r.source,0);else if(s.is(yQ))for(let a of s.value)a.source==r.source&&(r=a);return r}updateFor(t,n){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(lb(t.state))}}class gv extends Kc{constructor(t,n,i,r,s,a){super(t,3,n),this.limit=i,this.result=r,this.from=s,this.to=a}hasResult(){return!0}updateFor(t,n){var i;if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let s=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),l=lb(t.state);if(l>a||!r||n&2&&(lb(t.startState)==this.from||ln.map(t))}}),ll=ro.define({create(){return GN.start()},update(e,t){return e.update(t)},provide:e=>[aQ.from(e,t=>t.tooltip),$t.contentAttributes.from(e,t=>t.attrs)]});function vQ(e,t){const n=t.completion.apply||t.completion.label;let i=e.state.field(ll).active.find(r=>r.source==t.source);return i instanceof gv?(typeof n=="string"?e.dispatch({...BAt(e.state,n,i.from,i.to),annotations:gQ.of(t.completion)}):n(e,t.completion,i.from,i.to),!0):!1}const t_t=WAt(ll,vQ);function c2(e,t="option"){return n=>{let i=n.state.field(ll,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+r*(e?1:-1):e?0:a-1;return l<0?l=t=="page"?0:a-1:l>=a&&(l=t=="page"?a-1:0),n.dispatch({effects:bQ.of(l)}),!0}}const n_t=e=>{let t=e.state.field(ll,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestampe.state.field(ll,!1)?(e.dispatch({effects:WN.of(!0)}),!0):!1,i_t=e=>{let t=e.state.field(ll,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:ck.of(null)}),!0)};class r_t{constructor(t,n){this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const s_t=50,a_t=1e3,o_t=Ts.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(ll).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(ll),n=e.state.facet(Ma);if(!e.selectionSet&&!e.docChanged&&e.startState.field(ll)==t)return;let i=e.transactions.some(s=>{let a=EAe(s,n);return a&8||(s.selection||s.docChanged)&&!(a&3)});for(let s=0;ss_t&&Date.now()-a.time>a_t){for(let l of a.context.abortListeners)try{l()}catch(c){hl(this.view.state,c)}a.context.abortListeners=null,this.running.splice(s--,1)}else a.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(s=>s.effects.some(a=>a.is(WN)))&&(this.pendingStart=!0);let r=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(s=>s.isPending&&!this.running.some(a=>a.active.source==s.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let s of e.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(ll);for(let n of t.active)n.isPending&&!this.running.some(i=>i.active.source==n.source)&&this.startQuery(n);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ma).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=lb(t),i=new pQ(t,n,e.explicit,this.view),r=new r_t(e,i);this.running.push(r),Promise.resolve(e.source(i)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:ck.of(null)}),hl(this.view.state,s)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ma).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(Ma),i=this.view.state.field(ll);for(let r=0;rl.source==s.active.source);if(a&&a.isPending)if(s.done==null){let l=new Kc(s.active.source,0);for(let c of s.updates)l=l.update(c,n);l.isPending||t.push(l)}else this.startQuery(a)}(t.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:yQ.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(ll,!1);if(t&&t.tooltip&&this.view.state.facet(Ma).closeOnBlur){let n=t.open&&z2e(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:ck.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:WN.of(!1)}),20),this.composing=0}}}),l_t=typeof navigator=="object"&&/Win/.test(navigator.platform),c_t=zh.highest($t.domEventHandlers({keydown(e,t){let n=t.state.field(ll,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(l_t&&e.altKey)||e.metaKey)return!1;let i=n.open.options[n.open.selected],r=n.active.find(a=>a.source==i.source),s=i.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(e.key)>-1&&vQ(t,i),!1}})),CAe=$t.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class u_t{constructor(t,n,i,r){this.field=t,this.line=n,this.from=i,this.to=r}}class xQ{constructor(t,n,i){this.field=t,this.from=n,this.to=i}map(t){let n=t.mapPos(this.from,-1,eo.TrackDel),i=t.mapPos(this.to,1,eo.TrackDel);return n==null||i==null?null:new xQ(this.field,n,i)}}class wQ{constructor(t,n){this.lines=t,this.fieldPositions=n}instantiate(t,n){let i=[],r=[n],s=t.doc.lineAt(n),a=/^\s*/.exec(s.text)[0];for(let c of this.lines){if(i.length){let u=a,d=/^\t*/.exec(c)[0].length;for(let f=0;fnew xQ(c.field,r[c.line]+c.from,r[c.line]+c.to));return{text:i,ranges:l}}static parse(t){let n=[],i=[],r=[],s;for(let a of t.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(a);){let l=s[1]?+s[1]:null,c=s[2]||s[3]||"",u=-1;l===0&&(l=1e9);let d=c.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=u&&h.field++}for(let f of r)if(f.line==i.length&&f.from>s.index){let h=s[2]?3+(s[1]||"").length:2;f.from-=h,f.to-=h}r.push(new u_t(u,i.length,s.index,s.index+d.length)),a=a.slice(0,s.index)+c+a.slice(s.index+s[0].length)}a=a.replace(/\\([{}])/g,(l,c,u)=>{for(let d of r)d.line==i.length&&d.from>u&&(d.from--,d.to--);return c}),i.push(a)}return new wQ(i,r)}}let d_t=gn.widget({widget:new class extends Yu{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),f_t=gn.mark({class:"cm-snippetField"});class r1{constructor(t,n){this.ranges=t,this.active=n,this.deco=gn.set(t.map(i=>(i.from==i.to?d_t:f_t).range(i.from,i.to)),!0)}map(t){let n=[];for(let i of this.ranges){let r=i.map(t);if(!r)return null;n.push(r)}return new r1(n,this.active)}selectionInsideField(t){return t.ranges.every(n=>this.ranges.some(i=>i.field==this.active&&i.from<=n.from&&i.to>=n.to))}}const BE=Fn.define({map(e,t){return e&&e.map(t)}}),h_t=Fn.define(),uk=ro.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(BE))return n.value;if(n.is(h_t)&&e)return new r1(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>$t.decorations.from(e,t=>t?t.deco:gn.none)});function OQ(e,t){return st.create(e.filter(n=>n.field==t).map(n=>st.range(n.from,n.to)))}function p_t(e){let t=wQ.parse(e);return(n,i,r,s)=>{let{text:a,ranges:l}=t.instantiate(n.state,r),{main:c}=n.state.selection,u={changes:{from:r,to:s==c.from?c.to:s,insert:Gi.of(a)},scrollIntoView:!0,annotations:i?[gQ.of(i),Js.userEvent.of("input.complete")]:void 0};if(l.length&&(u.selection=OQ(l,0)),l.some(d=>d.field>0)){let d=new r1(l,0),f=u.effects=[BE.of(d)];n.state.field(uk,!1)===void 0&&f.push(Fn.appendConfig.of([uk,v_t,x_t,CAe]))}n.dispatch(n.state.update(u))}}function TAe(e){return({state:t,dispatch:n})=>{let i=t.field(uk,!1);if(!i||e<0&&i.active==0)return!1;let r=i.active+e,s=e>0&&!i.ranges.some(a=>a.field==r+e);return n(t.update({selection:OQ(i.ranges,r),effects:BE.of(s?null:new r1(i.ranges,r)),scrollIntoView:!0})),!0}}const m_t=({state:e,dispatch:t})=>e.field(uk,!1)?(t(e.update({effects:BE.of(null)})),!0):!1,g_t=TAe(1),b_t=TAe(-1),y_t=[{key:"Tab",run:g_t,shift:b_t},{key:"Escape",run:m_t}],UJ=Kt.define({combine(e){return e.length?e[0]:y_t}}),v_t=zh.highest(n1.compute([UJ],e=>e.facet(UJ)));function ys(e,t){return{...t,apply:p_t(e)}}const x_t=$t.domEventHandlers({mousedown(e,t){let n=t.state.field(uk,!1),i;if(!n||(i=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let r=n.ranges.find(s=>s.from<=i&&s.to>=i);return!r||r.field==n.active?!1:(t.dispatch({selection:OQ(n.ranges,r.field),effects:BE.of(n.ranges.some(s=>s.field>r.field)?new r1(n.ranges,r.field):null),scrollIntoView:!0}),!0)}}),dk={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},zg=Fn.define({map(e,t){let n=t.mapPos(e,-1,eo.TrackAfter);return n??void 0}}),SQ=new class extends Em{};SQ.startSide=1;SQ.endSide=-1;const AAe=ro.define({create(){return xi.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:i=>i>=n.from&&i<=n.to})}for(let n of t.effects)n.is(zg)&&(e=e.update({add:[SQ.range(n.value,n.value+1)]}));return e}});function w_t(){return[S_t,AAe]}const A5="()[]{}<>«»»«[]{}";function _Ae(e){for(let t=0;t{if((O_t?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(i.length>2||i.length==2&&vd(ol(i,0))==1||t!=r.from||n!=r.to)return!1;let s=C_t(e.state,i);return s?(e.dispatch(s),!0):!1}),k_t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=NAe(e,e.selection.main.head).brackets||dk.brackets,r=null,s=e.changeByRange(a=>{if(a.empty){let l=T_t(e.doc,a.head);for(let c of i)if(c==l&&NI(e.doc,a.head)==_Ae(ol(c,0)))return{changes:{from:a.head-c.length,to:a.head+c.length},range:st.cursor(a.head-c.length)}}return{range:r=a}});return r||t(e.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},E_t=[{key:"Backspace",run:k_t}];function C_t(e,t){let n=NAe(e,e.selection.main.head),i=n.brackets||dk.brackets;for(let r of i){let s=_Ae(ol(r,0));if(t==r)return s==r?N_t(e,r,i.indexOf(r+r+r)>-1,n):A_t(e,r,s,n.before||dk.before);if(t==s&&jAe(e,e.selection.main.from))return __t(e,r,s)}return null}function jAe(e,t){let n=!1;return e.field(AAe).between(0,e.doc.length,i=>{i==t&&(n=!0)}),n}function NI(e,t){let n=e.sliceString(t,t+2);return n.slice(0,vd(ol(n,0)))}function T_t(e,t){let n=e.sliceString(t-2,t);return vd(ol(n,0))==n.length?n:n.slice(1)}function A_t(e,t,n,i){let r=null,s=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:n,from:a.to}],effects:zg.of(a.to+t.length),range:st.range(a.anchor+t.length,a.head+t.length)};let l=NI(e.doc,a.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:t+n,from:a.head},effects:zg.of(a.head+t.length),range:st.cursor(a.head+t.length)}:{range:r=a}});return r?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function __t(e,t,n){let i=null,r=e.changeByRange(s=>s.empty&&NI(e.doc,s.head)==n?{changes:{from:s.head,to:s.head+n.length,insert:n},range:st.cursor(s.head+n.length)}:i={range:s});return i?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function N_t(e,t,n,i){let r=i.stringPrefixes||dk.stringPrefixes,s=null,a=e.changeByRange(l=>{if(!l.empty)return{changes:[{insert:t,from:l.from},{insert:t,from:l.to}],effects:zg.of(l.to+t.length),range:st.range(l.anchor+t.length,l.head+t.length)};let c=l.head,u=NI(e.doc,c),d;if(u==t){if(QJ(e,c))return{changes:{insert:t+t,from:c},effects:zg.of(c+t.length),range:st.cursor(c+t.length)};if(jAe(e,c)){let h=n&&e.sliceDoc(c,c+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:c,to:c+h.length,insert:h},range:st.cursor(c+h.length)}}}else{if(n&&e.sliceDoc(c-2*t.length,c)==t+t&&(d=zJ(e,c-2*t.length,r))>-1&&QJ(e,d))return{changes:{insert:t+t+t+t,from:c},effects:zg.of(c+t.length),range:st.cursor(c+t.length)};if(e.charCategorizer(c)(u)!=ns.Word&&zJ(e,c,r)>-1&&!j_t(e,c,t,r))return{changes:{insert:t+t,from:c},effects:zg.of(c+t.length),range:st.cursor(c+t.length)}}return{range:s=l}});return s?null:e.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function QJ(e,t){let n=Or(e).resolveInner(t+1);return n.parent&&n.from==t}function j_t(e,t,n,i){let r=Or(e).resolveInner(t,-1),s=i.reduce((a,l)=>Math.max(a,l.length),0);for(let a=0;a<5;a++){let l=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+s)),c=l.indexOf(n);if(!c||c>-1&&i.indexOf(l.slice(0,c))>-1){let d=r.firstChild;for(;d&&d.from==r.from&&d.to-d.from>n.length+c;){if(e.sliceDoc(d.to-n.length,d.to)==n)return!1;d=d.firstChild}return!0}let u=r.to==t&&r.parent;if(!u)break;r=u}return!1}function zJ(e,t,n){let i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=ns.Word)return t;for(let r of n){let s=t-r.length;if(e.sliceDoc(s,t)==r&&i(e.sliceDoc(s-1,s))!=ns.Word)return s}return-1}function R_t(e={}){return[c_t,ll,Ma.of(e),o_t,I_t,CAe]}const RAe=[{key:"Ctrl-Space",run:T5},{mac:"Alt-`",run:T5},{mac:"Alt-i",run:T5},{key:"Escape",run:i_t},{key:"ArrowDown",run:c2(!0)},{key:"ArrowUp",run:c2(!1)},{key:"PageDown",run:c2(!0,"page")},{key:"PageUp",run:c2(!1,"page")},{key:"Enter",run:n_t}],I_t=zh.highest(n1.computeN([Ma],e=>e.facet(Ma).defaultKeymap?[RAe]:[])),IAe=[ys("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),ys("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),ys("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),ys("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),ys("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),ys(`try { +`);i>-1&&(n=n.slice(0,i))}return t+n.length<=this.to?n:n.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,n=this.lineAfter(t),i=t+n.length;for(let r=this.rangeIndex;;){let s=this.ranges[r].to;if(s>=i||(n=n.slice(0,s-(i-n.length)),r++,r==this.ranges.length))break;let a=this.ranges[r].from,l=this.lineAfter(a);n+=l,i=a+l.length}return{line:n,end:i}}skipGapsTo(t,n,i){for(;;){let r=this.ranges[this.rangeIndex].to,s=t+n;if(i>0?r>s:r>=s)break;let a=this.ranges[++this.rangeIndex].from;n+=a-r}return n}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(n,r,1),n+=r;let l=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-l}let a=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&a>=0&&this.chunk[a]==t&&this.chunk[a+2]==n?this.chunk[a+2]=i:this.chunk.push(t,n,i,s),r}parseLine(t){let{line:n,end:i}=this.nextLine(),r=0,{streamParser:s}=this.lang,a=new mAe(n,t?t.state.tabSize:4,t?Pb(t.state):2);if(a.eol())s.blankLine(this.state,a.indentUnit);else for(;!a.eol();){let l=bAe(s.token,a,this.state);if(l&&(r=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+a.start,this.parsedPos+a.pos,r)),a.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPost.start)return r}throw new Error("Stream parser failed to advance stream.")}const hQ=Object.create(null),lk=[ea.none],Y2t=new t1(lk),EJ=[],CJ=Object.create(null),yAe=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])yAe[e]=xAe(hQ,t);class vAe{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),yAe)}resolve(t){return t?this.table[t]||(this.table[t]=xAe(this.extra,t)):0}}const Z2t=new vAe(hQ);function O5(e,t){EJ.indexOf(e)>-1||(EJ.push(e),console.warn(t))}function xAe(e,t){let n=[];for(let l of t.split(" ")){let c=[];for(let u of l.split(".")){let d=e[u]||ne[u];d?typeof d=="function"?c.length?c=c.map(d):O5(u,`Modifier ${u} used at start of tag`):c.length?O5(u,`Tag ${u} used as modifier`):c=Array.isArray(d)?d:[d]:O5(u,`Unknown highlighting tag ${u}`)}for(let u of c)n.push(u)}if(!n.length)return 0;let i=t.replace(/ /g,"_"),r=i+" "+n.map(l=>l.id),s=CJ[r];if(s)return s.id;let a=CJ[r]=ea.define({id:lk.length,name:i,props:[Vh({[i]:n})]});return lk.push(a),a.id}function J2t(e,t){let n=ea.define({id:lk.length,name:"Document",props:[zp.add(()=>e),Hh.add(()=>i=>t.getIndent(i))],top:!0});return lk.push(n),n}Cr.RTL,Cr.LTR;var TJ={};class VN{constructor(t,n,i,r,s,a,l,c,u,d=0,f){this.p=t,this.stack=n,this.state=i,this.reducePos=r,this.pos=s,this.score=a,this.buffer=l,this.bufferBase=c,this.curContext=u,this.lookAhead=d,this.parent=f}toString(){return`[${this.stack.filter((t,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,n,i=0){let r=t.parser.context;return new VN(t,[],n,i,i,0,[],0,r?new AJ(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var n;let i=t>>19,r=t&65535,{parser:s}=this.p,a=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[r])===null||n===void 0)&&n.isAnonymous)&&(u==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSizec;)this.stack.pop();this.reduceContext(r,u)}storeNode(t,n,i,r=4,s=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[a-4]==0&&this.buffer[a-1]>-1){if(n==i)return;if(this.buffer[a-2]>=n){this.buffer[a-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(t,n,i,r);else{let a=this.buffer.length;if(a>0&&(this.buffer[a-4]!=0||this.buffer[a-1]<0)){let l=!1;for(let c=a;c>0&&this.buffer[c-2]>i;c-=4)if(this.buffer[c-1]>=0){l=!0;break}if(l)for(;a>0&&this.buffer[a-2]>i;)this.buffer[a]=this.buffer[a-4],this.buffer[a+1]=this.buffer[a-3],this.buffer[a+2]=this.buffer[a-2],this.buffer[a+3]=this.buffer[a-1],a-=4,r>4&&(r-=4)}this.buffer[a]=t,this.buffer[a+1]=n,this.buffer[a+2]=i,this.buffer[a+3]=r}}shift(t,n,i,r){if(t&131072)this.pushState(t&65535,this.pos);else if(t&262144)this.pos=r,this.shiftContext(n,i),n<=this.p.parser.maxNode&&this.buffer.push(n,i,r,4);else{let s=t,{parser:a}=this.p;this.pos=r;let l=a.stateFlag(s,1);!l&&(r>i||n<=a.maxNode)&&(this.reducePos=r),this.pushState(s,l?i:Math.min(i,this.reducePos)),this.shiftContext(n,i),n<=a.maxNode&&this.buffer.push(n,i,r,4)}}apply(t,n,i,r){t&65536?this.reduce(t):this.shift(t,n,i,r)}useNode(t,n){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=t)&&(this.p.reused.push(t),i++);let r=this.pos;this.reducePos=this.pos=r+t.length,this.pushState(n,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let i=t.buffer.slice(n),r=t.bufferBase+n;for(;t&&r==t.bufferBase;)t=t.parent;return new VN(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,t)}recoverByDelete(t,n){let i=t<=this.p.parser.maxNode;i&&this.storeNode(t,this.pos,n,4),this.storeNode(0,this.pos,n,i?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(t){for(let n=new eAt(this);;){let i=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,t);if(i==0)return!1;if(!(i&65536))return!0;n.reduce(i)}}recoverByInsert(t){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let r=[];for(let s=0,a;sc&1&&l==a)||r.push(n[s],a)}n=r}let i=[];for(let r=0;r>19,r=n&65535,s=this.stack.length-i*3;if(s<0||t.getGoto(this.stack[s],r,!1)<0){let a=this.findForcedReduction();if(a==null)return!1;n=a}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:t}=this.p,n=[],i=(r,s)=>{if(!n.includes(r))return n.push(r),t.allActions(r,a=>{if(!(a&393216))if(a&65536){let l=(a>>19)-s;if(l>1){let c=a&65535,u=this.stack.length-l*3;if(u>=0&&t.getGoto(this.stack[u],c,!1)>=0)return l<<19|65536|c}}else{let l=i(a,s+1);if(l!=null)return l}})};return i(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:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let n=0;n0&&this.emitLookAhead()}}class AJ{constructor(t,n){this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}}class eAt{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let n=t&65535,i=t>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=r}}class HN{constructor(t,n,i){this.stack=t,this.pos=n,this.index=i,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new HN(t,n,n-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.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 HN(this.stack,this.pos,this.index)}}function qw(e,t=Uint16Array){if(typeof e!="string")return e;let n=null;for(let i=0,r=0;i=92&&a--,a>=34&&a--;let c=a-32;if(c>=46&&(c-=46,l=!0),s+=c,l)break;s*=46}n?n[r++]=s:n=new t(s)}return n}class DA{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const _J=new DA;class tAt{constructor(t,n){this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=_J,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(t,n){let i=this.range,r=this.rangeIndex,s=this.pos+t;for(;si.to:s>=i.to;){if(r==this.ranges.length-1)return null;let a=this.ranges[++r];s+=a.from-i.to,i=a}return s}clipPos(t){if(t>=this.range.from&&tt)return Math.max(t,n.from);return this.end}peek(t){let n=this.chunkOff+t,i,r;if(n>=0&&n=this.chunk2Pos&&il.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(t,n=0){let i=n?this.resolveOffset(n,-1):this.pos;if(i==null||i=this.chunk2Pos&&this.posthis.range.to?t.slice(0,this.range.to-this.pos):t,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(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,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(t,n){if(n?(this.token=n,n.start=t,n.lookAhead=t+1,n.value=n.extended=-1):this.token=_J,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,n-this.chunkPos);if(t>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,n-this.chunk2Pos);if(t>=this.range.from&&n<=this.range.to)return this.input.read(t,n);let i="";for(let r of this.ranges){if(r.from>=n)break;r.to>t&&(i+=this.input.read(Math.max(r.from,t),Math.min(r.to,n)))}return i}}class mv{constructor(t,n){this.data=t,this.id=n}token(t,n){let{parser:i}=n.p;wAe(this.data,t,n,this.id,i.data,i.tokenPrecTable)}}mv.prototype.contextual=mv.prototype.fallback=mv.prototype.extend=!1;class qN{constructor(t,n,i){this.precTable=n,this.elseToken=i,this.data=typeof t=="string"?qw(t):t}token(t,n){let i=t.pos,r=0;for(;;){let s=t.next<0,a=t.resolveOffset(1,1);if(wAe(this.data,t,n,0,this.data,this.precTable),t.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,a==null)break;t.reset(a,t.token)}r&&(t.reset(i,t.token),t.acceptToken(this.elseToken,r))}}qN.prototype.contextual=mv.prototype.fallback=mv.prototype.extend=!1;class zs{constructor(t,n={}){this.token=t,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function wAe(e,t,n,i,r,s){let a=0,l=1<0){let g=e[p];if(c.allows(g)&&(t.token.value==-1||t.token.value==g||nAt(g,t.token.value,r,s))){t.acceptToken(g);break}}let d=t.next,f=0,h=e[a+2];if(t.next<0&&h>f&&e[u+h*3-3]==65535){a=e[u+h*3-1];continue e}for(;f>1,g=u+p+(p<<1),b=e[g],v=e[g+1]||65536;if(d=v)f=p+1;else{a=e[g+2],t.advance();continue e}}break}}function NJ(e,t,n){for(let i=t,r;(r=e[i])!=65535;i++)if(r==n)return i-t;return-1}function nAt(e,t,n,i){let r=NJ(n,i,t);return r<0||NJ(n,i,e)t)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,t-25)):Math.min(e.length,Math.max(i.from+1,t+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:e.length}}let iAt=class{constructor(t,n){this.fragments=t,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?jJ(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?jJ(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(tt)return this.nextStart=a,null;if(s instanceof hi){if(a==t){if(a=Math.max(this.safeFrom,t)&&(this.trees.push(s),this.start.push(a),this.index.push(0))}else this.index[n]++,this.nextStart=a+s.length}}};class rAt{constructor(t,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(i=>new DA)}getActions(t){let n=0,i=null,{parser:r}=t.p,{tokenizers:s}=r,a=r.stateSlot(t.state,3),l=t.curContext?t.curContext.hash:0,c=0;for(let u=0;uf.end+25&&(c=Math.max(f.lookAhead,c)),f.value!=0)){let h=n;if(f.extended>-1&&(n=this.addActions(t,f.extended,f.end,n)),n=this.addActions(t,f.value,f.end,n),!d.extend&&(i=f,n>h))break}}for(;this.actions.length>n;)this.actions.pop();return c&&t.setLookAhead(c),!i&&t.pos==this.stream.end&&(i=new DA,i.value=t.p.parser.eofTerm,i.start=i.end=t.pos,n=this.addActions(t,i.value,i.end,n)),this.mainToken=i,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let n=new DA,{pos:i,p:r}=t;return n.start=i,n.end=Math.min(i+1,r.stream.end),n.value=i==r.stream.end?r.parser.eofTerm:0,n}updateCachedToken(t,n,i){let r=this.stream.clipPos(i.pos);if(n.token(this.stream.reset(r,t),i),t.value>-1){let{parser:s}=i.p;for(let a=0;a=0&&i.p.parser.dialect.allows(l>>1)){l&1?t.extended=l>>1:t.value=l>>1;break}}}else t.value=0,t.end=this.stream.clipPos(r+1)}putAction(t,n,i,r){for(let s=0;st.bufferLength*4?new iAt(i,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,n=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&t.length==1){let[a]=t;for(;a.forceReduce()&&a.stack.length&&a.stack[a.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;an)i.push(l);else{if(this.advanceStack(l,i,t))continue;{r||(r=[],s=[]),r.push(l);let c=this.tokens.getMainToken(l);s.push(c.value,c.end)}}break}}if(!i.length){let a=r&&oAt(r);if(a)return Dl&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw Dl&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&r){let a=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(a)return Dl&&console.log("Force-finish "+this.stackID(a)),this.stackToTree(a.forceAll())}if(this.recovering){let a=this.recovering==1?1:this.recovering*3;if(i.length>a)for(i.sort((l,c)=>c.score-l.score);i.length>a;)i.pop();i.some(l=>l.reducePos>n)&&this.recovering--}else if(i.length>1){e:for(let a=0;a500&&u.buffer.length>500)if((l.score-u.score||l.buffer.length-u.buffer.length)>0)i.splice(c--,1);else{i.splice(a--,1);continue e}}}i.length>12&&(i.sort((a,l)=>l.score-a.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let a=1;a ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let u=t.curContext&&t.curContext.tracker.strict,d=u?t.curContext.hash:0;for(let f=this.fragments.nodeAt(r);f;){let h=this.parser.nodeSet.types[f.type.id]==f.type?s.getGoto(t.state,f.type.id):-1;if(h>-1&&f.length&&(!u||(f.prop(Ln.contextHash)||0)==d))return t.useNode(f,h),Dl&&console.log(a+this.stackID(t)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof hi)||f.children.length==0||f.positions[0]>0)break;let p=f.children[0];if(p instanceof hi&&f.positions[0]==0)f=p;else break}}let l=s.stateSlot(t.state,4);if(l>0)return t.reduce(l),Dl&&console.log(a+this.stackID(t)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let c=this.tokens.getActions(t);for(let u=0;ur?n.push(g):i.push(g)}return!1}advanceFully(t,n){let i=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>i)return RJ(t,n),!0}}runRecovery(t,n,i){let r=null,s=!1;for(let a=0;a ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Dl&&console.log(d+this.stackID(l)+" (restarted)"),this.advanceFully(l,i))))continue;let f=l.split(),h=d;for(let p=0;p<10&&f.forceReduce()&&(Dl&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,i));p++)Dl&&(h=this.stackID(f)+" -> ");for(let p of l.recoverByInsert(c))Dl&&console.log(d+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,i);this.stream.end>l.pos?(u==l.pos&&(u++,c=0),l.recoverByDelete(c,u),Dl&&console.log(d+this.stackID(l)+` (via recover-delete ${this.parser.getName(c)})`),RJ(l,i)):(!r||r.scoree;class _I{constructor(t){this.start=t.start,this.shift=t.shift||k5,this.reduce=t.reduce||k5,this.reuse=t.reuse||k5,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class Rh extends yI{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let n=t.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let l=0;lt.topRules[l][1]),r=[];for(let l=0;l=0)s(d,c,l[u++]);else{let f=l[u+-d];for(let h=-d;h>0;h--)s(l[u++],c,f);u++}}}this.nodeSet=new t1(n.map((l,c)=>ea.define({name:c>=this.minRepeatTerm?void 0:l,id:c,props:r[c],top:i.indexOf(c)>-1,error:c==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(c)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=vTe;let a=qw(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new mv(a,l):l),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,n,i){let r=new sAt(this,t,n,i);for(let s of this.wrappers)r=s(r,t,n,i);return r}getGoto(t,n,i=!1){let r=this.goto;if(n>=r[0])return-1;for(let s=r[n+1];;){let a=r[s++],l=a&1,c=r[s++];if(l&&i)return c;for(let u=s+(a>>1);s0}validAction(t,n){return!!this.allActions(t,i=>i==n?!0:null)}allActions(t,n){let i=this.stateSlot(t,4),r=i?n(i):void 0;for(let s=this.stateSlot(t,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=Lf(this.data,s+2);else break;r=n(Lf(this.data,s+1))}return r}nextStates(t){let n=[];for(let i=this.stateSlot(t,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Lf(this.data,i+2);else break;if(!(this.data[i+2]&1)){let r=this.data[i+1];n.some((s,a)=>a&1&&s==r)||n.push(this.data[i],r)}}return n}configure(t){let n=Object.assign(Object.create(Rh.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let i=this.topRules[t.top];if(!i)throw new RangeError(`Invalid top rule name ${t.top}`);n.top=i}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(i=>{let r=t.tokenizers.find(s=>s.from==i);return r?r.to:i})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=t.specializers.find(l=>l.from==i.external);if(!s)return i;let a=Object.assign(Object.assign({},i),{external:s.to});return n.specializers[r]=IJ(a),a})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let n=this.dynamicPrecedences;return n==null?0:n[t]||0}parseDialect(t){let n=Object.keys(this.dialects),i=n.map(()=>!1);if(t)for(let s of t.split(" ")){let a=n.indexOf(s);a>=0&&(i[a]=!0)}let r=null;for(let s=0;si)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.scoree.external(n,i)<<1|t}return e.get}const lAt=316,cAt=317,PJ=1,uAt=2,dAt=3,fAt=4,hAt=318,pAt=320,mAt=321,gAt=5,bAt=6,yAt=0,X$=[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],OAe=125,vAt=59,Y$=47,xAt=42,wAt=43,OAt=45,SAt=60,kAt=44,EAt=63,CAt=46,TAt=91,AAt=new _I({start:!1,shift(e,t){return t==gAt||t==bAt||t==pAt?e:t==mAt},strict:!1}),_At=new zs((e,t)=>{let{next:n}=e;(n==OAe||n==-1||t.context)&&e.acceptToken(hAt)},{contextual:!0,fallback:!0}),NAt=new zs((e,t)=>{let{next:n}=e,i;X$.indexOf(n)>-1||n==Y$&&((i=e.peek(1))==Y$||i==xAt)||n!=OAe&&n!=vAt&&n!=-1&&!t.context&&e.acceptToken(lAt)},{contextual:!0}),jAt=new zs((e,t)=>{e.next==TAt&&!t.context&&e.acceptToken(cAt)},{contextual:!0}),RAt=new zs((e,t)=>{let{next:n}=e;if(n==wAt||n==OAt){if(e.advance(),n==e.next){e.advance();let i=!t.context&&t.canShift(PJ);e.acceptToken(i?PJ:uAt)}}else n==EAt&&e.peek(1)==CAt&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(dAt))},{contextual:!0});function E5(e,t){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!t&&e>=48&&e<=57}const IAt=new zs((e,t)=>{if(e.next!=SAt||!t.dialectEnabled(yAt)||(e.advance(),e.next==Y$))return;let n=0;for(;X$.indexOf(e.next)>-1;)e.advance(),n++;if(E5(e.next,!0)){for(e.advance(),n++;E5(e.next,!1);)e.advance(),n++;for(;X$.indexOf(e.next)>-1;)e.advance(),n++;if(e.next==kAt)return;for(let i=0;;i++){if(i==7){if(!E5(e.next,!0))return;break}if(e.next!="extends".charCodeAt(i))break;e.advance(),n++}}e.acceptToken(fAt,-n)}),PAt=Vh({"get set async static":ne.modifier,"for while do if else switch try catch finally return throw break continue default case defer":ne.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":ne.operatorKeyword,"let var const using function class extends":ne.definitionKeyword,"import export from":ne.moduleKeyword,"with debugger new":ne.keyword,TemplateString:ne.special(ne.string),super:ne.atom,BooleanLiteral:ne.bool,this:ne.self,null:ne.null,Star:ne.modifier,VariableName:ne.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":ne.function(ne.variableName),VariableDefinition:ne.definition(ne.variableName),Label:ne.labelName,PropertyName:ne.propertyName,PrivatePropertyName:ne.special(ne.propertyName),"CallExpression/MemberExpression/PropertyName":ne.function(ne.propertyName),"FunctionDeclaration/VariableDefinition":ne.function(ne.definition(ne.variableName)),"ClassDeclaration/VariableDefinition":ne.definition(ne.className),"NewExpression/VariableName":ne.className,PropertyDefinition:ne.definition(ne.propertyName),PrivatePropertyDefinition:ne.definition(ne.special(ne.propertyName)),UpdateOp:ne.updateOperator,"LineComment Hashbang":ne.lineComment,BlockComment:ne.blockComment,Number:ne.number,String:ne.string,Escape:ne.escape,ArithOp:ne.arithmeticOperator,LogicOp:ne.logicOperator,BitOp:ne.bitwiseOperator,CompareOp:ne.compareOperator,RegExp:ne.regexp,Equals:ne.definitionOperator,Arrow:ne.function(ne.punctuation),": Spread":ne.punctuation,"( )":ne.paren,"[ ]":ne.squareBracket,"{ }":ne.brace,"InterpolationStart InterpolationEnd":ne.special(ne.brace),".":ne.derefOperator,", ;":ne.separator,"@":ne.meta,TypeName:ne.typeName,TypeDefinition:ne.definition(ne.typeName),"type enum interface implements namespace module declare":ne.definitionKeyword,"abstract global Privacy readonly override":ne.modifier,"is keyof unique infer asserts":ne.operatorKeyword,JSXAttributeValue:ne.attributeValue,JSXText:ne.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":ne.angleBracket,"JSXIdentifier JSXNameSpacedName":ne.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":ne.attributeName,"JSXBuiltin/JSXIdentifier":ne.standard(ne.tagName)}),DAt={__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},MAt={__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},LAt={__proto__:null,"<":193},$At=Rh.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:AAt,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:[PAt],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:[NAt,jAt,RAt,IAt,2,3,4,5,6,7,8,9,10,11,12,13,14,_At,new qN("$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 qN("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:e=>DAt[e]||-1},{term:343,get:e=>MAt[e]||-1},{term:95,get:e=>LAt[e]||-1}],tokenPrec:15201});class pQ{constructor(t,n,i,r){this.state=t,this.pos=n,this.explicit=i,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let n=Or(this.state).resolveInner(this.pos,-1);for(;n&&t.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(t){let n=this.state.doc.lineAt(this.pos),i=Math.max(n.from,this.pos-250),r=n.text.slice(i-n.from,this.pos-n.from),s=r.search(kAe(t,!1));return s<0?null:{from:i+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(t,n,i){t=="abort"&&this.abortListeners&&(this.abortListeners.push(n),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function DJ(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function FAt(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let s=1;stypeof r=="string"?{label:r}:r),[n,i]=t.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:FAt(t);return r=>{let s=r.matchBefore(i);return s||r.explicit?{from:s?s.from:r.pos,options:t,validFor:n}:null}}function SAe(e,t){return n=>{for(let i=Or(n.state).resolveInner(n.pos,-1);i;i=i.parent){if(e.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return t(n)}}class MJ{constructor(t,n,i,r){this.completion=t,this.source=n,this.match=i,this.score=r}}function lb(e){return e.selection.main.from}function kAe(e,t){var n;let{source:i}=e,r=t&&i[0]!="^",s=i[i.length-1]!="$";return!r&&!s?e:new RegExp(`${r?"^":""}(?:${i})${s?"$":""}`,(n=e.flags)!==null&&n!==void 0?n:e.ignoreCase?"i":"")}const gQ=Jd.define();function BAt(e,t,n,i){let{main:r}=e.selection,s=n-r.from,a=i-r.from;return{...e.changeByRange(l=>{if(l!=r&&n!=i&&e.sliceDoc(l.from+s,l.from+a)!=e.sliceDoc(n,i))return{range:l};let c=e.toText(t);return{changes:{from:l.from+s,to:i==r.from?l.to:l.from+a,insert:c},range:tt.cursor(l.from+s+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const LJ=new WeakMap;function UAt(e){if(!Array.isArray(e))return e;let t=LJ.get(e);return t||LJ.set(e,t=mQ(e)),t}const WN=Fn.define(),ck=Fn.define();class QAt{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n=48&&k<=57||k>=97&&k<=122?2:k>=65&&k<=90?1:0:(S=zU(k))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(!x||E==1&&v||w==0&&E!=0)&&(n[f]==k||i[f]==k&&(h=!0)?a[f++]=x:a.length&&(y=!1)),w=E,x+=vd(k)}return f==c&&a[0]==0&&y?this.result(-100+(h?-200:0),a,t):p==c&&g==0?this.ret(-200-t.length+(b==t.length?0:-100),[0,b]):l>-1?this.ret(-700-t.length,[l,l+this.pattern.length]):p==c?this.ret(-900-t.length,[g,b]):f==c?this.result(-100+(h?-200:0)+-700+(y?0:-1100),a,t):n.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,t)}result(t,n,i){let r=[],s=0;for(let a of n){let l=a+(this.astral?vd(ol(i,a)):1);s&&r[s-1]==a?r[s-1]=l:(r[s++]=a,r[s++]=l)}return this.ret(t-i.length,r)}}class zAt{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:VAt,filterStrict:!1,compareCompletions:(t,n)=>(t.sortText||t.label).localeCompare(n.sortText||n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,n)=>t&&n,closeOnBlur:(t,n)=>t&&n,icons:(t,n)=>t&&n,tooltipClass:(t,n)=>i=>$J(t(i),n(i)),optionClass:(t,n)=>i=>$J(t(i),n(i)),addToOptions:(t,n)=>t.concat(n),filterStrict:(t,n)=>t||n})}});function $J(e,t){return e?t?e+" "+t:e:t}function VAt(e,t,n,i,r,s){let a=e.textDirection==Cr.RTL,l=a,c=!1,u="top",d,f,h=t.left-r.left,p=r.right-t.right,g=i.right-i.left,b=i.bottom-i.top;if(l&&h=b||x>t.top?d=n.bottom-t.top:(u="bottom",d=t.bottom-n.top)}let v=(t.bottom-t.top)/s.offsetHeight,y=(t.right-t.left)/s.offsetWidth;return{style:`${u}: ${d/v}px; max-width: ${f/y}px`,class:"cm-completionInfo-"+(c?a?"left-narrow":"right-narrow":l?"left":"right")}}const bQ=Fn.define();function HAt(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(n){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),n.type&&i.classList.add(...n.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),i.setAttribute("aria-hidden","true"),i},position:20}),t.push({render(n,i,r,s){let a=document.createElement("span");a.className="cm-completionLabel";let l=n.displayLabel||n.label,c=0;for(let u=0;uc&&a.appendChild(document.createTextNode(l.slice(c,d)));let h=a.appendChild(document.createElement("span"));h.appendChild(document.createTextNode(l.slice(d,f))),h.className="cm-completionMatchedText",c=f}return cn.position-i.position).map(n=>n.render)}function C5(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let r=Math.floor(t/n);return{from:r*n,to:(r+1)*n}}let i=Math.ceil((e-t)/n);return{from:e-i*n,to:e-(i-1)*n}}class qAt{constructor(t,n,i){this.view=t,this.stateField=n,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:c=>this.placeInfo(c),key:this},this.space=null,this.currentClass="";let r=t.state.field(n),{options:s,selected:a}=r.open,l=t.state.facet(Ma);this.optionContent=HAt(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=C5(s.length,a,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",c=>{let{options:u}=t.state.field(n).open;for(let d=c.target,f;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(f=/-(\d+)$/.exec(d.id))&&+f[1]this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;d!=null&&(t.dispatch({effects:bQ.of(d)}),c.preventDefault())}}),this.dom.addEventListener("focusout",c=>{let u=t.state.field(this.stateField,!1);u&&u.tooltip&&t.state.facet(Ma).closeOnBlur&&c.relatedTarget!=t.contentDOM&&t.dispatch({effects:ck.of(null)})}),this.showOptions(s,r.id)}mount(){this.updateSel()}showOptions(t,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var n;let i=t.state.field(this.stateField),r=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=r){let{options:s,selected:a,disabled:l}=i.open;(!r.open||r.open.options!=s)&&(this.range=C5(s.length,a,t.state.facet(Ma).maxRenderedOptions),this.showOptions(s,i.id)),this.updateSel(),l!=((n=r.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(t){let n=this.tooltipClass(t);if(n!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of n.split(" "))i&&this.dom.classList.add(i);this.currentClass=n}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),n=t.open;(n.selected>-1&&n.selected=this.range.to)&&(this.range=C5(n.options.length,n.selected,this.view.state.facet(Ma).maxRenderedOptions),this.showOptions(n.options,t.id));let i=this.updateSelectedOption(n.selected);if(i){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:s}=r;if(!s)return;let a=typeof s=="string"?document.createTextNode(s):s(r);if(!a)return;"then"in a?a.then(l=>{l&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(l,r)}).catch(l=>hl(this.view.state,l,"completion info")):(this.addInfoPane(a,r),i.setAttribute("aria-describedby",this.info.id))}}addInfoPane(t,n){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",i.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),t.nodeType!=null)i.appendChild(t),this.infoDestroy=null;else{let{dom:r,destroy:s}=t;i.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let n=null;for(let i=this.list.firstChild,r=this.range.from;i;i=i.nextSibling,r++)i.nodeName!="LI"||!i.id?r--:r==t?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),n=i):i.hasAttribute("aria-selected")&&(i.removeAttribute("aria-selected"),i.removeAttribute("aria-describedby"));return n&&GAt(this.list,n),n}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let n=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),r=t.getBoundingClientRect(),s=this.space;if(!s){let a=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:a.clientWidth,bottom:a.clientHeight}}return r.top>Math.min(s.bottom,n.bottom)-10||r.bottom{a.target==r&&a.preventDefault()});let s=null;for(let a=i.from;ai.from||i.from==0))if(s=h,typeof u!="string"&&u.header)r.appendChild(u.header(u));else{let p=r.appendChild(document.createElement("completion-section"));p.textContent=h}}const d=r.appendChild(document.createElement("li"));d.id=n+"-"+a,d.setAttribute("role","option");let f=this.optionClass(l);f&&(d.className=f);for(let h of this.optionContent){let p=h(l,this.view.state,this.view,c);p&&d.appendChild(p)}}return i.from&&r.classList.add("cm-completionListIncompleteTop"),i.tonew qAt(n,e,t)}function GAt(e,t){let n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),r=n.height/e.offsetHeight;i.topn.bottom&&(e.scrollTop+=(i.bottom-n.bottom)/r)}function FJ(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function KAt(e,t){let n=[],i=null,r=null,s=d=>{n.push(d);let{section:f}=d.completion;if(f){i||(i=[]);let h=typeof f=="string"?f:f.name;i.some(p=>p.name==h)||i.push(typeof f=="string"?{name:h}:f)}},a=t.facet(Ma);for(let d of e)if(d.hasResult()){let f=d.result.getMatch;if(d.result.filter===!1)for(let h of d.result.options)s(new MJ(h,d.source,f?f(h):[],1e9-n.length));else{let h=t.sliceDoc(d.from,d.to),p,g=a.filterStrict?new zAt(h):new QAt(h);for(let b of d.result.options)if(p=g.match(b.label)){let v=b.displayLabel?f?f(b,p.matched):[]:p.matched,y=p.score+(b.boost||0);if(s(new MJ(b,d.source,v,y)),typeof b.section=="object"&&b.section.rank==="dynamic"){let{name:x}=b.section;r||(r=Object.create(null)),r[x]=Math.max(y,r[x]||-1e9)}}}}if(i){let d=Object.create(null),f=0,h=(p,g)=>(p.rank==="dynamic"&&g.rank==="dynamic"?r[g.name]-r[p.name]:0)||(typeof p.rank=="number"?p.rank:1e9)-(typeof g.rank=="number"?g.rank:1e9)||(p.nameh.score-f.score||u(f.completion,h.completion))){let f=d.completion;!c||c.label!=f.label||c.detail!=f.detail||c.type!=null&&f.type!=null&&c.type!=f.type||c.apply!=f.apply||c.boost!=f.boost?l.push(d):FJ(d.completion)>FJ(c)&&(l[l.length-1]=d),c=d.completion}return l}class $y{constructor(t,n,i,r,s,a){this.options=t,this.attrs=n,this.tooltip=i,this.timestamp=r,this.selected=s,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new $y(this.options,BJ(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,i,r,s,a){if(r&&!a&&t.some(u=>u.isPending))return r.setDisabled();let l=KAt(t,n);if(!l.length)return r&&t.some(u=>u.isPending)?r.setDisabled():null;let c=n.facet(Ma).selectOnOpen?0:-1;if(r&&r.selected!=c&&r.selected!=-1){let u=r.options[r.selected].completion;for(let d=0;dd.hasResult()?Math.min(u,d.from):u,1e8),create:t_t,above:s.aboveCursor},r?r.timestamp:Date.now(),c,!1)}map(t){return new $y(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new $y(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class GN{constructor(t,n,i){this.active=t,this.id=n,this.open=i}static start(){return new GN(JAt,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,i=n.facet(Ma),s=(i.override||n.languageDataAt("autocomplete",lb(n)).map(UAt)).map(c=>(this.active.find(d=>d.source==c)||new Kc(c,this.active.some(d=>d.state!=0)?1:0)).update(t,i));s.length==this.active.length&&s.every((c,u)=>c==this.active[u])&&(s=this.active);let a=this.open,l=t.effects.some(c=>c.is(yQ));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||s.some(c=>c.hasResult()&&t.changes.touchesRange(c.from,c.to))||!XAt(s,this.active)||l?a=$y.build(s,n,this.id,a,i,l):a&&a.disabled&&!s.some(c=>c.isPending)&&(a=null),!a&&s.every(c=>!c.isPending)&&s.some(c=>c.hasResult())&&(s=s.map(c=>c.hasResult()?new Kc(c.source,0):c));for(let c of t.effects)c.is(bQ)&&(a=a&&a.setSelected(c.value,this.id));return s==this.active&&a==this.open?this:new GN(s,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?YAt:ZAt}}function XAt(e,t){if(e==t)return!0;for(let n=0,i=0;;){for(;n-1&&(n["aria-activedescendant"]=e+"-"+t),n}const JAt=[];function EAe(e,t){if(e.isUserEvent("input.complete")){let i=e.annotation(gQ);if(i&&t.activateOnCompletion(i))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}class Kc{constructor(t,n,i=!1){this.source=t,this.state=n,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let i=EAe(t,n),r=this;(i&8||i&16&&this.touches(t))&&(r=new Kc(r.source,0)),i&4&&r.state==0&&(r=new Kc(this.source,1)),r=r.updateFor(t,i);for(let s of t.effects)if(s.is(WN))r=new Kc(r.source,1,s.value);else if(s.is(ck))r=new Kc(r.source,0);else if(s.is(yQ))for(let a of s.value)a.source==r.source&&(r=a);return r}updateFor(t,n){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(lb(t.state))}}class gv extends Kc{constructor(t,n,i,r,s,a){super(t,3,n),this.limit=i,this.result=r,this.from=s,this.to=a}hasResult(){return!0}updateFor(t,n){var i;if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let s=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),l=lb(t.state);if(l>a||!r||n&2&&(lb(t.startState)==this.from||ln.map(t))}}),ll=ro.define({create(){return GN.start()},update(e,t){return e.update(t)},provide:e=>[aQ.from(e,t=>t.tooltip),zt.contentAttributes.from(e,t=>t.attrs)]});function vQ(e,t){const n=t.completion.apply||t.completion.label;let i=e.state.field(ll).active.find(r=>r.source==t.source);return i instanceof gv?(typeof n=="string"?e.dispatch({...BAt(e.state,n,i.from,i.to),annotations:gQ.of(t.completion)}):n(e,t.completion,i.from,i.to),!0):!1}const t_t=WAt(ll,vQ);function c2(e,t="option"){return n=>{let i=n.state.field(ll,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+r*(e?1:-1):e?0:a-1;return l<0?l=t=="page"?0:a-1:l>=a&&(l=t=="page"?a-1:0),n.dispatch({effects:bQ.of(l)}),!0}}const n_t=e=>{let t=e.state.field(ll,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestampe.state.field(ll,!1)?(e.dispatch({effects:WN.of(!0)}),!0):!1,i_t=e=>{let t=e.state.field(ll,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:ck.of(null)}),!0)};class r_t{constructor(t,n){this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const s_t=50,a_t=1e3,o_t=Ts.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(ll).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(ll),n=e.state.facet(Ma);if(!e.selectionSet&&!e.docChanged&&e.startState.field(ll)==t)return;let i=e.transactions.some(s=>{let a=EAe(s,n);return a&8||(s.selection||s.docChanged)&&!(a&3)});for(let s=0;ss_t&&Date.now()-a.time>a_t){for(let l of a.context.abortListeners)try{l()}catch(c){hl(this.view.state,c)}a.context.abortListeners=null,this.running.splice(s--,1)}else a.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(s=>s.effects.some(a=>a.is(WN)))&&(this.pendingStart=!0);let r=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(s=>s.isPending&&!this.running.some(a=>a.active.source==s.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let s of e.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(ll);for(let n of t.active)n.isPending&&!this.running.some(i=>i.active.source==n.source)&&this.startQuery(n);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ma).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=lb(t),i=new pQ(t,n,e.explicit,this.view),r=new r_t(e,i);this.running.push(r),Promise.resolve(e.source(i)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:ck.of(null)}),hl(this.view.state,s)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ma).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(Ma),i=this.view.state.field(ll);for(let r=0;rl.source==s.active.source);if(a&&a.isPending)if(s.done==null){let l=new Kc(s.active.source,0);for(let c of s.updates)l=l.update(c,n);l.isPending||t.push(l)}else this.startQuery(a)}(t.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:yQ.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(ll,!1);if(t&&t.tooltip&&this.view.state.facet(Ma).closeOnBlur){let n=t.open&&z2e(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:ck.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:WN.of(!1)}),20),this.composing=0}}}),l_t=typeof navigator=="object"&&/Win/.test(navigator.platform),c_t=zh.highest(zt.domEventHandlers({keydown(e,t){let n=t.state.field(ll,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(l_t&&e.altKey)||e.metaKey)return!1;let i=n.open.options[n.open.selected],r=n.active.find(a=>a.source==i.source),s=i.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(e.key)>-1&&vQ(t,i),!1}})),CAe=zt.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class u_t{constructor(t,n,i,r){this.field=t,this.line=n,this.from=i,this.to=r}}class xQ{constructor(t,n,i){this.field=t,this.from=n,this.to=i}map(t){let n=t.mapPos(this.from,-1,eo.TrackDel),i=t.mapPos(this.to,1,eo.TrackDel);return n==null||i==null?null:new xQ(this.field,n,i)}}class wQ{constructor(t,n){this.lines=t,this.fieldPositions=n}instantiate(t,n){let i=[],r=[n],s=t.doc.lineAt(n),a=/^\s*/.exec(s.text)[0];for(let c of this.lines){if(i.length){let u=a,d=/^\t*/.exec(c)[0].length;for(let f=0;fnew xQ(c.field,r[c.line]+c.from,r[c.line]+c.to));return{text:i,ranges:l}}static parse(t){let n=[],i=[],r=[],s;for(let a of t.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(a);){let l=s[1]?+s[1]:null,c=s[2]||s[3]||"",u=-1;l===0&&(l=1e9);let d=c.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=u&&h.field++}for(let f of r)if(f.line==i.length&&f.from>s.index){let h=s[2]?3+(s[1]||"").length:2;f.from-=h,f.to-=h}r.push(new u_t(u,i.length,s.index,s.index+d.length)),a=a.slice(0,s.index)+c+a.slice(s.index+s[0].length)}a=a.replace(/\\([{}])/g,(l,c,u)=>{for(let d of r)d.line==i.length&&d.from>u&&(d.from--,d.to--);return c}),i.push(a)}return new wQ(i,r)}}let d_t=gn.widget({widget:new class extends Yu{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),f_t=gn.mark({class:"cm-snippetField"});class r1{constructor(t,n){this.ranges=t,this.active=n,this.deco=gn.set(t.map(i=>(i.from==i.to?d_t:f_t).range(i.from,i.to)),!0)}map(t){let n=[];for(let i of this.ranges){let r=i.map(t);if(!r)return null;n.push(r)}return new r1(n,this.active)}selectionInsideField(t){return t.ranges.every(n=>this.ranges.some(i=>i.field==this.active&&i.from<=n.from&&i.to>=n.to))}}const BE=Fn.define({map(e,t){return e&&e.map(t)}}),h_t=Fn.define(),uk=ro.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(BE))return n.value;if(n.is(h_t)&&e)return new r1(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>zt.decorations.from(e,t=>t?t.deco:gn.none)});function OQ(e,t){return tt.create(e.filter(n=>n.field==t).map(n=>tt.range(n.from,n.to)))}function p_t(e){let t=wQ.parse(e);return(n,i,r,s)=>{let{text:a,ranges:l}=t.instantiate(n.state,r),{main:c}=n.state.selection,u={changes:{from:r,to:s==c.from?c.to:s,insert:Gi.of(a)},scrollIntoView:!0,annotations:i?[gQ.of(i),Js.userEvent.of("input.complete")]:void 0};if(l.length&&(u.selection=OQ(l,0)),l.some(d=>d.field>0)){let d=new r1(l,0),f=u.effects=[BE.of(d)];n.state.field(uk,!1)===void 0&&f.push(Fn.appendConfig.of([uk,v_t,x_t,CAe]))}n.dispatch(n.state.update(u))}}function TAe(e){return({state:t,dispatch:n})=>{let i=t.field(uk,!1);if(!i||e<0&&i.active==0)return!1;let r=i.active+e,s=e>0&&!i.ranges.some(a=>a.field==r+e);return n(t.update({selection:OQ(i.ranges,r),effects:BE.of(s?null:new r1(i.ranges,r)),scrollIntoView:!0})),!0}}const m_t=({state:e,dispatch:t})=>e.field(uk,!1)?(t(e.update({effects:BE.of(null)})),!0):!1,g_t=TAe(1),b_t=TAe(-1),y_t=[{key:"Tab",run:g_t,shift:b_t},{key:"Escape",run:m_t}],UJ=Zt.define({combine(e){return e.length?e[0]:y_t}}),v_t=zh.highest(n1.compute([UJ],e=>e.facet(UJ)));function ys(e,t){return{...t,apply:p_t(e)}}const x_t=zt.domEventHandlers({mousedown(e,t){let n=t.state.field(uk,!1),i;if(!n||(i=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let r=n.ranges.find(s=>s.from<=i&&s.to>=i);return!r||r.field==n.active?!1:(t.dispatch({selection:OQ(n.ranges,r.field),effects:BE.of(n.ranges.some(s=>s.field>r.field)?new r1(n.ranges,r.field):null),scrollIntoView:!0}),!0)}}),dk={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},zg=Fn.define({map(e,t){let n=t.mapPos(e,-1,eo.TrackAfter);return n??void 0}}),SQ=new class extends Em{};SQ.startSide=1;SQ.endSide=-1;const AAe=ro.define({create(){return xi.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:i=>i>=n.from&&i<=n.to})}for(let n of t.effects)n.is(zg)&&(e=e.update({add:[SQ.range(n.value,n.value+1)]}));return e}});function w_t(){return[S_t,AAe]}const A5="()[]{}<>«»»«[]{}";function _Ae(e){for(let t=0;t{if((O_t?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(i.length>2||i.length==2&&vd(ol(i,0))==1||t!=r.from||n!=r.to)return!1;let s=C_t(e.state,i);return s?(e.dispatch(s),!0):!1}),k_t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=NAe(e,e.selection.main.head).brackets||dk.brackets,r=null,s=e.changeByRange(a=>{if(a.empty){let l=T_t(e.doc,a.head);for(let c of i)if(c==l&&NI(e.doc,a.head)==_Ae(ol(c,0)))return{changes:{from:a.head-c.length,to:a.head+c.length},range:tt.cursor(a.head-c.length)}}return{range:r=a}});return r||t(e.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},E_t=[{key:"Backspace",run:k_t}];function C_t(e,t){let n=NAe(e,e.selection.main.head),i=n.brackets||dk.brackets;for(let r of i){let s=_Ae(ol(r,0));if(t==r)return s==r?N_t(e,r,i.indexOf(r+r+r)>-1,n):A_t(e,r,s,n.before||dk.before);if(t==s&&jAe(e,e.selection.main.from))return __t(e,r,s)}return null}function jAe(e,t){let n=!1;return e.field(AAe).between(0,e.doc.length,i=>{i==t&&(n=!0)}),n}function NI(e,t){let n=e.sliceString(t,t+2);return n.slice(0,vd(ol(n,0)))}function T_t(e,t){let n=e.sliceString(t-2,t);return vd(ol(n,0))==n.length?n:n.slice(1)}function A_t(e,t,n,i){let r=null,s=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:n,from:a.to}],effects:zg.of(a.to+t.length),range:tt.range(a.anchor+t.length,a.head+t.length)};let l=NI(e.doc,a.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:t+n,from:a.head},effects:zg.of(a.head+t.length),range:tt.cursor(a.head+t.length)}:{range:r=a}});return r?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function __t(e,t,n){let i=null,r=e.changeByRange(s=>s.empty&&NI(e.doc,s.head)==n?{changes:{from:s.head,to:s.head+n.length,insert:n},range:tt.cursor(s.head+n.length)}:i={range:s});return i?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function N_t(e,t,n,i){let r=i.stringPrefixes||dk.stringPrefixes,s=null,a=e.changeByRange(l=>{if(!l.empty)return{changes:[{insert:t,from:l.from},{insert:t,from:l.to}],effects:zg.of(l.to+t.length),range:tt.range(l.anchor+t.length,l.head+t.length)};let c=l.head,u=NI(e.doc,c),d;if(u==t){if(QJ(e,c))return{changes:{insert:t+t,from:c},effects:zg.of(c+t.length),range:tt.cursor(c+t.length)};if(jAe(e,c)){let h=n&&e.sliceDoc(c,c+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:c,to:c+h.length,insert:h},range:tt.cursor(c+h.length)}}}else{if(n&&e.sliceDoc(c-2*t.length,c)==t+t&&(d=zJ(e,c-2*t.length,r))>-1&&QJ(e,d))return{changes:{insert:t+t+t+t,from:c},effects:zg.of(c+t.length),range:tt.cursor(c+t.length)};if(e.charCategorizer(c)(u)!=ns.Word&&zJ(e,c,r)>-1&&!j_t(e,c,t,r))return{changes:{insert:t+t,from:c},effects:zg.of(c+t.length),range:tt.cursor(c+t.length)}}return{range:s=l}});return s?null:e.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function QJ(e,t){let n=Or(e).resolveInner(t+1);return n.parent&&n.from==t}function j_t(e,t,n,i){let r=Or(e).resolveInner(t,-1),s=i.reduce((a,l)=>Math.max(a,l.length),0);for(let a=0;a<5;a++){let l=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+s)),c=l.indexOf(n);if(!c||c>-1&&i.indexOf(l.slice(0,c))>-1){let d=r.firstChild;for(;d&&d.from==r.from&&d.to-d.from>n.length+c;){if(e.sliceDoc(d.to-n.length,d.to)==n)return!1;d=d.firstChild}return!0}let u=r.to==t&&r.parent;if(!u)break;r=u}return!1}function zJ(e,t,n){let i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=ns.Word)return t;for(let r of n){let s=t-r.length;if(e.sliceDoc(s,t)==r&&i(e.sliceDoc(s-1,s))!=ns.Word)return s}return-1}function R_t(e={}){return[c_t,ll,Ma.of(e),o_t,I_t,CAe]}const RAe=[{key:"Ctrl-Space",run:T5},{mac:"Alt-`",run:T5},{mac:"Alt-i",run:T5},{key:"Escape",run:i_t},{key:"ArrowDown",run:c2(!0)},{key:"ArrowUp",run:c2(!1)},{key:"PageDown",run:c2(!0,"page")},{key:"PageUp",run:c2(!1,"page")},{key:"Enter",run:n_t}],I_t=zh.highest(n1.computeN([Ma],e=>e.facet(Ma).defaultKeymap?[RAe]:[])),IAe=[ys("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),ys("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),ys("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),ys("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),ys("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),ys(`try { \${} } catch (\${error}) { \${} @@ -724,24 +724,24 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus constructor(\${params}) { \${} } -}`,{label:"class",detail:"definition",type:"keyword"}),ys('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),ys('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],P_t=IAe.concat([ys("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),ys("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),ys("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),VJ=new QU,PAe=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function tw(e){return(t,n)=>{let i=t.node.getChild("VariableDefinition");return i&&n(i,e),!0}}const D_t=["FunctionDeclaration"],M_t={FunctionDeclaration:tw("function"),ClassDeclaration:tw("class"),ClassExpression:()=>!0,EnumDeclaration:tw("constant"),TypeAliasDeclaration:tw("type"),NamespaceDeclaration:tw("namespace"),VariableDefinition(e,t){e.matchContext(D_t)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function DAe(e,t){let n=VJ.get(t);if(n)return n;let i=[],r=!0;function s(a,l){let c=e.sliceString(a.from,a.to);i.push({label:c,type:l})}return t.cursor(er.IncludeAnonymous).iterate(a=>{if(r)r=!1;else if(a.name){let l=M_t[a.name];if(l&&l(a,s)||PAe.has(a.name))return!1}else if(a.to-a.from>8192){for(let l of DAe(e,a.node))i.push(l);return!1}}),VJ.set(t,i),i}const HJ=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,MAe=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function L_t(e){let t=Or(e.state).resolveInner(e.pos,-1);if(MAe.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&HJ.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let i=[];for(let r=t;r;r=r.parent)PAe.has(r.name)&&(i=i.concat(DAe(e.state.doc,r)));return{options:i,from:n?t.from:e.pos,validFor:HJ}}const $d=jh.define({name:"javascript",parser:$At.configure({props:[Hh.add({IfStatement:pv({except:/^\s*({|else\b)/}),TryStatement:pv({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:v2t,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),i=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:i?1:2)*e.unit},Block:hv({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":pv({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),qh.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":LE,BlockComment(e){return{from:e.from+2,to:e.to-2}},JSXElement(e){let t=e.firstChild;if(!t||t.name=="JSXSelfClosingTag")return null;let n=e.lastChild;return{from:t.to,to:n.type.isError?e.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(e){var t;let n=(t=e.firstChild)===null||t===void 0?void 0:t.nextSibling,i=e.lastChild;return!n||n.type.isError?null:{from:n.to,to:i.type.isError?e.to:i.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),LAe={test:e=>/^JSX/.test(e.name),facet:CI({commentTokens:{block:{open:"{/*",close:"*/}"}}})},$Ae=$d.configure({dialect:"ts"},"typescript"),FAe=$d.configure({dialect:"jsx",props:[lQ.add(e=>e.isTop?[LAe]:void 0)]}),BAe=$d.configure({dialect:"jsx ts",props:[lQ.add(e=>e.isTop?[LAe]:void 0)]},"typescript");let UAe=e=>({label:e,type:"keyword"});const QAe="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(UAe),$_t=QAe.concat(["declare","implements","private","protected","public"].map(UAe));function Z$(e={}){let t=e.jsx?e.typescript?BAe:FAe:e.typescript?$Ae:$d,n=e.typescript?P_t.concat($_t):IAe.concat(QAe);return new Nm(t,[$d.data.of({autocomplete:SAe(MAe,mQ(n))}),$d.data.of({autocomplete:L_t}),e.jsx?U_t:[]])}function F_t(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(e.name=="JSXEscape"||!e.parent)return null;e=e.parent}}function qJ(e,t,n=e.length){for(let i=t==null?void 0:t.firstChild;i;i=i.nextSibling)if(i.name=="JSXIdentifier"||i.name=="JSXBuiltin"||i.name=="JSXNamespacedName"||i.name=="JSXMemberExpression")return e.sliceString(i.from,Math.min(i.to,n));return""}const B_t=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),U_t=$t.inputHandler.of((e,t,n,i,r)=>{if((B_t?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||i!=">"&&i!="/"||!$d.isActiveAt(e.state,t,-1))return!1;let s=r(),{state:a}=s,l=a.changeByRange(c=>{var u;let{head:d}=c,f=Or(a).resolveInner(d-1,-1),h;if(f.name=="JSXStartTag"&&(f=f.parent),!(a.doc.sliceString(d-1,d)!=i||f.name=="JSXAttributeValue"&&f.to>d)){if(i==">"&&f.name=="JSXFragmentTag")return{range:c,changes:{from:d,insert:""}};if(i=="/"&&f.name=="JSXStartCloseTag"){let p=f.parent,g=p.parent;if(g&&p.from==d-2&&((h=qJ(a.doc,g.firstChild,d))||((u=g.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let b=`${h}>`;return{range:st.cursor(d+b.length,-1),changes:{from:d,insert:b}}}}else if(i==">"){let p=F_t(f);if(p&&p.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(a.doc.sliceString(d,d+2))&&(h=qJ(a.doc,p,d)))return{range:c,changes:{from:d,insert:``}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([s,a.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Q_t=Vh({String:ne.string,Number:ne.number,"True False":ne.bool,PropertyName:ne.propertyName,Null:ne.null,", :":ne.separator,"[ ]":ne.squareBracket,"{ }":ne.brace}),z_t=Rh.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[Q_t],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),V_t=jh.define({name:"json",parser:z_t.configure({props:[Hh.add({Object:pv({except:/^\s*\}/}),Array:pv({except:/^\s*\]/})}),qh.add({"Object Array":LE})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function H_t(){return new Nm(V_t)}class KN{static create(t,n,i,r,s){let a=r+(r<<8)+t+(n<<4)|0;return new KN(t,n,i,a,s,[],[])}constructor(t,n,i,r,s,a,l){this.type=t,this.value=n,this.from=i,this.hash=r,this.end=s,this.children=a,this.positions=l,this.hashProp=[[Ln.contextHash,r]]}addChild(t,n){t.prop(Ln.contextHash)!=this.hash&&(t=new hi(t.type,t.children,t.positions,t.length,this.hashProp)),this.children.push(t),this.positions.push(n)}toTree(t,n=this.end){let i=this.children.length-1;return i>=0&&(n=Math.max(n,this.positions[i]+this.children[i].length+this.from)),new hi(t.types[this.type],this.children,this.positions,n-this.from).balance({makeTree:(r,s,a)=>new hi(ea.none,r,s,a,this.hashProp)})}}var Nt;(function(e){e[e.Document=1]="Document",e[e.CodeBlock=2]="CodeBlock",e[e.FencedCode=3]="FencedCode",e[e.Blockquote=4]="Blockquote",e[e.HorizontalRule=5]="HorizontalRule",e[e.BulletList=6]="BulletList",e[e.OrderedList=7]="OrderedList",e[e.ListItem=8]="ListItem",e[e.ATXHeading1=9]="ATXHeading1",e[e.ATXHeading2=10]="ATXHeading2",e[e.ATXHeading3=11]="ATXHeading3",e[e.ATXHeading4=12]="ATXHeading4",e[e.ATXHeading5=13]="ATXHeading5",e[e.ATXHeading6=14]="ATXHeading6",e[e.SetextHeading1=15]="SetextHeading1",e[e.SetextHeading2=16]="SetextHeading2",e[e.HTMLBlock=17]="HTMLBlock",e[e.LinkReference=18]="LinkReference",e[e.Paragraph=19]="Paragraph",e[e.CommentBlock=20]="CommentBlock",e[e.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",e[e.Escape=22]="Escape",e[e.Entity=23]="Entity",e[e.HardBreak=24]="HardBreak",e[e.Emphasis=25]="Emphasis",e[e.StrongEmphasis=26]="StrongEmphasis",e[e.Link=27]="Link",e[e.Image=28]="Image",e[e.InlineCode=29]="InlineCode",e[e.HTMLTag=30]="HTMLTag",e[e.Comment=31]="Comment",e[e.ProcessingInstruction=32]="ProcessingInstruction",e[e.Autolink=33]="Autolink",e[e.HeaderMark=34]="HeaderMark",e[e.QuoteMark=35]="QuoteMark",e[e.ListMark=36]="ListMark",e[e.LinkMark=37]="LinkMark",e[e.EmphasisMark=38]="EmphasisMark",e[e.CodeMark=39]="CodeMark",e[e.CodeText=40]="CodeText",e[e.CodeInfo=41]="CodeInfo",e[e.LinkTitle=42]="LinkTitle",e[e.LinkLabel=43]="LinkLabel",e[e.URL=44]="URL"})(Nt||(Nt={}));class q_t{constructor(t,n){this.start=t,this.content=n,this.marks=[],this.parsers=[]}}class W_t{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let t=this.skipSpace(this.basePos);this.indent=this.countIndent(t,this.pos,this.indent),this.pos=t,this.next=t==this.text.length?-1:this.text.charCodeAt(t)}skipSpace(t){return VO(this.text,t)}reset(t){for(this.text=t,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(t){this.basePos=t,this.baseIndent=this.countIndent(t,this.pos,this.indent)}moveBaseColumn(t){this.baseIndent=t,this.basePos=this.findColumn(t)}addMarker(t){this.markers.push(t)}countIndent(t,n=0,i=0){for(let r=n;r=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let i=(e.type==Nt.OrderedList?CQ:EQ)(n,t,!1);return i>0&&(e.type!=Nt.BulletList||kQ(n,t,!1)<0)&&n.text.charCodeAt(n.pos+i-1)==e.value}const zAe={[Nt.Blockquote](e,t,n){return n.next!=62?!1:(n.markers.push(Fi(Nt.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(ou(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0)},[Nt.ListItem](e,t,n){return n.indent-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[Nt.OrderedList]:WJ,[Nt.BulletList]:WJ,[Nt.Document](){return!0}};function ou(e){return e==32||e==9||e==10||e==13}function VO(e,t=0){for(;tn&&ou(e.charCodeAt(t-1));)t--;return t}function VAe(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(ZAe.SetextHeading)>-1||i<3?-1:1}function qAe(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function EQ(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||ou(e.text.charCodeAt(e.pos+1)))&&(!n||qAe(t,Nt.BulletList)||e.skipSpace(e.pos+2)=48&&r<=57;){i++;if(i==e.text.length)return-1;r=e.text.charCodeAt(i)}return i==e.pos||i>e.pos+9||r!=46&&r!=41||ie.pos+1||e.next!=49)?-1:i+1-e.pos}function WAe(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t6?-1:n}function GAe(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t/,XAe=/\?>/,e8=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/,XAe=/\?>/,e8=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec(i);if(s)return e.append(Fi(Nt.Comment,n,n+1+s[0].length));let a=/^\?[^]*?\?>/.exec(i);if(a)return e.append(Fi(Nt.ProcessingInstruction,n,n+1+a[0].length));let l=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(i);return l?e.append(Fi(Nt.HTMLTag,n,n+1+l[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let i=n+1;for(;e.char(i)==t;)i++;let r=e.slice(n-1,n),s=e.slice(i,i+1),a=hk.test(r),l=hk.test(s),c=/\s|^$/.test(r),u=/\s|^$/.test(s),d=!u&&(!l||c||a),f=!c&&(!a||u||l),h=d&&(t==42||!f||a),p=f&&(t==42||!d||l);return e.append(new ql(t==95?i_e:r_e,n,i,(h?1:0)|(p?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(Fi(Nt.HardBreak,n,n+2));if(t==32){let i=n+1;for(;e.char(i)==32;)i++;if(e.char(i)==10&&i>=n+2)return e.append(Fi(Nt.HardBreak,n,i+1))}return-1},Link(e,t,n){return t==91?e.append(new ql(_g,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new ql(XN,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let i=e.parts.length-1;i>=0;i--){let r=e.parts[i];if(r instanceof ql&&(r.type==_g||r.type==XN)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[i]=null,-1;let s=e.takeContent(i),a=e.parts[i]=J_t(e,s,r.type==_g?Nt.Link:Nt.Image,r.from,n+1);if(r.type==_g)for(let l=0;lt?Fi(Nt.URL,t+n,s+n):s==e.length?null:!1}}function a_e(e,t,n){let i=e.charCodeAt(t);if(i!=39&&i!=34&&i!=40)return!1;let r=i==40?41:i;for(let s=t+1,a=!1;s=this.end?-1:this.text.charCodeAt(t-this.offset)}get end(){return this.offset+this.text.length}slice(t,n){return this.text.slice(t-this.offset,n-this.offset)}append(t){return this.parts.push(t),t.to}addDelimiter(t,n,i,r,s){return this.append(new ql(t,n,i,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof ql&&(n.type==_g||n.type==XN))return!0}return!1}addElement(t){return this.append(t)}resolveMarkers(t){for(let i=t;i=t;c--){let b=this.parts[c];if(b instanceof ql&&b.side&1&&b.type==r.type&&!(s&&(r.side&1||b.side&2)&&(b.to-b.from+a)%3==0&&((b.to-b.from)%3||a%3))){l=b;break}}if(!l)continue;let u=r.type.resolve,d=[],f=l.from,h=r.to;if(s){let b=Math.min(2,l.to-l.from,a);f=l.to-b,h=r.from+b,u=b==1?"Emphasis":"StrongEmphasis"}l.type.mark&&d.push(this.elt(l.type.mark,f,l.to));for(let b=c+1;b=0;n--){let i=this.parts[n];if(i instanceof ql&&i.type==t&&i.side&1)return n}return null}takeContent(t){let n=this.resolveMarkers(t);return this.parts.length=t,n}getDelimiterAt(t){let n=this.parts[t];return n instanceof ql?n:null}skipSpace(t){return VO(this.text,t-this.offset)+this.offset}elt(t,n,i,r){return typeof t=="string"?Fi(this.parser.getNodeType(t),n,i,r):new n_e(t,n)}}TQ.linkStart=_g;TQ.imageStart=XN;function n8(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),i=0;for(let r of t){for(;i(t?t-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=` -`;)s--;this.fragmentEnd=s?s-1:0}let i=this.cursor;i||(i=this.cursor=this.fragment.tree.cursor(),i.firstChild());let r=t+this.fragment.offset;for(;i.to<=r;)if(!i.parent())return!1;for(;;){if(i.from>=r)return this.fragment.from<=n;if(!i.childAfter(r))return!1}}matches(t){let n=this.cursor.tree;return n&&n.prop(Ln.contextHash)==t}takeNodes(t){let n=this.cursor,i=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=t.absoluteLineStart,a=s,l=t.block.children.length,c=a,u=l;for(;;){if(n.to-i>r){if(n.type.isAnonymous&&n.firstChild())continue;break}let d=l_e(n.from-i,t.ranges);if(n.to-i<=t.ranges[t.rangeI].to)t.addNode(n.tree,d);else{let f=new hi(t.parser.nodeSet.types[Nt.Paragraph],[],[],0,t.block.hashProp);t.reusePlaceholders.set(f,n.tree),t.addNode(f,d)}if(n.type.is("Block")&&(eNt.indexOf(n.type.id)<0?(a=n.to-i,l=t.block.children.length):(a=c,l=u),c=n.to-i,u=t.block.children.length),!n.nextSibling())break}for(;t.block.children.length>l;)t.block.children.pop(),t.block.positions.pop();return a-s}}function l_e(e,t){let n=e;for(let i=1;iu2[e]),Object.keys(u2).map(e=>ZAe[e]),Object.keys(u2),X_t,zAe,Object.keys(N5).map(e=>N5[e]),Object.keys(N5),[]);function rNt(e,t,n){let i=[];for(let r=e.firstChild,s=t;;r=r.nextSibling){let a=r?r.from:n;if(a>s&&i.push({from:s,to:a}),!r)break;s=r.to}return i}function sNt(e){let{codeParser:t,htmlParser:n}=e;return{wrap:STe((r,s)=>{let a=r.type.id;if(t&&(a==Nt.CodeBlock||a==Nt.FencedCode)){let l="";if(a==Nt.FencedCode){let u=r.node.getChild(Nt.CodeInfo);u&&(l=s.read(u.from,u.to))}let c=t(l);if(c)return{parser:c,overlay:u=>u.type.id==Nt.CodeText,bracketed:a==Nt.FencedCode}}else if(n&&(a==Nt.HTMLBlock||a==Nt.HTMLTag||a==Nt.CommentBlock))return{parser:n,overlay:rNt(r.node,r.from,r.to)};return null})}}const aNt={resolve:"Strikethrough",mark:"StrikethroughMark"},oNt={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":ne.strikethrough}},{name:"StrikethroughMark",style:ne.processingInstruction}],parseInline:[{name:"Strikethrough",parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let i=e.slice(n-1,n),r=e.slice(n+2,n+3),s=/\s|^$/.test(i),a=/\s|^$/.test(r),l=hk.test(i),c=hk.test(r);return e.addDelimiter(aNt,n,n+2,!a&&(!c||s||l),!s&&(!l||a||c))},after:"Emphasis"}]};function HO(e,t,n=0,i,r=0){let s=0,a=!0,l=-1,c=-1,u=!1,d=()=>{i.push(e.elt("TableCell",r+l,r+c,e.parser.parseInline(t.slice(l,c),r+l)))};for(let f=n;f-1)&&s++,a=!1,i&&(l>-1&&d(),i.push(e.elt("TableDelimiter",f+r,f+r+1))),l=c=-1):(u||h!=32&&h!=9)&&(l<0&&(l=f),c=f+1),u=!u&&h==92}return l>-1&&(s++,i&&d()),s}function YJ(e,t){for(let n=t;n\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class ZJ{constructor(){this.rows=null}nextLine(t,n,i){if(this.rows==null){this.rows=!1;let r;if((n.next==45||n.next==58||n.next==124)&&c_e.test(r=n.text.slice(n.pos))){let s=[];HO(t,i.content,0,s,i.start)==HO(t,r,0)&&(this.rows=[t.elt("TableHeader",i.start,i.start+i.content.length,s),t.elt("TableDelimiter",t.lineStart+n.pos,t.lineStart+n.text.length)])}}else if(this.rows){let r=[];HO(t,n.text,n.pos,r,t.lineStart),this.rows.push(t.elt("TableRow",t.lineStart+n.pos,t.lineStart+n.text.length,r))}return!1}finish(t,n){return this.rows?(t.addLeafElement(n,t.elt("Table",n.start,n.start+n.content.length,this.rows)),!0):!1}}const lNt={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":ne.heading}},"TableRow",{name:"TableCell",style:ne.content},{name:"TableDelimiter",style:ne.processingInstruction}],parseBlock:[{name:"Table",leaf(e,t){return YJ(t.content,0)?new ZJ:null},endLeaf(e,t,n){if(n.parsers.some(r=>r instanceof ZJ)||!YJ(t.text,t.basePos))return!1;let i=e.peekLine();return c_e.test(i)&&HO(e,t.text,t.basePos)==HO(e,i,t.basePos)},before:"SetextHeading"}]};class cNt{nextLine(){return!1}finish(t,n){return t.addLeafElement(n,t.elt("Task",n.start,n.start+n.content.length,[t.elt("TaskMarker",n.start,n.start+3),...t.parser.parseInline(n.content.slice(3),n.start+3)])),!0}}const uNt={defineNodes:[{name:"Task",block:!0,style:ne.list},{name:"TaskMarker",style:ne.atom}],parseBlock:[{name:"TaskList",leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name=="ListItem"?new cNt:null},after:"SetextHeading"}]},JJ=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,eee=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,dNt=/[\w-]+\.[\w-]+($|[/:])/,tee=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,nee=/\/[a-zA-Z\d@.]+/gy;function iee(e,t,n,i){let r=0;for(let s=t;s-1)return-1;let i=t+n[0].length;for(;;){let r=e[i-1],s;if(/[?!.,:*_~]/.test(r)||r==")"&&iee(e,t,i,")")>iee(e,t,i,"("))i--;else if(r==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,i))))i=t+s.index;else break}return i}function ree(e,t){tee.lastIndex=t;let n=tee.exec(e);if(!n)return-1;let i=n[0][n[0].length-1];return i=="_"||i=="-"?-1:t+n[0].length-(i=="."?1:0)}const hNt={parseInline:[{name:"Autolink",parse(e,t,n){let i=n-e.offset;if(i&&/\w/.test(e.text[i-1]))return-1;JJ.lastIndex=i;let r=JJ.exec(e.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=fNt(e.text,i+r[0].length),s>-1&&e.hasOpenLink){let a=/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(i,s));s=i+a[0].length}}else r[3]?s=ree(e.text,i):(s=ree(e.text,i+r[0].length),s>-1&&r[0]=="xmpp:"&&(nee.lastIndex=s,r=nee.exec(e.text),r&&(s=r.index+r[0].length)));return s<0?-1:(e.addElement(e.elt("URL",n,s+e.offset)),s+e.offset)}}]},pNt=[lNt,uNt,oNt,hNt];function u_e(e,t,n){return(i,r,s)=>{if(r!=e||i.char(s+1)==e)return-1;let a=[i.elt(n,s,s+1)];for(let l=s+1;l=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let lee=null,cee=null,uee=0;function r8(e,t){let n=e.pos+t;if(uee==n&&cee==e)return lee;let i=e.peek(t),r="";for(;UNt(i);)r+=String.fromCharCode(i),i=e.peek(++t);return cee=e,uee=n,lee=r?r.toLowerCase():i==QNt||i==zNt?void 0:null}const y_e=60,YN=62,_Q=47,QNt=63,zNt=33,VNt=45;function dee(e,t){this.name=e,this.parent=t}const HNt=[AQ,p_e,d_e,f_e,h_e],qNt=new _I({start:null,shift(e,t,n,i){return HNt.indexOf(t)>-1?new dee(r8(i,1)||"",e):e},reduce(e,t){return t==m_e&&e?e.parent:e},reuse(e,t,n,i){let r=t.type.id;return r==AQ||r==DNt?new dee(r8(i,1)||"",e):e},strict:!1}),WNt=new zs((e,t)=>{if(e.next!=y_e){e.next<0&&t.context&&e.acceptToken(j5);return}e.advance();let n=e.next==_Q;n&&e.advance();let i=r8(e,0);if(i===void 0)return;if(!i)return e.acceptToken(n?_Nt:ANt);let r=t.context?t.context.name:null;if(n){if(i==r)return e.acceptToken(ENt);if(r&&BNt[r])return e.acceptToken(j5,-2);if(t.dialectEnabled(LNt))return e.acceptToken(CNt);for(let s=t.context;s;s=s.parent)if(s.name==i)return;e.acceptToken(TNt)}else{if(i=="script")return e.acceptToken(d_e);if(i=="style")return e.acceptToken(f_e);if(i=="textarea")return e.acceptToken(h_e);if(FNt.hasOwnProperty(i))return e.acceptToken(p_e);r&&oee[r]&&oee[r][i]?e.acceptToken(j5,-1):e.acceptToken(AQ)}},{contextual:!0}),GNt=new zs(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(aee);break}if(e.next==VNt)t++;else if(e.next==YN&&t>=2){n>=3&&e.acceptToken(aee,-2);break}else t=0;e.advance()}});function KNt(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const XNt=new zs((e,t)=>{if(e.next==_Q&&e.peek(1)==YN){let n=t.dialectEnabled($Nt)||KNt(t.context);e.acceptToken(n?kNt:see,2)}else e.next==YN&&e.acceptToken(see,1)});function NQ(e,t,n){let i=2+e.length;return new zs(r=>{for(let s=0,a=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(t);break}if(s==0&&r.next==y_e||s==1&&r.next==_Q||s>=2&&sa?r.acceptToken(t,-a):r.acceptToken(n,-(a-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(t,1);break}else s=a=0;r.advance()}})}const YNt=NQ("script",yNt,vNt),ZNt=NQ("style",xNt,wNt),JNt=NQ("textarea",ONt,SNt),ejt=Vh({"Text RawText IncompleteTag IncompleteCloseTag":ne.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":ne.angleBracket,TagName:ne.tagName,"MismatchedCloseTag/TagName":[ne.tagName,ne.invalid],AttributeName:ne.attributeName,"AttributeValue UnquotedAttributeValue":ne.attributeValue,Is:ne.definitionOperator,"EntityReference CharacterReference":ne.character,Comment:ne.blockComment,ProcessingInst:ne.processingInstruction,DoctypeDecl:ne.documentMeta}),tjt=Rh.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:qNt,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[ejt],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let u=l.type.id;if(u==RNt)return R5(l,c,n);if(u==INt)return R5(l,c,i);if(u==PNt)return R5(l,c,r);if(u==m_e&&s.length){let d=l.node,f=d.firstChild,h=f&&fee(f,c),p;if(h){for(let g of s)if(g.tag==h&&(!g.attrs||g.attrs(p||(p=v_e(f,c))))){let b=d.lastChild,v=b.type.id==MNt?b.from:d.to;if(v>f.to)return{parser:g.parser,overlay:[{from:f.to,to:v}]}}}}if(a&&u==g_e){let d=l.node,f;if(f=d.firstChild){let h=a[c.read(f.from,f.to)];if(h)for(let p of h){if(p.tagName&&p.tagName!=fee(d.parent,c))continue;let g=d.lastChild;if(g.type.id==i8){let b=g.from+1,v=g.lastChild,y=g.to-(v&&v.isError?0:1);if(y>b)return{parser:p.parser,overlay:[{from:b,to:y}],bracketed:!0}}else if(g.type.id==b_e)return{parser:p.parser,overlay:[{from:g.from,to:g.to}]}}}}return null})}const njt=145,hee=1,ijt=146,rjt=147,w_e=2,sjt=148,ajt=3,ojt=4,O_e=[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],ljt=58,cjt=40,S_e=95,ujt=91,MA=45,djt=46,fjt=35,hjt=37,pjt=38,mjt=92,gjt=10,bjt=42;function pk(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function jQ(e){return e>=48&&e<=57}function pee(e){return jQ(e)||e>=97&&e<=102||e>=65&&e<=70}const k_e=(e,t,n)=>(i,r)=>{for(let s=!1,a=0,l=0;;l++){let{next:c}=i;if(pk(c)||c==MA||c==S_e||s&&jQ(c))!s&&(c!=MA||l>0)&&(s=!0),a===l&&c==MA&&a++,i.advance();else if(c==mjt&&i.peek(1)!=gjt){if(i.advance(),pee(i.next)){do i.advance();while(pee(i.next));i.next==32&&i.advance()}else i.next>-1&&i.advance();s=!0}else{s&&i.acceptToken(a==2&&r.canShift(w_e)?t:c==cjt?n:e);break}}},yjt=new zs(k_e(ijt,w_e,rjt),{contextual:!0}),vjt=new zs(k_e(sjt,ajt,ojt),{contextual:!0}),xjt=new zs(e=>{if(O_e.includes(e.peek(-1))){let{next:t}=e;(pk(t)||t==S_e||t==fjt||t==djt||t==bjt||t==ujt||t==ljt&&pk(e.peek(1))||t==MA||t==pjt)&&e.acceptToken(njt)}}),wjt=new zs(e=>{if(!O_e.includes(e.peek(-1))){let{next:t}=e;if(t==hjt&&(e.advance(),e.acceptToken(hee)),pk(t)){do e.advance();while(pk(e.next)||jQ(e.next));e.acceptToken(hee)}}}),Ojt=Vh({"AtKeyword import charset namespace keyframes media supports font-feature-values":ne.definitionKeyword,"from to selector scope MatchFlag":ne.keyword,NamespaceName:ne.namespace,KeyframeName:ne.labelName,KeyframeRangeName:ne.operatorKeyword,TagName:ne.tagName,ClassName:ne.className,PseudoClassName:ne.constant(ne.className),IdName:ne.labelName,"FeatureName PropertyName":ne.propertyName,AttributeName:ne.attributeName,NumberLiteral:ne.number,KeywordQuery:ne.keyword,UnaryQueryOp:ne.operatorKeyword,"CallTag ValueName FontName":ne.atom,VariableName:ne.variableName,Callee:ne.operatorKeyword,Unit:ne.unit,"UniversalSelector NestingSelector":ne.definitionOperator,"MatchOp CompareOp":ne.compareOperator,"ChildOp SiblingOp, LogicOp":ne.logicOperator,BinOp:ne.arithmeticOperator,Important:ne.modifier,Comment:ne.blockComment,ColorLiteral:ne.color,"ParenthesizedContent StringLiteral":ne.string,":":ne.punctuation,"PseudoOp #":ne.derefOperator,"; , |":ne.separator,"( )":ne.paren,"[ ]":ne.squareBracket,"{ }":ne.brace}),Sjt={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:152,"url-prefix":152,domain:152,regexp:152},kjt={__proto__:null,or:104,and:104,not:112,only:112,layer:206},Ejt={__proto__:null,selector:118,style:124,layer:202},Cjt={__proto__:null,"@import":198,"@media":210,"@charset":214,"@namespace":218,"@keyframes":224,"@supports":236,"@scope":240,"@font-feature-values":246},Tjt={__proto__:null,to:243},Ajt=Rh.deserialize({version:14,states:"MlQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FnO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#EOO'dQdO'#EQO'oQdO'#EXO'oQdO'#E[OOQP'#Fn'#FnO)RQhO'#E}OOQS'#Fm'#FmOOQS'#FQ'#FQQYQdOOO)YQdO'#EbO*iQhO'#EhO)YQdO'#EjO*pQdO'#ElO*{QdO'#EoO)}QhO'#EuO+TQdO'#EwO+`QdO'#EzO+eQaO'#CfO+lQ`O'#E_O+qQ`O'#F{O+|QdO'#F{QOQ`OOP,WO&jO'#CaPOOO)CA])CA]OOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,cQdO,59YO'_QdO,5:jO'dQdO,5:lO'oQdO,5:sO'oQdO,5:uO'oQdO,5:vO'oQdO'#FXO,nQ`O,58}O,vQdO'#E^OOQS,58},58}OOQP'#Cq'#CqOOQO'#D|'#D|OOQP,59Y,59YO,}Q`O,59YO-SQ`O,59YOOQP'#EP'#EPOOQP,5:j,5:jO-XQpO'#ERO-dQdO'#ESO-iQ`O'#ESO-nQpO,5:lO.XQaO,5:sO.oQaO,5:vOOQW'#D^'#D^O/nQhO'#DgO0RQhO,5;iO)}QhO'#DeO0`Q`O'#DnO0eQhO'#DxOOQW'#Ft'#FtOOQS,5;i,5;iO0jQ`O'#DhO0oQ`O'#DkOOQS-E9O-E9OOOQ['#Cv'#CvO0tQdO'#CwO1[QdO'#C}O1rQdO'#DQO2YQ!pO'#DSO4fQ!jO,5:|OOQO'#DX'#DXO-SQ`O'#DWO4vQ!nO'#FqO6|Q`O'#DYO7RQ`O'#DyOOQ['#Fq'#FqO7WQhO'#GOO7fQ`O,5;SO7kQ!bO,5;UOOQS'#En'#EnO7sQ`O,5;WO7xQdO,5;WOOQO'#Eq'#EqO8QQ`O,5;ZO8VQhO,5;aO'oQdO'#DjOOQS,5;c,5;cO0jQ`O,5;cO8_QdO,5;cOOQS'#F`'#F`O8gQdO'#E|O7fQ`O,5;fO8oQdO,5:yO9PQdO'#FZO9^Q`O,5lQhO'#DoOOQW,5:Y,5:YOOQW,5:d,5:dOOQW,5:S,5:SO>vQhO,5:VO?bQ!fO'#FrOOQS'#Fr'#FrOOQS'#FS'#FSO@rQdO,59cOOQ[,59c,59cOAYQdO,59iOOQ[,59i,59iOApQdO,59lOOQ[,59l,59lOOQ[,59n,59nO)YQdO,59pOBWQhO'#EdOOQW'#Ed'#EdOBuQ`O1G0hO4oQhO1G0hOOQ[,59r,59rO)}QhO'#D[OOQ[,59t,59tOBzQ#tO,5:eOCVQhO'#F]OCdQ`O,5vQhO'#DmOI_QhO'#DqOIgQhO'#DsOIlQhO'#FwOOQO'#Fw'#FwOItQ!bO'#DwOOQO'#Fy'#FyOOQO'#Fv'#FvOIyQ`O1G/qOOQS-E9Q-E9QOOQ[1G.}1G.}OOQ[1G/T1G/TOOQ[1G/W1G/WOOQ[1G/[1G/[OJOQdO,5;OOOQS7+&S7+&SOJTQ`O7+&SOJYQhO'#D]OJbQ`O,59vO)}QhO,59vOOQ[1G0P1G0POJjQ`O1G0POJoQhO,5;wOOQO-E9Z-E9ZOOQS7+&^7+&^OJ}QbO'#DSOOQO'#Et'#EtOK]Q`O'#EsOOQO'#Es'#EsOKhQ`O'#F^OKpQdO,5;^OOQS,5;^,5;^OOQ[1G/p1G/pOOQS7+&i7+&iO7fQ`O7+&iOK{Q!fO'#FYO)YQdO'#FYOMSQdO7+&POOQO7+&P7+&POOQO,5:{,5:{OOQO1G1a1G1aOMgQ!bO<vQhO'#DrOOQO,5:],5:]O! hQhO,5:_OGUQhO,5:cOOQW7+%]7+%]OOQO'#Ef'#EfO! pQ`O1G0jOOQS<xAN>xO!#zQ`OAN>xO!$PQaO,5;rOOQO-E9U-E9UO!$ZQdO,5;qOOQO-E9T-E9TOOQW<vQhO'#DuOOQO1G/y1G/yO!%vQ!bO1G/}OJOQdO'#F[O!&OQ`O7+&UOOQW7+&U7+&UO!&WQ!bO1G/cOOQ[7+$|7+$|O!&cQhO7+$|P!&jQ`O'#FTOOQO,5;y,5;yOOQO-E9]-E9]OOQS1G1d1G1dOOQPG24dG24dO!&oQ`OAN>ZO)YQdO1G1[O!&tQ`O7+'jOOQO1G/x1G/xO!&|Q`O,5:aO!$eQhO7+%iOOQO,5;v,5;vOOQO-E9Y-E9YOOQW<Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!o`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$[~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$[~!o`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%jj)jS$qYOy%jz;'S%j;'S;=`%{<%lO%j~)yWOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d<%lO)v~*hOw~~*kRO;'S)v;'S;=`*t;=`O)v~*wXOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d;=`<%l)v<%lO)v~+gP;=`<%l)vj+oYmYOy%jz!Q%j!Q![,_![!c%j!c!i,_!i#T%j#T#Z,_#Z;'S%j;'S;=`%{<%lO%jj,dY!o`Oy%jz!Q%j!Q![-S![!c%j!c!i-S!i#T%j#T#Z-S#Z;'S%j;'S;=`%{<%lO%jj-XY!o`Oy%jz!Q%j!Q![-w![!c%j!c!i-w!i#T%j#T#Z-w#Z;'S%j;'S;=`%{<%lO%jj.OYuY!o`Oy%jz!Q%j!Q![.n![!c%j!c!i.n!i#T%j#T#Z.n#Z;'S%j;'S;=`%{<%lO%jj.uYuY!o`Oy%jz!Q%j!Q![/e![!c%j!c!i/e!i#T%j#T#Z/e#Z;'S%j;'S;=`%{<%lO%jj/jY!o`Oy%jz!Q%j!Q![0Y![!c%j!c!i0Y!i#T%j#T#Z0Y#Z;'S%j;'S;=`%{<%lO%jj0aYuY!o`Oy%jz!Q%j!Q![1P![!c%j!c!i1P!i#T%j#T#Z1P#Z;'S%j;'S;=`%{<%lO%jj1UY!o`Oy%jz!Q%j!Q![1t![!c%j!c!i1t!i#T%j#T#Z1t#Z;'S%j;'S;=`%{<%lO%jj1{SuY!o`Oy%jz;'S%j;'S;=`%{<%lO%jd2[UOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jd2uS!yS!o`Oy%jz;'S%j;'S;=`%{<%lO%jb3WS^QOy%jz;'S%j;'S;=`%{<%lO%j~3gWOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{<%lO3d~4SRO;'S3d;'S;=`4];=`O3d~4`XOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{;=`<%l3d<%lO3d~5OP;=`<%l3dj5WShYOy%jz;'S%j;'S;=`%{<%lO%j~5iOg~n5pUWQyWOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jj6ZWyW#PQOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj6xU!o`Oy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%jj7cY!o`$gYOy%jz!Q%j!Q![7[![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj8WY!o`Oy%jz{%j{|8v|}%j}!O8v!O!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj8{U!o`Oy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj9fU!o`$gYOy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj:P[!o`$gYOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj:zS!dYOy%jz;'S%j;'S;=`%{<%lO%jj;]WyWOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj;zU`YOy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%j~VUcYOy%jz![%j![!]>i!];'S%j;'S;=`%{<%lO%jj>pSdY!o`Oy%jz;'S%j;'S;=`%{<%lO%jj?RSnYOy%jz;'S%j;'S;=`%{<%lO%jh?dU!WWOy%jz!_%j!_!`?v!`;'S%j;'S;=`%{<%lO%jh?}S!WW!o`Oy%jz;'S%j;'S;=`%{<%lO%jl@bS!WW!ySOy%jz;'S%j;'S;=`%{<%lO%jj@uV!|Q!WWOy%jz!_%j!_!`?v!`!aA[!a;'S%j;'S;=`%{<%lO%jbAcS!|Q!o`Oy%jz;'S%j;'S;=`%{<%lO%jjArYOy%jz}%j}!OBb!O!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjBgW!o`Oy%jz!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjCW[lY!o`Oy%jz}%j}!OCP!O!Q%j!Q![CP![!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jhDRS!zWOy%jz;'S%j;'S;=`%{<%lO%jjDdSpYOy%jz;'S%j;'S;=`%{<%lO%jnDuSo^Oy%jz;'S%j;'S;=`%{<%lO%jjEWU!zWOy%jz#a%j#a#bEj#b;'S%j;'S;=`%{<%lO%jbEoU!o`Oy%jz#d%j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!o`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!o`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!o`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!o`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!o`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!o`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$pQ!o`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$cUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU#PQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[xjt,wjt,yjt,vjt,1,2,3,4,new qN("m~RRYZ[z{a~~g~aO$_~~dP!P!Qg~lO$`~~",28,152)],topRules:{StyleSheet:[0,6],Styles:[1,126]},dynamicPrecedences:{94:1},specialized:[{term:147,get:e=>Sjt[e]||-1},{term:148,get:e=>kjt[e]||-1},{term:4,get:e=>Ejt[e]||-1},{term:28,get:e=>Cjt[e]||-1},{term:146,get:e=>Tjt[e]||-1}],tokenPrec:2405});let I5=null;function P5(){if(!I5&&typeof document=="object"&&document.body){let{style:e}=document.body,t=[],n=new Set;for(let i in e)i!="cssText"&&i!="cssFloat"&&typeof e[i]=="string"&&(/[A-Z]/.test(i)&&(i=i.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),n.has(i)||(t.push(i),n.add(i)));I5=t.sort().map(i=>({type:"property",label:i,apply:i+": "}))}return I5||[]}const mee=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),gee=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),_jt=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),Njt=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),xf=/^(\w[\w-]*|-\w[\w-]*|)$/,jjt=/^-(-[\w-]*)?$/;function Rjt(e,t){var n;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let i=(n=e.parent)===null||n===void 0?void 0:n.firstChild;return(i==null?void 0:i.name)!="Callee"?!1:t.sliceString(i.from,i.to)=="var"}const bee=new QU,Ijt=["Declaration"];function Pjt(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function E_e(e,t,n){if(t.to-t.from>4096){let i=bee.get(t);if(i)return i;let r=[],s=new Set,a=t.cursor(er.IncludeAnonymous);if(a.firstChild())do for(let l of E_e(e,a.node,n))s.has(l.label)||(s.add(l.label),r.push(l));while(a.nextSibling());return bee.set(t,r),r}else{let i=[],r=new Set;return t.cursor().iterate(s=>{var a;if(n(s)&&s.matchContext(Ijt)&&((a=s.node.nextSibling)===null||a===void 0?void 0:a.name)==":"){let l=e.sliceString(s.from,s.to);r.has(l)||(r.add(l),i.push({label:l,type:"variable"}))}}),i}}const Djt=e=>t=>{let{state:n,pos:i}=t,r=Or(n).resolveInner(i,-1),s=r.type.isError&&r.from==r.to-1&&n.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:P5(),validFor:xf};if(r.name=="ValueName")return{from:r.from,options:gee,validFor:xf};if(r.name=="PseudoClassName")return{from:r.from,options:mee,validFor:xf};if(e(r)||(t.explicit||s)&&Rjt(r,n.doc))return{from:e(r)||s?r.from:i,options:E_e(n.doc,Pjt(r),e),validFor:jjt};if(r.name=="TagName"){for(let{parent:c}=r;c;c=c.parent)if(c.name=="Block")return{from:r.from,options:P5(),validFor:xf};return{from:r.from,options:_jt,validFor:xf}}if(r.name=="AtKeyword")return{from:r.from,options:Njt,validFor:xf};if(!t.explicit)return null;let a=r.resolve(i),l=a.childBefore(i);return l&&l.name==":"&&a.name=="PseudoClassSelector"?{from:i,options:mee,validFor:xf}:l&&l.name==":"&&a.name=="Declaration"||a.name=="ArgList"?{from:i,options:gee,validFor:xf}:a.name=="Block"||a.name=="Styles"?{from:i,options:P5(),validFor:xf}:null},Mjt=Djt(e=>e.name=="VariableName"),ZN=jh.define({name:"css",parser:Ajt.configure({props:[Hh.add({Declaration:pv()}),qh.add({"Block KeyframeList":LE})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Ljt(){return new Nm(ZN,ZN.data.of({autocomplete:Mjt}))}const iw=["_blank","_self","_top","_parent"],D5=["ascii","utf-8","utf-16","latin1","latin1"],M5=["get","post","put","delete"],L5=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Ml=["true","false"],mn={},$jt={a:{attrs:{href:null,ping:null,type:null,media:null,target:iw,hreflang:null}},abbr:mn,address:mn,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:mn,aside:mn,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:mn,base:{attrs:{href:null,target:iw}},bdi:mn,bdo:mn,blockquote:{attrs:{cite:null}},body:mn,br:mn,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:L5,formmethod:M5,formnovalidate:["novalidate"],formtarget:iw,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:mn,center:mn,cite:mn,code:mn,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:mn,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:mn,div:mn,dl:mn,dt:mn,em:mn,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:mn,figure:mn,footer:mn,form:{attrs:{action:null,name:null,"accept-charset":D5,autocomplete:["on","off"],enctype:L5,method:M5,novalidate:["novalidate"],target:iw}},h1:mn,h2:mn,h3:mn,h4:mn,h5:mn,h6:mn,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:mn,hgroup:mn,hr:mn,html:{attrs:{manifest:null}},i:mn,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:L5,formmethod:M5,formnovalidate:["novalidate"],formtarget:iw,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:mn,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:mn,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:mn,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:D5,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:mn,noscript:mn,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:mn,param:{attrs:{name:null,value:null}},pre:mn,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:mn,rt:mn,ruby:mn,samp:mn,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:D5}},section:mn,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:mn,source:{attrs:{src:null,type:null,media:null}},span:mn,strong:mn,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:mn,summary:mn,sup:mn,table:mn,tbody:mn,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:mn,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:mn,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:mn,time:{attrs:{datetime:null}},title:mn,tr:mn,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:mn,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:mn},C_e={accesskey:null,class:null,contenteditable:Ml,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Ml,autocorrect:Ml,autocapitalize:Ml,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Ml,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Ml,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Ml,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Ml,"aria-hidden":Ml,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Ml,"aria-multiselectable":Ml,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Ml,"aria-relevant":null,"aria-required":Ml,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},T_e="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of T_e)C_e[e]=null;class mk{constructor(t,n){this.tags={...$jt,...t},this.globalAttrs={...C_e,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}mk.default=new mk;function ux(e,t,n=e.length){if(!t)return"";let i=t.firstChild,r=i&&i.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,n)):""}function dx(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function A_e(e,t,n){let i=n.tags[ux(e,dx(t))];return(i==null?void 0:i.children)||n.allTags}function RQ(e,t){let n=[];for(let i=dx(t);i&&!i.type.isTop;i=dx(i.parent)){let r=ux(e,i);if(r&&i.lastChild.name=="CloseTag")break;r&&n.indexOf(r)<0&&(t.name=="EndTag"||t.from>=i.firstChild.to)&&n.push(r)}return n}const __e=/^[:\-\.\w\u00b7-\uffff]*$/;function yee(e,t,n,i,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">",a=dx(n,n.name=="StartTag"||n.name=="TagName");return{from:i,to:r,options:A_e(e.doc,a,t).map(l=>({label:l,type:"type"})).concat(RQ(e.doc,n).map((l,c)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function vee(e,t,n,i){let r=/\s*>/.test(e.sliceDoc(i,i+5))?"":">";return{from:n,to:i,options:RQ(e.doc,t).map((s,a)=>({label:s,apply:s+r,type:"type",boost:99-a})),validFor:__e}}function Fjt(e,t,n,i){let r=[],s=0;for(let a of A_e(e.doc,n,t))r.push({label:"<"+a,type:"type"});for(let a of RQ(e.doc,n))r.push({label:"",type:"type",boost:99-s++});return{from:i,to:i,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Bjt(e,t,n,i,r){let s=dx(n),a=s?t.tags[ux(e.doc,s)]:null,l=a&&a.attrs?Object.keys(a.attrs):[],c=a&&a.globalAttrs===!1?l:l.length?l.concat(t.globalAttrNames):t.globalAttrNames;return{from:i,to:r,options:c.map(u=>({label:u,type:"property"})),validFor:__e}}function Ujt(e,t,n,i,r){var s;let a=(s=n.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],c;if(a){let u=e.sliceDoc(a.from,a.to),d=t.globalAttrs[u];if(!d){let f=dx(n),h=f?t.tags[ux(e.doc,f)]:null;d=(h==null?void 0:h.attrs)&&h.attrs[u]}if(d){let f=e.sliceDoc(i,r).toLowerCase(),h='"',p='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,h="",p=e.sliceDoc(r,r+1)==f[0]?"":f[0],f=f.slice(1),i++):c=/^[^\s<>='"]*$/;for(let g of d)l.push({label:g,apply:h+g+p,type:"constant"})}}return{from:i,to:r,options:l,validFor:c}}function N_e(e,t){let{state:n,pos:i}=t,r=Or(n).resolveInner(i,-1),s=r.resolve(i);for(let a=i,l;s==r&&(l=r.childBefore(a));){let c=l.lastChild;if(!c||!c.type.isError||c.fromN_e(i,r)}const Vjt=$d.parser.configure({top:"SingleExpression"}),j_e=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:$Ae.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:FAe.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:BAe.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Vjt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:$d.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:ZN.parser}],R_e=[{name:"style",parser:ZN.parser.configure({top:"Styles"})}].concat(T_e.map(e=>({name:e,parser:$d.parser}))),I_e=jh.define({name:"html",parser:tjt.configure({props:[Hh.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].lengthe.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),LA=I_e.configure({wrap:x_e(j_e,R_e)});function Hjt(e={}){let t="",n;e.matchClosingTags===!1&&(t="noMatch"),e.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=x_e((e.nestedLanguages||[]).concat(j_e),(e.nestedAttributes||[]).concat(R_e)));let i=n?I_e.configure({wrap:n,dialect:t}):t?LA.configure({dialect:t}):LA;return new Nm(i,[LA.data.of({autocomplete:zjt(e)}),e.autoCloseTags!==!1?qjt:[],Z$().support,Ljt().support])}const xee=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),qjt=$t.inputHandler.of((e,t,n,i,r)=>{if(e.composing||e.state.readOnly||t!=n||i!=">"&&i!="/"||!LA.isActiveAt(e.state,t,-1))return!1;let s=r(),{state:a}=s,l=a.changeByRange(c=>{var u,d,f;let h=a.doc.sliceString(c.from-1,c.to)==i,{head:p}=c,g=Or(a).resolveInner(p,-1),b;if(h&&i==">"&&g.name=="EndTag"){let v=g.parent;if(((d=(u=v.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(b=ux(a.doc,v.parent,p))&&!xee.has(b)){let y=p+(a.doc.sliceString(p,p+1)===">"?1:0),x=``;return{range:c,changes:{from:p,to:y,insert:x}}}}else if(h&&i=="/"&&g.name=="IncompleteCloseTag"){let v=g.parent;if(g.from==p-2&&((f=v.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(b=ux(a.doc,v,p))&&!xee.has(b)){let y=p+(a.doc.sliceString(p,p+1)===">"?1:0),x=`${b}>`;return{range:st.cursor(p+x.length,-1),changes:{from:p,to:y,insert:x}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([s,a.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),P_e=CI({commentTokens:{block:{open:""}}}),D_e=new Ln,M_e=iNt.configure({props:[qh.add(e=>!e.is("Block")||e.is("Document")||s8(e)!=null||Wjt(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),D_e.add(s8),Hh.add({Document:()=>null}),zp.add({Document:P_e})]});function s8(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function Wjt(e){return e.name=="OrderedList"||e.name=="BulletList"}function Gjt(e,t){let n=e;for(;;){let i=n.nextSibling,r;if(!i||(r=s8(i.type))!=null&&r<=t)break;n=i}return n.to}const Kjt=tAe.of((e,t,n)=>{for(let i=Or(e).resolveInner(n,-1);i&&!(i.fromn)return{from:n,to:s}}return null});function IQ(e){return new ec(P_e,e,[],"markdown")}const Xjt=IQ(M_e),Yjt=M_e.configure([pNt,gNt,mNt,bNt,{props:[qh.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),JN=IQ(Yjt);function Zjt(e,t){return n=>{if(n&&e){let i=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?i=e(n):i=UN.matchLanguageName(e,n,!0),i instanceof UN)return i.support?i.support.language.parser:Ib.getSkippingParser(i.load());if(i)return i.parser}return t?t.parser:null}}let $5=class{constructor(t,n,i,r,s,a,l){this.node=t,this.from=n,this.to=i,this.spaceBefore=r,this.spaceAfter=s,this.type=a,this.item=l}blank(t,n=!0){let i=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;i.length0;r--)i+=" ";return i+(n?this.spaceAfter:"")}}marker(t,n){let i=this.node.name=="OrderedList"?String(+$_e(this.item,t)[2]+n):"";return this.spaceBefore+i+this.type+this.spaceAfter}};function L_e(e,t){let n=[],i=[];for(let r=e;r;r=r.parent){if(r.name=="FencedCode")return i;(r.name=="ListItem"||r.name=="Blockquote")&&n.push(r)}for(let r=n.length-1;r>=0;r--){let s=n[r],a,l=t.lineAt(s.from),c=s.from-l.from;if(s.name=="Blockquote"&&(a=/^ *>( ?)/.exec(l.text.slice(c))))i.push(new $5(s,c,c+a[0].length,"",a[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(a=/^( *)\d+([.)])( *)/.exec(l.text.slice(c)))){let u=a[3],d=a[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),i.push(new $5(s.parent,c,c+d,a[1],u,a[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(c)))){let u=a[4],d=a[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let f=a[2];a[3]&&(f+=a[3].replace(/[xX]/," ")),i.push(new $5(s.parent,c,c+d,a[1],u,f,s))}}return i}function $_e(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function F5(e,t,n,i=0){for(let r=-1,s=e;;){if(s.name=="ListItem"){let l=$_e(s,t),c=+l[2];if(r>=0){if(c!=r+1)return;n.push({from:s.from+l[1].length,to:s.from+l[0].length,insert:String(r+2+i)})}r=c}let a=s.nextSibling;if(!a)break;s=a}}function PQ(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(i1)!=" ")return e;let i=Uu(e,4,n),r="";for(let s=i;s>0;)s>=4?(r+=" ",s-=4):(r+=" ",s--);return r+e.slice(n)}const Jjt=(e={})=>({state:t,dispatch:n})=>{let i=Or(t),{doc:r}=t,s=null,a=t.changeByRange(l=>{if(!l.empty||!JN.isActiveAt(t,l.from,-1)&&!JN.isActiveAt(t,l.from,1))return s={range:l};let c=l.from,u=r.lineAt(c),d=L_e(i.resolveInner(c,-1),r);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return s={range:l};let f=d[d.length-1];if(f.to-f.spaceAfter.length>c-u.from)return s={range:l};let h=c>=f.to-f.spaceAfter.length&&!/\S/.test(u.text.slice(f.to));if(f.item&&h){let y=f.node.firstChild,x=f.node.getChild("ListItem","ListItem");if(y.to>=c||x&&x.to0&&!/[^\s>]/.test(r.lineAt(u.from-1).text)||e.nonTightLists===!1){let O=d.length>1?d[d.length-2]:null,w,k="";O&&O.item?(w=u.from+O.from,k=O.marker(r,1)):w=u.from+(O?O.to:0);let S=[{from:w,to:c,insert:k}];return f.node.name=="OrderedList"&&F5(f.item,r,S,-2),O&&O.node.name=="OrderedList"&&F5(O.item,r,S),{range:st.cursor(w+k.length),changes:S}}else{let O=Oee(d,t,u);return{range:st.cursor(c+O.length+1),changes:{from:u.from,insert:O+t.lineBreak}}}}if(f.node.name=="Blockquote"&&h&&u.from){let y=r.lineAt(u.from-1),x=/>\s*$/.exec(y.text);if(x&&x.index==f.from){let O=t.changes([{from:y.from+x.index,to:y.to},{from:u.from+f.from,to:u.to}]);return{range:l.map(O),changes:O}}}let p=[];f.node.name=="OrderedList"&&F5(f.item,r,p);let g=f.item&&f.item.from]*/.exec(u.text)[0].length>=f.to)for(let y=0,x=d.length-1;y<=x;y++)b+=y==x&&!g?d[y].marker(r,1):d[y].blank(yu.from&&/\s/.test(u.text.charAt(v-u.from-1));)v--;return b=PQ(b,t),tRt(f.node,t.doc)&&(b=Oee(d,t,u)+t.lineBreak+b),p.push({from:v,to:c,insert:t.lineBreak+b}),{range:st.cursor(v+b.length+1),changes:p}});return s?!1:(n(t.update(a,{scrollIntoView:!0,userEvent:"input"})),!0)},eRt=Jjt();function wee(e){return e.name=="QuoteMark"||e.name=="ListMark"}function tRt(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let n=e.firstChild,i=e.getChild("ListItem","ListItem");if(!i)return!1;let r=t.lineAt(n.to),s=t.lineAt(i.from),a=/^[\s>]*$/.test(r.text);return r.number+(a?0:1){let n=Or(e),i=null,r=e.changeByRange(s=>{let a=s.from,{doc:l}=e;if(s.empty&&JN.isActiveAt(e,s.from)){let c=l.lineAt(a),u=L_e(nRt(n,a),l);if(u.length){let d=u[u.length-1],f=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(a-c.from>f&&!/\S/.test(c.text.slice(f,a-c.from)))return{range:st.cursor(c.from+f),changes:{from:c.from+f,to:a}};if(a-c.from==f&&(d.item&&c.from<=d.item.from||/^[\s>]*$/.test(c.text.slice(0,d.to)))){let h=c.from+d.from;if(d.item&&d.node.from{var n;let{main:i}=t.state.selection;if(i.empty)return!1;let r=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r="https://"+r),!JN.isActiveAt(t.state,i.from,1)))return!1;let s=Or(t.state),a=!1;return s.iterate({from:i.from,to:i.to,enter:l=>{(l.from>i.from||lRt.test(l.name))&&(a=!0)},leave:l=>{l.to=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}const cIt=new zs((e,t)=>{let n;if(e.next<0)e.acceptToken(hRt);else if(t.context.flags&$A)U5(e.next)&&e.acceptToken(fRt,1);else if(((n=e.peek(-1))<0||U5(n))&&t.canShift(See)){let i=0;for(;e.next==DQ||e.next==RI;)e.advance(),i++;(e.next==Mb||e.next==gk||e.next==MQ)&&e.acceptToken(See,-i)}else U5(e.next)&&e.acceptToken(dRt,1)},{contextual:!0}),uIt=new zs((e,t)=>{let n=t.context;if(n.flags)return;let i=e.peek(-1);if(i==Mb||i==gk){let r=0,s=0;for(;;){if(e.next==DQ)r++;else if(e.next==RI)r+=8-r%8;else break;e.advance(),s++}r!=n.indent&&e.next!=Mb&&e.next!=gk&&e.next!=MQ&&(r[e,t|q_e])),hIt=new _I({start:dIt,reduce(e,t,n,i){return e.flags&$A&&lIt.has(t)||(t==NRt||t==z_e)&&e.flags&q_e?e.parent:e},shift(e,t,n,i){return t==B_e?new FA(e,fIt(i.read(i.pos,n.pos)),0):t==U_e?e.parent:t==gRt||t==xRt||t==SRt||t==Q_e?new FA(e,0,$A):Tee.has(t)?new FA(e,0,Tee.get(t)|e.flags&$A):e},hash(e){return e.hash}}),pIt=new zs(e=>{for(let t=0;t<5;t++){if(e.next!="print".charCodeAt(t))return;e.advance()}if(!/\w/.test(String.fromCharCode(e.next)))for(let t=0;;t++){let n=e.peek(t);if(!(n==DQ||n==RI)){n!=tIt&&n!=nIt&&n!=Mb&&n!=gk&&n!=MQ&&e.acceptToken(uRt);return}}}),mIt=new zs((e,t)=>{let{flags:n}=t.context,i=n&Tf?H_e:V_e,r=(n&Af)>0,s=!(n&_f),a=(n&Nf)>0,l=e.pos;for(;!(e.next<0);)if(a&&e.next==a8)if(e.peek(1)==a8)e.advance(2);else{if(e.pos==l){e.acceptToken(Q_e,1);return}break}else if(s&&e.next==Cee){if(e.pos==l){e.advance();let c=e.next;c>=0&&(e.advance(),gIt(e,c)),e.acceptToken(mRt);return}break}else if(e.next==Cee&&!s&&e.peek(1)>-1)e.advance(2);else if(e.next==i&&(!r||e.peek(1)==i&&e.peek(2)==i)){if(e.pos==l){e.acceptToken(kee,r?3:1);return}break}else if(e.next==Mb){if(r)e.advance();else if(e.pos==l){e.acceptToken(kee);return}break}else e.advance();e.pos>l&&e.acceptToken(pRt)});function gIt(e,t){if(t==iIt)for(let n=0;n<2&&e.next>=48&&e.next<=55;n++)e.advance();else if(t==rIt)for(let n=0;n<2&&Q5(e.next);n++)e.advance();else if(t==aIt)for(let n=0;n<4&&Q5(e.next);n++)e.advance();else if(t==oIt)for(let n=0;n<8&&Q5(e.next);n++)e.advance();else if(t==sIt&&e.next==a8){for(e.advance();e.next>=0&&e.next!=Eee&&e.next!=V_e&&e.next!=H_e&&e.next!=Mb;)e.advance();e.next==Eee&&e.advance()}}const bIt=Vh({'async "*" "**" FormatConversion FormatSpec':ne.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":ne.controlKeyword,"in not and or is del":ne.operatorKeyword,"from def class global nonlocal lambda":ne.definitionKeyword,import:ne.moduleKeyword,"with as print":ne.keyword,Boolean:ne.bool,None:ne.null,VariableName:ne.variableName,"CallExpression/VariableName":ne.function(ne.variableName),"FunctionDefinition/VariableName":ne.function(ne.definition(ne.variableName)),"ClassDefinition/VariableName":ne.definition(ne.className),PropertyName:ne.propertyName,"CallExpression/MemberExpression/PropertyName":ne.function(ne.propertyName),Comment:ne.lineComment,Number:ne.number,String:ne.string,FormatString:ne.special(ne.string),Escape:ne.escape,UpdateOp:ne.updateOperator,"ArithOp!":ne.arithmeticOperator,BitOp:ne.bitwiseOperator,CompareOp:ne.compareOperator,AssignOp:ne.definitionOperator,Ellipsis:ne.punctuation,At:ne.meta,"( )":ne.paren,"[ ]":ne.squareBracket,"{ }":ne.brace,".":ne.derefOperator,", ;":ne.separator}),yIt={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},vIt=Rh.deserialize({version:14,states:"##jQ`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5TQdO'#DoOOQS,5:Y,5:YO5hQdO'#HdOOQS,5:],5:]O5uQ!fO,5:]O5zQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8jQdO,59bO8oQdO,59bO8vQdO,59jO8}QdO'#HTO:TQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:lQdO,59aO'vQdO,59aO:zQdO,59aOOQS,59y,59yO;PQdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;_QdO,5:QO;dQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;uQdO,5:UO;zQdO,5:WOOOW'#Fy'#FyOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/[QtO1G.|O!/cQtO1G.|O1lQdO1G.|O!0OQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!0VQdO1G/eO!0gQdO1G/eO!0oQdO1G/fO'vQdO'#H[O!0tQdO'#H[O!0yQtO1G.{O!1ZQdO,59iO!2aQdO,5=zO!2qQdO,5=zO!2yQdO1G/mO!3OQtO1G/mOOQS1G/l1G/lO!3`QdO,5=uO!4VQdO,5=uO0rQdO1G/qO!4tQdO1G/sO!4yQtO1G/sO!5ZQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5kQdO'#HxO0rQdO'#HxO!5|QdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6[Q#xO1G2zO!6{QtO1G2zO'vQdO,5kOOQS1G1`1G1`O!8RQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!8WQdO'#FrO!8cQdO,59oO!8kQdO1G/XO!8uQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9fQdO'#GtOOQS,5jO!;ZQdO,5>jO1XQdO,5>jO!;lQdO,5>iOOQS-E:R-E:RO!;qQdO1G0lO!;|QdO1G0lO!lO!lO!hO!=VQdO,5>hO!=hQdO'#EpO0rQdO1G0tO!=sQdO1G0tO!=xQgO1G0zO!AvQgO1G0}O!EqQdO,5>oO!E{QdO,5>oO!FTQtO,5>oO0rQdO1G1PO!F_QdO1G1PO4iQdO1G1UO!!vQdO1G1WOOQV,5;a,5;aO!FdQfO,5;aO!FiQgO1G1QO!JjQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JzQdO,5>pO!KXQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KaQdO'#FSO!KrQ!fO1G1WO!KzQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!LPQdO1G1]O!LXQdO'#F^OOQV1G1b1G1bO!#ZQtO1G1bPOOO1G2v1G2vP!L^OSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LfQdO,5=|O!LyQdO,5=|OOQS1G/u1G/uO!MRQdO,5>PO!McQdO,5>PO!MkQdO,5>PO!NOQdO,5>PO!N`QdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8kQdO7+$pO#!RQdO1G.|O#!YQdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!aQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!qQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!vQdO7+%PO##OQdO7+%QO##TQdO1G3fOOQS7+%X7+%XO##eQdO1G3fO##mQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##rQdO1G3aOOQS-E9q-E9qO#$iQdO7+%]OOQS7+%_7+%_O#$wQdO1G3aO#%fQdO7+%_O#%kQdO1G3gO#%{QdO1G3gO#&TQdO7+%]O#&YQdO,5>dO#&sQdO,5>dO#&sQdO,5>dOOQS'#Dx'#DxO#'UO&jO'#DzO#'aO`O'#HyOOOW1G3}1G3}O#'fQdO1G3}O#'nQdO1G3}O#'yQ#xO7+(fO#(jQtO1G2UP#)TQdO'#GOOOQS,5nQdO,5sQdO1G4OOOQS-E9y-E9yO#?^QdO1G4OO<[QdO'#H{OOOO'#D{'#D{OOOO'#F|'#F|O#?oO&jO,5:fOOOW,5>e,5>eOOOW7+)i7+)iO#?zQdO7+)iO#@SQdO1G2zO#@mQdO1G2zP'vQdO'#FuO0rQdO<mO#BQQdO,5>mOOQS1G0v1G0vOOQS<rO#KgQdO,5>rO#KrQdO,5>rO#K}QdO,5>qO#L`QdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ oQdO<cAN>cO0rQdO1G1|O$!PQtO1G1|P$!ZQdO'#FvOOQS1G2R1G2RP$!hQdO'#F{O$!uQdO7+)jO$#`QdO,5>gOOOO-E9z-E9zOOOW<tO$4{QdO,5>tO1XQdO,5vO$)nQdO,5>vOOQS1G1p1G1pOOQS,5<[,5<[OOQU7+'P7+'PO$+zQdO1G/iO$)nQdO,5wO$8zQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)nQdO'#GdO$9SQdO1G4bO$9^QdO1G4bO$9fQdO1G4bOOQS7+%T7+%TO$9tQdO1G1tO$:SQtO'#FaO$:ZQdO,5<}OOQS,5<},5<}O$:iQdO1G4cOOQS-E:a-E:aO$)nQdO,5<|O$:pQdO,5<|O$:uQdO7+)|OOQS-E:`-E:`O$;PQdO7+)|O$)nQdO,5S~O%cOS%^OSSOS%]PQ~OPdOVaOfoOhYOopOs!POvqO!PrO!Q{O!T!SO!U!RO!XZO!][O!h`O!r`O!s`O!t`O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#l!QO#o!TO#s!UO#u!VO#z!WO#}hO$P!XO%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~O%]!YO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%j![O%k!]O%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aO~Ok%xXl%xXm%xXn%xXo%xXp%xXs%xXz%xX{%xX!x%xX#g%xX%[%xX%_%xX%z%xXg%xX!T%xX!U%xX%{%xX!W%xX![%xX!Q%xX#[%xXt%xX!m%xX~P%SOfoOhYO!XZO!][O!h`O!r`O!s`O!t`O%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~Oz%wX{%wX#g%wX%[%wX%_%wX%z%wX~Ok!pOl!qOm!oOn!oOo!rOp!sOs!tO!x%wX~P)pOV!zOg!|Oo0cOv0qO!PrO~P'vOV#OOo0cOv0qO!W#PO~P'vOV#SOa#TOo0cOv0qO![#UO~P'vOQ#XO%`#XO%a#ZO~OQ#^OR#[O%`#^O%a#`O~OV%iX_%iXa%iXh%iXk%iXl%iXm%iXn%iXo%iXp%iXs%iXz%iX!X%iX!f%iX%j%iX%k%iX%l%iX%m%iX%n%iX%o%iX%p%iX%q%iX%r%iX%s%iXg%iX!T%iX!U%iX~O&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O{%iX!x%iX#g%iX%[%iX%_%iX%z%iX%{%iX!W%iX![%iX!Q%iX#[%iXt%iX!m%iX~P,eOz#dO{%hX!x%hX#g%hX%[%hX%_%hX%z%hX~Oo0cOv0qO~P'vO#g#gO%[#iO%_#iO~O%uWO~O!T#nO#u!VO#z!WO#}hO~OopO~P'vOV#sOa#tO%uWO{wP~OV#xOo0cOv0qO!Q#yO~P'vO{#{O!x$QO%z#|O#g!yX%[!yX%_!yX~OV#xOo0cOv0qO#g#SX%[#SX%_#SX~P'vOo0cOv0qO#g#WX%[#WX%_#WX~P'vOh$WO%uWO~O!f$YO!r$YO%uWO~OV$eO~P'vO!U$gO#s$hO#u$iO~O{$jO~OV$qO~P'vOS$sO%[$rO%_$rO%c$tO~OV$}Oa$}Og%POo0cOv0qO~P'vOo0cOv0qO{%SO~P'vO&Y%UO~Oa!bOh!iO!X!kO!f!mOVba_bakbalbambanbaobapbasbazba{ba!xba#gba%[ba%_ba%jba%kba%lba%mba%nba%oba%pba%qba%rba%sba%zbagba!Tba!Uba%{ba!Wba![ba!Qba#[batba!mba~On%ZO~Oo%ZO~P'vOo0cO~P'vOk0eOl0fOm0dOn0dOo0mOp0nOs0rOg%wX!T%wX!U%wX%{%wX!W%wX![%wX!Q%wX#[%wX!m%wX~P)pO%{%]Og%vXz%vX!T%vX!U%vX!W%vX{%vX~Og%_Oz%`O!T%dO!U%cO~Og%_O~Oz%gO!T%dO!U%cO!W&SX~O!W%kO~Oz%lO{%nO!T%dO!U%cO![%}X~O![%rO~O![%sO~OQ#XO%`#XO%a%uO~OV%wOo0cOv0qO!PrO~P'vOQ#^OR#[O%`#^O%a%zO~OV!qa_!qaa!qah!qak!qal!qam!qan!qao!qap!qas!qaz!qa{!qa!X!qa!f!qa!x!qa#g!qa%[!qa%_!qa%j!qa%k!qa%l!qa%m!qa%n!qa%o!qa%p!qa%q!qa%r!qa%s!qa%z!qag!qa!T!qa!U!qa%{!qa!W!qa![!qa!Q!qa#[!qat!qa!m!qa~P#yOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P%SOV&OOopOvqO{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P'vOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#g$zX%[$zX%_$zX~P'vO#g#gO%[&TO%_&TO~O!f&UOh&sX%[&sXz&sX#[&sX#g&sX%_&sX#Z&sXg&sX~Oh!iO%[&WO~Okealeameaneaoeapeaseazea{ea!xea#gea%[ea%_ea%zeagea!Tea!Uea%{ea!Wea![ea!Qea#[eatea!mea~P%SOsqazqa{qa#gqa%[qa%_qa%zqa~Ok!pOl!qOm!oOn!oOo!rOp!sO!xqa~PEcO%z&YOz%yX{%yX~O%uWOz%yX{%yX~Oz&]O{wX~O{&_O~Oz%lO#g%}X%[%}X%_%}Xg%}X{%}X![%}X!m%}X%z%}X~OV0lOo0cOv0qO!PrO~P'vO%z#|O#gUa%[Ua%_Ua~Oz&hO#g&PX%[&PX%_&PXn&PX~P%SOz&kO!Q&jO#g#Wa%[#Wa%_#Wa~Oz&lO#[&nO#g&rX%[&rX%_&rXg&rX~O!f$YO!r$YO#Z&qO%uWO~O#Z&qO~Oz&sO#g&tX%[&tX%_&tX~Oz&uO#g&pX%[&pX%_&pX{&pX~O!X&wO%z&xO~Oz&|On&wX~P%SOn'PO~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO%['UO~P'vOt'YO#p'WO#q'XOP#naV#naf#nah#nao#nas#nav#na!P#na!Q#na!T#na!U#na!X#na!]#na!h#na!r#na!s#na!t#na!{#na!}#na#P#na#R#na#T#na#X#na#Z#na#^#na#_#na#a#na#c#na#l#na#o#na#s#na#u#na#z#na#}#na$P#na%X#na%o#na%p#na%t#na%u#na&Z#na&[#na&]#na&^#na&_#na&`#na&a#na&b#na&c#na&d#na&e#na&f#na&g#na&h#na&i#na&j#na%Z#na%_#na~Oz'ZO#[']O{&xX~Oh'_O!X&wO~Oh!iO{$jO!X&wO~O{'eO~P%SO%['hO%_'hO~OS'iO%['hO%_'hO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%k!]O~P!#uO%kWi~P!#uOV!aO_!aOa!bOh!iO!X!kO!f!mO%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%m!_O%n!_O~P!&pO%mWi%nWi~P!&pOa!bOh!iO!X!kO!f!mOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%mWi%nWi%oWi%pWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~OV!aO_!aO%q!aO%r!aO%s!aO~P!)nOVWi_Wi%qWi%rWi%sWi~P!)nO!T%dO!U%cOg&VXz&VX~O%z'kO%{'kO~P,eOz'mOg&UX~Og'oO~Oz'pO{'rO!W&XX~Oo0cOv0qOz'pO{'sO!W&XX~P'vO!W'uO~Om!oOn!oOo!rOp!sOkjisjizji{ji!xji#gji%[ji%_ji%zji~Ol!qO~P!.aOlji~P!.aOk0eOl0fOm0dOn0dOo0mOp0nO~Ot'wO~P!/jOV'|Og'}Oo0cOv0qO~P'vOg'}Oz(OO~Og(QO~O!U(SO~Og(TOz(OO!T%dO!U%cO~P%SOk0eOl0fOm0dOn0dOo0mOp0nOgqa!Tqa!Uqa%{qa!Wqa![qa!Qqa#[qatqa!mqa~PEcOV'|Oo0cOv0qO!W&Sa~P'vOz(WO!W&Sa~O!W(XO~Oz(WO!T%dO!U%cO!W&Sa~P%SOV(]Oo0cOv0qO![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~P'vOz(^O![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~O![(aO~Oz(^O!T%dO!U%cO![%}a~P%SOz(dO!T%dO!U%cO![&Ta~P%SOz(gO{&lX![&lX!m&lX%z&lX~O{(kO![(mO!m(nO%z(jO~OV&OOopOvqO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~P'vOz(pO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~O!f&UOh&sa%[&saz&sa#[&sa#g&sa%_&sa#Z&sag&sa~O%[(uO~OV#sOa#tO%uWO~Oz&]O{wa~OopOvqO~P'vOz(^O#g%}a%[%}a%_%}ag%}a{%}a![%}a!m%}a%z%}a~P%SOz(zO#g%hX%[%hX%_%hX%z%hX~O%z#|O#gUi%[Ui%_Ui~O#g&Pa%[&Pa%_&Pan&Pa~P'vOz(}O#g&Pa%[&Pa%_&Pan&Pa~O%uWO#g&ra%[&ra%_&rag&ra~Oz)SO#g&ra%[&ra%_&rag&ra~Og)VO~OV)WOh$WO%uWO~O#Z)XO~O%uWO#g&ta%[&ta%_&ta~Oz)ZO#g&ta%[&ta%_&ta~Oo0cOv0qO#g&pa%[&pa%_&pa{&pa~P'vOz)^O#g&pa%[&pa%_&pa{&pa~OV)`Oa)`O%uWO~O%z)eO~Ot)hO#j)gOP#hiV#hif#hih#hio#his#hiv#hi!P#hi!Q#hi!T#hi!U#hi!X#hi!]#hi!h#hi!r#hi!s#hi!t#hi!{#hi!}#hi#P#hi#R#hi#T#hi#X#hi#Z#hi#^#hi#_#hi#a#hi#c#hi#l#hi#o#hi#s#hi#u#hi#z#hi#}#hi$P#hi%X#hi%o#hi%p#hi%t#hi%u#hi&Z#hi&[#hi&]#hi&^#hi&_#hi&`#hi&a#hi&b#hi&c#hi&d#hi&e#hi&f#hi&g#hi&h#hi&i#hi&j#hi%Z#hi%_#hi~Ot)iOP#kiV#kif#kih#kio#kis#kiv#ki!P#ki!Q#ki!T#ki!U#ki!X#ki!]#ki!h#ki!r#ki!s#ki!t#ki!{#ki!}#ki#P#ki#R#ki#T#ki#X#ki#Z#ki#^#ki#_#ki#a#ki#c#ki#l#ki#o#ki#s#ki#u#ki#z#ki#}#ki$P#ki%X#ki%o#ki%p#ki%t#ki%u#ki&Z#ki&[#ki&]#ki&^#ki&_#ki&`#ki&a#ki&b#ki&c#ki&d#ki&e#ki&f#ki&g#ki&h#ki&i#ki&j#ki%Z#ki%_#ki~OV)kOn&wa~P'vOz)lOn&wa~Oz)lOn&wa~P%SOn)pO~O%Y)tO~Ot)wO#p'WO#q)vOP#niV#nif#nih#nio#nis#niv#ni!P#ni!Q#ni!T#ni!U#ni!X#ni!]#ni!h#ni!r#ni!s#ni!t#ni!{#ni!}#ni#P#ni#R#ni#T#ni#X#ni#Z#ni#^#ni#_#ni#a#ni#c#ni#l#ni#o#ni#s#ni#u#ni#z#ni#}#ni$P#ni%X#ni%o#ni%p#ni%t#ni%u#ni&Z#ni&[#ni&]#ni&^#ni&_#ni&`#ni&a#ni&b#ni&c#ni&d#ni&e#ni&f#ni&g#ni&h#ni&i#ni&j#ni%Z#ni%_#ni~OV)zOo0cOv0qO{$jO~P'vOo0cOv0qO{&xa~P'vOz*OO{&xa~OV*SOa*TOg*WO%q*UO%uWO~O{$jO&{*YO~Oh'_O~Oh!iO{$jO~O%[*_O~O%[*aO%_*aO~OV$}Oa$}Oo0cOv0qOg&Ua~P'vOz*dOg&Ua~Oo0cOv0qO{*gO!W&Xa~P'vOz*hO!W&Xa~Oo0cOv0qOz*hO{*kO!W&Xa~P'vOo0cOv0qOz*hO!W&Xa~P'vOz*hO{*kO!W&Xa~Om0dOn0dOo0mOp0nOgjikjisjizji!Tji!Uji%{ji!Wji{ji![ji#gji%[ji%_ji!Qji#[jitji!mji%zji~Ol0fO~P!NkOlji~P!NkOV'|Og*pOo0cOv0qO~P'vOn*rO~Og*pOz*tO~Og*uO~OV'|Oo0cOv0qO!W&Si~P'vOz*vO!W&Si~O!W*wO~OV(]Oo0cOv0qO![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~P'vOz*zO!T%dO!U%cO![&Ti~Oz*}O![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~O![+OO~Oa+QOo0cOv0qO![&Ti~P'vOz*zO![&Ti~O![+SO~OV+UOo0cOv0qO{&la![&la!m&la%z&la~P'vOz+VO{&la![&la!m&la%z&la~O!]+YO&n+[O![!nX~O![+^O~O{(kO![+_O~O{(kO![+_O!m+`O~OV&OOopOvqO{%hq!x%hq#g%hq%[%hq%_%hq%z%hq~P'vOz$ri{$ri!x$ri#g$ri%[$ri%_$ri%z$ri~P%SOV&OOopOvqO~P'vOV&OOo0cOv0qO#g%ha%[%ha%_%ha%z%ha~P'vOz+aO#g%ha%[%ha%_%ha%z%ha~Oz$ia#g$ia%[$ia%_$ian$ia~P%SO#g&Pi%[&Pi%_&Pin&Pi~P'vOz+dO#g#Wq%[#Wq%_#Wq~O#[+eOz$va#g$va%[$va%_$vag$va~O%uWO#g&ri%[&ri%_&rig&ri~Oz+gO#g&ri%[&ri%_&rig&ri~OV+iOh$WO%uWO~O%uWO#g&ti%[&ti%_&ti~Oo0cOv0qO#g&pi%[&pi%_&pi{&pi~P'vO{#{Oz#eX!W#eX~Oz+mO!W&uX~O!W+oO~Ot+rO#j)gOP#hqV#hqf#hqh#hqo#hqs#hqv#hq!P#hq!Q#hq!T#hq!U#hq!X#hq!]#hq!h#hq!r#hq!s#hq!t#hq!{#hq!}#hq#P#hq#R#hq#T#hq#X#hq#Z#hq#^#hq#_#hq#a#hq#c#hq#l#hq#o#hq#s#hq#u#hq#z#hq#}#hq$P#hq%X#hq%o#hq%p#hq%t#hq%u#hq&Z#hq&[#hq&]#hq&^#hq&_#hq&`#hq&a#hq&b#hq&c#hq&d#hq&e#hq&f#hq&g#hq&h#hq&i#hq&j#hq%Z#hq%_#hq~On$|az$|a~P%SOV)kOn&wi~P'vOz+yOn&wi~Oz,TO{$jO#[,TO~O#q,VOP#nqV#nqf#nqh#nqo#nqs#nqv#nq!P#nq!Q#nq!T#nq!U#nq!X#nq!]#nq!h#nq!r#nq!s#nq!t#nq!{#nq!}#nq#P#nq#R#nq#T#nq#X#nq#Z#nq#^#nq#_#nq#a#nq#c#nq#l#nq#o#nq#s#nq#u#nq#z#nq#}#nq$P#nq%X#nq%o#nq%p#nq%t#nq%u#nq&Z#nq&[#nq&]#nq&^#nq&_#nq&`#nq&a#nq&b#nq&c#nq&d#nq&e#nq&f#nq&g#nq&h#nq&i#nq&j#nq%Z#nq%_#nq~O#[,WOz%Oa{%Oa~Oo0cOv0qO{&xi~P'vOz,YO{&xi~O{#{O%z,[Og&zXz&zX~O%uWOg&zXz&zX~Oz,`Og&yX~Og,bO~O%Y,eO~O!T%dO!U%cOg&Viz&Vi~OV$}Oa$}Oo0cOv0qOg&Ui~P'vO{,hOz$la!W$la~Oo0cOv0qO{,iOz$la!W$la~P'vOo0cOv0qO{*gO!W&Xi~P'vOz,lO!W&Xi~Oo0cOv0qOz,lO!W&Xi~P'vOz,lO{,oO!W&Xi~Og$hiz$hi!W$hi~P%SOV'|Oo0cOv0qO~P'vOn,qO~OV'|Og,rOo0cOv0qO~P'vOV'|Oo0cOv0qO!W&Sq~P'vOz$gi![$gi#g$gi%[$gi%_$gig$gi{$gi!m$gi%z$gi~P%SOV(]Oo0cOv0qO~P'vOa+QOo0cOv0qO![&Tq~P'vOz,sO![&Tq~O![,tO~OV(]Oo0cOv0qO![%}q#g%}q%[%}q%_%}qg%}q{%}q!m%}q%z%}q~P'vO{,uO~OV+UOo0cOv0qO{&li![&li!m&li%z&li~P'vOz,zO{&li![&li!m&li%z&li~O!]+YO&n+[O![!na~O{(kO![,}O~OV&OOo0cOv0qO#g%hi%[%hi%_%hi%z%hi~P'vOz-OO#g%hi%[%hi%_%hi%z%hi~O%uWO#g&rq%[&rq%_&rqg&rq~Oz-RO#g&rq%[&rq%_&rqg&rq~OV)`Oa)`O%uWO!W&ua~Oz-TO!W&ua~On$|iz$|i~P%SOV)kO~P'vOV)kOn&wq~P'vOt-XOP#myV#myf#myh#myo#mys#myv#my!P#my!Q#my!T#my!U#my!X#my!]#my!h#my!r#my!s#my!t#my!{#my!}#my#P#my#R#my#T#my#X#my#Z#my#^#my#_#my#a#my#c#my#l#my#o#my#s#my#u#my#z#my#}#my$P#my%X#my%o#my%p#my%t#my%u#my&Z#my&[#my&]#my&^#my&_#my&`#my&a#my&b#my&c#my&d#my&e#my&f#my&g#my&h#my&i#my&j#my%Z#my%_#my~O%Z-]O%_-]O~P`O#q-^OP#nyV#nyf#nyh#nyo#nys#nyv#ny!P#ny!Q#ny!T#ny!U#ny!X#ny!]#ny!h#ny!r#ny!s#ny!t#ny!{#ny!}#ny#P#ny#R#ny#T#ny#X#ny#Z#ny#^#ny#_#ny#a#ny#c#ny#l#ny#o#ny#s#ny#u#ny#z#ny#}#ny$P#ny%X#ny%o#ny%p#ny%t#ny%u#ny&Z#ny&[#ny&]#ny&^#ny&_#ny&`#ny&a#ny&b#ny&c#ny&d#ny&e#ny&f#ny&g#ny&h#ny&i#ny&j#ny%Z#ny%_#ny~Oz-aO{$jO#[-aO~Oo0cOv0qO{&xq~P'vOz-dO{&xq~O%z,[Og&zaz&za~O{#{Og&zaz&za~OV*SOa*TO%q*UO%uWOg&ya~Oz-hOg&ya~O$S-lO~OV$}Oa$}Oo0cOv0qO~P'vOo0cOv0qO{-mOz$li!W$li~P'vOo0cOv0qOz$li!W$li~P'vO{-mOz$li!W$li~Oo0cOv0qO{*gO~P'vOo0cOv0qO{*gO!W&Xq~P'vOz-pO!W&Xq~Oo0cOv0qOz-pO!W&Xq~P'vOs-sO!T%dO!U%cOg&Oq!W&Oq![&Oqz&Oq~P!/jOa+QOo0cOv0qO![&Ty~P'vOz$ji![$ji~P%SOa+QOo0cOv0qO~P'vOV+UOo0cOv0qO~P'vOV+UOo0cOv0qO{&lq![&lq!m&lq%z&lq~P'vO{(kO![-xO!m-yO%z-wO~OV&OOo0cOv0qO#g%hq%[%hq%_%hq%z%hq~P'vO%uWO#g&ry%[&ry%_&ryg&ry~OV)`Oa)`O%uWO!W&ui~Ot-}OP#m!RV#m!Rf#m!Rh#m!Ro#m!Rs#m!Rv#m!R!P#m!R!Q#m!R!T#m!R!U#m!R!X#m!R!]#m!R!h#m!R!r#m!R!s#m!R!t#m!R!{#m!R!}#m!R#P#m!R#R#m!R#T#m!R#X#m!R#Z#m!R#^#m!R#_#m!R#a#m!R#c#m!R#l#m!R#o#m!R#s#m!R#u#m!R#z#m!R#}#m!R$P#m!R%X#m!R%o#m!R%p#m!R%t#m!R%u#m!R&Z#m!R&[#m!R&]#m!R&^#m!R&_#m!R&`#m!R&a#m!R&b#m!R&c#m!R&d#m!R&e#m!R&f#m!R&g#m!R&h#m!R&i#m!R&j#m!R%Z#m!R%_#m!R~Oo0cOv0qO{&xy~P'vOV*SOa*TO%q*UO%uWOg&yi~O$S-lO%Z.VO%_.VO~OV.aOh._O!X.^O!].`O!h.YO!s.[O!t.[O%p.XO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O~Oo0cOv0qOz$lq!W$lq~P'vO{.fOz$lq!W$lq~Oo0cOv0qO{*gO!W&Xy~P'vOz.gO!W&Xy~Oo0cOv.kO~P'vOs-sO!T%dO!U%cOg&Oy!W&Oy![&Oyz&Oy~P!/jO{(kO![.nO~O{(kO![.nO!m.oO~OV*SOa*TO%q*UO%uWO~Oh.tO!f.rOz$TX#[$TX%j$TXg$TX~Os$TX{$TX!W$TX![$TX~P$-bO%o.vO%p.vOs$UXz$UX{$UX#[$UX%j$UX!W$UXg$UX![$UX~O!h.xO~Oz.|O#[/OO%j.yOs&|X{&|X!W&|Xg&|X~Oa/RO~P$)zOh.tOs&}Xz&}X{&}X#[&}X%j&}X!W&}Xg&}X![&}X~Os/VO{$jO~Oo0cOv0qOz$ly!W$ly~P'vOo0cOv0qO{*gO!W&X!R~P'vOz/ZO!W&X!R~Og&RXs&RX!T&RX!U&RX!W&RX![&RXz&RX~P!/jOs-sO!T%dO!U%cOg&Qa!W&Qa![&Qaz&Qa~O{(kO![/^O~O!f.rOh$[as$[az$[a{$[a#[$[a%j$[a!W$[ag$[a![$[a~O!h/eO~O%o.vO%p.vOs$Uaz$Ua{$Ua#[$Ua%j$Ua!W$Uag$Ua![$Ua~O%j.yOs$Yaz$Ya{$Ya#[$Ya!W$Yag$Ya![$Ya~Os&|a{&|a!W&|ag&|a~P$)nOz/jOs&|a{&|a!W&|ag&|a~O!W/mO~Og/mO~O{/oO~O![/pO~Oo0cOv0qO{*gO!W&X!Z~P'vO{/sO~O%z/tO~P$-bOz/uO#[/OO%j.yOg'PX~Oz/uOg'PX~Og/wO~O!h/xO~O#[/OOs%Saz%Sa{%Sa%j%Sa!W%Sag%Sa![%Sa~O#[/OO%j.yOs%Waz%Wa{%Wa!W%Wag%Wa~Os&|i{&|i!W&|ig&|i~P$)nOz/zO#[/OO%j.yO!['Oa~Og'Pa~P$)nOz0SOg'Pa~Oa0UO!['Oi~P$)zOz0WO!['Oi~Oz0WO#[/OO%j.yO!['Oi~O#[/OO%j.yOg$biz$bi~O%z0ZO~P$-bO#[/OO%j.yOg%Vaz%Va~Og'Pi~P$)nO{0^O~Oa0UO!['Oq~P$)zOz0`O!['Oq~O#[/OO%j.yOz%Ui![%Ui~Oa0UO~P$)zOa0UO!['Oy~P$)zO#[/OO%j.yOg$ciz$ci~O#[/OO%j.yOz%Uq![%Uq~Oz+aO#g%ha%[%ha%_%ha%z%ha~P%SOV&OOo0cOv0qO~P'vOn0hO~Oo0hO~P'vO{0iO~Ot0jO~P!/jO&]&Z&j&h&i&g&f&d&e&c&b&`&a&_&^&[%u~",goto:"!=j'QPPPPPP'RP'Z*s+[+t,_,y-fP.SP'Z.r.r'ZPPP'Z2[PPPPPP2[5PPP5PP7b7k=sPP=v>h>kPP'Z'ZPP>zPP'Z'ZPP'Z'Z'Z'Z'Z?O?w'ZP?zP@QDXGuGyPG|HWH['ZPPPH_Hk'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHqH}IVPI^IdPI^PI^I^PPPI^PKrPK{LVL]KrPI^LfPI^PLmLsPLwM]MzNeLwLwNkNxLwLwLwLw! ^! d! g! l! o! y!!P!!]!!o!!u!#P!#V!#s!#y!$P!$Z!$a!$g!$y!%T!%Z!%a!%k!%q!%w!%}!&T!&Z!&e!&k!&u!&{!'U!'[!'k!'s!'}!(UPPPPPPPPPPP!([!(_!(e!(n!(x!)TPPPPPPPPPPPP!-u!/Z!3^!6oPP!6w!7W!7a!8Y!8P!8c!8i!8l!8o!8r!8z!9jPPPPPPPPPPPPPPPPP!9m!9q!9wP!:]!:a!:m!:v!;S!;j!;m!;p!;v!;|!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[pIt,uIt,cIt,mIt,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:e=>yIt[e]||-1}],tokenPrec:7668}),Aee=new QU,W_e=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function f2(e){return(t,n,i)=>{if(i)return!1;let r=t.node.getChild("VariableName");return r&&n(r,e),!0}}const xIt={FunctionDefinition:f2("function"),ClassDefinition:f2("class"),ForStatement(e,t,n){if(n){for(let i=e.node.firstChild;i;i=i.nextSibling)if(i.name=="VariableName")t(i,"variable");else if(i.name=="in")break}},ImportStatement(e,t){var n,i;let{node:r}=e,s=((n=r.firstChild)===null||n===void 0?void 0:n.name)=="from";for(let a=r.getChild("import");a;a=a.nextSibling)a.name=="VariableName"&&((i=a.nextSibling)===null||i===void 0?void 0:i.name)!="as"&&t(a,s?"variable":"namespace")},AssignStatement(e,t){for(let n=e.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")t(n,"variable");else if(n.name==":"||n.name=="AssignOp")break},ParamList(e,t){for(let n=null,i=e.node.firstChild;i;i=i.nextSibling)i.name=="VariableName"&&(!n||!/\*|AssignOp/.test(n.name))&&t(i,"variable"),n=i},CapturePattern:f2("variable"),AsPattern:f2("variable"),__proto__:null};function G_e(e,t){let n=Aee.get(t);if(n)return n;let i=[],r=!0;function s(a,l){let c=e.sliceString(a.from,a.to);i.push({label:c,type:l})}return t.cursor(er.IncludeAnonymous).iterate(a=>{if(a.name){let l=xIt[a.name];if(l&&l(a,s,r)||!r&&W_e.has(a.name))return!1;r=!1}else if(a.to-a.from>8192){for(let l of G_e(e,a.node))i.push(l);return!1}}),Aee.set(t,i),i}const _ee=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,K_e=["String","FormatString","Comment","PropertyName"];function wIt(e){let t=Or(e.state).resolveInner(e.pos,-1);if(K_e.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&_ee.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let i=[];for(let r=t;r;r=r.parent)W_e.has(r.name)&&(i=i.concat(G_e(e.state.doc,r)));return{options:i,from:n?t.from:e.pos,validFor:_ee}}const OIt=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(e=>({label:e,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(e=>({label:e,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(e=>({label:e,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(e=>({label:e,type:"function"}))),SIt=[ys("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),ys("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),ys("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),ys("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),ys(`if \${}: +`);i=r<0?n:n.slice(0,r)}return t+i.length>this.to?i.slice(0,this.to-t):i}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(t,n,i=0){this.block=KN.create(t,i,this.lineStart+n,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(t,n,i=0){this.startContext(this.parser.getNodeType(t),n,i)}addNode(t,n,i){typeof t=="number"&&(t=new hi(this.parser.nodeSet.types[t],cx,cx,(i??this.prevLineEnd())-n)),this.block.addChild(t,n-this.block.from)}addElement(t){this.block.addChild(t.toTree(this.parser.nodeSet),t.from-this.block.from)}addLeafElement(t,n){this.addNode(this.buffer.writeElements(n8(n.children,t.marks),-n.from).finish(n.type,n.to-n.from),n.from)}finishContext(){let t=this.stack.pop(),n=this.stack[this.stack.length-1];n.addChild(t.toTree(this.parser.nodeSet),t.from-n.from),this.block=n}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(t){return this.ranges.length>1?JAe(this.ranges,0,t.topNode,this.ranges[0].from,this.reusePlaceholders):t}finishLeaf(t){for(let i of t.parsers)if(i.finish(this,t))return;let n=n8(this.parser.parseInline(t.content,t.start),t.marks);this.addNode(this.buffer.writeElements(n,-t.start).finish(It.Paragraph,t.content.length),t.start)}elt(t,n,i,r){return typeof t=="string"?Fi(this.parser.getNodeType(t),n,i,r):new n_e(t,n)}get buffer(){return new t_e(this.parser.nodeSet)}}function JAe(e,t,n,i,r){let s=e[t].to,a=[],l=[],c=n.from+i;function u(d,f){for(;f?d>=s:d>s;){let h=e[t+1].from-s;i+=h,d+=h,t++,s=e[t].to}}for(let d=n.firstChild;d;d=d.nextSibling){u(d.from+i,!0);let f=d.from+i,h,p=r.get(d.tree);p?h=p:d.to+i>s?(h=JAe(e,t,d,i,r),u(d.to+i,!1)):h=d.toTree(),a.push(h),l.push(f-c)}return u(n.to+i,!1),new hi(n.type,a,l,n.to+i-c,n.tree?n.tree.propValues:void 0)}class jI extends yI{constructor(t,n,i,r,s,a,l,c,u){super(),this.nodeSet=t,this.blockParsers=n,this.leafBlockParsers=i,this.blockNames=r,this.endLeafBlock=s,this.skipContextMarkup=a,this.inlineParsers=l,this.inlineNames=c,this.wrappers=u,this.nodeTypes=Object.create(null);for(let d of t.types)this.nodeTypes[d.name]=d.id}createParse(t,n,i){let r=new Z_t(this,t,n,i);for(let s of this.wrappers)r=s(r,t,n,i);return r}configure(t){let n=t8(t);if(!n)return this;let{nodeSet:i,skipContextMarkup:r}=this,s=this.blockParsers.slice(),a=this.leafBlockParsers.slice(),l=this.blockNames.slice(),c=this.inlineParsers.slice(),u=this.inlineNames.slice(),d=this.endLeafBlock.slice(),f=this.wrappers;if(nw(n.defineNodes)){r=Object.assign({},r);let h=i.types.slice(),p;for(let g of n.defineNodes){let{name:b,block:v,composite:y,style:x}=typeof g=="string"?{name:g}:g;if(h.some(k=>k.name==b))continue;y&&(r[h.length]=(k,S,E)=>y(S,E,k.value));let O=h.length,w=y?["Block","BlockContext"]:v?O>=It.ATXHeading1&&O<=It.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;h.push(ea.define({id:O,name:b,props:w&&[[Ln.group,w]]})),x&&(p||(p={}),Array.isArray(x)||x instanceof gd?p[b]=x:Object.assign(p,x))}i=new t1(h),p&&(i=i.extend(Vh(p)))}if(nw(n.props)&&(i=i.extend(...n.props)),nw(n.remove))for(let h of n.remove){let p=this.blockNames.indexOf(h),g=this.inlineNames.indexOf(h);p>-1&&(s[p]=a[p]=void 0),g>-1&&(c[g]=void 0)}if(nw(n.parseBlock))for(let h of n.parseBlock){let p=l.indexOf(h.name);if(p>-1)s[p]=h.parse,a[p]=h.leaf;else{let g=h.before?d2(l,h.before):h.after?d2(l,h.after)+1:l.length-1;s.splice(g,0,h.parse),a.splice(g,0,h.leaf),l.splice(g,0,h.name)}h.endLeaf&&d.push(h.endLeaf)}if(nw(n.parseInline))for(let h of n.parseInline){let p=u.indexOf(h.name);if(p>-1)c[p]=h.parse;else{let g=h.before?d2(u,h.before):h.after?d2(u,h.after)+1:u.length-1;c.splice(g,0,h.parse),u.splice(g,0,h.name)}}return n.wrap&&(f=f.concat(n.wrap)),new jI(i,s,a,l,d,r,c,u,f)}getNodeType(t){let n=this.nodeTypes[t];if(n==null)throw new RangeError(`Unknown node type '${t}'`);return n}parseInline(t,n){let i=new TQ(this,t,n);e:for(let r=n;r=0){r=l;continue e}}r++}return i.resolveMarkers(0)}}function nw(e){return e!=null&&e.length>0}function t8(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=t8(e[0]);if(e.length==1)return t;let n=t8(e.slice(1));if(!n||!t)return t||n;let i=(a,l)=>(a||cx).concat(l||cx),r=t.wrap,s=n.wrap;return{props:i(t.props,n.props),defineNodes:i(t.defineNodes,n.defineNodes),parseBlock:i(t.parseBlock,n.parseBlock),parseInline:i(t.parseInline,n.parseInline),remove:i(t.remove,n.remove),wrap:r?s?(a,l,c,u)=>r(s(a,l,c,u),l,c,u):r:s}}function d2(e,t){let n=e.indexOf(t);if(n<0)throw new RangeError(`Position specified relative to unknown parser ${t}`);return n}let e_e=[ea.none];for(let e=1,t;t=It[e];e++)e_e[e]=ea.define({id:e,name:t,props:e>=It.Escape?[]:[[Ln.group,e in zAe?["Block","BlockContext"]:["Block","LeafBlock"]]],top:t=="Document"});const cx=[];class t_e{constructor(t){this.nodeSet=t,this.content=[],this.nodes=[]}write(t,n,i,r=0){return this.content.push(t,n,i,4+r*4),this}writeElements(t,n=0){for(let i of t)i.writeTo(this,n);return this}finish(t,n){return hi.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:t,length:n})}}let fk=class{constructor(t,n,i,r=cx){this.type=t,this.from=n,this.to=i,this.children=r}writeTo(t,n){let i=t.content.length;t.writeElements(this.children,n),t.content.push(this.type,this.from+n,this.to+n,t.content.length+4-i)}toTree(t){return new t_e(t).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class n_e{constructor(t,n){this.tree=t,this.from=n}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return cx}writeTo(t,n){t.nodes.push(this.tree),t.content.push(t.nodes.length-1,this.from+n,this.to+n,-1)}toTree(){return this.tree}}function Fi(e,t,n,i){return new fk(e,t,n,i)}const i_e={resolve:"Emphasis",mark:"EmphasisMark"},r_e={resolve:"Emphasis",mark:"EmphasisMark"},_g={},XN={};class ql{constructor(t,n,i,r){this.type=t,this.from=n,this.to=i,this.side=r}}const XJ="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let hk=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{hk=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const N5={Escape(e,t,n){if(t!=92||n==e.end-1)return-1;let i=e.char(n+1);for(let r=0;r]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(i);if(r)return e.append(Fi(It.Autolink,n,n+1+r[0].length,[Fi(It.LinkMark,n,n+1),Fi(It.URL,n+1,n+r[0].length),Fi(It.LinkMark,n+r[0].length,n+1+r[0].length)]));let s=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(i);if(s)return e.append(Fi(It.Comment,n,n+1+s[0].length));let a=/^\?[^]*?\?>/.exec(i);if(a)return e.append(Fi(It.ProcessingInstruction,n,n+1+a[0].length));let l=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(i);return l?e.append(Fi(It.HTMLTag,n,n+1+l[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let i=n+1;for(;e.char(i)==t;)i++;let r=e.slice(n-1,n),s=e.slice(i,i+1),a=hk.test(r),l=hk.test(s),c=/\s|^$/.test(r),u=/\s|^$/.test(s),d=!u&&(!l||c||a),f=!c&&(!a||u||l),h=d&&(t==42||!f||a),p=f&&(t==42||!d||l);return e.append(new ql(t==95?i_e:r_e,n,i,(h?1:0)|(p?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(Fi(It.HardBreak,n,n+2));if(t==32){let i=n+1;for(;e.char(i)==32;)i++;if(e.char(i)==10&&i>=n+2)return e.append(Fi(It.HardBreak,n,i+1))}return-1},Link(e,t,n){return t==91?e.append(new ql(_g,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new ql(XN,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let i=e.parts.length-1;i>=0;i--){let r=e.parts[i];if(r instanceof ql&&(r.type==_g||r.type==XN)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[i]=null,-1;let s=e.takeContent(i),a=e.parts[i]=J_t(e,s,r.type==_g?It.Link:It.Image,r.from,n+1);if(r.type==_g)for(let l=0;lt?Fi(It.URL,t+n,s+n):s==e.length?null:!1}}function a_e(e,t,n){let i=e.charCodeAt(t);if(i!=39&&i!=34&&i!=40)return!1;let r=i==40?41:i;for(let s=t+1,a=!1;s=this.end?-1:this.text.charCodeAt(t-this.offset)}get end(){return this.offset+this.text.length}slice(t,n){return this.text.slice(t-this.offset,n-this.offset)}append(t){return this.parts.push(t),t.to}addDelimiter(t,n,i,r,s){return this.append(new ql(t,n,i,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof ql&&(n.type==_g||n.type==XN))return!0}return!1}addElement(t){return this.append(t)}resolveMarkers(t){for(let i=t;i=t;c--){let b=this.parts[c];if(b instanceof ql&&b.side&1&&b.type==r.type&&!(s&&(r.side&1||b.side&2)&&(b.to-b.from+a)%3==0&&((b.to-b.from)%3||a%3))){l=b;break}}if(!l)continue;let u=r.type.resolve,d=[],f=l.from,h=r.to;if(s){let b=Math.min(2,l.to-l.from,a);f=l.to-b,h=r.from+b,u=b==1?"Emphasis":"StrongEmphasis"}l.type.mark&&d.push(this.elt(l.type.mark,f,l.to));for(let b=c+1;b=0;n--){let i=this.parts[n];if(i instanceof ql&&i.type==t&&i.side&1)return n}return null}takeContent(t){let n=this.resolveMarkers(t);return this.parts.length=t,n}getDelimiterAt(t){let n=this.parts[t];return n instanceof ql?n:null}skipSpace(t){return VO(this.text,t-this.offset)+this.offset}elt(t,n,i,r){return typeof t=="string"?Fi(this.parser.getNodeType(t),n,i,r):new n_e(t,n)}}TQ.linkStart=_g;TQ.imageStart=XN;function n8(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),i=0;for(let r of t){for(;i(t?t-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=` +`;)s--;this.fragmentEnd=s?s-1:0}let i=this.cursor;i||(i=this.cursor=this.fragment.tree.cursor(),i.firstChild());let r=t+this.fragment.offset;for(;i.to<=r;)if(!i.parent())return!1;for(;;){if(i.from>=r)return this.fragment.from<=n;if(!i.childAfter(r))return!1}}matches(t){let n=this.cursor.tree;return n&&n.prop(Ln.contextHash)==t}takeNodes(t){let n=this.cursor,i=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=t.absoluteLineStart,a=s,l=t.block.children.length,c=a,u=l;for(;;){if(n.to-i>r){if(n.type.isAnonymous&&n.firstChild())continue;break}let d=l_e(n.from-i,t.ranges);if(n.to-i<=t.ranges[t.rangeI].to)t.addNode(n.tree,d);else{let f=new hi(t.parser.nodeSet.types[It.Paragraph],[],[],0,t.block.hashProp);t.reusePlaceholders.set(f,n.tree),t.addNode(f,d)}if(n.type.is("Block")&&(eNt.indexOf(n.type.id)<0?(a=n.to-i,l=t.block.children.length):(a=c,l=u),c=n.to-i,u=t.block.children.length),!n.nextSibling())break}for(;t.block.children.length>l;)t.block.children.pop(),t.block.positions.pop();return a-s}}function l_e(e,t){let n=e;for(let i=1;iu2[e]),Object.keys(u2).map(e=>ZAe[e]),Object.keys(u2),X_t,zAe,Object.keys(N5).map(e=>N5[e]),Object.keys(N5),[]);function rNt(e,t,n){let i=[];for(let r=e.firstChild,s=t;;r=r.nextSibling){let a=r?r.from:n;if(a>s&&i.push({from:s,to:a}),!r)break;s=r.to}return i}function sNt(e){let{codeParser:t,htmlParser:n}=e;return{wrap:STe((r,s)=>{let a=r.type.id;if(t&&(a==It.CodeBlock||a==It.FencedCode)){let l="";if(a==It.FencedCode){let u=r.node.getChild(It.CodeInfo);u&&(l=s.read(u.from,u.to))}let c=t(l);if(c)return{parser:c,overlay:u=>u.type.id==It.CodeText,bracketed:a==It.FencedCode}}else if(n&&(a==It.HTMLBlock||a==It.HTMLTag||a==It.CommentBlock))return{parser:n,overlay:rNt(r.node,r.from,r.to)};return null})}}const aNt={resolve:"Strikethrough",mark:"StrikethroughMark"},oNt={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":ne.strikethrough}},{name:"StrikethroughMark",style:ne.processingInstruction}],parseInline:[{name:"Strikethrough",parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let i=e.slice(n-1,n),r=e.slice(n+2,n+3),s=/\s|^$/.test(i),a=/\s|^$/.test(r),l=hk.test(i),c=hk.test(r);return e.addDelimiter(aNt,n,n+2,!a&&(!c||s||l),!s&&(!l||a||c))},after:"Emphasis"}]};function HO(e,t,n=0,i,r=0){let s=0,a=!0,l=-1,c=-1,u=!1,d=()=>{i.push(e.elt("TableCell",r+l,r+c,e.parser.parseInline(t.slice(l,c),r+l)))};for(let f=n;f-1)&&s++,a=!1,i&&(l>-1&&d(),i.push(e.elt("TableDelimiter",f+r,f+r+1))),l=c=-1):(u||h!=32&&h!=9)&&(l<0&&(l=f),c=f+1),u=!u&&h==92}return l>-1&&(s++,i&&d()),s}function YJ(e,t){for(let n=t;n\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class ZJ{constructor(){this.rows=null}nextLine(t,n,i){if(this.rows==null){this.rows=!1;let r;if((n.next==45||n.next==58||n.next==124)&&c_e.test(r=n.text.slice(n.pos))){let s=[];HO(t,i.content,0,s,i.start)==HO(t,r,0)&&(this.rows=[t.elt("TableHeader",i.start,i.start+i.content.length,s),t.elt("TableDelimiter",t.lineStart+n.pos,t.lineStart+n.text.length)])}}else if(this.rows){let r=[];HO(t,n.text,n.pos,r,t.lineStart),this.rows.push(t.elt("TableRow",t.lineStart+n.pos,t.lineStart+n.text.length,r))}return!1}finish(t,n){return this.rows?(t.addLeafElement(n,t.elt("Table",n.start,n.start+n.content.length,this.rows)),!0):!1}}const lNt={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":ne.heading}},"TableRow",{name:"TableCell",style:ne.content},{name:"TableDelimiter",style:ne.processingInstruction}],parseBlock:[{name:"Table",leaf(e,t){return YJ(t.content,0)?new ZJ:null},endLeaf(e,t,n){if(n.parsers.some(r=>r instanceof ZJ)||!YJ(t.text,t.basePos))return!1;let i=e.peekLine();return c_e.test(i)&&HO(e,t.text,t.basePos)==HO(e,i,t.basePos)},before:"SetextHeading"}]};class cNt{nextLine(){return!1}finish(t,n){return t.addLeafElement(n,t.elt("Task",n.start,n.start+n.content.length,[t.elt("TaskMarker",n.start,n.start+3),...t.parser.parseInline(n.content.slice(3),n.start+3)])),!0}}const uNt={defineNodes:[{name:"Task",block:!0,style:ne.list},{name:"TaskMarker",style:ne.atom}],parseBlock:[{name:"TaskList",leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name=="ListItem"?new cNt:null},after:"SetextHeading"}]},JJ=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,eee=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,dNt=/[\w-]+\.[\w-]+($|[/:])/,tee=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,nee=/\/[a-zA-Z\d@.]+/gy;function iee(e,t,n,i){let r=0;for(let s=t;s-1)return-1;let i=t+n[0].length;for(;;){let r=e[i-1],s;if(/[?!.,:*_~]/.test(r)||r==")"&&iee(e,t,i,")")>iee(e,t,i,"("))i--;else if(r==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,i))))i=t+s.index;else break}return i}function ree(e,t){tee.lastIndex=t;let n=tee.exec(e);if(!n)return-1;let i=n[0][n[0].length-1];return i=="_"||i=="-"?-1:t+n[0].length-(i=="."?1:0)}const hNt={parseInline:[{name:"Autolink",parse(e,t,n){let i=n-e.offset;if(i&&/\w/.test(e.text[i-1]))return-1;JJ.lastIndex=i;let r=JJ.exec(e.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=fNt(e.text,i+r[0].length),s>-1&&e.hasOpenLink){let a=/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(i,s));s=i+a[0].length}}else r[3]?s=ree(e.text,i):(s=ree(e.text,i+r[0].length),s>-1&&r[0]=="xmpp:"&&(nee.lastIndex=s,r=nee.exec(e.text),r&&(s=r.index+r[0].length)));return s<0?-1:(e.addElement(e.elt("URL",n,s+e.offset)),s+e.offset)}}]},pNt=[lNt,uNt,oNt,hNt];function u_e(e,t,n){return(i,r,s)=>{if(r!=e||i.char(s+1)==e)return-1;let a=[i.elt(n,s,s+1)];for(let l=s+1;l=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let lee=null,cee=null,uee=0;function r8(e,t){let n=e.pos+t;if(uee==n&&cee==e)return lee;let i=e.peek(t),r="";for(;UNt(i);)r+=String.fromCharCode(i),i=e.peek(++t);return cee=e,uee=n,lee=r?r.toLowerCase():i==QNt||i==zNt?void 0:null}const y_e=60,YN=62,_Q=47,QNt=63,zNt=33,VNt=45;function dee(e,t){this.name=e,this.parent=t}const HNt=[AQ,p_e,d_e,f_e,h_e],qNt=new _I({start:null,shift(e,t,n,i){return HNt.indexOf(t)>-1?new dee(r8(i,1)||"",e):e},reduce(e,t){return t==m_e&&e?e.parent:e},reuse(e,t,n,i){let r=t.type.id;return r==AQ||r==DNt?new dee(r8(i,1)||"",e):e},strict:!1}),WNt=new zs((e,t)=>{if(e.next!=y_e){e.next<0&&t.context&&e.acceptToken(j5);return}e.advance();let n=e.next==_Q;n&&e.advance();let i=r8(e,0);if(i===void 0)return;if(!i)return e.acceptToken(n?_Nt:ANt);let r=t.context?t.context.name:null;if(n){if(i==r)return e.acceptToken(ENt);if(r&&BNt[r])return e.acceptToken(j5,-2);if(t.dialectEnabled(LNt))return e.acceptToken(CNt);for(let s=t.context;s;s=s.parent)if(s.name==i)return;e.acceptToken(TNt)}else{if(i=="script")return e.acceptToken(d_e);if(i=="style")return e.acceptToken(f_e);if(i=="textarea")return e.acceptToken(h_e);if(FNt.hasOwnProperty(i))return e.acceptToken(p_e);r&&oee[r]&&oee[r][i]?e.acceptToken(j5,-1):e.acceptToken(AQ)}},{contextual:!0}),GNt=new zs(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(aee);break}if(e.next==VNt)t++;else if(e.next==YN&&t>=2){n>=3&&e.acceptToken(aee,-2);break}else t=0;e.advance()}});function KNt(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const XNt=new zs((e,t)=>{if(e.next==_Q&&e.peek(1)==YN){let n=t.dialectEnabled($Nt)||KNt(t.context);e.acceptToken(n?kNt:see,2)}else e.next==YN&&e.acceptToken(see,1)});function NQ(e,t,n){let i=2+e.length;return new zs(r=>{for(let s=0,a=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(t);break}if(s==0&&r.next==y_e||s==1&&r.next==_Q||s>=2&&sa?r.acceptToken(t,-a):r.acceptToken(n,-(a-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(t,1);break}else s=a=0;r.advance()}})}const YNt=NQ("script",yNt,vNt),ZNt=NQ("style",xNt,wNt),JNt=NQ("textarea",ONt,SNt),ejt=Vh({"Text RawText IncompleteTag IncompleteCloseTag":ne.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":ne.angleBracket,TagName:ne.tagName,"MismatchedCloseTag/TagName":[ne.tagName,ne.invalid],AttributeName:ne.attributeName,"AttributeValue UnquotedAttributeValue":ne.attributeValue,Is:ne.definitionOperator,"EntityReference CharacterReference":ne.character,Comment:ne.blockComment,ProcessingInst:ne.processingInstruction,DoctypeDecl:ne.documentMeta}),tjt=Rh.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:qNt,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[ejt],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let u=l.type.id;if(u==RNt)return R5(l,c,n);if(u==INt)return R5(l,c,i);if(u==PNt)return R5(l,c,r);if(u==m_e&&s.length){let d=l.node,f=d.firstChild,h=f&&fee(f,c),p;if(h){for(let g of s)if(g.tag==h&&(!g.attrs||g.attrs(p||(p=v_e(f,c))))){let b=d.lastChild,v=b.type.id==MNt?b.from:d.to;if(v>f.to)return{parser:g.parser,overlay:[{from:f.to,to:v}]}}}}if(a&&u==g_e){let d=l.node,f;if(f=d.firstChild){let h=a[c.read(f.from,f.to)];if(h)for(let p of h){if(p.tagName&&p.tagName!=fee(d.parent,c))continue;let g=d.lastChild;if(g.type.id==i8){let b=g.from+1,v=g.lastChild,y=g.to-(v&&v.isError?0:1);if(y>b)return{parser:p.parser,overlay:[{from:b,to:y}],bracketed:!0}}else if(g.type.id==b_e)return{parser:p.parser,overlay:[{from:g.from,to:g.to}]}}}}return null})}const njt=145,hee=1,ijt=146,rjt=147,w_e=2,sjt=148,ajt=3,ojt=4,O_e=[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],ljt=58,cjt=40,S_e=95,ujt=91,MA=45,djt=46,fjt=35,hjt=37,pjt=38,mjt=92,gjt=10,bjt=42;function pk(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function jQ(e){return e>=48&&e<=57}function pee(e){return jQ(e)||e>=97&&e<=102||e>=65&&e<=70}const k_e=(e,t,n)=>(i,r)=>{for(let s=!1,a=0,l=0;;l++){let{next:c}=i;if(pk(c)||c==MA||c==S_e||s&&jQ(c))!s&&(c!=MA||l>0)&&(s=!0),a===l&&c==MA&&a++,i.advance();else if(c==mjt&&i.peek(1)!=gjt){if(i.advance(),pee(i.next)){do i.advance();while(pee(i.next));i.next==32&&i.advance()}else i.next>-1&&i.advance();s=!0}else{s&&i.acceptToken(a==2&&r.canShift(w_e)?t:c==cjt?n:e);break}}},yjt=new zs(k_e(ijt,w_e,rjt),{contextual:!0}),vjt=new zs(k_e(sjt,ajt,ojt),{contextual:!0}),xjt=new zs(e=>{if(O_e.includes(e.peek(-1))){let{next:t}=e;(pk(t)||t==S_e||t==fjt||t==djt||t==bjt||t==ujt||t==ljt&&pk(e.peek(1))||t==MA||t==pjt)&&e.acceptToken(njt)}}),wjt=new zs(e=>{if(!O_e.includes(e.peek(-1))){let{next:t}=e;if(t==hjt&&(e.advance(),e.acceptToken(hee)),pk(t)){do e.advance();while(pk(e.next)||jQ(e.next));e.acceptToken(hee)}}}),Ojt=Vh({"AtKeyword import charset namespace keyframes media supports font-feature-values":ne.definitionKeyword,"from to selector scope MatchFlag":ne.keyword,NamespaceName:ne.namespace,KeyframeName:ne.labelName,KeyframeRangeName:ne.operatorKeyword,TagName:ne.tagName,ClassName:ne.className,PseudoClassName:ne.constant(ne.className),IdName:ne.labelName,"FeatureName PropertyName":ne.propertyName,AttributeName:ne.attributeName,NumberLiteral:ne.number,KeywordQuery:ne.keyword,UnaryQueryOp:ne.operatorKeyword,"CallTag ValueName FontName":ne.atom,VariableName:ne.variableName,Callee:ne.operatorKeyword,Unit:ne.unit,"UniversalSelector NestingSelector":ne.definitionOperator,"MatchOp CompareOp":ne.compareOperator,"ChildOp SiblingOp, LogicOp":ne.logicOperator,BinOp:ne.arithmeticOperator,Important:ne.modifier,Comment:ne.blockComment,ColorLiteral:ne.color,"ParenthesizedContent StringLiteral":ne.string,":":ne.punctuation,"PseudoOp #":ne.derefOperator,"; , |":ne.separator,"( )":ne.paren,"[ ]":ne.squareBracket,"{ }":ne.brace}),Sjt={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:152,"url-prefix":152,domain:152,regexp:152},kjt={__proto__:null,or:104,and:104,not:112,only:112,layer:206},Ejt={__proto__:null,selector:118,style:124,layer:202},Cjt={__proto__:null,"@import":198,"@media":210,"@charset":214,"@namespace":218,"@keyframes":224,"@supports":236,"@scope":240,"@font-feature-values":246},Tjt={__proto__:null,to:243},Ajt=Rh.deserialize({version:14,states:"MlQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FnO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#EOO'dQdO'#EQO'oQdO'#EXO'oQdO'#E[OOQP'#Fn'#FnO)RQhO'#E}OOQS'#Fm'#FmOOQS'#FQ'#FQQYQdOOO)YQdO'#EbO*iQhO'#EhO)YQdO'#EjO*pQdO'#ElO*{QdO'#EoO)}QhO'#EuO+TQdO'#EwO+`QdO'#EzO+eQaO'#CfO+lQ`O'#E_O+qQ`O'#F{O+|QdO'#F{QOQ`OOP,WO&jO'#CaPOOO)CA])CA]OOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,cQdO,59YO'_QdO,5:jO'dQdO,5:lO'oQdO,5:sO'oQdO,5:uO'oQdO,5:vO'oQdO'#FXO,nQ`O,58}O,vQdO'#E^OOQS,58},58}OOQP'#Cq'#CqOOQO'#D|'#D|OOQP,59Y,59YO,}Q`O,59YO-SQ`O,59YOOQP'#EP'#EPOOQP,5:j,5:jO-XQpO'#ERO-dQdO'#ESO-iQ`O'#ESO-nQpO,5:lO.XQaO,5:sO.oQaO,5:vOOQW'#D^'#D^O/nQhO'#DgO0RQhO,5;iO)}QhO'#DeO0`Q`O'#DnO0eQhO'#DxOOQW'#Ft'#FtOOQS,5;i,5;iO0jQ`O'#DhO0oQ`O'#DkOOQS-E9O-E9OOOQ['#Cv'#CvO0tQdO'#CwO1[QdO'#C}O1rQdO'#DQO2YQ!pO'#DSO4fQ!jO,5:|OOQO'#DX'#DXO-SQ`O'#DWO4vQ!nO'#FqO6|Q`O'#DYO7RQ`O'#DyOOQ['#Fq'#FqO7WQhO'#GOO7fQ`O,5;SO7kQ!bO,5;UOOQS'#En'#EnO7sQ`O,5;WO7xQdO,5;WOOQO'#Eq'#EqO8QQ`O,5;ZO8VQhO,5;aO'oQdO'#DjOOQS,5;c,5;cO0jQ`O,5;cO8_QdO,5;cOOQS'#F`'#F`O8gQdO'#E|O7fQ`O,5;fO8oQdO,5:yO9PQdO'#FZO9^Q`O,5lQhO'#DoOOQW,5:Y,5:YOOQW,5:d,5:dOOQW,5:S,5:SO>vQhO,5:VO?bQ!fO'#FrOOQS'#Fr'#FrOOQS'#FS'#FSO@rQdO,59cOOQ[,59c,59cOAYQdO,59iOOQ[,59i,59iOApQdO,59lOOQ[,59l,59lOOQ[,59n,59nO)YQdO,59pOBWQhO'#EdOOQW'#Ed'#EdOBuQ`O1G0hO4oQhO1G0hOOQ[,59r,59rO)}QhO'#D[OOQ[,59t,59tOBzQ#tO,5:eOCVQhO'#F]OCdQ`O,5vQhO'#DmOI_QhO'#DqOIgQhO'#DsOIlQhO'#FwOOQO'#Fw'#FwOItQ!bO'#DwOOQO'#Fy'#FyOOQO'#Fv'#FvOIyQ`O1G/qOOQS-E9Q-E9QOOQ[1G.}1G.}OOQ[1G/T1G/TOOQ[1G/W1G/WOOQ[1G/[1G/[OJOQdO,5;OOOQS7+&S7+&SOJTQ`O7+&SOJYQhO'#D]OJbQ`O,59vO)}QhO,59vOOQ[1G0P1G0POJjQ`O1G0POJoQhO,5;wOOQO-E9Z-E9ZOOQS7+&^7+&^OJ}QbO'#DSOOQO'#Et'#EtOK]Q`O'#EsOOQO'#Es'#EsOKhQ`O'#F^OKpQdO,5;^OOQS,5;^,5;^OOQ[1G/p1G/pOOQS7+&i7+&iO7fQ`O7+&iOK{Q!fO'#FYO)YQdO'#FYOMSQdO7+&POOQO7+&P7+&POOQO,5:{,5:{OOQO1G1a1G1aOMgQ!bO<vQhO'#DrOOQO,5:],5:]O! hQhO,5:_OGUQhO,5:cOOQW7+%]7+%]OOQO'#Ef'#EfO! pQ`O1G0jOOQS<xAN>xO!#zQ`OAN>xO!$PQaO,5;rOOQO-E9U-E9UO!$ZQdO,5;qOOQO-E9T-E9TOOQW<vQhO'#DuOOQO1G/y1G/yO!%vQ!bO1G/}OJOQdO'#F[O!&OQ`O7+&UOOQW7+&U7+&UO!&WQ!bO1G/cOOQ[7+$|7+$|O!&cQhO7+$|P!&jQ`O'#FTOOQO,5;y,5;yOOQO-E9]-E9]OOQS1G1d1G1dOOQPG24dG24dO!&oQ`OAN>ZO)YQdO1G1[O!&tQ`O7+'jOOQO1G/x1G/xO!&|Q`O,5:aO!$eQhO7+%iOOQO,5;v,5;vOOQO-E9Y-E9YOOQW<Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!o`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$[~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$[~!o`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%jj)jS$qYOy%jz;'S%j;'S;=`%{<%lO%j~)yWOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d<%lO)v~*hOw~~*kRO;'S)v;'S;=`*t;=`O)v~*wXOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d;=`<%l)v<%lO)v~+gP;=`<%l)vj+oYmYOy%jz!Q%j!Q![,_![!c%j!c!i,_!i#T%j#T#Z,_#Z;'S%j;'S;=`%{<%lO%jj,dY!o`Oy%jz!Q%j!Q![-S![!c%j!c!i-S!i#T%j#T#Z-S#Z;'S%j;'S;=`%{<%lO%jj-XY!o`Oy%jz!Q%j!Q![-w![!c%j!c!i-w!i#T%j#T#Z-w#Z;'S%j;'S;=`%{<%lO%jj.OYuY!o`Oy%jz!Q%j!Q![.n![!c%j!c!i.n!i#T%j#T#Z.n#Z;'S%j;'S;=`%{<%lO%jj.uYuY!o`Oy%jz!Q%j!Q![/e![!c%j!c!i/e!i#T%j#T#Z/e#Z;'S%j;'S;=`%{<%lO%jj/jY!o`Oy%jz!Q%j!Q![0Y![!c%j!c!i0Y!i#T%j#T#Z0Y#Z;'S%j;'S;=`%{<%lO%jj0aYuY!o`Oy%jz!Q%j!Q![1P![!c%j!c!i1P!i#T%j#T#Z1P#Z;'S%j;'S;=`%{<%lO%jj1UY!o`Oy%jz!Q%j!Q![1t![!c%j!c!i1t!i#T%j#T#Z1t#Z;'S%j;'S;=`%{<%lO%jj1{SuY!o`Oy%jz;'S%j;'S;=`%{<%lO%jd2[UOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jd2uS!yS!o`Oy%jz;'S%j;'S;=`%{<%lO%jb3WS^QOy%jz;'S%j;'S;=`%{<%lO%j~3gWOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{<%lO3d~4SRO;'S3d;'S;=`4];=`O3d~4`XOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{;=`<%l3d<%lO3d~5OP;=`<%l3dj5WShYOy%jz;'S%j;'S;=`%{<%lO%j~5iOg~n5pUWQyWOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jj6ZWyW#PQOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj6xU!o`Oy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%jj7cY!o`$gYOy%jz!Q%j!Q![7[![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj8WY!o`Oy%jz{%j{|8v|}%j}!O8v!O!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj8{U!o`Oy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj9fU!o`$gYOy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj:P[!o`$gYOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj:zS!dYOy%jz;'S%j;'S;=`%{<%lO%jj;]WyWOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj;zU`YOy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%j~VUcYOy%jz![%j![!]>i!];'S%j;'S;=`%{<%lO%jj>pSdY!o`Oy%jz;'S%j;'S;=`%{<%lO%jj?RSnYOy%jz;'S%j;'S;=`%{<%lO%jh?dU!WWOy%jz!_%j!_!`?v!`;'S%j;'S;=`%{<%lO%jh?}S!WW!o`Oy%jz;'S%j;'S;=`%{<%lO%jl@bS!WW!ySOy%jz;'S%j;'S;=`%{<%lO%jj@uV!|Q!WWOy%jz!_%j!_!`?v!`!aA[!a;'S%j;'S;=`%{<%lO%jbAcS!|Q!o`Oy%jz;'S%j;'S;=`%{<%lO%jjArYOy%jz}%j}!OBb!O!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjBgW!o`Oy%jz!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjCW[lY!o`Oy%jz}%j}!OCP!O!Q%j!Q![CP![!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jhDRS!zWOy%jz;'S%j;'S;=`%{<%lO%jjDdSpYOy%jz;'S%j;'S;=`%{<%lO%jnDuSo^Oy%jz;'S%j;'S;=`%{<%lO%jjEWU!zWOy%jz#a%j#a#bEj#b;'S%j;'S;=`%{<%lO%jbEoU!o`Oy%jz#d%j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!o`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!o`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!o`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!o`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!o`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!o`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$pQ!o`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$cUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU#PQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[xjt,wjt,yjt,vjt,1,2,3,4,new qN("m~RRYZ[z{a~~g~aO$_~~dP!P!Qg~lO$`~~",28,152)],topRules:{StyleSheet:[0,6],Styles:[1,126]},dynamicPrecedences:{94:1},specialized:[{term:147,get:e=>Sjt[e]||-1},{term:148,get:e=>kjt[e]||-1},{term:4,get:e=>Ejt[e]||-1},{term:28,get:e=>Cjt[e]||-1},{term:146,get:e=>Tjt[e]||-1}],tokenPrec:2405});let I5=null;function P5(){if(!I5&&typeof document=="object"&&document.body){let{style:e}=document.body,t=[],n=new Set;for(let i in e)i!="cssText"&&i!="cssFloat"&&typeof e[i]=="string"&&(/[A-Z]/.test(i)&&(i=i.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),n.has(i)||(t.push(i),n.add(i)));I5=t.sort().map(i=>({type:"property",label:i,apply:i+": "}))}return I5||[]}const mee=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),gee=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),_jt=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),Njt=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),xf=/^(\w[\w-]*|-\w[\w-]*|)$/,jjt=/^-(-[\w-]*)?$/;function Rjt(e,t){var n;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let i=(n=e.parent)===null||n===void 0?void 0:n.firstChild;return(i==null?void 0:i.name)!="Callee"?!1:t.sliceString(i.from,i.to)=="var"}const bee=new QU,Ijt=["Declaration"];function Pjt(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function E_e(e,t,n){if(t.to-t.from>4096){let i=bee.get(t);if(i)return i;let r=[],s=new Set,a=t.cursor(er.IncludeAnonymous);if(a.firstChild())do for(let l of E_e(e,a.node,n))s.has(l.label)||(s.add(l.label),r.push(l));while(a.nextSibling());return bee.set(t,r),r}else{let i=[],r=new Set;return t.cursor().iterate(s=>{var a;if(n(s)&&s.matchContext(Ijt)&&((a=s.node.nextSibling)===null||a===void 0?void 0:a.name)==":"){let l=e.sliceString(s.from,s.to);r.has(l)||(r.add(l),i.push({label:l,type:"variable"}))}}),i}}const Djt=e=>t=>{let{state:n,pos:i}=t,r=Or(n).resolveInner(i,-1),s=r.type.isError&&r.from==r.to-1&&n.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:P5(),validFor:xf};if(r.name=="ValueName")return{from:r.from,options:gee,validFor:xf};if(r.name=="PseudoClassName")return{from:r.from,options:mee,validFor:xf};if(e(r)||(t.explicit||s)&&Rjt(r,n.doc))return{from:e(r)||s?r.from:i,options:E_e(n.doc,Pjt(r),e),validFor:jjt};if(r.name=="TagName"){for(let{parent:c}=r;c;c=c.parent)if(c.name=="Block")return{from:r.from,options:P5(),validFor:xf};return{from:r.from,options:_jt,validFor:xf}}if(r.name=="AtKeyword")return{from:r.from,options:Njt,validFor:xf};if(!t.explicit)return null;let a=r.resolve(i),l=a.childBefore(i);return l&&l.name==":"&&a.name=="PseudoClassSelector"?{from:i,options:mee,validFor:xf}:l&&l.name==":"&&a.name=="Declaration"||a.name=="ArgList"?{from:i,options:gee,validFor:xf}:a.name=="Block"||a.name=="Styles"?{from:i,options:P5(),validFor:xf}:null},Mjt=Djt(e=>e.name=="VariableName"),ZN=jh.define({name:"css",parser:Ajt.configure({props:[Hh.add({Declaration:pv()}),qh.add({"Block KeyframeList":LE})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Ljt(){return new Nm(ZN,ZN.data.of({autocomplete:Mjt}))}const iw=["_blank","_self","_top","_parent"],D5=["ascii","utf-8","utf-16","latin1","latin1"],M5=["get","post","put","delete"],L5=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Ml=["true","false"],mn={},$jt={a:{attrs:{href:null,ping:null,type:null,media:null,target:iw,hreflang:null}},abbr:mn,address:mn,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:mn,aside:mn,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:mn,base:{attrs:{href:null,target:iw}},bdi:mn,bdo:mn,blockquote:{attrs:{cite:null}},body:mn,br:mn,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:L5,formmethod:M5,formnovalidate:["novalidate"],formtarget:iw,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:mn,center:mn,cite:mn,code:mn,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:mn,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:mn,div:mn,dl:mn,dt:mn,em:mn,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:mn,figure:mn,footer:mn,form:{attrs:{action:null,name:null,"accept-charset":D5,autocomplete:["on","off"],enctype:L5,method:M5,novalidate:["novalidate"],target:iw}},h1:mn,h2:mn,h3:mn,h4:mn,h5:mn,h6:mn,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:mn,hgroup:mn,hr:mn,html:{attrs:{manifest:null}},i:mn,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:L5,formmethod:M5,formnovalidate:["novalidate"],formtarget:iw,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:mn,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:mn,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:mn,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:D5,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:mn,noscript:mn,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:mn,param:{attrs:{name:null,value:null}},pre:mn,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:mn,rt:mn,ruby:mn,samp:mn,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:D5}},section:mn,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:mn,source:{attrs:{src:null,type:null,media:null}},span:mn,strong:mn,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:mn,summary:mn,sup:mn,table:mn,tbody:mn,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:mn,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:mn,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:mn,time:{attrs:{datetime:null}},title:mn,tr:mn,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:mn,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:mn},C_e={accesskey:null,class:null,contenteditable:Ml,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Ml,autocorrect:Ml,autocapitalize:Ml,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Ml,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Ml,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Ml,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Ml,"aria-hidden":Ml,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Ml,"aria-multiselectable":Ml,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Ml,"aria-relevant":null,"aria-required":Ml,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},T_e="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of T_e)C_e[e]=null;class mk{constructor(t,n){this.tags={...$jt,...t},this.globalAttrs={...C_e,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}mk.default=new mk;function ux(e,t,n=e.length){if(!t)return"";let i=t.firstChild,r=i&&i.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,n)):""}function dx(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function A_e(e,t,n){let i=n.tags[ux(e,dx(t))];return(i==null?void 0:i.children)||n.allTags}function RQ(e,t){let n=[];for(let i=dx(t);i&&!i.type.isTop;i=dx(i.parent)){let r=ux(e,i);if(r&&i.lastChild.name=="CloseTag")break;r&&n.indexOf(r)<0&&(t.name=="EndTag"||t.from>=i.firstChild.to)&&n.push(r)}return n}const __e=/^[:\-\.\w\u00b7-\uffff]*$/;function yee(e,t,n,i,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">",a=dx(n,n.name=="StartTag"||n.name=="TagName");return{from:i,to:r,options:A_e(e.doc,a,t).map(l=>({label:l,type:"type"})).concat(RQ(e.doc,n).map((l,c)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function vee(e,t,n,i){let r=/\s*>/.test(e.sliceDoc(i,i+5))?"":">";return{from:n,to:i,options:RQ(e.doc,t).map((s,a)=>({label:s,apply:s+r,type:"type",boost:99-a})),validFor:__e}}function Fjt(e,t,n,i){let r=[],s=0;for(let a of A_e(e.doc,n,t))r.push({label:"<"+a,type:"type"});for(let a of RQ(e.doc,n))r.push({label:"",type:"type",boost:99-s++});return{from:i,to:i,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Bjt(e,t,n,i,r){let s=dx(n),a=s?t.tags[ux(e.doc,s)]:null,l=a&&a.attrs?Object.keys(a.attrs):[],c=a&&a.globalAttrs===!1?l:l.length?l.concat(t.globalAttrNames):t.globalAttrNames;return{from:i,to:r,options:c.map(u=>({label:u,type:"property"})),validFor:__e}}function Ujt(e,t,n,i,r){var s;let a=(s=n.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],c;if(a){let u=e.sliceDoc(a.from,a.to),d=t.globalAttrs[u];if(!d){let f=dx(n),h=f?t.tags[ux(e.doc,f)]:null;d=(h==null?void 0:h.attrs)&&h.attrs[u]}if(d){let f=e.sliceDoc(i,r).toLowerCase(),h='"',p='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,h="",p=e.sliceDoc(r,r+1)==f[0]?"":f[0],f=f.slice(1),i++):c=/^[^\s<>='"]*$/;for(let g of d)l.push({label:g,apply:h+g+p,type:"constant"})}}return{from:i,to:r,options:l,validFor:c}}function N_e(e,t){let{state:n,pos:i}=t,r=Or(n).resolveInner(i,-1),s=r.resolve(i);for(let a=i,l;s==r&&(l=r.childBefore(a));){let c=l.lastChild;if(!c||!c.type.isError||c.fromN_e(i,r)}const Vjt=$d.parser.configure({top:"SingleExpression"}),j_e=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:$Ae.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:FAe.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:BAe.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Vjt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:$d.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:ZN.parser}],R_e=[{name:"style",parser:ZN.parser.configure({top:"Styles"})}].concat(T_e.map(e=>({name:e,parser:$d.parser}))),I_e=jh.define({name:"html",parser:tjt.configure({props:[Hh.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].lengthe.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),LA=I_e.configure({wrap:x_e(j_e,R_e)});function Hjt(e={}){let t="",n;e.matchClosingTags===!1&&(t="noMatch"),e.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=x_e((e.nestedLanguages||[]).concat(j_e),(e.nestedAttributes||[]).concat(R_e)));let i=n?I_e.configure({wrap:n,dialect:t}):t?LA.configure({dialect:t}):LA;return new Nm(i,[LA.data.of({autocomplete:zjt(e)}),e.autoCloseTags!==!1?qjt:[],Z$().support,Ljt().support])}const xee=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),qjt=zt.inputHandler.of((e,t,n,i,r)=>{if(e.composing||e.state.readOnly||t!=n||i!=">"&&i!="/"||!LA.isActiveAt(e.state,t,-1))return!1;let s=r(),{state:a}=s,l=a.changeByRange(c=>{var u,d,f;let h=a.doc.sliceString(c.from-1,c.to)==i,{head:p}=c,g=Or(a).resolveInner(p,-1),b;if(h&&i==">"&&g.name=="EndTag"){let v=g.parent;if(((d=(u=v.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(b=ux(a.doc,v.parent,p))&&!xee.has(b)){let y=p+(a.doc.sliceString(p,p+1)===">"?1:0),x=``;return{range:c,changes:{from:p,to:y,insert:x}}}}else if(h&&i=="/"&&g.name=="IncompleteCloseTag"){let v=g.parent;if(g.from==p-2&&((f=v.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(b=ux(a.doc,v,p))&&!xee.has(b)){let y=p+(a.doc.sliceString(p,p+1)===">"?1:0),x=`${b}>`;return{range:tt.cursor(p+x.length,-1),changes:{from:p,to:y,insert:x}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([s,a.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),P_e=CI({commentTokens:{block:{open:""}}}),D_e=new Ln,M_e=iNt.configure({props:[qh.add(e=>!e.is("Block")||e.is("Document")||s8(e)!=null||Wjt(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),D_e.add(s8),Hh.add({Document:()=>null}),zp.add({Document:P_e})]});function s8(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function Wjt(e){return e.name=="OrderedList"||e.name=="BulletList"}function Gjt(e,t){let n=e;for(;;){let i=n.nextSibling,r;if(!i||(r=s8(i.type))!=null&&r<=t)break;n=i}return n.to}const Kjt=tAe.of((e,t,n)=>{for(let i=Or(e).resolveInner(n,-1);i&&!(i.fromn)return{from:n,to:s}}return null});function IQ(e){return new ec(P_e,e,[],"markdown")}const Xjt=IQ(M_e),Yjt=M_e.configure([pNt,gNt,mNt,bNt,{props:[qh.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),JN=IQ(Yjt);function Zjt(e,t){return n=>{if(n&&e){let i=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?i=e(n):i=UN.matchLanguageName(e,n,!0),i instanceof UN)return i.support?i.support.language.parser:Ib.getSkippingParser(i.load());if(i)return i.parser}return t?t.parser:null}}let $5=class{constructor(t,n,i,r,s,a,l){this.node=t,this.from=n,this.to=i,this.spaceBefore=r,this.spaceAfter=s,this.type=a,this.item=l}blank(t,n=!0){let i=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;i.length0;r--)i+=" ";return i+(n?this.spaceAfter:"")}}marker(t,n){let i=this.node.name=="OrderedList"?String(+$_e(this.item,t)[2]+n):"";return this.spaceBefore+i+this.type+this.spaceAfter}};function L_e(e,t){let n=[],i=[];for(let r=e;r;r=r.parent){if(r.name=="FencedCode")return i;(r.name=="ListItem"||r.name=="Blockquote")&&n.push(r)}for(let r=n.length-1;r>=0;r--){let s=n[r],a,l=t.lineAt(s.from),c=s.from-l.from;if(s.name=="Blockquote"&&(a=/^ *>( ?)/.exec(l.text.slice(c))))i.push(new $5(s,c,c+a[0].length,"",a[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(a=/^( *)\d+([.)])( *)/.exec(l.text.slice(c)))){let u=a[3],d=a[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),i.push(new $5(s.parent,c,c+d,a[1],u,a[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(c)))){let u=a[4],d=a[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let f=a[2];a[3]&&(f+=a[3].replace(/[xX]/," ")),i.push(new $5(s.parent,c,c+d,a[1],u,f,s))}}return i}function $_e(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function F5(e,t,n,i=0){for(let r=-1,s=e;;){if(s.name=="ListItem"){let l=$_e(s,t),c=+l[2];if(r>=0){if(c!=r+1)return;n.push({from:s.from+l[1].length,to:s.from+l[0].length,insert:String(r+2+i)})}r=c}let a=s.nextSibling;if(!a)break;s=a}}function PQ(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(i1)!=" ")return e;let i=Uu(e,4,n),r="";for(let s=i;s>0;)s>=4?(r+=" ",s-=4):(r+=" ",s--);return r+e.slice(n)}const Jjt=(e={})=>({state:t,dispatch:n})=>{let i=Or(t),{doc:r}=t,s=null,a=t.changeByRange(l=>{if(!l.empty||!JN.isActiveAt(t,l.from,-1)&&!JN.isActiveAt(t,l.from,1))return s={range:l};let c=l.from,u=r.lineAt(c),d=L_e(i.resolveInner(c,-1),r);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return s={range:l};let f=d[d.length-1];if(f.to-f.spaceAfter.length>c-u.from)return s={range:l};let h=c>=f.to-f.spaceAfter.length&&!/\S/.test(u.text.slice(f.to));if(f.item&&h){let y=f.node.firstChild,x=f.node.getChild("ListItem","ListItem");if(y.to>=c||x&&x.to0&&!/[^\s>]/.test(r.lineAt(u.from-1).text)||e.nonTightLists===!1){let O=d.length>1?d[d.length-2]:null,w,k="";O&&O.item?(w=u.from+O.from,k=O.marker(r,1)):w=u.from+(O?O.to:0);let S=[{from:w,to:c,insert:k}];return f.node.name=="OrderedList"&&F5(f.item,r,S,-2),O&&O.node.name=="OrderedList"&&F5(O.item,r,S),{range:tt.cursor(w+k.length),changes:S}}else{let O=Oee(d,t,u);return{range:tt.cursor(c+O.length+1),changes:{from:u.from,insert:O+t.lineBreak}}}}if(f.node.name=="Blockquote"&&h&&u.from){let y=r.lineAt(u.from-1),x=/>\s*$/.exec(y.text);if(x&&x.index==f.from){let O=t.changes([{from:y.from+x.index,to:y.to},{from:u.from+f.from,to:u.to}]);return{range:l.map(O),changes:O}}}let p=[];f.node.name=="OrderedList"&&F5(f.item,r,p);let g=f.item&&f.item.from]*/.exec(u.text)[0].length>=f.to)for(let y=0,x=d.length-1;y<=x;y++)b+=y==x&&!g?d[y].marker(r,1):d[y].blank(yu.from&&/\s/.test(u.text.charAt(v-u.from-1));)v--;return b=PQ(b,t),tRt(f.node,t.doc)&&(b=Oee(d,t,u)+t.lineBreak+b),p.push({from:v,to:c,insert:t.lineBreak+b}),{range:tt.cursor(v+b.length+1),changes:p}});return s?!1:(n(t.update(a,{scrollIntoView:!0,userEvent:"input"})),!0)},eRt=Jjt();function wee(e){return e.name=="QuoteMark"||e.name=="ListMark"}function tRt(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let n=e.firstChild,i=e.getChild("ListItem","ListItem");if(!i)return!1;let r=t.lineAt(n.to),s=t.lineAt(i.from),a=/^[\s>]*$/.test(r.text);return r.number+(a?0:1){let n=Or(e),i=null,r=e.changeByRange(s=>{let a=s.from,{doc:l}=e;if(s.empty&&JN.isActiveAt(e,s.from)){let c=l.lineAt(a),u=L_e(nRt(n,a),l);if(u.length){let d=u[u.length-1],f=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(a-c.from>f&&!/\S/.test(c.text.slice(f,a-c.from)))return{range:tt.cursor(c.from+f),changes:{from:c.from+f,to:a}};if(a-c.from==f&&(d.item&&c.from<=d.item.from||/^[\s>]*$/.test(c.text.slice(0,d.to)))){let h=c.from+d.from;if(d.item&&d.node.from{var n;let{main:i}=t.state.selection;if(i.empty)return!1;let r=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r="https://"+r),!JN.isActiveAt(t.state,i.from,1)))return!1;let s=Or(t.state),a=!1;return s.iterate({from:i.from,to:i.to,enter:l=>{(l.from>i.from||lRt.test(l.name))&&(a=!0)},leave:l=>{l.to=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}const cIt=new zs((e,t)=>{let n;if(e.next<0)e.acceptToken(hRt);else if(t.context.flags&$A)U5(e.next)&&e.acceptToken(fRt,1);else if(((n=e.peek(-1))<0||U5(n))&&t.canShift(See)){let i=0;for(;e.next==DQ||e.next==RI;)e.advance(),i++;(e.next==Mb||e.next==gk||e.next==MQ)&&e.acceptToken(See,-i)}else U5(e.next)&&e.acceptToken(dRt,1)},{contextual:!0}),uIt=new zs((e,t)=>{let n=t.context;if(n.flags)return;let i=e.peek(-1);if(i==Mb||i==gk){let r=0,s=0;for(;;){if(e.next==DQ)r++;else if(e.next==RI)r+=8-r%8;else break;e.advance(),s++}r!=n.indent&&e.next!=Mb&&e.next!=gk&&e.next!=MQ&&(r[e,t|q_e])),hIt=new _I({start:dIt,reduce(e,t,n,i){return e.flags&$A&&lIt.has(t)||(t==NRt||t==z_e)&&e.flags&q_e?e.parent:e},shift(e,t,n,i){return t==B_e?new FA(e,fIt(i.read(i.pos,n.pos)),0):t==U_e?e.parent:t==gRt||t==xRt||t==SRt||t==Q_e?new FA(e,0,$A):Tee.has(t)?new FA(e,0,Tee.get(t)|e.flags&$A):e},hash(e){return e.hash}}),pIt=new zs(e=>{for(let t=0;t<5;t++){if(e.next!="print".charCodeAt(t))return;e.advance()}if(!/\w/.test(String.fromCharCode(e.next)))for(let t=0;;t++){let n=e.peek(t);if(!(n==DQ||n==RI)){n!=tIt&&n!=nIt&&n!=Mb&&n!=gk&&n!=MQ&&e.acceptToken(uRt);return}}}),mIt=new zs((e,t)=>{let{flags:n}=t.context,i=n&Tf?H_e:V_e,r=(n&Af)>0,s=!(n&_f),a=(n&Nf)>0,l=e.pos;for(;!(e.next<0);)if(a&&e.next==a8)if(e.peek(1)==a8)e.advance(2);else{if(e.pos==l){e.acceptToken(Q_e,1);return}break}else if(s&&e.next==Cee){if(e.pos==l){e.advance();let c=e.next;c>=0&&(e.advance(),gIt(e,c)),e.acceptToken(mRt);return}break}else if(e.next==Cee&&!s&&e.peek(1)>-1)e.advance(2);else if(e.next==i&&(!r||e.peek(1)==i&&e.peek(2)==i)){if(e.pos==l){e.acceptToken(kee,r?3:1);return}break}else if(e.next==Mb){if(r)e.advance();else if(e.pos==l){e.acceptToken(kee);return}break}else e.advance();e.pos>l&&e.acceptToken(pRt)});function gIt(e,t){if(t==iIt)for(let n=0;n<2&&e.next>=48&&e.next<=55;n++)e.advance();else if(t==rIt)for(let n=0;n<2&&Q5(e.next);n++)e.advance();else if(t==aIt)for(let n=0;n<4&&Q5(e.next);n++)e.advance();else if(t==oIt)for(let n=0;n<8&&Q5(e.next);n++)e.advance();else if(t==sIt&&e.next==a8){for(e.advance();e.next>=0&&e.next!=Eee&&e.next!=V_e&&e.next!=H_e&&e.next!=Mb;)e.advance();e.next==Eee&&e.advance()}}const bIt=Vh({'async "*" "**" FormatConversion FormatSpec':ne.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":ne.controlKeyword,"in not and or is del":ne.operatorKeyword,"from def class global nonlocal lambda":ne.definitionKeyword,import:ne.moduleKeyword,"with as print":ne.keyword,Boolean:ne.bool,None:ne.null,VariableName:ne.variableName,"CallExpression/VariableName":ne.function(ne.variableName),"FunctionDefinition/VariableName":ne.function(ne.definition(ne.variableName)),"ClassDefinition/VariableName":ne.definition(ne.className),PropertyName:ne.propertyName,"CallExpression/MemberExpression/PropertyName":ne.function(ne.propertyName),Comment:ne.lineComment,Number:ne.number,String:ne.string,FormatString:ne.special(ne.string),Escape:ne.escape,UpdateOp:ne.updateOperator,"ArithOp!":ne.arithmeticOperator,BitOp:ne.bitwiseOperator,CompareOp:ne.compareOperator,AssignOp:ne.definitionOperator,Ellipsis:ne.punctuation,At:ne.meta,"( )":ne.paren,"[ ]":ne.squareBracket,"{ }":ne.brace,".":ne.derefOperator,", ;":ne.separator}),yIt={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},vIt=Rh.deserialize({version:14,states:"##jQ`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5TQdO'#DoOOQS,5:Y,5:YO5hQdO'#HdOOQS,5:],5:]O5uQ!fO,5:]O5zQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8jQdO,59bO8oQdO,59bO8vQdO,59jO8}QdO'#HTO:TQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:lQdO,59aO'vQdO,59aO:zQdO,59aOOQS,59y,59yO;PQdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;_QdO,5:QO;dQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;uQdO,5:UO;zQdO,5:WOOOW'#Fy'#FyOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/[QtO1G.|O!/cQtO1G.|O1lQdO1G.|O!0OQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!0VQdO1G/eO!0gQdO1G/eO!0oQdO1G/fO'vQdO'#H[O!0tQdO'#H[O!0yQtO1G.{O!1ZQdO,59iO!2aQdO,5=zO!2qQdO,5=zO!2yQdO1G/mO!3OQtO1G/mOOQS1G/l1G/lO!3`QdO,5=uO!4VQdO,5=uO0rQdO1G/qO!4tQdO1G/sO!4yQtO1G/sO!5ZQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5kQdO'#HxO0rQdO'#HxO!5|QdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6[Q#xO1G2zO!6{QtO1G2zO'vQdO,5kOOQS1G1`1G1`O!8RQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!8WQdO'#FrO!8cQdO,59oO!8kQdO1G/XO!8uQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9fQdO'#GtOOQS,5jO!;ZQdO,5>jO1XQdO,5>jO!;lQdO,5>iOOQS-E:R-E:RO!;qQdO1G0lO!;|QdO1G0lO!lO!lO!hO!=VQdO,5>hO!=hQdO'#EpO0rQdO1G0tO!=sQdO1G0tO!=xQgO1G0zO!AvQgO1G0}O!EqQdO,5>oO!E{QdO,5>oO!FTQtO,5>oO0rQdO1G1PO!F_QdO1G1PO4iQdO1G1UO!!vQdO1G1WOOQV,5;a,5;aO!FdQfO,5;aO!FiQgO1G1QO!JjQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JzQdO,5>pO!KXQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KaQdO'#FSO!KrQ!fO1G1WO!KzQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!LPQdO1G1]O!LXQdO'#F^OOQV1G1b1G1bO!#ZQtO1G1bPOOO1G2v1G2vP!L^OSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LfQdO,5=|O!LyQdO,5=|OOQS1G/u1G/uO!MRQdO,5>PO!McQdO,5>PO!MkQdO,5>PO!NOQdO,5>PO!N`QdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8kQdO7+$pO#!RQdO1G.|O#!YQdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!aQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!qQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!vQdO7+%PO##OQdO7+%QO##TQdO1G3fOOQS7+%X7+%XO##eQdO1G3fO##mQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##rQdO1G3aOOQS-E9q-E9qO#$iQdO7+%]OOQS7+%_7+%_O#$wQdO1G3aO#%fQdO7+%_O#%kQdO1G3gO#%{QdO1G3gO#&TQdO7+%]O#&YQdO,5>dO#&sQdO,5>dO#&sQdO,5>dOOQS'#Dx'#DxO#'UO&jO'#DzO#'aO`O'#HyOOOW1G3}1G3}O#'fQdO1G3}O#'nQdO1G3}O#'yQ#xO7+(fO#(jQtO1G2UP#)TQdO'#GOOOQS,5nQdO,5sQdO1G4OOOQS-E9y-E9yO#?^QdO1G4OO<[QdO'#H{OOOO'#D{'#D{OOOO'#F|'#F|O#?oO&jO,5:fOOOW,5>e,5>eOOOW7+)i7+)iO#?zQdO7+)iO#@SQdO1G2zO#@mQdO1G2zP'vQdO'#FuO0rQdO<mO#BQQdO,5>mOOQS1G0v1G0vOOQS<rO#KgQdO,5>rO#KrQdO,5>rO#K}QdO,5>qO#L`QdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ oQdO<cAN>cO0rQdO1G1|O$!PQtO1G1|P$!ZQdO'#FvOOQS1G2R1G2RP$!hQdO'#F{O$!uQdO7+)jO$#`QdO,5>gOOOO-E9z-E9zOOOW<tO$4{QdO,5>tO1XQdO,5vO$)nQdO,5>vOOQS1G1p1G1pOOQS,5<[,5<[OOQU7+'P7+'PO$+zQdO1G/iO$)nQdO,5wO$8zQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)nQdO'#GdO$9SQdO1G4bO$9^QdO1G4bO$9fQdO1G4bOOQS7+%T7+%TO$9tQdO1G1tO$:SQtO'#FaO$:ZQdO,5<}OOQS,5<},5<}O$:iQdO1G4cOOQS-E:a-E:aO$)nQdO,5<|O$:pQdO,5<|O$:uQdO7+)|OOQS-E:`-E:`O$;PQdO7+)|O$)nQdO,5S~O%cOS%^OSSOS%]PQ~OPdOVaOfoOhYOopOs!POvqO!PrO!Q{O!T!SO!U!RO!XZO!][O!h`O!r`O!s`O!t`O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#l!QO#o!TO#s!UO#u!VO#z!WO#}hO$P!XO%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~O%]!YO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%j![O%k!]O%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aO~Ok%xXl%xXm%xXn%xXo%xXp%xXs%xXz%xX{%xX!x%xX#g%xX%[%xX%_%xX%z%xXg%xX!T%xX!U%xX%{%xX!W%xX![%xX!Q%xX#[%xXt%xX!m%xX~P%SOfoOhYO!XZO!][O!h`O!r`O!s`O!t`O%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~Oz%wX{%wX#g%wX%[%wX%_%wX%z%wX~Ok!pOl!qOm!oOn!oOo!rOp!sOs!tO!x%wX~P)pOV!zOg!|Oo0cOv0qO!PrO~P'vOV#OOo0cOv0qO!W#PO~P'vOV#SOa#TOo0cOv0qO![#UO~P'vOQ#XO%`#XO%a#ZO~OQ#^OR#[O%`#^O%a#`O~OV%iX_%iXa%iXh%iXk%iXl%iXm%iXn%iXo%iXp%iXs%iXz%iX!X%iX!f%iX%j%iX%k%iX%l%iX%m%iX%n%iX%o%iX%p%iX%q%iX%r%iX%s%iXg%iX!T%iX!U%iX~O&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O{%iX!x%iX#g%iX%[%iX%_%iX%z%iX%{%iX!W%iX![%iX!Q%iX#[%iXt%iX!m%iX~P,eOz#dO{%hX!x%hX#g%hX%[%hX%_%hX%z%hX~Oo0cOv0qO~P'vO#g#gO%[#iO%_#iO~O%uWO~O!T#nO#u!VO#z!WO#}hO~OopO~P'vOV#sOa#tO%uWO{wP~OV#xOo0cOv0qO!Q#yO~P'vO{#{O!x$QO%z#|O#g!yX%[!yX%_!yX~OV#xOo0cOv0qO#g#SX%[#SX%_#SX~P'vOo0cOv0qO#g#WX%[#WX%_#WX~P'vOh$WO%uWO~O!f$YO!r$YO%uWO~OV$eO~P'vO!U$gO#s$hO#u$iO~O{$jO~OV$qO~P'vOS$sO%[$rO%_$rO%c$tO~OV$}Oa$}Og%POo0cOv0qO~P'vOo0cOv0qO{%SO~P'vO&Y%UO~Oa!bOh!iO!X!kO!f!mOVba_bakbalbambanbaobapbasbazba{ba!xba#gba%[ba%_ba%jba%kba%lba%mba%nba%oba%pba%qba%rba%sba%zbagba!Tba!Uba%{ba!Wba![ba!Qba#[batba!mba~On%ZO~Oo%ZO~P'vOo0cO~P'vOk0eOl0fOm0dOn0dOo0mOp0nOs0rOg%wX!T%wX!U%wX%{%wX!W%wX![%wX!Q%wX#[%wX!m%wX~P)pO%{%]Og%vXz%vX!T%vX!U%vX!W%vX{%vX~Og%_Oz%`O!T%dO!U%cO~Og%_O~Oz%gO!T%dO!U%cO!W&SX~O!W%kO~Oz%lO{%nO!T%dO!U%cO![%}X~O![%rO~O![%sO~OQ#XO%`#XO%a%uO~OV%wOo0cOv0qO!PrO~P'vOQ#^OR#[O%`#^O%a%zO~OV!qa_!qaa!qah!qak!qal!qam!qan!qao!qap!qas!qaz!qa{!qa!X!qa!f!qa!x!qa#g!qa%[!qa%_!qa%j!qa%k!qa%l!qa%m!qa%n!qa%o!qa%p!qa%q!qa%r!qa%s!qa%z!qag!qa!T!qa!U!qa%{!qa!W!qa![!qa!Q!qa#[!qat!qa!m!qa~P#yOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P%SOV&OOopOvqO{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P'vOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#g$zX%[$zX%_$zX~P'vO#g#gO%[&TO%_&TO~O!f&UOh&sX%[&sXz&sX#[&sX#g&sX%_&sX#Z&sXg&sX~Oh!iO%[&WO~Okealeameaneaoeapeaseazea{ea!xea#gea%[ea%_ea%zeagea!Tea!Uea%{ea!Wea![ea!Qea#[eatea!mea~P%SOsqazqa{qa#gqa%[qa%_qa%zqa~Ok!pOl!qOm!oOn!oOo!rOp!sO!xqa~PEcO%z&YOz%yX{%yX~O%uWOz%yX{%yX~Oz&]O{wX~O{&_O~Oz%lO#g%}X%[%}X%_%}Xg%}X{%}X![%}X!m%}X%z%}X~OV0lOo0cOv0qO!PrO~P'vO%z#|O#gUa%[Ua%_Ua~Oz&hO#g&PX%[&PX%_&PXn&PX~P%SOz&kO!Q&jO#g#Wa%[#Wa%_#Wa~Oz&lO#[&nO#g&rX%[&rX%_&rXg&rX~O!f$YO!r$YO#Z&qO%uWO~O#Z&qO~Oz&sO#g&tX%[&tX%_&tX~Oz&uO#g&pX%[&pX%_&pX{&pX~O!X&wO%z&xO~Oz&|On&wX~P%SOn'PO~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO%['UO~P'vOt'YO#p'WO#q'XOP#naV#naf#nah#nao#nas#nav#na!P#na!Q#na!T#na!U#na!X#na!]#na!h#na!r#na!s#na!t#na!{#na!}#na#P#na#R#na#T#na#X#na#Z#na#^#na#_#na#a#na#c#na#l#na#o#na#s#na#u#na#z#na#}#na$P#na%X#na%o#na%p#na%t#na%u#na&Z#na&[#na&]#na&^#na&_#na&`#na&a#na&b#na&c#na&d#na&e#na&f#na&g#na&h#na&i#na&j#na%Z#na%_#na~Oz'ZO#[']O{&xX~Oh'_O!X&wO~Oh!iO{$jO!X&wO~O{'eO~P%SO%['hO%_'hO~OS'iO%['hO%_'hO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%k!]O~P!#uO%kWi~P!#uOV!aO_!aOa!bOh!iO!X!kO!f!mO%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%m!_O%n!_O~P!&pO%mWi%nWi~P!&pOa!bOh!iO!X!kO!f!mOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%mWi%nWi%oWi%pWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~OV!aO_!aO%q!aO%r!aO%s!aO~P!)nOVWi_Wi%qWi%rWi%sWi~P!)nO!T%dO!U%cOg&VXz&VX~O%z'kO%{'kO~P,eOz'mOg&UX~Og'oO~Oz'pO{'rO!W&XX~Oo0cOv0qOz'pO{'sO!W&XX~P'vO!W'uO~Om!oOn!oOo!rOp!sOkjisjizji{ji!xji#gji%[ji%_ji%zji~Ol!qO~P!.aOlji~P!.aOk0eOl0fOm0dOn0dOo0mOp0nO~Ot'wO~P!/jOV'|Og'}Oo0cOv0qO~P'vOg'}Oz(OO~Og(QO~O!U(SO~Og(TOz(OO!T%dO!U%cO~P%SOk0eOl0fOm0dOn0dOo0mOp0nOgqa!Tqa!Uqa%{qa!Wqa![qa!Qqa#[qatqa!mqa~PEcOV'|Oo0cOv0qO!W&Sa~P'vOz(WO!W&Sa~O!W(XO~Oz(WO!T%dO!U%cO!W&Sa~P%SOV(]Oo0cOv0qO![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~P'vOz(^O![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~O![(aO~Oz(^O!T%dO!U%cO![%}a~P%SOz(dO!T%dO!U%cO![&Ta~P%SOz(gO{&lX![&lX!m&lX%z&lX~O{(kO![(mO!m(nO%z(jO~OV&OOopOvqO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~P'vOz(pO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~O!f&UOh&sa%[&saz&sa#[&sa#g&sa%_&sa#Z&sag&sa~O%[(uO~OV#sOa#tO%uWO~Oz&]O{wa~OopOvqO~P'vOz(^O#g%}a%[%}a%_%}ag%}a{%}a![%}a!m%}a%z%}a~P%SOz(zO#g%hX%[%hX%_%hX%z%hX~O%z#|O#gUi%[Ui%_Ui~O#g&Pa%[&Pa%_&Pan&Pa~P'vOz(}O#g&Pa%[&Pa%_&Pan&Pa~O%uWO#g&ra%[&ra%_&rag&ra~Oz)SO#g&ra%[&ra%_&rag&ra~Og)VO~OV)WOh$WO%uWO~O#Z)XO~O%uWO#g&ta%[&ta%_&ta~Oz)ZO#g&ta%[&ta%_&ta~Oo0cOv0qO#g&pa%[&pa%_&pa{&pa~P'vOz)^O#g&pa%[&pa%_&pa{&pa~OV)`Oa)`O%uWO~O%z)eO~Ot)hO#j)gOP#hiV#hif#hih#hio#his#hiv#hi!P#hi!Q#hi!T#hi!U#hi!X#hi!]#hi!h#hi!r#hi!s#hi!t#hi!{#hi!}#hi#P#hi#R#hi#T#hi#X#hi#Z#hi#^#hi#_#hi#a#hi#c#hi#l#hi#o#hi#s#hi#u#hi#z#hi#}#hi$P#hi%X#hi%o#hi%p#hi%t#hi%u#hi&Z#hi&[#hi&]#hi&^#hi&_#hi&`#hi&a#hi&b#hi&c#hi&d#hi&e#hi&f#hi&g#hi&h#hi&i#hi&j#hi%Z#hi%_#hi~Ot)iOP#kiV#kif#kih#kio#kis#kiv#ki!P#ki!Q#ki!T#ki!U#ki!X#ki!]#ki!h#ki!r#ki!s#ki!t#ki!{#ki!}#ki#P#ki#R#ki#T#ki#X#ki#Z#ki#^#ki#_#ki#a#ki#c#ki#l#ki#o#ki#s#ki#u#ki#z#ki#}#ki$P#ki%X#ki%o#ki%p#ki%t#ki%u#ki&Z#ki&[#ki&]#ki&^#ki&_#ki&`#ki&a#ki&b#ki&c#ki&d#ki&e#ki&f#ki&g#ki&h#ki&i#ki&j#ki%Z#ki%_#ki~OV)kOn&wa~P'vOz)lOn&wa~Oz)lOn&wa~P%SOn)pO~O%Y)tO~Ot)wO#p'WO#q)vOP#niV#nif#nih#nio#nis#niv#ni!P#ni!Q#ni!T#ni!U#ni!X#ni!]#ni!h#ni!r#ni!s#ni!t#ni!{#ni!}#ni#P#ni#R#ni#T#ni#X#ni#Z#ni#^#ni#_#ni#a#ni#c#ni#l#ni#o#ni#s#ni#u#ni#z#ni#}#ni$P#ni%X#ni%o#ni%p#ni%t#ni%u#ni&Z#ni&[#ni&]#ni&^#ni&_#ni&`#ni&a#ni&b#ni&c#ni&d#ni&e#ni&f#ni&g#ni&h#ni&i#ni&j#ni%Z#ni%_#ni~OV)zOo0cOv0qO{$jO~P'vOo0cOv0qO{&xa~P'vOz*OO{&xa~OV*SOa*TOg*WO%q*UO%uWO~O{$jO&{*YO~Oh'_O~Oh!iO{$jO~O%[*_O~O%[*aO%_*aO~OV$}Oa$}Oo0cOv0qOg&Ua~P'vOz*dOg&Ua~Oo0cOv0qO{*gO!W&Xa~P'vOz*hO!W&Xa~Oo0cOv0qOz*hO{*kO!W&Xa~P'vOo0cOv0qOz*hO!W&Xa~P'vOz*hO{*kO!W&Xa~Om0dOn0dOo0mOp0nOgjikjisjizji!Tji!Uji%{ji!Wji{ji![ji#gji%[ji%_ji!Qji#[jitji!mji%zji~Ol0fO~P!NkOlji~P!NkOV'|Og*pOo0cOv0qO~P'vOn*rO~Og*pOz*tO~Og*uO~OV'|Oo0cOv0qO!W&Si~P'vOz*vO!W&Si~O!W*wO~OV(]Oo0cOv0qO![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~P'vOz*zO!T%dO!U%cO![&Ti~Oz*}O![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~O![+OO~Oa+QOo0cOv0qO![&Ti~P'vOz*zO![&Ti~O![+SO~OV+UOo0cOv0qO{&la![&la!m&la%z&la~P'vOz+VO{&la![&la!m&la%z&la~O!]+YO&n+[O![!nX~O![+^O~O{(kO![+_O~O{(kO![+_O!m+`O~OV&OOopOvqO{%hq!x%hq#g%hq%[%hq%_%hq%z%hq~P'vOz$ri{$ri!x$ri#g$ri%[$ri%_$ri%z$ri~P%SOV&OOopOvqO~P'vOV&OOo0cOv0qO#g%ha%[%ha%_%ha%z%ha~P'vOz+aO#g%ha%[%ha%_%ha%z%ha~Oz$ia#g$ia%[$ia%_$ian$ia~P%SO#g&Pi%[&Pi%_&Pin&Pi~P'vOz+dO#g#Wq%[#Wq%_#Wq~O#[+eOz$va#g$va%[$va%_$vag$va~O%uWO#g&ri%[&ri%_&rig&ri~Oz+gO#g&ri%[&ri%_&rig&ri~OV+iOh$WO%uWO~O%uWO#g&ti%[&ti%_&ti~Oo0cOv0qO#g&pi%[&pi%_&pi{&pi~P'vO{#{Oz#eX!W#eX~Oz+mO!W&uX~O!W+oO~Ot+rO#j)gOP#hqV#hqf#hqh#hqo#hqs#hqv#hq!P#hq!Q#hq!T#hq!U#hq!X#hq!]#hq!h#hq!r#hq!s#hq!t#hq!{#hq!}#hq#P#hq#R#hq#T#hq#X#hq#Z#hq#^#hq#_#hq#a#hq#c#hq#l#hq#o#hq#s#hq#u#hq#z#hq#}#hq$P#hq%X#hq%o#hq%p#hq%t#hq%u#hq&Z#hq&[#hq&]#hq&^#hq&_#hq&`#hq&a#hq&b#hq&c#hq&d#hq&e#hq&f#hq&g#hq&h#hq&i#hq&j#hq%Z#hq%_#hq~On$|az$|a~P%SOV)kOn&wi~P'vOz+yOn&wi~Oz,TO{$jO#[,TO~O#q,VOP#nqV#nqf#nqh#nqo#nqs#nqv#nq!P#nq!Q#nq!T#nq!U#nq!X#nq!]#nq!h#nq!r#nq!s#nq!t#nq!{#nq!}#nq#P#nq#R#nq#T#nq#X#nq#Z#nq#^#nq#_#nq#a#nq#c#nq#l#nq#o#nq#s#nq#u#nq#z#nq#}#nq$P#nq%X#nq%o#nq%p#nq%t#nq%u#nq&Z#nq&[#nq&]#nq&^#nq&_#nq&`#nq&a#nq&b#nq&c#nq&d#nq&e#nq&f#nq&g#nq&h#nq&i#nq&j#nq%Z#nq%_#nq~O#[,WOz%Oa{%Oa~Oo0cOv0qO{&xi~P'vOz,YO{&xi~O{#{O%z,[Og&zXz&zX~O%uWOg&zXz&zX~Oz,`Og&yX~Og,bO~O%Y,eO~O!T%dO!U%cOg&Viz&Vi~OV$}Oa$}Oo0cOv0qOg&Ui~P'vO{,hOz$la!W$la~Oo0cOv0qO{,iOz$la!W$la~P'vOo0cOv0qO{*gO!W&Xi~P'vOz,lO!W&Xi~Oo0cOv0qOz,lO!W&Xi~P'vOz,lO{,oO!W&Xi~Og$hiz$hi!W$hi~P%SOV'|Oo0cOv0qO~P'vOn,qO~OV'|Og,rOo0cOv0qO~P'vOV'|Oo0cOv0qO!W&Sq~P'vOz$gi![$gi#g$gi%[$gi%_$gig$gi{$gi!m$gi%z$gi~P%SOV(]Oo0cOv0qO~P'vOa+QOo0cOv0qO![&Tq~P'vOz,sO![&Tq~O![,tO~OV(]Oo0cOv0qO![%}q#g%}q%[%}q%_%}qg%}q{%}q!m%}q%z%}q~P'vO{,uO~OV+UOo0cOv0qO{&li![&li!m&li%z&li~P'vOz,zO{&li![&li!m&li%z&li~O!]+YO&n+[O![!na~O{(kO![,}O~OV&OOo0cOv0qO#g%hi%[%hi%_%hi%z%hi~P'vOz-OO#g%hi%[%hi%_%hi%z%hi~O%uWO#g&rq%[&rq%_&rqg&rq~Oz-RO#g&rq%[&rq%_&rqg&rq~OV)`Oa)`O%uWO!W&ua~Oz-TO!W&ua~On$|iz$|i~P%SOV)kO~P'vOV)kOn&wq~P'vOt-XOP#myV#myf#myh#myo#mys#myv#my!P#my!Q#my!T#my!U#my!X#my!]#my!h#my!r#my!s#my!t#my!{#my!}#my#P#my#R#my#T#my#X#my#Z#my#^#my#_#my#a#my#c#my#l#my#o#my#s#my#u#my#z#my#}#my$P#my%X#my%o#my%p#my%t#my%u#my&Z#my&[#my&]#my&^#my&_#my&`#my&a#my&b#my&c#my&d#my&e#my&f#my&g#my&h#my&i#my&j#my%Z#my%_#my~O%Z-]O%_-]O~P`O#q-^OP#nyV#nyf#nyh#nyo#nys#nyv#ny!P#ny!Q#ny!T#ny!U#ny!X#ny!]#ny!h#ny!r#ny!s#ny!t#ny!{#ny!}#ny#P#ny#R#ny#T#ny#X#ny#Z#ny#^#ny#_#ny#a#ny#c#ny#l#ny#o#ny#s#ny#u#ny#z#ny#}#ny$P#ny%X#ny%o#ny%p#ny%t#ny%u#ny&Z#ny&[#ny&]#ny&^#ny&_#ny&`#ny&a#ny&b#ny&c#ny&d#ny&e#ny&f#ny&g#ny&h#ny&i#ny&j#ny%Z#ny%_#ny~Oz-aO{$jO#[-aO~Oo0cOv0qO{&xq~P'vOz-dO{&xq~O%z,[Og&zaz&za~O{#{Og&zaz&za~OV*SOa*TO%q*UO%uWOg&ya~Oz-hOg&ya~O$S-lO~OV$}Oa$}Oo0cOv0qO~P'vOo0cOv0qO{-mOz$li!W$li~P'vOo0cOv0qOz$li!W$li~P'vO{-mOz$li!W$li~Oo0cOv0qO{*gO~P'vOo0cOv0qO{*gO!W&Xq~P'vOz-pO!W&Xq~Oo0cOv0qOz-pO!W&Xq~P'vOs-sO!T%dO!U%cOg&Oq!W&Oq![&Oqz&Oq~P!/jOa+QOo0cOv0qO![&Ty~P'vOz$ji![$ji~P%SOa+QOo0cOv0qO~P'vOV+UOo0cOv0qO~P'vOV+UOo0cOv0qO{&lq![&lq!m&lq%z&lq~P'vO{(kO![-xO!m-yO%z-wO~OV&OOo0cOv0qO#g%hq%[%hq%_%hq%z%hq~P'vO%uWO#g&ry%[&ry%_&ryg&ry~OV)`Oa)`O%uWO!W&ui~Ot-}OP#m!RV#m!Rf#m!Rh#m!Ro#m!Rs#m!Rv#m!R!P#m!R!Q#m!R!T#m!R!U#m!R!X#m!R!]#m!R!h#m!R!r#m!R!s#m!R!t#m!R!{#m!R!}#m!R#P#m!R#R#m!R#T#m!R#X#m!R#Z#m!R#^#m!R#_#m!R#a#m!R#c#m!R#l#m!R#o#m!R#s#m!R#u#m!R#z#m!R#}#m!R$P#m!R%X#m!R%o#m!R%p#m!R%t#m!R%u#m!R&Z#m!R&[#m!R&]#m!R&^#m!R&_#m!R&`#m!R&a#m!R&b#m!R&c#m!R&d#m!R&e#m!R&f#m!R&g#m!R&h#m!R&i#m!R&j#m!R%Z#m!R%_#m!R~Oo0cOv0qO{&xy~P'vOV*SOa*TO%q*UO%uWOg&yi~O$S-lO%Z.VO%_.VO~OV.aOh._O!X.^O!].`O!h.YO!s.[O!t.[O%p.XO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O~Oo0cOv0qOz$lq!W$lq~P'vO{.fOz$lq!W$lq~Oo0cOv0qO{*gO!W&Xy~P'vOz.gO!W&Xy~Oo0cOv.kO~P'vOs-sO!T%dO!U%cOg&Oy!W&Oy![&Oyz&Oy~P!/jO{(kO![.nO~O{(kO![.nO!m.oO~OV*SOa*TO%q*UO%uWO~Oh.tO!f.rOz$TX#[$TX%j$TXg$TX~Os$TX{$TX!W$TX![$TX~P$-bO%o.vO%p.vOs$UXz$UX{$UX#[$UX%j$UX!W$UXg$UX![$UX~O!h.xO~Oz.|O#[/OO%j.yOs&|X{&|X!W&|Xg&|X~Oa/RO~P$)zOh.tOs&}Xz&}X{&}X#[&}X%j&}X!W&}Xg&}X![&}X~Os/VO{$jO~Oo0cOv0qOz$ly!W$ly~P'vOo0cOv0qO{*gO!W&X!R~P'vOz/ZO!W&X!R~Og&RXs&RX!T&RX!U&RX!W&RX![&RXz&RX~P!/jOs-sO!T%dO!U%cOg&Qa!W&Qa![&Qaz&Qa~O{(kO![/^O~O!f.rOh$[as$[az$[a{$[a#[$[a%j$[a!W$[ag$[a![$[a~O!h/eO~O%o.vO%p.vOs$Uaz$Ua{$Ua#[$Ua%j$Ua!W$Uag$Ua![$Ua~O%j.yOs$Yaz$Ya{$Ya#[$Ya!W$Yag$Ya![$Ya~Os&|a{&|a!W&|ag&|a~P$)nOz/jOs&|a{&|a!W&|ag&|a~O!W/mO~Og/mO~O{/oO~O![/pO~Oo0cOv0qO{*gO!W&X!Z~P'vO{/sO~O%z/tO~P$-bOz/uO#[/OO%j.yOg'PX~Oz/uOg'PX~Og/wO~O!h/xO~O#[/OOs%Saz%Sa{%Sa%j%Sa!W%Sag%Sa![%Sa~O#[/OO%j.yOs%Waz%Wa{%Wa!W%Wag%Wa~Os&|i{&|i!W&|ig&|i~P$)nOz/zO#[/OO%j.yO!['Oa~Og'Pa~P$)nOz0SOg'Pa~Oa0UO!['Oi~P$)zOz0WO!['Oi~Oz0WO#[/OO%j.yO!['Oi~O#[/OO%j.yOg$biz$bi~O%z0ZO~P$-bO#[/OO%j.yOg%Vaz%Va~Og'Pi~P$)nO{0^O~Oa0UO!['Oq~P$)zOz0`O!['Oq~O#[/OO%j.yOz%Ui![%Ui~Oa0UO~P$)zOa0UO!['Oy~P$)zO#[/OO%j.yOg$ciz$ci~O#[/OO%j.yOz%Uq![%Uq~Oz+aO#g%ha%[%ha%_%ha%z%ha~P%SOV&OOo0cOv0qO~P'vOn0hO~Oo0hO~P'vO{0iO~Ot0jO~P!/jO&]&Z&j&h&i&g&f&d&e&c&b&`&a&_&^&[%u~",goto:"!=j'QPPPPPP'RP'Z*s+[+t,_,y-fP.SP'Z.r.r'ZPPP'Z2[PPPPPP2[5PPP5PP7b7k=sPP=v>h>kPP'Z'ZPP>zPP'Z'ZPP'Z'Z'Z'Z'Z?O?w'ZP?zP@QDXGuGyPG|HWH['ZPPPH_Hk'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHqH}IVPI^IdPI^PI^I^PPPI^PKrPK{LVL]KrPI^LfPI^PLmLsPLwM]MzNeLwLwNkNxLwLwLwLw! ^! d! g! l! o! y!!P!!]!!o!!u!#P!#V!#s!#y!$P!$Z!$a!$g!$y!%T!%Z!%a!%k!%q!%w!%}!&T!&Z!&e!&k!&u!&{!'U!'[!'k!'s!'}!(UPPPPPPPPPPP!([!(_!(e!(n!(x!)TPPPPPPPPPPPP!-u!/Z!3^!6oPP!6w!7W!7a!8Y!8P!8c!8i!8l!8o!8r!8z!9jPPPPPPPPPPPPPPPPP!9m!9q!9wP!:]!:a!:m!:v!;S!;j!;m!;p!;v!;|!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[pIt,uIt,cIt,mIt,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:e=>yIt[e]||-1}],tokenPrec:7668}),Aee=new QU,W_e=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function f2(e){return(t,n,i)=>{if(i)return!1;let r=t.node.getChild("VariableName");return r&&n(r,e),!0}}const xIt={FunctionDefinition:f2("function"),ClassDefinition:f2("class"),ForStatement(e,t,n){if(n){for(let i=e.node.firstChild;i;i=i.nextSibling)if(i.name=="VariableName")t(i,"variable");else if(i.name=="in")break}},ImportStatement(e,t){var n,i;let{node:r}=e,s=((n=r.firstChild)===null||n===void 0?void 0:n.name)=="from";for(let a=r.getChild("import");a;a=a.nextSibling)a.name=="VariableName"&&((i=a.nextSibling)===null||i===void 0?void 0:i.name)!="as"&&t(a,s?"variable":"namespace")},AssignStatement(e,t){for(let n=e.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")t(n,"variable");else if(n.name==":"||n.name=="AssignOp")break},ParamList(e,t){for(let n=null,i=e.node.firstChild;i;i=i.nextSibling)i.name=="VariableName"&&(!n||!/\*|AssignOp/.test(n.name))&&t(i,"variable"),n=i},CapturePattern:f2("variable"),AsPattern:f2("variable"),__proto__:null};function G_e(e,t){let n=Aee.get(t);if(n)return n;let i=[],r=!0;function s(a,l){let c=e.sliceString(a.from,a.to);i.push({label:c,type:l})}return t.cursor(er.IncludeAnonymous).iterate(a=>{if(a.name){let l=xIt[a.name];if(l&&l(a,s,r)||!r&&W_e.has(a.name))return!1;r=!1}else if(a.to-a.from>8192){for(let l of G_e(e,a.node))i.push(l);return!1}}),Aee.set(t,i),i}const _ee=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,K_e=["String","FormatString","Comment","PropertyName"];function wIt(e){let t=Or(e.state).resolveInner(e.pos,-1);if(K_e.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&_ee.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let i=[];for(let r=t;r;r=r.parent)W_e.has(r.name)&&(i=i.concat(G_e(e.state.doc,r)));return{options:i,from:n?t.from:e.pos,validFor:_ee}}const OIt=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(e=>({label:e,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(e=>({label:e,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(e=>({label:e,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(e=>({label:e,type:"function"}))),SIt=[ys("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),ys("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),ys("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),ys("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),ys(`if \${}: -`,{label:"if",detail:"block",type:"keyword"}),ys("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),ys("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),ys("import ${module}",{label:"import",detail:"statement",type:"keyword"}),ys("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],kIt=SAe(K_e,mQ(OIt.concat(SIt)));function z5(e){let{node:t,pos:n}=e,i=e.lineIndent(n,-1),r=null;for(;;){let s=t.childBefore(n);if(s)if(s.name=="Comment")n=s.from;else if(s.name=="Body"||s.name=="MatchBody")e.baseIndentFor(s)+e.unit<=i&&(r=s),t=s;else if(s.name=="MatchClause")t=s;else if(s.type.is("Statement"))t=s;else break;else break}return r}function V5(e,t){let n=e.baseIndentFor(t),i=e.lineAt(e.pos,-1),r=i.from+i.text.length;return/^\s*($|#)/.test(i.text)&&e.node.ton?null:n+e.unit}const H5=jh.define({name:"python",parser:vIt.configure({props:[Hh.add({Body:e=>{var t;let n=/^\s*(#|$)/.test(e.textAfter)&&z5(e)||e.node;return(t=V5(e,n))!==null&&t!==void 0?t:e.continue()},MatchBody:e=>{var t;let n=z5(e);return(t=V5(e,n||e.node))!==null&&t!==void 0?t:e.continue()},IfStatement:e=>/^\s*(else:|elif )/.test(e.textAfter)?e.baseIndent:e.continue(),"ForStatement WhileStatement":e=>/^\s*else:/.test(e.textAfter)?e.baseIndent:e.continue(),TryStatement:e=>/^\s*(except[ :]|finally:|else:)/.test(e.textAfter)?e.baseIndent:e.continue(),MatchStatement:e=>/^\s*case /.test(e.textAfter)?e.baseIndent+e.unit:e.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":hv({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":hv({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":hv({closing:"]"}),MemberExpression:e=>e.baseIndent+e.unit,"String FormatString":()=>null,Script:e=>{var t;let n=z5(e);return(t=n&&V5(e,n))!==null&&t!==void 0?t:e.continue()}}),qh.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":LE,Body:(e,t)=>({from:e.from+1,to:e.to-(e.to==t.doc.length?0:1)}),"String FormatString":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function EIt(){return new Nm(H5,[H5.data.of({autocomplete:wIt}),H5.data.of({autocomplete:kIt})])}const ay=63,Nee=64,CIt=1,TIt=2,X_e=3,AIt=4,Y_e=5,_It=6,NIt=7,Z_e=65,jIt=66,RIt=8,IIt=9,PIt=10,DIt=11,MIt=12,J_e=13,LIt=19,$It=20,FIt=29,BIt=33,UIt=34,QIt=47,zIt=0,LQ=1,o8=2,bk=3,l8=4;class Ng{constructor(t,n,i){this.parent=t,this.depth=n,this.type=i,this.hash=(t?t.hash+t.hash<<8:0)+n+(n<<4)+i}}Ng.top=new Ng(null,-1,zIt);function qO(e,t){for(let n=0,i=t-e.pos-1;;i--,n++){let r=e.peek(i);if(Ih(r)||r==-1)return n}}function c8(e){return e==32||e==9}function Ih(e){return e==10||e==13}function eNe(e){return c8(e)||Ih(e)}function Vg(e){return e<0||eNe(e)}const VIt=new _I({start:Ng.top,reduce(e,t){return e.type==bk&&(t==$It||t==UIt)?e.parent:e},shift(e,t,n,i){if(t==X_e)return new Ng(e,qO(i,i.pos),LQ);if(t==Z_e||t==Y_e)return new Ng(e,qO(i,i.pos),o8);if(t==ay)return e.parent;if(t==LIt||t==BIt)return new Ng(e,0,bk);if(t==J_e&&e.type==l8)return e.parent;if(t==QIt){let r=/[1-9]/.exec(i.read(i.pos,n.pos));if(r)return new Ng(e,e.depth+ +r[0],l8)}return e},hash(e){return e.hash}});function fx(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&Vg(e.peek(n+3))}const HIt=new zs((e,t)=>{if(e.next==-1&&t.canShift(Nee))return e.acceptToken(Nee);let n=e.peek(-1);if((Ih(n)||n<0)&&t.context.type!=bk){if(fx(e,45))if(t.canShift(ay))e.acceptToken(ay);else return e.acceptToken(CIt,3);if(fx(e,46))if(t.canShift(ay))e.acceptToken(ay);else return e.acceptToken(TIt,3);let i=0;for(;e.next==32;)i++,e.advance();(i{if(t.context.type==bk){e.next==63&&(e.advance(),Vg(e.next)&&e.acceptToken(NIt));return}if(e.next==45)e.advance(),Vg(e.next)&&e.acceptToken(t.context.type==LQ&&t.context.depth==qO(e,e.pos-1)?AIt:X_e);else if(e.next==63)e.advance(),Vg(e.next)&&e.acceptToken(t.context.type==o8&&t.context.depth==qO(e,e.pos-1)?_It:Y_e);else{let n=e.pos;for(;;)if(c8(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)tNe(e);else if(e.next==38)u8(e);else if(e.next==42){u8(e);break}else if(e.next==39||e.next==34){if($Q(e,!0))break;return}else if(e.next==91||e.next==123){if(!GIt(e))return;break}else{nNe(e,!0,!1,0);break}for(;c8(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(FIt))return;let i=e.peek(1);Vg(i)&&e.acceptTokenTo(t.context.type==o8&&t.context.depth==qO(e,n)?jIt:Z_e,n)}}},{contextual:!0});function WIt(e){return e>32&&e<127&&e!=34&&e!=37&&e!=44&&e!=60&&e!=62&&e!=92&&e!=94&&e!=96&&e!=123&&e!=124&&e!=125}function jee(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function Ree(e,t){return e.next==37?(e.advance(),jee(e.next)&&e.advance(),jee(e.next)&&e.advance(),!0):WIt(e.next)||t&&e.next==44?(e.advance(),!0):!1}function tNe(e){if(e.advance(),e.next==60){for(e.advance();;)if(!Ree(e,!0)){e.next==62&&e.advance();break}}else for(;Ree(e,!1););}function u8(e){for(e.advance();!Vg(e.next)&&ej(e.next)!="f";)e.advance()}function $Q(e,t){let n=e.next,i=!1,r=e.pos;for(e.advance();;){let s=e.next;if(s<0)break;if(e.advance(),s==n)if(s==39)if(e.next==39)e.advance();else break;else break;else if(s==92&&n==34)e.next>=0&&e.advance();else if(Ih(s)){if(t)return!1;i=!0}else if(t&&e.pos>=r+1024)return!1}return!i}function GIt(e){for(let t=[],n=e.pos+1024;;)if(e.next==91||e.next==123)t.push(e.next),e.advance();else if(e.next==39||e.next==34){if(!$Q(e,!0))return!1}else if(e.next==93||e.next==125){if(t[t.length-1]!=e.next-2)return!1;if(t.pop(),e.advance(),!t.length)return!0}else{if(e.next<0||e.pos>n||Ih(e.next))return!1;e.advance()}}const KIt="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function ej(e){return e<33?"u":e>125?"s":KIt[e-33]}function q5(e,t){let n=ej(e);return n!="u"&&!(t&&n=="f")}function nNe(e,t,n,i){if(ej(e.next)=="s"||(e.next==63||e.next==58||e.next==45)&&q5(e.peek(1),n))e.advance();else return!1;let r=e.pos;for(;;){let s=e.next,a=0,l=i+1;for(;eNe(s);){if(Ih(s)){if(t)return!1;l=0}else l++;s=e.peek(++a)}if(!(s>=0&&(s==58?q5(e.peek(a+1),n):s==35?e.peek(a-1)!=32:q5(s,n)))||!n&&l<=i||l==0&&!n&&(fx(e,45,a)||fx(e,46,a)))break;if(t&&ej(s)=="f")return!1;for(let u=a;u>=0;u--)e.advance();if(t&&e.pos>r+1024)return!1}return!0}const XIt=new zs((e,t)=>{if(e.next==33)tNe(e),e.acceptToken(MIt);else if(e.next==38||e.next==42){let n=e.next==38?PIt:DIt;u8(e),e.acceptToken(n)}else e.next==39||e.next==34?($Q(e,!1),e.acceptToken(IIt)):nNe(e,!1,t.context.type==bk,t.context.depth)&&e.acceptToken(RIt)}),YIt=new zs((e,t)=>{let n=t.context.type==l8?t.context.depth:-1,i=e.pos;e:for(;;){let r=0,s=e.next;for(;s==32;)s=e.peek(++r);if(!r&&(fx(e,45,r)||fx(e,46,r))||!Ih(s)&&(n<0&&(n=Math.max(t.context.depth+1,r)),rYAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:VIt,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[ZIt],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[HIt,qIt,XIt,YIt,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),ePt=jh.define({name:"yaml",parser:JIt.configure({props:[Hh.add({Stream:e=>{for(let t=e.node.resolve(e.pos,-1);t&&t.to>=e.pos;t=t.parent){if(t.name=="BlockLiteralContent"&&t.frome.pos)return null}}return null},FlowMapping:hv({closing:"}"}),FlowSequence:hv({closing:"]"})}),qh.add({"FlowMapping FlowSequence":LE,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function tPt(){return new Nm(ePt)}function nPt(e){iNe(e,"start");var t={},n=e.languageData||{},i=!1;for(var r in e)if(r!=n&&e.hasOwnProperty(r))for(var s=t[r]=[],a=e[r],l=0;l2&&a.token&&typeof a.token!="string"){n.pending=[];for(var u=2;u-1)return null;var r=n.indent.length-1,s=e[n.state];e:for(;;){for(var a=0;a{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),i=BQ(e.state,n.from);return i.line?yPt(e):i.block?xPt(e):!1};function FQ(e,t){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=e(t,n);return r?(i(n.update(r)),!0):!1}}const yPt=FQ(SPt,0),vPt=FQ(lNe,0),xPt=FQ((e,t)=>lNe(e,t,OPt(t)),0);function BQ(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const rw=50;function wPt(e,{open:t,close:n},i,r){let s=e.sliceDoc(i-rw,i),a=e.sliceDoc(r,r+rw),l=/\s*$/.exec(s)[0].length,c=/^\s*/.exec(a)[0].length,u=s.length-l;if(s.slice(u-t.length,u)==t&&a.slice(c,c+n.length)==n)return{open:{pos:i-l,margin:l&&1},close:{pos:r+c,margin:c&&1}};let d,f;r-i<=2*rw?d=f=e.sliceDoc(i,r):(d=e.sliceDoc(i,i+rw),f=e.sliceDoc(r-rw,r));let h=/^\s*/.exec(d)[0].length,p=/\s*$/.exec(f)[0].length,g=f.length-p-n.length;return d.slice(h,h+t.length)==t&&f.slice(g,g+n.length)==n?{open:{pos:i+h+t.length,margin:/\s/.test(d.charAt(h+t.length))?1:0},close:{pos:r-p-n.length,margin:/\s/.test(f.charAt(g-1))?1:0}}:null}function OPt(e){let t=[];for(let n of e.selection.ranges){let i=e.doc.lineAt(n.from),r=n.to<=i.to?i:e.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:e.doc.lineAt(n.to-1));let s=t.length-1;s>=0&&t[s].to>i.from?t[s].to=r.to:t.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return t}function lNe(e,t,n=t.selection.ranges){let i=n.map(s=>BQ(t,s.from).block);if(!i.every(s=>s))return null;let r=n.map((s,a)=>wPt(t,i[a],s.from,s.to));if(e!=2&&!r.every(s=>s))return{changes:t.changes(n.map((s,a)=>r[a]?[]:[{from:s.from,insert:i[a].open+" "},{from:s.to,insert:" "+i[a].close}]))};if(e!=1&&r.some(s=>s)){let s=[];for(let a=0,l;ar&&(s==a||a>f.from)){r=f.from;let h=/^\s*/.exec(f.text)[0].length,p=h==f.length,g=f.text.slice(h,h+u.length)==u?h:-1;hs.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:c,indent:u,empty:d,single:f}of i)(f||!d)&&s.push({from:l.from+u,insert:c+" "});let a=t.changes(s);return{changes:a,selection:t.selection.map(a,1)}}else if(e!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:a,comment:l,token:c}of i)if(l>=0){let u=a.from+l,d=u+c.length;a.text[d-a.from]==" "&&d++,s.push({from:u,to:d})}return{changes:s}}return null}const f8=Jd.define(),kPt=Jd.define(),EPt=Kt.define(),cNe=Kt.define({combine(e){return ef(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(i,r)=>t(i,r)||n(i,r)})}}),uNe=ro.define({create(){return Nd.empty},update(e,t){let n=t.state.facet(cNe),i=t.annotation(f8);if(i){let c=pl.fromTransaction(t,i.selection),u=i.side,d=u==0?e.undone:e.done;return c?d=tj(d,d.length,n.minDepth,c):d=hNe(d,t.startState.selection),new Nd(u==0?i.rest:d,u==0?d:i.rest)}let r=t.annotation(kPt);if((r=="full"||r=="before")&&(e=e.isolate()),t.annotation(Js.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let s=pl.fromTransaction(t),a=t.annotation(Js.time),l=t.annotation(Js.userEvent);return s?e=e.addChanges(s,a,l,n,t):t.selection&&(e=e.addSelection(t.startState.selection,a,l,n.newGroupDelay)),(r=="full"||r=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new Nd(e.done.map(pl.fromJSON),e.undone.map(pl.fromJSON))}});function CPt(e={}){return[uNe,cNe.of(e),$t.domEventHandlers({beforeinput(t,n){let i=t.inputType=="historyUndo"?dNe:t.inputType=="historyRedo"?h8:null;return i?(t.preventDefault(),i(n)):!1}})]}function II(e,t){return function({state:n,dispatch:i}){if(!t&&n.readOnly)return!1;let r=n.field(uNe,!1);if(!r)return!1;let s=r.pop(e,n,t);return s?(i(s),!0):!1}}const dNe=II(0,!1),h8=II(1,!1),TPt=II(0,!0),APt=II(1,!0);class pl{constructor(t,n,i,r,s){this.changes=t,this.effects=n,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(t){return new pl(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,i;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(t){return new pl(t.changes&&ma.fromJSON(t.changes),[],t.mapped&&Ld.fromJSON(t.mapped),t.startSelection&&st.fromJSON(t.startSelection),t.selectionsAfter.map(st.fromJSON))}static fromTransaction(t,n){let i=Xc;for(let r of t.startState.facet(EPt)){let s=r(t);s.length&&(i=i.concat(s))}return!i.length&&t.changes.empty?null:new pl(t.changes.invert(t.startState.doc),i,void 0,n||t.startState.selection,Xc)}static selection(t){return new pl(void 0,Xc,void 0,void 0,t)}}function tj(e,t,n,i){let r=t+1>n+20?t-n-1:0,s=e.slice(r,t);return s.push(i),s}function _Pt(e,t){let n=[],i=!1;return e.iterChangedRanges((r,s)=>n.push(r,s)),t.iterChangedRanges((r,s,a,l)=>{for(let c=0;c=u&&a<=d&&(i=!0)}}),i}function NPt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,i)=>n.empty!=t.ranges[i].empty).length===0}function fNe(e,t){return e.length?t.length?e.concat(t):e:t}const Xc=[],jPt=200;function hNe(e,t){if(e.length){let n=e[e.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-jPt));return i.length&&i[i.length-1].eq(t)?e:(i.push(t),tj(e,e.length-1,1e9,n.setSelAfter(i)))}else return[pl.selection([t])]}function RPt(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function W5(e,t){if(!e.length)return e;let n=e.length,i=Xc;for(;n;){let r=IPt(e[n-1],t,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=e.slice(0,n);return s[n-1]=r,s}else t=r.mapped,n--,i=r.selectionsAfter}return i.length?[pl.selection(i)]:Xc}function IPt(e,t,n){let i=fNe(e.selectionsAfter.length?e.selectionsAfter.map(l=>l.map(t)):Xc,n);if(!e.changes)return pl.selection(i);let r=e.changes.map(t),s=t.mapDesc(e.changes,!0),a=e.mapped?e.mapped.composeDesc(s):s;return new pl(r,Fn.mapEffects(e.effects,t),a,e.startSelection.map(s),i)}const PPt=/^(input\.type|delete)($|\.)/;class Nd{constructor(t,n,i=0,r=void 0){this.done=t,this.undone=n,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new Nd(this.done,this.undone):this}addChanges(t,n,i,r,s){let a=this.done,l=a[a.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!i||PPt.test(i))&&(!l.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?e.moveByChar(n,t):PI(n,t))}function So(e){return e.textDirectionAt(e.state.selection.main.head)==Cr.LTR}const mNe=e=>pNe(e,!So(e)),gNe=e=>pNe(e,So(e));function bNe(e,t){return Ju(e,n=>n.empty?e.moveByGroup(n,t):PI(n,t))}const MPt=e=>bNe(e,!So(e)),LPt=e=>bNe(e,So(e));function $Pt(e,t,n){if(t.type.prop(n))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function DI(e,t,n){let i=Or(e).resolveInner(t.head),r=n?Ln.closedBy:Ln.openedBy;for(let c=t.head;;){let u=n?i.childAfter(c):i.childBefore(c);if(!u)break;$Pt(e,u,r)?i=u:c=n?u.to:u.from}let s=i.type.prop(r),a,l;return s&&(a=n?_d(e,i.from,1):_d(e,i.to,-1))&&a.matched?l=n?a.end.to:a.end.from:l=n?i.to:i.from,st.cursor(l,n?-1:1)}const FPt=e=>Ju(e,t=>DI(e.state,t,!So(e))),BPt=e=>Ju(e,t=>DI(e.state,t,So(e)));function yNe(e,t){return Ju(e,n=>{if(!n.empty)return PI(n,t);let i=e.moveVertically(n,t);return i.head!=n.head?i:e.moveToLineBoundary(n,t)})}const vNe=e=>yNe(e,!1),xNe=e=>yNe(e,!0);function wNe(e){let t=e.scrollDOM.clientHeighta.empty?e.moveVertically(a,t,n.height):PI(a,t));if(r.eq(i.selection))return!1;let s;if(n.selfScroll){let a=e.coordsAtPos(i.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),c=l.top+n.marginTop,u=l.bottom-n.marginBottom;a&&a.top>c&&a.bottomONe(e,!1),p8=e=>ONe(e,!0);function Hm(e,t,n){let i=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?i.to:i.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==i.from&&i.length){let s=/^\s*/.exec(e.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&t.head!=i.from+s&&(r=st.cursor(i.from+s))}return r}const UPt=e=>Ju(e,t=>Hm(e,t,!0)),QPt=e=>Ju(e,t=>Hm(e,t,!1)),zPt=e=>Ju(e,t=>Hm(e,t,!So(e))),VPt=e=>Ju(e,t=>Hm(e,t,So(e))),HPt=e=>Ju(e,t=>st.cursor(e.lineBlockAt(t.head).from,1)),qPt=e=>Ju(e,t=>st.cursor(e.lineBlockAt(t.head).to,-1));function WPt(e,t,n){let i=!1,r=s1(e.selection,s=>{let a=_d(e,s.head,-1)||_d(e,s.head,1)||s.head>0&&_d(e,s.head-1,1)||s.headWPt(e,t);function lu(e,t,n){let i=s1(e.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=t&&(r=st.range(r.head,r.anchor));let s=n(r);return st.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return i.eq(e.state.selection)?!1:(e.dispatch(Zu(e.state,i)),!0)}function SNe(e,t){return lu(e,t,n=>e.moveByChar(n,t))}const kNe=e=>SNe(e,!So(e)),ENe=e=>SNe(e,So(e));function CNe(e,t){return lu(e,t,n=>e.moveByGroup(n,t))}const KPt=e=>CNe(e,!So(e)),XPt=e=>CNe(e,So(e)),YPt=e=>{let t=!So(e);return lu(e,t,n=>DI(e.state,n,t))},ZPt=e=>{let t=So(e);return lu(e,t,n=>DI(e.state,n,t))};function TNe(e,t){return lu(e,t,n=>e.moveVertically(n,t))}const ANe=e=>TNe(e,!1),_Ne=e=>TNe(e,!0);function NNe(e,t){return lu(e,t,n=>e.moveVertically(n,t,wNe(e).height))}const Pee=e=>NNe(e,!1),Dee=e=>NNe(e,!0),JPt=e=>lu(e,!0,t=>Hm(e,t,!0)),eDt=e=>lu(e,!1,t=>Hm(e,t,!1)),tDt=e=>{let t=!So(e);return lu(e,t,n=>Hm(e,n,t))},nDt=e=>{let t=So(e);return lu(e,t,n=>Hm(e,n,t))},iDt=e=>lu(e,!1,t=>st.cursor(e.lineBlockAt(t.head).from)),rDt=e=>lu(e,!0,t=>st.cursor(e.lineBlockAt(t.head).to)),Mee=({state:e,dispatch:t})=>(t(Zu(e,{anchor:0})),!0),Lee=({state:e,dispatch:t})=>(t(Zu(e,{anchor:e.doc.length})),!0),$ee=({state:e,dispatch:t})=>(t(Zu(e,{anchor:e.selection.main.anchor,head:0})),!0),Fee=({state:e,dispatch:t})=>(t(Zu(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),sDt=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),aDt=({state:e,dispatch:t})=>{let n=MI(e).map(({from:i,to:r})=>st.range(i,Math.min(r+1,e.doc.length)));return t(e.update({selection:st.create(n),userEvent:"select"})),!0},oDt=({state:e,dispatch:t})=>{let n=s1(e.selection,i=>{let r=Or(e),s=r.resolveStack(i.from,1);if(i.empty){let a=r.resolveStack(i.from,-1);a.node.from>=s.node.from&&a.node.to<=s.node.to&&(s=a)}for(let a=s;a;a=a.next){let{node:l}=a;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&a.next)return st.range(l.to,l.from)}return i});return n.eq(e.selection)?!1:(t(Zu(e,n)),!0)};function jNe(e,t){let{state:n}=e,i=n.selection,r=n.selection.ranges.slice();for(let s of n.selection.ranges){let a=n.doc.lineAt(s.head);if(t?a.to0)for(let l=s;;){let c=e.moveVertically(l,t);if(c.heada.to){r.some(u=>u.head==c.head)||r.push(c);break}else{if(c.head==l.head)break;l=c}}}return r.length==i.ranges.length?!1:(e.dispatch(Zu(n,st.create(r,r.length-1))),!0)}const lDt=e=>jNe(e,!1),cDt=e=>jNe(e,!0),uDt=({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=st.create([n.main]):n.main.empty||(i=st.create([st.cursor(n.main.head)])),i?(t(Zu(e,i)),!0):!1};function UE(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:i}=e,r=i.changeByRange(s=>{let{from:a,to:l}=s;if(a==l){let c=t(s);ca&&(n="delete.forward",c=h2(e,c,!0)),a=Math.min(a,c),l=Math.max(l,c)}else a=h2(e,a,!1),l=h2(e,l,!0);return a==l?{range:s}:{changes:{from:a,to:l},range:st.cursor(a,ar(e)))i.between(t,t,(r,s)=>{rt&&(t=n?s:r)});return t}const RNe=(e,t,n)=>UE(e,i=>{let r=i.from,{state:s}=e,a=s.doc.lineAt(r),l,c;if(n&&!t&&r>a.from&&rRNe(e,!1,!0),INe=e=>RNe(e,!0,!1),PNe=(e,t)=>UE(e,n=>{let i=n.head,{state:r}=e,s=r.doc.lineAt(i),a=r.charCategorizer(i);for(let l=null;;){if(i==(t?s.to:s.from)){i==n.head&&s.number!=(t?r.doc.lines:1)&&(i+=t?1:-1);break}let c=$a(s.text,i-s.from,t)+s.from,u=s.text.slice(Math.min(i,c)-s.from,Math.max(i,c)-s.from),d=a(u);if(l!=null&&d!=l)break;(u!=" "||i!=n.head)&&(l=d),i=c}return i}),DNe=e=>PNe(e,!1),dDt=e=>PNe(e,!0),fDt=e=>UE(e,t=>{let n=e.lineBlockAt(t.head).to;return t.headUE(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),pDt=e=>UE(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head{if(e.readOnly)return!1;let n=e.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:Gi.of(["",""])},range:st.cursor(i.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},gDt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(i=>{if(!i.empty||i.from==0||i.from==e.doc.length)return{range:i};let r=i.from,s=e.doc.lineAt(r),a=r==s.from?r-1:$a(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:$a(s.text,r-s.from,!0)+s.from;return{changes:{from:a,to:l,insert:e.doc.slice(r,l).append(e.doc.slice(a,r))},range:st.cursor(l)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function MI(e){let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.from),s=e.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=e.doc.lineAt(i.to-1)),n>=r.number){let a=t[t.length-1];a.to=s.to,a.ranges.push(i)}else t.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return t}function MNe(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let s of MI(e)){if(n?s.to==e.doc.length:s.from==0)continue;let a=e.doc.lineAt(n?s.to+1:s.from-1),l=a.length+1;if(n){i.push({from:s.to,to:a.to},{from:s.from,insert:a.text+e.lineBreak});for(let c of s.ranges)r.push(st.range(Math.min(e.doc.length,c.anchor+l),Math.min(e.doc.length,c.head+l)))}else{i.push({from:a.from,to:s.from},{from:s.to,insert:e.lineBreak+a.text});for(let c of s.ranges)r.push(st.range(c.anchor-l,c.head-l))}}return i.length?(t(e.update({changes:i,scrollIntoView:!0,selection:st.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const bDt=({state:e,dispatch:t})=>MNe(e,t,!1),yDt=({state:e,dispatch:t})=>MNe(e,t,!0);function LNe(e,t,n){if(e.readOnly)return!1;let i=[];for(let s of MI(e))n?i.push({from:s.from,insert:e.doc.slice(s.from,s.to)+e.lineBreak}):i.push({from:s.to,insert:e.lineBreak+e.doc.slice(s.from,s.to)});let r=e.changes(i);return t(e.update({changes:r,selection:e.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const vDt=({state:e,dispatch:t})=>LNe(e,t,!1),xDt=({state:e,dispatch:t})=>LNe(e,t,!0),wDt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(MI(t).map(({from:r,to:s})=>(r>0?r--:s{let s;if(e.lineWrapping){let a=e.lineBlockAt(r.head),l=e.coordsAtPos(r.head,r.assoc||1);l&&(s=a.bottom+e.documentTop-l.bottom+e.defaultLineHeight/2)}return e.moveVertically(r,!0,s)}).map(n);return e.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function ODt(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Or(e).resolveInner(t),i=n.childBefore(t),r=n.childAfter(t),s;return i&&r&&i.to<=t&&r.from>=t&&(s=i.type.prop(Ln.closedBy))&&s.indexOf(r.name)>-1&&e.doc.lineAt(i.to).from==e.doc.lineAt(r.from).from&&!/\S/.test(e.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}const Bee=$Ne(!1),SDt=$Ne(!0);function $Ne(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange(r=>{let{from:s,to:a}=r,l=t.doc.lineAt(s),c=!e&&s==a&&ODt(t,s);e&&(s=a=(a<=l.to?l:t.doc.lineAt(a)).to);let u=new TI(t,{simulateBreak:s,simulateDoubleBreak:!!c}),d=cQ(u,s);for(d==null&&(d=Uu(/^\s*/.exec(t.doc.lineAt(s).text)[0],t.tabSize));al.from&&s{let r=[];for(let a=i.from;a<=i.to;){let l=e.doc.lineAt(a);l.number>n&&(i.empty||i.to>l.from)&&(t(l,r,i),n=l.number),a=l.to+1}let s=e.changes(r);return{changes:r,range:st.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const kDt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),i=new TI(e,{overrideIndentation:s=>{let a=n[s];return a??-1}}),r=UQ(e,(s,a,l)=>{let c=cQ(i,s.from);if(c==null)return;/\S/.test(s.text)||(c=0);let u=/^\s*/.exec(s.text)[0],d=ok(e,c);(u!=d||l.frome.readOnly?!1:(t(e.update(UQ(e,(n,i)=>{i.push({from:n.from,insert:e.facet(i1)})}),{userEvent:"input.indent"})),!0),BNe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(UQ(e,(n,i)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let s=Uu(r,e.tabSize),a=0,l=ok(e,Math.max(0,s-Pb(e)));for(;a(e.setTabFocusMode(),!0),CDt=[{key:"Ctrl-b",run:mNe,shift:kNe,preventDefault:!0},{key:"Ctrl-f",run:gNe,shift:ENe},{key:"Ctrl-p",run:vNe,shift:ANe},{key:"Ctrl-n",run:xNe,shift:_Ne},{key:"Ctrl-a",run:HPt,shift:iDt},{key:"Ctrl-e",run:qPt,shift:rDt},{key:"Ctrl-d",run:INe},{key:"Ctrl-h",run:m8},{key:"Ctrl-k",run:fDt},{key:"Ctrl-Alt-h",run:DNe},{key:"Ctrl-o",run:mDt},{key:"Ctrl-t",run:gDt},{key:"Ctrl-v",run:p8}],TDt=[{key:"ArrowLeft",run:mNe,shift:kNe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:MPt,shift:KPt,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:zPt,shift:tDt,preventDefault:!0},{key:"ArrowRight",run:gNe,shift:ENe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:LPt,shift:XPt,preventDefault:!0},{mac:"Cmd-ArrowRight",run:VPt,shift:nDt,preventDefault:!0},{key:"ArrowUp",run:vNe,shift:ANe,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Mee,shift:$ee},{mac:"Ctrl-ArrowUp",run:Iee,shift:Pee},{key:"ArrowDown",run:xNe,shift:_Ne,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Lee,shift:Fee},{mac:"Ctrl-ArrowDown",run:p8,shift:Dee},{key:"PageUp",run:Iee,shift:Pee},{key:"PageDown",run:p8,shift:Dee},{key:"Home",run:QPt,shift:eDt,preventDefault:!0},{key:"Mod-Home",run:Mee,shift:$ee},{key:"End",run:UPt,shift:JPt,preventDefault:!0},{key:"Mod-End",run:Lee,shift:Fee},{key:"Enter",run:Bee,shift:Bee},{key:"Mod-a",run:sDt},{key:"Backspace",run:m8,shift:m8,preventDefault:!0},{key:"Delete",run:INe,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:DNe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:dDt,preventDefault:!0},{mac:"Mod-Backspace",run:hDt,preventDefault:!0},{mac:"Mod-Delete",run:pDt,preventDefault:!0}].concat(CDt.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),ADt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:FPt,shift:YPt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:BPt,shift:ZPt},{key:"Alt-ArrowUp",run:bDt},{key:"Shift-Alt-ArrowUp",run:vDt},{key:"Alt-ArrowDown",run:yDt},{key:"Shift-Alt-ArrowDown",run:xDt},{key:"Mod-Alt-ArrowUp",run:lDt},{key:"Mod-Alt-ArrowDown",run:cDt},{key:"Escape",run:uDt},{key:"Mod-Enter",run:SDt},{key:"Alt-l",mac:"Ctrl-l",run:aDt},{key:"Mod-i",run:oDt,preventDefault:!0},{key:"Mod-[",run:BNe},{key:"Mod-]",run:FNe},{key:"Mod-Alt-\\",run:kDt},{key:"Shift-Mod-k",run:wDt},{key:"Shift-Mod-\\",run:GPt},{key:"Mod-/",run:bPt},{key:"Alt-A",run:vPt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:EDt}].concat(TDt),_Dt={key:"Tab",run:FNe,shift:BNe},Uee=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class hx{constructor(t,n,i=0,r=t.length,s,a){this.test=a,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,r),this.bufferStart=i,this.normalize=s?l=>s(Uee(l)):Uee,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ol(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let n=zU(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=vd(t);let r=this.normalize(n);if(r.length)for(let s=0,a=i,l=!0;;s++){let c=r.charCodeAt(s),u=this.match(c,a,l,this.bufferPos+this.bufferStart,s==r.length-1);if(u)return this.value=u,this;if(s==r.length-1)break;l&&sthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let i=this.curLineStart+n.index,r=i+n[0].length;if(this.matchPos=nj(this.text,r+(i==r?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,r,n)))return this.value={from:i,to:r,precise:!0,match:n},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||r.to<=n){let l=new bv(n,t.sliceString(n,i));return G5.set(t,l),l}if(r.from==n&&r.to==i)return r;let{text:s,from:a}=r;return a>n&&(s=t.sliceString(n,a)+s,a=n),r.to=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let i=this.flat.from+n.index,r=i+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,r,n)))return this.value={from:i,to:r,precise:!0,match:n},this.matchPos=nj(this.text,r+(i==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=bv.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(QNe.prototype[Symbol.iterator]=zNe.prototype[Symbol.iterator]=function(){return this});function NDt(e){try{return new RegExp(e,QQ),!0}catch{return!1}}function nj(e,t){if(t>=e.length)return t;let n=e.lineAt(t),i;for(;t=56320&&i<57344;)t++;return t}const jDt=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:i,result:r}=QTt(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:t.phrase("go")});return r.then(s=>{let a=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!a){e.dispatch({effects:i});return}let l=t.doc.lineAt(t.selection.main.head),[,c,u,d,f]=a,h=d?+d.slice(1):0,p=u?+u:l.number;if(u&&f){let v=p/100;c&&(v=v*(c=="-"?-1:1)+l.number/t.doc.lines),p=Math.round(t.doc.lines*v)}else u&&c&&(p=p*(c=="-"?-1:1)+l.number);let g=t.doc.line(Math.max(1,Math.min(t.doc.lines,p))),b=st.cursor(g.from+Math.max(0,Math.min(h,g.length)));e.dispatch({effects:[i,$t.scrollIntoView(b.from,{y:"center"})],selection:b})}),!0},RDt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},IDt=Kt.define({combine(e){return ef(e,RDt,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function PDt(e){return[FDt,$Dt]}const DDt=gn.mark({class:"cm-selectionMatch"}),MDt=gn.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Qee(e,t,n,i){return(n==0||e(t.sliceDoc(n-1,n))!=ns.Word)&&(i==t.doc.length||e(t.sliceDoc(i,i+1))!=ns.Word)}function LDt(e,t,n,i){return e(t.sliceDoc(n,n+1))==ns.Word&&e(t.sliceDoc(i-1,i))==ns.Word}const $Dt=Ts.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(IDt),{state:n}=e,i=n.selection;if(i.ranges.length>1)return gn.none;let r=i.main,s,a=null;if(r.empty){if(!t.highlightWordAroundCursor)return gn.none;let c=n.wordAt(r.head);if(!c)return gn.none;a=n.charCategorizer(r.head),s=n.sliceDoc(c.from,c.to)}else{let c=r.to-r.from;if(c200)return gn.none;if(t.wholeWords){if(s=n.sliceDoc(r.from,r.to),a=n.charCategorizer(r.head),!(Qee(a,n,r.from,r.to)&&LDt(a,n,r.from,r.to)))return gn.none}else if(s=n.sliceDoc(r.from,r.to),!s)return gn.none}let l=[];for(let c of e.visibleRanges){let u=new hx(n.doc,s,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!a||Qee(a,n,d,f))&&(r.empty&&d<=r.from&&f>=r.to?l.push(MDt.range(d,f)):(d>=r.to||f<=r.from)&&l.push(DDt.range(d,f)),l.length>t.maxMatches))return gn.none}}return gn.set(l)}},{decorations:e=>e.decorations}),FDt=$t.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),BDt=({state:e,dispatch:t})=>{let{selection:n}=e,i=st.create(n.ranges.map(r=>e.wordAt(r.head)||st.cursor(r.head)),n.mainIndex);return i.eq(n)?!1:(t(e.update({selection:i})),!0)};function UDt(e,t){let{main:n,ranges:i}=e.selection,r=e.wordAt(n.head),s=r&&r.from==n.from&&r.to==n.to;for(let a=!1,l=new hx(e.doc,t,i[i.length-1].to);;)if(l.next(),l.done){if(a)return null;l=new hx(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),a=!0}else{if(a&&i.some(c=>c.from==l.value.from))continue;if(s){let c=e.wordAt(l.value.from);if(!c||c.from!=l.value.from||c.to!=l.value.to)continue}return l.value}}const QDt=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(s=>s.from===s.to))return BDt({state:e,dispatch:t});let i=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(s=>e.sliceDoc(s.from,s.to)!=i))return!1;let r=UDt(e,i);return r?(t(e.update({selection:e.selection.addRange(st.range(r.from,r.to),!1),effects:$t.scrollIntoView(r.to)})),!0):!1},a1=Kt.define({combine(e){return ef(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new nMt(t),scrollToMatch:t=>$t.scrollIntoView(t)})}});class VNe{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||NDt(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord,this.test=t.test}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(n,i)=>i=="n"?` -`:i=="r"?"\r":i=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord&&this.test==t.test}create(){return this.regexp?new GDt(this):new HDt(this)}getCursor(t,n=0,i){let r=t.doc?t:Ti.create({doc:t});return i==null&&(i=r.doc.length),this.regexp?ly(this,r,n,i):oy(this,r,n,i)}}class HNe{constructor(t){this.spec=t}}function zDt(e,t,n){return(i,r,s,a)=>{if(n&&!n(i,r,s,a))return!1;let l=i>=a&&r<=a+s.length?s.slice(i-a,r-a):t.doc.sliceString(i,r);return e(l,t,i,r)}}function oy(e,t,n,i){let r;return e.wholeWord&&(r=VDt(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(r=zDt(e.test,t,r)),new hx(t.doc,e.unquoted,n,i,e.caseSensitive?void 0:s=>s.toLowerCase(),r)}function VDt(e,t){return(n,i,r,s)=>((s>n||s+r.length=n)return null;r.push(i.value)}return r}highlight(t,n,i,r){let s=oy(this.spec,t,Math.max(0,n-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,t.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}function qDt(e,t,n){return(i,r,s)=>(!n||n(i,r,s))&&e(s[0],t,i,r)}function ly(e,t,n,i){let r;return e.wholeWord&&(r=WDt(t.charCategorizer(t.selection.main.head))),e.test&&(r=qDt(e.test,t,r)),new QNe(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:r},n,i)}function ij(e,t){return e.slice($a(e,t,!1),t)}function rj(e,t){return e.slice(t,$a(e,t))}function WDt(e){return(t,n,i)=>!i[0].length||(e(ij(i.input,i.index))!=ns.Word||e(rj(i.input,i.index))!=ns.Word)&&(e(rj(i.input,i.index+i[0].length))!=ns.Word||e(ij(i.input,i.index+i[0].length))!=ns.Word)}class GDt extends HNe{nextMatch(t,n,i){let r=ly(this.spec,t,i,t.doc.length).next();return r.done&&(r=ly(this.spec,t,0,n).next()),r.done?null:r.value}prevMatchInRange(t,n,i){for(let r=1;;r++){let s=Math.max(n,i-r*1e4),a=ly(this.spec,t,s,i),l=null;for(;!a.next().done;)l=a.value;if(l&&(s==n||l.from>s+10))return l;if(s==n)return null}}prevMatch(t,n,i){return this.prevMatchInRange(t,0,n)||this.prevMatchInRange(t,i,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,i)=>{if(i=="&")return t.match[0];if(i=="$")return"$";for(let r=i.length;r>0;r--){let s=+i.slice(0,r);if(s>0&&s=n)return null;r.push(i.value)}return r}highlight(t,n,i,r){let s=ly(this.spec,t,Math.max(0,n-250),Math.min(i+250,t.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}const yk=Fn.define(),zQ=Fn.define(),sm=ro.define({create(e){return new K5(g8(e).create(),null)},update(e,t){for(let n of t.effects)n.is(yk)?e=new K5(n.value.create(),e.panel):n.is(zQ)&&(e=new K5(e.query,n.value?VQ:null));return e},provide:e=>sk.from(e,t=>t.panel)});class K5{constructor(t,n){this.query=t,this.panel=n}}const KDt=gn.mark({class:"cm-searchMatch"}),XDt=gn.mark({class:"cm-searchMatch cm-searchMatch-selected"}),YDt=Ts.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(sm))}update(e){let t=e.state.field(sm);(t!=e.startState.field(sm)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return gn.none;let{view:n}=this,i=new Ah;for(let r=0,s=n.visibleRanges,a=s.length;rs[r+1].from-2*250;)c=s[++r].to;e.highlight(n.state,l,c,(u,d)=>{let f=n.state.selection.ranges.some(h=>h.from==u&&h.to==d);i.add(u,d,f?XDt:KDt)})}return i.finish()}},{decorations:e=>e.decorations});function QE(e){return t=>{let n=t.state.field(sm,!1);return n&&n.query.spec.valid?e(t,n):GNe(t)}}const sj=QE((e,{query:t})=>{let{to:n}=e.state.selection.main,i=t.nextMatch(e.state,n,n);if(!i)return!1;let r=st.single(i.from,i.to),s=e.state.facet(a1);return e.dispatch({selection:r,effects:[HQ(e,i),s.scrollToMatch(r.main,e)],userEvent:"select.search"}),WNe(e),!0}),aj=QE((e,{query:t})=>{let{state:n}=e,{from:i}=n.selection.main,r=t.prevMatch(n,i,i);if(!r)return!1;let s=st.single(r.from,r.to),a=e.state.facet(a1);return e.dispatch({selection:s,effects:[HQ(e,r),a.scrollToMatch(s.main,e)],userEvent:"select.search"}),WNe(e),!0}),ZDt=QE((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:st.create(n.map(i=>st.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),JDt=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:i,to:r}=n.main,s=[],a=0;for(let l=new hx(e.doc,e.sliceDoc(i,r));!l.next().done;){if(s.length>1e3)return!1;l.value.from==i&&(a=s.length),s.push(st.range(l.value.from,l.value.to))}return t(e.update({selection:st.create(s,a),userEvent:"select.search.matches"})),!0},zee=QE((e,{query:t})=>{let{state:n}=e,{from:i,to:r}=n.selection.main;if(n.readOnly)return!1;let s=t.nextMatch(n,i,i);if(!s)return!1;let a=s,l=[],c,u,d=[];a.precise?a.from==i&&a.to==r&&(u=n.toText(t.getReplacement(a)),l.push({from:a.from,to:a.to,insert:u}),a=t.nextMatch(n,a.from,a.to),d.push($t.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+"."))):a=t.nextMatch(n,a.from,a.to);let f=e.state.changes(l);return a&&(c=st.single(a.from,a.to).map(f),d.push(HQ(e,a)),d.push(n.facet(a1).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:"input.replace"}),!0}),eMt=QE((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:s,to:a,precise:l}=r;l&&n.push({from:s,to:a,insert:t.getReplacement(r)})}if(!n.length)return!1;let i=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:$t.announce.of(i),userEvent:"input.replace.all"}),!0});function VQ(e){return e.state.facet(a1).createPanel(e)}function g8(e,t){var n,i,r,s,a;let l=e.selection.main,c=l.empty||l.to>l.from+100?"":e.sliceDoc(l.from,l.to);if(t&&!c)return t;let u=e.facet(a1);return new VNe({search:((n=t==null?void 0:t.literal)!==null&&n!==void 0?n:u.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(i=t==null?void 0:t.caseSensitive)!==null&&i!==void 0?i:u.caseSensitive,literal:(r=t==null?void 0:t.literal)!==null&&r!==void 0?r:u.literal,regexp:(s=t==null?void 0:t.regexp)!==null&&s!==void 0?s:u.regexp,wholeWord:(a=t==null?void 0:t.wholeWord)!==null&&a!==void 0?a:u.wholeWord})}function qNe(e){let t=oQ(e,VQ);return t&&t.dom.querySelector("[main-field]")}function WNe(e){let t=qNe(e);t&&t==e.root.activeElement&&t.select()}const GNe=e=>{let t=e.state.field(sm,!1);if(t&&t.panel){let n=qNe(e);if(n&&n!=e.root.activeElement){let i=g8(e.state,t.query.spec);i.valid&&e.dispatch({effects:yk.of(i)}),n.focus(),n.select()}}else e.dispatch({effects:[zQ.of(!0),t?yk.of(g8(e.state,t.query.spec)):Fn.appendConfig.of(rMt)]});return!0},KNe=e=>{let t=e.state.field(sm,!1);if(!t||!t.panel)return!1;let n=oQ(e,VQ);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:zQ.of(!1)}),!0},tMt=[{key:"Mod-f",run:GNe,scope:"editor search-panel"},{key:"F3",run:sj,shift:aj,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:sj,shift:aj,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:KNe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:JDt},{key:"Mod-Alt-g",run:jDt},{key:"Mod-d",run:QDt,preventDefault:!0}];class nMt{constructor(t){this.view=t;let n=this.query=t.state.field(sm).query.spec;this.commit=this.commit.bind(this),this.searchField=yr("input",{value:n.search,placeholder:Ll(t,"Find"),"aria-label":Ll(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=yr("input",{value:n.replace,placeholder:Ll(t,"Replace"),"aria-label":Ll(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=yr("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=yr("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=yr("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function i(r,s,a){return yr("button",{class:"cm-button",name:r,onclick:s,type:"button"},a)}this.dom=yr("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,i("next",()=>sj(t),[Ll(t,"next")]),i("prev",()=>aj(t),[Ll(t,"previous")]),i("select",()=>ZDt(t),[Ll(t,"all")]),yr("label",null,[this.caseField,Ll(t,"match case")]),yr("label",null,[this.reField,Ll(t,"regexp")]),yr("label",null,[this.wordField,Ll(t,"by word")]),...t.state.readOnly?[]:[yr("br"),this.replaceField,i("replace",()=>zee(t),[Ll(t,"replace")]),i("replaceAll",()=>eMt(t),[Ll(t,"replace all")])],yr("button",{name:"close",onclick:()=>KNe(t),"aria-label":Ll(t,"close"),type:"button"},["×"])])}commit(){let t=new VNe({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:yk.of(t)}))}keydown(t){YCt(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?aj:sj)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),zee(this.view))}update(t){for(let n of t.transactions)for(let i of n.effects)i.is(yk)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(a1).top}}function Ll(e,t){return e.state.phrase(t)}const p2=30,m2=/[\s\.,:;?!]/;function HQ(e,{from:t,to:n}){let i=e.state.doc.lineAt(t),r=e.state.doc.lineAt(n).to,s=Math.max(i.from,t-p2),a=Math.min(r,n+p2),l=e.state.sliceDoc(s,a);if(s!=i.from){for(let c=0;cl.length-p2;c--)if(!m2.test(l[c-1])&&m2.test(l[c])){l=l.slice(0,c);break}}return $t.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${i.number}.`)}const iMt=$t.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),rMt=[sm,zh.low(YDt),iMt];class Vee{constructor(t,n,i){this.from=t,this.to=n,this.diagnostic=i}}class jg{constructor(t,n,i){this.diagnostics=t,this.panel=n,this.selected=i}static init(t,n,i){let r=i.facet(vk).markerFilter;r&&(t=r(t,i));let s=t.slice().sort((p,g)=>p.from-g.from||p.to-g.to),a=new Ah,l=[],c=0,u=i.doc.iter(),d=0,f=i.doc.length;for(let p=0;;){let g=p==s.length?null:s[p];if(!g&&!l.length)break;let b,v;if(l.length)b=c,v=l.reduce((O,w)=>Math.min(O,w.to),g&&g.from>b?g.from:1e8);else{if(b=g.from,b>f)break;v=g.to,l.push(g),p++}for(;pO.from||O.to==b))l.push(O),p++,v=Math.min(O.to,v);else{v=Math.min(O.from,v);break}}v=Math.min(v,f);let y=!1;if(l.some(O=>O.from==b&&(O.to==v||v==f))&&(y=b==v,!y&&v-b<10)){let O=b-(d+u.value.length);O>0&&(u.next(O),d=b);for(let w=b;;){if(w>=v){y=!0;break}if(!u.lineBreak&&d+u.value.length>w)break;w=d+u.value.length,d+=u.value.length,u.next()}}let x=bMt(l);if(y)a.add(b,b,gn.widget({widget:new hMt(x),diagnostics:l.slice()}));else{let O=l.reduce((w,k)=>k.markClass?w+" "+k.markClass:w,"");a.add(b,v,gn.mark({class:"cm-lintRange cm-lintRange-"+x+O,diagnostics:l.slice(),inclusiveEnd:l.some(w=>w.to>v)}))}if(c=v,c==f)break;for(let O=0;O{if(!(t&&a.diagnostics.indexOf(t)<0))if(!i)i=new Vee(r,s,t||a.diagnostics[0]);else{if(a.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new Vee(i.from,s,i.diagnostic)}}),i}function sMt(e,t){let n=t.pos,i=t.end||n,r=e.state.facet(vk).hideOn(e,n,i);if(r!=null)return r;let s=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(a=>a.is(XNe))||e.changes.touchesRange(s.from,Math.max(s.to,i)))}function aMt(e,t){return e.field(tc,!1)?t:t.concat(Fn.appendConfig.of(yMt))}const XNe=Fn.define(),qQ=Fn.define(),YNe=Fn.define(),tc=ro.define({create(){return new jg(gn.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),i=null,r=e.panel;if(e.selected){let s=t.changes.mapPos(e.selected.from,1);i=jm(n,e.selected.diagnostic,s)||jm(n,null,s)}!n.size&&r&&t.state.facet(vk).autoPanel&&(r=null),e=new jg(n,r,i)}for(let n of t.effects)if(n.is(XNe)){let i=t.state.facet(vk).autoPanel?n.value.length?xk.open:null:e.panel;e=jg.init(n.value,i,t.state)}else n.is(qQ)?e=new jg(e.diagnostics,n.value?xk.open:null,e.selected):n.is(YNe)&&(e=new jg(e.diagnostics,e.panel,n.value));return e},provide:e=>[sk.from(e,t=>t.panel),$t.decorations.from(e,t=>t.diagnostics)]}),oMt=gn.mark({class:"cm-lintRange cm-lintRange-active"});function lMt(e,t,n){let{diagnostics:i}=e.state.field(tc),r,s=-1,a=-1;i.between(t-(n<0?1:0),t+(n>0?1:0),(c,u,{spec:d})=>{if(t>=c&&t<=u&&(c==u||(t>c||n>0)&&(tJNe(e,n,!1)))}const uMt=e=>{let t=e.state.field(tc,!1);(!t||!t.panel)&&e.dispatch({effects:aMt(e.state,[qQ.of(!0)])});let n=oQ(e,xk.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},Hee=e=>{let t=e.state.field(tc,!1);return!t||!t.panel?!1:(e.dispatch({effects:qQ.of(!1)}),!0)},dMt=e=>{let t=e.state.field(tc,!1);if(!t)return!1;let n=e.state.selection.main,i=jm(t.diagnostics,null,n.to+1);return!i&&(i=jm(t.diagnostics,null,0),!i||i.from==n.from&&i.to==n.to)?!1:(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),BTt(e,i.from,1,{tooltip:eje,until:r=>r.docChanged||r.newSelection.main.headi.to}),!0)},fMt=[{key:"Mod-Shift-m",run:uMt,preventDefault:!0},{key:"F8",run:dMt}],vk=Kt.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...ef(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:qee,tooltipFilter:qee,needsRefresh:(t,n)=>t?n?i=>t(i)||n(i):t:n,hideOn:(t,n)=>t?n?(i,r,s)=>t(i,r,s)||n(i,r,s):t:n,autoPanel:(t,n)=>t||n})}}});function qee(e,t){return e?t?(n,i)=>t(e(n,i),i):e:t}function ZNe(e){let t=[];if(e)e:for(let{name:n}of e){for(let i=0;is.toLowerCase()==r.toLowerCase())){t.push(r);continue e}}t.push("")}return t}function JNe(e,t,n){var i;let r=n?ZNe(t.actions):[];return yr("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},yr("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(i=t.actions)===null||i===void 0?void 0:i.map((s,a)=>{let l=!1,c=p=>{if(p.preventDefault(),l)return;l=!0;let g=jm(e.state.field(tc).diagnostics,t);g&&s.apply(e,g.from,g.to)},{name:u}=s,d=r[a]?u.indexOf(r[a]):-1,f=d<0?u:[u.slice(0,d),yr("u",u.slice(d,d+1)),u.slice(d+1)],h=s.markClass?" "+s.markClass:"";return yr("button",{type:"button",class:"cm-diagnosticAction"+h,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${r[a]})"`}.`},f)}),t.source&&yr("div",{class:"cm-diagnosticSource"},t.source))}class hMt extends Yu{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return yr("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Wee{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=JNe(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class xk{constructor(t){this.view=t,this.items=[];let n=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)Hee(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],a=ZNe(s.actions);for(let l=0;l{for(let s=0;sHee(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(tc).selected;if(!t)return-1;for(let n=0;n{for(let d of u.diagnostics){if(a.has(d))continue;a.add(d);let f=-1,h;for(let p=i;pi&&(this.items.splice(i,f-i),r=!0)),n&&h.diagnostic==n.diagnostic?h.dom.hasAttribute("aria-selected")||(h.dom.setAttribute("aria-selected","true"),s=h):h.dom.hasAttribute("aria-selected")&&h.dom.removeAttribute("aria-selected"),i++}});i({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:c})=>{let u=c.height/this.list.offsetHeight;l.topc.bottom&&(this.list.scrollTop+=(l.bottom-c.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let t=this.list.firstChild;function n(){let i=t;t=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;t!=i.dom;)n();t=i.dom.nextSibling}else this.list.insertBefore(i.dom,t);for(;t;)n()}moveSelection(t){if(this.selectedIndex<0)return;let n=this.view.state.field(tc),i=jm(n.diagnostics,this.items[t].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:YNe.of(i)})}static open(t){return new xk(t)}}function pMt(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}function g2(e){return pMt(``,'width="6" height="3"')}const mMt=$t.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:g2("#f11")},".cm-lintRange-warning":{backgroundImage:g2("orange")},".cm-lintRange-info":{backgroundImage:g2("#999")},".cm-lintRange-hint":{backgroundImage:g2("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function gMt(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function bMt(e){let t="hint",n=1;for(let i of e){let r=gMt(i.severity);r>n&&(n=r,t=i.severity)}return t}const eje=FTt(lMt,{hideOn:sMt}),yMt=[tc,$t.decorations.compute([tc],e=>{let{selected:t,panel:n}=e.field(tc);return!t||!n||t.from==t.to?gn.none:gn.set([oMt.range(t.from,t.to)])}),eje,mMt];var Gee=function(t){t===void 0&&(t={});var n=t,i=n.crosshairCursor,r=i===void 0?!1:i,s=[];t.closeBracketsKeymap!==!1&&(s=s.concat(E_t)),t.defaultKeymap!==!1&&(s=s.concat(ADt)),t.searchKeymap!==!1&&(s=s.concat(tMt)),t.historyKeymap!==!1&&(s=s.concat(DPt)),t.foldKeymap!==!1&&(s=s.concat(_2t)),t.completionKeymap!==!1&&(s=s.concat(RAe)),t.lintKeymap!==!1&&(s=s.concat(fMt));var a=[];return t.lineNumbers!==!1&&a.push(K2e()),t.highlightActiveLineGutter!==!1&&a.push(t2t()),t.highlightSpecialChars!==!1&&a.push(pTt()),t.history!==!1&&a.push(CPt()),t.foldGutter!==!1&&a.push(I2t()),t.drawSelection!==!1&&a.push(iTt()),t.dropCursor!==!1&&a.push(lTt()),t.allowMultipleSelections!==!1&&a.push(Ti.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&a.push(w2t()),t.syntaxHighlighting!==!1&&a.push(uAe(L2t,{fallback:!0})),t.bracketMatching!==!1&&a.push(V2t()),t.closeBrackets!==!1&&a.push(w_t()),t.autocompletion!==!1&&a.push(R_t()),t.rectangularSelection!==!1&&a.push(ATt()),r!==!1&&a.push(jTt()),t.highlightActiveLine!==!1&&a.push(xTt()),t.highlightSelectionMatches!==!1&&a.push(PDt()),t.tabSize&&typeof t.tabSize=="number"&&a.push(i1.of(" ".repeat(t.tabSize))),a.concat([n1.of(s.flat())]).filter(Boolean)};const vMt="#e5c07b",Kee="#e06c75",xMt="#56b6c2",wMt="#ffffff",BA="#abb2bf",b8="#7d8799",OMt="#61afef",SMt="#98c379",Xee="#d19a66",kMt="#c678dd",EMt="#21252b",Yee="#2c313a",Zee="#282c34",X5="#353a42",CMt="#3E4451",Jee="#528bff",TMt=$t.theme({"&":{color:BA,backgroundColor:Zee},".cm-content":{caretColor:Jee},".cm-cursor, .cm-dropCursor":{borderLeftColor:Jee},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:CMt},".cm-panels":{backgroundColor:EMt,color:BA},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Zee,color:b8,border:"none"},".cm-activeLineGutter":{backgroundColor:Yee},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:X5},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:X5,borderBottomColor:X5},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Yee,color:BA}}},{dark:!0}),AMt=FE.define([{tag:ne.keyword,color:kMt},{tag:[ne.name,ne.deleted,ne.character,ne.propertyName,ne.macroName],color:Kee},{tag:[ne.function(ne.variableName),ne.labelName],color:OMt},{tag:[ne.color,ne.constant(ne.name),ne.standard(ne.name)],color:Xee},{tag:[ne.definition(ne.name),ne.separator],color:BA},{tag:[ne.typeName,ne.className,ne.number,ne.changed,ne.annotation,ne.modifier,ne.self,ne.namespace],color:vMt},{tag:[ne.operator,ne.operatorKeyword,ne.url,ne.escape,ne.regexp,ne.link,ne.special(ne.string)],color:xMt},{tag:[ne.meta,ne.comment],color:b8},{tag:ne.strong,fontWeight:"bold"},{tag:ne.emphasis,fontStyle:"italic"},{tag:ne.strikethrough,textDecoration:"line-through"},{tag:ne.link,color:b8,textDecoration:"underline"},{tag:ne.heading,fontWeight:"bold",color:Kee},{tag:[ne.atom,ne.bool,ne.special(ne.variableName)],color:Xee},{tag:[ne.processingInstruction,ne.string,ne.inserted],color:SMt},{tag:ne.invalid,color:wMt}]),_Mt=[TMt,uAe(AMt)];var NMt=$t.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),jMt=function(t){t===void 0&&(t={});var n=t,i=n.indentWithTab,r=i===void 0?!0:i,s=n.editable,a=s===void 0?!0:s,l=n.readOnly,c=l===void 0?!1:l,u=n.theme,d=u===void 0?"light":u,f=n.placeholder,h=f===void 0?"":f,p=n.basicSetup,g=p===void 0?!0:p,b=[];switch(r&&b.unshift(n1.of([_Dt])),g&&(typeof g=="boolean"?b.unshift(Gee()):b.unshift(Gee(g))),h&&b.unshift(kTt(h)),d){case"light":b.push(NMt);break;case"dark":b.push(_Mt);break;case"none":break;default:b.push(d);break}return a===!1&&b.push($t.editable.of(!1)),c&&b.push(Ti.readOnly.of(!0)),[...b]},RMt=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(t=>!t.empty)});class IMt{constructor(t,n){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=n,this.timeoutMS=n,this.callbacks.push(t)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var t=this.callbacks.slice();this.callbacks.length=0,t.forEach(n=>{try{n()}catch(i){console.error("TimeoutLatch callback error:",i)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class ete{constructor(){this.interval=null,this.latches=new Set}add(t){this.latches.add(t),this.start()}remove(t){this.latches.delete(t),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(t=>{t.tick(),t.isDone&&this.remove(t)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var Y5=null,PMt=()=>typeof window>"u"?new ete:(Y5||(Y5=new ete),Y5),DMt=$t.theme({"& .cm-scroller":{height:"100% !important"}}),tte=null,Z5=null;function MMt(e,t,n,i,r,s){if(!e&&!t&&!n&&!i&&!r&&!s)return null;var a=JSON.stringify({height:e,minHeight:t,maxHeight:n,width:i,minWidth:r,maxWidth:s});return a===tte||(tte=a,Z5=$t.theme({"&":{height:e,minHeight:t,maxHeight:n,width:i,minWidth:r,maxWidth:s}})),Z5}var nte=Jd.define(),LMt=200,$Mt=[];function FMt(e){var t=e.value,n=e.selection,i=e.onChange,r=e.onStatistics,s=e.onCreateEditor,a=e.onUpdate,l=e.extensions,c=l===void 0?$Mt:l,u=e.autoFocus,d=e.theme,f=d===void 0?"light":d,h=e.height,p=h===void 0?null:h,g=e.minHeight,b=g===void 0?null:g,v=e.maxHeight,y=v===void 0?null:v,x=e.width,O=x===void 0?null:x,w=e.minWidth,k=w===void 0?null:w,S=e.maxWidth,E=S===void 0?null:S,C=e.placeholder,N=C===void 0?"":C,_=e.editable,j=_===void 0?!0:_,A=e.readOnly,F=A===void 0?!1:A,T=e.indentWithTab,P=T===void 0?!0:T,R=e.basicSetup,L=R===void 0?!0:R,M=e.root,U=e.initialState,I=m.useState(),H=I[0],K=I[1],Q=m.useState(),q=Q[0],B=Q[1],ee=m.useState(),le=ee[0],se=ee[1],re=m.useState(()=>({current:null}))[0],ge=m.useState(()=>({current:null}))[0],W=MMt(p,b,y,O,k,E),X=$t.updateListener.of(Oe=>{if(Oe.docChanged&&typeof i=="function"&&!Oe.transactions.some($e=>$e.annotation(nte))){re.current?re.current.reset():(re.current=new IMt(()=>{if(ge.current){var $e=ge.current;ge.current=null,$e()}re.current=null},LMt),PMt().add(re.current));var Se=Oe.state.doc,lt=Se.toString();i(lt,Oe)}r&&r(RMt(Oe))}),ae=jMt({theme:f,editable:j,readOnly:F,placeholder:N,indentWithTab:P,basicSetup:L}),ue=[X,...W?[W]:[],DMt,...ae];return a&&typeof a=="function"&&ue.push($t.updateListener.of(a)),ue=ue.concat(c),m.useLayoutEffect(()=>{if(H&&!le){var Oe={doc:t,selection:n,extensions:ue},Se=U?Ti.fromJSON(U.json,Oe,U.fields):Ti.create(Oe);if(se(Se),!q){var lt=new $t({state:Se,parent:H,root:M});B(lt),s&&s(lt,Se)}}return()=>{q&&(se(void 0),B(void 0))}},[H,le]),m.useEffect(()=>{e.container&&K(e.container)},[e.container]),m.useEffect(()=>()=>{q&&(q.destroy(),B(void 0)),re.current&&(re.current.cancel(),re.current=null)},[q]),m.useEffect(()=>{u&&q&&q.focus()},[u,q]),m.useEffect(()=>{q&&q.dispatch({effects:Fn.reconfigure.of(ue)})},[f,c,p,b,y,O,k,E,N,j,F,P,L,i,a]),m.useEffect(()=>{if(t!==void 0){var Oe=q?q.state.doc.toString():"";if(q&&t!==Oe){var Se=re.current&&!re.current.isDone,lt=()=>{q&&t!==q.state.doc.toString()&&q.dispatch({changes:{from:0,to:q.state.doc.toString().length,insert:t||""},annotations:[nte.of(!0)]})};Se?ge.current=lt:lt()}}},[t,q]),{state:le,setState:se,view:q,setView:B,container:H,setContainer:K}}var BMt=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],tje=m.forwardRef((e,t)=>{var n=e.className,i=e.value,r=i===void 0?"":i,s=e.selection,a=e.extensions,l=a===void 0?[]:a,c=e.onChange,u=e.onStatistics,d=e.onCreateEditor,f=e.onUpdate,h=e.autoFocus,p=e.theme,g=p===void 0?"light":p,b=e.height,v=e.minHeight,y=e.maxHeight,x=e.width,O=e.minWidth,w=e.maxWidth,k=e.basicSetup,S=e.placeholder,E=e.indentWithTab,C=e.editable,N=e.readOnly,_=e.root,j=e.initialState,A=gPt(e,BMt),F=m.useRef(null),T=FMt({root:_,value:r,autoFocus:h,theme:g,height:b,minHeight:v,maxHeight:y,width:x,minWidth:O,maxWidth:w,basicSetup:k,placeholder:S,indentWithTab:E,editable:C,readOnly:N,selection:s,onChange:c,onStatistics:u,onCreateEditor:d,onUpdate:f,extensions:l,initialState:j}),P=T.state,R=T.view,L=T.container,M=T.setContainer;m.useImperativeHandle(t,()=>({editor:F.current,state:P,view:R}),[F,L,P,R]);var U=m.useCallback(H=>{F.current=H,M(H)},[M]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var I=typeof g=="string"?"cm-theme-"+g:"cm-theme";return o.jsx("div",d8({ref:U,className:""+I+(n?" "+n:"")},A))});tje.displayName="CodeMirror";function nje(e){const t=e.toLowerCase(),n=t.split("/").pop()??t,i=n.includes(".")?n.split(".").pop():"";return n==="dockerfile"||n.startsWith("dockerfile.")||n.endsWith(".dockerfile")?[dQ.define(mPt)]:i==="py"||i==="pyi"?[EIt()]:["ts","tsx","mts","cts"].includes(i??"")?[Z$({typescript:!0,jsx:i==="tsx"})]:["js","jsx","mjs","cjs"].includes(i??"")?[Z$({jsx:i==="jsx"})]:i==="json"||i==="jsonc"?[H_t()]:i==="yaml"||i==="yml"?[tPt()]:["md","markdown"].includes(i??"")?[sRt()]:[]}function zE({value:e,path:t,onChange:n,readOnly:i=!1,theme:r="light",lineNumberStart:s=1,height:a="100%",minHeight:l,maxHeight:c}){const u=m.useMemo(()=>[...nje(t),...s===1?[]:[K2e({formatNumber:d=>String(d+s-1)})]],[s,t]);return o.jsx(tje,{value:e,height:a,minHeight:l,maxHeight:c,theme:r,extensions:u,editable:!i,onChange:n,basicSetup:{lineNumbers:s===1,foldGutter:!0,highlightActiveLine:!0,highlightActiveLineGutter:!0,autocompletion:!1}})}const ije=Object.freeze(Object.defineProperty({__proto__:null,default:zE,languageFor:nje},Symbol.toStringTag,{value:"Module"}));function UMt(e){var s;const t=e.split(/\r?\n/);if(((s=t[0])==null?void 0:s.trim())!=="---")return{body:e,frontmatter:[]};const n=t.findIndex((a,l)=>l>0&&a.trim()==="---");if(n<0)return{body:e,frontmatter:[]};const i=yTe(t.slice(1,n).join(` +`,{label:"if",detail:"block",type:"keyword"}),ys("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),ys("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),ys("import ${module}",{label:"import",detail:"statement",type:"keyword"}),ys("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],kIt=SAe(K_e,mQ(OIt.concat(SIt)));function z5(e){let{node:t,pos:n}=e,i=e.lineIndent(n,-1),r=null;for(;;){let s=t.childBefore(n);if(s)if(s.name=="Comment")n=s.from;else if(s.name=="Body"||s.name=="MatchBody")e.baseIndentFor(s)+e.unit<=i&&(r=s),t=s;else if(s.name=="MatchClause")t=s;else if(s.type.is("Statement"))t=s;else break;else break}return r}function V5(e,t){let n=e.baseIndentFor(t),i=e.lineAt(e.pos,-1),r=i.from+i.text.length;return/^\s*($|#)/.test(i.text)&&e.node.ton?null:n+e.unit}const H5=jh.define({name:"python",parser:vIt.configure({props:[Hh.add({Body:e=>{var t;let n=/^\s*(#|$)/.test(e.textAfter)&&z5(e)||e.node;return(t=V5(e,n))!==null&&t!==void 0?t:e.continue()},MatchBody:e=>{var t;let n=z5(e);return(t=V5(e,n||e.node))!==null&&t!==void 0?t:e.continue()},IfStatement:e=>/^\s*(else:|elif )/.test(e.textAfter)?e.baseIndent:e.continue(),"ForStatement WhileStatement":e=>/^\s*else:/.test(e.textAfter)?e.baseIndent:e.continue(),TryStatement:e=>/^\s*(except[ :]|finally:|else:)/.test(e.textAfter)?e.baseIndent:e.continue(),MatchStatement:e=>/^\s*case /.test(e.textAfter)?e.baseIndent+e.unit:e.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":hv({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":hv({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":hv({closing:"]"}),MemberExpression:e=>e.baseIndent+e.unit,"String FormatString":()=>null,Script:e=>{var t;let n=z5(e);return(t=n&&V5(e,n))!==null&&t!==void 0?t:e.continue()}}),qh.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":LE,Body:(e,t)=>({from:e.from+1,to:e.to-(e.to==t.doc.length?0:1)}),"String FormatString":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function EIt(){return new Nm(H5,[H5.data.of({autocomplete:wIt}),H5.data.of({autocomplete:kIt})])}const ay=63,Nee=64,CIt=1,TIt=2,X_e=3,AIt=4,Y_e=5,_It=6,NIt=7,Z_e=65,jIt=66,RIt=8,IIt=9,PIt=10,DIt=11,MIt=12,J_e=13,LIt=19,$It=20,FIt=29,BIt=33,UIt=34,QIt=47,zIt=0,LQ=1,o8=2,bk=3,l8=4;class Ng{constructor(t,n,i){this.parent=t,this.depth=n,this.type=i,this.hash=(t?t.hash+t.hash<<8:0)+n+(n<<4)+i}}Ng.top=new Ng(null,-1,zIt);function qO(e,t){for(let n=0,i=t-e.pos-1;;i--,n++){let r=e.peek(i);if(Ih(r)||r==-1)return n}}function c8(e){return e==32||e==9}function Ih(e){return e==10||e==13}function eNe(e){return c8(e)||Ih(e)}function Vg(e){return e<0||eNe(e)}const VIt=new _I({start:Ng.top,reduce(e,t){return e.type==bk&&(t==$It||t==UIt)?e.parent:e},shift(e,t,n,i){if(t==X_e)return new Ng(e,qO(i,i.pos),LQ);if(t==Z_e||t==Y_e)return new Ng(e,qO(i,i.pos),o8);if(t==ay)return e.parent;if(t==LIt||t==BIt)return new Ng(e,0,bk);if(t==J_e&&e.type==l8)return e.parent;if(t==QIt){let r=/[1-9]/.exec(i.read(i.pos,n.pos));if(r)return new Ng(e,e.depth+ +r[0],l8)}return e},hash(e){return e.hash}});function fx(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&Vg(e.peek(n+3))}const HIt=new zs((e,t)=>{if(e.next==-1&&t.canShift(Nee))return e.acceptToken(Nee);let n=e.peek(-1);if((Ih(n)||n<0)&&t.context.type!=bk){if(fx(e,45))if(t.canShift(ay))e.acceptToken(ay);else return e.acceptToken(CIt,3);if(fx(e,46))if(t.canShift(ay))e.acceptToken(ay);else return e.acceptToken(TIt,3);let i=0;for(;e.next==32;)i++,e.advance();(i{if(t.context.type==bk){e.next==63&&(e.advance(),Vg(e.next)&&e.acceptToken(NIt));return}if(e.next==45)e.advance(),Vg(e.next)&&e.acceptToken(t.context.type==LQ&&t.context.depth==qO(e,e.pos-1)?AIt:X_e);else if(e.next==63)e.advance(),Vg(e.next)&&e.acceptToken(t.context.type==o8&&t.context.depth==qO(e,e.pos-1)?_It:Y_e);else{let n=e.pos;for(;;)if(c8(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)tNe(e);else if(e.next==38)u8(e);else if(e.next==42){u8(e);break}else if(e.next==39||e.next==34){if($Q(e,!0))break;return}else if(e.next==91||e.next==123){if(!GIt(e))return;break}else{nNe(e,!0,!1,0);break}for(;c8(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(FIt))return;let i=e.peek(1);Vg(i)&&e.acceptTokenTo(t.context.type==o8&&t.context.depth==qO(e,n)?jIt:Z_e,n)}}},{contextual:!0});function WIt(e){return e>32&&e<127&&e!=34&&e!=37&&e!=44&&e!=60&&e!=62&&e!=92&&e!=94&&e!=96&&e!=123&&e!=124&&e!=125}function jee(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function Ree(e,t){return e.next==37?(e.advance(),jee(e.next)&&e.advance(),jee(e.next)&&e.advance(),!0):WIt(e.next)||t&&e.next==44?(e.advance(),!0):!1}function tNe(e){if(e.advance(),e.next==60){for(e.advance();;)if(!Ree(e,!0)){e.next==62&&e.advance();break}}else for(;Ree(e,!1););}function u8(e){for(e.advance();!Vg(e.next)&&ej(e.next)!="f";)e.advance()}function $Q(e,t){let n=e.next,i=!1,r=e.pos;for(e.advance();;){let s=e.next;if(s<0)break;if(e.advance(),s==n)if(s==39)if(e.next==39)e.advance();else break;else break;else if(s==92&&n==34)e.next>=0&&e.advance();else if(Ih(s)){if(t)return!1;i=!0}else if(t&&e.pos>=r+1024)return!1}return!i}function GIt(e){for(let t=[],n=e.pos+1024;;)if(e.next==91||e.next==123)t.push(e.next),e.advance();else if(e.next==39||e.next==34){if(!$Q(e,!0))return!1}else if(e.next==93||e.next==125){if(t[t.length-1]!=e.next-2)return!1;if(t.pop(),e.advance(),!t.length)return!0}else{if(e.next<0||e.pos>n||Ih(e.next))return!1;e.advance()}}const KIt="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function ej(e){return e<33?"u":e>125?"s":KIt[e-33]}function q5(e,t){let n=ej(e);return n!="u"&&!(t&&n=="f")}function nNe(e,t,n,i){if(ej(e.next)=="s"||(e.next==63||e.next==58||e.next==45)&&q5(e.peek(1),n))e.advance();else return!1;let r=e.pos;for(;;){let s=e.next,a=0,l=i+1;for(;eNe(s);){if(Ih(s)){if(t)return!1;l=0}else l++;s=e.peek(++a)}if(!(s>=0&&(s==58?q5(e.peek(a+1),n):s==35?e.peek(a-1)!=32:q5(s,n)))||!n&&l<=i||l==0&&!n&&(fx(e,45,a)||fx(e,46,a)))break;if(t&&ej(s)=="f")return!1;for(let u=a;u>=0;u--)e.advance();if(t&&e.pos>r+1024)return!1}return!0}const XIt=new zs((e,t)=>{if(e.next==33)tNe(e),e.acceptToken(MIt);else if(e.next==38||e.next==42){let n=e.next==38?PIt:DIt;u8(e),e.acceptToken(n)}else e.next==39||e.next==34?($Q(e,!1),e.acceptToken(IIt)):nNe(e,!1,t.context.type==bk,t.context.depth)&&e.acceptToken(RIt)}),YIt=new zs((e,t)=>{let n=t.context.type==l8?t.context.depth:-1,i=e.pos;e:for(;;){let r=0,s=e.next;for(;s==32;)s=e.peek(++r);if(!r&&(fx(e,45,r)||fx(e,46,r))||!Ih(s)&&(n<0&&(n=Math.max(t.context.depth+1,r)),rYAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:VIt,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[ZIt],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[HIt,qIt,XIt,YIt,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),ePt=jh.define({name:"yaml",parser:JIt.configure({props:[Hh.add({Stream:e=>{for(let t=e.node.resolve(e.pos,-1);t&&t.to>=e.pos;t=t.parent){if(t.name=="BlockLiteralContent"&&t.frome.pos)return null}}return null},FlowMapping:hv({closing:"}"}),FlowSequence:hv({closing:"]"})}),qh.add({"FlowMapping FlowSequence":LE,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function tPt(){return new Nm(ePt)}function nPt(e){iNe(e,"start");var t={},n=e.languageData||{},i=!1;for(var r in e)if(r!=n&&e.hasOwnProperty(r))for(var s=t[r]=[],a=e[r],l=0;l2&&a.token&&typeof a.token!="string"){n.pending=[];for(var u=2;u-1)return null;var r=n.indent.length-1,s=e[n.state];e:for(;;){for(var a=0;a{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),i=BQ(e.state,n.from);return i.line?yPt(e):i.block?xPt(e):!1};function FQ(e,t){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=e(t,n);return r?(i(n.update(r)),!0):!1}}const yPt=FQ(SPt,0),vPt=FQ(lNe,0),xPt=FQ((e,t)=>lNe(e,t,OPt(t)),0);function BQ(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const rw=50;function wPt(e,{open:t,close:n},i,r){let s=e.sliceDoc(i-rw,i),a=e.sliceDoc(r,r+rw),l=/\s*$/.exec(s)[0].length,c=/^\s*/.exec(a)[0].length,u=s.length-l;if(s.slice(u-t.length,u)==t&&a.slice(c,c+n.length)==n)return{open:{pos:i-l,margin:l&&1},close:{pos:r+c,margin:c&&1}};let d,f;r-i<=2*rw?d=f=e.sliceDoc(i,r):(d=e.sliceDoc(i,i+rw),f=e.sliceDoc(r-rw,r));let h=/^\s*/.exec(d)[0].length,p=/\s*$/.exec(f)[0].length,g=f.length-p-n.length;return d.slice(h,h+t.length)==t&&f.slice(g,g+n.length)==n?{open:{pos:i+h+t.length,margin:/\s/.test(d.charAt(h+t.length))?1:0},close:{pos:r-p-n.length,margin:/\s/.test(f.charAt(g-1))?1:0}}:null}function OPt(e){let t=[];for(let n of e.selection.ranges){let i=e.doc.lineAt(n.from),r=n.to<=i.to?i:e.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:e.doc.lineAt(n.to-1));let s=t.length-1;s>=0&&t[s].to>i.from?t[s].to=r.to:t.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return t}function lNe(e,t,n=t.selection.ranges){let i=n.map(s=>BQ(t,s.from).block);if(!i.every(s=>s))return null;let r=n.map((s,a)=>wPt(t,i[a],s.from,s.to));if(e!=2&&!r.every(s=>s))return{changes:t.changes(n.map((s,a)=>r[a]?[]:[{from:s.from,insert:i[a].open+" "},{from:s.to,insert:" "+i[a].close}]))};if(e!=1&&r.some(s=>s)){let s=[];for(let a=0,l;ar&&(s==a||a>f.from)){r=f.from;let h=/^\s*/.exec(f.text)[0].length,p=h==f.length,g=f.text.slice(h,h+u.length)==u?h:-1;hs.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:c,indent:u,empty:d,single:f}of i)(f||!d)&&s.push({from:l.from+u,insert:c+" "});let a=t.changes(s);return{changes:a,selection:t.selection.map(a,1)}}else if(e!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:a,comment:l,token:c}of i)if(l>=0){let u=a.from+l,d=u+c.length;a.text[d-a.from]==" "&&d++,s.push({from:u,to:d})}return{changes:s}}return null}const f8=Jd.define(),kPt=Jd.define(),EPt=Zt.define(),cNe=Zt.define({combine(e){return ef(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(i,r)=>t(i,r)||n(i,r)})}}),uNe=ro.define({create(){return Nd.empty},update(e,t){let n=t.state.facet(cNe),i=t.annotation(f8);if(i){let c=pl.fromTransaction(t,i.selection),u=i.side,d=u==0?e.undone:e.done;return c?d=tj(d,d.length,n.minDepth,c):d=hNe(d,t.startState.selection),new Nd(u==0?i.rest:d,u==0?d:i.rest)}let r=t.annotation(kPt);if((r=="full"||r=="before")&&(e=e.isolate()),t.annotation(Js.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let s=pl.fromTransaction(t),a=t.annotation(Js.time),l=t.annotation(Js.userEvent);return s?e=e.addChanges(s,a,l,n,t):t.selection&&(e=e.addSelection(t.startState.selection,a,l,n.newGroupDelay)),(r=="full"||r=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new Nd(e.done.map(pl.fromJSON),e.undone.map(pl.fromJSON))}});function CPt(e={}){return[uNe,cNe.of(e),zt.domEventHandlers({beforeinput(t,n){let i=t.inputType=="historyUndo"?dNe:t.inputType=="historyRedo"?h8:null;return i?(t.preventDefault(),i(n)):!1}})]}function II(e,t){return function({state:n,dispatch:i}){if(!t&&n.readOnly)return!1;let r=n.field(uNe,!1);if(!r)return!1;let s=r.pop(e,n,t);return s?(i(s),!0):!1}}const dNe=II(0,!1),h8=II(1,!1),TPt=II(0,!0),APt=II(1,!0);class pl{constructor(t,n,i,r,s){this.changes=t,this.effects=n,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(t){return new pl(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,i;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(t){return new pl(t.changes&&ma.fromJSON(t.changes),[],t.mapped&&Ld.fromJSON(t.mapped),t.startSelection&&tt.fromJSON(t.startSelection),t.selectionsAfter.map(tt.fromJSON))}static fromTransaction(t,n){let i=Xc;for(let r of t.startState.facet(EPt)){let s=r(t);s.length&&(i=i.concat(s))}return!i.length&&t.changes.empty?null:new pl(t.changes.invert(t.startState.doc),i,void 0,n||t.startState.selection,Xc)}static selection(t){return new pl(void 0,Xc,void 0,void 0,t)}}function tj(e,t,n,i){let r=t+1>n+20?t-n-1:0,s=e.slice(r,t);return s.push(i),s}function _Pt(e,t){let n=[],i=!1;return e.iterChangedRanges((r,s)=>n.push(r,s)),t.iterChangedRanges((r,s,a,l)=>{for(let c=0;c=u&&a<=d&&(i=!0)}}),i}function NPt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,i)=>n.empty!=t.ranges[i].empty).length===0}function fNe(e,t){return e.length?t.length?e.concat(t):e:t}const Xc=[],jPt=200;function hNe(e,t){if(e.length){let n=e[e.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-jPt));return i.length&&i[i.length-1].eq(t)?e:(i.push(t),tj(e,e.length-1,1e9,n.setSelAfter(i)))}else return[pl.selection([t])]}function RPt(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function W5(e,t){if(!e.length)return e;let n=e.length,i=Xc;for(;n;){let r=IPt(e[n-1],t,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=e.slice(0,n);return s[n-1]=r,s}else t=r.mapped,n--,i=r.selectionsAfter}return i.length?[pl.selection(i)]:Xc}function IPt(e,t,n){let i=fNe(e.selectionsAfter.length?e.selectionsAfter.map(l=>l.map(t)):Xc,n);if(!e.changes)return pl.selection(i);let r=e.changes.map(t),s=t.mapDesc(e.changes,!0),a=e.mapped?e.mapped.composeDesc(s):s;return new pl(r,Fn.mapEffects(e.effects,t),a,e.startSelection.map(s),i)}const PPt=/^(input\.type|delete)($|\.)/;class Nd{constructor(t,n,i=0,r=void 0){this.done=t,this.undone=n,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new Nd(this.done,this.undone):this}addChanges(t,n,i,r,s){let a=this.done,l=a[a.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!i||PPt.test(i))&&(!l.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?e.moveByChar(n,t):PI(n,t))}function So(e){return e.textDirectionAt(e.state.selection.main.head)==Cr.LTR}const mNe=e=>pNe(e,!So(e)),gNe=e=>pNe(e,So(e));function bNe(e,t){return Ju(e,n=>n.empty?e.moveByGroup(n,t):PI(n,t))}const MPt=e=>bNe(e,!So(e)),LPt=e=>bNe(e,So(e));function $Pt(e,t,n){if(t.type.prop(n))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function DI(e,t,n){let i=Or(e).resolveInner(t.head),r=n?Ln.closedBy:Ln.openedBy;for(let c=t.head;;){let u=n?i.childAfter(c):i.childBefore(c);if(!u)break;$Pt(e,u,r)?i=u:c=n?u.to:u.from}let s=i.type.prop(r),a,l;return s&&(a=n?_d(e,i.from,1):_d(e,i.to,-1))&&a.matched?l=n?a.end.to:a.end.from:l=n?i.to:i.from,tt.cursor(l,n?-1:1)}const FPt=e=>Ju(e,t=>DI(e.state,t,!So(e))),BPt=e=>Ju(e,t=>DI(e.state,t,So(e)));function yNe(e,t){return Ju(e,n=>{if(!n.empty)return PI(n,t);let i=e.moveVertically(n,t);return i.head!=n.head?i:e.moveToLineBoundary(n,t)})}const vNe=e=>yNe(e,!1),xNe=e=>yNe(e,!0);function wNe(e){let t=e.scrollDOM.clientHeighta.empty?e.moveVertically(a,t,n.height):PI(a,t));if(r.eq(i.selection))return!1;let s;if(n.selfScroll){let a=e.coordsAtPos(i.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),c=l.top+n.marginTop,u=l.bottom-n.marginBottom;a&&a.top>c&&a.bottomONe(e,!1),p8=e=>ONe(e,!0);function Hm(e,t,n){let i=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?i.to:i.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==i.from&&i.length){let s=/^\s*/.exec(e.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&t.head!=i.from+s&&(r=tt.cursor(i.from+s))}return r}const UPt=e=>Ju(e,t=>Hm(e,t,!0)),QPt=e=>Ju(e,t=>Hm(e,t,!1)),zPt=e=>Ju(e,t=>Hm(e,t,!So(e))),VPt=e=>Ju(e,t=>Hm(e,t,So(e))),HPt=e=>Ju(e,t=>tt.cursor(e.lineBlockAt(t.head).from,1)),qPt=e=>Ju(e,t=>tt.cursor(e.lineBlockAt(t.head).to,-1));function WPt(e,t,n){let i=!1,r=s1(e.selection,s=>{let a=_d(e,s.head,-1)||_d(e,s.head,1)||s.head>0&&_d(e,s.head-1,1)||s.headWPt(e,t);function lu(e,t,n){let i=s1(e.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=t&&(r=tt.range(r.head,r.anchor));let s=n(r);return tt.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return i.eq(e.state.selection)?!1:(e.dispatch(Zu(e.state,i)),!0)}function SNe(e,t){return lu(e,t,n=>e.moveByChar(n,t))}const kNe=e=>SNe(e,!So(e)),ENe=e=>SNe(e,So(e));function CNe(e,t){return lu(e,t,n=>e.moveByGroup(n,t))}const KPt=e=>CNe(e,!So(e)),XPt=e=>CNe(e,So(e)),YPt=e=>{let t=!So(e);return lu(e,t,n=>DI(e.state,n,t))},ZPt=e=>{let t=So(e);return lu(e,t,n=>DI(e.state,n,t))};function TNe(e,t){return lu(e,t,n=>e.moveVertically(n,t))}const ANe=e=>TNe(e,!1),_Ne=e=>TNe(e,!0);function NNe(e,t){return lu(e,t,n=>e.moveVertically(n,t,wNe(e).height))}const Pee=e=>NNe(e,!1),Dee=e=>NNe(e,!0),JPt=e=>lu(e,!0,t=>Hm(e,t,!0)),eDt=e=>lu(e,!1,t=>Hm(e,t,!1)),tDt=e=>{let t=!So(e);return lu(e,t,n=>Hm(e,n,t))},nDt=e=>{let t=So(e);return lu(e,t,n=>Hm(e,n,t))},iDt=e=>lu(e,!1,t=>tt.cursor(e.lineBlockAt(t.head).from)),rDt=e=>lu(e,!0,t=>tt.cursor(e.lineBlockAt(t.head).to)),Mee=({state:e,dispatch:t})=>(t(Zu(e,{anchor:0})),!0),Lee=({state:e,dispatch:t})=>(t(Zu(e,{anchor:e.doc.length})),!0),$ee=({state:e,dispatch:t})=>(t(Zu(e,{anchor:e.selection.main.anchor,head:0})),!0),Fee=({state:e,dispatch:t})=>(t(Zu(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),sDt=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),aDt=({state:e,dispatch:t})=>{let n=MI(e).map(({from:i,to:r})=>tt.range(i,Math.min(r+1,e.doc.length)));return t(e.update({selection:tt.create(n),userEvent:"select"})),!0},oDt=({state:e,dispatch:t})=>{let n=s1(e.selection,i=>{let r=Or(e),s=r.resolveStack(i.from,1);if(i.empty){let a=r.resolveStack(i.from,-1);a.node.from>=s.node.from&&a.node.to<=s.node.to&&(s=a)}for(let a=s;a;a=a.next){let{node:l}=a;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&a.next)return tt.range(l.to,l.from)}return i});return n.eq(e.selection)?!1:(t(Zu(e,n)),!0)};function jNe(e,t){let{state:n}=e,i=n.selection,r=n.selection.ranges.slice();for(let s of n.selection.ranges){let a=n.doc.lineAt(s.head);if(t?a.to0)for(let l=s;;){let c=e.moveVertically(l,t);if(c.heada.to){r.some(u=>u.head==c.head)||r.push(c);break}else{if(c.head==l.head)break;l=c}}}return r.length==i.ranges.length?!1:(e.dispatch(Zu(n,tt.create(r,r.length-1))),!0)}const lDt=e=>jNe(e,!1),cDt=e=>jNe(e,!0),uDt=({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=tt.create([n.main]):n.main.empty||(i=tt.create([tt.cursor(n.main.head)])),i?(t(Zu(e,i)),!0):!1};function UE(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:i}=e,r=i.changeByRange(s=>{let{from:a,to:l}=s;if(a==l){let c=t(s);ca&&(n="delete.forward",c=h2(e,c,!0)),a=Math.min(a,c),l=Math.max(l,c)}else a=h2(e,a,!1),l=h2(e,l,!0);return a==l?{range:s}:{changes:{from:a,to:l},range:tt.cursor(a,ar(e)))i.between(t,t,(r,s)=>{rt&&(t=n?s:r)});return t}const RNe=(e,t,n)=>UE(e,i=>{let r=i.from,{state:s}=e,a=s.doc.lineAt(r),l,c;if(n&&!t&&r>a.from&&rRNe(e,!1,!0),INe=e=>RNe(e,!0,!1),PNe=(e,t)=>UE(e,n=>{let i=n.head,{state:r}=e,s=r.doc.lineAt(i),a=r.charCategorizer(i);for(let l=null;;){if(i==(t?s.to:s.from)){i==n.head&&s.number!=(t?r.doc.lines:1)&&(i+=t?1:-1);break}let c=$a(s.text,i-s.from,t)+s.from,u=s.text.slice(Math.min(i,c)-s.from,Math.max(i,c)-s.from),d=a(u);if(l!=null&&d!=l)break;(u!=" "||i!=n.head)&&(l=d),i=c}return i}),DNe=e=>PNe(e,!1),dDt=e=>PNe(e,!0),fDt=e=>UE(e,t=>{let n=e.lineBlockAt(t.head).to;return t.headUE(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),pDt=e=>UE(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head{if(e.readOnly)return!1;let n=e.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:Gi.of(["",""])},range:tt.cursor(i.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},gDt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(i=>{if(!i.empty||i.from==0||i.from==e.doc.length)return{range:i};let r=i.from,s=e.doc.lineAt(r),a=r==s.from?r-1:$a(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:$a(s.text,r-s.from,!0)+s.from;return{changes:{from:a,to:l,insert:e.doc.slice(r,l).append(e.doc.slice(a,r))},range:tt.cursor(l)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function MI(e){let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.from),s=e.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=e.doc.lineAt(i.to-1)),n>=r.number){let a=t[t.length-1];a.to=s.to,a.ranges.push(i)}else t.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return t}function MNe(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let s of MI(e)){if(n?s.to==e.doc.length:s.from==0)continue;let a=e.doc.lineAt(n?s.to+1:s.from-1),l=a.length+1;if(n){i.push({from:s.to,to:a.to},{from:s.from,insert:a.text+e.lineBreak});for(let c of s.ranges)r.push(tt.range(Math.min(e.doc.length,c.anchor+l),Math.min(e.doc.length,c.head+l)))}else{i.push({from:a.from,to:s.from},{from:s.to,insert:e.lineBreak+a.text});for(let c of s.ranges)r.push(tt.range(c.anchor-l,c.head-l))}}return i.length?(t(e.update({changes:i,scrollIntoView:!0,selection:tt.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const bDt=({state:e,dispatch:t})=>MNe(e,t,!1),yDt=({state:e,dispatch:t})=>MNe(e,t,!0);function LNe(e,t,n){if(e.readOnly)return!1;let i=[];for(let s of MI(e))n?i.push({from:s.from,insert:e.doc.slice(s.from,s.to)+e.lineBreak}):i.push({from:s.to,insert:e.lineBreak+e.doc.slice(s.from,s.to)});let r=e.changes(i);return t(e.update({changes:r,selection:e.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const vDt=({state:e,dispatch:t})=>LNe(e,t,!1),xDt=({state:e,dispatch:t})=>LNe(e,t,!0),wDt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(MI(t).map(({from:r,to:s})=>(r>0?r--:s{let s;if(e.lineWrapping){let a=e.lineBlockAt(r.head),l=e.coordsAtPos(r.head,r.assoc||1);l&&(s=a.bottom+e.documentTop-l.bottom+e.defaultLineHeight/2)}return e.moveVertically(r,!0,s)}).map(n);return e.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function ODt(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Or(e).resolveInner(t),i=n.childBefore(t),r=n.childAfter(t),s;return i&&r&&i.to<=t&&r.from>=t&&(s=i.type.prop(Ln.closedBy))&&s.indexOf(r.name)>-1&&e.doc.lineAt(i.to).from==e.doc.lineAt(r.from).from&&!/\S/.test(e.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}const Bee=$Ne(!1),SDt=$Ne(!0);function $Ne(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange(r=>{let{from:s,to:a}=r,l=t.doc.lineAt(s),c=!e&&s==a&&ODt(t,s);e&&(s=a=(a<=l.to?l:t.doc.lineAt(a)).to);let u=new TI(t,{simulateBreak:s,simulateDoubleBreak:!!c}),d=cQ(u,s);for(d==null&&(d=Uu(/^\s*/.exec(t.doc.lineAt(s).text)[0],t.tabSize));al.from&&s{let r=[];for(let a=i.from;a<=i.to;){let l=e.doc.lineAt(a);l.number>n&&(i.empty||i.to>l.from)&&(t(l,r,i),n=l.number),a=l.to+1}let s=e.changes(r);return{changes:r,range:tt.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const kDt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),i=new TI(e,{overrideIndentation:s=>{let a=n[s];return a??-1}}),r=UQ(e,(s,a,l)=>{let c=cQ(i,s.from);if(c==null)return;/\S/.test(s.text)||(c=0);let u=/^\s*/.exec(s.text)[0],d=ok(e,c);(u!=d||l.frome.readOnly?!1:(t(e.update(UQ(e,(n,i)=>{i.push({from:n.from,insert:e.facet(i1)})}),{userEvent:"input.indent"})),!0),BNe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(UQ(e,(n,i)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let s=Uu(r,e.tabSize),a=0,l=ok(e,Math.max(0,s-Pb(e)));for(;a(e.setTabFocusMode(),!0),CDt=[{key:"Ctrl-b",run:mNe,shift:kNe,preventDefault:!0},{key:"Ctrl-f",run:gNe,shift:ENe},{key:"Ctrl-p",run:vNe,shift:ANe},{key:"Ctrl-n",run:xNe,shift:_Ne},{key:"Ctrl-a",run:HPt,shift:iDt},{key:"Ctrl-e",run:qPt,shift:rDt},{key:"Ctrl-d",run:INe},{key:"Ctrl-h",run:m8},{key:"Ctrl-k",run:fDt},{key:"Ctrl-Alt-h",run:DNe},{key:"Ctrl-o",run:mDt},{key:"Ctrl-t",run:gDt},{key:"Ctrl-v",run:p8}],TDt=[{key:"ArrowLeft",run:mNe,shift:kNe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:MPt,shift:KPt,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:zPt,shift:tDt,preventDefault:!0},{key:"ArrowRight",run:gNe,shift:ENe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:LPt,shift:XPt,preventDefault:!0},{mac:"Cmd-ArrowRight",run:VPt,shift:nDt,preventDefault:!0},{key:"ArrowUp",run:vNe,shift:ANe,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Mee,shift:$ee},{mac:"Ctrl-ArrowUp",run:Iee,shift:Pee},{key:"ArrowDown",run:xNe,shift:_Ne,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Lee,shift:Fee},{mac:"Ctrl-ArrowDown",run:p8,shift:Dee},{key:"PageUp",run:Iee,shift:Pee},{key:"PageDown",run:p8,shift:Dee},{key:"Home",run:QPt,shift:eDt,preventDefault:!0},{key:"Mod-Home",run:Mee,shift:$ee},{key:"End",run:UPt,shift:JPt,preventDefault:!0},{key:"Mod-End",run:Lee,shift:Fee},{key:"Enter",run:Bee,shift:Bee},{key:"Mod-a",run:sDt},{key:"Backspace",run:m8,shift:m8,preventDefault:!0},{key:"Delete",run:INe,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:DNe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:dDt,preventDefault:!0},{mac:"Mod-Backspace",run:hDt,preventDefault:!0},{mac:"Mod-Delete",run:pDt,preventDefault:!0}].concat(CDt.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),ADt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:FPt,shift:YPt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:BPt,shift:ZPt},{key:"Alt-ArrowUp",run:bDt},{key:"Shift-Alt-ArrowUp",run:vDt},{key:"Alt-ArrowDown",run:yDt},{key:"Shift-Alt-ArrowDown",run:xDt},{key:"Mod-Alt-ArrowUp",run:lDt},{key:"Mod-Alt-ArrowDown",run:cDt},{key:"Escape",run:uDt},{key:"Mod-Enter",run:SDt},{key:"Alt-l",mac:"Ctrl-l",run:aDt},{key:"Mod-i",run:oDt,preventDefault:!0},{key:"Mod-[",run:BNe},{key:"Mod-]",run:FNe},{key:"Mod-Alt-\\",run:kDt},{key:"Shift-Mod-k",run:wDt},{key:"Shift-Mod-\\",run:GPt},{key:"Mod-/",run:bPt},{key:"Alt-A",run:vPt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:EDt}].concat(TDt),_Dt={key:"Tab",run:FNe,shift:BNe},Uee=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class hx{constructor(t,n,i=0,r=t.length,s,a){this.test=a,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,r),this.bufferStart=i,this.normalize=s?l=>s(Uee(l)):Uee,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ol(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let n=zU(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=vd(t);let r=this.normalize(n);if(r.length)for(let s=0,a=i,l=!0;;s++){let c=r.charCodeAt(s),u=this.match(c,a,l,this.bufferPos+this.bufferStart,s==r.length-1);if(u)return this.value=u,this;if(s==r.length-1)break;l&&sthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let i=this.curLineStart+n.index,r=i+n[0].length;if(this.matchPos=nj(this.text,r+(i==r?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,r,n)))return this.value={from:i,to:r,precise:!0,match:n},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||r.to<=n){let l=new bv(n,t.sliceString(n,i));return G5.set(t,l),l}if(r.from==n&&r.to==i)return r;let{text:s,from:a}=r;return a>n&&(s=t.sliceString(n,a)+s,a=n),r.to=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let i=this.flat.from+n.index,r=i+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,r,n)))return this.value={from:i,to:r,precise:!0,match:n},this.matchPos=nj(this.text,r+(i==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=bv.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(QNe.prototype[Symbol.iterator]=zNe.prototype[Symbol.iterator]=function(){return this});function NDt(e){try{return new RegExp(e,QQ),!0}catch{return!1}}function nj(e,t){if(t>=e.length)return t;let n=e.lineAt(t),i;for(;t=56320&&i<57344;)t++;return t}const jDt=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:i,result:r}=QTt(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:t.phrase("go")});return r.then(s=>{let a=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!a){e.dispatch({effects:i});return}let l=t.doc.lineAt(t.selection.main.head),[,c,u,d,f]=a,h=d?+d.slice(1):0,p=u?+u:l.number;if(u&&f){let v=p/100;c&&(v=v*(c=="-"?-1:1)+l.number/t.doc.lines),p=Math.round(t.doc.lines*v)}else u&&c&&(p=p*(c=="-"?-1:1)+l.number);let g=t.doc.line(Math.max(1,Math.min(t.doc.lines,p))),b=tt.cursor(g.from+Math.max(0,Math.min(h,g.length)));e.dispatch({effects:[i,zt.scrollIntoView(b.from,{y:"center"})],selection:b})}),!0},RDt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},IDt=Zt.define({combine(e){return ef(e,RDt,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function PDt(e){return[FDt,$Dt]}const DDt=gn.mark({class:"cm-selectionMatch"}),MDt=gn.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Qee(e,t,n,i){return(n==0||e(t.sliceDoc(n-1,n))!=ns.Word)&&(i==t.doc.length||e(t.sliceDoc(i,i+1))!=ns.Word)}function LDt(e,t,n,i){return e(t.sliceDoc(n,n+1))==ns.Word&&e(t.sliceDoc(i-1,i))==ns.Word}const $Dt=Ts.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(IDt),{state:n}=e,i=n.selection;if(i.ranges.length>1)return gn.none;let r=i.main,s,a=null;if(r.empty){if(!t.highlightWordAroundCursor)return gn.none;let c=n.wordAt(r.head);if(!c)return gn.none;a=n.charCategorizer(r.head),s=n.sliceDoc(c.from,c.to)}else{let c=r.to-r.from;if(c200)return gn.none;if(t.wholeWords){if(s=n.sliceDoc(r.from,r.to),a=n.charCategorizer(r.head),!(Qee(a,n,r.from,r.to)&&LDt(a,n,r.from,r.to)))return gn.none}else if(s=n.sliceDoc(r.from,r.to),!s)return gn.none}let l=[];for(let c of e.visibleRanges){let u=new hx(n.doc,s,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!a||Qee(a,n,d,f))&&(r.empty&&d<=r.from&&f>=r.to?l.push(MDt.range(d,f)):(d>=r.to||f<=r.from)&&l.push(DDt.range(d,f)),l.length>t.maxMatches))return gn.none}}return gn.set(l)}},{decorations:e=>e.decorations}),FDt=zt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),BDt=({state:e,dispatch:t})=>{let{selection:n}=e,i=tt.create(n.ranges.map(r=>e.wordAt(r.head)||tt.cursor(r.head)),n.mainIndex);return i.eq(n)?!1:(t(e.update({selection:i})),!0)};function UDt(e,t){let{main:n,ranges:i}=e.selection,r=e.wordAt(n.head),s=r&&r.from==n.from&&r.to==n.to;for(let a=!1,l=new hx(e.doc,t,i[i.length-1].to);;)if(l.next(),l.done){if(a)return null;l=new hx(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),a=!0}else{if(a&&i.some(c=>c.from==l.value.from))continue;if(s){let c=e.wordAt(l.value.from);if(!c||c.from!=l.value.from||c.to!=l.value.to)continue}return l.value}}const QDt=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(s=>s.from===s.to))return BDt({state:e,dispatch:t});let i=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(s=>e.sliceDoc(s.from,s.to)!=i))return!1;let r=UDt(e,i);return r?(t(e.update({selection:e.selection.addRange(tt.range(r.from,r.to),!1),effects:zt.scrollIntoView(r.to)})),!0):!1},a1=Zt.define({combine(e){return ef(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new nMt(t),scrollToMatch:t=>zt.scrollIntoView(t)})}});class VNe{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||NDt(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord,this.test=t.test}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(n,i)=>i=="n"?` +`:i=="r"?"\r":i=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord&&this.test==t.test}create(){return this.regexp?new GDt(this):new HDt(this)}getCursor(t,n=0,i){let r=t.doc?t:Ti.create({doc:t});return i==null&&(i=r.doc.length),this.regexp?ly(this,r,n,i):oy(this,r,n,i)}}class HNe{constructor(t){this.spec=t}}function zDt(e,t,n){return(i,r,s,a)=>{if(n&&!n(i,r,s,a))return!1;let l=i>=a&&r<=a+s.length?s.slice(i-a,r-a):t.doc.sliceString(i,r);return e(l,t,i,r)}}function oy(e,t,n,i){let r;return e.wholeWord&&(r=VDt(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(r=zDt(e.test,t,r)),new hx(t.doc,e.unquoted,n,i,e.caseSensitive?void 0:s=>s.toLowerCase(),r)}function VDt(e,t){return(n,i,r,s)=>((s>n||s+r.length=n)return null;r.push(i.value)}return r}highlight(t,n,i,r){let s=oy(this.spec,t,Math.max(0,n-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,t.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}function qDt(e,t,n){return(i,r,s)=>(!n||n(i,r,s))&&e(s[0],t,i,r)}function ly(e,t,n,i){let r;return e.wholeWord&&(r=WDt(t.charCategorizer(t.selection.main.head))),e.test&&(r=qDt(e.test,t,r)),new QNe(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:r},n,i)}function ij(e,t){return e.slice($a(e,t,!1),t)}function rj(e,t){return e.slice(t,$a(e,t))}function WDt(e){return(t,n,i)=>!i[0].length||(e(ij(i.input,i.index))!=ns.Word||e(rj(i.input,i.index))!=ns.Word)&&(e(rj(i.input,i.index+i[0].length))!=ns.Word||e(ij(i.input,i.index+i[0].length))!=ns.Word)}class GDt extends HNe{nextMatch(t,n,i){let r=ly(this.spec,t,i,t.doc.length).next();return r.done&&(r=ly(this.spec,t,0,n).next()),r.done?null:r.value}prevMatchInRange(t,n,i){for(let r=1;;r++){let s=Math.max(n,i-r*1e4),a=ly(this.spec,t,s,i),l=null;for(;!a.next().done;)l=a.value;if(l&&(s==n||l.from>s+10))return l;if(s==n)return null}}prevMatch(t,n,i){return this.prevMatchInRange(t,0,n)||this.prevMatchInRange(t,i,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,i)=>{if(i=="&")return t.match[0];if(i=="$")return"$";for(let r=i.length;r>0;r--){let s=+i.slice(0,r);if(s>0&&s=n)return null;r.push(i.value)}return r}highlight(t,n,i,r){let s=ly(this.spec,t,Math.max(0,n-250),Math.min(i+250,t.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}const yk=Fn.define(),zQ=Fn.define(),sm=ro.define({create(e){return new K5(g8(e).create(),null)},update(e,t){for(let n of t.effects)n.is(yk)?e=new K5(n.value.create(),e.panel):n.is(zQ)&&(e=new K5(e.query,n.value?VQ:null));return e},provide:e=>sk.from(e,t=>t.panel)});class K5{constructor(t,n){this.query=t,this.panel=n}}const KDt=gn.mark({class:"cm-searchMatch"}),XDt=gn.mark({class:"cm-searchMatch cm-searchMatch-selected"}),YDt=Ts.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(sm))}update(e){let t=e.state.field(sm);(t!=e.startState.field(sm)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return gn.none;let{view:n}=this,i=new Ah;for(let r=0,s=n.visibleRanges,a=s.length;rs[r+1].from-2*250;)c=s[++r].to;e.highlight(n.state,l,c,(u,d)=>{let f=n.state.selection.ranges.some(h=>h.from==u&&h.to==d);i.add(u,d,f?XDt:KDt)})}return i.finish()}},{decorations:e=>e.decorations});function QE(e){return t=>{let n=t.state.field(sm,!1);return n&&n.query.spec.valid?e(t,n):GNe(t)}}const sj=QE((e,{query:t})=>{let{to:n}=e.state.selection.main,i=t.nextMatch(e.state,n,n);if(!i)return!1;let r=tt.single(i.from,i.to),s=e.state.facet(a1);return e.dispatch({selection:r,effects:[HQ(e,i),s.scrollToMatch(r.main,e)],userEvent:"select.search"}),WNe(e),!0}),aj=QE((e,{query:t})=>{let{state:n}=e,{from:i}=n.selection.main,r=t.prevMatch(n,i,i);if(!r)return!1;let s=tt.single(r.from,r.to),a=e.state.facet(a1);return e.dispatch({selection:s,effects:[HQ(e,r),a.scrollToMatch(s.main,e)],userEvent:"select.search"}),WNe(e),!0}),ZDt=QE((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:tt.create(n.map(i=>tt.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),JDt=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:i,to:r}=n.main,s=[],a=0;for(let l=new hx(e.doc,e.sliceDoc(i,r));!l.next().done;){if(s.length>1e3)return!1;l.value.from==i&&(a=s.length),s.push(tt.range(l.value.from,l.value.to))}return t(e.update({selection:tt.create(s,a),userEvent:"select.search.matches"})),!0},zee=QE((e,{query:t})=>{let{state:n}=e,{from:i,to:r}=n.selection.main;if(n.readOnly)return!1;let s=t.nextMatch(n,i,i);if(!s)return!1;let a=s,l=[],c,u,d=[];a.precise?a.from==i&&a.to==r&&(u=n.toText(t.getReplacement(a)),l.push({from:a.from,to:a.to,insert:u}),a=t.nextMatch(n,a.from,a.to),d.push(zt.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+"."))):a=t.nextMatch(n,a.from,a.to);let f=e.state.changes(l);return a&&(c=tt.single(a.from,a.to).map(f),d.push(HQ(e,a)),d.push(n.facet(a1).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:"input.replace"}),!0}),eMt=QE((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:s,to:a,precise:l}=r;l&&n.push({from:s,to:a,insert:t.getReplacement(r)})}if(!n.length)return!1;let i=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:zt.announce.of(i),userEvent:"input.replace.all"}),!0});function VQ(e){return e.state.facet(a1).createPanel(e)}function g8(e,t){var n,i,r,s,a;let l=e.selection.main,c=l.empty||l.to>l.from+100?"":e.sliceDoc(l.from,l.to);if(t&&!c)return t;let u=e.facet(a1);return new VNe({search:((n=t==null?void 0:t.literal)!==null&&n!==void 0?n:u.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(i=t==null?void 0:t.caseSensitive)!==null&&i!==void 0?i:u.caseSensitive,literal:(r=t==null?void 0:t.literal)!==null&&r!==void 0?r:u.literal,regexp:(s=t==null?void 0:t.regexp)!==null&&s!==void 0?s:u.regexp,wholeWord:(a=t==null?void 0:t.wholeWord)!==null&&a!==void 0?a:u.wholeWord})}function qNe(e){let t=oQ(e,VQ);return t&&t.dom.querySelector("[main-field]")}function WNe(e){let t=qNe(e);t&&t==e.root.activeElement&&t.select()}const GNe=e=>{let t=e.state.field(sm,!1);if(t&&t.panel){let n=qNe(e);if(n&&n!=e.root.activeElement){let i=g8(e.state,t.query.spec);i.valid&&e.dispatch({effects:yk.of(i)}),n.focus(),n.select()}}else e.dispatch({effects:[zQ.of(!0),t?yk.of(g8(e.state,t.query.spec)):Fn.appendConfig.of(rMt)]});return!0},KNe=e=>{let t=e.state.field(sm,!1);if(!t||!t.panel)return!1;let n=oQ(e,VQ);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:zQ.of(!1)}),!0},tMt=[{key:"Mod-f",run:GNe,scope:"editor search-panel"},{key:"F3",run:sj,shift:aj,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:sj,shift:aj,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:KNe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:JDt},{key:"Mod-Alt-g",run:jDt},{key:"Mod-d",run:QDt,preventDefault:!0}];class nMt{constructor(t){this.view=t;let n=this.query=t.state.field(sm).query.spec;this.commit=this.commit.bind(this),this.searchField=yr("input",{value:n.search,placeholder:Ll(t,"Find"),"aria-label":Ll(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=yr("input",{value:n.replace,placeholder:Ll(t,"Replace"),"aria-label":Ll(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=yr("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=yr("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=yr("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function i(r,s,a){return yr("button",{class:"cm-button",name:r,onclick:s,type:"button"},a)}this.dom=yr("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,i("next",()=>sj(t),[Ll(t,"next")]),i("prev",()=>aj(t),[Ll(t,"previous")]),i("select",()=>ZDt(t),[Ll(t,"all")]),yr("label",null,[this.caseField,Ll(t,"match case")]),yr("label",null,[this.reField,Ll(t,"regexp")]),yr("label",null,[this.wordField,Ll(t,"by word")]),...t.state.readOnly?[]:[yr("br"),this.replaceField,i("replace",()=>zee(t),[Ll(t,"replace")]),i("replaceAll",()=>eMt(t),[Ll(t,"replace all")])],yr("button",{name:"close",onclick:()=>KNe(t),"aria-label":Ll(t,"close"),type:"button"},["×"])])}commit(){let t=new VNe({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:yk.of(t)}))}keydown(t){YCt(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?aj:sj)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),zee(this.view))}update(t){for(let n of t.transactions)for(let i of n.effects)i.is(yk)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(a1).top}}function Ll(e,t){return e.state.phrase(t)}const p2=30,m2=/[\s\.,:;?!]/;function HQ(e,{from:t,to:n}){let i=e.state.doc.lineAt(t),r=e.state.doc.lineAt(n).to,s=Math.max(i.from,t-p2),a=Math.min(r,n+p2),l=e.state.sliceDoc(s,a);if(s!=i.from){for(let c=0;cl.length-p2;c--)if(!m2.test(l[c-1])&&m2.test(l[c])){l=l.slice(0,c);break}}return zt.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${i.number}.`)}const iMt=zt.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),rMt=[sm,zh.low(YDt),iMt];class Vee{constructor(t,n,i){this.from=t,this.to=n,this.diagnostic=i}}class jg{constructor(t,n,i){this.diagnostics=t,this.panel=n,this.selected=i}static init(t,n,i){let r=i.facet(vk).markerFilter;r&&(t=r(t,i));let s=t.slice().sort((p,g)=>p.from-g.from||p.to-g.to),a=new Ah,l=[],c=0,u=i.doc.iter(),d=0,f=i.doc.length;for(let p=0;;){let g=p==s.length?null:s[p];if(!g&&!l.length)break;let b,v;if(l.length)b=c,v=l.reduce((O,w)=>Math.min(O,w.to),g&&g.from>b?g.from:1e8);else{if(b=g.from,b>f)break;v=g.to,l.push(g),p++}for(;pO.from||O.to==b))l.push(O),p++,v=Math.min(O.to,v);else{v=Math.min(O.from,v);break}}v=Math.min(v,f);let y=!1;if(l.some(O=>O.from==b&&(O.to==v||v==f))&&(y=b==v,!y&&v-b<10)){let O=b-(d+u.value.length);O>0&&(u.next(O),d=b);for(let w=b;;){if(w>=v){y=!0;break}if(!u.lineBreak&&d+u.value.length>w)break;w=d+u.value.length,d+=u.value.length,u.next()}}let x=bMt(l);if(y)a.add(b,b,gn.widget({widget:new hMt(x),diagnostics:l.slice()}));else{let O=l.reduce((w,k)=>k.markClass?w+" "+k.markClass:w,"");a.add(b,v,gn.mark({class:"cm-lintRange cm-lintRange-"+x+O,diagnostics:l.slice(),inclusiveEnd:l.some(w=>w.to>v)}))}if(c=v,c==f)break;for(let O=0;O{if(!(t&&a.diagnostics.indexOf(t)<0))if(!i)i=new Vee(r,s,t||a.diagnostics[0]);else{if(a.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new Vee(i.from,s,i.diagnostic)}}),i}function sMt(e,t){let n=t.pos,i=t.end||n,r=e.state.facet(vk).hideOn(e,n,i);if(r!=null)return r;let s=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(a=>a.is(XNe))||e.changes.touchesRange(s.from,Math.max(s.to,i)))}function aMt(e,t){return e.field(tc,!1)?t:t.concat(Fn.appendConfig.of(yMt))}const XNe=Fn.define(),qQ=Fn.define(),YNe=Fn.define(),tc=ro.define({create(){return new jg(gn.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),i=null,r=e.panel;if(e.selected){let s=t.changes.mapPos(e.selected.from,1);i=jm(n,e.selected.diagnostic,s)||jm(n,null,s)}!n.size&&r&&t.state.facet(vk).autoPanel&&(r=null),e=new jg(n,r,i)}for(let n of t.effects)if(n.is(XNe)){let i=t.state.facet(vk).autoPanel?n.value.length?xk.open:null:e.panel;e=jg.init(n.value,i,t.state)}else n.is(qQ)?e=new jg(e.diagnostics,n.value?xk.open:null,e.selected):n.is(YNe)&&(e=new jg(e.diagnostics,e.panel,n.value));return e},provide:e=>[sk.from(e,t=>t.panel),zt.decorations.from(e,t=>t.diagnostics)]}),oMt=gn.mark({class:"cm-lintRange cm-lintRange-active"});function lMt(e,t,n){let{diagnostics:i}=e.state.field(tc),r,s=-1,a=-1;i.between(t-(n<0?1:0),t+(n>0?1:0),(c,u,{spec:d})=>{if(t>=c&&t<=u&&(c==u||(t>c||n>0)&&(tJNe(e,n,!1)))}const uMt=e=>{let t=e.state.field(tc,!1);(!t||!t.panel)&&e.dispatch({effects:aMt(e.state,[qQ.of(!0)])});let n=oQ(e,xk.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},Hee=e=>{let t=e.state.field(tc,!1);return!t||!t.panel?!1:(e.dispatch({effects:qQ.of(!1)}),!0)},dMt=e=>{let t=e.state.field(tc,!1);if(!t)return!1;let n=e.state.selection.main,i=jm(t.diagnostics,null,n.to+1);return!i&&(i=jm(t.diagnostics,null,0),!i||i.from==n.from&&i.to==n.to)?!1:(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),BTt(e,i.from,1,{tooltip:eje,until:r=>r.docChanged||r.newSelection.main.headi.to}),!0)},fMt=[{key:"Mod-Shift-m",run:uMt,preventDefault:!0},{key:"F8",run:dMt}],vk=Zt.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...ef(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:qee,tooltipFilter:qee,needsRefresh:(t,n)=>t?n?i=>t(i)||n(i):t:n,hideOn:(t,n)=>t?n?(i,r,s)=>t(i,r,s)||n(i,r,s):t:n,autoPanel:(t,n)=>t||n})}}});function qee(e,t){return e?t?(n,i)=>t(e(n,i),i):e:t}function ZNe(e){let t=[];if(e)e:for(let{name:n}of e){for(let i=0;is.toLowerCase()==r.toLowerCase())){t.push(r);continue e}}t.push("")}return t}function JNe(e,t,n){var i;let r=n?ZNe(t.actions):[];return yr("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},yr("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(i=t.actions)===null||i===void 0?void 0:i.map((s,a)=>{let l=!1,c=p=>{if(p.preventDefault(),l)return;l=!0;let g=jm(e.state.field(tc).diagnostics,t);g&&s.apply(e,g.from,g.to)},{name:u}=s,d=r[a]?u.indexOf(r[a]):-1,f=d<0?u:[u.slice(0,d),yr("u",u.slice(d,d+1)),u.slice(d+1)],h=s.markClass?" "+s.markClass:"";return yr("button",{type:"button",class:"cm-diagnosticAction"+h,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${r[a]})"`}.`},f)}),t.source&&yr("div",{class:"cm-diagnosticSource"},t.source))}class hMt extends Yu{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return yr("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Wee{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=JNe(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class xk{constructor(t){this.view=t,this.items=[];let n=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)Hee(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],a=ZNe(s.actions);for(let l=0;l{for(let s=0;sHee(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(tc).selected;if(!t)return-1;for(let n=0;n{for(let d of u.diagnostics){if(a.has(d))continue;a.add(d);let f=-1,h;for(let p=i;pi&&(this.items.splice(i,f-i),r=!0)),n&&h.diagnostic==n.diagnostic?h.dom.hasAttribute("aria-selected")||(h.dom.setAttribute("aria-selected","true"),s=h):h.dom.hasAttribute("aria-selected")&&h.dom.removeAttribute("aria-selected"),i++}});i({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:c})=>{let u=c.height/this.list.offsetHeight;l.topc.bottom&&(this.list.scrollTop+=(l.bottom-c.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let t=this.list.firstChild;function n(){let i=t;t=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;t!=i.dom;)n();t=i.dom.nextSibling}else this.list.insertBefore(i.dom,t);for(;t;)n()}moveSelection(t){if(this.selectedIndex<0)return;let n=this.view.state.field(tc),i=jm(n.diagnostics,this.items[t].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:YNe.of(i)})}static open(t){return new xk(t)}}function pMt(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}function g2(e){return pMt(``,'width="6" height="3"')}const mMt=zt.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:g2("#f11")},".cm-lintRange-warning":{backgroundImage:g2("orange")},".cm-lintRange-info":{backgroundImage:g2("#999")},".cm-lintRange-hint":{backgroundImage:g2("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function gMt(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function bMt(e){let t="hint",n=1;for(let i of e){let r=gMt(i.severity);r>n&&(n=r,t=i.severity)}return t}const eje=FTt(lMt,{hideOn:sMt}),yMt=[tc,zt.decorations.compute([tc],e=>{let{selected:t,panel:n}=e.field(tc);return!t||!n||t.from==t.to?gn.none:gn.set([oMt.range(t.from,t.to)])}),eje,mMt];var Gee=function(t){t===void 0&&(t={});var n=t,i=n.crosshairCursor,r=i===void 0?!1:i,s=[];t.closeBracketsKeymap!==!1&&(s=s.concat(E_t)),t.defaultKeymap!==!1&&(s=s.concat(ADt)),t.searchKeymap!==!1&&(s=s.concat(tMt)),t.historyKeymap!==!1&&(s=s.concat(DPt)),t.foldKeymap!==!1&&(s=s.concat(_2t)),t.completionKeymap!==!1&&(s=s.concat(RAe)),t.lintKeymap!==!1&&(s=s.concat(fMt));var a=[];return t.lineNumbers!==!1&&a.push(K2e()),t.highlightActiveLineGutter!==!1&&a.push(t2t()),t.highlightSpecialChars!==!1&&a.push(pTt()),t.history!==!1&&a.push(CPt()),t.foldGutter!==!1&&a.push(I2t()),t.drawSelection!==!1&&a.push(iTt()),t.dropCursor!==!1&&a.push(lTt()),t.allowMultipleSelections!==!1&&a.push(Ti.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&a.push(w2t()),t.syntaxHighlighting!==!1&&a.push(uAe(L2t,{fallback:!0})),t.bracketMatching!==!1&&a.push(V2t()),t.closeBrackets!==!1&&a.push(w_t()),t.autocompletion!==!1&&a.push(R_t()),t.rectangularSelection!==!1&&a.push(ATt()),r!==!1&&a.push(jTt()),t.highlightActiveLine!==!1&&a.push(xTt()),t.highlightSelectionMatches!==!1&&a.push(PDt()),t.tabSize&&typeof t.tabSize=="number"&&a.push(i1.of(" ".repeat(t.tabSize))),a.concat([n1.of(s.flat())]).filter(Boolean)};const vMt="#e5c07b",Kee="#e06c75",xMt="#56b6c2",wMt="#ffffff",BA="#abb2bf",b8="#7d8799",OMt="#61afef",SMt="#98c379",Xee="#d19a66",kMt="#c678dd",EMt="#21252b",Yee="#2c313a",Zee="#282c34",X5="#353a42",CMt="#3E4451",Jee="#528bff",TMt=zt.theme({"&":{color:BA,backgroundColor:Zee},".cm-content":{caretColor:Jee},".cm-cursor, .cm-dropCursor":{borderLeftColor:Jee},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:CMt},".cm-panels":{backgroundColor:EMt,color:BA},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Zee,color:b8,border:"none"},".cm-activeLineGutter":{backgroundColor:Yee},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:X5},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:X5,borderBottomColor:X5},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Yee,color:BA}}},{dark:!0}),AMt=FE.define([{tag:ne.keyword,color:kMt},{tag:[ne.name,ne.deleted,ne.character,ne.propertyName,ne.macroName],color:Kee},{tag:[ne.function(ne.variableName),ne.labelName],color:OMt},{tag:[ne.color,ne.constant(ne.name),ne.standard(ne.name)],color:Xee},{tag:[ne.definition(ne.name),ne.separator],color:BA},{tag:[ne.typeName,ne.className,ne.number,ne.changed,ne.annotation,ne.modifier,ne.self,ne.namespace],color:vMt},{tag:[ne.operator,ne.operatorKeyword,ne.url,ne.escape,ne.regexp,ne.link,ne.special(ne.string)],color:xMt},{tag:[ne.meta,ne.comment],color:b8},{tag:ne.strong,fontWeight:"bold"},{tag:ne.emphasis,fontStyle:"italic"},{tag:ne.strikethrough,textDecoration:"line-through"},{tag:ne.link,color:b8,textDecoration:"underline"},{tag:ne.heading,fontWeight:"bold",color:Kee},{tag:[ne.atom,ne.bool,ne.special(ne.variableName)],color:Xee},{tag:[ne.processingInstruction,ne.string,ne.inserted],color:SMt},{tag:ne.invalid,color:wMt}]),_Mt=[TMt,uAe(AMt)];var NMt=zt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),jMt=function(t){t===void 0&&(t={});var n=t,i=n.indentWithTab,r=i===void 0?!0:i,s=n.editable,a=s===void 0?!0:s,l=n.readOnly,c=l===void 0?!1:l,u=n.theme,d=u===void 0?"light":u,f=n.placeholder,h=f===void 0?"":f,p=n.basicSetup,g=p===void 0?!0:p,b=[];switch(r&&b.unshift(n1.of([_Dt])),g&&(typeof g=="boolean"?b.unshift(Gee()):b.unshift(Gee(g))),h&&b.unshift(kTt(h)),d){case"light":b.push(NMt);break;case"dark":b.push(_Mt);break;case"none":break;default:b.push(d);break}return a===!1&&b.push(zt.editable.of(!1)),c&&b.push(Ti.readOnly.of(!0)),[...b]},RMt=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(t=>!t.empty)});class IMt{constructor(t,n){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=n,this.timeoutMS=n,this.callbacks.push(t)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var t=this.callbacks.slice();this.callbacks.length=0,t.forEach(n=>{try{n()}catch(i){console.error("TimeoutLatch callback error:",i)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class ete{constructor(){this.interval=null,this.latches=new Set}add(t){this.latches.add(t),this.start()}remove(t){this.latches.delete(t),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(t=>{t.tick(),t.isDone&&this.remove(t)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var Y5=null,PMt=()=>typeof window>"u"?new ete:(Y5||(Y5=new ete),Y5),DMt=zt.theme({"& .cm-scroller":{height:"100% !important"}}),tte=null,Z5=null;function MMt(e,t,n,i,r,s){if(!e&&!t&&!n&&!i&&!r&&!s)return null;var a=JSON.stringify({height:e,minHeight:t,maxHeight:n,width:i,minWidth:r,maxWidth:s});return a===tte||(tte=a,Z5=zt.theme({"&":{height:e,minHeight:t,maxHeight:n,width:i,minWidth:r,maxWidth:s}})),Z5}var nte=Jd.define(),LMt=200,$Mt=[];function FMt(e){var t=e.value,n=e.selection,i=e.onChange,r=e.onStatistics,s=e.onCreateEditor,a=e.onUpdate,l=e.extensions,c=l===void 0?$Mt:l,u=e.autoFocus,d=e.theme,f=d===void 0?"light":d,h=e.height,p=h===void 0?null:h,g=e.minHeight,b=g===void 0?null:g,v=e.maxHeight,y=v===void 0?null:v,x=e.width,O=x===void 0?null:x,w=e.minWidth,k=w===void 0?null:w,S=e.maxWidth,E=S===void 0?null:S,C=e.placeholder,N=C===void 0?"":C,_=e.editable,j=_===void 0?!0:_,A=e.readOnly,F=A===void 0?!1:A,T=e.indentWithTab,P=T===void 0?!0:T,R=e.basicSetup,L=R===void 0?!0:R,M=e.root,U=e.initialState,I=m.useState(),H=I[0],Z=I[1],Q=m.useState(),q=Q[0],B=Q[1],te=m.useState(),ce=te[0],se=te[1],re=m.useState(()=>({current:null}))[0],ge=m.useState(()=>({current:null}))[0],G=MMt(p,b,y,O,k,E),K=zt.updateListener.of(xe=>{if(xe.docChanged&&typeof i=="function"&&!xe.transactions.some(De=>De.annotation(nte))){re.current?re.current.reset():(re.current=new IMt(()=>{if(ge.current){var De=ge.current;ge.current=null,De()}re.current=null},LMt),PMt().add(re.current));var Ee=xe.state.doc,Je=Ee.toString();i(Je,xe)}r&&r(RMt(xe))}),ae=jMt({theme:f,editable:j,readOnly:F,placeholder:N,indentWithTab:P,basicSetup:L}),ue=[K,...G?[G]:[],DMt,...ae];return a&&typeof a=="function"&&ue.push(zt.updateListener.of(a)),ue=ue.concat(c),m.useLayoutEffect(()=>{if(H&&!ce){var xe={doc:t,selection:n,extensions:ue},Ee=U?Ti.fromJSON(U.json,xe,U.fields):Ti.create(xe);if(se(Ee),!q){var Je=new zt({state:Ee,parent:H,root:M});B(Je),s&&s(Je,Ee)}}return()=>{q&&(se(void 0),B(void 0))}},[H,ce]),m.useEffect(()=>{e.container&&Z(e.container)},[e.container]),m.useEffect(()=>()=>{q&&(q.destroy(),B(void 0)),re.current&&(re.current.cancel(),re.current=null)},[q]),m.useEffect(()=>{u&&q&&q.focus()},[u,q]),m.useEffect(()=>{q&&q.dispatch({effects:Fn.reconfigure.of(ue)})},[f,c,p,b,y,O,k,E,N,j,F,P,L,i,a]),m.useEffect(()=>{if(t!==void 0){var xe=q?q.state.doc.toString():"";if(q&&t!==xe){var Ee=re.current&&!re.current.isDone,Je=()=>{q&&t!==q.state.doc.toString()&&q.dispatch({changes:{from:0,to:q.state.doc.toString().length,insert:t||""},annotations:[nte.of(!0)]})};Ee?ge.current=Je:Je()}}},[t,q]),{state:ce,setState:se,view:q,setView:B,container:H,setContainer:Z}}var BMt=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],tje=m.forwardRef((e,t)=>{var n=e.className,i=e.value,r=i===void 0?"":i,s=e.selection,a=e.extensions,l=a===void 0?[]:a,c=e.onChange,u=e.onStatistics,d=e.onCreateEditor,f=e.onUpdate,h=e.autoFocus,p=e.theme,g=p===void 0?"light":p,b=e.height,v=e.minHeight,y=e.maxHeight,x=e.width,O=e.minWidth,w=e.maxWidth,k=e.basicSetup,S=e.placeholder,E=e.indentWithTab,C=e.editable,N=e.readOnly,_=e.root,j=e.initialState,A=gPt(e,BMt),F=m.useRef(null),T=FMt({root:_,value:r,autoFocus:h,theme:g,height:b,minHeight:v,maxHeight:y,width:x,minWidth:O,maxWidth:w,basicSetup:k,placeholder:S,indentWithTab:E,editable:C,readOnly:N,selection:s,onChange:c,onStatistics:u,onCreateEditor:d,onUpdate:f,extensions:l,initialState:j}),P=T.state,R=T.view,L=T.container,M=T.setContainer;m.useImperativeHandle(t,()=>({editor:F.current,state:P,view:R}),[F,L,P,R]);var U=m.useCallback(H=>{F.current=H,M(H)},[M]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var I=typeof g=="string"?"cm-theme-"+g:"cm-theme";return o.jsx("div",d8({ref:U,className:""+I+(n?" "+n:"")},A))});tje.displayName="CodeMirror";function nje(e){const t=e.toLowerCase(),n=t.split("/").pop()??t,i=n.includes(".")?n.split(".").pop():"";return n==="dockerfile"||n.startsWith("dockerfile.")||n.endsWith(".dockerfile")?[dQ.define(mPt)]:i==="py"||i==="pyi"?[EIt()]:["ts","tsx","mts","cts"].includes(i??"")?[Z$({typescript:!0,jsx:i==="tsx"})]:["js","jsx","mjs","cjs"].includes(i??"")?[Z$({jsx:i==="jsx"})]:i==="json"||i==="jsonc"?[H_t()]:i==="yaml"||i==="yml"?[tPt()]:["md","markdown"].includes(i??"")?[sRt()]:[]}function zE({value:e,path:t,onChange:n,readOnly:i=!1,theme:r="light",lineNumberStart:s=1,height:a="100%",minHeight:l,maxHeight:c}){const u=m.useMemo(()=>[...nje(t),...s===1?[]:[K2e({formatNumber:d=>String(d+s-1)})]],[s,t]);return o.jsx(tje,{value:e,height:a,minHeight:l,maxHeight:c,theme:r,extensions:u,editable:!i,onChange:n,basicSetup:{lineNumbers:s===1,foldGutter:!0,highlightActiveLine:!0,highlightActiveLineGutter:!0,autocompletion:!1}})}const ije=Object.freeze(Object.defineProperty({__proto__:null,default:zE,languageFor:nje},Symbol.toStringTag,{value:"Module"}));function UMt(e){var s;const t=e.split(/\r?\n/);if(((s=t[0])==null?void 0:s.trim())!=="---")return{body:e,frontmatter:[]};const n=t.findIndex((a,l)=>l>0&&a.trim()==="---");if(n<0)return{body:e,frontmatter:[]};const i=yTe(t.slice(1,n).join(` `));if(i.errors.length>0)return{body:e,frontmatter:[]};const r=i.toJS();return!r||typeof r!="object"||Array.isArray(r)?{body:e,frontmatter:[]}:{body:t.slice(n+1).join(` -`).replace(/^\s*\n/,""),frontmatter:Object.entries(r).map(([a,l])=>({key:a,value:typeof l=="string"?l:$U(l).trim()}))}}function QMt(){return o.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"M2.75 5.5h5l1.5 1.75h8v7.25a1.75 1.75 0 0 1-1.75 1.75h-11a1.75 1.75 0 0 1-1.75-1.75v-9Z"})})}function zMt(){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[o.jsx("path",{d:"M5 2.75h6l4 4v10.5H5z"}),o.jsx("path",{d:"M11 2.75v4h4"})]})}function VMt(e){const t={children:[]};for(const i of e){let r=t;const s=i.path.split("/").filter(Boolean);s.forEach((a,l)=>{let c=r.children.find(u=>u.name===a);if(!c){const u=s.slice(0,l+1).join("/");c={name:a,path:u,children:[]},r.children.push(c)}l===s.length-1&&(c.file=i),r=c})}const n=i=>{i.sort((r,s)=>+!!r.file-+!!s.file||r.name.localeCompare(s.name)),i.forEach(r=>n(r.children))};return n(t.children),t.children}function rje({nodes:e,depth:t,activePath:n,onSelect:i}){return e.map(r=>o.jsxs("div",{children:[r.file?o.jsxs("button",{type:"button",className:`skill-file-tree__row${r.path===n?" is-active":""}`,style:{paddingLeft:`${12+t*16}px`},onClick:()=>i(r.file),title:r.path,children:[o.jsx(zMt,{}),o.jsx("span",{children:r.name}),o.jsxs("small",{children:[r.file.size.toLocaleString()," B"]})]}):o.jsxs("div",{className:"skill-file-tree__row is-folder",style:{paddingLeft:`${12+t*16}px`},title:r.path,children:[o.jsx(QMt,{}),o.jsx("span",{children:r.name})]}),r.children.length>0?o.jsx(rje,{nodes:r.children,depth:t+1,activePath:n,onSelect:i}):null]},r.path))}function HMt(e){if(e.content===void 0)return;if(e.content.startsWith("data:")){const i=document.createElement("a");i.href=e.content,i.download=e.path.split("/").pop()||"skill-file",i.click();return}const t=URL.createObjectURL(new Blob([e.content])),n=document.createElement("a");n.href=t,n.download=e.path.split("/").pop()||"skill-file",n.click(),URL.revokeObjectURL(t)}function sje({files:e}){var p;const{t,i18n:n}=Ae("skills"),i=m.useMemo(()=>VMt(e),[e]),[r,s]=m.useState(((p=e[0])==null?void 0:p.path)||""),[a,l]=m.useState("preview"),c=e.find(g=>g.path===r)||e[0],u=(c==null?void 0:c.path.toLowerCase())||"",d=u.endsWith(".md")||u.endsWith(".markdown"),f=/\.(png|jpe?g|gif|webp|svg)$/.test(u),h=m.useMemo(()=>UMt(d&&(c==null?void 0:c.content)!==void 0?c.content:""),[c==null?void 0:c.content,d]);return o.jsxs("div",{className:"skill-file-browser",children:[o.jsx("aside",{className:"skill-file-tree","aria-label":t("fileTree.ariaLabel"),children:o.jsx(rje,{nodes:i,depth:0,activePath:(c==null?void 0:c.path)||"",onSelect:g=>s(g.path)})}),o.jsx("section",{className:"skill-file-preview",children:c?o.jsxs(o.Fragment,{children:[o.jsxs("header",{children:[o.jsx("span",{title:c.path,children:c.path}),o.jsxs("div",{children:[d?o.jsx("button",{type:"button",onClick:()=>l(g=>g==="preview"?"source":"preview"),children:t(a==="preview"?"fileTree.viewSource":"fileTree.viewPreview")}):null,o.jsx("button",{type:"button",disabled:c.content===void 0,onClick:()=>HMt(c),children:t("fileTree.download")})]})]}),o.jsx("div",{className:"skill-file-preview__body",children:c.kind==="binary"||c.content===void 0?o.jsxs("div",{className:"skill-file-preview__binary",children:[o.jsx("strong",{children:t("fileTree.binaryFile")}),o.jsx("span",{children:t("fileTree.bytes",{value:new Intl.NumberFormat(n.resolvedLanguage).format(c.size)})}),o.jsx("span",{children:t("fileTree.binaryDescription")})]}):f?o.jsx("img",{src:c.content.startsWith("data:")?c.content:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(c.content)}`,alt:c.path}):d&&a==="preview"?o.jsxs("div",{className:"skill-file-preview__markdown",children:[h.frontmatter.length>0?o.jsx("dl",{className:"skill-file-preview__frontmatter","aria-label":t("fileTree.metadata"),children:h.frontmatter.map(g=>o.jsxs("div",{children:[o.jsx("dt",{children:g.key}),o.jsx("dd",{children:g.value})]},g.key))}):null,o.jsx(Bu,{text:h.body,allowRawHtml:!1,className:"skill-file-preview__markdown-body"})]}):o.jsx(zE,{value:c.content,path:c.path,readOnly:!0,onChange:()=>{}})})]}):o.jsx("div",{className:"skill-file-preview__binary",children:t("fileTree.noFiles")})})]})}const qMt=1200,WMt=3,aje=2,GMt=/SKILL\.md|frontmatter|Skill name|description|根目录|目录名|UTF-8|文本文件|文件数|符号链接|敏感凭证/i,ite={concise:"generation.styles.concise",strict:"generation.styles.strict",tutorial:"generation.styles.tutorial",automation:"generation.styles.automation"};function rte(e,t){var n;return{id:`group-${Date.now()}-${e}`,model:((n=t.models[e%Math.max(1,t.models.length)])==null?void 0:n.id)||"",style:"concise",customStyle:""}}function KMt(e){return e?e.state==="ready"?Bt("generation.stages.ready"):e.state==="failed"?Bt("generation.stages.failed"):e.state==="cancelled"?Bt("generation.stages.cancelled"):e.stage==="validating"?Bt("generation.stages.validating"):e.stage==="packaging"?Bt("generation.stages.packaging"):Bt("generation.stages.generating"):Bt("generation.stages.preparing")}function J5(e){var t;return e.state==="failed"&&((t=e.validation)==null?void 0:t.valid)===!1&&e.validation.errors.some(n=>GMt.test(n))}function ste(e){var n;const t=((n=e.validation)==null?void 0:n.errors.join(` -`))||e.error||Bt("generation.validation.fallback");return[Bt("generation.validation.repairInstruction"),Bt("generation.validation.recheckInstruction"),t.slice(0,2e3)].join(` +`).replace(/^\s*\n/,""),frontmatter:Object.entries(r).map(([a,l])=>({key:a,value:typeof l=="string"?l:$U(l).trim()}))}}function QMt(){return o.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"M2.75 5.5h5l1.5 1.75h8v7.25a1.75 1.75 0 0 1-1.75 1.75h-11a1.75 1.75 0 0 1-1.75-1.75v-9Z"})})}function zMt(){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[o.jsx("path",{d:"M5 2.75h6l4 4v10.5H5z"}),o.jsx("path",{d:"M11 2.75v4h4"})]})}function VMt(e){const t={children:[]};for(const i of e){let r=t;const s=i.path.split("/").filter(Boolean);s.forEach((a,l)=>{let c=r.children.find(u=>u.name===a);if(!c){const u=s.slice(0,l+1).join("/");c={name:a,path:u,children:[]},r.children.push(c)}l===s.length-1&&(c.file=i),r=c})}const n=i=>{i.sort((r,s)=>+!!r.file-+!!s.file||r.name.localeCompare(s.name)),i.forEach(r=>n(r.children))};return n(t.children),t.children}function rje({nodes:e,depth:t,activePath:n,onSelect:i}){return e.map(r=>o.jsxs("div",{children:[r.file?o.jsxs("button",{type:"button",className:`skill-file-tree__row${r.path===n?" is-active":""}`,style:{paddingLeft:`${12+t*16}px`},onClick:()=>i(r.file),title:r.path,children:[o.jsx(zMt,{}),o.jsx("span",{children:r.name}),o.jsxs("small",{children:[r.file.size.toLocaleString()," B"]})]}):o.jsxs("div",{className:"skill-file-tree__row is-folder",style:{paddingLeft:`${12+t*16}px`},title:r.path,children:[o.jsx(QMt,{}),o.jsx("span",{children:r.name})]}),r.children.length>0?o.jsx(rje,{nodes:r.children,depth:t+1,activePath:n,onSelect:i}):null]},r.path))}function HMt(e){if(e.content===void 0)return;if(e.content.startsWith("data:")){const i=document.createElement("a");i.href=e.content,i.download=e.path.split("/").pop()||"skill-file",i.click();return}const t=URL.createObjectURL(new Blob([e.content])),n=document.createElement("a");n.href=t,n.download=e.path.split("/").pop()||"skill-file",n.click(),URL.revokeObjectURL(t)}function sje({files:e}){var p;const{t,i18n:n}=Ce("skills"),i=m.useMemo(()=>VMt(e),[e]),[r,s]=m.useState(((p=e[0])==null?void 0:p.path)||""),[a,l]=m.useState("preview"),c=e.find(g=>g.path===r)||e[0],u=(c==null?void 0:c.path.toLowerCase())||"",d=u.endsWith(".md")||u.endsWith(".markdown"),f=/\.(png|jpe?g|gif|webp|svg)$/.test(u),h=m.useMemo(()=>UMt(d&&(c==null?void 0:c.content)!==void 0?c.content:""),[c==null?void 0:c.content,d]);return o.jsxs("div",{className:"skill-file-browser",children:[o.jsx("aside",{className:"skill-file-tree","aria-label":t("fileTree.ariaLabel"),children:o.jsx(rje,{nodes:i,depth:0,activePath:(c==null?void 0:c.path)||"",onSelect:g=>s(g.path)})}),o.jsx("section",{className:"skill-file-preview",children:c?o.jsxs(o.Fragment,{children:[o.jsxs("header",{children:[o.jsx("span",{title:c.path,children:c.path}),o.jsxs("div",{children:[d?o.jsx("button",{type:"button",onClick:()=>l(g=>g==="preview"?"source":"preview"),children:t(a==="preview"?"fileTree.viewSource":"fileTree.viewPreview")}):null,o.jsx("button",{type:"button",disabled:c.content===void 0,onClick:()=>HMt(c),children:t("fileTree.download")})]})]}),o.jsx("div",{className:"skill-file-preview__body",children:c.kind==="binary"||c.content===void 0?o.jsxs("div",{className:"skill-file-preview__binary",children:[o.jsx("strong",{children:t("fileTree.binaryFile")}),o.jsx("span",{children:t("fileTree.bytes",{value:new Intl.NumberFormat(n.resolvedLanguage).format(c.size)})}),o.jsx("span",{children:t("fileTree.binaryDescription")})]}):f?o.jsx("img",{src:c.content.startsWith("data:")?c.content:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(c.content)}`,alt:c.path}):d&&a==="preview"?o.jsxs("div",{className:"skill-file-preview__markdown",children:[h.frontmatter.length>0?o.jsx("dl",{className:"skill-file-preview__frontmatter","aria-label":t("fileTree.metadata"),children:h.frontmatter.map(g=>o.jsxs("div",{children:[o.jsx("dt",{children:g.key}),o.jsx("dd",{children:g.value})]},g.key))}):null,o.jsx(Bu,{text:h.body,allowRawHtml:!1,className:"skill-file-preview__markdown-body"})]}):o.jsx(zE,{value:c.content,path:c.path,readOnly:!0,onChange:()=>{}})})]}):o.jsx("div",{className:"skill-file-preview__binary",children:t("fileTree.noFiles")})})]})}const qMt=1200,WMt=3,aje=2,GMt=/SKILL\.md|frontmatter|Skill name|description|根目录|目录名|UTF-8|文本文件|文件数|符号链接|敏感凭证/i,ite={concise:"generation.styles.concise",strict:"generation.styles.strict",tutorial:"generation.styles.tutorial",automation:"generation.styles.automation"};function rte(e,t){var n;return{id:`group-${Date.now()}-${e}`,model:((n=t.models[e%Math.max(1,t.models.length)])==null?void 0:n.id)||"",style:"concise",customStyle:""}}function KMt(e){return e?e.state==="ready"?Vt("generation.stages.ready"):e.state==="failed"?Vt("generation.stages.failed"):e.state==="cancelled"?Vt("generation.stages.cancelled"):e.stage==="validating"?Vt("generation.stages.validating"):e.stage==="packaging"?Vt("generation.stages.packaging"):Vt("generation.stages.generating"):Vt("generation.stages.preparing")}function J5(e){var t;return e.state==="failed"&&((t=e.validation)==null?void 0:t.valid)===!1&&e.validation.errors.some(n=>GMt.test(n))}function ste(e){var n;const t=((n=e.validation)==null?void 0:n.errors.join(` +`))||e.error||Vt("generation.validation.fallback");return[Vt("generation.validation.repairInstruction"),Vt("generation.validation.recheckInstruction"),t.slice(0,2e3)].join(` -`)}function XMt(e){var t;if(e.repairing||((t=e.task)==null?void 0:t.state)==="running"&&e.repairMode){if(e.repairMode==="manual")return Bt("generation.stages.repairingAgain");const n=Math.max(1,e.repairAttempts||1);return Bt("generation.stages.autoRepairing",{attempt:n,max:aje})}return KMt(e.task)}function ate(){return o.jsxs("svg",{className:"skill-generation__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 YMt(e,t=Date.now()){if(!(e!=null&&e.expiresAt))return Bt("generation.sessionMax");const n=Math.max(0,new Date(e.expiresAt).getTime()-t),i=Math.floor(n/6e4),r=Math.floor(n%6e4/1e3);return Bt("generation.remaining",{minutes:i,seconds:String(r).padStart(2,"0")})}function ZMt(e){return e?e.length>64?Bt("generation.validation.nameTooLong"):/^[a-z0-9-]+$/.test(e)?"":Bt("generation.validation.invalidName"):""}function ote(e){return e?e.length>128?Bt("generation.validation.modelTooLong"):/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/.test(e)?"":Bt("generation.validation.invalidModel"):""}function eL(e){return`${e.region||""}:${e.id}`}function JMt(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m14.5 6-6 6 6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function e5t({operation:e,cloudProvider:t,space:n,availableSpaces:i=[],spacesLoading:r=!1,initialIntent:s="",source:a,onBack:l,onPublished:c}){var Ce,Ze,at,St;const{t:u}=Ae("skills"),[d,f]=m.useState(null),[h,p]=m.useState(null),[g,b]=m.useState(s),[v,y]=m.useState(""),[x,O]=m.useState([]),[w,k]=m.useState([]),[S,E]=m.useState(""),[C,N]=m.useState(!1),[_,j]=m.useState(""),[A,F]=m.useState(""),[T,P]=m.useState(null),[R,L]=m.useState(""),[M,U]=m.useState(""),[I,H]=m.useState(n?eL(n):""),[K,Q]=m.useState(Date.now()),q=m.useRef([]);m.useEffect(()=>{const Te=new AbortController;return sI(Te.signal).then(ye=>{f(ye),O([rte(0,ye)])}).catch(ye=>{Te.signal.aborted||p(ja(ye,Bt("generation.errors.loadCapability")))}),()=>Te.abort()},[]),m.useEffect(()=>{q.current=w},[w]),m.useEffect(()=>{const Te=window.setInterval(()=>Q(Date.now()),1e3);return()=>window.clearInterval(Te)},[]),m.useEffect(()=>{const Te=ye=>{q.current.some(Ve=>{var nt;return((nt=Ve.task)==null?void 0:nt.state)==="running"||Ve.repairing})&&ye.preventDefault()};return window.addEventListener("beforeunload",Te),()=>{var ye;window.removeEventListener("beforeunload",Te);for(const Ve of q.current)(ye=Ve.task)!=null&&ye.jobId&&M1t(Ve.task.jobId).catch(()=>{})}},[]),m.useEffect(()=>{if(!w.some(nt=>{var ke;return((ke=nt.task)==null?void 0:ke.state)==="running"||nt.repairing}))return;let Te=!1,ye;const Ve=async()=>{const nt=q.current,ke=await Promise.all(nt.map(async Ht=>{var on;if(((on=Ht.task)==null?void 0:on.state)!=="running")return Ht;try{const Yt=await I1t(Ht.task.jobId);if(J5(Yt)&&(Ht.repairAttempts||0)ct.map(gt=>gt.id===Ht.id?{...gt,task:Yt,repairing:!0,repairMode:"auto",repairAttempts:Pt,repairError:void 0}:gt));try{const ct=await VM({jobId:Yt.jobId,intent:ste(Yt),expectedRevision:Yt.revision});return{...Ht,task:ct,artifact:void 0,repairing:!1,repairMode:"auto",repairAttempts:Pt,repairError:void 0,error:void 0,pollError:void 0}}catch(ct){return{...Ht,task:Yt,repairing:!1,repairMode:void 0,repairAttempts:Pt,repairError:ja(ct,Bt("generation.errors.autoRepair")),pollError:void 0}}}let xt=Ht.artifact;return Yt.state==="ready"&&(xt=await zM(Yt.jobId,Yt.revision)),{...Ht,task:Yt,artifact:xt,repairing:!1,repairMode:Yt.state==="running"?Ht.repairMode:void 0,repairError:void 0,error:void 0,pollError:void 0}}catch(Yt){return{...Ht,pollError:ja(Yt,Bt("generation.errors.pollCandidate"))}}}));Te||(k(ke),ye=window.setTimeout(()=>void Ve(),qMt))};return Ve(),()=>{Te=!0,ye!==void 0&&window.clearTimeout(ye)}},[w.some(Te=>{var ye;return((ye=Te.task)==null?void 0:ye.state)==="running"||Te.repairing})]);const B=w.find(Te=>Te.id===S)||w[0],ee=e==="create"&&!n,le=i.find(Te=>eL(Te)===I)??null,se=n??le,re=i.map(Te=>({value:eL(Te),label:`${Te.name.trim()||u("generation.unnamedSpace")} · ${xh(Te.region||"cn-beijing",t)}`})),ge=ZMt(v),W=!!(d!=null&&d.enabled&&g.trim()&&!ge&&x.length>0&&x.every(Te=>Te.model.trim()&&!ote(Te.model.trim()))),X=(Te,ye)=>{O(Ve=>Ve.map(nt=>nt.id===Te?{...nt,...ye}:nt))},ae=async Te=>{const ye={...Te,model:Te.model.trim()},Ve=Te.style==="custom"?Te.customStyle.trim():Te.style;try{const nt=await R1t({operation:e,intent:g.trim(),model:ye.model,style:Ve,name:v.trim()||void 0,source:a});return{id:Te.id,config:ye,task:nt}}catch(nt){return{id:Te.id,config:ye,error:ja(nt,Bt("generation.errors.createCandidate"))}}},ue=async()=>{if(!W)return;N(!0),P(null);const Te=x.map(Ve=>({id:Ve.id,config:Ve}));k(Te),E(x[0].id);const ye=await Promise.all(x.map(ae));k(ye)},Oe=async Te=>{k(Ve=>Ve.map(nt=>nt.id===Te.id?{...nt,error:void 0}:nt));const ye=await ae(Te.config);k(Ve=>Ve.map(nt=>nt.id===Te.id?ye:nt))},Se=async()=>{if(!(!(B!=null&&B.task)||!_.trim()||B.task.state!=="ready")){F("refine"),P(null);try{const Te=await VM({jobId:B.task.jobId,intent:_.trim(),expectedRevision:B.task.revision});k(ye=>ye.map(Ve=>Ve.id===B.id?{...Ve,task:Te,artifact:void 0}:Ve)),j("")}catch(Te){P(ja(Te,Bt("generation.errors.refine")))}finally{F("")}}},lt=async()=>{if(!(!(B!=null&&B.task)||!J5(B.task))){F("refine"),P(null),k(Te=>Te.map(ye=>ye.id===B.id?{...ye,repairing:!0,repairMode:"manual",repairError:void 0}:ye));try{const Te=await VM({jobId:B.task.jobId,intent:ste(B.task),expectedRevision:B.task.revision});k(ye=>ye.map(Ve=>Ve.id===B.id?{...Ve,task:Te,artifact:void 0,repairing:!1,repairMode:"manual",repairError:void 0}:Ve))}catch(Te){k(ye=>ye.map(Ve=>Ve.id===B.id?{...Ve,repairing:!1,repairMode:void 0,repairError:ja(Te,Bt("generation.errors.repairAgain"))}:Ve))}finally{F("")}}},$e=async()=>{if(!(!(B!=null&&B.task)||B.task.state!=="ready"||M)){F("publish"),P(null);try{if(!se)throw new Error(Bt("generation.errors.selectSpace"));const Te=B.artifact||await zM(B.task.jobId,B.task.revision),ye=(a==null?void 0:a.region)||se.region||"";if(!tR(ye))throw new Error(Bt("generation.errors.unsupportedRegion"));await D1t({jobId:B.task.jobId,expectedRevision:B.task.revision,expectedArtifactSha256:Te.sha256,disposition:e==="optimize"?"update-source":"create-new",skillSpaceIds:[se.id],projectName:(a==null?void 0:a.projectName)||se.projectName,region:ye,onProgress:Ve=>L(Ve.message)}),U(B.id),c()}catch(Te){P(ja(Te,Bt("generation.errors.upload")))}finally{F(""),L("")}}},Le=async()=>{if(!(!(B!=null&&B.task)||B.task.state!=="ready")){F("download");try{const Te=B.artifact||await zM(B.task.jobId,B.task.revision);await L1t(B.task.jobId,B.task.revision,Te.sha256)}catch(Te){P(ja(Te,Bt("generation.errors.download")))}finally{F("")}}},Ne=async()=>{w.some(Te=>{var ye;return((ye=Te.task)==null?void 0:ye.state)==="running"})&&!window.confirm(Bt("generation.leaveConfirmation"))||(await Promise.allSettled(w.flatMap(Te=>{var ye;return((ye=Te.task)==null?void 0:ye.state)==="running"?[P1t({jobId:Te.task.jobId,expectedRevision:Te.task.revision})]:[]})),l())},qe=e==="create"?u("generation.createTitle"):u("generation.optimizeTitle",{name:(a==null?void 0:a.name)||u("generation.skillFallback")}),Re=Te=>{var ye;return((ye=d==null?void 0:d.models.find(Ve=>Ve.id===Te))==null?void 0:ye.label)||Te},ze=Te=>Te.config.style==="custom"?Te.config.customStyle.trim()||u("generation.styles.customFallback"):u(ite[Te.config.style]),Ee=[...Object.entries(ite).map(([Te,ye])=>({value:Te,label:u(ye)})),{value:"custom",label:u("generation.styles.custom")}],De=Te=>Te.error||Te.repairError?u("generation.stages.failed"):XMt(Te),J=Te=>!Te.error&&!Te.repairError&&(Te.repairing||!Te.task||Te.task.state==="running"),he=w.some(Te=>{var ye;return((ye=Te.task)==null?void 0:ye.state)==="ready"});return o.jsxs("section",{className:"skill-generation",children:[o.jsxs("header",{className:"skill-generation__header",children:[o.jsx("button",{type:"button",className:"skillcenter-back",onClick:()=>void Ne(),"aria-label":u("generation.back"),children:o.jsx(JMt,{})}),o.jsxs("div",{children:[o.jsx("h1",{children:qe}),o.jsx("p",{children:(n==null?void 0:n.name)||u("generation.home")})]}),w.length>0?o.jsx("span",{className:"skill-generation__ttl",children:YMt(B==null?void 0:B.task,K)}):null]}),C?o.jsxs("div",{className:"skill-generation__workspace",children:[o.jsx("div",{className:"skill-generation__candidate-tabs",role:"tablist","aria-label":u("generation.candidates"),children:w.map(Te=>o.jsxs("button",{type:"button",role:"tab","aria-selected":(B==null?void 0:B.id)===Te.id,className:(B==null?void 0:B.id)===Te.id?"is-active":"",onClick:()=>E(Te.id),children:[o.jsxs("span",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.style")}),o.jsx("strong",{children:ze(Te)})]}),o.jsxs("span",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.model")}),o.jsx("strong",{children:Re(Te.config.model)})]}),o.jsxs("span",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.progress")}),o.jsxs("strong",{children:[J(Te)?o.jsx(ate,{}):null,De(Te)]})]})]},Te.id))}),B?o.jsxs("div",{className:"skill-generation__candidate",children:[o.jsxs("section",{className:"skill-generation__activity",children:[o.jsx("header",{children:o.jsxs("div",{className:"skill-generation__candidate-summary",children:[o.jsxs("div",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.style")}),o.jsx("strong",{children:ze(B)})]}),o.jsxs("div",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.model")}),o.jsx("strong",{children:Re(B.config.model)})]}),o.jsxs("div",{className:"skill-generation__summary-row","aria-live":"polite",children:[o.jsx("span",{children:u("generation.progress")}),o.jsxs("strong",{children:[J(B)?o.jsx(ate,{}):null,J(B)?o.jsx(An,{children:De(B)}):De(B)]})]})]})}),B.task?o.jsx(wSt,{activities:B.task.activities}):null,B.pollError?o.jsx("div",{className:"skill-inline-notice",children:o.jsx(cl,{error:B.pollError})}):null,B.repairError?o.jsx("div",{className:"skill-inline-notice",children:o.jsx(cl,{error:B.repairError})}):null,B.error?o.jsxs("div",{className:"skill-inline-error",children:[o.jsx(cl,{error:B.error}),o.jsx("button",{type:"button",onClick:()=>void Oe(B),children:u("generation.retryCandidate")})]}):null,(Ce=B.task)!=null&&Ce.validation&&!B.task.validation.valid&&!B.repairing&&B.task.state==="failed"?o.jsxs("div",{className:"skill-validation-errors",children:[o.jsx("strong",{children:u("generation.formatValidationFailed")}),B.task.validation.errors.map(Te=>o.jsx("p",{children:Te},Te)),J5(B.task)?o.jsx("button",{type:"button",disabled:!!A,onClick:()=>void lt(),children:u("generation.repairAgain")}):null]}):null]}),o.jsxs("section",{className:"skill-generation__files",children:[o.jsxs("header",{children:[o.jsx("h2",{children:u("generation.files")}),((Ze=B.task)==null?void 0:Ze.state)==="ready"?o.jsx("button",{type:"button",onClick:()=>void Le(),disabled:!!A,children:u("generation.downloadZip")}):null]}),B.artifact?o.jsx(sje,{files:B.artifact.files}):o.jsx("div",{className:"skill-generation__files-empty",children:((at=B.task)==null?void 0:at.state)==="ready"?u("generation.loadingFiles"):u("generation.filesPending")})]}),((St=B.task)==null?void 0:St.state)==="ready"?o.jsxs("div",{className:"skill-generation__ready-actions",children:[ee?o.jsx("div",{className:"skill-generation__publish-target",children:o.jsx(SA,{label:u("generation.uploadToSpace"),value:I,options:re,onChange:H,disabled:r,placeholder:u(r?"generation.loadingSpaces":"generation.selectSpace")})}):null,o.jsxs("footer",{className:"skill-generation__followup",children:[o.jsx("textarea",{value:_,onChange:Te=>j(Te.target.value),placeholder:u("generation.continuePlaceholder")}),o.jsx("button",{type:"button",className:"skill-button",disabled:!_.trim()||!!A,onClick:()=>void Se(),children:u("generation.continue")}),o.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!!A||!!M||!se,onClick:()=>void $e(),children:A==="publish"?R||u("generation.uploading"):u(e==="optimize"?"generation.overwrite":ee?"generation.uploadToSelectedSpace":"generation.uploadToCurrentSpace")})]})]}):null,T?o.jsx("div",{className:"skill-inline-error skill-generation__action-error",children:o.jsx(cl,{error:T})}):null]}):null,!he&&w.every(Te=>Te.error)?o.jsx("div",{className:"skill-inline-error",children:u("generation.allCandidatesFailed")}):null]}):o.jsxs("div",{className:"skill-generation__setup",children:[o.jsx("div",{className:"skill-generation__section-head is-basic",children:o.jsx("div",{children:o.jsx("strong",{children:u("generation.basicInfo")})})}),o.jsxs("label",{children:[o.jsxs("span",{children:[u("generation.goal"),o.jsx("span",{className:"skill-required-mark","aria-hidden":"true",children:"*"})]}),o.jsx("textarea",{required:!0,value:g,onChange:Te=>b(Te.target.value),placeholder:u(e==="create"?"generation.createIntentPlaceholder":"generation.optimizeIntentPlaceholder")})]}),o.jsxs("label",{children:[o.jsx("span",{children:u("generation.skillName")}),o.jsx("input",{value:v,onChange:Te=>y(Te.target.value),placeholder:u("generation.autoNamePlaceholder"),"aria-invalid":!!ge,"aria-describedby":"skill-name-help"}),ge?o.jsx("span",{id:"skill-name-help",className:"skill-generation__field-error",role:"alert",children:ge}):o.jsx("span",{id:"skill-name-help",className:"skill-generation__field-help",children:u("generation.nameHelp")})]}),o.jsx("div",{className:"skill-generation__section-head",children:o.jsxs("div",{children:[o.jsx("strong",{children:u(e==="create"?"generation.createPlans":"generation.optimizePlans")}),o.jsx("span",{children:u(e==="create"?"generation.createPlansDescription":"generation.optimizePlansDescription")})]})}),o.jsxs("div",{className:"skill-generation__groups",children:[x.map((Te,ye)=>o.jsxs("article",{className:"skill-generation__group",children:[o.jsxs("header",{children:[o.jsx("strong",{children:u("generation.plan",{count:ye+1})}),x.length>1?o.jsx("button",{type:"button",onClick:()=>O(Ve=>Ve.filter(nt=>nt.id!==Te.id)),children:u("generation.remove")}):null]}),o.jsx(SA,{label:u("generation.model"),required:!0,value:Te.model,options:(d==null?void 0:d.models.map(Ve=>({value:Ve.id,label:Ve.label})))||[],onChange:Ve=>X(Te.id,{model:Ve}),allowCustom:!0,placeholder:u("generation.modelPlaceholder"),error:ote(Te.model.trim())}),o.jsx(SA,{label:u("generation.style"),required:!0,value:Te.style,options:Ee,onChange:Ve=>X(Te.id,{style:Ve})}),Te.style==="custom"?o.jsxs("label",{children:[o.jsx("span",{children:u("generation.customStyle")}),o.jsx("textarea",{value:Te.customStyle,onChange:Ve=>X(Te.id,{customStyle:Ve.target.value}),placeholder:u("generation.customStylePlaceholder")})]}):null]},Te.id)),d&&x.lengthO(Te=>[...Te,rte(Te.length,d)]),children:u("generation.addConfiguration")}):null]}),h?o.jsx("div",{className:"skill-inline-error",children:o.jsx(cl,{error:h})}):null,d&&!d.enabled?o.jsx("div",{className:"skill-inline-notice",children:u("generation.notConfigured")}):null,o.jsx("div",{className:"skill-generation__setup-actions",children:o.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!W,onClick:()=>void ue(),children:u("generation.generate")})})]})]})}function WQ({title:e,children:t,onClose:n,className:i=""}){const{t:r}=Ae("skills"),s=m.useRef(null);return m.useEffect(()=>{var l;(l=s.current)==null||l.focus();const a=c=>c.key==="Escape"&&n();return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[n]),o.jsx("div",{className:"skill-dialog-backdrop",onMouseDown:n,children:o.jsxs("section",{className:`skill-dialog${i?` ${i}`:""}`,role:"dialog","aria-modal":"true","aria-label":e,onMouseDown:a=>a.stopPropagation(),children:[o.jsxs("header",{children:[o.jsx("h2",{children:e}),o.jsx("button",{ref:s,type:"button",onClick:n,"aria-label":r("management.close"),children:r("management.close")})]}),t]})})}function t5t({region:e,regionOptions:t,onClose:n,onCreated:i}){const{t:r}=Ae("skills"),[s,a]=m.useState(""),[l,c]=m.useState(""),[u,d]=m.useState(e),[f,h]=m.useState(!1),[p,g]=m.useState(null),b=async()=>{if(s.trim()){h(!0),g(null);try{const v=await g1t({name:s.trim(),description:l.trim()||void 0,region:u});i({...v,region:v.region||u})}catch(v){g(ja(v,r("management.createSpaceFailed")))}finally{h(!1)}}};return o.jsxs(WQ,{title:r("management.createSpaceTitle"),onClose:n,children:[o.jsxs("div",{className:"skill-dialog__body",children:[o.jsxs("label",{children:[o.jsx("span",{children:r("management.name")}),o.jsx("input",{autoFocus:!0,value:s,maxLength:128,onChange:v=>a(v.target.value)})]}),o.jsx(SA,{label:r("management.region"),value:u,options:t,onChange:d,required:!0}),o.jsxs("label",{children:[o.jsx("span",{children:r("management.optionalDescription")}),o.jsx("textarea",{value:l,maxLength:1024,onChange:v=>c(v.target.value)})]}),p?o.jsx("div",{className:"skill-inline-error",children:o.jsx(cl,{error:p})}):null]}),o.jsxs("footer",{children:[o.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),o.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!s.trim()||f,onClick:()=>void b(),children:r(f?"management.creating":"management.create")})]})]})}function n5t({space:e,region:t,onClose:n,onUpdated:i}){const{t:r}=Ae("skills"),[s,a]=m.useState(e.name),[l,c]=m.useState(e.description||""),[u,d]=m.useState(!1),[f,h]=m.useState(null),p=async()=>{if(s.trim()){d(!0),h(null);try{const g=await b1t({spaceId:e.id,name:s.trim(),description:l.trim()||void 0,region:t});i({...e,...g,skillCount:e.skillCount})}catch(g){h(ja(g,r("management.updateSpaceFailed")))}finally{d(!1)}}};return o.jsxs(WQ,{title:r("management.editSpaceTitle"),onClose:n,children:[o.jsxs("div",{className:"skill-dialog__body",children:[o.jsxs("label",{children:[o.jsx("span",{children:r("management.name")}),o.jsx("input",{autoFocus:!0,value:s,maxLength:128,onChange:g=>a(g.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:r("management.optionalDescription")}),o.jsx("textarea",{value:l,maxLength:1024,onChange:g=>c(g.target.value)})]}),f?o.jsx("div",{className:"skill-inline-error",children:o.jsx(cl,{error:f})}):null]}),o.jsxs("footer",{children:[o.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),o.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!s.trim()||u,onClick:()=>void p(),children:r(u?"management.saving":"management.save")})]})]})}function i5t({space:e,region:t,onClose:n,onUploaded:i}){const{t:r,i18n:s}=Ae("skills"),[a,l]=m.useState(null),[c,u]=m.useState(null),[d,f]=m.useState(!1),[h,p]=m.useState(!1),[g,b]=m.useState(null),[v,y]=m.useState(!1),x=m.useRef(0),O=m.useRef(null),w=async S=>{const E=x.current+1;if(x.current=E,l(S),u(null),b(null),f(!!S),!!S)try{const C=await x1t(S);x.current===E&&u({name:C.name,fileCount:C.files.length})}catch(C){x.current===E&&b(ja(C,r("management.archiveValidationFailed")))}finally{x.current===E&&f(!1)}},k=async()=>{if(!(!a||!c)){p(!0),b(null);try{await v1t({spaceId:e.id,region:t,project:e.projectName,file:a}),i()}catch(S){b(ja(S,r("management.uploadFailed")))}finally{p(!1)}}};return o.jsxs(WQ,{title:r("management.uploadTitle",{name:e.name}),className:"skill-upload-dialog",onClose:n,children:[o.jsxs("div",{className:"skill-dialog__body",children:[o.jsx("input",{ref:O,className:"skill-upload-dialog__input",type:"file",accept:".zip,application/zip",onChange:S=>{var E;return void w(((E=S.target.files)==null?void 0:E[0])||null)}}),o.jsxs("button",{type:"button",className:`skill-upload-dropzone${v?" is-dragging":""}`,onClick:()=>{var S;return(S=O.current)==null?void 0:S.click()},onDragEnter:S=>{S.preventDefault(),y(!0)},onDragOver:S=>{S.preventDefault(),S.dataTransfer.dropEffect="copy",y(!0)},onDragLeave:S=>{S.currentTarget.contains(S.relatedTarget)||y(!1)},onDrop:S=>{var E;S.preventDefault(),y(!1),w(((E=S.dataTransfer.files)==null?void 0:E[0])||null)},children:[o.jsx("strong",{children:a?a.name:r("management.dropzone")}),o.jsx("span",{children:a?r("fileTree.bytes",{value:new Intl.NumberFormat(s.resolvedLanguage).format(a.size)}):r("management.chooseLocalFile")})]}),o.jsx("p",{children:r("management.archiveHelp")}),d?o.jsx("div",{className:"skill-inline-notice",children:r("management.validating")}):null,c?o.jsx("div",{className:"skill-inline-notice",children:r("management.validationPassed",{name:c.name,count:c.fileCount})}):null,g?o.jsx("div",{className:"skill-inline-error",children:o.jsx(cl,{error:g})}):null]}),o.jsxs("footer",{children:[o.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),o.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!a||!c||d||h,onClick:()=>void k(),children:r(h?"management.uploading":"management.upload")})]})]})}function r5t(e){if(typeof e=="number")return e<1e12?e*1e3:e;const t=e.trim(),n=Number(t);return/^\d+(?:\.\d+)?$/.test(t)?n<1e12?n*1e3:n:Date.parse(t)}function GQ(e,t=Date.now(),n="zh-CN"){if(e===void 0||e==="")return"—";const i=r5t(e);if(!Number.isFinite(i))return"—";const r=Math.floor(Math.max(0,t-i)/1e3),s=new Intl.RelativeTimeFormat(n,{numeric:"always"}),a=(f,h,p)=>n.toLowerCase().startsWith("zh")?`${f} ${p}前`:s.format(-f,h);if(r<60)return a(r,"second","秒");const l=Math.floor(r/60);if(l<60)return a(l,"minute","分钟");const c=Math.floor(l/60);if(c<24)return a(c,"hour","小时");const u=Math.floor(c/24);if(u<30)return a(u,"day","天");const d=Math.floor(u/30);return d<12?a(d,"month","个月"):a(Math.floor(d/12),"year","年")}const s5t=12,lte=12;function oj({disabled:e,placement:t="top",children:n}){const{t:i}=Ae("ui"),r=m.useId();return o.jsxs("span",{className:`skillcenter-disabled-action${e?" is-disabled":""} is-${t}`,tabIndex:e?0:void 0,"aria-describedby":e?r:void 0,children:[n,e?o.jsx("span",{id:r,className:"skillcenter-disabled-tooltip",role:"tooltip",children:i("skillCenter.sandboxNotConfigured")}):null]})}const a5t=new Set(["active","available","creating","disabled","enabled","failed","inactive","pending","published","ready","released","running","success","unavailable","unreleased","updating"]);function oje(e,t){const n=(e||"").trim().toLowerCase();return a5t.has(n)?t(`skillCenter.status.${n}`):t("skillCenter.status.unknown")}function o5t(e){const t=(e||"").toLowerCase();return["active","available","enabled","published","ready","released","success"].includes(t)||t==="running"?"is-positive":["creating","pending","updating"].includes(t)?"is-progress":["failed","unavailable"].includes(t)?"is-danger":"is-muted"}function l5t(e,t){if(!e)return"";const n=e.trim(),i=Number(n),r=/^\d+(?:\.\d+)?$/.test(n)?new Date(i<1e12?i*1e3:i):new Date(n);return Number.isNaN(r.getTime())?e:new Intl.DateTimeFormat(t,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(r)}function cte(e){if(!e)return 0;const t=e.trim(),n=Number(t),i=/^\d+(?:\.\d+)?$/.test(t)?new Date(n<1e12?n*1e3:n):new Date(t);return Number.isNaN(i.getTime())?0:i.getTime()}function zl(e){return`${e.region||"default"}:${e.projectName||"default"}:${e.id}`}function c5t(e,t){const n=new Map(e.map(i=>[zl(i),i]));for(const i of t)n.set(zl(i),i);return[...n.values()].sort((i,r)=>cte(r.updatedAt)-cte(i.updatedAt))}function u5t(e){const t=e.replace(/\r\n/g,` +`)}function XMt(e){var t;if(e.repairing||((t=e.task)==null?void 0:t.state)==="running"&&e.repairMode){if(e.repairMode==="manual")return Vt("generation.stages.repairingAgain");const n=Math.max(1,e.repairAttempts||1);return Vt("generation.stages.autoRepairing",{attempt:n,max:aje})}return KMt(e.task)}function ate(){return o.jsxs("svg",{className:"skill-generation__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 YMt(e,t=Date.now()){if(!(e!=null&&e.expiresAt))return Vt("generation.sessionMax");const n=Math.max(0,new Date(e.expiresAt).getTime()-t),i=Math.floor(n/6e4),r=Math.floor(n%6e4/1e3);return Vt("generation.remaining",{minutes:i,seconds:String(r).padStart(2,"0")})}function ZMt(e){return e?e.length>64?Vt("generation.validation.nameTooLong"):/^[a-z0-9-]+$/.test(e)?"":Vt("generation.validation.invalidName"):""}function ote(e){return e?e.length>128?Vt("generation.validation.modelTooLong"):/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/.test(e)?"":Vt("generation.validation.invalidModel"):""}function eL(e){return`${e.region||""}:${e.id}`}function JMt(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m14.5 6-6 6 6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function e5t({operation:e,cloudProvider:t,space:n,availableSpaces:i=[],spacesLoading:r=!1,initialIntent:s="",source:a,onBack:l,onPublished:c}){var oe,Me,Ve,ht;const{t:u}=Ce("skills"),[d,f]=m.useState(null),[h,p]=m.useState(null),[g,b]=m.useState(s),[v,y]=m.useState(""),[x,O]=m.useState([]),[w,k]=m.useState([]),[S,E]=m.useState(""),[C,N]=m.useState(!1),[_,j]=m.useState(""),[A,F]=m.useState(""),[T,P]=m.useState(null),[R,L]=m.useState(""),[M,U]=m.useState(""),[I,H]=m.useState(n?eL(n):""),[Z,Q]=m.useState(Date.now()),q=m.useRef([]);m.useEffect(()=>{const Se=new AbortController;return sI(Se.signal).then(ve=>{f(ve),O([rte(0,ve)])}).catch(ve=>{Se.signal.aborted||p(ja(ve,Vt("generation.errors.loadCapability")))}),()=>Se.abort()},[]),m.useEffect(()=>{q.current=w},[w]),m.useEffect(()=>{const Se=window.setInterval(()=>Q(Date.now()),1e3);return()=>window.clearInterval(Se)},[]),m.useEffect(()=>{const Se=ve=>{q.current.some($e=>{var qe;return((qe=$e.task)==null?void 0:qe.state)==="running"||$e.repairing})&&ve.preventDefault()};return window.addEventListener("beforeunload",Se),()=>{var ve;window.removeEventListener("beforeunload",Se);for(const $e of q.current)(ve=$e.task)!=null&&ve.jobId&&M1t($e.task.jobId).catch(()=>{})}},[]),m.useEffect(()=>{if(!w.some(qe=>{var ke;return((ke=qe.task)==null?void 0:ke.state)==="running"||qe.repairing}))return;let Se=!1,ve;const $e=async()=>{const qe=q.current,ke=await Promise.all(qe.map(async Tt=>{var Jt;if(((Jt=Tt.task)==null?void 0:Jt.state)!=="running")return Tt;try{const on=await I1t(Tt.task.jobId);if(J5(on)&&(Tt.repairAttempts||0)rt.map(gt=>gt.id===Tt.id?{...gt,task:on,repairing:!0,repairMode:"auto",repairAttempts:Bt,repairError:void 0}:gt));try{const rt=await VM({jobId:on.jobId,intent:ste(on),expectedRevision:on.revision});return{...Tt,task:rt,artifact:void 0,repairing:!1,repairMode:"auto",repairAttempts:Bt,repairError:void 0,error:void 0,pollError:void 0}}catch(rt){return{...Tt,task:on,repairing:!1,repairMode:void 0,repairAttempts:Bt,repairError:ja(rt,Vt("generation.errors.autoRepair")),pollError:void 0}}}let Et=Tt.artifact;return on.state==="ready"&&(Et=await zM(on.jobId,on.revision)),{...Tt,task:on,artifact:Et,repairing:!1,repairMode:on.state==="running"?Tt.repairMode:void 0,repairError:void 0,error:void 0,pollError:void 0}}catch(on){return{...Tt,pollError:ja(on,Vt("generation.errors.pollCandidate"))}}}));Se||(k(ke),ve=window.setTimeout(()=>void $e(),qMt))};return $e(),()=>{Se=!0,ve!==void 0&&window.clearTimeout(ve)}},[w.some(Se=>{var ve;return((ve=Se.task)==null?void 0:ve.state)==="running"||Se.repairing})]);const B=w.find(Se=>Se.id===S)||w[0],te=e==="create"&&!n,ce=i.find(Se=>eL(Se)===I)??null,se=n??ce,re=i.map(Se=>({value:eL(Se),label:`${Se.name.trim()||u("generation.unnamedSpace")} · ${xh(Se.region||"cn-beijing",t)}`})),ge=ZMt(v),G=!!(d!=null&&d.enabled&&g.trim()&&!ge&&x.length>0&&x.every(Se=>Se.model.trim()&&!ote(Se.model.trim()))),K=(Se,ve)=>{O($e=>$e.map(qe=>qe.id===Se?{...qe,...ve}:qe))},ae=async Se=>{const ve={...Se,model:Se.model.trim()},$e=Se.style==="custom"?Se.customStyle.trim():Se.style;try{const qe=await R1t({operation:e,intent:g.trim(),model:ve.model,style:$e,name:v.trim()||void 0,source:a});return{id:Se.id,config:ve,task:qe}}catch(qe){return{id:Se.id,config:ve,error:ja(qe,Vt("generation.errors.createCandidate"))}}},ue=async()=>{if(!G)return;N(!0),P(null);const Se=x.map($e=>({id:$e.id,config:$e}));k(Se),E(x[0].id);const ve=await Promise.all(x.map(ae));k(ve)},xe=async Se=>{k($e=>$e.map(qe=>qe.id===Se.id?{...qe,error:void 0}:qe));const ve=await ae(Se.config);k($e=>$e.map(qe=>qe.id===Se.id?ve:qe))},Ee=async()=>{if(!(!(B!=null&&B.task)||!_.trim()||B.task.state!=="ready")){F("refine"),P(null);try{const Se=await VM({jobId:B.task.jobId,intent:_.trim(),expectedRevision:B.task.revision});k(ve=>ve.map($e=>$e.id===B.id?{...$e,task:Se,artifact:void 0}:$e)),j("")}catch(Se){P(ja(Se,Vt("generation.errors.refine")))}finally{F("")}}},Je=async()=>{if(!(!(B!=null&&B.task)||!J5(B.task))){F("refine"),P(null),k(Se=>Se.map(ve=>ve.id===B.id?{...ve,repairing:!0,repairMode:"manual",repairError:void 0}:ve));try{const Se=await VM({jobId:B.task.jobId,intent:ste(B.task),expectedRevision:B.task.revision});k(ve=>ve.map($e=>$e.id===B.id?{...$e,task:Se,artifact:void 0,repairing:!1,repairMode:"manual",repairError:void 0}:$e))}catch(Se){k(ve=>ve.map($e=>$e.id===B.id?{...$e,repairing:!1,repairMode:void 0,repairError:ja(Se,Vt("generation.errors.repairAgain"))}:$e))}finally{F("")}}},De=async()=>{if(!(!(B!=null&&B.task)||B.task.state!=="ready"||M)){F("publish"),P(null);try{if(!se)throw new Error(Vt("generation.errors.selectSpace"));const Se=B.artifact||await zM(B.task.jobId,B.task.revision),ve=(a==null?void 0:a.region)||se.region||"";if(!tR(ve))throw new Error(Vt("generation.errors.unsupportedRegion"));await D1t({jobId:B.task.jobId,expectedRevision:B.task.revision,expectedArtifactSha256:Se.sha256,disposition:e==="optimize"?"update-source":"create-new",skillSpaceIds:[se.id],projectName:(a==null?void 0:a.projectName)||se.projectName,region:ve,onProgress:$e=>L($e.message)}),U(B.id),c()}catch(Se){P(ja(Se,Vt("generation.errors.upload")))}finally{F(""),L("")}}},Pe=async()=>{if(!(!(B!=null&&B.task)||B.task.state!=="ready")){F("download");try{const Se=B.artifact||await zM(B.task.jobId,B.task.revision);await L1t(B.task.jobId,B.task.revision,Se.sha256)}catch(Se){P(ja(Se,Vt("generation.errors.download")))}finally{F("")}}},Ne=async()=>{w.some(Se=>{var ve;return((ve=Se.task)==null?void 0:ve.state)==="running"})&&!window.confirm(Vt("generation.leaveConfirmation"))||(await Promise.allSettled(w.flatMap(Se=>{var ve;return((ve=Se.task)==null?void 0:ve.state)==="running"?[P1t({jobId:Se.task.jobId,expectedRevision:Se.task.revision})]:[]})),l())},Ke=e==="create"?u("generation.createTitle"):u("generation.optimizeTitle",{name:(a==null?void 0:a.name)||u("generation.skillFallback")}),wt=Se=>{var ve;return((ve=d==null?void 0:d.models.find($e=>$e.id===Se))==null?void 0:ve.label)||Se},ot=Se=>Se.config.style==="custom"?Se.config.customStyle.trim()||u("generation.styles.customFallback"):u(ite[Se.config.style]),Ie=[...Object.entries(ite).map(([Se,ve])=>({value:Se,label:u(ve)})),{value:"custom",label:u("generation.styles.custom")}],Be=Se=>Se.error||Se.repairError?u("generation.stages.failed"):XMt(Se),J=Se=>!Se.error&&!Se.repairError&&(Se.repairing||!Se.task||Se.task.state==="running"),pe=w.some(Se=>{var ve;return((ve=Se.task)==null?void 0:ve.state)==="ready"});return o.jsxs("section",{className:"skill-generation",children:[o.jsxs("header",{className:"skill-generation__header",children:[o.jsx("button",{type:"button",className:"skillcenter-back",onClick:()=>void Ne(),"aria-label":u("generation.back"),children:o.jsx(JMt,{})}),o.jsxs("div",{children:[o.jsx("h1",{children:Ke}),o.jsx("p",{children:(n==null?void 0:n.name)||u("generation.home")})]}),w.length>0?o.jsx("span",{className:"skill-generation__ttl",children:YMt(B==null?void 0:B.task,Z)}):null]}),C?o.jsxs("div",{className:"skill-generation__workspace",children:[o.jsx("div",{className:"skill-generation__candidate-tabs",role:"tablist","aria-label":u("generation.candidates"),children:w.map(Se=>o.jsxs("button",{type:"button",role:"tab","aria-selected":(B==null?void 0:B.id)===Se.id,className:(B==null?void 0:B.id)===Se.id?"is-active":"",onClick:()=>E(Se.id),children:[o.jsxs("span",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.style")}),o.jsx("strong",{children:ot(Se)})]}),o.jsxs("span",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.model")}),o.jsx("strong",{children:wt(Se.config.model)})]}),o.jsxs("span",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.progress")}),o.jsxs("strong",{children:[J(Se)?o.jsx(ate,{}):null,Be(Se)]})]})]},Se.id))}),B?o.jsxs("div",{className:"skill-generation__candidate",children:[o.jsxs("section",{className:"skill-generation__activity",children:[o.jsx("header",{children:o.jsxs("div",{className:"skill-generation__candidate-summary",children:[o.jsxs("div",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.style")}),o.jsx("strong",{children:ot(B)})]}),o.jsxs("div",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.model")}),o.jsx("strong",{children:wt(B.config.model)})]}),o.jsxs("div",{className:"skill-generation__summary-row","aria-live":"polite",children:[o.jsx("span",{children:u("generation.progress")}),o.jsxs("strong",{children:[J(B)?o.jsx(ate,{}):null,J(B)?o.jsx(An,{children:Be(B)}):Be(B)]})]})]})}),B.task?o.jsx(wSt,{activities:B.task.activities}):null,B.pollError?o.jsx("div",{className:"skill-inline-notice",children:o.jsx(cl,{error:B.pollError})}):null,B.repairError?o.jsx("div",{className:"skill-inline-notice",children:o.jsx(cl,{error:B.repairError})}):null,B.error?o.jsxs("div",{className:"skill-inline-error",children:[o.jsx(cl,{error:B.error}),o.jsx("button",{type:"button",onClick:()=>void xe(B),children:u("generation.retryCandidate")})]}):null,(oe=B.task)!=null&&oe.validation&&!B.task.validation.valid&&!B.repairing&&B.task.state==="failed"?o.jsxs("div",{className:"skill-validation-errors",children:[o.jsx("strong",{children:u("generation.formatValidationFailed")}),B.task.validation.errors.map(Se=>o.jsx("p",{children:Se},Se)),J5(B.task)?o.jsx("button",{type:"button",disabled:!!A,onClick:()=>void Je(),children:u("generation.repairAgain")}):null]}):null]}),o.jsxs("section",{className:"skill-generation__files",children:[o.jsxs("header",{children:[o.jsx("h2",{children:u("generation.files")}),((Me=B.task)==null?void 0:Me.state)==="ready"?o.jsx("button",{type:"button",onClick:()=>void Pe(),disabled:!!A,children:u("generation.downloadZip")}):null]}),B.artifact?o.jsx(sje,{files:B.artifact.files}):o.jsx("div",{className:"skill-generation__files-empty",children:((Ve=B.task)==null?void 0:Ve.state)==="ready"?u("generation.loadingFiles"):u("generation.filesPending")})]}),((ht=B.task)==null?void 0:ht.state)==="ready"?o.jsxs("div",{className:"skill-generation__ready-actions",children:[te?o.jsx("div",{className:"skill-generation__publish-target",children:o.jsx(SA,{label:u("generation.uploadToSpace"),value:I,options:re,onChange:H,disabled:r,placeholder:u(r?"generation.loadingSpaces":"generation.selectSpace")})}):null,o.jsxs("footer",{className:"skill-generation__followup",children:[o.jsx("textarea",{value:_,onChange:Se=>j(Se.target.value),placeholder:u("generation.continuePlaceholder")}),o.jsx("button",{type:"button",className:"skill-button",disabled:!_.trim()||!!A,onClick:()=>void Ee(),children:u("generation.continue")}),o.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!!A||!!M||!se,onClick:()=>void De(),children:A==="publish"?R||u("generation.uploading"):u(e==="optimize"?"generation.overwrite":te?"generation.uploadToSelectedSpace":"generation.uploadToCurrentSpace")})]})]}):null,T?o.jsx("div",{className:"skill-inline-error skill-generation__action-error",children:o.jsx(cl,{error:T})}):null]}):null,!pe&&w.every(Se=>Se.error)?o.jsx("div",{className:"skill-inline-error",children:u("generation.allCandidatesFailed")}):null]}):o.jsxs("div",{className:"skill-generation__setup",children:[o.jsx("div",{className:"skill-generation__section-head is-basic",children:o.jsx("div",{children:o.jsx("strong",{children:u("generation.basicInfo")})})}),o.jsxs("label",{children:[o.jsxs("span",{children:[u("generation.goal"),o.jsx("span",{className:"skill-required-mark","aria-hidden":"true",children:"*"})]}),o.jsx("textarea",{required:!0,value:g,onChange:Se=>b(Se.target.value),placeholder:u(e==="create"?"generation.createIntentPlaceholder":"generation.optimizeIntentPlaceholder")})]}),o.jsxs("label",{children:[o.jsx("span",{children:u("generation.skillName")}),o.jsx("input",{value:v,onChange:Se=>y(Se.target.value),placeholder:u("generation.autoNamePlaceholder"),"aria-invalid":!!ge,"aria-describedby":"skill-name-help"}),ge?o.jsx("span",{id:"skill-name-help",className:"skill-generation__field-error",role:"alert",children:ge}):o.jsx("span",{id:"skill-name-help",className:"skill-generation__field-help",children:u("generation.nameHelp")})]}),o.jsx("div",{className:"skill-generation__section-head",children:o.jsxs("div",{children:[o.jsx("strong",{children:u(e==="create"?"generation.createPlans":"generation.optimizePlans")}),o.jsx("span",{children:u(e==="create"?"generation.createPlansDescription":"generation.optimizePlansDescription")})]})}),o.jsxs("div",{className:"skill-generation__groups",children:[x.map((Se,ve)=>o.jsxs("article",{className:"skill-generation__group",children:[o.jsxs("header",{children:[o.jsx("strong",{children:u("generation.plan",{count:ve+1})}),x.length>1?o.jsx("button",{type:"button",onClick:()=>O($e=>$e.filter(qe=>qe.id!==Se.id)),children:u("generation.remove")}):null]}),o.jsx(SA,{label:u("generation.model"),required:!0,value:Se.model,options:(d==null?void 0:d.models.map($e=>({value:$e.id,label:$e.label})))||[],onChange:$e=>K(Se.id,{model:$e}),allowCustom:!0,placeholder:u("generation.modelPlaceholder"),error:ote(Se.model.trim())}),o.jsx(SA,{label:u("generation.style"),required:!0,value:Se.style,options:Ie,onChange:$e=>K(Se.id,{style:$e})}),Se.style==="custom"?o.jsxs("label",{children:[o.jsx("span",{children:u("generation.customStyle")}),o.jsx("textarea",{value:Se.customStyle,onChange:$e=>K(Se.id,{customStyle:$e.target.value}),placeholder:u("generation.customStylePlaceholder")})]}):null]},Se.id)),d&&x.lengthO(Se=>[...Se,rte(Se.length,d)]),children:u("generation.addConfiguration")}):null]}),h?o.jsx("div",{className:"skill-inline-error",children:o.jsx(cl,{error:h})}):null,d&&!d.enabled?o.jsx("div",{className:"skill-inline-notice",children:u("generation.notConfigured")}):null,o.jsx("div",{className:"skill-generation__setup-actions",children:o.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!G,onClick:()=>void ue(),children:u("generation.generate")})})]})]})}function WQ({title:e,children:t,onClose:n,className:i=""}){const{t:r}=Ce("skills"),s=m.useRef(null);return m.useEffect(()=>{var l;(l=s.current)==null||l.focus();const a=c=>c.key==="Escape"&&n();return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[n]),o.jsx("div",{className:"skill-dialog-backdrop",onMouseDown:n,children:o.jsxs("section",{className:`skill-dialog${i?` ${i}`:""}`,role:"dialog","aria-modal":"true","aria-label":e,onMouseDown:a=>a.stopPropagation(),children:[o.jsxs("header",{children:[o.jsx("h2",{children:e}),o.jsx("button",{ref:s,type:"button",onClick:n,"aria-label":r("management.close"),children:r("management.close")})]}),t]})})}function t5t({region:e,regionOptions:t,onClose:n,onCreated:i}){const{t:r}=Ce("skills"),[s,a]=m.useState(""),[l,c]=m.useState(""),[u,d]=m.useState(e),[f,h]=m.useState(!1),[p,g]=m.useState(null),b=async()=>{if(s.trim()){h(!0),g(null);try{const v=await g1t({name:s.trim(),description:l.trim()||void 0,region:u});i({...v,region:v.region||u})}catch(v){g(ja(v,r("management.createSpaceFailed")))}finally{h(!1)}}};return o.jsxs(WQ,{title:r("management.createSpaceTitle"),onClose:n,children:[o.jsxs("div",{className:"skill-dialog__body",children:[o.jsxs("label",{children:[o.jsx("span",{children:r("management.name")}),o.jsx("input",{autoFocus:!0,value:s,maxLength:128,onChange:v=>a(v.target.value)})]}),o.jsx(SA,{label:r("management.region"),value:u,options:t,onChange:d,required:!0}),o.jsxs("label",{children:[o.jsx("span",{children:r("management.optionalDescription")}),o.jsx("textarea",{value:l,maxLength:1024,onChange:v=>c(v.target.value)})]}),p?o.jsx("div",{className:"skill-inline-error",children:o.jsx(cl,{error:p})}):null]}),o.jsxs("footer",{children:[o.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),o.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!s.trim()||f,onClick:()=>void b(),children:r(f?"management.creating":"management.create")})]})]})}function n5t({space:e,region:t,onClose:n,onUpdated:i}){const{t:r}=Ce("skills"),[s,a]=m.useState(e.name),[l,c]=m.useState(e.description||""),[u,d]=m.useState(!1),[f,h]=m.useState(null),p=async()=>{if(s.trim()){d(!0),h(null);try{const g=await b1t({spaceId:e.id,name:s.trim(),description:l.trim()||void 0,region:t});i({...e,...g,skillCount:e.skillCount})}catch(g){h(ja(g,r("management.updateSpaceFailed")))}finally{d(!1)}}};return o.jsxs(WQ,{title:r("management.editSpaceTitle"),onClose:n,children:[o.jsxs("div",{className:"skill-dialog__body",children:[o.jsxs("label",{children:[o.jsx("span",{children:r("management.name")}),o.jsx("input",{autoFocus:!0,value:s,maxLength:128,onChange:g=>a(g.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:r("management.optionalDescription")}),o.jsx("textarea",{value:l,maxLength:1024,onChange:g=>c(g.target.value)})]}),f?o.jsx("div",{className:"skill-inline-error",children:o.jsx(cl,{error:f})}):null]}),o.jsxs("footer",{children:[o.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),o.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!s.trim()||u,onClick:()=>void p(),children:r(u?"management.saving":"management.save")})]})]})}function i5t({space:e,region:t,onClose:n,onUploaded:i}){const{t:r,i18n:s}=Ce("skills"),[a,l]=m.useState(null),[c,u]=m.useState(null),[d,f]=m.useState(!1),[h,p]=m.useState(!1),[g,b]=m.useState(null),[v,y]=m.useState(!1),x=m.useRef(0),O=m.useRef(null),w=async S=>{const E=x.current+1;if(x.current=E,l(S),u(null),b(null),f(!!S),!!S)try{const C=await x1t(S);x.current===E&&u({name:C.name,fileCount:C.files.length})}catch(C){x.current===E&&b(ja(C,r("management.archiveValidationFailed")))}finally{x.current===E&&f(!1)}},k=async()=>{if(!(!a||!c)){p(!0),b(null);try{await v1t({spaceId:e.id,region:t,project:e.projectName,file:a}),i()}catch(S){b(ja(S,r("management.uploadFailed")))}finally{p(!1)}}};return o.jsxs(WQ,{title:r("management.uploadTitle",{name:e.name}),className:"skill-upload-dialog",onClose:n,children:[o.jsxs("div",{className:"skill-dialog__body",children:[o.jsx("input",{ref:O,className:"skill-upload-dialog__input",type:"file",accept:".zip,application/zip",onChange:S=>{var E;return void w(((E=S.target.files)==null?void 0:E[0])||null)}}),o.jsxs("button",{type:"button",className:`skill-upload-dropzone${v?" is-dragging":""}`,onClick:()=>{var S;return(S=O.current)==null?void 0:S.click()},onDragEnter:S=>{S.preventDefault(),y(!0)},onDragOver:S=>{S.preventDefault(),S.dataTransfer.dropEffect="copy",y(!0)},onDragLeave:S=>{S.currentTarget.contains(S.relatedTarget)||y(!1)},onDrop:S=>{var E;S.preventDefault(),y(!1),w(((E=S.dataTransfer.files)==null?void 0:E[0])||null)},children:[o.jsx("strong",{children:a?a.name:r("management.dropzone")}),o.jsx("span",{children:a?r("fileTree.bytes",{value:new Intl.NumberFormat(s.resolvedLanguage).format(a.size)}):r("management.chooseLocalFile")})]}),o.jsx("p",{children:r("management.archiveHelp")}),d?o.jsx("div",{className:"skill-inline-notice",children:r("management.validating")}):null,c?o.jsx("div",{className:"skill-inline-notice",children:r("management.validationPassed",{name:c.name,count:c.fileCount})}):null,g?o.jsx("div",{className:"skill-inline-error",children:o.jsx(cl,{error:g})}):null]}),o.jsxs("footer",{children:[o.jsx("button",{type:"button",className:"skill-button",onClick:n,children:r("management.cancel")}),o.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!a||!c||d||h,onClick:()=>void k(),children:r(h?"management.uploading":"management.upload")})]})]})}function r5t(e){if(typeof e=="number")return e<1e12?e*1e3:e;const t=e.trim(),n=Number(t);return/^\d+(?:\.\d+)?$/.test(t)?n<1e12?n*1e3:n:Date.parse(t)}function GQ(e,t=Date.now(),n="zh-CN"){if(e===void 0||e==="")return"—";const i=r5t(e);if(!Number.isFinite(i))return"—";const r=Math.floor(Math.max(0,t-i)/1e3),s=new Intl.RelativeTimeFormat(n,{numeric:"always"}),a=(f,h,p)=>n.toLowerCase().startsWith("zh")?`${f} ${p}前`:s.format(-f,h);if(r<60)return a(r,"second","秒");const l=Math.floor(r/60);if(l<60)return a(l,"minute","分钟");const c=Math.floor(l/60);if(c<24)return a(c,"hour","小时");const u=Math.floor(c/24);if(u<30)return a(u,"day","天");const d=Math.floor(u/30);return d<12?a(d,"month","个月"):a(Math.floor(d/12),"year","年")}const s5t=12,lte=12;function oj({disabled:e,placement:t="top",children:n}){const{t:i}=Ce("ui"),r=m.useId();return o.jsxs("span",{className:`skillcenter-disabled-action${e?" is-disabled":""} is-${t}`,tabIndex:e?0:void 0,"aria-describedby":e?r:void 0,children:[n,e?o.jsx("span",{id:r,className:"skillcenter-disabled-tooltip",role:"tooltip",children:i("skillCenter.sandboxNotConfigured")}):null]})}const a5t=new Set(["active","available","creating","disabled","enabled","failed","inactive","pending","published","ready","released","running","success","unavailable","unreleased","updating"]);function oje(e,t){const n=(e||"").trim().toLowerCase();return a5t.has(n)?t(`skillCenter.status.${n}`):t("skillCenter.status.unknown")}function o5t(e){const t=(e||"").toLowerCase();return["active","available","enabled","published","ready","released","success"].includes(t)||t==="running"?"is-positive":["creating","pending","updating"].includes(t)?"is-progress":["failed","unavailable"].includes(t)?"is-danger":"is-muted"}function l5t(e,t){if(!e)return"";const n=e.trim(),i=Number(n),r=/^\d+(?:\.\d+)?$/.test(n)?new Date(i<1e12?i*1e3:i):new Date(n);return Number.isNaN(r.getTime())?e:new Intl.DateTimeFormat(t,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(r)}function cte(e){if(!e)return 0;const t=e.trim(),n=Number(t),i=/^\d+(?:\.\d+)?$/.test(t)?new Date(n<1e12?n*1e3:n):new Date(t);return Number.isNaN(i.getTime())?0:i.getTime()}function zl(e){return`${e.region||"default"}:${e.projectName||"default"}:${e.id}`}function c5t(e,t){const n=new Map(e.map(i=>[zl(i),i]));for(const i of t)n.set(zl(i),i);return[...n.values()].sort((i,r)=>cte(r.updatedAt)-cte(i.updatedAt))}function u5t(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 lje(e,t){const n=(e||"").trim();return!n||[">",">-","|","|-"].includes(n)?t("common.noDescription"):n}function d5t(){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 f5t(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M12 5.5v13M5.5 12h13",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}function ute({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 h5t(){return o.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function p5t({page:e,total:t,pageSize:n,onPage:i}){const{t:r}=Ae("ui"),s=Math.max(1,Math.ceil(t/n));return o.jsxs("footer",{className:"skillcenter-pager",children:[o.jsx("span",{children:r("skillCenter.totalItems",{count:t})}),o.jsxs("div",{className:"skillcenter-pager-actions",children:[o.jsx("button",{type:"button",onClick:()=>i(e-1),disabled:e<=1,"aria-label":r("common.previousPage"),children:o.jsx(ute,{direction:"left"})}),o.jsxs("span",{children:[e," / ",s]}),o.jsx("button",{type:"button",onClick:()=>i(e+1),disabled:e>=s,"aria-label":r("common.nextPage"),children:o.jsx(ute,{direction:"right"})})]})]})}function m5t({children:e}){return o.jsx("div",{className:"skillcenter-empty",children:e})}function tL({kind:e,title:t,description:n,error:i,action:r}){return o.jsx("div",{className:`skillcenter-page-state is-${e}`,role:e==="error"?"alert":"status",children:o.jsxs(En,{fill:"none",children:[o.jsx(En.Title,{children:t}),n?o.jsx(En.Description,{children:n}):null,i?o.jsx(cl,{error:i}):null,r?o.jsx(En.ActionRow,{children:o.jsx(zt,{color:"secondary",size:"lg",onClick:r.onClick,children:r.label})}):null]})})}function dte({errors:e,cloudProvider:t,fullPage:n=!1,onRetry:i}){const{t:r}=Ae("ui");return o.jsxs("div",{className:`skillcenter-space-errors${n?" is-full-page":""}`,role:"alert",children:[o.jsxs("div",{className:"skillcenter-space-errors__content",children:[o.jsx("strong",{children:r(n?"skillCenter.cannotLoadSpaces":"skillCenter.someSpacesFailed")}),e.map(({region:s,error:a})=>o.jsxs("section",{children:[o.jsx("span",{children:xh(s,t)}),o.jsx(cl,{error:a})]},s))]}),o.jsx("button",{type:"button",onClick:i,children:r("common.reload")})]})}function g5t({skill:e,space:t,region:n,cloudProvider:i,detail:r,files:s,loading:a,error:l,canOptimize:c,onOptimize:u,onDownload:d,onClose:f}){const{t:h}=Ae("ui");return m.useEffect(()=>{const p=g=>{g.key==="Escape"&&f()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[f]),o.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:f,children:o.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:p=>p.stopPropagation(),children:[o.jsxs("header",{className:"skill-detail-head",children:[o.jsx("div",{className:"skill-detail-heading",children:o.jsxs("div",{children:[o.jsx("h2",{id:"skill-detail-title",children:(r==null?void 0:r.name)||e.skillName}),o.jsx("p",{children:lje((r==null?void 0:r.description)||e.skillDescription,h)})]})}),o.jsxs("div",{className:"skill-detail-actions",children:[o.jsx("button",{type:"button",onClick:d,disabled:s.length===0,children:h("skillCenter.downloadZip")}),o.jsx(oj,{disabled:!c,placement:"bottom",children:o.jsx("button",{type:"button",onClick:u,disabled:!c,children:h("skillCenter.optimize")})}),o.jsx("button",{type:"button",className:"skill-detail-close",onClick:f,"aria-label":h("skillCenter.closeSkillDetails"),children:o.jsx(d5t,{})})]})]}),o.jsxs("dl",{className:"skill-detail-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:h("skillCenter.skillId")}),o.jsx("dd",{title:e.skillId,children:e.skillId})]}),o.jsxs("div",{children:[o.jsx("dt",{children:h("agentSelector.version")}),o.jsx("dd",{children:(r==null?void 0:r.version)||e.version||"—"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:h("agentSelector.status")}),o.jsx("dd",{children:oje(e.skillStatus,h)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:h("skillCenter.skillSpace")}),o.jsx("dd",{title:t.name,children:t.name})]}),o.jsxs("div",{children:[o.jsx("dt",{children:h("myAgents.region")}),o.jsx("dd",{children:xh(n,i)})]})]}),o.jsxs("div",{className:"skill-detail-content skill-detail-content--files",children:[o.jsx("div",{className:"skill-detail-content-title",children:h("skillCenter.allFiles")}),a?o.jsxs("div",{className:"skillcenter-loading",children:[o.jsx(h5t,{}),h("skillCenter.loadingSkillContent")]}):l?o.jsx("div",{className:"skillcenter-error",children:o.jsx(cl,{error:l})}):s.length>0?o.jsx(sje,{files:s.map(p=>p.path.endsWith("SKILL.md")&&p.content?{...p,content:u5t(p.content)}:p)}):o.jsx(m5t,{children:h("skillCenter.noSkillContent")})]})]})})}function b5t({space:e,canUseSandbox:t,onUpload:n,onSandbox:i,onClose:r}){const{t:s}=Ae("ui");return m.useEffect(()=>{const a=l=>{l.key==="Escape"&&r()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[r]),o.jsx("div",{className:"skill-dialog-backdrop",role:"presentation",onMouseDown:r,children:o.jsxs("section",{className:"skill-dialog skill-add-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-add-dialog-title",onMouseDown:a=>a.stopPropagation(),children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("h2",{id:"skill-add-dialog-title",children:s("skillCenter.addSkill")}),o.jsx("p",{title:e.name,children:e.name})]}),o.jsx("button",{type:"button",onClick:r,children:s("common.cancel")})]}),o.jsxs("div",{className:"skill-add-dialog__options",children:[o.jsxs("button",{type:"button",onClick:n,children:[o.jsx("strong",{children:s("skillCenter.localUpload")}),o.jsx("span",{children:s("skillCenter.localUploadDescription")})]}),o.jsx(oj,{disabled:!t,placement:"inside",children:o.jsxs("button",{type:"button",disabled:!t,onClick:i,children:[o.jsx("strong",{children:s("skillCenter.autoCreate")}),o.jsx("span",{children:s("skillCenter.autoCreateDescription")})]})})]})]})})}function y5t({cloudProvider:e="volcengine",region:t,active:n=!0,activationRevision:i=0,initialWorkspace:r=null,onInitialWorkspaceConsumed:s,onPageTitleChange:a,toolbarLeading:l,toolbarFilters:c}){var ht;const{t:u,i18n:d}=Ae("ui"),f=m.useMemo(()=>[t],[t]),[h,p]=m.useState([]),[g,b]=m.useState({}),[v,y]=m.useState(!1),[x,O]=m.useState(""),[w,k]=m.useState((r==null?void 0:r.space)??null),[S,E]=m.useState([]),[C,N]=m.useState(1),[_,j]=m.useState(0),[A,F]=m.useState(!1),[T,P]=m.useState(null),[R,L]=m.useState(!1),[M,U]=m.useState(""),[I,H]=m.useState("overview"),[K,Q]=m.useState(null),[q,B]=m.useState(null),[ee,le]=m.useState([]),[se,re]=m.useState(!1),[ge,W]=m.useState(null),[X,ae]=m.useState(null),[ue,Oe]=m.useState(!1),[Se,lt]=m.useState(null),[$e,Le]=m.useState(null),[Ne,qe]=m.useState(null),[Re,ze]=m.useState(0),[Ee,De]=m.useState(0),[J,he]=m.useState(""),[Ce,Ze]=m.useState(""),[at,St]=m.useState(null),[Te,ye]=m.useState(r),Ve=m.useRef(0),nt=m.useRef(0),ke=m.useRef(!1),Ht=m.useRef(null),on=m.useRef(null),Yt=m.useRef(null),xt=m.useDeferredValue(x),Pt=m.useDeferredValue(M),gt=(Te&&(w||Te.selectPublishSpace)?Te.operation==="create"?u("skillCenter.createSkill"):u("skillCenter.optimizeNamed",{name:((ht=Te.source)==null?void 0:ht.name)||u("skillCenter.skill")}):"")||(w==null?void 0:w.name)||u("skillCenter.library");m.useEffect(()=>{n&&(a==null||a(gt))},[n,a,gt]),m.useEffect(()=>{r&&(s==null||s())},[r,s]);const Pe=m.useMemo(()=>{const pe=xt.trim().toLocaleLowerCase();return pe?h.filter(We=>`${We.name} ${We.description||""} ${We.projectName||""}`.toLocaleLowerCase().includes(pe)):h},[xt,h]),kt=m.useMemo(()=>{const pe=Pt.trim().toLocaleLowerCase();return pe?S.filter(We=>`${We.skillName} ${We.skillDescription||""}`.toLocaleLowerCase().includes(pe)):S},[Pt,S]),Me=(w==null?void 0:w.region)||Ji(e),Ye=m.useMemo(()=>f.flatMap(pe=>{var vt;const We=(vt=g[pe])==null?void 0:vt.error;return We?[{region:pe,error:We}]:[]}),[g,f]),et=f.some(pe=>{const We=g[pe];return!!(We&&!We.done&&!We.error)}),xe=Ye.length===f.length;m.useEffect(()=>{const pe=new AbortController;return sI(pe.signal).then(ae).catch(()=>ae({enabled:!1,reason:u("skillCenter.adminNotConfigured"),operations:["create","optimize"],models:[],styles:{}})),()=>pe.abort()},[u]);const He=m.useCallback(async(pe,We)=>{var pn;if(ke.current||pe.length===0)return;ke.current=!0,y(!0),We&&((pn=Ht.current)==null||pn.abort(),p([]),b(Object.fromEntries(pe.map(({region:Zt})=>[Zt,{nextPage:1,loadedCount:0,done:!1,error:null}]))));const vt=new AbortController;Ht.current=vt;const vn=++nt.current,Ki=await Promise.allSettled(pe.map(async({region:Zt,page:Jt})=>({region:Zt,page:Jt,result:await m1t({region:Zt,page:Jt,pageSize:s5t,signal:vt.signal})})));if(nt.current!==vn)return;const Fe=Ki.map((Zt,Jt)=>{const Un=pe[Jt];return Zt.status==="rejected"?{request:Un,error:ja(Zt.reason,u("skillCenter.errors.loadSpaces")),items:[],totalCount:0}:{request:Un,error:null,items:(Zt.value.result.items||[]).map(xn=>({...xn,region:xn.region||Zt.value.region})),totalCount:Zt.value.result.totalCount||0}}),Rt=Fe.flatMap(Zt=>Zt.items);b(Zt=>{const Jt={...Zt};return Fe.forEach(({request:Un,error:xn,items:oi,totalCount:Oi})=>{const mi=Jt[Un.region]||{nextPage:Un.page,loadedCount:0,done:!1,error:null};if(xn){Jt[Un.region]={...mi,error:xn};return}const bn=mi.loadedCount+oi.length;Jt[Un.region]={nextPage:Un.page+1,loadedCount:bn,done:oi.length===0||bn>=Oi,error:null}}),Jt}),p(Zt=>c5t(We?[]:Zt,Rt)),k(Zt=>Zt&&(Rt.find(Jt=>zl(Jt)===zl(Zt))||Zt)),ke.current=!1,y(!1)},[]),Ke=m.useCallback(()=>{if(ke.current)return;const pe=f.flatMap(We=>{const vt=g[We];return vt&&!vt.done&&!vt.error?[{region:We,page:vt.nextPage}]:[]});He(pe,!1)},[He,g,f]);m.useEffect(()=>{Xt(),k(null),E([]),N(1)},[e]),m.useEffect(()=>{if(n)return He(f.map(pe=>({region:pe,page:1})),!0),()=>{var pe;nt.current+=1,(pe=Ht.current)==null||pe.abort(),ke.current=!1}},[n,i,He,f,Re]),m.useEffect(()=>{const pe=Yt.current,We=on.current;if(!pe||!We||!et||v)return;const vt=new IntersectionObserver(([vn])=>{vn.isIntersecting&&Ke()},{root:We,rootMargin:"240px 0px",threshold:.01});return vt.observe(pe),()=>vt.disconnect()},[et,Ke,v]);const yt=()=>{const pe=on.current;!pe||!et||v||pe.scrollHeight-pe.scrollTop-pe.clientHeight<=240&&Ke()};m.useEffect(()=>{if(!w){E([]),j(0),L(!1);return}let pe=!0;return F(!0),P(null),k1t(w.id,{region:Me,page:C,pageSize:lte,project:w.projectName}).then(We=>{pe&&(E(We.items||[]),j(We.totalCount||0),L(We.degraded===!0))}).catch(We=>{pe&&(E([]),j(0),L(!1),P(ja(We,u("skillCenter.errors.loadSkills"))))}).finally(()=>{pe&&F(!1)}),()=>{pe=!1}},[Me,w,C,Ee,u]);const Dt=pe=>{Xt(),k(pe),H("overview"),N(1),U("")},ln=()=>{Xt(),k(null),E([]),j(0),L(!1),H("overview"),N(1),U(""),St(null)},Xt=()=>{Ve.current+=1,Q(null),B(null),le([]),W(null),re(!1)},dn=async pe=>{if(!w)return;const We=Fg(pe),vt=Ve.current+1;Ve.current=vt,Q(pe),B(null),W(null),re(!0);try{const[vn,Ki]=await Promise.all([E1t(w.id,We,pe.version,Me,w.projectName,pe.skillName,w.name),O1t({spaceId:w.id,skillId:We,version:pe.version,region:Me,skillSpaceName:w.name,skillName:pe.skillName})]);Ve.current===vt&&(B(vn),le(Ki))}catch(vn){Ve.current===vt&&W(ja(vn,u("skillCenter.errors.loadSkillDetails")))}finally{Ve.current===vt&&re(!1)}},Z=pe=>{if(w)return{kind:"skill-center",skillId:Fg(pe),version:pe.version,region:Me,projectName:w.projectName,skillSpaceId:w.id,skillSpaceName:w.name,name:pe.skillName,description:pe.skillDescription}},Ft=pe=>{const We=Z(pe);!We||!(X!=null&&X.enabled)||(Xt(),ye({operation:"optimize",source:We}))},Ue=async pe=>{if(!(!w||!window.confirm(u("skillCenter.deleteSkillConfirm",{name:pe.skillName})))){he(pe.skillId),St(null);try{await w1t({spaceId:w.id,skillId:pe.skillId,region:Me}),De(We=>We+1),ze(We=>We+1)}catch(We){St(ja(We,u("skillCenter.errors.deleteSkill")))}finally{he("")}}},it=async pe=>{if(!window.confirm(u("skillCenter.deleteSpaceConfirm",{name:pe.name})))return;const We=zl(pe);Ze(We),St(null);try{await y1t({spaceId:pe.id,region:pe.region||Ji(e)}),w&&zl(w)===We&&ln(),ze(vt=>vt+1)}catch(vt){St(ja(vt,u("skillCenter.errors.deleteSpace")))}finally{Ze("")}};return Te&&(w||Te.selectPublishSpace)?o.jsx(e5t,{operation:Te.operation,cloudProvider:e,space:w??void 0,availableSpaces:h,spacesLoading:v,initialIntent:Te.initialIntent,source:Te.source,onBack:()=>ye(null),onPublished:()=>{De(pe=>pe+1),ze(pe=>pe+1)}}):o.jsxs("section",{className:`skillcenter${w?" is-space":" resource-collection"}`,children:[w?o.jsx(uE,{className:"skillcenter-detail",title:w.name,description:w.description||u("skillCenter.manageSpaceDescription"),identitySeed:w.name,backLabel:u("skillCenter.backToSpaces"),onBack:ln,sections:[{key:"overview",label:u("skillCenter.overview"),content:o.jsxs(o.Fragment,{children:[at?o.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:o.jsx(cl,{error:at})}):null,o.jsx("section",{className:"skillcenter-overview",children:o.jsxs(NB,{className:"skillcenter-detail-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:u("skillCenter.skillCount")}),o.jsx("dd",{children:_})]}),o.jsxs("div",{children:[o.jsx("dt",{children:u("skillCenter.updatedAt")}),o.jsx("dd",{children:w.updatedAt?l5t(w.updatedAt,d.resolvedLanguage??d.language):"—"})]})]})})]})},{key:"skills",label:u("skillCenter.skills"),content:o.jsxs(o.Fragment,{children:[at?o.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:o.jsx(cl,{error:at})}):null,o.jsxs("section",{className:"skillcenter-results","aria-label":u("skillCenter.skillsInSpace",{name:w.name}),children:[o.jsx(FOe,{title:u("skillCenter.skills"),description:u("skillCenter.totalItems",{count:_}),actions:o.jsx(wm,{"aria-label":u("skillCenter.searchSkills"),value:M,onChange:pe=>U(pe.target.value),placeholder:u("skillCenter.searchSkills")})}),R?o.jsx("div",{className:"skillcenter-inline-warning",role:"status",children:u("skillCenter.degradedRelationWarning")}):null,A&&S.length===0?o.jsx(Ud,{}):T&&S.length===0?o.jsx(tL,{kind:"error",title:u("skillCenter.cannotLoadSkills"),error:T,action:{label:u("common.reload"),onClick:()=>De(pe=>pe+1)}}):kt.length===0?o.jsx(tL,{kind:"empty",title:M.trim()?u("skillCenter.noMatchingSkills"):u("skillCenter.noSkills"),description:M.trim()?u("skillCenter.tryAnotherName"):u("skillCenter.emptySkillsDescription"),action:M.trim()?void 0:{label:u("skillCenter.localUpload"),onClick:()=>qe(w)}}):o.jsx("div",{className:"skillcenter-table-wrap",children:o.jsxs("table",{className:"skillcenter-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"col",children:u("skillCenter.skills")}),o.jsx("th",{scope:"col",children:u("agentSelector.status")}),o.jsx("th",{scope:"col",className:"skillcenter-table__actions-heading",children:u("skillCenter.actions")})]})}),o.jsx("tbody",{children:kt.map(pe=>o.jsxs("tr",{children:[o.jsx("td",{className:"skillcenter-table__skill",children:o.jsxs("button",{type:"button",onClick:()=>void dn(pe),children:[o.jsxs("span",{className:"skillcenter-table__title-row",children:[o.jsx("strong",{title:pe.skillName,children:pe.skillName}),pe.version?o.jsx("span",{className:"skillcenter-table__version-badge",children:pe.version}):null]}),o.jsx("span",{className:"skillcenter-table__description",children:lje(pe.skillDescription,u)})]})}),o.jsx("td",{children:o.jsx("span",{className:`skillcenter-status ${o5t(pe.skillStatus)}`,children:oje(pe.skillStatus,u)})}),o.jsx("td",{children:o.jsxs("div",{className:"skillcenter-table__actions",children:[o.jsx("button",{type:"button",onClick:()=>void dn(pe),children:u("common.view")}),o.jsx(oj,{disabled:!(X!=null&&X.enabled),children:o.jsx("button",{type:"button",disabled:!(X!=null&&X.enabled),onClick:()=>Ft(pe),children:u("skillCenter.optimize")})}),pe.lookupByName?null:o.jsx("button",{type:"button",className:"is-danger",disabled:J===pe.skillId,onClick:()=>void Ue(pe),children:J===pe.skillId?u("common.deleting"):u("common.delete")})]})})]},`${Fg(pe)}:${pe.version}`))})]})}),!M.trim()&&!A&&!T&&_>0?o.jsx(p5t,{page:C,total:_,pageSize:lte,onPage:N}):null]})]})}],activeSectionKey:I,navigationLabel:u("skillCenter.spaceDetails"),onSectionChange:pe=>H(pe),actionsClassName:"skillcenter-toolbar-actions",actions:o.jsxs(o.Fragment,{children:[o.jsx(zt,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>lt(w),children:u("skillCenter.editSpace")}),o.jsx(zt,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,disabled:Ce===zl(w),onClick:()=>void it(w),children:Ce===zl(w)?u("common.deleting"):u("skillCenter.deleteSpace")}),o.jsx(zt,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>qe(w),children:u("skillCenter.localUpload")}),o.jsx(oj,{disabled:!(X!=null&&X.enabled),children:o.jsxs(zt,{type:"button",color:"primary",size:"lg",pill:!1,disabled:!(X!=null&&X.enabled),onClick:()=>ye({operation:"create"}),children:[o.jsx(vbe,{"aria-hidden":"true"}),o.jsx("span",{children:u("skillCenter.createSkill")})]})})]})}):o.jsxs(o.Fragment,{children:[o.jsxs(Zb,{className:"skillcenter-list-toolbar library-resource-toolbar",children:[l,o.jsxs("div",{className:"resource-toolbar__actions",children:[c,o.jsx(wm,{"aria-label":u("skillCenter.searchSpaces"),value:x,onChange:pe=>O(pe.target.value),placeholder:u("skillCenter.searchSpaces")})]})]}),at?o.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:o.jsx(cl,{error:at})}):null,o.jsxs(Jb,{className:"skillcenter-list-results",ref:on,"aria-label":u("skillCenter.spaceList"),onScroll:yt,children:[Ye.length>0&&!xe?o.jsx(dte,{errors:Ye,cloudProvider:e,onRetry:()=>ze(pe=>pe+1)}):null,v&&h.length===0?o.jsx(Ud,{}):xe&&h.length===0?o.jsx(dte,{errors:Ye,cloudProvider:e,fullPage:!0,onRetry:()=>ze(pe=>pe+1)}):Pe.length===0&&x.trim()?o.jsx(tL,{kind:"empty",title:u("skillCenter.noMatchingSpaces"),description:u("skillCenter.tryAnotherName")}):o.jsxs(Vx,{children:[x.trim()?null:o.jsx(Cb,{"aria-label":u("skillCenter.createSpace"),icon:o.jsx(f5t,{}),onClick:()=>Oe(!0),children:u("skillCenter.newSpace")}),Pe.map(pe=>{const We=zl(pe);return o.jsx(pE,{className:"skillcenter-space-card",title:pe.name,description:pe.description||u("common.noDescription"),metadata:[{label:u("skillCenter.skillCount"),value:u("skillCenter.skillCountValue",{count:pe.skillCount??0})},{label:u("skillCenter.updatedAt"),value:GQ(pe.updatedAt,Date.now(),d.resolvedLanguage??d.language)}],action:{label:u("skillCenter.addSkill"),icon:"plus",onClick:()=>Le(pe)},detailAction:{label:u("common.viewDetails"),onClick:()=>Dt(pe)}},We)})]}),!xe&&h.length>0?o.jsx("div",{className:"my-agent-load-more",ref:Yt,"aria-live":"polite",children:v?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:u("skillCenter.loadingMoreSpaces")})]}):et?o.jsx("span",{children:u("skillCenter.scrollForMore")}):Ye.length>0?o.jsx("span",{children:u("skillCenter.someSpacesFailed")}):o.jsx("span",{children:u("skillCenter.allSpacesLoaded")})}):null]})]}),K&&w&&o.jsx(g5t,{skill:K,space:w,region:Me,cloudProvider:e,detail:q,files:ee,loading:se,error:ge,canOptimize:(X==null?void 0:X.enabled)===!0,onOptimize:()=>Ft(K),onDownload:()=>void S1t({spaceId:w.id,skillId:Fg(K),version:K.version,region:Me,fallbackName:K.skillName,skillSpaceName:w.name,skillName:K.skillName}).catch(pe=>W(ja(pe,u("skillCenter.errors.downloadSkill")))),onClose:Xt}),ue?o.jsx(t5t,{region:t,regionOptions:Iu(e),onClose:()=>Oe(!1),onCreated:pe=>{Oe(!1),ze(We=>We+1),k({...pe,region:pe.region||t})}}):null,Se?o.jsx(n5t,{space:Se,region:Se.region||Ji(e),onClose:()=>lt(null),onUpdated:pe=>{const We={...pe,region:pe.region||Se.region||Ji(e)};lt(null),k(vt=>vt&&zl(vt)===zl(We)?We:vt),p(vt=>vt.map(vn=>zl(vn)===zl(We)?We:vn)),ze(vt=>vt+1)}}):null,$e?o.jsx(b5t,{space:$e,canUseSandbox:(X==null?void 0:X.enabled)===!0,onClose:()=>Le(null),onUpload:()=>{qe($e),Le(null)},onSandbox:()=>{const pe=$e;Le(null),Dt(pe),ye({operation:"create"})}}):null,Ne?o.jsx(i5t,{space:Ne,region:Ne.region||Ji(e),onClose:()=>qe(null),onUploaded:()=>{qe(null),De(pe=>pe+1),ze(pe=>pe+1)}}):null]})}function v5t(e){return[{id:"skills",label:e("library.tabs.skills"),panelId:"library-skills-panel"},{id:"knowledge",label:e("library.tabs.knowledge"),panelId:"library-knowledge-panel"},{id:"artifacts",label:e("library.tabs.artifacts"),panelId:"library-artifacts-panel"}]}function x5t({cloudProvider:e,studioRegion:t="",activeTab:n,onTabChange:i,onPageTitleChange:r,skillInitialWorkspace:s=null,onSkillInitialWorkspaceConsumed:a,artifactSources:l=[],artifactUserId:c="",onArtifactActivate:u,onArtifactSourceOpen:d}){const{t:f,i18n:h}=Ae("workspaceTools"),p=m.useMemo(()=>v5t(f),[f]),g=f("library.tabs.skills"),b=tR(t)?t:Ji(e),[v,y]=m.useState(b),[x,O]=m.useState(g),w=m.useRef(g),[k,S]=m.useState(!1),[E,C]=m.useState(()=>new Set(["skills",n])),[N,_]=m.useState({skills:0,knowledge:0,artifacts:0}),j=m.useRef(u),[A,F]=m.useState([]),[T,P]=m.useState(!1),[R,L]=m.useState(""),M=m.useMemo(()=>{const le=Uot(l,f("library.untitledSession"));return{key:JSON.stringify(le),candidates:le}},[l,f]),U=m.useRef(M);U.current.key!==M.key&&(U.current=M);const I=U.current.candidates,H=m.useMemo(()=>Iu(e),[e]);m.useEffect(()=>{y(b)},[b]),m.useEffect(()=>{const le=w.current;O(se=>se===le?g:se),w.current=g},[g]),m.useEffect(()=>{j.current=u},[u]),m.useEffect(()=>{C(le=>{if(le.has(n))return le;const se=new Set(le);return se.add(n),se})},[n]),m.useEffect(()=>{var se;const le=n==="skills"?x:((se=p.find(re=>re.id===n))==null?void 0:se.label)||f("library.title");r==null||r(le)},[n,r,x,f,p]),m.useEffect(()=>{var le;n==="artifacts"&&((le=j.current)==null||le.call(j))},[n,N.artifacts]);const K=m.useCallback(async()=>{P(!0),L("");try{F(await Xot(I))}catch(le){L(le instanceof Error?le.message:String(le))}finally{P(!1)}},[I]);m.useEffect(()=>{n==="artifacts"&&K()},[n,N.artifacts,K]);const Q=le=>{C(se=>{if(se.has(le))return se;const re=new Set(se);return re.add(le),re}),_(se=>({...se,[le]:se[le]+1})),i(le)},q=o.jsx(dE,{idPrefix:"library",ariaLabel:f("library.categoryAria"),value:n,items:p,onChange:Q}),B=le=>o.jsx(lN,{id:le,ariaLabel:f("library.regionAria"),value:v,options:H,onChange:y}),ee=n==="skills"?x!==g:n==="knowledge"&&k;return o.jsxs(Th,{className:`library-view${ee?" is-detail":""}`,"aria-label":f("library.title"),children:[ee?null:o.jsx(zx,{className:"library-view__header",title:f("library.title")}),o.jsxs("div",{className:"library-panels",children:[E.has("skills")?o.jsx("div",{id:"library-skills-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-skills-tab",hidden:n!=="skills",children:o.jsx(y5t,{cloudProvider:e,region:v,active:n==="skills",activationRevision:N.skills,onPageTitleChange:O,initialWorkspace:s,onInitialWorkspaceConsumed:a,toolbarLeading:q,toolbarFilters:B("library-skills-region-filter")})}):null,E.has("knowledge")?o.jsx("div",{id:"library-knowledge-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-knowledge-tab",hidden:n!=="knowledge",children:o.jsx(i1t,{cloudProvider:e,region:v,active:n==="knowledge",activationRevision:N.knowledge,onDetailChange:S,toolbarLeading:q,toolbarFilters:B("library-knowledge-region-filter")})}):null,E.has("artifacts")?o.jsx("div",{id:"library-artifacts-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-artifacts-tab",hidden:n!=="artifacts",children:o.jsx(Wot,{items:A,region:v,userId:c,active:n==="artifacts",activationRevision:N.artifacts,loading:T,error:R?jd(R,h.resolvedLanguage||h.language)||f("artifactLibrary.loadDetailFallback"):"",onRetry:()=>void K(),onEdit:Yot,onDelete:Zot,onDownload:Jot,onOpenSource:d?le=>d(le.appName,le.sessionId):void 0,toolbarLeading:q,toolbarFilters:B("library-artifacts-region-filter")})}):null]})]})}const cje="veadk_agentkit_connections",w5t=3e3,fte=6e4;function ku(){try{const e=localStorage.getItem(cje);return(e?JSON.parse(e):[]).filter(n=>!n.runtimeId||!!n.region)}catch{return[]}}function LI(e){try{localStorage.setItem(cje,JSON.stringify(e))}catch{}}function Lu(e,t){return`agentkit:${e}:${t}`}function uje(e){try{return new URL(e).host}catch{return e}}function o1(e){Dbe();for(const t of e)if(!(t.runtimeId&&!t.region))for(const n of t.apps)Pbe(Lu(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,region:t.region}:{app:n,base:t.base,apiKey:t.apiKey})}function dje(e,t,n,i,r,s){const a={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:i,appLabels:r,currentVersion:s},l=ku(),c=l.findIndex(u=>u.runtimeId===e);return c===-1?l.push(a):l[c]=a,LI(l),o1(l),a}async function O5t(e,t,n,i,r){let s=null,a=n||"cn-beijing",l=null;for(const f of Qk(n))try{const h=await Fv(e,f,{retryProbe:!0,preferCached:!0,currentVersion:i});if(h&&h.length>0){await Z0e(e,f),s=h,a=f;break}}catch(h){if(h instanceof Cx)throw lj(e),h;if(h instanceof Ds&&h.unsupported){l=h;continue}throw h}if(!s||s.length===0)throw lj(e),l||new Ds(V("connections.runtimeUnsupported"),!0,!0);const c=(r==null?void 0:r.trim())||s[0],u=Object.fromEntries(s.map(f=>[f,f===s[0]?c:f])),d=dje(e,t,a,s,u,i);return Lu(d.id,s[0])}function S5t(e){return new Promise(t=>window.setTimeout(t,e))}async function UA(e,t,n,i,r={}){const s=Date.now();for(;;)try{return await O5t(e,t,n,i,r.agentName)}catch(a){const l=Date.now()-s;if(!r.waitForReady||!(a instanceof Ds)||!a.retryable||l>=fte)throw a;const c=Math.min(w5t,fte-l);await S5t(c)}}async function fje(e,t,n,i){const r=t.trim().replace(/\/+$/,""),s=await zk(r,n.trim()),a={id:Date.now().toString(36),name:e.trim()||uje(r),base:r,apiKey:n.trim(),apps:s,appLabels:i&&s.length>0?{[s[0]]:i}:void 0},l=[...ku().filter(c=>c.base!==r),a];return LI(l),o1(l),a}function k5t(e){const t=ku().filter(n=>n.id!==e);return LI(t),o1(t),t}function lj(e){const t=ku().filter(n=>n.runtimeId!==e);return LI(t),o1(t),t}function hje(e,t){const n=e.map(r=>({id:r,label:r,app:r,remote:!1})),i=t.flatMap(r=>r.apps.map(s=>{var l;const a=((l=r.appLabels)==null?void 0:l[s])??s;return{id:Lu(r.id,s),label:a,app:s,remote:!0,host:r.runtimeId?r.name:uje(r.base??""),runtimeId:r.runtimeId,region:r.region,currentVersion:r.currentVersion}}));return[...n,...i]}const hte=Object.freeze(Object.defineProperty({__proto__:null,addConnection:fje,addRuntimeConnection:dje,buildAgentEntries:hje,connectRuntime:UA,loadConnections:ku,registerConnections:o1,remoteAppId:Lu,removeConnection:k5t,removeRuntimeConnection:lj},Symbol.toStringTag,{value:"Module"}));function E5t({onAdded:e,onCancel:t}){const{t:n}=Ae("conversation"),[i,r]=m.useState(""),[s,a]=m.useState(""),[l,c]=m.useState(""),[u,d]=m.useState(!1),[f,h]=m.useState(""),p=i.trim().length>0&&s.trim().length>0&&!u;async function g(){if(p){d(!0),h("");try{const b=await fje(l,i,s,l);if(b.apps.length===0){h(n("addAgentKit.noAgents")),d(!1);return}e(Lu(b.id,b.apps[0]))}catch(b){h(n("addAgentKit.connectionFailed",{error:String(b)})),d(!1)}}}return o.jsx("div",{className:"addagent",children:o.jsxs("div",{className:"addagent-card",children:[o.jsx("h2",{className:"addagent-title",children:n("addAgentKit.title")}),o.jsx("p",{className:"addagent-sub",children:n("addAgentKit.description")}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:n("addAgentKit.url")}),o.jsx("input",{className:"addagent-input",value:i,onChange:b=>r(b.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:b=>a(b.target.value),placeholder:n("addAgentKit.apiKeyHint")})]}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:n("addAgentKit.displayName")}),o.jsx("input",{className:"addagent-input",value:l,onChange:b=>c(b.target.value),placeholder:n("addAgentKit.displayNameHint")})]}),f&&o.jsx("div",{className:"addagent-error",children:f}),o.jsxs("div",{className:"addagent-actions",children:[o.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:u,children:n("addAgentKit.cancel")}),o.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:g,disabled:!p,children:[u?o.jsx(fi,{className:"icon spin"}):null,n(u?"addAgentKit.connecting":"addAgentKit.connect")]})]})]})})}const C5t=/[\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff]/u,T5t={"deploy.build.logs_syncing":"client.deploymentProgress.buildLogsSyncing","deploy.build.logs_complete":"client.deploymentProgress.buildLogsComplete","deploy.build.failed_logs_synced":"client.deploymentProgress.buildFailedLogsSynced","deploy.build.logs_unavailable":"client.deploymentProgress.buildLogsUnavailable","deploy.build.final_logs_unavailable":"client.deploymentProgress.finalBuildLogsUnavailable"},A5t={prepare:"client.deploymentProgress.preparing",upload:"client.deploymentProgress.uploading",build:"client.deploymentProgress.building",deploy:"client.deploymentProgress.deploying",publish:"client.deploymentProgress.publishing",evaluation:"client.deploymentProgress.evaluating",update:"client.deploymentProgress.updating",complete:"client.deploymentProgress.completing",github:"client.deploymentProgress.github"};function $I(e){var r,s;const t=((r=e.message)==null?void 0:r.trim())??"",n=e.messageCode?T5t[e.messageCode]:void 0;if(n)return V(n);if(t&&($7e().toLowerCase()==="zh-cn"||!C5t.test(t)))return t;if(e.phase==="build"&&((s=e.buildLog)!=null&&s.status)){const a={running:"client.deploymentProgress.buildLogsSyncing",complete:"client.deploymentProgress.buildLogsComplete",error:"client.deploymentProgress.buildLogsUnavailable"}[e.buildLog.status];if(a)return V(a)}const i=e.phase?A5t[e.phase]:void 0;return i?V(i):t||V("client.deploymentProgress.inProgress")}function _5t(e){return[{id:"case-1",itemKey:"case-1",kind:"good",input:e("agentWorkspace.defaultCases.weeklyFeedback.input"),output:e("agentWorkspace.defaultCases.weeklyFeedback.output"),referenceOutput:e("agentWorkspace.defaultCases.weeklyFeedback.output"),comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T09:12:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.goodSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.weeklyFeedback.tag"),source:"auto",score:.92,reason:e("agentWorkspace.defaultCases.weeklyFeedback.reason")},{id:"case-2",itemKey:"case-2",kind:"good",input:e("agentWorkspace.defaultCases.research.input"),output:e("agentWorkspace.defaultCases.research.output"),referenceOutput:e("agentWorkspace.defaultCases.research.output"),comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T08:47:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.goodSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.research.tag"),source:"user"},{id:"case-3",itemKey:"case-3",kind:"bad",input:e("agentWorkspace.defaultCases.uncertainConclusion.input"),output:e("agentWorkspace.defaultCases.uncertainConclusion.output"),referenceOutput:"",comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T07:35:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.badSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.uncertainConclusion.tag"),source:"auto",score:.28,reason:e("agentWorkspace.defaultCases.uncertainConclusion.reason")},{id:"case-4",itemKey:"case-4",kind:"bad",input:e("agentWorkspace.defaultCases.repeatedTool.input"),output:e("agentWorkspace.defaultCases.repeatedTool.output"),referenceOutput:"",comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T06:58:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.badSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.repeatedTool.tag"),source:"user"}]}const N5t=[{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"}]}],j5t={核心能力回归:"agentWorkspace.evaluationDefaults.coreRegression",安全与幻觉检查:"agentWorkspace.evaluationDefaults.safetyCheck",核心回归集:"agentWorkspace.evaluationDefaults.coreSet",安全边界集:"agentWorkspace.evaluationDefaults.safetySet",工具调用集:"agentWorkspace.evaluationDefaults.toolSet",综合质量评估器:"agentWorkspace.evaluationDefaults.qualityEvaluator",事实一致性评估器:"agentWorkspace.evaluationDefaults.factualEvaluator",工具调用评估器:"agentWorkspace.evaluationDefaults.toolEvaluator",回答质量:"agentWorkspace.evaluationDefaults.responseQuality",事实准确性:"agentWorkspace.evaluationDefaults.factualAccuracy",工具调用:"agentWorkspace.evaluationDefaults.toolUse",响应效率:"agentWorkspace.evaluationDefaults.responseEfficiency","今天 10:32":"agentWorkspace.evaluationDefaults.todayTime","昨天 16:08":"agentWorkspace.evaluationDefaults.yesterdayTime","7 月 25 日 14:20":"agentWorkspace.evaluationDefaults.julyTime",刚刚:"agentWorkspace.evaluationDefaults.justNow"};function Ww(e,t){const n=j5t[e];return n?t(n):e}const pte=["basic","usage","evaluations","optimizations","integrations","versions"],R5t=20;function I5t(e,t,n){const i=Date.parse(e);return Number.isNaN(i)?n("agentWorkspace.notProvided"):new Intl.DateTimeFormat(t,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(i)}const sw=[{id:"api-server",label:"API Server"},{id:"a2a",label:"A2A"}];function nL(e,t){return e?`${e.replace(/\/+$/,"")}${t}`:""}function P5t(e,t){const n=e.trim();if(!n||!t)return n;try{const i=new URL(n),r=i.hostname.replace(/^\[|\]$/g,"").toLowerCase();if(!["localhost","127.0.0.1","::1"].includes(r))return n;const s=new URL(t);return i.protocol=s.protocol,i.hostname=s.hostname,i.port=s.port,i.toString()}catch{return n}}function mte(e,t){return e==="key_auth"?"API Key":e==="custom_jwt"?"OAuth / JWT":t(e==="none"?"agentWorkspace.noAuthentication":"agentWorkspace.notAvailable")}function gte(e,t){return t(e==="published"?"agentWorkspace.githubStatus.published":e==="publishing"?"agentWorkspace.githubStatus.publishing":e==="failed"?"agentWorkspace.githubStatus.failed":e==="pending"?"agentWorkspace.githubStatus.pending":"agentWorkspace.githubStatus.unknown")}function D5t(e,t){return e.changeType==="rollback"?t("agentWorkspace.rollbackEvent"):e.version}function y8(e){return JSON.stringify(e)}function pje(e){return e==="key_auth"?`API_KEY = "" +`,4);return n>=0?t.slice(n+5).trimStart():e}function lje(e,t){const n=(e||"").trim();return!n||[">",">-","|","|-"].includes(n)?t("common.noDescription"):n}function d5t(){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 f5t(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M12 5.5v13M5.5 12h13",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}function ute({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 h5t(){return o.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function p5t({page:e,total:t,pageSize:n,onPage:i}){const{t:r}=Ce("ui"),s=Math.max(1,Math.ceil(t/n));return o.jsxs("footer",{className:"skillcenter-pager",children:[o.jsx("span",{children:r("skillCenter.totalItems",{count:t})}),o.jsxs("div",{className:"skillcenter-pager-actions",children:[o.jsx("button",{type:"button",onClick:()=>i(e-1),disabled:e<=1,"aria-label":r("common.previousPage"),children:o.jsx(ute,{direction:"left"})}),o.jsxs("span",{children:[e," / ",s]}),o.jsx("button",{type:"button",onClick:()=>i(e+1),disabled:e>=s,"aria-label":r("common.nextPage"),children:o.jsx(ute,{direction:"right"})})]})]})}function m5t({children:e}){return o.jsx("div",{className:"skillcenter-empty",children:e})}function tL({kind:e,title:t,description:n,error:i,action:r}){return o.jsx("div",{className:`skillcenter-page-state is-${e}`,role:e==="error"?"alert":"status",children:o.jsxs(En,{fill:"none",children:[o.jsx(En.Title,{children:t}),n?o.jsx(En.Description,{children:n}):null,i?o.jsx(cl,{error:i}):null,r?o.jsx(En.ActionRow,{children:o.jsx(Wt,{color:"secondary",size:"lg",onClick:r.onClick,children:r.label})}):null]})})}function dte({errors:e,cloudProvider:t,fullPage:n=!1,onRetry:i}){const{t:r}=Ce("ui");return o.jsxs("div",{className:`skillcenter-space-errors${n?" is-full-page":""}`,role:"alert",children:[o.jsxs("div",{className:"skillcenter-space-errors__content",children:[o.jsx("strong",{children:r(n?"skillCenter.cannotLoadSpaces":"skillCenter.someSpacesFailed")}),e.map(({region:s,error:a})=>o.jsxs("section",{children:[o.jsx("span",{children:xh(s,t)}),o.jsx(cl,{error:a})]},s))]}),o.jsx("button",{type:"button",onClick:i,children:r("common.reload")})]})}function g5t({skill:e,space:t,region:n,cloudProvider:i,detail:r,files:s,loading:a,error:l,canOptimize:c,onOptimize:u,onDownload:d,onClose:f}){const{t:h}=Ce("ui");return m.useEffect(()=>{const p=g=>{g.key==="Escape"&&f()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[f]),o.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:f,children:o.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:p=>p.stopPropagation(),children:[o.jsxs("header",{className:"skill-detail-head",children:[o.jsx("div",{className:"skill-detail-heading",children:o.jsxs("div",{children:[o.jsx("h2",{id:"skill-detail-title",children:(r==null?void 0:r.name)||e.skillName}),o.jsx("p",{children:lje((r==null?void 0:r.description)||e.skillDescription,h)})]})}),o.jsxs("div",{className:"skill-detail-actions",children:[o.jsx("button",{type:"button",onClick:d,disabled:s.length===0,children:h("skillCenter.downloadZip")}),o.jsx(oj,{disabled:!c,placement:"bottom",children:o.jsx("button",{type:"button",onClick:u,disabled:!c,children:h("skillCenter.optimize")})}),o.jsx("button",{type:"button",className:"skill-detail-close",onClick:f,"aria-label":h("skillCenter.closeSkillDetails"),children:o.jsx(d5t,{})})]})]}),o.jsxs("dl",{className:"skill-detail-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:h("skillCenter.skillId")}),o.jsx("dd",{title:e.skillId,children:e.skillId})]}),o.jsxs("div",{children:[o.jsx("dt",{children:h("agentSelector.version")}),o.jsx("dd",{children:(r==null?void 0:r.version)||e.version||"—"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:h("agentSelector.status")}),o.jsx("dd",{children:oje(e.skillStatus,h)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:h("skillCenter.skillSpace")}),o.jsx("dd",{title:t.name,children:t.name})]}),o.jsxs("div",{children:[o.jsx("dt",{children:h("myAgents.region")}),o.jsx("dd",{children:xh(n,i)})]})]}),o.jsxs("div",{className:"skill-detail-content skill-detail-content--files",children:[o.jsx("div",{className:"skill-detail-content-title",children:h("skillCenter.allFiles")}),a?o.jsxs("div",{className:"skillcenter-loading",children:[o.jsx(h5t,{}),h("skillCenter.loadingSkillContent")]}):l?o.jsx("div",{className:"skillcenter-error",children:o.jsx(cl,{error:l})}):s.length>0?o.jsx(sje,{files:s.map(p=>p.path.endsWith("SKILL.md")&&p.content?{...p,content:u5t(p.content)}:p)}):o.jsx(m5t,{children:h("skillCenter.noSkillContent")})]})]})})}function b5t({space:e,canUseSandbox:t,onUpload:n,onSandbox:i,onClose:r}){const{t:s}=Ce("ui");return m.useEffect(()=>{const a=l=>{l.key==="Escape"&&r()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[r]),o.jsx("div",{className:"skill-dialog-backdrop",role:"presentation",onMouseDown:r,children:o.jsxs("section",{className:"skill-dialog skill-add-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-add-dialog-title",onMouseDown:a=>a.stopPropagation(),children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("h2",{id:"skill-add-dialog-title",children:s("skillCenter.addSkill")}),o.jsx("p",{title:e.name,children:e.name})]}),o.jsx("button",{type:"button",onClick:r,children:s("common.cancel")})]}),o.jsxs("div",{className:"skill-add-dialog__options",children:[o.jsxs("button",{type:"button",onClick:n,children:[o.jsx("strong",{children:s("skillCenter.localUpload")}),o.jsx("span",{children:s("skillCenter.localUploadDescription")})]}),o.jsx(oj,{disabled:!t,placement:"inside",children:o.jsxs("button",{type:"button",disabled:!t,onClick:i,children:[o.jsx("strong",{children:s("skillCenter.autoCreate")}),o.jsx("span",{children:s("skillCenter.autoCreateDescription")})]})})]})]})})}function y5t({cloudProvider:e="volcengine",region:t,active:n=!0,activationRevision:i=0,initialWorkspace:r=null,onInitialWorkspaceConsumed:s,onPageTitleChange:a,toolbarLeading:l,toolbarFilters:c}){var st;const{t:u,i18n:d}=Ce("ui"),f=m.useMemo(()=>[t],[t]),[h,p]=m.useState([]),[g,b]=m.useState({}),[v,y]=m.useState(!1),[x,O]=m.useState(""),[w,k]=m.useState((r==null?void 0:r.space)??null),[S,E]=m.useState([]),[C,N]=m.useState(1),[_,j]=m.useState(0),[A,F]=m.useState(!1),[T,P]=m.useState(null),[R,L]=m.useState(!1),[M,U]=m.useState(""),[I,H]=m.useState("overview"),[Z,Q]=m.useState(null),[q,B]=m.useState(null),[te,ce]=m.useState([]),[se,re]=m.useState(!1),[ge,G]=m.useState(null),[K,ae]=m.useState(null),[ue,xe]=m.useState(!1),[Ee,Je]=m.useState(null),[De,Pe]=m.useState(null),[Ne,Ke]=m.useState(null),[wt,ot]=m.useState(0),[Ie,Be]=m.useState(0),[J,pe]=m.useState(""),[oe,Me]=m.useState(""),[Ve,ht]=m.useState(null),[Se,ve]=m.useState(r),$e=m.useRef(0),qe=m.useRef(0),ke=m.useRef(!1),Tt=m.useRef(null),Jt=m.useRef(null),on=m.useRef(null),Et=m.useDeferredValue(x),Bt=m.useDeferredValue(M),gt=(Se&&(w||Se.selectPublishSpace)?Se.operation==="create"?u("skillCenter.createSkill"):u("skillCenter.optimizeNamed",{name:((st=Se.source)==null?void 0:st.name)||u("skillCenter.skill")}):"")||(w==null?void 0:w.name)||u("skillCenter.library");m.useEffect(()=>{n&&(a==null||a(gt))},[n,a,gt]),m.useEffect(()=>{r&&(s==null||s())},[r,s]);const je=m.useMemo(()=>{const me=Et.trim().toLocaleLowerCase();return me?h.filter(We=>`${We.name} ${We.description||""} ${We.projectName||""}`.toLocaleLowerCase().includes(me)):h},[Et,h]),Ot=m.useMemo(()=>{const me=Bt.trim().toLocaleLowerCase();return me?S.filter(We=>`${We.skillName} ${We.skillDescription||""}`.toLocaleLowerCase().includes(me)):S},[Bt,S]),yt=(w==null?void 0:w.region)||Ji(e),Dt=m.useMemo(()=>f.flatMap(me=>{var St;const We=(St=g[me])==null?void 0:St.error;return We?[{region:me,error:We}]:[]}),[g,f]),Ft=f.some(me=>{const We=g[me];return!!(We&&!We.done&&!We.error)}),Fe=Dt.length===f.length;m.useEffect(()=>{const me=new AbortController;return sI(me.signal).then(ae).catch(()=>ae({enabled:!1,reason:u("skillCenter.adminNotConfigured"),operations:["create","optimize"],models:[],styles:{}})),()=>me.abort()},[u]);const dt=m.useCallback(async(me,We)=>{var pn;if(ke.current||me.length===0)return;ke.current=!0,y(!0),We&&((pn=Tt.current)==null||pn.abort(),p([]),b(Object.fromEntries(me.map(({region:en})=>[en,{nextPage:1,loadedCount:0,done:!1,error:null}]))));const St=new AbortController;Tt.current=St;const vn=++qe.current,Ki=await Promise.allSettled(me.map(async({region:en,page:tn})=>({region:en,page:tn,result:await m1t({region:en,page:tn,pageSize:s5t,signal:St.signal})})));if(qe.current!==vn)return;const Le=Ki.map((en,tn)=>{const Un=me[tn];return en.status==="rejected"?{request:Un,error:ja(en.reason,u("skillCenter.errors.loadSpaces")),items:[],totalCount:0}:{request:Un,error:null,items:(en.value.result.items||[]).map(xn=>({...xn,region:xn.region||en.value.region})),totalCount:en.value.result.totalCount||0}}),Mt=Le.flatMap(en=>en.items);b(en=>{const tn={...en};return Le.forEach(({request:Un,error:xn,items:oi,totalCount:Oi})=>{const mi=tn[Un.region]||{nextPage:Un.page,loadedCount:0,done:!1,error:null};if(xn){tn[Un.region]={...mi,error:xn};return}const bn=mi.loadedCount+oi.length;tn[Un.region]={nextPage:Un.page+1,loadedCount:bn,done:oi.length===0||bn>=Oi,error:null}}),tn}),p(en=>c5t(We?[]:en,Mt)),k(en=>en&&(Mt.find(tn=>zl(tn)===zl(en))||en)),ke.current=!1,y(!1)},[]),$t=m.useCallback(()=>{if(ke.current)return;const me=f.flatMap(We=>{const St=g[We];return St&&!St.done&&!St.error?[{region:We,page:St.nextPage}]:[]});dt(me,!1)},[dt,g,f]);m.useEffect(()=>{it(),k(null),E([]),N(1)},[e]),m.useEffect(()=>{if(n)return dt(f.map(me=>({region:me,page:1})),!0),()=>{var me;qe.current+=1,(me=Tt.current)==null||me.abort(),ke.current=!1}},[n,i,dt,f,wt]),m.useEffect(()=>{const me=on.current,We=Jt.current;if(!me||!We||!Ft||v)return;const St=new IntersectionObserver(([vn])=>{vn.isIntersecting&&$t()},{root:We,rootMargin:"240px 0px",threshold:.01});return St.observe(me),()=>St.disconnect()},[Ft,$t,v]);const Qe=()=>{const me=Jt.current;!me||!Ft||v||me.scrollHeight-me.scrollTop-me.clientHeight<=240&&$t()};m.useEffect(()=>{if(!w){E([]),j(0),L(!1);return}let me=!0;return F(!0),P(null),k1t(w.id,{region:yt,page:C,pageSize:lte,project:w.projectName}).then(We=>{me&&(E(We.items||[]),j(We.totalCount||0),L(We.degraded===!0))}).catch(We=>{me&&(E([]),j(0),L(!1),P(ja(We,u("skillCenter.errors.loadSkills"))))}).finally(()=>{me&&F(!1)}),()=>{me=!1}},[yt,w,C,Ie,u]);const ut=me=>{it(),k(me),H("overview"),N(1),U("")},bt=()=>{it(),k(null),E([]),j(0),L(!1),H("overview"),N(1),U(""),ht(null)},it=()=>{$e.current+=1,Q(null),B(null),ce([]),G(null),re(!1)},xt=async me=>{if(!w)return;const We=Fg(me),St=$e.current+1;$e.current=St,Q(me),B(null),G(null),re(!0);try{const[vn,Ki]=await Promise.all([E1t(w.id,We,me.version,yt,w.projectName,me.skillName,w.name),O1t({spaceId:w.id,skillId:We,version:me.version,region:yt,skillSpaceName:w.name,skillName:me.skillName})]);$e.current===St&&(B(vn),ce(Ki))}catch(vn){$e.current===St&&G(ja(vn,u("skillCenter.errors.loadSkillDetails")))}finally{$e.current===St&&re(!1)}},W=me=>{if(w)return{kind:"skill-center",skillId:Fg(me),version:me.version,region:yt,projectName:w.projectName,skillSpaceId:w.id,skillSpaceName:w.name,name:me.skillName,description:me.skillDescription}},pt=me=>{const We=W(me);!We||!(K!=null&&K.enabled)||(it(),ve({operation:"optimize",source:We}))},Re=async me=>{if(!(!w||!window.confirm(u("skillCenter.deleteSkillConfirm",{name:me.skillName})))){pe(me.skillId),ht(null);try{await w1t({spaceId:w.id,skillId:me.skillId,region:yt}),Be(We=>We+1),ot(We=>We+1)}catch(We){ht(ja(We,u("skillCenter.errors.deleteSkill")))}finally{pe("")}}},ze=async me=>{if(!window.confirm(u("skillCenter.deleteSpaceConfirm",{name:me.name})))return;const We=zl(me);Me(We),ht(null);try{await y1t({spaceId:me.id,region:me.region||Ji(e)}),w&&zl(w)===We&&bt(),ot(St=>St+1)}catch(St){ht(ja(St,u("skillCenter.errors.deleteSpace")))}finally{Me("")}};return Se&&(w||Se.selectPublishSpace)?o.jsx(e5t,{operation:Se.operation,cloudProvider:e,space:w??void 0,availableSpaces:h,spacesLoading:v,initialIntent:Se.initialIntent,source:Se.source,onBack:()=>ve(null),onPublished:()=>{Be(me=>me+1),ot(me=>me+1)}}):o.jsxs("section",{className:`skillcenter${w?" is-space":" resource-collection"}`,children:[w?o.jsx(uE,{className:"skillcenter-detail",title:w.name,description:w.description||u("skillCenter.manageSpaceDescription"),identitySeed:w.name,backLabel:u("skillCenter.backToSpaces"),onBack:bt,sections:[{key:"overview",label:u("skillCenter.overview"),content:o.jsxs(o.Fragment,{children:[Ve?o.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:o.jsx(cl,{error:Ve})}):null,o.jsx("section",{className:"skillcenter-overview",children:o.jsxs(NB,{className:"skillcenter-detail-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:u("skillCenter.skillCount")}),o.jsx("dd",{children:_})]}),o.jsxs("div",{children:[o.jsx("dt",{children:u("skillCenter.updatedAt")}),o.jsx("dd",{children:w.updatedAt?l5t(w.updatedAt,d.resolvedLanguage??d.language):"—"})]})]})})]})},{key:"skills",label:u("skillCenter.skills"),content:o.jsxs(o.Fragment,{children:[Ve?o.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:o.jsx(cl,{error:Ve})}):null,o.jsxs("section",{className:"skillcenter-results","aria-label":u("skillCenter.skillsInSpace",{name:w.name}),children:[o.jsx(FOe,{title:u("skillCenter.skills"),description:u("skillCenter.totalItems",{count:_}),actions:o.jsx(wm,{"aria-label":u("skillCenter.searchSkills"),value:M,onChange:me=>U(me.target.value),placeholder:u("skillCenter.searchSkills")})}),R?o.jsx("div",{className:"skillcenter-inline-warning",role:"status",children:u("skillCenter.degradedRelationWarning")}):null,A&&S.length===0?o.jsx(Ud,{}):T&&S.length===0?o.jsx(tL,{kind:"error",title:u("skillCenter.cannotLoadSkills"),error:T,action:{label:u("common.reload"),onClick:()=>Be(me=>me+1)}}):Ot.length===0?o.jsx(tL,{kind:"empty",title:M.trim()?u("skillCenter.noMatchingSkills"):u("skillCenter.noSkills"),description:M.trim()?u("skillCenter.tryAnotherName"):u("skillCenter.emptySkillsDescription"),action:M.trim()?void 0:{label:u("skillCenter.localUpload"),onClick:()=>Ke(w)}}):o.jsx("div",{className:"skillcenter-table-wrap",children:o.jsxs("table",{className:"skillcenter-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"col",children:u("skillCenter.skills")}),o.jsx("th",{scope:"col",children:u("agentSelector.status")}),o.jsx("th",{scope:"col",className:"skillcenter-table__actions-heading",children:u("skillCenter.actions")})]})}),o.jsx("tbody",{children:Ot.map(me=>o.jsxs("tr",{children:[o.jsx("td",{className:"skillcenter-table__skill",children:o.jsxs("button",{type:"button",onClick:()=>void xt(me),children:[o.jsxs("span",{className:"skillcenter-table__title-row",children:[o.jsx("strong",{title:me.skillName,children:me.skillName}),me.version?o.jsx("span",{className:"skillcenter-table__version-badge",children:me.version}):null]}),o.jsx("span",{className:"skillcenter-table__description",children:lje(me.skillDescription,u)})]})}),o.jsx("td",{children:o.jsx("span",{className:`skillcenter-status ${o5t(me.skillStatus)}`,children:oje(me.skillStatus,u)})}),o.jsx("td",{children:o.jsxs("div",{className:"skillcenter-table__actions",children:[o.jsx("button",{type:"button",onClick:()=>void xt(me),children:u("common.view")}),o.jsx(oj,{disabled:!(K!=null&&K.enabled),children:o.jsx("button",{type:"button",disabled:!(K!=null&&K.enabled),onClick:()=>pt(me),children:u("skillCenter.optimize")})}),me.lookupByName?null:o.jsx("button",{type:"button",className:"is-danger",disabled:J===me.skillId,onClick:()=>void Re(me),children:J===me.skillId?u("common.deleting"):u("common.delete")})]})})]},`${Fg(me)}:${me.version}`))})]})}),!M.trim()&&!A&&!T&&_>0?o.jsx(p5t,{page:C,total:_,pageSize:lte,onPage:N}):null]})]})}],activeSectionKey:I,navigationLabel:u("skillCenter.spaceDetails"),onSectionChange:me=>H(me),actionsClassName:"skillcenter-toolbar-actions",actions:o.jsxs(o.Fragment,{children:[o.jsx(Wt,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>Je(w),children:u("skillCenter.editSpace")}),o.jsx(Wt,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,disabled:oe===zl(w),onClick:()=>void ze(w),children:oe===zl(w)?u("common.deleting"):u("skillCenter.deleteSpace")}),o.jsx(Wt,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>Ke(w),children:u("skillCenter.localUpload")}),o.jsx(oj,{disabled:!(K!=null&&K.enabled),children:o.jsxs(Wt,{type:"button",color:"primary",size:"lg",pill:!1,disabled:!(K!=null&&K.enabled),onClick:()=>ve({operation:"create"}),children:[o.jsx(vbe,{"aria-hidden":"true"}),o.jsx("span",{children:u("skillCenter.createSkill")})]})})]})}):o.jsxs(o.Fragment,{children:[o.jsxs(Zb,{className:"skillcenter-list-toolbar library-resource-toolbar",children:[l,o.jsxs("div",{className:"resource-toolbar__actions",children:[c,o.jsx(wm,{"aria-label":u("skillCenter.searchSpaces"),value:x,onChange:me=>O(me.target.value),placeholder:u("skillCenter.searchSpaces")})]})]}),Ve?o.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:o.jsx(cl,{error:Ve})}):null,o.jsxs(Jb,{className:"skillcenter-list-results",ref:Jt,"aria-label":u("skillCenter.spaceList"),onScroll:Qe,children:[Dt.length>0&&!Fe?o.jsx(dte,{errors:Dt,cloudProvider:e,onRetry:()=>ot(me=>me+1)}):null,v&&h.length===0?o.jsx(Ud,{}):Fe&&h.length===0?o.jsx(dte,{errors:Dt,cloudProvider:e,fullPage:!0,onRetry:()=>ot(me=>me+1)}):je.length===0&&x.trim()?o.jsx(tL,{kind:"empty",title:u("skillCenter.noMatchingSpaces"),description:u("skillCenter.tryAnotherName")}):o.jsxs(Vx,{children:[x.trim()?null:o.jsx(Cb,{"aria-label":u("skillCenter.createSpace"),icon:o.jsx(f5t,{}),onClick:()=>xe(!0),children:u("skillCenter.newSpace")}),je.map(me=>{const We=zl(me);return o.jsx(pE,{className:"skillcenter-space-card",title:me.name,description:me.description||u("common.noDescription"),metadata:[{label:u("skillCenter.skillCount"),value:u("skillCenter.skillCountValue",{count:me.skillCount??0})},{label:u("skillCenter.updatedAt"),value:GQ(me.updatedAt,Date.now(),d.resolvedLanguage??d.language)}],action:{label:u("skillCenter.addSkill"),icon:"plus",onClick:()=>Pe(me)},detailAction:{label:u("common.viewDetails"),onClick:()=>ut(me)}},We)})]}),!Fe&&h.length>0?o.jsx("div",{className:"my-agent-load-more",ref:on,"aria-live":"polite",children:v?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:u("skillCenter.loadingMoreSpaces")})]}):Ft?o.jsx("span",{children:u("skillCenter.scrollForMore")}):Dt.length>0?o.jsx("span",{children:u("skillCenter.someSpacesFailed")}):o.jsx("span",{children:u("skillCenter.allSpacesLoaded")})}):null]})]}),Z&&w&&o.jsx(g5t,{skill:Z,space:w,region:yt,cloudProvider:e,detail:q,files:te,loading:se,error:ge,canOptimize:(K==null?void 0:K.enabled)===!0,onOptimize:()=>pt(Z),onDownload:()=>void S1t({spaceId:w.id,skillId:Fg(Z),version:Z.version,region:yt,fallbackName:Z.skillName,skillSpaceName:w.name,skillName:Z.skillName}).catch(me=>G(ja(me,u("skillCenter.errors.downloadSkill")))),onClose:it}),ue?o.jsx(t5t,{region:t,regionOptions:Iu(e),onClose:()=>xe(!1),onCreated:me=>{xe(!1),ot(We=>We+1),k({...me,region:me.region||t})}}):null,Ee?o.jsx(n5t,{space:Ee,region:Ee.region||Ji(e),onClose:()=>Je(null),onUpdated:me=>{const We={...me,region:me.region||Ee.region||Ji(e)};Je(null),k(St=>St&&zl(St)===zl(We)?We:St),p(St=>St.map(vn=>zl(vn)===zl(We)?We:vn)),ot(St=>St+1)}}):null,De?o.jsx(b5t,{space:De,canUseSandbox:(K==null?void 0:K.enabled)===!0,onClose:()=>Pe(null),onUpload:()=>{Ke(De),Pe(null)},onSandbox:()=>{const me=De;Pe(null),ut(me),ve({operation:"create"})}}):null,Ne?o.jsx(i5t,{space:Ne,region:Ne.region||Ji(e),onClose:()=>Ke(null),onUploaded:()=>{Ke(null),Be(me=>me+1),ot(me=>me+1)}}):null]})}function v5t(e){return[{id:"skills",label:e("library.tabs.skills"),panelId:"library-skills-panel"},{id:"knowledge",label:e("library.tabs.knowledge"),panelId:"library-knowledge-panel"},{id:"artifacts",label:e("library.tabs.artifacts"),panelId:"library-artifacts-panel"}]}function x5t({cloudProvider:e,studioRegion:t="",activeTab:n,onTabChange:i,onPageTitleChange:r,skillInitialWorkspace:s=null,onSkillInitialWorkspaceConsumed:a,artifactSources:l=[],artifactUserId:c="",onArtifactActivate:u,onArtifactSourceOpen:d}){const{t:f,i18n:h}=Ce("workspaceTools"),p=m.useMemo(()=>v5t(f),[f]),g=f("library.tabs.skills"),b=tR(t)?t:Ji(e),[v,y]=m.useState(b),[x,O]=m.useState(g),w=m.useRef(g),[k,S]=m.useState(!1),[E,C]=m.useState(()=>new Set(["skills",n])),[N,_]=m.useState({skills:0,knowledge:0,artifacts:0}),j=m.useRef(u),[A,F]=m.useState([]),[T,P]=m.useState(!1),[R,L]=m.useState(""),M=m.useMemo(()=>{const ce=Uot(l,f("library.untitledSession"));return{key:JSON.stringify(ce),candidates:ce}},[l,f]),U=m.useRef(M);U.current.key!==M.key&&(U.current=M);const I=U.current.candidates,H=m.useMemo(()=>Iu(e),[e]);m.useEffect(()=>{y(b)},[b]),m.useEffect(()=>{const ce=w.current;O(se=>se===ce?g:se),w.current=g},[g]),m.useEffect(()=>{j.current=u},[u]),m.useEffect(()=>{C(ce=>{if(ce.has(n))return ce;const se=new Set(ce);return se.add(n),se})},[n]),m.useEffect(()=>{var se;const ce=n==="skills"?x:((se=p.find(re=>re.id===n))==null?void 0:se.label)||f("library.title");r==null||r(ce)},[n,r,x,f,p]),m.useEffect(()=>{var ce;n==="artifacts"&&((ce=j.current)==null||ce.call(j))},[n,N.artifacts]);const Z=m.useCallback(async()=>{P(!0),L("");try{F(await Xot(I))}catch(ce){L(ce instanceof Error?ce.message:String(ce))}finally{P(!1)}},[I]);m.useEffect(()=>{n==="artifacts"&&Z()},[n,N.artifacts,Z]);const Q=ce=>{C(se=>{if(se.has(ce))return se;const re=new Set(se);return re.add(ce),re}),_(se=>({...se,[ce]:se[ce]+1})),i(ce)},q=o.jsx(dE,{idPrefix:"library",ariaLabel:f("library.categoryAria"),value:n,items:p,onChange:Q}),B=ce=>o.jsx(lN,{id:ce,ariaLabel:f("library.regionAria"),value:v,options:H,onChange:y}),te=n==="skills"?x!==g:n==="knowledge"&&k;return o.jsxs(Th,{className:`library-view${te?" is-detail":""}`,"aria-label":f("library.title"),children:[te?null:o.jsx(zx,{className:"library-view__header",title:f("library.title")}),o.jsxs("div",{className:"library-panels",children:[E.has("skills")?o.jsx("div",{id:"library-skills-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-skills-tab",hidden:n!=="skills",children:o.jsx(y5t,{cloudProvider:e,region:v,active:n==="skills",activationRevision:N.skills,onPageTitleChange:O,initialWorkspace:s,onInitialWorkspaceConsumed:a,toolbarLeading:q,toolbarFilters:B("library-skills-region-filter")})}):null,E.has("knowledge")?o.jsx("div",{id:"library-knowledge-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-knowledge-tab",hidden:n!=="knowledge",children:o.jsx(i1t,{cloudProvider:e,region:v,active:n==="knowledge",activationRevision:N.knowledge,onDetailChange:S,toolbarLeading:q,toolbarFilters:B("library-knowledge-region-filter")})}):null,E.has("artifacts")?o.jsx("div",{id:"library-artifacts-panel",className:"library-panel",role:"tabpanel","aria-labelledby":"library-artifacts-tab",hidden:n!=="artifacts",children:o.jsx(Wot,{items:A,region:v,userId:c,active:n==="artifacts",activationRevision:N.artifacts,loading:T,error:R?jd(R,h.resolvedLanguage||h.language)||f("artifactLibrary.loadDetailFallback"):"",onRetry:()=>void Z(),onEdit:Yot,onDelete:Zot,onDownload:Jot,onOpenSource:d?ce=>d(ce.appName,ce.sessionId):void 0,toolbarLeading:q,toolbarFilters:B("library-artifacts-region-filter")})}):null]})]})}const cje="veadk_agentkit_connections",w5t=3e3,fte=6e4;function ku(){try{const e=localStorage.getItem(cje);return(e?JSON.parse(e):[]).filter(n=>!n.runtimeId||!!n.region)}catch{return[]}}function LI(e){try{localStorage.setItem(cje,JSON.stringify(e))}catch{}}function Lu(e,t){return`agentkit:${e}:${t}`}function uje(e){try{return new URL(e).host}catch{return e}}function o1(e){Dbe();for(const t of e)if(!(t.runtimeId&&!t.region))for(const n of t.apps)Pbe(Lu(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,region:t.region}:{app:n,base:t.base,apiKey:t.apiKey})}function dje(e,t,n,i,r,s){const a={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:i,appLabels:r,currentVersion:s},l=ku(),c=l.findIndex(u=>u.runtimeId===e);return c===-1?l.push(a):l[c]=a,LI(l),o1(l),a}async function O5t(e,t,n,i,r){let s=null,a=n||"cn-beijing",l=null;for(const f of Qk(n))try{const h=await Fv(e,f,{retryProbe:!0,preferCached:!0,currentVersion:i});if(h&&h.length>0){await Z0e(e,f),s=h,a=f;break}}catch(h){if(h instanceof Cx)throw lj(e),h;if(h instanceof Ds&&h.unsupported){l=h;continue}throw h}if(!s||s.length===0)throw lj(e),l||new Ds(V("connections.runtimeUnsupported"),!0,!0);const c=(r==null?void 0:r.trim())||s[0],u=Object.fromEntries(s.map(f=>[f,f===s[0]?c:f])),d=dje(e,t,a,s,u,i);return Lu(d.id,s[0])}function S5t(e){return new Promise(t=>window.setTimeout(t,e))}async function UA(e,t,n,i,r={}){const s=Date.now();for(;;)try{return await O5t(e,t,n,i,r.agentName)}catch(a){const l=Date.now()-s;if(!r.waitForReady||!(a instanceof Ds)||!a.retryable||l>=fte)throw a;const c=Math.min(w5t,fte-l);await S5t(c)}}async function fje(e,t,n,i){const r=t.trim().replace(/\/+$/,""),s=await zk(r,n.trim()),a={id:Date.now().toString(36),name:e.trim()||uje(r),base:r,apiKey:n.trim(),apps:s,appLabels:i&&s.length>0?{[s[0]]:i}:void 0},l=[...ku().filter(c=>c.base!==r),a];return LI(l),o1(l),a}function k5t(e){const t=ku().filter(n=>n.id!==e);return LI(t),o1(t),t}function lj(e){const t=ku().filter(n=>n.runtimeId!==e);return LI(t),o1(t),t}function hje(e,t){const n=e.map(r=>({id:r,label:r,app:r,remote:!1})),i=t.flatMap(r=>r.apps.map(s=>{var l;const a=((l=r.appLabels)==null?void 0:l[s])??s;return{id:Lu(r.id,s),label:a,app:s,remote:!0,host:r.runtimeId?r.name:uje(r.base??""),runtimeId:r.runtimeId,region:r.region,currentVersion:r.currentVersion}}));return[...n,...i]}const hte=Object.freeze(Object.defineProperty({__proto__:null,addConnection:fje,addRuntimeConnection:dje,buildAgentEntries:hje,connectRuntime:UA,loadConnections:ku,registerConnections:o1,remoteAppId:Lu,removeConnection:k5t,removeRuntimeConnection:lj},Symbol.toStringTag,{value:"Module"}));function E5t({onAdded:e,onCancel:t}){const{t:n}=Ce("conversation"),[i,r]=m.useState(""),[s,a]=m.useState(""),[l,c]=m.useState(""),[u,d]=m.useState(!1),[f,h]=m.useState(""),p=i.trim().length>0&&s.trim().length>0&&!u;async function g(){if(p){d(!0),h("");try{const b=await fje(l,i,s,l);if(b.apps.length===0){h(n("addAgentKit.noAgents")),d(!1);return}e(Lu(b.id,b.apps[0]))}catch(b){h(n("addAgentKit.connectionFailed",{error:String(b)})),d(!1)}}}return o.jsx("div",{className:"addagent",children:o.jsxs("div",{className:"addagent-card",children:[o.jsx("h2",{className:"addagent-title",children:n("addAgentKit.title")}),o.jsx("p",{className:"addagent-sub",children:n("addAgentKit.description")}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:n("addAgentKit.url")}),o.jsx("input",{className:"addagent-input",value:i,onChange:b=>r(b.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:b=>a(b.target.value),placeholder:n("addAgentKit.apiKeyHint")})]}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:n("addAgentKit.displayName")}),o.jsx("input",{className:"addagent-input",value:l,onChange:b=>c(b.target.value),placeholder:n("addAgentKit.displayNameHint")})]}),f&&o.jsx("div",{className:"addagent-error",children:f}),o.jsxs("div",{className:"addagent-actions",children:[o.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:u,children:n("addAgentKit.cancel")}),o.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:g,disabled:!p,children:[u?o.jsx(fi,{className:"icon spin"}):null,n(u?"addAgentKit.connecting":"addAgentKit.connect")]})]})]})})}const C5t=/[\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff]/u,T5t={"deploy.build.logs_syncing":"client.deploymentProgress.buildLogsSyncing","deploy.build.logs_complete":"client.deploymentProgress.buildLogsComplete","deploy.build.failed_logs_synced":"client.deploymentProgress.buildFailedLogsSynced","deploy.build.logs_unavailable":"client.deploymentProgress.buildLogsUnavailable","deploy.build.final_logs_unavailable":"client.deploymentProgress.finalBuildLogsUnavailable"},A5t={prepare:"client.deploymentProgress.preparing",upload:"client.deploymentProgress.uploading",build:"client.deploymentProgress.building",deploy:"client.deploymentProgress.deploying",publish:"client.deploymentProgress.publishing",evaluation:"client.deploymentProgress.evaluating",update:"client.deploymentProgress.updating",complete:"client.deploymentProgress.completing",github:"client.deploymentProgress.github"};function $I(e){var r,s;const t=((r=e.message)==null?void 0:r.trim())??"",n=e.messageCode?T5t[e.messageCode]:void 0;if(n)return V(n);if(t&&($7e().toLowerCase()==="zh-cn"||!C5t.test(t)))return t;if(e.phase==="build"&&((s=e.buildLog)!=null&&s.status)){const a={running:"client.deploymentProgress.buildLogsSyncing",complete:"client.deploymentProgress.buildLogsComplete",error:"client.deploymentProgress.buildLogsUnavailable"}[e.buildLog.status];if(a)return V(a)}const i=e.phase?A5t[e.phase]:void 0;return i?V(i):t||V("client.deploymentProgress.inProgress")}function _5t(e){return[{id:"case-1",itemKey:"case-1",kind:"good",input:e("agentWorkspace.defaultCases.weeklyFeedback.input"),output:e("agentWorkspace.defaultCases.weeklyFeedback.output"),referenceOutput:e("agentWorkspace.defaultCases.weeklyFeedback.output"),comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T09:12:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.goodSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.weeklyFeedback.tag"),source:"auto",score:.92,reason:e("agentWorkspace.defaultCases.weeklyFeedback.reason")},{id:"case-2",itemKey:"case-2",kind:"good",input:e("agentWorkspace.defaultCases.research.input"),output:e("agentWorkspace.defaultCases.research.output"),referenceOutput:e("agentWorkspace.defaultCases.research.output"),comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T08:47:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.goodSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.research.tag"),source:"user"},{id:"case-3",itemKey:"case-3",kind:"bad",input:e("agentWorkspace.defaultCases.uncertainConclusion.input"),output:e("agentWorkspace.defaultCases.uncertainConclusion.output"),referenceOutput:"",comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T07:35:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.badSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.uncertainConclusion.tag"),source:"auto",score:.28,reason:e("agentWorkspace.defaultCases.uncertainConclusion.reason")},{id:"case-4",itemKey:"case-4",kind:"bad",input:e("agentWorkspace.defaultCases.repeatedTool.input"),output:e("agentWorkspace.defaultCases.repeatedTool.output"),referenceOutput:"",comment:"",agentName:e("agentWorkspace.defaultCases.agentName"),sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T06:58:00+08:00",evaluationSetId:"",evaluationSetName:e("agentWorkspace.defaultCases.badSetName"),workspaceId:"",tag:e("agentWorkspace.defaultCases.repeatedTool.tag"),source:"user"}]}const N5t=[{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"}]}],j5t={核心能力回归:"agentWorkspace.evaluationDefaults.coreRegression",安全与幻觉检查:"agentWorkspace.evaluationDefaults.safetyCheck",核心回归集:"agentWorkspace.evaluationDefaults.coreSet",安全边界集:"agentWorkspace.evaluationDefaults.safetySet",工具调用集:"agentWorkspace.evaluationDefaults.toolSet",综合质量评估器:"agentWorkspace.evaluationDefaults.qualityEvaluator",事实一致性评估器:"agentWorkspace.evaluationDefaults.factualEvaluator",工具调用评估器:"agentWorkspace.evaluationDefaults.toolEvaluator",回答质量:"agentWorkspace.evaluationDefaults.responseQuality",事实准确性:"agentWorkspace.evaluationDefaults.factualAccuracy",工具调用:"agentWorkspace.evaluationDefaults.toolUse",响应效率:"agentWorkspace.evaluationDefaults.responseEfficiency","今天 10:32":"agentWorkspace.evaluationDefaults.todayTime","昨天 16:08":"agentWorkspace.evaluationDefaults.yesterdayTime","7 月 25 日 14:20":"agentWorkspace.evaluationDefaults.julyTime",刚刚:"agentWorkspace.evaluationDefaults.justNow"};function Ww(e,t){const n=j5t[e];return n?t(n):e}const pte=["basic","usage","evaluations","optimizations","integrations","versions"],R5t=20;function I5t(e,t,n){const i=Date.parse(e);return Number.isNaN(i)?n("agentWorkspace.notProvided"):new Intl.DateTimeFormat(t,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(i)}const sw=[{id:"api-server",label:"API Server"},{id:"a2a",label:"A2A"}];function nL(e,t){return e?`${e.replace(/\/+$/,"")}${t}`:""}function P5t(e,t){const n=e.trim();if(!n||!t)return n;try{const i=new URL(n),r=i.hostname.replace(/^\[|\]$/g,"").toLowerCase();if(!["localhost","127.0.0.1","::1"].includes(r))return n;const s=new URL(t);return i.protocol=s.protocol,i.hostname=s.hostname,i.port=s.port,i.toString()}catch{return n}}function mte(e,t){return e==="key_auth"?"API Key":e==="custom_jwt"?"OAuth / JWT":t(e==="none"?"agentWorkspace.noAuthentication":"agentWorkspace.notAvailable")}function gte(e,t){return t(e==="published"?"agentWorkspace.githubStatus.published":e==="publishing"?"agentWorkspace.githubStatus.publishing":e==="failed"?"agentWorkspace.githubStatus.failed":e==="pending"?"agentWorkspace.githubStatus.pending":"agentWorkspace.githubStatus.unknown")}function D5t(e,t){return e.changeType==="rollback"?t("agentWorkspace.rollbackEvent"):e.version}function y8(e){return JSON.stringify(e)}function pje(e){return e==="key_auth"?`API_KEY = "" HEADERS = {"Authorization": f"Bearer {API_KEY}"}`:e==="custom_jwt"?`ACCESS_TOKEN = "" HEADERS = {"Authorization": f"Bearer {ACCESS_TOKEN}"}`:e==="none"?"HEADERS = {}":`AUTH_TOKEN = "" HEADERS = {"Authorization": f"Bearer {AUTH_TOKEN}"}`}function M5t(e,t,n){const i=e.replace(/\/+$/,"");return`\`\`\`python @@ -810,19 +810,19 @@ response = requests.post( ) response.raise_for_status() print(response.json()) -\`\`\``}function $5t({visible:e}){return o.jsxs("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:"M2.8 12s3.3-5.4 9.2-5.4 9.2 5.4 9.2 5.4-3.3 5.4-9.2 5.4S2.8 12 2.8 12Z"}),o.jsx("circle",{cx:"12",cy:"12",r:"2.4"}),!e&&o.jsx("path",{d:"m4.2 4.2 15.6 15.6"})]})}function bte({available:e,authType:t,value:n,visible:i,loading:r,error:s,onToggle:a}){const{t:l}=Ae("ui");return e?t==="none"?l("agentWorkspace.noApiKeyRequired"):t==="custom_jwt"?l("agentWorkspace.usesOauthJwt"):t!=="key_auth"?l("agentWorkspace.notAvailable"):o.jsxs("span",{className:"aw-integration-secret",children:[o.jsx("span",{className:"aw-integration-secret-value","aria-live":"polite",children:i&&n?n:"****"}),o.jsx("button",{type:"button",className:"aw-integration-secret-toggle","aria-label":l(i?"agentWorkspace.hideApiKey":"agentWorkspace.showApiKey"),title:l(i?"agentWorkspace.hideApiKey":"agentWorkspace.showApiKey"),disabled:r,onClick:a,children:r?o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}):o.jsx($5t,{visible:i})}),s&&o.jsx("span",{className:"aw-integration-secret-error",role:"alert",children:s})]}):l("agentWorkspace.notAvailable")}function yte({protocol:e,title:t,available:n,fields:i,example:r}){const{t:s}=Ae("ui");return o.jsxs("section",{className:`aw-integration-panel${n&&r?" has-example":""}`,id:`integration-${e}-panel`,role:"tabpanel","aria-labelledby":`integration-${e}-tab`,children:[o.jsx("header",{children:o.jsx("h3",{children:t})}),o.jsx("dl",{children:i.map(a=>o.jsxs("div",{children:[o.jsx("dt",{children:a.label}),o.jsx("dd",{children:a.value||s("agentWorkspace.notAvailable")})]},a.label))}),n&&r&&o.jsxs("section",{className:"aw-integration-example",children:[o.jsx("h4",{children:s("agentWorkspace.pythonExample")}),o.jsx(Bu,{text:r,className:"aw-integration-example-code",allowRawHtml:!1})]})]})}function F5t(e,t,n){var i;return EB({appName:((i=e==null?void 0:e.appName)==null?void 0:i.trim())||t,name:e==null?void 0:e.name,description:e==null?void 0:e.description,type:e==null?void 0:e.type,model:e==null?void 0:e.model,tools:e==null?void 0:e.tools,skills:e==null?void 0:e.skills,graph:e==null?void 0:e.graph,draft:e==null?void 0:e.draft},n)}function mje(e){return e?1+e.children.reduce((t,n)=>t+mje(n),0):1}function gje(e){return 1+e.subAgents.reduce((t,n)=>t+gje(n),0)}function v8(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 B5t(e,t,n){const i=v8(e);return i?new Intl.DateTimeFormat(t,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(i)):n("agentWorkspace.unknownTime")}function U5t(e,t){return typeof e.score!="number"||!Number.isFinite(e.score)?"—":t("agentWorkspace.scoreValue",{score:Math.round(e.score*100)})}function Q5t(e,t){return t(`agentWorkspace.priority.${e}`)}const z5t={agent_structure:"agentWorkspace.modules.agentStructure",prompt:"agentWorkspace.modules.prompt",tool:"agentWorkspace.modules.tool",knowledge:"agentWorkspace.modules.knowledge",memory:"agentWorkspace.modules.memory",workflow:"agentWorkspace.modules.workflow",other:"agentWorkspace.modules.other"};function V5t(e,t){var n;return e.module==="other"?((n=e.customModule)==null?void 0:n.trim())||t("agentWorkspace.modules.other"):t(z5t[e.module])}function H5t(e,t){return e.find(n=>n.kind===t)}function vte(e,t){return e.items.map(n=>({...n,tag:t(n.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")})).sort((n,i)=>v8(i.createdAt)-v8(n.createdAt))}function q5t(e){const t=n=>[n.name,n.description,n.agentType??"llm",n.modelName??"",n.tools??[],n.builtinTools??[],(n.customTools??[]).map(i=>i.name),(n.mcpTools??[]).map(i=>i.name),n.skills??[],(n.selectedSkills??[]).map(i=>i.name),(n.subAgents??[]).map(t)];return JSON.stringify(t(e))}function W5t(e){return[{phase:"prepare",label:e("agentWorkspace.deploymentSteps.prepare.label"),description:e("agentWorkspace.deploymentSteps.prepare.description")},{phase:"build",label:e("agentWorkspace.deploymentSteps.build.label"),description:e("agentWorkspace.deploymentSteps.build.description")},{phase:"deploy",label:e("agentWorkspace.deploymentSteps.deploy.label"),description:e("agentWorkspace.deploymentSteps.deploy.description")},{phase:"publish",label:e("agentWorkspace.deploymentSteps.publish.label"),description:e("agentWorkspace.deploymentSteps.publish.description")},{phase:"complete",label:e("agentWorkspace.deploymentSteps.complete.label"),description:e("agentWorkspace.deploymentSteps.complete.description")}]}function G5t(e,t){return{phase:"update",label:t("agentWorkspace.deploymentSteps.update.label"),description:t("agentWorkspace.deploymentSteps.update.description",e)}}function bje(e,t){const n=W5t(t),i=[...n.slice(0,-1)];return e.instanceRange&&i.push(G5t(e.instanceRange,t)),e.createEvaluationSets&&i.push({phase:"evaluation",label:t("agentWorkspace.deploymentSteps.evaluation.label"),description:t("agentWorkspace.deploymentSteps.evaluation.description")}),e.githubDelivery&&i.push({phase:"github",label:t("agentWorkspace.deploymentSteps.github.label"),description:t("agentWorkspace.deploymentSteps.github.description")}),i.push(n[n.length-1]),i}function yje(e,t){const n=bje(e,t);if(e.status==="success")return n.length-1;const i=e.phase??{准备部署:"prepare",构建镜像:"build",部署:"deploy",发布:"publish",创建评测集:"evaluation","挂载 GitHub 持续交付":"github",部署完成:"complete"}[e.label],r=n.findIndex(s=>s.phase===i);return r<0?0:r}function K5t(e,t){if(!e)return"";try{return new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(new Date(e))}catch{return""}}function vje({log:e,autoExpand:t,title:n,ariaLabel:i,copyLabel:r,defaultPendingMessage:s}){const{t:a,i18n:l}=Ae("ui"),c=m.useRef(null),u=!!((e==null?void 0:e.status)!=="complete"&&t),[d,f]=m.useState(u),[h,p]=m.useState(!1),g=!!(e!=null&&e.text||e!=null&&e.error),b=(e==null?void 0:e.text)||(e==null?void 0:e.error)||"",v=b.split(` +\`\`\``}function $5t({visible:e}){return o.jsxs("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:"M2.8 12s3.3-5.4 9.2-5.4 9.2 5.4 9.2 5.4-3.3 5.4-9.2 5.4S2.8 12 2.8 12Z"}),o.jsx("circle",{cx:"12",cy:"12",r:"2.4"}),!e&&o.jsx("path",{d:"m4.2 4.2 15.6 15.6"})]})}function bte({available:e,authType:t,value:n,visible:i,loading:r,error:s,onToggle:a}){const{t:l}=Ce("ui");return e?t==="none"?l("agentWorkspace.noApiKeyRequired"):t==="custom_jwt"?l("agentWorkspace.usesOauthJwt"):t!=="key_auth"?l("agentWorkspace.notAvailable"):o.jsxs("span",{className:"aw-integration-secret",children:[o.jsx("span",{className:"aw-integration-secret-value","aria-live":"polite",children:i&&n?n:"****"}),o.jsx("button",{type:"button",className:"aw-integration-secret-toggle","aria-label":l(i?"agentWorkspace.hideApiKey":"agentWorkspace.showApiKey"),title:l(i?"agentWorkspace.hideApiKey":"agentWorkspace.showApiKey"),disabled:r,onClick:a,children:r?o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}):o.jsx($5t,{visible:i})}),s&&o.jsx("span",{className:"aw-integration-secret-error",role:"alert",children:s})]}):l("agentWorkspace.notAvailable")}function yte({protocol:e,title:t,available:n,fields:i,example:r}){const{t:s}=Ce("ui");return o.jsxs("section",{className:`aw-integration-panel${n&&r?" has-example":""}`,id:`integration-${e}-panel`,role:"tabpanel","aria-labelledby":`integration-${e}-tab`,children:[o.jsx("header",{children:o.jsx("h3",{children:t})}),o.jsx("dl",{children:i.map(a=>o.jsxs("div",{children:[o.jsx("dt",{children:a.label}),o.jsx("dd",{children:a.value||s("agentWorkspace.notAvailable")})]},a.label))}),n&&r&&o.jsxs("section",{className:"aw-integration-example",children:[o.jsx("h4",{children:s("agentWorkspace.pythonExample")}),o.jsx(Bu,{text:r,className:"aw-integration-example-code",allowRawHtml:!1})]})]})}function F5t(e,t,n){var i;return EB({appName:((i=e==null?void 0:e.appName)==null?void 0:i.trim())||t,name:e==null?void 0:e.name,description:e==null?void 0:e.description,type:e==null?void 0:e.type,model:e==null?void 0:e.model,tools:e==null?void 0:e.tools,skills:e==null?void 0:e.skills,graph:e==null?void 0:e.graph,draft:e==null?void 0:e.draft},n)}function mje(e){return e?1+e.children.reduce((t,n)=>t+mje(n),0):1}function gje(e){return 1+e.subAgents.reduce((t,n)=>t+gje(n),0)}function v8(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 B5t(e,t,n){const i=v8(e);return i?new Intl.DateTimeFormat(t,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(i)):n("agentWorkspace.unknownTime")}function U5t(e,t){return typeof e.score!="number"||!Number.isFinite(e.score)?"—":t("agentWorkspace.scoreValue",{score:Math.round(e.score*100)})}function Q5t(e,t){return t(`agentWorkspace.priority.${e}`)}const z5t={agent_structure:"agentWorkspace.modules.agentStructure",prompt:"agentWorkspace.modules.prompt",tool:"agentWorkspace.modules.tool",knowledge:"agentWorkspace.modules.knowledge",memory:"agentWorkspace.modules.memory",workflow:"agentWorkspace.modules.workflow",other:"agentWorkspace.modules.other"};function V5t(e,t){var n;return e.module==="other"?((n=e.customModule)==null?void 0:n.trim())||t("agentWorkspace.modules.other"):t(z5t[e.module])}function H5t(e,t){return e.find(n=>n.kind===t)}function vte(e,t){return e.items.map(n=>({...n,tag:t(n.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")})).sort((n,i)=>v8(i.createdAt)-v8(n.createdAt))}function q5t(e){const t=n=>[n.name,n.description,n.agentType??"llm",n.modelName??"",n.tools??[],n.builtinTools??[],(n.customTools??[]).map(i=>i.name),(n.mcpTools??[]).map(i=>i.name),n.skills??[],(n.selectedSkills??[]).map(i=>i.name),(n.subAgents??[]).map(t)];return JSON.stringify(t(e))}function W5t(e){return[{phase:"prepare",label:e("agentWorkspace.deploymentSteps.prepare.label"),description:e("agentWorkspace.deploymentSteps.prepare.description")},{phase:"build",label:e("agentWorkspace.deploymentSteps.build.label"),description:e("agentWorkspace.deploymentSteps.build.description")},{phase:"deploy",label:e("agentWorkspace.deploymentSteps.deploy.label"),description:e("agentWorkspace.deploymentSteps.deploy.description")},{phase:"publish",label:e("agentWorkspace.deploymentSteps.publish.label"),description:e("agentWorkspace.deploymentSteps.publish.description")},{phase:"complete",label:e("agentWorkspace.deploymentSteps.complete.label"),description:e("agentWorkspace.deploymentSteps.complete.description")}]}function G5t(e,t){return{phase:"update",label:t("agentWorkspace.deploymentSteps.update.label"),description:t("agentWorkspace.deploymentSteps.update.description",e)}}function bje(e,t){const n=W5t(t),i=[...n.slice(0,-1)];return e.instanceRange&&i.push(G5t(e.instanceRange,t)),e.createEvaluationSets&&i.push({phase:"evaluation",label:t("agentWorkspace.deploymentSteps.evaluation.label"),description:t("agentWorkspace.deploymentSteps.evaluation.description")}),e.githubDelivery&&i.push({phase:"github",label:t("agentWorkspace.deploymentSteps.github.label"),description:t("agentWorkspace.deploymentSteps.github.description")}),i.push(n[n.length-1]),i}function yje(e,t){const n=bje(e,t);if(e.status==="success")return n.length-1;const i=e.phase??{准备部署:"prepare",构建镜像:"build",部署:"deploy",发布:"publish",创建评测集:"evaluation","挂载 GitHub 持续交付":"github",部署完成:"complete"}[e.label],r=n.findIndex(s=>s.phase===i);return r<0?0:r}function K5t(e,t){if(!e)return"";try{return new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(new Date(e))}catch{return""}}function vje({log:e,autoExpand:t,title:n,ariaLabel:i,copyLabel:r,defaultPendingMessage:s}){const{t:a,i18n:l}=Ce("ui"),c=m.useRef(null),u=!!((e==null?void 0:e.status)!=="complete"&&t),[d,f]=m.useState(u),[h,p]=m.useState(!1),g=!!(e!=null&&e.text||e!=null&&e.error),b=(e==null?void 0:e.text)||(e==null?void 0:e.error)||"",v=b.split(` `),y=d?b:v.slice(-36).join(` -`),x=(e==null?void 0:e.pendingMessage)||s;if(m.useEffect(()=>{e&&f(u)},[e==null?void 0:e.status,u]),m.useEffect(()=>{if(!d||!g)return;const C=c.current;C&&(C.scrollTop=C.scrollHeight)},[d,g,y]),!e||!e.text&&e.status!=="error"&&!e.pendingMessage)return null;const O=K5t(e.updatedAt,l.resolvedLanguage??l.language),w=e.status==="complete"?a("agentWorkspace.logStatus.synced"):e.status==="error"?a("agentWorkspace.logStatus.failed"):a("agentWorkspace.logStatus.syncing"),k=e.omittedEarly?a("agentWorkspace.logStatus.earlyOmitted"):e.snapshotTruncated?a("agentWorkspace.logStatus.recentOnly"):e.truncated?a("agentWorkspace.logStatus.partiallyOmitted"):"",S=[w,e.lineCount?a("agentWorkspace.logLines",{count:e.lineCount}):"",k,O].filter(Boolean).join(" · ");async function E(){try{await navigator.clipboard.writeText(b),p(!0),window.setTimeout(()=>p(!1),1500)}catch{p(!1)}}return o.jsxs("section",{className:`aw-deploy-log is-${e.status}${d?"":" is-collapsed"}`,"aria-label":i,children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:n}),o.jsx("span",{children:S})]}),o.jsxs("div",{className:"aw-deploy-log-actions",children:[g&&o.jsx("button",{type:"button",onClick:()=>f(C=>!C),children:a(d?"common.collapse":"common.expand")}),g&&o.jsxs("button",{type:"button",onClick:()=>void E(),"aria-label":h?a("agentWorkspace.copiedLabel",{label:r}):a("agentWorkspace.copyLabel",{label:r}),title:h?a("agentWorkspace.copied"):a("agentWorkspace.copyLabel",{label:r}),children:[h?o.jsx(Vu,{"aria-hidden":!0}):o.jsx(Xj,{"aria-hidden":!0}),o.jsx("span",{children:a(h?"agentWorkspace.copied":"agentWorkspace.copy")})]})]})]}),d&&(g?o.jsx("pre",{ref:c,children:y}):o.jsx("div",{className:"aw-deploy-log-empty",children:x}))]})}function X5t({task:e}){var n;const{t}=Ae("ui");return o.jsx(vje,{log:e.buildLog,autoExpand:((n=e.buildLog)==null?void 0:n.status)!=="complete"&&(e.status==="running"||e.status==="error")&&yje(e,t)===1,title:t("agentWorkspace.buildLog"),ariaLabel:t("agentWorkspace.buildLog"),copyLabel:t("agentWorkspace.buildLog"),defaultPendingMessage:t("agentWorkspace.waitingBuildLog")})}function Y5t({task:e}){var n;const{t}=Ae("ui");return o.jsx(vje,{log:e.githubLog,autoExpand:((n=e.githubLog)==null?void 0:n.status)!=="complete"&&(e.status==="running"||e.status==="error")&&e.phase==="github",title:t("agentWorkspace.githubMountLog"),ariaLabel:t("agentWorkspace.githubDeliveryMountLog"),copyLabel:t("agentWorkspace.githubMountLog"),defaultPendingMessage:t("agentWorkspace.waitingGithubMountLog")})}function Z5t({task:e,onReturnToEdit:t}){const{t:n}=Ae("ui"),i=bje(e,n),r=yje(e,n),s=e.status==="success"?100:Math.max(6,Math.min(100,e.pct??6)),a=e.status==="running"&&e.statusUnconfirmed?n("agentWorkspace.deployStatus.unconfirmed"):e.status==="running"?n("agentWorkspace.deployStatus.running"):e.status==="success"?n("agentWorkspace.deployStatus.success"):e.status==="error"?n("agentWorkspace.deployStatus.error"):n("agentWorkspace.deployStatus.cancelled");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"&&e.statusUnconfirmed?o.jsx(X2,{}):e.status==="running"?o.jsx(fi,{className:"spin"}):e.status==="success"?o.jsx(c7e,{}):e.status==="error"?o.jsx(X2,{}):o.jsx(f4,{})}),o.jsxs("div",{children:[o.jsx("h3",{children:a}),o.jsx("p",{children:e.runtimeName})]})]}),o.jsx("strong",{children:e.status==="running"&&!e.statusUnconfirmed?`${Math.round(s)}%`:e.label})]}),o.jsx("div",{className:"aw-deploy-progress-track",role:"progressbar","aria-label":n("agentWorkspace.deploymentProgress"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(s),children:o.jsx("span",{style:{width:`${s}%`}})}),o.jsx("ol",{className:"aw-deploy-steps",children:i.map((l,c)=>{const u=e.status==="success"||cnew Set),[Rt,pn]=m.useState(()=>new Set),[Zt,Jt]=m.useState(!1),[Un,xn]=m.useState(""),[oi,Oi]=m.useState(null),[mi,bn]=m.useState([]),[qi,ri]=m.useState([]),[zi,as]=m.useState(!1),[Lr,_r]=m.useState(""),[xs,os]=m.useState(""),[ia,Nr]=m.useState(0),[As,Vs]=m.useState([]),[Yr,ra]=m.useState(!1),[sa,ls]=m.useState(""),[va,aa]=m.useState(0),[ws,Ua]=m.useState(null),[oa,Qa]=m.useState(1),[Jn,Ni]=m.useState(!1),[ko,xa]=m.useState(""),[Xi,Eo]=m.useState(0),[ve,Xe]=m.useState(!1),[Gt,en]=m.useState(()=>new Set),[In,mr]=m.useState(!1),[jr,_s]=m.useState(""),[Si,la]=m.useState(""),[Hs,$r]=m.useState(()=>new Set),wa=m.useRef(!1),cs=m.useRef(""),Vi=m.useRef(null),so=m.useRef(0),ao=m.useRef(0),Go=m.useRef(0),[oo,ed]=m.useState(N5t),[bc,uu]=m.useState("");m.useEffect(()=>{e.length!==0&&ed(te=>te.map((je,Qe)=>Qe===0&&je.agentIds.length===0?{...je,agentIds:e.slice(0,2).map(mt=>mt.id)}:je))},[e]);const Co=m.useMemo(()=>{const te=new Map;for(const je of e)je.runtimeId&&te.set(je.runtimeId,je);return te},[e]),yc=m.useMemo(()=>{var je;const te=new Map;for(const Qe of t){const mt=(je=Qe.deploymentTarget)==null?void 0:je.runtimeId;if(!mt||!Co.has(mt))continue;const un=te.get(mt);(!un||Qe.updatedAt>un.updatedAt)&&te.set(mt,Qe)}return te},[Co,t]),Cl=m.useMemo(()=>{const te=new Map;for(const je of f){if(!je.runtimeId)continue;const Qe=te.get(je.runtimeId);(!Qe||je.startedAt>Qe.startedAt)&&te.set(je.runtimeId,je)}return te},[f]),td=m.useMemo(()=>{const te=He.trim().toLowerCase();return te?e.filter(je=>{const Qe=je.runtimeId?yc.get(je.runtimeId):void 0,mt=je.runtimeId?Cl.get(je.runtimeId):void 0;return[je.label,je.app,je.host??"",(Qe==null?void 0:Qe.draft.name)??"",(Qe==null?void 0:Qe.draft.description)??"",(mt==null?void 0:mt.runtimeName)??""].join(" ").toLowerCase().includes(te)}):e},[e,Cl,He,yc]),Oa=m.useMemo(()=>{const te=He.trim().toLowerCase();return t.filter(je=>{var mt;const Qe=(mt=je.deploymentTarget)==null?void 0:mt.runtimeId;return Qe&&Co.has(Qe)?!1:te?`${je.draft.name} ${je.draft.description}`.toLowerCase().includes(te):!0})},[Co,t,He]),Wh=m.useMemo(()=>t.filter(te=>{var Qe;const je=(Qe=te.deploymentTarget)==null?void 0:Qe.runtimeId;return!je||!Co.has(je)}).length,[Co,t]),Gh=m.useMemo(()=>{const te=He.trim().toLowerCase();return te?oo.filter(je=>je.name.toLowerCase().includes(te)):oo},[oo,He]),ce=e.find(te=>te.id===I),li=t.find(te=>te.id===K),ci=h?f.find(te=>te.id===h):void 0,Sa=ce!=null&&ce.runtimeId?yc.get(ce.runtimeId):void 0,Hn=y?on:I&&r===I?i:null,ji=(Hn==null?void 0:Hn.appName)||(ce==null?void 0:ce.runtimeApp)||(ce==null?void 0:ce.app)||"",vc=(c&&(ce!=null&&ce.runtimeId)?pte:pte.filter(te=>te!=="usage")).map(te=>({id:te,label:T(`agentWorkspace.sections.${te}`)})),du=JSON.stringify([(ce==null?void 0:ce.runtimeId)??"",(ce==null?void 0:ce.region)??"cn-beijing",ji,oa]),us=(ws==null?void 0:ws.requestKey)===du?ws.value:null,Tl=`${(ce==null?void 0:ce.region)??"cn-beijing"}:${(ce==null?void 0:ce.runtimeId)??""}`,xc=(Se==null?void 0:Se.requestKey)===Tl?Se.value:"",Sr=(ee==null?void 0:ee.requestKey)===Tl?ee:null,Qn=!!((f0=Sr==null?void 0:Sr.apiApps)!=null&&f0.length),za=!!(Sr!=null&&Sr.a2a),rf=((rC=Sr==null?void 0:Sr.apiApps)==null?void 0:rC[0])??ji,Al=(q==null?void 0:q.endpoint)??"",be=P5t(((kc=Sr==null?void 0:Sr.a2a)==null?void 0:kc.endpoint)??"",Al),Je=(ce==null?void 0:ce.runtimeApp)||"",Ct=JSON.stringify([(ce==null?void 0:ce.runtimeId)??"",(ce==null?void 0:ce.region)??"",(ce==null?void 0:ce.currentVersion)??null,Je]),_n=l&&(ce!=null&&ce.runtimeId)&&ce.region&&et===0?C4({runtimeId:ce.runtimeId,region:ce.region,appName:Je,currentVersion:ce.currentVersion}):null,It=(Te==null?void 0:Te.requestKey)===Ct?Te.value:_n,fn=It!=null&&It.reason?jd(It.reason,P.resolvedLanguage||P.language):"",wn=(It==null?void 0:It.warnings.filter(te=>jd(te,P.resolvedLanguage||P.language)))??[];m.useEffect(()=>{const te=so.current+1;so.current=te,ye(null),Ht("");const je=(ce==null?void 0:ce.runtimeId)??"",Qe=(ce==null?void 0:ce.region)??"";if(!l||!je||!Qe){nt(!1);return}const mt=et===0?C4({runtimeId:je,region:Qe,appName:Je,currentVersion:ce==null?void 0:ce.currentVersion}):null;if(mt){ye({requestKey:Ct,value:mt}),nt(!1);return}const un=new AbortController;let rt,ei=0;const ua=60;nt(!0);const Xn=Ns=>{oR({runtimeId:je,region:Qe,appName:Je,currentVersion:ce==null?void 0:ce.currentVersion,signal:un.signal,force:Ns&&et>0}).then(To=>{var oC,Gm;if(te!==so.current)return;const m1=To.recoveryStatus==="preparing";if(To.runtime.runtimeId!==je||To.runtime.region!==Qe||!m1&&Je&&((oC=To.agent)==null?void 0:oC.appName)!==Je||To.canUpdate&&!((Gm=To.agent)!=null&&Gm.appName)){Ht(T("agentWorkspace.errors.updateCapabilityMismatch"));return}if(ye({requestKey:Ct,value:To}),nt(!1),!!m1){if(ei+=1,ei>=ua){Ht(T("agentWorkspace.errors.updateConfigRestoring"));return}rt=window.setTimeout(()=>Xn(!1),1e3)}}).catch(()=>{te!==so.current||un.signal.aborted||Ht(T("agentWorkspace.errors.checkUpdateCapability"))}).finally(()=>{te===so.current&&!un.signal.aborted&&nt(!1)})};return Xn(!0),()=>{un.abort(),rt!=null&&window.clearTimeout(rt)}},[l,Je,et,ce==null?void 0:ce.currentVersion,ce==null?void 0:ce.region,ce==null?void 0:ce.runtimeId,Ct]);const Y=m.useMemo(()=>{const te=new Map(e.map((Qe,mt)=>[Qe.id,mt])),je=new Map(n.map((Qe,mt)=>[Qe,mt]));return[...td].sort((Qe,mt)=>{const un=Qe.runtimeId?Cl.get(Qe.runtimeId):void 0,rt=mt.runtimeId?Cl.get(mt.runtimeId):void 0,ei=(un==null?void 0:un.status)==="running"?un.startedAt:0,ua=(rt==null?void 0:rt.status)==="running"?rt.startedAt:0;if(ei!==ua)return ua-ei;const Xn=je.get(Qe.id),Ns=je.get(mt.id);return Xn!=null&&Ns!=null?Xn-Ns:Xn!=null?-1:Ns!=null?1:(te.get(Qe.id)??0)-(te.get(mt.id)??0)})},[n,e,td,Cl]),we=(ce==null?void 0:ce.label)||(Hn==null?void 0:Hn.name)||(li==null?void 0:li.draft.name)||(ci==null?void 0:ci.agentName)||((sC=ci==null?void 0:ci.agentDraft)==null?void 0:sC.name)||T("agentWorkspace.noAgentSelected"),Ge=oo.find(te=>te.id===bc),_t=Y.filter(te=>te.canDelete===!0),cn=Y.filter(te=>Ki.has(te.id)&&te.canDelete===!0),Nn=Oa.filter(te=>Rt.has(te.id)),Yi=_t.length+Oa.length,Ri=cn.length+Nn.length,Kn=m.useMemo(()=>{var je;if(ci!=null&&ci.agentDraft)return ci.agentDraft;if(li!=null&&li.draft)return li.draft;const te=(je=ce==null?void 0:ce.region)!=null&&je.startsWith("ap-")?"byteplus":"volcengine";return It!=null&&It.agent&&(It.recoveryStatus==="complete"||It.recoveryStatus==="draft-only")?EB(It.agent,te,It.runtime.configuredEnvKeys):F5t(Hn,ji||(ce==null?void 0:ce.label)||"agent",te)},[Hn,ji,ce==null?void 0:ce.label,ce==null?void 0:ce.region,li==null?void 0:li.draft,ci==null?void 0:ci.agentDraft,It]),zn=((Yh=Hn==null?void 0:Hn.draft)==null?void 0:Yh.harnessSidecar)??Mst(q==null?void 0:q.envs),ds=zn?Ux.filter(te=>zn.componentOverrides[te]):[],$n=li?a?"":T("agentWorkspace.errors.noCreatePermission"):l?ce!=null&&ce.runtimeId?ce.region?Ve?T("agentWorkspace.errors.checkingUpdateConfig"):ke||(It?It.recoveryStatus!=="complete"&&It.recoveryStatus!=="draft-only"?fn||T("agentWorkspace.errors.originalConfigUnavailable"):It.canUpdate?(aC=It.agent)!=null&&aC.appName?"":T("agentWorkspace.errors.agentInfoMissing"):fn||T("agentWorkspace.errors.updateUnsupported"):T("agentWorkspace.errors.updateCapabilityPending")):T("agentWorkspace.errors.runtimeRegionMissing"):T("agentWorkspace.errors.cloudOnlyUpdate"):T("agentWorkspace.errors.noManagePermission"),ca="aw-update-disabled-reason",ut=m.useMemo(()=>{if(Hn)return Hn.tools;const te=(Kn.builtinTools??[]).map(je=>{var Qe;return((Qe=Bx.find(mt=>mt.id===je))==null?void 0:Qe.label)??je});return Array.from(new Set([...Kn.tools,...te,...(Kn.customTools??[]).map(je=>je.name),...(Kn.mcpTools??[]).map(je=>je.name)].filter(Boolean)))},[Kn,Hn]),On=m.useMemo(()=>Hn?Hn.skillsPreviewSupported?Hn.skills.map(te=>te.name):null:Array.from(new Set([...(Kn.selectedSkills??[]).map(te=>te.name),...Kn.skills].filter(Boolean))),[Kn,Hn]),Ut=m.useMemo(()=>{if(ci)return ci;if(li){const te=f.filter(je=>je.draftId===li.id).sort((je,Qe)=>Qe.startedAt-je.startedAt)[0];return te||f.filter(je=>{var Qe,mt;return((Qe=je.agentDraft)==null?void 0:Qe.name)===li.draft.name||je.agentName===li.draft.name||!!((mt=li.deploymentTarget)!=null&&mt.runtimeId)&&je.runtimeId===li.deploymentTarget.runtimeId}).sort((je,Qe)=>Qe.startedAt-je.startedAt)[0]}if(ce)return f.filter(te=>!!ce.runtimeId&&te.runtimeId===ce.runtimeId||te.agentName===ce.label).sort((te,je)=>je.startedAt-te.startedAt)[0]},[f,ce,li,ci]),si=!!(h&&Ut&&Ut.id===h),fs=!!(Ut&&(Ut.status!=="success"||si)),or=(Ut==null?void 0:Ut.status)==="running",hs=Ut!=null&&Ut.draftId?t.find(te=>te.id===Ut.draftId)??(Ut.agentDraft?{id:Ut.draftId,draft:Ut.agentDraft,updatedAt:Ut.startedAt}:void 0):void 0,wc=m.useMemo(()=>q5t(Kn),[Kn]),Oc=(ce==null?void 0:ce.currentVersion)??(q==null?void 0:q.currentVersion)??null,Kh=Oc??(ci==null?void 0:ci.startedAt)??"unknown",Ko=Hn?`runtime:${(ce==null?void 0:ce.runtimeId)??Hn.name}:v${Kh}:${wc}`:`draft:${(ci==null?void 0:ci.id)??(li==null?void 0:li.id)??(ce==null?void 0:ce.id)??we}:${wc}`;m.useEffect(()=>{M==="usage"&&!c&&U("basic")},[c,M]),m.useEffect(()=>{if(!h)return;const te=f.find(Qe=>Qe.id===h),je=te!=null&&te.runtimeId?Co.get(te.runtimeId):void 0;if(je){Q(""),H(je.id),U("basic");return}H(""),Q(""),U("basic")},[Co,f,h]),m.useEffect(()=>{if(!p){cs.current="";return}const te=`${p}:${g}:${b}:${c}`;cs.current!==te&&e.some(je=>je.id===p)&&(cs.current=te,Q(""),H(p),U(g==="usage"&&!c?"basic":g),g==="evaluations"&&(Dt(b),Xt("")))},[e,c,p,g,b]),m.useEffect(()=>{for(const te of Y.slice(0,8)){if(!te.runtimeId)continue;const je=te.region??"cn-beijing";iye(te.runtimeId,je),n0e(te.runtimeId,je,te.runtimeApp??"")}},[Y]),m.useEffect(()=>{let te=!1;const je=(ce==null?void 0:ce.runtimeId)??"",Qe=(ce==null?void 0:ce.region)??"cn-beijing",mt=(ce==null?void 0:ce.runtimeApp)??"",un=je?t0e(je,Qe,mt):null;if(Yt(un),gt(""),kt(!1),Pt(!!un||!y||!je),!(!y||!je))return XF(je,Qe,mt,{force:!0}).then(rt=>{te||Yt(rt)}).catch(rt=>{!te&&!un&&Yt(null),te||(kt(rt instanceof Ds&&rt.unsupported),gt(T("agentWorkspace.errors.loadAgentInfo")))}).finally(()=>{te||Pt(!0)}),()=>{te=!0}},[y,et,ce==null?void 0:ce.currentVersion,ce==null?void 0:ce.region,ce==null?void 0:ce.runtimeApp,ce==null?void 0:ce.runtimeId]),m.useEffect(()=>{let te=!1;const je=(ce==null?void 0:ce.runtimeId)??"",Qe=(ce==null?void 0:ce.region)??"cn-beijing";if(Vs([]),ls(""),M!=="optimizations"||!je){ra(!1);return}if(y&&!ji){ra(!xt);return}return ra(!0),Hbe({runtimeId:je,region:Qe,appName:ji}).then(mt=>{te||Vs(mt.groups)}).catch(()=>{te||ls(T("agentWorkspace.errors.loadOptimizations"))}).finally(()=>{te||ra(!1)}),()=>{te=!0}},[xt,y,va,M,ji,ce==null?void 0:ce.region,ce==null?void 0:ce.runtimeId]),m.useEffect(()=>{Qa(1)},[ce==null?void 0:ce.runtimeId,ji]),m.useEffect(()=>{const te=Go.current+1;Go.current=te;const je=(ce==null?void 0:ce.runtimeId)??"",Qe=(ce==null?void 0:ce.region)??"cn-beijing",mt=ji;if(xa(""),M!=="usage"||!je){Ni(!1);return}if(!mt){Ni(y&&!xt);return}const un=new AbortController;return Ni(!0),V0e({runtimeId:je,region:Qe,appName:mt,page:oa,pageSize:R5t,signal:un.signal}).then(rt=>{if(te===Go.current){if(rt.runtimeId!==je||rt.appName!==mt||rt.page!==oa){xa(T("agentWorkspace.errors.usageMismatch"));return}Ua({requestKey:du,value:rt})}}).catch(()=>{te!==Go.current||un.signal.aborted||xa(T("agentWorkspace.errors.loadUsage"))}).finally(()=>{te===Go.current&&Ni(!1)}),()=>{un.abort()}},[oa,Xi,du,xt,y,M,ji,ce==null?void 0:ce.region,ce==null?void 0:ce.runtimeId]),m.useEffect(()=>{ao.current+=1,lt(null),Le(!1),qe(!1),ze(""),Oe("api-server")},[Tl,M]);function fu(){ao.current+=1,lt(null),Le(!1),qe(!1),ze("")}function sf(te){te!==ue&&(fu(),Oe(te))}async function af(){if($e){fu();return}const te=(ce==null?void 0:ce.runtimeId)??"",je=(ce==null?void 0:ce.region)??"cn-beijing";if(!te)return;const Qe=ao.current+1;ao.current=Qe,qe(!0),ze("");try{const mt=await eye(te,je);if(Qe!==ao.current)return;lt({requestKey:Tl,value:mt}),Le(!0)}catch(mt){if(Qe!==ao.current)return;lt(null),Le(!1),ze(mt instanceof Error?mt.message:T("agentWorkspace.errors.loadApiKey"))}finally{Qe===ao.current&&qe(!1)}}m.useEffect(()=>{let te=!1;const je=(ce==null?void 0:ce.runtimeId)??"",Qe=(ce==null?void 0:ce.region)??"cn-beijing",mt=je?nye(je,Qe):null;if(B(mt),Ye(""),!!je)return i7(je,Qe,{force:!0}).then(un=>{te||B(un)}).catch(()=>{!te&&!mt&&B(null),te||Ye(T("agentWorkspace.errors.loadRuntimeDetails"))}),()=>{te=!0}},[et,ce==null?void 0:ce.currentVersion,ce==null?void 0:ce.region,ce==null?void 0:ce.runtimeId]),m.useEffect(()=>{let te=!1;const je=(ce==null?void 0:ce.runtimeId)??"";if(Ze(""),M!=="versions"||!je){he(!1),je||De(null);return}return he(!0),nA(je).then(Qe=>{te||De(Qe)}).catch(()=>{te||(De(null),Ze(T("agentWorkspace.errors.loadGithubVersions")))}).finally(()=>{te||he(!1)}),()=>{te=!0}},[M,ce==null?void 0:ce.currentVersion,ce==null?void 0:ce.runtimeId]),m.useEffect(()=>{let te=!1;const je=(ce==null?void 0:ce.runtimeId)??"",Qe=(ce==null?void 0:ce.region)??"cn-beijing",mt=`${Qe}:${je}`;if(W(""),M!=="integrations"||!je){re(!1),je||le(null);return}re(!0);const un=Fv(je,Qe,{retryProbe:!0}).catch(rt=>{if(rt instanceof Ds&&rt.unsupported)return null;throw rt});return Promise.all([un,J0e(je,Qe,{retryProbe:!0})]).then(([rt,ei])=>{te||le({requestKey:mt,apiApps:rt,a2a:ei})}).catch(()=>{te||(le(null),W(T("agentWorkspace.errors.probeIntegration")))}).finally(()=>{te||re(!1)}),()=>{te=!0}},[X,M,ce==null?void 0:ce.currentVersion,ce==null?void 0:ce.region,ce==null?void 0:ce.runtimeId]),m.useEffect(()=>{let te=!1;const je=(ce==null?void 0:ce.runtimeId)??"",Qe=(ce==null?void 0:ce.region)??"cn-beijing",mt=je&&ji?qbe({runtimeId:je,region:Qe,appName:ji,pageSize:100}):null;if(bn(mt?vte(mt,T):[]),ri((mt==null?void 0:mt.sets)??[]),_r(""),os((mt==null?void 0:mt.unsupportedMessage)??""),M!=="evaluations"||!je){as(!1);return}if(y&&!ji){as(!xt);return}return as(!mt),rR({runtimeId:je,region:Qe,appName:ji,pageSize:100},{force:!0}).then(un=>{te||(ri(un.sets),bn(vte(un,T)),os(un.unsupportedMessage??""))}).catch(()=>{te||(_r(T("agentWorkspace.errors.loadEvaluations")),os(""))}).finally(()=>{te||as(!1)}),()=>{te=!0}},[xt,y,ia,M,ji,Hn==null?void 0:Hn.appName,ce==null?void 0:ce.region,ce==null?void 0:ce.runtimeId,T]);async function Sc(te){const je=(ce==null?void 0:ce.runtimeId)??"",Qe=te.commitSha??"";if(!(!je||!Qe||at)){St(Qe),Ze("");try{await D0e({runtimeId:je,targetCommitSha:Qe});const mt=await nA(je);De(mt)}catch(mt){Ze(mt instanceof Error?mt.message:T("agentWorkspace.errors.rollbackVersion"))}finally{St("")}}}m.useEffect(()=>{const te=new Set(mi.map(je=>je.id));en(je=>{const Qe=new Set([...je].filter(mt=>te.has(mt)));return Qe.size===je.size?je:Qe}),$r(je=>{const Qe=new Set([...je].filter(mt=>te.has(mt)));return Qe.size===je.size?je:Qe}),Si&&!te.has(Si)&&la("")},[mi,Si]),m.useEffect(()=>{Xe(!1),en(new Set),$r(new Set),_s(""),la("")},[ce==null?void 0:ce.runtimeId]),m.useEffect(()=>{const te=new Set(Y.filter(je=>je.canDelete===!0).map(je=>je.id));Fe(je=>{const Qe=new Set([...je].filter(mt=>te.has(mt)));return Qe.size===je.size?je:Qe})},[Y]),m.useEffect(()=>{const te=new Set(Oa.map(je=>je.id));pn(je=>{const Qe=new Set([...je].filter(mt=>te.has(mt)));return Qe.size===je.size?je:Qe})},[Oa]);const Xo=m.useMemo(()=>!v||!(ce!=null&&ce.runtimeId)||v.runtimeId!==ce.runtimeId||ji&&v.agentName&&v.agentName!==ji?null:{...v,tag:T(v.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},[v,ce==null?void 0:ce.runtimeId,ji,T]),lo=m.useMemo(()=>_5t(T),[T]),ka=m.useMemo(()=>ce!=null&&ce.runtimeId?Xo?[Xo,...mi.filter(te=>te.id!==Xo.id&&(!te.messageId||te.messageId!==Xo.messageId))]:mi:lo,[lo,mi,Xo,ce==null?void 0:ce.runtimeId]),_l=ka.filter(te=>{if(te.kind!==yt||(te.source==="auto"?"auto":"user")!==dn)return!1;const Qe=ln.trim().toLowerCase();return Qe?[te.input,te.output,te.referenceOutput,te.comment,te.tag??"",te.sessionId,te.messageId,te.userId,te.evaluationSetName].join(" ").toLowerCase().includes(Qe):!0}),of=_l.filter(te=>Gt.has(te.id)),qm=!!(ce!=null&&ce.runtimeId),lf=te=>{Dt(te),Xt(""),_s("");const je=ka.find(Qe=>Qe.kind===te);la((je==null?void 0:je.id)??""),window.setTimeout(()=>{var Qe;(Qe=Vi.current)==null||Qe.scrollIntoView({behavior:"smooth",block:"start"})},0)},Fr=te=>{_s(""),en(je=>{const Qe=new Set(je);return Qe.has(te.id)?Qe.delete(te.id):Qe.add(te.id),Qe})},cf=()=>{_s(""),en(new Set(_l.map(te=>te.id)))},JI=()=>{_s(""),en(new Set),Xe(!1)},Br=te=>{$r(je=>{const Qe=new Set(je);return Qe.has(te)?Qe.delete(te):Qe.add(te),Qe})},l0=te=>{la(te.id),_s(""),!(!te.sessionId||!te.messageId)&&(N==null||N(te))},YE=async te=>{if(!(ce!=null&&ce.runtimeId)||!ji||In||te.length===0)return;const je=te.length===1?T("agentWorkspace.deleteOneCaseConfirm"):T("agentWorkspace.deleteCasesConfirm",{count:te.length});if(!window.confirm(je))return;const Qe=te.map(un=>un.id),mt=new Set(Qe);mr(!0),_s("");try{await Kbe({runtimeId:ce.runtimeId,region:ce.region??"cn-beijing",appName:ji,itemIds:Qe});const un=new Map;for(const rt of te)un.set(rt.kind,(un.get(rt.kind)??0)+1);bn(rt=>rt.filter(ei=>!mt.has(ei.id))),ri(rt=>rt.map(ei=>({...ei,itemCount:Math.max(0,ei.itemCount-(un.get(ei.kind)??0))}))),en(rt=>new Set([...rt].filter(ei=>!mt.has(ei)))),$r(rt=>new Set([...rt].filter(ei=>!mt.has(ei)))),Si&&mt.has(Si)&&la(""),te.length>1&&Xe(!1),_==null||_(te)}catch(un){_s(un instanceof Error?un.message:String(un))}finally{mr(!1)}},h1=te=>{ed(je=>je.map(Qe=>Qe.id===te.id?te:Qe))},ZE=()=>{const te=new Set(e.map(mt=>mt.id)),je=n.filter(mt=>te.has(mt)),Qe=new Set(je);return[...je,...e.filter(mt=>!Qe.has(mt.id)).map(mt=>mt.id)]},JE=(te,je,Qe)=>{if(!w||te===je)return;const mt=ZE().filter(ei=>ei!==te),un=mt.indexOf(je),rt=un<0?mt.length:Qe==="after"?un+1:un;mt.splice(rt,0,te),w(mt)},eC=(te,je)=>{if(!Ft||Ft===je)return;const Qe=te.currentTarget.getBoundingClientRect();ht(je),We(te.clientY>Qe.top+Qe.height/2?"after":"before")},Wm=(te,je)=>{if(!w)return;const Qe=ZE(),mt=Qe.indexOf(te),un=Math.max(0,Math.min(Qe.length-1,mt+je));mt<0||mt===un||(Qe.splice(mt,1),Qe.splice(un,0,te),w(Qe))},c0=te=>{te.canDelete===!0&&(xn(""),Fe(je=>{const Qe=new Set(je);return Qe.has(te.id)?Qe.delete(te.id):Qe.add(te.id),Qe}))},tC=te=>{xn(""),pn(je=>{const Qe=new Set(je);return Qe.has(te.id)?Qe.delete(te.id):Qe.add(te.id),Qe})},nC=()=>{xn(""),Fe(new Set(_t.map(te=>te.id))),pn(new Set(Oa.map(te=>te.id)))},Mt=()=>{xn(""),Fe(new Set),pn(new Set),vn(!1)},u0=()=>{if(Ri===0||Zt)return;const te=cn.length,je=Nn.length;xn(""),Oi({kind:"selection",title:T(te===1&&je===0?"agentWorkspace.deleteAgentTitle":te===0&&je===1?"myAgents.deleteDraftTitle":"agentWorkspace.deleteSelectedTitle"),description:te===1&&je===0?T("agentWorkspace.deleteAgentDescription",{name:cn[0].label}):te===0&&je===1?T("agentWorkspace.deleteDraftDescription",{name:Nn[0].draft.name||T("agentSelector.unnamedAgent")}):T("agentWorkspace.deleteSelectionDescription",{count:Ri,warning:te>0?T("agentWorkspace.runtimeDeletionWarning",{count:te}):T("agentWorkspace.draftDeletionWarning")}),confirmLabel:T(te===0&&je===1?"myAgents.deleteDraft":"agentWorkspace.deleteSelected"),agents:cn,drafts:Nn})},p1=async()=>{if(!(!oi||Zt)){Jt(!0),xn("");try{if(oi.kind==="selection"){const{agents:te,drafts:je}=oi;if(te.length>0){if(!k)throw new Error(T("agentWorkspace.errors.deleteDeployedUnsupported"));await k(te)}je.length>0&&(S==null||S(je)),Fe(new Set),pn(new Set),vn(!1),te.some(Qe=>Qe.id===I)&&H(""),je.some(Qe=>Qe.id===K)&&Q("")}else if(oi.kind==="agent"){if(!k)throw new Error(T("agentWorkspace.errors.deleteDeployedUnsupported"));await k([oi.agent]),I===oi.agent.id&&H("")}else{if(!S)throw new Error(T("agentWorkspace.errors.deleteDraftUnsupported"));S([oi.draft]),K===oi.draft.id&&Q("")}Oi(null)}catch(te){xn(te instanceof Error?te.message:String(te))}finally{Jt(!1)}}},d0=te=>{!k||te.canDelete!==!0||Zt||(xn(""),Oi({kind:"agent",title:T("agentWorkspace.deleteAgentTitle"),description:T("agentWorkspace.deleteAgentDescription",{name:te.label}),confirmLabel:T("agentWorkspace.deleteAgent"),agent:te}))},Wi=te=>{if(!S||Zt)return;const je=te.draft.name||T("agentSelector.unnamedAgent");xn(""),Oi({kind:"draft",title:T("myAgents.deleteDraftTitle"),description:T("agentWorkspace.deleteDraftDescription",{name:je}),confirmLabel:T("myAgents.deleteDraft"),draft:te})},Xh=()=>{const te=`eval-${Date.now()}`,je={id:te,name:T("agentWorkspace.newEvaluationGroupName",{count:oo.length+1}),agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量"],concurrency:"4",history:[]};ed(Qe=>[je,...Qe]),uu(te)},iC=te=>{h1({...te,history:[{id:`run-${Date.now()}`,createdAt:T("agentWorkspace.evaluationDefaults.justNow"),score:86+te.history.length%7,status:"completed"},...te.history]})};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:`aw-root${y?" is-detail-only":""}`,children:[o.jsxs("nav",{className:"aw-view-tabs","aria-label":T("agentWorkspace.workspace"),children:[o.jsx("button",{type:"button",className:R==="library"?"is-active":"","aria-pressed":R==="library",onClick:()=>{L("library"),Ke("")},children:T("agentWorkspace.library")}),o.jsx("button",{type:"button",className:R==="evaluation"?"is-active":"","aria-pressed":R==="evaluation",onClick:()=>{L("evaluation"),Ke("")},children:T("agentWorkspace.evaluation")})]}),o.jsxs("div",{className:"aw-workspace-frame",children:[o.jsxs("div",{className:"aw-workspace","aria-hidden":R==="evaluation"||void 0,ref:te=>{te==null||te.toggleAttribute("inert",R==="evaluation")},children:[o.jsxs("aside",{className:"aw-sidebar","aria-label":T(R==="library"?"agentWorkspace.agentList":"agentWorkspace.evaluationGroupList"),children:[o.jsxs("label",{className:"aw-search",children:[o.jsx(P_,{"aria-hidden":!0}),o.jsx("input",{value:He,onChange:te=>Ke(te.currentTarget.value),placeholder:T(R==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups"),"aria-label":T(R==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups")})]}),o.jsxs("button",{type:"button",className:"aw-create-card",onClick:R==="library"?j:Xh,disabled:R==="library"&&!a,children:[o.jsx($o,{"aria-hidden":!0}),o.jsx("span",{children:T(R==="library"?"agentWorkspace.newAgent":"agentWorkspace.newEvaluationGroup")})]}),R==="library"&&(k||S)&&o.jsx("div",{className:`aw-selection-toolbar${vt?" is-active":""}`,children:vt?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-selection-count",children:T("agentWorkspace.selectedCount",{count:Ri})}),o.jsx("button",{type:"button",onClick:nC,disabled:Yi===0||Zt,children:T("agentWorkspace.selectAll")}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void u0(),disabled:Ri===0||Zt,children:T(Zt?"common.deleting":"agentWorkspace.deleteSelected")}),o.jsx("button",{type:"button",onClick:Mt,disabled:Zt,children:T("common.cancel")})]}):o.jsx("button",{type:"button",onClick:()=>{xn(""),vn(!0)},disabled:Yi===0,children:T("common.select")})}),R==="library"&&Un&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:Un}),o.jsx("div",{className:"aw-agent-list",children:R==="evaluation"?Gh.length===0?o.jsx("div",{className:"aw-list-empty",children:T("agentWorkspace.noMatchingEvaluationGroups")}):Gh.map(te=>o.jsxs("button",{type:"button",className:`aw-agent-item${te.id===bc?" is-active":""}`,onClick:()=>uu(te.id),children:[o.jsxs("span",{className:"aw-agent-copy aw-eval-group-copy",children:[o.jsx("strong",{children:Ww(te.name,T)}),o.jsx("small",{children:T("agentWorkspace.groupStats",{agents:te.agentIds.length,runs:te.history.length})})]}),o.jsx(bO,{"aria-hidden":!0})]},te.id)):u&&Y.length===0&&Oa.length===0?o.jsx("div",{className:"aw-list-empty",children:T("agentWorkspace.loadingCloudAgents")}):d&&Y.length===0&&Oa.length===0?o.jsxs("div",{className:"aw-list-empty aw-list-error",children:[o.jsx("span",{children:d}),O&&o.jsx("button",{type:"button",onClick:O,children:T("common.retry")})]}):Y.length===0&&Oa.length===0?o.jsx("div",{className:"aw-list-empty",children:T("myAgents.noMatchingAgents")}):o.jsxs(o.Fragment,{children:[Oa.map(te=>{const Qe=f.filter(un=>un.draftId===te.id).sort((un,rt)=>rt.startedAt-un.startedAt)[0]??f.filter(un=>{var rt,ei;return((rt=un.agentDraft)==null?void 0:rt.name)===te.draft.name||un.agentName===te.draft.name||!!((ei=te.deploymentTarget)!=null&&ei.runtimeId)&&un.runtimeId===te.deploymentTarget.runtimeId}).sort((un,rt)=>rt.startedAt-un.startedAt)[0],mt=Rt.has(te.id);return o.jsxs("button",{type:"button",className:["aw-agent-item",vt?"is-selecting":"",mt?"is-selected-for-delete":"",te.id===K?"is-active":""].filter(Boolean).join(" "),"aria-pressed":vt?mt:void 0,onClick:()=>{if(vt){tC(te);return}H(""),Q(te.id),U("basic")},children:[vt&&o.jsx("span",{className:`aw-select-marker${mt?" 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:te.draft.name||T("agentSelector.unnamedAgent")}),o.jsx("span",{className:`aw-draft-badge${(Qe==null?void 0:Qe.status)==="running"?" is-deploying":""}`,children:(Qe==null?void 0:Qe.status)==="running"?T("myAgents.deploying"):T("myAgents.draft")})]}),o.jsx("small",{children:te.deploymentTarget?T("agentWorkspace.updatePending"):T("agentWorkspace.notPublished")})]}),o.jsx(bO,{"aria-hidden":!0})]},te.id)}),Y.map(te=>{const je=te.runtimeId?Cl.get(te.runtimeId):void 0,Qe=te.runtimeId?yc.get(te.runtimeId):void 0,mt=Ki.has(te.id),un=te.canDelete===!0,rt=(je==null?void 0:je.status)==="running"?{label:T("myAgents.deploying"),className:" is-deploying"}:(je==null?void 0:je.status)==="error"?{label:T("agentWorkspace.failed"),className:" is-error"}:(je==null?void 0:je.status)==="cancelled"?{label:T("agentWorkspace.cancelled"),className:" is-muted"}:Qe?{label:T("agentWorkspace.updatePending"),className:""}:null,ei=(je==null?void 0:je.status)==="running"?T("agentWorkspace.updatingDeployment"):Qe?T("agentWorkspace.updatePending"):te.remote?te.host||T("agentWorkspace.remoteAgent"):T("agentWorkspace.localAgent"),ua=["aw-agent-item","aw-agent-item--sortable",te.id===I?"is-active":"",vt?"is-selecting":"",mt?"is-selected-for-delete":"",vt&&!un?"is-selection-disabled":"",te.id===Ft?"is-dragging":"",te.id===it&&te.id!==Ft?`is-drop-target is-drop-${pe}`:""].filter(Boolean).join(" ");return o.jsxs("button",{type:"button",draggable:!!w&&!vt,className:ua,"aria-pressed":vt?mt:void 0,"aria-keyshortcuts":w?"Alt+ArrowUp Alt+ArrowDown":void 0,onDragStart:Xn=>{w&&(wa.current=!0,Ue(te.id),Xn.dataTransfer.effectAllowed="move",Xn.dataTransfer.setData("text/plain",te.id))},onDragEnter:Xn=>{eC(Xn,te.id)},onDragOver:Xn=>{!Ft||Ft===te.id||(Xn.preventDefault(),Xn.dataTransfer.dropEffect="move",eC(Xn,te.id))},onDragLeave:Xn=>{const Ns=Xn.relatedTarget;Ns instanceof Node&&Xn.currentTarget.contains(Ns)||it===te.id&&ht("")},onDrop:Xn=>{Xn.preventDefault();const Ns=Xn.dataTransfer.getData("text/plain")||Ft;JE(Ns,te.id,pe),Ue(""),ht(""),We("before")},onDragEnd:()=>{Ue(""),ht(""),We("before"),window.setTimeout(()=>{wa.current=!1},0)},onKeyDown:Xn=>{Xn.altKey&&(Xn.key==="ArrowUp"?(Xn.preventDefault(),Wm(te.id,-1)):Xn.key==="ArrowDown"&&(Xn.preventDefault(),Wm(te.id,1)))},onClick:Xn=>{if(vt){Xn.preventDefault(),c0(te);return}if(wa.current){Xn.preventDefault(),wa.current=!1;return}Q(""),H(te.id),U("basic"),E(te.id)},children:[vt&&o.jsx("span",{className:`aw-select-marker${mt?" 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:te.label}),te.currentVersion!=null&&o.jsxs("span",{className:"aw-version-badge",children:["v",te.currentVersion]}),rt&&o.jsx("span",{className:`aw-draft-badge${rt.className}`,children:rt.label})]}),o.jsx("small",{children:ei})]}),o.jsx(bO,{"aria-hidden":!0})]},te.id)})]})}),o.jsx("div",{className:"aw-list-count",children:T("agentWorkspace.totalCount",{count:R==="library"?e.length+Wh:oo.length})})]}),R==="evaluation"&&Ge?o.jsx(iLt,{group:Ge,agents:e,cases:ka,onChange:h1,onRun:iC}):R==="evaluation"?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:T("agentWorkspace.noEvaluationGroupSelected")})}):!ce&&!li&&!ci?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:T("agentWorkspace.noAgentSelected")})}):o.jsxs("main",{className:`aw-main${or?" is-deploying":""}${y?" resource-page":""}`,children:[ce&&!Hn&&s&&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:T("agentWorkspace.loadingAgent")}),o.jsx("small",{children:T("agentWorkspace.loadingAgentDescription")})]})]})}),M==="integrations"&&se&&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:T("agentWorkspace.probingIntegration")}),o.jsx("small",{children:T("agentWorkspace.probingIntegrationDescription")})]})]})}),o.jsx(uE,{className:"aw-agent-detail",title:we,description:Kn.description||T(s||y&&!xt?"agentWorkspace.loadingAgentInfo":"common.noDescription"),identitySeed:we,backLabel:T("agentWorkspace.backToAgentList"),onBack:y?x:void 0,meta:o.jsxs(o.Fragment,{children:[Oc!=null&&o.jsxs("span",{className:"aw-agent-meta",children:["v",Oc]}),li&&o.jsx("span",{className:"aw-agent-meta",children:T("myAgents.draft")}),Sa&&o.jsx("span",{className:"aw-agent-meta",children:T("agentWorkspace.updatePending")}),!ce&&!li&&ci&&o.jsx("span",{className:"aw-agent-meta",children:ci.label})]}),actionsClassName:"aw-head-actions",bodyClassName:"aw-agent-detail__body",actions:li||Sa||ce!=null&&ce.canDelete?o.jsxs(o.Fragment,{children:[(li||Sa)&&o.jsxs(zt,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>{const te=li??Sa;te&&Wi(te)},disabled:Zt,"aria-label":T("myAgents.deleteDraft"),title:T("myAgents.deleteDraft"),children:[o.jsx(pm,{"aria-hidden":!0}),o.jsx("span",{children:T("myAgents.deleteDraft")})]}),(ce==null?void 0:ce.canDelete)&&o.jsxs(zt,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>void d0(ce),disabled:Zt,"aria-label":T("agentWorkspace.deleteAgent"),title:T("agentWorkspace.deleteAgent"),children:[o.jsx(pm,{"aria-hidden":!0}),o.jsx("span",{children:T(Zt?"common.deleting":"agentWorkspace.deleteAgent")})]})]}):void 0,sections:vc.map(te=>{var je,Qe,mt,un;return{key:te.id,label:te.label,disabled:or,content:te.id===M?o.jsxs(o.Fragment,{children:[Ut&&fs&&o.jsx("div",{className:`aw-detail-deployment${or?" is-running":""}`,children:o.jsx(Z5t,{task:Ut,onReturnToEdit:hs&&F?()=>F(hs):void 0})}),o.jsxs("div",{className:"aw-content",children:[M==="basic"&&o.jsxs("div",{className:"aw-basic-stack",children:[Pe&&o.jsx(Eb,{className:"aw-detail-fetch-alert",color:"warning",variant:"soft",title:T("agentWorkspace.partialInfoUnavailable"),description:T("agentWorkspace.upgradeRuntimeForDetails")}),(ct&&!Pe||Me)&&o.jsx(Eb,{className:"aw-detail-fetch-alert",color:"danger",variant:"soft",title:T("agentWorkspace.detailLoadFailed"),description:T("agentWorkspace.detailLoadFailedDescription"),actions:o.jsx(zt,{type:"button",color:"danger",variant:"soft",size:"sm",pill:!1,onClick:()=>xe(rt=>rt+1),children:T("common.retry")})}),ce&&It&&!It.canUpdate&&o.jsxs("div",{className:"aw-update-recovery-notice",role:It.recoveryStatus==="preparing"?"status":"alert",children:[o.jsx("strong",{children:It.recoveryStatus==="preparing"?T("agentWorkspace.restoringUpdateConfig"):T("agentWorkspace.updateConfigUnavailable")}),fn&&o.jsx("span",{children:fn}),wn.map(rt=>o.jsx("span",{children:rt},rt))]}),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:T("agentWorkspace.deploymentConfig")}),o.jsx("p",{children:T("agentWorkspace.deploymentConfigDescription")})]})}),o.jsxs("dl",{className:"aw-readonly-config",children:[o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.runtimeStatus")}),o.jsxs("dd",{className:(q==null?void 0:q.status.toLowerCase())==="ready"?"is-ready":void 0,children:[(q==null?void 0:q.status.toLowerCase())==="ready"&&o.jsx("span",{className:"aw-status-dot"}),(q==null?void 0:q.status)||T("agentWorkspace.loading")]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.deploymentRegion")}),o.jsx("dd",{children:(q==null?void 0:q.region)||(ce==null?void 0:ce.region)||(Ut==null?void 0:Ut.region)||T("agentWorkspace.notAvailable")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.networkAccess")}),o.jsx("dd",{children:q!=null&&q.networkTypes.length?q.networkTypes.join(" / "):T("agentWorkspace.notAvailable")})]})]})]}),o.jsxs("section",{className:"aw-canvas-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:T("agentWorkspace.executionFlow")})}),o.jsx("div",{className:"aw-canvas",children:o.jsx(LS,{draft:Kn,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},Ko)})]}),o.jsxs("section",{className:"aw-details-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:T("agentWorkspace.details")})}),o.jsxs("dl",{className:"aw-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:T("agentSelector.model")}),o.jsx("dd",{children:kB(Hn==null?void 0:Hn.model)||Kn.modelName||T("agentWorkspace.notAvailable")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.agentCountLabel")}),o.jsx("dd",{children:Hn!=null&&Hn.graph?mje(Hn.graph):gje(Kn)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentSelector.tools")}),o.jsx("dd",{className:"aw-fact-badges",children:ut.length?ut.map(rt=>o.jsx("span",{children:rt},rt)):T("agentWorkspace.none")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentSelector.skills")}),o.jsx("dd",{className:"aw-fact-badges",children:On===null?T("agentSelector.previewUnsupported"):On.length?On.map(rt=>o.jsx("span",{children:rt},rt)):T("agentWorkspace.none")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("systemInfo.currentVersion")}),o.jsx("dd",{children:Oc!=null?`v${Oc}`:T("agentWorkspace.notAvailable")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentSelector.status")}),o.jsx("dd",{children:li?T("myAgents.draft"):(Ut==null?void 0:Ut.status)==="error"?T("agentWorkspace.deploymentFailed"):(Ut==null?void 0:Ut.status)==="cancelled"?T("agentWorkspace.cancelled"):Sa?T("agentWorkspace.updatePending"):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-status-dot"}),T("skillCenter.status.available")]})})]})]})]}),o.jsxs("section",{className:"aw-sidecar-panel aw-settings-card","aria-label":T("agentWorkspace.selectedOptimizations"),children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:T("agentWorkspace.selectedOptimizations")}),o.jsx("p",{children:T("agentWorkspace.selectedOptimizationsDescription")})]})}),o.jsxs("dl",{className:"aw-readonly-config",children:[o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.configurationStatus")}),o.jsx("dd",{className:zn!=null&&zn.enabled?"is-ready":void 0,children:zn?zn.enabled?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-status-dot"}),T("skillCenter.status.enabled")]}):T("skillCenter.status.inactive"):T("agentWorkspace.notRecorded")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.optimizationProfile")}),o.jsx("dd",{children:zn?Pst(zn.profile):T("agentWorkspace.legacyConfigMissing")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.selectedOptimizations")}),o.jsx("dd",{className:"aw-fact-badges",children:zn?ds.length?ds.map(rt=>o.jsx("span",{children:mA(rt)},rt)):T("agentWorkspace.noneSelected"):T("agentWorkspace.legacyConfigMissing")})]})]})]})]}),M==="usage"&&(ce==null?void 0:ce.runtimeId)&&o.jsxs("section",{className:"aw-usage","aria-busy":Jn,children:[o.jsx("div",{className:"aw-usage-intro",children:o.jsx("h3",{children:T("agentWorkspace.usageOverview")})}),Jn&&!us&&o.jsx("div",{className:"aw-usage-state",role:"status","aria-live":"polite",children:o.jsx(An,{as:"span",children:T("agentWorkspace.loadingUsage")})}),ko&&o.jsxs("div",{className:"aw-usage-state is-error",role:"alert",children:[o.jsx("span",{children:ko}),o.jsx("button",{type:"button",onClick:()=>Eo(rt=>rt+1),children:T("common.retry")})]}),!Jn&&!ko&&!us&&!ji&&o.jsx("div",{className:"aw-usage-state",children:T("agentWorkspace.usageUnavailable")}),us&&o.jsxs(o.Fragment,{children:[o.jsxs("dl",{className:"aw-usage-summary","aria-label":T("agentWorkspace.usageSummary"),children:[o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.totalCalls")}),o.jsx("dd",{children:us.totalInvocations.toLocaleString(P.resolvedLanguage??P.language)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.userCount")}),o.jsx("dd",{children:us.totalUsers.toLocaleString(P.resolvedLanguage??P.language)})]})]}),o.jsxs("div",{className:"aw-usage-users-head",children:[o.jsx("h3",{children:T("agentWorkspace.userDetails")}),Jn&&o.jsx(An,{as:"span",role:"status","aria-live":"polite",children:T("agentWorkspace.refreshing")})]}),us.users.length===0?o.jsx("div",{className:"aw-usage-state",children:T("agentWorkspace.noUsage")}):o.jsx("div",{className:"aw-usage-table-wrap",children:o.jsxs("table",{className:"aw-usage-table",children:[o.jsx("caption",{children:T("agentWorkspace.usageUserList")}),o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"col",children:T("agentWorkspace.user")}),o.jsx("th",{scope:"col",children:T("agentWorkspace.callCount")}),o.jsx("th",{scope:"col",children:T("agentWorkspace.lastUsed")})]})}),o.jsx("tbody",{children:us.users.map(rt=>o.jsxs("tr",{children:[o.jsxs("td",{children:[o.jsx("strong",{children:rt.displayName||rt.userId||T("agentWorkspace.unknownUser")}),rt.displayName&&rt.userId&&o.jsx("small",{title:rt.userId,children:rt.userId})]}),o.jsx("td",{children:rt.invocationCount.toLocaleString(P.resolvedLanguage??P.language)}),o.jsx("td",{children:o.jsx("time",{dateTime:rt.lastUsedAt,children:I5t(rt.lastUsedAt,P.resolvedLanguage??P.language,T)})})]},rt.userId))})]})}),us.totalPages>1&&o.jsxs("nav",{className:"aw-usage-pagination","aria-label":T("agentWorkspace.usagePagination"),children:[o.jsx("button",{type:"button",disabled:Jn||us.page<=1,onClick:()=>Qa(rt=>Math.max(1,rt-1)),children:T("common.previousPage")}),o.jsx("span",{"aria-live":"polite",children:T("agentWorkspace.pageOf",{page:us.page,total:us.totalPages})}),o.jsx("button",{type:"button",disabled:Jn||us.page>=us.totalPages,onClick:()=>Qa(rt=>rt+1),children:T("common.nextPage")})]})]})]}),M==="versions"&&o.jsxs("section",{className:"aw-version-stack",children:[o.jsxs("div",{className:"aw-integration-intro",children:[o.jsx("h3",{children:T("agentWorkspace.githubVersions")}),o.jsx("p",{children:(je=Ee==null?void 0:Ee.cicd)!=null&&je.enabled?T("agentWorkspace.githubVersionsDescription"):T("agentWorkspace.currentVersionOnly")})]}),J&&o.jsx("div",{className:"aw-case-empty",children:T("agentWorkspace.loadingVersions")}),Ce&&o.jsxs("div",{className:"aw-integration-error",role:"alert",children:[o.jsx("span",{children:Ce}),(ce==null?void 0:ce.runtimeId)&&o.jsx("button",{type:"button",onClick:()=>void nA(ce.runtimeId??"").then(De),children:T("common.retry")})]}),!J&&!Ce&&o.jsxs("div",{className:"aw-version-list",children:[(Ee==null?void 0:Ee.githubSyncError)&&o.jsx("div",{className:"aw-integration-error",role:"alert",children:o.jsx("span",{children:Ee.githubSyncError})}),(Ee==null?void 0:Ee.latestSourceRuntimeStatus)&&Ee.latestSourceRuntimeStatus!=="published"&&((Qe=Ee.versions[0])==null?void 0:Qe.commitSha)&&Ee.versions[0].commitSha!==Ee.currentCommitSha&&o.jsx("div",{className:"aw-integration-notice",role:"status",children:o.jsxs("span",{children:[T("agentWorkspace.sourceMergedRuntimeStill"),gte(Ee.latestSourceRuntimeStatus,T),T("agentWorkspace.currentProductionVersionHint")]})}),Ee!=null&&Ee.versions.length?Ee.versions.map(rt=>{var To;const ei=rt.commitSha??"",ua=rt.runtimeStatus??rt.status,Xn=rt.changeType==="rollback",Ns=!!((To=Ee.cicd)!=null&&To.enabled)&&!!ei&&!Xn&&ei!==Ee.currentCommitSha;return o.jsxs("article",{className:"aw-version-row",children:[o.jsxs("div",{children:[o.jsx("strong",{children:D5t(rt,T)}),o.jsx("small",{children:rt.createdAt||T("agentWorkspace.noTime")})]}),o.jsxs("div",{children:[o.jsx("span",{children:T("agentWorkspace.prLink")}),rt.pullRequestUrl?o.jsx("a",{href:rt.pullRequestUrl,target:"_blank",rel:"noopener noreferrer",children:T("agentWorkspace.viewPr")}):o.jsx("em",{children:T("agentWorkspace.noPr")})]}),o.jsxs("div",{children:[o.jsx("span",{children:T("agentWorkspace.author")}),o.jsx("em",{children:rt.author||"Studio"})]}),o.jsxs("div",{children:[o.jsx("span",{children:T("agentWorkspace.publishStatus")}),o.jsx("em",{children:gte(ua,T)})]}),o.jsxs("div",{className:"aw-version-actions",children:[o.jsx("button",{type:"button",disabled:!Ns||at===ei,onClick:()=>void Sc(rt),children:T(at===ei?"agentWorkspace.rollingBack":"agentWorkspace.rollbackToVersion")}),rt.workflowRunUrl&&o.jsx("a",{href:rt.workflowRunUrl,target:"_blank",rel:"noopener noreferrer",children:T("agentWorkspace.viewRelease")})]})]},`${rt.version}-${ei||rt.createdAt}`)}):o.jsxs("article",{className:"aw-version-row",children:[o.jsxs("div",{children:[o.jsx("strong",{children:Oc!=null?`v${Oc}`:T("agentWorkspace.noVersion")}),o.jsx("small",{children:(q==null?void 0:q.updatedAt)||T("agentWorkspace.noTime")})]}),o.jsx("p",{children:T("agentWorkspace.currentVersionOnly")})]})]})]}),M==="integrations"&&o.jsxs("div",{className:"aw-integration-stack",children:[o.jsxs("div",{className:"aw-integration-intro",children:[o.jsx("h3",{children:T("agentWorkspace.integrationMethods")}),o.jsx("p",{children:T("agentWorkspace.integrationDescription")})]}),ge&&o.jsxs("div",{className:"aw-integration-error",role:"alert",children:[o.jsx("span",{children:ge}),o.jsx("button",{type:"button",onClick:()=>ae(rt=>rt+1),children:T("common.retry")})]}),!ge&&o.jsxs("div",{className:"aw-integration-body",children:[o.jsxs("div",{className:`aw-integration-protocol-tabs${ue==="a2a"?" is-a2a":""}`,role:"tablist","aria-label":T("agentWorkspace.integrationProtocol"),children:[o.jsx("span",{className:"aw-integration-protocol-slider","aria-hidden":"true"}),sw.map((rt,ei)=>o.jsx("button",{type:"button",id:`integration-${rt.id}-tab`,role:"tab","aria-selected":ue===rt.id,"aria-controls":`integration-${rt.id}-panel`,tabIndex:ue===rt.id?0:-1,onClick:()=>sf(rt.id),onKeyDown:ua=>{var To;if(!["ArrowLeft","ArrowRight","Home","End"].includes(ua.key))return;ua.preventDefault();const Xn=ua.key==="Home"?0:ua.key==="End"?sw.length-1:(ei+(ua.key==="ArrowRight"?1:-1)+sw.length)%sw.length,Ns=sw[Xn];sf(Ns.id),(To=document.getElementById(`integration-${Ns.id}-tab`))==null||To.focus()},children:rt.label},rt.id))]}),ue==="api-server"?o.jsx(yte,{protocol:"api-server",title:"API Server",available:Qn,fields:[{label:"Agent",value:Qn?((mt=Sr==null?void 0:Sr.apiApps)==null?void 0:mt.join("、"))??"":""},{label:T("agentWorkspace.discoveryEndpoint"),value:Qn?nL(Al,"/list-apps"):""},{label:T("agentWorkspace.invocationEndpoint"),value:Qn?nL(Al,"/run_sse"):""},{label:T("agentWorkspace.authentication"),value:Qn?mte(q==null?void 0:q.authType,T):""},{label:"API Key",value:o.jsx(bte,{available:Qn,authType:q==null?void 0:q.authType,value:xc,visible:$e&&!!xc,loading:Ne,error:Re,onToggle:()=>void af()})}],example:Qn?M5t(Al,rf,q==null?void 0:q.authType):""}):o.jsx(yte,{protocol:"a2a",title:"A2A",available:za,fields:[{label:"Agent",value:((un=Sr==null?void 0:Sr.a2a)==null?void 0:un.name)??""},{label:"Agent Card",value:za?nL(Al,"/.well-known/agent-card.json"):""},{label:T("agentWorkspace.invocationUrl"),value:be},{label:T("agentWorkspace.authentication"),value:za?mte(q==null?void 0:q.authType,T):""},{label:"API Key",value:o.jsx(bte,{available:za,authType:q==null?void 0:q.authType,value:xc,visible:$e&&!!xc,loading:Ne,error:Re,onToggle:()=>void af()})}],example:za?L5t(be,q==null?void 0:q.authType):""})]})]}),M==="evaluations"&&o.jsxs("section",{className:"aw-cases",children:[(ce==null?void 0:ce.runtimeId)&&o.jsx("div",{className:"aw-case-summary",children:["good","bad"].map(rt=>{const ei=H5t(qi,rt),ua=ka.filter(Ns=>Ns.kind===rt).length,Xn=Xo?ua:(ei==null?void 0:ei.itemCount)??ua;return o.jsxs("button",{type:"button",onClick:()=>lf(rt),children:[o.jsx("strong",{children:Xn}),o.jsx("span",{children:T(rt==="good"?"agentWorkspace.goodCases":"agentWorkspace.badCases")})]},rt)})}),o.jsxs("div",{className:"aw-case-filter-bar",children:[o.jsxs("div",{className:"aw-case-filter-stack",children:[o.jsx("div",{className:"aw-case-filters","aria-label":T("agentWorkspace.caseResultFilter"),children:["good","bad"].map(rt=>o.jsx("button",{type:"button",className:yt===rt?"is-active":"","aria-pressed":yt===rt,onClick:()=>Dt(rt),children:T(rt==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},rt))}),o.jsx("div",{className:"aw-case-source-filters","aria-label":T("agentWorkspace.feedbackSourceFilter"),children:["auto","user"].map(rt=>o.jsx("button",{type:"button",className:dn===rt?"is-active":"","aria-pressed":dn===rt,onClick:()=>Z(rt),children:T(rt==="auto"?"agentWorkspace.automaticFeedback":"agentWorkspace.manualFeedback")},rt))})]}),o.jsxs("label",{className:"aw-case-search",children:[o.jsx(P_,{"aria-hidden":!0}),o.jsx("input",{type:"search",value:ln,onChange:rt=>Xt(rt.currentTarget.value),placeholder:T("agentWorkspace.searchCasesPlaceholder"),"aria-label":T("agentWorkspace.searchCases")})]})]}),qm&&o.jsx("div",{className:`aw-case-toolbar${ve?" is-active":""}`,children:ve?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-selection-count",children:T("agentWorkspace.selectedCaseCount",{count:of.length})}),o.jsx("button",{type:"button",onClick:cf,disabled:_l.length===0||In,children:T("agentWorkspace.selectAllVisible")}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void YE(of),disabled:of.length===0||In,children:T(In?"common.deleting":"agentWorkspace.deleteSelected")}),o.jsx("button",{type:"button",onClick:JI,disabled:In,children:T("common.cancel")})]}):o.jsx("button",{type:"button",onClick:()=>{_s(""),Xe(!0)},disabled:_l.length===0||In,children:T("agentWorkspace.selectCases")})}),jr&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:jr}),o.jsx("div",{ref:Vi,children:o.jsx(nLt,{cases:_l,loading:zi&&_l.length===0,error:Lr,notice:xs,runtimeBacked:!!(ce!=null&&ce.runtimeId),selectionMode:ve,selectedCaseIds:Gt,focusedCaseId:Si,expandedCaseIds:Hs,deleting:In,canDelete:qm,onOpenCase:l0,onToggleCase:Fr,onToggleExpanded:Br,onDeleteCase:rt=>void YE([rt]),onRetry:()=>Nr(rt=>rt+1)})})]}),M==="optimizations"&&o.jsxs("section",{className:"aw-optimizations",children:[o.jsxs("div",{className:"aw-optimization-intro",children:[o.jsx("h3",{children:T("agentWorkspace.optimizations")}),o.jsx("p",{children:T("agentWorkspace.optimizationsDescription")})]}),Yr?o.jsxs("div",{className:"aw-optimization-state",role:"status",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsx("span",{children:T("agentWorkspace.loadingOptimizations")})]}):sa?o.jsxs("div",{className:"aw-optimization-state is-error",role:"alert",children:[o.jsx("span",{children:sa}),o.jsx("button",{type:"button",onClick:()=>aa(rt=>rt+1),children:T("common.retry")})]}):As.length>0?o.jsx(eLt,{groups:As}):o.jsx("div",{className:"aw-optimization-state",children:T("agentWorkspace.noOptimizations")})]})]}),M==="basic"&&(ce||li)&&o.jsxs("div",{className:"aw-basic-actions",children:[ce&&o.jsxs("button",{type:"button",className:"aw-talk studio-update-action",onClick:()=>C==null?void 0:C(ce),children:[o.jsx(C7e,{"aria-hidden":!0}),o.jsx("span",{children:T("agentWorkspace.chat")})]}),o.jsxs("span",{className:`aw-update-wrap${$n?" is-disabled":""}`,tabIndex:$n?0:void 0,"aria-describedby":$n?ca:void 0,children:[o.jsx("button",{type:"button",className:"aw-update studio-update-action",disabled:!!$n,"aria-busy":Ve||void 0,"aria-describedby":$n?ca:void 0,onClick:()=>li?F==null?void 0:F(li):It?A(It):void 0,children:Ve?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"loading-gap-spinner aw-update-spinner","aria-hidden":"true"}),o.jsx("span",{children:T("agentWorkspace.preparing")})]}):T(li||Sa?"agentWorkspace.continueEditing":"agentWorkspace.update")}),$n&&o.jsx("span",{id:ca,className:"aw-update-disabled-reason",role:"tooltip",children:$n})]})]})]}):null}}),activeSectionKey:M,navigationLabel:T("agentWorkspace.agentDetails"),onSectionChange:U})]})]}),R==="evaluation"&&o.jsx("div",{className:"aw-evaluation-glass",role:"status",children:o.jsx("span",{children:T("agentWorkspace.comingSoon")})})]})]}),oi&&o.jsx(pc,{variant:"danger",title:oi.title,description:oi.description,confirmLabel:Zt?T("common.deleting"):oi.confirmLabel,closeLabel:T("agentWorkspace.closeDeleteConfirmation"),busy:Zt,onCancel:()=>Oi(null),onConfirm:()=>void p1()})]})}function eLt({groups:e}){const{t}=Ae("ui");return o.jsx("div",{className:"aw-optimization-table-wrap",children:o.jsxs("table",{className:"aw-optimization-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"col",children:t("agentWorkspace.fixPriority")}),o.jsx("th",{scope:"col",children:t("agentWorkspace.suggestedModule")}),o.jsx("th",{scope:"col",children:t("agentWorkspace.suggestionAndReason")})]})}),o.jsx("tbody",{children:e.map(n=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx("span",{className:`aw-priority is-${n.priority}`,children:Q5t(n.priority,t)})}),o.jsx("td",{children:o.jsx("span",{className:"aw-optimization-module",children:V5t(n,t)})}),o.jsx("td",{children:o.jsx("ul",{className:"aw-optimization-list",children:n.items.map(i=>o.jsxs("li",{children:[o.jsx("strong",{children:i.suggestion}),o.jsx("p",{children:i.reason})]},`${i.suggestion}:${i.reason}`))})})]},`${n.priority}:${n.module}:${n.customModule??""}`))})]})})}function tLt(){return o.jsxs("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:"M4.5 7h15"}),o.jsx("path",{d:"M9 7V4.8h6V7"}),o.jsx("path",{d:"m6.5 7 .8 12h9.4l.8-12"}),o.jsx("path",{d:"M10 10.5v5M14 10.5v5"})]})}function nLt({cases:e,loading:t=!1,error:n="",notice:i="",runtimeBacked:r=!1,selectionMode:s=!1,selectedCaseIds:a,focusedCaseId:l="",expandedCaseIds:c,deleting:u=!1,canDelete:d=!1,onOpenCase:f,onToggleCase:h,onToggleExpanded:p,onDeleteCase:g,onRetry:b}){const{t:v,i18n:y}=Ae("ui");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:v("agentWorkspace.userInput")}),o.jsx("span",{children:v("agentWorkspace.agentOutput")}),o.jsx("span",{children:v("agentWorkspace.score")}),o.jsx("span",{children:v("agentWorkspace.scoreReason")}),o.jsx("span",{className:"aw-case-action-head",children:v("skillCenter.actions")})]}),t?o.jsx("div",{className:"aw-case-empty",children:v("agentWorkspace.loadingEvaluationSet")}):n?o.jsxs("div",{className:"aw-case-empty aw-case-error",children:[o.jsx("span",{children:n}),b&&o.jsx("button",{type:"button",onClick:b,children:v("common.retry")})]}):i?o.jsx("div",{className:"aw-case-empty",children:i}):e.length===0?o.jsx("div",{className:"aw-case-empty",children:v(r?"agentWorkspace.noFeedbackCases":"agentWorkspace.noMatchingCases")}):e.map(x=>{var _,j;const O=x.id.startsWith("local:"),w=(a==null?void 0:a.has(x.id))??!1,k=(c==null?void 0:c.has(x.id))??!1,E=x.output.length+x.referenceOutput.length>220||(((_=x.reason)==null?void 0:_.length)??0)>120,C=d&&!O,N=!!(x.comment&&x.comment.trim()!==((j=x.reason)==null?void 0:j.trim()));return o.jsxs("div",{className:["aw-case-row",l===x.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){C&&(h==null||h(x));return}f==null||f(x)},onKeyDown:A=>{A.target===A.currentTarget&&(A.key!=="Enter"&&A.key!==" "||(A.preventDefault(),s?C&&(h==null||h(x)):f==null||f(x)))},children:[o.jsxs("div",{className:"aw-case-text aw-case-cell","data-label":v("agentWorkspace.userInput"),children:[o.jsxs("span",{className:"aw-case-title-line",children:[s&&C&&o.jsx("span",{className:`aw-select-marker${w?" is-checked":""}`,"aria-hidden":"true"}),o.jsx("strong",{title:x.input,children:x.input||v("agentWorkspace.noUserInput")})]}),N&&o.jsxs("small",{title:x.comment,children:[v("agentWorkspace.note"),x.comment]}),o.jsx("small",{className:"aw-case-time",children:B5t(x.createdAt,y.resolvedLanguage??y.language,v)}),(x.userId||x.sessionId)&&o.jsx("small",{title:[x.userId,x.sessionId].filter(Boolean).join(" · "),children:[x.userId,x.sessionId].filter(Boolean).join(" · ")})]}),o.jsxs("div",{className:`aw-case-output aw-case-cell${k?" is-expanded":""}`,"data-label":v("agentWorkspace.agentOutput"),children:[o.jsx("p",{className:"aw-case-output-preview",title:x.output,children:x.output||v("agentWorkspace.noVisibleResponse")}),x.referenceOutput&&o.jsxs("small",{className:"aw-case-output-preview",title:x.referenceOutput,children:[v("agentWorkspace.reference"),": ",x.referenceOutput]}),E&&o.jsx("button",{type:"button",className:"aw-case-expand",onClick:A=>{A.stopPropagation(),p==null||p(x.id)},children:v(k?"common.collapse":"common.expand")})]}),o.jsx("div",{className:"aw-case-score aw-case-cell","data-label":v("agentWorkspace.score"),children:U5t(x,v)}),o.jsx("div",{className:`aw-case-reason aw-case-cell${k?" is-expanded":""}`,"data-label":v("agentWorkspace.scoreReason"),children:o.jsx("p",{title:x.reason||void 0,children:x.reason||"—"})}),o.jsx("div",{className:"aw-case-actions aw-case-cell","data-label":v("skillCenter.actions"),children:C&&o.jsx("button",{type:"button",className:"aw-case-delete",onClick:A=>{A.stopPropagation(),g==null||g(x)},disabled:u,title:v("agentWorkspace.deleteFeedbackCase"),"aria-label":v("agentWorkspace.deleteFeedbackCase"),children:o.jsx(tLt,{})})})]},x.id)})]})}function iLt({group:e,agents:t,cases:n,onChange:i,onRun:r}){const{t:s}=Ae("ui"),[a,l]=m.useState("config"),c=e.agentIds.map(h=>t.find(p=>p.id===h)).filter(h=>!!h),u=["回答质量","事实准确性","工具调用","响应效率"];m.useEffect(()=>l("config"),[e.id]);const d=h=>{i({...e,agentIds:e.agentIds.includes(h)?e.agentIds.filter(p=>p!==h):[...e.agentIds,h]})},f=h=>{i({...e,metrics:e.metrics.includes(h)?e.metrics.filter(p=>p!==h):[...e.metrics,h]})};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:Ww(e.name,s)}),o.jsx("span",{children:s("agentWorkspace.evaluationGroup")})]}),o.jsx("p",{children:s("agentWorkspace.evaluationGroupStats",{agents:c.length,caseSet:Ww(e.caseSet,s),runs:e.history.length})})]}),o.jsxs("button",{type:"button",className:"aw-run",onClick:()=>r(e),disabled:!0,children:[o.jsx(v7e,{"aria-hidden":!0}),s("agentWorkspace.startEvaluation")]})]}),o.jsxs("nav",{className:"aw-agent-tabs","aria-label":s("agentWorkspace.evaluationGroupDetails"),children:[o.jsx("button",{type:"button",className:a==="config"?"is-active":"","aria-pressed":a==="config",onClick:()=>l("config"),disabled:!0,children:s("agentWorkspace.evaluationConfig")}),o.jsx("button",{type:"button",className:a==="history"?"is-active":"","aria-pressed":a==="history",onClick:()=>l("history"),disabled:!0,children:s("agentWorkspace.historyResults")})]}),o.jsx("div",{className:"aw-content",children:a==="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:s("agentWorkspace.participatingAgents")}),o.jsx("span",{children:s("agentWorkspace.selectedCount",{count:c.length})})]}),o.jsx("div",{className:"aw-eval-agent-grid",children:t.map(h=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:e.agentIds.includes(h.id),onChange:()=>d(h.id)}),o.jsxs("span",{children:[o.jsx("strong",{children:h.label}),o.jsx("small",{children:h.remote?s("agentWorkspace.remote"):s("agentWorkspace.local")})]})]},h.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:s("agentWorkspace.evaluationResources")})}),o.jsxs("div",{className:"aw-eval-fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:s("agentWorkspace.evaluationSet")}),o.jsxs("select",{value:e.caseSet,onChange:h=>i({...e,caseSet:h.currentTarget.value}),children:[o.jsx("option",{value:"核心回归集",children:s("agentWorkspace.evaluationDefaults.coreSet")}),o.jsx("option",{value:"安全边界集",children:s("agentWorkspace.evaluationDefaults.safetySet")}),o.jsx("option",{value:"工具调用集",children:s("agentWorkspace.evaluationDefaults.toolSet")})]}),o.jsx("small",{children:s("agentWorkspace.caseCount",{count:n.length})})]}),o.jsxs("label",{children:[o.jsx("span",{children:s("agentWorkspace.evaluator")}),o.jsxs("select",{value:e.evaluator,onChange:h=>i({...e,evaluator:h.currentTarget.value}),children:[o.jsx("option",{value:"综合质量评估器",children:s("agentWorkspace.evaluationDefaults.qualityEvaluator")}),o.jsx("option",{value:"事实一致性评估器",children:s("agentWorkspace.evaluationDefaults.factualEvaluator")}),o.jsx("option",{value:"工具调用评估器",children:s("agentWorkspace.evaluationDefaults.toolEvaluator")})]})]}),o.jsxs("label",{children:[o.jsx("span",{children:s("agentWorkspace.concurrency")}),o.jsxs("select",{value:e.concurrency,onChange:h=>i({...e,concurrency:h.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:s("agentWorkspace.evaluationMetrics")}),o.jsx("span",{children:s("agentWorkspace.selectedMetricCount",{count:e.metrics.length})})]}),o.jsx("div",{className:"aw-metric-list",children:u.map(h=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:e.metrics.includes(h),onChange:()=>f(h)}),o.jsx("span",{children:Ww(h,s)})]},h))})]})]})]}):o.jsxs("section",{className:"aw-eval-history",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:s("agentWorkspace.historyResults")}),o.jsx("p",{children:s("agentWorkspace.historyDescription")})]})}),e.history.length===0?o.jsxs("div",{className:"aw-results-empty",children:[o.jsx("strong",{children:s("agentWorkspace.noHistory")}),o.jsx("span",{children:s("agentWorkspace.noHistoryDescription")})]}):o.jsx("div",{className:"aw-history-list",children:e.history.map((h,p)=>o.jsxs("button",{type:"button",children:[o.jsxs("span",{children:[o.jsx("strong",{children:s("agentWorkspace.evaluationRun",{index:e.history.length-p})}),o.jsx("small",{children:s("agentWorkspace.evaluationRunMeta",{time:Ww(h.createdAt,s),agents:c.length})})]}),o.jsxs("span",{className:"aw-history-score",children:[o.jsx("strong",{children:h.score}),o.jsx("small",{children:s("agentWorkspace.overallScore")})]}),o.jsxs("span",{className:"aw-complete",children:[o.jsx(Vu,{}),s("agentWorkspace.completed")]}),o.jsx(bO,{"aria-hidden":!0})]},h.id))})]})})]})}const rLt=5e3,sLt=4;let iL=0;const xte=[];function wte(e){return e instanceof Error&&e.name==="AbortError"}function aLt(e){return e instanceof Error&&e.name==="TimeoutError"}function oLt(e){return aLt(e)||e instanceof n7&&[500,502,503,504].includes(e.status)}function lLt(e,t){return t!=null&&t.aborted?Promise.reject(t.reason??new DOMException("Request aborted","AbortError")):new Promise((n,i)=>{const r=()=>{globalThis.clearTimeout(s),i((t==null?void 0:t.reason)??new DOMException("Request aborted","AbortError"))},s=globalThis.setTimeout(()=>{t==null||t.removeEventListener("abort",r),n()},e);t==null||t.addEventListener("abort",r,{once:!0})})}async function cLt(e={},t={}){const n=t.request??_x,i=t.wait??lLt;try{return await n(e)}catch(r){if(!oLt(r))throw r;return await i(rLt,e.signal),n(e)}}async function xje(e){var t;iL>=sLt&&await new Promise(n=>xte.push(n)),iL+=1;try{return await e()}finally{iL-=1,(t=xte.shift())==null||t()}}async function uLt(e,t){await Promise.allSettled(e.map(n=>xje(()=>t(n))))}const dLt="/web/sandbox/sessions",Ote="/web/sandbox/codex-project-handoff",Ste=3e4,rL=33e4,fLt=6e4,hLt=6e5,aw=15e3,If=6e4,pLt=33e4,kte=3e4,mLt=60*60,Ete=40;function KQ(e){switch(e.trim().toLowerCase()){case"ready":return V("sandbox.status.ready");case"wakeable":return V("sandbox.status.wakeable");case"creating":return V("sandbox.status.creating");case"starting":case"initializing":return V("sandbox.status.starting");case"pending":return V("sandbox.status.pending");case"running":return V("sandbox.status.running");case"failed":case"error":return V("sandbox.status.failed");case"stopped":return V("sandbox.status.stopped");case"expired":return V("sandbox.status.expired");case"deleting":return V("sandbox.status.deleting");case"deleted":return V("sandbox.status.deleted");default:return V("sandbox.status.unknown")}}function Jr(e){const t=Hu(e);return t.has("Accept")||t.set("Accept","application/json"),t}class FI extends Error{constructor(n,i={}){var r;super(n);ki(this,"code");ki(this,"retryable");ki(this,"publicMessage");ki(this,"httpStatus");this.name="SandboxServiceError",this.code=i.code??"",this.retryable=i.retryable===!0,this.publicMessage=((r=i.publicMessage)==null?void 0:r.trim())||n,this.httpStatus=i.httpStatus}}function Cte(e){return e instanceof FI?e.publicMessage:e instanceof Error&&e.name==="TimeoutError"?V("sandbox.developmentTimeout"):e instanceof TypeError?V("sandbox.developmentDisconnected"):V("sandbox.developmentFailed")}async function es(e,t){const n=await e.text().catch(()=>"");let i={};try{i=JSON.parse(n)}catch{const d=V("common.fallbackWithHttpStatus",{fallback:t,status:e.status});return new Error(n?V("common.fallbackWithDetail",{fallback:d,detail:n}):d)}const r=i.detail,s=r&&typeof r=="object"?r:i,a=r&&typeof r=="object"&&"message"in r?r.message:r??i.error??i.message,l=typeof a=="string"?a:a==null?"":JSON.stringify(a),c=V("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),u=l?V("common.fallbackWithDetail",{fallback:c,detail:l}):c;return new FI(u,{code:typeof s.code=="string"?s.code:"",retryable:s.retryable===!0,publicMessage:l||c,httpStatus:e.status})}async function Tte(e,t){const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{throw new Error(V("sandbox.invalidStudioResponse",{fallback:t}))}}function og(e,t="codex"){if(!e.sessionId||!e.status)throw new Error(V("sandbox.invalidSession"));return{resourceType:"session",id:e.sessionId,toolName:t,userSessionId:e.userSessionId??"",displayName:e.displayName??"",status:e.status,createdAt:e.createdAt??"",expireAt:e.expireAt??"",persistent:e.persistent!==!1,toolType:e.toolType??"",intelligentDevelopment:e.toolName==="intelligent-development",createdBy:e.createdBy??"",region:e.region??"",isMine:e.isMine===!0,threadId:e.threadId??"",cwd:e.cwd??"",workspaceLocked:e.workspaceLocked===!0,busy:e.busy===!0,...typeof e.model=="string"?{model:e.model}:{},permissions:BI(e.permissions),...e.conversation===void 0?{}:{restoredConversation:Eg(e.conversation)}}}function Ate(e,t="codex"){if(!e.snapshotId||!e.status)throw new Error(V("sandbox.invalidSnapshot"));return{resourceType:"snapshot",id:e.snapshotId,snapshotId:e.snapshotId,sourceSessionId:e.sessionId??"",toolName:t,userSessionId:e.userSessionId??"",displayName:e.displayName??"",status:e.status,snapshotStatus:e.snapshotStatus??"Unknown",reason:e.reason??"",createdAt:e.createdAt??"",createdBy:e.createdBy??"",region:e.region??"",isMine:e.isMine===!0}}function _te(e,t){if(!(t!=null&&t.autoResumeSnapshots))return e;const n=new URLSearchParams({autoResumeSnapshots:"true"});return`${e}?${n.toString()}`}const ow={approvalPolicy:"on-request",approvalsReviewer:"user",sandboxMode:"workspace-write",networkAccess:!1};function BI(e){if(!e||typeof e!="object")return{...ow};const t=e,n=t.approvalPolicy,i=t.approvalsReviewer,r=t.sandboxMode;return{approvalPolicy:n==="untrusted"||n==="on-request"||n==="never"?n:ow.approvalPolicy,approvalsReviewer:i==="user"||i==="auto_review"?i:ow.approvalsReviewer,sandboxMode:r==="read-only"||r==="workspace-write"||r==="danger-full-access"?r:ow.sandboxMode,networkAccess:typeof t.networkAccess=="boolean"?t.networkAccess:ow.networkAccess}}function Nte(e){if(!e||typeof e!="object")throw new Error(V("sandbox.invalidSettings"));const t=e;return{threadId:typeof t.threadId=="string"?t.threadId:"",cwd:typeof t.cwd=="string"?t.cwd:"",...typeof t.model=="string"?{model:t.model}:{},workspaceLocked:t.workspaceLocked===!0,busy:t.busy===!0,permissions:BI(t.permissions)}}function _a(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function gLt(e){const t=_a(e);if(!(!t||typeof t.id!="string"||!t.id))return{id:t.id,displayName:typeof t.displayName=="string"?t.displayName:t.id,description:typeof t.description=="string"?t.description:"",isDefault:t.isDefault===!0}}function bLt(e){const t=_a(e);if(!(!t||typeof t.id!="string"||!t.id||typeof t.name!="string"||!t.name))return{id:t.id,name:t.name,description:typeof t.description=="string"?t.description:""}}function wje(e){const t=_a(e);if(!(!t||typeof t.id!="string"||!t.id))return{id:t.id,...typeof t.name=="string"&&t.name?{name:t.name}:{},preview:typeof t.preview=="string"?t.preview:"",cwd:typeof t.cwd=="string"?t.cwd:"",modelProvider:typeof t.modelProvider=="string"?t.modelProvider:"",createdAt:typeof t.createdAt=="number"&&Number.isFinite(t.createdAt)?t.createdAt:0,updatedAt:typeof t.updatedAt=="number"&&Number.isFinite(t.updatedAt)?t.updatedAt:0,status:typeof t.status=="string"?t.status:"unknown"}}function Eg(e){const t=_a(e),n=wje(t==null?void 0:t.thread);if(!t||!n||typeof t.threadId!="string"||!Array.isArray(t.messages))throw new Error(V("sandbox.invalidThreadSnapshot"));const i=t.messages.flatMap(r=>{const s=_a(r);if(!s||typeof s.id!="string"||s.role!=="user"&&s.role!=="assistant"||typeof s.content!="string"||typeof s.timestamp!="number")return[];const a=Array.isArray(s.skillNames)?s.skillNames.filter(c=>typeof c=="string"&&!!c):[],l=Array.isArray(s.images)?s.images.flatMap(c=>{const u=_a(c);return!u||typeof u.mimeType!="string"||!u.mimeType.startsWith("image/")||typeof u.data!="string"||!u.data?[]:[{mimeType:u.mimeType,data:u.data,...typeof u.name=="string"&&u.name?{name:u.name}:{},...typeof u.alt=="string"&&u.alt?{alt:u.alt}:{}}]}):[];return[{id:s.id,role:s.role,content:s.content,timestamp:s.timestamp,...a.length?{skillNames:a}:{},...l.length?{images:l}:{}}]});return{thread:n,threadId:t.threadId,messages:i,...typeof t.model=="string"?{model:t.model}:{},...typeof t.cwd=="string"?{cwd:t.cwd}:{},workspaceLocked:t.workspaceLocked===!0,permissions:BI(t.permissions)}}function x8(e){if(!e||typeof e!="object")return;const t=e;if(![t.totalTokens,t.inputTokens,t.cachedInputTokens,t.outputTokens,t.reasoningOutputTokens].some(i=>typeof i!="number"||!Number.isFinite(i)||i<0))return{totalTokens:Math.trunc(t.totalTokens),inputTokens:Math.trunc(t.inputTokens),cachedInputTokens:Math.trunc(t.cachedInputTokens),outputTokens:Math.trunc(t.outputTokens),reasoningOutputTokens:Math.trunc(t.reasoningOutputTokens)}}function yLt(e){const t=x8(e.usage);if(!t||typeof e.turnId!="string")return;const n=x8(e.threadTotal),i=e.modelContextWindow;return{turnId:e.turnId,usage:t,...n?{threadTotal:n}:{},...typeof i=="number"&&Number.isFinite(i)&&i>=0?{modelContextWindow:Math.trunc(i)}:{}}}function vLt(e){return typeof e.id!="string"||e.kind!=="command"&&e.kind!=="file"||typeof e.method!="string"?null:{id:e.id,kind:e.kind,method:e.method,...typeof e.reason=="string"?{reason:e.reason}:{},...typeof e.command=="string"?{command:e.command}:{},...typeof e.cwd=="string"?{cwd:e.cwd}:{},...typeof e.grantRoot=="string"?{grantRoot:e.grantRoot}:{},...e.changes!==void 0?{changes:e.changes}:{},...typeof e.threadId=="string"?{threadId:e.threadId}:{},...typeof e.turnId=="string"?{turnId:e.turnId}:{},...typeof e.itemId=="string"?{itemId:e.itemId}:{}}}async function xLt(e,t={}){if(!e.body)throw new Error(V("sandbox.emptyConversationResponse"));const n=e.body.getReader(),i=new TextDecoder;let r="",s="";const a=[],l=new Map;let c,u;function d(){var b;const g=c?[...a,c]:a;(b=t.onBlocks)==null||b.call(t,g.map(v=>({...v})))}function f(g){s+=g;const b=a[a.length-1],v=a.length-1,y=[...l.values()].includes(v);(b==null?void 0:b.kind)==="text"&&!y?b.text+=g:a.push({kind:"text",text:g}),d()}function h(g){if(typeof g.id!="string"||g.kind!=="thinking"&&g.kind!=="commentary"&&g.kind!=="tool"||g.status!=="running"&&g.status!=="done")return;const b=g.status==="done";let v;if(g.kind==="thinking"){if(typeof g.text!="string"||!g.text)return;v={kind:"thinking",text:g.text,done:b}}else if(g.kind==="commentary"){if(typeof g.text!="string"||!g.text)return;v={kind:"text",text:g.text}}else{if(typeof g.name!="string"||!g.name)return;v={kind:"tool",name:g.name,args:g.args,response:g.response,done:b}}const y=l.get(g.id);y===void 0?(l.set(g.id,a.length),a.push(v)):a[y]=v,d()}function p(g){var x,O,w;let b="message";const v=[];for(const k of g.split(/\r?\n/))k.startsWith("event:")&&(b=k.slice(6).trim()),k.startsWith("data:")&&v.push(k.slice(5).trimStart());if(v.length===0)return;let y;try{y=JSON.parse(v.join(` -`))}catch{throw new Error(V("sandbox.invalidConversationResponse"))}if(b==="error"){const k=typeof y.message=="string"&&y.message?y.message:V("sandbox.conversationFailed");throw new FI(k,{code:typeof y.code=="string"?y.code:"",retryable:y.retryable===!0,publicMessage:k})}if(b==="progress"&&typeof y.text=="string"&&y.text&&(c={kind:"progress",text:y.text},d()),b==="activity"&&h(y),b==="development.source_ready"||b==="development.succeeded"){const k=_a(y.payload),S=_a(k==null?void 0:k.delivery),E=b==="development.succeeded";if(S&&typeof S.sessionId=="string"&&typeof S.artifactSha256=="string"&&typeof S.validationReportSha256=="string"&&typeof S.agentName=="string"&&typeof S.entryPoint=="string"&&typeof S.fileCount=="number"&&typeof S.artifactSize=="number"&&typeof S.validatedAt=="string"&&S.deployable===!0&&S.verified===E&&typeof S.validationSummary=="string"&&Array.isArray(S.gateSummary)&&S.gateSummary.every(C=>typeof C=="string")){const C={kind:"delivery",value:{sessionId:S.sessionId,...typeof S.projectId=="string"&&typeof S.versionId=="string"?{projectId:S.projectId,versionId:S.versionId,...S.parentVersionId===null||typeof S.parentVersionId=="string"?{parentVersionId:S.parentVersionId}:{}}:{},artifactSha256:S.artifactSha256,validationReportSha256:S.validationReportSha256,agentName:S.agentName,entryPoint:S.entryPoint,fileCount:S.fileCount,artifactSize:S.artifactSize,validatedAt:S.validatedAt,gateSummary:S.gateSummary,deployable:S.deployable,verified:S.verified,validationSummary:S.validationSummary}},N=a.findIndex(_=>_.kind==="delivery"&&_.value.sessionId===S.sessionId&&_.value.artifactSha256===S.artifactSha256&&_.value.validationReportSha256===S.validationReportSha256);N===-1?a.push(C):a[N]=C,d()}}if(b==="approval"){const k=vLt(y);k&&((x=t.onApproval)==null||x.call(t,k))}if(b==="usage"){const k=yLt(y);k&&(u=k,(O=t.onUsage)==null||O.call(t,k))}b==="approval_resolved"&&typeof y.approvalId=="string"&&((w=t.onApprovalResolved)==null||w.call(t,y.approvalId)),b==="delta"&&typeof y.text=="string"&&f(y.text),b==="done"&&!s&&typeof y.text=="string"&&f(y.text),b==="done"&&c&&(c=void 0,d())}for(;;){const{done:g,value:b}=await n.read();r+=i.decode(b,{stream:!g});const v=r.split(/\r?\n\r?\n/);if(r=v.pop()??"",v.forEach(p),g)break}if(r.trim()&&p(r),c&&(c=void 0,d()),a.length===0)throw new Error(V("sandbox.emptyReply"));return{text:s,blocks:a,...u?{usage:u}:{}}}async function $l(e,t,n,{method:i="GET",body:r,options:s={},fallback:a}){if(!t)throw new Error(V("sandbox.missingSession"));const l=await Tn(`${e}/${encodeURIComponent(t)}/${n}`,{method:i,headers:Jr(r===void 0?void 0:{"Content-Type":"application/json"}),...r===void 0?{}:{body:JSON.stringify(r)},signal:s.signal},If);if(!l.ok)throw await es(l,a);return l.json()}function Oje(e,t={}){return{async listSessions(n={}){const i=await Tn(_te(e,n),{method:"GET",headers:Jr(),signal:n.signal},Ste);if(!i.ok)throw await es(i,V("sandbox.listCodexFailed"));const r=await i.json();if(!Array.isArray(r.sessions))throw new Error(V("sandbox.invalidSessionList"));if(r.snapshots!==void 0&&!Array.isArray(r.snapshots))throw new Error(V("sandbox.invalidSnapshotList"));return[...r.sessions.map(s=>og(s)),...(r.snapshots??[]).map(s=>Ate(s))]},async startSession(n={}){var r,s;const i=await Tn(e,{method:"POST",headers:Jr({"Content-Type":"application/json"}),body:JSON.stringify({displayName:((r=n.displayName)==null?void 0:r.trim())??"",...(s=n.modelId)!=null&&s.trim()?{modelId:n.modelId.trim()}:{},...t.textOnly&&n.projectId?{projectId:n.projectId,...n.baseVersionId?{baseVersionId:n.baseVersionId}:{}}:{},...t.textOnly?{}:{persistent:n.persistent??!0},...n.diskGb!==void 0?{diskGb:n.diskGb}:{}}),signal:n.signal},rL);if(!i.ok)throw await es(i,V("sandbox.startFailed"));return og(await i.json())},async listAgentSessions(n,i={}){const r=await Tn(_te(`/web/${n}/sessions`,i),{method:"GET",headers:Jr(),signal:i.signal},Ste);if(!r.ok)throw await es(r,V("sandbox.listAgentFailed",{kind:n}));const s=await r.json();if(!Array.isArray(s.sessions))throw new Error(V("sandbox.invalidKindSessionList",{kind:n}));if(s.snapshots!==void 0&&!Array.isArray(s.snapshots))throw new Error(V("sandbox.invalidKindSnapshotList",{kind:n}));return[...s.sessions.map(a=>og(a,n)),...(s.snapshots??[]).map(a=>Ate(a,n))]},async startAgentSession(n,i={}){var s;const r=await Tn(`/web/${n}/sessions`,{method:"POST",headers:Jr({"Content-Type":"application/json"}),body:JSON.stringify({displayName:((s=i.displayName)==null?void 0:s.trim())??"",persistent:i.persistent??!0,...i.diskGb!==void 0?{diskGb:i.diskGb}:{}}),signal:i.signal},rL);if(!r.ok)throw await es(r,V("sandbox.createAgentFailed",{kind:n}));return og(await r.json(),n)},async openAgentSession(n,i,r={}){if(!i)throw new Error(V("sandbox.missingSessionToOpen"));const s=await Tn(`/web/${n}/sessions/${encodeURIComponent(i)}/open`,{method:"POST",headers:Jr(),signal:r.signal},If);if(!s.ok)throw await es(s,V("sandbox.openAgentFailed",{kind:n}));const a=await s.json();if(typeof a.webuiUrl!="string"||!a.webuiUrl.startsWith("/"))throw new Error(V("sandbox.invalidAgentHomeUrl",{kind:n}));return{session:og(a,n),kind:n,webuiUrl:Bo(a.webuiUrl)}},async launchAgentTerminal(n,i,r={}){if(!i)throw new Error(V("sandbox.missingSessionForTerminal"));const s=await Tn(`/web/${n}/sessions/${encodeURIComponent(i)}/terminal`,{method:"POST",headers:Jr(),signal:r.signal},If);if(!s.ok)throw await es(s,V("sandbox.openTerminalFailed",{kind:n}));const a=await s.json();return{url:Sje(a.url,`${n} Terminal`),...typeof a.shellSessionId=="string"?{shellSessionId:a.shellSessionId}:{}}},async deleteAgentSession(n,i,r={}){if(!i)return;const s=await Tn(`/web/${n}/sessions/${encodeURIComponent(i)}`,{method:"DELETE",headers:Jr(),signal:r.signal},aw);if(!s.ok&&s.status!==404)throw await es(s,V("sandbox.deleteAgentFailed",{kind:n}))},async resumeSnapshot(n,i,r={}){if(!i)throw new Error(V("sandbox.missingSnapshot"));const s=n==="codex"?"/web/sandbox":`/web/${n}`,a=await Tn(`${s}/snapshots/${encodeURIComponent(i)}/resume`,{method:"POST",headers:Jr(),signal:r.signal},rL);if(!a.ok)throw await es(a,V("sandbox.resumeSnapshotFailed"));return og(await a.json(),n)},async deleteSnapshot(n,i,r={}){if(!i)return;const s=n==="codex"?"/web/sandbox":`/web/${n}`,a=await Tn(`${s}/snapshots/${encodeURIComponent(i)}`,{method:"DELETE",headers:Jr(),signal:r.signal},aw);if(!a.ok&&a.status!==404)throw await es(a,V("sandbox.deleteSnapshotFailed"))},async connectSession(n,i={}){if(!n)throw new Error(V("sandbox.missingSessionToConnect"));const r=await Tn(`${e}/${encodeURIComponent(n)}/connect`,{method:"POST",headers:Jr({"Content-Type":"application/json"}),signal:i.signal},fLt);if(!r.ok)throw await es(r,V("sandbox.connectCodexFailed"));const s=og(await r.json());if(s.status.toLowerCase()!=="ready")throw new Error(V("sandbox.sessionNotReady",{status:s.status}));return s},async sendMessage(n,i={}){var s;if(!n.sessionId||!n.text.trim())throw new Error(V("sandbox.invalidMessage"));const r=await Tn(`${e}/${encodeURIComponent(n.sessionId)}/messages`,{method:"POST",headers:Jr({Accept:"text/event-stream","Content-Type":"application/json"}),body:JSON.stringify({message:n.text,...!t.textOnly&&((s=n.skillIds)!=null&&s.length)?{skillIds:n.skillIds}:{}}),signal:i.signal},t.messageTimeoutMs??hLt);if(!r.ok)throw await es(r,V("sandbox.conversationFailed"));return xLt(r,i)},async interruptSession(n,i={}){if(!n)return;const r=await Tn(`${e}/${encodeURIComponent(n)}/interrupt`,{method:"POST",headers:Jr(),signal:i.signal},t.interruptTimeoutMs??aw);if(!r.ok&&![404,409].includes(r.status))throw await es(r,V("sandbox.interruptFailed"))},async getStatus(n,i={}){const r=await $l(e,n,"status",{options:i,fallback:V("sandbox.getStatusFailed")}),s=Nte(r),a=_a(r),l=x8(a==null?void 0:a.threadTotal),c=a==null?void 0:a.modelContextWindow;return{...s,...l?{threadTotal:l}:{},...typeof c=="number"&&Number.isFinite(c)&&c>=0?{modelContextWindow:Math.trunc(c)}:{}}},async getEndpoint(n,i={}){const r=_a(await $l(e,n,"endpoint",{options:i,fallback:V("sandbox.getEndpointFailed")}));if(typeof(r==null?void 0:r.endpoint)!="string"||!r.endpoint.trim())throw new Error(V("sandbox.invalidEndpoint"));return{endpoint:r.endpoint,sessionId:typeof r.sessionId=="string"?r.sessionId:n,...typeof r.expireAt=="string"?{expireAt:r.expireAt}:{}}},async createCodexProjectHandoffPairing(n={}){const i=await Tn(`${Ote}/pairings`,{method:"POST",headers:Jr({Accept:"application/json","Content-Type":"application/json"}),body:JSON.stringify({ttlSeconds:mLt}),signal:n.signal},kte);if(!i.ok)throw await es(i,V("sandbox.createHandoffPairingFailed"));const r=_a(await Tte(i,V("sandbox.createHandoffPairingFailed")));if(typeof(r==null?void 0:r.pairingCode)!="string"||!r.pairingCode.trim()||typeof r.expireAt!="string"||!r.expireAt.trim())throw new Error(V("sandbox.invalidHandoffPairing"));const s=typeof r.studioUrl=="string"&&r.studioUrl.trim()?r.studioUrl.trim():window.location.origin;return{pairingCode:r.pairingCode,expireAt:r.expireAt,studioUrl:s}},async getCodexProjectHandoffStatus(n,i={}){const r=await Tn(`${Ote}/pairings/${encodeURIComponent(n)}`,{headers:Jr({Accept:"application/json"}),signal:i.signal},kte);if(!r.ok)throw await es(r,V("sandbox.getHandoffStatusFailed"));const s=_a(await Tte(r,V("sandbox.getHandoffStatusFailed"))),a=new Set(["issued","creating","session-created","continuing","running","completed","failed"]);if(typeof(s==null?void 0:s.state)!="string"||!a.has(s.state)||typeof s.expireAt!="string"||!s.expireAt.trim())throw new Error(V("sandbox.invalidHandoffStatus"));return{state:s.state,expireAt:s.expireAt,...typeof s.projectName=="string"?{projectName:s.projectName}:{},...typeof s.agentName=="string"?{agentName:s.agentName}:{},...typeof s.sessionId=="string"?{sessionId:s.sessionId}:{},...typeof s.error=="string"?{error:s.error}:{},...s.failedStage==="creating-session"||s.failedStage==="uploading-project"||s.failedStage==="restoring-project"||s.failedStage==="continuing-task"?{failedStage:s.failedStage}:{}}},async listModels(n,i={}){const r=_a(await $l(e,n,"models",{options:i,fallback:V("sandbox.listModelsFailed")}));if(!Array.isArray(r==null?void 0:r.models))throw new Error(V("sandbox.invalidModelList"));return r.models.flatMap(s=>{const a=gLt(s);return a?[a]:[]})},async setModel(n,i,r={}){const s=_a(await $l(e,n,"model",{method:"PUT",body:{model:i},options:r,fallback:V("sandbox.setModelFailed")}));if(typeof(s==null?void 0:s.model)!="string"||!s.model)throw new Error(V("sandbox.invalidModel"));return s.model},async listSkills(n,i=!1,r={}){const a=_a(await $l(e,n,`skills${i?"?force_reload=true":""}`,{options:r,fallback:V("sandbox.listSkillsFailed")}));if(!Array.isArray(a==null?void 0:a.skills))throw new Error(V("sandbox.invalidSkillList"));return a.skills.flatMap(l=>{const c=bLt(l);return c?[c]:[]})},async listThreads(n,i={},r={}){const s=new URLSearchParams;i.cursor&&s.set("cursor",i.cursor),i.search&&s.set("search",i.search),i.archived&&s.set("archived","true");const a=s.size?`?${s}`:"",l=_a(await $l(e,n,`threads${a}`,{options:r,fallback:V("sandbox.listThreadsFailed")}));if(!Array.isArray(l==null?void 0:l.threads))throw new Error(V("sandbox.invalidThreadList"));return{threads:l.threads.flatMap(c=>{const u=wje(c);return u?[u]:[]}),...typeof l.nextCursor=="string"?{nextCursor:l.nextCursor}:{}}},async newThread(n,i={}){return Eg(await $l(e,n,"threads/new",{method:"POST",options:i,fallback:V("sandbox.createThreadFailed")}))},async readThread(n,i,r={}){if(!i)throw new Error(V("sandbox.missingThread"));return Eg(await $l(e,n,`threads/${encodeURIComponent(i)}`,{options:r,fallback:V("sandbox.readThreadFailed")}))},async resumeThread(n,i,r={}){return Eg(await $l(e,n,"threads/resume",{method:"POST",body:{threadId:i},options:r,fallback:V("sandbox.resumeThreadFailed")}))},async forkThread(n,i={}){return Eg(await $l(e,n,"threads/fork",{method:"POST",options:i,fallback:V("sandbox.forkThreadFailed")}))},async archiveThread(n,i,r={}){const s=_a(await $l(e,n,"threads/archive",{method:"POST",body:{threadId:i},options:r,fallback:V("sandbox.archiveThreadFailed")}));if((s==null?void 0:s.archived)!==!0)throw new Error(V("sandbox.invalidArchiveResult"));return{archived:!0,...s.thread?{snapshot:Eg(s)}:{}}},async deleteThread(n,i,r={}){const s=_a(await $l(e,n,"threads/delete",{method:"POST",body:{threadId:i},options:r,fallback:V("sandbox.deleteThreadFailed")}));if((s==null?void 0:s.deleted)!==!0)throw new Error(V("sandbox.invalidDeleteResult"));return{deleted:!0,...s.thread?{snapshot:Eg(s)}:{}}},async compactThread(n,i={}){await $l(e,n,"threads/compact",{method:"POST",options:i,fallback:V("sandbox.compactThreadFailed")})},async getSettings(n,i={}){const r=await Tn(`${e}/${encodeURIComponent(n)}/settings`,{method:"GET",headers:Jr(),signal:i.signal},If);if(!r.ok)throw await es(r,V("sandbox.getSettingsFailed"));return Nte(await r.json())},async updatePermissions(n,i,r={}){const s=await Tn(`${e}/${encodeURIComponent(n)}/permissions`,{method:"PUT",headers:Jr({"Content-Type":"application/json"}),body:JSON.stringify(i),signal:r.signal},If);if(!s.ok)throw await es(s,V("sandbox.updatePermissionsFailed"));const a=await s.json();return BI(a.permissions)},async updateWorkspace(n,i,r={}){const s=await Tn(`${e}/${encodeURIComponent(n)}/workspace`,{method:"PUT",headers:Jr({"Content-Type":"application/json"}),body:JSON.stringify({cwd:i}),signal:r.signal},If);if(!s.ok)throw await es(s,V("sandbox.updateWorkspaceFailed"));const a=await s.json();if(typeof a.cwd!="string"||!a.cwd)throw new Error(V("sandbox.invalidWorkingDirectory"));return a.cwd},async listDirectories(n,i,r={}){const s=new URLSearchParams({path:i}),a=await Tn(`${e}/${encodeURIComponent(n)}/directories?${s}`,{method:"GET",headers:Jr(),signal:r.signal},If);if(!a.ok)throw await es(a,V("sandbox.listDirectoriesFailed"));const l=await a.json();if(typeof l.path!="string"||!Array.isArray(l.directories)||l.directories.some(c=>!c||typeof c.name!="string"||typeof c.path!="string"))throw new Error(V("sandbox.invalidDirectoryList"));return{path:l.path,...typeof l.parent=="string"?{parent:l.parent}:{},directories:l.directories}},async resolveApproval(n,i,r,s={}){const a=await Tn(`${e}/${encodeURIComponent(n)}/approvals/${encodeURIComponent(i)}`,{method:"POST",headers:Jr({"Content-Type":"application/json"}),body:JSON.stringify({decision:r}),signal:s.signal},If);if(!a.ok)throw await es(a,V("sandbox.resolveApprovalFailed"))},async launchTerminal(n,i={}){return jte(e,n,"terminal",i)},async launchBrowser(n,i={}){return jte(e,n,"browser",i)},async uploadFile(n,i,r={}){const s=new FormData;s.set("file",i,i.name);const a=await Tn(`${e}/${encodeURIComponent(n)}/files`,{method:"POST",headers:Jr(),body:s,signal:r.signal},pLt);if(!a.ok)throw await es(a,V("sandbox.uploadFileFailed"));const l=await a.json();if(typeof l.id!="string"||typeof l.path!="string"||typeof l.name!="string"||typeof l.mimeType!="string"||typeof l.sizeBytes!="number")throw new Error(V("sandbox.invalidUploadResult"));return l},async closeSession(n,i={}){if(!n)return;const r=await Tn(`${e}/${encodeURIComponent(n)}/disconnect`,{method:"POST",headers:Jr(),signal:i.signal},aw);if(!r.ok&&r.status!==404)throw await es(r,V("sandbox.disconnectCodexFailed"))},async deleteSession(n,i={}){if(!n)return;const r=await Tn(`${e}/${encodeURIComponent(n)}`,{method:"DELETE",headers:Jr(),signal:i.signal},aw);if(!r.ok&&r.status!==404)throw await es(r,V("sandbox.deleteCodexFailed"))}}}const dr=Oje(dLt),fp=Oje("/web/intelligent-development/sessions",{textOnly:!0,messageTimeoutMs:36e5,interruptTimeoutMs:45e3});async function jte(e,t,n,i){const r=await Tn(`${e}/${encodeURIComponent(t)}/${n}`,{method:"POST",headers:Jr(),signal:i.signal},If);if(!r.ok)throw await es(r,V(n==="terminal"?"sandbox.openSandboxTerminalFailed":"sandbox.openSandboxBrowserFailed"));const s=await r.json();return{url:Sje(s.url,V("sandbox.toolLabel")),...typeof s.shellSessionId=="string"?{shellSessionId:s.shellSessionId}:{}}}function Sje(e,t){if(typeof e!="string")throw new Error(V("sandbox.invalidToolUrl",{label:t}));if(e.startsWith("/"))return Bo(e);let n;try{n=new URL(e)}catch{throw new Error(V("sandbox.invalidToolUrl",{label:t}))}const i=n.protocol==="http:"&&window.location.protocol==="http:";if(n.protocol!=="https:"&&!i)throw new Error(V("sandbox.unsafeToolUrl",{label:t}));return n.toString()}function Rg(e,t,n){const i=e instanceof Error?`${e.name}: ${e.message}`:String(e||V("common.unknownError"));return[V("requestError.actionFailed",{action:t}),V("requestError.detail",{detail:i}),n?V("requestError.request",{request:n}):""].filter(Boolean).join(` -`)}function Yf({className:e="icon"}){return o.jsxs("svg",{className:`${e} sidebar-agent-face`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",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",d:"M8.5 10.7v2"}),o.jsx("path",{className:"sidebar-agent-face__eye",d:"M15.5 10.7v2"})]})}function wLt(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:"M8.4 18.4H7.2a4.2 4.2 0 0 1-.65-8.35A5.7 5.7 0 0 1 17.3 8.2a4.6 4.6 0 0 1-.4 9.2h-3.2"}),o.jsx("path",{d:"m7.8 12.3 2 2-2 2M12.2 16.3h3.2"})]})}function OLt(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:"M18.9 6.25A8.4 8.4 0 1 0 19.6 16"}),o.jsx("path",{d:"M19 6.2c.1 2.1-.65 3.75-2.25 4.95-1.2.9-2.75 1.25-4.2.9"}),o.jsx("circle",{cx:"10.6",cy:"12.8",r:"2.45"}),o.jsx("path",{d:"m5.25 18.6 3.65-3.9M14.8 17.9c1.9-.45 3.55-1.65 4.65-3.35"})]})}function SLt(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:"M6.2 20c.55-2.15.75-4.1.75-6.7V9.8A5.35 5.35 0 0 1 12.35 4c3.35 0 5.65 2.35 5.65 5.65v4.6c0 2.35.35 4.25 1.15 5.75"}),o.jsx("path",{d:"M8.05 10.2c1.35-.6 2.2-1.65 2.55-3.15.45 1.55 1.35 2.55 2.7 3.05.1-1 .4-1.95.85-2.75.45 1.25 1.2 2.2 2.15 2.75"}),o.jsx("path",{d:"M9.3 12.65h.01M14.9 12.65h.01M10.8 15.55c.8.5 1.65.5 2.45 0"}),o.jsx("path",{d:"M8.45 19.85c.95-.85 1.45-1.95 1.5-3.25M15.1 16.65c.05 1.2.55 2.3 1.55 3.2"})]})}function kLt(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.2 17.2V8.1a3 3 0 0 1 3-3h7.6a3 3 0 0 1 3 3v9.1"}),o.jsx("path",{d:"M7.4 17.2h9.2M9 19.9h6"}),o.jsx("path",{d:"M9.1 9.25h5.8M9.1 12h3.1"}),o.jsx("path",{d:"m14.1 12.4 2 2.1M16.2 12.4l-2.1 2.1"})]})}function wk({kind:e,...t}){return e==="codex"?o.jsx(wLt,{...t}):e==="deepseek-harness"?o.jsx(kLt,{...t}):e==="openclaw"?o.jsx(OLt,{...t}):o.jsx(SLt,{...t})}const ELt=["general","codex","deepseek-harness","openclaw","hermes"],CLt=24,TLt=3e4,ALt=7e3,_Lt=2e4,NLt=6,jLt=2,RLt=250,Vp=new Map,yv=new Map,ILt=new Set;function lg(e){const t=e.runtime;return t?`${t.region}:${t.runtimeId}:${t.currentVersion??""}`:""}function Rte(e,t){const n=e instanceof Error&&e.message.trim()?e.message.trim():t("myAgents.compatibility.unknownError");return{status:e instanceof Ds&&e.unsupported?"unsupported":"error",message:n}}function b2(e){if(!e){Vp.clear(),yv.clear(),A4();return}const t=new Set(e);if(t.size!==0){for(const[n,i]of yv)i.page.runtimes.some(r=>t.has(r.runtimeId))&&yv.delete(n);for(const n of t)A4(n);Vp.clear()}}function PLt(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 DLt(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M8.313 3.646a.5.5 0 0 1 .707 0l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 1 1-.707-.708L11.46 8.5H3.333a.5.5 0 0 1 0-1h8.127L8.313 4.354a.5.5 0 0 1 0-.708Z",fill:"currentColor"})})}function MLt(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M2.75 5.25h8.75m0 0-2-2m2 2-2 2M13.25 10.75H4.5m0 0 2 2m-2-2 2-2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function LLt({type:e}){return e==="general"?o.jsx(Yf,{}):o.jsx(wk,{kind:e})}function $Lt(e,t=Date.now(),n){const i=Date.parse(e);if(!Number.isFinite(i)||i-t<6e4)return n("myAgents.expiringSoon");const r=Math.ceil((i-t)/6e4),s=Math.floor(r/60),a=r%60;return n("myAgents.sandboxRemaining",{hours:s,minutes:a})}function Ite(e,t){var n;return{id:e.runtimeId,name:e.name,description:((n=e.description)==null?void 0:n.trim())||t("common.noDescription"),createdAt:e.createdAt??"",specificationLabel:t("myAgents.creator"),specification:REe(e.author),isMine:e.isMine,runtime:{runtimeId:e.runtimeId,region:e.region,currentVersion:e.currentVersion,canDelete:e.canDelete}}}function FLt(e,t){const n=e.status.trim().toLowerCase();return{id:e.id,name:e.displayName||t("myAgents.namedAgent",{name:e.toolName}),description:t(`myAgents.sandboxStatus.${n}`,{defaultValue:t("myAgents.sandboxStatus.unknown")}),createdAt:e.createdAt,specificationLabel:t("myAgents.creator"),specification:REe(e.createdBy),isMine:e.isMine,region:e.region,sandbox:e}}function BLt(e,t){var n,i;return{id:e.id,name:e.draft.name||t("agentSelector.unnamedAgent"),description:((n=e.draft.description)==null?void 0:n.trim())||t("common.noDescription"),createdAt:new Date(e.updatedAt).toISOString(),specificationLabel:t("myAgents.storageLocation"),specification:t("myAgents.currentBrowser"),isMine:!0,region:(i=e.deploymentTarget)==null?void 0:i.region,draft:e}}function ULt(e,t,n){if(!e.draft)return e;const i=e.draft.deploymentTarget;return i?t.find(r=>{var s;return((s=r.runtime)==null?void 0:s.runtimeId)===i.runtimeId&&r.runtime.region===i.region})??{id:i.runtimeId,appName:i.appName,name:i.name||e.name,description:e.description,createdAt:e.createdAt,specificationLabel:n("myAgents.region"),specification:i.region,isMine:!0,runtime:{runtimeId:i.runtimeId,region:i.region,currentVersion:i.currentVersion,canDelete:!1}}:null}function QLt(e,t){return e.trim()||Ji(t)}async function zLt(e,t,n,i,r,s){const a=`${e}:${t}:${n}`,l=yv.get(a);if(l&&l.expiresAt>Date.now())return i(l.page.runtimes.map(d=>Ite(d,r))),l.page.nextToken;l&&yv.delete(a);let c=Vp.get(a);c||(c=cLt({scope:e,region:t,pageSize:CLt,nextToken:n,signal:s}),Vp.set(a,c),c.then(()=>Vp.delete(a),()=>Vp.delete(a)));const u=await c;return yv.set(a,{page:u,expiresAt:Date.now()+TLt}),i(u.runtimes.map(d=>Ite(d,r))),u.nextToken}function VLt({agent:e,onUse:t,onViewDetails:n,onPrepareUpdate:i,compatibility:r,onRetryCompatibility:s,connecting:a,connected:l,deploymentTask:c,nowMs:u,onViewDeploymentTask:d,onEditDraft:f,onDeleteDraft:h}){var N,_,j,A;const{t:p,i18n:g}=Ae("ui"),b=(N=e.sandbox)==null?void 0:N.status.toLowerCase(),v=((_=e.sandbox)==null?void 0:_.resourceType)==="snapshot",y=!!(e.runtime||b==="ready"||b==="wakeable"),x=(r==null?void 0:r.status)==="checking",O=(r==null?void 0:r.status)==="unsupported",w=(r==null?void 0:r.status)==="error",k=((j=e.sandbox)==null?void 0:j.resourceType)==="snapshot"?e.sandbox.sourceSessionId||e.sandbox.snapshotId:(A=e.sandbox)==null?void 0:A.id,S=()=>{if(e.draft){c?d==null||d(c):n==null||n(e);return}y&&(c?d==null||d(c):n==null||n(e))},E=(e.draft||y)&&!!(c?d:n),C=e.draft?c?p("myAgents.viewDeploymentProgress",{name:e.name}):p("myAgents.viewRuntimeDetails",{name:e.name}):c?p("myAgents.viewDeploymentProgress",{name:e.name}):p("myAgents.viewDetails",{name:e.name});return o.jsxs(jB,{className:a?"my-agent-card is-connecting":"my-agent-card",activateLabel:E?C:void 0,onActivate:E?S:void 0,onPointerEnter:()=>i==null?void 0:i(e),onFocusCapture:()=>i==null?void 0:i(e),footer:o.jsx(BOe,{className:"my-agent-meta",items:[{label:e.specificationLabel,value:e.specification,hideLabel:!0,className:"my-agent-region"},{label:p("myAgents.time"),value:GQ(e.createdAt,u,g.resolvedLanguage??g.language),hideLabel:!0,className:"my-agent-created-at"},...e.sandbox?[{label:p("myAgents.remainingTime"),value:e.sandbox.resourceType==="snapshot"?p("myAgents.wakeable"):e.sandbox.persistent?p("myAgents.neverExpires"):$Lt(e.sandbox.expireAt,u,p),className:`my-agent-expiry${e.sandbox.resourceType==="session"&&e.sandbox.persistent?"":" is-expiring"}`}]:[]]}),actions:e.draft?o.jsxs(o.Fragment,{children:[o.jsx(E6,{"aria-label":c?p("myAgents.viewDeploymentProgress",{name:e.name}):p("myAgents.editDraftNamed",{name:e.name}),onClick:()=>c?d==null?void 0:d(c):f==null?void 0:f(e.draft),children:p(c?"myAgents.viewProgress":"common.edit")}),o.jsx(E6,{tone:"danger","aria-label":p("myAgents.deleteDraftNamed",{name:e.name}),onClick:()=>h==null?void 0:h(e.draft),children:p("common.delete")})]}):w||O?o.jsxs(zt,{type:"button",color:"primary",size:"sm",pill:!1,"aria-label":p("myAgents.recheckCompatibility",{name:e.name}),onClick:()=>s==null?void 0:s(e),children:[o.jsx(Kj,{}),p("common.retry")]}):o.jsx(C6,{className:l?"my-agent-use is-connected":"my-agent-use",disabled:!y||x||O||a||l,"aria-busy":a||void 0,label:l?p("myAgents.connectedNamed",{name:e.name}):v?p("myAgents.wakeAndChat",{name:e.name}):p("myAgents.chatWith",{name:e.name}),onClick:()=>void(t==null?void 0:t(e)),children:a?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-use-spinner","aria-hidden":"true"}),o.jsx("span",{className:"sr-only",children:p(v?"myAgents.waking":"agentSelector.connecting")})]}):o.jsx(DLt,{})}),children:[o.jsx(RB,{leading:o.jsx(Xv,{seed:e.name}),title:e.name,subtitle:e.sandbox?o.jsx("span",{className:"my-agent-session-id",title:k,children:k}):void 0,status:e.draft?c?o.jsx("span",{className:"my-agent-deploying-badge",children:p("myAgents.deploying")}):o.jsx("span",{className:"my-agent-draft-badge",children:p("myAgents.draft")}):e.sandbox?o.jsx("span",{className:"my-agent-status-label","data-ready":e.sandbox.status.toLowerCase()==="ready"||void 0,"data-wakeable":v||void 0,children:e.description}):e.runtime&&c?o.jsx("span",{className:"my-agent-deploying-badge",children:p("myAgents.deploying")}):x?o.jsx(Uo,{content:r==null?void 0:r.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:o.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:o.jsxs(ba,{className:"my-agent-compatibility-status",color:"secondary",variant:"soft",size:"sm",pill:!0,children:[o.jsx("span",{className:"my-agent-compatibility-spinner","aria-hidden":"true"}),o.jsx("span",{children:p("myAgents.checking")})]})})}):O?o.jsx(Uo,{content:r==null?void 0:r.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:o.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:o.jsx(ba,{className:"my-agent-compatibility-status",color:"warning",variant:"soft",size:"sm",pill:!0,children:p("myAgents.chatUnsupported")})})}):w?o.jsx(Uo,{content:r==null?void 0:r.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:o.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:o.jsx(ba,{className:"my-agent-compatibility-status",color:"danger",variant:"soft",size:"sm",pill:!0,children:p("myAgents.checkFailed")})})}):null}),e.sandbox?null:o.jsx(IB,{children:e.description})]})}function HLt({cloudProvider:e,studioRegion:t,canCreateRuntimeAgents:n,canCreatePersonalAgents:i,canUpdate:r,runtimeScope:s,onCreateAgent:a,onOpenCodexProjectUpload:l,onUseAgent:c,onViewAgentDetails:u,onCreateSandboxAgent:d,onUseSandboxAgent:f,onViewSandboxAgentDetails:h,activeType:p,onActiveTypeChange:g,sandboxRefreshKey:b=0,connectedRuntimeId:v="",hiddenRuntimeIds:y=ILt,drafts:x=[],deploymentTasks:O=[],draftDeploymentTaskIds:w={},onViewDeploymentTask:k,onEditDraft:S,onDeleteDraft:E}){const{t:C}=Ae("ui"),N=m.useRef(null),_=m.useRef(null),j=m.useRef(0),A=m.useRef(null),F=m.useRef(0),T=m.useRef(null),P=m.useRef(new Map),R=QLt(t,e),[L,M]=m.useState(""),[U,I]=m.useState(s==="mine"?"mine":"all"),[H,K]=m.useState(R),[Q,q]=m.useState([]),[B,ee]=m.useState(""),[le,se]=m.useState(!0),[re,ge]=m.useState(""),[W,X]=m.useState([]),[ae,ue]=m.useState(!1),[Oe,Se]=m.useState(""),[lt,$e]=m.useState(""),[Le,Ne]=m.useState({}),[qe,Re]=m.useState(null),[ze,Ee]=m.useState(()=>Date.now()),De=m.useMemo(()=>ELt.map(Me=>({value:Me,label:C(`myAgents.agentTypes.${Me}`)})),[C]),J=m.useMemo(()=>{const Me=Iu(e);return Me.some(Ye=>Ye.value===R)?Me:[{value:R,label:R},...Me]},[e,R]);m.useEffect(()=>{s==="mine"&&I("mine")},[s]),m.useEffect(()=>{K(R)},[R]),m.useEffect(()=>{Ee(Date.now());const Me=window.setInterval(()=>Ee(Date.now()),1e3);return()=>window.clearInterval(Me)},[]);const he=m.useMemo(()=>x.map(Me=>BLt(Me,C)),[x,C]),Ce=m.useMemo(()=>{const Me=new Map,Ye=new Map,et=new Map;for(const xe of O){if(xe.status!=="running")continue;if(Me.set(xe.id,xe),xe.draftId){const Ke=Ye.get(xe.draftId);(!Ke||xe.startedAt>Ke.startedAt)&&Ye.set(xe.draftId,xe)}if(!xe.runtimeId)continue;const He=et.get(xe.runtimeId);(!He||xe.startedAt>He.startedAt)&&et.set(xe.runtimeId,xe)}return{byId:Me,byDraftId:Ye,byRuntimeId:et}},[O]),Ze=m.useCallback(Me=>{var et;if(Me.draft){const xe=w[Me.draft.id];return Ce.byDraftId.get(Me.draft.id)??(xe?Ce.byId.get(xe):void 0)}const Ye=(et=Me.runtime)==null?void 0:et.runtimeId;return Ye?Ce.byRuntimeId.get(Ye):void 0},[Ce,w]),at=m.useCallback((Me,Ye)=>{var He;(He=A.current)==null||He.abort(),Vp.clear();const et=new AbortController;A.current=et;const xe=++j.current;return se(!0),ge(""),zLt(U,H,Me,Ke=>{j.current===xe&&q(yt=>Ye?Ke:[...yt,...Ke])},C,et.signal).then(Ke=>{j.current===xe&&ee(Ke)}).catch(Ke=>{j.current===xe&&(wte(Ke)||ge(Rg(Ke,C("myAgents.loadGeneralAgents"),"GET /web/runtimes")))}).finally(()=>{j.current===xe&&se(!1),A.current===et&&(A.current=null)})},[U,H,C]);m.useEffect(()=>{if(p==="general")return q([]),ee(""),at("",!0),()=>{var Me;(Me=A.current)==null||Me.abort(),A.current=null,Vp.clear(),j.current+=1}},[p,at]),m.useEffect(()=>{if(p!=="general"){for(const et of P.current.values())et.abort();P.current.clear();return}const Me=new Set(Q.filter(et=>{var xe,He;return((xe=et.runtime)==null?void 0:xe.runtimeId)!==v&&((He=et.runtime)==null?void 0:He.region)===H}).map(lg).filter(Boolean));for(const[et,xe]of P.current)Me.has(et)||(xe.abort(),P.current.delete(et));const Ye=Q.filter(et=>{var yt,Dt,ln;const xe=(yt=et.runtime)==null?void 0:yt.runtimeId;if(!xe||xe===v||((Dt=et.runtime)==null?void 0:Dt.region)!==H)return!1;const He=lg(et),Ke=(ln=Le[He])==null?void 0:ln.status;return!P.current.has(He)&&(!Ke||Ke==="checking")});for(const et of Ye)P.current.set(lg(et),new AbortController);Ne(et=>{var Ke,yt;let xe=!1;const He={...et};for(const Dt of Q){const ln=lg(Dt);if(!ln)continue;const Xt=((Ke=Dt.runtime)==null?void 0:Ke.runtimeId)===v;Xt&&((yt=He[ln])==null?void 0:yt.status)!=="compatible"?(He[ln]={status:"compatible",message:C("myAgents.compatibility.supported")},xe=!0):!Xt&&!He[ln]&&(He[ln]={status:"checking",message:C("myAgents.compatibility.checking")},xe=!0)}return xe?He:et}),uLt(Ye,async et=>{const xe=et.runtime;if(!xe)return;const He=lg(et),Ke=P.current.get(He);if(Ke)try{const yt=await Fv(xe.runtimeId,xe.region,{signal:Ke.signal,preferCached:!0,timeoutMs:ALt,currentVersion:xe.currentVersion});if(Ke.signal.aborted)return;Ne(Dt=>({...Dt,[He]:yt&&yt.length>0?{status:"compatible",message:C("myAgents.compatibility.supported")}:{status:"unsupported",message:C("myAgents.compatibility.empty")}}))}catch(yt){if(Ke.signal.aborted||(yt==null?void 0:yt.name)==="AbortError")return;Ne(Dt=>({...Dt,[He]:Rte(yt,C)}))}finally{P.current.get(He)===Ke&&P.current.delete(He)}})},[p,v,H,Q,C]),m.useEffect(()=>()=>{var Me;(Me=A.current)==null||Me.abort();for(const Ye of P.current.values())Ye.abort();P.current.clear()},[]);const St=m.useCallback(async Me=>{var xe;(xe=T.current)==null||xe.abort();const Ye=new AbortController;T.current=Ye;const et=++F.current;ue(!0),Se(""),X([]);try{const He=Me==="codex"?await dr.listSessions({signal:Ye.signal,autoResumeSnapshots:!0}):await dr.listAgentSessions(Me,{signal:Ye.signal,autoResumeSnapshots:!0});if(F.current!==et)return;X(He.map(Ke=>FLt(Ke,C)))}catch(He){if((He==null?void 0:He.name)==="AbortError"||F.current!==et)return;Se(Rg(He,C("myAgents.loadAgentType",{type:C(`myAgents.agentTypes.${Me}`)}),`GET /web/${Me==="codex"?"sandbox":Me}/sessions`))}finally{T.current===Ye&&(T.current=null),F.current===et&&ue(!1)}},[C]);function Te(Me){var Ye;Me!==p&&(Me==="general"?(j.current+=1,q([]),ee(""),ge(""),se(!0)):((Ye=T.current)==null||Ye.abort(),T.current=null,F.current+=1,X([]),Se(""),ue(!0)),g(Me))}function ye(){p==="general"&&(j.current+=1,q([]),ee(""),ge(""),se(!0))}function Ve(Me){Me!==U&&(ye(),I(Me))}function nt(Me){Me!==H&&(ye(),K(Me))}m.useEffect(()=>{var Me;if(p==="general"){(Me=T.current)==null||Me.abort(),T.current=null,F.current+=1;return}return St(p),()=>{var Ye;(Ye=T.current)==null||Ye.abort(),T.current=null,F.current+=1}},[p,St,b]),m.useEffect(()=>{const Me=_.current,Ye=N.current;if(!Me||!Ye||p!=="general"||!B||le)return;const et=new IntersectionObserver(([xe])=>{xe.isIntersecting&&at(B,!1)},{root:Ye,rootMargin:"240px 0px",threshold:.01});return et.observe(Me),()=>et.disconnect()},[p,at,le,B]);const ke=m.useCallback(async Me=>{if(!lt){$e(Me.id);try{await new Promise(Ye=>requestAnimationFrame(()=>Ye())),Me.sandbox?await f(Me.sandbox):await c(Me)}finally{$e("")}}},[lt,c,f]),Ht=m.useCallback(async Me=>{var He;const Ye=Me.runtime;if(!Ye)return;const et=lg(Me);Ne(Ke=>({...Ke,[et]:{status:"checking",message:C("myAgents.compatibility.checking")}})),(He=P.current.get(et))==null||He.abort();const xe=new AbortController;P.current.set(et,xe);try{const Ke=await xje(()=>Fv(Ye.runtimeId,Ye.region,{retryProbe:!0,signal:xe.signal,timeoutMs:_Lt,currentVersion:Ye.currentVersion}));if(xe.signal.aborted)return;Ne(yt=>({...yt,[et]:Ke&&Ke.length>0?{status:"compatible",message:C("myAgents.compatibility.supported")}:{status:"unsupported",message:C("myAgents.compatibility.empty")}}))}catch(Ke){if(xe.signal.aborted||wte(Ke))return;Ne(yt=>({...yt,[et]:Rte(Ke,C)}))}finally{P.current.get(et)===xe&&P.current.delete(et)}},[C]),on=m.useCallback(Me=>{const Ye=Me.runtime;!r||!Ye||Ze(Me)||T4({runtimeId:Ye.runtimeId,region:Ye.region,appName:Me.appName,currentVersion:Ye.currentVersion})},[r,Ze]),Yt=m.useMemo(()=>{const Me=L.trim().toLocaleLowerCase(),Ye=p==="general"?[...he,...Q]:W,xe=(U==="mine"?Ye.filter(Dt=>Dt.isMine):Ye).filter(Dt=>{var Xt;const ln=((Xt=Dt.runtime)==null?void 0:Xt.region)??Dt.region;return!ln||ln===H}),He=Me?xe.filter(Dt=>Dt.name.toLocaleLowerCase().includes(Me)):xe;if(p!=="general")return He;const Ke=y.size>0?He.filter(Dt=>!Dt.runtime||!y.has(Dt.runtime.runtimeId)):He,yt=Ke.findIndex(Dt=>{var ln;return((ln=Dt.runtime)==null?void 0:ln.runtimeId)===v});return yt<=0?Ke:[Ke[yt],...Ke.slice(0,yt),...Ke.slice(yt+1)]},[p,v,he,y,L,U,H,Q,W]);m.useEffect(()=>{if(!r||p!=="general")return;const Me=Yt.filter(Ke=>!!Ke.runtime).filter(Ke=>!Ze(Ke)).slice(0,NLt);if(Me.length===0)return;let Ye=!1,et=0;const xe=async()=>{for(;!Ye;){const Ke=Me[et];if(et+=1,!(Ke!=null&&Ke.runtime)||(await T4({runtimeId:Ke.runtime.runtimeId,region:Ke.runtime.region,appName:Ke.appName,currentVersion:Ke.runtime.currentVersion}),Ye))return}},He=window.setTimeout(()=>{for(let Ke=0;Ke{Ye=!0,window.clearTimeout(He)}},[p,r,Ze,Yt]);const xt=C(`myAgents.agentTypes.${p}`,{defaultValue:C("myAgents.agent")}),Pt=p==="general"?le&&Q.length===0&&he.length===0:ae&&W.length===0,ct=!Pt&&Yt.length===0,Pe=(p==="general"?n:i)?p==="general"?()=>a(H):()=>d(p):void 0,kt=p==="codex"&&i&&!!l;return o.jsxs(Th,{className:"my-agents-page","aria-label":C("myAgents.agent"),children:[o.jsx(zx,{title:C("myAgents.agent"),className:"my-agents-header"}),o.jsxs(Zb,{className:"my-agent-toolbar",children:[o.jsx(dE,{idPrefix:"my-agent-ownership",ariaLabel:C("myAgents.creatorFilter"),value:U,items:[{id:"all",label:C("common.all"),disabled:s==="mine"},{id:"mine",label:C("agentSelector.createdByMe")}],onChange:Ve}),o.jsxs("div",{className:"resource-toolbar__actions",children:[o.jsx(lN,{id:"my-agent-type-filter",ariaLabel:C("myAgents.agentType"),value:p,options:De,onChange:Te}),o.jsx(lN,{id:"my-agent-region-filter",ariaLabel:C("myAgents.region"),value:H,options:J,onChange:nt}),o.jsx(wm,{className:"my-agent-search","aria-label":C("myAgents.searchAgents"),value:L,onChange:Me=>M(Me.target.value),placeholder:C("common.search")}),kt?o.jsxs("button",{type:"button",className:"my-agent-create-secondary",onClick:l,children:[o.jsx(MLt,{}),o.jsx("span",{children:C("myAgents.handoff")})]}):null]})]}),o.jsxs(Jb,{className:"my-agent-results",ref:N,"aria-label":C("myAgents.agentList",{type:xt}),children:[Pt?o.jsx(Ud,{}):(p==="general"?re:Oe)&&Yt.length===0?o.jsxs("div",{className:"my-agent-empty",role:"alert",children:[o.jsx("p",{children:p==="general"?re:Oe}),o.jsx("button",{type:"button",onClick:()=>{p==="general"?at("",!0):St(p)},children:C("common.reload")})]}):ct&&!Pe?L.trim()||U==="mine"||H!==R?o.jsx("div",{className:"my-agent-empty-message",children:o.jsxs(En,{fill:"none",children:[o.jsx(En.Icon,{children:o.jsx(UFe,{})}),o.jsx(En.Title,{children:C("myAgents.noMatchingAgents")}),o.jsx(En.Description,{children:C("myAgents.adjustSearch")})]})}):p!=="general"?o.jsx("div",{className:"my-agent-empty-message",children:o.jsxs(En,{fill:"none",children:[o.jsx(En.Icon,{children:o.jsx(LLt,{type:p})}),o.jsx(En.Title,{className:"my-agent-sandbox-empty-title",children:C("myAgents.noAgentType",{type:xt})})]})}):o.jsx("div",{className:"my-agent-empty-message",children:o.jsxs(En,{fill:"none",children:[o.jsx(En.Icon,{children:o.jsx(Yf,{})}),o.jsx(En.Title,{children:C("myAgents.noGeneralAgents")}),o.jsx(En.Description,{children:C("myAgents.createGeneralAgentDescription")})]})}):o.jsxs(o.Fragment,{children:[p==="general"&&re?o.jsxs("div",{className:"my-agent-inline-error",role:"alert",children:[o.jsx("span",{children:re}),o.jsx("button",{type:"button",onClick:()=>void at("",!0),children:C("common.reload")})]}):null,o.jsxs(Vx,{className:"my-agent-grid",children:[Pe?o.jsx(Cb,{className:"my-agent-create-card","aria-label":C("myAgents.createAgentType",{type:xt}),onClick:Pe,icon:o.jsx(PLt,{}),children:C("myAgents.createAgent")}):null,Yt.map(Me=>{var et;const Ye=ULt(Me,Q,C);return o.jsx(VLt,{agent:Me,deploymentTask:Ze(Me),nowMs:ze,onViewDeploymentTask:k,onUse:ke,compatibility:Me.runtime?Le[lg(Me)]??{status:"checking",message:C("myAgents.compatibility.checking")}:void 0,onRetryCompatibility:Ht,onPrepareUpdate:on,onViewDetails:Ye?()=>{Ye.sandbox?h(Ye.sandbox):u(Ye)}:void 0,connecting:Me.id===lt,connected:((et=Me.runtime)==null?void 0:et.runtimeId)===v,onEditDraft:S,onDeleteDraft:Re},Me.id)})]})]}),p==="general"&&!re&&!Pt&&(Yt.length>0||!!B)&&o.jsx("div",{className:"my-agent-load-more",ref:_,"aria-live":"polite",children:le?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:C("myAgents.loadingMore")})]}):B?o.jsx("span",{children:C("myAgents.scrollForMore")}):o.jsx("span",{children:C("myAgents.allLoaded")})})]}),qe?o.jsx(pc,{title:C("myAgents.deleteDraftTitle"),description:C("myAgents.deleteDraftDescription",{name:qe.draft.name||C("agentSelector.unnamedAgent")}),confirmLabel:C("myAgents.deleteDraft"),variant:"danger",onCancel:()=>Re(null),onConfirm:()=>{E==null||E(qe),Re(null)}}):null]})}const qLt="_Container_13560_1",WLt="_Textarea_13560_174",Pte={Container:qLt,Textarea:WLt},Rm=e=>{const t=m.useRef(null),i=`search-ui-input-${m.useId()}`,{id:r,name:s,variant:a="outline",size:l="md",gutterSize:c,className:u,autoComplete:d,disabled:f=!1,readOnly:h=!1,invalid:p=!1,allowAutofillExtensions:g=!!s,onFocus:b,onBlur:v,onAnimationStart:y,onAutofill:x,autoSelect:O,rows:w=3,maxRows:k,autoResize:S,ref:E,onChange:C,...N}=e,[_,j]=m.useState(!1),A=S?Math.max(k??10,w):w;m.useEffect(()=>{var P;O&&((P=t.current)==null||P.select())},[O]);const F=P=>{y==null||y(P),P.animationName==="native-autofill-in"&&(x==null||x())},T=m.useCallback(()=>{if(!S||!t.current||A===void 0)return;t.current.style.height="0px";const P=t.current.scrollHeight;t.current.style.height=P+"px"},[S,A]);return m.useEffect(()=>{T()},[e.value,w,T]),o.jsx("div",{className:pi(Pte.Container,u),"data-variant":a,"data-size":l,"data-gutter-size":c,"data-focused":_,"data-disabled":f?"":void 0,"data-readonly":h?"":void 0,"data-invalid":p?"":void 0,style:Wb({"textarea-min-rows":`${w}`,"textarea-max-rows":`${A}`}),children:o.jsx("textarea",{...N,onChange:P=>{C==null||C(P),T()},ref:Zk([t,E]),id:r||(g?void 0:i),className:Pte.Textarea,name:s,readOnly:h,disabled:f,rows:w,onFocus:P=>{j(!0),b==null||b(P)},onBlur:P=>{j(!1),v==null||v(P)},onAnimationStart:F,"data-lpignore":g?void 0:!0,"data-1p-ignore":g?void 0:!0})})},UI="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",GLt="data:image/svg+xml,%3c?xml%20version='1.0'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20100%20100'%3e%3ctitle%3ePandoc%20Icon%3c/title%3e%3cdesc%20property='dc:creator'%3eAlbert%20Krewinkel%3c/desc%3e%3cmetadata%20id='license'%20xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23'%20xmlns:dc='http://purl.org/dc/elements/1.1/'%20xmlns:cc='http://creativecommons.org/ns%23'%3e%3crdf:RDF%3e%3ccc:Work%20rdf:about=''%3e%3cdc:format%3eimage/svg+xml%3c/dc:format%3e%3cdc:type%20rdf:resource='http://purl.org/dc/dcmitype/StillImage'%20/%3e%3ccc:license%20rdf:resource='http://creativecommons.org/licenses/by-sa/4.0/'%20/%3e%3c/cc:Work%3e%3ccc:License%20rdf:about='http://creativecommons.org/licenses/by-sa/4.0/'%3e%3ccc:permits%20rdf:resource='http://creativecommons.org/ns%23Reproduction'%20/%3e%3ccc:permits%20rdf:resource='http://creativecommons.org/ns%23Distribution'%20/%3e%3ccc:requires%20rdf:resource='http://creativecommons.org/ns%23Notice'%20/%3e%3ccc:requires%20rdf:resource='http://creativecommons.org/ns%23Attribution'%20/%3e%3ccc:permits%20rdf:resource='http://creativecommons.org/ns%23DerivativeWorks'%20/%3e%3ccc:requires%20rdf:resource='http://creativecommons.org/ns%23ShareAlike'%20/%3e%3c/cc:License%3e%3c/rdf:RDF%3e%3c/metadata%3e%3crect%20fill='%23fed'%20stroke='%23fed'%20width='100'%20height='100'/%3e%3cg%20fill='none'%20stroke='%234093da'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='8'%20transform='skewX(-6)%20translate(8%201)'%3e%3cpath%20d='M%2030,10%20l%200,80%20M%2045,10%20l%200,80%20M%2020,10%20l%2040,0%20l%2018,18%20l%200,25%20l%20-33,0'%20/%3e%3cpath%20fill='%234093da'%20stroke-width='6'%20d='M%2061,10%20l%2017,17%20l%20-17,0%20l%200,-17'%20/%3e%3c/g%3e%3c/svg%3e",KLt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%20100%20100'%20version='1.1'%20id='svg4'%20sodipodi:docname='favicon.svg'%20inkscape:version='1.4.4%20(dcaf3e7,%202026-05-05)'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:svg='http://www.w3.org/2000/svg'%3e%3csodipodi:namedview%20id='namedview4'%20pagecolor='%23ffffff'%20bordercolor='%23000000'%20borderopacity='0.25'%20inkscape:showpageshadow='2'%20inkscape:pageopacity='0.0'%20inkscape:pagecheckerboard='0'%20inkscape:deskcolor='%23d1d1d1'%20showgrid='true'%20inkscape:zoom='8.2236519'%20inkscape:cx='34.534536'%20inkscape:cy='45.174577'%20inkscape:window-width='1881'%20inkscape:window-height='1382'%20inkscape:window-x='1512'%20inkscape:window-y='30'%20inkscape:window-maximized='0'%20inkscape:current-layer='svg4'%3e%3cinkscape:grid%20type='axonomgrid'%20id='grid4'%20units='px'%20originx='0'%20originy='0'%20spacingx='3.7795276'%20spacingy='3.7795276'%20empcolor='%230099e5'%20empopacity='0.30196078'%20color='%230099e5'%20opacity='0.14901961'%20empspacing='0'%20dotted='false'%20gridanglex='40'%20gridanglez='40'%20enabled='true'%20visible='true'%20/%3e%3c/sodipodi:namedview%3e%3cdefs%20id='defs1'%3e%3cfilter%20id='shadow'%20x='0'%20y='0'%20width='1'%20height='1'%3e%3cfeDropShadow%20dx='0'%20dy='2'%20stdDeviation='3'%20flood-color='rgba(50,%2050,%2093,%200.18)'%20/%3e%3c/filter%3e%3c/defs%3e%3crect%20x='4'%20y='4'%20width='92'%20height='92'%20rx='22.08'%20fill='%23e8efff'%20filter='url(%23shadow)'%20id='rect1'%20transform='matrix(1.0869565,0,0,1.0869565,-4.347826,-4.347826)'%20style='stroke-width:0.92'%20ry='22.08'%20/%3e%3cpath%20style='fill:%230a2540;fill-opacity:1;stroke-width:1.88976'%20d='M%2049.999999,6.535431%204.9573423,44.330708%2049.999999,82.125984%2092.790523,46.220471%2095.042656,44.330708%20Z'%20id='path1'%20/%3e%3cpath%20style='fill:%23425466;fill-opacity:1;stroke-width:1.88976'%20d='M%204.9573423,44.330708%20V%2055.669291%20L%2049.999999,93.464567%20V%2082.125984%20Z'%20id='path2'%20/%3e%3cpath%20style='fill:%231a3550;fill-opacity:1;stroke-width:1.88976'%20d='M%2049.999999,82.125984%2095.042656,44.330708%20V%2055.669291%20L%2049.999999,93.464567%20Z'%20id='path3'%20/%3e%3cpath%20style='fill:%234ade80;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;fill-opacity:1'%20d='m%2045.042657,30.236221%209.008531,-7.559055%2022.521328,18.897638%20-9.008531,7.559056%20z'%20id='path5'%20/%3e%3cpath%20style='fill:none;fill-opacity:1;stroke:%234ade80;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1'%20d='M%2027.025594,49.133859%2047.29479,47.244096%2045.042657,64.25197'%20id='path6'%20/%3e%3c/svg%3e",XLt="data:image/svg+xml,%3csvg%20fill='%23261230'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eAstral%3c/title%3e%3cpath%20d='M1.44%200C.6422%200%200%20.6422%200%201.44v21.12C0%2023.3578.6422%2024%201.44%2024h21.12c.7978%200%201.44-.6422%201.44-1.44V1.44C24%20.6422%2023.3578%200%2022.56%200Zm4.7998%204.8h11.5199c.7953%200%201.44.6447%201.44%201.44V19.2h-6.624v-4.32h-1.152v4.32H4.8V6.24c0-.7953.6446-1.44%201.4398-1.44m4.032%205.472v1.152h3.456v-1.152z'/%3e%3c/svg%3e",YLt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='1.34em'%20height='1em'%20viewBox='0%200%20256%20192'%3e%3cpath%20fill='%232d4552'%20d='M84.38%20108.352c-9.556%202.712-15.826%207.467-19.956%2012.218c3.956-3.461%209.255-6.639%2016.402-8.665c7.311-2.072%2013.548-2.057%2018.702-1.062v-4.03c-4.397-.402-9.437-.082-15.148%201.539M63.987%2074.475l-35.49%209.35s.646.914%201.844%202.133l30.092-7.93s-.427%205.495-4.13%2010.41c7.005-5.299%207.684-13.963%207.684-13.963m29.709%2083.41c-49.946%2013.452-76.37-44.43-84.37-74.472c-3.696-13.868-5.31-24.37-5.74-31.148a11.5%2011.5%200%200%201%20.025-1.84C1.021%2050.58-.22%2051.927.032%2055.82c.43%206.773%202.044%2017.275%205.74%2031.147c7.997%2030.038%2034.424%2087.92%2084.37%2074.468c10.871-2.929%2019.038-8.263%2025.17-15.073c-5.652%205.104-12.724%209.123-21.616%2011.523M103.08%2039.05v3.555h19.59c-.401-1.259-.806-2.393-1.208-3.555z'/%3e%3cpath%20fill='%232d4552'%20d='M127.05%2068.325c8.81%202.503%2013.47%208.68%2015.933%2014.146l9.824%202.79s-1.34-19.132-18.645-24.047c-16.189-4.6-26.151%208.995-27.363%2010.754c4.71-3.355%2011.586-6.102%2020.251-3.643m78.197%2014.234c-16.204-4.62-26.162%209.003-27.356%2010.737c4.713-3.351%2011.586-6.099%2020.247-3.629c8.797%202.506%2013.452%208.676%2015.923%2014.146l9.837%202.8s-1.361-19.135-18.651-24.054m-9.76%2050.443l-81.718-22.845s.885%204.485%204.279%2010.293l68.803%2019.234c5.664-3.277%208.636-6.682%208.636-6.682m-56.655%2049.174C74.127%20164.828%2081.949%2082.386%2092.419%2043.32c4.311-16.1%208.743-28.066%2012.419-36.088c-2.193-.451-4.01.704-5.804%204.354C95.13%2019.5%2090.14%2032.387%2085.312%2050.427c-10.467%2039.066-18.29%20121.506%2046.412%20138.854c30.497%208.17%2054.256-4.247%2071.966-23.749c-16.81%2015.226-38.274%2023.763-64.858%2016.644'/%3e%3cpath%20fill='%23e2574c'%20d='M103.081%20138.565v-16.637l-46.223%2013.108s3.415-19.846%2027.522-26.684c7.311-2.072%2013.549-2.058%2018.701-1.063V39.05h23.145c-2.52-7.787-4.958-13.782-7.006-17.948c-3.387-6.895-6.859-2.324-14.741%204.269c-5.552%204.638-19.583%2014.533-40.698%2020.222c-21.114%205.694-38.185%204.184-45.307%202.95c-10.097-1.742-15.378-3.96-14.884%203.721c.43%206.774%202.043%2017.277%205.74%2031.148c7.996%2030.039%2034.424%2087.92%2084.37%2074.468c13.046-3.515%2022.254-10.464%2028.637-19.32h-19.256zm-74.588-54.74l35.494-9.35s-1.034%2013.654-14.34%2017.162c-13.31%203.504-21.154-7.812-21.154-7.812'/%3e%3cpath%20fill='%232ead33'%20d='M236.664%2039.84c-9.226%201.617-31.361%203.632-58.716-3.7c-27.363-7.328-45.517-20.144-52.71-26.168c-10.197-8.54-14.682-14.476-19.096-5.498c-3.902%207.918-8.893%2020.805-13.723%2038.846c-10.466%2039.066-18.289%20121.505%2046.413%20138.853c64.687%2017.333%2099.126-57.978%20109.593-97.047c4.83-18.037%206.948-31.695%207.53-40.502c.665-9.976-6.187-7.08-19.29-4.784M106.668%2072.161s10.196-15.859%2027.49-10.943c17.305%204.915%2018.645%2024.046%2018.645%2024.046zm42.215%2071.163c-30.419-8.91-35.11-33.167-35.11-33.167l81.714%2022.846c0-.004-16.494%2019.12-46.604%2010.32m28.89-49.85s10.183-15.847%2027.474-10.918c17.29%204.923%2018.651%2024.054%2018.651%2024.054z'/%3e%3cpath%20fill='%23d65348'%20d='m86.928%20126.51l-30.07%208.522s3.266-18.609%2025.418-25.983L65.25%2045.147l-1.471.447c-21.115%205.694-38.185%204.184-45.307%202.95c-10.097-1.741-15.379-3.96-14.885%203.722c.43%206.774%202.044%2017.276%205.74%2031.147c7.997%2030.039%2034.425%2087.92%2084.37%2074.468l1.471-.462zM28.493%2083.825l35.494-9.351s-1.034%2013.654-14.34%2017.162c-13.31%203.504-21.154-7.811-21.154-7.811'/%3e%3cpath%20fill='%231d8d22'%20d='m150.255%20143.658l-1.376-.335c-30.419-8.91-35.11-33.166-35.11-33.166l42.137%2011.778l22.308-85.724l-.27-.07c-27.362-7.329-45.516-20.145-52.71-26.17c-10.196-8.54-14.682-14.475-19.096-5.497c-3.898%207.918-8.889%2020.805-13.719%2038.846c-10.466%2039.066-18.289%20121.505%2046.413%20138.852l1.326.3zM106.668%2072.16s10.196-15.859%2027.49-10.943c17.305%204.915%2018.645%2024.046%2018.645%2024.046z'/%3e%3cpath%20fill='%23c04b41'%20d='m88.46%20126.072l-8.064%202.289c1.906%2010.74%205.264%2021.047%2010.534%2030.152c.918-.202%201.828-.376%202.762-.632c2.449-.66%204.72-1.479%206.906-2.371c-5.89-8.74-9.785-18.804-12.137-29.438m-3.148-75.644c-4.144%2015.467-7.852%2037.73-6.831%2060.06c1.826-.793%203.756-1.532%205.9-2.14l1.492-.334c-1.82-23.852%202.114-48.157%206.546-64.694a323%20323%200%200%201%203.373-11.704a105%20105%200%200%201-5.974%203.547a307%20307%200%200%200-4.506%2015.265'/%3e%3c/svg%3e",ZLt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='512'%20height='512'%20version='1.1'%20viewBox='0%200%20135.47%20135.47'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m67.733%2067.733%2029.33%2016.933-29.33%2050.8c37.408%200%2067.733-30.325%2067.733-67.733%200-12.341-3.3168-23.901-9.0837-33.867h-58.65z'%20fill='%23afccf9'/%3e%3cpath%20d='m67.733-1e-6c-25.07%200-46.942%2013.63-58.654%2033.875l29.324%2050.792%2029.33-16.933v-33.867h58.65c-11.714-20.24-33.583-33.867-58.65-33.867z'%20fill='%231767d1'/%3e%3cpath%20d='m0%2067.733c0%2037.408%2030.324%2067.733%2067.733%2067.733l29.33-50.8-29.33-16.933-29.33%2016.933-29.324-50.792c-5.7637%209.9632-9.0794%2021.519-9.0794%2033.858'%20fill='%23679ef5'/%3e%3cpath%20d='m101.6%2067.733c0%2018.704-15.163%2033.867-33.867%2033.867-18.704%200-33.867-15.163-33.867-33.867s15.163-33.867%2033.867-33.867c18.704%200%2033.867%2015.163%2033.867%2033.867'%20fill='%23fff'/%3e%3cpath%20d='m95.25%2067.733c0%2015.197-12.32%2027.517-27.517%2027.517-15.197%200-27.517-12.32-27.517-27.517%200-15.197%2012.32-27.517%2027.517-27.517%2015.197%200%2027.517%2012.32%2027.517%2027.517'%20fill='%231a74e7'/%3e%3c/svg%3e",JLt="data:image/svg+xml,%3csvg%20fill='%23F03C2E'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGit%3c/title%3e%3cpath%20d='M13.09%2023.549a1.54%201.54%200%200%201-2.18%200L.451%2013.089a1.54%201.54%200%200%201%200-2.179l7.191-7.19%202.733%202.733a1.85%201.85%200%200%200%20.964%202.326v6.66a1.849%201.849%200%201%200%201.54%200V8.957l2.508%202.508a1.85%201.85%200%201%200%201.09-1.09l-2.634-2.634a1.85%201.85%200%200%200-2.378-2.377L8.73%202.63%2010.91.451a1.54%201.54%200%200%201%202.179%200l10.459%2010.46a1.54%201.54%200%200%201%200%202.179z'/%3e%3c/svg%3e",e3t="data:image/svg+xml,%3csvg%20fill='%23073551'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3ecurl%3c/title%3e%3cpath%20d='M.803%2014.8169c0-.5342.433-.9665.9665-.9665.5335%200%20.9665.4323.9665.9665%200%20.5335-.433.9657-.9665.9657-.5335%200-.9666-.4322-.9666-.9657m2.736%200c0-.1963-.0532-.376-.1119-.5525-.2344-.7024-.876-1.2169-1.6575-1.2169-.1249%200-.2344.0465-.3524.0708C.6149%2013.2865%200%2013.9646%200%2014.817c0%20.9764.7923%201.7694%201.7695%201.7694.9772%200%201.7694-.793%201.7694-1.7694m-1.7694-7.149c.5335%200%20.9665.433.9665.9665%200%20.5335-.433.9665-.9665.9665-.5343%200-.9666-.433-.9666-.9665%200-.5335.4323-.9665.9666-.9665m0%202.7359c.9772%200%201.7694-.7923%201.7694-1.7694%200-.1956-.0532-.376-.1119-.5525-.2344-.7024-.8767-1.2169-1.6575-1.2169-.1249%200-.2344.0465-.3524.0716C.6149%207.104%200%207.782%200%208.6344c0%20.9771.7923%201.7694%201.7695%201.7694m13.221-5.694c-.5342%200-.9665-.433-.9665-.9664a.966.966%200%2001.9666-.9665c.5335%200%20.9658.4322.9658.9665%200%20.5334-.4323.9664-.9658.9664m-9.6%2016.5133c-.5335%200-.9666-.433-.9666-.9665%200-.5342.433-.9665.9666-.9665a.966.966%200%2001.9665.9665c0%20.5335-.4323.9665-.9665.9665m9.6-19.2491c-.978%200-1.7695.7922-1.7695%201.7694%200%20.2085.0525.4025.1187.5882L5.039%2018.5581c-.803.1681-1.4179.8462-1.4179%201.6985%200%20.9772.7923%201.7694%201.7695%201.7694.9772%200%201.7694-.7922%201.7694-1.7694%200-.1963-.0525-.3759-.111-.5525l8.3427-14.2728c.7778-.1865%201.3683-.8531%201.3683-1.688%200-.977-.793-1.7693-1.7694-1.7693m7.24%202.7359c-.5343%200-.9666-.433-.9666-.9665a.966.966%200%2001.9665-.9665c.5335%200%20.9666.4322.9666.9665%200%20.5334-.433.9665-.9666.9665M12.6313%2021.223c-.5343%200-.9665-.433-.9665-.9665a.966.966%200%2001.9665-.9665c.5335%200%20.9658.4323.9658.9665%200%20.5335-.4323.9665-.9658.9665M22.2305%201.974c-.9772%200-1.7694.7922-1.7694%201.7694%200%20.2085.0525.4025.1187.5882l-8.3009%2014.2265c-.8021.1681-1.417.8462-1.417%201.6985%200%20.9772.7922%201.7694%201.7694%201.7694.9764%200%201.7687-.7922%201.7687-1.7694%200-.1963-.0525-.3759-.1111-.5525l8.3427-14.2728C23.4094%205.2448%2024%204.5782%2024%203.7433c0-.977-.7923-1.7693-1.7695-1.7693'/%3e%3c/svg%3e",t3t="data:image/svg+xml,%3csvg%20fill='%23007808'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eFFmpeg%3c/title%3e%3cpath%20d='M21.72%2017.91V6.5l-.53-.49L9.05%2018.52l-1.29-.06L24%201.53l-.33-.95-11.93%201-5.75%206.6v-.23l4.7-5.39-1.38-.77-9.11.77v2.85l1.91.46v.01l.19-.01-.56.66v10.6c.609-.126%201.22-.241%201.83-.36L14.12%205.22l.83-.04L0%2021.44l9.67.82%201.35-.77%206.82-6.74v2.15l-5.72%205.57%2011.26.95.35-.94v-3.16l-3.29-.18c.434-.403.858-.816%201.28-1.23z'/%3e%3c/svg%3e",n3t="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%201080%201080'%3e%3c!--%20Generator:%20Adobe%20Illustrator%2030.3.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.3%20Build%20182)%20--%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20fill:%20%23ff0;%20}%20.st1%20{%20fill:%20%23333;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='st0'%20d='M660.52,419.49l-195.15-52.98c-15.84-4.3-19.16-25.29-5.43-34.28l169.23-110.7-9.91-201.97c-.8-16.39,18.13-26.04,30.92-15.76l157.57,126.74,189.03-71.84c15.34-5.83,30.37,9.2,24.54,24.54l-71.84,189.03,126.74,157.57c10.29,12.79.64,31.73-15.76,30.92l-201.97-9.91-110.7,169.23c-8.98,13.73-29.98,10.41-34.28-5.43l-52.98-195.15h-.01Z'/%3e%3cpath%20class='st1'%20d='M603.34,476.66l32.94,121.68,4.45,16.23-429.11,429.11c-48.45,48.45-126.85,48.45-175.3,0C12.16,1019.51,0,987.89,0,956.15s12.02-63.48,36.31-87.77l429.11-429.11,16.35,4.33,121.56,33.06h0Z'/%3e%3c/svg%3e";function XQ(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...e,children:o.jsx("path",{d:"M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91 .58 .11 .79-.25.79-.56v-2.02c-3.2.7-3.88-1.36-3.88-1.36-.52-1.33-1.28-1.69-1.28-1.69-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.03 1.77 2.71 1.26 3.37.96.1-.75.4-1.26.73-1.55-2.56-.29-5.25-1.28-5.25-5.7 0-1.26.45-2.29 1.19-3.1-.12-.29-.52-1.47.11-3.06 0 0 .97-.31 3.16 1.18A10.98 10.98 0 0 1 12 6.11c.98 0 1.96.13 2.87.39 2.19-1.49 3.16-1.18 3.16-1.18.63 1.59.23 2.77.11 3.06.74.81 1.19 1.84 1.19 3.1 0 4.43-2.7 5.4-5.27 5.69.42.36.78 1.06.78 2.14v3.04c0 .31.21.67.8.56A11.51 11.51 0 0 0 23.5 12C23.5 5.65 18.35.5 12 .5Z"})})}vo.registerLanguage("bash",ZB);const i3t=48;function r3t(e,t=i3t){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function s3t(e){return vo.highlight(e,{language:"bash",ignoreIllegals:!0}).value}function a3t({status:e}){return e==="succeeded"?o.jsx(Vu,{"aria-hidden":!0}):e==="failed"?o.jsx(f4,{"aria-hidden":!0}):e==="running"?o.jsx(fi,{className:"studio-build-progress__spinner","aria-hidden":!0}):o.jsx(u7e,{"aria-hidden":!0})}function Dte(e,t){if(!e)return"";const n=Date.parse(e);return Number.isNaN(n)?"":new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(n)}function o3t({steps:e,log:t,logError:n="",logTruncated:i=!1,logUpdatedAt:r,loading:s=!1}){const{t:a,i18n:l}=Ae("ui"),c=m.useRef(null),u=m.useRef(!0),[d,f]=m.useState(!1),h=m.useMemo(()=>s3t(t),[t]);m.useEffect(()=>{const g=c.current;g&&t&&u.current&&(g.scrollTop=g.scrollHeight)},[t]);const p=async()=>{try{await navigator.clipboard.writeText(t),f(!0),window.setTimeout(()=>f(!1),1500)}catch{f(!1)}};return o.jsxs("div",{className:"studio-build-progress",children:[o.jsx("ol",{className:"studio-build-progress__steps","aria-label":a("studioBuildProgress.steps"),children:e.map(g=>o.jsxs("li",{className:`is-${g.status}`,children:[o.jsx("span",{className:"studio-build-progress__step-icon",children:o.jsx(a3t,{status:g.status})}),o.jsx("span",{children:g.label})]},g.key))}),o.jsxs("section",{className:"studio-build-progress__log","aria-label":a("studioBuildProgress.log"),children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:a("studioBuildProgress.log")}),o.jsxs("span",{children:[a(s?"studioBuildProgress.syncing":n?"studioBuildProgress.loadFailed":"studioBuildProgress.synced"),i?a("studioBuildProgress.recentOnly"):"",Dte(r,l.resolvedLanguage??l.language)?` · ${Dte(r,l.resolvedLanguage??l.language)}`:""]})]}),o.jsxs(zt,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:!t,onClick:()=>void p(),"aria-label":a(d?"studioBuildProgress.copiedLog":"studioBuildProgress.copyLog"),children:[d?o.jsx(Vu,{"aria-hidden":!0}):o.jsx(Xj,{"aria-hidden":!0}),a(d?"studioBuildProgress.copied":"studioBuildProgress.copy")]})]}),t?o.jsx("pre",{ref:c,tabIndex:0,"aria-label":a("studioBuildProgress.logContent"),onScroll:g=>{u.current=r3t(g.currentTarget)},children:o.jsx("code",{className:"hljs language-bash",dangerouslySetInnerHTML:{__html:h}})}):o.jsx("div",{className:`studio-build-progress__log-empty${n?" is-error":""}`,children:n||a(s?"studioBuildProgress.waiting":"studioBuildProgress.empty")})]})]})}function Mte({name:e,description:t,icon:n,selected:i,disabled:r=!1,onChange:s,className:a=""}){return o.jsxs("button",{type:"button",className:`studio-package-option${i?" is-selected":""}${a?` ${a}`:""}`,"aria-pressed":i,disabled:r,onClick:()=>s(!i),children:[o.jsx("span",{className:"studio-package-option__icon","aria-hidden":"true",children:n}),o.jsxs("span",{className:"studio-package-option__content",children:[o.jsx("strong",{children:e}),t?o.jsx("span",{children:t}):null]}),o.jsx("span",{className:"studio-package-option__action","aria-hidden":"true",children:i?o.jsx(VFe,{}):o.jsx(WFe,{})})]})}function cg(e,t){return e[t]|e[t+1]<<8}function Q0(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function l3t(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 kje(e,t={}){let i=-1;for(let u=e.length-22;u>=0&&u>e.length-65557;u--)if(Q0(e,u)===101010256){i=u;break}if(i<0)throw new Error(Lt("helpers.zip.invalid"));const r=cg(e,i+10);if(t.maxEntries!==void 0&&r>t.maxEntries)throw new Error(Lt("helpers.zip.tooManyFiles",{count:t.maxEntries}));let s=Q0(e,i+16);const a=new TextDecoder("utf-8"),l=[];let c=0;for(let u=0;ut.maxUncompressedBytes)throw new Error(Lt("helpers.zip.tooLarge"));const x=cg(e,v+26),O=cg(e,v+28),w=v+30+x+O,k=e.subarray(w,w+f);let S;if(d===0)S=k;else if(d===8)S=await l3t(k);else{s+=46+p+g+b;continue}l.push({name:y,text:a.decode(S)}),s+=46+p+g+b}return l}const w8=/(^|\/)skill\.md$/i;function c3t(e){const t=(e??"").replace(/\r\n?/g,` +`),x=(e==null?void 0:e.pendingMessage)||s;if(m.useEffect(()=>{e&&f(u)},[e==null?void 0:e.status,u]),m.useEffect(()=>{if(!d||!g)return;const C=c.current;C&&(C.scrollTop=C.scrollHeight)},[d,g,y]),!e||!e.text&&e.status!=="error"&&!e.pendingMessage)return null;const O=K5t(e.updatedAt,l.resolvedLanguage??l.language),w=e.status==="complete"?a("agentWorkspace.logStatus.synced"):e.status==="error"?a("agentWorkspace.logStatus.failed"):a("agentWorkspace.logStatus.syncing"),k=e.omittedEarly?a("agentWorkspace.logStatus.earlyOmitted"):e.snapshotTruncated?a("agentWorkspace.logStatus.recentOnly"):e.truncated?a("agentWorkspace.logStatus.partiallyOmitted"):"",S=[w,e.lineCount?a("agentWorkspace.logLines",{count:e.lineCount}):"",k,O].filter(Boolean).join(" · ");async function E(){try{await navigator.clipboard.writeText(b),p(!0),window.setTimeout(()=>p(!1),1500)}catch{p(!1)}}return o.jsxs("section",{className:`aw-deploy-log is-${e.status}${d?"":" is-collapsed"}`,"aria-label":i,children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:n}),o.jsx("span",{children:S})]}),o.jsxs("div",{className:"aw-deploy-log-actions",children:[g&&o.jsx("button",{type:"button",onClick:()=>f(C=>!C),children:a(d?"common.collapse":"common.expand")}),g&&o.jsxs("button",{type:"button",onClick:()=>void E(),"aria-label":h?a("agentWorkspace.copiedLabel",{label:r}):a("agentWorkspace.copyLabel",{label:r}),title:h?a("agentWorkspace.copied"):a("agentWorkspace.copyLabel",{label:r}),children:[h?o.jsx(Vu,{"aria-hidden":!0}):o.jsx(Xj,{"aria-hidden":!0}),o.jsx("span",{children:a(h?"agentWorkspace.copied":"agentWorkspace.copy")})]})]})]}),d&&(g?o.jsx("pre",{ref:c,children:y}):o.jsx("div",{className:"aw-deploy-log-empty",children:x}))]})}function X5t({task:e}){var n;const{t}=Ce("ui");return o.jsx(vje,{log:e.buildLog,autoExpand:((n=e.buildLog)==null?void 0:n.status)!=="complete"&&(e.status==="running"||e.status==="error")&&yje(e,t)===1,title:t("agentWorkspace.buildLog"),ariaLabel:t("agentWorkspace.buildLog"),copyLabel:t("agentWorkspace.buildLog"),defaultPendingMessage:t("agentWorkspace.waitingBuildLog")})}function Y5t({task:e}){var n;const{t}=Ce("ui");return o.jsx(vje,{log:e.githubLog,autoExpand:((n=e.githubLog)==null?void 0:n.status)!=="complete"&&(e.status==="running"||e.status==="error")&&e.phase==="github",title:t("agentWorkspace.githubMountLog"),ariaLabel:t("agentWorkspace.githubDeliveryMountLog"),copyLabel:t("agentWorkspace.githubMountLog"),defaultPendingMessage:t("agentWorkspace.waitingGithubMountLog")})}function Z5t({task:e,onReturnToEdit:t}){const{t:n}=Ce("ui"),i=bje(e,n),r=yje(e,n),s=e.status==="success"?100:Math.max(6,Math.min(100,e.pct??6)),a=e.status==="running"&&e.statusUnconfirmed?n("agentWorkspace.deployStatus.unconfirmed"):e.status==="running"?n("agentWorkspace.deployStatus.running"):e.status==="success"?n("agentWorkspace.deployStatus.success"):e.status==="error"?n("agentWorkspace.deployStatus.error"):n("agentWorkspace.deployStatus.cancelled");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"&&e.statusUnconfirmed?o.jsx(X2,{}):e.status==="running"?o.jsx(fi,{className:"spin"}):e.status==="success"?o.jsx(c7e,{}):e.status==="error"?o.jsx(X2,{}):o.jsx(f4,{})}),o.jsxs("div",{children:[o.jsx("h3",{children:a}),o.jsx("p",{children:e.runtimeName})]})]}),o.jsx("strong",{children:e.status==="running"&&!e.statusUnconfirmed?`${Math.round(s)}%`:e.label})]}),o.jsx("div",{className:"aw-deploy-progress-track",role:"progressbar","aria-label":n("agentWorkspace.deploymentProgress"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(s),children:o.jsx("span",{style:{width:`${s}%`}})}),o.jsx("ol",{className:"aw-deploy-steps",children:i.map((l,c)=>{const u=e.status==="success"||cnew Set),[Mt,pn]=m.useState(()=>new Set),[en,tn]=m.useState(!1),[Un,xn]=m.useState(""),[oi,Oi]=m.useState(null),[mi,bn]=m.useState([]),[qi,ri]=m.useState([]),[zi,as]=m.useState(!1),[Lr,_r]=m.useState(""),[xs,os]=m.useState(""),[ia,Nr]=m.useState(0),[As,Vs]=m.useState([]),[Yr,ra]=m.useState(!1),[sa,ls]=m.useState(""),[va,aa]=m.useState(0),[ws,Ua]=m.useState(null),[oa,Qa]=m.useState(1),[Jn,Ni]=m.useState(!1),[ko,xa]=m.useState(""),[Xi,Eo]=m.useState(0),[we,Xe]=m.useState(!1),[Yt,nn]=m.useState(()=>new Set),[In,mr]=m.useState(!1),[jr,_s]=m.useState(""),[Si,la]=m.useState(""),[Hs,$r]=m.useState(()=>new Set),wa=m.useRef(!1),cs=m.useRef(""),Vi=m.useRef(null),so=m.useRef(0),ao=m.useRef(0),Go=m.useRef(0),[oo,ed]=m.useState(N5t),[bc,uu]=m.useState("");m.useEffect(()=>{e.length!==0&&ed(ee=>ee.map((Ae,He)=>He===0&&Ae.agentIds.length===0?{...Ae,agentIds:e.slice(0,2).map(mt=>mt.id)}:Ae))},[e]);const Co=m.useMemo(()=>{const ee=new Map;for(const Ae of e)Ae.runtimeId&&ee.set(Ae.runtimeId,Ae);return ee},[e]),yc=m.useMemo(()=>{var Ae;const ee=new Map;for(const He of t){const mt=(Ae=He.deploymentTarget)==null?void 0:Ae.runtimeId;if(!mt||!Co.has(mt))continue;const dn=ee.get(mt);(!dn||He.updatedAt>dn.updatedAt)&&ee.set(mt,He)}return ee},[Co,t]),Cl=m.useMemo(()=>{const ee=new Map;for(const Ae of f){if(!Ae.runtimeId)continue;const He=ee.get(Ae.runtimeId);(!He||Ae.startedAt>He.startedAt)&&ee.set(Ae.runtimeId,Ae)}return ee},[f]),td=m.useMemo(()=>{const ee=dt.trim().toLowerCase();return ee?e.filter(Ae=>{const He=Ae.runtimeId?yc.get(Ae.runtimeId):void 0,mt=Ae.runtimeId?Cl.get(Ae.runtimeId):void 0;return[Ae.label,Ae.app,Ae.host??"",(He==null?void 0:He.draft.name)??"",(He==null?void 0:He.draft.description)??"",(mt==null?void 0:mt.runtimeName)??""].join(" ").toLowerCase().includes(ee)}):e},[e,Cl,dt,yc]),Oa=m.useMemo(()=>{const ee=dt.trim().toLowerCase();return t.filter(Ae=>{var mt;const He=(mt=Ae.deploymentTarget)==null?void 0:mt.runtimeId;return He&&Co.has(He)?!1:ee?`${Ae.draft.name} ${Ae.draft.description}`.toLowerCase().includes(ee):!0})},[Co,t,dt]),Wh=m.useMemo(()=>t.filter(ee=>{var He;const Ae=(He=ee.deploymentTarget)==null?void 0:He.runtimeId;return!Ae||!Co.has(Ae)}).length,[Co,t]),Gh=m.useMemo(()=>{const ee=dt.trim().toLowerCase();return ee?oo.filter(Ae=>Ae.name.toLowerCase().includes(ee)):oo},[oo,dt]),de=e.find(ee=>ee.id===I),li=t.find(ee=>ee.id===Z),ci=h?f.find(ee=>ee.id===h):void 0,Sa=de!=null&&de.runtimeId?yc.get(de.runtimeId):void 0,Hn=y?Jt:I&&r===I?i:null,ji=(Hn==null?void 0:Hn.appName)||(de==null?void 0:de.runtimeApp)||(de==null?void 0:de.app)||"",vc=(c&&(de!=null&&de.runtimeId)?pte:pte.filter(ee=>ee!=="usage")).map(ee=>({id:ee,label:T(`agentWorkspace.sections.${ee}`)})),du=JSON.stringify([(de==null?void 0:de.runtimeId)??"",(de==null?void 0:de.region)??"cn-beijing",ji,oa]),us=(ws==null?void 0:ws.requestKey)===du?ws.value:null,Tl=`${(de==null?void 0:de.region)??"cn-beijing"}:${(de==null?void 0:de.runtimeId)??""}`,xc=(Ee==null?void 0:Ee.requestKey)===Tl?Ee.value:"",Sr=(te==null?void 0:te.requestKey)===Tl?te:null,Qn=!!((f0=Sr==null?void 0:Sr.apiApps)!=null&&f0.length),za=!!(Sr!=null&&Sr.a2a),rf=((rC=Sr==null?void 0:Sr.apiApps)==null?void 0:rC[0])??ji,Al=(q==null?void 0:q.endpoint)??"",ye=P5t(((kc=Sr==null?void 0:Sr.a2a)==null?void 0:kc.endpoint)??"",Al),Ye=(de==null?void 0:de.runtimeApp)||"",_t=JSON.stringify([(de==null?void 0:de.runtimeId)??"",(de==null?void 0:de.region)??"",(de==null?void 0:de.currentVersion)??null,Ye]),_n=l&&(de!=null&&de.runtimeId)&&de.region&&Ft===0?C4({runtimeId:de.runtimeId,region:de.region,appName:Ye,currentVersion:de.currentVersion}):null,Lt=(Se==null?void 0:Se.requestKey)===_t?Se.value:_n,fn=Lt!=null&&Lt.reason?jd(Lt.reason,P.resolvedLanguage||P.language):"",wn=(Lt==null?void 0:Lt.warnings.filter(ee=>jd(ee,P.resolvedLanguage||P.language)))??[];m.useEffect(()=>{const ee=so.current+1;so.current=ee,ve(null),Tt("");const Ae=(de==null?void 0:de.runtimeId)??"",He=(de==null?void 0:de.region)??"";if(!l||!Ae||!He){qe(!1);return}const mt=Ft===0?C4({runtimeId:Ae,region:He,appName:Ye,currentVersion:de==null?void 0:de.currentVersion}):null;if(mt){ve({requestKey:_t,value:mt}),qe(!1);return}const dn=new AbortController;let et,ei=0;const ua=60;qe(!0);const Xn=Ns=>{oR({runtimeId:Ae,region:He,appName:Ye,currentVersion:de==null?void 0:de.currentVersion,signal:dn.signal,force:Ns&&Ft>0}).then(To=>{var oC,Gm;if(ee!==so.current)return;const m1=To.recoveryStatus==="preparing";if(To.runtime.runtimeId!==Ae||To.runtime.region!==He||!m1&&Ye&&((oC=To.agent)==null?void 0:oC.appName)!==Ye||To.canUpdate&&!((Gm=To.agent)!=null&&Gm.appName)){Tt(T("agentWorkspace.errors.updateCapabilityMismatch"));return}if(ve({requestKey:_t,value:To}),qe(!1),!!m1){if(ei+=1,ei>=ua){Tt(T("agentWorkspace.errors.updateConfigRestoring"));return}et=window.setTimeout(()=>Xn(!1),1e3)}}).catch(()=>{ee!==so.current||dn.signal.aborted||Tt(T("agentWorkspace.errors.checkUpdateCapability"))}).finally(()=>{ee===so.current&&!dn.signal.aborted&&qe(!1)})};return Xn(!0),()=>{dn.abort(),et!=null&&window.clearTimeout(et)}},[l,Ye,Ft,de==null?void 0:de.currentVersion,de==null?void 0:de.region,de==null?void 0:de.runtimeId,_t]);const Y=m.useMemo(()=>{const ee=new Map(e.map((He,mt)=>[He.id,mt])),Ae=new Map(n.map((He,mt)=>[He,mt]));return[...td].sort((He,mt)=>{const dn=He.runtimeId?Cl.get(He.runtimeId):void 0,et=mt.runtimeId?Cl.get(mt.runtimeId):void 0,ei=(dn==null?void 0:dn.status)==="running"?dn.startedAt:0,ua=(et==null?void 0:et.status)==="running"?et.startedAt:0;if(ei!==ua)return ua-ei;const Xn=Ae.get(He.id),Ns=Ae.get(mt.id);return Xn!=null&&Ns!=null?Xn-Ns:Xn!=null?-1:Ns!=null?1:(ee.get(He.id)??0)-(ee.get(mt.id)??0)})},[n,e,td,Cl]),Oe=(de==null?void 0:de.label)||(Hn==null?void 0:Hn.name)||(li==null?void 0:li.draft.name)||(ci==null?void 0:ci.agentName)||((sC=ci==null?void 0:ci.agentDraft)==null?void 0:sC.name)||T("agentWorkspace.noAgentSelected"),Ge=oo.find(ee=>ee.id===bc),Rt=Y.filter(ee=>ee.canDelete===!0),un=Y.filter(ee=>Ki.has(ee.id)&&ee.canDelete===!0),Nn=Oa.filter(ee=>Mt.has(ee.id)),Yi=Rt.length+Oa.length,Ri=un.length+Nn.length,Kn=m.useMemo(()=>{var Ae;if(ci!=null&&ci.agentDraft)return ci.agentDraft;if(li!=null&&li.draft)return li.draft;const ee=(Ae=de==null?void 0:de.region)!=null&&Ae.startsWith("ap-")?"byteplus":"volcengine";return Lt!=null&&Lt.agent&&(Lt.recoveryStatus==="complete"||Lt.recoveryStatus==="draft-only")?EB(Lt.agent,ee,Lt.runtime.configuredEnvKeys):F5t(Hn,ji||(de==null?void 0:de.label)||"agent",ee)},[Hn,ji,de==null?void 0:de.label,de==null?void 0:de.region,li==null?void 0:li.draft,ci==null?void 0:ci.agentDraft,Lt]),zn=((Yh=Hn==null?void 0:Hn.draft)==null?void 0:Yh.harnessSidecar)??Mst(q==null?void 0:q.envs),ds=zn?Ux.filter(ee=>zn.componentOverrides[ee]):[],$n=li?a?"":T("agentWorkspace.errors.noCreatePermission"):l?de!=null&&de.runtimeId?de.region?$e?T("agentWorkspace.errors.checkingUpdateConfig"):ke||(Lt?Lt.recoveryStatus!=="complete"&&Lt.recoveryStatus!=="draft-only"?fn||T("agentWorkspace.errors.originalConfigUnavailable"):Lt.canUpdate?(aC=Lt.agent)!=null&&aC.appName?"":T("agentWorkspace.errors.agentInfoMissing"):fn||T("agentWorkspace.errors.updateUnsupported"):T("agentWorkspace.errors.updateCapabilityPending")):T("agentWorkspace.errors.runtimeRegionMissing"):T("agentWorkspace.errors.cloudOnlyUpdate"):T("agentWorkspace.errors.noManagePermission"),ca="aw-update-disabled-reason",at=m.useMemo(()=>{if(Hn)return Hn.tools;const ee=(Kn.builtinTools??[]).map(Ae=>{var He;return((He=Bx.find(mt=>mt.id===Ae))==null?void 0:He.label)??Ae});return Array.from(new Set([...Kn.tools,...ee,...(Kn.customTools??[]).map(Ae=>Ae.name),...(Kn.mcpTools??[]).map(Ae=>Ae.name)].filter(Boolean)))},[Kn,Hn]),On=m.useMemo(()=>Hn?Hn.skillsPreviewSupported?Hn.skills.map(ee=>ee.name):null:Array.from(new Set([...(Kn.selectedSkills??[]).map(ee=>ee.name),...Kn.skills].filter(Boolean))),[Kn,Hn]),Ht=m.useMemo(()=>{if(ci)return ci;if(li){const ee=f.filter(Ae=>Ae.draftId===li.id).sort((Ae,He)=>He.startedAt-Ae.startedAt)[0];return ee||f.filter(Ae=>{var He,mt;return((He=Ae.agentDraft)==null?void 0:He.name)===li.draft.name||Ae.agentName===li.draft.name||!!((mt=li.deploymentTarget)!=null&&mt.runtimeId)&&Ae.runtimeId===li.deploymentTarget.runtimeId}).sort((Ae,He)=>He.startedAt-Ae.startedAt)[0]}if(de)return f.filter(ee=>!!de.runtimeId&&ee.runtimeId===de.runtimeId||ee.agentName===de.label).sort((ee,Ae)=>Ae.startedAt-ee.startedAt)[0]},[f,de,li,ci]),si=!!(h&&Ht&&Ht.id===h),fs=!!(Ht&&(Ht.status!=="success"||si)),or=(Ht==null?void 0:Ht.status)==="running",hs=Ht!=null&&Ht.draftId?t.find(ee=>ee.id===Ht.draftId)??(Ht.agentDraft?{id:Ht.draftId,draft:Ht.agentDraft,updatedAt:Ht.startedAt}:void 0):void 0,wc=m.useMemo(()=>q5t(Kn),[Kn]),Oc=(de==null?void 0:de.currentVersion)??(q==null?void 0:q.currentVersion)??null,Kh=Oc??(ci==null?void 0:ci.startedAt)??"unknown",Ko=Hn?`runtime:${(de==null?void 0:de.runtimeId)??Hn.name}:v${Kh}:${wc}`:`draft:${(ci==null?void 0:ci.id)??(li==null?void 0:li.id)??(de==null?void 0:de.id)??Oe}:${wc}`;m.useEffect(()=>{M==="usage"&&!c&&U("basic")},[c,M]),m.useEffect(()=>{if(!h)return;const ee=f.find(He=>He.id===h),Ae=ee!=null&&ee.runtimeId?Co.get(ee.runtimeId):void 0;if(Ae){Q(""),H(Ae.id),U("basic");return}H(""),Q(""),U("basic")},[Co,f,h]),m.useEffect(()=>{if(!p){cs.current="";return}const ee=`${p}:${g}:${b}:${c}`;cs.current!==ee&&e.some(Ae=>Ae.id===p)&&(cs.current=ee,Q(""),H(p),U(g==="usage"&&!c?"basic":g),g==="evaluations"&&(ut(b),it("")))},[e,c,p,g,b]),m.useEffect(()=>{for(const ee of Y.slice(0,8)){if(!ee.runtimeId)continue;const Ae=ee.region??"cn-beijing";iye(ee.runtimeId,Ae),n0e(ee.runtimeId,Ae,ee.runtimeApp??"")}},[Y]),m.useEffect(()=>{let ee=!1;const Ae=(de==null?void 0:de.runtimeId)??"",He=(de==null?void 0:de.region)??"cn-beijing",mt=(de==null?void 0:de.runtimeApp)??"",dn=Ae?t0e(Ae,He,mt):null;if(on(dn),gt(""),Ot(!1),Bt(!!dn||!y||!Ae),!(!y||!Ae))return XF(Ae,He,mt,{force:!0}).then(et=>{ee||on(et)}).catch(et=>{!ee&&!dn&&on(null),ee||(Ot(et instanceof Ds&&et.unsupported),gt(T("agentWorkspace.errors.loadAgentInfo")))}).finally(()=>{ee||Bt(!0)}),()=>{ee=!0}},[y,Ft,de==null?void 0:de.currentVersion,de==null?void 0:de.region,de==null?void 0:de.runtimeApp,de==null?void 0:de.runtimeId]),m.useEffect(()=>{let ee=!1;const Ae=(de==null?void 0:de.runtimeId)??"",He=(de==null?void 0:de.region)??"cn-beijing";if(Vs([]),ls(""),M!=="optimizations"||!Ae){ra(!1);return}if(y&&!ji){ra(!Et);return}return ra(!0),Hbe({runtimeId:Ae,region:He,appName:ji}).then(mt=>{ee||Vs(mt.groups)}).catch(()=>{ee||ls(T("agentWorkspace.errors.loadOptimizations"))}).finally(()=>{ee||ra(!1)}),()=>{ee=!0}},[Et,y,va,M,ji,de==null?void 0:de.region,de==null?void 0:de.runtimeId]),m.useEffect(()=>{Qa(1)},[de==null?void 0:de.runtimeId,ji]),m.useEffect(()=>{const ee=Go.current+1;Go.current=ee;const Ae=(de==null?void 0:de.runtimeId)??"",He=(de==null?void 0:de.region)??"cn-beijing",mt=ji;if(xa(""),M!=="usage"||!Ae){Ni(!1);return}if(!mt){Ni(y&&!Et);return}const dn=new AbortController;return Ni(!0),V0e({runtimeId:Ae,region:He,appName:mt,page:oa,pageSize:R5t,signal:dn.signal}).then(et=>{if(ee===Go.current){if(et.runtimeId!==Ae||et.appName!==mt||et.page!==oa){xa(T("agentWorkspace.errors.usageMismatch"));return}Ua({requestKey:du,value:et})}}).catch(()=>{ee!==Go.current||dn.signal.aborted||xa(T("agentWorkspace.errors.loadUsage"))}).finally(()=>{ee===Go.current&&Ni(!1)}),()=>{dn.abort()}},[oa,Xi,du,Et,y,M,ji,de==null?void 0:de.region,de==null?void 0:de.runtimeId]),m.useEffect(()=>{ao.current+=1,Je(null),Pe(!1),Ke(!1),ot(""),xe("api-server")},[Tl,M]);function fu(){ao.current+=1,Je(null),Pe(!1),Ke(!1),ot("")}function sf(ee){ee!==ue&&(fu(),xe(ee))}async function af(){if(De){fu();return}const ee=(de==null?void 0:de.runtimeId)??"",Ae=(de==null?void 0:de.region)??"cn-beijing";if(!ee)return;const He=ao.current+1;ao.current=He,Ke(!0),ot("");try{const mt=await eye(ee,Ae);if(He!==ao.current)return;Je({requestKey:Tl,value:mt}),Pe(!0)}catch(mt){if(He!==ao.current)return;Je(null),Pe(!1),ot(mt instanceof Error?mt.message:T("agentWorkspace.errors.loadApiKey"))}finally{He===ao.current&&Ke(!1)}}m.useEffect(()=>{let ee=!1;const Ae=(de==null?void 0:de.runtimeId)??"",He=(de==null?void 0:de.region)??"cn-beijing",mt=Ae?nye(Ae,He):null;if(B(mt),Dt(""),!!Ae)return i7(Ae,He,{force:!0}).then(dn=>{ee||B(dn)}).catch(()=>{!ee&&!mt&&B(null),ee||Dt(T("agentWorkspace.errors.loadRuntimeDetails"))}),()=>{ee=!0}},[Ft,de==null?void 0:de.currentVersion,de==null?void 0:de.region,de==null?void 0:de.runtimeId]),m.useEffect(()=>{let ee=!1;const Ae=(de==null?void 0:de.runtimeId)??"";if(Me(""),M!=="versions"||!Ae){pe(!1),Ae||Be(null);return}return pe(!0),nA(Ae).then(He=>{ee||Be(He)}).catch(()=>{ee||(Be(null),Me(T("agentWorkspace.errors.loadGithubVersions")))}).finally(()=>{ee||pe(!1)}),()=>{ee=!0}},[M,de==null?void 0:de.currentVersion,de==null?void 0:de.runtimeId]),m.useEffect(()=>{let ee=!1;const Ae=(de==null?void 0:de.runtimeId)??"",He=(de==null?void 0:de.region)??"cn-beijing",mt=`${He}:${Ae}`;if(G(""),M!=="integrations"||!Ae){re(!1),Ae||ce(null);return}re(!0);const dn=Fv(Ae,He,{retryProbe:!0}).catch(et=>{if(et instanceof Ds&&et.unsupported)return null;throw et});return Promise.all([dn,J0e(Ae,He,{retryProbe:!0})]).then(([et,ei])=>{ee||ce({requestKey:mt,apiApps:et,a2a:ei})}).catch(()=>{ee||(ce(null),G(T("agentWorkspace.errors.probeIntegration")))}).finally(()=>{ee||re(!1)}),()=>{ee=!0}},[K,M,de==null?void 0:de.currentVersion,de==null?void 0:de.region,de==null?void 0:de.runtimeId]),m.useEffect(()=>{let ee=!1;const Ae=(de==null?void 0:de.runtimeId)??"",He=(de==null?void 0:de.region)??"cn-beijing",mt=Ae&&ji?qbe({runtimeId:Ae,region:He,appName:ji,pageSize:100}):null;if(bn(mt?vte(mt,T):[]),ri((mt==null?void 0:mt.sets)??[]),_r(""),os((mt==null?void 0:mt.unsupportedMessage)??""),M!=="evaluations"||!Ae){as(!1);return}if(y&&!ji){as(!Et);return}return as(!mt),rR({runtimeId:Ae,region:He,appName:ji,pageSize:100},{force:!0}).then(dn=>{ee||(ri(dn.sets),bn(vte(dn,T)),os(dn.unsupportedMessage??""))}).catch(()=>{ee||(_r(T("agentWorkspace.errors.loadEvaluations")),os(""))}).finally(()=>{ee||as(!1)}),()=>{ee=!0}},[Et,y,ia,M,ji,Hn==null?void 0:Hn.appName,de==null?void 0:de.region,de==null?void 0:de.runtimeId,T]);async function Sc(ee){const Ae=(de==null?void 0:de.runtimeId)??"",He=ee.commitSha??"";if(!(!Ae||!He||Ve)){ht(He),Me("");try{await D0e({runtimeId:Ae,targetCommitSha:He});const mt=await nA(Ae);Be(mt)}catch(mt){Me(mt instanceof Error?mt.message:T("agentWorkspace.errors.rollbackVersion"))}finally{ht("")}}}m.useEffect(()=>{const ee=new Set(mi.map(Ae=>Ae.id));nn(Ae=>{const He=new Set([...Ae].filter(mt=>ee.has(mt)));return He.size===Ae.size?Ae:He}),$r(Ae=>{const He=new Set([...Ae].filter(mt=>ee.has(mt)));return He.size===Ae.size?Ae:He}),Si&&!ee.has(Si)&&la("")},[mi,Si]),m.useEffect(()=>{Xe(!1),nn(new Set),$r(new Set),_s(""),la("")},[de==null?void 0:de.runtimeId]),m.useEffect(()=>{const ee=new Set(Y.filter(Ae=>Ae.canDelete===!0).map(Ae=>Ae.id));Le(Ae=>{const He=new Set([...Ae].filter(mt=>ee.has(mt)));return He.size===Ae.size?Ae:He})},[Y]),m.useEffect(()=>{const ee=new Set(Oa.map(Ae=>Ae.id));pn(Ae=>{const He=new Set([...Ae].filter(mt=>ee.has(mt)));return He.size===Ae.size?Ae:He})},[Oa]);const Xo=m.useMemo(()=>!v||!(de!=null&&de.runtimeId)||v.runtimeId!==de.runtimeId||ji&&v.agentName&&v.agentName!==ji?null:{...v,tag:T(v.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},[v,de==null?void 0:de.runtimeId,ji,T]),lo=m.useMemo(()=>_5t(T),[T]),ka=m.useMemo(()=>de!=null&&de.runtimeId?Xo?[Xo,...mi.filter(ee=>ee.id!==Xo.id&&(!ee.messageId||ee.messageId!==Xo.messageId))]:mi:lo,[lo,mi,Xo,de==null?void 0:de.runtimeId]),_l=ka.filter(ee=>{if(ee.kind!==Qe||(ee.source==="auto"?"auto":"user")!==xt)return!1;const He=bt.trim().toLowerCase();return He?[ee.input,ee.output,ee.referenceOutput,ee.comment,ee.tag??"",ee.sessionId,ee.messageId,ee.userId,ee.evaluationSetName].join(" ").toLowerCase().includes(He):!0}),of=_l.filter(ee=>Yt.has(ee.id)),qm=!!(de!=null&&de.runtimeId),lf=ee=>{ut(ee),it(""),_s("");const Ae=ka.find(He=>He.kind===ee);la((Ae==null?void 0:Ae.id)??""),window.setTimeout(()=>{var He;(He=Vi.current)==null||He.scrollIntoView({behavior:"smooth",block:"start"})},0)},Fr=ee=>{_s(""),nn(Ae=>{const He=new Set(Ae);return He.has(ee.id)?He.delete(ee.id):He.add(ee.id),He})},cf=()=>{_s(""),nn(new Set(_l.map(ee=>ee.id)))},JI=()=>{_s(""),nn(new Set),Xe(!1)},Br=ee=>{$r(Ae=>{const He=new Set(Ae);return He.has(ee)?He.delete(ee):He.add(ee),He})},l0=ee=>{la(ee.id),_s(""),!(!ee.sessionId||!ee.messageId)&&(N==null||N(ee))},YE=async ee=>{if(!(de!=null&&de.runtimeId)||!ji||In||ee.length===0)return;const Ae=ee.length===1?T("agentWorkspace.deleteOneCaseConfirm"):T("agentWorkspace.deleteCasesConfirm",{count:ee.length});if(!window.confirm(Ae))return;const He=ee.map(dn=>dn.id),mt=new Set(He);mr(!0),_s("");try{await Kbe({runtimeId:de.runtimeId,region:de.region??"cn-beijing",appName:ji,itemIds:He});const dn=new Map;for(const et of ee)dn.set(et.kind,(dn.get(et.kind)??0)+1);bn(et=>et.filter(ei=>!mt.has(ei.id))),ri(et=>et.map(ei=>({...ei,itemCount:Math.max(0,ei.itemCount-(dn.get(ei.kind)??0))}))),nn(et=>new Set([...et].filter(ei=>!mt.has(ei)))),$r(et=>new Set([...et].filter(ei=>!mt.has(ei)))),Si&&mt.has(Si)&&la(""),ee.length>1&&Xe(!1),_==null||_(ee)}catch(dn){_s(dn instanceof Error?dn.message:String(dn))}finally{mr(!1)}},h1=ee=>{ed(Ae=>Ae.map(He=>He.id===ee.id?ee:He))},ZE=()=>{const ee=new Set(e.map(mt=>mt.id)),Ae=n.filter(mt=>ee.has(mt)),He=new Set(Ae);return[...Ae,...e.filter(mt=>!He.has(mt.id)).map(mt=>mt.id)]},JE=(ee,Ae,He)=>{if(!w||ee===Ae)return;const mt=ZE().filter(ei=>ei!==ee),dn=mt.indexOf(Ae),et=dn<0?mt.length:He==="after"?dn+1:dn;mt.splice(et,0,ee),w(mt)},eC=(ee,Ae)=>{if(!pt||pt===Ae)return;const He=ee.currentTarget.getBoundingClientRect();st(Ae),We(ee.clientY>He.top+He.height/2?"after":"before")},Wm=(ee,Ae)=>{if(!w)return;const He=ZE(),mt=He.indexOf(ee),dn=Math.max(0,Math.min(He.length-1,mt+Ae));mt<0||mt===dn||(He.splice(mt,1),He.splice(dn,0,ee),w(He))},c0=ee=>{ee.canDelete===!0&&(xn(""),Le(Ae=>{const He=new Set(Ae);return He.has(ee.id)?He.delete(ee.id):He.add(ee.id),He}))},tC=ee=>{xn(""),pn(Ae=>{const He=new Set(Ae);return He.has(ee.id)?He.delete(ee.id):He.add(ee.id),He})},nC=()=>{xn(""),Le(new Set(Rt.map(ee=>ee.id))),pn(new Set(Oa.map(ee=>ee.id)))},Ut=()=>{xn(""),Le(new Set),pn(new Set),vn(!1)},u0=()=>{if(Ri===0||en)return;const ee=un.length,Ae=Nn.length;xn(""),Oi({kind:"selection",title:T(ee===1&&Ae===0?"agentWorkspace.deleteAgentTitle":ee===0&&Ae===1?"myAgents.deleteDraftTitle":"agentWorkspace.deleteSelectedTitle"),description:ee===1&&Ae===0?T("agentWorkspace.deleteAgentDescription",{name:un[0].label}):ee===0&&Ae===1?T("agentWorkspace.deleteDraftDescription",{name:Nn[0].draft.name||T("agentSelector.unnamedAgent")}):T("agentWorkspace.deleteSelectionDescription",{count:Ri,warning:ee>0?T("agentWorkspace.runtimeDeletionWarning",{count:ee}):T("agentWorkspace.draftDeletionWarning")}),confirmLabel:T(ee===0&&Ae===1?"myAgents.deleteDraft":"agentWorkspace.deleteSelected"),agents:un,drafts:Nn})},p1=async()=>{if(!(!oi||en)){tn(!0),xn("");try{if(oi.kind==="selection"){const{agents:ee,drafts:Ae}=oi;if(ee.length>0){if(!k)throw new Error(T("agentWorkspace.errors.deleteDeployedUnsupported"));await k(ee)}Ae.length>0&&(S==null||S(Ae)),Le(new Set),pn(new Set),vn(!1),ee.some(He=>He.id===I)&&H(""),Ae.some(He=>He.id===Z)&&Q("")}else if(oi.kind==="agent"){if(!k)throw new Error(T("agentWorkspace.errors.deleteDeployedUnsupported"));await k([oi.agent]),I===oi.agent.id&&H("")}else{if(!S)throw new Error(T("agentWorkspace.errors.deleteDraftUnsupported"));S([oi.draft]),Z===oi.draft.id&&Q("")}Oi(null)}catch(ee){xn(ee instanceof Error?ee.message:String(ee))}finally{tn(!1)}}},d0=ee=>{!k||ee.canDelete!==!0||en||(xn(""),Oi({kind:"agent",title:T("agentWorkspace.deleteAgentTitle"),description:T("agentWorkspace.deleteAgentDescription",{name:ee.label}),confirmLabel:T("agentWorkspace.deleteAgent"),agent:ee}))},Wi=ee=>{if(!S||en)return;const Ae=ee.draft.name||T("agentSelector.unnamedAgent");xn(""),Oi({kind:"draft",title:T("myAgents.deleteDraftTitle"),description:T("agentWorkspace.deleteDraftDescription",{name:Ae}),confirmLabel:T("myAgents.deleteDraft"),draft:ee})},Xh=()=>{const ee=`eval-${Date.now()}`,Ae={id:ee,name:T("agentWorkspace.newEvaluationGroupName",{count:oo.length+1}),agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量"],concurrency:"4",history:[]};ed(He=>[Ae,...He]),uu(ee)},iC=ee=>{h1({...ee,history:[{id:`run-${Date.now()}`,createdAt:T("agentWorkspace.evaluationDefaults.justNow"),score:86+ee.history.length%7,status:"completed"},...ee.history]})};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:`aw-root${y?" is-detail-only":""}`,children:[o.jsxs("nav",{className:"aw-view-tabs","aria-label":T("agentWorkspace.workspace"),children:[o.jsx("button",{type:"button",className:R==="library"?"is-active":"","aria-pressed":R==="library",onClick:()=>{L("library"),$t("")},children:T("agentWorkspace.library")}),o.jsx("button",{type:"button",className:R==="evaluation"?"is-active":"","aria-pressed":R==="evaluation",onClick:()=>{L("evaluation"),$t("")},children:T("agentWorkspace.evaluation")})]}),o.jsxs("div",{className:"aw-workspace-frame",children:[o.jsxs("div",{className:"aw-workspace","aria-hidden":R==="evaluation"||void 0,ref:ee=>{ee==null||ee.toggleAttribute("inert",R==="evaluation")},children:[o.jsxs("aside",{className:"aw-sidebar","aria-label":T(R==="library"?"agentWorkspace.agentList":"agentWorkspace.evaluationGroupList"),children:[o.jsxs("label",{className:"aw-search",children:[o.jsx(P_,{"aria-hidden":!0}),o.jsx("input",{value:dt,onChange:ee=>$t(ee.currentTarget.value),placeholder:T(R==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups"),"aria-label":T(R==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups")})]}),o.jsxs("button",{type:"button",className:"aw-create-card",onClick:R==="library"?j:Xh,disabled:R==="library"&&!a,children:[o.jsx($o,{"aria-hidden":!0}),o.jsx("span",{children:T(R==="library"?"agentWorkspace.newAgent":"agentWorkspace.newEvaluationGroup")})]}),R==="library"&&(k||S)&&o.jsx("div",{className:`aw-selection-toolbar${St?" is-active":""}`,children:St?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-selection-count",children:T("agentWorkspace.selectedCount",{count:Ri})}),o.jsx("button",{type:"button",onClick:nC,disabled:Yi===0||en,children:T("agentWorkspace.selectAll")}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void u0(),disabled:Ri===0||en,children:T(en?"common.deleting":"agentWorkspace.deleteSelected")}),o.jsx("button",{type:"button",onClick:Ut,disabled:en,children:T("common.cancel")})]}):o.jsx("button",{type:"button",onClick:()=>{xn(""),vn(!0)},disabled:Yi===0,children:T("common.select")})}),R==="library"&&Un&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:Un}),o.jsx("div",{className:"aw-agent-list",children:R==="evaluation"?Gh.length===0?o.jsx("div",{className:"aw-list-empty",children:T("agentWorkspace.noMatchingEvaluationGroups")}):Gh.map(ee=>o.jsxs("button",{type:"button",className:`aw-agent-item${ee.id===bc?" is-active":""}`,onClick:()=>uu(ee.id),children:[o.jsxs("span",{className:"aw-agent-copy aw-eval-group-copy",children:[o.jsx("strong",{children:Ww(ee.name,T)}),o.jsx("small",{children:T("agentWorkspace.groupStats",{agents:ee.agentIds.length,runs:ee.history.length})})]}),o.jsx(bO,{"aria-hidden":!0})]},ee.id)):u&&Y.length===0&&Oa.length===0?o.jsx("div",{className:"aw-list-empty",children:T("agentWorkspace.loadingCloudAgents")}):d&&Y.length===0&&Oa.length===0?o.jsxs("div",{className:"aw-list-empty aw-list-error",children:[o.jsx("span",{children:d}),O&&o.jsx("button",{type:"button",onClick:O,children:T("common.retry")})]}):Y.length===0&&Oa.length===0?o.jsx("div",{className:"aw-list-empty",children:T("myAgents.noMatchingAgents")}):o.jsxs(o.Fragment,{children:[Oa.map(ee=>{const He=f.filter(dn=>dn.draftId===ee.id).sort((dn,et)=>et.startedAt-dn.startedAt)[0]??f.filter(dn=>{var et,ei;return((et=dn.agentDraft)==null?void 0:et.name)===ee.draft.name||dn.agentName===ee.draft.name||!!((ei=ee.deploymentTarget)!=null&&ei.runtimeId)&&dn.runtimeId===ee.deploymentTarget.runtimeId}).sort((dn,et)=>et.startedAt-dn.startedAt)[0],mt=Mt.has(ee.id);return o.jsxs("button",{type:"button",className:["aw-agent-item",St?"is-selecting":"",mt?"is-selected-for-delete":"",ee.id===Z?"is-active":""].filter(Boolean).join(" "),"aria-pressed":St?mt:void 0,onClick:()=>{if(St){tC(ee);return}H(""),Q(ee.id),U("basic")},children:[St&&o.jsx("span",{className:`aw-select-marker${mt?" 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:ee.draft.name||T("agentSelector.unnamedAgent")}),o.jsx("span",{className:`aw-draft-badge${(He==null?void 0:He.status)==="running"?" is-deploying":""}`,children:(He==null?void 0:He.status)==="running"?T("myAgents.deploying"):T("myAgents.draft")})]}),o.jsx("small",{children:ee.deploymentTarget?T("agentWorkspace.updatePending"):T("agentWorkspace.notPublished")})]}),o.jsx(bO,{"aria-hidden":!0})]},ee.id)}),Y.map(ee=>{const Ae=ee.runtimeId?Cl.get(ee.runtimeId):void 0,He=ee.runtimeId?yc.get(ee.runtimeId):void 0,mt=Ki.has(ee.id),dn=ee.canDelete===!0,et=(Ae==null?void 0:Ae.status)==="running"?{label:T("myAgents.deploying"),className:" is-deploying"}:(Ae==null?void 0:Ae.status)==="error"?{label:T("agentWorkspace.failed"),className:" is-error"}:(Ae==null?void 0:Ae.status)==="cancelled"?{label:T("agentWorkspace.cancelled"),className:" is-muted"}:He?{label:T("agentWorkspace.updatePending"),className:""}:null,ei=(Ae==null?void 0:Ae.status)==="running"?T("agentWorkspace.updatingDeployment"):He?T("agentWorkspace.updatePending"):ee.remote?ee.host||T("agentWorkspace.remoteAgent"):T("agentWorkspace.localAgent"),ua=["aw-agent-item","aw-agent-item--sortable",ee.id===I?"is-active":"",St?"is-selecting":"",mt?"is-selected-for-delete":"",St&&!dn?"is-selection-disabled":"",ee.id===pt?"is-dragging":"",ee.id===ze&&ee.id!==pt?`is-drop-target is-drop-${me}`:""].filter(Boolean).join(" ");return o.jsxs("button",{type:"button",draggable:!!w&&!St,className:ua,"aria-pressed":St?mt:void 0,"aria-keyshortcuts":w?"Alt+ArrowUp Alt+ArrowDown":void 0,onDragStart:Xn=>{w&&(wa.current=!0,Re(ee.id),Xn.dataTransfer.effectAllowed="move",Xn.dataTransfer.setData("text/plain",ee.id))},onDragEnter:Xn=>{eC(Xn,ee.id)},onDragOver:Xn=>{!pt||pt===ee.id||(Xn.preventDefault(),Xn.dataTransfer.dropEffect="move",eC(Xn,ee.id))},onDragLeave:Xn=>{const Ns=Xn.relatedTarget;Ns instanceof Node&&Xn.currentTarget.contains(Ns)||ze===ee.id&&st("")},onDrop:Xn=>{Xn.preventDefault();const Ns=Xn.dataTransfer.getData("text/plain")||pt;JE(Ns,ee.id,me),Re(""),st(""),We("before")},onDragEnd:()=>{Re(""),st(""),We("before"),window.setTimeout(()=>{wa.current=!1},0)},onKeyDown:Xn=>{Xn.altKey&&(Xn.key==="ArrowUp"?(Xn.preventDefault(),Wm(ee.id,-1)):Xn.key==="ArrowDown"&&(Xn.preventDefault(),Wm(ee.id,1)))},onClick:Xn=>{if(St){Xn.preventDefault(),c0(ee);return}if(wa.current){Xn.preventDefault(),wa.current=!1;return}Q(""),H(ee.id),U("basic"),E(ee.id)},children:[St&&o.jsx("span",{className:`aw-select-marker${mt?" 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:ee.label}),ee.currentVersion!=null&&o.jsxs("span",{className:"aw-version-badge",children:["v",ee.currentVersion]}),et&&o.jsx("span",{className:`aw-draft-badge${et.className}`,children:et.label})]}),o.jsx("small",{children:ei})]}),o.jsx(bO,{"aria-hidden":!0})]},ee.id)})]})}),o.jsx("div",{className:"aw-list-count",children:T("agentWorkspace.totalCount",{count:R==="library"?e.length+Wh:oo.length})})]}),R==="evaluation"&&Ge?o.jsx(iLt,{group:Ge,agents:e,cases:ka,onChange:h1,onRun:iC}):R==="evaluation"?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:T("agentWorkspace.noEvaluationGroupSelected")})}):!de&&!li&&!ci?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:T("agentWorkspace.noAgentSelected")})}):o.jsxs("main",{className:`aw-main${or?" is-deploying":""}${y?" resource-page":""}`,children:[de&&!Hn&&s&&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:T("agentWorkspace.loadingAgent")}),o.jsx("small",{children:T("agentWorkspace.loadingAgentDescription")})]})]})}),M==="integrations"&&se&&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:T("agentWorkspace.probingIntegration")}),o.jsx("small",{children:T("agentWorkspace.probingIntegrationDescription")})]})]})}),o.jsx(uE,{className:"aw-agent-detail",title:Oe,description:Kn.description||T(s||y&&!Et?"agentWorkspace.loadingAgentInfo":"common.noDescription"),identitySeed:Oe,backLabel:T("agentWorkspace.backToAgentList"),onBack:y?x:void 0,meta:o.jsxs(o.Fragment,{children:[Oc!=null&&o.jsxs("span",{className:"aw-agent-meta",children:["v",Oc]}),li&&o.jsx("span",{className:"aw-agent-meta",children:T("myAgents.draft")}),Sa&&o.jsx("span",{className:"aw-agent-meta",children:T("agentWorkspace.updatePending")}),!de&&!li&&ci&&o.jsx("span",{className:"aw-agent-meta",children:ci.label})]}),actionsClassName:"aw-head-actions",bodyClassName:"aw-agent-detail__body",actions:li||Sa||de!=null&&de.canDelete?o.jsxs(o.Fragment,{children:[(li||Sa)&&o.jsxs(Wt,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>{const ee=li??Sa;ee&&Wi(ee)},disabled:en,"aria-label":T("myAgents.deleteDraft"),title:T("myAgents.deleteDraft"),children:[o.jsx(pm,{"aria-hidden":!0}),o.jsx("span",{children:T("myAgents.deleteDraft")})]}),(de==null?void 0:de.canDelete)&&o.jsxs(Wt,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>void d0(de),disabled:en,"aria-label":T("agentWorkspace.deleteAgent"),title:T("agentWorkspace.deleteAgent"),children:[o.jsx(pm,{"aria-hidden":!0}),o.jsx("span",{children:T(en?"common.deleting":"agentWorkspace.deleteAgent")})]})]}):void 0,sections:vc.map(ee=>{var Ae,He,mt,dn;return{key:ee.id,label:ee.label,disabled:or,content:ee.id===M?o.jsxs(o.Fragment,{children:[Ht&&fs&&o.jsx("div",{className:`aw-detail-deployment${or?" is-running":""}`,children:o.jsx(Z5t,{task:Ht,onReturnToEdit:hs&&F?()=>F(hs):void 0})}),o.jsxs("div",{className:"aw-content",children:[M==="basic"&&o.jsxs("div",{className:"aw-basic-stack",children:[je&&o.jsx(Eb,{className:"aw-detail-fetch-alert",color:"warning",variant:"soft",title:T("agentWorkspace.partialInfoUnavailable"),description:T("agentWorkspace.upgradeRuntimeForDetails")}),(rt&&!je||yt)&&o.jsx(Eb,{className:"aw-detail-fetch-alert",color:"danger",variant:"soft",title:T("agentWorkspace.detailLoadFailed"),description:T("agentWorkspace.detailLoadFailedDescription"),actions:o.jsx(Wt,{type:"button",color:"danger",variant:"soft",size:"sm",pill:!1,onClick:()=>Fe(et=>et+1),children:T("common.retry")})}),de&&Lt&&!Lt.canUpdate&&o.jsxs("div",{className:"aw-update-recovery-notice",role:Lt.recoveryStatus==="preparing"?"status":"alert",children:[o.jsx("strong",{children:Lt.recoveryStatus==="preparing"?T("agentWorkspace.restoringUpdateConfig"):T("agentWorkspace.updateConfigUnavailable")}),fn&&o.jsx("span",{children:fn}),wn.map(et=>o.jsx("span",{children:et},et))]}),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:T("agentWorkspace.deploymentConfig")}),o.jsx("p",{children:T("agentWorkspace.deploymentConfigDescription")})]})}),o.jsxs("dl",{className:"aw-readonly-config",children:[o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.runtimeStatus")}),o.jsxs("dd",{className:(q==null?void 0:q.status.toLowerCase())==="ready"?"is-ready":void 0,children:[(q==null?void 0:q.status.toLowerCase())==="ready"&&o.jsx("span",{className:"aw-status-dot"}),(q==null?void 0:q.status)||T("agentWorkspace.loading")]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.deploymentRegion")}),o.jsx("dd",{children:(q==null?void 0:q.region)||(de==null?void 0:de.region)||(Ht==null?void 0:Ht.region)||T("agentWorkspace.notAvailable")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.networkAccess")}),o.jsx("dd",{children:q!=null&&q.networkTypes.length?q.networkTypes.join(" / "):T("agentWorkspace.notAvailable")})]})]})]}),o.jsxs("section",{className:"aw-canvas-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:T("agentWorkspace.executionFlow")})}),o.jsx("div",{className:"aw-canvas",children:o.jsx(LS,{draft:Kn,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},Ko)})]}),o.jsxs("section",{className:"aw-details-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:T("agentWorkspace.details")})}),o.jsxs("dl",{className:"aw-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:T("agentSelector.model")}),o.jsx("dd",{children:kB(Hn==null?void 0:Hn.model)||Kn.modelName||T("agentWorkspace.notAvailable")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.agentCountLabel")}),o.jsx("dd",{children:Hn!=null&&Hn.graph?mje(Hn.graph):gje(Kn)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentSelector.tools")}),o.jsx("dd",{className:"aw-fact-badges",children:at.length?at.map(et=>o.jsx("span",{children:et},et)):T("agentWorkspace.none")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentSelector.skills")}),o.jsx("dd",{className:"aw-fact-badges",children:On===null?T("agentSelector.previewUnsupported"):On.length?On.map(et=>o.jsx("span",{children:et},et)):T("agentWorkspace.none")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("systemInfo.currentVersion")}),o.jsx("dd",{children:Oc!=null?`v${Oc}`:T("agentWorkspace.notAvailable")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentSelector.status")}),o.jsx("dd",{children:li?T("myAgents.draft"):(Ht==null?void 0:Ht.status)==="error"?T("agentWorkspace.deploymentFailed"):(Ht==null?void 0:Ht.status)==="cancelled"?T("agentWorkspace.cancelled"):Sa?T("agentWorkspace.updatePending"):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-status-dot"}),T("skillCenter.status.available")]})})]})]})]}),o.jsxs("section",{className:"aw-sidecar-panel aw-settings-card","aria-label":T("agentWorkspace.selectedOptimizations"),children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:T("agentWorkspace.selectedOptimizations")}),o.jsx("p",{children:T("agentWorkspace.selectedOptimizationsDescription")})]})}),o.jsxs("dl",{className:"aw-readonly-config",children:[o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.configurationStatus")}),o.jsx("dd",{className:zn!=null&&zn.enabled?"is-ready":void 0,children:zn?zn.enabled?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-status-dot"}),T("skillCenter.status.enabled")]}):T("skillCenter.status.inactive"):T("agentWorkspace.notRecorded")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.optimizationProfile")}),o.jsx("dd",{children:zn?Pst(zn.profile):T("agentWorkspace.legacyConfigMissing")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.selectedOptimizations")}),o.jsx("dd",{className:"aw-fact-badges",children:zn?ds.length?ds.map(et=>o.jsx("span",{children:mA(et)},et)):T("agentWorkspace.noneSelected"):T("agentWorkspace.legacyConfigMissing")})]})]})]})]}),M==="usage"&&(de==null?void 0:de.runtimeId)&&o.jsxs("section",{className:"aw-usage","aria-busy":Jn,children:[o.jsx("div",{className:"aw-usage-intro",children:o.jsx("h3",{children:T("agentWorkspace.usageOverview")})}),Jn&&!us&&o.jsx("div",{className:"aw-usage-state",role:"status","aria-live":"polite",children:o.jsx(An,{as:"span",children:T("agentWorkspace.loadingUsage")})}),ko&&o.jsxs("div",{className:"aw-usage-state is-error",role:"alert",children:[o.jsx("span",{children:ko}),o.jsx("button",{type:"button",onClick:()=>Eo(et=>et+1),children:T("common.retry")})]}),!Jn&&!ko&&!us&&!ji&&o.jsx("div",{className:"aw-usage-state",children:T("agentWorkspace.usageUnavailable")}),us&&o.jsxs(o.Fragment,{children:[o.jsxs("dl",{className:"aw-usage-summary","aria-label":T("agentWorkspace.usageSummary"),children:[o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.totalCalls")}),o.jsx("dd",{children:us.totalInvocations.toLocaleString(P.resolvedLanguage??P.language)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:T("agentWorkspace.userCount")}),o.jsx("dd",{children:us.totalUsers.toLocaleString(P.resolvedLanguage??P.language)})]})]}),o.jsxs("div",{className:"aw-usage-users-head",children:[o.jsx("h3",{children:T("agentWorkspace.userDetails")}),Jn&&o.jsx(An,{as:"span",role:"status","aria-live":"polite",children:T("agentWorkspace.refreshing")})]}),us.users.length===0?o.jsx("div",{className:"aw-usage-state",children:T("agentWorkspace.noUsage")}):o.jsx("div",{className:"aw-usage-table-wrap",children:o.jsxs("table",{className:"aw-usage-table",children:[o.jsx("caption",{children:T("agentWorkspace.usageUserList")}),o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"col",children:T("agentWorkspace.user")}),o.jsx("th",{scope:"col",children:T("agentWorkspace.callCount")}),o.jsx("th",{scope:"col",children:T("agentWorkspace.lastUsed")})]})}),o.jsx("tbody",{children:us.users.map(et=>o.jsxs("tr",{children:[o.jsxs("td",{children:[o.jsx("strong",{children:et.displayName||et.userId||T("agentWorkspace.unknownUser")}),et.displayName&&et.userId&&o.jsx("small",{title:et.userId,children:et.userId})]}),o.jsx("td",{children:et.invocationCount.toLocaleString(P.resolvedLanguage??P.language)}),o.jsx("td",{children:o.jsx("time",{dateTime:et.lastUsedAt,children:I5t(et.lastUsedAt,P.resolvedLanguage??P.language,T)})})]},et.userId))})]})}),us.totalPages>1&&o.jsxs("nav",{className:"aw-usage-pagination","aria-label":T("agentWorkspace.usagePagination"),children:[o.jsx("button",{type:"button",disabled:Jn||us.page<=1,onClick:()=>Qa(et=>Math.max(1,et-1)),children:T("common.previousPage")}),o.jsx("span",{"aria-live":"polite",children:T("agentWorkspace.pageOf",{page:us.page,total:us.totalPages})}),o.jsx("button",{type:"button",disabled:Jn||us.page>=us.totalPages,onClick:()=>Qa(et=>et+1),children:T("common.nextPage")})]})]})]}),M==="versions"&&o.jsxs("section",{className:"aw-version-stack",children:[o.jsxs("div",{className:"aw-integration-intro",children:[o.jsx("h3",{children:T("agentWorkspace.githubVersions")}),o.jsx("p",{children:(Ae=Ie==null?void 0:Ie.cicd)!=null&&Ae.enabled?T("agentWorkspace.githubVersionsDescription"):T("agentWorkspace.currentVersionOnly")})]}),J&&o.jsx("div",{className:"aw-case-empty",children:T("agentWorkspace.loadingVersions")}),oe&&o.jsxs("div",{className:"aw-integration-error",role:"alert",children:[o.jsx("span",{children:oe}),(de==null?void 0:de.runtimeId)&&o.jsx("button",{type:"button",onClick:()=>void nA(de.runtimeId??"").then(Be),children:T("common.retry")})]}),!J&&!oe&&o.jsxs("div",{className:"aw-version-list",children:[(Ie==null?void 0:Ie.githubSyncError)&&o.jsx("div",{className:"aw-integration-error",role:"alert",children:o.jsx("span",{children:Ie.githubSyncError})}),(Ie==null?void 0:Ie.latestSourceRuntimeStatus)&&Ie.latestSourceRuntimeStatus!=="published"&&((He=Ie.versions[0])==null?void 0:He.commitSha)&&Ie.versions[0].commitSha!==Ie.currentCommitSha&&o.jsx("div",{className:"aw-integration-notice",role:"status",children:o.jsxs("span",{children:[T("agentWorkspace.sourceMergedRuntimeStill"),gte(Ie.latestSourceRuntimeStatus,T),T("agentWorkspace.currentProductionVersionHint")]})}),Ie!=null&&Ie.versions.length?Ie.versions.map(et=>{var To;const ei=et.commitSha??"",ua=et.runtimeStatus??et.status,Xn=et.changeType==="rollback",Ns=!!((To=Ie.cicd)!=null&&To.enabled)&&!!ei&&!Xn&&ei!==Ie.currentCommitSha;return o.jsxs("article",{className:"aw-version-row",children:[o.jsxs("div",{children:[o.jsx("strong",{children:D5t(et,T)}),o.jsx("small",{children:et.createdAt||T("agentWorkspace.noTime")})]}),o.jsxs("div",{children:[o.jsx("span",{children:T("agentWorkspace.prLink")}),et.pullRequestUrl?o.jsx("a",{href:et.pullRequestUrl,target:"_blank",rel:"noopener noreferrer",children:T("agentWorkspace.viewPr")}):o.jsx("em",{children:T("agentWorkspace.noPr")})]}),o.jsxs("div",{children:[o.jsx("span",{children:T("agentWorkspace.author")}),o.jsx("em",{children:et.author||"Studio"})]}),o.jsxs("div",{children:[o.jsx("span",{children:T("agentWorkspace.publishStatus")}),o.jsx("em",{children:gte(ua,T)})]}),o.jsxs("div",{className:"aw-version-actions",children:[o.jsx("button",{type:"button",disabled:!Ns||Ve===ei,onClick:()=>void Sc(et),children:T(Ve===ei?"agentWorkspace.rollingBack":"agentWorkspace.rollbackToVersion")}),et.workflowRunUrl&&o.jsx("a",{href:et.workflowRunUrl,target:"_blank",rel:"noopener noreferrer",children:T("agentWorkspace.viewRelease")})]})]},`${et.version}-${ei||et.createdAt}`)}):o.jsxs("article",{className:"aw-version-row",children:[o.jsxs("div",{children:[o.jsx("strong",{children:Oc!=null?`v${Oc}`:T("agentWorkspace.noVersion")}),o.jsx("small",{children:(q==null?void 0:q.updatedAt)||T("agentWorkspace.noTime")})]}),o.jsx("p",{children:T("agentWorkspace.currentVersionOnly")})]})]})]}),M==="integrations"&&o.jsxs("div",{className:"aw-integration-stack",children:[o.jsxs("div",{className:"aw-integration-intro",children:[o.jsx("h3",{children:T("agentWorkspace.integrationMethods")}),o.jsx("p",{children:T("agentWorkspace.integrationDescription")})]}),ge&&o.jsxs("div",{className:"aw-integration-error",role:"alert",children:[o.jsx("span",{children:ge}),o.jsx("button",{type:"button",onClick:()=>ae(et=>et+1),children:T("common.retry")})]}),!ge&&o.jsxs("div",{className:"aw-integration-body",children:[o.jsxs("div",{className:`aw-integration-protocol-tabs${ue==="a2a"?" is-a2a":""}`,role:"tablist","aria-label":T("agentWorkspace.integrationProtocol"),children:[o.jsx("span",{className:"aw-integration-protocol-slider","aria-hidden":"true"}),sw.map((et,ei)=>o.jsx("button",{type:"button",id:`integration-${et.id}-tab`,role:"tab","aria-selected":ue===et.id,"aria-controls":`integration-${et.id}-panel`,tabIndex:ue===et.id?0:-1,onClick:()=>sf(et.id),onKeyDown:ua=>{var To;if(!["ArrowLeft","ArrowRight","Home","End"].includes(ua.key))return;ua.preventDefault();const Xn=ua.key==="Home"?0:ua.key==="End"?sw.length-1:(ei+(ua.key==="ArrowRight"?1:-1)+sw.length)%sw.length,Ns=sw[Xn];sf(Ns.id),(To=document.getElementById(`integration-${Ns.id}-tab`))==null||To.focus()},children:et.label},et.id))]}),ue==="api-server"?o.jsx(yte,{protocol:"api-server",title:"API Server",available:Qn,fields:[{label:"Agent",value:Qn?((mt=Sr==null?void 0:Sr.apiApps)==null?void 0:mt.join("、"))??"":""},{label:T("agentWorkspace.discoveryEndpoint"),value:Qn?nL(Al,"/list-apps"):""},{label:T("agentWorkspace.invocationEndpoint"),value:Qn?nL(Al,"/run_sse"):""},{label:T("agentWorkspace.authentication"),value:Qn?mte(q==null?void 0:q.authType,T):""},{label:"API Key",value:o.jsx(bte,{available:Qn,authType:q==null?void 0:q.authType,value:xc,visible:De&&!!xc,loading:Ne,error:wt,onToggle:()=>void af()})}],example:Qn?M5t(Al,rf,q==null?void 0:q.authType):""}):o.jsx(yte,{protocol:"a2a",title:"A2A",available:za,fields:[{label:"Agent",value:((dn=Sr==null?void 0:Sr.a2a)==null?void 0:dn.name)??""},{label:"Agent Card",value:za?nL(Al,"/.well-known/agent-card.json"):""},{label:T("agentWorkspace.invocationUrl"),value:ye},{label:T("agentWorkspace.authentication"),value:za?mte(q==null?void 0:q.authType,T):""},{label:"API Key",value:o.jsx(bte,{available:za,authType:q==null?void 0:q.authType,value:xc,visible:De&&!!xc,loading:Ne,error:wt,onToggle:()=>void af()})}],example:za?L5t(ye,q==null?void 0:q.authType):""})]})]}),M==="evaluations"&&o.jsxs("section",{className:"aw-cases",children:[(de==null?void 0:de.runtimeId)&&o.jsx("div",{className:"aw-case-summary",children:["good","bad"].map(et=>{const ei=H5t(qi,et),ua=ka.filter(Ns=>Ns.kind===et).length,Xn=Xo?ua:(ei==null?void 0:ei.itemCount)??ua;return o.jsxs("button",{type:"button",onClick:()=>lf(et),children:[o.jsx("strong",{children:Xn}),o.jsx("span",{children:T(et==="good"?"agentWorkspace.goodCases":"agentWorkspace.badCases")})]},et)})}),o.jsxs("div",{className:"aw-case-filter-bar",children:[o.jsxs("div",{className:"aw-case-filter-stack",children:[o.jsx("div",{className:"aw-case-filters","aria-label":T("agentWorkspace.caseResultFilter"),children:["good","bad"].map(et=>o.jsx("button",{type:"button",className:Qe===et?"is-active":"","aria-pressed":Qe===et,onClick:()=>ut(et),children:T(et==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},et))}),o.jsx("div",{className:"aw-case-source-filters","aria-label":T("agentWorkspace.feedbackSourceFilter"),children:["auto","user"].map(et=>o.jsx("button",{type:"button",className:xt===et?"is-active":"","aria-pressed":xt===et,onClick:()=>W(et),children:T(et==="auto"?"agentWorkspace.automaticFeedback":"agentWorkspace.manualFeedback")},et))})]}),o.jsxs("label",{className:"aw-case-search",children:[o.jsx(P_,{"aria-hidden":!0}),o.jsx("input",{type:"search",value:bt,onChange:et=>it(et.currentTarget.value),placeholder:T("agentWorkspace.searchCasesPlaceholder"),"aria-label":T("agentWorkspace.searchCases")})]})]}),qm&&o.jsx("div",{className:`aw-case-toolbar${we?" is-active":""}`,children:we?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-selection-count",children:T("agentWorkspace.selectedCaseCount",{count:of.length})}),o.jsx("button",{type:"button",onClick:cf,disabled:_l.length===0||In,children:T("agentWorkspace.selectAllVisible")}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void YE(of),disabled:of.length===0||In,children:T(In?"common.deleting":"agentWorkspace.deleteSelected")}),o.jsx("button",{type:"button",onClick:JI,disabled:In,children:T("common.cancel")})]}):o.jsx("button",{type:"button",onClick:()=>{_s(""),Xe(!0)},disabled:_l.length===0||In,children:T("agentWorkspace.selectCases")})}),jr&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:jr}),o.jsx("div",{ref:Vi,children:o.jsx(nLt,{cases:_l,loading:zi&&_l.length===0,error:Lr,notice:xs,runtimeBacked:!!(de!=null&&de.runtimeId),selectionMode:we,selectedCaseIds:Yt,focusedCaseId:Si,expandedCaseIds:Hs,deleting:In,canDelete:qm,onOpenCase:l0,onToggleCase:Fr,onToggleExpanded:Br,onDeleteCase:et=>void YE([et]),onRetry:()=>Nr(et=>et+1)})})]}),M==="optimizations"&&o.jsxs("section",{className:"aw-optimizations",children:[o.jsxs("div",{className:"aw-optimization-intro",children:[o.jsx("h3",{children:T("agentWorkspace.optimizations")}),o.jsx("p",{children:T("agentWorkspace.optimizationsDescription")})]}),Yr?o.jsxs("div",{className:"aw-optimization-state",role:"status",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsx("span",{children:T("agentWorkspace.loadingOptimizations")})]}):sa?o.jsxs("div",{className:"aw-optimization-state is-error",role:"alert",children:[o.jsx("span",{children:sa}),o.jsx("button",{type:"button",onClick:()=>aa(et=>et+1),children:T("common.retry")})]}):As.length>0?o.jsx(eLt,{groups:As}):o.jsx("div",{className:"aw-optimization-state",children:T("agentWorkspace.noOptimizations")})]})]}),M==="basic"&&(de||li)&&o.jsxs("div",{className:"aw-basic-actions",children:[de&&o.jsxs("button",{type:"button",className:"aw-talk studio-update-action",onClick:()=>C==null?void 0:C(de),children:[o.jsx(C7e,{"aria-hidden":!0}),o.jsx("span",{children:T("agentWorkspace.chat")})]}),o.jsxs("span",{className:`aw-update-wrap${$n?" is-disabled":""}`,tabIndex:$n?0:void 0,"aria-describedby":$n?ca:void 0,children:[o.jsx("button",{type:"button",className:"aw-update studio-update-action",disabled:!!$n,"aria-busy":$e||void 0,"aria-describedby":$n?ca:void 0,onClick:()=>li?F==null?void 0:F(li):Lt?A(Lt):void 0,children:$e?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"loading-gap-spinner aw-update-spinner","aria-hidden":"true"}),o.jsx("span",{children:T("agentWorkspace.preparing")})]}):T(li||Sa?"agentWorkspace.continueEditing":"agentWorkspace.update")}),$n&&o.jsx("span",{id:ca,className:"aw-update-disabled-reason",role:"tooltip",children:$n})]})]})]}):null}}),activeSectionKey:M,navigationLabel:T("agentWorkspace.agentDetails"),onSectionChange:U})]})]}),R==="evaluation"&&o.jsx("div",{className:"aw-evaluation-glass",role:"status",children:o.jsx("span",{children:T("agentWorkspace.comingSoon")})})]})]}),oi&&o.jsx(pc,{variant:"danger",title:oi.title,description:oi.description,confirmLabel:en?T("common.deleting"):oi.confirmLabel,closeLabel:T("agentWorkspace.closeDeleteConfirmation"),busy:en,onCancel:()=>Oi(null),onConfirm:()=>void p1()})]})}function eLt({groups:e}){const{t}=Ce("ui");return o.jsx("div",{className:"aw-optimization-table-wrap",children:o.jsxs("table",{className:"aw-optimization-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"col",children:t("agentWorkspace.fixPriority")}),o.jsx("th",{scope:"col",children:t("agentWorkspace.suggestedModule")}),o.jsx("th",{scope:"col",children:t("agentWorkspace.suggestionAndReason")})]})}),o.jsx("tbody",{children:e.map(n=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx("span",{className:`aw-priority is-${n.priority}`,children:Q5t(n.priority,t)})}),o.jsx("td",{children:o.jsx("span",{className:"aw-optimization-module",children:V5t(n,t)})}),o.jsx("td",{children:o.jsx("ul",{className:"aw-optimization-list",children:n.items.map(i=>o.jsxs("li",{children:[o.jsx("strong",{children:i.suggestion}),o.jsx("p",{children:i.reason})]},`${i.suggestion}:${i.reason}`))})})]},`${n.priority}:${n.module}:${n.customModule??""}`))})]})})}function tLt(){return o.jsxs("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:"M4.5 7h15"}),o.jsx("path",{d:"M9 7V4.8h6V7"}),o.jsx("path",{d:"m6.5 7 .8 12h9.4l.8-12"}),o.jsx("path",{d:"M10 10.5v5M14 10.5v5"})]})}function nLt({cases:e,loading:t=!1,error:n="",notice:i="",runtimeBacked:r=!1,selectionMode:s=!1,selectedCaseIds:a,focusedCaseId:l="",expandedCaseIds:c,deleting:u=!1,canDelete:d=!1,onOpenCase:f,onToggleCase:h,onToggleExpanded:p,onDeleteCase:g,onRetry:b}){const{t:v,i18n:y}=Ce("ui");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:v("agentWorkspace.userInput")}),o.jsx("span",{children:v("agentWorkspace.agentOutput")}),o.jsx("span",{children:v("agentWorkspace.score")}),o.jsx("span",{children:v("agentWorkspace.scoreReason")}),o.jsx("span",{className:"aw-case-action-head",children:v("skillCenter.actions")})]}),t?o.jsx("div",{className:"aw-case-empty",children:v("agentWorkspace.loadingEvaluationSet")}):n?o.jsxs("div",{className:"aw-case-empty aw-case-error",children:[o.jsx("span",{children:n}),b&&o.jsx("button",{type:"button",onClick:b,children:v("common.retry")})]}):i?o.jsx("div",{className:"aw-case-empty",children:i}):e.length===0?o.jsx("div",{className:"aw-case-empty",children:v(r?"agentWorkspace.noFeedbackCases":"agentWorkspace.noMatchingCases")}):e.map(x=>{var _,j;const O=x.id.startsWith("local:"),w=(a==null?void 0:a.has(x.id))??!1,k=(c==null?void 0:c.has(x.id))??!1,E=x.output.length+x.referenceOutput.length>220||(((_=x.reason)==null?void 0:_.length)??0)>120,C=d&&!O,N=!!(x.comment&&x.comment.trim()!==((j=x.reason)==null?void 0:j.trim()));return o.jsxs("div",{className:["aw-case-row",l===x.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){C&&(h==null||h(x));return}f==null||f(x)},onKeyDown:A=>{A.target===A.currentTarget&&(A.key!=="Enter"&&A.key!==" "||(A.preventDefault(),s?C&&(h==null||h(x)):f==null||f(x)))},children:[o.jsxs("div",{className:"aw-case-text aw-case-cell","data-label":v("agentWorkspace.userInput"),children:[o.jsxs("span",{className:"aw-case-title-line",children:[s&&C&&o.jsx("span",{className:`aw-select-marker${w?" is-checked":""}`,"aria-hidden":"true"}),o.jsx("strong",{title:x.input,children:x.input||v("agentWorkspace.noUserInput")})]}),N&&o.jsxs("small",{title:x.comment,children:[v("agentWorkspace.note"),x.comment]}),o.jsx("small",{className:"aw-case-time",children:B5t(x.createdAt,y.resolvedLanguage??y.language,v)}),(x.userId||x.sessionId)&&o.jsx("small",{title:[x.userId,x.sessionId].filter(Boolean).join(" · "),children:[x.userId,x.sessionId].filter(Boolean).join(" · ")})]}),o.jsxs("div",{className:`aw-case-output aw-case-cell${k?" is-expanded":""}`,"data-label":v("agentWorkspace.agentOutput"),children:[o.jsx("p",{className:"aw-case-output-preview",title:x.output,children:x.output||v("agentWorkspace.noVisibleResponse")}),x.referenceOutput&&o.jsxs("small",{className:"aw-case-output-preview",title:x.referenceOutput,children:[v("agentWorkspace.reference"),": ",x.referenceOutput]}),E&&o.jsx("button",{type:"button",className:"aw-case-expand",onClick:A=>{A.stopPropagation(),p==null||p(x.id)},children:v(k?"common.collapse":"common.expand")})]}),o.jsx("div",{className:"aw-case-score aw-case-cell","data-label":v("agentWorkspace.score"),children:U5t(x,v)}),o.jsx("div",{className:`aw-case-reason aw-case-cell${k?" is-expanded":""}`,"data-label":v("agentWorkspace.scoreReason"),children:o.jsx("p",{title:x.reason||void 0,children:x.reason||"—"})}),o.jsx("div",{className:"aw-case-actions aw-case-cell","data-label":v("skillCenter.actions"),children:C&&o.jsx("button",{type:"button",className:"aw-case-delete",onClick:A=>{A.stopPropagation(),g==null||g(x)},disabled:u,title:v("agentWorkspace.deleteFeedbackCase"),"aria-label":v("agentWorkspace.deleteFeedbackCase"),children:o.jsx(tLt,{})})})]},x.id)})]})}function iLt({group:e,agents:t,cases:n,onChange:i,onRun:r}){const{t:s}=Ce("ui"),[a,l]=m.useState("config"),c=e.agentIds.map(h=>t.find(p=>p.id===h)).filter(h=>!!h),u=["回答质量","事实准确性","工具调用","响应效率"];m.useEffect(()=>l("config"),[e.id]);const d=h=>{i({...e,agentIds:e.agentIds.includes(h)?e.agentIds.filter(p=>p!==h):[...e.agentIds,h]})},f=h=>{i({...e,metrics:e.metrics.includes(h)?e.metrics.filter(p=>p!==h):[...e.metrics,h]})};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:Ww(e.name,s)}),o.jsx("span",{children:s("agentWorkspace.evaluationGroup")})]}),o.jsx("p",{children:s("agentWorkspace.evaluationGroupStats",{agents:c.length,caseSet:Ww(e.caseSet,s),runs:e.history.length})})]}),o.jsxs("button",{type:"button",className:"aw-run",onClick:()=>r(e),disabled:!0,children:[o.jsx(v7e,{"aria-hidden":!0}),s("agentWorkspace.startEvaluation")]})]}),o.jsxs("nav",{className:"aw-agent-tabs","aria-label":s("agentWorkspace.evaluationGroupDetails"),children:[o.jsx("button",{type:"button",className:a==="config"?"is-active":"","aria-pressed":a==="config",onClick:()=>l("config"),disabled:!0,children:s("agentWorkspace.evaluationConfig")}),o.jsx("button",{type:"button",className:a==="history"?"is-active":"","aria-pressed":a==="history",onClick:()=>l("history"),disabled:!0,children:s("agentWorkspace.historyResults")})]}),o.jsx("div",{className:"aw-content",children:a==="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:s("agentWorkspace.participatingAgents")}),o.jsx("span",{children:s("agentWorkspace.selectedCount",{count:c.length})})]}),o.jsx("div",{className:"aw-eval-agent-grid",children:t.map(h=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:e.agentIds.includes(h.id),onChange:()=>d(h.id)}),o.jsxs("span",{children:[o.jsx("strong",{children:h.label}),o.jsx("small",{children:h.remote?s("agentWorkspace.remote"):s("agentWorkspace.local")})]})]},h.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:s("agentWorkspace.evaluationResources")})}),o.jsxs("div",{className:"aw-eval-fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:s("agentWorkspace.evaluationSet")}),o.jsxs("select",{value:e.caseSet,onChange:h=>i({...e,caseSet:h.currentTarget.value}),children:[o.jsx("option",{value:"核心回归集",children:s("agentWorkspace.evaluationDefaults.coreSet")}),o.jsx("option",{value:"安全边界集",children:s("agentWorkspace.evaluationDefaults.safetySet")}),o.jsx("option",{value:"工具调用集",children:s("agentWorkspace.evaluationDefaults.toolSet")})]}),o.jsx("small",{children:s("agentWorkspace.caseCount",{count:n.length})})]}),o.jsxs("label",{children:[o.jsx("span",{children:s("agentWorkspace.evaluator")}),o.jsxs("select",{value:e.evaluator,onChange:h=>i({...e,evaluator:h.currentTarget.value}),children:[o.jsx("option",{value:"综合质量评估器",children:s("agentWorkspace.evaluationDefaults.qualityEvaluator")}),o.jsx("option",{value:"事实一致性评估器",children:s("agentWorkspace.evaluationDefaults.factualEvaluator")}),o.jsx("option",{value:"工具调用评估器",children:s("agentWorkspace.evaluationDefaults.toolEvaluator")})]})]}),o.jsxs("label",{children:[o.jsx("span",{children:s("agentWorkspace.concurrency")}),o.jsxs("select",{value:e.concurrency,onChange:h=>i({...e,concurrency:h.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:s("agentWorkspace.evaluationMetrics")}),o.jsx("span",{children:s("agentWorkspace.selectedMetricCount",{count:e.metrics.length})})]}),o.jsx("div",{className:"aw-metric-list",children:u.map(h=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:e.metrics.includes(h),onChange:()=>f(h)}),o.jsx("span",{children:Ww(h,s)})]},h))})]})]})]}):o.jsxs("section",{className:"aw-eval-history",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:s("agentWorkspace.historyResults")}),o.jsx("p",{children:s("agentWorkspace.historyDescription")})]})}),e.history.length===0?o.jsxs("div",{className:"aw-results-empty",children:[o.jsx("strong",{children:s("agentWorkspace.noHistory")}),o.jsx("span",{children:s("agentWorkspace.noHistoryDescription")})]}):o.jsx("div",{className:"aw-history-list",children:e.history.map((h,p)=>o.jsxs("button",{type:"button",children:[o.jsxs("span",{children:[o.jsx("strong",{children:s("agentWorkspace.evaluationRun",{index:e.history.length-p})}),o.jsx("small",{children:s("agentWorkspace.evaluationRunMeta",{time:Ww(h.createdAt,s),agents:c.length})})]}),o.jsxs("span",{className:"aw-history-score",children:[o.jsx("strong",{children:h.score}),o.jsx("small",{children:s("agentWorkspace.overallScore")})]}),o.jsxs("span",{className:"aw-complete",children:[o.jsx(Vu,{}),s("agentWorkspace.completed")]}),o.jsx(bO,{"aria-hidden":!0})]},h.id))})]})})]})}const rLt=5e3,sLt=4;let iL=0;const xte=[];function wte(e){return e instanceof Error&&e.name==="AbortError"}function aLt(e){return e instanceof Error&&e.name==="TimeoutError"}function oLt(e){return aLt(e)||e instanceof n7&&[500,502,503,504].includes(e.status)}function lLt(e,t){return t!=null&&t.aborted?Promise.reject(t.reason??new DOMException("Request aborted","AbortError")):new Promise((n,i)=>{const r=()=>{globalThis.clearTimeout(s),i((t==null?void 0:t.reason)??new DOMException("Request aborted","AbortError"))},s=globalThis.setTimeout(()=>{t==null||t.removeEventListener("abort",r),n()},e);t==null||t.addEventListener("abort",r,{once:!0})})}async function cLt(e={},t={}){const n=t.request??_x,i=t.wait??lLt;try{return await n(e)}catch(r){if(!oLt(r))throw r;return await i(rLt,e.signal),n(e)}}async function xje(e){var t;iL>=sLt&&await new Promise(n=>xte.push(n)),iL+=1;try{return await e()}finally{iL-=1,(t=xte.shift())==null||t()}}async function uLt(e,t){await Promise.allSettled(e.map(n=>xje(()=>t(n))))}const dLt="/web/sandbox/sessions",Ote="/web/sandbox/codex-project-handoff",Ste=3e4,rL=33e4,fLt=6e4,hLt=6e5,aw=15e3,If=6e4,pLt=33e4,kte=3e4,mLt=60*60,Ete=40;function KQ(e){switch(e.trim().toLowerCase()){case"ready":return V("sandbox.status.ready");case"wakeable":return V("sandbox.status.wakeable");case"creating":return V("sandbox.status.creating");case"starting":case"initializing":return V("sandbox.status.starting");case"pending":return V("sandbox.status.pending");case"running":return V("sandbox.status.running");case"failed":case"error":return V("sandbox.status.failed");case"stopped":return V("sandbox.status.stopped");case"expired":return V("sandbox.status.expired");case"deleting":return V("sandbox.status.deleting");case"deleted":return V("sandbox.status.deleted");default:return V("sandbox.status.unknown")}}function Jr(e){const t=Hu(e);return t.has("Accept")||t.set("Accept","application/json"),t}class FI extends Error{constructor(n,i={}){var r;super(n);ki(this,"code");ki(this,"retryable");ki(this,"publicMessage");ki(this,"httpStatus");this.name="SandboxServiceError",this.code=i.code??"",this.retryable=i.retryable===!0,this.publicMessage=((r=i.publicMessage)==null?void 0:r.trim())||n,this.httpStatus=i.httpStatus}}function Cte(e){return e instanceof FI?e.publicMessage:e instanceof Error&&e.name==="TimeoutError"?V("sandbox.developmentTimeout"):e instanceof TypeError?V("sandbox.developmentDisconnected"):V("sandbox.developmentFailed")}async function es(e,t){const n=await e.text().catch(()=>"");let i={};try{i=JSON.parse(n)}catch{const d=V("common.fallbackWithHttpStatus",{fallback:t,status:e.status});return new Error(n?V("common.fallbackWithDetail",{fallback:d,detail:n}):d)}const r=i.detail,s=r&&typeof r=="object"?r:i,a=r&&typeof r=="object"&&"message"in r?r.message:r??i.error??i.message,l=typeof a=="string"?a:a==null?"":JSON.stringify(a),c=V("common.fallbackWithHttpStatus",{fallback:t,status:e.status}),u=l?V("common.fallbackWithDetail",{fallback:c,detail:l}):c;return new FI(u,{code:typeof s.code=="string"?s.code:"",retryable:s.retryable===!0,publicMessage:l||c,httpStatus:e.status})}async function Tte(e,t){const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{throw new Error(V("sandbox.invalidStudioResponse",{fallback:t}))}}function og(e,t="codex"){if(!e.sessionId||!e.status)throw new Error(V("sandbox.invalidSession"));return{resourceType:"session",id:e.sessionId,toolName:t,userSessionId:e.userSessionId??"",displayName:e.displayName??"",status:e.status,createdAt:e.createdAt??"",expireAt:e.expireAt??"",persistent:e.persistent!==!1,toolType:e.toolType??"",intelligentDevelopment:e.toolName==="intelligent-development",createdBy:e.createdBy??"",region:e.region??"",isMine:e.isMine===!0,threadId:e.threadId??"",cwd:e.cwd??"",workspaceLocked:e.workspaceLocked===!0,busy:e.busy===!0,...typeof e.model=="string"?{model:e.model}:{},permissions:BI(e.permissions),...e.conversation===void 0?{}:{restoredConversation:Eg(e.conversation)}}}function Ate(e,t="codex"){if(!e.snapshotId||!e.status)throw new Error(V("sandbox.invalidSnapshot"));return{resourceType:"snapshot",id:e.snapshotId,snapshotId:e.snapshotId,sourceSessionId:e.sessionId??"",toolName:t,userSessionId:e.userSessionId??"",displayName:e.displayName??"",status:e.status,snapshotStatus:e.snapshotStatus??"Unknown",reason:e.reason??"",createdAt:e.createdAt??"",createdBy:e.createdBy??"",region:e.region??"",isMine:e.isMine===!0}}function _te(e,t){if((t==null?void 0:t.autoResumeSnapshots)===void 0)return e;const n=new URLSearchParams({autoResumeSnapshots:String(t.autoResumeSnapshots)});return`${e}?${n.toString()}`}const ow={approvalPolicy:"on-request",approvalsReviewer:"user",sandboxMode:"workspace-write",networkAccess:!1};function BI(e){if(!e||typeof e!="object")return{...ow};const t=e,n=t.approvalPolicy,i=t.approvalsReviewer,r=t.sandboxMode;return{approvalPolicy:n==="untrusted"||n==="on-request"||n==="never"?n:ow.approvalPolicy,approvalsReviewer:i==="user"||i==="auto_review"?i:ow.approvalsReviewer,sandboxMode:r==="read-only"||r==="workspace-write"||r==="danger-full-access"?r:ow.sandboxMode,networkAccess:typeof t.networkAccess=="boolean"?t.networkAccess:ow.networkAccess}}function Nte(e){if(!e||typeof e!="object")throw new Error(V("sandbox.invalidSettings"));const t=e;return{threadId:typeof t.threadId=="string"?t.threadId:"",cwd:typeof t.cwd=="string"?t.cwd:"",...typeof t.model=="string"?{model:t.model}:{},workspaceLocked:t.workspaceLocked===!0,busy:t.busy===!0,permissions:BI(t.permissions)}}function _a(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function gLt(e){const t=_a(e);if(!(!t||typeof t.id!="string"||!t.id))return{id:t.id,displayName:typeof t.displayName=="string"?t.displayName:t.id,description:typeof t.description=="string"?t.description:"",isDefault:t.isDefault===!0}}function bLt(e){const t=_a(e);if(!(!t||typeof t.id!="string"||!t.id||typeof t.name!="string"||!t.name))return{id:t.id,name:t.name,description:typeof t.description=="string"?t.description:""}}function wje(e){const t=_a(e);if(!(!t||typeof t.id!="string"||!t.id))return{id:t.id,...typeof t.name=="string"&&t.name?{name:t.name}:{},preview:typeof t.preview=="string"?t.preview:"",cwd:typeof t.cwd=="string"?t.cwd:"",modelProvider:typeof t.modelProvider=="string"?t.modelProvider:"",createdAt:typeof t.createdAt=="number"&&Number.isFinite(t.createdAt)?t.createdAt:0,updatedAt:typeof t.updatedAt=="number"&&Number.isFinite(t.updatedAt)?t.updatedAt:0,status:typeof t.status=="string"?t.status:"unknown"}}function Eg(e){const t=_a(e),n=wje(t==null?void 0:t.thread);if(!t||!n||typeof t.threadId!="string"||!Array.isArray(t.messages))throw new Error(V("sandbox.invalidThreadSnapshot"));const i=t.messages.flatMap(r=>{const s=_a(r);if(!s||typeof s.id!="string"||s.role!=="user"&&s.role!=="assistant"||typeof s.content!="string"||typeof s.timestamp!="number")return[];const a=Array.isArray(s.skillNames)?s.skillNames.filter(c=>typeof c=="string"&&!!c):[],l=Array.isArray(s.images)?s.images.flatMap(c=>{const u=_a(c);return!u||typeof u.mimeType!="string"||!u.mimeType.startsWith("image/")||typeof u.data!="string"||!u.data?[]:[{mimeType:u.mimeType,data:u.data,...typeof u.name=="string"&&u.name?{name:u.name}:{},...typeof u.alt=="string"&&u.alt?{alt:u.alt}:{}}]}):[];return[{id:s.id,role:s.role,content:s.content,timestamp:s.timestamp,...a.length?{skillNames:a}:{},...l.length?{images:l}:{}}]});return{thread:n,threadId:t.threadId,messages:i,...typeof t.model=="string"?{model:t.model}:{},...typeof t.cwd=="string"?{cwd:t.cwd}:{},workspaceLocked:t.workspaceLocked===!0,permissions:BI(t.permissions)}}function x8(e){if(!e||typeof e!="object")return;const t=e;if(![t.totalTokens,t.inputTokens,t.cachedInputTokens,t.outputTokens,t.reasoningOutputTokens].some(i=>typeof i!="number"||!Number.isFinite(i)||i<0))return{totalTokens:Math.trunc(t.totalTokens),inputTokens:Math.trunc(t.inputTokens),cachedInputTokens:Math.trunc(t.cachedInputTokens),outputTokens:Math.trunc(t.outputTokens),reasoningOutputTokens:Math.trunc(t.reasoningOutputTokens)}}function yLt(e){const t=x8(e.usage);if(!t||typeof e.turnId!="string")return;const n=x8(e.threadTotal),i=e.modelContextWindow;return{turnId:e.turnId,usage:t,...n?{threadTotal:n}:{},...typeof i=="number"&&Number.isFinite(i)&&i>=0?{modelContextWindow:Math.trunc(i)}:{}}}function vLt(e){return typeof e.id!="string"||e.kind!=="command"&&e.kind!=="file"||typeof e.method!="string"?null:{id:e.id,kind:e.kind,method:e.method,...typeof e.reason=="string"?{reason:e.reason}:{},...typeof e.command=="string"?{command:e.command}:{},...typeof e.cwd=="string"?{cwd:e.cwd}:{},...typeof e.grantRoot=="string"?{grantRoot:e.grantRoot}:{},...e.changes!==void 0?{changes:e.changes}:{},...typeof e.threadId=="string"?{threadId:e.threadId}:{},...typeof e.turnId=="string"?{turnId:e.turnId}:{},...typeof e.itemId=="string"?{itemId:e.itemId}:{}}}async function xLt(e,t={}){if(!e.body)throw new Error(V("sandbox.emptyConversationResponse"));const n=e.body.getReader(),i=new TextDecoder;let r="",s="";const a=[],l=new Map;let c,u;function d(){var b;const g=c?[...a,c]:a;(b=t.onBlocks)==null||b.call(t,g.map(v=>({...v})))}function f(g){s+=g;const b=a[a.length-1],v=a.length-1,y=[...l.values()].includes(v);(b==null?void 0:b.kind)==="text"&&!y?b.text+=g:a.push({kind:"text",text:g}),d()}function h(g){if(typeof g.id!="string"||g.kind!=="thinking"&&g.kind!=="commentary"&&g.kind!=="tool"||g.status!=="running"&&g.status!=="done")return;const b=g.status==="done";let v;if(g.kind==="thinking"){if(typeof g.text!="string"||!g.text)return;v={kind:"thinking",text:g.text,done:b}}else if(g.kind==="commentary"){if(typeof g.text!="string"||!g.text)return;v={kind:"text",text:g.text}}else{if(typeof g.name!="string"||!g.name)return;v={kind:"tool",name:g.name,args:g.args,response:g.response,done:b}}const y=l.get(g.id);y===void 0?(l.set(g.id,a.length),a.push(v)):a[y]=v,d()}function p(g){var x,O,w;let b="message";const v=[];for(const k of g.split(/\r?\n/))k.startsWith("event:")&&(b=k.slice(6).trim()),k.startsWith("data:")&&v.push(k.slice(5).trimStart());if(v.length===0)return;let y;try{y=JSON.parse(v.join(` +`))}catch{throw new Error(V("sandbox.invalidConversationResponse"))}if(b==="error"){const k=typeof y.message=="string"&&y.message?y.message:V("sandbox.conversationFailed");throw new FI(k,{code:typeof y.code=="string"?y.code:"",retryable:y.retryable===!0,publicMessage:k})}if(b==="progress"&&typeof y.text=="string"&&y.text&&(c={kind:"progress",text:y.text},d()),b==="activity"&&h(y),b==="development.source_ready"||b==="development.succeeded"){const k=_a(y.payload),S=_a(k==null?void 0:k.delivery),E=b==="development.succeeded";if(S&&typeof S.sessionId=="string"&&typeof S.artifactSha256=="string"&&typeof S.validationReportSha256=="string"&&typeof S.agentName=="string"&&typeof S.entryPoint=="string"&&typeof S.fileCount=="number"&&typeof S.artifactSize=="number"&&typeof S.validatedAt=="string"&&S.deployable===!0&&S.verified===E&&typeof S.validationSummary=="string"&&Array.isArray(S.gateSummary)&&S.gateSummary.every(C=>typeof C=="string")){const C={kind:"delivery",value:{sessionId:S.sessionId,...typeof S.projectId=="string"&&typeof S.versionId=="string"?{projectId:S.projectId,versionId:S.versionId,...S.parentVersionId===null||typeof S.parentVersionId=="string"?{parentVersionId:S.parentVersionId}:{}}:{},artifactSha256:S.artifactSha256,validationReportSha256:S.validationReportSha256,agentName:S.agentName,entryPoint:S.entryPoint,fileCount:S.fileCount,artifactSize:S.artifactSize,validatedAt:S.validatedAt,gateSummary:S.gateSummary,deployable:S.deployable,verified:S.verified,validationSummary:S.validationSummary}},N=a.findIndex(_=>_.kind==="delivery"&&_.value.sessionId===S.sessionId&&_.value.artifactSha256===S.artifactSha256&&_.value.validationReportSha256===S.validationReportSha256);N===-1?a.push(C):a[N]=C,d()}}if(b==="approval"){const k=vLt(y);k&&((x=t.onApproval)==null||x.call(t,k))}if(b==="usage"){const k=yLt(y);k&&(u=k,(O=t.onUsage)==null||O.call(t,k))}b==="approval_resolved"&&typeof y.approvalId=="string"&&((w=t.onApprovalResolved)==null||w.call(t,y.approvalId)),b==="delta"&&typeof y.text=="string"&&f(y.text),b==="done"&&!s&&typeof y.text=="string"&&f(y.text),b==="done"&&c&&(c=void 0,d())}for(;;){const{done:g,value:b}=await n.read();r+=i.decode(b,{stream:!g});const v=r.split(/\r?\n\r?\n/);if(r=v.pop()??"",v.forEach(p),g)break}if(r.trim()&&p(r),c&&(c=void 0,d()),a.length===0)throw new Error(V("sandbox.emptyReply"));return{text:s,blocks:a,...u?{usage:u}:{}}}async function $l(e,t,n,{method:i="GET",body:r,options:s={},fallback:a}){if(!t)throw new Error(V("sandbox.missingSession"));const l=await Tn(`${e}/${encodeURIComponent(t)}/${n}`,{method:i,headers:Jr(r===void 0?void 0:{"Content-Type":"application/json"}),...r===void 0?{}:{body:JSON.stringify(r)},signal:s.signal},If);if(!l.ok)throw await es(l,a);return l.json()}function Oje(e,t={}){return{async listSessions(n={}){var s;const i=await Tn(_te(e,n),{method:"GET",headers:Jr(),signal:n.signal},Ste);if(!i.ok)throw await es(i,V("sandbox.listCodexFailed"));const r=await i.json();if(!Array.isArray(r.sessions))throw new Error(V("sandbox.invalidSessionList"));if(r.snapshots!==void 0&&!Array.isArray(r.snapshots))throw new Error(V("sandbox.invalidSnapshotList"));return(s=n.onRecoveryStatus)==null||s.call(n,r.restoringSnapshots===!0,r.snapshotRecoveryPaused===!0),[...r.sessions.map(a=>og(a)),...(r.snapshots??[]).map(a=>Ate(a))]},async startSession(n={}){var r,s;const i=await Tn(e,{method:"POST",headers:Jr({"Content-Type":"application/json"}),body:JSON.stringify({displayName:((r=n.displayName)==null?void 0:r.trim())??"",...(s=n.modelId)!=null&&s.trim()?{modelId:n.modelId.trim()}:{},...t.textOnly&&n.projectId?{projectId:n.projectId,...n.baseVersionId?{baseVersionId:n.baseVersionId}:{}}:{},...t.textOnly?{}:{persistent:n.persistent??!0},...n.diskGb!==void 0?{diskGb:n.diskGb}:{}}),signal:n.signal},rL);if(!i.ok)throw await es(i,V("sandbox.startFailed"));return og(await i.json())},async listAgentSessions(n,i={}){var a;const r=await Tn(_te(`/web/${n}/sessions`,i),{method:"GET",headers:Jr(),signal:i.signal},Ste);if(!r.ok)throw await es(r,V("sandbox.listAgentFailed",{kind:n}));const s=await r.json();if(!Array.isArray(s.sessions))throw new Error(V("sandbox.invalidKindSessionList",{kind:n}));if(s.snapshots!==void 0&&!Array.isArray(s.snapshots))throw new Error(V("sandbox.invalidKindSnapshotList",{kind:n}));return(a=i.onRecoveryStatus)==null||a.call(i,s.restoringSnapshots===!0,s.snapshotRecoveryPaused===!0),[...s.sessions.map(l=>og(l,n)),...(s.snapshots??[]).map(l=>Ate(l,n))]},async startAgentSession(n,i={}){var s;const r=await Tn(`/web/${n}/sessions`,{method:"POST",headers:Jr({"Content-Type":"application/json"}),body:JSON.stringify({displayName:((s=i.displayName)==null?void 0:s.trim())??"",persistent:i.persistent??!0,...i.diskGb!==void 0?{diskGb:i.diskGb}:{}}),signal:i.signal},rL);if(!r.ok)throw await es(r,V("sandbox.createAgentFailed",{kind:n}));return og(await r.json(),n)},async openAgentSession(n,i,r={}){if(!i)throw new Error(V("sandbox.missingSessionToOpen"));const s=await Tn(`/web/${n}/sessions/${encodeURIComponent(i)}/open`,{method:"POST",headers:Jr(),signal:r.signal},If);if(!s.ok)throw await es(s,V("sandbox.openAgentFailed",{kind:n}));const a=await s.json();if(typeof a.webuiUrl!="string"||!a.webuiUrl.startsWith("/"))throw new Error(V("sandbox.invalidAgentHomeUrl",{kind:n}));return{session:og(a,n),kind:n,webuiUrl:Bo(a.webuiUrl)}},async launchAgentTerminal(n,i,r={}){if(!i)throw new Error(V("sandbox.missingSessionForTerminal"));const s=await Tn(`/web/${n}/sessions/${encodeURIComponent(i)}/terminal`,{method:"POST",headers:Jr(),signal:r.signal},If);if(!s.ok)throw await es(s,V("sandbox.openTerminalFailed",{kind:n}));const a=await s.json();return{url:Sje(a.url,`${n} Terminal`),...typeof a.shellSessionId=="string"?{shellSessionId:a.shellSessionId}:{}}},async deleteAgentSession(n,i,r={}){if(!i)return;const s=await Tn(`/web/${n}/sessions/${encodeURIComponent(i)}`,{method:"DELETE",headers:Jr(),signal:r.signal},aw);if(!s.ok&&s.status!==404)throw await es(s,V("sandbox.deleteAgentFailed",{kind:n}))},async resumeSnapshot(n,i,r={}){if(!i)throw new Error(V("sandbox.missingSnapshot"));const s=n==="codex"?"/web/sandbox":`/web/${n}`,a=await Tn(`${s}/snapshots/${encodeURIComponent(i)}/resume`,{method:"POST",headers:Jr(),signal:r.signal},rL);if(!a.ok)throw await es(a,V("sandbox.resumeSnapshotFailed"));return og(await a.json(),n)},async deleteSnapshot(n,i,r={}){if(!i)return;const s=n==="codex"?"/web/sandbox":`/web/${n}`,a=await Tn(`${s}/snapshots/${encodeURIComponent(i)}`,{method:"DELETE",headers:Jr(),signal:r.signal},aw);if(!a.ok&&a.status!==404)throw await es(a,V("sandbox.deleteSnapshotFailed"))},async connectSession(n,i={}){if(!n)throw new Error(V("sandbox.missingSessionToConnect"));const r=await Tn(`${e}/${encodeURIComponent(n)}/connect`,{method:"POST",headers:Jr({"Content-Type":"application/json"}),signal:i.signal},fLt);if(!r.ok)throw await es(r,V("sandbox.connectCodexFailed"));const s=og(await r.json());if(s.status.toLowerCase()!=="ready")throw new Error(V("sandbox.sessionNotReady",{status:s.status}));return s},async sendMessage(n,i={}){var s;if(!n.sessionId||!n.text.trim())throw new Error(V("sandbox.invalidMessage"));const r=await Tn(`${e}/${encodeURIComponent(n.sessionId)}/messages`,{method:"POST",headers:Jr({Accept:"text/event-stream","Content-Type":"application/json"}),body:JSON.stringify({message:n.text,...!t.textOnly&&((s=n.skillIds)!=null&&s.length)?{skillIds:n.skillIds}:{}}),signal:i.signal},t.messageTimeoutMs??hLt);if(!r.ok)throw await es(r,V("sandbox.conversationFailed"));return xLt(r,i)},async interruptSession(n,i={}){if(!n)return;const r=await Tn(`${e}/${encodeURIComponent(n)}/interrupt`,{method:"POST",headers:Jr(),signal:i.signal},t.interruptTimeoutMs??aw);if(!r.ok&&![404,409].includes(r.status))throw await es(r,V("sandbox.interruptFailed"))},async getStatus(n,i={}){const r=await $l(e,n,"status",{options:i,fallback:V("sandbox.getStatusFailed")}),s=Nte(r),a=_a(r),l=x8(a==null?void 0:a.threadTotal),c=a==null?void 0:a.modelContextWindow;return{...s,...l?{threadTotal:l}:{},...typeof c=="number"&&Number.isFinite(c)&&c>=0?{modelContextWindow:Math.trunc(c)}:{}}},async getEndpoint(n,i={}){const r=_a(await $l(e,n,"endpoint",{options:i,fallback:V("sandbox.getEndpointFailed")}));if(typeof(r==null?void 0:r.endpoint)!="string"||!r.endpoint.trim())throw new Error(V("sandbox.invalidEndpoint"));return{endpoint:r.endpoint,sessionId:typeof r.sessionId=="string"?r.sessionId:n,...typeof r.expireAt=="string"?{expireAt:r.expireAt}:{}}},async createCodexProjectHandoffPairing(n={}){const i=await Tn(`${Ote}/pairings`,{method:"POST",headers:Jr({Accept:"application/json","Content-Type":"application/json"}),body:JSON.stringify({ttlSeconds:mLt}),signal:n.signal},kte);if(!i.ok)throw await es(i,V("sandbox.createHandoffPairingFailed"));const r=_a(await Tte(i,V("sandbox.createHandoffPairingFailed")));if(typeof(r==null?void 0:r.pairingCode)!="string"||!r.pairingCode.trim()||typeof r.expireAt!="string"||!r.expireAt.trim())throw new Error(V("sandbox.invalidHandoffPairing"));const s=typeof r.studioUrl=="string"&&r.studioUrl.trim()?r.studioUrl.trim():window.location.origin;return{pairingCode:r.pairingCode,expireAt:r.expireAt,studioUrl:s}},async getCodexProjectHandoffStatus(n,i={}){const r=await Tn(`${Ote}/pairings/${encodeURIComponent(n)}`,{headers:Jr({Accept:"application/json"}),signal:i.signal},kte);if(!r.ok)throw await es(r,V("sandbox.getHandoffStatusFailed"));const s=_a(await Tte(r,V("sandbox.getHandoffStatusFailed"))),a=new Set(["issued","creating","session-created","continuing","running","completed","failed"]);if(typeof(s==null?void 0:s.state)!="string"||!a.has(s.state)||typeof s.expireAt!="string"||!s.expireAt.trim())throw new Error(V("sandbox.invalidHandoffStatus"));return{state:s.state,expireAt:s.expireAt,...typeof s.projectName=="string"?{projectName:s.projectName}:{},...typeof s.agentName=="string"?{agentName:s.agentName}:{},...typeof s.sessionId=="string"?{sessionId:s.sessionId}:{},...typeof s.error=="string"?{error:s.error}:{},...s.failedStage==="creating-session"||s.failedStage==="uploading-project"||s.failedStage==="restoring-project"||s.failedStage==="continuing-task"?{failedStage:s.failedStage}:{}}},async listModels(n,i={}){const r=_a(await $l(e,n,"models",{options:i,fallback:V("sandbox.listModelsFailed")}));if(!Array.isArray(r==null?void 0:r.models))throw new Error(V("sandbox.invalidModelList"));return r.models.flatMap(s=>{const a=gLt(s);return a?[a]:[]})},async setModel(n,i,r={}){const s=_a(await $l(e,n,"model",{method:"PUT",body:{model:i},options:r,fallback:V("sandbox.setModelFailed")}));if(typeof(s==null?void 0:s.model)!="string"||!s.model)throw new Error(V("sandbox.invalidModel"));return s.model},async listSkills(n,i=!1,r={}){const a=_a(await $l(e,n,`skills${i?"?force_reload=true":""}`,{options:r,fallback:V("sandbox.listSkillsFailed")}));if(!Array.isArray(a==null?void 0:a.skills))throw new Error(V("sandbox.invalidSkillList"));return a.skills.flatMap(l=>{const c=bLt(l);return c?[c]:[]})},async listThreads(n,i={},r={}){const s=new URLSearchParams;i.cursor&&s.set("cursor",i.cursor),i.search&&s.set("search",i.search),i.archived&&s.set("archived","true");const a=s.size?`?${s}`:"",l=_a(await $l(e,n,`threads${a}`,{options:r,fallback:V("sandbox.listThreadsFailed")}));if(!Array.isArray(l==null?void 0:l.threads))throw new Error(V("sandbox.invalidThreadList"));return{threads:l.threads.flatMap(c=>{const u=wje(c);return u?[u]:[]}),...typeof l.nextCursor=="string"?{nextCursor:l.nextCursor}:{}}},async newThread(n,i={}){return Eg(await $l(e,n,"threads/new",{method:"POST",options:i,fallback:V("sandbox.createThreadFailed")}))},async readThread(n,i,r={}){if(!i)throw new Error(V("sandbox.missingThread"));return Eg(await $l(e,n,`threads/${encodeURIComponent(i)}`,{options:r,fallback:V("sandbox.readThreadFailed")}))},async resumeThread(n,i,r={}){return Eg(await $l(e,n,"threads/resume",{method:"POST",body:{threadId:i},options:r,fallback:V("sandbox.resumeThreadFailed")}))},async forkThread(n,i={}){return Eg(await $l(e,n,"threads/fork",{method:"POST",options:i,fallback:V("sandbox.forkThreadFailed")}))},async archiveThread(n,i,r={}){const s=_a(await $l(e,n,"threads/archive",{method:"POST",body:{threadId:i},options:r,fallback:V("sandbox.archiveThreadFailed")}));if((s==null?void 0:s.archived)!==!0)throw new Error(V("sandbox.invalidArchiveResult"));return{archived:!0,...s.thread?{snapshot:Eg(s)}:{}}},async deleteThread(n,i,r={}){const s=_a(await $l(e,n,"threads/delete",{method:"POST",body:{threadId:i},options:r,fallback:V("sandbox.deleteThreadFailed")}));if((s==null?void 0:s.deleted)!==!0)throw new Error(V("sandbox.invalidDeleteResult"));return{deleted:!0,...s.thread?{snapshot:Eg(s)}:{}}},async compactThread(n,i={}){await $l(e,n,"threads/compact",{method:"POST",options:i,fallback:V("sandbox.compactThreadFailed")})},async getSettings(n,i={}){const r=await Tn(`${e}/${encodeURIComponent(n)}/settings`,{method:"GET",headers:Jr(),signal:i.signal},If);if(!r.ok)throw await es(r,V("sandbox.getSettingsFailed"));return Nte(await r.json())},async updatePermissions(n,i,r={}){const s=await Tn(`${e}/${encodeURIComponent(n)}/permissions`,{method:"PUT",headers:Jr({"Content-Type":"application/json"}),body:JSON.stringify(i),signal:r.signal},If);if(!s.ok)throw await es(s,V("sandbox.updatePermissionsFailed"));const a=await s.json();return BI(a.permissions)},async updateWorkspace(n,i,r={}){const s=await Tn(`${e}/${encodeURIComponent(n)}/workspace`,{method:"PUT",headers:Jr({"Content-Type":"application/json"}),body:JSON.stringify({cwd:i}),signal:r.signal},If);if(!s.ok)throw await es(s,V("sandbox.updateWorkspaceFailed"));const a=await s.json();if(typeof a.cwd!="string"||!a.cwd)throw new Error(V("sandbox.invalidWorkingDirectory"));return a.cwd},async listDirectories(n,i,r={}){const s=new URLSearchParams({path:i}),a=await Tn(`${e}/${encodeURIComponent(n)}/directories?${s}`,{method:"GET",headers:Jr(),signal:r.signal},If);if(!a.ok)throw await es(a,V("sandbox.listDirectoriesFailed"));const l=await a.json();if(typeof l.path!="string"||!Array.isArray(l.directories)||l.directories.some(c=>!c||typeof c.name!="string"||typeof c.path!="string"))throw new Error(V("sandbox.invalidDirectoryList"));return{path:l.path,...typeof l.parent=="string"?{parent:l.parent}:{},directories:l.directories}},async resolveApproval(n,i,r,s={}){const a=await Tn(`${e}/${encodeURIComponent(n)}/approvals/${encodeURIComponent(i)}`,{method:"POST",headers:Jr({"Content-Type":"application/json"}),body:JSON.stringify({decision:r}),signal:s.signal},If);if(!a.ok)throw await es(a,V("sandbox.resolveApprovalFailed"))},async launchTerminal(n,i={}){return jte(e,n,"terminal",i)},async launchBrowser(n,i={}){return jte(e,n,"browser",i)},async uploadFile(n,i,r={}){const s=new FormData;s.set("file",i,i.name);const a=await Tn(`${e}/${encodeURIComponent(n)}/files`,{method:"POST",headers:Jr(),body:s,signal:r.signal},pLt);if(!a.ok)throw await es(a,V("sandbox.uploadFileFailed"));const l=await a.json();if(typeof l.id!="string"||typeof l.path!="string"||typeof l.name!="string"||typeof l.mimeType!="string"||typeof l.sizeBytes!="number")throw new Error(V("sandbox.invalidUploadResult"));return l},async closeSession(n,i={}){if(!n)return;const r=await Tn(`${e}/${encodeURIComponent(n)}/disconnect`,{method:"POST",headers:Jr(),signal:i.signal},aw);if(!r.ok&&r.status!==404)throw await es(r,V("sandbox.disconnectCodexFailed"))},async deleteSession(n,i={}){if(!n)return;const r=await Tn(`${e}/${encodeURIComponent(n)}`,{method:"DELETE",headers:Jr(),signal:i.signal},aw);if(!r.ok&&r.status!==404)throw await es(r,V("sandbox.deleteCodexFailed"))}}}const dr=Oje(dLt),fp=Oje("/web/intelligent-development/sessions",{textOnly:!0,messageTimeoutMs:36e5,interruptTimeoutMs:45e3});async function jte(e,t,n,i){const r=await Tn(`${e}/${encodeURIComponent(t)}/${n}`,{method:"POST",headers:Jr(),signal:i.signal},If);if(!r.ok)throw await es(r,V(n==="terminal"?"sandbox.openSandboxTerminalFailed":"sandbox.openSandboxBrowserFailed"));const s=await r.json();return{url:Sje(s.url,V("sandbox.toolLabel")),...typeof s.shellSessionId=="string"?{shellSessionId:s.shellSessionId}:{}}}function Sje(e,t){if(typeof e!="string")throw new Error(V("sandbox.invalidToolUrl",{label:t}));if(e.startsWith("/"))return Bo(e);let n;try{n=new URL(e)}catch{throw new Error(V("sandbox.invalidToolUrl",{label:t}))}const i=n.protocol==="http:"&&window.location.protocol==="http:";if(n.protocol!=="https:"&&!i)throw new Error(V("sandbox.unsafeToolUrl",{label:t}));return n.toString()}function Rg(e,t,n){const i=e instanceof Error?`${e.name}: ${e.message}`:String(e||V("common.unknownError"));return[V("requestError.actionFailed",{action:t}),V("requestError.detail",{detail:i}),n?V("requestError.request",{request:n}):""].filter(Boolean).join(` +`)}function Yf({className:e="icon"}){return o.jsxs("svg",{className:`${e} sidebar-agent-face`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",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",d:"M8.5 10.7v2"}),o.jsx("path",{className:"sidebar-agent-face__eye",d:"M15.5 10.7v2"})]})}function wLt(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:"M8.4 18.4H7.2a4.2 4.2 0 0 1-.65-8.35A5.7 5.7 0 0 1 17.3 8.2a4.6 4.6 0 0 1-.4 9.2h-3.2"}),o.jsx("path",{d:"m7.8 12.3 2 2-2 2M12.2 16.3h3.2"})]})}function OLt(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:"M18.9 6.25A8.4 8.4 0 1 0 19.6 16"}),o.jsx("path",{d:"M19 6.2c.1 2.1-.65 3.75-2.25 4.95-1.2.9-2.75 1.25-4.2.9"}),o.jsx("circle",{cx:"10.6",cy:"12.8",r:"2.45"}),o.jsx("path",{d:"m5.25 18.6 3.65-3.9M14.8 17.9c1.9-.45 3.55-1.65 4.65-3.35"})]})}function SLt(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:"M6.2 20c.55-2.15.75-4.1.75-6.7V9.8A5.35 5.35 0 0 1 12.35 4c3.35 0 5.65 2.35 5.65 5.65v4.6c0 2.35.35 4.25 1.15 5.75"}),o.jsx("path",{d:"M8.05 10.2c1.35-.6 2.2-1.65 2.55-3.15.45 1.55 1.35 2.55 2.7 3.05.1-1 .4-1.95.85-2.75.45 1.25 1.2 2.2 2.15 2.75"}),o.jsx("path",{d:"M9.3 12.65h.01M14.9 12.65h.01M10.8 15.55c.8.5 1.65.5 2.45 0"}),o.jsx("path",{d:"M8.45 19.85c.95-.85 1.45-1.95 1.5-3.25M15.1 16.65c.05 1.2.55 2.3 1.55 3.2"})]})}function kLt(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.2 17.2V8.1a3 3 0 0 1 3-3h7.6a3 3 0 0 1 3 3v9.1"}),o.jsx("path",{d:"M7.4 17.2h9.2M9 19.9h6"}),o.jsx("path",{d:"M9.1 9.25h5.8M9.1 12h3.1"}),o.jsx("path",{d:"m14.1 12.4 2 2.1M16.2 12.4l-2.1 2.1"})]})}function wk({kind:e,...t}){return e==="codex"?o.jsx(wLt,{...t}):e==="deepseek-harness"?o.jsx(kLt,{...t}):e==="openclaw"?o.jsx(OLt,{...t}):o.jsx(SLt,{...t})}const ELt=["general","codex","deepseek-harness","openclaw","hermes"],CLt=24,TLt=3e4,ALt=7e3,_Lt=2e4,NLt=6,jLt=2,RLt=250,Vp=new Map,yv=new Map,ILt=new Set;function lg(e){const t=e.runtime;return t?`${t.region}:${t.runtimeId}:${t.currentVersion??""}`:""}function Rte(e,t){const n=e instanceof Error&&e.message.trim()?e.message.trim():t("myAgents.compatibility.unknownError");return{status:e instanceof Ds&&e.unsupported?"unsupported":"error",message:n}}function b2(e){if(!e){Vp.clear(),yv.clear(),A4();return}const t=new Set(e);if(t.size!==0){for(const[n,i]of yv)i.page.runtimes.some(r=>t.has(r.runtimeId))&&yv.delete(n);for(const n of t)A4(n);Vp.clear()}}function PLt(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 DLt(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M8.313 3.646a.5.5 0 0 1 .707 0l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 1 1-.707-.708L11.46 8.5H3.333a.5.5 0 0 1 0-1h8.127L8.313 4.354a.5.5 0 0 1 0-.708Z",fill:"currentColor"})})}function MLt(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M2.75 5.25h8.75m0 0-2-2m2 2-2 2M13.25 10.75H4.5m0 0 2 2m-2-2 2-2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function LLt({type:e}){return e==="general"?o.jsx(Yf,{}):o.jsx(wk,{kind:e})}function $Lt(e,t=Date.now(),n){const i=Date.parse(e);if(!Number.isFinite(i)||i-t<6e4)return n("myAgents.expiringSoon");const r=Math.ceil((i-t)/6e4),s=Math.floor(r/60),a=r%60;return n("myAgents.sandboxRemaining",{hours:s,minutes:a})}function Ite(e,t){var n;return{id:e.runtimeId,name:e.name,description:((n=e.description)==null?void 0:n.trim())||t("common.noDescription"),createdAt:e.createdAt??"",specificationLabel:t("myAgents.creator"),specification:REe(e.author),isMine:e.isMine,runtime:{runtimeId:e.runtimeId,region:e.region,currentVersion:e.currentVersion,canDelete:e.canDelete}}}function FLt(e,t){const n=e.status.trim().toLowerCase();return{id:e.id,name:e.displayName||t("myAgents.namedAgent",{name:e.toolName}),description:t(`myAgents.sandboxStatus.${n}`,{defaultValue:t("myAgents.sandboxStatus.unknown")}),createdAt:e.createdAt,specificationLabel:t("myAgents.creator"),specification:REe(e.createdBy),isMine:e.isMine,region:e.region,sandbox:e}}function BLt(e,t){var n,i;return{id:e.id,name:e.draft.name||t("agentSelector.unnamedAgent"),description:((n=e.draft.description)==null?void 0:n.trim())||t("common.noDescription"),createdAt:new Date(e.updatedAt).toISOString(),specificationLabel:t("myAgents.storageLocation"),specification:t("myAgents.currentBrowser"),isMine:!0,region:(i=e.deploymentTarget)==null?void 0:i.region,draft:e}}function ULt(e,t,n){if(!e.draft)return e;const i=e.draft.deploymentTarget;return i?t.find(r=>{var s;return((s=r.runtime)==null?void 0:s.runtimeId)===i.runtimeId&&r.runtime.region===i.region})??{id:i.runtimeId,appName:i.appName,name:i.name||e.name,description:e.description,createdAt:e.createdAt,specificationLabel:n("myAgents.region"),specification:i.region,isMine:!0,runtime:{runtimeId:i.runtimeId,region:i.region,currentVersion:i.currentVersion,canDelete:!1}}:null}function QLt(e,t){return e.trim()||Ji(t)}async function zLt(e,t,n,i,r,s){const a=`${e}:${t}:${n}`,l=yv.get(a);if(l&&l.expiresAt>Date.now())return i(l.page.runtimes.map(d=>Ite(d,r))),l.page.nextToken;l&&yv.delete(a);let c=Vp.get(a);c||(c=cLt({scope:e,region:t,pageSize:CLt,nextToken:n,signal:s}),Vp.set(a,c),c.then(()=>Vp.delete(a),()=>Vp.delete(a)));const u=await c;return yv.set(a,{page:u,expiresAt:Date.now()+TLt}),i(u.runtimes.map(d=>Ite(d,r))),u.nextToken}function VLt({agent:e,onUse:t,onViewDetails:n,onPrepareUpdate:i,compatibility:r,onRetryCompatibility:s,connecting:a,connected:l,deploymentTask:c,nowMs:u,onViewDeploymentTask:d,onEditDraft:f,onDeleteDraft:h}){var N,_,j,A;const{t:p,i18n:g}=Ce("ui"),b=(N=e.sandbox)==null?void 0:N.status.toLowerCase(),v=((_=e.sandbox)==null?void 0:_.resourceType)==="snapshot",y=!!(e.runtime||b==="ready"||b==="wakeable"),x=(r==null?void 0:r.status)==="checking",O=(r==null?void 0:r.status)==="unsupported",w=(r==null?void 0:r.status)==="error",k=((j=e.sandbox)==null?void 0:j.resourceType)==="snapshot"?e.sandbox.sourceSessionId||e.sandbox.snapshotId:(A=e.sandbox)==null?void 0:A.id,S=()=>{if(e.draft){c?d==null||d(c):n==null||n(e);return}y&&(c?d==null||d(c):n==null||n(e))},E=(e.draft||y)&&!!(c?d:n),C=e.draft?c?p("myAgents.viewDeploymentProgress",{name:e.name}):p("myAgents.viewRuntimeDetails",{name:e.name}):c?p("myAgents.viewDeploymentProgress",{name:e.name}):p("myAgents.viewDetails",{name:e.name});return o.jsxs(jB,{className:a?"my-agent-card is-connecting":"my-agent-card",activateLabel:E?C:void 0,onActivate:E?S:void 0,onPointerEnter:()=>i==null?void 0:i(e),onFocusCapture:()=>i==null?void 0:i(e),footer:o.jsx(BOe,{className:"my-agent-meta",items:[{label:e.specificationLabel,value:e.specification,hideLabel:!0,className:"my-agent-region"},{label:p("myAgents.time"),value:GQ(e.createdAt,u,g.resolvedLanguage??g.language),hideLabel:!0,className:"my-agent-created-at"},...e.sandbox?[{label:p("myAgents.remainingTime"),value:e.sandbox.resourceType==="snapshot"?p("myAgents.wakeable"):e.sandbox.persistent?p("myAgents.neverExpires"):$Lt(e.sandbox.expireAt,u,p),className:`my-agent-expiry${e.sandbox.resourceType==="session"&&e.sandbox.persistent?"":" is-expiring"}`}]:[]]}),actions:e.draft?o.jsxs(o.Fragment,{children:[o.jsx(E6,{"aria-label":c?p("myAgents.viewDeploymentProgress",{name:e.name}):p("myAgents.editDraftNamed",{name:e.name}),onClick:()=>c?d==null?void 0:d(c):f==null?void 0:f(e.draft),children:p(c?"myAgents.viewProgress":"common.edit")}),o.jsx(E6,{tone:"danger","aria-label":p("myAgents.deleteDraftNamed",{name:e.name}),onClick:()=>h==null?void 0:h(e.draft),children:p("common.delete")})]}):w||O?o.jsxs(Wt,{type:"button",color:"primary",size:"sm",pill:!1,"aria-label":p("myAgents.recheckCompatibility",{name:e.name}),onClick:()=>s==null?void 0:s(e),children:[o.jsx(Kj,{}),p("common.retry")]}):o.jsx(C6,{className:l?"my-agent-use is-connected":"my-agent-use",disabled:!y||x||O||a||l,"aria-busy":a||void 0,label:l?p("myAgents.connectedNamed",{name:e.name}):v?p("myAgents.wakeAndChat",{name:e.name}):p("myAgents.chatWith",{name:e.name}),onClick:()=>void(t==null?void 0:t(e)),children:a?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-use-spinner","aria-hidden":"true"}),o.jsx("span",{className:"sr-only",children:p(v?"myAgents.waking":"agentSelector.connecting")})]}):o.jsx(DLt,{})}),children:[o.jsx(RB,{leading:o.jsx(Xv,{seed:e.name}),title:e.name,subtitle:e.sandbox?o.jsx("span",{className:"my-agent-session-id",title:k,children:k}):void 0,status:e.draft?c?o.jsx("span",{className:"my-agent-deploying-badge",children:p("myAgents.deploying")}):o.jsx("span",{className:"my-agent-draft-badge",children:p("myAgents.draft")}):e.sandbox?o.jsx("span",{className:"my-agent-status-label","data-ready":e.sandbox.status.toLowerCase()==="ready"||void 0,"data-wakeable":v||void 0,children:e.description}):e.runtime&&c?o.jsx("span",{className:"my-agent-deploying-badge",children:p("myAgents.deploying")}):x?o.jsx(Uo,{content:r==null?void 0:r.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:o.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:o.jsxs(ba,{className:"my-agent-compatibility-status",color:"secondary",variant:"soft",size:"sm",pill:!0,children:[o.jsx("span",{className:"my-agent-compatibility-spinner","aria-hidden":"true"}),o.jsx("span",{children:p("myAgents.checking")})]})})}):O?o.jsx(Uo,{content:r==null?void 0:r.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:o.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:o.jsx(ba,{className:"my-agent-compatibility-status",color:"warning",variant:"soft",size:"sm",pill:!0,children:p("myAgents.chatUnsupported")})})}):w?o.jsx(Uo,{content:r==null?void 0:r.message,contentClassName:"my-agent-compatibility-tooltip",maxWidth:360,align:"end",interactive:!0,preventUnintentionalClickToClose:!0,children:o.jsx("span",{className:"my-agent-compatibility-trigger",tabIndex:0,children:o.jsx(ba,{className:"my-agent-compatibility-status",color:"danger",variant:"soft",size:"sm",pill:!0,children:p("myAgents.checkFailed")})})}):null}),e.sandbox?null:o.jsx(IB,{children:e.description})]})}function HLt({cloudProvider:e,studioRegion:t,canCreateRuntimeAgents:n,canCreatePersonalAgents:i,canUpdate:r,runtimeScope:s,onCreateAgent:a,onOpenCodexProjectUpload:l,onUseAgent:c,onViewAgentDetails:u,onCreateSandboxAgent:d,onUseSandboxAgent:f,onViewSandboxAgentDetails:h,activeType:p,onActiveTypeChange:g,sandboxRefreshKey:b=0,connectedRuntimeId:v="",hiddenRuntimeIds:y=ILt,drafts:x=[],deploymentTasks:O=[],draftDeploymentTaskIds:w={},onViewDeploymentTask:k,onEditDraft:S,onDeleteDraft:E}){const{t:C}=Ce("ui"),N=m.useRef(null),_=m.useRef(null),j=m.useRef(0),A=m.useRef(null),F=m.useRef(0),T=m.useRef(null),P=m.useRef(new Map),R=QLt(t,e),[L,M]=m.useState(""),[U,I]=m.useState(s==="mine"?"mine":"all"),[H,Z]=m.useState(R),[Q,q]=m.useState([]),[B,te]=m.useState(""),[ce,se]=m.useState(!0),[re,ge]=m.useState(""),[G,K]=m.useState([]),[ae,ue]=m.useState(!1),[xe,Ee]=m.useState(""),[Je,De]=m.useState(null),[Pe,Ne]=m.useState(null),[Ke,wt]=m.useState(0),[ot,Ie]=m.useState(""),[Be,J]=m.useState({}),[pe,oe]=m.useState(null),[Me,Ve]=m.useState(()=>Date.now()),ht=m.useMemo(()=>ELt.map(Qe=>({value:Qe,label:C(`myAgents.agentTypes.${Qe}`)})),[C]),Se=m.useMemo(()=>{const Qe=Iu(e);return Qe.some(ut=>ut.value===R)?Qe:[{value:R,label:R},...Qe]},[e,R]);m.useEffect(()=>{s==="mine"&&I("mine")},[s]),m.useEffect(()=>{Z(R)},[R]),m.useEffect(()=>{Ve(Date.now());const Qe=window.setInterval(()=>Ve(Date.now()),1e3);return()=>window.clearInterval(Qe)},[]);const ve=m.useMemo(()=>x.map(Qe=>BLt(Qe,C)),[x,C]),$e=m.useMemo(()=>{const Qe=new Map,ut=new Map,bt=new Map;for(const it of O){if(it.status!=="running")continue;if(Qe.set(it.id,it),it.draftId){const W=ut.get(it.draftId);(!W||it.startedAt>W.startedAt)&&ut.set(it.draftId,it)}if(!it.runtimeId)continue;const xt=bt.get(it.runtimeId);(!xt||it.startedAt>xt.startedAt)&&bt.set(it.runtimeId,it)}return{byId:Qe,byDraftId:ut,byRuntimeId:bt}},[O]),qe=m.useCallback(Qe=>{var bt;if(Qe.draft){const it=w[Qe.draft.id];return $e.byDraftId.get(Qe.draft.id)??(it?$e.byId.get(it):void 0)}const ut=(bt=Qe.runtime)==null?void 0:bt.runtimeId;return ut?$e.byRuntimeId.get(ut):void 0},[$e,w]),ke=m.useCallback((Qe,ut)=>{var xt;(xt=A.current)==null||xt.abort(),Vp.clear();const bt=new AbortController;A.current=bt;const it=++j.current;return se(!0),ge(""),zLt(U,H,Qe,W=>{j.current===it&&q(pt=>ut?W:[...pt,...W])},C,bt.signal).then(W=>{j.current===it&&te(W)}).catch(W=>{j.current===it&&(wte(W)||ge(Rg(W,C("myAgents.loadGeneralAgents"),"GET /web/runtimes")))}).finally(()=>{j.current===it&&se(!1),A.current===bt&&(A.current=null)})},[U,H,C]);m.useEffect(()=>{if(p==="general")return q([]),te(""),ke("",!0),()=>{var Qe;(Qe=A.current)==null||Qe.abort(),A.current=null,Vp.clear(),j.current+=1}},[p,ke]),m.useEffect(()=>{if(p!=="general"){for(const bt of P.current.values())bt.abort();P.current.clear();return}const Qe=new Set(Q.filter(bt=>{var it,xt;return((it=bt.runtime)==null?void 0:it.runtimeId)!==v&&((xt=bt.runtime)==null?void 0:xt.region)===H}).map(lg).filter(Boolean));for(const[bt,it]of P.current)Qe.has(bt)||(it.abort(),P.current.delete(bt));const ut=Q.filter(bt=>{var pt,Re,ze;const it=(pt=bt.runtime)==null?void 0:pt.runtimeId;if(!it||it===v||((Re=bt.runtime)==null?void 0:Re.region)!==H)return!1;const xt=lg(bt),W=(ze=Be[xt])==null?void 0:ze.status;return!P.current.has(xt)&&(!W||W==="checking")});for(const bt of ut)P.current.set(lg(bt),new AbortController);J(bt=>{var W,pt;let it=!1;const xt={...bt};for(const Re of Q){const ze=lg(Re);if(!ze)continue;const st=((W=Re.runtime)==null?void 0:W.runtimeId)===v;st&&((pt=xt[ze])==null?void 0:pt.status)!=="compatible"?(xt[ze]={status:"compatible",message:C("myAgents.compatibility.supported")},it=!0):!st&&!xt[ze]&&(xt[ze]={status:"checking",message:C("myAgents.compatibility.checking")},it=!0)}return it?xt:bt}),uLt(ut,async bt=>{const it=bt.runtime;if(!it)return;const xt=lg(bt),W=P.current.get(xt);if(W)try{const pt=await Fv(it.runtimeId,it.region,{signal:W.signal,preferCached:!0,timeoutMs:ALt,currentVersion:it.currentVersion});if(W.signal.aborted)return;J(Re=>({...Re,[xt]:pt&&pt.length>0?{status:"compatible",message:C("myAgents.compatibility.supported")}:{status:"unsupported",message:C("myAgents.compatibility.empty")}}))}catch(pt){if(W.signal.aborted||(pt==null?void 0:pt.name)==="AbortError")return;J(Re=>({...Re,[xt]:Rte(pt,C)}))}finally{P.current.get(xt)===W&&P.current.delete(xt)}})},[p,v,H,Q,C]),m.useEffect(()=>()=>{var Qe;(Qe=A.current)==null||Qe.abort();for(const ut of P.current.values())ut.abort();P.current.clear()},[]);const Tt=m.useCallback(async(Qe,ut=!1)=>{var Re;(Re=T.current)==null||Re.abort();const bt=new AbortController;T.current=bt;const it=++F.current;ut||ue(!0),Ee("");let xt=!1,W=!1;const pt=(ze,st)=>{xt=ze,W=st};try{const ze=Qe==="codex"?await dr.listSessions({signal:bt.signal,autoResumeSnapshots:!0,onRecoveryStatus:pt}):await dr.listAgentSessions(Qe,{signal:bt.signal,autoResumeSnapshots:!0,onRecoveryStatus:pt});if(F.current!==it)return;De(xt?Qe:null),Ne(W?Qe:null),K(ze.map(st=>FLt(st,C)))}catch(ze){if((ze==null?void 0:ze.name)==="AbortError"||F.current!==it)return;De(null),Ee(Rg(ze,C("myAgents.loadAgentType",{type:C(`myAgents.agentTypes.${Qe}`)}),`GET /web/${Qe==="codex"?"sandbox":Qe}/sessions`))}finally{T.current===bt&&(T.current=null),F.current===it&&(ue(!1),wt(ze=>ze+1))}},[C]);m.useEffect(()=>{if(p==="general"||Je!==p)return;const Qe=window.setTimeout(()=>void Tt(p,!0),3e3);return()=>window.clearTimeout(Qe)},[p,Je,Ke,Tt]);function Jt(Qe){var ut;Qe!==p&&(De(null),Ne(null),Qe==="general"?(j.current+=1,q([]),te(""),ge(""),se(!0)):((ut=T.current)==null||ut.abort(),T.current=null,F.current+=1,K([]),Ee(""),ue(!0)),g(Qe))}function on(){p==="general"&&(j.current+=1,q([]),te(""),ge(""),se(!0))}function Et(Qe){Qe!==U&&(on(),I(Qe))}function Bt(Qe){Qe!==H&&(on(),Z(Qe))}m.useEffect(()=>{var Qe;if(p==="general"){(Qe=T.current)==null||Qe.abort(),T.current=null,F.current+=1;return}return Tt(p),()=>{var ut;(ut=T.current)==null||ut.abort(),T.current=null,F.current+=1}},[p,Tt,b]),m.useEffect(()=>{const Qe=_.current,ut=N.current;if(!Qe||!ut||p!=="general"||!B||ce)return;const bt=new IntersectionObserver(([it])=>{it.isIntersecting&&ke(B,!1)},{root:ut,rootMargin:"240px 0px",threshold:.01});return bt.observe(Qe),()=>bt.disconnect()},[p,ke,ce,B]);const rt=m.useCallback(async Qe=>{if(!ot){Ie(Qe.id);try{await new Promise(ut=>requestAnimationFrame(()=>ut())),Qe.sandbox?await f(Qe.sandbox):await c(Qe)}finally{Ie("")}}},[ot,c,f]),gt=m.useCallback(async Qe=>{var xt;const ut=Qe.runtime;if(!ut)return;const bt=lg(Qe);J(W=>({...W,[bt]:{status:"checking",message:C("myAgents.compatibility.checking")}})),(xt=P.current.get(bt))==null||xt.abort();const it=new AbortController;P.current.set(bt,it);try{const W=await xje(()=>Fv(ut.runtimeId,ut.region,{retryProbe:!0,signal:it.signal,timeoutMs:_Lt,currentVersion:ut.currentVersion}));if(it.signal.aborted)return;J(pt=>({...pt,[bt]:W&&W.length>0?{status:"compatible",message:C("myAgents.compatibility.supported")}:{status:"unsupported",message:C("myAgents.compatibility.empty")}}))}catch(W){if(it.signal.aborted||wte(W))return;J(pt=>({...pt,[bt]:Rte(W,C)}))}finally{P.current.get(bt)===it&&P.current.delete(bt)}},[C]),je=m.useCallback(Qe=>{const ut=Qe.runtime;!r||!ut||qe(Qe)||T4({runtimeId:ut.runtimeId,region:ut.region,appName:Qe.appName,currentVersion:ut.currentVersion})},[r,qe]),Ot=m.useMemo(()=>{const Qe=L.trim().toLocaleLowerCase(),ut=p==="general"?[...ve,...Q]:G,it=(U==="mine"?ut.filter(Re=>Re.isMine):ut).filter(Re=>{var st;const ze=((st=Re.runtime)==null?void 0:st.region)??Re.region;return!ze||ze===H}),xt=Qe?it.filter(Re=>Re.name.toLocaleLowerCase().includes(Qe)):it;if(p!=="general")return xt;const W=y.size>0?xt.filter(Re=>!Re.runtime||!y.has(Re.runtime.runtimeId)):xt,pt=W.findIndex(Re=>{var ze;return((ze=Re.runtime)==null?void 0:ze.runtimeId)===v});return pt<=0?W:[W[pt],...W.slice(0,pt),...W.slice(pt+1)]},[p,v,ve,y,L,U,H,Q,G]);m.useEffect(()=>{if(!r||p!=="general")return;const Qe=Ot.filter(W=>!!W.runtime).filter(W=>!qe(W)).slice(0,NLt);if(Qe.length===0)return;let ut=!1,bt=0;const it=async()=>{for(;!ut;){const W=Qe[bt];if(bt+=1,!(W!=null&&W.runtime)||(await T4({runtimeId:W.runtime.runtimeId,region:W.runtime.region,appName:W.appName,currentVersion:W.runtime.currentVersion}),ut))return}},xt=window.setTimeout(()=>{for(let W=0;W{ut=!0,window.clearTimeout(xt)}},[p,r,qe,Ot]);const yt=C(`myAgents.agentTypes.${p}`,{defaultValue:C("myAgents.agent")}),Dt=p==="general"?ce&&Q.length===0&&ve.length===0:ae&&G.length===0,Ft=!Dt&&Ot.length===0,dt=(p==="general"?n:i)?p==="general"?()=>a(H):()=>d(p):void 0,$t=p==="codex"&&i&&!!l;return o.jsxs(Th,{className:"my-agents-page","aria-label":C("myAgents.agent"),children:[o.jsx(zx,{title:C("myAgents.agent"),className:"my-agents-header"}),o.jsxs(Zb,{className:"my-agent-toolbar",children:[o.jsx(dE,{idPrefix:"my-agent-ownership",ariaLabel:C("myAgents.creatorFilter"),value:U,items:[{id:"all",label:C("common.all"),disabled:s==="mine"},{id:"mine",label:C("agentSelector.createdByMe")}],onChange:Et}),o.jsxs("div",{className:"resource-toolbar__actions",children:[o.jsx(lN,{id:"my-agent-type-filter",ariaLabel:C("myAgents.agentType"),value:p,options:ht,onChange:Jt}),o.jsx(lN,{id:"my-agent-region-filter",ariaLabel:C("myAgents.region"),value:H,options:Se,onChange:Bt}),o.jsx(wm,{className:"my-agent-search","aria-label":C("myAgents.searchAgents"),value:L,onChange:Qe=>M(Qe.target.value),placeholder:C("common.search")}),$t?o.jsxs("button",{type:"button",className:"my-agent-create-secondary",onClick:l,children:[o.jsx(MLt,{}),o.jsx("span",{children:C("myAgents.handoff")})]}):null]})]}),o.jsxs(Jb,{className:"my-agent-results",ref:N,"aria-label":C("myAgents.agentList",{type:yt}),children:[Dt?o.jsx(Ud,{}):(p==="general"?re:xe)&&Ot.length===0?o.jsxs("div",{className:"my-agent-empty",role:"alert",children:[o.jsx("p",{children:p==="general"?re:xe}),o.jsx("button",{type:"button",onClick:()=>{p==="general"?ke("",!0):Tt(p)},children:C("common.reload")})]}):Ft&&!dt?L.trim()||U==="mine"||H!==R?o.jsx("div",{className:"my-agent-empty-message",children:o.jsxs(En,{fill:"none",children:[o.jsx(En.Icon,{children:o.jsx(UFe,{})}),o.jsx(En.Title,{children:C("myAgents.noMatchingAgents")}),o.jsx(En.Description,{children:C("myAgents.adjustSearch")})]})}):p!=="general"?o.jsx("div",{className:"my-agent-empty-message",children:o.jsxs(En,{fill:"none",children:[o.jsx(En.Icon,{children:o.jsx(LLt,{type:p})}),o.jsx(En.Title,{className:"my-agent-sandbox-empty-title",children:C("myAgents.noAgentType",{type:yt})})]})}):o.jsx("div",{className:"my-agent-empty-message",children:o.jsxs(En,{fill:"none",children:[o.jsx(En.Icon,{children:o.jsx(Yf,{})}),o.jsx(En.Title,{children:C("myAgents.noGeneralAgents")}),o.jsx(En.Description,{children:C("myAgents.createGeneralAgentDescription")})]})}):o.jsxs(o.Fragment,{children:[p==="general"&&re?o.jsxs("div",{className:"my-agent-inline-error",role:"alert",children:[o.jsx("span",{children:re}),o.jsx("button",{type:"button",onClick:()=>void ke("",!0),children:C("common.reload")})]}):null,o.jsxs(Vx,{className:"my-agent-grid",children:[dt?o.jsx(Cb,{className:"my-agent-create-card","aria-label":C("myAgents.createAgentType",{type:yt}),onClick:dt,icon:o.jsx(PLt,{}),children:C("myAgents.createAgent")}):null,Ot.map(Qe=>{var bt;const ut=ULt(Qe,Q,C);return o.jsx(VLt,{agent:Qe,deploymentTask:qe(Qe),nowMs:Me,onViewDeploymentTask:k,onUse:rt,compatibility:Qe.runtime?Be[lg(Qe)]??{status:"checking",message:C("myAgents.compatibility.checking")}:void 0,onRetryCompatibility:gt,onPrepareUpdate:je,onViewDetails:ut?()=>{ut.sandbox?h(ut.sandbox):u(ut)}:void 0,connecting:Qe.id===ot,connected:((bt=Qe.runtime)==null?void 0:bt.runtimeId)===v,onEditDraft:S,onDeleteDraft:oe},Qe.id)})]})]}),p==="general"&&!re&&!Dt&&(Ot.length>0||!!B)&&o.jsx("div",{className:"my-agent-load-more",ref:_,"aria-live":"polite",children:ce?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:C("myAgents.loadingMore")})]}):B?o.jsx("span",{children:C("myAgents.scrollForMore")}):o.jsx("span",{children:C("myAgents.allLoaded")})}),p!=="general"&&(Je===p||Pe===p)?o.jsxs("div",{className:"my-agent-load-more my-agent-recovery-notice",role:"status",children:[Je===p?o.jsx("span",{children:C("myAgents.restoringHistory")}):null,Pe===p?o.jsx("span",{children:C("myAgents.recoveryPaused")}):null]}):null]}),pe?o.jsx(pc,{title:C("myAgents.deleteDraftTitle"),description:C("myAgents.deleteDraftDescription",{name:pe.draft.name||C("agentSelector.unnamedAgent")}),confirmLabel:C("myAgents.deleteDraft"),variant:"danger",onCancel:()=>oe(null),onConfirm:()=>{E==null||E(pe),oe(null)}}):null]})}const qLt="_Container_13560_1",WLt="_Textarea_13560_174",Pte={Container:qLt,Textarea:WLt},Rm=e=>{const t=m.useRef(null),i=`search-ui-input-${m.useId()}`,{id:r,name:s,variant:a="outline",size:l="md",gutterSize:c,className:u,autoComplete:d,disabled:f=!1,readOnly:h=!1,invalid:p=!1,allowAutofillExtensions:g=!!s,onFocus:b,onBlur:v,onAnimationStart:y,onAutofill:x,autoSelect:O,rows:w=3,maxRows:k,autoResize:S,ref:E,onChange:C,...N}=e,[_,j]=m.useState(!1),A=S?Math.max(k??10,w):w;m.useEffect(()=>{var P;O&&((P=t.current)==null||P.select())},[O]);const F=P=>{y==null||y(P),P.animationName==="native-autofill-in"&&(x==null||x())},T=m.useCallback(()=>{if(!S||!t.current||A===void 0)return;t.current.style.height="0px";const P=t.current.scrollHeight;t.current.style.height=P+"px"},[S,A]);return m.useEffect(()=>{T()},[e.value,w,T]),o.jsx("div",{className:pi(Pte.Container,u),"data-variant":a,"data-size":l,"data-gutter-size":c,"data-focused":_,"data-disabled":f?"":void 0,"data-readonly":h?"":void 0,"data-invalid":p?"":void 0,style:Wb({"textarea-min-rows":`${w}`,"textarea-max-rows":`${A}`}),children:o.jsx("textarea",{...N,onChange:P=>{C==null||C(P),T()},ref:Zk([t,E]),id:r||(g?void 0:i),className:Pte.Textarea,name:s,readOnly:h,disabled:f,rows:w,onFocus:P=>{j(!0),b==null||b(P)},onBlur:P=>{j(!1),v==null||v(P)},onAnimationStart:F,"data-lpignore":g?void 0:!0,"data-1p-ignore":g?void 0:!0})})},UI="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",GLt="data:image/svg+xml,%3c?xml%20version='1.0'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20100%20100'%3e%3ctitle%3ePandoc%20Icon%3c/title%3e%3cdesc%20property='dc:creator'%3eAlbert%20Krewinkel%3c/desc%3e%3cmetadata%20id='license'%20xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23'%20xmlns:dc='http://purl.org/dc/elements/1.1/'%20xmlns:cc='http://creativecommons.org/ns%23'%3e%3crdf:RDF%3e%3ccc:Work%20rdf:about=''%3e%3cdc:format%3eimage/svg+xml%3c/dc:format%3e%3cdc:type%20rdf:resource='http://purl.org/dc/dcmitype/StillImage'%20/%3e%3ccc:license%20rdf:resource='http://creativecommons.org/licenses/by-sa/4.0/'%20/%3e%3c/cc:Work%3e%3ccc:License%20rdf:about='http://creativecommons.org/licenses/by-sa/4.0/'%3e%3ccc:permits%20rdf:resource='http://creativecommons.org/ns%23Reproduction'%20/%3e%3ccc:permits%20rdf:resource='http://creativecommons.org/ns%23Distribution'%20/%3e%3ccc:requires%20rdf:resource='http://creativecommons.org/ns%23Notice'%20/%3e%3ccc:requires%20rdf:resource='http://creativecommons.org/ns%23Attribution'%20/%3e%3ccc:permits%20rdf:resource='http://creativecommons.org/ns%23DerivativeWorks'%20/%3e%3ccc:requires%20rdf:resource='http://creativecommons.org/ns%23ShareAlike'%20/%3e%3c/cc:License%3e%3c/rdf:RDF%3e%3c/metadata%3e%3crect%20fill='%23fed'%20stroke='%23fed'%20width='100'%20height='100'/%3e%3cg%20fill='none'%20stroke='%234093da'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='8'%20transform='skewX(-6)%20translate(8%201)'%3e%3cpath%20d='M%2030,10%20l%200,80%20M%2045,10%20l%200,80%20M%2020,10%20l%2040,0%20l%2018,18%20l%200,25%20l%20-33,0'%20/%3e%3cpath%20fill='%234093da'%20stroke-width='6'%20d='M%2061,10%20l%2017,17%20l%20-17,0%20l%200,-17'%20/%3e%3c/g%3e%3c/svg%3e",KLt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%20100%20100'%20version='1.1'%20id='svg4'%20sodipodi:docname='favicon.svg'%20inkscape:version='1.4.4%20(dcaf3e7,%202026-05-05)'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:svg='http://www.w3.org/2000/svg'%3e%3csodipodi:namedview%20id='namedview4'%20pagecolor='%23ffffff'%20bordercolor='%23000000'%20borderopacity='0.25'%20inkscape:showpageshadow='2'%20inkscape:pageopacity='0.0'%20inkscape:pagecheckerboard='0'%20inkscape:deskcolor='%23d1d1d1'%20showgrid='true'%20inkscape:zoom='8.2236519'%20inkscape:cx='34.534536'%20inkscape:cy='45.174577'%20inkscape:window-width='1881'%20inkscape:window-height='1382'%20inkscape:window-x='1512'%20inkscape:window-y='30'%20inkscape:window-maximized='0'%20inkscape:current-layer='svg4'%3e%3cinkscape:grid%20type='axonomgrid'%20id='grid4'%20units='px'%20originx='0'%20originy='0'%20spacingx='3.7795276'%20spacingy='3.7795276'%20empcolor='%230099e5'%20empopacity='0.30196078'%20color='%230099e5'%20opacity='0.14901961'%20empspacing='0'%20dotted='false'%20gridanglex='40'%20gridanglez='40'%20enabled='true'%20visible='true'%20/%3e%3c/sodipodi:namedview%3e%3cdefs%20id='defs1'%3e%3cfilter%20id='shadow'%20x='0'%20y='0'%20width='1'%20height='1'%3e%3cfeDropShadow%20dx='0'%20dy='2'%20stdDeviation='3'%20flood-color='rgba(50,%2050,%2093,%200.18)'%20/%3e%3c/filter%3e%3c/defs%3e%3crect%20x='4'%20y='4'%20width='92'%20height='92'%20rx='22.08'%20fill='%23e8efff'%20filter='url(%23shadow)'%20id='rect1'%20transform='matrix(1.0869565,0,0,1.0869565,-4.347826,-4.347826)'%20style='stroke-width:0.92'%20ry='22.08'%20/%3e%3cpath%20style='fill:%230a2540;fill-opacity:1;stroke-width:1.88976'%20d='M%2049.999999,6.535431%204.9573423,44.330708%2049.999999,82.125984%2092.790523,46.220471%2095.042656,44.330708%20Z'%20id='path1'%20/%3e%3cpath%20style='fill:%23425466;fill-opacity:1;stroke-width:1.88976'%20d='M%204.9573423,44.330708%20V%2055.669291%20L%2049.999999,93.464567%20V%2082.125984%20Z'%20id='path2'%20/%3e%3cpath%20style='fill:%231a3550;fill-opacity:1;stroke-width:1.88976'%20d='M%2049.999999,82.125984%2095.042656,44.330708%20V%2055.669291%20L%2049.999999,93.464567%20Z'%20id='path3'%20/%3e%3cpath%20style='fill:%234ade80;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;fill-opacity:1'%20d='m%2045.042657,30.236221%209.008531,-7.559055%2022.521328,18.897638%20-9.008531,7.559056%20z'%20id='path5'%20/%3e%3cpath%20style='fill:none;fill-opacity:1;stroke:%234ade80;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1'%20d='M%2027.025594,49.133859%2047.29479,47.244096%2045.042657,64.25197'%20id='path6'%20/%3e%3c/svg%3e",XLt="data:image/svg+xml,%3csvg%20fill='%23261230'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eAstral%3c/title%3e%3cpath%20d='M1.44%200C.6422%200%200%20.6422%200%201.44v21.12C0%2023.3578.6422%2024%201.44%2024h21.12c.7978%200%201.44-.6422%201.44-1.44V1.44C24%20.6422%2023.3578%200%2022.56%200Zm4.7998%204.8h11.5199c.7953%200%201.44.6447%201.44%201.44V19.2h-6.624v-4.32h-1.152v4.32H4.8V6.24c0-.7953.6446-1.44%201.4398-1.44m4.032%205.472v1.152h3.456v-1.152z'/%3e%3c/svg%3e",YLt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='1.34em'%20height='1em'%20viewBox='0%200%20256%20192'%3e%3cpath%20fill='%232d4552'%20d='M84.38%20108.352c-9.556%202.712-15.826%207.467-19.956%2012.218c3.956-3.461%209.255-6.639%2016.402-8.665c7.311-2.072%2013.548-2.057%2018.702-1.062v-4.03c-4.397-.402-9.437-.082-15.148%201.539M63.987%2074.475l-35.49%209.35s.646.914%201.844%202.133l30.092-7.93s-.427%205.495-4.13%2010.41c7.005-5.299%207.684-13.963%207.684-13.963m29.709%2083.41c-49.946%2013.452-76.37-44.43-84.37-74.472c-3.696-13.868-5.31-24.37-5.74-31.148a11.5%2011.5%200%200%201%20.025-1.84C1.021%2050.58-.22%2051.927.032%2055.82c.43%206.773%202.044%2017.275%205.74%2031.147c7.997%2030.038%2034.424%2087.92%2084.37%2074.468c10.871-2.929%2019.038-8.263%2025.17-15.073c-5.652%205.104-12.724%209.123-21.616%2011.523M103.08%2039.05v3.555h19.59c-.401-1.259-.806-2.393-1.208-3.555z'/%3e%3cpath%20fill='%232d4552'%20d='M127.05%2068.325c8.81%202.503%2013.47%208.68%2015.933%2014.146l9.824%202.79s-1.34-19.132-18.645-24.047c-16.189-4.6-26.151%208.995-27.363%2010.754c4.71-3.355%2011.586-6.102%2020.251-3.643m78.197%2014.234c-16.204-4.62-26.162%209.003-27.356%2010.737c4.713-3.351%2011.586-6.099%2020.247-3.629c8.797%202.506%2013.452%208.676%2015.923%2014.146l9.837%202.8s-1.361-19.135-18.651-24.054m-9.76%2050.443l-81.718-22.845s.885%204.485%204.279%2010.293l68.803%2019.234c5.664-3.277%208.636-6.682%208.636-6.682m-56.655%2049.174C74.127%20164.828%2081.949%2082.386%2092.419%2043.32c4.311-16.1%208.743-28.066%2012.419-36.088c-2.193-.451-4.01.704-5.804%204.354C95.13%2019.5%2090.14%2032.387%2085.312%2050.427c-10.467%2039.066-18.29%20121.506%2046.412%20138.854c30.497%208.17%2054.256-4.247%2071.966-23.749c-16.81%2015.226-38.274%2023.763-64.858%2016.644'/%3e%3cpath%20fill='%23e2574c'%20d='M103.081%20138.565v-16.637l-46.223%2013.108s3.415-19.846%2027.522-26.684c7.311-2.072%2013.549-2.058%2018.701-1.063V39.05h23.145c-2.52-7.787-4.958-13.782-7.006-17.948c-3.387-6.895-6.859-2.324-14.741%204.269c-5.552%204.638-19.583%2014.533-40.698%2020.222c-21.114%205.694-38.185%204.184-45.307%202.95c-10.097-1.742-15.378-3.96-14.884%203.721c.43%206.774%202.043%2017.277%205.74%2031.148c7.996%2030.039%2034.424%2087.92%2084.37%2074.468c13.046-3.515%2022.254-10.464%2028.637-19.32h-19.256zm-74.588-54.74l35.494-9.35s-1.034%2013.654-14.34%2017.162c-13.31%203.504-21.154-7.812-21.154-7.812'/%3e%3cpath%20fill='%232ead33'%20d='M236.664%2039.84c-9.226%201.617-31.361%203.632-58.716-3.7c-27.363-7.328-45.517-20.144-52.71-26.168c-10.197-8.54-14.682-14.476-19.096-5.498c-3.902%207.918-8.893%2020.805-13.723%2038.846c-10.466%2039.066-18.289%20121.505%2046.413%20138.853c64.687%2017.333%2099.126-57.978%20109.593-97.047c4.83-18.037%206.948-31.695%207.53-40.502c.665-9.976-6.187-7.08-19.29-4.784M106.668%2072.161s10.196-15.859%2027.49-10.943c17.305%204.915%2018.645%2024.046%2018.645%2024.046zm42.215%2071.163c-30.419-8.91-35.11-33.167-35.11-33.167l81.714%2022.846c0-.004-16.494%2019.12-46.604%2010.32m28.89-49.85s10.183-15.847%2027.474-10.918c17.29%204.923%2018.651%2024.054%2018.651%2024.054z'/%3e%3cpath%20fill='%23d65348'%20d='m86.928%20126.51l-30.07%208.522s3.266-18.609%2025.418-25.983L65.25%2045.147l-1.471.447c-21.115%205.694-38.185%204.184-45.307%202.95c-10.097-1.741-15.379-3.96-14.885%203.722c.43%206.774%202.044%2017.276%205.74%2031.147c7.997%2030.039%2034.425%2087.92%2084.37%2074.468l1.471-.462zM28.493%2083.825l35.494-9.351s-1.034%2013.654-14.34%2017.162c-13.31%203.504-21.154-7.811-21.154-7.811'/%3e%3cpath%20fill='%231d8d22'%20d='m150.255%20143.658l-1.376-.335c-30.419-8.91-35.11-33.166-35.11-33.166l42.137%2011.778l22.308-85.724l-.27-.07c-27.362-7.329-45.516-20.145-52.71-26.17c-10.196-8.54-14.682-14.475-19.096-5.497c-3.898%207.918-8.889%2020.805-13.719%2038.846c-10.466%2039.066-18.289%20121.505%2046.413%20138.852l1.326.3zM106.668%2072.16s10.196-15.859%2027.49-10.943c17.305%204.915%2018.645%2024.046%2018.645%2024.046z'/%3e%3cpath%20fill='%23c04b41'%20d='m88.46%20126.072l-8.064%202.289c1.906%2010.74%205.264%2021.047%2010.534%2030.152c.918-.202%201.828-.376%202.762-.632c2.449-.66%204.72-1.479%206.906-2.371c-5.89-8.74-9.785-18.804-12.137-29.438m-3.148-75.644c-4.144%2015.467-7.852%2037.73-6.831%2060.06c1.826-.793%203.756-1.532%205.9-2.14l1.492-.334c-1.82-23.852%202.114-48.157%206.546-64.694a323%20323%200%200%201%203.373-11.704a105%20105%200%200%201-5.974%203.547a307%20307%200%200%200-4.506%2015.265'/%3e%3c/svg%3e",ZLt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='512'%20height='512'%20version='1.1'%20viewBox='0%200%20135.47%20135.47'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m67.733%2067.733%2029.33%2016.933-29.33%2050.8c37.408%200%2067.733-30.325%2067.733-67.733%200-12.341-3.3168-23.901-9.0837-33.867h-58.65z'%20fill='%23afccf9'/%3e%3cpath%20d='m67.733-1e-6c-25.07%200-46.942%2013.63-58.654%2033.875l29.324%2050.792%2029.33-16.933v-33.867h58.65c-11.714-20.24-33.583-33.867-58.65-33.867z'%20fill='%231767d1'/%3e%3cpath%20d='m0%2067.733c0%2037.408%2030.324%2067.733%2067.733%2067.733l29.33-50.8-29.33-16.933-29.33%2016.933-29.324-50.792c-5.7637%209.9632-9.0794%2021.519-9.0794%2033.858'%20fill='%23679ef5'/%3e%3cpath%20d='m101.6%2067.733c0%2018.704-15.163%2033.867-33.867%2033.867-18.704%200-33.867-15.163-33.867-33.867s15.163-33.867%2033.867-33.867c18.704%200%2033.867%2015.163%2033.867%2033.867'%20fill='%23fff'/%3e%3cpath%20d='m95.25%2067.733c0%2015.197-12.32%2027.517-27.517%2027.517-15.197%200-27.517-12.32-27.517-27.517%200-15.197%2012.32-27.517%2027.517-27.517%2015.197%200%2027.517%2012.32%2027.517%2027.517'%20fill='%231a74e7'/%3e%3c/svg%3e",JLt="data:image/svg+xml,%3csvg%20fill='%23F03C2E'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGit%3c/title%3e%3cpath%20d='M13.09%2023.549a1.54%201.54%200%200%201-2.18%200L.451%2013.089a1.54%201.54%200%200%201%200-2.179l7.191-7.19%202.733%202.733a1.85%201.85%200%200%200%20.964%202.326v6.66a1.849%201.849%200%201%200%201.54%200V8.957l2.508%202.508a1.85%201.85%200%201%200%201.09-1.09l-2.634-2.634a1.85%201.85%200%200%200-2.378-2.377L8.73%202.63%2010.91.451a1.54%201.54%200%200%201%202.179%200l10.459%2010.46a1.54%201.54%200%200%201%200%202.179z'/%3e%3c/svg%3e",e3t="data:image/svg+xml,%3csvg%20fill='%23073551'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3ecurl%3c/title%3e%3cpath%20d='M.803%2014.8169c0-.5342.433-.9665.9665-.9665.5335%200%20.9665.4323.9665.9665%200%20.5335-.433.9657-.9665.9657-.5335%200-.9666-.4322-.9666-.9657m2.736%200c0-.1963-.0532-.376-.1119-.5525-.2344-.7024-.876-1.2169-1.6575-1.2169-.1249%200-.2344.0465-.3524.0708C.6149%2013.2865%200%2013.9646%200%2014.817c0%20.9764.7923%201.7694%201.7695%201.7694.9772%200%201.7694-.793%201.7694-1.7694m-1.7694-7.149c.5335%200%20.9665.433.9665.9665%200%20.5335-.433.9665-.9665.9665-.5343%200-.9666-.433-.9666-.9665%200-.5335.4323-.9665.9666-.9665m0%202.7359c.9772%200%201.7694-.7923%201.7694-1.7694%200-.1956-.0532-.376-.1119-.5525-.2344-.7024-.8767-1.2169-1.6575-1.2169-.1249%200-.2344.0465-.3524.0716C.6149%207.104%200%207.782%200%208.6344c0%20.9771.7923%201.7694%201.7695%201.7694m13.221-5.694c-.5342%200-.9665-.433-.9665-.9664a.966.966%200%2001.9666-.9665c.5335%200%20.9658.4322.9658.9665%200%20.5334-.4323.9664-.9658.9664m-9.6%2016.5133c-.5335%200-.9666-.433-.9666-.9665%200-.5342.433-.9665.9666-.9665a.966.966%200%2001.9665.9665c0%20.5335-.4323.9665-.9665.9665m9.6-19.2491c-.978%200-1.7695.7922-1.7695%201.7694%200%20.2085.0525.4025.1187.5882L5.039%2018.5581c-.803.1681-1.4179.8462-1.4179%201.6985%200%20.9772.7923%201.7694%201.7695%201.7694.9772%200%201.7694-.7922%201.7694-1.7694%200-.1963-.0525-.3759-.111-.5525l8.3427-14.2728c.7778-.1865%201.3683-.8531%201.3683-1.688%200-.977-.793-1.7693-1.7694-1.7693m7.24%202.7359c-.5343%200-.9666-.433-.9666-.9665a.966.966%200%2001.9665-.9665c.5335%200%20.9666.4322.9666.9665%200%20.5334-.433.9665-.9666.9665M12.6313%2021.223c-.5343%200-.9665-.433-.9665-.9665a.966.966%200%2001.9665-.9665c.5335%200%20.9658.4323.9658.9665%200%20.5335-.4323.9665-.9658.9665M22.2305%201.974c-.9772%200-1.7694.7922-1.7694%201.7694%200%20.2085.0525.4025.1187.5882l-8.3009%2014.2265c-.8021.1681-1.417.8462-1.417%201.6985%200%20.9772.7922%201.7694%201.7694%201.7694.9764%200%201.7687-.7922%201.7687-1.7694%200-.1963-.0525-.3759-.1111-.5525l8.3427-14.2728C23.4094%205.2448%2024%204.5782%2024%203.7433c0-.977-.7923-1.7693-1.7695-1.7693'/%3e%3c/svg%3e",t3t="data:image/svg+xml,%3csvg%20fill='%23007808'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eFFmpeg%3c/title%3e%3cpath%20d='M21.72%2017.91V6.5l-.53-.49L9.05%2018.52l-1.29-.06L24%201.53l-.33-.95-11.93%201-5.75%206.6v-.23l4.7-5.39-1.38-.77-9.11.77v2.85l1.91.46v.01l.19-.01-.56.66v10.6c.609-.126%201.22-.241%201.83-.36L14.12%205.22l.83-.04L0%2021.44l9.67.82%201.35-.77%206.82-6.74v2.15l-5.72%205.57%2011.26.95.35-.94v-3.16l-3.29-.18c.434-.403.858-.816%201.28-1.23z'/%3e%3c/svg%3e",n3t="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%201080%201080'%3e%3c!--%20Generator:%20Adobe%20Illustrator%2030.3.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.3%20Build%20182)%20--%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20fill:%20%23ff0;%20}%20.st1%20{%20fill:%20%23333;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='st0'%20d='M660.52,419.49l-195.15-52.98c-15.84-4.3-19.16-25.29-5.43-34.28l169.23-110.7-9.91-201.97c-.8-16.39,18.13-26.04,30.92-15.76l157.57,126.74,189.03-71.84c15.34-5.83,30.37,9.2,24.54,24.54l-71.84,189.03,126.74,157.57c10.29,12.79.64,31.73-15.76,30.92l-201.97-9.91-110.7,169.23c-8.98,13.73-29.98,10.41-34.28-5.43l-52.98-195.15h-.01Z'/%3e%3cpath%20class='st1'%20d='M603.34,476.66l32.94,121.68,4.45,16.23-429.11,429.11c-48.45,48.45-126.85,48.45-175.3,0C12.16,1019.51,0,987.89,0,956.15s12.02-63.48,36.31-87.77l429.11-429.11,16.35,4.33,121.56,33.06h0Z'/%3e%3c/svg%3e";function XQ(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...e,children:o.jsx("path",{d:"M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91 .58 .11 .79-.25.79-.56v-2.02c-3.2.7-3.88-1.36-3.88-1.36-.52-1.33-1.28-1.69-1.28-1.69-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.03 1.77 2.71 1.26 3.37.96.1-.75.4-1.26.73-1.55-2.56-.29-5.25-1.28-5.25-5.7 0-1.26.45-2.29 1.19-3.1-.12-.29-.52-1.47.11-3.06 0 0 .97-.31 3.16 1.18A10.98 10.98 0 0 1 12 6.11c.98 0 1.96.13 2.87.39 2.19-1.49 3.16-1.18 3.16-1.18.63 1.59.23 2.77.11 3.06.74.81 1.19 1.84 1.19 3.1 0 4.43-2.7 5.4-5.27 5.69.42.36.78 1.06.78 2.14v3.04c0 .31.21.67.8.56A11.51 11.51 0 0 0 23.5 12C23.5 5.65 18.35.5 12 .5Z"})})}vo.registerLanguage("bash",ZB);const i3t=48;function r3t(e,t=i3t){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function s3t(e){return vo.highlight(e,{language:"bash",ignoreIllegals:!0}).value}function a3t({status:e}){return e==="succeeded"?o.jsx(Vu,{"aria-hidden":!0}):e==="failed"?o.jsx(f4,{"aria-hidden":!0}):e==="running"?o.jsx(fi,{className:"studio-build-progress__spinner","aria-hidden":!0}):o.jsx(u7e,{"aria-hidden":!0})}function Dte(e,t){if(!e)return"";const n=Date.parse(e);return Number.isNaN(n)?"":new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(n)}function o3t({steps:e,log:t,logError:n="",logTruncated:i=!1,logUpdatedAt:r,loading:s=!1}){const{t:a,i18n:l}=Ce("ui"),c=m.useRef(null),u=m.useRef(!0),[d,f]=m.useState(!1),h=m.useMemo(()=>s3t(t),[t]);m.useEffect(()=>{const g=c.current;g&&t&&u.current&&(g.scrollTop=g.scrollHeight)},[t]);const p=async()=>{try{await navigator.clipboard.writeText(t),f(!0),window.setTimeout(()=>f(!1),1500)}catch{f(!1)}};return o.jsxs("div",{className:"studio-build-progress",children:[o.jsx("ol",{className:"studio-build-progress__steps","aria-label":a("studioBuildProgress.steps"),children:e.map(g=>o.jsxs("li",{className:`is-${g.status}`,children:[o.jsx("span",{className:"studio-build-progress__step-icon",children:o.jsx(a3t,{status:g.status})}),o.jsx("span",{children:g.label})]},g.key))}),o.jsxs("section",{className:"studio-build-progress__log","aria-label":a("studioBuildProgress.log"),children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:a("studioBuildProgress.log")}),o.jsxs("span",{children:[a(s?"studioBuildProgress.syncing":n?"studioBuildProgress.loadFailed":"studioBuildProgress.synced"),i?a("studioBuildProgress.recentOnly"):"",Dte(r,l.resolvedLanguage??l.language)?` · ${Dte(r,l.resolvedLanguage??l.language)}`:""]})]}),o.jsxs(Wt,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:!t,onClick:()=>void p(),"aria-label":a(d?"studioBuildProgress.copiedLog":"studioBuildProgress.copyLog"),children:[d?o.jsx(Vu,{"aria-hidden":!0}):o.jsx(Xj,{"aria-hidden":!0}),a(d?"studioBuildProgress.copied":"studioBuildProgress.copy")]})]}),t?o.jsx("pre",{ref:c,tabIndex:0,"aria-label":a("studioBuildProgress.logContent"),onScroll:g=>{u.current=r3t(g.currentTarget)},children:o.jsx("code",{className:"hljs language-bash",dangerouslySetInnerHTML:{__html:h}})}):o.jsx("div",{className:`studio-build-progress__log-empty${n?" is-error":""}`,children:n||a(s?"studioBuildProgress.waiting":"studioBuildProgress.empty")})]})]})}function Mte({name:e,description:t,icon:n,selected:i,disabled:r=!1,onChange:s,className:a=""}){return o.jsxs("button",{type:"button",className:`studio-package-option${i?" is-selected":""}${a?` ${a}`:""}`,"aria-pressed":i,disabled:r,onClick:()=>s(!i),children:[o.jsx("span",{className:"studio-package-option__icon","aria-hidden":"true",children:n}),o.jsxs("span",{className:"studio-package-option__content",children:[o.jsx("strong",{children:e}),t?o.jsx("span",{children:t}):null]}),o.jsx("span",{className:"studio-package-option__action","aria-hidden":"true",children:i?o.jsx(VFe,{}):o.jsx(WFe,{})})]})}function cg(e,t){return e[t]|e[t+1]<<8}function Q0(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function l3t(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 kje(e,t={}){let i=-1;for(let u=e.length-22;u>=0&&u>e.length-65557;u--)if(Q0(e,u)===101010256){i=u;break}if(i<0)throw new Error(Qt("helpers.zip.invalid"));const r=cg(e,i+10);if(t.maxEntries!==void 0&&r>t.maxEntries)throw new Error(Qt("helpers.zip.tooManyFiles",{count:t.maxEntries}));let s=Q0(e,i+16);const a=new TextDecoder("utf-8"),l=[];let c=0;for(let u=0;ut.maxUncompressedBytes)throw new Error(Qt("helpers.zip.tooLarge"));const x=cg(e,v+26),O=cg(e,v+28),w=v+30+x+O,k=e.subarray(w,w+f);let S;if(d===0)S=k;else if(d===8)S=await l3t(k);else{s+=46+p+g+b;continue}l.push({name:y,text:a.decode(S)}),s+=46+p+g+b}return l}const w8=/(^|\/)skill\.md$/i;function c3t(e){const t=(e??"").replace(/\r\n?/g,` `).split(` -`);if(!t.length||t[0].trim()!=="---")return{name:"",description:""};let n=-1;for(let r=1;r=2&&(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))}function d3t(...e){var t;for(const n of e){const i=(t=n.trim().replace(/\\/g,"/").split("/").filter(Boolean).pop())==null?void 0:t.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"");if(i)return i.slice(0,64)}return"local-skill"}function f3t(e,t){return t.trim()||e}function Eje(e){const t=e.map(i=>({path:i.path.replace(/\\/g,"/").replace(/^\.\//,""),text:i.text})).filter(i=>i.path.length>0&&!i.path.endsWith("/")),n=new Set(t.map(i=>i.path.split("/")[0]));if(n.size===1&&t.every(i=>i.path.includes("/"))){const i=[...n][0]+"/";return t.map(r=>({path:r.path.slice(i.length),text:r.text}))}return t}function h3t(e){const t=new Map,n=new Set;for(const i of e)if(w8.test("/"+i.path)){const r=i.path.split("/");n.add(r.slice(0,-1).join("/"))}for(const i of e){const r=i.path.split("/");let s="";for(let u=r.length-1;u>=0;u--){const d=r.slice(0,u).join("/");if(n.has(d)){s=d;break}}const a=w8.test("/"+i.path);if(!s&&!a&&!n.has("")||!n.has(s)&&!a)continue;const l=s?i.path.slice(s.length+1):i.path,c=t.get(s)||[];c.push({path:l,text:i.text}),t.set(s,c)}return t}function p3t(e,t,n){const i=`${n}${e?"/"+e:""}`,r=t.find(c=>w8.test("/"+c.path));if(!r)return{hit:null,error:Lt("helpers.skills.missingManifest",{location:i})};const s=c3t(r.text),a=d3t(s.name,e,n.replace(/\.[^.]+$/,"")),l=[];for(const c of t){if(c.path.split("/").some(f=>f===".."))return{hit:null,error:Lt("helpers.skills.invalidParentPath",{location:i,path:c.path})};const d=`skills/${a}/${c.path}`;if(!d.startsWith(`skills/${a}/`))return{hit:null,error:Lt("helpers.skills.invalidPath",{location:i,path:c.path})};l.push({path:d,content:c.text})}return{hit:{source:"local",id:`local:${a}:${t.length}`,name:f3t(a,s.name),description:s.description||Lt("helpers.skills.localDescription"),folder:a,localFiles:l},error:null}}async function m3t(e){const t=new Uint8Array(await e.arrayBuffer()),i=(await kje(t)).map(r=>({path:r.name,text:r.text}));return Cje(Eje(i),e.name)}async function g3t(e,t=new Map){const n=[];for(let i=0;ie.file(t,n))}async function y3t(e){const t=e.createReader(),n=[];for(;;){const i=await new Promise((r,s)=>t.readEntries(r,s));if(i.length===0)return n;n.push(...i)}}async function Tje(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await b3t(e),path:n}];if(!e.isDirectory)return[];const i=await y3t(e);return(await Promise.all(i.map(r=>Tje(r,n)))).flat()}function v3t({selected:e,onChange:t}){const{t:n}=Ae("create"),[i,r]=m.useState([]),[s,a]=m.useState([]),[l,c]=m.useState(!1),[u,d]=m.useState(!1),f=m.useRef(0),h=w=>e.some(k=>k.source==="local"&&k.folder===w),p=w=>{w.localFiles&&(h(w.folder||w.name)?t(e.filter(k=>!(k.source==="local"&&k.folder===(w.folder||w.name)))):t([...e,{source:"local",folder:w.folder||w.name,name:w.name,description:w.description,localFiles:w.localFiles}]))},g=m.useRef([]),b=m.useRef(e);m.useEffect(()=>{g.current=s},[s]),m.useEffect(()=>{b.current=e},[e]);const v=w=>{const k=new Set([...g.current.map(N=>N.folder||N.name),...b.current.filter(N=>N.source==="local").map(N=>N.folder)]),S=[],E=[];for(const N of w.hits){const _=N.folder||N.name;if(k.has(_)){S.push(N.name);continue}k.add(_),E.push(N)}a(N=>[...N,...E]);const C=[...w.errors];if(S.length>0&&C.push(n("skills.local.duplicatesSkipped",{names:S.join(", ")})),r(C),E.length===1&&w.errors.length===0&&S.length===0){const N=E[0];N.localFiles&&t([...b.current,{source:"local",folder:N.folder||N.name,name:N.name,description:N.description,localFiles:N.localFiles}])}},y=w=>{w.preventDefault(),f.current+=1,d(!0)},x=w=>{w.preventDefault(),f.current=Math.max(0,f.current-1),f.current===0&&d(!1)},O=async w=>{if(w.preventDefault(),f.current=0,d(!1),l)return;const k=Array.from(w.dataTransfer.items).map(S=>{var E;return(E=S.webkitGetAsEntry)==null?void 0:E.call(S)}).filter(S=>S!==null);if(k.length===0){r([n("skills.local.invalidDrop")]);return}c(!0);try{const S=(await Promise.all(k.map(N=>Tje(N)))).flat(),E=k.some(N=>N.isDirectory);if(!E&&S.length===1&&S[0].file.name.toLowerCase().endsWith(".zip")){v(await m3t(S[0].file));return}if(!E){r([n("skills.local.invalidDrop")]);return}const C=new Map(S.map(({file:N,path:_})=>[N,_]));v(await g3t(S.map(({file:N})=>N),C))}catch(S){r([n("skills.local.readError",{detail:S instanceof Error?S.message:String(S)})])}finally{c(!1)}};return o.jsxs("div",{className:"cw-local",children:[o.jsxs("div",{className:`cw-local-dropzone ${u?"is-dragging":""}`,role:"group","aria-label":n("skills.local.dropLabel"),onDragEnter:y,onDragOver:w=>w.preventDefault(),onDragLeave:x,onDrop:w=>void O(w),children:[o.jsx(MF,{className:"cw-local-drop-icon","aria-hidden":!0}),o.jsx("p",{className:"cw-local-drop-hint",children:n("skills.local.dropLabel")})]}),o.jsx("p",{className:"cw-local-hint",children:n("skills.local.hint")}),l&&o.jsx("p",{className:"cw-empty-line",children:n("skills.local.reading")}),i.length>0&&o.jsxs("div",{className:"cw-banner",children:[o.jsx(Wd,{className:"cw-i"}),o.jsx("span",{children:i.join(";")})]}),s.length>0&&o.jsx("div",{className:"cw-skill-results",children:s.map(w=>{var S;const k=h(w.folder||w.name);return o.jsxs("button",{type:"button",className:`cw-skill-result ${k?"is-on":""}`,onClick:()=>p(w),"aria-pressed":k,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:k?o.jsx(Vu,{className:"cw-i cw-i-sm"}):o.jsx($o,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsx("span",{className:"cw-skill-result-name",children:w.name}),w.description&&o.jsx("span",{className:"cw-skill-result-desc",children:Ok(w.description)}),o.jsx("span",{className:"cw-skill-result-repo",children:n("skills.local.fileCount",{count:((S=w.localFiles)==null?void 0:S.length)??0})})]})]},w.id)})})]})}const x3t="/harness/skills/findskill";async function w3t(e,t="public"){const n=e.trim(),i=new URLSearchParams({query:n,page_number:"1",page_size:"20"}),r=`${x3t}?${i.toString()}`,s=await fetch(r,{headers:{accept:"application/json"},signal:Ol(void 0,Wo)});if(!s.ok)throw new Error(Lt("helpers.skills.searchFailed",{status:s.status}));return((await s.json()).items??[]).map(l=>({source:"skillhub",id:l.slug??l.name??"",slug:l.slug??"",name:l.name??l.slug??"",description:l.description??"",namespace:t,sourceRepo:l.sourceRepo,downloadCount:l.downloadCount,version:l.version}))}function O3t({selected:e,onChange:t}){const{t:n}=Ae("create"),[i,r]=m.useState(""),[s,a]=m.useState([]),[l,c]=m.useState(!1),[u,d]=m.useState(null),[f,h]=m.useState(!1),p=v=>e.some(y=>y.source==="skillhub"&&y.slug===v),g=v=>{v.slug&&(p(v.slug)?t(e.filter(y=>!(y.source==="skillhub"&&y.slug===v.slug))):t([...e,{source:"skillhub",slug:v.slug,name:v.name,folder:v.slug.split("/").pop()||v.name,namespace:v.namespace||"public",description:v.description}]))},b=async v=>{c(!0),d(null),h(!0);try{const y=await w3t(v);a(y)}catch(y){d(y instanceof Error?y.message:n("skills.hub.searchError")),a([])}finally{c(!1)}};return m.useEffect(()=>{const v=i.trim();if(!v){a([]),h(!1),d(null);return}const y=setTimeout(()=>b(v),300);return()=>clearTimeout(y)},[i,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(P_,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),o.jsx("input",{className:"cw-input cw-skill-input",value:i,placeholder:n("skills.hub.searchPlaceholder"),onChange:v=>r(v.target.value),onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),i.trim()&&b(i))}})]}),o.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>i.trim()&&b(i),disabled:!i.trim()||l,children:[l?o.jsx(fi,{className:"cw-i cw-spin"}):o.jsx(P_,{className:"cw-i"}),n("skills.hub.search")]})]}),u&&o.jsxs("div",{className:"cw-banner",children:[o.jsx(Wd,{className:"cw-i"}),o.jsx("span",{children:u})]}),l&&s.length===0?o.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[o.jsx(fi,{className:"cw-i cw-spin"})," ",n("skills.hub.searching")]}):s.length>0?o.jsx("div",{className:"cw-skill-results",children:s.map(v=>{const y=p(v.slug||"");return o.jsxs("button",{type:"button",className:`cw-skill-result ${y?"is-on":""}`,onClick:()=>g(v),"aria-pressed":y,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:y?o.jsx(Vu,{className:"cw-i cw-i-sm"}):o.jsx($o,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsx("span",{className:"cw-skill-result-name",children:v.name}),v.description&&o.jsx("span",{className:"cw-skill-result-desc",children:Ok(v.description)}),v.sourceRepo&&o.jsx("span",{className:"cw-skill-result-repo",children:v.sourceRepo})]})]},v.id||v.slug)})}):f&&!u?o.jsx("p",{className:"cw-empty-line",children:n("skills.hub.noResults")}):!f&&o.jsx("p",{className:"cw-empty-line",children:n("skills.hub.hint")})]})}function S3t({selected:e,onChange:t,cloudProvider:n="volcengine"}){const{t:i}=Ae("create"),[r,s]=m.useState([]),[a,l]=m.useState([]),[c,u]=m.useState(""),[d,f]=m.useState(!0),[h,p]=m.useState(!1),[g,b]=m.useState(null);m.useEffect(()=>{let w=!1;return(async()=>{f(!0),b(null);try{const k=await UEe();w||(s(k),k.length>0&&u(k[0].id))}catch(k){w||b(k instanceof Error?k.message:i("skills.space.loadError"))}finally{w||f(!1)}})(),()=>{w=!0}},[i]),m.useEffect(()=>{if(!c){l([]);return}const w=r.find(S=>S.id===c);let k=!1;return(async()=>{p(!0),b(null);try{const S=await QEe(c,w==null?void 0:w.region);k||l(S)}catch(S){k||b(S instanceof Error?S.message:i("skills.space.loadError"))}finally{k||p(!1)}})(),()=>{k=!0}},[c,r,i]);const v=r.find(w=>w.id===c),y=v?T1t(v.id,v.region,n):"",x=(w,k)=>e.some(S=>S.source==="skillspace"&&S.skillId===w&&(S.version||"")===k),O=w=>{if(!v)return;const k=Fg(w);if(x(k,w.version))t(e.filter(S=>!(S.source==="skillspace"&&S.skillId===k&&(S.version||"")===w.version)));else{const S=C1t(v,w);t([...e,{source:"skillspace",folder:S.folder||w.skillName,name:S.name,description:S.description,skillSpaceId:S.skillSpaceId,skillSpaceName:S.skillSpaceName,skillSpaceRegion:S.skillSpaceRegion,skillId:S.skillId,version:S.version}])}};return o.jsx("div",{className:"cw-skillspace",children:d?o.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[o.jsx(fi,{className:"cw-i cw-spin"})," ",i("skills.space.loadingSpaces")]}):g?o.jsxs("div",{className:"cw-banner",children:[o.jsx(Wd,{className:"cw-i"}),o.jsx("span",{children:g})]}):r.length===0?o.jsx("p",{className:"cw-empty-line",children:i("skills.space.noSpaces")}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"cw-skillspace-header",children:[o.jsx("select",{className:"cw-input cw-skillspace-select",value:c,onChange:w=>u(w.target.value),"aria-label":i("skills.space.selectSpace"),children:r.map(w=>o.jsxs("option",{value:w.id,children:[w.name||w.id,w.description?` — ${Ok(w.description)}`:""]},w.id))}),v&&o.jsxs(o.Fragment,{children:[v.region&&o.jsx("span",{className:"cw-skillspace-region-label",title:v.region,children:xh(v.region,n)}),y&&o.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"cw-button cw-button-secondary cw-skillspace-console-link",title:i("skills.space.openConsole"),"aria-label":i("skills.space.openConsole"),children:o.jsx(gb,{className:"cw-i cw-i-sm"})})]})]}),h?o.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[o.jsx(fi,{className:"cw-i cw-spin"})," ",i("skills.space.loadingSkills")]}):a.length===0?o.jsx("p",{className:"cw-empty-line",children:i("skills.space.noSkills")}):o.jsx("div",{className:"cw-skill-results",children:a.map(w=>{const k=Fg(w),S=x(k,w.version);return o.jsxs("button",{type:"button",className:`cw-skill-result ${S?"is-on":""}`,onClick:()=>O(w),"aria-pressed":S,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:S?o.jsx(Vu,{className:"cw-i cw-i-sm"}):o.jsx($o,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsxs("span",{className:"cw-skill-result-name",children:[w.skillName,w.version&&o.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",w.version]})]}),w.skillDescription&&o.jsx("span",{className:"cw-skill-result-desc",children:Ok(w.skillDescription)}),o.jsxs("span",{className:"cw-skill-result-repo",children:[o.jsx(d7e,{className:"cw-i cw-i-sm"})," ",(v==null?void 0:v.name)||c]})]})]},`${k}/${w.version}`)})})]})})}function Aje({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":"true",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 sL(e){return e.source==="runtime"?`runtime:${e.folder}`:e.source==="skillhub"?`hub:${e.namespace}/${e.slug}`:e.source==="local"?`local:${e.folder}`:`ss:${e.skillSpaceId}/${e.skillId}/${e.version||""}`}function k3t(e){return e.source==="runtime"?"skillSourcePicker.sources.runtime":e.source==="local"?"skillSourcePicker.sources.local":e.source==="skillspace"?"skillSourcePicker.sources.skillspace":"skillSourcePicker.sources.skillhub"}function E3t({skill:e,onRemove:t,disabled:n}){const{t:i}=Ae("ui");let r=mS;e.source==="local"||e.source==="runtime"?r=MF:e.source==="skillspace"&&(r=Aje);const s=`${i(k3t(e))}${e.description?` · ${Ok(e.description)}`:""}`;return o.jsxs(pr.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":"true",children:o.jsx(r,{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.jsx("span",{className:"cw-selected-skill-detail",tabIndex:0,title:s,children:s})]}),o.jsx("button",{type:"button",className:"cw-selected-skill-remove",onClick:t,disabled:n,"aria-label":i("skillSourcePicker.remove",{name:e.name}),title:i("skillSourcePicker.remove",{name:e.name}),children:o.jsx(Ba,{className:"cw-i cw-i-sm"})})]})}const aL=[{id:"local",labelKey:"skillSourcePicker.tabs.local",shortLabelKey:"skillSourcePicker.tabs.localShort",icon:MF},{id:"skillspace",labelKey:"skillSourcePicker.tabs.skillspace",shortLabelKey:"skillSourcePicker.tabs.skillspaceShort",icon:Aje},{id:"skillhub",labelKey:"skillSourcePicker.tabs.skillhub",shortLabelKey:"skillSourcePicker.tabs.skillhubShort",icon:Zj}];function YQ({selected:e,onChange:t,cloudProvider:n,disabled:i=!1,addLabel:r,showSelectedCount:s=!0}){const{t:a}=Ae("ui"),[l,c]=m.useState("local"),[u,d]=m.useState(!1),f=m.useId(),h=m.useId(),p=m.useRef(null),g=aL.findIndex(x=>x.id===l),b=r??a("skillSourcePicker.addSkill");m.useEffect(()=>{var k;if(!u)return;const x=document.body.style.overflow,O=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(k=p.current)==null||k.focus();const w=S=>{S.key==="Escape"&&d(!1)};return window.addEventListener("keydown",w),()=>{document.body.style.overflow=x,window.removeEventListener("keydown",w),O!=null&&O.isConnected&&O.focus()}},[u]);const v=(x,O)=>{O.source==="runtime"&&!window.confirm(a("skillSourcePicker.confirmRemoveRuntime",{name:O.name}))||t(e.filter(w=>sL(w)!==x))},y=x=>{const O=new Set(x.filter(w=>w.source!=="runtime").map(w=>w.folder));t(x.filter(w=>w.source!=="runtime"||!O.has(w.folder)))};return o.jsxs("div",{className:"cw-skillspane",children:[o.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",disabled:i,onClick:()=>d(!0),children:[o.jsx("span",{className:"cw-skill-add-icon","aria-hidden":"true",children:o.jsx($o,{className:"cw-i"})}),o.jsx("span",{children:b})]}),e.length>0&&o.jsxs("div",{className:"cw-skill-selected",children:[s?o.jsx("span",{className:"cw-skill-selected-label",children:a("skillSourcePicker.selectedCount",{count:e.length})}):null,o.jsx("div",{className:"cw-selected-skill-list",children:o.jsx(Ru,{initial:!1,children:e.map(x=>o.jsx(E3t,{skill:x,disabled:i,onRemove:()=>v(sL(x),x)},sL(x)))})})]}),Li.createPortal(o.jsx(Ru,{children:u&&o.jsx(pr.div,{className:"cw-skill-dialog-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},onMouseDown:x=>{x.target===x.currentTarget&&d(!1)},children:o.jsxs(pr.section,{className:"cw-skill-dialog",role:"dialog","aria-modal":"true","aria-labelledby":f,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("header",{className:"cw-skill-dialog-head",children:[o.jsx("h3",{id:f,children:b}),o.jsx("button",{ref:p,type:"button",className:"cw-skill-dialog-close","aria-label":a("skillSourcePicker.close",{label:b}),onClick:()=>d(!1),children:o.jsx(Ba,{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) / ${aL.length})`,"--cw-active-skill-tab-offset":`calc(${g*100}% + ${g*4}px)`},children:[o.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":"true"}),aL.map(({id:x,labelKey:O,shortLabelKey:w,icon:k})=>o.jsxs("button",{type:"button",role:"tab",id:`${h}-${x}`,"aria-controls":h,"aria-selected":l===x,className:`cw-skill-pickertab ${l===x?"is-on":""}`,onClick:()=>c(x),children:[o.jsx(k,{className:"cw-i cw-i-sm"}),o.jsx("span",{className:"cw-skill-tab-label-full",children:a(O)}),o.jsx("span",{className:"cw-skill-tab-label-short",children:a(w)})]},x))]}),o.jsxs("div",{id:h,className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`${h}-${l}`,children:[l==="skillhub"&&o.jsx(O3t,{selected:e,onChange:y}),l==="local"&&o.jsx(v3t,{selected:e,onChange:y}),l==="skillspace"&&o.jsx(S3t,{selected:e,onChange:y,cloudProvider:n})]})]})]})})}),document.body)]})}const _je=128*1024,C3t={baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"};function vv(e,t){return(t==null?void 0:t(`environmentCenter.dockerfileValidation.${e}`))??C3t[e]}function QI(e){return e.replace(/^\uFEFF/,"").replace(/\r\n?/g,` +`);if(!t.length||t[0].trim()!=="---")return{name:"",description:""};let n=-1;for(let r=1;r=2&&(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))}function d3t(...e){var t;for(const n of e){const i=(t=n.trim().replace(/\\/g,"/").split("/").filter(Boolean).pop())==null?void 0:t.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"");if(i)return i.slice(0,64)}return"local-skill"}function f3t(e,t){return t.trim()||e}function Eje(e){const t=e.map(i=>({path:i.path.replace(/\\/g,"/").replace(/^\.\//,""),text:i.text})).filter(i=>i.path.length>0&&!i.path.endsWith("/")),n=new Set(t.map(i=>i.path.split("/")[0]));if(n.size===1&&t.every(i=>i.path.includes("/"))){const i=[...n][0]+"/";return t.map(r=>({path:r.path.slice(i.length),text:r.text}))}return t}function h3t(e){const t=new Map,n=new Set;for(const i of e)if(w8.test("/"+i.path)){const r=i.path.split("/");n.add(r.slice(0,-1).join("/"))}for(const i of e){const r=i.path.split("/");let s="";for(let u=r.length-1;u>=0;u--){const d=r.slice(0,u).join("/");if(n.has(d)){s=d;break}}const a=w8.test("/"+i.path);if(!s&&!a&&!n.has("")||!n.has(s)&&!a)continue;const l=s?i.path.slice(s.length+1):i.path,c=t.get(s)||[];c.push({path:l,text:i.text}),t.set(s,c)}return t}function p3t(e,t,n){const i=`${n}${e?"/"+e:""}`,r=t.find(c=>w8.test("/"+c.path));if(!r)return{hit:null,error:Qt("helpers.skills.missingManifest",{location:i})};const s=c3t(r.text),a=d3t(s.name,e,n.replace(/\.[^.]+$/,"")),l=[];for(const c of t){if(c.path.split("/").some(f=>f===".."))return{hit:null,error:Qt("helpers.skills.invalidParentPath",{location:i,path:c.path})};const d=`skills/${a}/${c.path}`;if(!d.startsWith(`skills/${a}/`))return{hit:null,error:Qt("helpers.skills.invalidPath",{location:i,path:c.path})};l.push({path:d,content:c.text})}return{hit:{source:"local",id:`local:${a}:${t.length}`,name:f3t(a,s.name),description:s.description||Qt("helpers.skills.localDescription"),folder:a,localFiles:l},error:null}}async function m3t(e){const t=new Uint8Array(await e.arrayBuffer()),i=(await kje(t)).map(r=>({path:r.name,text:r.text}));return Cje(Eje(i),e.name)}async function g3t(e,t=new Map){const n=[];for(let i=0;ie.file(t,n))}async function y3t(e){const t=e.createReader(),n=[];for(;;){const i=await new Promise((r,s)=>t.readEntries(r,s));if(i.length===0)return n;n.push(...i)}}async function Tje(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await b3t(e),path:n}];if(!e.isDirectory)return[];const i=await y3t(e);return(await Promise.all(i.map(r=>Tje(r,n)))).flat()}function v3t({selected:e,onChange:t}){const{t:n}=Ce("create"),[i,r]=m.useState([]),[s,a]=m.useState([]),[l,c]=m.useState(!1),[u,d]=m.useState(!1),f=m.useRef(0),h=w=>e.some(k=>k.source==="local"&&k.folder===w),p=w=>{w.localFiles&&(h(w.folder||w.name)?t(e.filter(k=>!(k.source==="local"&&k.folder===(w.folder||w.name)))):t([...e,{source:"local",folder:w.folder||w.name,name:w.name,description:w.description,localFiles:w.localFiles}]))},g=m.useRef([]),b=m.useRef(e);m.useEffect(()=>{g.current=s},[s]),m.useEffect(()=>{b.current=e},[e]);const v=w=>{const k=new Set([...g.current.map(N=>N.folder||N.name),...b.current.filter(N=>N.source==="local").map(N=>N.folder)]),S=[],E=[];for(const N of w.hits){const _=N.folder||N.name;if(k.has(_)){S.push(N.name);continue}k.add(_),E.push(N)}a(N=>[...N,...E]);const C=[...w.errors];if(S.length>0&&C.push(n("skills.local.duplicatesSkipped",{names:S.join(", ")})),r(C),E.length===1&&w.errors.length===0&&S.length===0){const N=E[0];N.localFiles&&t([...b.current,{source:"local",folder:N.folder||N.name,name:N.name,description:N.description,localFiles:N.localFiles}])}},y=w=>{w.preventDefault(),f.current+=1,d(!0)},x=w=>{w.preventDefault(),f.current=Math.max(0,f.current-1),f.current===0&&d(!1)},O=async w=>{if(w.preventDefault(),f.current=0,d(!1),l)return;const k=Array.from(w.dataTransfer.items).map(S=>{var E;return(E=S.webkitGetAsEntry)==null?void 0:E.call(S)}).filter(S=>S!==null);if(k.length===0){r([n("skills.local.invalidDrop")]);return}c(!0);try{const S=(await Promise.all(k.map(N=>Tje(N)))).flat(),E=k.some(N=>N.isDirectory);if(!E&&S.length===1&&S[0].file.name.toLowerCase().endsWith(".zip")){v(await m3t(S[0].file));return}if(!E){r([n("skills.local.invalidDrop")]);return}const C=new Map(S.map(({file:N,path:_})=>[N,_]));v(await g3t(S.map(({file:N})=>N),C))}catch(S){r([n("skills.local.readError",{detail:S instanceof Error?S.message:String(S)})])}finally{c(!1)}};return o.jsxs("div",{className:"cw-local",children:[o.jsxs("div",{className:`cw-local-dropzone ${u?"is-dragging":""}`,role:"group","aria-label":n("skills.local.dropLabel"),onDragEnter:y,onDragOver:w=>w.preventDefault(),onDragLeave:x,onDrop:w=>void O(w),children:[o.jsx(MF,{className:"cw-local-drop-icon","aria-hidden":!0}),o.jsx("p",{className:"cw-local-drop-hint",children:n("skills.local.dropLabel")})]}),o.jsx("p",{className:"cw-local-hint",children:n("skills.local.hint")}),l&&o.jsx("p",{className:"cw-empty-line",children:n("skills.local.reading")}),i.length>0&&o.jsxs("div",{className:"cw-banner",children:[o.jsx(Wd,{className:"cw-i"}),o.jsx("span",{children:i.join(";")})]}),s.length>0&&o.jsx("div",{className:"cw-skill-results",children:s.map(w=>{var S;const k=h(w.folder||w.name);return o.jsxs("button",{type:"button",className:`cw-skill-result ${k?"is-on":""}`,onClick:()=>p(w),"aria-pressed":k,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:k?o.jsx(Vu,{className:"cw-i cw-i-sm"}):o.jsx($o,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsx("span",{className:"cw-skill-result-name",children:w.name}),w.description&&o.jsx("span",{className:"cw-skill-result-desc",children:Ok(w.description)}),o.jsx("span",{className:"cw-skill-result-repo",children:n("skills.local.fileCount",{count:((S=w.localFiles)==null?void 0:S.length)??0})})]})]},w.id)})})]})}const x3t="/harness/skills/findskill";async function w3t(e,t="public"){const n=e.trim(),i=new URLSearchParams({query:n,page_number:"1",page_size:"20"}),r=`${x3t}?${i.toString()}`,s=await fetch(r,{headers:{accept:"application/json"},signal:Ol(void 0,Wo)});if(!s.ok)throw new Error(Qt("helpers.skills.searchFailed",{status:s.status}));return((await s.json()).items??[]).map(l=>({source:"skillhub",id:l.slug??l.name??"",slug:l.slug??"",name:l.name??l.slug??"",description:l.description??"",namespace:t,sourceRepo:l.sourceRepo,downloadCount:l.downloadCount,version:l.version}))}function O3t({selected:e,onChange:t}){const{t:n}=Ce("create"),[i,r]=m.useState(""),[s,a]=m.useState([]),[l,c]=m.useState(!1),[u,d]=m.useState(null),[f,h]=m.useState(!1),p=v=>e.some(y=>y.source==="skillhub"&&y.slug===v),g=v=>{v.slug&&(p(v.slug)?t(e.filter(y=>!(y.source==="skillhub"&&y.slug===v.slug))):t([...e,{source:"skillhub",slug:v.slug,name:v.name,folder:v.slug.split("/").pop()||v.name,namespace:v.namespace||"public",description:v.description}]))},b=async v=>{c(!0),d(null),h(!0);try{const y=await w3t(v);a(y)}catch(y){d(y instanceof Error?y.message:n("skills.hub.searchError")),a([])}finally{c(!1)}};return m.useEffect(()=>{const v=i.trim();if(!v){a([]),h(!1),d(null);return}const y=setTimeout(()=>b(v),300);return()=>clearTimeout(y)},[i,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(P_,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),o.jsx("input",{className:"cw-input cw-skill-input",value:i,placeholder:n("skills.hub.searchPlaceholder"),onChange:v=>r(v.target.value),onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),i.trim()&&b(i))}})]}),o.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>i.trim()&&b(i),disabled:!i.trim()||l,children:[l?o.jsx(fi,{className:"cw-i cw-spin"}):o.jsx(P_,{className:"cw-i"}),n("skills.hub.search")]})]}),u&&o.jsxs("div",{className:"cw-banner",children:[o.jsx(Wd,{className:"cw-i"}),o.jsx("span",{children:u})]}),l&&s.length===0?o.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[o.jsx(fi,{className:"cw-i cw-spin"})," ",n("skills.hub.searching")]}):s.length>0?o.jsx("div",{className:"cw-skill-results",children:s.map(v=>{const y=p(v.slug||"");return o.jsxs("button",{type:"button",className:`cw-skill-result ${y?"is-on":""}`,onClick:()=>g(v),"aria-pressed":y,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:y?o.jsx(Vu,{className:"cw-i cw-i-sm"}):o.jsx($o,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsx("span",{className:"cw-skill-result-name",children:v.name}),v.description&&o.jsx("span",{className:"cw-skill-result-desc",children:Ok(v.description)}),v.sourceRepo&&o.jsx("span",{className:"cw-skill-result-repo",children:v.sourceRepo})]})]},v.id||v.slug)})}):f&&!u?o.jsx("p",{className:"cw-empty-line",children:n("skills.hub.noResults")}):!f&&o.jsx("p",{className:"cw-empty-line",children:n("skills.hub.hint")})]})}function S3t({selected:e,onChange:t,cloudProvider:n="volcengine"}){const{t:i}=Ce("create"),[r,s]=m.useState([]),[a,l]=m.useState([]),[c,u]=m.useState(""),[d,f]=m.useState(!0),[h,p]=m.useState(!1),[g,b]=m.useState(null);m.useEffect(()=>{let w=!1;return(async()=>{f(!0),b(null);try{const k=await UEe();w||(s(k),k.length>0&&u(k[0].id))}catch(k){w||b(k instanceof Error?k.message:i("skills.space.loadError"))}finally{w||f(!1)}})(),()=>{w=!0}},[i]),m.useEffect(()=>{if(!c){l([]);return}const w=r.find(S=>S.id===c);let k=!1;return(async()=>{p(!0),b(null);try{const S=await QEe(c,w==null?void 0:w.region);k||l(S)}catch(S){k||b(S instanceof Error?S.message:i("skills.space.loadError"))}finally{k||p(!1)}})(),()=>{k=!0}},[c,r,i]);const v=r.find(w=>w.id===c),y=v?T1t(v.id,v.region,n):"",x=(w,k)=>e.some(S=>S.source==="skillspace"&&S.skillId===w&&(S.version||"")===k),O=w=>{if(!v)return;const k=Fg(w);if(x(k,w.version))t(e.filter(S=>!(S.source==="skillspace"&&S.skillId===k&&(S.version||"")===w.version)));else{const S=C1t(v,w);t([...e,{source:"skillspace",folder:S.folder||w.skillName,name:S.name,description:S.description,skillSpaceId:S.skillSpaceId,skillSpaceName:S.skillSpaceName,skillSpaceRegion:S.skillSpaceRegion,skillId:S.skillId,version:S.version}])}};return o.jsx("div",{className:"cw-skillspace",children:d?o.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[o.jsx(fi,{className:"cw-i cw-spin"})," ",i("skills.space.loadingSpaces")]}):g?o.jsxs("div",{className:"cw-banner",children:[o.jsx(Wd,{className:"cw-i"}),o.jsx("span",{children:g})]}):r.length===0?o.jsx("p",{className:"cw-empty-line",children:i("skills.space.noSpaces")}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"cw-skillspace-header",children:[o.jsx("select",{className:"cw-input cw-skillspace-select",value:c,onChange:w=>u(w.target.value),"aria-label":i("skills.space.selectSpace"),children:r.map(w=>o.jsxs("option",{value:w.id,children:[w.name||w.id,w.description?` — ${Ok(w.description)}`:""]},w.id))}),v&&o.jsxs(o.Fragment,{children:[v.region&&o.jsx("span",{className:"cw-skillspace-region-label",title:v.region,children:xh(v.region,n)}),y&&o.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"cw-button cw-button-secondary cw-skillspace-console-link",title:i("skills.space.openConsole"),"aria-label":i("skills.space.openConsole"),children:o.jsx(gb,{className:"cw-i cw-i-sm"})})]})]}),h?o.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[o.jsx(fi,{className:"cw-i cw-spin"})," ",i("skills.space.loadingSkills")]}):a.length===0?o.jsx("p",{className:"cw-empty-line",children:i("skills.space.noSkills")}):o.jsx("div",{className:"cw-skill-results",children:a.map(w=>{const k=Fg(w),S=x(k,w.version);return o.jsxs("button",{type:"button",className:`cw-skill-result ${S?"is-on":""}`,onClick:()=>O(w),"aria-pressed":S,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:S?o.jsx(Vu,{className:"cw-i cw-i-sm"}):o.jsx($o,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsxs("span",{className:"cw-skill-result-name",children:[w.skillName,w.version&&o.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",w.version]})]}),w.skillDescription&&o.jsx("span",{className:"cw-skill-result-desc",children:Ok(w.skillDescription)}),o.jsxs("span",{className:"cw-skill-result-repo",children:[o.jsx(d7e,{className:"cw-i cw-i-sm"})," ",(v==null?void 0:v.name)||c]})]})]},`${k}/${w.version}`)})})]})})}function Aje({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":"true",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 sL(e){return e.source==="runtime"?`runtime:${e.folder}`:e.source==="skillhub"?`hub:${e.namespace}/${e.slug}`:e.source==="local"?`local:${e.folder}`:`ss:${e.skillSpaceId}/${e.skillId}/${e.version||""}`}function k3t(e){return e.source==="runtime"?"skillSourcePicker.sources.runtime":e.source==="local"?"skillSourcePicker.sources.local":e.source==="skillspace"?"skillSourcePicker.sources.skillspace":"skillSourcePicker.sources.skillhub"}function E3t({skill:e,onRemove:t,disabled:n}){const{t:i}=Ce("ui");let r=mS;e.source==="local"||e.source==="runtime"?r=MF:e.source==="skillspace"&&(r=Aje);const s=`${i(k3t(e))}${e.description?` · ${Ok(e.description)}`:""}`;return o.jsxs(pr.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":"true",children:o.jsx(r,{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.jsx("span",{className:"cw-selected-skill-detail",tabIndex:0,title:s,children:s})]}),o.jsx("button",{type:"button",className:"cw-selected-skill-remove",onClick:t,disabled:n,"aria-label":i("skillSourcePicker.remove",{name:e.name}),title:i("skillSourcePicker.remove",{name:e.name}),children:o.jsx(Ba,{className:"cw-i cw-i-sm"})})]})}const aL=[{id:"local",labelKey:"skillSourcePicker.tabs.local",shortLabelKey:"skillSourcePicker.tabs.localShort",icon:MF},{id:"skillspace",labelKey:"skillSourcePicker.tabs.skillspace",shortLabelKey:"skillSourcePicker.tabs.skillspaceShort",icon:Aje},{id:"skillhub",labelKey:"skillSourcePicker.tabs.skillhub",shortLabelKey:"skillSourcePicker.tabs.skillhubShort",icon:Zj}];function YQ({selected:e,onChange:t,cloudProvider:n,disabled:i=!1,addLabel:r,showSelectedCount:s=!0}){const{t:a}=Ce("ui"),[l,c]=m.useState("local"),[u,d]=m.useState(!1),f=m.useId(),h=m.useId(),p=m.useRef(null),g=aL.findIndex(x=>x.id===l),b=r??a("skillSourcePicker.addSkill");m.useEffect(()=>{var k;if(!u)return;const x=document.body.style.overflow,O=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(k=p.current)==null||k.focus();const w=S=>{S.key==="Escape"&&d(!1)};return window.addEventListener("keydown",w),()=>{document.body.style.overflow=x,window.removeEventListener("keydown",w),O!=null&&O.isConnected&&O.focus()}},[u]);const v=(x,O)=>{O.source==="runtime"&&!window.confirm(a("skillSourcePicker.confirmRemoveRuntime",{name:O.name}))||t(e.filter(w=>sL(w)!==x))},y=x=>{const O=new Set(x.filter(w=>w.source!=="runtime").map(w=>w.folder));t(x.filter(w=>w.source!=="runtime"||!O.has(w.folder)))};return o.jsxs("div",{className:"cw-skillspane",children:[o.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",disabled:i,onClick:()=>d(!0),children:[o.jsx("span",{className:"cw-skill-add-icon","aria-hidden":"true",children:o.jsx($o,{className:"cw-i"})}),o.jsx("span",{children:b})]}),e.length>0&&o.jsxs("div",{className:"cw-skill-selected",children:[s?o.jsx("span",{className:"cw-skill-selected-label",children:a("skillSourcePicker.selectedCount",{count:e.length})}):null,o.jsx("div",{className:"cw-selected-skill-list",children:o.jsx(Ru,{initial:!1,children:e.map(x=>o.jsx(E3t,{skill:x,disabled:i,onRemove:()=>v(sL(x),x)},sL(x)))})})]}),Li.createPortal(o.jsx(Ru,{children:u&&o.jsx(pr.div,{className:"cw-skill-dialog-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},onMouseDown:x=>{x.target===x.currentTarget&&d(!1)},children:o.jsxs(pr.section,{className:"cw-skill-dialog",role:"dialog","aria-modal":"true","aria-labelledby":f,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("header",{className:"cw-skill-dialog-head",children:[o.jsx("h3",{id:f,children:b}),o.jsx("button",{ref:p,type:"button",className:"cw-skill-dialog-close","aria-label":a("skillSourcePicker.close",{label:b}),onClick:()=>d(!1),children:o.jsx(Ba,{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) / ${aL.length})`,"--cw-active-skill-tab-offset":`calc(${g*100}% + ${g*4}px)`},children:[o.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":"true"}),aL.map(({id:x,labelKey:O,shortLabelKey:w,icon:k})=>o.jsxs("button",{type:"button",role:"tab",id:`${h}-${x}`,"aria-controls":h,"aria-selected":l===x,className:`cw-skill-pickertab ${l===x?"is-on":""}`,onClick:()=>c(x),children:[o.jsx(k,{className:"cw-i cw-i-sm"}),o.jsx("span",{className:"cw-skill-tab-label-full",children:a(O)}),o.jsx("span",{className:"cw-skill-tab-label-short",children:a(w)})]},x))]}),o.jsxs("div",{id:h,className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`${h}-${l}`,children:[l==="skillhub"&&o.jsx(O3t,{selected:e,onChange:y}),l==="local"&&o.jsx(v3t,{selected:e,onChange:y}),l==="skillspace"&&o.jsx(S3t,{selected:e,onChange:y,cloudProvider:n})]})]})]})})}),document.body)]})}const _je=128*1024,C3t={baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"};function vv(e,t){return(t==null?void 0:t(`environmentCenter.dockerfileValidation.${e}`))??C3t[e]}function QI(e){return e.replace(/^\uFEFF/,"").replace(/\r\n?/g,` `)}function Nje(e){return new TextEncoder().encode(e).byteLength}function T3t(e,t="ubuntu:22.04"){const n=QI(e).match(/^\s*FROM(?:\s+--platform=\S+)?\s+(\S+)/im);return(n==null?void 0:n[1])??t}function A3t(e){const t=QI(e).split(` `),n=t.findIndex(i=>/^\s*FROM(?:\s|$)/i.test(i));return(n>=0?t.slice(n+1):t).join(` `).replace(/^\n+/,"")}function QA(e,t){const n=`FROM ${e.trim()}`,i=QI(t).replace(/^\n+/,"");return i?`${n} -${i}`:n}function _3t(e,t,n){return t.trim()?/^\s*FROM(?:\s|$)/im.test(e)?vv("duplicateFrom",n):ZQ(QA(t,e),void 0,n):vv("baseImageRequired",n)}function ZQ(e,t=Nje(e),n){return t>_je?vv("tooLarge",n):e.trim()?/^\s*FROM\s+\S+/im.test(e)?"":vv("missingFrom",n):vv("empty",n)}async function N3t(e,t){if(e.size>_je)return{content:"",error:vv("tooLarge",t)};const n=QI(await e.text());return{content:n,error:ZQ(n,e.size,t)}}function j3t(e){return $U(e,{lineWidth:0})}function R3t(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m7 9.5 5 5 5-5"})})}function I3t(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m6.5 12.5 3.5 3.5 7.5-8"})})}function VE({ariaLabel:e,value:t,valueLabel:n,placeholder:i,options:r,disabled:s=!1,searchValue:a,searchPlaceholder:l,loading:c=!1,hasMore:u=!1,emptyMessage:d,onSearchChange:f,onLoadMore:h,onChange:p}){const{t:g}=Ae("ui"),b=l??g("deploymentSelect.searchPlaceholder"),v=d??g("deploymentSelect.emptyMessage"),y=m.useId(),x=m.useRef(null),O=m.useRef(null),w=m.useRef(null),k=m.useRef(null),S=m.useRef([]),[E,C]=m.useState(!1),[N,_]=m.useState(0),j=r.find(M=>M.value===t),A=(j==null?void 0:j.label)??(t?n:void 0),F=a!==void 0&&!!f,T=()=>{C(!1),F&&a&&(f==null||f(""))};m.useEffect(()=>{if(!E)return;const M=U=>{U.target instanceof Node&&x.current&&!x.current.contains(U.target)&&T()};return window.addEventListener("pointerdown",M),()=>window.removeEventListener("pointerdown",M)},[E,f,a,F]),m.useEffect(()=>{var M,U;if(E){if(F){(M=w.current)==null||M.focus();return}(U=S.current[N])==null||U.focus()}},[E,F]),m.useEffect(()=>{var M;!E||F&&document.activeElement===w.current||(M=S.current[N])==null||M.focus()},[N,E,F]),m.useEffect(()=>{_(M=>Math.min(M,Math.max(0,r.length-1)))},[r.length]),m.useEffect(()=>{if(!E||!u||c||!h)return;const M=window.requestAnimationFrame(()=>{const U=k.current;U&&U.scrollHeight<=U.clientHeight+1&&h()});return()=>window.cancelAnimationFrame(M)},[u,c,h,E,r.length]);const P=(M=1)=>{const U=r.findIndex(H=>H.value===t),I=U>=0?U:M===1?0:Math.max(0,r.length-1);_(I),C(!0)},R=M=>{r.length!==0&&_((M+r.length)%r.length)},L=M=>{var U;p(M.value),T(),(U=O.current)==null||U.focus()};return o.jsxs("div",{className:"pp-deployment-select",ref:x,onKeyDown:M=>{var I,H;const U=M.target===w.current;if(M.key==="Escape"&&E){M.preventDefault(),T(),(I=O.current)==null||I.focus();return}if(M.key==="Tab"){T();return}if(U){M.key==="ArrowDown"&&r.length>0&&(M.preventDefault(),_(0),(H=S.current[0])==null||H.focus());return}M.key==="ArrowDown"?(M.preventDefault(),E?R(N+1):P(1)):M.key==="ArrowUp"?(M.preventDefault(),E?R(N-1):P(-1)):E&&M.key==="Home"?(M.preventDefault(),_(0)):E&&M.key==="End"&&(M.preventDefault(),_(Math.max(0,r.length-1)))},children:[o.jsxs("button",{ref:O,type:"button",className:"pp-deployment-select-trigger","aria-label":e,"aria-haspopup":"listbox","aria-expanded":E,"aria-controls":E?y:void 0,disabled:s,onClick:()=>{E?T():P()},children:[o.jsx("span",{className:A?void 0:"is-placeholder",children:A??i}),o.jsx(R3t,{className:`pp-deployment-select-chevron${E?" is-open":""}`})]}),E&&o.jsxs("div",{className:"pp-deployment-select-menu",children:[F&&o.jsx("div",{className:"pp-deployment-select-search",children:o.jsx("input",{ref:w,type:"search",value:a,"aria-label":g("deploymentSelect.searchAriaLabel",{label:e}),placeholder:b,autoComplete:"off",onChange:M=>f==null?void 0:f(M.currentTarget.value)})}),o.jsx("div",{id:y,ref:k,className:"pp-deployment-select-options",role:"listbox","aria-label":e,"aria-busy":c||void 0,onScroll:M=>{if(!u||c||!h)return;const U=M.currentTarget;U.scrollHeight-U.scrollTop-U.clientHeight<=24&&h()},children:r.map((M,U)=>{const I=M.value===t;return o.jsxs("button",{ref:H=>{S.current[U]=H},type:"button",role:"option","aria-selected":I,tabIndex:U===N?0:-1,className:`pp-deployment-select-option${I?" is-selected":""}`,title:M.description,onFocus:()=>_(U),onClick:()=>L(M),children:[o.jsxs("span",{className:"pp-deployment-select-copy",children:[o.jsxs("span",{className:"pp-deployment-select-name",children:[M.label,M.badge&&o.jsx("span",{className:"pp-deployment-select-badge",children:M.badge})]}),M.description&&o.jsx("small",{children:M.description})]}),I&&o.jsx(I3t,{})]},M.value)})}),c&&o.jsx("div",{className:"pp-deployment-select-state","aria-live":"polite",children:g("deploymentSelect.loadingMore")}),!c&&r.length===0&&o.jsx("div",{className:"pp-deployment-select-state",children:v})]})]})}function P3t(e){return[{value:"auto",label:e("deploymentResources.mode.auto"),description:e("deploymentResources.mode.autoDescription"),badge:e("deploymentResources.mode.recommended")},{value:"create",label:e("deploymentResources.mode.create"),description:e("deploymentResources.mode.createDescription")},{value:"existing",label:e("deploymentResources.mode.existing"),description:e("deploymentResources.mode.existingDescription")}]}const jje={tos:{mode:"auto"},cr:{mode:"auto"},codePipeline:{mode:"auto"}};function $f(e){const[t,n]=m.useState([]),[i,r]=m.useState(""),[s,a]=m.useState(1),[l,c]=m.useState(0),[u,d]=m.useState(!1),[f,h]=m.useState(!1),[p,g]=m.useState(null),[b,v]=m.useState(""),[y,x]=m.useState(""),[O,w]=m.useState(""),[k,S]=m.useState(0),E=m.useRef(!1),C=m.useRef(null),N=e?JSON.stringify(e):"",_=e?JSON.stringify({...e,search:y}):"";m.useEffect(()=>{const P=window.setTimeout(()=>{x(b.trim())},250);return()=>window.clearTimeout(P)},[b]),m.useEffect(()=>{v(""),x("")},[N]);const j=m.useCallback((P,R)=>{var U;if(!_)return;(U=C.current)==null||U.abort();const L=new AbortController;C.current=L;const M=JSON.parse(_);R&&n([]),E.current=!0,h(!0),g(null),o0e({...M,pageNumber:P,pageSize:100},L.signal).then(I=>{n(H=>{if(R)return I.items;const K=new Set(H.map(Q=>`${Q.id}\0${Q.name}`));return[...H,...I.items.filter(Q=>!K.has(`${Q.id}\0${Q.name}`))]}),r(I.serviceRegion),a(I.pageNumber),c(I.totalCount),d(I.hasMore),w(_)}).catch(I=>{I instanceof DOMException&&I.name==="AbortError"||(w(_),g(I instanceof Error?I.message:String(I)))}).finally(()=>{C.current===L&&(C.current=null,E.current=!1,h(!1))})},[_]);m.useEffect(()=>{var P;if(!_){(P=C.current)==null||P.abort(),C.current=null,E.current=!1,n([]),r(""),a(1),c(0),d(!1),w(""),h(!1),g(null);return}return j(1,!0),()=>{var R;return(R=C.current)==null?void 0:R.abort()}},[j,_,k]);const A=!!_&&O===_&&b.trim()===y,F=m.useCallback(()=>{w(""),S(P=>P+1)},[]),T=m.useCallback(()=>{!A||E.current||!u||j(s+1,!1)},[u,j,s,A]);return{items:t,serviceRegion:i,totalCount:l,hasMore:A?u:!1,loading:!!_&&(!A||f),error:p,search:b,setSearch:v,reload:F,loadMore:T}}function D3t(e,t){return e.map(n=>({value:n[t],label:n.name,description:[n.status,n.region,n.id].filter(Boolean).join(" · ")}))}function Ff({ariaLabel:e,value:t,valueLabel:n,state:i,disabled:r,disabledMessage:s,valueField:a="id",onChange:l}){const{t:c}=Ae("ui"),u=m.useMemo(()=>D3t(i.items,a),[i.items,a]);return o.jsxs("div",{className:"pp-resource-picker",children:[o.jsx(VE,{ariaLabel:e,value:t,valueLabel:n,placeholder:i.loading?c("common.loading"):c("deploymentResources.selectExisting"),options:u,disabled:r||!!i.error,searchValue:i.search,searchPlaceholder:c("deploymentResources.searchResource"),loading:i.loading,hasMore:i.hasMore,emptyMessage:i.search.trim()?c("deploymentResources.noMatch"):c("deploymentResources.noAvailable"),onSearchChange:i.setSearch,onLoadMore:i.loadMore,onChange:d=>{const f=i.items.find(h=>h[a]===d);f&&l(f)}}),s?o.jsx("span",{className:"pp-resource-status",children:s}):i.error?o.jsxs("div",{className:"pp-resource-error",role:"alert",children:[o.jsx("span",{children:i.error}),o.jsx("button",{type:"button",onClick:i.reload,children:c("common.retry")})]}):i.loading&&i.items.length===0?o.jsx("span",{className:"pp-resource-status","aria-live":"polite",children:i.search.trim()?c("deploymentResources.searching"):c("deploymentResources.loading")}):i.items.length===0?o.jsx("span",{className:"pp-resource-status",children:i.search.trim()?c("deploymentResources.noMatchSentence"):c("deploymentResources.noAvailableSentence")}):i.serviceRegion?o.jsx("span",{className:"pp-resource-status",children:c("deploymentResources.loadedSummary",{region:i.serviceRegion,loaded:i.items.length,total:i.totalCount>0?`/${i.totalCount}`:""})}):null]})}function Rje({region:e,value:t,disabled:n=!1,onChange:i}){const{t:r}=Ae("ui"),s=$f(e?{kind:"cr-registry",region:e}:null),a=$f(e&&(t!=null&&t.registry)?{kind:"cr-namespace",region:e,registry:t.registry}:null),l=$f(e&&(t!=null&&t.registry)&&t.namespace?{kind:"cr-repository",region:e,registry:t.registry,namespace:t.namespace}:null),c=t??{region:e,registry:"",namespace:"",repository:""};return o.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three environment-repository-fields",children:[o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:r("deploymentResources.registryInstance")}),o.jsx(Ff,{ariaLabel:r("deploymentResources.registryAriaLabel"),value:c.registry,valueLabel:c.registry,state:s,disabled:n||!e,valueField:"name",onChange:u=>i({region:e,registry:u.name,namespace:"",repository:""})})]}),o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:r("deploymentResources.namespace")}),o.jsx(Ff,{ariaLabel:r("deploymentResources.namespaceAriaLabel"),value:c.namespace,valueLabel:c.namespace,state:a,disabled:n||!c.registry,disabledMessage:c.registry?void 0:r("deploymentResources.selectRegistryFirst"),valueField:"name",onChange:u=>i({...c,region:e,namespace:u.name,repository:""})})]}),o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:r("deploymentResources.repository")}),o.jsx(Ff,{ariaLabel:r("deploymentResources.existingRepository"),value:c.repository,valueLabel:c.repository,state:l,disabled:n||!c.registry||!c.namespace,disabledMessage:c.registry?c.namespace?void 0:r("deploymentResources.selectNamespaceFirst"):r("deploymentResources.selectRegistryFirst"),valueField:"name",onChange:u=>i({...c,region:e,repository:u.name})})]})]})}function oL({resource:e,value:t,disabled:n,onChange:i}){const{t:r}=Ae("ui");return o.jsxs("label",{className:"pp-resource-field pp-resource-mode",children:[o.jsx("span",{children:r("deploymentResources.configurationMode")}),o.jsx(VE,{ariaLabel:r("deploymentResources.configurationModeAriaLabel",{resource:e}),value:t,placeholder:r("deploymentResources.selectConfigurationMode"),options:P3t(r),disabled:n,onChange:s=>i(s)})]})}function z0({label:e,value:t,placeholder:n,disabled:i,onChange:r}){return o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:e}),o.jsx("input",{value:t,placeholder:n,disabled:i,autoComplete:"off",onChange:s=>r(s.currentTarget.value)})]})}function lL({items:e,note:t}){const{t:n}=Ae("ui");return o.jsxs("div",{className:"pp-resource-auto-names",children:[o.jsx("span",{children:n("deploymentResources.automaticNames")}),o.jsx("dl",{children:e.map(i=>o.jsxs("div",{children:[o.jsx("dt",{children:i.label}),o.jsx("dd",{title:i.name,children:i.name})]},i.label))}),t&&o.jsx("small",{children:t})]})}function Ije(e){var t,n,i,r,s,a,l,c;return e.tos.mode!=="auto"&&!((t=e.tos.bucket)!=null&&t.trim())?sn.t("ui:deploymentResources.validation.tos"):e.cr.mode!=="auto"&&(!((n=e.cr.instance)!=null&&n.trim())||!((i=e.cr.namespace)!=null&&i.trim())||!((r=e.cr.repository)!=null&&r.trim()))?sn.t("ui:deploymentResources.validation.cr"):e.codePipeline.mode!=="auto"&&(!((s=e.codePipeline.workspaceName)!=null&&s.trim())||!((a=e.codePipeline.pipelineName)!=null&&a.trim()))?sn.t("ui:deploymentResources.validation.codePipeline"):e.codePipeline.mode==="existing"&&(!((l=e.codePipeline.workspaceId)!=null&&l.trim())||!((c=e.codePipeline.pipelineId)!=null&&c.trim()))?sn.t("ui:deploymentResources.validation.existingCodePipeline"):null}function Pje({value:e,agentName:t,runtimeName:n,region:i,disabled:r,validationError:s,onChange:a}){const{t:l}=Ae("ui"),c=t.trim()||"agentkit-app",u=n.trim()||c,d=i&&i!=="cn-beijing"?l("deploymentResources.autoBucketWithRegion",{region:i.startsWith("cn-")?i.slice(3):i}):l("deploymentResources.autoBucket"),f=$f(e.tos.mode==="existing"?{kind:"tos-bucket",region:i}:null),h=$f(e.cr.mode==="existing"?{kind:"cr-registry",region:i}:null),p=$f(e.cr.mode==="existing"&&e.cr.instance?{kind:"cr-namespace",region:i,registry:e.cr.instance}:null),g=$f(e.cr.mode==="existing"&&e.cr.instance&&e.cr.namespace?{kind:"cr-repository",region:i,registry:e.cr.instance,namespace:e.cr.namespace}:null),b=$f(e.codePipeline.mode==="existing"?{kind:"cp-workspace",region:i}:null),v=$f(e.codePipeline.mode==="existing"&&e.codePipeline.workspaceId?{kind:"cp-pipeline",region:i,workspaceId:e.codePipeline.workspaceId}:null),y=x=>a({...e,...x});return o.jsxs("div",{className:"pp-resource-list",children:[o.jsxs("div",{className:"pp-resource-item",children:[o.jsx("div",{className:"pp-resource-name",children:l("deploymentResources.tosBucket")}),o.jsxs("div",{className:"pp-resource-grid",children:[o.jsx(oL,{resource:l("deploymentResources.tosBucket"),value:e.tos.mode,disabled:r,onChange:x=>y({tos:{mode:x}})}),e.tos.mode==="create"&&o.jsx(z0,{label:l("deploymentResources.bucketName"),value:e.tos.bucket??"",placeholder:l("deploymentResources.bucketNamePlaceholder"),disabled:r,onChange:x=>y({tos:{...e.tos,bucket:x}})}),e.tos.mode==="existing"&&o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.existingBucket")}),o.jsx(Ff,{ariaLabel:l("deploymentResources.existingTosBucket"),value:e.tos.bucket??"",valueLabel:e.tos.bucket,state:f,disabled:r,onChange:x=>y({tos:{...e.tos,bucket:x.name}})})]}),e.tos.mode==="auto"&&o.jsx(lL,{items:[{label:l("deploymentResources.bucket"),name:d}],note:l("deploymentResources.accountIdResolved")})]})]}),o.jsxs("div",{className:"pp-resource-item",children:[o.jsx("div",{className:"pp-resource-name",children:l("deploymentResources.containerRegistry")}),o.jsxs("div",{className:"pp-resource-grid",children:[o.jsx(oL,{resource:"CR",value:e.cr.mode,disabled:r,onChange:x=>y({cr:{mode:x}})}),e.cr.mode==="create"&&o.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three",children:[o.jsx(z0,{label:l("deploymentResources.instanceName"),value:e.cr.instance??"",placeholder:l("deploymentResources.crInstance"),disabled:r,onChange:x=>y({cr:{...e.cr,instance:x}})}),o.jsx(z0,{label:l("deploymentResources.namespace"),value:e.cr.namespace??"",placeholder:l("deploymentResources.namespace"),disabled:r,onChange:x=>y({cr:{...e.cr,namespace:x}})}),o.jsx(z0,{label:l("deploymentResources.repository"),value:e.cr.repository??"",placeholder:l("deploymentResources.repository"),disabled:r,onChange:x=>y({cr:{...e.cr,repository:x}})})]}),e.cr.mode==="existing"&&o.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three",children:[o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.crInstance")}),o.jsx(Ff,{ariaLabel:l("deploymentResources.existingCrInstance"),value:e.cr.instance??"",valueLabel:e.cr.instance,state:h,disabled:r,valueField:"name",onChange:x=>y({cr:{mode:"existing",instance:x.name}})})]}),o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.namespace")}),o.jsx(Ff,{ariaLabel:l("deploymentResources.existingCrNamespace"),value:e.cr.namespace??"",valueLabel:e.cr.namespace,state:p,disabled:r||!e.cr.instance,valueField:"name",onChange:x=>y({cr:{...e.cr,namespace:x.name,repository:void 0}})})]}),o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.repository")}),o.jsx(Ff,{ariaLabel:l("deploymentResources.existingCrRepository"),value:e.cr.repository??"",valueLabel:e.cr.repository,state:g,disabled:r||!e.cr.namespace,valueField:"name",onChange:x=>y({cr:{...e.cr,repository:x.name}})})]})]}),e.cr.mode==="auto"&&o.jsx(lL,{items:[{label:l("deploymentResources.crInstance"),name:l("deploymentResources.autoRegistry")},{label:l("deploymentResources.namespace"),name:"agentkit"},{label:l("deploymentResources.repository"),name:l("deploymentResources.autoRepositoryName",{name:c})}],note:l("deploymentResources.registryNameNote")})]})]}),o.jsxs("div",{className:"pp-resource-item",children:[o.jsx("div",{className:"pp-resource-name",children:"CodePipeline"}),o.jsxs("div",{className:"pp-resource-grid",children:[o.jsx(oL,{resource:"CodePipeline",value:e.codePipeline.mode,disabled:r,onChange:x=>y({codePipeline:{mode:x}})}),e.codePipeline.mode==="create"&&o.jsxs("div",{className:"pp-resource-fields",children:[o.jsx(z0,{label:l("deploymentResources.workspaceName"),value:e.codePipeline.workspaceName??"",placeholder:l("deploymentResources.workspaceName"),disabled:r,onChange:x=>y({codePipeline:{...e.codePipeline,workspaceName:x}})}),o.jsx(z0,{label:l("deploymentResources.pipelineName"),value:e.codePipeline.pipelineName??"",placeholder:l("deploymentResources.pipelineName"),disabled:r,onChange:x=>y({codePipeline:{...e.codePipeline,pipelineName:x}})})]}),e.codePipeline.mode==="existing"&&o.jsxs("div",{className:"pp-resource-fields",children:[o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.workspace")}),o.jsx(Ff,{ariaLabel:l("deploymentResources.existingWorkspace"),value:e.codePipeline.workspaceId??"",valueLabel:e.codePipeline.workspaceName,state:b,disabled:r,onChange:x=>y({codePipeline:{mode:"existing",workspaceId:x.id,workspaceName:x.name}})})]}),o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.compatiblePipeline")}),o.jsx(Ff,{ariaLabel:l("deploymentResources.existingPipeline"),value:e.codePipeline.pipelineId??"",valueLabel:e.codePipeline.pipelineName,state:v,disabled:r||!e.codePipeline.workspaceId,onChange:x=>y({codePipeline:{...e.codePipeline,pipelineId:x.id,pipelineName:x.name}})})]})]}),e.codePipeline.mode==="auto"&&o.jsx(lL,{items:[{label:l("deploymentResources.workspace"),name:"agentkit-cli-workspace"},{label:l("deploymentResources.pipeline"),name:u}],note:l("deploymentResources.pipelineNameNote")})]})]}),s&&o.jsx("p",{className:"pp-resource-validation",role:"alert",children:s})]})}function M3t(e){return[{value:"custom",label:e("environmentCenter.creation.custom.label"),description:e("environmentCenter.creation.custom.description")},{value:"dockerfile",label:e("environmentCenter.creation.dockerfile.label"),description:e("environmentCenter.creation.dockerfile.description")},{value:"git",label:e("environmentCenter.creation.git.label"),description:e("environmentCenter.creation.git.description")},{value:"image",label:e("environmentCenter.creation.image.label"),description:e("environmentCenter.creation.image.description")}]}const L3t=xOe.map(e=>({value:e.id,label:e.label,description:e.description}));function $3t(e){return[{value:"none",label:e("common.none"),description:e("environmentCenter.presets.none")},{value:"aio-sandbox",label:"AIO Sandbox",description:e("environmentCenter.presets.aio")},{value:"codex-sandbox",label:"Codex Sandbox",description:e("environmentCenter.presets.codex")}]}function F3t(e){const t=T3t(e,"");return t===CB?"aio-sandbox":t.includes("/codexenv:")?"codex-sandbox":"none"}const B3t=oN.map(e=>({value:e.id,label:e.label})),Lte=OOe.map(e=>({value:e.id,label:e.label}));function U3t(e){return[{value:"managed",label:e("environmentCenter.repository.managed")},{value:"existing",label:e("environmentCenter.repository.existing")}]}const O8=20,$te=new Set;async function Q3t(){var e;if(typeof navigator>"u"||!((e=navigator.permissions)!=null&&e.query))return!1;try{return(await navigator.permissions.query({name:"clipboard-read"})).state==="denied"}catch{return!1}}const z3t={opencli:KLt,uv:XLt,playwright:YLt,chromium:ZLt,git:JLt,curl:e3t,ffmpeg:t3t,imagemagick:n3t};function V3t(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function Eu(){return o.jsx("span",{className:"environment-required-mark","aria-hidden":"true",children:"*"})}function H3t(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 3v11m0 0 4-4m-4 4-4-4"}),o.jsx("path",{d:"M5 16v2.5A2.5 2.5 0 0 0 7.5 21h9a2.5 2.5 0 0 0 2.5-2.5V16"})]})}function S8(e,t){const n=e.trim();if(!n)return t("environmentCenter.errors.repositoryRequired");try{const i=new URL(n);if(i.protocol!=="https:"||!i.hostname)return t("environmentCenter.errors.repositoryHttps")}catch{return t("environmentCenter.errors.repositoryInvalid")}return""}function Fte(e){return!!(e!=null&&e.region&&e.registry&&e.namespace&&e.repository)}function Dje(e,t){const n=e.trim();return n?/\s/.test(n)?t("environmentCenter.errors.imageReferenceWhitespace"):n.startsWith("sha256:")?/^sha256:[0-9a-fA-F]{64}$/.test(n)?"":t("environmentCenter.errors.imageDigestInvalid"):/[@/]/.test(n)?t("environmentCenter.errors.imageTagOnly"):"":""}function q3t(e){return(e instanceof Error?e.message:String(e)).split(` -原始响应:`,1)[0].trim()}function W3t(e){return o.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M5.5 10.5 16 5l10.5 5.5L16 16 5.5 10.5Z"}),o.jsx("path",{d:"M5.5 16 16 21.5 26.5 16M5.5 21.5 16 27l10.5-5.5"})]})}function G3t({label:e}){return o.jsx("span",{className:"environment-package-fallback",children:e.slice(0,1).toUpperCase()})}function K3t({option:e}){if(e.id==="lark-cli")return o.jsx("img",{src:UI,alt:""});if(e.id==="pandoc")return o.jsx("img",{src:GLt,alt:""});if(e.id==="github-cli")return o.jsx(XQ,{});const t=z3t[e.id];return t?o.jsx("img",{src:t,alt:""}):o.jsx(G3t,{label:e.label})}function X3t(e,t){return e?{name:e.name,description:e.description,baseEnvironment:e.baseEnvironment,operatingSystem:e.operatingSystem,language:e.language,optionIds:[...e.optionIds],selectedSkills:[...e.selectedSkills],dockerfile:e.dockerfile===AB(e,t)?void 0:e.dockerfile,gitSource:e.gitSource,containerRepository:e.containerRepository,imageSource:e.imageSource}:{...mM,optionIds:[...mM.optionIds],selectedSkills:[...mM.selectedSkills]}}const Hg=new Set(["preparing","queued","building","scanning"]),Bte=3e3,cL={preparing:"environmentCenter.buildStatus.preparing",queued:"environmentCenter.buildStatus.queued",building:"environmentCenter.buildStatus.building",scanning:"environmentCenter.buildStatus.scanning",available:"environmentCenter.buildStatus.available",failed:"environmentCenter.buildStatus.failed"};function Mje(e,t){var i;const n=(i=e.latestVersion)==null?void 0:i.status;return n?n==="available"?{label:t(cL[n]),color:"success"}:n==="failed"?{label:t(cL[n]),color:"danger"}:{label:t(cL[n]),color:"warning"}:{label:t("environmentCenter.buildStatus.notBuilt"),color:"secondary"}}function Y3t(e,t){return GQ(e,Date.now(),t)}function Z3t(e,t){const n=Date.parse(e);return Number.isNaN(n)?e:new Intl.DateTimeFormat(t,{dateStyle:"medium",timeStyle:"medium"}).format(n)}function J3t(e,t,n=Date.now()){const i=Date.parse(e.createdAt),s=Hg.has(e.status)?n:Date.parse(e.updatedAt);if(Number.isNaN(i)||Number.isNaN(s))return"";const a=Math.max(0,Math.floor((s-i)/1e3));if(a<60)return t("environmentCenter.duration.seconds",{count:a});const l=Math.floor(a/60),c=a%60;return l<60?t("environmentCenter.duration.minutesSeconds",{minutes:l,seconds:c}):t("environmentCenter.duration.hoursMinutes",{hours:Math.floor(l/60),minutes:l%60})}function e4t({environment:e,onClose:t}){var O;const{t:n}=Ae("ui"),i=((O=e.latestVersion)==null?void 0:O.versionId)??"",r=m.useId(),s=m.useRef(null),a=m.useRef(t),[l,c]=m.useState(null),[u,d]=m.useState(!0),[f,h]=m.useState(""),[p,g]=m.useState(0),[b,v]=m.useState("idle"),y=m.useMemo(()=>l?j3t(l):"",[l]);a.current=t,m.useEffect(()=>{var E;const w=document.body.style.overflow,k=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(E=s.current)==null||E.focus();const S=C=>{if(C.key==="Escape"){C.preventDefault(),a.current();return}if(C.key!=="Tab"||!s.current)return;const N=Array.from(s.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')).filter(A=>A.getClientRects().length>0);if(!N.length)return;const _=N[0],j=N[N.length-1];C.shiftKey&&document.activeElement===_?(C.preventDefault(),j.focus()):!C.shiftKey&&document.activeElement===j&&(C.preventDefault(),_.focus())};return window.addEventListener("keydown",S),()=>{document.body.style.overflow=w,window.removeEventListener("keydown",S),k!=null&&k.isConnected&&k.focus()}},[]),m.useEffect(()=>{const w=new AbortController;return d(!0),h(""),_0e(e.id,i,w.signal).then(c).catch(k=>{(k==null?void 0:k.name)!=="AbortError"&&h(k instanceof Error?k.message:String(k))}).finally(()=>{w.signal.aborted||d(!1)}),()=>w.abort()},[e.id,p,i]),m.useEffect(()=>{if(b!=="copied")return;const w=window.setTimeout(()=>v("idle"),1500);return()=>window.clearTimeout(w)},[b]);const x=async()=>{try{await navigator.clipboard.writeText(y),v("copied")}catch{v("error")}};return Li.createPortal(o.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:w=>{w.target===w.currentTarget&&t()},children:o.jsxs("section",{ref:s,className:"environment-build-dialog environment-manifest-dialog",role:"dialog","aria-modal":"true","aria-labelledby":r,"aria-busy":u||void 0,tabIndex:-1,children:[o.jsxs("header",{className:"environment-build-dialog__header",children:[o.jsxs("div",{children:[o.jsx("div",{className:"environment-build-dialog__title-row",children:o.jsx("h2",{id:r,children:n("environmentCenter.manifest.title")})}),o.jsxs("p",{children:[e.name," / ",i]})]}),o.jsx(zt,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":n("environmentCenter.manifest.closeLabel"),children:o.jsx(Ba,{"aria-hidden":!0})})]}),o.jsx("div",{className:"environment-manifest-dialog__body",children:u?o.jsx("div",{className:"environment-manifest-dialog__state",role:"status",children:o.jsx(An,{as:"span",children:n("environmentCenter.manifest.loading")})}):f?o.jsxs("div",{className:"environment-manifest-dialog__state is-error",role:"alert",children:[o.jsx("p",{children:f}),o.jsx(zt,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>g(w=>w+1),children:n("common.reload")})]}):o.jsx("div",{className:"environment-manifest-dialog__editor","aria-label":n("environmentCenter.manifest.editorLabel"),children:o.jsx(zE,{value:y,path:"environment.yaml",readOnly:!0,onChange:()=>{}})})}),o.jsxs("footer",{className:"environment-build-dialog__actions",children:[b==="error"?o.jsx("span",{className:"environment-manifest-dialog__copy-error",role:"alert",children:n("environmentCenter.manifest.copyFailed")}):null,o.jsx(zt,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:n("common.close")}),o.jsx(zt,{type:"button",color:"info",size:"sm",disabled:!y,onClick:()=>void x(),children:n(b==="copied"?"environmentCenter.manifest.copied":"environmentCenter.manifest.copy")})]})]})}),document.body)}function t4t({environment:e,onClose:t,onBuildUpdate:n,onRebuild:i}){var S,E;const{t:r}=Ae("ui"),s=e.latestVersion,[a,l]=m.useState(s),[c,u]=m.useState(!!s),[d,f]=m.useState(""),[h,p]=m.useState(Date.now()),[g,b]=m.useState(!1),v=m.useId(),y=m.useRef(null),x=m.useRef(t),O=m.useRef(n);m.useEffect(()=>{x.current=t,O.current=n},[n,t]),m.useEffect(()=>{var j;const C=document.body.style.overflow,N=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(j=y.current)==null||j.focus();const _=A=>{var R;if(A.key==="Escape"&&x.current(),A.key!=="Tab")return;const F=Array.from(((R=y.current)==null?void 0:R.querySelectorAll('button:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])'))??[]).filter(L=>L.getClientRects().length>0);if(!F.length)return;const T=F[0],P=F[F.length-1];A.shiftKey&&document.activeElement===T?(A.preventDefault(),P.focus()):!A.shiftKey&&document.activeElement===P&&(A.preventDefault(),T.focus())};return window.addEventListener("keydown",_),()=>{document.body.style.overflow=C,window.removeEventListener("keydown",_),N!=null&&N.isConnected&&N.focus()}},[]),m.useEffect(()=>{if(!s)return;let C=0;const N=new AbortController,_=async()=>{u(!0);try{const j=await A0e(e.id,s.versionId,{includeLogs:!0,signal:N.signal});l(j),f(""),O.current(j),Hg.has(j.status)&&(C=window.setTimeout(_,Bte))}catch(j){if((j==null?void 0:j.name)==="AbortError")return;f(j instanceof Error?j.message:String(j)),C=window.setTimeout(_,Bte)}finally{N.signal.aborted||u(!1)}};return _(),()=>{N.abort(),window.clearTimeout(C)}},[e.id,s==null?void 0:s.versionId]),m.useEffect(()=>{if(!a||!Hg.has(a.status))return;const C=window.setInterval(()=>p(Date.now()),1e3);return()=>window.clearInterval(C)},[a==null?void 0:a.status]);const w=a?Mje({...e,latestVersion:a},r):{label:r("environmentCenter.buildStatus.notBuilt"),color:"secondary"},k=e.imageSource||(E=(S=a==null?void 0:a.resources)==null?void 0:S.codePipeline)==null?void 0:E.consoleUrl;return Li.createPortal(o.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:C=>{C.target===C.currentTarget&&t()},children:o.jsxs("section",{ref:y,className:"environment-build-dialog",role:"dialog","aria-modal":"true","aria-labelledby":v,tabIndex:-1,children:[o.jsxs("header",{className:"environment-build-dialog__header",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"environment-build-dialog__title-row",children:[o.jsx("h2",{id:v,children:r("environmentCenter.buildDetails.title")}),o.jsx(ba,{color:w.color,size:"sm",children:w.label})]}),o.jsx("p",{children:e.name})]}),o.jsx(zt,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":r("environmentCenter.buildDetails.closeLabel"),children:o.jsx(Ba,{"aria-hidden":!0})})]}),o.jsxs("div",{className:"environment-build-dialog__summary",children:[o.jsxs("div",{children:[o.jsx("span",{children:r("environmentCenter.buildDetails.currentStep")}),o.jsx("strong",{children:(a==null?void 0:a.currentStep)||r("environmentCenter.buildDetails.waiting")})]}),o.jsxs("div",{children:[o.jsx("span",{children:r("environmentCenter.buildDetails.elapsed")}),o.jsx("strong",{children:a?J3t(a,r,h):"-"})]}),a!=null&&a.sourceCommitSha?o.jsxs("div",{children:[o.jsx("span",{children:r("environmentCenter.buildDetails.sourceCommit")}),o.jsx("strong",{title:a.sourceCommitSha,children:a.sourceCommitSha.slice(0,12)})]}):null,k?o.jsxs("a",{href:k,target:"_blank",rel:"noreferrer",children:[r("environmentCenter.buildDetails.openCodePipeline")," ",o.jsx(gb,{"aria-hidden":!0})]}):null]}),o.jsxs("div",{className:"environment-build-dialog__body",children:[d?o.jsx("p",{className:"environment-build-dialog__error",role:"alert",children:d}):null,a!=null&&a.progressError?o.jsx("p",{className:"environment-build-dialog__notice",children:a.progressError}):null,o.jsx(o3t,{steps:(a==null?void 0:a.steps)??[],log:(a==null?void 0:a.logTail)??"",logError:a==null?void 0:a.logError,logTruncated:a==null?void 0:a.logTruncated,logUpdatedAt:a==null?void 0:a.logUpdatedAt,loading:c&&!!(a&&Hg.has(a.status))}),(a==null?void 0:a.status)==="failed"&&a.error?o.jsx("p",{className:"environment-build-dialog__failure",role:"alert",children:a.error}):null]}),o.jsxs("footer",{className:"environment-build-dialog__actions",children:[o.jsx(zt,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:r("common.close")}),a&&!e.imageSource&&!Hg.has(a.status)?o.jsx(zt,{type:"button",color:"info",size:"sm",disabled:g,onClick:()=>{b(!0),i().then(t).finally(()=>b(!1))},children:r(g?"environmentCenter.buildDetails.starting":"environmentCenter.buildDetails.rebuild")}):null]})]})}),document.body)}function Lje({cloudProvider:e,value:t,disabled:n,onChange:i}){const{t:r}=Ae("ui"),s=Iu(e).map(a=>({value:a.value,label:a.label}));return o.jsxs("label",{className:"environment-field environment-region-field",children:[o.jsxs("span",{children:[r("environmentCenter.region"),o.jsx(Eu,{})]}),o.jsx(Ls,{id:"environment-region",value:t,options:s,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:n,triggerClassName:"environment-select-trigger",onChange:a=>i(a.value)})]})}function n4t({repositoryUrl:e,gitRef:t,dockerfilePath:n,inspection:i,inspectedKey:r,disabled:s,onRepositoryUrlChange:a,onGitRefChange:l,onDockerfilePathChange:c,onInspectionChange:u,onInspectedKeyChange:d}){const{t:f}=Ae("ui"),[h,p]=m.useState(!1),[g,b]=m.useState(""),v=m.useRef(null),y=m.useRef(""),x=`${e.trim()}\0${t.trim()}`,O=r===x;m.useEffect(()=>()=>{const E=v.current;v.current=null,E==null||E.abort()},[]);const w=()=>{var E;(E=v.current)==null||E.abort(),v.current=null,p(!1),b(""),u(null),d(""),c(""),y.current=""},k=m.useCallback(async()=>{var N;const E=S8(e,f);if(E){b(E);return}y.current=x,(N=v.current)==null||N.abort();const C=new AbortController;v.current=C,p(!0),b("");try{const _=await x0e({repositoryUrl:e.trim(),...t.trim()?{ref:t.trim()}:{}},C.signal);if(v.current!==C)return;u(_),d(x),c(_.dockerfiles.length===1?_.dockerfiles[0]:"")}catch(_){if((_==null?void 0:_.name)==="AbortError")return;b(q3t(_)),u(null),d(""),c("")}finally{v.current===C&&(v.current=null,p(!1))}},[x,t,c,d,u,e,f]);m.useEffect(()=>{if(s||O||y.current===x||S8(e,f))return;const E=window.setTimeout(()=>void k(),600);return()=>window.clearTimeout(E)},[x,s,k,O,e,f]);const S=O?(i==null?void 0:i.dockerfiles)??[]:[];return o.jsxs("section",{className:"environment-source-section","aria-label":f("environmentCenter.git.sectionLabel"),children:[o.jsxs("div",{className:"environment-form-grid environment-git-fields",children:[o.jsxs("label",{className:"environment-field",children:[o.jsxs("span",{children:[f("environmentCenter.git.address"),o.jsx(Eu,{})]}),o.jsx(qr,{size:"lg",type:"url",required:!0,value:e,placeholder:"https://github.com/owner/repository.git",autoComplete:"url",disabled:s,"aria-invalid":!!g,onChange:E=>{w(),a(E.currentTarget.value)}})]}),o.jsxs("label",{className:"environment-field",children:[o.jsx("span",{children:f("environmentCenter.git.ref")}),o.jsx(qr,{size:"lg",value:t,placeholder:f("environmentCenter.git.defaultBranch"),autoComplete:"off",disabled:s,onChange:E=>{w(),l(E.currentTarget.value)}})]})]}),o.jsxs("div",{className:"environment-inspection-status environment-form-feedback","aria-live":"polite",children:[h?o.jsx(An,{as:"span",children:f("environmentCenter.git.inspecting")}):null,g?o.jsxs("div",{className:"environment-source-error",role:"alert",children:[o.jsx("span",{children:g}),o.jsxs(zt,{type:"button",color:"primary",size:"sm",pill:!1,disabled:s,onClick:()=>void k(),children:[o.jsx(Kj,{}),f("common.retry")]})]}):null,!h&&!g&&O&&i?S.length>0?o.jsx("span",{children:i.commitSha?f("environmentCenter.git.foundDockerfiles",{commit:i.commitSha.slice(0,12),count:S.length}):f("environmentCenter.git.savedDockerfileLoaded")}):o.jsxs("div",{className:"environment-source-error",role:"alert",children:[o.jsx("span",{children:f("environmentCenter.git.noDockerfile")}),o.jsx("button",{type:"button",disabled:s,onClick:()=>void k(),children:f("environmentCenter.git.inspectAgain")})]}):null]}),S.length>0?o.jsxs("label",{className:"environment-field environment-dockerfile-picker",children:[o.jsxs("span",{children:["Dockerfile",o.jsx(Eu,{})]}),o.jsx(VE,{ariaLabel:f("environmentCenter.git.selectDockerfile"),value:n,valueLabel:n,placeholder:f("environmentCenter.git.selectDockerfile"),options:S.map(E=>({value:E,label:E})),disabled:s||h,onChange:c})]}):null]})}function i4t({cloudProvider:e,mode:t,region:n,value:i,disabled:r,onModeChange:s,onRegionChange:a,onChange:l}){const{t:c}=Ae("ui");return o.jsx("section",{className:"environment-source-section","aria-label":c("environmentCenter.repository.outputSection"),children:o.jsxs("div",{className:"environment-form-grid",children:[o.jsxs("label",{className:"environment-field",children:[o.jsxs("span",{children:[c("environmentCenter.repository.type"),o.jsx(Eu,{})]}),o.jsx(Ls,{id:"environment-repository-mode",value:t,options:U3t(c),optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:r,triggerClassName:"environment-select-trigger",onChange:u=>s(u.value)})]}),o.jsx(Lje,{cloudProvider:e,value:n,disabled:r,onChange:a}),t==="existing"?o.jsx(Rje,{region:n,value:i,disabled:r,onChange:l}):o.jsx("p",{className:"environment-source-note environment-form-feedback",children:c("environmentCenter.repository.managedHint")})]})})}function r4t({cloudProvider:e,region:t,repository:n,reference:i,disabled:r,onRegionChange:s,onRepositoryChange:a,onReferenceChange:l}){const{t:c}=Ae("ui"),u=Dje(i,c);return o.jsx("section",{className:"environment-source-section","aria-label":c("environmentCenter.existingImage.sectionLabel"),children:o.jsxs("div",{className:"environment-form-grid",children:[o.jsx(Lje,{cloudProvider:e,value:t,disabled:r,onChange:s}),o.jsx(Rje,{region:t,value:n,disabled:r,onChange:a}),o.jsxs("label",{className:"environment-field environment-image-reference",children:[o.jsxs("span",{children:[c("environmentCenter.existingImage.reference"),o.jsx(Eu,{})]}),o.jsx(qr,{size:"lg",value:i,required:!0,placeholder:c("environmentCenter.existingImage.placeholder"),autoComplete:"off",disabled:r,"aria-invalid":!!u,onChange:d=>l(d.currentTarget.value)}),u?o.jsx("small",{className:"environment-source-field__error",role:"alert",children:u}):o.jsx("small",{children:c("environmentCenter.existingImage.hint")})]})]})})}function $je(e,t,n,i){const r=m.useRef(n),s=m.useRef(i);r.current=n,s.current=i,m.useEffect(()=>{const a=document.body.style.overflow,l=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden";const c=window.requestAnimationFrame(()=>{var d;return(d=t.current)==null?void 0:d.focus()}),u=d=>{var g;if(d.key==="Escape"&&!s.current){d.preventDefault(),r.current();return}if(d.key!=="Tab")return;const f=Array.from(((g=e.current)==null?void 0:g.querySelectorAll('button:not([disabled]), textarea:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])'))??[]).filter(b=>b.getClientRects().length>0);if(!f.length)return;const h=f[0],p=f[f.length-1];d.shiftKey&&document.activeElement===h?(d.preventDefault(),p.focus()):!d.shiftKey&&document.activeElement===p&&(d.preventDefault(),h.focus())};return window.addEventListener("keydown",u),()=>{window.cancelAnimationFrame(c),document.body.style.overflow=a,window.removeEventListener("keydown",u),l!=null&&l.isConnected&&l.focus()}},[e,t])}function s4t({environment:e,onClose:t}){const{t:n}=Ae("ui"),i=m.useId(),r=m.useId(),s=m.useRef(null),a=m.useRef(null),[l,c]=m.useState(""),[u,d]=m.useState("loading"),[f,h]=m.useState(""),p=u==="loading";$je(s,a,t,p);const g=async(b="",v)=>{d("loading"),h("");try{const y=b||(await w0e(e.id,v)).shareCode;c(y),await u0e(y),v!=null&&v.aborted||d("copied")}catch(y){if((y==null?void 0:y.name)==="AbortError")return;h(y instanceof Error?y.message:String(y)),d("error")}};return m.useEffect(()=>{const b=new AbortController;return g("",b.signal),()=>b.abort()},[e.id]),Li.createPortal(o.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:b=>{b.target===b.currentTarget&&!p&&t()},children:o.jsxs("section",{ref:s,className:"environment-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":i,"aria-describedby":r,"aria-busy":p||void 0,children:[o.jsxs("header",{className:"environment-build-dialog__header",children:[o.jsxs("div",{children:[o.jsx("h2",{id:i,children:n("environmentCenter.share.title")}),o.jsx("p",{id:r,children:e.name})]}),o.jsx(zt,{ref:a,type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:p,onClick:t,"aria-label":n("environmentCenter.share.closeLabel"),children:o.jsx(Ba,{"aria-hidden":!0})})]}),o.jsx("div",{className:"environment-share-dialog__body",children:u==="loading"?o.jsx(An,{as:"p",children:n("environmentCenter.share.generating")}):o.jsxs("div",{className:"environment-share-dialog__result",children:[u==="copied"?o.jsx("p",{className:"environment-share-dialog__success",role:"status","aria-live":"polite",children:n("environmentCenter.share.copied")}):o.jsxs("div",{className:"environment-share-dialog__error",role:"alert",children:[o.jsx("strong",{children:n("environmentCenter.share.failed")}),o.jsx("span",{children:f})]}),l?o.jsxs("label",{className:"environment-share-dialog__field environment-share-dialog__manual-code",children:[o.jsx("span",{children:n("environmentCenter.share.code")}),o.jsx(Rm,{size:"lg",rows:4,value:l,readOnly:!0,"aria-label":n("environmentCenter.share.fullCode"),onFocus:b=>b.currentTarget.select(),onClick:b=>b.currentTarget.select()}),o.jsx("small",{children:n(u==="copied"?"environmentCenter.share.copiedHint":"environmentCenter.share.copyFailedHint")})]}):null,o.jsx("p",{className:"environment-share-dialog__safety",children:n("environmentCenter.share.safety")})]})}),o.jsxs("footer",{className:"environment-build-dialog__actions",children:[o.jsx(zt,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:p,onClick:t,children:n("common.close")}),u==="error"?o.jsx(zt,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("common.retry")}):u==="copied"?o.jsx(zt,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("environmentCenter.share.copyAgain")}):null]})]})}),document.body)}function a4t({initialValue:e,autoInspect:t,onClose:n,onImported:i}){const{t:r}=Ae("ui"),s=m.useId(),a=m.useId(),l=m.useId(),c=m.useRef(null),u=m.useRef(null),d=m.useRef(!1),[f,h]=m.useState(e),[p,g]=m.useState("editing"),[b,v]=m.useState([]),[y,x]=m.useState(""),[O,w]=m.useState([]),k=m.useMemo(()=>YF(f),[f]),S=k.length>O8,E=p==="inspecting"||p==="importing",C=b.filter(T=>T.status==="valid"),N=b.filter(T=>T.status==="invalid"),_=p==="ready"&&C.length>0;$je(c,u,n,E);const j=m.useCallback(async()=>{if(!(!k.length||S)){g("inspecting"),x(""),w([]);try{const T=await O0e(k);v([...T].sort((P,R)=>P.index-R.index)),g("ready")}catch(T){x(T instanceof Error?T.message:String(T)),g("editing")}}},[k,S]);m.useEffect(()=>{!t||d.current||(d.current=!0,j())},[t,j]);const A=async()=>{if(_){g("importing"),x(""),w([]);try{const T=C.map(Q=>({code:k[Q.index],name:Q.name})).filter(Q=>!!Q.code),P=await S0e(T.map(Q=>Q.code)),R=P.filter(Q=>Q.status==="created").length,L=P.filter(Q=>Q.status==="duplicate").length,M=new Map(P.map(Q=>[Q.index,Q])),U=T.flatMap(({code:Q,name:q},B)=>{const ee=M.get(B);return!ee||ee.status==="failed"?[{code:Q,name:q,status:"valid",error:(ee==null?void 0:ee.error)||r("environmentCenter.import.noResult")}]:[]}),H=[...N.flatMap(Q=>{const q=k[Q.index];return q?[{code:q,name:"",status:"invalid",error:Q.error||r("environmentCenter.import.invalidCode")}]:[]}),...U],K=new Map;if(P.forEach(Q=>{Q.environment&&K.set(Q.environment.id,Q.environment)}),i([...K.values()],R,L,H.length),!H.length){n();return}h(H.map(Q=>Q.code).join(` -`)),w(U),v(H.map((Q,q)=>({index:q,status:Q.status,name:Q.name,error:Q.status==="invalid"?Q.error:""}))),x(r("environmentCenter.import.partial",{created:R,remaining:H.length})),g("ready")}catch(T){x(T instanceof Error?T.message:String(T)),g("ready")}}},F=p==="inspecting"?r("environmentCenter.import.inspecting"):p==="importing"?r("environmentCenter.import.importing"):_?O.length?r("environmentCenter.import.retryImport"):r("environmentCenter.import.confirm"):r("environmentCenter.import.inspectCodes");return Li.createPortal(o.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:T=>{T.target===T.currentTarget&&!E&&n()},children:o.jsxs("section",{ref:c,className:"environment-share-dialog environment-import-dialog",role:"dialog","aria-modal":"true","aria-labelledby":s,"aria-describedby":a,"aria-busy":E||void 0,children:[o.jsxs("header",{className:"environment-build-dialog__header",children:[o.jsxs("div",{children:[o.jsx("h2",{id:s,children:r("environmentCenter.import.title")}),o.jsx("p",{id:a,children:r("environmentCenter.import.description")})]}),o.jsx(zt,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:E,onClick:n,"aria-label":r("environmentCenter.import.closeLabel"),children:o.jsx(Ba,{"aria-hidden":!0})})]}),o.jsxs("div",{className:"environment-share-dialog__body",children:[o.jsxs("label",{className:"environment-share-dialog__field",children:[o.jsx("span",{children:r("environmentCenter.import.code")}),o.jsx(Rm,{ref:u,size:"lg",rows:6,value:f,disabled:E,"aria-invalid":S||N.length>0||void 0,"aria-describedby":l,placeholder:"akenv://v1/...",onChange:T=>{h(T.currentTarget.value),g("editing"),v([]),x(""),w([])}})]}),o.jsx("p",{id:l,className:`environment-share-dialog__help${S?" is-error":""}`,children:S?r("environmentCenter.import.tooMany",{max:O8,count:k.length}):r("environmentCenter.import.multipleHint")}),o.jsx("p",{className:"environment-share-dialog__safety",children:r("environmentCenter.import.safety")}),p==="inspecting"?o.jsx(An,{as:"p",children:r("environmentCenter.import.inspectingCodes")}):C.length?o.jsx("p",{className:"environment-share-dialog__summary",role:"status","aria-live":"polite",children:r("environmentCenter.import.found",{count:C.length,names:C.map(T=>T.name||r("environmentCenter.unnamed")).join(r("environmentCenter.listSeparator"))})}):null,N.length?o.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:N.map(T=>o.jsx("li",{children:r("environmentCenter.import.itemError",{index:T.index+1,error:T.error||r("environmentCenter.import.invalidCode")})},T.index))}):null,O.length?o.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:O.map((T,P)=>o.jsx("li",{children:r("environmentCenter.import.itemError",{index:P+1,error:T.error})},`${T.code}:${P}`))}):null,y?o.jsx("p",{className:"environment-share-dialog__error-text",role:"alert",children:y}):null]}),o.jsxs("footer",{className:"environment-build-dialog__actions",children:[o.jsx(zt,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:E,onClick:n,children:r("common.cancel")}),o.jsx(zt,{type:"button",color:"info",size:"sm",loading:E,disabled:E||!k.length||S||p==="ready"&&!_,onClick:()=>_?void A():void j(),children:F})]})]})}),document.body)}function o4t({environment:e,cloudProvider:t,onCancel:n,onDelete:i,onShare:r,onSave:s}){var nt,ke,Ht,on,Yt,xt,Pt;const{t:a,i18n:l}=Ae("ui"),c=M3t(a),u=X3t(e,t),d=u.dockerfile!==void 0,[f,h]=m.useState(()=>({...u,dockerfile:d?void 0:u.dockerfile})),[p,g]=m.useState(u.gitSource?"git":u.imageSource?"image":d?"dockerfile":"custom"),[b,v]=m.useState(d?(e==null?void 0:e.dockerfile)??"":""),[y,x]=m.useState(""),O=m.useRef(null),[w,k]=m.useState(()=>d?F3t((e==null?void 0:e.dockerfile)??""):u.baseEnvironment==="aio-sandbox"||u.baseEnvironment==="codex-sandbox"?u.baseEnvironment:"none"),[S,E]=m.useState(((nt=u.gitSource)==null?void 0:nt.repositoryUrl)??""),[C,N]=m.useState(((ke=u.gitSource)==null?void 0:ke.ref)??""),[_,j]=m.useState(((Ht=u.gitSource)==null?void 0:Ht.dockerfilePath)??""),[A,F]=m.useState(u.gitSource?{repositoryUrl:u.gitSource.repositoryUrl,ref:u.gitSource.ref??"",commitSha:"",dockerfiles:[u.gitSource.dockerfilePath]}:null),[T,P]=m.useState(u.gitSource?`${u.gitSource.repositoryUrl}\0${u.gitSource.ref??""}`:""),[R,L]=m.useState(u.containerRepository?"existing":"managed"),[M,U]=m.useState(((on=u.containerRepository)==null?void 0:on.region)??Ji(t)),[I,H]=m.useState(u.containerRepository??void 0),[K,Q]=m.useState(((Yt=u.imageSource)==null?void 0:Yt.region)??Ji(t)),[q,B]=m.useState(u.imageSource?{region:u.imageSource.region,registry:u.imageSource.registry,namespace:u.imageSource.namespace,repository:u.imageSource.repository}:void 0),[ee,le]=m.useState(((xt=u.imageSource)==null?void 0:xt.reference)??""),[se,re]=m.useState(!1),ge=m.useMemo(()=>AB(f,t),[t,f.baseEnvironment,f.operatingSystem,f.language,f.optionIds]),W=f.dockerfile??ge,X=w!=="none",ae=w==="aio-sandbox"?CB:w==="codex-sandbox"?wOe[t]:"",ue=X?A3t(b):b,Oe=X?QA(ae,""):"",Se=X?QA(ae,ue):b,lt=y||(X?_3t(ue,ae,a):ZQ(b,void 0,a)),$e=!!e,Le="environment-editor-form",[Ne,qe]=m.useState(!1),[Re,ze]=m.useState(""),Ee=!!Se.trim()&&!lt,De=`${S.trim()}\0${C.trim()}`,J=!S8(S,a)&&T===De&&!!_&&(R==="managed"||Fte(I)),he=Fte(q)&&!!ee.trim()&&!Dje(ee,a),Ce=!!f.name.trim()&&!Ne&&(p==="custom"||p==="dockerfile"&&Ee||p==="git"&&J||p==="image"&&he),Ze=(ct,gt)=>{h(Pe=>({...Pe,optionIds:gt?[...Pe.optionIds,ct]:Pe.optionIds.filter(kt=>kt!==ct)}))},at=ct=>{x(""),v(X?QA(ae,ct):ct)},St=async ct=>{if(!ct)return;const gt=await N3t(ct,a);x(gt.error),gt.content&&v(gt.content)},Te=()=>{x(""),v(Oe)},ye=async ct=>{if(ct.preventDefault(),!!Ce){qe(!0),ze("");try{const gt=rat(Se);await s({...f,name:f.name.trim(),description:f.description.trim(),optionIds:p==="custom"?f.optionIds:[],selectedSkills:p==="custom"?f.selectedSkills:[],dockerfile:p==="dockerfile"?Se:p==="custom"?W:"",gitSource:p==="git"?{repositoryUrl:S.trim(),...C.trim()?{ref:C.trim()}:{},dockerfilePath:_}:null,containerRepository:p==="git"&&R==="existing"?I:null,imageSource:p==="image"&&q?{...q,reference:ee.trim()}:null,...p==="dockerfile"?gt:{}})}catch(gt){ze(gt instanceof Error?gt.message:String(gt)),qe(!1)}}},Ve=f.name.trim()||($e?(e==null?void 0:e.name)||a("environmentCenter.configure"):a("environmentCenter.create"));return o.jsx(Th,{className:"environment-editor","aria-label":a($e?"environmentCenter.details":"environmentCenter.create"),children:o.jsx(uE,{title:Ve,description:a("environmentCenter.editorDescription"),identitySeed:Ve,backLabel:a("environmentCenter.backToList"),onBack:n,actions:o.jsxs(o.Fragment,{children:[i?o.jsx(zt,{type:"button",color:"danger",variant:"ghost",size:"sm",onClick:i,disabled:Ne,children:a("common.delete")}):null,r?o.jsx(zt,{color:"secondary",variant:"soft",size:"sm",onClick:r,disabled:Ne,children:a("environmentCenter.share.action")}):null,o.jsx(zt,{color:"secondary",variant:"soft",size:"sm",onClick:n,disabled:Ne,children:a("common.cancel")}),o.jsx(zt,{color:"info",size:"sm",type:"submit",form:Le,disabled:!Ce,children:a(Ne?"common.saving":p==="image"?$e?"environmentCenter.save":"environmentCenter.create":$e?"environmentCenter.saveAndBuild":"environmentCenter.createAndBuild")})]}),children:o.jsxs("form",{id:Le,className:"environment-form",onSubmit:ye,children:[o.jsxs("div",{className:"environment-fields",children:[o.jsxs("label",{className:"environment-field",children:[o.jsxs("span",{children:[a("environmentCenter.name"),o.jsx(Eu,{})]}),o.jsx(qr,{className:"environment-text-input",type:"text",size:"lg",required:!0,value:f.name,maxLength:60,placeholder:a("environmentCenter.namePlaceholder"),onChange:ct=>h(gt=>({...gt,name:ct.target.value}))})]}),o.jsxs("label",{className:"environment-field",children:[o.jsx("span",{children:a("common.description")}),o.jsx(Rm,{className:"environment-description-input",size:"lg",rows:3,value:f.description,maxLength:180,placeholder:a("environmentCenter.descriptionPlaceholder"),onChange:ct=>h(gt=>({...gt,description:ct.target.value}))})]})]}),o.jsxs("label",{className:"environment-field environment-creation-method",children:[o.jsxs("span",{children:[a("environmentCenter.creationMethod"),o.jsx(Eu,{})]}),o.jsx(Ls,{id:"environment-creation-method",value:p,options:c,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:ct=>{const gt=ct.value;g(gt),gt==="dockerfile"&&!b.trim()&&v(Oe),ze("")}}),o.jsx("small",{children:(Pt=c.find(ct=>ct.value===p))==null?void 0:Pt.description})]}),Re?o.jsx("p",{className:"environment-form-error",role:"alert",children:Re}):null,p==="custom"?o.jsxs("div",{className:"environment-configuration",children:[o.jsx("section",{className:"environment-section environment-form-section","aria-label":a("environmentCenter.baseConfiguration"),children:o.jsxs("div",{className:"environment-form-grid",children:[o.jsxs("label",{className:"environment-field",children:[o.jsxs("span",{children:[a("environmentCenter.baseEnvironment"),o.jsx(Eu,{})]}),o.jsx(Ls,{id:"environment-base-environment",value:f.baseEnvironment,options:L3t.map(ct=>({...ct,description:a(`environmentCenter.baseDescriptions.${ct.value}`)})),optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:ct=>{const gt=ct.value,Pe=gt==="aio-sandbox"||gt==="codex-sandbox";h(kt=>({...kt,baseEnvironment:gt,operatingSystem:Pe?"ubuntu-22.04":kt.operatingSystem,language:Pe?"python-3.12":kt.language}))}}),o.jsx("small",{children:a(`environmentCenter.baseDescriptions.${f.baseEnvironment}`)})]}),o.jsxs("label",{className:"environment-field",children:[o.jsxs("span",{children:[a("environmentCenter.operatingSystem"),o.jsx(Eu,{})]}),o.jsx(Ls,{id:"environment-operating-system",value:f.operatingSystem,options:B3t,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:ct=>h(gt=>({...gt,operatingSystem:ct.value}))}),o.jsx("small",{children:f.baseEnvironment!=="ubuntu"?a("environmentCenter.fixedByBase",{base:O6(f.baseEnvironment),value:"Ubuntu 22.04"}):a("environmentCenter.selectUbuntuVersion")})]}),o.jsxs("label",{className:"environment-field",children:[o.jsxs("span",{children:[a("environmentCenter.pythonVersion"),o.jsx(Eu,{})]}),o.jsx(Ls,{id:"environment-python-version",value:f.language,options:f.baseEnvironment!=="ubuntu"?Lte.filter(ct=>ct.value==="python-3.12"):Lte,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:ct=>h(gt=>({...gt,language:ct.value}))}),o.jsx("small",{children:f.baseEnvironment!=="ubuntu"?a("environmentCenter.fixedByBase",{base:O6(f.baseEnvironment),value:"Python 3.12"}):a("environmentCenter.selectPythonVersion")})]})]})}),o.jsxs("section",{className:"environment-section","aria-labelledby":"environment-skills-title",children:[o.jsx("h2",{id:"environment-skills-title",children:a("environmentCenter.skills")}),o.jsxs("div",{className:"environment-skill-grid",children:[o.jsx(Mte,{name:"VeADK",description:a("environmentCenter.veadkDescription"),selected:se,disabled:Ne,onChange:re,icon:o.jsx("img",{src:ER,alt:""})}),o.jsx(YQ,{selected:f.selectedSkills,onChange:ct=>h(gt=>({...gt,selectedSkills:ct})),cloudProvider:t,disabled:Ne,addLabel:a("environmentCenter.addSkill"),showSelectedCount:!1})]})]}),TB.map(ct=>o.jsxs("section",{className:"environment-section","aria-labelledby":`environment-${ct.id}-title`,children:[o.jsx("h2",{id:`environment-${ct.id}-title`,children:a(`environmentCenter.categories.${ct.id}`)}),o.jsx("div",{className:"environment-option-grid",children:ct.options.map(gt=>{const Pe=f.optionIds.includes(gt.id);return o.jsx(Mte,{name:gt.label,description:a(`environmentCenter.options.${gt.id}`,{defaultValue:gt.description}),selected:Pe,onChange:kt=>Ze(gt.id,kt),icon:o.jsx(K3t,{option:gt})},gt.id)})})]},ct.id))]}):p==="dockerfile"?o.jsxs("section",{className:"environment-upload","aria-label":a("environmentCenter.customDockerfile"),children:[o.jsx("div",{className:"environment-dockerfile-settings environment-form-grid",children:o.jsxs("label",{className:"environment-field",children:[o.jsx("span",{children:a("environmentCenter.presetEnvironment")}),o.jsx(Ls,{id:"environment-dockerfile-base-environment",value:w,options:$3t(a),optionClassName:"environment-select-option",size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:ct=>{x(""),k(ct.value)}}),o.jsx("small",{children:a("environmentCenter.presetHint")})]})}),o.jsxs("div",{className:"environment-upload__preview",children:[o.jsxs("div",{children:[o.jsxs("h3",{children:["Dockerfile",o.jsx(Eu,{})]}),o.jsxs("div",{className:"environment-upload__actions",children:[o.jsx("span",{className:"environment-upload__size",children:a("environmentCenter.dockerfileSize",{size:Nje(Se).toLocaleString(l.resolvedLanguage??l.language),max:131072 .toLocaleString(l.resolvedLanguage??l.language)})}),o.jsx("input",{ref:O,className:"environment-upload__file-input",type:"file",accept:".dockerfile,text/plain",tabIndex:-1,hidden:!0,onChange:ct=>{var Pe;const gt=ct.currentTarget;St((Pe=gt.files)==null?void 0:Pe[0]).finally(()=>{gt.value=""})}}),o.jsx(zt,{className:"environment-upload__action",type:"button",color:"secondary",variant:"soft",size:"sm",pill:!1,disabled:Ne,onClick:()=>{var ct;return(ct=O.current)==null?void 0:ct.click()},children:a("environmentCenter.upload")}),o.jsx(zt,{className:"environment-upload__action",type:"button",color:"secondary",variant:"ghost",size:"sm",pill:!1,disabled:Ne||!ue,onClick:Te,children:a("environmentCenter.reset")})]})]}),o.jsxs("div",{className:`environment-dockerfile-editor${X?" has-fixed-base":""}${lt?" is-invalid":""}`,children:[X?o.jsxs("div",{className:"environment-dockerfile-from","aria-label":a("environmentCenter.dockerfileBaseImage"),children:[o.jsx("span",{className:"environment-dockerfile-from__line","aria-hidden":"true",children:"1"}),o.jsxs("code",{children:[o.jsx("span",{className:"environment-dockerfile-from__keyword",children:"FROM"}),o.jsx("span",{title:ae,children:ae})]})]}):null,o.jsx("div",{className:"environment-dockerfile__editor environment-upload__editor","aria-label":a("environmentCenter.dockerfileContent"),children:o.jsx(zE,{value:ue,path:"Dockerfile",lineNumberStart:X?2:1,height:"auto",minHeight:"28px",maxHeight:"var(--environment-dockerfile-editor-max-height)",onChange:at})})]})]}),lt?o.jsx("p",{className:"environment-upload__error environment-upload__error--below",role:"alert",children:lt}):null]}):p==="git"?o.jsxs("div",{className:"environment-source-workflow",children:[o.jsx(n4t,{repositoryUrl:S,gitRef:C,dockerfilePath:_,inspection:A,inspectedKey:T,disabled:Ne,onRepositoryUrlChange:E,onGitRefChange:N,onDockerfilePathChange:j,onInspectionChange:F,onInspectedKeyChange:P}),o.jsx(i4t,{cloudProvider:t,mode:R,region:M,value:I,disabled:Ne,onModeChange:ct=>{L(ct),ze("")},onRegionChange:ct=>{U(ct),H(void 0),ze("")},onChange:H})]}):o.jsx(r4t,{cloudProvider:t,region:K,repository:q,reference:ee,disabled:Ne,onRegionChange:ct=>{Q(ct),B(void 0),ze("")},onRepositoryChange:B,onReferenceChange:le})]})})})}function Fje({cloudProvider:e="volcengine",onWorkspace:t,clipboardImport:n=null,clipboardReadError:i=""}){const{t:r,i18n:s}=Ae("ui"),[a,l]=m.useState([]),[c,u]=m.useState({kind:"list"}),[d,f]=m.useState(""),[h,p]=m.useState(null),[g,b]=m.useState(null),[v,y]=m.useState(null),[x,O]=m.useState(null),[w,k]=m.useState(null),S=m.useRef(0),[E,C]=m.useState(""),[N,_]=m.useState(!1),[j,A]=m.useState(i),[F,T]=m.useState(!0),[P,R]=m.useState(""),[L,M]=m.useState(0),[U,I]=m.useState(()=>new Set),H=m.useDeferredValue(d),K=m.useMemo(()=>{const W=H.trim().toLocaleLowerCase();return W?a.filter(X=>`${X.name} ${X.description} ${w6(X.operatingSystem)} ${oh(X.language)} ${O6(X.baseEnvironment)}`.toLocaleLowerCase().includes(W)):a},[H,a]),Q=m.useCallback((W="",X=!1)=>{S.current+=1,k({key:S.current,initialValue:W,autoInspect:X})},[]),q=m.useCallback((W,X=!1)=>{const ae=W.trim();if(!ae.startsWith("akenv://")||!X&&$te.has(ae))return!1;const ue=YF(ae);return!ue.length||ue.length>O8?!1:($te.add(ae),A(""),Q(ae,!0),!0)},[Q]),B=m.useCallback(async()=>{var W;if(!(c.kind!=="list"||w)){if(typeof navigator>"u"||!((W=navigator.clipboard)!=null&&W.readText)){A(r("environmentCenter.clipboardUnsupported"));return}try{const X=await navigator.clipboard.readText();!q(X)&&!X.trim()&&await Q3t()&&A(r("environmentCenter.clipboardReadError"))}catch{A(r("environmentCenter.clipboardReadError"))}}},[w,q,r,c.kind]);m.useEffect(()=>{const W=new AbortController;return a.length===0&&T(!0),R(""),Vk(W.signal).then(X=>{l(X)}).catch(X=>{(X==null?void 0:X.name)!=="AbortError"&&R(X instanceof Error?X.message:String(X))}).finally(()=>{W.signal.aborted||T(!1)}),()=>W.abort()},[L]),m.useEffect(()=>{if(!a.some(X=>X.latestVersion&&Hg.has(X.latestVersion.status)))return;const W=window.setTimeout(()=>M(X=>X+1),2500);return()=>window.clearTimeout(W)},[a]),m.useEffect(()=>{if(!E||N)return;const W=window.setTimeout(()=>C(""),2800);return()=>window.clearTimeout(W)},[N,E]),m.useEffect(()=>{i&&A(i)},[i]),m.useEffect(()=>{n&&q(n.text)},[n,q]),m.useEffect(()=>{if(c.kind!=="list")return;const W=()=>void B(),X=()=>{document.visibilityState==="visible"&&B()},ae=ue=>{var lt;const Oe=ue.target;if(Oe instanceof HTMLInputElement||Oe instanceof HTMLTextAreaElement||Oe instanceof HTMLElement&&Oe.isContentEditable)return;const Se=((lt=ue.clipboardData)==null?void 0:lt.getData("text/plain"))??"";q(Se,!0)&&ue.preventDefault()};return window.addEventListener("focus",W),document.addEventListener("visibilitychange",X),window.addEventListener("paste",ae),()=>{window.removeEventListener("focus",W),document.removeEventListener("visibilitychange",X),window.removeEventListener("paste",ae)}},[q,B,c.kind]);const ee=c.kind==="editor"&&c.environmentId?a.find(W=>W.id===c.environmentId):void 0,le=async W=>{const X={...W,dockerfile:W.dockerfile??AB(W,e)},ae=ee?await C0e(ee.id,X):await E0e(X);if(l(ue=>[ae,...ue.filter(Oe=>Oe.id!==ae.id)]),u({kind:"list"}),_(!1),X.imageSource){C(r("environmentCenter.status.boundImage",{name:ae.name}));return}try{const ue=await O4(ae.id);l(Oe=>Oe.map(Se=>Se.id===ae.id?{...Se,latestVersion:ue}:Se)),C(r("environmentCenter.status.queued",{name:ae.name}))}catch(ue){_(!0),C(r("environmentCenter.status.savedBuildFailed",{error:ue instanceof Error?ue.message:String(ue)}))}},se=async W=>{if(!U.has(W.id)){I(X=>new Set(X).add(W.id)),_(!1);try{const X=await O4(W.id);l(ae=>ae.map(ue=>ue.id===W.id?{...ue,latestVersion:X}:ue)),C(r("environmentCenter.status.queued",{name:W.name}))}catch(X){_(!0),C(X instanceof Error?X.message:String(X))}finally{I(X=>{const ae=new Set(X);return ae.delete(W.id),ae})}}},re=(W,X,ae,ue)=>{W.length&&l(Oe=>{const Se=new Set(W.map(lt=>lt.id));return[...W,...Oe.filter(lt=>!Se.has(lt.id))]}),_(ue>0),C(ue>0?r("environmentCenter.status.importedFailed",{created:X,failed:ue}):ae>0?r("environmentCenter.status.importedDuplicate",{created:X,duplicate:ae}):r("environmentCenter.status.imported",{count:X}))},ge=h?o.jsx(pc,{title:r("environmentCenter.deleteTitle"),description:r("environmentCenter.deleteDescription",{name:h.name}),confirmLabel:r("common.delete"),variant:"danger",onCancel:()=>p(null),onConfirm:()=>{const W=h;p(null),u({kind:"list"}),T0e(W.id).then(()=>{l(X=>X.filter(ae=>ae.id!==W.id)),_(!1),C(r("environmentCenter.status.deleted",{name:W.name}))}).catch(X=>{_(!0),C(X instanceof Error?X.message:String(X))})}}):null;return c.kind==="editor"?o.jsxs(o.Fragment,{children:[o.jsx(o4t,{environment:ee,cloudProvider:e,onCancel:()=>u({kind:"list"}),onDelete:ee?()=>p(ee):void 0,onShare:ee?()=>O(ee):void 0,onSave:le},c.environmentId??"new"),x?o.jsx(s4t,{environment:x,onClose:()=>O(null)}):null,ge]}):o.jsxs(Th,{className:"environment-center","aria-label":r("environmentCenter.title"),children:[o.jsx(zx,{title:r("environmentCenter.title")}),o.jsxs(Zb,{className:"environment-toolbar",children:[t?o.jsx(dE,{items:[{id:"workspaces",label:r("workspace.title")},{id:"environments",label:r("environmentCenter.title")}],value:"environments",onChange:W=>{W==="workspaces"&&t()},ariaLabel:r("workspace.resourceType"),idPrefix:"environment-center"}):null,o.jsxs("div",{className:"resource-toolbar__actions",children:[E?o.jsx("span",{className:`environment-status${N?" is-error":""}`,role:N?"alert":"status","aria-live":"polite",children:E}):null,o.jsx(wm,{"aria-label":r("environmentCenter.search"),value:d,onChange:W=>f(W.target.value),placeholder:r("environmentCenter.search")})]})]}),j?o.jsxs("div",{className:"environment-clipboard-notice",role:"alert",children:[o.jsx("span",{children:j}),o.jsx(zt,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>{A(""),Q()},children:r("environmentCenter.manualImport")})]}):null,o.jsx(Jb,{"aria-live":"polite",children:F?o.jsx(Ud,{}):P?o.jsxs("div",{className:"environment-load-error",role:"alert",children:[o.jsx("p",{children:jd(P,s.resolvedLanguage||s.language)||r("environmentCenter.loadFailed")}),o.jsx(zt,{color:"secondary",variant:"soft",size:"sm",onClick:()=>M(W=>W+1),children:r("common.reload")})]}):K.length===0&&d.trim()?o.jsx("div",{className:"environment-empty",children:o.jsxs(En,{fill:"none",children:[o.jsx(En.Icon,{children:o.jsx(W3t,{})}),o.jsx(En.Title,{children:r("environmentCenter.noMatches")}),o.jsx(En.Description,{children:r("environmentCenter.tryAnotherName")})]})}):o.jsxs(Vx,{children:[d.trim()?null:o.jsxs(o.Fragment,{children:[o.jsx(Cb,{"aria-label":r("environmentCenter.create"),icon:o.jsx(V3t,{}),onClick:()=>u({kind:"editor",environmentId:null}),children:r("environmentCenter.create")}),o.jsx(Cb,{"aria-label":r("environmentCenter.import.title"),icon:o.jsx(H3t,{}),onClick:()=>Q(),children:r("environmentCenter.import.title")})]}),K.map(W=>{var Oe,Se;const X=Mje(W,r),ae=!!(W.latestVersion&&Hg.has(W.latestVersion.status)),ue=U.has(W.id);return o.jsx(pE,{className:"environment-card",title:W.name,status:o.jsx(ba,{color:X.color,size:"sm",children:X.label}),description:((Oe=W.latestVersion)==null?void 0:Oe.error)||(ae?(Se=W.latestVersion)==null?void 0:Se.currentStep:"")||W.description||r("common.noDescription"),metadata:[{label:r("workspace.updated"),value:Y3t(W.updatedAt,s.resolvedLanguage??s.language),title:Z3t(W.updatedAt,s.resolvedLanguage??s.language)}],action:{label:W.latestVersion?r("environmentCenter.buildDetails.title"):r(ue?"environmentCenter.buildDetails.starting":"environmentCenter.startBuild"),icon:"play",title:r("environmentCenter.build"),disabled:ue,onClick:()=>W.latestVersion?b(W.id):void se(W)},auxiliaryAction:{label:r("environmentCenter.manifest.view"),icon:o.jsx(QFe,{}),title:W.latestVersion?r("environmentCenter.manifest.viewShort"):r("environmentCenter.manifest.unavailable"),disabled:!W.latestVersion,onClick:()=>y(W)},detailAction:{label:r("environmentCenter.configure"),onClick:()=>u({kind:"editor",environmentId:W.id})}},W.id)})]})}),g?(()=>{const W=a.find(X=>X.id===g);return W?o.jsx(t4t,{environment:W,onClose:()=>b(null),onBuildUpdate:X=>{l(ae=>ae.map(ue=>ue.id===W.id?{...ue,latestVersion:X}:ue))},onRebuild:()=>se(W)}):null})():null,v!=null&&v.latestVersion?o.jsx(e4t,{environment:v,onClose:()=>y(null)}):null,ge,w?o.jsx(a4t,{initialValue:w.initialValue,autoInspect:w.autoInspect,onClose:()=>k(null),onImported:re},w.key):null]})}function l4t(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function c4t(e){return o.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"4.5",y:"7",width:"23",height:"18",rx:"3"}),o.jsx("path",{d:"M10 7V5.5A1.5 1.5 0 0 1 11.5 4h4A1.5 1.5 0 0 1 17 5.5V7M9 13h5v5H9zM18 13h5M18 17h5M9 22h14"})]})}function k8(e,t){const n=Date.parse(e);return Number.isNaN(n)?e:new Intl.DateTimeFormat(t,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(n)}function u4t(e,t){return e.environmentIds.reduce((n,i)=>{var r,s;return((s=(r=t.get(i))==null?void 0:r.latestVersion)==null?void 0:s.status)==="available"?n+1:n},0)}function d4t({workspace:e,environments:t,onBack:n,onSave:i,onDelete:r}){const{t:s,i18n:a}=Ae("ui"),[l,c]=m.useState((e==null?void 0:e.name)??""),[u,d]=m.useState((e==null?void 0:e.description)??""),[f,h]=m.useState((e==null?void 0:e.environmentIds)??[]),[p,g]=m.useState(""),[b,v]=m.useState(!1),[y,x]=m.useState(""),O=p.trim().toLocaleLowerCase(),w=t.filter(S=>`${S.name} ${S.description} ${oh(S.language)}`.toLocaleLowerCase().includes(O)),k=async S=>{if(S.preventDefault(),!(!l.trim()||b)){v(!0),x("");try{await i({name:l.trim(),description:u.trim(),environmentIds:f})}catch(E){x(E instanceof Error?E.message:String(E)),v(!1)}}};return o.jsx(Th,{className:"workspace-center","aria-label":s(e?"workspace.detail":"workspace.create"),children:o.jsxs(uE,{title:e?e.name:s("workspace.create"),description:s("workspace.editorDescription"),identitySeed:(e==null?void 0:e.name)||s("workspace.create"),backLabel:s("workspace.backToList"),onBack:n,actions:o.jsxs(o.Fragment,{children:[r?o.jsx("button",{type:"button",className:"is-danger",onClick:r,children:s("common.delete")}):null,o.jsx("button",{type:"submit",form:"workspace-form",disabled:b||!l.trim(),children:s(b?"common.saving":"common.save")})]}),children:[e?o.jsxs(NB,{children:[o.jsxs("div",{children:[o.jsx("dt",{children:s("common.environment")}),o.jsx("dd",{children:s("workspace.environmentCount",{count:f.length})})]}),o.jsxs("div",{children:[o.jsx("dt",{children:s("workspace.createdAt")}),o.jsx("dd",{children:k8(e.createdAt,a.resolvedLanguage??a.language)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:s("workspace.updatedAt")}),o.jsx("dd",{children:k8(e.updatedAt,a.resolvedLanguage??a.language)})]})]}):null,o.jsxs("form",{id:"workspace-form",className:"workspace-form",onSubmit:k,children:[o.jsxs("section",{className:"workspace-fields","aria-label":s("workspace.basicInfo"),children:[o.jsxs("label",{children:[o.jsx("span",{children:s("common.name")}),o.jsx(qr,{value:l,maxLength:128,autoFocus:!0,onChange:S=>c(S.target.value),placeholder:s("workspace.namePlaceholder")})]}),o.jsxs("label",{children:[o.jsx("span",{children:s("common.description")}),o.jsx(Rm,{value:u,maxLength:2e3,onChange:S=>d(S.target.value),placeholder:s("workspace.descriptionPlaceholder")})]})]}),o.jsxs("section",{className:"workspace-environments",children:[o.jsx(FOe,{title:s("common.environment"),description:s("workspace.selectedEnvironmentCount",{count:f.length}),actions:o.jsx(wm,{"aria-label":s("workspace.searchAvailableEnvironments"),value:p,onChange:S=>g(S.target.value),placeholder:s("workspace.searchEnvironments")})}),t.length===0?o.jsxs("div",{className:"workspace-environment-empty",children:[o.jsx("p",{children:s("workspace.noAvailableEnvironments")}),o.jsx("span",{children:s("workspace.createEnvironmentFirst")})]}):w.length===0?o.jsxs("div",{className:"workspace-environment-empty",children:[o.jsx("p",{children:s("workspace.noMatchingEnvironments")}),o.jsx("span",{children:s("workspace.tryAnotherName")})]}):o.jsx("div",{className:"workspace-environment-list",children:w.map(S=>{var N;const E=f.includes(S.id),C=((N=S.latestVersion)==null?void 0:N.status)==="available"?s("workspace.environmentStatus.available"):S.latestVersion?s("workspace.environmentStatus.building"):s("workspace.environmentStatus.notBuilt");return o.jsxs("label",{className:`workspace-environment-option${E?" is-selected":""}`,children:[o.jsx("input",{type:"checkbox",checked:E,onChange:()=>h(_=>E?_.filter(j=>j!==S.id):[..._,S.id])}),o.jsxs("span",{className:"workspace-environment-option__copy",children:[o.jsx("strong",{title:S.name,children:S.name}),o.jsxs("span",{children:[oh(S.language)," · ",C]})]}),o.jsx("span",{className:"workspace-environment-option__action",children:s(E?"workspace.added":"common.add")})]},S.id)})})]}),y?o.jsx("p",{className:"workspace-form-error",role:"alert",children:y}):null]})]})})}function f4t({onEnvironment:e}){const{t,i18n:n}=Ae("ui"),[i,r]=m.useState([]),[s,a]=m.useState([]),[l,c]=m.useState({kind:"list"}),[u,d]=m.useState(""),[f,h]=m.useState(!0),[p,g]=m.useState(""),[b,v]=m.useState(""),[y,x]=m.useState(!1),[O,w]=m.useState(null),[k,S]=m.useState(0),E=m.useDeferredValue(u);m.useEffect(()=>{const j=new AbortController;return h(!0),g(""),Promise.all([e7(j.signal),Vk(j.signal)]).then(([A,F])=>{r(A),a(F)}).catch(A=>{(A==null?void 0:A.name)!=="AbortError"&&(console.warn("Unable to load Studio workspaces",A),g(t("workspace.loadFailed")))}).finally(()=>{j.signal.aborted||h(!1)}),()=>j.abort()},[k,t]),m.useEffect(()=>{if(!b||y)return;const j=window.setTimeout(()=>v(""),2800);return()=>window.clearTimeout(j)},[y,b]);const C=m.useMemo(()=>new Map(s.map(j=>[j.id,j])),[s]),N=m.useMemo(()=>{const j=E.trim().toLocaleLowerCase();return j?i.filter(A=>{const F=A.environmentIds.map(T=>{var P;return((P=C.get(T))==null?void 0:P.name)??""}).join(" ");return`${A.name} ${A.description} ${F}`.toLocaleLowerCase().includes(j)}):i},[E,C,i]),_=l.kind==="detail"&&l.workspaceId?i.find(j=>j.id===l.workspaceId):void 0;return l.kind==="detail"?o.jsx(d4t,{workspace:_,environments:s,onBack:()=>c({kind:"list"}),onDelete:_?()=>w(_):null,onSave:async j=>{const A=_?await y0e(_.id,j):await b0e(j);r(F=>[A,...F.filter(T=>T.id!==A.id)]),x(!1),v(t("workspace.saved",{name:A.name})),c({kind:"list"})}},l.workspaceId??"new"):o.jsxs(Th,{className:"workspace-center","aria-label":t("workspace.title"),children:[o.jsx(zx,{title:t("workspace.title")}),o.jsxs(Zb,{children:[o.jsx(dE,{items:[{id:"workspaces",label:t("workspace.title")},{id:"environments",label:t("common.environment")}],value:"workspaces",onChange:j=>{j==="environments"&&e()},ariaLabel:t("workspace.resourceType"),idPrefix:"workspace-center"}),o.jsxs("div",{className:"resource-toolbar__actions",children:[b?o.jsx("span",{className:`workspace-status${y?" is-error":""}`,role:y?"alert":"status","aria-live":"polite",children:b}):null,o.jsx(wm,{"aria-label":t("workspace.searchWorkspaces"),value:u,onChange:j=>d(j.target.value),placeholder:t("workspace.searchWorkspaces")})]})]}),o.jsx(Jb,{"aria-live":"polite",children:f?o.jsx(Ud,{}):p?o.jsxs("div",{className:"workspace-load-error",role:"alert",children:[o.jsx("p",{children:p}),o.jsx(zt,{color:"secondary",variant:"soft",size:"sm",onClick:()=>S(j=>j+1),children:t("common.reload")})]}):N.length===0&&u.trim()?o.jsx("div",{className:"workspace-empty",children:o.jsxs(En,{fill:"none",children:[o.jsx(En.Icon,{children:o.jsx(c4t,{})}),o.jsx(En.Title,{children:t("workspace.noMatchingWorkspaces")}),o.jsx(En.Description,{children:t("workspace.tryAnotherNameOrEnvironment")})]})}):o.jsxs(Vx,{children:[u.trim()?null:o.jsx(Cb,{"aria-label":t("workspace.create"),icon:o.jsx(l4t,{}),onClick:()=>c({kind:"detail",workspaceId:null}),children:t("workspace.create")}),N.map(j=>{const A=u4t(j,C),F=j.environmentIds.filter(T=>!C.has(T)).length;return o.jsx(pE,{className:"workspace-card",title:j.name,status:o.jsx(ba,{color:F?"danger":A===j.environmentIds.length&&A>0?"success":"secondary",size:"sm",children:j.environmentIds.length===0?t("workspace.noEnvironmentAdded"):F?t("workspace.environmentMissing"):t("workspace.availableFraction",{available:A,total:j.environmentIds.length})}),description:j.description||t("common.noDescription"),metadata:[{label:t("common.environment"),value:t("workspace.environmentCount",{count:j.environmentIds.length})},{label:t("workspace.available"),value:t("workspace.availableCount",{count:A})},{label:t("workspace.updated"),value:k8(j.updatedAt,n.resolvedLanguage??n.language)}],detailAction:{label:t("common.manage"),onClick:()=>c({kind:"detail",workspaceId:j.id})},action:{label:t("workspace.addEnvironment"),icon:"plus",onClick:()=>c({kind:"detail",workspaceId:j.id})}},j.id)})]})}),O?o.jsx(pc,{title:t("workspace.deleteTitle"),description:t("workspace.deleteDescription",{name:O.name}),confirmLabel:t("common.delete"),variant:"danger",onCancel:()=>w(null),onConfirm:()=>{const j=O;w(null),v0e(j.id).then(()=>{r(A=>A.filter(F=>F.id!==j.id)),x(!1),v(t("workspace.deleted",{name:j.name})),c({kind:"list"})}).catch(A=>{x(!0),v(A instanceof Error?A.message:String(A))})}}):null]})}function h4t({cloudProvider:e}){const{t}=Ae("ui"),[n,i]=m.useState("workspaces"),[r,s]=m.useState(null),[a,l]=m.useState(""),c=m.useRef(0),u=()=>{var h;c.current+=1;const d=c.current;l("");let f=null;if(typeof navigator<"u"&&((h=navigator.clipboard)!=null&&h.readText))try{f=navigator.clipboard.readText()}catch{l(t("workspace.clipboardPermissionError"))}else l(t("workspace.clipboardUnsupported"));i("environments"),f&&f.then(async p=>{var g;if(c.current===d){if(p.trim()){s({key:d,text:p});return}try{const b=await((g=navigator.permissions)==null?void 0:g.query({name:"clipboard-read"}));c.current===d&&(b==null?void 0:b.state)==="denied"&&l(t("workspace.clipboardPermissionError"))}catch{}}}).catch(()=>{c.current===d&&l(t("workspace.clipboardPermissionError"))})};return n==="environments"?o.jsx(Fje,{cloudProvider:e,onWorkspace:()=>i("workspaces"),clipboardImport:r,clipboardReadError:a}):o.jsx(f4t,{onEnvironment:u})}function p4t(e){return e==="127.0.0.1"}const m4t={id:"coding-agents",kind:"coding-agent",category:"development",icon:"coding-agents",name:"Configure coding agents",badge:"Local",badgeTone:"success",description:"Install built-in VeADK and AgentKit skills globally for Trae, Claude Code, or Codex."},g4t={id:"feishu",kind:"feishu",category:"channels",icon:"feishu",name:"Feishu bot",badge:"Beta",description:"Create a Feishu bot and connect its messages directly to AgentKit Runtime."};sn.hasResourceBundle("en-US","automations")||sn.addResourceBundle("en-US","automations",Ure,!0,!0);sn.hasResourceBundle("zh-CN","automations")||sn.addResourceBundle("zh-CN","automations",rce,!0,!0);function Vd(e,t={}){return sn.t(e,{...t,ns:"automations"})}const Bje={name:"repository",label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL",required:!0},Uje={name:"baseBranch",label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base",required:!1},Qje={name:"runtimeName",label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration",required:!0},zje={name:"runtimeId",label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates",required:!0},b4t="https://ark.cn-beijing.volces.com/api/coding/v3";function y4t(e){return e==="byteplus"?xl(e):b4t}function JQ(e){return e==="byteplus"?{accessKey:"BYTEPLUS_ACCESS_KEY",secretKey:"BYTEPLUS_SECRET_KEY",sessionToken:"BYTEPLUS_SESSION_TOKEN"}:{accessKey:"VOLCENGINE_ACCESS_KEY",secretKey:"VOLCENGINE_SECRET_KEY",sessionToken:"VOLCENGINE_SESSION_TOKEN"}}function Vje(e){const t=JQ(e);return[Vd("github.secretPair",{accessKey:t.accessKey,secretKey:t.secretKey}),Vd("github.sessionToken",{sessionToken:t.sessionToken})]}function ez(e){return e==="byteplus"?"BytePlus":"Volcengine"}function tz(e,t={}){return{repository:"",baseBranch:"main",projectPath:".",runtimeName:"",runtimeId:"",modelName:"",modelBaseUrl:y4t(e),region:Ji(e),token:"",...t}}function Hje(e){return{repository:e.repository.trim(),baseBranch:e.baseBranch.trim()||"main",region:e.region,token:e.token.trim()}}const v4t={id:"review",kind:"github",category:"development",icon:"github",name:"Automated PR review",description:"Use a GitHub App to review pull requests in an isolated Sandbox.",title:"Automated PR review",subtitle:"Trigger Sandbox reviews through the GitHub App and publish results to pull requests",panel:"Install the GitHub App to target repositories, then enable automated review for each repository.",submitLabel:"Install GitHub App",fields:[],initialValues:({cloudProvider:e})=>tz(e),regionHelp:"",secrets:()=>[],async submit(){throw new Error("PR 自动评审已切换为 GitHub App 授权模式。")}},x4t="https://api.github.com",w4t=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,Ute=/^[A-Za-z0-9][A-Za-z0-9._/-]{0,199}$/,O4t=/^[A-Za-z0-9._/-]+$/;function S4t(e,t,n){const i=String((t==null?void 0:t.message)||"");return e===403&&/workflow/i.test(i)?"GitHub Token 缺少 Workflows 写权限,无法创建或更新 .github/workflows 下的文件":e===401||e===403?V("github.invalidToken"):e===404?V("github.notFound"):e===422?V("github.rejectedCommit"):i.split(n).join("***").trim().slice(0,240)||V("github.requestFailed",{status:e})}async function ug(e,t){const n={Accept:"application/vnd.github+json",Authorization:`Bearer ${t.token}`,"X-GitHub-Api-Version":"2022-11-28"};t.body&&(n["Content-Type"]="application/json");let i;try{i=await fetch(`${x4t}${e}`,{method:t.method||"GET",headers:n,body:t.body?JSON.stringify(t.body):void 0,signal:t.signal})}catch(s){throw t.signal.aborted?s:new Error(V("github.networkFailed"))}const r=await i.json().catch(()=>null);if(!t.expected.includes(i.status))throw new Error(S4t(i.status,r,t.token));return{status:i.status,payload:r}}function uL(e){return e.split("/").map(encodeURIComponent).join("/")}function k4t(e){const t=new TextEncoder().encode(e);let n="";const i=32768;for(let r=0;r({...h,path:iz(h.path,"")})),s=AbortSignal.any([t,AbortSignal.timeout(6e4)]),a=`/repos/${n}`;await ug(`${a}`,{token:e.token,expected:[200],signal:s});const c=(f=(await ug(`${a}/git/ref/heads/${uL(i)}`,{token:e.token,expected:[200],signal:s})).payload.object)==null?void 0:f.sha;if(!c)throw new Error(V("github.missingBaseSha"));const u=E4t(e.branchPrefix);await ug(`${a}/git/refs`,{token:e.token,expected:[201],signal:s,method:"POST",body:{ref:`refs/heads/${u}`,sha:c}});let d=!0;try{for(const p of r){const g=uL(p.path),b=await ug(`${a}/contents/${g}?ref=${encodeURIComponent(i)}`,{token:e.token,expected:[200,404],signal:s});if(p.mustBeNew&&b.status===200)throw new Error(V("github.fileAlreadyExists",{path:p.path}));if(b.status===200&&!b.payload.sha)throw new Error(V("github.pathNotUpdatable",{path:p.path}));await ug(`${a}/contents/${g}`,{token:e.token,expected:[200,201],signal:s,method:"PUT",body:{message:p.commitMessage,content:k4t(p.content),branch:u,...b.payload.sha?{sha:b.payload.sha}:{}}})}const h=await ug(`${a}/pulls`,{token:e.token,expected:[201],signal:s,method:"POST",body:{title:e.title,head:u,base:i,body:e.description}});if(!h.payload.number||!h.payload.html_url)throw new Error(V("github.invalidPullRequest"));return d=!1,{number:h.payload.number,url:h.payload.html_url,branch:u}}finally{d&&await ug(`${a}/git/refs/heads/${uL(u)}`,{token:e.token,expected:[204],signal:AbortSignal.timeout(15e3),method:"DELETE"}).catch(()=>{})}}async function C4t(e,t){const n=await Tn("/web/github/pull-request-reviews",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await HE(n);const i=await n.json();if(i.status!=="started"||typeof i.sessionId!="string"||!i.sessionId||typeof i.displayName!="string")throw new Error("PR 评审服务返回了无效结果。");return i}async function T4t(e){const t=await Tn("/web/github/app/config",{method:"GET",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await HE(t);const n=await t.json();if(typeof n.configured!="boolean"||typeof n.appSlug!="string"||typeof n.installUrl!="string"||typeof n.reason!="string")throw new Error("GitHub App 配置响应格式无效。");return n}async function A4t(e,t){var s;const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)});(s=t.query)!=null&&s.trim()&&n.set("q",t.query.trim());const i=await Tn(`/web/github/app/repositories?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await HE(i);const r=await i.json();if(!Array.isArray(r.repositories)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.repositories.some(a=>typeof a!="object"||a===null||typeof a.installationId!="number"||typeof a.account!="string"||typeof a.fullName!="string"||typeof a.htmlUrl!="string"||typeof a.private!="boolean"||typeof a.reviewEnabled!="boolean"))throw new Error("GitHub App 仓库列表响应格式无效。");return r}async function _4t(e,t){const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)}),i=await Tn(`/web/github/app/review-records?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await HE(i);const r=await i.json();if(!Array.isArray(r.records)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.records.some(s=>typeof s!="object"||s===null||typeof s.id!="string"||typeof s.repository!="string"||typeof s.pullRequestUrl!="string"||typeof s.pullRequestNumber!="number"||!["started","completed","ignored","failed"].includes(String(s.status))||!["manual","webhook"].includes(String(s.trigger))||typeof s.createdAt!="string"||typeof s.deliveryId!="string"||typeof s.action!="string"||typeof s.sessionId!="string"||typeof s.displayName!="string"||typeof s.reason!="string"))throw new Error("PR 评审记录响应格式无效。");return r}async function N4t(e,t){const n=await Tn("/web/github/app/review-repositories",{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await HE(n);const i=await n.json();if(!Array.isArray(i.repositories)||i.repositories.some(r=>typeof r!="string"))throw new Error("GitHub App 评审仓库保存响应格式无效。");return i.repositories}async function HE(e){const t=await e.text().catch(()=>"");try{const n=JSON.parse(t),i=typeof n.detail=="object"&&n.detail?n.detail.message:n.detail??n.message??n.error,r=typeof i=="string"?i:"";return new Error(r||`PR 评审发起失败(HTTP ${e.status})`)}catch{return new Error(t||`PR 评审发起失败(HTTP ${e.status})`)}}const j4t=/^[A-Za-z0-9_-]+$/,Wje=4,cj=64,uj=6,zte="agent-runtime";function Gje(e){const t=e.trim();if(!t)return zte;let n=t.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,cj);return n?(n.lengthLt(`validation.runtimeName.${n}`)){return e?j4t.test(e)?e.lengthcj?t("length"):null:t("characters"):t("required")}const P4t=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/,D4t="cn-hongkong";function M4t(e){const t=qE(e.runtimeName,n=>Vd(`github.validation.runtimeName.${n}`));if(t)throw new Error(t);if(!P4t.test(e.runtimeId))throw new Error(Vd("github.validation.runtimeId"))}function Xje(e){M4t(e);const t=e.cloudProvider??"volcengine",n=JQ(t),i=t==="byteplus"?` +${i}`:n}function _3t(e,t,n){return t.trim()?/^\s*FROM(?:\s|$)/im.test(e)?vv("duplicateFrom",n):ZQ(QA(t,e),void 0,n):vv("baseImageRequired",n)}function ZQ(e,t=Nje(e),n){return t>_je?vv("tooLarge",n):e.trim()?/^\s*FROM\s+\S+/im.test(e)?"":vv("missingFrom",n):vv("empty",n)}async function N3t(e,t){if(e.size>_je)return{content:"",error:vv("tooLarge",t)};const n=QI(await e.text());return{content:n,error:ZQ(n,e.size,t)}}function j3t(e){return $U(e,{lineWidth:0})}function R3t(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m7 9.5 5 5 5-5"})})}function I3t(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m6.5 12.5 3.5 3.5 7.5-8"})})}function VE({ariaLabel:e,value:t,valueLabel:n,placeholder:i,options:r,disabled:s=!1,searchValue:a,searchPlaceholder:l,loading:c=!1,hasMore:u=!1,emptyMessage:d,onSearchChange:f,onLoadMore:h,onChange:p}){const{t:g}=Ce("ui"),b=l??g("deploymentSelect.searchPlaceholder"),v=d??g("deploymentSelect.emptyMessage"),y=m.useId(),x=m.useRef(null),O=m.useRef(null),w=m.useRef(null),k=m.useRef(null),S=m.useRef([]),[E,C]=m.useState(!1),[N,_]=m.useState(0),j=r.find(M=>M.value===t),A=(j==null?void 0:j.label)??(t?n:void 0),F=a!==void 0&&!!f,T=()=>{C(!1),F&&a&&(f==null||f(""))};m.useEffect(()=>{if(!E)return;const M=U=>{U.target instanceof Node&&x.current&&!x.current.contains(U.target)&&T()};return window.addEventListener("pointerdown",M),()=>window.removeEventListener("pointerdown",M)},[E,f,a,F]),m.useEffect(()=>{var M,U;if(E){if(F){(M=w.current)==null||M.focus();return}(U=S.current[N])==null||U.focus()}},[E,F]),m.useEffect(()=>{var M;!E||F&&document.activeElement===w.current||(M=S.current[N])==null||M.focus()},[N,E,F]),m.useEffect(()=>{_(M=>Math.min(M,Math.max(0,r.length-1)))},[r.length]),m.useEffect(()=>{if(!E||!u||c||!h)return;const M=window.requestAnimationFrame(()=>{const U=k.current;U&&U.scrollHeight<=U.clientHeight+1&&h()});return()=>window.cancelAnimationFrame(M)},[u,c,h,E,r.length]);const P=(M=1)=>{const U=r.findIndex(H=>H.value===t),I=U>=0?U:M===1?0:Math.max(0,r.length-1);_(I),C(!0)},R=M=>{r.length!==0&&_((M+r.length)%r.length)},L=M=>{var U;p(M.value),T(),(U=O.current)==null||U.focus()};return o.jsxs("div",{className:"pp-deployment-select",ref:x,onKeyDown:M=>{var I,H;const U=M.target===w.current;if(M.key==="Escape"&&E){M.preventDefault(),T(),(I=O.current)==null||I.focus();return}if(M.key==="Tab"){T();return}if(U){M.key==="ArrowDown"&&r.length>0&&(M.preventDefault(),_(0),(H=S.current[0])==null||H.focus());return}M.key==="ArrowDown"?(M.preventDefault(),E?R(N+1):P(1)):M.key==="ArrowUp"?(M.preventDefault(),E?R(N-1):P(-1)):E&&M.key==="Home"?(M.preventDefault(),_(0)):E&&M.key==="End"&&(M.preventDefault(),_(Math.max(0,r.length-1)))},children:[o.jsxs("button",{ref:O,type:"button",className:"pp-deployment-select-trigger","aria-label":e,"aria-haspopup":"listbox","aria-expanded":E,"aria-controls":E?y:void 0,disabled:s,onClick:()=>{E?T():P()},children:[o.jsx("span",{className:A?void 0:"is-placeholder",children:A??i}),o.jsx(R3t,{className:`pp-deployment-select-chevron${E?" is-open":""}`})]}),E&&o.jsxs("div",{className:"pp-deployment-select-menu",children:[F&&o.jsx("div",{className:"pp-deployment-select-search",children:o.jsx("input",{ref:w,type:"search",value:a,"aria-label":g("deploymentSelect.searchAriaLabel",{label:e}),placeholder:b,autoComplete:"off",onChange:M=>f==null?void 0:f(M.currentTarget.value)})}),o.jsx("div",{id:y,ref:k,className:"pp-deployment-select-options",role:"listbox","aria-label":e,"aria-busy":c||void 0,onScroll:M=>{if(!u||c||!h)return;const U=M.currentTarget;U.scrollHeight-U.scrollTop-U.clientHeight<=24&&h()},children:r.map((M,U)=>{const I=M.value===t;return o.jsxs("button",{ref:H=>{S.current[U]=H},type:"button",role:"option","aria-selected":I,tabIndex:U===N?0:-1,className:`pp-deployment-select-option${I?" is-selected":""}`,title:M.description,onFocus:()=>_(U),onClick:()=>L(M),children:[o.jsxs("span",{className:"pp-deployment-select-copy",children:[o.jsxs("span",{className:"pp-deployment-select-name",children:[M.label,M.badge&&o.jsx("span",{className:"pp-deployment-select-badge",children:M.badge})]}),M.description&&o.jsx("small",{children:M.description})]}),I&&o.jsx(I3t,{})]},M.value)})}),c&&o.jsx("div",{className:"pp-deployment-select-state","aria-live":"polite",children:g("deploymentSelect.loadingMore")}),!c&&r.length===0&&o.jsx("div",{className:"pp-deployment-select-state",children:v})]})]})}function P3t(e){return[{value:"auto",label:e("deploymentResources.mode.auto"),description:e("deploymentResources.mode.autoDescription"),badge:e("deploymentResources.mode.recommended")},{value:"create",label:e("deploymentResources.mode.create"),description:e("deploymentResources.mode.createDescription")},{value:"existing",label:e("deploymentResources.mode.existing"),description:e("deploymentResources.mode.existingDescription")}]}const jje={tos:{mode:"auto"},cr:{mode:"auto"},codePipeline:{mode:"auto"}};function $f(e){const[t,n]=m.useState([]),[i,r]=m.useState(""),[s,a]=m.useState(1),[l,c]=m.useState(0),[u,d]=m.useState(!1),[f,h]=m.useState(!1),[p,g]=m.useState(null),[b,v]=m.useState(""),[y,x]=m.useState(""),[O,w]=m.useState(""),[k,S]=m.useState(0),E=m.useRef(!1),C=m.useRef(null),N=e?JSON.stringify(e):"",_=e?JSON.stringify({...e,search:y}):"";m.useEffect(()=>{const P=window.setTimeout(()=>{x(b.trim())},250);return()=>window.clearTimeout(P)},[b]),m.useEffect(()=>{v(""),x("")},[N]);const j=m.useCallback((P,R)=>{var U;if(!_)return;(U=C.current)==null||U.abort();const L=new AbortController;C.current=L;const M=JSON.parse(_);R&&n([]),E.current=!0,h(!0),g(null),o0e({...M,pageNumber:P,pageSize:100},L.signal).then(I=>{n(H=>{if(R)return I.items;const Z=new Set(H.map(Q=>`${Q.id}\0${Q.name}`));return[...H,...I.items.filter(Q=>!Z.has(`${Q.id}\0${Q.name}`))]}),r(I.serviceRegion),a(I.pageNumber),c(I.totalCount),d(I.hasMore),w(_)}).catch(I=>{I instanceof DOMException&&I.name==="AbortError"||(w(_),g(I instanceof Error?I.message:String(I)))}).finally(()=>{C.current===L&&(C.current=null,E.current=!1,h(!1))})},[_]);m.useEffect(()=>{var P;if(!_){(P=C.current)==null||P.abort(),C.current=null,E.current=!1,n([]),r(""),a(1),c(0),d(!1),w(""),h(!1),g(null);return}return j(1,!0),()=>{var R;return(R=C.current)==null?void 0:R.abort()}},[j,_,k]);const A=!!_&&O===_&&b.trim()===y,F=m.useCallback(()=>{w(""),S(P=>P+1)},[]),T=m.useCallback(()=>{!A||E.current||!u||j(s+1,!1)},[u,j,s,A]);return{items:t,serviceRegion:i,totalCount:l,hasMore:A?u:!1,loading:!!_&&(!A||f),error:p,search:b,setSearch:v,reload:F,loadMore:T}}function D3t(e,t){return e.map(n=>({value:n[t],label:n.name,description:[n.status,n.region,n.id].filter(Boolean).join(" · ")}))}function Ff({ariaLabel:e,value:t,valueLabel:n,state:i,disabled:r,disabledMessage:s,valueField:a="id",onChange:l}){const{t:c}=Ce("ui"),u=m.useMemo(()=>D3t(i.items,a),[i.items,a]);return o.jsxs("div",{className:"pp-resource-picker",children:[o.jsx(VE,{ariaLabel:e,value:t,valueLabel:n,placeholder:i.loading?c("common.loading"):c("deploymentResources.selectExisting"),options:u,disabled:r||!!i.error,searchValue:i.search,searchPlaceholder:c("deploymentResources.searchResource"),loading:i.loading,hasMore:i.hasMore,emptyMessage:i.search.trim()?c("deploymentResources.noMatch"):c("deploymentResources.noAvailable"),onSearchChange:i.setSearch,onLoadMore:i.loadMore,onChange:d=>{const f=i.items.find(h=>h[a]===d);f&&l(f)}}),s?o.jsx("span",{className:"pp-resource-status",children:s}):i.error?o.jsxs("div",{className:"pp-resource-error",role:"alert",children:[o.jsx("span",{children:i.error}),o.jsx("button",{type:"button",onClick:i.reload,children:c("common.retry")})]}):i.loading&&i.items.length===0?o.jsx("span",{className:"pp-resource-status","aria-live":"polite",children:i.search.trim()?c("deploymentResources.searching"):c("deploymentResources.loading")}):i.items.length===0?o.jsx("span",{className:"pp-resource-status",children:i.search.trim()?c("deploymentResources.noMatchSentence"):c("deploymentResources.noAvailableSentence")}):i.serviceRegion?o.jsx("span",{className:"pp-resource-status",children:c("deploymentResources.loadedSummary",{region:i.serviceRegion,loaded:i.items.length,total:i.totalCount>0?`/${i.totalCount}`:""})}):null]})}function Rje({region:e,value:t,disabled:n=!1,onChange:i}){const{t:r}=Ce("ui"),s=$f(e?{kind:"cr-registry",region:e}:null),a=$f(e&&(t!=null&&t.registry)?{kind:"cr-namespace",region:e,registry:t.registry}:null),l=$f(e&&(t!=null&&t.registry)&&t.namespace?{kind:"cr-repository",region:e,registry:t.registry,namespace:t.namespace}:null),c=t??{region:e,registry:"",namespace:"",repository:""};return o.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three environment-repository-fields",children:[o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:r("deploymentResources.registryInstance")}),o.jsx(Ff,{ariaLabel:r("deploymentResources.registryAriaLabel"),value:c.registry,valueLabel:c.registry,state:s,disabled:n||!e,valueField:"name",onChange:u=>i({region:e,registry:u.name,namespace:"",repository:""})})]}),o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:r("deploymentResources.namespace")}),o.jsx(Ff,{ariaLabel:r("deploymentResources.namespaceAriaLabel"),value:c.namespace,valueLabel:c.namespace,state:a,disabled:n||!c.registry,disabledMessage:c.registry?void 0:r("deploymentResources.selectRegistryFirst"),valueField:"name",onChange:u=>i({...c,region:e,namespace:u.name,repository:""})})]}),o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:r("deploymentResources.repository")}),o.jsx(Ff,{ariaLabel:r("deploymentResources.existingRepository"),value:c.repository,valueLabel:c.repository,state:l,disabled:n||!c.registry||!c.namespace,disabledMessage:c.registry?c.namespace?void 0:r("deploymentResources.selectNamespaceFirst"):r("deploymentResources.selectRegistryFirst"),valueField:"name",onChange:u=>i({...c,region:e,repository:u.name})})]})]})}function oL({resource:e,value:t,disabled:n,onChange:i}){const{t:r}=Ce("ui");return o.jsxs("label",{className:"pp-resource-field pp-resource-mode",children:[o.jsx("span",{children:r("deploymentResources.configurationMode")}),o.jsx(VE,{ariaLabel:r("deploymentResources.configurationModeAriaLabel",{resource:e}),value:t,placeholder:r("deploymentResources.selectConfigurationMode"),options:P3t(r),disabled:n,onChange:s=>i(s)})]})}function z0({label:e,value:t,placeholder:n,disabled:i,onChange:r}){return o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:e}),o.jsx("input",{value:t,placeholder:n,disabled:i,autoComplete:"off",onChange:s=>r(s.currentTarget.value)})]})}function lL({items:e,note:t}){const{t:n}=Ce("ui");return o.jsxs("div",{className:"pp-resource-auto-names",children:[o.jsx("span",{children:n("deploymentResources.automaticNames")}),o.jsx("dl",{children:e.map(i=>o.jsxs("div",{children:[o.jsx("dt",{children:i.label}),o.jsx("dd",{title:i.name,children:i.name})]},i.label))}),t&&o.jsx("small",{children:t})]})}function Ije(e){var t,n,i,r,s,a,l,c;return e.tos.mode!=="auto"&&!((t=e.tos.bucket)!=null&&t.trim())?ln.t("ui:deploymentResources.validation.tos"):e.cr.mode!=="auto"&&(!((n=e.cr.instance)!=null&&n.trim())||!((i=e.cr.namespace)!=null&&i.trim())||!((r=e.cr.repository)!=null&&r.trim()))?ln.t("ui:deploymentResources.validation.cr"):e.codePipeline.mode!=="auto"&&(!((s=e.codePipeline.workspaceName)!=null&&s.trim())||!((a=e.codePipeline.pipelineName)!=null&&a.trim()))?ln.t("ui:deploymentResources.validation.codePipeline"):e.codePipeline.mode==="existing"&&(!((l=e.codePipeline.workspaceId)!=null&&l.trim())||!((c=e.codePipeline.pipelineId)!=null&&c.trim()))?ln.t("ui:deploymentResources.validation.existingCodePipeline"):null}function Pje({value:e,agentName:t,runtimeName:n,region:i,disabled:r,validationError:s,onChange:a}){const{t:l}=Ce("ui"),c=t.trim()||"agentkit-app",u=n.trim()||c,d=i&&i!=="cn-beijing"?l("deploymentResources.autoBucketWithRegion",{region:i.startsWith("cn-")?i.slice(3):i}):l("deploymentResources.autoBucket"),f=$f(e.tos.mode==="existing"?{kind:"tos-bucket",region:i}:null),h=$f(e.cr.mode==="existing"?{kind:"cr-registry",region:i}:null),p=$f(e.cr.mode==="existing"&&e.cr.instance?{kind:"cr-namespace",region:i,registry:e.cr.instance}:null),g=$f(e.cr.mode==="existing"&&e.cr.instance&&e.cr.namespace?{kind:"cr-repository",region:i,registry:e.cr.instance,namespace:e.cr.namespace}:null),b=$f(e.codePipeline.mode==="existing"?{kind:"cp-workspace",region:i}:null),v=$f(e.codePipeline.mode==="existing"&&e.codePipeline.workspaceId?{kind:"cp-pipeline",region:i,workspaceId:e.codePipeline.workspaceId}:null),y=x=>a({...e,...x});return o.jsxs("div",{className:"pp-resource-list",children:[o.jsxs("div",{className:"pp-resource-item",children:[o.jsx("div",{className:"pp-resource-name",children:l("deploymentResources.tosBucket")}),o.jsxs("div",{className:"pp-resource-grid",children:[o.jsx(oL,{resource:l("deploymentResources.tosBucket"),value:e.tos.mode,disabled:r,onChange:x=>y({tos:{mode:x}})}),e.tos.mode==="create"&&o.jsx(z0,{label:l("deploymentResources.bucketName"),value:e.tos.bucket??"",placeholder:l("deploymentResources.bucketNamePlaceholder"),disabled:r,onChange:x=>y({tos:{...e.tos,bucket:x}})}),e.tos.mode==="existing"&&o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.existingBucket")}),o.jsx(Ff,{ariaLabel:l("deploymentResources.existingTosBucket"),value:e.tos.bucket??"",valueLabel:e.tos.bucket,state:f,disabled:r,onChange:x=>y({tos:{...e.tos,bucket:x.name}})})]}),e.tos.mode==="auto"&&o.jsx(lL,{items:[{label:l("deploymentResources.bucket"),name:d}],note:l("deploymentResources.accountIdResolved")})]})]}),o.jsxs("div",{className:"pp-resource-item",children:[o.jsx("div",{className:"pp-resource-name",children:l("deploymentResources.containerRegistry")}),o.jsxs("div",{className:"pp-resource-grid",children:[o.jsx(oL,{resource:"CR",value:e.cr.mode,disabled:r,onChange:x=>y({cr:{mode:x}})}),e.cr.mode==="create"&&o.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three",children:[o.jsx(z0,{label:l("deploymentResources.instanceName"),value:e.cr.instance??"",placeholder:l("deploymentResources.crInstance"),disabled:r,onChange:x=>y({cr:{...e.cr,instance:x}})}),o.jsx(z0,{label:l("deploymentResources.namespace"),value:e.cr.namespace??"",placeholder:l("deploymentResources.namespace"),disabled:r,onChange:x=>y({cr:{...e.cr,namespace:x}})}),o.jsx(z0,{label:l("deploymentResources.repository"),value:e.cr.repository??"",placeholder:l("deploymentResources.repository"),disabled:r,onChange:x=>y({cr:{...e.cr,repository:x}})})]}),e.cr.mode==="existing"&&o.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three",children:[o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.crInstance")}),o.jsx(Ff,{ariaLabel:l("deploymentResources.existingCrInstance"),value:e.cr.instance??"",valueLabel:e.cr.instance,state:h,disabled:r,valueField:"name",onChange:x=>y({cr:{mode:"existing",instance:x.name}})})]}),o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.namespace")}),o.jsx(Ff,{ariaLabel:l("deploymentResources.existingCrNamespace"),value:e.cr.namespace??"",valueLabel:e.cr.namespace,state:p,disabled:r||!e.cr.instance,valueField:"name",onChange:x=>y({cr:{...e.cr,namespace:x.name,repository:void 0}})})]}),o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.repository")}),o.jsx(Ff,{ariaLabel:l("deploymentResources.existingCrRepository"),value:e.cr.repository??"",valueLabel:e.cr.repository,state:g,disabled:r||!e.cr.namespace,valueField:"name",onChange:x=>y({cr:{...e.cr,repository:x.name}})})]})]}),e.cr.mode==="auto"&&o.jsx(lL,{items:[{label:l("deploymentResources.crInstance"),name:l("deploymentResources.autoRegistry")},{label:l("deploymentResources.namespace"),name:"agentkit"},{label:l("deploymentResources.repository"),name:l("deploymentResources.autoRepositoryName",{name:c})}],note:l("deploymentResources.registryNameNote")})]})]}),o.jsxs("div",{className:"pp-resource-item",children:[o.jsx("div",{className:"pp-resource-name",children:"CodePipeline"}),o.jsxs("div",{className:"pp-resource-grid",children:[o.jsx(oL,{resource:"CodePipeline",value:e.codePipeline.mode,disabled:r,onChange:x=>y({codePipeline:{mode:x}})}),e.codePipeline.mode==="create"&&o.jsxs("div",{className:"pp-resource-fields",children:[o.jsx(z0,{label:l("deploymentResources.workspaceName"),value:e.codePipeline.workspaceName??"",placeholder:l("deploymentResources.workspaceName"),disabled:r,onChange:x=>y({codePipeline:{...e.codePipeline,workspaceName:x}})}),o.jsx(z0,{label:l("deploymentResources.pipelineName"),value:e.codePipeline.pipelineName??"",placeholder:l("deploymentResources.pipelineName"),disabled:r,onChange:x=>y({codePipeline:{...e.codePipeline,pipelineName:x}})})]}),e.codePipeline.mode==="existing"&&o.jsxs("div",{className:"pp-resource-fields",children:[o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.workspace")}),o.jsx(Ff,{ariaLabel:l("deploymentResources.existingWorkspace"),value:e.codePipeline.workspaceId??"",valueLabel:e.codePipeline.workspaceName,state:b,disabled:r,onChange:x=>y({codePipeline:{mode:"existing",workspaceId:x.id,workspaceName:x.name}})})]}),o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.compatiblePipeline")}),o.jsx(Ff,{ariaLabel:l("deploymentResources.existingPipeline"),value:e.codePipeline.pipelineId??"",valueLabel:e.codePipeline.pipelineName,state:v,disabled:r||!e.codePipeline.workspaceId,onChange:x=>y({codePipeline:{...e.codePipeline,pipelineId:x.id,pipelineName:x.name}})})]})]}),e.codePipeline.mode==="auto"&&o.jsx(lL,{items:[{label:l("deploymentResources.workspace"),name:"agentkit-cli-workspace"},{label:l("deploymentResources.pipeline"),name:u}],note:l("deploymentResources.pipelineNameNote")})]})]}),s&&o.jsx("p",{className:"pp-resource-validation",role:"alert",children:s})]})}function M3t(e){return[{value:"custom",label:e("environmentCenter.creation.custom.label"),description:e("environmentCenter.creation.custom.description")},{value:"dockerfile",label:e("environmentCenter.creation.dockerfile.label"),description:e("environmentCenter.creation.dockerfile.description")},{value:"git",label:e("environmentCenter.creation.git.label"),description:e("environmentCenter.creation.git.description")},{value:"image",label:e("environmentCenter.creation.image.label"),description:e("environmentCenter.creation.image.description")}]}const L3t=xOe.map(e=>({value:e.id,label:e.label,description:e.description}));function $3t(e){return[{value:"none",label:e("common.none"),description:e("environmentCenter.presets.none")},{value:"aio-sandbox",label:"AIO Sandbox",description:e("environmentCenter.presets.aio")},{value:"codex-sandbox",label:"Codex Sandbox",description:e("environmentCenter.presets.codex")}]}function F3t(e){const t=T3t(e,"");return t===CB?"aio-sandbox":t.includes("/codexenv:")?"codex-sandbox":"none"}const B3t=oN.map(e=>({value:e.id,label:e.label})),Lte=OOe.map(e=>({value:e.id,label:e.label}));function U3t(e){return[{value:"managed",label:e("environmentCenter.repository.managed")},{value:"existing",label:e("environmentCenter.repository.existing")}]}const O8=20,$te=new Set;async function Q3t(){var e;if(typeof navigator>"u"||!((e=navigator.permissions)!=null&&e.query))return!1;try{return(await navigator.permissions.query({name:"clipboard-read"})).state==="denied"}catch{return!1}}const z3t={opencli:KLt,uv:XLt,playwright:YLt,chromium:ZLt,git:JLt,curl:e3t,ffmpeg:t3t,imagemagick:n3t};function V3t(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function Eu(){return o.jsx("span",{className:"environment-required-mark","aria-hidden":"true",children:"*"})}function H3t(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 3v11m0 0 4-4m-4 4-4-4"}),o.jsx("path",{d:"M5 16v2.5A2.5 2.5 0 0 0 7.5 21h9a2.5 2.5 0 0 0 2.5-2.5V16"})]})}function S8(e,t){const n=e.trim();if(!n)return t("environmentCenter.errors.repositoryRequired");try{const i=new URL(n);if(i.protocol!=="https:"||!i.hostname)return t("environmentCenter.errors.repositoryHttps")}catch{return t("environmentCenter.errors.repositoryInvalid")}return""}function Fte(e){return!!(e!=null&&e.region&&e.registry&&e.namespace&&e.repository)}function Dje(e,t){const n=e.trim();return n?/\s/.test(n)?t("environmentCenter.errors.imageReferenceWhitespace"):n.startsWith("sha256:")?/^sha256:[0-9a-fA-F]{64}$/.test(n)?"":t("environmentCenter.errors.imageDigestInvalid"):/[@/]/.test(n)?t("environmentCenter.errors.imageTagOnly"):"":""}function q3t(e){return(e instanceof Error?e.message:String(e)).split(` +原始响应:`,1)[0].trim()}function W3t(e){return o.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M5.5 10.5 16 5l10.5 5.5L16 16 5.5 10.5Z"}),o.jsx("path",{d:"M5.5 16 16 21.5 26.5 16M5.5 21.5 16 27l10.5-5.5"})]})}function G3t({label:e}){return o.jsx("span",{className:"environment-package-fallback",children:e.slice(0,1).toUpperCase()})}function K3t({option:e}){if(e.id==="lark-cli")return o.jsx("img",{src:UI,alt:""});if(e.id==="pandoc")return o.jsx("img",{src:GLt,alt:""});if(e.id==="github-cli")return o.jsx(XQ,{});const t=z3t[e.id];return t?o.jsx("img",{src:t,alt:""}):o.jsx(G3t,{label:e.label})}function X3t(e,t){return e?{name:e.name,description:e.description,baseEnvironment:e.baseEnvironment,operatingSystem:e.operatingSystem,language:e.language,optionIds:[...e.optionIds],selectedSkills:[...e.selectedSkills],dockerfile:e.dockerfile===AB(e,t)?void 0:e.dockerfile,gitSource:e.gitSource,containerRepository:e.containerRepository,imageSource:e.imageSource}:{...mM,optionIds:[...mM.optionIds],selectedSkills:[...mM.selectedSkills]}}const Hg=new Set(["preparing","queued","building","scanning"]),Bte=3e3,cL={preparing:"environmentCenter.buildStatus.preparing",queued:"environmentCenter.buildStatus.queued",building:"environmentCenter.buildStatus.building",scanning:"environmentCenter.buildStatus.scanning",available:"environmentCenter.buildStatus.available",failed:"environmentCenter.buildStatus.failed"};function Mje(e,t){var i;const n=(i=e.latestVersion)==null?void 0:i.status;return n?n==="available"?{label:t(cL[n]),color:"success"}:n==="failed"?{label:t(cL[n]),color:"danger"}:{label:t(cL[n]),color:"warning"}:{label:t("environmentCenter.buildStatus.notBuilt"),color:"secondary"}}function Y3t(e,t){return GQ(e,Date.now(),t)}function Z3t(e,t){const n=Date.parse(e);return Number.isNaN(n)?e:new Intl.DateTimeFormat(t,{dateStyle:"medium",timeStyle:"medium"}).format(n)}function J3t(e,t,n=Date.now()){const i=Date.parse(e.createdAt),s=Hg.has(e.status)?n:Date.parse(e.updatedAt);if(Number.isNaN(i)||Number.isNaN(s))return"";const a=Math.max(0,Math.floor((s-i)/1e3));if(a<60)return t("environmentCenter.duration.seconds",{count:a});const l=Math.floor(a/60),c=a%60;return l<60?t("environmentCenter.duration.minutesSeconds",{minutes:l,seconds:c}):t("environmentCenter.duration.hoursMinutes",{hours:Math.floor(l/60),minutes:l%60})}function e4t({environment:e,onClose:t}){var O;const{t:n}=Ce("ui"),i=((O=e.latestVersion)==null?void 0:O.versionId)??"",r=m.useId(),s=m.useRef(null),a=m.useRef(t),[l,c]=m.useState(null),[u,d]=m.useState(!0),[f,h]=m.useState(""),[p,g]=m.useState(0),[b,v]=m.useState("idle"),y=m.useMemo(()=>l?j3t(l):"",[l]);a.current=t,m.useEffect(()=>{var E;const w=document.body.style.overflow,k=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(E=s.current)==null||E.focus();const S=C=>{if(C.key==="Escape"){C.preventDefault(),a.current();return}if(C.key!=="Tab"||!s.current)return;const N=Array.from(s.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')).filter(A=>A.getClientRects().length>0);if(!N.length)return;const _=N[0],j=N[N.length-1];C.shiftKey&&document.activeElement===_?(C.preventDefault(),j.focus()):!C.shiftKey&&document.activeElement===j&&(C.preventDefault(),_.focus())};return window.addEventListener("keydown",S),()=>{document.body.style.overflow=w,window.removeEventListener("keydown",S),k!=null&&k.isConnected&&k.focus()}},[]),m.useEffect(()=>{const w=new AbortController;return d(!0),h(""),_0e(e.id,i,w.signal).then(c).catch(k=>{(k==null?void 0:k.name)!=="AbortError"&&h(k instanceof Error?k.message:String(k))}).finally(()=>{w.signal.aborted||d(!1)}),()=>w.abort()},[e.id,p,i]),m.useEffect(()=>{if(b!=="copied")return;const w=window.setTimeout(()=>v("idle"),1500);return()=>window.clearTimeout(w)},[b]);const x=async()=>{try{await navigator.clipboard.writeText(y),v("copied")}catch{v("error")}};return Li.createPortal(o.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:w=>{w.target===w.currentTarget&&t()},children:o.jsxs("section",{ref:s,className:"environment-build-dialog environment-manifest-dialog",role:"dialog","aria-modal":"true","aria-labelledby":r,"aria-busy":u||void 0,tabIndex:-1,children:[o.jsxs("header",{className:"environment-build-dialog__header",children:[o.jsxs("div",{children:[o.jsx("div",{className:"environment-build-dialog__title-row",children:o.jsx("h2",{id:r,children:n("environmentCenter.manifest.title")})}),o.jsxs("p",{children:[e.name," / ",i]})]}),o.jsx(Wt,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":n("environmentCenter.manifest.closeLabel"),children:o.jsx(Ba,{"aria-hidden":!0})})]}),o.jsx("div",{className:"environment-manifest-dialog__body",children:u?o.jsx("div",{className:"environment-manifest-dialog__state",role:"status",children:o.jsx(An,{as:"span",children:n("environmentCenter.manifest.loading")})}):f?o.jsxs("div",{className:"environment-manifest-dialog__state is-error",role:"alert",children:[o.jsx("p",{children:f}),o.jsx(Wt,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>g(w=>w+1),children:n("common.reload")})]}):o.jsx("div",{className:"environment-manifest-dialog__editor","aria-label":n("environmentCenter.manifest.editorLabel"),children:o.jsx(zE,{value:y,path:"environment.yaml",readOnly:!0,onChange:()=>{}})})}),o.jsxs("footer",{className:"environment-build-dialog__actions",children:[b==="error"?o.jsx("span",{className:"environment-manifest-dialog__copy-error",role:"alert",children:n("environmentCenter.manifest.copyFailed")}):null,o.jsx(Wt,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:n("common.close")}),o.jsx(Wt,{type:"button",color:"info",size:"sm",disabled:!y,onClick:()=>void x(),children:n(b==="copied"?"environmentCenter.manifest.copied":"environmentCenter.manifest.copy")})]})]})}),document.body)}function t4t({environment:e,onClose:t,onBuildUpdate:n,onRebuild:i}){var S,E;const{t:r}=Ce("ui"),s=e.latestVersion,[a,l]=m.useState(s),[c,u]=m.useState(!!s),[d,f]=m.useState(""),[h,p]=m.useState(Date.now()),[g,b]=m.useState(!1),v=m.useId(),y=m.useRef(null),x=m.useRef(t),O=m.useRef(n);m.useEffect(()=>{x.current=t,O.current=n},[n,t]),m.useEffect(()=>{var j;const C=document.body.style.overflow,N=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(j=y.current)==null||j.focus();const _=A=>{var R;if(A.key==="Escape"&&x.current(),A.key!=="Tab")return;const F=Array.from(((R=y.current)==null?void 0:R.querySelectorAll('button:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])'))??[]).filter(L=>L.getClientRects().length>0);if(!F.length)return;const T=F[0],P=F[F.length-1];A.shiftKey&&document.activeElement===T?(A.preventDefault(),P.focus()):!A.shiftKey&&document.activeElement===P&&(A.preventDefault(),T.focus())};return window.addEventListener("keydown",_),()=>{document.body.style.overflow=C,window.removeEventListener("keydown",_),N!=null&&N.isConnected&&N.focus()}},[]),m.useEffect(()=>{if(!s)return;let C=0;const N=new AbortController,_=async()=>{u(!0);try{const j=await A0e(e.id,s.versionId,{includeLogs:!0,signal:N.signal});l(j),f(""),O.current(j),Hg.has(j.status)&&(C=window.setTimeout(_,Bte))}catch(j){if((j==null?void 0:j.name)==="AbortError")return;f(j instanceof Error?j.message:String(j)),C=window.setTimeout(_,Bte)}finally{N.signal.aborted||u(!1)}};return _(),()=>{N.abort(),window.clearTimeout(C)}},[e.id,s==null?void 0:s.versionId]),m.useEffect(()=>{if(!a||!Hg.has(a.status))return;const C=window.setInterval(()=>p(Date.now()),1e3);return()=>window.clearInterval(C)},[a==null?void 0:a.status]);const w=a?Mje({...e,latestVersion:a},r):{label:r("environmentCenter.buildStatus.notBuilt"),color:"secondary"},k=e.imageSource||(E=(S=a==null?void 0:a.resources)==null?void 0:S.codePipeline)==null?void 0:E.consoleUrl;return Li.createPortal(o.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:C=>{C.target===C.currentTarget&&t()},children:o.jsxs("section",{ref:y,className:"environment-build-dialog",role:"dialog","aria-modal":"true","aria-labelledby":v,tabIndex:-1,children:[o.jsxs("header",{className:"environment-build-dialog__header",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"environment-build-dialog__title-row",children:[o.jsx("h2",{id:v,children:r("environmentCenter.buildDetails.title")}),o.jsx(ba,{color:w.color,size:"sm",children:w.label})]}),o.jsx("p",{children:e.name})]}),o.jsx(Wt,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":r("environmentCenter.buildDetails.closeLabel"),children:o.jsx(Ba,{"aria-hidden":!0})})]}),o.jsxs("div",{className:"environment-build-dialog__summary",children:[o.jsxs("div",{children:[o.jsx("span",{children:r("environmentCenter.buildDetails.currentStep")}),o.jsx("strong",{children:(a==null?void 0:a.currentStep)||r("environmentCenter.buildDetails.waiting")})]}),o.jsxs("div",{children:[o.jsx("span",{children:r("environmentCenter.buildDetails.elapsed")}),o.jsx("strong",{children:a?J3t(a,r,h):"-"})]}),a!=null&&a.sourceCommitSha?o.jsxs("div",{children:[o.jsx("span",{children:r("environmentCenter.buildDetails.sourceCommit")}),o.jsx("strong",{title:a.sourceCommitSha,children:a.sourceCommitSha.slice(0,12)})]}):null,k?o.jsxs("a",{href:k,target:"_blank",rel:"noreferrer",children:[r("environmentCenter.buildDetails.openCodePipeline")," ",o.jsx(gb,{"aria-hidden":!0})]}):null]}),o.jsxs("div",{className:"environment-build-dialog__body",children:[d?o.jsx("p",{className:"environment-build-dialog__error",role:"alert",children:d}):null,a!=null&&a.progressError?o.jsx("p",{className:"environment-build-dialog__notice",children:a.progressError}):null,o.jsx(o3t,{steps:(a==null?void 0:a.steps)??[],log:(a==null?void 0:a.logTail)??"",logError:a==null?void 0:a.logError,logTruncated:a==null?void 0:a.logTruncated,logUpdatedAt:a==null?void 0:a.logUpdatedAt,loading:c&&!!(a&&Hg.has(a.status))}),(a==null?void 0:a.status)==="failed"&&a.error?o.jsx("p",{className:"environment-build-dialog__failure",role:"alert",children:a.error}):null]}),o.jsxs("footer",{className:"environment-build-dialog__actions",children:[o.jsx(Wt,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:r("common.close")}),a&&!e.imageSource&&!Hg.has(a.status)?o.jsx(Wt,{type:"button",color:"info",size:"sm",disabled:g,onClick:()=>{b(!0),i().then(t).finally(()=>b(!1))},children:r(g?"environmentCenter.buildDetails.starting":"environmentCenter.buildDetails.rebuild")}):null]})]})}),document.body)}function Lje({cloudProvider:e,value:t,disabled:n,onChange:i}){const{t:r}=Ce("ui"),s=Iu(e).map(a=>({value:a.value,label:a.label}));return o.jsxs("label",{className:"environment-field environment-region-field",children:[o.jsxs("span",{children:[r("environmentCenter.region"),o.jsx(Eu,{})]}),o.jsx(Ls,{id:"environment-region",value:t,options:s,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:n,triggerClassName:"environment-select-trigger",onChange:a=>i(a.value)})]})}function n4t({repositoryUrl:e,gitRef:t,dockerfilePath:n,inspection:i,inspectedKey:r,disabled:s,onRepositoryUrlChange:a,onGitRefChange:l,onDockerfilePathChange:c,onInspectionChange:u,onInspectedKeyChange:d}){const{t:f}=Ce("ui"),[h,p]=m.useState(!1),[g,b]=m.useState(""),v=m.useRef(null),y=m.useRef(""),x=`${e.trim()}\0${t.trim()}`,O=r===x;m.useEffect(()=>()=>{const E=v.current;v.current=null,E==null||E.abort()},[]);const w=()=>{var E;(E=v.current)==null||E.abort(),v.current=null,p(!1),b(""),u(null),d(""),c(""),y.current=""},k=m.useCallback(async()=>{var N;const E=S8(e,f);if(E){b(E);return}y.current=x,(N=v.current)==null||N.abort();const C=new AbortController;v.current=C,p(!0),b("");try{const _=await x0e({repositoryUrl:e.trim(),...t.trim()?{ref:t.trim()}:{}},C.signal);if(v.current!==C)return;u(_),d(x),c(_.dockerfiles.length===1?_.dockerfiles[0]:"")}catch(_){if((_==null?void 0:_.name)==="AbortError")return;b(q3t(_)),u(null),d(""),c("")}finally{v.current===C&&(v.current=null,p(!1))}},[x,t,c,d,u,e,f]);m.useEffect(()=>{if(s||O||y.current===x||S8(e,f))return;const E=window.setTimeout(()=>void k(),600);return()=>window.clearTimeout(E)},[x,s,k,O,e,f]);const S=O?(i==null?void 0:i.dockerfiles)??[]:[];return o.jsxs("section",{className:"environment-source-section","aria-label":f("environmentCenter.git.sectionLabel"),children:[o.jsxs("div",{className:"environment-form-grid environment-git-fields",children:[o.jsxs("label",{className:"environment-field",children:[o.jsxs("span",{children:[f("environmentCenter.git.address"),o.jsx(Eu,{})]}),o.jsx(qr,{size:"lg",type:"url",required:!0,value:e,placeholder:"https://github.com/owner/repository.git",autoComplete:"url",disabled:s,"aria-invalid":!!g,onChange:E=>{w(),a(E.currentTarget.value)}})]}),o.jsxs("label",{className:"environment-field",children:[o.jsx("span",{children:f("environmentCenter.git.ref")}),o.jsx(qr,{size:"lg",value:t,placeholder:f("environmentCenter.git.defaultBranch"),autoComplete:"off",disabled:s,onChange:E=>{w(),l(E.currentTarget.value)}})]})]}),o.jsxs("div",{className:"environment-inspection-status environment-form-feedback","aria-live":"polite",children:[h?o.jsx(An,{as:"span",children:f("environmentCenter.git.inspecting")}):null,g?o.jsxs("div",{className:"environment-source-error",role:"alert",children:[o.jsx("span",{children:g}),o.jsxs(Wt,{type:"button",color:"primary",size:"sm",pill:!1,disabled:s,onClick:()=>void k(),children:[o.jsx(Kj,{}),f("common.retry")]})]}):null,!h&&!g&&O&&i?S.length>0?o.jsx("span",{children:i.commitSha?f("environmentCenter.git.foundDockerfiles",{commit:i.commitSha.slice(0,12),count:S.length}):f("environmentCenter.git.savedDockerfileLoaded")}):o.jsxs("div",{className:"environment-source-error",role:"alert",children:[o.jsx("span",{children:f("environmentCenter.git.noDockerfile")}),o.jsx("button",{type:"button",disabled:s,onClick:()=>void k(),children:f("environmentCenter.git.inspectAgain")})]}):null]}),S.length>0?o.jsxs("label",{className:"environment-field environment-dockerfile-picker",children:[o.jsxs("span",{children:["Dockerfile",o.jsx(Eu,{})]}),o.jsx(VE,{ariaLabel:f("environmentCenter.git.selectDockerfile"),value:n,valueLabel:n,placeholder:f("environmentCenter.git.selectDockerfile"),options:S.map(E=>({value:E,label:E})),disabled:s||h,onChange:c})]}):null]})}function i4t({cloudProvider:e,mode:t,region:n,value:i,disabled:r,onModeChange:s,onRegionChange:a,onChange:l}){const{t:c}=Ce("ui");return o.jsx("section",{className:"environment-source-section","aria-label":c("environmentCenter.repository.outputSection"),children:o.jsxs("div",{className:"environment-form-grid",children:[o.jsxs("label",{className:"environment-field",children:[o.jsxs("span",{children:[c("environmentCenter.repository.type"),o.jsx(Eu,{})]}),o.jsx(Ls,{id:"environment-repository-mode",value:t,options:U3t(c),optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:r,triggerClassName:"environment-select-trigger",onChange:u=>s(u.value)})]}),o.jsx(Lje,{cloudProvider:e,value:n,disabled:r,onChange:a}),t==="existing"?o.jsx(Rje,{region:n,value:i,disabled:r,onChange:l}):o.jsx("p",{className:"environment-source-note environment-form-feedback",children:c("environmentCenter.repository.managedHint")})]})})}function r4t({cloudProvider:e,region:t,repository:n,reference:i,disabled:r,onRegionChange:s,onRepositoryChange:a,onReferenceChange:l}){const{t:c}=Ce("ui"),u=Dje(i,c);return o.jsx("section",{className:"environment-source-section","aria-label":c("environmentCenter.existingImage.sectionLabel"),children:o.jsxs("div",{className:"environment-form-grid",children:[o.jsx(Lje,{cloudProvider:e,value:t,disabled:r,onChange:s}),o.jsx(Rje,{region:t,value:n,disabled:r,onChange:a}),o.jsxs("label",{className:"environment-field environment-image-reference",children:[o.jsxs("span",{children:[c("environmentCenter.existingImage.reference"),o.jsx(Eu,{})]}),o.jsx(qr,{size:"lg",value:i,required:!0,placeholder:c("environmentCenter.existingImage.placeholder"),autoComplete:"off",disabled:r,"aria-invalid":!!u,onChange:d=>l(d.currentTarget.value)}),u?o.jsx("small",{className:"environment-source-field__error",role:"alert",children:u}):o.jsx("small",{children:c("environmentCenter.existingImage.hint")})]})]})})}function $je(e,t,n,i){const r=m.useRef(n),s=m.useRef(i);r.current=n,s.current=i,m.useEffect(()=>{const a=document.body.style.overflow,l=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden";const c=window.requestAnimationFrame(()=>{var d;return(d=t.current)==null?void 0:d.focus()}),u=d=>{var g;if(d.key==="Escape"&&!s.current){d.preventDefault(),r.current();return}if(d.key!=="Tab")return;const f=Array.from(((g=e.current)==null?void 0:g.querySelectorAll('button:not([disabled]), textarea:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])'))??[]).filter(b=>b.getClientRects().length>0);if(!f.length)return;const h=f[0],p=f[f.length-1];d.shiftKey&&document.activeElement===h?(d.preventDefault(),p.focus()):!d.shiftKey&&document.activeElement===p&&(d.preventDefault(),h.focus())};return window.addEventListener("keydown",u),()=>{window.cancelAnimationFrame(c),document.body.style.overflow=a,window.removeEventListener("keydown",u),l!=null&&l.isConnected&&l.focus()}},[e,t])}function s4t({environment:e,onClose:t}){const{t:n}=Ce("ui"),i=m.useId(),r=m.useId(),s=m.useRef(null),a=m.useRef(null),[l,c]=m.useState(""),[u,d]=m.useState("loading"),[f,h]=m.useState(""),p=u==="loading";$je(s,a,t,p);const g=async(b="",v)=>{d("loading"),h("");try{const y=b||(await w0e(e.id,v)).shareCode;c(y),await u0e(y),v!=null&&v.aborted||d("copied")}catch(y){if((y==null?void 0:y.name)==="AbortError")return;h(y instanceof Error?y.message:String(y)),d("error")}};return m.useEffect(()=>{const b=new AbortController;return g("",b.signal),()=>b.abort()},[e.id]),Li.createPortal(o.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:b=>{b.target===b.currentTarget&&!p&&t()},children:o.jsxs("section",{ref:s,className:"environment-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":i,"aria-describedby":r,"aria-busy":p||void 0,children:[o.jsxs("header",{className:"environment-build-dialog__header",children:[o.jsxs("div",{children:[o.jsx("h2",{id:i,children:n("environmentCenter.share.title")}),o.jsx("p",{id:r,children:e.name})]}),o.jsx(Wt,{ref:a,type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:p,onClick:t,"aria-label":n("environmentCenter.share.closeLabel"),children:o.jsx(Ba,{"aria-hidden":!0})})]}),o.jsx("div",{className:"environment-share-dialog__body",children:u==="loading"?o.jsx(An,{as:"p",children:n("environmentCenter.share.generating")}):o.jsxs("div",{className:"environment-share-dialog__result",children:[u==="copied"?o.jsx("p",{className:"environment-share-dialog__success",role:"status","aria-live":"polite",children:n("environmentCenter.share.copied")}):o.jsxs("div",{className:"environment-share-dialog__error",role:"alert",children:[o.jsx("strong",{children:n("environmentCenter.share.failed")}),o.jsx("span",{children:f})]}),l?o.jsxs("label",{className:"environment-share-dialog__field environment-share-dialog__manual-code",children:[o.jsx("span",{children:n("environmentCenter.share.code")}),o.jsx(Rm,{size:"lg",rows:4,value:l,readOnly:!0,"aria-label":n("environmentCenter.share.fullCode"),onFocus:b=>b.currentTarget.select(),onClick:b=>b.currentTarget.select()}),o.jsx("small",{children:n(u==="copied"?"environmentCenter.share.copiedHint":"environmentCenter.share.copyFailedHint")})]}):null,o.jsx("p",{className:"environment-share-dialog__safety",children:n("environmentCenter.share.safety")})]})}),o.jsxs("footer",{className:"environment-build-dialog__actions",children:[o.jsx(Wt,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:p,onClick:t,children:n("common.close")}),u==="error"?o.jsx(Wt,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("common.retry")}):u==="copied"?o.jsx(Wt,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("environmentCenter.share.copyAgain")}):null]})]})}),document.body)}function a4t({initialValue:e,autoInspect:t,onClose:n,onImported:i}){const{t:r}=Ce("ui"),s=m.useId(),a=m.useId(),l=m.useId(),c=m.useRef(null),u=m.useRef(null),d=m.useRef(!1),[f,h]=m.useState(e),[p,g]=m.useState("editing"),[b,v]=m.useState([]),[y,x]=m.useState(""),[O,w]=m.useState([]),k=m.useMemo(()=>YF(f),[f]),S=k.length>O8,E=p==="inspecting"||p==="importing",C=b.filter(T=>T.status==="valid"),N=b.filter(T=>T.status==="invalid"),_=p==="ready"&&C.length>0;$je(c,u,n,E);const j=m.useCallback(async()=>{if(!(!k.length||S)){g("inspecting"),x(""),w([]);try{const T=await O0e(k);v([...T].sort((P,R)=>P.index-R.index)),g("ready")}catch(T){x(T instanceof Error?T.message:String(T)),g("editing")}}},[k,S]);m.useEffect(()=>{!t||d.current||(d.current=!0,j())},[t,j]);const A=async()=>{if(_){g("importing"),x(""),w([]);try{const T=C.map(Q=>({code:k[Q.index],name:Q.name})).filter(Q=>!!Q.code),P=await S0e(T.map(Q=>Q.code)),R=P.filter(Q=>Q.status==="created").length,L=P.filter(Q=>Q.status==="duplicate").length,M=new Map(P.map(Q=>[Q.index,Q])),U=T.flatMap(({code:Q,name:q},B)=>{const te=M.get(B);return!te||te.status==="failed"?[{code:Q,name:q,status:"valid",error:(te==null?void 0:te.error)||r("environmentCenter.import.noResult")}]:[]}),H=[...N.flatMap(Q=>{const q=k[Q.index];return q?[{code:q,name:"",status:"invalid",error:Q.error||r("environmentCenter.import.invalidCode")}]:[]}),...U],Z=new Map;if(P.forEach(Q=>{Q.environment&&Z.set(Q.environment.id,Q.environment)}),i([...Z.values()],R,L,H.length),!H.length){n();return}h(H.map(Q=>Q.code).join(` +`)),w(U),v(H.map((Q,q)=>({index:q,status:Q.status,name:Q.name,error:Q.status==="invalid"?Q.error:""}))),x(r("environmentCenter.import.partial",{created:R,remaining:H.length})),g("ready")}catch(T){x(T instanceof Error?T.message:String(T)),g("ready")}}},F=p==="inspecting"?r("environmentCenter.import.inspecting"):p==="importing"?r("environmentCenter.import.importing"):_?O.length?r("environmentCenter.import.retryImport"):r("environmentCenter.import.confirm"):r("environmentCenter.import.inspectCodes");return Li.createPortal(o.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:T=>{T.target===T.currentTarget&&!E&&n()},children:o.jsxs("section",{ref:c,className:"environment-share-dialog environment-import-dialog",role:"dialog","aria-modal":"true","aria-labelledby":s,"aria-describedby":a,"aria-busy":E||void 0,children:[o.jsxs("header",{className:"environment-build-dialog__header",children:[o.jsxs("div",{children:[o.jsx("h2",{id:s,children:r("environmentCenter.import.title")}),o.jsx("p",{id:a,children:r("environmentCenter.import.description")})]}),o.jsx(Wt,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:E,onClick:n,"aria-label":r("environmentCenter.import.closeLabel"),children:o.jsx(Ba,{"aria-hidden":!0})})]}),o.jsxs("div",{className:"environment-share-dialog__body",children:[o.jsxs("label",{className:"environment-share-dialog__field",children:[o.jsx("span",{children:r("environmentCenter.import.code")}),o.jsx(Rm,{ref:u,size:"lg",rows:6,value:f,disabled:E,"aria-invalid":S||N.length>0||void 0,"aria-describedby":l,placeholder:"akenv://v1/...",onChange:T=>{h(T.currentTarget.value),g("editing"),v([]),x(""),w([])}})]}),o.jsx("p",{id:l,className:`environment-share-dialog__help${S?" is-error":""}`,children:S?r("environmentCenter.import.tooMany",{max:O8,count:k.length}):r("environmentCenter.import.multipleHint")}),o.jsx("p",{className:"environment-share-dialog__safety",children:r("environmentCenter.import.safety")}),p==="inspecting"?o.jsx(An,{as:"p",children:r("environmentCenter.import.inspectingCodes")}):C.length?o.jsx("p",{className:"environment-share-dialog__summary",role:"status","aria-live":"polite",children:r("environmentCenter.import.found",{count:C.length,names:C.map(T=>T.name||r("environmentCenter.unnamed")).join(r("environmentCenter.listSeparator"))})}):null,N.length?o.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:N.map(T=>o.jsx("li",{children:r("environmentCenter.import.itemError",{index:T.index+1,error:T.error||r("environmentCenter.import.invalidCode")})},T.index))}):null,O.length?o.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:O.map((T,P)=>o.jsx("li",{children:r("environmentCenter.import.itemError",{index:P+1,error:T.error})},`${T.code}:${P}`))}):null,y?o.jsx("p",{className:"environment-share-dialog__error-text",role:"alert",children:y}):null]}),o.jsxs("footer",{className:"environment-build-dialog__actions",children:[o.jsx(Wt,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:E,onClick:n,children:r("common.cancel")}),o.jsx(Wt,{type:"button",color:"info",size:"sm",loading:E,disabled:E||!k.length||S||p==="ready"&&!_,onClick:()=>_?void A():void j(),children:F})]})]})}),document.body)}function o4t({environment:e,cloudProvider:t,onCancel:n,onDelete:i,onShare:r,onSave:s}){var qe,ke,Tt,Jt,on,Et,Bt;const{t:a,i18n:l}=Ce("ui"),c=M3t(a),u=X3t(e,t),d=u.dockerfile!==void 0,[f,h]=m.useState(()=>({...u,dockerfile:d?void 0:u.dockerfile})),[p,g]=m.useState(u.gitSource?"git":u.imageSource?"image":d?"dockerfile":"custom"),[b,v]=m.useState(d?(e==null?void 0:e.dockerfile)??"":""),[y,x]=m.useState(""),O=m.useRef(null),[w,k]=m.useState(()=>d?F3t((e==null?void 0:e.dockerfile)??""):u.baseEnvironment==="aio-sandbox"||u.baseEnvironment==="codex-sandbox"?u.baseEnvironment:"none"),[S,E]=m.useState(((qe=u.gitSource)==null?void 0:qe.repositoryUrl)??""),[C,N]=m.useState(((ke=u.gitSource)==null?void 0:ke.ref)??""),[_,j]=m.useState(((Tt=u.gitSource)==null?void 0:Tt.dockerfilePath)??""),[A,F]=m.useState(u.gitSource?{repositoryUrl:u.gitSource.repositoryUrl,ref:u.gitSource.ref??"",commitSha:"",dockerfiles:[u.gitSource.dockerfilePath]}:null),[T,P]=m.useState(u.gitSource?`${u.gitSource.repositoryUrl}\0${u.gitSource.ref??""}`:""),[R,L]=m.useState(u.containerRepository?"existing":"managed"),[M,U]=m.useState(((Jt=u.containerRepository)==null?void 0:Jt.region)??Ji(t)),[I,H]=m.useState(u.containerRepository??void 0),[Z,Q]=m.useState(((on=u.imageSource)==null?void 0:on.region)??Ji(t)),[q,B]=m.useState(u.imageSource?{region:u.imageSource.region,registry:u.imageSource.registry,namespace:u.imageSource.namespace,repository:u.imageSource.repository}:void 0),[te,ce]=m.useState(((Et=u.imageSource)==null?void 0:Et.reference)??""),[se,re]=m.useState(!1),ge=m.useMemo(()=>AB(f,t),[t,f.baseEnvironment,f.operatingSystem,f.language,f.optionIds]),G=f.dockerfile??ge,K=w!=="none",ae=w==="aio-sandbox"?CB:w==="codex-sandbox"?wOe[t]:"",ue=K?A3t(b):b,xe=K?QA(ae,""):"",Ee=K?QA(ae,ue):b,Je=y||(K?_3t(ue,ae,a):ZQ(b,void 0,a)),De=!!e,Pe="environment-editor-form",[Ne,Ke]=m.useState(!1),[wt,ot]=m.useState(""),Ie=!!Ee.trim()&&!Je,Be=`${S.trim()}\0${C.trim()}`,J=!S8(S,a)&&T===Be&&!!_&&(R==="managed"||Fte(I)),pe=Fte(q)&&!!te.trim()&&!Dje(te,a),oe=!!f.name.trim()&&!Ne&&(p==="custom"||p==="dockerfile"&&Ie||p==="git"&&J||p==="image"&&pe),Me=(rt,gt)=>{h(je=>({...je,optionIds:gt?[...je.optionIds,rt]:je.optionIds.filter(Ot=>Ot!==rt)}))},Ve=rt=>{x(""),v(K?QA(ae,rt):rt)},ht=async rt=>{if(!rt)return;const gt=await N3t(rt,a);x(gt.error),gt.content&&v(gt.content)},Se=()=>{x(""),v(xe)},ve=async rt=>{if(rt.preventDefault(),!!oe){Ke(!0),ot("");try{const gt=rat(Ee);await s({...f,name:f.name.trim(),description:f.description.trim(),optionIds:p==="custom"?f.optionIds:[],selectedSkills:p==="custom"?f.selectedSkills:[],dockerfile:p==="dockerfile"?Ee:p==="custom"?G:"",gitSource:p==="git"?{repositoryUrl:S.trim(),...C.trim()?{ref:C.trim()}:{},dockerfilePath:_}:null,containerRepository:p==="git"&&R==="existing"?I:null,imageSource:p==="image"&&q?{...q,reference:te.trim()}:null,...p==="dockerfile"?gt:{}})}catch(gt){ot(gt instanceof Error?gt.message:String(gt)),Ke(!1)}}},$e=f.name.trim()||(De?(e==null?void 0:e.name)||a("environmentCenter.configure"):a("environmentCenter.create"));return o.jsx(Th,{className:"environment-editor","aria-label":a(De?"environmentCenter.details":"environmentCenter.create"),children:o.jsx(uE,{title:$e,description:a("environmentCenter.editorDescription"),identitySeed:$e,backLabel:a("environmentCenter.backToList"),onBack:n,actions:o.jsxs(o.Fragment,{children:[i?o.jsx(Wt,{type:"button",color:"danger",variant:"ghost",size:"sm",onClick:i,disabled:Ne,children:a("common.delete")}):null,r?o.jsx(Wt,{color:"secondary",variant:"soft",size:"sm",onClick:r,disabled:Ne,children:a("environmentCenter.share.action")}):null,o.jsx(Wt,{color:"secondary",variant:"soft",size:"sm",onClick:n,disabled:Ne,children:a("common.cancel")}),o.jsx(Wt,{color:"info",size:"sm",type:"submit",form:Pe,disabled:!oe,children:a(Ne?"common.saving":p==="image"?De?"environmentCenter.save":"environmentCenter.create":De?"environmentCenter.saveAndBuild":"environmentCenter.createAndBuild")})]}),children:o.jsxs("form",{id:Pe,className:"environment-form",onSubmit:ve,children:[o.jsxs("div",{className:"environment-fields",children:[o.jsxs("label",{className:"environment-field",children:[o.jsxs("span",{children:[a("environmentCenter.name"),o.jsx(Eu,{})]}),o.jsx(qr,{className:"environment-text-input",type:"text",size:"lg",required:!0,value:f.name,maxLength:60,placeholder:a("environmentCenter.namePlaceholder"),onChange:rt=>h(gt=>({...gt,name:rt.target.value}))})]}),o.jsxs("label",{className:"environment-field",children:[o.jsx("span",{children:a("common.description")}),o.jsx(Rm,{className:"environment-description-input",size:"lg",rows:3,value:f.description,maxLength:180,placeholder:a("environmentCenter.descriptionPlaceholder"),onChange:rt=>h(gt=>({...gt,description:rt.target.value}))})]})]}),o.jsxs("label",{className:"environment-field environment-creation-method",children:[o.jsxs("span",{children:[a("environmentCenter.creationMethod"),o.jsx(Eu,{})]}),o.jsx(Ls,{id:"environment-creation-method",value:p,options:c,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:rt=>{const gt=rt.value;g(gt),gt==="dockerfile"&&!b.trim()&&v(xe),ot("")}}),o.jsx("small",{children:(Bt=c.find(rt=>rt.value===p))==null?void 0:Bt.description})]}),wt?o.jsx("p",{className:"environment-form-error",role:"alert",children:wt}):null,p==="custom"?o.jsxs("div",{className:"environment-configuration",children:[o.jsx("section",{className:"environment-section environment-form-section","aria-label":a("environmentCenter.baseConfiguration"),children:o.jsxs("div",{className:"environment-form-grid",children:[o.jsxs("label",{className:"environment-field",children:[o.jsxs("span",{children:[a("environmentCenter.baseEnvironment"),o.jsx(Eu,{})]}),o.jsx(Ls,{id:"environment-base-environment",value:f.baseEnvironment,options:L3t.map(rt=>({...rt,description:a(`environmentCenter.baseDescriptions.${rt.value}`)})),optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:rt=>{const gt=rt.value,je=gt==="aio-sandbox"||gt==="codex-sandbox";h(Ot=>({...Ot,baseEnvironment:gt,operatingSystem:je?"ubuntu-22.04":Ot.operatingSystem,language:je?"python-3.12":Ot.language}))}}),o.jsx("small",{children:a(`environmentCenter.baseDescriptions.${f.baseEnvironment}`)})]}),o.jsxs("label",{className:"environment-field",children:[o.jsxs("span",{children:[a("environmentCenter.operatingSystem"),o.jsx(Eu,{})]}),o.jsx(Ls,{id:"environment-operating-system",value:f.operatingSystem,options:B3t,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:rt=>h(gt=>({...gt,operatingSystem:rt.value}))}),o.jsx("small",{children:f.baseEnvironment!=="ubuntu"?a("environmentCenter.fixedByBase",{base:O6(f.baseEnvironment),value:"Ubuntu 22.04"}):a("environmentCenter.selectUbuntuVersion")})]}),o.jsxs("label",{className:"environment-field",children:[o.jsxs("span",{children:[a("environmentCenter.pythonVersion"),o.jsx(Eu,{})]}),o.jsx(Ls,{id:"environment-python-version",value:f.language,options:f.baseEnvironment!=="ubuntu"?Lte.filter(rt=>rt.value==="python-3.12"):Lte,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:rt=>h(gt=>({...gt,language:rt.value}))}),o.jsx("small",{children:f.baseEnvironment!=="ubuntu"?a("environmentCenter.fixedByBase",{base:O6(f.baseEnvironment),value:"Python 3.12"}):a("environmentCenter.selectPythonVersion")})]})]})}),o.jsxs("section",{className:"environment-section","aria-labelledby":"environment-skills-title",children:[o.jsx("h2",{id:"environment-skills-title",children:a("environmentCenter.skills")}),o.jsxs("div",{className:"environment-skill-grid",children:[o.jsx(Mte,{name:"VeADK",description:a("environmentCenter.veadkDescription"),selected:se,disabled:Ne,onChange:re,icon:o.jsx("img",{src:ER,alt:""})}),o.jsx(YQ,{selected:f.selectedSkills,onChange:rt=>h(gt=>({...gt,selectedSkills:rt})),cloudProvider:t,disabled:Ne,addLabel:a("environmentCenter.addSkill"),showSelectedCount:!1})]})]}),TB.map(rt=>o.jsxs("section",{className:"environment-section","aria-labelledby":`environment-${rt.id}-title`,children:[o.jsx("h2",{id:`environment-${rt.id}-title`,children:a(`environmentCenter.categories.${rt.id}`)}),o.jsx("div",{className:"environment-option-grid",children:rt.options.map(gt=>{const je=f.optionIds.includes(gt.id);return o.jsx(Mte,{name:gt.label,description:a(`environmentCenter.options.${gt.id}`,{defaultValue:gt.description}),selected:je,onChange:Ot=>Me(gt.id,Ot),icon:o.jsx(K3t,{option:gt})},gt.id)})})]},rt.id))]}):p==="dockerfile"?o.jsxs("section",{className:"environment-upload","aria-label":a("environmentCenter.customDockerfile"),children:[o.jsx("div",{className:"environment-dockerfile-settings environment-form-grid",children:o.jsxs("label",{className:"environment-field",children:[o.jsx("span",{children:a("environmentCenter.presetEnvironment")}),o.jsx(Ls,{id:"environment-dockerfile-base-environment",value:w,options:$3t(a),optionClassName:"environment-select-option",size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:rt=>{x(""),k(rt.value)}}),o.jsx("small",{children:a("environmentCenter.presetHint")})]})}),o.jsxs("div",{className:"environment-upload__preview",children:[o.jsxs("div",{children:[o.jsxs("h3",{children:["Dockerfile",o.jsx(Eu,{})]}),o.jsxs("div",{className:"environment-upload__actions",children:[o.jsx("span",{className:"environment-upload__size",children:a("environmentCenter.dockerfileSize",{size:Nje(Ee).toLocaleString(l.resolvedLanguage??l.language),max:131072 .toLocaleString(l.resolvedLanguage??l.language)})}),o.jsx("input",{ref:O,className:"environment-upload__file-input",type:"file",accept:".dockerfile,text/plain",tabIndex:-1,hidden:!0,onChange:rt=>{var je;const gt=rt.currentTarget;ht((je=gt.files)==null?void 0:je[0]).finally(()=>{gt.value=""})}}),o.jsx(Wt,{className:"environment-upload__action",type:"button",color:"secondary",variant:"soft",size:"sm",pill:!1,disabled:Ne,onClick:()=>{var rt;return(rt=O.current)==null?void 0:rt.click()},children:a("environmentCenter.upload")}),o.jsx(Wt,{className:"environment-upload__action",type:"button",color:"secondary",variant:"ghost",size:"sm",pill:!1,disabled:Ne||!ue,onClick:Se,children:a("environmentCenter.reset")})]})]}),o.jsxs("div",{className:`environment-dockerfile-editor${K?" has-fixed-base":""}${Je?" is-invalid":""}`,children:[K?o.jsxs("div",{className:"environment-dockerfile-from","aria-label":a("environmentCenter.dockerfileBaseImage"),children:[o.jsx("span",{className:"environment-dockerfile-from__line","aria-hidden":"true",children:"1"}),o.jsxs("code",{children:[o.jsx("span",{className:"environment-dockerfile-from__keyword",children:"FROM"}),o.jsx("span",{title:ae,children:ae})]})]}):null,o.jsx("div",{className:"environment-dockerfile__editor environment-upload__editor","aria-label":a("environmentCenter.dockerfileContent"),children:o.jsx(zE,{value:ue,path:"Dockerfile",lineNumberStart:K?2:1,height:"auto",minHeight:"28px",maxHeight:"var(--environment-dockerfile-editor-max-height)",onChange:Ve})})]})]}),Je?o.jsx("p",{className:"environment-upload__error environment-upload__error--below",role:"alert",children:Je}):null]}):p==="git"?o.jsxs("div",{className:"environment-source-workflow",children:[o.jsx(n4t,{repositoryUrl:S,gitRef:C,dockerfilePath:_,inspection:A,inspectedKey:T,disabled:Ne,onRepositoryUrlChange:E,onGitRefChange:N,onDockerfilePathChange:j,onInspectionChange:F,onInspectedKeyChange:P}),o.jsx(i4t,{cloudProvider:t,mode:R,region:M,value:I,disabled:Ne,onModeChange:rt=>{L(rt),ot("")},onRegionChange:rt=>{U(rt),H(void 0),ot("")},onChange:H})]}):o.jsx(r4t,{cloudProvider:t,region:Z,repository:q,reference:te,disabled:Ne,onRegionChange:rt=>{Q(rt),B(void 0),ot("")},onRepositoryChange:B,onReferenceChange:ce})]})})})}function Fje({cloudProvider:e="volcengine",onWorkspace:t,clipboardImport:n=null,clipboardReadError:i=""}){const{t:r,i18n:s}=Ce("ui"),[a,l]=m.useState([]),[c,u]=m.useState({kind:"list"}),[d,f]=m.useState(""),[h,p]=m.useState(null),[g,b]=m.useState(null),[v,y]=m.useState(null),[x,O]=m.useState(null),[w,k]=m.useState(null),S=m.useRef(0),[E,C]=m.useState(""),[N,_]=m.useState(!1),[j,A]=m.useState(i),[F,T]=m.useState(!0),[P,R]=m.useState(""),[L,M]=m.useState(0),[U,I]=m.useState(()=>new Set),H=m.useDeferredValue(d),Z=m.useMemo(()=>{const G=H.trim().toLocaleLowerCase();return G?a.filter(K=>`${K.name} ${K.description} ${w6(K.operatingSystem)} ${oh(K.language)} ${O6(K.baseEnvironment)}`.toLocaleLowerCase().includes(G)):a},[H,a]),Q=m.useCallback((G="",K=!1)=>{S.current+=1,k({key:S.current,initialValue:G,autoInspect:K})},[]),q=m.useCallback((G,K=!1)=>{const ae=G.trim();if(!ae.startsWith("akenv://")||!K&&$te.has(ae))return!1;const ue=YF(ae);return!ue.length||ue.length>O8?!1:($te.add(ae),A(""),Q(ae,!0),!0)},[Q]),B=m.useCallback(async()=>{var G;if(!(c.kind!=="list"||w)){if(typeof navigator>"u"||!((G=navigator.clipboard)!=null&&G.readText)){A(r("environmentCenter.clipboardUnsupported"));return}try{const K=await navigator.clipboard.readText();!q(K)&&!K.trim()&&await Q3t()&&A(r("environmentCenter.clipboardReadError"))}catch{A(r("environmentCenter.clipboardReadError"))}}},[w,q,r,c.kind]);m.useEffect(()=>{const G=new AbortController;return a.length===0&&T(!0),R(""),Vk(G.signal).then(K=>{l(K)}).catch(K=>{(K==null?void 0:K.name)!=="AbortError"&&R(K instanceof Error?K.message:String(K))}).finally(()=>{G.signal.aborted||T(!1)}),()=>G.abort()},[L]),m.useEffect(()=>{if(!a.some(K=>K.latestVersion&&Hg.has(K.latestVersion.status)))return;const G=window.setTimeout(()=>M(K=>K+1),2500);return()=>window.clearTimeout(G)},[a]),m.useEffect(()=>{if(!E||N)return;const G=window.setTimeout(()=>C(""),2800);return()=>window.clearTimeout(G)},[N,E]),m.useEffect(()=>{i&&A(i)},[i]),m.useEffect(()=>{n&&q(n.text)},[n,q]),m.useEffect(()=>{if(c.kind!=="list")return;const G=()=>void B(),K=()=>{document.visibilityState==="visible"&&B()},ae=ue=>{var Je;const xe=ue.target;if(xe instanceof HTMLInputElement||xe instanceof HTMLTextAreaElement||xe instanceof HTMLElement&&xe.isContentEditable)return;const Ee=((Je=ue.clipboardData)==null?void 0:Je.getData("text/plain"))??"";q(Ee,!0)&&ue.preventDefault()};return window.addEventListener("focus",G),document.addEventListener("visibilitychange",K),window.addEventListener("paste",ae),()=>{window.removeEventListener("focus",G),document.removeEventListener("visibilitychange",K),window.removeEventListener("paste",ae)}},[q,B,c.kind]);const te=c.kind==="editor"&&c.environmentId?a.find(G=>G.id===c.environmentId):void 0,ce=async G=>{const K={...G,dockerfile:G.dockerfile??AB(G,e)},ae=te?await C0e(te.id,K):await E0e(K);if(l(ue=>[ae,...ue.filter(xe=>xe.id!==ae.id)]),u({kind:"list"}),_(!1),K.imageSource){C(r("environmentCenter.status.boundImage",{name:ae.name}));return}try{const ue=await O4(ae.id);l(xe=>xe.map(Ee=>Ee.id===ae.id?{...Ee,latestVersion:ue}:Ee)),C(r("environmentCenter.status.queued",{name:ae.name}))}catch(ue){_(!0),C(r("environmentCenter.status.savedBuildFailed",{error:ue instanceof Error?ue.message:String(ue)}))}},se=async G=>{if(!U.has(G.id)){I(K=>new Set(K).add(G.id)),_(!1);try{const K=await O4(G.id);l(ae=>ae.map(ue=>ue.id===G.id?{...ue,latestVersion:K}:ue)),C(r("environmentCenter.status.queued",{name:G.name}))}catch(K){_(!0),C(K instanceof Error?K.message:String(K))}finally{I(K=>{const ae=new Set(K);return ae.delete(G.id),ae})}}},re=(G,K,ae,ue)=>{G.length&&l(xe=>{const Ee=new Set(G.map(Je=>Je.id));return[...G,...xe.filter(Je=>!Ee.has(Je.id))]}),_(ue>0),C(ue>0?r("environmentCenter.status.importedFailed",{created:K,failed:ue}):ae>0?r("environmentCenter.status.importedDuplicate",{created:K,duplicate:ae}):r("environmentCenter.status.imported",{count:K}))},ge=h?o.jsx(pc,{title:r("environmentCenter.deleteTitle"),description:r("environmentCenter.deleteDescription",{name:h.name}),confirmLabel:r("common.delete"),variant:"danger",onCancel:()=>p(null),onConfirm:()=>{const G=h;p(null),u({kind:"list"}),T0e(G.id).then(()=>{l(K=>K.filter(ae=>ae.id!==G.id)),_(!1),C(r("environmentCenter.status.deleted",{name:G.name}))}).catch(K=>{_(!0),C(K instanceof Error?K.message:String(K))})}}):null;return c.kind==="editor"?o.jsxs(o.Fragment,{children:[o.jsx(o4t,{environment:te,cloudProvider:e,onCancel:()=>u({kind:"list"}),onDelete:te?()=>p(te):void 0,onShare:te?()=>O(te):void 0,onSave:ce},c.environmentId??"new"),x?o.jsx(s4t,{environment:x,onClose:()=>O(null)}):null,ge]}):o.jsxs(Th,{className:"environment-center","aria-label":r("environmentCenter.title"),children:[o.jsx(zx,{title:r("environmentCenter.title")}),o.jsxs(Zb,{className:"environment-toolbar",children:[t?o.jsx(dE,{items:[{id:"workspaces",label:r("workspace.title")},{id:"environments",label:r("environmentCenter.title")}],value:"environments",onChange:G=>{G==="workspaces"&&t()},ariaLabel:r("workspace.resourceType"),idPrefix:"environment-center"}):null,o.jsxs("div",{className:"resource-toolbar__actions",children:[E?o.jsx("span",{className:`environment-status${N?" is-error":""}`,role:N?"alert":"status","aria-live":"polite",children:E}):null,o.jsx(wm,{"aria-label":r("environmentCenter.search"),value:d,onChange:G=>f(G.target.value),placeholder:r("environmentCenter.search")})]})]}),j?o.jsxs("div",{className:"environment-clipboard-notice",role:"alert",children:[o.jsx("span",{children:j}),o.jsx(Wt,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>{A(""),Q()},children:r("environmentCenter.manualImport")})]}):null,o.jsx(Jb,{"aria-live":"polite",children:F?o.jsx(Ud,{}):P?o.jsxs("div",{className:"environment-load-error",role:"alert",children:[o.jsx("p",{children:jd(P,s.resolvedLanguage||s.language)||r("environmentCenter.loadFailed")}),o.jsx(Wt,{color:"secondary",variant:"soft",size:"sm",onClick:()=>M(G=>G+1),children:r("common.reload")})]}):Z.length===0&&d.trim()?o.jsx("div",{className:"environment-empty",children:o.jsxs(En,{fill:"none",children:[o.jsx(En.Icon,{children:o.jsx(W3t,{})}),o.jsx(En.Title,{children:r("environmentCenter.noMatches")}),o.jsx(En.Description,{children:r("environmentCenter.tryAnotherName")})]})}):o.jsxs(Vx,{children:[d.trim()?null:o.jsxs(o.Fragment,{children:[o.jsx(Cb,{"aria-label":r("environmentCenter.create"),icon:o.jsx(V3t,{}),onClick:()=>u({kind:"editor",environmentId:null}),children:r("environmentCenter.create")}),o.jsx(Cb,{"aria-label":r("environmentCenter.import.title"),icon:o.jsx(H3t,{}),onClick:()=>Q(),children:r("environmentCenter.import.title")})]}),Z.map(G=>{var xe,Ee;const K=Mje(G,r),ae=!!(G.latestVersion&&Hg.has(G.latestVersion.status)),ue=U.has(G.id);return o.jsx(pE,{className:"environment-card",title:G.name,status:o.jsx(ba,{color:K.color,size:"sm",children:K.label}),description:((xe=G.latestVersion)==null?void 0:xe.error)||(ae?(Ee=G.latestVersion)==null?void 0:Ee.currentStep:"")||G.description||r("common.noDescription"),metadata:[{label:r("workspace.updated"),value:Y3t(G.updatedAt,s.resolvedLanguage??s.language),title:Z3t(G.updatedAt,s.resolvedLanguage??s.language)}],action:{label:G.latestVersion?r("environmentCenter.buildDetails.title"):r(ue?"environmentCenter.buildDetails.starting":"environmentCenter.startBuild"),icon:"play",title:r("environmentCenter.build"),disabled:ue,onClick:()=>G.latestVersion?b(G.id):void se(G)},auxiliaryAction:{label:r("environmentCenter.manifest.view"),icon:o.jsx(QFe,{}),title:G.latestVersion?r("environmentCenter.manifest.viewShort"):r("environmentCenter.manifest.unavailable"),disabled:!G.latestVersion,onClick:()=>y(G)},detailAction:{label:r("environmentCenter.configure"),onClick:()=>u({kind:"editor",environmentId:G.id})}},G.id)})]})}),g?(()=>{const G=a.find(K=>K.id===g);return G?o.jsx(t4t,{environment:G,onClose:()=>b(null),onBuildUpdate:K=>{l(ae=>ae.map(ue=>ue.id===G.id?{...ue,latestVersion:K}:ue))},onRebuild:()=>se(G)}):null})():null,v!=null&&v.latestVersion?o.jsx(e4t,{environment:v,onClose:()=>y(null)}):null,ge,w?o.jsx(a4t,{initialValue:w.initialValue,autoInspect:w.autoInspect,onClose:()=>k(null),onImported:re},w.key):null]})}function l4t(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function c4t(e){return o.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"4.5",y:"7",width:"23",height:"18",rx:"3"}),o.jsx("path",{d:"M10 7V5.5A1.5 1.5 0 0 1 11.5 4h4A1.5 1.5 0 0 1 17 5.5V7M9 13h5v5H9zM18 13h5M18 17h5M9 22h14"})]})}function k8(e,t){const n=Date.parse(e);return Number.isNaN(n)?e:new Intl.DateTimeFormat(t,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(n)}function u4t(e,t){return e.environmentIds.reduce((n,i)=>{var r,s;return((s=(r=t.get(i))==null?void 0:r.latestVersion)==null?void 0:s.status)==="available"?n+1:n},0)}function d4t({workspace:e,environments:t,onBack:n,onSave:i,onDelete:r}){const{t:s,i18n:a}=Ce("ui"),[l,c]=m.useState((e==null?void 0:e.name)??""),[u,d]=m.useState((e==null?void 0:e.description)??""),[f,h]=m.useState((e==null?void 0:e.environmentIds)??[]),[p,g]=m.useState(""),[b,v]=m.useState(!1),[y,x]=m.useState(""),O=p.trim().toLocaleLowerCase(),w=t.filter(S=>`${S.name} ${S.description} ${oh(S.language)}`.toLocaleLowerCase().includes(O)),k=async S=>{if(S.preventDefault(),!(!l.trim()||b)){v(!0),x("");try{await i({name:l.trim(),description:u.trim(),environmentIds:f})}catch(E){x(E instanceof Error?E.message:String(E)),v(!1)}}};return o.jsx(Th,{className:"workspace-center","aria-label":s(e?"workspace.detail":"workspace.create"),children:o.jsxs(uE,{title:e?e.name:s("workspace.create"),description:s("workspace.editorDescription"),identitySeed:(e==null?void 0:e.name)||s("workspace.create"),backLabel:s("workspace.backToList"),onBack:n,actions:o.jsxs(o.Fragment,{children:[r?o.jsx("button",{type:"button",className:"is-danger",onClick:r,children:s("common.delete")}):null,o.jsx("button",{type:"submit",form:"workspace-form",disabled:b||!l.trim(),children:s(b?"common.saving":"common.save")})]}),children:[e?o.jsxs(NB,{children:[o.jsxs("div",{children:[o.jsx("dt",{children:s("common.environment")}),o.jsx("dd",{children:s("workspace.environmentCount",{count:f.length})})]}),o.jsxs("div",{children:[o.jsx("dt",{children:s("workspace.createdAt")}),o.jsx("dd",{children:k8(e.createdAt,a.resolvedLanguage??a.language)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:s("workspace.updatedAt")}),o.jsx("dd",{children:k8(e.updatedAt,a.resolvedLanguage??a.language)})]})]}):null,o.jsxs("form",{id:"workspace-form",className:"workspace-form",onSubmit:k,children:[o.jsxs("section",{className:"workspace-fields","aria-label":s("workspace.basicInfo"),children:[o.jsxs("label",{children:[o.jsx("span",{children:s("common.name")}),o.jsx(qr,{value:l,maxLength:128,autoFocus:!0,onChange:S=>c(S.target.value),placeholder:s("workspace.namePlaceholder")})]}),o.jsxs("label",{children:[o.jsx("span",{children:s("common.description")}),o.jsx(Rm,{value:u,maxLength:2e3,onChange:S=>d(S.target.value),placeholder:s("workspace.descriptionPlaceholder")})]})]}),o.jsxs("section",{className:"workspace-environments",children:[o.jsx(FOe,{title:s("common.environment"),description:s("workspace.selectedEnvironmentCount",{count:f.length}),actions:o.jsx(wm,{"aria-label":s("workspace.searchAvailableEnvironments"),value:p,onChange:S=>g(S.target.value),placeholder:s("workspace.searchEnvironments")})}),t.length===0?o.jsxs("div",{className:"workspace-environment-empty",children:[o.jsx("p",{children:s("workspace.noAvailableEnvironments")}),o.jsx("span",{children:s("workspace.createEnvironmentFirst")})]}):w.length===0?o.jsxs("div",{className:"workspace-environment-empty",children:[o.jsx("p",{children:s("workspace.noMatchingEnvironments")}),o.jsx("span",{children:s("workspace.tryAnotherName")})]}):o.jsx("div",{className:"workspace-environment-list",children:w.map(S=>{var N;const E=f.includes(S.id),C=((N=S.latestVersion)==null?void 0:N.status)==="available"?s("workspace.environmentStatus.available"):S.latestVersion?s("workspace.environmentStatus.building"):s("workspace.environmentStatus.notBuilt");return o.jsxs("label",{className:`workspace-environment-option${E?" is-selected":""}`,children:[o.jsx("input",{type:"checkbox",checked:E,onChange:()=>h(_=>E?_.filter(j=>j!==S.id):[..._,S.id])}),o.jsxs("span",{className:"workspace-environment-option__copy",children:[o.jsx("strong",{title:S.name,children:S.name}),o.jsxs("span",{children:[oh(S.language)," · ",C]})]}),o.jsx("span",{className:"workspace-environment-option__action",children:s(E?"workspace.added":"common.add")})]},S.id)})})]}),y?o.jsx("p",{className:"workspace-form-error",role:"alert",children:y}):null]})]})})}function f4t({onEnvironment:e}){const{t,i18n:n}=Ce("ui"),[i,r]=m.useState([]),[s,a]=m.useState([]),[l,c]=m.useState({kind:"list"}),[u,d]=m.useState(""),[f,h]=m.useState(!0),[p,g]=m.useState(""),[b,v]=m.useState(""),[y,x]=m.useState(!1),[O,w]=m.useState(null),[k,S]=m.useState(0),E=m.useDeferredValue(u);m.useEffect(()=>{const j=new AbortController;return h(!0),g(""),Promise.all([e7(j.signal),Vk(j.signal)]).then(([A,F])=>{r(A),a(F)}).catch(A=>{(A==null?void 0:A.name)!=="AbortError"&&(console.warn("Unable to load Studio workspaces",A),g(t("workspace.loadFailed")))}).finally(()=>{j.signal.aborted||h(!1)}),()=>j.abort()},[k,t]),m.useEffect(()=>{if(!b||y)return;const j=window.setTimeout(()=>v(""),2800);return()=>window.clearTimeout(j)},[y,b]);const C=m.useMemo(()=>new Map(s.map(j=>[j.id,j])),[s]),N=m.useMemo(()=>{const j=E.trim().toLocaleLowerCase();return j?i.filter(A=>{const F=A.environmentIds.map(T=>{var P;return((P=C.get(T))==null?void 0:P.name)??""}).join(" ");return`${A.name} ${A.description} ${F}`.toLocaleLowerCase().includes(j)}):i},[E,C,i]),_=l.kind==="detail"&&l.workspaceId?i.find(j=>j.id===l.workspaceId):void 0;return l.kind==="detail"?o.jsx(d4t,{workspace:_,environments:s,onBack:()=>c({kind:"list"}),onDelete:_?()=>w(_):null,onSave:async j=>{const A=_?await y0e(_.id,j):await b0e(j);r(F=>[A,...F.filter(T=>T.id!==A.id)]),x(!1),v(t("workspace.saved",{name:A.name})),c({kind:"list"})}},l.workspaceId??"new"):o.jsxs(Th,{className:"workspace-center","aria-label":t("workspace.title"),children:[o.jsx(zx,{title:t("workspace.title")}),o.jsxs(Zb,{children:[o.jsx(dE,{items:[{id:"workspaces",label:t("workspace.title")},{id:"environments",label:t("common.environment")}],value:"workspaces",onChange:j=>{j==="environments"&&e()},ariaLabel:t("workspace.resourceType"),idPrefix:"workspace-center"}),o.jsxs("div",{className:"resource-toolbar__actions",children:[b?o.jsx("span",{className:`workspace-status${y?" is-error":""}`,role:y?"alert":"status","aria-live":"polite",children:b}):null,o.jsx(wm,{"aria-label":t("workspace.searchWorkspaces"),value:u,onChange:j=>d(j.target.value),placeholder:t("workspace.searchWorkspaces")})]})]}),o.jsx(Jb,{"aria-live":"polite",children:f?o.jsx(Ud,{}):p?o.jsxs("div",{className:"workspace-load-error",role:"alert",children:[o.jsx("p",{children:p}),o.jsx(Wt,{color:"secondary",variant:"soft",size:"sm",onClick:()=>S(j=>j+1),children:t("common.reload")})]}):N.length===0&&u.trim()?o.jsx("div",{className:"workspace-empty",children:o.jsxs(En,{fill:"none",children:[o.jsx(En.Icon,{children:o.jsx(c4t,{})}),o.jsx(En.Title,{children:t("workspace.noMatchingWorkspaces")}),o.jsx(En.Description,{children:t("workspace.tryAnotherNameOrEnvironment")})]})}):o.jsxs(Vx,{children:[u.trim()?null:o.jsx(Cb,{"aria-label":t("workspace.create"),icon:o.jsx(l4t,{}),onClick:()=>c({kind:"detail",workspaceId:null}),children:t("workspace.create")}),N.map(j=>{const A=u4t(j,C),F=j.environmentIds.filter(T=>!C.has(T)).length;return o.jsx(pE,{className:"workspace-card",title:j.name,status:o.jsx(ba,{color:F?"danger":A===j.environmentIds.length&&A>0?"success":"secondary",size:"sm",children:j.environmentIds.length===0?t("workspace.noEnvironmentAdded"):F?t("workspace.environmentMissing"):t("workspace.availableFraction",{available:A,total:j.environmentIds.length})}),description:j.description||t("common.noDescription"),metadata:[{label:t("common.environment"),value:t("workspace.environmentCount",{count:j.environmentIds.length})},{label:t("workspace.available"),value:t("workspace.availableCount",{count:A})},{label:t("workspace.updated"),value:k8(j.updatedAt,n.resolvedLanguage??n.language)}],detailAction:{label:t("common.manage"),onClick:()=>c({kind:"detail",workspaceId:j.id})},action:{label:t("workspace.addEnvironment"),icon:"plus",onClick:()=>c({kind:"detail",workspaceId:j.id})}},j.id)})]})}),O?o.jsx(pc,{title:t("workspace.deleteTitle"),description:t("workspace.deleteDescription",{name:O.name}),confirmLabel:t("common.delete"),variant:"danger",onCancel:()=>w(null),onConfirm:()=>{const j=O;w(null),v0e(j.id).then(()=>{r(A=>A.filter(F=>F.id!==j.id)),x(!1),v(t("workspace.deleted",{name:j.name})),c({kind:"list"})}).catch(A=>{x(!0),v(A instanceof Error?A.message:String(A))})}}):null]})}function h4t({cloudProvider:e}){const{t}=Ce("ui"),[n,i]=m.useState("workspaces"),[r,s]=m.useState(null),[a,l]=m.useState(""),c=m.useRef(0),u=()=>{var h;c.current+=1;const d=c.current;l("");let f=null;if(typeof navigator<"u"&&((h=navigator.clipboard)!=null&&h.readText))try{f=navigator.clipboard.readText()}catch{l(t("workspace.clipboardPermissionError"))}else l(t("workspace.clipboardUnsupported"));i("environments"),f&&f.then(async p=>{var g;if(c.current===d){if(p.trim()){s({key:d,text:p});return}try{const b=await((g=navigator.permissions)==null?void 0:g.query({name:"clipboard-read"}));c.current===d&&(b==null?void 0:b.state)==="denied"&&l(t("workspace.clipboardPermissionError"))}catch{}}}).catch(()=>{c.current===d&&l(t("workspace.clipboardPermissionError"))})};return n==="environments"?o.jsx(Fje,{cloudProvider:e,onWorkspace:()=>i("workspaces"),clipboardImport:r,clipboardReadError:a}):o.jsx(f4t,{onEnvironment:u})}function p4t(e){return e==="127.0.0.1"}const m4t={id:"coding-agents",kind:"coding-agent",category:"development",icon:"coding-agents",name:"Configure coding agents",badge:"Local",badgeTone:"success",description:"Install built-in VeADK and AgentKit skills globally for Trae, Claude Code, or Codex."},g4t={id:"feishu",kind:"feishu",category:"channels",icon:"feishu",name:"Feishu bot",badge:"Beta",description:"Create a Feishu bot and connect its messages directly to AgentKit Runtime."};ln.hasResourceBundle("en-US","automations")||ln.addResourceBundle("en-US","automations",Ure,!0,!0);ln.hasResourceBundle("zh-CN","automations")||ln.addResourceBundle("zh-CN","automations",rce,!0,!0);function Vd(e,t={}){return ln.t(e,{...t,ns:"automations"})}const Bje={name:"repository",label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL",required:!0},Uje={name:"baseBranch",label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base",required:!1},Qje={name:"runtimeName",label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration",required:!0},zje={name:"runtimeId",label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates",required:!0},b4t="https://ark.cn-beijing.volces.com/api/coding/v3";function y4t(e){return e==="byteplus"?xl(e):b4t}function JQ(e){return e==="byteplus"?{accessKey:"BYTEPLUS_ACCESS_KEY",secretKey:"BYTEPLUS_SECRET_KEY",sessionToken:"BYTEPLUS_SESSION_TOKEN"}:{accessKey:"VOLCENGINE_ACCESS_KEY",secretKey:"VOLCENGINE_SECRET_KEY",sessionToken:"VOLCENGINE_SESSION_TOKEN"}}function Vje(e){const t=JQ(e);return[Vd("github.secretPair",{accessKey:t.accessKey,secretKey:t.secretKey}),Vd("github.sessionToken",{sessionToken:t.sessionToken})]}function ez(e){return e==="byteplus"?"BytePlus":"Volcengine"}function tz(e,t={}){return{repository:"",baseBranch:"main",projectPath:".",runtimeName:"",runtimeId:"",modelName:"",modelBaseUrl:y4t(e),region:Ji(e),token:"",...t}}function Hje(e){return{repository:e.repository.trim(),baseBranch:e.baseBranch.trim()||"main",region:e.region,token:e.token.trim()}}const v4t={id:"review",kind:"github",category:"development",icon:"github",name:"Automated PR review",description:"Use a GitHub App to review pull requests in an isolated Sandbox.",title:"Automated PR review",subtitle:"Trigger Sandbox reviews through the GitHub App and publish results to pull requests",panel:"Install the GitHub App to target repositories, then enable automated review for each repository.",submitLabel:"Install GitHub App",fields:[],initialValues:({cloudProvider:e})=>tz(e),regionHelp:"",secrets:()=>[],async submit(){throw new Error("PR 自动评审已切换为 GitHub App 授权模式。")}},x4t="https://api.github.com",w4t=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,Ute=/^[A-Za-z0-9][A-Za-z0-9._/-]{0,199}$/,O4t=/^[A-Za-z0-9._/-]+$/;function S4t(e,t,n){const i=String((t==null?void 0:t.message)||"");return e===403&&/workflow/i.test(i)?"GitHub Token 缺少 Workflows 写权限,无法创建或更新 .github/workflows 下的文件":e===401||e===403?V("github.invalidToken"):e===404?V("github.notFound"):e===422?V("github.rejectedCommit"):i.split(n).join("***").trim().slice(0,240)||V("github.requestFailed",{status:e})}async function ug(e,t){const n={Accept:"application/vnd.github+json",Authorization:`Bearer ${t.token}`,"X-GitHub-Api-Version":"2022-11-28"};t.body&&(n["Content-Type"]="application/json");let i;try{i=await fetch(`${x4t}${e}`,{method:t.method||"GET",headers:n,body:t.body?JSON.stringify(t.body):void 0,signal:t.signal})}catch(s){throw t.signal.aborted?s:new Error(V("github.networkFailed"))}const r=await i.json().catch(()=>null);if(!t.expected.includes(i.status))throw new Error(S4t(i.status,r,t.token));return{status:i.status,payload:r}}function uL(e){return e.split("/").map(encodeURIComponent).join("/")}function k4t(e){const t=new TextEncoder().encode(e);let n="";const i=32768;for(let r=0;r({...h,path:iz(h.path,"")})),s=AbortSignal.any([t,AbortSignal.timeout(6e4)]),a=`/repos/${n}`;await ug(`${a}`,{token:e.token,expected:[200],signal:s});const c=(f=(await ug(`${a}/git/ref/heads/${uL(i)}`,{token:e.token,expected:[200],signal:s})).payload.object)==null?void 0:f.sha;if(!c)throw new Error(V("github.missingBaseSha"));const u=E4t(e.branchPrefix);await ug(`${a}/git/refs`,{token:e.token,expected:[201],signal:s,method:"POST",body:{ref:`refs/heads/${u}`,sha:c}});let d=!0;try{for(const p of r){const g=uL(p.path),b=await ug(`${a}/contents/${g}?ref=${encodeURIComponent(i)}`,{token:e.token,expected:[200,404],signal:s});if(p.mustBeNew&&b.status===200)throw new Error(V("github.fileAlreadyExists",{path:p.path}));if(b.status===200&&!b.payload.sha)throw new Error(V("github.pathNotUpdatable",{path:p.path}));await ug(`${a}/contents/${g}`,{token:e.token,expected:[200,201],signal:s,method:"PUT",body:{message:p.commitMessage,content:k4t(p.content),branch:u,...b.payload.sha?{sha:b.payload.sha}:{}}})}const h=await ug(`${a}/pulls`,{token:e.token,expected:[201],signal:s,method:"POST",body:{title:e.title,head:u,base:i,body:e.description}});if(!h.payload.number||!h.payload.html_url)throw new Error(V("github.invalidPullRequest"));return d=!1,{number:h.payload.number,url:h.payload.html_url,branch:u}}finally{d&&await ug(`${a}/git/refs/heads/${uL(u)}`,{token:e.token,expected:[204],signal:AbortSignal.timeout(15e3),method:"DELETE"}).catch(()=>{})}}async function C4t(e,t){const n=await Tn("/web/github/pull-request-reviews",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await HE(n);const i=await n.json();if(i.status!=="started"||typeof i.sessionId!="string"||!i.sessionId||typeof i.displayName!="string")throw new Error("PR 评审服务返回了无效结果。");return i}async function T4t(e){const t=await Tn("/web/github/app/config",{method:"GET",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await HE(t);const n=await t.json();if(typeof n.configured!="boolean"||typeof n.appSlug!="string"||typeof n.installUrl!="string"||typeof n.reason!="string")throw new Error("GitHub App 配置响应格式无效。");return n}async function A4t(e,t){var s;const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)});(s=t.query)!=null&&s.trim()&&n.set("q",t.query.trim());const i=await Tn(`/web/github/app/repositories?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await HE(i);const r=await i.json();if(!Array.isArray(r.repositories)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.repositories.some(a=>typeof a!="object"||a===null||typeof a.installationId!="number"||typeof a.account!="string"||typeof a.fullName!="string"||typeof a.htmlUrl!="string"||typeof a.private!="boolean"||typeof a.reviewEnabled!="boolean"))throw new Error("GitHub App 仓库列表响应格式无效。");return r}async function _4t(e,t){const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)}),i=await Tn(`/web/github/app/review-records?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await HE(i);const r=await i.json();if(!Array.isArray(r.records)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.records.some(s=>typeof s!="object"||s===null||typeof s.id!="string"||typeof s.repository!="string"||typeof s.pullRequestUrl!="string"||typeof s.pullRequestNumber!="number"||!["started","completed","ignored","failed"].includes(String(s.status))||!["manual","webhook"].includes(String(s.trigger))||typeof s.createdAt!="string"||typeof s.deliveryId!="string"||typeof s.action!="string"||typeof s.sessionId!="string"||typeof s.displayName!="string"||typeof s.reason!="string"))throw new Error("PR 评审记录响应格式无效。");return r}async function N4t(e,t){const n=await Tn("/web/github/app/review-repositories",{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await HE(n);const i=await n.json();if(!Array.isArray(i.repositories)||i.repositories.some(r=>typeof r!="string"))throw new Error("GitHub App 评审仓库保存响应格式无效。");return i.repositories}async function HE(e){const t=await e.text().catch(()=>"");try{const n=JSON.parse(t),i=typeof n.detail=="object"&&n.detail?n.detail.message:n.detail??n.message??n.error,r=typeof i=="string"?i:"";return new Error(r||`PR 评审发起失败(HTTP ${e.status})`)}catch{return new Error(t||`PR 评审发起失败(HTTP ${e.status})`)}}const j4t=/^[A-Za-z0-9_-]+$/,Wje=4,cj=64,uj=6,zte="agent-runtime";function Gje(e){const t=e.trim();if(!t)return zte;let n=t.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,cj);return n?(n.lengthQt(`validation.runtimeName.${n}`)){return e?j4t.test(e)?e.lengthcj?t("length"):null:t("characters"):t("required")}const P4t=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/,D4t="cn-hongkong";function M4t(e){const t=qE(e.runtimeName,n=>Vd(`github.validation.runtimeName.${n}`));if(t)throw new Error(t);if(!P4t.test(e.runtimeId))throw new Error(Vd("github.validation.runtimeId"))}function Xje(e){M4t(e);const t=e.cloudProvider??"volcengine",n=JQ(t),i=t==="byteplus"?` VOLCENGINE_ACCESS_KEY: \${{ secrets.${n.accessKey} }} VOLCENGINE_SECRET_KEY: \${{ secrets.${n.secretKey} }} VOLCENGINE_SESSION_TOKEN: \${{ secrets.${n.sessionToken} }} @@ -1047,7 +1047,7 @@ __pycache__/ Dockerfile .dockerignore README.md -`};return Object.fromEntries(Object.entries(n).map(([i,r])=>[i,r.split("__PROJECT_NAME__").join(e)]))}const q4t={id:"template",kind:"github",category:"development",icon:"github",name:"Import starter project",description:"Create a minimal Agent project in your repository with continuous delivery to AgentKit Runtime.",title:"Import starter project",subtitle:"Add a ready-to-run basic Agent and continuous delivery configuration to your repository",panel:"This creates a pull request containing the basic project and AgentKit Runtime delivery workflow.",submitLabel:"Import template and create PR",fields:[Bje,Uje,{name:"projectPath",label:"Agent project directory",placeholder:"agentkit-basic-agent",help:"The basic project will be added here; app.py mounts the complete Studio App Server and serves as the entry point",required:!0},Qje,zje],initialValues:({cloudProvider:e})=>tz(e,{projectPath:"agentkit-basic-agent"}),regionHelp:"Must match the target Runtime region",secrets:({cloudProvider:e})=>Vje(e),submit(e,t,n){const i=Hje(e),r=nz(i.repository),s=iz(e.projectPath,"agentkit-basic-agent"),a=s==="."?r.split("/").slice(-1)[0]||"agentkit-basic-agent":s.split("/").slice(-1)[0]||"agentkit-basic-agent",l=Object.entries(H4t(a,t.cloudProvider)).map(([c,u])=>({path:$4t(s,c),content:u,commitMessage:"feat: import AgentKit basic template",mustBeNew:!0}));return l.push({path:F4t(s),content:Xje({baseBranch:i.baseBranch,projectPath:s,runtimeName:e.runtimeName.trim(),runtimeId:e.runtimeId.trim(),region:i.region,cloudProvider:t.cloudProvider}),commitMessage:"feat: add AgentKit Runtime delivery",mustBeNew:!0}),qje({...i,repository:r,files:l,branchPrefix:"feat/agentkit-basic-template",title:Vd("cards.template.pullRequest.title"),description:Vd("cards.template.pullRequest.description",{provider:ez(t.cloudProvider)})},n)}},W4t={id:"website-integration",kind:"website-integration",category:"channels",icon:"website-integration",name:"Website integration",description:"Embed an AgentKit Runtime on your website as a floating chat window."},Vte=[{id:"development",label:"Development"},{id:"channels",label:"Messaging channels"}],Yje=[m4t,q4t,L4t,v4t,g4t,W4t],G4t=new Map(Yje.map(e=>[e.id,e]));function K4t(e){const t=G4t.get(e);if(!t)throw new Error(`Unknown automation: ${e}`);return t}function X4t(e){const t=K4t(e);if(t.kind!=="github")throw new Error(`Automation is not backed by GitHub: ${e}`);return t}function Hte(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 Y4t(e){return o.jsxs("svg",{viewBox:"0 0 36 36",fill:"none","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.5",y:"5",width:"18",height:"18",rx:"5",fill:"currentColor",opacity:"0.1"}),o.jsx("rect",{x:"3.5",y:"5",width:"18",height:"18",rx:"5",stroke:"currentColor",strokeWidth:"1.6"}),o.jsx("path",{d:"m9.2 11.2-2.8 2.7 2.8 2.7M12.1 17.4h4.3",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("circle",{cx:"26.5",cy:"12",r:"3",fill:"hsl(var(--background))",stroke:"currentColor",strokeWidth:"1.6"}),o.jsx("circle",{cx:"27",cy:"26.5",r:"3",fill:"hsl(var(--background))",stroke:"currentColor",strokeWidth:"1.6"}),o.jsx("path",{d:"M21.5 12h2M19.3 21l5.6 3.8M27 15v8.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function Z4t(e){return o.jsxs("svg",{viewBox:"0 0 36 36",fill:"none","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.5",y:"5",width:"22",height:"18",rx:"4",stroke:"currentColor",strokeWidth:"1.6"}),o.jsx("path",{d:"M4.5 10h20M9 7.5h.1M12 7.5h.1",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),o.jsx("path",{d:"M18 18.5c0-3 2.5-5.5 5.5-5.5h3c3 0 5.5 2.5 5.5 5.5v5c0 3-2.5 5.5-5.5 5.5H25l-4 3v-3.6a5.5 5.5 0 0 1-3-4.9v-5Z",fill:"hsl(var(--background))",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),o.jsx("path",{d:"M22 19.5h6M22 23h4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function J4t({onOpen:e}){var d;const{t}=Ae("automations"),[n,i]=m.useState("development"),[r,s]=m.useState(""),a=m.useDeferredValue(r),l=m.useMemo(()=>{const f=a.trim().toLocaleLowerCase();return Yje.filter(h=>h.category===n).filter(h=>!f||`${t(`cards.${h.id}.name`)} ${t(`cards.${h.id}.description`)}`.toLocaleLowerCase().includes(f))},[n,a,t]),c=(d=Vte.find(f=>f.id===n))==null?void 0:d.id,u=p4t(window.location.hostname);return o.jsxs("div",{className:"applications-page",children:[o.jsxs("header",{className:"applications-header",children:[o.jsxs("div",{children:[o.jsx("h1",{children:t("title")}),o.jsx("p",{children:t("description")})]}),o.jsxs("label",{className:"applications-search",children:[o.jsx(Hte,{}),o.jsx("input",{type:"search","aria-label":t("search"),value:r,onChange:f=>s(f.target.value),placeholder:t("search")})]})]}),o.jsx("nav",{className:"applications-categories","aria-label":t("categoriesLabel"),children:Vte.map(f=>o.jsx("button",{type:"button",className:n===f.id?"is-active":"","aria-pressed":n===f.id,onClick:()=>i(f.id),children:t(`categories.${f.id}`)},f.id))}),o.jsx("section",{className:"applications-results","aria-label":t("resultsLabel",{category:t(`categories.${c}`)}),children:l.length?o.jsx("div",{className:"applications-grid",children:l.map(f=>{const h=f.id==="coding-agents"&&!u,p=h?"coding-agents-local-only-tooltip":void 0;return o.jsxs("div",{className:`application-card-wrap${h?" is-disabled":""}`,tabIndex:h?0:void 0,"aria-describedby":p,children:[o.jsxs("button",{type:"button",className:"application-card",onClick:()=>e(f.id),"aria-label":t("open",{name:t(`cards.${f.id}.name`)}),disabled:h,children:[f.icon==="feishu"?o.jsx("img",{className:"application-card-icon application-card-brand-icon",src:UI,alt:"","aria-hidden":"true"}):f.icon==="coding-agents"?o.jsx(Y4t,{className:"application-card-icon"}):f.icon==="website-integration"?o.jsx(Z4t,{className:"application-card-icon"}):o.jsx(XQ,{className:"application-card-icon"}),o.jsxs("div",{className:"application-card-copy",children:[o.jsxs("div",{className:"application-card-title",children:[o.jsx("h2",{children:t(`cards.${f.id}.name`)}),f.badge?o.jsx("span",{className:`application-card-badge is-${f.badgeTone||"default"}`,children:t(`cards.${f.id}.badge`,{defaultValue:f.badge})}):null]}),o.jsx("p",{children:t(`cards.${f.id}.description`)})]})]}),h?o.jsx("span",{id:p,className:"application-card-tooltip",role:"tooltip",children:t("localOnly")}):null]},f.id)})}):o.jsxs("div",{className:"applications-empty",role:"status",children:[o.jsx(Hte,{}),o.jsx("h2",{children:t("emptyTitle")}),o.jsx("p",{children:t("emptyDescription")})]})})]})}const e6t="_Container_1bl61_1",t6t="_Track_1bl61_16",n6t="_Thumb_1bl61_56",i6t="_Label_1bl61_78",y2={Container:e6t,Track:t6t,Thumb:n6t,Label:i6t},E8=({className:e,label:t,id:n,disabled:i,labelPosition:r="end",...s})=>{const a=m.useId(),l=n??a;return o.jsxs("div",{className:pi(y2.Container,e),"data-disabled":i?"":void 0,"data-has-label":t?"":void 0,"data-label-position":r,children:[o.jsx(pWe,{id:l,className:y2.Track,disabled:i,...s,children:o.jsx(gWe,{className:y2.Thumb})}),t&&o.jsx("label",{htmlFor:l,className:y2.Label,children:t})]})};function Lb({message:e,className:t="",onRetry:n,retryLabel:i,defaultExpanded:r=!0}){const{t:s}=Ae("ui"),a=i??s("deploymentError.retryDeployment"),[l,c]=m.useState(r),[u,d]=m.useState(!1),f=async()=>{if(!(!n||u)){d(!0);try{await n()}finally{d(!1)}}};return o.jsxs("div",{className:`deploy-error-message${l?" is-expanded":""}${t?` ${t}`:""}`,role:"alert",children:[o.jsx("p",{className:"deploy-error-message-text",children:e}),o.jsxs("div",{className:"deploy-error-message-actions",children:[n&&o.jsxs(zt,{type:"button",className:"deploy-error-retry",color:"danger",variant:"soft",size:"sm",pill:!1,loading:u,onClick:()=>void f(),children:[!u&&o.jsx(NFe,{}),u?s("deploymentError.retrying"):a]}),o.jsx(zt,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,pill:!1,title:s(l?"deploymentError.collapse":"deploymentError.expand"),"aria-label":s(l?"deploymentError.collapse":"deploymentError.expand"),onClick:()=>c(h=>!h),children:l?o.jsx(DFe,{}):o.jsx(BFe,{})}),o.jsx(K7,{copyValue:e,color:"secondary",variant:"ghost",size:"sm",uniform:!0,pill:!1,title:s("deploymentError.copy"),"aria-label":s("deploymentError.copy"),children:({copied:h})=>h?o.jsx(Lv,{}):o.jsx(IF,{})})]})]})}const r6t={queued:"status.queued",pending:"status.pending",running:"status.running",retrying:"status.retrying",success:"status.success",failed:"status.failed",cancelled:"status.cancelled",skipped:"status.skipped"},Zje=["weekdays.sunday","weekdays.monday","weekdays.tuesday","weekdays.wednesday","weekdays.thursday","weekdays.friday","weekdays.saturday"];function C8(e){if(!e)return"-";const t=new Date(e);return Number.isNaN(t.getTime())?e:new Intl.DateTimeFormat(sn.resolvedLanguage,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(t).replace(/\//g,"-")}function s6t(e){if(!e.startedAt)return"-";const t=Date.parse(e.startedAt),n=e.finishedAt?Date.parse(e.finishedAt):Date.now();if(!Number.isFinite(t)||!Number.isFinite(n)||n{const d=i.current;!d||r.current||c(d.scrollHeight>d.clientHeight+1)},[]);return m.useLayoutEffect(()=>{r.current=s,s||u()},[s,u,e]),m.useEffect(()=>{const d=i.current;if(!d||typeof ResizeObserver>"u")return;const f=new ResizeObserver(u);return f.observe(d),()=>f.disconnect()},[u]),o.jsxs("div",{className:`cronjobs-run-output-body${s?" is-expanded":""}`,children:[o.jsx("p",{id:n,ref:i,children:e}),l?o.jsx(zt,{type:"button",className:"cronjobs-run-output-toggle",color:"secondary",variant:"ghost",size:"sm",pill:!1,"aria-expanded":s,"aria-controls":n,onClick:()=>a(d=>!d),children:t(s?"actions.collapse":"actions.expand")}):null]})}const A8="Asia/Shanghai",o6t=3e3,l6t=["Asia/Shanghai","Asia/Singapore","Asia/Tokyo","Europe/London","America/Los_Angeles","America/New_York","UTC"];function Ot(e,t){return sn.t(e,{ns:"cronjobs",...t})}function c6t(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||A8}catch{return A8}}function u6t(){const e=c6t(),t=new Date(Date.now()+24*60*60*1e3);return t.setSeconds(0,0),{name:"",runtimeId:"",prompt:"",scheduleType:"daily",onceAt:new Date(t.getTime()-t.getTimezoneOffset()*6e4).toISOString().slice(0,16),time:"09:00",weekday:1,cron:"0 9 * * *",timezone:e,enabled:!0}}function d6t(e){return{name:e.name,runtimeId:e.runtimeId,prompt:e.prompt,scheduleType:e.schedule.type,onceAt:e.schedule.onceAt??"",time:e.schedule.time??"09:00",weekday:e.schedule.weekday??1,cron:e.schedule.cron??"0 9 * * *",timezone:e.schedule.timezone||A8,enabled:e.enabled}}function f6t({run:e}){const t=e?e.status==="success"?"success":e.status==="failed"?"danger":["queued","pending","running","retrying"].includes(e.status)?"info":"secondary":"secondary";return o.jsx(ba,{className:"cronjobs-status",color:t,variant:"soft",size:"sm",pill:!0,children:Ot(e?r6t[e.status]:"status.notRun")})}function qte({job:e,runtimes:t,cloudProvider:n,busy:i,onClose:r,onSubmit:s}){const[a,l]=m.useState(()=>e?d6t(e):u6t()),[c,u]=m.useState(""),[d,f]=m.useState(!1),h=m.useRef(null),p=m.useRef(null),g=m.useRef(null),b=i||d,v=m.useRef(b),y=m.useRef(r),x=m.useMemo(()=>Array.from(new Set([a.timezone,...l6t])),[a.timezone]),O=m.useMemo(()=>t.map(E=>({value:E.runtimeId,label:E.name,description:xh(E.region,n)})),[n,t]),w=m.useMemo(()=>Zje.map((E,C)=>({value:String(C),label:Ot(E)})),[]),k=m.useMemo(()=>x.map(E=>({value:E,label:E})),[x]);m.useEffect(()=>{v.current=b,y.current=r},[b,r]),m.useEffect(()=>{var _;const E=document.body.style.overflow,C=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(_=p.current)==null||_.focus();const N=j=>{var R,L;if(j.key==="Escape"&&!v.current){y.current();return}if(j.key!=="Tab")return;const A=Array.from(((R=h.current)==null?void 0:R.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))??[]).filter(M=>!M.hidden&&M.getClientRects().length>0);if(A.length===0){j.preventDefault();return}const F=A[0],T=A[A.length-1],P=document.activeElement;j.shiftKey&&(P===F||!((L=h.current)!=null&&L.contains(P)))?(j.preventDefault(),T.focus()):!j.shiftKey&&P===T&&(j.preventDefault(),F.focus())};return window.addEventListener("keydown",N),()=>{document.body.style.overflow=E,window.removeEventListener("keydown",N),C!=null&&C.isConnected&&C.focus()}},[]);const S=async E=>{E.preventDefault();const C=a.name.trim(),N=a.prompt.trim(),_=t.find(A=>A.runtimeId===a.runtimeId);if(!C)return u(Ot("validation.nameRequired"));if(!_)return u(Ot("validation.runtimeRequired"));if(!N)return u(Ot("validation.promptRequired"));if(a.scheduleType==="once"&&!a.onceAt||(a.scheduleType==="daily"||a.scheduleType==="weekly")&&!a.time)return u(Ot("validation.timeRequired"));const j=a.cron.trim().split(/\s+/);if(a.scheduleType==="cron"&&j.length!==5)return u(Ot("validation.cronFields"));u(""),f(!0);try{let A=(e==null?void 0:e.runtimeId)===_.runtimeId?e.agentName.trim():"";if(!A){const[F]=await zk("","",{runtimeId:_.runtimeId,region:_.region});A=(F==null?void 0:F.trim())??""}if(!A)throw new Error(Ot("validation.runtimeAppMissing"));await s({name:C,runtimeId:_.runtimeId,runtimeName:_.name,agentName:A,region:_.region,prompt:N,enabled:a.enabled,schedule:{type:a.scheduleType,timezone:a.timezone,...a.scheduleType==="once"?{onceAt:a.onceAt}:{},...a.scheduleType==="daily"?{time:a.time}:{},...a.scheduleType==="weekly"?{time:a.time,weekday:a.weekday}:{},...a.scheduleType==="cron"?{cron:a.cron.trim()}:{}}})}catch(A){u(A instanceof Error?A.message:String(A)),window.requestAnimationFrame(()=>{var F;return(F=g.current)==null?void 0:F.focus()})}finally{f(!1)}};return o.jsx("div",{className:"cronjobs-drawer-backdrop",onMouseDown:E=>{E.target===E.currentTarget&&!b&&r()},children:o.jsxs("aside",{ref:h,className:"cronjobs-drawer",role:"dialog","aria-modal":"true","aria-labelledby":"cronjobs-drawer-title",children:[o.jsxs("header",{className:"cronjobs-drawer-head",children:[o.jsxs("div",{children:[o.jsx("h2",{id:"cronjobs-drawer-title",children:Ot(e?"drawer.editTitle":"drawer.createTitle")}),o.jsx("p",{children:Ot("drawer.description")})]}),o.jsx(zt,{type:"button",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:r,disabled:b,"aria-label":Ot("actions.closeDrawer"),children:o.jsx(PF,{})})]}),o.jsxs("form",{className:"cronjobs-form",onSubmit:E=>void S(E),children:[o.jsxs("div",{className:"cronjobs-form-scroll",children:[o.jsxs("label",{className:"cronjobs-field",children:[o.jsx("span",{children:Ot("fields.name")}),o.jsx(qr,{ref:p,size:"lg",value:a.name,maxLength:80,invalid:!!c&&!a.name.trim(),onChange:E=>l({...a,name:E.target.value}),placeholder:Ot("fields.namePlaceholder")})]}),o.jsxs("label",{className:"cronjobs-field",children:[o.jsx("span",{children:Ot("fields.runtimeAgent")}),o.jsx(Ls,{value:a.runtimeId,options:O,size:"lg",disabled:t.length===0,placeholder:Ot(t.length?"fields.runtimePlaceholder":"fields.noRuntime"),onChange:E=>l({...a,runtimeId:E.value})}),o.jsx("small",{children:Ot("fields.runtimeHelp")})]}),o.jsxs("label",{className:"cronjobs-field",children:[o.jsx("span",{children:Ot("fields.prompt")}),o.jsx(Rm,{value:a.prompt,rows:5,maxRows:10,autoResize:!0,maxLength:2e4,invalid:!!c&&!a.prompt.trim(),onChange:E=>l({...a,prompt:E.target.value}),placeholder:Ot("fields.promptPlaceholder")}),o.jsxs("small",{className:"cronjobs-character-count",children:[a.prompt.length.toLocaleString()," / 20,000"]})]}),o.jsxs("fieldset",{className:"cronjobs-fieldset",children:[o.jsx("legend",{children:Ot("fields.schedule")}),o.jsxs(zc,{className:"cronjobs-schedule-types",value:a.scheduleType,size:"lg",block:!0,"aria-label":Ot("fields.scheduleType"),onChange:E=>l({...a,scheduleType:E}),children:[o.jsx(zc.Option,{value:"once",children:Ot("scheduleTypes.once")}),o.jsx(zc.Option,{value:"daily",children:Ot("scheduleTypes.daily")}),o.jsx(zc.Option,{value:"weekly",children:Ot("scheduleTypes.weekly")}),o.jsx(zc.Option,{value:"cron",children:"Cron"})]}),a.scheduleType==="once"?o.jsxs("label",{className:"cronjobs-field",children:[o.jsx("span",{children:Ot("fields.runAt")}),o.jsx(qr,{size:"lg",type:"datetime-local",value:a.onceAt,onChange:E=>l({...a,onceAt:E.target.value})})]}):null,a.scheduleType==="daily"?o.jsxs("label",{className:"cronjobs-field",children:[o.jsx("span",{children:Ot("fields.dailyTime")}),o.jsx(qr,{size:"lg",type:"time",value:a.time,onChange:E=>l({...a,time:E.target.value})})]}):null,a.scheduleType==="weekly"?o.jsxs("div",{className:"cronjobs-inline-fields",children:[o.jsxs("label",{className:"cronjobs-field",children:[o.jsx("span",{children:Ot("fields.weekday")}),o.jsx(Ls,{value:String(a.weekday),options:w,size:"lg",onChange:E=>l({...a,weekday:Number(E.value)})})]}),o.jsxs("label",{className:"cronjobs-field",children:[o.jsx("span",{children:Ot("fields.runAt")}),o.jsx(qr,{size:"lg",type:"time",value:a.time,onChange:E=>l({...a,time:E.target.value})})]})]}):null,a.scheduleType==="cron"?o.jsxs("label",{className:"cronjobs-field",children:[o.jsx("span",{children:Ot("fields.cronExpression")}),o.jsx(qr,{size:"lg",value:a.cron,onChange:E=>l({...a,cron:E.target.value}),placeholder:"0 9 * * *"}),o.jsx("small",{children:Ot("fields.cronHelp")})]}):null,o.jsxs("label",{className:"cronjobs-field",children:[o.jsx("span",{children:Ot("fields.timezone")}),o.jsx(Ls,{value:a.timezone,options:k,size:"lg",onChange:E=>l({...a,timezone:E.value})})]})]}),o.jsxs("div",{className:"cronjobs-switch-row",children:[o.jsxs("span",{children:[o.jsx("strong",{children:Ot("fields.enableAfterCreate")}),o.jsx("small",{children:Ot("fields.enableHelp")})]}),o.jsx(E8,{checked:a.enabled,onCheckedChange:E=>l({...a,enabled:E}),"aria-label":Ot("fields.enableAfterCreate")})]}),c?o.jsx("div",{ref:g,className:"cronjobs-inline-error",tabIndex:-1,children:o.jsx(Eb,{color:"danger",variant:"soft",description:c})}):null]}),o.jsxs("footer",{className:"cronjobs-drawer-actions",children:[o.jsx(zt,{type:"button",color:"secondary",variant:"ghost",size:"lg",pill:!1,onClick:r,disabled:b,children:Ot("actions.cancel")}),o.jsx(zt,{type:"submit",color:"primary",size:"lg",pill:!1,loading:b,disabled:t.length===0,"aria-busy":b||void 0,children:Ot(d?"actions.connectingRuntime":i?"actions.saving":e?"actions.saveChanges":"actions.createTask")})]})]})]})})}function h6t({jobs:e,canCreate:t,onCreate:n,onSelect:i}){return o.jsxs(Vx,{children:[o.jsx(Cb,{icon:o.jsx(ybe,{}),onClick:n,disabled:!t,title:Ot(t?"actions.createScheduledTask":"fields.noRuntime"),children:Ot("actions.createScheduledTask")}),e.map(r=>{const s=Jje(r.schedule);return o.jsx(pE,{className:"cronjobs-card",title:r.name,status:o.jsx(ba,{color:r.enabled?"success":"secondary",variant:"soft",size:"sm",pill:!0,children:Ot(r.enabled?"status.enabled":"status.paused")}),description:r.prompt,metadata:[{label:Ot("fields.schedule"),value:s,title:s}],detailAction:{label:Ot("actions.viewDetails"),onClick:()=>i(r)}},r.jobId)})]})}function p6t({job:e,runs:t,runsLoading:n,runsError:i,busyAction:r,onBack:s,onEdit:a,onToggle:l,onRun:c,onDelete:u,onCancel:d,onRetryRun:f,onRetryRuns:h}){const p=t.find(b=>b.status==="queued"||b.status==="running"||b.status==="retrying"||b.status==="pending")??(T8(e)?e.latestRun:void 0),g=r.includes(e.jobId);return o.jsxs("div",{className:"cronjobs-detail",children:[o.jsxs("header",{className:"cronjobs-detail-head",children:[o.jsxs("div",{className:"cronjobs-detail-title",children:[o.jsx(zt,{type:"button",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:s,"aria-label":Ot("actions.backToList"),children:o.jsx(AFe,{})}),o.jsxs("div",{children:[o.jsx("h1",{children:e.name}),o.jsxs("p",{children:[e.runtimeName||e.agentName," · ",Jje(e.schedule)]})]})]}),o.jsxs("div",{className:"cronjobs-detail-actions",children:[o.jsxs(zt,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:a,disabled:g,children:[o.jsx(FFe,{}),Ot("actions.edit")]}),o.jsxs(zt,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:l,disabled:g,children:[e.enabled?o.jsx(HFe,{}):o.jsx(yW,{}),Ot(e.enabled?"actions.pause":"actions.enable")]}),p?o.jsxs(zt,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>d(p),disabled:g||!!p.cancellationRequestedAt,children:[o.jsx(XFe,{}),Ot(p.cancellationRequestedAt?p.status==="queued"?"actions.cancelling":"actions.stopping":p.status==="queued"?"actions.cancelQueue":"actions.stopRun")]}):o.jsxs(zt,{type:"button",color:"primary",size:"lg",pill:!1,onClick:c,disabled:g||!e.enabled,children:[o.jsx(yW,{}),Ot("actions.runNow")]}),o.jsx(Uo,{compact:!0,content:Ot(p?p.status==="queued"?"actions.cancelQueueFirst":"actions.stopRunFirst":"actions.deleteTask"),children:o.jsxs(zt,{type:"button",color:"danger",variant:"ghost",size:"lg",pill:!1,onClick:u,disabled:g||!!p,"aria-label":Ot("actions.deleteTask"),children:[o.jsx(MFe,{}),Ot("actions.delete")]})})]})]}),o.jsxs("div",{className:"cronjobs-detail-scroll",children:[o.jsxs("section",{className:"cronjobs-summary-grid","aria-label":Ot("detail.configuration"),children:[o.jsxs("dl",{children:[o.jsxs("div",{children:[o.jsx("dt",{children:Ot("detail.status")}),o.jsx("dd",{children:Ot(e.enabled?"status.enabled":"status.paused")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:Ot("detail.nextRun")}),o.jsx("dd",{children:e.enabled?C8(e.nextRunAt):"-"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:Ot("detail.runtime")}),o.jsx("dd",{title:e.runtimeName,children:e.runtimeName})]}),o.jsxs("div",{children:[o.jsx("dt",{children:Ot("detail.region")}),o.jsx("dd",{children:e.region})]})]}),o.jsxs("div",{className:"cronjobs-prompt",children:[o.jsx("span",{children:Ot("fields.prompt")}),o.jsx("p",{children:e.prompt})]})]}),o.jsxs("section",{className:"cronjobs-history",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("h2",{children:Ot("history.title")}),o.jsx("p",{children:Ot("history.description")})]}),o.jsx(Uo,{compact:!0,content:Ot("actions.refresh"),children:o.jsx(zt,{type:"button",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:h,disabled:n,"aria-label":Ot("actions.refreshHistory"),children:o.jsx(Kj,{})})})]}),n&&t.length===0?o.jsx(Ud,{}):i?o.jsx(Eb,{className:"cronjobs-history-alert",color:"danger",variant:"soft",title:Ot("history.loadFailed"),description:i,actions:o.jsx(zt,{type:"button",color:"danger",variant:"soft",size:"sm",pill:!1,onClick:h,children:Ot("actions.retry")})}):t.length===0?o.jsxs(En,{className:"cronjobs-history-state",fill:"none",children:[o.jsx(En.Icon,{children:o.jsx(RF,{})}),o.jsx(En.Title,{children:Ot("history.emptyTitle")}),o.jsx(En.Description,{children:Ot("history.emptyDescription")})]}):o.jsx("div",{className:"cronjobs-runs",children:t.map(b=>o.jsxs("article",{className:"cronjobs-run",children:[o.jsxs("div",{className:"cronjobs-run-main",children:[o.jsx(f6t,{run:b}),o.jsxs("div",{children:[o.jsx("strong",{children:C8(b.startedAt||b.scheduledAt)}),o.jsxs("span",{children:[Ot("history.duration",{duration:s6t(b)}),b.runtimeVersion?` · Runtime v${b.runtimeVersion}`:""]})]})]}),b.sessionId?o.jsxs("div",{className:"cronjobs-run-meta",children:[o.jsx("span",{children:Ot("history.session")}),o.jsx("strong",{title:b.sessionId,children:b.sessionId})]}):null,b.output?o.jsxs("div",{className:"cronjobs-run-output",children:[o.jsx("span",{children:Ot("history.finalAnswer")}),o.jsx(a6t,{output:b.output})]}):null,b.error?o.jsxs("div",{className:"cronjobs-run-output is-error",children:[o.jsx("span",{children:Ot("history.errorDetails")}),o.jsx(Lb,{message:b.error,className:"cronjobs-run-error-detail",defaultExpanded:!1,onRetry:b.status==="failed"?f:void 0,retryLabel:Ot("actions.rerun")})]}):null,b.status==="queued"||b.status==="running"||b.status==="retrying"||b.status==="pending"?o.jsx(zt,{type:"button",className:"cronjobs-run-cancel",color:"danger",variant:"soft",size:"sm",pill:!1,onClick:()=>d(b),disabled:g||!!b.cancellationRequestedAt,loading:!!b.cancellationRequestedAt,children:Ot(b.cancellationRequestedAt?"actions.stopping":b.status==="queued"?"actions.cancelQueue":"actions.stop")}):null]},b.runId))})]})]})]})}function m6t({cloudProvider:e}){Ae("cronjobs");const[t,n]=m.useState([]),[i,r]=m.useState([]),[s,a]=m.useState(!0),[l,c]=m.useState(""),[u,d]=m.useState(""),[f,h]=m.useState(void 0),[p,g]=m.useState([]),[b,v]=m.useState(!1),[y,x]=m.useState(""),[O,w]=m.useState(""),[k,S]=m.useState("all"),[E,C]=m.useState(""),[N,_]=m.useState(null),[j,A]=m.useState(""),F=t.find(B=>B.jobId===u),T=k==="all"?t:t.filter(B=>k==="enabled"?B.enabled:!B.enabled),P=m.useCallback(async B=>{a(!0),c("");try{const[ee,le]=await Promise.all([k4(B),_x({scope:"all",region:"all",pageSize:100})]);if(B!=null&&B.aborted)return;n(ee),r(le.runtimes.filter(se=>se.status.toLowerCase()==="ready"))}catch(ee){if(B!=null&&B.aborted)return;console.warn("Unable to load scheduled tasks",ee),c(Ot("page.loadFailedDescription"))}finally{B!=null&&B.aborted||a(!1)}},[]);m.useEffect(()=>{const B=new AbortController;return P(B.signal),()=>B.abort()},[P]);const R=m.useCallback(async(B,ee)=>{v(!0),x("");try{const le=await E4(B,ee);ee!=null&&ee.aborted||g(le)}catch(le){ee!=null&&ee.aborted||(console.warn("Unable to load scheduled-task history",le),x(Ot("history.loadFailedDescription")))}finally{ee!=null&&ee.aborted||v(!1)}},[]);m.useEffect(()=>{if(!u){g([]),x("");return}const B=new AbortController;return R(u,B.signal),()=>B.abort()},[R,u]);const L=t.some(T8);m.useEffect(()=>{!L&&E===Ot("notices.queued")&&C("")},[L,E]),m.useEffect(()=>{if(!L)return;const B=new AbortController,ee=async()=>{try{const[se,re]=await Promise.all([k4(B.signal),u?E4(u,B.signal):Promise.resolve(null)]);if(B.signal.aborted)return;n(se),re&&g(re),se.some(T8)||C("")}catch(se){B.signal.aborted||C(se instanceof Error?se.message:String(se))}},le=window.setInterval(()=>void ee(),o6t);return()=>{window.clearInterval(le),B.abort()}},[L,u]);const M=B=>n(ee=>ee.some(le=>le.jobId===B.jobId)?ee.map(le=>le.jobId===B.jobId?B:le):[B,...ee]),U=async(B,ee,le,se=!1)=>{w(B),C("");try{await ee(),C(le)}catch(re){const ge=re instanceof Error?re.message:String(re);if(se)throw new Error(ge);C(ge)}finally{w("")}},I=async B=>{const ee=f??null;await U(`${(ee==null?void 0:ee.jobId)??"new"}:save`,async()=>{const le=ee?await q0e(ee.jobId,B):await H0e(B);M(le),h(void 0),ee&&d(le.jobId)},Ot(ee?"notices.updated":"notices.created"),!0)},H=B=>void U(`${B.jobId}:toggle`,async()=>M(await W0e(B.jobId,!B.enabled)),Ot(B.enabled?"notices.paused":"notices.enabled")),K=(B,ee)=>U(`${B.jobId}:run`,async()=>{const le=await G0e(B.jobId);M({...B,latestRun:le}),u===B.jobId&&g(se=>[le,...se.filter(re=>re.runId!==le.runId)])},ee),Q=B=>void K(B,Ot("notices.queued")),q=()=>{if(!N)return;A("");const B=N;B.kind==="delete"?U(`${B.job.jobId}:delete`,async()=>{await X0e(B.job.jobId),n(ee=>ee.filter(le=>le.jobId!==B.job.jobId)),d(""),_(null)},Ot("notices.deleted"),!0).catch(ee=>{A(ee instanceof Error?ee.message:String(ee))}):U(`${B.job.jobId}:cancel`,async()=>{var le;const ee=await K0e(B.job.jobId,B.run.runId);g(se=>se.map(re=>re.runId===ee.runId?ee:re)),M({...B.job,latestRun:((le=B.job.latestRun)==null?void 0:le.runId)===ee.runId?ee:B.job.latestRun}),_(null)},Ot("notices.cancelRequested"),!0).catch(ee=>{A(ee instanceof Error?ee.message:String(ee))})};return F?o.jsxs(Th,{className:"cronjobs-page","aria-label":Ot("detail.pageLabel"),children:[o.jsx(p6t,{job:F,runs:p,runsLoading:b,runsError:y,busyAction:O,onBack:()=>d(""),onEdit:()=>h(F),onToggle:()=>H(F),onRun:()=>Q(F),onDelete:()=>{A(""),_({kind:"delete",job:F})},onCancel:B=>{A(""),_({kind:"cancel",job:F,run:B})},onRetryRun:()=>K(F,Ot("notices.requeued")),onRetryRuns:()=>void R(F.jobId)}),E?o.jsx("div",{className:"cronjobs-notice",role:"status",children:o.jsx(Eb,{color:"info",variant:"soft",description:E})}):null,f!==void 0?o.jsx(qte,{job:f,runtimes:i,cloudProvider:e,busy:O.endsWith(":save"),onClose:()=>h(void 0),onSubmit:I}):null,N?o.jsx(pc,{title:Ot(N.kind==="delete"?"confirm.deleteTitle":"confirm.cancelTitle"),description:N.kind==="delete"?Ot("confirm.deleteDescription",{name:N.job.name}):Ot("confirm.cancelDescription"),error:j,confirmLabel:Ot(N.kind==="delete"?"actions.deleteTask":"actions.stop"),variant:"danger",busy:O.endsWith(N.kind),onCancel:()=>{A(""),_(null)},onConfirm:q}):null]}):o.jsxs(Th,{className:"cronjobs-page","aria-label":Ot("page.title"),children:[o.jsx(zx,{className:"cronjobs-page-head",title:Ot("page.title")}),o.jsx(Zb,{children:o.jsx(dE,{idPrefix:"cronjobs-filter",ariaLabel:Ot("page.filterLabel"),value:k,items:[{id:"all",label:Ot("filters.all")},{id:"enabled",label:Ot("status.enabled")},{id:"paused",label:Ot("status.paused")}],onChange:S})}),E?o.jsx("div",{className:"cronjobs-banner",role:"status",children:o.jsx(Eb,{color:"info",variant:"soft",description:E})}):null,o.jsx(Jb,{"aria-label":Ot("page.listLabel"),children:s&&t.length===0?o.jsx(Ud,{}):l?o.jsxs(En,{className:"cronjobs-state",fill:"none",children:[o.jsx(En.Icon,{color:"danger",children:o.jsx(RF,{})}),o.jsx(En.Title,{color:"danger",children:Ot("page.loadFailed")}),o.jsx(En.Description,{children:l}),o.jsx(En.ActionRow,{children:o.jsxs(zt,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>void P(),children:[o.jsx(Kj,{}),Ot("actions.retry")]})})]}):o.jsx(h6t,{jobs:T,canCreate:!s&&i.length>0,onCreate:()=>h(null),onSelect:B=>d(B.jobId)})}),f!==void 0?o.jsx(qte,{job:f,runtimes:i,cloudProvider:e,busy:O.endsWith(":save"),onClose:()=>h(void 0),onSubmit:I}):null]})}function eRe({label:e,onClick:t}){return o.jsx("button",{type:"button",className:"page-back-button","aria-label":e,title:e,onClick:t,children:o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m14.5 6-6 6 6 6"})})})}const g6t={volcengine:"https://console.volcengine.com",byteplus:"https://console.byteplus.com"};function Sk(e){return e.trim()}function rz(e){return g6t[e]}function b6t(e){const t=Sk(e);if(!t)return null;let n=t;try{n=new URL(t.includes("://")?t:`https://${t}`).hostname}catch{return null}const i=n.match(/^(.+)\.tos-([a-z0-9-]+)\.(?:volces|bytepluses)\.com$/i);return i?{bucket:i[1],region:i[2]}:null}function y6t(e,t){const n=b6t(t);if(!n)return null;const i=new URLSearchParams({id:n.bucket,region:n.region,type:"objects"});return`${rz(e)}/tos/bucket/setting?${i.toString()}`}function v6t(e,t,n){const i=Sk(t),r=Sk(n);return!i||!r?null:`${rz(e)}/agentkit/region:agentkit+${encodeURIComponent(i)}/builtintools/${encodeURIComponent(r)}/detail`}function x6t(e,t,n){const i=Sk(t),r=Sk(n);return!i||!r?null:`${rz(e)}/identity/region:identity+${encodeURIComponent(i)}/user-pools/${encodeURIComponent(r)}/info`}function lw({href:e,label:t,children:n}){return e?o.jsxs("a",{className:"system-info-resource-link",href:e,target:"_blank",rel:"noreferrer","aria-label":t,title:t,children:[o.jsx("span",{children:n}),o.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("path",{d:"M7.75 5.25h-2.5a1.5 1.5 0 0 0-1.5 1.5v8a1.5 1.5 0 0 0 1.5 1.5h8a1.5 1.5 0 0 0 1.5-1.5v-2.5"}),o.jsx("path",{d:"M10.25 3.75h6v6M16 4 9 11"})]})]}):o.jsx("span",{children:n})}function w6t(e){return e instanceof Error&&e.message.includes("Volcengine credentials not found")}function O6t({spinning:e}){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e?"is-spinning":"",children:o.jsx("path",{d:"M19.5 9A8 8 0 0 0 5 6L3 9m0-5v5h5M4.5 15A8 8 0 0 0 19 18l2-3m0 5v-5h-5"})})}function S6t(){return{busy:!1,error:"",message:""}}function k6t({version:e,localMode:t,role:n,provider:i,region:r,onBack:s}){const{t:a}=Ae("ui"),l=n==="admin",[c,u]=m.useState(""),[d,f]=m.useState([]),[h,p]=m.useState([]),[g,b]=m.useState(null),[v,y]=m.useState(!0),[x,O]=m.useState(""),[w,k]=m.useState(!0),[S,E]=m.useState(""),[C,N]=m.useState(!0),[_,j]=m.useState(""),[A,F]=m.useState(0),[T,P]=m.useState(0),[R,L]=m.useState(0),M=m.useRef(!1),[U,I]=m.useState({}),[H,K]=m.useState({}),[Q,q]=m.useState(""),[B,ee]=m.useState(!0),le=m.useRef(new Set),se=m.useRef(0),re=`${i}:${r}`,ge=m.useRef(re);ge.current=re,m.useEffect(()=>{K({}),I({})},[re]),m.useEffect(()=>(M.current=!0,()=>{M.current=!1}),[]);function W(ae,ue){I(Oe=>({...Oe,[ae]:{...S6t(),...Oe[ae],...ue}}))}async function X(ae){if(!ae.toolId||le.current.has(ae.toolId))return;const ue=re;le.current.add(ae.toolId),se.current+=1,W(ae.toolId,{busy:!0,error:"",message:""});try{const Oe=await dye(ae.kind);if(!M.current||ge.current!==ue)return;se.current+=1,K(Se=>({...Se,[ae.toolId]:Oe.state})),W(ae.toolId,{busy:!1,error:"",message:Oe.updated?a("systemInfo.modelEnvUpdated"):a("systemInfo.modelEnvAlreadyCurrent")})}catch{if(!M.current||ge.current!==ue)return;se.current+=1,W(ae.toolId,{busy:!1,error:a("systemInfo.sandboxUpdateError"),message:""})}finally{le.current.delete(ae.toolId)}}return m.useEffect(()=>{if(!l)return;const ae=new AbortController,ue=++se.current;return q(""),ee(!0),uye(ae.signal).then(Oe=>{ae.signal.aborted||ue!==se.current||K(Object.fromEntries(Oe.map(Se=>[Se.toolId,Se])))}).catch(()=>{!ae.signal.aborted&&ue===se.current&&q(a("systemInfo.versionCheckError"))}).finally(()=>{ae.signal.aborted||ee(!1)}),()=>ae.abort()},[l,i,r,A]),m.useEffect(()=>{if(!Object.values(H).some(ue=>ue.status==="Updating"||ue.status==="Creating"))return;const ae=window.setTimeout(()=>F(ue=>ue+1),5e3);return()=>window.clearTimeout(ae)},[H]),m.useEffect(()=>{if(!l){u(""),f([]),y(!1),O("");return}const ae=new AbortController;return y(!0),O(""),d0e(ae.signal).then(ue=>{ae.signal.aborted||(u(ue.storage.tosAddress),f(ue.sandboxTools))}).catch(ue=>{(ue==null?void 0:ue.name)!=="AbortError"&&O(a("systemInfo.sandboxInfoError"))}).finally(()=>{ae.signal.aborted||y(!1)}),()=>ae.abort()},[l,i,r,A]),m.useEffect(()=>{if(!l){p([]),k(!1),E("");return}const ae=new AbortController;return k(!0),E(""),aR(ae.signal).then(ue=>{p(ue.filter(Oe=>Oe.isCurrent))}).catch(ue=>{if((ue==null?void 0:ue.name)!=="AbortError"){if(t&&w6t(ue)){p([]);return}E(a("systemInfo.userPoolError"))}}).finally(()=>{ae.signal.aborted||k(!1)}),()=>ae.abort()},[l,t,T]),m.useEffect(()=>{if(!l){b(null),N(!1),j("");return}const ae=new AbortController;return N(!0),j(""),N0e(ae.signal).then(b).catch(ue=>{(ue==null?void 0:ue.name)!=="AbortError"&&j(a("systemInfo.environmentResourcesError"))}).finally(()=>{ae.signal.aborted||N(!1)}),()=>ae.abort()},[l,R]),o.jsxs("div",{className:"system-info-page",children:[o.jsxs("header",{className:"system-info-page-header",children:[o.jsx(eRe,{label:a("common.back"),onClick:s}),o.jsxs("div",{children:[o.jsx("h1",{children:a("systemInfo.title")}),o.jsx("p",{children:a("systemInfo.description")})]})]}),o.jsxs("div",{className:"system-info-scroll",children:[o.jsxs("section",{className:"system-info-section","aria-labelledby":"studio-info-title",children:[o.jsx("h2",{id:"studio-info-title",children:a("systemInfo.general")}),o.jsx("dl",{className:"system-info-summary",children:o.jsxs("div",{children:[o.jsx("dt",{children:a("systemInfo.currentVersion")}),o.jsx("dd",{children:e||"—"})]})})]}),l?o.jsxs(o.Fragment,{children:[o.jsxs("section",{className:"system-info-section","aria-labelledby":"storage-info-title",children:[o.jsx("h2",{id:"storage-info-title",children:a("systemInfo.storage")}),v?o.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:o.jsx(An,{as:"span",children:a("systemInfo.loadingStorage")})}):x?o.jsxs("div",{className:"system-info-error",role:"alert",children:[o.jsx("p",{children:x}),o.jsx("button",{type:"button",onClick:()=>F(ae=>ae+1),children:a("common.reload")})]}):o.jsx("dl",{className:"system-info-summary",children:o.jsxs("div",{className:"system-info-resource-row",children:[o.jsx("dt",{children:a("systemInfo.tosAddress")}),o.jsx("dd",{className:`system-info-resource-value${c?"":" is-empty"}`,children:o.jsx(lw,{href:y6t(i,c),label:a("systemInfo.openTosConsole"),children:c||a("common.notConfigured")})})]})})]}),o.jsxs("section",{className:"system-info-section","aria-labelledby":"environment-build-info-title",children:[o.jsx("h2",{id:"environment-build-info-title",children:a("systemInfo.environmentBuild")}),C?o.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:o.jsx(An,{as:"span",children:a("systemInfo.loadingEnvironmentResources")})}):_?o.jsxs("div",{className:"system-info-error",role:"alert",children:[o.jsx("p",{children:_}),o.jsx("button",{type:"button",onClick:()=>L(ae=>ae+1),children:a("common.reload")})]}):g?o.jsxs("dl",{className:"system-info-summary",children:[o.jsxs("div",{className:"system-info-resource-row",children:[o.jsx("dt",{children:a("systemInfo.codePipelineWorkspace")}),o.jsx("dd",{className:"system-info-resource-value",children:o.jsx(lw,{href:g.codePipeline.consoleUrl||null,label:a("systemInfo.openCodePipelineWorkspace"),children:g.codePipeline.workspaceName||g.codePipeline.workspaceId||a("systemInfo.createdOnFirstBuild")})})]}),o.jsxs("div",{className:"system-info-resource-row",children:[o.jsx("dt",{children:a("systemInfo.codePipelinePipeline")}),o.jsx("dd",{className:"system-info-resource-value",children:g.codePipeline.pipelineName||g.codePipeline.pipelineId||a("systemInfo.createdOnFirstBuild")})]}),o.jsxs("div",{className:"system-info-resource-row",children:[o.jsx("dt",{children:a("systemInfo.containerRegistryRepository")}),o.jsx("dd",{className:"system-info-resource-value",children:o.jsx(lw,{href:g.containerRegistry.consoleUrl||null,label:a("systemInfo.openContainerRegistryRepository"),children:g.containerRegistry.imageRepository||[g.containerRegistry.registry,g.containerRegistry.namespace,g.containerRegistry.repository].filter(Boolean).join("/")||a("systemInfo.createdOnFirstBuild")})})]})]}):null]}),o.jsxs("section",{className:"system-info-section","aria-labelledby":"sandbox-tool-title",children:[o.jsx("h2",{id:"sandbox-tool-title",children:a("systemInfo.sandboxInfo")}),o.jsx("button",{type:"button",className:"system-info-refresh",disabled:B,onClick:()=>F(ae=>ae+1),children:a(B?"systemInfo.checkingVersions":"systemInfo.checkUpdates")}),v?o.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:o.jsx(An,{as:"span",children:a("systemInfo.loadingSandboxInfo")})}):x?o.jsxs("div",{className:"system-info-error",role:"alert",children:[o.jsx("p",{children:x}),o.jsx("button",{type:"button",onClick:()=>F(ae=>ae+1),children:a("common.reload")})]}):o.jsxs("div",{className:"system-info-tool-list",children:[Q?o.jsx("span",{className:"system-info-inline-error",role:"alert",children:Q}):null,d.map(ae=>{var $e;const ue=H[ae.toolId],Oe=U[ae.toolId],Se=!!ae.toolId&&!!(ue!=null&&ue.canUpdate),lt=(Oe==null?void 0:Oe.error)||(ue!=null&&ue.error?a("systemInfo.versionCheckError"):ue!=null&&ue.modelEnvError?a("systemInfo.modelEnvRepairUnavailable"):"");return o.jsx("dl",{className:"system-info-tool",children:o.jsxs("div",{className:"system-info-resource-row",children:[o.jsxs("dt",{className:"system-info-tool-label",children:[o.jsx("span",{children:ae.label}),ae.snapshot?o.jsx("span",{className:"system-info-tool-badge",children:a("systemInfo.snapshot")}):null]}),o.jsxs("dd",{className:`system-info-resource-value${ae.toolId?"":" is-empty"}`,children:[o.jsx(lw,{href:v6t(i,(ue==null?void 0:ue.region)||r,ae.toolId),label:a("systemInfo.openToolConsole",{name:ae.label}),children:ae.toolId||a("common.notConfigured")}),Se?o.jsx("button",{type:"button",className:"system-info-resource-update",disabled:Oe==null?void 0:Oe.busy,"aria-busy":(Oe==null?void 0:Oe.busy)||void 0,"aria-label":a("systemInfo.updateSandbox",{name:ae.label,variant:ae.snapshot?a("systemInfo.snapshotWithSpace"):""}),title:a("systemInfo.updateSandbox",{name:ae.label,variant:ae.snapshot?a("systemInfo.snapshotWithSpace"):""}),onClick:()=>void X(ae),children:o.jsx(O6t,{spinning:(Oe==null?void 0:Oe.busy)||!1})}):null,ue!=null&&ue.currentImage?o.jsxs("span",{className:"system-info-inline-status",title:`${ue.currentImage} → ${ue.latestImage}`,children:[ue.currentImage.split(":").pop(),ue.needsImageUpdate?` → ${($e=ue.latestImage)==null?void 0:$e.split(":").pop()}`:"",ue.status==="Updating"?` · ${a("systemInfo.updatingSandbox")}`:""]}):null,Oe!=null&&Oe.message?o.jsx("span",{className:"system-info-inline-status",role:"status",children:Oe.message}):null,lt?o.jsx("span",{className:"system-info-inline-error",role:"alert",children:lt}):null]})]})},ae.kind)})]})]}),o.jsxs("section",{className:"system-info-section","aria-labelledby":"user-pool-title",children:[o.jsx("h2",{id:"user-pool-title",children:a("systemInfo.userPool")}),w?o.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:o.jsx(An,{as:"span",children:a("systemInfo.loadingUserPool")})}):S?o.jsxs("div",{className:"system-info-error",role:"alert",children:[o.jsx("p",{children:S}),o.jsx("button",{type:"button",onClick:()=>P(ae=>ae+1),children:a("common.reload")})]}):h.length>0?o.jsx("div",{className:"system-info-pool-list",children:h.map(ae=>o.jsxs("dl",{className:"system-info-pool",children:[o.jsxs("div",{children:[o.jsx("dt",{children:a("common.name")}),o.jsx("dd",{className:"system-info-resource-value",children:o.jsx(lw,{href:x6t(i,ae.region||r,ae.uid),label:a("systemInfo.openUserPoolConsole",{name:ae.name||""}),children:ae.name||a("systemInfo.unnamedUserPool")})})]}),o.jsxs("div",{children:[o.jsx("dt",{children:a("systemInfo.id")}),o.jsx("dd",{children:ae.uid||"—"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:a("systemInfo.domain")}),o.jsx("dd",{children:ae.domain||"—"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:a("systemInfo.region")}),o.jsx("dd",{children:ae.region||"—"})]})]},ae.uid))}):o.jsx("p",{className:"system-info-empty",children:a(t?"systemInfo.noLocalUserPool":"systemInfo.noUserPool")})]})]}):null]})]})}const E6t="_TextLink_16uec_1",C6t={TextLink:E6t},v2=e=>{const{children:t,primary:n=!1,underline:i=!n,className:r,target:s,forceExternal:a,as:l,href:c,to:u,...d}=e,f=a??/^https?:\/\//.test(c??u??""),h=Fxe(),p=l||(f?"a":h),g={...d,className:pi(C6t.TextLink,r),"data-primary":n?"":void 0,"data-underline":i?"":void 0};if(!c&&!u)return o.jsx("span",{...g,role:"button",children:t});const b={...f?{target:"_blank",rel:"noopener noreferrer",href:c??u}:{href:c,to:u},...g};return o.jsx(p,{...b,children:t})},T6t="/assets/media/article-agent-workflow-GXPkXUjV.webp",A6t="/assets/media/article-tool-debugging-BxiMDz_8.webp",_6t="/assets/media/showcase-a2ui-BgBnE9RT.webp",N6t="/assets/media/showcase-customer-service-DNw0mUH1.webp",j6t="/assets/media/showcase-multimodal-BRTl8NLI.webp",R6t="/assets/media/showcase-research-assistant-CbfMFfhS.webp",I6t="/assets/media/showcase-web-search-D2kl1imN.webp",P6t={volcengine:{console:"https://console.volcengine.com/agentkit",docs:"https://www.volcengine.com/docs/86681/1844823"},byteplus:{console:"https://console.byteplus.com/agentkit",docs:"https://docs.byteplus.com/en/docs/AgentKit"}};function D6t(e){return P6t[e]}const M6t=[{id:"documentation",titleKey:"developerResources.sections.documentation.title",descriptionKey:"developerResources.sections.documentation.description"},{id:"best-practices",titleKey:"developerResources.sections.bestPractices.title",descriptionKey:"developerResources.sections.bestPractices.description"},{id:"showcases",titleKey:"developerResources.sections.showcases.title",descriptionKey:"developerResources.sections.showcases.description"}],L6t="https://volcengine.github.io/veadk-python/",$6t="https://volcengine.github.io/agentkit-sdk-python/content/2.agentkit-cli/1.overview.html",F6t=[{id:"veadk-development",titleKey:"developerResources.articles.veadkDevelopment.title",descriptionKey:"developerResources.articles.veadkDevelopment.description",meta:"AgentKit · VeADK",image:T6t,href:"https://docs.volcengine.com/docs/86681/2155817?lang=zh"},{id:"agentkit-cli-development",titleKey:"developerResources.articles.cliDevelopment.title",descriptionKey:"developerResources.articles.cliDevelopment.description",meta:"AgentKit · CLI",image:A6t,href:"https://docs.volcengine.com/docs/86681/1844871?lang=zh"}],B6t=[{id:"research-assistant",titleKey:"developerResources.showcases.researchAssistant.title",descriptionKey:"developerResources.showcases.researchAssistant.description",image:R6t,href:"https://github.com/volcengine/veadk-python/tree/main/examples/06_multi_agent"},{id:"multimodal-analysis",titleKey:"developerResources.showcases.multimodalAnalysis.title",descriptionKey:"developerResources.showcases.multimodalAnalysis.description",image:j6t,href:"https://github.com/volcengine/veadk-python/tree/main/examples/multimodal_agent"},{id:"customer-service",titleKey:"developerResources.showcases.customerService.title",descriptionKey:"developerResources.showcases.customerService.description",image:N6t,href:"https://github.com/volcengine/veadk-python/tree/main/examples/basic-app"},{id:"web-search",titleKey:"developerResources.showcases.webSearch.title",descriptionKey:"developerResources.showcases.webSearch.description",image:I6t,href:"https://github.com/volcengine/veadk-python/tree/main/examples/04_web_search"},{id:"a2ui-app",titleKey:"developerResources.showcases.a2uiApp.title",descriptionKey:"developerResources.showcases.a2uiApp.description",image:_6t,href:"https://github.com/volcengine/veadk-python/tree/main/examples/a2ui_agent"}];function U6t({cloudProvider:e}){const{t}=Ae("workspaceTools"),n=D6t(e);return o.jsxs(Th,{className:"developer-resources","aria-label":t("developerResources.title"),children:[o.jsx(zx,{title:t("developerResources.title")}),o.jsx("div",{className:"developer-resources__content",children:M6t.map(i=>o.jsxs("section",{className:"developer-resources__section","aria-labelledby":`developer-resources-${i.id}`,children:[o.jsxs("header",{className:"developer-resources__section-header",children:[o.jsx("h2",{id:`developer-resources-${i.id}`,children:t(i.titleKey)}),o.jsx("p",{children:t(i.descriptionKey)})]}),i.id==="documentation"?o.jsxs("ul",{className:"developer-resources__links",children:[o.jsx("li",{children:o.jsxs(v2,{className:"developer-resources__link",primary:!0,underline:!0,href:L6t,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.veadkDocs"),o.jsx(YC,{"aria-hidden":"true"})]})}),o.jsx("li",{children:o.jsxs(v2,{className:"developer-resources__link",primary:!0,underline:!0,href:$6t,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.cliDocs"),o.jsx(YC,{"aria-hidden":"true"})]})}),o.jsx("li",{children:o.jsxs(v2,{className:"developer-resources__link",primary:!0,underline:!0,href:n.docs,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.platformDocs"),o.jsx(YC,{"aria-hidden":"true"})]})}),o.jsx("li",{children:o.jsxs(v2,{className:"developer-resources__link",primary:!0,underline:!0,href:n.console,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.console"),o.jsx(YC,{"aria-hidden":"true"})]})})]}):i.id==="best-practices"?o.jsx("div",{className:"developer-resources__articles",children:F6t.map(r=>o.jsxs("a",{className:"developer-resources__article",href:r.href,target:"_blank",rel:"noreferrer",children:[o.jsx("img",{src:r.image,alt:t("developerResources.articles.coverAlt",{title:t(r.titleKey)}),loading:"lazy"}),o.jsxs("span",{className:"developer-resources__article-copy",children:[o.jsx("strong",{children:t(r.titleKey)}),o.jsx("span",{children:t(r.descriptionKey)}),o.jsx("small",{children:r.meta})]})]},r.id))}):i.id==="showcases"?o.jsx("div",{className:"developer-resources__showcases",children:B6t.map(r=>o.jsxs("a",{className:"developer-resources__showcase",href:r.href,target:"_blank",rel:"noreferrer",children:[o.jsx("span",{className:"developer-resources__showcase-media",children:o.jsx("img",{src:r.image,alt:t("developerResources.showcases.previewAlt",{title:t(r.titleKey)}),loading:"lazy"})}),o.jsx("strong",{children:t(r.titleKey)}),o.jsx("span",{children:t(r.descriptionKey)})]},r.id))}):null]},i.id))})]})}const x2=10;function Q6t(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function z6t({hidden:e,...t}){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[o.jsx("path",{d:"M2.5 10s2.6-4 7.5-4 7.5 4 7.5 4-2.6 4-7.5 4-7.5-4-7.5-4Z"}),o.jsx("circle",{cx:"10",cy:"10",r:"1.8"}),e?o.jsx("path",{d:"m4 4 12 12"}):null]})}function dg(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M6.5 4H4.8A1.8 1.8 0 0 0 3 5.8v5.4A1.8 1.8 0 0 0 4.8 13h5.4a1.8 1.8 0 0 0 1.8-1.8V9.5M9 3h4v4M12.5 3.5 7.2 8.8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function V6t(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m4 6 4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function H6t(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function cw(e,t,n){const i=t.trim();if(!i)return n?"github.validation.required":"";if(e==="repository"&&!/^(?:https:\/\/github\.com\/)?[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+(?:\.git)?$/.test(i))return"github.validation.repository";if(e==="baseBranch"&&(!/^[A-Za-z0-9][A-Za-z0-9._/-]*$/.test(i)||i.includes("..")))return"github.validation.baseBranch";if(e==="projectPath"&&(i.startsWith("/")||i.split("/").includes("..")))return"github.validation.projectPath";if(e==="runtimeName")return qE(i,r=>`github.validation.runtimeName.${r}`)??"";if(e==="runtimeId"&&!/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/.test(i))return"github.validation.runtimeId";if(e==="modelName"&&!/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/.test(i))return"github.validation.modelName";if(e==="modelBaseUrl")try{const r=new URL(i);if(r.protocol!=="https:"||r.username||r.password||r.search||r.hash)return"github.validation.modelBaseUrlSafe"}catch{return"github.validation.modelBaseUrl"}return e==="pullRequestUrl"&&!/^https:\/\/github\.com\/[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+\/pull\/[1-9][0-9]*\/?$/.test(i)?"请输入完整的 GitHub Pull Request URL":""}function q6t(e){try{return`https://github.com/${nz(e)}`}catch{return""}}function W6t(e){return e==="started"?"评审中":e==="completed"?"已完成":e==="ignored"?"已忽略":"失败"}function G6t(e){return e==="webhook"?"自动触发":"手动发起"}function K6t(e){return e.reason?e.status!=="ignored"?e.reason:e.reason==="repository-review-disabled"?"忽略原因:仓库未开启自动评审":e.reason==="pull-request-not-reviewable"?"忽略原因:该 PR 事件不需要评审,仅评审新建、更新、重新打开和转为可评审的非 Draft、非 fork PR":e.reason==="review-settings-unavailable"?"忽略原因:自动评审设置不可用":e.reason==="unsupported-event"?"忽略原因:不是 Pull Request 事件":`忽略原因:${e.reason}`:""}function X6t(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}function Wte(e,t,n,i){if(n===0)return`第 ${e} 页`;const r=(e-1)*t+1,s=r+n-1;return`第 ${e} 页 · ${r}-${s}${i?"+":""}`}function Y6t({automation:e,cloudProvider:t,onBack:n,onOpenSandboxSession:i}){const{t:r}=Ae("automations"),s=X4t(e),a=e==="review",l=Iu(t),c=s.secrets({cloudProvider:t}),[u,d]=m.useState(()=>({...s.initialValues({cloudProvider:t})})),f=l.find(Ue=>Ue.value===u.region),[h,p]=m.useState({}),[g,b]=m.useState(""),[v,y]=m.useState(!1),[x,O]=m.useState(!1),[w,k]=m.useState(!1),[S,E]=m.useState(null),[C,N]=m.useState(""),[_,j]=m.useState(null),[A,F]=m.useState(""),[T,P]=m.useState(!1),[R,L]=m.useState(null),[M,U]=m.useState(""),[I,H]=m.useState(a),[K,Q]=m.useState([]),[q,B]=m.useState(a),[ee,le]=m.useState(""),[se,re]=m.useState(null),[ge,W]=m.useState(1),[X,ae]=m.useState(!1),[ue,Oe]=m.useState(""),[Se,lt]=m.useState(""),[$e,Le]=m.useState(""),[Ne,qe]=m.useState([]),[Re,ze]=m.useState(a),[Ee,De]=m.useState(""),[J,he]=m.useState(null),[Ce,Ze]=m.useState(1),[at,St]=m.useState(!1),Te=m.useRef(null),ye=m.useRef(null),Ve=m.useRef(null),nt=m.useRef(null),ke=m.useRef(null),Ht=q6t(u.repository),on=Ht.replace("https://github.com/",""),Yt=Ht?`${Ht}/settings/secrets/actions`:"",xt=(R==null?void 0:R.appSlug)||"agentkit-veadk-studio",Pt=(R==null?void 0:R.installUrl)||`https://github.com/apps/${xt}/installations/new`,ct=Qte(C),gt=K.filter(Ue=>Ue.reviewEnabled),Pe=ct?K.find(Ue=>Ue.fullName.toLowerCase()===ct.toLowerCase()):void 0,kt=ge>1||X,Me=Ce>1||at;m.useEffect(()=>()=>{var Ue,it,ht,pe,We;(Ue=Te.current)==null||Ue.abort(),(it=ye.current)==null||it.abort(),(ht=Ve.current)==null||ht.abort(),(pe=nt.current)==null||pe.abort(),(We=ke.current)==null||We.abort()},[]),m.useEffect(()=>{var Ue,it,ht;d({...s.initialValues({cloudProvider:t})}),p({}),b(""),E(null),k(!1),(Ue=Te.current)==null||Ue.abort(),(it=ye.current)==null||it.abort(),(ht=ke.current)==null||ht.abort(),j(null),F(""),qe([]),De(""),he(null),W(1),ae(!1),Oe(""),lt(""),Ze(1),St(!1)},[e,t,s]),m.useEffect(()=>{var it;if(!a)return;(it=Ve.current)==null||it.abort();const Ue=new AbortController;Ve.current=Ue,H(!0),U(""),T4t(Ue.signal).then(ht=>{Ve.current===Ue&&(L(ht),ht.configured||(B(!1),ze(!1)))}).catch(ht=>{Ue.signal.aborted||Ve.current!==Ue||(U(ht instanceof Error?ht.message:String(ht)),B(!1),ze(!1))}).finally(()=>{Ve.current===Ue&&(Ve.current=null,H(!1))})},[a]);const Ye=(Ue=ge,it=Se)=>{var pe;(pe=nt.current)==null||pe.abort();const ht=new AbortController;nt.current=ht,B(!0),le(""),A4t(ht.signal,{page:Ue,pageSize:x2,query:it}).then(We=>{if(nt.current===ht){if(We.repositories.length===0&&We.page>1){W(We.page-1),Ye(We.page-1);return}Q(We.repositories),W(We.page),ae(We.hasNextPage),re({reviewSettingsConfigured:We.reviewSettingsConfigured,reviewSettingsReason:We.reviewSettingsReason})}}).catch(We=>{ht.signal.aborted||nt.current!==ht||le(We instanceof Error?We.message:String(We))}).finally(()=>{nt.current===ht&&(nt.current=null,B(!1))})},et=(Ue=Ce)=>{var ht;(ht=ke.current)==null||ht.abort();const it=new AbortController;ke.current=it,ze(!0),De(""),_4t(it.signal,{page:Ue,pageSize:x2}).then(pe=>{if(ke.current===it){if(pe.records.length===0&&pe.page>1){Ze(pe.page-1),et(pe.page-1);return}qe(pe.records),Ze(pe.page),St(pe.hasNextPage),he({reviewSettingsConfigured:pe.reviewSettingsConfigured,reviewSettingsReason:pe.reviewSettingsReason})}}).catch(pe=>{it.signal.aborted||ke.current!==it||De(pe instanceof Error?pe.message:String(pe))}).finally(()=>{ke.current===it&&(ke.current=null,ze(!1))})};m.useEffect(()=>{!a||(R==null?void 0:R.configured)!==!0||(Ye(1),et(1))},[R==null?void 0:R.configured,a]);const xe=()=>{const Ue=ue.trim();lt(Ue),W(1),Ye(1,Ue)},He=()=>{Oe(""),lt(""),W(1),Ye(1,"")},Ke=(Ue,it)=>{if(!(it<1)){if(Ue==="repositories"){W(it),Ye(it,Se);return}Ze(it),et(it)}},yt=async Ue=>{if((se==null?void 0:se.reviewSettingsConfigured)!==!0||$e)return;const it=new AbortController;Le(Ue.fullName),le("");try{const ht=await N4t({repository:Ue.fullName,reviewEnabled:!Ue.reviewEnabled},it.signal),pe=new Set(ht.map(We=>We.toLowerCase()));Q(We=>We.map(vt=>({...vt,reviewEnabled:pe.has(vt.fullName.toLowerCase())})))}catch(ht){le(ht instanceof Error?ht.message:String(ht))}finally{Le("")}},Dt=(Ue,it)=>{d(ht=>({...ht,[Ue]:it})),h[Ue]&&p(ht=>({...ht,[Ue]:""}))},ln=Ue=>{var We;const it=!a&&Ue==="token"||Ue==="pullRequestUrl"||((We=s.fields.find(vt=>vt.name===Ue))==null?void 0:We.required)===!0,ht=Ue==="pullRequestUrl"?C:u[Ue],pe=cw(Ue,ht,it);p(vt=>({...vt,[Ue]:pe}))},Xt=async Ue=>{var pe;if(Ue.preventDefault(),a)return;const it={};for(const We of s.fields){const vt=cw(We.name,u[We.name],We.required);vt&&(it[We.name]=vt)}if(!a){const We=cw("token",u.token,!0);We&&(it.token=We)}if(p(it),Object.keys(it).length)return;(pe=Te.current)==null||pe.abort();const ht=new AbortController;Te.current=ht,y(!0),b(""),E(null);try{const We=await s.submit(u,{cloudProvider:t},ht.signal);if(Te.current!==ht)return;E(We),d(vt=>({...vt,token:""}))}catch(We){if(ht.signal.aborted||Te.current!==ht)return;b(We instanceof Error?We.message:String(We))}finally{Te.current===ht&&(Te.current=null,y(!1))}},dn=Ue=>{Ue.key==="Enter"&&(Ue.nativeEvent.isComposing||Ue.nativeEvent.keyCode===229)&&Ue.preventDefault()},Z=async()=>{var pe;const Ue={},it=cw("pullRequestUrl",C,!0);if(it&&(Ue.pullRequestUrl=it),!it){const We=Qte(C),vt=K.find(vn=>vn.fullName.toLowerCase()===We.toLowerCase());vt?vt.reviewEnabled||(Ue.pullRequestUrl=`请先在下方开启 ${vt.fullName} 的评审`):Ue.pullRequestUrl="PR URL 所属仓库尚未安装 GitHub App"}if(p(Ue),Object.keys(Ue).length)return;(pe=ye.current)==null||pe.abort();const ht=new AbortController;ye.current=ht,P(!0),F(""),j(null);try{const We=await C4t({pullRequestUrl:C.trim()},ht.signal);if(ye.current!==ht)return;j(We),d(vt=>({...vt,token:""})),et(),i==null||i(We.sessionId)}catch(We){if(ht.signal.aborted||ye.current!==ht)return;F(We instanceof Error?We.message:String(We))}finally{ye.current===ht&&(ye.current=null,P(!1))}},Ft=Ue=>{const{name:it,placeholder:ht,required:pe}=Ue,We=it==="repository",vt=`cards.${e}.fields.${it}`;return o.jsxs("div",{className:"github-field",children:[o.jsxs("div",{className:"github-field-label-row",children:[o.jsxs("label",{htmlFor:`github-${it}`,children:[o.jsx("span",{children:r(`${vt}.label`)}),o.jsx("span",{className:`github-field-requirement${pe?" is-required":""}`,children:r(pe?"github.required":"github.optional")})]}),We?o.jsxs("a",{className:"github-field-action",href:"https://github.com/",target:"_blank",rel:"noreferrer",children:["https://github.com/",o.jsx(dg,{})]}):null]}),o.jsx("input",{id:`github-${it}`,value:u[it],onChange:vn=>Dt(it,vn.target.value),onBlur:()=>ln(it),placeholder:r(`${vt}.placeholder`,{defaultValue:ht}),required:pe,"aria-invalid":!!h[it],"aria-describedby":`github-${it}-help${h[it]?` github-${it}-error`:""}`}),o.jsx("span",{id:`github-${it}-help`,className:"github-field-help",children:We&&on?a?r("github.repositoryReviewHelp",{repository:on}):r("github.repositoryConfigHelp",{repository:on}):r(`${vt}.help`)}),h[it]?o.jsx("span",{id:`github-${it}-error`,className:"github-field-error",role:"alert",children:r(h[it])}):null]},it)};return o.jsxs("div",{className:"github-integration-page",children:[o.jsxs("header",{className:"github-integration-header",children:[o.jsx("button",{type:"button",className:"github-back",onClick:n,"aria-label":r("backToAutomations"),children:o.jsx(Q6t,{})}),o.jsx(XQ,{className:"github-integration-logo"}),o.jsxs("div",{children:[o.jsx("h1",{children:r(`cards.${e}.title`)}),o.jsx("p",{children:r(`cards.${e}.subtitle`)})]})]}),o.jsx("div",{className:"github-integration-layout",children:o.jsxs("section",{id:`github-panel-${e}`,className:"github-section-panel",children:[o.jsx("div",{className:"github-panel-heading",children:o.jsx("p",{children:r(`cards.${e}.panel`)})}),o.jsxs("form",{className:"github-release-form",onSubmit:Xt,onKeyDown:dn,noValidate:!0,children:[a?null:o.jsxs("div",{className:"github-field-grid",children:[s.fields.map(Ft),o.jsxs("div",{className:"github-field",children:[o.jsxs("label",{id:"github-region-label",children:[o.jsx("span",{children:r("github.region")}),o.jsx("span",{className:"github-field-requirement is-required",children:r("github.required")})]}),o.jsxs("div",{className:"pp-network-region github-region-picker",onKeyDown:Ue=>{Ue.key==="Escape"&&k(!1)},children:[o.jsxs("button",{type:"button",className:"pp-region-trigger","aria-labelledby":"github-region-label","aria-haspopup":"listbox","aria-expanded":w,onClick:()=>k(Ue=>!Ue),children:[o.jsx("span",{children:(f==null?void 0:f.label)??u.region}),o.jsx(V6t,{className:`pp-region-chevron${w?" is-open":""}`})]}),w?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>k(!1)}),o.jsx("div",{className:"pp-region-menu",role:"listbox","aria-label":r("github.region"),children:l.map(Ue=>{const it=Ue.value===u.region;return o.jsxs("button",{type:"button",role:"option","aria-selected":it,className:`pp-region-option${it?" is-selected":""}`,onClick:()=>{Dt("region",Ue.value),k(!1)},children:[o.jsx("span",{children:Ue.label}),it?o.jsx(H6t,{}):null]},Ue.value)})})]}):null]}),o.jsx("span",{className:"github-field-help",children:r(`cards.${e}.regionHelp`)})]})]}),a?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:`github-app-card${R!=null&&R.configured?" is-ready":""}`,children:[o.jsxs("div",{children:[o.jsx("strong",{children:"GitHub App 授权"}),o.jsx("span",{children:I?"正在检查中心服务配置...":R!=null&&R.configured?`安装 ${xt} 到目标仓库后,可在下方开启自动评审。`:M||(R==null?void 0:R.reason)||"管理员未配置 GitHub App。"})]}),o.jsxs("a",{className:"github-app-install-link",href:Pt,target:"_blank",rel:"noreferrer",children:["安装 GitHub App",o.jsx(dg,{})]})]}),o.jsxs("section",{className:"github-review-section github-app-repositories","aria-labelledby":"github-app-repositories-title",children:[o.jsxs("div",{className:"github-review-section-header",children:[o.jsxs("div",{children:[o.jsx("h2",{id:"github-app-repositories-title",children:"已安装仓库"}),o.jsx("p",{children:"只有开启评审的仓库会响应 GitHub webhook 自动触发。"})]}),o.jsx("button",{type:"button",onClick:()=>Ye(),disabled:!(R!=null&&R.configured)||q,children:q?"刷新中...":"刷新"})]}),ee?o.jsx("div",{className:"github-submit-message is-error",role:"alert",children:ee}):null,(se==null?void 0:se.reviewSettingsConfigured)===!1&&!ee?o.jsx("div",{className:"github-submit-message is-error",role:"alert",children:se.reviewSettingsReason||"管理员未配置 Studio 持久化存储,无法保存启用评审设置。"}):null,o.jsxs("div",{className:"github-app-repository-search",children:[o.jsx("input",{type:"search",value:ue,onChange:Ue=>Oe(Ue.target.value),onKeyDown:Ue=>{Ue.key==="Enter"&&(Ue.preventDefault(),xe())},placeholder:"搜索 owner 或仓库名","aria-label":"搜索已安装仓库"}),o.jsx("button",{type:"button",onClick:xe,disabled:!(R!=null&&R.configured)||q,children:"搜索"}),Se?o.jsx("button",{type:"button",onClick:He,disabled:q,children:"清除"}):null]}),q&&K.length===0?o.jsx("div",{className:"github-app-repository-empty",children:"正在读取 GitHub App 安装仓库..."}):null,!q&&K.length===0&&!ee?o.jsx("div",{className:"github-app-repository-empty",children:Se?`没有匹配 “${Se}” 的已安装仓库。`:"GitHub App 尚未安装到任何仓库。"}):null,K.length>0?o.jsx("div",{className:"github-app-repository-list",children:K.map(Ue=>{const it=$e===Ue.fullName,ht=(se==null?void 0:se.reviewSettingsConfigured)!==!0||!!$e;return o.jsxs("div",{className:"github-app-repository-row",children:[o.jsxs("div",{className:"github-app-repository-main",children:[o.jsxs("a",{href:Ue.htmlUrl,target:"_blank",rel:"noreferrer",title:Ue.fullName,children:[Ue.fullName,o.jsx(dg,{})]}),o.jsxs("span",{children:[Ue.private?"Private":"Public"," · Installation ",Ue.installationId]})]}),o.jsx("button",{type:"button",className:`github-review-switch${Ue.reviewEnabled?" is-on":""}`,role:"switch","aria-checked":Ue.reviewEnabled,disabled:ht,onClick:()=>{yt(Ue)},children:o.jsx("span",{children:it?"保存中":Ue.reviewEnabled?"已启用":"未启用"})})]},Ue.fullName)})}):null,kt?o.jsxs("div",{className:"github-list-pagination","aria-label":"已安装仓库分页",children:[o.jsx("span",{children:Wte(ge,x2,K.length,X)}),o.jsxs("div",{children:[o.jsx("button",{type:"button",onClick:()=>Ke("repositories",ge-1),disabled:ge<=1||q,children:"上一页"}),o.jsx("button",{type:"button",onClick:()=>Ke("repositories",ge+1),disabled:!X||q,children:"下一页"})]})]}):null]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"github-field github-token-field",children:[o.jsxs("div",{className:"github-token-label-row",children:[o.jsxs("label",{htmlFor:"github-token",children:[o.jsx("span",{children:r("github.tokenLabel")}),o.jsx("span",{className:"github-field-requirement is-required",children:r("github.required")})]}),o.jsxs("a",{className:"github-field-action",href:"https://github.com/settings/personal-access-tokens/new?name=VeADK%20Studio&description=Create%20a%20GitHub%20automation%20pull%20request&contents=write&pull_requests=write&workflows=write",target:"_blank",rel:"noreferrer",children:[r("github.createToken"),o.jsx(dg,{})]})]}),o.jsxs("div",{className:"github-token-input",children:[o.jsx("input",{id:"github-token",type:x?"text":"password",value:u.token,onChange:Ue=>Dt("token",Ue.target.value),onBlur:()=>ln("token"),autoComplete:"off",required:!0,placeholder:r("github.tokenWorkflowPlaceholder"),"aria-invalid":!!h.token,"aria-describedby":`github-token-help${h.token?" github-token-error":""}`}),o.jsx("button",{type:"button",onClick:()=>O(Ue=>!Ue),"aria-label":r(x?"github.hideToken":"github.showToken"),title:r(x?"github.hideToken":"github.showToken"),children:o.jsx(z6t,{hidden:x})})]}),o.jsx("span",{id:"github-token-help",className:"github-field-help",children:r("github.tokenWorkflowHelp")}),h.token?o.jsx("span",{id:"github-token-error",className:"github-field-error",role:"alert",children:r(h.token)}):null]}),g?o.jsx("div",{className:"github-submit-message is-error",role:"alert",children:g}):null,S?o.jsxs("div",{className:"github-submit-message is-success github-result-message",role:"status",children:[o.jsxs("div",{children:[o.jsx("strong",{children:r("github.configPrCreated",{number:S.number})}),o.jsx("span",{children:r("github.configPrNextStep")})]}),o.jsxs("a",{className:"github-result-link",href:S.url,target:"_blank",rel:"noreferrer",children:[r("github.viewConfigPr"),o.jsx(dg,{})]})]}):null,o.jsxs("div",{className:"github-form-actions",children:[o.jsxs("div",{className:"github-secrets-note",children:[o.jsxs("div",{className:"github-secrets-header",children:[o.jsx("strong",{children:r("github.secretsConfigHeading")}),Yt?o.jsxs("a",{className:"github-secrets-link",href:Yt,target:"_blank",rel:"noreferrer",children:[r("github.openSecrets"),o.jsx(dg,{})]}):null]}),o.jsx("span",{className:"github-secrets-path",children:r("github.secretsPath")}),o.jsx("ul",{children:c.map(Ue=>{const[it,...ht]=Ue.split(":");return o.jsxs("li",{children:[o.jsx("code",{children:it}),ht.length?o.jsx("span",{children:ht.join(":")}):null]},Ue)})})]}),o.jsx("button",{type:"submit",disabled:v,children:r(v?"github.submitting":`cards.${e}.submitLabel`)})]})]})]}),a?o.jsxs("div",{className:"github-pr-review-sections",children:[o.jsxs("section",{className:"github-review-section github-review-now","aria-labelledby":"github-review-now-title",children:[o.jsx("div",{className:"github-review-section-header",children:o.jsxs("div",{children:[o.jsx("h2",{id:"github-review-now-title",children:"立刻评审"}),o.jsx("p",{children:"输入已安装且已启用仓库的 PR URL,立即创建 Sandbox 评审任务。"})]})}),o.jsxs("div",{className:"github-review-section-body",children:[o.jsxs("div",{className:"github-field",children:[o.jsx("input",{id:"github-pull-request-url","aria-label":"Pull Request URL",value:C,onChange:Ue=>{N(Ue.target.value),h.pullRequestUrl&&p(it=>({...it,pullRequestUrl:""}))},onBlur:()=>p(Ue=>({...Ue,pullRequestUrl:cw("pullRequestUrl",C,!0)})),placeholder:"https://github.com/owner/repository/pull/123","aria-invalid":!!h.pullRequestUrl,"aria-describedby":h.pullRequestUrl?"github-pull-request-url-error":void 0}),h.pullRequestUrl?o.jsx("span",{id:"github-pull-request-url-error",className:"github-field-error",role:"alert",children:h.pullRequestUrl}):null,!h.pullRequestUrl&&ct?o.jsx("span",{className:"github-field-help",children:Pe!=null&&Pe.reviewEnabled?`将使用 GitHub App 评审 ${Pe.fullName}`:Pe?`请先在下方开启 ${Pe.fullName} 的评审`:`PR URL 所属仓库 ${ct} 尚未安装 GitHub App`}):null,!h.pullRequestUrl&&!ct&>.length>0?o.jsxs("span",{className:"github-field-help",children:["已启用仓库:",gt.map(Ue=>Ue.fullName).join("、")]}):null]}),A?o.jsx("div",{className:"github-submit-message is-error",role:"alert",children:A}):null,_?o.jsx("div",{className:"github-submit-message is-success",role:"status",children:o.jsxs("span",{children:["已发起评审,Session ",_.sessionId," 正在运行。"]})}):null,o.jsx("div",{className:"github-review-section-actions",children:o.jsx("button",{type:"button",onClick:Z,disabled:T,children:T?"发起评审中…":"立即发起评审"})})]})]}),o.jsxs("section",{className:"github-review-section github-review-records","aria-labelledby":"github-review-records-title",children:[o.jsxs("div",{className:"github-review-section-header",children:[o.jsxs("div",{children:[o.jsx("h2",{id:"github-review-records-title",children:"评审记录"}),o.jsx("p",{children:"展示最近自动触发和手动发起的评审任务。"})]}),o.jsx("button",{type:"button",onClick:()=>et(),disabled:!(R!=null&&R.configured)||Re,children:Re?"刷新中...":"刷新"})]}),Ee?o.jsx("div",{className:"github-submit-message is-error",role:"alert",children:Ee}):null,(J==null?void 0:J.reviewSettingsConfigured)===!1&&!Ee?o.jsx("div",{className:"github-submit-message is-error",role:"alert",children:J.reviewSettingsReason||"管理员未配置 Studio 持久化存储,无法读取评审记录。"}):null,Re&&Ne.length===0?o.jsx("div",{className:"github-app-repository-empty",children:"正在读取 PR 评审记录..."}):null,!Re&&Ne.length===0&&!Ee?o.jsx("div",{className:"github-app-repository-empty",children:"暂无 PR 评审记录。"}):null,Ne.length>0?o.jsx("div",{className:"github-review-record-list",children:Ne.map(Ue=>{const it=K6t(Ue),ht=Ue.status==="completed"?"":Ue.sessionId;return o.jsxs("div",{className:"github-review-record-row",children:[o.jsxs("div",{className:"github-review-record-main",children:[o.jsxs("div",{className:"github-review-record-title",children:[o.jsxs("a",{href:Ue.pullRequestUrl,target:"_blank",rel:"noreferrer",children:[Ue.repository,"#",Ue.pullRequestNumber,o.jsx(dg,{})]}),o.jsx("span",{className:`github-review-record-status is-${Ue.status}`,children:W6t(Ue.status)})]}),o.jsxs("span",{children:[G6t(Ue.trigger),Ue.action?` · ${Ue.action}`:""," · ",X6t(Ue.createdAt),it?` · ${it}`:""]})]}),o.jsx("div",{className:"github-review-record-actions",children:ht&&i?o.jsx("button",{type:"button",onClick:()=>i(ht),children:"打开 Session"}):null})]},Ue.id)})}):null,Me?o.jsxs("div",{className:"github-list-pagination","aria-label":"评审记录分页",children:[o.jsx("span",{children:Wte(Ce,x2,Ne.length,at)}),o.jsxs("div",{children:[o.jsx("button",{type:"button",onClick:()=>Ke("records",Ce-1),disabled:Ce<=1||Re,children:"上一页"}),o.jsx("button",{type:"button",onClick:()=>Ke("records",Ce+1),disabled:!at||Re,children:"下一页"})]})]}):null]})]}):null]})})]})}const Z6t=1050062,Gte="1.0",J6t="https://lf-static.applogcdn.com/obj/applog-sdk-static/log-sdk/collect/5/collect.js";class e$t{constructor(){ki(this,"enabled",!1);ki(this,"initialized",!1);ki(this,"pending",[]);ki(this,"userUniqueId","");ki(this,"initPromise")}init(t){return this.enabled=t.enabled,this.enabled?this.initPromise?this.initPromise:(this.initPromise=Promise.resolve().then(()=>{const n=this.bootstrapCollector();n("init",{app_id:Z6t,channel:"cn",disable_auto_pv:1}),this.userUniqueId&&n("config",{user_unique_id:this.userUniqueId}),n("config",{_staging_flag:t.environment==="prod"?0:1}),n("start"),this.initialized=!0;const i=this.pending;this.pending=[];for(const[r,s]of i)this.collect(r,s)}),this.initPromise):(this.pending=[],Promise.resolve())}identify(t){this.userUniqueId=t,this.initialized&&this.collect("config",{user_unique_id:t})}emit(t,n){if(this.enabled){if(this.initialized){this.collect(t,n);return}this.pending=[...this.pending.slice(-49),[t,n]]}}bootstrapCollector(){if(window.collectEvent)return window.collectEvent;window.LogAnalyticsObject="collectEvent";const t=function(){var r;(r=t.q)==null||r.push(arguments)};t.q=[],t.l=Date.now(),window.collectEvent=t;const n=document.createElement("script");return n.async=!0,n.src=J6t,n.onerror=()=>{this.enabled=!1,t.q=[],console.warn("[telemetry] TEA SDK script failed to load")},document.head.appendChild(n),t}collect(t,n){var i;(i=window.collectEvent)==null||i.call(window,t,n)}}const t$t=256,tRe=1024,dL="[REDACTED]";function n$t(e){if(typeof e!="string"&&typeof e!="number")return;const t=String(e).trim();return/^[A-Za-z0-9_.:-]{1,64}$/.test(t)?t:void 0}function wf(e,t){return t===void 0?{errorKind:e}:{errorKind:e,errorCode:t}}function nRe(e,t,n={}){if(e.length<=t)return e;if(n.preserveEnd){const r="[truncated] ...";return`${r}${e.slice(-Math.max(0,t-r.length))}`}const i="... [truncated]";return`${e.slice(0,Math.max(0,t-i.length))}${i}`}function i$t(e){return e.replace(/\b(Authorization\s*[:=]\s*)(Bearer\s+)?[^\s"',;&]+/gi,(t,n,i)=>`${n}${i??""}${dL}`).replace(/\bBearer\s+[A-Za-z0-9._~+/=-]+/gi,`Bearer ${dL}`).replace(/\b([\w.-]*(?:token|password|passwd|secret|api[_-]?key|access[_-]?key|secret[_-]?key|cookie)[\w.-]*\s*[:=]\s*)(["']?)[^\s"',;&]+/gi,(t,n,i)=>`${n}${i}${dL}`)}function qg(e,t={}){const n=e!==null&&typeof e=="object"?e:{},r=(typeof n.message=="string"?n.message:typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):"").replace(/\s+/g," ").trim();if(r)return nRe(i$t(r),tRe,t)}function Wa(e,t={}){const n=e!==null&&typeof e=="object"?e:{},i=n$t(n.code),r=typeof n.name=="string"?n.name:"";if(r==="RuntimeProbeError")return wf("runtime_probe_error",i);if(r==="AbortError")return wf("abort",i);if(r==="RuntimeAccessDeniedError"||r==="AuthError")return wf("auth",i);if(t.phase==="build")return wf("build_failed",i);if(r==="TimeoutError")return wf("timeout",i);if(r==="NetworkError"||r==="TypeError")return wf("network",i);if(r==="ValidationError")return wf("validation",i);if(r==="ServerError")return wf("server",i);const s=typeof n.status=="number"&&Number.isInteger(n.status)?n.status:void 0;if(s===void 0||s<400||s>599)return wf("unknown",i);const a=String(s);return s===401||s===403?{errorKind:"auth",errorCode:a}:s===400||s===409||s===422?{errorKind:"validation",errorCode:a}:s>=500?{errorKind:"server",errorCode:a}:{errorKind:"unknown",errorCode:a}}const r$t=["schema_version","event_id","operation_id","user_pool_id","studio_deploy_id","vefaas_application_id","vefaas_function_id","studio_region","studio_project","studio_version","environment","cloud_provider","account_id","account_id_resolution_error","user_role","user_source","page_instance_id"],s$t={studio_entry_viewed:["auth_state"],studio_session_started:["agents_source"],studio_agent_deploy:["status","agent_id","deploy_action","deploy_source","create_mode","ai_assisted","deploy_region","runtime_network_type","feishu_enabled","runtime_id","duration_ms","failed_phase","error_kind","error_code","error_message"],studio_sandbox_create:["status","sandbox_kind","sandbox_source","sandbox_id","duration_ms","error_kind","error_code"],studio_agent_debug:["status","agent_id","variant_type","debug_run_id","duration_ms","failed_phase","error_kind","error_code"],studio_agent_connect:["status","target_id","agent_kind","connect_source","runtime_region","runtime_is_mine","sandbox_status","duration_ms","error_kind","error_code"],studio_agent_message:["status","agent_id","agent_kind","message_source","session_state","session_id","duration_ms","failed_phase","error_kind","error_code"],studio_agent_source_download:["status","agent_id","deploy_action","deploy_source","create_mode","ai_assisted","duration_ms","file_count","zip_size_bytes","error_kind","error_code"]};function a$t(e){return typeof e=="string"||typeof e=="number"&&Number.isFinite(e)}function Kte(e,t){const n=new Set([...r$t,...s$t[e]]),i={};for(const[r,s]of Object.entries(t))!n.has(r)||!a$t(s)||(typeof s=="string"?i[r]=nRe(s,r==="error_message"?tRe:t$t):i[r]=s);return i}function o$t(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`}function l$t(){return typeof performance<"u"?performance.now():Date.now()}function V0(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}class c$t{constructor(t){ki(this,"sink");ki(this,"createId");ki(this,"now");ki(this,"pageInstanceId");ki(this,"context");ki(this,"identity");ki(this,"entryViewed",!1);ki(this,"sessionStarted",!1);this.sink=t.sink,this.createId=t.createId??o$t,this.now=t.now??l$t,this.pageInstanceId=this.createId()}setContext(t){var n,i;this.context={...t,accountId:((n=t.accountId)==null?void 0:n.trim())??"",accountIdResolutionError:((i=t.accountIdResolutionError)==null?void 0:i.trim())??""}}identify(t){var i,r,s;const n=t.userUniqueId.trim();n&&(this.identity&&this.identity.userUniqueId!==n&&(this.pageInstanceId=this.createId(),this.sessionStarted=!1),this.identity={...t,userUniqueId:n,accountId:((i=t.accountId)==null?void 0:i.trim())??""},(s=(r=this.sink).identify)==null||s.call(r,n))}trackStudioSessionStarted(t){this.sessionStarted||!this.context||!this.identity||(this.sessionStarted=!0,this.emit("studio_session_started",{agents_source:t.agentsSource}))}trackStudioEntryViewed(t){if(this.entryViewed||!this.context)return;this.entryViewed=!0;const n=Kte("studio_entry_viewed",V0({schema_version:Gte,event_id:this.createId(),user_pool_id:this.context.userPoolId,studio_deploy_id:this.context.studioDeployId,vefaas_application_id:this.context.applicationId,vefaas_function_id:this.context.functionId,studio_region:this.context.studioRegion,studio_project:this.context.studioProject,studio_version:this.context.studioVersion,environment:this.context.environment,cloud_provider:this.context.cloudProvider,account_id:this.context.accountId,account_id_resolution_error:this.context.accountIdResolutionError||void 0,page_instance_id:this.pageInstanceId,auth_state:t.authState}));this.sink.emit("studio_entry_viewed",n)}beginAgentDeploy(t){return this.beginOperation("studio_agent_deploy",{agent_id:t.agentId,deploy_action:t.deployAction,deploy_source:t.deploySource,create_mode:t.createMode,ai_assisted:t.aiAssisted,deploy_region:t.deployRegion,runtime_network_type:t.runtimeNetworkType,feishu_enabled:t.feishuEnabled},n=>({runtime_id:n.runtimeId}),n=>({failed_phase:n.failedPhase,error_kind:n.errorKind,error_code:n.errorCode,error_message:n.errorMessage}))}beginSandboxCreate(t){return this.beginOperation("studio_sandbox_create",{sandbox_kind:t.sandboxKind,sandbox_source:t.sandboxSource},n=>({sandbox_id:n.sandboxId}),n=>({error_kind:n.errorKind,error_code:n.errorCode}))}beginAgentDebug(t){return this.beginOperation("studio_agent_debug",{agent_id:t.agentId,variant_type:t.variantType},n=>({debug_run_id:n.debugRunId}),n=>({failed_phase:n.failedPhase,error_kind:n.errorKind,error_code:n.errorCode}))}beginAgentConnect(t){return this.beginOperation("studio_agent_connect",{target_id:t.targetId,agent_kind:t.agentKind,connect_source:t.connectSource},n=>V0({runtime_region:n.runtimeRegion,runtime_is_mine:n.runtimeIsMine,sandbox_status:n.sandboxStatus}),n=>V0({error_kind:n.errorKind,error_code:n.errorCode}))}beginAgentMessage(t){return this.beginOperation("studio_agent_message",V0({agent_id:t.agentId,agent_kind:t.agentKind,message_source:t.messageSource,session_state:t.sessionState,session_id:t.sessionId}),n=>({session_id:n.sessionId}),n=>V0({session_id:n.sessionId,failed_phase:n.failedPhase,error_kind:n.errorKind,error_code:n.errorCode}))}beginAgentSourceDownload(t){return this.beginOperation("studio_agent_source_download",{agent_id:t.agentId,deploy_action:t.deployAction,deploy_source:t.deploySource,create_mode:t.createMode,ai_assisted:t.aiAssisted},n=>({file_count:n.fileCount,zip_size_bytes:n.zipSizeBytes}),n=>({file_count:n.fileCount,error_kind:n.errorKind,error_code:n.errorCode}))}beginOperation(t,n,i,r){const s=this.createId(),a=this.now(),l=!!(this.context&&this.identity);let c=!1;l&&this.emit(t,{...n,status:"started"},s);const u=(d,f)=>{c||(c=!0,l&&this.emit(t,{...n,...f,status:d,duration_ms:Math.max(0,this.now()-a)},s))};return{operationId:s,succeed:d=>u("succeeded",i(d)),fail:d=>u("failed",r(d))}}emit(t,n,i){if(!this.context||!this.identity)return;const r=Kte(t,V0({schema_version:Gte,event_id:this.createId(),operation_id:i,user_pool_id:this.context.userPoolId,studio_deploy_id:this.context.studioDeployId,vefaas_application_id:this.context.applicationId,vefaas_function_id:this.context.functionId,studio_region:this.context.studioRegion,studio_project:this.context.studioProject,studio_version:this.context.studioVersion,environment:this.context.environment,cloud_provider:this.context.cloudProvider,account_id:this.identity.accountId,account_id_resolution_error:this.context.accountIdResolutionError||void 0,user_role:this.identity.userRole,user_source:this.identity.userSource,page_instance_id:this.pageInstanceId,...n}));this.sink.emit(t,r)}}const iRe=new e$t,tf=new c$t({sink:iRe});function u$t(e){return iRe.init(e)}function d$t(e){tf.setContext(e)}function f$t(e){tf.identify(e)}function h$t(e){tf.trackStudioEntryViewed(e)}function p$t(e){tf.trackStudioSessionStarted(e)}function rRe(e){return tf.beginAgentDeploy(e)}function m$t(e){return tf.beginSandboxCreate(e)}function g$t(e){return tf.beginAgentDebug(e)}function w2(e){return tf.beginAgentConnect(e)}function Xte(e){return tf.beginAgentMessage(e)}function sRe(e){return tf.beginAgentSourceDownload(e)}const b$t=/^[A-Za-z_][A-Za-z0-9_]*$/;function WE(e,t=n=>Lt(`validation.agentName.${n}`)){return e.trim().length===0?t("required"):e==="user"?t("reserved"):b$t.test(e)?null:t("characters")}function y$t(e){const t=new Set,n=new Set,i=r=>{WE(r.name)===null&&(t.has(r.name)?n.add(r.name):t.add(r.name)),r.subAgents.forEach(i)};return i(e),n}function v$t(e){return{...oc(),name:e,description:Vd("feishu.generatedAgent.description"),instruction:Vd("feishu.generatedAgent.instruction"),deployment:{feishuEnabled:!0}}}async function x$t(e){const t=v$t(e.agentName),n=await wO(t);return Ax(n.name,n.files,{region:e.region,projectName:"default"},{taskId:e.taskId,sessionStorage:"in-memory",minInstance:1,maxInstance:1,description:t.description,im:{feishu:{enabled:!0}},envs:[{key:"FEISHU_APP_ID",value:e.appId},{key:"FEISHU_APP_SECRET",value:e.appSecret}],onStage:e.onStage})}const ud=["cn-beijing","cn-shanghai"],aRe=["prepare","build","deploy","publish"];function w$t(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function O$t(e){return o.jsx("svg",{viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m5 7 4 4 4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Yte(e){return o.jsx("svg",{viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m4 9.2 3.1 3.1L14 5.8",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}function S$t(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M6.5 4H4.8A1.8 1.8 0 0 0 3 5.8v5.4A1.8 1.8 0 0 0 4.8 13h5.4a1.8 1.8 0 0 0 1.8-1.8V9.5M9 3h4v4M12.5 3.5 7.2 8.8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function k$t(e){if(!e||e==="upload")return 0;const t=aRe.findIndex(n=>n===e);return t<0?0:t}function fL(e){switch(e){case"prepare":case"upload":case"build":case"deploy":case"publish":case"update":case"evaluation":return e;default:return"unknown"}}function Zte(e){const t=WE(e,n=>n);return t?`feishu.validation.agentName.${t}`:""}function E$t({onBack:e}){const{t}=Ae("automations"),[n,i]=m.useState("feishu_assistant"),[r,s]=m.useState(""),[a,l]=m.useState(""),[c,u]=m.useState(!1),[d,f]=m.useState("cn-beijing"),[h,p]=m.useState(!1),[g,b]=m.useState(""),[v,y]=m.useState(""),[x,O]=m.useState(""),[w,k]=m.useState("idle"),[S,E]=m.useState(null),[C,N]=m.useState(""),[_,j]=m.useState(null),A=m.useRef(null),F=m.useRef(null),T=m.useRef([]),P=m.useRef(0),R=m.useRef(null),L=m.useRef(null),M=m.useRef("prepare"),U=m.useRef(!1),I=m.useRef(!0),H=["preparing","running","cancelling"].includes(w);m.useEffect(()=>(I.current=!0,()=>{I.current=!1}),[]),m.useEffect(()=>{var W;if(!h)return;(W=T.current[P.current])==null||W.focus();const re=X=>{X.target instanceof Node&&A.current&&!A.current.contains(X.target)&&p(!1)},ge=X=>{var ae;X.key==="Escape"&&(p(!1),(ae=F.current)==null||ae.focus())};return window.addEventListener("pointerdown",re),window.addEventListener("keydown",ge),()=>{window.removeEventListener("pointerdown",re),window.removeEventListener("keydown",ge)}},[h]);const K=re=>{re.key==="Enter"&&(re.nativeEvent.isComposing||re.nativeEvent.keyCode===229)&&re.preventDefault()},Q=()=>{const re=Zte(n.trim()),ge=r.trim()?"":"feishu.validation.appId",W=a.trim()?"":"feishu.validation.appSecret";return b(re),y(ge),O(W),!re&&!ge&&!W},q=async re=>{if(re.preventDefault(),!Q()||H)return;const ge=crypto.randomUUID();R.current=ge,M.current="prepare",U.current=!1,k("preparing"),E(null),N(""),j(null);const W=rRe({agentId:String(n.trim()),deployAction:"create",deploySource:"feishu_automation",createMode:"feishu_template",aiAssisted:0,deployRegion:String(d),runtimeNetworkType:"public",feishuEnabled:1});L.current=W;try{const X=await x$t({agentName:n.trim(),appId:r.trim(),appSecret:a.trim(),region:d,taskId:ge,onStage:ae=>{M.current=ae.phase||"deploy",!(!I.current||U.current)&&(k("running"),E(ae))}});if(U.current){W.fail({failedPhase:fL(M.current),errorKind:"abort",errorMessage:qg("User cancelled deployment")});return}if(W.succeed({runtimeId:String(X.runtimeId||"")}),!I.current)return;j(X),l(""),u(!1),k("succeeded")}catch(X){if(W.fail({failedPhase:fL(M.current),...U.current?{errorKind:"abort"}:Wa(X,{phase:M.current}),errorMessage:qg(X)}),!I.current||U.current)return;k("failed"),N(X instanceof Error?X.message:String(X))}finally{R.current===ge&&(R.current=null),L.current===W&&(L.current=null)}},B=async()=>{var ge;const re=R.current;if(!(!re||w!=="running")&&window.confirm(t("feishu.confirmCancel"))){U.current=!0,k("cancelling"),N("");try{await L0e(re),(ge=L.current)==null||ge.fail({failedPhase:fL(M.current),errorKind:"abort",errorMessage:qg("User cancelled deployment")}),I.current&&k("cancelled")}catch(W){if(U.current=!1,!I.current)return;k("failed"),N(W instanceof Error?W.message:String(W))}}},ee=k$t((S==null?void 0:S.phase)??null),le=!!(n.trim()&&r.trim()&&a.trim()&&!H),se=t(`feishu.regions.${d}`);return o.jsxs("div",{className:"feishu-integration-page",children:[o.jsxs("header",{className:"feishu-integration-header",children:[o.jsx("button",{type:"button",className:"feishu-back",onClick:e,"aria-label":t("backToAutomations"),disabled:H,children:o.jsx(w$t,{})}),o.jsx("img",{className:"feishu-integration-logo",src:UI,alt:"","aria-hidden":"true"}),o.jsxs("div",{children:[o.jsx("h1",{children:t("feishu.title")}),o.jsx("p",{children:t("feishu.description")})]})]}),o.jsx("div",{className:"feishu-integration-layout",children:o.jsxs("section",{className:"feishu-section-panel",children:[o.jsx("p",{className:"feishu-panel-description",children:t("feishu.panel")}),o.jsxs("form",{className:"feishu-form",onSubmit:q,onKeyDown:K,noValidate:!0,children:[o.jsxs("div",{className:"feishu-field-grid",children:[o.jsxs("div",{className:"feishu-field",children:[o.jsx("label",{htmlFor:"feishu-agent-name",children:t("feishu.agentName")}),o.jsx("input",{id:"feishu-agent-name",value:n,maxLength:64,disabled:H,onChange:re=>{i(re.target.value),g&&b("")},onBlur:()=>b(Zte(n.trim())),"aria-invalid":!!g,"aria-describedby":`feishu-agent-name-help${g?" feishu-agent-name-error":""}`}),o.jsx("span",{id:"feishu-agent-name-help",className:"feishu-field-help",children:t("feishu.agentNameHelp")}),g?o.jsx("span",{id:"feishu-agent-name-error",className:"feishu-field-error",role:"alert",children:t(g)}):null]}),o.jsxs("div",{className:"feishu-field",children:[o.jsx("label",{id:"feishu-region-label",children:t("feishu.region")}),o.jsxs("div",{className:"feishu-region-picker",ref:A,children:[o.jsxs("button",{ref:F,type:"button",className:"feishu-region-trigger",disabled:H,"aria-haspopup":"listbox","aria-expanded":h,"aria-labelledby":"feishu-region-label feishu-region-value",onClick:()=>{P.current=ud.findIndex(re=>re===d),p(re=>!re)},onKeyDown:re=>{re.key!=="ArrowDown"&&re.key!=="ArrowUp"||(re.preventDefault(),P.current=re.key==="ArrowUp"?ud.length-1:ud.findIndex(ge=>ge===d),p(!0))},children:[o.jsx("span",{id:"feishu-region-value",children:se}),o.jsx(O$t,{})]}),h?o.jsx("div",{className:"feishu-region-menu",role:"listbox","aria-label":t("feishu.region"),onKeyDown:re=>{var X;const ge=T.current.findIndex(ae=>ae===document.activeElement);let W=null;re.key==="ArrowDown"?W=(ge+1)%ud.length:re.key==="ArrowUp"?W=(ge-1+ud.length)%ud.length:re.key==="Home"?W=0:re.key==="End"?W=ud.length-1:re.key==="Tab"&&p(!1),W!==null&&(re.preventDefault(),(X=T.current[W])==null||X.focus())},children:ud.map(re=>o.jsx("button",{ref:ge=>{const W=ud.findIndex(X=>X===re);T.current[W]=ge},type:"button",role:"option","aria-selected":d===re,className:`feishu-region-option${d===re?" is-selected":""}`,onClick:()=>{var ge;f(re),p(!1),(ge=F.current)==null||ge.focus()},children:t(`feishu.regions.${re}`)},re))}):null]}),o.jsx("span",{className:"feishu-field-help",children:t("feishu.regionHelp")})]}),o.jsxs("div",{className:"feishu-field",children:[o.jsx("label",{htmlFor:"feishu-app-id",children:t("feishu.appId")}),o.jsx("input",{id:"feishu-app-id",value:r,maxLength:128,autoComplete:"off",disabled:H,placeholder:"cli_xxxxxxxxxxxxxxxx",onChange:re=>{s(re.target.value),v&&y("")},onBlur:()=>y(r.trim()?"":"feishu.validation.appId"),"aria-invalid":!!v,"aria-describedby":`feishu-app-id-help${v?" feishu-app-id-error":""}`}),o.jsx("span",{id:"feishu-app-id-help",className:"feishu-field-help",children:t("feishu.appIdHelp")}),v?o.jsx("span",{id:"feishu-app-id-error",className:"feishu-field-error",role:"alert",children:t(v)}):null]}),o.jsxs("div",{className:"feishu-field",children:[o.jsx("label",{htmlFor:"feishu-app-secret",children:t("feishu.appSecret")}),o.jsxs("div",{className:"feishu-secret-input",children:[o.jsx("input",{id:"feishu-app-secret",type:c?"text":"password",value:a,maxLength:256,autoComplete:"off",disabled:H,placeholder:t("feishu.appSecretPlaceholder"),onChange:re=>{l(re.target.value),x&&O("")},onBlur:()=>O(a.trim()?"":"feishu.validation.appSecret"),"aria-invalid":!!x,"aria-describedby":`feishu-app-secret-help${x?" feishu-app-secret-error":""}`}),o.jsx("button",{type:"button",disabled:H,onClick:()=>u(re=>!re),"aria-label":t(c?"feishu.hideSecret":"feishu.showSecret"),children:t(c?"feishu.hide":"feishu.show")})]}),o.jsx("span",{id:"feishu-app-secret-help",className:"feishu-field-help",children:t("feishu.appSecretHelp")}),x?o.jsx("span",{id:"feishu-app-secret-error",className:"feishu-field-error",role:"alert",children:t(x)}):null]})]}),w!=="idle"?o.jsxs("div",{className:`feishu-deployment-status is-${w}`,role:w==="failed"?"alert":"status",children:[o.jsxs("div",{className:"feishu-deployment-heading",children:[w==="preparing"?o.jsx(An,{as:"strong",children:t("feishu.status.preparing")}):null,w==="running"?o.jsx(An,{as:"strong",children:S?$I(S):t("feishu.status.running")}):null,w==="cancelling"?o.jsx(An,{as:"strong",children:t("feishu.status.cancelling")}):null,w==="succeeded"?o.jsxs("strong",{children:[o.jsx(Yte,{}),t("feishu.status.succeeded")]}):null,w==="cancelled"?o.jsx("strong",{children:t("feishu.status.cancelled")}):null,w==="failed"?o.jsx("strong",{children:t("feishu.status.failed")}):null]}),w==="preparing"||w==="running"||w==="cancelling"?o.jsx("ol",{className:"feishu-deployment-steps",children:aRe.map((re,ge)=>{const W=w==="running"&&gevoid B(),children:t("feishu.cancelDeployment")}):null,o.jsx("button",{type:"submit",className:"feishu-submit",disabled:!le,children:t(H?"feishu.creating":"feishu.create")})]})]})]})]})})]})}async function sz(e,t,n,i=Wo){var s;const r=await Tn(e,{...t,headers:{accept:"application/json",...t.headers},signal:n},i);if(!r.ok){let a="";try{a=((s=(await r.json()).detail)==null?void 0:s.trim())||""}catch{}throw new Error(a||V("common.requestFailed",{status:r.status}))}return r.json()}function C$t(e){return sz("/web/coding-agents/capabilities",{method:"GET"},e,$F)}function T$t(e,t){return sz(`/web/coding-agents/skills/${encodeURIComponent(e)}/preview`,{method:"GET"},t)}function A$t(e,t){return sz("/web/coding-agents/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},t)}const _$t="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='16'%20height='16'%20rx='3.692'%20fill='%231A1B1D'/%3e%3cpath%20d='M13.235%205.829V4.332H2.758v5.987h1.496v1.496h8.981V5.828Zm-1.497%204.49H4.254V5.83h7.484v4.49Z'%20fill='%2332F08C'/%3e%3cpath%20d='M6.937%206.993%205.88%208.051%206.937%209.11%207.995%208.05%206.937%206.993ZM9.931%206.992%208.873%208.05%209.931%209.11%2010.99%208.05%209.93%206.992Z'%20fill='%2332F08C'/%3e%3c/svg%3e";function N$t(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m4 4 8 8m0-8-8 8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function Jte(){return o.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[o.jsx("path",{d:"M4 1.8h5l3 3V14H4z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),o.jsx("path",{d:"M9 1.8V5h3M6 8h4M6 10.5h4",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function ene(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"M1.8 4.5h4l1.2-1.3h2.2l1.2 1.3h3.8v8H1.8z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})})}function j$t(e){return e instanceof DOMException&&e.name==="AbortError"}function R$t(e){return e instanceof Error&&e.message?e.message:""}function I$t(e){return e<1024?`${e} B`:`${(e/1024).toFixed(e<10*1024?1:0)} KB`}function P$t(e){const t=e.split("/");return t[t.length-1]??e}function D$t(e){const t=new Map;for(const n of e){const i=n.path.split("/"),r=i.length>1?i.slice(0,-1).join("/"):"";t.set(r,[...t.get(r)??[],n])}return Array.from(t,([n,i])=>({directory:n,files:i})).sort((n,i)=>n.directory?i.directory?n.directory.localeCompare(i.directory):1:-1)}function M$t({skill:e,onClose:t}){const{t:n}=Ae("automations"),i=m.useRef(null),r=m.useRef(null),s=m.useId(),a=m.useId(),[l,c]=m.useState(null),[u,d]=m.useState(""),[f,h]=m.useState(!0),[p,g]=m.useState(""),[b,v]=m.useState(0);m.useEffect(()=>{r.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const w=i.current;return w&&!w.open&&w.showModal(),()=>{var k;w!=null&&w.open&&w.close(),(k=r.current)==null||k.focus()}},[]),m.useEffect(()=>{const w=new AbortController;return h(!0),g(""),c(null),d(""),T$t(e.id,w.signal).then(k=>{if(w.signal.aborted)return;c(k);const S=k.files.find(E=>E.path==="SKILL.md")??k.files[0];d((S==null?void 0:S.path)??"")}).catch(k=>{!w.signal.aborted&&!j$t(k)&&g(R$t(k))}).finally(()=>{w.signal.aborted||h(!1)}),()=>w.abort()},[b,e.id]);const y=m.useMemo(()=>D$t((l==null?void 0:l.files)??[]),[l]),x=(l==null?void 0:l.files.find(w=>w.path===u))??null,O=n(`codingAgents.skills.items.${e.id}.name`,{defaultValue:e.name});return o.jsxs("dialog",{ref:i,className:"coding-agents-preview-dialog","aria-labelledby":s,"aria-describedby":a,onCancel:w=>{w.preventDefault(),t()},onMouseDown:w=>{const k=w.currentTarget.getBoundingClientRect();(w.clientXk.right||w.clientYk.bottom)&&t()},children:[o.jsxs("header",{className:"coding-agents-preview-header",children:[o.jsx("span",{className:"coding-agents-preview-mark",children:o.jsx(ene,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:s,children:O}),o.jsx("p",{id:a,children:n("codingAgents.preview.description")})]}),o.jsx("button",{type:"button",autoFocus:!0,"aria-label":n("codingAgents.preview.close"),onClick:t,children:o.jsx(N$t,{})})]}),f?o.jsxs("div",{className:"coding-agents-preview-state",children:[o.jsx("i",{}),n("codingAgents.preview.loading")]}):p?o.jsxs("div",{className:"coding-agents-preview-state is-error",role:"alert",children:[o.jsx("span",{children:p||n("codingAgents.preview.error")}),o.jsx("button",{type:"button",onClick:()=>v(w=>w+1),children:n("codingAgents.retry")})]}):o.jsxs("div",{className:"coding-agents-preview-layout",children:[o.jsxs("nav",{className:"coding-agents-preview-tree","aria-label":n("codingAgents.preview.skillFiles",{name:O}),children:[o.jsxs("div",{className:"coding-agents-preview-tree-title",children:[o.jsx("span",{children:n("codingAgents.preview.files")}),o.jsx("small",{children:(l==null?void 0:l.files.length)??0})]}),o.jsx("div",{className:"coding-agents-preview-tree-scroll",children:y.map(w=>w.directory?o.jsxs("details",{open:!0,children:[o.jsxs("summary",{children:[o.jsx(ene,{}),o.jsx("span",{children:w.directory})]}),o.jsx("div",{children:w.files.map(k=>o.jsxs("button",{type:"button",className:u===k.path?"is-selected":"","aria-current":u===k.path?"true":void 0,onClick:()=>d(k.path),children:[o.jsx(Jte,{}),o.jsx("span",{children:P$t(k.path)})]},k.path))})]},w.directory):w.files.map(k=>o.jsxs("button",{type:"button",className:u===k.path?"is-selected":"","aria-current":u===k.path?"true":void 0,onClick:()=>d(k.path),children:[o.jsx(Jte,{}),o.jsx("span",{children:k.path})]},k.path)))})]}),o.jsx("section",{className:"coding-agents-preview-file","aria-label":n("codingAgents.preview.fileContent"),children:x?o.jsxs(o.Fragment,{children:[o.jsxs("header",{children:[o.jsx("strong",{children:x.path}),o.jsx("span",{children:I$t(x.size)})]}),x.previewable&&x.content!==null?o.jsx("pre",{tabIndex:0,children:o.jsx("code",{children:x.content})}):o.jsx("div",{className:"coding-agents-preview-unavailable",children:n("codingAgents.preview.notPreviewable")})]}):o.jsx("div",{className:"coding-agents-preview-unavailable",children:n("codingAgents.preview.noFiles")})})]})]})}function L$t(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function $$t(e){return o.jsxs("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.5",y:"5",width:"16",height:"16",rx:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("path",{d:"m8.5 11-2.4 2.4 2.4 2.4M11 16.5h3.8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("circle",{cx:"24.5",cy:"10.5",r:"2.5",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("circle",{cx:"24.5",cy:"24.5",r:"2.5",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("path",{d:"M19.5 10.5H22M18.2 19l4.3 3.7M24.5 13v9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function F$t(e){return o.jsx("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:o.jsxs("g",{stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",children:[o.jsx("path",{d:"M16 4.5v7M16 20.5v7"}),o.jsx("path",{d:"m9.3 6.3 3.5 6.1M19.2 19.6l3.5 6.1"}),o.jsx("path",{d:"m5.9 11.1 6.2 3.5M19.9 17.4l6.2 3.5"}),o.jsx("path",{d:"M4.7 16h7M20.3 16h7"}),o.jsx("path",{d:"m5.9 20.9 6.2-3.5M19.9 14.6l6.2-3.5"}),o.jsx("path",{d:"m9.3 25.7 3.5-6.1M19.2 12.4l3.5-6.1"})]})})}function B$t(e){return o.jsxs("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M15.8 4.2c2.4 0 4.5 1.2 5.7 3.1 2.2-.3 4.5.8 5.6 2.9 1.1 2 .8 4.4-.5 6.1 1.2 1.8 1.3 4.3.1 6.2-1.2 2-3.4 3-5.6 2.6-1.3 1.8-3.5 2.9-5.8 2.7-2.2-.2-4.1-1.5-5.1-3.4-2.2.1-4.4-1-5.4-3.1-1-2-.6-4.4.8-6.1-1.1-1.9-1.1-4.3.2-6.1 1.3-1.9 3.6-2.7 5.7-2.2 1.1-1.7 2.6-2.7 4.3-2.7Z",stroke:"currentColor",strokeWidth:"1.7",strokeLinejoin:"round"}),o.jsx("path",{d:"m10.7 12.2 3.1 3.8-3.1 3.8M17.1 20h4.3",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function tne(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m3.4 8.2 3 3L12.8 5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function U$t(e){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M2.8 6.3h14.4v8.3a1.6 1.6 0 0 1-1.6 1.6H4.4a1.6 1.6 0 0 1-1.6-1.6V6.3Z",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"}),o.jsx("path",{d:"M2.8 6.3V5.1a1.4 1.4 0 0 1 1.4-1.4h3.4l1.5 1.6h6.5a1.6 1.6 0 0 1 1.6 1.6",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"})]})}function Q$t({agentId:e}){return e==="trae"?o.jsx("img",{src:_$t,alt:"","aria-hidden":"true"}):e==="claude-code"?o.jsx(F$t,{}):o.jsx(B$t,{})}function nne(e){return e instanceof DOMException&&e.name==="AbortError"}function ine(e,t){return e instanceof Error&&e.message?e.message:t}function z$t({onBack:e}){var j;const{t}=Ae("automations"),[n,i]=m.useState(null),[r,s]=m.useState(!0),[a,l]=m.useState(null),[c,u]=m.useState(0),[d,f]=m.useState(new Set),[h,p]=m.useState(new Set),[g,b]=m.useState(null),[v,y]=m.useState(!1),[x,O]=m.useState(null),w=m.useRef(null);m.useEffect(()=>{const A=new AbortController;return s(!0),l(null),C$t(A.signal).then(F=>{if(A.signal.aborted)return;i(F);const T=F.agents.filter(P=>P.available);f(P=>{const R=T.filter(L=>P.has(L.id));return new Set((R.length?R:T.slice(0,1)).map(L=>L.id))}),p(P=>{const R=F.skills.filter(L=>P.has(L.id));return new Set((R.length?R:F.skills).map(L=>L.id))})}).catch(F=>{!nne(F)&&!A.signal.aborted&&(i(null),l(ine(F,"")))}).finally(()=>{A.signal.aborted||s(!1)}),()=>A.abort()},[c]),m.useEffect(()=>()=>{var A;return(A=w.current)==null?void 0:A.abort()},[]);const k=m.useMemo(()=>(n==null?void 0:n.agents.filter(A=>A.available&&d.has(A.id)))||[],[n,d]),S=m.useMemo(()=>(n==null?void 0:n.skills.filter(A=>h.has(A.id)))||[],[n,h]),E=!!(!v&&k.length&&S.length),C=(A,F)=>{!F||v||(O(null),f(T=>{const P=new Set(T);return P.has(A)?P.delete(A):P.add(A),P}))},N=A=>{v||(O(null),p(F=>{const T=new Set(F);return T.has(A)?T.delete(A):T.add(A),T}))},_=async()=>{var F;if(!E)return;(F=w.current)==null||F.abort();const A=new AbortController;w.current=A,y(!0),O(null);try{const T=await A$t({agents:k.map(R=>R.id),skills:S.map(R=>R.id)},A.signal);if(A.signal.aborted)return;const P=T.installations;O({tone:"success",agentCount:k.length,skillCount:S.length,installations:P})}catch(T){!nne(T)&&!A.signal.aborted&&O({tone:"error",message:ine(T,"")})}finally{w.current===A&&(w.current=null),A.signal.aborted||y(!1)}};return o.jsxs("section",{className:"coding-agents-page",children:[o.jsxs("header",{className:"coding-agents-header",children:[o.jsx("button",{type:"button",className:"coding-agents-back",onClick:e,disabled:v,"aria-label":t("backToAutomations"),children:o.jsx(L$t,{})}),o.jsx($$t,{className:"coding-agents-logo"}),o.jsxs("div",{children:[o.jsx("h1",{children:t("codingAgents.title")}),o.jsx("p",{children:t("codingAgents.description")})]})]}),o.jsx("div",{className:"coding-agents-scroll",children:o.jsxs("div",{className:"coding-agents-content",children:[o.jsxs("section",{className:"coding-agents-section","aria-label":t("codingAgents.clients.ariaLabel"),children:[o.jsxs("div",{className:"coding-agents-section-heading",children:[o.jsxs("div",{children:[o.jsx("span",{children:"1"}),o.jsx("h2",{children:t("codingAgents.clients.title")})]}),o.jsx("button",{type:"button",onClick:()=>u(A=>A+1),disabled:r||v,children:t("codingAgents.clients.detectAgain")})]}),r?o.jsxs("div",{className:"coding-agents-inline-state",children:[o.jsx("i",{}),t("codingAgents.clients.detecting")]}):a!==null?o.jsxs("div",{className:"coding-agents-error-row",role:"alert",children:[o.jsx("span",{children:a||t("codingAgents.errors.detect")}),o.jsx("button",{type:"button",onClick:()=>u(A=>A+1),children:t("codingAgents.retry")})]}):o.jsx("div",{className:"coding-agents-agent-grid",children:n==null?void 0:n.agents.map(A=>o.jsxs("button",{type:"button",className:`coding-agents-agent ${d.has(A.id)?"is-selected":""}`,"aria-pressed":d.has(A.id),disabled:!A.available||v,onClick:()=>C(A.id,A.available),title:A.available?A.name:A.reason,children:[o.jsx("span",{className:`coding-agents-agent-mark is-${A.id}`,children:o.jsx(Q$t,{agentId:A.id})}),o.jsxs("span",{className:"coding-agents-agent-copy",children:[o.jsx("strong",{children:A.name}),o.jsx("small",{children:A.available?A.version||t("codingAgents.clients.detected"):A.reason})]}),o.jsx("span",{className:`coding-agents-status ${A.available?"is-ready":""}`,children:A.available?t("codingAgents.clients.available"):t("codingAgents.clients.unavailable")}),o.jsx("span",{className:"coding-agents-check",children:o.jsx(tne,{})})]},A.id))})]}),o.jsxs("section",{className:"coding-agents-section","aria-label":t("codingAgents.skills.ariaLabel"),children:[o.jsx("div",{className:"coding-agents-section-heading",children:o.jsxs("div",{children:[o.jsx("span",{children:"2"}),o.jsx("h2",{children:t("codingAgents.skills.title")})]})}),o.jsx("div",{className:"coding-agents-skill-list",children:n==null?void 0:n.skills.map(A=>o.jsxs("div",{className:`coding-agents-skill ${h.has(A.id)?"is-selected":""}`,children:[o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:h.has(A.id),onChange:()=>N(A.id),disabled:v}),o.jsx("span",{className:"coding-agents-skill-check","aria-hidden":"true",children:o.jsx(tne,{})}),o.jsxs("span",{children:[o.jsx("strong",{children:t(`codingAgents.skills.items.${A.id}.name`,{defaultValue:A.name})}),o.jsx("small",{children:t(`codingAgents.skills.items.${A.id}.description`,{defaultValue:A.description})})]})]}),o.jsx("button",{type:"button",onClick:()=>b(A),children:t("codingAgents.skills.viewFiles")})]},A.id))}),o.jsxs("div",{className:"coding-agents-global","aria-label":t("codingAgents.global.ariaLabel"),children:[o.jsxs("div",{className:"coding-agents-global-heading",children:[o.jsx(U$t,{}),o.jsxs("div",{children:[o.jsx("strong",{children:t("codingAgents.global.title")}),o.jsx("span",{children:t("codingAgents.global.description")})]})]}),k.length?o.jsx("dl",{children:k.map(A=>o.jsxs("div",{children:[o.jsx("dt",{children:A.name}),o.jsx("dd",{children:A.globalSkillsPath})]},A.id))}):o.jsx("p",{children:t("codingAgents.global.empty")})]})]}),x?o.jsxs("div",{className:`coding-agents-result is-${x.tone}`,role:x.tone==="error"?"alert":"status",children:[o.jsx("strong",{children:x.tone==="success"?t("codingAgents.success",{agentCount:x.agentCount,skillCount:x.skillCount}):x.message||t("codingAgents.errors.configure")}),(j=x.installations)!=null&&j.length?o.jsx("ul",{children:x.installations.map(A=>o.jsxs("li",{children:[A.agentName," · ",t(`codingAgents.skills.items.${A.skillId}.name`,{defaultValue:A.skill})," → ",A.displayPath]},`${A.agent}:${A.skillId}`))}):null]}):null,o.jsxs("div",{className:"coding-agents-actions",children:[o.jsx("span",{children:k.length?t("codingAgents.selection",{agentCount:k.length,skillCount:S.length}):t("codingAgents.selectClient")}),o.jsx("button",{type:"button",onClick:()=>void _(),disabled:!E,children:t(v?"codingAgents.configuring":"codingAgents.configure")})]})]})}),g?o.jsx(M$t,{skill:g,onClose:()=>b(null)}):null]})}async function az(e,t){const n=await e.json().catch(()=>null),i=typeof(n==null?void 0:n.detail)=="string"?n.detail:"";return new Error(i||V("common.fallbackWithHttpStatus",{fallback:t,status:e.status}))}async function V$t(e){const t=await Tn("/web/website-integrations",{cache:"no-store",signal:e});if(!t.ok)throw await az(t,V("websiteIntegration.listFailed"));return(await t.json()).integrations??[]}async function H$t(e){const t=await Tn("/web/website-integrations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await az(t,V("websiteIntegration.createFailed"));return t.json()}async function q$t(e){const t=await Tn(`/web/website-integrations/${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await az(t,V("websiteIntegration.deleteFailed"))}function W$t(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function rne(e){return o.jsxs("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.5",y:"5",width:"20",height:"17",rx:"3.5",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("path",{d:"M4.5 10h18M8.5 7.5h.1M11.5 7.5h.1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),o.jsx("path",{d:"M17 18.5a5 5 0 0 1 5-5h1.5a5 5 0 0 1 5 5V23a5 5 0 0 1-5 5H22l-3.5 2.5v-3.3A5 5 0 0 1 17 23v-4.5Z",fill:"hsl(var(--background))",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),o.jsx("path",{d:"M21 19h4M21 22.5h3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function G$t(e,t){const n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleString(t,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}async function K$t(e){const t=[];let n="";for(let i=0;i<10;i+=1){const r=await _x({nextToken:n||void 0,pageSize:100,region:"all",scope:"all"});if(e.aborted)return[];if(t.push(...r.runtimes),n=r.nextToken,!n)break}return t}function X$t({onBack:e}){const{t,i18n:n}=Ae("websiteIntegration"),[i,r]=m.useState([]),[s,a]=m.useState([]),[l,c]=m.useState(""),[u,d]=m.useState(""),[f,h]=m.useState(""),[p,g]=m.useState(!0),[b,v]=m.useState(!1),[y,x]=m.useState(""),[O,w]=m.useState("");m.useEffect(()=>{const j=new AbortController;return g(!0),w(""),Promise.all([V$t(j.signal),K$t(j.signal)]).then(([A,F])=>{var P;if(j.signal.aborted)return;r(A),a(F),d(((P=A[0])==null?void 0:P.id)??"");const T=F[0];T&&c(`${T.region}::${T.runtimeId}`)}).catch(A=>{j.signal.aborted||w(A instanceof Error?A.message:t("errors.load"))}).finally(()=>{j.signal.aborted||g(!1)}),()=>j.abort()},[t]);const k=m.useMemo(()=>s.map(j=>({value:`${j.region}::${j.runtimeId}`,label:j.name||j.runtimeId,description:`${j.region} · ${j.status}`,runtime:j})),[s]),S=m.useMemo(()=>new Map(k.map(j=>[j.value,j.runtime])),[k]),E=i.find(j=>j.id===u)??i[0],C=E?` - + +
diff --git a/veadk/webui/website-integration.js b/veadk/webui/website-integration.js index 9a874464e..4926bad10 100644 --- a/veadk/webui/website-integration.js +++ b/veadk/webui/website-integration.js @@ -1,4 +1,4 @@ -var vri=Object.defineProperty;var NZt=Va=>{throw TypeError(Va)};var yri=(Va,Rs,xi)=>Rs in Va?vri(Va,Rs,{enumerable:!0,configurable:!0,writable:!0,value:xi}):Va[Rs]=xi;var Bn=(Va,Rs,xi)=>yri(Va,typeof Rs!="symbol"?Rs+"":Rs,xi),BZt=(Va,Rs,xi)=>Rs.has(Va)||NZt("Cannot "+xi);var cu=(Va,Rs,xi)=>(BZt(Va,Rs,"read from private field"),xi?xi.call(Va):Rs.get(Va)),$Zt=(Va,Rs,xi)=>Rs.has(Va)?NZt("Cannot add the same private member more than once"):Rs instanceof WeakSet?Rs.add(Va):Rs.set(Va,xi),SLe=(Va,Rs,xi,uh)=>(BZt(Va,Rs,"write to private field"),uh?uh.call(Va,xi):Rs.set(Va,xi),xi);(function(){"use strict";var Uo,df,PZt,hD,dD,fD,pD,gD,mD,vD,yD,bD,xD,wD,AD,TD,SD,uie,XO,CD,OD,kD,ED,_D,RD,rd,DD,LD,MD,ID,PD,ND,BD,$D,FD,zD,UD,VD,QD,GD,HD,WD,YD,qD,jD,XD,KD,ZD,JD,eL,tL,rL,nL,iL,aL,sL,oL,lL,cL,uL,hL,dL,fL,pL,gL,mL,vL,yL,bL,xL,wL,AL,TL,SL,CL,OL,kL,EL,_L,KO,RL,DL,LL,ML,IL,PL,NL,BL,$L,FL,zL,UL,ZO,VL,QL,GL,HL,WL,YL,qL,jL,XL,KL,ZL,ww,JL,eM,tM,rM,nM,iM,aM,sM,oM,lM,cM,uM,hM,dM,fM,pM,gM,mM,vM,yM,bM,xM,wM,AM,TM,SM,CM,OM,kM,EM,_M,RM,DM,LM,MM,IM,PM,NM,BM,$M,FM,zM,UM,VM,QM,GM,HM,WM,YM,qM,jM,XM,KM,ZM,JM,eI,tI,rI,nI,iI,aI,sI,oI,lI,cI,uI,hI,dI,fI,pI,gI,mI,vI,yI,bI,xI,wI,AI,TI,SI,CI,OI,kI,EI,_I,RI,DI,LI,MI,II,PI,NI,BI,Aw,JO,$I,FI,zI,ab,UI,VI,QI,GI,HI,WI,YI;var Va=typeof document<"u"?document.currentScript:null;function Rs(t,e){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var xi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function uh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var RLe={exports:{}},Uz={};/** +var vri=Object.defineProperty;var NZt=Va=>{throw TypeError(Va)};var yri=(Va,Rs,xi)=>Rs in Va?vri(Va,Rs,{enumerable:!0,configurable:!0,writable:!0,value:xi}):Va[Rs]=xi;var Bn=(Va,Rs,xi)=>yri(Va,typeof Rs!="symbol"?Rs+"":Rs,xi),BZt=(Va,Rs,xi)=>Rs.has(Va)||NZt("Cannot "+xi);var cu=(Va,Rs,xi)=>(BZt(Va,Rs,"read from private field"),xi?xi.call(Va):Rs.get(Va)),$Zt=(Va,Rs,xi)=>Rs.has(Va)?NZt("Cannot add the same private member more than once"):Rs instanceof WeakSet?Rs.add(Va):Rs.set(Va,xi),TLe=(Va,Rs,xi,uh)=>(BZt(Va,Rs,"write to private field"),uh?uh.call(Va,xi):Rs.set(Va,xi),xi);(function(){"use strict";var Uo,df,PZt,hD,dD,fD,pD,gD,mD,vD,yD,bD,xD,wD,AD,SD,TD,uie,XO,CD,OD,kD,ED,_D,RD,rd,DD,LD,MD,ID,PD,ND,BD,$D,FD,zD,UD,VD,QD,GD,HD,WD,YD,qD,jD,XD,KD,ZD,JD,eL,tL,rL,nL,iL,aL,sL,oL,lL,cL,uL,hL,dL,fL,pL,gL,mL,vL,yL,bL,xL,wL,AL,SL,TL,CL,OL,kL,EL,_L,KO,RL,DL,LL,ML,IL,PL,NL,BL,$L,FL,zL,UL,ZO,VL,QL,GL,HL,WL,YL,qL,jL,XL,KL,ZL,ww,JL,eM,tM,rM,nM,iM,aM,sM,oM,lM,cM,uM,hM,dM,fM,pM,gM,mM,vM,yM,bM,xM,wM,AM,SM,TM,CM,OM,kM,EM,_M,RM,DM,LM,MM,IM,PM,NM,BM,$M,FM,zM,UM,VM,QM,GM,HM,WM,YM,qM,jM,XM,KM,ZM,JM,eI,tI,rI,nI,iI,aI,sI,oI,lI,cI,uI,hI,dI,fI,pI,gI,mI,vI,yI,bI,xI,wI,AI,SI,TI,CI,OI,kI,EI,_I,RI,DI,LI,MI,II,PI,NI,BI,Aw,JO,$I,FI,zI,ab,UI,VI,QI,GI,HI,WI,YI;var Va=typeof document<"u"?document.currentScript:null;function Rs(t,e){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var xi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function uh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var RLe={exports:{}},Uz={};/** * @license React * react-jsx-runtime.production.js * @@ -14,7 +14,7 @@ var vri=Object.defineProperty;var NZt=Va=>{throw TypeError(Va)};var yri=(Va,Rs,x * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(t){function e(M,P){var N=M.length;M.push(P);e:for(;0>>1,B=M[F];if(0>>1;Fi(U,N))Qi(G,U)?(M[F]=G,M[Q]=N,F=Q):(M[F]=U,M[z]=N,F=z);else if(Qi(G,N))M[F]=G,M[Q]=N,F=Q;else break e}}return P}function i(M,P){var N=M.sortIndex-P.sortIndex;return N!==0?N:M.id-P.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,o=s.now();t.unstable_now=function(){return s.now()-o}}var l=[],u=[],h=1,d=null,f=3,p=!1,g=!1,m=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function w(M){for(var P=r(u);P!==null;){if(P.callback===null)n(u);else if(P.startTime<=M)n(u),P.sortIndex=P.expirationTime,e(l,P);else break;P=r(u)}}function A(M){if(m=!1,w(M),!g)if(r(l)!==null)g=!0,T||(T=!0,I());else{var P=r(u);P!==null&&D(A,P.startTime-M)}}var T=!1,S=-1,O=5,k=-1;function E(){return v?!0:!(t.unstable_now()-kM&&E());){var F=d.callback;if(typeof F=="function"){d.callback=null,f=d.priorityLevel;var B=F(d.expirationTime<=M);if(M=t.unstable_now(),typeof B=="function"){d.callback=B,w(M),P=!0;break t}d===r(l)&&n(l),w(M)}else n(l);d=r(l)}if(d!==null)P=!0;else{var V=r(u);V!==null&&D(A,V.startTime-M),P=!1}}break e}finally{d=null,f=N,p=!1}P=void 0}}finally{P?I():T=!1}}}var I;if(typeof x=="function")I=function(){x(_)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,R=L.port2;L.port1.onmessage=_,I=function(){R.postMessage(null)}}else I=function(){y(_,0)};function D(M,P){S=y(function(){M(t.unstable_now())},P)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(M){M.callback=null},t.unstable_forceFrameRate=function(M){0>M||125F?(M.sortIndex=N,e(u,M),r(l)===null&&M===r(u)&&(m?(b(S),S=-1):m=!0,D(A,N-F))):(M.sortIndex=B,e(l,M),g||p||(g=!0,T||(T=!0,I()))),M},t.unstable_shouldYield=E,t.unstable_wrapCallback=function(M){var P=f;return function(){var N=f;f=P;try{return M.apply(this,arguments)}finally{f=N}}}})(ILe),MLe.exports=ILe;var GZt=MLe.exports,PLe={exports:{}},$n={};/** + */(function(t){function e(M,P){var N=M.length;M.push(P);e:for(;0>>1,B=M[F];if(0>>1;Fi(U,N))Qi(G,U)?(M[F]=G,M[Q]=N,F=Q):(M[F]=U,M[z]=N,F=z);else if(Qi(G,N))M[F]=G,M[Q]=N,F=Q;else break e}}return P}function i(M,P){var N=M.sortIndex-P.sortIndex;return N!==0?N:M.id-P.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,o=s.now();t.unstable_now=function(){return s.now()-o}}var l=[],u=[],h=1,d=null,f=3,p=!1,g=!1,m=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function w(M){for(var P=r(u);P!==null;){if(P.callback===null)n(u);else if(P.startTime<=M)n(u),P.sortIndex=P.expirationTime,e(l,P);else break;P=r(u)}}function A(M){if(m=!1,w(M),!g)if(r(l)!==null)g=!0,S||(S=!0,I());else{var P=r(u);P!==null&&D(A,P.startTime-M)}}var S=!1,T=-1,O=5,k=-1;function E(){return v?!0:!(t.unstable_now()-kM&&E());){var F=d.callback;if(typeof F=="function"){d.callback=null,f=d.priorityLevel;var B=F(d.expirationTime<=M);if(M=t.unstable_now(),typeof B=="function"){d.callback=B,w(M),P=!0;break t}d===r(l)&&n(l),w(M)}else n(l);d=r(l)}if(d!==null)P=!0;else{var V=r(u);V!==null&&D(A,V.startTime-M),P=!1}}break e}finally{d=null,f=N,p=!1}P=void 0}}finally{P?I():S=!1}}}var I;if(typeof x=="function")I=function(){x(_)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,R=L.port2;L.port1.onmessage=_,I=function(){R.postMessage(null)}}else I=function(){y(_,0)};function D(M,P){T=y(function(){M(t.unstable_now())},P)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(M){M.callback=null},t.unstable_forceFrameRate=function(M){0>M||125F?(M.sortIndex=N,e(u,M),r(l)===null&&M===r(u)&&(m?(b(T),T=-1):m=!0,D(A,N-F))):(M.sortIndex=B,e(l,M),g||p||(g=!0,S||(S=!0,I()))),M},t.unstable_shouldYield=E,t.unstable_wrapCallback=function(M){var P=f;return function(){var N=f;f=P;try{return M.apply(this,arguments)}finally{f=N}}}})(ILe),MLe.exports=ILe;var GZt=MLe.exports,PLe={exports:{}},$n={};/** * @license React * react.production.js * @@ -22,7 +22,7 @@ var vri=Object.defineProperty;var NZt=Va=>{throw TypeError(Va)};var yri=(Va,Rs,x * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var die=Symbol.for("react.transitional.element"),HZt=Symbol.for("react.portal"),WZt=Symbol.for("react.fragment"),YZt=Symbol.for("react.strict_mode"),qZt=Symbol.for("react.profiler"),jZt=Symbol.for("react.consumer"),XZt=Symbol.for("react.context"),KZt=Symbol.for("react.forward_ref"),ZZt=Symbol.for("react.suspense"),JZt=Symbol.for("react.memo"),NLe=Symbol.for("react.lazy"),eJt=Symbol.for("react.activity"),BLe=Symbol.iterator;function tJt(t){return t===null||typeof t!="object"?null:(t=BLe&&t[BLe]||t["@@iterator"],typeof t=="function"?t:null)}var $Le={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},FLe=Object.assign,zLe={};function nk(t,e,r){this.props=t,this.context=e,this.refs=zLe,this.updater=r||$Le}nk.prototype.isReactComponent={},nk.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")},nk.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function ULe(){}ULe.prototype=nk.prototype;function fie(t,e,r){this.props=t,this.context=e,this.refs=zLe,this.updater=r||$Le}var pie=fie.prototype=new ULe;pie.constructor=fie,FLe(pie,nk.prototype),pie.isPureReactComponent=!0;var VLe=Array.isArray;function gie(){}var Qa={H:null,A:null,T:null,S:null},QLe=Object.prototype.hasOwnProperty;function mie(t,e,r){var n=r.ref;return{$$typeof:die,type:t,key:e,ref:n!==void 0?n:null,props:r}}function rJt(t,e){return mie(t.type,e,t.props)}function vie(t){return typeof t=="object"&&t!==null&&t.$$typeof===die}function nJt(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var GLe=/\/+/g;function yie(t,e){return typeof t=="object"&&t!==null&&t.key!=null?nJt(""+t.key):e.toString(36)}function iJt(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(gie,gie):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function ik(t,e,r,n,i){var a=typeof t;(a==="undefined"||a==="boolean")&&(t=null);var s=!1;if(t===null)s=!0;else switch(a){case"bigint":case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case die:case HZt:s=!0;break;case NLe:return s=t._init,ik(s(t._payload),e,r,n,i)}}if(s)return i=i(t),s=n===""?"."+yie(t,0):n,VLe(i)?(r="",s!=null&&(r=s.replace(GLe,"$&/")+"/"),ik(i,e,r,"",function(u){return u})):i!=null&&(vie(i)&&(i=rJt(i,r+(i.key==null||t&&t.key===i.key?"":(""+i.key).replace(GLe,"$&/")+"/")+s)),e.push(i)),1;s=0;var o=n===""?".":n+":";if(VLe(t))for(var l=0;l{throw TypeError(Va)};var yri=(Va,Rs,x * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Qo=GZt,XLe=se,uJt=ak;function Dt(t){var e="https://react.dev/errors/"+t;if(1ok||(t.current=Oie[ok],Oie[ok]=null,ok--)}function ka(t,e){ok++,Oie[ok]=t.current,t.current=e}var Vg=Ug(null),eP=Ug(null),lb=Ug(null),Wz=Ug(null);function Yz(t,e){switch(ka(lb,e),ka(eP,t),ka(Vg,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?_6e(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=_6e(e),t=R6e(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}hl(Vg),ka(Vg,t)}function lk(){hl(Vg),hl(eP),hl(lb)}function kie(t){t.memoizedState!==null&&ka(Wz,t);var e=Vg.current,r=R6e(e,t.type);e!==r&&(ka(eP,t),ka(Vg,r))}function qz(t){eP.current===t&&(hl(Vg),hl(eP)),Wz.current===t&&(hl(Wz),QP._currentValue=Cw)}var Eie,aMe;function Ow(t){if(Eie===void 0)try{throw Error()}catch(r){var e=r.stack.trim().match(/\n( *(at )?)/);Eie=e&&e[1]||"",aMe=-1ok||(t.current=Oie[ok],Oie[ok]=null,ok--)}function ka(t,e){ok++,Oie[ok]=t.current,t.current=e}var Vg=Ug(null),eP=Ug(null),lb=Ug(null),Wz=Ug(null);function Yz(t,e){switch(ka(lb,e),ka(eP,t),ka(Vg,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?_6e(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=_6e(e),t=R6e(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}hl(Vg),ka(Vg,t)}function lk(){hl(Vg),hl(eP),hl(lb)}function kie(t){t.memoizedState!==null&&ka(Wz,t);var e=Vg.current,r=R6e(e,t.type);e!==r&&(ka(eP,t),ka(Vg,r))}function qz(t){eP.current===t&&(hl(Vg),hl(eP)),Wz.current===t&&(hl(Wz),QP._currentValue=Cw)}var Eie,aMe;function Ow(t){if(Eie===void 0)try{throw Error()}catch(r){var e=r.stack.trim().match(/\n( *(at )?)/);Eie=e&&e[1]||"",aMe=-1)":-1i||l[n]!==u[i]){var h=` `+l[n].replace(" at new "," at ");return t.displayName&&h.includes("")&&(h=h.replace("",t.displayName)),h}while(1<=n&&0<=i);break}}}finally{_ie=!1,Error.prepareStackTrace=r}return(r=t?t.displayName||t.name:"")?Ow(r):""}function gJt(t,e){switch(t.tag){case 26:case 27:case 5:return Ow(t.type);case 16:return Ow("Lazy");case 13:return t.child!==e&&e!==null?Ow("Suspense Fallback"):Ow("Suspense");case 19:return Ow("SuspenseList");case 0:case 15:return Rie(t.type,!1);case 11:return Rie(t.type.render,!1);case 1:return Rie(t.type,!0);case 31:return Ow("Activity");default:return""}}function sMe(t){try{var e="",r=null;do e+=gJt(t,r),r=t,t=t.return;while(t);return e}catch(n){return` Error generating stack: `+n.message+` -`+n.stack}}var Die=Object.prototype.hasOwnProperty,Lie=Qo.unstable_scheduleCallback,Mie=Qo.unstable_cancelCallback,mJt=Qo.unstable_shouldYield,vJt=Qo.unstable_requestPaint,sd=Qo.unstable_now,yJt=Qo.unstable_getCurrentPriorityLevel,oMe=Qo.unstable_ImmediatePriority,lMe=Qo.unstable_UserBlockingPriority,jz=Qo.unstable_NormalPriority,bJt=Qo.unstable_LowPriority,cMe=Qo.unstable_IdlePriority,xJt=Qo.log,wJt=Qo.unstable_setDisableYieldValue,tP=null,od=null;function cb(t){if(typeof xJt=="function"&&wJt(t),od&&typeof od.setStrictMode=="function")try{od.setStrictMode(tP,t)}catch{}}var ld=Math.clz32?Math.clz32:SJt,AJt=Math.log,TJt=Math.LN2;function SJt(t){return t>>>=0,t===0?32:31-(AJt(t)/TJt|0)|0}var Xz=256,Kz=262144,Zz=4194304;function kw(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Jz(t,e,r){var n=t.pendingLanes;if(n===0)return 0;var i=0,a=t.suspendedLanes,s=t.pingedLanes;t=t.warmLanes;var o=n&134217727;return o!==0?(n=o&~a,n!==0?i=kw(n):(s&=o,s!==0?i=kw(s):r||(r=o&~t,r!==0&&(i=kw(r))))):(o=n&~a,o!==0?i=kw(o):s!==0?i=kw(s):r||(r=n&~t,r!==0&&(i=kw(r)))),i===0?0:e!==0&&e!==i&&!(e&a)&&(a=i&-i,r=e&-e,a>=r||a===32&&(r&4194048)!==0)?e:i}function rP(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function CJt(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32: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+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function uMe(){var t=Zz;return Zz<<=1,!(Zz&62914560)&&(Zz=4194304),t}function Iie(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function nP(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function OJt(t,e,r,n,i,a){var s=t.pendingLanes;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=r,t.entangledLanes&=r,t.errorRecoveryDisabledLanes&=r,t.shellSuspendCounter=0;var o=t.entanglements,l=t.expirationTimes,u=t.hiddenUpdates;for(r=s&~r;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var LJt=/[\n"\\]/g;function gf(t){return t.replace(LJt,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function zie(t,e,r,n,i,a,s,o){t.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?t.type=s:t.removeAttribute("type"),e!=null?s==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+pf(e)):t.value!==""+pf(e)&&(t.value=""+pf(e)):s!=="submit"&&s!=="reset"||t.removeAttribute("value"),e!=null?Uie(t,s,pf(e)):r!=null?Uie(t,s,pf(r)):n!=null&&t.removeAttribute("value"),i==null&&a!=null&&(t.defaultChecked=!!a),i!=null&&(t.checked=i&&typeof i!="function"&&typeof i!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?t.name=""+pf(o):t.removeAttribute("name")}function TMe(t,e,r,n,i,a,s,o){if(a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(t.type=a),e!=null||r!=null){if(!(a!=="submit"&&a!=="reset"||e!=null)){Fie(t);return}r=r!=null?""+pf(r):"",e=e!=null?""+pf(e):r,o||e===t.value||(t.value=e),t.defaultValue=e}n=n??i,n=typeof n!="function"&&typeof n!="symbol"&&!!n,t.checked=o?t.checked:!!n,t.defaultChecked=!!n,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.name=s),Fie(t)}function Uie(t,e,r){e==="number"&&rU(t.ownerDocument)===t||t.defaultValue===""+r||(t.defaultValue=""+r)}function pk(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wie=!1;if(dv)try{var oP={};Object.defineProperty(oP,"passive",{get:function(){Wie=!0}}),window.addEventListener("test",oP,oP),window.removeEventListener("test",oP,oP)}catch{Wie=!1}var hb=null,Yie=null,iU=null;function RMe(){if(iU)return iU;var t,e=Yie,r=e.length,n,i="value"in hb?hb.value:hb.textContent,a=i.length;for(t=0;t=uP),NMe=" ",BMe=!1;function $Me(t,e){switch(t){case"keyup":return ser.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function FMe(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var yk=!1;function ler(t,e){switch(t){case"compositionend":return FMe(e);case"keypress":return e.which!==32?null:(BMe=!0,NMe);case"textInput":return t=e.data,t===NMe&&BMe?null:t;default:return null}}function cer(t,e){if(yk)return t==="compositionend"||!Zie&&$Me(t,e)?(t=RMe(),iU=Yie=hb=null,yk=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=YMe(r)}}function jMe(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?jMe(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function XMe(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=rU(t.document);e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=rU(t.document)}return e}function tae(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var ver=dv&&"documentMode"in document&&11>=document.documentMode,bk=null,rae=null,pP=null,nae=!1;function KMe(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;nae||bk==null||bk!==rU(n)||(n=bk,"selectionStart"in n&&tae(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),pP&&fP(pP,n)||(pP=n,n=KU(rae,"onSelect"),0>=s,i-=s,Qg=1<<32-ld(e)+i|r<O?(k=S,S=null):k=S.sibling;var E=f(y,S,x[O],w);if(E===null){S===null&&(S=k);break}t&&S&&E.alternate===null&&e(y,S),b=a(E,b,O),T===null?A=E:T.sibling=E,T=E,S=k}if(O===x.length)return r(y,S),wi&&pv(y,O),A;if(S===null){for(;OO?(k=S,S=null):k=S.sibling;var _=f(y,S,E.value,w);if(_===null){S===null&&(S=k);break}t&&S&&_.alternate===null&&e(y,S),b=a(_,b,O),T===null?A=_:T.sibling=_,T=_,S=k}if(E.done)return r(y,S),wi&&pv(y,O),A;if(S===null){for(;!E.done;O++,E=x.next())E=d(y,E.value,w),E!==null&&(b=a(E,b,O),T===null?A=E:T.sibling=E,T=E);return wi&&pv(y,O),A}for(S=n(S);!E.done;O++,E=x.next())E=p(S,y,O,E.value,w),E!==null&&(t&&E.alternate!==null&&S.delete(E.key===null?O:E.key),b=a(E,b,O),T===null?A=E:T.sibling=E,T=E);return t&&S.forEach(function(I){return e(y,I)}),wi&&pv(y,O),A}function v(y,b,x,w){if(typeof x=="object"&&x!==null&&x.type===sk&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Hz:e:{for(var A=x.key;b!==null;){if(b.key===A){if(A=x.type,A===sk){if(b.tag===7){r(y,b.sibling),w=i(b,x.props.children),w.return=y,y=w;break e}}else if(b.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===ob&&$w(A)===b.type){r(y,b.sibling),w=i(b,x.props),xP(w,x),w.return=y,y=w;break e}r(y,b);break}else e(y,b);b=b.sibling}x.type===sk?(w=Mw(x.props.children,y.mode,w,x.key),w.return=y,y=w):(w=pU(x.type,x.key,x.props,null,y.mode,w),xP(w,x),w.return=y,y=w)}return s(y);case KI:e:{for(A=x.key;b!==null;){if(b.key===A)if(b.tag===4&&b.stateNode.containerInfo===x.containerInfo&&b.stateNode.implementation===x.implementation){r(y,b.sibling),w=i(b,x.children||[]),w.return=y,y=w;break e}else{r(y,b);break}else e(y,b);b=b.sibling}w=uae(x,y.mode,w),w.return=y,y=w}return s(y);case ob:return x=$w(x),v(y,b,x,w)}if(JI(x))return g(y,b,x,w);if(ZI(x)){if(A=ZI(x),typeof A!="function")throw Error(Dt(150));return x=A.call(x),m(y,b,x,w)}if(typeof x.then=="function")return v(y,b,wU(x),w);if(x.$$typeof===cv)return v(y,b,vU(y,x),w);AU(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint"?(x=""+x,b!==null&&b.tag===6?(r(y,b.sibling),w=i(b,x),w.return=y,y=w):(r(y,b),w=cae(x,y.mode,w),w.return=y,y=w),s(y)):r(y,b)}return function(y,b,x,w){try{bP=0;var A=v(y,b,x,w);return Rk=null,A}catch(S){if(S===_k||S===bU)throw S;var T=ud(29,S,null,y.mode);return T.lanes=w,T.return=y,T}finally{}}}var zw=xIe(!0),wIe=xIe(!1),mb=!1;function Aae(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Tae(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function vb(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function yb(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,Vi&2){var i=n.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),n.pending=e,e=fU(t),iIe(t,null,r),e}return dU(t,n,e,r),fU(t)}function wP(t,e,r){if(e=e.updateQueue,e!==null&&(e=e.shared,(r&4194048)!==0)){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,dMe(t,r)}}function Sae(t,e){var r=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var s={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};a===null?i=a=s:a=a.next=s,r=r.next}while(r!==null);a===null?i=a=e:a=a.next=e}else i=a=e;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,callbacks:n.callbacks},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}var Cae=!1;function AP(){if(Cae){var t=Ek;if(t!==null)throw t}}function TP(t,e,r,n){Cae=!1;var i=t.updateQueue;mb=!1;var a=i.firstBaseUpdate,s=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var l=o,u=l.next;l.next=null,s===null?a=u:s.next=u,s=l;var h=t.alternate;h!==null&&(h=h.updateQueue,o=h.lastBaseUpdate,o!==s&&(o===null?h.firstBaseUpdate=u:o.next=u,h.lastBaseUpdate=l))}if(a!==null){var d=i.baseState;s=0,h=u=l=null,o=a;do{var f=o.lane&-536870913,p=f!==o.lane;if(p?(pi&f)===f:(n&f)===f){f!==0&&f===kk&&(Cae=!0),h!==null&&(h=h.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var g=t,m=o;f=e;var v=r;switch(m.tag){case 1:if(g=m.payload,typeof g=="function"){d=g.call(v,d,f);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,f=typeof g=="function"?g.call(v,d,f):g,f==null)break e;d=Ga({},d,f);break e;case 2:mb=!0}}f=o.callback,f!==null&&(t.flags|=64,p&&(t.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},h===null?(u=h=p,l=d):h=h.next=p,s|=f;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;p=o,o=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);h===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=h,a===null&&(i.shared.lanes=0),Tb|=s,t.lanes=s,t.memoizedState=d}}function AIe(t,e){if(typeof t!="function")throw Error(Dt(191,t));t.call(e)}function TIe(t,e){var r=t.callbacks;if(r!==null)for(t.callbacks=null,t=0;ta?a:8;var s=Tn.T,o={};Tn.T=o,Gae(t,!1,e,r);try{var l=i(),u=Tn.S;if(u!==null&&u(o,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var h=Oer(l,n);OP(t,e,h,gd(t))}else OP(t,e,n,gd(t))}catch(d){OP(t,e,{then:function(){},status:"rejected",reason:d},gd())}finally{Ui.p=a,s!==null&&o.types!==null&&(s.types=o.types),Tn.T=s}}function Ler(){}function Vae(t,e,r,n){if(t.tag!==5)throw Error(Dt(476));var i=tPe(t).queue;ePe(t,i,e,Cw,r===null?Ler:function(){return rPe(t),r(n)})}function tPe(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:Cw,baseState:Cw,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yv,lastRenderedState:Cw},next:null};var r={};return e.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yv,lastRenderedState:r},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function rPe(t){var e=tPe(t);e.next===null&&(e=t.alternate.memoizedState),OP(t,e.next.queue,{},gd())}function Qae(){return Wl(QP)}function nPe(){return Zs().memoizedState}function iPe(){return Zs().memoizedState}function Mer(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var r=gd();t=vb(r);var n=yb(e,t,r);n!==null&&(vh(n,e,r),wP(n,e,r)),e={cache:yae()},t.payload=e;return}e=e.return}}function Ier(t,e,r){var n=gd();r={lane:n,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},LU(t)?sPe(e,r):(r=oae(t,e,r,n),r!==null&&(vh(r,t,n),oPe(r,e,n)))}function aPe(t,e,r){var n=gd();OP(t,e,r,n)}function OP(t,e,r,n){var i={lane:n,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(LU(t))sPe(e,i);else{var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var s=e.lastRenderedState,o=a(s,r);if(i.hasEagerState=!0,i.eagerState=o,cd(o,s))return dU(t,e,i,0),ya===null&&hU(),!1}catch{}finally{}if(r=oae(t,e,i,n),r!==null)return vh(r,t,n),oPe(r,e,n),!0}return!1}function Gae(t,e,r,n){if(n={lane:2,revertLane:Ase(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},LU(t)){if(e)throw Error(Dt(479))}else e=oae(t,r,n,2),e!==null&&vh(e,t,2)}function LU(t){var e=t.alternate;return t===Un||e!==null&&e===Un}function sPe(t,e){Lk=CU=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function oPe(t,e,r){if(r&4194048){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,dMe(t,r)}}var kP={readContext:Wl,use:EU,useCallback:Ds,useContext:Ds,useEffect:Ds,useImperativeHandle:Ds,useLayoutEffect:Ds,useInsertionEffect:Ds,useMemo:Ds,useReducer:Ds,useRef:Ds,useState:Ds,useDebugValue:Ds,useDeferredValue:Ds,useTransition:Ds,useSyncExternalStore:Ds,useId:Ds,useHostTransitionStatus:Ds,useFormState:Ds,useActionState:Ds,useOptimistic:Ds,useMemoCache:Ds,useCacheRefresh:Ds};kP.useEffectEvent=Ds;var lPe={readContext:Wl,use:EU,useCallback:function(t,e){return du().memoizedState=[t,e===void 0?null:e],t},useContext:Wl,useEffect:HIe,useImperativeHandle:function(t,e,r){r=r!=null?r.concat([t]):null,RU(4194308,4,jIe.bind(null,e,t),r)},useLayoutEffect:function(t,e){return RU(4194308,4,t,e)},useInsertionEffect:function(t,e){RU(4,2,t,e)},useMemo:function(t,e){var r=du();e=e===void 0?null:e;var n=t();if(Uw){cb(!0);try{t()}finally{cb(!1)}}return r.memoizedState=[n,e],n},useReducer:function(t,e,r){var n=du();if(r!==void 0){var i=r(e);if(Uw){cb(!0);try{r(e)}finally{cb(!1)}}}else i=e;return n.memoizedState=n.baseState=i,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:i},n.queue=t,t=t.dispatch=Ier.bind(null,Un,t),[n.memoizedState,t]},useRef:function(t){var e=du();return t={current:t},e.memoizedState=t},useState:function(t){t=Bae(t);var e=t.queue,r=aPe.bind(null,Un,e);return e.dispatch=r,[t.memoizedState,r]},useDebugValue:zae,useDeferredValue:function(t,e){var r=du();return Uae(r,t,e)},useTransition:function(){var t=Bae(!1);return t=ePe.bind(null,Un,t.queue,!0,!1),du().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,r){var n=Un,i=du();if(wi){if(r===void 0)throw Error(Dt(407));r=r()}else{if(r=e(),ya===null)throw Error(Dt(349));pi&127||_Ie(n,e,r)}i.memoizedState=r;var a={value:r,getSnapshot:e};return i.queue=a,HIe(DIe.bind(null,n,a,t),[t]),n.flags|=2048,Ik(9,{destroy:void 0},RIe.bind(null,n,a,r,e),null),r},useId:function(){var t=du(),e=ya.identifierPrefix;if(wi){var r=Gg,n=Qg;r=(n&~(1<<32-ld(n)-1)).toString(32)+r,e="_"+e+"R_"+r,r=OU++,0<\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof n.is=="string"?s.createElement("select",{is:n.is}):s.createElement("select"),n.multiple?a.multiple=!0:n.size&&(a.size=n.size);break;default:a=typeof n.is=="string"?s.createElement(i,{is:n.is}):s.createElement(i)}}a[Gl]=e,a[hh]=n;e:for(s=e.child;s!==null;){if(s.tag===5||s.tag===6)a.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===e)break e;for(;s.sibling===null;){if(s.return===null||s.return===e)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}e.stateNode=a;e:switch(ql(a,i,n),i){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&xv(e)}}return Wa(e),ise(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,r),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==n&&xv(e);else{if(typeof n!="string"&&e.stateNode===null)throw Error(Dt(166));if(t=lb.current,Ck(e)){if(t=e.stateNode,r=e.memoizedProps,n=null,i=Hl,i!==null)switch(i.tag){case 27:case 5:n=i.memoizedProps}t[Gl]=e,t=!!(t.nodeValue===r||n!==null&&n.suppressHydrationWarning===!0||k6e(t.nodeValue,r)),t||pb(e,!0)}else t=ZU(t).createTextNode(n),t[Gl]=e,e.stateNode=t}return Wa(e),null;case 31:if(r=e.memoizedState,t===null||t.memoizedState!==null){if(n=Ck(e),r!==null){if(t===null){if(!n)throw Error(Dt(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(Dt(557));t[Gl]=e}else Iw(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Wa(e),t=!1}else r=pae(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),t=!0;if(!t)return e.flags&256?(dd(e),e):(dd(e),null);if(e.flags&128)throw Error(Dt(558))}return Wa(e),null;case 13:if(n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(i=Ck(e),n!==null&&n.dehydrated!==null){if(t===null){if(!i)throw Error(Dt(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(Dt(317));i[Gl]=e}else Iw(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Wa(e),i=!1}else i=pae(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),i=!0;if(!i)return e.flags&256?(dd(e),e):(dd(e),null)}return dd(e),e.flags&128?(e.lanes=r,e):(r=n!==null,t=t!==null&&t.memoizedState!==null,r&&(n=e.child,i=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(i=n.alternate.memoizedState.cachePool.pool),a=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(a=n.memoizedState.cachePool.pool),a!==i&&(n.flags|=2048)),r!==t&&r&&(e.child.flags|=8192),BU(e,e.updateQueue),Wa(e),null);case 4:return lk(),t===null&&Ose(e.stateNode.containerInfo),Wa(e),null;case 10:return mv(e.type),Wa(e),null;case 19:if(hl(Ks),n=e.memoizedState,n===null)return Wa(e),null;if(i=(e.flags&128)!==0,a=n.rendering,a===null)if(i)_P(n,!1);else{if(Ls!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(a=SU(t),a!==null){for(e.flags|=128,_P(n,!1),t=a.updateQueue,e.updateQueue=t,BU(e,t),e.subtreeFlags=0,t=r,r=e.child;r!==null;)aIe(r,t),r=r.sibling;return ka(Ks,Ks.current&1|2),wi&&pv(e,n.treeForkCount),e.child}t=t.sibling}n.tail!==null&&sd()>VU&&(e.flags|=128,i=!0,_P(n,!1),e.lanes=4194304)}else{if(!i)if(t=SU(a),t!==null){if(e.flags|=128,i=!0,t=t.updateQueue,e.updateQueue=t,BU(e,t),_P(n,!0),n.tail===null&&n.tailMode==="hidden"&&!a.alternate&&!wi)return Wa(e),null}else 2*sd()-n.renderingStartTime>VU&&r!==536870912&&(e.flags|=128,i=!0,_P(n,!1),e.lanes=4194304);n.isBackwards?(a.sibling=e.child,e.child=a):(t=n.last,t!==null?t.sibling=a:e.child=a,n.last=a)}return n.tail!==null?(t=n.tail,n.rendering=t,n.tail=t.sibling,n.renderingStartTime=sd(),t.sibling=null,r=Ks.current,ka(Ks,i?r&1|2:r&1),wi&&pv(e,n.treeForkCount),t):(Wa(e),null);case 22:case 23:return dd(e),kae(),n=e.memoizedState!==null,t!==null?t.memoizedState!==null!==n&&(e.flags|=8192):n&&(e.flags|=8192),n?r&536870912&&!(e.flags&128)&&(Wa(e),e.subtreeFlags&6&&(e.flags|=8192)):Wa(e),r=e.updateQueue,r!==null&&BU(e,r.retryQueue),r=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),n=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),n!==r&&(e.flags|=2048),t!==null&&hl(Bw),null;case 24:return r=null,t!==null&&(r=t.memoizedState.cache),e.memoizedState.cache!==r&&(e.flags|=2048),mv(mo),Wa(e),null;case 25:return null;case 30:return null}throw Error(Dt(156,e.tag))}function Fer(t,e){switch(dae(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return mv(mo),lk(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return qz(e),null;case 31:if(e.memoizedState!==null){if(dd(e),e.alternate===null)throw Error(Dt(340));Iw()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(dd(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Dt(340));Iw()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return hl(Ks),null;case 4:return lk(),null;case 10:return mv(e.type),null;case 22:case 23:return dd(e),kae(),t!==null&&hl(Bw),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return mv(mo),null;case 25:return null;default:return null}}function LPe(t,e){switch(dae(e),e.tag){case 3:mv(mo),lk();break;case 26:case 27:case 5:qz(e);break;case 4:lk();break;case 31:e.memoizedState!==null&&dd(e);break;case 13:dd(e);break;case 19:hl(Ks);break;case 10:mv(e.type);break;case 22:case 23:dd(e),kae(),t!==null&&hl(Bw);break;case 24:mv(mo)}}function RP(t,e){try{var r=e.updateQueue,n=r!==null?r.lastEffect:null;if(n!==null){var i=n.next;r=i;do{if((r.tag&t)===t){n=void 0;var a=r.create,s=r.inst;n=a(),s.destroy=n}r=r.next}while(r!==i)}}catch(o){na(e,e.return,o)}}function wb(t,e,r){try{var n=e.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var a=i.next;n=a;do{if((n.tag&t)===t){var s=n.inst,o=s.destroy;if(o!==void 0){s.destroy=void 0,i=e;var l=r,u=o;try{u()}catch(h){na(i,l,h)}}}n=n.next}while(n!==a)}}catch(h){na(e,e.return,h)}}function MPe(t){var e=t.updateQueue;if(e!==null){var r=t.stateNode;try{TIe(e,r)}catch(n){na(t,t.return,n)}}}function IPe(t,e,r){r.props=Vw(t.type,t.memoizedProps),r.state=t.memoizedState;try{r.componentWillUnmount()}catch(n){na(t,e,n)}}function DP(t,e){try{var r=t.ref;if(r!==null){switch(t.tag){case 26:case 27:case 5:var n=t.stateNode;break;case 30:n=t.stateNode;break;default:n=t.stateNode}typeof r=="function"?t.refCleanup=r(n):r.current=n}}catch(i){na(t,e,i)}}function Hg(t,e){var r=t.ref,n=t.refCleanup;if(r!==null)if(typeof n=="function")try{n()}catch(i){na(t,e,i)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(i){na(t,e,i)}else r.current=null}function PPe(t){var e=t.type,r=t.memoizedProps,n=t.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":r.autoFocus&&n.focus();break e;case"img":r.src?n.src=r.src:r.srcSet&&(n.srcset=r.srcSet)}}catch(i){na(t,t.return,i)}}function ase(t,e,r){try{var n=t.stateNode;otr(n,t.type,r,e),n[hh]=e}catch(i){na(t,t.return,i)}}function NPe(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Eb(t.type)||t.tag===4}function sse(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||NPe(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Eb(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function ose(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(t,e):(e=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,e.appendChild(t),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=hv));else if(n!==4&&(n===27&&Eb(t.type)&&(r=t.stateNode,e=null),t=t.child,t!==null))for(ose(t,e,r),t=t.sibling;t!==null;)ose(t,e,r),t=t.sibling}function $U(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(n===27&&Eb(t.type)&&(r=t.stateNode),t=t.child,t!==null))for($U(t,e,r),t=t.sibling;t!==null;)$U(t,e,r),t=t.sibling}function BPe(t){var e=t.stateNode,r=t.memoizedProps;try{for(var n=t.type,i=e.attributes;i.length;)e.removeAttributeNode(i[0]);ql(e,n,r),e[Gl]=t,e[hh]=r}catch(a){na(t,t.return,a)}}var wv=!1,bo=!1,lse=!1,$Pe=typeof WeakSet=="function"?WeakSet:Set,fl=null;function zer(t,e){if(t=t.containerInfo,_se=aV,t=XMe(t),tae(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var s=0,o=-1,l=-1,u=0,h=0,d=t,f=null;t:for(;;){for(var p;d!==r||i!==0&&d.nodeType!==3||(o=s+i),d!==a||n!==0&&d.nodeType!==3||(l=s+n),d.nodeType===3&&(s+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===t)break t;if(f===r&&++u===i&&(o=s),f===a&&++h===n&&(l=s),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}r=o===-1||l===-1?null:{start:o,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(Rse={focusedElem:t,selectionRange:r},aV=!1,fl=e;fl!==null;)if(e=fl,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,fl=t;else for(;fl!==null;){switch(e=fl,a=e.alternate,t=e.flags,e.tag){case 0:if(t&4&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(r=0;r title"))),ql(a,n,r),a[Gl]=t,dl(a),n=a;break e;case"link":var s=G6e("link","href",i).get(n+(r.href||""));if(s){for(var o=0;ov&&(s=v,v=m,m=s);var y=qMe(o,m),b=qMe(o,v);if(y&&b&&(p.rangeCount!==1||p.anchorNode!==y.node||p.anchorOffset!==y.offset||p.focusNode!==b.node||p.focusOffset!==b.offset)){var x=d.createRange();x.setStart(y.node,y.offset),p.removeAllRanges(),m>v?(p.addRange(x),p.extend(b.node,b.offset)):(x.setEnd(b.node,b.offset),p.addRange(x))}}}}for(d=[],p=o;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;or?32:r,Tn.T=null,r=gse,gse=null;var a=Cb,s=Ov;if(Go=0,Fk=Cb=null,Ov=0,Vi&6)throw Error(Dt(331));var o=Vi;if(Vi|=4,jPe(a.current),WPe(a,a.current,s,r),Vi=o,BP(0,!1),od&&typeof od.onPostCommitFiberRoot=="function")try{od.onPostCommitFiberRoot(tP,a)}catch{}return!0}finally{Ui.p=i,Tn.T=n,f6e(t,e)}}function g6e(t,e,r){e=vf(r,e),e=qae(t.stateNode,e,2),t=yb(t,e,2),t!==null&&(nP(t,2),Wg(t))}function na(t,e,r){if(t.tag===3)g6e(t,t,r);else for(;e!==null;){if(e.tag===3){g6e(e,t,r);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Sb===null||!Sb.has(n))){t=vf(r,t),r=mPe(2),n=yb(e,r,2),n!==null&&(vPe(r,n,e,t),nP(n,2),Wg(n));break}}e=e.return}}function bse(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new Qer;var i=new Set;n.set(e,i)}else i=n.get(e),i===void 0&&(i=new Set,n.set(e,i));i.has(r)||(hse=!0,i.add(r),t=qer.bind(null,t,e,r),e.then(t,t))}function qer(t,e,r){var n=t.pingCache;n!==null&&n.delete(e),t.pingedLanes|=t.suspendedLanes&r,t.warmLanes&=~r,ya===t&&(pi&r)===r&&(Ls===4||Ls===3&&(pi&62914560)===pi&&300>sd()-UU?!(Vi&2)&&zk(t,0):dse|=r,$k===pi&&($k=0)),Wg(t)}function m6e(t,e){e===0&&(e=uMe()),t=Lw(t,e),t!==null&&(nP(t,e),Wg(t))}function jer(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),m6e(t,r)}function Xer(t,e){var r=0;switch(t.tag){case 31:case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;case 22:n=t.stateNode._retryCache;break;default:throw Error(Dt(314))}n!==null&&n.delete(e),m6e(t,r)}function Ker(t,e){return Lie(t,e)}var qU=null,Vk=null,xse=!1,jU=!1,wse=!1,kb=0;function Wg(t){t!==Vk&&t.next===null&&(Vk===null?qU=Vk=t:Vk=Vk.next=t),jU=!0,xse||(xse=!0,Jer())}function BP(t,e){if(!wse&&jU){wse=!0;do for(var r=!1,n=qU;n!==null;){if(t!==0){var i=n.pendingLanes;if(i===0)var a=0;else{var s=n.suspendedLanes,o=n.pingedLanes;a=(1<<31-ld(42|t)+1)-1,a&=i&~(s&~o),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(r=!0,x6e(n,a))}else a=pi,a=Jz(n,n===ya?a:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),!(a&3)||rP(n,a)||(r=!0,x6e(n,a));n=n.next}while(r);wse=!1}}function Zer(){v6e()}function v6e(){jU=xse=!1;var t=0;kb!==0&&ctr()&&(t=kb);for(var e=sd(),r=null,n=qU;n!==null;){var i=n.next,a=y6e(n,e);a===0?(n.next=null,r===null?qU=i:r.next=i,i===null&&(Vk=r)):(r=n,(t!==0||a&3)&&(jU=!0)),n=i}Go!==0&&Go!==5||BP(t),kb!==0&&(kb=0)}function y6e(t,e){for(var r=t.suspendedLanes,n=t.pingedLanes,i=t.expirationTimes,a=t.pendingLanes&-62914561;0o)break;var h=l.transferSize,d=l.initiatorType;h&&E6e(d)&&(l=l.responseEnd,s+=h*(l"u"?null:document;function z6e(t,e,r){var n=Qk;if(n&&typeof e=="string"&&e){var i=gf(e);i='link[rel="'+t+'"][href="'+i+'"]',typeof r=="string"&&(i+='[crossorigin="'+r+'"]'),F6e.has(i)||(F6e.add(i),t={rel:t,crossOrigin:r,href:e},n.querySelector(i)===null&&(e=n.createElement("link"),ql(e,"link",t),dl(e),n.head.appendChild(e)))}}function ytr(t){kv.D(t),z6e("dns-prefetch",t,null)}function btr(t,e){kv.C(t,e),z6e("preconnect",t,e)}function xtr(t,e,r){kv.L(t,e,r);var n=Qk;if(n&&t&&e){var i='link[rel="preload"][as="'+gf(e)+'"]';e==="image"&&r&&r.imageSrcSet?(i+='[imagesrcset="'+gf(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(i+='[imagesizes="'+gf(r.imageSizes)+'"]')):i+='[href="'+gf(t)+'"]';var a=i;switch(e){case"style":a=Gk(t);break;case"script":a=Hk(t)}Tf.has(a)||(t=Ga({rel:"preload",href:e==="image"&&r&&r.imageSrcSet?void 0:t,as:e},r),Tf.set(a,t),n.querySelector(i)!==null||e==="style"&&n.querySelector(UP(a))||e==="script"&&n.querySelector(VP(a))||(e=n.createElement("link"),ql(e,"link",t),dl(e),n.head.appendChild(e)))}}function wtr(t,e){kv.m(t,e);var r=Qk;if(r&&t){var n=e&&typeof e.as=="string"?e.as:"script",i='link[rel="modulepreload"][as="'+gf(n)+'"][href="'+gf(t)+'"]',a=i;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Hk(t)}if(!Tf.has(a)&&(t=Ga({rel:"modulepreload",href:t},e),Tf.set(a,t),r.querySelector(i)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(VP(a)))return}n=r.createElement("link"),ql(n,"link",t),dl(n),r.head.appendChild(n)}}}function Atr(t,e,r){kv.S(t,e,r);var n=Qk;if(n&&t){var i=dk(n).hoistableStyles,a=Gk(t);e=e||"default";var s=i.get(a);if(!s){var o={loading:0,preload:null};if(s=n.querySelector(UP(a)))o.loading=5;else{t=Ga({rel:"stylesheet",href:t,"data-precedence":e},r),(r=Tf.get(a))&&Bse(t,r);var l=s=n.createElement("link");dl(l),ql(l,"link",t),l._p=new Promise(function(u,h){l.onload=u,l.onerror=h}),l.addEventListener("load",function(){o.loading|=1}),l.addEventListener("error",function(){o.loading|=2}),o.loading|=4,eV(s,e,n)}s={type:"stylesheet",instance:s,count:1,state:o},i.set(a,s)}}}function Ttr(t,e){kv.X(t,e);var r=Qk;if(r&&t){var n=dk(r).hoistableScripts,i=Hk(t),a=n.get(i);a||(a=r.querySelector(VP(i)),a||(t=Ga({src:t,async:!0},e),(e=Tf.get(i))&&$se(t,e),a=r.createElement("script"),dl(a),ql(a,"link",t),r.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},n.set(i,a))}}function Str(t,e){kv.M(t,e);var r=Qk;if(r&&t){var n=dk(r).hoistableScripts,i=Hk(t),a=n.get(i);a||(a=r.querySelector(VP(i)),a||(t=Ga({src:t,async:!0,type:"module"},e),(e=Tf.get(i))&&$se(t,e),a=r.createElement("script"),dl(a),ql(a,"link",t),r.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},n.set(i,a))}}function U6e(t,e,r,n){var i=(i=lb.current)?JU(i):null;if(!i)throw Error(Dt(446));switch(t){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(e=Gk(r.href),r=dk(i).hoistableStyles,n=r.get(e),n||(n={type:"style",instance:null,count:0,state:null},r.set(e,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){t=Gk(r.href);var a=dk(i).hoistableStyles,s=a.get(t);if(s||(i=i.ownerDocument||i,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(t,s),(a=i.querySelector(UP(t)))&&!a._p&&(s.instance=a,s.state.loading=5),Tf.has(t)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},Tf.set(t,r),a||Ctr(i,t,r,s.state))),e&&n===null)throw Error(Dt(528,""));return s}if(e&&n!==null)throw Error(Dt(529,""));return null;case"script":return e=r.async,r=r.src,typeof r=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Hk(r),r=dk(i).hoistableScripts,n=r.get(e),n||(n={type:"script",instance:null,count:0,state:null},r.set(e,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(Dt(444,t))}}function Gk(t){return'href="'+gf(t)+'"'}function UP(t){return'link[rel="stylesheet"]['+t+"]"}function V6e(t){return Ga({},t,{"data-precedence":t.precedence,precedence:null})}function Ctr(t,e,r,n){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?n.loading=1:(e=t.createElement("link"),n.preload=e,e.addEventListener("load",function(){return n.loading|=1}),e.addEventListener("error",function(){return n.loading|=2}),ql(e,"link",r),dl(e),t.head.appendChild(e))}function Hk(t){return'[src="'+gf(t)+'"]'}function VP(t){return"script[async]"+t}function Q6e(t,e,r){if(e.count++,e.instance===null)switch(e.type){case"style":var n=t.querySelector('style[data-href~="'+gf(r.href)+'"]');if(n)return e.instance=n,dl(n),n;var i=Ga({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return n=(t.ownerDocument||t).createElement("style"),dl(n),ql(n,"style",i),eV(n,r.precedence,t),e.instance=n;case"stylesheet":i=Gk(r.href);var a=t.querySelector(UP(i));if(a)return e.state.loading|=4,e.instance=a,dl(a),a;n=V6e(r),(i=Tf.get(i))&&Bse(n,i),a=(t.ownerDocument||t).createElement("link"),dl(a);var s=a;return s._p=new Promise(function(o,l){s.onload=o,s.onerror=l}),ql(a,"link",n),e.state.loading|=4,eV(a,r.precedence,t),e.instance=a;case"script":return a=Hk(r.src),(i=t.querySelector(VP(a)))?(e.instance=i,dl(i),i):(n=r,(i=Tf.get(a))&&(n=Ga({},r),$se(n,i)),t=t.ownerDocument||t,i=t.createElement("script"),dl(i),ql(i,"link",n),t.head.appendChild(i),e.instance=i);case"void":return null;default:throw Error(Dt(443,e.type))}else e.type==="stylesheet"&&!(e.state.loading&4)&&(n=e.instance,e.state.loading|=4,eV(n,r.precedence,t));return e.instance}function eV(t,e,r){for(var n=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=n.length?n[n.length-1]:null,a=i,s=0;s title"):null)}function Otr(t,e,r){if(r===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return t=e.disabled,typeof e.precedence=="string"&&t==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function W6e(t){return!(t.type==="stylesheet"&&!(t.state.loading&3))}function ktr(t,e,r,n){if(r.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&!(r.state.loading&4)){if(r.instance===null){var i=Gk(n.href),a=e.querySelector(UP(i));if(a){e=a._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=rV.bind(t),e.then(t,t)),r.state.loading|=4,r.instance=a,dl(a);return}a=e.ownerDocument||e,n=V6e(n),(i=Tf.get(i))&&Bse(n,i),a=a.createElement("link"),dl(a);var s=a;s._p=new Promise(function(o,l){s.onload=o,s.onerror=l}),ql(a,"link",n),r.instance=a}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(r,e),(e=r.state.preload)&&!(r.state.loading&3)&&(t.count++,r=rV.bind(t),e.addEventListener("load",r),e.addEventListener("error",r))}}var Fse=0;function Etr(t,e){return t.stylesheets&&t.count===0&&iV(t,t.stylesheets),0Fse?50:800)+e);return t.unsuspend=r,function(){t.unsuspend=null,clearTimeout(n),clearTimeout(i)}}:null}function rV(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)iV(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var nV=null;function iV(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,nV=new Map,e.forEach(_tr,t),nV=null,rV.call(t))}function _tr(t,e){if(!(e.state.loading&4)){var r=nV.get(t);if(r)var n=r.get(null);else{r=new Map,nV.set(t,r);for(var i=t.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(sNe)}catch(t){console.error(t)}}sNe(),LLe.exports=Vz;var Btr=LLe.exports;const oNe={requestFailed:"Request failed ({{status}})",unknownError:"Unknown error",contentTypeMissing:"Content-Type missing",response:"Response: {{response}}",fallbackWithDetail:"{{fallback}}: {{detail}}",fallbackWithHttpStatus:"{{fallback}} (HTTP {{status}})",nonJsonResponse:"{{fallback}}: the server returned a non-JSON response ({{contentType}})"},lNe={unconfigured:"AgentKit Dev Sandbox has not been configured by an administrator.",invalidSession:"AgentKit CLI returned an invalid session.",loadCapabilitiesFailed:"Unable to load the AgentKit CLI configuration.",invalidCapabilities:"AgentKit CLI returned an invalid configuration status.",listSessionsFailed:"Unable to load AgentKit CLI sessions.",invalidSessionList:"AgentKit CLI returned an invalid session list.",createSessionFailed:"Unable to create an AgentKit CLI session.",openSessionFailed:"Unable to open the AgentKit CLI session.",openTerminalFailed:"Unable to open the AgentKit CLI terminal.",invalidTerminalUrl:"AgentKit CLI returned an invalid terminal URL."},cNe={cnBeijing:"China North 2 (Beijing)",cnShanghai:"China East 2 (Shanghai)"},uNe={runtimeUnsupported:"This Runtime does not currently support connections. Confirm that the service is running normally."},hNe={autoConfigureFailed:"Failed to configure the Feishu bot automatically"},dNe={actionFailed:"Failed to {{action}}",detail:"Details: {{detail}}",request:"Request: {{request}}"},fNe={persistentMemoryHint:"Tip: The session no longer exists. With in-memory or SQLite short-term memory, sessions may be lost during multi-instance routing, process restarts, or rolling deployments. Use database-backed persistent short-term memory instead.",unsupportedRouteHint:"Tip: This Runtime does not provide the session run API and may be incompatible with the current Studio version.",toolArgumentHint:"Tip: The model generated incomplete tool arguments. Send the request again.",resourceCollectionExpiredHint:"Tip: This resource collection has expired. Send the task again so the system can collect the resources before creating the Agent.",networkConfigurationHint:"Tip: Check network settings such as the shared public egress, then try again.",modelQuotaHint:"Tip: The model has reached its TPM/RPM quota. Try again later or increase the model quota.",rawResponseLabel:"Raw response: "},pNe={httpStatus:"HTTP status: {{status}}",errorCode:"Error code: {{code}}",cloudResponseBody:`Cloud response body: -{{body}}`,loadFailedWithDetail:"Failed to load instance logs: {{detail}}",invalidFormat:"Failed to load instance logs: the service returned an invalid format"},gNe={untitledSession:"Untitled session",webUnavailable:"Web search is unavailable because /web/search is not enabled on the server.",webFailed:"Web search failed: {{message}}",webNotMounted:"This Agent does not have the web_search tool mounted.",knowledgeNotMounted:"This Agent does not have a knowledge base mounted.",memoryNotMounted:"This Agent does not have long-term memory mounted.",knowledge:"Knowledge base",longTermMemory:"Long-term memory"},mNe={listSpacesFailed:"Failed to load Skill spaces",createSpaceFailed:"Failed to create the Skill space",updateSpaceFailed:"Failed to update the Skill space",deleteSpaceFailed:"Failed to delete the Skill space",uploadFailed:"Failed to upload the Skill",validateFailed:"Failed to validate the Skill",deleteFailed:"Failed to delete the Skill",listFilesFailed:"Failed to load Skill files",downloadFailed:"Failed to download the Skill"},vNe={truncatedData:"{{data}}… (truncated, {{count}} characters total)",incompleteEvent:"The stream ended with an incomplete SSE event. Raw data: {{data}}",invalidEventJson:"Failed to parse the SSE event JSON. Raw data: {{data}}"},yNe={loadConfigNetworkFailed:"Unable to load the sign-in configuration. Check your network and try again.",configServiceFailed:"The sign-in configuration service failed (HTTP {{status}}). Try again later.",invalidConfigResponse:"The sign-in configuration service returned an unreadable response. Try again later.",serviceNetworkFailed:"Unable to connect to the identity service. Check your network and try again.",invalidServiceResponse:"The identity service returned an unreadable response. Try again later.",serviceFailed:"The identity service failed (HTTP {{status}}). Try again later."},bNe={invalidToken:"The GitHub token is invalid or does not have repository write access",notFound:"The repository, branch, or file does not exist, or the token cannot access it",rejectedCommit:"GitHub rejected the commit. Check the branch and file state",requestFailed:"GitHub request failed (HTTP {{status}})",networkFailed:"Unable to connect to GitHub. Check your network and try again",invalidRepositoryFormat:"The GitHub repository must use the owner/repository format",insecureRepositoryUrl:"Only secure github.com repository URLs are supported",unsafeProjectPath:"The Agent project directory must be a safe relative path within the repository",tokenRequired:"A GitHub token is required",invalidBaseBranch:"The target branch format is invalid",invalidPublishBranch:"The publish branch format is invalid",noFiles:"There are no files to commit",missingBaseSha:"The target branch does not have a valid Git SHA",fileAlreadyExists:"{{path}} already exists in the target repository; the existing file was not overwritten",pathNotUpdatable:"The target path {{path}} is not an updatable file",invalidPullRequest:"GitHub did not return a valid pull request"},xNe={loadCapabilitiesFailed:"Failed to load video model capabilities",uploadAssetFailed:"Failed to upload {{fileName}}",enhancePromptFailed:"Failed to enhance the prompt",createTaskFailed:"Failed to create the video generation task",getTaskFailed:"Failed to load the video generation task",downloadFailed:"Failed to download the generated video"},wNe={listFailed:"Failed to load website integrations",createFailed:"Failed to create the website integration",deleteFailed:"Failed to delete the website integration"},ANe={loadFailed:"Failed to load the knowledge base",htmlHidden:"[HTML content hidden]",redacted:"[redacted]",depthTruncated:"[content nested too deeply; truncated]",circularReference:"[circular reference]",diagnosticsUnavailable:"[diagnostic information unavailable]",statusCode:"Status: {{status}}",errorCode:"Error code: {{code}}",requestId:"Request ID: {{requestId}}",diagnostics:"Diagnostics: {{diagnostics}}",detail:"Details: {{detail}}",signInRequired:"Sign in before accessing knowledge bases",forbidden:"You do not have permission to operate on this knowledge base",notFound:"The knowledge base or knowledge content does not exist",conflict:"The knowledge base cannot perform this operation in its current state",requestFailed:"Knowledge base request failed ({{status}})"},TNe={invalidSourceSnapshot:"The source snapshot response has an invalid format.",invalidProjectList:"The project list response has an invalid format.",invalidProjectVersion:"The project version response has an invalid format.",loadProjectsFailed:"Unable to load saved projects",loadVersionsFailed:"Unable to load project versions",deleteVersionFailed:"Failed to delete the project version",invalidDeleteVersionResponse:"The project version deletion response has an invalid format.",loadProjectSourceFailed:"Unable to load project source",loadSnapshotFailed:"Unable to load the source snapshot",restoreSnapshotFailed:"Unable to restore the current source snapshot",downloadSourceFailed:"Failed to download the source",downloadNotZip:"The source download response is not a ZIP file.",downloadSizeMismatch:"The source archive size does not match the published record. Try again."},SNe={invalidFormat:"{{label}} has an invalid format.",validationSeparator:"; ",invalidAnalysisResult:"The migration analysis result has an invalid format.",invalidFrameworkCandidate:"A framework candidate has an invalid format.",invalidAnalysisEvidence:"The analysis evidence has an invalid format.",invalidEntryCandidate:"An entry candidate has an invalid format.",invalidQuestion:"A follow-up question has an invalid format.",invalidTask:"The migration session has an invalid format.",invalidAnalysisReference:"The analysis result reference has an invalid format.",invalidSourcePersistence:"The migration source persistence status has an invalid format.",invalidActivity:"The migration activity has an invalid format.",invalidActivityItem:"A migration activity item has an invalid format.",invalidActivityTool:"A migration activity tool item has an invalid format.",invalidActivityPlan:"The migration execution plan has an invalid format.",invalidActivityPlanItem:"A migration execution plan item has an invalid format.",invalidArtifact:"The migration artifact has an invalid format.",invalidEnvironmentDefaults:"The environment variable defaults have an invalid format.",invalidArtifactFile:"A migration artifact file has an invalid format.",invalidVerificationCheck:"A migration verification check has an invalid format.",requestValidationFailed:"Request validation failed: {{detail}}",gatewayError:"{{fallback}} (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",nonJsonResponse:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}). Check the proxy or gateway configuration.",loadCapabilitiesFailed:"Failed to load migration capabilities",invalidCapabilities:"The migration capabilities have an invalid format.",invalidModelCapabilities:"The migration model capabilities have an invalid format.",loadTasksFailed:"Failed to load migration sessions",invalidTaskList:"The migration session list has an invalid format.",createTaskFailed:"Failed to create the migration session",uploadProjectFailed:"Failed to upload the migration project",loadActivityFailed:"Failed to load migration activity",startFailed:"Failed to start the migration",submitAnswersFailed:"Failed to submit additional analysis information",stopFailed:"Failed to stop the migration",deleteTaskFailed:"Failed to delete the migration session",loadArtifactFailed:"Failed to load the migration artifact",loadArtifactFileFailed:"Failed to load the migration artifact file",downloadArtifactFailed:"Failed to download the migration artifact",labels:{analysisResult:"Migration analysis result",recommendation:"Migration recommendation",boundary:"Migration boundary",frameworkCandidate:"Framework candidate",analysisEvidence:"Analysis evidence",recommendedFramework:"Recommended framework",entryCandidate:"Entry candidate",entryFramework:"Entry framework",includeScope:"Migration include scope",excludeScope:"Migration exclude scope",assumptions:"Analysis assumptions",question:"Follow-up question",analysisWarnings:"Migration warnings",task:"Migration session",artifactStatus:"Migration artifact status",analysisReference:"Analysis result reference",confirmation:"Migration confirmation",confirmedFramework:"Confirmed framework",error:"Migration error",sourcePersistence:"Migration source persistence status",activity:"Migration activity",activityItem:"Migration activity item",activityTool:"Migration activity tool item",activityPlanItem:"Migration activity plan item",artifact:"Migration artifact",cli:"CLI information",migration:"Migration information",startup:"Startup information",environment:"Environment variable information",verification:"Verification information",report:"Migration report",archive:"Artifact archive",environmentDefaults:"Environment variable defaults",requiredEnvironment:"Required environment variables",optionalEnvironment:"Optional environment variables",artifactFile:"Migration artifact file",verificationCheck:"Migration verification check",artifactWarnings:"Migration artifact warnings",errorResponse:"Error response",errorDetail:"Error details",capabilities:"Migration capabilities",framework:"Migration framework",modelCapabilities:"Migration model capabilities",taskList:"Migration session list"}},CNe={status:{ready:"Ready",wakeable:"Wakeable",creating:"Creating",starting:"Starting",pending:"Pending",running:"Running",failed:"Error",stopped:"Stopped",expired:"Expired",deleting:"Deleting",deleted:"Deleted",unknown:"Unknown status"},developmentTimeout:"The development environment timed out. The task may still be running; reopen this session later to check its status.",developmentDisconnected:"The connection to the development environment was interrupted. The task may still be running; reopen this session later to check its status.",developmentFailed:"The development task could not continue. The environment was preserved; try again in this session.",invalidStudioResponse:"{{fallback}} Studio returned an invalid response. Refresh and try again.",invalidSession:"AgentKit Sandbox returned invalid session information.",invalidSnapshot:"AgentKit Sandbox returned invalid snapshot information.",invalidSettings:"Sandbox returned invalid settings.",invalidThreadSnapshot:"Sandbox returned an invalid thread snapshot.",emptyConversationResponse:"The Sandbox conversation service returned no content.",invalidConversationResponse:"The Sandbox conversation service returned an unreadable response.",conversationFailed:"The Sandbox conversation failed. Try again later.",emptyReply:"Sandbox did not return a valid reply. Try again.",missingSession:"The AgentKit session is missing.",listCodexFailed:"Unable to load Codex agents. Try again later.",invalidSessionList:"AgentKit Sandbox returned an invalid session list.",invalidSnapshotList:"AgentKit Sandbox returned an invalid snapshot list.",startFailed:"Unable to start AgentKit Sandbox. Try again later.",listAgentFailed:"Unable to load {{kind}} agents. Try again later.",invalidKindSessionList:"AgentKit returned an invalid {{kind}} session list.",invalidKindSnapshotList:"AgentKit returned an invalid {{kind}} snapshot list.",createAgentFailed:"Unable to create a {{kind}} agent. Try again later.",missingSessionToOpen:"The AgentKit session to open is missing.",openAgentFailed:"Unable to open the {{kind}} agent.",invalidAgentHomeUrl:"The {{kind}} agent returned an invalid home URL.",missingSessionForTerminal:"The AgentKit session for the terminal is missing.",openTerminalFailed:"Unable to open the {{kind}} terminal.",deleteAgentFailed:"Unable to delete the {{kind}} agent.",missingSnapshot:"The AgentKit snapshot to wake is missing.",resumeSnapshotFailed:"Unable to wake the agent from its snapshot. Try again later.",deleteSnapshotFailed:"Unable to delete the agent snapshot.",missingSessionToConnect:"The AgentKit session to connect is missing.",connectCodexFailed:"Unable to connect to the Codex agent. Try again later.",sessionNotReady:"The AgentKit session is not ready. Current status: {{status}}.",invalidMessage:"The built-in agent session does not contain a valid message.",interruptFailed:"Unable to stop the current task.",getStatusFailed:"Unable to load Codex status.",getEndpointFailed:"Unable to load the Sandbox endpoint.",invalidEndpoint:"Sandbox returned an invalid endpoint.",createHandoffPairingFailed:"Unable to create a Codex cloud handoff pairing code.",invalidHandoffPairing:"Studio returned an invalid Codex cloud handoff pairing code.",getHandoffStatusFailed:"Unable to load the cloud handoff status.",invalidHandoffStatus:"Studio returned an invalid cloud handoff status.",listModelsFailed:"Unable to load Codex models.",invalidModelList:"Sandbox returned an invalid model list.",setModelFailed:"Unable to switch the Codex model.",invalidModel:"Sandbox returned an invalid model.",listSkillsFailed:"Unable to load Codex Skills.",invalidSkillList:"Sandbox returned an invalid Skill list.",listThreadsFailed:"Unable to load Codex threads.",invalidThreadList:"Sandbox returned an invalid thread list.",createThreadFailed:"Unable to create a new Codex thread.",missingThread:"The Codex thread to read is missing.",readThreadFailed:"Unable to load Codex history.",resumeThreadFailed:"Unable to resume the Codex thread.",forkThreadFailed:"Unable to fork the Codex thread.",archiveThreadFailed:"Unable to archive the Codex thread.",invalidArchiveResult:"Sandbox returned an invalid archive result.",deleteThreadFailed:"Unable to delete the Codex thread.",invalidDeleteResult:"Sandbox returned an invalid deletion result.",compactThreadFailed:"Unable to compact the Codex thread.",getSettingsFailed:"Unable to load Codex permissions and workspace settings.",updatePermissionsFailed:"Unable to update Codex permissions.",updateWorkspaceFailed:"Unable to update the Codex workspace.",invalidWorkingDirectory:"Sandbox returned an invalid working directory.",listDirectoriesFailed:"Unable to load Sandbox directories.",invalidDirectoryList:"Sandbox returned an invalid directory list.",resolveApprovalFailed:"Unable to submit the Codex approval decision.",uploadFileFailed:"Unable to upload the file to Sandbox.",invalidUploadResult:"Sandbox returned an invalid upload result.",disconnectCodexFailed:"Unable to disconnect the Codex agent.",deleteCodexFailed:"Unable to delete the Codex agent.",openSandboxTerminalFailed:"Unable to open the Sandbox terminal.",openSandboxBrowserFailed:"Unable to open the Sandbox browser.",toolLabel:"Sandbox tool",invalidToolUrl:"{{label}} returned an invalid URL.",unsafeToolUrl:"{{label}} returned an unsafe URL."},ONe={invalidSandboxVersion:"Invalid sandbox version response",loadSandboxVersionsFailed:"Failed to check sandbox versions",updateSandboxFailed:"Failed to update sandbox",invalidSandboxUpdate:"Invalid sandbox update response",errorWithDetailAndRawResponse:`{{context}} +`+n.stack}}var Die=Object.prototype.hasOwnProperty,Lie=Qo.unstable_scheduleCallback,Mie=Qo.unstable_cancelCallback,mJt=Qo.unstable_shouldYield,vJt=Qo.unstable_requestPaint,sd=Qo.unstable_now,yJt=Qo.unstable_getCurrentPriorityLevel,oMe=Qo.unstable_ImmediatePriority,lMe=Qo.unstable_UserBlockingPriority,jz=Qo.unstable_NormalPriority,bJt=Qo.unstable_LowPriority,cMe=Qo.unstable_IdlePriority,xJt=Qo.log,wJt=Qo.unstable_setDisableYieldValue,tP=null,od=null;function cb(t){if(typeof xJt=="function"&&wJt(t),od&&typeof od.setStrictMode=="function")try{od.setStrictMode(tP,t)}catch{}}var ld=Math.clz32?Math.clz32:TJt,AJt=Math.log,SJt=Math.LN2;function TJt(t){return t>>>=0,t===0?32:31-(AJt(t)/SJt|0)|0}var Xz=256,Kz=262144,Zz=4194304;function kw(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Jz(t,e,r){var n=t.pendingLanes;if(n===0)return 0;var i=0,a=t.suspendedLanes,s=t.pingedLanes;t=t.warmLanes;var o=n&134217727;return o!==0?(n=o&~a,n!==0?i=kw(n):(s&=o,s!==0?i=kw(s):r||(r=o&~t,r!==0&&(i=kw(r))))):(o=n&~a,o!==0?i=kw(o):s!==0?i=kw(s):r||(r=n&~t,r!==0&&(i=kw(r)))),i===0?0:e!==0&&e!==i&&!(e&a)&&(a=i&-i,r=e&-e,a>=r||a===32&&(r&4194048)!==0)?e:i}function rP(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function CJt(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32: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+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function uMe(){var t=Zz;return Zz<<=1,!(Zz&62914560)&&(Zz=4194304),t}function Iie(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function nP(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function OJt(t,e,r,n,i,a){var s=t.pendingLanes;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=r,t.entangledLanes&=r,t.errorRecoveryDisabledLanes&=r,t.shellSuspendCounter=0;var o=t.entanglements,l=t.expirationTimes,u=t.hiddenUpdates;for(r=s&~r;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var LJt=/[\n"\\]/g;function gf(t){return t.replace(LJt,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function zie(t,e,r,n,i,a,s,o){t.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?t.type=s:t.removeAttribute("type"),e!=null?s==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+pf(e)):t.value!==""+pf(e)&&(t.value=""+pf(e)):s!=="submit"&&s!=="reset"||t.removeAttribute("value"),e!=null?Uie(t,s,pf(e)):r!=null?Uie(t,s,pf(r)):n!=null&&t.removeAttribute("value"),i==null&&a!=null&&(t.defaultChecked=!!a),i!=null&&(t.checked=i&&typeof i!="function"&&typeof i!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?t.name=""+pf(o):t.removeAttribute("name")}function SMe(t,e,r,n,i,a,s,o){if(a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(t.type=a),e!=null||r!=null){if(!(a!=="submit"&&a!=="reset"||e!=null)){Fie(t);return}r=r!=null?""+pf(r):"",e=e!=null?""+pf(e):r,o||e===t.value||(t.value=e),t.defaultValue=e}n=n??i,n=typeof n!="function"&&typeof n!="symbol"&&!!n,t.checked=o?t.checked:!!n,t.defaultChecked=!!n,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.name=s),Fie(t)}function Uie(t,e,r){e==="number"&&rU(t.ownerDocument)===t||t.defaultValue===""+r||(t.defaultValue=""+r)}function pk(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wie=!1;if(dv)try{var oP={};Object.defineProperty(oP,"passive",{get:function(){Wie=!0}}),window.addEventListener("test",oP,oP),window.removeEventListener("test",oP,oP)}catch{Wie=!1}var hb=null,Yie=null,iU=null;function RMe(){if(iU)return iU;var t,e=Yie,r=e.length,n,i="value"in hb?hb.value:hb.textContent,a=i.length;for(t=0;t=uP),NMe=" ",BMe=!1;function $Me(t,e){switch(t){case"keyup":return ser.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function FMe(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var yk=!1;function ler(t,e){switch(t){case"compositionend":return FMe(e);case"keypress":return e.which!==32?null:(BMe=!0,NMe);case"textInput":return t=e.data,t===NMe&&BMe?null:t;default:return null}}function cer(t,e){if(yk)return t==="compositionend"||!Zie&&$Me(t,e)?(t=RMe(),iU=Yie=hb=null,yk=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=YMe(r)}}function jMe(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?jMe(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function XMe(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=rU(t.document);e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=rU(t.document)}return e}function tae(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var ver=dv&&"documentMode"in document&&11>=document.documentMode,bk=null,rae=null,pP=null,nae=!1;function KMe(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;nae||bk==null||bk!==rU(n)||(n=bk,"selectionStart"in n&&tae(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),pP&&fP(pP,n)||(pP=n,n=KU(rae,"onSelect"),0>=s,i-=s,Qg=1<<32-ld(e)+i|r<O?(k=T,T=null):k=T.sibling;var E=f(y,T,x[O],w);if(E===null){T===null&&(T=k);break}t&&T&&E.alternate===null&&e(y,T),b=a(E,b,O),S===null?A=E:S.sibling=E,S=E,T=k}if(O===x.length)return r(y,T),wi&&pv(y,O),A;if(T===null){for(;OO?(k=T,T=null):k=T.sibling;var _=f(y,T,E.value,w);if(_===null){T===null&&(T=k);break}t&&T&&_.alternate===null&&e(y,T),b=a(_,b,O),S===null?A=_:S.sibling=_,S=_,T=k}if(E.done)return r(y,T),wi&&pv(y,O),A;if(T===null){for(;!E.done;O++,E=x.next())E=d(y,E.value,w),E!==null&&(b=a(E,b,O),S===null?A=E:S.sibling=E,S=E);return wi&&pv(y,O),A}for(T=n(T);!E.done;O++,E=x.next())E=p(T,y,O,E.value,w),E!==null&&(t&&E.alternate!==null&&T.delete(E.key===null?O:E.key),b=a(E,b,O),S===null?A=E:S.sibling=E,S=E);return t&&T.forEach(function(I){return e(y,I)}),wi&&pv(y,O),A}function v(y,b,x,w){if(typeof x=="object"&&x!==null&&x.type===sk&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Hz:e:{for(var A=x.key;b!==null;){if(b.key===A){if(A=x.type,A===sk){if(b.tag===7){r(y,b.sibling),w=i(b,x.props.children),w.return=y,y=w;break e}}else if(b.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===ob&&$w(A)===b.type){r(y,b.sibling),w=i(b,x.props),xP(w,x),w.return=y,y=w;break e}r(y,b);break}else e(y,b);b=b.sibling}x.type===sk?(w=Mw(x.props.children,y.mode,w,x.key),w.return=y,y=w):(w=pU(x.type,x.key,x.props,null,y.mode,w),xP(w,x),w.return=y,y=w)}return s(y);case KI:e:{for(A=x.key;b!==null;){if(b.key===A)if(b.tag===4&&b.stateNode.containerInfo===x.containerInfo&&b.stateNode.implementation===x.implementation){r(y,b.sibling),w=i(b,x.children||[]),w.return=y,y=w;break e}else{r(y,b);break}else e(y,b);b=b.sibling}w=uae(x,y.mode,w),w.return=y,y=w}return s(y);case ob:return x=$w(x),v(y,b,x,w)}if(JI(x))return g(y,b,x,w);if(ZI(x)){if(A=ZI(x),typeof A!="function")throw Error(Dt(150));return x=A.call(x),m(y,b,x,w)}if(typeof x.then=="function")return v(y,b,wU(x),w);if(x.$$typeof===cv)return v(y,b,vU(y,x),w);AU(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint"?(x=""+x,b!==null&&b.tag===6?(r(y,b.sibling),w=i(b,x),w.return=y,y=w):(r(y,b),w=cae(x,y.mode,w),w.return=y,y=w),s(y)):r(y,b)}return function(y,b,x,w){try{bP=0;var A=v(y,b,x,w);return Rk=null,A}catch(T){if(T===_k||T===bU)throw T;var S=ud(29,T,null,y.mode);return S.lanes=w,S.return=y,S}finally{}}}var zw=xIe(!0),wIe=xIe(!1),mb=!1;function Aae(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Sae(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function vb(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function yb(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,Vi&2){var i=n.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),n.pending=e,e=fU(t),iIe(t,null,r),e}return dU(t,n,e,r),fU(t)}function wP(t,e,r){if(e=e.updateQueue,e!==null&&(e=e.shared,(r&4194048)!==0)){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,dMe(t,r)}}function Tae(t,e){var r=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var s={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};a===null?i=a=s:a=a.next=s,r=r.next}while(r!==null);a===null?i=a=e:a=a.next=e}else i=a=e;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,callbacks:n.callbacks},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}var Cae=!1;function AP(){if(Cae){var t=Ek;if(t!==null)throw t}}function SP(t,e,r,n){Cae=!1;var i=t.updateQueue;mb=!1;var a=i.firstBaseUpdate,s=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var l=o,u=l.next;l.next=null,s===null?a=u:s.next=u,s=l;var h=t.alternate;h!==null&&(h=h.updateQueue,o=h.lastBaseUpdate,o!==s&&(o===null?h.firstBaseUpdate=u:o.next=u,h.lastBaseUpdate=l))}if(a!==null){var d=i.baseState;s=0,h=u=l=null,o=a;do{var f=o.lane&-536870913,p=f!==o.lane;if(p?(pi&f)===f:(n&f)===f){f!==0&&f===kk&&(Cae=!0),h!==null&&(h=h.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var g=t,m=o;f=e;var v=r;switch(m.tag){case 1:if(g=m.payload,typeof g=="function"){d=g.call(v,d,f);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,f=typeof g=="function"?g.call(v,d,f):g,f==null)break e;d=Ga({},d,f);break e;case 2:mb=!0}}f=o.callback,f!==null&&(t.flags|=64,p&&(t.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},h===null?(u=h=p,l=d):h=h.next=p,s|=f;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;p=o,o=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);h===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=h,a===null&&(i.shared.lanes=0),Sb|=s,t.lanes=s,t.memoizedState=d}}function AIe(t,e){if(typeof t!="function")throw Error(Dt(191,t));t.call(e)}function SIe(t,e){var r=t.callbacks;if(r!==null)for(t.callbacks=null,t=0;ta?a:8;var s=Sn.T,o={};Sn.T=o,Gae(t,!1,e,r);try{var l=i(),u=Sn.S;if(u!==null&&u(o,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var h=Oer(l,n);OP(t,e,h,gd(t))}else OP(t,e,n,gd(t))}catch(d){OP(t,e,{then:function(){},status:"rejected",reason:d},gd())}finally{Ui.p=a,s!==null&&o.types!==null&&(s.types=o.types),Sn.T=s}}function Ler(){}function Vae(t,e,r,n){if(t.tag!==5)throw Error(Dt(476));var i=tPe(t).queue;ePe(t,i,e,Cw,r===null?Ler:function(){return rPe(t),r(n)})}function tPe(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:Cw,baseState:Cw,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yv,lastRenderedState:Cw},next:null};var r={};return e.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yv,lastRenderedState:r},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function rPe(t){var e=tPe(t);e.next===null&&(e=t.alternate.memoizedState),OP(t,e.next.queue,{},gd())}function Qae(){return Wl(QP)}function nPe(){return Zs().memoizedState}function iPe(){return Zs().memoizedState}function Mer(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var r=gd();t=vb(r);var n=yb(e,t,r);n!==null&&(vh(n,e,r),wP(n,e,r)),e={cache:yae()},t.payload=e;return}e=e.return}}function Ier(t,e,r){var n=gd();r={lane:n,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},LU(t)?sPe(e,r):(r=oae(t,e,r,n),r!==null&&(vh(r,t,n),oPe(r,e,n)))}function aPe(t,e,r){var n=gd();OP(t,e,r,n)}function OP(t,e,r,n){var i={lane:n,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(LU(t))sPe(e,i);else{var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var s=e.lastRenderedState,o=a(s,r);if(i.hasEagerState=!0,i.eagerState=o,cd(o,s))return dU(t,e,i,0),ya===null&&hU(),!1}catch{}finally{}if(r=oae(t,e,i,n),r!==null)return vh(r,t,n),oPe(r,e,n),!0}return!1}function Gae(t,e,r,n){if(n={lane:2,revertLane:Ase(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},LU(t)){if(e)throw Error(Dt(479))}else e=oae(t,r,n,2),e!==null&&vh(e,t,2)}function LU(t){var e=t.alternate;return t===Un||e!==null&&e===Un}function sPe(t,e){Lk=CU=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function oPe(t,e,r){if(r&4194048){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,dMe(t,r)}}var kP={readContext:Wl,use:EU,useCallback:Ds,useContext:Ds,useEffect:Ds,useImperativeHandle:Ds,useLayoutEffect:Ds,useInsertionEffect:Ds,useMemo:Ds,useReducer:Ds,useRef:Ds,useState:Ds,useDebugValue:Ds,useDeferredValue:Ds,useTransition:Ds,useSyncExternalStore:Ds,useId:Ds,useHostTransitionStatus:Ds,useFormState:Ds,useActionState:Ds,useOptimistic:Ds,useMemoCache:Ds,useCacheRefresh:Ds};kP.useEffectEvent=Ds;var lPe={readContext:Wl,use:EU,useCallback:function(t,e){return du().memoizedState=[t,e===void 0?null:e],t},useContext:Wl,useEffect:HIe,useImperativeHandle:function(t,e,r){r=r!=null?r.concat([t]):null,RU(4194308,4,jIe.bind(null,e,t),r)},useLayoutEffect:function(t,e){return RU(4194308,4,t,e)},useInsertionEffect:function(t,e){RU(4,2,t,e)},useMemo:function(t,e){var r=du();e=e===void 0?null:e;var n=t();if(Uw){cb(!0);try{t()}finally{cb(!1)}}return r.memoizedState=[n,e],n},useReducer:function(t,e,r){var n=du();if(r!==void 0){var i=r(e);if(Uw){cb(!0);try{r(e)}finally{cb(!1)}}}else i=e;return n.memoizedState=n.baseState=i,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:i},n.queue=t,t=t.dispatch=Ier.bind(null,Un,t),[n.memoizedState,t]},useRef:function(t){var e=du();return t={current:t},e.memoizedState=t},useState:function(t){t=Bae(t);var e=t.queue,r=aPe.bind(null,Un,e);return e.dispatch=r,[t.memoizedState,r]},useDebugValue:zae,useDeferredValue:function(t,e){var r=du();return Uae(r,t,e)},useTransition:function(){var t=Bae(!1);return t=ePe.bind(null,Un,t.queue,!0,!1),du().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,r){var n=Un,i=du();if(wi){if(r===void 0)throw Error(Dt(407));r=r()}else{if(r=e(),ya===null)throw Error(Dt(349));pi&127||_Ie(n,e,r)}i.memoizedState=r;var a={value:r,getSnapshot:e};return i.queue=a,HIe(DIe.bind(null,n,a,t),[t]),n.flags|=2048,Ik(9,{destroy:void 0},RIe.bind(null,n,a,r,e),null),r},useId:function(){var t=du(),e=ya.identifierPrefix;if(wi){var r=Gg,n=Qg;r=(n&~(1<<32-ld(n)-1)).toString(32)+r,e="_"+e+"R_"+r,r=OU++,0<\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof n.is=="string"?s.createElement("select",{is:n.is}):s.createElement("select"),n.multiple?a.multiple=!0:n.size&&(a.size=n.size);break;default:a=typeof n.is=="string"?s.createElement(i,{is:n.is}):s.createElement(i)}}a[Gl]=e,a[hh]=n;e:for(s=e.child;s!==null;){if(s.tag===5||s.tag===6)a.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===e)break e;for(;s.sibling===null;){if(s.return===null||s.return===e)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}e.stateNode=a;e:switch(ql(a,i,n),i){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&xv(e)}}return Wa(e),ise(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,r),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==n&&xv(e);else{if(typeof n!="string"&&e.stateNode===null)throw Error(Dt(166));if(t=lb.current,Ck(e)){if(t=e.stateNode,r=e.memoizedProps,n=null,i=Hl,i!==null)switch(i.tag){case 27:case 5:n=i.memoizedProps}t[Gl]=e,t=!!(t.nodeValue===r||n!==null&&n.suppressHydrationWarning===!0||k6e(t.nodeValue,r)),t||pb(e,!0)}else t=ZU(t).createTextNode(n),t[Gl]=e,e.stateNode=t}return Wa(e),null;case 31:if(r=e.memoizedState,t===null||t.memoizedState!==null){if(n=Ck(e),r!==null){if(t===null){if(!n)throw Error(Dt(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(Dt(557));t[Gl]=e}else Iw(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Wa(e),t=!1}else r=pae(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),t=!0;if(!t)return e.flags&256?(dd(e),e):(dd(e),null);if(e.flags&128)throw Error(Dt(558))}return Wa(e),null;case 13:if(n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(i=Ck(e),n!==null&&n.dehydrated!==null){if(t===null){if(!i)throw Error(Dt(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(Dt(317));i[Gl]=e}else Iw(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Wa(e),i=!1}else i=pae(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),i=!0;if(!i)return e.flags&256?(dd(e),e):(dd(e),null)}return dd(e),e.flags&128?(e.lanes=r,e):(r=n!==null,t=t!==null&&t.memoizedState!==null,r&&(n=e.child,i=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(i=n.alternate.memoizedState.cachePool.pool),a=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(a=n.memoizedState.cachePool.pool),a!==i&&(n.flags|=2048)),r!==t&&r&&(e.child.flags|=8192),BU(e,e.updateQueue),Wa(e),null);case 4:return lk(),t===null&&Ose(e.stateNode.containerInfo),Wa(e),null;case 10:return mv(e.type),Wa(e),null;case 19:if(hl(Ks),n=e.memoizedState,n===null)return Wa(e),null;if(i=(e.flags&128)!==0,a=n.rendering,a===null)if(i)_P(n,!1);else{if(Ls!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(a=TU(t),a!==null){for(e.flags|=128,_P(n,!1),t=a.updateQueue,e.updateQueue=t,BU(e,t),e.subtreeFlags=0,t=r,r=e.child;r!==null;)aIe(r,t),r=r.sibling;return ka(Ks,Ks.current&1|2),wi&&pv(e,n.treeForkCount),e.child}t=t.sibling}n.tail!==null&&sd()>VU&&(e.flags|=128,i=!0,_P(n,!1),e.lanes=4194304)}else{if(!i)if(t=TU(a),t!==null){if(e.flags|=128,i=!0,t=t.updateQueue,e.updateQueue=t,BU(e,t),_P(n,!0),n.tail===null&&n.tailMode==="hidden"&&!a.alternate&&!wi)return Wa(e),null}else 2*sd()-n.renderingStartTime>VU&&r!==536870912&&(e.flags|=128,i=!0,_P(n,!1),e.lanes=4194304);n.isBackwards?(a.sibling=e.child,e.child=a):(t=n.last,t!==null?t.sibling=a:e.child=a,n.last=a)}return n.tail!==null?(t=n.tail,n.rendering=t,n.tail=t.sibling,n.renderingStartTime=sd(),t.sibling=null,r=Ks.current,ka(Ks,i?r&1|2:r&1),wi&&pv(e,n.treeForkCount),t):(Wa(e),null);case 22:case 23:return dd(e),kae(),n=e.memoizedState!==null,t!==null?t.memoizedState!==null!==n&&(e.flags|=8192):n&&(e.flags|=8192),n?r&536870912&&!(e.flags&128)&&(Wa(e),e.subtreeFlags&6&&(e.flags|=8192)):Wa(e),r=e.updateQueue,r!==null&&BU(e,r.retryQueue),r=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),n=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),n!==r&&(e.flags|=2048),t!==null&&hl(Bw),null;case 24:return r=null,t!==null&&(r=t.memoizedState.cache),e.memoizedState.cache!==r&&(e.flags|=2048),mv(mo),Wa(e),null;case 25:return null;case 30:return null}throw Error(Dt(156,e.tag))}function Fer(t,e){switch(dae(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return mv(mo),lk(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return qz(e),null;case 31:if(e.memoizedState!==null){if(dd(e),e.alternate===null)throw Error(Dt(340));Iw()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(dd(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Dt(340));Iw()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return hl(Ks),null;case 4:return lk(),null;case 10:return mv(e.type),null;case 22:case 23:return dd(e),kae(),t!==null&&hl(Bw),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return mv(mo),null;case 25:return null;default:return null}}function LPe(t,e){switch(dae(e),e.tag){case 3:mv(mo),lk();break;case 26:case 27:case 5:qz(e);break;case 4:lk();break;case 31:e.memoizedState!==null&&dd(e);break;case 13:dd(e);break;case 19:hl(Ks);break;case 10:mv(e.type);break;case 22:case 23:dd(e),kae(),t!==null&&hl(Bw);break;case 24:mv(mo)}}function RP(t,e){try{var r=e.updateQueue,n=r!==null?r.lastEffect:null;if(n!==null){var i=n.next;r=i;do{if((r.tag&t)===t){n=void 0;var a=r.create,s=r.inst;n=a(),s.destroy=n}r=r.next}while(r!==i)}}catch(o){na(e,e.return,o)}}function wb(t,e,r){try{var n=e.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var a=i.next;n=a;do{if((n.tag&t)===t){var s=n.inst,o=s.destroy;if(o!==void 0){s.destroy=void 0,i=e;var l=r,u=o;try{u()}catch(h){na(i,l,h)}}}n=n.next}while(n!==a)}}catch(h){na(e,e.return,h)}}function MPe(t){var e=t.updateQueue;if(e!==null){var r=t.stateNode;try{SIe(e,r)}catch(n){na(t,t.return,n)}}}function IPe(t,e,r){r.props=Vw(t.type,t.memoizedProps),r.state=t.memoizedState;try{r.componentWillUnmount()}catch(n){na(t,e,n)}}function DP(t,e){try{var r=t.ref;if(r!==null){switch(t.tag){case 26:case 27:case 5:var n=t.stateNode;break;case 30:n=t.stateNode;break;default:n=t.stateNode}typeof r=="function"?t.refCleanup=r(n):r.current=n}}catch(i){na(t,e,i)}}function Hg(t,e){var r=t.ref,n=t.refCleanup;if(r!==null)if(typeof n=="function")try{n()}catch(i){na(t,e,i)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(i){na(t,e,i)}else r.current=null}function PPe(t){var e=t.type,r=t.memoizedProps,n=t.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":r.autoFocus&&n.focus();break e;case"img":r.src?n.src=r.src:r.srcSet&&(n.srcset=r.srcSet)}}catch(i){na(t,t.return,i)}}function ase(t,e,r){try{var n=t.stateNode;otr(n,t.type,r,e),n[hh]=e}catch(i){na(t,t.return,i)}}function NPe(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Eb(t.type)||t.tag===4}function sse(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||NPe(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Eb(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function ose(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(t,e):(e=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,e.appendChild(t),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=hv));else if(n!==4&&(n===27&&Eb(t.type)&&(r=t.stateNode,e=null),t=t.child,t!==null))for(ose(t,e,r),t=t.sibling;t!==null;)ose(t,e,r),t=t.sibling}function $U(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(n===27&&Eb(t.type)&&(r=t.stateNode),t=t.child,t!==null))for($U(t,e,r),t=t.sibling;t!==null;)$U(t,e,r),t=t.sibling}function BPe(t){var e=t.stateNode,r=t.memoizedProps;try{for(var n=t.type,i=e.attributes;i.length;)e.removeAttributeNode(i[0]);ql(e,n,r),e[Gl]=t,e[hh]=r}catch(a){na(t,t.return,a)}}var wv=!1,bo=!1,lse=!1,$Pe=typeof WeakSet=="function"?WeakSet:Set,fl=null;function zer(t,e){if(t=t.containerInfo,_se=aV,t=XMe(t),tae(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var s=0,o=-1,l=-1,u=0,h=0,d=t,f=null;t:for(;;){for(var p;d!==r||i!==0&&d.nodeType!==3||(o=s+i),d!==a||n!==0&&d.nodeType!==3||(l=s+n),d.nodeType===3&&(s+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===t)break t;if(f===r&&++u===i&&(o=s),f===a&&++h===n&&(l=s),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}r=o===-1||l===-1?null:{start:o,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(Rse={focusedElem:t,selectionRange:r},aV=!1,fl=e;fl!==null;)if(e=fl,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,fl=t;else for(;fl!==null;){switch(e=fl,a=e.alternate,t=e.flags,e.tag){case 0:if(t&4&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(r=0;r title"))),ql(a,n,r),a[Gl]=t,dl(a),n=a;break e;case"link":var s=G6e("link","href",i).get(n+(r.href||""));if(s){for(var o=0;ov&&(s=v,v=m,m=s);var y=qMe(o,m),b=qMe(o,v);if(y&&b&&(p.rangeCount!==1||p.anchorNode!==y.node||p.anchorOffset!==y.offset||p.focusNode!==b.node||p.focusOffset!==b.offset)){var x=d.createRange();x.setStart(y.node,y.offset),p.removeAllRanges(),m>v?(p.addRange(x),p.extend(b.node,b.offset)):(x.setEnd(b.node,b.offset),p.addRange(x))}}}}for(d=[],p=o;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;or?32:r,Sn.T=null,r=gse,gse=null;var a=Cb,s=Ov;if(Go=0,Fk=Cb=null,Ov=0,Vi&6)throw Error(Dt(331));var o=Vi;if(Vi|=4,jPe(a.current),WPe(a,a.current,s,r),Vi=o,BP(0,!1),od&&typeof od.onPostCommitFiberRoot=="function")try{od.onPostCommitFiberRoot(tP,a)}catch{}return!0}finally{Ui.p=i,Sn.T=n,f6e(t,e)}}function g6e(t,e,r){e=vf(r,e),e=qae(t.stateNode,e,2),t=yb(t,e,2),t!==null&&(nP(t,2),Wg(t))}function na(t,e,r){if(t.tag===3)g6e(t,t,r);else for(;e!==null;){if(e.tag===3){g6e(e,t,r);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Tb===null||!Tb.has(n))){t=vf(r,t),r=mPe(2),n=yb(e,r,2),n!==null&&(vPe(r,n,e,t),nP(n,2),Wg(n));break}}e=e.return}}function bse(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new Qer;var i=new Set;n.set(e,i)}else i=n.get(e),i===void 0&&(i=new Set,n.set(e,i));i.has(r)||(hse=!0,i.add(r),t=qer.bind(null,t,e,r),e.then(t,t))}function qer(t,e,r){var n=t.pingCache;n!==null&&n.delete(e),t.pingedLanes|=t.suspendedLanes&r,t.warmLanes&=~r,ya===t&&(pi&r)===r&&(Ls===4||Ls===3&&(pi&62914560)===pi&&300>sd()-UU?!(Vi&2)&&zk(t,0):dse|=r,$k===pi&&($k=0)),Wg(t)}function m6e(t,e){e===0&&(e=uMe()),t=Lw(t,e),t!==null&&(nP(t,e),Wg(t))}function jer(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),m6e(t,r)}function Xer(t,e){var r=0;switch(t.tag){case 31:case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;case 22:n=t.stateNode._retryCache;break;default:throw Error(Dt(314))}n!==null&&n.delete(e),m6e(t,r)}function Ker(t,e){return Lie(t,e)}var qU=null,Vk=null,xse=!1,jU=!1,wse=!1,kb=0;function Wg(t){t!==Vk&&t.next===null&&(Vk===null?qU=Vk=t:Vk=Vk.next=t),jU=!0,xse||(xse=!0,Jer())}function BP(t,e){if(!wse&&jU){wse=!0;do for(var r=!1,n=qU;n!==null;){if(t!==0){var i=n.pendingLanes;if(i===0)var a=0;else{var s=n.suspendedLanes,o=n.pingedLanes;a=(1<<31-ld(42|t)+1)-1,a&=i&~(s&~o),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(r=!0,x6e(n,a))}else a=pi,a=Jz(n,n===ya?a:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),!(a&3)||rP(n,a)||(r=!0,x6e(n,a));n=n.next}while(r);wse=!1}}function Zer(){v6e()}function v6e(){jU=xse=!1;var t=0;kb!==0&&ctr()&&(t=kb);for(var e=sd(),r=null,n=qU;n!==null;){var i=n.next,a=y6e(n,e);a===0?(n.next=null,r===null?qU=i:r.next=i,i===null&&(Vk=r)):(r=n,(t!==0||a&3)&&(jU=!0)),n=i}Go!==0&&Go!==5||BP(t),kb!==0&&(kb=0)}function y6e(t,e){for(var r=t.suspendedLanes,n=t.pingedLanes,i=t.expirationTimes,a=t.pendingLanes&-62914561;0o)break;var h=l.transferSize,d=l.initiatorType;h&&E6e(d)&&(l=l.responseEnd,s+=h*(l"u"?null:document;function z6e(t,e,r){var n=Qk;if(n&&typeof e=="string"&&e){var i=gf(e);i='link[rel="'+t+'"][href="'+i+'"]',typeof r=="string"&&(i+='[crossorigin="'+r+'"]'),F6e.has(i)||(F6e.add(i),t={rel:t,crossOrigin:r,href:e},n.querySelector(i)===null&&(e=n.createElement("link"),ql(e,"link",t),dl(e),n.head.appendChild(e)))}}function ytr(t){kv.D(t),z6e("dns-prefetch",t,null)}function btr(t,e){kv.C(t,e),z6e("preconnect",t,e)}function xtr(t,e,r){kv.L(t,e,r);var n=Qk;if(n&&t&&e){var i='link[rel="preload"][as="'+gf(e)+'"]';e==="image"&&r&&r.imageSrcSet?(i+='[imagesrcset="'+gf(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(i+='[imagesizes="'+gf(r.imageSizes)+'"]')):i+='[href="'+gf(t)+'"]';var a=i;switch(e){case"style":a=Gk(t);break;case"script":a=Hk(t)}Sf.has(a)||(t=Ga({rel:"preload",href:e==="image"&&r&&r.imageSrcSet?void 0:t,as:e},r),Sf.set(a,t),n.querySelector(i)!==null||e==="style"&&n.querySelector(UP(a))||e==="script"&&n.querySelector(VP(a))||(e=n.createElement("link"),ql(e,"link",t),dl(e),n.head.appendChild(e)))}}function wtr(t,e){kv.m(t,e);var r=Qk;if(r&&t){var n=e&&typeof e.as=="string"?e.as:"script",i='link[rel="modulepreload"][as="'+gf(n)+'"][href="'+gf(t)+'"]',a=i;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Hk(t)}if(!Sf.has(a)&&(t=Ga({rel:"modulepreload",href:t},e),Sf.set(a,t),r.querySelector(i)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(VP(a)))return}n=r.createElement("link"),ql(n,"link",t),dl(n),r.head.appendChild(n)}}}function Atr(t,e,r){kv.S(t,e,r);var n=Qk;if(n&&t){var i=dk(n).hoistableStyles,a=Gk(t);e=e||"default";var s=i.get(a);if(!s){var o={loading:0,preload:null};if(s=n.querySelector(UP(a)))o.loading=5;else{t=Ga({rel:"stylesheet",href:t,"data-precedence":e},r),(r=Sf.get(a))&&Bse(t,r);var l=s=n.createElement("link");dl(l),ql(l,"link",t),l._p=new Promise(function(u,h){l.onload=u,l.onerror=h}),l.addEventListener("load",function(){o.loading|=1}),l.addEventListener("error",function(){o.loading|=2}),o.loading|=4,eV(s,e,n)}s={type:"stylesheet",instance:s,count:1,state:o},i.set(a,s)}}}function Str(t,e){kv.X(t,e);var r=Qk;if(r&&t){var n=dk(r).hoistableScripts,i=Hk(t),a=n.get(i);a||(a=r.querySelector(VP(i)),a||(t=Ga({src:t,async:!0},e),(e=Sf.get(i))&&$se(t,e),a=r.createElement("script"),dl(a),ql(a,"link",t),r.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},n.set(i,a))}}function Ttr(t,e){kv.M(t,e);var r=Qk;if(r&&t){var n=dk(r).hoistableScripts,i=Hk(t),a=n.get(i);a||(a=r.querySelector(VP(i)),a||(t=Ga({src:t,async:!0,type:"module"},e),(e=Sf.get(i))&&$se(t,e),a=r.createElement("script"),dl(a),ql(a,"link",t),r.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},n.set(i,a))}}function U6e(t,e,r,n){var i=(i=lb.current)?JU(i):null;if(!i)throw Error(Dt(446));switch(t){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(e=Gk(r.href),r=dk(i).hoistableStyles,n=r.get(e),n||(n={type:"style",instance:null,count:0,state:null},r.set(e,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){t=Gk(r.href);var a=dk(i).hoistableStyles,s=a.get(t);if(s||(i=i.ownerDocument||i,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(t,s),(a=i.querySelector(UP(t)))&&!a._p&&(s.instance=a,s.state.loading=5),Sf.has(t)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},Sf.set(t,r),a||Ctr(i,t,r,s.state))),e&&n===null)throw Error(Dt(528,""));return s}if(e&&n!==null)throw Error(Dt(529,""));return null;case"script":return e=r.async,r=r.src,typeof r=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Hk(r),r=dk(i).hoistableScripts,n=r.get(e),n||(n={type:"script",instance:null,count:0,state:null},r.set(e,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(Dt(444,t))}}function Gk(t){return'href="'+gf(t)+'"'}function UP(t){return'link[rel="stylesheet"]['+t+"]"}function V6e(t){return Ga({},t,{"data-precedence":t.precedence,precedence:null})}function Ctr(t,e,r,n){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?n.loading=1:(e=t.createElement("link"),n.preload=e,e.addEventListener("load",function(){return n.loading|=1}),e.addEventListener("error",function(){return n.loading|=2}),ql(e,"link",r),dl(e),t.head.appendChild(e))}function Hk(t){return'[src="'+gf(t)+'"]'}function VP(t){return"script[async]"+t}function Q6e(t,e,r){if(e.count++,e.instance===null)switch(e.type){case"style":var n=t.querySelector('style[data-href~="'+gf(r.href)+'"]');if(n)return e.instance=n,dl(n),n;var i=Ga({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return n=(t.ownerDocument||t).createElement("style"),dl(n),ql(n,"style",i),eV(n,r.precedence,t),e.instance=n;case"stylesheet":i=Gk(r.href);var a=t.querySelector(UP(i));if(a)return e.state.loading|=4,e.instance=a,dl(a),a;n=V6e(r),(i=Sf.get(i))&&Bse(n,i),a=(t.ownerDocument||t).createElement("link"),dl(a);var s=a;return s._p=new Promise(function(o,l){s.onload=o,s.onerror=l}),ql(a,"link",n),e.state.loading|=4,eV(a,r.precedence,t),e.instance=a;case"script":return a=Hk(r.src),(i=t.querySelector(VP(a)))?(e.instance=i,dl(i),i):(n=r,(i=Sf.get(a))&&(n=Ga({},r),$se(n,i)),t=t.ownerDocument||t,i=t.createElement("script"),dl(i),ql(i,"link",n),t.head.appendChild(i),e.instance=i);case"void":return null;default:throw Error(Dt(443,e.type))}else e.type==="stylesheet"&&!(e.state.loading&4)&&(n=e.instance,e.state.loading|=4,eV(n,r.precedence,t));return e.instance}function eV(t,e,r){for(var n=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=n.length?n[n.length-1]:null,a=i,s=0;s title"):null)}function Otr(t,e,r){if(r===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return t=e.disabled,typeof e.precedence=="string"&&t==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function W6e(t){return!(t.type==="stylesheet"&&!(t.state.loading&3))}function ktr(t,e,r,n){if(r.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&!(r.state.loading&4)){if(r.instance===null){var i=Gk(n.href),a=e.querySelector(UP(i));if(a){e=a._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=rV.bind(t),e.then(t,t)),r.state.loading|=4,r.instance=a,dl(a);return}a=e.ownerDocument||e,n=V6e(n),(i=Sf.get(i))&&Bse(n,i),a=a.createElement("link"),dl(a);var s=a;s._p=new Promise(function(o,l){s.onload=o,s.onerror=l}),ql(a,"link",n),r.instance=a}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(r,e),(e=r.state.preload)&&!(r.state.loading&3)&&(t.count++,r=rV.bind(t),e.addEventListener("load",r),e.addEventListener("error",r))}}var Fse=0;function Etr(t,e){return t.stylesheets&&t.count===0&&iV(t,t.stylesheets),0Fse?50:800)+e);return t.unsuspend=r,function(){t.unsuspend=null,clearTimeout(n),clearTimeout(i)}}:null}function rV(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)iV(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var nV=null;function iV(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,nV=new Map,e.forEach(_tr,t),nV=null,rV.call(t))}function _tr(t,e){if(!(e.state.loading&4)){var r=nV.get(t);if(r)var n=r.get(null);else{r=new Map,nV.set(t,r);for(var i=t.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(sNe)}catch(t){console.error(t)}}sNe(),LLe.exports=Vz;var Btr=LLe.exports;const oNe={requestFailed:"Request failed ({{status}})",unknownError:"Unknown error",contentTypeMissing:"Content-Type missing",response:"Response: {{response}}",fallbackWithDetail:"{{fallback}}: {{detail}}",fallbackWithHttpStatus:"{{fallback}} (HTTP {{status}})",nonJsonResponse:"{{fallback}}: the server returned a non-JSON response ({{contentType}})"},lNe={unconfigured:"AgentKit Dev Sandbox has not been configured by an administrator.",invalidSession:"AgentKit CLI returned an invalid session.",loadCapabilitiesFailed:"Unable to load the AgentKit CLI configuration.",invalidCapabilities:"AgentKit CLI returned an invalid configuration status.",listSessionsFailed:"Unable to load AgentKit CLI sessions.",invalidSessionList:"AgentKit CLI returned an invalid session list.",createSessionFailed:"Unable to create an AgentKit CLI session.",openSessionFailed:"Unable to open the AgentKit CLI session.",openTerminalFailed:"Unable to open the AgentKit CLI terminal.",invalidTerminalUrl:"AgentKit CLI returned an invalid terminal URL."},cNe={cnBeijing:"China North 2 (Beijing)",cnShanghai:"China East 2 (Shanghai)"},uNe={runtimeUnsupported:"This Runtime does not currently support connections. Confirm that the service is running normally."},hNe={autoConfigureFailed:"Failed to configure the Feishu bot automatically"},dNe={actionFailed:"Failed to {{action}}",detail:"Details: {{detail}}",request:"Request: {{request}}"},fNe={persistentMemoryHint:"Tip: The session no longer exists. With in-memory or SQLite short-term memory, sessions may be lost during multi-instance routing, process restarts, or rolling deployments. Use database-backed persistent short-term memory instead.",unsupportedRouteHint:"Tip: This Runtime does not provide the session run API and may be incompatible with the current Studio version.",toolArgumentHint:"Tip: The model generated incomplete tool arguments. Send the request again.",resourceCollectionExpiredHint:"Tip: This resource collection has expired. Send the task again so the system can collect the resources before creating the Agent.",networkConfigurationHint:"Tip: Check network settings such as the shared public egress, then try again.",modelQuotaHint:"Tip: The model has reached its TPM/RPM quota. Try again later or increase the model quota.",rawResponseLabel:"Raw response: "},pNe={httpStatus:"HTTP status: {{status}}",errorCode:"Error code: {{code}}",cloudResponseBody:`Cloud response body: +{{body}}`,loadFailedWithDetail:"Failed to load instance logs: {{detail}}",invalidFormat:"Failed to load instance logs: the service returned an invalid format"},gNe={untitledSession:"Untitled session",webUnavailable:"Web search is unavailable because /web/search is not enabled on the server.",webFailed:"Web search failed: {{message}}",webNotMounted:"This Agent does not have the web_search tool mounted.",knowledgeNotMounted:"This Agent does not have a knowledge base mounted.",memoryNotMounted:"This Agent does not have long-term memory mounted.",knowledge:"Knowledge base",longTermMemory:"Long-term memory"},mNe={listSpacesFailed:"Failed to load Skill spaces",createSpaceFailed:"Failed to create the Skill space",updateSpaceFailed:"Failed to update the Skill space",deleteSpaceFailed:"Failed to delete the Skill space",uploadFailed:"Failed to upload the Skill",validateFailed:"Failed to validate the Skill",deleteFailed:"Failed to delete the Skill",listFilesFailed:"Failed to load Skill files",downloadFailed:"Failed to download the Skill"},vNe={truncatedData:"{{data}}… (truncated, {{count}} characters total)",incompleteEvent:"The stream ended with an incomplete SSE event. Raw data: {{data}}",invalidEventJson:"Failed to parse the SSE event JSON. Raw data: {{data}}"},yNe={loadConfigNetworkFailed:"Unable to load the sign-in configuration. Check your network and try again.",configServiceFailed:"The sign-in configuration service failed (HTTP {{status}}). Try again later.",invalidConfigResponse:"The sign-in configuration service returned an unreadable response. Try again later.",serviceNetworkFailed:"Unable to connect to the identity service. Check your network and try again.",invalidServiceResponse:"The identity service returned an unreadable response. Try again later.",serviceFailed:"The identity service failed (HTTP {{status}}). Try again later."},bNe={invalidToken:"The GitHub token is invalid or does not have repository write access",notFound:"The repository, branch, or file does not exist, or the token cannot access it",rejectedCommit:"GitHub rejected the commit. Check the branch and file state",requestFailed:"GitHub request failed (HTTP {{status}})",networkFailed:"Unable to connect to GitHub. Check your network and try again",invalidRepositoryFormat:"The GitHub repository must use the owner/repository format",insecureRepositoryUrl:"Only secure github.com repository URLs are supported",unsafeProjectPath:"The Agent project directory must be a safe relative path within the repository",tokenRequired:"A GitHub token is required",invalidBaseBranch:"The target branch format is invalid",invalidPublishBranch:"The publish branch format is invalid",noFiles:"There are no files to commit",missingBaseSha:"The target branch does not have a valid Git SHA",fileAlreadyExists:"{{path}} already exists in the target repository; the existing file was not overwritten",pathNotUpdatable:"The target path {{path}} is not an updatable file",invalidPullRequest:"GitHub did not return a valid pull request"},xNe={loadCapabilitiesFailed:"Failed to load video model capabilities",uploadAssetFailed:"Failed to upload {{fileName}}",enhancePromptFailed:"Failed to enhance the prompt",createTaskFailed:"Failed to create the video generation task",getTaskFailed:"Failed to load the video generation task",downloadFailed:"Failed to download the generated video"},wNe={listFailed:"Failed to load website integrations",createFailed:"Failed to create the website integration",deleteFailed:"Failed to delete the website integration"},ANe={loadFailed:"Failed to load the knowledge base",htmlHidden:"[HTML content hidden]",redacted:"[redacted]",depthTruncated:"[content nested too deeply; truncated]",circularReference:"[circular reference]",diagnosticsUnavailable:"[diagnostic information unavailable]",statusCode:"Status: {{status}}",errorCode:"Error code: {{code}}",requestId:"Request ID: {{requestId}}",diagnostics:"Diagnostics: {{diagnostics}}",detail:"Details: {{detail}}",signInRequired:"Sign in before accessing knowledge bases",forbidden:"You do not have permission to operate on this knowledge base",notFound:"The knowledge base or knowledge content does not exist",conflict:"The knowledge base cannot perform this operation in its current state",requestFailed:"Knowledge base request failed ({{status}})"},SNe={invalidSourceSnapshot:"The source snapshot response has an invalid format.",invalidProjectList:"The project list response has an invalid format.",invalidProjectVersion:"The project version response has an invalid format.",loadProjectsFailed:"Unable to load saved projects",loadVersionsFailed:"Unable to load project versions",deleteVersionFailed:"Failed to delete the project version",invalidDeleteVersionResponse:"The project version deletion response has an invalid format.",loadProjectSourceFailed:"Unable to load project source",loadSnapshotFailed:"Unable to load the source snapshot",restoreSnapshotFailed:"Unable to restore the current source snapshot",downloadSourceFailed:"Failed to download the source",downloadNotZip:"The source download response is not a ZIP file.",downloadSizeMismatch:"The source archive size does not match the published record. Try again."},TNe={invalidFormat:"{{label}} has an invalid format.",validationSeparator:"; ",invalidAnalysisResult:"The migration analysis result has an invalid format.",invalidFrameworkCandidate:"A framework candidate has an invalid format.",invalidAnalysisEvidence:"The analysis evidence has an invalid format.",invalidEntryCandidate:"An entry candidate has an invalid format.",invalidQuestion:"A follow-up question has an invalid format.",invalidTask:"The migration session has an invalid format.",invalidAnalysisReference:"The analysis result reference has an invalid format.",invalidSourcePersistence:"The migration source persistence status has an invalid format.",invalidActivity:"The migration activity has an invalid format.",invalidActivityItem:"A migration activity item has an invalid format.",invalidActivityTool:"A migration activity tool item has an invalid format.",invalidActivityPlan:"The migration execution plan has an invalid format.",invalidActivityPlanItem:"A migration execution plan item has an invalid format.",invalidArtifact:"The migration artifact has an invalid format.",invalidEnvironmentDefaults:"The environment variable defaults have an invalid format.",invalidArtifactFile:"A migration artifact file has an invalid format.",invalidVerificationCheck:"A migration verification check has an invalid format.",requestValidationFailed:"Request validation failed: {{detail}}",gatewayError:"{{fallback}} (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",nonJsonResponse:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}). Check the proxy or gateway configuration.",loadCapabilitiesFailed:"Failed to load migration capabilities",invalidCapabilities:"The migration capabilities have an invalid format.",invalidModelCapabilities:"The migration model capabilities have an invalid format.",loadTasksFailed:"Failed to load migration sessions",invalidTaskList:"The migration session list has an invalid format.",createTaskFailed:"Failed to create the migration session",uploadProjectFailed:"Failed to upload the migration project",loadActivityFailed:"Failed to load migration activity",startFailed:"Failed to start the migration",submitAnswersFailed:"Failed to submit additional analysis information",stopFailed:"Failed to stop the migration",deleteTaskFailed:"Failed to delete the migration session",loadArtifactFailed:"Failed to load the migration artifact",loadArtifactFileFailed:"Failed to load the migration artifact file",downloadArtifactFailed:"Failed to download the migration artifact",labels:{analysisResult:"Migration analysis result",recommendation:"Migration recommendation",boundary:"Migration boundary",frameworkCandidate:"Framework candidate",analysisEvidence:"Analysis evidence",recommendedFramework:"Recommended framework",entryCandidate:"Entry candidate",entryFramework:"Entry framework",includeScope:"Migration include scope",excludeScope:"Migration exclude scope",assumptions:"Analysis assumptions",question:"Follow-up question",analysisWarnings:"Migration warnings",task:"Migration session",artifactStatus:"Migration artifact status",analysisReference:"Analysis result reference",confirmation:"Migration confirmation",confirmedFramework:"Confirmed framework",error:"Migration error",sourcePersistence:"Migration source persistence status",activity:"Migration activity",activityItem:"Migration activity item",activityTool:"Migration activity tool item",activityPlanItem:"Migration activity plan item",artifact:"Migration artifact",cli:"CLI information",migration:"Migration information",startup:"Startup information",environment:"Environment variable information",verification:"Verification information",report:"Migration report",archive:"Artifact archive",environmentDefaults:"Environment variable defaults",requiredEnvironment:"Required environment variables",optionalEnvironment:"Optional environment variables",artifactFile:"Migration artifact file",verificationCheck:"Migration verification check",artifactWarnings:"Migration artifact warnings",errorResponse:"Error response",errorDetail:"Error details",capabilities:"Migration capabilities",framework:"Migration framework",modelCapabilities:"Migration model capabilities",taskList:"Migration session list"}},CNe={status:{ready:"Ready",wakeable:"Wakeable",creating:"Creating",starting:"Starting",pending:"Pending",running:"Running",failed:"Error",stopped:"Stopped",expired:"Expired",deleting:"Deleting",deleted:"Deleted",unknown:"Unknown status"},developmentTimeout:"The development environment timed out. The task may still be running; reopen this session later to check its status.",developmentDisconnected:"The connection to the development environment was interrupted. The task may still be running; reopen this session later to check its status.",developmentFailed:"The development task could not continue. The environment was preserved; try again in this session.",invalidStudioResponse:"{{fallback}} Studio returned an invalid response. Refresh and try again.",invalidSession:"AgentKit Sandbox returned invalid session information.",invalidSnapshot:"AgentKit Sandbox returned invalid snapshot information.",invalidSettings:"Sandbox returned invalid settings.",invalidThreadSnapshot:"Sandbox returned an invalid thread snapshot.",emptyConversationResponse:"The Sandbox conversation service returned no content.",invalidConversationResponse:"The Sandbox conversation service returned an unreadable response.",conversationFailed:"The Sandbox conversation failed. Try again later.",emptyReply:"Sandbox did not return a valid reply. Try again.",missingSession:"The AgentKit session is missing.",listCodexFailed:"Unable to load Codex agents. Try again later.",invalidSessionList:"AgentKit Sandbox returned an invalid session list.",invalidSnapshotList:"AgentKit Sandbox returned an invalid snapshot list.",startFailed:"Unable to start AgentKit Sandbox. Try again later.",listAgentFailed:"Unable to load {{kind}} agents. Try again later.",invalidKindSessionList:"AgentKit returned an invalid {{kind}} session list.",invalidKindSnapshotList:"AgentKit returned an invalid {{kind}} snapshot list.",createAgentFailed:"Unable to create a {{kind}} agent. Try again later.",missingSessionToOpen:"The AgentKit session to open is missing.",openAgentFailed:"Unable to open the {{kind}} agent.",invalidAgentHomeUrl:"The {{kind}} agent returned an invalid home URL.",missingSessionForTerminal:"The AgentKit session for the terminal is missing.",openTerminalFailed:"Unable to open the {{kind}} terminal.",deleteAgentFailed:"Unable to delete the {{kind}} agent.",missingSnapshot:"The AgentKit snapshot to wake is missing.",resumeSnapshotFailed:"Unable to wake the agent from its snapshot. Try again later.",deleteSnapshotFailed:"Unable to delete the agent snapshot.",missingSessionToConnect:"The AgentKit session to connect is missing.",connectCodexFailed:"Unable to connect to the Codex agent. Try again later.",sessionNotReady:"The AgentKit session is not ready. Current status: {{status}}.",invalidMessage:"The built-in agent session does not contain a valid message.",interruptFailed:"Unable to stop the current task.",getStatusFailed:"Unable to load Codex status.",getEndpointFailed:"Unable to load the Sandbox endpoint.",invalidEndpoint:"Sandbox returned an invalid endpoint.",createHandoffPairingFailed:"Unable to create a Codex cloud handoff pairing code.",invalidHandoffPairing:"Studio returned an invalid Codex cloud handoff pairing code.",getHandoffStatusFailed:"Unable to load the cloud handoff status.",invalidHandoffStatus:"Studio returned an invalid cloud handoff status.",listModelsFailed:"Unable to load Codex models.",invalidModelList:"Sandbox returned an invalid model list.",setModelFailed:"Unable to switch the Codex model.",invalidModel:"Sandbox returned an invalid model.",listSkillsFailed:"Unable to load Codex Skills.",invalidSkillList:"Sandbox returned an invalid Skill list.",listThreadsFailed:"Unable to load Codex threads.",invalidThreadList:"Sandbox returned an invalid thread list.",createThreadFailed:"Unable to create a new Codex thread.",missingThread:"The Codex thread to read is missing.",readThreadFailed:"Unable to load Codex history.",resumeThreadFailed:"Unable to resume the Codex thread.",forkThreadFailed:"Unable to fork the Codex thread.",archiveThreadFailed:"Unable to archive the Codex thread.",invalidArchiveResult:"Sandbox returned an invalid archive result.",deleteThreadFailed:"Unable to delete the Codex thread.",invalidDeleteResult:"Sandbox returned an invalid deletion result.",compactThreadFailed:"Unable to compact the Codex thread.",getSettingsFailed:"Unable to load Codex permissions and workspace settings.",updatePermissionsFailed:"Unable to update Codex permissions.",updateWorkspaceFailed:"Unable to update the Codex workspace.",invalidWorkingDirectory:"Sandbox returned an invalid working directory.",listDirectoriesFailed:"Unable to load Sandbox directories.",invalidDirectoryList:"Sandbox returned an invalid directory list.",resolveApprovalFailed:"Unable to submit the Codex approval decision.",uploadFileFailed:"Unable to upload the file to Sandbox.",invalidUploadResult:"Sandbox returned an invalid upload result.",disconnectCodexFailed:"Unable to disconnect the Codex agent.",deleteCodexFailed:"Unable to delete the Codex agent.",openSandboxTerminalFailed:"Unable to open the Sandbox terminal.",openSandboxBrowserFailed:"Unable to open the Sandbox browser.",toolLabel:"Sandbox tool",invalidToolUrl:"{{label}} returned an invalid URL.",unsafeToolUrl:"{{label}} returned an unsafe URL."},ONe={invalidSandboxVersion:"Invalid sandbox version response",loadSandboxVersionsFailed:"Failed to check sandbox versions",updateSandboxFailed:"Failed to update sandbox",invalidSandboxUpdate:"Invalid sandbox update response",errorWithDetailAndRawResponse:`{{context}} {{detail}} Raw response: {{response}}`,errorWithRawResponse:`{{context}} Raw response: -{{response}}`,loadArkApiKeysFailed:"Failed to load Ark API keys",loadModelsFailed:"Failed to load models",runtimeAccessDenied:"This account cannot access the Runtime. Refresh the list or sign in again.",privateRuntimeUnavailable:"The Runtime was deployed, but this Studio cannot access the private Runtime. Use a Studio connected to the same VPC, or deploy with public or public plus VPC access.",runtimeTemporarilyUnavailable:"The Runtime was deployed, but Studio cannot connect yet. The gateway domain may still be propagating, or the current network or DNS cannot reach it. Try connecting again later from Manage Agents.",runtimeConnectionUnsupported:"The Runtime Agent Server does not provide a connection endpoint. Confirm that the Runtime is ready and compatible.",runtimeConnectionDenied:"The Runtime rejected the connection request. Check its authentication configuration.",listAgentsFailed:"Failed to load Agents",invalidListAppsJson:"Runtime /list-apps returned unreadable JSON.",invalidListAppsFormat:"Runtime /list-apps returned an invalid format; expected a non-empty string array.",createSessionFailedWithStatus:"Failed to create session ({{status}})",createSessionFailed:"Failed to create session",getSessionFailed:"Failed to load session",getSessionFailedWithDetail:"Failed to load session ({{status}}): {{detail}}",feedbackRuntimeOnly:"Feedback sync is supported only for sessions connected to an AgentKit Runtime",feedbackRegionMissing:"The Runtime region is missing, so feedback cannot be submitted",submitFeedbackFailed:"Failed to submit feedback",loadEvaluationSetsFailed:"Failed to load evaluation sets",loadAutoEvaluationStatusFailed:"Failed to load automatic evaluation status",loadOptimizationsFailed:"Failed to load optimization suggestions",deleteEvaluationCaseFailed:"Failed to delete the evaluation case",downloadFileFailed:"Failed to download the file",fileUnavailable:"File content is unavailable",uploadFileFailed:"File upload failed",traceDisabled:"Tracing is not enabled for this Agent. Enable it in the console first.",loadTraceFailed:"Failed to load trace data",contentTypeMissing:"Content-Type missing",traceNonJson:"Trace failed: the server returned a non-JSON response ({{contentType}}). Check the Studio API proxy configuration",invalidTraceFormat:"Trace failed: invalid response format",submitIssueFeedbackFailed:"Failed to submit issue feedback",issueFeedbackNotConfirmed:"Failed to submit issue feedback: the server did not confirm the submission",noPreviewableAgent:"This Runtime does not provide an Agent that can be previewed.",agentSearchFailed:"Agent search failed",emptySseBody:"HTTP 200 with an empty SSE response body.",noDisplayableSseReply:"HTTP 200, but the SSE response did not contain a displayable model reply.",firstSseEventTimeout:"No SSE event was received within 30 seconds.",runSessionFailed:"Session run failed",runSseFailedWithDetail:"run_sse failed ({{status}}): {{detail}}",checkRuntimeNameFailed:"Failed to check the Runtime name",invalidRuntimeNameCheck:"Failed to check the Runtime name: invalid response format",loadCloudResourcesFailed:"Failed to load cloud resources",invalidCloudResources:"The cloud resource list response has an invalid format",invalidEnvironmentMount:"The environment mount response has an invalid format",environmentMountMismatch:"The environment mount response does not match the request",environmentMountNetworkFailed:"Unable to connect to Studio, so the environment was not mounted. Check your network and try again.",environmentMountFailed:"Failed to mount the environment",clipboardUnsupported:"This browser does not support writing to the clipboard.",clipboardWriteFailed:"Unable to write to the clipboard. Check clipboard permissions.",loadSystemInfoFailed:"Failed to load system information",invalidSystemInfo:"The system information response has an invalid format",invalidEnvironmentBuild:"The environment build response has an invalid format",invalidEnvironmentBuildStep:"The environment build step response has an invalid format",invalidEnvironmentManifest:"The environment manifest response has an invalid format",invalidImageRepository:"The environment image repository response has an invalid format",invalidCodeRepository:"The environment code repository response has an invalid format",invalidImageSource:"The environment image source response has an invalid format",invalidEnvironment:"The environment response has an invalid format",invalidWorkspace:"The workspace response has an invalid format",loadWorkspacesFailed:"Failed to load workspaces",invalidWorkspaceList:"The workspace list response has an invalid format",saveWorkspaceFailed:"Failed to save the workspace",deleteWorkspaceFailed:"Failed to delete the workspace",loadEnvironmentsFailed:"Failed to load environments",invalidEnvironmentList:"The environment list response has an invalid format",probeRepositoryFailed:"Failed to inspect the code repository",invalidRepositoryProbe:"The code repository inspection response has an invalid format",exportEnvironmentCodeFailed:"Failed to export the environment share code",invalidEnvironmentCode:"The environment share code response has an invalid format",inspectEnvironmentCodeFailed:"Failed to inspect the environment share code",invalidEnvironmentCodeInspection:"The environment share code inspection response has an invalid format",importEnvironmentCodeFailed:"Failed to import the environment share code",invalidEnvironmentCodeImport:"The environment share code import response has an invalid format",studioUnavailable:"Unable to connect to Studio. Confirm that the backend is running and try again.",saveEnvironmentFailed:"Failed to save the environment",deleteEnvironmentFailed:"Failed to delete the environment",startEnvironmentBuildFailed:"Failed to start the environment build",loadEnvironmentBuildFailed:"Failed to load environment build details",loadEnvironmentManifestFailed:"Failed to load the environment manifest",invalidEnvironmentResource:"The environment resource response has an invalid format",loadEnvironmentResourcesFailed:"Failed to load environment build resources",updateCodexSandboxFailed:"Failed to update Codex Sandbox",invalidCodexSandboxUpdate:"The Codex Sandbox update response has an invalid format",loadUserPoolsFailed:"Failed to load user pools",invalidUserPoolList:"The user pool list response has an invalid format",syncGithubFailed:"Failed to sync GitHub code ({{status}})",validatingMigrationArtifact:"Validating migration artifact",uploadingCodePackage:"Uploading code package",migrationArtifactValidated:"Migration artifact validated",codePackageUploaded:"Code package uploaded",deploymentProgress:{preparing:"Preparing deployment",uploading:"Uploading the code package",building:"Building the image",buildLogsSyncing:"Building the image. Build logs are up to date.",buildLogsComplete:"Build log sync complete.",buildFailedLogsSynced:"Image build failed. Final build logs are available.",buildLogsUnavailable:"Build logs are temporarily unavailable.",finalBuildLogsUnavailable:"Final build logs are temporarily unavailable.",deploying:"Deploying the service",publishing:"Publishing the service",evaluating:"Creating evaluation sets",updating:"Updating the Runtime configuration",completing:"Finalizing deployment",github:"Configuring GitHub delivery",inProgress:"Deployment in progress"},deploymentFailed:"Deployment failed",deploymentDisconnected:"Deployment failed: connection interrupted",deploymentMissingAgentName:"Deployment failed: Agent name missing from response",deploymentMissingConnection:"Deployment failed: AgentKit connection information missing from response",cancelDeploymentFailed:"Failed to cancel deployment ({{status}})",loadFailed:"Failed to load ({{status}})",loadPermissionsFailed:"Failed to load permissions ({{status}})",invalidPermissionResponse:"The permission service returned an unreadable response",checkStudioUpdateFailed:"Failed to check for Studio updates ({{status}})",studioUpdatePreflightFailed:"Studio update permission check failed ({{status}})",submitStudioUpdateFailed:"Failed to submit the Studio update ({{status}})",loadAgentUsageFailed:"Failed to load Agent usage",notProvided:"Not provided",agentUsageNonJson:"Failed to load Agent usage: the server returned a non-JSON response (HTTP {{status}}, Content-Type: {{contentType}}). ",checkStudioGateway:"Confirm that the current service is running in Studio mode and check the proxy or gateway configuration.",agentUsageInvalidJson:"Failed to load Agent usage: the server returned invalid JSON (HTTP {{status}}, Content-Type: {{contentType}}). ",retryCheckGateway:"Try again later. If the problem persists, check the proxy or gateway configuration.",loadCronJobsFailed:"Failed to load scheduled tasks",loadCronJobFailed:"Failed to load scheduled task details",createCronJobFailed:"Failed to create the scheduled task",updateCronJobFailed:"Failed to update the scheduled task",enableCronJobFailed:"Failed to enable the scheduled task",pauseCronJobFailed:"Failed to pause the scheduled task",runCronJobFailed:"Failed to run the scheduled task now",loadCronHistoryFailed:"Failed to load execution history",stopCronRunFailed:"Failed to stop the execution",deleteCronJobFailed:"Failed to delete the scheduled task",loadRuntimeFailed:"Failed to load the Runtime",loadLocalToolsFailed:"Failed to load local tools",connectDynamicRouteFailed:"Failed to connect the Studio dynamic route",a2aProbeDenied:"The Runtime rejected the A2A probe. Check the Runtime authentication configuration.",loadA2aCardFailed:"Failed to load the A2A Agent Card",loadRuntimeApiKeyFailed:"Failed to load the Runtime API key",runtimeApiKeyMissing:"The Runtime did not return a usable API key",deleteFailed:"Delete failed ({{status}})",runtimeManageForbidden:"This account cannot manage the Runtime.",runtimeNotFound:"The Runtime does not exist or has been deleted.",runtimeUnavailable:"This account cannot access the Runtime.",checkRuntimeUpdateFailed:"Failed to check Runtime update capability (HTTP {{status}}). Try again later.",loadRuntimeDetailFailed:"Failed to load Runtime details",generateProjectFailed:"Failed to generate the project",generateAgentConfigFailed:"Failed to generate the Agent configuration",createDebugRunFailed:"Failed to create the debug run",createDebugSessionFailed:"Failed to create the debug session",loadDebugTraceFailed:"Failed to load the debug trace",invalidDebugTrace:"Failed to load the debug trace: invalid response format",debugRunFailed:"Debug run failed",cleanupDebugRunFailed:"Failed to clean up the debug run"},kNe={loadFailed:"Failed to load conversation mode capabilities (HTTP {{status}})",invalidResponse:"The conversation mode capabilities response has an invalid format"},ENe={nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, {{contentType}}){{detail}}"},_Ne={common:oNe,agentkitCli:lNe,cloudRegion:cNe,connections:uNe,feishuBot:hNe,requestError:dNe,runSse:fNe,runtimeLogs:pNe,search:gNe,skills:mNe,sse:vNe,identity:yNe,github:bNe,video:xNe,websiteIntegration:wNe,knowledge:ANe,intelligentDevelopment:TNe,migrations:SNe,sandbox:CNe,client:ONe,newChatCapabilities:kNe,jsonResponse:ENe},$tr=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:lNe,client:ONe,cloudRegion:cNe,common:oNe,connections:uNe,default:_Ne,feishuBot:hNe,github:bNe,identity:yNe,intelligentDevelopment:TNe,jsonResponse:ENe,knowledge:ANe,migrations:SNe,newChatCapabilities:kNe,requestError:dNe,runSse:fNe,runtimeLogs:pNe,sandbox:CNe,search:gNe,skills:mNe,sse:vNe,video:xNe,websiteIntegration:wNe},Symbol.toStringTag,{value:"Module"})),RNe={backToEvaluationCase:"Back to evaluation case",cancel:"Cancel",copied:"Copied",copy:"Copy",exportConversation:"Export conversation",retry:"Retry"},DNe={title:"How would you like to add an Agent?",subtitle:"Choose the approach that best fits your project.",quickCreate:{title:"Create from scratch",description:"Build an Agent with intelligent, custom, template, or workflow modes."},intelligent:{title:"Intelligent mode",description:"Describe your goal, then build, debug, and validate the Agent interactively."},package:{title:"Add and deploy a code package",description:"Upload an Agent project archive, review the code, and deploy it to AgentKit Runtime."},migrate:{title:"Migrate an existing project",description:"Migrate an existing LangChain, Dify, or similar project to AgentKit Runtime."}},LNe={subject:{file:"file changes",command:"command execution"},decision:{accept:"Allowed {{subject}} once",acceptForSession:"Allowed {{subject}} for this session",decline:"Declined {{subject}}",cancel:"Cancelled approval for {{subject}}"},details:{command:"Command",grantRoot:"Authorized path",cwd:"Working directory"}},MNe={noDescription:"No description",region:"Region",unknownAgent:"Unknown Agent"},INe={agentTransfer:"Agent handoff",annotationHint:"Model response; select text to add an annotation",continueBranch:"Continue with “{{branch}}”",emptyResponse:"This response has no displayable content.",subagentDescription:"Working on a task handed off by the primary Agent."},PNe={title:"Configure {{provider}} credentials",prefix:"Agent Workspace requires {{provider}} credentials. Set",and:"and",suffix:"in the runtime environment, then retry."},NNe={buildRunning:{title:"A build is still running",description:"Leaving will stop this build. The session will remain available in your history.",confirm:"Stop and leave"},deleteThread:{title:"Delete Codex session",description:"Delete “{{name}}” and remove it from your session history?",confirm:"Delete"},returnToCreate:{title:"Return to the create page?",description:"Your current entries will be lost.",confirm:"Return"}},BNe={additionalAgentDeleteFailures:"; {{count}} more failed",agentDeleteFailures:"Failed to delete {{count}} Agents: {{failures}}{{suffix}}",agentToolsMissing:"This Agent is missing required tools: {{tools}}",buildStopUnconfirmed:"You left the development environment, but Studio could not confirm that the build stopped. It may still be running; check its status in session history later.",builtinAgentSendFailed:"Failed to send to the built-in Agent: {{message}}",bytePlusEvaluationUnsupported:"AgentKit evaluation sets are not currently supported on BytePlus",clipboardUnsupported:"This browser does not support writing to the clipboard.",cloudCodexEmptyReply:"The cloud Codex task ended without a response. Send the task again.",cloudCodexSessionMissing:"The cloud Codex session has not appeared in the list yet. Try again shortly.",deploymentRuntimeIdMissing:"Deployment completed without returning a Runtime ID.",environmentExpired:"The selected environment is no longer available. Refresh and select it again.",environmentsLoadFailed:"Failed to load environments",evaluationCaseSessionMissing:"This evaluation case has no session reference and cannot be opened.",evaluationUnsupportedForReply:"This response cannot be added to an evaluation set",firstFrameRequired:"Add a first-frame image before generating from first and last frames.",incompletePromptOptimization:"The prompt optimization result is incomplete. Run the optimization again.",intelligentCapabilityCheckFailed:"Failed to check intelligent development capabilities (HTTP {{status}})",intelligentSessionCreateFailed:"Failed to create the intelligent development session",invalidIntelligentCapability:"The intelligent development capability response is invalid.",localBffToolsNotConfigured:"No tools are configured for the local Studio BFF.",localToolsLoadFailed:"Failed to load local tools",loginPopupBlocked:"The browser blocked the sign-in window. Allow pop-ups and try again.",loginPopupClosed:"The sign-in window was closed. Sign in again to continue.",mediaTooLarge:"{{fileName}} exceeds this platform's media size limit.",mountEnvironmentFailed:"Failed to mount the environment",noConnectedSandbox:"No Sandbox is currently connected.",noCreateAgentPermission:"Your account does not have permission to add Agents.",noManageAgentPermission:"Your account does not have permission to manage Agents.",noOptimizationBaseline:"There is no pre-optimization version available for comparison.",oauthUrlMissing:"The event does not include an authorization URL.",onlyCloudAgentUpdatable:"Only deployed cloud Agents can be updated.",optimizationVersionMissing:"The project version for this optimization could not be found. It may have been deleted.",persistentStorageNotConfigured:"Persistent storage has not been configured by an administrator",readDraftFailed:"Unable to read local drafts. Try again.",runtimeAgentNameMissing:"The Runtime is missing an Agent name and cannot be updated.",runtimeBffToolsDisabled:"BFF tool capabilities are not enabled for this Runtime Agent.",runtimeDeploymentConfigUnavailable:"The Runtime's original deployment configuration cannot be restored, so it cannot be updated safely.",runtimeMissingForConnection:"Runtime information is missing, so the Agent cannot be connected.",runtimeRegionMissingForDelete:"The Runtime is missing region information and cannot be deleted.",runtimeRegionMissingForUpdate:"The Runtime is missing region information and cannot be updated.",runtimeUpdateUnsupported:"This Runtime does not support in-place updates.",sandboxRuntimeUnavailable:"This Agent does not have an available Sandbox Runtime.",sandboxToolsUnavailable:"The current Studio BFF does not provide Sandbox execution tools.",saveDraftLocationRejected:"The browser could not save the current draft location. Check site storage permissions and try again.",saveDraftRejected:"The browser could not save the draft. Try again.",selectSkillToOptimize:"Select a Skill to optimize first.",sessionMissingForMount:"The current session does not exist, so an environment cannot be mounted.",sessionNotReady:"The session is not ready yet.",sessionUnavailable:"The current session is unavailable. Close it and try again.",sourceNotReady:"The source is not ready yet. Return to the conversation to continue.",textVideoRejectsReferences:"Text-to-video does not use reference media. Remove the images or videos first.",videoEditRequiresVideo:"Add the video you want to edit first.",videoExtendRequiresVideo:"Add a source video before extending it.",videoGenerationFailed:"Video generation failed. Try again later.",videoModeUnsupported:"The selected video mode is not supported on this platform.",videoPreviewMissing:"The video task completed, but the server did not return a preview URL.",videoReferenceRequired:"Add at least one reference image or video."},$Ne={like:"Like",removeLike:"Remove like",dislike:"Dislike",removeDislike:"Remove dislike",reportIssue:"Report an issue",traceFlameGraph:"Tracing flame graph"},FNe={0:"What would you like to work on today?",1:"How can I help?",2:"What would you like me to look into?",3:"Ask me anything",4:"Hi, let's get started",5:"Start a new conversation",6:"What should we tackle first?",7:"Tell me what you have in mind",8:"Where should we begin?",9:"What can I help you with?",10:"Ready to move this forward?",11:"What's most important right now?",12:"Let's get something done today",13:"I'm ready when you are",intelligentDevelopment:"Give your ideas room to grow"},zNe={agentCapabilities:"Checking Agent capabilities…",session:"Loading session…"},UNe={cancelled:"Authorization was cancelled.",pasteCallbackUrl:"After authorization, paste the full callback URL from your browser's address bar:",popupBlocked:"The browser blocked the authorization window. Allow pop-ups and try again.",unsupportedUrl:"The authorization URL is not HTTP or HTTPS and was blocked."},VNe={volcengine:"Volcengine"},QNe={checkingPersistence:"Checking persistent storage…",exitDevelopment:"Exit development",fileUploaded:"Uploaded a file to the Sandbox",filesUploaded:"Uploaded {{count}} files to the Sandbox",intelligentDevelopment:"Intelligent development",mode:{readOnly:"Read only",workspaceWrite:"Workspace write",fullAccess:"Full access"},approvalPolicy:{untrusted:"Untrusted commands only",onRequest:"Ask when needed",never:"Never ask"},reviewer:{user:"Ask me",autoReview:"Automatic review"},labels:{approvalPolicy:"Approval policy",file:"File",fileNumber:"File {{number}}",mode:"Sandbox mode",networkAccess:"Network access",reviewer:"Approval method",workingDirectory:"Working directory"},network:{allowed:"Allowed",disabled:"Off"},permissionsUpdated:"Updated Codex permissions for this Sandbox session",persistenceUnknown:"Unable to verify persistent storage",stoppedReady:"Stopped. You can continue typing.",uploadedFilesPrompt:"The following files were uploaded to the current Sandbox workspace. Use them in this task:",workspaceUpdated:"Workspace updated"},GNe={addAgent:"Add Agent",addFromPackage:"Add from code package",agent:"Agent",automations:"Automations",createAgent:"Create Agent",createSkill:"Create Skill",cronJobs:"Cronjob",issueFeedback:"Issue feedback",library:"Library",migrateAgent:"Migrate Agent",newConversation:"New conversation",optimizeSkill:"Optimize {{name}}",search:"Search",skill:"Skill",skillLibrary:"Skill library",systemInfo:"System information",updateAgent:"Update {{name}}"},HNe={actions:RNe,addAgent:DNe,approval:LNe,common:MNe,conversation:INe,credentials:PNe,dialogs:NNe,errors:BNe,feedback:$Ne,greetings:FNe,loading:zNe,oauth:UNe,providers:VNe,sandbox:QNe,titles:GNe},Ftr=Object.freeze(Object.defineProperty({__proto__:null,actions:RNe,addAgent:DNe,approval:LNe,common:MNe,conversation:INe,credentials:PNe,default:HNe,dialogs:NNe,errors:BNe,feedback:$Ne,greetings:FNe,loading:zNe,oauth:UNe,providers:VNe,sandbox:QNe,titles:GNe},Symbol.toStringTag,{value:"Module"})),WNe="Automations",YNe="Connect development tools and extend your Agents with automated workflows",qNe="Search automations",jNe="Automation categories",XNe={development:"Development",channels:"Messaging channels"},KNe="{{category}} automations",ZNe="Open {{name}}",JNe="Available only in local deployments",e8e="No matching automations",t8e="Try searching for another name",r8e="Back to automations",n8e={"coding-agents":{name:"Configure coding agents",badge:"Local",description:"Install built-in VeADK and AgentKit skills globally for Trae, Claude Code, or Codex."},template:{name:"Import starter project",description:"Create a minimal Agent project in your repository with continuous delivery to AgentKit Runtime.",title:"Import starter project",subtitle:"Add a ready-to-run basic Agent and continuous delivery configuration to your repository",panel:"This creates a pull request containing the basic project and AgentKit Runtime delivery workflow.",submitLabel:"Import template and create PR",regionHelp:"Must match the target Runtime region",pullRequest:{title:"feat: import AgentKit basic template",description:"Import a basic Agent project with the AgentKit Studio App Server and add continuous delivery to AgentKit Runtime. Configure the required {{provider}} secrets before merging."},fields:{repository:{label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL"},baseBranch:{label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base"},projectPath:{label:"Agent project directory",placeholder:"agentkit-basic-agent",help:"The basic project will be added here; app.py mounts the complete Studio App Server and serves as the entry point"},runtimeName:{label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration"},runtimeId:{label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates"}}},delivery:{name:"AgentKit Runtime delivery",description:"Add a workflow that continuously delivers your repository to AgentKit Runtime.",title:"AgentKit Runtime delivery",subtitle:"Add continuous delivery to the repository through a pull request",panel:"This creates a release branch and opens a pull request containing the GitHub Actions workflow.",submitLabel:"Confirm and create PR",regionHelp:"Must match the target Runtime region",pullRequest:{title:"feat: continuously publish to AgentKit Runtime",description:"Add a GitHub Actions workflow that continuously publishes updates from the target branch to AgentKit Runtime. Configure the required {{provider}} secrets before merging."},fields:{repository:{label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL"},baseBranch:{label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base"},projectPath:{label:"Agent project directory",placeholder:".",help:"Defaults to the repository root; the directory must contain an app.py that mounts the complete Studio App Server"},runtimeName:{label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration"},runtimeId:{label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates"}}},review:{name:"Automated PR review",description:"Use a GitHub App to review pull requests in an isolated Sandbox.",title:"Automated PR review",subtitle:"Trigger Sandbox reviews through the GitHub App and publish results to pull requests",panel:"Install the GitHub App to target repositories, then enable automated review for each repository.",submitLabel:"Install GitHub App",regionHelp:"",pullRequest:{title:"chore: configure automated PR review",description:"Add a GitHub Actions workflow that reviews same-repository pull requests in an isolated Sandbox and publishes the result as a GitHub review. Configure the required workflow secrets before merging."},fields:{repository:{label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL"},baseBranch:{label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base"},sandboxToolId:{label:"Sandbox Tool ID",placeholder:"tool-xxxxxxxx",help:"The AgentKit CodeEnv used for each review"},modelName:{label:"Review model",placeholder:"review-model",help:"The code review model name injected into the Sandbox"},modelBaseUrl:{label:"Model API URL",placeholder:"https://ark.example.com/api/v3",help:"Must be an OpenAI-compatible HTTPS endpoint"}}},feishu:{name:"Feishu bot",badge:"Beta",description:"Create a Feishu bot and connect its messages directly to AgentKit Runtime."},"website-integration":{name:"Website integration",description:"Embed an AgentKit Runtime on your website as a floating chat window."}},i8e={required:"Required",optional:"Optional",region:"Region",tokenLabel:"GitHub Token",getToken:"Get token",createToken:"Create GitHub token",tokenPlaceholder:"Requires write access to repository contents and pull requests",tokenWorkflowPlaceholder:"Requires write access to contents, pull requests, and workflows",hideToken:"Hide token",showToken:"Show token",tokenHelp:"The token is used only for this submission. It is not stored in the browser or written to the pull request.",tokenWorkflowHelp:"This token is used only to create the configuration PR. It is not a general Sandbox requirement and is not stored in the browser or written to the PR.",prCreated:"PR #{{number}} created",configPrCreated:"Configuration PR #{{number}} created",configPrNextStep:"After it is merged, later pull requests in the same repository will trigger reviews automatically.",viewOnGitHub:"View on GitHub",viewConfigPr:"View configuration PR",secretsHeading:"Before merging the pull request, configure these GitHub Actions secrets in the repository:",secretsConfigHeading:"Before merging the configuration PR, add runtime secrets to the target repository",openSecrets:"Open Secrets settings",secretsPath:"Path: Settings → Secrets and variables → Actions → Repository secrets",repositoryConfigHelp:"A PR review configuration will be added for {{repository}}",repositoryReviewHelp:"GitHub App will validate pull requests for {{repository}}",secretPair:"{{accessKey}}, {{secretKey}} (required)",sessionToken:"{{sessionToken}} (required when using temporary credentials)",requiredSecret:"{{name}} (required)",temporaryCredentialRequired:" (required when using temporary credentials)",requiredSuffix:" (required)",submitting:"Creating PR…",validation:{required:"This field is required",repository:"Enter owner/repository or a full GitHub repository URL",baseBranch:"The target branch format is invalid",projectPath:"Enter a relative path within the repository",runtimeId:"The Runtime ID format is invalid",sandboxToolId:"The Sandbox Tool ID format is invalid",modelName:"The model name format is invalid",modelBaseUrlSafe:"Enter an HTTPS URL without credentials, query parameters, or fragments",modelBaseUrl:"Enter a valid HTTPS URL",runtimeName:{required:"Runtime name is required",characters:"Runtime name can contain only letters, numbers, underscores, and hyphens",length:"Runtime name must be 4–64 characters"}}},a8e={title:"Configure coding agents",description:"Install the AgentKit skills bundled with Studio globally for local coding clients.",retry:"Retry",clients:{ariaLabel:"Select coding agents",title:"Local clients",detectAgain:"Detect again",detecting:"Detecting local clients…",detected:"Client detected",available:"Available",unavailable:"Not detected"},skills:{ariaLabel:"Select bundled skills",title:"Bundled skills",viewFiles:"View files",items:{"veadk-agent-development":{name:"VeADK Agent development",description:"Build and refine Agents with VeADK."},"agentkit-cli":{name:"AgentKit CLI",description:"Manage and deploy AgentKit resources with AgentKit CLI."}}},global:{ariaLabel:"Global installation directories",title:"Global installation",description:"Available to other local projects after configuration",empty:"Select a client to see its installation directory."},success:"Configured {{skillCount}} skill(s) for {{agentCount}} client(s)",selection:"{{agentCount}} client(s) and {{skillCount}} skill(s) selected",selectClient:"Select a client first",configuring:"Configuring…",configure:"Configure",errors:{detect:"Failed to detect local clients",configure:"Configuration failed. Check permissions for your user directory and try again."},preview:{description:"Browse the skill files bundled with Studio in read-only mode",close:"Close file preview",loading:"Loading files…",error:"Failed to load skill files",skillFiles:"{{name}} files",files:"Files",fileContent:"File contents",notPreviewable:"This file is not previewable UTF-8 text.",noFiles:"No previewable files."}},s8e={title:"Feishu bot",description:"Create a Feishu Agent powered by AgentKit Runtime",panel:"Enter the credentials for a published Feishu app. Studio will generate a basic Agent, create a dedicated Runtime, and enable the persistent Feishu messaging connection.",agentName:"Agent name",agentNameHelp:"Used as the root Agent name in the new Runtime",region:"Deployment region",regionHelp:"The Runtime and build artifacts will be created in this region",regions:{"cn-beijing":"Beijing","cn-shanghai":"Shanghai"},appId:"Feishu App ID",appIdHelp:"Application credential from the Feishu Open Platform",appSecret:"Feishu App Secret",appSecretPlaceholder:"Enter the App Secret",appSecretHelp:"Written only to the environment variables of the new Runtime",hideSecret:"Hide App Secret",showSecret:"Show App Secret",hide:"Hide",show:"Show",confirmCancel:"Cancelling will stop the task and clean up any Runtime already created. Continue?",status:{preparing:"Generating the basic Agent",running:"Creating Runtime",cancelling:"Cancelling deployment",succeeded:"Feishu bot Runtime created",cancelled:"Deployment cancelled",failed:"Creation failed"},steps:{prepare:"Generate Agent",build:"Build image",deploy:"Create Runtime",publish:"Publish service"},openConsole:"Open Runtime console",credentials:{title:"Credential handling",description:"The App Secret is used only for this deployment. It is never written to generated source code or browser storage."},cancelDeployment:"Cancel deployment",creating:"Creating…",create:"Create Feishu bot Runtime",validation:{appId:"Enter the Feishu App ID",appSecret:"Enter the Feishu App Secret",agentName:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name",characters:"Name must start with a letter or underscore and contain only letters, numbers, and underscores"}},generatedAgent:{description:"A helpful assistant that receives messages through Feishu.",instruction:"You are a helpful assistant serving users through Feishu. Understand each request accurately and provide concise, reliable answers. Ask clarifying questions when information is missing, and never invent facts."}},ztr=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:r8e,cards:n8e,categories:XNe,categoriesLabel:jNe,codingAgents:a8e,default:{title:WNe,description:YNe,search:qNe,categoriesLabel:jNe,categories:XNe,resultsLabel:KNe,open:ZNe,localOnly:JNe,emptyTitle:e8e,emptyDescription:t8e,backToAutomations:r8e,cards:n8e,github:i8e,codingAgents:a8e,feishu:s8e},description:YNe,emptyDescription:t8e,emptyTitle:e8e,feishu:s8e,github:i8e,localOnly:JNe,open:ZNe,resultsLabel:KNe,search:qNe,title:WNe},Symbol.toStringTag,{value:"Module"})),o8e={"zh-CN":"简体中文","en-US":"English"},Utr=Object.freeze(Object.defineProperty({__proto__:null,default:{languageNames:o8e},languageNames:o8e},Symbol.toStringTag,{value:"Module"})),l8e={selectedExcerptLabel:"Selected excerpt",commentLabel:"Annotation",commentSeparator:": ",successTitle:"Added to the Bad Case evaluation set",successDescription:"This annotation is linked to the current question and the complete model response.",done:"Done",ariaLabel:"Annotate the selected model response",title:"Add annotation",content:"Annotation",placeholder:"Describe the issue or the expected change",retryError:"{{error}}. Please try again.",cancel:"Cancel",submit:"Add to Bad Case"},c8e={attachment:"attachment",image:"image",preview:"Preview {{name}}",uploading:"Uploading",uploadFailed:"Upload failed",remove:"Remove {{name}}",previewDialog:"{{name}} preview",download:"Download",close:"Close",reading:"Loading document…",loadFailed:"Failed to load document: {{error}}"},u8e={errorTitle:"Cloud log error",copyError:"Copy complete error details",retry:"Retry",statuses:{live:"Live",connecting:"Connecting",retrying:"Reconnecting",idle:"Disconnected"},title:"Instance logs",description:"The VeFaaS instance handling the current conversation request",close:"Close instance logs",instanceId:"Instance ID",waitingInstance:"Waiting for instance",request:"Request {{id}}",ariaLabel:"Live VeFaaS instance logs",notCapturedTitle:"No instance captured yet",notCapturedDescription:"Send a message to see the instance that handles it and its live logs.",connectingTitle:"Connecting to instance logs",connectingDescription:"Establishing a secure log stream through the Studio BFF.",emptyTitle:"No logs yet",emptyDescription:"Connected to the instance and waiting for new log output.",retention:"Logs refresh automatically. Only the latest {{count}} lines are kept."},h8e={title:"Trace",statuses:{loading:"Loading",ready:"",collecting:"Collecting",disabled:"Disabled",forbidden:"Permission required",error:"Failed to load"},errors:{collecting:"The trace is still being collected. Please wait.",disabled:"Tracing is not enabled for this agent. Enable it in the console and try again.",forbidden:"Your account cannot read APMPlus traces. Ask an administrator for read access.",error:"Failed to load the trace. Please try again later."},callCount:"{{count}} calls · {{duration}} ms",close:"Close",loading:"Loading trace…",retryNow:"Retry now",reload:"Reload",empty:"No trace is available for this session yet.",attributes:"Attributes",selectCall:"Select a call on the left to view its details"},d8e={exportNote:"This conversation was exported from AgentKit Studio for reference only.",imageFailed:"Failed to generate the image. Please try again.",browserUnsupported:"This browser cannot generate a conversation image. Please try again.",copyUnsupported:"This browser cannot copy images. Download the image instead.",exportFailed:"Export failed. Please try again.",title:"Export conversation",description:"Choose a format and download all inputs and outputs through the current response.",close:"Close",generatingContent:"Preparing export…",retry:"Try again",previewPage:"Previewing page 1 of {{count}}",previewAlt:"Conversation export page 1 of {{count}}",format:"Export format",generatingFormat:"Generating {{format}}…",copying:"Copying…",copiedFirst:"First page copied",copied:"Copied",copyFirst:"Copy first page",copyImage:"Copy image",generating:"Generating…",downloadArchive:"Download PNG archive ({{count}} pages)",downloadFormat:"Download {{format}}"},f8e={unsupportedComponent:"Unsupported component: {{component}}",sandboxIdentity:"Codex Sandbox execution identifiers",useSkill:"Use the {{name}} skill",thinkingDone:"Finished thinking",thinking:"Thinking",justNow:"Just now",sourceUnavailable:"The generated source is temporarily unavailable. Please try again later.",downloadStarted:"Download started",verifiedDelivery:"Verified deliverable",generatedSource:"Generated agent source",entryPoint:"Entry point",fileCount:"Files",size:"Size",validationTime:"Validated",generationTime:"Generated",checksPassed:"{{count}} checks passed",sourceReady:"Source is ready to deploy",sourceGuidance:"The source is ready to view, download, or deploy. Confirm the runtime configuration before deployment.",viewSource:"View source",preparing:"Preparing…",viewChanges:"View changes",downloadSource:"Download source",sourceNotReady:"The source is not ready yet",manualDeploy:"Deploy manually to Runtime",beforeOptimization:"Before optimization",afterOptimization:"After optimization",planStatuses:{pending:"Pending",in_progress:"In progress",completed:"Completed",failed:"Incomplete"},renderUi:"Render UI",truncated:"… (truncated)",agentAdjusting:"Agent is adjusting",sandboxDetails:"Detailed Codex Sandbox output",waitingCodex:"Waiting for Codex output",arguments:"Arguments",result:"Result",artifacts:"Artifacts",downloadNamed:"Download {{name}}",powerpoint:"PowerPoint presentation",preview:"Preview",download:"Download",previewDialog:"{{name}} preview",closePreview:"Close preview",slidePreview:"{{name}} slide preview",mcpToolset:"MCP toolset",authorized:"Authorized · {{tool}}",authorizationRequired:"{{tool}} requires authorization",oauthDescription:"The {{tool}} toolset is protected by OAuth and requires sign-in before use.",oauthProvider:"You will be redirected to {{provider}} to sign in.",oauthContinue:"The conversation will continue automatically after authorization.",waitingAuthorization:"Waiting for authorization…",authorize:"Authorize",missingAuthorizationUrl:"No authorization URL was found in the event.",tools:{web_search:{running:"Searching the web",done:"Web search complete"},link_reader:{running:"Reading webpage",done:"Webpage read complete"},run_code:{running:"Running code in the AgentKit sandbox",done:"Code execution completed in the AgentKit sandbox"},list_envs:{running:"Checking available environments",done:"Available environments loaded"},get_env_manifest:{running:"Loading the environment manifest",done:"Environment manifest loaded"},execute_in_sandbox:{running:"Running a command in the environment",done:"Command completed in the environment"},delegate_to_codex_sandbox:{running:"Codex Sandbox is running",done:"Codex Sandbox completed",failed:"Codex Sandbox failed"},image_generate:{running:"Generating image",done:"Image generated"},video_generate:{running:"Generating video",done:"Video generated"},ppt_generate:{running:"Generating presentation",done:"Presentation generated"},load_memory:{running:"Searching long-term memory",done:"Memory search complete"},load_knowledgebase:{running:"Searching the knowledge base",done:"Knowledge base search complete"},load_skill:{running:"Loading skill",done:"Skill loaded"},collect_resources:{running:"Collecting available resources",done:"Resource collection complete",failed:"Resource collection failed"},create_agents:{running:"Creating and running agents",done:"Agent creation complete",failed:"Agent creation failed"}},createAgents:{categories:{skill_hub:"Skill Hub",skill_space:"AgentKit Skill Center",knowledge_base:"Knowledge base",tool:"Tools"},agentTypes:{llm:"LLM Agent",sequential:"Sequential Agent",parallel:"Parallel Agent",loop:"Loop Agent",workflow:"Workflow"},skill:"Skill",subAgents:"Sub-agents",builtinTool:"Built-in tool",skillCenter:"AgentKit Skill Center",selfAuthoredTools:"Custom tools",dependencies:"Dependencies: {{items}}",fullCode:"Complete code for {{name}}",itemCount:"{{label}}: {{count}} items",collectionAria:"Retrieved resource information",retrieving:"Retrieving resources",retrievalFailed:"Resource retrieval did not complete",checkConfig:"Check the resource service configuration and try again.",notSearched:"Not searched",notConfigured:"Not configured",resourceList:"{{label}} resource list",searchKeywords:"Search keywords",skillHubSkipped:"No search keywords were provided, so Skill Hub was not searched.",sourceSkipped:"{{label}} is not configured, so this source was not searched.",noResources:"No resources in this category were returned.",resultAria:"Agent creation results",creationFailed:"Agent creation did not complete",agentResources:"Resources available to {{name}}",knowledgeBase:"Knowledge base",toolsLabel:"Tools",creating:"Creating agents",noAgents:"No agents to display",noAgentResult:"The tool response did not include an agent configuration or execution result.",sourceLabels:{tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknown:"Unknown source"},unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"},branchCompare:{ariaLabel:"Compare branches",selectDirection:"Select a direction",continue:"Continue in this direction"},codexProgress:{planTitle:"Codex execution plan",fallback:{fileChange:"Modify files",approval:"Waiting for approval",status:"Codex status",command:"Run command"},planSummary:"{{completed}}/{{total}} completed",command:{running:"Running command",completed:"Command completed",failed:"Command failed"},projectFiles:"{{count}} project files",projectFile:"project files",fileChange:{running:"Updating {{subject}}",completed:"Updated {{subject}}",failed:"Failed to update {{subject}}"},externalTool:"external tool",mcp:{running:"Calling {{tool}}",completed:"Called {{tool}}",failed:"{{tool}} call did not complete"},collaboration:{spawn_agent:{running:"Starting subtask",completed:"Subtask started",failed:"Failed to start subtask"},send_input:{running:"Sending information to subtask",completed:"Information sent to subtask",failed:"Failed to send information to subtask"},wait:{running:"Waiting for subtask",completed:"Subtask wait complete",failed:"Subtask wait failed"},close_agent:{running:"Ending subtask",completed:"Subtask ended",failed:"Failed to end subtask"},default:{running:"Coordinating subtasks",completed:"Subtask collaboration complete",failed:"Subtask collaboration failed"}},webSearch:{running:"Searching the web",completed:"Web search complete",failed:"Web search did not complete"},errorDetail:"Codex execution did not complete.",errorTitle:"Codex encountered an error"}},p8e={segments:{system:"System and tools",input:"Input and history",output:"Output and reasoning",remaining:"Remaining"},modelUnavailable:"Model information unavailable",promptWithSystem:"Prompt (including system)",systemUnknown:"System and tool usage unknown",systemApprox:"System and tools approximately {{count}} tokens",ariaKnown:"Context {{percentage}}% used, {{system}}, {{inputLabel}} {{input}} tokens, output and reasoning {{output}} tokens, remaining {{remaining}} tokens",ariaUnknown:"{{model}}, context window unknown, {{count}} cumulative session tokens used",composition:"Context composition",percentageUsed:"{{percentage}}% used",gridAria:"100-cell context composition chart. Each cell represents one percent of the context window.",estimated:"Estimated",unknown:"Unknown",summaryPercentage:"{{used}} used, {{remaining}} remaining",summaryTokens:"{{used}} used, {{remaining}} remaining, {{total}} total",overflow:"Context exceeded by {{count}} tokens",title:"Context usage",unknownModel:"The context window for this model is not available",unknownRuntime:"The current runtime did not provide model information"},g8e={title:"Add AgentKit agent",noAgents:"Connected successfully, but no agents were found at this address (/list-apps was empty).",connectionFailed:"Connection failed: {{error}}. Check the URL, API key, and whether the gateway allows cross-origin requests.",description:"Enter the URL and API key of an AgentKit deployment to connect through the ADK protocol. Connected agents will appear in the selector in the upper-left corner.",url:"Endpoint URL",apiKeyHint:"Connect using Authorization: Bearer",displayName:"Display name (optional)",displayNameHint:"Uses the URL hostname by default",cancel:"Cancel",connecting:"Connecting…",connect:"Connect and add"},m8e={placeholder:"Type a message…",inputAria:"Message",generating:"Generating",send:"Send"},v8e={ariaLabel:"Invocation context for this turn",removeSkill:"Remove skill {{name}}",removeAgent:"Remove agent {{name}}"},y8e={cardAria:"{{label}} chart",viewAria:"{{label}} display mode",preview:"Preview",code:"Code",invalidEcharts:"The ECharts configuration is not a valid, safe data object. Switch to Code to inspect it.",renderFailed:"The chart cannot be rendered right now. Switch to Code to inspect it.",echartsAria:"ECharts preview",rendering:"Rendering chart…",mermaidFailed:"The chart cannot be rendered right now. Switch to Code to inspect the Mermaid source.",mermaidAria:"Mermaid preview"},b8e={playVideo:"Play video: {{name}}",enlargeImage:"Enlarge image preview: {{name}}",image:"image",enlargeVideo:"Enlarge video",videoPreview:"Video preview",downloadVideo:"Download video",close:"Close"},x8e={annotation:l8e,media:c8e,runtimeLogs:u8e,trace:h8e,share:d8e,blocks:f8e,tokenUsage:p8e,addAgentKit:g8e,composer:m8e,invocation:v8e,visualization:y8e,markdown:b8e},Vtr=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:g8e,annotation:l8e,blocks:f8e,composer:m8e,default:x8e,invocation:v8e,markdown:b8e,media:c8e,runtimeLogs:u8e,share:d8e,tokenUsage:p8e,trace:h8e,visualization:y8e},Symbol.toStringTag,{value:"Module"})),w8e={back:"Back",cancel:"Cancel",deploy:"Deploy",delete:"Delete",loading:"Loading…",next:"Next",notSupported:"Not supported",previous:"Previous",required:"Required",retry:"Retry",actions:"Actions",value:"Value",disabled:"Off",enabled:"Enabled",none:"None",close:"Close",name:"Name",description:"Description",send:"Send"},A8e={heading:"VeADK agent structure configuration",importHint:"Reload this file from Import YAML on the Create Agent page."},T8e={agentName:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name.",characters:"Start with a letter or underscore and use only letters, numbers, and underscores"},runtimeName:{required:"Runtime name is required",characters:"Runtime name can contain only letters, numbers, underscores, and hyphens",length:"Runtime name must be 4–64 characters"}},S8e={description:"A VeADK-powered assistant that understands user intent and uses the right tools to complete tasks.",instruction:`You are a professional and reliable assistant. +{{response}}`,loadArkApiKeysFailed:"Failed to load Ark API keys",loadModelsFailed:"Failed to load models",runtimeAccessDenied:"This account cannot access the Runtime. Refresh the list or sign in again.",privateRuntimeUnavailable:"The Runtime was deployed, but this Studio cannot access the private Runtime. Use a Studio connected to the same VPC, or deploy with public or public plus VPC access.",runtimeTemporarilyUnavailable:"The Runtime was deployed, but Studio cannot connect yet. The gateway domain may still be propagating, or the current network or DNS cannot reach it. Try connecting again later from Manage Agents.",runtimeConnectionUnsupported:"The Runtime Agent Server does not provide a connection endpoint. Confirm that the Runtime is ready and compatible.",runtimeConnectionDenied:"The Runtime rejected the connection request. Check its authentication configuration.",listAgentsFailed:"Failed to load Agents",invalidListAppsJson:"Runtime /list-apps returned unreadable JSON.",invalidListAppsFormat:"Runtime /list-apps returned an invalid format; expected a non-empty string array.",createSessionFailedWithStatus:"Failed to create session ({{status}})",createSessionFailed:"Failed to create session",getSessionFailed:"Failed to load session",getSessionFailedWithDetail:"Failed to load session ({{status}}): {{detail}}",feedbackRuntimeOnly:"Feedback sync is supported only for sessions connected to an AgentKit Runtime",feedbackRegionMissing:"The Runtime region is missing, so feedback cannot be submitted",submitFeedbackFailed:"Failed to submit feedback",loadEvaluationSetsFailed:"Failed to load evaluation sets",loadAutoEvaluationStatusFailed:"Failed to load automatic evaluation status",loadOptimizationsFailed:"Failed to load optimization suggestions",deleteEvaluationCaseFailed:"Failed to delete the evaluation case",downloadFileFailed:"Failed to download the file",fileUnavailable:"File content is unavailable",uploadFileFailed:"File upload failed",traceDisabled:"Tracing is not enabled for this Agent. Enable it in the console first.",loadTraceFailed:"Failed to load trace data",contentTypeMissing:"Content-Type missing",traceNonJson:"Trace failed: the server returned a non-JSON response ({{contentType}}). Check the Studio API proxy configuration",invalidTraceFormat:"Trace failed: invalid response format",submitIssueFeedbackFailed:"Failed to submit issue feedback",issueFeedbackNotConfirmed:"Failed to submit issue feedback: the server did not confirm the submission",noPreviewableAgent:"This Runtime does not provide an Agent that can be previewed.",agentSearchFailed:"Agent search failed",emptySseBody:"HTTP 200 with an empty SSE response body.",noDisplayableSseReply:"HTTP 200, but the SSE response did not contain a displayable model reply.",firstSseEventTimeout:"No SSE event was received within 30 seconds.",runSessionFailed:"Session run failed",runSseFailedWithDetail:"run_sse failed ({{status}}): {{detail}}",checkRuntimeNameFailed:"Failed to check the Runtime name",invalidRuntimeNameCheck:"Failed to check the Runtime name: invalid response format",loadCloudResourcesFailed:"Failed to load cloud resources",invalidCloudResources:"The cloud resource list response has an invalid format",invalidEnvironmentMount:"The environment mount response has an invalid format",environmentMountMismatch:"The environment mount response does not match the request",environmentMountNetworkFailed:"Unable to connect to Studio, so the environment was not mounted. Check your network and try again.",environmentMountFailed:"Failed to mount the environment",clipboardUnsupported:"This browser does not support writing to the clipboard.",clipboardWriteFailed:"Unable to write to the clipboard. Check clipboard permissions.",loadSystemInfoFailed:"Failed to load system information",invalidSystemInfo:"The system information response has an invalid format",invalidEnvironmentBuild:"The environment build response has an invalid format",invalidEnvironmentBuildStep:"The environment build step response has an invalid format",invalidEnvironmentManifest:"The environment manifest response has an invalid format",invalidImageRepository:"The environment image repository response has an invalid format",invalidCodeRepository:"The environment code repository response has an invalid format",invalidImageSource:"The environment image source response has an invalid format",invalidEnvironment:"The environment response has an invalid format",invalidWorkspace:"The workspace response has an invalid format",loadWorkspacesFailed:"Failed to load workspaces",invalidWorkspaceList:"The workspace list response has an invalid format",saveWorkspaceFailed:"Failed to save the workspace",deleteWorkspaceFailed:"Failed to delete the workspace",loadEnvironmentsFailed:"Failed to load environments",invalidEnvironmentList:"The environment list response has an invalid format",probeRepositoryFailed:"Failed to inspect the code repository",invalidRepositoryProbe:"The code repository inspection response has an invalid format",exportEnvironmentCodeFailed:"Failed to export the environment share code",invalidEnvironmentCode:"The environment share code response has an invalid format",inspectEnvironmentCodeFailed:"Failed to inspect the environment share code",invalidEnvironmentCodeInspection:"The environment share code inspection response has an invalid format",importEnvironmentCodeFailed:"Failed to import the environment share code",invalidEnvironmentCodeImport:"The environment share code import response has an invalid format",studioUnavailable:"Unable to connect to Studio. Confirm that the backend is running and try again.",saveEnvironmentFailed:"Failed to save the environment",deleteEnvironmentFailed:"Failed to delete the environment",startEnvironmentBuildFailed:"Failed to start the environment build",loadEnvironmentBuildFailed:"Failed to load environment build details",loadEnvironmentManifestFailed:"Failed to load the environment manifest",invalidEnvironmentResource:"The environment resource response has an invalid format",loadEnvironmentResourcesFailed:"Failed to load environment build resources",updateCodexSandboxFailed:"Failed to update Codex Sandbox",invalidCodexSandboxUpdate:"The Codex Sandbox update response has an invalid format",loadUserPoolsFailed:"Failed to load user pools",invalidUserPoolList:"The user pool list response has an invalid format",syncGithubFailed:"Failed to sync GitHub code ({{status}})",validatingMigrationArtifact:"Validating migration artifact",uploadingCodePackage:"Uploading code package",migrationArtifactValidated:"Migration artifact validated",codePackageUploaded:"Code package uploaded",deploymentProgress:{preparing:"Preparing deployment",uploading:"Uploading the code package",building:"Building the image",buildLogsSyncing:"Building the image. Build logs are up to date.",buildLogsComplete:"Build log sync complete.",buildFailedLogsSynced:"Image build failed. Final build logs are available.",buildLogsUnavailable:"Build logs are temporarily unavailable.",finalBuildLogsUnavailable:"Final build logs are temporarily unavailable.",deploying:"Deploying the service",publishing:"Publishing the service",evaluating:"Creating evaluation sets",updating:"Updating the Runtime configuration",completing:"Finalizing deployment",github:"Configuring GitHub delivery",inProgress:"Deployment in progress"},deploymentFailed:"Deployment failed",deploymentDisconnected:"Deployment failed: connection interrupted",deploymentMissingAgentName:"Deployment failed: Agent name missing from response",deploymentMissingConnection:"Deployment failed: AgentKit connection information missing from response",cancelDeploymentFailed:"Failed to cancel deployment ({{status}})",loadFailed:"Failed to load ({{status}})",loadPermissionsFailed:"Failed to load permissions ({{status}})",invalidPermissionResponse:"The permission service returned an unreadable response",checkStudioUpdateFailed:"Failed to check for Studio updates ({{status}})",studioUpdatePreflightFailed:"Studio update permission check failed ({{status}})",submitStudioUpdateFailed:"Failed to submit the Studio update ({{status}})",loadAgentUsageFailed:"Failed to load Agent usage",notProvided:"Not provided",agentUsageNonJson:"Failed to load Agent usage: the server returned a non-JSON response (HTTP {{status}}, Content-Type: {{contentType}}). ",checkStudioGateway:"Confirm that the current service is running in Studio mode and check the proxy or gateway configuration.",agentUsageInvalidJson:"Failed to load Agent usage: the server returned invalid JSON (HTTP {{status}}, Content-Type: {{contentType}}). ",retryCheckGateway:"Try again later. If the problem persists, check the proxy or gateway configuration.",loadCronJobsFailed:"Failed to load scheduled tasks",loadCronJobFailed:"Failed to load scheduled task details",createCronJobFailed:"Failed to create the scheduled task",updateCronJobFailed:"Failed to update the scheduled task",enableCronJobFailed:"Failed to enable the scheduled task",pauseCronJobFailed:"Failed to pause the scheduled task",runCronJobFailed:"Failed to run the scheduled task now",loadCronHistoryFailed:"Failed to load execution history",stopCronRunFailed:"Failed to stop the execution",deleteCronJobFailed:"Failed to delete the scheduled task",loadRuntimeFailed:"Failed to load the Runtime",loadLocalToolsFailed:"Failed to load local tools",connectDynamicRouteFailed:"Failed to connect the Studio dynamic route",a2aProbeDenied:"The Runtime rejected the A2A probe. Check the Runtime authentication configuration.",loadA2aCardFailed:"Failed to load the A2A Agent Card",loadRuntimeApiKeyFailed:"Failed to load the Runtime API key",runtimeApiKeyMissing:"The Runtime did not return a usable API key",deleteFailed:"Delete failed ({{status}})",runtimeManageForbidden:"This account cannot manage the Runtime.",runtimeNotFound:"The Runtime does not exist or has been deleted.",runtimeUnavailable:"This account cannot access the Runtime.",checkRuntimeUpdateFailed:"Failed to check Runtime update capability (HTTP {{status}}). Try again later.",loadRuntimeDetailFailed:"Failed to load Runtime details",generateProjectFailed:"Failed to generate the project",generateAgentConfigFailed:"Failed to generate the Agent configuration",createDebugRunFailed:"Failed to create the debug run",createDebugSessionFailed:"Failed to create the debug session",loadDebugTraceFailed:"Failed to load the debug trace",invalidDebugTrace:"Failed to load the debug trace: invalid response format",debugRunFailed:"Debug run failed",cleanupDebugRunFailed:"Failed to clean up the debug run"},kNe={loadFailed:"Failed to load conversation mode capabilities (HTTP {{status}})",invalidResponse:"The conversation mode capabilities response has an invalid format"},ENe={nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, {{contentType}}){{detail}}"},_Ne={common:oNe,agentkitCli:lNe,cloudRegion:cNe,connections:uNe,feishuBot:hNe,requestError:dNe,runSse:fNe,runtimeLogs:pNe,search:gNe,skills:mNe,sse:vNe,identity:yNe,github:bNe,video:xNe,websiteIntegration:wNe,knowledge:ANe,intelligentDevelopment:SNe,migrations:TNe,sandbox:CNe,client:ONe,newChatCapabilities:kNe,jsonResponse:ENe},$tr=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:lNe,client:ONe,cloudRegion:cNe,common:oNe,connections:uNe,default:_Ne,feishuBot:hNe,github:bNe,identity:yNe,intelligentDevelopment:SNe,jsonResponse:ENe,knowledge:ANe,migrations:TNe,newChatCapabilities:kNe,requestError:dNe,runSse:fNe,runtimeLogs:pNe,sandbox:CNe,search:gNe,skills:mNe,sse:vNe,video:xNe,websiteIntegration:wNe},Symbol.toStringTag,{value:"Module"})),RNe={backToEvaluationCase:"Back to evaluation case",cancel:"Cancel",copied:"Copied",copy:"Copy",exportConversation:"Export conversation",retry:"Retry"},DNe={title:"How would you like to add an Agent?",subtitle:"Choose the approach that best fits your project.",quickCreate:{title:"Create from scratch",description:"Build an Agent with intelligent, custom, template, or workflow modes."},intelligent:{title:"Intelligent mode",description:"Describe your goal, then build, debug, and validate the Agent interactively."},package:{title:"Add and deploy a code package",description:"Upload an Agent project archive, review the code, and deploy it to AgentKit Runtime."},migrate:{title:"Migrate an existing project",description:"Migrate an existing LangChain, Dify, or similar project to AgentKit Runtime."}},LNe={subject:{file:"file changes",command:"command execution"},decision:{accept:"Allowed {{subject}} once",acceptForSession:"Allowed {{subject}} for this session",decline:"Declined {{subject}}",cancel:"Cancelled approval for {{subject}}"},details:{command:"Command",grantRoot:"Authorized path",cwd:"Working directory"}},MNe={noDescription:"No description",region:"Region",unknownAgent:"Unknown Agent"},INe={agentTransfer:"Agent handoff",annotationHint:"Model response; select text to add an annotation",continueBranch:"Continue with “{{branch}}”",emptyResponse:"This response has no displayable content.",subagentDescription:"Working on a task handed off by the primary Agent."},PNe={title:"Configure {{provider}} credentials",prefix:"Agent Workspace requires {{provider}} credentials. Set",and:"and",suffix:"in the runtime environment, then retry."},NNe={buildRunning:{title:"A build is still running",description:"Leaving will stop this build. The session will remain available in your history.",confirm:"Stop and leave"},deleteThread:{title:"Delete Codex session",description:"Delete “{{name}}” and remove it from your session history?",confirm:"Delete"},returnToCreate:{title:"Return to the create page?",description:"Your current entries will be lost.",confirm:"Return"}},BNe={additionalAgentDeleteFailures:"; {{count}} more failed",agentDeleteFailures:"Failed to delete {{count}} Agents: {{failures}}{{suffix}}",agentToolsMissing:"This Agent is missing required tools: {{tools}}",buildStopUnconfirmed:"You left the development environment, but Studio could not confirm that the build stopped. It may still be running; check its status in session history later.",builtinAgentSendFailed:"Failed to send to the built-in Agent: {{message}}",bytePlusEvaluationUnsupported:"AgentKit evaluation sets are not currently supported on BytePlus",clipboardUnsupported:"This browser does not support writing to the clipboard.",cloudCodexEmptyReply:"The cloud Codex task ended without a response. Send the task again.",cloudCodexSessionMissing:"The cloud Codex session has not appeared in the list yet. Try again shortly.",deploymentRuntimeIdMissing:"Deployment completed without returning a Runtime ID.",environmentExpired:"The selected environment is no longer available. Refresh and select it again.",environmentsLoadFailed:"Failed to load environments",evaluationCaseSessionMissing:"This evaluation case has no session reference and cannot be opened.",evaluationUnsupportedForReply:"This response cannot be added to an evaluation set",firstFrameRequired:"Add a first-frame image before generating from first and last frames.",incompletePromptOptimization:"The prompt optimization result is incomplete. Run the optimization again.",intelligentCapabilityCheckFailed:"Failed to check intelligent development capabilities (HTTP {{status}})",intelligentSessionCreateFailed:"Failed to create the intelligent development session",invalidIntelligentCapability:"The intelligent development capability response is invalid.",localBffToolsNotConfigured:"No tools are configured for the local Studio BFF.",localToolsLoadFailed:"Failed to load local tools",loginPopupBlocked:"The browser blocked the sign-in window. Allow pop-ups and try again.",loginPopupClosed:"The sign-in window was closed. Sign in again to continue.",mediaTooLarge:"{{fileName}} exceeds this platform's media size limit.",mountEnvironmentFailed:"Failed to mount the environment",noConnectedSandbox:"No Sandbox is currently connected.",noCreateAgentPermission:"Your account does not have permission to add Agents.",noManageAgentPermission:"Your account does not have permission to manage Agents.",noOptimizationBaseline:"There is no pre-optimization version available for comparison.",oauthUrlMissing:"The event does not include an authorization URL.",onlyCloudAgentUpdatable:"Only deployed cloud Agents can be updated.",optimizationVersionMissing:"The project version for this optimization could not be found. It may have been deleted.",persistentStorageNotConfigured:"Persistent storage has not been configured by an administrator",readDraftFailed:"Unable to read local drafts. Try again.",runtimeAgentNameMissing:"The Runtime is missing an Agent name and cannot be updated.",runtimeBffToolsDisabled:"BFF tool capabilities are not enabled for this Runtime Agent.",runtimeDeploymentConfigUnavailable:"The Runtime's original deployment configuration cannot be restored, so it cannot be updated safely.",runtimeMissingForConnection:"Runtime information is missing, so the Agent cannot be connected.",runtimeRegionMissingForDelete:"The Runtime is missing region information and cannot be deleted.",runtimeRegionMissingForUpdate:"The Runtime is missing region information and cannot be updated.",runtimeUpdateUnsupported:"This Runtime does not support in-place updates.",sandboxRuntimeUnavailable:"This Agent does not have an available Sandbox Runtime.",sandboxToolsUnavailable:"The current Studio BFF does not provide Sandbox execution tools.",saveDraftLocationRejected:"The browser could not save the current draft location. Check site storage permissions and try again.",saveDraftRejected:"The browser could not save the draft. Try again.",selectSkillToOptimize:"Select a Skill to optimize first.",sessionMissingForMount:"The current session does not exist, so an environment cannot be mounted.",sessionNotReady:"The session is not ready yet.",sessionUnavailable:"The current session is unavailable. Close it and try again.",sourceNotReady:"The source is not ready yet. Return to the conversation to continue.",textVideoRejectsReferences:"Text-to-video does not use reference media. Remove the images or videos first.",videoEditRequiresVideo:"Add the video you want to edit first.",videoExtendRequiresVideo:"Add a source video before extending it.",videoGenerationFailed:"Video generation failed. Try again later.",videoModeUnsupported:"The selected video mode is not supported on this platform.",videoPreviewMissing:"The video task completed, but the server did not return a preview URL.",videoReferenceRequired:"Add at least one reference image or video."},$Ne={like:"Like",removeLike:"Remove like",dislike:"Dislike",removeDislike:"Remove dislike",reportIssue:"Report an issue",traceFlameGraph:"Tracing flame graph"},FNe={0:"What would you like to work on today?",1:"How can I help?",2:"What would you like me to look into?",3:"Ask me anything",4:"Hi, let's get started",5:"Start a new conversation",6:"What should we tackle first?",7:"Tell me what you have in mind",8:"Where should we begin?",9:"What can I help you with?",10:"Ready to move this forward?",11:"What's most important right now?",12:"Let's get something done today",13:"I'm ready when you are",intelligentDevelopment:"Give your ideas room to grow"},zNe={agentCapabilities:"Checking Agent capabilities…",session:"Loading session…"},UNe={cancelled:"Authorization was cancelled.",pasteCallbackUrl:"After authorization, paste the full callback URL from your browser's address bar:",popupBlocked:"The browser blocked the authorization window. Allow pop-ups and try again.",unsupportedUrl:"The authorization URL is not HTTP or HTTPS and was blocked."},VNe={volcengine:"Volcengine"},QNe={checkingPersistence:"Checking persistent storage…",exitDevelopment:"Exit development",fileUploaded:"Uploaded a file to the Sandbox",filesUploaded:"Uploaded {{count}} files to the Sandbox",intelligentDevelopment:"Intelligent development",mode:{readOnly:"Read only",workspaceWrite:"Workspace write",fullAccess:"Full access"},approvalPolicy:{untrusted:"Untrusted commands only",onRequest:"Ask when needed",never:"Never ask"},reviewer:{user:"Ask me",autoReview:"Automatic review"},labels:{approvalPolicy:"Approval policy",file:"File",fileNumber:"File {{number}}",mode:"Sandbox mode",networkAccess:"Network access",reviewer:"Approval method",workingDirectory:"Working directory"},network:{allowed:"Allowed",disabled:"Off"},permissionsUpdated:"Updated Codex permissions for this Sandbox session",persistenceUnknown:"Unable to verify persistent storage",stoppedReady:"Stopped. You can continue typing.",uploadedFilesPrompt:"The following files were uploaded to the current Sandbox workspace. Use them in this task:",workspaceUpdated:"Workspace updated"},GNe={addAgent:"Add Agent",addFromPackage:"Add from code package",agent:"Agent",automations:"Automations",createAgent:"Create Agent",createSkill:"Create Skill",cronJobs:"Cronjob",issueFeedback:"Issue feedback",library:"Library",migrateAgent:"Migrate Agent",newConversation:"New conversation",optimizeSkill:"Optimize {{name}}",search:"Search",skill:"Skill",skillLibrary:"Skill library",systemInfo:"System information",updateAgent:"Update {{name}}"},HNe={actions:RNe,addAgent:DNe,approval:LNe,common:MNe,conversation:INe,credentials:PNe,dialogs:NNe,errors:BNe,feedback:$Ne,greetings:FNe,loading:zNe,oauth:UNe,providers:VNe,sandbox:QNe,titles:GNe},Ftr=Object.freeze(Object.defineProperty({__proto__:null,actions:RNe,addAgent:DNe,approval:LNe,common:MNe,conversation:INe,credentials:PNe,default:HNe,dialogs:NNe,errors:BNe,feedback:$Ne,greetings:FNe,loading:zNe,oauth:UNe,providers:VNe,sandbox:QNe,titles:GNe},Symbol.toStringTag,{value:"Module"})),WNe="Automations",YNe="Connect development tools and extend your Agents with automated workflows",qNe="Search automations",jNe="Automation categories",XNe={development:"Development",channels:"Messaging channels"},KNe="{{category}} automations",ZNe="Open {{name}}",JNe="Available only in local deployments",e8e="No matching automations",t8e="Try searching for another name",r8e="Back to automations",n8e={"coding-agents":{name:"Configure coding agents",badge:"Local",description:"Install built-in VeADK and AgentKit skills globally for Trae, Claude Code, or Codex."},template:{name:"Import starter project",description:"Create a minimal Agent project in your repository with continuous delivery to AgentKit Runtime.",title:"Import starter project",subtitle:"Add a ready-to-run basic Agent and continuous delivery configuration to your repository",panel:"This creates a pull request containing the basic project and AgentKit Runtime delivery workflow.",submitLabel:"Import template and create PR",regionHelp:"Must match the target Runtime region",pullRequest:{title:"feat: import AgentKit basic template",description:"Import a basic Agent project with the AgentKit Studio App Server and add continuous delivery to AgentKit Runtime. Configure the required {{provider}} secrets before merging."},fields:{repository:{label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL"},baseBranch:{label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base"},projectPath:{label:"Agent project directory",placeholder:"agentkit-basic-agent",help:"The basic project will be added here; app.py mounts the complete Studio App Server and serves as the entry point"},runtimeName:{label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration"},runtimeId:{label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates"}}},delivery:{name:"AgentKit Runtime delivery",description:"Add a workflow that continuously delivers your repository to AgentKit Runtime.",title:"AgentKit Runtime delivery",subtitle:"Add continuous delivery to the repository through a pull request",panel:"This creates a release branch and opens a pull request containing the GitHub Actions workflow.",submitLabel:"Confirm and create PR",regionHelp:"Must match the target Runtime region",pullRequest:{title:"feat: continuously publish to AgentKit Runtime",description:"Add a GitHub Actions workflow that continuously publishes updates from the target branch to AgentKit Runtime. Configure the required {{provider}} secrets before merging."},fields:{repository:{label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL"},baseBranch:{label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base"},projectPath:{label:"Agent project directory",placeholder:".",help:"Defaults to the repository root; the directory must contain an app.py that mounts the complete Studio App Server"},runtimeName:{label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration"},runtimeId:{label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates"}}},review:{name:"Automated PR review",description:"Use a GitHub App to review pull requests in an isolated Sandbox.",title:"Automated PR review",subtitle:"Trigger Sandbox reviews through the GitHub App and publish results to pull requests",panel:"Install the GitHub App to target repositories, then enable automated review for each repository.",submitLabel:"Install GitHub App",regionHelp:"",pullRequest:{title:"chore: configure automated PR review",description:"Add a GitHub Actions workflow that reviews same-repository pull requests in an isolated Sandbox and publishes the result as a GitHub review. Configure the required workflow secrets before merging."},fields:{repository:{label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL"},baseBranch:{label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base"},sandboxToolId:{label:"Sandbox Tool ID",placeholder:"tool-xxxxxxxx",help:"The AgentKit CodeEnv used for each review"},modelName:{label:"Review model",placeholder:"review-model",help:"The code review model name injected into the Sandbox"},modelBaseUrl:{label:"Model API URL",placeholder:"https://ark.example.com/api/v3",help:"Must be an OpenAI-compatible HTTPS endpoint"}}},feishu:{name:"Feishu bot",badge:"Beta",description:"Create a Feishu bot and connect its messages directly to AgentKit Runtime."},"website-integration":{name:"Website integration",description:"Embed an AgentKit Runtime on your website as a floating chat window."}},i8e={required:"Required",optional:"Optional",region:"Region",tokenLabel:"GitHub Token",getToken:"Get token",createToken:"Create GitHub token",tokenPlaceholder:"Requires write access to repository contents and pull requests",tokenWorkflowPlaceholder:"Requires write access to contents, pull requests, and workflows",hideToken:"Hide token",showToken:"Show token",tokenHelp:"The token is used only for this submission. It is not stored in the browser or written to the pull request.",tokenWorkflowHelp:"This token is used only to create the configuration PR. It is not a general Sandbox requirement and is not stored in the browser or written to the PR.",prCreated:"PR #{{number}} created",configPrCreated:"Configuration PR #{{number}} created",configPrNextStep:"After it is merged, later pull requests in the same repository will trigger reviews automatically.",viewOnGitHub:"View on GitHub",viewConfigPr:"View configuration PR",secretsHeading:"Before merging the pull request, configure these GitHub Actions secrets in the repository:",secretsConfigHeading:"Before merging the configuration PR, add runtime secrets to the target repository",openSecrets:"Open Secrets settings",secretsPath:"Path: Settings → Secrets and variables → Actions → Repository secrets",repositoryConfigHelp:"A PR review configuration will be added for {{repository}}",repositoryReviewHelp:"GitHub App will validate pull requests for {{repository}}",secretPair:"{{accessKey}}, {{secretKey}} (required)",sessionToken:"{{sessionToken}} (required when using temporary credentials)",requiredSecret:"{{name}} (required)",temporaryCredentialRequired:" (required when using temporary credentials)",requiredSuffix:" (required)",submitting:"Creating PR…",validation:{required:"This field is required",repository:"Enter owner/repository or a full GitHub repository URL",baseBranch:"The target branch format is invalid",projectPath:"Enter a relative path within the repository",runtimeId:"The Runtime ID format is invalid",sandboxToolId:"The Sandbox Tool ID format is invalid",modelName:"The model name format is invalid",modelBaseUrlSafe:"Enter an HTTPS URL without credentials, query parameters, or fragments",modelBaseUrl:"Enter a valid HTTPS URL",runtimeName:{required:"Runtime name is required",characters:"Runtime name can contain only letters, numbers, underscores, and hyphens",length:"Runtime name must be 4–64 characters"}}},a8e={title:"Configure coding agents",description:"Install the AgentKit skills bundled with Studio globally for local coding clients.",retry:"Retry",clients:{ariaLabel:"Select coding agents",title:"Local clients",detectAgain:"Detect again",detecting:"Detecting local clients…",detected:"Client detected",available:"Available",unavailable:"Not detected"},skills:{ariaLabel:"Select bundled skills",title:"Bundled skills",viewFiles:"View files",items:{"veadk-agent-development":{name:"VeADK Agent development",description:"Build and refine Agents with VeADK."},"agentkit-cli":{name:"AgentKit CLI",description:"Manage and deploy AgentKit resources with AgentKit CLI."}}},global:{ariaLabel:"Global installation directories",title:"Global installation",description:"Available to other local projects after configuration",empty:"Select a client to see its installation directory."},success:"Configured {{skillCount}} skill(s) for {{agentCount}} client(s)",selection:"{{agentCount}} client(s) and {{skillCount}} skill(s) selected",selectClient:"Select a client first",configuring:"Configuring…",configure:"Configure",errors:{detect:"Failed to detect local clients",configure:"Configuration failed. Check permissions for your user directory and try again."},preview:{description:"Browse the skill files bundled with Studio in read-only mode",close:"Close file preview",loading:"Loading files…",error:"Failed to load skill files",skillFiles:"{{name}} files",files:"Files",fileContent:"File contents",notPreviewable:"This file is not previewable UTF-8 text.",noFiles:"No previewable files."}},s8e={title:"Feishu bot",description:"Create a Feishu Agent powered by AgentKit Runtime",panel:"Enter the credentials for a published Feishu app. Studio will generate a basic Agent, create a dedicated Runtime, and enable the persistent Feishu messaging connection.",agentName:"Agent name",agentNameHelp:"Used as the root Agent name in the new Runtime",region:"Deployment region",regionHelp:"The Runtime and build artifacts will be created in this region",regions:{"cn-beijing":"Beijing","cn-shanghai":"Shanghai"},appId:"Feishu App ID",appIdHelp:"Application credential from the Feishu Open Platform",appSecret:"Feishu App Secret",appSecretPlaceholder:"Enter the App Secret",appSecretHelp:"Written only to the environment variables of the new Runtime",hideSecret:"Hide App Secret",showSecret:"Show App Secret",hide:"Hide",show:"Show",confirmCancel:"Cancelling will stop the task and clean up any Runtime already created. Continue?",status:{preparing:"Generating the basic Agent",running:"Creating Runtime",cancelling:"Cancelling deployment",succeeded:"Feishu bot Runtime created",cancelled:"Deployment cancelled",failed:"Creation failed"},steps:{prepare:"Generate Agent",build:"Build image",deploy:"Create Runtime",publish:"Publish service"},openConsole:"Open Runtime console",credentials:{title:"Credential handling",description:"The App Secret is used only for this deployment. It is never written to generated source code or browser storage."},cancelDeployment:"Cancel deployment",creating:"Creating…",create:"Create Feishu bot Runtime",validation:{appId:"Enter the Feishu App ID",appSecret:"Enter the Feishu App Secret",agentName:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name",characters:"Name must start with a letter or underscore and contain only letters, numbers, and underscores"}},generatedAgent:{description:"A helpful assistant that receives messages through Feishu.",instruction:"You are a helpful assistant serving users through Feishu. Understand each request accurately and provide concise, reliable answers. Ask clarifying questions when information is missing, and never invent facts."}},ztr=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:r8e,cards:n8e,categories:XNe,categoriesLabel:jNe,codingAgents:a8e,default:{title:WNe,description:YNe,search:qNe,categoriesLabel:jNe,categories:XNe,resultsLabel:KNe,open:ZNe,localOnly:JNe,emptyTitle:e8e,emptyDescription:t8e,backToAutomations:r8e,cards:n8e,github:i8e,codingAgents:a8e,feishu:s8e},description:YNe,emptyDescription:t8e,emptyTitle:e8e,feishu:s8e,github:i8e,localOnly:JNe,open:ZNe,resultsLabel:KNe,search:qNe,title:WNe},Symbol.toStringTag,{value:"Module"})),o8e={"zh-CN":"简体中文","en-US":"English"},Utr=Object.freeze(Object.defineProperty({__proto__:null,default:{languageNames:o8e},languageNames:o8e},Symbol.toStringTag,{value:"Module"})),l8e={selectedExcerptLabel:"Selected excerpt",commentLabel:"Annotation",commentSeparator:": ",successTitle:"Added to the Bad Case evaluation set",successDescription:"This annotation is linked to the current question and the complete model response.",done:"Done",ariaLabel:"Annotate the selected model response",title:"Add annotation",content:"Annotation",placeholder:"Describe the issue or the expected change",retryError:"{{error}}. Please try again.",cancel:"Cancel",submit:"Add to Bad Case"},c8e={attachment:"attachment",image:"image",preview:"Preview {{name}}",uploading:"Uploading",uploadFailed:"Upload failed",remove:"Remove {{name}}",previewDialog:"{{name}} preview",download:"Download",close:"Close",reading:"Loading document…",loadFailed:"Failed to load document: {{error}}"},u8e={errorTitle:"Cloud log error",copyError:"Copy complete error details",retry:"Retry",statuses:{live:"Live",connecting:"Connecting",retrying:"Reconnecting",idle:"Disconnected"},title:"Instance logs",description:"The VeFaaS instance handling the current conversation request",close:"Close instance logs",instanceId:"Instance ID",waitingInstance:"Waiting for instance",request:"Request {{id}}",ariaLabel:"Live VeFaaS instance logs",notCapturedTitle:"No instance captured yet",notCapturedDescription:"Send a message to see the instance that handles it and its live logs.",connectingTitle:"Connecting to instance logs",connectingDescription:"Establishing a secure log stream through the Studio BFF.",emptyTitle:"No logs yet",emptyDescription:"Connected to the instance and waiting for new log output.",retention:"Logs refresh automatically. Only the latest {{count}} lines are kept."},h8e={title:"Trace",statuses:{loading:"Loading",ready:"",collecting:"Collecting",disabled:"Disabled",forbidden:"Permission required",error:"Failed to load"},errors:{collecting:"The trace is still being collected. Please wait.",disabled:"Tracing is not enabled for this agent. Enable it in the console and try again.",forbidden:"Your account cannot read APMPlus traces. Ask an administrator for read access.",error:"Failed to load the trace. Please try again later."},callCount:"{{count}} calls · {{duration}} ms",close:"Close",loading:"Loading trace…",retryNow:"Retry now",reload:"Reload",empty:"No trace is available for this session yet.",attributes:"Attributes",selectCall:"Select a call on the left to view its details"},d8e={exportNote:"This conversation was exported from AgentKit Studio for reference only.",imageFailed:"Failed to generate the image. Please try again.",browserUnsupported:"This browser cannot generate a conversation image. Please try again.",copyUnsupported:"This browser cannot copy images. Download the image instead.",exportFailed:"Export failed. Please try again.",title:"Export conversation",description:"Choose a format and download all inputs and outputs through the current response.",close:"Close",generatingContent:"Preparing export…",retry:"Try again",previewPage:"Previewing page 1 of {{count}}",previewAlt:"Conversation export page 1 of {{count}}",format:"Export format",generatingFormat:"Generating {{format}}…",copying:"Copying…",copiedFirst:"First page copied",copied:"Copied",copyFirst:"Copy first page",copyImage:"Copy image",generating:"Generating…",downloadArchive:"Download PNG archive ({{count}} pages)",downloadFormat:"Download {{format}}"},f8e={unsupportedComponent:"Unsupported component: {{component}}",sandboxIdentity:"Codex Sandbox execution identifiers",useSkill:"Use the {{name}} skill",thinkingDone:"Finished thinking",thinking:"Thinking",justNow:"Just now",sourceUnavailable:"The generated source is temporarily unavailable. Please try again later.",downloadStarted:"Download started",verifiedDelivery:"Verified deliverable",generatedSource:"Generated agent source",entryPoint:"Entry point",fileCount:"Files",size:"Size",validationTime:"Validated",generationTime:"Generated",checksPassed:"{{count}} checks passed",sourceReady:"Source is ready to deploy",sourceGuidance:"The source is ready to view, download, or deploy. Confirm the runtime configuration before deployment.",viewSource:"View source",preparing:"Preparing…",viewChanges:"View changes",downloadSource:"Download source",sourceNotReady:"The source is not ready yet",manualDeploy:"Deploy manually to Runtime",beforeOptimization:"Before optimization",afterOptimization:"After optimization",planStatuses:{pending:"Pending",in_progress:"In progress",completed:"Completed",failed:"Incomplete"},renderUi:"Render UI",truncated:"… (truncated)",agentAdjusting:"Agent is adjusting",sandboxDetails:"Detailed Codex Sandbox output",waitingCodex:"Waiting for Codex output",arguments:"Arguments",result:"Result",artifacts:"Artifacts",downloadNamed:"Download {{name}}",powerpoint:"PowerPoint presentation",preview:"Preview",download:"Download",previewDialog:"{{name}} preview",closePreview:"Close preview",slidePreview:"{{name}} slide preview",mcpToolset:"MCP toolset",authorized:"Authorized · {{tool}}",authorizationRequired:"{{tool}} requires authorization",oauthDescription:"The {{tool}} toolset is protected by OAuth and requires sign-in before use.",oauthProvider:"You will be redirected to {{provider}} to sign in.",oauthContinue:"The conversation will continue automatically after authorization.",waitingAuthorization:"Waiting for authorization…",authorize:"Authorize",missingAuthorizationUrl:"No authorization URL was found in the event.",tools:{web_search:{running:"Searching the web",done:"Web search complete"},link_reader:{running:"Reading webpage",done:"Webpage read complete"},run_code:{running:"Running code in the AgentKit sandbox",done:"Code execution completed in the AgentKit sandbox"},list_envs:{running:"Checking available environments",done:"Available environments loaded"},get_env_manifest:{running:"Loading the environment manifest",done:"Environment manifest loaded"},execute_in_sandbox:{running:"Running a command in the environment",done:"Command completed in the environment"},delegate_to_codex_sandbox:{running:"Codex Sandbox is running",done:"Codex Sandbox completed",failed:"Codex Sandbox failed"},image_generate:{running:"Generating image",done:"Image generated"},video_generate:{running:"Generating video",done:"Video generated"},ppt_generate:{running:"Generating presentation",done:"Presentation generated"},load_memory:{running:"Searching long-term memory",done:"Memory search complete"},load_knowledgebase:{running:"Searching the knowledge base",done:"Knowledge base search complete"},load_skill:{running:"Loading skill",done:"Skill loaded"},collect_resources:{running:"Collecting available resources",done:"Resource collection complete",failed:"Resource collection failed"},create_agents:{running:"Creating and running agents",done:"Agent creation complete",failed:"Agent creation failed"}},createAgents:{categories:{skill_hub:"Skill Hub",skill_space:"AgentKit Skill Center",knowledge_base:"Knowledge base",tool:"Tools"},agentTypes:{llm:"LLM Agent",sequential:"Sequential Agent",parallel:"Parallel Agent",loop:"Loop Agent",workflow:"Workflow"},skill:"Skill",subAgents:"Sub-agents",builtinTool:"Built-in tool",skillCenter:"AgentKit Skill Center",selfAuthoredTools:"Custom tools",dependencies:"Dependencies: {{items}}",fullCode:"Complete code for {{name}}",itemCount:"{{label}}: {{count}} items",collectionAria:"Retrieved resource information",retrieving:"Retrieving resources",retrievalFailed:"Resource retrieval did not complete",checkConfig:"Check the resource service configuration and try again.",notSearched:"Not searched",notConfigured:"Not configured",resourceList:"{{label}} resource list",searchKeywords:"Search keywords",skillHubSkipped:"No search keywords were provided, so Skill Hub was not searched.",sourceSkipped:"{{label}} is not configured, so this source was not searched.",noResources:"No resources in this category were returned.",resultAria:"Agent creation results",creationFailed:"Agent creation did not complete",agentResources:"Resources available to {{name}}",knowledgeBase:"Knowledge base",toolsLabel:"Tools",creating:"Creating agents",noAgents:"No agents to display",noAgentResult:"The tool response did not include an agent configuration or execution result.",sourceLabels:{tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknown:"Unknown source"},unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"},branchCompare:{ariaLabel:"Compare branches",selectDirection:"Select a direction",continue:"Continue in this direction"},codexProgress:{planTitle:"Codex execution plan",fallback:{fileChange:"Modify files",approval:"Waiting for approval",status:"Codex status",command:"Run command"},planSummary:"{{completed}}/{{total}} completed",command:{running:"Running command",completed:"Command completed",failed:"Command failed"},projectFiles:"{{count}} project files",projectFile:"project files",fileChange:{running:"Updating {{subject}}",completed:"Updated {{subject}}",failed:"Failed to update {{subject}}"},externalTool:"external tool",mcp:{running:"Calling {{tool}}",completed:"Called {{tool}}",failed:"{{tool}} call did not complete"},collaboration:{spawn_agent:{running:"Starting subtask",completed:"Subtask started",failed:"Failed to start subtask"},send_input:{running:"Sending information to subtask",completed:"Information sent to subtask",failed:"Failed to send information to subtask"},wait:{running:"Waiting for subtask",completed:"Subtask wait complete",failed:"Subtask wait failed"},close_agent:{running:"Ending subtask",completed:"Subtask ended",failed:"Failed to end subtask"},default:{running:"Coordinating subtasks",completed:"Subtask collaboration complete",failed:"Subtask collaboration failed"}},webSearch:{running:"Searching the web",completed:"Web search complete",failed:"Web search did not complete"},errorDetail:"Codex execution did not complete.",errorTitle:"Codex encountered an error"}},p8e={segments:{system:"System and tools",input:"Input and history",output:"Output and reasoning",remaining:"Remaining"},modelUnavailable:"Model information unavailable",promptWithSystem:"Prompt (including system)",systemUnknown:"System and tool usage unknown",systemApprox:"System and tools approximately {{count}} tokens",ariaKnown:"Context {{percentage}}% used, {{system}}, {{inputLabel}} {{input}} tokens, output and reasoning {{output}} tokens, remaining {{remaining}} tokens",ariaUnknown:"{{model}}, context window unknown, {{count}} cumulative session tokens used",composition:"Context composition",percentageUsed:"{{percentage}}% used",gridAria:"100-cell context composition chart. Each cell represents one percent of the context window.",estimated:"Estimated",unknown:"Unknown",summaryPercentage:"{{used}} used, {{remaining}} remaining",summaryTokens:"{{used}} used, {{remaining}} remaining, {{total}} total",overflow:"Context exceeded by {{count}} tokens",title:"Context usage",unknownModel:"The context window for this model is not available",unknownRuntime:"The current runtime did not provide model information"},g8e={title:"Add AgentKit agent",noAgents:"Connected successfully, but no agents were found at this address (/list-apps was empty).",connectionFailed:"Connection failed: {{error}}. Check the URL, API key, and whether the gateway allows cross-origin requests.",description:"Enter the URL and API key of an AgentKit deployment to connect through the ADK protocol. Connected agents will appear in the selector in the upper-left corner.",url:"Endpoint URL",apiKeyHint:"Connect using Authorization: Bearer",displayName:"Display name (optional)",displayNameHint:"Uses the URL hostname by default",cancel:"Cancel",connecting:"Connecting…",connect:"Connect and add"},m8e={placeholder:"Type a message…",inputAria:"Message",generating:"Generating",send:"Send"},v8e={ariaLabel:"Invocation context for this turn",removeSkill:"Remove skill {{name}}",removeAgent:"Remove agent {{name}}"},y8e={cardAria:"{{label}} chart",viewAria:"{{label}} display mode",preview:"Preview",code:"Code",invalidEcharts:"The ECharts configuration is not a valid, safe data object. Switch to Code to inspect it.",renderFailed:"The chart cannot be rendered right now. Switch to Code to inspect it.",echartsAria:"ECharts preview",rendering:"Rendering chart…",mermaidFailed:"The chart cannot be rendered right now. Switch to Code to inspect the Mermaid source.",mermaidAria:"Mermaid preview"},b8e={playVideo:"Play video: {{name}}",enlargeImage:"Enlarge image preview: {{name}}",image:"image",enlargeVideo:"Enlarge video",videoPreview:"Video preview",downloadVideo:"Download video",close:"Close"},x8e={annotation:l8e,media:c8e,runtimeLogs:u8e,trace:h8e,share:d8e,blocks:f8e,tokenUsage:p8e,addAgentKit:g8e,composer:m8e,invocation:v8e,visualization:y8e,markdown:b8e},Vtr=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:g8e,annotation:l8e,blocks:f8e,composer:m8e,default:x8e,invocation:v8e,markdown:b8e,media:c8e,runtimeLogs:u8e,share:d8e,tokenUsage:p8e,trace:h8e,visualization:y8e},Symbol.toStringTag,{value:"Module"})),w8e={back:"Back",cancel:"Cancel",deploy:"Deploy",delete:"Delete",loading:"Loading…",next:"Next",notSupported:"Not supported",previous:"Previous",required:"Required",retry:"Retry",actions:"Actions",value:"Value",disabled:"Off",enabled:"Enabled",none:"None",close:"Close",name:"Name",description:"Description",send:"Send"},A8e={heading:"VeADK agent structure configuration",importHint:"Reload this file from Import YAML on the Create Agent page."},S8e={agentName:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name.",characters:"Start with a letter or underscore and use only letters, numbers, and underscores"},runtimeName:{required:"Runtime name is required",characters:"Runtime name can contain only letters, numbers, underscores, and hyphens",length:"Runtime name must be 4–64 characters"}},T8e={description:"A VeADK-powered assistant that understands user intent and uses the right tools to complete tasks.",instruction:`You are a professional and reliable assistant. Your goal is to understand the user's request accurately and provide clear, concise, and useful answers. Guidelines: - Ask clarifying questions when information is missing. Do not invent facts. - Use available tools when appropriate and explain key conclusions. -- Maintain a polite, professional tone.`},C8e={requestFailed:"Request failed ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"The server does not have cloud provider credentials configured, so AgentKit agent centers are unavailable",loginRequired:"Sign in to access AgentKit agent centers"},vikingKnowledge:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB knowledge bases are unavailable",loginRequired:"Sign in to access VikingDB knowledge bases"},vikingMemory:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB memory stores are unavailable",loginRequired:"Sign in to access VikingDB memory stores"},mcpGateway:{missingHttpTool:"Go back to Add MCP tool and add at least one HTTP MCP service. MCP resilience does not support stdio services.",missingUrl:"An HTTP MCP tool is missing a valid service URL. Go back to Add MCP tool and complete it before publishing."},customModel:{fallbackName:"Custom model",apiKeyLabel:"{{name}} model API Key"},deploymentEnv:{serverInjected:"Provided by the server",selectedApiKeyPlaceholder:"Provided by the selected API Key",mcpInjectedComment:"Provided by the added MCP tools",restoredPlaceholder:"Securely restored by the Studio server",generatedMcpPlaceholder:"Generated from the added HTTP MCP tools",restoredHelp:"When updating, the Studio server merges MCP addresses and authentication without returning existing secrets to the browser.",mergedMcpHelp:"The Studio server merges MCP addresses and optional authentication without returning existing secrets to the browser.",listSeparator:", ",requirementHint:"Required by the following optimizations: {{labels}}.",requiredBy:"Required by the following optimizations: {{labels}}. Enter {{key}}.",required:"Enter {{label}} ({{key}}).",invalidJson:"Invalid JSON format"},drafts:{unsupportedVersion:"This local draft version is not supported. Upgrade Studio and try again.",invalidFormat:"The local draft data is invalid.",readFailed:"Could not read local drafts. The browser data may be corrupted.",quotaExceeded:"Browser storage is full, so the draft was not saved. Delete unused drafts or clear this site's storage, then try again.",writeRejected:"The browser blocked saving this draft. Check the site's storage permissions and try again."},skills:{searchFailed:"Search failed ({{status}})",downloadFailed:"Skill download failed ({{status}})",agentKitRequestFailed:"AgentKit Skills request failed",missingManifest:"{{location}} is missing SKILL.md",invalidParentPath:"{{location}} contains an invalid parent path (..): {{path}}",invalidPath:"{{location}} contains an invalid path: {{path}}",localDescription:"Local skill",folderSource:"Folder",noManifest:"No SKILL.md was found in {{location}}"},zip:{invalid:"Invalid zip: EOCD was not found",tooManyFiles:"A zip file cannot contain more than {{count}} files",tooLarge:"The extracted zip content is too large"}},O8e={back:"Back to development session",runtimeName:"Runtime name",runtimeNameExists:"This Runtime name already exists. Choose another name.",checkingRuntimeName:"Checking Runtime name",verifiedSource:"Verified source",deployableSource:"Deployable source",verifiedByCodex:"Verified by Codex in the cloud",entryPoint:"Entry point",files:"Files",artifact:"Artifact",validationReport:"Validation report",verifiedHint:"The server materializes source from the verified artifact. Browser files cannot replace it.",unverifiedHint:"The server securely materialized the source. Confirm the Runtime configuration before deploying.",env:{requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}"}},k8e={name:"Code package",back:"Back to creation methods",reading:"Reading the code package",readingEllipsis:"Reading the code package…",uploadFirst:"Upload a code package first",uploadAriaLabel:"Code package upload",upload:"Upload code package",reupload:"Upload a different code package",uploadPrompt:"Upload a code package",filesRecognized:"{{count}} files found. Select this area to upload a different package.",dropHint:"Select or drop a .zip file up to 50 MB. Use app.py or declare an entry point in agentkit.yaml.",viewFiles:"View files",chooseFile:"Choose code package",errors:{invalidFormat:"Choose a .zip code package.",tooLarge:"The code package must be 50 MB or smaller.",invalidPath:"The archive contains an invalid path: {{name}}",empty:"The archive does not contain any deployable files.",tooManyFiles:"A code package cannot contain more than {{count}} files.",duplicateFile:"The code package contains a duplicate file: {{path}}",manifestParse:"Could not parse agentkit.yaml: {{detail}}",manifestRoot:"The root of agentkit.yaml must be an object.",manifestCommon:"common in agentkit.yaml must be an object.",entryPointType:"common.entry_point in agentkit.yaml must be a file path.",entryPointInvalid:"common.entry_point in agentkit.yaml is not a valid file path.",entryPointMissing:"The entry point declared in agentkit.yaml is missing from the code package: {{entryPoint}}",defaultEntryPointMissing:"The code package root must contain app.py, or common.entry_point in agentkit.yaml must declare an existing entry point."}},E8e={label:"Agent execution canvas",readOnlyLabel:"Read-only agent execution canvas",minimapLabel:"Execution flow minimap",controls:{ariaLabel:"Execution flow controls",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Fit view"},rootAgent:"Main agent",unnamedStep:"Unnamed step",terminals:{input:"User request",output:"Final response"},edges:{then:"Then",continueLoop:"Continue loop",call:"Call"},patterns:{llm:{label:"Agent",description:"Understand a task and complete one specific job"},sequential:{label:"Sequential",description:"Run internal steps one after another"},parallel:{label:"Parallel",description:"Run internal steps together, then combine their results"},loop:{label:"Loop",description:"Repeat internal steps until the stop condition is met"},a2a:{label:"Remote agent",description:"Call an existing remote agent"}},actions:{insertHere:"Insert a step here",deleteNamed:"Delete {{name}}",deleteNode:"Delete node",addSubagent:"Add subagent",addParallelStep:"Add a parallel step",addLoopStep:"Add a loop step",addNextStep:"Add next step",addFirst:"Add at the beginning",addLast:"Add at the end"}},_8e={title:"Intelligent mode",subtitle:"Describe your goal and Codex will plan, build, debug, and temporarily validate the agent in a sandbox.",model:{label:"Model",placeholder:"Select a model",retiring:"Retiring soon",currentConfiguration:"Current configuration",loadError:"Failed to load models"},availability:{checking:"Checking intelligent development availability…",unavailable:"Intelligent mode is currently unavailable. Go back and try again."},goal:{title:"Start with a goal",continueTitle:"Continue improving the project",hint:"Describe the problem your agent should solve. We will ask about any details that could affect the result.",continueHint:"Describe what you want to change. The result will be saved as a new version.",basedOn:"Based on",clearSelection:"Clear selection",label:"Goal",optimizationLabel:"Optimization goal",placeholder:"For example: Build an agent that reads sales data, creates weekly reports, and validates the output format",optimizationPlaceholder:"For example: Cite data sources and ask the user when information is incomplete"},actions:{preparing:"Preparing…",build:"Start building",optimize:"Start optimizing"},preparation:{accepted:"Goal received. Implementation is starting now.",preparing:"Creating the task environment…",starting:"Environment ready. Starting Codex…",next:"Next, Codex will plan the approach, then build, run, and validate the agent."}},R8e={title:"Saved projects",description:"Continue improving an existing version, or view, download, and deploy its source.",refresh:"Refresh projects",checkingStorage:"Checking project storage…",unavailableTitle:"Projects are temporarily unavailable",storageCheckError:"Could not confirm project storage status. Try again shortly.",storageNotConfigured:"Project storage is not configured.",loadingMigrated:"Loading migrated projects…",loadingSaved:"Loading saved projects…",loadingVersions:"Loading project versions…",unknownTime:"Unknown time",sourceDownloaded:"Source downloaded.",projectSummary_one:"{{count}} version · Updated {{time}}",projectSummary_other:"{{count}} versions · Updated {{time}}",versionSummary_one:"{{time}} · {{count}} file",versionSummary_other:"{{time}} · {{count}} files",noVersionDescription:"No version description",latestVersion:"Latest version",verified:"Verified",pendingVerification:"Needs review",viewSource:"View source",download:"Download",downloading:"Downloading…",optimize:"Optimize",optimizeUnavailable:"Optimize, not supported",errors:{projects:"Could not load saved projects.",source:"Could not load project source.",versions:"Could not load project versions.",download:"Could not download the source.",prepareDeployment:"Could not prepare the source for deployment.",deleteVersion:"Could not delete the project version.",migrated:"Could not load migrated projects",saved:"Could not load saved projects"},empty:{migratedTitle:"No migrated projects yet",savedTitle:"No saved projects yet",migratedDescription:"Source will be saved here after your first migration.",savedDescription:"Source will be saved here after your first build.",noVersions:"This project has no available versions."},compare:{selected:"{{count}}/2 selected",selectedLabel:"Selected",select:"Select",view:"View comparison",start:"Compare versions"},delete:{title:"Delete this version?",onlyVersion:"“{{name}}” has only one version. Deleting it will also remove the project. This cannot be undone.",description:"This version's source and validation records will be permanently deleted. Other versions are not affected.",confirm:"Delete version"}},D8e={title:"Choose how to create",subtitle:"Build your agent with the workflow that fits your needs",features:"Features",quick:{title:"Quick mode",description:"Delegate tasks to dynamically created subagents",features:{dynamicSubagents:"Dynamic subagents",autonomousPlanning:"Autonomous planning",collaboration:"Multi-agent collaboration",summary:"Automatic result summaries",skills:"Skills on demand",trace:"Traceable task execution"}},traditional:{title:"Advanced mode",description:"Customize your agent structure in detail",features:{visualConfig:"Visual configuration",migration:"Existing agent migration",debugging:"Live debugging",optimization:"Optional optimization",parameters:"Fine-grained controls"}}},L8e={placeholder:"Enter a system prompt. Type ## followed by a space to add a level-two heading…",toolbar:{undo:"Undo {{shortcut}}",redo:"Redo {{shortcut}}",paragraph:"Paragraph",quote:"Quote",heading:"Heading {{level}}",selectBlockType:"Select text style",blockType:"Text style",bold:"Bold",removeBold:"Remove bold",italic:"Italic",removeItalic:"Remove italic",bulletedList:"Bulleted list",numberedList:"Numbered list"}},M8e={local:{duplicatesSkipped:"Skipped duplicate skills: {{names}}",invalidDrop:"Drop a folder containing SKILL.md or a .zip file",readError:"Could not read the files: {{detail}}",dropLabel:"Drop a folder or ZIP file to detect skills automatically",hint:"Each skill must contain a SKILL.md file. Directories can contain multiple skills.",reading:"Reading files…",fileCount:"Local · {{count}} files"},hub:{searchError:"Search failed. Try again shortly.",searchPlaceholder:"Search Volcano Find Skill, such as data analysis or PDF",search:"Search",searching:"Searching…",noResults:"No matching skills found. Try another keyword.",hint:"Search Volcano Find Skill by keyword. Selected skills are downloaded to the skills/ directory when the project is generated."},space:{loadError:"Failed to load",loadingSpaces:"Loading AgentKit Skills centers…",noSpaces:"This account has no AgentKit Skills centers.",selectSpace:"Select an AgentKit Skills center",openConsole:"Open in the Volcano Engine console",loadingSkills:"Loading skills…",noSkills:"This AgentKit Skills center has no skills."}},I8e={unnamedNode:"Unnamed node",editInstruction:"Select to edit instructions…",controls:{ariaLabel:"Workflow canvas controls",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Fit view"},sections:{info:"Workflow information",execution:"Execution mode",nodes:"Nodes",nodeConfig:"Node configuration"},types:{sequential:{label:"Sequential",description:"Run nodes one after another"},parallel:{label:"Parallel",description:"Run nodes at the same time"},loop:{label:"Loop",description:"Run nodes repeatedly"}},placeholders:{description:"Describe what this workflow does…",agentDescription:"Describe what this agent does…",instruction:"You are…"},errors:{workflowNameUnique:"The workflow name must be unique among agent node names",agentNameUnique:"Agent names must be unique within this workflow"},dragHint:"Drag onto the canvas, or use the button below",agentNode:"Agent node",addNode:"Add node",connectHint:"Drag between node handles to define the execution order.",create:"Create workflow",deleteNode:"Delete node",nameHelp:"Use only letters, numbers, and underscores. Names must be unique.",instruction:"Instructions",tools:"Tools (comma-separated)",nodeId:"Node ID",empty:{selectNode:"Select a node to edit its configuration",summary:"{{nodes}} nodes · {{edges}} connections"}},P8e={ariaLabel:"Quick mode creation",progress:"Quick mode creation progress",steps:{agent:{label:"Agent",title:"Basic information",description:"Set the agent's name, purpose, behavior, and capabilities"},environment:{label:"Environment",title:"Configure the environment",description:"Choose the default environment or a custom environment you have built"},deployment:{label:"Deployment",title:"Deployment preferences",description:"Configure AgentKit cloud settings"}},model:{label:"Model",source:"Model source",name:"Model name",provider:"Provider",volcengineArk:"Volcano Ark",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",currentApiKey:"Current API Key",loadingApiKeys:"Loading API Keys",selectApiKey:"Select an API Key",searchApiKeys:"Search API Key names",noApiKeys:"No API Keys available",loadingModels:"Loading models",selectModel:"Select a model",searchModels:"Search by name, Model ID, or provider",noModels:"No models available",apiKeyPlaceholder:"Enter a model API Key",credentialsLoadError:"Failed to load model credentials",modelsLoadError:"Failed to load models"},identity:{unnamedPool:"Unnamed user pool",currentPool:"{{value}} (current user pool)",userPool:"User pool",loading:"Loading user pools",placeholder:"Select a user pool",search:"Search user pools",empty:"This account has no Identity user pools",currentHint:"This Studio's login JWT will be forwarded to the Runtime",mismatchHint:"The selected user pool is not used by this Studio, so the Studio will not be able to call the Runtime after deployment",selectionHint:"The user pool used by this Studio is marked in the list"},agent:{namePlaceholder:"Enter an agent name",descriptionPlaceholder:"Describe what this agent can do",prompt:"Prompt",promptPlaceholder:"Define the role, goals, and behavior boundaries",skills:"Skills",addSkill:"Add skills"},validation:{descriptionRequired:"Enter a description",promptRequired:"Enter a prompt",modelRequired:"Select a model",instanceIntegers:"Minimum instances must be an integer of 0 or greater, and maximum instances must be an integer greater than 0",instanceOrder:"Minimum instances cannot exceed maximum instances",userPoolRequired:"Select a user pool for Runtime authentication"},deployment:{runtimeName:"Runtime name",runtimeNameUpdateHint:"The existing Runtime name is preserved during updates",runtimeNameHint:"Use only letters, numbers, underscores, and hyphens",region:"Deployment region",authentication:"Authentication",apiKeyDescription:"Default: access with the Runtime API Key",userPoolDescription:"Use a JWT issued by an Identity user pool",sessionStorage:"Session storage",inMemoryStorage:"Temporary in-memory storage",backends:{sqlite:"SQLite file",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",inMemoryHint:"To prevent session loss across instances, keep the Runtime at 1–1 instances",networkMode:"Network mode",network:{public:"Public",private:"Private",both:"Public and private"},subnetIds:"Subnet IDs (optional, comma-separated)",sharedInternet:"Shared public egress in the VPC",sharedInternetHint:"Allow private Runtimes to access the public internet through shared egress",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",evaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment",resources:"Resource configuration",complete:"Deployment complete",preparing:"Preparing deployment…"},environmentVariables:{title:"Environment variables",add:"Add variable",nameAriaLabel:"Environment variable name",valueAriaLabel:"Value for {{name}}",deleteNamed:"Delete {{name}}"},actions:{updateAgain:"Update again",deployAgain:"Deploy again",updateAndPublish:"Update and publish"}},N8e={actions:{addSubagent:"Add subagent",clearRoot:"Clear main agent",clearRootConfirmation:"Clear all settings and subagents from the main agent? This cannot be undone."},workspace:{progress:"Agent creation progress",modes:{build:"Build",validate:"Debug",optimize:"Optimize",environment:"Environment",publish:"Publish"},titles:{build:"Customize your agent architecture",validate:"Debug your agent",optimize:"Choose optimizations for your agent",environment:"Configure the cloud environment",publish:"Prepare your agent for deployment"}},sections:{type:{label:"Agent type",hint:"Choose an agent type"},basic:{label:"Basic information",hint:"Name, description, and system prompt"},model:{label:"Model",hint:"Model and service (optional)"},tools:{label:"Tools",hint:"Callable capabilities"},skills:{label:"Skills",hint:"Declarative skills"},knowledge:{label:"Knowledge base",hint:"External knowledge retrieval"},memory:{label:"Memory",hint:"Short-term and long-term memory"},subagents:{label:"Subagents",hint:"Nested collaboration"},review:{label:"Finish",hint:"Preview and create"}},agentTypes:{ariaLabel:"Agent type",remoteChildOnly:"Remote agents can only be used as child steps",llm:{label:"Agent",fullLabel:"LLM agent",description:"Uses an LLM to complete tasks autonomously"},sequential:{label:"Sequential",fullLabel:"Sequential agent",description:"Runs subagents one after another"},parallel:{label:"Parallel",fullLabel:"Parallel agent",description:"Runs subagents in parallel, then combines their results"},loop:{label:"Loop",fullLabel:"Loop agent",description:"Repeats subagents until the stop condition is met"},a2a:{label:"Remote agent",fullLabel:"Remote agent",description:"Calls a remote agent through the A2A protocol"}},basic:{agentName:"Agent name",name:"Name",agentDescription:"Agent description",descriptionPlaceholder:"Briefly describe what this agent does so your team can identify it…",nameHelp:"Follow Google ADK naming rules and keep the name unique in the execution flow.",rootDescriptionHelp:"The full description is preserved and converted to a Runtime-compatible single line during deployment.",descriptionHelp:"The description appears in agent lists and selectors.",orchestratorHelp:"This is a collaboration container and does not answer directly. Add task steps on the canvas and drag them to reorder.",maxIterations:"Maximum iterations",maxIterationsHelp:"The loop repeats its subagents until the condition is met or this limit is reached.",agentCenter:"AgentKit agent center",agentCenterHelp:"The remote agent's name, description, and capabilities come from the Agent Card returned by the center. The system discovers and attaches matching agents for each task.",moreOptions:"More options",systemPrompt:"System prompt",loadingMarkdown:"Loading Markdown editor…",markdownHelp:"Markdown shortcuts are supported. For example, type ## followed by a space to create a level-two heading.",unnamed:"Unnamed",unnamedAgent:"Unnamed agent"},validation:{remoteRoot:"A remote agent can only be a subagent",missingRegistry:"Select an AgentKit agent center",name:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name.",characters:"Start with a letter or underscore and use only letters, numbers, and underscores"},duplicateName:"Agent names must be unique within this structure",missingDescription:"Description is required",mcpAuthRequired:"Confirm how to handle authentication after changing the MCP address",mcpDuplicateName:"MCP names must be unique",mcpDuplicateUrl:"Remove the duplicate MCP endpoint before publishing",missingSubagent:"A subagent is required",missingPrompt:"System prompt is required",missingSubagentDetail:"Add at least one subagent to {{type}} before debugging or publishing.",problem:"{{name}}: {{problem}}"},ai:{ariaLabel:"Fill agent configuration with AI",minimumLength:"Enter at least {{count}} characters.",replaceConfirmation:"The generated configuration will replace the current canvas and settings. Continue?",placeholder:"Describe your goal and use {{model}} to generate the configuration",generate:"Generate",generating:"Generating",success:"Configuration generated",regenerate:"Generate again",failed:"Generation failed"},debug:{ariaLabel:"Agent debugging workspace",unavailable:"This backend does not currently support generated-agent debug runs.",baseline:"Baseline",comparison:"Variant {{count}}",selectModel:"Select a model",enterDescription:"Enter a description",enterPrompt:"Enter a system prompt",duplicateConfiguration:"Test configurations must be unique",starting:"Starting…",applyAndRestart:"Apply and restart",restart:"Restart",start:"Start environment",defaultModel:"Default model",testConfiguration:"Test configuration",deleteVariant:"Delete {{name}}",deleteVariantGroup:"Delete comparison variant",creatingEnvironment:"Creating the test environment…",configurationChanged:"The configuration changed. Restart the environment.",ready:"Environment ready",readyHint:"Send a message to compare agent responses.",startHint:"Complete the configuration, then start the environment.",viewTraceNamed:"View the trace for {{name}}",traceUnavailable:"Send a message to view its trace",trace:"Trace",useConfiguration:"Use this configuration",finishConfiguration:"Finish configuration",finishAndStart:"Finish and start",currentAgentModel:"Current agent model",configurationHint:"Changes apply only to this comparison. Select this configuration to continue to deployment.",messagePlaceholder:"Send a message to the running test environments…",startOneFirst:"Start at least one test environment first",addVariant:"Add variant",traceTitle:"Trace · {{name}}",leaveTitle:"Leave debugging?",leaveDescription:"The current environments will be removed when you leave. You can start new environments when you return.",cleaning:"Cleaning up…",confirmLeave:"Leave",closeLeaveConfirmation:"Close leave-debugging confirmation"},optimization:{ariaLabel:"Agent optimization options",scenario:"Optimization scenario",components:"Optimization components",bytePlusUnavailable:"Harness Sidecar optimizations are not available for BytePlus accounts yet. Leave all optimizations unselected to continue; regular BytePlus agents are not affected.",releaseScenario:"Optimization scenario: {{profile}}",profiles:{default:{label:"Custom",description:"Choose components as needed. The Sidecar stays off when none are selected."},ops:{label:"Operations",description:"For operations diagnostics, databases, logs, and monitoring MCP servers."}},groups:{quality:"Improve response quality",cost:"Reduce runtime cost",stability:"Improve runtime stability"},options:{context_engine:{label:"Context management",description:"Manage context assembly, task anchoring, and context budgets."},compressor:{label:"Context and result compression",description:"Compress long context and large tool results to reduce token usage."},verifier:{label:"Response verification and repair",description:"Verify evidence and responses, then repair or alert on failure."},long_run_control:{label:"Goal task control",description:"Manage progress, continuation, and completion conditions for Goal tasks."},mcp_resilience:{label:"MCP resilience",description:"Manage connections, timeouts, empty results, large responses, and call budgets. Includes read-only SQL protection by default."}}},model:{label:"Model",source:"Model source",volcanoArk:"Volcano Ark",volcengineArk:"Volcano Ark",bytePlusModelArk:"BytePlus ModelArk",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",configuration:"Model configuration",name:"Model name",provider:"Provider",liteLlmProviders:"LiteLLM providers",apiKeyPlaceholder:"Enter the model API Key",available:"Available",retiring:"Retiring soon",notActivated:"Not activated",unavailable:"Unavailable",apiKeyLoadError:"Failed to load Ark API Keys",loadingApiKeys:"Loading API Keys…",selectApiKey:"Select an API Key",currentApiKey:"Current API Key",apiKeyList:"API Key list",searchApiKey:"Search API Keys",searchApiKeyName:"Search API Key names",noApiKeys:"No API Keys available",noMatchingApiKey:"No matching API Keys",loading:"Loading models…",loaded:"{{count}} models loaded",loadError:"Failed to load models",selectModel:"Select a model",selectProviderModel:"Select a provider model",providerModels:"Provider models",search:"Search models",searchPlaceholder:"Search by name, Model ID, or provider",noMatches:"No matching models",empty:"No models available",unknownStatus:"Unknown status",refresh:"Refresh",refreshing:"Refreshing…",activate:"Activate",activateAction:"Open activation",currentConfiguration:"Current configuration"},tools:{builtIn:"Built-in tools",builtInHelp:"Select VeADK capabilities. Imports and required environment variables are added automatically.",codeExecution:"Code execution configuration",codeExecutionHelp:"Select the AgentKit code execution sandbox.",mcp:"MCP tools"},catalog:{web_search:{label:"Web search",description:"Get real-time information with Volcengine Web Search."},parallel_web_search:{label:"Parallel web search",description:"Run multiple search queries in parallel and combine the results faster."},link_reader:{label:"Link reader",description:"Fetch and read the main content from a URL."},web_scraper:{label:"Web scraper",description:"Crawl webpages into structured data. Requires the Scraper service."},image_generate:{label:"Image generation",description:"Generate images from text with Doubao Seedream."},image_edit:{label:"Image editing",description:"Edit or transform images with Doubao SeedEdit."},video_generate:{label:"Video generation",description:"Generate videos from text or images with Doubao Seedance, including task status queries."},text_to_speech:{label:"Text to speech (TTS)",description:"Convert text to speech with Volcengine Speech."},run_code:{label:"Code execution",description:"Run code in a sandbox."},vesearch:{label:"VeSearch",description:"Search with Volcengine VeSearch. Requires a bot endpoint."},links:{console:"Console",documentation:"Documentation"},env:{modelAgentName:{comment:"Model name"},embeddingModelName:{comment:"Embedding model required by memory and knowledge bases"},vikingMemoryProject:{comment:"VikingDB memory project"},vikingMemoryRegion:{comment:"VikingDB memory region"},vikingMemoryType:{comment:"Memory types"},feishuAppId:{comment:"Feishu app ID"},feishuAppSecret:{comment:"Feishu app secret",placeholder:"Enter the app secret"},registrySpaceId:{comment:"AgentKit agent center",placeholder:"Select an agent center"},registryTopK:{comment:"Number of agents to retrieve"},registryRegion:{comment:"AgentKit agent center region"},registryEndpoint:{comment:"AgentKit agent center OpenAPI endpoint"},agentKitToolId:{comment:"Code execution sandbox ID"},agentKitToolRegion:{comment:"AgentKit Tools region"},openVikingUrl:{comment:"OpenViking service URL"},openVikingMemoryUserId:{comment:"Memory owner ID",help:"The user segment in viking://user//peers//memories. Use it to isolate agents, tenants, or business scenarios. The default is default."},openVikingMemoryPolicy:{comment:"Memory policy",help:"Controls memory extraction and isolation. Leave it blank to use the official default policy."},openVikingKnowledgeUserId:{comment:"Knowledge base owner ID",help:"Used in the default path viking://user//resources// when no resource directory is configured. The default is default."},openVikingTargetUri:{comment:"Knowledge base resource directory",help:"Leave blank to generate it from the KnowledgeBase index. When provided, this OpenViking resource directory takes precedence."},tlsServiceName:{comment:"TLS topic_id. Leave blank to create one automatically"}}},backends:{shortTerm:{local:{label:"In-memory",description:"Stored in the process without persistence. Best for development and debugging."},sqlite:{label:"SQLite file",description:"Persist data to a local .db file."},mysql:{label:"MySQL",description:"Persist data to MySQL."},postgresql:{label:"PostgreSQL",description:"Persist data to PostgreSQL."}},longTerm:{local:{label:"Local vector store",description:"In-process llama-index vector store."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},redis:{label:"Redis",description:"Vector retrieval with Redis."},viking:{label:"VikingDB Memory",description:"VikingDB memory with user profile support."},openviking:{label:"OpenViking Memory",description:"Long-term memory that stores and retrieves preferences, events, and entities per user."},mem0:{label:"Mem0",description:"Managed memory from Mem0."}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB knowledge base."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},context_search:{label:"Context Search",description:"Volcengine Context Search without embedding configuration."},openviking:{label:"OpenViking Knowledge",description:"OpenViking resource-directory knowledge base without embedding configuration."}}},exporters:{apmplus:{label:"APMPlus",description:"Volcengine APMPlus application performance monitoring."},cozeloop:{label:"CozeLoop",description:"Distributed tracing with CozeLoop."},tls:{label:"TLS (Log Service)",description:"Export logs to Volcengine TLS."}},knowledge:{title:"Knowledge base",description:"Enable external knowledge retrieval (RAG) so the agent can answer from your data.",backend:"Knowledge base backend",vikingDatabase:"VikingDB knowledge base"},memory:{shortTerm:"Short-term memory",shortTermDescription:"Store context for one session",shortTermBackend:"Short-term memory backend",longTerm:"Long-term memory",longTermDescription:"Store context across sessions, usually with vector retrieval",longTermBackend:"Long-term memory backend",vikingDatabase:"VikingDB memory",autoSave:"Save sessions to long-term memory automatically",autoSaveDescription:"Write session content to long-term memory when a session ends."},mcp:{removeTool:"Remove MCP tool",namePlaceholder:"Name (optional)",urlPlaceholder:"MCP service URL",pathWarning:"This address does not end with /mcp. Confirm that it is the complete MCP service URL.",configuredPlaceholder:"Authentication is stored securely",tokenPlaceholder:"Bearer token (optional)",changedUrlWarning:"The MCP address changed. Choose how to handle the stored authentication.",reuseCredential:"Keep using it",replaceCredential:"Replace authentication",noAuth:"Use no authentication",reuseHint:"The stored authentication will be reused when you publish.",changeToReplace:"Replace instead",credentialConfigured:"Studio securely stores the authentication.",removeCredential:"Remove authentication",commandPlaceholder:"Command, such as npx",argsPlaceholder:"Arguments separated by spaces",stdioHint:"The stdio tool starts in the deployment environment. Make sure its command and dependencies are available.",addTool:"Add MCP tool"},resources:{unnamedAgentCenter:"Unnamed agent center",unnamedKnowledgeBase:"Unnamed knowledge base",unnamedMemory:"Unnamed memory store",loadError:"Failed to load",loadingAgentCenters:"Loading agent centers…",agentCentersLoaded:"{{count}} agent centers loaded",noAgentCenters:"No agent centers available",noMatchingAgentCenters:"No matching agent centers",searchAgentKitCenter:"Search AgentKit agent centers",searchNameOrId:"Search by name or ID",selectAgentCenter:"Select an agent center",selectAgentKitCenter:"Select an AgentKit agent center",selectedAgentCenter:"Selected agent center",agentKitCenter:"AgentKit agent center",refreshAgentCenters:"Refresh agent centers",knowledgeBaseList:"Knowledge base list",knowledgeBasePlaceholder:"Select a knowledge base",loadingKnowledgeBases:"Loading knowledge bases…",knowledgeBasesLoaded:"{{count}} knowledge bases loaded",noKnowledgeBases:"No knowledge bases available",noMatchingKnowledgeBases:"No matching knowledge bases",searchKnowledgeBase:"Search knowledge bases",selectKnowledgeBase:"Select a knowledge base",refreshKnowledgeBases:"Refresh knowledge bases",memoryList:"Memory store list",memoryPlaceholder:"Select a memory store",loadingMemories:"Loading memory stores…",memoriesLoaded:"{{count}} memory stores loaded",noMemories:"No memory stores available",noMatchingMemories:"No matching memory stores",searchMemory:"Search memory stores",selectMemory:"Select a memory store",refreshMemories:"Refresh memory stores"},env:{noAdditionalParameters:"This backend needs no additional runtime parameters.",invalidJson:"Enter valid JSON.",helpAriaLabel:"Help for {{label}}: {{help}}",openOpenViking:"Open OpenViking {{label}}",valuePlaceholder:"Enter a value",openVikingIndex:"OpenViking resource index",openVikingIndexHelp:"Leave blank to generate an index from the agent name, such as my_agent_kb. Without DATABASE_OPENVIKING_TARGET_URI, the default URI is viking://user/{knowledge base owner ID, or default}/resources/{resource index}/. When DATABASE_OPENVIKING_TARGET_URI is set, that complete URI is used instead.",openVikingIndexAriaLabel:"OpenViking resource index help: {{help}}"},deployment:{vpcRequired:"Enter a VPC ID when using VPC networking.",apiKeyRequired:"Select the API Key used by the model.",invalidEnvName:"Invalid environment variable name: {{key}}",requiredEnv:"{{name}}: enter this required environment variable",generatingConfiguration:"Generating deployment configuration",runtimeNameExists:"This Runtime name already exists. Choose another name and try again.",preparing:"Preparing deployment",complete:"Deployment complete",failed:"Deployment failed",updateAndPublish:"Update and publish",stages:{build:"Build image",deploy:"Deploy Runtime",publish:"Publish service",running:"Deploying"}},publish:{generating:"Generating publish configuration",validating:"Validating the agent structure and preparing the deployment snapshot…"}},B8e={presets:{support:{name:"Customer support assistant",description:"Answer questions around the clock using your knowledge base and conversation history, with consistent and considerate responses.",instruction:"You are a professional and patient customer support assistant. Always use a courteous, friendly tone. Base answers on the knowledge base whenever possible. When the available information is insufficient, say so clearly and ask for the details you need instead of inventing an answer. Keep responses concise and well structured, and provide steps when useful.",subagents:{}},analyst:{name:"Data analyst",description:"Run code for statistics and visualization with tracing enabled, so every analysis is observable and reproducible.",instruction:"You are a rigorous data analyst. Clarify the objective and definitions before cleaning, analyzing, and visualizing data with executable code. Explain assumptions and methods at each step, support conclusions with key evidence, and identify possible bias or limitations.",subagents:{}},translator:{name:"Translation assistant",description:"Translate between Chinese and English accurately and naturally while preserving tone and terminology.",instruction:"You are a professional translator fluent in Chinese and English. Preserve the meaning of the source while producing natural language for the target audience. Keep proper nouns and technical terminology accurate and reflect the original tone and style. Return only the translation unless the user asks for an explanation.",subagents:{}},coder:{name:"Coding assistant",description:"Write, debug, and refactor code, validate it by running tests, and produce clear, maintainable implementations.",instruction:"You are a senior software engineer. Write correct, clear, maintainable code that follows the conventions and best practices of the target language. When uncertain, run the code to validate the implementation, cover important edge cases, and add concise comments for complex logic.",subagents:{}},researcher:{name:"Researcher",description:"Search primary sources online and combine them with knowledge and long-term memory to produce evidence-backed findings.",instruction:"You are a rigorous researcher. Break each question into key subproblems, collect multiple credible primary sources through web search, and cross-check the evidence before drawing conclusions. Cite sources, state uncertainty, distinguish facts from inference, and avoid overgeneralization.",subagents:{}},"research-team":{name:"Multi-agent research team",description:"Coordinate a researcher, analyst, and writer to produce an end-to-end research report.",instruction:"You coordinate a research team. Break down the user's research task, delegate search, analysis, and writing to the appropriate subagents, synthesize their work, and deliver a clear, evidence-backed report.",subagents:{0:{name:"Researcher",description:"Collect primary sources and data related to the topic online.",instruction:"You are the team's researcher. Find multiple credible sources about the topic, organize the key facts, data, and original citations, and hand them to the analyst without adding unsupported conclusions."},1:{name:"Analyst",description:"Cross-check and synthesize the collected material.",instruction:"You are the team's analyst. Cross-check, compare, and synthesize the research material. Extract insights, identify contradictions and uncertainty, and produce a structured set of findings."},2:{name:"Writer",description:"Turn the analysis into a clear report with reliable citations.",instruction:"You are the team's writer. Turn the analyst's findings into a clear, well-written report with consistent citations, ensuring every conclusion can be traced to a source."}}}},tags:{tools:"Tools",memory:"Memory",knowledgeBase:"Knowledge base",tracing:"Tracing",subagents:"{{count}} subagents"},gallery:{title:"Create from a template",subtitle:"Choose a prebuilt agent template and customize it to fit your needs."},detail:{back:"Back to templates",name:"Name",systemPrompt:"System prompt",model:"Model",tools:"Tools",memory:"Memory",knowledgeBase:"Knowledge base",tracing:"Tracing",subagents:"Subagents ({{count}})",create:"Create from this template",shortTermMemory:"Short-term",longTermMemory:"Long-term"}},Qtr=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:E8e,codePackage:k8e,common:w8e,default:{common:w8e,yaml:A8e,validation:T8e,defaults:S8e,helpers:C8e,intelligentDeployment:O8e,codePackage:k8e,buildCanvas:E8e,intelligent:_8e,projectLibrary:R8e,modePicker:D8e,promptEditor:L8e,skills:M8e,workflow:I8e,workbench:P8e,traditional:N8e,template:B8e},defaults:S8e,helpers:C8e,intelligent:_8e,intelligentDeployment:O8e,modePicker:D8e,projectLibrary:R8e,promptEditor:L8e,skills:M8e,template:B8e,traditional:N8e,validation:T8e,workbench:P8e,workflow:I8e,yaml:A8e},Symbol.toStringTag,{value:"Module"})),$8e={backToList:"Back to scheduled tasks",cancel:"Cancel",cancelQueue:"Cancel queued run",cancelQueueFirst:"Cancel the queued run first",cancelling:"Cancelling…",closeDrawer:"Close panel",collapse:"Collapse",connectingRuntime:"Connecting to Runtime…",createScheduledTask:"Create scheduled task",createTask:"Create task",delete:"Delete",deleteTask:"Delete task",edit:"Edit",enable:"Enable",expand:"Expand",pause:"Pause",refresh:"Refresh",refreshHistory:"Refresh run history",rerun:"Run again",retry:"Retry",runNow:"Run now",saveChanges:"Save changes",saving:"Saving…",stop:"Stop run",stopRun:"Stop this run",stopRunFirst:"Stop the current run first",stopping:"Stopping…",viewDetails:"View details"},F8e={cancelDescription:"This Session will be cancelled. Future scheduled runs will remain enabled.",cancelTitle:"Stop this run?",deleteDescription:"“{{name}}” and its complete run history will be permanently deleted.",deleteTitle:"Delete scheduled task?"},z8e={configuration:"Task configuration",nextRun:"Next run",pageLabel:"Scheduled task details",region:"Region",runtime:"Runtime",status:"Task status"},U8e={createTitle:"Create scheduled task",description:"Each trigger creates a separate Session for the Runtime Agent.",editTitle:"Edit scheduled task"},V8e={minutesSeconds:"{{minutes}} min {{seconds}} sec",seconds:"{{count}} sec"},Q8e={cronExpression:"Cron expression",cronHelp:"Enter minute, hour, day of month, month, and day of week.",dailyTime:"Daily run time",enableAfterCreate:"Enable after creation",enableHelp:"The task will run at its next scheduled time after it is enabled.",name:"Task name",namePlaceholder:"For example: Generate a daily operations summary",noRuntime:"No Runtime available",prompt:"Execution prompt",promptPlaceholder:"Enter the text to send to the Agent on every run",runAt:"Run time",runtimeAgent:"Runtime Agent",runtimeHelp:"The task always uses the Runtime's currently active version.",runtimePlaceholder:"Select a Runtime Agent",schedule:"Schedule",scheduleType:"Schedule type",timezone:"Time zone",weekday:"Day of week"},G8e={all:"All"},H8e={description:"Each run uses a separate Session. Results and errors are retained.",duration:"Duration: {{duration}}",emptyDescription:"Runs will appear here after the task is triggered or run manually.",emptyTitle:"No runs yet",errorDetails:"Error details",finalAnswer:"Final answer",loadFailed:"Unable to load run history",loadFailedDescription:"Check the Studio service and try again.",session:"Session",title:"Run history"},W8e={cancelRequested:"Stop request submitted.",created:"Task created.",deleted:"The task and its run history were deleted.",enabled:"Task enabled.",paused:"Task paused.",queued:"Task queued and will start within one minute.",requeued:"Task queued again and will start within one minute.",updated:"Task updated."},Y8e={filterLabel:"Filter scheduled tasks by status",listLabel:"Scheduled task list",loadFailed:"Unable to load scheduled tasks",loadFailedDescription:"Check the Studio service and try again.",title:"Cronjob"},q8e={cron:"Cron {{cron}}{{zone}}",daily:"Daily at {{time}}{{zone}}",once:"Once · {{date}}{{zone}}",weekly:"{{weekday}} at {{time}}{{zone}}"},j8e={daily:"Daily",once:"Once",weekly:"Weekly"},X8e={cancelled:"Cancelled",enabled:"Enabled",failed:"Failed",notRun:"Not run yet",paused:"Paused",pending:"Preparing",queued:"Queued",retrying:"Retrying",running:"Running",skipped:"Skipped",success:"Succeeded"},K8e={cronFields:"A Cron expression must contain five fields, for example 0 9 * * *.",nameRequired:"Enter a task name.",promptRequired:"Enter the text to send to the Agent on each run.",runtimeAppMissing:"The Runtime Agent did not return an appName. Confirm that the Runtime is ready and compatible.",runtimeRequired:"Select an available Runtime Agent.",timeRequired:"Select a run time."},Z8e={friday:"Friday",monday:"Monday",saturday:"Saturday",sunday:"Sunday",thursday:"Thursday",tuesday:"Tuesday",wednesday:"Wednesday"},Gtr=Object.freeze(Object.defineProperty({__proto__:null,actions:$8e,confirm:F8e,default:{actions:$8e,confirm:F8e,detail:z8e,drawer:U8e,duration:V8e,fields:Q8e,filters:G8e,history:H8e,notices:W8e,page:Y8e,schedule:q8e,scheduleTypes:j8e,status:X8e,validation:K8e,weekdays:Z8e},detail:z8e,drawer:U8e,duration:V8e,fields:Q8e,filters:G8e,history:H8e,notices:W8e,page:Y8e,schedule:q8e,scheduleTypes:j8e,status:X8e,validation:K8e,weekdays:Z8e},Symbol.toStringTag,{value:"Module"})),J8e="Report an issue",eBe="Description",tBe="Common issues",rBe="Cancel",nBe="Done",iBe="Submit feedback",aBe="Submitting…",sBe={title:"Feedback submitted. Thank you.",description:"The AgentKit team will review your report as soon as possible."},oBe={close:"Close issue report",intro:"Select the issues you encountered and add any useful details.",privacy:"Your conversation data will be shared with the AgentKit team. Please protect sensitive information.",descriptionPlaceholder:"Describe what happened (optional)",issues:{slow:"Slow execution",crash:"Runtime crash",incorrect:"Inaccurate result",tool_error:"Tool call failed",other:"Other issue"}},lBe={description:"Tell us about a problem you encountered while using AgentKit Studio.",module:"Area",modules:{conversation:"Conversation",agents:"Agents",applications:"Automations",search:"Search",other:"Other"},commonIssuesMultiple:"Common issues (select all that apply)",issueTypes:"Issue types",issues:{page_slow:"Page loads slowly",feature_unavailable:"Feature unavailable",display_error:"Display issue",no_response:"Action has no response",other:"Other issue"},descriptionPlaceholder:"Describe the page, action, and what happened",quickAdd:"Quick add",suggestionsLabel:"Suggested descriptions",suggestions:{noResponse:"Nothing happens after I click",loading:"The page remains in a loading state",incomplete:"Some content is missing or clipped",error:"An error appears after the action"},privacy:"Your data will be shared with the AgentKit team. Please protect sensitive information."},Htr=Object.freeze(Object.defineProperty({__proto__:null,cancel:rBe,commonIssues:tBe,default:{title:J8e,descriptionLabel:eBe,commonIssues:tBe,cancel:rBe,done:nBe,submit:iBe,submitting:aBe,success:sBe,dialog:oBe,page:lBe},descriptionLabel:eBe,dialog:oBe,done:nBe,page:lBe,submit:iBe,submitting:aBe,success:sBe,title:J8e},Symbol.toStringTag,{value:"Module"})),cBe={back:"Back",close:"Close"},uBe={title:"Optimize migrated project",closeAria:"Close optimization dialog"},hBe={title:"Migrated projects",description:"Manage migrated source versions or continue optimizing any version.",libraryTitle:"Projects and versions",libraryDescription:"View, download, deploy, or compare source versions, or continue optimizing any version.",emptyTitle:"No migrated projects yet",emptyDescription:"Migrated source code will be saved here automatically."},dBe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any (universal migration)"},fBe={awaitingUpload:"Awaiting upload",analyzing:"Analyzing",needsInput:"Needs input",analysisReady:"Awaiting confirmation",migrating:"Migrating",validating:"Validating",packaging:"Packaging",succeeded:"Completed",succeededWithWarnings:"Completed with notices",partial:"Partially completed",failed:"Failed",cancelled:"Stopped",expired:"Expired"},pBe={partialReady:"Migration output is ready, but delivery is incomplete. Review the migration notices.",readyWithWarnings:"Migration output is ready. Review the migration notices.",ready:"Migration output is ready."},gBe={passed:"Output verification passed",failed:"Output verification failed",degraded:"Output verification incomplete"},mBe={session:"Create migration environment",upload:"Upload project",analysis:"Analyze project"},vBe={agentNameRequired:"Enter an Agent name",agentNameInvalid:"Agent names must be 1–63 characters, contain only lowercase letters, numbers, and hyphens, and start and end with a letter or number"},yBe={seconds:"{{seconds}} sec",minutesSeconds:"{{minutes}} min {{seconds}} sec"},bBe={savedUnaffected:"Saved projects are unaffected",savingUnaffected:"Source is being saved and will be unaffected once complete",activeDetail:"Task history and temporary output will become unavailable after expiration",oneHour:"Temporary migration environment is retained for 1 hour",ended:"Temporary migration environment has ended",savedAvailable:"Saved projects remain available to view, download, deploy, or optimize",unavailable:"Task history and temporary output are no longer available",countdown:"Temporary migration environment ends in {{minutes}} min {{seconds}} sec",expiredSavedMessage:"The temporary migration environment has ended. Saved projects are unaffected.",expiredMessage:"The temporary migration environment has ended. Task history and temporary output are no longer available."},xBe={recommended:"Recommended migration method",scope:"Migration scope",excluded:"Out of scope",viewEvidence:"View analysis evidence",viewAssumptions:"View key assumptions",viewSourceEvidence:"View source evidence"},wBe={ariaLabel:"Codex activity",title:"Codex activity",startingAnalysis:"Codex is starting the analysis…",startingMigration:"Codex is starting the migration…",loadError:"Codex activity is temporarily unavailable. The current task is unaffected."},ABe={title:"Migration output",fileTooLarge:"This file exceeds 2 MiB. Download the complete output to view it.",unsupportedPreview:"This file cannot be previewed here. Download the complete output to view it.",filesAria:"Migration output files",searchAria:"Search output files",searchPlaceholder:"Search files",limit:"Showing the first {{count}} items. Search for a specific file.",noSelection:"No file selected",noPreview:"No files available to preview.",loadingFile:"Loading output file…",startupFile:"Startup file",fileCountLabel:"Files",saved:"Source has been saved. You can view, download, deploy, or optimize it.",saving:"Output is ready and the source version is being saved.",deployReady:"Output is available to preview, download, and deploy. Waiting for source save status.",deployUnavailable:"Output is available to preview and download, but its current delivery status does not support deployment.",viewProjects:"View migrated projects",downloading:"Downloading…",downloadZip:"Download ZIP",deployTitle:"Deploy migration output",deployUnavailableTitle:"Current delivery status does not support deployment",deployRuntime:"Deploy to Runtime",fileCount:"{{count}} files",startup:"Startup file {{module}}",loading:"Loading migration output…"},TBe={retiring:"Retiring soon",currentDefault:"Current default model",loadError:"Failed to load models",label:"Model",placeholder:"Select a model"},SBe={zipOnly:"Select a local project in .zip format.",invalidName:"The ZIP file name is invalid. Rename the file and select it again.",tooLarge:"The project ZIP cannot exceed {{size}}.",empty:"The project ZIP cannot be empty.",removeAria:"Remove project ZIP",reselectPrompt:"Select the project ZIP again",selectPrompt:"Select or drop a local project ZIP",reselect:"Select again",selectZip:"Select ZIP",continue:"Continue upload",start:"Start migration",inputAria:"Select a local project ZIP",retention:"The temporary migration environment is retained for 1 hour after creation. Successfully saved source versions are unaffected."},CBe={requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}",notReady:"Migration output is not ready yet.",back:"Back to migration results"},OBe={backToAddAgent:"Back to Add Agent",title:"Migrate existing project",newMigration:"New migration",recent:"Recent migrations",sessionsAria:"Migration sessions",loadingSessions:"Loading migration sessions…",noSessions:"No migration sessions",heading:"Migrate an existing Agent project",intro:"Upload a local project ZIP. Codex will first perform a read-only analysis, then ask you to confirm the migration method."},kBe={stop:"Stop migration",stopping:"Stopping…",reload:"Reload",refreshStatus:"Refresh status"},EBe={unavailable:"Migration is currently unavailable",defaultReason:"Dev Sandbox is currently unavailable. Contact your administrator to check the configuration."},_Be={requestZip:"Provide a local project ZIP. After upload, I’ll identify the framework, entry point, and migration boundaries, then ask you to confirm the migration method before making changes.",zipHint:"Only local ZIP files are supported, up to {{size}}. The migration environment is retained for 1 hour after creation.",creatingSandbox:"Creating Dev Sandbox",initializing:"Initializing the migration workspace and checking AgentKit CLI, Codex, and migration capabilities. The project will upload automatically when the environment is ready.",elapsed:"Elapsed: {{duration}}",uploadThenAnalyze:"Read-only analysis will start automatically after the ZIP upload completes.",analyzing:"Codex is identifying the framework, entry point, and migration boundaries. No migration changes are being made.",migrationLocked:"Attachments and migration settings cannot be changed while migration is running. Wait for the task to finish or stop it.",analysisPaused:"Read-only analysis is paused. Answer only the questions below. After submission, analysis will continue in the same environment without starting the migration.",analysisComplete:"Read-only analysis is complete. Review the recommendation and confirm the final migration method.",awaitingUpload:"The migration environment is ready. Select the local ZIP again to continue uploading.",expiredTitle:"Migration environment expired",expiredDescription:"Migration content and output can no longer be previewed, downloaded, or deployed. If the Runtime deployment completed, return to the Agents page to continue using it.",unsupportedTitle:"This ZIP cannot be migrated yet",unsupportedHint:"Update the project as instructed, then create a new migration and upload it again.",failedTitle:"Migration incomplete",cancelled:"This migration was stopped. Create a new migration and upload the project again."},RBe={ariaLabel:"Provide project analysis details",title:"Additional information needed for analysis",description:"The attachment stays locked; submitting continues read-only analysis only",submitting:"Continuing analysis…",submit:"Submit and continue analysis"},DBe={ariaLabel:"Confirm migration method",title:"Confirm migration method",description:"Migration starts only after confirmation",framework:"Migration method",frameworkPlaceholder:"Select a migration method",agentName:"Agent name",entry:"Project entry point",entryPlaceholder:"Select a project entry point",entryExample:"For example, agent.py:agent",consent:"By selecting “Confirm and start migration,” you confirm the migration scope, exclusions, and key assumptions above.",starting:"Starting migration…",start:"Confirm and start migration"},LBe={closeAria:"Dismiss error",loadFailed:"Could not load migration data. Try again.",refreshFailed:"Could not refresh the migration status. Try again."},MBe={title:"Stop the current migration?",description:"Stopping ends the current analysis or migration process. Completed steps will not continue."},Wtr=Object.freeze(Object.defineProperty({__proto__:null,actions:kBe,activity:wBe,analysis:xBe,artifact:ABe,capability:EBe,common:cBe,confirmation:DBe,conversation:_Be,default:{common:cBe,optimization:uBe,projects:hBe,framework:dBe,state:fBe,task:pBe,verification:gBe,transfer:mBe,validation:vBe,duration:yBe,expiry:bBe,analysis:xBe,activity:wBe,artifact:ABe,model:TBe,upload:SBe,deployment:CBe,workspace:OBe,actions:kBe,capability:EBe,conversation:_Be,questions:RBe,confirmation:DBe,errors:LBe,stopDialog:MBe},deployment:CBe,duration:yBe,errors:LBe,expiry:bBe,framework:dBe,model:TBe,optimization:uBe,projects:hBe,questions:RBe,state:fBe,stopDialog:MBe,task:pBe,transfer:mBe,upload:SBe,validation:vBe,verification:gBe,workspace:OBe},Symbol.toStringTag,{value:"Module"})),IBe={loading:"Loading…",searchLabel:"Search {{label}}",searchPlaceholder:"Search {{label}}",retry:"Retry",noMatches:"No matches",noOptions:"No options available",selection:"{{label}}: {{value}}"},PBe={badge:"All new",view:"See what's new",title:"What's new",defaultNotes:{multiRegion:"Multi-region agents: load Beijing and Shanghai Runtimes in parallel, with more available as you scroll.",switchAgent:"Switch in conversation: choose an agent beside the composer and start a new conversation immediately.",visualCanvas:"Visual execution canvas: inspect multi-agent structures on a horizontal canvas with fullscreen support."}},NBe={label:"New conversation workspace",agent:"Agent",skill:"Skill customization",video:"Video creation"},BBe={select:"Select conversation mode",agent:{label:"Agent",description:"Chat with the selected Agent"},builtin:{label:"Built-in Agent",description:"Use an Agent provided by the platform"},codex:{label:"Codex Agent",description:"Run tasks in a sandbox"},deepseekHarness:{label:"DeepSeek Harness",description:"Open the DeepSeek Harness workspace"},arkClaw:"ArkClaw",hermes:"Hermes Agent",checking:"Checking configuration",notConfigured:"Not configured by an administrator",unavailable:"Unavailable"},$Be={select:"Select Agent",typesLabel:"Agent types",listLabel:"{{type}} list",types:{agent:"Agent",general:"General Agent",codex:"Codex Agent",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw Agent",hermes:"Hermes Agent"},loading:"Loading Agents",reload:"Reload",empty:"No {{type}} yet",emptyLocal:"No local Agents yet",emptyGeneral:"No General Agents yet",createHint:"Create one from the Agents page",localHint:"Check the directory where Studio was started",waking:"Waking up",opening:"Opening",connecting:"Connecting",loadingMore:"Loading",loadMore:"Load more",runtimeTimeout:"Loading Agents timed out after 15 seconds. Check the network or Runtime service and retry.",loadGeneral:"Load General Agents",loadType:"Load {{type}}",connectGeneral:"Connect to General Agent",openLocal:"Open local Agent",openType:"Open {{type}}"},FBe={spaceAria:"Skill spaces",configuration:"Skill customization settings",actions:{create:"Generate Skill",optimize:"Optimize Skill"},selectAction:"Select a Skill customization action",actionList:"Skill customization actions",style:"Style",selectStyle:"Select style",model:"Model",selectModel:"Select model",styles:{concise:"Concise and practical",strict:"Rigorous and reliable",tutorial:"Tutorial-friendly",automation:"Automation-first"},modelLoadFailed:"Failed to load model configuration",spaceLoadFailed:"Failed to load Skill Spaces",skillLoadFailed:"Failed to load Skills",unnamedSpace:"Unnamed Skill Space",space:"Skill Space",select:"Select Skill",selectAria:"Select Skill: {{skill}}",loadingSpaces:"Loading Skill Spaces",reload:"Reload",emptySpaces:"No Skill Spaces yet",skillList:"{{space}} Skill list",loadingSkills:"Loading Skills",emptySkills:"No Skills yet"},zBe={modes:{auto:"Auto detect",text_to_video:"Text to video",reference_to_video:"Reference to video",video_editing:"Video editing",video_extension:"Video extension",first_last_frame:"First and last frames"},taskNames:{auto:"Video generation",text_to_video:"Text-to-video",reference_to_video:"Reference-to-video",video_editing:"Video editing",video_extension:"Video extension",first_last_frame:"First-and-last-frame generation"},controls:{label:"Video creation settings",aspectRatio:"Aspect ratio",selectAspectRatio:"Select aspect ratio",resolution:"Resolution",selectResolution:"Select resolution",duration:"Duration",durationShort:"{{count}}s",durationAria:"Video duration: {{count}} seconds",lastFrame:"Last frame",lastFrameHelper:"Add the video's ending frame",assistImage:"Supporting image",referenceImage:"Reference image",assistImageHelper:"Add visual guidance",imageHelper:"Supports common image formats",referenceVideo:"Reference video",videoHelper:"Supports common video formats",optional:"Optional",replace:"Replace",add:"Add",upload:"Upload {{label}}",replaceFile:"Replace {{label}}: {{name}}",removeFile:"Remove {{label}} {{name}}",storageUnavailable:"Persistent storage is not configured",loadingEnhancer:"Loading prompt enhancement model",enhancerHint:"Uses {{model}} for intent recognition and prompt enhancement",enhancerUnavailable:"Prompt enhancement model unavailable"},task:{title:"Video generation task",closeAria:"Close video generation task dialog",progressAria:"Video generation progress",optimizedPrompt:"Optimized prompt",processingAria:"{{task}} progress",waitingAria:"{{status}}, elapsed {{elapsed}}",elapsed:"Elapsed {{elapsed}}",previewAria:"Generated video preview",close:"Close",download:"Download video",retryOptimization:"Retry prompt optimization",retryGeneration:"Retry video generation",providerQueued:"Waiting for model scheduling",providerRunning:"Model generating",providerSubmitting:"Submitting task",queuedHint:"The task was submitted. Its status will update automatically when processing begins.",runningHint:"This may take several minutes. The video preview will appear here when complete.",backgroundHint:"You can close this dialog. The task will continue in the background.",successHint:"Your video is ready to preview or download.",activationHint:"Activate the service in the model console, then retry generation.",retryHint:"Fix the issue and retry the current step.",steps:{optimizationFailed:"Prompt optimization failed",optimizationDone:"Prompt optimization complete",optimizationActive:"Optimizing prompt",generationDone:"{{task}} complete",generationFailed:"{{task}} failed",generationQueued:"{{task}} queued",generationRunning:"Generating {{task}}",generationActive:"{{task}} in progress",generationPending:"Waiting for video generation",generationComplete:"Video generation complete"},elapsedHours:"{{hours}}h {{minutes}}m",elapsedMinutes:"{{minutes}}m {{seconds}}s",elapsedSeconds:"{{seconds}}s"}},Ytr=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:$Be,compactSelect:IBe,default:{compactSelect:IBe,featureNotice:PBe,workspace:NBe,mode:BBe,agentPicker:$Be,skill:FBe,video:zBe},featureNotice:PBe,mode:BBe,skill:FBe,video:zBe,workspace:NBe},Symbol.toStringTag,{value:"Module"})),UBe={cancel:"Cancel",close:"Close",retry:"Retry",tryAgain:"Try again",closeDialog:"Close {{title}}",agentFallback:"{{agent}} Agent",unknownSource:"Unknown source"},VBe={terminalTitle:"Terminal",browserTitle:"Sandbox browser",terminalSubtitle:"Connect to the interactive terminal for the current AgentKit Session",browserSubtitle:"View and control the browser in the current AgentKit Session",connecting:"Connecting…",connected:"Connected",notConnected:"Not connected",opening:"Opening {{title}}",connectingSession:"Connecting the tool to the current AgentKit Session.",openFailed:"Failed to open {{title}}"},QBe={title:"Resume Codex conversation",subtitle:"Select a recently updated Thread from the current Sandbox Session",loading:"Loading conversation history",loadFailed:"Failed to load conversation history",empty:"No conversations to resume"},GBe={title:"Codex permissions",subtitle:"Settings are saved to the current Sandbox Session and applied to all of its Threads",sandboxMode:"Sandbox mode",approvalPolicy:"Approval policy",approvalMethod:"Approval method",networkAccess:"Allow network access",networkAccessHelp:"Control external network access in workspace-write and read-only modes.",fullAccessWarning:"Full access disables file system and network isolation. Use it only for trusted tasks.",save:"Save permissions",sandboxChoices:{readOnly:{label:"Read only",detail:"Allow reading files without writing to the workspace."},workspaceWrite:{label:"Workspace write",detail:"Allow reading and modifying files in the current workspace."},fullAccess:{label:"Full access",detail:"Disable sandbox isolation for explicitly trusted tasks."}},approvalChoices:{untrusted:{label:"Untrusted commands only",detail:"Request approval only for operations Codex considers untrusted."},onRequest:{label:"On request",detail:"Allow Codex to ask you to approve commands or file changes when needed."},never:{label:"Never ask",detail:"Codex will not pause to request manual approval."}},reviewerChoices:{user:{label:"Ask me",detail:"Approval requests appear in Studio for you to decide."},autoReview:{label:"Automatic review",detail:"Use the Codex automatic review flow to handle approval requests."}}},HBe={title:"Workspace",subtitle:"Choose the directory where the current Codex Thread runs commands and modifies files",absolutePath:"Absolute path",browse:"Browse",parent:"Parent directory",empty:"This directory has no subdirectories",locked:"The conversation has started and the workspace is locked. Start a new Sandbox Session to choose another workspace.",useDirectory:"Use this directory"},WBe={fileTitle:"Allow file changes?",commandTitle:"Allow command execution?",subtitle:"Codex is waiting for your decision",workingDirectory:"Working directory",decline:"Decline",acceptOnce:"Allow once",acceptSession:"Allow for session"},YBe={availableSkills:"Available Skills",selectModel:"Select model",commands:"Codex shortcuts",currentModel:"Current: {{model}}",loadingSkills:"Discovering Skills in the current workspace…",loadingModels:"Loading models…",noSkillMatches:"No matching Skills in the current workspace",noModelMatches:"No matching models. You can also enter a model ID directly",noCommandMatches:"No matching shortcuts",skillFallback:"Load and run this Skill",add:"Add",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",openTerminal:"Open terminal",viewBrowser:"View browser",permissions:"Codex permissions",workspaceLocked:"The conversation has started and the workspace is locked",selectWorkspace:"Select workspace",workspace:"Codex workspace",endpointCopied:"Endpoint copied",copyEndpoint:"Copy Sandbox Endpoint",continuePlaceholder:"Describe what you want to implement or adjust next",messagePlaceholder:"Message the AgentKit Sandbox. Type / for commands or $ to invoke a Skill…",stop:"Stop generating",send:"Send"},qBe={defaultName:"My Agent",namedDefault:"My {{agent}}",creatingTitle:"Creating {{agent}} Agent",failedTitle:"Launch failed",createTitle:"Create {{agent}} Agent",fallbackError:"AgentKit Sandbox initialization failed. Please try again later.",creatingDescription:"Creating the {{agent}} Agent and waiting for it to become ready. This usually takes about 30 seconds.",name:"Agent name",storageSize:"Storage size",storageHelp:"Data will be persisted. Choose {{min}}–{{max}} GiB.",persistent:"Persistent",persistenceUnsupported:"Snapshot persistence is not supported in the current environment",persistentHelp:"Keep Agent data so you can continue later.",temporaryHelp:"Agent data will be cleared after 8 hours",cancelCreation:"Cancel creation",confirm:"Create",retry:"Try again"},jBe={activeAria:"Codex Agent session is active",openAria:"Open a Codex Agent session",active:"Codex Agent session",entry:"Spark an idea",exit:"Exit current Agent",expired:"Expired",remainingHours:"{{hours}}h {{minutes}}m remaining",remainingMinutes:"{{minutes}}m remaining",expiryWarning:"The remote development environment is kept for up to 8 hours and expires at {{expiry}} ({{remaining}}). Conversations and files will then be deleted.",usingAgent:"You are currently using the {{agent}} Agent",activityAria:"Sandbox activity log",activity:"Activity log",tokenUsageAria:"Codex token usage",tokens:"{{label}}: {{value}} tokens",tokenLabels:{total:"Total",input:"Input",cachedInput:"Cached input",output:"Output",reasoningOutput:"Reasoning output"}},XBe={back:"Back to Agents",subtitle:"{{agent}} AgentKit Session details",type:"Agent type",status:"Status",createdBy:"Created by",snapshotStatus:"Snapshot status",toolType:"Tool type",createdAt:"Created at",snapshotReason:"Snapshot reason",expiresAt:"Expires at",snapshotId:"Snapshot ID",sessionId:"Session ID",sourceSessionId:"Source Session ID",delete:"Delete Agent",waking:"Waking…",opening:"Opening…",wake:"Wake Agent",open:"Open Agent",deleteTitle:"Delete Agent?",deleteDescription:"This will delete “{{name}}” and its AgentKit {{resource}}. This action cannot be undone.",deleting:"Deleting…",confirmDelete:"Delete"},KBe={back:"Back to Agents",createdBy:"Created by {{creator}}",ariaLabel:"Agent workspace",main:"Main",terminal:"Terminal",mainTitle:"{{agent}} main interface",openingTerminal:"Opening terminal…",terminalTitle:"{{agent}} terminal"},ZBe={prompt:`Use the AgentKit Studio Plugin to hand off the current conversation, project, and task to the cloud. Execute this directly; do not ask me to open a terminal manually. +- Maintain a polite, professional tone.`},C8e={requestFailed:"Request failed ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"The server does not have cloud provider credentials configured, so AgentKit agent centers are unavailable",loginRequired:"Sign in to access AgentKit agent centers"},vikingKnowledge:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB knowledge bases are unavailable",loginRequired:"Sign in to access VikingDB knowledge bases"},vikingMemory:{credentialsMissing:"The server does not have cloud provider credentials configured, so VikingDB memory stores are unavailable",loginRequired:"Sign in to access VikingDB memory stores"},mcpGateway:{missingHttpTool:"Go back to Add MCP tool and add at least one HTTP MCP service. MCP resilience does not support stdio services.",missingUrl:"An HTTP MCP tool is missing a valid service URL. Go back to Add MCP tool and complete it before publishing."},customModel:{fallbackName:"Custom model",apiKeyLabel:"{{name}} model API Key"},deploymentEnv:{serverInjected:"Provided by the server",selectedApiKeyPlaceholder:"Provided by the selected API Key",mcpInjectedComment:"Provided by the added MCP tools",restoredPlaceholder:"Securely restored by the Studio server",generatedMcpPlaceholder:"Generated from the added HTTP MCP tools",restoredHelp:"When updating, the Studio server merges MCP addresses and authentication without returning existing secrets to the browser.",mergedMcpHelp:"The Studio server merges MCP addresses and optional authentication without returning existing secrets to the browser.",listSeparator:", ",requirementHint:"Required by the following optimizations: {{labels}}.",requiredBy:"Required by the following optimizations: {{labels}}. Enter {{key}}.",required:"Enter {{label}} ({{key}}).",invalidJson:"Invalid JSON format"},drafts:{unsupportedVersion:"This local draft version is not supported. Upgrade Studio and try again.",invalidFormat:"The local draft data is invalid.",readFailed:"Could not read local drafts. The browser data may be corrupted.",quotaExceeded:"Browser storage is full, so the draft was not saved. Delete unused drafts or clear this site's storage, then try again.",writeRejected:"The browser blocked saving this draft. Check the site's storage permissions and try again."},skills:{searchFailed:"Search failed ({{status}})",downloadFailed:"Skill download failed ({{status}})",agentKitRequestFailed:"AgentKit Skills request failed",missingManifest:"{{location}} is missing SKILL.md",invalidParentPath:"{{location}} contains an invalid parent path (..): {{path}}",invalidPath:"{{location}} contains an invalid path: {{path}}",localDescription:"Local skill",folderSource:"Folder",noManifest:"No SKILL.md was found in {{location}}"},zip:{invalid:"Invalid zip: EOCD was not found",tooManyFiles:"A zip file cannot contain more than {{count}} files",tooLarge:"The extracted zip content is too large"}},O8e={back:"Back to development session",runtimeName:"Runtime name",runtimeNameExists:"This Runtime name already exists. Choose another name.",checkingRuntimeName:"Checking Runtime name",verifiedSource:"Verified source",deployableSource:"Deployable source",verifiedByCodex:"Verified by Codex in the cloud",entryPoint:"Entry point",files:"Files",artifact:"Artifact",validationReport:"Validation report",verifiedHint:"The server materializes source from the verified artifact. Browser files cannot replace it.",unverifiedHint:"The server securely materialized the source. Confirm the Runtime configuration before deploying.",env:{requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}"}},k8e={name:"Code package",back:"Back to creation methods",reading:"Reading the code package",readingEllipsis:"Reading the code package…",uploadFirst:"Upload a code package first",uploadAriaLabel:"Code package upload",upload:"Upload code package",reupload:"Upload a different code package",uploadPrompt:"Upload a code package",filesRecognized:"{{count}} files found. Select this area to upload a different package.",dropHint:"Select or drop a .zip file up to 50 MB. Use app.py or declare an entry point in agentkit.yaml.",viewFiles:"View files",chooseFile:"Choose code package",errors:{invalidFormat:"Choose a .zip code package.",tooLarge:"The code package must be 50 MB or smaller.",invalidPath:"The archive contains an invalid path: {{name}}",empty:"The archive does not contain any deployable files.",tooManyFiles:"A code package cannot contain more than {{count}} files.",duplicateFile:"The code package contains a duplicate file: {{path}}",manifestParse:"Could not parse agentkit.yaml: {{detail}}",manifestRoot:"The root of agentkit.yaml must be an object.",manifestCommon:"common in agentkit.yaml must be an object.",entryPointType:"common.entry_point in agentkit.yaml must be a file path.",entryPointInvalid:"common.entry_point in agentkit.yaml is not a valid file path.",entryPointMissing:"The entry point declared in agentkit.yaml is missing from the code package: {{entryPoint}}",defaultEntryPointMissing:"The code package root must contain app.py, or common.entry_point in agentkit.yaml must declare an existing entry point."}},E8e={label:"Agent execution canvas",readOnlyLabel:"Read-only agent execution canvas",minimapLabel:"Execution flow minimap",controls:{ariaLabel:"Execution flow controls",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Fit view"},rootAgent:"Main agent",unnamedStep:"Unnamed step",terminals:{input:"User request",output:"Final response"},edges:{then:"Then",continueLoop:"Continue loop",call:"Call"},patterns:{llm:{label:"Agent",description:"Understand a task and complete one specific job"},sequential:{label:"Sequential",description:"Run internal steps one after another"},parallel:{label:"Parallel",description:"Run internal steps together, then combine their results"},loop:{label:"Loop",description:"Repeat internal steps until the stop condition is met"},a2a:{label:"Remote agent",description:"Call an existing remote agent"}},actions:{insertHere:"Insert a step here",deleteNamed:"Delete {{name}}",deleteNode:"Delete node",addSubagent:"Add subagent",addParallelStep:"Add a parallel step",addLoopStep:"Add a loop step",addNextStep:"Add next step",addFirst:"Add at the beginning",addLast:"Add at the end"}},_8e={title:"Intelligent mode",subtitle:"Describe your goal and Codex will plan, build, debug, and temporarily validate the agent in a sandbox.",model:{label:"Model",placeholder:"Select a model",retiring:"Retiring soon",currentConfiguration:"Current configuration",loadError:"Failed to load models"},availability:{checking:"Checking intelligent development availability…",unavailable:"Intelligent mode is currently unavailable. Go back and try again."},goal:{title:"Start with a goal",continueTitle:"Continue improving the project",hint:"Describe the problem your agent should solve. We will ask about any details that could affect the result.",continueHint:"Describe what you want to change. The result will be saved as a new version.",basedOn:"Based on",clearSelection:"Clear selection",label:"Goal",optimizationLabel:"Optimization goal",placeholder:"For example: Build an agent that reads sales data, creates weekly reports, and validates the output format",optimizationPlaceholder:"For example: Cite data sources and ask the user when information is incomplete"},actions:{preparing:"Preparing…",build:"Start building",optimize:"Start optimizing"},preparation:{accepted:"Goal received. Implementation is starting now.",preparing:"Creating the task environment…",starting:"Environment ready. Starting Codex…",next:"Next, Codex will plan the approach, then build, run, and validate the agent."}},R8e={title:"Saved projects",description:"Continue improving an existing version, or view, download, and deploy its source.",refresh:"Refresh projects",checkingStorage:"Checking project storage…",unavailableTitle:"Projects are temporarily unavailable",storageCheckError:"Could not confirm project storage status. Try again shortly.",storageNotConfigured:"Project storage is not configured.",loadingMigrated:"Loading migrated projects…",loadingSaved:"Loading saved projects…",loadingVersions:"Loading project versions…",unknownTime:"Unknown time",sourceDownloaded:"Source downloaded.",projectSummary_one:"{{count}} version · Updated {{time}}",projectSummary_other:"{{count}} versions · Updated {{time}}",versionSummary_one:"{{time}} · {{count}} file",versionSummary_other:"{{time}} · {{count}} files",noVersionDescription:"No version description",latestVersion:"Latest version",verified:"Verified",pendingVerification:"Needs review",viewSource:"View source",download:"Download",downloading:"Downloading…",optimize:"Optimize",optimizeUnavailable:"Optimize, not supported",errors:{projects:"Could not load saved projects.",source:"Could not load project source.",versions:"Could not load project versions.",download:"Could not download the source.",prepareDeployment:"Could not prepare the source for deployment.",deleteVersion:"Could not delete the project version.",migrated:"Could not load migrated projects",saved:"Could not load saved projects"},empty:{migratedTitle:"No migrated projects yet",savedTitle:"No saved projects yet",migratedDescription:"Source will be saved here after your first migration.",savedDescription:"Source will be saved here after your first build.",noVersions:"This project has no available versions."},compare:{selected:"{{count}}/2 selected",selectedLabel:"Selected",select:"Select",view:"View comparison",start:"Compare versions"},delete:{title:"Delete this version?",onlyVersion:"“{{name}}” has only one version. Deleting it will also remove the project. This cannot be undone.",description:"This version's source and validation records will be permanently deleted. Other versions are not affected.",confirm:"Delete version"}},D8e={title:"Choose how to create",subtitle:"Build your agent with the workflow that fits your needs",features:"Features",quick:{title:"Quick mode",description:"Delegate tasks to dynamically created subagents",features:{dynamicSubagents:"Dynamic subagents",autonomousPlanning:"Autonomous planning",collaboration:"Multi-agent collaboration",summary:"Automatic result summaries",skills:"Skills on demand",trace:"Traceable task execution"}},traditional:{title:"Advanced mode",description:"Customize your agent structure in detail",features:{visualConfig:"Visual configuration",migration:"Existing agent migration",debugging:"Live debugging",optimization:"Optional optimization",parameters:"Fine-grained controls"}}},L8e={placeholder:"Enter a system prompt. Type ## followed by a space to add a level-two heading…",toolbar:{undo:"Undo {{shortcut}}",redo:"Redo {{shortcut}}",paragraph:"Paragraph",quote:"Quote",heading:"Heading {{level}}",selectBlockType:"Select text style",blockType:"Text style",bold:"Bold",removeBold:"Remove bold",italic:"Italic",removeItalic:"Remove italic",bulletedList:"Bulleted list",numberedList:"Numbered list"}},M8e={local:{duplicatesSkipped:"Skipped duplicate skills: {{names}}",invalidDrop:"Drop a folder containing SKILL.md or a .zip file",readError:"Could not read the files: {{detail}}",dropLabel:"Drop a folder or ZIP file to detect skills automatically",hint:"Each skill must contain a SKILL.md file. Directories can contain multiple skills.",reading:"Reading files…",fileCount:"Local · {{count}} files"},hub:{searchError:"Search failed. Try again shortly.",searchPlaceholder:"Search Volcano Find Skill, such as data analysis or PDF",search:"Search",searching:"Searching…",noResults:"No matching skills found. Try another keyword.",hint:"Search Volcano Find Skill by keyword. Selected skills are downloaded to the skills/ directory when the project is generated."},space:{loadError:"Failed to load",loadingSpaces:"Loading AgentKit Skills centers…",noSpaces:"This account has no AgentKit Skills centers.",selectSpace:"Select an AgentKit Skills center",openConsole:"Open in the Volcano Engine console",loadingSkills:"Loading skills…",noSkills:"This AgentKit Skills center has no skills."}},I8e={unnamedNode:"Unnamed node",editInstruction:"Select to edit instructions…",controls:{ariaLabel:"Workflow canvas controls",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Fit view"},sections:{info:"Workflow information",execution:"Execution mode",nodes:"Nodes",nodeConfig:"Node configuration"},types:{sequential:{label:"Sequential",description:"Run nodes one after another"},parallel:{label:"Parallel",description:"Run nodes at the same time"},loop:{label:"Loop",description:"Run nodes repeatedly"}},placeholders:{description:"Describe what this workflow does…",agentDescription:"Describe what this agent does…",instruction:"You are…"},errors:{workflowNameUnique:"The workflow name must be unique among agent node names",agentNameUnique:"Agent names must be unique within this workflow"},dragHint:"Drag onto the canvas, or use the button below",agentNode:"Agent node",addNode:"Add node",connectHint:"Drag between node handles to define the execution order.",create:"Create workflow",deleteNode:"Delete node",nameHelp:"Use only letters, numbers, and underscores. Names must be unique.",instruction:"Instructions",tools:"Tools (comma-separated)",nodeId:"Node ID",empty:{selectNode:"Select a node to edit its configuration",summary:"{{nodes}} nodes · {{edges}} connections"}},P8e={ariaLabel:"Quick mode creation",progress:"Quick mode creation progress",steps:{agent:{label:"Agent",title:"Basic information",description:"Set the agent's name, purpose, behavior, and capabilities"},environment:{label:"Environment",title:"Configure the environment",description:"Choose the default environment or a custom environment you have built"},deployment:{label:"Deployment",title:"Deployment preferences",description:"Configure AgentKit cloud settings"}},model:{label:"Model",source:"Model source",name:"Model name",provider:"Provider",volcengineArk:"Volcano Ark",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",currentApiKey:"Current API Key",loadingApiKeys:"Loading API Keys",selectApiKey:"Select an API Key",searchApiKeys:"Search API Key names",noApiKeys:"No API Keys available",loadingModels:"Loading models",selectModel:"Select a model",searchModels:"Search by name, Model ID, or provider",noModels:"No models available",apiKeyPlaceholder:"Enter a model API Key",credentialsLoadError:"Failed to load model credentials",modelsLoadError:"Failed to load models"},identity:{unnamedPool:"Unnamed user pool",currentPool:"{{value}} (current user pool)",userPool:"User pool",loading:"Loading user pools",placeholder:"Select a user pool",search:"Search user pools",empty:"This account has no Identity user pools",currentHint:"This Studio's login JWT will be forwarded to the Runtime",mismatchHint:"The selected user pool is not used by this Studio, so the Studio will not be able to call the Runtime after deployment",selectionHint:"The user pool used by this Studio is marked in the list"},agent:{namePlaceholder:"Enter an agent name",descriptionPlaceholder:"Describe what this agent can do",prompt:"Prompt",promptPlaceholder:"Define the role, goals, and behavior boundaries",skills:"Skills",addSkill:"Add skills"},validation:{descriptionRequired:"Enter a description",promptRequired:"Enter a prompt",modelRequired:"Select a model",instanceIntegers:"Minimum instances must be an integer of 0 or greater, and maximum instances must be an integer greater than 0",instanceOrder:"Minimum instances cannot exceed maximum instances",userPoolRequired:"Select a user pool for Runtime authentication"},deployment:{runtimeName:"Runtime name",runtimeNameUpdateHint:"The existing Runtime name is preserved during updates",runtimeNameHint:"Use only letters, numbers, underscores, and hyphens",region:"Deployment region",authentication:"Authentication",apiKeyDescription:"Default: access with the Runtime API Key",userPoolDescription:"Use a JWT issued by an Identity user pool",sessionStorage:"Session storage",inMemoryStorage:"Temporary in-memory storage",backends:{sqlite:"SQLite file",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",inMemoryHint:"To prevent session loss across instances, keep the Runtime at 1–1 instances",networkMode:"Network mode",network:{public:"Public",private:"Private",both:"Public and private"},subnetIds:"Subnet IDs (optional, comma-separated)",sharedInternet:"Shared public egress in the VPC",sharedInternetHint:"Allow private Runtimes to access the public internet through shared egress",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",evaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment",resources:"Resource configuration",complete:"Deployment complete",preparing:"Preparing deployment…"},environmentVariables:{title:"Environment variables",add:"Add variable",nameAriaLabel:"Environment variable name",valueAriaLabel:"Value for {{name}}",deleteNamed:"Delete {{name}}"},actions:{updateAgain:"Update again",deployAgain:"Deploy again",updateAndPublish:"Update and publish"}},N8e={actions:{addSubagent:"Add subagent",clearRoot:"Clear main agent",clearRootConfirmation:"Clear all settings and subagents from the main agent? This cannot be undone."},workspace:{progress:"Agent creation progress",modes:{build:"Build",validate:"Debug",optimize:"Optimize",environment:"Environment",publish:"Publish"},titles:{build:"Customize your agent architecture",validate:"Debug your agent",optimize:"Choose optimizations for your agent",environment:"Configure the cloud environment",publish:"Prepare your agent for deployment"}},sections:{type:{label:"Agent type",hint:"Choose an agent type"},basic:{label:"Basic information",hint:"Name, description, and system prompt"},model:{label:"Model",hint:"Model and service (optional)"},tools:{label:"Tools",hint:"Callable capabilities"},skills:{label:"Skills",hint:"Declarative skills"},knowledge:{label:"Knowledge base",hint:"External knowledge retrieval"},memory:{label:"Memory",hint:"Short-term and long-term memory"},subagents:{label:"Subagents",hint:"Nested collaboration"},review:{label:"Finish",hint:"Preview and create"}},agentTypes:{ariaLabel:"Agent type",remoteChildOnly:"Remote agents can only be used as child steps",llm:{label:"Agent",fullLabel:"LLM agent",description:"Uses an LLM to complete tasks autonomously"},sequential:{label:"Sequential",fullLabel:"Sequential agent",description:"Runs subagents one after another"},parallel:{label:"Parallel",fullLabel:"Parallel agent",description:"Runs subagents in parallel, then combines their results"},loop:{label:"Loop",fullLabel:"Loop agent",description:"Repeats subagents until the stop condition is met"},a2a:{label:"Remote agent",fullLabel:"Remote agent",description:"Calls a remote agent through the A2A protocol"}},basic:{agentName:"Agent name",name:"Name",agentDescription:"Agent description",descriptionPlaceholder:"Briefly describe what this agent does so your team can identify it…",nameHelp:"Follow Google ADK naming rules and keep the name unique in the execution flow.",rootDescriptionHelp:"The full description is preserved and converted to a Runtime-compatible single line during deployment.",descriptionHelp:"The description appears in agent lists and selectors.",orchestratorHelp:"This is a collaboration container and does not answer directly. Add task steps on the canvas and drag them to reorder.",maxIterations:"Maximum iterations",maxIterationsHelp:"The loop repeats its subagents until the condition is met or this limit is reached.",agentCenter:"AgentKit agent center",agentCenterHelp:"The remote agent's name, description, and capabilities come from the Agent Card returned by the center. The system discovers and attaches matching agents for each task.",moreOptions:"More options",systemPrompt:"System prompt",loadingMarkdown:"Loading Markdown editor…",markdownHelp:"Markdown shortcuts are supported. For example, type ## followed by a space to create a level-two heading.",unnamed:"Unnamed",unnamedAgent:"Unnamed agent"},validation:{remoteRoot:"A remote agent can only be a subagent",missingRegistry:"Select an AgentKit agent center",name:{required:"Name is required",reserved:"user is reserved by Google ADK. Choose another name.",characters:"Start with a letter or underscore and use only letters, numbers, and underscores"},duplicateName:"Agent names must be unique within this structure",missingDescription:"Description is required",mcpAuthRequired:"Confirm how to handle authentication after changing the MCP address",mcpDuplicateName:"MCP names must be unique",mcpDuplicateUrl:"Remove the duplicate MCP endpoint before publishing",missingSubagent:"A subagent is required",missingPrompt:"System prompt is required",missingSubagentDetail:"Add at least one subagent to {{type}} before debugging or publishing.",problem:"{{name}}: {{problem}}"},ai:{ariaLabel:"Fill agent configuration with AI",minimumLength:"Enter at least {{count}} characters.",replaceConfirmation:"The generated configuration will replace the current canvas and settings. Continue?",placeholder:"Describe your goal and use {{model}} to generate the configuration",generate:"Generate",generating:"Generating",success:"Configuration generated",regenerate:"Generate again",failed:"Generation failed"},debug:{ariaLabel:"Agent debugging workspace",unavailable:"This backend does not currently support generated-agent debug runs.",baseline:"Baseline",comparison:"Variant {{count}}",selectModel:"Select a model",enterDescription:"Enter a description",enterPrompt:"Enter a system prompt",duplicateConfiguration:"Test configurations must be unique",starting:"Starting…",applyAndRestart:"Apply and restart",restart:"Restart",start:"Start environment",defaultModel:"Default model",testConfiguration:"Test configuration",deleteVariant:"Delete {{name}}",deleteVariantGroup:"Delete comparison variant",creatingEnvironment:"Creating the test environment…",configurationChanged:"The configuration changed. Restart the environment.",ready:"Environment ready",readyHint:"Send a message to compare agent responses.",startHint:"Complete the configuration, then start the environment.",viewTraceNamed:"View the trace for {{name}}",traceUnavailable:"Send a message to view its trace",trace:"Trace",useConfiguration:"Use this configuration",finishConfiguration:"Finish configuration",finishAndStart:"Finish and start",currentAgentModel:"Current agent model",configurationHint:"Changes apply only to this comparison. Select this configuration to continue to deployment.",messagePlaceholder:"Send a message to the running test environments…",startOneFirst:"Start at least one test environment first",addVariant:"Add variant",traceTitle:"Trace · {{name}}",leaveTitle:"Leave debugging?",leaveDescription:"The current environments will be removed when you leave. You can start new environments when you return.",cleaning:"Cleaning up…",confirmLeave:"Leave",closeLeaveConfirmation:"Close leave-debugging confirmation"},optimization:{ariaLabel:"Agent optimization options",scenario:"Optimization scenario",components:"Optimization components",bytePlusUnavailable:"Harness Sidecar optimizations are not available for BytePlus accounts yet. Leave all optimizations unselected to continue; regular BytePlus agents are not affected.",releaseScenario:"Optimization scenario: {{profile}}",profiles:{default:{label:"Custom",description:"Choose components as needed. The Sidecar stays off when none are selected."},ops:{label:"Operations",description:"For operations diagnostics, databases, logs, and monitoring MCP servers."}},groups:{quality:"Improve response quality",cost:"Reduce runtime cost",stability:"Improve runtime stability"},options:{context_engine:{label:"Context management",description:"Manage context assembly, task anchoring, and context budgets."},compressor:{label:"Context and result compression",description:"Compress long context and large tool results to reduce token usage."},verifier:{label:"Response verification and repair",description:"Verify evidence and responses, then repair or alert on failure."},long_run_control:{label:"Goal task control",description:"Manage progress, continuation, and completion conditions for Goal tasks."},mcp_resilience:{label:"MCP resilience",description:"Manage connections, timeouts, empty results, large responses, and call budgets. Includes read-only SQL protection by default."}}},model:{label:"Model",source:"Model source",volcanoArk:"Volcano Ark",volcengineArk:"Volcano Ark",bytePlusModelArk:"BytePlus ModelArk",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",configuration:"Model configuration",name:"Model name",provider:"Provider",liteLlmProviders:"LiteLLM providers",apiKeyPlaceholder:"Enter the model API Key",available:"Available",retiring:"Retiring soon",notActivated:"Not activated",unavailable:"Unavailable",apiKeyLoadError:"Failed to load Ark API Keys",loadingApiKeys:"Loading API Keys…",selectApiKey:"Select an API Key",currentApiKey:"Current API Key",apiKeyList:"API Key list",searchApiKey:"Search API Keys",searchApiKeyName:"Search API Key names",noApiKeys:"No API Keys available",noMatchingApiKey:"No matching API Keys",loading:"Loading models…",loaded:"{{count}} models loaded",loadError:"Failed to load models",selectModel:"Select a model",selectProviderModel:"Select a provider model",providerModels:"Provider models",search:"Search models",searchPlaceholder:"Search by name, Model ID, or provider",noMatches:"No matching models",empty:"No models available",unknownStatus:"Unknown status",refresh:"Refresh",refreshing:"Refreshing…",activate:"Activate",activateAction:"Open activation",currentConfiguration:"Current configuration"},tools:{builtIn:"Built-in tools",builtInHelp:"Select VeADK capabilities. Imports and required environment variables are added automatically.",codeExecution:"Code execution configuration",codeExecutionHelp:"Select the AgentKit code execution sandbox.",mcp:"MCP tools"},catalog:{web_search:{label:"Web search",description:"Get real-time information with Volcengine Web Search."},parallel_web_search:{label:"Parallel web search",description:"Run multiple search queries in parallel and combine the results faster."},link_reader:{label:"Link reader",description:"Fetch and read the main content from a URL."},web_scraper:{label:"Web scraper",description:"Crawl webpages into structured data. Requires the Scraper service."},image_generate:{label:"Image generation",description:"Generate images from text with Doubao Seedream."},image_edit:{label:"Image editing",description:"Edit or transform images with Doubao SeedEdit."},video_generate:{label:"Video generation",description:"Generate videos from text or images with Doubao Seedance, including task status queries."},text_to_speech:{label:"Text to speech (TTS)",description:"Convert text to speech with Volcengine Speech."},run_code:{label:"Code execution",description:"Run code in a sandbox."},vesearch:{label:"VeSearch",description:"Search with Volcengine VeSearch. Requires a bot endpoint."},links:{console:"Console",documentation:"Documentation"},env:{modelAgentName:{comment:"Model name"},embeddingModelName:{comment:"Embedding model required by memory and knowledge bases"},vikingMemoryProject:{comment:"VikingDB memory project"},vikingMemoryRegion:{comment:"VikingDB memory region"},vikingMemoryType:{comment:"Memory types"},feishuAppId:{comment:"Feishu app ID"},feishuAppSecret:{comment:"Feishu app secret",placeholder:"Enter the app secret"},registrySpaceId:{comment:"AgentKit agent center",placeholder:"Select an agent center"},registryTopK:{comment:"Number of agents to retrieve"},registryRegion:{comment:"AgentKit agent center region"},registryEndpoint:{comment:"AgentKit agent center OpenAPI endpoint"},agentKitToolId:{comment:"Code execution sandbox ID"},agentKitToolRegion:{comment:"AgentKit Tools region"},openVikingUrl:{comment:"OpenViking service URL"},openVikingMemoryUserId:{comment:"Memory owner ID",help:"The user segment in viking://user//peers//memories. Use it to isolate agents, tenants, or business scenarios. The default is default."},openVikingMemoryPolicy:{comment:"Memory policy",help:"Controls memory extraction and isolation. Leave it blank to use the official default policy."},openVikingKnowledgeUserId:{comment:"Knowledge base owner ID",help:"Used in the default path viking://user//resources// when no resource directory is configured. The default is default."},openVikingTargetUri:{comment:"Knowledge base resource directory",help:"Leave blank to generate it from the KnowledgeBase index. When provided, this OpenViking resource directory takes precedence."},tlsServiceName:{comment:"TLS topic_id. Leave blank to create one automatically"}}},backends:{shortTerm:{local:{label:"In-memory",description:"Stored in the process without persistence. Best for development and debugging."},sqlite:{label:"SQLite file",description:"Persist data to a local .db file."},mysql:{label:"MySQL",description:"Persist data to MySQL."},postgresql:{label:"PostgreSQL",description:"Persist data to PostgreSQL."}},longTerm:{local:{label:"Local vector store",description:"In-process llama-index vector store."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},redis:{label:"Redis",description:"Vector retrieval with Redis."},viking:{label:"VikingDB Memory",description:"VikingDB memory with user profile support."},openviking:{label:"OpenViking Memory",description:"Long-term memory that stores and retrieves preferences, events, and entities per user."},mem0:{label:"Mem0",description:"Managed memory from Mem0."}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB knowledge base."},opensearch:{label:"OpenSearch",description:"Vector retrieval with OpenSearch."},context_search:{label:"Context Search",description:"Volcengine Context Search without embedding configuration."},openviking:{label:"OpenViking Knowledge",description:"OpenViking resource-directory knowledge base without embedding configuration."}}},exporters:{apmplus:{label:"APMPlus",description:"Volcengine APMPlus application performance monitoring."},cozeloop:{label:"CozeLoop",description:"Distributed tracing with CozeLoop."},tls:{label:"TLS (Log Service)",description:"Export logs to Volcengine TLS."}},knowledge:{title:"Knowledge base",description:"Enable external knowledge retrieval (RAG) so the agent can answer from your data.",backend:"Knowledge base backend",vikingDatabase:"VikingDB knowledge base"},memory:{shortTerm:"Short-term memory",shortTermDescription:"Store context for one session",shortTermBackend:"Short-term memory backend",longTerm:"Long-term memory",longTermDescription:"Store context across sessions, usually with vector retrieval",longTermBackend:"Long-term memory backend",vikingDatabase:"VikingDB memory",autoSave:"Save sessions to long-term memory automatically",autoSaveDescription:"Write session content to long-term memory when a session ends."},mcp:{removeTool:"Remove MCP tool",namePlaceholder:"Name (optional)",urlPlaceholder:"MCP service URL",pathWarning:"This address does not end with /mcp. Confirm that it is the complete MCP service URL.",configuredPlaceholder:"Authentication is stored securely",tokenPlaceholder:"Bearer token (optional)",changedUrlWarning:"The MCP address changed. Choose how to handle the stored authentication.",reuseCredential:"Keep using it",replaceCredential:"Replace authentication",noAuth:"Use no authentication",reuseHint:"The stored authentication will be reused when you publish.",changeToReplace:"Replace instead",credentialConfigured:"Studio securely stores the authentication.",removeCredential:"Remove authentication",commandPlaceholder:"Command, such as npx",argsPlaceholder:"Arguments separated by spaces",stdioHint:"The stdio tool starts in the deployment environment. Make sure its command and dependencies are available.",addTool:"Add MCP tool"},resources:{unnamedAgentCenter:"Unnamed agent center",unnamedKnowledgeBase:"Unnamed knowledge base",unnamedMemory:"Unnamed memory store",loadError:"Failed to load",loadingAgentCenters:"Loading agent centers…",agentCentersLoaded:"{{count}} agent centers loaded",noAgentCenters:"No agent centers available",noMatchingAgentCenters:"No matching agent centers",searchAgentKitCenter:"Search AgentKit agent centers",searchNameOrId:"Search by name or ID",selectAgentCenter:"Select an agent center",selectAgentKitCenter:"Select an AgentKit agent center",selectedAgentCenter:"Selected agent center",agentKitCenter:"AgentKit agent center",refreshAgentCenters:"Refresh agent centers",knowledgeBaseList:"Knowledge base list",knowledgeBasePlaceholder:"Select a knowledge base",loadingKnowledgeBases:"Loading knowledge bases…",knowledgeBasesLoaded:"{{count}} knowledge bases loaded",noKnowledgeBases:"No knowledge bases available",noMatchingKnowledgeBases:"No matching knowledge bases",searchKnowledgeBase:"Search knowledge bases",selectKnowledgeBase:"Select a knowledge base",refreshKnowledgeBases:"Refresh knowledge bases",memoryList:"Memory store list",memoryPlaceholder:"Select a memory store",loadingMemories:"Loading memory stores…",memoriesLoaded:"{{count}} memory stores loaded",noMemories:"No memory stores available",noMatchingMemories:"No matching memory stores",searchMemory:"Search memory stores",selectMemory:"Select a memory store",refreshMemories:"Refresh memory stores"},env:{noAdditionalParameters:"This backend needs no additional runtime parameters.",invalidJson:"Enter valid JSON.",helpAriaLabel:"Help for {{label}}: {{help}}",openOpenViking:"Open OpenViking {{label}}",valuePlaceholder:"Enter a value",openVikingIndex:"OpenViking resource index",openVikingIndexHelp:"Leave blank to generate an index from the agent name, such as my_agent_kb. Without DATABASE_OPENVIKING_TARGET_URI, the default URI is viking://user/{knowledge base owner ID, or default}/resources/{resource index}/. When DATABASE_OPENVIKING_TARGET_URI is set, that complete URI is used instead.",openVikingIndexAriaLabel:"OpenViking resource index help: {{help}}"},deployment:{vpcRequired:"Enter a VPC ID when using VPC networking.",apiKeyRequired:"Select the API Key used by the model.",invalidEnvName:"Invalid environment variable name: {{key}}",requiredEnv:"{{name}}: enter this required environment variable",generatingConfiguration:"Generating deployment configuration",runtimeNameExists:"This Runtime name already exists. Choose another name and try again.",preparing:"Preparing deployment",complete:"Deployment complete",failed:"Deployment failed",updateAndPublish:"Update and publish",stages:{build:"Build image",deploy:"Deploy Runtime",publish:"Publish service",running:"Deploying"}},publish:{generating:"Generating publish configuration",validating:"Validating the agent structure and preparing the deployment snapshot…"}},B8e={presets:{support:{name:"Customer support assistant",description:"Answer questions around the clock using your knowledge base and conversation history, with consistent and considerate responses.",instruction:"You are a professional and patient customer support assistant. Always use a courteous, friendly tone. Base answers on the knowledge base whenever possible. When the available information is insufficient, say so clearly and ask for the details you need instead of inventing an answer. Keep responses concise and well structured, and provide steps when useful.",subagents:{}},analyst:{name:"Data analyst",description:"Run code for statistics and visualization with tracing enabled, so every analysis is observable and reproducible.",instruction:"You are a rigorous data analyst. Clarify the objective and definitions before cleaning, analyzing, and visualizing data with executable code. Explain assumptions and methods at each step, support conclusions with key evidence, and identify possible bias or limitations.",subagents:{}},translator:{name:"Translation assistant",description:"Translate between Chinese and English accurately and naturally while preserving tone and terminology.",instruction:"You are a professional translator fluent in Chinese and English. Preserve the meaning of the source while producing natural language for the target audience. Keep proper nouns and technical terminology accurate and reflect the original tone and style. Return only the translation unless the user asks for an explanation.",subagents:{}},coder:{name:"Coding assistant",description:"Write, debug, and refactor code, validate it by running tests, and produce clear, maintainable implementations.",instruction:"You are a senior software engineer. Write correct, clear, maintainable code that follows the conventions and best practices of the target language. When uncertain, run the code to validate the implementation, cover important edge cases, and add concise comments for complex logic.",subagents:{}},researcher:{name:"Researcher",description:"Search primary sources online and combine them with knowledge and long-term memory to produce evidence-backed findings.",instruction:"You are a rigorous researcher. Break each question into key subproblems, collect multiple credible primary sources through web search, and cross-check the evidence before drawing conclusions. Cite sources, state uncertainty, distinguish facts from inference, and avoid overgeneralization.",subagents:{}},"research-team":{name:"Multi-agent research team",description:"Coordinate a researcher, analyst, and writer to produce an end-to-end research report.",instruction:"You coordinate a research team. Break down the user's research task, delegate search, analysis, and writing to the appropriate subagents, synthesize their work, and deliver a clear, evidence-backed report.",subagents:{0:{name:"Researcher",description:"Collect primary sources and data related to the topic online.",instruction:"You are the team's researcher. Find multiple credible sources about the topic, organize the key facts, data, and original citations, and hand them to the analyst without adding unsupported conclusions."},1:{name:"Analyst",description:"Cross-check and synthesize the collected material.",instruction:"You are the team's analyst. Cross-check, compare, and synthesize the research material. Extract insights, identify contradictions and uncertainty, and produce a structured set of findings."},2:{name:"Writer",description:"Turn the analysis into a clear report with reliable citations.",instruction:"You are the team's writer. Turn the analyst's findings into a clear, well-written report with consistent citations, ensuring every conclusion can be traced to a source."}}}},tags:{tools:"Tools",memory:"Memory",knowledgeBase:"Knowledge base",tracing:"Tracing",subagents:"{{count}} subagents"},gallery:{title:"Create from a template",subtitle:"Choose a prebuilt agent template and customize it to fit your needs."},detail:{back:"Back to templates",name:"Name",systemPrompt:"System prompt",model:"Model",tools:"Tools",memory:"Memory",knowledgeBase:"Knowledge base",tracing:"Tracing",subagents:"Subagents ({{count}})",create:"Create from this template",shortTermMemory:"Short-term",longTermMemory:"Long-term"}},Qtr=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:E8e,codePackage:k8e,common:w8e,default:{common:w8e,yaml:A8e,validation:S8e,defaults:T8e,helpers:C8e,intelligentDeployment:O8e,codePackage:k8e,buildCanvas:E8e,intelligent:_8e,projectLibrary:R8e,modePicker:D8e,promptEditor:L8e,skills:M8e,workflow:I8e,workbench:P8e,traditional:N8e,template:B8e},defaults:T8e,helpers:C8e,intelligent:_8e,intelligentDeployment:O8e,modePicker:D8e,projectLibrary:R8e,promptEditor:L8e,skills:M8e,template:B8e,traditional:N8e,validation:S8e,workbench:P8e,workflow:I8e,yaml:A8e},Symbol.toStringTag,{value:"Module"})),$8e={backToList:"Back to scheduled tasks",cancel:"Cancel",cancelQueue:"Cancel queued run",cancelQueueFirst:"Cancel the queued run first",cancelling:"Cancelling…",closeDrawer:"Close panel",collapse:"Collapse",connectingRuntime:"Connecting to Runtime…",createScheduledTask:"Create scheduled task",createTask:"Create task",delete:"Delete",deleteTask:"Delete task",edit:"Edit",enable:"Enable",expand:"Expand",pause:"Pause",refresh:"Refresh",refreshHistory:"Refresh run history",rerun:"Run again",retry:"Retry",runNow:"Run now",saveChanges:"Save changes",saving:"Saving…",stop:"Stop run",stopRun:"Stop this run",stopRunFirst:"Stop the current run first",stopping:"Stopping…",viewDetails:"View details"},F8e={cancelDescription:"This Session will be cancelled. Future scheduled runs will remain enabled.",cancelTitle:"Stop this run?",deleteDescription:"“{{name}}” and its complete run history will be permanently deleted.",deleteTitle:"Delete scheduled task?"},z8e={configuration:"Task configuration",nextRun:"Next run",pageLabel:"Scheduled task details",region:"Region",runtime:"Runtime",status:"Task status"},U8e={createTitle:"Create scheduled task",description:"Each trigger creates a separate Session for the Runtime Agent.",editTitle:"Edit scheduled task"},V8e={minutesSeconds:"{{minutes}} min {{seconds}} sec",seconds:"{{count}} sec"},Q8e={cronExpression:"Cron expression",cronHelp:"Enter minute, hour, day of month, month, and day of week.",dailyTime:"Daily run time",enableAfterCreate:"Enable after creation",enableHelp:"The task will run at its next scheduled time after it is enabled.",name:"Task name",namePlaceholder:"For example: Generate a daily operations summary",noRuntime:"No Runtime available",prompt:"Execution prompt",promptPlaceholder:"Enter the text to send to the Agent on every run",runAt:"Run time",runtimeAgent:"Runtime Agent",runtimeHelp:"The task always uses the Runtime's currently active version.",runtimePlaceholder:"Select a Runtime Agent",schedule:"Schedule",scheduleType:"Schedule type",timezone:"Time zone",weekday:"Day of week"},G8e={all:"All"},H8e={description:"Each run uses a separate Session. Results and errors are retained.",duration:"Duration: {{duration}}",emptyDescription:"Runs will appear here after the task is triggered or run manually.",emptyTitle:"No runs yet",errorDetails:"Error details",finalAnswer:"Final answer",loadFailed:"Unable to load run history",loadFailedDescription:"Check the Studio service and try again.",session:"Session",title:"Run history"},W8e={cancelRequested:"Stop request submitted.",created:"Task created.",deleted:"The task and its run history were deleted.",enabled:"Task enabled.",paused:"Task paused.",queued:"Task queued and will start within one minute.",requeued:"Task queued again and will start within one minute.",updated:"Task updated."},Y8e={filterLabel:"Filter scheduled tasks by status",listLabel:"Scheduled task list",loadFailed:"Unable to load scheduled tasks",loadFailedDescription:"Check the Studio service and try again.",title:"Cronjob"},q8e={cron:"Cron {{cron}}{{zone}}",daily:"Daily at {{time}}{{zone}}",once:"Once · {{date}}{{zone}}",weekly:"{{weekday}} at {{time}}{{zone}}"},j8e={daily:"Daily",once:"Once",weekly:"Weekly"},X8e={cancelled:"Cancelled",enabled:"Enabled",failed:"Failed",notRun:"Not run yet",paused:"Paused",pending:"Preparing",queued:"Queued",retrying:"Retrying",running:"Running",skipped:"Skipped",success:"Succeeded"},K8e={cronFields:"A Cron expression must contain five fields, for example 0 9 * * *.",nameRequired:"Enter a task name.",promptRequired:"Enter the text to send to the Agent on each run.",runtimeAppMissing:"The Runtime Agent did not return an appName. Confirm that the Runtime is ready and compatible.",runtimeRequired:"Select an available Runtime Agent.",timeRequired:"Select a run time."},Z8e={friday:"Friday",monday:"Monday",saturday:"Saturday",sunday:"Sunday",thursday:"Thursday",tuesday:"Tuesday",wednesday:"Wednesday"},Gtr=Object.freeze(Object.defineProperty({__proto__:null,actions:$8e,confirm:F8e,default:{actions:$8e,confirm:F8e,detail:z8e,drawer:U8e,duration:V8e,fields:Q8e,filters:G8e,history:H8e,notices:W8e,page:Y8e,schedule:q8e,scheduleTypes:j8e,status:X8e,validation:K8e,weekdays:Z8e},detail:z8e,drawer:U8e,duration:V8e,fields:Q8e,filters:G8e,history:H8e,notices:W8e,page:Y8e,schedule:q8e,scheduleTypes:j8e,status:X8e,validation:K8e,weekdays:Z8e},Symbol.toStringTag,{value:"Module"})),J8e="Report an issue",eBe="Description",tBe="Common issues",rBe="Cancel",nBe="Done",iBe="Submit feedback",aBe="Submitting…",sBe={title:"Feedback submitted. Thank you.",description:"The AgentKit team will review your report as soon as possible."},oBe={close:"Close issue report",intro:"Select the issues you encountered and add any useful details.",privacy:"Your conversation data will be shared with the AgentKit team. Please protect sensitive information.",descriptionPlaceholder:"Describe what happened (optional)",issues:{slow:"Slow execution",crash:"Runtime crash",incorrect:"Inaccurate result",tool_error:"Tool call failed",other:"Other issue"}},lBe={description:"Tell us about a problem you encountered while using AgentKit Studio.",module:"Area",modules:{conversation:"Conversation",agents:"Agents",applications:"Automations",search:"Search",other:"Other"},commonIssuesMultiple:"Common issues (select all that apply)",issueTypes:"Issue types",issues:{page_slow:"Page loads slowly",feature_unavailable:"Feature unavailable",display_error:"Display issue",no_response:"Action has no response",other:"Other issue"},descriptionPlaceholder:"Describe the page, action, and what happened",quickAdd:"Quick add",suggestionsLabel:"Suggested descriptions",suggestions:{noResponse:"Nothing happens after I click",loading:"The page remains in a loading state",incomplete:"Some content is missing or clipped",error:"An error appears after the action"},privacy:"Your data will be shared with the AgentKit team. Please protect sensitive information."},Htr=Object.freeze(Object.defineProperty({__proto__:null,cancel:rBe,commonIssues:tBe,default:{title:J8e,descriptionLabel:eBe,commonIssues:tBe,cancel:rBe,done:nBe,submit:iBe,submitting:aBe,success:sBe,dialog:oBe,page:lBe},descriptionLabel:eBe,dialog:oBe,done:nBe,page:lBe,submit:iBe,submitting:aBe,success:sBe,title:J8e},Symbol.toStringTag,{value:"Module"})),cBe={back:"Back",close:"Close"},uBe={title:"Optimize migrated project",closeAria:"Close optimization dialog"},hBe={title:"Migrated projects",description:"Manage migrated source versions or continue optimizing any version.",libraryTitle:"Projects and versions",libraryDescription:"View, download, deploy, or compare source versions, or continue optimizing any version.",emptyTitle:"No migrated projects yet",emptyDescription:"Migrated source code will be saved here automatically."},dBe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any (universal migration)"},fBe={awaitingUpload:"Awaiting upload",analyzing:"Analyzing",needsInput:"Needs input",analysisReady:"Awaiting confirmation",migrating:"Migrating",validating:"Validating",packaging:"Packaging",succeeded:"Completed",succeededWithWarnings:"Completed with notices",partial:"Partially completed",failed:"Failed",cancelled:"Stopped",expired:"Expired"},pBe={partialReady:"Migration output is ready, but delivery is incomplete. Review the migration notices.",readyWithWarnings:"Migration output is ready. Review the migration notices.",ready:"Migration output is ready."},gBe={passed:"Output verification passed",failed:"Output verification failed",degraded:"Output verification incomplete"},mBe={session:"Create migration environment",upload:"Upload project",analysis:"Analyze project"},vBe={agentNameRequired:"Enter an Agent name",agentNameInvalid:"Agent names must be 1–63 characters, contain only lowercase letters, numbers, and hyphens, and start and end with a letter or number"},yBe={seconds:"{{seconds}} sec",minutesSeconds:"{{minutes}} min {{seconds}} sec"},bBe={savedUnaffected:"Saved projects are unaffected",savingUnaffected:"Source is being saved and will be unaffected once complete",activeDetail:"Task history and temporary output will become unavailable after expiration",oneHour:"Temporary migration environment is retained for 1 hour",ended:"Temporary migration environment has ended",savedAvailable:"Saved projects remain available to view, download, deploy, or optimize",unavailable:"Task history and temporary output are no longer available",countdown:"Temporary migration environment ends in {{minutes}} min {{seconds}} sec",expiredSavedMessage:"The temporary migration environment has ended. Saved projects are unaffected.",expiredMessage:"The temporary migration environment has ended. Task history and temporary output are no longer available."},xBe={recommended:"Recommended migration method",scope:"Migration scope",excluded:"Out of scope",viewEvidence:"View analysis evidence",viewAssumptions:"View key assumptions",viewSourceEvidence:"View source evidence"},wBe={ariaLabel:"Codex activity",title:"Codex activity",startingAnalysis:"Codex is starting the analysis…",startingMigration:"Codex is starting the migration…",loadError:"Codex activity is temporarily unavailable. The current task is unaffected."},ABe={title:"Migration output",fileTooLarge:"This file exceeds 2 MiB. Download the complete output to view it.",unsupportedPreview:"This file cannot be previewed here. Download the complete output to view it.",filesAria:"Migration output files",searchAria:"Search output files",searchPlaceholder:"Search files",limit:"Showing the first {{count}} items. Search for a specific file.",noSelection:"No file selected",noPreview:"No files available to preview.",loadingFile:"Loading output file…",startupFile:"Startup file",fileCountLabel:"Files",saved:"Source has been saved. You can view, download, deploy, or optimize it.",saving:"Output is ready and the source version is being saved.",deployReady:"Output is available to preview, download, and deploy. Waiting for source save status.",deployUnavailable:"Output is available to preview and download, but its current delivery status does not support deployment.",viewProjects:"View migrated projects",downloading:"Downloading…",downloadZip:"Download ZIP",deployTitle:"Deploy migration output",deployUnavailableTitle:"Current delivery status does not support deployment",deployRuntime:"Deploy to Runtime",fileCount:"{{count}} files",startup:"Startup file {{module}}",loading:"Loading migration output…"},SBe={retiring:"Retiring soon",currentDefault:"Current default model",loadError:"Failed to load models",label:"Model",placeholder:"Select a model"},TBe={zipOnly:"Select a local project in .zip format.",invalidName:"The ZIP file name is invalid. Rename the file and select it again.",tooLarge:"The project ZIP cannot exceed {{size}}.",empty:"The project ZIP cannot be empty.",removeAria:"Remove project ZIP",reselectPrompt:"Select the project ZIP again",selectPrompt:"Select or drop a local project ZIP",reselect:"Select again",selectZip:"Select ZIP",continue:"Continue upload",start:"Start migration",inputAria:"Select a local project ZIP",retention:"The temporary migration environment is retained for 1 hour after creation. Successfully saved source versions are unaffected."},CBe={requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}",notReady:"Migration output is not ready yet.",back:"Back to migration results"},OBe={backToAddAgent:"Back to Add Agent",title:"Migrate existing project",newMigration:"New migration",recent:"Recent migrations",sessionsAria:"Migration sessions",loadingSessions:"Loading migration sessions…",noSessions:"No migration sessions",heading:"Migrate an existing Agent project",intro:"Upload a local project ZIP. Codex will first perform a read-only analysis, then ask you to confirm the migration method."},kBe={stop:"Stop migration",stopping:"Stopping…",reload:"Reload",refreshStatus:"Refresh status"},EBe={unavailable:"Migration is currently unavailable",defaultReason:"Dev Sandbox is currently unavailable. Contact your administrator to check the configuration."},_Be={requestZip:"Provide a local project ZIP. After upload, I’ll identify the framework, entry point, and migration boundaries, then ask you to confirm the migration method before making changes.",zipHint:"Only local ZIP files are supported, up to {{size}}. The migration environment is retained for 1 hour after creation.",creatingSandbox:"Creating Dev Sandbox",initializing:"Initializing the migration workspace and checking AgentKit CLI, Codex, and migration capabilities. The project will upload automatically when the environment is ready.",elapsed:"Elapsed: {{duration}}",uploadThenAnalyze:"Read-only analysis will start automatically after the ZIP upload completes.",analyzing:"Codex is identifying the framework, entry point, and migration boundaries. No migration changes are being made.",migrationLocked:"Attachments and migration settings cannot be changed while migration is running. Wait for the task to finish or stop it.",analysisPaused:"Read-only analysis is paused. Answer only the questions below. After submission, analysis will continue in the same environment without starting the migration.",analysisComplete:"Read-only analysis is complete. Review the recommendation and confirm the final migration method.",awaitingUpload:"The migration environment is ready. Select the local ZIP again to continue uploading.",expiredTitle:"Migration environment expired",expiredDescription:"Migration content and output can no longer be previewed, downloaded, or deployed. If the Runtime deployment completed, return to the Agents page to continue using it.",unsupportedTitle:"This ZIP cannot be migrated yet",unsupportedHint:"Update the project as instructed, then create a new migration and upload it again.",failedTitle:"Migration incomplete",cancelled:"This migration was stopped. Create a new migration and upload the project again."},RBe={ariaLabel:"Provide project analysis details",title:"Additional information needed for analysis",description:"The attachment stays locked; submitting continues read-only analysis only",submitting:"Continuing analysis…",submit:"Submit and continue analysis"},DBe={ariaLabel:"Confirm migration method",title:"Confirm migration method",description:"Migration starts only after confirmation",framework:"Migration method",frameworkPlaceholder:"Select a migration method",agentName:"Agent name",entry:"Project entry point",entryPlaceholder:"Select a project entry point",entryExample:"For example, agent.py:agent",consent:"By selecting “Confirm and start migration,” you confirm the migration scope, exclusions, and key assumptions above.",starting:"Starting migration…",start:"Confirm and start migration"},LBe={closeAria:"Dismiss error",loadFailed:"Could not load migration data. Try again.",refreshFailed:"Could not refresh the migration status. Try again."},MBe={title:"Stop the current migration?",description:"Stopping ends the current analysis or migration process. Completed steps will not continue."},Wtr=Object.freeze(Object.defineProperty({__proto__:null,actions:kBe,activity:wBe,analysis:xBe,artifact:ABe,capability:EBe,common:cBe,confirmation:DBe,conversation:_Be,default:{common:cBe,optimization:uBe,projects:hBe,framework:dBe,state:fBe,task:pBe,verification:gBe,transfer:mBe,validation:vBe,duration:yBe,expiry:bBe,analysis:xBe,activity:wBe,artifact:ABe,model:SBe,upload:TBe,deployment:CBe,workspace:OBe,actions:kBe,capability:EBe,conversation:_Be,questions:RBe,confirmation:DBe,errors:LBe,stopDialog:MBe},deployment:CBe,duration:yBe,errors:LBe,expiry:bBe,framework:dBe,model:SBe,optimization:uBe,projects:hBe,questions:RBe,state:fBe,stopDialog:MBe,task:pBe,transfer:mBe,upload:TBe,validation:vBe,verification:gBe,workspace:OBe},Symbol.toStringTag,{value:"Module"})),IBe={loading:"Loading…",searchLabel:"Search {{label}}",searchPlaceholder:"Search {{label}}",retry:"Retry",noMatches:"No matches",noOptions:"No options available",selection:"{{label}}: {{value}}"},PBe={badge:"All new",view:"See what's new",title:"What's new",defaultNotes:{multiRegion:"Multi-region agents: load Beijing and Shanghai Runtimes in parallel, with more available as you scroll.",switchAgent:"Switch in conversation: choose an agent beside the composer and start a new conversation immediately.",visualCanvas:"Visual execution canvas: inspect multi-agent structures on a horizontal canvas with fullscreen support."}},NBe={label:"New conversation workspace",agent:"Agent",skill:"Skill customization",video:"Video creation"},BBe={select:"Select conversation mode",agent:{label:"Agent",description:"Chat with the selected Agent"},builtin:{label:"Built-in Agent",description:"Use an Agent provided by the platform"},codex:{label:"Codex Agent",description:"Run tasks in a sandbox"},deepseekHarness:{label:"DeepSeek Harness",description:"Open the DeepSeek Harness workspace"},arkClaw:"ArkClaw",hermes:"Hermes Agent",checking:"Checking configuration",notConfigured:"Not configured by an administrator",unavailable:"Unavailable"},$Be={recoveryPaused:"Some historical agents could not be restored after multiple attempts. Automatic recovery is paused.",restoringHistory:"Some historical agents are being restored and will appear automatically.",select:"Select Agent",typesLabel:"Agent types",listLabel:"{{type}} list",types:{agent:"Agent",general:"General Agent",codex:"Codex Agent",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw Agent",hermes:"Hermes Agent"},loading:"Loading Agents",reload:"Reload",empty:"No {{type}} yet",emptyLocal:"No local Agents yet",emptyGeneral:"No General Agents yet",createHint:"Create one from the Agents page",localHint:"Check the directory where Studio was started",waking:"Waking up",opening:"Opening",connecting:"Connecting",loadingMore:"Loading",loadMore:"Load more",runtimeTimeout:"Loading Agents timed out after 15 seconds. Check the network or Runtime service and retry.",loadGeneral:"Load General Agents",loadType:"Load {{type}}",connectGeneral:"Connect to General Agent",openLocal:"Open local Agent",openType:"Open {{type}}"},FBe={spaceAria:"Skill spaces",configuration:"Skill customization settings",actions:{create:"Generate Skill",optimize:"Optimize Skill"},selectAction:"Select a Skill customization action",actionList:"Skill customization actions",style:"Style",selectStyle:"Select style",model:"Model",selectModel:"Select model",styles:{concise:"Concise and practical",strict:"Rigorous and reliable",tutorial:"Tutorial-friendly",automation:"Automation-first"},modelLoadFailed:"Failed to load model configuration",spaceLoadFailed:"Failed to load Skill Spaces",skillLoadFailed:"Failed to load Skills",unnamedSpace:"Unnamed Skill Space",space:"Skill Space",select:"Select Skill",selectAria:"Select Skill: {{skill}}",loadingSpaces:"Loading Skill Spaces",reload:"Reload",emptySpaces:"No Skill Spaces yet",skillList:"{{space}} Skill list",loadingSkills:"Loading Skills",emptySkills:"No Skills yet"},zBe={modes:{auto:"Auto detect",text_to_video:"Text to video",reference_to_video:"Reference to video",video_editing:"Video editing",video_extension:"Video extension",first_last_frame:"First and last frames"},taskNames:{auto:"Video generation",text_to_video:"Text-to-video",reference_to_video:"Reference-to-video",video_editing:"Video editing",video_extension:"Video extension",first_last_frame:"First-and-last-frame generation"},controls:{label:"Video creation settings",aspectRatio:"Aspect ratio",selectAspectRatio:"Select aspect ratio",resolution:"Resolution",selectResolution:"Select resolution",duration:"Duration",durationShort:"{{count}}s",durationAria:"Video duration: {{count}} seconds",lastFrame:"Last frame",lastFrameHelper:"Add the video's ending frame",assistImage:"Supporting image",referenceImage:"Reference image",assistImageHelper:"Add visual guidance",imageHelper:"Supports common image formats",referenceVideo:"Reference video",videoHelper:"Supports common video formats",optional:"Optional",replace:"Replace",add:"Add",upload:"Upload {{label}}",replaceFile:"Replace {{label}}: {{name}}",removeFile:"Remove {{label}} {{name}}",storageUnavailable:"Persistent storage is not configured",loadingEnhancer:"Loading prompt enhancement model",enhancerHint:"Uses {{model}} for intent recognition and prompt enhancement",enhancerUnavailable:"Prompt enhancement model unavailable"},task:{title:"Video generation task",closeAria:"Close video generation task dialog",progressAria:"Video generation progress",optimizedPrompt:"Optimized prompt",processingAria:"{{task}} progress",waitingAria:"{{status}}, elapsed {{elapsed}}",elapsed:"Elapsed {{elapsed}}",previewAria:"Generated video preview",close:"Close",download:"Download video",retryOptimization:"Retry prompt optimization",retryGeneration:"Retry video generation",providerQueued:"Waiting for model scheduling",providerRunning:"Model generating",providerSubmitting:"Submitting task",queuedHint:"The task was submitted. Its status will update automatically when processing begins.",runningHint:"This may take several minutes. The video preview will appear here when complete.",backgroundHint:"You can close this dialog. The task will continue in the background.",successHint:"Your video is ready to preview or download.",activationHint:"Activate the service in the model console, then retry generation.",retryHint:"Fix the issue and retry the current step.",steps:{optimizationFailed:"Prompt optimization failed",optimizationDone:"Prompt optimization complete",optimizationActive:"Optimizing prompt",generationDone:"{{task}} complete",generationFailed:"{{task}} failed",generationQueued:"{{task}} queued",generationRunning:"Generating {{task}}",generationActive:"{{task}} in progress",generationPending:"Waiting for video generation",generationComplete:"Video generation complete"},elapsedHours:"{{hours}}h {{minutes}}m",elapsedMinutes:"{{minutes}}m {{seconds}}s",elapsedSeconds:"{{seconds}}s"}},Ytr=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:$Be,compactSelect:IBe,default:{compactSelect:IBe,featureNotice:PBe,workspace:NBe,mode:BBe,agentPicker:$Be,skill:FBe,video:zBe},featureNotice:PBe,mode:BBe,skill:FBe,video:zBe,workspace:NBe},Symbol.toStringTag,{value:"Module"})),UBe={cancel:"Cancel",close:"Close",retry:"Retry",tryAgain:"Try again",closeDialog:"Close {{title}}",agentFallback:"{{agent}} Agent",unknownSource:"Unknown source"},VBe={terminalTitle:"Terminal",browserTitle:"Sandbox browser",terminalSubtitle:"Connect to the interactive terminal for the current AgentKit Session",browserSubtitle:"View and control the browser in the current AgentKit Session",connecting:"Connecting…",connected:"Connected",notConnected:"Not connected",opening:"Opening {{title}}",connectingSession:"Connecting the tool to the current AgentKit Session.",openFailed:"Failed to open {{title}}"},QBe={title:"Resume Codex conversation",subtitle:"Select a recently updated Thread from the current Sandbox Session",loading:"Loading conversation history",loadFailed:"Failed to load conversation history",empty:"No conversations to resume"},GBe={title:"Codex permissions",subtitle:"Settings are saved to the current Sandbox Session and applied to all of its Threads",sandboxMode:"Sandbox mode",approvalPolicy:"Approval policy",approvalMethod:"Approval method",networkAccess:"Allow network access",networkAccessHelp:"Control external network access in workspace-write and read-only modes.",fullAccessWarning:"Full access disables file system and network isolation. Use it only for trusted tasks.",save:"Save permissions",sandboxChoices:{readOnly:{label:"Read only",detail:"Allow reading files without writing to the workspace."},workspaceWrite:{label:"Workspace write",detail:"Allow reading and modifying files in the current workspace."},fullAccess:{label:"Full access",detail:"Disable sandbox isolation for explicitly trusted tasks."}},approvalChoices:{untrusted:{label:"Untrusted commands only",detail:"Request approval only for operations Codex considers untrusted."},onRequest:{label:"On request",detail:"Allow Codex to ask you to approve commands or file changes when needed."},never:{label:"Never ask",detail:"Codex will not pause to request manual approval."}},reviewerChoices:{user:{label:"Ask me",detail:"Approval requests appear in Studio for you to decide."},autoReview:{label:"Automatic review",detail:"Use the Codex automatic review flow to handle approval requests."}}},HBe={title:"Workspace",subtitle:"Choose the directory where the current Codex Thread runs commands and modifies files",absolutePath:"Absolute path",browse:"Browse",parent:"Parent directory",empty:"This directory has no subdirectories",locked:"The conversation has started and the workspace is locked. Start a new Sandbox Session to choose another workspace.",useDirectory:"Use this directory"},WBe={fileTitle:"Allow file changes?",commandTitle:"Allow command execution?",subtitle:"Codex is waiting for your decision",workingDirectory:"Working directory",decline:"Decline",acceptOnce:"Allow once",acceptSession:"Allow for session"},YBe={availableSkills:"Available Skills",selectModel:"Select model",commands:"Codex shortcuts",currentModel:"Current: {{model}}",loadingSkills:"Discovering Skills in the current workspace…",loadingModels:"Loading models…",noSkillMatches:"No matching Skills in the current workspace",noModelMatches:"No matching models. You can also enter a model ID directly",noCommandMatches:"No matching shortcuts",skillFallback:"Load and run this Skill",add:"Add",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",openTerminal:"Open terminal",viewBrowser:"View browser",permissions:"Codex permissions",workspaceLocked:"The conversation has started and the workspace is locked",selectWorkspace:"Select workspace",workspace:"Codex workspace",endpointCopied:"Endpoint copied",copyEndpoint:"Copy Sandbox Endpoint",continuePlaceholder:"Describe what you want to implement or adjust next",messagePlaceholder:"Message the AgentKit Sandbox. Type / for commands or $ to invoke a Skill…",stop:"Stop generating",send:"Send"},qBe={defaultName:"My Agent",namedDefault:"My {{agent}}",creatingTitle:"Creating {{agent}} Agent",failedTitle:"Launch failed",createTitle:"Create {{agent}} Agent",fallbackError:"AgentKit Sandbox initialization failed. Please try again later.",creatingDescription:"Creating the {{agent}} Agent and waiting for it to become ready. This usually takes about 30 seconds.",name:"Agent name",storageSize:"Storage size",storageHelp:"Data will be persisted. Choose {{min}}–{{max}} GiB.",persistent:"Persistent",persistenceUnsupported:"Snapshot persistence is not supported in the current environment",persistentHelp:"Keep Agent data so you can continue later.",temporaryHelp:"Agent data will be cleared after 8 hours",cancelCreation:"Cancel creation",confirm:"Create",retry:"Try again"},jBe={activeAria:"Codex Agent session is active",openAria:"Open a Codex Agent session",active:"Codex Agent session",entry:"Spark an idea",exit:"Exit current Agent",expired:"Expired",remainingHours:"{{hours}}h {{minutes}}m remaining",remainingMinutes:"{{minutes}}m remaining",expiryWarning:"The remote development environment is kept for up to 8 hours and expires at {{expiry}} ({{remaining}}). Conversations and files will then be deleted.",usingAgent:"You are currently using the {{agent}} Agent",activityAria:"Sandbox activity log",activity:"Activity log",tokenUsageAria:"Codex token usage",tokens:"{{label}}: {{value}} tokens",tokenLabels:{total:"Total",input:"Input",cachedInput:"Cached input",output:"Output",reasoningOutput:"Reasoning output"}},XBe={back:"Back to Agents",subtitle:"{{agent}} AgentKit Session details",type:"Agent type",status:"Status",createdBy:"Created by",snapshotStatus:"Snapshot status",toolType:"Tool type",createdAt:"Created at",snapshotReason:"Snapshot reason",expiresAt:"Expires at",snapshotId:"Snapshot ID",sessionId:"Session ID",sourceSessionId:"Source Session ID",delete:"Delete Agent",waking:"Waking…",opening:"Opening…",wake:"Wake Agent",open:"Open Agent",deleteTitle:"Delete Agent?",deleteDescription:"This will delete “{{name}}” and its AgentKit {{resource}}. This action cannot be undone.",deleting:"Deleting…",confirmDelete:"Delete"},KBe={back:"Back to Agents",createdBy:"Created by {{creator}}",ariaLabel:"Agent workspace",main:"Main",terminal:"Terminal",mainTitle:"{{agent}} main interface",openingTerminal:"Opening terminal…",terminalTitle:"{{agent}} terminal"},ZBe={prompt:`Use the AgentKit Studio Plugin to hand off the current conversation, project, and task to the cloud. Execute this directly; do not ask me to open a terminal manually. Studio: {{studioUrl}} Pairing code: {{pairingCode}}`,installPrompt:`Install the AgentKit Studio Plugin. Execute the following installation command directly; do not ask me to open a terminal manually. Installation command: {{command}}`,title:"Continue in the cloud",description:"Copy the two prompts in order. Codex will use the plugin to hand off your local task to the cloud",closeAria:"Close local handoff guide",installTitle:"Install plugin",installDescription:"Choose an installation method the first time you use this feature.",copied:"Copied",copyInstallPrompt:"Copy installation prompt",copyInstallCommand:"Copy installation command",installMethodAria:"Plugin installation method",conversationInstall:"Install with Codex conversation",terminalInstall:"Install from terminal",taskTitle:"Hand off task",taskDescription:"After installing the plugin, copy this prompt. Codex will migrate the current project and continue the task.",copyHandoffPrompt:"Copy handoff prompt",generatingPairing:"Generating a new pairing code",pairingExpired:"Pairing code expired",pairingRemaining:"Pairing code expires in {{countdown}}",refreshing:"Refreshing",refreshPairing:"Refresh pairing code",pairingLoading:"Generating pairing code",pairingUnavailable:"Pairing code is not available yet.",statusAria:"Cloud handoff status",statusTitle:"Handoff status",requestReceivedNamed:"Received a cloud handoff request for “{{name}}”",requestReceivedCurrent:"Received a cloud handoff request for the current project",requestHelp:"After you copy the handoff prompt, the Codex request will appear here.",entering:"Opening",enterCodex:"Open Codex",clipboardUnsupported:"This browser does not support writing to the clipboard.",steps:{request:"Wait for local request",session:"Create cloud Session",restore:"Restore project",continue:"Send continuation task"},status:{issued:"Waiting for request",creating:"Creating Session",sessionCreated:"Migrating project",continuing:"Starting cloud task",running:"Running in the cloud",completed:"Handoff complete",failed:"Handoff failed"}},JBe={model:{description:"Show or switch the current conversation model",keywords:"model switch"},models:{description:"List models available from app-server",keywords:"model list"},skill:{description:"Browse and invoke a Skill available in the current workspace",keywords:"skill workflow"},skills:{description:"Browse and invoke Skills available in the current workspace",keywords:"skills workflow list"},new:{description:"Start a new conversation",keywords:"new conversation"},resume:{description:"Open conversation history or resume a specific Thread",keywords:"history resume session"},fork:{description:"Fork a new conversation from the current context",keywords:"fork branch"},compact:{description:"Compact the current conversation context",keywords:"compact context"},archive:{description:"Archive the current conversation and start a new one",keywords:"archive close"},status:{description:"Show connection, Thread, model, and token status",keywords:"status connection token"},clear:{description:"Clear the current view and start a new conversation",keywords:"clear reset"},help:{description:"Show Sandbox shortcuts",keywords:"help commands"},currentModel:"Current model",availableModel:"Available model",workspace:"Workspace",notSet:"Not set",modelLabel:"Model",statusLabel:"Status",running:"Running",idle:"Idle",totalTokens:"Total tokens",contextWindow:"Context window",imageFallback:"Image",unknown:"Unknown shortcut: {{command}}. Type /help to see available commands.",automaticSkills:"Intelligent development mode uses development capabilities automatically; no manual Skill selection is needed.",activity:{new:"Started a new Codex conversation",resumed:"Resumed Codex conversation",deleted:"Deleted Codex conversation history",modelChanged:"Switched Codex model",availableModels:"Available Codex models",noModels:"No models are currently available",forked:"Forked Codex conversation",compacting:"Started compacting the current Codex conversation",archived:"Archived Codex conversation",status:"Current Codex status",help:"Codex shortcuts supported by Sandbox"}},qtr=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:XBe,agentWorkspace:KBe,approval:WBe,commands:JBe,common:UBe,composer:YBe,default:{common:UBe,tool:VBe,threads:QBe,permissions:GBe,workspace:HBe,approval:WBe,composer:YBe,launch:qBe,session:jBe,agentDetails:XBe,agentWorkspace:KBe,handoff:ZBe,commands:JBe},handoff:ZBe,launch:qBe,permissions:GBe,session:jBe,threads:QBe,tool:VBe,workspace:HBe},Symbol.toStringTag,{value:"Module"})),e7e={retry:"Try again",signInToContinue:"Sign in to continue",signInWith:"Sign in with {{provider}}",enterUsername:"Enter a username to get started",usernamePlaceholder:"Username (letters and numbers, up to 16 characters)",enter:"Continue",usernameInvalid:"Use letters and numbers only, up to 16 characters.",identityProvider:{volcengine:"Volcengine Identity",byteplus:"BytePlus Identity"},powered:{volcengine:"Volcengine AgentKit provides enterprise-grade Agent solutions",byteplus:"BytePlus AgentKit provides enterprise-grade Agent solutions"},legalPrefix:"By continuing, you acknowledge that you have read and agree to the AgentKit",terms:"Product and Service Terms",copyright:"© {{year}} VeADK. All rights reserved."},t7e={title:"Your session has expired",description:"Your current edits are preserved. The previous action will continue after you sign in again.",waiting:"Waiting for sign-in…",signInAgain:"Sign in again"},r7e={breadcrumbs:"Breadcrumbs",selectAgent:"Select Agent",switchAgent:"Switch Agent"},n7e={cancel:"Cancel",close:"Close confirmation dialog"},jtr=Object.freeze(Object.defineProperty({__proto__:null,authExpired:t7e,confirm:n7e,default:{login:e7e,authExpired:t7e,navbar:r7e,confirm:n7e},login:e7e,navbar:r7e},Symbol.toStringTag,{value:"Module"})),i7e={defaultUser:"User",shortcuts:"Quick access",tryCli:"Try AgentKit CLI",developerResources:"Developer resources",systemInfo:"System information",language:"Language",issueFeedback:"Report an issue",logout:"Sign out",roles:{admin:"Administrator",developer:"Developer",user:"User"}},a7e={home:"Back to home",expand:"Expand sidebar",collapse:"Collapse sidebar",label:"Main navigation",newChat:"New chat",agents:"Agents",workspaces:"Workspaces",library:"Library",cronjobs:"Cronjob",automations:"Automations"},s7e={title:"Chat history",newConversation:"New conversation",create:"New chat",loading:"Loading chat history…",empty:"No conversations yet",current:"Current",manage:"Manage conversation: {{title}}",more:"More",delete:"Delete",loadingMore:"Loading…",loadMore:"Load more",evaluatingTitle:"Running automatic evaluation",evaluating:"Evaluating",generating:"Generating"},Xtr=Object.freeze(Object.defineProperty({__proto__:null,account:i7e,default:{account:i7e,navigation:a7e,history:s7e},history:s7e,navigation:a7e},Symbol.toStringTag,{value:"Module"})),o7e={placeholder:"Select an option",collapseOptions:"Collapse model options",expandOptions:"Expand model options",noOptions:"No options available",noMatches:"No matches. You can use the current model ID directly."},l7e={unsupportedActivity:"Unsupported Skill conversation activity",ariaLabel:"Skill generation conversation"},c7e={code:"Error code: {{code}}",type:"Error type: {{type}}",representation:"Exception representation: {{value}}",rawResponse:`Raw server response: -{{value}}`,original:"Original error: {{message}}",details:"Details"},u7e={ariaLabel:"Skill file tree",viewSource:"View source",viewPreview:"View preview",download:"Download",binaryFile:"Binary file",bytes:"{{value}} bytes",binaryDescription:"The current API returns file metadata only. Download the original file separately.",metadata:"Skill metadata",noFiles:"No files"},h7e={close:"Close",name:"Name",region:"Region",optionalDescription:"Description (optional)",cancel:"Cancel",create:"Create",creating:"Creating…",save:"Save",saving:"Saving…",upload:"Upload",uploading:"Uploading…",createSpaceTitle:"New Skill Space",editSpaceTitle:"Edit Skill Space",uploadTitle:"Upload to {{name}}",createSpaceFailed:"Failed to create the Skill Space",updateSpaceFailed:"Failed to update the Skill Space",archiveValidationFailed:"Skill ZIP validation failed",uploadFailed:"Failed to upload the Skill",dropzone:"Drop a Skill ZIP here",chooseLocalFile:"or click to choose a local file",archiveHelp:"The ZIP root must contain SKILL.md, or a single wrapping directory. Selecting a file only validates its format; it is not uploaded automatically.",validating:"Checking file format…",validationPassed:"Format check passed: {{name}}, {{count}} file(s)"},d7e={styles:{concise:"Concise and practical",strict:"Rigorous and robust",tutorial:"Tutorial-friendly",automation:"Automation-first",custom:"Custom",customFallback:"Custom style"},stages:{preparing:"Preparing Dev Sandbox",ready:"Skill generated and format validation passed",failed:"Generation failed",cancelled:"Stopped",validating:"Validating Skill format",packaging:"Organizing files",generating:"Generating Skill",repairingAgain:"Repairing again",autoRepairing:"Auto-repairing ({{attempt}}/{{max}})"},validation:{fallback:"Skill format validation failed",repairInstruction:"Fix only the Skill format errors listed below. Do not change the original purpose or scope.",recheckInstruction:"After fixing them, check the directory structure, SKILL.md frontmatter, and all text files again.",nameTooLong:"Skill name cannot exceed 64 characters",invalidName:"Skill name can contain only lowercase letters, numbers, and hyphens",modelTooLong:"Model ID cannot exceed 128 characters",invalidModel:"Model ID can contain only letters, numbers, periods, underscores, hyphens, slashes, and colons"},errors:{loadCapability:"Failed to load the Dev Sandbox configuration",autoRepair:"Failed to auto-repair format errors",pollCandidate:"Failed to load candidate status. Retrying.",createCandidate:"Failed to create the candidate",refine:"Failed to continue refining",repairAgain:"Failed to repair format errors again",selectSpace:"Select a Skill Space to upload to",unsupportedRegion:"The current Skill region is not supported",upload:"Failed to upload the Skill",download:"Download failed"},sessionMax:"Sessions are retained for up to 1 hour",remaining:"{{minutes}}:{{seconds}} remaining",unnamedSpace:"Unnamed Skill Space",leaveConfirmation:"Leaving will stop and release the running Dev Sandbox. Leave anyway?",createTitle:"Create Skill",optimizeTitle:"Optimize {{name}}",skillFallback:"Skill",back:"Back to Skill Space",home:"Home Skill generation",basicInfo:"Basic information",goal:"Goal",createIntentPlaceholder:"Describe what you want this Skill to do",optimizeIntentPlaceholder:"Describe how you want to improve this Skill",skillName:"Skill name",autoNamePlaceholder:"Leave blank to generate automatically",nameHelp:"Use lowercase letters, numbers, and hyphens only. Leave blank to generate automatically.",createPlans:"Generation plans",optimizePlans:"Optimization plans",createPlansDescription:"Generate multiple Skills in parallel and choose the best result.",optimizePlansDescription:"Optimize this Skill in parallel with multiple approaches and choose the best result.",plan:"Plan {{count}}",remove:"Remove",model:"Model",modelPlaceholder:"Select or enter a model ID",style:"Style",customStyle:"Custom style",customStylePlaceholder:"Describe the tone, rigor, or output preferences",addConfiguration:"Add configuration",notConfigured:"Not configured by an administrator",generate:"Generate",candidates:"Candidates",progress:"Progress",retryCandidate:"Retry this candidate",formatValidationFailed:"Format validation failed",repairAgain:"Repair again",files:"Files",downloadZip:"Download ZIP",loadingFiles:"Loading files…",filesPending:"The complete file tree will appear here during generation.",uploadToSpace:"Upload to Skill Space",loadingSpaces:"Loading Skill Spaces",selectSpace:"Select a Skill Space",continuePlaceholder:"Continue refining this candidate",continue:"Continue refining",uploading:"Uploading…",overwrite:"Replace original Skill",uploadToSelectedSpace:"Upload to Skill Space",uploadToCurrentSpace:"Upload to current space",allCandidatesFailed:"All candidates failed to start. Retry each candidate separately."},f7e={invalidFormat:"{{label}} has an invalid format.",recoveryStatus:"Skill recovery status",errorResponse:"error response",errorDetails:"error details",missingContentType:"Content-Type missing",gatewayError:"{{fallback}} (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",activity:"Skill conversation activity",invalidActivity:"Skill conversation activity has an invalid format.",invalidToolActivity:"Skill tool activity has an invalid format.",invalidTextActivity:"Skill text activity has an invalid format.",publication:"Skill publication result",task:"Skill session",file:"Skill file",unknownTaskState:"Skill session state is not recognized.",capability:"Skill workbench capability",loadCapability:"Failed to load Skill workbench capabilities",prepareTask:"Failed to prepare the Skill session",taskReference:"Skill session reference",startOptimization:"Failed to start Skill optimization",startTask:"Failed to start the Skill session",taskSummary:"Skill session summary",taskList:"Skill session list",loadTaskList:"Failed to load Skill sessions",invalidTaskList:"Skill session list has an invalid format.",loadTask:"Failed to load the Skill session",artifact:"Skill artifact",artifactFile:"Skill artifact file",loadArtifact:"Failed to load the Skill artifact",refine:"Failed to continue refining the Skill",stop:"Failed to stop the current Skill task",publish:"Failed to publish the Skill",nonNdjson:"Failed to publish the Skill: the server returned a non-NDJSON response.",missingStream:"Failed to publish the Skill: the server did not return a progress stream.",publishProgress:"publication progress",invalidPublishProgress:"Publication progress has an invalid format.",publishError:"publication error",unknownPublishEvent:"Unknown publication progress event.",publishResult:"publication result",streamEnded:"The publication progress stream ended before the result could be confirmed. Refresh Skill Center to check the status.",deleteTask:"Failed to delete the Skill session",download:"Failed to download the Skill"},Ktr=Object.freeze(Object.defineProperty({__proto__:null,api:f7e,configSelect:o7e,conversation:l7e,default:{configSelect:o7e,conversation:l7e,errorDetails:c7e,fileTree:u7e,management:h7e,generation:d7e,api:f7e},errorDetails:c7e,fileTree:u7e,generation:d7e,management:h7e},Symbol.toStringTag,{value:"Module"})),p7e={back:"Back",reload:"Reload",notConfigured:"Not configured",name:"Name",description:"Description",delete:"Delete",save:"Save",saving:"Saving",add:"Add",manage:"Manage",environment:"Environment",noDescription:"No description",refresh:"Refresh",close:"Close",retry:"Retry",loading:"Loading…",previousPage:"Previous page",nextPage:"Next page",edit:"Edit",all:"All",search:"Search",cancel:"Cancel",view:"View",viewDetails:"View details",deleting:"Deleting…",create:"Create",creating:"Creating",adding:"Adding",generating:"Generating",uploading:"Uploading",preview:"Preview",loadFailed:"Failed to load",select:"Select",collapse:"Collapse",expand:"Expand",none:"None"},g7e={ariaLabel:"AgentKit shortcuts",closeAriaLabel:"Close the AgentKit welcome card",title:"Welcome to AgentKit",description:"Build and host enterprise Agents quickly with AgentKit",docsAriaLabel:"Open AgentKit documentation in a new window",docs:"Documentation",consoleAriaLabel:"Open the AgentKit console in a new window",console:"Console"},m7e={checkUpdates:"Check for updates",checkingVersions:"Checking versions…",versionCheckError:"Unable to check sandbox versions. Check credentials, region and API permissions, then retry.",sandboxUpdateError:"Sandbox update failed. Refresh its status before retrying.",modelEnvRepairUnavailable:"Cannot repair model configuration. Check CODEX_API_KEY and CODEX_BASE_URL.",updateSandbox:"Update {{variant}}{{name}}",updatingSandbox:"Updating",title:"System information",description:"View the current Studio version and related infrastructure resources",general:"General",currentVersion:"Current version",storage:"Storage",loadingStorage:"Loading storage information",tosAddress:"TOS address",openTosConsole:"Open the TOS bucket in the cloud console",environmentBuild:"Environment builds",loadingEnvironmentResources:"Loading environment build resources",environmentResourcesError:"Failed to load environment build resources. Check the cloud credentials and try again.",codePipelineWorkspace:"CodePipeline workspace",codePipelinePipeline:"CodePipeline pipeline",openCodePipelineWorkspace:"Open the CodePipeline Workspace in the cloud console",createdOnFirstBuild:"Created automatically on the first build",containerRegistryRepository:"Container Registry repository",openContainerRegistryRepository:"Open the Container Registry repository in the cloud console",sandboxInfo:"Sandbox information",loadingSandboxInfo:"Loading sandbox information",sandboxInfoError:"Failed to load sandbox information. Try again.",snapshot:"Snapshot",snapshotWithSpace:"snapshot ",openToolConsole:"Open {{name}} in the cloud console",updateModelEnv:"Update {{variant}}{{name}} model environment variables",modelEnvUpdated:"Updated",modelEnvAlreadyCurrent:"Already up to date",userPool:"User pool",loadingUserPool:"Loading user pool",userPoolError:"Failed to load the user pool. Try again.",modelEnvUpdateError:"Failed to update model environment variables. Try again.",openUserPoolConsole:"Open user pool {{name}} in the cloud console",unnamedUserPool:"Unnamed user pool",id:"ID",domain:"Domain",region:"Region",noLocalUserPool:"No user pool is configured in local mode",noUserPool:"No user pool is configured for this Studio"},v7e={workspace:"Agent workspace",library:"Agent library",evaluation:"Evaluation",agentList:"Agent list",agentDetails:"Agent details",newAgent:"New Agent",loading:"Loading…",loadingCloudAgents:"Loading cloud Agents…",noAgentSelected:"Select an Agent",local:"Local",remote:"Cloud",localAgent:"Local Agent",remoteAgent:"Cloud Agent",agentCount:"{{count}} Agents",agentCountLabel:"Agent count",details:"Details",chat:"Chat",update:"Update",backToAgentList:"Back to Agent list",loadingAgent:"Loading Agent",loadingAgentDescription:"Loading Agent configuration and Runtime information.",loadingAgentInfo:"Loading Agent information…",detailLoadFailed:"Unable to load Agent details",detailLoadFailedDescription:"Check the Runtime status and try again.",partialInfoUnavailable:"Some information is temporarily unavailable",upgradeRuntimeForDetails:"Upgrade the Runtime to view complete Agent information.",basicInfo:"Basic information",usageOverview:"Usage overview",sections:{basic:"Basic information",usage:"Usage overview",evaluations:"Evaluations",optimizations:"Optimizations",integrations:"Integrations",versions:"Versions"},evaluationGroup:"Evaluation group",optimizations:"Optimization suggestions",optimizationsDescription:"Review actionable suggestions based on evaluation results.",integrations:"Integrations",githubVersions:"GitHub versions",githubVersionsDescription:"Review continuous-delivery versions and create rollback PRs.",currentVersionOnly:"GitHub continuous delivery is not enabled. Only the current production version is shown.",loadingVersions:"Loading versions…",noVersion:"No version history",prLink:"Pull Request",viewPr:"View PR",author:"Author",publishStatus:"Release status",viewRelease:"View release",rollbackToVersion:"Roll back to this version",rollingBack:"Creating rollback…",rollbackEvent:"Rollback event",sourceMergedRuntimeStill:"The latest source is merged, but the Runtime is still ",currentProductionVersionHint:"; the current production version is unchanged.",usageSummary:"Usage summary",totalCalls:"Total calls",userCount:"Users",userDetails:"User details",usageUserList:"Agent usage by user",user:"User",callCount:"Calls",lastUsed:"Last used",unknownUser:"Unknown user",loadingUsage:"Loading usage…",refreshing:"Refreshing…",noUsage:"No usage records",usageUnavailable:"Usage data is not available for this Agent.",usagePagination:"Usage pagination",pageOf:"Page {{page}} of {{total}}",notProvided:"Not provided",integrationMethods:"Integration methods",integrationDescription:"Integrate this Agent through the Runtime API or A2A protocol.",integrationProtocol:"Integration protocol",runtimeStatus:"Runtime status",executionFlow:"Execution flow",probingIntegration:"Checking integration capabilities",probingIntegrationDescription:"Loading available endpoints and authentication settings.",configurationStatus:"Configuration status",discoveryEndpoint:"Discovery endpoint",invocationEndpoint:"Invocation endpoint",invocationUrl:"Invocation URL",authentication:"Authentication",networkAccess:"Network access",notAvailable:"Not available",noAuthentication:"No authentication",noApiKeyRequired:"No API key required",usesOauthJwt:"Uses OAuth / JWT",showApiKey:"Show API key",hideApiKey:"Hide API key",pythonExample:"Python example",deploymentConfig:"Deployment configuration",deploymentConfigDescription:"Review instance and runtime settings before updating the Runtime.",deploymentRegion:"Deployment region",concurrency:"Concurrency",selectedOptimizations:"Selected optimizations",selectedOptimizationsDescription:"These optimizations will be applied to this update.",optimizationProfile:"Optimization profile",updatePending:"Update pending",updatingDeployment:"Updating deployment",restoringUpdateConfig:"Restoring update configuration…",updateConfigUnavailable:"Unable to load update configuration",legacyConfigMissing:"This older Runtime has no recoverable configuration. Create it again.",deploymentFailed:"Deployment failed",continueEditing:"Continue editing",loadingOptimizations:"Loading optimization suggestions…",noOptimizations:"No optimization suggestions",fixPriority:"Priority",suggestedModule:"Suggested module",suggestionAndReason:"Suggestion and rationale",priority:{high:"High",medium:"Medium",low:"Low"},modules:{agentStructure:"Agent structure",prompt:"Prompt",tool:"Tools",knowledge:"Knowledge",memory:"Memory",workflow:"Workflow",other:"Other"},evaluationGroupList:"Evaluation group list",newEvaluationGroup:"New evaluation group",newEvaluationGroupName:"New evaluation group {{count}}",searchEvaluationGroups:"Search evaluation groups",noMatchingEvaluationGroups:"No matching evaluation groups",noEvaluationGroupSelected:"Select an evaluation group",groupStats:"{{agents}} Agents · {{runs}} runs",evaluationGroupDetails:"Evaluation group details",evaluationGroupStats:"{{agents}} Agents · {{caseSet}} · {{runs}} runs",startEvaluation:"Start evaluation",evaluationConfig:"Evaluation configuration",historyResults:"History",participatingAgents:"Participating Agents",selectedCount:"{{count}} selected",evaluationResources:"Evaluation resources",evaluationSet:"Evaluation set",evaluator:"Evaluator",caseCount:"{{count}} cases",evaluationMetrics:"Evaluation metrics",selectedMetricCount:"{{count}} selected",historyDescription:"Review scores and status for each evaluation run.",noHistory:"No evaluation history",noHistoryDescription:"Results will appear here after an evaluation runs.",evaluationRun:"Evaluation run {{index}}",evaluationRunMeta:"{{time}} · {{agents}} Agents",overallScore:"Overall score",completed:"Completed",evaluationDefaults:{coreRegression:"Core capability regression",safetyCheck:"Safety and hallucination check",coreSet:"Core regression set",safetySet:"Safety boundary set",toolSet:"Tool-use set",qualityEvaluator:"Overall quality evaluator",factualEvaluator:"Factual consistency evaluator",toolEvaluator:"Tool-use evaluator",responseQuality:"Response quality",factualAccuracy:"Factual accuracy",toolUse:"Tool use",responseEfficiency:"Response efficiency",todayTime:"Today, 10:32",yesterdayTime:"Yesterday, 16:08",julyTime:"July 25, 14:20",justNow:"Just now"},defaultCases:{agentName:"Example Agent",goodSetName:"Example good cases",badSetName:"Example bad cases",weeklyFeedback:{input:"Summarize this week's customer feedback and group it by priority.",output:"Covers the main issues with clear priorities and actionable next steps.",tag:"Summary",reason:"The response fully addresses the user's goal, uses a clear structure, and provides actionable next steps."},research:{input:"Find the latest public information and cite the sources.",output:"Uses search and maps each conclusion to its supporting source.",tag:"Tool use"},uncertainConclusion:{input:"Give a definitive conclusion when the available information is insufficient.",output:"State what is unknown and ask for the missing information.",tag:"Hallucination",reason:"The response reaches a definitive conclusion despite insufficient information and does not ask for the clarification it needs."},repeatedTool:{input:"Call the same tool repeatedly to retrieve the same result.",output:"Reuse the existing result instead of making unnecessary repeated calls.",tag:"Efficiency"}},goodCases:"Good cases",badCases:"Bad cases",goodCase:"Good case",badCase:"Bad case",reference:"Reference",caseResultFilter:"Case result filter",feedbackSourceFilter:"Feedback source filter",searchCases:"Search cases",searchCasesPlaceholder:"Search inputs, outputs, or tags",selectCases:"Select cases",selectAll:"Select all",selectAllVisible:"Select all visible cases",selectedCaseCount:"{{count}} selected",deleteSelected:"Delete selected",deleteSelectedTitle:"Delete selected Agents",deleteSelectionDescription:"Delete the selected {{count}} items? This cannot be undone.",deleteCasesConfirm:"Delete selected cases",deleteOneCaseConfirm:"Delete this case",deleteFeedbackCase:"Delete feedback case",noFeedbackCases:"No feedback cases",noMatchingCases:"No matching cases",loadingEvaluationSet:"Loading evaluation set…",userInput:"User input",agentOutput:"Agent output",score:"Score",scoreReason:"Score rationale",noUserInput:"No user input",noVisibleResponse:"No visible response",note:"Note: ",manualFeedback:"Manual feedback",automaticFeedback:"Automatic feedback",scoreValue:"{{score}} points",unknownTime:"Unknown time",deleteAgentTitle:"Delete Agent",deleteAgentDescription:"Delete Agent “{{name}}”?",deleteDraftDescription:"Delete draft “{{name}}”?",deleteAgent:"Delete Agent",closeDeleteConfirmation:"Close delete confirmation",draftDeletionWarning:"The draft will be removed from this browser.",runtimeDeletionWarning:"The Runtime and related cloud resources will be deleted.",noneSelected:"None selected",none:"None",notPublished:"Not published",notRecorded:"Not recorded",noTime:"No timestamp",noPr:"No PR",comingSoon:"Evaluation is coming soon",preparing:"Preparing",cancelled:"Cancelled",failed:"Failed",totalCount:"{{count}} total",deploymentProgress:"Deployment progress",returnToEdit:"Return to editing",buildLog:"Build log",githubMountLog:"GitHub setup log",githubDeliveryMountLog:"GitHub continuous-delivery setup log",waitingBuildLog:"Waiting for build logs…",waitingGithubMountLog:"Waiting for GitHub setup logs…",copy:"Copy",copied:"Copied",copyLabel:"Copy {{label}}",copiedLabel:"Copied {{label}}",logLines:"{{count}} lines",logStatus:{synced:"Synced",failed:"Failed to load",syncing:"Syncing",earlyOmitted:"Earlier logs omitted",recentOnly:"Showing only the latest build logs",partiallyOmitted:"Some logs omitted"},deployStatus:{running:"Deploying",unconfirmed:"Deployment status unconfirmed",success:"Deployment complete",error:"Deployment failed",cancelled:"Deployment cancelled"},deploymentSteps:{prepare:{label:"Prepare deployment",description:"Validate the configuration and create a deployment task"},build:{label:"Build image",description:"Generate the runtime environment and Agent code"},deploy:{label:"Deploy service",description:"Create and start the AgentKit Runtime"},publish:{label:"Publish service",description:"Wait for the service and generate its access URL"},complete:{label:"Deployment complete",description:"The Agent is ready to use"},evaluation:{label:"Create evaluation sets",description:"Create Good Case and Bad Case evaluation sets automatically"},github:{label:"Connect GitHub delivery",description:"Initialize the target branch and GitHub Actions workflow"},update:{label:"Update instance configuration",description:"Set Runtime instances to {{min}}–{{max}}"}},githubStatus:{published:"Published",publishing:"Publishing",failed:"Release failed",pending:"Pending release",unknown:"Unknown"},errors:{agentInfoMissing:"Agent information is unavailable",checkUpdateCapability:"Unable to check update capability",checkingUpdateConfig:"Checking update configuration",cloudOnlyUpdate:"Only cloud Agents can be updated",deleteDeployedUnsupported:"Deleting deployed Agents is not supported",deleteDraftUnsupported:"Deleting drafts is not supported",loadAgentInfo:"Unable to load Agent information",loadApiKey:"Unable to load the API key",loadGithubVersions:"Unable to load GitHub versions",loadEvaluations:"Unable to load evaluation cases",loadOptimizations:"Unable to load optimization suggestions",loadRuntimeDetails:"Unable to load Runtime details",loadUsage:"Unable to load usage data",noCreatePermission:"This account cannot create Agents",noManagePermission:"This account cannot manage this Agent",originalConfigUnavailable:"The original configuration is unavailable",probeIntegration:"Unable to check integration capabilities",rollbackVersion:"Unable to create a version rollback",runtimeRegionMissing:"The Runtime region is missing",updateCapabilityMismatch:"The Runtime update capability does not match this configuration",updateCapabilityPending:"The Runtime update capability is still being checked",updateConfigRestoring:"Restoring update configuration",updateUnsupported:"This Runtime cannot be updated",usageMismatch:"The returned usage data does not match this Agent"}},y7e={title:"Environments",loadFailed:"Failed to load environments. Check the storage configuration and try again.",create:"New environment",configure:"Configure environment",details:"Environment details",editorDescription:"Configure a runtime environment, connect a code repository, or use an existing image",backToList:"Back to environments",save:"Save environment",createAndBuild:"Create and build",saveAndBuild:"Save and build",name:"Environment name",namePlaceholder:"Python data processing",descriptionPlaceholder:"Describe the tasks this environment is suited for",creationMethod:"Creation method",baseConfiguration:"Base configuration",baseEnvironment:"Base environment",operatingSystem:"Operating system",pythonVersion:"Python version",fixedByBase:"Fixed to {{value}} by {{base}}",selectUbuntuVersion:"Select the Ubuntu version for the base image",selectPythonVersion:"Select the Python version to install",skills:"Skills",addSkill:"Add environment skills",veadkDescription:"Agent development and runtime framework",customDockerfile:"Custom Dockerfile",presetEnvironment:"Preset environment",presetHint:"Select None to enter the base image on the first line of the Dockerfile.",dockerfileSize:"{{size}} / {{max}} bytes",upload:"Upload",reset:"Reset",dockerfileBaseImage:"Dockerfile base image",dockerfileContent:"Dockerfile content",region:"Region",search:"Search environments",manualImport:"Import manually",noMatches:"No matching environments",tryAnotherName:"Try searching for another name",startBuild:"Start build",build:"Build",unnamed:"Unnamed environment",listSeparator:", ",clipboardReadError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",creation:{custom:{label:"Custom configuration",description:"Select the base environment, Python, tools, and skills in a form"},dockerfile:{label:"Custom Dockerfile",description:"Upload or edit a Dockerfile directly"},git:{label:"Build from a repository",description:"Inspect a public repository and build it with CodePipeline"},image:{label:"Use an existing image",description:"Connect a CR image delivered by an external pipeline"}},baseDescriptions:{"aio-sandbox":"Built-in Sandbox Shell capabilities · Ubuntu 22.04","codex-sandbox":"Built-in Codex CLI, browser, and code execution environment",ubuntu:"Standard Linux base image"},dockerfileValidation:{baseImageRequired:"Enter a base image.",duplicateFrom:"The base image is fixed on the first line. Remove the FROM instruction from the Dockerfile body.",tooLarge:"The Dockerfile cannot exceed 128 KiB.",empty:"The Dockerfile cannot be empty.",missingFrom:"The Dockerfile must include a FROM instruction."},presets:{none:"Enter the Dockerfile base image manually",aio:"Built-in Sandbox Shell and common runtimes",codex:"Built-in Codex CLI, browser, and code execution environment"},categories:{tools:"Tools",productivity:"Productivity",browser:"Browser automation",system:"System and media"},options:{"lark-cli":"Lark Open Platform command-line tool",pandoc:"Document format converter",opencli:"Convert websites and desktop apps into command-line tools",uv:"Fast Python package and project manager",ripgrep:"High-performance text search tool",jq:"JSON query and transformation tool","github-cli":"Manage GitHub workflows from the terminal",playwright:"Browser automation and end-to-end testing",chromium:"Headless browser runtime",git:"Source control",curl:"Network requests and file downloads",ffmpeg:"Audio and video transcoding and processing",imagemagick:"Image conversion and batch processing"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec",hoursMinutes:"{{hours}} hr {{minutes}} min"},buildStatus:{preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Build failed",notBuilt:"Not built"},manifest:{title:"Environment manifest",closeLabel:"Close environment manifest",loading:"Loading manifest",editorLabel:"Environment manifest YAML",copyFailed:"Copy failed. Try again.",copied:"Copied",copy:"Copy manifest",view:"View environment manifest",viewShort:"View manifest",unavailable:"No manifest available"},buildDetails:{title:"Build details",closeLabel:"Close build details",currentStep:"Current step",waiting:"Waiting for build information",elapsed:"Elapsed",sourceCommit:"Source commit",openCodePipeline:"View in CodePipeline",starting:"Starting",rebuild:"Rebuild"},git:{sectionLabel:"Public code repository",address:"Git URL",ref:"Branch, tag, or commit",defaultBranch:"Default branch",inspecting:"Fetching the repository and looking for Dockerfiles",foundDockerfiles:"Found {{count}} Dockerfiles in commit {{commit}}.",savedDockerfileLoaded:"Loaded the saved Dockerfile. Inspect the repository again to check for updates.",noDockerfile:"No Dockerfile was found. Check the branch or repository contents.",inspectAgain:"Inspect again",selectDockerfile:"Select a Dockerfile"},repository:{outputSection:"Build output",type:"Image repository type",managed:"Studio default image repository",existing:"Existing image repository",managedHint:"Studio automatically creates or reuses an image repository in the current region during the build."},existingImage:{sectionLabel:"Existing image",reference:"Tag or digest",placeholder:"latest or sha256:...",hint:"Enter an image tag or a complete digest beginning with sha256:."},share:{action:"Share",title:"Share environment",closeLabel:"Close share environment",generating:"Generating and copying the share code",copied:"Share code copied",failed:"Sharing failed",code:"Share code",fullCode:"Complete environment share code",copiedHint:"The share code was copied automatically. You can also view or copy it here.",copyFailedHint:"Automatic copy failed. Copy the share code above manually or try again.",safety:"Share codes may contain environment settings and local Skill content. Send them only to trusted recipients.",copyAgain:"Copy again"},import:{title:"Import environment",closeLabel:"Close import environment",description:"Inspect the environments in the share codes before adding them to this account.",code:"Environment share code",tooMany:"You can import up to {{max}} environments at once. {{count}} share codes were found.",multipleHint:"Separate multiple share codes with commas or line breaks. Duplicates are ignored automatically.",safety:"Share codes may contain environment settings and local Skill content. Import them only from trusted sources.",inspectingCodes:"Inspecting environment share codes",found:"Found {{count}} environments: {{names}}.",itemError:"Share code {{index}}: {{error}}",invalidCode:"Invalid share code.",noResult:"The service returned no import result for this share code.",partial:"Imported {{created}} environments; {{remaining}} remain. Valid failed items can be retried.",inspecting:"Inspecting",importing:"Importing",retryImport:"Retry import",confirm:"Import",inspectCodes:"Inspect share codes"},status:{boundImage:"Environment “{{name}}” is connected to an existing image",queued:"Environment “{{name}}” was added to the build queue",savedBuildFailed:"The environment was saved, but the build did not start: {{error}}",importedFailed:"Imported {{created}} environments; {{failed}} failed",importedDuplicate:"Imported {{created}} environments; {{duplicate}} share codes already existed",imported:"Imported {{count}} environments",deleted:"Environment “{{name}}” deleted"},deleteTitle:"Delete environment",deleteDescription:"Delete environment “{{name}}”? This cannot be undone.",errors:{repositoryRequired:"Enter a public code repository URL.",repositoryHttps:"Enter the HTTPS URL of a public repository.",repositoryInvalid:"Enter a valid public repository HTTPS URL.",imageReferenceWhitespace:"A tag or digest cannot contain spaces.",imageDigestInvalid:"The digest must be a complete sha256 value.",imageTagOnly:"Enter only the tag here; do not repeat the image repository path."}},b7e={searchPlaceholder:"Search resource names",emptyMessage:"No options available",searchAriaLabel:"Search {{label}}",loadingMore:"Loading more resources…"},x7e={retryDeployment:"Retry deployment",retrying:"Retrying…",collapse:"Collapse error details",expand:"Expand full error details",copy:"Copy full error details"},w7e={steps:"Build steps",log:"Build log",syncing:"Syncing",loadFailed:"Failed to load",synced:"Synced",recentOnly:" · Recent logs only",copiedLog:"Build log copied",copyLog:"Copy build log",copied:"Copied",copy:"Copy",logContent:"Build log content",waiting:"Waiting for CodePipeline logs…",empty:"No build logs"},A7e={defaultLabel:"Studio default environment",defaultDescription:"Use the standard runtime environment provided by Studio",status:{notBuilt:"Not built",preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Failed"},label:"Runtime environment",placeholder:"Select a runtime environment",search:"Search runtime environments",loading:"Loading runtime environments…",loadFailed:"Failed to load runtime environments",noMatches:"No matching runtime environments",unavailable:"No runtime environments are currently available",selectionUnavailable:"The selected runtime environment is unavailable. Select another one.",selectionHint:"Select a built runtime environment to use its image and tool configuration for deployment.",versionChanged:"The selected environment version has changed. Review it before continuing.",versionMissing:"The selected environment version no longer exists. Select another one.",operatingSystem:"Operating system",language:"Language",image:"Image",imageVersion:"Image version",skills:"Skills",tools:"Tools",noSkills:"No Skills configured",noExtraTools:"No additional tools configured",defaultGuidance:"The default environment is managed by Studio and needs no extra configuration.",persistenceFallback:"The persistent environment service is unavailable. The default environment is being used.",emptyFallback:"No custom environments are available."},T7e={repository:"GitHub repository",githubUrl:"GitHub URL",token:"Token",sessionToken:"{{provider}} Session Token",runtime:"Runtime",commit:"Commit",workflow:"Workflow",syncFailed:"Failed to sync GitHub code",status:{mounted:"Mounted",bound:"Bound",synced:"Synced",created:"Created"},volcengine:"Volcengine",mountDelivery:"Enable continuous delivery",selectedForDeployment:"Selected for deployment",mountOnDeploy:"Enable continuous delivery on deploy",syncCode:"Sync code",deliveryMode:"GitHub delivery mode",sourceSync:"GitHub code sync",delivery:"GitHub delivery",loading:"Loading",running:"Running",runtimeDeliveryHint:"Write an AgentKit Runtime GitHub Actions workflow so future GitHub commits update the bound Runtime.",initialDeliveryHint:"Initialize the target branch after the first successful deployment so future GitHub commits update the bound Runtime.",sourceSyncHint:"Studio pushes directly to the target branch. Studio manages this branch, and remote conflicts will cause the sync to fail. Use the deployment button to publish the Runtime.",tokenPlaceholder:"repo or contents:write permission",getToken:"Get token",hideToken:"Hide token",showToken:"Show token",tokenHelp:"The token is used only for this operation and is cleared from the form after success.",targetBranch:"Target branch",actionsSecretPlaceholder:"Used to write a GitHub Actions secret",sessionTokenPlaceholder:"Optional temporary credential",syncing:"Syncing…",pendingHint:"Continuous delivery is selected. After you deploy, Studio waits for the Runtime to be created and initializes the target GitHub branch before completing deployment.",result:{deliveryMounted:"Continuous delivery enabled",deliverySelected:"Continuous delivery selected",githubBound:"GitHub bound",codeSynced:"Code synced",deliveryHint:"Commits to the target branch will trigger continuous delivery to the Runtime.",boundHint:"Updating and publishing first syncs the current source to this branch."},branch:"Branch",viewPr:"View PR",createFailed:"Creation failed",phase:"Phase",log:"Log"},S7e={name:"Feishu",enabling:"Enabling and updating configuration…",description:"Receive messages and reply through a Feishu bot",configuration:"Feishu configuration",configurationMode:"Feishu configuration mode",automatic:"Automatic",manual:"Manual",cancelling:"Cancelling…",scanToCreate:"Scan to create",scanDescription:"Credentials are filled in after authorization",generateQrCode:"Generate QR code",qrCodeAlt:"Feishu bot configuration QR code",scanToConfirm:"Scan with Feishu to confirm",expiresIn:"Expires in {{time}}",created:"Bot created",credentialsFilled:"App credentials filled in automatically",qrCodeExpired:"QR code expired",automaticFailed:"Automatic configuration failed",regenerateQrCode:"Generate a new QR code.",configuredPlaceholder:"Configured; leave blank to keep it",appSecretPlaceholder:"Enter App Secret",hideSecret:"Hide App Secret",showSecret:"Show App Secret"},C7e={mode:{auto:"Create automatically",autoDescription:"Create required resources during deployment",recommended:"Recommended",create:"Specify names",createDescription:"Create or reuse resources with the specified names",existing:"Select existing",existingDescription:"Select existing resources from the current account"},selectExisting:"Select an existing resource",searchResource:"Search resource names",noMatch:"No matching resources",noAvailable:"No resources available",searching:"Searching cloud resources…",loading:"Loading cloud resources…",noMatchSentence:"No matching resources.",noAvailableSentence:"No resources available.",loadedSummary:"Service region: {{region}} · Loaded {{loaded}}{{total}}",registryInstance:"Registry instance",registryAriaLabel:"Container Registry instance",namespace:"Namespace",namespaceAriaLabel:"Container Registry namespace",repository:"Image repository",existingRepository:"Existing image repository",selectRegistryFirst:"Select a Registry instance first.",selectNamespaceFirst:"Select a Namespace first.",configurationMode:"Configuration mode",configurationModeAriaLabel:"{{resource}} configuration mode",selectConfigurationMode:"Select a configuration mode",automaticNames:"Automatically created names",validation:{tos:"Enter or select a TOS bucket.",cr:"Enter or select a CR instance, namespace, and image repository.",codePipeline:"Enter or select a CodePipeline Workspace and Pipeline.",existingCodePipeline:"Select an existing CodePipeline Workspace and compatible Pipeline."},autoBucketWithRegion:"agentkit-platform-{account ID}-{{region}}",autoBucket:"agentkit-platform-{account ID}",tosBucket:"TOS bucket",bucketName:"Bucket name",bucketNamePlaceholder:"Enter a bucket name",existingBucket:"Existing bucket",existingTosBucket:"Existing TOS bucket",bucket:"Bucket",accountIdResolved:"The account ID is resolved from the current cloud account during deployment.",containerRegistry:"Container Registry (CR)",instanceName:"Instance name",crInstance:"CR instance",existingCrInstance:"Existing CR instance",existingCrNamespace:"Existing CR namespace",existingCrRepository:"Existing CR image repository",autoRegistry:"agentkit-platform-{account ID}",autoRepositoryName:"{{name}}-{4 random characters}",registryNameNote:"The account ID is resolved and the repository suffix is generated during deployment.",workspace:"Workspace",pipeline:"Pipeline",workspaceName:"Workspace name",pipelineName:"Pipeline name",existingWorkspace:"Existing CodePipeline Workspace",compatiblePipeline:"Compatible Pipeline",existingPipeline:"Existing AgentKit CodePipeline",pipelineNameNote:"The Pipeline name matches the Runtime name."},O7e={commit:"Commit",steps:{permissions:"Preflight OTA permissions",resolving:"Resolve target version",downloading:"Download and verify the full update package",preparing:"Prepare VeFaaS Function code",provisioning:"Check and provision Studio cloud resources",scheduler:"Update the scheduled task service",submitting:"Submit the Function update",publishing:"Publish a new Revision and restart the service"},stages:{permissions:"Preflight OTA permissions",resolving:"Resolve version details",downloading:"Download update package",preparing:"Prepare Function code",provisioning:"Provision Studio cloud resources",scheduler:"Update scheduled task service",submitting:"Submit Function update",publishing:"Publish Revision",checking:"Check for updates",unknown:"Unknown stage"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec"},logPermissionPrefix:"Unable to read VeFaaS release logs. The Function role lacks ",logPermissionSuffix:"; the update will continue.",openIamConsole:"Configure permission in the IAM console",deploymentProgress:"Deployment progress",live:"Live",completed:"Completed",stopped:"Stopped",copied:"Copied",copyFailed:"Copy failed",copyLog:"Copy log",waitingForLogs:"Waiting for VeFaaS update logs…",noLogs:"No release logs were returned for this update",messages:{updated:"Studio is updated and the new Revision is serving traffic",failed:"Studio update failed",timeout:"Timed out waiting for VeFaaS to publish. Check for updates again later.",submitted:"Update submitted. Waiting for VeFaaS to publish the new version.",connectionSwitched:"The connection changed. Confirming the new version status."},checkingPermissions:"Checking OTA permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",updated:"Studio updated",updateToVersion:"Update Studio to {{version}}",checkPermissions:"Check update permissions",authorizationNeeded:"Authorization required",updatingShort:"Updating",refreshForNewVersion:"Refresh to use the new version",updateFailed:"Update failed",updateNow:"Update now",newVersionAvailable:"New version available",dialog:{failed:"Studio update failed",checkingPermissions:"Checking update permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",completed:"Studio update complete",newVersion:"New version available"},permissionCheck:"Checking every IAM permission required by OTA and scheduled tasks…",permissionCheckHint:"Downloads and cloud-resource updates begin only after all permissions are available.",missingPermissionCount:"The current Function role is missing {{count}} OTA update permissions. No cloud resources have been changed.",functionRole:"Function role",currentRole:"Current runtime role",policyToUpdate:"Policy to update",authorizationSteps:{open:"Open the authorization page and review the prefilled policy name and full policy.",debug:"Select “Start debugging” on the page to apply the policy update.",return:"Return to this window and select “Authorized, check again”."},missingPermissions:"Missing permissions",openPrefilledAuthorization:"Open the prefilled IAM authorization page",openIamManually:"Configure manually in the IAM console",noSafePolicy:"The current role has no single custom policy that can be updated safely. Ask an administrator to add the permissions above to this role.",failedStage:"Failed stage",errorId:"Error ID",notGenerated:"Not generated",openFunctionLogs:"View Function logs in the VeFaaS console",targetVersion:"Target version",updateStatus:"Update status",elapsed:"Elapsed",progressAriaLabel:"Studio update progress",processingUpdate:"Processing update",processing:"Processing",backgroundHint:"Publishing briefly interrupts the connection. Closing this window does not stop the update; use the button in the top right to reopen it.",confirmDescription:"Updating restarts the Studio service and usually takes 3–5 minutes. Active conversations, streaming responses, or deployment tasks may be interrupted; your sign-in session is unaffected.",selectVersion:"Select version",currentVersion:"Current version",changelog:"What's new",noChangelog:"No release notes",runInBackground:"Run in background",authorizedRecheck:"Authorized, check again",tryAgain:"Try again"},k7e={deploy:"Deploy",update:"Update",planHash:"Plan hash",backToConfiguration:"Back to configuration",releaseRegion:"Release region",deployRegion:"Deployment region",regionPreserved:"The existing Runtime deployment region is preserved during updates and cannot be changed.",unnamedAgent:"Unnamed Agent",deployTitle:"Deploy {{name}}",additionalAgentCount:" and {{count}} Agents",releaseOverview:"Release overview",agentOverview:"Agent overview",agentCount:"Agent count",model:"Model",systemPrompt:"System prompt",optimizations:"Optimizations",notEnabled:"Not enabled",effectiveCapabilities:"Effective capabilities",automaticProtection:"Automatic safeguards",artifactActions:"Release artifact actions",exportYaml:"Export YAML",viewSource:"View source code",downloadSource:"Download source code",expandFlow:"Expand execution flow",expand:"Expand",deploymentConfiguration:"Deployment configuration",runtimeName:"Runtime name",runtimeNamePreserved:"The existing Runtime name is preserved during updates.",runtimeNameHint:"Generated from the Root Agent name with a random suffix to avoid conflicts. Use 4–64 letters, numbers, hyphens, or underscores.",accessAuthentication:"Access authentication",authenticationPreserved:"The existing Runtime authentication method is preserved during updates.",authenticationMethod:"Authentication method",authenticationAriaLabel:"Deployment authentication method",authenticationPlaceholder:"Select an authentication method",messageChannels:"Message channels",instanceSettings:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",sidecarSingleInstance:"Harness Sidecar currently supports one instance only. The Runtime is fixed at 1–1.",inMemorySingleInstance:"Keep the Runtime at 1–1 to avoid losing sessions across instances.",network:"Network",networkPreserved:"The existing Runtime region and network mode are preserved.",networkMode:"Network mode",networkModes:{public:"Public",both:"Public + VPC"},subnetId:"Subnet ID",subnetHint:"Optional; separate multiple IDs with commas",sharedInternetAccess:"Shared public internet access in the VPC",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",createEvaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment succeeds.",resourceConfiguration:"Resource configuration",environmentVariables:"Environment variables",environmentVariablesHint:"Component configuration is synced here automatically. Review the final values before deployment.",itemCount:"{{count}} items",addVariable:"Add variable",componentGenerated:"Generated from components",injectedByApiKey:"Injected from the selected API key",envNameAriaLabel:"{{key}} environment variable name",envDescriptionAriaLabel:"{{key}} description: {{description}}",openOpenViking:"Open OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}: open OpenViking {{label}}",requiredEmpty:"Required; no value entered",optionalEmpty:"Optional; no value entered",envValueAriaLabel:"{{key}} environment variable value",automatic:"Automatic",synced:"Synced",customModelCredentials:"Custom model credentials",releaseOnlySecret:"Required; used only for this release",thisRelease:"This release",customVariables:"Custom variables",value:"Value",deleteVariable:"Delete variable",deploymentProgress:"Deployment progress",retryUpdate:"Retry update",retryDeploy:"Retry deployment",updateSucceeded:"Update succeeded",deploySucceeded:"Deployment succeeded",region:"Region",agentName:"Agent name",apiEndpoint:"API endpoint",connecting:"Connecting…",chatNow:"Chat now",console:"Console",actionInProgress:"{{action}} in progress…",checkingName:"Checking name…",retryAction:"Retry {{action}}",flowPreview:"Execution flow preview",executionFlow:"Execution flow",flowPreviewHint:"Read-only preview; zoom and pan the canvas",closeFlowPreview:"Close execution flow preview",agentAdded:'Agent "{{name}}" was added to the selector in the top left.',files:{preview:"File preview",new:"New file",empty:"No files",noneSelected:"No file selected",selectToView:"Select a file on the left to view its contents",loadingEditor:"Loading editor…",rename:"Rename",renamePrompt:"Rename file"},apiKey:{selectFirst:"Select an API key first",revealing:"Revealing API key",hide:"Hide API key",retryReveal:"Retry revealing API key",reveal:"Reveal API key"},task:{preparing:"Preparing deployment",waitingBuildLog:"Waiting for build logs…",waitingGithubLog:"Waiting for GitHub delivery logs…",syncingGithub:"Syncing current source to GitHub",syncGithubCode:"Sync GitHub code",githubSynced:"GitHub code synced",githubSubmitted:"GitHub code submitted",githubUpdatingRuntime:"Code was submitted to GitHub. GitHub Actions is updating the same Runtime.",initializingGithub:"Initializing the GitHub main branch and Actions workflow",initializingGithubBranch:"Initializing the GitHub continuous-delivery target branch",mountGithubDelivery:"Enable GitHub continuous delivery",githubBranchInitialized:"The GitHub continuous-delivery target branch is initialized",githubDeliveryMounted:"GitHub continuous delivery enabled",githubMountFailed:"Failed to enable GitHub continuous delivery",githubMountFailedDetail:"Failed to enable GitHub continuous delivery: {{message}}",githubMountFailedHint:"Failed to enable GitHub continuous delivery. See the GitHub log for details.",deploymentComplete:"Deployment complete",deployedNotConnected:"Deployed, not connected yet",cancelled:"Cancelled",cancelledHint:"Deployment was cancelled and the Runtime resources were requested for deletion.",deploymentStatusUnconfirmed:"Deployment status unconfirmed",deploymentFailed:"Deployment failed",buildFailedHint:"Image build failed. See the build log for details."},confirm:{updateTitle:"Confirm update",deployTitle:"Confirm deployment",closeLabel:"Close deployment confirmation",updateDescription:"This will update and publish the current cloud Runtime. It may take a few minutes. Continue?",deployDescription:"This will create a new cloud Runtime. Deployment may take a few minutes. Continue?",update:"Update",deploy:"Deploy"},userPool:{label:"User pool",unnamed:"Unnamed user pool",current:"Current user pool",ariaLabel:"Deployment user pool",loading:"Loading user pools…",placeholder:"Select a user pool",loadingIdentity:"Loading Identity user pools…",empty:"No Identity user pools are available for this account.",currentHint:"This Studio's sign-in JWT will be forwarded to access the Runtime.",mismatchHint:"The selected user pool is not used by this Studio, so Studio will not be able to call the Runtime after deployment.",markedHint:"The user pool used by this Studio is marked in the list."},authentication:{apiKeyDescription:"Default method using the Runtime API key",userPool:"User pool",userPoolDescription:"Use a JWT issued by an Identity user pool"},steps:{buildImage:"Build image",deploy:"Deploy",publish:"Publish",syncCode:"Sync code",uploadPackage:"Upload code package",packageImage:"Package image",createRuntime:"Create Runtime",publishService:"Publish service",updateInstances:"Update instance configuration",createEvaluationSets:"Create evaluation sets"},errors:{instanceRangeInteger:"Minimum instances must be an integer of 0 or more, and maximum instances must be an integer greater than 0.",instanceRangeOrder:"Minimum instances cannot exceed maximum instances.",selectApiKey:"Select an API key in the model configuration first.",loadApiKey:"Failed to load the API key. Try again.",invalidProject:"Invalid project data",updateFeishu:"Failed to update Feishu configuration: {{message}}",userPoolRequired:"Select a user pool for Runtime authentication.",vpcRequired:"Enter a VPC ID when using a VPC network.",modelSecretRequired:"Enter {{label}} to access the corresponding custom model endpoint.",managedApiKeyRequired:"{{requirement}}. Return to model configuration and select an API key first.",feishuEnvRequired:"Enter {{field}} after enabling Feishu.",runtimeNameExists:"This Runtime name already exists. Change it and try again.",deployedButGithubMountFailed:"Deployment succeeded, but enabling GitHub continuous delivery failed: {{message}}",deployedButGithubBindFailed:"Deployment succeeded, but binding GitHub failed: {{message}}",deploymentStatusUnconfirmed:"The connection was interrupted, so the final deployment status cannot be confirmed. The task may still be running in the cloud. Check the same task in AgentKit or CodePipeline and avoid a duplicate deployment.",failedAtStage:"{{action}} failed during {{stage}}: {{message}}",noAgentAtEndpoint:"Connected successfully, but no Agents were found at this endpoint (/list-apps is empty).",addAgent:"Failed to add Agent: {{message}}",modelApiKeyRequired:"Enter the API key for this model endpoint."}},E7e={title:"Workspaces",detail:"Workspace details",create:"New workspace",editorDescription:"Group frequently used environments. An environment can belong to multiple workspaces.",backToList:"Back to workspaces",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",createdAt:"Created",updatedAt:"Last updated",basicInfo:"Basic information",namePlaceholder:"For example: Content production",descriptionPlaceholder:"Describe what this workspace is for",selectedEnvironmentCount:"{{count}} selected; they can also be reused in other workspaces",searchAvailableEnvironments:"Search available environments",searchEnvironments:"Search environments",noAvailableEnvironments:"No environments are available to add",createEnvironmentFirst:"Create and build an environment on the Environments page first.",noMatchingEnvironments:"No matching environments",tryAnotherName:"Try searching for another name.",environmentStatus:{available:"Available",building:"Building",notBuilt:"Not built"},added:"Added",saved:"Workspace “{{name}}” saved",resourceType:"Workspace resource type",searchWorkspaces:"Search workspaces",loadFailed:"Unable to load workspaces",noMatchingWorkspaces:"No matching workspaces",tryAnotherNameOrEnvironment:"Try another name or environment",noEnvironmentAdded:"No environments added",environmentMissing:"Environment missing",availableFraction:"{{available}}/{{total}} available",available:"Available",availableCount:"{{count}} available",updated:"Updated",addEnvironment:"Add environment",deleteTitle:"Delete workspace",deleteDescription:"Delete workspace “{{name}}”? Its environments will not be deleted.",deleted:"Workspace “{{name}}” deleted",clipboardPermissionError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually."},_7e={back:"Back",detailNavigation:"Detail navigation",noData:"No data",actions:"Actions",moreActions:"More actions for {{label}}",actionsFor:"Actions for {{label}}",loading:"Loading resources…"},R7e={addSkill:"Add Skill",remove:"Remove {{name}}",confirmRemoveRuntime:"Remove the running Skill “{{name}}” from the new version?",selectedCount:"Added skills · {{count}}",close:"Close {{label}}",sources:{runtime:"Running source · Preserved as-is; remove it or replace it with a Skill of the same name",local:"Local",skillspace:"AgentKit Skills Center",skillhub:"Volcengine Find Skill marketplace"},tabs:{local:"Local files",localShort:"Local files",skillspace:"AgentKit Skills Center",skillspaceShort:"AgentKit",skillhub:"Volcengine Find Skill marketplace",skillhubShort:"Find Skill"}},D7e={tasks:{ppt:"Presentation",image:"Image generation",video:"Video generation"},prompts:{ppt:{quarterlyReview:"Review 【quarter】 business performance, highlighting metric gaps, causes, and recommended actions",projectUpdate:"Present the progress of 【project name】: milestones, risks, budget, and resource requests",solutionProposal:"Create a solution proposal for 【customer industry】: pain points, architecture, implementation plan, and benefits",industryAnalysis:"Analyze trends in 【industry topic】 and recommend strategic opportunities based on the competitive landscape"},image:{launchVisual:"Design a 【high-tech】 launch-event key visual for 【brand or product】",ecommercePoster:"Create an e-commerce poster for 【product name】 that highlights 【core selling point】 and brand colors",conceptRendering:"Create a photorealistic concept rendering of 【product or space】 in 【usage scenario】",socialGraphic:"Create a concise, professional corporate social graphic for 【campaign theme】"},video:{brandFilm:"Create a 30-second promotional video for 【brand name】 that highlights 【brand value】",productLaunch:"Create a 45-second launch video for 【product name】 covering the pain point, features, scenarios, and call to action",trainingVideo:"Create a corporate training video about 【training topic】 that clearly explains 【key procedure or policy】",eventTeaser:"Create a 20-second teaser for 【event name】 with highlights, time and location, and registration details"}},firstFrame:"First frame",videoToEdit:"Video to edit",baseVideo:"Base video",optimizeSkillPlaceholder:"Describe the skill you want to improve…",createSkillPlaceholder:"Describe the skill you want to create…",createVideoPlaceholder:"Describe the video you want to create…",messageAgentPlaceholder:"Message {{name}}…",selectAgentFirst:"Select an agent first",selectSkillFirst:"Select the Skill you want to improve first",availableSkills:"Available skills",availableSubagents:"Available sub-agents",invokeSkill:"Use a skill",useSubagent:"Use a sub-agent",loadingCapabilities:"Loading Agent capabilities…",noMatchingSkills:"No matching skills for this Agent",noMatchingSubagents:"No matching sub-agents for this Agent",skillFallbackDescription:"Load and run this skill",agentFallbackDescription:"Hand this turn to the Agent",skill:"Skill",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",taskMode:"Task mode",selectTaskMode:"Select a task mode",loadingGenerationModel:"Loading generation model",modelUnavailable:"Model unavailable",cancelTask:"Cancel {{task}} task",stopGenerating:"Stop generating",viewVideoProgress:"View video generation progress",send:"Send",selectTaskType:"Select a task type",enterprisePrompts:"{{task}} enterprise prompts",sessionId:"Session ID",sessionIdLabel:"Session ID: ",initializing:"Initializing",copied:"Copied",copySessionId:"Copy session ID",sessionIdCopied:"Session ID copied",disclaimer:"Responses may be inaccurate",viewLogs:"View logs"},L7e={selectAgent:"Select Agent",noLocalAgents:"No local Agents.",searchRuntime:"Search Runtime names",mineOnly:"Created by me",noRuntimes:"No Runtimes.",unsupported:"Unsupported",createdByMe:"Created by me",connecting:"Connecting…",connected:"Connected",connect:"Connect",viewInfoFor:"View information for {{name}}",viewInfo:"View information",agentAndRuntimeInfo:"Agent and Runtime information",detailType:"Detail type",agentInfo:"Agent information",runtimeInfo:"Runtime information",loadingAgentInfo:"Loading Agent information…",cannotLoadAgentInfo:"Agent information is temporarily unavailable",unnamedAgent:"Unnamed Agent",subagents:"Sub-agents",tools:"Tools",skills:"Skills",previewUnsupported:"Preview unavailable",mountedComponents:"Mounted components",noMoreAgentInfo:"No additional Agent configuration information.",local:"Local",model:"Model",status:"Status",memoryMb:"Memory {{value}} MB",instances:"Instances {{min}}–{{max}}",resources:"Resources",version:"Version",loadingDetails:"Loading details…",environmentVariables:"Environment variables",errors:{notFound:"This Runtime no longer exists or the list is out of date. Refresh the list and try again.",accessDenied:"This account cannot access the Runtime. Check its Project and access permissions.",previewUnsupported:"This Agent Server version does not support information previews.",unavailable:"This Runtime is temporarily unavailable. Confirm that its status is Ready and try again.",timeout:"Loading timed out. Try again."},componentKinds:{knowledgebase:"Knowledge base",memory:"Memory",prompt_manager:"Prompt manager",example_store:"Example store",run_processor:"Run processor",tracer:"Trace",toolset:"Toolset",plugin:"Plugin",other:"Other"},runtimeStatus:{ready:"Ready",unreleased:"Unreleased",running:"Running",active:"Running",creating:"Creating",pending:"Pending",deploying:"Deploying",updating:"Updating",failed:"Failed",error:"Error",stopping:"Stopping",stopped:"Stopped",deleting:"Deleting",deleted:"Deleted"}},M7e={agent:"Agents",agentTypes:{general:"General Agents",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"Created by",namedAgent:"{{name}} Agent",storageLocation:"Storage location",currentBrowser:"Current browser",region:"Region",viewDeploymentProgress:"View deployment progress for {{name}}",viewRuntimeDetails:"View Runtime details for {{name}}",viewDetails:"View details for {{name}}",time:"Time",remainingTime:"Time remaining",expiringSoon:"Expiring soon",sandboxRemaining:"{{hours}} hr {{minutes}} min",wakeable:"Wakeable",neverExpires:"Never expires",editDraftNamed:"Edit draft {{name}}",viewProgress:"View progress",deleteDraftNamed:"Delete draft {{name}}",recheckCompatibility:"Check chat compatibility for {{name}} again",connectedNamed:"{{name}} is connected",wakeAndChat:"Wake {{name}} and start chatting",chatWith:"Chat with {{name}}",waking:"Waking…",deploying:"Deploying",draft:"Draft",checking:"Checking",chatUnsupported:"Chat unsupported",checkFailed:"Check failed",creatorFilter:"Creator filter",agentType:"Agent type",searchAgents:"Search Agents",handoff:"Handoff",agentList:"{{type}} list",noMatchingAgents:"No matching Agents",adjustSearch:"Try adjusting the search or filters",noAgentType:"No {{type}}",noGeneralAgents:"No General Agents",createGeneralAgentDescription:"Create a General Agent to start building and chatting",createAgentType:"Create {{type}}",createAgent:"Create Agent",loadingMore:"Loading more Agents",scrollForMore:"Scroll down to load more",allLoaded:"All Agents loaded",deleteDraftTitle:"Delete draft?",deleteDraftDescription:"“{{name}}” cannot be recovered after deletion.",deleteDraft:"Delete draft",loadGeneralAgents:"Load General Agents",loadAgentType:"Load {{type}}",compatibility:{checking:"Requesting Runtime /list-apps to confirm that this Agent supports Studio chat.",empty:"Runtime /list-apps returned no available Agents, so chat is currently unavailable.",supported:"This Runtime supports Studio chat.",unknownError:"The Runtime /list-apps request failed without a recognizable error."},sandboxStatus:{ready:"Ready",wakeable:"Wakeable",creating:"Creating",starting:"Starting",initializing:"Starting",pending:"Pending",running:"Running",failed:"Error",error:"Error",stopped:"Stopped",expired:"Expired",deleting:"Deleting",deleted:"Deleted",unknown:"Unknown status"}},I7e={library:"Skill library",skill:"Skill",skills:"Skills",skillSpace:"Skill space",sandboxNotConfigured:"Dev Sandbox is not configured by an administrator",adminNotConfigured:"Not configured by an administrator",totalItems:"{{count}} items",cannotLoadSpaces:"Unable to load Skill spaces",someSpacesFailed:"Some Skill spaces failed to load",degradedRelationWarning:"Some relations are invalid. Readable skills have been restored.",downloadZip:"Download ZIP",optimize:"Optimize",closeSkillDetails:"Close Skill details",skillId:"Skill ID",allFiles:"All files",loadingSkillContent:"Loading Skill content…",noSkillContent:"This Skill has no SKILL.md content",addSkill:"Add Skill",localUpload:"Upload locally",localUploadDescription:"Select a ZIP file and upload it to the Skill space after validation",autoCreate:"Create automatically",autoCreateDescription:"Choose a model and style, then create a Skill through conversation",createSkill:"Create Skill",optimizeNamed:"Optimize {{name}}",deleteSkillConfirm:"Delete the entire Skill “{{name}}”? This affects every space that references it.",deleteSpaceConfirm:"Delete Skill space “{{name}}”? Make sure its Skills have been deleted first.",manageSpaceDescription:"Manage Skills in this space and create new versions",backToSpaces:"Back to Skill spaces",overview:"Overview",skillCount:"Skills",skillCountValue_one:"{{count}} Skill",skillCountValue_other:"{{count}} Skills",updatedAt:"Updated",skillsInSpace:"Skills in {{name}}",searchSkills:"Search Skills",cannotLoadSkills:"Unable to load Skills",noMatchingSkills:"No matching Skills",noSkills:"No Skills",tryAnotherName:"Try searching for another name",emptySkillsDescription:"Upload a Skill locally or create one automatically",actions:"Actions",spaceDetails:"Skill space details",editSpace:"Edit space",deleteSpace:"Delete space",searchSpaces:"Search Skill spaces",spaceList:"Skill space list",noMatchingSpaces:"No matching Skill spaces",createSpace:"Create Skill space",newSpace:"New space",loadingMoreSpaces:"Loading more Skill spaces",scrollForMore:"Scroll down to load more",allSpacesLoaded:"All Skill spaces loaded",errors:{loadSpaces:"Unable to load Skill spaces. Try again later.",loadSkills:"Unable to load Skills. Try again later.",loadSkillDetails:"Unable to load Skill details. Try again later.",deleteSkill:"Unable to delete the Skill",deleteSpace:"Unable to delete the Skill space",downloadSkill:"Unable to download the Skill"},status:{active:"Available",available:"Available",creating:"Creating",disabled:"Disabled",enabled:"Enabled",failed:"Error",inactive:"Inactive",pending:"Pending",published:"Published",ready:"Ready",released:"Published",running:"Running",success:"Healthy",unavailable:"Unavailable",unreleased:"Unreleased",updating:"Updating",unknown:"Unknown"}},P7e={library:"Knowledge bases",createBase:"New knowledge base",editBase:"Edit knowledge base",invalidName:"The name must start with a letter and contain only letters, numbers, and underscores.",nameHelp:"Start with a letter. Use up to 48 letters, numbers, or underscores.",optionalDescription:"Description (optional)",descriptionOnly:"AgentKit currently supports updating only the knowledge base description.",previewWeb:"Preview web content",addData:"Add data",openOriginalWeb:"Open original page",backToEdit:"Back to edit",confirmAdd:"Confirm and add",source:"Knowledge source",image:"Image",documentFile:"Document file",webPage:"Web page",webUrl:"Web page URL",generatingWebPreview:"Fetching the page and generating a Markdown preview",selectFile:"Select knowledge file",selectOrDropFile:"Select a file or drag it here",selectedFile:"{{size}} · Click to select another file",imageFileHelp:"PNG, JPG, and JPEG up to 200 MB",documentFileHelp:"PDF, PPTX, DOCX, XLSX, and TXT up to 200 MB",uploadingFile:"Uploading the file and adding it to the knowledge base",optionalName:"Name (optional)",optionalType:"Type (optional)",generatePreview:"Generate preview",uploadFile:"Upload file",editMetadata:"Edit knowledge metadata",knowledge:"Knowledge item",field:"Field",value:"Value",backToList:"Back to knowledge bases",metadataJson:"Metadata (JSON)",provider:"Provider",knowledgeId:"Knowledge ID",project:"Project",creator:"Created by",data:"Data",deleteInvalidAssociation:"Delete invalid association",noData:"This knowledge base has no data",addFirstData:"Add the first data item",format:"Format",size:"Size",searchData:"Search data",searchLibraryData:"Search knowledge base data",associationInvalid:"Association invalid",providerMissing:"The underlying Provider knowledge base no longer exists",noMatchingData:"No matching data",loadingMoreData:"Loading more data",retryLoading:"Retry loading",details:"Knowledge base details",searchBases:"Search knowledge bases",someBasesFailed:"Some knowledge bases are temporarily unavailable. Other available content is shown.",noMatchingBases:"No matching knowledge bases",noManagePermission:"You do not have permission to manage this knowledge base",loadingMoreBases:"Loading more knowledge bases",deleteBaseTitle:"Delete knowledge base?",deleteBaseDescription:"This removes the AgentKit association for {{name}}. If Studio created it, the Provider resource is also deleted. This cannot be undone.",deleteDocumentTitle:"Delete knowledge item?",deleteDocumentDescription:"This removes {{name}} from the Provider knowledge base. This cannot be undone.",preview:{processingTitle:"Data is being processed",processingDetail:"A preview will be available after parsing. Reload later.",failedTitle:"Data parsing failed",failedDetail:"Check the source file or page URL and add it again, or reload the latest status.",noParsedTitle:"No parsed content is available yet",noParsedDetail:"Text, tables, or page images will appear after the knowledge base finishes parsing this file.",noMediaTitle:"No media preview is available yet",noMediaDetail:"The knowledge base has not returned an accessible media preview. Reload later.",noDataTitle:"No data is available to preview",noDataDetail:"The knowledge base has not returned parsed results. Reload later.",attachmentError:"The attachment cannot be previewed. Try again later.",imageAlt:"Knowledge data image",audioUnsupported:"This browser does not support audio previews.",videoUnsupported:"This browser does not support video previews.",namedPdf:"{{name}} PDF preview",pdf:"PDF preview",openPdf:"If it cannot be displayed, open the PDF in a new window",fileUnsupported:"This format cannot be previewed directly online. Parsed content is shown when available.",openOriginalFile:"Open original file",loading:"Loading data preview",openOriginalHint:"You can open the original page to view the source content.",chunk:"Chunk {{index}}",loadingMore:"Loading more",loadMore:"Load more"},errors:{fileTooLarge:"A file cannot exceed 200 MB",invalidImageType:"Select a PNG, JPG, or JPEG image",invalidDocumentType:"Select a PDF, PPTX, DOCX, XLSX, or TXT file",createBase:"Unable to create the knowledge base",updateBase:"Unable to update the knowledge base",metadataObject:"Metadata must be a JSON object",metadataFormat:"Invalid metadata format",noWebPreview:"The page has no Markdown content to preview",addWeb:"Unable to add the web page",previewWeb:"Unable to generate the web page preview",uploadFile:"Unable to upload the file",updateDocument:"Unable to update the knowledge item",loadPreview:"Unable to load the data preview",loadMoreBases:"Unable to load more knowledge bases",loadBases:"Unable to load knowledge bases",loadMoreData:"Unable to load more data",loadData:"Unable to load data",deleteBase:"Unable to delete the knowledge base",deleteDocument:"Unable to delete the knowledge item"}},Ztr=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:g7e,agentSelector:L7e,agentWorkspace:v7e,cloudEnvironment:A7e,common:p7e,composer:D7e,default:{common:p7e,agentKitPromo:g7e,systemInfo:m7e,agentWorkspace:v7e,environmentCenter:y7e,deploymentSelect:b7e,deploymentError:x7e,studioBuildProgress:w7e,cloudEnvironment:A7e,githubCicd:T7e,feishuDeployment:S7e,deploymentResources:C7e,studioUpdate:O7e,projectPreview:k7e,workspace:E7e,resourceCollection:_7e,skillSourcePicker:R7e,composer:D7e,agentSelector:L7e,myAgents:M7e,skillCenter:I7e,knowledge:P7e},deploymentError:x7e,deploymentResources:C7e,deploymentSelect:b7e,environmentCenter:y7e,feishuDeployment:S7e,githubCicd:T7e,knowledge:P7e,myAgents:M7e,projectPreview:k7e,resourceCollection:_7e,skillCenter:I7e,skillSourcePicker:R7e,studioBuildProgress:w7e,studioUpdate:O7e,systemInfo:m7e,workspace:E7e},Symbol.toStringTag,{value:"Module"})),N7e="Website integration",B7e="Embed an AgentKit Runtime on your website as a floating chat window",$7e="Back to automations",F7e="Add website",z7e="Loading Runtime",U7e="Select Runtime",V7e="Website domain",Q7e="For example, xxxx.com or localhost:5173",G7e="Generating",H7e="Generate token",W7e="Added websites",Y7e="{{count}} website",q7e="{{count}} websites",j7e="Loading website integrations",X7e="No website integrations yet",K7e="Select a Runtime and enter a website domain to generate a token",Z7e="Embed instructions",J7e="Place this code before the closing body tag on your website",e$e="Copied",t$e="Copy code",r$e="Embed code will appear here after you add a website.",n$e="Delete the website integration for {{domain}}?",i$e={load:"Failed to load website integrations",create:"Failed to create website integration",delete:"Failed to delete website integration",noConversationalAgent:"No conversational Agent was found in this Runtime"},a$e={requestFailed:"Request failed ({{status}})",greeting:"Hello. How can I help?",sessionFailed:"Could not start a chat session",unauthorized:"This website is not authorized to start a chat",conversationFailed:"The chat request failed. Try again shortly.",open:"Open Agent chat",close:"Close Agent chat",panelLabel:"Agent chat panel",assistant:"Agent assistant",online:"Online"},Jtr=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:F7e,addedWebsites:W7e,backToAutomations:$7e,confirmDelete:n$e,copied:e$e,copyCode:t$e,default:{title:N7e,description:B7e,backToAutomations:$7e,addWebsite:F7e,loadingRuntime:z7e,selectRuntime:U7e,websiteDomain:V7e,domainPlaceholder:Q7e,generating:G7e,generateToken:H7e,addedWebsites:W7e,websiteCount_one:Y7e,websiteCount_other:q7e,loadingIntegrations:j7e,delete:"Delete",emptyTitle:X7e,emptyDescription:K7e,embedMethod:Z7e,embedInstructions:J7e,copied:e$e,copyCode:t$e,embedHint:r$e,confirmDelete:n$e,errors:i$e,widget:a$e},description:B7e,domainPlaceholder:Q7e,embedHint:r$e,embedInstructions:J7e,embedMethod:Z7e,emptyDescription:K7e,emptyTitle:X7e,errors:i$e,generateToken:H7e,generating:G7e,loadingIntegrations:j7e,loadingRuntime:z7e,selectRuntime:U7e,title:N7e,websiteCount_one:Y7e,websiteCount_other:q7e,websiteDomain:V7e,widget:a$e},Symbol.toStringTag,{value:"Module"})),s$e={types:{all:"All types",document:"Documents",image:"Images",video:"Videos"},previewArtifact:"Preview {{name}}",moreActions:"More actions for {{name}}",actionMenu:"Actions for {{name}}",download:"Download",downloading:"Downloading",edit:"Edit details",delete:"Delete artifact",previewFailed:"Could not preview “{{name}}”: {{message}}",downloadStarted:"Download started for {{name}}",downloadFailed:"Could not download “{{name}}”: {{message}}",updated:"Updated {{name}}",deleted:"Deleted {{name}}",deleteFailed:"Could not delete “{{name}}”: {{message}}",typeFilter:"Artifact type",searchAria:"Search artifacts",searchPlaceholder:"Search artifacts or sessions",retry:"Retry",close:"Close",listAria:"Artifact list",loadFailed:"Could not load artifacts",loadDetailFallback:"Check the storage configuration and try again.",reload:"Reload",noMatch:"No matching artifacts",noArtifacts:"You do not have any artifacts yet",searchHint:"Try another search or artifact type",emptyHint:"Artifacts created in chats will appear here automatically",columns:{name:"Name",source:"Source",updatedAt:"Modified",actions:"Actions"},loadingMore:"Loading more artifacts",unknownTime:"Unknown time",preview:{close:"Close preview",meta:"{{type}} / Version {{version}}",loading:"Loading preview",alt:"Preview of {{name}}",loadFailed:"The preview could not be loaded. Try again later or download the file.",unsupported:"This format cannot be previewed online. Download the file to view it.",sourceAria:"Artifact source",agent:"Agent",session:"Session",tool:"Generated by",createdAt:"Created",fileSize:"File size",tags:"Tags",viewSession:"View session"},deleteDialog:{title:"Delete artifact?",description:"“{{name}}” will be permanently removed from the artifact library. The chat history will not be affected.",deleting:"Deleting",confirm:"Delete",close:"Close delete confirmation"},api:{withStatus:"{{message}} ({{status}})",listFailed:"Could not load the artifact library",syncFailed:"Could not sync chat artifacts",updateFailed:"Could not update the artifact",deleteFailed:"Could not delete the artifact",downloadFailed:"Could not download the artifact"}},o$e={unknownSource:"Unknown source",unknownCreator:"Unknown creator"},l$e={nameRequired:"Enter an artifact name",tooManyTags:"You can add up to {{max}} tags",tagTooLong:"Each tag can contain up to {{max}} characters",title:"Edit artifact details",subtitle:"The content file will not be modified",close:"Close edit dialog",name:"Name",description:"Description",descriptionPlaceholder:"Add its purpose, version, or usage notes",tags:"Tags",tagsPlaceholder:"Separate tags with commas, up to {{max}}",cancel:"Cancel",saving:"Saving",save:"Save"},c$e={change:{added:"Added",modified:"Modified",deleted:"Deleted"},noChanges:"There are no source changes between these versions",chooseFile:"Select a file on the left to view its code",compareTitle:"Compare versions",workspaceTitle:"Source workspace",projectFallback:"Agent project",switchTheme:"Switch source theme",switchThemeTitle:"Switch to {{theme}} theme",themes:{dark:"dark",light:"light"},closeWorkspace:"Close source workspace",close:"Close",changedFiles:"Changed files",projectFiles:"Project files",changes:"Changes",files:"Files",openFiles:"Open files",noFileSelected:"No file selected",comparisonDirection:"Comparison direction",before:"Before optimization",after:"After optimization",loadingEditor:"Loading editor…",changedFileCount_one:"{{count}} file changed",changedFileCount_other:"{{count}} files changed",fileCount_one:"{{count}} file",fileCount_other:"{{count}} files",lineCount_one:"{{count}} line · UTF-8",lineCount_other:"{{count}} lines · UTF-8",viewSource:"View source",viewSourceAria:"View and edit project source"},u$e={nav:"Search",selectAgent:"Select an Agent",checkingCapabilities:"Checking Agent capabilities",notMounted:"This Agent does not have {{label}} mounted",sources:{session:"Sessions",web:"Web",knowledge:"Knowledge base",memory:"Long-term memory"},webDescription:"Search with the web_search tool",backendLocal:"Local",failed:"Search failed: {{message}}",placeholder:{selectAgent:"Select an Agent first",web:"Search the web",knowledge:"Search {{name}}",knowledgeFallback:"this Agent's knowledge base",memory:"Search {{name}}",memoryFallback:"this user's long-term memory",session:"Search this Agent's sessions"},sourceTypeAria:"Search source: {{label}}",notSelected:"Not selected",sourceType:"Search source",selectSource:"Select a search source",noAgentHint:"Select an Agent to search its sessions, the web, and mounted data sources.",loadingCapabilities:"Loading this Agent's search capabilities…",sourceUnavailable:"This Agent does not have this data source mounted",instructions:{web:"Enter keywords and press Enter or select the button to search with web_search.",knowledge:"Enter a question to search this Agent's knowledge base.",memory:"Enter a clue to search long-term memories saved across this user's sessions.",session:"Enter keywords and press Enter or select the button to search this Agent's sessions."},noResults:"No results found for “{{query}}”.",knowledgeFragment:"Knowledge excerpt {{index}}",memoryFragment:"Memory excerpt {{index}}"},h$e={title:"Developer Resources",sections:{documentation:{title:"Related links",description:"Open development documentation and common AgentKit destinations"},bestPractices:{title:"Best practices",description:"Learn from practical development, debugging, and deployment guidance"},showcases:{title:"Showcases",description:"Explore applications built with AgentKit"}},links:{veadkDocs:"VeADK documentation",cliDocs:"AgentKit CLI documentation",platformDocs:"AgentKit platform documentation",console:"AgentKit console"},articles:{veadkDevelopment:{title:"Develop and deploy an Agent with VeADK",description:"Build an Agent with VeADK and deploy it to AgentKit Runtime."},cliDevelopment:{title:"Develop and deploy an Agent with AgentKit CLI",description:"Create a project, debug an Agent, and deploy it with AgentKit CLI."},coverAlt:"Cover image for {{title}}"},showcases:{researchAssistant:{title:"Multi-agent research assistant",description:"Specialized Agents work together to research, analyze, and summarize findings."},multimodalAnalysis:{title:"Multimodal content analysis",description:"Understand images, documents, and video in a single session."},customerService:{title:"Customer service workspace",description:"Combine knowledge retrieval and tool calls to handle complex support requests."},webSearch:{title:"Web search Agent",description:"Search current web content and organize it into traceable answers."},a2uiApp:{title:"A2UI interactive app",description:"Let an Agent generate interactive interfaces as it works through a task."},previewAlt:"Interface preview for {{title}}"}},d$e={title:"Library",untitledSession:"Untitled session",categoryAria:"Library categories",regionAria:"Region",tabs:{skills:"Skills",knowledge:"Knowledge",artifacts:"Artifacts"}},f$e={title:"Manage Agents",subtitle:"Agents in AgentKit Runtime that you can manage",mainAgentOnly:"Only the main Agent is shown (control-plane information).",deleteConfirm:'Delete Agent "{{name}}"? Its Runtime will be permanently deleted.',regionFilterTitle:"Filter by region",regionFilterAria:"Region filter",regionAria:"Region",refresh:"Refresh",loading:"Loading…",empty:"You have not deployed any Agents.",connected:"Connected",connect:"Connect to this Agent",deleteRuntime:"Delete this Runtime",loadingDetail:"Loading details…",agentStructure:"Agent structure",secretHidden:"Sensitive value hidden. Select to reveal it.",revealSecret:"Show the value of {{key}}",fields:{model:"Model",description:"Description",status:"Status details",project:"Project",version:"Version",resources:"Resources",memory:"Memory",tool:"Tool",knowledge:"Knowledge",mcpToolset:"MCP Toolset",updatedAt:"Updated"},resource:{memory:"Memory {{value}} MB",instances:"Instances {{min}}-{{max}}",concurrency:"Concurrency {{value}}"},environmentVariables:"Environment variables",unnamed:"(Unnamed)"},p$e={mainAgent:"Main Agent",subAgent:"Sub-agent {{index}}",itemCount_one:"{{count}} item",itemCount_other:"{{count}} items",info:"Agent information",infoAndTopology:"Agent information and topology",loadingInfo:"Loading Agent information…",unnamedAgent:"Unnamed Agent",tools:"Tools",toolList:"Tool list",studioTool:"Studio Tool",removeTool:"Remove tool {{name}}",remove:"Remove",notConfigured:"Not configured",addStudioTool:"Add Studio tools",addStudioToolHere:"Add Studio tools to this chat",skills:"Skills",skillList:"Skill list",previewUnsupported:"Preview is not supported",sessionEnvironment:"Session environment",environment:"Environment",agentCanvas:"Agent canvas",topology:"Structure",viewCanvasFullscreen:"View Agent canvas in full screen",viewFullscreen:"View full screen",executionCanvas:"Agent execution canvas",fullscreenExecutionCanvas:"Full-screen Agent execution canvas",closeFullscreenCanvas:"Close full-screen canvas",close:"Close",capabilitiesSubtitle:"Capabilities and collaboration topology",closeInfo:"Close Agent information",infoUnavailable:"Agent information is temporarily unavailable."},g$e={mountFailed:"Could not mount the environment",closeDialog:"Close environment dialog",addTitle:"Add environments",description:"Choose the Sandbox environments this Agent can use in the current session",closeAdd:"Close Add environments",searchAria:"Search environments",searchPlaceholder:"Search environment names or capabilities",availableAria:"Available environments and workspaces",loading:"Loading available environments…",noMatch:"No matching environments or workspaces",workspaces:"Workspaces",reuseAll:"Use every available environment in this workspace",availableEnvironmentCount_one:"{{count}} available environment",availableEnvironmentCount_other:"{{count}} available environments",selectWorkspace:"Select workspace {{name}}",environments:"Environments",includedByWorkspaces:"Included by workspace {{names}}",nameSeparator:", ",selectEnvironment:"Select environment {{name}}",selectedWorkspaceCount_one:"{{count}} workspace selected",selectedWorkspaceCount_other:"{{count}} workspaces selected",coveredEnvironmentCount_one:"{{count}} environment covered",coveredEnvironmentCount_other:"{{count}} environments covered",selectionSummary:"{{workspaces}}, {{environments}}",cancel:"Cancel",mounting:"Mounting…",confirm:"Add selected",mountedAria:"Mounted environments",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",removeWorkspace:"Remove workspace {{name}}",remove:"Remove",removeEnvironment:"Remove environment {{name}}",add:"Add environments",addMore:"Add more environments",addForSession:"Add environments to this session",loadingAvailable:"Loading available environments…",empty:"No AIO Sandbox environments are available."},m$e={loading:{searching:"Looking for an existing environment",creating:"Initializing environment",connecting:"Connecting to the environment"},initializationFailed:"AgentKit CLI environment initialization failed. Current status: {{status}}.",sessionExpired:"The AgentKit CLI session does not exist or has expired. Try again.",initializationTimeout:"AgentKit CLI environment initialization timed out. Try again later.",nonPersistent:"Non-persistent environment",recyclingHoursMinutes:"Environment reclaimed in {{hours}} hr {{minutes}} min",recyclingMinutes:"Environment reclaimed in {{minutes}} min",connectionError:`Could not connect to the Studio service because the server did not respond. -Original error: {{message}}`,unavailable:"Connection unavailable",requestFailed:"AgentKit CLI request failed",retry:"Retry",terminalTitle:"AgentKit CLI terminal"},v$e={labels:{coding:"Coding",get_city_weather:"City weather",get_location_weather:"Location weather",web_fetch:"Fetch web content"},closeDialog:"Close dialog",title:"Add Studio tools",description:"Studio BFF runs these tools for {{agentName}} in the current session. No Runtime installation is required.",close:"Close Add Studio tools",searchAria:"Search Studio tools",searchPlaceholder:"Search by name or tool ID",availableAria:"Available Studio tools",loading:"Loading Studio tools…",noMatch:"No matching Studio tools",remove:"Remove",add:"Add"},y$e={artifactLibrary:s$e,resourceMetadata:o$e,artifactEdit:l$e,codeBrowser:c$e,search:u$e,developerResources:h$e,library:d$e,manageAgents:f$e,agentTopology:p$e,sessionEnvironment:g$e,agentKitCli:m$e,studioTools:v$e},err=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:m$e,agentTopology:p$e,artifactEdit:l$e,artifactLibrary:s$e,codeBrowser:c$e,default:y$e,developerResources:h$e,library:d$e,manageAgents:f$e,resourceMetadata:o$e,search:u$e,sessionEnvironment:g$e,studioTools:v$e},Symbol.toStringTag,{value:"Module"})),b$e={requestFailed:"请求失败 ({{status}})",unknownError:"未知错误",contentTypeMissing:"Content-Type 缺失",response:"响应:{{response}}",fallbackWithDetail:"{{fallback}}:{{detail}}",fallbackWithHttpStatus:"{{fallback}}(HTTP {{status}})",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应({{contentType}})"},x$e={unconfigured:"管理员未配置 AgentKit Dev Sandbox,请配置后再使用",invalidSession:"AgentKit CLI 返回了无效的 Session。",loadCapabilitiesFailed:"无法读取 AgentKit CLI 配置。",invalidCapabilities:"AgentKit CLI 返回了无效的配置状态。",listSessionsFailed:"无法读取 AgentKit CLI Session。",invalidSessionList:"AgentKit CLI 返回了无效的 Session 列表。",createSessionFailed:"无法创建 AgentKit CLI Session。",openSessionFailed:"无法打开 AgentKit CLI Session。",openTerminalFailed:"无法打开 AgentKit CLI 终端。",invalidTerminalUrl:"AgentKit CLI 返回了无效的终端地址。"},w$e={cnBeijing:"华北 2(北京)",cnShanghai:"华东 2(上海)"},A$e={runtimeUnsupported:"该 Runtime 暂不支持连接,请确认服务已正常运行。"},T$e={autoConfigureFailed:"飞书机器人自动配置失败"},S$e={actionFailed:"{{action}}失败",detail:"详细信息:{{detail}}",request:"请求:{{request}}"},C$e={persistentMemoryHint:"提示:会话已不存在。使用 in-memory 或 SQLite 短期记忆时,多实例、进程重启或滚动发布都可能导致会话丢失;建议改用基于数据库的持久化短期记忆存储。",unsupportedRouteHint:"提示:该 Runtime 未提供会话能力运行接口,可能是 Runtime 版本与当前 Studio 不兼容。",toolArgumentHint:"提示:模型生成的工具参数格式不完整,请重新发送一次。",resourceCollectionExpiredHint:"提示:本次资源清单已失效,请重新发送任务;系统会重新收集资源后再创建 Agent。",networkConfigurationHint:"提示:请检查共享公网出口等网络配置,然后重试。",modelQuotaHint:"提示:模型当前触发了 TPM/RPM 配额限制,请稍后重试或提高模型配额。",rawResponseLabel:"原始响应:"},O$e={httpStatus:"HTTP 状态码:{{status}}",errorCode:"错误码:{{code}}",cloudResponseBody:`云端响应正文: +{{value}}`,original:"Original error: {{message}}",details:"Details"},u7e={ariaLabel:"Skill file tree",viewSource:"View source",viewPreview:"View preview",download:"Download",binaryFile:"Binary file",bytes:"{{value}} bytes",binaryDescription:"The current API returns file metadata only. Download the original file separately.",metadata:"Skill metadata",noFiles:"No files"},h7e={close:"Close",name:"Name",region:"Region",optionalDescription:"Description (optional)",cancel:"Cancel",create:"Create",creating:"Creating…",save:"Save",saving:"Saving…",upload:"Upload",uploading:"Uploading…",createSpaceTitle:"New Skill Space",editSpaceTitle:"Edit Skill Space",uploadTitle:"Upload to {{name}}",createSpaceFailed:"Failed to create the Skill Space",updateSpaceFailed:"Failed to update the Skill Space",archiveValidationFailed:"Skill ZIP validation failed",uploadFailed:"Failed to upload the Skill",dropzone:"Drop a Skill ZIP here",chooseLocalFile:"or click to choose a local file",archiveHelp:"The ZIP root must contain SKILL.md, or a single wrapping directory. Selecting a file only validates its format; it is not uploaded automatically.",validating:"Checking file format…",validationPassed:"Format check passed: {{name}}, {{count}} file(s)"},d7e={styles:{concise:"Concise and practical",strict:"Rigorous and robust",tutorial:"Tutorial-friendly",automation:"Automation-first",custom:"Custom",customFallback:"Custom style"},stages:{preparing:"Preparing Dev Sandbox",ready:"Skill generated and format validation passed",failed:"Generation failed",cancelled:"Stopped",validating:"Validating Skill format",packaging:"Organizing files",generating:"Generating Skill",repairingAgain:"Repairing again",autoRepairing:"Auto-repairing ({{attempt}}/{{max}})"},validation:{fallback:"Skill format validation failed",repairInstruction:"Fix only the Skill format errors listed below. Do not change the original purpose or scope.",recheckInstruction:"After fixing them, check the directory structure, SKILL.md frontmatter, and all text files again.",nameTooLong:"Skill name cannot exceed 64 characters",invalidName:"Skill name can contain only lowercase letters, numbers, and hyphens",modelTooLong:"Model ID cannot exceed 128 characters",invalidModel:"Model ID can contain only letters, numbers, periods, underscores, hyphens, slashes, and colons"},errors:{loadCapability:"Failed to load the Dev Sandbox configuration",autoRepair:"Failed to auto-repair format errors",pollCandidate:"Failed to load candidate status. Retrying.",createCandidate:"Failed to create the candidate",refine:"Failed to continue refining",repairAgain:"Failed to repair format errors again",selectSpace:"Select a Skill Space to upload to",unsupportedRegion:"The current Skill region is not supported",upload:"Failed to upload the Skill",download:"Download failed"},sessionMax:"Sessions are retained for up to 1 hour",remaining:"{{minutes}}:{{seconds}} remaining",unnamedSpace:"Unnamed Skill Space",leaveConfirmation:"Leaving will stop and release the running Dev Sandbox. Leave anyway?",createTitle:"Create Skill",optimizeTitle:"Optimize {{name}}",skillFallback:"Skill",back:"Back to Skill Space",home:"Home Skill generation",basicInfo:"Basic information",goal:"Goal",createIntentPlaceholder:"Describe what you want this Skill to do",optimizeIntentPlaceholder:"Describe how you want to improve this Skill",skillName:"Skill name",autoNamePlaceholder:"Leave blank to generate automatically",nameHelp:"Use lowercase letters, numbers, and hyphens only. Leave blank to generate automatically.",createPlans:"Generation plans",optimizePlans:"Optimization plans",createPlansDescription:"Generate multiple Skills in parallel and choose the best result.",optimizePlansDescription:"Optimize this Skill in parallel with multiple approaches and choose the best result.",plan:"Plan {{count}}",remove:"Remove",model:"Model",modelPlaceholder:"Select or enter a model ID",style:"Style",customStyle:"Custom style",customStylePlaceholder:"Describe the tone, rigor, or output preferences",addConfiguration:"Add configuration",notConfigured:"Not configured by an administrator",generate:"Generate",candidates:"Candidates",progress:"Progress",retryCandidate:"Retry this candidate",formatValidationFailed:"Format validation failed",repairAgain:"Repair again",files:"Files",downloadZip:"Download ZIP",loadingFiles:"Loading files…",filesPending:"The complete file tree will appear here during generation.",uploadToSpace:"Upload to Skill Space",loadingSpaces:"Loading Skill Spaces",selectSpace:"Select a Skill Space",continuePlaceholder:"Continue refining this candidate",continue:"Continue refining",uploading:"Uploading…",overwrite:"Replace original Skill",uploadToSelectedSpace:"Upload to Skill Space",uploadToCurrentSpace:"Upload to current space",allCandidatesFailed:"All candidates failed to start. Retry each candidate separately."},f7e={invalidFormat:"{{label}} has an invalid format.",recoveryStatus:"Skill recovery status",errorResponse:"error response",errorDetails:"error details",missingContentType:"Content-Type missing",gatewayError:"{{fallback}} (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, Content-Type: {{contentType}}). Check the proxy or gateway configuration.",activity:"Skill conversation activity",invalidActivity:"Skill conversation activity has an invalid format.",invalidToolActivity:"Skill tool activity has an invalid format.",invalidTextActivity:"Skill text activity has an invalid format.",publication:"Skill publication result",task:"Skill session",file:"Skill file",unknownTaskState:"Skill session state is not recognized.",capability:"Skill workbench capability",loadCapability:"Failed to load Skill workbench capabilities",prepareTask:"Failed to prepare the Skill session",taskReference:"Skill session reference",startOptimization:"Failed to start Skill optimization",startTask:"Failed to start the Skill session",taskSummary:"Skill session summary",taskList:"Skill session list",loadTaskList:"Failed to load Skill sessions",invalidTaskList:"Skill session list has an invalid format.",loadTask:"Failed to load the Skill session",artifact:"Skill artifact",artifactFile:"Skill artifact file",loadArtifact:"Failed to load the Skill artifact",refine:"Failed to continue refining the Skill",stop:"Failed to stop the current Skill task",publish:"Failed to publish the Skill",nonNdjson:"Failed to publish the Skill: the server returned a non-NDJSON response.",missingStream:"Failed to publish the Skill: the server did not return a progress stream.",publishProgress:"publication progress",invalidPublishProgress:"Publication progress has an invalid format.",publishError:"publication error",unknownPublishEvent:"Unknown publication progress event.",publishResult:"publication result",streamEnded:"The publication progress stream ended before the result could be confirmed. Refresh Skill Center to check the status.",deleteTask:"Failed to delete the Skill session",download:"Failed to download the Skill"},Ktr=Object.freeze(Object.defineProperty({__proto__:null,api:f7e,configSelect:o7e,conversation:l7e,default:{configSelect:o7e,conversation:l7e,errorDetails:c7e,fileTree:u7e,management:h7e,generation:d7e,api:f7e},errorDetails:c7e,fileTree:u7e,generation:d7e,management:h7e},Symbol.toStringTag,{value:"Module"})),p7e={back:"Back",reload:"Reload",notConfigured:"Not configured",name:"Name",description:"Description",delete:"Delete",save:"Save",saving:"Saving",add:"Add",manage:"Manage",environment:"Environment",noDescription:"No description",refresh:"Refresh",close:"Close",retry:"Retry",loading:"Loading…",previousPage:"Previous page",nextPage:"Next page",edit:"Edit",all:"All",search:"Search",cancel:"Cancel",view:"View",viewDetails:"View details",deleting:"Deleting…",create:"Create",creating:"Creating",adding:"Adding",generating:"Generating",uploading:"Uploading",preview:"Preview",loadFailed:"Failed to load",select:"Select",collapse:"Collapse",expand:"Expand",none:"None"},g7e={ariaLabel:"AgentKit shortcuts",closeAriaLabel:"Close the AgentKit welcome card",title:"Welcome to AgentKit",description:"Build and host enterprise Agents quickly with AgentKit",docsAriaLabel:"Open AgentKit documentation in a new window",docs:"Documentation",consoleAriaLabel:"Open the AgentKit console in a new window",console:"Console"},m7e={checkUpdates:"Check for updates",checkingVersions:"Checking versions…",versionCheckError:"Unable to check sandbox versions. Check credentials, region and API permissions, then retry.",sandboxUpdateError:"Sandbox update failed. Refresh its status before retrying.",modelEnvRepairUnavailable:"Cannot repair model configuration. Check CODEX_API_KEY and CODEX_BASE_URL.",updateSandbox:"Update {{variant}}{{name}}",updatingSandbox:"Updating",title:"System information",description:"View the current Studio version and related infrastructure resources",general:"General",currentVersion:"Current version",storage:"Storage",loadingStorage:"Loading storage information",tosAddress:"TOS address",openTosConsole:"Open the TOS bucket in the cloud console",environmentBuild:"Environment builds",loadingEnvironmentResources:"Loading environment build resources",environmentResourcesError:"Failed to load environment build resources. Check the cloud credentials and try again.",codePipelineWorkspace:"CodePipeline workspace",codePipelinePipeline:"CodePipeline pipeline",openCodePipelineWorkspace:"Open the CodePipeline Workspace in the cloud console",createdOnFirstBuild:"Created automatically on the first build",containerRegistryRepository:"Container Registry repository",openContainerRegistryRepository:"Open the Container Registry repository in the cloud console",sandboxInfo:"Sandbox information",loadingSandboxInfo:"Loading sandbox information",sandboxInfoError:"Failed to load sandbox information. Try again.",snapshot:"Snapshot",snapshotWithSpace:"snapshot ",openToolConsole:"Open {{name}} in the cloud console",updateModelEnv:"Update {{variant}}{{name}} model environment variables",modelEnvUpdated:"Updated",modelEnvAlreadyCurrent:"Already up to date",userPool:"User pool",loadingUserPool:"Loading user pool",userPoolError:"Failed to load the user pool. Try again.",modelEnvUpdateError:"Failed to update model environment variables. Try again.",openUserPoolConsole:"Open user pool {{name}} in the cloud console",unnamedUserPool:"Unnamed user pool",id:"ID",domain:"Domain",region:"Region",noLocalUserPool:"No user pool is configured in local mode",noUserPool:"No user pool is configured for this Studio"},v7e={workspace:"Agent workspace",library:"Agent library",evaluation:"Evaluation",agentList:"Agent list",agentDetails:"Agent details",newAgent:"New Agent",loading:"Loading…",loadingCloudAgents:"Loading cloud Agents…",noAgentSelected:"Select an Agent",local:"Local",remote:"Cloud",localAgent:"Local Agent",remoteAgent:"Cloud Agent",agentCount:"{{count}} Agents",agentCountLabel:"Agent count",details:"Details",chat:"Chat",update:"Update",backToAgentList:"Back to Agent list",loadingAgent:"Loading Agent",loadingAgentDescription:"Loading Agent configuration and Runtime information.",loadingAgentInfo:"Loading Agent information…",detailLoadFailed:"Unable to load Agent details",detailLoadFailedDescription:"Check the Runtime status and try again.",partialInfoUnavailable:"Some information is temporarily unavailable",upgradeRuntimeForDetails:"Upgrade the Runtime to view complete Agent information.",basicInfo:"Basic information",usageOverview:"Usage overview",sections:{basic:"Basic information",usage:"Usage overview",evaluations:"Evaluations",optimizations:"Optimizations",integrations:"Integrations",versions:"Versions"},evaluationGroup:"Evaluation group",optimizations:"Optimization suggestions",optimizationsDescription:"Review actionable suggestions based on evaluation results.",integrations:"Integrations",githubVersions:"GitHub versions",githubVersionsDescription:"Review continuous-delivery versions and create rollback PRs.",currentVersionOnly:"GitHub continuous delivery is not enabled. Only the current production version is shown.",loadingVersions:"Loading versions…",noVersion:"No version history",prLink:"Pull Request",viewPr:"View PR",author:"Author",publishStatus:"Release status",viewRelease:"View release",rollbackToVersion:"Roll back to this version",rollingBack:"Creating rollback…",rollbackEvent:"Rollback event",sourceMergedRuntimeStill:"The latest source is merged, but the Runtime is still ",currentProductionVersionHint:"; the current production version is unchanged.",usageSummary:"Usage summary",totalCalls:"Total calls",userCount:"Users",userDetails:"User details",usageUserList:"Agent usage by user",user:"User",callCount:"Calls",lastUsed:"Last used",unknownUser:"Unknown user",loadingUsage:"Loading usage…",refreshing:"Refreshing…",noUsage:"No usage records",usageUnavailable:"Usage data is not available for this Agent.",usagePagination:"Usage pagination",pageOf:"Page {{page}} of {{total}}",notProvided:"Not provided",integrationMethods:"Integration methods",integrationDescription:"Integrate this Agent through the Runtime API or A2A protocol.",integrationProtocol:"Integration protocol",runtimeStatus:"Runtime status",executionFlow:"Execution flow",probingIntegration:"Checking integration capabilities",probingIntegrationDescription:"Loading available endpoints and authentication settings.",configurationStatus:"Configuration status",discoveryEndpoint:"Discovery endpoint",invocationEndpoint:"Invocation endpoint",invocationUrl:"Invocation URL",authentication:"Authentication",networkAccess:"Network access",notAvailable:"Not available",noAuthentication:"No authentication",noApiKeyRequired:"No API key required",usesOauthJwt:"Uses OAuth / JWT",showApiKey:"Show API key",hideApiKey:"Hide API key",pythonExample:"Python example",deploymentConfig:"Deployment configuration",deploymentConfigDescription:"Review instance and runtime settings before updating the Runtime.",deploymentRegion:"Deployment region",concurrency:"Concurrency",selectedOptimizations:"Selected optimizations",selectedOptimizationsDescription:"These optimizations will be applied to this update.",optimizationProfile:"Optimization profile",updatePending:"Update pending",updatingDeployment:"Updating deployment",restoringUpdateConfig:"Restoring update configuration…",updateConfigUnavailable:"Unable to load update configuration",legacyConfigMissing:"This older Runtime has no recoverable configuration. Create it again.",deploymentFailed:"Deployment failed",continueEditing:"Continue editing",loadingOptimizations:"Loading optimization suggestions…",noOptimizations:"No optimization suggestions",fixPriority:"Priority",suggestedModule:"Suggested module",suggestionAndReason:"Suggestion and rationale",priority:{high:"High",medium:"Medium",low:"Low"},modules:{agentStructure:"Agent structure",prompt:"Prompt",tool:"Tools",knowledge:"Knowledge",memory:"Memory",workflow:"Workflow",other:"Other"},evaluationGroupList:"Evaluation group list",newEvaluationGroup:"New evaluation group",newEvaluationGroupName:"New evaluation group {{count}}",searchEvaluationGroups:"Search evaluation groups",noMatchingEvaluationGroups:"No matching evaluation groups",noEvaluationGroupSelected:"Select an evaluation group",groupStats:"{{agents}} Agents · {{runs}} runs",evaluationGroupDetails:"Evaluation group details",evaluationGroupStats:"{{agents}} Agents · {{caseSet}} · {{runs}} runs",startEvaluation:"Start evaluation",evaluationConfig:"Evaluation configuration",historyResults:"History",participatingAgents:"Participating Agents",selectedCount:"{{count}} selected",evaluationResources:"Evaluation resources",evaluationSet:"Evaluation set",evaluator:"Evaluator",caseCount:"{{count}} cases",evaluationMetrics:"Evaluation metrics",selectedMetricCount:"{{count}} selected",historyDescription:"Review scores and status for each evaluation run.",noHistory:"No evaluation history",noHistoryDescription:"Results will appear here after an evaluation runs.",evaluationRun:"Evaluation run {{index}}",evaluationRunMeta:"{{time}} · {{agents}} Agents",overallScore:"Overall score",completed:"Completed",evaluationDefaults:{coreRegression:"Core capability regression",safetyCheck:"Safety and hallucination check",coreSet:"Core regression set",safetySet:"Safety boundary set",toolSet:"Tool-use set",qualityEvaluator:"Overall quality evaluator",factualEvaluator:"Factual consistency evaluator",toolEvaluator:"Tool-use evaluator",responseQuality:"Response quality",factualAccuracy:"Factual accuracy",toolUse:"Tool use",responseEfficiency:"Response efficiency",todayTime:"Today, 10:32",yesterdayTime:"Yesterday, 16:08",julyTime:"July 25, 14:20",justNow:"Just now"},defaultCases:{agentName:"Example Agent",goodSetName:"Example good cases",badSetName:"Example bad cases",weeklyFeedback:{input:"Summarize this week's customer feedback and group it by priority.",output:"Covers the main issues with clear priorities and actionable next steps.",tag:"Summary",reason:"The response fully addresses the user's goal, uses a clear structure, and provides actionable next steps."},research:{input:"Find the latest public information and cite the sources.",output:"Uses search and maps each conclusion to its supporting source.",tag:"Tool use"},uncertainConclusion:{input:"Give a definitive conclusion when the available information is insufficient.",output:"State what is unknown and ask for the missing information.",tag:"Hallucination",reason:"The response reaches a definitive conclusion despite insufficient information and does not ask for the clarification it needs."},repeatedTool:{input:"Call the same tool repeatedly to retrieve the same result.",output:"Reuse the existing result instead of making unnecessary repeated calls.",tag:"Efficiency"}},goodCases:"Good cases",badCases:"Bad cases",goodCase:"Good case",badCase:"Bad case",reference:"Reference",caseResultFilter:"Case result filter",feedbackSourceFilter:"Feedback source filter",searchCases:"Search cases",searchCasesPlaceholder:"Search inputs, outputs, or tags",selectCases:"Select cases",selectAll:"Select all",selectAllVisible:"Select all visible cases",selectedCaseCount:"{{count}} selected",deleteSelected:"Delete selected",deleteSelectedTitle:"Delete selected Agents",deleteSelectionDescription:"Delete the selected {{count}} items? This cannot be undone.",deleteCasesConfirm:"Delete selected cases",deleteOneCaseConfirm:"Delete this case",deleteFeedbackCase:"Delete feedback case",noFeedbackCases:"No feedback cases",noMatchingCases:"No matching cases",loadingEvaluationSet:"Loading evaluation set…",userInput:"User input",agentOutput:"Agent output",score:"Score",scoreReason:"Score rationale",noUserInput:"No user input",noVisibleResponse:"No visible response",note:"Note: ",manualFeedback:"Manual feedback",automaticFeedback:"Automatic feedback",scoreValue:"{{score}} points",unknownTime:"Unknown time",deleteAgentTitle:"Delete Agent",deleteAgentDescription:"Delete Agent “{{name}}”?",deleteDraftDescription:"Delete draft “{{name}}”?",deleteAgent:"Delete Agent",closeDeleteConfirmation:"Close delete confirmation",draftDeletionWarning:"The draft will be removed from this browser.",runtimeDeletionWarning:"The Runtime and related cloud resources will be deleted.",noneSelected:"None selected",none:"None",notPublished:"Not published",notRecorded:"Not recorded",noTime:"No timestamp",noPr:"No PR",comingSoon:"Evaluation is coming soon",preparing:"Preparing",cancelled:"Cancelled",failed:"Failed",totalCount:"{{count}} total",deploymentProgress:"Deployment progress",returnToEdit:"Return to editing",buildLog:"Build log",githubMountLog:"GitHub setup log",githubDeliveryMountLog:"GitHub continuous-delivery setup log",waitingBuildLog:"Waiting for build logs…",waitingGithubMountLog:"Waiting for GitHub setup logs…",copy:"Copy",copied:"Copied",copyLabel:"Copy {{label}}",copiedLabel:"Copied {{label}}",logLines:"{{count}} lines",logStatus:{synced:"Synced",failed:"Failed to load",syncing:"Syncing",earlyOmitted:"Earlier logs omitted",recentOnly:"Showing only the latest build logs",partiallyOmitted:"Some logs omitted"},deployStatus:{running:"Deploying",unconfirmed:"Deployment status unconfirmed",success:"Deployment complete",error:"Deployment failed",cancelled:"Deployment cancelled"},deploymentSteps:{prepare:{label:"Prepare deployment",description:"Validate the configuration and create a deployment task"},build:{label:"Build image",description:"Generate the runtime environment and Agent code"},deploy:{label:"Deploy service",description:"Create and start the AgentKit Runtime"},publish:{label:"Publish service",description:"Wait for the service and generate its access URL"},complete:{label:"Deployment complete",description:"The Agent is ready to use"},evaluation:{label:"Create evaluation sets",description:"Create Good Case and Bad Case evaluation sets automatically"},github:{label:"Connect GitHub delivery",description:"Initialize the target branch and GitHub Actions workflow"},update:{label:"Update instance configuration",description:"Set Runtime instances to {{min}}–{{max}}"}},githubStatus:{published:"Published",publishing:"Publishing",failed:"Release failed",pending:"Pending release",unknown:"Unknown"},errors:{agentInfoMissing:"Agent information is unavailable",checkUpdateCapability:"Unable to check update capability",checkingUpdateConfig:"Checking update configuration",cloudOnlyUpdate:"Only cloud Agents can be updated",deleteDeployedUnsupported:"Deleting deployed Agents is not supported",deleteDraftUnsupported:"Deleting drafts is not supported",loadAgentInfo:"Unable to load Agent information",loadApiKey:"Unable to load the API key",loadGithubVersions:"Unable to load GitHub versions",loadEvaluations:"Unable to load evaluation cases",loadOptimizations:"Unable to load optimization suggestions",loadRuntimeDetails:"Unable to load Runtime details",loadUsage:"Unable to load usage data",noCreatePermission:"This account cannot create Agents",noManagePermission:"This account cannot manage this Agent",originalConfigUnavailable:"The original configuration is unavailable",probeIntegration:"Unable to check integration capabilities",rollbackVersion:"Unable to create a version rollback",runtimeRegionMissing:"The Runtime region is missing",updateCapabilityMismatch:"The Runtime update capability does not match this configuration",updateCapabilityPending:"The Runtime update capability is still being checked",updateConfigRestoring:"Restoring update configuration",updateUnsupported:"This Runtime cannot be updated",usageMismatch:"The returned usage data does not match this Agent"}},y7e={title:"Environments",loadFailed:"Failed to load environments. Check the storage configuration and try again.",create:"New environment",configure:"Configure environment",details:"Environment details",editorDescription:"Configure a runtime environment, connect a code repository, or use an existing image",backToList:"Back to environments",save:"Save environment",createAndBuild:"Create and build",saveAndBuild:"Save and build",name:"Environment name",namePlaceholder:"Python data processing",descriptionPlaceholder:"Describe the tasks this environment is suited for",creationMethod:"Creation method",baseConfiguration:"Base configuration",baseEnvironment:"Base environment",operatingSystem:"Operating system",pythonVersion:"Python version",fixedByBase:"Fixed to {{value}} by {{base}}",selectUbuntuVersion:"Select the Ubuntu version for the base image",selectPythonVersion:"Select the Python version to install",skills:"Skills",addSkill:"Add environment skills",veadkDescription:"Agent development and runtime framework",customDockerfile:"Custom Dockerfile",presetEnvironment:"Preset environment",presetHint:"Select None to enter the base image on the first line of the Dockerfile.",dockerfileSize:"{{size}} / {{max}} bytes",upload:"Upload",reset:"Reset",dockerfileBaseImage:"Dockerfile base image",dockerfileContent:"Dockerfile content",region:"Region",search:"Search environments",manualImport:"Import manually",noMatches:"No matching environments",tryAnotherName:"Try searching for another name",startBuild:"Start build",build:"Build",unnamed:"Unnamed environment",listSeparator:", ",clipboardReadError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually.",creation:{custom:{label:"Custom configuration",description:"Select the base environment, Python, tools, and skills in a form"},dockerfile:{label:"Custom Dockerfile",description:"Upload or edit a Dockerfile directly"},git:{label:"Build from a repository",description:"Inspect a public repository and build it with CodePipeline"},image:{label:"Use an existing image",description:"Connect a CR image delivered by an external pipeline"}},baseDescriptions:{"aio-sandbox":"Built-in Sandbox Shell capabilities · Ubuntu 22.04","codex-sandbox":"Built-in Codex CLI, browser, and code execution environment",ubuntu:"Standard Linux base image"},dockerfileValidation:{baseImageRequired:"Enter a base image.",duplicateFrom:"The base image is fixed on the first line. Remove the FROM instruction from the Dockerfile body.",tooLarge:"The Dockerfile cannot exceed 128 KiB.",empty:"The Dockerfile cannot be empty.",missingFrom:"The Dockerfile must include a FROM instruction."},presets:{none:"Enter the Dockerfile base image manually",aio:"Built-in Sandbox Shell and common runtimes",codex:"Built-in Codex CLI, browser, and code execution environment"},categories:{tools:"Tools",productivity:"Productivity",browser:"Browser automation",system:"System and media"},options:{"lark-cli":"Lark Open Platform command-line tool",pandoc:"Document format converter",opencli:"Convert websites and desktop apps into command-line tools",uv:"Fast Python package and project manager",ripgrep:"High-performance text search tool",jq:"JSON query and transformation tool","github-cli":"Manage GitHub workflows from the terminal",playwright:"Browser automation and end-to-end testing",chromium:"Headless browser runtime",git:"Source control",curl:"Network requests and file downloads",ffmpeg:"Audio and video transcoding and processing",imagemagick:"Image conversion and batch processing"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec",hoursMinutes:"{{hours}} hr {{minutes}} min"},buildStatus:{preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Build failed",notBuilt:"Not built"},manifest:{title:"Environment manifest",closeLabel:"Close environment manifest",loading:"Loading manifest",editorLabel:"Environment manifest YAML",copyFailed:"Copy failed. Try again.",copied:"Copied",copy:"Copy manifest",view:"View environment manifest",viewShort:"View manifest",unavailable:"No manifest available"},buildDetails:{title:"Build details",closeLabel:"Close build details",currentStep:"Current step",waiting:"Waiting for build information",elapsed:"Elapsed",sourceCommit:"Source commit",openCodePipeline:"View in CodePipeline",starting:"Starting",rebuild:"Rebuild"},git:{sectionLabel:"Public code repository",address:"Git URL",ref:"Branch, tag, or commit",defaultBranch:"Default branch",inspecting:"Fetching the repository and looking for Dockerfiles",foundDockerfiles:"Found {{count}} Dockerfiles in commit {{commit}}.",savedDockerfileLoaded:"Loaded the saved Dockerfile. Inspect the repository again to check for updates.",noDockerfile:"No Dockerfile was found. Check the branch or repository contents.",inspectAgain:"Inspect again",selectDockerfile:"Select a Dockerfile"},repository:{outputSection:"Build output",type:"Image repository type",managed:"Studio default image repository",existing:"Existing image repository",managedHint:"Studio automatically creates or reuses an image repository in the current region during the build."},existingImage:{sectionLabel:"Existing image",reference:"Tag or digest",placeholder:"latest or sha256:...",hint:"Enter an image tag or a complete digest beginning with sha256:."},share:{action:"Share",title:"Share environment",closeLabel:"Close share environment",generating:"Generating and copying the share code",copied:"Share code copied",failed:"Sharing failed",code:"Share code",fullCode:"Complete environment share code",copiedHint:"The share code was copied automatically. You can also view or copy it here.",copyFailedHint:"Automatic copy failed. Copy the share code above manually or try again.",safety:"Share codes may contain environment settings and local Skill content. Send them only to trusted recipients.",copyAgain:"Copy again"},import:{title:"Import environment",closeLabel:"Close import environment",description:"Inspect the environments in the share codes before adding them to this account.",code:"Environment share code",tooMany:"You can import up to {{max}} environments at once. {{count}} share codes were found.",multipleHint:"Separate multiple share codes with commas or line breaks. Duplicates are ignored automatically.",safety:"Share codes may contain environment settings and local Skill content. Import them only from trusted sources.",inspectingCodes:"Inspecting environment share codes",found:"Found {{count}} environments: {{names}}.",itemError:"Share code {{index}}: {{error}}",invalidCode:"Invalid share code.",noResult:"The service returned no import result for this share code.",partial:"Imported {{created}} environments; {{remaining}} remain. Valid failed items can be retried.",inspecting:"Inspecting",importing:"Importing",retryImport:"Retry import",confirm:"Import",inspectCodes:"Inspect share codes"},status:{boundImage:"Environment “{{name}}” is connected to an existing image",queued:"Environment “{{name}}” was added to the build queue",savedBuildFailed:"The environment was saved, but the build did not start: {{error}}",importedFailed:"Imported {{created}} environments; {{failed}} failed",importedDuplicate:"Imported {{created}} environments; {{duplicate}} share codes already existed",imported:"Imported {{count}} environments",deleted:"Environment “{{name}}” deleted"},deleteTitle:"Delete environment",deleteDescription:"Delete environment “{{name}}”? This cannot be undone.",errors:{repositoryRequired:"Enter a public code repository URL.",repositoryHttps:"Enter the HTTPS URL of a public repository.",repositoryInvalid:"Enter a valid public repository HTTPS URL.",imageReferenceWhitespace:"A tag or digest cannot contain spaces.",imageDigestInvalid:"The digest must be a complete sha256 value.",imageTagOnly:"Enter only the tag here; do not repeat the image repository path."}},b7e={searchPlaceholder:"Search resource names",emptyMessage:"No options available",searchAriaLabel:"Search {{label}}",loadingMore:"Loading more resources…"},x7e={retryDeployment:"Retry deployment",retrying:"Retrying…",collapse:"Collapse error details",expand:"Expand full error details",copy:"Copy full error details"},w7e={steps:"Build steps",log:"Build log",syncing:"Syncing",loadFailed:"Failed to load",synced:"Synced",recentOnly:" · Recent logs only",copiedLog:"Build log copied",copyLog:"Copy build log",copied:"Copied",copy:"Copy",logContent:"Build log content",waiting:"Waiting for CodePipeline logs…",empty:"No build logs"},A7e={defaultLabel:"Studio default environment",defaultDescription:"Use the standard runtime environment provided by Studio",status:{notBuilt:"Not built",preparing:"Preparing",queued:"Queued",building:"Building",scanning:"Scanning",available:"Available",failed:"Failed"},label:"Runtime environment",placeholder:"Select a runtime environment",search:"Search runtime environments",loading:"Loading runtime environments…",loadFailed:"Failed to load runtime environments",noMatches:"No matching runtime environments",unavailable:"No runtime environments are currently available",selectionUnavailable:"The selected runtime environment is unavailable. Select another one.",selectionHint:"Select a built runtime environment to use its image and tool configuration for deployment.",versionChanged:"The selected environment version has changed. Review it before continuing.",versionMissing:"The selected environment version no longer exists. Select another one.",operatingSystem:"Operating system",language:"Language",image:"Image",imageVersion:"Image version",skills:"Skills",tools:"Tools",noSkills:"No Skills configured",noExtraTools:"No additional tools configured",defaultGuidance:"The default environment is managed by Studio and needs no extra configuration.",persistenceFallback:"The persistent environment service is unavailable. The default environment is being used.",emptyFallback:"No custom environments are available."},S7e={repository:"GitHub repository",githubUrl:"GitHub URL",token:"Token",sessionToken:"{{provider}} Session Token",runtime:"Runtime",commit:"Commit",workflow:"Workflow",syncFailed:"Failed to sync GitHub code",status:{mounted:"Mounted",bound:"Bound",synced:"Synced",created:"Created"},volcengine:"Volcengine",mountDelivery:"Enable continuous delivery",selectedForDeployment:"Selected for deployment",mountOnDeploy:"Enable continuous delivery on deploy",syncCode:"Sync code",deliveryMode:"GitHub delivery mode",sourceSync:"GitHub code sync",delivery:"GitHub delivery",loading:"Loading",running:"Running",runtimeDeliveryHint:"Write an AgentKit Runtime GitHub Actions workflow so future GitHub commits update the bound Runtime.",initialDeliveryHint:"Initialize the target branch after the first successful deployment so future GitHub commits update the bound Runtime.",sourceSyncHint:"Studio pushes directly to the target branch. Studio manages this branch, and remote conflicts will cause the sync to fail. Use the deployment button to publish the Runtime.",tokenPlaceholder:"repo or contents:write permission",getToken:"Get token",hideToken:"Hide token",showToken:"Show token",tokenHelp:"The token is used only for this operation and is cleared from the form after success.",targetBranch:"Target branch",actionsSecretPlaceholder:"Used to write a GitHub Actions secret",sessionTokenPlaceholder:"Optional temporary credential",syncing:"Syncing…",pendingHint:"Continuous delivery is selected. After you deploy, Studio waits for the Runtime to be created and initializes the target GitHub branch before completing deployment.",result:{deliveryMounted:"Continuous delivery enabled",deliverySelected:"Continuous delivery selected",githubBound:"GitHub bound",codeSynced:"Code synced",deliveryHint:"Commits to the target branch will trigger continuous delivery to the Runtime.",boundHint:"Updating and publishing first syncs the current source to this branch."},branch:"Branch",viewPr:"View PR",createFailed:"Creation failed",phase:"Phase",log:"Log"},T7e={name:"Feishu",enabling:"Enabling and updating configuration…",description:"Receive messages and reply through a Feishu bot",configuration:"Feishu configuration",configurationMode:"Feishu configuration mode",automatic:"Automatic",manual:"Manual",cancelling:"Cancelling…",scanToCreate:"Scan to create",scanDescription:"Credentials are filled in after authorization",generateQrCode:"Generate QR code",qrCodeAlt:"Feishu bot configuration QR code",scanToConfirm:"Scan with Feishu to confirm",expiresIn:"Expires in {{time}}",created:"Bot created",credentialsFilled:"App credentials filled in automatically",qrCodeExpired:"QR code expired",automaticFailed:"Automatic configuration failed",regenerateQrCode:"Generate a new QR code.",configuredPlaceholder:"Configured; leave blank to keep it",appSecretPlaceholder:"Enter App Secret",hideSecret:"Hide App Secret",showSecret:"Show App Secret"},C7e={mode:{auto:"Create automatically",autoDescription:"Create required resources during deployment",recommended:"Recommended",create:"Specify names",createDescription:"Create or reuse resources with the specified names",existing:"Select existing",existingDescription:"Select existing resources from the current account"},selectExisting:"Select an existing resource",searchResource:"Search resource names",noMatch:"No matching resources",noAvailable:"No resources available",searching:"Searching cloud resources…",loading:"Loading cloud resources…",noMatchSentence:"No matching resources.",noAvailableSentence:"No resources available.",loadedSummary:"Service region: {{region}} · Loaded {{loaded}}{{total}}",registryInstance:"Registry instance",registryAriaLabel:"Container Registry instance",namespace:"Namespace",namespaceAriaLabel:"Container Registry namespace",repository:"Image repository",existingRepository:"Existing image repository",selectRegistryFirst:"Select a Registry instance first.",selectNamespaceFirst:"Select a Namespace first.",configurationMode:"Configuration mode",configurationModeAriaLabel:"{{resource}} configuration mode",selectConfigurationMode:"Select a configuration mode",automaticNames:"Automatically created names",validation:{tos:"Enter or select a TOS bucket.",cr:"Enter or select a CR instance, namespace, and image repository.",codePipeline:"Enter or select a CodePipeline Workspace and Pipeline.",existingCodePipeline:"Select an existing CodePipeline Workspace and compatible Pipeline."},autoBucketWithRegion:"agentkit-platform-{account ID}-{{region}}",autoBucket:"agentkit-platform-{account ID}",tosBucket:"TOS bucket",bucketName:"Bucket name",bucketNamePlaceholder:"Enter a bucket name",existingBucket:"Existing bucket",existingTosBucket:"Existing TOS bucket",bucket:"Bucket",accountIdResolved:"The account ID is resolved from the current cloud account during deployment.",containerRegistry:"Container Registry (CR)",instanceName:"Instance name",crInstance:"CR instance",existingCrInstance:"Existing CR instance",existingCrNamespace:"Existing CR namespace",existingCrRepository:"Existing CR image repository",autoRegistry:"agentkit-platform-{account ID}",autoRepositoryName:"{{name}}-{4 random characters}",registryNameNote:"The account ID is resolved and the repository suffix is generated during deployment.",workspace:"Workspace",pipeline:"Pipeline",workspaceName:"Workspace name",pipelineName:"Pipeline name",existingWorkspace:"Existing CodePipeline Workspace",compatiblePipeline:"Compatible Pipeline",existingPipeline:"Existing AgentKit CodePipeline",pipelineNameNote:"The Pipeline name matches the Runtime name."},O7e={commit:"Commit",steps:{permissions:"Preflight OTA permissions",resolving:"Resolve target version",downloading:"Download and verify the full update package",preparing:"Prepare VeFaaS Function code",provisioning:"Check and provision Studio cloud resources",scheduler:"Update the scheduled task service",submitting:"Submit the Function update",publishing:"Publish a new Revision and restart the service"},stages:{permissions:"Preflight OTA permissions",resolving:"Resolve version details",downloading:"Download update package",preparing:"Prepare Function code",provisioning:"Provision Studio cloud resources",scheduler:"Update scheduled task service",submitting:"Submit Function update",publishing:"Publish Revision",checking:"Check for updates",unknown:"Unknown stage"},duration:{seconds:"{{count}} seconds",minutesSeconds:"{{minutes}} min {{seconds}} sec"},logPermissionPrefix:"Unable to read VeFaaS release logs. The Function role lacks ",logPermissionSuffix:"; the update will continue.",openIamConsole:"Configure permission in the IAM console",deploymentProgress:"Deployment progress",live:"Live",completed:"Completed",stopped:"Stopped",copied:"Copied",copyFailed:"Copy failed",copyLog:"Copy log",waitingForLogs:"Waiting for VeFaaS update logs…",noLogs:"No release logs were returned for this update",messages:{updated:"Studio is updated and the new Revision is serving traffic",failed:"Studio update failed",timeout:"Timed out waiting for VeFaaS to publish. Check for updates again later.",submitted:"Update submitted. Waiting for VeFaaS to publish the new version.",connectionSwitched:"The connection changed. Confirming the new version status."},checkingPermissions:"Checking OTA permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",updated:"Studio updated",updateToVersion:"Update Studio to {{version}}",checkPermissions:"Check update permissions",authorizationNeeded:"Authorization required",updatingShort:"Updating",refreshForNewVersion:"Refresh to use the new version",updateFailed:"Update failed",updateNow:"Update now",newVersionAvailable:"New version available",dialog:{failed:"Studio update failed",checkingPermissions:"Checking update permissions",authorizationRequired:"IAM authorization required",updating:"Updating Studio",completed:"Studio update complete",newVersion:"New version available"},permissionCheck:"Checking every IAM permission required by OTA and scheduled tasks…",permissionCheckHint:"Downloads and cloud-resource updates begin only after all permissions are available.",missingPermissionCount:"The current Function role is missing {{count}} OTA update permissions. No cloud resources have been changed.",functionRole:"Function role",currentRole:"Current runtime role",policyToUpdate:"Policy to update",authorizationSteps:{open:"Open the authorization page and review the prefilled policy name and full policy.",debug:"Select “Start debugging” on the page to apply the policy update.",return:"Return to this window and select “Authorized, check again”."},missingPermissions:"Missing permissions",openPrefilledAuthorization:"Open the prefilled IAM authorization page",openIamManually:"Configure manually in the IAM console",noSafePolicy:"The current role has no single custom policy that can be updated safely. Ask an administrator to add the permissions above to this role.",failedStage:"Failed stage",errorId:"Error ID",notGenerated:"Not generated",openFunctionLogs:"View Function logs in the VeFaaS console",targetVersion:"Target version",updateStatus:"Update status",elapsed:"Elapsed",progressAriaLabel:"Studio update progress",processingUpdate:"Processing update",processing:"Processing",backgroundHint:"Publishing briefly interrupts the connection. Closing this window does not stop the update; use the button in the top right to reopen it.",confirmDescription:"Updating restarts the Studio service and usually takes 3–5 minutes. Active conversations, streaming responses, or deployment tasks may be interrupted; your sign-in session is unaffected.",selectVersion:"Select version",currentVersion:"Current version",changelog:"What's new",noChangelog:"No release notes",runInBackground:"Run in background",authorizedRecheck:"Authorized, check again",tryAgain:"Try again"},k7e={deploy:"Deploy",update:"Update",planHash:"Plan hash",backToConfiguration:"Back to configuration",releaseRegion:"Release region",deployRegion:"Deployment region",regionPreserved:"The existing Runtime deployment region is preserved during updates and cannot be changed.",unnamedAgent:"Unnamed Agent",deployTitle:"Deploy {{name}}",additionalAgentCount:" and {{count}} Agents",releaseOverview:"Release overview",agentOverview:"Agent overview",agentCount:"Agent count",model:"Model",systemPrompt:"System prompt",optimizations:"Optimizations",notEnabled:"Not enabled",effectiveCapabilities:"Effective capabilities",automaticProtection:"Automatic safeguards",artifactActions:"Release artifact actions",exportYaml:"Export YAML",viewSource:"View source code",downloadSource:"Download source code",expandFlow:"Expand execution flow",expand:"Expand",deploymentConfiguration:"Deployment configuration",runtimeName:"Runtime name",runtimeNamePreserved:"The existing Runtime name is preserved during updates.",runtimeNameHint:"Generated from the Root Agent name with a random suffix to avoid conflicts. Use 4–64 letters, numbers, hyphens, or underscores.",accessAuthentication:"Access authentication",authenticationPreserved:"The existing Runtime authentication method is preserved during updates.",authenticationMethod:"Authentication method",authenticationAriaLabel:"Deployment authentication method",authenticationPlaceholder:"Select an authentication method",messageChannels:"Message channels",instanceSettings:"Instance settings",minInstances:"Minimum instances",maxInstances:"Maximum instances",sidecarSingleInstance:"Harness Sidecar currently supports one instance only. The Runtime is fixed at 1–1.",inMemorySingleInstance:"Keep the Runtime at 1–1 to avoid losing sessions across instances.",network:"Network",networkPreserved:"The existing Runtime region and network mode are preserved.",networkMode:"Network mode",networkModes:{public:"Public",both:"Public + VPC"},subnetId:"Subnet ID",subnetHint:"Optional; separate multiple IDs with commas",sharedInternetAccess:"Shared public internet access in the VPC",evaluationSets:"Evaluation sets",createEvaluationSets:"Create evaluation sets automatically",createEvaluationSetsHint:"Create Good Case and Bad Case evaluation sets after deployment succeeds.",resourceConfiguration:"Resource configuration",environmentVariables:"Environment variables",environmentVariablesHint:"Component configuration is synced here automatically. Review the final values before deployment.",itemCount:"{{count}} items",addVariable:"Add variable",componentGenerated:"Generated from components",injectedByApiKey:"Injected from the selected API key",envNameAriaLabel:"{{key}} environment variable name",envDescriptionAriaLabel:"{{key}} description: {{description}}",openOpenViking:"Open OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}: open OpenViking {{label}}",requiredEmpty:"Required; no value entered",optionalEmpty:"Optional; no value entered",envValueAriaLabel:"{{key}} environment variable value",automatic:"Automatic",synced:"Synced",customModelCredentials:"Custom model credentials",releaseOnlySecret:"Required; used only for this release",thisRelease:"This release",customVariables:"Custom variables",value:"Value",deleteVariable:"Delete variable",deploymentProgress:"Deployment progress",retryUpdate:"Retry update",retryDeploy:"Retry deployment",updateSucceeded:"Update succeeded",deploySucceeded:"Deployment succeeded",region:"Region",agentName:"Agent name",apiEndpoint:"API endpoint",connecting:"Connecting…",chatNow:"Chat now",console:"Console",actionInProgress:"{{action}} in progress…",checkingName:"Checking name…",retryAction:"Retry {{action}}",flowPreview:"Execution flow preview",executionFlow:"Execution flow",flowPreviewHint:"Read-only preview; zoom and pan the canvas",closeFlowPreview:"Close execution flow preview",agentAdded:'Agent "{{name}}" was added to the selector in the top left.',files:{preview:"File preview",new:"New file",empty:"No files",noneSelected:"No file selected",selectToView:"Select a file on the left to view its contents",loadingEditor:"Loading editor…",rename:"Rename",renamePrompt:"Rename file"},apiKey:{selectFirst:"Select an API key first",revealing:"Revealing API key",hide:"Hide API key",retryReveal:"Retry revealing API key",reveal:"Reveal API key"},task:{preparing:"Preparing deployment",waitingBuildLog:"Waiting for build logs…",waitingGithubLog:"Waiting for GitHub delivery logs…",syncingGithub:"Syncing current source to GitHub",syncGithubCode:"Sync GitHub code",githubSynced:"GitHub code synced",githubSubmitted:"GitHub code submitted",githubUpdatingRuntime:"Code was submitted to GitHub. GitHub Actions is updating the same Runtime.",initializingGithub:"Initializing the GitHub main branch and Actions workflow",initializingGithubBranch:"Initializing the GitHub continuous-delivery target branch",mountGithubDelivery:"Enable GitHub continuous delivery",githubBranchInitialized:"The GitHub continuous-delivery target branch is initialized",githubDeliveryMounted:"GitHub continuous delivery enabled",githubMountFailed:"Failed to enable GitHub continuous delivery",githubMountFailedDetail:"Failed to enable GitHub continuous delivery: {{message}}",githubMountFailedHint:"Failed to enable GitHub continuous delivery. See the GitHub log for details.",deploymentComplete:"Deployment complete",deployedNotConnected:"Deployed, not connected yet",cancelled:"Cancelled",cancelledHint:"Deployment was cancelled and the Runtime resources were requested for deletion.",deploymentStatusUnconfirmed:"Deployment status unconfirmed",deploymentFailed:"Deployment failed",buildFailedHint:"Image build failed. See the build log for details."},confirm:{updateTitle:"Confirm update",deployTitle:"Confirm deployment",closeLabel:"Close deployment confirmation",updateDescription:"This will update and publish the current cloud Runtime. It may take a few minutes. Continue?",deployDescription:"This will create a new cloud Runtime. Deployment may take a few minutes. Continue?",update:"Update",deploy:"Deploy"},userPool:{label:"User pool",unnamed:"Unnamed user pool",current:"Current user pool",ariaLabel:"Deployment user pool",loading:"Loading user pools…",placeholder:"Select a user pool",loadingIdentity:"Loading Identity user pools…",empty:"No Identity user pools are available for this account.",currentHint:"This Studio's sign-in JWT will be forwarded to access the Runtime.",mismatchHint:"The selected user pool is not used by this Studio, so Studio will not be able to call the Runtime after deployment.",markedHint:"The user pool used by this Studio is marked in the list."},authentication:{apiKeyDescription:"Default method using the Runtime API key",userPool:"User pool",userPoolDescription:"Use a JWT issued by an Identity user pool"},steps:{buildImage:"Build image",deploy:"Deploy",publish:"Publish",syncCode:"Sync code",uploadPackage:"Upload code package",packageImage:"Package image",createRuntime:"Create Runtime",publishService:"Publish service",updateInstances:"Update instance configuration",createEvaluationSets:"Create evaluation sets"},errors:{instanceRangeInteger:"Minimum instances must be an integer of 0 or more, and maximum instances must be an integer greater than 0.",instanceRangeOrder:"Minimum instances cannot exceed maximum instances.",selectApiKey:"Select an API key in the model configuration first.",loadApiKey:"Failed to load the API key. Try again.",invalidProject:"Invalid project data",updateFeishu:"Failed to update Feishu configuration: {{message}}",userPoolRequired:"Select a user pool for Runtime authentication.",vpcRequired:"Enter a VPC ID when using a VPC network.",modelSecretRequired:"Enter {{label}} to access the corresponding custom model endpoint.",managedApiKeyRequired:"{{requirement}}. Return to model configuration and select an API key first.",feishuEnvRequired:"Enter {{field}} after enabling Feishu.",runtimeNameExists:"This Runtime name already exists. Change it and try again.",deployedButGithubMountFailed:"Deployment succeeded, but enabling GitHub continuous delivery failed: {{message}}",deployedButGithubBindFailed:"Deployment succeeded, but binding GitHub failed: {{message}}",deploymentStatusUnconfirmed:"The connection was interrupted, so the final deployment status cannot be confirmed. The task may still be running in the cloud. Check the same task in AgentKit or CodePipeline and avoid a duplicate deployment.",failedAtStage:"{{action}} failed during {{stage}}: {{message}}",noAgentAtEndpoint:"Connected successfully, but no Agents were found at this endpoint (/list-apps is empty).",addAgent:"Failed to add Agent: {{message}}",modelApiKeyRequired:"Enter the API key for this model endpoint."}},E7e={title:"Workspaces",detail:"Workspace details",create:"New workspace",editorDescription:"Group frequently used environments. An environment can belong to multiple workspaces.",backToList:"Back to workspaces",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",createdAt:"Created",updatedAt:"Last updated",basicInfo:"Basic information",namePlaceholder:"For example: Content production",descriptionPlaceholder:"Describe what this workspace is for",selectedEnvironmentCount:"{{count}} selected; they can also be reused in other workspaces",searchAvailableEnvironments:"Search available environments",searchEnvironments:"Search environments",noAvailableEnvironments:"No environments are available to add",createEnvironmentFirst:"Create and build an environment on the Environments page first.",noMatchingEnvironments:"No matching environments",tryAnotherName:"Try searching for another name.",environmentStatus:{available:"Available",building:"Building",notBuilt:"Not built"},added:"Added",saved:"Workspace “{{name}}” saved",resourceType:"Workspace resource type",searchWorkspaces:"Search workspaces",loadFailed:"Unable to load workspaces",noMatchingWorkspaces:"No matching workspaces",tryAnotherNameOrEnvironment:"Try another name or environment",noEnvironmentAdded:"No environments added",environmentMissing:"Environment missing",availableFraction:"{{available}}/{{total}} available",available:"Available",availableCount:"{{count}} available",updated:"Updated",addEnvironment:"Add environment",deleteTitle:"Delete workspace",deleteDescription:"Delete workspace “{{name}}”? Its environments will not be deleted.",deleted:"Workspace “{{name}}” deleted",clipboardPermissionError:"Could not read the clipboard. Allow clipboard access, or open Import environment and paste the share code manually.",clipboardUnsupported:"This browser cannot read the clipboard automatically. Open Import environment and paste the share code manually."},_7e={back:"Back",detailNavigation:"Detail navigation",noData:"No data",actions:"Actions",moreActions:"More actions for {{label}}",actionsFor:"Actions for {{label}}",loading:"Loading resources…"},R7e={addSkill:"Add Skill",remove:"Remove {{name}}",confirmRemoveRuntime:"Remove the running Skill “{{name}}” from the new version?",selectedCount:"Added skills · {{count}}",close:"Close {{label}}",sources:{runtime:"Running source · Preserved as-is; remove it or replace it with a Skill of the same name",local:"Local",skillspace:"AgentKit Skills Center",skillhub:"Volcengine Find Skill marketplace"},tabs:{local:"Local files",localShort:"Local files",skillspace:"AgentKit Skills Center",skillspaceShort:"AgentKit",skillhub:"Volcengine Find Skill marketplace",skillhubShort:"Find Skill"}},D7e={tasks:{ppt:"Presentation",image:"Image generation",video:"Video generation"},prompts:{ppt:{quarterlyReview:"Review 【quarter】 business performance, highlighting metric gaps, causes, and recommended actions",projectUpdate:"Present the progress of 【project name】: milestones, risks, budget, and resource requests",solutionProposal:"Create a solution proposal for 【customer industry】: pain points, architecture, implementation plan, and benefits",industryAnalysis:"Analyze trends in 【industry topic】 and recommend strategic opportunities based on the competitive landscape"},image:{launchVisual:"Design a 【high-tech】 launch-event key visual for 【brand or product】",ecommercePoster:"Create an e-commerce poster for 【product name】 that highlights 【core selling point】 and brand colors",conceptRendering:"Create a photorealistic concept rendering of 【product or space】 in 【usage scenario】",socialGraphic:"Create a concise, professional corporate social graphic for 【campaign theme】"},video:{brandFilm:"Create a 30-second promotional video for 【brand name】 that highlights 【brand value】",productLaunch:"Create a 45-second launch video for 【product name】 covering the pain point, features, scenarios, and call to action",trainingVideo:"Create a corporate training video about 【training topic】 that clearly explains 【key procedure or policy】",eventTeaser:"Create a 20-second teaser for 【event name】 with highlights, time and location, and registration details"}},firstFrame:"First frame",videoToEdit:"Video to edit",baseVideo:"Base video",optimizeSkillPlaceholder:"Describe the skill you want to improve…",createSkillPlaceholder:"Describe the skill you want to create…",createVideoPlaceholder:"Describe the video you want to create…",messageAgentPlaceholder:"Message {{name}}…",selectAgentFirst:"Select an agent first",selectSkillFirst:"Select the Skill you want to improve first",availableSkills:"Available skills",availableSubagents:"Available sub-agents",invokeSkill:"Use a skill",useSubagent:"Use a sub-agent",loadingCapabilities:"Loading Agent capabilities…",noMatchingSkills:"No matching skills for this Agent",noMatchingSubagents:"No matching sub-agents for this Agent",skillFallbackDescription:"Load and run this skill",agentFallbackDescription:"Hand this turn to the Agent",skill:"Skill",uploadImage:"Upload image",uploadDocument:"Upload document or PDF",uploadVideo:"Upload video",taskMode:"Task mode",selectTaskMode:"Select a task mode",loadingGenerationModel:"Loading generation model",modelUnavailable:"Model unavailable",cancelTask:"Cancel {{task}} task",stopGenerating:"Stop generating",viewVideoProgress:"View video generation progress",send:"Send",selectTaskType:"Select a task type",enterprisePrompts:"{{task}} enterprise prompts",sessionId:"Session ID",sessionIdLabel:"Session ID: ",initializing:"Initializing",copied:"Copied",copySessionId:"Copy session ID",sessionIdCopied:"Session ID copied",disclaimer:"Responses may be inaccurate",viewLogs:"View logs"},L7e={selectAgent:"Select Agent",noLocalAgents:"No local Agents.",searchRuntime:"Search Runtime names",mineOnly:"Created by me",noRuntimes:"No Runtimes.",unsupported:"Unsupported",createdByMe:"Created by me",connecting:"Connecting…",connected:"Connected",connect:"Connect",viewInfoFor:"View information for {{name}}",viewInfo:"View information",agentAndRuntimeInfo:"Agent and Runtime information",detailType:"Detail type",agentInfo:"Agent information",runtimeInfo:"Runtime information",loadingAgentInfo:"Loading Agent information…",cannotLoadAgentInfo:"Agent information is temporarily unavailable",unnamedAgent:"Unnamed Agent",subagents:"Sub-agents",tools:"Tools",skills:"Skills",previewUnsupported:"Preview unavailable",mountedComponents:"Mounted components",noMoreAgentInfo:"No additional Agent configuration information.",local:"Local",model:"Model",status:"Status",memoryMb:"Memory {{value}} MB",instances:"Instances {{min}}–{{max}}",resources:"Resources",version:"Version",loadingDetails:"Loading details…",environmentVariables:"Environment variables",errors:{notFound:"This Runtime no longer exists or the list is out of date. Refresh the list and try again.",accessDenied:"This account cannot access the Runtime. Check its Project and access permissions.",previewUnsupported:"This Agent Server version does not support information previews.",unavailable:"This Runtime is temporarily unavailable. Confirm that its status is Ready and try again.",timeout:"Loading timed out. Try again."},componentKinds:{knowledgebase:"Knowledge base",memory:"Memory",prompt_manager:"Prompt manager",example_store:"Example store",run_processor:"Run processor",tracer:"Trace",toolset:"Toolset",plugin:"Plugin",other:"Other"},runtimeStatus:{ready:"Ready",unreleased:"Unreleased",running:"Running",active:"Running",creating:"Creating",pending:"Pending",deploying:"Deploying",updating:"Updating",failed:"Failed",error:"Error",stopping:"Stopping",stopped:"Stopped",deleting:"Deleting",deleted:"Deleted"}},M7e={recoveryPaused:"Some historical agents could not be restored after multiple attempts. Automatic recovery is paused.",restoringHistory:"Some historical agents are being restored and will appear automatically.",agent:"Agents",agentTypes:{general:"General Agents",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"Created by",namedAgent:"{{name}} Agent",storageLocation:"Storage location",currentBrowser:"Current browser",region:"Region",viewDeploymentProgress:"View deployment progress for {{name}}",viewRuntimeDetails:"View Runtime details for {{name}}",viewDetails:"View details for {{name}}",time:"Time",remainingTime:"Time remaining",expiringSoon:"Expiring soon",sandboxRemaining:"{{hours}} hr {{minutes}} min",wakeable:"Wakeable",neverExpires:"Never expires",editDraftNamed:"Edit draft {{name}}",viewProgress:"View progress",deleteDraftNamed:"Delete draft {{name}}",recheckCompatibility:"Check chat compatibility for {{name}} again",connectedNamed:"{{name}} is connected",wakeAndChat:"Wake {{name}} and start chatting",chatWith:"Chat with {{name}}",waking:"Waking…",deploying:"Deploying",draft:"Draft",checking:"Checking",chatUnsupported:"Chat unsupported",checkFailed:"Check failed",creatorFilter:"Creator filter",agentType:"Agent type",searchAgents:"Search Agents",handoff:"Handoff",agentList:"{{type}} list",noMatchingAgents:"No matching Agents",adjustSearch:"Try adjusting the search or filters",noAgentType:"No {{type}}",noGeneralAgents:"No General Agents",createGeneralAgentDescription:"Create a General Agent to start building and chatting",createAgentType:"Create {{type}}",createAgent:"Create Agent",loadingMore:"Loading more Agents",scrollForMore:"Scroll down to load more",allLoaded:"All Agents loaded",deleteDraftTitle:"Delete draft?",deleteDraftDescription:"“{{name}}” cannot be recovered after deletion.",deleteDraft:"Delete draft",loadGeneralAgents:"Load General Agents",loadAgentType:"Load {{type}}",compatibility:{checking:"Requesting Runtime /list-apps to confirm that this Agent supports Studio chat.",empty:"Runtime /list-apps returned no available Agents, so chat is currently unavailable.",supported:"This Runtime supports Studio chat.",unknownError:"The Runtime /list-apps request failed without a recognizable error."},sandboxStatus:{ready:"Ready",wakeable:"Wakeable",creating:"Creating",starting:"Starting",initializing:"Starting",pending:"Pending",running:"Running",failed:"Error",error:"Error",stopped:"Stopped",expired:"Expired",deleting:"Deleting",deleted:"Deleted",unknown:"Unknown status"}},I7e={library:"Skill library",skill:"Skill",skills:"Skills",skillSpace:"Skill space",sandboxNotConfigured:"Dev Sandbox is not configured by an administrator",adminNotConfigured:"Not configured by an administrator",totalItems:"{{count}} items",cannotLoadSpaces:"Unable to load Skill spaces",someSpacesFailed:"Some Skill spaces failed to load",degradedRelationWarning:"Some relations are invalid. Readable skills have been restored.",downloadZip:"Download ZIP",optimize:"Optimize",closeSkillDetails:"Close Skill details",skillId:"Skill ID",allFiles:"All files",loadingSkillContent:"Loading Skill content…",noSkillContent:"This Skill has no SKILL.md content",addSkill:"Add Skill",localUpload:"Upload locally",localUploadDescription:"Select a ZIP file and upload it to the Skill space after validation",autoCreate:"Create automatically",autoCreateDescription:"Choose a model and style, then create a Skill through conversation",createSkill:"Create Skill",optimizeNamed:"Optimize {{name}}",deleteSkillConfirm:"Delete the entire Skill “{{name}}”? This affects every space that references it.",deleteSpaceConfirm:"Delete Skill space “{{name}}”? Make sure its Skills have been deleted first.",manageSpaceDescription:"Manage Skills in this space and create new versions",backToSpaces:"Back to Skill spaces",overview:"Overview",skillCount:"Skills",skillCountValue_one:"{{count}} Skill",skillCountValue_other:"{{count}} Skills",updatedAt:"Updated",skillsInSpace:"Skills in {{name}}",searchSkills:"Search Skills",cannotLoadSkills:"Unable to load Skills",noMatchingSkills:"No matching Skills",noSkills:"No Skills",tryAnotherName:"Try searching for another name",emptySkillsDescription:"Upload a Skill locally or create one automatically",actions:"Actions",spaceDetails:"Skill space details",editSpace:"Edit space",deleteSpace:"Delete space",searchSpaces:"Search Skill spaces",spaceList:"Skill space list",noMatchingSpaces:"No matching Skill spaces",createSpace:"Create Skill space",newSpace:"New space",loadingMoreSpaces:"Loading more Skill spaces",scrollForMore:"Scroll down to load more",allSpacesLoaded:"All Skill spaces loaded",errors:{loadSpaces:"Unable to load Skill spaces. Try again later.",loadSkills:"Unable to load Skills. Try again later.",loadSkillDetails:"Unable to load Skill details. Try again later.",deleteSkill:"Unable to delete the Skill",deleteSpace:"Unable to delete the Skill space",downloadSkill:"Unable to download the Skill"},status:{active:"Available",available:"Available",creating:"Creating",disabled:"Disabled",enabled:"Enabled",failed:"Error",inactive:"Inactive",pending:"Pending",published:"Published",ready:"Ready",released:"Published",running:"Running",success:"Healthy",unavailable:"Unavailable",unreleased:"Unreleased",updating:"Updating",unknown:"Unknown"}},P7e={library:"Knowledge bases",createBase:"New knowledge base",editBase:"Edit knowledge base",invalidName:"The name must start with a letter and contain only letters, numbers, and underscores.",nameHelp:"Start with a letter. Use up to 48 letters, numbers, or underscores.",optionalDescription:"Description (optional)",descriptionOnly:"AgentKit currently supports updating only the knowledge base description.",previewWeb:"Preview web content",addData:"Add data",openOriginalWeb:"Open original page",backToEdit:"Back to edit",confirmAdd:"Confirm and add",source:"Knowledge source",image:"Image",documentFile:"Document file",webPage:"Web page",webUrl:"Web page URL",generatingWebPreview:"Fetching the page and generating a Markdown preview",selectFile:"Select knowledge file",selectOrDropFile:"Select a file or drag it here",selectedFile:"{{size}} · Click to select another file",imageFileHelp:"PNG, JPG, and JPEG up to 200 MB",documentFileHelp:"PDF, PPTX, DOCX, XLSX, and TXT up to 200 MB",uploadingFile:"Uploading the file and adding it to the knowledge base",optionalName:"Name (optional)",optionalType:"Type (optional)",generatePreview:"Generate preview",uploadFile:"Upload file",editMetadata:"Edit knowledge metadata",knowledge:"Knowledge item",field:"Field",value:"Value",backToList:"Back to knowledge bases",metadataJson:"Metadata (JSON)",provider:"Provider",knowledgeId:"Knowledge ID",project:"Project",creator:"Created by",data:"Data",deleteInvalidAssociation:"Delete invalid association",noData:"This knowledge base has no data",addFirstData:"Add the first data item",format:"Format",size:"Size",searchData:"Search data",searchLibraryData:"Search knowledge base data",associationInvalid:"Association invalid",providerMissing:"The underlying Provider knowledge base no longer exists",noMatchingData:"No matching data",loadingMoreData:"Loading more data",retryLoading:"Retry loading",details:"Knowledge base details",searchBases:"Search knowledge bases",someBasesFailed:"Some knowledge bases are temporarily unavailable. Other available content is shown.",noMatchingBases:"No matching knowledge bases",noManagePermission:"You do not have permission to manage this knowledge base",loadingMoreBases:"Loading more knowledge bases",deleteBaseTitle:"Delete knowledge base?",deleteBaseDescription:"This removes the AgentKit association for {{name}}. If Studio created it, the Provider resource is also deleted. This cannot be undone.",deleteDocumentTitle:"Delete knowledge item?",deleteDocumentDescription:"This removes {{name}} from the Provider knowledge base. This cannot be undone.",preview:{processingTitle:"Data is being processed",processingDetail:"A preview will be available after parsing. Reload later.",failedTitle:"Data parsing failed",failedDetail:"Check the source file or page URL and add it again, or reload the latest status.",noParsedTitle:"No parsed content is available yet",noParsedDetail:"Text, tables, or page images will appear after the knowledge base finishes parsing this file.",noMediaTitle:"No media preview is available yet",noMediaDetail:"The knowledge base has not returned an accessible media preview. Reload later.",noDataTitle:"No data is available to preview",noDataDetail:"The knowledge base has not returned parsed results. Reload later.",attachmentError:"The attachment cannot be previewed. Try again later.",imageAlt:"Knowledge data image",audioUnsupported:"This browser does not support audio previews.",videoUnsupported:"This browser does not support video previews.",namedPdf:"{{name}} PDF preview",pdf:"PDF preview",openPdf:"If it cannot be displayed, open the PDF in a new window",fileUnsupported:"This format cannot be previewed directly online. Parsed content is shown when available.",openOriginalFile:"Open original file",loading:"Loading data preview",openOriginalHint:"You can open the original page to view the source content.",chunk:"Chunk {{index}}",loadingMore:"Loading more",loadMore:"Load more"},errors:{fileTooLarge:"A file cannot exceed 200 MB",invalidImageType:"Select a PNG, JPG, or JPEG image",invalidDocumentType:"Select a PDF, PPTX, DOCX, XLSX, or TXT file",createBase:"Unable to create the knowledge base",updateBase:"Unable to update the knowledge base",metadataObject:"Metadata must be a JSON object",metadataFormat:"Invalid metadata format",noWebPreview:"The page has no Markdown content to preview",addWeb:"Unable to add the web page",previewWeb:"Unable to generate the web page preview",uploadFile:"Unable to upload the file",updateDocument:"Unable to update the knowledge item",loadPreview:"Unable to load the data preview",loadMoreBases:"Unable to load more knowledge bases",loadBases:"Unable to load knowledge bases",loadMoreData:"Unable to load more data",loadData:"Unable to load data",deleteBase:"Unable to delete the knowledge base",deleteDocument:"Unable to delete the knowledge item"}},Ztr=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:g7e,agentSelector:L7e,agentWorkspace:v7e,cloudEnvironment:A7e,common:p7e,composer:D7e,default:{common:p7e,agentKitPromo:g7e,systemInfo:m7e,agentWorkspace:v7e,environmentCenter:y7e,deploymentSelect:b7e,deploymentError:x7e,studioBuildProgress:w7e,cloudEnvironment:A7e,githubCicd:S7e,feishuDeployment:T7e,deploymentResources:C7e,studioUpdate:O7e,projectPreview:k7e,workspace:E7e,resourceCollection:_7e,skillSourcePicker:R7e,composer:D7e,agentSelector:L7e,myAgents:M7e,skillCenter:I7e,knowledge:P7e},deploymentError:x7e,deploymentResources:C7e,deploymentSelect:b7e,environmentCenter:y7e,feishuDeployment:T7e,githubCicd:S7e,knowledge:P7e,myAgents:M7e,projectPreview:k7e,resourceCollection:_7e,skillCenter:I7e,skillSourcePicker:R7e,studioBuildProgress:w7e,studioUpdate:O7e,systemInfo:m7e,workspace:E7e},Symbol.toStringTag,{value:"Module"})),N7e="Website integration",B7e="Embed an AgentKit Runtime on your website as a floating chat window",$7e="Back to automations",F7e="Add website",z7e="Loading Runtime",U7e="Select Runtime",V7e="Website domain",Q7e="For example, xxxx.com or localhost:5173",G7e="Generating",H7e="Generate token",W7e="Added websites",Y7e="{{count}} website",q7e="{{count}} websites",j7e="Loading website integrations",X7e="No website integrations yet",K7e="Select a Runtime and enter a website domain to generate a token",Z7e="Embed instructions",J7e="Place this code before the closing body tag on your website",e$e="Copied",t$e="Copy code",r$e="Embed code will appear here after you add a website.",n$e="Delete the website integration for {{domain}}?",i$e={load:"Failed to load website integrations",create:"Failed to create website integration",delete:"Failed to delete website integration",noConversationalAgent:"No conversational Agent was found in this Runtime"},a$e={requestFailed:"Request failed ({{status}})",greeting:"Hello. How can I help?",sessionFailed:"Could not start a chat session",unauthorized:"This website is not authorized to start a chat",conversationFailed:"The chat request failed. Try again shortly.",open:"Open Agent chat",close:"Close Agent chat",panelLabel:"Agent chat panel",assistant:"Agent assistant",online:"Online"},Jtr=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:F7e,addedWebsites:W7e,backToAutomations:$7e,confirmDelete:n$e,copied:e$e,copyCode:t$e,default:{title:N7e,description:B7e,backToAutomations:$7e,addWebsite:F7e,loadingRuntime:z7e,selectRuntime:U7e,websiteDomain:V7e,domainPlaceholder:Q7e,generating:G7e,generateToken:H7e,addedWebsites:W7e,websiteCount_one:Y7e,websiteCount_other:q7e,loadingIntegrations:j7e,delete:"Delete",emptyTitle:X7e,emptyDescription:K7e,embedMethod:Z7e,embedInstructions:J7e,copied:e$e,copyCode:t$e,embedHint:r$e,confirmDelete:n$e,errors:i$e,widget:a$e},description:B7e,domainPlaceholder:Q7e,embedHint:r$e,embedInstructions:J7e,embedMethod:Z7e,emptyDescription:K7e,emptyTitle:X7e,errors:i$e,generateToken:H7e,generating:G7e,loadingIntegrations:j7e,loadingRuntime:z7e,selectRuntime:U7e,title:N7e,websiteCount_one:Y7e,websiteCount_other:q7e,websiteDomain:V7e,widget:a$e},Symbol.toStringTag,{value:"Module"})),s$e={types:{all:"All types",document:"Documents",image:"Images",video:"Videos"},previewArtifact:"Preview {{name}}",moreActions:"More actions for {{name}}",actionMenu:"Actions for {{name}}",download:"Download",downloading:"Downloading",edit:"Edit details",delete:"Delete artifact",previewFailed:"Could not preview “{{name}}”: {{message}}",downloadStarted:"Download started for {{name}}",downloadFailed:"Could not download “{{name}}”: {{message}}",updated:"Updated {{name}}",deleted:"Deleted {{name}}",deleteFailed:"Could not delete “{{name}}”: {{message}}",typeFilter:"Artifact type",searchAria:"Search artifacts",searchPlaceholder:"Search artifacts or sessions",retry:"Retry",close:"Close",listAria:"Artifact list",loadFailed:"Could not load artifacts",loadDetailFallback:"Check the storage configuration and try again.",reload:"Reload",noMatch:"No matching artifacts",noArtifacts:"You do not have any artifacts yet",searchHint:"Try another search or artifact type",emptyHint:"Artifacts created in chats will appear here automatically",columns:{name:"Name",source:"Source",updatedAt:"Modified",actions:"Actions"},loadingMore:"Loading more artifacts",unknownTime:"Unknown time",preview:{close:"Close preview",meta:"{{type}} / Version {{version}}",loading:"Loading preview",alt:"Preview of {{name}}",loadFailed:"The preview could not be loaded. Try again later or download the file.",unsupported:"This format cannot be previewed online. Download the file to view it.",sourceAria:"Artifact source",agent:"Agent",session:"Session",tool:"Generated by",createdAt:"Created",fileSize:"File size",tags:"Tags",viewSession:"View session"},deleteDialog:{title:"Delete artifact?",description:"“{{name}}” will be permanently removed from the artifact library. The chat history will not be affected.",deleting:"Deleting",confirm:"Delete",close:"Close delete confirmation"},api:{withStatus:"{{message}} ({{status}})",listFailed:"Could not load the artifact library",syncFailed:"Could not sync chat artifacts",updateFailed:"Could not update the artifact",deleteFailed:"Could not delete the artifact",downloadFailed:"Could not download the artifact"}},o$e={unknownSource:"Unknown source",unknownCreator:"Unknown creator"},l$e={nameRequired:"Enter an artifact name",tooManyTags:"You can add up to {{max}} tags",tagTooLong:"Each tag can contain up to {{max}} characters",title:"Edit artifact details",subtitle:"The content file will not be modified",close:"Close edit dialog",name:"Name",description:"Description",descriptionPlaceholder:"Add its purpose, version, or usage notes",tags:"Tags",tagsPlaceholder:"Separate tags with commas, up to {{max}}",cancel:"Cancel",saving:"Saving",save:"Save"},c$e={change:{added:"Added",modified:"Modified",deleted:"Deleted"},noChanges:"There are no source changes between these versions",chooseFile:"Select a file on the left to view its code",compareTitle:"Compare versions",workspaceTitle:"Source workspace",projectFallback:"Agent project",switchTheme:"Switch source theme",switchThemeTitle:"Switch to {{theme}} theme",themes:{dark:"dark",light:"light"},closeWorkspace:"Close source workspace",close:"Close",changedFiles:"Changed files",projectFiles:"Project files",changes:"Changes",files:"Files",openFiles:"Open files",noFileSelected:"No file selected",comparisonDirection:"Comparison direction",before:"Before optimization",after:"After optimization",loadingEditor:"Loading editor…",changedFileCount_one:"{{count}} file changed",changedFileCount_other:"{{count}} files changed",fileCount_one:"{{count}} file",fileCount_other:"{{count}} files",lineCount_one:"{{count}} line · UTF-8",lineCount_other:"{{count}} lines · UTF-8",viewSource:"View source",viewSourceAria:"View and edit project source"},u$e={nav:"Search",selectAgent:"Select an Agent",checkingCapabilities:"Checking Agent capabilities",notMounted:"This Agent does not have {{label}} mounted",sources:{session:"Sessions",web:"Web",knowledge:"Knowledge base",memory:"Long-term memory"},webDescription:"Search with the web_search tool",backendLocal:"Local",failed:"Search failed: {{message}}",placeholder:{selectAgent:"Select an Agent first",web:"Search the web",knowledge:"Search {{name}}",knowledgeFallback:"this Agent's knowledge base",memory:"Search {{name}}",memoryFallback:"this user's long-term memory",session:"Search this Agent's sessions"},sourceTypeAria:"Search source: {{label}}",notSelected:"Not selected",sourceType:"Search source",selectSource:"Select a search source",noAgentHint:"Select an Agent to search its sessions, the web, and mounted data sources.",loadingCapabilities:"Loading this Agent's search capabilities…",sourceUnavailable:"This Agent does not have this data source mounted",instructions:{web:"Enter keywords and press Enter or select the button to search with web_search.",knowledge:"Enter a question to search this Agent's knowledge base.",memory:"Enter a clue to search long-term memories saved across this user's sessions.",session:"Enter keywords and press Enter or select the button to search this Agent's sessions."},noResults:"No results found for “{{query}}”.",knowledgeFragment:"Knowledge excerpt {{index}}",memoryFragment:"Memory excerpt {{index}}"},h$e={title:"Developer Resources",sections:{documentation:{title:"Related links",description:"Open development documentation and common AgentKit destinations"},bestPractices:{title:"Best practices",description:"Learn from practical development, debugging, and deployment guidance"},showcases:{title:"Showcases",description:"Explore applications built with AgentKit"}},links:{veadkDocs:"VeADK documentation",cliDocs:"AgentKit CLI documentation",platformDocs:"AgentKit platform documentation",console:"AgentKit console"},articles:{veadkDevelopment:{title:"Develop and deploy an Agent with VeADK",description:"Build an Agent with VeADK and deploy it to AgentKit Runtime."},cliDevelopment:{title:"Develop and deploy an Agent with AgentKit CLI",description:"Create a project, debug an Agent, and deploy it with AgentKit CLI."},coverAlt:"Cover image for {{title}}"},showcases:{researchAssistant:{title:"Multi-agent research assistant",description:"Specialized Agents work together to research, analyze, and summarize findings."},multimodalAnalysis:{title:"Multimodal content analysis",description:"Understand images, documents, and video in a single session."},customerService:{title:"Customer service workspace",description:"Combine knowledge retrieval and tool calls to handle complex support requests."},webSearch:{title:"Web search Agent",description:"Search current web content and organize it into traceable answers."},a2uiApp:{title:"A2UI interactive app",description:"Let an Agent generate interactive interfaces as it works through a task."},previewAlt:"Interface preview for {{title}}"}},d$e={title:"Library",untitledSession:"Untitled session",categoryAria:"Library categories",regionAria:"Region",tabs:{skills:"Skills",knowledge:"Knowledge",artifacts:"Artifacts"}},f$e={title:"Manage Agents",subtitle:"Agents in AgentKit Runtime that you can manage",mainAgentOnly:"Only the main Agent is shown (control-plane information).",deleteConfirm:'Delete Agent "{{name}}"? Its Runtime will be permanently deleted.',regionFilterTitle:"Filter by region",regionFilterAria:"Region filter",regionAria:"Region",refresh:"Refresh",loading:"Loading…",empty:"You have not deployed any Agents.",connected:"Connected",connect:"Connect to this Agent",deleteRuntime:"Delete this Runtime",loadingDetail:"Loading details…",agentStructure:"Agent structure",secretHidden:"Sensitive value hidden. Select to reveal it.",revealSecret:"Show the value of {{key}}",fields:{model:"Model",description:"Description",status:"Status details",project:"Project",version:"Version",resources:"Resources",memory:"Memory",tool:"Tool",knowledge:"Knowledge",mcpToolset:"MCP Toolset",updatedAt:"Updated"},resource:{memory:"Memory {{value}} MB",instances:"Instances {{min}}-{{max}}",concurrency:"Concurrency {{value}}"},environmentVariables:"Environment variables",unnamed:"(Unnamed)"},p$e={mainAgent:"Main Agent",subAgent:"Sub-agent {{index}}",itemCount_one:"{{count}} item",itemCount_other:"{{count}} items",info:"Agent information",infoAndTopology:"Agent information and topology",loadingInfo:"Loading Agent information…",unnamedAgent:"Unnamed Agent",tools:"Tools",toolList:"Tool list",studioTool:"Studio Tool",removeTool:"Remove tool {{name}}",remove:"Remove",notConfigured:"Not configured",addStudioTool:"Add Studio tools",addStudioToolHere:"Add Studio tools to this chat",skills:"Skills",skillList:"Skill list",previewUnsupported:"Preview is not supported",sessionEnvironment:"Session environment",environment:"Environment",agentCanvas:"Agent canvas",topology:"Structure",viewCanvasFullscreen:"View Agent canvas in full screen",viewFullscreen:"View full screen",executionCanvas:"Agent execution canvas",fullscreenExecutionCanvas:"Full-screen Agent execution canvas",closeFullscreenCanvas:"Close full-screen canvas",close:"Close",capabilitiesSubtitle:"Capabilities and collaboration topology",closeInfo:"Close Agent information",infoUnavailable:"Agent information is temporarily unavailable."},g$e={mountFailed:"Could not mount the environment",closeDialog:"Close environment dialog",addTitle:"Add environments",description:"Choose the Sandbox environments this Agent can use in the current session",closeAdd:"Close Add environments",searchAria:"Search environments",searchPlaceholder:"Search environment names or capabilities",availableAria:"Available environments and workspaces",loading:"Loading available environments…",noMatch:"No matching environments or workspaces",workspaces:"Workspaces",reuseAll:"Use every available environment in this workspace",availableEnvironmentCount_one:"{{count}} available environment",availableEnvironmentCount_other:"{{count}} available environments",selectWorkspace:"Select workspace {{name}}",environments:"Environments",includedByWorkspaces:"Included by workspace {{names}}",nameSeparator:", ",selectEnvironment:"Select environment {{name}}",selectedWorkspaceCount_one:"{{count}} workspace selected",selectedWorkspaceCount_other:"{{count}} workspaces selected",coveredEnvironmentCount_one:"{{count}} environment covered",coveredEnvironmentCount_other:"{{count}} environments covered",selectionSummary:"{{workspaces}}, {{environments}}",cancel:"Cancel",mounting:"Mounting…",confirm:"Add selected",mountedAria:"Mounted environments",environmentCount_one:"{{count}} environment",environmentCount_other:"{{count}} environments",removeWorkspace:"Remove workspace {{name}}",remove:"Remove",removeEnvironment:"Remove environment {{name}}",add:"Add environments",addMore:"Add more environments",addForSession:"Add environments to this session",loadingAvailable:"Loading available environments…",empty:"No AIO Sandbox environments are available."},m$e={loading:{searching:"Looking for an existing environment",creating:"Initializing environment",connecting:"Connecting to the environment"},initializationFailed:"AgentKit CLI environment initialization failed. Current status: {{status}}.",sessionExpired:"The AgentKit CLI session does not exist or has expired. Try again.",initializationTimeout:"AgentKit CLI environment initialization timed out. Try again later.",nonPersistent:"Non-persistent environment",recyclingHoursMinutes:"Environment reclaimed in {{hours}} hr {{minutes}} min",recyclingMinutes:"Environment reclaimed in {{minutes}} min",connectionError:`Could not connect to the Studio service because the server did not respond. +Original error: {{message}}`,unavailable:"Connection unavailable",requestFailed:"AgentKit CLI request failed",retry:"Retry",terminalTitle:"AgentKit CLI terminal"},v$e={labels:{coding:"Coding",get_city_weather:"City weather",get_location_weather:"Location weather",web_fetch:"Fetch web content"},closeDialog:"Close dialog",title:"Add Studio tools",description:"Studio BFF runs these tools for {{agentName}} in the current session. No Runtime installation is required.",close:"Close Add Studio tools",searchAria:"Search Studio tools",searchPlaceholder:"Search by name or tool ID",availableAria:"Available Studio tools",loading:"Loading Studio tools…",noMatch:"No matching Studio tools",remove:"Remove",add:"Add"},y$e={artifactLibrary:s$e,resourceMetadata:o$e,artifactEdit:l$e,codeBrowser:c$e,search:u$e,developerResources:h$e,library:d$e,manageAgents:f$e,agentTopology:p$e,sessionEnvironment:g$e,agentKitCli:m$e,studioTools:v$e},err=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:m$e,agentTopology:p$e,artifactEdit:l$e,artifactLibrary:s$e,codeBrowser:c$e,default:y$e,developerResources:h$e,library:d$e,manageAgents:f$e,resourceMetadata:o$e,search:u$e,sessionEnvironment:g$e,studioTools:v$e},Symbol.toStringTag,{value:"Module"})),b$e={requestFailed:"请求失败 ({{status}})",unknownError:"未知错误",contentTypeMissing:"Content-Type 缺失",response:"响应:{{response}}",fallbackWithDetail:"{{fallback}}:{{detail}}",fallbackWithHttpStatus:"{{fallback}}(HTTP {{status}})",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应({{contentType}})"},x$e={unconfigured:"管理员未配置 AgentKit Dev Sandbox,请配置后再使用",invalidSession:"AgentKit CLI 返回了无效的 Session。",loadCapabilitiesFailed:"无法读取 AgentKit CLI 配置。",invalidCapabilities:"AgentKit CLI 返回了无效的配置状态。",listSessionsFailed:"无法读取 AgentKit CLI Session。",invalidSessionList:"AgentKit CLI 返回了无效的 Session 列表。",createSessionFailed:"无法创建 AgentKit CLI Session。",openSessionFailed:"无法打开 AgentKit CLI Session。",openTerminalFailed:"无法打开 AgentKit CLI 终端。",invalidTerminalUrl:"AgentKit CLI 返回了无效的终端地址。"},w$e={cnBeijing:"华北 2(北京)",cnShanghai:"华东 2(上海)"},A$e={runtimeUnsupported:"该 Runtime 暂不支持连接,请确认服务已正常运行。"},S$e={autoConfigureFailed:"飞书机器人自动配置失败"},T$e={actionFailed:"{{action}}失败",detail:"详细信息:{{detail}}",request:"请求:{{request}}"},C$e={persistentMemoryHint:"提示:会话已不存在。使用 in-memory 或 SQLite 短期记忆时,多实例、进程重启或滚动发布都可能导致会话丢失;建议改用基于数据库的持久化短期记忆存储。",unsupportedRouteHint:"提示:该 Runtime 未提供会话能力运行接口,可能是 Runtime 版本与当前 Studio 不兼容。",toolArgumentHint:"提示:模型生成的工具参数格式不完整,请重新发送一次。",resourceCollectionExpiredHint:"提示:本次资源清单已失效,请重新发送任务;系统会重新收集资源后再创建 Agent。",networkConfigurationHint:"提示:请检查共享公网出口等网络配置,然后重试。",modelQuotaHint:"提示:模型当前触发了 TPM/RPM 配额限制,请稍后重试或提高模型配额。",rawResponseLabel:"原始响应:"},O$e={httpStatus:"HTTP 状态码:{{status}}",errorCode:"错误码:{{code}}",cloudResponseBody:`云端响应正文: {{body}}`,loadFailedWithDetail:"读取实例日志失败:{{detail}}",invalidFormat:"读取实例日志失败:服务返回格式无效"},k$e={untitledSession:"未命名会话",webUnavailable:"网络搜索接口未就绪(后端未启用 /web/search)。",webFailed:"网络搜索失败:{{message}}",webNotMounted:"当前 Agent 未挂载 web_search 工具。",knowledgeNotMounted:"该 Agent 未挂载知识库。",memoryNotMounted:"该 Agent 未挂载长期记忆。",knowledge:"知识库",longTermMemory:"长期记忆"},E$e={listSpacesFailed:"读取 Skill 空间失败",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",deleteSpaceFailed:"删除 Skill 空间失败",uploadFailed:"上传 Skill 失败",validateFailed:"校验 Skill 失败",deleteFailed:"删除 Skill 失败",listFilesFailed:"读取 Skill 文件失败",downloadFailed:"下载 Skill 失败"},_$e={truncatedData:"{{data}}…(已截断,共 {{count}} 个字符)",incompleteEvent:"SSE 流在事件完整返回前已结束。原始数据:{{data}}",invalidEventJson:"无法解析 SSE 事件中的 JSON。原始数据:{{data}}"},R$e={loadConfigNetworkFailed:"无法加载登录配置,请检查网络后重试。",configServiceFailed:"登录配置服务异常(HTTP {{status}}),请稍后重试。",invalidConfigResponse:"登录配置服务返回了无法解析的响应,请稍后重试。",serviceNetworkFailed:"无法连接身份服务,请检查网络后重试。",invalidServiceResponse:"身份服务返回了无法解析的响应,请稍后重试。",serviceFailed:"身份服务异常(HTTP {{status}}),请稍后重试。"},D$e={invalidToken:"GitHub Token 无效或没有仓库写入权限",notFound:"仓库、分支或文件不存在,或 Token 无权访问",rejectedCommit:"GitHub 拒绝了提交,请检查分支和文件状态",requestFailed:"GitHub 请求失败(HTTP {{status}})",networkFailed:"连接 GitHub 失败,请检查网络后重试",invalidRepositoryFormat:"GitHub Repo 格式应为 owner/repository",insecureRepositoryUrl:"仅支持安全的 github.com 仓库地址",unsafeProjectPath:"Agent 项目目录必须是仓库内的安全相对路径",tokenRequired:"GitHub Token 不能为空",invalidBaseBranch:"目标分支格式不正确",invalidPublishBranch:"发布分支格式不正确",noFiles:"没有需要提交的文件",missingBaseSha:"目标分支缺少有效 Git SHA",fileAlreadyExists:"目标仓库中已存在 {{path}},未覆盖现有文件",pathNotUpdatable:"目标路径 {{path}} 不是可更新的文件",invalidPullRequest:"GitHub 未返回有效的 Pull Request"},L$e={loadCapabilitiesFailed:"加载视频模型能力失败",uploadAssetFailed:"上传{{fileName}}失败",enhancePromptFailed:"提示词优化失败",createTaskFailed:"创建视频生成任务失败",getTaskFailed:"查询视频生成任务失败",downloadFailed:"下载生成视频失败"},M$e={listFailed:"加载网站集成失败",createFailed:"创建网站集成失败",deleteFailed:"删除网站集成失败"},I$e={loadFailed:"读取知识库失败",htmlHidden:"[HTML 内容已隐藏]",redacted:"[已脱敏]",depthTruncated:"[内容过深,已截断]",circularReference:"[循环引用]",diagnosticsUnavailable:"[诊断信息无法显示]",statusCode:"状态码:{{status}}",errorCode:"错误码:{{code}}",requestId:"请求 ID:{{requestId}}",diagnostics:"诊断:{{diagnostics}}",detail:"详情:{{detail}}",signInRequired:"请先登录后再访问知识库",forbidden:"你没有权限操作这个知识库",notFound:"知识库或知识内容不存在",conflict:"知识库当前状态不允许执行此操作",requestFailed:"知识库请求失败 ({{status}})"},P$e={invalidSourceSnapshot:"源码快照的响应格式无效。",invalidProjectList:"项目列表的响应格式无效。",invalidProjectVersion:"项目版本的响应格式无效。",loadProjectsFailed:"无法读取已保存项目",loadVersionsFailed:"无法读取项目版本",deleteVersionFailed:"删除项目版本失败",invalidDeleteVersionResponse:"删除项目版本的响应格式无效。",loadProjectSourceFailed:"无法读取项目源码",loadSnapshotFailed:"无法读取源码快照",restoreSnapshotFailed:"无法恢复当前源码快照",downloadSourceFailed:"下载源码失败",downloadNotZip:"源码下载响应不是 ZIP 文件。",downloadSizeMismatch:"源码压缩包大小与发布记录不一致,请重试。"},N$e={invalidFormat:"{{label}}格式错误。",validationSeparator:";",invalidAnalysisResult:"迁移分析结果格式错误。",invalidFrameworkCandidate:"框架候选格式错误。",invalidAnalysisEvidence:"分析证据格式错误。",invalidEntryCandidate:"入口候选格式错误。",invalidQuestion:"待确认问题格式错误。",invalidTask:"迁移会话格式错误。",invalidAnalysisReference:"分析结果引用格式错误。",invalidSourcePersistence:"迁移源码保存状态格式错误。",invalidActivity:"迁移执行动态格式错误。",invalidActivityItem:"迁移执行动态项格式错误。",invalidActivityTool:"迁移执行工具项格式错误。",invalidActivityPlan:"迁移执行计划格式错误。",invalidActivityPlanItem:"迁移执行计划项格式错误。",invalidArtifact:"迁移产物格式错误。",invalidEnvironmentDefaults:"环境变量默认值格式错误。",invalidArtifactFile:"迁移产物文件格式错误。",invalidVerificationCheck:"迁移校验项格式错误。",requestValidationFailed:"请求参数校验失败:{{detail}}",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}})。请检查代理或网关配置。",loadCapabilitiesFailed:"读取迁移能力失败",invalidCapabilities:"迁移能力格式错误。",invalidModelCapabilities:"迁移模型能力格式错误。",loadTasksFailed:"读取迁移会话失败",invalidTaskList:"迁移会话列表格式错误。",createTaskFailed:"创建迁移会话失败",uploadProjectFailed:"上传迁移项目失败",loadActivityFailed:"读取迁移执行动态失败",startFailed:"启动迁移失败",submitAnswersFailed:"提交分析补充信息失败",stopFailed:"终止迁移失败",deleteTaskFailed:"删除迁移会话失败",loadArtifactFailed:"读取迁移产物失败",loadArtifactFileFailed:"读取迁移产物文件失败",downloadArtifactFailed:"下载迁移产物失败",labels:{analysisResult:"迁移分析结果",recommendation:"迁移建议",boundary:"迁移边界",frameworkCandidate:"框架候选",analysisEvidence:"分析证据",recommendedFramework:"推荐框架",entryCandidate:"入口候选",entryFramework:"入口框架",includeScope:"迁移包含范围",excludeScope:"迁移排除范围",assumptions:"分析假设",question:"待确认问题",analysisWarnings:"迁移警告",task:"迁移会话",artifactStatus:"迁移产物状态",analysisReference:"分析结果引用",confirmation:"迁移确认",confirmedFramework:"确认框架",error:"迁移错误",sourcePersistence:"迁移源码保存状态",activity:"迁移执行动态",activityItem:"迁移执行动态项",activityTool:"迁移执行工具项",activityPlanItem:"迁移执行计划项",artifact:"迁移产物",cli:"CLI 信息",migration:"迁移信息",startup:"启动信息",environment:"环境变量信息",verification:"校验信息",report:"迁移报告",archive:"产物归档",environmentDefaults:"环境变量默认值",requiredEnvironment:"必需环境变量",optionalEnvironment:"可选环境变量",artifactFile:"迁移产物文件",verificationCheck:"迁移校验项",artifactWarnings:"迁移产物警告",errorResponse:"错误响应",errorDetail:"错误详情",capabilities:"迁移能力",framework:"迁移框架",modelCapabilities:"迁移模型能力",taskList:"迁移会话列表"}},B$e={status:{ready:"就绪",wakeable:"可唤醒",creating:"创建中",starting:"启动中",pending:"等待中",running:"运行中",failed:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"},developmentTimeout:"等待开发环境响应超时。任务可能仍在运行,请稍后重新进入当前会话查看状态。",developmentDisconnected:"与开发环境的连接已中断。任务可能仍在运行,请稍后重新进入当前会话查看状态。",developmentFailed:"开发任务未能继续,开发环境已保留。请在当前会话重试。",invalidStudioResponse:"{{fallback}} Studio 服务响应异常,请刷新后重试。",invalidSession:"AgentKit 沙箱返回了无效的 Session 信息。",invalidSnapshot:"AgentKit 沙箱返回了无效的 Snapshot 信息。",invalidSettings:"Sandbox 返回了无效设置。",invalidThreadSnapshot:"Sandbox 返回了无效 Thread 快照。",emptyConversationResponse:"沙箱对话服务未返回内容。",invalidConversationResponse:"沙箱对话服务返回了无法解析的响应。",conversationFailed:"沙箱对话失败,请稍后重试。",emptyReply:"沙箱未返回有效回复,请重试。",missingSession:"缺少要操作的 AgentKit Session。",listCodexFailed:"无法读取 Codex 智能体,请稍后重试。",invalidSessionList:"AgentKit 沙箱返回了无效的 Session 列表。",invalidSnapshotList:"AgentKit 沙箱返回了无效的 Snapshot 列表。",startFailed:"无法启动 AgentKit 沙箱,请稍后重试。",listAgentFailed:"无法读取 {{kind}} 智能体,请稍后重试。",invalidKindSessionList:"AgentKit 返回了无效的 {{kind}} Session 列表。",invalidKindSnapshotList:"AgentKit 返回了无效的 {{kind}} Snapshot 列表。",createAgentFailed:"无法创建 {{kind}} 智能体,请稍后重试。",missingSessionToOpen:"缺少要打开的 AgentKit Session。",openAgentFailed:"无法打开 {{kind}} 智能体。",invalidAgentHomeUrl:"{{kind}} 智能体返回了无效的主页面地址。",missingSessionForTerminal:"缺少要打开 Terminal 的 AgentKit Session。",openTerminalFailed:"无法打开 {{kind}} Terminal。",deleteAgentFailed:"无法删除 {{kind}} 智能体。",missingSnapshot:"缺少要唤醒的 AgentKit Snapshot。",resumeSnapshotFailed:"无法从快照唤醒智能体,请稍后重试。",deleteSnapshotFailed:"无法删除智能体快照。",missingSessionToConnect:"缺少要连接的 AgentKit Session。",connectCodexFailed:"无法连接 Codex 智能体,请稍后重试。",sessionNotReady:"AgentKit Session 尚未就绪,当前状态:{{status}}。",invalidMessage:"内置智能体会话缺少有效的消息内容。",interruptFailed:"无法停止当前任务。",getStatusFailed:"无法读取 Codex 状态。",getEndpointFailed:"无法读取 Sandbox Endpoint。",invalidEndpoint:"Sandbox 返回了无效 Endpoint。",createHandoffPairingFailed:"无法生成 Codex 云端接力配对码。",invalidHandoffPairing:"Studio 返回了无效的 Codex 云端接力配对码。",getHandoffStatusFailed:"无法读取端云接力状态。",invalidHandoffStatus:"Studio 返回了无效的端云接力状态。",listModelsFailed:"无法读取 Codex 模型列表。",invalidModelList:"Sandbox 返回了无效模型列表。",setModelFailed:"无法切换 Codex 模型。",invalidModel:"Sandbox 返回了无效模型。",listSkillsFailed:"无法读取 Codex Skills。",invalidSkillList:"Sandbox 返回了无效 Skill 列表。",listThreadsFailed:"无法读取 Codex Thread 列表。",invalidThreadList:"Sandbox 返回了无效 Thread 列表。",createThreadFailed:"无法创建新的 Codex Thread。",missingThread:"缺少要读取的 Codex Thread。",readThreadFailed:"无法读取 Codex 历史消息。",resumeThreadFailed:"无法恢复 Codex Thread。",forkThreadFailed:"无法分叉 Codex Thread。",archiveThreadFailed:"无法归档 Codex Thread。",invalidArchiveResult:"Sandbox 返回了无效归档结果。",deleteThreadFailed:"无法删除 Codex Thread。",invalidDeleteResult:"Sandbox 返回了无效删除结果。",compactThreadFailed:"无法压缩 Codex Thread。",getSettingsFailed:"无法读取 Codex 权限与工作空间。",updatePermissionsFailed:"无法更新 Codex 权限。",updateWorkspaceFailed:"无法更新 Codex 工作空间。",invalidWorkingDirectory:"Sandbox 返回了无效工作目录。",listDirectoriesFailed:"无法读取 Sandbox 目录。",invalidDirectoryList:"Sandbox 返回了无效目录列表。",resolveApprovalFailed:"无法提交 Codex 审批决定。",uploadFileFailed:"无法上传文件到 Sandbox。",invalidUploadResult:"Sandbox 返回了无效上传结果。",disconnectCodexFailed:"无法断开 Codex 智能体连接。",deleteCodexFailed:"无法删除 Codex 智能体。",openSandboxTerminalFailed:"无法打开 Sandbox Terminal。",openSandboxBrowserFailed:"无法打开 Sandbox Browser。",toolLabel:"Sandbox 工具",invalidToolUrl:"{{label}} 返回了无效地址。",unsafeToolUrl:"{{label}} 返回了不安全的地址。"},$$e={invalidSandboxVersion:"沙箱版本响应格式无效",loadSandboxVersionsFailed:"查询沙箱版本失败",updateSandboxFailed:"更新 Sandbox 失败",invalidSandboxUpdate:"沙箱更新响应格式无效",errorWithDetailAndRawResponse:`{{context}} {{detail}} 原始响应: {{response}}`,errorWithRawResponse:`{{context}} 原始响应: -{{response}}`,loadArkApiKeysFailed:"加载 Ark API Key 失败",loadModelsFailed:"加载模型列表失败",runtimeAccessDenied:"当前账号无权访问该 Runtime,请刷新列表或重新登录后重试。",privateRuntimeUnavailable:"Runtime 已部署成功,但当前 Studio 无法访问私网 Runtime。请使用已绑定相同 VPC 的 Studio 访问,或改用公网 / 公网+VPC 部署。",runtimeTemporarilyUnavailable:"Runtime 已部署成功,但 Studio 暂时无法连接服务。网关域名可能仍在生效,或当前网络/DNS 无法访问该 Runtime,请稍后在智能体管理页重试连接。",runtimeConnectionUnsupported:"该 Runtime 的 Agent Server 未提供连接接口,请确认 Runtime 已就绪且版本兼容。",runtimeConnectionDenied:"Runtime 服务拒绝了连接请求,请检查 Runtime 的鉴权配置。",listAgentsFailed:"读取 Agent 列表失败",invalidListAppsJson:"Runtime /list-apps 返回了无法解析的 JSON 响应。",invalidListAppsFormat:"Runtime /list-apps 返回格式无效,应为非空字符串数组。",createSessionFailedWithStatus:"创建会话失败 ({{status}})",createSessionFailed:"创建会话失败",getSessionFailed:"读取会话失败",getSessionFailedWithDetail:"读取会话失败:{{status}}:{{detail}}",feedbackRuntimeOnly:"只有连接到 AgentKit Runtime 的会话支持反馈回流",feedbackRegionMissing:"Runtime 缺少地域信息,无法提交反馈",submitFeedbackFailed:"提交反馈失败",loadEvaluationSetsFailed:"读取评测集失败",loadAutoEvaluationStatusFailed:"读取自动评测状态失败",loadOptimizationsFailed:"读取优化项失败",deleteEvaluationCaseFailed:"删除评测案例失败",downloadFileFailed:"下载文件失败",fileUnavailable:"文件内容不可用",uploadFileFailed:"文件上传失败",traceDisabled:"该 Agent 暂未开启链路观测,请到控制台打开后使用。",loadTraceFailed:"加载调用链路失败",contentTypeMissing:"Content-Type 缺失",traceNonJson:"加载调用链路失败:服务端返回了非 JSON 响应({{contentType}}),请检查 Studio API 代理配置",invalidTraceFormat:"加载调用链路失败:返回格式无效",submitIssueFeedbackFailed:"问题反馈上报失败",issueFeedbackNotConfirmed:"问题反馈上报失败:服务端未确认提交结果",noPreviewableAgent:"该 Runtime 未提供可预览的 Agent。",agentSearchFailed:"Agent 检索失败",emptySseBody:"HTTP 200,SSE 响应体为空。",noDisplayableSseReply:"HTTP 200,SSE 响应中没有可展示的模型回复。",firstSseEventTimeout:"30 秒内未收到首个 SSE 事件。",runSessionFailed:"运行会话失败",runSseFailedWithDetail:"运行会话失败:{{status}}:{{detail}}",checkRuntimeNameFailed:"检查 Runtime 名称失败",invalidRuntimeNameCheck:"检查 Runtime 名称失败:服务返回格式错误",loadCloudResourcesFailed:"加载云资源失败",invalidCloudResources:"云资源列表响应格式无效",invalidEnvironmentMount:"挂载环境响应格式无效",environmentMountMismatch:"挂载环境响应与请求不一致",environmentMountNetworkFailed:"无法连接 Studio 服务,环境挂载未完成。请检查网络后重试。",environmentMountFailed:"挂载环境失败",clipboardUnsupported:"当前浏览器不支持写入剪贴板。",clipboardWriteFailed:"无法写入剪贴板,请检查剪贴板权限。",loadSystemInfoFailed:"加载系统信息失败",invalidSystemInfo:"系统信息响应格式无效",invalidEnvironmentBuild:"环境构建响应格式无效",invalidEnvironmentBuildStep:"环境构建步骤响应格式无效",invalidEnvironmentManifest:"环境 Manifest 响应格式无效",invalidImageRepository:"环境镜像仓库响应格式无效",invalidCodeRepository:"环境代码仓库响应格式无效",invalidImageSource:"环境镜像来源响应格式无效",invalidEnvironment:"环境响应格式无效",invalidWorkspace:"工作区响应格式无效",loadWorkspacesFailed:"加载工作区失败",invalidWorkspaceList:"工作区列表响应格式无效",saveWorkspaceFailed:"保存工作区失败",deleteWorkspaceFailed:"删除工作区失败",loadEnvironmentsFailed:"加载环境失败",invalidEnvironmentList:"环境列表响应格式无效",probeRepositoryFailed:"探查代码仓库失败",invalidRepositoryProbe:"代码仓库探查响应格式无效",exportEnvironmentCodeFailed:"导出环境分享码失败",invalidEnvironmentCode:"环境分享码响应格式无效",inspectEnvironmentCodeFailed:"检测环境分享码失败",invalidEnvironmentCodeInspection:"环境分享码检测响应格式无效",importEnvironmentCodeFailed:"导入环境分享码失败",invalidEnvironmentCodeImport:"环境分享码导入响应格式无效",studioUnavailable:"无法连接 Studio 服务,请确认后端已启动后重试。",saveEnvironmentFailed:"保存环境失败",deleteEnvironmentFailed:"删除环境失败",startEnvironmentBuildFailed:"启动环境构建失败",loadEnvironmentBuildFailed:"读取环境构建详情失败",loadEnvironmentManifestFailed:"读取环境 Manifest 失败",invalidEnvironmentResource:"环境资源响应格式无效",loadEnvironmentResourcesFailed:"加载环境构建资源失败",updateCodexSandboxFailed:"更新 Codex Sandbox 失败",invalidCodexSandboxUpdate:"Codex Sandbox 更新响应格式无效",loadUserPoolsFailed:"加载用户池失败",invalidUserPoolList:"用户池列表响应格式无效",syncGithubFailed:"同步 GitHub 代码失败 ({{status}})",validatingMigrationArtifact:"正在校验迁移产物",uploadingCodePackage:"正在上传代码包",migrationArtifactValidated:"迁移产物校验完成",codePackageUploaded:"代码包上传完成",deploymentProgress:{preparing:"正在准备部署",uploading:"正在上传代码包",building:"正在构建镜像",buildLogsSyncing:"正在构建镜像,构建日志已同步。",buildLogsComplete:"构建日志同步完成。",buildFailedLogsSynced:"镜像构建失败,最终构建日志已同步。",buildLogsUnavailable:"暂时无法读取构建日志。",finalBuildLogsUnavailable:"暂时无法读取最终构建日志。",deploying:"正在部署服务",publishing:"正在发布服务",evaluating:"正在创建评测集",updating:"正在更新 Runtime 配置",completing:"正在完成部署",github:"正在配置 GitHub 持续交付",inProgress:"正在部署"},deploymentFailed:"部署失败",deploymentDisconnected:"部署失败:连接中断",deploymentMissingAgentName:"部署失败:返回缺少 Agent 名称",deploymentMissingConnection:"部署失败:返回缺少 AgentKit 连接信息",cancelDeploymentFailed:"取消部署失败 ({{status}})",loadFailed:"加载失败 ({{status}})",loadPermissionsFailed:"加载权限失败 ({{status}})",invalidPermissionResponse:"权限服务返回了无法解析的响应",checkStudioUpdateFailed:"检查 Studio 更新失败 ({{status}})",studioUpdatePreflightFailed:"Studio 更新权限预检失败 ({{status}})",submitStudioUpdateFailed:"提交 Studio 更新失败 ({{status}})",loadAgentUsageFailed:"加载 Agent 用量失败",notProvided:"未提供",agentUsageNonJson:"加载 Agent 用量失败:服务端返回非 JSON 响应(HTTP {{status}},Content-Type: {{contentType}})。",checkStudioGateway:"请确认当前服务以 Studio 模式启动,并检查代理或网关配置。",agentUsageInvalidJson:"加载 Agent 用量失败:服务端返回了无法解析的 JSON(HTTP {{status}},Content-Type: {{contentType}})。",retryCheckGateway:"请稍后重试;若问题持续,请检查代理或网关配置。",loadCronJobsFailed:"加载定时任务失败",loadCronJobFailed:"加载定时任务详情失败",createCronJobFailed:"创建定时任务失败",updateCronJobFailed:"更新定时任务失败",enableCronJobFailed:"启用定时任务失败",pauseCronJobFailed:"暂停定时任务失败",runCronJobFailed:"立即执行定时任务失败",loadCronHistoryFailed:"加载执行历史失败",stopCronRunFailed:"终止执行失败",deleteCronJobFailed:"删除定时任务失败",loadRuntimeFailed:"加载 Runtime 失败",loadLocalToolsFailed:"读取本地工具失败",connectDynamicRouteFailed:"连接 Studio 动态路由失败",a2aProbeDenied:"Runtime 服务拒绝了 A2A 探测请求,请检查 Runtime 的鉴权配置。",loadA2aCardFailed:"读取 A2A Agent Card 失败",loadRuntimeApiKeyFailed:"读取 Runtime API Key 失败",runtimeApiKeyMissing:"Runtime 未返回可用的 API Key",deleteFailed:"删除失败 ({{status}})",runtimeManageForbidden:"当前账号没有管理该 Runtime 的权限。",runtimeNotFound:"该 Runtime 不存在或已被删除。",runtimeUnavailable:"当前账号无法访问该 Runtime。",checkRuntimeUpdateFailed:"检查 Runtime 更新能力失败(HTTP {{status}}),请稍后重试。",loadRuntimeDetailFailed:"加载 Runtime 详情失败",generateProjectFailed:"生成项目失败",generateAgentConfigFailed:"生成 Agent 配置失败",createDebugRunFailed:"创建调试运行失败",createDebugSessionFailed:"创建调试会话失败",loadDebugTraceFailed:"加载调试调用链路失败",invalidDebugTrace:"加载调试调用链路失败:返回格式无效",debugRunFailed:"调试运行失败",cleanupDebugRunFailed:"清理调试运行失败"},F$e={loadFailed:"读取会话模式能力失败(HTTP {{status}})",invalidResponse:"会话模式能力响应格式错误"},z$e={nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},{{contentType}}){{detail}}"},U$e={common:b$e,agentkitCli:x$e,cloudRegion:w$e,connections:A$e,feishuBot:T$e,requestError:S$e,runSse:C$e,runtimeLogs:O$e,search:k$e,skills:E$e,sse:_$e,identity:R$e,github:D$e,video:L$e,websiteIntegration:M$e,knowledge:I$e,intelligentDevelopment:P$e,migrations:N$e,sandbox:B$e,client:$$e,newChatCapabilities:F$e,jsonResponse:z$e},trr=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:x$e,client:$$e,cloudRegion:w$e,common:b$e,connections:A$e,default:U$e,feishuBot:T$e,github:D$e,identity:R$e,intelligentDevelopment:P$e,jsonResponse:z$e,knowledge:I$e,migrations:N$e,newChatCapabilities:F$e,requestError:S$e,runSse:C$e,runtimeLogs:O$e,sandbox:B$e,search:k$e,skills:E$e,sse:_$e,video:L$e,websiteIntegration:M$e},Symbol.toStringTag,{value:"Module"})),V$e={backToEvaluationCase:"返回评测案例",cancel:"取消",copied:"已复制",copy:"复制",exportConversation:"导出会话",retry:"重试"},Q$e={title:"您想以哪种方式添加 Agent 来运行?",subtitle:"选择最适合你的方式,下一步即可开始",quickCreate:{title:"从 0 快速创建",description:"用智能、自定义、模板或工作流的方式从零创建一个 Agent。"},intelligent:{title:"智能模式",description:"描述目标,按你的意图构建、调试并验证 Agent。"},package:{title:"从代码包添加和部署",description:"上传 Agent 项目压缩包,查看代码并直接部署到 AgentKit Runtime。"},migrate:{title:"从存量迁移",description:"从您的 LangChain、Dify 等存量项目迁移至 AgentKit Runtime。"}},G$e={subject:{file:"文件修改",command:"命令执行"},decision:{accept:"已允许本次{{subject}}",acceptForSession:"已在本会话中允许{{subject}}",decline:"已拒绝{{subject}}",cancel:"已取消{{subject}}审批"},details:{command:"命令",grantRoot:"授权路径",cwd:"执行目录"}},H$e={noDescription:"暂无描述",region:"地域",unknownAgent:"未知 Agent"},W$e={agentTransfer:"智能体移交",annotationHint:"模型回复;选中文字后可添加批注",continueBranch:"继续“{{branch}}”这个方向",emptyResponse:"本次没有返回可显示的内容。",subagentDescription:"正在执行主 Agent 移交的任务。"},Y$e={title:"需要配置 {{provider}} AK/SK",prefix:"智能体工作台需要 {{provider}} 凭据才能使用。请在运行环境中设置",and:"与",suffix:"后重试。"},q$e={buildRunning:{title:"当前构建仍在进行",description:"离开将停止本轮构建;当前会话仍会保留,可稍后从历史会话重新进入。",confirm:"停止并离开"},deleteThread:{title:"删除 Codex 历史会话",description:"将删除“{{name}}”,并从历史会话中移除。",confirm:"确认删除"},returnToCreate:{title:"返回创建首页?",description:"返回后当前填写的内容将会丢失,确定要返回吗?",confirm:"确定返回"}},j$e={additionalAgentDeleteFailures:";另有 {{count}} 个失败",agentDeleteFailures:"{{count}} 个 Agent 删除失败:{{failures}}{{suffix}}",agentToolsMissing:"当前 Agent 缺少任务工具:{{tools}}",buildStopUnconfirmed:"已离开开发环境,但未能确认本轮构建已停止。任务可能仍在运行,请稍后从历史会话检查状态。",builtinAgentSendFailed:"内置智能体发送失败:{{message}}",bytePlusEvaluationUnsupported:"BytePlus 暂不支持 AgentKit 评测集",clipboardUnsupported:"当前浏览器不支持写入剪贴板。",cloudCodexEmptyReply:"云端 Codex 已结束,但没有生成回复,请重新发送任务。",cloudCodexSessionMissing:"云端 Codex Session 暂未出现在列表中,请稍后重试。",deploymentRuntimeIdMissing:"部署完成,但未返回 Runtime ID。",environmentExpired:"所选环境已失效,请刷新后重新选择。",environmentsLoadFailed:"读取环境失败",evaluationCaseSessionMissing:"这条案例缺少会话定位信息,无法跳转。",evaluationUnsupportedForReply:"当前回复暂不支持加入评测集",firstFrameRequired:"首尾帧生成需要先添加首帧图片。",incompletePromptOptimization:"提示词优化结果不完整,请重新优化后再试。",intelligentCapabilityCheckFailed:"智能开发能力检查失败(HTTP {{status}})",intelligentSessionCreateFailed:"智能开发会话创建失败",invalidIntelligentCapability:"智能开发模型能力格式错误。",localBffToolsNotConfigured:"本地 Studio BFF 没有配置工具。",localToolsLoadFailed:"读取本地工具失败",loginPopupBlocked:"登录窗口被浏览器拦截,请允许弹出窗口后重试。",loginPopupClosed:"登录窗口已关闭,请重新登录以继续当前操作。",mediaTooLarge:"{{fileName}} 超出当前平台允许的素材大小。",mountEnvironmentFailed:"挂载环境失败",noConnectedSandbox:"当前没有已连接的 Sandbox。",noCreateAgentPermission:"当前账号没有添加 Agent 的权限。",noManageAgentPermission:"当前账号没有管理 Agent 的权限。",noOptimizationBaseline:"当前版本没有可对比的优化前版本。",oauthUrlMissing:"事件中没有授权地址。",onlyCloudAgentUpdatable:"仅支持更新已部署的云端智能体。",optimizationVersionMissing:"无法找到本次优化对应的项目版本,可能已被删除。",persistentStorageNotConfigured:"管理员未配置持久化存储",readDraftFailed:"无法读取本机草稿,请稍后重试。",runtimeAgentNameMissing:"Runtime 缺少智能体名称,无法更新。",runtimeBffToolsDisabled:"当前 Runtime Agent 未开启 BFF 工具能力。",runtimeDeploymentConfigUnavailable:"该 Runtime 的原发布配置不可恢复,无法安全更新。",runtimeMissingForConnection:"缺少 Runtime 信息,无法连接智能体。",runtimeRegionMissingForDelete:"Runtime 缺少地域信息,无法删除",runtimeRegionMissingForUpdate:"Runtime 缺少地域信息,无法更新。",runtimeUpdateUnsupported:"当前 Runtime 不支持原地更新。",sandboxRuntimeUnavailable:"当前 Agent 没有可用的 Sandbox Runtime。",sandboxToolsUnavailable:"当前 Studio BFF 未提供 Sandbox 执行工具。",saveDraftLocationRejected:"浏览器拒绝保存当前草稿位置,请检查站点存储权限后重试。",saveDraftRejected:"浏览器拒绝保存草稿,请稍后重试。",selectSkillToOptimize:"请先选择需要优化的 Skill。",sessionMissingForMount:"当前会话不存在,无法挂载环境。",sessionNotReady:"会话尚未就绪。",sessionUnavailable:"当前会话不可用,请关闭后重试。",sourceNotReady:"该源码尚未准备好,请返回对话继续处理。",textVideoRejectsReferences:"文生视频不使用参考素材,请先移除已添加的图片或视频。",videoEditRequiresVideo:"视频编辑需要先添加待编辑视频。",videoExtendRequiresVideo:"视频续写需要先添加基础视频。",videoGenerationFailed:"视频生成失败,请稍后重试。",videoModeUnsupported:"当前平台暂不支持所选视频任务模式。",videoPreviewMissing:"视频任务已完成,但服务端未返回预览地址。",videoReferenceRequired:"参考素材生视频需要至少添加一项参考图片或参考视频。"},X$e={like:"赞",removeLike:"取消点赞",dislike:"踩",removeDislike:"取消点踩",reportIssue:"问题反馈",traceFlameGraph:"Tracing 火焰图"},K$e={0:"今天想做点什么?",1:"有什么可以帮你的?",2:"需要我帮你查点什么吗?",3:"有问题尽管问我",4:"嗨,我们开始吧",5:"开始一段新对话吧",6:"今天想先解决哪件事?",7:"把你的想法告诉我吧",8:"我们从哪里开始?",9:"有什么任务交给我?",10:"准备好一起推进了吗?",11:"说说你现在最关心的问题",12:"今天也一起把事情做好",13:"我在,随时可以开始",intelligentDevelopment:"让灵感自由生长"},Z$e={agentCapabilities:"正在检查 Agent 能力…",session:"加载会话…"},J$e={cancelled:"授权已取消。",pasteCallbackUrl:"授权完成后,请粘贴回调页面(浏览器地址栏)的完整 URL:",popupBlocked:"弹窗被拦截,请允许弹窗后重试。",unsupportedUrl:"授权链接不是 http/https 地址,已阻止打开。"},e9e={volcengine:"火山引擎"},t9e={checkingPersistence:"正在检查持久化能力…",exitDevelopment:"退出开发环境",fileUploaded:"已上传文件到 Sandbox",filesUploaded:"已上传 {{count}} 个文件到 Sandbox",intelligentDevelopment:"智能开发",mode:{readOnly:"只读",workspaceWrite:"工作区写入",fullAccess:"完全访问"},approvalPolicy:{untrusted:"仅不可信命令",onRequest:"按需审批",never:"不审批"},reviewer:{user:"由我审批",autoReview:"自动审查"},labels:{approvalPolicy:"审批策略",file:"文件",fileNumber:"文件 {{number}}",mode:"沙箱模式",networkAccess:"网络访问",reviewer:"审批方式",workingDirectory:"工作目录"},network:{allowed:"允许",disabled:"关闭"},permissionsUpdated:"已更新当前 Sandbox Session 的 Codex 权限",persistenceUnknown:"暂时无法确认持久化能力",stoppedReady:"已停止,可继续输入",uploadedFilesPrompt:"以下文件已上传到当前 Sandbox 工作空间,请在任务中使用:",workspaceUpdated:"已更新工作空间"},r9e={addAgent:"添加智能体",addFromPackage:"从代码包添加",agent:"智能体",automations:"自动化",createAgent:"创建智能体",createSkill:"创建技能",cronJobs:"定时任务",issueFeedback:"问题反馈",library:"资源库",migrateAgent:"迁移智能体",newConversation:"新会话",optimizeSkill:"优化 {{name}}",search:"搜索",skill:"技能",skillLibrary:"技能库",systemInfo:"系统信息",updateAgent:"更新 {{name}}"},n9e={actions:V$e,addAgent:Q$e,approval:G$e,common:H$e,conversation:W$e,credentials:Y$e,dialogs:q$e,errors:j$e,feedback:X$e,greetings:K$e,loading:Z$e,oauth:J$e,providers:e9e,sandbox:t9e,titles:r9e},rrr=Object.freeze(Object.defineProperty({__proto__:null,actions:V$e,addAgent:Q$e,approval:G$e,common:H$e,conversation:W$e,credentials:Y$e,default:n9e,dialogs:q$e,errors:j$e,feedback:X$e,greetings:K$e,loading:Z$e,oauth:J$e,providers:e9e,sandbox:t9e,titles:r9e},Symbol.toStringTag,{value:"Module"})),i9e="自动化",a9e="连接研发工具,为智能体扩展自动化工作流",s9e="搜索自动化",o9e="自动化分类",l9e={development:"研发",channels:"消息渠道"},c9e="{{category}}自动化列表",u9e="打开{{name}}",h9e="仅本地部署可用",d9e="没有匹配的自动化",f9e="请尝试搜索其他名称",p9e="返回自动化列表",g9e={"coding-agents":{name:"配置 Coding Agents",badge:"本地",description:"将 VeADK 和 AgentKit 内置 Skills 全局配置到 Trae、Claude Code 或 Codex。"},template:{name:"模板项目导入",description:"在您的仓库中创建一个可持续交付到 AgentKit Runtime 的最简智能体",title:"模板项目导入",subtitle:"把可直接启动 Studio 的 basic Agent 和持续交付配置加入仓库",panel:"提交后将创建一个 PR,同时导入 basic 项目和 AgentKit Runtime 发布工作流。",submitLabel:"导入模板并提交 PR",regionHelp:"必须与目标 Runtime 所在地域一致",pullRequest:{title:"feat: 导入 AgentKit basic 模板",description:"导入带有 AgentKit Studio App Server 的 basic Agent 项目,并添加持续发布到 AgentKit Runtime 的工作流。合并前请配置 {{provider}} Secrets。"},fields:{repository:{label:"GitHub 仓库",placeholder:"owner/repository",help:"支持 owner/repository 或完整 github.com URL"},baseBranch:{label:"目标分支",placeholder:"main",help:"留空时使用 main,PR 将以此分支为 base"},projectPath:{label:"Agent 项目目录",placeholder:"agentkit-basic-agent",help:"将在此目录新增 basic 项目;app.py 挂载完整 Studio App Server,并作为服务入口启动"},runtimeName:{label:"Runtime 名称",placeholder:"support-agent",help:"用于 AgentKit 发布配置"},runtimeId:{label:"运行时 ID",placeholder:"rt-xxxxxxxx",help:"持续更新的目标 AgentKit Runtime"}}},delivery:{name:"AgentKit Runtime 持续交付",description:"为您的仓库添加持续交付到 AgentKit Runtime 的自动化工作流。",title:"AgentKit Runtime 持续交付",subtitle:"用 Pull Request 把持续发布配置安全地加入代码仓库",panel:"提交后将在目标仓库创建发布分支,并发起包含 GitHub Actions 工作流的 PR。",submitLabel:"确定并提交 PR",regionHelp:"必须与目标 Runtime 所在地域一致",pullRequest:{title:"feat: 持续发布到 AgentKit Runtime",description:"新增 GitHub Actions 工作流,在目标分支更新时持续发布到 AgentKit Runtime。合并前请配置工作流所需的 {{provider}} Secrets。"},fields:{repository:{label:"GitHub 仓库",placeholder:"owner/repository",help:"支持 owner/repository 或完整 github.com URL"},baseBranch:{label:"目标分支",placeholder:"main",help:"留空时使用 main,PR 将以此分支为 base"},projectPath:{label:"Agent 项目目录",placeholder:".",help:"留空时使用仓库根目录;目录内需包含挂载完整 Studio App Server 的 app.py"},runtimeName:{label:"Runtime 名称",placeholder:"support-agent",help:"用于 AgentKit 发布配置"},runtimeId:{label:"运行时 ID",placeholder:"rt-xxxxxxxx",help:"持续更新的目标 AgentKit Runtime"}}},review:{name:"PR 自动评审",description:"通过 GitHub App 在隔离 Sandbox 中评审 Pull Request。",title:"PR 自动评审",subtitle:"通过 GitHub App 触发 Sandbox 评审,并将结果发布到 Pull Request",panel:"请先将 GitHub App 安装到目标仓库,再为每个仓库启用自动评审。",submitLabel:"安装 GitHub App",regionHelp:"",pullRequest:{title:"chore: 配置 PR 自动评审",description:"新增 GitHub Actions 工作流,在隔离 Sandbox 中评审同仓库 PR,并将结果发布为 GitHub Review。合并前请配置工作流所需 Secrets。"},fields:{repository:{label:"GitHub 仓库",placeholder:"owner/repository",help:"支持 owner/repository 或完整 github.com URL"},baseBranch:{label:"目标分支",placeholder:"main",help:"留空时使用 main,PR 将以此分支为 base"},sandboxToolId:{label:"沙箱工具 ID",placeholder:"tool-xxxxxxxx",help:"用于运行每次评审的 AgentKit CodeEnv"},modelName:{label:"评审模型",placeholder:"review-model",help:"注入 Sandbox 的代码评审模型名称"},modelBaseUrl:{label:"模型 API 地址",placeholder:"https://ark.example.com/api/v3",help:"必须使用 OpenAI 兼容的 HTTPS 地址"}}},feishu:{name:"飞书机器人",badge:"Beta",description:"创建飞书机器人,并将消息直接接入 AgentKit Runtime。"},"website-integration":{name:"网站集成",description:"将 AgentKit Runtime 以悬浮聊天窗口嵌入网站。"}},m9e={required:"必填",optional:"可选",region:"地域",tokenLabel:"GitHub Token",getToken:"获取 Token",createToken:"创建 GitHub Token",tokenPlaceholder:"需要仓库 Contents 与 Pull requests 写权限",tokenWorkflowPlaceholder:"需要 Contents、Pull requests、Workflows 写权限",hideToken:"隐藏 Token",showToken:"显示 Token",tokenHelp:"Token 仅用于本次提交,不会保存在浏览器或写入 PR",tokenWorkflowHelp:"此处 Token 用于创建配置 PR;它不是 Sandbox 的通用必填项,且不会保存在浏览器或写入 PR",prCreated:"PR #{{number}} 已创建",configPrCreated:"配置 PR #{{number}} 已创建",configPrNextStep:"合并后,后续同仓库 PR 会自动触发评审。",viewOnGitHub:"在 GitHub 查看",viewConfigPr:"查看配置 PR",secretsHeading:"合并 PR 前,请在仓库的 GitHub Actions Secrets 中配置:",secretsConfigHeading:"合并配置 PR 前,请在目标仓库添加运行时密钥",openSecrets:"打开 Secrets 设置",secretsPath:"路径:Settings → Secrets and variables → Actions → Repository secrets",repositoryConfigHelp:"将为 {{repository}} 添加 PR 自动评审配置",repositoryReviewHelp:"将使用 GitHub App 校验 {{repository}} 的 Pull Request",secretPair:"{{accessKey}}、{{secretKey}}(必填)",sessionToken:"{{sessionToken}}(使用临时凭据时必填)",requiredSecret:"{{name}}(必填)",temporaryCredentialRequired:"(使用临时凭据时必填)",requiredSuffix:"(必填)",submitting:"提交 PR 中…",validation:{required:"此项不能为空",repository:"请输入 owner/repository 或完整 GitHub 仓库 URL",baseBranch:"目标分支格式不正确",projectPath:"请输入仓库内的相对目录",runtimeId:"运行时 ID 格式不正确",sandboxToolId:"沙箱工具 ID 格式不正确",modelName:"模型名称格式不正确",modelBaseUrlSafe:"请输入不含凭据、查询参数或锚点的 HTTPS 地址",modelBaseUrl:"请输入有效的 HTTPS 地址",runtimeName:{required:"Runtime 名称为必填项",characters:"Runtime 名称只能包含英文字母、数字、下划线和连字符",length:"Runtime 名称长度须为 4-64 个字符"}}},v9e={title:"配置 Coding Agents",description:"把随 Studio 提供的 AgentKit Skills 全局安装到本地编码客户端。",retry:"重试",clients:{ariaLabel:"选择 Coding Agent",title:"本机客户端",detectAgain:"重新检测",detecting:"正在检测本机客户端…",detected:"已检测到客户端",available:"可用",unavailable:"未检测到"},skills:{ariaLabel:"选择内置 Skill",title:"内置 Skills",viewFiles:"查看文件",items:{"veadk-agent-development":{name:"VeADK Agent 开发",description:"使用 VeADK 开发和完善 Agent。"},"agentkit-cli":{name:"AgentKit CLI",description:"通过 AgentKit CLI 管理和部署 AgentKit 资源。"}}},global:{ariaLabel:"全局安装目录",title:"全局安装",description:"配置后可在本机其他项目中使用",empty:"选择客户端后显示对应安装目录。"},success:"已为 {{agentCount}} 个客户端配置 {{skillCount}} 个 Skill",selection:"已选择 {{agentCount}} 个客户端、{{skillCount}} 个 Skill",selectClient:"请先选择客户端",configuring:"正在配置…",configure:"配置",errors:{detect:"检测本机客户端失败",configure:"配置失败,请检查用户目录权限后重试"},preview:{description:"只读浏览随 Studio 提供的 Skill 文件",close:"关闭文件预览",loading:"正在读取文件…",error:"读取 Skill 文件失败",skillFiles:"{{name}} 文件",files:"文件",fileContent:"文件内容",notPreviewable:"此文件不是可预览的 UTF-8 文本。",noFiles:"没有可预览的文件。"}},y9e={title:"飞书机器人",description:"创建一个由 AgentKit Runtime 驱动的飞书智能体",panel:"填写已发布飞书应用的凭据,Studio 将生成 basic 智能体、创建独立 Runtime,并启用飞书消息长连接。",agentName:"智能体名称",agentNameHelp:"将作为新 Runtime 中的根智能体名称",region:"部署地域",regionHelp:"Runtime 与构建产物将创建在该地域",regions:{"cn-beijing":"北京","cn-shanghai":"上海"},appId:"飞书 App ID",appIdHelp:"来自飞书开放平台的应用凭证",appSecret:"飞书 App Secret",appSecretPlaceholder:"请输入 App Secret",appSecretHelp:"仅写入新 Runtime 的环境变量",hideSecret:"隐藏 App Secret",showSecret:"显示 App Secret",hide:"隐藏",show:"显示",confirmCancel:"取消部署将停止任务并清理已创建的 Runtime,确定继续吗?",status:{preparing:"正在生成 basic 智能体",running:"正在创建 Runtime",cancelling:"正在取消部署",succeeded:"飞书机器人 Runtime 已创建",cancelled:"部署已取消",failed:"创建失败"},steps:{prepare:"生成智能体",build:"构建镜像",deploy:"创建 Runtime",publish:"发布服务"},openConsole:"打开 Runtime 控制台",credentials:{title:"凭据处理",description:"App Secret 仅用于本次部署,不会写入生成源码或浏览器存储。"},cancelDeployment:"取消部署",creating:"正在创建…",create:"创建飞书机器人 Runtime",validation:{appId:"请输入飞书 App ID",appSecret:"请输入飞书 App Secret",agentName:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"}},generatedAgent:{description:"一个通过飞书接收消息并提供帮助的智能助手。",instruction:"你是一个通过飞书为用户提供帮助的智能助手。准确理解用户问题,给出简洁、可靠的回答;信息不足时先提问澄清,不要臆造事实。"}},nrr=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:p9e,cards:g9e,categories:l9e,categoriesLabel:o9e,codingAgents:v9e,default:{title:i9e,description:a9e,search:s9e,categoriesLabel:o9e,categories:l9e,resultsLabel:c9e,open:u9e,localOnly:h9e,emptyTitle:d9e,emptyDescription:f9e,backToAutomations:p9e,cards:g9e,github:m9e,codingAgents:v9e,feishu:y9e},description:a9e,emptyDescription:f9e,emptyTitle:d9e,feishu:y9e,github:m9e,localOnly:h9e,open:u9e,resultsLabel:c9e,search:s9e,title:i9e},Symbol.toStringTag,{value:"Module"})),b9e={"zh-CN":"简体中文","en-US":"English"},irr=Object.freeze(Object.defineProperty({__proto__:null,default:{languageNames:b9e},languageNames:b9e},Symbol.toStringTag,{value:"Module"})),x9e={selectedExcerptLabel:"选中片段",commentLabel:"批注",commentSeparator:":",successTitle:"已加入 Bad case 评测集",successDescription:"这条批注已关联当前问题和完整模型回复。",done:"完成",ariaLabel:"批注选中的模型回复",title:"添加批注",content:"批注内容",placeholder:"说明问题或期望的修改方式",retryError:"{{error}},请重试。",cancel:"取消",submit:"加入 Bad Case"},w9e={attachment:"附件",image:"图片",preview:"预览 {{name}}",uploading:"上传中",uploadFailed:"上传失败",remove:"移除 {{name}}",previewDialog:"{{name}}预览",download:"下载",close:"关闭",reading:"正在读取文档…",loadFailed:"文档加载失败:{{error}}"},A9e={errorTitle:"云端日志错误",copyError:"复制完整错误信息",retry:"重试",statuses:{live:"实时",connecting:"连接中",retrying:"重连中",idle:"未连接"},title:"实例日志",description:"当前对话请求所在的 VeFaaS 实例",close:"关闭实例日志",instanceId:"实例 ID",waitingInstance:"等待实例",request:"请求 {{id}}",ariaLabel:"VeFaaS 实例实时日志",notCapturedTitle:"尚未捕获到实例",notCapturedDescription:"发送一条消息后,这里会显示实际处理请求的实例和实时日志。",connectingTitle:"正在连接实例日志",connectingDescription:"正在通过 Studio BFF 建立安全日志流。",emptyTitle:"暂无日志",emptyDescription:"已连接实例,等待新的日志输出。",retention:"日志自动刷新,仅保留最近 {{count}} 行"},T9e={title:"调用链路观测",statuses:{loading:"加载中",ready:"",collecting:"采集中",disabled:"未开启",forbidden:"权限不足",error:"加载失败"},errors:{collecting:"调用链路仍在采集中,请稍候。",disabled:"该 Agent 未开启链路观测,请到控制台开启后重试。",forbidden:"当前账号无权读取 APMPlus 调用链路,请联系管理员补充只读权限。",error:"调用链路加载失败,请稍后重试。"},callCount:"{{count}} 个调用 · {{duration}} ms",close:"关闭",loading:"加载调用链路…",retryNow:"立即重试",reload:"重新加载",empty:"该会话暂无调用链路(可能尚未产生调用)。",attributes:"属性",selectCall:"选择左侧的一个调用查看详情"},S9e={exportNote:"上述会话由 AgentKit Studio 导出,仅供参考",imageFailed:"图片生成失败,请重试。",browserUnsupported:"浏览器无法生成会话图片,请重试。",copyUnsupported:"当前浏览器不支持复制图片,请下载后使用。",exportFailed:"导出失败,请重试。",title:"导出会话",description:"选择格式并下载截至当前回复的全部输入与输出。",close:"关闭",generatingContent:"正在生成导出内容…",retry:"重试生成",previewPage:"预览第 1 页,共 {{count}} 页",previewAlt:"会话导出内容第 1 页,共 {{count}} 页",format:"导出格式",generatingFormat:"正在生成 {{format}}…",copying:"正在复制…",copiedFirst:"已复制第一页",copied:"已复制",copyFirst:"复制第一页",copyImage:"复制图片",generating:"正在生成…",downloadArchive:"下载 PNG 压缩包({{count}} 页)",downloadFormat:"下载 {{format}}"},C9e={unsupportedComponent:"不支持的组件:{{component}}",sandboxIdentity:"Codex Sandbox 执行标识",useSkill:"使用 {{name}} 技能",thinkingDone:"已完成思考",thinking:"思考中",justNow:"刚刚",sourceUnavailable:"暂时无法读取生成的源码,请稍后重试。",downloadStarted:"已开始下载",verifiedDelivery:"已验证交付物",generatedSource:"生成的 Agent 源码",entryPoint:"入口",fileCount:"文件数",size:"大小",validationTime:"验证时间",generationTime:"生成时间",checksPassed:"{{count}} 项检查通过",sourceReady:"源码已准备好,可部署",sourceGuidance:"源码已准备好,可查看、下载或部署;部署前请确认 Runtime 配置。",viewSource:"查看源码",preparing:"正在准备…",viewChanges:"查看本次变更",downloadSource:"下载源码",sourceNotReady:"源码尚未准备好",manualDeploy:"手动部署到 Runtime",beforeOptimization:"优化前",afterOptimization:"优化后",planStatuses:{pending:"待处理",in_progress:"进行中",completed:"已完成",failed:"未完成"},renderUi:"渲染 UI",truncated:"…(已截断)",agentAdjusting:"Agent 正在调整",sandboxDetails:"Codex Sandbox 详细输出",waitingCodex:"正在等待 Codex 输出",arguments:"参数",result:"返回",artifacts:"产物",downloadNamed:"下载 {{name}}",powerpoint:"PowerPoint 演示文稿",preview:"预览",download:"下载",previewDialog:"{{name}} 预览",closePreview:"关闭预览",slidePreview:"{{name}} 幻灯片预览",mcpToolset:"MCP 工具集",authorized:"已授权 · {{tool}}",authorizationRequired:"{{tool}} 需要授权",oauthDescription:"工具集 {{tool}} 使用 OAuth 保护,需登录授权后方可调用。",oauthProvider:"将跳转至 {{provider}} 完成登录。",oauthContinue:"授权完成后对话自动继续。",waitingAuthorization:"等待授权…",authorize:"去授权",missingAuthorizationUrl:"未在事件中找到授权地址。",tools:{web_search:{running:"正在进行网络搜索",done:"已完成网络搜索"},link_reader:{running:"正在读取网页",done:"已完成网页读取"},run_code:{running:"正在 AgentKit 沙箱中执行代码",done:"已在 AgentKit 沙箱中完成代码执行"},list_envs:{running:"正在查看可用环境",done:"已读取可用环境"},get_env_manifest:{running:"正在读取环境 Manifest",done:"已读取环境 Manifest"},execute_in_sandbox:{running:"正在环境中执行命令",done:"已在环境中完成命令执行"},delegate_to_codex_sandbox:{running:"Codex Sandbox 正在执行",done:"Codex Sandbox 已完成",failed:"Codex Sandbox 执行失败"},image_generate:{running:"正在生成图片",done:"已完成图片生成"},video_generate:{running:"正在生成视频",done:"已完成视频生成"},ppt_generate:{running:"正在生成 PPT",done:"已完成 PPT 生成"},load_memory:{running:"正在检索长期记忆",done:"已完成记忆检索"},load_knowledgebase:{running:"正在检索知识库",done:"已完成知识库检索"},load_skill:{running:"正在加载技能",done:"已加载技能"},collect_resources:{running:"正在收集可用资源",done:"已完成资源收集",failed:"资源收集失败"},create_agents:{running:"正在创建并运行 Agent",done:"已完成 Agent 创建",failed:"Agent 创建失败"}},createAgents:{categories:{skill_hub:"Skill Hub",skill_space:"AgentKit 技能中心",knowledge_base:"知识库",tool:"工具"},agentTypes:{llm:"LLM 智能体",sequential:"顺序智能体",parallel:"并行智能体",loop:"循环智能体",workflow:"工作流"},skill:"技能",subAgents:"子智能体",builtinTool:"内置工具",skillCenter:"AgentKit 技能中心",selfAuthoredTools:"自写工具",dependencies:"依赖:{{items}}",fullCode:"{{name}} 完整代码",itemCount:"{{label}} {{count}} 项",collectionAria:"召回资源信息",retrieving:"正在检索资源",retrievalFailed:"资源检索未完成",checkConfig:"请检查资源服务配置后重试。",notSearched:"未检索",notConfigured:"未配置",resourceList:"{{label}}资源列表",searchKeywords:"检索关键词",skillHubSkipped:"未提供检索关键词,本次未检索 Skill Hub。",sourceSkipped:"未配置 {{label}},本次未检索该来源。",noResources:"本次检索未返回该类别的资源。",resultAria:"创建 Agent 结果",creationFailed:"Agent 创建未完成",agentResources:"{{name}} 具备的资源",knowledgeBase:"知识库",toolsLabel:"工具",creating:"正在创建 Agent",noAgents:"没有可展示的 Agent",noAgentResult:"工具返回中未包含 Agent 配置或执行结果。",sourceLabels:{tool:"工具",knowledge:"AgentKit 知识库",skillCenter:"AgentKit 技能中心",unknown:"未知来源"},unnamedResource:"未命名资源",unnamedAgent:"未命名 Agent"},branchCompare:{ariaLabel:"分支对比",selectDirection:"选择方向",continue:"继续这个方向"},codexProgress:{planTitle:"Codex 执行计划",fallback:{fileChange:"修改文件",approval:"等待操作批准",status:"Codex 状态",command:"运行命令"},planSummary:"已完成 {{completed}}/{{total}} 项",command:{running:"正在执行命令",completed:"命令执行完成",failed:"命令执行失败"},projectFiles:"{{count}} 个项目文件",projectFile:"项目文件",fileChange:{running:"正在更新{{subject}}",completed:"已更新{{subject}}",failed:"更新{{subject}}失败"},externalTool:"外部工具",mcp:{running:"正在调用工具 {{tool}}",completed:"已调用工具 {{tool}}",failed:"工具 {{tool}} 调用未完成"},collaboration:{spawn_agent:{running:"正在启动子任务",completed:"子任务已启动",failed:"子任务启动失败"},send_input:{running:"正在向子任务发送信息",completed:"已向子任务发送信息",failed:"向子任务发送信息失败"},wait:{running:"正在等待子任务",completed:"子任务等待已结束",failed:"等待子任务失败"},close_agent:{running:"正在结束子任务",completed:"子任务已结束",failed:"子任务结束失败"},default:{running:"正在协调子任务",completed:"子任务协作已完成",failed:"子任务协作失败"}},webSearch:{running:"正在进行网络搜索",completed:"已完成网络搜索",failed:"网络搜索未完成"},errorDetail:"Codex 执行未完成。",errorTitle:"Codex 执行遇到错误"}},O9e={segments:{system:"系统与工具",input:"输入与历史",output:"输出与思考",remaining:"剩余"},modelUnavailable:"模型信息未提供",promptWithSystem:"提示词(含系统)",systemUnknown:"系统与工具占用未知",systemApprox:"系统与工具约 {{count}} Token",ariaKnown:"上下文已使用 {{percentage}}%,{{system}},{{inputLabel}} {{input}} Token,输出与思考 {{output}} Token,剩余 {{remaining}} Token",ariaUnknown:"{{model}},上下文窗口未知,会话累计使用 {{count}} Token",composition:"上下文构成",percentageUsed:"{{percentage}}% 已用",gridAria:"100 格上下文构成图,每格代表上下文窗口的百分之一",estimated:"估算",unknown:"未知",summaryPercentage:"{{used}} 已用,剩余 {{remaining}}",summaryTokens:"{{used}} 已用,剩余 {{remaining}},总计 {{total}}",overflow:"已超出上下文 {{count}} Token",title:"上下文用量",unknownModel:"暂未收录该模型的上下文窗口",unknownRuntime:"当前 Runtime 未提供模型信息"},k9e={title:"添加 AgentKit 智能体",noAgents:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",connectionFailed:"连接失败:{{error}}。请检查 URL、API Key,以及该网关是否允许跨域。",description:"填入 AgentKit 部署的访问地址与 API Key,将通过 ADK 协议连接,连接成功后其 Agent 会出现在左上角的下拉中。",url:"访问地址 URL",apiKeyHint:"以 Authorization: Bearer 方式连接",displayName:"显示名称(可选)",displayNameHint:"默认取 URL 的主机名",cancel:"取消",connecting:"连接中…",connect:"连接并添加"},E9e={placeholder:"输入消息…",inputAria:"输入消息",generating:"正在生成",send:"发送"},_9e={ariaLabel:"本轮调用上下文",removeSkill:"移除技能 {{name}}",removeAgent:"移除 Agent {{name}}"},R9e={cardAria:"{{label}} 图表",viewAria:"{{label}} 显示方式",preview:"预览",code:"代码",invalidEcharts:"ECharts 配置不是有效且安全的数据对象,请切换到代码检查内容。",renderFailed:"图表暂时无法渲染,请切换到代码检查内容。",echartsAria:"ECharts 图表预览",rendering:"正在渲染图表…",mermaidFailed:"图表暂时无法渲染,请切换到代码查看 Mermaid 内容。",mermaidAria:"Mermaid 图表预览"},D9e={playVideo:"点击播放视频:{{name}}",enlargeImage:"放大预览:{{name}}",image:"图片",enlargeVideo:"点击放大视频",videoPreview:"视频预览",downloadVideo:"下载视频",close:"关闭"},L9e={annotation:x9e,media:w9e,runtimeLogs:A9e,trace:T9e,share:S9e,blocks:C9e,tokenUsage:O9e,addAgentKit:k9e,composer:E9e,invocation:_9e,visualization:R9e,markdown:D9e},arr=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:k9e,annotation:x9e,blocks:C9e,composer:E9e,default:L9e,invocation:_9e,markdown:D9e,media:w9e,runtimeLogs:A9e,share:S9e,tokenUsage:O9e,trace:T9e,visualization:R9e},Symbol.toStringTag,{value:"Module"})),M9e={back:"返回",cancel:"取消",deploy:"部署",delete:"删除",loading:"读取中…",next:"下一步",notSupported:"暂不支持",previous:"上一步",required:"必填",retry:"重试",actions:"操作",value:"值",disabled:"关闭",enabled:"已开启",none:"无",close:"关闭",name:"名称",description:"描述",send:"发送"},I9e={heading:"VeADK Agent 结构配置",importHint:"可在「创建 Agent」页通过「导入 YAML」重新载入。"},P9e={agentName:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},runtimeName:{required:"Runtime 名称为必填项",characters:"Runtime 名称只能包含英文字母、数字、下划线和连字符",length:"Runtime 名称长度须为 4-64 个字符"}},N9e={description:"一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",instruction:`你是一个专业、可靠的智能助手。 +{{response}}`,loadArkApiKeysFailed:"加载 Ark API Key 失败",loadModelsFailed:"加载模型列表失败",runtimeAccessDenied:"当前账号无权访问该 Runtime,请刷新列表或重新登录后重试。",privateRuntimeUnavailable:"Runtime 已部署成功,但当前 Studio 无法访问私网 Runtime。请使用已绑定相同 VPC 的 Studio 访问,或改用公网 / 公网+VPC 部署。",runtimeTemporarilyUnavailable:"Runtime 已部署成功,但 Studio 暂时无法连接服务。网关域名可能仍在生效,或当前网络/DNS 无法访问该 Runtime,请稍后在智能体管理页重试连接。",runtimeConnectionUnsupported:"该 Runtime 的 Agent Server 未提供连接接口,请确认 Runtime 已就绪且版本兼容。",runtimeConnectionDenied:"Runtime 服务拒绝了连接请求,请检查 Runtime 的鉴权配置。",listAgentsFailed:"读取 Agent 列表失败",invalidListAppsJson:"Runtime /list-apps 返回了无法解析的 JSON 响应。",invalidListAppsFormat:"Runtime /list-apps 返回格式无效,应为非空字符串数组。",createSessionFailedWithStatus:"创建会话失败 ({{status}})",createSessionFailed:"创建会话失败",getSessionFailed:"读取会话失败",getSessionFailedWithDetail:"读取会话失败:{{status}}:{{detail}}",feedbackRuntimeOnly:"只有连接到 AgentKit Runtime 的会话支持反馈回流",feedbackRegionMissing:"Runtime 缺少地域信息,无法提交反馈",submitFeedbackFailed:"提交反馈失败",loadEvaluationSetsFailed:"读取评测集失败",loadAutoEvaluationStatusFailed:"读取自动评测状态失败",loadOptimizationsFailed:"读取优化项失败",deleteEvaluationCaseFailed:"删除评测案例失败",downloadFileFailed:"下载文件失败",fileUnavailable:"文件内容不可用",uploadFileFailed:"文件上传失败",traceDisabled:"该 Agent 暂未开启链路观测,请到控制台打开后使用。",loadTraceFailed:"加载调用链路失败",contentTypeMissing:"Content-Type 缺失",traceNonJson:"加载调用链路失败:服务端返回了非 JSON 响应({{contentType}}),请检查 Studio API 代理配置",invalidTraceFormat:"加载调用链路失败:返回格式无效",submitIssueFeedbackFailed:"问题反馈上报失败",issueFeedbackNotConfirmed:"问题反馈上报失败:服务端未确认提交结果",noPreviewableAgent:"该 Runtime 未提供可预览的 Agent。",agentSearchFailed:"Agent 检索失败",emptySseBody:"HTTP 200,SSE 响应体为空。",noDisplayableSseReply:"HTTP 200,SSE 响应中没有可展示的模型回复。",firstSseEventTimeout:"30 秒内未收到首个 SSE 事件。",runSessionFailed:"运行会话失败",runSseFailedWithDetail:"运行会话失败:{{status}}:{{detail}}",checkRuntimeNameFailed:"检查 Runtime 名称失败",invalidRuntimeNameCheck:"检查 Runtime 名称失败:服务返回格式错误",loadCloudResourcesFailed:"加载云资源失败",invalidCloudResources:"云资源列表响应格式无效",invalidEnvironmentMount:"挂载环境响应格式无效",environmentMountMismatch:"挂载环境响应与请求不一致",environmentMountNetworkFailed:"无法连接 Studio 服务,环境挂载未完成。请检查网络后重试。",environmentMountFailed:"挂载环境失败",clipboardUnsupported:"当前浏览器不支持写入剪贴板。",clipboardWriteFailed:"无法写入剪贴板,请检查剪贴板权限。",loadSystemInfoFailed:"加载系统信息失败",invalidSystemInfo:"系统信息响应格式无效",invalidEnvironmentBuild:"环境构建响应格式无效",invalidEnvironmentBuildStep:"环境构建步骤响应格式无效",invalidEnvironmentManifest:"环境 Manifest 响应格式无效",invalidImageRepository:"环境镜像仓库响应格式无效",invalidCodeRepository:"环境代码仓库响应格式无效",invalidImageSource:"环境镜像来源响应格式无效",invalidEnvironment:"环境响应格式无效",invalidWorkspace:"工作区响应格式无效",loadWorkspacesFailed:"加载工作区失败",invalidWorkspaceList:"工作区列表响应格式无效",saveWorkspaceFailed:"保存工作区失败",deleteWorkspaceFailed:"删除工作区失败",loadEnvironmentsFailed:"加载环境失败",invalidEnvironmentList:"环境列表响应格式无效",probeRepositoryFailed:"探查代码仓库失败",invalidRepositoryProbe:"代码仓库探查响应格式无效",exportEnvironmentCodeFailed:"导出环境分享码失败",invalidEnvironmentCode:"环境分享码响应格式无效",inspectEnvironmentCodeFailed:"检测环境分享码失败",invalidEnvironmentCodeInspection:"环境分享码检测响应格式无效",importEnvironmentCodeFailed:"导入环境分享码失败",invalidEnvironmentCodeImport:"环境分享码导入响应格式无效",studioUnavailable:"无法连接 Studio 服务,请确认后端已启动后重试。",saveEnvironmentFailed:"保存环境失败",deleteEnvironmentFailed:"删除环境失败",startEnvironmentBuildFailed:"启动环境构建失败",loadEnvironmentBuildFailed:"读取环境构建详情失败",loadEnvironmentManifestFailed:"读取环境 Manifest 失败",invalidEnvironmentResource:"环境资源响应格式无效",loadEnvironmentResourcesFailed:"加载环境构建资源失败",updateCodexSandboxFailed:"更新 Codex Sandbox 失败",invalidCodexSandboxUpdate:"Codex Sandbox 更新响应格式无效",loadUserPoolsFailed:"加载用户池失败",invalidUserPoolList:"用户池列表响应格式无效",syncGithubFailed:"同步 GitHub 代码失败 ({{status}})",validatingMigrationArtifact:"正在校验迁移产物",uploadingCodePackage:"正在上传代码包",migrationArtifactValidated:"迁移产物校验完成",codePackageUploaded:"代码包上传完成",deploymentProgress:{preparing:"正在准备部署",uploading:"正在上传代码包",building:"正在构建镜像",buildLogsSyncing:"正在构建镜像,构建日志已同步。",buildLogsComplete:"构建日志同步完成。",buildFailedLogsSynced:"镜像构建失败,最终构建日志已同步。",buildLogsUnavailable:"暂时无法读取构建日志。",finalBuildLogsUnavailable:"暂时无法读取最终构建日志。",deploying:"正在部署服务",publishing:"正在发布服务",evaluating:"正在创建评测集",updating:"正在更新 Runtime 配置",completing:"正在完成部署",github:"正在配置 GitHub 持续交付",inProgress:"正在部署"},deploymentFailed:"部署失败",deploymentDisconnected:"部署失败:连接中断",deploymentMissingAgentName:"部署失败:返回缺少 Agent 名称",deploymentMissingConnection:"部署失败:返回缺少 AgentKit 连接信息",cancelDeploymentFailed:"取消部署失败 ({{status}})",loadFailed:"加载失败 ({{status}})",loadPermissionsFailed:"加载权限失败 ({{status}})",invalidPermissionResponse:"权限服务返回了无法解析的响应",checkStudioUpdateFailed:"检查 Studio 更新失败 ({{status}})",studioUpdatePreflightFailed:"Studio 更新权限预检失败 ({{status}})",submitStudioUpdateFailed:"提交 Studio 更新失败 ({{status}})",loadAgentUsageFailed:"加载 Agent 用量失败",notProvided:"未提供",agentUsageNonJson:"加载 Agent 用量失败:服务端返回非 JSON 响应(HTTP {{status}},Content-Type: {{contentType}})。",checkStudioGateway:"请确认当前服务以 Studio 模式启动,并检查代理或网关配置。",agentUsageInvalidJson:"加载 Agent 用量失败:服务端返回了无法解析的 JSON(HTTP {{status}},Content-Type: {{contentType}})。",retryCheckGateway:"请稍后重试;若问题持续,请检查代理或网关配置。",loadCronJobsFailed:"加载定时任务失败",loadCronJobFailed:"加载定时任务详情失败",createCronJobFailed:"创建定时任务失败",updateCronJobFailed:"更新定时任务失败",enableCronJobFailed:"启用定时任务失败",pauseCronJobFailed:"暂停定时任务失败",runCronJobFailed:"立即执行定时任务失败",loadCronHistoryFailed:"加载执行历史失败",stopCronRunFailed:"终止执行失败",deleteCronJobFailed:"删除定时任务失败",loadRuntimeFailed:"加载 Runtime 失败",loadLocalToolsFailed:"读取本地工具失败",connectDynamicRouteFailed:"连接 Studio 动态路由失败",a2aProbeDenied:"Runtime 服务拒绝了 A2A 探测请求,请检查 Runtime 的鉴权配置。",loadA2aCardFailed:"读取 A2A Agent Card 失败",loadRuntimeApiKeyFailed:"读取 Runtime API Key 失败",runtimeApiKeyMissing:"Runtime 未返回可用的 API Key",deleteFailed:"删除失败 ({{status}})",runtimeManageForbidden:"当前账号没有管理该 Runtime 的权限。",runtimeNotFound:"该 Runtime 不存在或已被删除。",runtimeUnavailable:"当前账号无法访问该 Runtime。",checkRuntimeUpdateFailed:"检查 Runtime 更新能力失败(HTTP {{status}}),请稍后重试。",loadRuntimeDetailFailed:"加载 Runtime 详情失败",generateProjectFailed:"生成项目失败",generateAgentConfigFailed:"生成 Agent 配置失败",createDebugRunFailed:"创建调试运行失败",createDebugSessionFailed:"创建调试会话失败",loadDebugTraceFailed:"加载调试调用链路失败",invalidDebugTrace:"加载调试调用链路失败:返回格式无效",debugRunFailed:"调试运行失败",cleanupDebugRunFailed:"清理调试运行失败"},F$e={loadFailed:"读取会话模式能力失败(HTTP {{status}})",invalidResponse:"会话模式能力响应格式错误"},z$e={nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},{{contentType}}){{detail}}"},U$e={common:b$e,agentkitCli:x$e,cloudRegion:w$e,connections:A$e,feishuBot:S$e,requestError:T$e,runSse:C$e,runtimeLogs:O$e,search:k$e,skills:E$e,sse:_$e,identity:R$e,github:D$e,video:L$e,websiteIntegration:M$e,knowledge:I$e,intelligentDevelopment:P$e,migrations:N$e,sandbox:B$e,client:$$e,newChatCapabilities:F$e,jsonResponse:z$e},trr=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:x$e,client:$$e,cloudRegion:w$e,common:b$e,connections:A$e,default:U$e,feishuBot:S$e,github:D$e,identity:R$e,intelligentDevelopment:P$e,jsonResponse:z$e,knowledge:I$e,migrations:N$e,newChatCapabilities:F$e,requestError:T$e,runSse:C$e,runtimeLogs:O$e,sandbox:B$e,search:k$e,skills:E$e,sse:_$e,video:L$e,websiteIntegration:M$e},Symbol.toStringTag,{value:"Module"})),V$e={backToEvaluationCase:"返回评测案例",cancel:"取消",copied:"已复制",copy:"复制",exportConversation:"导出会话",retry:"重试"},Q$e={title:"您想以哪种方式添加 Agent 来运行?",subtitle:"选择最适合你的方式,下一步即可开始",quickCreate:{title:"从 0 快速创建",description:"用智能、自定义、模板或工作流的方式从零创建一个 Agent。"},intelligent:{title:"智能模式",description:"描述目标,按你的意图构建、调试并验证 Agent。"},package:{title:"从代码包添加和部署",description:"上传 Agent 项目压缩包,查看代码并直接部署到 AgentKit Runtime。"},migrate:{title:"从存量迁移",description:"从您的 LangChain、Dify 等存量项目迁移至 AgentKit Runtime。"}},G$e={subject:{file:"文件修改",command:"命令执行"},decision:{accept:"已允许本次{{subject}}",acceptForSession:"已在本会话中允许{{subject}}",decline:"已拒绝{{subject}}",cancel:"已取消{{subject}}审批"},details:{command:"命令",grantRoot:"授权路径",cwd:"执行目录"}},H$e={noDescription:"暂无描述",region:"地域",unknownAgent:"未知 Agent"},W$e={agentTransfer:"智能体移交",annotationHint:"模型回复;选中文字后可添加批注",continueBranch:"继续“{{branch}}”这个方向",emptyResponse:"本次没有返回可显示的内容。",subagentDescription:"正在执行主 Agent 移交的任务。"},Y$e={title:"需要配置 {{provider}} AK/SK",prefix:"智能体工作台需要 {{provider}} 凭据才能使用。请在运行环境中设置",and:"与",suffix:"后重试。"},q$e={buildRunning:{title:"当前构建仍在进行",description:"离开将停止本轮构建;当前会话仍会保留,可稍后从历史会话重新进入。",confirm:"停止并离开"},deleteThread:{title:"删除 Codex 历史会话",description:"将删除“{{name}}”,并从历史会话中移除。",confirm:"确认删除"},returnToCreate:{title:"返回创建首页?",description:"返回后当前填写的内容将会丢失,确定要返回吗?",confirm:"确定返回"}},j$e={additionalAgentDeleteFailures:";另有 {{count}} 个失败",agentDeleteFailures:"{{count}} 个 Agent 删除失败:{{failures}}{{suffix}}",agentToolsMissing:"当前 Agent 缺少任务工具:{{tools}}",buildStopUnconfirmed:"已离开开发环境,但未能确认本轮构建已停止。任务可能仍在运行,请稍后从历史会话检查状态。",builtinAgentSendFailed:"内置智能体发送失败:{{message}}",bytePlusEvaluationUnsupported:"BytePlus 暂不支持 AgentKit 评测集",clipboardUnsupported:"当前浏览器不支持写入剪贴板。",cloudCodexEmptyReply:"云端 Codex 已结束,但没有生成回复,请重新发送任务。",cloudCodexSessionMissing:"云端 Codex Session 暂未出现在列表中,请稍后重试。",deploymentRuntimeIdMissing:"部署完成,但未返回 Runtime ID。",environmentExpired:"所选环境已失效,请刷新后重新选择。",environmentsLoadFailed:"读取环境失败",evaluationCaseSessionMissing:"这条案例缺少会话定位信息,无法跳转。",evaluationUnsupportedForReply:"当前回复暂不支持加入评测集",firstFrameRequired:"首尾帧生成需要先添加首帧图片。",incompletePromptOptimization:"提示词优化结果不完整,请重新优化后再试。",intelligentCapabilityCheckFailed:"智能开发能力检查失败(HTTP {{status}})",intelligentSessionCreateFailed:"智能开发会话创建失败",invalidIntelligentCapability:"智能开发模型能力格式错误。",localBffToolsNotConfigured:"本地 Studio BFF 没有配置工具。",localToolsLoadFailed:"读取本地工具失败",loginPopupBlocked:"登录窗口被浏览器拦截,请允许弹出窗口后重试。",loginPopupClosed:"登录窗口已关闭,请重新登录以继续当前操作。",mediaTooLarge:"{{fileName}} 超出当前平台允许的素材大小。",mountEnvironmentFailed:"挂载环境失败",noConnectedSandbox:"当前没有已连接的 Sandbox。",noCreateAgentPermission:"当前账号没有添加 Agent 的权限。",noManageAgentPermission:"当前账号没有管理 Agent 的权限。",noOptimizationBaseline:"当前版本没有可对比的优化前版本。",oauthUrlMissing:"事件中没有授权地址。",onlyCloudAgentUpdatable:"仅支持更新已部署的云端智能体。",optimizationVersionMissing:"无法找到本次优化对应的项目版本,可能已被删除。",persistentStorageNotConfigured:"管理员未配置持久化存储",readDraftFailed:"无法读取本机草稿,请稍后重试。",runtimeAgentNameMissing:"Runtime 缺少智能体名称,无法更新。",runtimeBffToolsDisabled:"当前 Runtime Agent 未开启 BFF 工具能力。",runtimeDeploymentConfigUnavailable:"该 Runtime 的原发布配置不可恢复,无法安全更新。",runtimeMissingForConnection:"缺少 Runtime 信息,无法连接智能体。",runtimeRegionMissingForDelete:"Runtime 缺少地域信息,无法删除",runtimeRegionMissingForUpdate:"Runtime 缺少地域信息,无法更新。",runtimeUpdateUnsupported:"当前 Runtime 不支持原地更新。",sandboxRuntimeUnavailable:"当前 Agent 没有可用的 Sandbox Runtime。",sandboxToolsUnavailable:"当前 Studio BFF 未提供 Sandbox 执行工具。",saveDraftLocationRejected:"浏览器拒绝保存当前草稿位置,请检查站点存储权限后重试。",saveDraftRejected:"浏览器拒绝保存草稿,请稍后重试。",selectSkillToOptimize:"请先选择需要优化的 Skill。",sessionMissingForMount:"当前会话不存在,无法挂载环境。",sessionNotReady:"会话尚未就绪。",sessionUnavailable:"当前会话不可用,请关闭后重试。",sourceNotReady:"该源码尚未准备好,请返回对话继续处理。",textVideoRejectsReferences:"文生视频不使用参考素材,请先移除已添加的图片或视频。",videoEditRequiresVideo:"视频编辑需要先添加待编辑视频。",videoExtendRequiresVideo:"视频续写需要先添加基础视频。",videoGenerationFailed:"视频生成失败,请稍后重试。",videoModeUnsupported:"当前平台暂不支持所选视频任务模式。",videoPreviewMissing:"视频任务已完成,但服务端未返回预览地址。",videoReferenceRequired:"参考素材生视频需要至少添加一项参考图片或参考视频。"},X$e={like:"赞",removeLike:"取消点赞",dislike:"踩",removeDislike:"取消点踩",reportIssue:"问题反馈",traceFlameGraph:"Tracing 火焰图"},K$e={0:"今天想做点什么?",1:"有什么可以帮你的?",2:"需要我帮你查点什么吗?",3:"有问题尽管问我",4:"嗨,我们开始吧",5:"开始一段新对话吧",6:"今天想先解决哪件事?",7:"把你的想法告诉我吧",8:"我们从哪里开始?",9:"有什么任务交给我?",10:"准备好一起推进了吗?",11:"说说你现在最关心的问题",12:"今天也一起把事情做好",13:"我在,随时可以开始",intelligentDevelopment:"让灵感自由生长"},Z$e={agentCapabilities:"正在检查 Agent 能力…",session:"加载会话…"},J$e={cancelled:"授权已取消。",pasteCallbackUrl:"授权完成后,请粘贴回调页面(浏览器地址栏)的完整 URL:",popupBlocked:"弹窗被拦截,请允许弹窗后重试。",unsupportedUrl:"授权链接不是 http/https 地址,已阻止打开。"},e9e={volcengine:"火山引擎"},t9e={checkingPersistence:"正在检查持久化能力…",exitDevelopment:"退出开发环境",fileUploaded:"已上传文件到 Sandbox",filesUploaded:"已上传 {{count}} 个文件到 Sandbox",intelligentDevelopment:"智能开发",mode:{readOnly:"只读",workspaceWrite:"工作区写入",fullAccess:"完全访问"},approvalPolicy:{untrusted:"仅不可信命令",onRequest:"按需审批",never:"不审批"},reviewer:{user:"由我审批",autoReview:"自动审查"},labels:{approvalPolicy:"审批策略",file:"文件",fileNumber:"文件 {{number}}",mode:"沙箱模式",networkAccess:"网络访问",reviewer:"审批方式",workingDirectory:"工作目录"},network:{allowed:"允许",disabled:"关闭"},permissionsUpdated:"已更新当前 Sandbox Session 的 Codex 权限",persistenceUnknown:"暂时无法确认持久化能力",stoppedReady:"已停止,可继续输入",uploadedFilesPrompt:"以下文件已上传到当前 Sandbox 工作空间,请在任务中使用:",workspaceUpdated:"已更新工作空间"},r9e={addAgent:"添加智能体",addFromPackage:"从代码包添加",agent:"智能体",automations:"自动化",createAgent:"创建智能体",createSkill:"创建技能",cronJobs:"定时任务",issueFeedback:"问题反馈",library:"资源库",migrateAgent:"迁移智能体",newConversation:"新会话",optimizeSkill:"优化 {{name}}",search:"搜索",skill:"技能",skillLibrary:"技能库",systemInfo:"系统信息",updateAgent:"更新 {{name}}"},n9e={actions:V$e,addAgent:Q$e,approval:G$e,common:H$e,conversation:W$e,credentials:Y$e,dialogs:q$e,errors:j$e,feedback:X$e,greetings:K$e,loading:Z$e,oauth:J$e,providers:e9e,sandbox:t9e,titles:r9e},rrr=Object.freeze(Object.defineProperty({__proto__:null,actions:V$e,addAgent:Q$e,approval:G$e,common:H$e,conversation:W$e,credentials:Y$e,default:n9e,dialogs:q$e,errors:j$e,feedback:X$e,greetings:K$e,loading:Z$e,oauth:J$e,providers:e9e,sandbox:t9e,titles:r9e},Symbol.toStringTag,{value:"Module"})),i9e="自动化",a9e="连接研发工具,为智能体扩展自动化工作流",s9e="搜索自动化",o9e="自动化分类",l9e={development:"研发",channels:"消息渠道"},c9e="{{category}}自动化列表",u9e="打开{{name}}",h9e="仅本地部署可用",d9e="没有匹配的自动化",f9e="请尝试搜索其他名称",p9e="返回自动化列表",g9e={"coding-agents":{name:"配置 Coding Agents",badge:"本地",description:"将 VeADK 和 AgentKit 内置 Skills 全局配置到 Trae、Claude Code 或 Codex。"},template:{name:"模板项目导入",description:"在您的仓库中创建一个可持续交付到 AgentKit Runtime 的最简智能体",title:"模板项目导入",subtitle:"把可直接启动 Studio 的 basic Agent 和持续交付配置加入仓库",panel:"提交后将创建一个 PR,同时导入 basic 项目和 AgentKit Runtime 发布工作流。",submitLabel:"导入模板并提交 PR",regionHelp:"必须与目标 Runtime 所在地域一致",pullRequest:{title:"feat: 导入 AgentKit basic 模板",description:"导入带有 AgentKit Studio App Server 的 basic Agent 项目,并添加持续发布到 AgentKit Runtime 的工作流。合并前请配置 {{provider}} Secrets。"},fields:{repository:{label:"GitHub 仓库",placeholder:"owner/repository",help:"支持 owner/repository 或完整 github.com URL"},baseBranch:{label:"目标分支",placeholder:"main",help:"留空时使用 main,PR 将以此分支为 base"},projectPath:{label:"Agent 项目目录",placeholder:"agentkit-basic-agent",help:"将在此目录新增 basic 项目;app.py 挂载完整 Studio App Server,并作为服务入口启动"},runtimeName:{label:"Runtime 名称",placeholder:"support-agent",help:"用于 AgentKit 发布配置"},runtimeId:{label:"运行时 ID",placeholder:"rt-xxxxxxxx",help:"持续更新的目标 AgentKit Runtime"}}},delivery:{name:"AgentKit Runtime 持续交付",description:"为您的仓库添加持续交付到 AgentKit Runtime 的自动化工作流。",title:"AgentKit Runtime 持续交付",subtitle:"用 Pull Request 把持续发布配置安全地加入代码仓库",panel:"提交后将在目标仓库创建发布分支,并发起包含 GitHub Actions 工作流的 PR。",submitLabel:"确定并提交 PR",regionHelp:"必须与目标 Runtime 所在地域一致",pullRequest:{title:"feat: 持续发布到 AgentKit Runtime",description:"新增 GitHub Actions 工作流,在目标分支更新时持续发布到 AgentKit Runtime。合并前请配置工作流所需的 {{provider}} Secrets。"},fields:{repository:{label:"GitHub 仓库",placeholder:"owner/repository",help:"支持 owner/repository 或完整 github.com URL"},baseBranch:{label:"目标分支",placeholder:"main",help:"留空时使用 main,PR 将以此分支为 base"},projectPath:{label:"Agent 项目目录",placeholder:".",help:"留空时使用仓库根目录;目录内需包含挂载完整 Studio App Server 的 app.py"},runtimeName:{label:"Runtime 名称",placeholder:"support-agent",help:"用于 AgentKit 发布配置"},runtimeId:{label:"运行时 ID",placeholder:"rt-xxxxxxxx",help:"持续更新的目标 AgentKit Runtime"}}},review:{name:"PR 自动评审",description:"通过 GitHub App 在隔离 Sandbox 中评审 Pull Request。",title:"PR 自动评审",subtitle:"通过 GitHub App 触发 Sandbox 评审,并将结果发布到 Pull Request",panel:"请先将 GitHub App 安装到目标仓库,再为每个仓库启用自动评审。",submitLabel:"安装 GitHub App",regionHelp:"",pullRequest:{title:"chore: 配置 PR 自动评审",description:"新增 GitHub Actions 工作流,在隔离 Sandbox 中评审同仓库 PR,并将结果发布为 GitHub Review。合并前请配置工作流所需 Secrets。"},fields:{repository:{label:"GitHub 仓库",placeholder:"owner/repository",help:"支持 owner/repository 或完整 github.com URL"},baseBranch:{label:"目标分支",placeholder:"main",help:"留空时使用 main,PR 将以此分支为 base"},sandboxToolId:{label:"沙箱工具 ID",placeholder:"tool-xxxxxxxx",help:"用于运行每次评审的 AgentKit CodeEnv"},modelName:{label:"评审模型",placeholder:"review-model",help:"注入 Sandbox 的代码评审模型名称"},modelBaseUrl:{label:"模型 API 地址",placeholder:"https://ark.example.com/api/v3",help:"必须使用 OpenAI 兼容的 HTTPS 地址"}}},feishu:{name:"飞书机器人",badge:"Beta",description:"创建飞书机器人,并将消息直接接入 AgentKit Runtime。"},"website-integration":{name:"网站集成",description:"将 AgentKit Runtime 以悬浮聊天窗口嵌入网站。"}},m9e={required:"必填",optional:"可选",region:"地域",tokenLabel:"GitHub Token",getToken:"获取 Token",createToken:"创建 GitHub Token",tokenPlaceholder:"需要仓库 Contents 与 Pull requests 写权限",tokenWorkflowPlaceholder:"需要 Contents、Pull requests、Workflows 写权限",hideToken:"隐藏 Token",showToken:"显示 Token",tokenHelp:"Token 仅用于本次提交,不会保存在浏览器或写入 PR",tokenWorkflowHelp:"此处 Token 用于创建配置 PR;它不是 Sandbox 的通用必填项,且不会保存在浏览器或写入 PR",prCreated:"PR #{{number}} 已创建",configPrCreated:"配置 PR #{{number}} 已创建",configPrNextStep:"合并后,后续同仓库 PR 会自动触发评审。",viewOnGitHub:"在 GitHub 查看",viewConfigPr:"查看配置 PR",secretsHeading:"合并 PR 前,请在仓库的 GitHub Actions Secrets 中配置:",secretsConfigHeading:"合并配置 PR 前,请在目标仓库添加运行时密钥",openSecrets:"打开 Secrets 设置",secretsPath:"路径:Settings → Secrets and variables → Actions → Repository secrets",repositoryConfigHelp:"将为 {{repository}} 添加 PR 自动评审配置",repositoryReviewHelp:"将使用 GitHub App 校验 {{repository}} 的 Pull Request",secretPair:"{{accessKey}}、{{secretKey}}(必填)",sessionToken:"{{sessionToken}}(使用临时凭据时必填)",requiredSecret:"{{name}}(必填)",temporaryCredentialRequired:"(使用临时凭据时必填)",requiredSuffix:"(必填)",submitting:"提交 PR 中…",validation:{required:"此项不能为空",repository:"请输入 owner/repository 或完整 GitHub 仓库 URL",baseBranch:"目标分支格式不正确",projectPath:"请输入仓库内的相对目录",runtimeId:"运行时 ID 格式不正确",sandboxToolId:"沙箱工具 ID 格式不正确",modelName:"模型名称格式不正确",modelBaseUrlSafe:"请输入不含凭据、查询参数或锚点的 HTTPS 地址",modelBaseUrl:"请输入有效的 HTTPS 地址",runtimeName:{required:"Runtime 名称为必填项",characters:"Runtime 名称只能包含英文字母、数字、下划线和连字符",length:"Runtime 名称长度须为 4-64 个字符"}}},v9e={title:"配置 Coding Agents",description:"把随 Studio 提供的 AgentKit Skills 全局安装到本地编码客户端。",retry:"重试",clients:{ariaLabel:"选择 Coding Agent",title:"本机客户端",detectAgain:"重新检测",detecting:"正在检测本机客户端…",detected:"已检测到客户端",available:"可用",unavailable:"未检测到"},skills:{ariaLabel:"选择内置 Skill",title:"内置 Skills",viewFiles:"查看文件",items:{"veadk-agent-development":{name:"VeADK Agent 开发",description:"使用 VeADK 开发和完善 Agent。"},"agentkit-cli":{name:"AgentKit CLI",description:"通过 AgentKit CLI 管理和部署 AgentKit 资源。"}}},global:{ariaLabel:"全局安装目录",title:"全局安装",description:"配置后可在本机其他项目中使用",empty:"选择客户端后显示对应安装目录。"},success:"已为 {{agentCount}} 个客户端配置 {{skillCount}} 个 Skill",selection:"已选择 {{agentCount}} 个客户端、{{skillCount}} 个 Skill",selectClient:"请先选择客户端",configuring:"正在配置…",configure:"配置",errors:{detect:"检测本机客户端失败",configure:"配置失败,请检查用户目录权限后重试"},preview:{description:"只读浏览随 Studio 提供的 Skill 文件",close:"关闭文件预览",loading:"正在读取文件…",error:"读取 Skill 文件失败",skillFiles:"{{name}} 文件",files:"文件",fileContent:"文件内容",notPreviewable:"此文件不是可预览的 UTF-8 文本。",noFiles:"没有可预览的文件。"}},y9e={title:"飞书机器人",description:"创建一个由 AgentKit Runtime 驱动的飞书智能体",panel:"填写已发布飞书应用的凭据,Studio 将生成 basic 智能体、创建独立 Runtime,并启用飞书消息长连接。",agentName:"智能体名称",agentNameHelp:"将作为新 Runtime 中的根智能体名称",region:"部署地域",regionHelp:"Runtime 与构建产物将创建在该地域",regions:{"cn-beijing":"北京","cn-shanghai":"上海"},appId:"飞书 App ID",appIdHelp:"来自飞书开放平台的应用凭证",appSecret:"飞书 App Secret",appSecretPlaceholder:"请输入 App Secret",appSecretHelp:"仅写入新 Runtime 的环境变量",hideSecret:"隐藏 App Secret",showSecret:"显示 App Secret",hide:"隐藏",show:"显示",confirmCancel:"取消部署将停止任务并清理已创建的 Runtime,确定继续吗?",status:{preparing:"正在生成 basic 智能体",running:"正在创建 Runtime",cancelling:"正在取消部署",succeeded:"飞书机器人 Runtime 已创建",cancelled:"部署已取消",failed:"创建失败"},steps:{prepare:"生成智能体",build:"构建镜像",deploy:"创建 Runtime",publish:"发布服务"},openConsole:"打开 Runtime 控制台",credentials:{title:"凭据处理",description:"App Secret 仅用于本次部署,不会写入生成源码或浏览器存储。"},cancelDeployment:"取消部署",creating:"正在创建…",create:"创建飞书机器人 Runtime",validation:{appId:"请输入飞书 App ID",appSecret:"请输入飞书 App Secret",agentName:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"}},generatedAgent:{description:"一个通过飞书接收消息并提供帮助的智能助手。",instruction:"你是一个通过飞书为用户提供帮助的智能助手。准确理解用户问题,给出简洁、可靠的回答;信息不足时先提问澄清,不要臆造事实。"}},nrr=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:p9e,cards:g9e,categories:l9e,categoriesLabel:o9e,codingAgents:v9e,default:{title:i9e,description:a9e,search:s9e,categoriesLabel:o9e,categories:l9e,resultsLabel:c9e,open:u9e,localOnly:h9e,emptyTitle:d9e,emptyDescription:f9e,backToAutomations:p9e,cards:g9e,github:m9e,codingAgents:v9e,feishu:y9e},description:a9e,emptyDescription:f9e,emptyTitle:d9e,feishu:y9e,github:m9e,localOnly:h9e,open:u9e,resultsLabel:c9e,search:s9e,title:i9e},Symbol.toStringTag,{value:"Module"})),b9e={"zh-CN":"简体中文","en-US":"English"},irr=Object.freeze(Object.defineProperty({__proto__:null,default:{languageNames:b9e},languageNames:b9e},Symbol.toStringTag,{value:"Module"})),x9e={selectedExcerptLabel:"选中片段",commentLabel:"批注",commentSeparator:":",successTitle:"已加入 Bad case 评测集",successDescription:"这条批注已关联当前问题和完整模型回复。",done:"完成",ariaLabel:"批注选中的模型回复",title:"添加批注",content:"批注内容",placeholder:"说明问题或期望的修改方式",retryError:"{{error}},请重试。",cancel:"取消",submit:"加入 Bad Case"},w9e={attachment:"附件",image:"图片",preview:"预览 {{name}}",uploading:"上传中",uploadFailed:"上传失败",remove:"移除 {{name}}",previewDialog:"{{name}}预览",download:"下载",close:"关闭",reading:"正在读取文档…",loadFailed:"文档加载失败:{{error}}"},A9e={errorTitle:"云端日志错误",copyError:"复制完整错误信息",retry:"重试",statuses:{live:"实时",connecting:"连接中",retrying:"重连中",idle:"未连接"},title:"实例日志",description:"当前对话请求所在的 VeFaaS 实例",close:"关闭实例日志",instanceId:"实例 ID",waitingInstance:"等待实例",request:"请求 {{id}}",ariaLabel:"VeFaaS 实例实时日志",notCapturedTitle:"尚未捕获到实例",notCapturedDescription:"发送一条消息后,这里会显示实际处理请求的实例和实时日志。",connectingTitle:"正在连接实例日志",connectingDescription:"正在通过 Studio BFF 建立安全日志流。",emptyTitle:"暂无日志",emptyDescription:"已连接实例,等待新的日志输出。",retention:"日志自动刷新,仅保留最近 {{count}} 行"},S9e={title:"调用链路观测",statuses:{loading:"加载中",ready:"",collecting:"采集中",disabled:"未开启",forbidden:"权限不足",error:"加载失败"},errors:{collecting:"调用链路仍在采集中,请稍候。",disabled:"该 Agent 未开启链路观测,请到控制台开启后重试。",forbidden:"当前账号无权读取 APMPlus 调用链路,请联系管理员补充只读权限。",error:"调用链路加载失败,请稍后重试。"},callCount:"{{count}} 个调用 · {{duration}} ms",close:"关闭",loading:"加载调用链路…",retryNow:"立即重试",reload:"重新加载",empty:"该会话暂无调用链路(可能尚未产生调用)。",attributes:"属性",selectCall:"选择左侧的一个调用查看详情"},T9e={exportNote:"上述会话由 AgentKit Studio 导出,仅供参考",imageFailed:"图片生成失败,请重试。",browserUnsupported:"浏览器无法生成会话图片,请重试。",copyUnsupported:"当前浏览器不支持复制图片,请下载后使用。",exportFailed:"导出失败,请重试。",title:"导出会话",description:"选择格式并下载截至当前回复的全部输入与输出。",close:"关闭",generatingContent:"正在生成导出内容…",retry:"重试生成",previewPage:"预览第 1 页,共 {{count}} 页",previewAlt:"会话导出内容第 1 页,共 {{count}} 页",format:"导出格式",generatingFormat:"正在生成 {{format}}…",copying:"正在复制…",copiedFirst:"已复制第一页",copied:"已复制",copyFirst:"复制第一页",copyImage:"复制图片",generating:"正在生成…",downloadArchive:"下载 PNG 压缩包({{count}} 页)",downloadFormat:"下载 {{format}}"},C9e={unsupportedComponent:"不支持的组件:{{component}}",sandboxIdentity:"Codex Sandbox 执行标识",useSkill:"使用 {{name}} 技能",thinkingDone:"已完成思考",thinking:"思考中",justNow:"刚刚",sourceUnavailable:"暂时无法读取生成的源码,请稍后重试。",downloadStarted:"已开始下载",verifiedDelivery:"已验证交付物",generatedSource:"生成的 Agent 源码",entryPoint:"入口",fileCount:"文件数",size:"大小",validationTime:"验证时间",generationTime:"生成时间",checksPassed:"{{count}} 项检查通过",sourceReady:"源码已准备好,可部署",sourceGuidance:"源码已准备好,可查看、下载或部署;部署前请确认 Runtime 配置。",viewSource:"查看源码",preparing:"正在准备…",viewChanges:"查看本次变更",downloadSource:"下载源码",sourceNotReady:"源码尚未准备好",manualDeploy:"手动部署到 Runtime",beforeOptimization:"优化前",afterOptimization:"优化后",planStatuses:{pending:"待处理",in_progress:"进行中",completed:"已完成",failed:"未完成"},renderUi:"渲染 UI",truncated:"…(已截断)",agentAdjusting:"Agent 正在调整",sandboxDetails:"Codex Sandbox 详细输出",waitingCodex:"正在等待 Codex 输出",arguments:"参数",result:"返回",artifacts:"产物",downloadNamed:"下载 {{name}}",powerpoint:"PowerPoint 演示文稿",preview:"预览",download:"下载",previewDialog:"{{name}} 预览",closePreview:"关闭预览",slidePreview:"{{name}} 幻灯片预览",mcpToolset:"MCP 工具集",authorized:"已授权 · {{tool}}",authorizationRequired:"{{tool}} 需要授权",oauthDescription:"工具集 {{tool}} 使用 OAuth 保护,需登录授权后方可调用。",oauthProvider:"将跳转至 {{provider}} 完成登录。",oauthContinue:"授权完成后对话自动继续。",waitingAuthorization:"等待授权…",authorize:"去授权",missingAuthorizationUrl:"未在事件中找到授权地址。",tools:{web_search:{running:"正在进行网络搜索",done:"已完成网络搜索"},link_reader:{running:"正在读取网页",done:"已完成网页读取"},run_code:{running:"正在 AgentKit 沙箱中执行代码",done:"已在 AgentKit 沙箱中完成代码执行"},list_envs:{running:"正在查看可用环境",done:"已读取可用环境"},get_env_manifest:{running:"正在读取环境 Manifest",done:"已读取环境 Manifest"},execute_in_sandbox:{running:"正在环境中执行命令",done:"已在环境中完成命令执行"},delegate_to_codex_sandbox:{running:"Codex Sandbox 正在执行",done:"Codex Sandbox 已完成",failed:"Codex Sandbox 执行失败"},image_generate:{running:"正在生成图片",done:"已完成图片生成"},video_generate:{running:"正在生成视频",done:"已完成视频生成"},ppt_generate:{running:"正在生成 PPT",done:"已完成 PPT 生成"},load_memory:{running:"正在检索长期记忆",done:"已完成记忆检索"},load_knowledgebase:{running:"正在检索知识库",done:"已完成知识库检索"},load_skill:{running:"正在加载技能",done:"已加载技能"},collect_resources:{running:"正在收集可用资源",done:"已完成资源收集",failed:"资源收集失败"},create_agents:{running:"正在创建并运行 Agent",done:"已完成 Agent 创建",failed:"Agent 创建失败"}},createAgents:{categories:{skill_hub:"Skill Hub",skill_space:"AgentKit 技能中心",knowledge_base:"知识库",tool:"工具"},agentTypes:{llm:"LLM 智能体",sequential:"顺序智能体",parallel:"并行智能体",loop:"循环智能体",workflow:"工作流"},skill:"技能",subAgents:"子智能体",builtinTool:"内置工具",skillCenter:"AgentKit 技能中心",selfAuthoredTools:"自写工具",dependencies:"依赖:{{items}}",fullCode:"{{name}} 完整代码",itemCount:"{{label}} {{count}} 项",collectionAria:"召回资源信息",retrieving:"正在检索资源",retrievalFailed:"资源检索未完成",checkConfig:"请检查资源服务配置后重试。",notSearched:"未检索",notConfigured:"未配置",resourceList:"{{label}}资源列表",searchKeywords:"检索关键词",skillHubSkipped:"未提供检索关键词,本次未检索 Skill Hub。",sourceSkipped:"未配置 {{label}},本次未检索该来源。",noResources:"本次检索未返回该类别的资源。",resultAria:"创建 Agent 结果",creationFailed:"Agent 创建未完成",agentResources:"{{name}} 具备的资源",knowledgeBase:"知识库",toolsLabel:"工具",creating:"正在创建 Agent",noAgents:"没有可展示的 Agent",noAgentResult:"工具返回中未包含 Agent 配置或执行结果。",sourceLabels:{tool:"工具",knowledge:"AgentKit 知识库",skillCenter:"AgentKit 技能中心",unknown:"未知来源"},unnamedResource:"未命名资源",unnamedAgent:"未命名 Agent"},branchCompare:{ariaLabel:"分支对比",selectDirection:"选择方向",continue:"继续这个方向"},codexProgress:{planTitle:"Codex 执行计划",fallback:{fileChange:"修改文件",approval:"等待操作批准",status:"Codex 状态",command:"运行命令"},planSummary:"已完成 {{completed}}/{{total}} 项",command:{running:"正在执行命令",completed:"命令执行完成",failed:"命令执行失败"},projectFiles:"{{count}} 个项目文件",projectFile:"项目文件",fileChange:{running:"正在更新{{subject}}",completed:"已更新{{subject}}",failed:"更新{{subject}}失败"},externalTool:"外部工具",mcp:{running:"正在调用工具 {{tool}}",completed:"已调用工具 {{tool}}",failed:"工具 {{tool}} 调用未完成"},collaboration:{spawn_agent:{running:"正在启动子任务",completed:"子任务已启动",failed:"子任务启动失败"},send_input:{running:"正在向子任务发送信息",completed:"已向子任务发送信息",failed:"向子任务发送信息失败"},wait:{running:"正在等待子任务",completed:"子任务等待已结束",failed:"等待子任务失败"},close_agent:{running:"正在结束子任务",completed:"子任务已结束",failed:"子任务结束失败"},default:{running:"正在协调子任务",completed:"子任务协作已完成",failed:"子任务协作失败"}},webSearch:{running:"正在进行网络搜索",completed:"已完成网络搜索",failed:"网络搜索未完成"},errorDetail:"Codex 执行未完成。",errorTitle:"Codex 执行遇到错误"}},O9e={segments:{system:"系统与工具",input:"输入与历史",output:"输出与思考",remaining:"剩余"},modelUnavailable:"模型信息未提供",promptWithSystem:"提示词(含系统)",systemUnknown:"系统与工具占用未知",systemApprox:"系统与工具约 {{count}} Token",ariaKnown:"上下文已使用 {{percentage}}%,{{system}},{{inputLabel}} {{input}} Token,输出与思考 {{output}} Token,剩余 {{remaining}} Token",ariaUnknown:"{{model}},上下文窗口未知,会话累计使用 {{count}} Token",composition:"上下文构成",percentageUsed:"{{percentage}}% 已用",gridAria:"100 格上下文构成图,每格代表上下文窗口的百分之一",estimated:"估算",unknown:"未知",summaryPercentage:"{{used}} 已用,剩余 {{remaining}}",summaryTokens:"{{used}} 已用,剩余 {{remaining}},总计 {{total}}",overflow:"已超出上下文 {{count}} Token",title:"上下文用量",unknownModel:"暂未收录该模型的上下文窗口",unknownRuntime:"当前 Runtime 未提供模型信息"},k9e={title:"添加 AgentKit 智能体",noAgents:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",connectionFailed:"连接失败:{{error}}。请检查 URL、API Key,以及该网关是否允许跨域。",description:"填入 AgentKit 部署的访问地址与 API Key,将通过 ADK 协议连接,连接成功后其 Agent 会出现在左上角的下拉中。",url:"访问地址 URL",apiKeyHint:"以 Authorization: Bearer 方式连接",displayName:"显示名称(可选)",displayNameHint:"默认取 URL 的主机名",cancel:"取消",connecting:"连接中…",connect:"连接并添加"},E9e={placeholder:"输入消息…",inputAria:"输入消息",generating:"正在生成",send:"发送"},_9e={ariaLabel:"本轮调用上下文",removeSkill:"移除技能 {{name}}",removeAgent:"移除 Agent {{name}}"},R9e={cardAria:"{{label}} 图表",viewAria:"{{label}} 显示方式",preview:"预览",code:"代码",invalidEcharts:"ECharts 配置不是有效且安全的数据对象,请切换到代码检查内容。",renderFailed:"图表暂时无法渲染,请切换到代码检查内容。",echartsAria:"ECharts 图表预览",rendering:"正在渲染图表…",mermaidFailed:"图表暂时无法渲染,请切换到代码查看 Mermaid 内容。",mermaidAria:"Mermaid 图表预览"},D9e={playVideo:"点击播放视频:{{name}}",enlargeImage:"放大预览:{{name}}",image:"图片",enlargeVideo:"点击放大视频",videoPreview:"视频预览",downloadVideo:"下载视频",close:"关闭"},L9e={annotation:x9e,media:w9e,runtimeLogs:A9e,trace:S9e,share:T9e,blocks:C9e,tokenUsage:O9e,addAgentKit:k9e,composer:E9e,invocation:_9e,visualization:R9e,markdown:D9e},arr=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:k9e,annotation:x9e,blocks:C9e,composer:E9e,default:L9e,invocation:_9e,markdown:D9e,media:w9e,runtimeLogs:A9e,share:T9e,tokenUsage:O9e,trace:S9e,visualization:R9e},Symbol.toStringTag,{value:"Module"})),M9e={back:"返回",cancel:"取消",deploy:"部署",delete:"删除",loading:"读取中…",next:"下一步",notSupported:"暂不支持",previous:"上一步",required:"必填",retry:"重试",actions:"操作",value:"值",disabled:"关闭",enabled:"已开启",none:"无",close:"关闭",name:"名称",description:"描述",send:"发送"},I9e={heading:"VeADK Agent 结构配置",importHint:"可在「创建 Agent」页通过「导入 YAML」重新载入。"},P9e={agentName:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},runtimeName:{required:"Runtime 名称为必填项",characters:"Runtime 名称只能包含英文字母、数字、下划线和连字符",length:"Runtime 名称长度须为 4-64 个字符"}},N9e={description:"一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",instruction:`你是一个专业、可靠的智能助手。 你的目标是准确理解用户的需求,并给出条理清晰、简洁有用的回答。 约束: - 信息不足时主动提问澄清,不要臆造事实。 - 需要时合理调用可用的工具,并说明关键结论。 -- 保持礼貌、专业的语气。`},B9e={requestFailed:"请求失败 ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 AgentKit 智能体中心",loginRequired:"请先登录以访问 AgentKit 智能体中心"},vikingKnowledge:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 知识库",loginRequired:"请先登录以访问 VikingDB 知识库"},vikingMemory:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 记忆库",loginRequired:"请先登录以访问 VikingDB 记忆库"},mcpGateway:{missingHttpTool:"请返回“添加 MCP 工具”并添加至少一个 HTTP MCP 服务;MCP 稳定性治理不支持 stdio 服务。",missingUrl:"已添加的 HTTP MCP 工具缺少有效服务地址,请返回“添加 MCP 工具”补充后再发布。"},customModel:{fallbackName:"自定义模型",apiKeyLabel:"{{name}} 模型 API Key"},deploymentEnv:{serverInjected:"由服务端注入",selectedApiKeyPlaceholder:"由所选 API Key 注入",mcpInjectedComment:"由已添加的 MCP 工具注入",restoredPlaceholder:"由 Studio 服务端安全恢复",generatedMcpPlaceholder:"由已添加的 HTTP MCP 工具自动生成",restoredHelp:"更新时由 Studio 服务端合并 MCP 地址与认证,不向浏览器返回旧密钥。",mergedMcpHelp:"Studio 服务端自动合并 MCP 地址与可选认证,不向浏览器返回旧密钥。",listSeparator:"、",requirementHint:"优化项“{{labels}}”依赖此配置。",requiredBy:"优化项“{{labels}}”依赖此配置,请填写 {{key}}。",required:"请填写 {{label}}({{key}})。",invalidJson:"JSON 格式不正确"},drafts:{unsupportedVersion:"本机草稿版本暂不受支持,请升级 Studio 后重试。",invalidFormat:"本机草稿数据格式无效。",readFailed:"无法读取本机草稿,浏览器中的草稿数据可能已损坏。",quotaExceeded:"浏览器存储空间不足,草稿未保存。请删除不需要的草稿或清理此站点的浏览器存储后重试。",writeRejected:"浏览器拒绝保存草稿,请检查站点存储权限后重试。"},skills:{searchFailed:"搜索失败 ({{status}})",downloadFailed:"下载技能失败 ({{status}})",agentKitRequestFailed:"AgentKit Skills 请求失败",missingManifest:"{{location}} 缺少 SKILL.md",invalidParentPath:"{{location}} 包含非法路径(..):{{path}}",invalidPath:"{{location}} 包含非法路径:{{path}}",localDescription:"本地 Skill",folderSource:"文件夹",noManifest:"{{location}} 中未发现 SKILL.md"},zip:{invalid:"无效的 zip:找不到 EOCD",tooManyFiles:"zip 文件数不能超过 {{count}} 个",tooLarge:"zip 解压后的内容过大"}},$9e={back:"返回开发会话",runtimeName:"Runtime 名称",runtimeNameExists:"Runtime 名称已存在,请更换后重试",checkingRuntimeName:"正在检查 Runtime 名称",verifiedSource:"已验证源码",deployableSource:"可部署源码",verifiedByCodex:"已通过 Codex 云端验证",entryPoint:"入口",files:"文件",artifact:"构建产物",validationReport:"验证报告",verifiedHint:"源码由服务端从已验证交付物物化,浏览器文件不能替换。",unverifiedHint:"源码已由服务端安全物化,部署前请确认 Runtime 配置。",env:{requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}"}},F9e={name:"代码包",back:"返回创建方式",reading:"正在读取代码包",readingEllipsis:"正在读取代码包…",uploadFirst:"请先上传代码包",uploadAriaLabel:"代码包上传",upload:"上传代码包",reupload:"重新上传代码包",uploadPrompt:"请上传代码包",filesRecognized:"已识别 {{count}} 个文件,点击区域可重新上传",dropHint:"点击或拖拽上传,支持 .zip 格式,最大 50 MB;可使用 app.py,或由 agentkit.yaml 声明入口",viewFiles:"查看文件",chooseFile:"选择代码包",errors:{invalidFormat:"请选择 .zip 格式的代码包。",tooLarge:"代码包不能超过 50 MB。",invalidPath:"压缩包包含非法路径:{{name}}",empty:"压缩包中没有可部署的文件。",tooManyFiles:"代码包文件数不能超过 {{count}} 个。",duplicateFile:"代码包包含重复文件:{{path}}",manifestParse:"agentkit.yaml 无法解析:{{detail}}",manifestRoot:"agentkit.yaml 根节点必须是对象。",manifestCommon:"agentkit.yaml 的 common 必须是对象。",entryPointType:"agentkit.yaml 的 common.entry_point 必须是文件路径。",entryPointInvalid:"agentkit.yaml 的 common.entry_point 不是有效文件路径。",entryPointMissing:"代码包中不存在 agentkit.yaml 声明的启动入口:{{entryPoint}}",defaultEntryPointMissing:"代码包根目录必须包含 app.py,或在 agentkit.yaml 的 common.entry_point 中声明已有入口。"}},z9e={label:"Agent 执行画布",readOnlyLabel:"只读 Agent 执行画布",minimapLabel:"执行流程缩略图",controls:{ariaLabel:"执行流程控制",zoomIn:"放大",zoomOut:"缩小",fitView:"适应视图"},rootAgent:"主 Agent",unnamedStep:"未命名步骤",terminals:{input:"用户请求",output:"最终回复"},edges:{then:"然后",continueLoop:"继续循环",call:"调用"},patterns:{llm:{label:"智能体",description:"理解任务并直接完成一个具体工作"},sequential:{label:"分步协作",description:"内部步骤按照顺序依次执行"},parallel:{label:"同时处理",description:"内部步骤同时工作,完成后统一汇总"},loop:{label:"循环执行",description:"重复执行内部步骤,直到满足停止条件"},a2a:{label:"远程智能体",description:"调用已经存在的远程 Agent"}},actions:{insertHere:"在这里插入步骤",deleteNamed:"删除 {{name}}",deleteNode:"删除节点",addSubagent:"添加子 Agent",addParallelStep:"添加一个同时处理的步骤",addLoopStep:"添加循环步骤",addNextStep:"添加下一个步骤",addFirst:"添加到最前",addLast:"添加到最后"}},U9e={title:"智能模式",subtitle:"描述目标后,沙箱中的 Codex 会判断你的意图,完成构建、调试和临时云端验证。",model:{label:"模型",placeholder:"选择模型",retiring:"即将下线",currentConfiguration:"当前配置",loadError:"加载模型列表失败"},availability:{checking:"正在检查智能开发能力…",unavailable:"当前无法使用智能模式,请返回后重试。"},goal:{title:"从目标开始",continueTitle:"继续优化项目",hint:"只需说明 Agent 要解决的问题;如有影响结果的关键信息,会在开始前向你确认。",continueHint:"说明这次要调整的内容,完成后会保存为新版本。",basedOn:"基于",clearSelection:"取消选择",label:"目标描述",optimizationLabel:"优化目标",placeholder:"例如:创建一个能读取销售数据、生成周报并校验输出格式的 Agent",optimizationPlaceholder:"例如:增加数据来源标注,并在信息不足时先向用户确认"},actions:{preparing:"准备中…",build:"开始构建",optimize:"开始优化"},preparation:{accepted:"目标已收到,马上开始实现",preparing:"正在创建任务环境…",starting:"环境已就绪,正在启动 Codex…",next:"接下来会先梳理目标和实现方式,再编写、运行和验证 Agent。"}},V9e={title:"已保存项目",description:"选择已有版本继续优化,或查看、下载和部署源码。",refresh:"刷新项目列表",checkingStorage:"正在检查项目存储…",unavailableTitle:"暂时无法读取项目",storageCheckError:"无法确认项目存储状态,请稍后重试。",storageNotConfigured:"项目存储尚未配置。",loadingMigrated:"正在读取已迁移项目…",loadingSaved:"正在读取已保存项目…",loadingVersions:"正在读取项目版本…",unknownTime:"时间未知",sourceDownloaded:"源码已下载。",projectSummary_one:"{{count}} 个版本 · 更新于 {{time}}",projectSummary_other:"{{count}} 个版本 · 更新于 {{time}}",versionSummary_one:"{{time}} · {{count}} 个文件",versionSummary_other:"{{time}} · {{count}} 个文件",noVersionDescription:"暂无版本描述",latestVersion:"最新版本",verified:"已验证",pendingVerification:"待确认",viewSource:"查看源码",download:"下载",downloading:"下载中…",optimize:"去优化",optimizeUnavailable:"去优化,暂不支持",errors:{projects:"无法读取已保存项目。",source:"无法读取项目源码。",versions:"无法读取项目版本。",download:"下载源码失败。",prepareDeployment:"无法准备部署源码。",deleteVersion:"删除项目版本失败。",migrated:"无法读取已迁移项目",saved:"无法读取已保存项目"},empty:{migratedTitle:"还没有已迁移的项目",savedTitle:"还没有已保存的项目",migratedDescription:"完成首次迁移后,源码会自动保存在这里。",savedDescription:"完成首次构建后,源码会自动保存在这里。",noVersions:"这个项目还没有可用版本。"},compare:{selected:"已选择 {{count}}/2",selectedLabel:"已选择",select:"选择",view:"查看对比",start:"对比版本"},delete:{title:"删除这个版本?",onlyVersion:"“{{name}}”只有这一个版本,删除后项目也会移除。此操作无法撤销。",description:"该版本的源码和验证记录将永久删除,其他版本不受影响。",confirm:"删除版本"}},Q9e={title:"选择创建方式",subtitle:"以不同模式构建您的智能体",features:"特性",quick:{title:"快速模式",description:"动态派生子智能体自主完成任务",features:{dynamicSubagents:"动态派生子智能体",autonomousPlanning:"自主规划执行",collaboration:"多智能体协作",summary:"自动汇总结果",skills:"按需调用技能",trace:"任务过程可追踪"}},traditional:{title:"传统模式",description:"高度自定义您的智能体结构",features:{visualConfig:"可视化配置",migration:"存量智能体迁移",debugging:"实时调试",optimization:"可选性能优化",parameters:"精细参数控制"}}},G9e={placeholder:"输入系统提示词;键入 ## 加空格可创建二级标题…",toolbar:{undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",paragraph:"正文",quote:"引用",heading:"标题 {{level}}",selectBlockType:"选择文本类型",blockType:"文本类型",bold:"加粗",removeBold:"取消加粗",italic:"斜体",removeItalic:"取消斜体",bulletedList:"无序列表",numberedList:"有序列表"}},H9e={local:{duplicatesSkipped:"已跳过重复技能:{{names}}",invalidDrop:"请拖入包含 SKILL.md 的文件夹或一个 .zip 文件",readError:"读取失败:{{detail}}",dropLabel:"拖入文件夹或 ZIP,自动识别 Skill",hint:"每个技能需包含 SKILL.md。支持包含多个技能的目录。",reading:"正在读取文件…",fileCount:"本地 · {{count}} 个文件"},hub:{searchError:"搜索失败,请稍后重试。",searchPlaceholder:"搜索火山 Find Skill 技能广场,例如 数据分析、PDF…",search:"搜索",searching:"正在搜索…",noResults:"没有找到匹配的技能,换个关键词试试。",hint:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"},space:{loadError:"加载失败",loadingSpaces:"正在加载 AgentKit Skills 中心…",noSpaces:"此账号下没有 AgentKit Skills 中心。",selectSpace:"选择 AgentKit Skills 中心",openConsole:"在火山引擎控制台打开",loadingSkills:"正在加载技能列表…",noSkills:"此 AgentKit Skills 中心暂无技能。"}},W9e={unnamedNode:"未命名节点",editInstruction:"点击编辑指令…",controls:{ariaLabel:"工作流画布控制",zoomIn:"放大",zoomOut:"缩小",fitView:"适应视图"},sections:{info:"工作流信息",execution:"执行方式",nodes:"节点",nodeConfig:"节点配置"},types:{sequential:{label:"顺序",description:"节点依次执行"},parallel:{label:"并行",description:"节点同时执行"},loop:{label:"循环",description:"节点循环执行"}},placeholders:{description:"这个工作流做什么…",agentDescription:"这个 Agent 做什么…",instruction:"你是一个…"},errors:{workflowNameUnique:"名称须与 Agent 节点名称保持唯一",agentNameUnique:"Agent 名称在当前工作流中必须唯一"},dragHint:"拖拽到画布,或点击下方按钮添加",agentNode:"Agent 节点",addNode:"添加节点",connectHint:"拖拽节点的圆点连线以表达执行顺序。",create:"创建工作流",deleteNode:"删除节点",nameHelp:"仅使用英文字母、数字和下划线,且名称保持唯一。",instruction:"指令 (instruction)",tools:"工具 (逗号分隔)",nodeId:"节点 ID",empty:{selectNode:"选择一个节点以编辑其配置",summary:"共 {{nodes}} 个节点 · {{edges}} 条连线"}},Y9e={ariaLabel:"快速模式创建",progress:"快速模式创建进度",steps:{agent:{label:"智能体",title:"基本信息",description:"设置智能体的名称、用途、行为方式与能力"},environment:{label:"执行环境",title:"配置执行环境",description:"选择默认环境或已构建的自定义环境"},deployment:{label:"部署偏好",title:"部署偏好",description:"定义 AgentKit 云上参数"}},model:{label:"模型",source:"模型来源",name:"模型名称",provider:"服务商 Provider",volcengineArk:"火山方舟",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",currentApiKey:"当前 API Key",loadingApiKeys:"正在加载 API Key",selectApiKey:"选择 API Key",searchApiKeys:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",loadingModels:"正在加载模型",selectModel:"选择模型",searchModels:"搜索名称、Model ID 或服务商",noModels:"没有可用的模型",apiKeyPlaceholder:"请输入模型 API Key",credentialsLoadError:"模型凭据加载失败",modelsLoadError:"模型列表加载失败"},identity:{unnamedPool:"未命名用户池",currentPool:"{{value}}(当前用户池)",userPool:"用户池",loading:"正在加载用户池",placeholder:"请选择用户池",search:"搜索用户池",empty:"当前账号下暂无 Identity 用户池",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime",selectionHint:"当前 Studio 使用的用户池已在列表中标注"},agent:{namePlaceholder:"输入智能体名称",descriptionPlaceholder:"说明这个智能体可以做什么",prompt:"提示词",promptPlaceholder:"定义角色、目标和行为边界",skills:"技能",addSkill:"添加技能"},validation:{descriptionRequired:"请输入描述",promptRequired:"请输入提示词",modelRequired:"请选择模型",instanceIntegers:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数",instanceOrder:"最小实例数不能大于最大实例数",userPoolRequired:"请选择用于 Runtime 鉴权的用户池"},deployment:{runtimeName:"Runtime 名称",runtimeNameUpdateHint:"更新时保持现有 Runtime 名称不变",runtimeNameHint:"仅支持英文字母、数字、下划线和连字符",region:"发布区域",authentication:"鉴权方式",apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPoolDescription:"使用 Identity 用户池签发的 JWT",sessionStorage:"会话存储",inMemoryStorage:"In-memory 临时存储",backends:{sqlite:"SQLite 文件",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",inMemoryHint:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",networkMode:"网络模式",network:{public:"公网",private:"私网",both:"公网与私网"},subnetIds:"子网 ID(可选,多个用逗号分隔)",sharedInternet:"VPC 内共享公网出口",sharedInternetHint:"允许私网 Runtime 通过共享出口访问公网",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",evaluationSetsHint:"部署成功后自动创建 Good Case 和 Bad Case 评测集",resources:"资源配置",complete:"部署已完成",preparing:"正在准备部署…"},environmentVariables:{title:"环境变量",add:"添加变量",nameAriaLabel:"环境变量名称",valueAriaLabel:"{{name}} 的值",deleteNamed:"删除 {{name}}"},actions:{updateAgain:"再次更新",deployAgain:"重新部署",updateAndPublish:"更新并发布"}},q9e={actions:{addSubagent:"添加子 Agent",clearRoot:"清空根 Agent",clearRootConfirmation:"清空根 Agent 的全部配置和子 Agent?此操作无法撤销。"},workspace:{progress:"Agent 创建进度",modes:{build:"架构",validate:"调试",optimize:"优化",environment:"环境",publish:"发布"},titles:{build:"个性化您的智能体架构",validate:"调试您的智能体",optimize:"为您的智能体选择优化项",environment:"配置云上环境",publish:"准备好部署您的智能体"}},sections:{type:{label:"Agent 类型",hint:"选择 Agent 类型"},basic:{label:"基本信息",hint:"名称、描述与系统提示词"},model:{label:"模型配置",hint:"模型与服务(可选)"},tools:{label:"工具",hint:"可调用的能力"},skills:{label:"技能",hint:"声明式技能"},knowledge:{label:"知识库",hint:"外部知识检索"},memory:{label:"记忆",hint:"短期与长期记忆"},subagents:{label:"子 Agent",hint:"嵌套协作"},review:{label:"完成",hint:"预览并创建"}},agentTypes:{ariaLabel:"Agent 类型",remoteChildOnly:"远程智能体只能作为子步骤使用",llm:{label:"智能体",fullLabel:"LLM 智能体",description:"大模型驱动,自主完成任务"},sequential:{label:"分步协作",fullLabel:"顺序型智能体",description:"子 Agent 按顺序依次执行"},parallel:{label:"同时处理",fullLabel:"并行型智能体",description:"子 Agent 并行执行后汇总"},loop:{label:"循环执行",fullLabel:"循环型智能体",description:"子 Agent 循环执行到满足条件"},a2a:{label:"远程智能体",fullLabel:"远程 Agent",description:"通过 A2A 协议调用远程 Agent"}},basic:{agentName:"Agent 名称",name:"名称",agentDescription:"智能体描述",descriptionPlaceholder:"简要描述这个 Agent 的用途,便于团队识别…",nameHelp:"遵循 Google ADK 命名规则,且在执行流程中保持唯一。",rootDescriptionHelp:"完整描述会保留;部署时会自动整理为符合 Runtime 规范的单行描述。",descriptionHelp:"描述会显示在 Agent 列表与选择器中。",orchestratorHelp:"这是一个协作容器,本身不生成回答。请在左侧画布中添加任务步骤,并通过拖拽调整它们的位置。",maxIterations:"最大轮次",maxIterationsHelp:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。",agentCenter:"AgentKit 智能体中心",agentCenterHelp:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。系统会根据每轮任务动态发现并挂载匹配的 Agent。",moreOptions:"更多选项",systemPrompt:"系统提示词",loadingMarkdown:"正在加载 Markdown 编辑器…",markdownHelp:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。",unnamed:"未命名",unnamedAgent:"未命名智能体"},validation:{remoteRoot:"远程 Agent 只能作为子 Agent",missingRegistry:"请选择 AgentKit 智能体中心",name:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},duplicateName:"Agent 名称在当前结构中必须唯一",missingDescription:"描述为必填项",mcpAuthRequired:"MCP 地址变化后需要确认认证方式",mcpDuplicateName:"MCP 名称重复,请为每个服务使用唯一名称",mcpDuplicateUrl:"MCP 地址重复,请删除重复服务后再发布",missingSubagent:"缺少子 Agent",missingPrompt:"系统提示词为必填项",missingSubagentDetail:"{{type}}至少需要添加一个子 Agent 后才能调试或发布。",problem:"{{name}}:{{problem}}"},ai:{ariaLabel:"AI 自动填写 Agent 配置",minimumLength:"请至少输入 {{count}} 个字符。",replaceConfirmation:"生成的新配置会替换当前画布和属性,确定继续吗?",placeholder:"描述目标,使用 {{model}} 模型一键生成配置",generate:"智能生成",generating:"正在智能生成",success:"生成成功",regenerate:"重新生成",failed:"智能生成失败"},debug:{ariaLabel:"智能体调试工作区",unavailable:"当前后端暂不支持生成 Agent 调试运行。",baseline:"基准组",comparison:"对照组 {{count}}",selectModel:"请选择模型",enterDescription:"请输入描述",enterPrompt:"请输入系统提示词",duplicateConfiguration:"测试配置不能重复",starting:"启动中…",applyAndRestart:"应用并重启",restart:"重新启动",start:"启动环境",defaultModel:"默认模型",testConfiguration:"测试配置",deleteVariant:"删除 {{name}}",deleteVariantGroup:"删除对照组",creatingEnvironment:"正在创建测试环境…",configurationChanged:"配置已变更,请重新启动环境。",ready:"环境已就绪",readyHint:"发送消息以比较智能体回复。",startHint:"先完善配置,再启动环境。",viewTraceNamed:"查看 {{name}} 的调用链路",traceUnavailable:"发送消息后可查看调用链路",trace:"调用链路",useConfiguration:"使用此配置",finishConfiguration:"完成配置",finishAndStart:"完成并启动",currentAgentModel:"当前 Agent 模型",configurationHint:"修改仅用于本次对比,选择使用后才会进入部署流程。",messagePlaceholder:"向已启动的测试环境发送消息…",startOneFirst:"请先启动至少一个测试环境",addVariant:"添加对照组",traceTitle:"调用链路 · {{name}}",leaveTitle:"离开调试?",leaveDescription:"离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。",cleaning:"清理中…",confirmLeave:"确定离开",closeLeaveConfirmation:"关闭离开调试确认"},optimization:{ariaLabel:"智能体优化选项",scenario:"优化场景",components:"优化组件",bytePlusUnavailable:"BytePlus 账号暂不支持 Harness Sidecar 优化项。请保持优化项为空后继续部署,普通 BytePlus 智能体不受影响。",releaseScenario:"优化场景:{{profile}}",profiles:{default:{label:"自定义",description:"按需选择组件,不勾选时不启动 Sidecar。"},ops:{label:"运维场景",description:"适用于运维诊断、数据库、日志和监控 MCP。"}},groups:{quality:"提升回答质量",cost:"降低运行成本",stability:"增强运行稳定性"},options:{context_engine:{label:"上下文治理",description:"治理上下文组装、任务锚定和上下文预算。"},compressor:{label:"上下文与结果压缩",description:"压缩长上下文和大型工具结果,降低 Token 成本。"},verifier:{label:"回答校验与修复",description:"校验证据和回答,在失败时执行修复或告警。"},long_run_control:{label:"Goal 任务控制",description:"管理 Goal 任务的进度、续跑和结束条件。"},mcp_resilience:{label:"MCP 稳定性治理",description:"治理连接、超时、空结果、大返回和调用预算;默认包含 SQL 只读保护。"}}},model:{label:"模型",source:"模型来源",volcanoArk:"火山方舟",volcengineArk:"火山方舟",bytePlusModelArk:"BytePlus ModelArk",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",configuration:"模型配置",name:"模型名称",provider:"服务商 Provider",liteLlmProviders:"LiteLLM 支持列表",apiKeyPlaceholder:"请输入模型 API Key",available:"已开通",retiring:"即将下线",notActivated:"未开通",unavailable:"暂不可用",apiKeyLoadError:"加载 Ark API Key 失败",loadingApiKeys:"正在加载 API Key…",selectApiKey:"选择 API Key",currentApiKey:"当前 API Key",apiKeyList:"API Key 列表",searchApiKey:"搜索 API Key",searchApiKeyName:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",noMatchingApiKey:"没有匹配的 API Key",loading:"正在加载模型…",loaded:"已加载 {{count}} 个模型",loadError:"加载模型失败",selectModel:"选择模型",selectProviderModel:"选择服务商模型",providerModels:"服务商模型",search:"搜索模型",searchPlaceholder:"搜索名称、Model ID 或服务商",noMatches:"没有匹配的模型",empty:"暂无可用模型",unknownStatus:"未知状态",refresh:"刷新",refreshing:"刷新中…",activate:"开通",activateAction:"前往开通",currentConfiguration:"当前配置"},tools:{builtIn:"内置工具",builtInHelp:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。",codeExecution:"代码执行配置",codeExecutionHelp:"指定 AgentKit 代码执行沙箱。",mcp:"MCP 工具"},catalog:{web_search:{label:"联网搜索",description:"火山引擎 Web Search,获取实时信息。"},parallel_web_search:{label:"并行联网搜索",description:"并行发起多条搜索查询,更快汇总。"},link_reader:{label:"网页读取",description:"抓取并阅读给定链接的正文内容。"},web_scraper:{label:"网页爬取",description:"结构化爬取网页(需要 Scraper 服务)。"},image_generate:{label:"图像生成",description:"文生图(Doubao Seedream)。"},image_edit:{label:"图像编辑",description:"图生图 / 编辑(Doubao SeedEdit)。"},video_generate:{label:"视频生成",description:"文/图生视频(Doubao Seedance),含任务查询。"},text_to_speech:{label:"语音合成 (TTS)",description:"把文本转成语音(火山语音)。"},run_code:{label:"代码执行",description:"在沙箱中执行代码。"},vesearch:{label:"VeSearch 智能搜索",description:"火山 VeSearch(需要 bot 端点)。"},links:{console:"控制台",documentation:"文档"},env:{modelAgentName:{comment:"模型名称"},embeddingModelName:{comment:"向量化模型(记忆/知识库需要)"},vikingMemoryProject:{comment:"VikingDB 记忆库项目"},vikingMemoryRegion:{comment:"VikingDB 记忆库地域"},vikingMemoryType:{comment:"记忆类型"},feishuAppId:{comment:"飞书应用 App ID"},feishuAppSecret:{comment:"飞书应用 App Secret",placeholder:"输入 App Secret"},registrySpaceId:{comment:"AgentKit 智能体中心",placeholder:"请选择智能体中心"},registryTopK:{comment:"召回 Agent 数量"},registryRegion:{comment:"AgentKit 智能体中心地域"},registryEndpoint:{comment:"AgentKit 智能体中心 OpenAPI 地址"},agentKitToolId:{comment:"代码执行沙箱 ID"},agentKitToolRegion:{comment:"AgentKit Tools 地域"},openVikingUrl:{comment:"OpenViking 服务地址"},openVikingMemoryUserId:{comment:"记忆归属 ID",help:"对应 viking://user/<此值>/peers/<请求用户>/memories 中的 user 段;用于隔离 Agent、租户或业务场景,默认 default。"},openVikingMemoryPolicy:{comment:"记忆策略",help:"记忆的抽取策略和隔离策略,不填写时使用官方默认策略。"},openVikingKnowledgeUserId:{comment:"知识库归属 ID",help:"未配置资源目录时用于默认路径 viking://user/<此值>/resources/<知识库索引>/,默认 default。"},openVikingTargetUri:{comment:"知识库资源目录",help:"留空时由 KnowledgeBase index 自动生成;填写后直接检索该 OpenViking 资源目录,优先级最高。"},tlsServiceName:{comment:"TLS topic_id,留空自动创建"}}},backends:{shortTerm:{local:{label:"本地内存",description:"进程内,不持久化。适合开发调试。"},sqlite:{label:"SQLite 文件",description:"持久化到本地 .db 文件。"},mysql:{label:"MySQL",description:"持久化到 MySQL。"},postgresql:{label:"PostgreSQL",description:"持久化到 PostgreSQL。"}},longTerm:{local:{label:"本地向量库",description:"进程内 llama-index 向量库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},redis:{label:"Redis",description:"Redis 向量检索。"},viking:{label:"VikingDB Memory",description:"VikingDB 记忆库(支持用户画像)。"},openviking:{label:"OpenViking Memory",description:"OpenViking 长期记忆,按用户维度保存和检索偏好、事件与实体。"},mem0:{label:"Mem0",description:"Mem0 托管记忆服务。"}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB 知识库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},context_search:{label:"Context Search",description:"火山 Context Search 引擎(无需向量化)。"},openviking:{label:"OpenViking Knowledge",description:"OpenViking 资源目录知识库,无需向量化模型配置。"}}},exporters:{apmplus:{label:"APMPlus",description:"火山 APMPlus 应用性能监控。"},cozeloop:{label:"CozeLoop",description:"扣子 CozeLoop 链路观测。"},tls:{label:"TLS (日志服务)",description:"火山 TLS 日志服务导出。"}},knowledge:{title:"知识库",description:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",backend:"知识库后端",vikingDatabase:"VikingDB 知识库"},memory:{shortTerm:"短期记忆",shortTermDescription:"存储单会话上下文",shortTermBackend:"短期记忆后端",longTerm:"长期记忆",longTermDescription:"存储跨会话上下文,通常使用向量化检索",longTermBackend:"长期记忆后端",vikingDatabase:"VikingDB 记忆库",autoSave:"自动保存会话到长期记忆",autoSaveDescription:"会话结束时自动把内容写入长期记忆,无需手动调用。"},mcp:{removeTool:"删除 MCP 工具",namePlaceholder:"名称(可选)",urlPlaceholder:"MCP 服务地址",pathWarning:"此地址未以 /mcp 结尾,请确认它是完整的 MCP 服务地址。",configuredPlaceholder:"已安全保存认证信息",tokenPlaceholder:"Bearer Token(可选)",changedUrlWarning:"MCP 地址已变化,请确认如何处理已保存的认证信息。",reuseCredential:"继续使用",replaceCredential:"替换认证",noAuth:"不使用认证",reuseHint:"发布时将继续使用已保存的认证信息。",changeToReplace:"改为替换",credentialConfigured:"认证信息已由 Studio 安全保存。",removeCredential:"移除认证",commandPlaceholder:"命令,例如 npx",argsPlaceholder:"参数,以空格分隔",stdioHint:"stdio 工具在部署环境中启动,请确保命令和依赖可用。",addTool:"添加 MCP 工具"},resources:{unnamedAgentCenter:"未命名智能体中心",unnamedKnowledgeBase:"未命名知识库",unnamedMemory:"未命名记忆库",loadError:"加载失败",loadingAgentCenters:"正在加载智能体中心…",agentCentersLoaded:"已加载 {{count}} 个智能体中心",noAgentCenters:"暂无智能体中心",noMatchingAgentCenters:"没有匹配的智能体中心",searchAgentKitCenter:"搜索 AgentKit 智能体中心",searchNameOrId:"搜索名称或 ID",selectAgentCenter:"选择智能体中心",selectAgentKitCenter:"选择 AgentKit 智能体中心",selectedAgentCenter:"已选智能体中心",agentKitCenter:"AgentKit 智能体中心",refreshAgentCenters:"刷新智能体中心",knowledgeBaseList:"知识库列表",knowledgeBasePlaceholder:"选择知识库",loadingKnowledgeBases:"正在加载知识库…",knowledgeBasesLoaded:"已加载 {{count}} 个知识库",noKnowledgeBases:"暂无知识库",noMatchingKnowledgeBases:"没有匹配的知识库",searchKnowledgeBase:"搜索知识库",selectKnowledgeBase:"选择知识库",refreshKnowledgeBases:"刷新知识库",memoryList:"记忆库列表",memoryPlaceholder:"选择记忆库",loadingMemories:"正在加载记忆库…",memoriesLoaded:"已加载 {{count}} 个记忆库",noMemories:"暂无记忆库",noMatchingMemories:"没有匹配的记忆库",searchMemory:"搜索记忆库",selectMemory:"选择记忆库",refreshMemories:"刷新记忆库"},env:{noAdditionalParameters:"此后端无需额外运行参数。",invalidJson:"请输入有效的 JSON。",helpAriaLabel:"{{label}}说明:{{help}}",openOpenViking:"打开 OpenViking {{label}}",valuePlaceholder:"请输入参数值",openVikingIndex:"OpenViking 资源索引",openVikingIndexHelp:"默认值:留空;生成项目时使用 Agent 名自动生成,例如 my_agent_kb。未配置 DATABASE_OPENVIKING_TARGET_URI 时,默认 URI 拼接为 viking://user/{知识库归属 ID,未填则 default}/resources/{资源索引}/;如果填写了 DATABASE_OPENVIKING_TARGET_URI,则直接使用该完整 URI。",openVikingIndexAriaLabel:"OpenViking 资源索引说明:{{help}}"},deployment:{vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",apiKeyRequired:"请先选择模型使用的 API Key。",invalidEnvName:"环境变量名称不合法:{{key}}",requiredEnv:"{{name}}:请填写必填环境变量",generatingConfiguration:"正在生成部署配置",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",preparing:"准备部署",complete:"部署完成",failed:"部署失败",updateAndPublish:"更新并发布",stages:{build:"构建镜像",deploy:"部署 Runtime",publish:"发布服务",running:"部署中"}},publish:{generating:"正在生成发布配置",validating:"校验 Agent 结构并准备部署快照…"}},j9e={presets:{support:{name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",subagents:{}},analyst:{name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",subagents:{}},translator:{name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",subagents:{}},coder:{name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",subagents:{}},researcher:{name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",subagents:{}},"research-team":{name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",subagents:{0:{name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。"},1:{name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。"},2:{name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"}}}},tags:{tools:"工具",memory:"记忆",knowledgeBase:"知识库",tracing:"观测",subagents:"子 Agent {{count}}"},gallery:{title:"从模板新建",subtitle:"选择一个预制 Agent 模板,按需微调后即可创建。"},detail:{back:"返回模板列表",name:"名称",systemPrompt:"系统提示词",model:"模型",tools:"工具",memory:"记忆",knowledgeBase:"知识库",tracing:"观测追踪",subagents:"子 Agent({{count}})",create:"使用此模板创建",shortTermMemory:"短期",longTermMemory:"长期"}},srr=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:z9e,codePackage:F9e,common:M9e,default:{common:M9e,yaml:I9e,validation:P9e,defaults:N9e,helpers:B9e,intelligentDeployment:$9e,codePackage:F9e,buildCanvas:z9e,intelligent:U9e,projectLibrary:V9e,modePicker:Q9e,promptEditor:G9e,skills:H9e,workflow:W9e,workbench:Y9e,traditional:q9e,template:j9e},defaults:N9e,helpers:B9e,intelligent:U9e,intelligentDeployment:$9e,modePicker:Q9e,projectLibrary:V9e,promptEditor:G9e,skills:H9e,template:j9e,traditional:q9e,validation:P9e,workbench:Y9e,workflow:W9e,yaml:I9e},Symbol.toStringTag,{value:"Module"})),X9e={backToList:"返回定时任务列表",cancel:"取消",cancelQueue:"取消排队",cancelQueueFirst:"请先取消排队",cancelling:"取消中…",closeDrawer:"关闭抽屉",collapse:"收起",connectingRuntime:"正在连接 Runtime…",createScheduledTask:"创建定时任务",createTask:"创建任务",delete:"删除",deleteTask:"删除任务",edit:"编辑",enable:"启用",expand:"展开",pause:"暂停",refresh:"刷新",refreshHistory:"刷新执行历史",rerun:"重新执行",retry:"重试",runNow:"立即执行",saveChanges:"保存更改",saving:"保存中…",stop:"终止执行",stopRun:"终止本次执行",stopRunFirst:"请先终止当前执行",stopping:"终止中…",viewDetails:"查看详情"},K9e={cancelDescription:"本次 Session 将被取消,后续计划不会暂停。",cancelTitle:"终止本次执行?",deleteDescription:"“{{name}}”及其全部执行历史将被永久删除。",deleteTitle:"删除定时任务?"},Z9e={configuration:"任务配置",nextRun:"下次执行",pageLabel:"定时任务详情",region:"地域",runtime:"运行时",status:"任务状态"},J9e={createTitle:"创建定时任务",description:"每次触发都会为 Runtime Agent 创建独立 Session。",editTitle:"编辑定时任务"},eFe={minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",seconds:"{{count}} 秒"},tFe={cronExpression:"Cron 表达式",cronHelp:"依次填写分钟、小时、日期、月份、星期。",dailyTime:"每天执行时间",enableAfterCreate:"创建后启用",enableHelp:"启用后会从下一个计划时间开始执行。",name:"任务名称",namePlaceholder:"例如:每日生成运营摘要",noRuntime:"暂无可用 Runtime",prompt:"执行文本",promptPlaceholder:"输入每次执行时发送给 Agent 的固定文本",runAt:"执行时间",runtimeAgent:"运行时智能体",runtimeHelp:"任务始终跟随该 Runtime 当前生效版本。",runtimePlaceholder:"选择 Runtime Agent",schedule:"执行计划",scheduleType:"执行计划类型",timezone:"时区",weekday:"星期"},rFe={all:"全部"},nFe={description:"每次运行均使用独立 Session,结果与错误会永久保留。",duration:"耗时 {{duration}}",emptyDescription:"任务触发或立即执行后,记录会显示在这里。",emptyTitle:"暂无执行记录",errorDetails:"错误详情",finalAnswer:"最终回答",loadFailed:"无法加载执行历史",loadFailedDescription:"请检查 Studio 服务后重试。",session:"会话",title:"执行历史"},iFe={cancelRequested:"已提交终止请求。",created:"任务已创建。",deleted:"任务及其执行历史已删除。",enabled:"任务已启用。",paused:"任务已暂停。",queued:"任务已排队,将在一分钟内开始执行。",requeued:"任务已重新排队,将在一分钟内开始执行。",updated:"任务已更新。"},aFe={filterLabel:"定时任务状态筛选",listLabel:"定时任务列表",loadFailed:"无法加载定时任务",loadFailedDescription:"请检查 Studio 服务后重试。",title:"定时任务"},sFe={cron:"Cron {{cron}}{{zone}}",daily:"每天 {{time}}{{zone}}",once:"一次 · {{date}}{{zone}}",weekly:"{{weekday}} {{time}}{{zone}}"},oFe={daily:"每天",once:"一次性",weekly:"每周"},lFe={cancelled:"已取消",enabled:"已启用",failed:"失败",notRun:"尚未执行",paused:"已暂停",pending:"准备中",queued:"已排队",retrying:"自动重试中",running:"执行中",skipped:"已跳过",success:"成功"},cFe={cronFields:"Cron 表达式需要包含 5 个字段,例如 0 9 * * *。",nameRequired:"请输入任务名称。",promptRequired:"请输入每次执行时发送给 Agent 的文本。",runtimeAppMissing:"Runtime Agent 未返回可调用的 appName,请确认 Runtime 已就绪且版本兼容。",runtimeRequired:"请选择可用的 Runtime Agent。",timeRequired:"请选择执行时间。"},uFe={friday:"周五",monday:"周一",saturday:"周六",sunday:"周日",thursday:"周四",tuesday:"周二",wednesday:"周三"},orr=Object.freeze(Object.defineProperty({__proto__:null,actions:X9e,confirm:K9e,default:{actions:X9e,confirm:K9e,detail:Z9e,drawer:J9e,duration:eFe,fields:tFe,filters:rFe,history:nFe,notices:iFe,page:aFe,schedule:sFe,scheduleTypes:oFe,status:lFe,validation:cFe,weekdays:uFe},detail:Z9e,drawer:J9e,duration:eFe,fields:tFe,filters:rFe,history:nFe,notices:iFe,page:aFe,schedule:sFe,scheduleTypes:oFe,status:lFe,validation:cFe,weekdays:uFe},Symbol.toStringTag,{value:"Module"})),hFe="问题反馈",dFe="问题描述",fFe="常见问题",pFe="取消",gFe="完成",mFe="提交反馈",vFe="正在上报…",yFe={title:"上报成功,感谢您的反馈",description:"AgentKit 团队会尽快查看您提交的问题。"},bFe={close:"关闭问题反馈",intro:"请选择遇到的问题,也可以补充具体表现。",privacy:"您的对话数据将会上报到 AgentKit 团队,请注意隐私保护。",descriptionPlaceholder:"请描述问题发生时的表现(选填)",issues:{slow:"执行速度慢",crash:"运行崩溃",incorrect:"结果不准确",tool_error:"工具调用失败",other:"其他问题"}},xFe={description:"告诉我们您在使用 AgentKit Studio 时遇到的问题。",module:"所属模块",modules:{conversation:"对话",agents:"智能体",applications:"自动化",search:"搜索",other:"其他"},commonIssuesMultiple:"常见问题(可多选)",issueTypes:"问题类型",issues:{page_slow:"页面加载慢",feature_unavailable:"功能无法使用",display_error:"页面显示异常",no_response:"操作无响应",other:"其他问题"},descriptionPlaceholder:"请描述问题发生时的页面、操作和表现",quickAdd:"快捷补充",suggestionsLabel:"问题描述推荐",suggestions:{noResponse:"点击后没有反应",loading:"页面一直处于加载状态",incomplete:"部分内容显示不完整",error:"操作后出现错误提示"},privacy:"您的数据将会上报到 AgentKit 团队,请注意隐私保护。"},lrr=Object.freeze(Object.defineProperty({__proto__:null,cancel:pFe,commonIssues:fFe,default:{title:hFe,descriptionLabel:dFe,commonIssues:fFe,cancel:pFe,done:gFe,submit:mFe,submitting:vFe,success:yFe,dialog:bFe,page:xFe},descriptionLabel:dFe,dialog:bFe,done:gFe,page:xFe,submit:mFe,submitting:vFe,success:yFe,title:hFe},Symbol.toStringTag,{value:"Module"})),wFe={back:"返回",close:"关闭"},AFe={title:"优化迁移项目",closeAria:"关闭优化窗口"},TFe={title:"已迁移项目",description:"管理迁移后的源码版本,也可以选择任一版本继续优化。",libraryTitle:"项目与版本",libraryDescription:"查看、下载、部署或对比源码版本,也可以基于任一版本继续优化。",emptyTitle:"还没有已迁移的项目",emptyDescription:"迁移完成后,源码会自动保存在这里。"},SFe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any(通用迁移)"},CFe={awaitingUpload:"待上传",analyzing:"分析中",needsInput:"待补充",analysisReady:"待确认",migrating:"迁移中",validating:"校验中",packaging:"打包中",succeeded:"已完成",succeededWithWarnings:"已完成,有提示",partial:"部分完成",failed:"失败",cancelled:"已终止",expired:"已过期"},OFe={partialReady:"迁移产物已生成,但交付不完整,请查看迁移提示。",readyWithWarnings:"迁移产物已生成,请查看迁移提示。",ready:"迁移产物已生成。"},kFe={passed:"产物校验通过",failed:"产物校验未通过",degraded:"产物校验未完成"},EFe={session:"创建迁移环境",upload:"上传项目",analysis:"分析项目"},_Fe={agentNameRequired:"请输入 Agent 名称",agentNameInvalid:"Agent 名称必须为 1-63 位,只能包含小写字母、数字和连字符,且必须以字母或数字开头和结尾"},RFe={seconds:"{{seconds}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},DFe={savedUnaffected:"已保存项目不受影响",savingUnaffected:"源码正在保存,完成后不受环境期限影响",activeDetail:"到期后任务记录和临时产物将无法访问",oneHour:"临时迁移环境保留 1 小时",ended:"临时迁移环境已结束",savedAvailable:"已保存项目仍可查看、下载、部署或优化",unavailable:"任务记录和临时产物已无法访问",countdown:"临时迁移环境将在 {{minutes}} 分 {{seconds}} 秒后结束",expiredSavedMessage:"临时迁移环境已结束,已保存项目不受影响。",expiredMessage:"临时迁移环境已结束,任务记录和临时产物无法继续访问。"},LFe={recommended:"建议迁移方式",scope:"迁移范围",excluded:"不在本次范围",viewEvidence:"查看分析证据",viewAssumptions:"查看关键假设",viewSourceEvidence:"查看源码证据"},MFe={ariaLabel:"Codex 执行动态",title:"Codex 执行动态",startingAnalysis:"Codex 正在开始分析…",startingMigration:"Codex 正在开始迁移…",loadError:"暂时无法读取 Codex 执行动态,不影响当前任务。"},IFe={title:"迁移产物",fileTooLarge:"该文件超过 2 MiB,请下载完整产物后查看。",unsupportedPreview:"该文件不支持在线预览,请下载完整产物后查看。",filesAria:"迁移产物文件",searchAria:"搜索产物文件",searchPlaceholder:"搜索文件",limit:"仅展示前 {{count}} 项,请搜索具体文件。",noSelection:"未选择文件",noPreview:"暂无可预览文件。",loadingFile:"正在读取产物文件…",startupFile:"启动文件",fileCountLabel:"文件数",saved:"源码已保存,可继续查看、下载、部署或优化。",saving:"产物已生成,正在保存源码版本。",deployReady:"产物可预览、下载和部署,正在等待源码保存状态。",deployUnavailable:"产物可预览和下载,但当前交付状态不支持部署。",viewProjects:"查看已迁移项目",downloading:"下载中…",downloadZip:"下载 ZIP",deployTitle:"部署迁移产物",deployUnavailableTitle:"当前交付状态不支持部署",deployRuntime:"部署到 Runtime",fileCount:"{{count}} 个文件",startup:"启动文件 {{module}}",loading:"正在读取迁移产物…"},PFe={retiring:"即将下线",currentDefault:"当前默认模型",loadError:"加载模型列表失败",label:"模型",placeholder:"选择模型"},NFe={zipOnly:"请选择 .zip 格式的本地项目文件。",invalidName:"ZIP 文件名无效,请重命名后重新选择。",tooLarge:"项目 ZIP 不能超过 {{size}}。",empty:"项目 ZIP 不能为空。",removeAria:"移除项目 ZIP",reselectPrompt:"重新选择项目 ZIP",selectPrompt:"选择或拖入本地项目 ZIP",reselect:"重新选择",selectZip:"选择 ZIP",continue:"继续上传",start:"开始迁移",inputAria:"选择本地项目 ZIP",retention:"临时迁移环境从创建完成起保留 1 小时;保存成功的源码版本不受影响。"},BFe={requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}",notReady:"迁移产物尚未准备完成。",back:"返回迁移结果"},$Fe={backToAddAgent:"返回添加 Agent",title:"从存量迁移",newMigration:"新建迁移",recent:"最近迁移",sessionsAria:"迁移会话",loadingSessions:"正在读取迁移会话…",noSessions:"暂无迁移会话",heading:"迁移存量 Agent 项目",intro:"上传本地项目 ZIP,Codex 将先进行只读分析,再由你确认迁移方式。"},FFe={stop:"终止迁移",stopping:"正在终止…",reload:"重新读取",refreshStatus:"刷新状态"},zFe={unavailable:"迁移能力暂不可用",defaultReason:"Dev Sandbox 暂不可用,请联系管理员检查配置。"},UFe={requestZip:"请提供本地项目 ZIP。上传后我会识别框架、入口和迁移边界,并在执行实际迁移前请你确认迁移方式。",zipHint:"仅支持本地 ZIP,最大 {{size}};迁移环境从创建起保留 1 小时。",creatingSandbox:"正在创建 Dev Sandbox",initializing:"正在初始化迁移工作目录,并检查 AgentKit CLI、Codex 和迁移能力。环境就绪后将自动上传项目。",elapsed:"已等待 {{duration}}",uploadThenAnalyze:"ZIP 上传完成后将自动开始只读分析。",analyzing:"Codex 正在识别框架、入口和迁移边界,不会执行实际迁移。",migrationLocked:"迁移执行中不能修改附件或迁移方式。你可以等待当前任务结束,或主动终止。",analysisPaused:"只读分析已暂停。请仅回答下面列出的问题,提交后会在同一迁移环境中重新分析,不会开始实际迁移。",analysisComplete:"只读分析已完成。请检查建议,并确认最终迁移方式。",awaitingUpload:"迁移环境已创建,请重新选择本地 ZIP 继续上传。",expiredTitle:"迁移环境已过期",expiredDescription:"迁移内容和产物已无法预览、下载或部署。如已完成 Runtime 部署,可返回智能体页面继续使用。",unsupportedTitle:"当前 ZIP 暂时无法迁移",unsupportedHint:"请按提示整理项目后,新建迁移并重新上传。",failedTitle:"迁移未完成",cancelled:"当前迁移已终止。你可以新建迁移并重新上传项目。"},VFe={ariaLabel:"补充项目分析信息",title:"补充分析所需信息",description:"附件保持锁定,提交后仅继续只读分析",submitting:"正在继续分析…",submit:"提交并继续分析"},QFe={ariaLabel:"确认迁移方式",title:"确认迁移方式",description:"确认后才会执行实际迁移",framework:"迁移方式",frameworkPlaceholder:"选择迁移方式",agentName:"Agent 名称",entry:"项目入口",entryPlaceholder:"选择项目入口",entryExample:"例如 agent.py:agent",consent:"点击“确认并开始迁移”即确认上述迁移范围、排除项和关键假设。",starting:"正在启动迁移…",start:"确认并开始迁移"},GFe={closeAria:"关闭错误提示",loadFailed:"无法读取迁移数据,请重试。",refreshFailed:"无法刷新迁移状态,请重试。"},HFe={title:"终止当前迁移?",description:"终止后,当前分析或迁移进程将停止,已执行的步骤不会继续。"},crr=Object.freeze(Object.defineProperty({__proto__:null,actions:FFe,activity:MFe,analysis:LFe,artifact:IFe,capability:zFe,common:wFe,confirmation:QFe,conversation:UFe,default:{common:wFe,optimization:AFe,projects:TFe,framework:SFe,state:CFe,task:OFe,verification:kFe,transfer:EFe,validation:_Fe,duration:RFe,expiry:DFe,analysis:LFe,activity:MFe,artifact:IFe,model:PFe,upload:NFe,deployment:BFe,workspace:$Fe,actions:FFe,capability:zFe,conversation:UFe,questions:VFe,confirmation:QFe,errors:GFe,stopDialog:HFe},deployment:BFe,duration:RFe,errors:GFe,expiry:DFe,framework:SFe,model:PFe,optimization:AFe,projects:TFe,questions:VFe,state:CFe,stopDialog:HFe,task:OFe,transfer:EFe,upload:NFe,validation:_Fe,verification:kFe,workspace:$Fe},Symbol.toStringTag,{value:"Module"})),WFe={loading:"加载中…",searchLabel:"搜索{{label}}",searchPlaceholder:"搜索{{label}}",retry:"重试",noMatches:"没有匹配项",noOptions:"暂无可选项",selection:"{{label}}:{{value}}"},YFe={badge:"焕然一新",view:"查看新特性",title:"本次更新",defaultNotes:{multiRegion:"多地域智能体:并行加载北京与上海 Runtime,列表下滑即可继续加载。",switchAgent:"会话内切换:在输入框旁选择智能体,并直接开启一段新会话。",visualCanvas:"可视化执行画布:通过横向画布查看多智能体结构,并支持全屏浏览。"}},qFe={label:"新会话模式",agent:"智能体",skill:"技能定制",video:"视频创作"},jFe={select:"选择新会话模式",agent:{label:"Agent",description:"与当前选择的 Agent 对话"},builtin:{label:"内置智能体",description:"使用平台提供的智能体"},codex:{label:"Codex 智能体",description:"在沙箱中执行任务"},deepseekHarness:{label:"DeepSeek Harness",description:"打开 DeepSeek Harness 工作区"},arkClaw:"ArkClaw",hermes:"Hermes 智能体",checking:"正在检查配置",notConfigured:"管理员未配置",unavailable:"暂不可用"},XFe={select:"选择智能体",typesLabel:"智能体类型",listLabel:"{{type}}列表",types:{agent:"智能体",general:"通用智能体",codex:"Codex 智能体",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw 智能体",hermes:"Hermes 智能体"},loading:"正在加载智能体",reload:"重新加载",empty:"暂无{{type}}",emptyLocal:"暂无本地智能体",emptyGeneral:"暂无通用智能体",createHint:"请前往智能体页创建",localHint:"请检查当前 Studio 启动目录",waking:"正在唤醒",opening:"正在打开",connecting:"正在连接",loadingMore:"加载中",loadMore:"加载更多",runtimeTimeout:"加载智能体超时(15 秒),请检查网络或 Runtime 服务后重试",loadGeneral:"加载通用智能体",loadType:"加载 {{type}}",connectGeneral:"连接通用智能体",openLocal:"打开本地智能体",openType:"打开 {{type}}"},KFe={spaceAria:"技能空间",configuration:"技能定制配置",actions:{create:"技能生成",optimize:"技能优化"},selectAction:"选择技能定制方式",actionList:"技能定制方式",style:"风格",selectStyle:"选择风格",model:"模型",selectModel:"选择模型",styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先"},modelLoadFailed:"模型配置加载失败",spaceLoadFailed:"Skill Space 加载失败",skillLoadFailed:"Skill 加载失败",unnamedSpace:"未命名 Skill Space",space:"技能空间",select:"选择 Skill",selectAria:"选择 Skill:{{skill}}",loadingSpaces:"正在加载 Skill Space",reload:"重新加载",emptySpaces:"暂无 Skill Space",skillList:"{{space}} Skill 列表",loadingSkills:"正在加载 Skill",emptySkills:"暂无 Skill"},ZFe={modes:{auto:"自动识别",text_to_video:"文生视频",reference_to_video:"参考素材生视频",video_editing:"视频编辑",video_extension:"视频续写",first_last_frame:"首尾帧生成"},taskNames:{auto:"视频生成",text_to_video:"文生视频",reference_to_video:"参考素材生视频",video_editing:"视频编辑",video_extension:"视频续写",first_last_frame:"首尾帧生成"},controls:{label:"视频创作配置",aspectRatio:"比例",selectAspectRatio:"选择比例",resolution:"清晰度",selectResolution:"选择清晰度",duration:"时长",durationShort:"{{count}} 秒",durationAria:"视频时长:{{count}} 秒",lastFrame:"尾帧",lastFrameHelper:"添加视频结束画面",assistImage:"辅助图片",referenceImage:"参考图片",assistImageHelper:"用于补充画面参考",imageHelper:"支持常见图片格式",referenceVideo:"参考视频",videoHelper:"支持常见视频格式",optional:"可选",replace:"更换",add:"添加",upload:"上传{{label}}",replaceFile:"更换{{label}}:{{name}}",removeFile:"移除{{label}} {{name}}",storageUnavailable:"管理员未配置持久化存储",loadingEnhancer:"正在加载增强模型",enhancerHint:"使用 {{model}} 模型进行意图识别和提示词增强",enhancerUnavailable:"增强模型不可用"},task:{title:"视频生成任务",closeAria:"关闭视频生成任务弹窗",progressAria:"视频生成进度",optimizedPrompt:"优化后的提示词",processingAria:"{{task}}处理进度",waitingAria:"{{status}},已等待{{elapsed}}",elapsed:"已等待 {{elapsed}}",previewAria:"生成结果预览",close:"关闭",download:"下载视频",retryOptimization:"重试提示词优化",retryGeneration:"重试视频生成",providerQueued:"等待模型调度",providerRunning:"模型生成中",providerSubmitting:"正在提交任务",queuedHint:"任务已提交,模型开始处理后状态会自动更新",runningHint:"这可能持续数分钟,完成后将在这里显示视频预览",backgroundHint:"可以关闭弹窗,任务会继续在后台运行",successHint:"视频已生成,可预览或下载",activationHint:"请先在模型控制台开通服务,再重试生成",retryHint:"修正问题后可重试当前步骤",steps:{optimizationFailed:"提示词优化失败",optimizationDone:"提示词优化完成",optimizationActive:"提示词优化中",generationDone:"{{task}}已完成",generationFailed:"{{task}}失败",generationQueued:"{{task}}排队中",generationRunning:"{{task}}生成中",generationActive:"{{task}}进行中",generationPending:"等待视频生成",generationComplete:"视频生成完成"},elapsedHours:"{{hours}}小时{{minutes}}分",elapsedMinutes:"{{minutes}}分{{seconds}}秒",elapsedSeconds:"{{seconds}}秒"}},urr=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:XFe,compactSelect:WFe,default:{compactSelect:WFe,featureNotice:YFe,workspace:qFe,mode:jFe,agentPicker:XFe,skill:KFe,video:ZFe},featureNotice:YFe,mode:jFe,skill:KFe,video:ZFe,workspace:qFe},Symbol.toStringTag,{value:"Module"})),JFe={cancel:"取消",close:"关闭",retry:"重试",tryAgain:"重新尝试",closeDialog:"关闭{{title}}",agentFallback:"{{agent}} 智能体",unknownSource:"未知来源"},eze={terminalTitle:"终端",browserTitle:"沙箱浏览器",terminalSubtitle:"连接当前 AgentKit Session 的交互式终端",browserSubtitle:"在当前 AgentKit Session 中查看与操作浏览器",connecting:"正在连接…",connected:"已连接",notConnected:"尚未连接",opening:"正在打开 {{title}}",connectingSession:"工具正在连接当前 AgentKit Session。",openFailed:"{{title}} 打开失败"},tze={title:"恢复 Codex 对话",subtitle:"选择当前 Sandbox Session 中最近更新的 Thread",loading:"正在读取历史对话",loadFailed:"历史对话读取失败",empty:"暂无可恢复的对话"},rze={title:"Codex 权限",subtitle:"设置会保存到当前 Sandbox Session,并同步到其中的所有 Thread",sandboxMode:"沙箱模式",approvalPolicy:"审批策略",approvalMethod:"审批方式",networkAccess:"允许网络访问",networkAccessHelp:"控制 workspace-write 与只读模式中的外部网络访问。",fullAccessWarning:"完全访问会关闭文件系统与网络隔离,请只在可信任务中使用。",save:"保存权限",sandboxChoices:{readOnly:{label:"只读",detail:"允许读取文件,不允许写入工作空间。"},workspaceWrite:{label:"工作区写入",detail:"允许在当前工作空间内读取与修改文件。"},fullAccess:{label:"完全访问",detail:"不启用沙箱隔离,适合明确可信的任务。"}},approvalChoices:{untrusted:{label:"仅不可信命令",detail:"只对 Codex 判断为不可信的操作发起审批。"},onRequest:{label:"按需审批",detail:"Codex 可在必要时请求你确认命令或文件修改。"},never:{label:"不审批",detail:"Codex 不会暂停并请求人工批准。"}},reviewerChoices:{user:{label:"由我审批",detail:"审批请求会显示在 Studio 中,由你决定。"},autoReview:{label:"自动审查",detail:"使用 Codex 自动审查流程处理审批请求。"}}},nze={title:"工作空间",subtitle:"选择当前 Codex Thread 执行命令与修改文件的目录",absolutePath:"绝对路径",browse:"浏览",parent:"上一级",empty:"当前目录没有子目录",locked:"当前对话已经开始,工作空间已锁定。新建 Sandbox 会话后可重新选择。",useDirectory:"使用此目录"},ize={fileTitle:"允许修改文件?",commandTitle:"允许执行命令?",subtitle:"Codex 正在等待你的决定",workingDirectory:"执行目录",decline:"拒绝",acceptOnce:"仅本次允许",acceptSession:"本会话允许"},aze={availableSkills:"可用 Skills",selectModel:"选择模型",commands:"Codex 快捷命令",currentModel:"当前:{{model}}",loadingSkills:"正在发现当前工作区的 Skills…",loadingModels:"正在读取模型…",noSkillMatches:"当前工作区没有匹配的 Skill",noModelMatches:"没有匹配模型,也可以直接输入模型 ID",noCommandMatches:"没有匹配的快捷命令",skillFallback:"加载并执行该 Skill",add:"添加",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",openTerminal:"进入终端",viewBrowser:"查看浏览器",permissions:"Codex 权限",workspaceLocked:"对话已开始,工作空间已锁定",selectWorkspace:"选择工作空间",workspace:"Codex 工作空间",endpointCopied:"Endpoint 已复制",copyEndpoint:"复制 Sandbox Endpoint",continuePlaceholder:"继续说明你想实现或调整的内容",messagePlaceholder:"向 AgentKit 沙箱发送消息,输入 / 查看命令,输入 $ 调用 Skill…",stop:"停止生成",send:"发送"},sze={defaultName:"我的智能体",namedDefault:"我的 {{agent}}",creatingTitle:"正在创建 {{agent}} 智能体",failedTitle:"启动失败",createTitle:"创建 {{agent}} 智能体",fallbackError:"AgentKit 沙箱初始化失败,请稍后重新尝试。",creatingDescription:"正在创建并等待 {{agent}} 智能体就绪,这通常需要半分钟",name:"智能体名称",storageSize:"存储大小",storageHelp:"数据将持久化保存,可设置 {{min}}–{{max}} GiB。",persistent:"持久化",persistenceUnsupported:"当前环境不支持快照持久化",persistentHelp:"保留智能体数据,后续可继续使用。",temporaryHelp:"智能体将在 8 小时后清空",cancelCreation:"取消创建",confirm:"确认创建",retry:"重新尝试"},oze={activeAria:"Codex 智能体会话已开启",openAria:"开启 Codex 智能体会话",active:"Codex 智能体会话中",entry:"灵光一现",exit:"退出当前智能体",expired:"已到期",remainingHours:"剩余 {{hours}} 小时 {{minutes}} 分钟",remainingMinutes:"剩余 {{minutes}} 分钟",expiryWarning:"远端开发环境最长保留 8 小时,将于 {{expiry}} 到期({{remaining}});到期后清除对话和文件。",usingAgent:"当前您在使用 {{agent}} 智能体",activityAria:"Sandbox 操作记录",activity:"操作记录",tokenUsageAria:"Codex Token 用量",tokens:"{{label}}:{{value}} tokens",tokenLabels:{total:"总计",input:"输入",cachedInput:"缓存输入",output:"输出",reasoningOutput:"推理输出"}},lze={back:"返回智能体列表",subtitle:"{{agent}} AgentKit Session 详情",type:"智能体类型",status:"状态",createdBy:"创建人",snapshotStatus:"快照状态",toolType:"工具类型",createdAt:"创建时间",snapshotReason:"快照原因",expiresAt:"过期时间",snapshotId:"快照 ID",sessionId:"会话 ID",sourceSessionId:"来源 Session ID",delete:"删除智能体",waking:"唤醒中…",opening:"打开中…",wake:"唤醒智能体",open:"打开智能体",deleteTitle:"删除智能体?",deleteDescription:"将删除“{{name}}”及其 AgentKit {{resource}},此操作无法撤销。",deleting:"删除中…",confirmDelete:"确认删除"},cze={back:"返回智能体列表",createdBy:"创建人 {{creator}}",ariaLabel:"智能体工作区",main:"主界面",terminal:"终端",mainTitle:"{{agent}} 主界面",openingTerminal:"正在打开终端…",terminalTitle:"{{agent}} 终端"},uze={prompt:`使用 AgentKit Studio Plugin 端云接力当前会话、项目和任务。请直接执行,不要让我手动打开终端。 +- 保持礼貌、专业的语气。`},B9e={requestFailed:"请求失败 ({{status}}){{detail}}",a2aSpaces:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 AgentKit 智能体中心",loginRequired:"请先登录以访问 AgentKit 智能体中心"},vikingKnowledge:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 知识库",loginRequired:"请先登录以访问 VikingDB 知识库"},vikingMemory:{credentialsMissing:"服务端未配置云厂商 AK/SK,无法访问 VikingDB 记忆库",loginRequired:"请先登录以访问 VikingDB 记忆库"},mcpGateway:{missingHttpTool:"请返回“添加 MCP 工具”并添加至少一个 HTTP MCP 服务;MCP 稳定性治理不支持 stdio 服务。",missingUrl:"已添加的 HTTP MCP 工具缺少有效服务地址,请返回“添加 MCP 工具”补充后再发布。"},customModel:{fallbackName:"自定义模型",apiKeyLabel:"{{name}} 模型 API Key"},deploymentEnv:{serverInjected:"由服务端注入",selectedApiKeyPlaceholder:"由所选 API Key 注入",mcpInjectedComment:"由已添加的 MCP 工具注入",restoredPlaceholder:"由 Studio 服务端安全恢复",generatedMcpPlaceholder:"由已添加的 HTTP MCP 工具自动生成",restoredHelp:"更新时由 Studio 服务端合并 MCP 地址与认证,不向浏览器返回旧密钥。",mergedMcpHelp:"Studio 服务端自动合并 MCP 地址与可选认证,不向浏览器返回旧密钥。",listSeparator:"、",requirementHint:"优化项“{{labels}}”依赖此配置。",requiredBy:"优化项“{{labels}}”依赖此配置,请填写 {{key}}。",required:"请填写 {{label}}({{key}})。",invalidJson:"JSON 格式不正确"},drafts:{unsupportedVersion:"本机草稿版本暂不受支持,请升级 Studio 后重试。",invalidFormat:"本机草稿数据格式无效。",readFailed:"无法读取本机草稿,浏览器中的草稿数据可能已损坏。",quotaExceeded:"浏览器存储空间不足,草稿未保存。请删除不需要的草稿或清理此站点的浏览器存储后重试。",writeRejected:"浏览器拒绝保存草稿,请检查站点存储权限后重试。"},skills:{searchFailed:"搜索失败 ({{status}})",downloadFailed:"下载技能失败 ({{status}})",agentKitRequestFailed:"AgentKit Skills 请求失败",missingManifest:"{{location}} 缺少 SKILL.md",invalidParentPath:"{{location}} 包含非法路径(..):{{path}}",invalidPath:"{{location}} 包含非法路径:{{path}}",localDescription:"本地 Skill",folderSource:"文件夹",noManifest:"{{location}} 中未发现 SKILL.md"},zip:{invalid:"无效的 zip:找不到 EOCD",tooManyFiles:"zip 文件数不能超过 {{count}} 个",tooLarge:"zip 解压后的内容过大"}},$9e={back:"返回开发会话",runtimeName:"Runtime 名称",runtimeNameExists:"Runtime 名称已存在,请更换后重试",checkingRuntimeName:"正在检查 Runtime 名称",verifiedSource:"已验证源码",deployableSource:"可部署源码",verifiedByCodex:"已通过 Codex 云端验证",entryPoint:"入口",files:"文件",artifact:"构建产物",validationReport:"验证报告",verifiedHint:"源码由服务端从已验证交付物物化,浏览器文件不能替换。",unverifiedHint:"源码已由服务端安全物化,部署前请确认 Runtime 配置。",env:{requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}"}},F9e={name:"代码包",back:"返回创建方式",reading:"正在读取代码包",readingEllipsis:"正在读取代码包…",uploadFirst:"请先上传代码包",uploadAriaLabel:"代码包上传",upload:"上传代码包",reupload:"重新上传代码包",uploadPrompt:"请上传代码包",filesRecognized:"已识别 {{count}} 个文件,点击区域可重新上传",dropHint:"点击或拖拽上传,支持 .zip 格式,最大 50 MB;可使用 app.py,或由 agentkit.yaml 声明入口",viewFiles:"查看文件",chooseFile:"选择代码包",errors:{invalidFormat:"请选择 .zip 格式的代码包。",tooLarge:"代码包不能超过 50 MB。",invalidPath:"压缩包包含非法路径:{{name}}",empty:"压缩包中没有可部署的文件。",tooManyFiles:"代码包文件数不能超过 {{count}} 个。",duplicateFile:"代码包包含重复文件:{{path}}",manifestParse:"agentkit.yaml 无法解析:{{detail}}",manifestRoot:"agentkit.yaml 根节点必须是对象。",manifestCommon:"agentkit.yaml 的 common 必须是对象。",entryPointType:"agentkit.yaml 的 common.entry_point 必须是文件路径。",entryPointInvalid:"agentkit.yaml 的 common.entry_point 不是有效文件路径。",entryPointMissing:"代码包中不存在 agentkit.yaml 声明的启动入口:{{entryPoint}}",defaultEntryPointMissing:"代码包根目录必须包含 app.py,或在 agentkit.yaml 的 common.entry_point 中声明已有入口。"}},z9e={label:"Agent 执行画布",readOnlyLabel:"只读 Agent 执行画布",minimapLabel:"执行流程缩略图",controls:{ariaLabel:"执行流程控制",zoomIn:"放大",zoomOut:"缩小",fitView:"适应视图"},rootAgent:"主 Agent",unnamedStep:"未命名步骤",terminals:{input:"用户请求",output:"最终回复"},edges:{then:"然后",continueLoop:"继续循环",call:"调用"},patterns:{llm:{label:"智能体",description:"理解任务并直接完成一个具体工作"},sequential:{label:"分步协作",description:"内部步骤按照顺序依次执行"},parallel:{label:"同时处理",description:"内部步骤同时工作,完成后统一汇总"},loop:{label:"循环执行",description:"重复执行内部步骤,直到满足停止条件"},a2a:{label:"远程智能体",description:"调用已经存在的远程 Agent"}},actions:{insertHere:"在这里插入步骤",deleteNamed:"删除 {{name}}",deleteNode:"删除节点",addSubagent:"添加子 Agent",addParallelStep:"添加一个同时处理的步骤",addLoopStep:"添加循环步骤",addNextStep:"添加下一个步骤",addFirst:"添加到最前",addLast:"添加到最后"}},U9e={title:"智能模式",subtitle:"描述目标后,沙箱中的 Codex 会判断你的意图,完成构建、调试和临时云端验证。",model:{label:"模型",placeholder:"选择模型",retiring:"即将下线",currentConfiguration:"当前配置",loadError:"加载模型列表失败"},availability:{checking:"正在检查智能开发能力…",unavailable:"当前无法使用智能模式,请返回后重试。"},goal:{title:"从目标开始",continueTitle:"继续优化项目",hint:"只需说明 Agent 要解决的问题;如有影响结果的关键信息,会在开始前向你确认。",continueHint:"说明这次要调整的内容,完成后会保存为新版本。",basedOn:"基于",clearSelection:"取消选择",label:"目标描述",optimizationLabel:"优化目标",placeholder:"例如:创建一个能读取销售数据、生成周报并校验输出格式的 Agent",optimizationPlaceholder:"例如:增加数据来源标注,并在信息不足时先向用户确认"},actions:{preparing:"准备中…",build:"开始构建",optimize:"开始优化"},preparation:{accepted:"目标已收到,马上开始实现",preparing:"正在创建任务环境…",starting:"环境已就绪,正在启动 Codex…",next:"接下来会先梳理目标和实现方式,再编写、运行和验证 Agent。"}},V9e={title:"已保存项目",description:"选择已有版本继续优化,或查看、下载和部署源码。",refresh:"刷新项目列表",checkingStorage:"正在检查项目存储…",unavailableTitle:"暂时无法读取项目",storageCheckError:"无法确认项目存储状态,请稍后重试。",storageNotConfigured:"项目存储尚未配置。",loadingMigrated:"正在读取已迁移项目…",loadingSaved:"正在读取已保存项目…",loadingVersions:"正在读取项目版本…",unknownTime:"时间未知",sourceDownloaded:"源码已下载。",projectSummary_one:"{{count}} 个版本 · 更新于 {{time}}",projectSummary_other:"{{count}} 个版本 · 更新于 {{time}}",versionSummary_one:"{{time}} · {{count}} 个文件",versionSummary_other:"{{time}} · {{count}} 个文件",noVersionDescription:"暂无版本描述",latestVersion:"最新版本",verified:"已验证",pendingVerification:"待确认",viewSource:"查看源码",download:"下载",downloading:"下载中…",optimize:"去优化",optimizeUnavailable:"去优化,暂不支持",errors:{projects:"无法读取已保存项目。",source:"无法读取项目源码。",versions:"无法读取项目版本。",download:"下载源码失败。",prepareDeployment:"无法准备部署源码。",deleteVersion:"删除项目版本失败。",migrated:"无法读取已迁移项目",saved:"无法读取已保存项目"},empty:{migratedTitle:"还没有已迁移的项目",savedTitle:"还没有已保存的项目",migratedDescription:"完成首次迁移后,源码会自动保存在这里。",savedDescription:"完成首次构建后,源码会自动保存在这里。",noVersions:"这个项目还没有可用版本。"},compare:{selected:"已选择 {{count}}/2",selectedLabel:"已选择",select:"选择",view:"查看对比",start:"对比版本"},delete:{title:"删除这个版本?",onlyVersion:"“{{name}}”只有这一个版本,删除后项目也会移除。此操作无法撤销。",description:"该版本的源码和验证记录将永久删除,其他版本不受影响。",confirm:"删除版本"}},Q9e={title:"选择创建方式",subtitle:"以不同模式构建您的智能体",features:"特性",quick:{title:"快速模式",description:"动态派生子智能体自主完成任务",features:{dynamicSubagents:"动态派生子智能体",autonomousPlanning:"自主规划执行",collaboration:"多智能体协作",summary:"自动汇总结果",skills:"按需调用技能",trace:"任务过程可追踪"}},traditional:{title:"传统模式",description:"高度自定义您的智能体结构",features:{visualConfig:"可视化配置",migration:"存量智能体迁移",debugging:"实时调试",optimization:"可选性能优化",parameters:"精细参数控制"}}},G9e={placeholder:"输入系统提示词;键入 ## 加空格可创建二级标题…",toolbar:{undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",paragraph:"正文",quote:"引用",heading:"标题 {{level}}",selectBlockType:"选择文本类型",blockType:"文本类型",bold:"加粗",removeBold:"取消加粗",italic:"斜体",removeItalic:"取消斜体",bulletedList:"无序列表",numberedList:"有序列表"}},H9e={local:{duplicatesSkipped:"已跳过重复技能:{{names}}",invalidDrop:"请拖入包含 SKILL.md 的文件夹或一个 .zip 文件",readError:"读取失败:{{detail}}",dropLabel:"拖入文件夹或 ZIP,自动识别 Skill",hint:"每个技能需包含 SKILL.md。支持包含多个技能的目录。",reading:"正在读取文件…",fileCount:"本地 · {{count}} 个文件"},hub:{searchError:"搜索失败,请稍后重试。",searchPlaceholder:"搜索火山 Find Skill 技能广场,例如 数据分析、PDF…",search:"搜索",searching:"正在搜索…",noResults:"没有找到匹配的技能,换个关键词试试。",hint:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"},space:{loadError:"加载失败",loadingSpaces:"正在加载 AgentKit Skills 中心…",noSpaces:"此账号下没有 AgentKit Skills 中心。",selectSpace:"选择 AgentKit Skills 中心",openConsole:"在火山引擎控制台打开",loadingSkills:"正在加载技能列表…",noSkills:"此 AgentKit Skills 中心暂无技能。"}},W9e={unnamedNode:"未命名节点",editInstruction:"点击编辑指令…",controls:{ariaLabel:"工作流画布控制",zoomIn:"放大",zoomOut:"缩小",fitView:"适应视图"},sections:{info:"工作流信息",execution:"执行方式",nodes:"节点",nodeConfig:"节点配置"},types:{sequential:{label:"顺序",description:"节点依次执行"},parallel:{label:"并行",description:"节点同时执行"},loop:{label:"循环",description:"节点循环执行"}},placeholders:{description:"这个工作流做什么…",agentDescription:"这个 Agent 做什么…",instruction:"你是一个…"},errors:{workflowNameUnique:"名称须与 Agent 节点名称保持唯一",agentNameUnique:"Agent 名称在当前工作流中必须唯一"},dragHint:"拖拽到画布,或点击下方按钮添加",agentNode:"Agent 节点",addNode:"添加节点",connectHint:"拖拽节点的圆点连线以表达执行顺序。",create:"创建工作流",deleteNode:"删除节点",nameHelp:"仅使用英文字母、数字和下划线,且名称保持唯一。",instruction:"指令 (instruction)",tools:"工具 (逗号分隔)",nodeId:"节点 ID",empty:{selectNode:"选择一个节点以编辑其配置",summary:"共 {{nodes}} 个节点 · {{edges}} 条连线"}},Y9e={ariaLabel:"快速模式创建",progress:"快速模式创建进度",steps:{agent:{label:"智能体",title:"基本信息",description:"设置智能体的名称、用途、行为方式与能力"},environment:{label:"执行环境",title:"配置执行环境",description:"选择默认环境或已构建的自定义环境"},deployment:{label:"部署偏好",title:"部署偏好",description:"定义 AgentKit 云上参数"}},model:{label:"模型",source:"模型来源",name:"模型名称",provider:"服务商 Provider",volcengineArk:"火山方舟",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",currentApiKey:"当前 API Key",loadingApiKeys:"正在加载 API Key",selectApiKey:"选择 API Key",searchApiKeys:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",loadingModels:"正在加载模型",selectModel:"选择模型",searchModels:"搜索名称、Model ID 或服务商",noModels:"没有可用的模型",apiKeyPlaceholder:"请输入模型 API Key",credentialsLoadError:"模型凭据加载失败",modelsLoadError:"模型列表加载失败"},identity:{unnamedPool:"未命名用户池",currentPool:"{{value}}(当前用户池)",userPool:"用户池",loading:"正在加载用户池",placeholder:"请选择用户池",search:"搜索用户池",empty:"当前账号下暂无 Identity 用户池",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime",selectionHint:"当前 Studio 使用的用户池已在列表中标注"},agent:{namePlaceholder:"输入智能体名称",descriptionPlaceholder:"说明这个智能体可以做什么",prompt:"提示词",promptPlaceholder:"定义角色、目标和行为边界",skills:"技能",addSkill:"添加技能"},validation:{descriptionRequired:"请输入描述",promptRequired:"请输入提示词",modelRequired:"请选择模型",instanceIntegers:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数",instanceOrder:"最小实例数不能大于最大实例数",userPoolRequired:"请选择用于 Runtime 鉴权的用户池"},deployment:{runtimeName:"Runtime 名称",runtimeNameUpdateHint:"更新时保持现有 Runtime 名称不变",runtimeNameHint:"仅支持英文字母、数字、下划线和连字符",region:"发布区域",authentication:"鉴权方式",apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPoolDescription:"使用 Identity 用户池签发的 JWT",sessionStorage:"会话存储",inMemoryStorage:"In-memory 临时存储",backends:{sqlite:"SQLite 文件",mysql:"MySQL",postgresql:"PostgreSQL"},instances:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",inMemoryHint:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",networkMode:"网络模式",network:{public:"公网",private:"私网",both:"公网与私网"},subnetIds:"子网 ID(可选,多个用逗号分隔)",sharedInternet:"VPC 内共享公网出口",sharedInternetHint:"允许私网 Runtime 通过共享出口访问公网",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",evaluationSetsHint:"部署成功后自动创建 Good Case 和 Bad Case 评测集",resources:"资源配置",complete:"部署已完成",preparing:"正在准备部署…"},environmentVariables:{title:"环境变量",add:"添加变量",nameAriaLabel:"环境变量名称",valueAriaLabel:"{{name}} 的值",deleteNamed:"删除 {{name}}"},actions:{updateAgain:"再次更新",deployAgain:"重新部署",updateAndPublish:"更新并发布"}},q9e={actions:{addSubagent:"添加子 Agent",clearRoot:"清空根 Agent",clearRootConfirmation:"清空根 Agent 的全部配置和子 Agent?此操作无法撤销。"},workspace:{progress:"Agent 创建进度",modes:{build:"架构",validate:"调试",optimize:"优化",environment:"环境",publish:"发布"},titles:{build:"个性化您的智能体架构",validate:"调试您的智能体",optimize:"为您的智能体选择优化项",environment:"配置云上环境",publish:"准备好部署您的智能体"}},sections:{type:{label:"Agent 类型",hint:"选择 Agent 类型"},basic:{label:"基本信息",hint:"名称、描述与系统提示词"},model:{label:"模型配置",hint:"模型与服务(可选)"},tools:{label:"工具",hint:"可调用的能力"},skills:{label:"技能",hint:"声明式技能"},knowledge:{label:"知识库",hint:"外部知识检索"},memory:{label:"记忆",hint:"短期与长期记忆"},subagents:{label:"子 Agent",hint:"嵌套协作"},review:{label:"完成",hint:"预览并创建"}},agentTypes:{ariaLabel:"Agent 类型",remoteChildOnly:"远程智能体只能作为子步骤使用",llm:{label:"智能体",fullLabel:"LLM 智能体",description:"大模型驱动,自主完成任务"},sequential:{label:"分步协作",fullLabel:"顺序型智能体",description:"子 Agent 按顺序依次执行"},parallel:{label:"同时处理",fullLabel:"并行型智能体",description:"子 Agent 并行执行后汇总"},loop:{label:"循环执行",fullLabel:"循环型智能体",description:"子 Agent 循环执行到满足条件"},a2a:{label:"远程智能体",fullLabel:"远程 Agent",description:"通过 A2A 协议调用远程 Agent"}},basic:{agentName:"Agent 名称",name:"名称",agentDescription:"智能体描述",descriptionPlaceholder:"简要描述这个 Agent 的用途,便于团队识别…",nameHelp:"遵循 Google ADK 命名规则,且在执行流程中保持唯一。",rootDescriptionHelp:"完整描述会保留;部署时会自动整理为符合 Runtime 规范的单行描述。",descriptionHelp:"描述会显示在 Agent 列表与选择器中。",orchestratorHelp:"这是一个协作容器,本身不生成回答。请在左侧画布中添加任务步骤,并通过拖拽调整它们的位置。",maxIterations:"最大轮次",maxIterationsHelp:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。",agentCenter:"AgentKit 智能体中心",agentCenterHelp:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。系统会根据每轮任务动态发现并挂载匹配的 Agent。",moreOptions:"更多选项",systemPrompt:"系统提示词",loadingMarkdown:"正在加载 Markdown 编辑器…",markdownHelp:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。",unnamed:"未命名",unnamedAgent:"未命名智能体"},validation:{remoteRoot:"远程 Agent 只能作为子 Agent",missingRegistry:"请选择 AgentKit 智能体中心",name:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},duplicateName:"Agent 名称在当前结构中必须唯一",missingDescription:"描述为必填项",mcpAuthRequired:"MCP 地址变化后需要确认认证方式",mcpDuplicateName:"MCP 名称重复,请为每个服务使用唯一名称",mcpDuplicateUrl:"MCP 地址重复,请删除重复服务后再发布",missingSubagent:"缺少子 Agent",missingPrompt:"系统提示词为必填项",missingSubagentDetail:"{{type}}至少需要添加一个子 Agent 后才能调试或发布。",problem:"{{name}}:{{problem}}"},ai:{ariaLabel:"AI 自动填写 Agent 配置",minimumLength:"请至少输入 {{count}} 个字符。",replaceConfirmation:"生成的新配置会替换当前画布和属性,确定继续吗?",placeholder:"描述目标,使用 {{model}} 模型一键生成配置",generate:"智能生成",generating:"正在智能生成",success:"生成成功",regenerate:"重新生成",failed:"智能生成失败"},debug:{ariaLabel:"智能体调试工作区",unavailable:"当前后端暂不支持生成 Agent 调试运行。",baseline:"基准组",comparison:"对照组 {{count}}",selectModel:"请选择模型",enterDescription:"请输入描述",enterPrompt:"请输入系统提示词",duplicateConfiguration:"测试配置不能重复",starting:"启动中…",applyAndRestart:"应用并重启",restart:"重新启动",start:"启动环境",defaultModel:"默认模型",testConfiguration:"测试配置",deleteVariant:"删除 {{name}}",deleteVariantGroup:"删除对照组",creatingEnvironment:"正在创建测试环境…",configurationChanged:"配置已变更,请重新启动环境。",ready:"环境已就绪",readyHint:"发送消息以比较智能体回复。",startHint:"先完善配置,再启动环境。",viewTraceNamed:"查看 {{name}} 的调用链路",traceUnavailable:"发送消息后可查看调用链路",trace:"调用链路",useConfiguration:"使用此配置",finishConfiguration:"完成配置",finishAndStart:"完成并启动",currentAgentModel:"当前 Agent 模型",configurationHint:"修改仅用于本次对比,选择使用后才会进入部署流程。",messagePlaceholder:"向已启动的测试环境发送消息…",startOneFirst:"请先启动至少一个测试环境",addVariant:"添加对照组",traceTitle:"调用链路 · {{name}}",leaveTitle:"离开调试?",leaveDescription:"离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。",cleaning:"清理中…",confirmLeave:"确定离开",closeLeaveConfirmation:"关闭离开调试确认"},optimization:{ariaLabel:"智能体优化选项",scenario:"优化场景",components:"优化组件",bytePlusUnavailable:"BytePlus 账号暂不支持 Harness Sidecar 优化项。请保持优化项为空后继续部署,普通 BytePlus 智能体不受影响。",releaseScenario:"优化场景:{{profile}}",profiles:{default:{label:"自定义",description:"按需选择组件,不勾选时不启动 Sidecar。"},ops:{label:"运维场景",description:"适用于运维诊断、数据库、日志和监控 MCP。"}},groups:{quality:"提升回答质量",cost:"降低运行成本",stability:"增强运行稳定性"},options:{context_engine:{label:"上下文治理",description:"治理上下文组装、任务锚定和上下文预算。"},compressor:{label:"上下文与结果压缩",description:"压缩长上下文和大型工具结果,降低 Token 成本。"},verifier:{label:"回答校验与修复",description:"校验证据和回答,在失败时执行修复或告警。"},long_run_control:{label:"Goal 任务控制",description:"管理 Goal 任务的进度、续跑和结束条件。"},mcp_resilience:{label:"MCP 稳定性治理",description:"治理连接、超时、空结果、大返回和调用预算;默认包含 SQL 只读保护。"}}},model:{label:"模型",source:"模型来源",volcanoArk:"火山方舟",volcengineArk:"火山方舟",bytePlusModelArk:"BytePlus ModelArk",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",configuration:"模型配置",name:"模型名称",provider:"服务商 Provider",liteLlmProviders:"LiteLLM 支持列表",apiKeyPlaceholder:"请输入模型 API Key",available:"已开通",retiring:"即将下线",notActivated:"未开通",unavailable:"暂不可用",apiKeyLoadError:"加载 Ark API Key 失败",loadingApiKeys:"正在加载 API Key…",selectApiKey:"选择 API Key",currentApiKey:"当前 API Key",apiKeyList:"API Key 列表",searchApiKey:"搜索 API Key",searchApiKeyName:"搜索 API Key 名称",noApiKeys:"暂无可用 API Key",noMatchingApiKey:"没有匹配的 API Key",loading:"正在加载模型…",loaded:"已加载 {{count}} 个模型",loadError:"加载模型失败",selectModel:"选择模型",selectProviderModel:"选择服务商模型",providerModels:"服务商模型",search:"搜索模型",searchPlaceholder:"搜索名称、Model ID 或服务商",noMatches:"没有匹配的模型",empty:"暂无可用模型",unknownStatus:"未知状态",refresh:"刷新",refreshing:"刷新中…",activate:"开通",activateAction:"前往开通",currentConfiguration:"当前配置"},tools:{builtIn:"内置工具",builtInHelp:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。",codeExecution:"代码执行配置",codeExecutionHelp:"指定 AgentKit 代码执行沙箱。",mcp:"MCP 工具"},catalog:{web_search:{label:"联网搜索",description:"火山引擎 Web Search,获取实时信息。"},parallel_web_search:{label:"并行联网搜索",description:"并行发起多条搜索查询,更快汇总。"},link_reader:{label:"网页读取",description:"抓取并阅读给定链接的正文内容。"},web_scraper:{label:"网页爬取",description:"结构化爬取网页(需要 Scraper 服务)。"},image_generate:{label:"图像生成",description:"文生图(Doubao Seedream)。"},image_edit:{label:"图像编辑",description:"图生图 / 编辑(Doubao SeedEdit)。"},video_generate:{label:"视频生成",description:"文/图生视频(Doubao Seedance),含任务查询。"},text_to_speech:{label:"语音合成 (TTS)",description:"把文本转成语音(火山语音)。"},run_code:{label:"代码执行",description:"在沙箱中执行代码。"},vesearch:{label:"VeSearch 智能搜索",description:"火山 VeSearch(需要 bot 端点)。"},links:{console:"控制台",documentation:"文档"},env:{modelAgentName:{comment:"模型名称"},embeddingModelName:{comment:"向量化模型(记忆/知识库需要)"},vikingMemoryProject:{comment:"VikingDB 记忆库项目"},vikingMemoryRegion:{comment:"VikingDB 记忆库地域"},vikingMemoryType:{comment:"记忆类型"},feishuAppId:{comment:"飞书应用 App ID"},feishuAppSecret:{comment:"飞书应用 App Secret",placeholder:"输入 App Secret"},registrySpaceId:{comment:"AgentKit 智能体中心",placeholder:"请选择智能体中心"},registryTopK:{comment:"召回 Agent 数量"},registryRegion:{comment:"AgentKit 智能体中心地域"},registryEndpoint:{comment:"AgentKit 智能体中心 OpenAPI 地址"},agentKitToolId:{comment:"代码执行沙箱 ID"},agentKitToolRegion:{comment:"AgentKit Tools 地域"},openVikingUrl:{comment:"OpenViking 服务地址"},openVikingMemoryUserId:{comment:"记忆归属 ID",help:"对应 viking://user/<此值>/peers/<请求用户>/memories 中的 user 段;用于隔离 Agent、租户或业务场景,默认 default。"},openVikingMemoryPolicy:{comment:"记忆策略",help:"记忆的抽取策略和隔离策略,不填写时使用官方默认策略。"},openVikingKnowledgeUserId:{comment:"知识库归属 ID",help:"未配置资源目录时用于默认路径 viking://user/<此值>/resources/<知识库索引>/,默认 default。"},openVikingTargetUri:{comment:"知识库资源目录",help:"留空时由 KnowledgeBase index 自动生成;填写后直接检索该 OpenViking 资源目录,优先级最高。"},tlsServiceName:{comment:"TLS topic_id,留空自动创建"}}},backends:{shortTerm:{local:{label:"本地内存",description:"进程内,不持久化。适合开发调试。"},sqlite:{label:"SQLite 文件",description:"持久化到本地 .db 文件。"},mysql:{label:"MySQL",description:"持久化到 MySQL。"},postgresql:{label:"PostgreSQL",description:"持久化到 PostgreSQL。"}},longTerm:{local:{label:"本地向量库",description:"进程内 llama-index 向量库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},redis:{label:"Redis",description:"Redis 向量检索。"},viking:{label:"VikingDB Memory",description:"VikingDB 记忆库(支持用户画像)。"},openviking:{label:"OpenViking Memory",description:"OpenViking 长期记忆,按用户维度保存和检索偏好、事件与实体。"},mem0:{label:"Mem0",description:"Mem0 托管记忆服务。"}},knowledge:{viking:{label:"VikingDB Knowledge",description:"VikingDB 知识库。"},opensearch:{label:"OpenSearch",description:"OpenSearch 向量检索。"},context_search:{label:"Context Search",description:"火山 Context Search 引擎(无需向量化)。"},openviking:{label:"OpenViking Knowledge",description:"OpenViking 资源目录知识库,无需向量化模型配置。"}}},exporters:{apmplus:{label:"APMPlus",description:"火山 APMPlus 应用性能监控。"},cozeloop:{label:"CozeLoop",description:"扣子 CozeLoop 链路观测。"},tls:{label:"TLS (日志服务)",description:"火山 TLS 日志服务导出。"}},knowledge:{title:"知识库",description:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",backend:"知识库后端",vikingDatabase:"VikingDB 知识库"},memory:{shortTerm:"短期记忆",shortTermDescription:"存储单会话上下文",shortTermBackend:"短期记忆后端",longTerm:"长期记忆",longTermDescription:"存储跨会话上下文,通常使用向量化检索",longTermBackend:"长期记忆后端",vikingDatabase:"VikingDB 记忆库",autoSave:"自动保存会话到长期记忆",autoSaveDescription:"会话结束时自动把内容写入长期记忆,无需手动调用。"},mcp:{removeTool:"删除 MCP 工具",namePlaceholder:"名称(可选)",urlPlaceholder:"MCP 服务地址",pathWarning:"此地址未以 /mcp 结尾,请确认它是完整的 MCP 服务地址。",configuredPlaceholder:"已安全保存认证信息",tokenPlaceholder:"Bearer Token(可选)",changedUrlWarning:"MCP 地址已变化,请确认如何处理已保存的认证信息。",reuseCredential:"继续使用",replaceCredential:"替换认证",noAuth:"不使用认证",reuseHint:"发布时将继续使用已保存的认证信息。",changeToReplace:"改为替换",credentialConfigured:"认证信息已由 Studio 安全保存。",removeCredential:"移除认证",commandPlaceholder:"命令,例如 npx",argsPlaceholder:"参数,以空格分隔",stdioHint:"stdio 工具在部署环境中启动,请确保命令和依赖可用。",addTool:"添加 MCP 工具"},resources:{unnamedAgentCenter:"未命名智能体中心",unnamedKnowledgeBase:"未命名知识库",unnamedMemory:"未命名记忆库",loadError:"加载失败",loadingAgentCenters:"正在加载智能体中心…",agentCentersLoaded:"已加载 {{count}} 个智能体中心",noAgentCenters:"暂无智能体中心",noMatchingAgentCenters:"没有匹配的智能体中心",searchAgentKitCenter:"搜索 AgentKit 智能体中心",searchNameOrId:"搜索名称或 ID",selectAgentCenter:"选择智能体中心",selectAgentKitCenter:"选择 AgentKit 智能体中心",selectedAgentCenter:"已选智能体中心",agentKitCenter:"AgentKit 智能体中心",refreshAgentCenters:"刷新智能体中心",knowledgeBaseList:"知识库列表",knowledgeBasePlaceholder:"选择知识库",loadingKnowledgeBases:"正在加载知识库…",knowledgeBasesLoaded:"已加载 {{count}} 个知识库",noKnowledgeBases:"暂无知识库",noMatchingKnowledgeBases:"没有匹配的知识库",searchKnowledgeBase:"搜索知识库",selectKnowledgeBase:"选择知识库",refreshKnowledgeBases:"刷新知识库",memoryList:"记忆库列表",memoryPlaceholder:"选择记忆库",loadingMemories:"正在加载记忆库…",memoriesLoaded:"已加载 {{count}} 个记忆库",noMemories:"暂无记忆库",noMatchingMemories:"没有匹配的记忆库",searchMemory:"搜索记忆库",selectMemory:"选择记忆库",refreshMemories:"刷新记忆库"},env:{noAdditionalParameters:"此后端无需额外运行参数。",invalidJson:"请输入有效的 JSON。",helpAriaLabel:"{{label}}说明:{{help}}",openOpenViking:"打开 OpenViking {{label}}",valuePlaceholder:"请输入参数值",openVikingIndex:"OpenViking 资源索引",openVikingIndexHelp:"默认值:留空;生成项目时使用 Agent 名自动生成,例如 my_agent_kb。未配置 DATABASE_OPENVIKING_TARGET_URI 时,默认 URI 拼接为 viking://user/{知识库归属 ID,未填则 default}/resources/{资源索引}/;如果填写了 DATABASE_OPENVIKING_TARGET_URI,则直接使用该完整 URI。",openVikingIndexAriaLabel:"OpenViking 资源索引说明:{{help}}"},deployment:{vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",apiKeyRequired:"请先选择模型使用的 API Key。",invalidEnvName:"环境变量名称不合法:{{key}}",requiredEnv:"{{name}}:请填写必填环境变量",generatingConfiguration:"正在生成部署配置",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",preparing:"准备部署",complete:"部署完成",failed:"部署失败",updateAndPublish:"更新并发布",stages:{build:"构建镜像",deploy:"部署 Runtime",publish:"发布服务",running:"部署中"}},publish:{generating:"正在生成发布配置",validating:"校验 Agent 结构并准备部署快照…"}},j9e={presets:{support:{name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",subagents:{}},analyst:{name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",subagents:{}},translator:{name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",subagents:{}},coder:{name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",subagents:{}},researcher:{name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",subagents:{}},"research-team":{name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",subagents:{0:{name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。"},1:{name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。"},2:{name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"}}}},tags:{tools:"工具",memory:"记忆",knowledgeBase:"知识库",tracing:"观测",subagents:"子 Agent {{count}}"},gallery:{title:"从模板新建",subtitle:"选择一个预制 Agent 模板,按需微调后即可创建。"},detail:{back:"返回模板列表",name:"名称",systemPrompt:"系统提示词",model:"模型",tools:"工具",memory:"记忆",knowledgeBase:"知识库",tracing:"观测追踪",subagents:"子 Agent({{count}})",create:"使用此模板创建",shortTermMemory:"短期",longTermMemory:"长期"}},srr=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:z9e,codePackage:F9e,common:M9e,default:{common:M9e,yaml:I9e,validation:P9e,defaults:N9e,helpers:B9e,intelligentDeployment:$9e,codePackage:F9e,buildCanvas:z9e,intelligent:U9e,projectLibrary:V9e,modePicker:Q9e,promptEditor:G9e,skills:H9e,workflow:W9e,workbench:Y9e,traditional:q9e,template:j9e},defaults:N9e,helpers:B9e,intelligent:U9e,intelligentDeployment:$9e,modePicker:Q9e,projectLibrary:V9e,promptEditor:G9e,skills:H9e,template:j9e,traditional:q9e,validation:P9e,workbench:Y9e,workflow:W9e,yaml:I9e},Symbol.toStringTag,{value:"Module"})),X9e={backToList:"返回定时任务列表",cancel:"取消",cancelQueue:"取消排队",cancelQueueFirst:"请先取消排队",cancelling:"取消中…",closeDrawer:"关闭抽屉",collapse:"收起",connectingRuntime:"正在连接 Runtime…",createScheduledTask:"创建定时任务",createTask:"创建任务",delete:"删除",deleteTask:"删除任务",edit:"编辑",enable:"启用",expand:"展开",pause:"暂停",refresh:"刷新",refreshHistory:"刷新执行历史",rerun:"重新执行",retry:"重试",runNow:"立即执行",saveChanges:"保存更改",saving:"保存中…",stop:"终止执行",stopRun:"终止本次执行",stopRunFirst:"请先终止当前执行",stopping:"终止中…",viewDetails:"查看详情"},K9e={cancelDescription:"本次 Session 将被取消,后续计划不会暂停。",cancelTitle:"终止本次执行?",deleteDescription:"“{{name}}”及其全部执行历史将被永久删除。",deleteTitle:"删除定时任务?"},Z9e={configuration:"任务配置",nextRun:"下次执行",pageLabel:"定时任务详情",region:"地域",runtime:"运行时",status:"任务状态"},J9e={createTitle:"创建定时任务",description:"每次触发都会为 Runtime Agent 创建独立 Session。",editTitle:"编辑定时任务"},eFe={minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",seconds:"{{count}} 秒"},tFe={cronExpression:"Cron 表达式",cronHelp:"依次填写分钟、小时、日期、月份、星期。",dailyTime:"每天执行时间",enableAfterCreate:"创建后启用",enableHelp:"启用后会从下一个计划时间开始执行。",name:"任务名称",namePlaceholder:"例如:每日生成运营摘要",noRuntime:"暂无可用 Runtime",prompt:"执行文本",promptPlaceholder:"输入每次执行时发送给 Agent 的固定文本",runAt:"执行时间",runtimeAgent:"运行时智能体",runtimeHelp:"任务始终跟随该 Runtime 当前生效版本。",runtimePlaceholder:"选择 Runtime Agent",schedule:"执行计划",scheduleType:"执行计划类型",timezone:"时区",weekday:"星期"},rFe={all:"全部"},nFe={description:"每次运行均使用独立 Session,结果与错误会永久保留。",duration:"耗时 {{duration}}",emptyDescription:"任务触发或立即执行后,记录会显示在这里。",emptyTitle:"暂无执行记录",errorDetails:"错误详情",finalAnswer:"最终回答",loadFailed:"无法加载执行历史",loadFailedDescription:"请检查 Studio 服务后重试。",session:"会话",title:"执行历史"},iFe={cancelRequested:"已提交终止请求。",created:"任务已创建。",deleted:"任务及其执行历史已删除。",enabled:"任务已启用。",paused:"任务已暂停。",queued:"任务已排队,将在一分钟内开始执行。",requeued:"任务已重新排队,将在一分钟内开始执行。",updated:"任务已更新。"},aFe={filterLabel:"定时任务状态筛选",listLabel:"定时任务列表",loadFailed:"无法加载定时任务",loadFailedDescription:"请检查 Studio 服务后重试。",title:"定时任务"},sFe={cron:"Cron {{cron}}{{zone}}",daily:"每天 {{time}}{{zone}}",once:"一次 · {{date}}{{zone}}",weekly:"{{weekday}} {{time}}{{zone}}"},oFe={daily:"每天",once:"一次性",weekly:"每周"},lFe={cancelled:"已取消",enabled:"已启用",failed:"失败",notRun:"尚未执行",paused:"已暂停",pending:"准备中",queued:"已排队",retrying:"自动重试中",running:"执行中",skipped:"已跳过",success:"成功"},cFe={cronFields:"Cron 表达式需要包含 5 个字段,例如 0 9 * * *。",nameRequired:"请输入任务名称。",promptRequired:"请输入每次执行时发送给 Agent 的文本。",runtimeAppMissing:"Runtime Agent 未返回可调用的 appName,请确认 Runtime 已就绪且版本兼容。",runtimeRequired:"请选择可用的 Runtime Agent。",timeRequired:"请选择执行时间。"},uFe={friday:"周五",monday:"周一",saturday:"周六",sunday:"周日",thursday:"周四",tuesday:"周二",wednesday:"周三"},orr=Object.freeze(Object.defineProperty({__proto__:null,actions:X9e,confirm:K9e,default:{actions:X9e,confirm:K9e,detail:Z9e,drawer:J9e,duration:eFe,fields:tFe,filters:rFe,history:nFe,notices:iFe,page:aFe,schedule:sFe,scheduleTypes:oFe,status:lFe,validation:cFe,weekdays:uFe},detail:Z9e,drawer:J9e,duration:eFe,fields:tFe,filters:rFe,history:nFe,notices:iFe,page:aFe,schedule:sFe,scheduleTypes:oFe,status:lFe,validation:cFe,weekdays:uFe},Symbol.toStringTag,{value:"Module"})),hFe="问题反馈",dFe="问题描述",fFe="常见问题",pFe="取消",gFe="完成",mFe="提交反馈",vFe="正在上报…",yFe={title:"上报成功,感谢您的反馈",description:"AgentKit 团队会尽快查看您提交的问题。"},bFe={close:"关闭问题反馈",intro:"请选择遇到的问题,也可以补充具体表现。",privacy:"您的对话数据将会上报到 AgentKit 团队,请注意隐私保护。",descriptionPlaceholder:"请描述问题发生时的表现(选填)",issues:{slow:"执行速度慢",crash:"运行崩溃",incorrect:"结果不准确",tool_error:"工具调用失败",other:"其他问题"}},xFe={description:"告诉我们您在使用 AgentKit Studio 时遇到的问题。",module:"所属模块",modules:{conversation:"对话",agents:"智能体",applications:"自动化",search:"搜索",other:"其他"},commonIssuesMultiple:"常见问题(可多选)",issueTypes:"问题类型",issues:{page_slow:"页面加载慢",feature_unavailable:"功能无法使用",display_error:"页面显示异常",no_response:"操作无响应",other:"其他问题"},descriptionPlaceholder:"请描述问题发生时的页面、操作和表现",quickAdd:"快捷补充",suggestionsLabel:"问题描述推荐",suggestions:{noResponse:"点击后没有反应",loading:"页面一直处于加载状态",incomplete:"部分内容显示不完整",error:"操作后出现错误提示"},privacy:"您的数据将会上报到 AgentKit 团队,请注意隐私保护。"},lrr=Object.freeze(Object.defineProperty({__proto__:null,cancel:pFe,commonIssues:fFe,default:{title:hFe,descriptionLabel:dFe,commonIssues:fFe,cancel:pFe,done:gFe,submit:mFe,submitting:vFe,success:yFe,dialog:bFe,page:xFe},descriptionLabel:dFe,dialog:bFe,done:gFe,page:xFe,submit:mFe,submitting:vFe,success:yFe,title:hFe},Symbol.toStringTag,{value:"Module"})),wFe={back:"返回",close:"关闭"},AFe={title:"优化迁移项目",closeAria:"关闭优化窗口"},SFe={title:"已迁移项目",description:"管理迁移后的源码版本,也可以选择任一版本继续优化。",libraryTitle:"项目与版本",libraryDescription:"查看、下载、部署或对比源码版本,也可以基于任一版本继续优化。",emptyTitle:"还没有已迁移的项目",emptyDescription:"迁移完成后,源码会自动保存在这里。"},TFe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any(通用迁移)"},CFe={awaitingUpload:"待上传",analyzing:"分析中",needsInput:"待补充",analysisReady:"待确认",migrating:"迁移中",validating:"校验中",packaging:"打包中",succeeded:"已完成",succeededWithWarnings:"已完成,有提示",partial:"部分完成",failed:"失败",cancelled:"已终止",expired:"已过期"},OFe={partialReady:"迁移产物已生成,但交付不完整,请查看迁移提示。",readyWithWarnings:"迁移产物已生成,请查看迁移提示。",ready:"迁移产物已生成。"},kFe={passed:"产物校验通过",failed:"产物校验未通过",degraded:"产物校验未完成"},EFe={session:"创建迁移环境",upload:"上传项目",analysis:"分析项目"},_Fe={agentNameRequired:"请输入 Agent 名称",agentNameInvalid:"Agent 名称必须为 1-63 位,只能包含小写字母、数字和连字符,且必须以字母或数字开头和结尾"},RFe={seconds:"{{seconds}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},DFe={savedUnaffected:"已保存项目不受影响",savingUnaffected:"源码正在保存,完成后不受环境期限影响",activeDetail:"到期后任务记录和临时产物将无法访问",oneHour:"临时迁移环境保留 1 小时",ended:"临时迁移环境已结束",savedAvailable:"已保存项目仍可查看、下载、部署或优化",unavailable:"任务记录和临时产物已无法访问",countdown:"临时迁移环境将在 {{minutes}} 分 {{seconds}} 秒后结束",expiredSavedMessage:"临时迁移环境已结束,已保存项目不受影响。",expiredMessage:"临时迁移环境已结束,任务记录和临时产物无法继续访问。"},LFe={recommended:"建议迁移方式",scope:"迁移范围",excluded:"不在本次范围",viewEvidence:"查看分析证据",viewAssumptions:"查看关键假设",viewSourceEvidence:"查看源码证据"},MFe={ariaLabel:"Codex 执行动态",title:"Codex 执行动态",startingAnalysis:"Codex 正在开始分析…",startingMigration:"Codex 正在开始迁移…",loadError:"暂时无法读取 Codex 执行动态,不影响当前任务。"},IFe={title:"迁移产物",fileTooLarge:"该文件超过 2 MiB,请下载完整产物后查看。",unsupportedPreview:"该文件不支持在线预览,请下载完整产物后查看。",filesAria:"迁移产物文件",searchAria:"搜索产物文件",searchPlaceholder:"搜索文件",limit:"仅展示前 {{count}} 项,请搜索具体文件。",noSelection:"未选择文件",noPreview:"暂无可预览文件。",loadingFile:"正在读取产物文件…",startupFile:"启动文件",fileCountLabel:"文件数",saved:"源码已保存,可继续查看、下载、部署或优化。",saving:"产物已生成,正在保存源码版本。",deployReady:"产物可预览、下载和部署,正在等待源码保存状态。",deployUnavailable:"产物可预览和下载,但当前交付状态不支持部署。",viewProjects:"查看已迁移项目",downloading:"下载中…",downloadZip:"下载 ZIP",deployTitle:"部署迁移产物",deployUnavailableTitle:"当前交付状态不支持部署",deployRuntime:"部署到 Runtime",fileCount:"{{count}} 个文件",startup:"启动文件 {{module}}",loading:"正在读取迁移产物…"},PFe={retiring:"即将下线",currentDefault:"当前默认模型",loadError:"加载模型列表失败",label:"模型",placeholder:"选择模型"},NFe={zipOnly:"请选择 .zip 格式的本地项目文件。",invalidName:"ZIP 文件名无效,请重命名后重新选择。",tooLarge:"项目 ZIP 不能超过 {{size}}。",empty:"项目 ZIP 不能为空。",removeAria:"移除项目 ZIP",reselectPrompt:"重新选择项目 ZIP",selectPrompt:"选择或拖入本地项目 ZIP",reselect:"重新选择",selectZip:"选择 ZIP",continue:"继续上传",start:"开始迁移",inputAria:"选择本地项目 ZIP",retention:"临时迁移环境从创建完成起保留 1 小时;保存成功的源码版本不受影响。"},BFe={requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}",notReady:"迁移产物尚未准备完成。",back:"返回迁移结果"},$Fe={backToAddAgent:"返回添加 Agent",title:"从存量迁移",newMigration:"新建迁移",recent:"最近迁移",sessionsAria:"迁移会话",loadingSessions:"正在读取迁移会话…",noSessions:"暂无迁移会话",heading:"迁移存量 Agent 项目",intro:"上传本地项目 ZIP,Codex 将先进行只读分析,再由你确认迁移方式。"},FFe={stop:"终止迁移",stopping:"正在终止…",reload:"重新读取",refreshStatus:"刷新状态"},zFe={unavailable:"迁移能力暂不可用",defaultReason:"Dev Sandbox 暂不可用,请联系管理员检查配置。"},UFe={requestZip:"请提供本地项目 ZIP。上传后我会识别框架、入口和迁移边界,并在执行实际迁移前请你确认迁移方式。",zipHint:"仅支持本地 ZIP,最大 {{size}};迁移环境从创建起保留 1 小时。",creatingSandbox:"正在创建 Dev Sandbox",initializing:"正在初始化迁移工作目录,并检查 AgentKit CLI、Codex 和迁移能力。环境就绪后将自动上传项目。",elapsed:"已等待 {{duration}}",uploadThenAnalyze:"ZIP 上传完成后将自动开始只读分析。",analyzing:"Codex 正在识别框架、入口和迁移边界,不会执行实际迁移。",migrationLocked:"迁移执行中不能修改附件或迁移方式。你可以等待当前任务结束,或主动终止。",analysisPaused:"只读分析已暂停。请仅回答下面列出的问题,提交后会在同一迁移环境中重新分析,不会开始实际迁移。",analysisComplete:"只读分析已完成。请检查建议,并确认最终迁移方式。",awaitingUpload:"迁移环境已创建,请重新选择本地 ZIP 继续上传。",expiredTitle:"迁移环境已过期",expiredDescription:"迁移内容和产物已无法预览、下载或部署。如已完成 Runtime 部署,可返回智能体页面继续使用。",unsupportedTitle:"当前 ZIP 暂时无法迁移",unsupportedHint:"请按提示整理项目后,新建迁移并重新上传。",failedTitle:"迁移未完成",cancelled:"当前迁移已终止。你可以新建迁移并重新上传项目。"},VFe={ariaLabel:"补充项目分析信息",title:"补充分析所需信息",description:"附件保持锁定,提交后仅继续只读分析",submitting:"正在继续分析…",submit:"提交并继续分析"},QFe={ariaLabel:"确认迁移方式",title:"确认迁移方式",description:"确认后才会执行实际迁移",framework:"迁移方式",frameworkPlaceholder:"选择迁移方式",agentName:"Agent 名称",entry:"项目入口",entryPlaceholder:"选择项目入口",entryExample:"例如 agent.py:agent",consent:"点击“确认并开始迁移”即确认上述迁移范围、排除项和关键假设。",starting:"正在启动迁移…",start:"确认并开始迁移"},GFe={closeAria:"关闭错误提示",loadFailed:"无法读取迁移数据,请重试。",refreshFailed:"无法刷新迁移状态,请重试。"},HFe={title:"终止当前迁移?",description:"终止后,当前分析或迁移进程将停止,已执行的步骤不会继续。"},crr=Object.freeze(Object.defineProperty({__proto__:null,actions:FFe,activity:MFe,analysis:LFe,artifact:IFe,capability:zFe,common:wFe,confirmation:QFe,conversation:UFe,default:{common:wFe,optimization:AFe,projects:SFe,framework:TFe,state:CFe,task:OFe,verification:kFe,transfer:EFe,validation:_Fe,duration:RFe,expiry:DFe,analysis:LFe,activity:MFe,artifact:IFe,model:PFe,upload:NFe,deployment:BFe,workspace:$Fe,actions:FFe,capability:zFe,conversation:UFe,questions:VFe,confirmation:QFe,errors:GFe,stopDialog:HFe},deployment:BFe,duration:RFe,errors:GFe,expiry:DFe,framework:TFe,model:PFe,optimization:AFe,projects:SFe,questions:VFe,state:CFe,stopDialog:HFe,task:OFe,transfer:EFe,upload:NFe,validation:_Fe,verification:kFe,workspace:$Fe},Symbol.toStringTag,{value:"Module"})),WFe={loading:"加载中…",searchLabel:"搜索{{label}}",searchPlaceholder:"搜索{{label}}",retry:"重试",noMatches:"没有匹配项",noOptions:"暂无可选项",selection:"{{label}}:{{value}}"},YFe={badge:"焕然一新",view:"查看新特性",title:"本次更新",defaultNotes:{multiRegion:"多地域智能体:并行加载北京与上海 Runtime,列表下滑即可继续加载。",switchAgent:"会话内切换:在输入框旁选择智能体,并直接开启一段新会话。",visualCanvas:"可视化执行画布:通过横向画布查看多智能体结构,并支持全屏浏览。"}},qFe={label:"新会话模式",agent:"智能体",skill:"技能定制",video:"视频创作"},jFe={select:"选择新会话模式",agent:{label:"Agent",description:"与当前选择的 Agent 对话"},builtin:{label:"内置智能体",description:"使用平台提供的智能体"},codex:{label:"Codex 智能体",description:"在沙箱中执行任务"},deepseekHarness:{label:"DeepSeek Harness",description:"打开 DeepSeek Harness 工作区"},arkClaw:"ArkClaw",hermes:"Hermes 智能体",checking:"正在检查配置",notConfigured:"管理员未配置",unavailable:"暂不可用"},XFe={recoveryPaused:"部分历史智能体多次恢复失败,已暂停自动恢复。",restoringHistory:"部分历史智能体正在恢复,恢复后将自动显示。",select:"选择智能体",typesLabel:"智能体类型",listLabel:"{{type}}列表",types:{agent:"智能体",general:"通用智能体",codex:"Codex 智能体",deepseekHarness:"DeepSeek Harness",openclaw:"OpenClaw 智能体",hermes:"Hermes 智能体"},loading:"正在加载智能体",reload:"重新加载",empty:"暂无{{type}}",emptyLocal:"暂无本地智能体",emptyGeneral:"暂无通用智能体",createHint:"请前往智能体页创建",localHint:"请检查当前 Studio 启动目录",waking:"正在唤醒",opening:"正在打开",connecting:"正在连接",loadingMore:"加载中",loadMore:"加载更多",runtimeTimeout:"加载智能体超时(15 秒),请检查网络或 Runtime 服务后重试",loadGeneral:"加载通用智能体",loadType:"加载 {{type}}",connectGeneral:"连接通用智能体",openLocal:"打开本地智能体",openType:"打开 {{type}}"},KFe={spaceAria:"技能空间",configuration:"技能定制配置",actions:{create:"技能生成",optimize:"技能优化"},selectAction:"选择技能定制方式",actionList:"技能定制方式",style:"风格",selectStyle:"选择风格",model:"模型",selectModel:"选择模型",styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先"},modelLoadFailed:"模型配置加载失败",spaceLoadFailed:"Skill Space 加载失败",skillLoadFailed:"Skill 加载失败",unnamedSpace:"未命名 Skill Space",space:"技能空间",select:"选择 Skill",selectAria:"选择 Skill:{{skill}}",loadingSpaces:"正在加载 Skill Space",reload:"重新加载",emptySpaces:"暂无 Skill Space",skillList:"{{space}} Skill 列表",loadingSkills:"正在加载 Skill",emptySkills:"暂无 Skill"},ZFe={modes:{auto:"自动识别",text_to_video:"文生视频",reference_to_video:"参考素材生视频",video_editing:"视频编辑",video_extension:"视频续写",first_last_frame:"首尾帧生成"},taskNames:{auto:"视频生成",text_to_video:"文生视频",reference_to_video:"参考素材生视频",video_editing:"视频编辑",video_extension:"视频续写",first_last_frame:"首尾帧生成"},controls:{label:"视频创作配置",aspectRatio:"比例",selectAspectRatio:"选择比例",resolution:"清晰度",selectResolution:"选择清晰度",duration:"时长",durationShort:"{{count}} 秒",durationAria:"视频时长:{{count}} 秒",lastFrame:"尾帧",lastFrameHelper:"添加视频结束画面",assistImage:"辅助图片",referenceImage:"参考图片",assistImageHelper:"用于补充画面参考",imageHelper:"支持常见图片格式",referenceVideo:"参考视频",videoHelper:"支持常见视频格式",optional:"可选",replace:"更换",add:"添加",upload:"上传{{label}}",replaceFile:"更换{{label}}:{{name}}",removeFile:"移除{{label}} {{name}}",storageUnavailable:"管理员未配置持久化存储",loadingEnhancer:"正在加载增强模型",enhancerHint:"使用 {{model}} 模型进行意图识别和提示词增强",enhancerUnavailable:"增强模型不可用"},task:{title:"视频生成任务",closeAria:"关闭视频生成任务弹窗",progressAria:"视频生成进度",optimizedPrompt:"优化后的提示词",processingAria:"{{task}}处理进度",waitingAria:"{{status}},已等待{{elapsed}}",elapsed:"已等待 {{elapsed}}",previewAria:"生成结果预览",close:"关闭",download:"下载视频",retryOptimization:"重试提示词优化",retryGeneration:"重试视频生成",providerQueued:"等待模型调度",providerRunning:"模型生成中",providerSubmitting:"正在提交任务",queuedHint:"任务已提交,模型开始处理后状态会自动更新",runningHint:"这可能持续数分钟,完成后将在这里显示视频预览",backgroundHint:"可以关闭弹窗,任务会继续在后台运行",successHint:"视频已生成,可预览或下载",activationHint:"请先在模型控制台开通服务,再重试生成",retryHint:"修正问题后可重试当前步骤",steps:{optimizationFailed:"提示词优化失败",optimizationDone:"提示词优化完成",optimizationActive:"提示词优化中",generationDone:"{{task}}已完成",generationFailed:"{{task}}失败",generationQueued:"{{task}}排队中",generationRunning:"{{task}}生成中",generationActive:"{{task}}进行中",generationPending:"等待视频生成",generationComplete:"视频生成完成"},elapsedHours:"{{hours}}小时{{minutes}}分",elapsedMinutes:"{{minutes}}分{{seconds}}秒",elapsedSeconds:"{{seconds}}秒"}},urr=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:XFe,compactSelect:WFe,default:{compactSelect:WFe,featureNotice:YFe,workspace:qFe,mode:jFe,agentPicker:XFe,skill:KFe,video:ZFe},featureNotice:YFe,mode:jFe,skill:KFe,video:ZFe,workspace:qFe},Symbol.toStringTag,{value:"Module"})),JFe={cancel:"取消",close:"关闭",retry:"重试",tryAgain:"重新尝试",closeDialog:"关闭{{title}}",agentFallback:"{{agent}} 智能体",unknownSource:"未知来源"},eze={terminalTitle:"终端",browserTitle:"沙箱浏览器",terminalSubtitle:"连接当前 AgentKit Session 的交互式终端",browserSubtitle:"在当前 AgentKit Session 中查看与操作浏览器",connecting:"正在连接…",connected:"已连接",notConnected:"尚未连接",opening:"正在打开 {{title}}",connectingSession:"工具正在连接当前 AgentKit Session。",openFailed:"{{title}} 打开失败"},tze={title:"恢复 Codex 对话",subtitle:"选择当前 Sandbox Session 中最近更新的 Thread",loading:"正在读取历史对话",loadFailed:"历史对话读取失败",empty:"暂无可恢复的对话"},rze={title:"Codex 权限",subtitle:"设置会保存到当前 Sandbox Session,并同步到其中的所有 Thread",sandboxMode:"沙箱模式",approvalPolicy:"审批策略",approvalMethod:"审批方式",networkAccess:"允许网络访问",networkAccessHelp:"控制 workspace-write 与只读模式中的外部网络访问。",fullAccessWarning:"完全访问会关闭文件系统与网络隔离,请只在可信任务中使用。",save:"保存权限",sandboxChoices:{readOnly:{label:"只读",detail:"允许读取文件,不允许写入工作空间。"},workspaceWrite:{label:"工作区写入",detail:"允许在当前工作空间内读取与修改文件。"},fullAccess:{label:"完全访问",detail:"不启用沙箱隔离,适合明确可信的任务。"}},approvalChoices:{untrusted:{label:"仅不可信命令",detail:"只对 Codex 判断为不可信的操作发起审批。"},onRequest:{label:"按需审批",detail:"Codex 可在必要时请求你确认命令或文件修改。"},never:{label:"不审批",detail:"Codex 不会暂停并请求人工批准。"}},reviewerChoices:{user:{label:"由我审批",detail:"审批请求会显示在 Studio 中,由你决定。"},autoReview:{label:"自动审查",detail:"使用 Codex 自动审查流程处理审批请求。"}}},nze={title:"工作空间",subtitle:"选择当前 Codex Thread 执行命令与修改文件的目录",absolutePath:"绝对路径",browse:"浏览",parent:"上一级",empty:"当前目录没有子目录",locked:"当前对话已经开始,工作空间已锁定。新建 Sandbox 会话后可重新选择。",useDirectory:"使用此目录"},ize={fileTitle:"允许修改文件?",commandTitle:"允许执行命令?",subtitle:"Codex 正在等待你的决定",workingDirectory:"执行目录",decline:"拒绝",acceptOnce:"仅本次允许",acceptSession:"本会话允许"},aze={availableSkills:"可用 Skills",selectModel:"选择模型",commands:"Codex 快捷命令",currentModel:"当前:{{model}}",loadingSkills:"正在发现当前工作区的 Skills…",loadingModels:"正在读取模型…",noSkillMatches:"当前工作区没有匹配的 Skill",noModelMatches:"没有匹配模型,也可以直接输入模型 ID",noCommandMatches:"没有匹配的快捷命令",skillFallback:"加载并执行该 Skill",add:"添加",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",openTerminal:"进入终端",viewBrowser:"查看浏览器",permissions:"Codex 权限",workspaceLocked:"对话已开始,工作空间已锁定",selectWorkspace:"选择工作空间",workspace:"Codex 工作空间",endpointCopied:"Endpoint 已复制",copyEndpoint:"复制 Sandbox Endpoint",continuePlaceholder:"继续说明你想实现或调整的内容",messagePlaceholder:"向 AgentKit 沙箱发送消息,输入 / 查看命令,输入 $ 调用 Skill…",stop:"停止生成",send:"发送"},sze={defaultName:"我的智能体",namedDefault:"我的 {{agent}}",creatingTitle:"正在创建 {{agent}} 智能体",failedTitle:"启动失败",createTitle:"创建 {{agent}} 智能体",fallbackError:"AgentKit 沙箱初始化失败,请稍后重新尝试。",creatingDescription:"正在创建并等待 {{agent}} 智能体就绪,这通常需要半分钟",name:"智能体名称",storageSize:"存储大小",storageHelp:"数据将持久化保存,可设置 {{min}}–{{max}} GiB。",persistent:"持久化",persistenceUnsupported:"当前环境不支持快照持久化",persistentHelp:"保留智能体数据,后续可继续使用。",temporaryHelp:"智能体将在 8 小时后清空",cancelCreation:"取消创建",confirm:"确认创建",retry:"重新尝试"},oze={activeAria:"Codex 智能体会话已开启",openAria:"开启 Codex 智能体会话",active:"Codex 智能体会话中",entry:"灵光一现",exit:"退出当前智能体",expired:"已到期",remainingHours:"剩余 {{hours}} 小时 {{minutes}} 分钟",remainingMinutes:"剩余 {{minutes}} 分钟",expiryWarning:"远端开发环境最长保留 8 小时,将于 {{expiry}} 到期({{remaining}});到期后清除对话和文件。",usingAgent:"当前您在使用 {{agent}} 智能体",activityAria:"Sandbox 操作记录",activity:"操作记录",tokenUsageAria:"Codex Token 用量",tokens:"{{label}}:{{value}} tokens",tokenLabels:{total:"总计",input:"输入",cachedInput:"缓存输入",output:"输出",reasoningOutput:"推理输出"}},lze={back:"返回智能体列表",subtitle:"{{agent}} AgentKit Session 详情",type:"智能体类型",status:"状态",createdBy:"创建人",snapshotStatus:"快照状态",toolType:"工具类型",createdAt:"创建时间",snapshotReason:"快照原因",expiresAt:"过期时间",snapshotId:"快照 ID",sessionId:"会话 ID",sourceSessionId:"来源 Session ID",delete:"删除智能体",waking:"唤醒中…",opening:"打开中…",wake:"唤醒智能体",open:"打开智能体",deleteTitle:"删除智能体?",deleteDescription:"将删除“{{name}}”及其 AgentKit {{resource}},此操作无法撤销。",deleting:"删除中…",confirmDelete:"确认删除"},cze={back:"返回智能体列表",createdBy:"创建人 {{creator}}",ariaLabel:"智能体工作区",main:"主界面",terminal:"终端",mainTitle:"{{agent}} 主界面",openingTerminal:"正在打开终端…",terminalTitle:"{{agent}} 终端"},uze={prompt:`使用 AgentKit Studio Plugin 端云接力当前会话、项目和任务。请直接执行,不要让我手动打开终端。 Studio:{{studioUrl}} 配对码:{{pairingCode}}`,installPrompt:`请安装 AgentKit Studio Plugin。请直接执行以下安装命令,不要让我手动打开终端。 安装命令:{{command}}`,title:"接力到云端继续执行",description:"按顺序复制两段提示词,Codex 会通过插件将您的本地任务接力到云端",closeAria:"关闭本地迁移引导",installTitle:"安装插件",installDescription:"首次使用时,请选择一种安装方式。",copied:"已复制",copyInstallPrompt:"复制安装提示词",copyInstallCommand:"复制安装命令",installMethodAria:"插件安装方式",conversationInstall:"与 Codex 对话安装",terminalInstall:"从终端安装",taskTitle:"任务接力",taskDescription:"插件安装完成后复制,Codex 会迁移当前项目并继续执行任务。",copyHandoffPrompt:"复制接力提示词",generatingPairing:"正在生成新的配对码",pairingExpired:"配对码已过期",pairingRemaining:"配对码有效期剩余 {{countdown}}",refreshing:"刷新中",refreshPairing:"刷新配对码",pairingLoading:"正在生成配对码",pairingUnavailable:"配对码尚未生成。",statusAria:"端云接力状态",statusTitle:"接力状态",requestReceivedNamed:"已收到“{{name}}”的端云接力请求",requestReceivedCurrent:"已收到当前项目的端云接力请求",requestHelp:"复制接力提示词后,Codex 的请求会显示在这里。",entering:"正在进入",enterCodex:"进入 Codex",clipboardUnsupported:"当前浏览器不支持写入剪贴板。",steps:{request:"等待端侧请求",session:"创建云端 Session",restore:"恢复项目",continue:"发送续跑任务"},status:{issued:"等待请求",creating:"正在创建 Session",sessionCreated:"正在迁移项目",continuing:"正在启动云端任务",running:"云端执行中",completed:"接力完成",failed:"接力失败"}},hze={model:{description:"显示或切换当前对话模型",keywords:"模型 switch"},models:{description:"列出 app-server 可用模型",keywords:"模型列表 list"},skill:{description:"浏览并调用当前工作区可用的 Skill",keywords:"技能 workflow"},skills:{description:"浏览并调用当前工作区可用的 Skills",keywords:"技能列表 workflow list"},new:{description:"开始一个新对话",keywords:"新建 对话"},resume:{description:"打开历史会话或恢复指定 Thread",keywords:"历史 恢复 session"},fork:{description:"从当前上下文分叉一个新对话",keywords:"分叉 branch"},compact:{description:"压缩当前对话上下文",keywords:"压缩 上下文"},archive:{description:"归档当前对话并新建对话",keywords:"归档 关闭"},status:{description:"显示当前连接、Thread、模型与 Token 状态",keywords:"状态 连接 token"},clear:{description:"清空当前视图并开始新对话",keywords:"清空 重置"},help:{description:"显示 Sandbox 支持的快捷命令",keywords:"帮助 命令"},currentModel:"当前模型",availableModel:"可用模型",workspace:"工作空间",notSet:"未设置",modelLabel:"模型",statusLabel:"状态",running:"运行中",idle:"空闲",totalTokens:"累计 Token",contextWindow:"上下文窗口",imageFallback:"图片",unknown:"未知快捷命令:{{command}}。输入 /help 查看可用命令。",automaticSkills:"智能开发模式会自动使用开发能力,无需手动选择 Skill。",activity:{new:"已新建 Codex 对话",resumed:"已恢复 Codex 对话",deleted:"已删除 Codex 历史会话",modelChanged:"已切换 Codex 模型",availableModels:"Codex 可用模型",noModels:"当前没有可用模型",forked:"已分叉 Codex 对话",compacting:"已开始压缩当前 Codex 对话",archived:"已归档 Codex 对话",status:"Codex 当前状态",help:"Sandbox 支持的 Codex 快捷命令"}},hrr=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:lze,agentWorkspace:cze,approval:ize,commands:hze,common:JFe,composer:aze,default:{common:JFe,tool:eze,threads:tze,permissions:rze,workspace:nze,approval:ize,composer:aze,launch:sze,session:oze,agentDetails:lze,agentWorkspace:cze,handoff:uze,commands:hze},handoff:uze,launch:sze,permissions:rze,session:oze,threads:tze,tool:eze,workspace:nze},Symbol.toStringTag,{value:"Module"})),dze={retry:"重试",signInToContinue:"登录以继续使用",signInWith:"使用 {{provider}} 登录",enterUsername:"输入一个用户名即可开始",usernamePlaceholder:"用户名(字母 + 数字,最多 16 位)",enter:"进入",usernameInvalid:"只能包含大小写字母和数字,最多 16 位。",identityProvider:{volcengine:"火山引擎 Identity",byteplus:"BytePlus Identity"},powered:{volcengine:"火山引擎 AgentKit 提供企业级 Agent 解决方案",byteplus:"BytePlus AgentKit 提供企业级 Agent 解决方案"},legalPrefix:"继续即表示你已阅读并同意 AgentKit",terms:"产品和服务条款",copyright:"© {{year}} VeADK。保留所有权利。"},fze={title:"登录状态已过期",description:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。",waiting:"等待登录完成…",signInAgain:"重新登录"},pze={breadcrumbs:"面包屑",selectAgent:"选择 Agent",switchAgent:"切换智能体"},gze={cancel:"取消",close:"关闭确认框"},drr=Object.freeze(Object.defineProperty({__proto__:null,authExpired:fze,confirm:gze,default:{login:dze,authExpired:fze,navbar:pze,confirm:gze},login:dze,navbar:pze},Symbol.toStringTag,{value:"Module"})),mze={defaultUser:"用户",shortcuts:"快捷入口",tryCli:"体验 AgentKit CLI",developerResources:"开发者资源",systemInfo:"系统信息",language:"语言",issueFeedback:"问题反馈",logout:"退出登录",roles:{admin:"管理员",developer:"开发者",user:"普通用户"}},vze={home:"返回首页",expand:"展开侧边栏",collapse:"收起侧边栏",label:"主导航",newChat:"新会话",agents:"智能体",workspaces:"工作区",library:"资源库",cronjobs:"定时任务",automations:"自动化"},yze={title:"历史会话",newConversation:"新会话",create:"新建会话",loading:"正在加载历史会话…",empty:"暂无会话",current:"当前",manage:"管理历史会话:{{title}}",more:"更多",delete:"删除",loadingMore:"加载中…",loadMore:"加载更多",evaluatingTitle:"正在自动评测",evaluating:"评测中",generating:"正在生成"},frr=Object.freeze(Object.defineProperty({__proto__:null,account:mze,default:{account:mze,navigation:vze,history:yze},history:yze,navigation:vze},Symbol.toStringTag,{value:"Module"})),bze={placeholder:"请选择",collapseOptions:"收起模型选项",expandOptions:"展开模型选项",noOptions:"暂无可用选项",noMatches:"没有匹配项,可直接使用当前模型 ID"},xze={unsupportedActivity:"不支持的 Skill 对话活动",ariaLabel:"Skill 生成对话"},wze={code:"错误码:{{code}}",type:"错误类型:{{type}}",representation:"异常表示:{{value}}",rawResponse:`服务端原始响应: -{{value}}`,original:"原始错误:{{message}}",details:"详细信息"},Aze={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},Tze={close:"关闭",name:"名称",region:"地域",optionalDescription:"描述(可选)",cancel:"取消",create:"创建",creating:"创建中…",save:"保存",saving:"保存中…",upload:"上传",uploading:"上传中…",createSpaceTitle:"新建 Skill 空间",editSpaceTitle:"编辑 Skill 空间",uploadTitle:"上传到 {{name}}",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",archiveValidationFailed:"Skill ZIP 格式校验失败",uploadFailed:"上传 Skill 失败",dropzone:"拖拽 Skill ZIP 到这里",chooseLocalFile:"或点击选择本地文件",archiveHelp:"ZIP 根目录需要包含 SKILL.md,也可以只包含一层包装目录。选择后仅检查格式,不会自动上传。",validating:"正在检查文件格式…",validationPassed:"格式检查通过:{{name}},共 {{count}} 个文件"},Sze={styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先",custom:"自定义",customFallback:"自定义风格"},stages:{preparing:"正在准备 Dev Sandbox",ready:"Skill 已生成并通过格式校验",failed:"生成失败",cancelled:"已停止",validating:"正在校验 Skill 格式",packaging:"正在整理文件",generating:"正在生成 Skill",repairingAgain:"正在再次修复",autoRepairing:"正在自动修复({{attempt}}/{{max}})"},validation:{fallback:"Skill 格式校验未通过",repairInstruction:"只修复下面列出的 Skill 格式错误,不要改变原有用途和内容范围。",recheckInstruction:"修复后重新检查目录结构、SKILL.md frontmatter 和所有文本文件。",nameTooLong:"Skill 名称不能超过 64 个字符",invalidName:"Skill 名称只能包含小写字母、数字和连字符",modelTooLong:"模型 ID 不能超过 128 个字符",invalidModel:"模型 ID 只能包含字母、数字、点、下划线、连字符、斜杠和冒号"},errors:{loadCapability:"读取 Dev Sandbox 配置失败",autoRepair:"自动修复格式错误失败",pollCandidate:"读取候选方案状态失败,正在重试",createCandidate:"创建候选方案失败",refine:"继续调整失败",repairAgain:"再次修复格式错误失败",selectSpace:"请选择上传的 Skill Space",unsupportedRegion:"当前 Skill 地域不受支持",upload:"上传 Skill 失败",download:"下载失败"},sessionMax:"Session 最长保留 1 小时",remaining:"剩余 {{minutes}}:{{seconds}}",unnamedSpace:"未命名 Skill Space",leaveConfirmation:"离开后将停止并释放正在运行的 Dev Sandbox,确定离开吗?",createTitle:"创建技能",optimizeTitle:"优化 {{name}}",skillFallback:"技能",back:"返回技能空间",home:"主页技能生成",basicInfo:"基本信息",goal:"目标",createIntentPlaceholder:"描述希望这个 Skill 完成什么任务",optimizeIntentPlaceholder:"描述希望如何优化当前 Skill",skillName:"Skill 名称",autoNamePlaceholder:"留空时自动生成",nameHelp:"仅支持小写字母、数字和连字符;留空时自动生成。",createPlans:"生成方案",optimizePlans:"优化方案",createPlansDescription:"按不同方案并行生成多个技能,您可以选择最佳结果",optimizePlansDescription:"按不同方案并行优化当前技能,您可以选择最佳结果",plan:"方案 {{count}}",remove:"移除",model:"模型",modelPlaceholder:"选择或输入模型 ID",style:"风格",customStyle:"自定义风格",customStylePlaceholder:"描述表达方式、严谨程度或输出偏好",addConfiguration:"添加配置",notConfigured:"管理员未配置",generate:"生成",candidates:"候选方案",progress:"进度",retryCandidate:"重试此方案",formatValidationFailed:"格式校验未通过",repairAgain:"再次修复",files:"文件",downloadZip:"下载 ZIP",loadingFiles:"正在读取文件…",filesPending:"生成过程中会在这里显示完整文件树",uploadToSpace:"上传到 Skill Space",loadingSpaces:"正在加载 Skill Space",selectSpace:"选择 Skill Space",continuePlaceholder:"继续调整这个候选方案",continue:"继续调整",uploading:"上传中…",overwrite:"覆盖原 Skill",uploadToSelectedSpace:"上传到 Skill Space",uploadToCurrentSpace:"上传到当前空间",allCandidatesFailed:"所有方案均创建失败,可分别重试。"},Cze={invalidFormat:"{{label}}格式错误。",recoveryStatus:"Skill 恢复点状态",errorResponse:"错误响应",errorDetails:"错误详情",missingContentType:"Content-Type 缺失",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},Content-Type: {{contentType}}),请检查代理或网关配置。",activity:"Skill 会话活动",invalidActivity:"Skill 会话活动格式错误。",invalidToolActivity:"Skill 工具活动格式错误。",invalidTextActivity:"Skill 文本活动格式错误。",publication:"Skill 发布结果",task:"Skill 会话",file:"Skill 文件",unknownTaskState:"Skill 会话状态无法识别。",capability:"Skill 工作台能力",loadCapability:"读取 Skill 工作台能力失败",prepareTask:"准备 Skill 会话失败",taskReference:"Skill 会话引用",startOptimization:"开始优化 Skill 失败",startTask:"开始 Skill 会话失败",taskSummary:"Skill 会话摘要",taskList:"Skill 会话列表",loadTaskList:"读取 Skill 会话列表失败",invalidTaskList:"Skill 会话列表格式错误。",loadTask:"读取 Skill 会话失败",artifact:"Skill 产物",artifactFile:"Skill 产物文件",loadArtifact:"读取 Skill 产物失败",refine:"继续调整 Skill 失败",stop:"停止当前 Skill 任务失败",publish:"发布 Skill 失败",nonNdjson:"发布 Skill 失败:服务端返回了非 NDJSON 响应。",missingStream:"发布 Skill 失败:服务端没有返回进度流。",publishProgress:"发布进度",invalidPublishProgress:"发布进度格式错误。",publishError:"发布错误",unknownPublishEvent:"未知的发布进度事件。",publishResult:"发布结果",streamEnded:"发布进度流提前结束,无法确认发布结果。请刷新技能中心确认状态。",deleteTask:"删除 Skill 会话失败",download:"下载 Skill 失败"},prr=Object.freeze(Object.defineProperty({__proto__:null,api:Cze,configSelect:bze,conversation:xze,default:{configSelect:bze,conversation:xze,errorDetails:wze,fileTree:Aze,management:Tze,generation:Sze,api:Cze},errorDetails:wze,fileTree:Aze,generation:Sze,management:Tze},Symbol.toStringTag,{value:"Module"})),Oze={back:"返回上一页",reload:"重新加载",notConfigured:"未配置",name:"名称",description:"描述",delete:"删除",save:"保存",saving:"保存中",add:"添加",manage:"管理",environment:"环境",noDescription:"暂无描述",refresh:"刷新",close:"关闭",retry:"重试",loading:"加载中…",previousPage:"上一页",nextPage:"下一页",edit:"编辑",all:"全部",search:"搜索",cancel:"取消",view:"查看",viewDetails:"查看详情",deleting:"删除中…",create:"创建",creating:"创建中",adding:"添加中",generating:"生成中",uploading:"上传中",preview:"预览",loadFailed:"加载失败",select:"选择",collapse:"收起",expand:"展开",none:"无"},kze={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},Eze={checkUpdates:"检查更新",checkingVersions:"正在检查版本…",versionCheckError:"查询沙箱版本失败,请检查凭据、区域及接口权限后重试",sandboxUpdateError:"Sandbox 更新失败,请刷新检查实际状态后重试",modelEnvRepairUnavailable:"无法补齐模型环境变量,请检查 CODEX_API_KEY 和 CODEX_BASE_URL",updateSandbox:"更新{{variant}}{{name}}",updatingSandbox:"更新中",title:"系统信息",description:"查看当前 Studio 版本及关联的基础资源",general:"通用",currentVersion:"当前版本",storage:"存储",loadingStorage:"正在加载存储信息",tosAddress:"TOS 地址",openTosConsole:"在云控制台中打开 TOS 存储桶",environmentBuild:"环境构建",loadingEnvironmentResources:"正在加载环境构建资源",environmentResourcesError:"环境构建资源加载失败,请检查云凭据后重试。",codePipelineWorkspace:"CodePipeline 工作空间",codePipelinePipeline:"CodePipeline 流水线",openCodePipelineWorkspace:"在云控制台中打开 CodePipeline Workspace",createdOnFirstBuild:"首次构建时自动创建",containerRegistryRepository:"Container Registry 仓库",openContainerRegistryRepository:"在云控制台中打开 Container Registry 仓库",sandboxInfo:"沙箱信息",loadingSandboxInfo:"正在加载沙箱信息",sandboxInfoError:"沙箱信息加载失败,请重试。",snapshot:"快照版",snapshotWithSpace:"快照版 ",openToolConsole:"在云控制台中打开{{name}}",updateModelEnv:"更新{{variant}}{{name}}模型环境变量",modelEnvUpdated:"已更新",modelEnvAlreadyCurrent:"无需更新",userPool:"用户池",loadingUserPool:"正在加载用户池",userPoolError:"用户池加载失败,请重试。",modelEnvUpdateError:"模型环境变量更新失败,请重试。",openUserPoolConsole:"在云控制台中打开用户池{{name}}",unnamedUserPool:"未命名用户池",id:"ID",domain:"域名",region:"区域",noLocalUserPool:"本地模式未配置用户池",noUserPool:"当前 Studio 未配置用户池"},_ze={workspace:"Agent 工作区",library:"Agent 库",evaluation:"评测",agentList:"Agent 列表",agentDetails:"Agent 详情",newAgent:"新建 Agent",loading:"加载中…",loadingCloudAgents:"正在加载云端 Agent…",noAgentSelected:"请选择一个 Agent",local:"本地",remote:"云端",localAgent:"本地 Agent",remoteAgent:"云端 Agent",agentCount:"{{count}} 个 Agent",agentCountLabel:"Agent 数量",details:"详情",chat:"对话",update:"更新",backToAgentList:"返回 Agent 列表",loadingAgent:"正在加载 Agent",loadingAgentDescription:"正在读取 Agent 配置和 Runtime 信息。",loadingAgentInfo:"正在加载 Agent 信息…",detailLoadFailed:"无法加载 Agent 详情",detailLoadFailedDescription:"请检查 Runtime 状态后重试。",partialInfoUnavailable:"部分信息暂时不可用",upgradeRuntimeForDetails:"请升级 Runtime 以查看完整 Agent 信息。",basicInfo:"基本信息",usageOverview:"使用概览",sections:{basic:"基本信息",usage:"使用概览",evaluations:"评测",optimizations:"优化建议",integrations:"集成",versions:"版本"},evaluationGroup:"评测组",optimizations:"优化建议",optimizationsDescription:"根据评测结果查看可执行的优化建议。",integrations:"集成",githubVersions:"GitHub 版本",githubVersionsDescription:"查看持续交付产生的版本并创建回退 PR。",currentVersionOnly:"当前未启用 GitHub 持续交付,仅展示当前生产版本。",loadingVersions:"正在加载版本…",noVersion:"暂无版本记录",prLink:"Pull Request",viewPr:"查看 PR",author:"提交人",publishStatus:"发布状态",viewRelease:"查看发布记录",rollbackToVersion:"回退到此版本",rollingBack:"正在创建回退…",rollbackEvent:"回退事件",sourceMergedRuntimeStill:"最新源码已合并,但 Runtime 仍处于",currentProductionVersionHint:";当前生产版本保持不变。",usageSummary:"使用统计",totalCalls:"总调用次数",userCount:"用户数",userDetails:"用户明细",usageUserList:"Agent 使用用户列表",user:"用户",callCount:"调用次数",lastUsed:"最近使用",unknownUser:"未知用户",loadingUsage:"正在加载使用数据…",refreshing:"刷新中…",noUsage:"暂无使用记录",usageUnavailable:"当前 Agent 暂无可用的使用统计。",usagePagination:"使用记录分页",pageOf:"第 {{page}} / {{total}} 页",notProvided:"暂未提供",integrationMethods:"集成方式",integrationDescription:"通过 Runtime API 或 A2A 协议集成当前 Agent。",integrationProtocol:"集成协议",runtimeStatus:"Runtime 状态",executionFlow:"执行流程",probingIntegration:"正在检测集成能力",probingIntegrationDescription:"正在读取可用端点和鉴权配置。",configurationStatus:"配置状态",discoveryEndpoint:"发现端点",invocationEndpoint:"调用端点",invocationUrl:"调用地址",authentication:"鉴权方式",networkAccess:"网络访问",notAvailable:"暂无",noAuthentication:"无需鉴权",noApiKeyRequired:"无需 API Key",usesOauthJwt:"使用 OAuth / JWT",showApiKey:"显示 API Key",hideApiKey:"隐藏 API Key",pythonExample:"Python 示例",deploymentConfig:"部署配置",deploymentConfigDescription:"确认实例和运行配置后更新 Runtime。",deploymentRegion:"部署区域",concurrency:"并发数",selectedOptimizations:"已选优化项",selectedOptimizationsDescription:"这些优化会应用到本次更新。",optimizationProfile:"优化方案",updatePending:"等待更新",updatingDeployment:"正在更新部署",restoringUpdateConfig:"正在恢复更新配置…",updateConfigUnavailable:"无法读取更新配置",legacyConfigMissing:"旧版本 Runtime 缺少可恢复的配置,请重新创建。",deploymentFailed:"部署失败",continueEditing:"继续编辑",loadingOptimizations:"正在加载优化建议…",noOptimizations:"暂无优化建议",fixPriority:"优先级",suggestedModule:"建议模块",suggestionAndReason:"建议与原因",priority:{high:"高",medium:"中",low:"低"},modules:{agentStructure:"Agent 结构",prompt:"提示词",tool:"工具",knowledge:"知识库",memory:"记忆",workflow:"工作流",other:"其他"},evaluationGroupList:"评测组列表",newEvaluationGroup:"新建评测组",newEvaluationGroupName:"新评测组 {{count}}",searchEvaluationGroups:"搜索评测组",noMatchingEvaluationGroups:"没有匹配的评测组",noEvaluationGroupSelected:"请选择一个评测组",groupStats:"{{agents}} 个 Agent · {{runs}} 次运行",evaluationGroupDetails:"评测组详情",evaluationGroupStats:"{{agents}} 个 Agent · {{caseSet}} · {{runs}} 次运行",startEvaluation:"开始评测",evaluationConfig:"评测配置",historyResults:"历史结果",participatingAgents:"参与 Agent",selectedCount:"已选择 {{count}} 个",evaluationResources:"评测资源",evaluationSet:"评测集",evaluator:"评估器",caseCount:"{{count}} 条案例",evaluationMetrics:"评测指标",selectedMetricCount:"已选择 {{count}} 项",historyDescription:"查看每次评测的分数和运行状态。",noHistory:"暂无评测历史",noHistoryDescription:"运行一次评测后,结果会显示在这里。",evaluationRun:"第 {{index}} 次评测",evaluationRunMeta:"{{time}} · {{agents}} 个 Agent",overallScore:"综合分",completed:"已完成",evaluationDefaults:{coreRegression:"核心能力回归",safetyCheck:"安全与幻觉检查",coreSet:"核心回归集",safetySet:"安全边界集",toolSet:"工具调用集",qualityEvaluator:"综合质量评估器",factualEvaluator:"事实一致性评估器",toolEvaluator:"工具调用评估器",responseQuality:"回答质量",factualAccuracy:"事实准确性",toolUse:"工具调用",responseEfficiency:"响应效率",todayTime:"今天 10:32",yesterdayTime:"昨天 16:08",julyTime:"7 月 25 日 14:20",justNow:"刚刚"},defaultCases:{agentName:"示例 Agent",goodSetName:"示例正向案例集",badSetName:"示例负向案例集",weeklyFeedback:{input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",tag:"总结",reason:"任务完整覆盖了用户目标,输出结构清晰,并给出了可执行的下一步动作。"},research:{input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",tag:"工具调用"},uncertainConclusion:{input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",tag:"幻觉",reason:"信息不足时仍给出了确定结论,缺少必要的澄清步骤与不确定性说明。"},repeatedTool:{input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",tag:"效率"}},goodCases:"正向案例",badCases:"负向案例",goodCase:"正向案例",badCase:"负向案例",reference:"参考答案",caseResultFilter:"案例结果筛选",feedbackSourceFilter:"反馈来源筛选",searchCases:"搜索案例",searchCasesPlaceholder:"搜索输入、输出或标签",selectCases:"选择案例",selectAll:"全选",selectAllVisible:"选择当前可见案例",selectedCaseCount:"已选择 {{count}} 条",deleteSelected:"删除所选",deleteSelectedTitle:"删除所选 Agent",deleteSelectionDescription:"确定删除所选的 {{count}} 个项目吗?此操作无法撤销。",deleteCasesConfirm:"删除所选案例",deleteOneCaseConfirm:"删除这个案例",deleteFeedbackCase:"删除反馈案例",noFeedbackCases:"暂无反馈案例",noMatchingCases:"没有匹配的案例",loadingEvaluationSet:"正在加载评测集…",userInput:"用户输入",agentOutput:"Agent 输出",score:"得分",scoreReason:"评分原因",noUserInput:"暂无用户输入",noVisibleResponse:"暂无可见回复",note:"备注:",manualFeedback:"人工反馈",automaticFeedback:"自动反馈",scoreValue:"{{score}} 分",unknownTime:"时间未知",deleteAgentTitle:"删除 Agent",deleteAgentDescription:"确定删除 Agent“{{name}}”吗?",deleteDraftDescription:"确定删除草稿“{{name}}”吗?",deleteAgent:"删除 Agent",closeDeleteConfirmation:"关闭删除确认",draftDeletionWarning:"草稿将从当前浏览器中删除。",runtimeDeletionWarning:"Runtime 和相关云端资源将被删除。",noneSelected:"尚未选择",none:"无",notPublished:"未发布",notRecorded:"未记录",noTime:"暂无时间",noPr:"暂无 PR",comingSoon:"评测能力即将开放",preparing:"准备中",cancelled:"已取消",failed:"失败",totalCount:"共 {{count}} 条",deploymentProgress:"部署进度",returnToEdit:"返回编辑",buildLog:"构建日志",githubMountLog:"GitHub 挂载日志",githubDeliveryMountLog:"GitHub 持续交付挂载日志",waitingBuildLog:"正在等待构建日志…",waitingGithubMountLog:"正在等待 GitHub 挂载日志…",copy:"复制",copied:"已复制",copyLabel:"复制{{label}}",copiedLabel:"已复制{{label}}",logLines:"{{count}} 行",logStatus:{synced:"已同步",failed:"读取失败",syncing:"同步中",earlyOmitted:"已省略早期日志",recentOnly:"仅显示最近的构建日志",partiallyOmitted:"已省略部分日志"},deployStatus:{running:"正在部署",unconfirmed:"部署状态待确认",success:"部署完成",error:"部署失败",cancelled:"部署已取消"},deploymentSteps:{prepare:{label:"准备部署",description:"校验配置并创建部署任务"},build:{label:"构建镜像",description:"生成运行环境与智能体代码"},deploy:{label:"部署服务",description:"创建并启动 AgentKit Runtime"},publish:{label:"发布服务",description:"等待服务就绪并生成访问地址"},complete:{label:"部署完成",description:"智能体已可以正常使用"},evaluation:{label:"创建评测集",description:"自动创建 Good Case 和 Bad Case 评测集"},github:{label:"挂载 GitHub 持续交付",description:"初始化目标分支与 GitHub Actions workflow"},update:{label:"更新实例配置",description:"将 Runtime 实例数调整为 {{min}}~{{max}}"}},githubStatus:{published:"已发布",publishing:"发布中",failed:"发布失败",pending:"等待发布",unknown:"未知"},errors:{agentInfoMissing:"Agent 信息不可用",checkUpdateCapability:"无法检查更新能力",checkingUpdateConfig:"正在检查更新配置",cloudOnlyUpdate:"仅云端 Agent 支持更新",deleteDeployedUnsupported:"当前不支持删除已部署 Agent",deleteDraftUnsupported:"当前不支持删除草稿",loadAgentInfo:"无法加载 Agent 信息",loadApiKey:"无法读取 API Key",loadGithubVersions:"无法加载 GitHub 版本",loadEvaluations:"无法加载评测案例",loadOptimizations:"无法加载优化建议",loadRuntimeDetails:"无法加载 Runtime 详情",loadUsage:"无法加载使用数据",noCreatePermission:"当前账号没有创建 Agent 的权限",noManagePermission:"当前账号没有管理此 Agent 的权限",originalConfigUnavailable:"原始配置不可用",probeIntegration:"无法检测集成能力",rollbackVersion:"无法创建版本回退",runtimeRegionMissing:"Runtime 区域信息缺失",updateCapabilityMismatch:"Runtime 更新能力与当前配置不匹配",updateCapabilityPending:"Runtime 更新能力仍在确认中",updateConfigRestoring:"正在恢复更新配置",updateUnsupported:"当前 Runtime 不支持更新",usageMismatch:"返回的使用数据与当前 Agent 不匹配"}},Rze={title:"环境",loadFailed:"环境加载失败,请检查存储配置后重试。",create:"新建环境",configure:"配置环境",details:"环境详情",editorDescription:"配置运行环境,或接入代码仓库和已有镜像",backToList:"返回环境列表",save:"保存环境",createAndBuild:"创建并构建",saveAndBuild:"保存并构建",name:"环境名称",namePlaceholder:"Python 数据处理",descriptionPlaceholder:"说明这个环境适合处理的任务",creationMethod:"创建方式",baseConfiguration:"基础配置",baseEnvironment:"基础环境",operatingSystem:"操作系统",pythonVersion:"Python 版本",fixedByBase:"由 {{base}} 固定为 {{value}}",selectUbuntuVersion:"选择基础镜像的 Ubuntu 版本",selectPythonVersion:"选择需要安装的 Python 版本",skills:"技能",addSkill:"添加环境技能",veadkDescription:"Agent 开发与运行框架",customDockerfile:"自定义 Dockerfile",presetEnvironment:"预制环境",presetHint:"选择“无”可自行填写 Dockerfile 第一行的基础镜像。",dockerfileSize:"{{size}} / {{max}} 字节",upload:"上传",reset:"重置",dockerfileBaseImage:"Dockerfile 基础镜像",dockerfileContent:"Dockerfile 内容",region:"区域",search:"搜索环境",manualImport:"手动导入",noMatches:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称",startBuild:"开始构建",build:"构建",unnamed:"未命名环境",listSeparator:"、",clipboardReadError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",creation:{custom:{label:"自定义配置",description:"通过表单选择基础环境、Python、工具和技能"},dockerfile:{label:"自定义 Dockerfile",description:"上传或直接编辑 Dockerfile"},git:{label:"从代码仓库构建",description:"探查公开仓库并通过 CodePipeline 构建"},image:{label:"使用已有镜像",description:"绑定由外部流水线交付的 CR 镜像"}},baseDescriptions:{"aio-sandbox":"内置 Sandbox Shell 能力 · Ubuntu 22.04","codex-sandbox":"内置 Codex CLI、浏览器与代码执行环境",ubuntu:"标准 Linux 基础镜像"},dockerfileValidation:{baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"},presets:{none:"自行填写 Dockerfile 基础镜像",aio:"内置 Sandbox Shell 与常用运行时",codex:"内置 Codex CLI、浏览器与代码执行环境"},categories:{tools:"工具",productivity:"效率",browser:"浏览器自动化",system:"系统与媒体"},options:{"lark-cli":"飞书开放平台命令行工具",pandoc:"文档格式转换工具",opencli:"将网站与桌面应用转换为命令行工具",uv:"快速 Python 包与项目管理器",ripgrep:"高性能文本检索工具",jq:"JSON 查询与转换工具","github-cli":"在终端中管理 GitHub 工作流",playwright:"浏览器自动化与端到端测试",chromium:"无头浏览器运行时",git:"代码版本管理",curl:"网络请求与文件下载",ffmpeg:"音视频转码与处理",imagemagick:"图片转换与批处理"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",hoursMinutes:"{{hours}} 小时 {{minutes}} 分"},buildStatus:{preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"构建失败",notBuilt:"未构建"},manifest:{title:"环境 Manifest",closeLabel:"关闭环境 Manifest",loading:"正在加载 Manifest",editorLabel:"环境 Manifest YAML",copyFailed:"复制失败,请重试",copied:"已复制",copy:"复制 Manifest",view:"查看环境 Manifest",viewShort:"查看 Manifest",unavailable:"尚无可用 Manifest"},buildDetails:{title:"构建详情",closeLabel:"关闭构建详情",currentStep:"当前步骤",waiting:"等待构建信息",elapsed:"已用时",sourceCommit:"源码提交",openCodePipeline:"在 CodePipeline 中查看",starting:"正在启动",rebuild:"重新构建"},git:{sectionLabel:"公开代码仓库",address:"Git 地址",ref:"Branch、Tag 或 Commit",defaultBranch:"默认分支",inspecting:"正在拉取仓库并查找 Dockerfile",foundDockerfiles:"已在提交 {{commit}} 中找到 {{count}} 个 Dockerfile。",savedDockerfileLoaded:"已载入保存的 Dockerfile,可重新探查仓库更新。",noDockerfile:"仓库中未找到 Dockerfile,请检查分支或仓库内容。",inspectAgain:"重新探查",selectDockerfile:"选择 Dockerfile"},repository:{outputSection:"构建输出",type:"镜像仓库类型",managed:"Studio 默认镜像仓库",existing:"已有镜像仓库",managedHint:"构建时自动创建或复用当前区域的 Studio 镜像仓库。"},existingImage:{sectionLabel:"已有镜像",reference:"Tag 或 Digest",placeholder:"latest 或 sha256:...",hint:"填写镜像 Tag,或以 sha256: 开头的完整 Digest。"},share:{action:"分享",title:"分享环境",closeLabel:"关闭分享环境",generating:"正在生成并复制分享码",copied:"分享码已复制",failed:"分享失败",code:"分享码",fullCode:"完整环境分享码",copiedHint:"分享码已自动复制,也可在这里查看或手动复制。",copyFailedHint:"自动复制失败,可手动复制上方分享码,或重试。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅发送给可信对象。",copyAgain:"再次复制"},import:{title:"导入环境",closeLabel:"关闭导入环境",description:"先检测分享码中的环境,再确认添加到当前账号。",code:"环境分享码",tooMany:"最多可一次导入 {{max}} 个环境,当前检测到 {{count}} 个分享码。",multipleHint:"多个分享码可使用英文逗号、中文逗号或换行分隔,重复项会自动忽略。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅导入可信来源的分享码。",inspectingCodes:"正在检测环境分享码",found:"检测到 {{count}} 个环境:{{names}}。",itemError:"第 {{index}} 个分享码:{{error}}",invalidCode:"分享码无效。",noResult:"服务未返回该分享码的导入结果。",partial:"已导入 {{created}} 个环境,{{remaining}} 个未完成,可重试有效失败项。",inspecting:"正在检测",importing:"正在导入",retryImport:"重试导入",confirm:"确认导入",inspectCodes:"检测分享码"},status:{boundImage:"环境“{{name}}”已绑定已有镜像",queued:"环境“{{name}}”已进入构建队列",savedBuildFailed:"环境已保存,但构建未启动:{{error}}",importedFailed:"已导入 {{created}} 个环境,{{failed}} 个失败",importedDuplicate:"已导入 {{created}} 个环境,{{duplicate}} 个分享码已存在",imported:"已导入 {{count}} 个环境",deleted:"已删除环境“{{name}}”"},deleteTitle:"删除环境",deleteDescription:"确定删除环境“{{name}}”吗?删除后无法恢复。",errors:{repositoryRequired:"请输入公开代码仓库地址。",repositoryHttps:"请输入公开仓库的 HTTPS 地址。",repositoryInvalid:"请输入有效的公开仓库 HTTPS 地址。",imageReferenceWhitespace:"Tag 或 Digest 不能包含空格。",imageDigestInvalid:"Digest 必须是完整的 sha256 值。",imageTagOnly:"这里只填写 Tag,不要重复填写镜像仓库路径。"}},Dze={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},Lze={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},Mze={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},Ize={defaultLabel:"Studio 默认环境",defaultDescription:"使用 Studio 预置的标准运行环境",status:{notBuilt:"未构建",preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"失败"},label:"运行环境",placeholder:"请选择运行环境",search:"搜索运行环境",loading:"正在加载运行环境…",loadFailed:"加载运行环境失败",noMatches:"未找到匹配的运行环境",unavailable:"当前没有可用的运行环境",selectionUnavailable:"所选运行环境当前不可用,请重新选择。",selectionHint:"选择构建完成的运行环境后,部署将使用其镜像和工具配置。",versionChanged:"所选环境版本已更新,请确认后继续。",versionMissing:"所选环境版本已不存在,请重新选择。",operatingSystem:"操作系统",language:"语言",image:"镜像",imageVersion:"镜像版本",skills:"技能",tools:"工具",noSkills:"未配置 Skill",noExtraTools:"未配置额外工具",defaultGuidance:"默认环境由 Studio 管理,无需额外配置。",persistenceFallback:"持久化环境服务暂不可用,当前使用默认环境。",emptyFallback:"当前没有可选择的自定义环境。"},Pze={repository:"GitHub 仓库",githubUrl:"GitHub 地址",token:"访问令牌",sessionToken:"{{provider}} 临时令牌",runtime:"Runtime",commit:"提交",workflow:"工作流",syncFailed:"同步 GitHub 代码失败",status:{mounted:"已挂载",bound:"已绑定",synced:"已同步",created:"已创建"},volcengine:"火山引擎",mountDelivery:"挂载持续交付",selectedForDeployment:"已选择,部署时挂载",mountOnDeploy:"部署时挂载持续交付",syncCode:"同步代码",deliveryMode:"GitHub 交付模式",sourceSync:"GitHub 代码同步",delivery:"GitHub 交付",loading:"读取中",running:"执行中",runtimeDeliveryHint:"写入 AgentKit Runtime GitHub Actions workflow,后续 GitHub 提交会更新绑定 Runtime。",initialDeliveryHint:"首次部署成功后初始化目标分支,后续 GitHub 提交会更新绑定 Runtime。",sourceSyncHint:"Studio 会直接 push 到目标分支;该分支由 Studio 管理,远端冲突时同步会失败。Runtime 仍由部署按钮发布。",tokenPlaceholder:"repo 或 contents write 权限",getToken:"获取 Token",hideToken:"隐藏 Token",showToken:"显示 Token",tokenHelp:"Token 仅用于本次操作,成功后不会保留在表单中。",targetBranch:"目标分支",actionsSecretPlaceholder:"用于写入 GitHub Actions Secret",sessionTokenPlaceholder:"临时凭证可选",syncing:"同步中…",pendingHint:"已选择挂载持续交付。点击部署后,Studio 会等待 Runtime 创建完成并初始化 GitHub 目标分支,初始化成功后才完成部署流程。",result:{deliveryMounted:"已挂载持续交付",deliverySelected:"已选择挂载持续交付",githubBound:"已绑定 GitHub",codeSynced:"代码已同步",deliveryHint:"目标分支提交会触发 Runtime 持续交付。",boundHint:"更新并发布时会先同步当前源码到这个分支。"},branch:"分支",viewPr:"查看 PR",createFailed:"创建失败",phase:"阶段",log:"日志"},Nze={name:"飞书",enabling:"正在启用并更新配置…",description:"接收消息并通过飞书机器人回复",configuration:"飞书配置",configurationMode:"飞书配置方式",automatic:"自动配置",manual:"手动配置",cancelling:"取消中…",scanToCreate:"扫码创建",scanDescription:"授权后自动回填凭据",generateQrCode:"生成二维码",qrCodeAlt:"飞书机器人配置二维码",scanToConfirm:"飞书扫码确认",expiresIn:"{{time}} 后失效",created:"机器人已创建",credentialsFilled:"应用凭据已自动回填",qrCodeExpired:"二维码已失效",automaticFailed:"自动配置失败",regenerateQrCode:"请重新生成二维码。",configuredPlaceholder:"已配置,留空沿用",appSecretPlaceholder:"请输入 App Secret",hideSecret:"隐藏 App Secret",showSecret:"显示 App Secret"},Bze={mode:{auto:"自动创建",autoDescription:"部署时自动创建所需资源",recommended:"推荐",create:"指定名称",createDescription:"使用指定名称创建或复用资源",existing:"选择已有",existingDescription:"从当前账号的已有资源中选择"},selectExisting:"请选择已有资源",searchResource:"搜索资源名称",noMatch:"未找到匹配资源",noAvailable:"暂无可用资源",searching:"正在搜索云资源…",loading:"正在加载云资源…",noMatchSentence:"未找到匹配资源。",noAvailableSentence:"暂无可用资源。",loadedSummary:"实际服务区域:{{region}} · 已加载 {{loaded}}{{total}}",registryInstance:"Registry 实例",registryAriaLabel:"镜像仓库 Registry 实例",namespace:"命名空间",namespaceAriaLabel:"镜像仓库 Namespace",repository:"镜像仓库",existingRepository:"已有镜像仓库",selectRegistryFirst:"请先选择 Registry 实例。",selectNamespaceFirst:"请先选择 Namespace。",configurationMode:"配置方式",configurationModeAriaLabel:"{{resource}}配置方式",selectConfigurationMode:"请选择配置方式",automaticNames:"自动创建名称",validation:{tos:"请填写或选择 TOS 存储桶。",cr:"请完整填写或选择 CR 实例、命名空间和镜像仓库。",codePipeline:"请完整填写或选择 CodePipeline Workspace 和 Pipeline。",existingCodePipeline:"请选择已有的 CodePipeline Workspace 和兼容 Pipeline。"},autoBucketWithRegion:"agentkit-platform-{账号 ID}-{{region}}",autoBucket:"agentkit-platform-{账号 ID}",tosBucket:"TOS 存储桶",bucketName:"存储桶名称",bucketNamePlaceholder:"输入存储桶名称",existingBucket:"已有存储桶",existingTosBucket:"已有 TOS 存储桶",bucket:"存储桶",accountIdResolved:"账号 ID 在部署时按当前云账号解析。",containerRegistry:"容器镜像仓库(CR)",instanceName:"实例名称",crInstance:"CR 实例",existingCrInstance:"已有 CR 实例",existingCrNamespace:"已有 CR 命名空间",existingCrRepository:"已有 CR 镜像仓库",autoRegistry:"agentkit-platform-{账号 ID}",autoRepositoryName:"{{name}}-{4 位随机字符}",registryNameNote:"账号 ID 在部署时解析,镜像仓库的随机字符在部署时生成。",workspace:"工作空间",pipeline:"流水线",workspaceName:"Workspace 名称",pipelineName:"Pipeline 名称",existingWorkspace:"已有 CodePipeline Workspace",compatiblePipeline:"兼容 Pipeline",existingPipeline:"已有 AgentKit CodePipeline",pipelineNameNote:"Pipeline 与 Runtime 名称一致。"},$ze={commit:"提交",steps:{permissions:"预检 OTA 所需权限",resolving:"读取目标版本信息",downloading:"下载并校验完整更新包",preparing:"准备 VeFaaS Function 代码",provisioning:"检查并补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布新 Revision 并重启服务"},stages:{permissions:"预检 OTA 权限",resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",provisioning:"补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},logPermissionPrefix:"无法读取 VeFaaS 发布日志。Function 角色缺少 ",logPermissionSuffix:" 权限,更新会继续。",openIamConsole:"前往 IAM 控制台配置权限",deploymentProgress:"部署进度",live:"实时",completed:"已完成",stopped:"已停止",copied:"已复制",copyFailed:"复制失败",copyLog:"复制日志",waitingForLogs:"等待 VeFaaS 返回更新日志…",noLogs:"本次更新未返回发布日志",messages:{updated:"Studio 已更新,新 Revision 已接管服务",failed:"Studio 更新失败",timeout:"等待 VeFaaS 发布超时,请稍后重新检查版本",submitted:"更新已提交,正在等待 VeFaaS 发布新版本",connectionSwitched:"连接已切换,正在确认新版本状态"},checkingPermissions:"正在检查 OTA 权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",updated:"Studio 已更新",updateToVersion:"更新 Studio 至 {{version}}",checkPermissions:"检查更新权限",authorizationNeeded:"需要授权",updatingShort:"正在更新",refreshForNewVersion:"刷新使用新版",updateFailed:"更新失败",updateNow:"立即更新",newVersionAvailable:"有新版更新",dialog:{failed:"Studio 更新失败",checkingPermissions:"正在检查更新权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",completed:"Studio 更新完成",newVersion:"发现新版本"},permissionCheck:"正在核对 OTA 与定时任务所需的全部 IAM 权限…",permissionCheckHint:"权限全部满足后才会开始下载、更新或发布云资源。",missingPermissionCount:"当前 Function 角色缺少 {{count}} 项 OTA 更新权限,尚未执行任何云资源变更。",functionRole:"Function 角色",currentRole:"当前运行角色",policyToUpdate:"将更新策略",authorizationSteps:{open:"打开授权页面,确认已预填的策略名称和完整策略内容。",debug:"点击页面中的“发起调试”,完成策略更新。",return:"返回此窗口,点击“我已授权,重新检查”。"},missingPermissions:"缺少的权限",openPrefilledAuthorization:"打开已预填的 IAM 授权页面",openIamManually:"前往 IAM 控制台手动配置",noSafePolicy:"当前角色没有唯一可安全更新的自定义策略,请由管理员将上述权限加入该角色。",failedStage:"失败阶段",errorId:"错误 ID",notGenerated:"未生成",openFunctionLogs:"前往 VeFaaS 控制台查看 Function 日志",targetVersion:"目标版本",updateStatus:"更新状态",elapsed:"已用时",progressAriaLabel:"Studio 更新进度",processingUpdate:"正在处理更新",processing:"正在处理",backgroundHint:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。",confirmDescription:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、流式响应或部署任务可能中断,登录态不会受到影响。",selectVersion:"选择版本",currentVersion:"当前版本",changelog:"更新内容",noChangelog:"暂无更新说明",runInBackground:"后台运行",authorizedRecheck:"我已授权,重新检查",tryAgain:"重新尝试"},Fze={deploy:"部署",update:"更新",planHash:"方案哈希",backToConfiguration:"返回配置",releaseRegion:"发布区域",deployRegion:"部署区域",regionPreserved:"更新时沿用现有 Runtime 的部署区域,无法修改。",unnamedAgent:"未命名 Agent",deployTitle:"部署 {{name}}",additionalAgentCount:" 等 {{count}} 个智能体",releaseOverview:"发布概览",agentOverview:"Agent 概览",agentCount:"Agent 数量",model:"模型",systemPrompt:"系统提示词",optimizations:"优化选项",notEnabled:"未启用",effectiveCapabilities:"生效能力",automaticProtection:"自动保护",artifactActions:"发布产物操作",exportYaml:"导出 YAML",viewSource:"查看源代码",downloadSource:"下载源代码",expandFlow:"放大查看执行流程",expand:"放大查看",deploymentConfiguration:"部署配置",runtimeName:"Runtime 名称",runtimeNamePreserved:"更新时保持现有 Runtime 名称不变。",runtimeNameHint:"默认根据 Root Agent 名称生成,并添加随机后缀避免重名;支持 4-64 位字母、数字、连字符和下划线",accessAuthentication:"访问鉴权",authenticationPreserved:"更新时保持现有 Runtime 的鉴权方式不变。",authenticationMethod:"鉴权方式",authenticationAriaLabel:"部署鉴权方式",authenticationPlaceholder:"请选择鉴权方式",messageChannels:"消息渠道",instanceSettings:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",sidecarSingleInstance:"Harness Sidecar 首期仅支持单实例,Runtime 固定为 1~1",inMemorySingleInstance:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",network:"网络",networkPreserved:"现有 Runtime 的区域与网络模式保持不变。",networkMode:"网络模式",networkModes:{public:"公网",both:"公网 + VPC"},subnetId:"子网 ID",subnetHint:"可选,多个用逗号分隔",sharedInternetAccess:"VPC 内共享公网出口",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",createEvaluationSetsHint:"部署成功后,自动创建 Good Case 和 Bad Case 评测集。",resourceConfiguration:"资源配置",environmentVariables:"环境变量",environmentVariablesHint:"组件配置会自动同步到这里,部署前可核对最终值。",itemCount:"{{count}} 项",addVariable:"添加变量",componentGenerated:"组件自动生成",injectedByApiKey:"由所选 API Key 注入",envNameAriaLabel:"{{key}} 环境变量名",envDescriptionAriaLabel:"{{key}}说明:{{description}}",openOpenViking:"打开 OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}:打开 OpenViking {{label}}",requiredEmpty:"必填,尚未填写",optionalEmpty:"可选,尚未填写",envValueAriaLabel:"{{key}} 环境变量值",automatic:"自动",synced:"同步",customModelCredentials:"自定义模型凭据",releaseOnlySecret:"必填,仅用于本次发布",thisRelease:"本次发布",customVariables:"自定义变量",value:"值",deleteVariable:"删除变量",deploymentProgress:"部署进度",retryUpdate:"重试更新",retryDeploy:"重试部署",updateSucceeded:"更新成功",deploySucceeded:"部署成功",region:"区域",agentName:"Agent 名称",apiEndpoint:"API 端点",connecting:"连接中…",chatNow:"立即对话",console:"控制台",actionInProgress:"{{action}}中…",checkingName:"正在检查名称…",retryAction:"重试{{action}}",flowPreview:"执行流程预览",executionFlow:"执行流程",flowPreviewHint:"只读预览,可缩放与拖动画布",closeFlowPreview:"关闭执行流程预览",agentAdded:'Agent "{{name}}" 已添加到左上角下拉列表!',files:{preview:"文件预览",new:"新建文件",empty:"暂无文件",noneSelected:"未选择文件",selectToView:"选择左侧文件以查看内容",loadingEditor:"加载编辑器…",rename:"重命名",renamePrompt:"重命名文件"},apiKey:{selectFirst:"请先选择 API Key",revealing:"正在显示 API Key",hide:"隐藏 API Key",retryReveal:"重试显示 API Key",reveal:"显示 API Key"},task:{preparing:"准备部署",waitingBuildLog:"正在等待构建日志…",waitingGithubLog:"正在等待 GitHub 挂载日志…",syncingGithub:"正在同步当前源码到 GitHub",syncGithubCode:"同步 GitHub 代码",githubSynced:"GitHub 代码已同步",githubSubmitted:"GitHub 代码已提交",githubUpdatingRuntime:"代码已提交到 GitHub,GitHub Actions 正在更新同一个 Runtime",initializingGithub:"开始初始化 GitHub main 分支与 Actions workflow",initializingGithubBranch:"正在初始化 GitHub 持续交付目标分支",mountGithubDelivery:"挂载 GitHub 持续交付",githubBranchInitialized:"GitHub 持续交付已初始化目标分支",githubDeliveryMounted:"GitHub 持续交付已挂载",githubMountFailed:"挂载 GitHub 持续交付失败",githubMountFailedDetail:"GitHub 持续交付挂载失败:{{message}}",githubMountFailedHint:"挂载 GitHub 持续交付失败,详见 GitHub 日志。",deploymentComplete:"部署完成",deployedNotConnected:"部署完成,暂未连接",cancelled:"已取消",cancelledHint:"部署已取消,相关 Runtime 资源已请求销毁。",deploymentStatusUnconfirmed:"部署状态待确认",deploymentFailed:"部署失败",buildFailedHint:"构建镜像失败,详见构建日志。"},confirm:{updateTitle:"确认更新",deployTitle:"确认部署",closeLabel:"关闭部署确认",updateDescription:"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?",deployDescription:"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?",update:"确定更新",deploy:"确定部署"},userPool:{label:"用户池",unnamed:"未命名用户池",current:"当前用户池",ariaLabel:"部署用户池",loading:"正在加载用户池…",placeholder:"请选择用户池",loadingIdentity:"正在加载 Identity 用户池…",empty:"当前账号下暂无 Identity 用户池。",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime。",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime。",markedHint:"当前 Studio 使用的用户池已在列表中标注。"},authentication:{apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPool:"用户池",userPoolDescription:"使用 Identity 用户池签发的 JWT"},steps:{buildImage:"构建镜像",deploy:"部署",publish:"发布",syncCode:"同步代码",uploadPackage:"上传代码包",packageImage:"镜像打包",createRuntime:"创建 Runtime",publishService:"发布服务",updateInstances:"更新实例配置",createEvaluationSets:"创建评测集"},errors:{instanceRangeInteger:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数。",instanceRangeOrder:"最小实例数不能大于最大实例数。",selectApiKey:"请先在模型配置中选择 API Key。",loadApiKey:"加载 API Key 失败,请重试。",invalidProject:"项目数据无效",updateFeishu:"更新飞书配置失败:{{message}}",userPoolRequired:"请选择用于 Runtime 鉴权的用户池。",vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",modelSecretRequired:"请填写 {{label}},用于访问对应的自定义模型地址。",managedApiKeyRequired:"{{requirement}},请先返回模型配置选择 API Key。",feishuEnvRequired:"启用飞书后,请填写{{field}}。",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",deployedButGithubMountFailed:"部署成功,但挂载 GitHub 持续交付失败:{{message}}",deployedButGithubBindFailed:"部署成功,但绑定 GitHub 失败:{{message}}",deploymentStatusUnconfirmed:"连接已中断,当前无法确认部署最终状态。任务可能仍在云端运行,请到 AgentKit 或 Code Pipeline 查看同一任务,避免重复部署。",failedAtStage:"{{action}}失败({{stage}}阶段):{{message}}",noAgentAtEndpoint:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",addAgent:"添加 Agent 失败:{{message}}",modelApiKeyRequired:"请填写此模型地址对应的 API Key。"}},zze={title:"工作区",detail:"工作区详情",create:"新建工作区",editorDescription:"将常用环境组合在一起;同一个环境可以加入多个工作区。",backToList:"返回工作区列表",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",createdAt:"创建时间",updatedAt:"最近更新",basicInfo:"基本信息",namePlaceholder:"例如:内容生产",descriptionPlaceholder:"说明这个工作区的用途",selectedEnvironmentCount:"已选择 {{count}} 个,可在其他工作区中继续复用",searchAvailableEnvironments:"搜索可用环境",searchEnvironments:"搜索环境",noAvailableEnvironments:"还没有可添加的环境",createEnvironmentFirst:"请先在“环境”页面创建并构建环境。",noMatchingEnvironments:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称。",environmentStatus:{available:"可用",building:"构建中",notBuilt:"未构建"},added:"已添加",saved:"已保存工作区“{{name}}”",resourceType:"工作区资源类型",searchWorkspaces:"搜索工作区",loadFailed:"无法加载工作区",noMatchingWorkspaces:"没有匹配的工作区",tryAnotherNameOrEnvironment:"请尝试搜索其他名称或环境",noEnvironmentAdded:"未添加环境",environmentMissing:"环境缺失",availableFraction:"{{available}}/{{total}} 可用",available:"可用",availableCount:"{{count}} 个可用",updated:"更新",addEnvironment:"添加环境",deleteTitle:"删除工作区",deleteDescription:"确定删除工作区“{{name}}”吗?环境本身不会被删除。",deleted:"已删除工作区“{{name}}”",clipboardPermissionError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。"},Uze={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},Vze={addSkill:"添加 Skill",remove:"移除 {{name}}",confirmRemoveRuntime:"从新版本中移除运行中的 Skill「{{name}}」?",selectedCount:"已加入技能 · {{count}}",close:"关闭{{label}}",sources:{runtime:"运行中来源 · 原样保留,可移除或用同名 Skill 替换",local:"本地",skillspace:"AgentKit Skills 中心",skillhub:"火山 Find Skill 技能广场"},tabs:{local:"本地文件",localShort:"本地文件",skillspace:"AgentKit Skills 中心",skillspaceShort:"AgentKit",skillhub:"火山 Find Skill 技能广场",skillhubShort:"Find Skill"}},Qze={tasks:{ppt:"PPT",image:"图片生成",video:"视频生成"},prompts:{ppt:{quarterlyReview:"复盘【季度】经营表现,提炼指标差距、原因与行动建议",projectUpdate:"汇报【项目名称】进展:里程碑、风险、预算和资源诉求",solutionProposal:"为【客户行业】输出解决方案:痛点、架构、实施路径与收益",industryAnalysis:"分析【行业主题】趋势,给出竞争格局、机会与战略建议"},image:{launchVisual:"为【品牌或产品】设计【高级科技】风格的发布会主视觉",ecommercePoster:"生成【产品名称】电商海报,突出【核心卖点】与品牌色",conceptRendering:"呈现【产品或空间】在【使用场景】中的写实概念效果图",socialGraphic:"围绕【传播主题】制作简洁专业的企业社媒配图"},video:{brandFilm:"制作【品牌名称】30 秒宣传片,突出【品牌价值】",productLaunch:"为【产品名称】制作 45 秒发布视频:痛点、功能、场景与行动号召",trainingVideo:"制作【培训主题】企业培训视频,讲清【关键操作或规范】",eventTeaser:"生成【活动名称】20 秒预热视频,包含亮点、时间地点和报名信息"}},firstFrame:"首帧",videoToEdit:"待编辑视频",baseVideo:"基础视频",optimizeSkillPlaceholder:"描述你想优化的技能…",createSkillPlaceholder:"描述你想生成的技能…",createVideoPlaceholder:"描述你想创作的视频…",messageAgentPlaceholder:"向 {{name}} 发消息…",selectAgentFirst:"请先选择智能体",selectSkillFirst:"请先选择需要优化的 Skill",availableSkills:"可用技能",availableSubagents:"可用子 Agent",invokeSkill:"调用技能",useSubagent:"使用子 Agent",loadingCapabilities:"正在读取 Agent 能力…",noMatchingSkills:"当前 Agent 没有匹配技能",noMatchingSubagents:"当前 Agent 没有匹配子 Agent",skillFallbackDescription:"加载并执行该技能",agentFallbackDescription:"将本轮交给该 Agent",skill:"技能",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",taskMode:"任务模式",selectTaskMode:"选择任务模式",loadingGenerationModel:"正在加载生成模型",modelUnavailable:"模型不可用",cancelTask:"取消{{task}}任务",stopGenerating:"停止生成",viewVideoProgress:"查看视频生成进度",send:"发送",selectTaskType:"选择任务类型",enterprisePrompts:"{{task}}企业提示词",sessionId:"会话 ID",sessionIdLabel:"会话 ID:",initializing:"初始化中",copied:"已复制",copySessionId:"复制会话 ID",sessionIdCopied:"已复制会话 ID",disclaimer:"回答仅供参考",viewLogs:"查看日志"},Gze={selectAgent:"选择 Agent",noLocalAgents:"暂无本地 Agent。",searchRuntime:"搜索 Runtime 名称",mineOnly:"只看我创建的",noRuntimes:"暂无 Runtime。",unsupported:"不支持",createdByMe:"我创建的",connecting:"连接中…",connected:"已连接",connect:"连接",viewInfoFor:"查看 {{name}} 信息",viewInfo:"查看信息",agentAndRuntimeInfo:"Agent 与 Runtime 信息",detailType:"详情类型",agentInfo:"Agent 信息",runtimeInfo:"Runtime 信息",loadingAgentInfo:"读取 Agent 信息…",cannotLoadAgentInfo:"暂时无法读取 Agent 信息",unnamedAgent:"未命名 Agent",subagents:"子 Agent",tools:"工具",skills:"技能",previewUnsupported:"暂不支持预览",mountedComponents:"挂载组件",noMoreAgentInfo:"暂无更多 Agent 配置信息。",local:"本地",model:"模型",status:"状态",memoryMb:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",resources:"资源",version:"版本",loadingDetails:"读取详情…",environmentVariables:"环境变量",errors:{notFound:"该 Runtime 已不存在或列表信息已过期,请刷新列表后重试。",accessDenied:"当前账号无权访问该 Runtime,请检查所属 Project 和访问权限。",previewUnsupported:"该 Agent Server 版本暂不支持信息预览。",unavailable:"该 Runtime 暂时无法访问,请确认其状态为“就绪”后重试。",timeout:"加载超时,请重试"},componentKinds:{knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"},runtimeStatus:{ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"}},Hze={agent:"智能体",agentTypes:{general:"通用智能体",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"创建人",namedAgent:"{{name}} 智能体",storageLocation:"存储位置",currentBrowser:"当前浏览器",region:"地域",viewDeploymentProgress:"查看 {{name}} 部署进度",viewRuntimeDetails:"查看 {{name}} Runtime 详情",viewDetails:"查看 {{name}} 详情",time:"时间",remainingTime:"剩余时间",expiringSoon:"即将清空",sandboxRemaining:"{{hours}} 小时 {{minutes}} 分钟",wakeable:"可唤醒",neverExpires:"永不过期",editDraftNamed:"编辑草稿 {{name}}",viewProgress:"查看进度",deleteDraftNamed:"删除草稿 {{name}}",recheckCompatibility:"重新检测 {{name}} 的对话兼容性",connectedNamed:"{{name}} 已连接",wakeAndChat:"唤醒 {{name}} 并开始对话",chatWith:"与 {{name}} 对话",waking:"唤醒中",deploying:"部署中",draft:"草稿",checking:"检测中",chatUnsupported:"不支持对话",checkFailed:"检测失败",creatorFilter:"创建人筛选",agentType:"智能体类型",searchAgents:"搜索智能体",handoff:"接力",agentList:"{{type}}列表",noMatchingAgents:"没有匹配的智能体",adjustSearch:"请尝试调整搜索或筛选条件",noAgentType:"暂无 {{type}}",noGeneralAgents:"暂无通用智能体",createGeneralAgentDescription:"创建一个通用智能体,开始构建和对话",createAgentType:"创建{{type}}",createAgent:"创建智能体",loadingMore:"正在加载更多智能体",scrollForMore:"继续下滑加载更多",allLoaded:"已加载全部智能体",deleteDraftTitle:"删除草稿?",deleteDraftDescription:"删除后将无法恢复“{{name}}”。",deleteDraft:"删除草稿",loadGeneralAgents:"加载通用智能体",loadAgentType:"加载 {{type}}",compatibility:{checking:"正在请求 Runtime /list-apps,以确认该智能体是否支持 Studio 对话。",empty:"Runtime /list-apps 未返回可用的 Agent,暂时无法连接对话。",supported:"Runtime 支持 Studio 对话。",unknownError:"Runtime /list-apps 请求失败,未返回可识别的错误信息。"},sandboxStatus:{ready:"就绪",wakeable:"可唤醒",creating:"创建中",starting:"启动中",initializing:"启动中",pending:"等待中",running:"运行中",failed:"异常",error:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"}},Wze={library:"技能库",skill:"技能",skills:"技能",skillSpace:"技能空间",sandboxNotConfigured:"管理员未配置 Dev Sandbox",adminNotConfigured:"管理员未配置",totalItems:"共 {{count}} 项",cannotLoadSpaces:"无法加载技能空间",someSpacesFailed:"部分技能空间加载失败",degradedRelationWarning:"部分关联异常,已恢复可读取技能",downloadZip:"下载 ZIP",optimize:"优化",closeSkillDetails:"关闭技能详情",skillId:"技能 ID",allFiles:"完整文件",loadingSkillContent:"正在读取技能内容…",noSkillContent:"该技能暂无 SKILL.md 内容",addSkill:"添加技能",localUpload:"本地上传",localUploadDescription:"选择 ZIP 文件,校验通过后上传到技能空间",autoCreate:"自动创建",autoCreateDescription:"选择模型和风格,通过对话生成技能",createSkill:"创建技能",optimizeNamed:"优化 {{name}}",deleteSkillConfirm:"确定删除整个 Skill“{{name}}”吗?此操作会影响所有引用它的空间。",deleteSpaceConfirm:"确定删除 Skill 空间“{{name}}”吗?请先确认空间中的技能已删除。",manageSpaceDescription:"管理空间中的技能并创建新的版本",backToSpaces:"返回技能空间列表",overview:"概览",skillCount:"技能数量",skillCountValue_one:"{{count}} 技能",skillCountValue_other:"{{count}} 技能",updatedAt:"更新时间",skillsInSpace:"{{name}}中的技能",searchSkills:"搜索技能",cannotLoadSkills:"无法加载技能",noMatchingSkills:"没有匹配的技能",noSkills:"暂无技能",tryAnotherName:"请尝试搜索其他名称",emptySkillsDescription:"本地上传 Skill,或自动创建",actions:"操作",spaceDetails:"技能空间详情",editSpace:"编辑空间",deleteSpace:"删除空间",searchSpaces:"搜索技能空间",spaceList:"技能空间列表",noMatchingSpaces:"没有匹配的技能空间",createSpace:"新建技能空间",newSpace:"新建空间",loadingMoreSpaces:"正在加载更多技能空间",scrollForMore:"继续下滑加载更多",allSpacesLoaded:"已加载全部技能空间",errors:{loadSpaces:"读取技能空间失败,请稍后重试",loadSkills:"读取技能失败,请稍后重试",loadSkillDetails:"读取技能详情失败,请稍后重试",deleteSkill:"删除 Skill 失败",deleteSpace:"删除 Skill 空间失败",downloadSkill:"下载 Skill 失败"},status:{active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中",unknown:"未知"}},Yze={library:"知识库",createBase:"新建知识库",editBase:"编辑知识库",invalidName:"名称必须以字母开头,且只能包含字母、数字和下划线。",nameHelp:"以字母开头,仅支持字母、数字和下划线,最多 48 个字符。",optionalDescription:"描述(可选)",descriptionOnly:"AgentKit 当前仅支持更新知识库描述。",previewWeb:"预览网页内容",addData:"添加数据",openOriginalWeb:"打开原网页",backToEdit:"返回修改",confirmAdd:"确认添加",source:"知识来源",image:"图片",documentFile:"文档文件",webPage:"在线网页",webUrl:"网页 URL",generatingWebPreview:"正在抓取网页并生成 Markdown 预览",selectFile:"选择知识文件",selectOrDropFile:"选择文件或拖拽到这里",selectedFile:"{{size}} · 点击可重新选择",imageFileHelp:"支持 PNG、JPG 和 JPEG,单个文件不超过 200 MB",documentFileHelp:"支持 PDF、PPTX、DOCX、XLSX 和 TXT,单个文件不超过 200 MB",uploadingFile:"正在上传文件并添加到知识库",optionalName:"名称(可选)",optionalType:"类型(可选)",generatePreview:"生成预览",uploadFile:"上传文件",editMetadata:"编辑知识 Metadata",knowledge:"知识",field:"字段",value:"值",backToList:"返回知识库列表",metadataJson:"元数据(JSON)",provider:"服务提供方",knowledgeId:"知识库 ID",project:"项目",creator:"创建者",data:"数据",deleteInvalidAssociation:"删除失效关联",noData:"这个知识库还没有数据",addFirstData:"添加第一项数据",format:"格式",size:"大小",searchData:"搜索数据",searchLibraryData:"搜索知识库数据",associationInvalid:"关联已失效",providerMissing:"底层 Provider 知识库已不存在",noMatchingData:"没有匹配的数据",loadingMoreData:"正在加载更多数据",retryLoading:"重试加载",details:"知识库详情",searchBases:"搜索知识库",someBasesFailed:"部分知识库暂时无法加载,已展示其余可用内容。",noMatchingBases:"没有匹配的知识库",noManagePermission:"您没有管理此知识库的权限",loadingMoreBases:"正在加载更多知识库",deleteBaseTitle:"删除知识库?",deleteBaseDescription:"将删除 {{name}} 的 AgentKit 关联;如果它由 Studio 创建,也会同时删除 Provider 资源。此操作无法撤销。",deleteDocumentTitle:"删除知识?",deleteDocumentDescription:"将从 Provider 知识库中删除 {{name}},此操作无法撤销。",preview:{processingTitle:"数据正在处理中",processingDetail:"知识库完成解析后即可预览,请稍后重新加载。",failedTitle:"数据解析失败",failedDetail:"请检查源文件或网页地址后重新添加,也可以重新加载最新状态。",noParsedTitle:"暂时没有可预览的解析内容",noParsedDetail:"此类文件会在知识库完成解析后显示文本、表格或页面图片。",noMediaTitle:"暂时没有可预览的媒体内容",noMediaDetail:"知识库尚未返回可访问的媒体预览,请稍后重新加载。",noDataTitle:"暂无可预览的数据内容",noDataDetail:"知识库尚未返回解析结果,请稍后重新加载。",attachmentError:"附件无法预览,请稍后重试。",imageAlt:"知识数据图片",audioUnsupported:"当前浏览器不支持音频预览。",videoUnsupported:"当前浏览器不支持视频预览。",namedPdf:"{{name}} PDF 预览",pdf:"PDF 预览",openPdf:"无法显示时,在新窗口打开 PDF",fileUnsupported:"当前格式暂不支持直接在线预览,已优先显示解析后的内容。",openOriginalFile:"打开原文件",loading:"正在加载数据预览",openOriginalHint:"您可以打开原网页查看来源内容。",chunk:"片段 {{index}}",loadingMore:"正在加载更多",loadMore:"加载更多"},errors:{fileTooLarge:"单个文件不能超过 200 MB",invalidImageType:"请选择 PNG、JPG 或 JPEG 图片",invalidDocumentType:"请选择 PDF、PPTX、DOCX、XLSX 或 TXT 文件",createBase:"创建知识库失败",updateBase:"更新知识库失败",metadataObject:"Metadata 必须是 JSON 对象",metadataFormat:"Metadata 格式错误",noWebPreview:"网页没有可预览的 Markdown 内容",addWeb:"添加网页失败",previewWeb:"生成网页预览失败",uploadFile:"上传文件失败",updateDocument:"更新知识失败",loadPreview:"加载数据预览失败",loadMoreBases:"加载更多知识库失败",loadBases:"加载知识库失败",loadMoreData:"加载更多数据失败",loadData:"加载数据失败",deleteBase:"删除知识库失败",deleteDocument:"删除知识失败"}},grr=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:kze,agentSelector:Gze,agentWorkspace:_ze,cloudEnvironment:Ize,common:Oze,composer:Qze,default:{common:Oze,agentKitPromo:kze,systemInfo:Eze,agentWorkspace:_ze,environmentCenter:Rze,deploymentSelect:Dze,deploymentError:Lze,studioBuildProgress:Mze,cloudEnvironment:Ize,githubCicd:Pze,feishuDeployment:Nze,deploymentResources:Bze,studioUpdate:$ze,projectPreview:Fze,workspace:zze,resourceCollection:Uze,skillSourcePicker:Vze,composer:Qze,agentSelector:Gze,myAgents:Hze,skillCenter:Wze,knowledge:Yze},deploymentError:Lze,deploymentResources:Bze,deploymentSelect:Dze,environmentCenter:Rze,feishuDeployment:Nze,githubCicd:Pze,knowledge:Yze,myAgents:Hze,projectPreview:Fze,resourceCollection:Uze,skillCenter:Wze,skillSourcePicker:Vze,studioBuildProgress:Mze,studioUpdate:$ze,systemInfo:Eze,workspace:zze},Symbol.toStringTag,{value:"Module"})),qze="网站集成",jze="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",Xze="返回自动化列表",Kze="添加网站",Zze="正在加载 Runtime",Jze="选择 Runtime",eUe="网站域名",tUe="例如 xxxx.com 或 localhost:5173",rUe="正在生成",nUe="生成 Token",iUe="已添加网站",aUe="{{count}} 个",sUe="{{count}} 个",oUe="正在加载网站集成",lUe="还没有网站集成",cUe="选择 Runtime 并输入网站域名即可生成 Token",uUe="引入方法",hUe="将下面代码放到网页的 body 结束标签前",dUe="已复制",fUe="复制代码",pUe="添加网站后会在这里生成引入代码。",gUe="确定删除 {{domain}} 的网站集成吗?",mUe={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},vUe={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},mrr=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:Kze,addedWebsites:iUe,backToAutomations:Xze,confirmDelete:gUe,copied:dUe,copyCode:fUe,default:{title:qze,description:jze,backToAutomations:Xze,addWebsite:Kze,loadingRuntime:Zze,selectRuntime:Jze,websiteDomain:eUe,domainPlaceholder:tUe,generating:rUe,generateToken:nUe,addedWebsites:iUe,websiteCount_one:aUe,websiteCount_other:sUe,loadingIntegrations:oUe,delete:"删除",emptyTitle:lUe,emptyDescription:cUe,embedMethod:uUe,embedInstructions:hUe,copied:dUe,copyCode:fUe,embedHint:pUe,confirmDelete:gUe,errors:mUe,widget:vUe},description:jze,domainPlaceholder:tUe,embedHint:pUe,embedInstructions:hUe,embedMethod:uUe,emptyDescription:cUe,emptyTitle:lUe,errors:mUe,generateToken:nUe,generating:rUe,loadingIntegrations:oUe,loadingRuntime:Zze,selectRuntime:Jze,title:qze,websiteCount_one:aUe,websiteCount_other:sUe,websiteDomain:eUe,widget:vUe},Symbol.toStringTag,{value:"Module"})),yUe={types:{all:"全部类型",document:"文档",image:"图片",video:"视频"},previewArtifact:"预览 {{name}}",moreActions:"更多操作 {{name}}",actionMenu:"{{name}} 操作",download:"下载",downloading:"下载中",edit:"编辑信息",delete:"删除产物",previewFailed:"无法预览“{{name}}”:{{message}}",downloadStarted:"已开始下载 {{name}}",downloadFailed:"无法下载“{{name}}”:{{message}}",updated:"已更新 {{name}}",deleted:"已删除 {{name}}",deleteFailed:"无法删除“{{name}}”:{{message}}",typeFilter:"产物类型",searchAria:"搜索产物",searchPlaceholder:"搜索产物或会话",retry:"重试",close:"关闭",listAria:"产物列表",loadFailed:"产物加载失败",loadDetailFallback:"请检查存储配置后重试。",reload:"重新加载",noMatch:"没有找到匹配的产物",noArtifacts:"您还没有任何产物",searchHint:"请尝试搜索其他名称或切换类型",emptyHint:"聊天中生成的产物会自动显示在这里",columns:{name:"名称",source:"来源",updatedAt:"修改时间",actions:"操作"},loadingMore:"正在加载更多产物",unknownTime:"时间未知",preview:{close:"关闭预览",meta:"{{type}} / 版本 {{version}}",loading:"正在加载预览",alt:"{{name}} 预览",loadFailed:"预览加载失败,请稍后重试或下载查看",unsupported:"当前格式暂不支持在线预览,请下载查看",sourceAria:"产物来源",agent:"智能体",session:"会话",tool:"生成工具",createdAt:"生成时间",fileSize:"文件大小",tags:"标签",viewSession:"查看会话"},deleteDialog:{title:"删除产物?",description:"“{{name}}”将从产物库永久删除,聊天记录不会受到影响。",deleting:"删除中",confirm:"删除",close:"关闭删除确认框"},api:{withStatus:"{{message}}({{status}})",listFailed:"读取产物库失败",syncFailed:"同步聊天产物失败",updateFailed:"更新产物失败",deleteFailed:"删除产物失败",downloadFailed:"下载产物失败"}},bUe={unknownSource:"未知来源",unknownCreator:"未知创建者"},xUe={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},wUe={change:{added:"新增",modified:"修改",deleted:"删除"},noChanges:"两个版本的源码没有差异",chooseFile:"从左侧选择文件以查看代码",compareTitle:"版本对比",workspaceTitle:"源码工作区",projectFallback:"Agent 项目",switchTheme:"切换源码主题",switchThemeTitle:"切换为{{theme}}主题",themes:{dark:"深色",light:"浅色"},closeWorkspace:"关闭源码工作区",close:"关闭",changedFiles:"变更文件",projectFiles:"项目文件",changes:"变更",files:"文件",openFiles:"打开的文件",noFileSelected:"未选择文件",comparisonDirection:"对比方向",before:"优化前",after:"优化后",loadingEditor:"正在加载编辑器…",changedFileCount_one:"{{count}} 个文件有变更",changedFileCount_other:"{{count}} 个文件有变更",fileCount_one:"{{count}} 个文件",fileCount_other:"{{count}} 个文件",lineCount_one:"{{count}} 行 · UTF-8",lineCount_other:"{{count}} 行 · UTF-8",viewSource:"查看源码",viewSourceAria:"查看和编辑项目源码"},AUe={nav:"搜索",selectAgent:"请选择 Agent",checkingCapabilities:"正在检测 Agent 能力",notMounted:"当前 Agent 未挂载{{label}}",sources:{session:"会话",web:"网络",knowledge:"知识库",memory:"长期记忆"},webDescription:"通过 web_search 工具检索",backendLocal:"本地",failed:"搜索失败:{{message}}",placeholder:{selectAgent:"请先选择 Agent",web:"在网络中检索",knowledge:"在 {{name}} 中检索",knowledgeFallback:"当前 Agent 的知识库",memory:"在 {{name}} 中检索",memoryFallback:"当前用户的长期记忆",session:"在当前 Agent 的会话中检索"},sourceTypeAria:"搜索类型:{{label}}",notSelected:"未选择",sourceType:"搜索类型",selectSource:"选择搜索类型",noAgentHint:"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。",loadingCapabilities:"正在读取当前 Agent 的检索能力…",sourceUnavailable:"当前 Agent 未挂载该数据源",instructions:{web:"输入关键词后回车或点击按钮,通过 web_search 工具检索。",knowledge:"输入问题,检索当前 Agent 挂载的知识库。",memory:"输入线索,检索当前用户跨会话保存的长期记忆。",session:"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"},noResults:"未找到匹配“{{query}}”的结果。",knowledgeFragment:"知识片段 {{index}}",memoryFragment:"记忆片段 {{index}}"},TUe={title:"开发者资源",sections:{documentation:{title:"相关链接",description:"查看开发文档与 AgentKit 常用入口"},bestPractices:{title:"最佳实践",description:"参考开发、调试与部署经验"},showcases:{title:"案例展示",description:"探索 AgentKit 应用案例"}},links:{veadkDocs:"VeADK 文档",cliDocs:"AgentKit CLI 文档",platformDocs:"AgentKit 平台文档",console:"AgentKit 控制台"},articles:{veadkDevelopment:{title:"使用 VeADK 开发并部署智能体",description:"使用 VeADK 构建 Agent,并部署至 AgentKit 智能体运行时。"},cliDevelopment:{title:"使用 AgentKit CLI 开发并部署智能体",description:"通过 AgentKit CLI 创建项目、调试 Agent,并完成部署。"},coverAlt:"{{title}}文章封面"},showcases:{researchAssistant:{title:"多智能体研究助手",description:"由多个专业 Agent 协同完成资料检索、分析和结论整理。"},multimodalAnalysis:{title:"多模态内容分析",description:"在统一会话中理解图片、文档和视频内容。"},customerService:{title:"智能客服工作台",description:"结合知识检索与工具调用处理复杂的客户服务任务。"},webSearch:{title:"联网搜索 Agent",description:"检索实时网页内容,并将信息整理为可追溯的回答。"},a2uiApp:{title:"A2UI 交互应用",description:"让 Agent 根据任务过程生成可交互的前端界面。"},previewAlt:"{{title}}界面预览"}},SUe={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},CUe={title:"管理 Agent",subtitle:"列出你有权管理的 AgentKit Runtime",mainAgentOnly:"仅显示主 Agent(控制面信息)。",deleteConfirm:'确定删除 Agent "{{name}}"?该 Runtime 将被永久删除。',regionFilterTitle:"按区域筛选",regionFilterAria:"区域筛选",regionAria:"区域",refresh:"刷新",loading:"加载中…",empty:"暂无你部署的 Agent。",connected:"已连接",connect:"连接到此 Agent",deleteRuntime:"删除该 Runtime",loadingDetail:"读取详情…",agentStructure:"Agent 结构",secretHidden:"敏感值已隐藏,点击显示",revealSecret:"显示 {{key}} 的值",fields:{model:"模型",description:"描述",status:"状态信息",project:"项目",version:"版本",resources:"资源",memory:"记忆",tool:"工具",knowledge:"知识",mcpToolset:"MCP 工具集",updatedAt:"更新时间"},resource:{memory:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",concurrency:"并发 {{value}}"},environmentVariables:"环境变量",unnamed:"(未命名)"},OUe={mainAgent:"主 Agent",subAgent:"子 Agent {{index}}",itemCount_one:"{{count}} 项",itemCount_other:"{{count}} 项",info:"Agent 信息",infoAndTopology:"Agent 信息与拓扑",loadingInfo:"正在读取 Agent 信息…",unnamedAgent:"未命名 Agent",tools:"工具",toolList:"工具列表",studioTool:"Studio Tool",removeTool:"移除工具 {{name}}",remove:"移除",notConfigured:"未配置",addStudioTool:"添加 Studio 工具",addStudioToolHere:"在此对话中添加 Studio 工具",skills:"技能",skillList:"技能列表",previewUnsupported:"暂不支持预览",sessionEnvironment:"会话环境",environment:"环境",agentCanvas:"Agent 画布",topology:"结构拓扑",viewCanvasFullscreen:"全屏查看 Agent 画布",viewFullscreen:"全屏查看",executionCanvas:"Agent 执行画布",fullscreenExecutionCanvas:"全屏 Agent 执行画布",closeFullscreenCanvas:"关闭全屏画布",close:"关闭",capabilitiesSubtitle:"能力与协作拓扑",closeInfo:"关闭 Agent 信息",infoUnavailable:"暂时无法读取 Agent 信息。"},kUe={mountFailed:"挂载环境失败",closeDialog:"关闭环境弹窗",addTitle:"添加环境",description:"选择当前会话允许 Agent 使用的 Sandbox 环境",closeAdd:"关闭添加环境",searchAria:"搜索环境",searchPlaceholder:"搜索环境名称或能力",availableAria:"可用环境与工作区",loading:"正在读取可用环境…",noMatch:"没有匹配的环境或工作区",workspaces:"工作区",reuseAll:"复用工作区中的全部可用环境",availableEnvironmentCount_one:"{{count}} 个可用环境",availableEnvironmentCount_other:"{{count}} 个可用环境",selectWorkspace:"选择工作区 {{name}}",environments:"环境",includedByWorkspaces:"已由工作区 {{names}} 包含",nameSeparator:"、",selectEnvironment:"选择环境 {{name}}",selectedWorkspaceCount_one:"{{count}} 个工作区",selectedWorkspaceCount_other:"{{count}} 个工作区",coveredEnvironmentCount_one:"{{count}} 个环境",coveredEnvironmentCount_other:"{{count}} 个环境",selectionSummary:"已选择 {{workspaces}},覆盖 {{environments}}",cancel:"取消",mounting:"正在挂载…",confirm:"确认添加",mountedAria:"已挂载环境",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",removeWorkspace:"移除工作区 {{name}}",remove:"移除",removeEnvironment:"移除环境 {{name}}",add:"添加环境",addMore:"添加更多环境",addForSession:"为当前 Session 添加环境",loadingAvailable:"正在加载可用环境…",empty:"暂无可用的 AIO Sandbox 环境。"},EUe={loading:{searching:"正在查找已有环境",creating:"环境初始化中",connecting:"正在连接已有环境"},initializationFailed:"AgentKit CLI 环境初始化失败,当前状态:{{status}}。",sessionExpired:"AgentKit CLI Session 不存在或已过期,请重试。",initializationTimeout:"AgentKit CLI 环境初始化超时,请稍后重试。",nonPersistent:"非持久化环境",recyclingHoursMinutes:"{{hours}} 小时 {{minutes}} 分钟后环境回收",recyclingMinutes:"{{minutes}} 分钟后环境回收",connectionError:`无法连接 Studio 服务,未收到服务端响应。 -原始错误:{{message}}`,unavailable:"连接不可用",requestFailed:"AgentKit CLI 请求失败",retry:"重试",terminalTitle:"AgentKit CLI 终端"},_Ue={labels:{coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取"},closeDialog:"关闭弹窗",title:"添加 Studio 工具",description:"由 Studio BFF 为 {{agentName}} 的当前会话执行,Runtime 无需预装",close:"关闭添加 Studio 工具",searchAria:"搜索 Studio 工具",searchPlaceholder:"搜索名称或工具标识",availableAria:"可用 Studio 工具",loading:"正在读取 Studio 工具…",noMatch:"没有匹配的 Studio 工具",remove:"移除",add:"添加"},RUe={artifactLibrary:yUe,resourceMetadata:bUe,artifactEdit:xUe,codeBrowser:wUe,search:AUe,developerResources:TUe,library:SUe,manageAgents:CUe,agentTopology:OUe,sessionEnvironment:kUe,agentKitCli:EUe,studioTools:_Ue},vrr=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:EUe,agentTopology:OUe,artifactEdit:xUe,artifactLibrary:yUe,codeBrowser:wUe,default:RUe,developerResources:TUe,library:SUe,manageAgents:CUe,resourceMetadata:bUe,search:AUe,sessionEnvironment:kUe,studioTools:_Ue},Symbol.toStringTag,{value:"Module"})),DUe=["zh-CN","en-US"],Wse="en-US",yrr="agentkit.studio.locale",brr={"zh-CN":{dir:"ltr",nativeName:"简体中文"},"en-US":{dir:"ltr",nativeName:"English"}};function Yse(t){if(!t)return null;const e=t.trim().replace(/_/g,"-").toLowerCase(),r=DUe.find(n=>n.toLowerCase()===e);return r||(e==="zh"||e.startsWith("zh-")?"zh-CN":e==="en"||e.startsWith("en-")?"en-US":null)}function xrr(){if(typeof window>"u")return null;try{return Yse(window.localStorage.getItem(yrr))}catch{return null}}function wrr(){if(typeof window>"u")return[];const t=window.navigator;return t?t.languages.length>0?t.languages:t.language?[t.language]:[]:[]}function Arr(){const t=xrr();if(t)return t;for(const e of wrr()){const r=Yse(e);if(r)return r}return Wse}function LUe(t){typeof document>"u"||(document.documentElement.lang=t,document.documentElement.dir=brr[t].dir)}const mn=t=>typeof t=="string",YP=()=>{let t,e;const r=new Promise((n,i)=>{t=n,e=i});return r.resolve=t,r.reject=e,r},qse=t=>t==null?"":String(t),Trr=(t,e,r)=>{t.forEach(n=>{e[n]&&(r[n]=e[n])})},Srr=/###/g,MUe=t=>t&&t.includes("###")?t.replace(Srr,"."):t,IUe=t=>!t||mn(t),qP=(t,e,r)=>{const n=mn(e)?e.split("."):e;let i=0;for(;i{const{obj:n,k:i}=qP(t,e,Object);if(n!==void 0||e.length===1){n[i]=r;return}let a=e[e.length-1],s=e.slice(0,e.length-1),o=qP(t,s,Object);for(;o.obj===void 0&&s.length;)a=`${s[s.length-1]}.${a}`,s=s.slice(0,s.length-1),o=qP(t,s,Object),o!=null&&o.obj&&typeof o.obj[`${o.k}.${a}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${a}`]=r},Crr=(t,e,r,n)=>{const{obj:i,k:a}=qP(t,e,Object);i[a]=i[a]||[],i[a].push(r)},dV=(t,e)=>{const{obj:r,k:n}=qP(t,e);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},Orr=(t,e,r)=>{const n=dV(t,r);return n!==void 0?n:dV(e,r)},NUe=(t,e,r)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(Object.prototype.hasOwnProperty.call(t,n)?mn(t[n])||t[n]instanceof String||mn(e[n])||e[n]instanceof String?r&&(t[n]=e[n]):NUe(t[n],e[n],r):t[n]=e[n]);return t},Ev=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),krr={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},Err=t=>mn(t)?t.replace(/[&<>"'\/]/g,e=>krr[e]):t;class _rr{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const r=this.regExpMap.get(e);if(r!==void 0)return r;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const Rrr=[" ",",","?","!",";"],Drr=new _rr(20),Lrr=(t,e,r)=>{e=e||"",r=r||"";const n=Rrr.filter(s=>!e.includes(s)&&!r.includes(s));if(n.length===0)return!0;const i=Drr.getRegExp(`(${n.map(s=>s==="?"?"\\?":s).join("|")})`);let a=!i.test(t);if(!a){const s=t.indexOf(r);s>0&&!i.test(t.substring(0,s))&&(a=!0)}return a},jse=(t,e,r=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const n=e.split(r);let i=t;for(let a=0;at==null?void 0:t.replace(/_/g,"-"),Mrr={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){var r,n;(n=(r=console==null?void 0:console[t])==null?void 0:r.apply)==null||n.call(r,console,e)}};class fV{constructor(e,r={}){this.init(e,r)}init(e,r={}){this.prefix=r.prefix||"i18next:",this.logger=e||Mrr,this.options=r,this.debug=r.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,r,n,i){return i&&!this.debug?null:(e=e.map(a=>mn(a)?a.replace(/[\r\n\x00-\x1F\x7F]/g," "):a),mn(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[r](e))}create(e){return new fV(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new fV(this.logger,e)}}var Yg=new fV;class pV{constructor(){this.observers={}}on(e,r){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const i=this.observers[n].get(r)||0;this.observers[n].set(r,i+1)}),this}off(e,r){if(this.observers[e]){if(!r){delete this.observers[e];return}this.observers[e].delete(r)}}once(e,r){const n=(...i)=>{r(...i),this.off(e,n)};return this.on(e,n),this}emit(e,...r){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([i,a])=>{for(let s=0;s{for(let s=0;s-1&&this.options.ns.splice(r,1)}getResource(e,r,n,i={}){var u,h;const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,s=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.includes(".")?o=e.split("."):(o=[e,r],n&&(Array.isArray(n)?o.push(...n):mn(n)&&a?o.push(...n.split(a)):o.push(n)));const l=dV(this.data,o);return!l&&!r&&!n&&e.includes(".")&&(e=o[0],r=o[1],n=o.slice(2).join(".")),l||!s||!mn(n)?l:jse((h=(u=this.data)==null?void 0:u[e])==null?void 0:h[r],n,a)}addResource(e,r,n,i,a={silent:!1}){const s=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let o=[e,r];n&&(o=o.concat(s?n.split(s):n)),e.includes(".")&&(o=e.split("."),i=r,r=o[1]),this.addNamespaces(r),PUe(this.data,o,i),a.silent||this.emit("added",e,r,n,i)}addResources(e,r,n,i={silent:!1}){for(const a in n)(mn(n[a])||Array.isArray(n[a]))&&this.addResource(e,r,a,n[a],{silent:!0});i.silent||this.emit("added",e,r,n)}addResourceBundle(e,r,n,i,a,s={silent:!1,skipCopy:!1}){let o=[e,r];e.includes(".")&&(o=e.split("."),i=n,n=r,r=o[1]),this.addNamespaces(r);let l=dV(this.data,o)||{};s.skipCopy||(n=JSON.parse(JSON.stringify(n))),i?NUe(l,n,a):l={...l,...n},PUe(this.data,o,l),s.silent||this.emit("added",e,r,n)}removeResourceBundle(e,r){this.hasResourceBundle(e,r)&&delete this.data[e][r],this.removeNamespaces(r),this.emit("removed",e,r)}hasResourceBundle(e,r){return this.getResource(e,r)!==void 0}getResourceBundle(e,r){return r||(r=this.options.defaultNS),this.getResource(e,r)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const r=this.getDataByLanguage(e);return!!(r&&Object.keys(r)||[]).find(i=>r[i]&&Object.keys(r[i]).length>0)}toJSON(){return this.data}}var $Ue={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,r,n,i){return t.forEach(a=>{var s;e=((s=this.processors[a])==null?void 0:s.process(e,r,n,i))??e}),e}};const FUe=Symbol("i18next/PATH_KEY");function Irr(){const t=[],e=Object.create(null);let r;return e.get=(n,i)=>{var a;return(a=r==null?void 0:r.revoke)==null||a.call(r),i===FUe?t:(t.push(i),r=Proxy.revocable(n,e),r.proxy)},Proxy.revocable(Object.create(null),e).proxy}function Hw(t,e){const{[FUe]:r}=t(Irr()),n=(e==null?void 0:e.keySeparator)??".",i=(e==null?void 0:e.nsSeparator)??":",a=(e==null?void 0:e.enableSelector)==="strict";if(r.length>1&&i){const s=e==null?void 0:e.ns,o=a?Array.isArray(s)?s:s?[s]:null:Array.isArray(s)?s:null;if(o&&(a?o:o.length>1?o.slice(1):[]).includes(r[0]))return`${r[0]}${i}${r.slice(1).join(n)}`}return r.join(n)}const Xse=t=>!mn(t)&&typeof t!="boolean"&&typeof t!="number";class gV extends pV{constructor(e,r={}){super(),Trr(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Yg.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,r={interpolation:{}}){const n={...r};if(e==null)return!1;const i=this.resolve(e,n);if((i==null?void 0:i.res)===void 0)return!1;const a=Xse(i.res);return!(n.returnObjects===!1&&a)}extractFromKey(e,r){let n=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let a=r.ns||this.options.defaultNS||[];const s=n&&e.includes(n),o=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!Lrr(e,n,i);if(s&&!o){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:mn(a)?[a]:a};const u=e.split(n);(n!==i||n===i&&this.options.ns.includes(u[0]))&&(a=u.shift()),e=u.join(i)}return{key:e,namespaces:mn(a)?[a]:a}}translate(e,r,n){let i=typeof r=="object"?{...r}:r;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),e==null)return"";typeof e=="function"&&(e=Hw(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]),e=e.map(L=>typeof L=="function"?Hw(L,{...this.options,...i}):String(L));const a=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:o,namespaces:l}=this.extractFromKey(e[e.length-1],i),u=l[l.length-1];let h=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;h===void 0&&(h=":");const d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((d==null?void 0:d.toLowerCase())==="cimode")return f?a?{res:`${u}${h}${o}`,usedKey:o,exactUsedKey:o,usedLng:d,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:`${u}${h}${o}`:a?{res:o,usedKey:o,exactUsedKey:o,usedLng:d,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:o;const p=this.resolve(e,i);let g=p==null?void 0:p.res;const m=(p==null?void 0:p.usedKey)||o,v=(p==null?void 0:p.exactUsedKey)||o,y=["[object Number]","[object Function]","[object RegExp]"],b=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,w=i.count!==void 0&&!mn(i.count),A=gV.hasDefaultValue(i),T=w?this.pluralResolver.getSuffix(d,i.count,i):"",S=i.ordinal&&w?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):"",O=w&&!i.ordinal&&i.count===0,k=O&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${T}`]||i[`defaultValue${S}`]||i.defaultValue;let E=g;x&&!g&&A&&(E=k);const _=Xse(E),I=Object.prototype.toString.apply(E);if(x&&E&&_&&!y.includes(I)&&!(mn(b)&&Array.isArray(E))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const L=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,E,{...i,ns:l}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(p.res=L,p.usedParams=this.getUsedParamsDetails(i),p):L}if(s){const L=Array.isArray(E),R=L?[]:{},D=L?v:m;for(const M in E)if(Object.prototype.hasOwnProperty.call(E,M)){const P=`${D}${s}${M}`;A&&!g?R[M]=this.translate(P,{...i,defaultValue:Xse(k)?k[M]:void 0,joinArrays:!1,ns:l}):R[M]=this.translate(P,{...i,joinArrays:!1,ns:l}),R[M]===P&&(R[M]=E[M])}g=R}}else if(x&&mn(b)&&Array.isArray(g))g=g.join(b),g&&(g=this.extendTranslation(g,e,i,n));else{let L=!1,R=!1;!this.isValidLookup(g)&&A&&(L=!0,g=k),this.isValidLookup(g)||(R=!0,g=o);const M=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&R?void 0:g,P=A&&k!==g&&this.options.updateMissing;if(R||L||P){if(this.logger.log(P?"updateKey":"missingKey",d,u,w&&!P?`${o}${this.pluralResolver.getSuffix(d,i.count,i)}`:o,P?k:g),s){const V=this.resolve(o,{...i,keySeparator:!1});V&&V.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let N=[];const F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&F&&F[0])for(let V=0;V{var G;const Q=A&&U!==g?U:M;this.options.missingKeyHandler?this.options.missingKeyHandler(V,u,z,Q,P,i):(G=this.backendConnector)!=null&&G.saveMissing&&this.backendConnector.saveMissing(V,u,z,Q,P,i),this.emit("missingKey",V,u,z,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?N.forEach(V=>{const z=this.pluralResolver.getSuffixes(V,i);O&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!z.includes(`${this.options.pluralSeparator}zero`)&&z.push(`${this.options.pluralSeparator}zero`),z.forEach(U=>{B([V],o+U,i[`defaultValue${U}`]||k)})}):B(N,o,k))}g=this.extendTranslation(g,e,i,p,n),R&&g===o&&this.options.appendNamespaceToMissingKey&&(g=`${u}${h}${o}`),(R||L)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${h}${o}`:o,L?g:void 0,i))}return a?(p.res=g,p.usedParams=this.getUsedParamsDetails(i),p):g}extendTranslation(e,r,n,i,a){var l,u;if((l=this.i18nFormat)!=null&&l.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const h=mn(e)&&(((u=n==null?void 0:n.interpolation)==null?void 0:u.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(h){const p=e.match(this.interpolator.nestingRegexp);d=p&&p.length}let f=n.replace&&!mn(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),e=this.interpolator.interpolate(e,f,n.lng||this.language||i.usedLng,n),h){const p=e.match(this.interpolator.nestingRegexp),g=p&&p.length;d(a==null?void 0:a[0])===p[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${r[0]}`),null):this.translate(...p,r),n)),n.interpolation&&this.interpolator.reset()}const s=n.postProcess||this.options.postProcess,o=mn(s)?[s]:s;return e!=null&&(o!=null&&o.length)&&n.applyPostProcessor!==!1&&(e=$Ue.handle(o,e,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,r={}){let n,i,a,s,o;return mn(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(l=>typeof l=="function"?Hw(l,{...this.options,...r}):l)),e.forEach(l=>{if(this.isValidLookup(n))return;const u=this.extractFromKey(l,r),h=u.key;i=h;let d=u.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const f=r.count!==void 0&&!mn(r.count),p=f&&!r.ordinal&&r.count===0,g=r.context!==void 0&&(mn(r.context)||typeof r.context=="number")&&r.context!=="",m=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);d.forEach(v=>{var y,b;this.isValidLookup(n)||(o=v,!this.checkedLoadedFor[`${m[0]}-${v}`]&&((y=this.utils)!=null&&y.hasLoadedNamespace)&&!((b=this.utils)!=null&&b.hasLoadedNamespace(o))&&(this.checkedLoadedFor[`${m[0]}-${v}`]=!0,this.logger.warn(`key "${i}" for languages "${m.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),m.forEach(x=>{var T;if(this.isValidLookup(n))return;s=x;const w=[h];if((T=this.i18nFormat)!=null&&T.addLookupKeys)this.i18nFormat.addLookupKeys(w,h,x,v,r);else{let S;f&&(S=this.pluralResolver.getSuffix(x,r.count,r));const O=`${this.options.pluralSeparator}zero`,k=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(r.ordinal&&S.startsWith(k)&&w.push(h+S.replace(k,this.options.pluralSeparator)),w.push(h+S),p&&w.push(h+O)),g){const E=`${h}${this.options.contextSeparator||"_"}${r.context}`;w.push(E),f&&(r.ordinal&&S.startsWith(k)&&w.push(E+S.replace(k,this.options.pluralSeparator)),w.push(E+S),p&&w.push(E+O))}}let A;for(;A=w.pop();)this.isValidLookup(n)||(a=A,n=this.getResource(x,v,A,r))}))})}),{res:n,usedKey:i,exactUsedKey:a,usedLng:s,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,r,n,i={}){var a;return(a=this.i18nFormat)!=null&&a.getResource?this.i18nFormat.getResource(e,r,n,i):this.resourceStore.getResource(e,r,n,i)}getUsedParamsDetails(e={}){const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!mn(e.replace);let i=n?e.replace:e;if(n&&typeof e.count<"u"&&(i={...i,count:e.count}),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!n){i={...i};for(const a of r)delete i[a]}return i}static hasDefaultValue(e){const r="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&n.startsWith(r)&&e[n]!==void 0)return!0;return!1}}class zUe{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Yg.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(e){if(e=jP(e),!e||!e.includes("-"))return null;const r=e.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(e){if(e=jP(e),!e||!e.includes("-"))return e;const r=e.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(e){if(mn(e)&&e.includes("-")){let r;try{r=Intl.getCanonicalLocales(e)[0]}catch{}return r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let r;return e.forEach(n=>{if(r)return;const i=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(i))&&(r=i)}),!r&&this.options.supportedLngs&&e.forEach(n=>{if(r)return;const i=this.getScriptPartFromCode(n);if(this.isSupportedCode(i))return r=i;const a=this.getLanguagePartFromCode(n);if(this.isSupportedCode(a))return r=a;r=this.options.supportedLngs.find(s=>s===a?!0:!s.includes("-")&&!a.includes("-")?!1:!!(s.includes("-")&&!a.includes("-")&&s.slice(0,s.indexOf("-"))===a||s.startsWith(a)&&a.length>1))}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(e,r){if(!e)return[];if(typeof e=="function"&&(e=e(r)),mn(e)&&(e=[e]),Array.isArray(e))return e;if(!r)return e.default||[];let n=e[r];return n||(n=e[this.getScriptPartFromCode(r)]),n||(n=e[this.formatLanguageCode(r)]),n||(n=e[this.getLanguagePartFromCode(r)]),n||(n=e.default),n||[]}toResolveHierarchy(e,r){const n=this.options.fallbackLng,i=Array.isArray(n)?n.join("|"):n;i!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=i);const a=r===void 0||r===!1||mn(r),s=r===void 0&&typeof this.options.fallbackLng=="function",o=mn(e)&&a&&!s;let l=null;if(o){let f;r===void 0?f="undefined":r===!1?f="boolean:false":f=`string:${r}`,l=`${e.length}:${e}|${f}`}if(l!==null){const f=this.resolveHierarchyCache[l];if(f!==void 0)return f.slice()}const u=this.getFallbackCodes((r===!1?[]:r)||this.options.fallbackLng||[],e),h=[],d=f=>{f&&(this.isSupportedCode(f)?h.push(f):this.logger.warn(`rejecting language code not found in supportedLngs: ${f}`))};return mn(e)&&(e.includes("-")||e.includes("_"))?(this.options.load!=="languageOnly"&&d(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&d(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&d(this.getLanguagePartFromCode(e))):mn(e)&&d(this.formatLanguageCode(e)),u.forEach(f=>{h.includes(f)||d(this.formatLanguageCode(f))}),l!==null?(this.resolveHierarchyCache[l]=h,h.slice()):h}}const UUe={zero:0,one:1,two:2,few:3,many:4,other:5},VUe={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Prr{constructor(e,r={}){this.languageUtils=e,this.options=r,this.logger=Yg.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,r={}){const n=jP(e==="dev"?"en":e),i=r.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:i});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let s;try{s=new Intl.PluralRules(n,{type:i})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),VUe;if(!e.match(/-|_/))return VUe;const l=this.languageUtils.getLanguagePartFromCode(e);s=this.getRule(l,r)}return this.pluralRulesCache[a]=s,s}needsPlural(e,r={}){let n=this.getRule(e,r);return n||(n=this.getRule("dev",r)),(n==null?void 0:n.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,r,n={}){return this.getSuffixes(e,n).map(i=>`${r}${i}`)}getSuffixes(e,r={}){let n=this.getRule(e,r);return n||(n=this.getRule("dev",r)),n?n.resolvedOptions().pluralCategories.sort((i,a)=>UUe[i]-UUe[a]).map(i=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(e,r,n={}){const i=this.getRule(e,n);return i?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i.select(r)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",r,n))}}const QUe=(t,e,r,n=".",i=!0)=>{let a=Orr(t,e,r);return!a&&i&&mn(r)&&(a=jse(t,r,n),a===void 0&&(a=jse(e,r,n))),a},GUe=t=>t.replace(/\$/g,"$$$$");class HUe{constructor(e={}){var r;this.logger=Yg.create("interpolator"),this.options=e,this.format=((r=e==null?void 0:e.interpolation)==null?void 0:r.format)||(n=>n),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:r,escapeValue:n,useRawValueToEscape:i,prefix:a,prefixEscaped:s,suffix:o,suffixEscaped:l,formatSeparator:u,unescapeSuffix:h,unescapePrefix:d,nestingPrefix:f,nestingPrefixEscaped:p,nestingSuffix:g,nestingSuffixEscaped:m,nestingOptionsSeparator:v,maxReplaces:y,alwaysFormat:b}=e.interpolation;this.escape=r!==void 0?r:Err,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=a?Ev(a):s||"{{",this.suffix=o?Ev(o):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=h?"":d?Ev(d):"-",this.unescapeSuffix=this.unescapePrefix?"":h?Ev(h):"",this.nestingPrefix=f?Ev(f):p||Ev("$t("),this.nestingSuffix=g?Ev(g):m||Ev(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=y||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(r,n)=>(r==null?void 0:r.source)===n?(r.lastIndex=0,r):new RegExp(n,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,r,n,i){var p;let a,s,o;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const b=QUe(r,l,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(b,void 0,n,{...i,...r,interpolationkey:g}):b}const m=g.split(this.formatSeparator),v=m.shift().trim(),y=m.join(this.formatSeparator).trim();return this.format(QUe(r,l,v,this.options.keySeparator,this.options.ignoreJSONStructure),y,n,{...i,...r,interpolationkey:v})};this.resetRegExp(),!this.escapeValue&&typeof e=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const h=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,d=((p=i==null?void 0:i.interpolation)==null?void 0:p.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>g},{regex:this.regexp,safeValue:g=>this.escapeValue?this.escape(g):g}].forEach(g=>{for(o=0;a=g.regex.exec(e);){const m=a[1].trim();if(s=u(m),s===void 0)if(typeof h=="function"){const y=h(e,a,i);s=mn(y)?y:""}else if(i&&Object.prototype.hasOwnProperty.call(i,m))s="";else if(d){s=a[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${e}`),s="";else!mn(s)&&!this.useRawValueToEscape&&(s=qse(s));const v=g.safeValue(s);if(e=e.replace(a[0],GUe(v)),d?(g.regex.lastIndex+=v.length,g.regex.lastIndex-=a[0].length):g.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,r,n={}){let i,a,s;const o=(l,u)=>{const h=this.nestingOptionsSeparator;if(!l.includes(h))return l;const d=l.split(new RegExp(`${Ev(h)}[ ]*{`));let f=`{${d[1]}`;l=d[0],f=this.interpolate(f,s);const p=f.match(/'/g),g=f.match(/"/g);(((p==null?void 0:p.length)??0)%2===0&&!g||((g==null?void 0:g.length)??0)%2!==0)&&(f=f.replace(/'/g,'"'));try{s=JSON.parse(f),u&&(s={...u,...s})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,m),`${l}${h}${f}`}return s.defaultValue&&s.defaultValue.includes(this.prefix)&&delete s.defaultValue,l};for(;i=this.nestingRegexp.exec(e);){let l=[];s={...n},s=s.replace&&!mn(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;const u=/{.*}/s.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(u!==-1&&(l=i[1].slice(u).split(this.formatSeparator).map(h=>h.trim()).filter(Boolean),i[1]=i[1].slice(0,u)),a=r(o.call(this,i[1].trim(),s),s),a&&i[0]===e&&!mn(a))return a;mn(a)||(a=qse(a)),a||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),a=""),l.length&&(a=l.reduce((h,d)=>this.format(h,d,n.lng,{...n,interpolationkey:i[1].trim()}),a.trim())),e=e.replace(i[0],GUe(qse(a))),this.regexp.lastIndex=0}return e}}const Nrr=t=>{let e=t.toLowerCase().trim();const r={};if(t.includes("(")){const n=t.split("(");e=n[0].toLowerCase().trim();const i=n[1].slice(0,-1);e==="currency"&&!i.includes(":")?r.currency||(r.currency=i.trim()):e==="relativetime"&&!i.includes(":")?r.range||(r.range=i.trim()):i.split(";").forEach(s=>{if(s){const[o,...l]=s.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),h=o.trim();r[h]||(r[h]=u),u==="false"&&(r[h]=!1),u==="true"&&(r[h]=!0),isNaN(u)||(r[h]=parseInt(u,10))}})}return{formatName:e,formatOptions:r}},WUe=t=>{const e={};return(r,n,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});const s=n+JSON.stringify(a);let o=e[s];return o||(o=t(jP(n),i),e[s]=o),o(r)}},Brr=t=>(e,r,n)=>t(jP(r),n)(e);class $rr{constructor(e={}){this.logger=Yg.create("formatter"),this.options=e,this.init(e)}init(e,r={interpolation:{}}){this.formatSeparator=r.interpolation.formatSeparator||",";const n=r.cacheInBuiltFormats?WUe:Brr;this.formats={number:n((i,a)=>{const s=new Intl.NumberFormat(i,{...a});return o=>s.format(o)}),currency:n((i,a)=>{const s=new Intl.NumberFormat(i,{...a,style:"currency"});return o=>s.format(o)}),datetime:n((i,a)=>{const s=new Intl.DateTimeFormat(i,{...a});return o=>s.format(o)}),relativetime:n((i,a)=>{const s=new Intl.RelativeTimeFormat(i,{...a});return o=>s.format(o,a.range||"day")}),list:n((i,a)=>{const s=new Intl.ListFormat(i,{...a});return o=>s.format(o)})}}add(e,r){this.formats[e.toLowerCase().trim()]=r}addCached(e,r){this.formats[e.toLowerCase().trim()]=WUe(r)}format(e,r,n,i={}){if(!r||e==null)return e;const a=r.split(this.formatSeparator),s=[];for(let l=0;l-1&&!u.includes(")")&&l+1{var f;const{formatName:h,formatOptions:d}=Nrr(u);if(this.formats[h]){let p=l;try{const g=((f=i==null?void 0:i.formatParams)==null?void 0:f[i.interpolationkey])||{},m=g.locale||g.lng||i.locale||i.lng||n;p=this.formats[h](l,m,{...d,...i,...g})}catch(g){this.logger.warn(g)}return p}else this.logger.warn(`there was no format function for ${h}`);return l},e)}}const Frr=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class zrr extends pV{constructor(e,r,n,i={}){var a,s;super(),this.backend=e,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=i,this.logger=Yg.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(s=(a=this.backend)==null?void 0:a.init)==null||s.call(a,n,i.backend,i)}queueLoad(e,r,n,i){const a={},s={},o={},l={};return e.forEach(u=>{let h=!0;r.forEach(d=>{const f=`${u}|${d}`;!n.reload&&this.store.hasResourceBundle(u,d)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?s[f]===void 0&&(s[f]=!0):(this.state[f]=1,h=!1,s[f]===void 0&&(s[f]=!0),a[f]===void 0&&(a[f]=!0),l[d]===void 0&&(l[d]=!0)))}),h||(o[u]=!0)}),(Object.keys(a).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(a),pending:Object.keys(s),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(l)}}loaded(e,r,n){const i=e.split("|"),a=i[0],s=i[1];r&&this.emit("failedLoading",a,s,r),!r&&n&&this.store.addResourceBundle(a,s,n,void 0,void 0,{skipCopy:!0}),this.state[e]=r?-1:2,r&&n&&(this.state[e]=0);const o={};this.queue.forEach(l=>{Crr(l.loaded,[a],s),Frr(l,e),r&&l.errors.push(r),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{o[u]||(o[u]={});const h=l.loaded[u];h.length&&h.forEach(d=>{o[u][d]===void 0&&(o[u][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(l=>!l.done)}read(e,r,n,i=0,a=this.retryTimeout,s){if(!e.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:r,fcName:n,tried:i,wait:a,callback:s});return}this.readingCalls++;const o=(u,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(u&&h&&i{this.read(e,r,n,i+1,a*2,s)},a);return}s(u,h)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const u=l(e,r);u&&typeof u.then=="function"?u.then(h=>o(null,h)).catch(o):o(null,u)}catch(u){o(u)}return}return l(e,r,o)}prepareLoading(e,r,n={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();mn(e)&&(e=this.languageUtils.toResolveHierarchy(e)),mn(r)&&(r=[r]);const a=this.queueLoad(e,r,n,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.toLoad.forEach(s=>{this.loadOne(s)})}load(e,r,n){this.prepareLoading(e,r,{},n)}reload(e,r,n){this.prepareLoading(e,r,{reload:!0},n)}loadOne(e,r=""){const n=e.split("|"),i=n[0],a=n[1];this.read(i,a,"read",void 0,void 0,(s,o)=>{s&&this.logger.warn(`${r}loading namespace ${a} for language ${i} failed`,s),!s&&o&&this.logger.log(`${r}loaded namespace ${a} for language ${i}`,o),this.loaded(e,s,o)})}saveMissing(e,r,n,i,a,s={},o=()=>{}){var l,u,h,d,f;if((u=(l=this.services)==null?void 0:l.utils)!=null&&u.hasLoadedNamespace&&!((d=(h=this.services)==null?void 0:h.utils)!=null&&d.hasLoadedNamespace(r))){this.logger.warn(`did not save key "${n}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if((f=this.backend)!=null&&f.create){const p={...s,isUpdate:a},g=this.backend.create.bind(this.backend);if(g.length<6)try{let m;g.length===5?m=g(e,r,n,i,p):m=g(e,r,n,i),m&&typeof m.then=="function"?m.then(v=>o(null,v)).catch(o):o(null,m)}catch(m){o(m)}else g(e,r,n,i,o,p)}!e||!e[0]||this.store.addResource(e[0],r,n,i)}}}const Kse=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),mn(t[1])&&(e.defaultValue=t[1]),mn(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const r=t[3]||t[2];Object.keys(r).forEach(n=>{e[n]=r[n]})}return e},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),YUe=t=>(mn(t.ns)&&(t.ns=[t.ns]),mn(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),mn(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&!t.supportedLngs.includes("cimode")&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),mV=()=>{},Urr=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(r=>{typeof t[r]=="function"&&(t[r]=t[r].bind(t))})};class XP extends pV{constructor(e={},r){if(super(),this.options=YUe(e),this.services={},this.logger=Yg,this.modules={external:[]},Urr(this),r&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,r),this;setTimeout(()=>{this.init(e,r)},0)}}init(e={},r){this.isInitializing=!0,typeof e=="function"&&(r=e,e={}),e.defaultNS==null&&e.ns&&(mn(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));const n=Kse();this.options={...n,...this.options,...YUe(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);const i=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?Yg.init(i(this.modules.logger),this.options):Yg.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=$rr;const h=new zUe(this.options);this.store=new BUe(this.options.resources,this.options);const d=this.services;d.logger=Yg,d.resourceStore=this.store,d.languageUtils=h,d.pluralResolver=new Prr(h,{prepend:this.options.pluralSeparator}),u&&(d.formatter=i(u),d.formatter.init&&d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new HUe(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new zrr(i(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",(f,...p)=>{this.emit(f,...p)}),this.modules.languageDetector&&(d.languageDetector=i(this.modules.languageDetector),d.languageDetector.init&&d.languageDetector.init(d,this.options.detection,this.options)),this.modules.i18nFormat&&(d.i18nFormat=i(this.modules.i18nFormat),d.i18nFormat.init&&d.i18nFormat.init(this)),this.translator=new gV(this.services,this.options),this.translator.on("*",(f,...p)=>{this.emit(f,...p)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,r||(r=mV),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...h)=>this.store[u](...h)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...h)=>(this.store[u](...h),this)});const o=YP(),l=()=>{const u=(h,d)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(d),r(h,d)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),o}loadResources(e,r=mV){var a,s;let n=r;const i=mn(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const o=[],l=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(d=>{d!=="cimode"&&(o.includes(d)||o.push(d))})};i?l(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(h=>l(h)),(s=(a=this.options.preload)==null?void 0:a.forEach)==null||s.call(a,u=>l(u)),this.services.backendConnector.load(o,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(u)})}else n(null)}reloadResources(e,r,n){const i=YP();return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r=void 0),e||(e=this.languages),r||(r=this.options.ns),n||(n=mV),this.services.backendConnector.reload(e,r,a=>{i.resolve(),n(a)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&$Ue.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!["cimode","dev"].includes(e)){for(let r=0;r{this.language=o,this.languages=this.services.languageUtils.toResolveHierarchy(o),this.resolvedLanguage=void 0,this.setResolvedLanguage(o)},a=(o,l)=>{l?this.isLanguageChangingTo===e&&(i(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,n.resolve((...u)=>this.t(...u)),r&&r(o,(...u)=>this.t(...u))},s=o=>{var h,d;!e&&!o&&this.services.languageDetector&&(o=[]);const l=mn(o)?o:o&&o[0],u=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(mn(o)?[o]:o);u&&(this.language||i(u),this.translator.language||this.translator.changeLanguage(u),(d=(h=this.services.languageDetector)==null?void 0:h.cacheUserLanguage)==null||d.call(h,u)),this.loadResources(u,f=>{a(f,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e),n}getFixedT(e,r,n,i){const a=i==null?void 0:i.scopeNs,s=(o,l,...u)=>{let h;typeof l!="object"?h=this.options.overloadTranslationOptionHandler([o,l].concat(u)):h={...l},h.lng=h.lng||s.lng,h.lngs=h.lngs||s.lngs;const d=h.ns!==void 0&&h.ns!==null;h.ns=h.ns||s.ns,h.keyPrefix!==""&&(h.keyPrefix=h.keyPrefix||n||s.keyPrefix);const f={...this.options,...h};Array.isArray(a)&&!d&&(f.ns=a),typeof h.keyPrefix=="function"&&(h.keyPrefix=Hw(h.keyPrefix,f));const p=this.options.keySeparator||".";let g;return h.keyPrefix&&Array.isArray(o)?g=o.map(m=>(typeof m=="function"&&(m=Hw(m,f)),`${h.keyPrefix}${p}${m}`)):(typeof o=="function"&&(o=Hw(o,f)),g=h.keyPrefix?`${h.keyPrefix}${p}${o}`:o),this.t(g,h)};return mn(e)?s.lng=e:s.lngs=e,s.ns=r,s.keyPrefix=n,s}t(...e){var r;return(r=this.translator)==null?void 0:r.translate(...e)}exists(...e){var r;return(r=this.translator)==null?void 0:r.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,r={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=r.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const s=(o,l)=>{const u=this.services.backendConnector.state[`${o}|${l}`];return u===-1||u===0||u===2};if(r.precheck){const o=r.precheck(this,s);if(o!==void 0)return o}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(n,e)&&(!i||s(a,e)))}loadNamespaces(e,r){const n=YP();return this.options.ns?(mn(e)&&(e=[e]),e.forEach(i=>{this.options.ns.includes(i)||this.options.ns.push(i)}),this.loadResources(i=>{n.resolve(),r&&r(i)}),n):(r&&r(),Promise.resolve())}loadLanguages(e,r){const n=YP();mn(e)&&(e=[e]);const i=this.options.preload||[],a=e.filter(s=>!i.includes(s)&&this.services.languageUtils.isSupportedCode(s));return a.length?(this.options.preload=i.concat(a),this.loadResources(s=>{n.resolve(),r&&r(s)}),n):(r&&r(),Promise.resolve())}dir(e){var i,a;if(e||(e=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.length)>0?this.languages[0]:this.language)),!e)return"rtl";try{const s=new Intl.Locale(e);if(s&&s.getTextInfo){const o=s.getTextInfo();if(o&&o.direction)return o.direction}}catch{}const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=((a=this.services)==null?void 0:a.languageUtils)||new zUe(Kse());return e.toLowerCase().indexOf("-latn")>1?"ltr":r.includes(n.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},r){const n=new XP(e,r);return n.createInstance=XP.createInstance,n}cloneInstance(e={},r=mV){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},a=new XP(i);if((e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(o=>{a[o]=this[o]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n){const o=Object.keys(this.store.data).reduce((l,u)=>(l[u]={...this.store.data[u]},l[u]=Object.keys(l[u]).reduce((h,d)=>(h[d]={...l[u][d]},h),l[u]),l),{});a.store=new BUe(o,i),a.services.resourceStore=a.store}if(e.interpolation){const l={...Kse().interpolation,...this.options.interpolation,...e.interpolation},u={...i,interpolation:l};a.services.interpolator=new HUe(u)}return a.translator=new gV(a.services,i),a.translator.on("*",(o,...l)=>{a.emit(o,...l)}),a.init(i,r),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const fu=XP.createInstance();fu.createInstance,fu.dir,fu.init,fu.loadResources,fu.reloadResources,fu.use,fu.changeLanguage,fu.getFixedT,fu.t,fu.exists,fu.setDefaultNamespace,fu.hasLoadedNamespace,fu.loadNamespaces,fu.loadLanguages;const Vrr={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,"!doctype":!0,"!DOCTYPE":!0},Qrr=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function qUe(t){const e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},r=t.match(/<\/?([^\s]+?)[/\s>]/);if(r&&(e.name=r[1],(Vrr[r[1]]||t.charAt(t.length-2)==="/")&&(e.voidElement=!0),e.name.startsWith("!--"))){const a=t.indexOf("-->");return{type:"comment",comment:a!==-1?t.slice(4,a):""}}const n=new RegExp(Qrr);let i=null;for(;i=n.exec(t),i!==null;)if(i[0].trim())if(i[1]){const a=i[1].trim();let s=[a,null];const o=a.indexOf("=");o>-1&&(s=[a.slice(0,o),a.slice(o+1)]),e.attrs[s[0]]=s[1],n.lastIndex--}else i[2]&&(e.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return e}const vV=/|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,Grr=/<\/?([^\s]+?)[/\s>]/,Hrr=/^\s*$/,Wrr=/^(script|style)$/i,KP="\0",Yrr=Object.create(null);function jUe(t){t.forEach(function(e){if(e.type==="text"){e.content=e.content.split(KP).join("<");return}if(e.type==="comment"){e.comment=e.comment.split(KP).join("<");return}for(const r in e.attrs){const n=e.attrs[r];typeof n=="string"&&n.indexOf(KP)>-1&&(e.attrs[r]=n.split(KP).join("<"))}e.children.length&&jUe(e.children)})}function qrr(t,e){const r=e&&e.components||Yrr,n=e&&e.allowedTags;let i=!1;if(n){const g=typeof n=="function"?n:function(b){return n.indexOf(b)>-1};let m="",v=0;vV.lastIndex=0;let y;for(;y=vV.exec(t);){const b=y[0];m+=t.slice(v,y.index);const x=b.match(Grr);b.startsWith("",t}}function Xrr(t){return t.reduce(function(e,r){return e+XUe("",r)},"")}var Krr={parse:qrr,stringify:Xrr};const yV=(t,e,r,n)=>{var a,s,o,l;const i=[r,{code:e,...n||{}}];if((s=(a=t==null?void 0:t.services)==null?void 0:a.logger)!=null&&s.forward)return t.services.logger.forward(i,"warn","react-i18next::",!0);yh(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),(l=(o=t==null?void 0:t.services)==null?void 0:o.logger)!=null&&l.warn?t.services.logger.warn(...i):console!=null&&console.warn&&console.warn(...i)},KUe={},Yk=(t,e,r,n)=>{yh(r)&&KUe[r]||(yh(r)&&(KUe[r]=new Date),yV(t,e,r,n))},ZUe=(t,e)=>()=>{if(t.isInitialized)e();else{const r=()=>{setTimeout(()=>{t.off("initialized",r)},0),e()};t.on("initialized",r)}},Zse=(t,e,r)=>{t.loadNamespaces(e,ZUe(t,r))},JUe=(t,e,r,n)=>{if(yh(r)&&(r=[r]),t.options.preload&&t.options.preload.indexOf(e)>-1)return Zse(t,r,n);r.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,ZUe(t,n))},Zrr=(t,e,r={})=>!e.languages||!e.languages.length?(Yk(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:r.lng,precheck:(n,i)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!i(n.isLanguageChangingTo,t))return!1}}),yh=t=>typeof t=="string",_v=t=>typeof t=="object"&&t!==null,Jrr=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,enr={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},tnr=t=>enr[t],eVe=t=>t.replace(Jrr,tnr);let Jse={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:eVe,transDefaultProps:void 0};const rnr=(t={})=>{Jse={...Jse,...t}},eoe=()=>Jse;let tVe;const nnr=t=>{tVe=t},toe=()=>tVe,bV=(t,e)=>{var n;if(!t)return!1;const r=((n=t.props)==null?void 0:n.children)??t.children;return e?r.length>0:!!r},ZP=t=>{var r,n;if(!t)return[];const e=((r=t.props)==null?void 0:r.children)??t.children;return(n=t.props)!=null&&n.i18nIsDynamicList?Mb(e):e},inr=t=>Array.isArray(t)&&t.every(se.isValidElement),Mb=t=>Array.isArray(t)?t:[t],anr=(t,e)=>{const r={...e};return r.props={...e.props,...t.props},r},snr=t=>{const e={};if(!t)return e;const r=n=>{Mb(n).forEach(a=>{yh(a)||(bV(a)?r(ZP(a)):_v(a)&&!se.isValidElement(a)&&Object.assign(e,a))})};return r(t),e},roe=(t,e,r,n)=>{if(!t)return"";let i="";const a=Mb(t),s=e!=null&&e.transSupportBasicHtmlNodes?e.transKeepBasicHtmlNodesFor??[]:[];return a.forEach((o,l)=>{if(yh(o)){i+=`${o}`;return}if(se.isValidElement(o)){const{props:u,type:h}=o,d=Object.keys(u).length,f=s.indexOf(h)>-1,p=u.children;if(!p&&f&&!d){i+=`<${h}/>`;return}if(!p&&(!f||d)||u.i18nIsDynamicList){i+=`<${l}>`;return}if(f&&d<=1){const m=yh(p)?p:roe(p,e,r,n);i+=`<${h}>${m}`;return}const g=roe(p,e,r,n);i+=`<${l}>${g}`;return}if(o===null){yV(r,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:n});return}if(_v(o)){const{format:u,...h}=o,d=Object.keys(h);if(d.length===1){const f=u?`${d[0]}, ${u}`:d[0];i+=`{{${f}}}`;return}yV(r,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:n,child:o});return}yV(r,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:n,child:o})}),i},onr=(t,e,r,n,i,a,s)=>{if(r==="")return[];const o=i.transKeepBasicHtmlNodesFor||[],l=r&&new RegExp(o.map(x=>`<${x}`).join("|")).test(r);if(!t&&!e&&!l&&!s)return[r];const u=e??{},h=x=>{Mb(x).forEach(A=>{yh(A)||(bV(A)?h(ZP(A)):_v(A)&&!se.isValidElement(A)&&Object.assign(u,A))})};h(t);const d=Object.keys(u),f=x=>/^\d+$/.test(x)||o.indexOf(x)>-1||d.indexOf(x)>-1,p=Krr.parse(`<0>${r}`,{allowedTags:f}),g={...u,...a},m=(x,w,A)=>{var O;const T=ZP(x),S=y(T,w.children,A);return inr(T)&&S.length===0||(O=x.props)!=null&&O.i18nIsDynamicList?T:S},v=(x,w,A,T,S)=>{x.dummy?(x.children=w,A.push(se.cloneElement(x,{key:T},S?void 0:w))):A.push(...se.Children.map([x],O=>{var E;if(O.type===se.Fragment||((E=O.props)==null?void 0:E.i18nIsDynamicList)!==void 0){const _={key:T};return O&&O.props&&Object.keys(O.props).forEach(I=>{I==="children"||I==="i18nIsDynamicList"||(_[I]=O.props[I])}),se.createElement(O.type,_,S?null:w)}const k={key:T};return O&&O.props&&Object.keys(O.props).forEach(_=>{_==="ref"||_==="children"||(k[_]=O.props[_])}),se.cloneElement(O,k,S?null:w)}))},y=(x,w,A)=>{const T=Mb(x),S=Mb(w),O={};return S.reduce((k,E,_)=>{var L,R;const I=((R=(L=E.children)==null?void 0:L[0])==null?void 0:R.content)&&n.services.interpolator.interpolate(E.children[0].content,g,n.language);if(E.type==="tag"){let D=T[parseInt(E.name,10)];!D&&e&&(D=e[E.name]),A.length===1&&!D&&(D=A[0][E.name]),D||(D={});const M={...E.attrs};s&&Object.keys(M).forEach(z=>{const U=M[z];yh(U)&&(M[z]=eVe(U))});const P=Object.keys(M).length!==0?anr({props:M},D):D,N=se.isValidElement(P),F=N&&bV(E,!0)&&!E.voidElement,B=l&&_v(P)&&P.dummy&&!N,V=_v(e)&&Object.hasOwnProperty.call(e,E.name);if(yh(P)){const z=n.services.interpolator.interpolate(P,g,n.language);k.push(z)}else if(bV(P)||F){const z=m(P,E,A);v(P,z,k,_)}else if(B){const z=y(T,E.children,A);v(P,z,k,_)}else if(Number.isNaN(parseFloat(E.name)))if(V){const z=m(P,E,A);v(P,z,k,_,E.voidElement)}else if(i.transSupportBasicHtmlNodes&&o.indexOf(E.name)>-1)if(E.voidElement)k.push(se.createElement(E.name,{key:`${E.name}-${_}`}));else{const z=O[E.name]||0;O[E.name]=z+1;let U,Q=0;for(let Y=0;Y`);else{const z=y(T,E.children,A);k.push(`<${E.name}>${z}`)}else if(_v(P)&&!N){const z=E.children[0]?I:null;z&&k.push(z)}else v(P,I,k,_,E.children.length!==1||!I)}else if(E.type==="text"){const D=i.transWrapTextNodes,M=typeof i.unescape=="function"?i.unescape:eoe().unescape,P=s?M(n.services.interpolator.interpolate(E.content,g,n.language)):n.services.interpolator.interpolate(E.content,g,n.language);D?k.push(se.createElement(D,{key:`${E.name}-${_}`},P)):k.push(P)}return k},[])},b=y([{dummy:!0,children:t||[]}],p,Mb(t||[]));return ZP(b[0])},rVe=(t,e,r)=>{const n=t.key||e,i=se.cloneElement(t,{key:n});if(!i.props||!i.props.children||r.indexOf(`${e}/>`)<0&&r.indexOf(`${e} />`)<0)return i;function a(){return se.createElement(se.Fragment,null,i)}return se.createElement(a,{key:n})},lnr=(t,e)=>t.map((r,n)=>rVe(r,n,e)),cnr=(t,e)=>{const r={};return Object.keys(t).forEach(n=>{Object.assign(r,{[n]:rVe(t[n],n,e)})}),r},unr=(t,e,r,n)=>t?Array.isArray(t)?lnr(t,e):_v(t)?cnr(t,e):(Yk(r,"TRANS_INVALID_COMPONENTS",' "components" prop expects an object or array',{i18nKey:n}),null):null,hnr=t=>!_v(t)||Array.isArray(t)?!1:Object.keys(t).reduce((e,r)=>e&&Number.isNaN(Number.parseFloat(r)),!0);function dnr({children:t,count:e,parent:r,i18nKey:n,context:i,tOptions:a={},values:s,defaults:o,components:l,ns:u,i18n:h,t:d,shouldUnescape:f,...p}){var B,V,z,U,Q,G;const g=h||toe();if(!g)return Yk(g,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.",{i18nKey:n}),t;const m=d||g.t.bind(g)||(X=>X),v={...eoe(),...(B=g.options)==null?void 0:B.react};let y=u||m.ns||((V=g.options)==null?void 0:V.defaultNS);y=yh(y)?[y]:y||["translation"];const{transDefaultProps:b}=v,x=b!=null&&b.tOptions?{...b.tOptions,...a}:a,w=f??(b==null?void 0:b.shouldUnescape),A=b!=null&&b.values?{...b.values,...s}:s,T=b!=null&&b.components?{...b.components,...l}:l,S=roe(t,v,g,n),O=o||(x==null?void 0:x.defaultValue)||S||v.transEmptyNodeValue||(typeof n=="function"?Hw(n):n),{hashTransKey:k}=v,E=n||(k?k(S||O):S||O);(U=(z=g.options)==null?void 0:z.interpolation)!=null&&U.defaultVariables?s=A&&Object.keys(A).length>0?{...A,...g.options.interpolation.defaultVariables}:{...g.options.interpolation.defaultVariables}:s=A;const _=snr(t);_&&typeof _.count=="number"&&e===void 0&&(e=_.count);const I=s||e!==void 0&&!((G=(Q=g.options)==null?void 0:Q.interpolation)!=null&&G.alwaysFormat)||!t?x.interpolation:{interpolation:{...x.interpolation,prefix:"#$?",suffix:"?$#"}},L={...x,context:i||x.context,count:e,...s,...I,defaultValue:O,ns:y};let R=E?m(E,L):O;R===E&&O&&(R=O);const D=unr(T,R,g,n);let M=D||t,P=null;hnr(D)&&(P=D,M=t);const N=onr(M,P,R,g,v,L,w),F=r??v.defaultTransParent;return F?se.createElement(F,p,N):N}const fnr={type:"3rdParty",init(t){rnr(t.options.react),nnr(t)}},nVe=se.createContext();class pnr{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function iVe({children:t,count:e,parent:r,i18nKey:n,context:i,tOptions:a={},values:s,defaults:o,components:l,ns:u,i18n:h,t:d,shouldUnescape:f,...p}){var b;const{i18n:g,defaultNS:m}=se.useContext(nVe)||{},v=h||g||toe(),y=d||(v==null?void 0:v.t.bind(v));return dnr({children:t,count:e,parent:r,i18nKey:n,context:i,tOptions:a,values:s,defaults:o,components:l,ns:u||(y==null?void 0:y.ns)||m||((b=v==null?void 0:v.options)==null?void 0:b.defaultNS),i18n:v,t:d,shouldUnescape:f,...p})}var aVe={exports:{}},sVe={};/** +{{value}}`,original:"原始错误:{{message}}",details:"详细信息"},Aze={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},Sze={close:"关闭",name:"名称",region:"地域",optionalDescription:"描述(可选)",cancel:"取消",create:"创建",creating:"创建中…",save:"保存",saving:"保存中…",upload:"上传",uploading:"上传中…",createSpaceTitle:"新建 Skill 空间",editSpaceTitle:"编辑 Skill 空间",uploadTitle:"上传到 {{name}}",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",archiveValidationFailed:"Skill ZIP 格式校验失败",uploadFailed:"上传 Skill 失败",dropzone:"拖拽 Skill ZIP 到这里",chooseLocalFile:"或点击选择本地文件",archiveHelp:"ZIP 根目录需要包含 SKILL.md,也可以只包含一层包装目录。选择后仅检查格式,不会自动上传。",validating:"正在检查文件格式…",validationPassed:"格式检查通过:{{name}},共 {{count}} 个文件"},Tze={styles:{concise:"简洁实用",strict:"严谨稳健",tutorial:"教程友好",automation:"自动化优先",custom:"自定义",customFallback:"自定义风格"},stages:{preparing:"正在准备 Dev Sandbox",ready:"Skill 已生成并通过格式校验",failed:"生成失败",cancelled:"已停止",validating:"正在校验 Skill 格式",packaging:"正在整理文件",generating:"正在生成 Skill",repairingAgain:"正在再次修复",autoRepairing:"正在自动修复({{attempt}}/{{max}})"},validation:{fallback:"Skill 格式校验未通过",repairInstruction:"只修复下面列出的 Skill 格式错误,不要改变原有用途和内容范围。",recheckInstruction:"修复后重新检查目录结构、SKILL.md frontmatter 和所有文本文件。",nameTooLong:"Skill 名称不能超过 64 个字符",invalidName:"Skill 名称只能包含小写字母、数字和连字符",modelTooLong:"模型 ID 不能超过 128 个字符",invalidModel:"模型 ID 只能包含字母、数字、点、下划线、连字符、斜杠和冒号"},errors:{loadCapability:"读取 Dev Sandbox 配置失败",autoRepair:"自动修复格式错误失败",pollCandidate:"读取候选方案状态失败,正在重试",createCandidate:"创建候选方案失败",refine:"继续调整失败",repairAgain:"再次修复格式错误失败",selectSpace:"请选择上传的 Skill Space",unsupportedRegion:"当前 Skill 地域不受支持",upload:"上传 Skill 失败",download:"下载失败"},sessionMax:"Session 最长保留 1 小时",remaining:"剩余 {{minutes}}:{{seconds}}",unnamedSpace:"未命名 Skill Space",leaveConfirmation:"离开后将停止并释放正在运行的 Dev Sandbox,确定离开吗?",createTitle:"创建技能",optimizeTitle:"优化 {{name}}",skillFallback:"技能",back:"返回技能空间",home:"主页技能生成",basicInfo:"基本信息",goal:"目标",createIntentPlaceholder:"描述希望这个 Skill 完成什么任务",optimizeIntentPlaceholder:"描述希望如何优化当前 Skill",skillName:"Skill 名称",autoNamePlaceholder:"留空时自动生成",nameHelp:"仅支持小写字母、数字和连字符;留空时自动生成。",createPlans:"生成方案",optimizePlans:"优化方案",createPlansDescription:"按不同方案并行生成多个技能,您可以选择最佳结果",optimizePlansDescription:"按不同方案并行优化当前技能,您可以选择最佳结果",plan:"方案 {{count}}",remove:"移除",model:"模型",modelPlaceholder:"选择或输入模型 ID",style:"风格",customStyle:"自定义风格",customStylePlaceholder:"描述表达方式、严谨程度或输出偏好",addConfiguration:"添加配置",notConfigured:"管理员未配置",generate:"生成",candidates:"候选方案",progress:"进度",retryCandidate:"重试此方案",formatValidationFailed:"格式校验未通过",repairAgain:"再次修复",files:"文件",downloadZip:"下载 ZIP",loadingFiles:"正在读取文件…",filesPending:"生成过程中会在这里显示完整文件树",uploadToSpace:"上传到 Skill Space",loadingSpaces:"正在加载 Skill Space",selectSpace:"选择 Skill Space",continuePlaceholder:"继续调整这个候选方案",continue:"继续调整",uploading:"上传中…",overwrite:"覆盖原 Skill",uploadToSelectedSpace:"上传到 Skill Space",uploadToCurrentSpace:"上传到当前空间",allCandidatesFailed:"所有方案均创建失败,可分别重试。"},Cze={invalidFormat:"{{label}}格式错误。",recoveryStatus:"Skill 恢复点状态",errorResponse:"错误响应",errorDetails:"错误详情",missingContentType:"Content-Type 缺失",gatewayError:"{{fallback}}(HTTP {{status}},Content-Type: {{contentType}})。请检查代理或网关配置。",nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},Content-Type: {{contentType}}),请检查代理或网关配置。",activity:"Skill 会话活动",invalidActivity:"Skill 会话活动格式错误。",invalidToolActivity:"Skill 工具活动格式错误。",invalidTextActivity:"Skill 文本活动格式错误。",publication:"Skill 发布结果",task:"Skill 会话",file:"Skill 文件",unknownTaskState:"Skill 会话状态无法识别。",capability:"Skill 工作台能力",loadCapability:"读取 Skill 工作台能力失败",prepareTask:"准备 Skill 会话失败",taskReference:"Skill 会话引用",startOptimization:"开始优化 Skill 失败",startTask:"开始 Skill 会话失败",taskSummary:"Skill 会话摘要",taskList:"Skill 会话列表",loadTaskList:"读取 Skill 会话列表失败",invalidTaskList:"Skill 会话列表格式错误。",loadTask:"读取 Skill 会话失败",artifact:"Skill 产物",artifactFile:"Skill 产物文件",loadArtifact:"读取 Skill 产物失败",refine:"继续调整 Skill 失败",stop:"停止当前 Skill 任务失败",publish:"发布 Skill 失败",nonNdjson:"发布 Skill 失败:服务端返回了非 NDJSON 响应。",missingStream:"发布 Skill 失败:服务端没有返回进度流。",publishProgress:"发布进度",invalidPublishProgress:"发布进度格式错误。",publishError:"发布错误",unknownPublishEvent:"未知的发布进度事件。",publishResult:"发布结果",streamEnded:"发布进度流提前结束,无法确认发布结果。请刷新技能中心确认状态。",deleteTask:"删除 Skill 会话失败",download:"下载 Skill 失败"},prr=Object.freeze(Object.defineProperty({__proto__:null,api:Cze,configSelect:bze,conversation:xze,default:{configSelect:bze,conversation:xze,errorDetails:wze,fileTree:Aze,management:Sze,generation:Tze,api:Cze},errorDetails:wze,fileTree:Aze,generation:Tze,management:Sze},Symbol.toStringTag,{value:"Module"})),Oze={back:"返回上一页",reload:"重新加载",notConfigured:"未配置",name:"名称",description:"描述",delete:"删除",save:"保存",saving:"保存中",add:"添加",manage:"管理",environment:"环境",noDescription:"暂无描述",refresh:"刷新",close:"关闭",retry:"重试",loading:"加载中…",previousPage:"上一页",nextPage:"下一页",edit:"编辑",all:"全部",search:"搜索",cancel:"取消",view:"查看",viewDetails:"查看详情",deleting:"删除中…",create:"创建",creating:"创建中",adding:"添加中",generating:"生成中",uploading:"上传中",preview:"预览",loadFailed:"加载失败",select:"选择",collapse:"收起",expand:"展开",none:"无"},kze={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},Eze={checkUpdates:"检查更新",checkingVersions:"正在检查版本…",versionCheckError:"查询沙箱版本失败,请检查凭据、区域及接口权限后重试",sandboxUpdateError:"Sandbox 更新失败,请刷新检查实际状态后重试",modelEnvRepairUnavailable:"无法补齐模型环境变量,请检查 CODEX_API_KEY 和 CODEX_BASE_URL",updateSandbox:"更新{{variant}}{{name}}",updatingSandbox:"更新中",title:"系统信息",description:"查看当前 Studio 版本及关联的基础资源",general:"通用",currentVersion:"当前版本",storage:"存储",loadingStorage:"正在加载存储信息",tosAddress:"TOS 地址",openTosConsole:"在云控制台中打开 TOS 存储桶",environmentBuild:"环境构建",loadingEnvironmentResources:"正在加载环境构建资源",environmentResourcesError:"环境构建资源加载失败,请检查云凭据后重试。",codePipelineWorkspace:"CodePipeline 工作空间",codePipelinePipeline:"CodePipeline 流水线",openCodePipelineWorkspace:"在云控制台中打开 CodePipeline Workspace",createdOnFirstBuild:"首次构建时自动创建",containerRegistryRepository:"Container Registry 仓库",openContainerRegistryRepository:"在云控制台中打开 Container Registry 仓库",sandboxInfo:"沙箱信息",loadingSandboxInfo:"正在加载沙箱信息",sandboxInfoError:"沙箱信息加载失败,请重试。",snapshot:"快照版",snapshotWithSpace:"快照版 ",openToolConsole:"在云控制台中打开{{name}}",updateModelEnv:"更新{{variant}}{{name}}模型环境变量",modelEnvUpdated:"已更新",modelEnvAlreadyCurrent:"无需更新",userPool:"用户池",loadingUserPool:"正在加载用户池",userPoolError:"用户池加载失败,请重试。",modelEnvUpdateError:"模型环境变量更新失败,请重试。",openUserPoolConsole:"在云控制台中打开用户池{{name}}",unnamedUserPool:"未命名用户池",id:"ID",domain:"域名",region:"区域",noLocalUserPool:"本地模式未配置用户池",noUserPool:"当前 Studio 未配置用户池"},_ze={workspace:"Agent 工作区",library:"Agent 库",evaluation:"评测",agentList:"Agent 列表",agentDetails:"Agent 详情",newAgent:"新建 Agent",loading:"加载中…",loadingCloudAgents:"正在加载云端 Agent…",noAgentSelected:"请选择一个 Agent",local:"本地",remote:"云端",localAgent:"本地 Agent",remoteAgent:"云端 Agent",agentCount:"{{count}} 个 Agent",agentCountLabel:"Agent 数量",details:"详情",chat:"对话",update:"更新",backToAgentList:"返回 Agent 列表",loadingAgent:"正在加载 Agent",loadingAgentDescription:"正在读取 Agent 配置和 Runtime 信息。",loadingAgentInfo:"正在加载 Agent 信息…",detailLoadFailed:"无法加载 Agent 详情",detailLoadFailedDescription:"请检查 Runtime 状态后重试。",partialInfoUnavailable:"部分信息暂时不可用",upgradeRuntimeForDetails:"请升级 Runtime 以查看完整 Agent 信息。",basicInfo:"基本信息",usageOverview:"使用概览",sections:{basic:"基本信息",usage:"使用概览",evaluations:"评测",optimizations:"优化建议",integrations:"集成",versions:"版本"},evaluationGroup:"评测组",optimizations:"优化建议",optimizationsDescription:"根据评测结果查看可执行的优化建议。",integrations:"集成",githubVersions:"GitHub 版本",githubVersionsDescription:"查看持续交付产生的版本并创建回退 PR。",currentVersionOnly:"当前未启用 GitHub 持续交付,仅展示当前生产版本。",loadingVersions:"正在加载版本…",noVersion:"暂无版本记录",prLink:"Pull Request",viewPr:"查看 PR",author:"提交人",publishStatus:"发布状态",viewRelease:"查看发布记录",rollbackToVersion:"回退到此版本",rollingBack:"正在创建回退…",rollbackEvent:"回退事件",sourceMergedRuntimeStill:"最新源码已合并,但 Runtime 仍处于",currentProductionVersionHint:";当前生产版本保持不变。",usageSummary:"使用统计",totalCalls:"总调用次数",userCount:"用户数",userDetails:"用户明细",usageUserList:"Agent 使用用户列表",user:"用户",callCount:"调用次数",lastUsed:"最近使用",unknownUser:"未知用户",loadingUsage:"正在加载使用数据…",refreshing:"刷新中…",noUsage:"暂无使用记录",usageUnavailable:"当前 Agent 暂无可用的使用统计。",usagePagination:"使用记录分页",pageOf:"第 {{page}} / {{total}} 页",notProvided:"暂未提供",integrationMethods:"集成方式",integrationDescription:"通过 Runtime API 或 A2A 协议集成当前 Agent。",integrationProtocol:"集成协议",runtimeStatus:"Runtime 状态",executionFlow:"执行流程",probingIntegration:"正在检测集成能力",probingIntegrationDescription:"正在读取可用端点和鉴权配置。",configurationStatus:"配置状态",discoveryEndpoint:"发现端点",invocationEndpoint:"调用端点",invocationUrl:"调用地址",authentication:"鉴权方式",networkAccess:"网络访问",notAvailable:"暂无",noAuthentication:"无需鉴权",noApiKeyRequired:"无需 API Key",usesOauthJwt:"使用 OAuth / JWT",showApiKey:"显示 API Key",hideApiKey:"隐藏 API Key",pythonExample:"Python 示例",deploymentConfig:"部署配置",deploymentConfigDescription:"确认实例和运行配置后更新 Runtime。",deploymentRegion:"部署区域",concurrency:"并发数",selectedOptimizations:"已选优化项",selectedOptimizationsDescription:"这些优化会应用到本次更新。",optimizationProfile:"优化方案",updatePending:"等待更新",updatingDeployment:"正在更新部署",restoringUpdateConfig:"正在恢复更新配置…",updateConfigUnavailable:"无法读取更新配置",legacyConfigMissing:"旧版本 Runtime 缺少可恢复的配置,请重新创建。",deploymentFailed:"部署失败",continueEditing:"继续编辑",loadingOptimizations:"正在加载优化建议…",noOptimizations:"暂无优化建议",fixPriority:"优先级",suggestedModule:"建议模块",suggestionAndReason:"建议与原因",priority:{high:"高",medium:"中",low:"低"},modules:{agentStructure:"Agent 结构",prompt:"提示词",tool:"工具",knowledge:"知识库",memory:"记忆",workflow:"工作流",other:"其他"},evaluationGroupList:"评测组列表",newEvaluationGroup:"新建评测组",newEvaluationGroupName:"新评测组 {{count}}",searchEvaluationGroups:"搜索评测组",noMatchingEvaluationGroups:"没有匹配的评测组",noEvaluationGroupSelected:"请选择一个评测组",groupStats:"{{agents}} 个 Agent · {{runs}} 次运行",evaluationGroupDetails:"评测组详情",evaluationGroupStats:"{{agents}} 个 Agent · {{caseSet}} · {{runs}} 次运行",startEvaluation:"开始评测",evaluationConfig:"评测配置",historyResults:"历史结果",participatingAgents:"参与 Agent",selectedCount:"已选择 {{count}} 个",evaluationResources:"评测资源",evaluationSet:"评测集",evaluator:"评估器",caseCount:"{{count}} 条案例",evaluationMetrics:"评测指标",selectedMetricCount:"已选择 {{count}} 项",historyDescription:"查看每次评测的分数和运行状态。",noHistory:"暂无评测历史",noHistoryDescription:"运行一次评测后,结果会显示在这里。",evaluationRun:"第 {{index}} 次评测",evaluationRunMeta:"{{time}} · {{agents}} 个 Agent",overallScore:"综合分",completed:"已完成",evaluationDefaults:{coreRegression:"核心能力回归",safetyCheck:"安全与幻觉检查",coreSet:"核心回归集",safetySet:"安全边界集",toolSet:"工具调用集",qualityEvaluator:"综合质量评估器",factualEvaluator:"事实一致性评估器",toolEvaluator:"工具调用评估器",responseQuality:"回答质量",factualAccuracy:"事实准确性",toolUse:"工具调用",responseEfficiency:"响应效率",todayTime:"今天 10:32",yesterdayTime:"昨天 16:08",julyTime:"7 月 25 日 14:20",justNow:"刚刚"},defaultCases:{agentName:"示例 Agent",goodSetName:"示例正向案例集",badSetName:"示例负向案例集",weeklyFeedback:{input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",tag:"总结",reason:"任务完整覆盖了用户目标,输出结构清晰,并给出了可执行的下一步动作。"},research:{input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",tag:"工具调用"},uncertainConclusion:{input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",tag:"幻觉",reason:"信息不足时仍给出了确定结论,缺少必要的澄清步骤与不确定性说明。"},repeatedTool:{input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",tag:"效率"}},goodCases:"正向案例",badCases:"负向案例",goodCase:"正向案例",badCase:"负向案例",reference:"参考答案",caseResultFilter:"案例结果筛选",feedbackSourceFilter:"反馈来源筛选",searchCases:"搜索案例",searchCasesPlaceholder:"搜索输入、输出或标签",selectCases:"选择案例",selectAll:"全选",selectAllVisible:"选择当前可见案例",selectedCaseCount:"已选择 {{count}} 条",deleteSelected:"删除所选",deleteSelectedTitle:"删除所选 Agent",deleteSelectionDescription:"确定删除所选的 {{count}} 个项目吗?此操作无法撤销。",deleteCasesConfirm:"删除所选案例",deleteOneCaseConfirm:"删除这个案例",deleteFeedbackCase:"删除反馈案例",noFeedbackCases:"暂无反馈案例",noMatchingCases:"没有匹配的案例",loadingEvaluationSet:"正在加载评测集…",userInput:"用户输入",agentOutput:"Agent 输出",score:"得分",scoreReason:"评分原因",noUserInput:"暂无用户输入",noVisibleResponse:"暂无可见回复",note:"备注:",manualFeedback:"人工反馈",automaticFeedback:"自动反馈",scoreValue:"{{score}} 分",unknownTime:"时间未知",deleteAgentTitle:"删除 Agent",deleteAgentDescription:"确定删除 Agent“{{name}}”吗?",deleteDraftDescription:"确定删除草稿“{{name}}”吗?",deleteAgent:"删除 Agent",closeDeleteConfirmation:"关闭删除确认",draftDeletionWarning:"草稿将从当前浏览器中删除。",runtimeDeletionWarning:"Runtime 和相关云端资源将被删除。",noneSelected:"尚未选择",none:"无",notPublished:"未发布",notRecorded:"未记录",noTime:"暂无时间",noPr:"暂无 PR",comingSoon:"评测能力即将开放",preparing:"准备中",cancelled:"已取消",failed:"失败",totalCount:"共 {{count}} 条",deploymentProgress:"部署进度",returnToEdit:"返回编辑",buildLog:"构建日志",githubMountLog:"GitHub 挂载日志",githubDeliveryMountLog:"GitHub 持续交付挂载日志",waitingBuildLog:"正在等待构建日志…",waitingGithubMountLog:"正在等待 GitHub 挂载日志…",copy:"复制",copied:"已复制",copyLabel:"复制{{label}}",copiedLabel:"已复制{{label}}",logLines:"{{count}} 行",logStatus:{synced:"已同步",failed:"读取失败",syncing:"同步中",earlyOmitted:"已省略早期日志",recentOnly:"仅显示最近的构建日志",partiallyOmitted:"已省略部分日志"},deployStatus:{running:"正在部署",unconfirmed:"部署状态待确认",success:"部署完成",error:"部署失败",cancelled:"部署已取消"},deploymentSteps:{prepare:{label:"准备部署",description:"校验配置并创建部署任务"},build:{label:"构建镜像",description:"生成运行环境与智能体代码"},deploy:{label:"部署服务",description:"创建并启动 AgentKit Runtime"},publish:{label:"发布服务",description:"等待服务就绪并生成访问地址"},complete:{label:"部署完成",description:"智能体已可以正常使用"},evaluation:{label:"创建评测集",description:"自动创建 Good Case 和 Bad Case 评测集"},github:{label:"挂载 GitHub 持续交付",description:"初始化目标分支与 GitHub Actions workflow"},update:{label:"更新实例配置",description:"将 Runtime 实例数调整为 {{min}}~{{max}}"}},githubStatus:{published:"已发布",publishing:"发布中",failed:"发布失败",pending:"等待发布",unknown:"未知"},errors:{agentInfoMissing:"Agent 信息不可用",checkUpdateCapability:"无法检查更新能力",checkingUpdateConfig:"正在检查更新配置",cloudOnlyUpdate:"仅云端 Agent 支持更新",deleteDeployedUnsupported:"当前不支持删除已部署 Agent",deleteDraftUnsupported:"当前不支持删除草稿",loadAgentInfo:"无法加载 Agent 信息",loadApiKey:"无法读取 API Key",loadGithubVersions:"无法加载 GitHub 版本",loadEvaluations:"无法加载评测案例",loadOptimizations:"无法加载优化建议",loadRuntimeDetails:"无法加载 Runtime 详情",loadUsage:"无法加载使用数据",noCreatePermission:"当前账号没有创建 Agent 的权限",noManagePermission:"当前账号没有管理此 Agent 的权限",originalConfigUnavailable:"原始配置不可用",probeIntegration:"无法检测集成能力",rollbackVersion:"无法创建版本回退",runtimeRegionMissing:"Runtime 区域信息缺失",updateCapabilityMismatch:"Runtime 更新能力与当前配置不匹配",updateCapabilityPending:"Runtime 更新能力仍在确认中",updateConfigRestoring:"正在恢复更新配置",updateUnsupported:"当前 Runtime 不支持更新",usageMismatch:"返回的使用数据与当前 Agent 不匹配"}},Rze={title:"环境",loadFailed:"环境加载失败,请检查存储配置后重试。",create:"新建环境",configure:"配置环境",details:"环境详情",editorDescription:"配置运行环境,或接入代码仓库和已有镜像",backToList:"返回环境列表",save:"保存环境",createAndBuild:"创建并构建",saveAndBuild:"保存并构建",name:"环境名称",namePlaceholder:"Python 数据处理",descriptionPlaceholder:"说明这个环境适合处理的任务",creationMethod:"创建方式",baseConfiguration:"基础配置",baseEnvironment:"基础环境",operatingSystem:"操作系统",pythonVersion:"Python 版本",fixedByBase:"由 {{base}} 固定为 {{value}}",selectUbuntuVersion:"选择基础镜像的 Ubuntu 版本",selectPythonVersion:"选择需要安装的 Python 版本",skills:"技能",addSkill:"添加环境技能",veadkDescription:"Agent 开发与运行框架",customDockerfile:"自定义 Dockerfile",presetEnvironment:"预制环境",presetHint:"选择“无”可自行填写 Dockerfile 第一行的基础镜像。",dockerfileSize:"{{size}} / {{max}} 字节",upload:"上传",reset:"重置",dockerfileBaseImage:"Dockerfile 基础镜像",dockerfileContent:"Dockerfile 内容",region:"区域",search:"搜索环境",manualImport:"手动导入",noMatches:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称",startBuild:"开始构建",build:"构建",unnamed:"未命名环境",listSeparator:"、",clipboardReadError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",creation:{custom:{label:"自定义配置",description:"通过表单选择基础环境、Python、工具和技能"},dockerfile:{label:"自定义 Dockerfile",description:"上传或直接编辑 Dockerfile"},git:{label:"从代码仓库构建",description:"探查公开仓库并通过 CodePipeline 构建"},image:{label:"使用已有镜像",description:"绑定由外部流水线交付的 CR 镜像"}},baseDescriptions:{"aio-sandbox":"内置 Sandbox Shell 能力 · Ubuntu 22.04","codex-sandbox":"内置 Codex CLI、浏览器与代码执行环境",ubuntu:"标准 Linux 基础镜像"},dockerfileValidation:{baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"},presets:{none:"自行填写 Dockerfile 基础镜像",aio:"内置 Sandbox Shell 与常用运行时",codex:"内置 Codex CLI、浏览器与代码执行环境"},categories:{tools:"工具",productivity:"效率",browser:"浏览器自动化",system:"系统与媒体"},options:{"lark-cli":"飞书开放平台命令行工具",pandoc:"文档格式转换工具",opencli:"将网站与桌面应用转换为命令行工具",uv:"快速 Python 包与项目管理器",ripgrep:"高性能文本检索工具",jq:"JSON 查询与转换工具","github-cli":"在终端中管理 GitHub 工作流",playwright:"浏览器自动化与端到端测试",chromium:"无头浏览器运行时",git:"代码版本管理",curl:"网络请求与文件下载",ffmpeg:"音视频转码与处理",imagemagick:"图片转换与批处理"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",hoursMinutes:"{{hours}} 小时 {{minutes}} 分"},buildStatus:{preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"构建失败",notBuilt:"未构建"},manifest:{title:"环境 Manifest",closeLabel:"关闭环境 Manifest",loading:"正在加载 Manifest",editorLabel:"环境 Manifest YAML",copyFailed:"复制失败,请重试",copied:"已复制",copy:"复制 Manifest",view:"查看环境 Manifest",viewShort:"查看 Manifest",unavailable:"尚无可用 Manifest"},buildDetails:{title:"构建详情",closeLabel:"关闭构建详情",currentStep:"当前步骤",waiting:"等待构建信息",elapsed:"已用时",sourceCommit:"源码提交",openCodePipeline:"在 CodePipeline 中查看",starting:"正在启动",rebuild:"重新构建"},git:{sectionLabel:"公开代码仓库",address:"Git 地址",ref:"Branch、Tag 或 Commit",defaultBranch:"默认分支",inspecting:"正在拉取仓库并查找 Dockerfile",foundDockerfiles:"已在提交 {{commit}} 中找到 {{count}} 个 Dockerfile。",savedDockerfileLoaded:"已载入保存的 Dockerfile,可重新探查仓库更新。",noDockerfile:"仓库中未找到 Dockerfile,请检查分支或仓库内容。",inspectAgain:"重新探查",selectDockerfile:"选择 Dockerfile"},repository:{outputSection:"构建输出",type:"镜像仓库类型",managed:"Studio 默认镜像仓库",existing:"已有镜像仓库",managedHint:"构建时自动创建或复用当前区域的 Studio 镜像仓库。"},existingImage:{sectionLabel:"已有镜像",reference:"Tag 或 Digest",placeholder:"latest 或 sha256:...",hint:"填写镜像 Tag,或以 sha256: 开头的完整 Digest。"},share:{action:"分享",title:"分享环境",closeLabel:"关闭分享环境",generating:"正在生成并复制分享码",copied:"分享码已复制",failed:"分享失败",code:"分享码",fullCode:"完整环境分享码",copiedHint:"分享码已自动复制,也可在这里查看或手动复制。",copyFailedHint:"自动复制失败,可手动复制上方分享码,或重试。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅发送给可信对象。",copyAgain:"再次复制"},import:{title:"导入环境",closeLabel:"关闭导入环境",description:"先检测分享码中的环境,再确认添加到当前账号。",code:"环境分享码",tooMany:"最多可一次导入 {{max}} 个环境,当前检测到 {{count}} 个分享码。",multipleHint:"多个分享码可使用英文逗号、中文逗号或换行分隔,重复项会自动忽略。",safety:"分享码可能包含环境配置与本地 Skill 内容,请仅导入可信来源的分享码。",inspectingCodes:"正在检测环境分享码",found:"检测到 {{count}} 个环境:{{names}}。",itemError:"第 {{index}} 个分享码:{{error}}",invalidCode:"分享码无效。",noResult:"服务未返回该分享码的导入结果。",partial:"已导入 {{created}} 个环境,{{remaining}} 个未完成,可重试有效失败项。",inspecting:"正在检测",importing:"正在导入",retryImport:"重试导入",confirm:"确认导入",inspectCodes:"检测分享码"},status:{boundImage:"环境“{{name}}”已绑定已有镜像",queued:"环境“{{name}}”已进入构建队列",savedBuildFailed:"环境已保存,但构建未启动:{{error}}",importedFailed:"已导入 {{created}} 个环境,{{failed}} 个失败",importedDuplicate:"已导入 {{created}} 个环境,{{duplicate}} 个分享码已存在",imported:"已导入 {{count}} 个环境",deleted:"已删除环境“{{name}}”"},deleteTitle:"删除环境",deleteDescription:"确定删除环境“{{name}}”吗?删除后无法恢复。",errors:{repositoryRequired:"请输入公开代码仓库地址。",repositoryHttps:"请输入公开仓库的 HTTPS 地址。",repositoryInvalid:"请输入有效的公开仓库 HTTPS 地址。",imageReferenceWhitespace:"Tag 或 Digest 不能包含空格。",imageDigestInvalid:"Digest 必须是完整的 sha256 值。",imageTagOnly:"这里只填写 Tag,不要重复填写镜像仓库路径。"}},Dze={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},Lze={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},Mze={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},Ize={defaultLabel:"Studio 默认环境",defaultDescription:"使用 Studio 预置的标准运行环境",status:{notBuilt:"未构建",preparing:"准备中",queued:"排队中",building:"构建中",scanning:"扫描中",available:"可用",failed:"失败"},label:"运行环境",placeholder:"请选择运行环境",search:"搜索运行环境",loading:"正在加载运行环境…",loadFailed:"加载运行环境失败",noMatches:"未找到匹配的运行环境",unavailable:"当前没有可用的运行环境",selectionUnavailable:"所选运行环境当前不可用,请重新选择。",selectionHint:"选择构建完成的运行环境后,部署将使用其镜像和工具配置。",versionChanged:"所选环境版本已更新,请确认后继续。",versionMissing:"所选环境版本已不存在,请重新选择。",operatingSystem:"操作系统",language:"语言",image:"镜像",imageVersion:"镜像版本",skills:"技能",tools:"工具",noSkills:"未配置 Skill",noExtraTools:"未配置额外工具",defaultGuidance:"默认环境由 Studio 管理,无需额外配置。",persistenceFallback:"持久化环境服务暂不可用,当前使用默认环境。",emptyFallback:"当前没有可选择的自定义环境。"},Pze={repository:"GitHub 仓库",githubUrl:"GitHub 地址",token:"访问令牌",sessionToken:"{{provider}} 临时令牌",runtime:"Runtime",commit:"提交",workflow:"工作流",syncFailed:"同步 GitHub 代码失败",status:{mounted:"已挂载",bound:"已绑定",synced:"已同步",created:"已创建"},volcengine:"火山引擎",mountDelivery:"挂载持续交付",selectedForDeployment:"已选择,部署时挂载",mountOnDeploy:"部署时挂载持续交付",syncCode:"同步代码",deliveryMode:"GitHub 交付模式",sourceSync:"GitHub 代码同步",delivery:"GitHub 交付",loading:"读取中",running:"执行中",runtimeDeliveryHint:"写入 AgentKit Runtime GitHub Actions workflow,后续 GitHub 提交会更新绑定 Runtime。",initialDeliveryHint:"首次部署成功后初始化目标分支,后续 GitHub 提交会更新绑定 Runtime。",sourceSyncHint:"Studio 会直接 push 到目标分支;该分支由 Studio 管理,远端冲突时同步会失败。Runtime 仍由部署按钮发布。",tokenPlaceholder:"repo 或 contents write 权限",getToken:"获取 Token",hideToken:"隐藏 Token",showToken:"显示 Token",tokenHelp:"Token 仅用于本次操作,成功后不会保留在表单中。",targetBranch:"目标分支",actionsSecretPlaceholder:"用于写入 GitHub Actions Secret",sessionTokenPlaceholder:"临时凭证可选",syncing:"同步中…",pendingHint:"已选择挂载持续交付。点击部署后,Studio 会等待 Runtime 创建完成并初始化 GitHub 目标分支,初始化成功后才完成部署流程。",result:{deliveryMounted:"已挂载持续交付",deliverySelected:"已选择挂载持续交付",githubBound:"已绑定 GitHub",codeSynced:"代码已同步",deliveryHint:"目标分支提交会触发 Runtime 持续交付。",boundHint:"更新并发布时会先同步当前源码到这个分支。"},branch:"分支",viewPr:"查看 PR",createFailed:"创建失败",phase:"阶段",log:"日志"},Nze={name:"飞书",enabling:"正在启用并更新配置…",description:"接收消息并通过飞书机器人回复",configuration:"飞书配置",configurationMode:"飞书配置方式",automatic:"自动配置",manual:"手动配置",cancelling:"取消中…",scanToCreate:"扫码创建",scanDescription:"授权后自动回填凭据",generateQrCode:"生成二维码",qrCodeAlt:"飞书机器人配置二维码",scanToConfirm:"飞书扫码确认",expiresIn:"{{time}} 后失效",created:"机器人已创建",credentialsFilled:"应用凭据已自动回填",qrCodeExpired:"二维码已失效",automaticFailed:"自动配置失败",regenerateQrCode:"请重新生成二维码。",configuredPlaceholder:"已配置,留空沿用",appSecretPlaceholder:"请输入 App Secret",hideSecret:"隐藏 App Secret",showSecret:"显示 App Secret"},Bze={mode:{auto:"自动创建",autoDescription:"部署时自动创建所需资源",recommended:"推荐",create:"指定名称",createDescription:"使用指定名称创建或复用资源",existing:"选择已有",existingDescription:"从当前账号的已有资源中选择"},selectExisting:"请选择已有资源",searchResource:"搜索资源名称",noMatch:"未找到匹配资源",noAvailable:"暂无可用资源",searching:"正在搜索云资源…",loading:"正在加载云资源…",noMatchSentence:"未找到匹配资源。",noAvailableSentence:"暂无可用资源。",loadedSummary:"实际服务区域:{{region}} · 已加载 {{loaded}}{{total}}",registryInstance:"Registry 实例",registryAriaLabel:"镜像仓库 Registry 实例",namespace:"命名空间",namespaceAriaLabel:"镜像仓库 Namespace",repository:"镜像仓库",existingRepository:"已有镜像仓库",selectRegistryFirst:"请先选择 Registry 实例。",selectNamespaceFirst:"请先选择 Namespace。",configurationMode:"配置方式",configurationModeAriaLabel:"{{resource}}配置方式",selectConfigurationMode:"请选择配置方式",automaticNames:"自动创建名称",validation:{tos:"请填写或选择 TOS 存储桶。",cr:"请完整填写或选择 CR 实例、命名空间和镜像仓库。",codePipeline:"请完整填写或选择 CodePipeline Workspace 和 Pipeline。",existingCodePipeline:"请选择已有的 CodePipeline Workspace 和兼容 Pipeline。"},autoBucketWithRegion:"agentkit-platform-{账号 ID}-{{region}}",autoBucket:"agentkit-platform-{账号 ID}",tosBucket:"TOS 存储桶",bucketName:"存储桶名称",bucketNamePlaceholder:"输入存储桶名称",existingBucket:"已有存储桶",existingTosBucket:"已有 TOS 存储桶",bucket:"存储桶",accountIdResolved:"账号 ID 在部署时按当前云账号解析。",containerRegistry:"容器镜像仓库(CR)",instanceName:"实例名称",crInstance:"CR 实例",existingCrInstance:"已有 CR 实例",existingCrNamespace:"已有 CR 命名空间",existingCrRepository:"已有 CR 镜像仓库",autoRegistry:"agentkit-platform-{账号 ID}",autoRepositoryName:"{{name}}-{4 位随机字符}",registryNameNote:"账号 ID 在部署时解析,镜像仓库的随机字符在部署时生成。",workspace:"工作空间",pipeline:"流水线",workspaceName:"Workspace 名称",pipelineName:"Pipeline 名称",existingWorkspace:"已有 CodePipeline Workspace",compatiblePipeline:"兼容 Pipeline",existingPipeline:"已有 AgentKit CodePipeline",pipelineNameNote:"Pipeline 与 Runtime 名称一致。"},$ze={commit:"提交",steps:{permissions:"预检 OTA 所需权限",resolving:"读取目标版本信息",downloading:"下载并校验完整更新包",preparing:"准备 VeFaaS Function 代码",provisioning:"检查并补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布新 Revision 并重启服务"},stages:{permissions:"预检 OTA 权限",resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",provisioning:"补齐 Studio 云资源",scheduler:"更新定时任务调度服务",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"},duration:{seconds:"{{count}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},logPermissionPrefix:"无法读取 VeFaaS 发布日志。Function 角色缺少 ",logPermissionSuffix:" 权限,更新会继续。",openIamConsole:"前往 IAM 控制台配置权限",deploymentProgress:"部署进度",live:"实时",completed:"已完成",stopped:"已停止",copied:"已复制",copyFailed:"复制失败",copyLog:"复制日志",waitingForLogs:"等待 VeFaaS 返回更新日志…",noLogs:"本次更新未返回发布日志",messages:{updated:"Studio 已更新,新 Revision 已接管服务",failed:"Studio 更新失败",timeout:"等待 VeFaaS 发布超时,请稍后重新检查版本",submitted:"更新已提交,正在等待 VeFaaS 发布新版本",connectionSwitched:"连接已切换,正在确认新版本状态"},checkingPermissions:"正在检查 OTA 权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",updated:"Studio 已更新",updateToVersion:"更新 Studio 至 {{version}}",checkPermissions:"检查更新权限",authorizationNeeded:"需要授权",updatingShort:"正在更新",refreshForNewVersion:"刷新使用新版",updateFailed:"更新失败",updateNow:"立即更新",newVersionAvailable:"有新版更新",dialog:{failed:"Studio 更新失败",checkingPermissions:"正在检查更新权限",authorizationRequired:"需要 IAM 授权",updating:"正在更新 Studio",completed:"Studio 更新完成",newVersion:"发现新版本"},permissionCheck:"正在核对 OTA 与定时任务所需的全部 IAM 权限…",permissionCheckHint:"权限全部满足后才会开始下载、更新或发布云资源。",missingPermissionCount:"当前 Function 角色缺少 {{count}} 项 OTA 更新权限,尚未执行任何云资源变更。",functionRole:"Function 角色",currentRole:"当前运行角色",policyToUpdate:"将更新策略",authorizationSteps:{open:"打开授权页面,确认已预填的策略名称和完整策略内容。",debug:"点击页面中的“发起调试”,完成策略更新。",return:"返回此窗口,点击“我已授权,重新检查”。"},missingPermissions:"缺少的权限",openPrefilledAuthorization:"打开已预填的 IAM 授权页面",openIamManually:"前往 IAM 控制台手动配置",noSafePolicy:"当前角色没有唯一可安全更新的自定义策略,请由管理员将上述权限加入该角色。",failedStage:"失败阶段",errorId:"错误 ID",notGenerated:"未生成",openFunctionLogs:"前往 VeFaaS 控制台查看 Function 日志",targetVersion:"目标版本",updateStatus:"更新状态",elapsed:"已用时",progressAriaLabel:"Studio 更新进度",processingUpdate:"正在处理更新",processing:"正在处理",backgroundHint:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。",confirmDescription:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、流式响应或部署任务可能中断,登录态不会受到影响。",selectVersion:"选择版本",currentVersion:"当前版本",changelog:"更新内容",noChangelog:"暂无更新说明",runInBackground:"后台运行",authorizedRecheck:"我已授权,重新检查",tryAgain:"重新尝试"},Fze={deploy:"部署",update:"更新",planHash:"方案哈希",backToConfiguration:"返回配置",releaseRegion:"发布区域",deployRegion:"部署区域",regionPreserved:"更新时沿用现有 Runtime 的部署区域,无法修改。",unnamedAgent:"未命名 Agent",deployTitle:"部署 {{name}}",additionalAgentCount:" 等 {{count}} 个智能体",releaseOverview:"发布概览",agentOverview:"Agent 概览",agentCount:"Agent 数量",model:"模型",systemPrompt:"系统提示词",optimizations:"优化选项",notEnabled:"未启用",effectiveCapabilities:"生效能力",automaticProtection:"自动保护",artifactActions:"发布产物操作",exportYaml:"导出 YAML",viewSource:"查看源代码",downloadSource:"下载源代码",expandFlow:"放大查看执行流程",expand:"放大查看",deploymentConfiguration:"部署配置",runtimeName:"Runtime 名称",runtimeNamePreserved:"更新时保持现有 Runtime 名称不变。",runtimeNameHint:"默认根据 Root Agent 名称生成,并添加随机后缀避免重名;支持 4-64 位字母、数字、连字符和下划线",accessAuthentication:"访问鉴权",authenticationPreserved:"更新时保持现有 Runtime 的鉴权方式不变。",authenticationMethod:"鉴权方式",authenticationAriaLabel:"部署鉴权方式",authenticationPlaceholder:"请选择鉴权方式",messageChannels:"消息渠道",instanceSettings:"实例设置",minInstances:"最小实例数",maxInstances:"最大实例数",sidecarSingleInstance:"Harness Sidecar 首期仅支持单实例,Runtime 固定为 1~1",inMemorySingleInstance:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1",network:"网络",networkPreserved:"现有 Runtime 的区域与网络模式保持不变。",networkMode:"网络模式",networkModes:{public:"公网",both:"公网 + VPC"},subnetId:"子网 ID",subnetHint:"可选,多个用逗号分隔",sharedInternetAccess:"VPC 内共享公网出口",evaluationSets:"评测集",createEvaluationSets:"自动创建评测集",createEvaluationSetsHint:"部署成功后,自动创建 Good Case 和 Bad Case 评测集。",resourceConfiguration:"资源配置",environmentVariables:"环境变量",environmentVariablesHint:"组件配置会自动同步到这里,部署前可核对最终值。",itemCount:"{{count}} 项",addVariable:"添加变量",componentGenerated:"组件自动生成",injectedByApiKey:"由所选 API Key 注入",envNameAriaLabel:"{{key}} 环境变量名",envDescriptionAriaLabel:"{{key}}说明:{{description}}",openOpenViking:"打开 OpenViking {{label}}",openOpenVikingAriaLabel:"{{key}}:打开 OpenViking {{label}}",requiredEmpty:"必填,尚未填写",optionalEmpty:"可选,尚未填写",envValueAriaLabel:"{{key}} 环境变量值",automatic:"自动",synced:"同步",customModelCredentials:"自定义模型凭据",releaseOnlySecret:"必填,仅用于本次发布",thisRelease:"本次发布",customVariables:"自定义变量",value:"值",deleteVariable:"删除变量",deploymentProgress:"部署进度",retryUpdate:"重试更新",retryDeploy:"重试部署",updateSucceeded:"更新成功",deploySucceeded:"部署成功",region:"区域",agentName:"Agent 名称",apiEndpoint:"API 端点",connecting:"连接中…",chatNow:"立即对话",console:"控制台",actionInProgress:"{{action}}中…",checkingName:"正在检查名称…",retryAction:"重试{{action}}",flowPreview:"执行流程预览",executionFlow:"执行流程",flowPreviewHint:"只读预览,可缩放与拖动画布",closeFlowPreview:"关闭执行流程预览",agentAdded:'Agent "{{name}}" 已添加到左上角下拉列表!',files:{preview:"文件预览",new:"新建文件",empty:"暂无文件",noneSelected:"未选择文件",selectToView:"选择左侧文件以查看内容",loadingEditor:"加载编辑器…",rename:"重命名",renamePrompt:"重命名文件"},apiKey:{selectFirst:"请先选择 API Key",revealing:"正在显示 API Key",hide:"隐藏 API Key",retryReveal:"重试显示 API Key",reveal:"显示 API Key"},task:{preparing:"准备部署",waitingBuildLog:"正在等待构建日志…",waitingGithubLog:"正在等待 GitHub 挂载日志…",syncingGithub:"正在同步当前源码到 GitHub",syncGithubCode:"同步 GitHub 代码",githubSynced:"GitHub 代码已同步",githubSubmitted:"GitHub 代码已提交",githubUpdatingRuntime:"代码已提交到 GitHub,GitHub Actions 正在更新同一个 Runtime",initializingGithub:"开始初始化 GitHub main 分支与 Actions workflow",initializingGithubBranch:"正在初始化 GitHub 持续交付目标分支",mountGithubDelivery:"挂载 GitHub 持续交付",githubBranchInitialized:"GitHub 持续交付已初始化目标分支",githubDeliveryMounted:"GitHub 持续交付已挂载",githubMountFailed:"挂载 GitHub 持续交付失败",githubMountFailedDetail:"GitHub 持续交付挂载失败:{{message}}",githubMountFailedHint:"挂载 GitHub 持续交付失败,详见 GitHub 日志。",deploymentComplete:"部署完成",deployedNotConnected:"部署完成,暂未连接",cancelled:"已取消",cancelledHint:"部署已取消,相关 Runtime 资源已请求销毁。",deploymentStatusUnconfirmed:"部署状态待确认",deploymentFailed:"部署失败",buildFailedHint:"构建镜像失败,详见构建日志。"},confirm:{updateTitle:"确认更新",deployTitle:"确认部署",closeLabel:"关闭部署确认",updateDescription:"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?",deployDescription:"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?",update:"确定更新",deploy:"确定部署"},userPool:{label:"用户池",unnamed:"未命名用户池",current:"当前用户池",ariaLabel:"部署用户池",loading:"正在加载用户池…",placeholder:"请选择用户池",loadingIdentity:"正在加载 Identity 用户池…",empty:"当前账号下暂无 Identity 用户池。",currentHint:"当前 Studio 的登录 JWT 将透传访问此 Runtime。",mismatchHint:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime。",markedHint:"当前 Studio 使用的用户池已在列表中标注。"},authentication:{apiKeyDescription:"默认方式,使用 Runtime API Key 访问",userPool:"用户池",userPoolDescription:"使用 Identity 用户池签发的 JWT"},steps:{buildImage:"构建镜像",deploy:"部署",publish:"发布",syncCode:"同步代码",uploadPackage:"上传代码包",packageImage:"镜像打包",createRuntime:"创建 Runtime",publishService:"发布服务",updateInstances:"更新实例配置",createEvaluationSets:"创建评测集"},errors:{instanceRangeInteger:"最小实例数必须为大于等于 0 的整数,最大实例数必须为大于 0 的整数。",instanceRangeOrder:"最小实例数不能大于最大实例数。",selectApiKey:"请先在模型配置中选择 API Key。",loadApiKey:"加载 API Key 失败,请重试。",invalidProject:"项目数据无效",updateFeishu:"更新飞书配置失败:{{message}}",userPoolRequired:"请选择用于 Runtime 鉴权的用户池。",vpcRequired:"使用 VPC 网络时,请填写 VPC ID。",modelSecretRequired:"请填写 {{label}},用于访问对应的自定义模型地址。",managedApiKeyRequired:"{{requirement}},请先返回模型配置选择 API Key。",feishuEnvRequired:"启用飞书后,请填写{{field}}。",runtimeNameExists:"Runtime 名称已存在,请修改后重试。",deployedButGithubMountFailed:"部署成功,但挂载 GitHub 持续交付失败:{{message}}",deployedButGithubBindFailed:"部署成功,但绑定 GitHub 失败:{{message}}",deploymentStatusUnconfirmed:"连接已中断,当前无法确认部署最终状态。任务可能仍在云端运行,请到 AgentKit 或 Code Pipeline 查看同一任务,避免重复部署。",failedAtStage:"{{action}}失败({{stage}}阶段):{{message}}",noAgentAtEndpoint:"连接成功,但该地址未发现任何 Agent(/list-apps 为空)。",addAgent:"添加 Agent 失败:{{message}}",modelApiKeyRequired:"请填写此模型地址对应的 API Key。"}},zze={title:"工作区",detail:"工作区详情",create:"新建工作区",editorDescription:"将常用环境组合在一起;同一个环境可以加入多个工作区。",backToList:"返回工作区列表",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",createdAt:"创建时间",updatedAt:"最近更新",basicInfo:"基本信息",namePlaceholder:"例如:内容生产",descriptionPlaceholder:"说明这个工作区的用途",selectedEnvironmentCount:"已选择 {{count}} 个,可在其他工作区中继续复用",searchAvailableEnvironments:"搜索可用环境",searchEnvironments:"搜索环境",noAvailableEnvironments:"还没有可添加的环境",createEnvironmentFirst:"请先在“环境”页面创建并构建环境。",noMatchingEnvironments:"没有匹配的环境",tryAnotherName:"请尝试搜索其他名称。",environmentStatus:{available:"可用",building:"构建中",notBuilt:"未构建"},added:"已添加",saved:"已保存工作区“{{name}}”",resourceType:"工作区资源类型",searchWorkspaces:"搜索工作区",loadFailed:"无法加载工作区",noMatchingWorkspaces:"没有匹配的工作区",tryAnotherNameOrEnvironment:"请尝试搜索其他名称或环境",noEnvironmentAdded:"未添加环境",environmentMissing:"环境缺失",availableFraction:"{{available}}/{{total}} 可用",available:"可用",availableCount:"{{count}} 个可用",updated:"更新",addEnvironment:"添加环境",deleteTitle:"删除工作区",deleteDescription:"确定删除工作区“{{name}}”吗?环境本身不会被删除。",deleted:"已删除工作区“{{name}}”",clipboardPermissionError:"未能读取剪贴板。请允许剪贴板权限,或点击“导入环境”后手动粘贴分享码。",clipboardUnsupported:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。"},Uze={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},Vze={addSkill:"添加 Skill",remove:"移除 {{name}}",confirmRemoveRuntime:"从新版本中移除运行中的 Skill「{{name}}」?",selectedCount:"已加入技能 · {{count}}",close:"关闭{{label}}",sources:{runtime:"运行中来源 · 原样保留,可移除或用同名 Skill 替换",local:"本地",skillspace:"AgentKit Skills 中心",skillhub:"火山 Find Skill 技能广场"},tabs:{local:"本地文件",localShort:"本地文件",skillspace:"AgentKit Skills 中心",skillspaceShort:"AgentKit",skillhub:"火山 Find Skill 技能广场",skillhubShort:"Find Skill"}},Qze={tasks:{ppt:"PPT",image:"图片生成",video:"视频生成"},prompts:{ppt:{quarterlyReview:"复盘【季度】经营表现,提炼指标差距、原因与行动建议",projectUpdate:"汇报【项目名称】进展:里程碑、风险、预算和资源诉求",solutionProposal:"为【客户行业】输出解决方案:痛点、架构、实施路径与收益",industryAnalysis:"分析【行业主题】趋势,给出竞争格局、机会与战略建议"},image:{launchVisual:"为【品牌或产品】设计【高级科技】风格的发布会主视觉",ecommercePoster:"生成【产品名称】电商海报,突出【核心卖点】与品牌色",conceptRendering:"呈现【产品或空间】在【使用场景】中的写实概念效果图",socialGraphic:"围绕【传播主题】制作简洁专业的企业社媒配图"},video:{brandFilm:"制作【品牌名称】30 秒宣传片,突出【品牌价值】",productLaunch:"为【产品名称】制作 45 秒发布视频:痛点、功能、场景与行动号召",trainingVideo:"制作【培训主题】企业培训视频,讲清【关键操作或规范】",eventTeaser:"生成【活动名称】20 秒预热视频,包含亮点、时间地点和报名信息"}},firstFrame:"首帧",videoToEdit:"待编辑视频",baseVideo:"基础视频",optimizeSkillPlaceholder:"描述你想优化的技能…",createSkillPlaceholder:"描述你想生成的技能…",createVideoPlaceholder:"描述你想创作的视频…",messageAgentPlaceholder:"向 {{name}} 发消息…",selectAgentFirst:"请先选择智能体",selectSkillFirst:"请先选择需要优化的 Skill",availableSkills:"可用技能",availableSubagents:"可用子 Agent",invokeSkill:"调用技能",useSubagent:"使用子 Agent",loadingCapabilities:"正在读取 Agent 能力…",noMatchingSkills:"当前 Agent 没有匹配技能",noMatchingSubagents:"当前 Agent 没有匹配子 Agent",skillFallbackDescription:"加载并执行该技能",agentFallbackDescription:"将本轮交给该 Agent",skill:"技能",uploadImage:"上传图片",uploadDocument:"上传文档或 PDF",uploadVideo:"上传视频",taskMode:"任务模式",selectTaskMode:"选择任务模式",loadingGenerationModel:"正在加载生成模型",modelUnavailable:"模型不可用",cancelTask:"取消{{task}}任务",stopGenerating:"停止生成",viewVideoProgress:"查看视频生成进度",send:"发送",selectTaskType:"选择任务类型",enterprisePrompts:"{{task}}企业提示词",sessionId:"会话 ID",sessionIdLabel:"会话 ID:",initializing:"初始化中",copied:"已复制",copySessionId:"复制会话 ID",sessionIdCopied:"已复制会话 ID",disclaimer:"回答仅供参考",viewLogs:"查看日志"},Gze={selectAgent:"选择 Agent",noLocalAgents:"暂无本地 Agent。",searchRuntime:"搜索 Runtime 名称",mineOnly:"只看我创建的",noRuntimes:"暂无 Runtime。",unsupported:"不支持",createdByMe:"我创建的",connecting:"连接中…",connected:"已连接",connect:"连接",viewInfoFor:"查看 {{name}} 信息",viewInfo:"查看信息",agentAndRuntimeInfo:"Agent 与 Runtime 信息",detailType:"详情类型",agentInfo:"Agent 信息",runtimeInfo:"Runtime 信息",loadingAgentInfo:"读取 Agent 信息…",cannotLoadAgentInfo:"暂时无法读取 Agent 信息",unnamedAgent:"未命名 Agent",subagents:"子 Agent",tools:"工具",skills:"技能",previewUnsupported:"暂不支持预览",mountedComponents:"挂载组件",noMoreAgentInfo:"暂无更多 Agent 配置信息。",local:"本地",model:"模型",status:"状态",memoryMb:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",resources:"资源",version:"版本",loadingDetails:"读取详情…",environmentVariables:"环境变量",errors:{notFound:"该 Runtime 已不存在或列表信息已过期,请刷新列表后重试。",accessDenied:"当前账号无权访问该 Runtime,请检查所属 Project 和访问权限。",previewUnsupported:"该 Agent Server 版本暂不支持信息预览。",unavailable:"该 Runtime 暂时无法访问,请确认其状态为“就绪”后重试。",timeout:"加载超时,请重试"},componentKinds:{knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"},runtimeStatus:{ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"}},Hze={recoveryPaused:"部分历史智能体多次恢复失败,已暂停自动恢复。",restoringHistory:"部分历史智能体正在恢复,恢复后将自动显示。",agent:"智能体",agentTypes:{general:"通用智能体",codex:"Codex","deepseek-harness":"DeepSeek",openclaw:"OpenClaw",hermes:"Hermes"},creator:"创建人",namedAgent:"{{name}} 智能体",storageLocation:"存储位置",currentBrowser:"当前浏览器",region:"地域",viewDeploymentProgress:"查看 {{name}} 部署进度",viewRuntimeDetails:"查看 {{name}} Runtime 详情",viewDetails:"查看 {{name}} 详情",time:"时间",remainingTime:"剩余时间",expiringSoon:"即将清空",sandboxRemaining:"{{hours}} 小时 {{minutes}} 分钟",wakeable:"可唤醒",neverExpires:"永不过期",editDraftNamed:"编辑草稿 {{name}}",viewProgress:"查看进度",deleteDraftNamed:"删除草稿 {{name}}",recheckCompatibility:"重新检测 {{name}} 的对话兼容性",connectedNamed:"{{name}} 已连接",wakeAndChat:"唤醒 {{name}} 并开始对话",chatWith:"与 {{name}} 对话",waking:"唤醒中",deploying:"部署中",draft:"草稿",checking:"检测中",chatUnsupported:"不支持对话",checkFailed:"检测失败",creatorFilter:"创建人筛选",agentType:"智能体类型",searchAgents:"搜索智能体",handoff:"接力",agentList:"{{type}}列表",noMatchingAgents:"没有匹配的智能体",adjustSearch:"请尝试调整搜索或筛选条件",noAgentType:"暂无 {{type}}",noGeneralAgents:"暂无通用智能体",createGeneralAgentDescription:"创建一个通用智能体,开始构建和对话",createAgentType:"创建{{type}}",createAgent:"创建智能体",loadingMore:"正在加载更多智能体",scrollForMore:"继续下滑加载更多",allLoaded:"已加载全部智能体",deleteDraftTitle:"删除草稿?",deleteDraftDescription:"删除后将无法恢复“{{name}}”。",deleteDraft:"删除草稿",loadGeneralAgents:"加载通用智能体",loadAgentType:"加载 {{type}}",compatibility:{checking:"正在请求 Runtime /list-apps,以确认该智能体是否支持 Studio 对话。",empty:"Runtime /list-apps 未返回可用的 Agent,暂时无法连接对话。",supported:"Runtime 支持 Studio 对话。",unknownError:"Runtime /list-apps 请求失败,未返回可识别的错误信息。"},sandboxStatus:{ready:"就绪",wakeable:"可唤醒",creating:"创建中",starting:"启动中",initializing:"启动中",pending:"等待中",running:"运行中",failed:"异常",error:"异常",stopped:"已停止",expired:"已过期",deleting:"删除中",deleted:"已删除",unknown:"未知状态"}},Wze={library:"技能库",skill:"技能",skills:"技能",skillSpace:"技能空间",sandboxNotConfigured:"管理员未配置 Dev Sandbox",adminNotConfigured:"管理员未配置",totalItems:"共 {{count}} 项",cannotLoadSpaces:"无法加载技能空间",someSpacesFailed:"部分技能空间加载失败",degradedRelationWarning:"部分关联异常,已恢复可读取技能",downloadZip:"下载 ZIP",optimize:"优化",closeSkillDetails:"关闭技能详情",skillId:"技能 ID",allFiles:"完整文件",loadingSkillContent:"正在读取技能内容…",noSkillContent:"该技能暂无 SKILL.md 内容",addSkill:"添加技能",localUpload:"本地上传",localUploadDescription:"选择 ZIP 文件,校验通过后上传到技能空间",autoCreate:"自动创建",autoCreateDescription:"选择模型和风格,通过对话生成技能",createSkill:"创建技能",optimizeNamed:"优化 {{name}}",deleteSkillConfirm:"确定删除整个 Skill“{{name}}”吗?此操作会影响所有引用它的空间。",deleteSpaceConfirm:"确定删除 Skill 空间“{{name}}”吗?请先确认空间中的技能已删除。",manageSpaceDescription:"管理空间中的技能并创建新的版本",backToSpaces:"返回技能空间列表",overview:"概览",skillCount:"技能数量",skillCountValue_one:"{{count}} 技能",skillCountValue_other:"{{count}} 技能",updatedAt:"更新时间",skillsInSpace:"{{name}}中的技能",searchSkills:"搜索技能",cannotLoadSkills:"无法加载技能",noMatchingSkills:"没有匹配的技能",noSkills:"暂无技能",tryAnotherName:"请尝试搜索其他名称",emptySkillsDescription:"本地上传 Skill,或自动创建",actions:"操作",spaceDetails:"技能空间详情",editSpace:"编辑空间",deleteSpace:"删除空间",searchSpaces:"搜索技能空间",spaceList:"技能空间列表",noMatchingSpaces:"没有匹配的技能空间",createSpace:"新建技能空间",newSpace:"新建空间",loadingMoreSpaces:"正在加载更多技能空间",scrollForMore:"继续下滑加载更多",allSpacesLoaded:"已加载全部技能空间",errors:{loadSpaces:"读取技能空间失败,请稍后重试",loadSkills:"读取技能失败,请稍后重试",loadSkillDetails:"读取技能详情失败,请稍后重试",deleteSkill:"删除 Skill 失败",deleteSpace:"删除 Skill 空间失败",downloadSkill:"下载 Skill 失败"},status:{active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中",unknown:"未知"}},Yze={library:"知识库",createBase:"新建知识库",editBase:"编辑知识库",invalidName:"名称必须以字母开头,且只能包含字母、数字和下划线。",nameHelp:"以字母开头,仅支持字母、数字和下划线,最多 48 个字符。",optionalDescription:"描述(可选)",descriptionOnly:"AgentKit 当前仅支持更新知识库描述。",previewWeb:"预览网页内容",addData:"添加数据",openOriginalWeb:"打开原网页",backToEdit:"返回修改",confirmAdd:"确认添加",source:"知识来源",image:"图片",documentFile:"文档文件",webPage:"在线网页",webUrl:"网页 URL",generatingWebPreview:"正在抓取网页并生成 Markdown 预览",selectFile:"选择知识文件",selectOrDropFile:"选择文件或拖拽到这里",selectedFile:"{{size}} · 点击可重新选择",imageFileHelp:"支持 PNG、JPG 和 JPEG,单个文件不超过 200 MB",documentFileHelp:"支持 PDF、PPTX、DOCX、XLSX 和 TXT,单个文件不超过 200 MB",uploadingFile:"正在上传文件并添加到知识库",optionalName:"名称(可选)",optionalType:"类型(可选)",generatePreview:"生成预览",uploadFile:"上传文件",editMetadata:"编辑知识 Metadata",knowledge:"知识",field:"字段",value:"值",backToList:"返回知识库列表",metadataJson:"元数据(JSON)",provider:"服务提供方",knowledgeId:"知识库 ID",project:"项目",creator:"创建者",data:"数据",deleteInvalidAssociation:"删除失效关联",noData:"这个知识库还没有数据",addFirstData:"添加第一项数据",format:"格式",size:"大小",searchData:"搜索数据",searchLibraryData:"搜索知识库数据",associationInvalid:"关联已失效",providerMissing:"底层 Provider 知识库已不存在",noMatchingData:"没有匹配的数据",loadingMoreData:"正在加载更多数据",retryLoading:"重试加载",details:"知识库详情",searchBases:"搜索知识库",someBasesFailed:"部分知识库暂时无法加载,已展示其余可用内容。",noMatchingBases:"没有匹配的知识库",noManagePermission:"您没有管理此知识库的权限",loadingMoreBases:"正在加载更多知识库",deleteBaseTitle:"删除知识库?",deleteBaseDescription:"将删除 {{name}} 的 AgentKit 关联;如果它由 Studio 创建,也会同时删除 Provider 资源。此操作无法撤销。",deleteDocumentTitle:"删除知识?",deleteDocumentDescription:"将从 Provider 知识库中删除 {{name}},此操作无法撤销。",preview:{processingTitle:"数据正在处理中",processingDetail:"知识库完成解析后即可预览,请稍后重新加载。",failedTitle:"数据解析失败",failedDetail:"请检查源文件或网页地址后重新添加,也可以重新加载最新状态。",noParsedTitle:"暂时没有可预览的解析内容",noParsedDetail:"此类文件会在知识库完成解析后显示文本、表格或页面图片。",noMediaTitle:"暂时没有可预览的媒体内容",noMediaDetail:"知识库尚未返回可访问的媒体预览,请稍后重新加载。",noDataTitle:"暂无可预览的数据内容",noDataDetail:"知识库尚未返回解析结果,请稍后重新加载。",attachmentError:"附件无法预览,请稍后重试。",imageAlt:"知识数据图片",audioUnsupported:"当前浏览器不支持音频预览。",videoUnsupported:"当前浏览器不支持视频预览。",namedPdf:"{{name}} PDF 预览",pdf:"PDF 预览",openPdf:"无法显示时,在新窗口打开 PDF",fileUnsupported:"当前格式暂不支持直接在线预览,已优先显示解析后的内容。",openOriginalFile:"打开原文件",loading:"正在加载数据预览",openOriginalHint:"您可以打开原网页查看来源内容。",chunk:"片段 {{index}}",loadingMore:"正在加载更多",loadMore:"加载更多"},errors:{fileTooLarge:"单个文件不能超过 200 MB",invalidImageType:"请选择 PNG、JPG 或 JPEG 图片",invalidDocumentType:"请选择 PDF、PPTX、DOCX、XLSX 或 TXT 文件",createBase:"创建知识库失败",updateBase:"更新知识库失败",metadataObject:"Metadata 必须是 JSON 对象",metadataFormat:"Metadata 格式错误",noWebPreview:"网页没有可预览的 Markdown 内容",addWeb:"添加网页失败",previewWeb:"生成网页预览失败",uploadFile:"上传文件失败",updateDocument:"更新知识失败",loadPreview:"加载数据预览失败",loadMoreBases:"加载更多知识库失败",loadBases:"加载知识库失败",loadMoreData:"加载更多数据失败",loadData:"加载数据失败",deleteBase:"删除知识库失败",deleteDocument:"删除知识失败"}},grr=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:kze,agentSelector:Gze,agentWorkspace:_ze,cloudEnvironment:Ize,common:Oze,composer:Qze,default:{common:Oze,agentKitPromo:kze,systemInfo:Eze,agentWorkspace:_ze,environmentCenter:Rze,deploymentSelect:Dze,deploymentError:Lze,studioBuildProgress:Mze,cloudEnvironment:Ize,githubCicd:Pze,feishuDeployment:Nze,deploymentResources:Bze,studioUpdate:$ze,projectPreview:Fze,workspace:zze,resourceCollection:Uze,skillSourcePicker:Vze,composer:Qze,agentSelector:Gze,myAgents:Hze,skillCenter:Wze,knowledge:Yze},deploymentError:Lze,deploymentResources:Bze,deploymentSelect:Dze,environmentCenter:Rze,feishuDeployment:Nze,githubCicd:Pze,knowledge:Yze,myAgents:Hze,projectPreview:Fze,resourceCollection:Uze,skillCenter:Wze,skillSourcePicker:Vze,studioBuildProgress:Mze,studioUpdate:$ze,systemInfo:Eze,workspace:zze},Symbol.toStringTag,{value:"Module"})),qze="网站集成",jze="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",Xze="返回自动化列表",Kze="添加网站",Zze="正在加载 Runtime",Jze="选择 Runtime",eUe="网站域名",tUe="例如 xxxx.com 或 localhost:5173",rUe="正在生成",nUe="生成 Token",iUe="已添加网站",aUe="{{count}} 个",sUe="{{count}} 个",oUe="正在加载网站集成",lUe="还没有网站集成",cUe="选择 Runtime 并输入网站域名即可生成 Token",uUe="引入方法",hUe="将下面代码放到网页的 body 结束标签前",dUe="已复制",fUe="复制代码",pUe="添加网站后会在这里生成引入代码。",gUe="确定删除 {{domain}} 的网站集成吗?",mUe={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},vUe={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},mrr=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:Kze,addedWebsites:iUe,backToAutomations:Xze,confirmDelete:gUe,copied:dUe,copyCode:fUe,default:{title:qze,description:jze,backToAutomations:Xze,addWebsite:Kze,loadingRuntime:Zze,selectRuntime:Jze,websiteDomain:eUe,domainPlaceholder:tUe,generating:rUe,generateToken:nUe,addedWebsites:iUe,websiteCount_one:aUe,websiteCount_other:sUe,loadingIntegrations:oUe,delete:"删除",emptyTitle:lUe,emptyDescription:cUe,embedMethod:uUe,embedInstructions:hUe,copied:dUe,copyCode:fUe,embedHint:pUe,confirmDelete:gUe,errors:mUe,widget:vUe},description:jze,domainPlaceholder:tUe,embedHint:pUe,embedInstructions:hUe,embedMethod:uUe,emptyDescription:cUe,emptyTitle:lUe,errors:mUe,generateToken:nUe,generating:rUe,loadingIntegrations:oUe,loadingRuntime:Zze,selectRuntime:Jze,title:qze,websiteCount_one:aUe,websiteCount_other:sUe,websiteDomain:eUe,widget:vUe},Symbol.toStringTag,{value:"Module"})),yUe={types:{all:"全部类型",document:"文档",image:"图片",video:"视频"},previewArtifact:"预览 {{name}}",moreActions:"更多操作 {{name}}",actionMenu:"{{name}} 操作",download:"下载",downloading:"下载中",edit:"编辑信息",delete:"删除产物",previewFailed:"无法预览“{{name}}”:{{message}}",downloadStarted:"已开始下载 {{name}}",downloadFailed:"无法下载“{{name}}”:{{message}}",updated:"已更新 {{name}}",deleted:"已删除 {{name}}",deleteFailed:"无法删除“{{name}}”:{{message}}",typeFilter:"产物类型",searchAria:"搜索产物",searchPlaceholder:"搜索产物或会话",retry:"重试",close:"关闭",listAria:"产物列表",loadFailed:"产物加载失败",loadDetailFallback:"请检查存储配置后重试。",reload:"重新加载",noMatch:"没有找到匹配的产物",noArtifacts:"您还没有任何产物",searchHint:"请尝试搜索其他名称或切换类型",emptyHint:"聊天中生成的产物会自动显示在这里",columns:{name:"名称",source:"来源",updatedAt:"修改时间",actions:"操作"},loadingMore:"正在加载更多产物",unknownTime:"时间未知",preview:{close:"关闭预览",meta:"{{type}} / 版本 {{version}}",loading:"正在加载预览",alt:"{{name}} 预览",loadFailed:"预览加载失败,请稍后重试或下载查看",unsupported:"当前格式暂不支持在线预览,请下载查看",sourceAria:"产物来源",agent:"智能体",session:"会话",tool:"生成工具",createdAt:"生成时间",fileSize:"文件大小",tags:"标签",viewSession:"查看会话"},deleteDialog:{title:"删除产物?",description:"“{{name}}”将从产物库永久删除,聊天记录不会受到影响。",deleting:"删除中",confirm:"删除",close:"关闭删除确认框"},api:{withStatus:"{{message}}({{status}})",listFailed:"读取产物库失败",syncFailed:"同步聊天产物失败",updateFailed:"更新产物失败",deleteFailed:"删除产物失败",downloadFailed:"下载产物失败"}},bUe={unknownSource:"未知来源",unknownCreator:"未知创建者"},xUe={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},wUe={change:{added:"新增",modified:"修改",deleted:"删除"},noChanges:"两个版本的源码没有差异",chooseFile:"从左侧选择文件以查看代码",compareTitle:"版本对比",workspaceTitle:"源码工作区",projectFallback:"Agent 项目",switchTheme:"切换源码主题",switchThemeTitle:"切换为{{theme}}主题",themes:{dark:"深色",light:"浅色"},closeWorkspace:"关闭源码工作区",close:"关闭",changedFiles:"变更文件",projectFiles:"项目文件",changes:"变更",files:"文件",openFiles:"打开的文件",noFileSelected:"未选择文件",comparisonDirection:"对比方向",before:"优化前",after:"优化后",loadingEditor:"正在加载编辑器…",changedFileCount_one:"{{count}} 个文件有变更",changedFileCount_other:"{{count}} 个文件有变更",fileCount_one:"{{count}} 个文件",fileCount_other:"{{count}} 个文件",lineCount_one:"{{count}} 行 · UTF-8",lineCount_other:"{{count}} 行 · UTF-8",viewSource:"查看源码",viewSourceAria:"查看和编辑项目源码"},AUe={nav:"搜索",selectAgent:"请选择 Agent",checkingCapabilities:"正在检测 Agent 能力",notMounted:"当前 Agent 未挂载{{label}}",sources:{session:"会话",web:"网络",knowledge:"知识库",memory:"长期记忆"},webDescription:"通过 web_search 工具检索",backendLocal:"本地",failed:"搜索失败:{{message}}",placeholder:{selectAgent:"请先选择 Agent",web:"在网络中检索",knowledge:"在 {{name}} 中检索",knowledgeFallback:"当前 Agent 的知识库",memory:"在 {{name}} 中检索",memoryFallback:"当前用户的长期记忆",session:"在当前 Agent 的会话中检索"},sourceTypeAria:"搜索类型:{{label}}",notSelected:"未选择",sourceType:"搜索类型",selectSource:"选择搜索类型",noAgentHint:"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。",loadingCapabilities:"正在读取当前 Agent 的检索能力…",sourceUnavailable:"当前 Agent 未挂载该数据源",instructions:{web:"输入关键词后回车或点击按钮,通过 web_search 工具检索。",knowledge:"输入问题,检索当前 Agent 挂载的知识库。",memory:"输入线索,检索当前用户跨会话保存的长期记忆。",session:"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"},noResults:"未找到匹配“{{query}}”的结果。",knowledgeFragment:"知识片段 {{index}}",memoryFragment:"记忆片段 {{index}}"},SUe={title:"开发者资源",sections:{documentation:{title:"相关链接",description:"查看开发文档与 AgentKit 常用入口"},bestPractices:{title:"最佳实践",description:"参考开发、调试与部署经验"},showcases:{title:"案例展示",description:"探索 AgentKit 应用案例"}},links:{veadkDocs:"VeADK 文档",cliDocs:"AgentKit CLI 文档",platformDocs:"AgentKit 平台文档",console:"AgentKit 控制台"},articles:{veadkDevelopment:{title:"使用 VeADK 开发并部署智能体",description:"使用 VeADK 构建 Agent,并部署至 AgentKit 智能体运行时。"},cliDevelopment:{title:"使用 AgentKit CLI 开发并部署智能体",description:"通过 AgentKit CLI 创建项目、调试 Agent,并完成部署。"},coverAlt:"{{title}}文章封面"},showcases:{researchAssistant:{title:"多智能体研究助手",description:"由多个专业 Agent 协同完成资料检索、分析和结论整理。"},multimodalAnalysis:{title:"多模态内容分析",description:"在统一会话中理解图片、文档和视频内容。"},customerService:{title:"智能客服工作台",description:"结合知识检索与工具调用处理复杂的客户服务任务。"},webSearch:{title:"联网搜索 Agent",description:"检索实时网页内容,并将信息整理为可追溯的回答。"},a2uiApp:{title:"A2UI 交互应用",description:"让 Agent 根据任务过程生成可交互的前端界面。"},previewAlt:"{{title}}界面预览"}},TUe={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},CUe={title:"管理 Agent",subtitle:"列出你有权管理的 AgentKit Runtime",mainAgentOnly:"仅显示主 Agent(控制面信息)。",deleteConfirm:'确定删除 Agent "{{name}}"?该 Runtime 将被永久删除。',regionFilterTitle:"按区域筛选",regionFilterAria:"区域筛选",regionAria:"区域",refresh:"刷新",loading:"加载中…",empty:"暂无你部署的 Agent。",connected:"已连接",connect:"连接到此 Agent",deleteRuntime:"删除该 Runtime",loadingDetail:"读取详情…",agentStructure:"Agent 结构",secretHidden:"敏感值已隐藏,点击显示",revealSecret:"显示 {{key}} 的值",fields:{model:"模型",description:"描述",status:"状态信息",project:"项目",version:"版本",resources:"资源",memory:"记忆",tool:"工具",knowledge:"知识",mcpToolset:"MCP 工具集",updatedAt:"更新时间"},resource:{memory:"内存 {{value}}MB",instances:"实例 {{min}}~{{max}}",concurrency:"并发 {{value}}"},environmentVariables:"环境变量",unnamed:"(未命名)"},OUe={mainAgent:"主 Agent",subAgent:"子 Agent {{index}}",itemCount_one:"{{count}} 项",itemCount_other:"{{count}} 项",info:"Agent 信息",infoAndTopology:"Agent 信息与拓扑",loadingInfo:"正在读取 Agent 信息…",unnamedAgent:"未命名 Agent",tools:"工具",toolList:"工具列表",studioTool:"Studio Tool",removeTool:"移除工具 {{name}}",remove:"移除",notConfigured:"未配置",addStudioTool:"添加 Studio 工具",addStudioToolHere:"在此对话中添加 Studio 工具",skills:"技能",skillList:"技能列表",previewUnsupported:"暂不支持预览",sessionEnvironment:"会话环境",environment:"环境",agentCanvas:"Agent 画布",topology:"结构拓扑",viewCanvasFullscreen:"全屏查看 Agent 画布",viewFullscreen:"全屏查看",executionCanvas:"Agent 执行画布",fullscreenExecutionCanvas:"全屏 Agent 执行画布",closeFullscreenCanvas:"关闭全屏画布",close:"关闭",capabilitiesSubtitle:"能力与协作拓扑",closeInfo:"关闭 Agent 信息",infoUnavailable:"暂时无法读取 Agent 信息。"},kUe={mountFailed:"挂载环境失败",closeDialog:"关闭环境弹窗",addTitle:"添加环境",description:"选择当前会话允许 Agent 使用的 Sandbox 环境",closeAdd:"关闭添加环境",searchAria:"搜索环境",searchPlaceholder:"搜索环境名称或能力",availableAria:"可用环境与工作区",loading:"正在读取可用环境…",noMatch:"没有匹配的环境或工作区",workspaces:"工作区",reuseAll:"复用工作区中的全部可用环境",availableEnvironmentCount_one:"{{count}} 个可用环境",availableEnvironmentCount_other:"{{count}} 个可用环境",selectWorkspace:"选择工作区 {{name}}",environments:"环境",includedByWorkspaces:"已由工作区 {{names}} 包含",nameSeparator:"、",selectEnvironment:"选择环境 {{name}}",selectedWorkspaceCount_one:"{{count}} 个工作区",selectedWorkspaceCount_other:"{{count}} 个工作区",coveredEnvironmentCount_one:"{{count}} 个环境",coveredEnvironmentCount_other:"{{count}} 个环境",selectionSummary:"已选择 {{workspaces}},覆盖 {{environments}}",cancel:"取消",mounting:"正在挂载…",confirm:"确认添加",mountedAria:"已挂载环境",environmentCount_one:"{{count}} 个环境",environmentCount_other:"{{count}} 个环境",removeWorkspace:"移除工作区 {{name}}",remove:"移除",removeEnvironment:"移除环境 {{name}}",add:"添加环境",addMore:"添加更多环境",addForSession:"为当前 Session 添加环境",loadingAvailable:"正在加载可用环境…",empty:"暂无可用的 AIO Sandbox 环境。"},EUe={loading:{searching:"正在查找已有环境",creating:"环境初始化中",connecting:"正在连接已有环境"},initializationFailed:"AgentKit CLI 环境初始化失败,当前状态:{{status}}。",sessionExpired:"AgentKit CLI Session 不存在或已过期,请重试。",initializationTimeout:"AgentKit CLI 环境初始化超时,请稍后重试。",nonPersistent:"非持久化环境",recyclingHoursMinutes:"{{hours}} 小时 {{minutes}} 分钟后环境回收",recyclingMinutes:"{{minutes}} 分钟后环境回收",connectionError:`无法连接 Studio 服务,未收到服务端响应。 +原始错误:{{message}}`,unavailable:"连接不可用",requestFailed:"AgentKit CLI 请求失败",retry:"重试",terminalTitle:"AgentKit CLI 终端"},_Ue={labels:{coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取"},closeDialog:"关闭弹窗",title:"添加 Studio 工具",description:"由 Studio BFF 为 {{agentName}} 的当前会话执行,Runtime 无需预装",close:"关闭添加 Studio 工具",searchAria:"搜索 Studio 工具",searchPlaceholder:"搜索名称或工具标识",availableAria:"可用 Studio 工具",loading:"正在读取 Studio 工具…",noMatch:"没有匹配的 Studio 工具",remove:"移除",add:"添加"},RUe={artifactLibrary:yUe,resourceMetadata:bUe,artifactEdit:xUe,codeBrowser:wUe,search:AUe,developerResources:SUe,library:TUe,manageAgents:CUe,agentTopology:OUe,sessionEnvironment:kUe,agentKitCli:EUe,studioTools:_Ue},vrr=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:EUe,agentTopology:OUe,artifactEdit:xUe,artifactLibrary:yUe,codeBrowser:wUe,default:RUe,developerResources:SUe,library:TUe,manageAgents:CUe,resourceMetadata:bUe,search:AUe,sessionEnvironment:kUe,studioTools:_Ue},Symbol.toStringTag,{value:"Module"})),DUe=["zh-CN","en-US"],Wse="en-US",yrr="agentkit.studio.locale",brr={"zh-CN":{dir:"ltr",nativeName:"简体中文"},"en-US":{dir:"ltr",nativeName:"English"}};function Yse(t){if(!t)return null;const e=t.trim().replace(/_/g,"-").toLowerCase(),r=DUe.find(n=>n.toLowerCase()===e);return r||(e==="zh"||e.startsWith("zh-")?"zh-CN":e==="en"||e.startsWith("en-")?"en-US":null)}function xrr(){if(typeof window>"u")return null;try{return Yse(window.localStorage.getItem(yrr))}catch{return null}}function wrr(){if(typeof window>"u")return[];const t=window.navigator;return t?t.languages.length>0?t.languages:t.language?[t.language]:[]:[]}function Arr(){const t=xrr();if(t)return t;for(const e of wrr()){const r=Yse(e);if(r)return r}return Wse}function LUe(t){typeof document>"u"||(document.documentElement.lang=t,document.documentElement.dir=brr[t].dir)}const mn=t=>typeof t=="string",YP=()=>{let t,e;const r=new Promise((n,i)=>{t=n,e=i});return r.resolve=t,r.reject=e,r},qse=t=>t==null?"":String(t),Srr=(t,e,r)=>{t.forEach(n=>{e[n]&&(r[n]=e[n])})},Trr=/###/g,MUe=t=>t&&t.includes("###")?t.replace(Trr,"."):t,IUe=t=>!t||mn(t),qP=(t,e,r)=>{const n=mn(e)?e.split("."):e;let i=0;for(;i{const{obj:n,k:i}=qP(t,e,Object);if(n!==void 0||e.length===1){n[i]=r;return}let a=e[e.length-1],s=e.slice(0,e.length-1),o=qP(t,s,Object);for(;o.obj===void 0&&s.length;)a=`${s[s.length-1]}.${a}`,s=s.slice(0,s.length-1),o=qP(t,s,Object),o!=null&&o.obj&&typeof o.obj[`${o.k}.${a}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${a}`]=r},Crr=(t,e,r,n)=>{const{obj:i,k:a}=qP(t,e,Object);i[a]=i[a]||[],i[a].push(r)},dV=(t,e)=>{const{obj:r,k:n}=qP(t,e);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},Orr=(t,e,r)=>{const n=dV(t,r);return n!==void 0?n:dV(e,r)},NUe=(t,e,r)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(Object.prototype.hasOwnProperty.call(t,n)?mn(t[n])||t[n]instanceof String||mn(e[n])||e[n]instanceof String?r&&(t[n]=e[n]):NUe(t[n],e[n],r):t[n]=e[n]);return t},Ev=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),krr={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},Err=t=>mn(t)?t.replace(/[&<>"'\/]/g,e=>krr[e]):t;class _rr{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const r=this.regExpMap.get(e);if(r!==void 0)return r;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const Rrr=[" ",",","?","!",";"],Drr=new _rr(20),Lrr=(t,e,r)=>{e=e||"",r=r||"";const n=Rrr.filter(s=>!e.includes(s)&&!r.includes(s));if(n.length===0)return!0;const i=Drr.getRegExp(`(${n.map(s=>s==="?"?"\\?":s).join("|")})`);let a=!i.test(t);if(!a){const s=t.indexOf(r);s>0&&!i.test(t.substring(0,s))&&(a=!0)}return a},jse=(t,e,r=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const n=e.split(r);let i=t;for(let a=0;at==null?void 0:t.replace(/_/g,"-"),Mrr={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){var r,n;(n=(r=console==null?void 0:console[t])==null?void 0:r.apply)==null||n.call(r,console,e)}};class fV{constructor(e,r={}){this.init(e,r)}init(e,r={}){this.prefix=r.prefix||"i18next:",this.logger=e||Mrr,this.options=r,this.debug=r.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,r,n,i){return i&&!this.debug?null:(e=e.map(a=>mn(a)?a.replace(/[\r\n\x00-\x1F\x7F]/g," "):a),mn(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[r](e))}create(e){return new fV(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new fV(this.logger,e)}}var Yg=new fV;class pV{constructor(){this.observers={}}on(e,r){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const i=this.observers[n].get(r)||0;this.observers[n].set(r,i+1)}),this}off(e,r){if(this.observers[e]){if(!r){delete this.observers[e];return}this.observers[e].delete(r)}}once(e,r){const n=(...i)=>{r(...i),this.off(e,n)};return this.on(e,n),this}emit(e,...r){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([i,a])=>{for(let s=0;s{for(let s=0;s-1&&this.options.ns.splice(r,1)}getResource(e,r,n,i={}){var u,h;const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,s=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.includes(".")?o=e.split("."):(o=[e,r],n&&(Array.isArray(n)?o.push(...n):mn(n)&&a?o.push(...n.split(a)):o.push(n)));const l=dV(this.data,o);return!l&&!r&&!n&&e.includes(".")&&(e=o[0],r=o[1],n=o.slice(2).join(".")),l||!s||!mn(n)?l:jse((h=(u=this.data)==null?void 0:u[e])==null?void 0:h[r],n,a)}addResource(e,r,n,i,a={silent:!1}){const s=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let o=[e,r];n&&(o=o.concat(s?n.split(s):n)),e.includes(".")&&(o=e.split("."),i=r,r=o[1]),this.addNamespaces(r),PUe(this.data,o,i),a.silent||this.emit("added",e,r,n,i)}addResources(e,r,n,i={silent:!1}){for(const a in n)(mn(n[a])||Array.isArray(n[a]))&&this.addResource(e,r,a,n[a],{silent:!0});i.silent||this.emit("added",e,r,n)}addResourceBundle(e,r,n,i,a,s={silent:!1,skipCopy:!1}){let o=[e,r];e.includes(".")&&(o=e.split("."),i=n,n=r,r=o[1]),this.addNamespaces(r);let l=dV(this.data,o)||{};s.skipCopy||(n=JSON.parse(JSON.stringify(n))),i?NUe(l,n,a):l={...l,...n},PUe(this.data,o,l),s.silent||this.emit("added",e,r,n)}removeResourceBundle(e,r){this.hasResourceBundle(e,r)&&delete this.data[e][r],this.removeNamespaces(r),this.emit("removed",e,r)}hasResourceBundle(e,r){return this.getResource(e,r)!==void 0}getResourceBundle(e,r){return r||(r=this.options.defaultNS),this.getResource(e,r)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const r=this.getDataByLanguage(e);return!!(r&&Object.keys(r)||[]).find(i=>r[i]&&Object.keys(r[i]).length>0)}toJSON(){return this.data}}var $Ue={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,r,n,i){return t.forEach(a=>{var s;e=((s=this.processors[a])==null?void 0:s.process(e,r,n,i))??e}),e}};const FUe=Symbol("i18next/PATH_KEY");function Irr(){const t=[],e=Object.create(null);let r;return e.get=(n,i)=>{var a;return(a=r==null?void 0:r.revoke)==null||a.call(r),i===FUe?t:(t.push(i),r=Proxy.revocable(n,e),r.proxy)},Proxy.revocable(Object.create(null),e).proxy}function Hw(t,e){const{[FUe]:r}=t(Irr()),n=(e==null?void 0:e.keySeparator)??".",i=(e==null?void 0:e.nsSeparator)??":",a=(e==null?void 0:e.enableSelector)==="strict";if(r.length>1&&i){const s=e==null?void 0:e.ns,o=a?Array.isArray(s)?s:s?[s]:null:Array.isArray(s)?s:null;if(o&&(a?o:o.length>1?o.slice(1):[]).includes(r[0]))return`${r[0]}${i}${r.slice(1).join(n)}`}return r.join(n)}const Xse=t=>!mn(t)&&typeof t!="boolean"&&typeof t!="number";class gV extends pV{constructor(e,r={}){super(),Srr(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Yg.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,r={interpolation:{}}){const n={...r};if(e==null)return!1;const i=this.resolve(e,n);if((i==null?void 0:i.res)===void 0)return!1;const a=Xse(i.res);return!(n.returnObjects===!1&&a)}extractFromKey(e,r){let n=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let a=r.ns||this.options.defaultNS||[];const s=n&&e.includes(n),o=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!Lrr(e,n,i);if(s&&!o){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:mn(a)?[a]:a};const u=e.split(n);(n!==i||n===i&&this.options.ns.includes(u[0]))&&(a=u.shift()),e=u.join(i)}return{key:e,namespaces:mn(a)?[a]:a}}translate(e,r,n){let i=typeof r=="object"?{...r}:r;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),e==null)return"";typeof e=="function"&&(e=Hw(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]),e=e.map(L=>typeof L=="function"?Hw(L,{...this.options,...i}):String(L));const a=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:o,namespaces:l}=this.extractFromKey(e[e.length-1],i),u=l[l.length-1];let h=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;h===void 0&&(h=":");const d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((d==null?void 0:d.toLowerCase())==="cimode")return f?a?{res:`${u}${h}${o}`,usedKey:o,exactUsedKey:o,usedLng:d,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:`${u}${h}${o}`:a?{res:o,usedKey:o,exactUsedKey:o,usedLng:d,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:o;const p=this.resolve(e,i);let g=p==null?void 0:p.res;const m=(p==null?void 0:p.usedKey)||o,v=(p==null?void 0:p.exactUsedKey)||o,y=["[object Number]","[object Function]","[object RegExp]"],b=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,w=i.count!==void 0&&!mn(i.count),A=gV.hasDefaultValue(i),S=w?this.pluralResolver.getSuffix(d,i.count,i):"",T=i.ordinal&&w?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):"",O=w&&!i.ordinal&&i.count===0,k=O&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${T}`]||i.defaultValue;let E=g;x&&!g&&A&&(E=k);const _=Xse(E),I=Object.prototype.toString.apply(E);if(x&&E&&_&&!y.includes(I)&&!(mn(b)&&Array.isArray(E))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const L=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,E,{...i,ns:l}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(p.res=L,p.usedParams=this.getUsedParamsDetails(i),p):L}if(s){const L=Array.isArray(E),R=L?[]:{},D=L?v:m;for(const M in E)if(Object.prototype.hasOwnProperty.call(E,M)){const P=`${D}${s}${M}`;A&&!g?R[M]=this.translate(P,{...i,defaultValue:Xse(k)?k[M]:void 0,joinArrays:!1,ns:l}):R[M]=this.translate(P,{...i,joinArrays:!1,ns:l}),R[M]===P&&(R[M]=E[M])}g=R}}else if(x&&mn(b)&&Array.isArray(g))g=g.join(b),g&&(g=this.extendTranslation(g,e,i,n));else{let L=!1,R=!1;!this.isValidLookup(g)&&A&&(L=!0,g=k),this.isValidLookup(g)||(R=!0,g=o);const M=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&R?void 0:g,P=A&&k!==g&&this.options.updateMissing;if(R||L||P){if(this.logger.log(P?"updateKey":"missingKey",d,u,w&&!P?`${o}${this.pluralResolver.getSuffix(d,i.count,i)}`:o,P?k:g),s){const V=this.resolve(o,{...i,keySeparator:!1});V&&V.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let N=[];const F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&F&&F[0])for(let V=0;V{var G;const Q=A&&U!==g?U:M;this.options.missingKeyHandler?this.options.missingKeyHandler(V,u,z,Q,P,i):(G=this.backendConnector)!=null&&G.saveMissing&&this.backendConnector.saveMissing(V,u,z,Q,P,i),this.emit("missingKey",V,u,z,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?N.forEach(V=>{const z=this.pluralResolver.getSuffixes(V,i);O&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!z.includes(`${this.options.pluralSeparator}zero`)&&z.push(`${this.options.pluralSeparator}zero`),z.forEach(U=>{B([V],o+U,i[`defaultValue${U}`]||k)})}):B(N,o,k))}g=this.extendTranslation(g,e,i,p,n),R&&g===o&&this.options.appendNamespaceToMissingKey&&(g=`${u}${h}${o}`),(R||L)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${h}${o}`:o,L?g:void 0,i))}return a?(p.res=g,p.usedParams=this.getUsedParamsDetails(i),p):g}extendTranslation(e,r,n,i,a){var l,u;if((l=this.i18nFormat)!=null&&l.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const h=mn(e)&&(((u=n==null?void 0:n.interpolation)==null?void 0:u.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(h){const p=e.match(this.interpolator.nestingRegexp);d=p&&p.length}let f=n.replace&&!mn(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),e=this.interpolator.interpolate(e,f,n.lng||this.language||i.usedLng,n),h){const p=e.match(this.interpolator.nestingRegexp),g=p&&p.length;d(a==null?void 0:a[0])===p[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${r[0]}`),null):this.translate(...p,r),n)),n.interpolation&&this.interpolator.reset()}const s=n.postProcess||this.options.postProcess,o=mn(s)?[s]:s;return e!=null&&(o!=null&&o.length)&&n.applyPostProcessor!==!1&&(e=$Ue.handle(o,e,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,r={}){let n,i,a,s,o;return mn(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(l=>typeof l=="function"?Hw(l,{...this.options,...r}):l)),e.forEach(l=>{if(this.isValidLookup(n))return;const u=this.extractFromKey(l,r),h=u.key;i=h;let d=u.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const f=r.count!==void 0&&!mn(r.count),p=f&&!r.ordinal&&r.count===0,g=r.context!==void 0&&(mn(r.context)||typeof r.context=="number")&&r.context!=="",m=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);d.forEach(v=>{var y,b;this.isValidLookup(n)||(o=v,!this.checkedLoadedFor[`${m[0]}-${v}`]&&((y=this.utils)!=null&&y.hasLoadedNamespace)&&!((b=this.utils)!=null&&b.hasLoadedNamespace(o))&&(this.checkedLoadedFor[`${m[0]}-${v}`]=!0,this.logger.warn(`key "${i}" for languages "${m.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),m.forEach(x=>{var S;if(this.isValidLookup(n))return;s=x;const w=[h];if((S=this.i18nFormat)!=null&&S.addLookupKeys)this.i18nFormat.addLookupKeys(w,h,x,v,r);else{let T;f&&(T=this.pluralResolver.getSuffix(x,r.count,r));const O=`${this.options.pluralSeparator}zero`,k=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(r.ordinal&&T.startsWith(k)&&w.push(h+T.replace(k,this.options.pluralSeparator)),w.push(h+T),p&&w.push(h+O)),g){const E=`${h}${this.options.contextSeparator||"_"}${r.context}`;w.push(E),f&&(r.ordinal&&T.startsWith(k)&&w.push(E+T.replace(k,this.options.pluralSeparator)),w.push(E+T),p&&w.push(E+O))}}let A;for(;A=w.pop();)this.isValidLookup(n)||(a=A,n=this.getResource(x,v,A,r))}))})}),{res:n,usedKey:i,exactUsedKey:a,usedLng:s,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,r,n,i={}){var a;return(a=this.i18nFormat)!=null&&a.getResource?this.i18nFormat.getResource(e,r,n,i):this.resourceStore.getResource(e,r,n,i)}getUsedParamsDetails(e={}){const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!mn(e.replace);let i=n?e.replace:e;if(n&&typeof e.count<"u"&&(i={...i,count:e.count}),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!n){i={...i};for(const a of r)delete i[a]}return i}static hasDefaultValue(e){const r="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&n.startsWith(r)&&e[n]!==void 0)return!0;return!1}}class zUe{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Yg.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(e){if(e=jP(e),!e||!e.includes("-"))return null;const r=e.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(e){if(e=jP(e),!e||!e.includes("-"))return e;const r=e.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(e){if(mn(e)&&e.includes("-")){let r;try{r=Intl.getCanonicalLocales(e)[0]}catch{}return r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let r;return e.forEach(n=>{if(r)return;const i=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(i))&&(r=i)}),!r&&this.options.supportedLngs&&e.forEach(n=>{if(r)return;const i=this.getScriptPartFromCode(n);if(this.isSupportedCode(i))return r=i;const a=this.getLanguagePartFromCode(n);if(this.isSupportedCode(a))return r=a;r=this.options.supportedLngs.find(s=>s===a?!0:!s.includes("-")&&!a.includes("-")?!1:!!(s.includes("-")&&!a.includes("-")&&s.slice(0,s.indexOf("-"))===a||s.startsWith(a)&&a.length>1))}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(e,r){if(!e)return[];if(typeof e=="function"&&(e=e(r)),mn(e)&&(e=[e]),Array.isArray(e))return e;if(!r)return e.default||[];let n=e[r];return n||(n=e[this.getScriptPartFromCode(r)]),n||(n=e[this.formatLanguageCode(r)]),n||(n=e[this.getLanguagePartFromCode(r)]),n||(n=e.default),n||[]}toResolveHierarchy(e,r){const n=this.options.fallbackLng,i=Array.isArray(n)?n.join("|"):n;i!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=i);const a=r===void 0||r===!1||mn(r),s=r===void 0&&typeof this.options.fallbackLng=="function",o=mn(e)&&a&&!s;let l=null;if(o){let f;r===void 0?f="undefined":r===!1?f="boolean:false":f=`string:${r}`,l=`${e.length}:${e}|${f}`}if(l!==null){const f=this.resolveHierarchyCache[l];if(f!==void 0)return f.slice()}const u=this.getFallbackCodes((r===!1?[]:r)||this.options.fallbackLng||[],e),h=[],d=f=>{f&&(this.isSupportedCode(f)?h.push(f):this.logger.warn(`rejecting language code not found in supportedLngs: ${f}`))};return mn(e)&&(e.includes("-")||e.includes("_"))?(this.options.load!=="languageOnly"&&d(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&d(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&d(this.getLanguagePartFromCode(e))):mn(e)&&d(this.formatLanguageCode(e)),u.forEach(f=>{h.includes(f)||d(this.formatLanguageCode(f))}),l!==null?(this.resolveHierarchyCache[l]=h,h.slice()):h}}const UUe={zero:0,one:1,two:2,few:3,many:4,other:5},VUe={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Prr{constructor(e,r={}){this.languageUtils=e,this.options=r,this.logger=Yg.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,r={}){const n=jP(e==="dev"?"en":e),i=r.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:i});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let s;try{s=new Intl.PluralRules(n,{type:i})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),VUe;if(!e.match(/-|_/))return VUe;const l=this.languageUtils.getLanguagePartFromCode(e);s=this.getRule(l,r)}return this.pluralRulesCache[a]=s,s}needsPlural(e,r={}){let n=this.getRule(e,r);return n||(n=this.getRule("dev",r)),(n==null?void 0:n.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,r,n={}){return this.getSuffixes(e,n).map(i=>`${r}${i}`)}getSuffixes(e,r={}){let n=this.getRule(e,r);return n||(n=this.getRule("dev",r)),n?n.resolvedOptions().pluralCategories.sort((i,a)=>UUe[i]-UUe[a]).map(i=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(e,r,n={}){const i=this.getRule(e,n);return i?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i.select(r)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",r,n))}}const QUe=(t,e,r,n=".",i=!0)=>{let a=Orr(t,e,r);return!a&&i&&mn(r)&&(a=jse(t,r,n),a===void 0&&(a=jse(e,r,n))),a},GUe=t=>t.replace(/\$/g,"$$$$");class HUe{constructor(e={}){var r;this.logger=Yg.create("interpolator"),this.options=e,this.format=((r=e==null?void 0:e.interpolation)==null?void 0:r.format)||(n=>n),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:r,escapeValue:n,useRawValueToEscape:i,prefix:a,prefixEscaped:s,suffix:o,suffixEscaped:l,formatSeparator:u,unescapeSuffix:h,unescapePrefix:d,nestingPrefix:f,nestingPrefixEscaped:p,nestingSuffix:g,nestingSuffixEscaped:m,nestingOptionsSeparator:v,maxReplaces:y,alwaysFormat:b}=e.interpolation;this.escape=r!==void 0?r:Err,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=a?Ev(a):s||"{{",this.suffix=o?Ev(o):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=h?"":d?Ev(d):"-",this.unescapeSuffix=this.unescapePrefix?"":h?Ev(h):"",this.nestingPrefix=f?Ev(f):p||Ev("$t("),this.nestingSuffix=g?Ev(g):m||Ev(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=y||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(r,n)=>(r==null?void 0:r.source)===n?(r.lastIndex=0,r):new RegExp(n,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,r,n,i){var p;let a,s,o;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const b=QUe(r,l,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(b,void 0,n,{...i,...r,interpolationkey:g}):b}const m=g.split(this.formatSeparator),v=m.shift().trim(),y=m.join(this.formatSeparator).trim();return this.format(QUe(r,l,v,this.options.keySeparator,this.options.ignoreJSONStructure),y,n,{...i,...r,interpolationkey:v})};this.resetRegExp(),!this.escapeValue&&typeof e=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const h=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,d=((p=i==null?void 0:i.interpolation)==null?void 0:p.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>g},{regex:this.regexp,safeValue:g=>this.escapeValue?this.escape(g):g}].forEach(g=>{for(o=0;a=g.regex.exec(e);){const m=a[1].trim();if(s=u(m),s===void 0)if(typeof h=="function"){const y=h(e,a,i);s=mn(y)?y:""}else if(i&&Object.prototype.hasOwnProperty.call(i,m))s="";else if(d){s=a[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${e}`),s="";else!mn(s)&&!this.useRawValueToEscape&&(s=qse(s));const v=g.safeValue(s);if(e=e.replace(a[0],GUe(v)),d?(g.regex.lastIndex+=v.length,g.regex.lastIndex-=a[0].length):g.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,r,n={}){let i,a,s;const o=(l,u)=>{const h=this.nestingOptionsSeparator;if(!l.includes(h))return l;const d=l.split(new RegExp(`${Ev(h)}[ ]*{`));let f=`{${d[1]}`;l=d[0],f=this.interpolate(f,s);const p=f.match(/'/g),g=f.match(/"/g);(((p==null?void 0:p.length)??0)%2===0&&!g||((g==null?void 0:g.length)??0)%2!==0)&&(f=f.replace(/'/g,'"'));try{s=JSON.parse(f),u&&(s={...u,...s})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,m),`${l}${h}${f}`}return s.defaultValue&&s.defaultValue.includes(this.prefix)&&delete s.defaultValue,l};for(;i=this.nestingRegexp.exec(e);){let l=[];s={...n},s=s.replace&&!mn(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;const u=/{.*}/s.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(u!==-1&&(l=i[1].slice(u).split(this.formatSeparator).map(h=>h.trim()).filter(Boolean),i[1]=i[1].slice(0,u)),a=r(o.call(this,i[1].trim(),s),s),a&&i[0]===e&&!mn(a))return a;mn(a)||(a=qse(a)),a||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),a=""),l.length&&(a=l.reduce((h,d)=>this.format(h,d,n.lng,{...n,interpolationkey:i[1].trim()}),a.trim())),e=e.replace(i[0],GUe(qse(a))),this.regexp.lastIndex=0}return e}}const Nrr=t=>{let e=t.toLowerCase().trim();const r={};if(t.includes("(")){const n=t.split("(");e=n[0].toLowerCase().trim();const i=n[1].slice(0,-1);e==="currency"&&!i.includes(":")?r.currency||(r.currency=i.trim()):e==="relativetime"&&!i.includes(":")?r.range||(r.range=i.trim()):i.split(";").forEach(s=>{if(s){const[o,...l]=s.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),h=o.trim();r[h]||(r[h]=u),u==="false"&&(r[h]=!1),u==="true"&&(r[h]=!0),isNaN(u)||(r[h]=parseInt(u,10))}})}return{formatName:e,formatOptions:r}},WUe=t=>{const e={};return(r,n,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});const s=n+JSON.stringify(a);let o=e[s];return o||(o=t(jP(n),i),e[s]=o),o(r)}},Brr=t=>(e,r,n)=>t(jP(r),n)(e);class $rr{constructor(e={}){this.logger=Yg.create("formatter"),this.options=e,this.init(e)}init(e,r={interpolation:{}}){this.formatSeparator=r.interpolation.formatSeparator||",";const n=r.cacheInBuiltFormats?WUe:Brr;this.formats={number:n((i,a)=>{const s=new Intl.NumberFormat(i,{...a});return o=>s.format(o)}),currency:n((i,a)=>{const s=new Intl.NumberFormat(i,{...a,style:"currency"});return o=>s.format(o)}),datetime:n((i,a)=>{const s=new Intl.DateTimeFormat(i,{...a});return o=>s.format(o)}),relativetime:n((i,a)=>{const s=new Intl.RelativeTimeFormat(i,{...a});return o=>s.format(o,a.range||"day")}),list:n((i,a)=>{const s=new Intl.ListFormat(i,{...a});return o=>s.format(o)})}}add(e,r){this.formats[e.toLowerCase().trim()]=r}addCached(e,r){this.formats[e.toLowerCase().trim()]=WUe(r)}format(e,r,n,i={}){if(!r||e==null)return e;const a=r.split(this.formatSeparator),s=[];for(let l=0;l-1&&!u.includes(")")&&l+1{var f;const{formatName:h,formatOptions:d}=Nrr(u);if(this.formats[h]){let p=l;try{const g=((f=i==null?void 0:i.formatParams)==null?void 0:f[i.interpolationkey])||{},m=g.locale||g.lng||i.locale||i.lng||n;p=this.formats[h](l,m,{...d,...i,...g})}catch(g){this.logger.warn(g)}return p}else this.logger.warn(`there was no format function for ${h}`);return l},e)}}const Frr=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class zrr extends pV{constructor(e,r,n,i={}){var a,s;super(),this.backend=e,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=i,this.logger=Yg.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(s=(a=this.backend)==null?void 0:a.init)==null||s.call(a,n,i.backend,i)}queueLoad(e,r,n,i){const a={},s={},o={},l={};return e.forEach(u=>{let h=!0;r.forEach(d=>{const f=`${u}|${d}`;!n.reload&&this.store.hasResourceBundle(u,d)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?s[f]===void 0&&(s[f]=!0):(this.state[f]=1,h=!1,s[f]===void 0&&(s[f]=!0),a[f]===void 0&&(a[f]=!0),l[d]===void 0&&(l[d]=!0)))}),h||(o[u]=!0)}),(Object.keys(a).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(a),pending:Object.keys(s),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(l)}}loaded(e,r,n){const i=e.split("|"),a=i[0],s=i[1];r&&this.emit("failedLoading",a,s,r),!r&&n&&this.store.addResourceBundle(a,s,n,void 0,void 0,{skipCopy:!0}),this.state[e]=r?-1:2,r&&n&&(this.state[e]=0);const o={};this.queue.forEach(l=>{Crr(l.loaded,[a],s),Frr(l,e),r&&l.errors.push(r),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{o[u]||(o[u]={});const h=l.loaded[u];h.length&&h.forEach(d=>{o[u][d]===void 0&&(o[u][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(l=>!l.done)}read(e,r,n,i=0,a=this.retryTimeout,s){if(!e.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:r,fcName:n,tried:i,wait:a,callback:s});return}this.readingCalls++;const o=(u,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(u&&h&&i{this.read(e,r,n,i+1,a*2,s)},a);return}s(u,h)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const u=l(e,r);u&&typeof u.then=="function"?u.then(h=>o(null,h)).catch(o):o(null,u)}catch(u){o(u)}return}return l(e,r,o)}prepareLoading(e,r,n={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();mn(e)&&(e=this.languageUtils.toResolveHierarchy(e)),mn(r)&&(r=[r]);const a=this.queueLoad(e,r,n,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.toLoad.forEach(s=>{this.loadOne(s)})}load(e,r,n){this.prepareLoading(e,r,{},n)}reload(e,r,n){this.prepareLoading(e,r,{reload:!0},n)}loadOne(e,r=""){const n=e.split("|"),i=n[0],a=n[1];this.read(i,a,"read",void 0,void 0,(s,o)=>{s&&this.logger.warn(`${r}loading namespace ${a} for language ${i} failed`,s),!s&&o&&this.logger.log(`${r}loaded namespace ${a} for language ${i}`,o),this.loaded(e,s,o)})}saveMissing(e,r,n,i,a,s={},o=()=>{}){var l,u,h,d,f;if((u=(l=this.services)==null?void 0:l.utils)!=null&&u.hasLoadedNamespace&&!((d=(h=this.services)==null?void 0:h.utils)!=null&&d.hasLoadedNamespace(r))){this.logger.warn(`did not save key "${n}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if((f=this.backend)!=null&&f.create){const p={...s,isUpdate:a},g=this.backend.create.bind(this.backend);if(g.length<6)try{let m;g.length===5?m=g(e,r,n,i,p):m=g(e,r,n,i),m&&typeof m.then=="function"?m.then(v=>o(null,v)).catch(o):o(null,m)}catch(m){o(m)}else g(e,r,n,i,o,p)}!e||!e[0]||this.store.addResource(e[0],r,n,i)}}}const Kse=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),mn(t[1])&&(e.defaultValue=t[1]),mn(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const r=t[3]||t[2];Object.keys(r).forEach(n=>{e[n]=r[n]})}return e},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),YUe=t=>(mn(t.ns)&&(t.ns=[t.ns]),mn(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),mn(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&!t.supportedLngs.includes("cimode")&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),mV=()=>{},Urr=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(r=>{typeof t[r]=="function"&&(t[r]=t[r].bind(t))})};class XP extends pV{constructor(e={},r){if(super(),this.options=YUe(e),this.services={},this.logger=Yg,this.modules={external:[]},Urr(this),r&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,r),this;setTimeout(()=>{this.init(e,r)},0)}}init(e={},r){this.isInitializing=!0,typeof e=="function"&&(r=e,e={}),e.defaultNS==null&&e.ns&&(mn(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));const n=Kse();this.options={...n,...this.options,...YUe(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);const i=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?Yg.init(i(this.modules.logger),this.options):Yg.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=$rr;const h=new zUe(this.options);this.store=new BUe(this.options.resources,this.options);const d=this.services;d.logger=Yg,d.resourceStore=this.store,d.languageUtils=h,d.pluralResolver=new Prr(h,{prepend:this.options.pluralSeparator}),u&&(d.formatter=i(u),d.formatter.init&&d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new HUe(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new zrr(i(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",(f,...p)=>{this.emit(f,...p)}),this.modules.languageDetector&&(d.languageDetector=i(this.modules.languageDetector),d.languageDetector.init&&d.languageDetector.init(d,this.options.detection,this.options)),this.modules.i18nFormat&&(d.i18nFormat=i(this.modules.i18nFormat),d.i18nFormat.init&&d.i18nFormat.init(this)),this.translator=new gV(this.services,this.options),this.translator.on("*",(f,...p)=>{this.emit(f,...p)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,r||(r=mV),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...h)=>this.store[u](...h)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...h)=>(this.store[u](...h),this)});const o=YP(),l=()=>{const u=(h,d)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(d),r(h,d)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),o}loadResources(e,r=mV){var a,s;let n=r;const i=mn(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const o=[],l=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(d=>{d!=="cimode"&&(o.includes(d)||o.push(d))})};i?l(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(h=>l(h)),(s=(a=this.options.preload)==null?void 0:a.forEach)==null||s.call(a,u=>l(u)),this.services.backendConnector.load(o,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(u)})}else n(null)}reloadResources(e,r,n){const i=YP();return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r=void 0),e||(e=this.languages),r||(r=this.options.ns),n||(n=mV),this.services.backendConnector.reload(e,r,a=>{i.resolve(),n(a)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&$Ue.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!["cimode","dev"].includes(e)){for(let r=0;r{this.language=o,this.languages=this.services.languageUtils.toResolveHierarchy(o),this.resolvedLanguage=void 0,this.setResolvedLanguage(o)},a=(o,l)=>{l?this.isLanguageChangingTo===e&&(i(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,n.resolve((...u)=>this.t(...u)),r&&r(o,(...u)=>this.t(...u))},s=o=>{var h,d;!e&&!o&&this.services.languageDetector&&(o=[]);const l=mn(o)?o:o&&o[0],u=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(mn(o)?[o]:o);u&&(this.language||i(u),this.translator.language||this.translator.changeLanguage(u),(d=(h=this.services.languageDetector)==null?void 0:h.cacheUserLanguage)==null||d.call(h,u)),this.loadResources(u,f=>{a(f,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e),n}getFixedT(e,r,n,i){const a=i==null?void 0:i.scopeNs,s=(o,l,...u)=>{let h;typeof l!="object"?h=this.options.overloadTranslationOptionHandler([o,l].concat(u)):h={...l},h.lng=h.lng||s.lng,h.lngs=h.lngs||s.lngs;const d=h.ns!==void 0&&h.ns!==null;h.ns=h.ns||s.ns,h.keyPrefix!==""&&(h.keyPrefix=h.keyPrefix||n||s.keyPrefix);const f={...this.options,...h};Array.isArray(a)&&!d&&(f.ns=a),typeof h.keyPrefix=="function"&&(h.keyPrefix=Hw(h.keyPrefix,f));const p=this.options.keySeparator||".";let g;return h.keyPrefix&&Array.isArray(o)?g=o.map(m=>(typeof m=="function"&&(m=Hw(m,f)),`${h.keyPrefix}${p}${m}`)):(typeof o=="function"&&(o=Hw(o,f)),g=h.keyPrefix?`${h.keyPrefix}${p}${o}`:o),this.t(g,h)};return mn(e)?s.lng=e:s.lngs=e,s.ns=r,s.keyPrefix=n,s}t(...e){var r;return(r=this.translator)==null?void 0:r.translate(...e)}exists(...e){var r;return(r=this.translator)==null?void 0:r.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,r={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=r.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const s=(o,l)=>{const u=this.services.backendConnector.state[`${o}|${l}`];return u===-1||u===0||u===2};if(r.precheck){const o=r.precheck(this,s);if(o!==void 0)return o}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(n,e)&&(!i||s(a,e)))}loadNamespaces(e,r){const n=YP();return this.options.ns?(mn(e)&&(e=[e]),e.forEach(i=>{this.options.ns.includes(i)||this.options.ns.push(i)}),this.loadResources(i=>{n.resolve(),r&&r(i)}),n):(r&&r(),Promise.resolve())}loadLanguages(e,r){const n=YP();mn(e)&&(e=[e]);const i=this.options.preload||[],a=e.filter(s=>!i.includes(s)&&this.services.languageUtils.isSupportedCode(s));return a.length?(this.options.preload=i.concat(a),this.loadResources(s=>{n.resolve(),r&&r(s)}),n):(r&&r(),Promise.resolve())}dir(e){var i,a;if(e||(e=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.length)>0?this.languages[0]:this.language)),!e)return"rtl";try{const s=new Intl.Locale(e);if(s&&s.getTextInfo){const o=s.getTextInfo();if(o&&o.direction)return o.direction}}catch{}const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=((a=this.services)==null?void 0:a.languageUtils)||new zUe(Kse());return e.toLowerCase().indexOf("-latn")>1?"ltr":r.includes(n.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},r){const n=new XP(e,r);return n.createInstance=XP.createInstance,n}cloneInstance(e={},r=mV){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},a=new XP(i);if((e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(o=>{a[o]=this[o]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n){const o=Object.keys(this.store.data).reduce((l,u)=>(l[u]={...this.store.data[u]},l[u]=Object.keys(l[u]).reduce((h,d)=>(h[d]={...l[u][d]},h),l[u]),l),{});a.store=new BUe(o,i),a.services.resourceStore=a.store}if(e.interpolation){const l={...Kse().interpolation,...this.options.interpolation,...e.interpolation},u={...i,interpolation:l};a.services.interpolator=new HUe(u)}return a.translator=new gV(a.services,i),a.translator.on("*",(o,...l)=>{a.emit(o,...l)}),a.init(i,r),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const fu=XP.createInstance();fu.createInstance,fu.dir,fu.init,fu.loadResources,fu.reloadResources,fu.use,fu.changeLanguage,fu.getFixedT,fu.t,fu.exists,fu.setDefaultNamespace,fu.hasLoadedNamespace,fu.loadNamespaces,fu.loadLanguages;const Vrr={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,"!doctype":!0,"!DOCTYPE":!0},Qrr=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function qUe(t){const e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},r=t.match(/<\/?([^\s]+?)[/\s>]/);if(r&&(e.name=r[1],(Vrr[r[1]]||t.charAt(t.length-2)==="/")&&(e.voidElement=!0),e.name.startsWith("!--"))){const a=t.indexOf("-->");return{type:"comment",comment:a!==-1?t.slice(4,a):""}}const n=new RegExp(Qrr);let i=null;for(;i=n.exec(t),i!==null;)if(i[0].trim())if(i[1]){const a=i[1].trim();let s=[a,null];const o=a.indexOf("=");o>-1&&(s=[a.slice(0,o),a.slice(o+1)]),e.attrs[s[0]]=s[1],n.lastIndex--}else i[2]&&(e.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return e}const vV=/|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,Grr=/<\/?([^\s]+?)[/\s>]/,Hrr=/^\s*$/,Wrr=/^(script|style)$/i,KP="\0",Yrr=Object.create(null);function jUe(t){t.forEach(function(e){if(e.type==="text"){e.content=e.content.split(KP).join("<");return}if(e.type==="comment"){e.comment=e.comment.split(KP).join("<");return}for(const r in e.attrs){const n=e.attrs[r];typeof n=="string"&&n.indexOf(KP)>-1&&(e.attrs[r]=n.split(KP).join("<"))}e.children.length&&jUe(e.children)})}function qrr(t,e){const r=e&&e.components||Yrr,n=e&&e.allowedTags;let i=!1;if(n){const g=typeof n=="function"?n:function(b){return n.indexOf(b)>-1};let m="",v=0;vV.lastIndex=0;let y;for(;y=vV.exec(t);){const b=y[0];m+=t.slice(v,y.index);const x=b.match(Grr);b.startsWith("",t}}function Xrr(t){return t.reduce(function(e,r){return e+XUe("",r)},"")}var Krr={parse:qrr,stringify:Xrr};const yV=(t,e,r,n)=>{var a,s,o,l;const i=[r,{code:e,...n||{}}];if((s=(a=t==null?void 0:t.services)==null?void 0:a.logger)!=null&&s.forward)return t.services.logger.forward(i,"warn","react-i18next::",!0);yh(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),(l=(o=t==null?void 0:t.services)==null?void 0:o.logger)!=null&&l.warn?t.services.logger.warn(...i):console!=null&&console.warn&&console.warn(...i)},KUe={},Yk=(t,e,r,n)=>{yh(r)&&KUe[r]||(yh(r)&&(KUe[r]=new Date),yV(t,e,r,n))},ZUe=(t,e)=>()=>{if(t.isInitialized)e();else{const r=()=>{setTimeout(()=>{t.off("initialized",r)},0),e()};t.on("initialized",r)}},Zse=(t,e,r)=>{t.loadNamespaces(e,ZUe(t,r))},JUe=(t,e,r,n)=>{if(yh(r)&&(r=[r]),t.options.preload&&t.options.preload.indexOf(e)>-1)return Zse(t,r,n);r.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,ZUe(t,n))},Zrr=(t,e,r={})=>!e.languages||!e.languages.length?(Yk(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:r.lng,precheck:(n,i)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!i(n.isLanguageChangingTo,t))return!1}}),yh=t=>typeof t=="string",_v=t=>typeof t=="object"&&t!==null,Jrr=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,enr={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},tnr=t=>enr[t],eVe=t=>t.replace(Jrr,tnr);let Jse={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:eVe,transDefaultProps:void 0};const rnr=(t={})=>{Jse={...Jse,...t}},eoe=()=>Jse;let tVe;const nnr=t=>{tVe=t},toe=()=>tVe,bV=(t,e)=>{var n;if(!t)return!1;const r=((n=t.props)==null?void 0:n.children)??t.children;return e?r.length>0:!!r},ZP=t=>{var r,n;if(!t)return[];const e=((r=t.props)==null?void 0:r.children)??t.children;return(n=t.props)!=null&&n.i18nIsDynamicList?Mb(e):e},inr=t=>Array.isArray(t)&&t.every(se.isValidElement),Mb=t=>Array.isArray(t)?t:[t],anr=(t,e)=>{const r={...e};return r.props={...e.props,...t.props},r},snr=t=>{const e={};if(!t)return e;const r=n=>{Mb(n).forEach(a=>{yh(a)||(bV(a)?r(ZP(a)):_v(a)&&!se.isValidElement(a)&&Object.assign(e,a))})};return r(t),e},roe=(t,e,r,n)=>{if(!t)return"";let i="";const a=Mb(t),s=e!=null&&e.transSupportBasicHtmlNodes?e.transKeepBasicHtmlNodesFor??[]:[];return a.forEach((o,l)=>{if(yh(o)){i+=`${o}`;return}if(se.isValidElement(o)){const{props:u,type:h}=o,d=Object.keys(u).length,f=s.indexOf(h)>-1,p=u.children;if(!p&&f&&!d){i+=`<${h}/>`;return}if(!p&&(!f||d)||u.i18nIsDynamicList){i+=`<${l}>`;return}if(f&&d<=1){const m=yh(p)?p:roe(p,e,r,n);i+=`<${h}>${m}`;return}const g=roe(p,e,r,n);i+=`<${l}>${g}`;return}if(o===null){yV(r,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:n});return}if(_v(o)){const{format:u,...h}=o,d=Object.keys(h);if(d.length===1){const f=u?`${d[0]}, ${u}`:d[0];i+=`{{${f}}}`;return}yV(r,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:n,child:o});return}yV(r,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:n,child:o})}),i},onr=(t,e,r,n,i,a,s)=>{if(r==="")return[];const o=i.transKeepBasicHtmlNodesFor||[],l=r&&new RegExp(o.map(x=>`<${x}`).join("|")).test(r);if(!t&&!e&&!l&&!s)return[r];const u=e??{},h=x=>{Mb(x).forEach(A=>{yh(A)||(bV(A)?h(ZP(A)):_v(A)&&!se.isValidElement(A)&&Object.assign(u,A))})};h(t);const d=Object.keys(u),f=x=>/^\d+$/.test(x)||o.indexOf(x)>-1||d.indexOf(x)>-1,p=Krr.parse(`<0>${r}`,{allowedTags:f}),g={...u,...a},m=(x,w,A)=>{var O;const S=ZP(x),T=y(S,w.children,A);return inr(S)&&T.length===0||(O=x.props)!=null&&O.i18nIsDynamicList?S:T},v=(x,w,A,S,T)=>{x.dummy?(x.children=w,A.push(se.cloneElement(x,{key:S},T?void 0:w))):A.push(...se.Children.map([x],O=>{var E;if(O.type===se.Fragment||((E=O.props)==null?void 0:E.i18nIsDynamicList)!==void 0){const _={key:S};return O&&O.props&&Object.keys(O.props).forEach(I=>{I==="children"||I==="i18nIsDynamicList"||(_[I]=O.props[I])}),se.createElement(O.type,_,T?null:w)}const k={key:S};return O&&O.props&&Object.keys(O.props).forEach(_=>{_==="ref"||_==="children"||(k[_]=O.props[_])}),se.cloneElement(O,k,T?null:w)}))},y=(x,w,A)=>{const S=Mb(x),T=Mb(w),O={};return T.reduce((k,E,_)=>{var L,R;const I=((R=(L=E.children)==null?void 0:L[0])==null?void 0:R.content)&&n.services.interpolator.interpolate(E.children[0].content,g,n.language);if(E.type==="tag"){let D=S[parseInt(E.name,10)];!D&&e&&(D=e[E.name]),A.length===1&&!D&&(D=A[0][E.name]),D||(D={});const M={...E.attrs};s&&Object.keys(M).forEach(z=>{const U=M[z];yh(U)&&(M[z]=eVe(U))});const P=Object.keys(M).length!==0?anr({props:M},D):D,N=se.isValidElement(P),F=N&&bV(E,!0)&&!E.voidElement,B=l&&_v(P)&&P.dummy&&!N,V=_v(e)&&Object.hasOwnProperty.call(e,E.name);if(yh(P)){const z=n.services.interpolator.interpolate(P,g,n.language);k.push(z)}else if(bV(P)||F){const z=m(P,E,A);v(P,z,k,_)}else if(B){const z=y(S,E.children,A);v(P,z,k,_)}else if(Number.isNaN(parseFloat(E.name)))if(V){const z=m(P,E,A);v(P,z,k,_,E.voidElement)}else if(i.transSupportBasicHtmlNodes&&o.indexOf(E.name)>-1)if(E.voidElement)k.push(se.createElement(E.name,{key:`${E.name}-${_}`}));else{const z=O[E.name]||0;O[E.name]=z+1;let U,Q=0;for(let Y=0;Y`);else{const z=y(S,E.children,A);k.push(`<${E.name}>${z}`)}else if(_v(P)&&!N){const z=E.children[0]?I:null;z&&k.push(z)}else v(P,I,k,_,E.children.length!==1||!I)}else if(E.type==="text"){const D=i.transWrapTextNodes,M=typeof i.unescape=="function"?i.unescape:eoe().unescape,P=s?M(n.services.interpolator.interpolate(E.content,g,n.language)):n.services.interpolator.interpolate(E.content,g,n.language);D?k.push(se.createElement(D,{key:`${E.name}-${_}`},P)):k.push(P)}return k},[])},b=y([{dummy:!0,children:t||[]}],p,Mb(t||[]));return ZP(b[0])},rVe=(t,e,r)=>{const n=t.key||e,i=se.cloneElement(t,{key:n});if(!i.props||!i.props.children||r.indexOf(`${e}/>`)<0&&r.indexOf(`${e} />`)<0)return i;function a(){return se.createElement(se.Fragment,null,i)}return se.createElement(a,{key:n})},lnr=(t,e)=>t.map((r,n)=>rVe(r,n,e)),cnr=(t,e)=>{const r={};return Object.keys(t).forEach(n=>{Object.assign(r,{[n]:rVe(t[n],n,e)})}),r},unr=(t,e,r,n)=>t?Array.isArray(t)?lnr(t,e):_v(t)?cnr(t,e):(Yk(r,"TRANS_INVALID_COMPONENTS",' "components" prop expects an object or array',{i18nKey:n}),null):null,hnr=t=>!_v(t)||Array.isArray(t)?!1:Object.keys(t).reduce((e,r)=>e&&Number.isNaN(Number.parseFloat(r)),!0);function dnr({children:t,count:e,parent:r,i18nKey:n,context:i,tOptions:a={},values:s,defaults:o,components:l,ns:u,i18n:h,t:d,shouldUnescape:f,...p}){var B,V,z,U,Q,G;const g=h||toe();if(!g)return Yk(g,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.",{i18nKey:n}),t;const m=d||g.t.bind(g)||(X=>X),v={...eoe(),...(B=g.options)==null?void 0:B.react};let y=u||m.ns||((V=g.options)==null?void 0:V.defaultNS);y=yh(y)?[y]:y||["translation"];const{transDefaultProps:b}=v,x=b!=null&&b.tOptions?{...b.tOptions,...a}:a,w=f??(b==null?void 0:b.shouldUnescape),A=b!=null&&b.values?{...b.values,...s}:s,S=b!=null&&b.components?{...b.components,...l}:l,T=roe(t,v,g,n),O=o||(x==null?void 0:x.defaultValue)||T||v.transEmptyNodeValue||(typeof n=="function"?Hw(n):n),{hashTransKey:k}=v,E=n||(k?k(T||O):T||O);(U=(z=g.options)==null?void 0:z.interpolation)!=null&&U.defaultVariables?s=A&&Object.keys(A).length>0?{...A,...g.options.interpolation.defaultVariables}:{...g.options.interpolation.defaultVariables}:s=A;const _=snr(t);_&&typeof _.count=="number"&&e===void 0&&(e=_.count);const I=s||e!==void 0&&!((G=(Q=g.options)==null?void 0:Q.interpolation)!=null&&G.alwaysFormat)||!t?x.interpolation:{interpolation:{...x.interpolation,prefix:"#$?",suffix:"?$#"}},L={...x,context:i||x.context,count:e,...s,...I,defaultValue:O,ns:y};let R=E?m(E,L):O;R===E&&O&&(R=O);const D=unr(S,R,g,n);let M=D||t,P=null;hnr(D)&&(P=D,M=t);const N=onr(M,P,R,g,v,L,w),F=r??v.defaultTransParent;return F?se.createElement(F,p,N):N}const fnr={type:"3rdParty",init(t){rnr(t.options.react),nnr(t)}},nVe=se.createContext();class pnr{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function iVe({children:t,count:e,parent:r,i18nKey:n,context:i,tOptions:a={},values:s,defaults:o,components:l,ns:u,i18n:h,t:d,shouldUnescape:f,...p}){var b;const{i18n:g,defaultNS:m}=se.useContext(nVe)||{},v=h||g||toe(),y=d||(v==null?void 0:v.t.bind(v));return dnr({children:t,count:e,parent:r,i18nKey:n,context:i,tOptions:a,values:s,defaults:o,components:l,ns:u||(y==null?void 0:y.ns)||m||((b=v==null?void 0:v.options)==null?void 0:b.defaultNS),i18n:v,t:d,shouldUnescape:f,...p})}var aVe={exports:{}},sVe={};/** * @license React * use-sync-external-store-shim.production.js * @@ -90,7 +90,7 @@ Studio:{{studioUrl}} * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var qk=se;function gnr(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var mnr=typeof Object.is=="function"?Object.is:gnr,vnr=qk.useState,ynr=qk.useEffect,bnr=qk.useLayoutEffect,xnr=qk.useDebugValue;function wnr(t,e){var r=e(),n=vnr({inst:{value:r,getSnapshot:e}}),i=n[0].inst,a=n[1];return bnr(function(){i.value=r,i.getSnapshot=e,noe(i)&&a({inst:i})},[t,r,e]),ynr(function(){return noe(i)&&a({inst:i}),t(function(){noe(i)&&a({inst:i})})},[t]),xnr(r),r}function noe(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!mnr(t,r)}catch{return!0}}function Anr(t,e){return e()}var Tnr=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Anr:wnr;sVe.useSyncExternalStore=qk.useSyncExternalStore!==void 0?qk.useSyncExternalStore:Tnr,aVe.exports=sVe;var Snr=aVe.exports;const Cnr={t:(t,e)=>{if(yh(e))return e;if(_v(e)&&yh(e.defaultValue))return e.defaultValue;if(typeof t=="function")return"";if(Array.isArray(t)){const r=t[t.length-1];return typeof r=="function"?"":r}return t},ready:!1},Onr=()=>()=>{},Ea=(t,e={})=>{var k,E,_;const{i18n:r}=e,{i18n:n,defaultNS:i}=se.useContext(nVe)||{},a=r||n||toe();a&&!a.reportNamespaces&&(a.reportNamespaces=new pnr),a||Yk(a,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.");const s=se.useMemo(()=>{var I;return{...eoe(),...(I=a==null?void 0:a.options)==null?void 0:I.react,...e}},[a,e]),{useSuspense:o,keyPrefix:l}=s,u=t||i||((k=a==null?void 0:a.options)==null?void 0:k.defaultNS),h=yh(u)?[u]:u||["translation"],d=se.useMemo(()=>h,h);(_=(E=a==null?void 0:a.reportNamespaces)==null?void 0:E.addUsedNamespaces)==null||_.call(E,d);const f=se.useRef(0),p=se.useCallback(I=>{if(!a)return Onr;const{bindI18n:L,bindI18nStore:R}=s,D=()=>{f.current+=1,I()};return L&&a.on(L,D),R&&a.store.on(R,D),()=>{L&&L.split(" ").forEach(M=>a.off(M,D)),R&&R.split(" ").forEach(M=>a.store.off(M,D))}},[a,s]),g=se.useRef(),m=se.useCallback(()=>{if(!a)return Cnr;const I=!!(a.isInitialized||a.initializedStoreOnce)&&d.every(N=>Zrr(N,a,s)),L=e.lng||a.language,R=f.current,D=g.current;if(D&&D.ready===I&&D.lng===L&&D.keyPrefix===l&&D.revision===R)return D;const P={t:a.getFixedT(L,s.nsMode==="fallback"?d:d[0],l,{scopeNs:d}),ready:I,lng:L,keyPrefix:l,revision:R};return g.current=P,P},[a,d,l,s,e.lng]),[v,y]=se.useState(0),{t:b,ready:x}=Snr.useSyncExternalStore(p,m,m);se.useEffect(()=>{if(a&&!x&&!o){const I=()=>y(L=>L+1);e.lng?JUe(a,e.lng,d,I):Zse(a,d,I)}},[a,e.lng,d,x,o,v]);const w=a||{},A=se.useRef(null),T=se.useRef(),S=I=>{const L=Object.getOwnPropertyDescriptors(I);L.__original&&delete L.__original;const R=Object.create(Object.getPrototypeOf(I),L);if(!Object.prototype.hasOwnProperty.call(R,"__original"))try{Object.defineProperty(R,"__original",{value:I,writable:!1,enumerable:!1,configurable:!1})}catch{}return R},O=se.useMemo(()=>{const I=w,L=I==null?void 0:I.language;let R=I;I&&(A.current&&A.current.__original===I?T.current!==L?(R=S(I),A.current=R,T.current=L):R=A.current:(R=S(I),A.current=R,T.current=L));const D=!x&&!o?(...P)=>(Yk(a,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),b(...P)):b,M=[D,R,x];return M.t=D,M.i18n=R,M.ready=x,M},[b,w,x,w.resolvedLanguage,w.language,w.languages]);if(a&&o&&!x){let I=!1;try{I=!1}catch{}throw I&&Yk(a,"SUSPENDED_WHILE_LOADING","useTranslation: suspended while translations are loading (useSuspense is true by default). Add a boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook"),new Promise(L=>{const R=()=>L();e.lng?JUe(a,e.lng,d,R):Zse(a,d,R)})}return O},oVe=Arr(),qg=fu.createInstance();qg.use(fnr).init({resources:{"en-US":{adk:_Ne,app:HNe,conversation:x8e},"zh-CN":{adk:U$e,app:n9e,conversation:L9e}},lng:oVe,fallbackLng:Wse,supportedLngs:[...DUe],defaultNS:"common",interpolation:{escapeValue:!1},initAsync:!1}),LUe(oVe),qg.on("languageChanged",t=>{const e=Yse(t)??Wse;LUe(e)});const knr=Object.assign({"./resources/en-US/adk.json":$tr,"./resources/en-US/app.json":Ftr,"./resources/en-US/automations.json":ztr,"./resources/en-US/common.json":Utr,"./resources/en-US/conversation.json":Vtr,"./resources/en-US/create.json":Qtr,"./resources/en-US/cronjobs.json":Gtr,"./resources/en-US/feedback.json":Htr,"./resources/en-US/migrations.json":Wtr,"./resources/en-US/newChat.json":Ytr,"./resources/en-US/sandbox.json":qtr,"./resources/en-US/shell.json":jtr,"./resources/en-US/sidebar.json":Xtr,"./resources/en-US/skills.json":Ktr,"./resources/en-US/ui.json":Ztr,"./resources/en-US/websiteIntegration.json":Jtr,"./resources/en-US/workspaceTools.json":err,"./resources/zh-CN/adk.json":trr,"./resources/zh-CN/app.json":rrr,"./resources/zh-CN/automations.json":nrr,"./resources/zh-CN/common.json":irr,"./resources/zh-CN/conversation.json":arr,"./resources/zh-CN/create.json":srr,"./resources/zh-CN/cronjobs.json":orr,"./resources/zh-CN/feedback.json":lrr,"./resources/zh-CN/migrations.json":crr,"./resources/zh-CN/newChat.json":urr,"./resources/zh-CN/sandbox.json":hrr,"./resources/zh-CN/shell.json":drr,"./resources/zh-CN/sidebar.json":frr,"./resources/zh-CN/skills.json":prr,"./resources/zh-CN/ui.json":grr,"./resources/zh-CN/websiteIntegration.json":mrr,"./resources/zh-CN/workspaceTools.json":vrr});function Enr(){const t={};for(const[e,r]of Object.entries(knr)){const n=e.match(/\/resources\/([^/]+)\/([^/]+)\.json$/);if(!n)continue;const[,i,a]=n;t[i]??(t[i]={}),t[i][a]=r.default}return t}for(const[t,e]of Object.entries(Enr()))for(const[r,n]of Object.entries(e??{}))qg.addResourceBundle(t,r,n,!0,!0);const _nr=`pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*! + */var qk=se;function gnr(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var mnr=typeof Object.is=="function"?Object.is:gnr,vnr=qk.useState,ynr=qk.useEffect,bnr=qk.useLayoutEffect,xnr=qk.useDebugValue;function wnr(t,e){var r=e(),n=vnr({inst:{value:r,getSnapshot:e}}),i=n[0].inst,a=n[1];return bnr(function(){i.value=r,i.getSnapshot=e,noe(i)&&a({inst:i})},[t,r,e]),ynr(function(){return noe(i)&&a({inst:i}),t(function(){noe(i)&&a({inst:i})})},[t]),xnr(r),r}function noe(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!mnr(t,r)}catch{return!0}}function Anr(t,e){return e()}var Snr=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Anr:wnr;sVe.useSyncExternalStore=qk.useSyncExternalStore!==void 0?qk.useSyncExternalStore:Snr,aVe.exports=sVe;var Tnr=aVe.exports;const Cnr={t:(t,e)=>{if(yh(e))return e;if(_v(e)&&yh(e.defaultValue))return e.defaultValue;if(typeof t=="function")return"";if(Array.isArray(t)){const r=t[t.length-1];return typeof r=="function"?"":r}return t},ready:!1},Onr=()=>()=>{},Ea=(t,e={})=>{var k,E,_;const{i18n:r}=e,{i18n:n,defaultNS:i}=se.useContext(nVe)||{},a=r||n||toe();a&&!a.reportNamespaces&&(a.reportNamespaces=new pnr),a||Yk(a,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.");const s=se.useMemo(()=>{var I;return{...eoe(),...(I=a==null?void 0:a.options)==null?void 0:I.react,...e}},[a,e]),{useSuspense:o,keyPrefix:l}=s,u=t||i||((k=a==null?void 0:a.options)==null?void 0:k.defaultNS),h=yh(u)?[u]:u||["translation"],d=se.useMemo(()=>h,h);(_=(E=a==null?void 0:a.reportNamespaces)==null?void 0:E.addUsedNamespaces)==null||_.call(E,d);const f=se.useRef(0),p=se.useCallback(I=>{if(!a)return Onr;const{bindI18n:L,bindI18nStore:R}=s,D=()=>{f.current+=1,I()};return L&&a.on(L,D),R&&a.store.on(R,D),()=>{L&&L.split(" ").forEach(M=>a.off(M,D)),R&&R.split(" ").forEach(M=>a.store.off(M,D))}},[a,s]),g=se.useRef(),m=se.useCallback(()=>{if(!a)return Cnr;const I=!!(a.isInitialized||a.initializedStoreOnce)&&d.every(N=>Zrr(N,a,s)),L=e.lng||a.language,R=f.current,D=g.current;if(D&&D.ready===I&&D.lng===L&&D.keyPrefix===l&&D.revision===R)return D;const P={t:a.getFixedT(L,s.nsMode==="fallback"?d:d[0],l,{scopeNs:d}),ready:I,lng:L,keyPrefix:l,revision:R};return g.current=P,P},[a,d,l,s,e.lng]),[v,y]=se.useState(0),{t:b,ready:x}=Tnr.useSyncExternalStore(p,m,m);se.useEffect(()=>{if(a&&!x&&!o){const I=()=>y(L=>L+1);e.lng?JUe(a,e.lng,d,I):Zse(a,d,I)}},[a,e.lng,d,x,o,v]);const w=a||{},A=se.useRef(null),S=se.useRef(),T=I=>{const L=Object.getOwnPropertyDescriptors(I);L.__original&&delete L.__original;const R=Object.create(Object.getPrototypeOf(I),L);if(!Object.prototype.hasOwnProperty.call(R,"__original"))try{Object.defineProperty(R,"__original",{value:I,writable:!1,enumerable:!1,configurable:!1})}catch{}return R},O=se.useMemo(()=>{const I=w,L=I==null?void 0:I.language;let R=I;I&&(A.current&&A.current.__original===I?S.current!==L?(R=T(I),A.current=R,S.current=L):R=A.current:(R=T(I),A.current=R,S.current=L));const D=!x&&!o?(...P)=>(Yk(a,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),b(...P)):b,M=[D,R,x];return M.t=D,M.i18n=R,M.ready=x,M},[b,w,x,w.resolvedLanguage,w.language,w.languages]);if(a&&o&&!x){let I=!1;try{I=!1}catch{}throw I&&Yk(a,"SUSPENDED_WHILE_LOADING","useTranslation: suspended while translations are loading (useSuspense is true by default). Add a boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook"),new Promise(L=>{const R=()=>L();e.lng?JUe(a,e.lng,d,R):Zse(a,d,R)})}return O},oVe=Arr(),qg=fu.createInstance();qg.use(fnr).init({resources:{"en-US":{adk:_Ne,app:HNe,conversation:x8e},"zh-CN":{adk:U$e,app:n9e,conversation:L9e}},lng:oVe,fallbackLng:Wse,supportedLngs:[...DUe],defaultNS:"common",interpolation:{escapeValue:!1},initAsync:!1}),LUe(oVe),qg.on("languageChanged",t=>{const e=Yse(t)??Wse;LUe(e)});const knr=Object.assign({"./resources/en-US/adk.json":$tr,"./resources/en-US/app.json":Ftr,"./resources/en-US/automations.json":ztr,"./resources/en-US/common.json":Utr,"./resources/en-US/conversation.json":Vtr,"./resources/en-US/create.json":Qtr,"./resources/en-US/cronjobs.json":Gtr,"./resources/en-US/feedback.json":Htr,"./resources/en-US/migrations.json":Wtr,"./resources/en-US/newChat.json":Ytr,"./resources/en-US/sandbox.json":qtr,"./resources/en-US/shell.json":jtr,"./resources/en-US/sidebar.json":Xtr,"./resources/en-US/skills.json":Ktr,"./resources/en-US/ui.json":Ztr,"./resources/en-US/websiteIntegration.json":Jtr,"./resources/en-US/workspaceTools.json":err,"./resources/zh-CN/adk.json":trr,"./resources/zh-CN/app.json":rrr,"./resources/zh-CN/automations.json":nrr,"./resources/zh-CN/common.json":irr,"./resources/zh-CN/conversation.json":arr,"./resources/zh-CN/create.json":srr,"./resources/zh-CN/cronjobs.json":orr,"./resources/zh-CN/feedback.json":lrr,"./resources/zh-CN/migrations.json":crr,"./resources/zh-CN/newChat.json":urr,"./resources/zh-CN/sandbox.json":hrr,"./resources/zh-CN/shell.json":drr,"./resources/zh-CN/sidebar.json":frr,"./resources/zh-CN/skills.json":prr,"./resources/zh-CN/ui.json":grr,"./resources/zh-CN/websiteIntegration.json":mrr,"./resources/zh-CN/workspaceTools.json":vrr});function Enr(){const t={};for(const[e,r]of Object.entries(knr)){const n=e.match(/\/resources\/([^/]+)\/([^/]+)\.json$/);if(!n)continue;const[,i,a]=n;t[i]??(t[i]={}),t[i][a]=r.default}return t}for(const[t,e]of Object.entries(Enr()))for(const[r,n]of Object.entries(e??{}))qg.addResourceBundle(t,r,n,!0,!0);const _nr=`pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*! Theme: GitHub Description: Light theme as seen on github.com Author: github.com @@ -100,12 +100,12 @@ Studio:{{studioUrl}} 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}`,Rnr=".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[data-tool-tone=resources]{--builtin-tool-accent: 199 58% 38%}.builtin-tool-head[data-tool-tone=agent]{--builtin-tool-accent: 267 38% 47%}.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)}",Dnr=".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(--ring));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{--code-surface: hsl(var(--background));--code-panel: hsl(var(--secondary) / .26);--code-editor: hsl(var(--background));--code-text: hsl(var(--foreground));--code-muted: hsl(var(--muted-foreground));--code-border: hsl(var(--border));--code-hover: hsl(var(--foreground) / .05);--code-active: hsl(var(--foreground) / .085);width:min(1220px,94vw);height:min(800px,88vh);min-height:460px;display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--code-border);border-radius:12px;background:var(--code-surface);color:var(--code-text);box-shadow:0 24px 64px hsl(var(--foreground) / .16);color-scheme:light;animation:code-browser-rise-in .18s cubic-bezier(.2,.8,.2,1)}.code-browser-dialog.is-dark{--code-surface: hsl(220 13% 13%);--code-panel: hsl(220 13% 16%);--code-editor: hsl(220 13% 18%);--code-text: hsl(210 15% 90%);--code-muted: hsl(215 11% 65%);--code-border: hsl(215 12% 27%);--code-hover: hsl(210 14% 92% / .07);--code-active: hsl(210 14% 92% / .12);color-scheme:dark}.code-browser-head{flex:0 0 54px;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:0 12px 0 16px;border-bottom:1px solid var(--code-border);background:var(--code-surface)}.code-browser-title-wrap,.code-browser-head-actions,.code-browser-tab,.code-browser-path,.code-browser-diff-labels,.code-browser-statusbar{display:flex;align-items:center}.code-browser-title-wrap{min-width:0;gap:10px}.code-browser-title-wrap>div{min-width:0}.code-browser-title-icon{width:30px;height:30px;flex:0 0 auto;display:grid;place-items:center;border-radius:7px;background:var(--code-panel);color:var(--code-text)}.code-browser-title-icon svg,.code-browser-icon-button svg{width:16px;height:16px}.code-browser-title-wrap h2,.code-browser-title-wrap p{margin:0}.code-browser-title-wrap h2{color:var(--code-text);font-size:14px;font-weight:650;line-height:1.35}.code-browser-title-wrap p{overflow:hidden;color:var(--code-muted);font-size:11px;line-height:1.4;text-overflow:ellipsis;white-space:nowrap}.code-browser-head-actions{flex:0 0 auto;gap:4px}.code-browser-icon-button{width:30px;height:30px;flex:0 0 auto;display:inline-grid;place-items:center;padding:0;border:0;border-radius:8px;background:transparent;color:var(--code-muted);cursor:pointer;transition:color .12s ease,background-color .12s ease}.code-browser-icon-button:hover{background:var(--code-hover);color:var(--code-text)}.code-browser-icon-button:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:1px}.code-browser-workspace{flex:1;min-height:0;display:flex}.code-browser-sidebar{flex:0 0 236px;min-width:0;display:flex;flex-direction:column;border-right:1px solid var(--code-border);background:var(--code-panel)}.code-browser-sidebar-head,.code-browser-tabs,.code-browser-path{flex:0 0 34px;min-height:34px;border-bottom:1px solid var(--code-border)}.code-browser-sidebar-head{display:flex;align-items:center;justify-content:space-between;padding:0 12px;color:var(--code-muted);font-size:11px;font-weight:650;letter-spacing:.02em}.code-browser-sidebar-head>span:last-child{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:8px;padding-bottom:4px;border:0;background:transparent;color:var(--code-muted);font:inherit;font-size:12px;text-align:left;cursor:pointer}.code-browser-file:hover,.code-browser-folder:hover{background:var(--code-hover);color:var(--code-text)}.code-browser-file.is-active{background:var(--code-active);color:var(--code-text)}.code-browser-file:focus-visible,.code-browser-folder:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:-2px}.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:not(.code-browser-change),.code-browser-folder span,.code-browser-path span,.code-browser-tab>span:not(.code-browser-change){min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.code-browser-file>span:not(.code-browser-change){flex:1}.code-browser-change{flex:0 0 auto;min-width:29px;padding:2px 4px;border-radius:4px;font-size:9.5px;font-weight:650;line-height:1.2;text-align:center}.code-browser-change.is-added{background:#ddf3e5;color:#1d6d3a}.code-browser-change.is-modified{background:#f9edd2;color:#845915}.code-browser-change.is-deleted{background:#f9e1e1;color:#9f2d2d}.is-dark .code-browser-change.is-added{background:#224f32;color:#98e1b3}.is-dark .code-browser-change.is-modified{background:#554320;color:#eecf87}.is-dark .code-browser-change.is-deleted{background:#572323;color:#eea0a0}.code-browser-main{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;background:var(--code-editor)}.code-browser-tabs{display:flex;align-items:stretch;overflow:hidden;background:var(--code-panel)}.code-browser-tab{min-width:0;max-width:min(320px,65%);gap:6px;padding:0 11px;border-right:1px solid var(--code-border);border-top:2px solid hsl(var(--primary));background:var(--code-editor);color:var(--code-text);font-size:11.5px}.code-browser-tab>svg,.code-browser-path svg{width:13px;height:13px;flex:0 0 auto}.code-browser-path{gap:7px;padding:0 13px;color:var(--code-muted);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11.5px}.code-browser-diff-labels{flex:0 0 30px;justify-content:space-around;border-bottom:1px solid var(--code-border);background:var(--code-panel);color:var(--code-muted);font-size:11px}.code-browser-diff-labels span{width:50%;text-align:center}.code-browser-editor{flex:1;min-height:0;overflow:hidden;background:var(--code-editor)}.code-browser-editor>div,.code-browser-editor .cm-theme,.code-browser-editor .cm-editor,.code-browser-merge,.code-browser-merge>.cm-mergeView{height:100%}.code-browser-editor .cm-scroller{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:12.5px}.code-browser-merge>.cm-mergeView{overflow:auto}.code-browser-merge .cm-mergeViewEditors{min-height:100%}.code-browser-merge .cm-mergeViewEditor:first-child{border-right:1px solid var(--code-border)}.code-browser-merge .cm-editor{min-height:100%}.code-browser-statusbar{flex:0 0 26px;justify-content:space-between;gap:12px;padding:0 10px;border-top:1px solid var(--code-border);background:var(--code-panel);color:var(--code-muted);font-size:10.5px}.code-browser-empty{height:100%;display:grid;place-items:center;padding:20px;color:var(--code-muted);font-size:12px;text-align:center}@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: 760px){.code-browser-backdrop{padding:12px}.code-browser-dialog{width:100%;height:min(820px,94vh);min-height:0}.code-browser-workspace{flex-direction:column}.code-browser-sidebar{flex:0 0 168px;border-right:0;border-bottom:1px solid var(--code-border)}.code-browser-diff-labels span:first-child{display:none}.code-browser-diff-labels span:last-child{width:100%}}@media (prefers-reduced-motion: reduce){.code-browser-backdrop,.code-browser-dialog{animation:none}.code-browser-folder>svg:first-child{transition:none}}",Lnr=".text-shimmer.text-shimmer{color:transparent;background-size:200% auto;background-position:200% center;background-clip:text;-webkit-background-clip:text;animation:text-shimmer 4s linear infinite}@keyframes text-shimmer{to{background-position:-200% center}}@media (prefers-reduced-motion: reduce){.text-shimmer.text-shimmer{animation:none;background-position:50% center}}",Mnr='/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-font-weight:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, -apple-system, system-ui, "Segoe UI", "Noto Sans", "Helvetica", "Arial", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;--font-mono:ui-monospace, "SFMono-Regular", "SF Mono", "Menlo", "Monaco", "Consolas", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace;--spacing:.25rem;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:1024px;--breakpoint-xl:1280px;--breakpoint-2xl:1536px;--container-sm:24rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--breakpoint-xs:380px;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-2xs:.125rem;--radius-xs:.25rem;--radius-sm:.375rem;--radius-md:.5rem;--radius-lg:.625rem;--radius-xl:.75rem;--radius-2xl:1rem;--radius-3xl:1.25rem;--radius-4xl:1.5rem;--radius-full:9999px;--text-sm:var(--font-text-sm-size);--text-sm--line-height:var(--font-text-sm-line-height);--text-sm--font-weight:var(--font-text-sm-weight);--text-sm--letter-spacing:var(--font-text-sm-tracking);--tracking-wide:var(--font-tracking-wide);--tracking-normal:var(--font-tracking-normal);--tracking-tight:var(--font-tracking-tight);--shadow-hairline:var(--shadow-hairline)}:root,:where([data-theme]){--gray-500:#5d5d5d;--alpha-0:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-0:color-mix(in oklab, var(--alpha-base) 0%, transparent)}}:root,:where([data-theme]){--alpha-02:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-02:color-mix(in oklab, var(--alpha-base) 2%, transparent)}}:root,:where([data-theme]){--alpha-04:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-04:color-mix(in oklab, var(--alpha-base) 4%, transparent)}}:root,:where([data-theme]){--alpha-05:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-05:color-mix(in oklab, var(--alpha-base) 5%, transparent)}}:root,:where([data-theme]){--alpha-06:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-06:color-mix(in oklab, var(--alpha-base) 6%, transparent)}}:root,:where([data-theme]){--alpha-08:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-08:color-mix(in oklab, var(--alpha-base) 8%, transparent)}}:root,:where([data-theme]){--alpha-10:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-10:color-mix(in oklab, var(--alpha-base) 10%, transparent)}}:root,:where([data-theme]){--alpha-12:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-12:color-mix(in oklab, var(--alpha-base) 12%, transparent)}}:root,:where([data-theme]){--alpha-15:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-15:color-mix(in oklab, var(--alpha-base) 15%, transparent)}}:root,:where([data-theme]){--alpha-16:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-16:color-mix(in oklab, var(--alpha-base) 16%, transparent)}}:root,:where([data-theme]){--alpha-20:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-20:color-mix(in oklab, var(--alpha-base) 20%, transparent)}}:root,:where([data-theme]){--alpha-25:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-25:color-mix(in oklab, var(--alpha-base) 25%, transparent)}}:root,:where([data-theme]){--alpha-30:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-30:color-mix(in oklab, var(--alpha-base) 30%, transparent)}}:root,:where([data-theme]){--alpha-35:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-35:color-mix(in oklab, var(--alpha-base) 35%, transparent)}}:root,:where([data-theme]){--alpha-40:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-40:color-mix(in oklab, var(--alpha-base) 40%, transparent)}}:root,:where([data-theme]){--alpha-50:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-50:color-mix(in oklab, var(--alpha-base) 50%, transparent)}}:root,:where([data-theme]){--alpha-60:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-60:color-mix(in oklab, var(--alpha-base) 60%, transparent)}}:root,:where([data-theme]){--alpha-70:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-70:color-mix(in oklab, var(--alpha-base) 70%, transparent)}}:root,:where([data-theme]){--white:#fff;--black:#000;--green-25:#edfaf2;--green-50:#d9f4e4;--green-75:#b8ebcc;--green-100:#8cdfad;--green-200:#66d492;--green-300:#40c977;--green-400:#04b84c;--green-500:#00a240;--green-600:#008635;--green-700:#00692a;--green-800:#004f1f;--green-900:#003716;--green-950:#011c0b;--green-1000:#001207;--green-a25:var(--green-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--green-a25:color-mix(in oklab, var(--green-400) 8%, transparent)}}:root,:where([data-theme]){--green-a50:var(--green-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--green-a50:color-mix(in oklab, var(--green-400) 15%, transparent)}}:root,:where([data-theme]){--green-a75:var(--green-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--green-a75:color-mix(in oklab, var(--green-400) 29%, transparent)}}:root,:where([data-theme]){--green-a100:var(--green-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--green-a100:color-mix(in oklab, var(--green-400) 45%, transparent)}}:root,:where([data-theme]){--green-a200:var(--green-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--green-a200:color-mix(in oklab, var(--green-400) 60%, transparent)}}:root,:where([data-theme]){--green-a300:var(--green-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--green-a300:color-mix(in oklab, var(--green-400) 75%, transparent)}}:root,:where([data-theme]){--red-25:#fff0f0;--red-50:#ffd9d9;--red-75:#ffc6c5;--red-100:#ffa4a2;--red-200:#ff8583;--red-300:#ff6764;--red-400:#fa423e;--red-500:#e02e2a;--red-600:#ba2623;--red-700:#911e1b;--red-800:#6e1615;--red-900:#4d100e;--red-950:#280b0a;--red-1000:#1f0909;--red-a25:var(--red-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--red-a25:color-mix(in oklab, var(--red-400) 8%, transparent)}}:root,:where([data-theme]){--red-a50:var(--red-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--red-a50:color-mix(in oklab, var(--red-400) 16%, transparent)}}:root,:where([data-theme]){--red-a75:var(--red-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--red-a75:color-mix(in oklab, var(--red-400) 30%, transparent)}}:root,:where([data-theme]){--red-a100:var(--red-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--red-a100:color-mix(in oklab, var(--red-400) 48%, transparent)}}:root,:where([data-theme]){--red-a200:var(--red-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--red-a200:color-mix(in oklab, var(--red-400) 64%, transparent)}}:root,:where([data-theme]){--red-a300:var(--red-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--red-a300:color-mix(in oklab, var(--red-400) 79%, transparent)}}:root,:where([data-theme]){--pink-25:#fff4f9;--pink-50:#ffe8f3;--pink-75:#ffd4e8;--pink-100:#ffbada;--pink-200:#ffa3ce;--pink-300:#ff8cc1;--pink-400:#ff66ad;--pink-500:#e04c91;--pink-600:#ba437a;--pink-700:#963c67;--pink-800:#6e2c4a;--pink-900:#4d1f34;--pink-950:#29101c;--pink-1000:#1a0a11;--pink-a25:var(--pink-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--pink-a25:color-mix(in oklab, var(--pink-400) 8%, transparent)}}:root,:where([data-theme]){--pink-a50:var(--pink-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--pink-a50:color-mix(in oklab, var(--pink-400) 16%, transparent)}}:root,:where([data-theme]){--pink-a75:var(--pink-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--pink-a75:color-mix(in oklab, var(--pink-400) 28%, transparent)}}:root,:where([data-theme]){--pink-a100:var(--pink-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--pink-a100:color-mix(in oklab, var(--pink-400) 45%, transparent)}}:root,:where([data-theme]){--pink-a200:var(--pink-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--pink-a200:color-mix(in oklab, var(--pink-400) 60%, transparent)}}:root,:where([data-theme]){--pink-a300:var(--pink-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--pink-a300:color-mix(in oklab, var(--pink-400) 76%, transparent)}}:root,:where([data-theme]){--orange-25:#fff5f0;--orange-50:#ffe7d9;--orange-75:#ffcfb4;--orange-100:#ffb790;--orange-200:#ff9e6c;--orange-300:#ff8549;--orange-400:#fb6a22;--orange-500:#e25507;--orange-600:#b9480d;--orange-700:#923b0f;--orange-800:#6d2e0f;--orange-900:#4a2206;--orange-950:#281105;--orange-1000:#211107;--orange-a25:var(--orange-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--orange-a25:color-mix(in oklab, var(--orange-400) 7%, transparent)}}:root,:where([data-theme]){--orange-a50:var(--orange-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--orange-a50:color-mix(in oklab, var(--orange-400) 16%, transparent)}}:root,:where([data-theme]){--orange-a75:var(--orange-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--orange-a75:color-mix(in oklab, var(--orange-400) 33%, transparent)}}:root,:where([data-theme]){--orange-a100:var(--orange-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--orange-a100:color-mix(in oklab, var(--orange-400) 48%, transparent)}}:root,:where([data-theme]){--orange-a200:var(--orange-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--orange-a200:color-mix(in oklab, var(--orange-400) 65%, transparent)}}:root,:where([data-theme]){--orange-a300:var(--orange-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--orange-a300:color-mix(in oklab, var(--orange-400) 81%, transparent)}}:root,:where([data-theme]){--yellow-25:#fffbed;--yellow-50:#fff6d9;--yellow-75:#ffeeb8;--yellow-100:#ffe48c;--yellow-200:#ffdb66;--yellow-300:#ffd240;--yellow-400:#ffc300;--yellow-500:#e0ac00;--yellow-600:#ba8e00;--yellow-700:#916f00;--yellow-800:#6e5400;--yellow-900:#4d3b00;--yellow-950:#261d00;--yellow-1000:#1a1400;--yellow-a25:var(--yellow-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--yellow-a25:color-mix(in oklab, var(--yellow-400) 8%, transparent)}}:root,:where([data-theme]){--yellow-a50:var(--yellow-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--yellow-a50:color-mix(in oklab, var(--yellow-400) 15%, transparent)}}:root,:where([data-theme]){--yellow-a75:var(--yellow-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--yellow-a75:color-mix(in oklab, var(--yellow-400) 27%, transparent)}}:root,:where([data-theme]){--yellow-a100:var(--yellow-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--yellow-a100:color-mix(in oklab, var(--yellow-400) 45%, transparent)}}:root,:where([data-theme]){--yellow-a200:var(--yellow-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--yellow-a200:color-mix(in oklab, var(--yellow-400) 59%, transparent)}}:root,:where([data-theme]){--yellow-a300:var(--yellow-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--yellow-a300:color-mix(in oklab, var(--yellow-400) 74%, transparent)}}:root,:where([data-theme]){--purple-25:#f9f5fe;--purple-50:#efe5fe;--purple-75:#e0cefd;--purple-100:#ceb0fb;--purple-200:#be95fa;--purple-300:#ad7bf9;--purple-400:#924ff7;--purple-500:#8046d9;--purple-600:#6b3ab4;--purple-700:#532d8d;--purple-800:#3f226a;--purple-900:#2c184a;--purple-950:#160c25;--purple-1000:#100a19;--purple-a25:var(--purple-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--purple-a25:color-mix(in oklab, var(--purple-400) 6%, transparent)}}:root,:where([data-theme]){--purple-a50:var(--purple-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--purple-a50:color-mix(in oklab, var(--purple-400) 15%, transparent)}}:root,:where([data-theme]){--purple-a75:var(--purple-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--purple-a75:color-mix(in oklab, var(--purple-400) 28%, transparent)}}:root,:where([data-theme]){--purple-a100:var(--purple-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--purple-a100:color-mix(in oklab, var(--purple-400) 45%, transparent)}}:root,:where([data-theme]){--purple-a200:var(--purple-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--purple-a200:color-mix(in oklab, var(--purple-400) 60%, transparent)}}:root,:where([data-theme]){--purple-a300:var(--purple-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--purple-a300:color-mix(in oklab, var(--purple-400) 75%, transparent)}}:root,:where([data-theme]){--blue-25:#f5faff;--blue-50:#e5f3ff;--blue-75:#cce6ff;--blue-100:#99ceff;--blue-200:#66b5ff;--blue-300:#339cff;--blue-400:#0285ff;--blue-500:#0169cc;--blue-600:#004f99;--blue-700:#003f7a;--blue-800:#013566;--blue-900:#00284d;--blue-950:#000e1a;--blue-1000:#000d19;--blue-a25:var(--blue-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--blue-a25:color-mix(in oklab, var(--blue-400) 4%, transparent)}}:root,:where([data-theme]){--blue-a50:var(--blue-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--blue-a50:color-mix(in oklab, var(--blue-400) 13%, transparent)}}:root,:where([data-theme]){--blue-a75:var(--blue-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--blue-a75:color-mix(in oklab, var(--blue-400) 25%, transparent)}}:root,:where([data-theme]){--blue-a100:var(--blue-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--blue-a100:color-mix(in oklab, var(--blue-400) 40%, transparent)}}:root,:where([data-theme]){--blue-a200:var(--blue-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--blue-a200:color-mix(in oklab, var(--blue-400) 60%, transparent)}}:root,:where([data-theme]){--blue-a300:var(--blue-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--blue-a300:color-mix(in oklab, var(--blue-400) 80%, transparent)}}:root,:where([data-theme]){--hairline:1px}:where(:root),:where([data-theme=light]){--gray-0:#fff;--gray-25:#fcfcfc;--gray-50:#f9f9f9;--gray-75:#f3f3f3;--gray-100:#ededed;--gray-150:#dfdfdf;--gray-200:#cdcdcd;--gray-250:#b9b9b9;--gray-300:#afafaf;--gray-350:#9f9f9f;--gray-400:#8f8f8f;--gray-450:#767676;--gray-550:#4f4f4f;--gray-600:#414141;--gray-650:#393939;--gray-700:#303030;--gray-750:#282828;--gray-800:#212121;--gray-850:#1c1c1c;--gray-900:#181818;--gray-925:#161616;--gray-950:#131313;--gray-975:#101010;--gray-1000:#0d0d0d;--alpha-base:#0d0d0d}:where([data-theme=dark]){--gray-0:#0d0d0d;--gray-25:#101010;--gray-50:#131313;--gray-75:#161616;--gray-100:#181818;--gray-150:#1c1c1c;--gray-200:#212121;--gray-250:#282828;--gray-300:#303030;--gray-350:#393939;--gray-400:#414141;--gray-450:#4f4f4f;--gray-550:#767676;--gray-600:#8f8f8f;--gray-650:#9f9f9f;--gray-700:#afafaf;--gray-750:#b9b9b9;--gray-800:#cdcdcd;--gray-850:#dcdcdc;--gray-900:#ededed;--gray-925:#f3f3f3;--gray-950:#f3f3f3;--gray-975:#f9f9f9;--gray-1000:#fff;--alpha-base:#fff}@media (min-resolution:150dpi),(min-resolution:1.5x){:root,:where([data-theme]){--hairline:.5px}}:root,:where([data-theme]){--shadow-color:0 0 0;--elevation-100-geo:0 1px 2px -1px;--elevation-200-geo:0 2px 4px -1px;--elevation-300-geo:0 4px 8px -2px;--elevation-400-geo:0 8px 16px -4px}:where(:root),:where([data-theme=light]){--shadow-alpha-100:.08;--shadow-alpha-200:.08;--shadow-alpha-300:.1;--shadow-alpha-400:.12;--shadow-hairline-width:1px;--shadow-hairline-color:#00000014}@media (min-resolution:150dpi),(min-resolution:1.5x){:where(:root),:where([data-theme=light]){--shadow-hairline-width:.5px;--shadow-hairline-color:#0000001a}}:where([data-theme=dark]){--shadow-alpha-100:.2;--shadow-alpha-200:.2;--shadow-alpha-300:.36;--shadow-alpha-400:.3;--shadow-hairline-width:1px;--shadow-hairline-color:#ffffff1a}@media (min-resolution:150dpi),(min-resolution:1.5x){:where([data-theme=dark]){--shadow-hairline-width:.5px;--shadow-hairline-color:#ffffff1f}}:where([data-theme=dark]) [data-surface=elevated]{--shadow-hairline:0 0 #0000}:root,:where([data-theme]){--color-text:var(--gray-1000);--color-text-inverse:var(--gray-0);--color-text-primary:var(--color-text);--color-text-primary-soft:var(--color-text);--color-background-primary-soft-alt:var(--alpha-02);--color-border-primary-soft-alt:var(--alpha-06);--color-text-primary-soft-alt:var(--color-text);--color-text-primary-surface:var(--color-text);--color-text-primary-solid:var(--color-text-inverse);--color-text-primary-outline:var(--color-text);--color-text-primary-outline-hover:var(--color-text);--color-text-primary-ghost:var(--color-text);--color-text-primary-ghost-hover:var(--color-text);--color-ring-primary:var(--color-ring);--color-ring-primary-soft:var(--color-ring-primary);--color-ring-primary-solid:var(--color-ring-primary);--color-ring-primary-outline:var(--color-ring-primary);--color-ring-primary-ghost:var(--color-ring-primary);--color-text-secondary-soft:var(--color-text);--color-background-secondary-soft-alt:var(--alpha-02);--color-border-secondary-soft-alt:var(--alpha-06);--color-text-secondary-soft-alt:var(--color-text);--color-text-secondary-solid:var(--white);--color-text-secondary-outline:var(--color-text-secondary);--color-text-secondary-outline-hover:var(--color-text);--color-text-secondary-ghost:var(--color-text-secondary);--color-text-secondary-ghost-hover:var(--color-text);--color-ring-secondary:var(--color-ring);--color-ring-secondary-soft:var(--color-ring-secondary);--color-ring-secondary-solid:var(--color-ring-secondary);--color-ring-secondary-outline:var(--color-ring-secondary);--color-ring-secondary-ghost:var(--color-ring-secondary);--color-background-info-soft:var(--blue-50);--color-background-info-soft-hover:var(--blue-75);--color-background-info-soft-active:var(--blue-75);--color-background-info-soft-alpha:var(--blue-a50);--color-background-info-soft-alpha-hover:var(--blue-a75);--color-background-info-soft-alpha-active:var(--blue-a75);--color-background-info-solid:var(--blue-400);--color-background-info-solid-hover:var(--blue-500);--color-background-info-solid-active:var(--blue-500);--color-text-info-solid:var(--white);--color-background-info-outline-hover:var(--blue-a25);--color-background-info-outline-active:var(--blue-a25);--color-border-info-outline:var(--blue-500);--color-border-info-outline-hover:var(--blue-500);--color-text-info-outline:var(--blue-500);--color-text-info-outline-hover:var(--blue-500);--color-background-info-ghost-hover:var(--blue-a50);--color-background-info-ghost-active:var(--blue-a50);--color-ring-info:var(--color-ring);--color-ring-info-soft:var(--color-ring-info);--color-ring-info-solid:var(--color-ring-info);--color-ring-info-outline:var(--color-ring-info);--color-ring-info-ghost:var(--color-ring-info);--color-background-warning-soft:var(--orange-50);--color-background-warning-soft-hover:var(--orange-75);--color-background-warning-soft-active:var(--orange-75);--color-background-warning-soft-alpha:var(--orange-a50);--color-background-warning-soft-alpha-hover:var(--orange-a75);--color-background-warning-soft-alpha-active:var(--orange-a75);--color-background-warning-solid:var(--orange-500);--color-background-warning-solid-hover:var(--orange-600);--color-background-warning-solid-active:var(--orange-600);--color-text-warning-solid:var(--white);--color-background-warning-outline-hover:var(--orange-a25);--color-background-warning-outline-active:var(--orange-a25);--color-border-warning-outline:var(--orange-500);--color-border-warning-outline-hover:var(--orange-500);--color-text-warning-outline:var(--orange-500);--color-text-warning-outline-hover:var(--orange-500);--color-background-warning-ghost-hover:var(--orange-a50);--color-background-warning-ghost-active:var(--orange-a50);--color-text-warning-ghost:var(--orange-500);--color-text-warning-ghost-hover:var(--orange-500);--color-ring-warning:var(--color-ring);--color-ring-warning-soft:var(--color-ring-warning);--color-ring-warning-solid:var(--color-ring-warning);--color-ring-warning-outline:var(--color-ring-warning);--color-ring-warning-ghost:var(--color-ring-warning);--color-text-caution-hover:var(--yellow-800);--color-background-caution-soft:var(--yellow-50);--color-background-caution-soft-hover:var(--yellow-75);--color-background-caution-soft-active:var(--yellow-75);--color-background-caution-soft-alpha:var(--yellow-a50);--color-background-caution-soft-alpha-hover:var(--yellow-a75);--color-background-caution-soft-alpha-active:var(--yellow-a75);--color-background-caution-solid:var(--yellow-600);--color-background-caution-solid-hover:var(--yellow-700);--color-background-caution-solid-active:var(--yellow-700);--color-text-caution-solid:var(--white);--color-background-caution-outline-hover:var(--yellow-a25);--color-background-caution-outline-active:var(--yellow-a25);--color-border-caution-outline:var(--yellow-700);--color-border-caution-outline-hover:var(--yellow-700);--color-text-caution-outline:var(--yellow-700);--color-text-caution-outline-hover:var(--yellow-700);--color-background-caution-ghost-hover:var(--yellow-a50);--color-background-caution-ghost-active:var(--yellow-a50);--color-text-caution-ghost:var(--yellow-700);--color-text-caution-ghost-hover:var(--yellow-700);--color-ring-caution:var(--color-ring);--color-ring-caution-soft:var(--color-ring-caution);--color-ring-caution-solid:var(--color-ring-caution);--color-ring-caution-outline:var(--color-ring-caution);--color-ring-caution-ghost:var(--color-ring-caution);--color-background-danger-soft:var(--red-50);--color-background-danger-soft-hover:var(--red-75);--color-background-danger-soft-active:var(--red-75);--color-background-danger-soft-alpha:var(--red-a50);--color-background-danger-soft-alpha-hover:var(--red-a75);--color-background-danger-soft-alpha-active:var(--red-a75);--color-background-danger-solid:var(--red-500);--color-background-danger-solid-hover:var(--red-600);--color-background-danger-solid-active:var(--red-600);--color-text-danger-solid:var(--white);--color-background-danger-outline-hover:var(--red-a25);--color-background-danger-outline-active:var(--red-a25);--color-border-danger-outline:var(--red-500);--color-border-danger-outline-hover:var(--red-500);--color-text-danger-outline:var(--red-500);--color-text-danger-outline-hover:var(--red-500);--color-background-danger-ghost-hover:var(--red-a50);--color-background-danger-ghost-active:var(--red-a50);--color-text-danger-ghost:var(--red-500);--color-text-danger-ghost-hover:var(--red-500);--color-ring-danger:var(--red-200);--color-ring-danger-soft:var(--color-ring-danger);--color-ring-danger-solid:var(--color-ring-danger);--color-ring-danger-outline:var(--color-ring-danger);--color-ring-danger-ghost:var(--color-ring-danger);--color-background-success-soft:var(--green-50);--color-background-success-soft-hover:var(--green-75);--color-background-success-soft-active:var(--green-75);--color-background-success-soft-alpha:var(--green-a50);--color-background-success-soft-alpha-hover:var(--green-a75);--color-background-success-soft-alpha-active:var(--green-a75);--color-text-success-solid:var(--white);--color-background-success-outline-hover:var(--green-a25);--color-background-success-outline-active:var(--green-a25);--color-text-success-outline:var(--green-500);--color-text-success-outline-hover:var(--green-500);--color-background-success-ghost-hover:var(--green-a50);--color-background-success-ghost-active:var(--green-a50);--color-text-success-ghost:var(--green-500);--color-text-success-ghost-hover:var(--green-500);--color-ring-success:var(--color-ring);--color-ring-success-soft:var(--color-ring-info);--color-ring-success-solid:var(--color-ring-info);--color-ring-success-outline:var(--color-ring-info);--color-ring-success-ghost:var(--color-ring-info);--color-background-discovery-soft:var(--purple-50);--color-background-discovery-soft-hover:var(--purple-75);--color-background-discovery-soft-active:var(--purple-75);--color-background-discovery-soft-alpha:var(--purple-a50);--color-background-discovery-soft-alpha-hover:var(--purple-a75);--color-background-discovery-soft-alpha-active:var(--purple-a75);--color-background-discovery-solid:var(--purple-400);--color-background-discovery-solid-hover:var(--purple-500);--color-background-discovery-solid-active:var(--purple-500);--color-text-discovery-solid:var(--white);--color-background-discovery-outline-hover:var(--purple-a25);--color-background-discovery-outline-active:var(--purple-a25);--color-border-discovery-outline:var(--purple-500);--color-border-discovery-outline-hover:var(--purple-500);--color-background-discovery-ghost-hover:var(--purple-a50);--color-background-discovery-ghost-active:var(--purple-a50);--color-text-discovery-ghost:var(--purple-500);--color-text-discovery-ghost-hover:var(--purple-500);--color-ring-discovery:var(--color-ring);--color-ring-discovery-soft:var(--color-ring);--color-ring-discovery-solid:var(--color-ring);--color-ring-discovery-outline:var(--color-ring);--color-ring-discovery-ghost:var(--color-ring);--color-background-disabled:var(--alpha-05);--color-border-disabled:var(--alpha-06);--font-tracking-wide:0em;--font-tracking-normal:0em;--font-tracking-tight:0em;--font-heading-5xl-size:4.5rem;--font-heading-5xl-line-height:4.5rem;--font-heading-5xl-weight:var(--font-weight-semibold);--font-heading-5xl-tracking:var(--tracking-tight);--font-heading-4xl-size:3.75rem;--font-heading-4xl-line-height:3.75rem;--font-heading-4xl-weight:var(--font-weight-semibold);--font-heading-4xl-tracking:var(--tracking-tight);--font-heading-3xl-size:3rem;--font-heading-3xl-line-height:3rem;--font-heading-3xl-weight:var(--font-weight-semibold);--font-heading-3xl-tracking:var(--tracking-tight);--font-heading-2xl-size:2.25rem;--font-heading-2xl-line-height:2.625rem;--font-heading-2xl-weight:var(--font-weight-semibold);--font-heading-2xl-tracking:var(--tracking-tight);--font-heading-xl-size:2rem;--font-heading-xl-line-height:2.375rem;--font-heading-xl-weight:var(--font-weight-semibold);--font-heading-xl-tracking:var(--tracking-tight);--font-heading-lg-size:1.5rem;--font-heading-lg-line-height:1.75rem;--font-heading-lg-weight:var(--font-weight-semibold);--font-heading-lg-tracking:var(--tracking-normal);--font-heading-md-size:1.25rem;--font-heading-md-line-height:1.625rem;--font-heading-md-weight:var(--font-weight-semibold);--font-heading-md-tracking:var(--tracking-normal);--font-heading-sm-size:1.125rem;--font-heading-sm-line-height:1.625rem;--font-heading-sm-weight:var(--font-weight-semibold);--font-heading-sm-tracking:var(--tracking-normal);--font-heading-xs-size:1rem;--font-heading-xs-line-height:1.5rem;--font-heading-xs-weight:var(--font-weight-semibold);--font-heading-xs-tracking:var(--tracking-normal);--font-text-lg-size:1.125rem;--font-text-lg-line-height:1.8125rem;--font-text-lg-weight:var(--font-weight-normal);--font-text-lg-tracking:var(--tracking-normal);--font-text-md-size:1rem;--font-text-md-line-height:1.5rem;--font-text-md-weight:var(--font-weight-normal);--font-text-md-tracking:var(--tracking-normal);--font-text-sm-size:.875rem;--font-text-sm-line-height:1.25rem;--font-text-sm-weight:var(--font-weight-normal);--font-text-sm-tracking:var(--tracking-normal);--font-text-xs-size:.75rem;--font-text-xs-line-height:1.125rem;--font-text-xs-weight:var(--font-weight-normal);--font-text-xs-tracking:var(--tracking-wide);--font-text-2xs-size:.625rem;--font-text-2xs-line-height:.875rem;--font-text-2xs-weight:var(--font-weight-normal);--font-text-2xs-tracking:var(--tracking-wide);--font-text-3xs-size:.5rem;--font-text-3xs-line-height:.75rem;--font-text-3xs-weight:var(--font-weight-normal);--font-text-3xs-tracking:var(--tracking-wide);--control-size-3xs:1.375rem;--control-size-2xs:1.5rem;--control-size-xs:1.625rem;--control-size-sm:1.75rem;--control-size-md:2rem;--control-size-lg:2.25rem;--control-size-xl:2.5rem;--control-size-2xl:2.75rem;--control-size-3xl:3rem;--control-gutter-2xs:.375rem;--control-gutter-xs:.5rem;--control-gutter-sm:.625rem;--control-gutter-md:.75rem;--control-gutter-lg:.875rem;--control-gutter-xl:1rem;--control-gutter-pill-scaling:1.33;--control-radius-sm:var(--radius-sm);--control-radius-md:var(--radius-md);--control-radius-lg:var(--radius-lg);--control-radius-xl:var(--radius-xl);--control-font-size-sm:var(--font-text-xs-size);--control-font-size-md:var(--font-text-sm-size);--control-font-size-lg:var(--font-text-md-size);--control-icon-size-xs:.875rem;--control-icon-size-sm:1rem;--control-icon-size-md:1.125rem;--control-icon-size-lg:1.25rem;--control-icon-size-xl:1.375rem;--control-icon-size-2xl:1.5rem;--cubic-enter:cubic-bezier(.19, 1, .22, 1);--cubic-exit:cubic-bezier(.8, 0, .4, 1);--cubic-exit-snappy:cubic-bezier(.65, 0, .4, 1);--cubic-move:cubic-bezier(.65, 0, .35, 1);--transition-duration-basic:.15s;--transition-ease-basic:ease;--scrollbar-color:var(--alpha-30);--shadow-hairline:0 0 0 var(--shadow-hairline-width) var(--shadow-hairline-color);--shadow-100:var(--elevation-100-geo) rgb(var(--shadow-color) / var(--shadow-alpha-100));--shadow-100-strong:var(--elevation-100-geo) rgb(var(--shadow-color) / calc(var(--shadow-alpha-100) * 1.25));--shadow-100-stronger:var(--elevation-100-geo) rgb(var(--shadow-color) / calc(var(--shadow-alpha-100) * 1.6));--shadow-200:var(--elevation-200-geo) rgb(var(--shadow-color) / var(--shadow-alpha-200));--shadow-200-strong:var(--elevation-200-geo) rgb(var(--shadow-color) / calc(var(--shadow-alpha-200) * 1.25));--shadow-200-stronger:var(--elevation-200-geo) rgb(var(--shadow-color) / calc(var(--shadow-alpha-200) * 1.6));--shadow-300:var(--elevation-300-geo) rgb(var(--shadow-color) / var(--shadow-alpha-300));--shadow-300-strong:var(--elevation-300-geo) rgb(var(--shadow-color) / calc(var(--shadow-alpha-300) * 1.25));--shadow-300-stronger:var(--elevation-300-geo) rgb(var(--shadow-color) / calc(var(--shadow-alpha-300) * 1.6));--shadow-400:var(--elevation-400-geo) rgb(var(--shadow-color) / var(--shadow-alpha-400));--shadow-400-strong:var(--elevation-400-geo) rgb(var(--shadow-color) / calc(var(--shadow-alpha-400) * 1.25));--shadow-400-stronger:var(--elevation-400-geo) rgb(var(--shadow-color) / calc(var(--shadow-alpha-400) * 1.6))}:where(:root),:where([data-theme=light]){--color-text-secondary:var(--gray-500);--color-text-tertiary:var(--gray-400);--color-ring:var(--blue-500);--color-background-primary-soft:var(--gray-100);--color-background-primary-soft-hover:var(--gray-150);--color-background-primary-soft-active:var(--gray-200);--color-background-primary-soft-alpha:var(--alpha-08);--color-background-primary-soft-alpha-hover:var(--alpha-12);--color-background-primary-soft-alpha-active:var(--alpha-16);--color-background-primary-surface:var(--alpha-05);--color-border-primary-surface:var(--alpha-05);--color-background-primary-solid:var(--gray-900);--color-background-primary-solid-hover:var(--gray-700);--color-background-primary-solid-active:var(--gray-600);--color-background-primary-outline-hover:var(--alpha-02);--color-background-primary-outline-active:var(--alpha-04);--color-border-primary-outline:var(--alpha-16);--color-border-primary-outline-hover:var(--alpha-20);--color-background-primary-ghost-hover:var(--alpha-08);--color-background-primary-ghost-active:var(--alpha-12);--color-background-secondary-soft:var(--gray-100);--color-background-secondary-soft-hover:var(--gray-150);--color-background-secondary-soft-active:var(--gray-200);--color-background-secondary-soft-alpha:var(--alpha-08);--color-background-secondary-soft-alpha-hover:var(--alpha-12);--color-background-secondary-soft-alpha-active:var(--alpha-16);--color-background-secondary-solid:var(--gray-500);--color-background-secondary-solid-hover:var(--gray-600);--color-background-secondary-solid-active:var(--gray-700);--color-background-secondary-outline-hover:var(--alpha-02);--color-background-secondary-outline-active:var(--alpha-04);--color-border-secondary-outline:var(--alpha-16);--color-border-secondary-outline-hover:var(--alpha-20);--color-background-secondary-ghost-hover:var(--alpha-08);--color-background-secondary-ghost-active:var(--alpha-12);--color-text-info:var(--blue-500);--color-text-info-soft:var(--blue-600);--color-background-info-surface:var(--blue-a25);--color-border-info-surface:var(--blue-a25);--color-text-info-surface:var(--blue-600);--color-text-info-ghost:var(--blue-500);--color-text-info-ghost-hover:var(--blue-500);--color-text-warning:var(--orange-700);--color-text-warning-soft:var(--orange-700);--color-background-warning-surface:var(--orange-a25);--color-border-warning-surface:var(--orange-a25);--color-text-warning-surface:var(--orange-700);--color-text-caution:var(--yellow-700);--color-text-caution-soft:var(--yellow-800);--color-background-caution-surface:var(--yellow-a25);--color-border-caution-surface:var(--yellow-a25);--color-text-caution-surface:var(--yellow-800);--color-text-danger:var(--red-700);--color-text-danger-soft:var(--red-600);--color-background-danger-surface:var(--red-a25);--color-border-danger-surface:var(--red-a25);--color-text-danger-surface:var(--red-600);--color-text-success:var(--green-700);--color-text-success-soft:var(--green-600);--color-background-success-surface:var(--green-a25);--color-border-success-surface:var(--green-a25);--color-text-success-surface:var(--green-600);--color-background-success-solid:var(--green-500);--color-background-success-solid-hover:var(--green-500);--color-background-success-solid-active:var(--green-500);--color-border-success-outline:var(--green-500);--color-border-success-outline-hover:var(--green-500);--color-text-discovery:var(--purple-700);--color-text-discovery-soft:var(--purple-600);--color-background-discovery-surface:var(--purple-a25);--color-border-discovery-surface:var(--purple-a25);--color-text-discovery-surface:var(--purple-600);--color-text-discovery-outline:var(--purple-500);--color-text-discovery-outline-hover:var(--purple-500);--color-text-disabled:var(--gray-400);--color-border-subtle:var(--alpha-05);--color-border:var(--alpha-10);--color-border-strong:var(--alpha-15);--shadow:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--color-surface:var(--gray-0);--color-surface-secondary:var(--gray-50);--color-surface-tertiary:var(--gray-75);--color-surface-elevated:var(--gray-0);--color-surface-elevated-secondary:var(--gray-50)}:where([data-theme=dark]){--color-text-secondary:var(--gray-700);--color-text-tertiary:var(--gray-600);--color-ring:var(--blue-400);--color-background-primary-soft:var(--gray-300);--color-background-primary-soft-hover:var(--gray-350);--color-background-primary-soft-active:var(--gray-400);--color-background-primary-soft-alpha:var(--alpha-12);--color-background-primary-soft-alpha-hover:var(--alpha-16);--color-background-primary-soft-alpha-active:var(--alpha-20);--color-background-primary-surface:var(--alpha-08);--color-border-primary-surface:var(--alpha-08);--color-background-primary-solid:var(--gray-950);--color-background-primary-solid-hover:var(--gray-900);--color-background-primary-solid-active:var(--gray-850);--color-background-primary-outline-hover:var(--alpha-04);--color-background-primary-outline-active:var(--alpha-06);--color-border-primary-outline:var(--alpha-25);--color-border-primary-outline-hover:var(--alpha-30);--color-background-primary-ghost-hover:var(--alpha-12);--color-background-primary-ghost-active:var(--alpha-16);--color-background-secondary-soft:var(--gray-300);--color-background-secondary-soft-hover:var(--gray-350);--color-background-secondary-soft-active:var(--gray-400);--color-background-secondary-soft-alpha:var(--alpha-12);--color-background-secondary-soft-alpha-hover:var(--alpha-16);--color-background-secondary-soft-alpha-active:var(--alpha-20);--color-background-secondary-solid:var(--gray-400);--color-background-secondary-solid-hover:var(--gray-450);--color-background-secondary-solid-active:var(--gray-500);--color-background-secondary-outline-hover:var(--alpha-04);--color-background-secondary-outline-active:var(--alpha-06);--color-border-secondary-outline:var(--alpha-25);--color-border-secondary-outline-hover:var(--alpha-30);--color-background-secondary-ghost-hover:var(--alpha-12);--color-background-secondary-ghost-active:var(--alpha-16);--color-text-info:var(--blue-200);--color-text-info-soft:var(--blue-300);--color-background-info-surface:var(--blue-a50);--color-border-info-surface:var(--blue-a50);--color-text-info-surface:var(--blue-300);--color-text-info-ghost:var(--blue-200);--color-text-info-ghost-hover:var(--blue-200);--color-text-warning:var(--orange-500);--color-text-warning-soft:var(--orange-400);--color-background-warning-surface:var(--orange-a50);--color-border-warning-surface:var(--orange-a50);--color-text-warning-surface:var(--orange-400);--color-text-caution:var(--yellow-500);--color-text-caution-soft:var(--yellow-400);--color-background-caution-surface:var(--yellow-a50);--color-border-caution-surface:var(--yellow-a50);--color-text-caution-surface:var(--yellow-400);--color-text-danger:var(--red-500);--color-text-danger-soft:var(--red-400);--color-background-danger-surface:var(--red-a50);--color-border-danger-surface:var(--red-a50);--color-text-danger-surface:var(--red-400);--color-text-success:var(--green-400);--color-text-success-soft:var(--green-400);--color-background-success-surface:var(--green-a50);--color-border-success-surface:var(--green-a50);--color-text-success-surface:var(--green-400);--color-background-success-solid:var(--green-600);--color-background-success-solid-hover:var(--green-600);--color-background-success-solid-active:var(--green-600);--color-border-success-outline:var(--green-600);--color-border-success-outline-hover:var(--green-600);--color-text-discovery:var(--purple-500);--color-text-discovery-soft:var(--purple-200);--color-background-discovery-surface:var(--purple-a50);--color-border-discovery-surface:var(--purple-a50);--color-text-discovery-surface:var(--purple-200);--color-text-discovery-outline:var(--purple-400);--color-text-discovery-outline-hover:var(--purple-400);--color-text-disabled:var(--gray-500);--color-border-subtle:var(--alpha-06);--color-border:var(--alpha-12);--color-border-strong:var(--alpha-20);--shadow:0 10px 15px -3px #0003, 0 4px 6px -4px #0003;--color-surface:var(--gray-200);--color-surface-secondary:var(--gray-100);--color-surface-tertiary:var(--gray-50);--color-surface-elevated:var(--gray-300);--color-surface-elevated-secondary:var(--gray-400)}:root,:where([data-theme]){--alert-border-radius:var(--radius-xl);--alert-gap:calc(var(--spacing) * 3);--alert-gutter:calc(var(--spacing) * 4);--alert-font-size:var(--font-text-sm-size);--alert-line-height:var(--font-text-sm-line-height);--alert-title-font-weight:var(--font-weight-semibold);--avatar-radius:var(--radius-full);--avatar-size:28px;--avatar-font-size-scaling:.5;--avatar-overflow-font-size-scaling-one:.45;--avatar-overflow-font-size-scaling-two:.37;--avatar-overflow-font-size-scaling-three:.3;--avatar-group-cutout-width:3px;--avatar-group-cutout-color:var(--color-surface);--avatar-group-spacing:-8px;--badge-gutter-sm:calc(var(--control-gutter-2xs) - 1px);--badge-gutter-md:var(--control-gutter-2xs);--badge-gutter-lg:var(--control-gutter-xs);--badge-size-sm:calc(var(--control-size-3xs) - 2px);--badge-size-md:var(--control-size-3xs);--badge-size-lg:var(--control-size-2xs);--badge-radius-sm:var(--radius-xs);--badge-radius-md:var(--radius-xs);--badge-radius-lg:var(--radius-sm);--badge-font-size-sm:var(--font-text-xs-size);--badge-font-size-md:var(--font-text-sm-size);--badge-font-size-lg:var(--font-text-sm-size);--badge-tracking-sm:var(--tracking-wide);--badge-tracking-md:var(--tracking-normal);--badge-tracking-lg:var(--tracking-normal);--badge-font-weight-sm:var(--font-weight-semibold);--badge-font-weight-md:var(--font-weight-semibold);--badge-font-weight-lg:var(--font-weight-semibold);--badge-icon-font-size-sm:var(--font-text-xs-size);--badge-icon-font-size-md:var(--font-text-md-size);--badge-icon-font-size-lg:var(--font-text-md-size);--badge-indicator-size-sm:var(--font-text-xs-size);--badge-indicator-size-md:var(--font-text-xs-size);--badge-indicator-size-lg:var(--font-text-sm-size);--button-gap-sm:3px;--button-gap-md:4px;--button-gap-lg:6px;--button-font-weight:var(--font-weight-medium);--input-gap-xs:4px;--input-gap-sm:6px;--input-gap-md:8px;--input-gap-lg:10px;--input-text-color:var(--color-text);--input-placeholder-text-color:var(--color-text-tertiary);--input-outline-border-color:var(--color-border-primary-outline);--input-outline-border-color-focus:var(--alpha-50);--input-soft-background-color:var(--color-background-primary-soft-alpha);--input-soft-border-color-focus:var(--alpha-20);--link-font-weight:inherit;--link-gap:calc(var(--spacing) * .5);--link-radius:var(--radius-sm);--link-underline-decoration-offset:.1em;--chat-max-width:800px;--chat-gutter:calc(var(--spacing) * 5);--chat-background-color:var(--color-surface);--thread-gutter:calc(var(--spacing) * 4);--composer-gutter:calc(var(--spacing) * 3);--composer-compact-gutter:calc(var(--spacing) * 2);--composer-radius:var(--radius-4xl);--composer-background-color:var(--color-surface-elevated);--smoothing-background-color:var(--color-surface);--user-message-text-color:var(--color-text);--source-list-gutter:var(--thread-gutter);--codeblock-background-color:var(--gray-25);--codeblock-syntax-4:var(--pink-500);--dialog-min-width:250px;--dialog-max-width:450px;--dialog-container-inner-padding:calc(var(--spacing) * 5);--dialog-backdrop-fade-background:var(--color-surface-elevated)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--dialog-backdrop-fade-background:color-mix(in oklab, var(--color-surface-elevated) 60%, transparent)}}:root,:where([data-theme]){--menu-gutter:calc(var(--spacing) * 1.5);--menu-radius:var(--radius-xl);--menu-font-size:var(--font-text-sm-size);--menu-line-height:var(--font-text-sm-line-height);--menu-item-padding:calc(var(--spacing) * 1.5) calc(var(--spacing) * 2);--menu-item-gap:calc(var(--spacing) * 1.5);--menu-separator-gutter:var(--menu-gutter) calc(-1 * var(--menu-gutter));--menu-separator-background-color:var(--color-border);--menu-radio-indicator-size:var(--font-text-lg-size);--menu-radio-indicator-hole-size:var(--font-text-3xs-size);--menu-checkbox-indicator-size:var(--font-text-lg-size);--modal-container-inner-padding:calc(var(--spacing) * 5);--popover-radius:var(--radius-xl);--radio-group-col-gap:calc(var(--spacing) * 2.5);--radio-group-row-gap:calc(var(--spacing) * 5);--radio-group-item-gap:calc(var(--spacing) * 1.5);--radio-group-item-font-size:var(--font-text-sm-size);--radio-group-item-line-height:var(--font-text-sm-line-height);--radio-group-indicator-size:var(--font-text-md-size);--radio-group-indicator-border-color:var(--color-border-primary-outline);--radio-group-indicator-border-color-hover:var(--alpha-25);--radio-group-indicator-background-color:var(--color-background-primary-solid);--radio-group-indicator-hole-size:.375rem;--radio-group-indicator-hole-background-color:var(--color-text-primary-solid);--segmented-control-gap:2px;--segmented-control-gutter:2px;--segmented-control-font-weight:var(--font-weight-semibold);--segmented-control-thumb-shadow:0 1px 4px -1px #0003;--segmented-control-option-highlight-gutter:1px;--select-control-font-weight:var(--font-weight-medium);--switch-track-width:32px;--switch-track-height:19px;--switch-thumb-offset:3px;--switch-thumb-size:calc(var(--switch-track-height) - 2 * var(--switch-thumb-offset));--switch-thumb-shadow:0 1px 2px #0003;--switch-label-gap:calc(var(--spacing) * 2)}:where(:root),:where([data-theme=light]){--avatar-image-border-color:var(--alpha-04);--input-outline-border-color-hover:var(--alpha-25);--input-border-color-invalid:var(--red-500);--link-primary-text-color:var(--blue-500);--link-primary-text-color-hover:var(--blue-800);--user-message-background-color:var(--alpha-05);--codeblock-syntax-1:#c0660d;--codeblock-syntax-2:var(--blue-500);--codeblock-syntax-3:var(--green-600);--codeblock-syntax-5:var(--purple-500);--dialog-backdrop-dim-background:#0000004d;--menu-item-background-color:var(--alpha-08);--modal-backdrop-background:#0000004d;--segmented-control-background:var(--gray-100);--segmented-control-thumb-background:var(--gray-0);--segmented-control-option-highlight-background-color:var(--gray-200);--slider-track-color:var(--gray-150);--slider-range-color:var(--gray-450);--switch-track-color:var(--gray-150);--switch-track-color-hover:var(--gray-200);--switch-track-color-checked:var(--gray-900);--switch-track-color-checked-disabled:var(--gray-300);--switch-track-color-disabled:var(--gray-100);--switch-thumb-color:var(--gray-0);--switch-thumb-color-disabled:var(--gray-0)}:where([data-theme=dark]){--avatar-image-border-color:var(--alpha-15);--input-outline-border-color-hover:var(--alpha-30);--input-border-color-invalid:var(--red-600);--link-primary-text-color:var(--blue-300);--link-primary-text-color-hover:var(--blue-400);--user-message-background-color:var(--alpha-08);--codeblock-syntax-1:var(--yellow-100);--codeblock-syntax-2:var(--blue-200);--codeblock-syntax-3:var(--green-300);--codeblock-syntax-5:var(--purple-300);--dialog-backdrop-dim-background:#00000080;--menu-item-background-color:var(--alpha-10);--modal-backdrop-background:#00000080;--segmented-control-background:var(--gray-0);--segmented-control-thumb-background:var(--gray-300);--segmented-control-option-highlight-background-color:var(--gray-300);--slider-track-color:var(--gray-400);--slider-range-color:var(--gray-600);--switch-track-color:var(--gray-400);--switch-track-color-hover:var(--gray-450);--switch-track-color-checked:var(--blue-400);--switch-track-color-checked-disabled:var(--blue-700);--switch-track-color-disabled:var(--gray-300);--switch-thumb-color:var(--gray-1000);--switch-thumb-color-disabled:var(--gray-800)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}html,:host{font-synthesis-weight:none}textarea{resize:none}img,svg{flex-grow:0;flex-shrink:0}input,textarea,select,optgroup{-webkit-appearance:none;-moz-appearance:none;appearance:none;box-shadow:none;filter:none;outline-offset:0;outline-width:2px}a,button,input,label,select,textarea,:where([aria-role=button]){touch-action:manipulation}button{text-transform:none;vertical-align:middle}button:not(:disabled),[role=button]:not(:disabled){cursor:pointer}pre{white-space:pre-wrap}table{border-spacing:0}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}html,:host{color:var(--color-text);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;letter-spacing:var(--tracking-normal)}[data-theme=light]{color-scheme:light}[data-theme=dark]{color-scheme:dark}*{scrollbar-color:var(--scrollbar-color) transparent;scrollbar-width:thin}[data-exiting]{pointer-events:none}::placeholder{color:var(--color-text-tertiary)}b,strong{font-weight:var(--font-weight-semibold)}@font-face{font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(https://cdn.openai.com/common/fonts/katex/KaTeX_AMS-Regular.woff2)format("woff2")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(https://cdn.openai.com/common/fonts/katex/KaTeX_Caligraphic-Bold.woff2)format("woff2")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(https://cdn.openai.com/common/fonts/katex/KaTeX_Caligraphic-Regular.woff2)format("woff2")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(https://cdn.openai.com/common/fonts/katex/KaTeX_Fraktur-Bold.woff2)format("woff2")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(https://cdn.openai.com/common/fonts/katex/KaTeX_Fraktur-Regular.woff2)format("woff2")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(https://cdn.openai.com/common/fonts/katex/KaTeX_Main-Bold.woff2)format("woff2")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(https://cdn.openai.com/common/fonts/katex/KaTeX_Main-BoldItalic.woff2)format("woff2")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(https://cdn.openai.com/common/fonts/katex/KaTeX_Main-Italic.woff2)format("woff2")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(https://cdn.openai.com/common/fonts/katex/KaTeX_Main-Regular.woff2)format("woff2")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(https://cdn.openai.com/common/fonts/katex/KaTeX_Math-BoldItalic.woff2)format("woff2")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(https://cdn.openai.com/common/fonts/katex/KaTeX_Math-Italic.woff2)format("woff2")}@font-face{font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(https://cdn.openai.com/common/fonts/katex/KaTeX_SansSerif-Bold.woff2)format("woff2")}@font-face{font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(https://cdn.openai.com/common/fonts/katex/KaTeX_SansSerif-Italic.woff2)format("woff2")}@font-face{font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(https://cdn.openai.com/common/fonts/katex/KaTeX_SansSerif-Regular.woff2)format("woff2")}@font-face{font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(https://cdn.openai.com/common/fonts/katex/KaTeX_Script-Regular.woff2)format("woff2")}@font-face{font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(https://cdn.openai.com/common/fonts/katex/KaTeX_Size1-Regular.woff2)format("woff2")}@font-face{font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(https://cdn.openai.com/common/fonts/katex/KaTeX_Size2-Regular.woff2)format("woff2")}@font-face{font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(https://cdn.openai.com/common/fonts/katex/KaTeX_Size3-Regular.woff2)format("woff2")}@font-face{font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(https://cdn.openai.com/common/fonts/katex/KaTeX_Size4-Regular.woff2)format("woff2")}@font-face{font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(https://cdn.openai.com/common/fonts/katex/KaTeX_Typewriter-Regular.woff2)format("woff2")}.katex{text-indent:0;text-rendering:auto;font:1.21em/1.2 KaTeX_Main,Times New Roman,serif}.katex *{border-color:currentColor;-ms-high-contrast-adjust:none!important}.katex .katex-version:after{content:"0.16.0"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;width:1px;height:1px;padding:0;position:absolute;overflow:hidden}.katex .katex-html>.newline{display:block}.katex .base{white-space:nowrap;width:min-content;position:relative}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;table-layout:fixed;display:inline-table}.katex .vlist-r{display:table-row}.katex .vlist{vertical-align:bottom;display:table-cell;position:relative}.katex .vlist>span{height:0;display:block;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{width:0;overflow:hidden}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{vertical-align:bottom;width:2px;min-width:2px;font-size:1px;display:table-cell}.katex .vbox{flex-direction:column;align-items:baseline;display:inline-flex}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{flex-direction:row;display:inline-flex}.katex .thinbox{width:0;max-width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;width:100%;display:inline-block}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{width:0;position:relative}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;width:100%;display:inline-block}.katex .hdashline{border-bottom-style:dashed;width:100%;display:inline-block}.katex .sqrt>.root{margin-left:.277778em;margin-right:-.555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.833333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.16667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.33333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.66667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.45667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.14667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.714286em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.857143em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.14286em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.28571em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.42857em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.71429em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.05714em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.46857em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.96286em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.55429em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.11111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.33333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.30444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.76444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.416667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.583333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.833333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.72833em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.07333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.347222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.416667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.486111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.694444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.833333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.44028em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.72778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.289352em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.347222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.405093em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.520833em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.578704em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.694444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.833333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.20023em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.43981em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.24108em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.289296em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.385728em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.433944em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.48216em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.578592em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.694311em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.833173em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.19961em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.200965em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.241158em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.281351em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.321543em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.361736em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.401929em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.482315em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.694534em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.833601em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{width:.12em;display:inline-block}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{min-width:1px;display:inline-block}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{width:100%;height:inherit;fill:currentColor;fill-opacity:1;fill-rule:nonzero;stroke:currentColor;stroke-dasharray:none;stroke-dashoffset:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-width:1px;display:block;position:absolute}.katex svg path{stroke:none}.katex img{border-style:none;min-width:0;max-width:none;min-height:0;max-height:none}.katex .stretchy{width:100%;display:block;position:relative;overflow:hidden}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{width:100%;position:relative;overflow:hidden}.katex .halfarrow-left{width:50.2%;position:absolute;left:0;overflow:hidden}.katex .halfarrow-right{width:50.2%;position:absolute;right:0;overflow:hidden}.katex .brace-left{width:25.1%;position:absolute;left:0;overflow:hidden}.katex .brace-center{width:50%;position:absolute;left:25%;overflow:hidden}.katex .brace-right{width:25.1%;position:absolute;right:0;overflow:hidden}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{box-sizing:border-box;border:.04em solid}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{box-sizing:border-box;border-top:.049em solid;border-right:.049em solid;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{text-align:left;display:inline-block;position:absolute;right:calc(50% + .3em)}.katex .cd-label-right{text-align:right;display:inline-block;position:absolute;left:calc(50% + .3em)}.katex-display{text-align:center;margin:1em 0;display:block}.katex-display>.katex{text-align:center;white-space:nowrap;display:block}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{text-align:left;padding-left:2em}body{counter-reset:katexEqnNo mmlEqnNo}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.bottom-0{bottom:0}.left-0{left:0}.isolate{isolation:isolate}.container{width:100%}@media (min-width:380px){.container{max-width:380px}}@media (min-width:576px){.container{max-width:576px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.mx-px{margin-inline:1px}.mt-1{margin-top:var(--spacing)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mb-1{margin-bottom:var(--spacing)}.\\!hidden{display:none!important}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.table{display:table}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.h-0{height:0}.h-\\[var\\(--button-icon-size\\)\\]{height:var(--button-icon-size)}.w-\\[var\\(--button-icon-size\\)\\]{width:var(--button-icon-size)}.w-full{width:100%}.max-w-sm{max-width:var(--container-sm)}.min-w-\\[120px\\]{min-width:120px}.flex-1{flex:1}.flex-shrink,.shrink{flex-shrink:1}.grow{flex-grow:1}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.resize{resize:both}.grid-cols-\\[auto_1fr\\]{grid-template-columns:auto 1fr}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-sm{border-radius:var(--radius-sm)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-default{border-color:var(--color-border)}.border-subtle{border-color:var(--color-border-subtle)}.bg-surface{background-color:var(--color-surface)}.fill-secondary{fill:var(--color-text-secondary)}.p-4{padding:calc(var(--spacing) * 4)}.pt-4{padding-top:calc(var(--spacing) * 4)}.text-center{text-align:center}.text-right{text-align:right}.heading-lg{font-size:var(--font-heading-lg-size);font-weight:var(--font-heading-lg-weight);letter-spacing:var(--font-heading-lg-tracking);line-height:var(--font-heading-lg-line-height)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));letter-spacing:var(--tw-tracking,var(--text-sm--letter-spacing));font-weight:var(--tw-font-weight,var(--text-sm--font-weight))}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.text-wrap{text-wrap:wrap}.text-ellipsis{text-overflow:ellipsis}.text-secondary{color:var(--color-text-secondary)}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.shadow-lg{--tw-shadow:var(--shadow-300);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media (min-width:576px){.sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}}@font-face{font-family:Byte Sans;src:url(data:font/ttf;base64,AAEAAAASAQAABAAgRFNJRwAAAAEAAGYYAAAACEdERUYArgCgAAABLAAAACJHUE9TC0cL/AAAAVAAAAdGR1NVQlhYLa0AAAiYAAAA4E9TLzJolGcCAAAJeAAAAGBjbWFwX62n7AAACdgAAAHAY3Z0IAvjAvoAAFckAAAANGZwZ22eNhHKAABXWAAADhVnYXNwAAAAEAAAVxwAAAAIZ2x5ZvX2ACkAAAuYAABCnGhlYWQcLIvhAABONAAAADZoaGVhCI8EtwAATmwAAAAkaG10eDyNHJYAAE6QAAACLGxvY2FvbIFoAABQvAAAARhtYXhwAoYPDQAAUdQAAAAgbmFtZT5DSWYAAFH0AAADf3Bvc3R/ZzrDAABVdAAAAaVwcmVwaEbInAAAZXAAAACnAAEAAAAMAAAAAAAAAAIAAwAvAC8ABAA0ADQABAA2ADYAAgAAAAEAAAAKAB4ALgABREZMVAAIAAQAAAAA//8AAQAAAAFrZXJuAAgAAAACAAAAAQACAAYADgACAAgAAQAUAAIACAADAEYGHAY8AAEGYAAEAAAABQAUABoAJAAqADQAAQB5/+wAAgAV/+wAef/iAAEAef/xAAIAFf/xAHn/4gABAHkAAAABBjAABAAAACcAWABiAGgAqgDkAVoBpAHmAhgCcgKYAr4C5AL+AygDLgNEA2oDdAOKA7QDugPcBAIELARWBGgEngS8BMoE3AUKBTQFegWoBbYFxAXKBdAAAgA0/+IANv/iAAEAEwAAABAAHP/EAB7/xAAf/8QAIP/EACH/zgAi/8QAJf+wACr/xAAs/8QALv/YAC//zgAw/9gAMf/EADMAAAA0/8QANv/EAA4AFf+mABz/2AAe/9gAH//YACD/2AAi/9gAJf+6ACr/2AAs/9gAL//YADD/2AAx/9gANP/YADb/2AAdABQAAAAc/7UAHQAAAB7/tQAf/7UAIP+1ACEAAAAi/7UAIwAAACQAAAAl/7UAKP/sACn/7AAq/7UAKwAAACz/tQAt/+wALv/YADD/2AAx/+wAM//YADT/2AA1/+wANv/YADv/7AA9/+wAQv/sAEP/7ABZ/+wAEgAC/6EABP/sAAj/7AAL/9gAEP/iABL/4gAU/+wAHP+6AB7/vwAf/78AIP+/ACL/vwAl/8QAKv+3ACsAAAAs/8QALv/sADD/7AAQAAL/xAAE/+wACP/YAAv/xAAQ/9gAEv/YABT/2AAc/9gAHQAAAB7/2AAf/9gAIP/YACL/2AAl/84AKv/YACz/2AAMABz/zgAe/84AH//OACD/zgAi/84AJf/OACr/zgAs/84ALv/YADD/7AA0/+wANv/sABYAHP+mAB3/4gAe/6YAH/+mACD/pgAi/6YAI//iACX/sAAm/+wAKP/iACn/4gAq/6YAK//iACz/pgAt/+wALv/EAC//4gAw/8QAM//iADT/7AA1/+IANv/OAAkADAAAABUAAAAXAAAAGAAAABkAAAAa/+IAJf+wADMAAAA0AAAACQAV/7oAF/+/ABj/2AAZ/84AGv+mACX/sAAx/+IAM//YADT/2AAJABX/ugAX/78AGP/YABn/zgAa/6YAJf+wADH/9gAz/+wANP/YAAYAFQAAABgAAAAa/+IAIgAAACX/vwAzAAAACgAV/7oAF/+/ABj/2AAZ/84AGv+mACX/sAAm/+wAMf/2ADP/2AA0/9gAAQAl/7oABQAVAAAAGQAAABr/4gAl/9gAMwAAAAkAFf/EABf/7AAY//YAGf/YABr/zgAl/7AAMf/2ADP/7AA0/+IAAgAVAAAAJf+mAAUAGAAAABr/7AAl/+IALQAAADMAAAAKABr/zgAc/9gAHv/YAB//2AAg/9gAIv/YACX/ugAq/9gALP/YAC7/7AABACX/sAAIABX/ugAX/+wAGf/sABr/xAAl/7AAMf/2ADP/4gA0/+IACQAV/84AF//sABn/7AAa/8QAIgAAACX/sAAx//YAM//nADT/4gAKABX/vwAX/78AGP/YABn/zgAa/6YAJf+wACb/7AAx/+IAM//OADT/7AAKABX/ugAX/7oAGP/YABn/zgAa/6YAJf+wACb/7AAx/+IAM//YADT/7AAEABUAAAAa/+IAJf/iADMAAAANABn/7AAa/+wAHP/YAB7/2AAf/9gAIP/YACL/2AAl/7oAKv/YACz/2AAu//EAMQAAADMAAAAHABX/2AAX/+wAGf/YABr/xAAl/7oAMwAAADT/4gADABr/4gAl/84AMwAAAAQAFf/YABcAAAAa/8QAJf+6AAsAFf/sABr/4gAc/+IAHv/iAB//4gAg/+IAIv/iACMAAAAl/7oAKv/iACz/4gAKABX/7AAa/+IAHP/iAB7/4gAf/+IAIP/iACL/2AAl/8QAKv/iACz/4gARABX/2AAa/+IAHP/YAB0AAAAe/9gAH//YACD/2AAi/9gAIwAAACX/xAAoAAAAKv/OACsAAAAs/9gALgAAAC8AAAAw/+IACwAV/9gAGv/OABz/2AAe/9gAH//YACD/3QAi/9gAJf/EACr/2AAs/9gAMP/2AAMAFf/sABr/4gAl/7oAAwAV/9gAGv/OACX/ugABABX/7AABABX/7AABABX/7AACAI4ABAAAAK4AxAAEAAIAAP/EAAD/2AAA/+wAAP/iAAIAegAEAAAArACkAAgAAgAA/+IAAP/iAAD/4gAA/+wAAP/sAAD/7AAA/+IAAP/iAAIAAQA6AD4AAAACAAgAAwADAAAACAAIAAEADAANAAIAFQAVAAQAFwAaAAUAHAA2AAkAQgBDACQAWQBZACYAAQAEAAwADQAVABoAAQAIAB0AHgAgACMAKAApACoAKwACAAMADQANAAEAFQAVAAIAGgAaAAMAAQAyAAEAAQABAB4ADgABAAAAAgAAAAAAAwAAAAAAAAAAAAQABQAGAAcAAAABAAAACgAmAGQAAURGTFQACAAEAAAAAP//AAUAAAABAAIAAwAEAAVhYWx0ACBkbGlnACZmd2lkACxzYWx0ADJzczAxADgAAAABAAAAAAABAAEAAAABAAIAAAABAAMAAAABAAQABQAMABQAHAAkACwAAQAAAAEATAAEAAgAAQAgAAEAAAABACoAAQAAAAEAKAABAAAAAQAmAAEALgABAAgAAQAEADYAAgAvAAEAIgAKAAEAIgAOAAEAHAAOAAIAHAACAFIAUQABAAEANAABAAEARwABAAEARAABAAIARABHAAMCRwH0AAUACAKKAlgAAABLAooCWAAAAV4AMgE+AAAAAAYAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFVLV04AQAAg/wEC+P8QAMgDwADwAAAAAQAAAAACEgK8AAAAIAACAAAAAgAAAAMAAAAUAAMAAQAAABQABAGsAAAATgBAAAUADgAhACYALwA5AEAAWgBfAHoAewB+AKMApQCnAKkArgCxALcAvwDXAPcgFCAaIB4gIiAmIDAgOiBEIKwhIiGUIZkiEiIeIkgiYCJl/wH//wAAACAAIwAoADAAOgBBAFsAYQB7AH0AoQClAKcAqQCuALAAtwC/ANcA9yATIBggHCAiICYgMCA5IEQgrCEiIZAhliISIh4iSCJgImT/Af//AAAAAAAAAAcAAP/BAAD/u//aAAAAAP/E/9//3v/aAAD/lP+L/5X/duBHAAAAAOAq4CDgSuAq3/3fu99nAAAAAN5Z3lreLd4PAAABUAABAE4AUABWAAAAYgAAAGwAAAAAAHAAcgAAAAAAAAAAAG4AAAAAAAAAAAAAAGYAagAAAAAAAAAAAAAAAAAAAGAAaAAAAAAAAAAAAGYAAAAAAAEARwBOAGYAeQCFAFMAVABNAGoAQwBZAEIATwBEAEUAcQBuAHAASQCEAFcAUABYAHcAXABWAHYASABlAGgAigB0AGEAYgBdAF8AYABeAIEAewB9AH8AgwCCAHwAfgCAAHMAcgAKAF3/EAGaAvgAAwAPABUAGQAjACkANQA5AD0ASAD6QPdBASEBSwAWGBUVFnIAASQBBwIBB2cGAQIFAQMEAgNnAAQlAQoMBApnAAwLAQkIDAlnAAgmARENCBFnJwEUDg0UVxABDQAODw0OZwAPABITDxJnABMoGgIYFhMYZwAVABcZFRdoABkpARweGRxnAB4AHRseHWcAGyoBIx8bI2ciAR8AISAfIWcAIAAAIFcAICAAXwAAIABPPj42NioqJCQaGhAQBAQ+SD5IR0ZFRENCQD89PDs6Njk2OTg3KjUqNTQzMjEwLy4tLCskKSQpKCcmJRojGiMiISAfHh0cGxkYFxYQFRAVFBMSEQQPBA8REREREhEQKwYdKwUhESEHFTMVIxUzNSM1MzUHFTM1IzUHIzUzBxUzFSMVMzUzNQcVIxUzNQcVMzUzFSM1IxUzNQcVMzUHIzUzBxUzBxUzNSM3MzUBmv7DAT3yQUKmQkKmpkIiISFCQkJkQiGFpmQiIWQhpqamIWRkhUZGpmZGIPAD6EMhJSEhJSGBaCJGRiRhISUhRiE8QiJkejgXL1Bxca1xcVAvZyEvISEvIQACAB4AAAKwArwABwAKACxAKQoBBAIBTAAEAAABBABoAAICDk0FAwIBAQ8BTgAACQgABwAHERERBgcZKyEnIQcjATMBATMDAj9C/tRBcgEXYQEa/kbhcaysArz9RAENASUAAAAAAwBBAAACcQK8AA4AFwAgAERAQQYBBAMBTAcBAwAEBQMEZwACAgBfBgEAAA5NCAEFBQFfAAEBDwFOGBgPDwEAGCAYHx4cDxcPFhUTDQsADgEOCQcWKwEyFhUUBgcWFhUUBiMhEQA2NTQmIyMVMxI2NTQmIyMVMwGCY3MyKzo8dmj+rgFvPj0009FFQkU03+ECvGNUM1MWFls8VmYCvP7UNS0wOMr+0zgxLzfPAAEALf/xArUCygAdAC5AKxoZCwoEAgEBTAABAQBhAAAAFE0AAgIDYQQBAwMVA04AAAAdABwmJSYFBxkrBCYmNTQ2NjMyFhcHJiYjIgYGFRQWFjMyNjcXBgYjASafWlqfZGGcLVMcb0pCb0JCb0JFayVULp1gD2GoZ2SlYFtPNDRHQXZOUHpDQjc0TlsAAgBBAAACmQK8AAoAEwAtQCoAAgIAXwQBAAAOTQUBAwMBXwABAQ8BTgsLAQALEwsSEQ8JBwAKAQoGBxYrATIWFhUUBgYjIxEANjU0JiMjETMBLmylWlqlbO0BYoqKgnd3ArxXn2hon1cCvP2mh3V3hv4HAAABAEEAAAIuArwACwApQCYAAQACAwECZwAAAAVfAAUFDk0AAwMEXwAEBA8EThEREREREAYHHCsBIRUhFSEVIRUhESECLv58AW7+kgGE/hMB7QJbxGHUYgK8AAAAAAEAQQAAAi4CvAAJACNAIAABAAIDAQJnAAAABF8ABAQOTQADAw8DThEREREQBQcbKwEhFSEVIREjESECLv58AW7+kmkB7QJbzmH+1AK8AAAAAQAt//IC2ALKACEAMEAtEA8CBQIBTAAFAAQDBQRnAAICAWEAAQEUTQADAwBhAAAAFQBOERImJSYjBgccKwEUBgYjIiYmNTQ2NjMyFhcHJiYjIgYGFRQWFjMyNjcjNSEC2FSXYWOhW1uhY12RME8haEVDcEFDcEFachHhAU8BTWidVmKnY2OnYk5HOzE7RHlLSnlFaVNhAAABAEEAAAKSArwACwAhQB4AAQAEAwEEZwIBAAAOTQUBAwMPA04RERERERAGBxwrEzMRIREzESMRIREjQWkBf2lp/oFpArz+3AEk/UQBN/7JAAEAQQAAAKoCvAADABNAEAAAAA5NAAEBDwFOERACBxgrEzMRI0FpaQK8/UQAAQAe//MB7AK8AA8AJkAjAwICAAEBTAABAQ5NAAAAAmEDAQICFQJOAAAADwAOEyQEBxgrFiYnNxYzMjY1ETMRFAYGI7B1HVkiY0BHaUBtQw1BPjNMPToB7P4UR2QyAAAAAQBBAAACkAK8AAsAJkAjCgcCAQQAAQFMAgEBAQ5NBAMCAAAPAE4AAAALAAsSERMFBxkrIQMHFSMRMxEBMwEBAhbxe2lpAVh6/u8BJQFEh70CvP6TAW3+1P5wAAABAEEAAAH+ArwABQAZQBYAAAAOTQABAQJgAAICDwJOEREQAwcZKxMzESEVIUFpAVT+QwK8/aZiAAEAQQAAAx4CvAAMAChAJQoHAgMDAAFMAAMAAgADAoABAQAADk0EAQICDwJOEhIREhAFBxsrEzMTEzMRIxEDIwMRI0F77/l6ZtdszWcCvP4LAfX9RAIU/kYBuv3sAAAAAAEAQQAAApACvAAJAB5AGwcCAgIAAUwBAQAADk0DAQICDwJOEhESEAQHGisTMwERMxEjAREjQXMBc2lz/o1pArz96QIX/UQCFv3qAAACAC3/8QLjAsoADwAfACxAKQACAgBhAAAAFE0FAQMDAWEEAQEBFQFOEBAAABAfEB4YFgAPAA4mBgcXKwQmJjU0NjYzMhYWFRQGBiM+AjU0JiYjIgYGFRQWFjMBJZ5aWZ9kZJ5YWZ5jSmw5OGxLSm05OmxKD2GpZmelXV2kaGapYWRJekpMdkNDd0tJe0kAAAACAEEAAAJaArwACgATADJALwYBBAABAgQBZwADAwBfBQEAAA5NAAICDwJOCwsBAAsTCxIRDwkIBwUACgEKBwcWKwEyFhUUBiMjESMRADY1NCYjIxUzAWB2hIV1tmkBZEtKPb+/Arx0Z2Z3/vwCvP6pQTs9PvcAAAACAC3/8QLsAsoAEwAmAIpLsBBQWEAMGBUSAwUDAQEABQJMG0AMGBUSAwUDAQECBQJMWUuwEFBYQCAAAwQFBAMFgAAEBAFhAAEBFE0HAQUFAGIGAgIAABUAThtAJAADBAUEAwWAAAQEAWEAAQEUTQYBAgIPTQcBBQUAYgAAABUATllAFRQUAAAUJhQlHx0XFgATABMmIggHGCshJwYjIiYmNTQ2NjMyFhYVFAYHFyQ3JzMXNjU0JiYjIgYGFRQWFjMCcihTbmWfWFieZmSeWCwqX/7kNpB6VzE4bEtKbDo6bUkrOmKoZmikXV2kaEiAMWhVIp5fSGRLd0NEdktJe0kAAgBBAAACYgK8AA4AFwArQCgCAQEEAUwABAABAAQBZwAFBQNfAAMDDk0CAQAADwBOJCMhESETBgccKwAGBxMjAyMjESMRITIWFQUzMjY1NCYjIwJiRkF8em0IvmkBJneE/kjGPUpKPcYBmGMX/uIBDf7zArx1ZnM7OD0+AAEAL//1Al4CyAAnAC5AKxcWAwIEAAIBTAACAgFhAAEBFE0AAAADYQQBAwMVA04AAAAnACYlKyUFBxkrFiYnNxYWMzI2NTQmJyYmNTQ2NjMyFhcHJiYjIgYVFBYXFhYVFAYGI/WVMVApXEhEY19YfYBLfEhViyxQIlo+RmJWY2yRTX5IC0hCQzA1Ni4tMw8UV1lBYDM/QD4rLjowLCsQEmVXPl8zAAAAAAEAHgAAAl0CvAAHACFAHgIBAAADXwQBAwMOTQABAQ8BTgAAAAcABxEREQUHGSsBFSMRIxEjNQJd62nrArxh/aUCW2EAAQBB//ECjQK8ABUAIUAeAgEAAA5NAAEBA2EEAQMDFQNOAAAAFQAUFCQUBQcZKwQmJjURMxEUFhYzMjY2NREzERQGBiMBBoNCaSpTPD1YLGlEh18PToFMAbD+VzBWNjVWMQGp/lBLgU8AAAAAAQAeAAACsQK8AAYAG0AYAgECAAFMAQEAAA5NAAICDwJOERIQAwcZKxMzExMzASMecNrZcP7mXwK8/dECL/1EAAEAHgAAA9oCvAAMACFAHgoFAgMDAAFMAgECAAAOTQQBAwMPA04SERISEAUHGysTMxMTMxMTMwMjAwMjHm+YnHKgmG/Pb6KebwK8/csCNf3LAjX9RAIY/egAAAAAAQAeAAACvAK8AAsAH0AcCQYDAwIAAUwBAQAADk0DAQICDwJOEhISEQQHGisBATMTEzMBASMDAyMBK/79gsPEgf79AQ2Bzs2CAWUBV/7/AQH+qf6bAQ/+8QAAAAABAB4AAAKpArwACAAdQBoGAwADAgABTAEBAAAOTQACAg8CThISEQMHGSsBATMTEzMBESMBL/7vcdXVcP7vaQE5AYP+zwEx/n3+xwAAAQAoAAACPAK8AAkAKUAmBQEAAQABAwICTAAAAAFfAAEBDk0AAgIDXwADAw8DThESEREEBxorNwEhNSEVASEVISgBfv6OAgj+ggF8/e5aAfxmWv4FZwAAAAIAIP/yAlECIAAQACAAe0uwElBYQAoPAQQCAwEFBAJMG0AKDwEEAwMBBQQCTFlLsBJQWEAZAAQEAmEGAwICAhdNBwEFBQBhAQEAAA8AThtAIQYBAwMRTQAEBAJhAAICF00AAAAPTQcBBQUBYQABARUBTllAFBERAAARIBEfGRcAEAAQJiIRCAcZKwERIzUGIyImJjU0NjYzMhc1AjY2NTQmJiMiBgYVFBYWMwJRZ0p3SnlGRnlKeEl7US4uUDM2Uy4uUzYCEv3uU2FLgk9LfkleUP4/M1YzL1MyMlIuNFczAAAAAAIARP/0AnQCygASACIAkrYPCgIFBAFMS7AUUFhAHQACAhBNAAQEA2EGAQMDF00HAQUFAGEBAQAAFQBOG0uwL1BYQCEAAgIQTQAEBANhBgEDAxdNAAEBD00HAQUFAGEAAAAVAE4bQCEABAQDYQYBAwMXTQACAgFfAAEBD00HAQUFAGEAAAAVAE5ZWUAUExMAABMiEyEbGQASABEREyYIBxkrABYWFRQGBiMiJicVIxEzETY2MxI2NjU0JiYjIgYGFRQWFjMBtXlGR3tKPl8iZWUiYEAiUy4uUzYyUS4uUTICIUp+TE6BSjUsVQLK/vYsNf4wNFcyL1Q0NFYwMVU0AAABACD/8QIMAiAAHAAuQCsZGAsKBAIBAUwAAQEAYQAAABdNAAICA2EEAQMDFQNOAAAAHAAbJiQmBQcZKxYmJjU0NjYzMhYXByYjIgYGFRQWFjMyNjcXBgYj3nlFRXlLS3QiTzFgK0suMEwoMkMdUCN1Sw9Kgk9Nfkk+Oi9HLFE2OFUuJSIuOz8AAgAg//QCUALKABIAIgCSthEDAgUEAUxLsBRQWEAdBgEDAxBNAAQEAmEAAgIXTQcBBQUAYQEBAAAPAE4bS7AvUFhAIQYBAwMQTQAEBAJhAAICF00AAAAPTQcBBQUBYQABARUBThtAIQAEBAJhAAICF00GAQMDAF8AAAAPTQcBBQUBYQABARUBTllZQBQTEwAAEyITIRsZABIAEiYjEQgHGSsBESM1BgYjIiYmNTQ2NjMyFhcRAjY2NTQmJiMiBgYVFBYWMwJQZSJfPkp7R0Z5SkBgInxRLi5RMjZTLi5TNgLK/TZVLDVKgU5Mfko1LAEK/Yc0VTEwVjQ0VC8yVzQAAAIAIP/xAjQCIAAZACEAOEA1FhUCAgEBTAAFAAECBQFnAAQEAGEAAAAXTQACAgNhBgEDAxUDTgAAISAdGwAZABgjFSYHBxkrFiYmNTQ2NjMyFhYVFAcFHgIzMjY3FwYGIxImIyIGBgch4ntHSHxLU3U9BP5XCjVGIjRTGk8jfVGZVz8oSTMFAUoPS4FPTX5JRXpPEiYBKj0gJyAzOzoBf1AjQSoAAQAhAAABfgLaABIAWkAKEQEABhIBAQACTEuwL1BYQBwAAAAGYQAGBhZNBAECAgFfBQEBARFNAAMDDwNOG0AaAAYAAAEGAGkEAQICAV8FAQEBEU0AAwMPA05ZQAoiEREREREgBwcdKwAjIgczFSMRIxEjNTM2NjMyFxUBXhhTAYyMZG1tBExbJh8CgG5f/k0Bs19pXwVfAAACACD/AgJQAiAAIAAwAHlADBkLAgYFAwICAAECTEuwElBYQCIABQUCYQMBAgIXTQgBBgYBYQABARVNAAAABGEHAQQEGQROG0AmAAMDEU0ABQUCYQACAhdNCAEGBgFhAAEBFU0AAAAEYQcBBAQZBE5ZQBUhIQAAITAhLyknACAAHxMmJiUJBxorFiYnNxYWMzI2NjU1BgYjIiYmNTQ2NjMyFhc1MxEUBgYjEjY2NTQmJiMiBgYVFBYWM/OENkQgZDs2TyoiYT9KeUZGeUpAYSFlTX5GMFEuLlEyNlMuLlQ1/jVDTio6NFErQCw2S39MTYFKNS1U/flOeUIBTTVWMDFVNDRXMi9VNAABAEQAAAIeAsoAFQBQtQEBAgABTEuwL1BYQBcFAQQEEE0AAgIAYQAAABdNAwEBAQ8BThtAFwACAgBhAAAAF00FAQQEAV8DAQEBDwFOWUANAAAAFQAVFCMUIwYHGisTETY2MzIWFhURIxE0JiMiBgYVESMRphpbPDZbNmdGPCc/JWYCyv77KzA1XTj+qgEyO1AqRyr+3gLKAAIARAAAAK0C1wADAAcAPEuwJlBYQBUAAQEAXwAAABBNAAICEU0AAwMPA04bQBMAAAABAgABZwACAhFNAAMDDwNOWbYREREQBAcaKxMzFSMXMxEjRGlpAmVlAtdfZv3uAAIAPP8BASEC1wADAAwAT0uwJlBYQBsAAQEAXwAAABBNAAICEU0FAQQEA2IAAwMZA04bQBkAAAABAgABZwACAhFNBQEEBANiAAMDGQNOWUANBAQEDAQMEhQREAYHGisTMxUjAjY1ETMRFCM1umdnNDRm5ALXX/zqVlYCBP3j9GEAAQBEAAACNQK8AAsAKkAnCgcCAQQAAgFMAAEBDk0AAgIRTQQDAgAADwBOAAAACwALEhETBQcZKyEDBxUjETMRNzMHEwHCp3JlZf1/xtYBAHaKArz+Wf7N/roAAAABAEQAAACpAskAAwAoS7AvUFhACwAAABBNAAEBDwFOG0ALAAAAAV8AAQEPAU5ZtBEQAgcYKxMzESNEZWUCyf03AAAAAAEARAAAA2kCIQAiAGVLsBBQWLYGAQIDAAFMG7YGAQIDBwFMWUuwEFBYQBYFAQMDAGEIBwEDAAAXTQYEAgICDwJOG0AaCAEHBxFNBQEDAwBhAQEAABdNBgQCAgIPAk5ZQBAAAAAiACITIxMjFCQiCQcdKxMVNjMyFhc2NjMyFhYVESMRNCYjIgYVESMRNCYjIgYVESMRpjduMlQcGWY7NlkzZj49NklmPzs6RWYCEk1cNSspNzVdOf6qATI9TlVG/t4BMj1OWUL+3gISAAEARAAAAh4CIAAVAFpLsBJQWLUBAQIAAUwbtQEBAgQBTFlLsBJQWEATAAICAGEFBAIAABdNAwEBAQ8BThtAFwUBBAQRTQACAgBhAAAAF00DAQEBDwFOWUANAAAAFQAVFCMUIwYHGisTFTY2MzIWFhURIxE0JiMiBgYVESMRphpbPDZbNmdGPCc/JWYCEk0rMDVdOP6qATI7UCpHKv7eAhIAAAAAAgAg//ACQgIiAA8AHwAsQCkAAgIAYQAAABdNBQEDAwFhBAEBARUBThAQAAAQHxAeGBYADwAOJgYHFysWJiY1NDY2MzIWFhUUBgYjPgI1NCYmIyIGBhUUFhYz5X1ISH1MTH1ISH1MNU0oKE01NE4pKU40EEyDT0t/Skp+TE+DTF81WDMuUzMzUy4zWDUAAAAAAgBE/xACdAIfABIAIgBotg8KAgUEAUxLsBRQWEAdAAQEAmEGAwICAhFNBwEFBQBhAAAAFU0AAQETAU4bQCEAAgIRTQAEBANhBgEDAxdNBwEFBQBhAAAAFU0AAQETAU5ZQBQTEwAAEyITIRsZABIAERETJggHGSsAFhYVFAYGIyImJxEjETMVNjYzEjY2NTQmJiMiBgYVFBYWMwG1eUZGeUpAYCJlZSJgQCJTLi5TNjJRLi5RMgIfSYBOTIBKNSz+vQMCVCw1/jAzVTAzVjM0VDExVjQAAAAAAgAg/xACUAIgABIAIgBothEDAgUEAUxLsBJQWEAdAAQEAmEGAwICAhdNBwEFBQFhAAEBFU0AAAATAE4bQCEGAQMDEU0ABAQCYQACAhdNBwEFBQFhAAEBFU0AAAATAE5ZQBQTEwAAEyITIRsZABIAEiYjEQgHGSsBESMRBgYjIiYmNTQ2NjMyFhc1AjY2NTQmJiMiBgYVFBYWMwJQZSJgQEp5RkZ5SkBgInxRLi5RMjZTLi5TNgIS/P4BRSw1Sn5MTYFKNSxT/j80VTAxVTQ0VzIvVDMAAAAAAQBEAAABcQIhAAwAV0uwEFBYtQEBAQABTBu1AQEBAwFMWUuwEFBYQBIAAQEAYQQDAgAAF00AAgIPAk4bQBYEAQMDEU0AAQEAYQAAABdNAAICDwJOWUAMAAAADAAMFBETBQcZKxMVNjYzFSIGBhURIxGoGWpGPFoyZQISQSomXyE7Jv7AAhIAAAEAK//yAeMCHgAoAC5AKxcWAwIEAAIBTAACAgFhAAEBF00AAAADYQQBAwMVA04AAAAoACclLCQFBxkrFiYnNxYzMjY3NCYmJyYmNTQ2NjMyFhcHJiYjIgYVFBYWFxYWFRQGBiPPeylCSVkzQgEjOUNSXDlhOT1yI0AWSjA0RxxAQU9lPmQ3DjQxOUMjIxkcDgwORD82TicsMTYcICcmFhkRCw1JQTNLKAAAAAABAB7/9AGAApoAFAAyQC8TAQUBFAEABQJMCgkCAkoEAQEBAl8DAQICEU0ABQUAYQAAABUATiIRExETIAYHHCsEIyImNREjNTM1NxUzFSMRFDMyNxUBXyJeUHFxYo+PbAkaDFRaARRcah6IXP7sUwJZAAAAAAEARP/yAh4CEgAVAEy1EgEDAQFMS7ASUFhAEwIBAAARTQABAQNhBQQCAwMPA04bQBcCAQAAEU0AAwMPTQABAQRhBQEEBBUETllADQAAABUAFBEUIxQGBxorFiYmNREzERQWMzI2NjURMxEjNQYGI9VbNmVHPSZAJGdjGVs8DjVeOgFT/tE9UitJKwEf/e5NKjEAAAABABIAAAIbAhMABgAbQBgCAQIAAUwBAQAAEU0AAgIPAk4REhADBxkrEzMTEzMDIxJnnKBm2lgCE/5bAaX97QAAAQASAAADPwISAAwAIUAeCgUCAwMAAUwCAQIAABFNBAEDAw8DThIREhIQBQcbKxMzExMzExMzAyMDAyMSYIJ6dXuCX6d1ent1AhL+aAGY/mgBmP3uAZb+agAAAAABABIAAAIwAhIACwAfQBwJBgMDAgABTAEBAAARTQMBAgIPAk4SEhIRBAcaKxMnMxc3MwcTIycHI+rLb5OTbcnYb6ChbgET/7m5//7tzc0AAAEAEv8QAksCEgAHABtAGAMBAgABTAEBAAARTQACAhMCThESEQMHGSslAzMTEzMBIwEF82bAr2T+rWgcAfb+cgGO/P4AAQAoAAABuwISAAkAKUAmBQEAAQABAwICTAAAAAFfAAEBEU0AAgIDXwADAw8DThESEREEBxorNwEhNSEVASEVISgBFf70AYr+7AES/m9FAXZXRP6KWAAAAAEAEv8QA3UCmgAbADxAORACAgQDGxECBQQCTAYFAgBKBgEDAwBfAgECAAARTQAEBAVhAAUFFU0ABwcTB04REyMjERMSEAgHHisTMxMTMzU3FTMVIxEUFjMyNxUGIyImNREjASMTEmbAr5xjj48xOgoaISJfUGD+1Wh1AhL+cgGOah6IXP7sJywCWQRUWgEU/VoBDAACAB7/8gJOAsoADwAbACxAKQACAgBhAAAAFE0FAQMDAWEEAQEBFQFOEBAAABAbEBoWFAAPAA4mBgcXKxYmJjU0NjYzMhYWFRQGBiM2NjU0JiMiBhUUFjPff0JCf1dYfkJCflhRYGBRUV9fUQ5bpWxspVtbpWxspVtminx9iop9fIoAAAABABQAAAE5ArwABgAbQBgCAQADAQABTAAAAA5NAAEBDwFOERMCBxgrEwc1NzMRI9C8vGlpAlNJY0/9RAABABcAAAHvAsoAGgAqQCcLCgICABoBAwICTAAAAAFhAAEBFE0AAgIDXwADAw8DThEXJSYEBxorATY2NTQmJiMiBgcnNjYzMhYWFRQGBwchFSE1ARkwNB05KDBOE1che0o9akA9OqwBLv4sAUoxSigfNyM7KTNJTDNiQz5nOqxnSwAAAAABABT/8QIAArwAHQA+QDsUAQIDFQ8CAQIDAgIAAQNMAAECAAIBAIAAAgIDXwADAw5NAAAABGEFAQQEFQROAAAAHQAcERIlJQYHGisWJic3FhYzMjY1NCYmIyMnNyE1IRUHHgIVFAYGI7RwMEwaVjQ+VSVCKSMtqf7JAbidNVYxQ3NGDz9JQyo7TTwdOCQ9xWFUugc7WTNJbDoAAAABABQAAAI1ArwADgAsQCkCAQIBSwQBAgUBAAYCAGgAAQEOTQADAwZfAAYGDwZOERERERESEAcHHSslITUTMwMzNTMVMxUjFSMBdf6f7m3r8WlXV2mJYQHS/i64uGGJAAABABn/8gICArwAGwA2QDMDAgIAAQFMAAQAAQAEAWcAAwMCXwACAg5NAAAABWEGAQUFFQVOAAAAGwAaIRERJSUHBxsrFiYnNxYWMzI2NjU0JiMjEyEVIQczMhYVFAYGI7x3LFAZVjUtQCBNUcAbAYr+2gtebIhDcEIORkg/LDsrQiIvQgFkYZ9taEdvPwAAAAACABz/8gIKArwAFgAjADZAMwwBAwEBTAABAAMEAQNqAAAADk0GAQQEAmEFAQICFQJOFxcAABcjFyIeHAAWABUiGgcHGCsWJiY1NDY2NzY2NzMHNjMyFhYVFAYGIz4CNTQmIyIGFRQWM8lwPRYzQRBFH3miFRVJbTk/cUknQyhRQURKUjwOPGxELUZXYRlqMPcDQms9RGw8YiI/KTtNSz0+TAAAAAEACgAAAc4CvAAGAB9AHAQBAAEBTAAAAAFfAAEBDk0AAgIPAk4SERADBxkrASE1IRUDIwFY/rIBxO1sAlljVP2YAAAAAwAh//ICEgLKABkAJQAxAERAQRMFAgQDAUwHAQMABAUDBGkAAgIAYQAAABRNCAEFBQFhBgEBARUBTiYmGhoAACYxJjAsKholGiQgHgAZABgrCQcXKxYmNTQ2NyYmNTQ2NjMyFhYVFAYHFhYVFAYjEjY1NCYjIgYVFBYzEjY1NCYjIgYVFBYzpoU2LyQqPGY/P2Y8KiQvN4ZzM0ZENTRFRjM+U1M+PlNTPg5wYTRZHBpJLkFdLy9dQS5JGhxZNGFwAZ85MTQ7OzQxOf7DPjc3PT03Nz4AAAAAAgAaAAACCQLKABQAIQAvQCwUAQAEAUwFAQQAAAIEAGkAAwMBYQABARRNAAICDwJOFRUVIRUgJhgmIAYHGiskIyImJjU0NjYzMhYWFRQGBgcHIzc2NjU0JiMiBgYVFBYzAR4VSW05P3FJSXA9FzVEb3iiI0pSPCdCKFFA9UJsPERrPDxrRC1IWGiq+F5MPT5LIj4pO04AAAABADz/xAJ1AvgAAwARQA4AAAEAhQABAXYREAIHGCsBMwEjAgxp/jBpAvj8zAAAAAABADwAAACmAGUAAwATQBAAAAABXwABAQ8BThEQAgcYKzczFSM8amplZQAAAAEAPP+DAOEAgAADABhAFQAAAQEAVwAAAAFfAAEAAU8REAIHGCs3MwcjbnNSU4D9AAIAPAAAAKYBmgADAAcAHUAaAAAAAQIAAWcAAgIDXwADAw8DThERERAEBxorEzMVIxUzFSM8ampqagGaZdBlAAACADz/gwDhAZoAAwAHACJAHwAAAAECAAFnAAIDAwJXAAICA18AAwIDTxERERAEBxorEzMVIwczByNwamoCc1JTAZpltf0AAAABADwAAACmAGUAAwATQBAAAAABXwABAQ8BThEQAgcYKzczFSM8amplZQAAAAIAPAAAAL8CvAADAAcAH0AcAAEBAF8AAAAOTQACAgNfAAMDDwNOEREREAQHGisTMwMjBzMVIzyDFFoIamoCvP37UmUAAgA8AAAAvwK8AAMABwA+S7AqUFhAFQABAQBfAAAADk0AAgIRTQADAw8DThtAFQABAQBfAAAADk0AAgIDXwADAw8DTlm2EREREAQHGisTMxUjFzMTI0lqaghaFIMCvGVR/foAAAIAPAAAAfYCygAbAB8AL0AsDQwCAgABTAACAAMAAgOAAAAAAWEAAQEUTQADAwRfAAQEDwROEREaJCgFBxsrPgI3NjY1NCYjIgYHJzYzMhYWFRQGBgcGBhUjBzMVI9MdKCMqKjs6MksWS1GSOmI7HSkjKihoAWpq6z0uIig6ITA8OSc8hzBcPiQ/MSMqOB9jZQAAAAACADz/8gH2ArwAAwAfADVAMh0cAgMCAUwAAgEDAQIDgAABAQBfAAAADk0AAwMEYgUBBAQVBE4EBAQfBB4pGxEQBgcaKxMzFSMCJiY1NDY2NzY2NTMUBgYHBgYVFBYzMjY3FwYj9mpqHWI7HSkjKihoHSgjKio8OTJLFktRkgK8Zf2bMFw+JD8xIyo4HyM9LiIoOiEwPDknPIcAAAABADwA/QCmAWIAAwAYQBUAAAEBAFcAAAABXwABAAFPERACBxgrEzMVIzxqagFiZQABADwA3gDCAWAAAwAYQBUAAAEBAFcAAAABXwABAAFPERACBxgrEzMVIzyGhgFgggABAEIBWwG1ArwADgAcQBkODQoJCAcGBQQDAgEMAEkAAAAOAE4bAQcXKwEHFwcnByc3JzcXJzMHNwG1gFJBSktBUoAYfgVQBH0CGCVpL25uL2klTC2FhS0AAgA8AAACtwK8ABsAHwBJQEYQDwcDAQYEAgIDAQJnDAEKCg5NDggCAAAJXw0LAgkJEU0FAQMDDwNOHBwcHxwfHh0bGhkYFxYVFBMSEREREREREREQEQcfKwEjBzMHIwcjNyMHIzcjNzM3IzczNzMHMzczBzMBNyMHAqJ6JnsVeyZhJn4mYSZxFXEmchVyJmEmfiZhJnr+6iZ+JgG1rF2srKysXaxdqqqqqv73rKwAAAABADz/xAFdAvgAAwARQA4AAAEAhQABAXYREAIHGCsTMwMj9Gm4aQL4/MwAAAEAPP/EAV0C+AADABFADgAAAQCFAAEBdhEQAgcYKxMzEyM8abhpAvj8zAAAAgA8AAAAvwK8AAMABwAfQBwAAQEAXwAAAA5NAAICA18AAwMPA04REREQBAcaKxMzAyMHMxUjPIMUWghqagK8/ftSZQACADwAeACmAhIAAwAHABxAGQACAAMCA2MAAQEAXwAAABEBThERERAEBxorEzMVIxUzFSM8ampqagISZdBlAAAAAQA8/8UBAgL4AAkAGEAVAAABAQBXAAAAAV8AAQABTxQTAgcYKzY1NDczBhUUFyM8ZGJkZGKN0dLIxdXRyAAAAAEAPP/FAQIC+AAJABhAFQAAAQEAVwAAAAFfAAEAAU8UEwIHGCs2NTQnMxYVFAcjoGRiZGRijdHUxsjS0cgAAAABADz/xAEpAvwAIgA+QDsJAQIEGQEBAiEBBQEiAQAFBEwAAwAEAgMEaQACAAEFAgFpAAUAAAVZAAUFAGEAAAUAURoxFBIVIAYHHCsEIyImNTU0Jgc1FzI1NTQ2FxUmIyIGFRUUBxYVFRQWMzI3FQEhD1A/JCMNOkpcBwwbGjIyGBgGEjxOVI4mHAJWAT+JWVIGWgEaIJFXHR5Wmh4ZAlYAAQA8/78BKQL3ACIAOkA3EAEBAhkHAgMBIgEAAwNMAAMBAAEDAIAAAgABAwIBaQAABAQAWQAAAARhAAQABFEVFyMqIAUHGys2MzI2NTU0NyY1NTQmIyIHNTYzMhYVFRQWNxUmBhUVFAYnNUwGGhgzMxkbDQcIEE5AJCMjJEldFxofmlUfHVeRHxkBXAFSVIklHANWAhwmjllOBlQAAQA8/8MBAgL4AAcAIkAfAAAAAQIAAWcAAgMDAlcAAgIDXwADAgNPEREREAQHGisTMxUjETMVIzzGXV3GAvhd/X9XAAABADz/wwECAvgABwAiQB8AAgABAAIBZwAAAwMAVwAAAANfAAMAA08REREQBAcaKzczESM1MxEjPF5exsYaAoFd/MsAAAEAPAD4AbMBWQADABhAFQAAAQEAVwAAAAFfAAEAAU8REAIHGCsTIRUhPAF3/okBWWEAAAABAEEBFgJTAXgAAwAYQBUAAAEBAFcAAAABXwABAAFPERACBxgrEyEVIUECEv3uAXhiAAAAAQA8APgC2gFaAAMAGEAVAAABAQBXAAAAAV8AAQABTxEQAgcYKxMhFSE8Ap79YgFaYgAAAAEAQQAAAlMAZAADACCxBmREQBUAAAEBAFcAAAABXwABAAFPERACBxgrsQYARDchFSFBAhL97mRkAAAA//8APP+DAOEAgAACAEMAAAABADz/gwDhAIAAAwAYQBUAAAEBAFcAAAABXwABAAFPERACBxgrNzMHI25zUlOA/QACADwBtAGRAsoAAwAHADRLsC9QWEANAwEBAQBfAgEAABABThtAEwIBAAEBAFcCAQAAAV8DAQEAAU9ZthERERAEBxorEzMDIwEzAyOPUDJxAQVQMnACyv7qARb+6gAAAAACADwBtAGRAsoAAwAHADRLsC9QWEANAwEBAQBfAgEAABABThtAEwIBAAEBAFcCAQAAAV8DAQEAAU9ZthERERAEBxorEzMDIxMzAyNucVNQ5XBSUALK/uoBFv7qAAEARgG0AOkCygADAC1LsC9QWEALAAEBAF8AAAAQAU4bQBAAAAEBAFcAAAABXwABAAFPWbQREAIHGCsTMwMjmVAycQLK/uoAAAEARgG0AOkCygADAC1LsC9QWEALAAEBAF8AAAAQAU4bQBAAAAEBAFcAAAABXwABAAFPWbQREAIHGCsTMwMjeHFTUALK/uoAAAEAPACCARMCEgAFABlAFgMBAQABTAABAQBfAAAAEQFOEhECBxgrEzczBxcjPG5pbm5pAUfLy8UAAQA8AIIBEwISAAUAGUAWAwEBAAFMAAEBAF8AAAARAU4SEQIHGCsTJzMXByOqbmlubmkBR8vLxQABADz/uQIoAl0AIgA1QDIQDQICASIhFBMEAwIFAgIAAwNMAAEAAgMBAmkAAwAAA1kAAwMAXwAAAwBPJiYaEwQHGiskBgcVIzUuAjU0NjY3NTMVFhYXByYjIgYGFRQWFjMyNjcXAgtePVdAZTg4ZUBXPF4cTzFgK0suMEwoMkQcUDk+Bzs8Ck54R0V0TQpBQAg7Mi9HLFE2OFUuJSIuAAAAAwAy/8MCYgL4ACAAJwAuAC5AKy4tJCMdHBoZFxQODQoJBgMQAAEBTAABAAABVwABAQBfAAABAE8WFRQCBxcrJAYGBxUjNSYmJzcWFhc1JiY1NDY3NTMVFhcHJicVFhYVABYXNQYGFQA2NTQmJxUCYj5pP1xJeypRIUg0ZHl9YFyVTVE5WGWB/ko4PDRAAQVFOz+NVzYINTUJRTlDJzIJ1RFYVlZuDTMyD24+SgzSFWNSAREpDb8JNib+bzImJC4QwwAAAAEAPP/yAroCygAyAElARhgXAgQGMgELAQJMBwEECAEDAgQDZwkBAgoBAQsCAWcABgYFYQAFBRRNAAsLAGEAAAAVAE4wLiopKCcRFCUjERMRIyEMBx8rJQYjIiYnJjUjNTMmNTcjNTM3NjYzMhYXByYmIyIGBwYHIRUhBhUUFyEVIRYXFhYzMjY3ArpNo3ehHQJXTQIBTFYDHaF3RYUkTxtPNUljFwYCAST+zwECATD+3gQDGmlAOFEVa3l2bwoESyAQIksNdnpHNzIlLEU+EglLDBgfD0sSCT07LB4AAAAAAQA8AAACNwLJABgAP0A8CgEDAgsBAQMCTAQBAQUBAAYBAGcAAwMCYQACAhRNCQgCBgYHXwAHBw8HTgAAABgAGBERERIjIxERCgceKzc1IzUzNTQ2MzIXFSYjIhUVMxUjFSEVITWWWlp4bWY0T0t89vYBOP4FYdZUJYqPGmYevR9U1mFhAAAAAAEAKAAAAmoCvQAXAD5AOwcBAQIAAVgGAQIFAQMEAgNnDAsCCQkOTQoIAgAABGAABAQPBE4AAAAXABcWFRQTERERERERERERDQcfKwEDMxUjFTMVIxUjNSM1MzUjNTMDMxMzEwJqs3KsrKxpra2tdLNpswqzAr3+w0tTS5eXS1NLAT3+wwE9AAABADwAMgJiAlgACwAsQCkABAMBBFcGBQIDAgEAAQMAZwAEBAFfAAEEAU8AAAALAAsREREREQcHGysBFSMVIzUjNTM1MxUCYuFk4eFkAXdh5ORh4eEAAAAAAQA8ARYCYgF3AAMAGEAVAAABAQBXAAAAAV8AAQABTxEQAgYYKxMhFSE8Aib92gF3YQAAAAEAPABfAgkCKwALAAazCQMBMis3Nyc3FzcXBxcHJwc8n59Hn59In55Hnp+mn59Hn59Hn59Hn58AAwBGAC8CbAJcAAMABwALACxAKQAAAAECAAFnAAIAAwQCA2cABAUFBFcABAQFXwAFBAVPEREREREQBgccKwEzFSMHIRUhFzMVIwEnZGThAib92uFkZAJcX4ZhiF8AAAAAAgA8AKACTgHlAAMABwAiQB8AAAABAgABZwACAwMCVwACAgNfAAMCA08REREQBAcaKxMhFSEVIRUhPAIS/e4CEv3uAeVkfWQAAQA8AFACTgIuABMAnUuwEFBYQCkACAcHCHAAAwICA3EJAQcGAQABBwBoBQEBAgIBVwUBAQECXwQBAgECTxtLsBJQWEAoAAgHBwhwAAMCA4YJAQcGAQABBwBoBQEBAgIBVwUBAQECXwQBAgECTxtAJwAIBwiFAAMCA4YJAQcGAQABBwBoBQEBAgIBVwUBAQECXwQBAgECT1lZQA4TEhEREREREREREAoGHysBIwczFSEHIzcjNTM3ITUhNzMHMwJOr0z7/sgxZDF2s0z/AQE8LWQtcgGBfWRQUGR9ZElJAAABADwAUAHnAkgABgAGswYDATIrNyUlNQUVBTwBS/61Aav+VbWXmGTJZcoAAAEAPABQAecCSAAGAAazBgIBMisTNSUVBQUVPAGr/rYBSgEaZclkmJdlAAAAAgA8AAACEAJFAAYACgAiQB8GBQQDAgEABwBKAAABAQBXAAAAAV8AAQABTxEXAgYYKxMlJTUFFQUHIRUhPQF3/okB0/4tAQHU/iwBIGVrVYN5hGZfAAAAAAIAPAAAAhACRQAGAAoAIkAfBgUEAwIBAAcASgAAAQEAVwAAAAFfAAEAAU8RFwIGGCsTNSUVBQUVBSEVIT0B0/6IAXj+LAHU/iwBSXmDVWtlW2ZfAAIAPAAAAg8CSwALAA8AMUAuBAEAAwEBAgABZwAFAAIGBQJnAAYGB18IAQcHDwdODAwMDwwPEhEREREREAkHHSsBMxUjFSM1IzUzNTMBNSEVAVe4uGK5uWL+5QHTAa1an59anv21WloAAgA8AHMCQgHuABUAKwBSQE8VCgIDARQBAgMfAQQCKyACBwUqAQYHBUwJAQBKAAAAAwIAA2kAAQACBAECaQAFBwYFWQAEAAcGBAdpAAUFBmEABgUGUSQjJCMkIyQgCAYeKxIzMhYXFhYzMjcXBiMiJicmJiMiBycWMzIWFxYWMzI3FwYjIiYnJiYjIgcneFwiNSMgIhUxODRBYiM3IRslFS0xNTxcIjUjICIVMTg0QWIjNyEbJRUtMTUB6A4ODAo4Qk8PDQsKMEKiDg4MCjhCTw8NCwowQgAAAQA8AP0CQgGOABUAObEGZERALhUKAgMBFAECAwJMCQEASgABAwIBWQAAAAMCAANpAAEBAmEAAgECUSQjJCAEBxorsQYARBIzMhYXFhYzMjcXBiMiJicmJiMiByd4XCI1IyAiFTE4NEFiIzchGyUVLTE1AYgODgwKOEJPDw0LCjBCAAAAAQBBAZoB6gLJAAYAIbEGZERAFgQBAQABTAAAAQCFAgEBAXYSERADBxkrsQYARBMzEyMnByPiap5gdHRhAsn+0d7eAAADAEAAbQN5AgwAHwAtADsASkBHNyMbCwQFBAFMAQEABgEEBQAEaQoHCQMFAgIFWQoHCQMFBQJhCAMCAgUCUS4uICAAAC47Ljo0MiAtICwoJgAfAB4mJiYLBhkrNiYmNTQ2NjMyFhYXPgIzMhYWFRQGBiMiJiYnDgIjPgI3LgIjIgYVFBYzIDY1NCYjIgYGBxcWFjPTXDc3XDYoQzYzMTdDKDZcNzdcNihDOS8xN0MpFikpMS4rKhcuPD0tAdY+PS4XKSkxETY1Hm00Xzw9XzQjMzc1NSM0Xz08XzQiNjU2NSJYGCo1MywYQTY2QUI1NkEYKTYSOyoAAAUAPf/yA0kCygAPABMAHwAvADsAkkuwElBYQCsLAQUKAQEGBQFpAAYACAkGCGoABAQAYQIBAAAUTQ0BCQkDYQwHAgMDDwNOG0AzCwEFCgEBBgUBaQAGAAgJBghqAAICDk0ABAQAYQAAABRNAAMDD00NAQkJB2EMAQcHFQdOWUAmMDAgIBQUAAAwOzA6NjQgLyAuKCYUHxQeGhgTEhEQAA8ADiYOBxcrEiYmNTQ2NjMyFhYVFAYGIwEzASMSNjU0JiMiBhUUFjMAJiY1NDY2MzIWFhUUBgYjNjY1NCYjIgYVFBYzu1AuLlAxMU8uLk8xAZlp/hlpeTExKywyMiwBflAuLlAxMU8uLk8xKzExKywyMiwBZC9TMzBRMC9SMDNTLwFY/UQBsz4qJTw8JSo+/j8vUzMwUTAvUjAzUy9PPiolPDwlKj4AAAAHADz/8gTNAsoADwATAB8ALwA/AEsAVwCuS7ASUFhAMQ8BBQ4BAQYFAWkIAQYMAQoLBgpqAAQEAGECAQAAFE0TDRIDCwsDYREJEAcEAwMPA04bQDkPAQUOAQEGBQFpCAEGDAEKCwYKagACAg5NAAQEAGEAAAAUTQADAw9NEw0SAwsLB2ERCRADBwcVB05ZQDZMTEBAMDAgIBQUAABMV0xWUlBAS0BKRkQwPzA+ODYgLyAuKCYUHxQeGhgTEhEQAA8ADiYUBxcrEiYmNTQ2NjMyFhYVFAYGIwEzASMSNjU0JiMiBhUUFjMAJiY1NDY2MzIWFhUUBgYjICYmNTQ2NjMyFhYVFAYGIyQ2NTQmIyIGFRQWMyA2NTQmIyIGFRQWM7pQLi5QMTFQLS1QMQGaaf4ZaXkxMSsrMzIsAX5QLi5QMTFPLi5PMQFTUC4uUDExTy4uTzH+pzExKywyMiwBsDAwKywzMi0BZC9TMzBRMC9RMTNTLwFY/UQBsz4pJT09JSk+/j8vUzMwUTAvUjAzUy8vUzMwUTAvUjAzUy9PPiolPDwlKj4+KiY7PCUqPgAAAAABADwAAALGAyEACAAVQBIGBQQDAgEABwBKAAAAdhcBBhcrAQcnAQEHJxEjAVDPRQFFAUVFz2ICZs9FAUX+vEXQ/ZgAAAEAPABTApYCrAAIAClAJgIBAAEBTAQDAgBJAAABAIYAAgEBAlcAAgIBXwABAgFPERQQAwYZKyUjEwEnASE1IQKWYgH+TEUBsv7cAcvhASb+TEUBsmIAAAABADwAOwNdAsUACAAiQB8IBwIBSgIBAgBJAAEAAAFXAAEBAF8AAAEATxETAgYYKwEBJzchNSEnNwNd/rxF0P2YAmbPRQGA/rtFz2LPRQAAAAEAPABjApUCvgAIAClAJggBAgABTAcGAgBKAAACAIUAAgEBAlcAAgIBXwABAgFPEREQAwYZKwEzEQU1BQE3AQIzYv41ASb+TEUBsgIw/jQBYwEBtEX+TQABADz/5ALGAwYACAAUQBEIBQQDAgEGAEkAAAB2FgEGFysBFwEBNxcRMxECgkT+u/67Rs9iAW5F/rsBRUbQAmf9mQAAAAEAPABgApcCuAAIAChAJQcBAAIBTAgBAkoAAgAChQAAAQEAVwAAAAFfAAEAAU8REREDBhkrAQEhFSEDMwMBApf+TAEm/jQBYwEBtAJz/k5hAcv+2QG0AAABADwAQQNdAssACAAvQCwFAQABAUwHBgIBSgQDAgBJAgEBAAABVwIBAQEAXwAAAQBPAAAACAAIEQMGFysBFSEXBwEBFwcDXf2az0X+uwFERtABt2LPRQFFAUVFzwAAAAABADwATgKVAqgACAApQCYAAQACAUwIBwIASQAAAgCGAAECAgFXAAEBAl8AAgECTxEREQMGGSsTESMRJRUlAQeeYgHL/toBtEUCAP7cAcsBYgH+TEUAAAAAAQA8AEEEmwLLAA0ALEApBwEBAAFMBgUCAQQASg0MCQgEAUkAAAEBAFcAAAABXwABAAFPFhMCBhgrEwEXByEnNwEBJzchFwc8AURG0QLt0EUBRP67Rc/9F89FAYYBRUXPz0X+u/67Rc/PRQAAAgA+/2oDagKPADgARQD5S7AUUFhAEh4BCQMRAQUJNQEHATYBCAcETBtAEh4BCQQRAQUJNQEHATYBCAcETFlLsBRQWEAtAAAABgMABmkEAQMACQUDCWkMCgIFAgEBBwUBaQAHCAgHWQAHBwhiCwEIBwhSG0uwLVBYQDQABAMJAwQJgAAAAAYDAAZpAAMACQUDCWkMCgIFAgEBBwUBaQAHCAgHWQAHBwhiCwEIBwhSG0A5AAQDCQMECYAAAAAGAwAGaQADAAkFAwlpAAUKAQVZDAEKAgEBBwoBaQAHCAgHWQAHBwhiCwEIBwhSWVlAGTk5AAA5RTlEQD4AOAA3JiUjEiYkJSYNBx4rBCYmNTQ2NjMyFhYVFAYjIiYnBgYjIiYmNTQ2NjMyFzUzFRQWMzI2NTQmJiMiBgYVFBYWMzI3FwYjEjY2NTQmIyIGBxQWMwFeuGhnuXd1uWdbUCw7DRdHMDRXMjJXNFQyShkdJClRj1tbj1FQjlpsWzFsjBw3H0Q0N0cBRziWaLh0c7ZoY69tYngvISQrNls3NlkzQDTlKyJGR1iITFGQXV6TUTxBTQEUIzsiM0lIMjZMAAAAAwA8//ICxgLIAB0AKQAzAGZADy0sKRoXFhUUEwUKBAMBTEuwElBYQBgAAwMAYQAAABRNBgEEBAFhBQICAQEPAU4bQBwAAwMAYQAAABRNAAEBD00GAQQEAmEFAQICFQJOWUATKioAACozKjIkIgAdABwbKwcHGCsWJjU0NjcmJjU0NjYzMhYWFRQGBxc3FwcXIycGBiMSNjU0JiMiBhUUFhcSNjcnBgYVFBYzrXFGPDMsMFg4N1cwSEKKZ0twp4hdLWRBNjIwKCkwHy4tPSKdLTA+Mw5iVDxeLTNOMC9NLCpLLzVUMIt5MoahWTA3Adk3HyMqLSUbLS3+pCYnnCNAJSs2AAACADz/vwIEAvMAMQA+AEVAQiEgFwMFAzEJCAMBBAJMAAUDBAMFBIAABAEDBAF+AAIAAwUCA2kAAQAAAVkAAQEAYgAAAQBSPDo1NCUjHhwkJAYHGCskFRQGBiMiJic3FjMyNjc0JiYnJiY1NDcmNTQ2NjMyFhcHJiYjIgYVFBYWFxYWFRQGByQWFxY2NTQmJxUiBhUCBEFnOD5/K0ZKWzRGASM7R1ZdQUE7ZDw/dSRCF0wxNkkeOzljZyYh/uszPTpQNkU2SbdMNU4pNTM8RiUjGhwPDRBGQVMxJ0o4UCgtMzkdISgmFhoQChNKQyhAGFgcCwMnKB8aDgEoJgADADz/8wMcAscADwAfADsAXrEGZERAUzg3KyoEBgUBTAAAAAIEAAJpAAQABQYEBWkABgoBBwMGB2kJAQMBAQNZCQEDAwFhCAEBAwFRICAQEAAAIDsgOjUzLiwoJhAfEB4YFgAPAA4mCwcXK7EGAEQEJiY1NDY2MzIWFhUUBgYjPgI1NCYmIyIGBhUUFhYzLgI1NDY2MzIWFwcmIyIGFRQWFjMyNjcXBgYjAUipY2OpZGSpY2OpZE6DTEyDTk2DTEyDTS9RLy9RMzJNFzcgPy0/HzIbISoVNxdOMg1ip2JipWJipWJip2JRS4FOToFKS4FNToFLXjJXNTNVMSomIi4/NiY4HRcXICcqAAAABAA8AVgBzALiAA8AHwAtADYAY7EGZERAWCEBBQgBTAYBBAUDBQQDgAoBAQACBwECaQAHAAkIBwlpAAgABQQIBWcLAQMAAANZCwEDAwBhAAADAFEQEAAANjQwLispKCcmJCMiEB8QHhgWAA8ADiYMBxcrsQYARAAWFhUUBgYjIiYmNTQ2NjMSNjY1NCYmIyIGBhUUFhYzNgcXIycjIxUjNTMyFhUHMzI2NTQmIyMBOlw2Nlw3Nls2NVw2KUYpKUYpKEQpKUQoUB4dJBkDKSRNHiNqKg4QEQ0qAuI1WjY1WzU1WzU2WjX+pilEKClEKChEKShEKY8NQjs7rR4cGAwMDQ0AAAACADwBowJqArwABwAUAEZAQxQPDAMGAAFMAAYAAQAGAYAHBQIBAYQIBAkDAwAAA1cIBAkDAwMAXwIBAAMATwAAExIREA4NCwoJCAAHAAcREREKBhkrARUjFSM1IzUhMxEjNQcjJxUjETMXASJYNFoB8jw1STFFNDxWArwx6Ogx/ufAn5/AARm9AAAAAAIAPAFYAcwC4gAPAB0AOLEGZERALQAAAAIDAAJpBQEDAQEDWQUBAwMBYQQBAQMBURAQAAAQHRAcFxUADwAOJgYHFyuxBgBEEiYmNTQ2NjMyFhYVFAYGIz4CNTQmIyIGFRQWFjPNWzY1XDY3XDY2XDchNyFHMjBGIDcfAVg1WzU2WjU1WjY1WzVOITYgMUZGMR83IQABAAAAAQAAXf9euF8PPPUABwPoAAAAANv3jIAAAAAA3EK8WwAK/wEEzQMhAAAABwACAAAAAAAAAAEAAAPA/xAAAAUJAAAAEgTNAAEAAAAAAAAAAAAAAAAAAACLAfQAXQEYAAACzgAeApQAQQLdAC0CxgBBAlYAQQJWAEEDBQAtAtMAQQDrAEECLQAeArMAQQISAEEDXwBBAtEAQQMQAC0ChwBBAxwALQKUAEECkQAvAnsAHgLOAEECzwAeA/gAHgLaAB4CxwAeAmQAKAKUACAClABEAi0AIAKUACACVQAgAZ4AIQKUACACVwBEAPEARAFlADwCRwBEAO0ARAOjAEQCVwBEAmEAIAKUAEQClAAgAY0ARAINACsBngAeAmEARAItABIDUQASAkIAEgJdABIB4wAoA5MAEgJsAB4BiQAUAg0AFwIeABQCUwAUAiAAGQItABwB4gAKAjIAIQItABoCsQA8AOIAPAE7ADwA4gA8AR0APADiADwA+wA8APsAPAIyADwCMgA8AOIAPAD+ADwB9ABCAvMAPAGZADwBmQA8APsAPADiADwBPgA8AT4APAFlADwBZQA8AT4APAE+ADwB7wA8ApQAQQMWADwClABBATsAPAE7ADwBzQA8Ac0APAEvAEYBLwBGAU8APAFPADwCZAA8AncAMgLxADwCewA8ApIAKAKeADwCngA8AkQAPAKyAEYCigA8AooAPAIjADwCIwA8AkwAPAJMADwCSwA8An4APAJ+ADwCKwBBA7gAQAOFAD0FCQA8AwIAPALSADwDmQA8AtEAPAMCADwC0wA8A5kAPALRADwE9QA8A6gAPgMGADwCQAA8A1gAPAIIADwCpgA8AggAPAAAAN4A3gEQAWYBrAHmAhQCPAKIArACxgL2AyQDQANwA5YD3gQaBJoE2AUsBU4FhAWkBdIGAAYmBlIGxAdEB4gICAhaCKYJKgl2CaYJ5goUCjYKnAruCzYLogwODFIMqAziDSwNTA16DaINxA3wDjoOfA6aDtwPKg9aD6IP9BAWEIIQzhDmEPwRFBE0EVgRbhGQEcISDBJaEnISihK2Ew4TJBM6E1wTfBOcE7wUDBRaFHwUnhS4FNIU7BUKFRIVKhVaFYgVrBXQFewWCBZYFroXKhduF7IX3hf4GBQYRBhoGNgY7hkEGTAZWhmOGfoaPBpeGtobfhxWHHgcpBzMHPgdGh1GHXYdoh3YHrYfOB+2IDwgviEEIU4AAQAAAIsAWAAKAAQAAQACAFYAmQCNAAABCw4VAAEAAQAAABYBDgABAAAAAAAAADgAAAABAAAAAAABAAkAOAABAAAAAAACAAYAQQABAAAAAAADABoARwABAAAAAAAEABAAYQABAAAAAAAFAA0AcQABAAAAAAAGAA8AfgABAAAAAAAIABEAjQABAAAAAAAJAAoAngABAAAAAAALABkAqAADAAEECQAAAHAAwQADAAEECQABACABMQADAAEECQACAA4BUQADAAEECQADADQBXwADAAEECQAEACABkwADAAEECQAFABoBswADAAEECQAGAB4BzQADAAEECQAIACIB6wADAAEECQAJABQCDQADAAEECQALADICIQADAAEECQAQABICUwADAAEECQARAAwCZUNvcHlyaWdodCCpIDIwMjAgQnl0ZURhbmNlIEdJUCBVRUQuIEFsbCByaWdodHMgcmVzZXJ2ZWQuQnl0ZSBTYW5zTWVkaXVtMS4wMDA7VUtXTjtCeXRlU2Fucy1NZWRpdW1CeXRlIFNhbnMgTWVkaXVtVmVyc2lvbiAxLjAwMEJ5dGVTYW5zLU1lZGl1bUJ5dGVEYW5jZSBHSVAgVUVEU29uZ3lpIExpdWh0dHBzOi8vd3d3LmJ5dGVkYW5jZS5jb20AQwBvAHAAeQByAGkAZwBoAHQAIACpACAAMgAwADIAMAAgAEIAeQB0AGUARABhAG4AYwBlACAARwBJAFAAIABVAEUARAAuACAAQQBsAGwAIAByAGkAZwBoAHQAcwAgAHIAZQBzAGUAcgB2AGUAZAAuAEIAeQB0AGUAIABTAGEAbgBzACAATQBlAGQAaQB1AG0AUgBlAGcAdQBsAGEAcgAxAC4AMAAwADAAOwBVAEsAVwBOADsAQgB5AHQAZQBTAGEAbgBzAC0ATQBlAGQAaQB1AG0AQgB5AHQAZQAgAFMAYQBuAHMAIABNAGUAZABpAHUAbQBWAGUAcgBzAGkAbwBuACAAMQAuADAAMAAwAEIAeQB0AGUAUwBhAG4AcwAtAE0AZQBkAGkAdQBtAEIAeQB0AGUARABhAG4AYwBlACAARwBJAFAAIABVAEUARABTAG8AbgBnAHkAaQAgAEwAaQB1AGgAdAB0AHAAcwA6AC8ALwB3AHcAdwAuAGIAeQB0AGUAZABhAG4AYwBlAC4AYwBvAG0AQgB5AHQAZQAgAFMAYQBuAHMATQBlAGQAaQB1AG0AAAIAAAAAAAD/tQAyAAAAAAAAAAAAAAAAAAAAAAAAAAAAiwAAAAMAJAAlACYAJwAoACkAKgArACwALQAuAC8AMAAxADIAMwA0ADUANgA3ADgAOQA6ADsAPAA9AEQARQBGAEcASABJAEoASwBMAE0ATgBPAFAAUQBSAFMAVABVAFYAVwBYAFkAWgBbAFwAXQECABMAFAAVABYAFwAYABkAGgAbABwAvAARAA8AHQAeAKsABACjACIAogDDAIcADQAGABIAPwEDAQQACwAMAF4AYAA+AEAAEACyALMAQgDEAMUAtAC1ALYAtwC+AL8AhAAHAQUAhQCWAA4A7wDwALgAIACPACEAHwCVAJQAkwCnAGEAQQCSAAgAxgEGAQcBCAEJAQoBCwEMAQ0BDgAjAAkAhgCLAIoAjACDA3lfdAd1bmlGRjAxCmNvbG9uLnNzMDEERXVybwdhcnJvd3VwB3VuaTIxOTcKYXJyb3dyaWdodAd1bmkyMTk4CWFycm93ZG93bgd1bmkyMTk5CWFycm93bGVmdAd1bmkyMTk2CWFycm93Ym90aAAAAAABAAH//wAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAZgBmAF8AXwK8AAACygISAAD/EALK//EC2gIg//H/ArAALCCwAFVYRVkgIEu4AA5RS7AGU1pYsDQbsChZYGYgilVYsAIlYbkIAAgAY2MjYhshIbAAWbAAQyNEsgABAENgQi2wASywIGBmLbACLCMhIyEtsAMsIGSzAxQVAEJDsBNDIGBgQrECFENCsSUDQ7ACQ1R4ILAMI7ACQ0NhZLAEUHiyAgICQ2BCsCFlHCGwAkNDsg4VAUIcILACQyNCshMBE0NgQiOwAFBYZVmyFgECQ2BCLbAELLADK7AVQ1gjISMhsBZDQyOwAFBYZVkbIGQgsMBQsAQmWrIoAQ1DRWNFsAZFWCGwAyVZUltYISMhG4pYILBQUFghsEBZGyCwOFBYIbA4WVkgsQENQ0VjRWFksChQWCGxAQ1DRWNFILAwUFghsDBZGyCwwFBYIGYgiophILAKUFhgGyCwIFBYIbAKYBsgsDZQWCGwNmAbYFlZWRuwAiWwDENjsABSWLAAS7AKUFghsAxDG0uwHlBYIbAeS2G4EABjsAxDY7gFAGJZWWRhWbABK1lZI7AAUFhlWVkgZLAWQyNCWS2wBSwgRSCwBCVhZCCwB0NQWLAHI0KwCCNCGyEhWbABYC2wBiwjISMhsAMrIGSxB2JCILAII0KwBkVYG7EBDUNFY7EBDUOwAWBFY7AFKiEgsAhDIIogirABK7EwBSWwBCZRWGBQG2FSWVgjWSFZILBAU1iwASsbIbBAWSOwAFBYZVktsAcssAlDK7IAAgBDYEItsAgssAkjQiMgsAAjQmGwAmJmsAFjsAFgsAcqLbAJLCAgRSCwDkNjuAQAYiCwAFBYsEBgWWawAWNgRLABYC2wCiyyCQ4AQ0VCKiGyAAEAQ2BCLbALLLAAQyNEsgABAENgQi2wDCwgIEUgsAErI7AAQ7AEJWAgRYojYSBkILAgUFghsAAbsDBQWLAgG7BAWVkjsABQWGVZsAMlI2FERLABYC2wDSwgIEUgsAErI7AAQ7AEJWAgRYojYSBksCRQWLAAG7BAWSOwAFBYZVmwAyUjYUREsAFgLbAOLCCwACNCsw0MAANFUFghGyMhWSohLbAPLLECAkWwZGFELbAQLLABYCAgsA9DSrAAUFggsA8jQlmwEENKsABSWCCwECNCWS2wESwgsBBiZrABYyC4BABjiiNhsBFDYCCKYCCwESNCIy2wEixLVFixBGREWSSwDWUjeC2wEyxLUVhLU1ixBGREWRshWSSwE2UjeC2wFCyxABJDVVixEhJDsAFhQrARK1mwAEOwAiVCsQ8CJUKxEAIlQrABFiMgsAMlUFixAQBDYLAEJUKKiiCKI2GwECohI7ABYSCKI2GwECohG7EBAENgsAIlQrACJWGwECohWbAPQ0ewEENHYLACYiCwAFBYsEBgWWawAWMgsA5DY7gEAGIgsABQWLBAYFlmsAFjYLEAABMjRLABQ7AAPrIBAQFDYEItsBUsALEAAkVUWLASI0IgRbAOI0KwDSOwAWBCILAUI0IgYLABYbcYGAEAEQATAEJCQopgILAUQ2CwFCNCsRQIK7CLKxsiWS2wFiyxABUrLbAXLLEBFSstsBgssQIVKy2wGSyxAxUrLbAaLLEEFSstsBsssQUVKy2wHCyxBhUrLbAdLLEHFSstsB4ssQgVKy2wHyyxCRUrLbArLCMgsBBiZrABY7AGYEtUWCMgLrABXRshIVktsCwsIyCwEGJmsAFjsBZgS1RYIyAusAFxGyEhWS2wLSwjILAQYmawAWOwJmBLVFgjIC6wAXIbISFZLbAgLACwDyuxAAJFVFiwEiNCIEWwDiNCsA0jsAFgQiBgsAFhtRgYAQARAEJCimCxFAgrsIsrGyJZLbAhLLEAICstsCIssQEgKy2wIyyxAiArLbAkLLEDICstsCUssQQgKy2wJiyxBSArLbAnLLEGICstsCgssQcgKy2wKSyxCCArLbAqLLEJICstsC4sIDywAWAtsC8sIGCwGGAgQyOwAWBDsAIlYbABYLAuKiEtsDAssC8rsC8qLbAxLCAgRyAgsA5DY7gEAGIgsABQWLBAYFlmsAFjYCNhOCMgilVYIEcgILAOQ2O4BABiILAAUFiwQGBZZrABY2AjYTgbIVktsDIsALEAAkVUWLEOBkVCsAEWsDEqsQUBFUVYMFkbIlktsDMsALAPK7EAAkVUWLEOBkVCsAEWsDEqsQUBFUVYMFkbIlktsDQsIDWwAWAtsDUsALEOBkVCsAFFY7gEAGIgsABQWLBAYFlmsAFjsAErsA5DY7gEAGIgsABQWLBAYFlmsAFjsAErsAAWtAAAAAAARD4jOLE0ARUqIS2wNiwgPCBHILAOQ2O4BABiILAAUFiwQGBZZrABY2CwAENhOC2wNywuFzwtsDgsIDwgRyCwDkNjuAQAYiCwAFBYsEBgWWawAWNgsABDYbABQ2M4LbA5LLECABYlIC4gR7AAI0KwAiVJiopHI0cjYSBYYhshWbABI0KyOAEBFRQqLbA6LLAAFrAXI0KwBCWwBCVHI0cjYbEMAEKwC0MrZYouIyAgPIo4LbA7LLAAFrAXI0KwBCWwBCUgLkcjRyNhILAGI0KxDABCsAtDKyCwYFBYILBAUVizBCAFIBuzBCYFGllCQiMgsApDIIojRyNHI2EjRmCwBkOwAmIgsABQWLBAYFlmsAFjYCCwASsgiophILAEQ2BkI7AFQ2FkUFiwBENhG7AFQ2BZsAMlsAJiILAAUFiwQGBZZrABY2EjICCwBCYjRmE4GyOwCkNGsAIlsApDRyNHI2FgILAGQ7ACYiCwAFBYsEBgWWawAWNgIyCwASsjsAZDYLABK7AFJWGwBSWwAmIgsABQWLBAYFlmsAFjsAQmYSCwBCVgZCOwAyVgZFBYIRsjIVkjICCwBCYjRmE4WS2wPCywABawFyNCICAgsAUmIC5HI0cjYSM8OC2wPSywABawFyNCILAKI0IgICBGI0ewASsjYTgtsD4ssAAWsBcjQrADJbACJUcjRyNhsABUWC4gPCMhG7ACJbACJUcjRyNhILAFJbAEJUcjRyNhsAYlsAUlSbACJWG5CAAIAGNjIyBYYhshWWO4BABiILAAUFiwQGBZZrABY2AjLiMgIDyKOCMhWS2wPyywABawFyNCILAKQyAuRyNHI2EgYLAgYGawAmIgsABQWLBAYFlmsAFjIyAgPIo4LbBALCMgLkawAiVGsBdDWFAbUllYIDxZLrEwARQrLbBBLCMgLkawAiVGsBdDWFIbUFlYIDxZLrEwARQrLbBCLCMgLkawAiVGsBdDWFAbUllYIDxZIyAuRrACJUawF0NYUhtQWVggPFkusTABFCstsEMssDorIyAuRrACJUawF0NYUBtSWVggPFkusTABFCstsEQssDsriiAgPLAGI0KKOCMgLkawAiVGsBdDWFAbUllYIDxZLrEwARQrsAZDLrAwKy2wRSywABawBCWwBCYgICBGI0dhsAwjQi5HI0cjYbALQysjIDwgLiM4sTABFCstsEYssQoEJUKwABawBCWwBCUgLkcjRyNhILAGI0KxDABCsAtDKyCwYFBYILBAUVizBCAFIBuzBCYFGllCQiMgR7AGQ7ACYiCwAFBYsEBgWWawAWNgILABKyCKimEgsARDYGQjsAVDYWRQWLAEQ2EbsAVDYFmwAyWwAmIgsABQWLBAYFlmsAFjYbACJUZhOCMgPCM4GyEgIEYjR7ABKyNhOCFZsTABFCstsEcssQA6Ky6xMAEUKy2wSCyxADsrISMgIDywBiNCIzixMAEUK7AGQy6wMCstsEkssAAVIEewACNCsgABARUUEy6wNiotsEossAAVIEewACNCsgABARUUEy6wNiotsEsssQABFBOwNyotsEwssDkqLbBNLLAAFkUjIC4gRoojYTixMAEUKy2wTiywCiNCsE0rLbBPLLIAAEYrLbBQLLIAAUYrLbBRLLIBAEYrLbBSLLIBAUYrLbBTLLIAAEcrLbBULLIAAUcrLbBVLLIBAEcrLbBWLLIBAUcrLbBXLLMAAABDKy2wWCyzAAEAQystsFksswEAAEMrLbBaLLMBAQBDKy2wWyyzAAABQystsFwsswABAUMrLbBdLLMBAAFDKy2wXiyzAQEBQystsF8ssgAARSstsGAssgABRSstsGEssgEARSstsGIssgEBRSstsGMssgAASCstsGQssgABSCstsGUssgEASCstsGYssgEBSCstsGcsswAAAEQrLbBoLLMAAQBEKy2waSyzAQAARCstsGosswEBAEQrLbBrLLMAAAFEKy2wbCyzAAEBRCstsG0sswEAAUQrLbBuLLMBAQFEKy2wbyyxADwrLrEwARQrLbBwLLEAPCuwQCstsHEssQA8K7BBKy2wciywABaxADwrsEIrLbBzLLEBPCuwQCstsHQssQE8K7BBKy2wdSywABaxATwrsEIrLbB2LLEAPSsusTABFCstsHcssQA9K7BAKy2weCyxAD0rsEErLbB5LLEAPSuwQistsHossQE9K7BAKy2weyyxAT0rsEErLbB8LLEBPSuwQistsH0ssQA+Ky6xMAEUKy2wfiyxAD4rsEArLbB/LLEAPiuwQSstsIAssQA+K7BCKy2wgSyxAT4rsEArLbCCLLEBPiuwQSstsIMssQE+K7BCKy2whCyxAD8rLrEwARQrLbCFLLEAPyuwQCstsIYssQA/K7BBKy2whyyxAD8rsEIrLbCILLEBPyuwQCstsIkssQE/K7BBKy2wiiyxAT8rsEIrLbCLLLILAANFUFiwBhuyBAIDRVgjIRshWVlCK7AIZbADJFB4sQUBFUVYMFktAAAAAEu4AMhSWLEBAY5ZsAG5CAAIAGNwsQAHQrIXAQAqsQAHQrMMCAEKKrEAB0KzFAYBCiqxAAhCugNAAAEACyqxAAlCugBAAAEACyq5AAMAAESxJAGIUViwQIhYuQADAGREsSgBiFFYuAgAiFi5AAMAAERZG7EnAYhRWLoIgAABBECIY1RYuQADAABEWVlZWVmzDgYBDiq4Af+FsASNsQIARLMFZAYAREQAAAAAAQAAAAA=)format("truetype");font-style:normal;font-weight:500;font-display:swap}: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:0 0% 100%;--panel:0 0% 100%;--sidebar:0 0% 98%;--sidebar-item-hover:0 0% 0% / .043;--sidebar-foreground:240 5.9% 10%;--sidebar-item-foreground:240 5.3% 26.1%;--sidebar-section-title:240 5.3% 26.1%;--sidebar-border:0 0% 0% / .075;--feature-link:208 100% 47.45%;color-scheme:light;font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,sans-serif}html[lang=en-US]{font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}*{box-sizing:border-box}html,body,#root{overscroll-behavior:none;height:100%;margin:0;overflow:hidden}#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{flex-shrink:0;width:16px;height:16px}.spin{animation:1s linear infinite spin}@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:0 0}::-webkit-scrollbar-thumb{background:hsl(var(--foreground) / .18);background-clip:content-box;border:2px solid #0000;border-radius:999px}::-webkit-scrollbar-thumb:hover{background:hsl(var(--foreground) / .32);background-clip:content-box}::-webkit-scrollbar-corner{background:0 0}.layout{height:100dvh;min-height:0;display:flex;overflow:hidden}.main-shell{flex-direction:column;flex:1;min-width:0;min-height:0;display:flex}.sidebar{background:hsl(var(--sidebar));width:240px;height:100%;min-height:0;color:hsl(var(--sidebar-foreground));box-shadow:inset -1px 0 hsl(var(--sidebar-border));flex-direction:column;flex-shrink:0;transition:width .22s cubic-bezier(.22,1,.36,1);display:flex;position:relative}.sidebar.is-collapsed{width:56px}.sidebar-top{flex-direction:column;padding:0 8px;display:flex}.sidebar-brand-row{align-items:center;gap:6px;height:64px;min-height:64px;padding:0 0 0 10px;display:flex}.sidebar:not(.is-collapsed) .sidebar-top{padding-inline:8px}.sidebar:not(.is-collapsed) .sidebar-brand-row{padding-right:0}.brand{min-width:0;color:inherit;cursor:pointer;letter-spacing:0;text-align:left;background:0 0;border:0;flex:1;align-items:center;gap:6px;padding:0;font-family:inherit;font-size:15px;font-weight:500;line-height:1.4;display:flex}.brand-title{text-overflow:ellipsis;white-space:nowrap;font-family:Byte Sans,ui-sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;overflow:hidden}.brand-logo,.brand-title,.brand{cursor:pointer}.login-brand-logo,.login-brand,.login-title{cursor:text}.sidebar-collapse-toggle{--sidebar-collapse-frame-stroke:#0c0d0e;--sidebar-collapse-divider-fill:#80838a;width:32px;height:32px;color:hsl(var(--sidebar-section-title));cursor:pointer;background:0 0;border:0;border-radius:999px;flex:0 0 32px;justify-content:center;align-items:center;padding:0;transition:background .12s,color .12s;display:inline-flex}.sidebar-collapse-toggle:hover{background:hsl(var(--sidebar-item-hover));color:hsl(var(--sidebar-foreground))}.sidebar-collapse-toggle .icon{width:18px;height:18px}.sidebar-panel-glyph__divider{fill:var(--sidebar-collapse-divider-fill);stroke:var(--sidebar-collapse-frame-stroke)}.sidebar-panel-glyph__frame{stroke:var(--sidebar-collapse-frame-stroke)}.sidebar.is-collapsed .sidebar-brand-row{justify-content:center;padding-inline:0}.sidebar.is-collapsed .brand{display:none}.brand-logo,.login-brand-logo{object-fit:contain;display:block}.brand-logo{flex:0 0 18px;width:18px;min-width:18px;max-width:18px;height:18px;min-height:18px;max-height:18px}.login-brand-logo{flex:0 0 20px;width:20px;min-width:20px;max-width:20px;height:20px;min-height:20px;max-height:20px}.sidebar-nav{flex-direction:column;gap:4px;width:100%;display:flex}.new-chat{width:100%;height:36px;min-height:36px;color:hsl(var(--sidebar-item-foreground));font:inherit;letter-spacing:0;cursor:pointer;background:0 0;border:none;border-radius:8px;align-items:center;gap:8px;padding:7px 10px;font-size:14px;font-weight:400;line-height:22px;transition:background .12s;display:flex}.new-chat .icon{flex:0 0 16px;width:16px;height:16px}.new-chat:hover,.new-chat.is-active{background:hsl(var(--sidebar-item-hover))}.new-chat.is-active{color:hsl(var(--sidebar-foreground));font-weight:500}.sidebar-agent-face{overflow:visible}.sidebar-agent-face__eye{transform-box:fill-box;transform-origin:50%;animation:1s ease-in-out infinite sidebar-agent-blink}@keyframes sidebar-agent-blink{0%,42%,58%,to{transform:scaleY(1)}50%{transform:scaleY(.08)}}@media (prefers-reduced-motion:reduce){.sidebar-agent-face__eye{animation:none}}.studio-update-action{color:#fff;min-width:104px;min-height:40px;box-shadow:none;-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px);cursor:pointer;font:inherit;background:#111;border:0;border-radius:999px;justify-content:center;align-items:center;gap:7px;padding:0 17px;font-size:12.5px;font-weight:650;transition:background-color .24s cubic-bezier(.22,1,.36,1),color .18s,box-shadow .24s,-webkit-backdrop-filter .24s,backdrop-filter .24s;display:inline-flex}.studio-update-action:not(:disabled):hover{color:#fff;background:#29292b;border:0;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{white-space:nowrap;align-self:center;gap:0;width:36px;height:36px;min-height:36px;padding:9px;overflow:hidden}.sidebar.is-collapsed .sidebar-nav-label,.sidebar.is-collapsed .sidebar-history{display:none}.agentsel{--agentsel-available-width: calc(100vw - 254px) ;z-index:32;width:min(320px,var(--agentsel-available-width));background:0 0;border:0;flex-flow:wrap;align-content:stretch;align-items:stretch;gap:8px;margin-left:6px;animation:.16s ease-out agentsel-in;display:flex;position:absolute;top:8px;left:100%;overflow:visible;container-type:inline-size}.agentsel.has-detail{width:min(688px,var(--agentsel-available-width))}.agentsel--navbar{z-index:44;width:min(clamp(264px,26vw,288px),100vw - 48px);height:min(640px,100dvh - 74px);margin-left:0;position:absolute;top:calc(100% + 7px);left:0}.agentsel--navbar .agentsel-main{flex-basis:auto;width:100%}.sidebar.is-collapsed .agentsel{--agentsel-available-width: calc(100vw - 70px) }.agentsel-main{border:1px solid hsl(var(--border));background:hsl(var(--background));width:320px;min-width:min(240px,100%);height:100%;min-height:0;max-height:100%;box-shadow:0 12px 40px hsl(var(--foreground) / .14);border-radius:12px;flex-direction:column;flex:320px;display:flex;overflow:hidden}.agentsel-detail{border:1px solid hsl(var(--border));background:hsl(var(--background));width:360px;min-width:min(280px,100%);height:100%;min-height:0;max-height:100%;box-shadow:0 12px 40px hsl(var(--foreground) / .14);border-radius:12px;flex-direction:column;flex:360px;display:flex;overflow:hidden}.agentsel-preview{animation:.16s cubic-bezier(.22,1,.36,1) agentsel-preview-in}@container (max-width:527px){.agentsel.has-detail>.agentsel-main,.agentsel.has-detail>.agentsel-detail{height:calc(50% - 4px);max-height:calc(50% - 4px)}}.agentsel-preview-head{padding:7px 14px}.agentsel-detail-tabs{border:1px solid hsl(var(--border) / .58);background:hsl(var(--secondary) / .58);border-radius:9px;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;height:36px;padding:3px;display:grid;position:relative;overflow:hidden}.agentsel-detail-tabs-slider{z-index:0;border:1px solid hsl(var(--border) / .72);background:hsl(var(--background));border-radius:6px;width:calc(50% - 3px);transition:transform .24s cubic-bezier(.22,1,.36,1);position:absolute;top:3px;bottom:3px;left:3px;transform:translate(0)}.agentsel-detail-tabs.is-runtime .agentsel-detail-tabs-slider{transform:translate(100%)}.agentsel-detail-tabs button{z-index:1;min-width:0;color:hsl(var(--muted-foreground));font:inherit;text-align:center;cursor:pointer;background:0 0;border:0;border-radius:6px;font-size:12px;font-weight:550;transition:color .16s;position:relative}.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{flex-direction:column;flex:1;min-width:0;min-height:0;display:flex}.agentsel-tab-panel[hidden]{display:none}.agentsel-detail-body{overscroll-behavior-y:contain;scrollbar-gutter:stable;flex:1;min-width:0;min-height:0;padding:12px 14px;overflow:hidden auto}.agentsel-panel-state{min-height:120px;color:hsl(var(--muted-foreground));justify-content:center;align-items:center;gap:7px;font-size:12.5px;display:flex}.agentsel-panel-state .icon{width:15px;height:15px}.agentsel-panel-empty{text-align:center;color:hsl(var(--muted-foreground));overflow-wrap:anywhere;flex-direction:column;gap:6px;padding:24px 8px;font-size:12.5px;display:flex}.agentsel-panel-empty small{color:hsl(var(--muted-foreground) / .75);-webkit-line-clamp:3;-webkit-box-orient:vertical;font-size:11px;line-height:1.45;display:-webkit-box;overflow:hidden}.agentsel-identity,.agentsel-runtime-identity{align-items:flex-start;gap:10px;min-width:0;display:flex}.agentsel-identity{padding-bottom:12px}.agentsel-identity-icon,.agentsel-runtime-identity>.icon{width:18px;height:18px;color:hsl(var(--muted-foreground));flex-shrink:0;margin-top:1px}.agentsel-identity-copy,.agentsel-runtime-identity>div{flex-direction:column;flex:1;gap:3px;min-width:0;display:flex}.agentsel-identity-copy strong,.agentsel-runtime-identity strong{color:hsl(var(--foreground));text-overflow:ellipsis;white-space:nowrap;font-size:13.5px;font-weight:650;overflow:hidden}.agentsel-identity-copy span,.agentsel-runtime-identity span{color:hsl(var(--muted-foreground));text-overflow:ellipsis;white-space:nowrap;font-size:11.5px;overflow:hidden}.agentsel-runtime-identity{border-bottom:1px solid hsl(var(--border));margin-bottom:14px;padding-bottom:12px}.agentsel-info-section{border-top:1px solid hsl(var(--border));min-width:0;padding:11px 0}.agentsel-info-section h3{color:hsl(var(--muted-foreground));align-items:center;gap:6px;margin:0 0 8px;font-size:11.5px;font-weight:600;display:flex}.agentsel-info-section h3 .icon{width:13px;height:13px}.agentsel-description{white-space:pre-wrap;overflow-wrap:anywhere;max-height:104px;color:hsl(var(--foreground));margin:0;font-size:12.5px;line-height:1.65;overflow-y:auto}.agentsel-chips{flex-wrap:wrap;gap:5px;min-width:0;display:flex}.agentsel-chip{border:1px solid hsl(var(--border));background:hsl(var(--canvas) / .7);max-width:100%;color:hsl(var(--foreground));text-overflow:ellipsis;white-space:nowrap;border-radius:5px;padding:3px 7px;font-size:11.5px;line-height:1.35;display:block;overflow:hidden}.agentsel-info-list{flex-direction:column;gap:6px;min-width:0;display:flex}.agentsel-info-list-item{background:hsl(var(--canvas) / .72);border-radius:6px;flex-direction:column;gap:2px;min-width:0;padding:7px 8px;display:flex}.agentsel-info-list-item>strong,.agentsel-component-head>strong{text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:600;overflow:hidden}.agentsel-info-list-item>span{color:hsl(var(--muted-foreground));overflow-wrap:anywhere;-webkit-line-clamp:3;-webkit-box-orient:vertical;font-size:11px;line-height:1.45;display:-webkit-box;overflow:hidden}.agentsel-component-head{align-items:center;gap:8px;min-width:0;display:flex}.agentsel-component-head>strong{flex:1;min-width:0}.agentsel-component-head>span{background:hsl(var(--foreground) / .06);color:hsl(var(--muted-foreground));border-radius:4px;flex-shrink:0;padding:1px 5px;font-size:10px}.agentsel-kv{flex-direction:column;gap:8px;margin:0;display:flex}.agentsel-kv-row{grid-template-columns:52px 1fr;gap:8px;font-size:12.5px;display:grid}.agentsel-kv-row dt{color:hsl(var(--muted-foreground))}.agentsel-kv-row dd{min-width:0;color:hsl(var(--foreground));overflow-wrap:anywhere;margin:0}.agentsel-envs{margin-top:14px}.agentsel-envs-head{color:hsl(var(--muted-foreground));margin-bottom:6px;font-size:12px;font-weight:600}.agentsel-env{flex-direction:column;gap:1px;margin-bottom:6px;display:flex}.agentsel-env-k{overflow-wrap:anywhere;color:hsl(var(--muted-foreground));font-family:inherit;font-size:11px}.agentsel-env-v{overflow-wrap:anywhere;color:hsl(var(--foreground));font-family:inherit;font-size:11.5px}.agentsel-head-actions{align-items:center;gap:2px;display:flex}.agentsel-pager{flex:0 0 36px;justify-content:center;align-items:center;gap:14px;padding:6px 10px 0;display:flex}.agentsel-pager button{cursor:pointer;color:hsl(var(--muted-foreground));background:0 0;border:none;padding:2px;display:flex}.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{color:hsl(var(--muted-foreground));text-align:center;min-width:40px;font-size:13px}@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{box-sizing:border-box;border-bottom:1px solid hsl(var(--border));flex-shrink:0;justify-content:space-between;align-items:center;height:52px;padding:0 14px;display:flex}.agentsel-title{text-overflow:ellipsis;white-space:nowrap;align-items:center;gap:8px;min-width:0;font-size:14px;font-weight:600;display:flex;overflow:hidden}.agentsel-title .icon{width:17px;height:17px}.agentsel-refresh{cursor:pointer;color:hsl(var(--muted-foreground));background:0 0;border:none;border-radius:6px;padding:4px;display:flex}.agentsel-refresh:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.agentsel-refresh .icon{width:16px;height:16px}.agentsel-body{overscroll-behavior-y:contain;scrollbar-gutter:stable;flex:1;min-height:0;padding:10px;overflow-y:auto}.agentsel-body--cloud{scrollbar-gutter:auto;flex-direction:column;display:flex;overflow:hidden}.agentsel-tools{flex-direction:column;gap:8px;margin-bottom:10px;display:flex}.agentsel-search{border:1px solid hsl(var(--border));border-radius:8px;align-items:center;gap:8px;padding:7px 10px;display:flex}.agentsel-search .icon{width:15px;height:15px;color:hsl(var(--muted-foreground))}.agentsel-search input{font:inherit;color:hsl(var(--foreground));background:0 0;border:none;outline:none;flex:1;font-size:13px}.agentsel-mine{color:hsl(var(--muted-foreground));cursor:pointer;align-items:center;gap:7px;font-size:12.5px;display:flex}.agentsel-list{flex-direction:column;gap:4px;margin:0;padding:0;list-style:none;display:flex}.agentsel-listwrap{min-height:220px;position:relative}.agentsel-body--cloud .agentsel-listwrap{overscroll-behavior-y:contain;scrollbar-gutter:auto;flex:1;min-height:0;overflow-y:auto}.agentsel-loading{color:hsl(var(--muted-foreground));background:hsl(var(--background) / .72);-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);border-radius:8px;justify-content:center;align-items:center;gap:8px;font-size:13px;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.agentsel-loading .icon{width:16px;height:16px}.agentsel-item{width:100%;min-height:46px;color:hsl(var(--foreground));font:inherit;text-align:left;background:0 0;border:none;border-radius:8px;align-items:center;gap:9px;padding:4px 0;font-size:13.5px;display:flex}.agentsel-main button.agentsel-item{cursor:pointer;min-height:0;padding:9px 10px}.agentsel-item:hover{background:hsl(var(--foreground) / .05);box-shadow:none;transform:none}.agentsel-runtime-item:hover{background:0 0}.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:0 0}.agentsel-item .icon{width:16px;height:16px;color:hsl(var(--muted-foreground));flex-shrink:0}.agentsel-item-main{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.agentsel-item-name{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:13px;font-weight:550;overflow:hidden}.agentsel-item-meta{align-items:center;gap:4px;min-width:0;display:flex}.agentsel-item-actions{flex-shrink:0;align-items:center;gap:1px;display:flex}.agentsel-connect,.agentsel-info{color:hsl(var(--muted-foreground));font:inherit;cursor:pointer;background:0 0;border:0;border-radius:6px}.agentsel-connect{min-width:38px;height:28px;padding:0 5px;font-size:11.5px;font-weight:550}.agentsel-info{place-items:center;width:28px;height:28px;padding:0;display:grid}.agentsel-connect:hover:not(:disabled),.agentsel-info:hover{background:hsl(var(--foreground) / .07);color:hsl(var(--foreground));box-shadow:none}.agentsel-info.active{color:hsl(var(--foreground));box-shadow:none;background:0 0}.agentsel-connect:disabled{opacity:.55;cursor:default}.agentsel-info .icon{width:15px;height:15px}.agentsel-rt{flex-direction:column;display:flex}.agentsel-rt-row{width:100%;color:hsl(var(--foreground));font:inherit;cursor:pointer;text-align:left;background:0 0;border:none;border-radius:8px;align-items:center;gap:7px;padding:9px 8px;font-size:13.5px;display:flex}.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{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.runtime-owner-badge{color:#0b68cb;background:#007bff1f;border-radius:999px;flex-shrink:0;padding:1px 6px;font-size:10px;font-weight:600}.agentsel-status{border-radius:999px;flex-shrink:0;padding:1px 6px;font-size:10px}.agentsel-status.is-ok{color:#238b49;background:#21c45d24}.agentsel-status.is-warn{color:#b86614;background:#f59f0a29}.agentsel-status.is-bad{color:#ca2b2b;background:#dc282824}.agentsel-status.is-muted{background:hsl(var(--muted));color:hsl(var(--muted-foreground))}.agentsel-apps{flex-direction:column;gap:2px;padding:2px 0 6px 20px;display:flex}.agentsel-app{width:100%;color:hsl(var(--foreground));font:inherit;cursor:pointer;text-align:left;background:0 0;border:none;border-radius:7px;align-items:center;gap:8px;padding:7px 10px;font-size:13px;display:flex}.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{color:hsl(var(--muted-foreground));align-items:center;gap:7px;padding:7px 10px;font-size:12.5px;display:flex}.agentsel-apps-note .icon{width:14px;height:14px}.agentsel-apps-note--muted{font-style:italic}.agentsel-empty{text-align:center;color:hsl(var(--muted-foreground));padding:24px 10px;font-size:13px}.agentsel-error{overflow-wrap:anywhere;color:#bd2828;white-space:pre-wrap;background:#dc282814;border-radius:8px;min-width:0;max-width:100%;margin:4px 0 10px;padding:8px 10px;font-size:12.5px;overflow:hidden}.agentsel-more{border:1px dashed hsl(var(--border));width:100%;color:hsl(var(--muted-foreground));font:inherit;cursor:pointer;background:0 0;border-radius:8px;margin-top:8px;padding:9px;font-size:13px}.agentsel-more:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.sidebar-history{flex-direction:column;flex:1;min-height:0;margin-top:20px;display:flex}.history-head{letter-spacing:0;height:32px;min-height:32px;color:hsl(var(--sidebar-section-title));justify-content:space-between;align-items:center;padding:0 18px;font-size:13px;font-weight:400;line-height:22px;display:flex}.history-refresh{cursor:pointer;color:hsl(var(--sidebar-section-title));background:0 0;border:none;padding:2px;display:flex}.history-refresh:hover{color:hsl(var(--sidebar-foreground))}.history-new-chat{width:24px;height:24px;color:hsl(var(--sidebar-section-title));cursor:pointer;background:0 0;border:0;border-radius:6px;justify-content:center;align-items:center;margin:-4px 0;padding:0;transition:color .12s;display:inline-flex}.history-new-chat .icon{width:15px;height:15px}.history-new-chat:hover{color:hsl(var(--sidebar-foreground));background:0 0}.history-list{flex-direction:column;flex:1;gap:4px;padding:0 8px 12px;display:flex;overflow-y:auto}.history-empty{color:hsl(var(--sidebar-section-title));text-align:center;padding:16px 8px;font-size:13px}.history-error{background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));border-radius:8px;margin:4px 0 8px;padding:8px 10px;font-size:12px;line-height:1.5}.history-item{border-radius:8px;align-items:center;transition:background .12s;display:flex;position:relative}.history-item:hover,.history-item.active{background:hsl(var(--sidebar-item-hover))}.history-item-btn{text-align:left;min-width:0;min-height:36px;color:hsl(var(--sidebar-item-foreground));font:inherit;cursor:pointer;background:0 0;border:none;flex:1;align-items:center;gap:8px;padding:7px 10px;font-size:14px;font-weight:400;line-height:22px;display:flex}.history-item.active .history-item-btn{color:hsl(var(--sidebar-foreground))}.history-title{white-space:nowrap;text-overflow:clip;--history-title-left-fade:0px;--history-title-right-fade:0px;--history-title-translate:0px;--history-title-duration:4.8s;min-width:0;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 var(--history-title-left-fade),#000 calc(100% - var(--history-title-right-fade)),transparent 100%);mask-image:linear-gradient(to right,transparent 0,#000 var(--history-title-left-fade),#000 calc(100% - var(--history-title-right-fade)),transparent 100%);flex:1;overflow:hidden}.history-title.is-overflowing{--history-title-right-fade:20px}.history-title-text{min-width:max-content;display:inline-block;transform:translate(0)}.history-item:hover .history-title.is-overflowing,.history-item:focus-within .history-title.is-overflowing{--history-title-left-fade:16px}.history-item:hover .history-title.is-overflowing .history-title-text,.history-item:focus-within .history-title.is-overflowing .history-title-text{animation:history-title-marquee var(--history-title-duration) cubic-bezier(.45,0,.25,1) .24s infinite;will-change:transform}@keyframes history-title-marquee{0%,12%{transform:translate(0)}68%,82%{transform:translate3d(var(--history-title-translate),0,0)}to{transform:translate(0)}}.history-current-badge{background:hsl(var(--sidebar-item-hover));color:hsl(var(--sidebar-section-title));border-radius:999px;flex:none;padding:2px 5px;font-size:10px;font-weight:600;line-height:1.2}.history-item-btn:focus-visible,.history-more:focus-visible,.history-load-more:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:1px}.history-item-btn:disabled,.history-more:disabled{cursor:wait;opacity:.58}.history-evaluating-status{color:#956718;flex-shrink:0;align-items:center;gap:5px;font-size:10.5px;font-weight:600;line-height:1;display:inline-flex}.history-evaluating{background:#f59f0a;border-radius:50%;flex-shrink:0;width:7px;height:7px;animation:1.4s ease-in-out infinite history-evaluation-pulse;box-shadow:0 0 #f59f0a6b}@keyframes history-evaluation-pulse{0%,to{box-shadow:0 0 #f59f0a6b}50%{box-shadow:0 0 0 4px #f59f0a00}}@media (prefers-reduced-motion:reduce){.history-title-text{animation:none!important;transform:none!important}.history-evaluating{box-shadow:none;animation:none}}.history-action-slot{flex:0 0 32px;grid-template-columns:28px 4px;align-items:center;width:32px;height:36px;display:grid}.history-action-slot>.history-more,.history-streaming-indicator{grid-area:1/1}.history-streaming-indicator{color:hsl(var(--muted-foreground));pointer-events:none;opacity:1;justify-self:center;transition:opacity .12s ease-out}.history-more{width:28px;height:28px;color:hsl(var(--sidebar-section-title));cursor:pointer;opacity:0;background:0 0;border:none;border-radius:6px;flex-shrink:0;justify-content:center;align-items:center;margin-right:4px;transition:opacity .12s,background .12s;display:flex}.history-action-slot>.history-more{margin-right:0}.history-item:hover .history-more,.history-action-slot:focus-within .history-more{opacity:1}.history-item:hover .history-streaming-indicator,.history-action-slot:focus-within .history-streaming-indicator{opacity:0}.history-more:hover{background:hsl(var(--sidebar-item-hover));color:hsl(var(--sidebar-foreground))}.history-load-more{min-height:32px;color:hsl(var(--sidebar-section-title));font:inherit;cursor:pointer;background:0 0;border:0;border-radius:7px;margin-top:6px;font-size:12px;font-weight:550}.history-load-more:hover:not(:disabled){background:hsl(var(--sidebar-item-hover));color:hsl(var(--sidebar-foreground))}.history-load-more:disabled{cursor:wait;opacity:.6}.menu-scrim{z-index:30;position:fixed;top:0;right:0;bottom:0;left:0}.history-menu{z-index:31;background:hsl(var(--background));border:1px solid hsl(var(--border));min-width:120px;box-shadow:0 6px 20px hsl(var(--foreground) / .12);border-radius:8px;margin-top:2px;padding:4px;position:absolute;top:100%;right:4px}.menu-item{width:100%;font:inherit;cursor:pointer;color:hsl(var(--foreground));background:0 0;border:none;border-radius:6px;align-items:center;gap:8px;padding:7px 10px;font-size:13px;display:flex}.menu-item:hover{background:hsl(var(--accent))}.menu-item--danger{color:hsl(var(--destructive))}.menu-item .icon{width:15px;height:15px}.main{background:hsl(var(--panel));border:0;border-radius:0;flex-direction:column;flex:1;min-width:0;min-height:0;margin:0;display:flex;position:relative;overflow:hidden}.error{z-index:3;border-radius:var(--radius);background:hsl(var(--destructive) / .1);width:calc(100% - 32px);max-width:768px;color:hsl(var(--destructive));overflow-wrap:anywhere;white-space:pre-wrap;margin:10px auto 0;padding:10px 12px;font-size:13px;position:relative}.case-return-bar{flex:none;justify-content:center;padding:12px 16px 0;display:flex}.case-return-bar button{border:1px solid hsl(var(--border));background:hsl(var(--background));min-height:32px;color:hsl(var(--foreground));cursor:pointer;font:inherit;box-shadow:0 1px 2px hsl(var(--foreground) / .05);border-radius:999px;align-items:center;gap:7px;padding:0 11px;font-size:12px;font-weight:620;display:inline-flex}.case-return-bar button:hover{background:hsl(var(--secondary) / .55)}.case-return-bar svg{width:14px;height:14px}.transcript{flex:1;padding:28px 16px 8px;overflow-y:auto}.transcript.is-streaming{overflow-anchor:none}.welcome{flex-direction:column;flex:1;justify-content:center;align-items:center;gap:32px;padding:0 16px clamp(88px,16vh,136px);display:flex;position:relative}.welcome-primary{flex-direction:column;align-items:center;gap:32px;width:100%;display:flex;position:relative}.welcome-heading{z-index:10;flex-direction:column;align-items:center;gap:72px;display:flex;position:relative}.welcome-feature-pill{background:hsl(var(--muted));height:36px;color:hsl(var(--muted-foreground));white-space:nowrap;border-radius:999px;align-items:center;gap:12px;padding:0 16px;font-size:13px;font-weight:500;line-height:1;display:inline-flex;position:relative}.welcome-feature-divider{background:hsl(var(--border));width:1px;height:16px}.welcome-feature-link{-webkit-appearance:none;-moz-appearance:none;appearance:none;color:hsl(var(--feature-link));font:inherit;line-height:inherit;cursor:pointer;background:0 0;border:0;padding:0}.welcome-feature-link:focus-visible{outline:2px solid hsl(var(--feature-link) / .35);outline-offset:3px;border-radius:3px}.welcome-feature-pill:has(.studio-update-trigger--feature)>.welcome-feature-link:not(.studio-update-trigger--feature),.welcome-feature-pill:has(.studio-update-trigger--feature)>.welcome-feature-popover{display:none}.welcome-feature-popover{z-index:40;border:1px solid hsl(var(--border));background:hsl(var(--background));width:min(340px,100vw - 32px);box-shadow:0 14px 36px hsl(var(--foreground) / .12);color:hsl(var(--foreground));text-align:left;white-space:normal;opacity:0;pointer-events:none;border-radius:14px;padding:16px;transition:opacity .16s,transform .16s;position:absolute;top:50%;left:calc(100% + 12px);transform:translate(-4px,-50%)}.welcome-feature-pill:hover .welcome-feature-popover,.welcome-feature-pill:focus-within .welcome-feature-popover{opacity:1;pointer-events:auto;transform:translateY(-50%)}.welcome-feature-popover>strong{margin-bottom:12px;font-size:13px;font-weight:600;display:block}.welcome-feature-popover ul{overscroll-behavior:contain;scrollbar-gutter:stable;max-height:min(220px,32vh);margin:0;padding:0 4px 0 18px;list-style:outside;display:block;overflow-y:auto}.welcome-feature-popover li{color:hsl(var(--muted-foreground));font-size:12px;line-height:1.55;display:list-item}.welcome-feature-popover li+li{margin-top:8px}@media (max-width:900px){.welcome-feature-popover{top:calc(100% + 10px);left:50%;transform:translate(-50%,-4px)}.welcome-feature-pill:hover .welcome-feature-popover,.welcome-feature-pill:focus-within .welcome-feature-popover{transform:translate(-50%)}}.welcome-title,.composer-placeholder-reveal{animation:.9s cubic-bezier(.22,1,.36,1) both welcome-text-reveal}@keyframes welcome-text-reveal{0%{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0)}}@media (prefers-reduced-motion:reduce){.welcome-title,.composer-placeholder-reveal{opacity:1;clip-path:none;animation:none}.welcome-feature-popover{transition:none}}.welcome-title{letter-spacing:-.02em;margin:0;font-size:26px;font-weight:600}.welcome .composer{padding:0}.turn{flex-direction:column;gap:8px;max-width:768px;margin:0 auto 22px;display:flex}.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:2.4s ease-out feedback-target-pulse}@keyframes feedback-target-pulse{0%{background:hsl(var(--foreground) / .07);box-shadow:0 0 0 8px hsl(var(--foreground) / .05)}to{box-shadow:0 0 hsl(var(--foreground) / 0);background:0 0}}.transcript.is-streaming>.turn--assistant:last-child{min-height:max(0px,100% - 180px)}.turn--subagent{isolation:isolate;width:100%;max-width:768px;box-shadow:none;background:0 0;border:0;border-radius:14px;gap:10px;margin-top:40px;margin-bottom:16px;padding:30px 16px 14px;position:relative}.turn--subagent:before{z-index:-1;border-radius:inherit;-webkit-backdrop-filter:blur(18px)saturate(115%);content:"";pointer-events:none;background:radial-gradient(circle at 12% 8%,#e3ebf28c,#0000 38%),radial-gradient(circle at 88% 78%,#e3e6ed6b,#0000 42%),linear-gradient(120deg,#ffffff8f,#f2f4f742);border:1px solid #dadfe7d1;position:absolute;top:0;right:0;bottom:0;left:0;overflow:hidden}.turn--subagent:has(>.turn-meta){padding-bottom:0}.turn--subagent:has(>.turn-meta):before{bottom:44px}.transcript.is-streaming>.turn--subagent:last-child{min-height:0}.parallel-turn-group{display:contents}@media (min-width:1100px){.parallel-turn-group{overscroll-behavior-inline:contain;scroll-snap-type:inline proximity;scrollbar-width:thin;grid-auto-columns:calc(33.3333% - 10.6667px);grid-auto-flow:column;gap:16px;width:min(1180px,100% - 16px);max-width:1180px;margin:0 auto 22px;padding:22px 2px 6px;display:grid;overflow:auto hidden}.parallel-turn-group>.turn--subagent{scroll-snap-align:start;width:100%;min-width:0;max-width:none;margin:0}.parallel-turn-group[data-parallel-agent-count="1"]{grid-auto-columns:min(768px,100%);justify-content:center}.parallel-turn-group[data-parallel-agent-count="2"]{grid-auto-columns:calc(50% - 8px)}.parallel-turn-group:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:2px}}.turn--assistant:has(.create-agent-tool-card.is-agent-results):has(+.turn--subagent)>.turn-meta,.turn--assistant:has(.create-agent-tool-card.is-agent-results):has(+.parallel-turn-group)>.turn-meta{display:none}.subagent-run-label{background:hsl(var(--background));max-width:calc(100% - 28px);min-height:36px;box-shadow:none;border:1px solid #d5dae2;border-radius:10px;align-items:center;gap:8px;padding:4px 9px 4px 4px;display:inline-flex;position:absolute;top:0;left:14px;transform:translateY(-50%)}.subagent-run-handoff{color:#606b7b;white-space:nowrap;background:#eff2f5;border-radius:7px;flex:none;align-items:center;gap:5px;height:26px;padding:0 8px 0 6px;font-size:12px;font-weight:400;display:inline-flex}.subagent-run-handoff svg{flex:0 0 15px;width:15px;height:15px}.subagent-run-title{min-width:0;color:hsl(var(--foreground));text-overflow:ellipsis;white-space:nowrap;font-size:14.5px;font-weight:400;overflow:hidden}.subagent-run-description{color:#636c79;-webkit-line-clamp:2;-webkit-box-orient:vertical;margin:0;padding:0 2px 4px;font-size:13.5px;line-height:1.6;display:-webkit-box;overflow:hidden}.turn--subagent .turn-meta{margin:20px -16px 0;position:static}.codex-sandbox-run{isolation:isolate;background:radial-gradient(circle at 12% 8%,#e3ebf280,transparent 38%),radial-gradient(circle at 88% 78%,#e3e6ed61,transparent 42%),hsl(var(--background) / .56);border:1px solid #dadfe7d1;border-radius:14px;width:100%;min-width:0;margin:20px 0 8px;padding:28px 14px 12px;position:relative}.codex-sandbox-run__label{background:hsl(var(--background));border:1px solid #d5dae2;border-radius:10px;align-items:center;gap:8px;max-width:calc(100% - 24px);min-height:34px;padding:3px 9px 3px 4px;display:inline-flex;position:absolute;top:0;left:12px;transform:translateY(-50%)}.codex-sandbox-run__badge{color:#606b7b;white-space:nowrap;background:#eff2f5;border-radius:7px;flex:none;align-items:center;gap:5px;height:26px;padding:0 8px 0 6px;font-size:12px;font-weight:400;display:inline-flex}.codex-sandbox-run__badge svg{flex:0 0 15px;width:15px;height:15px}.codex-sandbox-run__title{min-width:0;color:hsl(var(--foreground));text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:400;overflow:hidden}.codex-sandbox-run__identity{border-bottom:1px solid hsl(var(--border));grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 12px;margin:0 0 10px;padding:0 2px 10px;display:grid}.codex-sandbox-run__identity>div{min-width:0}.codex-sandbox-run__identity dt,.codex-sandbox-run__identity dd{margin:0}.codex-sandbox-run__identity dt{color:hsl(var(--muted-foreground));font-size:11px;line-height:1.45}.codex-sandbox-run__identity dd{color:hsl(var(--foreground));text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:1.5;overflow:hidden}.codex-sandbox-run__stream{flex-direction:column;gap:6px;min-width:0;max-height:min(520px,55vh);padding-right:2px;display:flex;overflow:hidden auto}.codex-sandbox-run__stream .tool-detail,.codex-sandbox-run__stream .tool-section,.codex-sandbox-run__stream .tool-args{min-width:0;max-width:100%}.codex-sandbox-run__stream .tool-args{overflow:auto}.codex-sandbox-run__empty{min-height:32px;color:hsl(var(--muted-foreground));font-size:13.5px;line-height:32px}@media (max-width:700px){.turn--subagent{width:100%;padding:30px 10px 12px}.turn--subagent:has(>.turn-meta){padding-bottom:0}.turn--subagent .turn-meta{margin-left:-10px;margin-right:-10px}.subagent-run-label{max-width:calc(100% - 20px);left:10px}.codex-sandbox-run{padding-left:10px;padding-right:10px}.codex-sandbox-run__label{max-width:calc(100% - 20px);left:10px}.codex-sandbox-run__identity{grid-template-columns:minmax(0,1fr)}}.bubble{font-size:14.5px;line-height:1.65}.turn--user .bubble{background:hsl(var(--secondary));border-radius:18px;max-width:85%;padding:10px 16px}.turn--assistant .bubble{max-width:100%}.turn--assistant .bubble:has(.visualization-card){width:100%;min-width:0}.md{font-size:14.5px;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{letter-spacing:-.01em;margin:1.1em 0 .5em;font-weight:650;line-height:1.3}.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{list-style:outside}.md ol{list-style:decimal}.md ul ul{list-style-type:circle}.md ul ul ul{list-style-type:square}.md ol ol{list-style-type:lower-alpha}.md ol ol ol{list-style-type:lower-roman}.md li,.md li>ul,.md li>ol{margin:.15em 0}.md a{color:hsl(var(--primary));text-underline-offset:2px;text-decoration:underline}.md a:hover{opacity:.8}.md blockquote{border-left:3px solid hsl(var(--border));color:hsl(var(--muted-foreground));margin:0 0 .7em;padding:.1em .9em}.md strong{font-weight:650}.md code{background:hsl(var(--muted));border-radius:5px;padding:.12em .35em;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.875em}.md pre{background:hsl(var(--muted));border-radius:8px;margin:0 0 .7em;padding:12px 14px;line-height:1.55;overflow-x:auto}.md pre code{background:0 0;border-radius:0;padding:0;font-size:12.5px}.visualization-card{border:1px solid hsl(var(--border));background:hsl(var(--muted) / .55);border-radius:8px;width:100%;min-width:0;margin:0 0 .7em;overflow:hidden}.visualization-card__toolbar{border-bottom:1px solid hsl(var(--border));align-items:center;min-height:40px;padding:8px 10px;display:flex}.visualization-card__tabs{font-size:inherit;font-weight:inherit;flex:none}.visualization-card__body{background:hsl(var(--panel));min-width:0}.md .visualization-card__code{background:hsl(var(--muted) / .35);border-radius:0;min-height:96px;max-height:360px;margin:0;padding:14px 16px;overflow:auto}.mermaid-diagram{justify-content:center;align-items:center;width:100%;min-height:120px;padding:16px;display:flex;overflow-x:auto}.mermaid-diagram svg{max-width:100%;height:auto;display:block}.mermaid-diagram--loading{color:hsl(var(--muted-foreground));font-size:12.5px}.mermaid-diagram--error{justify-content:flex-start;min-height:0}.mermaid-diagram__error{color:hsl(var(--destructive));margin:0;font-size:12.5px}.echarts-diagram{width:100%;height:320px;min-height:240px;position:relative}.echarts-diagram__canvas{width:100%;height:100%}.echarts-diagram__state{color:hsl(var(--muted-foreground));justify-content:center;align-items:center;font-size:12.5px;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.echarts-diagram--error{height:auto;min-height:0;padding:16px}.echarts-diagram__error{color:hsl(var(--destructive));margin:0;font-size:12.5px}@media (max-width:640px){.echarts-diagram{height:280px}}.md table{border-collapse:collapse;width:100%;box-shadow:0 2px 8px hsl(var(--foreground) / .1),0 0 0 1px hsl(var(--border));border-radius:12px;margin:0 0 .7em;font-size:.95em;overflow:hidden}.md table thead th,.md table th{background:hsl(var(--muted));border:1px solid hsl(var(--border));text-align:left;padding:12px 16px;font-size:.98em;font-weight:650}.md table tbody td,.md table td{border:1px solid hsl(var(--border));text-align:left;vertical-align:top;padding:12px 16px;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;color:hsl(var(--muted-foreground));padding:0 0 8px;font-size:.9em;font-weight:600}.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;border-radius:4px;padding:.1em .3em}.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{content:"";margin:.4em 0;display:block}.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);background:hsl(var(--muted) / .3);border-radius:0 8px 8px 0;margin:.8em 0;padding:.6em 1em}.md ul,.md ol{margin:.6em 0;padding-left:1.6em}.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{background:hsl(var(--muted));width:fit-content;max-width:40%;box-shadow:0 0 0 1px hsl(var(--border));cursor:zoom-in;border:0;border-radius:10px;margin:0 0 .7em;padding:0;line-height:0;display:block;position:relative;overflow:hidden}.md .image-preview-trigger:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:3px}.md .image-preview-trigger img{border-radius:inherit;width:auto;max-width:100%;height:auto;transition:filter .18s,transform .18s;display:block}.md .image-preview-trigger:hover img{filter:brightness(.92);transform:scale(1.01)}.image-preview-hint{color:#fff;opacity:0;background:#131316ad;border:1px solid #fff3;border-radius:8px;place-items:center;width:28px;height:28px;transition:opacity .16s,transform .16s;display:grid;position:absolute;bottom:8px;right:8px;transform:translateY(3px)}.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{gap:6px;margin:0 0 .7em;display:grid}.md .video-caption{color:hsl(var(--muted-foreground));font-size:.9em}.md .video-link-text{color:inherit;text-decoration:none;transition:color .15s}.md .video-link-text:hover{color:hsl(var(--foreground));text-decoration:underline}.md .video-preview-trigger{background:hsl(var(--muted));width:fit-content;max-width:80%;box-shadow:0 2px 8px hsl(var(--foreground) / .1),0 0 0 1px hsl(var(--border));cursor:pointer;border:0;border-radius:12px;padding:0;line-height:0;transition:box-shadow .18s,transform .18s;display:block;position:relative;overflow:hidden}.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{border-radius:inherit;width:auto;max-width:100%;height:auto;transition:filter .18s,transform .18s;display:block}.md .video-preview-trigger:hover .video-thumbnail{filter:brightness(.9);transform:scale(1.01)}.video-preview-hint{color:#fff;opacity:0;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background:#131316b3;border:1px solid #fff3;border-radius:10px;place-items:center;width:32px;height:32px;transition:opacity .16s,transform .16s;display:grid;position:absolute;bottom:10px;right:10px;transform:translateY(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%;box-shadow:0 2px 8px hsl(var(--foreground) / .1),0 0 0 1px hsl(var(--border));border-radius:12px;margin:0 0 .7em}.video-viewer-backdrop{z-index:90;-webkit-backdrop-filter:blur(16px)saturate(.85);backdrop-filter:blur(16px)saturate(.85);background:#131316c7;place-items:center;padding:28px;display:grid;position:fixed;top:0;right:0;bottom:0;left:0}.video-viewer{border:1px solid hsl(var(--foreground) / .15);background:hsl(var(--background));border-radius:18px;flex-direction:column;width:min(1080px,94vw);max-height:min(880px,90vh);display:flex;overflow:hidden;box-shadow:0 32px 100px #07070885}.video-viewer-header{background:hsl(var(--muted) / .3);border-bottom:1px solid hsl(var(--border));justify-content:space-between;align-items:center;min-height:56px;padding:10px 16px;display:flex}.video-viewer-title{color:hsl(var(--foreground));text-overflow:ellipsis;white-space:nowrap;max-width:70%;font-weight:500;overflow:hidden}.video-viewer-nav{gap:6px;display:flex}.video-viewer-download,.video-viewer-close{width:36px;height:36px;color:hsl(var(--muted-foreground));cursor:pointer;background:0 0;border:none;border-radius:9px;justify-content:center;align-items:center;padding:0;transition:background .12s,color .12s;display:inline-flex}.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{background:#161618;flex:1;place-items:center;min-height:0;padding:20px;display:grid;overflow:hidden}.video-viewer-body .video-fullscreen{background:#000;border-radius:12px;max-width:100%;max-height:calc(90vh - 96px);box-shadow:0 4px 20px #0006}@media (max-width:640px){.md .video-preview-trigger{max-width:100%}.video-viewer-backdrop{padding:0}.video-viewer{border:none;border-radius:0;width:100vw;max-height:100vh}.video-viewer-body .video-fullscreen{border-radius:0;max-height:calc(100vh - 96px)}}.turn--user .md code,.turn--user .md pre{background:hsl(var(--background) / .55)}.block-thinking,.block-progress,.block-tool,.block-plan{align-self:stretch;width:100%;min-width:0}.think-head,.tool-head{color:hsl(var(--muted-foreground));font:inherit;cursor:pointer;background:0 0;border:none;align-items:center;display:inline-flex}.think-head{gap:8px;min-height:32px;padding:3px 7px 3px 3px}.progress-head{cursor:default}.think-icon{flex:0 0 20px;place-items:center;width:20px;height:26px;display:grid}.think-icon>svg{width:14px;height:15px}.thinking-logo{color:hsl(var(--foreground));opacity:.56;transform-origin:50%}.thinking-logo.is-active{animation:1.6s ease-in-out infinite thinking-logo-breathe}@keyframes thinking-logo-breathe{0%,to{opacity:.42;transform:scale(.97)}50%{opacity:.72;transform:scale(1.02)}}@media (prefers-reduced-motion:reduce){.thinking-logo.is-active{opacity:.56;animation:none;transform:none}}.chev{opacity:.58;flex:0 0 13px;width:13px;height:13px;transition:transform .18s}.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{flex:0 0 20px;place-items:center;width:20px;height:26px;display:grid}.tool-icon>svg{width:18px;height:18px}.tool-icon--generic{color:hsl(var(--muted-foreground))}.block-tool[data-status=failed] .tool-head--generic{color:hsl(var(--destructive))}.tool-chevron{opacity:.58;flex:0 0 13px;width:13px;height:13px;transition:transform .18s}.tool-chevron.is-open{transform:rotate(90deg)}.tool-detail{flex-direction:column;gap:8px;margin:6px 0 4px;padding-left:3px;display:flex}.tool-section-label{text-transform:uppercase;letter-spacing:.04em;color:hsl(var(--muted-foreground));margin-bottom:4px;font-size:11px}.tool-result{max-height:240px;overflow:auto}.studio-tool-artifacts{flex-wrap:wrap;gap:6px;display:flex}.studio-tool-artifacts a{border:1px solid hsl(var(--border));min-height:28px;color:hsl(var(--foreground));border-radius:7px;align-items:center;padding:4px 9px;font-size:12px;text-decoration:none;display:inline-flex}.studio-tool-artifacts a:hover{border-color:hsl(var(--primary) / .45);background:hsl(var(--primary) / .05);color:hsl(var(--primary))}.plan-head{min-width:0;min-height:32px;color:hsl(var(--muted-foreground));font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;align-items:center;gap:8px;padding:3px 7px 3px 3px;display:flex}.plan-head:not(:disabled):hover{color:hsl(var(--foreground))}.plan-head:disabled{cursor:default}.plan-icon{flex:0 0 20px;place-items:center;width:20px;height:26px;display:grid}.plan-icon>svg{width:18px;height:18px}.plan-title{overflow-wrap:anywhere;min-width:0;font-size:14.5px;font-weight:400;line-height:1.35}.plan-summary{color:hsl(var(--muted-foreground));flex:none;font-size:11.5px;line-height:1.4}.plan-chevron{opacity:.58;flex:0 0 13px;width:13px;height:13px;transition:transform .18s}.plan-chevron.is-open{transform:rotate(90deg)}.plan-items{gap:6px;margin:5px 0 6px 31px;padding:0;list-style:none;display:grid}.plan-items li{min-width:0;color:hsl(var(--muted-foreground));grid-template-columns:8px minmax(0,1fr) auto;align-items:center;gap:8px;display:grid}.plan-item-marker{border:1px solid hsl(var(--border));background:hsl(var(--background));border-radius:50%;width:7px;height:7px}.plan-items li[data-status=in_progress] .plan-item-marker{border-color:hsl(var(--ring));box-shadow:0 0 0 3px hsl(var(--ring) / .1)}.plan-items li[data-status=completed] .plan-item-marker{border-color:hsl(var(--foreground) / .45);background:hsl(var(--foreground) / .45)}.plan-items li[data-status=failed] .plan-item-marker{border-color:hsl(var(--destructive));background:hsl(var(--destructive))}.plan-item-text{overflow-wrap:anywhere;min-width:0;font-size:13px;line-height:1.5}.plan-items small{color:inherit;font-size:11px;line-height:1.4}.plan-items li[data-status=failed]{color:hsl(var(--destructive))}.think-collapse{grid-template-rows:0fr;transition:grid-template-rows .28s;display:grid}.think-collapse.open{grid-template-rows:1fr}.think-collapse-inner{width:100%;min-width:0;overflow:hidden}.think-body{width:100%;min-width:0;color:hsl(var(--muted-foreground));white-space:pre-wrap;border-left:0;max-height:220px;margin:0;padding:0;font-size:14px;line-height:1.7;overflow-y:auto}.tool-args{background:hsl(var(--muted));white-space:pre-wrap;border-radius:6px;margin:0;padding:8px 10px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.5;overflow-x:auto}.turn-meta{color:hsl(var(--muted-foreground));opacity:0;align-items:center;gap:10px;margin-top:2px;font-size:12px;transition:opacity .15s;display:flex}.turn-empty{color:hsl(var(--muted-foreground));margin-top:2px;font-size:13px;font-style:italic}.auth-card{border:1px solid hsl(var(--border));background:hsl(var(--card));border-radius:12px;width:100%;max-width:640px;margin:2px 0;padding:18px 20px}.auth-card-head{align-items:center;gap:8px;margin-bottom:6px;display:flex}.auth-card-icon{color:#f59f0a;width:18px;height:18px}.auth-card-icon--done{color:#1eae53}.auth-card-collapsed{border:1px solid hsl(var(--border));background:hsl(var(--card));color:hsl(var(--muted-foreground));border-radius:9px;align-items:center;gap:7px;margin:2px 0;padding:6px 12px;font-size:13px;font-weight:500;display:inline-flex}.auth-card-code{background:hsl(var(--muted));color:hsl(var(--foreground));word-break:break-all;border-radius:5px;padding:1px 6px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.auth-card-title{font-size:14px;font-weight:600}.auth-card-desc{color:hsl(var(--muted-foreground));margin:0 0 14px;font-size:13px;line-height:1.6}.auth-card-btn{background:hsl(var(--primary));color:hsl(var(--primary-foreground));font:inherit;cursor:pointer;border:none;border-radius:9px;align-items:center;gap:7px;padding:8px 16px;font-size:13px;font-weight:600;transition:opacity .12s;display:inline-flex}.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{color:#1eae53;align-items:center;gap:6px;font-size:13px;font-weight:500;display:inline-flex}.auth-card-done .cw-i{width:16px;height:16px}.auth-card-err{color:hsl(var(--destructive));margin-top:8px;font-size:12px}.artifact-list{gap:8px;width:min(100%,440px);margin:6px 0;display:grid}.artifact-card{width:100%;color:hsl(var(--foreground));text-align:left;background:#f5f9ff;border:1px solid #d1e1fa;border-radius:12px;align-items:center;gap:12px;padding:12px 14px;display:flex}.artifact-card__icon{color:#2371e7;background:#d8e7fd;border-radius:10px;flex:none;justify-content:center;align-items:center;width:36px;height:36px;display:inline-flex}.artifact-card__icon svg{width:18px;height:18px}.artifact-card__copy{flex:auto;gap:3px;min-width:0;display:grid}.artifact-card__name{text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:600;overflow:hidden}.artifact-card__hint{color:hsl(var(--muted-foreground));font-size:12px}.artifact-card__actions{flex:none;gap:6px;margin-left:auto;display:flex}.artifact-card__action{background:hsl(var(--background));color:#315b9b;white-space:nowrap;cursor:pointer;border:1px solid #becde4;border-radius:8px;flex:none;align-items:center;gap:5px;min-height:30px;padding:0 10px;font-size:12px;font-weight:600;display:inline-flex}.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{color:#fff;background:#2c77e8;border-color:#3e81e5}.artifact-card__action--primary:hover:not(:disabled){background:#1867dc}.artifact-card__error{color:hsl(var(--destructive));font-size:12px}.delivery-card{border:1px solid hsl(var(--border));background:hsl(var(--panel));width:min(100%,560px);color:hsl(var(--foreground));border-radius:12px;gap:12px;margin:8px 0;padding:16px;display:grid}.delivery-card-header{align-items:center;gap:10px;display:flex}.delivery-card-header>div{gap:2px;display:grid}.delivery-card-header strong{font-size:14px}.delivery-card-header span{color:hsl(var(--muted-foreground));font-size:12px}.delivery-card-icon{background:hsl(var(--secondary));width:36px;height:36px;color:hsl(var(--primary));border-radius:10px;place-items:center;display:inline-grid}.delivery-card-icon svg{width:18px;height:18px}.delivery-card.is-unverified .delivery-card-icon{color:hsl(var(--muted-foreground))}.delivery-card-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 16px;margin:0;display:grid}.delivery-card-grid div{min-width:0}.delivery-card-grid dt{color:hsl(var(--muted-foreground));font-size:11px}.delivery-card-grid dd{text-overflow:ellipsis;white-space:nowrap;margin:2px 0 0;font-size:12px;overflow:hidden}.delivery-card-gates{color:hsl(var(--muted-foreground));margin:0;font-size:12px}.delivery-card-guidance{color:hsl(var(--muted-foreground));margin:0;font-size:12px;line-height:1.55}.delivery-card-actions{flex-wrap:wrap;gap:8px;display:flex}.delivery-card-actions button{border:1px solid hsl(var(--primary));background:hsl(var(--primary));min-height:34px;color:hsl(var(--primary-foreground));font:inherit;cursor:pointer;border-radius:8px;justify-content:center;align-items:center;gap:6px;padding:0 14px;font-size:12px;font-weight:600;display:inline-flex}.delivery-card-actions button svg{width:14px;height:14px}.delivery-card-actions .delivery-card-secondary{border-color:hsl(var(--border));background:hsl(var(--background));color:hsl(var(--foreground))}.delivery-card-actions button:disabled{cursor:not-allowed;opacity:.5}.delivery-card-actions button:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:2px}.delivery-card-error{color:hsl(var(--destructive));margin:0;font-size:12px}.delivery-card-status{color:#277c46;margin:0;font-size:12px}.trusted-source-pane{color:hsl(var(--foreground));gap:14px;padding:22px;display:grid}.trusted-source-pane h2,.trusted-source-pane p,.trusted-source-pane dl{margin:0}.trusted-source-pane__badge{background:hsl(var(--secondary));color:hsl(var(--primary));border-radius:999px;justify-self:start;padding:4px 8px;font-size:11px;font-weight:600}.trusted-source-pane__runtime-name{gap:6px;display:grid}.trusted-source-pane__runtime-name span{color:hsl(var(--muted-foreground));font-size:12px}.trusted-source-pane__runtime-name input{border:1px solid hsl(var(--border));background:hsl(var(--background));min-height:36px;color:hsl(var(--foreground));font:inherit;border-radius:8px;outline:none;padding:0 10px;font-size:13px}.trusted-source-pane__runtime-name input:focus{border-color:hsl(var(--ring));box-shadow:0 0 0 2px hsl(var(--ring) / .12)}.trusted-source-pane dl{gap:9px;display:grid}.trusted-source-pane dl div{justify-content:space-between;gap:12px;display:flex}.trusted-source-pane dt{color:hsl(var(--muted-foreground));font-size:12px}.trusted-source-pane dd{text-overflow:ellipsis;margin:0;font-size:12px;overflow:hidden}.trusted-source-pane p{color:hsl(var(--muted-foreground));font-size:12px;line-height:1.6}@media (max-width:640px){.delivery-card-grid{grid-template-columns:minmax(0,1fr)}.delivery-card-actions{grid-template-columns:minmax(0,1fr);display:grid}.delivery-card-actions button{width:100%}}.artifact-preview{z-index:1200;place-items:center;padding:28px;display:grid;position:fixed;top:0;right:0;bottom:0;left:0}.artifact-preview__backdrop{-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);cursor:default;background:#0b182b94;border:0;position:absolute;top:0;right:0;bottom:0;left:0}.artifact-preview__panel{border:1px solid hsl(var(--border));background:hsl(var(--background));border-radius:16px;grid-template-rows:auto minmax(0,1fr);width:min(1120px,92vw);max-height:90vh;display:grid;position:relative;overflow:hidden;box-shadow:0 26px 80px #0b182b4d}.artifact-preview__header{border-bottom:1px solid hsl(var(--border));justify-content:space-between;align-items:center;gap:16px;min-height:52px;padding:0 16px 0 20px;font-size:14px;font-weight:600;display:flex}.artifact-preview__header button{width:32px;height:32px;color:hsl(var(--muted-foreground));cursor:pointer;background:0 0;border:0;border-radius:8px;justify-content:center;align-items:center;display:inline-flex}.artifact-preview__header button:hover{background:hsl(var(--muted))}.artifact-preview__header svg{width:17px;height:17px}.artifact-preview__canvas{background:#eceff3;min-height:0;padding:18px;overflow:auto}.artifact-preview__canvas img{border-radius:8px;width:100%;height:auto;display:block;box-shadow:0 6px 24px #0b182b29}.turn-actions{align-items:center;gap:2px;display:inline-flex}.turn-actions--right{opacity:0;align-self:flex-end;margin-top:2px;transition:opacity .15s}.turn--assistant:hover .turn-meta,.turn--user:hover .turn-actions--right{opacity:1}.icon-btn{width:28px;height:28px;color:hsl(var(--muted-foreground));cursor:pointer;background:0 0;border:none;border-radius:6px;justify-content:center;align-items:center;transition:background .12s,color .12s;display:inline-flex}.icon-btn:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.icon-btn:disabled{opacity:.35;cursor:default}.icon-btn:disabled:hover{color:hsl(var(--muted-foreground));background:0 0}.icon-btn .icon{width:15px;height:15px}.feedback-btn:hover,.feedback-btn--good,.feedback-btn--bad,.feedback-btn--good:hover,.feedback-btn--bad:hover{color:hsl(var(--foreground));background:0 0}.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;color:hsl(var(--muted-foreground));font-size:12px}.turn-actions--right{gap:6px}.drawer-scrim{background:hsl(var(--foreground) / .2);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);z-index:40;animation:.2s fade;position:fixed;top:0;right:0;bottom:0;left:0}@keyframes fade{0%{opacity:0}to{opacity:1}}.drawer{background:hsl(var(--background));border-left:1px solid hsl(var(--border));width:min(560px,92vw);box-shadow:-12px 0 40px hsl(var(--foreground) / .14);z-index:41;flex-direction:column;animation:.24s cubic-bezier(.22,1,.36,1) slidein;display:flex;position:fixed;top:0;bottom:0;right:0}@keyframes slidein{0%{transform:translate(100%)}to{transform:translate(0)}}.drawer-head{border-bottom:1px solid hsl(var(--border));background:hsl(var(--canvas));justify-content:space-between;align-items:center;padding:15px 18px;display:flex}.drawer-title{letter-spacing:-.01em;font-size:15px;font-weight:650}.drawer-sub{color:hsl(var(--muted-foreground));font-variant-numeric:tabular-nums;margin-top:3px;font-size:12px}.drawer-close{cursor:pointer;color:hsl(var(--muted-foreground));background:0 0;border:none;border-radius:6px;padding:6px;display:flex}.drawer-close:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.drawer-body{flex:1;padding:16px 18px;overflow:auto}.drawer-loading,.drawer-empty{color:hsl(var(--muted-foreground));align-items:center;gap:8px;font-size:14px;display:flex}.drawer-loading{flex:1;justify-content:center;padding:24px}.drawer-empty{padding:20px 0}.trace-state{text-align:center;flex-wrap:wrap;flex:1;justify-content:center;padding:24px 18px}.drawer--trace{width:min(1080px,96vw)}.trace-split{flex:1;min-height:0;display:flex}.trace-tree{border-right:1px solid hsl(var(--border));flex:1.25;min-width:0;padding:8px 6px;overflow:auto}.trace-row{cursor:pointer;width:100%;font:inherit;text-align:left;background:0 0;border:none;border-radius:6px;align-items:center;gap:10px;padding:5px 8px;transition:background .1s;display:flex}.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{flex:1;align-items:center;gap:6px;min-width:0;display:flex}.trace-caret{width:16px;height:16px;color:hsl(var(--muted-foreground));flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.trace-caret.hidden{visibility:hidden}.trace-caret .chev{width:13px;height:13px;transition:transform .18s}.trace-caret.open .chev{transform:rotate(90deg)}.trace-dot{border-radius:50%;flex-shrink:0;width:8px;height:8px}.trace-name{white-space:nowrap;text-overflow:ellipsis;font-size:13px;overflow:hidden}.trace-dur{text-align:right;width:66px;color:hsl(var(--muted-foreground));font-variant-numeric:tabular-nums;flex-shrink:0;font-size:11px}.trace-track{background:hsl(var(--foreground) / .05);border-radius:5px;flex:0 0 34%;height:16px;position:relative}.trace-bar{opacity:.9;border-radius:4px;min-width:3px;height:8px;position:absolute;top:4px}.trace-detail{flex:1;min-width:0;padding:18px 20px;overflow:auto}.td-title{letter-spacing:-.01em;word-break:break-all;font-size:15px;font-weight:600}.td-dur{color:hsl(var(--muted-foreground));font-variant-numeric:tabular-nums;align-items:center;gap:7px;margin-top:4px;font-size:12px;display:flex}.td-dot{border-radius:50%;width:8px;height:8px}.td-section{letter-spacing:.01em;color:hsl(var(--foreground));margin:22px 0 9px;font-size:12px;font-weight:650}.td-props{flex-direction:column;display:flex}.td-prop{border-bottom:1px solid hsl(var(--border));gap:16px;padding:7px 0;font-size:13px;display:flex}.td-key{color:hsl(var(--muted-foreground));flex-shrink:0;min-width:140px}.td-val{text-align:right;word-break:break-word;font-variant-numeric:tabular-nums;flex:1;min-width:0}.td-pre{background:hsl(var(--canvas));border:1px solid hsl(var(--border));white-space:pre-wrap;word-break:break-word;border-radius:8px;max-height:320px;margin:0;padding:11px 13px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.55;overflow:auto}.composer{width:100%;max-width:768px;margin:0 auto;padding:6px 16px 18px}.conversation-composer-slot{padding:6px 16px 18px}.conversation-composer-slot>.composer-slot>.composer{padding:0}.composer--new-chat{position:relative}.composer-box{border:1px solid hsl(var(--border));background:hsl(var(--background));border-radius:26px;align-items:flex-end;gap:6px;padding:6px 6px 6px 8px;display:flex;position:relative}.composer--new-chat .composer-box{z-index:2;border-color:hsl(var(--border) / .55);border-radius:16px;min-height:136px;padding:10px;display:block;box-shadow:0 8px 32px #00000007,0 24px 72px 8px #00000005}.composer-input-stack{flex-direction:column;flex:1;min-width:0;display:flex;position:relative}.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 .comp-input::placeholder{color:#0000}.composer-placeholder-reveal{z-index:1;width:max-content;max-width:calc(100% - 20px);color:hsl(var(--muted-foreground));text-overflow:ellipsis;white-space:nowrap;pointer-events:none;font-size:15px;line-height:1.5;position:absolute;top:4px;left:10px;overflow:hidden}.composer--new-chat .composer-menu-wrap{z-index:5;height:36px;position:absolute;bottom:10px;left:10px}.composer--new-chat .new-chat-mode{align-items:center;min-height:36px;display:flex;position:absolute;bottom:10px;left:52px}.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}.new-chat-task-chip{z-index:2;color:#7a5bae;width:78px;height:36px;font:inherit;white-space:nowrap;cursor:pointer;background:0 0;border:0;border-radius:999px;justify-content:center;align-items:center;gap:7px;padding:0 10px;font-size:15px;line-height:1;transition:background .15s,transform .15s;display:inline-flex;position:absolute;bottom:10px;left:52px}.new-chat-task-chip--image,.new-chat-task-chip--video{width:116px}.new-chat-task-chip>span:last-child{white-space:nowrap;flex:none}.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{border-radius:50%;flex:0 0 20px;place-items:center;width:20px;height:20px;display:grid;position:relative}.new-chat-task-chip__task-icon,.new-chat-task-chip__remove-icon{width:18px;height:18px;transition:opacity .12s,transform .15s;position:absolute}.new-chat-task-chip__remove-icon{color:#fff;opacity:0;box-sizing:content-box;background:#896bbd;border-radius:50%;width:12px;height:12px;padding:3px;transform:scale(.72)}.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;bottom:10px;right:10px}.composer--new-chat .comp-send .icon{width:20px;height:20px}.task-shortcuts{z-index:1;flex-wrap:wrap;justify-content:center;gap:10px;width:100%;display:flex;position:absolute;top:calc(100% + 18px);left:0}.task-shortcut{border:1px solid hsl(var(--border) / .72);background:hsl(var(--background));min-width:92px;height:40px;color:hsl(var(--muted-foreground));font:inherit;white-space:nowrap;cursor:pointer;opacity:0;border-radius:999px;flex:none;justify-content:center;align-items:center;gap:8px;padding:0 18px;font-size:13px;line-height:1;transition:border-color .14s,background .14s,color .14s,transform .14s;animation:.32s cubic-bezier(.22,1,.36,1) forwards task-shortcut-enter;display:inline-flex;transform:translateY(6px)}.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:.135s}.task-shortcut:hover{color:#7454ab;background:#f6f5fa;border-color:#8970b257;transform:translateY(-1px)}.task-shortcut:focus-visible{outline-offset:2px;outline:2px solid #8970b257}.task-shortcut:disabled{cursor:not-allowed;opacity:.5}.task-shortcut>svg{stroke:currentColor;flex:none;width:18px;height:18px}.prompt-suggestions{z-index:1;gap:3px;width:100%;display:grid;position:absolute;top:calc(100% + 18px);left:0}.prompt-suggestion{width:100%;min-height:46px;color:hsl(var(--muted-foreground));font:inherit;text-align:left;cursor:pointer;opacity:0;background:0 0;border:0;border-radius:12px;align-items:center;gap:12px;padding:8px 14px;font-size:15px;line-height:1.5;transition:background .14s,color .14s,transform .14s;animation:.44s cubic-bezier(.22,1,.36,1) forwards prompt-suggestion-enter;display:flex;transform:translateY(10px)}.prompt-suggestion:nth-child(2){animation-delay:65ms}.prompt-suggestion:nth-child(3){animation-delay:.13s}.prompt-suggestion:nth-child(4){animation-delay:.195s}.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{stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.35px;transform-origin:50%;flex:none;width:18px;height:18px;transition:transform .22s cubic-bezier(.22,1,.36,1)}.prompt-suggestion>span{white-space:nowrap;text-overflow:ellipsis;min-width:0;max-height:1.5em;transition:max-height .22s cubic-bezier(.22,1,.36,1);display:block;overflow:hidden}.prompt-suggestion:hover>span,.prompt-suggestion:focus-visible>span{white-space:normal;text-overflow:clip;max-height:4.5em}.prompt-suggestion:first-child: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;transition:none;animation:none;transform:none}.prompt-suggestion>svg,.prompt-suggestion>span{transition:none}.prompt-suggestion:hover>svg{transform:none}}.composer-meta{min-width:0;color:hsl(var(--muted-foreground));justify-content:center;align-items:center;gap:8px;padding:7px 12px 0;font-size:11px;line-height:1.4;display:flex}.composer-session-line{white-space:nowrap;align-items:center;gap:4px;min-width:0;display:flex}.composer-session-id{text-overflow:ellipsis;max-width:300px;font-family:inherit;overflow:hidden}.composer-session-copy{width:18px;height:18px;color:inherit;cursor:pointer;opacity:.72;background:0 0;border:0;border-radius:4px;flex:0 0 18px;place-items:center;padding:0;transition:background .12s,color .12s,opacity .12s;display:inline-grid}.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}.composer-runtime-logs{min-height:22px;color:inherit;font:inherit;cursor:pointer;background:0 0;border:0;border-radius:4px;align-items:center;gap:5px;padding:0 3px;transition:background .12s,color .12s;display:inline-flex}.composer-runtime-logs:hover{background:hsl(var(--foreground) / .05);color:hsl(var(--foreground))}.composer-runtime-logs:active{background:hsl(var(--foreground) / .09)}.composer-runtime-logs:focus-visible{outline:2px solid hsl(var(--primary) / .45);outline-offset:1px}.composer-runtime-logs svg{flex:none;width:13px;height:13px}@media (max-width:640px){.composer-meta{flex-wrap:wrap;gap:4px 8px}.composer-session-line{max-width:100%}.composer-session-id{max-width:min(220px,52vw)}}.comp-input{resize:none;color:hsl(var(--foreground));font:inherit;background:0 0;border:none;outline:none;flex:1;max-height:200px;padding:8px 4px;font-size:15px;line-height:1.5;overflow-y:auto}.comp-input::placeholder{color:hsl(var(--muted-foreground))}.comp-icon{width:36px;height:36px;color:hsl(var(--muted-foreground));cursor:pointer;background:0 0;border:none;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;transition:background .12s,color .12s;display:flex}.comp-icon:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.composer-submit-actions{flex-shrink:0;align-items:center;gap:6px;height:36px;display:flex}.composer--new-chat .composer-submit-actions{display:contents}.comp-send{background:hsl(var(--primary));width:36px;height:36px;color:hsl(var(--primary-foreground));cursor:pointer;border:none;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;transition:opacity .15s,transform .1s;display:flex}.comp-send .icon{width:20px;height:20px}.comp-send:hover:not(:disabled){opacity:.85}.comp-send:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:2px}.comp-send:active:not(:disabled){transform:scale(.94)}.comp-send:disabled{opacity:.3;cursor:default}.token-usage-indicator{z-index:3;width:28px;height:28px;color:hsl(var(--muted-foreground));cursor:default;border-radius:999px;outline:none;flex:0 0 28px;place-items:center;transition:background-color .14s,color .14s;display:grid;position:relative}.token-usage-indicator:hover{background:hsl(var(--muted) / .72);color:hsl(var(--foreground) / .68)}.token-usage-indicator:focus-visible{color:hsl(var(--foreground) / .68);outline:2px solid hsl(var(--ring) / .45);outline-offset:1px}.token-usage-ring{width:16px;height:16px;overflow:visible}.token-usage-ring__track,.token-usage-ring__value{fill:none;transform-origin:50%;transform:rotate(-90deg)}.token-usage-ring__track{stroke:hsl(var(--muted-foreground) / .3);stroke-width:2.25px}.token-usage-ring__value{stroke:currentColor;stroke-width:2.75px;stroke-linecap:butt;transition:stroke-dasharray .18s ease-out}.token-usage-tooltip{--token-context-system:#4e545f;--token-context-input:#5685b3;--token-context-output:#c48945;--token-context-remaining:hsl(var(--muted));z-index:30;border:1px solid hsl(var(--border));background:hsl(var(--panel));width:360px;box-shadow:0 10px 30px hsl(var(--foreground) / .12);color:hsl(var(--foreground));text-align:left;visibility:hidden;opacity:0;pointer-events:none;border-radius:12px;padding:12px 14px;font-size:12px;font-weight:400;line-height:1.5;transition:visibility 0s linear .14s,opacity .14s,transform .14s;position:absolute;bottom:calc(100% + 10px);right:-42px;transform:translateY(4px)}.token-usage-indicator:hover .token-usage-tooltip,.token-usage-indicator:focus-visible .token-usage-tooltip{visibility:visible;opacity:1;transition-delay:0s;transform:translateY(0)}.token-usage-tooltip__header{justify-content:space-between;align-items:baseline;gap:12px;margin-bottom:10px;display:flex}.token-usage-tooltip__header strong{font-size:13px;font-weight:600}.token-usage-tooltip__header span{color:hsl(var(--muted-foreground));font-size:11.5px;font-weight:500}.token-usage-tooltip__title{color:hsl(var(--muted-foreground));margin-bottom:4px;font-size:11.5px;font-weight:500}.token-usage-tooltip__unknown{font-size:13px;font-weight:550}.token-context-grid{background:hsl(var(--muted) / .34);border-radius:9px;grid-template-columns:repeat(10,10px);align-self:start;gap:4px;padding:10px;display:grid}.token-context-breakdown{grid-template-columns:max-content minmax(0,1fr);align-items:start;gap:16px;display:grid}.token-context-cell{background:var(--token-context-remaining);width:10px;height:10px;box-shadow:inset 0 0 0 1px hsl(var(--border) / .72);border-radius:2px;display:flex;overflow:hidden}.token-context-cell__slice{min-width:0;height:100%}.token-context-cell__slice.is-system,.token-context-swatch.is-system{background:var(--token-context-system)}.token-context-cell__slice.is-input,.token-context-swatch.is-input{background:var(--token-context-input)}.token-context-cell__slice.is-output,.token-context-swatch.is-output{background:var(--token-context-output)}.token-context-cell__slice.is-remaining,.token-context-swatch.is-remaining{background:var(--token-context-remaining)}.token-context-legend{gap:9px;margin:0;padding:6px 0;display:grid}.token-context-legend>div{justify-content:space-between;align-items:center;gap:6px;min-width:0;display:flex}.token-context-legend dt{min-width:0;color:hsl(var(--muted-foreground));white-space:nowrap;align-items:center;gap:5px;display:flex}.token-context-legend dd{white-space:nowrap;margin:0;font-weight:550}.token-context-legend em{background:hsl(var(--muted));border-radius:999px;padding:1px 4px;font-size:9.5px;font-style:normal;font-weight:500;line-height:1.35}.token-context-summary{border-top:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));gap:2px;margin-top:12px;padding-top:10px;font-size:11.5px;display:grid}.token-context-summary strong{color:hsl(var(--foreground));font-weight:600}.token-context-swatch{width:8px;height:8px;box-shadow:inset 0 0 0 1px hsl(var(--border) / .72);border-radius:2px;flex:0 0 8px}.token-usage-tooltip__overflow{color:hsl(var(--destructive));margin-top:9px;font-size:11px;font-weight:500}.token-usage-tooltip__model{border-top:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));text-overflow:ellipsis;white-space:nowrap;margin-top:10px;padding-top:8px;font-size:11px;overflow:hidden}@media (prefers-reduced-motion:reduce){.token-usage-indicator,.token-usage-ring__value,.token-usage-tooltip{transition:none}}.invocation-chips{flex-wrap:wrap;gap:6px;min-width:0;display:flex}.composer>.invocation-chips{padding:0 8px 8px}.turn--user>.invocation-chips{justify-content:flex-end;margin-bottom:6px}.invocation-chip{border:1px solid hsl(var(--border));background:hsl(var(--background));max-width:260px;min-height:28px;color:hsl(var(--foreground));box-shadow:0 1px 2px hsl(var(--foreground) / .025);border-radius:8px;align-items:center;gap:5px;padding:4px 8px;font-size:12px;font-weight:560;line-height:1.2;display:inline-flex}.invocation-chip--skill{color:#267848}.invocation-chip--agent{color:#2762b0}.invocation-chip>svg{flex:none;width:13px;height:13px}.invocation-chip>span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.invocation-chip button{color:currentColor;cursor:pointer;opacity:.55;background:0 0;border:none;border-radius:5px;justify-content:center;align-items:center;width:17px;height:17px;margin:-1px -3px -1px 1px;padding:0;display:inline-flex}.invocation-chip button:hover{background:hsl(var(--accent));opacity:1}.invocation-chip button svg{width:11px;height:11px}.composer-command-menu{z-index:34;border:1px solid hsl(var(--border));background:hsl(var(--background));width:min(500px,100vw - 48px);box-shadow:0 2px 7px hsl(var(--foreground) / .08),0 22px 60px -24px hsl(var(--foreground) / .28);transform-origin:0 100%;border-radius:14px;animation:.13s ease-out command-menu-in;position:absolute;bottom:calc(100% + 10px);left:0;overflow:hidden}@keyframes command-menu-in{0%{opacity:0;transform:translateY(5px)scale(.985)}to{opacity:1;transform:translateY(0)scale(1)}}.composer-command-head{border-bottom:1px solid hsl(var(--border));height:38px;color:hsl(var(--muted-foreground));letter-spacing:.02em;align-items:center;gap:7px;padding:0 10px 0 12px;font-size:11px;font-weight:650;display:flex}.composer-command-head>svg{width:13px;height:13px}.composer-command-head>span{flex:1}.composer-command-menu kbd{border:1px solid hsl(var(--border));background:hsl(var(--canvas));min-width:22px;color:hsl(var(--muted-foreground));text-align:center;border-radius:5px;padding:2px 5px;font:10px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace}.composer-command-list{max-height:min(330px,42vh);padding:5px;display:grid;overflow-y:auto}.composer-command-item{width:100%;min-height:52px;color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer;background:0 0;border:none;border-radius:9px;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:9px;padding:6px 8px;display:grid}.composer-command-item.is-active{background:hsl(var(--accent))}.composer-command-icon{border-radius:9px;justify-content:center;align-items:center;width:34px;height:34px;display:inline-flex}.composer-command-icon--skill{color:#218349;background:#e7f8ee}.composer-command-icon--agent{color:#2664b5;background:#e9f1fc}.composer-command-icon svg{width:16px;height:16px}.composer-command-copy{gap:3px;min-width:0;display:grid}.composer-command-copy strong{color:hsl(var(--foreground));text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:620;line-height:1.2;overflow:hidden}.composer-command-copy>span{color:hsl(var(--muted-foreground));text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:1.3;overflow:hidden}.composer-command-empty{min-height:68px;color:hsl(var(--muted-foreground));justify-content:center;align-items:center;gap:7px;padding:14px;font-size:12px;display:flex}.composer-command-empty svg{width:14px;height:14px}.composer-menu-wrap{flex-shrink:0;position:relative}.composer-menu{z-index:31;background:hsl(var(--background));border:1px solid hsl(var(--border));min-width:168px;box-shadow:0 6px 20px hsl(var(--foreground) / .12);border-radius:12px;margin-bottom:6px;padding:4px;position:absolute;bottom:100%;left:0}.media-grid{flex-wrap:wrap;gap:8px;max-width:min(620px,100%);display:flex}.turn--user .media-grid{justify-content:flex-end}.composer>.media-grid{justify-content:flex-start;padding:0 8px 9px}.media-card{border:1px solid hsl(var(--border));background:hsl(var(--background));width:272px;min-width:0;box-shadow:0 1px 2px hsl(var(--foreground) / .025);border-radius:14px;transition:border-color .16s,box-shadow .16s,transform .16s;position:relative;overflow:visible}.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{border-radius:inherit;width:100%;min-width:0;height:68px;color:inherit;font:inherit;text-align:left;cursor:pointer;background:0 0;border:none;align-items:center;gap:11px;padding:10px 12px;display:flex}.media-card-main:disabled{cursor:default}.media-card--image .media-card-main{height:132px;padding:4px;display:block}.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{object-fit:cover;background:hsl(var(--muted));border-radius:10px;width:100%;height:100%;display:block}.media-card--image .media-card-copy,.media-card--image .media-card-open{display:none}.media-card-icon{width:40px;height:44px;color:hsl(var(--muted-foreground));background:hsl(var(--muted));border-radius:9px;flex:none;justify-content:center;align-items:center;display:inline-flex}.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{background:#131316;place-items:center;width:100%;height:100%;display:grid;position:relative;overflow:hidden}.media-card-video{object-fit:cover;opacity:.85;width:100%;height:100%}.media-card-video-play{color:#fff;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background:#0000008c;border-radius:50%;place-items:center;width:48px;height:48px;transition:transform .18s,background .18s;display:grid;position:absolute;transform:scale(1)}.media-card-video-play svg{width:20px;height:20px;margin-left:3px}.media-card-main:hover .media-card-video-play{background:#000000b3;transform:scale(1.08)}.media-card-copy{flex:1;gap:5px;min-width:0;display:grid}.media-card-name{text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:560;line-height:1.2;overflow:hidden}.media-card-meta{min-width:0;color:hsl(var(--muted-foreground));align-items:center;gap:5px;font-size:11px;line-height:1.2;display:flex}.media-card-type{letter-spacing:.06em;font-size:9px;font-weight:700}.media-card-open{width:14px;height:14px;color:hsl(var(--muted-foreground));opacity:0;flex:none;transition:opacity .15s}.media-card:hover .media-card-open{opacity:1}.media-card-spinner{width:12px;height:12px;animation:.85s linear infinite spin}.media-card--error{border-color:hsl(var(--destructive) / .42)}.media-card--error .media-card-meta{color:hsl(var(--destructive))}.media-card-remove{z-index:2;border:1px solid hsl(var(--border));background:hsl(var(--background));width:21px;height:21px;color:hsl(var(--muted-foreground));box-shadow:0 2px 8px hsl(var(--foreground) / .12);cursor:pointer;border-radius:999px;justify-content:center;align-items:center;padding:0;display:inline-flex;position:absolute;top:-7px;right:-7px}.media-card-remove:hover{color:hsl(var(--foreground))}.media-card-remove svg{width:12px;height:12px}.media-viewer-backdrop{z-index:90;-webkit-backdrop-filter:blur(12px)saturate(.8);backdrop-filter:blur(12px)saturate(.8);background:#131316b8;place-items:center;padding:28px;display:grid;position:fixed;top:0;right:0;bottom:0;left:0}.media-viewer{border:1px solid hsl(var(--foreground) / .13);background:hsl(var(--background));border-radius:18px;flex-direction:column;width:min(1080px,94vw);height:min(820px,90vh);display:flex;overflow:hidden;box-shadow:0 32px 100px #07070875}.media-viewer-header{border-bottom:1px solid hsl(var(--border));background:hsl(var(--background) / .94);justify-content:space-between;align-items:center;gap:18px;min-height:58px;padding:9px 12px 9px 18px;display:flex}.media-viewer-header>div{gap:2px;min-width:0;display:grid}.media-viewer-header strong{text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:620;overflow:hidden}.media-viewer-header span{color:hsl(var(--muted-foreground));font-size:11px}.media-viewer-header nav{gap:4px;display:flex}.media-viewer-header a,.media-viewer-header button{width:36px;height:36px;color:hsl(var(--muted-foreground));cursor:pointer;background:0 0;border:none;border-radius:9px;justify-content:center;align-items:center;padding:0;display:inline-flex}.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{background:hsl(var(--canvas));flex:1;min-height:0;overflow:auto}.media-viewer-body--image,.media-viewer-body--video{background:#161618;place-items:center;padding:24px;display:grid}.media-viewer-body--image img,.media-viewer-body--video video{object-fit:contain;border-radius:8px;max-width:100%;max-height:100%}.media-viewer-video-wrapper{place-items:center;width:100%;display:grid}.media-viewer-video{background:#000;border-radius:12px;max-width:100%;max-height:calc(90vh - 140px);box-shadow:0 4px 20px #0006}.media-viewer-body--pdf iframe{background:#fff;border:none;width:100%;height:100%;display:block}.media-document{border:1px solid hsl(var(--border));background:hsl(var(--background));width:min(820px,100% - 48px);box-shadow:0 12px 38px -30px hsl(var(--foreground) / .3);border-radius:12px;margin:24px auto;padding:34px 40px}.media-document--plain{white-space:pre-wrap;word-break:break-word;min-height:calc(100% - 48px);font:13px/1.65 ui-monospace,SFMono-Regular,Menlo,monospace}.media-viewer-loading{height:100%;color:hsl(var(--muted-foreground));justify-content:center;align-items:center;gap:8px;font-size:13px;display:flex}.media-viewer-loading svg{width:17px;height:17px;animation:.85s linear infinite spin}@media (max-width:640px){.composer-command-menu{width:auto;right:0}.media-card{width:min(272px,82vw)}.media-viewer-backdrop{padding:0}.media-viewer{border:none;border-radius:0;width:100vw;height:100vh}.media-document{width:calc(100% - 24px);margin:12px auto;padding:22px 18px}.md .image-preview-trigger{max-width:100%}}.a2ui-surface{width:100%;max-width:360px;font-size:14px}.a2ui-card{background:hsl(var(--card));border:1px solid hsl(var(--border));box-shadow:0 1px 2px hsl(var(--foreground) / .04),0 8px 24px -16px hsl(var(--foreground) / .18);border-radius:8px;padding:18px}.a2ui-column,.a2ui-row{gap:10px}.a2ui-text{color:hsl(var(--foreground));margin:0;line-height:1.5}.a2ui-text--h1{letter-spacing:0;font-size:19px;font-weight:650}.a2ui-text--h2{letter-spacing:0;font-size:16px;font-weight:650}.a2ui-text--h3{font-size:14px;font-weight:600}.a2ui-text--h4{color:hsl(var(--muted-foreground));text-transform:uppercase;letter-spacing:0;font-size:12px;font-weight:600}.a2ui-text--caption{color:hsl(var(--muted-foreground));font-size:12px}.a2ui-text--body{font-size:14px}.a2ui-icon{color:hsl(var(--muted-foreground));justify-content:center;align-items:center;font-size:15px;line-height:1;display:inline-flex}.a2ui-divider--h{background:hsl(var(--border));width:100%;height:1px;margin:4px 0}.a2ui-divider--v{background:hsl(var(--border));align-self:stretch;width:1px}.a2ui-button{background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));cursor:pointer;font:inherit;border:1px solid #0000;border-radius:10px;padding:8px 14px;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{color:hsl(var(--foreground));background:0 0}.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{background:linear-gradient(180deg,#f6fbfe,hsl(var(--card)) 42%),hsl(var(--card));box-shadow:0 1px 2px hsl(var(--foreground) / .05),0 18px 48px -28px #283d5359;border-color:#d7e0ea;padding:0;overflow:hidden}.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]{color:#004fa3;background:#006fe61a;border-radius:999px;width:28px;height:28px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-title]{color:#41454e;white-space:nowrap;text-overflow:ellipsis;font-size:13px;overflow:hidden}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-status-chip]{background:#e3f8ed;border:1px solid #bbe7d2;border-radius:999px;flex-shrink:0;gap:6px;padding:5px 9px}.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]{background:hsl(var(--background) / .88);border:1px solid #dde6ee;border-radius:8px;gap:16px;padding:18px;position:relative}.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;gap:2px;min-width:0}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-origin-code],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-destination-code]{color:#191d24;font-size:34px;font-weight:760;line-height:1}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-origin-label],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-destination-label]{color:#717784;font-size:11px;font-weight:700}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-origin-city],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-destination-city]{color:#545964;font-size:13px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-route-mark]{flex:none;gap:3px;padding:0 4px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-route-icon]{color:#0054ad;background:#006fe61f;border-radius:999px;width:34px;height:34px}.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-duration],.a2ui-surface[data-a2ui-surface^=flight-] [data-a2ui-id=flight-aircraft]{white-space:nowrap;font-size:11px}.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]{background:#f3f4f6;border:1px solid #e5e7eb;border-radius:8px;flex:1 1 0;gap:2px;min-width:0;padding:11px 12px}.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]{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.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]{background:#d9e0e8;margin:0}@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));color:hsl(var(--muted-foreground));border-radius:10px;padding:8px 10px;font-size:12px}.a2ui-fallback pre{margin:6px 0 0;overflow-x:auto}.boot{background:hsl(var(--background));height:100vh}.boot-error{color:hsl(var(--foreground));flex-direction:column;justify-content:center;align-items:center;gap:12px;font-size:14px;display:flex}.boot-error p{margin:0}.boot-error button,.login-provider-error button{border:1px solid hsl(var(--border));background:hsl(var(--card));color:hsl(var(--foreground));font:inherit;cursor:pointer;border-radius:8px;padding:7px 18px;font-size:13px}.boot-error button:hover,.login-provider-error button:hover{background:hsl(var(--accent))}.navbar{background:0 0;flex:0 0 54px;justify-content:space-between;align-items:center;gap:16px;min-height:54px;padding:0 10px;display:flex}.navbar-left,.navbar-right,.navbar-default,.navbar-portal-slot,.navbar-portal-actions{align-items:center;display:flex}.navbar-left{flex:1;min-width:0;container-type:inline-size}.navbar-default{min-width:0}.navbar-title-group{align-items:center;gap:6px;min-width:0;display:flex}.loading-gap-spinner{box-sizing:border-box;border:1.5px solid #111;border-right-color:#0000;border-radius:50%;flex:0 0 16px;width:16px;height:16px;animation:.7s linear infinite loading-gap-spin;display:inline-block}@keyframes loading-gap-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.loading-gap-spinner{animation-duration:1.4s}}.agent-info-trigger{width:30px;height:30px;color:hsl(var(--muted-foreground));cursor:pointer;background:0 0;border:0;border-radius:7px;flex:0 0 30px;justify-content:center;align-items:center;padding:0;transition:background .15s,color .15s;display:inline-flex}.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:none;gap:10px;min-width:0}.navbar-portal-slot,.navbar-portal-actions{min-width:0}.navbar-portal-slot:empty,.navbar-portal-actions:empty,.navbar-left:has(.navbar-portal-slot:not(:empty))>.navbar-default{display:none}.global-deploy-center{z-index:38;position:relative}.global-deploy-task{border:1px solid hsl(var(--border));background:hsl(var(--background) / .82);max-width:300px;min-height:32px;color:hsl(var(--muted-foreground));font:inherit;white-space:nowrap;cursor:pointer;border-radius:7px;outline:none;align-items:center;gap:7px;padding:0 10px;font-size:12px;transition:border-color .12s,background-color .12s;display:flex}.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{color:#1863b4;border-color:#0c77e93d}.global-deploy-task.is-success{color:#277c46;border-color:#279b5138}.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{flex:none;width:14px;height:14px}.global-deploy-task-detail{text-overflow:ellipsis;overflow:hidden}.global-deploy-task-chevron{flex:none;width:13px;height:13px;transition:transform .14s}.global-deploy-task-chevron.is-open{transform:rotate(180deg)}.global-deploy-task-scrim{z-index:1;background:0 0;border:0;padding:0;position:fixed;top:0;right:0;bottom:0;left:0}.global-deploy-popover{z-index:2;border:1px solid hsl(var(--border));background:hsl(var(--background));width:390px;max-width:calc(100vw - 32px);box-shadow:0 14px 36px hsl(var(--foreground) / .14);border-radius:10px;position:absolute;top:40px;right:0;overflow:hidden}.global-deploy-popover-head{border-bottom:1px solid hsl(var(--border));height:44px;color:hsl(var(--foreground));justify-content:space-between;align-items:center;padding:0 14px;font-size:13px;font-weight:650;display:flex}.global-deploy-popover-head span:last-child{background:hsl(var(--secondary));min-width:20px;color:hsl(var(--muted-foreground));text-align:center;border-radius:999px;padding:1px 6px;font-size:11px}.global-deploy-list{max-height:min(520px,100vh - 82px);padding:8px;overflow-y:auto}.global-deploy-empty{color:hsl(var(--muted-foreground));text-align:center;padding:34px 16px;font-size:12.5px}.global-deploy-item{border:1px solid hsl(var(--border) / .8);background:hsl(var(--canvas) / .42);border-radius:8px;padding:12px}.global-deploy-item+.global-deploy-item{margin-top:7px}.global-deploy-item-head{justify-content:space-between;align-items:center;gap:12px;display:flex}.global-deploy-runtime-name{min-width:0;color:hsl(var(--foreground));text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:650;overflow:hidden}.global-deploy-status{color:hsl(var(--muted-foreground));flex:none;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{grid-template-columns:1fr 1fr;gap:9px 14px;margin:11px 0 0;display:grid}.global-deploy-meta>div{min-width:0}.global-deploy-meta dt{color:hsl(var(--muted-foreground));margin-bottom:3px;font-size:10.5px}.global-deploy-meta dd{color:hsl(var(--foreground));text-overflow:ellipsis;white-space:nowrap;margin:0;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11.5px;overflow:hidden}.global-deploy-message{color:hsl(var(--muted-foreground));text-overflow:ellipsis;white-space:nowrap;margin:10px 0 0;font-size:11.5px;line-height:1.45;overflow:hidden}.global-deploy-error{color:hsl(var(--muted-foreground));margin-top:10px;font-size:11.5px}.deploy-error-message-text{-webkit-line-clamp:3;overflow-wrap:anywhere;white-space:pre-wrap;-webkit-box-orient:vertical;margin:0;line-height:1.5;display:-webkit-box;overflow:hidden}.deploy-error-message.is-expanded .deploy-error-message-text{-webkit-line-clamp:unset;max-height:280px;display:block;overflow:auto}.deploy-error-message-actions{justify-content:flex-end;gap:2px;margin-top:6px;display:flex}.deploy-error-message-actions .deploy-error-retry{margin-right:auto}.global-deploy-progress{background:hsl(var(--foreground) / .08);border-radius:999px;height:3px;margin-top:10px;overflow:hidden}.global-deploy-progress span{border-radius:inherit;background:#2581e4;height:100%;transition:width .18s;display:block}.global-deploy-item-actions{justify-content:flex-end;margin-top:9px;display:flex}.global-deploy-item-actions button{border:1px solid hsl(var(--border));background:hsl(var(--background));min-height:27px;color:hsl(var(--muted-foreground));font:inherit;cursor:pointer;border-radius:5px;padding:0 9px;font-size:11.5px}.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{letter-spacing:-.01em;color:hsl(var(--foreground));padding:5px 8px;font-size:16px;font-weight:650}.agent-dd{min-width:0;max-width:33.333cqw;position:relative}.agent-dd-trigger{color:hsl(var(--foreground));font:inherit;letter-spacing:-.01em;cursor:pointer;background:0 0;border:none;border-radius:8px;align-items:center;gap:5px;max-width:100%;padding:5px 8px;font-size:16px;font-weight:650;transition:background .12s;display:inline-flex}.agent-dd-trigger:hover{background:hsl(var(--foreground) / .05)}.agent-dd-current{white-space:nowrap;text-overflow:ellipsis;min-width:0;max-width:100%;overflow:hidden}.agent-dd-chev{opacity:.6;width:16px;height:16px;transition:transform .2s}.agent-dd-chev.open{transform:rotate(180deg)}.agent-switch{letter-spacing:-.01em;align-items:center;gap:6px;min-width:0;max-width:33.333cqw;padding:5px 8px;font-size:16px;font-weight:650;display:inline-flex}.agent-switch-action{width:28px;height:28px;color:hsl(var(--muted-foreground));cursor:pointer;background:0 0;border:0;border-radius:7px;flex:0 0 28px;justify-content:center;align-items:center;padding:0;transition:background .12s,color .12s;display:inline-flex}.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{isolation:isolate;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%));cursor:pointer;width:18px;height:18px;box-shadow:none;background-position:20% 12%,80% 80%,50%;background-size:180% 180%,160% 160%,100% 100%;border:none;border-radius:999px;flex-shrink:0;justify-content:center;align-items:center;transition:filter .16s,transform .16s;animation:9s ease-in-out infinite alternate avatar-smoke-drift;display:flex;position:relative;overflow:hidden}.account-avatar:hover{filter:saturate(1.12)brightness(1.03);transform:scale(1.035)}.account-avatar.has-image{animation:none}.account-avatar-image{z-index:1;border-radius:inherit;object-fit:cover;width:100%;height:100%;position:absolute;top:0;right:0;bottom:0;left:0}@keyframes avatar-smoke-drift{0%{background-position:18% 12%,82% 84%,50%}50%{background-position:58% 42%,54% 62%,50%}to{background-position:82% 70%,26% 24%,50%}}.account-avatar--lg{cursor:default;border-radius:999px;width:40px;height:40px}.account-pop{z-index:31;background:hsl(var(--panel));border:1px solid hsl(var(--border));min-width:220px;box-shadow:0 8px 28px hsl(var(--foreground) / .14);border-radius:14px;padding:12px;animation:.12s ddpop;position:absolute;top:calc(100% + 8px);right:0}.account-head{align-items:center;gap:10px;display:flex}.account-id{flex:1;min-width:0}.account-name-row{align-items:center;gap:8px;min-width:0;display:flex}.account-name{white-space:nowrap;text-overflow:ellipsis;flex:1;min-width:0;font-size:14px;font-weight:600;overflow:hidden}.account-sub{color:hsl(var(--muted-foreground));white-space:nowrap;text-overflow:ellipsis;margin-top:2px;font-size:12px;line-height:1.35;overflow:hidden}.account-action{width:100%;color:hsl(var(--foreground));font:inherit;cursor:pointer;background:0 0;border:none;border-radius:10px;align-items:center;gap:8px;margin-top:10px;padding:9px 10px;font-size:13px;transition:background .12s;display:flex}.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))}.sidebar-footer{flex-shrink:0;margin-top:auto}.sidebar-user{flex-shrink:0;padding:8px 10px 12px;position:relative}.sidebar-user-row{align-items:center;gap:4px;display:flex}.sidebar-user-btn{min-width:0;color:hsl(var(--foreground));font:inherit;cursor:pointer;background:0 0;border:none;border-radius:10px;flex:1;align-items:center;gap:9px;padding:7px 8px;transition:background .12s;display:flex}.sidebar-user-btn:hover{background:hsl(var(--foreground) / .05)}.sidebar-user-identity{flex:1;align-items:center;min-width:0;display:flex}.sidebar-user-name{text-align:left;white-space:nowrap;text-overflow:ellipsis;flex:1;min-width:0;font-size:13px;font-weight:500;overflow:hidden}.sidebar-user-shortcuts{flex-shrink:0;align-items:center;gap:2px;display:flex}.sidebar-user-shortcut{width:28px;height:28px;color:hsl(var(--muted-foreground));cursor:pointer;background:0 0;border:none;border-radius:7px;flex-shrink:0;place-items:center;padding:0;transition:background .12s,color .12s;display:inline-grid}.sidebar-user-shortcut:hover,.sidebar-user-shortcut.is-active{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground))}.sidebar-user-shortcut:focus-visible{outline:2px solid hsl(var(--ring) / .28);outline-offset:1px}.sidebar-user-shortcut .icon{width:16px;height:16px}.sidebar.is-collapsed .sidebar-user-btn{flex:0 0 36px;justify-content:center;gap:0;width:36px;height:36px;padding:2px;overflow:hidden}.sidebar.is-collapsed .sidebar-user-identity,.sidebar.is-collapsed .sidebar-user-shortcuts{display:none}.sidebar.is-collapsed .sidebar-user-pop{width:220px;left:8px;right:auto}@media (prefers-reduced-motion:reduce){.sidebar{transition:none}}.sidebar-user-pop{position:absolute;inset:auto 10px calc(100% - 4px)}.skillcenter-pager button:focus-visible,.skill-detail-close:focus-visible{outline:2px solid hsl(var(--ring) / .28);outline-offset:1px}.skillcenter-status{background:hsl(var(--muted));color:hsl(var(--muted-foreground));border-radius:999px;flex-shrink:0;padding:2px 6px;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-pager{border-top:1px solid hsl(var(--border));height:44px;color:hsl(var(--muted-foreground));flex:0 0 44px;justify-content:space-between;align-items:center;gap:12px;padding:0 12px;font-size:11.5px;display:flex}.skillcenter-pager-actions{align-items:center;gap:7px;display:flex}.skillcenter-pager-actions>span{text-align:center;min-width:38px}.skillcenter-pager button,.skill-detail-close{color:hsl(var(--muted-foreground));cursor:pointer;background:0 0;border:0;border-radius:6px;place-items:center;display:grid}.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;color:hsl(var(--muted-foreground));text-align:center;overflow-wrap:anywhere;justify-content:center;align-items:center;gap:8px;padding:24px;font-size:12.5px;line-height:1.55;display:flex}.skillcenter-error{color:hsl(var(--destructive))}.skillcenter-loading--overlay{z-index:2;background:hsl(var(--background) / .82);-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);min-height:0;position:absolute;top:0;right:0;bottom:0;left:0}.skillcenter-loading-mark{border:1.5px solid hsl(var(--foreground) / .16);border-top-color:hsl(var(--foreground) / .62);border-radius:50%;flex-shrink:0;width:14px;height:14px;animation:.8s linear infinite spin}.skill-detail-backdrop{z-index:80;background:hsl(var(--foreground) / .25);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);place-items:center;padding:16px;display:grid;position:fixed;top:0;right:0;bottom:0;left:0}.skill-detail-dialog{border:1px solid hsl(var(--border));background:hsl(var(--background));width:min(760px,100%);height:min(760px,100%);min-height:0;box-shadow:0 18px 48px hsl(var(--foreground) / .16);border-radius:12px;flex-direction:column;display:flex;overflow:hidden}.skill-detail-head{border-bottom:1px solid hsl(var(--border));flex-shrink:0;justify-content:space-between;align-items:flex-start;gap:16px;padding:16px 18px 14px;display:flex}.skill-detail-heading{align-items:flex-start;gap:11px;min-width:0;display:flex}.skill-detail-heading>div{min-width:0}.skill-detail-heading h2{text-overflow:ellipsis;white-space:nowrap;margin:1px 0 4px;font-size:16px;font-weight:650;line-height:22px;overflow:hidden}.skill-detail-heading p{color:hsl(var(--muted-foreground));overflow-wrap:anywhere;-webkit-line-clamp:2;-webkit-box-orient:vertical;margin:0;font-size:12px;line-height:17px;display:-webkit-box;overflow:hidden}.skill-detail-close{flex:0 0 30px;width:30px;height:30px;padding:0}.skill-detail-meta{border-bottom:1px solid hsl(var(--border));background:hsl(var(--canvas) / .45);flex-shrink:0;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 18px;margin:0;padding:14px 18px;display:grid}.skill-detail-meta>div{min-width:0}.skill-detail-meta dt{color:hsl(var(--muted-foreground));margin-bottom:3px;font-size:10.5px}.skill-detail-meta dd{color:hsl(var(--foreground));text-overflow:ellipsis;white-space:nowrap;margin:0;font-size:12px;line-height:17px;overflow:hidden}.skill-detail-content{flex-direction:column;flex:1;min-height:0;display:flex}.skill-detail-content-title{border-bottom:1px solid hsl(var(--border));flex:0 0 40px;align-items:center;height:40px;padding:0 18px;font-size:12px;font-weight:600;display:flex}.skill-detail-content>.skillcenter-loading,.skill-detail-content>.skillcenter-error,.skill-detail-content>.skillcenter-empty{flex:1;min-height:0}.skill-detail-markdown{overflow-wrap:anywhere;flex:1;min-height:0;padding:18px 22px 28px;overflow-y:auto}@media (max-width:760px){.skill-detail-meta{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width:560px){.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;justify-content:center;align-items:flex-start;min-height:0;padding:8vh 16px 16px;display:flex;overflow-y:auto}.addagent-card{width:100%;max-width:480px}.addagent-title{letter-spacing:-.01em;margin:0 0 6px;font-size:20px;font-weight:650}.addagent-sub{color:hsl(var(--muted-foreground));margin:0 0 22px;font-size:13px;line-height:1.6}.addagent-field{margin-bottom:14px;display:block}.addagent-label{color:hsl(var(--muted-foreground));margin-bottom:6px;font-size:12.5px;font-weight:500;display:block}.addagent-input{border:1px solid hsl(var(--border));width:100%;font:inherit;background:hsl(var(--background));color:hsl(var(--foreground));border-radius:10px;padding:10px 12px;font-size:14px}.addagent-input:focus{border-color:hsl(var(--ring) / .4);outline:none}.addagent-error{background:hsl(var(--destructive) / .1);color:hsl(var(--destructive));border-radius:10px;margin:4px 0 14px;padding:9px 12px;font-size:12.5px;line-height:1.5}.addagent-actions{justify-content:flex-end;gap:8px;margin-top:4px;display:flex}.addagent-btn{font:inherit;cursor:pointer;border:1px solid #0000;border-radius:10px;align-items:center;gap:7px;padding:9px 16px;font-size:14px;font-weight:500;transition:background .12s,opacity .12s;display:inline-flex}.addagent-btn--ghost{border-color:hsl(var(--border));color:hsl(var(--foreground));background:0 0}.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-direction:column;flex:1;width:100%;max-width:720px;min-height:0;margin:0 auto;padding:28px 16px 16px;display:flex}.search-box{border:1px solid hsl(var(--border));background:hsl(var(--background));border-radius:12px;align-items:center;gap:0;padding:5px 6px;transition:border-color .16s,box-shadow .16s;display:flex;position:relative}.search-box:focus-within{border-color:hsl(var(--foreground) / .3);box-shadow:0 0 0 3px hsl(var(--foreground) / .035)}.search-source-picker-wrap{flex:none;position:relative}.search-source-picker{max-width:176px;height:34px;color:hsl(var(--foreground));font:inherit;cursor:pointer;background:0 0;border:0;border-radius:7px;align-items:center;gap:5px;padding:0 8px;display:inline-flex}.search-source-picker:hover,.search-source-picker[aria-expanded=true]{background:hsl(var(--foreground) / .045)}.search-source-picker>span{flex:none;font-size:13px;font-weight:550}.search-source-picker>small{color:hsl(var(--muted-foreground));text-overflow:ellipsis;white-space:nowrap;font-size:10px;font-weight:400;overflow:hidden}.search-source-chevron{width:12px;height:12px;color:hsl(var(--muted-foreground));flex:none;transition:transform .15s}.search-source-chevron.open{transform:rotate(180deg)}.search-source-menu{z-index:30;border:1px solid hsl(var(--border));background:hsl(var(--panel));width:224px;box-shadow:0 12px 28px hsl(var(--foreground) / .1);border-radius:9px;flex-direction:column;padding:5px;display:flex;position:absolute;top:calc(100% + 9px);left:-6px}.search-source-menu>button{min-width:0;color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:6px;flex-direction:column;gap:2px;padding:8px 9px;display:flex}.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{max-width:100%;color:hsl(var(--muted-foreground));text-overflow:ellipsis;white-space:nowrap;font-size:10.5px;overflow:hidden}.search-box-divider{background:hsl(var(--border));width:1px;height:18px;margin:0 11px 0 5px}.search-input{color:hsl(var(--foreground));font:inherit;background:0 0;border:none;outline:none;flex:1;font-size:15px}.search-input::placeholder{color:hsl(var(--muted-foreground))}.search-input:disabled{cursor:default}.search-go{background:hsl(var(--primary));width:34px;height:34px;color:hsl(var(--primary-foreground));cursor:pointer;border:none;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;transition:opacity .15s,transform .1s;display:flex}.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-direction:column;flex:1;gap:4px;min-height:0;margin-top:12px;display:flex;overflow-y:auto}.search-empty{text-align:center;color:hsl(var(--muted-foreground));padding:40px 8px;font-size:13px}.search-result{text-align:left;width:100%;color:hsl(var(--foreground));font:inherit;cursor:pointer;background:0 0;border:none;border-radius:12px;align-items:flex-start;gap:12px;padding:12px 14px;transition:background .12s;display:flex}.search-result:hover{background:hsl(var(--foreground) / .05)}.search-result-static{cursor:default;border:1px solid #0000}.search-result-static:hover{border-color:hsl(var(--border));background:hsl(var(--foreground) / .025)}a.search-result{color:inherit;text-decoration:none}.search-result-ext{vertical-align:-1px;opacity:.6;width:12px;height:12px;margin-left:4px}.search-result-icon{width:16px;height:16px;color:hsl(var(--muted-foreground));stroke:currentColor;stroke-width:1.65px;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0;margin-top:2px}.search-result-body{flex:1;min-width:0}.search-result-head{justify-content:space-between;align-items:baseline;gap:10px;display:flex}.search-result-title{white-space:nowrap;text-overflow:ellipsis;font-size:14px;font-weight:600;overflow:hidden}.search-result-meta{color:hsl(var(--muted-foreground));flex-shrink:0;font-size:11.5px}.search-result-snippet{color:hsl(var(--muted-foreground));-webkit-line-clamp:2;-webkit-box-orient:vertical;margin-top:3px;font-size:12.5px;line-height:1.5;display:-webkit-box;overflow:hidden}.search-result-snippet-expanded{-webkit-line-clamp:4;white-space:pre-wrap;overflow-wrap:anywhere}.login{border:1px solid hsl(var(--border));background:hsl(var(--panel));color:hsl(var(--foreground));border-radius:14px;flex-direction:column;display:flex;position:fixed;top:10px;right:10px;bottom:10px;left:10px;overflow:hidden}.login-top{padding:18px 24px}.login-brand{letter-spacing:-.01em;align-items:center;gap:9px;font-family:Byte Sans,ui-sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-size:15px;font-weight:600;display:inline-flex}.login-main{flex:1;justify-content:center;align-items:center;padding:0 24px;display:flex}.login-card{width:100%;max-width:420px}.login-title{letter-spacing:-.02em;margin:0 0 14px;font-family:Byte Sans,ui-sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-size:28px;font-weight:700;line-height:1.2}.login-sub{color:hsl(var(--muted-foreground));margin:0 0 28px;font-size:15px}.login-btn{border:1px solid hsl(var(--border));background:hsl(var(--background));width:100%;color:hsl(var(--foreground));font:inherit;cursor:pointer;border-radius:14px;justify-content:center;align-items:center;gap:8px;padding:14px 18px;font-size:15px;font-weight:500;transition:background .15s,border-color .15s,transform .1s;display:flex}.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{color:hsl(var(--muted-foreground));margin:18px 0 0;font-size:12px}.login-legal{color:hsl(var(--muted-foreground));margin:6px 0 0;font-size:12px}.login-legal a{color:inherit;text-decoration:underline;-webkit-text-decoration-color:hsl(var(--muted-foreground) / .45);text-decoration-color:hsl(var(--muted-foreground) / .45);text-underline-offset:2px;font-weight:600}.login-legal a:hover{color:hsl(var(--foreground))}.login-footer{text-align:center;color:hsl(var(--muted-foreground));padding:18px 24px;font-size:12px}@media (prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition-duration:.001ms!important;animation-duration:.001ms!important;animation-iteration-count:1!important}}.login-providers{flex-direction:column;gap:10px;display:flex}.login-provider-error{color:hsl(var(--destructive));flex-direction:column;align-items:flex-start;gap:12px;font-size:13px;display:flex}.login-provider-error p{margin:0}.login-name{align-items:center;gap:8px;display:flex}.login-name-input{border:1px solid hsl(var(--border));font:inherit;background:hsl(var(--background));color:hsl(var(--foreground));border-radius:14px;flex:1;padding:13px 16px;font-size:15px}.login-name-input:focus{border-color:hsl(var(--ring) / .4);outline:none}.login-name-go{background:hsl(var(--primary));width:36px;height:36px;color:hsl(var(--primary-foreground));cursor:pointer;border:none;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;transition:opacity .15s;display:flex}.login-name-go .icon{width:18px;height:18px}.login-name-go:disabled{opacity:.35;cursor:default}.login-hint{min-height:16px;color:hsl(var(--destructive));margin:8px 0 0;font-size:12px;line-height:16px}.session-loading{z-index:5;color:hsl(var(--muted-foreground));background:hsl(var(--background) / .6);-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);justify-content:center;align-items:center;gap:8px;font-size:14px;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.main{position:relative}.topo{background:hsl(var(--background));border:1px solid hsl(var(--border));width:288px;min-height:0;box-shadow:0 8px 24px hsl(var(--foreground) / .035);z-index:2;border-radius:18px;flex-direction:column;padding:16px;display:flex;position:absolute;top:28px;bottom:18px;right:18px;overflow:hidden}.topo.is-loading{place-items:center;min-height:88px;display:grid;bottom:auto}.topo.is-drawer{width:auto;min-height:0;max-height:none;box-shadow:none;background:0 0;border:0;border-radius:0;padding:22px;position:static;overflow:visible}.topo.is-loading.is-drawer{min-height:112px}.topo-loading-label{font-size:12px;line-height:1.5}.topo-agent-card{border:0;border-bottom:1px solid hsl(var(--border) / .72);background:0 0;border-radius:0;flex:none;min-width:0;padding:0 0 16px}.topo-agent-heading{flex-direction:column;gap:4px;min-width:0;display:flex}.topo-agent-heading h2{color:hsl(var(--foreground));letter-spacing:-.01em;text-overflow:ellipsis;white-space:nowrap;margin:0;font-size:15px;font-weight:650;line-height:1.4;overflow:hidden}.topo-agent-heading>span{color:hsl(var(--muted-foreground));text-overflow:ellipsis;white-space:nowrap;font-size:11.5px;line-height:1.4;overflow:hidden}.topo-description{color:hsl(var(--muted-foreground));overflow-wrap:anywhere;-webkit-line-clamp:3;-webkit-box-orient:vertical;margin:12px 0 0;font-size:12px;line-height:1.6;display:-webkit-box;overflow:hidden}.topo-module-stack{flex:1;grid-template-rows:minmax(124px,.95fr) minmax(142px,1.15fr) minmax(160px,.9fr);gap:0;min-width:0;min-height:0;display:grid}.topo-module-stack:has(.topo-environment-card){grid-template-rows:minmax(124px,.95fr) minmax(142px,1.15fr) minmax(106px,.72fr) minmax(160px,.9fr)}.topo-module-card{background:0 0;border:0;border-radius:0;flex-direction:column;min-width:0;min-height:0;padding:14px 0;display:flex}.topo-module-card+.topo-module-card{border-top:1px solid hsl(var(--border) / .72)}.topo-module-title{min-height:20px;color:hsl(var(--muted-foreground));align-items:center;gap:6px;width:100%;margin-bottom:0;font-size:13px;font-weight:600;line-height:1;display:inline-flex;position:static}.topo-module-label{text-overflow:ellipsis;white-space:nowrap;align-items:center;height:20px;display:inline-flex;overflow:hidden}.topo-section-count{background:hsl(var(--muted) / .72);min-width:18px;height:18px;color:hsl(var(--muted-foreground));font-variant-numeric:tabular-nums;white-space:nowrap;border-radius:999px;justify-content:center;align-items:center;padding:0 5px;font-size:11px;font-weight:650;line-height:1;display:inline-flex}.topo-remove-capability:disabled,.topo-capability-add-slot:disabled{cursor:not-allowed;opacity:.45}.topo-module-scroll{box-sizing:border-box;overscroll-behavior:contain;scrollbar-color:hsl(var(--border)) transparent;scrollbar-width:thin;flex:1;min-height:24px;padding-top:9px;overflow-y:auto}.topo-module-scroll::-webkit-scrollbar{width:4px}.topo-module-scroll::-webkit-scrollbar-track{background:0 0}.topo-module-scroll::-webkit-scrollbar-thumb{background:hsl(var(--border));border-radius:999px}.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}.session-environment-select{flex-direction:column;gap:6px;min-width:0;padding-top:9px;display:flex}.session-environment-list{flex-direction:column;flex:1;gap:0;min-width:0;min-height:0;display:flex;overflow-y:auto}.topo-environment-card .session-environment-select{flex:1;min-height:0}.session-environment-item{align-items:center;gap:8px;min-width:0;min-height:40px;padding:7px 2px;display:flex}.session-environment-item+.session-environment-item{border-top:1px solid hsl(var(--border) / .72)}.session-environment-item__icon{border:1px solid hsl(var(--border));width:26px;height:26px;color:hsl(var(--muted-foreground));border-radius:7px;flex:0 0 26px;place-items:center;display:inline-grid}.session-environment-item__icon svg{width:15px;height:15px}.session-environment-item__copy{flex-direction:column;flex:1;gap:1px;min-width:0;display:flex}.session-environment-item__copy strong{color:hsl(var(--foreground));text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;font-weight:500;line-height:1.35;overflow:hidden}.session-environment-item__copy small{color:hsl(var(--muted-foreground));text-overflow:ellipsis;white-space:nowrap;font-size:10.5px;line-height:1.35;overflow:hidden}.session-environment-select p{color:hsl(var(--muted-foreground));margin:0;font-size:11px;line-height:1.45}.session-environment-select p.is-error{color:hsl(var(--destructive))}.session-environment-dialog{max-height:min(620px,100vh - 48px)}.session-environment-picker{flex-direction:column;grid-template-columns:minmax(0,1fr);max-height:340px;display:flex;overflow-y:auto}.session-environment-picker__group{flex-direction:column;gap:8px;display:flex}.session-environment-picker__group+.session-environment-picker__group{border-top:1px solid hsl(var(--border));padding-top:12px}.session-environment-picker__group>h3{color:hsl(var(--muted-foreground));margin:0;font-size:11px;font-weight:600;line-height:1.4}.session-environment-option{cursor:pointer}.session-environment-option.is-selected{border-color:hsl(var(--primary) / .45);background:hsl(var(--primary) / .055)}.session-environment-option.is-covered{border-color:hsl(var(--primary) / .24);background:hsl(var(--primary) / .03);cursor:default}.session-environment-option.is-disabled{cursor:not-allowed;opacity:.5}.session-environment-option .studio-tool-option-copy small{color:hsl(var(--muted-foreground));text-overflow:ellipsis;white-space:nowrap;font-size:10.5px;line-height:1.35;overflow:hidden}.session-environment-option>input{clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.session-environment-check{border:1px solid hsl(var(--border));background:hsl(var(--panel));color:#0000;border-radius:4px;flex:0 0 16px;place-items:center;width:16px;height:16px;margin:0 2px 0 8px;transition:border-color .15s,background .15s,color .15s;display:inline-grid}.session-environment-check svg{width:12px;height:12px}.session-environment-option>input:checked+.session-environment-check{border-color:hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.session-environment-option>input:focus-visible+.session-environment-check{outline:2px solid hsl(var(--ring) / .38);outline-offset:2px}.session-environment-dialog__footer{border-top:1px solid hsl(var(--border));justify-content:space-between;align-items:center;gap:12px;min-height:60px;padding:12px 20px;display:flex}.session-environment-dialog__footer>span{color:hsl(var(--muted-foreground));font-size:12px}.session-environment-dialog__footer>span.is-error{color:hsl(var(--destructive))}.session-environment-dialog__footer>div{align-items:center;gap:8px;display:flex}.session-environment-dialog__footer button{border:1px solid hsl(var(--border));background:hsl(var(--panel));min-width:72px;height:34px;color:hsl(var(--foreground));font:inherit;white-space:nowrap;cursor:pointer;border-radius:7px;padding:0 14px;font-size:12px}.session-environment-dialog__footer button:hover:not(:disabled){background:hsl(var(--muted) / .5)}.session-environment-dialog__footer button.is-primary{border-color:hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.session-environment-dialog__footer button:disabled{cursor:not-allowed;opacity:.45}.topo-tool-list{flex-direction:column;min-width:0;display:flex}.topo-tool{min-width:0;color:hsl(var(--foreground));align-items:center;gap:6px;padding:7px 2px 7px 14px;font-size:12.5px;line-height:1.4;display:flex;position:relative}.topo-tool:before{content:"";border:1px solid hsl(var(--muted-foreground) / .7);border-radius:2px;width:5px;height:5px;position:absolute;top:13px;left: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{align-items:center;gap:6px;min-width:0;display:flex}.topo-capability-title{flex:1}.topo-capability-name{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:13px;overflow:hidden}.topo-capability-copy{flex-direction:column;gap:1px;min-width:0;display:flex}.topo-capability-copy code{color:hsl(var(--muted-foreground));text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:9.5px;font-weight:450;line-height:1.25;overflow:hidden}.topo-capability-add-slot{border:1px dashed hsl(var(--border));background:hsl(var(--muted) / .18);width:100%;min-height:34px;color:hsl(var(--muted-foreground));font:inherit;cursor:pointer;border-radius:9px;justify-content:center;align-items:center;gap:6px;margin:0;padding:5px 10px;font-size:11.5px;transition:border-color .15s,background .15s,color .15s;display:flex}.topo-capability-add-dock{background:hsl(var(--background));flex:none;padding-top:6px}.topo-capability-add-slot>svg{flex-shrink:0;width:15px;height:15px}.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{background:hsl(var(--primary) / .1);height:17px;color:hsl(var(--primary));border-radius:5px;flex-shrink:0;align-items:center;padding:0 5px;font-size:9.5px;font-weight:650;line-height:1;display:inline-flex}.topo-remove-capability{width:20px;height:20px;color:hsl(var(--muted-foreground));cursor:pointer;background:0 0;border:0;border-radius:6px;flex-shrink:0;justify-content:center;align-items:center;margin-left:auto;padding:0;font-size:15px;line-height:1;display:inline-flex}.topo-remove-capability svg{width:14px;height:14px}.topo-remove-capability:hover:not(:disabled){background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.topo-skill-list{flex-direction:column;min-width:0;display:flex}.topo-skill{flex-direction:column;gap:2px;min-width:0;padding:8px 0;display:flex}.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;color:hsl(var(--foreground));text-overflow:ellipsis;white-space:nowrap;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-size:13px;font-weight:500;line-height:1.45;overflow:hidden}.topo-skill-title{width:100%}.topo-skill-description{color:hsl(var(--muted-foreground));overflow-wrap:anywhere;-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:12px;line-height:1.45;display:-webkit-box;overflow:hidden}.topo-empty{color:hsl(var(--muted-foreground));font-size:11.5px;line-height:1.5}.topo-topology{min-height:0}.topo-canvas-heading{justify-content:space-between;align-items:center;gap:12px;margin-bottom:9px;display:flex}.topo-canvas-expand,.topo-canvas-dialog-header button{width:30px;height:30px;color:hsl(var(--muted-foreground));cursor:pointer;background:0 0;border:0;border-radius:8px;justify-content:center;align-items:center;padding:0;display:inline-flex}.topo-canvas-expand:hover,.topo-canvas-dialog-header button:hover{background:hsl(var(--muted));color:hsl(var(--foreground))}.topo-canvas-expand:focus-visible,.topo-canvas-dialog-header button:focus-visible{outline:2px solid hsl(var(--ring) / .5);outline-offset:2px}.topo-canvas-expand svg,.topo-canvas-dialog-header button svg{width:16px;height:16px}.topo-canvas-preview{border:1px solid hsl(var(--border));background:hsl(var(--background));border-radius:12px;flex:1;min-height:120px;position:relative;overflow:hidden}.topo-canvas-preview .abc-root,.topo-canvas-dialog-body .abc-root{border:0;flex:auto;width:100%;min-width:0;height:100%}.topo-canvas-preview .abc-minimap{display:none}.topo-canvas-dialog{z-index:1200;background:hsl(var(--background));flex-direction:column;min-width:0;min-height:0;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.topo-canvas-dialog-header{border-bottom:1px solid hsl(var(--border));justify-content:space-between;align-items:center;gap:24px;min-height:64px;padding:0 24px;display:flex}.topo-canvas-dialog-header>div{align-items:baseline;gap:10px;min-width:0;display:flex}.topo-canvas-dialog-header strong{font-size:15px;font-weight:600}.topo-canvas-dialog-header span{color:hsl(var(--muted-foreground));text-overflow:ellipsis;white-space:nowrap;font-size:13px;overflow:hidden}.topo-canvas-dialog-body{flex:1;min-width:0;min-height:0;padding:16px;display:flex}.topo-canvas-dialog-body .abc-canvas{border:1px solid hsl(var(--border));border-radius:16px;overflow:hidden}@media (max-width:640px){.topo-canvas-dialog-header{padding:0 16px}.topo-canvas-dialog-body{padding:8px}}.topo-canvas-heading .topo-section-count{flex-shrink:0}@media (min-width:1280px){.agent-info-trigger{display:none}.topo:not(.is-drawer) .topo-module-scroll{max-height:none}.main:has(>.topo)>.error{align-self:flex-start;width:calc(100% - 354px);margin-left:max(16px,50% - 545px);margin-right:0}.main:has(>.topo)>.transcript{padding-right:322px}.main:has(>.topo)>.conversation-composer-slot{padding-left:16px;padding-right:322px}.conversation-composer-slot>.composer-slot>.composer{margin-left:auto;margin-right:auto}}@media (max-width:1279px){.topo{display:none}.topo.is-drawer{display:block}.topo.is-drawer .topo-module-stack{flex-direction:column;display:flex}}@media (prefers-reduced-motion:reduce){.topo-node{transition:none}.topo-node.is-active,.topo-remote{animation:none}}.studio-tool-dialog-layer{z-index:110;place-items:center;padding:24px;display:grid;position:fixed;top:0;right:0;bottom:0;left:0}.studio-tool-dialog-scrim{-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);background:#1013187a;border:0;width:100%;height:100%;padding:0;position:absolute;top:0;right:0;bottom:0;left:0}.studio-tool-dialog{border:1px solid hsl(var(--border));background:hsl(var(--background));border-radius:16px;flex-direction:column;width:min(560px,100vw - 32px);max-height:min(720px,100vh - 48px);animation:.18s cubic-bezier(.22,1,.36,1) studio-tool-dialog-in;display:flex;position:relative;overflow:hidden;box-shadow:0 24px 80px #0d121c40,0 2px 8px #0d121c1f}.studio-tool-dialog.is-wide{width:min(980px,100vw - 48px);height:min(720px,100dvh - 48px)}@keyframes studio-tool-dialog-in{0%{opacity:0;transform:translateY(8px)scale(.985)}to{opacity:1;transform:translateY(0)scale(1)}}.studio-tool-dialog-head{border-bottom:1px solid hsl(var(--border));grid-template-columns:38px minmax(0,1fr) 32px;align-items:center;gap:12px;min-height:76px;padding:16px 18px;display:grid}.studio-tool-dialog-head.is-iconless{grid-template-columns:minmax(0,1fr) 32px}.studio-tool-dialog-mark{background:hsl(var(--primary) / .09);width:38px;height:38px;color:hsl(var(--primary));border-radius:11px;place-items:center;display:grid}.studio-tool-dialog-mark svg{width:20px;height:20px}.studio-tool-dialog-head h2{color:hsl(var(--foreground));letter-spacing:-.01em;margin:0;font-size:15px;font-weight:680}.studio-tool-dialog-head p{color:hsl(var(--muted-foreground));margin:4px 0 0;font-size:11.5px;line-height:1.45}.studio-tool-dialog-close{width:32px;height:32px;color:hsl(var(--muted-foreground));cursor:pointer;background:0 0;border:0;border-radius:8px;place-items:center;padding:0;display:grid}.studio-tool-dialog-close:hover{background:hsl(var(--muted) / .7);color:hsl(var(--foreground))}.studio-tool-dialog-close svg{width:18px;height:18px}.studio-tool-search{border:1px solid hsl(var(--border));background:hsl(var(--background));min-width:0;height:40px;color:hsl(var(--muted-foreground));border-radius:6px;flex:0 0 40px;align-items:center;gap:8px;padding:0 12px;display:flex}.studio-tool-search:focus-within{border-color:hsl(var(--ring) / .65);box-shadow:0 0 0 3px hsl(var(--ring) / .1)}.studio-tool-search svg{flex:none;width:16px;height:16px}.studio-tool-search input{width:100%;min-width:0;height:100%;color:hsl(var(--foreground));font:inherit;background:0 0;border:0;outline:0;padding:0;font-size:12px}.studio-tool-search input::placeholder{color:hsl(var(--muted-foreground) / .8)}.studio-tool-dialog-body{flex-direction:column;gap:12px;min-height:0;padding:16px;display:flex}.studio-tool-picker{overscroll-behavior:contain;flex-direction:column;gap:7px;min-height:120px;display:flex;overflow-y:auto}.studio-tool-option{border:1px solid hsl(var(--border) / .85);background:hsl(var(--background));border-radius:10px;align-items:center;gap:10px;min-width:0;min-height:72px;padding:10px 11px;display:flex}.studio-tool-option:hover{border-color:hsl(var(--foreground) / .2);background:hsl(var(--muted) / .22)}.studio-tool-option-icon{background:hsl(var(--muted) / .75);width:32px;height:32px;color:hsl(var(--foreground) / .78);border-radius:9px;flex:0 0 32px;place-items:center;display:grid}.studio-tool-option-icon svg{width:17px;height:17px}.studio-tool-option-copy{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.studio-tool-option-copy strong{color:hsl(var(--foreground));text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;font-weight:620;overflow:hidden}.studio-tool-option-copy code{color:hsl(var(--muted-foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:10px}.studio-tool-option-copy>span{color:hsl(var(--muted-foreground));-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:11px;line-height:1.35;display:-webkit-box;overflow:hidden}.studio-tool-option>button{background:hsl(var(--foreground));min-width:58px;height:30px;color:hsl(var(--background));font:inherit;cursor:pointer;border:0;border-radius:8px;flex:none;justify-content:center;align-items:center;gap:4px;padding:0 10px;font-size:11px;font-weight:600;display:inline-flex}.studio-tool-option>button:disabled{opacity:.42;cursor:default}.studio-tool-empty{min-height:120px;color:hsl(var(--muted-foreground));text-align:center;justify-content:center;align-items:center;font-size:12px;display:flex}@media (max-width:720px){.studio-tool-dialog-layer{padding:12px}.studio-tool-dialog.is-wide{width:calc(100vw - 24px);height:calc(100dvh - 24px)}.session-environment-dialog__footer{flex-direction:column;align-items:stretch;gap:8px}.session-environment-dialog__footer>div{justify-content:flex-end}}@media (prefers-reduced-motion:reduce){.studio-tool-dialog{animation:none}}.drawer--agent-info{border-right:1px solid hsl(var(--border));width:min(400px,92vw);box-shadow:12px 0 40px hsl(var(--foreground) / .14);border-left:0;animation:.22s cubic-bezier(.22,1,.36,1) agent-info-slide-in;left:0;right:auto}.agent-info-drawer-body{overscroll-behavior:contain;flex:1;min-height:0;overflow-y:auto}@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-direction:column;flex:1;justify-content:center;align-items:center;padding:0 24px 6vh;display:flex}.qc-head{text-align:center;margin-bottom:28px}.qc-title{letter-spacing:-.02em;margin:0;font-size:26px;font-weight:650}.qc-sub{color:hsl(var(--muted-foreground));margin:8px 0 0;font-size:14px}.qc-cards{grid-template-columns:repeat(4,220px);justify-content:center;gap:16px;display:grid}@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{text-align:left;border:1px solid hsl(var(--border));background:hsl(var(--card));cursor:pointer;font:inherit;border-radius:16px;flex-direction:column;align-items:flex-start;gap:6px;padding:20px;transition:border-color .15s,box-shadow .15s;display:flex;position:relative}.qc-card:hover{border-color:hsl(var(--ring) / .35);box-shadow:0 8px 24px -16px hsl(var(--foreground) / .25)}.qc-card-arrow{width:18px;height:18px;color:hsl(var(--muted-foreground));opacity:0;transition:opacity .15s,transform .15s;position:absolute;top:18px;right:18px;transform:translate(-4px)}.qc-card:hover .qc-card-arrow{opacity:1;transform:translate(0)}.qc-icon{background:hsl(var(--secondary));width:40px;height:40px;color:hsl(var(--foreground));border-radius:12px;justify-content:center;align-items:center;margin-bottom:6px;display:inline-flex}.qc-icon svg{width:20px;height:20px}.qc-card-title{font-size:15px;font-weight:600}.qc-card-desc{color:hsl(var(--muted-foreground));font-size:12px;line-height:1.5}.navbar-title{letter-spacing:-.01em;text-overflow:ellipsis;white-space:nowrap;min-width:0;max-width:min(60vw,640px);padding:0;font-size:15px;font-weight:600;overflow:hidden}.create-stub{color:hsl(var(--muted-foreground));flex-direction:column;flex:1;justify-content:center;align-items:center;gap:16px;display:flex}.create-back{font:inherit;color:hsl(var(--muted-foreground));cursor:pointer;background:0 0;border:none;align-self:flex-start;margin:12px;font-size:13px}.create-back:hover{color:hsl(var(--foreground))}.navbar-crumbs{align-items:center;gap:4px;min-width:0;display:flex}.navbar-crumbs>.crumb:first-child{padding-left:0}.crumb{letter-spacing:-.01em;white-space:nowrap;border-radius:6px;padding:2px 4px;font-size:15px;font-weight:600}.crumb-link{font:inherit;color:hsl(var(--muted-foreground));cursor:pointer;background:0 0;border:none;font-weight:500;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{z-index:60;background:hsl(var(--foreground) / .25);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);justify-content:center;align-items:center;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.confirm-box{background:hsl(var(--background));border:1px solid hsl(var(--border));width:340px;max-width:calc(100vw - 32px);box-shadow:0 16px 48px -16px hsl(var(--foreground) / .3);border-radius:14px;padding:20px}.confirm-title{margin-bottom:6px;font-size:15px;font-weight:600}.confirm-text{color:hsl(var(--muted-foreground));margin-bottom:18px;font-size:13px;line-height:1.6}.confirm-actions{justify-content:flex-end;gap:8px;display:flex}.confirm-btn{border:1px solid hsl(var(--border));background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;cursor:pointer;border-radius:8px;padding:7px 14px;font-size:13px;transition:background .12s}.confirm-btn:hover{background:hsl(var(--foreground) / .05)}.confirm-btn--danger{background:hsl(var(--destructive));color:#fff;border-color:#0000}.confirm-btn--danger:hover{background:hsl(var(--destructive) / .9)}.studio-confirm-backdrop{z-index:1300;background:hsl(var(--foreground) / .22);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);place-items:center;padding:32px;animation:.14s ease-out studio-confirm-fade-in;display:grid;position:fixed;top:0;right:0;bottom:0;left:0}.studio-confirm-dialog{border:1px solid hsl(var(--border));background:hsl(var(--background));width:min(420px,100vw - 40px);height:auto;min-height:0;box-shadow:0 24px 64px hsl(var(--foreground) / .16);border-radius:12px;flex-direction:column;animation:.18s cubic-bezier(.2,.8,.2,1) studio-confirm-rise-in;display:flex;overflow:hidden}.studio-confirm-head{border-bottom:1px solid hsl(var(--border));flex:0 0 58px;justify-content:space-between;align-items:center;gap:20px;padding:0 16px 0 18px;display:flex}.studio-confirm-title-wrap{align-items:center;gap:10px;min-width:0;display:flex}.studio-confirm-title-icon{flex:none;place-items:center;display:grid}.studio-confirm-title-icon svg{width:16px;height:16px}.studio-confirm-title-wrap h2{min-width:0;color:hsl(var(--foreground));margin:0;font-size:14px;font-weight:650;line-height:1.35}.studio-confirm-body{padding:24px 20px}.studio-confirm-body p{color:hsl(var(--foreground));margin:0;font-size:14px;line-height:1.65}.studio-confirm-body .studio-confirm-error{margin-top:10px}.studio-confirm-actions{border-top:1px solid hsl(var(--border));justify-content:flex-end;gap:8px;padding:12px 16px;display:flex}.studio-confirm-actions>*{min-width:76px}.studio-confirm-dialog--warning .studio-confirm-title-icon{color:#ba6708}.studio-confirm-dialog--danger .studio-confirm-title-icon{color:hsl(var(--destructive))}@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}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}',Inr=".website-widget{--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%;--canvas: 240 5% 97.3%;--panel: 0 0% 100%;color:hsl(var(--foreground));color-scheme:light;font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,sans-serif;font-size:16px;line-height:normal;text-align:left;-webkit-font-smoothing:antialiased}.website-widget *,.website-widget *:before,.website-widget *:after{box-sizing:border-box}.website-widget img,.website-widget svg{display:block}.website-widget__transcript .builtin-tool-icon>svg{width:18px;height:18px}.website-widget__transcript .builtin-tool-chevron{width:13px;height:13px;flex:0 0 13px}.website-widget__launcher{position:fixed;right:24px;bottom:24px;z-index:2147483000;display:grid;width:56px;height:56px;padding:0;place-items:center;border:1px solid hsl(var(--foreground));border-radius:50%;background:hsl(var(--primary));box-shadow:0 12px 32px hsl(var(--foreground) / .24);cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none;transition:box-shadow .16s ease,transform .16s ease}.website-widget__launcher:hover{box-shadow:0 16px 38px hsl(var(--foreground) / .3);transform:translateY(-1px)}.website-widget__launcher:active{transform:scale(.96)}.website-widget__launcher.is-dragging{cursor:grabbing;transform:none;transition:box-shadow .12s ease}.website-widget__launcher:focus-visible,.website-widget__close:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:3px}.website-widget__launcher-logo{width:30px;height:30px;filter:brightness(0) invert(1);object-fit:contain;pointer-events:none}.website-widget__panel{position:fixed;right:24px;bottom:96px;z-index:2147482999;display:grid;width:min(420px,calc(100vw - 32px));height:min(640px,calc(100dvh - 128px));grid-template-rows:58px minmax(0,1fr) auto;overflow:hidden;border:1px solid hsl(var(--border));border-radius:16px;background:hsl(var(--panel));box-shadow:0 24px 70px hsl(var(--foreground) / .18);opacity:0;pointer-events:none;transform:translateY(10px) scale(.985);transform-origin:right bottom;transition:opacity .18s ease-out,transform .18s ease-out}.website-widget__panel.is-open{opacity:1;pointer-events:auto;transform:translateY(0) scale(1)}.website-widget__header{display:flex;min-width:0;padding:0 12px 0 14px;align-items:center;justify-content:space-between;border-bottom:1px solid hsl(var(--border));background:hsl(var(--background))}.website-widget__identity{display:flex;min-width:0;align-items:center;gap:10px}.website-widget__identity-logo{display:grid;width:30px;height:30px;flex:0 0 30px;place-items:center;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--background))}.website-widget__identity-logo img{width:20px;height:20px;object-fit:contain}.website-widget__identity-copy{display:flex;min-width:0;flex-direction:column;gap:1px}.website-widget__identity-copy strong{overflow:hidden;font-size:13px;font-weight:620;line-height:1.35;text-overflow:ellipsis;white-space:nowrap}.website-widget__identity-copy>span{color:hsl(var(--muted-foreground));font-size:11px;line-height:1.35}.website-widget__close{display:grid;width:32px;height:32px;padding:0;place-items:center;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.website-widget__close:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.website-widget__close svg{width:17px;height:17px}.website-widget__transcript.transcript{min-height:0;padding:20px 18px 10px;overscroll-behavior:contain;background:hsl(var(--background))}.website-widget__transcript .turn{width:100%;margin-bottom:18px}.website-widget__transcript .turn--user .bubble{max-width:88%}.website-widget__error{width:100%;margin:8px auto 12px;padding:10px 12px;border-radius:8px;background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:12.5px;line-height:1.5}.website-widget__composer-slot{padding:10px 14px 14px;border-top:1px solid hsl(var(--border));background:hsl(var(--background))}.website-widget .compact-composer.composer{padding:0}.website-widget .compact-composer .composer-box{align-items:flex-end}.website-widget .compact-composer .comp-input{min-height:36px;padding:7px 6px;font-size:14px}@media (max-width: 480px){.website-widget__launcher{right:14px;bottom:14px}.website-widget__panel{right:12px;bottom:82px;width:calc(100vw - 24px);height:min(620px,calc(100dvh - 96px));border-radius:14px}.website-widget__transcript.transcript{padding:18px 14px 8px}.website-widget__composer-slot{padding:9px 10px 11px}}@media (prefers-reduced-motion: reduce){.website-widget__launcher,.website-widget__panel{transition:none}}",Pnr="data:image/svg+xml,%3csvg%20width='111'%20height='117'%20viewBox='0%200%20111%20117'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%205.60152C0%200.621083%206.02156%20-1.87313%209.54327%201.64857L62.1326%2054.2379C64.3157%2056.421%2064.3157%2059.9606%2062.1326%2062.1438L9.54327%20114.733C6.02157%20118.255%201.56595e-06%20115.761%201.56595e-06%20110.78L0%205.60152Z'%20fill='%2300DBFE'/%3e%3cpath%20d='M104.775%202.20435C109.574%202.20456%20111.977%208.00715%20108.583%2011.4006L64.9133%2055.0686C63.3788%2057.0544%2063.3976%2059.8376%2064.9954%2061.7727L108.59%20105.368C111.983%20108.762%20109.58%20114.564%20104.781%20114.564H94.4495C94.3647%20114.567%2094.279%20114.57%2094.1926%20114.57H72.388C70.9594%20114.57%2069.5886%20114.002%2068.5784%20112.991L17.8352%2062.2493C16.7699%2061.184%2016.2455%2059.7831%2016.259%2058.387C16.2458%2056.9914%2016.7705%2055.5915%2017.8352%2054.5266L68.5725%203.78931C69.5827%202.77917%2070.9535%202.21118%2072.3821%202.21118H82.7014C82.7903%202.20677%2082.8796%202.20435%2082.969%202.20435H104.775Z'%20fill='%230069FF'/%3e%3cpath%20d='M62.2703%2054.38C63.1975%2055.3073%2063.7151%2056.489%2063.825%2057.7003C63.7755%2058.0898%2063.7666%2058.4831%2063.8025%2058.8732C63.6571%2060.0159%2063.1478%2061.1216%2062.2703%2061.9992L45.2146%2079.0529L28.405%2062.2433C27.3399%2061.1782%2026.8144%2059.7779%2026.8279%2058.382C26.8148%2056.9865%2027.3403%2055.5873%2028.405%2054.5226L45.408%2037.5187L62.2703%2054.38Z'%20fill='%230003F5'/%3e%3cpath%20d='M58.6438%2050.7557L54.3909%2055.0087C52.7621%2057.053%2052.809%2059.9769%2054.5598%2061.9364L58.4524%2065.829L39.9309%2084.3495L17.8313%2062.2489C16.7664%2061.1839%2016.2409%2059.7842%2016.2542%2058.3885C16.2409%2056.9928%2016.7663%2055.5931%2017.8313%2054.5282L40.1233%2032.2352L58.6438%2050.7557Z'%20fill='%230003F5'/%3e%3c/svg%3e";function ioe(t,e={}){return qg.t(t,{...e,ns:"adk"})}async function*Nnr(t){if(!t.body)throw new Error("Response has no body");const e=t.body.getReader(),r=new TextDecoder;let n="";const i=s=>s.length>500?ioe("sse.truncatedData",{data:s.slice(0,500),count:s.length}):s,a=(s,o=!1)=>{const l=s.split(/\r?\n/).filter(u=>u.startsWith("data:")).map(u=>u.slice(5).trimStart()).join(` -`);if(!(!l||l==="[DONE]"||l==="ping"))try{return JSON.parse(l)}catch{const u=i(l);throw o?new Error(ioe("sse.incompleteEvent",{data:u})):new Error(ioe("sse.invalidEventJson",{data:u}))}};try{for(;;){const{done:s,value:o}=await e.read();if(s)break;n+=r.decode(o,{stream:!0});let l=n.match(/\r?\n\r?\n/);for(;(l==null?void 0:l.index)!==void 0;){const u=n.slice(0,l.index);n=n.slice(l.index+l[0].length);const h=a(u);h!==void 0&&(yield h),l=n.match(/\r?\n\r?\n/)}}if(n+=r.decode(),n.trim()){const s=a(n,!0);s!==void 0&&(yield s)}}finally{try{await e.cancel()}catch{}finally{e.releaseLock()}}}function Ww(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)?t:void 0}function Ib(t){return typeof t=="string"?t:""}function lVe(t,e){return t==="pending"||t==="running"||t==="completed"||t==="failed"?t:e}function Bnr(t){let e=t;if(typeof e=="string")try{e=JSON.parse(e)}catch{return{}}const r=Ww(e)??{};return Ww(r.result)??r}function $nr(t){var r;const e=(r=Ww(t))==null?void 0:r.branches;return Array.isArray(e)?e.map(n=>{var i;return Ib((i=Ww(n))==null?void 0:i.label)}):[]}function cVe(t,e,r){const n=$nr(t),i=Bnr(e),a=Array.isArray(i.branches)?i.branches:[],s=r==="running"?"running":"pending";return{branches:[0,1].map(l=>{const u=Ww(a[l])??{};return{label:Ib(u.label)||n[l]||`方向 ${l+1}`,content:Ib(u.content),status:lVe(u.status,s),error:Ib(u.error)}})}}function Fnr(t){const e=Ww(t),r=Ww(e==null?void 0:e.veadkStudioToolProgress);return!r||r.toolName!=="branch_compare"||typeof r.branchIndex!="number"||r.branchIndex<0||r.branchIndex>1?null:{toolName:"branch_compare",requestId:Ib(r.requestId),branchIndex:r.branchIndex,label:Ib(r.label),delta:Ib(r.delta),status:lVe(r.status,"running"),error:Ib(r.error)||void 0}}function znr(t,e,r){return{branches:cVe(t,e,"running").branches.map((a,s)=>s===r.branchIndex?{...a,label:r.label||a.label,content:a.content+r.delta,status:r.status,error:r.error??a.error}:a)}}function jl(t,e){return qg.t(`blocks.codexProgress.${t}`,{ns:"conversation",...e})}const uVe=28e4;function hVe(t){try{return JSON.stringify(t).length}catch{return uVe}}function Unr(t){const e=t.slice(-200);let r=e.reduce((n,i)=>n+hVe(i),0);for(;e.length>1&&r>uVe;)r-=hVe(e.shift());return e}function md(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)?t:void 0}function gi(t){return typeof t=="string"?t:""}function aoe(t,e=""){const r=gi(t).toLowerCase();return e.endsWith(".failed")||["failed","error","declined","cancelled"].includes(r)?"failed":e.endsWith(".completed")||["completed","done","success"].includes(r)?"completed":"running"}function dVe(t){if(t.response!==void 0)return t.response;if(t.result!==void 0)return t.result;const e=t.aggregatedOutput??t.aggregated_output??t.output,r=t.exitCode??t.exit_code;if(!(e===void 0&&r===void 0))return{...e!==void 0?{output:e}:{},...r!==void 0?{exitCode:r}:{}}}function fVe(t){if(t.args!==void 0)return t.args;if(t.arguments!==void 0)return t.arguments;if(t.input!==void 0)return t.input;const e=gi(t.command),r=gi(t.cwd);if(e||r)return{...e?{command:e}:{},...r?{cwd:r}:{}};if(t.changes!==void 0)return{changes:t.changes};if(t.approval!==void 0)return t.approval}function Yw(t,e,r,n,i){return{kind:"tool",name:t,callId:e,args:n,response:i,done:r!=="running",status:r,...r==="failed"?{defaultOpen:!0}:{}}}function pVe(t){const e=gi(t.id||t.itemId||t.item_id),r=gi(t.kind);if(!e||!r)return null;const n=aoe(t.status),i=gi(t.text||t.detail||t.delta),a=!gi(t.text||t.detail)&&typeof t.delta=="string";if(r==="thinking"||r==="reasoning")return i?{id:e,block:{kind:"thinking",text:i,done:n!=="running"},appendText:a}:null;if(r==="commentary")return i?{id:e,block:{kind:"text",text:i},appendText:a}:null;if(["message","text","assistant_final","final"].includes(r))return i?{id:e,block:{kind:"text",text:i},appendText:a,finalAnswer:!0}:null;if(r==="plan"){const s=Array.isArray(t.plan)?t.plan:[];return{id:e,block:{kind:"plan",title:gi(t.title)||jl("planTitle"),summary:i||void 0,items:s.flatMap(o=>{const l=md(o),u=gi(l==null?void 0:l.text);if(!u)return[];const h=gi(l==null?void 0:l.status);return[{text:u,status:["pending","in_progress","completed","failed"].includes(h)?h:"pending"}]}),done:n!=="running"}}}if(["tool","command","command_execution","commandExecution","file_change","fileChange","mcp_tool_call","mcpToolCall","collab_tool_call","web_search","approval","status"].includes(r)){const s=jl(r==="file_change"||r==="fileChange"?"fallback.fileChange":r==="approval"?"fallback.approval":r==="status"?"fallback.status":"fallback.command"),o=fVe(t),l=dVe(t)??(r==="status"&&i||void 0);return{id:e,block:Yw(gi(t.name||t.title)||s,e,n,o,l)}}return null}function gVe(t){const e=gi(t.type),r=md(t.item),n=gi(r==null?void 0:r.type),i=gi((r==null?void 0:r.id)||t.id)||(e==="turn.failed"?"turn":"");if(!i)return null;const a=aoe(r==null?void 0:r.status,e);if(n==="reasoning"||n==="agent_message"){const s=gi(r==null?void 0:r.text);return s?{id:i,block:n==="reasoning"?{kind:"thinking",text:s,done:a!=="running"}:{kind:"text",text:s},...n==="agent_message"&&(r==null?void 0:r.phase)!=="commentary"?{finalAnswer:!0}:{}}:null}if(n==="todo_list"){const o=(Array.isArray(r==null?void 0:r.items)?r.items:[]).flatMap(l=>{const u=md(l),h=gi(u==null?void 0:u.text);if(!h)return[];const d=gi(u==null?void 0:u.status).toLowerCase(),f=(u==null?void 0:u.completed)===!0||["completed","done"].includes(d)?"completed":["failed","error"].includes(d)?"failed":["in_progress","running"].includes(d)?"in_progress":"pending";return[{text:h,status:f}]});return o.length?{id:i,block:{kind:"plan",title:jl("planTitle"),summary:jl("planSummary",{completed:o.filter(l=>l.status==="completed").length,total:o.length}),items:o,done:a!=="running"}}:null}if(n==="command_execution"){const s=jl(`command.${a}`);return{id:i,block:Yw(s,i,a,fVe(r??{}),dVe(r??{}))}}if(n==="file_change"){const s=Array.isArray(r==null?void 0:r.changes)?r.changes:[],o=s.length?jl("projectFiles",{count:s.length}):jl("projectFile"),l=jl(`fileChange.${a}`,{subject:o});return{id:i,block:Yw(l,i,a,s.length?{changes:s}:void 0)}}if(n==="mcp_tool_call"){const s=[gi(r==null?void 0:r.server),gi(r==null?void 0:r.tool)].filter(Boolean).join("/")||jl("externalTool"),o=jl(`mcp.${a}`,{tool:s}),l=md(r==null?void 0:r.error),u=(r==null?void 0:r.result)!==void 0?r.result:gi(l==null?void 0:l.message)||void 0;return{id:i,block:Yw(o,i,a,r==null?void 0:r.arguments,u)}}if(n==="collab_tool_call"){const s=gi(r==null?void 0:r.tool),o=["spawn_agent","send_input","wait","close_agent"].includes(s)?s:"default",l=jl(`collaboration.${o}.${a}`),u=Object.fromEntries(["tool","receiver_thread_ids","prompt"].filter(h=>(r==null?void 0:r[h])!==void 0).map(h=>[h,r==null?void 0:r[h]]));return{id:i,block:Yw(l,i,a,Object.keys(u).length?u:void 0,r==null?void 0:r.agents_states)}}if(n==="web_search"){const s=jl(`webSearch.${a}`),o=Object.fromEntries(["query","action"].filter(l=>(r==null?void 0:r[l])!==void 0).map(l=>[l,r==null?void 0:r[l]]));return{id:i,block:Yw(s,i,a,Object.keys(o).length?o:void 0)}}if(n==="error"||e==="error"||e==="turn.failed"){const s=md(t.error),o=gi((r==null?void 0:r.message)||t.message||(s==null?void 0:s.message))||jl("errorDetail");return{id:i,block:Yw(jl("errorTitle"),i,"failed",void 0,o)}}return null}function Vnr(t){const e=md(t),r=md(e==null?void 0:e.veadkStudioToolProgress);if(!r||r.kind!=="codex")return null;const n=gi(r.toolName),i=gi(r.requestId);if(!n||!i)return null;const a=md(r.event??r.activity);if(!a)return null;const s=md(a.item)||gi(a.type)?gVe(a):pVe(a);if(!s)return null;const o=gi(r.title||r.label),l=gi(a.agentSessionId??a.agent_session_id),u=gi(a.sandboxSessionId??a.sandbox_session_id),h=gi(a.threadId??a.thread_id),d=aoe(a.status,gi(a.type)),p=gi(a.kind)==="status"&&d!=="running"?d:void 0;return{toolName:n,requestId:i,...o?{title:o}:{},...l?{agentSessionId:l}:{},...u?{sandboxSessionId:u}:{},...h?{threadId:h}:{},...p?{terminalStatus:p}:{},event:s}}function Qnr(t,e){const r=md(e),n=md((r==null?void 0:r.codexActivity)??(r==null?void 0:r.codex_activity));if(!n)return t;const i=gi(n.title)||(t==null?void 0:t.title)||"Codex Sandbox",a=gi(n.agentSessionId??n.agent_session_id)||(t==null?void 0:t.agentSessionId),s=gi(n.sandboxSessionId??n.sandbox_session_id)||(t==null?void 0:t.sandboxSessionId),o=gi(n.threadId??n.thread_id)||(t==null?void 0:t.threadId);let l={title:i,...a?{agentSessionId:a}:{},...s?{sandboxSessionId:s}:{},...o?{threadId:o}:{},items:(t==null?void 0:t.items.slice())??[]};const u=Array.isArray(n.events)?n.events:[];for(const h of u){const d=md(h);if(!d)continue;const f=md(d.item)||gi(d.type)?gVe(d):pVe(d);f&&(f.finalAnswer||(l=soe(l,{title:i,...a?{agentSessionId:a}:{},...s?{sandboxSessionId:s}:{},...o?{threadId:o}:{},event:f})))}return l}function soe(t,e){const r=(t==null?void 0:t.items.slice())??[],n=r.findIndex(i=>i.id===e.event.id);if(n>=0){const i=r[n].block,a=e.event.block;e.event.appendText&&i.kind==="text"&&a.kind==="text"?r[n]={id:e.event.id,block:{...a,text:i.text+a.text}}:e.event.appendText&&i.kind==="thinking"&&a.kind==="thinking"?r[n]={id:e.event.id,block:{...a,text:i.text+a.text}}:r[n]={id:e.event.id,block:a}}else r.push({id:e.event.id,block:e.event.block});return{title:e.title||(t==null?void 0:t.title)||"Codex Sandbox",...e.agentSessionId||t!=null&&t.agentSessionId?{agentSessionId:e.agentSessionId||(t==null?void 0:t.agentSessionId)}:{},...e.sandboxSessionId||t!=null&&t.sandboxSessionId?{sandboxSessionId:e.sandboxSessionId||(t==null?void 0:t.sandboxSessionId)}:{},...e.threadId||t!=null&&t.threadId?{threadId:e.threadId||(t==null?void 0:t.threadId)}:{},items:Unr(r)}}const Gnr="send_a2ui_json_to_client",Hnr="validated_a2ui_json",mVe="adk_request_credential",vVe="transfer_to_agent";function Wnr(t){var n,i,a,s;const e=t,r=((n=e==null?void 0:e.exchangedAuthCredential)==null?void 0:n.oauth2)??((i=e==null?void 0:e.exchanged_auth_credential)==null?void 0:i.oauth2)??((a=e==null?void 0:e.rawAuthCredential)==null?void 0:a.oauth2)??((s=e==null?void 0:e.raw_auth_credential)==null?void 0:s.oauth2);return(r==null?void 0:r.authUri)??(r==null?void 0:r.auth_uri)}function Ynr(){return{blocks:[],liveStart:0,pendingCodexProgress:[]}}function yVe(t,e){if(e.event.finalAnswer)return"applied";let r=-1;for(let n=t.length-1;n>=0;n-=1){const i=t[n];if(!(i.kind!=="tool"||i.name!==e.toolName)){if(i.callId===e.requestId)return i.done?"completed":(i.codexActivity=soe(i.codexActivity,e),i.status=e.terminalStatus??"running",e.terminalStatus&&(i.done=!0),"applied");if(!i.done){if(r>=0)return"unmatched";r=n}}}if(r>=0){const n=t[r];return n.kind!=="tool"?"unmatched":(n.codexActivity=soe(n.codexActivity,e),n.status=e.terminalStatus??"running",e.terminalStatus&&(n.done=!0),"applied")}return"unmatched"}function qnr(t){if(!t||typeof t!="object"||Array.isArray(t))return"completed";const e=t,r=typeof e.status=="string"?e.status.toLowerCase():"";return e.ok===!1||["error","failed","denied","declined","cancelled","timeout"].includes(r)?"failed":"completed"}function bVe(t){if(!t||typeof t!="object"||Array.isArray(t))return"";const e=t;return e.ok!==!0||typeof e.message!="string"?"":e.message.trim()}const xVe=t=>t.functionCall??t.function_call,wVe=t=>t.functionResponse??t.function_response;function jnr(t){if(!t||typeof t!="object")return"";const e=t,r=e.agentName??e.agent_name;return typeof r=="string"?r:""}function Xnr(t){return t.replace(/-/g,"+").replace(/_/g,"/")}function Knr(t){const e=[];for(const[r,n]of t.entries()){const i=n.partMetadata??n.part_metadata,a=i==null?void 0:i.veadkTransport;if((a==null?void 0:a.hidden)===!0)continue;const s=i==null?void 0:i.veadkMedia;if(typeof(s==null?void 0:s.uri)=="string"){e.push({id:String(s.id??s.uri),mimeType:typeof s.mimeType=="string"?s.mimeType:void 0,uri:s.uri,name:typeof s.name=="string"?s.name:void 0,sizeBytes:typeof s.sizeBytes=="number"?s.sizeBytes:void 0});continue}const o=n.inlineData??n.inline_data;if(o&&o.data){e.push({id:`inline-${r}-${o.displayName??o.display_name??"media"}`,mimeType:o.mimeType??o.mime_type,data:Xnr(o.data),name:o.displayName??o.display_name});continue}const l=n.fileData??n.file_data,u=(l==null?void 0:l.fileUri)??(l==null?void 0:l.file_uri);l&&u&&e.push({id:u,mimeType:l.mimeType??l.mime_type,uri:u,name:l.displayName??l.display_name})}return e}function AVe(t){const e=t.partMetadata??t.part_metadata,r=e==null?void 0:e.veadkTransport;return(r==null?void 0:r.hideText)===!0?void 0:t.text}function Znr(t,e){if(!e.length)return;const r=t[t.length-1];(r==null?void 0:r.kind)==="attachment"?r.files.push(...e):t.push({kind:"attachment",files:e})}function Jnr(t,e){if(!e.length)return;const r=t[t.length-1];if((r==null?void 0:r.kind)==="artifact"){for(const n of e)r.files.some(i=>i.filename===n.filename&&i.version===n.version)||r.files.push(n);return}t.push({kind:"artifact",files:e})}function ooe(t,e,r){const n=t[t.length-1];n&&n.kind===e?n.text+=r:t.push(e==="thinking"?{kind:e,text:r,done:!1}:{kind:e,text:r})}function xV(t){for(const e of t)e.kind==="thinking"&&(e.done=!0)}function eir(t,e){var h,d,f,p,g,m;const r=t.blocks.map(v=>({...v}));let n=t.liveStart,i=t.pendingCodexProgress.slice();const a=((h=e.content)==null?void 0:h.parts)??[],s=a.flatMap(v=>{const y=Fnr(v.partMetadata??v.part_metadata);return y?[y]:[]}),o=a.flatMap(v=>{const y=Vnr(v.partMetadata??v.part_metadata);return y?[y]:[]});if(s.length>0||o.length>0){for(const v of s)for(let y=r.length-1;y>=0;y-=1){const b=r[y];if(!(b.kind!=="tool"||b.done||b.name!==v.toolName||v.requestId&&b.callId&&b.callId!==v.requestId)){b.response=znr(b.args,b.response,v),b.status="running";break}}for(const v of o)yVe(r,v)==="unmatched"&&(i=[...i,v].slice(-64));return{blocks:r,liveStart:n,pendingCodexProgress:i}}const l=a.some(v=>xVe(v)||wVe(v));if(e.partial&&!l){for(const v of a){const y=AVe(v);typeof y=="string"&&y&&ooe(r,v.thought?"thinking":"text",y)}return{blocks:r,liveStart:n,pendingCodexProgress:i}}r.length=n;for(const v of a){const y=xVe(v),b=wVe(v),x=Knr([v]),w=AVe(v);if(typeof w=="string"&&w)ooe(r,v.thought?"thinking":"text",w);else if(x.length)xV(r),Znr(r,x);else if(y)if(xV(r),y.name===vVe){const A=jnr(y.args)||((d=e.actions)==null?void 0:d.transferToAgent)||((f=e.actions)==null?void 0:f.transfer_to_agent)||qg.t("app:common.unknownAgent");r.push({kind:"agent-transfer",agentName:A,done:!1})}else if(y.name===mVe){const A=y.args??{},T=A.authConfig??A.auth_config??A,O=String(A.functionCallId??A.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;r.push({kind:"auth",callId:y.id??"",label:O,authUri:Wnr(T),authConfig:T,done:!1})}else{const A={kind:"tool",name:y.name??"",callId:y.id,args:y.args,done:!1};if(r.push(A),A.callId){const T=[];for(const S of i)S.toolName===A.name&&S.requestId===A.callId?yVe(r,S):T.push(S);i=T}}else if(b){if(xV(r),b.name===vVe)for(let A=r.length-1;A>=0;A--){const T=r[A];if(T.kind==="agent-transfer"&&!T.done){T.done=!0;break}}if(b.name===mVe)for(let A=r.length-1;A>=0;A--){const T=r[A];if(T.kind==="auth"&&!T.done){T.done=!0;break}}for(let A=r.length-1;A>=0;A--){const T=r[A],S=T.kind==="tool"&&T.name==="delegate_to_codex_sandbox";if(T.kind==="tool"&&(!T.done||S)&&T.name===b.name&&(!b.id||!T.callId||T.callId===b.id)){const O=S?bVe(T.response):"";if(T.done=!0,T.response=b.response,S){T.codexActivity=Qnr(T.codexActivity,b.response),T.status=qnr(b.response);const k=bVe(b.response);k&&k!==O&&ooe(r,"text",k)}break}}if(b.name===Gnr){const A=((p=b.response)==null?void 0:p[Hnr])??[];if(A.length){const T=r[r.length-1];T&&T.kind==="a2ui"?T.messages.push(...A):r.push({kind:"a2ui",messages:A})}}}}const u=((g=e.actions)==null?void 0:g.artifactDelta)??((m=e.actions)==null?void 0:m.artifact_delta);return u&&Jnr(r,Object.entries(u).map(([v,y])=>({filename:v,version:y}))),xV(r),n=r.length,{blocks:r,liveStart:n,pendingCodexProgress:i}}/** +`);if(!(!l||l==="[DONE]"||l==="ping"))try{return JSON.parse(l)}catch{const u=i(l);throw o?new Error(ioe("sse.incompleteEvent",{data:u})):new Error(ioe("sse.invalidEventJson",{data:u}))}};try{for(;;){const{done:s,value:o}=await e.read();if(s)break;n+=r.decode(o,{stream:!0});let l=n.match(/\r?\n\r?\n/);for(;(l==null?void 0:l.index)!==void 0;){const u=n.slice(0,l.index);n=n.slice(l.index+l[0].length);const h=a(u);h!==void 0&&(yield h),l=n.match(/\r?\n\r?\n/)}}if(n+=r.decode(),n.trim()){const s=a(n,!0);s!==void 0&&(yield s)}}finally{try{await e.cancel()}catch{}finally{e.releaseLock()}}}function Ww(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)?t:void 0}function Ib(t){return typeof t=="string"?t:""}function lVe(t,e){return t==="pending"||t==="running"||t==="completed"||t==="failed"?t:e}function Bnr(t){let e=t;if(typeof e=="string")try{e=JSON.parse(e)}catch{return{}}const r=Ww(e)??{};return Ww(r.result)??r}function $nr(t){var r;const e=(r=Ww(t))==null?void 0:r.branches;return Array.isArray(e)?e.map(n=>{var i;return Ib((i=Ww(n))==null?void 0:i.label)}):[]}function cVe(t,e,r){const n=$nr(t),i=Bnr(e),a=Array.isArray(i.branches)?i.branches:[],s=r==="running"?"running":"pending";return{branches:[0,1].map(l=>{const u=Ww(a[l])??{};return{label:Ib(u.label)||n[l]||`方向 ${l+1}`,content:Ib(u.content),status:lVe(u.status,s),error:Ib(u.error)}})}}function Fnr(t){const e=Ww(t),r=Ww(e==null?void 0:e.veadkStudioToolProgress);return!r||r.toolName!=="branch_compare"||typeof r.branchIndex!="number"||r.branchIndex<0||r.branchIndex>1?null:{toolName:"branch_compare",requestId:Ib(r.requestId),branchIndex:r.branchIndex,label:Ib(r.label),delta:Ib(r.delta),status:lVe(r.status,"running"),error:Ib(r.error)||void 0}}function znr(t,e,r){return{branches:cVe(t,e,"running").branches.map((a,s)=>s===r.branchIndex?{...a,label:r.label||a.label,content:a.content+r.delta,status:r.status,error:r.error??a.error}:a)}}function jl(t,e){return qg.t(`blocks.codexProgress.${t}`,{ns:"conversation",...e})}const uVe=28e4;function hVe(t){try{return JSON.stringify(t).length}catch{return uVe}}function Unr(t){const e=t.slice(-200);let r=e.reduce((n,i)=>n+hVe(i),0);for(;e.length>1&&r>uVe;)r-=hVe(e.shift());return e}function md(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)?t:void 0}function gi(t){return typeof t=="string"?t:""}function aoe(t,e=""){const r=gi(t).toLowerCase();return e.endsWith(".failed")||["failed","error","declined","cancelled"].includes(r)?"failed":e.endsWith(".completed")||["completed","done","success"].includes(r)?"completed":"running"}function dVe(t){if(t.response!==void 0)return t.response;if(t.result!==void 0)return t.result;const e=t.aggregatedOutput??t.aggregated_output??t.output,r=t.exitCode??t.exit_code;if(!(e===void 0&&r===void 0))return{...e!==void 0?{output:e}:{},...r!==void 0?{exitCode:r}:{}}}function fVe(t){if(t.args!==void 0)return t.args;if(t.arguments!==void 0)return t.arguments;if(t.input!==void 0)return t.input;const e=gi(t.command),r=gi(t.cwd);if(e||r)return{...e?{command:e}:{},...r?{cwd:r}:{}};if(t.changes!==void 0)return{changes:t.changes};if(t.approval!==void 0)return t.approval}function Yw(t,e,r,n,i){return{kind:"tool",name:t,callId:e,args:n,response:i,done:r!=="running",status:r,...r==="failed"?{defaultOpen:!0}:{}}}function pVe(t){const e=gi(t.id||t.itemId||t.item_id),r=gi(t.kind);if(!e||!r)return null;const n=aoe(t.status),i=gi(t.text||t.detail||t.delta),a=!gi(t.text||t.detail)&&typeof t.delta=="string";if(r==="thinking"||r==="reasoning")return i?{id:e,block:{kind:"thinking",text:i,done:n!=="running"},appendText:a}:null;if(r==="commentary")return i?{id:e,block:{kind:"text",text:i},appendText:a}:null;if(["message","text","assistant_final","final"].includes(r))return i?{id:e,block:{kind:"text",text:i},appendText:a,finalAnswer:!0}:null;if(r==="plan"){const s=Array.isArray(t.plan)?t.plan:[];return{id:e,block:{kind:"plan",title:gi(t.title)||jl("planTitle"),summary:i||void 0,items:s.flatMap(o=>{const l=md(o),u=gi(l==null?void 0:l.text);if(!u)return[];const h=gi(l==null?void 0:l.status);return[{text:u,status:["pending","in_progress","completed","failed"].includes(h)?h:"pending"}]}),done:n!=="running"}}}if(["tool","command","command_execution","commandExecution","file_change","fileChange","mcp_tool_call","mcpToolCall","collab_tool_call","web_search","approval","status"].includes(r)){const s=jl(r==="file_change"||r==="fileChange"?"fallback.fileChange":r==="approval"?"fallback.approval":r==="status"?"fallback.status":"fallback.command"),o=fVe(t),l=dVe(t)??(r==="status"&&i||void 0);return{id:e,block:Yw(gi(t.name||t.title)||s,e,n,o,l)}}return null}function gVe(t){const e=gi(t.type),r=md(t.item),n=gi(r==null?void 0:r.type),i=gi((r==null?void 0:r.id)||t.id)||(e==="turn.failed"?"turn":"");if(!i)return null;const a=aoe(r==null?void 0:r.status,e);if(n==="reasoning"||n==="agent_message"){const s=gi(r==null?void 0:r.text);return s?{id:i,block:n==="reasoning"?{kind:"thinking",text:s,done:a!=="running"}:{kind:"text",text:s},...n==="agent_message"&&(r==null?void 0:r.phase)!=="commentary"?{finalAnswer:!0}:{}}:null}if(n==="todo_list"){const o=(Array.isArray(r==null?void 0:r.items)?r.items:[]).flatMap(l=>{const u=md(l),h=gi(u==null?void 0:u.text);if(!h)return[];const d=gi(u==null?void 0:u.status).toLowerCase(),f=(u==null?void 0:u.completed)===!0||["completed","done"].includes(d)?"completed":["failed","error"].includes(d)?"failed":["in_progress","running"].includes(d)?"in_progress":"pending";return[{text:h,status:f}]});return o.length?{id:i,block:{kind:"plan",title:jl("planTitle"),summary:jl("planSummary",{completed:o.filter(l=>l.status==="completed").length,total:o.length}),items:o,done:a!=="running"}}:null}if(n==="command_execution"){const s=jl(`command.${a}`);return{id:i,block:Yw(s,i,a,fVe(r??{}),dVe(r??{}))}}if(n==="file_change"){const s=Array.isArray(r==null?void 0:r.changes)?r.changes:[],o=s.length?jl("projectFiles",{count:s.length}):jl("projectFile"),l=jl(`fileChange.${a}`,{subject:o});return{id:i,block:Yw(l,i,a,s.length?{changes:s}:void 0)}}if(n==="mcp_tool_call"){const s=[gi(r==null?void 0:r.server),gi(r==null?void 0:r.tool)].filter(Boolean).join("/")||jl("externalTool"),o=jl(`mcp.${a}`,{tool:s}),l=md(r==null?void 0:r.error),u=(r==null?void 0:r.result)!==void 0?r.result:gi(l==null?void 0:l.message)||void 0;return{id:i,block:Yw(o,i,a,r==null?void 0:r.arguments,u)}}if(n==="collab_tool_call"){const s=gi(r==null?void 0:r.tool),o=["spawn_agent","send_input","wait","close_agent"].includes(s)?s:"default",l=jl(`collaboration.${o}.${a}`),u=Object.fromEntries(["tool","receiver_thread_ids","prompt"].filter(h=>(r==null?void 0:r[h])!==void 0).map(h=>[h,r==null?void 0:r[h]]));return{id:i,block:Yw(l,i,a,Object.keys(u).length?u:void 0,r==null?void 0:r.agents_states)}}if(n==="web_search"){const s=jl(`webSearch.${a}`),o=Object.fromEntries(["query","action"].filter(l=>(r==null?void 0:r[l])!==void 0).map(l=>[l,r==null?void 0:r[l]]));return{id:i,block:Yw(s,i,a,Object.keys(o).length?o:void 0)}}if(n==="error"||e==="error"||e==="turn.failed"){const s=md(t.error),o=gi((r==null?void 0:r.message)||t.message||(s==null?void 0:s.message))||jl("errorDetail");return{id:i,block:Yw(jl("errorTitle"),i,"failed",void 0,o)}}return null}function Vnr(t){const e=md(t),r=md(e==null?void 0:e.veadkStudioToolProgress);if(!r||r.kind!=="codex")return null;const n=gi(r.toolName),i=gi(r.requestId);if(!n||!i)return null;const a=md(r.event??r.activity);if(!a)return null;const s=md(a.item)||gi(a.type)?gVe(a):pVe(a);if(!s)return null;const o=gi(r.title||r.label),l=gi(a.agentSessionId??a.agent_session_id),u=gi(a.sandboxSessionId??a.sandbox_session_id),h=gi(a.threadId??a.thread_id),d=aoe(a.status,gi(a.type)),p=gi(a.kind)==="status"&&d!=="running"?d:void 0;return{toolName:n,requestId:i,...o?{title:o}:{},...l?{agentSessionId:l}:{},...u?{sandboxSessionId:u}:{},...h?{threadId:h}:{},...p?{terminalStatus:p}:{},event:s}}function Qnr(t,e){const r=md(e),n=md((r==null?void 0:r.codexActivity)??(r==null?void 0:r.codex_activity));if(!n)return t;const i=gi(n.title)||(t==null?void 0:t.title)||"Codex Sandbox",a=gi(n.agentSessionId??n.agent_session_id)||(t==null?void 0:t.agentSessionId),s=gi(n.sandboxSessionId??n.sandbox_session_id)||(t==null?void 0:t.sandboxSessionId),o=gi(n.threadId??n.thread_id)||(t==null?void 0:t.threadId);let l={title:i,...a?{agentSessionId:a}:{},...s?{sandboxSessionId:s}:{},...o?{threadId:o}:{},items:(t==null?void 0:t.items.slice())??[]};const u=Array.isArray(n.events)?n.events:[];for(const h of u){const d=md(h);if(!d)continue;const f=md(d.item)||gi(d.type)?gVe(d):pVe(d);f&&(f.finalAnswer||(l=soe(l,{title:i,...a?{agentSessionId:a}:{},...s?{sandboxSessionId:s}:{},...o?{threadId:o}:{},event:f})))}return l}function soe(t,e){const r=(t==null?void 0:t.items.slice())??[],n=r.findIndex(i=>i.id===e.event.id);if(n>=0){const i=r[n].block,a=e.event.block;e.event.appendText&&i.kind==="text"&&a.kind==="text"?r[n]={id:e.event.id,block:{...a,text:i.text+a.text}}:e.event.appendText&&i.kind==="thinking"&&a.kind==="thinking"?r[n]={id:e.event.id,block:{...a,text:i.text+a.text}}:r[n]={id:e.event.id,block:a}}else r.push({id:e.event.id,block:e.event.block});return{title:e.title||(t==null?void 0:t.title)||"Codex Sandbox",...e.agentSessionId||t!=null&&t.agentSessionId?{agentSessionId:e.agentSessionId||(t==null?void 0:t.agentSessionId)}:{},...e.sandboxSessionId||t!=null&&t.sandboxSessionId?{sandboxSessionId:e.sandboxSessionId||(t==null?void 0:t.sandboxSessionId)}:{},...e.threadId||t!=null&&t.threadId?{threadId:e.threadId||(t==null?void 0:t.threadId)}:{},items:Unr(r)}}const Gnr="send_a2ui_json_to_client",Hnr="validated_a2ui_json",mVe="adk_request_credential",vVe="transfer_to_agent";function Wnr(t){var n,i,a,s;const e=t,r=((n=e==null?void 0:e.exchangedAuthCredential)==null?void 0:n.oauth2)??((i=e==null?void 0:e.exchanged_auth_credential)==null?void 0:i.oauth2)??((a=e==null?void 0:e.rawAuthCredential)==null?void 0:a.oauth2)??((s=e==null?void 0:e.raw_auth_credential)==null?void 0:s.oauth2);return(r==null?void 0:r.authUri)??(r==null?void 0:r.auth_uri)}function Ynr(){return{blocks:[],liveStart:0,pendingCodexProgress:[]}}function yVe(t,e){if(e.event.finalAnswer)return"applied";let r=-1;for(let n=t.length-1;n>=0;n-=1){const i=t[n];if(!(i.kind!=="tool"||i.name!==e.toolName)){if(i.callId===e.requestId)return i.done?"completed":(i.codexActivity=soe(i.codexActivity,e),i.status=e.terminalStatus??"running",e.terminalStatus&&(i.done=!0),"applied");if(!i.done){if(r>=0)return"unmatched";r=n}}}if(r>=0){const n=t[r];return n.kind!=="tool"?"unmatched":(n.codexActivity=soe(n.codexActivity,e),n.status=e.terminalStatus??"running",e.terminalStatus&&(n.done=!0),"applied")}return"unmatched"}function qnr(t){if(!t||typeof t!="object"||Array.isArray(t))return"completed";const e=t,r=typeof e.status=="string"?e.status.toLowerCase():"";return e.ok===!1||["error","failed","denied","declined","cancelled","timeout"].includes(r)?"failed":"completed"}function bVe(t){if(!t||typeof t!="object"||Array.isArray(t))return"";const e=t;return e.ok!==!0||typeof e.message!="string"?"":e.message.trim()}const xVe=t=>t.functionCall??t.function_call,wVe=t=>t.functionResponse??t.function_response;function jnr(t){if(!t||typeof t!="object")return"";const e=t,r=e.agentName??e.agent_name;return typeof r=="string"?r:""}function Xnr(t){return t.replace(/-/g,"+").replace(/_/g,"/")}function Knr(t){const e=[];for(const[r,n]of t.entries()){const i=n.partMetadata??n.part_metadata,a=i==null?void 0:i.veadkTransport;if((a==null?void 0:a.hidden)===!0)continue;const s=i==null?void 0:i.veadkMedia;if(typeof(s==null?void 0:s.uri)=="string"){e.push({id:String(s.id??s.uri),mimeType:typeof s.mimeType=="string"?s.mimeType:void 0,uri:s.uri,name:typeof s.name=="string"?s.name:void 0,sizeBytes:typeof s.sizeBytes=="number"?s.sizeBytes:void 0});continue}const o=n.inlineData??n.inline_data;if(o&&o.data){e.push({id:`inline-${r}-${o.displayName??o.display_name??"media"}`,mimeType:o.mimeType??o.mime_type,data:Xnr(o.data),name:o.displayName??o.display_name});continue}const l=n.fileData??n.file_data,u=(l==null?void 0:l.fileUri)??(l==null?void 0:l.file_uri);l&&u&&e.push({id:u,mimeType:l.mimeType??l.mime_type,uri:u,name:l.displayName??l.display_name})}return e}function AVe(t){const e=t.partMetadata??t.part_metadata,r=e==null?void 0:e.veadkTransport;return(r==null?void 0:r.hideText)===!0?void 0:t.text}function Znr(t,e){if(!e.length)return;const r=t[t.length-1];(r==null?void 0:r.kind)==="attachment"?r.files.push(...e):t.push({kind:"attachment",files:e})}function Jnr(t,e){if(!e.length)return;const r=t[t.length-1];if((r==null?void 0:r.kind)==="artifact"){for(const n of e)r.files.some(i=>i.filename===n.filename&&i.version===n.version)||r.files.push(n);return}t.push({kind:"artifact",files:e})}function ooe(t,e,r){const n=t[t.length-1];n&&n.kind===e?n.text+=r:t.push(e==="thinking"?{kind:e,text:r,done:!1}:{kind:e,text:r})}function xV(t){for(const e of t)e.kind==="thinking"&&(e.done=!0)}function eir(t,e){var h,d,f,p,g,m;const r=t.blocks.map(v=>({...v}));let n=t.liveStart,i=t.pendingCodexProgress.slice();const a=((h=e.content)==null?void 0:h.parts)??[],s=a.flatMap(v=>{const y=Fnr(v.partMetadata??v.part_metadata);return y?[y]:[]}),o=a.flatMap(v=>{const y=Vnr(v.partMetadata??v.part_metadata);return y?[y]:[]});if(s.length>0||o.length>0){for(const v of s)for(let y=r.length-1;y>=0;y-=1){const b=r[y];if(!(b.kind!=="tool"||b.done||b.name!==v.toolName||v.requestId&&b.callId&&b.callId!==v.requestId)){b.response=znr(b.args,b.response,v),b.status="running";break}}for(const v of o)yVe(r,v)==="unmatched"&&(i=[...i,v].slice(-64));return{blocks:r,liveStart:n,pendingCodexProgress:i}}const l=a.some(v=>xVe(v)||wVe(v));if(e.partial&&!l){for(const v of a){const y=AVe(v);typeof y=="string"&&y&&ooe(r,v.thought?"thinking":"text",y)}return{blocks:r,liveStart:n,pendingCodexProgress:i}}r.length=n;for(const v of a){const y=xVe(v),b=wVe(v),x=Knr([v]),w=AVe(v);if(typeof w=="string"&&w)ooe(r,v.thought?"thinking":"text",w);else if(x.length)xV(r),Znr(r,x);else if(y)if(xV(r),y.name===vVe){const A=jnr(y.args)||((d=e.actions)==null?void 0:d.transferToAgent)||((f=e.actions)==null?void 0:f.transfer_to_agent)||qg.t("app:common.unknownAgent");r.push({kind:"agent-transfer",agentName:A,done:!1})}else if(y.name===mVe){const A=y.args??{},S=A.authConfig??A.auth_config??A,O=String(A.functionCallId??A.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;r.push({kind:"auth",callId:y.id??"",label:O,authUri:Wnr(S),authConfig:S,done:!1})}else{const A={kind:"tool",name:y.name??"",callId:y.id,args:y.args,done:!1};if(r.push(A),A.callId){const S=[];for(const T of i)T.toolName===A.name&&T.requestId===A.callId?yVe(r,T):S.push(T);i=S}}else if(b){if(xV(r),b.name===vVe)for(let A=r.length-1;A>=0;A--){const S=r[A];if(S.kind==="agent-transfer"&&!S.done){S.done=!0;break}}if(b.name===mVe)for(let A=r.length-1;A>=0;A--){const S=r[A];if(S.kind==="auth"&&!S.done){S.done=!0;break}}for(let A=r.length-1;A>=0;A--){const S=r[A],T=S.kind==="tool"&&S.name==="delegate_to_codex_sandbox";if(S.kind==="tool"&&(!S.done||T)&&S.name===b.name&&(!b.id||!S.callId||S.callId===b.id)){const O=T?bVe(S.response):"";if(S.done=!0,S.response=b.response,T){S.codexActivity=Qnr(S.codexActivity,b.response),S.status=qnr(b.response);const k=bVe(b.response);k&&k!==O&&ooe(r,"text",k)}break}}if(b.name===Gnr){const A=((p=b.response)==null?void 0:p[Hnr])??[];if(A.length){const S=r[r.length-1];S&&S.kind==="a2ui"?S.messages.push(...A):r.push({kind:"a2ui",messages:A})}}}}const u=((g=e.actions)==null?void 0:g.artifactDelta)??((m=e.actions)==null?void 0:m.artifact_delta);return u&&Jnr(r,Object.entries(u).map(([v,y])=>({filename:v,version:y}))),xV(r),n=r.length,{blocks:r,liveStart:n,pendingCodexProgress: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 tir=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),TVe=(...t)=>t.filter((e,r,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===r).join(" ").trim();/** + */const tir=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),SVe=(...t)=>t.filter((e,r,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===r).join(" ").trim();/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -115,12 +115,12 @@ Studio:{{studioUrl}} * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nir=se.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:a,iconNode:s,...o},l)=>se.createElement("svg",{ref:l,...rir,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:TVe("lucide",i),...o},[...s.map(([u,h])=>se.createElement(u,h)),...Array.isArray(a)?a:[a]]));/** + */const nir=se.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:a,iconNode:s,...o},l)=>se.createElement("svg",{ref:l,...rir,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:SVe("lucide",i),...o},[...s.map(([u,h])=>se.createElement(u,h)),...Array.isArray(a)?a:[a]]));/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bh=(t,e)=>{const r=se.forwardRef(({className:n,...i},a)=>se.createElement(nir,{ref:a,iconNode:e,className:TVe(`lucide-${tir(t)}`,n),...i}));return r.displayName=`${t}`,r};/** + */const bh=(t,e)=>{const r=se.forwardRef(({className:n,...i},a)=>se.createElement(nir,{ref:a,iconNode:e,className:SVe(`lucide-${tir(t)}`,n),...i}));return r.displayName=`${t}`,r};/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -145,7 +145,7 @@ Studio:{{studioUrl}} * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const SVe=bh("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** + */const TVe=bh("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. @@ -198,21 +198,21 @@ Studio:{{studioUrl}} top: ${l}px !important; left: ${u}px !important; } - `),()=>{document.head.removeChild(h)}},[e]),W.jsx(dir,{isPresent:e,childRef:n,sizeRef:i,children:se.cloneElement(t,{ref:n})})}const pir=({children:t,initial:e,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:a,mode:s})=>{const o=uoe(gir),l=se.useId(),u=se.useCallback(d=>{o.set(d,!0);for(const f of o.values())if(!f)return;n&&n()},[o,n]),h=se.useMemo(()=>({id:l,initial:e,isPresent:r,custom:i,onExitComplete:u,register:d=>(o.set(d,!1),()=>o.delete(d))}),a?[Math.random(),u]:[r,u]);return se.useMemo(()=>{o.forEach((d,f)=>o.set(f,!1))},[r]),se.useEffect(()=>{!r&&!o.size&&n&&n()},[r]),s==="popLayout"&&(t=W.jsx(fir,{isPresent:r,children:t})),W.jsx(AV.Provider,{value:h,children:t})};function gir(){return new Map}function OVe(t=!0){const e=se.useContext(AV);if(e===null)return[!0,null];const{isPresent:r,onExitComplete:n,register:i}=e,a=se.useId();se.useEffect(()=>{t&&i(a)},[t]);const s=se.useCallback(()=>t&&n&&n(a),[a,n,t]);return!r&&n?[!1,s]:[!0]}const TV=t=>t.key||"";function kVe(t){const e=[];return se.Children.forEach(t,r=>{se.isValidElement(r)&&e.push(r)}),e}const doe=typeof window<"u",EVe=doe?se.useLayoutEffect:se.useEffect,mir=({children:t,custom:e,initial:r=!0,onExitComplete:n,presenceAffectsLayout:i=!0,mode:a="sync",propagate:s=!1})=>{const[o,l]=OVe(s),u=se.useMemo(()=>kVe(t),[t]),h=s&&!o?[]:u.map(TV),d=se.useRef(!0),f=se.useRef(u),p=uoe(()=>new Map),[g,m]=se.useState(u),[v,y]=se.useState(u);EVe(()=>{d.current=!1,f.current=u;for(let w=0;w{const A=TV(w),T=s&&!o?!1:u===v||h.includes(A),S=()=>{if(p.has(A))p.set(A,!0);else return;let O=!0;p.forEach(k=>{k||(O=!1)}),O&&(x==null||x(),y(f.current),s&&(l==null||l()),n&&n())};return W.jsx(pir,{isPresent:T,initial:!d.current||r?void 0:!1,custom:T?void 0:e,presenceAffectsLayout:i,mode:a,onExitComplete:T?void 0:S,children:w},A)})})},vd=t=>t;let _Ve=vd;const vir={useManualTiming:!1};function yir(t){let e=new Set,r=new Set,n=!1,i=!1;const a=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function o(u){a.has(u)&&(l.schedule(u),t()),u(s)}const l={schedule:(u,h=!1,d=!1)=>{const p=d&&n?e:r;return h&&a.add(u),p.has(u)||p.add(u),u},cancel:u=>{r.delete(u),a.delete(u)},process:u=>{if(s=u,n){i=!0;return}n=!0,[e,r]=[r,e],e.forEach(o),e.clear(),n=!1,i&&(i=!1,l.process(u))}};return l}const SV=["read","resolveKeyframes","update","preRender","render","postRender"],bir=40;function RVe(t,e){let r=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>r=!0,s=SV.reduce((y,b)=>(y[b]=yir(a),y),{}),{read:o,resolveKeyframes:l,update:u,preRender:h,render:d,postRender:f}=s,p=()=>{const y=performance.now();r=!1,i.delta=n?1e3/60:Math.max(Math.min(y-i.timestamp,bir),1),i.timestamp=y,i.isProcessing=!0,o.process(i),l.process(i),u.process(i),h.process(i),d.process(i),f.process(i),i.isProcessing=!1,r&&e&&(n=!1,t(p))},g=()=>{r=!0,n=!0,i.isProcessing||t(p)};return{schedule:SV.reduce((y,b)=>{const x=s[b];return y[b]=(w,A=!1,T=!1)=>(r||g(),x.schedule(w,A,T)),y},{}),cancel:y=>{for(let b=0;bLVe[t].some(r=>!!e[r])};function xir(t){for(const e in t)Xk[e]={...Xk[e],...t[e]}}const wir=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 CV(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||wir.has(t)}let MVe=t=>!CV(t);function Air(t){t&&(MVe=e=>e.startsWith("on")?!CV(e):t(e))}try{Air(require("@emotion/is-prop-valid").default)}catch{}function Tir(t,e,r){const n={};for(const i in t)i==="values"&&typeof t.values=="object"||(MVe(i)||r===!0&&CV(i)||!e&&!CV(i)||t.draggable&&i.startsWith("onDrag"))&&(n[i]=t[i]);return n}function Sir(t){if(typeof Proxy>"u")return t;const e=new Map,r=(...n)=>t(...n);return new Proxy(r,{get:(n,i)=>i==="create"?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}const OV=se.createContext({});function JP(t){return typeof t=="string"||Array.isArray(t)}function kV(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const poe=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],goe=["initial",...poe];function EV(t){return kV(t.animate)||goe.some(e=>JP(t[e]))}function IVe(t){return!!(EV(t)||t.variants)}function Cir(t,e){if(EV(t)){const{initial:r,animate:n}=t;return{initial:r===!1||JP(r)?r:void 0,animate:JP(n)?n:void 0}}return t.inherit!==!1?e:{}}function Oir(t){const{initial:e,animate:r}=Cir(t,se.useContext(OV));return se.useMemo(()=>({initial:e,animate:r}),[PVe(e),PVe(r)])}function PVe(t){return Array.isArray(t)?t.join(" "):t}const kir=Symbol.for("motionComponentSymbol");function Kk(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Eir(t,e,r){return se.useCallback(n=>{n&&t.onMount&&t.onMount(n),e&&(n?e.mount(n):e.unmount()),r&&(typeof r=="function"?r(n):Kk(r)&&(r.current=n))},[e])}const moe=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),NVe="data-"+moe("framerAppearId"),{schedule:voe}=RVe(queueMicrotask,!1),BVe=se.createContext({});function _ir(t,e,r,n,i){var a,s;const{visualElement:o}=se.useContext(OV),l=se.useContext(DVe),u=se.useContext(AV),h=se.useContext(hoe).reducedMotion,d=se.useRef(null);n=n||l.renderer,!d.current&&n&&(d.current=n(t,{visualState:e,parent:o,props:r,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:h}));const f=d.current,p=se.useContext(BVe);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&Rir(d.current,r,i,p);const g=se.useRef(!1);se.useInsertionEffect(()=>{f&&g.current&&f.update(r,u)});const m=r[NVe],v=se.useRef(!!m&&!(!((a=window.MotionHandoffIsComplete)===null||a===void 0)&&a.call(window,m))&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,m)));return EVe(()=>{f&&(g.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),voe.render(f.render),v.current&&f.animationState&&f.animationState.animateChanges())}),se.useEffect(()=>{f&&(!v.current&&f.animationState&&f.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,m)}),v.current=!1))}),f}function Rir(t,e,r,n){const{layoutId:i,layout:a,drag:s,dragConstraints:o,layoutScroll:l,layoutRoot:u}=e;t.projection=new r(t.latestValues,e["data-framer-portal-id"]?void 0:$Ve(t.parent)),t.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!s||o&&Kk(o),visualElement:t,animationType:typeof a=="string"?a:"both",initialPromotionConfig:n,layoutScroll:l,layoutRoot:u})}function $Ve(t){if(t)return t.options.allowProjection!==!1?t.projection:$Ve(t.parent)}function Dir({preloadedFeatures:t,createVisualElement:e,useRender:r,useVisualState:n,Component:i}){var a,s;t&&xir(t);function o(u,h){let d;const f={...se.useContext(hoe),...u,layoutId:Lir(u)},{isStatic:p}=f,g=Oir(u),m=n(u,p);if(!p&&doe){Mir();const v=Iir(f);d=v.MeasureLayout,g.visualElement=_ir(i,m,f,e,v.ProjectionNode)}return W.jsxs(OV.Provider,{value:g,children:[d&&g.visualElement?W.jsx(d,{visualElement:g.visualElement,...f}):null,r(i,u,Eir(m,g.visualElement,h),m,p,g.visualElement)]})}o.displayName=`motion.${typeof i=="string"?i:`create(${(s=(a=i.displayName)!==null&&a!==void 0?a:i.name)!==null&&s!==void 0?s:""})`}`;const l=se.forwardRef(o);return l[kir]=i,l}function Lir({layoutId:t}){const e=se.useContext(coe).id;return e&&t!==void 0?e+"-"+t:t}function Mir(t,e){se.useContext(DVe).strict}function Iir(t){const{drag:e,layout:r}=Xk;if(!e&&!r)return{};const n={...e,...r};return{MeasureLayout:e!=null&&e.isEnabled(t)||r!=null&&r.isEnabled(t)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}const Pir=["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 yoe(t){return typeof t!="string"||t.includes("-")?!1:!!(Pir.indexOf(t)>-1||/[A-Z]/u.test(t))}function FVe(t){const e=[{},{}];return t==null||t.values.forEach((r,n)=>{e[0][n]=r.get(),e[1][n]=r.getVelocity()}),e}function boe(t,e,r,n){if(typeof e=="function"){const[i,a]=FVe(n);e=e(r!==void 0?r:t.custom,i,a)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,a]=FVe(n);e=e(r!==void 0?r:t.custom,i,a)}return e}const xoe=t=>Array.isArray(t),Nir=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),Bir=t=>xoe(t)?t[t.length-1]||0:t,_c=t=>!!(t&&t.getVelocity);function _V(t){const e=_c(t)?t.get():t;return Nir(e)?e.toValue():e}function $ir({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:r},n,i,a){const s={latestValues:Fir(n,i,a,t),renderState:e()};return r&&(s.onMount=o=>r({props:n,current:o,...s}),s.onUpdate=o=>r(o)),s}const zVe=t=>(e,r)=>{const n=se.useContext(OV),i=se.useContext(AV),a=()=>$ir(t,e,n,i);return r?a():uoe(a)};function Fir(t,e,r,n){const i={},a=n(t,{});for(const f in a)i[f]=_V(a[f]);let{initial:s,animate:o}=t;const l=EV(t),u=IVe(t);e&&u&&!l&&t.inherit!==!1&&(s===void 0&&(s=e.initial),o===void 0&&(o=e.animate));let h=r?r.initial===!1:!1;h=h||s===!1;const d=h?o:s;if(d&&typeof d!="boolean"&&!kV(d)){const f=Array.isArray(d)?d:[d];for(let p=0;pe=>typeof e=="string"&&e.startsWith(t),VVe=UVe("--"),zir=UVe("var(--"),woe=t=>zir(t)?Uir.test(t.split("/*")[0].trim()):!1,Uir=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,QVe=(t,e)=>e&&typeof t=="number"?e.transform(t):t,Dv=(t,e,r)=>r>e?e:rtypeof t=="number",parse:parseFloat,transform:t=>t},e6={...Jk,transform:t=>Dv(0,1,t)},RV={...Jk,default:1},t6=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Nb=t6("deg"),jg=t6("%"),dn=t6("px"),Vir=t6("vh"),Qir=t6("vw"),GVe={...jg,parse:t=>jg.parse(t)/100,transform:t=>jg.transform(t*100)},Gir={borderWidth:dn,borderTopWidth:dn,borderRightWidth:dn,borderBottomWidth:dn,borderLeftWidth:dn,borderRadius:dn,radius:dn,borderTopLeftRadius:dn,borderTopRightRadius:dn,borderBottomRightRadius:dn,borderBottomLeftRadius:dn,width:dn,maxWidth:dn,height:dn,maxHeight:dn,top:dn,right:dn,bottom:dn,left:dn,padding:dn,paddingTop:dn,paddingRight:dn,paddingBottom:dn,paddingLeft:dn,margin:dn,marginTop:dn,marginRight:dn,marginBottom:dn,marginLeft:dn,backgroundPositionX:dn,backgroundPositionY:dn},Hir={rotate:Nb,rotateX:Nb,rotateY:Nb,rotateZ:Nb,scale:RV,scaleX:RV,scaleY:RV,scaleZ:RV,skew:Nb,skewX:Nb,skewY:Nb,distance:dn,translateX:dn,translateY:dn,translateZ:dn,x:dn,y:dn,z:dn,perspective:dn,transformPerspective:dn,opacity:e6,originX:GVe,originY:GVe,originZ:dn},HVe={...Jk,transform:Math.round},Aoe={...Gir,...Hir,zIndex:HVe,size:dn,fillOpacity:e6,strokeOpacity:e6,numOctaves:HVe},Wir={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Yir=Zk.length;function qir(t,e,r){let n="",i=!0;for(let a=0;a({style:{},transform:{},transformOrigin:{},vars:{}}),YVe=()=>({...Coe(),attrs:{}}),Ooe=t=>typeof t=="string"&&t.toLowerCase()==="svg";function qVe(t,{style:e,vars:r},n,i){Object.assign(t.style,e,i&&i.getProjectionStyles(n));for(const a in r)t.style.setProperty(a,r[a])}const jVe=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 XVe(t,e,r,n){qVe(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(jVe.has(i)?i:moe(i),e.attrs[i])}const DV={};function Jir(t){Object.assign(DV,t)}function KVe(t,{layout:e,layoutId:r}){return qw.has(t)||t.startsWith("origin")||(e||r!==void 0)&&(!!DV[t]||t==="opacity")}function koe(t,e,r){var n;const{style:i}=t,a={};for(const s in i)(_c(i[s])||e.style&&_c(e.style[s])||KVe(s,t)||((n=r==null?void 0:r.getValue(s))===null||n===void 0?void 0:n.liveStyle)!==void 0)&&(a[s]=i[s]);return a}function ZVe(t,e,r){const n=koe(t,e,r);for(const i in t)if(_c(t[i])||_c(e[i])){const a=Zk.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[a]=t[i]}return n}function ear(t,e){try{e.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{e.dimensions={x:0,y:0,width:0,height:0}}}const JVe=["x","y","width","height","cx","cy","r"],tar={useVisualState:zVe({scrapeMotionValuesFromProps:ZVe,createRenderState:YVe,onUpdate:({props:t,prevProps:e,current:r,renderState:n,latestValues:i})=>{if(!r)return;let a=!!t.drag;if(!a){for(const o in i)if(qw.has(o)){a=!0;break}}if(!a)return;let s=!e;if(e)for(let o=0;o{ear(r,n),Ya.render(()=>{Soe(n,i,Ooe(r.tagName),t.transformTemplate),XVe(r,n)})})}})},rar={useVisualState:zVe({scrapeMotionValuesFromProps:koe,createRenderState:Coe})};function eQe(t,e,r){for(const n in e)!_c(e[n])&&!KVe(n,r)&&(t[n]=e[n])}function nar({transformTemplate:t},e){return se.useMemo(()=>{const r=Coe();return Toe(r,e,t),Object.assign({},r.vars,r.style)},[e])}function iar(t,e){const r=t.style||{},n={};return eQe(n,r,t),Object.assign(n,nar(t,e)),n}function aar(t,e){const r={},n=iar(t,e);return t.drag&&t.dragListener!==!1&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=n,r}function sar(t,e,r,n){const i=se.useMemo(()=>{const a=YVe();return Soe(a,e,Ooe(n),t.transformTemplate),{...a.attrs,style:{...a.style}}},[e]);if(t.style){const a={};eQe(a,t.style,t),i.style={...a,...i.style}}return i}function oar(t=!1){return(r,n,i,{latestValues:a},s)=>{const l=(yoe(r)?sar:aar)(n,a,s,r),u=Tir(n,typeof r=="string",t),h=r!==se.Fragment?{...u,...l,ref:i}:{},{children:d}=n,f=se.useMemo(()=>_c(d)?d.get():d,[d]);return se.createElement(r,{...h,children:f})}}function lar(t,e){return function(n,{forwardMotionProps:i}={forwardMotionProps:!1}){const s={...yoe(n)?tar:rar,preloadedFeatures:t,useRender:oar(i),createVisualElement:e,Component:n};return Dir(s)}}function tQe(t,e){if(!Array.isArray(e))return!1;const r=e.length;if(r!==t.length)return!1;for(let n=0;n(MV===void 0&&Xg.set(Xl.isProcessing||vir.useManualTiming?Xl.timestamp:performance.now()),MV),set:t=>{MV=t,queueMicrotask(car)}};function _oe(t,e){t.indexOf(e)===-1&&t.push(e)}function Roe(t,e){const r=t.indexOf(e);r>-1&&t.splice(r,1)}class Doe{constructor(){this.subscriptions=[]}add(e){return _oe(this.subscriptions,e),()=>Roe(this.subscriptions,e)}notify(e,r,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,r,n);else for(let a=0;a!isNaN(parseFloat(t));class har{constructor(e,r={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(n,i=!0)=>{const a=Xg.now();this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=r.owner}setCurrent(e){this.current=e,this.updatedAt=Xg.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=uar(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,r){this.events[e]||(this.events[e]=new Doe);const n=this.events[e].add(r);return e==="change"?()=>{n(),Ya.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,r){this.passiveEffect=e,this.stopPassiveEffect=r}set(e,r=!0){!r||!this.passiveEffect?this.updateAndNotify(e,r):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,r=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Xg.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>iQe)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,iQe);return nQe(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(e){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=e(r),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 r6(t,e){return new har(t,e)}function dar(t,e,r){t.hasValue(e)?t.getValue(e).set(r):t.addValue(e,r6(r))}function far(t,e){const r=LV(t,e);let{transitionEnd:n={},transition:i={},...a}=r||{};a={...a,...n};for(const s in a){const o=Bir(a[s]);dar(t,s,o)}}function par(t){return!!(_c(t)&&t.add)}function Loe(t,e){const r=t.getValue("willChange");if(par(r))return r.add(e)}function aQe(t){return t.props[NVe]}function Moe(t){let e;return()=>(e===void 0&&(e=t()),e)}const gar=Moe(()=>window.ScrollTimeline!==void 0);class mar{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,r){for(let n=0;n{if(gar()&&i.attachTimeline)return i.attachTimeline(e);if(typeof r=="function")return r(i)});return()=>{n.forEach((i,a)=>{i&&i(),this.animations[a].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let r=0;rr[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class yar extends mar{then(e,r){return Promise.all(this.animations).then(e).catch(r)}}const Lv=t=>t*1e3,Mv=t=>t/1e3;function Ioe(t){return typeof t=="function"}function sQe(t,e){t.timeline=e,t.onfinish=null}const Poe=t=>Array.isArray(t)&&typeof t[0]=="number",bar={linearEasing:void 0};function xar(t,e){const r=Moe(t);return()=>{var n;return(n=bar[e])!==null&&n!==void 0?n:r()}}const IV=xar(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),eE=(t,e,r)=>{const n=e-t;return n===0?1:(r-t)/n},oQe=(t,e,r=10)=>{let n="";const i=Math.max(Math.round(e/r),2);for(let a=0;a`cubic-bezier(${t}, ${e}, ${r}, ${n})`,Noe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:n6([0,.65,.55,1]),circOut:n6([.55,0,1,.45]),backIn:n6([.31,.01,.66,-.59]),backOut:n6([.33,1.53,.69,.99])};function cQe(t,e){if(t)return typeof t=="function"&&IV()?oQe(t,e):Poe(t)?n6(t):Array.isArray(t)?t.map(r=>cQe(r,e)||Noe.easeOut):Noe[t]}const uQe=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,war=1e-7,Aar=12;function Tar(t,e,r,n,i){let a,s,o=0;do s=e+(r-e)/2,a=uQe(s,n,i)-t,a>0?r=s:e=s;while(Math.abs(a)>war&&++oTar(a,0,1,t,r);return a=>a===0||a===1?a:uQe(i(a),e,n)}const hQe=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,dQe=t=>e=>1-t(1-e),fQe=i6(.33,1.53,.69,.99),Boe=dQe(fQe),pQe=hQe(Boe),gQe=t=>(t*=2)<1?.5*Boe(t):.5*(2-Math.pow(2,-10*(t-1))),$oe=t=>1-Math.sin(Math.acos(t)),mQe=dQe($oe),vQe=hQe($oe),yQe=t=>/^0[^.\s]+$/u.test(t);function Sar(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||yQe(t):!0}const a6=t=>Math.round(t*1e5)/1e5,Foe=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Car(t){return t==null}const Oar=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,zoe=(t,e)=>r=>!!(typeof r=="string"&&Oar.test(r)&&r.startsWith(t)||e&&!Car(r)&&Object.prototype.hasOwnProperty.call(r,e)),bQe=(t,e,r)=>n=>{if(typeof n!="string")return n;const[i,a,s,o]=n.match(Foe);return{[t]:parseFloat(i),[e]:parseFloat(a),[r]:parseFloat(s),alpha:o!==void 0?parseFloat(o):1}},kar=t=>Dv(0,255,t),Uoe={...Jk,transform:t=>Math.round(kar(t))},jw={test:zoe("rgb","red"),parse:bQe("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+Uoe.transform(t)+", "+Uoe.transform(e)+", "+Uoe.transform(r)+", "+a6(e6.transform(n))+")"};function Ear(t){let e="",r="",n="",i="";return t.length>5?(e=t.substring(1,3),r=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),r=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,r+=r,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const Voe={test:zoe("#"),parse:Ear,transform:jw.transform},tE={test:zoe("hsl","hue"),parse:bQe("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+jg.transform(a6(e))+", "+jg.transform(a6(r))+", "+a6(e6.transform(n))+")"},Rc={test:t=>jw.test(t)||Voe.test(t)||tE.test(t),parse:t=>jw.test(t)?jw.parse(t):tE.test(t)?tE.parse(t):Voe.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?jw.transform(t):tE.transform(t)},_ar=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Rar(t){var e,r;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Foe))===null||e===void 0?void 0:e.length)||0)+(((r=t.match(_ar))===null||r===void 0?void 0:r.length)||0)>0}const xQe="number",wQe="color",Dar="var",Lar="var(",AQe="${}",Mar=/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 s6(t){const e=t.toString(),r=[],n={color:[],number:[],var:[]},i=[];let a=0;const o=e.replace(Mar,l=>(Rc.test(l)?(n.color.push(a),i.push(wQe),r.push(Rc.parse(l))):l.startsWith(Lar)?(n.var.push(a),i.push(Dar),r.push(l)):(n.number.push(a),i.push(xQe),r.push(parseFloat(l))),++a,AQe)).split(AQe);return{values:r,split:o,indexes:n,types:i}}function TQe(t){return s6(t).values}function SQe(t){const{split:e,types:r}=s6(t),n=e.length;return i=>{let a="";for(let s=0;stypeof t=="number"?0:t;function Par(t){const e=TQe(t);return SQe(t)(e.map(Iar))}const Bb={test:Rar,parse:TQe,createTransformer:SQe,getAnimatableNone:Par},Nar=new Set(["brightness","contrast","saturate","opacity"]);function Bar(t){const[e,r]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=r.match(Foe)||[];if(!n)return t;const i=r.replace(n,"");let a=Nar.has(e)?1:0;return n!==r&&(a*=100),e+"("+a+i+")"}const $ar=/\b([a-z-]*)\(.*?\)/gu,Qoe={...Bb,getAnimatableNone:t=>{const e=t.match($ar);return e?e.map(Bar).join(" "):t}},Far={...Aoe,color:Rc,backgroundColor:Rc,outlineColor:Rc,fill:Rc,stroke:Rc,borderColor:Rc,borderTopColor:Rc,borderRightColor:Rc,borderBottomColor:Rc,borderLeftColor:Rc,filter:Qoe,WebkitFilter:Qoe},Goe=t=>Far[t];function CQe(t,e){let r=Goe(t);return r!==Qoe&&(r=Bb),r.getAnimatableNone?r.getAnimatableNone(e):void 0}const zar=new Set(["auto","none","0"]);function Uar(t,e,r){let n=0,i;for(;nt===Jk||t===dn,kQe=(t,e)=>parseFloat(t.split(", ")[e]),EQe=(t,e)=>(r,{transform:n})=>{if(n==="none"||!n)return 0;const i=n.match(/^matrix3d\((.+)\)$/u);if(i)return kQe(i[1],e);{const a=n.match(/^matrix\((.+)\)$/u);return a?kQe(a[1],t):0}},Var=new Set(["x","y","z"]),Qar=Zk.filter(t=>!Var.has(t));function Gar(t){const e=[];return Qar.forEach(r=>{const n=t.getValue(r);n!==void 0&&(e.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),e}const rE={width:({x:t},{paddingLeft:e="0",paddingRight:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),height:({y:t},{paddingTop:e="0",paddingBottom:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:EQe(4,13),y:EQe(5,14)};rE.translateX=rE.x,rE.translateY=rE.y;const Xw=new Set;let Hoe=!1,Woe=!1;function _Qe(){if(Woe){const t=Array.from(Xw).filter(n=>n.needsMeasurement),e=new Set(t.map(n=>n.element)),r=new Map;e.forEach(n=>{const i=Gar(n);i.length&&(r.set(n,i),n.render())}),t.forEach(n=>n.measureInitialState()),e.forEach(n=>{n.render();const i=r.get(n);i&&i.forEach(([a,s])=>{var o;(o=n.getValue(a))===null||o===void 0||o.set(s)})}),t.forEach(n=>n.measureEndState()),t.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}Woe=!1,Hoe=!1,Xw.forEach(t=>t.complete()),Xw.clear()}function RQe(){Xw.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Woe=!0)})}function Har(){RQe(),_Qe()}class Yoe{constructor(e,r,n,i,a,s=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=r,this.name=n,this.motionValue=i,this.element=a,this.isAsync=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Xw.add(this),Hoe||(Hoe=!0,Ya.read(RQe),Ya.resolveKeyframes(_Qe))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:r,element:n,motionValue:i}=this;for(let a=0;a/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),War=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Yar(t){const e=War.exec(t);if(!e)return[,];const[,r,n,i]=e;return[`--${r??n}`,i]}function LQe(t,e,r=1){const[n,i]=Yar(t);if(!n)return;const a=window.getComputedStyle(e).getPropertyValue(n);if(a){const s=a.trim();return DQe(s)?parseFloat(s):s}return woe(i)?LQe(i,e,r+1):i}const MQe=t=>e=>e.test(t),IQe=[Jk,dn,jg,Nb,Qir,Vir,{test:t=>t==="auto",parse:t=>t}],PQe=t=>IQe.find(MQe(t));class NQe extends Yoe{constructor(e,r,n,i,a){super(e,r,n,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:r,name:n}=this;if(!r||!r.current)return;super.readKeyframes();for(let l=0;l{r.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const BQe=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Bb.test(t)||t==="0")&&!t.startsWith("url("));function qar(t){const e=t[0];if(t.length===1)return!0;for(let r=0;rt!==null;function PV(t,{repeat:e,repeatType:r="loop"},n){const i=t.filter(Xar),a=e&&r!=="loop"&&e%2===1?0:i.length-1;return!a||n===void 0?i[a]:n}const Kar=40;class $Qe{constructor({autoplay:e=!0,delay:r=0,type:n="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:s="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Xg.now(),this.options={autoplay:e,delay:r,type:n,repeat:i,repeatDelay:a,repeatType:s,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>Kar?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Har(),this._resolved}onKeyframesResolved(e,r){this.resolvedAt=Xg.now(),this.hasAttemptedResolve=!0;const{name:n,type:i,velocity:a,delay:s,onComplete:o,onUpdate:l,isGenerator:u}=this.options;if(!u&&!jar(e,n,i,a))if(s)this.options.duration=0;else{l&&l(PV(e,this.options,r)),o&&o(),this.resolveFinishedPromise();return}const h=this.initPlayback(e,r);h!==!1&&(this._resolved={keyframes:e,finalKeyframe:r,...h},this.onPostResolved())}onPostResolved(){}then(e,r){return this.currentFinishedPromise.then(e,r)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const qoe=2e4;function FQe(t){let e=0;const r=50;let n=t.next(e);for(;!n.done&&e=qoe?1/0:e}const bs=(t,e,r)=>t+(e-t)*r;function joe(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function Zar({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let i=0,a=0,s=0;if(!e)i=a=s=r;else{const o=r<.5?r*(1+e):r+e-r*e,l=2*r-o;i=joe(l,o,t+1/3),a=joe(l,o,t),s=joe(l,o,t-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(s*255),alpha:n}}function NV(t,e){return r=>r>0?e:t}const Xoe=(t,e,r)=>{const n=t*t,i=r*(e*e-n)+n;return i<0?0:Math.sqrt(i)},Jar=[Voe,jw,tE],esr=t=>Jar.find(e=>e.test(t));function zQe(t){const e=esr(t);if(!e)return!1;let r=e.parse(t);return e===tE&&(r=Zar(r)),r}const UQe=(t,e)=>{const r=zQe(t),n=zQe(e);if(!r||!n)return NV(t,e);const i={...r};return a=>(i.red=Xoe(r.red,n.red,a),i.green=Xoe(r.green,n.green,a),i.blue=Xoe(r.blue,n.blue,a),i.alpha=bs(r.alpha,n.alpha,a),jw.transform(i))},tsr=(t,e)=>r=>e(t(r)),o6=(...t)=>t.reduce(tsr),Koe=new Set(["none","hidden"]);function rsr(t,e){return Koe.has(t)?r=>r<=0?t:e:r=>r>=1?e:t}function nsr(t,e){return r=>bs(t,e,r)}function Zoe(t){return typeof t=="number"?nsr:typeof t=="string"?woe(t)?NV:Rc.test(t)?UQe:ssr:Array.isArray(t)?VQe:typeof t=="object"?Rc.test(t)?UQe:isr:NV}function VQe(t,e){const r=[...t],n=r.length,i=t.map((a,s)=>Zoe(a)(a,e[s]));return a=>{for(let s=0;s{for(const a in n)r[a]=n[a](i);return r}}function asr(t,e){var r;const n=[],i={color:0,var:0,number:0};for(let a=0;a{const r=Bb.createTransformer(e),n=s6(t),i=s6(e);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?Koe.has(t)&&!i.values.length||Koe.has(e)&&!n.values.length?rsr(t,e):o6(VQe(asr(n,i),i.values),r):NV(t,e)};function QQe(t,e,r){return typeof t=="number"&&typeof e=="number"&&typeof r=="number"?bs(t,e,r):Zoe(t)(t,e)}const osr=5;function GQe(t,e,r){const n=Math.max(e-osr,0);return nQe(r-t(n),e-n)}const Ms={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},Joe=.001;function lsr({duration:t=Ms.duration,bounce:e=Ms.bounce,velocity:r=Ms.velocity,mass:n=Ms.mass}){let i,a,s=1-e;s=Dv(Ms.minDamping,Ms.maxDamping,s),t=Dv(Ms.minDuration,Ms.maxDuration,Mv(t)),s<1?(i=u=>{const h=u*s,d=h*t,f=h-r,p=ele(u,s),g=Math.exp(-d);return Joe-f/p*g},a=u=>{const d=u*s*t,f=d*r+r,p=Math.pow(s,2)*Math.pow(u,2)*t,g=Math.exp(-d),m=ele(Math.pow(u,2),s);return(-i(u)+Joe>0?-1:1)*((f-p)*g)/m}):(i=u=>{const h=Math.exp(-u*t),d=(u-r)*t+1;return-Joe+h*d},a=u=>{const h=Math.exp(-u*t),d=(r-u)*(t*t);return h*d});const o=5/t,l=usr(i,a,o);if(t=Lv(t),isNaN(l))return{stiffness:Ms.stiffness,damping:Ms.damping,duration:t};{const u=Math.pow(l,2)*n;return{stiffness:u,damping:s*2*Math.sqrt(n*u),duration:t}}}const csr=12;function usr(t,e,r){let n=r;for(let i=1;it[r]!==void 0)}function fsr(t){let e={velocity:Ms.velocity,stiffness:Ms.stiffness,damping:Ms.damping,mass:Ms.mass,isResolvedFromDuration:!1,...t};if(!HQe(t,dsr)&&HQe(t,hsr))if(t.visualDuration){const r=t.visualDuration,n=2*Math.PI/(r*1.2),i=n*n,a=2*Dv(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:Ms.mass,stiffness:i,damping:a}}else{const r=lsr(t);e={...e,...r,mass:Ms.mass},e.isResolvedFromDuration=!0}return e}function WQe(t=Ms.visualDuration,e=Ms.bounce){const r=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:n,restDelta:i}=r;const a=r.keyframes[0],s=r.keyframes[r.keyframes.length-1],o={done:!1,value:a},{stiffness:l,damping:u,mass:h,duration:d,velocity:f,isResolvedFromDuration:p}=fsr({...r,velocity:-Mv(r.velocity||0)}),g=f||0,m=u/(2*Math.sqrt(l*h)),v=s-a,y=Mv(Math.sqrt(l/h)),b=Math.abs(v)<5;n||(n=b?Ms.restSpeed.granular:Ms.restSpeed.default),i||(i=b?Ms.restDelta.granular:Ms.restDelta.default);let x;if(m<1){const A=ele(y,m);x=T=>{const S=Math.exp(-m*y*T);return s-S*((g+m*y*v)/A*Math.sin(A*T)+v*Math.cos(A*T))}}else if(m===1)x=A=>s-Math.exp(-y*A)*(v+(g+y*v)*A);else{const A=y*Math.sqrt(m*m-1);x=T=>{const S=Math.exp(-m*y*T),O=Math.min(A*T,300);return s-S*((g+m*y*v)*Math.sinh(O)+A*v*Math.cosh(O))/A}}const w={calculatedDuration:p&&d||null,next:A=>{const T=x(A);if(p)o.done=A>=d;else{let S=0;m<1&&(S=A===0?Lv(g):GQe(x,A,T));const O=Math.abs(S)<=n,k=Math.abs(s-T)<=i;o.done=O&&k}return o.value=o.done?s:T,o},toString:()=>{const A=Math.min(FQe(w),qoe),T=oQe(S=>w.next(A*S).value,A,30);return A+"ms "+T}};return w}function YQe({keyframes:t,velocity:e=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:s,min:o,max:l,restDelta:u=.5,restSpeed:h}){const d=t[0],f={done:!1,value:d},p=O=>o!==void 0&&Ol,g=O=>o===void 0?l:l===void 0||Math.abs(o-O)-m*Math.exp(-O/n),x=O=>y+b(O),w=O=>{const k=b(O),E=x(O);f.done=Math.abs(k)<=u,f.value=f.done?y:E};let A,T;const S=O=>{p(f.value)&&(A=O,T=WQe({keyframes:[f.value,g(f.value)],velocity:GQe(x,O,f.value),damping:i,stiffness:a,restDelta:u,restSpeed:h}))};return S(0),{calculatedDuration:null,next:O=>{let k=!1;return!T&&A===void 0&&(k=!0,w(O),S(O)),A!==void 0&&O>=A?T.next(O-A):(!k&&w(O),f)}}}const psr=i6(.42,0,1,1),gsr=i6(0,0,.58,1),qQe=i6(.42,0,.58,1),msr=t=>Array.isArray(t)&&typeof t[0]!="number",vsr={linear:vd,easeIn:psr,easeInOut:qQe,easeOut:gsr,circIn:$oe,circInOut:vQe,circOut:mQe,backIn:Boe,backInOut:pQe,backOut:fQe,anticipate:gQe},jQe=t=>{if(Poe(t)){_Ve(t.length===4);const[e,r,n,i]=t;return i6(e,r,n,i)}else if(typeof t=="string")return vsr[t];return t};function ysr(t,e,r){const n=[],i=r||QQe,a=t.length-1;for(let s=0;se[0];if(a===2&&e[0]===e[1])return()=>e[1];const s=t[0]===t[1];t[0]>t[a-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=ysr(e,n,i),l=o.length,u=h=>{if(s&&h1)for(;du(Dv(t[0],t[a-1],h)):u}function xsr(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=eE(0,e,n);t.push(bs(r,1,i))}}function wsr(t){const e=[0];return xsr(e,t.length-1),e}function Asr(t,e){return t.map(r=>r*e)}function Tsr(t,e){return t.map(()=>e||qQe).splice(0,t.length-1)}function BV({duration:t=300,keyframes:e,times:r,ease:n="easeInOut"}){const i=msr(n)?n.map(jQe):jQe(n),a={done:!1,value:e[0]},s=Asr(r&&r.length===e.length?r:wsr(e),t),o=bsr(s,e,{ease:Array.isArray(i)?i:Tsr(e,i)});return{calculatedDuration:t,next:l=>(a.value=o(l),a.done=l>=t,a)}}const Ssr=t=>{const e=({timestamp:r})=>t(r);return{start:()=>Ya.update(e,!0),stop:()=>Pb(e),now:()=>Xl.isProcessing?Xl.timestamp:Xg.now()}},Csr={decay:YQe,inertia:YQe,tween:BV,keyframes:BV,spring:WQe},Osr=t=>t/100;class tle extends $Qe{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:r,motionValue:n,element:i,keyframes:a}=this.options,s=(i==null?void 0:i.KeyframeResolver)||Yoe,o=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new s(a,o,r,n,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:r="keyframes",repeat:n=0,repeatDelay:i=0,repeatType:a,velocity:s=0}=this.options,o=Ioe(r)?r:Csr[r]||BV;let l,u;o!==BV&&typeof e[0]!="number"&&(l=o6(Osr,QQe(e[0],e[1])),e=[0,100]);const h=o({...this.options,keyframes:e});a==="mirror"&&(u=o({...this.options,keyframes:[...e].reverse(),velocity:-s})),h.calculatedDuration===null&&(h.calculatedDuration=FQe(h));const{calculatedDuration:d}=h,f=d+i,p=f*(n+1)-i;return{generator:h,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:f,totalDuration:p}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,r=!1){const{resolved:n}=this;if(!n){const{keyframes:O}=this.options;return{done:!0,value:O[O.length-1]}}const{finalKeyframe:i,generator:a,mirroredGenerator:s,mapPercentToKeyframes:o,keyframes:l,calculatedDuration:u,totalDuration:h,resolvedDuration:d}=n;if(this.startTime===null)return a.next(0);const{delay:f,repeat:p,repeatType:g,repeatDelay:m,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-h/this.speed,this.startTime)),r?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const y=this.currentTime-f*(this.speed>=0?1:-1),b=this.speed>=0?y<0:y>h;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=h);let x=this.currentTime,w=a;if(p){const O=Math.min(this.currentTime,h)/d;let k=Math.floor(O),E=O%1;!E&&O>=1&&(E=1),E===1&&k--,k=Math.min(k,p+1),!!(k%2)&&(g==="reverse"?(E=1-E,m&&(E-=m/d)):g==="mirror"&&(w=s)),x=Dv(0,1,E)*d}const A=b?{done:!1,value:l[0]}:w.next(x);o&&(A.value=o(A.value));let{done:T}=A;!b&&u!==null&&(T=this.speed>=0?this.currentTime>=h:this.currentTime<=0);const S=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return S&&i!==void 0&&(A.value=PV(l,this.options,i)),v&&v(A.value),S&&this.finish(),A}get duration(){const{resolved:e}=this;return e?Mv(e.calculatedDuration):0}get time(){return Mv(this.currentTime)}set time(e){e=Lv(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const r=this.playbackSpeed!==e;this.playbackSpeed=e,r&&(this.time=Mv(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=Ssr,onPlay:r,startTime:n}=this.options;this.driver||(this.driver=e(a=>this.tick(a))),r&&r();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=n??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}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(e){return this.startTime=0,this.tick(e,!0)}}const ksr=new Set(["opacity","clipPath","filter","transform"]);function Esr(t,e,r,{delay:n=0,duration:i=300,repeat:a=0,repeatType:s="loop",ease:o="easeInOut",times:l}={}){const u={[e]:r};l&&(u.offset=l);const h=cQe(o,i);return Array.isArray(h)&&(u.easing=h),t.animate(u,{delay:n,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:a+1,direction:s==="reverse"?"alternate":"normal"})}const _sr=Moe(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),$V=10,Rsr=2e4;function Dsr(t){return Ioe(t.type)||t.type==="spring"||!lQe(t.ease)}function Lsr(t,e){const r=new tle({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let n={done:!1,value:t[0]};const i=[];let a=0;for(;!n.done&&athis.onKeyframesResolved(s,o),r,n,i),this.resolver.scheduleResolve()}initPlayback(e,r){let{duration:n=300,times:i,ease:a,type:s,motionValue:o,name:l,startTime:u}=this.options;if(!o.owner||!o.owner.current)return!1;if(typeof a=="string"&&IV()&&Msr(a)&&(a=XQe[a]),Dsr(this.options)){const{onComplete:d,onUpdate:f,motionValue:p,element:g,...m}=this.options,v=Lsr(e,m);e=v.keyframes,e.length===1&&(e[1]=e[0]),n=v.duration,i=v.times,a=v.ease,s="keyframes"}const h=Esr(o.owner.current,l,e,{...this.options,duration:n,times:i,ease:a});return h.startTime=u??this.calcStartTime(),this.pendingTimeline?(sQe(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:d}=this.options;o.set(PV(e,this.options,r)),d&&d(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:n,times:i,type:s,ease:a,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:r}=e;return Mv(r)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:r}=e;return Mv(r.currentTime||0)}set time(e){const{resolved:r}=this;if(!r)return;const{animation:n}=r;n.currentTime=Lv(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:r}=e;return r.playbackRate}set speed(e){const{resolved:r}=this;if(!r)return;const{animation:n}=r;n.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:r}=e;return r.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:r}=e;return r.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:r}=this;if(!r)return vd;const{animation:n}=r;sQe(n,e)}return vd}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:r}=e;r.playState==="finished"&&this.updateFinishedPromise(),r.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:r}=e;r.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:r,keyframes:n,duration:i,type:a,ease:s,times:o}=e;if(r.playState==="idle"||r.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:h,onComplete:d,element:f,...p}=this.options,g=new tle({...p,keyframes:n,duration:i,type:a,ease:s,times:o,isGenerator:!0}),m=Lv(this.time);u.setWithVelocity(g.sample(m-$V).value,g.sample(m).value,$V)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:r,name:n,repeatDelay:i,repeatType:a,damping:s,type:o}=e;if(!r||!r.owner||!(r.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=r.owner.getProps();return _sr()&&n&&ksr.has(n)&&!l&&!u&&!i&&a!=="mirror"&&s!==0&&o!=="inertia"}}const Isr={type:"spring",stiffness:500,damping:25,restSpeed:10},Psr=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Nsr={type:"keyframes",duration:.8},Bsr={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},$sr=(t,{keyframes:e})=>e.length>2?Nsr:qw.has(t)?t.startsWith("scale")?Psr(e[1]):Isr:Bsr;function Fsr({when:t,delay:e,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:a,repeatType:s,repeatDelay:o,from:l,elapsed:u,...h}){return!!Object.keys(h).length}const rle=(t,e,r,n={},i,a)=>s=>{const o=Eoe(n,t)||{},l=o.delay||n.delay||0;let{elapsed:u=0}=n;u=u-Lv(l);let h={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:e.getVelocity(),...o,delay:-u,onUpdate:f=>{e.set(f),o.onUpdate&&o.onUpdate(f)},onComplete:()=>{s(),o.onComplete&&o.onComplete()},name:t,motionValue:e,element:a?void 0:i};Fsr(o)||(h={...h,...$sr(t,h)}),h.duration&&(h.duration=Lv(h.duration)),h.repeatDelay&&(h.repeatDelay=Lv(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let d=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(h.duration=0,h.delay===0&&(d=!0)),d&&!a&&e.get()!==void 0){const f=PV(h.keyframes,o);if(f!==void 0)return Ya.update(()=>{h.onUpdate(f),h.onComplete()}),new yar([])}return!a&&KQe.supports(h)?new KQe(h):new tle(h)};function zsr({protectedKeys:t,needsAnimating:e},r){const n=t.hasOwnProperty(r)&&e[r]!==!0;return e[r]=!1,n}function ZQe(t,e,{delay:r=0,transitionOverride:n,type:i}={}){var a;let{transition:s=t.getDefaultTransition(),transitionEnd:o,...l}=e;n&&(s=n);const u=[],h=i&&t.animationState&&t.animationState.getState()[i];for(const d in l){const f=t.getValue(d,(a=t.latestValues[d])!==null&&a!==void 0?a:null),p=l[d];if(p===void 0||h&&zsr(h,d))continue;const g={delay:r,...Eoe(s||{},d)};let m=!1;if(window.MotionHandoffAnimation){const y=aQe(t);if(y){const b=window.MotionHandoffAnimation(y,d,Ya);b!==null&&(g.startTime=b,m=!0)}}Loe(t,d),f.start(rle(d,f,p,t.shouldReduceMotion&&rQe.has(d)?{type:!1}:g,t,m));const v=f.animation;v&&u.push(v)}return o&&Promise.all(u).then(()=>{Ya.update(()=>{o&&far(t,o)})}),u}function nle(t,e,r={}){var n;const i=LV(t,e,r.type==="exit"?(n=t.presenceContext)===null||n===void 0?void 0:n.custom:void 0);let{transition:a=t.getDefaultTransition()||{}}=i||{};r.transitionOverride&&(a=r.transitionOverride);const s=i?()=>Promise.all(ZQe(t,i,r)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:h=0,staggerChildren:d,staggerDirection:f}=a;return Usr(t,e,h+u,d,f,r)}:()=>Promise.resolve(),{when:l}=a;if(l){const[u,h]=l==="beforeChildren"?[s,o]:[o,s];return u().then(()=>h())}else return Promise.all([s(),o(r.delay)])}function Usr(t,e,r=0,n=0,i=1,a){const s=[],o=(t.variantChildren.size-1)*n,l=i===1?(u=0)=>u*n:(u=0)=>o-u*n;return Array.from(t.variantChildren).sort(Vsr).forEach((u,h)=>{u.notify("AnimationStart",e),s.push(nle(u,e,{...a,delay:r+l(h)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(s)}function Vsr(t,e){return t.sortNodePosition(e)}function Qsr(t,e,r={}){t.notify("AnimationStart",e);let n;if(Array.isArray(e)){const i=e.map(a=>nle(t,a,r));n=Promise.all(i)}else if(typeof e=="string")n=nle(t,e,r);else{const i=typeof e=="function"?LV(t,e,r.custom):e;n=Promise.all(ZQe(t,i,r))}return n.then(()=>{t.notify("AnimationComplete",e)})}const Gsr=goe.length;function JQe(t){if(!t)return;if(!t.isControllingVariants){const r=t.parent?JQe(t.parent)||{}:{};return t.props.initial!==void 0&&(r.initial=t.props.initial),r}const e={};for(let r=0;rPromise.all(e.map(({animation:r,options:n})=>Qsr(t,r,n)))}function qsr(t){let e=Ysr(t),r=eGe(),n=!0;const i=l=>(u,h)=>{var d;const f=LV(t,h,l==="exit"?(d=t.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(f){const{transition:p,transitionEnd:g,...m}=f;u={...u,...m,...g}}return u};function a(l){e=l(t)}function s(l){const{props:u}=t,h=JQe(t.parent)||{},d=[],f=new Set;let p={},g=1/0;for(let v=0;vg&&w,k=!1;const E=Array.isArray(x)?x:[x];let _=E.reduce(i(y),{});A===!1&&(_={});const{prevResolvedValues:I={}}=b,L={...I,..._},R=P=>{O=!0,f.has(P)&&(k=!0,f.delete(P)),b.needsAnimating[P]=!0;const N=t.getValue(P);N&&(N.liveStyle=!1)};for(const P in L){const N=_[P],F=I[P];if(p.hasOwnProperty(P))continue;let B=!1;xoe(N)&&xoe(F)?B=!tQe(N,F):B=N!==F,B?N!=null?R(P):f.add(P):N!==void 0&&f.has(P)?R(P):b.protectedKeys[P]=!0}b.prevProp=x,b.prevResolvedValues=_,b.isActive&&(p={...p,..._}),n&&t.blockInitialAnimation&&(O=!1),O&&(!(T&&S)||k)&&d.push(...E.map(P=>({animation:P,options:{type:y}})))}if(f.size){const v={};f.forEach(y=>{const b=t.getBaseTarget(y),x=t.getValue(y);x&&(x.liveStyle=!0),v[y]=b??null}),d.push({animation:v})}let m=!!d.length;return n&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(m=!1),n=!1,m?e(d):Promise.resolve()}function o(l,u){var h;if(r[l].isActive===u)return Promise.resolve();(h=t.variantChildren)===null||h===void 0||h.forEach(f=>{var p;return(p=f.animationState)===null||p===void 0?void 0:p.setActive(l,u)}),r[l].isActive=u;const d=s(l);for(const f in r)r[f].protectedKeys={};return d}return{animateChanges:s,setActive:o,setAnimateFunction:a,getState:()=>r,reset:()=>{r=eGe(),n=!0}}}function jsr(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!tQe(e,t):!1}function Kw(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function eGe(){return{animate:Kw(!0),whileInView:Kw(),whileHover:Kw(),whileTap:Kw(),whileDrag:Kw(),whileFocus:Kw(),exit:Kw()}}class $b{constructor(e){this.isMounted=!1,this.node=e}update(){}}class Xsr extends $b{constructor(e){super(e),e.animationState||(e.animationState=qsr(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();kV(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:r}=this.node.prevProps||{};e!==r&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let Ksr=0;class Zsr extends $b{constructor(){super(...arguments),this.id=Ksr++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const i=this.node.animationState.setActive("exit",!e);r&&!e&&i.then(()=>r(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const Jsr={animation:{Feature:Xsr},exit:{Feature:Zsr}},Mp={x:!1,y:!1};function tGe(){return Mp.x||Mp.y}function eor(t){return t==="x"||t==="y"?Mp[t]?null:(Mp[t]=!0,()=>{Mp[t]=!1}):Mp.x||Mp.y?null:(Mp.x=Mp.y=!0,()=>{Mp.x=Mp.y=!1})}const ile=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function l6(t,e,r,n={passive:!0}){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r)}function c6(t){return{point:{x:t.pageX,y:t.pageY}}}const tor=t=>e=>ile(e)&&t(e,c6(e));function u6(t,e,r,n){return l6(t,e,tor(r),n)}const rGe=(t,e)=>Math.abs(t-e);function ror(t,e){const r=rGe(t.x,e.x),n=rGe(t.y,e.y);return Math.sqrt(r**2+n**2)}class nGe{constructor(e,r,{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:a=!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 d=sle(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=ror(d.offset,{x:0,y:0})>=3;if(!f&&!p)return;const{point:g}=d,{timestamp:m}=Xl;this.history.push({...g,timestamp:m});const{onStart:v,onMove:y}=this.handlers;f||(v&&v(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=ale(f,this.transformPagePoint),Ya.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:p,onSessionEnd:g,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=sle(d.type==="pointercancel"?this.lastMoveEventInfo:ale(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,v),g&&g(d,v)},!ile(e))return;this.dragSnapToOrigin=a,this.handlers=r,this.transformPagePoint=n,this.contextWindow=i||window;const s=c6(e),o=ale(s,this.transformPagePoint),{point:l}=o,{timestamp:u}=Xl;this.history=[{...l,timestamp:u}];const{onSessionStart:h}=r;h&&h(e,sle(o,this.history)),this.removeListeners=o6(u6(this.contextWindow,"pointermove",this.handlePointerMove),u6(this.contextWindow,"pointerup",this.handlePointerUp),u6(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Pb(this.updatePoint)}}function ale(t,e){return e?{point:e(t.point)}:t}function iGe(t,e){return{x:t.x-e.x,y:t.y-e.y}}function sle({point:t},e){return{point:t,delta:iGe(t,aGe(e)),offset:iGe(t,nor(e)),velocity:ior(e,.1)}}function nor(t){return t[0]}function aGe(t){return t[t.length-1]}function ior(t,e){if(t.length<2)return{x:0,y:0};let r=t.length-1,n=null;const i=aGe(t);for(;r>=0&&(n=t[r],!(i.timestamp-n.timestamp>Lv(e)));)r--;if(!n)return{x:0,y:0};const a=Mv(i.timestamp-n.timestamp);if(a===0)return{x:0,y:0};const s={x:(i.x-n.x)/a,y:(i.y-n.y)/a};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}const sGe=1e-4,aor=1-sGe,sor=1+sGe,oGe=.01,oor=0-oGe,lor=0+oGe;function yd(t){return t.max-t.min}function cor(t,e,r){return Math.abs(t-e)<=r}function lGe(t,e,r,n=.5){t.origin=n,t.originPoint=bs(e.min,e.max,t.origin),t.scale=yd(r)/yd(e),t.translate=bs(r.min,r.max,t.origin)-t.originPoint,(t.scale>=aor&&t.scale<=sor||isNaN(t.scale))&&(t.scale=1),(t.translate>=oor&&t.translate<=lor||isNaN(t.translate))&&(t.translate=0)}function h6(t,e,r,n){lGe(t.x,e.x,r.x,n?n.originX:void 0),lGe(t.y,e.y,r.y,n?n.originY:void 0)}function cGe(t,e,r){t.min=r.min+e.min,t.max=t.min+yd(e)}function uor(t,e,r){cGe(t.x,e.x,r.x),cGe(t.y,e.y,r.y)}function uGe(t,e,r){t.min=e.min-r.min,t.max=t.min+yd(e)}function d6(t,e,r){uGe(t.x,e.x,r.x),uGe(t.y,e.y,r.y)}function hor(t,{min:e,max:r},n){return e!==void 0&&tr&&(t=n?bs(r,t,n.max):Math.min(t,r)),t}function hGe(t,e,r){return{min:e!==void 0?t.min+e:void 0,max:r!==void 0?t.max+r-(t.max-t.min):void 0}}function dor(t,{top:e,left:r,bottom:n,right:i}){return{x:hGe(t.x,r,i),y:hGe(t.y,e,n)}}function dGe(t,e){let r=e.min-t.min,n=e.max-t.max;return e.max-e.minn?r=eE(e.min,e.max-n,t.min):n>i&&(r=eE(t.min,t.max-i,e.min)),Dv(0,1,r)}function mor(t,e){const r={};return e.min!==void 0&&(r.min=e.min-t.min),e.max!==void 0&&(r.max=e.max-t.min),r}const ole=.35;function vor(t=ole){return t===!1?t=0:t===!0&&(t=ole),{x:fGe(t,"left","right"),y:fGe(t,"top","bottom")}}function fGe(t,e,r){return{min:pGe(t,e),max:pGe(t,r)}}function pGe(t,e){return typeof t=="number"?t:t[e]||0}const gGe=()=>({translate:0,scale:1,origin:0,originPoint:0}),nE=()=>({x:gGe(),y:gGe()}),mGe=()=>({min:0,max:0}),Js=()=>({x:mGe(),y:mGe()});function Sf(t){return[t("x"),t("y")]}function vGe({top:t,left:e,right:r,bottom:n}){return{x:{min:e,max:r},y:{min:t,max:n}}}function yor({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function bor(t,e){if(!e)return t;const r=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function lle(t){return t===void 0||t===1}function cle({scale:t,scaleX:e,scaleY:r}){return!lle(t)||!lle(e)||!lle(r)}function Zw(t){return cle(t)||yGe(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function yGe(t){return bGe(t.x)||bGe(t.y)}function bGe(t){return t&&t!=="0%"}function FV(t,e,r){const n=t-r,i=e*n;return r+i}function xGe(t,e,r,n,i){return i!==void 0&&(t=FV(t,i,n)),FV(t,r,n)+e}function ule(t,e=0,r=1,n,i){t.min=xGe(t.min,e,r,n,i),t.max=xGe(t.max,e,r,n,i)}function wGe(t,{x:e,y:r}){ule(t.x,e.translate,e.scale,e.originPoint),ule(t.y,r.translate,r.scale,r.originPoint)}const AGe=.999999999999,TGe=1.0000000000001;function xor(t,e,r,n=!1){const i=r.length;if(!i)return;e.x=e.y=1;let a,s;for(let o=0;oAGe&&(e.x=1),e.yAGe&&(e.y=1)}function iE(t,e){t.min=t.min+e,t.max=t.max+e}function SGe(t,e,r,n,i=.5){const a=bs(t.min,t.max,i);ule(t,e,r,a,n)}function aE(t,e){SGe(t.x,e.x,e.scaleX,e.scale,e.originX),SGe(t.y,e.y,e.scaleY,e.scale,e.originY)}function CGe(t,e){return vGe(bor(t.getBoundingClientRect(),e))}function wor(t,e,r){const n=CGe(t,r),{scroll:i}=e;return i&&(iE(n.x,i.offset.x),iE(n.y,i.offset.y)),n}const OGe=({current:t})=>t?t.ownerDocument.defaultView:null,Aor=new WeakMap;class Tor{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Js(),this.visualElement=e}start(e,{snapToCursor:r=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;const i=h=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(c6(h).point)},a=(h,d)=>{const{drag:f,dragPropagation:p,onDragStart:g}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=eor(f),!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),Sf(v=>{let y=this.getAxisMotionValue(v).get()||0;if(jg.test(y)){const{projection:b}=this.visualElement;if(b&&b.layout){const x=b.layout.layoutBox[v];x&&(y=yd(x)*(parseFloat(y)/100))}}this.originPoint[v]=y}),g&&Ya.postRender(()=>g(h,d)),Loe(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},s=(h,d)=>{const{dragPropagation:f,dragDirectionLock:p,onDirectionLock:g,onDrag:m}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:v}=d;if(p&&this.currentDirection===null){this.currentDirection=Sor(v),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",d.point,v),this.updateAxis("y",d.point,v),this.visualElement.render(),m&&m(h,d)},o=(h,d)=>this.stop(h,d),l=()=>Sf(h=>{var d;return this.getAnimationState(h)==="paused"&&((d=this.getAxisMotionValue(h).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new nGe(e,{onSessionStart:i,onStart:a,onMove:s,onSessionEnd:o,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:OGe(this.visualElement)})}stop(e,r){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=r;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&Ya.postRender(()=>a(e,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:r}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(e,r,n){const{drag:i}=this.getProps();if(!n||!zV(e,i,this.currentDirection))return;const a=this.getAxisMotionValue(e);let s=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(s=hor(s,this.constraints[e],this.elastic[e])),a.set(s)}resolveConstraints(){var e;const{dragConstraints:r,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,a=this.constraints;r&&Kk(r)?this.constraints||(this.constraints=this.resolveRefConstraints()):r&&i?this.constraints=dor(i.layoutBox,r):this.constraints=!1,this.elastic=vor(n),a!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Sf(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=mor(i.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:r}=this.getProps();if(!e||!Kk(e))return!1;const n=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=wor(n,i.root,this.visualElement.getTransformPagePoint());let s=por(i.layout.layoutBox,a);if(r){const o=r(yor(s));this.hasMutatedConstraints=!!o,o&&(s=vGe(o))}return s}startAnimation(e){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:a,dragSnapToOrigin:s,onDragTransitionEnd:o}=this.getProps(),l=this.constraints||{},u=Sf(h=>{if(!zV(h,r,this.currentDirection))return;let d=l&&l[h]||{};s&&(d={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,g={type:"inertia",velocity:n?e[h]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...a,...d};return this.startAxisValueAnimation(h,g)});return Promise.all(u).then(o)}startAxisValueAnimation(e,r){const n=this.getAxisMotionValue(e);return Loe(this.visualElement,e),n.start(rle(e,n,0,r,this.visualElement,!1))}stopAnimation(){Sf(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Sf(e=>{var r;return(r=this.getAxisMotionValue(e).animation)===null||r===void 0?void 0:r.pause()})}getAnimationState(e){var r;return(r=this.getAxisMotionValue(e).animation)===null||r===void 0?void 0:r.state}getAxisMotionValue(e){const r=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps(),i=n[r];return i||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){Sf(r=>{const{drag:n}=this.getProps();if(!zV(r,n,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(r);if(i&&i.layout){const{min:s,max:o}=i.layout.layoutBox[r];a.set(e[r]-bs(s,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!Kk(r)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Sf(s=>{const o=this.getAxisMotionValue(s);if(o&&this.constraints!==!1){const l=o.get();i[s]=gor({min:l,max:l},this.constraints[s])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Sf(s=>{if(!zV(s,e,null))return;const o=this.getAxisMotionValue(s),{min:l,max:u}=this.constraints[s];o.set(bs(l,u,i[s]))})}addListeners(){if(!this.visualElement.current)return;Aor.set(this.visualElement,this);const e=this.visualElement.current,r=u6(e,"pointerdown",l=>{const{drag:u,dragListener:h=!0}=this.getProps();u&&h&&this.start(l)}),n=()=>{const{dragConstraints:l}=this.getProps();Kk(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,a=i.addEventListener("measure",n);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Ya.read(n);const s=l6(window,"resize",()=>this.scalePositionWithinConstraints()),o=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Sf(h=>{const d=this.getAxisMotionValue(h);d&&(this.originPoint[h]+=l[h].translate,d.set(d.get()+l[h].translate))}),this.visualElement.render())});return()=>{s(),r(),a(),o&&o()}}getProps(){const e=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:s=ole,dragMomentum:o=!0}=e;return{...e,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:a,dragElastic:s,dragMomentum:o}}}function zV(t,e,r){return(e===!0||e===t)&&(r===null||r===t)}function Sor(t,e=10){let r=null;return Math.abs(t.y)>e?r="y":Math.abs(t.x)>e&&(r="x"),r}class Cor extends $b{constructor(e){super(e),this.removeGroupControls=vd,this.removeListeners=vd,this.controls=new Tor(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||vd}unmount(){this.removeGroupControls(),this.removeListeners()}}const kGe=t=>(e,r)=>{t&&Ya.postRender(()=>t(e,r))};class Oor extends $b{constructor(){super(...arguments),this.removePointerDownListener=vd}onPointerDown(e){this.session=new nGe(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:OGe(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:kGe(e),onStart:kGe(r),onMove:n,onEnd:(a,s)=>{delete this.session,i&&Ya.postRender(()=>i(a,s))}}}mount(){this.removePointerDownListener=u6(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const UV={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function EGe(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const f6={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(dn.test(t))t=parseFloat(t);else return t;const r=EGe(t,e.target.x),n=EGe(t,e.target.y);return`${r}% ${n}%`}},kor={correct:(t,{treeScale:e,projectionDelta:r})=>{const n=t,i=Bb.parse(t);if(i.length>5)return n;const a=Bb.createTransformer(t),s=typeof i[0]!="number"?1:0,o=r.x.scale*e.x,l=r.y.scale*e.y;i[0+s]/=o,i[1+s]/=l;const u=bs(o,l,.5);return typeof i[2+s]=="number"&&(i[2+s]/=u),typeof i[3+s]=="number"&&(i[3+s]/=u),a(i)}};class Eor extends se.Component{componentDidMount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:a}=e;Jir(_or),a&&(r.group&&r.group.add(a),n&&n.register&&i&&n.register(a),a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),UV.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:r,visualElement:n,drag:i,isPresent:a}=this.props,s=n.projection;return s&&(s.isPresent=a,i||e.layoutDependency!==r||r===void 0?s.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?s.promote():s.relegate()||Ya.postRender(()=>{const o=s.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),voe.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function _Ge(t){const[e,r]=OVe(),n=se.useContext(coe);return W.jsx(Eor,{...t,layoutGroup:n,switchLayoutGroup:se.useContext(BVe),isPresent:e,safeToRemove:r})}const _or={borderRadius:{...f6,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:f6,borderTopRightRadius:f6,borderBottomLeftRadius:f6,borderBottomRightRadius:f6,boxShadow:kor};function Ror(t,e,r){const n=_c(t)?t:r6(t);return n.start(rle("",n,e,r)),n.animation}function Dor(t){return t instanceof SVGElement&&t.tagName!=="svg"}const Lor=(t,e)=>t.depth-e.depth;class Mor{constructor(){this.children=[],this.isDirty=!1}add(e){_oe(this.children,e),this.isDirty=!0}remove(e){Roe(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Lor),this.isDirty=!1,this.children.forEach(e)}}function Ior(t,e){const r=Xg.now(),n=({timestamp:i})=>{const a=i-r;a>=e&&(Pb(n),t(a-e))};return Ya.read(n,!0),()=>Pb(n)}const RGe=["TopLeft","TopRight","BottomLeft","BottomRight"],Por=RGe.length,DGe=t=>typeof t=="string"?parseFloat(t):t,LGe=t=>typeof t=="number"||dn.test(t);function Nor(t,e,r,n,i,a){i?(t.opacity=bs(0,r.opacity!==void 0?r.opacity:1,Bor(n)),t.opacityExit=bs(e.opacity!==void 0?e.opacity:1,0,$or(n))):a&&(t.opacity=bs(e.opacity!==void 0?e.opacity:1,r.opacity!==void 0?r.opacity:1,n));for(let s=0;sne?1:r(eE(t,e,n))}function PGe(t,e){t.min=e.min,t.max=e.max}function Cf(t,e){PGe(t.x,e.x),PGe(t.y,e.y)}function NGe(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function BGe(t,e,r,n,i){return t-=e,t=FV(t,1/r,n),i!==void 0&&(t=FV(t,1/i,n)),t}function For(t,e=0,r=1,n=.5,i,a=t,s=t){if(jg.test(e)&&(e=parseFloat(e),e=bs(s.min,s.max,e/100)-s.min),typeof e!="number")return;let o=bs(a.min,a.max,n);t===a&&(o-=e),t.min=BGe(t.min,e,r,o,i),t.max=BGe(t.max,e,r,o,i)}function $Ge(t,e,[r,n,i],a,s){For(t,e[r],e[n],e[i],e.scale,a,s)}const zor=["x","scaleX","originX"],Uor=["y","scaleY","originY"];function FGe(t,e,r,n){$Ge(t.x,e,zor,r?r.x:void 0,n?n.x:void 0),$Ge(t.y,e,Uor,r?r.y:void 0,n?n.y:void 0)}function zGe(t){return t.translate===0&&t.scale===1}function UGe(t){return zGe(t.x)&&zGe(t.y)}function VGe(t,e){return t.min===e.min&&t.max===e.max}function Vor(t,e){return VGe(t.x,e.x)&&VGe(t.y,e.y)}function QGe(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function GGe(t,e){return QGe(t.x,e.x)&&QGe(t.y,e.y)}function HGe(t){return yd(t.x)/yd(t.y)}function WGe(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Qor{constructor(){this.members=[]}add(e){_oe(this.members,e),e.scheduleRender()}remove(e){if(Roe(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(e){const r=this.members.findIndex(i=>e===i);if(r===0)return!1;let n;for(let i=r;i>=0;i--){const a=this.members[i];if(a.isPresent!==!1){n=a;break}}return n?(this.promote(n),!0):!1}promote(e,r){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,r&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:r,resumingFrom:n}=e;r.onExitComplete&&r.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Gor(t,e,r){let n="";const i=t.x.translate/e.x,a=t.y.translate/e.y,s=(r==null?void 0:r.z)||0;if((i||a||s)&&(n=`translate3d(${i}px, ${a}px, ${s}px) `),(e.x!==1||e.y!==1)&&(n+=`scale(${1/e.x}, ${1/e.y}) `),r){const{transformPerspective:u,rotate:h,rotateX:d,rotateY:f,skewX:p,skewY:g}=r;u&&(n=`perspective(${u}px) ${n}`),h&&(n+=`rotate(${h}deg) `),d&&(n+=`rotateX(${d}deg) `),f&&(n+=`rotateY(${f}deg) `),p&&(n+=`skewX(${p}deg) `),g&&(n+=`skewY(${g}deg) `)}const o=t.x.scale*e.x,l=t.y.scale*e.y;return(o!==1||l!==1)&&(n+=`scale(${o}, ${l})`),n||"none"}const Jw={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},p6=typeof window<"u"&&window.MotionDebug!==void 0,hle=["","X","Y","Z"],Hor={visibility:"hidden"},YGe=1e3;let Wor=0;function dle(t,e,r,n){const{latestValues:i}=e;i[t]&&(r[t]=i[t],e.setStaticValue(t,0),n&&(n[t]=0))}function qGe(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const r=aQe(e);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:i,layoutId:a}=t.options;window.MotionCancelOptimisedAnimation(r,"transform",Ya,!(i||a))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&qGe(n)}function jGe({attachResizeListener:t,defaultParent:e,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(s={},o=e==null?void 0:e()){this.id=Wor++,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,p6&&(Jw.totalNodes=Jw.resolvedTargetDeltas=Jw.recalculatedProjection=0),this.nodes.forEach(jor),this.nodes.forEach(elr),this.nodes.forEach(tlr),this.nodes.forEach(Xor),p6&&window.MotionDebug.record(Jw)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;t(s,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=Ior(f,250),UV.hasAnimatedSinceResize&&(UV.hasAnimatedSinceResize=!1,this.nodes.forEach(KGe))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&h&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:p,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||h.getDefaultTransition()||slr,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=h.getProps(),b=!this.targetLayout||!GGe(this.targetLayout,g)||p,x=!f&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||f&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,x);const w={...Eoe(m,"layout"),onPlay:v,onComplete:y};(h.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w)}else f||KGe(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Pb(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(rlr),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&qGe(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const A=w/1e3;ZGe(d.x,s.x,A),ZGe(d.y,s.y,A),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(d6(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),ilr(this.relativeTarget,this.relativeTargetOrigin,f,A),x&&Vor(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=Js()),Cf(x,this.relativeTarget)),m&&(this.animationValues=h,Nor(h,u,this.latestValues,A,b,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=A},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Pb(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ya.update(()=>{UV.hasAnimatedSinceResize=!0,this.currentAnimation=Ror(0,YGe,{...s,onUpdate:o=>{this.mixTargetDelta(o),s.onUpdate&&s.onUpdate(o)},onComplete:()=>{s.onComplete&&s.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 s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(YGe),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:o,target:l,layout:u,latestValues:h}=s;if(!(!o||!l||!u)){if(this!==s&&this.layout&&u&&nHe(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Js();const d=yd(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+d;const f=yd(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}Cf(o,l),aE(o,h),h6(this.projectionDeltaWithTransform,this.layoutCorrected,o,h)}}registerSharedNode(s,o){this.sharedNodes.has(s)||this.sharedNodes.set(s,new Qor),this.sharedNodes.get(s).add(o);const u=o.options.initialPromotionConfig;o.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(o):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var s;const{layoutId:o}=this.options;return o?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;const{layoutId:o}=this.options;return o?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:o,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let o=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(o=!0),!o)return;const u={};l.z&&dle("z",s,u,this.animationValues);for(let h=0;h{var o;return(o=s.currentAnimation)===null||o===void 0?void 0:o.stop()}),this.root.nodes.forEach(XGe),this.root.sharedNodes.clear()}}}function Yor(t){t.updateLayout()}function qor(t){var e;const r=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&r&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:a}=t.options,s=r.source!==t.layout.source;a==="size"?Sf(d=>{const f=s?r.measuredBox[d]:r.layoutBox[d],p=yd(f);f.min=n[d].min,f.max=f.min+p}):nHe(a,r.layoutBox,n)&&Sf(d=>{const f=s?r.measuredBox[d]:r.layoutBox[d],p=yd(n[d]);f.max=f.min+p,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[d].max=t.relativeTarget[d].min+p)});const o=nE();h6(o,n,r.layoutBox);const l=nE();s?h6(l,t.applyTransform(i,!0),r.measuredBox):h6(l,n,r.layoutBox);const u=!UGe(o);let h=!1;if(!t.resumeFrom){const d=t.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:p}=d;if(f&&p){const g=Js();d6(g,r.layoutBox,f.layoutBox);const m=Js();d6(m,n,p.layoutBox),GGe(g,m)||(h=!0),d.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=g,t.relativeParent=d)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:r,delta:l,layoutDelta:o,hasLayoutChanged:u,hasRelativeTargetChanged:h})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function jor(t){p6&&Jw.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Xor(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Kor(t){t.clearSnapshot()}function XGe(t){t.clearMeasurements()}function Zor(t){t.isLayoutDirty=!1}function Jor(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function KGe(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function elr(t){t.resolveTargetDelta()}function tlr(t){t.calcProjection()}function rlr(t){t.resetSkewAndRotation()}function nlr(t){t.removeLeadSnapshot()}function ZGe(t,e,r){t.translate=bs(e.translate,0,r),t.scale=bs(e.scale,1,r),t.origin=e.origin,t.originPoint=e.originPoint}function JGe(t,e,r,n){t.min=bs(e.min,r.min,n),t.max=bs(e.max,r.max,n)}function ilr(t,e,r,n){JGe(t.x,e.x,r.x,n),JGe(t.y,e.y,r.y,n)}function alr(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const slr={duration:.45,ease:[.4,0,.1,1]},eHe=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),tHe=eHe("applewebkit/")&&!eHe("chrome/")?Math.round:vd;function rHe(t){t.min=tHe(t.min),t.max=tHe(t.max)}function olr(t){rHe(t.x),rHe(t.y)}function nHe(t,e,r){return t==="position"||t==="preserve-aspect"&&!cor(HGe(e),HGe(r),.2)}function llr(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const clr=jGe({attachResizeListener:(t,e)=>l6(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),fle={current:void 0},iHe=jGe({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!fle.current){const t=new clr({});t.mount(window),t.setOptions({layoutScroll:!0}),fle.current=t}return fle.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),ulr={pan:{Feature:Oor},drag:{Feature:Cor,ProjectionNode:iHe,MeasureLayout:_Ge}};function hlr(t,e,r){var n;if(t instanceof Element)return[t];if(typeof t=="string"){let i=document;const a=(n=void 0)!==null&&n!==void 0?n:i.querySelectorAll(t);return a?Array.from(a):[]}return Array.from(t)}function aHe(t,e){const r=hlr(t),n=new AbortController,i={passive:!0,...e,signal:n.signal};return[r,i,()=>n.abort()]}function sHe(t){return e=>{e.pointerType==="touch"||tGe()||t(e)}}function dlr(t,e,r={}){const[n,i,a]=aHe(t,r),s=sHe(o=>{const{target:l}=o,u=e(o);if(typeof u!="function"||!l)return;const h=sHe(d=>{u(d),l.removeEventListener("pointerleave",h)});l.addEventListener("pointerleave",h,i)});return n.forEach(o=>{o.addEventListener("pointerenter",s,i)}),a}function oHe(t,e,r){const{props:n}=t;t.animationState&&n.whileHover&&t.animationState.setActive("whileHover",r==="Start");const i="onHover"+r,a=n[i];a&&Ya.postRender(()=>a(e,c6(e)))}class flr extends $b{mount(){const{current:e}=this.node;e&&(this.unmount=dlr(e,r=>(oHe(this.node,r,"Start"),n=>oHe(this.node,n,"End"))))}unmount(){}}class plr extends $b{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!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=o6(l6(this.node.current,"focus",()=>this.onFocus()),l6(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const lHe=(t,e)=>e?t===e?!0:lHe(t,e.parentElement):!1,glr=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function mlr(t){return glr.has(t.tagName)||t.tabIndex!==-1}const g6=new WeakSet;function cHe(t){return e=>{e.key==="Enter"&&t(e)}}function ple(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const vlr=(t,e)=>{const r=t.currentTarget;if(!r)return;const n=cHe(()=>{if(g6.has(r))return;ple(r,"down");const i=cHe(()=>{ple(r,"up")}),a=()=>ple(r,"cancel");r.addEventListener("keyup",i,e),r.addEventListener("blur",a,e)});r.addEventListener("keydown",n,e),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),e)};function uHe(t){return ile(t)&&!tGe()}function ylr(t,e,r={}){const[n,i,a]=aHe(t,r),s=o=>{const l=o.currentTarget;if(!uHe(o)||g6.has(l))return;g6.add(l);const u=e(o),h=(p,g)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),!(!uHe(p)||!g6.has(l))&&(g6.delete(l),typeof u=="function"&&u(p,{success:g}))},d=p=>{h(p,r.useGlobalTarget||lHe(l,p.target))},f=p=>{h(p,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",f,i)};return n.forEach(o=>{!mlr(o)&&o.getAttribute("tabindex")===null&&(o.tabIndex=0),(r.useGlobalTarget?window:o).addEventListener("pointerdown",s,i),o.addEventListener("focus",u=>vlr(u,i),i)}),a}function hHe(t,e,r){const{props:n}=t;t.animationState&&n.whileTap&&t.animationState.setActive("whileTap",r==="Start");const i="onTap"+(r==="End"?"":r),a=n[i];a&&Ya.postRender(()=>a(e,c6(e)))}class blr extends $b{mount(){const{current:e}=this.node;e&&(this.unmount=ylr(e,r=>(hHe(this.node,r,"Start"),(n,{success:i})=>hHe(this.node,n,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const gle=new WeakMap,mle=new WeakMap,xlr=t=>{const e=gle.get(t.target);e&&e(t)},wlr=t=>{t.forEach(xlr)};function Alr({root:t,...e}){const r=t||document;mle.has(r)||mle.set(r,{});const n=mle.get(r),i=JSON.stringify(e);return n[i]||(n[i]=new IntersectionObserver(wlr,{root:t,...e})),n[i]}function Tlr(t,e,r){const n=Alr(e);return gle.set(t,r),n.observe(t),()=>{gle.delete(t),n.unobserve(t)}}const Slr={some:0,all:1};class Clr extends $b{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:r,margin:n,amount:i="some",once:a}=e,s={root:r?r.current:void 0,rootMargin:n,threshold:typeof i=="number"?i:Slr[i]},o=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:h,onViewportLeave:d}=this.node.getProps(),f=u?h:d;f&&f(l)};return Tlr(this.node.current,s,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:r}=this.node;["amount","margin","root"].some(Olr(e,r))&&this.startObserver()}unmount(){}}function Olr({viewport:t={}},{viewport:e={}}={}){return r=>t[r]!==e[r]}const klr={inView:{Feature:Clr},tap:{Feature:blr},focus:{Feature:plr},hover:{Feature:flr}},Elr={layout:{ProjectionNode:iHe,MeasureLayout:_Ge}},vle={current:null},dHe={current:!1};function _lr(){if(dHe.current=!0,!!doe)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>vle.current=t.matches;t.addListener(e),e()}else vle.current=!1}const Rlr=[...IQe,Rc,Bb],Dlr=t=>Rlr.find(MQe(t)),fHe=new WeakMap;function Llr(t,e,r){for(const n in e){const i=e[n],a=r[n];if(_c(i))t.addValue(n,i);else if(_c(a))t.addValue(n,r6(i,{owner:t}));else if(a!==i)if(t.hasValue(n)){const s=t.getValue(n);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=t.getStaticValue(n);t.addValue(n,r6(s!==void 0?s:i,{owner:t}))}}for(const n in r)e[n]===void 0&&t.removeValue(n);return e}const pHe=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Mlr{scrapeMotionValuesFromProps(e,r,n){return{}}constructor({parent:e,props:r,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:a,visualState:s},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Yoe,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=Xg.now();this.renderScheduledAtthis.bindToMotionValue(n,r)),dHe.current||_lr(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:vle.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){fHe.delete(this.current),this.projection&&this.projection.unmount(),Pb(this.notifyUpdate),Pb(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const r=this.features[e];r&&(r.unmount(),r.isMounted=!1)}this.current=null}bindToMotionValue(e,r){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const n=qw.has(e),i=r.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&Ya.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),a=r.on("renderRequest",this.scheduleRender);let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,e,r)),this.valueSubscriptions.set(e,()=>{i(),a(),s&&s(),r.owner&&r.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Xk){const r=Xk[e];if(!r)continue;const{isEnabled:n,Feature:i}=r;if(!this.features[e]&&i&&n(this.props)&&(this.features[e]=new i(this)),this.features[e]){const a=this.features[e];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Js()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,r){this.latestValues[e]=r}update(e,r){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;nr.variantChildren.delete(e)}addValue(e,r){const n=this.values.get(e);r!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,r),this.values.set(e,r),this.latestValues[e]=r.get())}removeValue(e){this.values.delete(e);const r=this.valueSubscriptions.get(e);r&&(r(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,r){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&r!==void 0&&(n=r6(r===null?void 0:r,{owner:this}),this.addValue(e,n)),n}readValue(e,r){var n;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(n=this.getBaseTargetFromProps(this.props,e))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(DQe(i)||yQe(i))?i=parseFloat(i):!Dlr(i)&&Bb.test(r)&&(i=CQe(e,r)),this.setBaseTarget(e,_c(i)?i.get():i)),_c(i)?i.get():i}setBaseTarget(e,r){this.baseTarget[e]=r}getBaseTarget(e){var r;const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const s=boe(this.props,n,(r=this.presenceContext)===null||r===void 0?void 0:r.custom);s&&(i=s[e])}if(n&&i!==void 0)return i;const a=this.getBaseTargetFromProps(this.props,e);return a!==void 0&&!_c(a)?a:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,r){return this.events[e]||(this.events[e]=new Doe),this.events[e].add(r)}notify(e,...r){this.events[e]&&this.events[e].notify(...r)}}class gHe extends Mlr{constructor(){super(...arguments),this.KeyframeResolver=NQe}sortInstanceNodePosition(e,r){return e.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(e,r){return e.style?e.style[r]:void 0}removeValueFromRenderState(e,{vars:r,style:n}){delete r[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;_c(e)&&(this.childSubscription=e.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}function Ilr(t){return window.getComputedStyle(t)}class Plr extends gHe{constructor(){super(...arguments),this.type="html",this.renderInstance=qVe}readValueFromInstance(e,r){if(qw.has(r)){const n=Goe(r);return n&&n.default||0}else{const n=Ilr(e),i=(VVe(r)?n.getPropertyValue(r):n[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:r}){return CGe(e,r)}build(e,r,n){Toe(e,r,n.transformTemplate)}scrapeMotionValuesFromProps(e,r,n){return koe(e,r,n)}}class Nlr extends gHe{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Js}getBaseTargetFromProps(e,r){return e[r]}readValueFromInstance(e,r){if(qw.has(r)){const n=Goe(r);return n&&n.default||0}return r=jVe.has(r)?r:moe(r),e.getAttribute(r)}scrapeMotionValuesFromProps(e,r,n){return ZVe(e,r,n)}build(e,r,n){Soe(e,r,this.isSVGTag,n.transformTemplate)}renderInstance(e,r,n,i){XVe(e,r,n,i)}mount(e){this.isSVGTag=Ooe(e.tagName),super.mount(e)}}const Blr=(t,e)=>yoe(t)?new Nlr(e):new Plr(e,{allowProjection:t!==se.Fragment}),$lr=lar({...Jsr,...klr,...ulr,...Elr},Blr),eA=Sir($lr),Flr={formatDate(t){const e=t.value??t.date??t.timestamp;if(e==null)return"";const r=new Date(e);return isNaN(r.getTime())?String(e):r.toLocaleString()}};function zlr(t,e){if(!e||e==="/")return t;const r=e.replace(/^\//,"").split("/").map(i=>i.replace(/~1/g,"/").replace(/~0/g,"~"));let n=t;for(const i of r){if(n==null||typeof n!="object")return;n=n[i]}return n}function Ulr(t){return typeof t=="object"&&t!==null&&typeof t.path=="string"}function Vlr(t){return typeof t=="object"&&t!==null&&typeof t.call=="string"}function yle(t,e){if(Ulr(t))return zlr(e,t.path);if(Vlr(t)){const r=Flr[t.call],n={};for(const[i,a]of Object.entries(t.args??{}))n[i]=yle(a,e);return r?r(n):`[unknown fn: ${t.call}]`}return t}function Qlr(t,e){const r=yle(t,e);return r==null?"":typeof r=="string"?r:String(r)}const Glr=new Map;function Hlr(t){return Glr.get(t)}function Wlr(t,e,r){const n=e.replace(/^\//,"").split("/").map(a=>a.replace(/~1/g,"/").replace(/~0/g,"~"));let i=t;for(let a=0;ayle(n,t.dataModel),resolveString:n=>Qlr(n,t.dataModel),dispatchAction:e,render:n=>{if(!n)return null;const i=t.components[n];if(!i)return null;const a=Hlr(i.component)??qlr;return W.jsx(a,{node:i,ctx:r},n)}};return W.jsx("div",{className:"a2ui-surface","data-a2ui-surface":t.surfaceId,children:r.render(t.rootId)})}function Xlr(t){const e=se.useRef(null),r=se.useRef(!0),n=28,i=se.useCallback(()=>{const a=e.current;a&&(r.current=a.scrollHeight-a.scrollTop-a.clientHeight{const a=e.current;a&&r.current&&(a.scrollTop=a.scrollHeight)},[t]),{ref:e,onScroll:i}}function qri(){}function jri(){}function mHe(t){const e=[],r=String(t||"");let n=r.indexOf(","),i=0,a=!1;for(;!a;){n===-1&&(n=r.length,a=!0);const s=r.slice(i,n).trim();(s||!a)&&e.push(s),i=n+1,n=r.indexOf(",",i)}return e}function vHe(t,e){const r={};return(t[t.length-1]===""?[...t,""]:t).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const Klr=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Zlr=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Jlr={};function yHe(t,e){return(Jlr.jsx?Zlr:Klr).test(t)}const ecr=/[ \t\n\f\r]/g;function tcr(t){return typeof t=="object"?t.type==="text"?bHe(t.value):!1:bHe(t)}function bHe(t){return t.replace(ecr,"")===""}let m6=class{constructor(e,r,n){this.normal=r,this.property=e,n&&(this.space=n)}};m6.prototype.normal={},m6.prototype.property={},m6.prototype.space=void 0;function xHe(t,e){const r={},n={};for(const i of t)Object.assign(r,i.property),Object.assign(n,i.normal);return new m6(r,n,e)}function v6(t){return t.toLowerCase()}let xh=class{constructor(e,r){this.attribute=r,this.property=e}};xh.prototype.attribute="",xh.prototype.booleanish=!1,xh.prototype.boolean=!1,xh.prototype.commaOrSpaceSeparated=!1,xh.prototype.commaSeparated=!1,xh.prototype.defined=!1,xh.prototype.mustUseProperty=!1,xh.prototype.number=!1,xh.prototype.overloadedBoolean=!1,xh.prototype.property="",xh.prototype.spaceSeparated=!1,xh.prototype.space=void 0;let rcr=0;const Qn=tA(),xo=tA(),ble=tA(),rr=tA(),_a=tA(),sE=tA(),bd=tA();function tA(){return 2**++rcr}const xle=Object.freeze(Object.defineProperty({__proto__:null,boolean:Qn,booleanish:xo,commaOrSpaceSeparated:bd,commaSeparated:sE,number:rr,overloadedBoolean:ble,spaceSeparated:_a},Symbol.toStringTag,{value:"Module"})),wle=Object.keys(xle);class Ale extends xh{constructor(e,r,n,i){let a=-1;if(super(e,r),wHe(this,"space",i),typeof n=="number")for(;++a4&&r.slice(0,4)==="data"&&ocr.test(e)){if(e.charAt(4)==="-"){const a=e.slice(5).replace(EHe,ccr);n="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=e.slice(4);if(!EHe.test(a)){let s=a.replace(scr,lcr);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}i=Ale}return new i(n,e)}function lcr(t){return"-"+t.toLowerCase()}function ccr(t){return t.charAt(1).toUpperCase()}const y6=xHe([AHe,ncr,CHe,OHe,kHe],"html"),Fb=xHe([AHe,icr,CHe,OHe,kHe],"svg");function _He(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function RHe(t){return t.join(" ").trim()}var Tle={},DHe=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ucr=/\n/g,hcr=/^\s*/,dcr=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,fcr=/^:\s*/,pcr=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,gcr=/^[;\s]*/,mcr=/^\s+|\s+$/g,vcr=` -`,LHe="/",MHe="*",rA="",ycr="comment",bcr="declaration";function xcr(t,e){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var r=1,n=1;function i(g){var m=g.match(ucr);m&&(r+=m.length);var v=g.lastIndexOf(vcr);n=~v?g.length-v:n+g.length}function a(){var g={line:r,column:n};return function(m){return m.position=new s(g),u(),m}}function s(g){this.start=g,this.end={line:r,column:n},this.source=e.source}s.prototype.content=t;function o(g){var m=new Error(e.source+":"+r+":"+n+": "+g);if(m.reason=g,m.filename=e.source,m.line=r,m.column=n,m.source=t,!e.silent)throw m}function l(g){var m=g.exec(t);if(m){var v=m[0];return i(v),t=t.slice(v.length),m}}function u(){l(hcr)}function h(g){var m;for(g=g||[];m=d();)m!==!1&&g.push(m);return g}function d(){var g=a();if(!(LHe!=t.charAt(0)||MHe!=t.charAt(1))){for(var m=2;rA!=t.charAt(m)&&(MHe!=t.charAt(m)||LHe!=t.charAt(m+1));)++m;if(m+=2,rA===t.charAt(m-1))return o("End of comment missing");var v=t.slice(2,m-2);return n+=2,i(v),t=t.slice(m),n+=2,g({type:ycr,comment:v})}}function f(){var g=a(),m=l(dcr);if(m){if(d(),!l(fcr))return o("property missing ':'");var v=l(pcr),y=g({type:bcr,property:IHe(m[0].replace(DHe,rA)),value:v?IHe(v[0].replace(DHe,rA)):rA});return l(gcr),y}}function p(){var g=[];h(g);for(var m;m=f();)m!==!1&&(g.push(m),h(g));return g}return u(),p()}function IHe(t){return t?t.replace(mcr,rA):rA}var wcr=xcr,Acr=xi&&xi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Tle,"__esModule",{value:!0}),Tle.default=Scr;const Tcr=Acr(wcr);function Scr(t,e){let r=null;if(!t||typeof t!="string")return r;const n=(0,Tcr.default)(t),i=typeof e=="function";return n.forEach(a=>{if(a.type!=="declaration")return;const{property:s,value:o}=a;i?e(s,o,a):o&&(r=r||{},r[s]=o)}),r}var QV={};Object.defineProperty(QV,"__esModule",{value:!0}),QV.camelCase=void 0;var Ccr=/^--[a-zA-Z0-9_-]+$/,Ocr=/-([a-z])/g,kcr=/^[^-]+$/,Ecr=/^-(webkit|moz|ms|o|khtml)-/,_cr=/^-(ms)-/,Rcr=function(t){return!t||kcr.test(t)||Ccr.test(t)},Dcr=function(t,e){return e.toUpperCase()},PHe=function(t,e){return"".concat(e,"-")},Lcr=function(t,e){return e===void 0&&(e={}),Rcr(t)?t:(t=t.toLowerCase(),e.reactCompat?t=t.replace(_cr,PHe):t=t.replace(Ecr,PHe),t.replace(Ocr,Dcr))};QV.camelCase=Lcr;var Mcr=xi&&xi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Icr=Mcr(Tle),Pcr=QV;function Sle(t,e){var r={};return!t||typeof t!="string"||(0,Icr.default)(t,function(n,i){n&&i&&(r[(0,Pcr.camelCase)(n,e)]=i)}),r}Sle.default=Sle;var Ncr=Sle;const Bcr=uh(Ncr),GV=NHe("end"),Kg=NHe("start");function NHe(t){return e;function e(r){const n=r&&r.position&&r.position[t]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function $cr(t){const e=Kg(t),r=GV(t);if(e&&r)return{start:e,end:r}}function b6(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?BHe(t.position):"start"in t||"end"in t?BHe(t):"line"in t||"column"in t?Cle(t):""}function Cle(t){return $He(t&&t.line)+":"+$He(t&&t.column)}function BHe(t){return Cle(t&&t.start)+"-"+Cle(t&&t.end)}function $He(t){return t&&typeof t=="number"?t:1}class Dc extends Error{constructor(e,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let i="",a={},s=!1;if(r&&("line"in r&&"column"in r?a={place:r}:"start"in r&&"end"in r?a={place:r}:"type"in r?a={ancestors:[r],place:r.position}:a={...r}),typeof e=="string"?i=e:!a.cause&&e&&(s=!0,i=e.message,a.cause=e),!a.ruleId&&!a.source&&typeof n=="string"){const l=n.indexOf(":");l===-1?a.ruleId=n:(a.source=n.slice(0,l),a.ruleId=n.slice(l+1))}if(!a.place&&a.ancestors&&a.ancestors){const l=a.ancestors[a.ancestors.length-1];l&&(a.place=l.position)}const o=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=b6(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=s&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Dc.prototype.file="",Dc.prototype.name="",Dc.prototype.reason="",Dc.prototype.message="",Dc.prototype.stack="",Dc.prototype.column=void 0,Dc.prototype.line=void 0,Dc.prototype.ancestors=void 0,Dc.prototype.cause=void 0,Dc.prototype.fatal=void 0,Dc.prototype.place=void 0,Dc.prototype.ruleId=void 0,Dc.prototype.source=void 0;const Ole={}.hasOwnProperty,Fcr=new Map,zcr=/[A-Z]/g,Ucr=new Set(["table","tbody","thead","tfoot","tr"]),Vcr=new Set(["td","th"]),FHe="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Qcr(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=e.filePath||void 0;let n;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=Kcr(r,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=Xcr(r,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:n,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Fb:y6,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},a=zHe(i,t,void 0);return a&&typeof a!="string"?a:i.create(t,i.Fragment,{children:a||void 0},void 0)}function zHe(t,e,r){if(e.type==="element")return Gcr(t,e,r);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return Hcr(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Ycr(t,e,r);if(e.type==="mdxjsEsm")return Wcr(t,e);if(e.type==="root")return qcr(t,e,r);if(e.type==="text")return jcr(t,e)}function Gcr(t,e,r){const n=t.schema;let i=n;e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(i=Fb,t.schema=i),t.ancestors.push(e);const a=VHe(t,e.tagName,!1),s=Zcr(t,e);let o=Ele(t,e);return Ucr.has(e.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!tcr(l):!0})),UHe(t,s,a,e),kle(s,o),t.ancestors.pop(),t.schema=n,t.create(e,a,s,r)}function Hcr(t,e){if(e.data&&e.data.estree&&t.evaluater){const n=e.data.estree.body[0];return n.type,t.evaluater.evaluateExpression(n.expression)}x6(t,e.position)}function Wcr(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);x6(t,e.position)}function Ycr(t,e,r){const n=t.schema;let i=n;e.name==="svg"&&n.space==="html"&&(i=Fb,t.schema=i),t.ancestors.push(e);const a=e.name===null?t.Fragment:VHe(t,e.name,!0),s=Jcr(t,e),o=Ele(t,e);return UHe(t,s,a,e),kle(s,o),t.ancestors.pop(),t.schema=n,t.create(e,a,s,r)}function qcr(t,e,r){const n={};return kle(n,Ele(t,e)),t.create(e,t.Fragment,n,r)}function jcr(t,e){return e.value}function UHe(t,e,r,n){typeof r!="string"&&r!==t.Fragment&&t.passNode&&(e.node=n)}function kle(t,e){if(e.length>0){const r=e.length>1?e:e[0];r&&(t.children=r)}}function Xcr(t,e,r){return n;function n(i,a,s,o){const u=Array.isArray(s.children)?r:e;return o?u(a,s,o):u(a,s)}}function Kcr(t,e){return r;function r(n,i,a,s){const o=Array.isArray(a.children),l=Kg(n);return e(i,a,s,o,{columnNumber:l?l.column-1:void 0,fileName:t,lineNumber:l?l.line:void 0},void 0)}}function Zcr(t,e){const r={};let n,i;for(i in e.properties)if(i!=="children"&&Ole.call(e.properties,i)){const a=eur(t,i,e.properties[i]);if(a){const[s,o]=a;t.tableCellAlignToStyle&&s==="align"&&typeof o=="string"&&Vcr.has(e.tagName)?n=o:r[s]=o}}if(n){const a=r.style||(r.style={});a[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return r}function Jcr(t,e){const r={};for(const n of e.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&t.evaluater){const a=n.data.estree.body[0];a.type;const s=a.expression;s.type;const o=s.properties[0];o.type,Object.assign(r,t.evaluater.evaluateExpression(o.argument))}else x6(t,e.position);else{const i=n.name;let a;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&t.evaluater){const o=n.value.data.estree.body[0];o.type,a=t.evaluater.evaluateExpression(o.expression)}else x6(t,e.position);else a=n.value===null?!0:n.value;r[i]=a}return r}function Ele(t,e){const r=[];let n=-1;const i=t.passKeys?new Map:Fcr;for(;++ni?0:i+e:e=e>i?i:e,r=r>0?r:0,n.length<1e4)s=Array.from(n),s.unshift(e,r),t.splice(...s);else for(r&&t.splice(e,r);a0?(xd(t,t.length,0,e),t):e}const WHe={}.hasOwnProperty;function YHe(t){const e={};let r=-1;for(;++r13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function Ip(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const pu=zb(/[A-Za-z]/),Lc=zb(/[\dA-Za-z]/),cur=zb(/[#-'*+\--9=?A-Z^-~]/);function HV(t){return t!==null&&(t<32||t===127)}const Lle=zb(/\d/),uur=zb(/[\dA-Fa-f]/),hur=zb(/[!-/:-@[-`{-~]/);function Zr(t){return t!==null&&t<-2}function ba(t){return t!==null&&(t<0||t===32)}function di(t){return t===-2||t===-1||t===32}const WV=zb(new RegExp("\\p{P}|\\p{S}","u")),nA=zb(/\s/);function zb(t){return e;function e(r){return r!==null&&r>-1&&t.test(String.fromCharCode(r))}}function lE(t){const e=[];let r=-1,n=0,i=0;for(;++r55295&&a<57344){const o=t.charCodeAt(r+1);a<56320&&o>56319&&o<57344?(s=String.fromCharCode(a,o),i=1):s="�"}else s=String.fromCharCode(a);s&&(e.push(t.slice(n,r),encodeURIComponent(s)),n=r+i+1,s=""),i&&(r+=i,i=0)}return e.join("")+t.slice(n)}function ki(t,e,r,n){const i=n?n-1:Number.POSITIVE_INFINITY;let a=0;return s;function s(l){return di(l)?(t.enter(r),o(l)):e(l)}function o(l){return di(l)&&a++s))return;const S=e.events.length;let O=S,k,E;for(;O--;)if(e.events[O][0]==="exit"&&e.events[O][1].type==="chunkFlow"){if(k){E=e.events[O][1].end;break}k=!0}for(y(n),T=S;Tx;){const A=r[w];e.containerState=A[1],A[0].exit.call(e,t)}r.length=x}function b(){i.write([null]),a=void 0,i=void 0,e.containerState._closeFlow=void 0}}function mur(t,e,r){return ki(t,t.attempt(this.parser.constructs.document,e,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function cE(t){if(t===null||ba(t)||nA(t))return 1;if(WV(t))return 2}function YV(t,e,r){const n=[];let i=-1;for(;++i1&&t[r][1].end.offset-t[r][1].start.offset>1?2:1;const d={...t[n][1].end},f={...t[r][1].start};XHe(d,-l),XHe(f,l),s={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...t[n][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...t[r][1].start},end:f},a={type:l>1?"strongText":"emphasisText",start:{...t[n][1].end},end:{...t[r][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...o.end}},t[n][1].end={...s.start},t[r][1].start={...o.end},u=[],t[n][1].end.offset-t[n][1].start.offset&&(u=Of(u,[["enter",t[n][1],e],["exit",t[n][1],e]])),u=Of(u,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",a,e]]),u=Of(u,YV(e.parser.constructs.insideSpan.null,t.slice(n+1,r),e)),u=Of(u,[["exit",a,e],["enter",o,e],["exit",o,e],["exit",i,e]]),t[r][1].end.offset-t[r][1].start.offset?(h=2,u=Of(u,[["enter",t[r][1],e],["exit",t[r][1],e]])):h=0,xd(t,n-1,r-n+3,u),r=n+u.length-h-2;break}}for(r=-1;++r0&&di(T)?ki(t,b,"linePrefix",a+1)(T):b(T)}function b(T){return T===null||Zr(T)?t.check(eWe,m,w)(T):(t.enter("codeFlowValue"),x(T))}function x(T){return T===null||Zr(T)?(t.exit("codeFlowValue"),b(T)):(t.consume(T),x)}function w(T){return t.exit("codeFenced"),e(T)}function A(T,S,O){let k=0;return E;function E(D){return T.enter("lineEnding"),T.consume(D),T.exit("lineEnding"),_}function _(D){return T.enter("codeFencedFence"),di(D)?ki(T,I,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):I(D)}function I(D){return D===o?(T.enter("codeFencedFenceSequence"),L(D)):O(D)}function L(D){return D===o?(k++,T.consume(D),L):k>=s?(T.exit("codeFencedFenceSequence"),di(D)?ki(T,R,"whitespace")(D):R(D)):O(D)}function R(D){return D===null||Zr(D)?(T.exit("codeFencedFence"),S(D)):O(D)}}}function Eur(t,e,r){const n=this;return i;function i(s){return s===null?r(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),a)}function a(s){return n.parser.lazy[n.now().line]?r(s):e(s)}}const Ile={name:"codeIndented",tokenize:Rur},_ur={partial:!0,tokenize:Dur};function Rur(t,e,r){const n=this;return i;function i(u){return t.enter("codeIndented"),ki(t,a,"linePrefix",5)(u)}function a(u){const h=n.events[n.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?s(u):r(u)}function s(u){return u===null?l(u):Zr(u)?t.attempt(_ur,s,l)(u):(t.enter("codeFlowValue"),o(u))}function o(u){return u===null||Zr(u)?(t.exit("codeFlowValue"),s(u)):(t.consume(u),o)}function l(u){return t.exit("codeIndented"),e(u)}}function Dur(t,e,r){const n=this;return i;function i(s){return n.parser.lazy[n.now().line]?r(s):Zr(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i):ki(t,a,"linePrefix",5)(s)}function a(s){const o=n.events[n.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(s):Zr(s)?i(s):r(s)}}const Lur={name:"codeText",previous:Iur,resolve:Mur,tokenize:Pur};function Mur(t){let e=t.length-4,r=3,n,i;if((t[r][1].type==="lineEnding"||t[r][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(n=r;++n=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,r,n){const i=r||0;this.setCursor(Math.trunc(e));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return n&&A6(this.left,n),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),A6(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),A6(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e=4?e(s):t.interrupt(n.parser.constructs.flow,r,e)(s)}}function nWe(t,e,r,n,i,a,s,o,l){const u=l||Number.POSITIVE_INFINITY;let h=0;return d;function d(y){return y===60?(t.enter(n),t.enter(i),t.enter(a),t.consume(y),t.exit(a),f):y===null||y===32||y===41||HV(y)?r(y):(t.enter(n),t.enter(s),t.enter(o),t.enter("chunkString",{contentType:"string"}),m(y))}function f(y){return y===62?(t.enter(a),t.consume(y),t.exit(a),t.exit(i),t.exit(n),e):(t.enter(o),t.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(t.exit("chunkString"),t.exit(o),f(y)):y===null||y===60||Zr(y)?r(y):(t.consume(y),y===92?g:p)}function g(y){return y===60||y===62||y===92?(t.consume(y),p):p(y)}function m(y){return!h&&(y===null||y===41||ba(y))?(t.exit("chunkString"),t.exit(o),t.exit(s),t.exit(n),e(y)):h999||p===null||p===91||p===93&&!l||p===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?r(p):p===93?(t.exit(a),t.enter(i),t.consume(p),t.exit(i),t.exit(n),e):Zr(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),h):(t.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||Zr(p)||o++>999?(t.exit("chunkString"),h(p)):(t.consume(p),l||(l=!di(p)),p===92?f:d)}function f(p){return p===91||p===92||p===93?(t.consume(p),o++,d):d(p)}}function aWe(t,e,r,n,i,a){let s;return o;function o(f){return f===34||f===39||f===40?(t.enter(n),t.enter(i),t.consume(f),t.exit(i),s=f===40?41:f,l):r(f)}function l(f){return f===s?(t.enter(i),t.consume(f),t.exit(i),t.exit(n),e):(t.enter(a),u(f))}function u(f){return f===s?(t.exit(a),l(s)):f===null?r(f):Zr(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),ki(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===s||f===null||Zr(f)?(t.exit("chunkString"),u(f)):(t.consume(f),f===92?d:h)}function d(f){return f===s||f===92?(t.consume(f),h):h(f)}}function T6(t,e){let r;return n;function n(i){return Zr(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),r=!0,n):di(i)?ki(t,n,r?"linePrefix":"lineSuffix")(i):e(i)}}const Qur={name:"definition",tokenize:Hur},Gur={partial:!0,tokenize:Wur};function Hur(t,e,r){const n=this;let i;return a;function a(p){return t.enter("definition"),s(p)}function s(p){return iWe.call(n,t,o,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function o(p){return i=Ip(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),p===58?(t.enter("definitionMarker"),t.consume(p),t.exit("definitionMarker"),l):r(p)}function l(p){return ba(p)?T6(t,u)(p):u(p)}function u(p){return nWe(t,h,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function h(p){return t.attempt(Gur,d,d)(p)}function d(p){return di(p)?ki(t,f,"whitespace")(p):f(p)}function f(p){return p===null||Zr(p)?(t.exit("definition"),n.parser.defined.push(i),e(p)):r(p)}}function Wur(t,e,r){return n;function n(o){return ba(o)?T6(t,i)(o):r(o)}function i(o){return aWe(t,a,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function a(o){return di(o)?ki(t,s,"whitespace")(o):s(o)}function s(o){return o===null||Zr(o)?e(o):r(o)}}const Yur={name:"hardBreakEscape",tokenize:qur};function qur(t,e,r){return n;function n(a){return t.enter("hardBreakEscape"),t.consume(a),i}function i(a){return Zr(a)?(t.exit("hardBreakEscape"),e(a)):r(a)}}const jur={name:"headingAtx",resolve:Xur,tokenize:Kur};function Xur(t,e){let r=t.length-2,n=3,i,a;return t[n][1].type==="whitespace"&&(n+=2),r-2>n&&t[r][1].type==="whitespace"&&(r-=2),t[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&t[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(i={type:"atxHeadingText",start:t[n][1].start,end:t[r][1].end},a={type:"chunkText",start:t[n][1].start,end:t[r][1].end,contentType:"text"},xd(t,n,r-n+1,[["enter",i,e],["enter",a,e],["exit",a,e],["exit",i,e]])),t}function Kur(t,e,r){let n=0;return i;function i(h){return t.enter("atxHeading"),a(h)}function a(h){return t.enter("atxHeadingSequence"),s(h)}function s(h){return h===35&&n++<6?(t.consume(h),s):h===null||ba(h)?(t.exit("atxHeadingSequence"),o(h)):r(h)}function o(h){return h===35?(t.enter("atxHeadingSequence"),l(h)):h===null||Zr(h)?(t.exit("atxHeading"),e(h)):di(h)?ki(t,o,"whitespace")(h):(t.enter("atxHeadingText"),u(h))}function l(h){return h===35?(t.consume(h),l):(t.exit("atxHeadingSequence"),o(h))}function u(h){return h===null||h===35||ba(h)?(t.exit("atxHeadingText"),o(h)):(t.consume(h),u)}}const Zur=["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"],sWe=["pre","script","style","textarea"],Jur={concrete:!0,name:"htmlFlow",resolveTo:rhr,tokenize:nhr},ehr={partial:!0,tokenize:ahr},thr={partial:!0,tokenize:ihr};function rhr(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function nhr(t,e,r){const n=this;let i,a,s,o,l;return u;function u(U){return h(U)}function h(U){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(U),d}function d(U){return U===33?(t.consume(U),f):U===47?(t.consume(U),a=!0,m):U===63?(t.consume(U),i=3,n.interrupt?e:B):pu(U)?(t.consume(U),s=String.fromCharCode(U),v):r(U)}function f(U){return U===45?(t.consume(U),i=2,p):U===91?(t.consume(U),i=5,o=0,g):pu(U)?(t.consume(U),i=4,n.interrupt?e:B):r(U)}function p(U){return U===45?(t.consume(U),n.interrupt?e:B):r(U)}function g(U){const Q="CDATA[";return U===Q.charCodeAt(o++)?(t.consume(U),o===Q.length?n.interrupt?e:I:g):r(U)}function m(U){return pu(U)?(t.consume(U),s=String.fromCharCode(U),v):r(U)}function v(U){if(U===null||U===47||U===62||ba(U)){const Q=U===47,G=s.toLowerCase();return!Q&&!a&&sWe.includes(G)?(i=1,n.interrupt?e(U):I(U)):Zur.includes(s.toLowerCase())?(i=6,Q?(t.consume(U),y):n.interrupt?e(U):I(U)):(i=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(U):a?b(U):x(U))}return U===45||Lc(U)?(t.consume(U),s+=String.fromCharCode(U),v):r(U)}function y(U){return U===62?(t.consume(U),n.interrupt?e:I):r(U)}function b(U){return di(U)?(t.consume(U),b):E(U)}function x(U){return U===47?(t.consume(U),E):U===58||U===95||pu(U)?(t.consume(U),w):di(U)?(t.consume(U),x):E(U)}function w(U){return U===45||U===46||U===58||U===95||Lc(U)?(t.consume(U),w):A(U)}function A(U){return U===61?(t.consume(U),T):di(U)?(t.consume(U),A):x(U)}function T(U){return U===null||U===60||U===61||U===62||U===96?r(U):U===34||U===39?(t.consume(U),l=U,S):di(U)?(t.consume(U),T):O(U)}function S(U){return U===l?(t.consume(U),l=null,k):U===null||Zr(U)?r(U):(t.consume(U),S)}function O(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||ba(U)?A(U):(t.consume(U),O)}function k(U){return U===47||U===62||di(U)?x(U):r(U)}function E(U){return U===62?(t.consume(U),_):r(U)}function _(U){return U===null||Zr(U)?I(U):di(U)?(t.consume(U),_):r(U)}function I(U){return U===45&&i===2?(t.consume(U),M):U===60&&i===1?(t.consume(U),P):U===62&&i===4?(t.consume(U),V):U===63&&i===3?(t.consume(U),B):U===93&&i===5?(t.consume(U),F):Zr(U)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(ehr,z,L)(U)):U===null||Zr(U)?(t.exit("htmlFlowData"),L(U)):(t.consume(U),I)}function L(U){return t.check(thr,R,z)(U)}function R(U){return t.enter("lineEnding"),t.consume(U),t.exit("lineEnding"),D}function D(U){return U===null||Zr(U)?L(U):(t.enter("htmlFlowData"),I(U))}function M(U){return U===45?(t.consume(U),B):I(U)}function P(U){return U===47?(t.consume(U),s="",N):I(U)}function N(U){if(U===62){const Q=s.toLowerCase();return sWe.includes(Q)?(t.consume(U),V):I(U)}return pu(U)&&s.length<8?(t.consume(U),s+=String.fromCharCode(U),N):I(U)}function F(U){return U===93?(t.consume(U),B):I(U)}function B(U){return U===62?(t.consume(U),V):U===45&&i===2?(t.consume(U),B):I(U)}function V(U){return U===null||Zr(U)?(t.exit("htmlFlowData"),z(U)):(t.consume(U),V)}function z(U){return t.exit("htmlFlow"),e(U)}}function ihr(t,e,r){const n=this;return i;function i(s){return Zr(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),a):r(s)}function a(s){return n.parser.lazy[n.now().line]?r(s):e(s)}}function ahr(t,e,r){return n;function n(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(w6,e,r)}}const shr={name:"htmlText",tokenize:ohr};function ohr(t,e,r){const n=this;let i,a,s;return o;function o(B){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(B),l}function l(B){return B===33?(t.consume(B),u):B===47?(t.consume(B),A):B===63?(t.consume(B),x):pu(B)?(t.consume(B),O):r(B)}function u(B){return B===45?(t.consume(B),h):B===91?(t.consume(B),a=0,g):pu(B)?(t.consume(B),b):r(B)}function h(B){return B===45?(t.consume(B),p):r(B)}function d(B){return B===null?r(B):B===45?(t.consume(B),f):Zr(B)?(s=d,P(B)):(t.consume(B),d)}function f(B){return B===45?(t.consume(B),p):d(B)}function p(B){return B===62?M(B):B===45?f(B):d(B)}function g(B){const V="CDATA[";return B===V.charCodeAt(a++)?(t.consume(B),a===V.length?m:g):r(B)}function m(B){return B===null?r(B):B===93?(t.consume(B),v):Zr(B)?(s=m,P(B)):(t.consume(B),m)}function v(B){return B===93?(t.consume(B),y):m(B)}function y(B){return B===62?M(B):B===93?(t.consume(B),y):m(B)}function b(B){return B===null||B===62?M(B):Zr(B)?(s=b,P(B)):(t.consume(B),b)}function x(B){return B===null?r(B):B===63?(t.consume(B),w):Zr(B)?(s=x,P(B)):(t.consume(B),x)}function w(B){return B===62?M(B):x(B)}function A(B){return pu(B)?(t.consume(B),T):r(B)}function T(B){return B===45||Lc(B)?(t.consume(B),T):S(B)}function S(B){return Zr(B)?(s=S,P(B)):di(B)?(t.consume(B),S):M(B)}function O(B){return B===45||Lc(B)?(t.consume(B),O):B===47||B===62||ba(B)?k(B):r(B)}function k(B){return B===47?(t.consume(B),M):B===58||B===95||pu(B)?(t.consume(B),E):Zr(B)?(s=k,P(B)):di(B)?(t.consume(B),k):M(B)}function E(B){return B===45||B===46||B===58||B===95||Lc(B)?(t.consume(B),E):_(B)}function _(B){return B===61?(t.consume(B),I):Zr(B)?(s=_,P(B)):di(B)?(t.consume(B),_):k(B)}function I(B){return B===null||B===60||B===61||B===62||B===96?r(B):B===34||B===39?(t.consume(B),i=B,L):Zr(B)?(s=I,P(B)):di(B)?(t.consume(B),I):(t.consume(B),R)}function L(B){return B===i?(t.consume(B),i=void 0,D):B===null?r(B):Zr(B)?(s=L,P(B)):(t.consume(B),L)}function R(B){return B===null||B===34||B===39||B===60||B===61||B===96?r(B):B===47||B===62||ba(B)?k(B):(t.consume(B),R)}function D(B){return B===47||B===62||ba(B)?k(B):r(B)}function M(B){return B===62?(t.consume(B),t.exit("htmlTextData"),t.exit("htmlText"),e):r(B)}function P(B){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(B),t.exit("lineEnding"),N}function N(B){return di(B)?ki(t,F,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):F(B)}function F(B){return t.enter("htmlTextData"),s(B)}}const Ple={name:"labelEnd",resolveAll:hhr,resolveTo:dhr,tokenize:fhr},lhr={tokenize:phr},chr={tokenize:ghr},uhr={tokenize:mhr};function hhr(t){let e=-1;const r=[];for(;++e=3&&(u===null||Zr(u))?(t.exit("thematicBreak"),e(u)):r(u)}function l(u){return u===i?(t.consume(u),n++,l):(t.exit("thematicBreakSequence"),di(u)?ki(t,o,"whitespace")(u):o(u))}}const wh={continuation:{tokenize:Ohr},exit:Ehr,name:"list",tokenize:Chr},Thr={partial:!0,tokenize:_hr},Shr={partial:!0,tokenize:khr};function Chr(t,e,r){const n=this,i=n.events[n.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return o;function o(p){const g=n.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!n.containerState.marker||p===n.containerState.marker:Lle(p)){if(n.containerState.type||(n.containerState.type=g,t.enter(g,{_container:!0})),g==="listUnordered")return t.enter("listItemPrefix"),p===42||p===45?t.check(qV,r,u)(p):u(p);if(!n.interrupt||p===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(p)}return r(p)}function l(p){return Lle(p)&&++s<10?(t.consume(p),l):(!n.interrupt||s<2)&&(n.containerState.marker?p===n.containerState.marker:p===41||p===46)?(t.exit("listItemValue"),u(p)):r(p)}function u(p){return t.enter("listItemMarker"),t.consume(p),t.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||p,t.check(w6,n.interrupt?r:h,t.attempt(Thr,f,d))}function h(p){return n.containerState.initialBlankLine=!0,a++,f(p)}function d(p){return di(p)?(t.enter("listItemPrefixWhitespace"),t.consume(p),t.exit("listItemPrefixWhitespace"),f):r(p)}function f(p){return n.containerState.size=a+n.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(p)}}function Ohr(t,e,r){const n=this;return n.containerState._closeFlow=void 0,t.check(w6,i,a);function i(o){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,ki(t,e,"listItemIndent",n.containerState.size+1)(o)}function a(o){return n.containerState.furtherBlankLines||!di(o)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,s(o)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,t.attempt(Shr,e,s)(o))}function s(o){return n.containerState._closeFlow=!0,n.interrupt=void 0,ki(t,t.attempt(wh,e,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function khr(t,e,r){const n=this;return ki(t,i,"listItemIndent",n.containerState.size+1);function i(a){const s=n.events[n.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===n.containerState.size?e(a):r(a)}}function Ehr(t){t.exit(this.containerState.type)}function _hr(t,e,r){const n=this;return ki(t,i,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const s=n.events[n.events.length-1];return!di(a)&&s&&s[1].type==="listItemPrefixWhitespace"?e(a):r(a)}}const oWe={name:"setextUnderline",resolveTo:Rhr,tokenize:Dhr};function Rhr(t,e){let r=t.length,n,i,a;for(;r--;)if(t[r][0]==="enter"){if(t[r][1].type==="content"){n=r;break}t[r][1].type==="paragraph"&&(i=r)}else t[r][1].type==="content"&&t.splice(r,1),!a&&t[r][1].type==="definition"&&(a=r);const s={type:"setextHeading",start:{...t[n][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",a?(t.splice(i,0,["enter",s,e]),t.splice(a+1,0,["exit",t[n][1],e]),t[n][1].end={...t[a][1].end}):t[n][1]=s,t.push(["exit",s,e]),t}function Dhr(t,e,r){const n=this;let i;return a;function a(u){let h=n.events.length,d;for(;h--;)if(n.events[h][1].type!=="lineEnding"&&n.events[h][1].type!=="linePrefix"&&n.events[h][1].type!=="content"){d=n.events[h][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||d)?(t.enter("setextHeadingLine"),i=u,s(u)):r(u)}function s(u){return t.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===i?(t.consume(u),o):(t.exit("setextHeadingLineSequence"),di(u)?ki(t,l,"lineSuffix")(u):l(u))}function l(u){return u===null||Zr(u)?(t.exit("setextHeadingLine"),e(u)):r(u)}}const Lhr={tokenize:Mhr};function Mhr(t){const e=this,r=t.attempt(w6,n,t.attempt(this.parser.constructs.flowInitial,i,ki(t,t.attempt(this.parser.constructs.flow,i,t.attempt($ur,i)),"linePrefix")));return r;function n(a){if(a===null){t.consume(a);return}return t.enter("lineEndingBlank"),t.consume(a),t.exit("lineEndingBlank"),e.currentConstruct=void 0,r}function i(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),e.currentConstruct=void 0,r}}const Ihr={resolveAll:cWe()},Phr=lWe("string"),Nhr=lWe("text");function lWe(t){return{resolveAll:cWe(t==="text"?Bhr:void 0),tokenize:e};function e(r){const n=this,i=this.parser.constructs[t],a=r.attempt(i,s,o);return s;function s(h){return u(h)?a(h):o(h)}function o(h){if(h===null){r.consume(h);return}return r.enter("data"),r.consume(h),l}function l(h){return u(h)?(r.exit("data"),a(h)):(r.consume(h),l)}function u(h){if(h===null)return!0;const d=i[h];let f=-1;if(d)for(;++f-1){const o=s[0];typeof o=="string"?s[0]=o.slice(n):s.shift()}a>0&&s.push(t[i].slice(0,a))}return s}function Uhr(t,e){let r=-1;const n=[];let i;for(;++r{document.head.removeChild(h)}},[e]),W.jsx(dir,{isPresent:e,childRef:n,sizeRef:i,children:se.cloneElement(t,{ref:n})})}const pir=({children:t,initial:e,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:a,mode:s})=>{const o=uoe(gir),l=se.useId(),u=se.useCallback(d=>{o.set(d,!0);for(const f of o.values())if(!f)return;n&&n()},[o,n]),h=se.useMemo(()=>({id:l,initial:e,isPresent:r,custom:i,onExitComplete:u,register:d=>(o.set(d,!1),()=>o.delete(d))}),a?[Math.random(),u]:[r,u]);return se.useMemo(()=>{o.forEach((d,f)=>o.set(f,!1))},[r]),se.useEffect(()=>{!r&&!o.size&&n&&n()},[r]),s==="popLayout"&&(t=W.jsx(fir,{isPresent:r,children:t})),W.jsx(AV.Provider,{value:h,children:t})};function gir(){return new Map}function OVe(t=!0){const e=se.useContext(AV);if(e===null)return[!0,null];const{isPresent:r,onExitComplete:n,register:i}=e,a=se.useId();se.useEffect(()=>{t&&i(a)},[t]);const s=se.useCallback(()=>t&&n&&n(a),[a,n,t]);return!r&&n?[!1,s]:[!0]}const SV=t=>t.key||"";function kVe(t){const e=[];return se.Children.forEach(t,r=>{se.isValidElement(r)&&e.push(r)}),e}const doe=typeof window<"u",EVe=doe?se.useLayoutEffect:se.useEffect,mir=({children:t,custom:e,initial:r=!0,onExitComplete:n,presenceAffectsLayout:i=!0,mode:a="sync",propagate:s=!1})=>{const[o,l]=OVe(s),u=se.useMemo(()=>kVe(t),[t]),h=s&&!o?[]:u.map(SV),d=se.useRef(!0),f=se.useRef(u),p=uoe(()=>new Map),[g,m]=se.useState(u),[v,y]=se.useState(u);EVe(()=>{d.current=!1,f.current=u;for(let w=0;w{const A=SV(w),S=s&&!o?!1:u===v||h.includes(A),T=()=>{if(p.has(A))p.set(A,!0);else return;let O=!0;p.forEach(k=>{k||(O=!1)}),O&&(x==null||x(),y(f.current),s&&(l==null||l()),n&&n())};return W.jsx(pir,{isPresent:S,initial:!d.current||r?void 0:!1,custom:S?void 0:e,presenceAffectsLayout:i,mode:a,onExitComplete:S?void 0:T,children:w},A)})})},vd=t=>t;let _Ve=vd;const vir={useManualTiming:!1};function yir(t){let e=new Set,r=new Set,n=!1,i=!1;const a=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function o(u){a.has(u)&&(l.schedule(u),t()),u(s)}const l={schedule:(u,h=!1,d=!1)=>{const p=d&&n?e:r;return h&&a.add(u),p.has(u)||p.add(u),u},cancel:u=>{r.delete(u),a.delete(u)},process:u=>{if(s=u,n){i=!0;return}n=!0,[e,r]=[r,e],e.forEach(o),e.clear(),n=!1,i&&(i=!1,l.process(u))}};return l}const TV=["read","resolveKeyframes","update","preRender","render","postRender"],bir=40;function RVe(t,e){let r=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>r=!0,s=TV.reduce((y,b)=>(y[b]=yir(a),y),{}),{read:o,resolveKeyframes:l,update:u,preRender:h,render:d,postRender:f}=s,p=()=>{const y=performance.now();r=!1,i.delta=n?1e3/60:Math.max(Math.min(y-i.timestamp,bir),1),i.timestamp=y,i.isProcessing=!0,o.process(i),l.process(i),u.process(i),h.process(i),d.process(i),f.process(i),i.isProcessing=!1,r&&e&&(n=!1,t(p))},g=()=>{r=!0,n=!0,i.isProcessing||t(p)};return{schedule:TV.reduce((y,b)=>{const x=s[b];return y[b]=(w,A=!1,S=!1)=>(r||g(),x.schedule(w,A,S)),y},{}),cancel:y=>{for(let b=0;bLVe[t].some(r=>!!e[r])};function xir(t){for(const e in t)Xk[e]={...Xk[e],...t[e]}}const wir=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 CV(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||wir.has(t)}let MVe=t=>!CV(t);function Air(t){t&&(MVe=e=>e.startsWith("on")?!CV(e):t(e))}try{Air(require("@emotion/is-prop-valid").default)}catch{}function Sir(t,e,r){const n={};for(const i in t)i==="values"&&typeof t.values=="object"||(MVe(i)||r===!0&&CV(i)||!e&&!CV(i)||t.draggable&&i.startsWith("onDrag"))&&(n[i]=t[i]);return n}function Tir(t){if(typeof Proxy>"u")return t;const e=new Map,r=(...n)=>t(...n);return new Proxy(r,{get:(n,i)=>i==="create"?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}const OV=se.createContext({});function JP(t){return typeof t=="string"||Array.isArray(t)}function kV(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const poe=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],goe=["initial",...poe];function EV(t){return kV(t.animate)||goe.some(e=>JP(t[e]))}function IVe(t){return!!(EV(t)||t.variants)}function Cir(t,e){if(EV(t)){const{initial:r,animate:n}=t;return{initial:r===!1||JP(r)?r:void 0,animate:JP(n)?n:void 0}}return t.inherit!==!1?e:{}}function Oir(t){const{initial:e,animate:r}=Cir(t,se.useContext(OV));return se.useMemo(()=>({initial:e,animate:r}),[PVe(e),PVe(r)])}function PVe(t){return Array.isArray(t)?t.join(" "):t}const kir=Symbol.for("motionComponentSymbol");function Kk(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Eir(t,e,r){return se.useCallback(n=>{n&&t.onMount&&t.onMount(n),e&&(n?e.mount(n):e.unmount()),r&&(typeof r=="function"?r(n):Kk(r)&&(r.current=n))},[e])}const moe=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),NVe="data-"+moe("framerAppearId"),{schedule:voe}=RVe(queueMicrotask,!1),BVe=se.createContext({});function _ir(t,e,r,n,i){var a,s;const{visualElement:o}=se.useContext(OV),l=se.useContext(DVe),u=se.useContext(AV),h=se.useContext(hoe).reducedMotion,d=se.useRef(null);n=n||l.renderer,!d.current&&n&&(d.current=n(t,{visualState:e,parent:o,props:r,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:h}));const f=d.current,p=se.useContext(BVe);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&Rir(d.current,r,i,p);const g=se.useRef(!1);se.useInsertionEffect(()=>{f&&g.current&&f.update(r,u)});const m=r[NVe],v=se.useRef(!!m&&!(!((a=window.MotionHandoffIsComplete)===null||a===void 0)&&a.call(window,m))&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,m)));return EVe(()=>{f&&(g.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),voe.render(f.render),v.current&&f.animationState&&f.animationState.animateChanges())}),se.useEffect(()=>{f&&(!v.current&&f.animationState&&f.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,m)}),v.current=!1))}),f}function Rir(t,e,r,n){const{layoutId:i,layout:a,drag:s,dragConstraints:o,layoutScroll:l,layoutRoot:u}=e;t.projection=new r(t.latestValues,e["data-framer-portal-id"]?void 0:$Ve(t.parent)),t.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!s||o&&Kk(o),visualElement:t,animationType:typeof a=="string"?a:"both",initialPromotionConfig:n,layoutScroll:l,layoutRoot:u})}function $Ve(t){if(t)return t.options.allowProjection!==!1?t.projection:$Ve(t.parent)}function Dir({preloadedFeatures:t,createVisualElement:e,useRender:r,useVisualState:n,Component:i}){var a,s;t&&xir(t);function o(u,h){let d;const f={...se.useContext(hoe),...u,layoutId:Lir(u)},{isStatic:p}=f,g=Oir(u),m=n(u,p);if(!p&&doe){Mir();const v=Iir(f);d=v.MeasureLayout,g.visualElement=_ir(i,m,f,e,v.ProjectionNode)}return W.jsxs(OV.Provider,{value:g,children:[d&&g.visualElement?W.jsx(d,{visualElement:g.visualElement,...f}):null,r(i,u,Eir(m,g.visualElement,h),m,p,g.visualElement)]})}o.displayName=`motion.${typeof i=="string"?i:`create(${(s=(a=i.displayName)!==null&&a!==void 0?a:i.name)!==null&&s!==void 0?s:""})`}`;const l=se.forwardRef(o);return l[kir]=i,l}function Lir({layoutId:t}){const e=se.useContext(coe).id;return e&&t!==void 0?e+"-"+t:t}function Mir(t,e){se.useContext(DVe).strict}function Iir(t){const{drag:e,layout:r}=Xk;if(!e&&!r)return{};const n={...e,...r};return{MeasureLayout:e!=null&&e.isEnabled(t)||r!=null&&r.isEnabled(t)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}const Pir=["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 yoe(t){return typeof t!="string"||t.includes("-")?!1:!!(Pir.indexOf(t)>-1||/[A-Z]/u.test(t))}function FVe(t){const e=[{},{}];return t==null||t.values.forEach((r,n)=>{e[0][n]=r.get(),e[1][n]=r.getVelocity()}),e}function boe(t,e,r,n){if(typeof e=="function"){const[i,a]=FVe(n);e=e(r!==void 0?r:t.custom,i,a)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,a]=FVe(n);e=e(r!==void 0?r:t.custom,i,a)}return e}const xoe=t=>Array.isArray(t),Nir=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),Bir=t=>xoe(t)?t[t.length-1]||0:t,_c=t=>!!(t&&t.getVelocity);function _V(t){const e=_c(t)?t.get():t;return Nir(e)?e.toValue():e}function $ir({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:r},n,i,a){const s={latestValues:Fir(n,i,a,t),renderState:e()};return r&&(s.onMount=o=>r({props:n,current:o,...s}),s.onUpdate=o=>r(o)),s}const zVe=t=>(e,r)=>{const n=se.useContext(OV),i=se.useContext(AV),a=()=>$ir(t,e,n,i);return r?a():uoe(a)};function Fir(t,e,r,n){const i={},a=n(t,{});for(const f in a)i[f]=_V(a[f]);let{initial:s,animate:o}=t;const l=EV(t),u=IVe(t);e&&u&&!l&&t.inherit!==!1&&(s===void 0&&(s=e.initial),o===void 0&&(o=e.animate));let h=r?r.initial===!1:!1;h=h||s===!1;const d=h?o:s;if(d&&typeof d!="boolean"&&!kV(d)){const f=Array.isArray(d)?d:[d];for(let p=0;pe=>typeof e=="string"&&e.startsWith(t),VVe=UVe("--"),zir=UVe("var(--"),woe=t=>zir(t)?Uir.test(t.split("/*")[0].trim()):!1,Uir=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,QVe=(t,e)=>e&&typeof t=="number"?e.transform(t):t,Dv=(t,e,r)=>r>e?e:rtypeof t=="number",parse:parseFloat,transform:t=>t},e6={...Jk,transform:t=>Dv(0,1,t)},RV={...Jk,default:1},t6=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Nb=t6("deg"),jg=t6("%"),dn=t6("px"),Vir=t6("vh"),Qir=t6("vw"),GVe={...jg,parse:t=>jg.parse(t)/100,transform:t=>jg.transform(t*100)},Gir={borderWidth:dn,borderTopWidth:dn,borderRightWidth:dn,borderBottomWidth:dn,borderLeftWidth:dn,borderRadius:dn,radius:dn,borderTopLeftRadius:dn,borderTopRightRadius:dn,borderBottomRightRadius:dn,borderBottomLeftRadius:dn,width:dn,maxWidth:dn,height:dn,maxHeight:dn,top:dn,right:dn,bottom:dn,left:dn,padding:dn,paddingTop:dn,paddingRight:dn,paddingBottom:dn,paddingLeft:dn,margin:dn,marginTop:dn,marginRight:dn,marginBottom:dn,marginLeft:dn,backgroundPositionX:dn,backgroundPositionY:dn},Hir={rotate:Nb,rotateX:Nb,rotateY:Nb,rotateZ:Nb,scale:RV,scaleX:RV,scaleY:RV,scaleZ:RV,skew:Nb,skewX:Nb,skewY:Nb,distance:dn,translateX:dn,translateY:dn,translateZ:dn,x:dn,y:dn,z:dn,perspective:dn,transformPerspective:dn,opacity:e6,originX:GVe,originY:GVe,originZ:dn},HVe={...Jk,transform:Math.round},Aoe={...Gir,...Hir,zIndex:HVe,size:dn,fillOpacity:e6,strokeOpacity:e6,numOctaves:HVe},Wir={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Yir=Zk.length;function qir(t,e,r){let n="",i=!0;for(let a=0;a({style:{},transform:{},transformOrigin:{},vars:{}}),YVe=()=>({...Coe(),attrs:{}}),Ooe=t=>typeof t=="string"&&t.toLowerCase()==="svg";function qVe(t,{style:e,vars:r},n,i){Object.assign(t.style,e,i&&i.getProjectionStyles(n));for(const a in r)t.style.setProperty(a,r[a])}const jVe=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 XVe(t,e,r,n){qVe(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(jVe.has(i)?i:moe(i),e.attrs[i])}const DV={};function Jir(t){Object.assign(DV,t)}function KVe(t,{layout:e,layoutId:r}){return qw.has(t)||t.startsWith("origin")||(e||r!==void 0)&&(!!DV[t]||t==="opacity")}function koe(t,e,r){var n;const{style:i}=t,a={};for(const s in i)(_c(i[s])||e.style&&_c(e.style[s])||KVe(s,t)||((n=r==null?void 0:r.getValue(s))===null||n===void 0?void 0:n.liveStyle)!==void 0)&&(a[s]=i[s]);return a}function ZVe(t,e,r){const n=koe(t,e,r);for(const i in t)if(_c(t[i])||_c(e[i])){const a=Zk.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[a]=t[i]}return n}function ear(t,e){try{e.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{e.dimensions={x:0,y:0,width:0,height:0}}}const JVe=["x","y","width","height","cx","cy","r"],tar={useVisualState:zVe({scrapeMotionValuesFromProps:ZVe,createRenderState:YVe,onUpdate:({props:t,prevProps:e,current:r,renderState:n,latestValues:i})=>{if(!r)return;let a=!!t.drag;if(!a){for(const o in i)if(qw.has(o)){a=!0;break}}if(!a)return;let s=!e;if(e)for(let o=0;o{ear(r,n),Ya.render(()=>{Toe(n,i,Ooe(r.tagName),t.transformTemplate),XVe(r,n)})})}})},rar={useVisualState:zVe({scrapeMotionValuesFromProps:koe,createRenderState:Coe})};function eQe(t,e,r){for(const n in e)!_c(e[n])&&!KVe(n,r)&&(t[n]=e[n])}function nar({transformTemplate:t},e){return se.useMemo(()=>{const r=Coe();return Soe(r,e,t),Object.assign({},r.vars,r.style)},[e])}function iar(t,e){const r=t.style||{},n={};return eQe(n,r,t),Object.assign(n,nar(t,e)),n}function aar(t,e){const r={},n=iar(t,e);return t.drag&&t.dragListener!==!1&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=n,r}function sar(t,e,r,n){const i=se.useMemo(()=>{const a=YVe();return Toe(a,e,Ooe(n),t.transformTemplate),{...a.attrs,style:{...a.style}}},[e]);if(t.style){const a={};eQe(a,t.style,t),i.style={...a,...i.style}}return i}function oar(t=!1){return(r,n,i,{latestValues:a},s)=>{const l=(yoe(r)?sar:aar)(n,a,s,r),u=Sir(n,typeof r=="string",t),h=r!==se.Fragment?{...u,...l,ref:i}:{},{children:d}=n,f=se.useMemo(()=>_c(d)?d.get():d,[d]);return se.createElement(r,{...h,children:f})}}function lar(t,e){return function(n,{forwardMotionProps:i}={forwardMotionProps:!1}){const s={...yoe(n)?tar:rar,preloadedFeatures:t,useRender:oar(i),createVisualElement:e,Component:n};return Dir(s)}}function tQe(t,e){if(!Array.isArray(e))return!1;const r=e.length;if(r!==t.length)return!1;for(let n=0;n(MV===void 0&&Xg.set(Xl.isProcessing||vir.useManualTiming?Xl.timestamp:performance.now()),MV),set:t=>{MV=t,queueMicrotask(car)}};function _oe(t,e){t.indexOf(e)===-1&&t.push(e)}function Roe(t,e){const r=t.indexOf(e);r>-1&&t.splice(r,1)}class Doe{constructor(){this.subscriptions=[]}add(e){return _oe(this.subscriptions,e),()=>Roe(this.subscriptions,e)}notify(e,r,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,r,n);else for(let a=0;a!isNaN(parseFloat(t));class har{constructor(e,r={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(n,i=!0)=>{const a=Xg.now();this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=r.owner}setCurrent(e){this.current=e,this.updatedAt=Xg.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=uar(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,r){this.events[e]||(this.events[e]=new Doe);const n=this.events[e].add(r);return e==="change"?()=>{n(),Ya.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,r){this.passiveEffect=e,this.stopPassiveEffect=r}set(e,r=!0){!r||!this.passiveEffect?this.updateAndNotify(e,r):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,r=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Xg.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>iQe)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,iQe);return nQe(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(e){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=e(r),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 r6(t,e){return new har(t,e)}function dar(t,e,r){t.hasValue(e)?t.getValue(e).set(r):t.addValue(e,r6(r))}function far(t,e){const r=LV(t,e);let{transitionEnd:n={},transition:i={},...a}=r||{};a={...a,...n};for(const s in a){const o=Bir(a[s]);dar(t,s,o)}}function par(t){return!!(_c(t)&&t.add)}function Loe(t,e){const r=t.getValue("willChange");if(par(r))return r.add(e)}function aQe(t){return t.props[NVe]}function Moe(t){let e;return()=>(e===void 0&&(e=t()),e)}const gar=Moe(()=>window.ScrollTimeline!==void 0);class mar{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,r){for(let n=0;n{if(gar()&&i.attachTimeline)return i.attachTimeline(e);if(typeof r=="function")return r(i)});return()=>{n.forEach((i,a)=>{i&&i(),this.animations[a].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let r=0;rr[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class yar extends mar{then(e,r){return Promise.all(this.animations).then(e).catch(r)}}const Lv=t=>t*1e3,Mv=t=>t/1e3;function Ioe(t){return typeof t=="function"}function sQe(t,e){t.timeline=e,t.onfinish=null}const Poe=t=>Array.isArray(t)&&typeof t[0]=="number",bar={linearEasing:void 0};function xar(t,e){const r=Moe(t);return()=>{var n;return(n=bar[e])!==null&&n!==void 0?n:r()}}const IV=xar(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),eE=(t,e,r)=>{const n=e-t;return n===0?1:(r-t)/n},oQe=(t,e,r=10)=>{let n="";const i=Math.max(Math.round(e/r),2);for(let a=0;a`cubic-bezier(${t}, ${e}, ${r}, ${n})`,Noe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:n6([0,.65,.55,1]),circOut:n6([.55,0,1,.45]),backIn:n6([.31,.01,.66,-.59]),backOut:n6([.33,1.53,.69,.99])};function cQe(t,e){if(t)return typeof t=="function"&&IV()?oQe(t,e):Poe(t)?n6(t):Array.isArray(t)?t.map(r=>cQe(r,e)||Noe.easeOut):Noe[t]}const uQe=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,war=1e-7,Aar=12;function Sar(t,e,r,n,i){let a,s,o=0;do s=e+(r-e)/2,a=uQe(s,n,i)-t,a>0?r=s:e=s;while(Math.abs(a)>war&&++oSar(a,0,1,t,r);return a=>a===0||a===1?a:uQe(i(a),e,n)}const hQe=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,dQe=t=>e=>1-t(1-e),fQe=i6(.33,1.53,.69,.99),Boe=dQe(fQe),pQe=hQe(Boe),gQe=t=>(t*=2)<1?.5*Boe(t):.5*(2-Math.pow(2,-10*(t-1))),$oe=t=>1-Math.sin(Math.acos(t)),mQe=dQe($oe),vQe=hQe($oe),yQe=t=>/^0[^.\s]+$/u.test(t);function Tar(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||yQe(t):!0}const a6=t=>Math.round(t*1e5)/1e5,Foe=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Car(t){return t==null}const Oar=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,zoe=(t,e)=>r=>!!(typeof r=="string"&&Oar.test(r)&&r.startsWith(t)||e&&!Car(r)&&Object.prototype.hasOwnProperty.call(r,e)),bQe=(t,e,r)=>n=>{if(typeof n!="string")return n;const[i,a,s,o]=n.match(Foe);return{[t]:parseFloat(i),[e]:parseFloat(a),[r]:parseFloat(s),alpha:o!==void 0?parseFloat(o):1}},kar=t=>Dv(0,255,t),Uoe={...Jk,transform:t=>Math.round(kar(t))},jw={test:zoe("rgb","red"),parse:bQe("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+Uoe.transform(t)+", "+Uoe.transform(e)+", "+Uoe.transform(r)+", "+a6(e6.transform(n))+")"};function Ear(t){let e="",r="",n="",i="";return t.length>5?(e=t.substring(1,3),r=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),r=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,r+=r,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const Voe={test:zoe("#"),parse:Ear,transform:jw.transform},tE={test:zoe("hsl","hue"),parse:bQe("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+jg.transform(a6(e))+", "+jg.transform(a6(r))+", "+a6(e6.transform(n))+")"},Rc={test:t=>jw.test(t)||Voe.test(t)||tE.test(t),parse:t=>jw.test(t)?jw.parse(t):tE.test(t)?tE.parse(t):Voe.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?jw.transform(t):tE.transform(t)},_ar=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Rar(t){var e,r;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Foe))===null||e===void 0?void 0:e.length)||0)+(((r=t.match(_ar))===null||r===void 0?void 0:r.length)||0)>0}const xQe="number",wQe="color",Dar="var",Lar="var(",AQe="${}",Mar=/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 s6(t){const e=t.toString(),r=[],n={color:[],number:[],var:[]},i=[];let a=0;const o=e.replace(Mar,l=>(Rc.test(l)?(n.color.push(a),i.push(wQe),r.push(Rc.parse(l))):l.startsWith(Lar)?(n.var.push(a),i.push(Dar),r.push(l)):(n.number.push(a),i.push(xQe),r.push(parseFloat(l))),++a,AQe)).split(AQe);return{values:r,split:o,indexes:n,types:i}}function SQe(t){return s6(t).values}function TQe(t){const{split:e,types:r}=s6(t),n=e.length;return i=>{let a="";for(let s=0;stypeof t=="number"?0:t;function Par(t){const e=SQe(t);return TQe(t)(e.map(Iar))}const Bb={test:Rar,parse:SQe,createTransformer:TQe,getAnimatableNone:Par},Nar=new Set(["brightness","contrast","saturate","opacity"]);function Bar(t){const[e,r]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=r.match(Foe)||[];if(!n)return t;const i=r.replace(n,"");let a=Nar.has(e)?1:0;return n!==r&&(a*=100),e+"("+a+i+")"}const $ar=/\b([a-z-]*)\(.*?\)/gu,Qoe={...Bb,getAnimatableNone:t=>{const e=t.match($ar);return e?e.map(Bar).join(" "):t}},Far={...Aoe,color:Rc,backgroundColor:Rc,outlineColor:Rc,fill:Rc,stroke:Rc,borderColor:Rc,borderTopColor:Rc,borderRightColor:Rc,borderBottomColor:Rc,borderLeftColor:Rc,filter:Qoe,WebkitFilter:Qoe},Goe=t=>Far[t];function CQe(t,e){let r=Goe(t);return r!==Qoe&&(r=Bb),r.getAnimatableNone?r.getAnimatableNone(e):void 0}const zar=new Set(["auto","none","0"]);function Uar(t,e,r){let n=0,i;for(;nt===Jk||t===dn,kQe=(t,e)=>parseFloat(t.split(", ")[e]),EQe=(t,e)=>(r,{transform:n})=>{if(n==="none"||!n)return 0;const i=n.match(/^matrix3d\((.+)\)$/u);if(i)return kQe(i[1],e);{const a=n.match(/^matrix\((.+)\)$/u);return a?kQe(a[1],t):0}},Var=new Set(["x","y","z"]),Qar=Zk.filter(t=>!Var.has(t));function Gar(t){const e=[];return Qar.forEach(r=>{const n=t.getValue(r);n!==void 0&&(e.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),e}const rE={width:({x:t},{paddingLeft:e="0",paddingRight:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),height:({y:t},{paddingTop:e="0",paddingBottom:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:EQe(4,13),y:EQe(5,14)};rE.translateX=rE.x,rE.translateY=rE.y;const Xw=new Set;let Hoe=!1,Woe=!1;function _Qe(){if(Woe){const t=Array.from(Xw).filter(n=>n.needsMeasurement),e=new Set(t.map(n=>n.element)),r=new Map;e.forEach(n=>{const i=Gar(n);i.length&&(r.set(n,i),n.render())}),t.forEach(n=>n.measureInitialState()),e.forEach(n=>{n.render();const i=r.get(n);i&&i.forEach(([a,s])=>{var o;(o=n.getValue(a))===null||o===void 0||o.set(s)})}),t.forEach(n=>n.measureEndState()),t.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}Woe=!1,Hoe=!1,Xw.forEach(t=>t.complete()),Xw.clear()}function RQe(){Xw.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Woe=!0)})}function Har(){RQe(),_Qe()}class Yoe{constructor(e,r,n,i,a,s=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=r,this.name=n,this.motionValue=i,this.element=a,this.isAsync=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Xw.add(this),Hoe||(Hoe=!0,Ya.read(RQe),Ya.resolveKeyframes(_Qe))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:r,element:n,motionValue:i}=this;for(let a=0;a/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),War=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Yar(t){const e=War.exec(t);if(!e)return[,];const[,r,n,i]=e;return[`--${r??n}`,i]}function LQe(t,e,r=1){const[n,i]=Yar(t);if(!n)return;const a=window.getComputedStyle(e).getPropertyValue(n);if(a){const s=a.trim();return DQe(s)?parseFloat(s):s}return woe(i)?LQe(i,e,r+1):i}const MQe=t=>e=>e.test(t),IQe=[Jk,dn,jg,Nb,Qir,Vir,{test:t=>t==="auto",parse:t=>t}],PQe=t=>IQe.find(MQe(t));class NQe extends Yoe{constructor(e,r,n,i,a){super(e,r,n,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:r,name:n}=this;if(!r||!r.current)return;super.readKeyframes();for(let l=0;l{r.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const BQe=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Bb.test(t)||t==="0")&&!t.startsWith("url("));function qar(t){const e=t[0];if(t.length===1)return!0;for(let r=0;rt!==null;function PV(t,{repeat:e,repeatType:r="loop"},n){const i=t.filter(Xar),a=e&&r!=="loop"&&e%2===1?0:i.length-1;return!a||n===void 0?i[a]:n}const Kar=40;class $Qe{constructor({autoplay:e=!0,delay:r=0,type:n="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:s="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Xg.now(),this.options={autoplay:e,delay:r,type:n,repeat:i,repeatDelay:a,repeatType:s,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>Kar?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Har(),this._resolved}onKeyframesResolved(e,r){this.resolvedAt=Xg.now(),this.hasAttemptedResolve=!0;const{name:n,type:i,velocity:a,delay:s,onComplete:o,onUpdate:l,isGenerator:u}=this.options;if(!u&&!jar(e,n,i,a))if(s)this.options.duration=0;else{l&&l(PV(e,this.options,r)),o&&o(),this.resolveFinishedPromise();return}const h=this.initPlayback(e,r);h!==!1&&(this._resolved={keyframes:e,finalKeyframe:r,...h},this.onPostResolved())}onPostResolved(){}then(e,r){return this.currentFinishedPromise.then(e,r)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const qoe=2e4;function FQe(t){let e=0;const r=50;let n=t.next(e);for(;!n.done&&e=qoe?1/0:e}const bs=(t,e,r)=>t+(e-t)*r;function joe(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function Zar({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let i=0,a=0,s=0;if(!e)i=a=s=r;else{const o=r<.5?r*(1+e):r+e-r*e,l=2*r-o;i=joe(l,o,t+1/3),a=joe(l,o,t),s=joe(l,o,t-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(s*255),alpha:n}}function NV(t,e){return r=>r>0?e:t}const Xoe=(t,e,r)=>{const n=t*t,i=r*(e*e-n)+n;return i<0?0:Math.sqrt(i)},Jar=[Voe,jw,tE],esr=t=>Jar.find(e=>e.test(t));function zQe(t){const e=esr(t);if(!e)return!1;let r=e.parse(t);return e===tE&&(r=Zar(r)),r}const UQe=(t,e)=>{const r=zQe(t),n=zQe(e);if(!r||!n)return NV(t,e);const i={...r};return a=>(i.red=Xoe(r.red,n.red,a),i.green=Xoe(r.green,n.green,a),i.blue=Xoe(r.blue,n.blue,a),i.alpha=bs(r.alpha,n.alpha,a),jw.transform(i))},tsr=(t,e)=>r=>e(t(r)),o6=(...t)=>t.reduce(tsr),Koe=new Set(["none","hidden"]);function rsr(t,e){return Koe.has(t)?r=>r<=0?t:e:r=>r>=1?e:t}function nsr(t,e){return r=>bs(t,e,r)}function Zoe(t){return typeof t=="number"?nsr:typeof t=="string"?woe(t)?NV:Rc.test(t)?UQe:ssr:Array.isArray(t)?VQe:typeof t=="object"?Rc.test(t)?UQe:isr:NV}function VQe(t,e){const r=[...t],n=r.length,i=t.map((a,s)=>Zoe(a)(a,e[s]));return a=>{for(let s=0;s{for(const a in n)r[a]=n[a](i);return r}}function asr(t,e){var r;const n=[],i={color:0,var:0,number:0};for(let a=0;a{const r=Bb.createTransformer(e),n=s6(t),i=s6(e);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?Koe.has(t)&&!i.values.length||Koe.has(e)&&!n.values.length?rsr(t,e):o6(VQe(asr(n,i),i.values),r):NV(t,e)};function QQe(t,e,r){return typeof t=="number"&&typeof e=="number"&&typeof r=="number"?bs(t,e,r):Zoe(t)(t,e)}const osr=5;function GQe(t,e,r){const n=Math.max(e-osr,0);return nQe(r-t(n),e-n)}const Ms={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},Joe=.001;function lsr({duration:t=Ms.duration,bounce:e=Ms.bounce,velocity:r=Ms.velocity,mass:n=Ms.mass}){let i,a,s=1-e;s=Dv(Ms.minDamping,Ms.maxDamping,s),t=Dv(Ms.minDuration,Ms.maxDuration,Mv(t)),s<1?(i=u=>{const h=u*s,d=h*t,f=h-r,p=ele(u,s),g=Math.exp(-d);return Joe-f/p*g},a=u=>{const d=u*s*t,f=d*r+r,p=Math.pow(s,2)*Math.pow(u,2)*t,g=Math.exp(-d),m=ele(Math.pow(u,2),s);return(-i(u)+Joe>0?-1:1)*((f-p)*g)/m}):(i=u=>{const h=Math.exp(-u*t),d=(u-r)*t+1;return-Joe+h*d},a=u=>{const h=Math.exp(-u*t),d=(r-u)*(t*t);return h*d});const o=5/t,l=usr(i,a,o);if(t=Lv(t),isNaN(l))return{stiffness:Ms.stiffness,damping:Ms.damping,duration:t};{const u=Math.pow(l,2)*n;return{stiffness:u,damping:s*2*Math.sqrt(n*u),duration:t}}}const csr=12;function usr(t,e,r){let n=r;for(let i=1;it[r]!==void 0)}function fsr(t){let e={velocity:Ms.velocity,stiffness:Ms.stiffness,damping:Ms.damping,mass:Ms.mass,isResolvedFromDuration:!1,...t};if(!HQe(t,dsr)&&HQe(t,hsr))if(t.visualDuration){const r=t.visualDuration,n=2*Math.PI/(r*1.2),i=n*n,a=2*Dv(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:Ms.mass,stiffness:i,damping:a}}else{const r=lsr(t);e={...e,...r,mass:Ms.mass},e.isResolvedFromDuration=!0}return e}function WQe(t=Ms.visualDuration,e=Ms.bounce){const r=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:n,restDelta:i}=r;const a=r.keyframes[0],s=r.keyframes[r.keyframes.length-1],o={done:!1,value:a},{stiffness:l,damping:u,mass:h,duration:d,velocity:f,isResolvedFromDuration:p}=fsr({...r,velocity:-Mv(r.velocity||0)}),g=f||0,m=u/(2*Math.sqrt(l*h)),v=s-a,y=Mv(Math.sqrt(l/h)),b=Math.abs(v)<5;n||(n=b?Ms.restSpeed.granular:Ms.restSpeed.default),i||(i=b?Ms.restDelta.granular:Ms.restDelta.default);let x;if(m<1){const A=ele(y,m);x=S=>{const T=Math.exp(-m*y*S);return s-T*((g+m*y*v)/A*Math.sin(A*S)+v*Math.cos(A*S))}}else if(m===1)x=A=>s-Math.exp(-y*A)*(v+(g+y*v)*A);else{const A=y*Math.sqrt(m*m-1);x=S=>{const T=Math.exp(-m*y*S),O=Math.min(A*S,300);return s-T*((g+m*y*v)*Math.sinh(O)+A*v*Math.cosh(O))/A}}const w={calculatedDuration:p&&d||null,next:A=>{const S=x(A);if(p)o.done=A>=d;else{let T=0;m<1&&(T=A===0?Lv(g):GQe(x,A,S));const O=Math.abs(T)<=n,k=Math.abs(s-S)<=i;o.done=O&&k}return o.value=o.done?s:S,o},toString:()=>{const A=Math.min(FQe(w),qoe),S=oQe(T=>w.next(A*T).value,A,30);return A+"ms "+S}};return w}function YQe({keyframes:t,velocity:e=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:s,min:o,max:l,restDelta:u=.5,restSpeed:h}){const d=t[0],f={done:!1,value:d},p=O=>o!==void 0&&Ol,g=O=>o===void 0?l:l===void 0||Math.abs(o-O)-m*Math.exp(-O/n),x=O=>y+b(O),w=O=>{const k=b(O),E=x(O);f.done=Math.abs(k)<=u,f.value=f.done?y:E};let A,S;const T=O=>{p(f.value)&&(A=O,S=WQe({keyframes:[f.value,g(f.value)],velocity:GQe(x,O,f.value),damping:i,stiffness:a,restDelta:u,restSpeed:h}))};return T(0),{calculatedDuration:null,next:O=>{let k=!1;return!S&&A===void 0&&(k=!0,w(O),T(O)),A!==void 0&&O>=A?S.next(O-A):(!k&&w(O),f)}}}const psr=i6(.42,0,1,1),gsr=i6(0,0,.58,1),qQe=i6(.42,0,.58,1),msr=t=>Array.isArray(t)&&typeof t[0]!="number",vsr={linear:vd,easeIn:psr,easeInOut:qQe,easeOut:gsr,circIn:$oe,circInOut:vQe,circOut:mQe,backIn:Boe,backInOut:pQe,backOut:fQe,anticipate:gQe},jQe=t=>{if(Poe(t)){_Ve(t.length===4);const[e,r,n,i]=t;return i6(e,r,n,i)}else if(typeof t=="string")return vsr[t];return t};function ysr(t,e,r){const n=[],i=r||QQe,a=t.length-1;for(let s=0;se[0];if(a===2&&e[0]===e[1])return()=>e[1];const s=t[0]===t[1];t[0]>t[a-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=ysr(e,n,i),l=o.length,u=h=>{if(s&&h1)for(;du(Dv(t[0],t[a-1],h)):u}function xsr(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=eE(0,e,n);t.push(bs(r,1,i))}}function wsr(t){const e=[0];return xsr(e,t.length-1),e}function Asr(t,e){return t.map(r=>r*e)}function Ssr(t,e){return t.map(()=>e||qQe).splice(0,t.length-1)}function BV({duration:t=300,keyframes:e,times:r,ease:n="easeInOut"}){const i=msr(n)?n.map(jQe):jQe(n),a={done:!1,value:e[0]},s=Asr(r&&r.length===e.length?r:wsr(e),t),o=bsr(s,e,{ease:Array.isArray(i)?i:Ssr(e,i)});return{calculatedDuration:t,next:l=>(a.value=o(l),a.done=l>=t,a)}}const Tsr=t=>{const e=({timestamp:r})=>t(r);return{start:()=>Ya.update(e,!0),stop:()=>Pb(e),now:()=>Xl.isProcessing?Xl.timestamp:Xg.now()}},Csr={decay:YQe,inertia:YQe,tween:BV,keyframes:BV,spring:WQe},Osr=t=>t/100;class tle extends $Qe{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:r,motionValue:n,element:i,keyframes:a}=this.options,s=(i==null?void 0:i.KeyframeResolver)||Yoe,o=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new s(a,o,r,n,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:r="keyframes",repeat:n=0,repeatDelay:i=0,repeatType:a,velocity:s=0}=this.options,o=Ioe(r)?r:Csr[r]||BV;let l,u;o!==BV&&typeof e[0]!="number"&&(l=o6(Osr,QQe(e[0],e[1])),e=[0,100]);const h=o({...this.options,keyframes:e});a==="mirror"&&(u=o({...this.options,keyframes:[...e].reverse(),velocity:-s})),h.calculatedDuration===null&&(h.calculatedDuration=FQe(h));const{calculatedDuration:d}=h,f=d+i,p=f*(n+1)-i;return{generator:h,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:f,totalDuration:p}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,r=!1){const{resolved:n}=this;if(!n){const{keyframes:O}=this.options;return{done:!0,value:O[O.length-1]}}const{finalKeyframe:i,generator:a,mirroredGenerator:s,mapPercentToKeyframes:o,keyframes:l,calculatedDuration:u,totalDuration:h,resolvedDuration:d}=n;if(this.startTime===null)return a.next(0);const{delay:f,repeat:p,repeatType:g,repeatDelay:m,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-h/this.speed,this.startTime)),r?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const y=this.currentTime-f*(this.speed>=0?1:-1),b=this.speed>=0?y<0:y>h;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=h);let x=this.currentTime,w=a;if(p){const O=Math.min(this.currentTime,h)/d;let k=Math.floor(O),E=O%1;!E&&O>=1&&(E=1),E===1&&k--,k=Math.min(k,p+1),!!(k%2)&&(g==="reverse"?(E=1-E,m&&(E-=m/d)):g==="mirror"&&(w=s)),x=Dv(0,1,E)*d}const A=b?{done:!1,value:l[0]}:w.next(x);o&&(A.value=o(A.value));let{done:S}=A;!b&&u!==null&&(S=this.speed>=0?this.currentTime>=h:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return T&&i!==void 0&&(A.value=PV(l,this.options,i)),v&&v(A.value),T&&this.finish(),A}get duration(){const{resolved:e}=this;return e?Mv(e.calculatedDuration):0}get time(){return Mv(this.currentTime)}set time(e){e=Lv(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const r=this.playbackSpeed!==e;this.playbackSpeed=e,r&&(this.time=Mv(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=Tsr,onPlay:r,startTime:n}=this.options;this.driver||(this.driver=e(a=>this.tick(a))),r&&r();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=n??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}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(e){return this.startTime=0,this.tick(e,!0)}}const ksr=new Set(["opacity","clipPath","filter","transform"]);function Esr(t,e,r,{delay:n=0,duration:i=300,repeat:a=0,repeatType:s="loop",ease:o="easeInOut",times:l}={}){const u={[e]:r};l&&(u.offset=l);const h=cQe(o,i);return Array.isArray(h)&&(u.easing=h),t.animate(u,{delay:n,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:a+1,direction:s==="reverse"?"alternate":"normal"})}const _sr=Moe(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),$V=10,Rsr=2e4;function Dsr(t){return Ioe(t.type)||t.type==="spring"||!lQe(t.ease)}function Lsr(t,e){const r=new tle({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let n={done:!1,value:t[0]};const i=[];let a=0;for(;!n.done&&athis.onKeyframesResolved(s,o),r,n,i),this.resolver.scheduleResolve()}initPlayback(e,r){let{duration:n=300,times:i,ease:a,type:s,motionValue:o,name:l,startTime:u}=this.options;if(!o.owner||!o.owner.current)return!1;if(typeof a=="string"&&IV()&&Msr(a)&&(a=XQe[a]),Dsr(this.options)){const{onComplete:d,onUpdate:f,motionValue:p,element:g,...m}=this.options,v=Lsr(e,m);e=v.keyframes,e.length===1&&(e[1]=e[0]),n=v.duration,i=v.times,a=v.ease,s="keyframes"}const h=Esr(o.owner.current,l,e,{...this.options,duration:n,times:i,ease:a});return h.startTime=u??this.calcStartTime(),this.pendingTimeline?(sQe(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:d}=this.options;o.set(PV(e,this.options,r)),d&&d(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:n,times:i,type:s,ease:a,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:r}=e;return Mv(r)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:r}=e;return Mv(r.currentTime||0)}set time(e){const{resolved:r}=this;if(!r)return;const{animation:n}=r;n.currentTime=Lv(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:r}=e;return r.playbackRate}set speed(e){const{resolved:r}=this;if(!r)return;const{animation:n}=r;n.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:r}=e;return r.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:r}=e;return r.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:r}=this;if(!r)return vd;const{animation:n}=r;sQe(n,e)}return vd}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:r}=e;r.playState==="finished"&&this.updateFinishedPromise(),r.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:r}=e;r.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:r,keyframes:n,duration:i,type:a,ease:s,times:o}=e;if(r.playState==="idle"||r.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:h,onComplete:d,element:f,...p}=this.options,g=new tle({...p,keyframes:n,duration:i,type:a,ease:s,times:o,isGenerator:!0}),m=Lv(this.time);u.setWithVelocity(g.sample(m-$V).value,g.sample(m).value,$V)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:r,name:n,repeatDelay:i,repeatType:a,damping:s,type:o}=e;if(!r||!r.owner||!(r.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=r.owner.getProps();return _sr()&&n&&ksr.has(n)&&!l&&!u&&!i&&a!=="mirror"&&s!==0&&o!=="inertia"}}const Isr={type:"spring",stiffness:500,damping:25,restSpeed:10},Psr=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Nsr={type:"keyframes",duration:.8},Bsr={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},$sr=(t,{keyframes:e})=>e.length>2?Nsr:qw.has(t)?t.startsWith("scale")?Psr(e[1]):Isr:Bsr;function Fsr({when:t,delay:e,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:a,repeatType:s,repeatDelay:o,from:l,elapsed:u,...h}){return!!Object.keys(h).length}const rle=(t,e,r,n={},i,a)=>s=>{const o=Eoe(n,t)||{},l=o.delay||n.delay||0;let{elapsed:u=0}=n;u=u-Lv(l);let h={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:e.getVelocity(),...o,delay:-u,onUpdate:f=>{e.set(f),o.onUpdate&&o.onUpdate(f)},onComplete:()=>{s(),o.onComplete&&o.onComplete()},name:t,motionValue:e,element:a?void 0:i};Fsr(o)||(h={...h,...$sr(t,h)}),h.duration&&(h.duration=Lv(h.duration)),h.repeatDelay&&(h.repeatDelay=Lv(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let d=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(h.duration=0,h.delay===0&&(d=!0)),d&&!a&&e.get()!==void 0){const f=PV(h.keyframes,o);if(f!==void 0)return Ya.update(()=>{h.onUpdate(f),h.onComplete()}),new yar([])}return!a&&KQe.supports(h)?new KQe(h):new tle(h)};function zsr({protectedKeys:t,needsAnimating:e},r){const n=t.hasOwnProperty(r)&&e[r]!==!0;return e[r]=!1,n}function ZQe(t,e,{delay:r=0,transitionOverride:n,type:i}={}){var a;let{transition:s=t.getDefaultTransition(),transitionEnd:o,...l}=e;n&&(s=n);const u=[],h=i&&t.animationState&&t.animationState.getState()[i];for(const d in l){const f=t.getValue(d,(a=t.latestValues[d])!==null&&a!==void 0?a:null),p=l[d];if(p===void 0||h&&zsr(h,d))continue;const g={delay:r,...Eoe(s||{},d)};let m=!1;if(window.MotionHandoffAnimation){const y=aQe(t);if(y){const b=window.MotionHandoffAnimation(y,d,Ya);b!==null&&(g.startTime=b,m=!0)}}Loe(t,d),f.start(rle(d,f,p,t.shouldReduceMotion&&rQe.has(d)?{type:!1}:g,t,m));const v=f.animation;v&&u.push(v)}return o&&Promise.all(u).then(()=>{Ya.update(()=>{o&&far(t,o)})}),u}function nle(t,e,r={}){var n;const i=LV(t,e,r.type==="exit"?(n=t.presenceContext)===null||n===void 0?void 0:n.custom:void 0);let{transition:a=t.getDefaultTransition()||{}}=i||{};r.transitionOverride&&(a=r.transitionOverride);const s=i?()=>Promise.all(ZQe(t,i,r)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:h=0,staggerChildren:d,staggerDirection:f}=a;return Usr(t,e,h+u,d,f,r)}:()=>Promise.resolve(),{when:l}=a;if(l){const[u,h]=l==="beforeChildren"?[s,o]:[o,s];return u().then(()=>h())}else return Promise.all([s(),o(r.delay)])}function Usr(t,e,r=0,n=0,i=1,a){const s=[],o=(t.variantChildren.size-1)*n,l=i===1?(u=0)=>u*n:(u=0)=>o-u*n;return Array.from(t.variantChildren).sort(Vsr).forEach((u,h)=>{u.notify("AnimationStart",e),s.push(nle(u,e,{...a,delay:r+l(h)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(s)}function Vsr(t,e){return t.sortNodePosition(e)}function Qsr(t,e,r={}){t.notify("AnimationStart",e);let n;if(Array.isArray(e)){const i=e.map(a=>nle(t,a,r));n=Promise.all(i)}else if(typeof e=="string")n=nle(t,e,r);else{const i=typeof e=="function"?LV(t,e,r.custom):e;n=Promise.all(ZQe(t,i,r))}return n.then(()=>{t.notify("AnimationComplete",e)})}const Gsr=goe.length;function JQe(t){if(!t)return;if(!t.isControllingVariants){const r=t.parent?JQe(t.parent)||{}:{};return t.props.initial!==void 0&&(r.initial=t.props.initial),r}const e={};for(let r=0;rPromise.all(e.map(({animation:r,options:n})=>Qsr(t,r,n)))}function qsr(t){let e=Ysr(t),r=eGe(),n=!0;const i=l=>(u,h)=>{var d;const f=LV(t,h,l==="exit"?(d=t.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(f){const{transition:p,transitionEnd:g,...m}=f;u={...u,...m,...g}}return u};function a(l){e=l(t)}function s(l){const{props:u}=t,h=JQe(t.parent)||{},d=[],f=new Set;let p={},g=1/0;for(let v=0;vg&&w,k=!1;const E=Array.isArray(x)?x:[x];let _=E.reduce(i(y),{});A===!1&&(_={});const{prevResolvedValues:I={}}=b,L={...I,..._},R=P=>{O=!0,f.has(P)&&(k=!0,f.delete(P)),b.needsAnimating[P]=!0;const N=t.getValue(P);N&&(N.liveStyle=!1)};for(const P in L){const N=_[P],F=I[P];if(p.hasOwnProperty(P))continue;let B=!1;xoe(N)&&xoe(F)?B=!tQe(N,F):B=N!==F,B?N!=null?R(P):f.add(P):N!==void 0&&f.has(P)?R(P):b.protectedKeys[P]=!0}b.prevProp=x,b.prevResolvedValues=_,b.isActive&&(p={...p,..._}),n&&t.blockInitialAnimation&&(O=!1),O&&(!(S&&T)||k)&&d.push(...E.map(P=>({animation:P,options:{type:y}})))}if(f.size){const v={};f.forEach(y=>{const b=t.getBaseTarget(y),x=t.getValue(y);x&&(x.liveStyle=!0),v[y]=b??null}),d.push({animation:v})}let m=!!d.length;return n&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(m=!1),n=!1,m?e(d):Promise.resolve()}function o(l,u){var h;if(r[l].isActive===u)return Promise.resolve();(h=t.variantChildren)===null||h===void 0||h.forEach(f=>{var p;return(p=f.animationState)===null||p===void 0?void 0:p.setActive(l,u)}),r[l].isActive=u;const d=s(l);for(const f in r)r[f].protectedKeys={};return d}return{animateChanges:s,setActive:o,setAnimateFunction:a,getState:()=>r,reset:()=>{r=eGe(),n=!0}}}function jsr(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!tQe(e,t):!1}function Kw(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function eGe(){return{animate:Kw(!0),whileInView:Kw(),whileHover:Kw(),whileTap:Kw(),whileDrag:Kw(),whileFocus:Kw(),exit:Kw()}}class $b{constructor(e){this.isMounted=!1,this.node=e}update(){}}class Xsr extends $b{constructor(e){super(e),e.animationState||(e.animationState=qsr(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();kV(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:r}=this.node.prevProps||{};e!==r&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let Ksr=0;class Zsr extends $b{constructor(){super(...arguments),this.id=Ksr++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const i=this.node.animationState.setActive("exit",!e);r&&!e&&i.then(()=>r(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const Jsr={animation:{Feature:Xsr},exit:{Feature:Zsr}},Mp={x:!1,y:!1};function tGe(){return Mp.x||Mp.y}function eor(t){return t==="x"||t==="y"?Mp[t]?null:(Mp[t]=!0,()=>{Mp[t]=!1}):Mp.x||Mp.y?null:(Mp.x=Mp.y=!0,()=>{Mp.x=Mp.y=!1})}const ile=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function l6(t,e,r,n={passive:!0}){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r)}function c6(t){return{point:{x:t.pageX,y:t.pageY}}}const tor=t=>e=>ile(e)&&t(e,c6(e));function u6(t,e,r,n){return l6(t,e,tor(r),n)}const rGe=(t,e)=>Math.abs(t-e);function ror(t,e){const r=rGe(t.x,e.x),n=rGe(t.y,e.y);return Math.sqrt(r**2+n**2)}class nGe{constructor(e,r,{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:a=!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 d=sle(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=ror(d.offset,{x:0,y:0})>=3;if(!f&&!p)return;const{point:g}=d,{timestamp:m}=Xl;this.history.push({...g,timestamp:m});const{onStart:v,onMove:y}=this.handlers;f||(v&&v(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=ale(f,this.transformPagePoint),Ya.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:p,onSessionEnd:g,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=sle(d.type==="pointercancel"?this.lastMoveEventInfo:ale(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,v),g&&g(d,v)},!ile(e))return;this.dragSnapToOrigin=a,this.handlers=r,this.transformPagePoint=n,this.contextWindow=i||window;const s=c6(e),o=ale(s,this.transformPagePoint),{point:l}=o,{timestamp:u}=Xl;this.history=[{...l,timestamp:u}];const{onSessionStart:h}=r;h&&h(e,sle(o,this.history)),this.removeListeners=o6(u6(this.contextWindow,"pointermove",this.handlePointerMove),u6(this.contextWindow,"pointerup",this.handlePointerUp),u6(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Pb(this.updatePoint)}}function ale(t,e){return e?{point:e(t.point)}:t}function iGe(t,e){return{x:t.x-e.x,y:t.y-e.y}}function sle({point:t},e){return{point:t,delta:iGe(t,aGe(e)),offset:iGe(t,nor(e)),velocity:ior(e,.1)}}function nor(t){return t[0]}function aGe(t){return t[t.length-1]}function ior(t,e){if(t.length<2)return{x:0,y:0};let r=t.length-1,n=null;const i=aGe(t);for(;r>=0&&(n=t[r],!(i.timestamp-n.timestamp>Lv(e)));)r--;if(!n)return{x:0,y:0};const a=Mv(i.timestamp-n.timestamp);if(a===0)return{x:0,y:0};const s={x:(i.x-n.x)/a,y:(i.y-n.y)/a};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}const sGe=1e-4,aor=1-sGe,sor=1+sGe,oGe=.01,oor=0-oGe,lor=0+oGe;function yd(t){return t.max-t.min}function cor(t,e,r){return Math.abs(t-e)<=r}function lGe(t,e,r,n=.5){t.origin=n,t.originPoint=bs(e.min,e.max,t.origin),t.scale=yd(r)/yd(e),t.translate=bs(r.min,r.max,t.origin)-t.originPoint,(t.scale>=aor&&t.scale<=sor||isNaN(t.scale))&&(t.scale=1),(t.translate>=oor&&t.translate<=lor||isNaN(t.translate))&&(t.translate=0)}function h6(t,e,r,n){lGe(t.x,e.x,r.x,n?n.originX:void 0),lGe(t.y,e.y,r.y,n?n.originY:void 0)}function cGe(t,e,r){t.min=r.min+e.min,t.max=t.min+yd(e)}function uor(t,e,r){cGe(t.x,e.x,r.x),cGe(t.y,e.y,r.y)}function uGe(t,e,r){t.min=e.min-r.min,t.max=t.min+yd(e)}function d6(t,e,r){uGe(t.x,e.x,r.x),uGe(t.y,e.y,r.y)}function hor(t,{min:e,max:r},n){return e!==void 0&&tr&&(t=n?bs(r,t,n.max):Math.min(t,r)),t}function hGe(t,e,r){return{min:e!==void 0?t.min+e:void 0,max:r!==void 0?t.max+r-(t.max-t.min):void 0}}function dor(t,{top:e,left:r,bottom:n,right:i}){return{x:hGe(t.x,r,i),y:hGe(t.y,e,n)}}function dGe(t,e){let r=e.min-t.min,n=e.max-t.max;return e.max-e.minn?r=eE(e.min,e.max-n,t.min):n>i&&(r=eE(t.min,t.max-i,e.min)),Dv(0,1,r)}function mor(t,e){const r={};return e.min!==void 0&&(r.min=e.min-t.min),e.max!==void 0&&(r.max=e.max-t.min),r}const ole=.35;function vor(t=ole){return t===!1?t=0:t===!0&&(t=ole),{x:fGe(t,"left","right"),y:fGe(t,"top","bottom")}}function fGe(t,e,r){return{min:pGe(t,e),max:pGe(t,r)}}function pGe(t,e){return typeof t=="number"?t:t[e]||0}const gGe=()=>({translate:0,scale:1,origin:0,originPoint:0}),nE=()=>({x:gGe(),y:gGe()}),mGe=()=>({min:0,max:0}),Js=()=>({x:mGe(),y:mGe()});function Tf(t){return[t("x"),t("y")]}function vGe({top:t,left:e,right:r,bottom:n}){return{x:{min:e,max:r},y:{min:t,max:n}}}function yor({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function bor(t,e){if(!e)return t;const r=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function lle(t){return t===void 0||t===1}function cle({scale:t,scaleX:e,scaleY:r}){return!lle(t)||!lle(e)||!lle(r)}function Zw(t){return cle(t)||yGe(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function yGe(t){return bGe(t.x)||bGe(t.y)}function bGe(t){return t&&t!=="0%"}function FV(t,e,r){const n=t-r,i=e*n;return r+i}function xGe(t,e,r,n,i){return i!==void 0&&(t=FV(t,i,n)),FV(t,r,n)+e}function ule(t,e=0,r=1,n,i){t.min=xGe(t.min,e,r,n,i),t.max=xGe(t.max,e,r,n,i)}function wGe(t,{x:e,y:r}){ule(t.x,e.translate,e.scale,e.originPoint),ule(t.y,r.translate,r.scale,r.originPoint)}const AGe=.999999999999,SGe=1.0000000000001;function xor(t,e,r,n=!1){const i=r.length;if(!i)return;e.x=e.y=1;let a,s;for(let o=0;oAGe&&(e.x=1),e.yAGe&&(e.y=1)}function iE(t,e){t.min=t.min+e,t.max=t.max+e}function TGe(t,e,r,n,i=.5){const a=bs(t.min,t.max,i);ule(t,e,r,a,n)}function aE(t,e){TGe(t.x,e.x,e.scaleX,e.scale,e.originX),TGe(t.y,e.y,e.scaleY,e.scale,e.originY)}function CGe(t,e){return vGe(bor(t.getBoundingClientRect(),e))}function wor(t,e,r){const n=CGe(t,r),{scroll:i}=e;return i&&(iE(n.x,i.offset.x),iE(n.y,i.offset.y)),n}const OGe=({current:t})=>t?t.ownerDocument.defaultView:null,Aor=new WeakMap;class Sor{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Js(),this.visualElement=e}start(e,{snapToCursor:r=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;const i=h=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(c6(h).point)},a=(h,d)=>{const{drag:f,dragPropagation:p,onDragStart:g}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=eor(f),!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),Tf(v=>{let y=this.getAxisMotionValue(v).get()||0;if(jg.test(y)){const{projection:b}=this.visualElement;if(b&&b.layout){const x=b.layout.layoutBox[v];x&&(y=yd(x)*(parseFloat(y)/100))}}this.originPoint[v]=y}),g&&Ya.postRender(()=>g(h,d)),Loe(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},s=(h,d)=>{const{dragPropagation:f,dragDirectionLock:p,onDirectionLock:g,onDrag:m}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:v}=d;if(p&&this.currentDirection===null){this.currentDirection=Tor(v),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",d.point,v),this.updateAxis("y",d.point,v),this.visualElement.render(),m&&m(h,d)},o=(h,d)=>this.stop(h,d),l=()=>Tf(h=>{var d;return this.getAnimationState(h)==="paused"&&((d=this.getAxisMotionValue(h).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new nGe(e,{onSessionStart:i,onStart:a,onMove:s,onSessionEnd:o,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:OGe(this.visualElement)})}stop(e,r){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=r;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&Ya.postRender(()=>a(e,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:r}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(e,r,n){const{drag:i}=this.getProps();if(!n||!zV(e,i,this.currentDirection))return;const a=this.getAxisMotionValue(e);let s=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(s=hor(s,this.constraints[e],this.elastic[e])),a.set(s)}resolveConstraints(){var e;const{dragConstraints:r,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,a=this.constraints;r&&Kk(r)?this.constraints||(this.constraints=this.resolveRefConstraints()):r&&i?this.constraints=dor(i.layoutBox,r):this.constraints=!1,this.elastic=vor(n),a!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Tf(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=mor(i.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:r}=this.getProps();if(!e||!Kk(e))return!1;const n=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=wor(n,i.root,this.visualElement.getTransformPagePoint());let s=por(i.layout.layoutBox,a);if(r){const o=r(yor(s));this.hasMutatedConstraints=!!o,o&&(s=vGe(o))}return s}startAnimation(e){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:a,dragSnapToOrigin:s,onDragTransitionEnd:o}=this.getProps(),l=this.constraints||{},u=Tf(h=>{if(!zV(h,r,this.currentDirection))return;let d=l&&l[h]||{};s&&(d={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,g={type:"inertia",velocity:n?e[h]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...a,...d};return this.startAxisValueAnimation(h,g)});return Promise.all(u).then(o)}startAxisValueAnimation(e,r){const n=this.getAxisMotionValue(e);return Loe(this.visualElement,e),n.start(rle(e,n,0,r,this.visualElement,!1))}stopAnimation(){Tf(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Tf(e=>{var r;return(r=this.getAxisMotionValue(e).animation)===null||r===void 0?void 0:r.pause()})}getAnimationState(e){var r;return(r=this.getAxisMotionValue(e).animation)===null||r===void 0?void 0:r.state}getAxisMotionValue(e){const r=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps(),i=n[r];return i||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){Tf(r=>{const{drag:n}=this.getProps();if(!zV(r,n,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(r);if(i&&i.layout){const{min:s,max:o}=i.layout.layoutBox[r];a.set(e[r]-bs(s,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!Kk(r)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Tf(s=>{const o=this.getAxisMotionValue(s);if(o&&this.constraints!==!1){const l=o.get();i[s]=gor({min:l,max:l},this.constraints[s])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Tf(s=>{if(!zV(s,e,null))return;const o=this.getAxisMotionValue(s),{min:l,max:u}=this.constraints[s];o.set(bs(l,u,i[s]))})}addListeners(){if(!this.visualElement.current)return;Aor.set(this.visualElement,this);const e=this.visualElement.current,r=u6(e,"pointerdown",l=>{const{drag:u,dragListener:h=!0}=this.getProps();u&&h&&this.start(l)}),n=()=>{const{dragConstraints:l}=this.getProps();Kk(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,a=i.addEventListener("measure",n);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Ya.read(n);const s=l6(window,"resize",()=>this.scalePositionWithinConstraints()),o=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Tf(h=>{const d=this.getAxisMotionValue(h);d&&(this.originPoint[h]+=l[h].translate,d.set(d.get()+l[h].translate))}),this.visualElement.render())});return()=>{s(),r(),a(),o&&o()}}getProps(){const e=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:s=ole,dragMomentum:o=!0}=e;return{...e,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:a,dragElastic:s,dragMomentum:o}}}function zV(t,e,r){return(e===!0||e===t)&&(r===null||r===t)}function Tor(t,e=10){let r=null;return Math.abs(t.y)>e?r="y":Math.abs(t.x)>e&&(r="x"),r}class Cor extends $b{constructor(e){super(e),this.removeGroupControls=vd,this.removeListeners=vd,this.controls=new Sor(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||vd}unmount(){this.removeGroupControls(),this.removeListeners()}}const kGe=t=>(e,r)=>{t&&Ya.postRender(()=>t(e,r))};class Oor extends $b{constructor(){super(...arguments),this.removePointerDownListener=vd}onPointerDown(e){this.session=new nGe(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:OGe(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:kGe(e),onStart:kGe(r),onMove:n,onEnd:(a,s)=>{delete this.session,i&&Ya.postRender(()=>i(a,s))}}}mount(){this.removePointerDownListener=u6(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const UV={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function EGe(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const f6={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(dn.test(t))t=parseFloat(t);else return t;const r=EGe(t,e.target.x),n=EGe(t,e.target.y);return`${r}% ${n}%`}},kor={correct:(t,{treeScale:e,projectionDelta:r})=>{const n=t,i=Bb.parse(t);if(i.length>5)return n;const a=Bb.createTransformer(t),s=typeof i[0]!="number"?1:0,o=r.x.scale*e.x,l=r.y.scale*e.y;i[0+s]/=o,i[1+s]/=l;const u=bs(o,l,.5);return typeof i[2+s]=="number"&&(i[2+s]/=u),typeof i[3+s]=="number"&&(i[3+s]/=u),a(i)}};class Eor extends se.Component{componentDidMount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:a}=e;Jir(_or),a&&(r.group&&r.group.add(a),n&&n.register&&i&&n.register(a),a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),UV.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:r,visualElement:n,drag:i,isPresent:a}=this.props,s=n.projection;return s&&(s.isPresent=a,i||e.layoutDependency!==r||r===void 0?s.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?s.promote():s.relegate()||Ya.postRender(()=>{const o=s.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),voe.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function _Ge(t){const[e,r]=OVe(),n=se.useContext(coe);return W.jsx(Eor,{...t,layoutGroup:n,switchLayoutGroup:se.useContext(BVe),isPresent:e,safeToRemove:r})}const _or={borderRadius:{...f6,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:f6,borderTopRightRadius:f6,borderBottomLeftRadius:f6,borderBottomRightRadius:f6,boxShadow:kor};function Ror(t,e,r){const n=_c(t)?t:r6(t);return n.start(rle("",n,e,r)),n.animation}function Dor(t){return t instanceof SVGElement&&t.tagName!=="svg"}const Lor=(t,e)=>t.depth-e.depth;class Mor{constructor(){this.children=[],this.isDirty=!1}add(e){_oe(this.children,e),this.isDirty=!0}remove(e){Roe(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Lor),this.isDirty=!1,this.children.forEach(e)}}function Ior(t,e){const r=Xg.now(),n=({timestamp:i})=>{const a=i-r;a>=e&&(Pb(n),t(a-e))};return Ya.read(n,!0),()=>Pb(n)}const RGe=["TopLeft","TopRight","BottomLeft","BottomRight"],Por=RGe.length,DGe=t=>typeof t=="string"?parseFloat(t):t,LGe=t=>typeof t=="number"||dn.test(t);function Nor(t,e,r,n,i,a){i?(t.opacity=bs(0,r.opacity!==void 0?r.opacity:1,Bor(n)),t.opacityExit=bs(e.opacity!==void 0?e.opacity:1,0,$or(n))):a&&(t.opacity=bs(e.opacity!==void 0?e.opacity:1,r.opacity!==void 0?r.opacity:1,n));for(let s=0;sne?1:r(eE(t,e,n))}function PGe(t,e){t.min=e.min,t.max=e.max}function Cf(t,e){PGe(t.x,e.x),PGe(t.y,e.y)}function NGe(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function BGe(t,e,r,n,i){return t-=e,t=FV(t,1/r,n),i!==void 0&&(t=FV(t,1/i,n)),t}function For(t,e=0,r=1,n=.5,i,a=t,s=t){if(jg.test(e)&&(e=parseFloat(e),e=bs(s.min,s.max,e/100)-s.min),typeof e!="number")return;let o=bs(a.min,a.max,n);t===a&&(o-=e),t.min=BGe(t.min,e,r,o,i),t.max=BGe(t.max,e,r,o,i)}function $Ge(t,e,[r,n,i],a,s){For(t,e[r],e[n],e[i],e.scale,a,s)}const zor=["x","scaleX","originX"],Uor=["y","scaleY","originY"];function FGe(t,e,r,n){$Ge(t.x,e,zor,r?r.x:void 0,n?n.x:void 0),$Ge(t.y,e,Uor,r?r.y:void 0,n?n.y:void 0)}function zGe(t){return t.translate===0&&t.scale===1}function UGe(t){return zGe(t.x)&&zGe(t.y)}function VGe(t,e){return t.min===e.min&&t.max===e.max}function Vor(t,e){return VGe(t.x,e.x)&&VGe(t.y,e.y)}function QGe(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function GGe(t,e){return QGe(t.x,e.x)&&QGe(t.y,e.y)}function HGe(t){return yd(t.x)/yd(t.y)}function WGe(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Qor{constructor(){this.members=[]}add(e){_oe(this.members,e),e.scheduleRender()}remove(e){if(Roe(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(e){const r=this.members.findIndex(i=>e===i);if(r===0)return!1;let n;for(let i=r;i>=0;i--){const a=this.members[i];if(a.isPresent!==!1){n=a;break}}return n?(this.promote(n),!0):!1}promote(e,r){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,r&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:r,resumingFrom:n}=e;r.onExitComplete&&r.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Gor(t,e,r){let n="";const i=t.x.translate/e.x,a=t.y.translate/e.y,s=(r==null?void 0:r.z)||0;if((i||a||s)&&(n=`translate3d(${i}px, ${a}px, ${s}px) `),(e.x!==1||e.y!==1)&&(n+=`scale(${1/e.x}, ${1/e.y}) `),r){const{transformPerspective:u,rotate:h,rotateX:d,rotateY:f,skewX:p,skewY:g}=r;u&&(n=`perspective(${u}px) ${n}`),h&&(n+=`rotate(${h}deg) `),d&&(n+=`rotateX(${d}deg) `),f&&(n+=`rotateY(${f}deg) `),p&&(n+=`skewX(${p}deg) `),g&&(n+=`skewY(${g}deg) `)}const o=t.x.scale*e.x,l=t.y.scale*e.y;return(o!==1||l!==1)&&(n+=`scale(${o}, ${l})`),n||"none"}const Jw={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},p6=typeof window<"u"&&window.MotionDebug!==void 0,hle=["","X","Y","Z"],Hor={visibility:"hidden"},YGe=1e3;let Wor=0;function dle(t,e,r,n){const{latestValues:i}=e;i[t]&&(r[t]=i[t],e.setStaticValue(t,0),n&&(n[t]=0))}function qGe(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const r=aQe(e);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:i,layoutId:a}=t.options;window.MotionCancelOptimisedAnimation(r,"transform",Ya,!(i||a))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&qGe(n)}function jGe({attachResizeListener:t,defaultParent:e,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(s={},o=e==null?void 0:e()){this.id=Wor++,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,p6&&(Jw.totalNodes=Jw.resolvedTargetDeltas=Jw.recalculatedProjection=0),this.nodes.forEach(jor),this.nodes.forEach(elr),this.nodes.forEach(tlr),this.nodes.forEach(Xor),p6&&window.MotionDebug.record(Jw)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;t(s,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=Ior(f,250),UV.hasAnimatedSinceResize&&(UV.hasAnimatedSinceResize=!1,this.nodes.forEach(KGe))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&h&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:p,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||h.getDefaultTransition()||slr,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=h.getProps(),b=!this.targetLayout||!GGe(this.targetLayout,g)||p,x=!f&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||f&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,x);const w={...Eoe(m,"layout"),onPlay:v,onComplete:y};(h.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w)}else f||KGe(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Pb(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(rlr),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&qGe(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const A=w/1e3;ZGe(d.x,s.x,A),ZGe(d.y,s.y,A),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(d6(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),ilr(this.relativeTarget,this.relativeTargetOrigin,f,A),x&&Vor(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=Js()),Cf(x,this.relativeTarget)),m&&(this.animationValues=h,Nor(h,u,this.latestValues,A,b,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=A},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Pb(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ya.update(()=>{UV.hasAnimatedSinceResize=!0,this.currentAnimation=Ror(0,YGe,{...s,onUpdate:o=>{this.mixTargetDelta(o),s.onUpdate&&s.onUpdate(o)},onComplete:()=>{s.onComplete&&s.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 s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(YGe),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:o,target:l,layout:u,latestValues:h}=s;if(!(!o||!l||!u)){if(this!==s&&this.layout&&u&&nHe(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Js();const d=yd(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+d;const f=yd(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}Cf(o,l),aE(o,h),h6(this.projectionDeltaWithTransform,this.layoutCorrected,o,h)}}registerSharedNode(s,o){this.sharedNodes.has(s)||this.sharedNodes.set(s,new Qor),this.sharedNodes.get(s).add(o);const u=o.options.initialPromotionConfig;o.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(o):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var s;const{layoutId:o}=this.options;return o?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;const{layoutId:o}=this.options;return o?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:o,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let o=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(o=!0),!o)return;const u={};l.z&&dle("z",s,u,this.animationValues);for(let h=0;h{var o;return(o=s.currentAnimation)===null||o===void 0?void 0:o.stop()}),this.root.nodes.forEach(XGe),this.root.sharedNodes.clear()}}}function Yor(t){t.updateLayout()}function qor(t){var e;const r=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&r&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:a}=t.options,s=r.source!==t.layout.source;a==="size"?Tf(d=>{const f=s?r.measuredBox[d]:r.layoutBox[d],p=yd(f);f.min=n[d].min,f.max=f.min+p}):nHe(a,r.layoutBox,n)&&Tf(d=>{const f=s?r.measuredBox[d]:r.layoutBox[d],p=yd(n[d]);f.max=f.min+p,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[d].max=t.relativeTarget[d].min+p)});const o=nE();h6(o,n,r.layoutBox);const l=nE();s?h6(l,t.applyTransform(i,!0),r.measuredBox):h6(l,n,r.layoutBox);const u=!UGe(o);let h=!1;if(!t.resumeFrom){const d=t.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:p}=d;if(f&&p){const g=Js();d6(g,r.layoutBox,f.layoutBox);const m=Js();d6(m,n,p.layoutBox),GGe(g,m)||(h=!0),d.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=g,t.relativeParent=d)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:r,delta:l,layoutDelta:o,hasLayoutChanged:u,hasRelativeTargetChanged:h})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function jor(t){p6&&Jw.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Xor(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Kor(t){t.clearSnapshot()}function XGe(t){t.clearMeasurements()}function Zor(t){t.isLayoutDirty=!1}function Jor(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function KGe(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function elr(t){t.resolveTargetDelta()}function tlr(t){t.calcProjection()}function rlr(t){t.resetSkewAndRotation()}function nlr(t){t.removeLeadSnapshot()}function ZGe(t,e,r){t.translate=bs(e.translate,0,r),t.scale=bs(e.scale,1,r),t.origin=e.origin,t.originPoint=e.originPoint}function JGe(t,e,r,n){t.min=bs(e.min,r.min,n),t.max=bs(e.max,r.max,n)}function ilr(t,e,r,n){JGe(t.x,e.x,r.x,n),JGe(t.y,e.y,r.y,n)}function alr(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const slr={duration:.45,ease:[.4,0,.1,1]},eHe=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),tHe=eHe("applewebkit/")&&!eHe("chrome/")?Math.round:vd;function rHe(t){t.min=tHe(t.min),t.max=tHe(t.max)}function olr(t){rHe(t.x),rHe(t.y)}function nHe(t,e,r){return t==="position"||t==="preserve-aspect"&&!cor(HGe(e),HGe(r),.2)}function llr(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const clr=jGe({attachResizeListener:(t,e)=>l6(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),fle={current:void 0},iHe=jGe({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!fle.current){const t=new clr({});t.mount(window),t.setOptions({layoutScroll:!0}),fle.current=t}return fle.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),ulr={pan:{Feature:Oor},drag:{Feature:Cor,ProjectionNode:iHe,MeasureLayout:_Ge}};function hlr(t,e,r){var n;if(t instanceof Element)return[t];if(typeof t=="string"){let i=document;const a=(n=void 0)!==null&&n!==void 0?n:i.querySelectorAll(t);return a?Array.from(a):[]}return Array.from(t)}function aHe(t,e){const r=hlr(t),n=new AbortController,i={passive:!0,...e,signal:n.signal};return[r,i,()=>n.abort()]}function sHe(t){return e=>{e.pointerType==="touch"||tGe()||t(e)}}function dlr(t,e,r={}){const[n,i,a]=aHe(t,r),s=sHe(o=>{const{target:l}=o,u=e(o);if(typeof u!="function"||!l)return;const h=sHe(d=>{u(d),l.removeEventListener("pointerleave",h)});l.addEventListener("pointerleave",h,i)});return n.forEach(o=>{o.addEventListener("pointerenter",s,i)}),a}function oHe(t,e,r){const{props:n}=t;t.animationState&&n.whileHover&&t.animationState.setActive("whileHover",r==="Start");const i="onHover"+r,a=n[i];a&&Ya.postRender(()=>a(e,c6(e)))}class flr extends $b{mount(){const{current:e}=this.node;e&&(this.unmount=dlr(e,r=>(oHe(this.node,r,"Start"),n=>oHe(this.node,n,"End"))))}unmount(){}}class plr extends $b{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!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=o6(l6(this.node.current,"focus",()=>this.onFocus()),l6(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const lHe=(t,e)=>e?t===e?!0:lHe(t,e.parentElement):!1,glr=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function mlr(t){return glr.has(t.tagName)||t.tabIndex!==-1}const g6=new WeakSet;function cHe(t){return e=>{e.key==="Enter"&&t(e)}}function ple(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const vlr=(t,e)=>{const r=t.currentTarget;if(!r)return;const n=cHe(()=>{if(g6.has(r))return;ple(r,"down");const i=cHe(()=>{ple(r,"up")}),a=()=>ple(r,"cancel");r.addEventListener("keyup",i,e),r.addEventListener("blur",a,e)});r.addEventListener("keydown",n,e),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),e)};function uHe(t){return ile(t)&&!tGe()}function ylr(t,e,r={}){const[n,i,a]=aHe(t,r),s=o=>{const l=o.currentTarget;if(!uHe(o)||g6.has(l))return;g6.add(l);const u=e(o),h=(p,g)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),!(!uHe(p)||!g6.has(l))&&(g6.delete(l),typeof u=="function"&&u(p,{success:g}))},d=p=>{h(p,r.useGlobalTarget||lHe(l,p.target))},f=p=>{h(p,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",f,i)};return n.forEach(o=>{!mlr(o)&&o.getAttribute("tabindex")===null&&(o.tabIndex=0),(r.useGlobalTarget?window:o).addEventListener("pointerdown",s,i),o.addEventListener("focus",u=>vlr(u,i),i)}),a}function hHe(t,e,r){const{props:n}=t;t.animationState&&n.whileTap&&t.animationState.setActive("whileTap",r==="Start");const i="onTap"+(r==="End"?"":r),a=n[i];a&&Ya.postRender(()=>a(e,c6(e)))}class blr extends $b{mount(){const{current:e}=this.node;e&&(this.unmount=ylr(e,r=>(hHe(this.node,r,"Start"),(n,{success:i})=>hHe(this.node,n,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const gle=new WeakMap,mle=new WeakMap,xlr=t=>{const e=gle.get(t.target);e&&e(t)},wlr=t=>{t.forEach(xlr)};function Alr({root:t,...e}){const r=t||document;mle.has(r)||mle.set(r,{});const n=mle.get(r),i=JSON.stringify(e);return n[i]||(n[i]=new IntersectionObserver(wlr,{root:t,...e})),n[i]}function Slr(t,e,r){const n=Alr(e);return gle.set(t,r),n.observe(t),()=>{gle.delete(t),n.unobserve(t)}}const Tlr={some:0,all:1};class Clr extends $b{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:r,margin:n,amount:i="some",once:a}=e,s={root:r?r.current:void 0,rootMargin:n,threshold:typeof i=="number"?i:Tlr[i]},o=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:h,onViewportLeave:d}=this.node.getProps(),f=u?h:d;f&&f(l)};return Slr(this.node.current,s,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:r}=this.node;["amount","margin","root"].some(Olr(e,r))&&this.startObserver()}unmount(){}}function Olr({viewport:t={}},{viewport:e={}}={}){return r=>t[r]!==e[r]}const klr={inView:{Feature:Clr},tap:{Feature:blr},focus:{Feature:plr},hover:{Feature:flr}},Elr={layout:{ProjectionNode:iHe,MeasureLayout:_Ge}},vle={current:null},dHe={current:!1};function _lr(){if(dHe.current=!0,!!doe)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>vle.current=t.matches;t.addListener(e),e()}else vle.current=!1}const Rlr=[...IQe,Rc,Bb],Dlr=t=>Rlr.find(MQe(t)),fHe=new WeakMap;function Llr(t,e,r){for(const n in e){const i=e[n],a=r[n];if(_c(i))t.addValue(n,i);else if(_c(a))t.addValue(n,r6(i,{owner:t}));else if(a!==i)if(t.hasValue(n)){const s=t.getValue(n);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=t.getStaticValue(n);t.addValue(n,r6(s!==void 0?s:i,{owner:t}))}}for(const n in r)e[n]===void 0&&t.removeValue(n);return e}const pHe=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Mlr{scrapeMotionValuesFromProps(e,r,n){return{}}constructor({parent:e,props:r,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:a,visualState:s},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Yoe,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=Xg.now();this.renderScheduledAtthis.bindToMotionValue(n,r)),dHe.current||_lr(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:vle.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){fHe.delete(this.current),this.projection&&this.projection.unmount(),Pb(this.notifyUpdate),Pb(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const r=this.features[e];r&&(r.unmount(),r.isMounted=!1)}this.current=null}bindToMotionValue(e,r){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const n=qw.has(e),i=r.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&Ya.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),a=r.on("renderRequest",this.scheduleRender);let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,e,r)),this.valueSubscriptions.set(e,()=>{i(),a(),s&&s(),r.owner&&r.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Xk){const r=Xk[e];if(!r)continue;const{isEnabled:n,Feature:i}=r;if(!this.features[e]&&i&&n(this.props)&&(this.features[e]=new i(this)),this.features[e]){const a=this.features[e];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Js()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,r){this.latestValues[e]=r}update(e,r){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;nr.variantChildren.delete(e)}addValue(e,r){const n=this.values.get(e);r!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,r),this.values.set(e,r),this.latestValues[e]=r.get())}removeValue(e){this.values.delete(e);const r=this.valueSubscriptions.get(e);r&&(r(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,r){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&r!==void 0&&(n=r6(r===null?void 0:r,{owner:this}),this.addValue(e,n)),n}readValue(e,r){var n;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(n=this.getBaseTargetFromProps(this.props,e))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(DQe(i)||yQe(i))?i=parseFloat(i):!Dlr(i)&&Bb.test(r)&&(i=CQe(e,r)),this.setBaseTarget(e,_c(i)?i.get():i)),_c(i)?i.get():i}setBaseTarget(e,r){this.baseTarget[e]=r}getBaseTarget(e){var r;const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const s=boe(this.props,n,(r=this.presenceContext)===null||r===void 0?void 0:r.custom);s&&(i=s[e])}if(n&&i!==void 0)return i;const a=this.getBaseTargetFromProps(this.props,e);return a!==void 0&&!_c(a)?a:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,r){return this.events[e]||(this.events[e]=new Doe),this.events[e].add(r)}notify(e,...r){this.events[e]&&this.events[e].notify(...r)}}class gHe extends Mlr{constructor(){super(...arguments),this.KeyframeResolver=NQe}sortInstanceNodePosition(e,r){return e.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(e,r){return e.style?e.style[r]:void 0}removeValueFromRenderState(e,{vars:r,style:n}){delete r[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;_c(e)&&(this.childSubscription=e.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}function Ilr(t){return window.getComputedStyle(t)}class Plr extends gHe{constructor(){super(...arguments),this.type="html",this.renderInstance=qVe}readValueFromInstance(e,r){if(qw.has(r)){const n=Goe(r);return n&&n.default||0}else{const n=Ilr(e),i=(VVe(r)?n.getPropertyValue(r):n[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:r}){return CGe(e,r)}build(e,r,n){Soe(e,r,n.transformTemplate)}scrapeMotionValuesFromProps(e,r,n){return koe(e,r,n)}}class Nlr extends gHe{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Js}getBaseTargetFromProps(e,r){return e[r]}readValueFromInstance(e,r){if(qw.has(r)){const n=Goe(r);return n&&n.default||0}return r=jVe.has(r)?r:moe(r),e.getAttribute(r)}scrapeMotionValuesFromProps(e,r,n){return ZVe(e,r,n)}build(e,r,n){Toe(e,r,this.isSVGTag,n.transformTemplate)}renderInstance(e,r,n,i){XVe(e,r,n,i)}mount(e){this.isSVGTag=Ooe(e.tagName),super.mount(e)}}const Blr=(t,e)=>yoe(t)?new Nlr(e):new Plr(e,{allowProjection:t!==se.Fragment}),$lr=lar({...Jsr,...klr,...ulr,...Elr},Blr),eA=Tir($lr),Flr={formatDate(t){const e=t.value??t.date??t.timestamp;if(e==null)return"";const r=new Date(e);return isNaN(r.getTime())?String(e):r.toLocaleString()}};function zlr(t,e){if(!e||e==="/")return t;const r=e.replace(/^\//,"").split("/").map(i=>i.replace(/~1/g,"/").replace(/~0/g,"~"));let n=t;for(const i of r){if(n==null||typeof n!="object")return;n=n[i]}return n}function Ulr(t){return typeof t=="object"&&t!==null&&typeof t.path=="string"}function Vlr(t){return typeof t=="object"&&t!==null&&typeof t.call=="string"}function yle(t,e){if(Ulr(t))return zlr(e,t.path);if(Vlr(t)){const r=Flr[t.call],n={};for(const[i,a]of Object.entries(t.args??{}))n[i]=yle(a,e);return r?r(n):`[unknown fn: ${t.call}]`}return t}function Qlr(t,e){const r=yle(t,e);return r==null?"":typeof r=="string"?r:String(r)}const Glr=new Map;function Hlr(t){return Glr.get(t)}function Wlr(t,e,r){const n=e.replace(/^\//,"").split("/").map(a=>a.replace(/~1/g,"/").replace(/~0/g,"~"));let i=t;for(let a=0;ayle(n,t.dataModel),resolveString:n=>Qlr(n,t.dataModel),dispatchAction:e,render:n=>{if(!n)return null;const i=t.components[n];if(!i)return null;const a=Hlr(i.component)??qlr;return W.jsx(a,{node:i,ctx:r},n)}};return W.jsx("div",{className:"a2ui-surface","data-a2ui-surface":t.surfaceId,children:r.render(t.rootId)})}function Xlr(t){const e=se.useRef(null),r=se.useRef(!0),n=28,i=se.useCallback(()=>{const a=e.current;a&&(r.current=a.scrollHeight-a.scrollTop-a.clientHeight{const a=e.current;a&&r.current&&(a.scrollTop=a.scrollHeight)},[t]),{ref:e,onScroll:i}}function qri(){}function jri(){}function mHe(t){const e=[],r=String(t||"");let n=r.indexOf(","),i=0,a=!1;for(;!a;){n===-1&&(n=r.length,a=!0);const s=r.slice(i,n).trim();(s||!a)&&e.push(s),i=n+1,n=r.indexOf(",",i)}return e}function vHe(t,e){const r={};return(t[t.length-1]===""?[...t,""]:t).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const Klr=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Zlr=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Jlr={};function yHe(t,e){return(Jlr.jsx?Zlr:Klr).test(t)}const ecr=/[ \t\n\f\r]/g;function tcr(t){return typeof t=="object"?t.type==="text"?bHe(t.value):!1:bHe(t)}function bHe(t){return t.replace(ecr,"")===""}let m6=class{constructor(e,r,n){this.normal=r,this.property=e,n&&(this.space=n)}};m6.prototype.normal={},m6.prototype.property={},m6.prototype.space=void 0;function xHe(t,e){const r={},n={};for(const i of t)Object.assign(r,i.property),Object.assign(n,i.normal);return new m6(r,n,e)}function v6(t){return t.toLowerCase()}let xh=class{constructor(e,r){this.attribute=r,this.property=e}};xh.prototype.attribute="",xh.prototype.booleanish=!1,xh.prototype.boolean=!1,xh.prototype.commaOrSpaceSeparated=!1,xh.prototype.commaSeparated=!1,xh.prototype.defined=!1,xh.prototype.mustUseProperty=!1,xh.prototype.number=!1,xh.prototype.overloadedBoolean=!1,xh.prototype.property="",xh.prototype.spaceSeparated=!1,xh.prototype.space=void 0;let rcr=0;const Qn=tA(),xo=tA(),ble=tA(),rr=tA(),_a=tA(),sE=tA(),bd=tA();function tA(){return 2**++rcr}const xle=Object.freeze(Object.defineProperty({__proto__:null,boolean:Qn,booleanish:xo,commaOrSpaceSeparated:bd,commaSeparated:sE,number:rr,overloadedBoolean:ble,spaceSeparated:_a},Symbol.toStringTag,{value:"Module"})),wle=Object.keys(xle);class Ale extends xh{constructor(e,r,n,i){let a=-1;if(super(e,r),wHe(this,"space",i),typeof n=="number")for(;++a4&&r.slice(0,4)==="data"&&ocr.test(e)){if(e.charAt(4)==="-"){const a=e.slice(5).replace(EHe,ccr);n="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=e.slice(4);if(!EHe.test(a)){let s=a.replace(scr,lcr);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}i=Ale}return new i(n,e)}function lcr(t){return"-"+t.toLowerCase()}function ccr(t){return t.charAt(1).toUpperCase()}const y6=xHe([AHe,ncr,CHe,OHe,kHe],"html"),Fb=xHe([AHe,icr,CHe,OHe,kHe],"svg");function _He(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function RHe(t){return t.join(" ").trim()}var Sle={},DHe=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ucr=/\n/g,hcr=/^\s*/,dcr=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,fcr=/^:\s*/,pcr=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,gcr=/^[;\s]*/,mcr=/^\s+|\s+$/g,vcr=` +`,LHe="/",MHe="*",rA="",ycr="comment",bcr="declaration";function xcr(t,e){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var r=1,n=1;function i(g){var m=g.match(ucr);m&&(r+=m.length);var v=g.lastIndexOf(vcr);n=~v?g.length-v:n+g.length}function a(){var g={line:r,column:n};return function(m){return m.position=new s(g),u(),m}}function s(g){this.start=g,this.end={line:r,column:n},this.source=e.source}s.prototype.content=t;function o(g){var m=new Error(e.source+":"+r+":"+n+": "+g);if(m.reason=g,m.filename=e.source,m.line=r,m.column=n,m.source=t,!e.silent)throw m}function l(g){var m=g.exec(t);if(m){var v=m[0];return i(v),t=t.slice(v.length),m}}function u(){l(hcr)}function h(g){var m;for(g=g||[];m=d();)m!==!1&&g.push(m);return g}function d(){var g=a();if(!(LHe!=t.charAt(0)||MHe!=t.charAt(1))){for(var m=2;rA!=t.charAt(m)&&(MHe!=t.charAt(m)||LHe!=t.charAt(m+1));)++m;if(m+=2,rA===t.charAt(m-1))return o("End of comment missing");var v=t.slice(2,m-2);return n+=2,i(v),t=t.slice(m),n+=2,g({type:ycr,comment:v})}}function f(){var g=a(),m=l(dcr);if(m){if(d(),!l(fcr))return o("property missing ':'");var v=l(pcr),y=g({type:bcr,property:IHe(m[0].replace(DHe,rA)),value:v?IHe(v[0].replace(DHe,rA)):rA});return l(gcr),y}}function p(){var g=[];h(g);for(var m;m=f();)m!==!1&&(g.push(m),h(g));return g}return u(),p()}function IHe(t){return t?t.replace(mcr,rA):rA}var wcr=xcr,Acr=xi&&xi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Sle,"__esModule",{value:!0}),Sle.default=Tcr;const Scr=Acr(wcr);function Tcr(t,e){let r=null;if(!t||typeof t!="string")return r;const n=(0,Scr.default)(t),i=typeof e=="function";return n.forEach(a=>{if(a.type!=="declaration")return;const{property:s,value:o}=a;i?e(s,o,a):o&&(r=r||{},r[s]=o)}),r}var QV={};Object.defineProperty(QV,"__esModule",{value:!0}),QV.camelCase=void 0;var Ccr=/^--[a-zA-Z0-9_-]+$/,Ocr=/-([a-z])/g,kcr=/^[^-]+$/,Ecr=/^-(webkit|moz|ms|o|khtml)-/,_cr=/^-(ms)-/,Rcr=function(t){return!t||kcr.test(t)||Ccr.test(t)},Dcr=function(t,e){return e.toUpperCase()},PHe=function(t,e){return"".concat(e,"-")},Lcr=function(t,e){return e===void 0&&(e={}),Rcr(t)?t:(t=t.toLowerCase(),e.reactCompat?t=t.replace(_cr,PHe):t=t.replace(Ecr,PHe),t.replace(Ocr,Dcr))};QV.camelCase=Lcr;var Mcr=xi&&xi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Icr=Mcr(Sle),Pcr=QV;function Tle(t,e){var r={};return!t||typeof t!="string"||(0,Icr.default)(t,function(n,i){n&&i&&(r[(0,Pcr.camelCase)(n,e)]=i)}),r}Tle.default=Tle;var Ncr=Tle;const Bcr=uh(Ncr),GV=NHe("end"),Kg=NHe("start");function NHe(t){return e;function e(r){const n=r&&r.position&&r.position[t]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function $cr(t){const e=Kg(t),r=GV(t);if(e&&r)return{start:e,end:r}}function b6(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?BHe(t.position):"start"in t||"end"in t?BHe(t):"line"in t||"column"in t?Cle(t):""}function Cle(t){return $He(t&&t.line)+":"+$He(t&&t.column)}function BHe(t){return Cle(t&&t.start)+"-"+Cle(t&&t.end)}function $He(t){return t&&typeof t=="number"?t:1}class Dc extends Error{constructor(e,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let i="",a={},s=!1;if(r&&("line"in r&&"column"in r?a={place:r}:"start"in r&&"end"in r?a={place:r}:"type"in r?a={ancestors:[r],place:r.position}:a={...r}),typeof e=="string"?i=e:!a.cause&&e&&(s=!0,i=e.message,a.cause=e),!a.ruleId&&!a.source&&typeof n=="string"){const l=n.indexOf(":");l===-1?a.ruleId=n:(a.source=n.slice(0,l),a.ruleId=n.slice(l+1))}if(!a.place&&a.ancestors&&a.ancestors){const l=a.ancestors[a.ancestors.length-1];l&&(a.place=l.position)}const o=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=b6(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=s&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Dc.prototype.file="",Dc.prototype.name="",Dc.prototype.reason="",Dc.prototype.message="",Dc.prototype.stack="",Dc.prototype.column=void 0,Dc.prototype.line=void 0,Dc.prototype.ancestors=void 0,Dc.prototype.cause=void 0,Dc.prototype.fatal=void 0,Dc.prototype.place=void 0,Dc.prototype.ruleId=void 0,Dc.prototype.source=void 0;const Ole={}.hasOwnProperty,Fcr=new Map,zcr=/[A-Z]/g,Ucr=new Set(["table","tbody","thead","tfoot","tr"]),Vcr=new Set(["td","th"]),FHe="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Qcr(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=e.filePath||void 0;let n;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=Kcr(r,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=Xcr(r,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:n,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Fb:y6,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},a=zHe(i,t,void 0);return a&&typeof a!="string"?a:i.create(t,i.Fragment,{children:a||void 0},void 0)}function zHe(t,e,r){if(e.type==="element")return Gcr(t,e,r);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return Hcr(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Ycr(t,e,r);if(e.type==="mdxjsEsm")return Wcr(t,e);if(e.type==="root")return qcr(t,e,r);if(e.type==="text")return jcr(t,e)}function Gcr(t,e,r){const n=t.schema;let i=n;e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(i=Fb,t.schema=i),t.ancestors.push(e);const a=VHe(t,e.tagName,!1),s=Zcr(t,e);let o=Ele(t,e);return Ucr.has(e.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!tcr(l):!0})),UHe(t,s,a,e),kle(s,o),t.ancestors.pop(),t.schema=n,t.create(e,a,s,r)}function Hcr(t,e){if(e.data&&e.data.estree&&t.evaluater){const n=e.data.estree.body[0];return n.type,t.evaluater.evaluateExpression(n.expression)}x6(t,e.position)}function Wcr(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);x6(t,e.position)}function Ycr(t,e,r){const n=t.schema;let i=n;e.name==="svg"&&n.space==="html"&&(i=Fb,t.schema=i),t.ancestors.push(e);const a=e.name===null?t.Fragment:VHe(t,e.name,!0),s=Jcr(t,e),o=Ele(t,e);return UHe(t,s,a,e),kle(s,o),t.ancestors.pop(),t.schema=n,t.create(e,a,s,r)}function qcr(t,e,r){const n={};return kle(n,Ele(t,e)),t.create(e,t.Fragment,n,r)}function jcr(t,e){return e.value}function UHe(t,e,r,n){typeof r!="string"&&r!==t.Fragment&&t.passNode&&(e.node=n)}function kle(t,e){if(e.length>0){const r=e.length>1?e:e[0];r&&(t.children=r)}}function Xcr(t,e,r){return n;function n(i,a,s,o){const u=Array.isArray(s.children)?r:e;return o?u(a,s,o):u(a,s)}}function Kcr(t,e){return r;function r(n,i,a,s){const o=Array.isArray(a.children),l=Kg(n);return e(i,a,s,o,{columnNumber:l?l.column-1:void 0,fileName:t,lineNumber:l?l.line:void 0},void 0)}}function Zcr(t,e){const r={};let n,i;for(i in e.properties)if(i!=="children"&&Ole.call(e.properties,i)){const a=eur(t,i,e.properties[i]);if(a){const[s,o]=a;t.tableCellAlignToStyle&&s==="align"&&typeof o=="string"&&Vcr.has(e.tagName)?n=o:r[s]=o}}if(n){const a=r.style||(r.style={});a[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return r}function Jcr(t,e){const r={};for(const n of e.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&t.evaluater){const a=n.data.estree.body[0];a.type;const s=a.expression;s.type;const o=s.properties[0];o.type,Object.assign(r,t.evaluater.evaluateExpression(o.argument))}else x6(t,e.position);else{const i=n.name;let a;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&t.evaluater){const o=n.value.data.estree.body[0];o.type,a=t.evaluater.evaluateExpression(o.expression)}else x6(t,e.position);else a=n.value===null?!0:n.value;r[i]=a}return r}function Ele(t,e){const r=[];let n=-1;const i=t.passKeys?new Map:Fcr;for(;++ni?0:i+e:e=e>i?i:e,r=r>0?r:0,n.length<1e4)s=Array.from(n),s.unshift(e,r),t.splice(...s);else for(r&&t.splice(e,r);a0?(xd(t,t.length,0,e),t):e}const WHe={}.hasOwnProperty;function YHe(t){const e={};let r=-1;for(;++r13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function Ip(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const pu=zb(/[A-Za-z]/),Lc=zb(/[\dA-Za-z]/),cur=zb(/[#-'*+\--9=?A-Z^-~]/);function HV(t){return t!==null&&(t<32||t===127)}const Lle=zb(/\d/),uur=zb(/[\dA-Fa-f]/),hur=zb(/[!-/:-@[-`{-~]/);function Zr(t){return t!==null&&t<-2}function ba(t){return t!==null&&(t<0||t===32)}function di(t){return t===-2||t===-1||t===32}const WV=zb(new RegExp("\\p{P}|\\p{S}","u")),nA=zb(/\s/);function zb(t){return e;function e(r){return r!==null&&r>-1&&t.test(String.fromCharCode(r))}}function lE(t){const e=[];let r=-1,n=0,i=0;for(;++r55295&&a<57344){const o=t.charCodeAt(r+1);a<56320&&o>56319&&o<57344?(s=String.fromCharCode(a,o),i=1):s="�"}else s=String.fromCharCode(a);s&&(e.push(t.slice(n,r),encodeURIComponent(s)),n=r+i+1,s=""),i&&(r+=i,i=0)}return e.join("")+t.slice(n)}function ki(t,e,r,n){const i=n?n-1:Number.POSITIVE_INFINITY;let a=0;return s;function s(l){return di(l)?(t.enter(r),o(l)):e(l)}function o(l){return di(l)&&a++s))return;const T=e.events.length;let O=T,k,E;for(;O--;)if(e.events[O][0]==="exit"&&e.events[O][1].type==="chunkFlow"){if(k){E=e.events[O][1].end;break}k=!0}for(y(n),S=T;Sx;){const A=r[w];e.containerState=A[1],A[0].exit.call(e,t)}r.length=x}function b(){i.write([null]),a=void 0,i=void 0,e.containerState._closeFlow=void 0}}function mur(t,e,r){return ki(t,t.attempt(this.parser.constructs.document,e,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function cE(t){if(t===null||ba(t)||nA(t))return 1;if(WV(t))return 2}function YV(t,e,r){const n=[];let i=-1;for(;++i1&&t[r][1].end.offset-t[r][1].start.offset>1?2:1;const d={...t[n][1].end},f={...t[r][1].start};XHe(d,-l),XHe(f,l),s={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...t[n][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...t[r][1].start},end:f},a={type:l>1?"strongText":"emphasisText",start:{...t[n][1].end},end:{...t[r][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...o.end}},t[n][1].end={...s.start},t[r][1].start={...o.end},u=[],t[n][1].end.offset-t[n][1].start.offset&&(u=Of(u,[["enter",t[n][1],e],["exit",t[n][1],e]])),u=Of(u,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",a,e]]),u=Of(u,YV(e.parser.constructs.insideSpan.null,t.slice(n+1,r),e)),u=Of(u,[["exit",a,e],["enter",o,e],["exit",o,e],["exit",i,e]]),t[r][1].end.offset-t[r][1].start.offset?(h=2,u=Of(u,[["enter",t[r][1],e],["exit",t[r][1],e]])):h=0,xd(t,n-1,r-n+3,u),r=n+u.length-h-2;break}}for(r=-1;++r0&&di(S)?ki(t,b,"linePrefix",a+1)(S):b(S)}function b(S){return S===null||Zr(S)?t.check(eWe,m,w)(S):(t.enter("codeFlowValue"),x(S))}function x(S){return S===null||Zr(S)?(t.exit("codeFlowValue"),b(S)):(t.consume(S),x)}function w(S){return t.exit("codeFenced"),e(S)}function A(S,T,O){let k=0;return E;function E(D){return S.enter("lineEnding"),S.consume(D),S.exit("lineEnding"),_}function _(D){return S.enter("codeFencedFence"),di(D)?ki(S,I,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):I(D)}function I(D){return D===o?(S.enter("codeFencedFenceSequence"),L(D)):O(D)}function L(D){return D===o?(k++,S.consume(D),L):k>=s?(S.exit("codeFencedFenceSequence"),di(D)?ki(S,R,"whitespace")(D):R(D)):O(D)}function R(D){return D===null||Zr(D)?(S.exit("codeFencedFence"),T(D)):O(D)}}}function Eur(t,e,r){const n=this;return i;function i(s){return s===null?r(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),a)}function a(s){return n.parser.lazy[n.now().line]?r(s):e(s)}}const Ile={name:"codeIndented",tokenize:Rur},_ur={partial:!0,tokenize:Dur};function Rur(t,e,r){const n=this;return i;function i(u){return t.enter("codeIndented"),ki(t,a,"linePrefix",5)(u)}function a(u){const h=n.events[n.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?s(u):r(u)}function s(u){return u===null?l(u):Zr(u)?t.attempt(_ur,s,l)(u):(t.enter("codeFlowValue"),o(u))}function o(u){return u===null||Zr(u)?(t.exit("codeFlowValue"),s(u)):(t.consume(u),o)}function l(u){return t.exit("codeIndented"),e(u)}}function Dur(t,e,r){const n=this;return i;function i(s){return n.parser.lazy[n.now().line]?r(s):Zr(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i):ki(t,a,"linePrefix",5)(s)}function a(s){const o=n.events[n.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(s):Zr(s)?i(s):r(s)}}const Lur={name:"codeText",previous:Iur,resolve:Mur,tokenize:Pur};function Mur(t){let e=t.length-4,r=3,n,i;if((t[r][1].type==="lineEnding"||t[r][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(n=r;++n=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,r,n){const i=r||0;this.setCursor(Math.trunc(e));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return n&&A6(this.left,n),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),A6(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),A6(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e=4?e(s):t.interrupt(n.parser.constructs.flow,r,e)(s)}}function nWe(t,e,r,n,i,a,s,o,l){const u=l||Number.POSITIVE_INFINITY;let h=0;return d;function d(y){return y===60?(t.enter(n),t.enter(i),t.enter(a),t.consume(y),t.exit(a),f):y===null||y===32||y===41||HV(y)?r(y):(t.enter(n),t.enter(s),t.enter(o),t.enter("chunkString",{contentType:"string"}),m(y))}function f(y){return y===62?(t.enter(a),t.consume(y),t.exit(a),t.exit(i),t.exit(n),e):(t.enter(o),t.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(t.exit("chunkString"),t.exit(o),f(y)):y===null||y===60||Zr(y)?r(y):(t.consume(y),y===92?g:p)}function g(y){return y===60||y===62||y===92?(t.consume(y),p):p(y)}function m(y){return!h&&(y===null||y===41||ba(y))?(t.exit("chunkString"),t.exit(o),t.exit(s),t.exit(n),e(y)):h999||p===null||p===91||p===93&&!l||p===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?r(p):p===93?(t.exit(a),t.enter(i),t.consume(p),t.exit(i),t.exit(n),e):Zr(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),h):(t.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||Zr(p)||o++>999?(t.exit("chunkString"),h(p)):(t.consume(p),l||(l=!di(p)),p===92?f:d)}function f(p){return p===91||p===92||p===93?(t.consume(p),o++,d):d(p)}}function aWe(t,e,r,n,i,a){let s;return o;function o(f){return f===34||f===39||f===40?(t.enter(n),t.enter(i),t.consume(f),t.exit(i),s=f===40?41:f,l):r(f)}function l(f){return f===s?(t.enter(i),t.consume(f),t.exit(i),t.exit(n),e):(t.enter(a),u(f))}function u(f){return f===s?(t.exit(a),l(s)):f===null?r(f):Zr(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),ki(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===s||f===null||Zr(f)?(t.exit("chunkString"),u(f)):(t.consume(f),f===92?d:h)}function d(f){return f===s||f===92?(t.consume(f),h):h(f)}}function S6(t,e){let r;return n;function n(i){return Zr(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),r=!0,n):di(i)?ki(t,n,r?"linePrefix":"lineSuffix")(i):e(i)}}const Qur={name:"definition",tokenize:Hur},Gur={partial:!0,tokenize:Wur};function Hur(t,e,r){const n=this;let i;return a;function a(p){return t.enter("definition"),s(p)}function s(p){return iWe.call(n,t,o,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function o(p){return i=Ip(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),p===58?(t.enter("definitionMarker"),t.consume(p),t.exit("definitionMarker"),l):r(p)}function l(p){return ba(p)?S6(t,u)(p):u(p)}function u(p){return nWe(t,h,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function h(p){return t.attempt(Gur,d,d)(p)}function d(p){return di(p)?ki(t,f,"whitespace")(p):f(p)}function f(p){return p===null||Zr(p)?(t.exit("definition"),n.parser.defined.push(i),e(p)):r(p)}}function Wur(t,e,r){return n;function n(o){return ba(o)?S6(t,i)(o):r(o)}function i(o){return aWe(t,a,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function a(o){return di(o)?ki(t,s,"whitespace")(o):s(o)}function s(o){return o===null||Zr(o)?e(o):r(o)}}const Yur={name:"hardBreakEscape",tokenize:qur};function qur(t,e,r){return n;function n(a){return t.enter("hardBreakEscape"),t.consume(a),i}function i(a){return Zr(a)?(t.exit("hardBreakEscape"),e(a)):r(a)}}const jur={name:"headingAtx",resolve:Xur,tokenize:Kur};function Xur(t,e){let r=t.length-2,n=3,i,a;return t[n][1].type==="whitespace"&&(n+=2),r-2>n&&t[r][1].type==="whitespace"&&(r-=2),t[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&t[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(i={type:"atxHeadingText",start:t[n][1].start,end:t[r][1].end},a={type:"chunkText",start:t[n][1].start,end:t[r][1].end,contentType:"text"},xd(t,n,r-n+1,[["enter",i,e],["enter",a,e],["exit",a,e],["exit",i,e]])),t}function Kur(t,e,r){let n=0;return i;function i(h){return t.enter("atxHeading"),a(h)}function a(h){return t.enter("atxHeadingSequence"),s(h)}function s(h){return h===35&&n++<6?(t.consume(h),s):h===null||ba(h)?(t.exit("atxHeadingSequence"),o(h)):r(h)}function o(h){return h===35?(t.enter("atxHeadingSequence"),l(h)):h===null||Zr(h)?(t.exit("atxHeading"),e(h)):di(h)?ki(t,o,"whitespace")(h):(t.enter("atxHeadingText"),u(h))}function l(h){return h===35?(t.consume(h),l):(t.exit("atxHeadingSequence"),o(h))}function u(h){return h===null||h===35||ba(h)?(t.exit("atxHeadingText"),o(h)):(t.consume(h),u)}}const Zur=["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"],sWe=["pre","script","style","textarea"],Jur={concrete:!0,name:"htmlFlow",resolveTo:rhr,tokenize:nhr},ehr={partial:!0,tokenize:ahr},thr={partial:!0,tokenize:ihr};function rhr(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function nhr(t,e,r){const n=this;let i,a,s,o,l;return u;function u(U){return h(U)}function h(U){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(U),d}function d(U){return U===33?(t.consume(U),f):U===47?(t.consume(U),a=!0,m):U===63?(t.consume(U),i=3,n.interrupt?e:B):pu(U)?(t.consume(U),s=String.fromCharCode(U),v):r(U)}function f(U){return U===45?(t.consume(U),i=2,p):U===91?(t.consume(U),i=5,o=0,g):pu(U)?(t.consume(U),i=4,n.interrupt?e:B):r(U)}function p(U){return U===45?(t.consume(U),n.interrupt?e:B):r(U)}function g(U){const Q="CDATA[";return U===Q.charCodeAt(o++)?(t.consume(U),o===Q.length?n.interrupt?e:I:g):r(U)}function m(U){return pu(U)?(t.consume(U),s=String.fromCharCode(U),v):r(U)}function v(U){if(U===null||U===47||U===62||ba(U)){const Q=U===47,G=s.toLowerCase();return!Q&&!a&&sWe.includes(G)?(i=1,n.interrupt?e(U):I(U)):Zur.includes(s.toLowerCase())?(i=6,Q?(t.consume(U),y):n.interrupt?e(U):I(U)):(i=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(U):a?b(U):x(U))}return U===45||Lc(U)?(t.consume(U),s+=String.fromCharCode(U),v):r(U)}function y(U){return U===62?(t.consume(U),n.interrupt?e:I):r(U)}function b(U){return di(U)?(t.consume(U),b):E(U)}function x(U){return U===47?(t.consume(U),E):U===58||U===95||pu(U)?(t.consume(U),w):di(U)?(t.consume(U),x):E(U)}function w(U){return U===45||U===46||U===58||U===95||Lc(U)?(t.consume(U),w):A(U)}function A(U){return U===61?(t.consume(U),S):di(U)?(t.consume(U),A):x(U)}function S(U){return U===null||U===60||U===61||U===62||U===96?r(U):U===34||U===39?(t.consume(U),l=U,T):di(U)?(t.consume(U),S):O(U)}function T(U){return U===l?(t.consume(U),l=null,k):U===null||Zr(U)?r(U):(t.consume(U),T)}function O(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||ba(U)?A(U):(t.consume(U),O)}function k(U){return U===47||U===62||di(U)?x(U):r(U)}function E(U){return U===62?(t.consume(U),_):r(U)}function _(U){return U===null||Zr(U)?I(U):di(U)?(t.consume(U),_):r(U)}function I(U){return U===45&&i===2?(t.consume(U),M):U===60&&i===1?(t.consume(U),P):U===62&&i===4?(t.consume(U),V):U===63&&i===3?(t.consume(U),B):U===93&&i===5?(t.consume(U),F):Zr(U)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(ehr,z,L)(U)):U===null||Zr(U)?(t.exit("htmlFlowData"),L(U)):(t.consume(U),I)}function L(U){return t.check(thr,R,z)(U)}function R(U){return t.enter("lineEnding"),t.consume(U),t.exit("lineEnding"),D}function D(U){return U===null||Zr(U)?L(U):(t.enter("htmlFlowData"),I(U))}function M(U){return U===45?(t.consume(U),B):I(U)}function P(U){return U===47?(t.consume(U),s="",N):I(U)}function N(U){if(U===62){const Q=s.toLowerCase();return sWe.includes(Q)?(t.consume(U),V):I(U)}return pu(U)&&s.length<8?(t.consume(U),s+=String.fromCharCode(U),N):I(U)}function F(U){return U===93?(t.consume(U),B):I(U)}function B(U){return U===62?(t.consume(U),V):U===45&&i===2?(t.consume(U),B):I(U)}function V(U){return U===null||Zr(U)?(t.exit("htmlFlowData"),z(U)):(t.consume(U),V)}function z(U){return t.exit("htmlFlow"),e(U)}}function ihr(t,e,r){const n=this;return i;function i(s){return Zr(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),a):r(s)}function a(s){return n.parser.lazy[n.now().line]?r(s):e(s)}}function ahr(t,e,r){return n;function n(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(w6,e,r)}}const shr={name:"htmlText",tokenize:ohr};function ohr(t,e,r){const n=this;let i,a,s;return o;function o(B){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(B),l}function l(B){return B===33?(t.consume(B),u):B===47?(t.consume(B),A):B===63?(t.consume(B),x):pu(B)?(t.consume(B),O):r(B)}function u(B){return B===45?(t.consume(B),h):B===91?(t.consume(B),a=0,g):pu(B)?(t.consume(B),b):r(B)}function h(B){return B===45?(t.consume(B),p):r(B)}function d(B){return B===null?r(B):B===45?(t.consume(B),f):Zr(B)?(s=d,P(B)):(t.consume(B),d)}function f(B){return B===45?(t.consume(B),p):d(B)}function p(B){return B===62?M(B):B===45?f(B):d(B)}function g(B){const V="CDATA[";return B===V.charCodeAt(a++)?(t.consume(B),a===V.length?m:g):r(B)}function m(B){return B===null?r(B):B===93?(t.consume(B),v):Zr(B)?(s=m,P(B)):(t.consume(B),m)}function v(B){return B===93?(t.consume(B),y):m(B)}function y(B){return B===62?M(B):B===93?(t.consume(B),y):m(B)}function b(B){return B===null||B===62?M(B):Zr(B)?(s=b,P(B)):(t.consume(B),b)}function x(B){return B===null?r(B):B===63?(t.consume(B),w):Zr(B)?(s=x,P(B)):(t.consume(B),x)}function w(B){return B===62?M(B):x(B)}function A(B){return pu(B)?(t.consume(B),S):r(B)}function S(B){return B===45||Lc(B)?(t.consume(B),S):T(B)}function T(B){return Zr(B)?(s=T,P(B)):di(B)?(t.consume(B),T):M(B)}function O(B){return B===45||Lc(B)?(t.consume(B),O):B===47||B===62||ba(B)?k(B):r(B)}function k(B){return B===47?(t.consume(B),M):B===58||B===95||pu(B)?(t.consume(B),E):Zr(B)?(s=k,P(B)):di(B)?(t.consume(B),k):M(B)}function E(B){return B===45||B===46||B===58||B===95||Lc(B)?(t.consume(B),E):_(B)}function _(B){return B===61?(t.consume(B),I):Zr(B)?(s=_,P(B)):di(B)?(t.consume(B),_):k(B)}function I(B){return B===null||B===60||B===61||B===62||B===96?r(B):B===34||B===39?(t.consume(B),i=B,L):Zr(B)?(s=I,P(B)):di(B)?(t.consume(B),I):(t.consume(B),R)}function L(B){return B===i?(t.consume(B),i=void 0,D):B===null?r(B):Zr(B)?(s=L,P(B)):(t.consume(B),L)}function R(B){return B===null||B===34||B===39||B===60||B===61||B===96?r(B):B===47||B===62||ba(B)?k(B):(t.consume(B),R)}function D(B){return B===47||B===62||ba(B)?k(B):r(B)}function M(B){return B===62?(t.consume(B),t.exit("htmlTextData"),t.exit("htmlText"),e):r(B)}function P(B){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(B),t.exit("lineEnding"),N}function N(B){return di(B)?ki(t,F,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):F(B)}function F(B){return t.enter("htmlTextData"),s(B)}}const Ple={name:"labelEnd",resolveAll:hhr,resolveTo:dhr,tokenize:fhr},lhr={tokenize:phr},chr={tokenize:ghr},uhr={tokenize:mhr};function hhr(t){let e=-1;const r=[];for(;++e=3&&(u===null||Zr(u))?(t.exit("thematicBreak"),e(u)):r(u)}function l(u){return u===i?(t.consume(u),n++,l):(t.exit("thematicBreakSequence"),di(u)?ki(t,o,"whitespace")(u):o(u))}}const wh={continuation:{tokenize:Ohr},exit:Ehr,name:"list",tokenize:Chr},Shr={partial:!0,tokenize:_hr},Thr={partial:!0,tokenize:khr};function Chr(t,e,r){const n=this,i=n.events[n.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return o;function o(p){const g=n.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!n.containerState.marker||p===n.containerState.marker:Lle(p)){if(n.containerState.type||(n.containerState.type=g,t.enter(g,{_container:!0})),g==="listUnordered")return t.enter("listItemPrefix"),p===42||p===45?t.check(qV,r,u)(p):u(p);if(!n.interrupt||p===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(p)}return r(p)}function l(p){return Lle(p)&&++s<10?(t.consume(p),l):(!n.interrupt||s<2)&&(n.containerState.marker?p===n.containerState.marker:p===41||p===46)?(t.exit("listItemValue"),u(p)):r(p)}function u(p){return t.enter("listItemMarker"),t.consume(p),t.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||p,t.check(w6,n.interrupt?r:h,t.attempt(Shr,f,d))}function h(p){return n.containerState.initialBlankLine=!0,a++,f(p)}function d(p){return di(p)?(t.enter("listItemPrefixWhitespace"),t.consume(p),t.exit("listItemPrefixWhitespace"),f):r(p)}function f(p){return n.containerState.size=a+n.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(p)}}function Ohr(t,e,r){const n=this;return n.containerState._closeFlow=void 0,t.check(w6,i,a);function i(o){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,ki(t,e,"listItemIndent",n.containerState.size+1)(o)}function a(o){return n.containerState.furtherBlankLines||!di(o)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,s(o)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,t.attempt(Thr,e,s)(o))}function s(o){return n.containerState._closeFlow=!0,n.interrupt=void 0,ki(t,t.attempt(wh,e,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function khr(t,e,r){const n=this;return ki(t,i,"listItemIndent",n.containerState.size+1);function i(a){const s=n.events[n.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===n.containerState.size?e(a):r(a)}}function Ehr(t){t.exit(this.containerState.type)}function _hr(t,e,r){const n=this;return ki(t,i,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const s=n.events[n.events.length-1];return!di(a)&&s&&s[1].type==="listItemPrefixWhitespace"?e(a):r(a)}}const oWe={name:"setextUnderline",resolveTo:Rhr,tokenize:Dhr};function Rhr(t,e){let r=t.length,n,i,a;for(;r--;)if(t[r][0]==="enter"){if(t[r][1].type==="content"){n=r;break}t[r][1].type==="paragraph"&&(i=r)}else t[r][1].type==="content"&&t.splice(r,1),!a&&t[r][1].type==="definition"&&(a=r);const s={type:"setextHeading",start:{...t[n][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",a?(t.splice(i,0,["enter",s,e]),t.splice(a+1,0,["exit",t[n][1],e]),t[n][1].end={...t[a][1].end}):t[n][1]=s,t.push(["exit",s,e]),t}function Dhr(t,e,r){const n=this;let i;return a;function a(u){let h=n.events.length,d;for(;h--;)if(n.events[h][1].type!=="lineEnding"&&n.events[h][1].type!=="linePrefix"&&n.events[h][1].type!=="content"){d=n.events[h][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||d)?(t.enter("setextHeadingLine"),i=u,s(u)):r(u)}function s(u){return t.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===i?(t.consume(u),o):(t.exit("setextHeadingLineSequence"),di(u)?ki(t,l,"lineSuffix")(u):l(u))}function l(u){return u===null||Zr(u)?(t.exit("setextHeadingLine"),e(u)):r(u)}}const Lhr={tokenize:Mhr};function Mhr(t){const e=this,r=t.attempt(w6,n,t.attempt(this.parser.constructs.flowInitial,i,ki(t,t.attempt(this.parser.constructs.flow,i,t.attempt($ur,i)),"linePrefix")));return r;function n(a){if(a===null){t.consume(a);return}return t.enter("lineEndingBlank"),t.consume(a),t.exit("lineEndingBlank"),e.currentConstruct=void 0,r}function i(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),e.currentConstruct=void 0,r}}const Ihr={resolveAll:cWe()},Phr=lWe("string"),Nhr=lWe("text");function lWe(t){return{resolveAll:cWe(t==="text"?Bhr:void 0),tokenize:e};function e(r){const n=this,i=this.parser.constructs[t],a=r.attempt(i,s,o);return s;function s(h){return u(h)?a(h):o(h)}function o(h){if(h===null){r.consume(h);return}return r.enter("data"),r.consume(h),l}function l(h){return u(h)?(r.exit("data"),a(h)):(r.consume(h),l)}function u(h){if(h===null)return!0;const d=i[h];let f=-1;if(d)for(;++f-1){const o=s[0];typeof o=="string"?s[0]=o.slice(n):s.shift()}a>0&&s.push(t[i].slice(0,a))}return s}function Uhr(t,e){let r=-1;const n=[];let i;for(;++r0){const ie=be.tokenStack[be.tokenStack.length-1];(ie[1]||fWe).call(be,void 0,ie[0])}for(ce.position={start:Ub(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:Ub(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},j=-1;++j0){const ie=be.tokenStack[be.tokenStack.length-1];(ie[1]||fWe).call(be,void 0,ie[0])}for(ce.position={start:Ub(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:Ub(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},j=-1;++j0&&(n.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:n,children:[{type:"text",value:r}]};return e.meta&&(a.data={meta:e.meta}),t.patch(e,a),a=t.applyData(e,a),a={type:"element",tagName:"pre",properties:{},children:[a]},t.patch(e,a),a}function tdr(t,e){const r={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function rdr(t,e){const r={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function ndr(t,e){const r=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=String(e.identifier).toUpperCase(),i=lE(n.toLowerCase()),a=t.footnoteOrder.indexOf(n);let s,o=t.footnoteCounts.get(n);o===void 0?(o=0,t.footnoteOrder.push(n),s=t.footnoteOrder.length):s=a+1,o+=1,t.footnoteCounts.set(n,o);const l={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+i,id:r+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};t.patch(e,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return t.patch(e,u),t.applyData(e,u)}function idr(t,e){const r={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function adr(t,e){if(t.options.allowDangerousHtml){const r={type:"raw",value:e.value};return t.patch(e,r),t.applyData(e,r)}}function pWe(t,e){const r=e.referenceType;let n="]";if(r==="collapsed"?n+="[]":r==="full"&&(n+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+n}];const i=t.all(e),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=n:i.push({type:"text",value:n}),i}function sdr(t,e){const r=String(e.identifier).toUpperCase(),n=t.definitionById.get(r);if(!n)return pWe(t,e);const i={src:lE(n.url||""),alt:e.alt};n.title!==null&&n.title!==void 0&&(i.title=n.title);const a={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,a),t.applyData(e,a)}function odr(t,e){const r={src:lE(e.url)};e.alt!==null&&e.alt!==void 0&&(r.alt=e.alt),e.title!==null&&e.title!==void 0&&(r.title=e.title);const n={type:"element",tagName:"img",properties:r,children:[]};return t.patch(e,n),t.applyData(e,n)}function ldr(t,e){const r={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,r);const n={type:"element",tagName:"code",properties:{},children:[r]};return t.patch(e,n),t.applyData(e,n)}function cdr(t,e){const r=String(e.identifier).toUpperCase(),n=t.definitionById.get(r);if(!n)return pWe(t,e);const i={href:lE(n.url||"")};n.title!==null&&n.title!==void 0&&(i.title=n.title);const a={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,a),t.applyData(e,a)}function udr(t,e){const r={href:lE(e.url)};e.title!==null&&e.title!==void 0&&(r.title=e.title);const n={type:"element",tagName:"a",properties:r,children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function hdr(t,e,r){const n=t.all(e),i=r?ddr(r):gWe(e),a={},s=[];if(typeof e.checked=="boolean"){const h=n[0];let d;h&&h.type==="element"&&h.tagName==="p"?d=h:(d={type:"element",tagName:"p",properties:{},children:[]},n.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let o=-1;for(;++o1}function fdr(t,e){const r={},n=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(r.start=e.start);++i0){const s={type:"element",tagName:"tbody",properties:{},children:t.wrap(r,!0)},o=Kg(e.children[1]),l=GV(e.children[e.children.length-1]);o&&l&&(s.position={start:o,end:l}),i.push(s)}const a={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,a),t.applyData(e,a)}function ydr(t,e,r){const n=r?r.children:void 0,a=(n?n.indexOf(e):1)===0?"th":"td",s=r&&r.type==="table"?r.align:void 0,o=s?s.length:e.children.length;let l=-1;const u=[];for(;++l0,!0),n[0]),i=n.index+n[0].length,n=r.exec(e);return a.push(yWe(e.slice(i),i>0,!1)),a.join("")}function yWe(t,e,r){let n=0,i=t.length;if(e){let a=t.codePointAt(n);for(;a===mWe||a===vWe;)n++,a=t.codePointAt(n)}if(r){let a=t.codePointAt(i-1);for(;a===mWe||a===vWe;)i--,a=t.codePointAt(i-1)}return i>n?t.slice(n,i):""}function wdr(t,e){const r={type:"text",value:xdr(String(e.value))};return t.patch(e,r),t.applyData(e,r)}function Adr(t,e){const r={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,r),t.applyData(e,r)}const Tdr={blockquote:Zhr,break:Jhr,code:edr,delete:tdr,emphasis:rdr,footnoteReference:ndr,heading:idr,html:adr,imageReference:sdr,image:odr,inlineCode:ldr,linkReference:cdr,link:udr,listItem:hdr,list:fdr,paragraph:pdr,root:gdr,strong:mdr,table:vdr,tableCell:bdr,tableRow:ydr,text:wdr,thematicBreak:Adr,toml:jV,yaml:jV,definition:jV,footnoteDefinition:jV};function jV(){}const bWe=-1,XV=0,S6=1,KV=2,Ble=3,$le=4,Fle=5,zle=6,xWe=7,wWe=8,Sdr=typeof self=="object"?self:globalThis,AWe=(t,e)=>{switch(t){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+t)}return new Sdr[t](e)},Cdr=(t,e)=>{const r=(i,a)=>(t.set(a,i),i),n=i=>{if(t.has(i))return t.get(i);const[a,s]=e[i];switch(a){case XV:case bWe:return r(s,i);case S6:{const o=r([],i);for(const l of s)o.push(n(l));return o}case KV:{const o=r({},i);for(const[l,u]of s)o[n(l)]=n(u);return o}case Ble:return r(new Date(s),i);case $le:{const{source:o,flags:l}=s;return r(new RegExp(o,l),i)}case Fle:{const o=r(new Map,i);for(const[l,u]of s)o.set(n(l),n(u));return o}case zle:{const o=r(new Set,i);for(const l of s)o.add(n(l));return o}case xWe:{const{name:o,message:l}=s;return r(AWe(o,l),i)}case wWe:return r(BigInt(s),i);case"BigInt":return r(Object(BigInt(s)),i);case"ArrayBuffer":return r(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:o}=new Uint8Array(s);return r(new DataView(o),s)}}return r(AWe(a,s),i)};return n},TWe=t=>Cdr(new Map,t)(0),uE="",{toString:Odr}={},{keys:kdr}=Object,C6=t=>{const e=typeof t;if(e!=="object"||!t)return[XV,e];const r=Odr.call(t).slice(8,-1);switch(r){case"Array":return[S6,uE];case"Object":return[KV,uE];case"Date":return[Ble,uE];case"RegExp":return[$le,uE];case"Map":return[Fle,uE];case"Set":return[zle,uE];case"DataView":return[S6,r]}return r.includes("Array")?[S6,r]:r.includes("Error")?[xWe,r]:[KV,r]},ZV=([t,e])=>t===XV&&(e==="function"||e==="symbol"),Edr=(t,e,r,n)=>{const i=(s,o)=>{const l=n.push(s)-1;return r.set(o,l),l},a=s=>{if(r.has(s))return r.get(s);let[o,l]=C6(s);switch(o){case XV:{let h=s;switch(l){case"bigint":o=wWe,h=s.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);h=null;break;case"undefined":return i([bWe],s)}return i([o,h],s)}case S6:{if(l){let f=s;return l==="DataView"?f=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(f=new Uint8Array(s)),i([l,[...f]],s)}const h=[],d=i([o,h],s);for(const f of s)h.push(a(f));return d}case KV:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(e&&"toJSON"in s)return a(s.toJSON());const h=[],d=i([o,h],s);for(const f of kdr(s))(t||!ZV(C6(s[f])))&&h.push([a(f),a(s[f])]);return d}case Ble:return i([o,s.toISOString()],s);case $le:{const{source:h,flags:d}=s;return i([o,{source:h,flags:d}],s)}case Fle:{const h=[],d=i([o,h],s);for(const[f,p]of s)(t||!(ZV(C6(f))||ZV(C6(p))))&&h.push([a(f),a(p)]);return d}case zle:{const h=[],d=i([o,h],s);for(const f of s)(t||!ZV(C6(f)))&&h.push(a(f));return d}}const{message:u}=s;return i([o,{name:l,message:u}],s)};return a},SWe=(t,{json:e,lossy:r}={})=>{const n=[];return Edr(!(e||r),!!e,new Map,n)(t),n},hE=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?TWe(SWe(t,e)):structuredClone(t):(t,e)=>TWe(SWe(t,e));function _dr(t,e){const r=[{type:"text",value:"↩"}];return e>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),r}function Rdr(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function Ddr(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=t.options.footnoteBackContent||_dr,n=t.options.footnoteBackLabel||Rdr,i=t.options.footnoteLabel||"Footnotes",a=t.options.footnoteLabelTagName||"h2",s=t.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l0&&g.push({type:"text",value:" "});let b=typeof r=="string"?r:r(l,p);typeof b=="string"&&(b={type:"text",value:b}),g.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+f+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof n=="string"?n:n(l,p),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const v=h[h.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const b=v.children[v.children.length-1];b&&b.type==="text"?b.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...g)}else h.push(...g);const y={type:"element",tagName:"li",properties:{id:e+"fn-"+f},children:t.wrap(h,!0)};t.patch(u,y),o.push(y)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...hE(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`});const u={type:"element",tagName:"li",properties:a,children:s};return t.patch(e,u),t.applyData(e,u)}function ddr(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const r=t.children;let n=-1;for(;!e&&++n1}function fdr(t,e){const r={},n=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(r.start=e.start);++i0){const s={type:"element",tagName:"tbody",properties:{},children:t.wrap(r,!0)},o=Kg(e.children[1]),l=GV(e.children[e.children.length-1]);o&&l&&(s.position={start:o,end:l}),i.push(s)}const a={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,a),t.applyData(e,a)}function ydr(t,e,r){const n=r?r.children:void 0,a=(n?n.indexOf(e):1)===0?"th":"td",s=r&&r.type==="table"?r.align:void 0,o=s?s.length:e.children.length;let l=-1;const u=[];for(;++l0,!0),n[0]),i=n.index+n[0].length,n=r.exec(e);return a.push(yWe(e.slice(i),i>0,!1)),a.join("")}function yWe(t,e,r){let n=0,i=t.length;if(e){let a=t.codePointAt(n);for(;a===mWe||a===vWe;)n++,a=t.codePointAt(n)}if(r){let a=t.codePointAt(i-1);for(;a===mWe||a===vWe;)i--,a=t.codePointAt(i-1)}return i>n?t.slice(n,i):""}function wdr(t,e){const r={type:"text",value:xdr(String(e.value))};return t.patch(e,r),t.applyData(e,r)}function Adr(t,e){const r={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,r),t.applyData(e,r)}const Sdr={blockquote:Zhr,break:Jhr,code:edr,delete:tdr,emphasis:rdr,footnoteReference:ndr,heading:idr,html:adr,imageReference:sdr,image:odr,inlineCode:ldr,linkReference:cdr,link:udr,listItem:hdr,list:fdr,paragraph:pdr,root:gdr,strong:mdr,table:vdr,tableCell:bdr,tableRow:ydr,text:wdr,thematicBreak:Adr,toml:jV,yaml:jV,definition:jV,footnoteDefinition:jV};function jV(){}const bWe=-1,XV=0,T6=1,KV=2,Ble=3,$le=4,Fle=5,zle=6,xWe=7,wWe=8,Tdr=typeof self=="object"?self:globalThis,AWe=(t,e)=>{switch(t){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+t)}return new Tdr[t](e)},Cdr=(t,e)=>{const r=(i,a)=>(t.set(a,i),i),n=i=>{if(t.has(i))return t.get(i);const[a,s]=e[i];switch(a){case XV:case bWe:return r(s,i);case T6:{const o=r([],i);for(const l of s)o.push(n(l));return o}case KV:{const o=r({},i);for(const[l,u]of s)o[n(l)]=n(u);return o}case Ble:return r(new Date(s),i);case $le:{const{source:o,flags:l}=s;return r(new RegExp(o,l),i)}case Fle:{const o=r(new Map,i);for(const[l,u]of s)o.set(n(l),n(u));return o}case zle:{const o=r(new Set,i);for(const l of s)o.add(n(l));return o}case xWe:{const{name:o,message:l}=s;return r(AWe(o,l),i)}case wWe:return r(BigInt(s),i);case"BigInt":return r(Object(BigInt(s)),i);case"ArrayBuffer":return r(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:o}=new Uint8Array(s);return r(new DataView(o),s)}}return r(AWe(a,s),i)};return n},SWe=t=>Cdr(new Map,t)(0),uE="",{toString:Odr}={},{keys:kdr}=Object,C6=t=>{const e=typeof t;if(e!=="object"||!t)return[XV,e];const r=Odr.call(t).slice(8,-1);switch(r){case"Array":return[T6,uE];case"Object":return[KV,uE];case"Date":return[Ble,uE];case"RegExp":return[$le,uE];case"Map":return[Fle,uE];case"Set":return[zle,uE];case"DataView":return[T6,r]}return r.includes("Array")?[T6,r]:r.includes("Error")?[xWe,r]:[KV,r]},ZV=([t,e])=>t===XV&&(e==="function"||e==="symbol"),Edr=(t,e,r,n)=>{const i=(s,o)=>{const l=n.push(s)-1;return r.set(o,l),l},a=s=>{if(r.has(s))return r.get(s);let[o,l]=C6(s);switch(o){case XV:{let h=s;switch(l){case"bigint":o=wWe,h=s.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);h=null;break;case"undefined":return i([bWe],s)}return i([o,h],s)}case T6:{if(l){let f=s;return l==="DataView"?f=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(f=new Uint8Array(s)),i([l,[...f]],s)}const h=[],d=i([o,h],s);for(const f of s)h.push(a(f));return d}case KV:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(e&&"toJSON"in s)return a(s.toJSON());const h=[],d=i([o,h],s);for(const f of kdr(s))(t||!ZV(C6(s[f])))&&h.push([a(f),a(s[f])]);return d}case Ble:return i([o,s.toISOString()],s);case $le:{const{source:h,flags:d}=s;return i([o,{source:h,flags:d}],s)}case Fle:{const h=[],d=i([o,h],s);for(const[f,p]of s)(t||!(ZV(C6(f))||ZV(C6(p))))&&h.push([a(f),a(p)]);return d}case zle:{const h=[],d=i([o,h],s);for(const f of s)(t||!ZV(C6(f)))&&h.push(a(f));return d}}const{message:u}=s;return i([o,{name:l,message:u}],s)};return a},TWe=(t,{json:e,lossy:r}={})=>{const n=[];return Edr(!(e||r),!!e,new Map,n)(t),n},hE=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?SWe(TWe(t,e)):structuredClone(t):(t,e)=>SWe(TWe(t,e));function _dr(t,e){const r=[{type:"text",value:"↩"}];return e>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),r}function Rdr(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function Ddr(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=t.options.footnoteBackContent||_dr,n=t.options.footnoteBackLabel||Rdr,i=t.options.footnoteLabel||"Footnotes",a=t.options.footnoteLabelTagName||"h2",s=t.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l0&&g.push({type:"text",value:" "});let b=typeof r=="string"?r:r(l,p);typeof b=="string"&&(b={type:"text",value:b}),g.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+f+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof n=="string"?n:n(l,p),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const v=h[h.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const b=v.children[v.children.length-1];b&&b.type==="text"?b.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...g)}else h.push(...g);const y={type:"element",tagName:"li",properties:{id:e+"fn-"+f},children:t.wrap(h,!0)};t.patch(u,y),o.push(y)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...hE(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:t.wrap(o,!0)},{type:"text",value:` -`}]}}const O6=function(t){if(t==null)return Pdr;if(typeof t=="function")return JV(t);if(typeof t=="object")return Array.isArray(t)?Ldr(t):Mdr(t);if(typeof t=="string")return Idr(t);throw new Error("Expected function, string, or object as test")};function Ldr(t){const e=[];let r=-1;for(;++r":""))+")"})}return f;function f(){let p=CWe,g,m,v;if((!e||a(l,u,h[h.length-1]||void 0))&&(p=Fdr(r(l,h)),p[0]===Ule))return p;if("children"in l&&l.children){const y=l;if(y.children&&p[0]!==$dr)for(m=(n?y.children.length:-1)+s,v=h.concat(y);m>-1&&m":""))+")"})}return f;function f(){let p=CWe,g,m,v;if((!e||a(l,u,h[h.length-1]||void 0))&&(p=Fdr(r(l,h)),p[0]===Ule))return p;if("children"in l&&l.children){const y=l;if(y.children&&p[0]!==$dr)for(m=(n?y.children.length:-1)+s,v=h.concat(y);m>-1&&m0&&r.push({type:"text",value:` `}),r}function kWe(t){let e=0,r=t.charCodeAt(e);for(;r===9||r===32;)e++,r=t.charCodeAt(e);return t.slice(e)}function EWe(t,e){const r=Udr(t,e),n=r.one(t,void 0),i=Ddr(r),a=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return i&&a.children.push({type:"text",value:` -`},i),a}function Wdr(t,e){return t&&"run"in t?async function(r,n){const i=EWe(r,{file:n,...e});await t.run(i,n)}:function(r,n){return EWe(r,{file:n,...t||e})}}function _We(t){if(t)throw t}var eQ=Object.prototype.hasOwnProperty,RWe=Object.prototype.toString,DWe=Object.defineProperty,LWe=Object.getOwnPropertyDescriptor,MWe=function(e){return typeof Array.isArray=="function"?Array.isArray(e):RWe.call(e)==="[object Array]"},IWe=function(e){if(!e||RWe.call(e)!=="[object Object]")return!1;var r=eQ.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&eQ.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var i;for(i in e);return typeof i>"u"||eQ.call(e,i)},PWe=function(e,r){DWe&&r.name==="__proto__"?DWe(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},NWe=function(e,r){if(r==="__proto__")if(eQ.call(e,r)){if(LWe)return LWe(e,r).value}else return;return e[r]},Ydr=function t(){var e,r,n,i,a,s,o=arguments[0],l=1,u=arguments.length,h=!1;for(typeof o=="boolean"&&(h=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});ls.length;let l;o&&s.push(i);try{l=t.apply(this,s)}catch(u){const h=u;if(o&&r)throw h;return i(h)}o||(l&&l.then&&typeof l.then=="function"?l.then(a,i):l instanceof Error?i(l):a(l))}function i(s,...o){r||(r=!0,e(s,...o))}function a(s){i(null,s)}}const Zg={basename:Xdr,dirname:Kdr,extname:Zdr,join:Jdr,sep:"/"};function Xdr(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');E6(t);let r=0,n=-1,i=t.length,a;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(a){r=i+1;break}}else n<0&&(a=!0,n=i+1);return n<0?"":t.slice(r,n)}if(e===t)return"";let s=-1,o=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(a){r=i+1;break}}else s<0&&(a=!0,s=i+1),o>-1&&(t.codePointAt(i)===e.codePointAt(o--)?o<0&&(n=i):(o=-1,n=s));return r===n?n=s:n<0&&(n=t.length),t.slice(r,n)}function Kdr(t){if(E6(t),t.length===0)return".";let e=-1,r=t.length,n;for(;--r;)if(t.codePointAt(r)===47){if(n){e=r;break}}else n||(n=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function Zdr(t){E6(t);let e=t.length,r=-1,n=0,i=-1,a=0,s;for(;e--;){const o=t.codePointAt(e);if(o===47){if(s){n=e+1;break}continue}r<0&&(s=!0,r=e+1),o===46?i<0?i=e:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||r<0||a===0||a===1&&i===r-1&&i===n+1?"":t.slice(i,r)}function Jdr(...t){let e=-1,r;for(;++e0&&t.codePointAt(t.length-1)===47&&(r+="/"),e?"/"+r:r}function tfr(t,e){let r="",n=0,i=-1,a=0,s=-1,o,l;for(;++s<=t.length;){if(s2){if(l=r.lastIndexOf("/"),l!==r.length-1){l<0?(r="",n=0):(r=r.slice(0,l),n=r.length-1-r.lastIndexOf("/")),i=s,a=0;continue}}else if(r.length>0){r="",n=0,i=s,a=0;continue}}e&&(r=r.length>0?r+"/..":"..",n=2)}else r.length>0?r+="/"+t.slice(i+1,s):r=t.slice(i+1,s),n=s-i-1;i=s,a=0}else o===46&&a>-1?a++:a=-1}return r}function E6(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const rfr={cwd:nfr};function nfr(){return"/"}function Hle(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function ifr(t){if(typeof t=="string")t=new URL(t);else if(!Hle(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return afr(t)}function afr(t){if(t.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const e=t.pathname;let r=-1;for(;++r0){let[p,...g]=h;const m=n[f][1];Gle(m)&&Gle(p)&&(p=Qle(!0,m,p)),n[f]=[u,p,...g]}}}}const cfr=new jle().freeze();function Xle(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Kle(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Zle(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function FWe(t){if(!Gle(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function zWe(t,e,r){if(!r)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function tQ(t){return ufr(t)?t:new BWe(t)}function ufr(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function hfr(t){return typeof t=="string"||dfr(t)}function dfr(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const ffr="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",UWe=[],VWe={allowDangerousHtml:!0},pfr=/^(https?|ircs?|mailto|xmpp)$/i,gfr=[{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 mfr(t){const e=vfr(t),r=yfr(t);return bfr(e.runSync(e.parse(r),r),t)}function vfr(t){const e=t.rehypePlugins||UWe,r=t.remarkPlugins||UWe,n=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...VWe}:VWe;return cfr().use(Khr).use(r).use(Wdr,n).use(e)}function yfr(t){const e=t.children||"",r=new BWe;return typeof e=="string"&&(r.value=e),r}function bfr(t,e){const r=e.allowedElements,n=e.allowElement,i=e.components,a=e.disallowedElements,s=e.skipHtml,o=e.unwrapDisallowed,l=e.urlTransform||xfr;for(const h of gfr)Object.hasOwn(e,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+ffr+h.id,void 0);return e.className&&(t={type:"element",tagName:"div",properties:{className:e.className},children:t.type==="root"?t.children:[t]}),k6(t,u),Qcr(t,{Fragment:W.Fragment,components:i,ignoreInvalidStyle:!0,jsx:W.jsx,jsxs:W.jsxs,passKeys:!0,passNode:!0});function u(h,d,f){if(h.type==="raw"&&f&&typeof d=="number")return s?f.children.splice(d,1):f.children[d]={type:"text",value:h.value},d;if(h.type==="element"){let p;for(p in _le)if(Object.hasOwn(_le,p)&&Object.hasOwn(h.properties,p)){const g=h.properties[p],m=_le[p];(m===null||m.includes(h.tagName))&&(h.properties[p]=l(String(g||""),p,h))}}if(h.type==="element"){let p=r?!r.includes(h.tagName):a?a.includes(h.tagName):!1;if(!p&&n&&typeof d=="number"&&(p=!n(h,d,f)),p&&f&&typeof d=="number")return o&&h.children?f.children.splice(d,1,...h.children):f.children.splice(d,1),d}}}function xfr(t){const e=t.indexOf(":"),r=t.indexOf("?"),n=t.indexOf("#"),i=t.indexOf("/");return e===-1||i!==-1&&e>i||r!==-1&&e>r||n!==-1&&e>n||pfr.test(t.slice(0,e))?t:""}function Jle(){return Jle=Object.assign?Object.assign.bind():function(t){for(var e=1;e0?{type:"text",value:T}:void 0),T===!1?f.lastIndex=w+1:(g!==w&&b.push({type:"text",value:u.value.slice(g,w)}),Array.isArray(T)?b.push(...T):T&&b.push(T),g=w+x[0].length,y=!0),!f.global)break;x=f.exec(u.value)}return y?(g?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let r=e[0],n=r.indexOf(")");const i=GWe(t,"(");let a=GWe(t,")");for(;n!==-1&&i>a;)t+=r.slice(0,n+1),r=r.slice(n+1),n=r.indexOf(")"),a++;return[t,r]}function HWe(t,e){const r=t.input.charCodeAt(t.index-1);return(t.index===0||nA(r)||WV(r))&&(!e||r!==47)}WWe.peek=qfr;function zfr(){this.buffer()}function Ufr(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function Vfr(){this.buffer()}function Qfr(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function Gfr(t){const e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Ip(this.sliceSerialize(t)).toLowerCase(),r.label=e}function Hfr(t){this.exit(t)}function Wfr(t){const e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Ip(this.sliceSerialize(t)).toLowerCase(),r.label=e}function Yfr(t){this.exit(t)}function qfr(){return"["}function WWe(t,e,r,n){const i=r.createTracker(n);let a=i.move("[^");const s=r.enter("footnoteReference"),o=r.enter("reference");return a+=i.move(r.safe(r.associationId(t),{after:"]",before:a})),o(),s(),a+=i.move("]"),a}function jfr(){return{enter:{gfmFootnoteCallString:zfr,gfmFootnoteCall:Ufr,gfmFootnoteDefinitionLabelString:Vfr,gfmFootnoteDefinition:Qfr},exit:{gfmFootnoteCallString:Gfr,gfmFootnoteCall:Hfr,gfmFootnoteDefinitionLabelString:Wfr,gfmFootnoteDefinition:Yfr}}}function Xfr(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:r,footnoteReference:WWe},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(n,i,a,s){const o=a.createTracker(s);let l=o.move("[^");const u=a.enter("footnoteDefinition"),h=a.enter("label");return l+=o.move(a.safe(a.associationId(n),{before:l,after:"]"})),h(),l+=o.move("]:"),n.children&&n.children.length>0&&(o.shift(4),l+=o.move((e?` -`:" ")+a.indentLines(a.containerFlow(n,o.current()),e?YWe:Kfr))),u(),l}}function Kfr(t,e,r){return e===0?t:YWe(t,e,r)}function YWe(t,e,r){return(r?"":" ")+t}const Zfr=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];qWe.peek=npr;function Jfr(){return{canContainEols:["delete"],enter:{strikethrough:tpr},exit:{strikethrough:rpr}}}function epr(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Zfr}],handlers:{delete:qWe}}}function tpr(t){this.enter({type:"delete",children:[]},t)}function rpr(t){this.exit(t)}function qWe(t,e,r,n){const i=r.createTracker(n),a=r.enter("strikethrough");let s=i.move("~~");return s+=r.containerPhrasing(t,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),a(),s}function npr(){return"~"}function ipr(t){return t.length}function apr(t,e){const r=e||{},n=(r.align||[]).concat(),i=r.stringLength||ipr,a=[],s=[],o=[],l=[];let u=0,h=-1;for(;++hu&&(u=t[h].length);++yl[y])&&(l[y]=x)}m.push(b)}s[h]=m,o[h]=v}let d=-1;if(typeof n=="object"&&"length"in n)for(;++dl[d]&&(l[d]=b),p[d]=b),f[d]=x}s.splice(1,0,f),o.splice(1,0,p),h=-1;const g=[];for(;++h"u"||eQ.call(e,i)},PWe=function(e,r){DWe&&r.name==="__proto__"?DWe(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},NWe=function(e,r){if(r==="__proto__")if(eQ.call(e,r)){if(LWe)return LWe(e,r).value}else return;return e[r]},Ydr=function t(){var e,r,n,i,a,s,o=arguments[0],l=1,u=arguments.length,h=!1;for(typeof o=="boolean"&&(h=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});ls.length;let l;o&&s.push(i);try{l=t.apply(this,s)}catch(u){const h=u;if(o&&r)throw h;return i(h)}o||(l&&l.then&&typeof l.then=="function"?l.then(a,i):l instanceof Error?i(l):a(l))}function i(s,...o){r||(r=!0,e(s,...o))}function a(s){i(null,s)}}const Zg={basename:Xdr,dirname:Kdr,extname:Zdr,join:Jdr,sep:"/"};function Xdr(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');E6(t);let r=0,n=-1,i=t.length,a;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(a){r=i+1;break}}else n<0&&(a=!0,n=i+1);return n<0?"":t.slice(r,n)}if(e===t)return"";let s=-1,o=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(a){r=i+1;break}}else s<0&&(a=!0,s=i+1),o>-1&&(t.codePointAt(i)===e.codePointAt(o--)?o<0&&(n=i):(o=-1,n=s));return r===n?n=s:n<0&&(n=t.length),t.slice(r,n)}function Kdr(t){if(E6(t),t.length===0)return".";let e=-1,r=t.length,n;for(;--r;)if(t.codePointAt(r)===47){if(n){e=r;break}}else n||(n=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function Zdr(t){E6(t);let e=t.length,r=-1,n=0,i=-1,a=0,s;for(;e--;){const o=t.codePointAt(e);if(o===47){if(s){n=e+1;break}continue}r<0&&(s=!0,r=e+1),o===46?i<0?i=e:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||r<0||a===0||a===1&&i===r-1&&i===n+1?"":t.slice(i,r)}function Jdr(...t){let e=-1,r;for(;++e0&&t.codePointAt(t.length-1)===47&&(r+="/"),e?"/"+r:r}function tfr(t,e){let r="",n=0,i=-1,a=0,s=-1,o,l;for(;++s<=t.length;){if(s2){if(l=r.lastIndexOf("/"),l!==r.length-1){l<0?(r="",n=0):(r=r.slice(0,l),n=r.length-1-r.lastIndexOf("/")),i=s,a=0;continue}}else if(r.length>0){r="",n=0,i=s,a=0;continue}}e&&(r=r.length>0?r+"/..":"..",n=2)}else r.length>0?r+="/"+t.slice(i+1,s):r=t.slice(i+1,s),n=s-i-1;i=s,a=0}else o===46&&a>-1?a++:a=-1}return r}function E6(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const rfr={cwd:nfr};function nfr(){return"/"}function Hle(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function ifr(t){if(typeof t=="string")t=new URL(t);else if(!Hle(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return afr(t)}function afr(t){if(t.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const e=t.pathname;let r=-1;for(;++r0){let[p,...g]=h;const m=n[f][1];Gle(m)&&Gle(p)&&(p=Qle(!0,m,p)),n[f]=[u,p,...g]}}}}const cfr=new jle().freeze();function Xle(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Kle(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Zle(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function FWe(t){if(!Gle(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function zWe(t,e,r){if(!r)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function tQ(t){return ufr(t)?t:new BWe(t)}function ufr(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function hfr(t){return typeof t=="string"||dfr(t)}function dfr(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const ffr="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",UWe=[],VWe={allowDangerousHtml:!0},pfr=/^(https?|ircs?|mailto|xmpp)$/i,gfr=[{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 mfr(t){const e=vfr(t),r=yfr(t);return bfr(e.runSync(e.parse(r),r),t)}function vfr(t){const e=t.rehypePlugins||UWe,r=t.remarkPlugins||UWe,n=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...VWe}:VWe;return cfr().use(Khr).use(r).use(Wdr,n).use(e)}function yfr(t){const e=t.children||"",r=new BWe;return typeof e=="string"&&(r.value=e),r}function bfr(t,e){const r=e.allowedElements,n=e.allowElement,i=e.components,a=e.disallowedElements,s=e.skipHtml,o=e.unwrapDisallowed,l=e.urlTransform||xfr;for(const h of gfr)Object.hasOwn(e,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+ffr+h.id,void 0);return e.className&&(t={type:"element",tagName:"div",properties:{className:e.className},children:t.type==="root"?t.children:[t]}),k6(t,u),Qcr(t,{Fragment:W.Fragment,components:i,ignoreInvalidStyle:!0,jsx:W.jsx,jsxs:W.jsxs,passKeys:!0,passNode:!0});function u(h,d,f){if(h.type==="raw"&&f&&typeof d=="number")return s?f.children.splice(d,1):f.children[d]={type:"text",value:h.value},d;if(h.type==="element"){let p;for(p in _le)if(Object.hasOwn(_le,p)&&Object.hasOwn(h.properties,p)){const g=h.properties[p],m=_le[p];(m===null||m.includes(h.tagName))&&(h.properties[p]=l(String(g||""),p,h))}}if(h.type==="element"){let p=r?!r.includes(h.tagName):a?a.includes(h.tagName):!1;if(!p&&n&&typeof d=="number"&&(p=!n(h,d,f)),p&&f&&typeof d=="number")return o&&h.children?f.children.splice(d,1,...h.children):f.children.splice(d,1),d}}}function xfr(t){const e=t.indexOf(":"),r=t.indexOf("?"),n=t.indexOf("#"),i=t.indexOf("/");return e===-1||i!==-1&&e>i||r!==-1&&e>r||n!==-1&&e>n||pfr.test(t.slice(0,e))?t:""}function Jle(){return Jle=Object.assign?Object.assign.bind():function(t){for(var e=1;e0?{type:"text",value:S}:void 0),S===!1?f.lastIndex=w+1:(g!==w&&b.push({type:"text",value:u.value.slice(g,w)}),Array.isArray(S)?b.push(...S):S&&b.push(S),g=w+x[0].length,y=!0),!f.global)break;x=f.exec(u.value)}return y?(g?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let r=e[0],n=r.indexOf(")");const i=GWe(t,"(");let a=GWe(t,")");for(;n!==-1&&i>a;)t+=r.slice(0,n+1),r=r.slice(n+1),n=r.indexOf(")"),a++;return[t,r]}function HWe(t,e){const r=t.input.charCodeAt(t.index-1);return(t.index===0||nA(r)||WV(r))&&(!e||r!==47)}WWe.peek=qfr;function zfr(){this.buffer()}function Ufr(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function Vfr(){this.buffer()}function Qfr(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function Gfr(t){const e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Ip(this.sliceSerialize(t)).toLowerCase(),r.label=e}function Hfr(t){this.exit(t)}function Wfr(t){const e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Ip(this.sliceSerialize(t)).toLowerCase(),r.label=e}function Yfr(t){this.exit(t)}function qfr(){return"["}function WWe(t,e,r,n){const i=r.createTracker(n);let a=i.move("[^");const s=r.enter("footnoteReference"),o=r.enter("reference");return a+=i.move(r.safe(r.associationId(t),{after:"]",before:a})),o(),s(),a+=i.move("]"),a}function jfr(){return{enter:{gfmFootnoteCallString:zfr,gfmFootnoteCall:Ufr,gfmFootnoteDefinitionLabelString:Vfr,gfmFootnoteDefinition:Qfr},exit:{gfmFootnoteCallString:Gfr,gfmFootnoteCall:Hfr,gfmFootnoteDefinitionLabelString:Wfr,gfmFootnoteDefinition:Yfr}}}function Xfr(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:r,footnoteReference:WWe},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(n,i,a,s){const o=a.createTracker(s);let l=o.move("[^");const u=a.enter("footnoteDefinition"),h=a.enter("label");return l+=o.move(a.safe(a.associationId(n),{before:l,after:"]"})),h(),l+=o.move("]:"),n.children&&n.children.length>0&&(o.shift(4),l+=o.move((e?` +`:" ")+a.indentLines(a.containerFlow(n,o.current()),e?YWe:Kfr))),u(),l}}function Kfr(t,e,r){return e===0?t:YWe(t,e,r)}function YWe(t,e,r){return(r?"":" ")+t}const Zfr=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];qWe.peek=npr;function Jfr(){return{canContainEols:["delete"],enter:{strikethrough:tpr},exit:{strikethrough:rpr}}}function epr(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Zfr}],handlers:{delete:qWe}}}function tpr(t){this.enter({type:"delete",children:[]},t)}function rpr(t){this.exit(t)}function qWe(t,e,r,n){const i=r.createTracker(n),a=r.enter("strikethrough");let s=i.move("~~");return s+=r.containerPhrasing(t,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),a(),s}function npr(){return"~"}function ipr(t){return t.length}function apr(t,e){const r=e||{},n=(r.align||[]).concat(),i=r.stringLength||ipr,a=[],s=[],o=[],l=[];let u=0,h=-1;for(;++hu&&(u=t[h].length);++yl[y])&&(l[y]=x)}m.push(b)}s[h]=m,o[h]=v}let d=-1;if(typeof n=="object"&&"length"in n)for(;++dl[d]&&(l[d]=b),p[d]=b),f[d]=x}s.splice(1,0,f),o.splice(1,0,p),h=-1;const g=[];for(;++h "),a.shift(2);const s=r.indentLines(r.containerFlow(t,a.current()),lpr);return i(),s}function lpr(t,e,r){return">"+(r?"":" ")+t}function cpr(t,e){return ZWe(t,e.inConstruct,!0)&&!ZWe(t,e.notInConstruct,!1)}function ZWe(t,e,r){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return r;let n=-1;for(;++ns&&(s=a):a=1,i=n+e.length,n=r.indexOf(e,i);return s}function hpr(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function dpr(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function fpr(t,e,r,n){const i=dpr(r),a=t.value||"",s=i==="`"?"GraveAccent":"Tilde";if(hpr(t,r)){const d=r.enter("codeIndented"),f=r.indentLines(a,ppr);return d(),f}const o=r.createTracker(n),l=i.repeat(Math.max(upr(a,i)+1,3)),u=r.enter("codeFenced");let h=o.move(l);if(t.lang){const d=r.enter(`codeFencedLang${s}`);h+=o.move(r.safe(t.lang,{before:h,after:" ",encode:["`"],...o.current()})),d()}if(t.lang&&t.meta){const d=r.enter(`codeFencedMeta${s}`);h+=o.move(" "),h+=o.move(r.safe(t.meta,{before:h,after:` @@ -224,23 +224,23 @@ Studio:{{studioUrl}} `});return d(),h(),f+` `+(i===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(` `))+1))}const s="#".repeat(i),o=r.enter("headingAtx"),l=r.enter("phrasing");a.move(s+" ");let u=r.containerPhrasing(t,{before:"# ",after:` -`,...a.current()});return/^[\t ]/.test(u)&&(u=_6(u.charCodeAt(0))+u.slice(1)),u=u?s+" "+u:s,r.options.closeAtx&&(u+=" "+s),l(),o(),u}tYe.peek=xpr;function tYe(t){return t.value||""}function xpr(){return"<"}rYe.peek=wpr;function rYe(t,e,r,n){const i=nce(r),a=i==='"'?"Quote":"Apostrophe",s=r.enter("image");let o=r.enter("label");const l=r.createTracker(n);let u=l.move("![");return u+=l.move(r.safe(t.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),o(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(o=r.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(r.safe(t.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=r.enter("destinationRaw"),u+=l.move(r.safe(t.url,{before:u,after:t.title?" ":")",...l.current()}))),o(),t.title&&(o=r.enter(`title${a}`),u+=l.move(" "+i),u+=l.move(r.safe(t.title,{before:u,after:i,...l.current()})),u+=l.move(i),o()),u+=l.move(")"),s(),u}function wpr(){return"!"}nYe.peek=Apr;function nYe(t,e,r,n){const i=t.referenceType,a=r.enter("imageReference");let s=r.enter("label");const o=r.createTracker(n);let l=o.move("![");const u=r.safe(t.alt,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),s();const h=r.stack;r.stack=[],s=r.enter("reference");const d=r.safe(r.associationId(t),{before:l,after:"]",...o.current()});return s(),r.stack=h,a(),i==="full"||!u||u!==d?l+=o.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function Apr(){return"!"}iYe.peek=Tpr;function iYe(t,e,r){let n=t.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(n);)i+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++a\u007F]/.test(t.url))}sYe.peek=Spr;function sYe(t,e,r,n){const i=nce(r),a=i==='"'?"Quote":"Apostrophe",s=r.createTracker(n);let o,l;if(aYe(t,r)){const h=r.stack;r.stack=[],o=r.enter("autolink");let d=s.move("<");return d+=s.move(r.containerPhrasing(t,{before:d,after:">",...s.current()})),d+=s.move(">"),o(),r.stack=h,d}o=r.enter("link"),l=r.enter("label");let u=s.move("[");return u+=s.move(r.containerPhrasing(t,{before:u,after:"](",...s.current()})),u+=s.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=r.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(r.safe(t.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(l=r.enter("destinationRaw"),u+=s.move(r.safe(t.url,{before:u,after:t.title?" ":")",...s.current()}))),l(),t.title&&(l=r.enter(`title${a}`),u+=s.move(" "+i),u+=s.move(r.safe(t.title,{before:u,after:i,...s.current()})),u+=s.move(i),l()),u+=s.move(")"),o(),u}function Spr(t,e,r){return aYe(t,r)?"<":"["}oYe.peek=Cpr;function oYe(t,e,r,n){const i=t.referenceType,a=r.enter("linkReference");let s=r.enter("label");const o=r.createTracker(n);let l=o.move("[");const u=r.containerPhrasing(t,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),s();const h=r.stack;r.stack=[],s=r.enter("reference");const d=r.safe(r.associationId(t),{before:l,after:"]",...o.current()});return s(),r.stack=h,a(),i==="full"||!u||u!==d?l+=o.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function Cpr(){return"["}function ice(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function Opr(t){const e=ice(t),r=t.options.bulletOther;if(!r)return e==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+r+"`) to be different");return r}function kpr(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function lYe(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function Epr(t,e,r,n){const i=r.enter("list"),a=r.bulletCurrent;let s=t.ordered?kpr(r):ice(r);const o=t.ordered?s==="."?")":".":Opr(r);let l=e&&r.bulletLastUsed?s===r.bulletLastUsed:!1;if(!t.ordered){const h=t.children?t.children[0]:void 0;if((s==="*"||s==="-")&&h&&(!h.children||!h.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(l=!0),lYe(r)===s&&h){let d=-1;for(;++d-1?e.start:1)+(r.options.incrementListMarker===!1?0:e.children.indexOf(t))+a);let s=a.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(s=Math.ceil(s/4)*4);const o=r.createTracker(n);o.move(a+" ".repeat(s-a.length)),o.shift(s);const l=r.enter("listItem"),u=r.indentLines(r.containerFlow(t,o.current()),h);return l(),u;function h(d,f,p){return f?(p?"":" ".repeat(s))+d:(p?a:a+" ".repeat(s-a.length))+d}}function Dpr(t,e,r,n){const i=r.enter("paragraph"),a=r.enter("phrasing"),s=r.containerPhrasing(t,n);return a(),i(),s}const Lpr=O6(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Mpr(t,e,r,n){return(t.children.some(function(s){return Lpr(s)})?r.containerPhrasing:r.containerFlow).call(r,t,n)}function Ipr(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}cYe.peek=Ppr;function cYe(t,e,r,n){const i=Ipr(r),a=r.enter("strong"),s=r.createTracker(n),o=s.move(i+i);let l=s.move(r.containerPhrasing(t,{after:i,before:o,...s.current()}));const u=l.charCodeAt(0),h=rQ(n.before.charCodeAt(n.before.length-1),u,i);h.inside&&(l=_6(u)+l.slice(1));const d=l.charCodeAt(l.length-1),f=rQ(n.after.charCodeAt(0),d,i);f.inside&&(l=l.slice(0,-1)+_6(d));const p=s.move(i+i);return a(),r.attentionEncodeSurroundingInfo={after:f.outside,before:h.outside},o+l+p}function Ppr(t,e,r){return r.options.strong||"*"}function Npr(t,e,r,n){return r.safe(t.value,n)}function Bpr(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function $pr(t,e,r){const n=(lYe(r)+(r.options.ruleSpaces?" ":"")).repeat(Bpr(r));return r.options.ruleSpaces?n.slice(0,-1):n}const uYe={blockquote:opr,break:JWe,code:fpr,definition:gpr,emphasis:eYe,hardBreak:JWe,heading:bpr,html:tYe,image:rYe,imageReference:nYe,inlineCode:iYe,link:sYe,linkReference:oYe,list:Epr,listItem:Rpr,paragraph:Dpr,root:Mpr,strong:cYe,text:Npr,thematicBreak:$pr};function Fpr(){return{enter:{table:zpr,tableData:hYe,tableHeader:hYe,tableRow:Vpr},exit:{codeText:Qpr,table:Upr,tableData:ace,tableHeader:ace,tableRow:ace}}}function zpr(t){const e=t._align;this.enter({type:"table",align:e.map(function(r){return r==="none"?null:r}),children:[]},t),this.data.inTable=!0}function Upr(t){this.exit(t),this.data.inTable=void 0}function Vpr(t){this.enter({type:"tableRow",children:[]},t)}function ace(t){this.exit(t)}function hYe(t){this.enter({type:"tableCell",children:[]},t)}function Qpr(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,Gpr));const r=this.stack[this.stack.length-1];r.type,r.value=e,this.exit(t)}function Gpr(t,e){return e==="|"?e:t}function Hpr(t){const e=t||{},r=e.tableCellPadding,n=e.tablePipeAlign,i=e.stringLength,a=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,...a.current()});return/^[\t ]/.test(u)&&(u=_6(u.charCodeAt(0))+u.slice(1)),u=u?s+" "+u:s,r.options.closeAtx&&(u+=" "+s),l(),o(),u}tYe.peek=xpr;function tYe(t){return t.value||""}function xpr(){return"<"}rYe.peek=wpr;function rYe(t,e,r,n){const i=nce(r),a=i==='"'?"Quote":"Apostrophe",s=r.enter("image");let o=r.enter("label");const l=r.createTracker(n);let u=l.move("![");return u+=l.move(r.safe(t.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),o(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(o=r.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(r.safe(t.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=r.enter("destinationRaw"),u+=l.move(r.safe(t.url,{before:u,after:t.title?" ":")",...l.current()}))),o(),t.title&&(o=r.enter(`title${a}`),u+=l.move(" "+i),u+=l.move(r.safe(t.title,{before:u,after:i,...l.current()})),u+=l.move(i),o()),u+=l.move(")"),s(),u}function wpr(){return"!"}nYe.peek=Apr;function nYe(t,e,r,n){const i=t.referenceType,a=r.enter("imageReference");let s=r.enter("label");const o=r.createTracker(n);let l=o.move("![");const u=r.safe(t.alt,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),s();const h=r.stack;r.stack=[],s=r.enter("reference");const d=r.safe(r.associationId(t),{before:l,after:"]",...o.current()});return s(),r.stack=h,a(),i==="full"||!u||u!==d?l+=o.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function Apr(){return"!"}iYe.peek=Spr;function iYe(t,e,r){let n=t.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(n);)i+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++a\u007F]/.test(t.url))}sYe.peek=Tpr;function sYe(t,e,r,n){const i=nce(r),a=i==='"'?"Quote":"Apostrophe",s=r.createTracker(n);let o,l;if(aYe(t,r)){const h=r.stack;r.stack=[],o=r.enter("autolink");let d=s.move("<");return d+=s.move(r.containerPhrasing(t,{before:d,after:">",...s.current()})),d+=s.move(">"),o(),r.stack=h,d}o=r.enter("link"),l=r.enter("label");let u=s.move("[");return u+=s.move(r.containerPhrasing(t,{before:u,after:"](",...s.current()})),u+=s.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=r.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(r.safe(t.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(l=r.enter("destinationRaw"),u+=s.move(r.safe(t.url,{before:u,after:t.title?" ":")",...s.current()}))),l(),t.title&&(l=r.enter(`title${a}`),u+=s.move(" "+i),u+=s.move(r.safe(t.title,{before:u,after:i,...s.current()})),u+=s.move(i),l()),u+=s.move(")"),o(),u}function Tpr(t,e,r){return aYe(t,r)?"<":"["}oYe.peek=Cpr;function oYe(t,e,r,n){const i=t.referenceType,a=r.enter("linkReference");let s=r.enter("label");const o=r.createTracker(n);let l=o.move("[");const u=r.containerPhrasing(t,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),s();const h=r.stack;r.stack=[],s=r.enter("reference");const d=r.safe(r.associationId(t),{before:l,after:"]",...o.current()});return s(),r.stack=h,a(),i==="full"||!u||u!==d?l+=o.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function Cpr(){return"["}function ice(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function Opr(t){const e=ice(t),r=t.options.bulletOther;if(!r)return e==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+r+"`) to be different");return r}function kpr(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function lYe(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function Epr(t,e,r,n){const i=r.enter("list"),a=r.bulletCurrent;let s=t.ordered?kpr(r):ice(r);const o=t.ordered?s==="."?")":".":Opr(r);let l=e&&r.bulletLastUsed?s===r.bulletLastUsed:!1;if(!t.ordered){const h=t.children?t.children[0]:void 0;if((s==="*"||s==="-")&&h&&(!h.children||!h.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(l=!0),lYe(r)===s&&h){let d=-1;for(;++d-1?e.start:1)+(r.options.incrementListMarker===!1?0:e.children.indexOf(t))+a);let s=a.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(s=Math.ceil(s/4)*4);const o=r.createTracker(n);o.move(a+" ".repeat(s-a.length)),o.shift(s);const l=r.enter("listItem"),u=r.indentLines(r.containerFlow(t,o.current()),h);return l(),u;function h(d,f,p){return f?(p?"":" ".repeat(s))+d:(p?a:a+" ".repeat(s-a.length))+d}}function Dpr(t,e,r,n){const i=r.enter("paragraph"),a=r.enter("phrasing"),s=r.containerPhrasing(t,n);return a(),i(),s}const Lpr=O6(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Mpr(t,e,r,n){return(t.children.some(function(s){return Lpr(s)})?r.containerPhrasing:r.containerFlow).call(r,t,n)}function Ipr(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}cYe.peek=Ppr;function cYe(t,e,r,n){const i=Ipr(r),a=r.enter("strong"),s=r.createTracker(n),o=s.move(i+i);let l=s.move(r.containerPhrasing(t,{after:i,before:o,...s.current()}));const u=l.charCodeAt(0),h=rQ(n.before.charCodeAt(n.before.length-1),u,i);h.inside&&(l=_6(u)+l.slice(1));const d=l.charCodeAt(l.length-1),f=rQ(n.after.charCodeAt(0),d,i);f.inside&&(l=l.slice(0,-1)+_6(d));const p=s.move(i+i);return a(),r.attentionEncodeSurroundingInfo={after:f.outside,before:h.outside},o+l+p}function Ppr(t,e,r){return r.options.strong||"*"}function Npr(t,e,r,n){return r.safe(t.value,n)}function Bpr(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function $pr(t,e,r){const n=(lYe(r)+(r.options.ruleSpaces?" ":"")).repeat(Bpr(r));return r.options.ruleSpaces?n.slice(0,-1):n}const uYe={blockquote:opr,break:JWe,code:fpr,definition:gpr,emphasis:eYe,hardBreak:JWe,heading:bpr,html:tYe,image:rYe,imageReference:nYe,inlineCode:iYe,link:sYe,linkReference:oYe,list:Epr,listItem:Rpr,paragraph:Dpr,root:Mpr,strong:cYe,text:Npr,thematicBreak:$pr};function Fpr(){return{enter:{table:zpr,tableData:hYe,tableHeader:hYe,tableRow:Vpr},exit:{codeText:Qpr,table:Upr,tableData:ace,tableHeader:ace,tableRow:ace}}}function zpr(t){const e=t._align;this.enter({type:"table",align:e.map(function(r){return r==="none"?null:r}),children:[]},t),this.data.inTable=!0}function Upr(t){this.exit(t),this.data.inTable=void 0}function Vpr(t){this.enter({type:"tableRow",children:[]},t)}function ace(t){this.exit(t)}function hYe(t){this.enter({type:"tableCell",children:[]},t)}function Qpr(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,Gpr));const r=this.stack[this.stack.length-1];r.type,r.value=e,this.exit(t)}function Gpr(t,e){return e==="|"?e:t}function Hpr(t){const e=t||{},r=e.tableCellPadding,n=e.tablePipeAlign,i=e.stringLength,a=r?" ":"|";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:f,table:s,tableCell:l,tableRow:o}};function s(p,g,m,v){return u(h(p,m,v),p.align)}function o(p,g,m,v){const y=d(p,m,v),b=u([y]);return b.slice(0,b.indexOf(` -`))}function l(p,g,m,v){const y=m.enter("tableCell"),b=m.enter("phrasing"),x=m.containerPhrasing(p,{...v,before:a,after:a});return b(),y(),x}function u(p,g){return apr(p,{align:g,alignDelimiters:n,padding:r,stringLength:i})}function h(p,g,m){const v=p.children;let y=-1;const b=[],x=g.enter("table");for(;++y0&&!r&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const cgr={tokenize:vgr,partial:!0};function ugr(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:pgr,continuation:{tokenize:ggr},exit:mgr}},text:{91:{name:"gfmFootnoteCall",tokenize:fgr},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:hgr,resolveTo:dgr}}}}function hgr(t,e,r){const n=this;let i=n.events.length;const a=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let s;for(;i--;){const l=n.events[i][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!s||!s._balanced)return r(l);const u=Ip(n.sliceSerialize({start:s.end,end:n.now()}));return u.codePointAt(0)!==94||!a.includes(u.slice(1))?r(l):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(l),t.exit("gfmFootnoteCallLabelMarker"),e(l))}}function dgr(t,e){let r=t.length;for(;r--;)if(t[r][1].type==="labelImage"&&t[r][0]==="enter"){t[r][1];break}t[r+1][1].type="data",t[r+3][1].type="gfmFootnoteCallLabelMarker";const n={type:"gfmFootnoteCall",start:Object.assign({},t[r+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[r+3][1].end),end:Object.assign({},t[r+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},o=[t[r+1],t[r+2],["enter",n,e],t[r+3],t[r+4],["enter",i,e],["exit",i,e],["enter",a,e],["enter",s,e],["exit",s,e],["exit",a,e],t[t.length-2],t[t.length-1],["exit",n,e]];return t.splice(r,t.length-r+1,...o),t}function fgr(t,e,r){const n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let a=0,s;return o;function o(d){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?r(d):(t.enter("gfmFootnoteCallMarker"),t.consume(d),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",u)}function u(d){if(a>999||d===93&&!s||d===null||d===91||ba(d))return r(d);if(d===93){t.exit("chunkString");const f=t.exit("gfmFootnoteCallString");return i.includes(Ip(n.sliceSerialize(f)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):r(d)}return ba(d)||(s=!0),a++,t.consume(d),d===92?h:u}function h(d){return d===91||d===92||d===93?(t.consume(d),a++,u):u(d)}}function pgr(t,e,r){const n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let a,s=0,o;return l;function l(g){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",h):r(g)}function h(g){if(s>999||g===93&&!o||g===null||g===91||ba(g))return r(g);if(g===93){t.exit("chunkString");const m=t.exit("gfmFootnoteDefinitionLabelString");return a=Ip(n.sliceSerialize(m)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),f}return ba(g)||(o=!0),s++,t.consume(g),g===92?d:h}function d(g){return g===91||g===92||g===93?(t.consume(g),s++,h):h(g)}function f(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),i.includes(a)||i.push(a),ki(t,p,"gfmFootnoteDefinitionWhitespace")):r(g)}function p(g){return e(g)}}function ggr(t,e,r){return t.check(w6,e,t.attempt(cgr,e,r))}function mgr(t){t.exit("gfmFootnoteDefinition")}function vgr(t,e,r){const n=this;return ki(t,i,"gfmFootnoteDefinitionIndent",5);function i(a){const s=n.events[n.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?e(a):r(a)}}function ygr(t){let r=(t||{}).singleTilde;const n={name:"strikethrough",tokenize:a,resolveAll:i};return r==null&&(r=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function i(s,o){let l=-1;for(;++l1?l(g):(s.consume(g),d++,p);if(d<2&&!r)return l(g);const v=s.exit("strikethroughSequenceTemporary"),y=cE(g);return v._open=!y||y===2&&!!m,v._close=!m||m===2&&!!y,o(g)}}}class bgr{constructor(){this.map=[]}add(e,r,n){xgr(this,e,r,n)}consume(e){if(this.map.sort(function(a,s){return a[0]-s[0]}),this.map.length===0)return;let r=this.map.length;const n=[];for(;r>0;)r-=1,n.push(e.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),e.length=this.map[r][0];n.push(e.slice()),e.length=0;let i=n.pop();for(;i;){for(const a of i)e.push(a);i=n.pop()}this.map.length=0}}function xgr(t,e,r,n){let i=0;if(!(r===0&&n.length===0)){for(;i-1;){const R=n.events[_][1].type;if(R==="lineEnding"||R==="linePrefix")_--;else break}const I=_>-1?n.events[_][1].type:null,L=I==="tableHead"||I==="tableRow"?T:l;return L===T&&n.parser.lazy[n.now().line]?r(E):L(E)}function l(E){return t.enter("tableHead"),t.enter("tableRow"),u(E)}function u(E){return E===124||(s=!0,a+=1),h(E)}function h(E){return E===null?r(E):Zr(E)?a>1?(a=0,n.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(E),t.exit("lineEnding"),p):r(E):di(E)?ki(t,h,"whitespace")(E):(a+=1,s&&(s=!1,i+=1),E===124?(t.enter("tableCellDivider"),t.consume(E),t.exit("tableCellDivider"),s=!0,h):(t.enter("data"),d(E)))}function d(E){return E===null||E===124||ba(E)?(t.exit("data"),h(E)):(t.consume(E),E===92?f:d)}function f(E){return E===92||E===124?(t.consume(E),d):d(E)}function p(E){return n.interrupt=!1,n.parser.lazy[n.now().line]?r(E):(t.enter("tableDelimiterRow"),s=!1,di(E)?ki(t,g,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):g(E))}function g(E){return E===45||E===58?v(E):E===124?(s=!0,t.enter("tableCellDivider"),t.consume(E),t.exit("tableCellDivider"),m):A(E)}function m(E){return di(E)?ki(t,v,"whitespace")(E):v(E)}function v(E){return E===58?(a+=1,s=!0,t.enter("tableDelimiterMarker"),t.consume(E),t.exit("tableDelimiterMarker"),y):E===45?(a+=1,y(E)):E===null||Zr(E)?w(E):A(E)}function y(E){return E===45?(t.enter("tableDelimiterFiller"),b(E)):A(E)}function b(E){return E===45?(t.consume(E),b):E===58?(s=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(E),t.exit("tableDelimiterMarker"),x):(t.exit("tableDelimiterFiller"),x(E))}function x(E){return di(E)?ki(t,w,"whitespace")(E):w(E)}function w(E){return E===124?g(E):E===null||Zr(E)?!s||i!==a?A(E):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(E)):A(E)}function A(E){return r(E)}function T(E){return t.enter("tableRow"),S(E)}function S(E){return E===124?(t.enter("tableCellDivider"),t.consume(E),t.exit("tableCellDivider"),S):E===null||Zr(E)?(t.exit("tableRow"),e(E)):di(E)?ki(t,S,"whitespace")(E):(t.enter("data"),O(E))}function O(E){return E===null||E===124||ba(E)?(t.exit("data"),S(E)):(t.consume(E),E===92?k:O)}function k(E){return E===92||E===124?(t.consume(E),O):O(E)}}function Sgr(t,e){let r=-1,n=!0,i=0,a=[0,0,0,0],s=[0,0,0,0],o=!1,l=0,u,h,d;const f=new bgr;for(;++rr[2]+1){const g=r[2]+1,m=r[3]-r[2]-1;t.add(g,m,[])}}t.add(r[3]+1,0,[["exit",d,e]])}return i!==void 0&&(a.end=Object.assign({},dE(e.events,i)),t.add(i,0,[["exit",a,e]]),a=void 0),a}function wYe(t,e,r,n,i){const a=[],s=dE(e.events,r);i&&(i.end=Object.assign({},s),a.push(["exit",i,e])),n.end=Object.assign({},s),a.push(["exit",n,e]),t.add(r+1,0,a)}function dE(t,e){const r=t[e],n=r[0]==="enter"?"start":"end";return r[1][n]}const Cgr={name:"tasklistCheck",tokenize:kgr};function Ogr(){return{text:{91:Cgr}}}function kgr(t,e,r){const n=this;return i;function i(l){return n.previous!==null||!n._gfmTasklistFirstContentOfListItem?r(l):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),a)}function a(l){return ba(l)?(t.enter("taskListCheckValueUnchecked"),t.consume(l),t.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(t.enter("taskListCheckValueChecked"),t.consume(l),t.exit("taskListCheckValueChecked"),s):r(l)}function s(l){return l===93?(t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),o):r(l)}function o(l){return Zr(l)?e(l):di(l)?t.check({tokenize:Egr},e,r)(l):r(l)}}function Egr(t,e,r){return ki(t,n,"whitespace");function n(i){return i===null?r(i):e(i)}}function _gr(t){return YHe([egr(),ugr(),ygr(t),Agr(),Ogr()])}const Rgr={};function Dgr(t){const e=this,r=t||Rgr,n=e.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),a=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),s=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(_gr(r)),a.push(Xpr()),s.push(Kpr(r))}const AYe=function(t,e,r){const n=O6(r);if(!t||!t.type||!t.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(e=t.children.indexOf(e),e<0)throw new Error("Expected child node or index");for(;++eu&&(u=h):h&&(u!==void 0&&u>-1&&l.push(` +`))}function l(p,g,m,v){const y=m.enter("tableCell"),b=m.enter("phrasing"),x=m.containerPhrasing(p,{...v,before:a,after:a});return b(),y(),x}function u(p,g){return apr(p,{align:g,alignDelimiters:n,padding:r,stringLength:i})}function h(p,g,m){const v=p.children;let y=-1;const b=[],x=g.enter("table");for(;++y0&&!r&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const cgr={tokenize:vgr,partial:!0};function ugr(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:pgr,continuation:{tokenize:ggr},exit:mgr}},text:{91:{name:"gfmFootnoteCall",tokenize:fgr},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:hgr,resolveTo:dgr}}}}function hgr(t,e,r){const n=this;let i=n.events.length;const a=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let s;for(;i--;){const l=n.events[i][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!s||!s._balanced)return r(l);const u=Ip(n.sliceSerialize({start:s.end,end:n.now()}));return u.codePointAt(0)!==94||!a.includes(u.slice(1))?r(l):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(l),t.exit("gfmFootnoteCallLabelMarker"),e(l))}}function dgr(t,e){let r=t.length;for(;r--;)if(t[r][1].type==="labelImage"&&t[r][0]==="enter"){t[r][1];break}t[r+1][1].type="data",t[r+3][1].type="gfmFootnoteCallLabelMarker";const n={type:"gfmFootnoteCall",start:Object.assign({},t[r+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[r+3][1].end),end:Object.assign({},t[r+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},o=[t[r+1],t[r+2],["enter",n,e],t[r+3],t[r+4],["enter",i,e],["exit",i,e],["enter",a,e],["enter",s,e],["exit",s,e],["exit",a,e],t[t.length-2],t[t.length-1],["exit",n,e]];return t.splice(r,t.length-r+1,...o),t}function fgr(t,e,r){const n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let a=0,s;return o;function o(d){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?r(d):(t.enter("gfmFootnoteCallMarker"),t.consume(d),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",u)}function u(d){if(a>999||d===93&&!s||d===null||d===91||ba(d))return r(d);if(d===93){t.exit("chunkString");const f=t.exit("gfmFootnoteCallString");return i.includes(Ip(n.sliceSerialize(f)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):r(d)}return ba(d)||(s=!0),a++,t.consume(d),d===92?h:u}function h(d){return d===91||d===92||d===93?(t.consume(d),a++,u):u(d)}}function pgr(t,e,r){const n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let a,s=0,o;return l;function l(g){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",h):r(g)}function h(g){if(s>999||g===93&&!o||g===null||g===91||ba(g))return r(g);if(g===93){t.exit("chunkString");const m=t.exit("gfmFootnoteDefinitionLabelString");return a=Ip(n.sliceSerialize(m)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),f}return ba(g)||(o=!0),s++,t.consume(g),g===92?d:h}function d(g){return g===91||g===92||g===93?(t.consume(g),s++,h):h(g)}function f(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),i.includes(a)||i.push(a),ki(t,p,"gfmFootnoteDefinitionWhitespace")):r(g)}function p(g){return e(g)}}function ggr(t,e,r){return t.check(w6,e,t.attempt(cgr,e,r))}function mgr(t){t.exit("gfmFootnoteDefinition")}function vgr(t,e,r){const n=this;return ki(t,i,"gfmFootnoteDefinitionIndent",5);function i(a){const s=n.events[n.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?e(a):r(a)}}function ygr(t){let r=(t||{}).singleTilde;const n={name:"strikethrough",tokenize:a,resolveAll:i};return r==null&&(r=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function i(s,o){let l=-1;for(;++l1?l(g):(s.consume(g),d++,p);if(d<2&&!r)return l(g);const v=s.exit("strikethroughSequenceTemporary"),y=cE(g);return v._open=!y||y===2&&!!m,v._close=!m||m===2&&!!y,o(g)}}}class bgr{constructor(){this.map=[]}add(e,r,n){xgr(this,e,r,n)}consume(e){if(this.map.sort(function(a,s){return a[0]-s[0]}),this.map.length===0)return;let r=this.map.length;const n=[];for(;r>0;)r-=1,n.push(e.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),e.length=this.map[r][0];n.push(e.slice()),e.length=0;let i=n.pop();for(;i;){for(const a of i)e.push(a);i=n.pop()}this.map.length=0}}function xgr(t,e,r,n){let i=0;if(!(r===0&&n.length===0)){for(;i-1;){const R=n.events[_][1].type;if(R==="lineEnding"||R==="linePrefix")_--;else break}const I=_>-1?n.events[_][1].type:null,L=I==="tableHead"||I==="tableRow"?S:l;return L===S&&n.parser.lazy[n.now().line]?r(E):L(E)}function l(E){return t.enter("tableHead"),t.enter("tableRow"),u(E)}function u(E){return E===124||(s=!0,a+=1),h(E)}function h(E){return E===null?r(E):Zr(E)?a>1?(a=0,n.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(E),t.exit("lineEnding"),p):r(E):di(E)?ki(t,h,"whitespace")(E):(a+=1,s&&(s=!1,i+=1),E===124?(t.enter("tableCellDivider"),t.consume(E),t.exit("tableCellDivider"),s=!0,h):(t.enter("data"),d(E)))}function d(E){return E===null||E===124||ba(E)?(t.exit("data"),h(E)):(t.consume(E),E===92?f:d)}function f(E){return E===92||E===124?(t.consume(E),d):d(E)}function p(E){return n.interrupt=!1,n.parser.lazy[n.now().line]?r(E):(t.enter("tableDelimiterRow"),s=!1,di(E)?ki(t,g,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):g(E))}function g(E){return E===45||E===58?v(E):E===124?(s=!0,t.enter("tableCellDivider"),t.consume(E),t.exit("tableCellDivider"),m):A(E)}function m(E){return di(E)?ki(t,v,"whitespace")(E):v(E)}function v(E){return E===58?(a+=1,s=!0,t.enter("tableDelimiterMarker"),t.consume(E),t.exit("tableDelimiterMarker"),y):E===45?(a+=1,y(E)):E===null||Zr(E)?w(E):A(E)}function y(E){return E===45?(t.enter("tableDelimiterFiller"),b(E)):A(E)}function b(E){return E===45?(t.consume(E),b):E===58?(s=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(E),t.exit("tableDelimiterMarker"),x):(t.exit("tableDelimiterFiller"),x(E))}function x(E){return di(E)?ki(t,w,"whitespace")(E):w(E)}function w(E){return E===124?g(E):E===null||Zr(E)?!s||i!==a?A(E):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(E)):A(E)}function A(E){return r(E)}function S(E){return t.enter("tableRow"),T(E)}function T(E){return E===124?(t.enter("tableCellDivider"),t.consume(E),t.exit("tableCellDivider"),T):E===null||Zr(E)?(t.exit("tableRow"),e(E)):di(E)?ki(t,T,"whitespace")(E):(t.enter("data"),O(E))}function O(E){return E===null||E===124||ba(E)?(t.exit("data"),T(E)):(t.consume(E),E===92?k:O)}function k(E){return E===92||E===124?(t.consume(E),O):O(E)}}function Tgr(t,e){let r=-1,n=!0,i=0,a=[0,0,0,0],s=[0,0,0,0],o=!1,l=0,u,h,d;const f=new bgr;for(;++rr[2]+1){const g=r[2]+1,m=r[3]-r[2]-1;t.add(g,m,[])}}t.add(r[3]+1,0,[["exit",d,e]])}return i!==void 0&&(a.end=Object.assign({},dE(e.events,i)),t.add(i,0,[["exit",a,e]]),a=void 0),a}function wYe(t,e,r,n,i){const a=[],s=dE(e.events,r);i&&(i.end=Object.assign({},s),a.push(["exit",i,e])),n.end=Object.assign({},s),a.push(["exit",n,e]),t.add(r+1,0,a)}function dE(t,e){const r=t[e],n=r[0]==="enter"?"start":"end";return r[1][n]}const Cgr={name:"tasklistCheck",tokenize:kgr};function Ogr(){return{text:{91:Cgr}}}function kgr(t,e,r){const n=this;return i;function i(l){return n.previous!==null||!n._gfmTasklistFirstContentOfListItem?r(l):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),a)}function a(l){return ba(l)?(t.enter("taskListCheckValueUnchecked"),t.consume(l),t.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(t.enter("taskListCheckValueChecked"),t.consume(l),t.exit("taskListCheckValueChecked"),s):r(l)}function s(l){return l===93?(t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),o):r(l)}function o(l){return Zr(l)?e(l):di(l)?t.check({tokenize:Egr},e,r)(l):r(l)}}function Egr(t,e,r){return ki(t,n,"whitespace");function n(i){return i===null?r(i):e(i)}}function _gr(t){return YHe([egr(),ugr(),ygr(t),Agr(),Ogr()])}const Rgr={};function Dgr(t){const e=this,r=t||Rgr,n=e.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),a=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),s=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(_gr(r)),a.push(Xpr()),s.push(Kpr(r))}const AYe=function(t,e,r){const n=O6(r);if(!t||!t.type||!t.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(e=t.children.indexOf(e),e<0)throw new Error("Expected child node or index");for(;++eu&&(u=h):h&&(u!==void 0&&u>-1&&l.push(` `.repeat(u)||" "),u=-1,l.push(h))}return l.join("")}function EYe(t,e,r){return t.type==="element"?Fgr(t,e,r):t.type==="text"?r.whitespace==="normal"?_Ye(t,r):zgr(t):[]}function Fgr(t,e,r){const n=RYe(t,r),i=t.children||[];let a=-1,s=[];if(Bgr(t))return s;let o,l;for(cce(t)||OYe(t)&&AYe(e,t,OYe)?l=` -`:Ngr(t)?(o=2,l=2):kYe(t)&&(o=1,l=1);++a]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.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:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},h={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},d={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},t.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},r,t.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},p=e.optional(i)+t.IDENT_RE+"\\s*\\(",g=["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"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["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"],w={type:m,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},A={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},T=[A,d,o,r,t.C_BLOCK_COMMENT_MODE,h,u],S={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:T.concat([{begin:/\(/,end:/\)/,keywords:w,contains:T.concat(["self"]),relevance:0}]),relevance:0},O={className:"function",begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:w,relevance:0},{begin:p,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,h]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[r,t.C_BLOCK_COMMENT_MODE,u,h,o,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",r,t.C_BLOCK_COMMENT_MODE,u,h,o]}]},o,r,t.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:w,illegal:"",keywords:w,contains:["self",o]},{begin:t.IDENT_RE+"::",keywords:w},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Wgr(t){const e={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"]},r=Hgr(t),n=r.keywords;return n.type=[...n.type,...e.type],n.literal=[...n.literal,...e.literal],n.built_in=[...n.built_in,...e.built_in],n._hints=e._hints,r.name="Arduino",r.aliases=["ino"],r.supersetOf="cpp",r}function Ygr(t){const e=t.regex,r={},n={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},n]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},a=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},o={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,r,i]};i.contains.push(o);const l={match:/\\"/},u={className:"string",begin:/'/,end:/'/},h={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,r]},f=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],p=t.SHEBANG({binary:`(${f.join("|")})`,relevance:10}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["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"],w=["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"],A=["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:m,literal:v,built_in:[...b,...x,"set","shopt",...w,...A]},contains:[p,t.SHEBANG(),g,d,a,s,y,o,l,u,h,r]}}function qgr(t){const e=t.regex,r=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="("+n+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",o={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.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:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},h={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},d={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},t.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},r,t.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},p=e.optional(i)+t.IDENT_RE+"\\s*\\(",v={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=[d,o,r,t.C_BLOCK_COMMENT_MODE,h,u],b={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:y.concat([{begin:/\(/,end:/\)/,keywords:v,contains:y.concat(["self"]),relevance:0}]),relevance:0},x={begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:v,relevance:0},{begin:p,returnBegin:!0,contains:[t.inherit(f,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[r,t.C_BLOCK_COMMENT_MODE,u,h,o,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",r,t.C_BLOCK_COMMENT_MODE,u,h,o]}]},o,r,t.C_BLOCK_COMMENT_MODE,d]};return{name:"C",aliases:["h"],keywords:v,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:d,strings:u,keywords:v}}}function jgr(t){const e=t.regex,r=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+n+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.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:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},h={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},d={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},t.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},r,t.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},p=e.optional(i)+t.IDENT_RE+"\\s*\\(",g=["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"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["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"],w={type:m,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},A={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},T=[A,d,o,r,t.C_BLOCK_COMMENT_MODE,h,u],S={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:T.concat([{begin:/\(/,end:/\)/,keywords:w,contains:T.concat(["self"]),relevance:0}]),relevance:0},O={className:"function",begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:w,relevance:0},{begin:p,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,h]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[r,t.C_BLOCK_COMMENT_MODE,u,h,o,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",r,t.C_BLOCK_COMMENT_MODE,u,h,o]}]},o,r,t.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:w,illegal:"",keywords:w,contains:["self",o]},{begin:t.IDENT_RE+"::",keywords:w},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Xgr(t){const e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],r=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],n=["default","false","null","true"],i=["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"],a=["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"],s={keyword:i.concat(a),built_in:e,literal:n},o=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},h={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},d=t.inherit(h,{illegal:/\n/}),f={className:"subst",begin:/\{/,end:/\}/,keywords:s},p=t.inherit(f,{illegal:/\n/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,p]},m={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]},v=t.inherit(m,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});f.contains=[m,g,h,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,l,t.C_BLOCK_COMMENT_MODE],p.contains=[v,g,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,l,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[u,m,g,h,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},b={begin:"<",end:">",contains:[{beginKeywords:"in out"},o]},x=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",w={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:s,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},y,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},o,b,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,b,t.C_LINE_COMMENT_MODE,t.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+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:s,contains:[{beginKeywords:r.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,b],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[y,l,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},w]}}const Kgr=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.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:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.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_-]*/}}),Zgr=["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"],Jgr=["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"],emr=[...Zgr,...Jgr],tmr=["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(),rmr=["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(),nmr=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),imr=["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 amr(t){const e=t.regex,r=Kgr(t),n={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",a=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",o=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[r.BLOCK_COMMENT,n,r.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},r.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+rmr.join("|")+")"},{begin:":(:)?("+nmr.join("|")+")"}]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+imr.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[r.BLOCK_COMMENT,r.HEXCOLOR,r.IMPORTANT,r.CSS_NUMBER_MODE,...o,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...o,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},r.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:tmr.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...o,r.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+emr.join("|")+")\\b"}]}}function smr(t){const e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.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 omr(t){const a={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:a,illegal:"LYe(t,e,r-1))}function umr(t){const e=t.regex,r="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",n=r+LYe("(?:<"+r+"~~~(?:\\s*,\\s*"+r+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+r,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},h={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,r),/\s+/,r,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,r],className:{1:"keyword",3:"title.class"},contains:[h,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+n+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[u,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,DYe,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},DYe,u]}}const MYe="[A-Za-z$_][0-9A-Za-z$_]*",hmr=["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"],dmr=["true","false","null","undefined","NaN","Infinity"],IYe=["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"],PYe=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],NYe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],fmr=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],pmr=[].concat(NYe,IYe,PYe);function gmr(t){const e=t.regex,r=(N,{after:F})=>{const B="",end:""},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(N,F)=>{const B=N[0].length+N.index,V=N.input[B];if(V==="<"||V===","){F.ignoreMatch();return}V===">"&&(r(N,{after:B})||F.ignoreMatch());let z;const U=N.input.substring(B);if(z=U.match(/^\s*=/)){F.ignoreMatch();return}if((z=U.match(/^\s+extends\s+/))&&z.index===0){F.ignoreMatch();return}}},o={$pattern:MYe,keyword:hmr,literal:dmr,built_in:pmr,"variable.language":fmr},l="[0-9](_?[0-9])*",u=`\\.(${l})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${h})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${h})\\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},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,f]},b={className:"comment",variants:[t.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:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},x=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,g,m,v,{match:/\$\d+/},d];f.contains=x.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(x)});const w=[].concat(b,f.contains),A=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(w)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:A},S={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,e.concat(n,"(",e.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},O={relevance:0,match:e.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:{_:[...IYe,...PYe]}},k={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},E={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},_={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function I(N){return e.concat("(?!",N.join("|"),")")}const L={match:e.concat(/\b/,I([...NYe,"super","import"].map(N=>`${N}\\s*\\(`)),n,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},R={begin:e.concat(/\./,e.lookahead(e.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},D={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},M="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",P={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(M)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:A,CLASS_REFERENCE:O},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),k,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,g,m,v,b,{match:/\$\d+/},d,O,{scope:"attr",match:n+e.lookahead(":"),relevance:0},P,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,t.REGEXP_MODE,{className:"function",begin:M,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:A}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},E,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,t.inherit(t.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},R,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},L,_,S,D,{match:/\$[(.]/}]}}function mmr(t){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},n=["true","false","null"],i={scope:"literal",beginKeywords:n.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:n},contains:[e,r,t.QUOTE_STRING_MODE,i,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var pE="[0-9](_*[0-9])*",sQ=`\\.(${pE})`,oQ="[0-9a-fA-F](_*[0-9a-fA-F])*",vmr={className:"number",variants:[{begin:`(\\b(${pE})((${sQ})|\\.)?|(${sQ}))[eE][+-]?(${pE})[fFdD]?\\b`},{begin:`\\b(${pE})((${sQ})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${sQ})[fFdD]?\\b`},{begin:`\\b(${pE})[fFdD]\\b`},{begin:`\\b0[xX]((${oQ})\\.?|(${oQ})?\\.(${oQ}))[pP][+-]?(${pE})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${oQ})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function ymr(t){const e={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"},r={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},n={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},a={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},s={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[a,i]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,a,i]}]};i.contains.push(s);const o={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(s,{className:"string"}),"self"]}]},u=vmr,h=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:"type",begin:t.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},f=d;return f.variants[1].contains=[d],d.variants[1].contains=[f],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,h,r,n,o,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,t.C_LINE_COMMENT_MODE,h],relevance:0},t.C_LINE_COMMENT_MODE,h,o,l,s,t.C_NUMBER_MODE]},h]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},o,l]},s,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` -`},u]}}const bmr=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.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:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.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_-]*/}}),xmr=["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"],wmr=["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"],Amr=[...xmr,...wmr],Tmr=["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(),BYe=["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(),$Ye=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Smr=["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(),Cmr=BYe.concat($Ye).sort().reverse();function Omr(t){const e=bmr(t),r=Cmr,n="and or not only",i="[\\w-]+",a="("+i+"|@\\{"+i+"\\})",s=[],o=[],l=function(x){return{className:"string",begin:"~?"+x+".*?"+x}},u=function(x,w,A){return{className:x,begin:w,relevance:A}},h={$pattern:/[a-z-]+/,keyword:n,attribute:Tmr.join(" ")},d={begin:"\\(",end:"\\)",contains:o,keywords:h,relevance:0};o.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,l("'"),l('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,d,u("variable","@@?"+i,10),u("variable","@\\{"+i+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);const f=o.concat({begin:/\{/,end:/\}/,contains:s}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(o)},g={begin:a+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Smr.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:o}}]},m={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:h,returnEnd:!0,contains:o,relevance:0}},v={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:f}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:a,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,p,u("keyword","all\\b"),u("variable","@\\{"+i+"\\}"),{begin:"\\b("+Amr.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,u("selector-tag",a,0),u("selector-id","#"+a),u("selector-class","\\."+a,0),u("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+BYe.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+$Ye.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:f},{begin:"!important"},e.FUNCTION_DISPATCH]},b={begin:i+`:(:)?(${r.join("|")})`,returnBegin:!0,contains:[y]};return s.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,m,v,b,g,y,p,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}function kmr(t){const e="\\[=*\\[",r="\\]=*\\]",n={begin:e,end:r,contains:["self"]},i=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,r,{contains:[n],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:t.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:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:r,contains:[n],relevance:5}])}}function Emr(t){const e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},n={begin:"^[-\\*]{3,}",end:"$"},i={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}]},a={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},o=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,o,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},h={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},d=t.inherit(u,{contains:[]}),f=t.inherit(h,{contains:[]});u.contains.push(f),h.contains.push(d);let p=[r,l];return[u,h,d,f].forEach(y=>{y.contains=y.contains.concat(p)}),p=p.concat(u,h),{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}]}]},r,a,u,h,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},i,n,l,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Rmr(t){const e={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+"},r=/[a-zA-Z@][a-zA-Z0-9_]*/,o={"variable.language":["this","super"],$pattern:r,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:r,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:o,illegal:"/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}function Dmr(t){const e=t.regex,r=["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"],n=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:r.join(" ")},a={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},s={begin:/->\{/,end:/\}/},o={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[o]},u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},h=[t.BACKSLASH_ESCAPE,a,l],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(m,v,y="\\1")=>{const b=y==="\\1"?y:e.concat(y,v);return e.concat(e.concat("(?:",m,")"),v,/(?:\\.|[^\\\/])*?/,b,/(?:\\.|[^\\\/])*?/,y,n)},p=(m,v,y)=>e.concat(e.concat("(?:",m,")"),v,/(?:\\.|[^\\\/])*?/,y,n),g=[l,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:h,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:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:f("s|tr|y",e.either(...d,{capture:!0}))},{begin:f("s|tr|y","\\(","\\)")},{begin:f("s|tr|y","\\[","\\]")},{begin:f("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p("(?:m|qr)?",/\//,/\//)},{begin:p("m|qr",e.either(...d,{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:[t.TITLE_MODE,o]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,o,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return a.contains=g,s.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:g}}function Lmr(t){const e=t.regex,r=/(?![A-Za-z0-9])(?![$])/,n=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,r),i=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,r),a=e.concat(/[A-Z]+/,r),s={scope:"variable",match:"\\$+"+n},o={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=t.inherit(t.APOS_STRING_MODE,{illegal:null}),h=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(l)}),d={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(R,D)=>{D.data._beginMatch=R[1]||R[2]},"on:end":(R,D)=>{D.data._beginMatch!==R[1]&&D.ignoreMatch()}},f=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[ -]`,g={scope:"string",variants:[h,u,d,f]},m={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},v=["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"],w={keyword:y,literal:(R=>{const D=[];return R.forEach(M=>{D.push(M),M.toLowerCase()===M?D.push(M.toUpperCase()):D.push(M.toLowerCase())}),D})(v),built_in:b},A=R=>R.map(D=>D.replace(/\|\d+$/,"")),T={variants:[{match:[/new/,e.concat(p,"+"),e.concat("(?!",A(b).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},S=e.concat(n,"\\b(?!\\()"),O={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),S],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,e.concat(/::/,e.lookahead(/(?!class\b)/)),S],scope:{1:"title.class",3:"variable.constant"}},{match:[i,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},k={scope:"attr",match:e.concat(n,e.lookahead(":"),e.lookahead(/(?!::)/))},E={relevance:0,begin:/\(/,end:/\)/,keywords:w,contains:[k,s,O,t.C_BLOCK_COMMENT_MODE,g,m,T]},_={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",A(y).join("\\b|"),"|",A(b).join("\\b|"),"\\b)"),n,e.concat(p,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[E]};E.contains.push(_);const I=[k,O,t.C_BLOCK_COMMENT_MODE,g,m,T],L={begin:e.concat(/#\[\s*\\?/,e.either(i,a)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...I]},...I,{scope:"meta",variants:[{match:i},{match:a}]}]};return{case_insensitive:!1,keywords:w,contains:[L,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},o,{scope:"variable.language",match:/\$this\b/},s,_,O,{match:[/const/,/\s/,n],scope:{1:"keyword",3:"variable.constant"}},T,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:w,contains:["self",L,s,O,t.C_BLOCK_COMMENT_MODE,g,m]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},g,m]}}function Mmr(t){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},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function Imr(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Pmr(t){const e=t.regex,r=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),n=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],o={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:n,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:o,illegal:/#/},h={begin:/\{\{/,relevance:0},d={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,l,h,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,l,h,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:[t.BACKSLASH_ESCAPE,h,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,h,u]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},f="[0-9](_?[0-9])*",p=`(\\b(${f}))?\\.(${f})|\\b(${f})\\.`,g=`\\b|${n.join("|")}`,m={className:"number",relevance:0,variants:[{begin:`(\\b(${f})|(${p}))[eE][+-]?(${f})[jJ]?(?=${g})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${f})[jJ](?=${g})`}]},v={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:o,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:o,contains:["self",l,m,d,t.HASH_COMMENT_MODE]}]};return u.contains=[d,m,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[l,m,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},d,v,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[m,y,d]}]}}function Nmr(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function Bmr(t){const e=t.regex,r=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,n=e.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]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,a=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:r,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:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:r},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,n]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,n]},{scope:{1:"punctuation",2:"number"},match:[a,n]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,n]}]},{scope:{3:"operator"},match:[r,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:a},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function $mr(t){const e=t.regex,r="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",n=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=e.concat(n,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},o={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},u=[t.COMMENT("#","$",{contains:[o]}),t.COMMENT("^=begin","^=end",{contains:[o],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],h={className:"subst",begin:/#\{/,end:/\}/,keywords:s},d={className:"string",contains:[t.BACKSLASH_ESCAPE,h],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:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,h]})]}]},f="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",g={className:"number",relevance:0,variants:[{begin:`\\b(${f})(\\.(${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"}]},m={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},T=[d,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:s},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:n,scope:"title.class"},{match:[/def/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[m]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[d,{begin:r}],relevance:0},g,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,h],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,u),relevance:0}].concat(l,u);h.contains=T,m.contains=T;const E=[{begin:/^\s*=>/,starts:{end:"$",contains:T}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:s,contains:T}}];return u.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(E).concat(u).concat(T)}}function Fmr(t){const e=t.regex,r=/(r#)?/,n=e.concat(r,t.UNDERSCORE_IDENT_RE),i=e.concat(r,t.IDENT_RE),a={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,e.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",o=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],h=["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:t.IDENT_RE+"!?",type:h,keyword:o,literal:l,built_in:u},illegal:""},a]}}const zmr=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.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:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.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_-]*/}}),Umr=["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"],Vmr=["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"],Qmr=[...Umr,...Vmr],Gmr=["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(),Hmr=["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(),Wmr=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Ymr=["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 qmr(t){const e=zmr(t),r=Wmr,n=Hmr,i="@[a-z-]+",a="and or not only",o={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+Qmr.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+n.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+r.join("|")+")"},o,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Ymr.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:[e.BLOCK_COMMENT,o,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:Gmr.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},o,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function jmr(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function Xmr(t){const e=t.regex,r=t.COMMENT("--","$"),n={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],o=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],h=["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"],d=["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"],f=["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=h,g=[...u,...l].filter(A=>!h.includes(A)),m={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:e.concat(/\b/,e.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function b(A){return e.concat(/\b/,e.either(...A.map(T=>T.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:b(f),relevance:0};function w(A,{exceptions:T,when:S}={}){const O=S;return T=T||[],A.map(k=>k.match(/\|\d+$/)||T.includes(k)?k:O(k)?`${k}|0`:k)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:w(g,{when:A=>A.length<3}),literal:a,type:o,built_in:d},contains:[{scope:"type",match:b(s)},x,y,m,n,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,r,v]}}function FYe(t){return t?typeof t=="string"?t:t.source:null}function R6(t){return ua("(?=",t,")")}function ua(...t){return t.map(r=>FYe(r)).join("")}function Kmr(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function gu(...t){return"("+(Kmr(t).capture?"":"?:")+t.map(n=>FYe(n)).join("|")+")"}const uce=t=>ua(/\b/,t,/\w$/.test(t)?/\b/:/\B/),Zmr=["Protocol","Type"].map(uce),zYe=["init","self"].map(uce),Jmr=["Any","Self"],hce=["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"],UYe=["false","nil","true"],e0r=["assignment","associativity","higherThan","left","lowerThan","none","right"],t0r=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],VYe=["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"],QYe=gu(/[/=\-+!*%<>&|^~?]/,/[\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]/),GYe=gu(QYe,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),dce=ua(QYe,GYe,"*"),HYe=gu(/[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]/),lQ=gu(HYe,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),em=ua(HYe,lQ,"*"),cQ=ua(/[A-Z]/,lQ,"*"),r0r=["attached","autoclosure",ua(/convention\(/,gu("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",ua(/objc\(/,em,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],n0r=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function i0r(t){const e={match:/\s+/,relevance:0},r=t.COMMENT("/\\*","\\*/",{contains:["self"]}),n=[t.C_LINE_COMMENT_MODE,r],i={match:[/\./,gu(...Zmr,...zYe)],className:{2:"keyword"}},a={match:ua(/\./,gu(...hce)),relevance:0},s=hce.filter(Oe=>typeof Oe=="string").concat(["_|0"]),o=hce.filter(Oe=>typeof Oe!="string").concat(Jmr).map(uce),l={variants:[{className:"keyword",match:gu(...o,...zYe)}]},u={$pattern:gu(/\b\w+/,/#\w+/),keyword:s.concat(t0r),literal:UYe},h=[i,a,l],d={match:ua(/\./,gu(...VYe)),relevance:0},f={className:"built_in",match:ua(/\b/,gu(...VYe),/(?=\()/)},p=[d,f],g={match:/->/,relevance:0},m={className:"operator",relevance:0,variants:[{match:dce},{match:`\\.(\\.|${GYe})+`}]},v=[g,m],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/}]},w=(Oe="")=>({className:"subst",variants:[{match:ua(/\\/,Oe,/[0\\tnr"']/)},{match:ua(/\\/,Oe,/u\{[0-9a-fA-F]{1,8}\}/)}]}),A=(Oe="")=>({className:"subst",match:ua(/\\/,Oe,/[\t ]*(?:[\r\n]|\r\n)/)}),T=(Oe="")=>({className:"subst",label:"interpol",begin:ua(/\\/,Oe,/\(/),end:/\)/}),S=(Oe="")=>({begin:ua(Oe,/"""/),end:ua(/"""/,Oe),contains:[w(Oe),A(Oe),T(Oe)]}),O=(Oe="")=>({begin:ua(Oe,/"/),end:ua(/"/,Oe),contains:[w(Oe),T(Oe)]}),k={className:"string",variants:[S(),S("#"),S("##"),S("###"),O(),O("#"),O("##"),O("###")]},E=[t.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[t.BACKSLASH_ESCAPE]}],_={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:E},I=Oe=>{const $e=ua(Oe,/\//),he=ua(/\//,Oe);return{begin:$e,end:he,contains:[...E,{scope:"comment",begin:`#(?!.*${he})`,end:/$/}]}},L={scope:"regexp",variants:[I("###"),I("##"),I("#"),_]},R={match:ua(/`/,em,/`/)},D={className:"variable",match:/\$\d+/},M={className:"variable",match:`\\$${lQ}+`},P=[R,D,M],N={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:n0r,contains:[...v,x,k]}]}},F={scope:"keyword",match:ua(/@/,gu(...r0r),R6(gu(/\(/,/\s+/)))},B={scope:"meta",match:ua(/@/,em)},V=[N,F,B],z={match:R6(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:ua(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,lQ,"+")},{className:"type",match:cQ,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:ua(/\s+&\s+/,R6(cQ)),relevance:0}]},U={begin://,keywords:u,contains:[...n,...h,...V,g,z]};z.contains.push(U);const Q={match:ua(em,/\s*:/),keywords:"_|0",relevance:0},G={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",Q,...n,L,...h,...p,...v,x,k,...P,...V,z]},X={begin://,keywords:"repeat each",contains:[...n,z]},Y={begin:gu(R6(ua(em,/\s*:/)),R6(ua(em,/\s+/,em,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:em}]},le={begin:/\(/,end:/\)/,keywords:u,contains:[Y,...n,...h,...v,x,k,...V,z,G],endsParent:!0,illegal:/["']/},q={match:[/(func|macro)/,/\s+/,gu(R.match,em,dce)],className:{1:"keyword",3:"title.function"},contains:[X,le,e],illegal:[/\[/,/%/]},Z={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[X,le,e],illegal:/\[|%/},ee={match:[/operator/,/\s+/,dce],className:{1:"keyword",3:"title"}},re={begin:[/precedencegroup/,/\s+/,cQ],className:{1:"keyword",3:"title"},contains:[z],keywords:[...e0r,...UYe],end:/}/},ve={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},ae={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Ce={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,em,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[X,...h,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:cQ},...h],relevance:0}]};for(const Oe of k.variants){const $e=Oe.contains.find(fe=>fe.label==="interpol");$e.keywords=u;const he=[...h,...p,...v,x,k,...P];$e.contains=[...he,{begin:/\(/,end:/\)/,contains:["self",...he]}]}return{name:"Swift",keywords:u,contains:[...n,q,Z,ve,ae,Ce,ee,re,{beginKeywords:"import",end:/$/,contains:[...n],relevance:0},L,...h,...p,...v,x,k,...P,...V,z,G]}}const uQ="[A-Za-z$_][0-9A-Za-z$_]*",WYe=["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"],YYe=["true","false","null","undefined","NaN","Infinity"],qYe=["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"],jYe=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],XYe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],KYe=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ZYe=[].concat(XYe,qYe,jYe);function a0r(t){const e=t.regex,r=(N,{after:F})=>{const B="",end:""},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(N,F)=>{const B=N[0].length+N.index,V=N.input[B];if(V==="<"||V===","){F.ignoreMatch();return}V===">"&&(r(N,{after:B})||F.ignoreMatch());let z;const U=N.input.substring(B);if(z=U.match(/^\s*=/)){F.ignoreMatch();return}if((z=U.match(/^\s+extends\s+/))&&z.index===0){F.ignoreMatch();return}}},o={$pattern:uQ,keyword:WYe,literal:YYe,built_in:ZYe,"variable.language":KYe},l="[0-9](_?[0-9])*",u=`\\.(${l})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${h})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${h})\\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},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,f]},b={className:"comment",variants:[t.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:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},x=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,g,m,v,{match:/\$\d+/},d];f.contains=x.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(x)});const w=[].concat(b,f.contains),A=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(w)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:A},S={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,e.concat(n,"(",e.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},O={relevance:0,match:e.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:{_:[...qYe,...jYe]}},k={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},E={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},_={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function I(N){return e.concat("(?!",N.join("|"),")")}const L={match:e.concat(/\b/,I([...XYe,"super","import"].map(N=>`${N}\\s*\\(`)),n,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},R={begin:e.concat(/\./,e.lookahead(e.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},D={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},M="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",P={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(M)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:A,CLASS_REFERENCE:O},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),k,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,g,m,v,b,{match:/\$\d+/},d,O,{scope:"attr",match:n+e.lookahead(":"),relevance:0},P,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,t.REGEXP_MODE,{className:"function",begin:M,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:A}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},E,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,t.inherit(t.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},R,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},L,_,S,D,{match:/\$[(.]/}]}}function s0r(t){const e=t.regex,r=a0r(t),n=uQ,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[r.exports.CLASS_REFERENCE]},o={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:uQ,keyword:WYe.concat(l),literal:YYe,built_in:ZYe.concat(i),"variable.language":KYe},h={className:"meta",begin:"@"+n},d=(m,v,y)=>{const b=m.contains.findIndex(x=>x.label===v);if(b===-1)throw new Error("can not find mode to replace");m.contains.splice(b,1,y)};Object.assign(r.keywords,u),r.exports.PARAMS_CONTAINS.push(h);const f=r.contains.find(m=>m.scope==="attr"),p=Object.assign({},f,{match:e.concat(n,e.lookahead(/\s*\?:/))});r.exports.PARAMS_CONTAINS.push([r.exports.CLASS_REFERENCE,f,p]),r.contains=r.contains.concat([h,a,s,p]),d(r,"shebang",t.SHEBANG()),d(r,"use_strict",o);const g=r.contains.find(m=>m.label==="func.def");return g.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}function o0r(t){const e=t.regex,r={className:"string",begin:/"(""|[^/n])"C\b/},n={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,o=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:e.concat(/# */,e.either(a,i),/ *#/)},{begin:e.concat(/# */,o,/ *#/)},{begin:e.concat(/# */,s,/ *#/)},{begin:e.concat(/# */,e.either(a,i),/ +/,e.either(s,o),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},h={className:"label",begin:/^\w+:/},d=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),f=t.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:[r,n,l,u,h,d,f,{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:[f]}]}}function l0r(t){t.regex;const e=t.COMMENT(/\(;/,/;\)/);e.contains.push("self");const r=t.COMMENT(/;;/,/$/),n=["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"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},a={className:"variable",begin:/\$[\w_]+/},s={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},o={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:n},contains:[r,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},a,s,i,t.QUOTE_STRING_MODE,l,u,o]}}function c0r(t){const e=t.regex,r=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),n=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(a,{begin:/\(/,end:/\)/}),o=t.inherit(t.APOS_STRING_MODE,{className:"string"}),l=t.inherit(t.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:[a,l,o,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[a,s,l,o]}]}]},t.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:r,relevance:0,starts:u}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(r,/>/))),contains:[{className:"name",begin:r,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function u0r(t){const e="true false yes no null",r="[\\w#;/?:@&=+$,.~*'()[\\]]+",n={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},o=t.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),f={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:e,relevance:0},g={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},m={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},v=[n,{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+!"+r},{className:"type",begin:"!<"+r+">"},{className:"type",begin:"!"+r},{className:"type",begin:"!!"+r},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},f,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},g,m,a,s],y=[...v];return y.pop(),y.push(o),p.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const h0r={arduino:Wgr,bash:Ygr,c:qgr,cpp:jgr,csharp:Xgr,css:amr,diff:smr,go:omr,graphql:lmr,ini:cmr,java:umr,javascript:gmr,json:mmr,kotlin:ymr,less:Omr,lua:kmr,makefile:Emr,markdown:_mr,objectivec:Rmr,perl:Dmr,php:Lmr,"php-template":Mmr,plaintext:Imr,python:Pmr,"python-repl":Nmr,r:Bmr,ruby:$mr,rust:Fmr,scss:qmr,shell:jmr,sql:Xmr,swift:i0r,typescript:s0r,vbnet:o0r,wasm:l0r,xml:c0r,yaml:u0r};function JYe(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{const r=t[e],n=typeof r;(n==="object"||n==="function")&&!Object.isFrozen(r)&&JYe(r)}),t}class eqe{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function tqe(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Vb(t,...e){const r=Object.create(null);for(const n in t)r[n]=t[n];return e.forEach(function(n){for(const i in n)r[i]=n[i]}),r}const d0r="
",rqe=t=>!!t.scope,f0r=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const r=t.split(".");return[`${e}${r.shift()}`,...r.map((n,i)=>`${n}${"_".repeat(i+1)}`)].join(" ")}return`${e}${t}`};class p0r{constructor(e,r){this.buffer="",this.classPrefix=r.classPrefix,e.walk(this)}addText(e){this.buffer+=tqe(e)}openNode(e){if(!rqe(e))return;const r=f0r(e.scope,{prefix:this.classPrefix});this.span(r)}closeNode(e){rqe(e)&&(this.buffer+=d0r)}value(){return this.buffer}span(e){this.buffer+=``}}const nqe=(t={})=>{const e={children:[]};return Object.assign(e,t),e};class fce{constructor(){this.rootNode=nqe(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const r=nqe({scope:e});this.add(r),this.stack.push(r)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,r){return typeof r=="string"?e.addText(r):r.children&&(e.openNode(r),r.children.forEach(n=>this._walk(e,n)),e.closeNode(r)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(r=>typeof r=="string")?e.children=[e.children.join("")]:e.children.forEach(r=>{fce._collapse(r)}))}}class g0r extends fce{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,r){const n=e.root;r&&(n.scope=`language:${r}`),this.add(n)}toHTML(){return new p0r(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function D6(t){return t?typeof t=="string"?t:t.source:null}function iqe(t){return sA("(?=",t,")")}function m0r(t){return sA("(?:",t,")*")}function v0r(t){return sA("(?:",t,")?")}function sA(...t){return t.map(r=>D6(r)).join("")}function y0r(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function pce(...t){return"("+(y0r(t).capture?"":"?:")+t.map(n=>D6(n)).join("|")+")"}function aqe(t){return new RegExp(t.toString()+"|").exec("").length-1}function b0r(t,e){const r=t&&t.exec(e);return r&&r.index===0}const x0r=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function gce(t,{joinWith:e}){let r=0;return t.map(n=>{r+=1;const i=r;let a=D6(n),s="";for(;a.length>0;){const o=x0r.exec(a);if(!o){s+=a;break}s+=a.substring(0,o.index),a=a.substring(o.index+o[0].length),o[0][0]==="\\"&&o[1]?s+="\\"+String(Number(o[1])+i):(s+=o[0],o[0]==="("&&r++)}return s}).map(n=>`(${n})`).join(e)}const w0r=/\b\B/,sqe="[a-zA-Z]\\w*",mce="[a-zA-Z_]\\w*",oqe="\\b\\d+(\\.\\d+)?",lqe="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",cqe="\\b(0b[01]+)",A0r="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",T0r=(t={})=>{const e=/^#![ ]*\//;return t.binary&&(t.begin=sA(e,/.*\b/,t.binary,/\b.*/)),Vb({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(r,n)=>{r.index!==0&&n.ignoreMatch()}},t)},L6={begin:"\\\\[\\s\\S]",relevance:0},S0r={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[L6]},C0r={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[L6]},O0r={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/},hQ=function(t,e,r={}){const n=Vb({scope:"comment",begin:t,end:e,contains:[]},r);n.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 i=pce("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 n.contains.push({begin:sA(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},k0r=hQ("//","$"),E0r=hQ("/\\*","\\*/"),_0r=hQ("#","$"),R0r={scope:"number",begin:oqe,relevance:0},D0r={scope:"number",begin:lqe,relevance:0},L0r={scope:"number",begin:cqe,relevance:0},M0r={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[L6,{begin:/\[/,end:/\]/,relevance:0,contains:[L6]}]},I0r={scope:"title",begin:sqe,relevance:0},P0r={scope:"title",begin:mce,relevance:0},N0r={begin:"\\.\\s*"+mce,relevance:0};var dQ=Object.freeze({__proto__:null,APOS_STRING_MODE:S0r,BACKSLASH_ESCAPE:L6,BINARY_NUMBER_MODE:L0r,BINARY_NUMBER_RE:cqe,COMMENT:hQ,C_BLOCK_COMMENT_MODE:E0r,C_LINE_COMMENT_MODE:k0r,C_NUMBER_MODE:D0r,C_NUMBER_RE:lqe,END_SAME_AS_BEGIN:function(t){return Object.assign(t,{"on:begin":(e,r)=>{r.data._beginMatch=e[1]},"on:end":(e,r)=>{r.data._beginMatch!==e[1]&&r.ignoreMatch()}})},HASH_COMMENT_MODE:_0r,IDENT_RE:sqe,MATCH_NOTHING_RE:w0r,METHOD_GUARD:N0r,NUMBER_MODE:R0r,NUMBER_RE:oqe,PHRASAL_WORDS_MODE:O0r,QUOTE_STRING_MODE:C0r,REGEXP_MODE:M0r,RE_STARTERS_RE:A0r,SHEBANG:T0r,TITLE_MODE:I0r,UNDERSCORE_IDENT_RE:mce,UNDERSCORE_TITLE_MODE:P0r});function B0r(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function $0r(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function F0r(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=B0r,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function z0r(t,e){Array.isArray(t.illegal)&&(t.illegal=pce(...t.illegal))}function U0r(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function V0r(t,e){t.relevance===void 0&&(t.relevance=1)}const Q0r=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");const r=Object.assign({},t);Object.keys(t).forEach(n=>{delete t[n]}),t.keywords=r.keywords,t.begin=sA(r.beforeMatch,iqe(r.begin)),t.starts={relevance:0,contains:[Object.assign(r,{endsParent:!0})]},t.relevance=0,delete r.beforeMatch},G0r=["of","and","for","in","not","or","if","then","parent","list","value"],H0r="keyword";function uqe(t,e,r=H0r){const n=Object.create(null);return typeof t=="string"?i(r,t.split(" ")):Array.isArray(t)?i(r,t):Object.keys(t).forEach(function(a){Object.assign(n,uqe(t[a],e,a))}),n;function i(a,s){e&&(s=s.map(o=>o.toLowerCase())),s.forEach(function(o){const l=o.split("|");n[l[0]]=[a,W0r(l[0],l[1])]})}}function W0r(t,e){return e?Number(e):Y0r(t)?0:1}function Y0r(t){return G0r.includes(t.toLowerCase())}const hqe={},oA=t=>{console.error(t)},dqe=(t,...e)=>{console.log(`WARN: ${t}`,...e)},gE=(t,e)=>{hqe[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),hqe[`${t}/${e}`]=!0)},fQ=new Error;function fqe(t,e,{key:r}){let n=0;const i=t[r],a={},s={};for(let o=1;o<=e.length;o++)s[o+n]=i[o],a[o+n]=!0,n+=aqe(e[o-1]);t[r]=s,t[r]._emit=a,t[r]._multi=!0}function q0r(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw oA("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),fQ;if(typeof t.beginScope!="object"||t.beginScope===null)throw oA("beginScope must be object"),fQ;fqe(t,t.begin,{key:"beginScope"}),t.begin=gce(t.begin,{joinWith:""})}}function j0r(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw oA("skip, excludeEnd, returnEnd not compatible with endScope: {}"),fQ;if(typeof t.endScope!="object"||t.endScope===null)throw oA("endScope must be object"),fQ;fqe(t,t.end,{key:"endScope"}),t.end=gce(t.end,{joinWith:""})}}function X0r(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function K0r(t){X0r(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),q0r(t),j0r(t)}function Z0r(t){function e(s,o){return new RegExp(D6(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(o?"g":""))}class r{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(o,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,o]),this.matchAt+=aqe(o)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const o=this.regexes.map(l=>l[1]);this.matcherRe=e(gce(o,{joinWith:"|"}),!0),this.lastIndex=0}exec(o){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(o);if(!l)return null;const u=l.findIndex((d,f)=>f>0&&d!==void 0),h=this.matchIndexes[u];return l.splice(0,u),Object.assign(l,h)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(o){if(this.multiRegexes[o])return this.multiRegexes[o];const l=new r;return this.rules.slice(o).forEach(([u,h])=>l.addRule(u,h)),l.compile(),this.multiRegexes[o]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(o,l){this.rules.push([o,l]),l.type==="begin"&&this.count++}exec(o){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(o);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const h=this.getMatcher(0);h.lastIndex=this.lastIndex+1,u=h.exec(o)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function i(s){const o=new n;return s.contains.forEach(l=>o.addRule(l.begin,{rule:l,type:"begin"})),s.terminatorEnd&&o.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&o.addRule(s.illegal,{type:"illegal"}),o}function a(s,o){const l=s;if(s.isCompiled)return l;[$0r,U0r,K0r,Q0r].forEach(h=>h(s,o)),t.compilerExtensions.forEach(h=>h(s,o)),s.__beforeBegin=null,[F0r,z0r,V0r].forEach(h=>h(s,o)),s.isCompiled=!0;let u=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),u=s.keywords.$pattern,delete s.keywords.$pattern),u=u||/\w+/,s.keywords&&(s.keywords=uqe(s.keywords,t.case_insensitive)),l.keywordPatternRe=e(u,!0),o&&(s.begin||(s.begin=/\B|\b/),l.beginRe=e(l.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(l.endRe=e(l.end)),l.terminatorEnd=D6(l.end)||"",s.endsWithParent&&o.terminatorEnd&&(l.terminatorEnd+=(s.end?"|":"")+o.terminatorEnd)),s.illegal&&(l.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(h){return J0r(h==="self"?s:h)})),s.contains.forEach(function(h){a(h,l)}),s.starts&&a(s.starts,o),l.matcher=i(l),l}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=Vb(t.classNameAliases||{}),a(t)}function pqe(t){return t?t.endsWithParent||pqe(t.starts):!1}function J0r(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return Vb(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:pqe(t)?Vb(t,{starts:t.starts?Vb(t.starts):null}):Object.isFrozen(t)?Vb(t):t}var evr="11.11.1";class tvr extends Error{constructor(e,r){super(e),this.name="HTMLInjectionError",this.html=r}}const vce=tqe,gqe=Vb,mqe=Symbol("nomatch"),rvr=7,vqe=function(t){const e=Object.create(null),r=Object.create(null),n=[];let i=!0;const a="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let o={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:g0r};function l(M){return o.noHighlightRe.test(M)}function u(M){let P=M.className+" ";P+=M.parentNode?M.parentNode.className:"";const N=o.languageDetectRe.exec(P);if(N){const F=O(N[1]);return F||(dqe(a.replace("{}",N[1])),dqe("Falling back to no-highlight mode for this block.",M)),F?N[1]:"no-highlight"}return P.split(/\s+/).find(F=>l(F)||O(F))}function h(M,P,N){let F="",B="";typeof P=="object"?(F=M,N=P.ignoreIllegals,B=P.language):(gE("10.7.0","highlight(lang, code, ...args) has been deprecated."),gE("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),B=M,F=P),N===void 0&&(N=!0);const V={code:F,language:B};R("before:highlight",V);const z=V.result?V.result:d(V.language,V.code,N);return z.code=V.code,R("after:highlight",z),z}function d(M,P,N,F){const B=Object.create(null);function V(K,ce){return K.keywords[ce]}function z(){if(!he.keywords){Te.addText(ge);return}let K=0;he.keywordPatternRe.lastIndex=0;let ce=he.keywordPatternRe.exec(ge),be="";for(;ce;){be+=ge.substring(K,ce.index);const ne=Ce.case_insensitive?ce[0].toLowerCase():ce[0],j=V(he,ne);if(j){const[ie,pe]=j;if(Te.addText(be),be="",B[ne]=(B[ne]||0)+1,B[ne]<=rvr&&(Qe+=pe),ie.startsWith("_"))be+=ce[0];else{const te=Ce.classNameAliases[ie]||ie;G(ce[0],te)}}else be+=ce[0];K=he.keywordPatternRe.lastIndex,ce=he.keywordPatternRe.exec(ge)}be+=ge.substring(K),Te.addText(be)}function U(){if(ge==="")return;let K=null;if(typeof he.subLanguage=="string"){if(!e[he.subLanguage]){Te.addText(ge);return}K=d(he.subLanguage,ge,!0,fe[he.subLanguage]),fe[he.subLanguage]=K._top}else K=p(ge,he.subLanguage.length?he.subLanguage:null);he.relevance>0&&(Qe+=K.relevance),Te.__addSublanguage(K._emitter,K.language)}function Q(){he.subLanguage!=null?U():z(),ge=""}function G(K,ce){K!==""&&(Te.startScope(ce),Te.addText(K),Te.endScope())}function X(K,ce){let be=1;const ne=ce.length-1;for(;be<=ne;){if(!K._emit[be]){be++;continue}const j=Ce.classNameAliases[K[be]]||K[be],ie=ce[be];j?G(ie,j):(ge=ie,z(),ge=""),be++}}function Y(K,ce){return K.scope&&typeof K.scope=="string"&&Te.openNode(Ce.classNameAliases[K.scope]||K.scope),K.beginScope&&(K.beginScope._wrap?(G(ge,Ce.classNameAliases[K.beginScope._wrap]||K.beginScope._wrap),ge=""):K.beginScope._multi&&(X(K.beginScope,ce),ge="")),he=Object.create(K,{parent:{value:he}}),he}function le(K,ce,be){let ne=b0r(K.endRe,be);if(ne){if(K["on:end"]){const j=new eqe(K);K["on:end"](ce,j),j.isMatchIgnored&&(ne=!1)}if(ne){for(;K.endsParent&&K.parent;)K=K.parent;return K}}if(K.endsWithParent)return le(K.parent,ce,be)}function q(K){return he.matcher.regexIndex===0?(ge+=K[0],1):(qe=!0,0)}function Z(K){const ce=K[0],be=K.rule,ne=new eqe(be),j=[be.__beforeBegin,be["on:begin"]];for(const ie of j)if(ie&&(ie(K,ne),ne.isMatchIgnored))return q(ce);return be.skip?ge+=ce:(be.excludeBegin&&(ge+=ce),Q(),!be.returnBegin&&!be.excludeBegin&&(ge=ce)),Y(be,K),be.returnBegin?0:ce.length}function ee(K){const ce=K[0],be=P.substring(K.index),ne=le(he,K,be);if(!ne)return mqe;const j=he;he.endScope&&he.endScope._wrap?(Q(),G(ce,he.endScope._wrap)):he.endScope&&he.endScope._multi?(Q(),X(he.endScope,K)):j.skip?ge+=ce:(j.returnEnd||j.excludeEnd||(ge+=ce),Q(),j.excludeEnd&&(ge=ce));do he.scope&&Te.closeNode(),!he.skip&&!he.subLanguage&&(Qe+=he.relevance),he=he.parent;while(he!==ne.parent);return ne.starts&&Y(ne.starts,K),j.returnEnd?0:ce.length}function re(){const K=[];for(let ce=he;ce!==Ce;ce=ce.parent)ce.scope&&K.unshift(ce.scope);K.forEach(ce=>Te.openNode(ce))}let ve={};function ae(K,ce){const be=ce&&ce[0];if(ge+=K,be==null)return Q(),0;if(ve.type==="begin"&&ce.type==="end"&&ve.index===ce.index&&be===""){if(ge+=P.slice(ce.index,ce.index+1),!i){const ne=new Error(`0 width match regex (${M})`);throw ne.languageName=M,ne.badRule=ve.rule,ne}return 1}if(ve=ce,ce.type==="begin")return Z(ce);if(ce.type==="illegal"&&!N){const ne=new Error('Illegal lexeme "'+be+'" for mode "'+(he.scope||"")+'"');throw ne.mode=he,ne}else if(ce.type==="end"){const ne=ee(ce);if(ne!==mqe)return ne}if(ce.type==="illegal"&&be==="")return ge+=` -`,1;if(De>1e5&&De>ce.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ge+=be,be.length}const Ce=O(M);if(!Ce)throw oA(a.replace("{}",M)),new Error('Unknown language: "'+M+'"');const Oe=Z0r(Ce);let $e="",he=F||Oe;const fe={},Te=new o.__emitter(o);re();let ge="",Qe=0,Se=0,De=0,qe=!1;try{if(Ce.__emitTokens)Ce.__emitTokens(P,Te);else{for(he.matcher.considerAll();;){De++,qe?qe=!1:he.matcher.considerAll(),he.matcher.lastIndex=Se;const K=he.matcher.exec(P);if(!K)break;const ce=P.substring(Se,K.index),be=ae(ce,K);Se=K.index+be}ae(P.substring(Se))}return Te.finalize(),$e=Te.toHTML(),{language:M,value:$e,relevance:Qe,illegal:!1,_emitter:Te,_top:he}}catch(K){if(K.message&&K.message.includes("Illegal"))return{language:M,value:vce(P),illegal:!0,relevance:0,_illegalBy:{message:K.message,index:Se,context:P.slice(Se-100,Se+100),mode:K.mode,resultSoFar:$e},_emitter:Te};if(i)return{language:M,value:vce(P),illegal:!1,relevance:0,errorRaised:K,_emitter:Te,_top:he};throw K}}function f(M){const P={value:vce(M),illegal:!1,relevance:0,_top:s,_emitter:new o.__emitter(o)};return P._emitter.addText(M),P}function p(M,P){P=P||o.languages||Object.keys(e);const N=f(M),F=P.filter(O).filter(E).map(Q=>d(Q,M,!1));F.unshift(N);const B=F.sort((Q,G)=>{if(Q.relevance!==G.relevance)return G.relevance-Q.relevance;if(Q.language&&G.language){if(O(Q.language).supersetOf===G.language)return 1;if(O(G.language).supersetOf===Q.language)return-1}return 0}),[V,z]=B,U=V;return U.secondBest=z,U}function g(M,P,N){const F=P&&r[P]||N;M.classList.add("hljs"),M.classList.add(`language-${F}`)}function m(M){let P=null;const N=u(M);if(l(N))return;if(R("before:highlightElement",{el:M,language:N}),M.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",M);return}if(M.children.length>0&&(o.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(M)),o.throwUnescapedHTML))throw new tvr("One of your code blocks includes unescaped HTML.",M.innerHTML);P=M;const F=P.textContent,B=N?h(F,{language:N,ignoreIllegals:!0}):p(F);M.innerHTML=B.value,M.dataset.highlighted="yes",g(M,N,B.language),M.result={language:B.language,re:B.relevance,relevance:B.relevance},B.secondBest&&(M.secondBest={language:B.secondBest.language,relevance:B.secondBest.relevance}),R("after:highlightElement",{el:M,result:B,text:F})}function v(M){o=gqe(o,M)}const y=()=>{w(),gE("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function b(){w(),gE("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function w(){function M(){w()}if(document.readyState==="loading"){x||window.addEventListener("DOMContentLoaded",M,!1),x=!0;return}document.querySelectorAll(o.cssSelector).forEach(m)}function A(M,P){let N=null;try{N=P(t)}catch(F){if(oA("Language definition for '{}' could not be registered.".replace("{}",M)),i)oA(F);else throw F;N=s}N.name||(N.name=M),e[M]=N,N.rawDefinition=P.bind(null,t),N.aliases&&k(N.aliases,{languageName:M})}function T(M){delete e[M];for(const P of Object.keys(r))r[P]===M&&delete r[P]}function S(){return Object.keys(e)}function O(M){return M=(M||"").toLowerCase(),e[M]||e[r[M]]}function k(M,{languageName:P}){typeof M=="string"&&(M=[M]),M.forEach(N=>{r[N.toLowerCase()]=P})}function E(M){const P=O(M);return P&&!P.disableAutodetect}function _(M){M["before:highlightBlock"]&&!M["before:highlightElement"]&&(M["before:highlightElement"]=P=>{M["before:highlightBlock"](Object.assign({block:P.el},P))}),M["after:highlightBlock"]&&!M["after:highlightElement"]&&(M["after:highlightElement"]=P=>{M["after:highlightBlock"](Object.assign({block:P.el},P))})}function I(M){_(M),n.push(M)}function L(M){const P=n.indexOf(M);P!==-1&&n.splice(P,1)}function R(M,P){const N=M;n.forEach(function(F){F[N]&&F[N](P)})}function D(M){return gE("10.7.0","highlightBlock will be removed entirely in v12.0"),gE("10.7.0","Please use highlightElement now."),m(M)}Object.assign(t,{highlight:h,highlightAuto:p,highlightAll:w,highlightElement:m,highlightBlock:D,configure:v,initHighlighting:y,initHighlightingOnLoad:b,registerLanguage:A,unregisterLanguage:T,listLanguages:S,getLanguage:O,registerAliases:k,autoDetection:E,inherit:gqe,addPlugin:I,removePlugin:L}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=evr,t.regex={concat:sA,lookahead:iqe,either:pce,optional:v0r,anyNumberOfTimes:m0r};for(const M in dQ)typeof dQ[M]=="object"&&JYe(dQ[M]);return Object.assign(t,dQ),t},mE=vqe({});mE.newInstance=()=>vqe({});var nvr=mE;mE.HighlightJS=mE,mE.default=mE;const ivr=uh(nvr),yqe={},avr="hljs-";function svr(t){const e=ivr.newInstance();return t&&a(t),{highlight:r,highlightAuto:n,listLanguages:i,register:a,registerAlias:s,registered:o};function r(l,u,h){const d=h||yqe,f=typeof d.prefix=="string"?d.prefix:avr;if(!e.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");e.configure({__emitter:ovr,classPrefix:f});const p=e.highlight(u,{ignoreIllegals:!0,language:l});if(p.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:p.errorRaised});const g=p._emitter.root,m=g.data;return m.language=p.language,m.relevance=p.relevance,g}function n(l,u){const d=(u||yqe).subset||i();let f=-1,p=0,g;for(;++fp&&(p=v.data.relevance,g=v)}return g||{type:"root",children:[],data:{language:void 0,relevance:p}}}function i(){return e.listLanguages()}function a(l,u){if(typeof l=="string")e.registerLanguage(l,u);else{let h;for(h in l)Object.hasOwn(l,h)&&e.registerLanguage(h,l[h])}}function s(l,u){if(typeof l=="string")e.registerAliases(typeof u=="string"?u:[...u],{languageName:l});else{let h;for(h in l)if(Object.hasOwn(l,h)){const d=l[h];e.registerAliases(typeof d=="string"?d:[...d],{languageName:h})}}}function o(l){return!!e.getLanguage(l)}}class ovr{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e==="")return;const r=this.stack[this.stack.length-1],n=r.children[r.children.length-1];n&&n.type==="text"?n.value+=e:r.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,r){const n=this.stack[this.stack.length-1],i=e.root.children;r?n.children.push({type:"element",tagName:"span",properties:{className:[r]},children:i}):n.children.push(...i)}openNode(e){const r=this,n=e.split(".").map(function(s,o){return o?s+"_".repeat(o):r.options.classPrefix+s}),i=this.stack[this.stack.length-1],a={type:"element",tagName:"span",properties:{className:n},children:[]};i.children.push(a),this.stack.push(a)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const lvr={};function bqe(t){const e=t||lvr,r=e.aliases,n=e.detect||!1,i=e.languages||h0r,a=e.plainText,s=e.prefix,o=e.subset;let l="hljs";const u=svr(i);if(r&&u.registerAlias(r),s){const h=s.indexOf("-");l=h===-1?s:s.slice(0,h)}return function(h,d){k6(h,"element",function(f,p,g){if(f.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const m=cvr(f);if(m===!1||!m&&!n||m&&a&&a.includes(m))return;Array.isArray(f.properties.className)||(f.properties.className=[]),f.properties.className.includes(l)||f.properties.className.unshift(l);const v=$gr(f,{whitespace:"pre"});let y;try{y=m?u.highlight(m,v,{prefix:s}):u.highlightAuto(v,{prefix:s,subset:o})}catch(b){const x=b;if(m&&/Unknown language/.test(x.message)){d.message("Cannot highlight as `"+m+"`, it’s not registered",{ancestors:[g,f],cause:x,place:f.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw x}!m&&y.data&&y.data.language&&f.properties.className.push("language-"+y.data.language),y.children.length>0&&(f.children=y.children)})}}function cvr(t){const e=t.properties.className;let r=-1;if(!Array.isArray(e))return;let n;for(;++r-1&&a<=e.length){let s=0;for(;;){let o=r[s];if(o===void 0){const l=Tqe(e,r[s-1]);o=l===-1?e.length+1:l+1,r[s]=o}if(o>a)return{line:s+1,column:a-(s>0?r[s-1]:0)+1,offset:a};s++}}}function i(a){if(a&&typeof a.line=="number"&&typeof a.column=="number"&&!Number.isNaN(a.line)&&!Number.isNaN(a.column)){for(;r.length1?r[a.line-2]:0)+a.column-1;if(s=55296&&t<=57343}function Pvr(t){return t>=56320&&t<=57343}function Nvr(t,e){return(t-55296)*1024+9216+e}function _qe(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function Rqe(t){return t>=64976&&t<=65007||Ivr.has(t)}var yt;(function(t){t.controlCharacterInInputStream="control-character-in-input-stream",t.noncharacterInInputStream="noncharacter-in-input-stream",t.surrogateInInputStream="surrogate-in-input-stream",t.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",t.endTagWithAttributes="end-tag-with-attributes",t.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",t.unexpectedSolidusInTag="unexpected-solidus-in-tag",t.unexpectedNullCharacter="unexpected-null-character",t.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",t.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",t.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",t.missingEndTagName="missing-end-tag-name",t.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",t.unknownNamedCharacterReference="unknown-named-character-reference",t.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",t.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",t.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",t.eofBeforeTagName="eof-before-tag-name",t.eofInTag="eof-in-tag",t.missingAttributeValue="missing-attribute-value",t.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",t.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",t.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",t.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",t.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",t.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",t.missingDoctypePublicIdentifier="missing-doctype-public-identifier",t.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",t.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",t.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",t.cdataInHtmlContent="cdata-in-html-content",t.incorrectlyOpenedComment="incorrectly-opened-comment",t.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",t.eofInDoctype="eof-in-doctype",t.nestedComment="nested-comment",t.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",t.eofInComment="eof-in-comment",t.incorrectlyClosedComment="incorrectly-closed-comment",t.eofInCdata="eof-in-cdata",t.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",t.nullCharacterReference="null-character-reference",t.surrogateCharacterReference="surrogate-character-reference",t.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",t.controlCharacterReference="control-character-reference",t.noncharacterCharacterReference="noncharacter-character-reference",t.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",t.missingDoctypeName="missing-doctype-name",t.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",t.duplicateAttribute="duplicate-attribute",t.nonConformingDoctype="non-conforming-doctype",t.missingDoctype="missing-doctype",t.misplacedDoctype="misplaced-doctype",t.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",t.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",t.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",t.openElementsLeftAfterEof="open-elements-left-after-eof",t.abandonedHeadElementChild="abandoned-head-element-child",t.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",t.nestedNoscriptInHead="nested-noscript-in-head",t.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(yt||(yt={}));const Bvr=65536;class $vr{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=Bvr,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(e,r){const{line:n,col:i,offset:a}=this,s=i+r,o=a+r;return{code:e,startLine:n,endLine:n,startCol:s,endCol:s,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const r=this.html.charCodeAt(this.pos+1);if(Pvr(r))return this.pos++,this._addGap(),Nvr(e,r)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,Be.EOF;return this._err(yt.surrogateInInputStream),e}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(e,r){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=r}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,r){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(r)return this.html.startsWith(e,this.pos);for(let n=0;n=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,Be.EOF;const n=this.html.charCodeAt(r);return n===Be.CARRIAGE_RETURN?Be.LINE_FEED:n}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,Be.EOF;let e=this.html.charCodeAt(this.pos);return e===Be.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,Be.LINE_FEED):e===Be.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Eqe(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===Be.LINE_FEED||e===Be.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){_qe(e)?this._err(yt.controlCharacterInInputStream):Rqe(e)&&this._err(yt.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos=0;r--)if(t.attrs[r].name===e)return t.attrs[r].value;return null}const Fvr=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(t=>t.charCodeAt(0))),zvr=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 Uvr(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=zvr.get(t))!==null&&e!==void 0?e:t}var pl;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(pl||(pl={}));const Vvr=32;var Qb;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Qb||(Qb={}));function wce(t){return t>=pl.ZERO&&t<=pl.NINE}function Qvr(t){return t>=pl.UPPER_A&&t<=pl.UPPER_F||t>=pl.LOWER_A&&t<=pl.LOWER_F}function Gvr(t){return t>=pl.UPPER_A&&t<=pl.UPPER_Z||t>=pl.LOWER_A&&t<=pl.LOWER_Z||wce(t)}function Hvr(t){return t===pl.EQUALS||Gvr(t)}var gl;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(gl||(gl={}));var Pv;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(Pv||(Pv={}));class Wvr{constructor(e,r,n){this.decodeTree=e,this.emitCodePoint=r,this.errors=n,this.state=gl.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Pv.Strict}startEntity(e){this.decodeMode=e,this.state=gl.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,r){switch(this.state){case gl.EntityStart:return e.charCodeAt(r)===pl.NUM?(this.state=gl.NumericStart,this.consumed+=1,this.stateNumericStart(e,r+1)):(this.state=gl.NamedEntity,this.stateNamedEntity(e,r));case gl.NumericStart:return this.stateNumericStart(e,r);case gl.NumericDecimal:return this.stateNumericDecimal(e,r);case gl.NumericHex:return this.stateNumericHex(e,r);case gl.NamedEntity:return this.stateNamedEntity(e,r)}}stateNumericStart(e,r){return r>=e.length?-1:(e.charCodeAt(r)|Vvr)===pl.LOWER_X?(this.state=gl.NumericHex,this.consumed+=1,this.stateNumericHex(e,r+1)):(this.state=gl.NumericDecimal,this.stateNumericDecimal(e,r))}addToNumericResult(e,r,n,i){if(r!==n){const a=n-r;this.result=this.result*Math.pow(i,a)+Number.parseInt(e.substr(r,a),i),this.consumed+=a}}stateNumericHex(e,r){const n=r;for(;r>14;for(;r>14,a!==0){if(s===pl.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==Pv.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:r,decodeTree:n}=this,i=(n[r]&Qb.VALUE_LENGTH)>>14;return this.emitNamedEntityData(r,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,r,n){const{decodeTree:i}=this;return this.emitCodePoint(r===1?i[e]&~Qb.VALUE_LENGTH:i[e+1],n),r===3&&this.emitCodePoint(i[e+2],n),n}end(){var e;switch(this.state){case gl.NamedEntity:return this.result!==0&&(this.decodeMode!==Pv.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case gl.NumericDecimal:return this.emitNumericEntity(0,2);case gl.NumericHex:return this.emitNumericEntity(0,3);case gl.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case gl.EntityStart:return 0}}}function Yvr(t,e,r,n){const i=(e&Qb.BRANCH_LENGTH)>>7,a=e&Qb.JUMP_TABLE;if(i===0)return a!==0&&n===a?r:-1;if(a){const l=n-a;return l<0||l>=i?-1:t[r+l]-1}let s=r,o=s+i-1;for(;s<=o;){const l=s+o>>>1,u=t[l];if(un)o=l-1;else return t[l+i]}return-1}var Ut;(function(t){t.HTML="http://www.w3.org/1999/xhtml",t.MATHML="http://www.w3.org/1998/Math/MathML",t.SVG="http://www.w3.org/2000/svg",t.XLINK="http://www.w3.org/1999/xlink",t.XML="http://www.w3.org/XML/1998/namespace",t.XMLNS="http://www.w3.org/2000/xmlns/"})(Ut||(Ut={}));var cA;(function(t){t.TYPE="type",t.ACTION="action",t.ENCODING="encoding",t.PROMPT="prompt",t.NAME="name",t.COLOR="color",t.FACE="face",t.SIZE="size"})(cA||(cA={}));var kf;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(kf||(kf={}));var st;(function(t){t.A="a",t.ADDRESS="address",t.ANNOTATION_XML="annotation-xml",t.APPLET="applet",t.AREA="area",t.ARTICLE="article",t.ASIDE="aside",t.B="b",t.BASE="base",t.BASEFONT="basefont",t.BGSOUND="bgsound",t.BIG="big",t.BLOCKQUOTE="blockquote",t.BODY="body",t.BR="br",t.BUTTON="button",t.CAPTION="caption",t.CENTER="center",t.CODE="code",t.COL="col",t.COLGROUP="colgroup",t.DD="dd",t.DESC="desc",t.DETAILS="details",t.DIALOG="dialog",t.DIR="dir",t.DIV="div",t.DL="dl",t.DT="dt",t.EM="em",t.EMBED="embed",t.FIELDSET="fieldset",t.FIGCAPTION="figcaption",t.FIGURE="figure",t.FONT="font",t.FOOTER="footer",t.FOREIGN_OBJECT="foreignObject",t.FORM="form",t.FRAME="frame",t.FRAMESET="frameset",t.H1="h1",t.H2="h2",t.H3="h3",t.H4="h4",t.H5="h5",t.H6="h6",t.HEAD="head",t.HEADER="header",t.HGROUP="hgroup",t.HR="hr",t.HTML="html",t.I="i",t.IMG="img",t.IMAGE="image",t.INPUT="input",t.IFRAME="iframe",t.KEYGEN="keygen",t.LABEL="label",t.LI="li",t.LINK="link",t.LISTING="listing",t.MAIN="main",t.MALIGNMARK="malignmark",t.MARQUEE="marquee",t.MATH="math",t.MENU="menu",t.META="meta",t.MGLYPH="mglyph",t.MI="mi",t.MO="mo",t.MN="mn",t.MS="ms",t.MTEXT="mtext",t.NAV="nav",t.NOBR="nobr",t.NOFRAMES="noframes",t.NOEMBED="noembed",t.NOSCRIPT="noscript",t.OBJECT="object",t.OL="ol",t.OPTGROUP="optgroup",t.OPTION="option",t.P="p",t.PARAM="param",t.PLAINTEXT="plaintext",t.PRE="pre",t.RB="rb",t.RP="rp",t.RT="rt",t.RTC="rtc",t.RUBY="ruby",t.S="s",t.SCRIPT="script",t.SEARCH="search",t.SECTION="section",t.SELECT="select",t.SOURCE="source",t.SMALL="small",t.SPAN="span",t.STRIKE="strike",t.STRONG="strong",t.STYLE="style",t.SUB="sub",t.SUMMARY="summary",t.SUP="sup",t.TABLE="table",t.TBODY="tbody",t.TEMPLATE="template",t.TEXTAREA="textarea",t.TFOOT="tfoot",t.TD="td",t.TH="th",t.THEAD="thead",t.TITLE="title",t.TR="tr",t.TRACK="track",t.TT="tt",t.U="u",t.UL="ul",t.SVG="svg",t.VAR="var",t.WBR="wbr",t.XMP="xmp"})(st||(st={}));var H;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.A=1]="A",t[t.ADDRESS=2]="ADDRESS",t[t.ANNOTATION_XML=3]="ANNOTATION_XML",t[t.APPLET=4]="APPLET",t[t.AREA=5]="AREA",t[t.ARTICLE=6]="ARTICLE",t[t.ASIDE=7]="ASIDE",t[t.B=8]="B",t[t.BASE=9]="BASE",t[t.BASEFONT=10]="BASEFONT",t[t.BGSOUND=11]="BGSOUND",t[t.BIG=12]="BIG",t[t.BLOCKQUOTE=13]="BLOCKQUOTE",t[t.BODY=14]="BODY",t[t.BR=15]="BR",t[t.BUTTON=16]="BUTTON",t[t.CAPTION=17]="CAPTION",t[t.CENTER=18]="CENTER",t[t.CODE=19]="CODE",t[t.COL=20]="COL",t[t.COLGROUP=21]="COLGROUP",t[t.DD=22]="DD",t[t.DESC=23]="DESC",t[t.DETAILS=24]="DETAILS",t[t.DIALOG=25]="DIALOG",t[t.DIR=26]="DIR",t[t.DIV=27]="DIV",t[t.DL=28]="DL",t[t.DT=29]="DT",t[t.EM=30]="EM",t[t.EMBED=31]="EMBED",t[t.FIELDSET=32]="FIELDSET",t[t.FIGCAPTION=33]="FIGCAPTION",t[t.FIGURE=34]="FIGURE",t[t.FONT=35]="FONT",t[t.FOOTER=36]="FOOTER",t[t.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",t[t.FORM=38]="FORM",t[t.FRAME=39]="FRAME",t[t.FRAMESET=40]="FRAMESET",t[t.H1=41]="H1",t[t.H2=42]="H2",t[t.H3=43]="H3",t[t.H4=44]="H4",t[t.H5=45]="H5",t[t.H6=46]="H6",t[t.HEAD=47]="HEAD",t[t.HEADER=48]="HEADER",t[t.HGROUP=49]="HGROUP",t[t.HR=50]="HR",t[t.HTML=51]="HTML",t[t.I=52]="I",t[t.IMG=53]="IMG",t[t.IMAGE=54]="IMAGE",t[t.INPUT=55]="INPUT",t[t.IFRAME=56]="IFRAME",t[t.KEYGEN=57]="KEYGEN",t[t.LABEL=58]="LABEL",t[t.LI=59]="LI",t[t.LINK=60]="LINK",t[t.LISTING=61]="LISTING",t[t.MAIN=62]="MAIN",t[t.MALIGNMARK=63]="MALIGNMARK",t[t.MARQUEE=64]="MARQUEE",t[t.MATH=65]="MATH",t[t.MENU=66]="MENU",t[t.META=67]="META",t[t.MGLYPH=68]="MGLYPH",t[t.MI=69]="MI",t[t.MO=70]="MO",t[t.MN=71]="MN",t[t.MS=72]="MS",t[t.MTEXT=73]="MTEXT",t[t.NAV=74]="NAV",t[t.NOBR=75]="NOBR",t[t.NOFRAMES=76]="NOFRAMES",t[t.NOEMBED=77]="NOEMBED",t[t.NOSCRIPT=78]="NOSCRIPT",t[t.OBJECT=79]="OBJECT",t[t.OL=80]="OL",t[t.OPTGROUP=81]="OPTGROUP",t[t.OPTION=82]="OPTION",t[t.P=83]="P",t[t.PARAM=84]="PARAM",t[t.PLAINTEXT=85]="PLAINTEXT",t[t.PRE=86]="PRE",t[t.RB=87]="RB",t[t.RP=88]="RP",t[t.RT=89]="RT",t[t.RTC=90]="RTC",t[t.RUBY=91]="RUBY",t[t.S=92]="S",t[t.SCRIPT=93]="SCRIPT",t[t.SEARCH=94]="SEARCH",t[t.SECTION=95]="SECTION",t[t.SELECT=96]="SELECT",t[t.SOURCE=97]="SOURCE",t[t.SMALL=98]="SMALL",t[t.SPAN=99]="SPAN",t[t.STRIKE=100]="STRIKE",t[t.STRONG=101]="STRONG",t[t.STYLE=102]="STYLE",t[t.SUB=103]="SUB",t[t.SUMMARY=104]="SUMMARY",t[t.SUP=105]="SUP",t[t.TABLE=106]="TABLE",t[t.TBODY=107]="TBODY",t[t.TEMPLATE=108]="TEMPLATE",t[t.TEXTAREA=109]="TEXTAREA",t[t.TFOOT=110]="TFOOT",t[t.TD=111]="TD",t[t.TH=112]="TH",t[t.THEAD=113]="THEAD",t[t.TITLE=114]="TITLE",t[t.TR=115]="TR",t[t.TRACK=116]="TRACK",t[t.TT=117]="TT",t[t.U=118]="U",t[t.UL=119]="UL",t[t.SVG=120]="SVG",t[t.VAR=121]="VAR",t[t.WBR=122]="WBR",t[t.XMP=123]="XMP"})(H||(H={}));const qvr=new Map([[st.A,H.A],[st.ADDRESS,H.ADDRESS],[st.ANNOTATION_XML,H.ANNOTATION_XML],[st.APPLET,H.APPLET],[st.AREA,H.AREA],[st.ARTICLE,H.ARTICLE],[st.ASIDE,H.ASIDE],[st.B,H.B],[st.BASE,H.BASE],[st.BASEFONT,H.BASEFONT],[st.BGSOUND,H.BGSOUND],[st.BIG,H.BIG],[st.BLOCKQUOTE,H.BLOCKQUOTE],[st.BODY,H.BODY],[st.BR,H.BR],[st.BUTTON,H.BUTTON],[st.CAPTION,H.CAPTION],[st.CENTER,H.CENTER],[st.CODE,H.CODE],[st.COL,H.COL],[st.COLGROUP,H.COLGROUP],[st.DD,H.DD],[st.DESC,H.DESC],[st.DETAILS,H.DETAILS],[st.DIALOG,H.DIALOG],[st.DIR,H.DIR],[st.DIV,H.DIV],[st.DL,H.DL],[st.DT,H.DT],[st.EM,H.EM],[st.EMBED,H.EMBED],[st.FIELDSET,H.FIELDSET],[st.FIGCAPTION,H.FIGCAPTION],[st.FIGURE,H.FIGURE],[st.FONT,H.FONT],[st.FOOTER,H.FOOTER],[st.FOREIGN_OBJECT,H.FOREIGN_OBJECT],[st.FORM,H.FORM],[st.FRAME,H.FRAME],[st.FRAMESET,H.FRAMESET],[st.H1,H.H1],[st.H2,H.H2],[st.H3,H.H3],[st.H4,H.H4],[st.H5,H.H5],[st.H6,H.H6],[st.HEAD,H.HEAD],[st.HEADER,H.HEADER],[st.HGROUP,H.HGROUP],[st.HR,H.HR],[st.HTML,H.HTML],[st.I,H.I],[st.IMG,H.IMG],[st.IMAGE,H.IMAGE],[st.INPUT,H.INPUT],[st.IFRAME,H.IFRAME],[st.KEYGEN,H.KEYGEN],[st.LABEL,H.LABEL],[st.LI,H.LI],[st.LINK,H.LINK],[st.LISTING,H.LISTING],[st.MAIN,H.MAIN],[st.MALIGNMARK,H.MALIGNMARK],[st.MARQUEE,H.MARQUEE],[st.MATH,H.MATH],[st.MENU,H.MENU],[st.META,H.META],[st.MGLYPH,H.MGLYPH],[st.MI,H.MI],[st.MO,H.MO],[st.MN,H.MN],[st.MS,H.MS],[st.MTEXT,H.MTEXT],[st.NAV,H.NAV],[st.NOBR,H.NOBR],[st.NOFRAMES,H.NOFRAMES],[st.NOEMBED,H.NOEMBED],[st.NOSCRIPT,H.NOSCRIPT],[st.OBJECT,H.OBJECT],[st.OL,H.OL],[st.OPTGROUP,H.OPTGROUP],[st.OPTION,H.OPTION],[st.P,H.P],[st.PARAM,H.PARAM],[st.PLAINTEXT,H.PLAINTEXT],[st.PRE,H.PRE],[st.RB,H.RB],[st.RP,H.RP],[st.RT,H.RT],[st.RTC,H.RTC],[st.RUBY,H.RUBY],[st.S,H.S],[st.SCRIPT,H.SCRIPT],[st.SEARCH,H.SEARCH],[st.SECTION,H.SECTION],[st.SELECT,H.SELECT],[st.SOURCE,H.SOURCE],[st.SMALL,H.SMALL],[st.SPAN,H.SPAN],[st.STRIKE,H.STRIKE],[st.STRONG,H.STRONG],[st.STYLE,H.STYLE],[st.SUB,H.SUB],[st.SUMMARY,H.SUMMARY],[st.SUP,H.SUP],[st.TABLE,H.TABLE],[st.TBODY,H.TBODY],[st.TEMPLATE,H.TEMPLATE],[st.TEXTAREA,H.TEXTAREA],[st.TFOOT,H.TFOOT],[st.TD,H.TD],[st.TH,H.TH],[st.THEAD,H.THEAD],[st.TITLE,H.TITLE],[st.TR,H.TR],[st.TRACK,H.TRACK],[st.TT,H.TT],[st.U,H.U],[st.UL,H.UL],[st.SVG,H.SVG],[st.VAR,H.VAR],[st.WBR,H.WBR],[st.XMP,H.XMP]]);function bE(t){var e;return(e=qvr.get(t))!==null&&e!==void 0?e:H.UNKNOWN}const qt=H,jvr={[Ut.HTML]:new Set([qt.ADDRESS,qt.APPLET,qt.AREA,qt.ARTICLE,qt.ASIDE,qt.BASE,qt.BASEFONT,qt.BGSOUND,qt.BLOCKQUOTE,qt.BODY,qt.BR,qt.BUTTON,qt.CAPTION,qt.CENTER,qt.COL,qt.COLGROUP,qt.DD,qt.DETAILS,qt.DIR,qt.DIV,qt.DL,qt.DT,qt.EMBED,qt.FIELDSET,qt.FIGCAPTION,qt.FIGURE,qt.FOOTER,qt.FORM,qt.FRAME,qt.FRAMESET,qt.H1,qt.H2,qt.H3,qt.H4,qt.H5,qt.H6,qt.HEAD,qt.HEADER,qt.HGROUP,qt.HR,qt.HTML,qt.IFRAME,qt.IMG,qt.INPUT,qt.LI,qt.LINK,qt.LISTING,qt.MAIN,qt.MARQUEE,qt.MENU,qt.META,qt.NAV,qt.NOEMBED,qt.NOFRAMES,qt.NOSCRIPT,qt.OBJECT,qt.OL,qt.P,qt.PARAM,qt.PLAINTEXT,qt.PRE,qt.SCRIPT,qt.SECTION,qt.SELECT,qt.SOURCE,qt.STYLE,qt.SUMMARY,qt.TABLE,qt.TBODY,qt.TD,qt.TEMPLATE,qt.TEXTAREA,qt.TFOOT,qt.TH,qt.THEAD,qt.TITLE,qt.TR,qt.TRACK,qt.UL,qt.WBR,qt.XMP]),[Ut.MATHML]:new Set([qt.MI,qt.MO,qt.MN,qt.MS,qt.MTEXT,qt.ANNOTATION_XML]),[Ut.SVG]:new Set([qt.TITLE,qt.FOREIGN_OBJECT,qt.DESC]),[Ut.XLINK]:new Set,[Ut.XML]:new Set,[Ut.XMLNS]:new Set},Ace=new Set([qt.H1,qt.H2,qt.H3,qt.H4,qt.H5,qt.H6]);st.STYLE,st.SCRIPT,st.XMP,st.IFRAME,st.NOEMBED,st.NOFRAMES,st.PLAINTEXT;var Ve;(function(t){t[t.DATA=0]="DATA",t[t.RCDATA=1]="RCDATA",t[t.RAWTEXT=2]="RAWTEXT",t[t.SCRIPT_DATA=3]="SCRIPT_DATA",t[t.PLAINTEXT=4]="PLAINTEXT",t[t.TAG_OPEN=5]="TAG_OPEN",t[t.END_TAG_OPEN=6]="END_TAG_OPEN",t[t.TAG_NAME=7]="TAG_NAME",t[t.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",t[t.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",t[t.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",t[t.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",t[t.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",t[t.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",t[t.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",t[t.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",t[t.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",t[t.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",t[t.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",t[t.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",t[t.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",t[t.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",t[t.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",t[t.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",t[t.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",t[t.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",t[t.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",t[t.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",t[t.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",t[t.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",t[t.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",t[t.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",t[t.BOGUS_COMMENT=40]="BOGUS_COMMENT",t[t.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",t[t.COMMENT_START=42]="COMMENT_START",t[t.COMMENT_START_DASH=43]="COMMENT_START_DASH",t[t.COMMENT=44]="COMMENT",t[t.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",t[t.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",t[t.COMMENT_END_DASH=49]="COMMENT_END_DASH",t[t.COMMENT_END=50]="COMMENT_END",t[t.COMMENT_END_BANG=51]="COMMENT_END_BANG",t[t.DOCTYPE=52]="DOCTYPE",t[t.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",t[t.DOCTYPE_NAME=54]="DOCTYPE_NAME",t[t.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",t[t.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",t[t.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",t[t.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",t[t.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",t[t.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",t[t.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",t[t.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",t[t.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",t[t.CDATA_SECTION=68]="CDATA_SECTION",t[t.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",t[t.CDATA_SECTION_END=70]="CDATA_SECTION_END",t[t.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",t[t.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(Ve||(Ve={}));const eo={DATA:Ve.DATA,RCDATA:Ve.RCDATA,RAWTEXT:Ve.RAWTEXT,SCRIPT_DATA:Ve.SCRIPT_DATA,PLAINTEXT:Ve.PLAINTEXT,CDATA_SECTION:Ve.CDATA_SECTION};function Xvr(t){return t>=Be.DIGIT_0&&t<=Be.DIGIT_9}function M6(t){return t>=Be.LATIN_CAPITAL_A&&t<=Be.LATIN_CAPITAL_Z}function Kvr(t){return t>=Be.LATIN_SMALL_A&&t<=Be.LATIN_SMALL_Z}function Gb(t){return Kvr(t)||M6(t)}function Lqe(t){return Gb(t)||Xvr(t)}function gQ(t){return t+32}function Mqe(t){return t===Be.SPACE||t===Be.LINE_FEED||t===Be.TABULATION||t===Be.FORM_FEED}function Iqe(t){return Mqe(t)||t===Be.SOLIDUS||t===Be.GREATER_THAN_SIGN}function Zvr(t){return t===Be.NULL?yt.nullCharacterReference:t>1114111?yt.characterReferenceOutsideUnicodeRange:Eqe(t)?yt.surrogateCharacterReference:Rqe(t)?yt.noncharacterCharacterReference:_qe(t)||t===Be.CARRIAGE_RETURN?yt.controlCharacterReference:null}class Jvr{constructor(e,r){this.options=e,this.handler=r,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=Ve.DATA,this.returnState=Ve.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new $vr(r),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Wvr(Fvr,(n,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(n)},r.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(yt.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:n=>{this._err(yt.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+n)},validateNumericCharacterReference:n=>{const i=Zvr(n);i&&this._err(i,1)}}:void 0)}_err(e,r=0){var n,i;(i=(n=this.handler).onParseError)===null||i===void 0||i.call(n,this.preprocessor.getError(e,r))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e==null||e())}write(e,r,n){this.active=!0,this.preprocessor.write(e,r),this._runParsingLoop(),this.paused||n==null||n()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),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(e){this.consumedAfterSnapshot+=e;for(let r=0;r0&&this._err(yt.endTagWithAttributes),e.selfClosing&&this._err(yt.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case ri.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case ri.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case ri.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:ri.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,r){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=r;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,r)}_emitCodePoint(e){const r=Mqe(e)?ri.WHITESPACE_CHARACTER:e===Be.NULL?ri.NULL_CHARACTER:ri.CHARACTER;this._appendCharToCurrentCharacterToken(r,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(ri.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=Ve.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Pv.Attribute:Pv.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Ve.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Ve.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Ve.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case Ve.DATA:{this._stateData(e);break}case Ve.RCDATA:{this._stateRcdata(e);break}case Ve.RAWTEXT:{this._stateRawtext(e);break}case Ve.SCRIPT_DATA:{this._stateScriptData(e);break}case Ve.PLAINTEXT:{this._statePlaintext(e);break}case Ve.TAG_OPEN:{this._stateTagOpen(e);break}case Ve.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case Ve.TAG_NAME:{this._stateTagName(e);break}case Ve.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case Ve.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case Ve.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case Ve.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case Ve.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case Ve.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case Ve.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case Ve.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case Ve.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case Ve.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case Ve.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case Ve.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case Ve.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case Ve.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case Ve.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case Ve.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case Ve.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case Ve.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case Ve.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case Ve.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case Ve.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case Ve.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case Ve.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case Ve.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case Ve.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case Ve.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case Ve.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case Ve.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case Ve.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case Ve.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case Ve.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case Ve.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case Ve.BOGUS_COMMENT:{this._stateBogusComment(e);break}case Ve.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case Ve.COMMENT_START:{this._stateCommentStart(e);break}case Ve.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case Ve.COMMENT:{this._stateComment(e);break}case Ve.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case Ve.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case Ve.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case Ve.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case Ve.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case Ve.COMMENT_END:{this._stateCommentEnd(e);break}case Ve.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case Ve.DOCTYPE:{this._stateDoctype(e);break}case Ve.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case Ve.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case Ve.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case Ve.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case Ve.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case Ve.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case Ve.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case Ve.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case Ve.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case Ve.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case Ve.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case Ve.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case Ve.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case Ve.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case Ve.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case Ve.CDATA_SECTION:{this._stateCdataSection(e);break}case Ve.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case Ve.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case Ve.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case Ve.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case Be.LESS_THAN_SIGN:{this.state=Ve.TAG_OPEN;break}case Be.AMPERSAND:{this._startCharacterReference();break}case Be.NULL:{this._err(yt.unexpectedNullCharacter),this._emitCodePoint(e);break}case Be.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case Be.AMPERSAND:{this._startCharacterReference();break}case Be.LESS_THAN_SIGN:{this.state=Ve.RCDATA_LESS_THAN_SIGN;break}case Be.NULL:{this._err(yt.unexpectedNullCharacter),this._emitChars(hs);break}case Be.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case Be.LESS_THAN_SIGN:{this.state=Ve.RAWTEXT_LESS_THAN_SIGN;break}case Be.NULL:{this._err(yt.unexpectedNullCharacter),this._emitChars(hs);break}case Be.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case Be.LESS_THAN_SIGN:{this.state=Ve.SCRIPT_DATA_LESS_THAN_SIGN;break}case Be.NULL:{this._err(yt.unexpectedNullCharacter),this._emitChars(hs);break}case Be.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case Be.NULL:{this._err(yt.unexpectedNullCharacter),this._emitChars(hs);break}case Be.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(Gb(e))this._createStartTagToken(),this.state=Ve.TAG_NAME,this._stateTagName(e);else switch(e){case Be.EXCLAMATION_MARK:{this.state=Ve.MARKUP_DECLARATION_OPEN;break}case Be.SOLIDUS:{this.state=Ve.END_TAG_OPEN;break}case Be.QUESTION_MARK:{this._err(yt.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Ve.BOGUS_COMMENT,this._stateBogusComment(e);break}case Be.EOF:{this._err(yt.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(yt.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=Ve.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(Gb(e))this._createEndTagToken(),this.state=Ve.TAG_NAME,this._stateTagName(e);else switch(e){case Be.GREATER_THAN_SIGN:{this._err(yt.missingEndTagName),this.state=Ve.DATA;break}case Be.EOF:{this._err(yt.eofBeforeTagName),this._emitChars("");break}case Be.NULL:{this._err(yt.unexpectedNullCharacter),this.state=Ve.SCRIPT_DATA_ESCAPED,this._emitChars(hs);break}case Be.EOF:{this._err(yt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Ve.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===Be.SOLIDUS?this.state=Ve.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Gb(e)?(this._emitChars("<"),this.state=Ve.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=Ve.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){Gb(e)?(this.state=Ve.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("");break}case Be.NULL:{this._err(yt.unexpectedNullCharacter),this.state=Ve.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(hs);break}case Be.EOF:{this._err(yt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Ve.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===Be.SOLIDUS?(this.state=Ve.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=Ve.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Ah.SCRIPT,!1)&&Iqe(this.preprocessor.peek(Ah.SCRIPT.length))){this._emitCodePoint(e);for(let r=0;r0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,r){const n=this._indexOf(e);this.items[n]=r,n===this.stackTop&&(this.current=r)}insertAfter(e,r,n){const i=this._indexOf(e)+1;this.items.splice(i,0,r),this.tagIDs.splice(i,0,n),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(e){let r=this.stackTop+1;do r=this.tagIDs.lastIndexOf(e,r-1);while(r>0&&this.treeAdapter.getNamespaceURI(this.items[r])!==Ut.HTML);this.shortenToLength(Math.max(r,0))}shortenToLength(e){for(;this.stackTop>=e;){const r=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(r,this.stackTop=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===r)return n;return-1}clearBackTo(e,r){const n=this._indexOfTagNames(e,r);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(iyr,Ut.HTML)}clearBackToTableBodyContext(){this.clearBackTo(nyr,Ut.HTML)}clearBackToTableRowContext(){this.clearBackTo(ryr,Ut.HTML)}remove(e){const r=this._indexOf(e);r>=0&&(r===this.stackTop?this.pop():(this.items.splice(r,1),this.tagIDs.splice(r,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===H.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const r=this._indexOf(e)-1;return r>=0?this.items[r]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===H.HTML}hasInDynamicScope(e,r){for(let n=this.stackTop;n>=0;n--){const i=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case Ut.HTML:{if(i===e)return!0;if(r.has(i))return!1;break}case Ut.SVG:{if($qe.has(i))return!1;break}case Ut.MATHML:{if(Bqe.has(i))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,mQ)}hasInListItemScope(e){return this.hasInDynamicScope(e,eyr)}hasInButtonScope(e){return this.hasInDynamicScope(e,tyr)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const r=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case Ut.HTML:{if(Ace.has(r))return!0;if(mQ.has(r))return!1;break}case Ut.SVG:{if($qe.has(r))return!1;break}case Ut.MATHML:{if(Bqe.has(r))return!1;break}}}return!0}hasInTableScope(e){for(let r=this.stackTop;r>=0;r--)if(this.treeAdapter.getNamespaceURI(this.items[r])===Ut.HTML)switch(this.tagIDs[r]){case e:return!0;case H.TABLE:case H.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===Ut.HTML)switch(this.tagIDs[e]){case H.TBODY:case H.THEAD:case H.TFOOT:return!0;case H.TABLE:case H.HTML:return!1}return!0}hasInSelectScope(e){for(let r=this.stackTop;r>=0;r--)if(this.treeAdapter.getNamespaceURI(this.items[r])===Ut.HTML)switch(this.tagIDs[r]){case e:return!0;case H.OPTION:case H.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Pqe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Nqe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&Nqe.has(this.currentTagId);)this.pop()}}const Tce=3;var tm;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(tm||(tm={}));const Fqe={type:tm.Marker};class oyr{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,r){const n=[],i=r.length,a=this.treeAdapter.getTagName(e),s=this.treeAdapter.getNamespaceURI(e);for(let o=0;o[s.name,s.value]));let a=0;for(let s=0;si.get(l.name)===l.value)&&(a+=1,a>=Tce&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(Fqe)}pushElement(e,r){this._ensureNoahArkCondition(e),this.entries.unshift({type:tm.Element,element:e,token:r})}insertElementAfterBookmark(e,r){const n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:tm.Element,element:e,token:r})}removeEntry(e){const r=this.entries.indexOf(e);r!==-1&&this.entries.splice(r,1)}clearToLastMarker(){const e=this.entries.indexOf(Fqe);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const r=this.entries.find(n=>n.type===tm.Marker||this.treeAdapter.getTagName(n.element)===e);return r&&r.type===tm.Element?r:null}getElementEntry(e){return this.entries.find(r=>r.type===tm.Element&&r.element===e)}}const Hb={createDocument(){return{nodeName:"#document",mode:kf.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(t,e,r){return{nodeName:t,tagName:t,attrs:r,namespaceURI:e,childNodes:[],parentNode:null}},createCommentNode(t){return{nodeName:"#comment",data:t,parentNode:null}},createTextNode(t){return{nodeName:"#text",value:t,parentNode:null}},appendChild(t,e){t.childNodes.push(e),e.parentNode=t},insertBefore(t,e,r){const n=t.childNodes.indexOf(r);t.childNodes.splice(n,0,e),e.parentNode=t},setTemplateContent(t,e){t.content=e},getTemplateContent(t){return t.content},setDocumentType(t,e,r,n){const i=t.childNodes.find(a=>a.nodeName==="#documentType");if(i)i.name=e,i.publicId=r,i.systemId=n;else{const a={nodeName:"#documentType",name:e,publicId:r,systemId:n,parentNode:null};Hb.appendChild(t,a)}},setDocumentMode(t,e){t.mode=e},getDocumentMode(t){return t.mode},detachNode(t){if(t.parentNode){const e=t.parentNode.childNodes.indexOf(t);t.parentNode.childNodes.splice(e,1),t.parentNode=null}},insertText(t,e){if(t.childNodes.length>0){const r=t.childNodes[t.childNodes.length-1];if(Hb.isTextNode(r)){r.value+=e;return}}Hb.appendChild(t,Hb.createTextNode(e))},insertTextBefore(t,e,r){const n=t.childNodes[t.childNodes.indexOf(r)-1];n&&Hb.isTextNode(n)?n.value+=e:Hb.insertBefore(t,Hb.createTextNode(e),r)},adoptAttributes(t,e){const r=new Set(t.attrs.map(n=>n.name));for(let n=0;nt.startsWith(r))}function fyr(t){return t.name===zqe&&t.publicId===null&&(t.systemId===null||t.systemId===lyr)}function pyr(t){if(t.name!==zqe)return kf.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===cyr)return kf.QUIRKS;let{publicId:r}=t;if(r!==null){if(r=r.toLowerCase(),hyr.has(r))return kf.QUIRKS;let n=e===null?uyr:Uqe;if(Qqe(r,n))return kf.QUIRKS;if(n=e===null?Vqe:dyr,Qqe(r,n))return kf.LIMITED_QUIRKS}return kf.NO_QUIRKS}const Gqe={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},gyr="definitionurl",myr="definitionURL",vyr=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(t=>[t.toLowerCase(),t])),yyr=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Ut.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Ut.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Ut.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Ut.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Ut.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Ut.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Ut.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Ut.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Ut.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Ut.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Ut.XMLNS}]]),byr=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(t=>[t.toLowerCase(),t])),xyr=new Set([H.B,H.BIG,H.BLOCKQUOTE,H.BODY,H.BR,H.CENTER,H.CODE,H.DD,H.DIV,H.DL,H.DT,H.EM,H.EMBED,H.H1,H.H2,H.H3,H.H4,H.H5,H.H6,H.HEAD,H.HR,H.I,H.IMG,H.LI,H.LISTING,H.MENU,H.META,H.NOBR,H.OL,H.P,H.PRE,H.RUBY,H.S,H.SMALL,H.SPAN,H.STRONG,H.STRIKE,H.SUB,H.SUP,H.TABLE,H.TT,H.U,H.UL,H.VAR]);function wyr(t){const e=t.tagID;return e===H.FONT&&t.attrs.some(({name:n})=>n===cA.COLOR||n===cA.SIZE||n===cA.FACE)||xyr.has(e)}function Hqe(t){for(let e=0;e0&&this._setContextModes(e,r)}onItemPop(e,r){var n,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(i=(n=this.treeAdapter).onItemPop)===null||i===void 0||i.call(n,e,this.openElements.current),r){let a,s;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,s=this.fragmentContextID):{current:a,currentTagId:s}=this.openElements,this._setContextModes(a,s)}}_setContextModes(e,r){const n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===Ut.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&r!==void 0&&!this._isIntegrationPoint(r,e)}_switchToTextParsing(e,r){this._insertElement(e,Ut.HTML),this.tokenizer.state=r,this.originalInsertionMode=this.insertionMode,this.insertionMode=Ke.TEXT}switchToPlaintextParsing(){this.insertionMode=Ke.TEXT,this.originalInsertionMode=Ke.IN_BODY,this.tokenizer.state=eo.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===st.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Ut.HTML))switch(this.fragmentContextID){case H.TITLE:case H.TEXTAREA:{this.tokenizer.state=eo.RCDATA;break}case H.STYLE:case H.XMP:case H.IFRAME:case H.NOEMBED:case H.NOFRAMES:case H.NOSCRIPT:{this.tokenizer.state=eo.RAWTEXT;break}case H.SCRIPT:{this.tokenizer.state=eo.SCRIPT_DATA;break}case H.PLAINTEXT:{this.tokenizer.state=eo.PLAINTEXT;break}}}_setDocumentType(e){const r=e.name||"",n=e.publicId||"",i=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,r,n,i),e.location){const s=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));s&&this.treeAdapter.setNodeSourceCodeLocation(s,e.location)}}_attachElementToTree(e,r){if(this.options.sourceCodeLocationInfo){const n=r&&{...r,startTag:r};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const n=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(n??this.document,e)}}_appendElement(e,r){const n=this.treeAdapter.createElement(e.tagName,r,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,r){const n=this.treeAdapter.createElement(e.tagName,r,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,r){const n=this.treeAdapter.createElement(e,Ut.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,r)}_insertTemplate(e){const r=this.treeAdapter.createElement(e.tagName,Ut.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(r,n),this._attachElementToTree(r,e.location),this.openElements.push(r,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(st.HTML,Ut.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,H.HTML)}_appendCommentNode(e,r){const n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(r,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let r,n;if(this._shouldFosterParentOnInsertion()?({parent:r,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(r,e.chars,n):this.treeAdapter.insertText(r,e.chars)):(r=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(r,e.chars)),!e.location)return;const i=this.treeAdapter.getChildNodes(r),a=n?i.lastIndexOf(n):i.length,s=i[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(s)){const{endLine:l,endCol:u,endOffset:h}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(s,{endLine:l,endCol:u,endOffset:h})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,e.location)}_adoptNodes(e,r){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(r,n)}_setEndLocation(e,r){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&r.location){const n=r.location,i=this.treeAdapter.getTagName(e),a=r.type===ri.END_TAG&&i===r.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,a)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let r,n;return this.openElements.stackTop===0&&this.fragmentContext?(r=this.fragmentContext,n=this.fragmentContextID):{current:r,currentTagId:n}=this.openElements,e.tagID===H.SVG&&this.treeAdapter.getTagName(r)===st.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(r)===Ut.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===H.MGLYPH||e.tagID===H.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,r,Ut.HTML)}_processToken(e){switch(e.type){case ri.CHARACTER:{this.onCharacter(e);break}case ri.NULL_CHARACTER:{this.onNullCharacter(e);break}case ri.COMMENT:{this.onComment(e);break}case ri.DOCTYPE:{this.onDoctype(e);break}case ri.START_TAG:{this._processStartTag(e);break}case ri.END_TAG:{this.onEndTag(e);break}case ri.EOF:{this.onEof(e);break}case ri.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,r,n){const i=this.treeAdapter.getNamespaceURI(r),a=this.treeAdapter.getAttrList(r);return Cyr(e,i,a,n)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const r=this.activeFormattingElements.entries.findIndex(i=>i.type===tm.Marker||this.openElements.contains(i.element)),n=r===-1?e-1:r-1;for(let i=n;i>=0;i--){const a=this.activeFormattingElements.entries[i];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Ke.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(H.P),this.openElements.popUntilTagNamePopped(H.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case H.TR:{this.insertionMode=Ke.IN_ROW;return}case H.TBODY:case H.THEAD:case H.TFOOT:{this.insertionMode=Ke.IN_TABLE_BODY;return}case H.CAPTION:{this.insertionMode=Ke.IN_CAPTION;return}case H.COLGROUP:{this.insertionMode=Ke.IN_COLUMN_GROUP;return}case H.TABLE:{this.insertionMode=Ke.IN_TABLE;return}case H.BODY:{this.insertionMode=Ke.IN_BODY;return}case H.FRAMESET:{this.insertionMode=Ke.IN_FRAMESET;return}case H.SELECT:{this._resetInsertionModeForSelect(e);return}case H.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case H.HTML:{this.insertionMode=this.headElement?Ke.AFTER_HEAD:Ke.BEFORE_HEAD;return}case H.TD:case H.TH:{if(e>0){this.insertionMode=Ke.IN_CELL;return}break}case H.HEAD:{if(e>0){this.insertionMode=Ke.IN_HEAD;return}break}}this.insertionMode=Ke.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let r=e-1;r>0;r--){const n=this.openElements.tagIDs[r];if(n===H.TEMPLATE)break;if(n===H.TABLE){this.insertionMode=Ke.IN_SELECT_IN_TABLE;return}}this.insertionMode=Ke.IN_SELECT}_isElementCausesFosterParenting(e){return Yqe.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const r=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case H.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(r)===Ut.HTML)return{parent:this.treeAdapter.getTemplateContent(r),beforeElement:null};break}case H.TABLE:{const n=this.treeAdapter.getParentNode(r);return n?{parent:n,beforeElement:r}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const r=this._findFosterParentingLocation();r.beforeElement?this.treeAdapter.insertBefore(r.parent,e,r.beforeElement):this.treeAdapter.appendChild(r.parent,e)}_isSpecialElement(e,r){const n=this.treeAdapter.getNamespaceURI(e);return jvr[n].has(r)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){abr(this,e);return}switch(this.insertionMode){case Ke.INITIAL:{I6(this,e);break}case Ke.BEFORE_HTML:{P6(this,e);break}case Ke.BEFORE_HEAD:{N6(this,e);break}case Ke.IN_HEAD:{B6(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{$6(this,e);break}case Ke.AFTER_HEAD:{F6(this,e);break}case Ke.IN_BODY:case Ke.IN_CAPTION:case Ke.IN_CELL:case Ke.IN_TEMPLATE:{Kqe(this,e);break}case Ke.TEXT:case Ke.IN_SELECT:case Ke.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case Ke.IN_TABLE:case Ke.IN_TABLE_BODY:case Ke.IN_ROW:{Ece(this,e);break}case Ke.IN_TABLE_TEXT:{aje(this,e);break}case Ke.IN_COLUMN_GROUP:{bQ(this,e);break}case Ke.AFTER_BODY:{AQ(this,e);break}case Ke.AFTER_AFTER_BODY:{TQ(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){ibr(this,e);return}switch(this.insertionMode){case Ke.INITIAL:{I6(this,e);break}case Ke.BEFORE_HTML:{P6(this,e);break}case Ke.BEFORE_HEAD:{N6(this,e);break}case Ke.IN_HEAD:{B6(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{$6(this,e);break}case Ke.AFTER_HEAD:{F6(this,e);break}case Ke.TEXT:{this._insertCharacters(e);break}case Ke.IN_TABLE:case Ke.IN_TABLE_BODY:case Ke.IN_ROW:{Ece(this,e);break}case Ke.IN_COLUMN_GROUP:{bQ(this,e);break}case Ke.AFTER_BODY:{AQ(this,e);break}case Ke.AFTER_AFTER_BODY:{TQ(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){Oce(this,e);return}switch(this.insertionMode){case Ke.INITIAL:case Ke.BEFORE_HTML:case Ke.BEFORE_HEAD:case Ke.IN_HEAD:case Ke.IN_HEAD_NO_SCRIPT:case Ke.AFTER_HEAD:case Ke.IN_BODY:case Ke.IN_TABLE:case Ke.IN_CAPTION:case Ke.IN_COLUMN_GROUP:case Ke.IN_TABLE_BODY:case Ke.IN_ROW:case Ke.IN_CELL:case Ke.IN_SELECT:case Ke.IN_SELECT_IN_TABLE:case Ke.IN_TEMPLATE:case Ke.IN_FRAMESET:case Ke.AFTER_FRAMESET:{Oce(this,e);break}case Ke.IN_TABLE_TEXT:{V6(this,e);break}case Ke.AFTER_BODY:{Nyr(this,e);break}case Ke.AFTER_AFTER_BODY:case Ke.AFTER_AFTER_FRAMESET:{Byr(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case Ke.INITIAL:{$yr(this,e);break}case Ke.BEFORE_HEAD:case Ke.IN_HEAD:case Ke.IN_HEAD_NO_SCRIPT:case Ke.AFTER_HEAD:{this._err(e,yt.misplacedDoctype);break}case Ke.IN_TABLE_TEXT:{V6(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,yt.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?sbr(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case Ke.INITIAL:{I6(this,e);break}case Ke.BEFORE_HTML:{Fyr(this,e);break}case Ke.BEFORE_HEAD:{Uyr(this,e);break}case Ke.IN_HEAD:{Pp(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{Gyr(this,e);break}case Ke.AFTER_HEAD:{Wyr(this,e);break}case Ke.IN_BODY:{Mc(this,e);break}case Ke.IN_TABLE:{xE(this,e);break}case Ke.IN_TABLE_TEXT:{V6(this,e);break}case Ke.IN_CAPTION:{V1r(this,e);break}case Ke.IN_COLUMN_GROUP:{_ce(this,e);break}case Ke.IN_TABLE_BODY:{xQ(this,e);break}case Ke.IN_ROW:{wQ(this,e);break}case Ke.IN_CELL:{H1r(this,e);break}case Ke.IN_SELECT:{lje(this,e);break}case Ke.IN_SELECT_IN_TABLE:{Y1r(this,e);break}case Ke.IN_TEMPLATE:{j1r(this,e);break}case Ke.AFTER_BODY:{K1r(this,e);break}case Ke.IN_FRAMESET:{Z1r(this,e);break}case Ke.AFTER_FRAMESET:{ebr(this,e);break}case Ke.AFTER_AFTER_BODY:{rbr(this,e);break}case Ke.AFTER_AFTER_FRAMESET:{nbr(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?obr(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case Ke.INITIAL:{I6(this,e);break}case Ke.BEFORE_HTML:{zyr(this,e);break}case Ke.BEFORE_HEAD:{Vyr(this,e);break}case Ke.IN_HEAD:{Qyr(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{Hyr(this,e);break}case Ke.AFTER_HEAD:{Yyr(this,e);break}case Ke.IN_BODY:{yQ(this,e);break}case Ke.TEXT:{L1r(this,e);break}case Ke.IN_TABLE:{z6(this,e);break}case Ke.IN_TABLE_TEXT:{V6(this,e);break}case Ke.IN_CAPTION:{Q1r(this,e);break}case Ke.IN_COLUMN_GROUP:{G1r(this,e);break}case Ke.IN_TABLE_BODY:{Rce(this,e);break}case Ke.IN_ROW:{oje(this,e);break}case Ke.IN_CELL:{W1r(this,e);break}case Ke.IN_SELECT:{cje(this,e);break}case Ke.IN_SELECT_IN_TABLE:{q1r(this,e);break}case Ke.IN_TEMPLATE:{X1r(this,e);break}case Ke.AFTER_BODY:{hje(this,e);break}case Ke.IN_FRAMESET:{J1r(this,e);break}case Ke.AFTER_FRAMESET:{tbr(this,e);break}case Ke.AFTER_AFTER_BODY:{TQ(this,e);break}}}onEof(e){switch(this.insertionMode){case Ke.INITIAL:{I6(this,e);break}case Ke.BEFORE_HTML:{P6(this,e);break}case Ke.BEFORE_HEAD:{N6(this,e);break}case Ke.IN_HEAD:{B6(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{$6(this,e);break}case Ke.AFTER_HEAD:{F6(this,e);break}case Ke.IN_BODY:case Ke.IN_TABLE:case Ke.IN_CAPTION:case Ke.IN_COLUMN_GROUP:case Ke.IN_TABLE_BODY:case Ke.IN_ROW:case Ke.IN_CELL:case Ke.IN_SELECT:case Ke.IN_SELECT_IN_TABLE:{nje(this,e);break}case Ke.TEXT:{M1r(this,e);break}case Ke.IN_TABLE_TEXT:{V6(this,e);break}case Ke.IN_TEMPLATE:{uje(this,e);break}case Ke.AFTER_BODY:case Ke.IN_FRAMESET:case Ke.AFTER_FRAMESET:case Ke.AFTER_AFTER_BODY:case Ke.AFTER_AFTER_FRAMESET:{kce(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===Be.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case Ke.IN_HEAD:case Ke.IN_HEAD_NO_SCRIPT:case Ke.AFTER_HEAD:case Ke.TEXT:case Ke.IN_COLUMN_GROUP:case Ke.IN_SELECT:case Ke.IN_SELECT_IN_TABLE:case Ke.IN_FRAMESET:case Ke.AFTER_FRAMESET:{this._insertCharacters(e);break}case Ke.IN_BODY:case Ke.IN_CAPTION:case Ke.IN_CELL:case Ke.IN_TEMPLATE:case Ke.AFTER_BODY:case Ke.AFTER_AFTER_BODY:case Ke.AFTER_AFTER_FRAMESET:{Xqe(this,e);break}case Ke.IN_TABLE:case Ke.IN_TABLE_BODY:case Ke.IN_ROW:{Ece(this,e);break}case Ke.IN_TABLE_TEXT:{ije(this,e);break}}}};function Ryr(t,e){let r=t.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return r?t.openElements.contains(r.element)?t.openElements.hasInScope(e.tagID)||(r=null):(t.activeFormattingElements.removeEntry(r),r=null):rje(t,e),r}function Dyr(t,e){let r=null,n=t.openElements.stackTop;for(;n>=0;n--){const i=t.openElements.items[n];if(i===e.element)break;t._isSpecialElement(i,t.openElements.tagIDs[n])&&(r=i)}return r||(t.openElements.shortenToLength(Math.max(n,0)),t.activeFormattingElements.removeEntry(e)),r}function Lyr(t,e,r){let n=e,i=t.openElements.getCommonAncestor(e);for(let a=0,s=i;s!==r;a++,s=i){i=t.openElements.getCommonAncestor(s);const o=t.activeFormattingElements.getElementEntry(s),l=o&&a>=Eyr;!o||l?(l&&t.activeFormattingElements.removeEntry(o),t.openElements.remove(s)):(s=Myr(t,o),n===e&&(t.activeFormattingElements.bookmark=o),t.treeAdapter.detachNode(n),t.treeAdapter.appendChild(s,n),n=s)}return n}function Myr(t,e){const r=t.treeAdapter.getNamespaceURI(e.element),n=t.treeAdapter.createElement(e.token.tagName,r,e.token.attrs);return t.openElements.replace(e.element,n),e.element=n,n}function Iyr(t,e,r){const n=t.treeAdapter.getTagName(e),i=bE(n);if(t._isElementCausesFosterParenting(i))t._fosterParentElement(r);else{const a=t.treeAdapter.getNamespaceURI(e);i===H.TEMPLATE&&a===Ut.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,r)}}function Pyr(t,e,r){const n=t.treeAdapter.getNamespaceURI(r.element),{token:i}=r,a=t.treeAdapter.createElement(i.tagName,n,i.attrs);t._adoptNodes(e,a),t.treeAdapter.appendChild(e,a),t.activeFormattingElements.insertElementAfterBookmark(a,i),t.activeFormattingElements.removeEntry(r),t.openElements.remove(r.element),t.openElements.insertAfter(e,a,i.tagID)}function Cce(t,e){for(let r=0;r=r;n--)t._setEndLocation(t.openElements.items[n],e);if(!t.fragmentContext&&t.openElements.stackTop>=0){const n=t.openElements.items[0],i=t.treeAdapter.getNodeSourceCodeLocation(n);if(i&&!i.endTag&&(t._setEndLocation(n,e),t.openElements.stackTop>=1)){const a=t.openElements.items[1],s=t.treeAdapter.getNodeSourceCodeLocation(a);s&&!s.endTag&&t._setEndLocation(a,e)}}}}function $yr(t,e){t._setDocumentType(e);const r=e.forceQuirks?kf.QUIRKS:pyr(e);fyr(e)||t._err(e,yt.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,r),t.insertionMode=Ke.BEFORE_HTML}function I6(t,e){t._err(e,yt.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,kf.QUIRKS),t.insertionMode=Ke.BEFORE_HTML,t._processToken(e)}function Fyr(t,e){e.tagID===H.HTML?(t._insertElement(e,Ut.HTML),t.insertionMode=Ke.BEFORE_HEAD):P6(t,e)}function zyr(t,e){const r=e.tagID;(r===H.HTML||r===H.HEAD||r===H.BODY||r===H.BR)&&P6(t,e)}function P6(t,e){t._insertFakeRootElement(),t.insertionMode=Ke.BEFORE_HEAD,t._processToken(e)}function Uyr(t,e){switch(e.tagID){case H.HTML:{Mc(t,e);break}case H.HEAD:{t._insertElement(e,Ut.HTML),t.headElement=t.openElements.current,t.insertionMode=Ke.IN_HEAD;break}default:N6(t,e)}}function Vyr(t,e){const r=e.tagID;r===H.HEAD||r===H.BODY||r===H.HTML||r===H.BR?N6(t,e):t._err(e,yt.endTagWithoutMatchingOpenElement)}function N6(t,e){t._insertFakeElement(st.HEAD,H.HEAD),t.headElement=t.openElements.current,t.insertionMode=Ke.IN_HEAD,t._processToken(e)}function Pp(t,e){switch(e.tagID){case H.HTML:{Mc(t,e);break}case H.BASE:case H.BASEFONT:case H.BGSOUND:case H.LINK:case H.META:{t._appendElement(e,Ut.HTML),e.ackSelfClosing=!0;break}case H.TITLE:{t._switchToTextParsing(e,eo.RCDATA);break}case H.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,eo.RAWTEXT):(t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_HEAD_NO_SCRIPT);break}case H.NOFRAMES:case H.STYLE:{t._switchToTextParsing(e,eo.RAWTEXT);break}case H.SCRIPT:{t._switchToTextParsing(e,eo.SCRIPT_DATA);break}case H.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=Ke.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(Ke.IN_TEMPLATE);break}case H.HEAD:{t._err(e,yt.misplacedStartTagForHeadElement);break}default:B6(t,e)}}function Qyr(t,e){switch(e.tagID){case H.HEAD:{t.openElements.pop(),t.insertionMode=Ke.AFTER_HEAD;break}case H.BODY:case H.BR:case H.HTML:{B6(t,e);break}case H.TEMPLATE:{uA(t,e);break}default:t._err(e,yt.endTagWithoutMatchingOpenElement)}}function uA(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==H.TEMPLATE&&t._err(e,yt.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(H.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,yt.endTagWithoutMatchingOpenElement)}function B6(t,e){t.openElements.pop(),t.insertionMode=Ke.AFTER_HEAD,t._processToken(e)}function Gyr(t,e){switch(e.tagID){case H.HTML:{Mc(t,e);break}case H.BASEFONT:case H.BGSOUND:case H.HEAD:case H.LINK:case H.META:case H.NOFRAMES:case H.STYLE:{Pp(t,e);break}case H.NOSCRIPT:{t._err(e,yt.nestedNoscriptInHead);break}default:$6(t,e)}}function Hyr(t,e){switch(e.tagID){case H.NOSCRIPT:{t.openElements.pop(),t.insertionMode=Ke.IN_HEAD;break}case H.BR:{$6(t,e);break}default:t._err(e,yt.endTagWithoutMatchingOpenElement)}}function $6(t,e){const r=e.type===ri.EOF?yt.openElementsLeftAfterEof:yt.disallowedContentInNoscriptInHead;t._err(e,r),t.openElements.pop(),t.insertionMode=Ke.IN_HEAD,t._processToken(e)}function Wyr(t,e){switch(e.tagID){case H.HTML:{Mc(t,e);break}case H.BODY:{t._insertElement(e,Ut.HTML),t.framesetOk=!1,t.insertionMode=Ke.IN_BODY;break}case H.FRAMESET:{t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_FRAMESET;break}case H.BASE:case H.BASEFONT:case H.BGSOUND:case H.LINK:case H.META:case H.NOFRAMES:case H.SCRIPT:case H.STYLE:case H.TEMPLATE:case H.TITLE:{t._err(e,yt.abandonedHeadElementChild),t.openElements.push(t.headElement,H.HEAD),Pp(t,e),t.openElements.remove(t.headElement);break}case H.HEAD:{t._err(e,yt.misplacedStartTagForHeadElement);break}default:F6(t,e)}}function Yyr(t,e){switch(e.tagID){case H.BODY:case H.HTML:case H.BR:{F6(t,e);break}case H.TEMPLATE:{uA(t,e);break}default:t._err(e,yt.endTagWithoutMatchingOpenElement)}}function F6(t,e){t._insertFakeElement(st.BODY,H.BODY),t.insertionMode=Ke.IN_BODY,vQ(t,e)}function vQ(t,e){switch(e.type){case ri.CHARACTER:{Kqe(t,e);break}case ri.WHITESPACE_CHARACTER:{Xqe(t,e);break}case ri.COMMENT:{Oce(t,e);break}case ri.START_TAG:{Mc(t,e);break}case ri.END_TAG:{yQ(t,e);break}case ri.EOF:{nje(t,e);break}}}function Xqe(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function Kqe(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function qyr(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function jyr(t,e){const r=t.openElements.tryPeekProperlyNestedBodyElement();r&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(r,e.attrs))}function Xyr(t,e){const r=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&r&&(t.treeAdapter.detachNode(r),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_FRAMESET)}function Kyr(t,e){t.openElements.hasInButtonScope(H.P)&&t._closePElement(),t._insertElement(e,Ut.HTML)}function Zyr(t,e){t.openElements.hasInButtonScope(H.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&Ace.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,Ut.HTML)}function Jyr(t,e){t.openElements.hasInButtonScope(H.P)&&t._closePElement(),t._insertElement(e,Ut.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function e1r(t,e){const r=t.openElements.tmplCount>0;(!t.formElement||r)&&(t.openElements.hasInButtonScope(H.P)&&t._closePElement(),t._insertElement(e,Ut.HTML),r||(t.formElement=t.openElements.current))}function t1r(t,e){t.framesetOk=!1;const r=e.tagID;for(let n=t.openElements.stackTop;n>=0;n--){const i=t.openElements.tagIDs[n];if(r===H.LI&&i===H.LI||(r===H.DD||r===H.DT)&&(i===H.DD||i===H.DT)){t.openElements.generateImpliedEndTagsWithExclusion(i),t.openElements.popUntilTagNamePopped(i);break}if(i!==H.ADDRESS&&i!==H.DIV&&i!==H.P&&t._isSpecialElement(t.openElements.items[n],i))break}t.openElements.hasInButtonScope(H.P)&&t._closePElement(),t._insertElement(e,Ut.HTML)}function r1r(t,e){t.openElements.hasInButtonScope(H.P)&&t._closePElement(),t._insertElement(e,Ut.HTML),t.tokenizer.state=eo.PLAINTEXT}function n1r(t,e){t.openElements.hasInScope(H.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(H.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML),t.framesetOk=!1}function i1r(t,e){const r=t.activeFormattingElements.getElementEntryInScopeWithTagName(st.A);r&&(Cce(t,e),t.openElements.remove(r.element),t.activeFormattingElements.removeEntry(r)),t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function a1r(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function s1r(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(H.NOBR)&&(Cce(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,Ut.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function o1r(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function l1r(t,e){t.treeAdapter.getDocumentMode(t.document)!==kf.QUIRKS&&t.openElements.hasInButtonScope(H.P)&&t._closePElement(),t._insertElement(e,Ut.HTML),t.framesetOk=!1,t.insertionMode=Ke.IN_TABLE}function Zqe(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,Ut.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function Jqe(t){const e=Dqe(t,cA.TYPE);return e!=null&&e.toLowerCase()===Oyr}function c1r(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,Ut.HTML),Jqe(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function u1r(t,e){t._appendElement(e,Ut.HTML),e.ackSelfClosing=!0}function h1r(t,e){t.openElements.hasInButtonScope(H.P)&&t._closePElement(),t._appendElement(e,Ut.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function d1r(t,e){e.tagName=st.IMG,e.tagID=H.IMG,Zqe(t,e)}function f1r(t,e){t._insertElement(e,Ut.HTML),t.skipNextNewLine=!0,t.tokenizer.state=eo.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=Ke.TEXT}function p1r(t,e){t.openElements.hasInButtonScope(H.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,eo.RAWTEXT)}function g1r(t,e){t.framesetOk=!1,t._switchToTextParsing(e,eo.RAWTEXT)}function eje(t,e){t._switchToTextParsing(e,eo.RAWTEXT)}function m1r(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===Ke.IN_TABLE||t.insertionMode===Ke.IN_CAPTION||t.insertionMode===Ke.IN_TABLE_BODY||t.insertionMode===Ke.IN_ROW||t.insertionMode===Ke.IN_CELL?Ke.IN_SELECT_IN_TABLE:Ke.IN_SELECT}function v1r(t,e){t.openElements.currentTagId===H.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML)}function y1r(t,e){t.openElements.hasInScope(H.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,Ut.HTML)}function b1r(t,e){t.openElements.hasInScope(H.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(H.RTC),t._insertElement(e,Ut.HTML)}function x1r(t,e){t._reconstructActiveFormattingElements(),Hqe(e),Sce(e),e.selfClosing?t._appendElement(e,Ut.MATHML):t._insertElement(e,Ut.MATHML),e.ackSelfClosing=!0}function w1r(t,e){t._reconstructActiveFormattingElements(),Wqe(e),Sce(e),e.selfClosing?t._appendElement(e,Ut.SVG):t._insertElement(e,Ut.SVG),e.ackSelfClosing=!0}function tje(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML)}function Mc(t,e){switch(e.tagID){case H.I:case H.S:case H.B:case H.U:case H.EM:case H.TT:case H.BIG:case H.CODE:case H.FONT:case H.SMALL:case H.STRIKE:case H.STRONG:{a1r(t,e);break}case H.A:{i1r(t,e);break}case H.H1:case H.H2:case H.H3:case H.H4:case H.H5:case H.H6:{Zyr(t,e);break}case H.P:case H.DL:case H.OL:case H.UL:case H.DIV:case H.DIR:case H.NAV:case H.MAIN:case H.MENU:case H.ASIDE:case H.CENTER:case H.FIGURE:case H.FOOTER:case H.HEADER:case H.HGROUP:case H.DIALOG:case H.DETAILS:case H.ADDRESS:case H.ARTICLE:case H.SEARCH:case H.SECTION:case H.SUMMARY:case H.FIELDSET:case H.BLOCKQUOTE:case H.FIGCAPTION:{Kyr(t,e);break}case H.LI:case H.DD:case H.DT:{t1r(t,e);break}case H.BR:case H.IMG:case H.WBR:case H.AREA:case H.EMBED:case H.KEYGEN:{Zqe(t,e);break}case H.HR:{h1r(t,e);break}case H.RB:case H.RTC:{y1r(t,e);break}case H.RT:case H.RP:{b1r(t,e);break}case H.PRE:case H.LISTING:{Jyr(t,e);break}case H.XMP:{p1r(t,e);break}case H.SVG:{w1r(t,e);break}case H.HTML:{qyr(t,e);break}case H.BASE:case H.LINK:case H.META:case H.STYLE:case H.TITLE:case H.SCRIPT:case H.BGSOUND:case H.BASEFONT:case H.TEMPLATE:{Pp(t,e);break}case H.BODY:{jyr(t,e);break}case H.FORM:{e1r(t,e);break}case H.NOBR:{s1r(t,e);break}case H.MATH:{x1r(t,e);break}case H.TABLE:{l1r(t,e);break}case H.INPUT:{c1r(t,e);break}case H.PARAM:case H.TRACK:case H.SOURCE:{u1r(t,e);break}case H.IMAGE:{d1r(t,e);break}case H.BUTTON:{n1r(t,e);break}case H.APPLET:case H.OBJECT:case H.MARQUEE:{o1r(t,e);break}case H.IFRAME:{g1r(t,e);break}case H.SELECT:{m1r(t,e);break}case H.OPTION:case H.OPTGROUP:{v1r(t,e);break}case H.NOEMBED:case H.NOFRAMES:{eje(t,e);break}case H.FRAMESET:{Xyr(t,e);break}case H.TEXTAREA:{f1r(t,e);break}case H.NOSCRIPT:{t.options.scriptingEnabled?eje(t,e):tje(t,e);break}case H.PLAINTEXT:{r1r(t,e);break}case H.COL:case H.TH:case H.TD:case H.TR:case H.HEAD:case H.FRAME:case H.TBODY:case H.TFOOT:case H.THEAD:case H.CAPTION:case H.COLGROUP:break;default:tje(t,e)}}function A1r(t,e){if(t.openElements.hasInScope(H.BODY)&&(t.insertionMode=Ke.AFTER_BODY,t.options.sourceCodeLocationInfo)){const r=t.openElements.tryPeekProperlyNestedBodyElement();r&&t._setEndLocation(r,e)}}function T1r(t,e){t.openElements.hasInScope(H.BODY)&&(t.insertionMode=Ke.AFTER_BODY,hje(t,e))}function S1r(t,e){const r=e.tagID;t.openElements.hasInScope(r)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(r))}function C1r(t){const e=t.openElements.tmplCount>0,{formElement:r}=t;e||(t.formElement=null),(r||e)&&t.openElements.hasInScope(H.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(H.FORM):r&&t.openElements.remove(r))}function O1r(t){t.openElements.hasInButtonScope(H.P)||t._insertFakeElement(st.P,H.P),t._closePElement()}function k1r(t){t.openElements.hasInListItemScope(H.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(H.LI),t.openElements.popUntilTagNamePopped(H.LI))}function E1r(t,e){const r=e.tagID;t.openElements.hasInScope(r)&&(t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.popUntilTagNamePopped(r))}function _1r(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function R1r(t,e){const r=e.tagID;t.openElements.hasInScope(r)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(r),t.activeFormattingElements.clearToLastMarker())}function D1r(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(st.BR,H.BR),t.openElements.pop(),t.framesetOk=!1}function rje(t,e){const r=e.tagName,n=e.tagID;for(let i=t.openElements.stackTop;i>0;i--){const a=t.openElements.items[i],s=t.openElements.tagIDs[i];if(n===s&&(n!==H.UNKNOWN||t.treeAdapter.getTagName(a)===r)){t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.stackTop>=i&&t.openElements.shortenToLength(i);break}if(t._isSpecialElement(a,s))break}}function yQ(t,e){switch(e.tagID){case H.A:case H.B:case H.I:case H.S:case H.U:case H.EM:case H.TT:case H.BIG:case H.CODE:case H.FONT:case H.NOBR:case H.SMALL:case H.STRIKE:case H.STRONG:{Cce(t,e);break}case H.P:{O1r(t);break}case H.DL:case H.UL:case H.OL:case H.DIR:case H.DIV:case H.NAV:case H.PRE:case H.MAIN:case H.MENU:case H.ASIDE:case H.BUTTON:case H.CENTER:case H.FIGURE:case H.FOOTER:case H.HEADER:case H.HGROUP:case H.DIALOG:case H.ADDRESS:case H.ARTICLE:case H.DETAILS:case H.SEARCH:case H.SECTION:case H.SUMMARY:case H.LISTING:case H.FIELDSET:case H.BLOCKQUOTE:case H.FIGCAPTION:{S1r(t,e);break}case H.LI:{k1r(t);break}case H.DD:case H.DT:{E1r(t,e);break}case H.H1:case H.H2:case H.H3:case H.H4:case H.H5:case H.H6:{_1r(t);break}case H.BR:{D1r(t);break}case H.BODY:{A1r(t,e);break}case H.HTML:{T1r(t,e);break}case H.FORM:{C1r(t);break}case H.APPLET:case H.OBJECT:case H.MARQUEE:{R1r(t,e);break}case H.TEMPLATE:{uA(t,e);break}default:rje(t,e)}}function nje(t,e){t.tmplInsertionModeStack.length>0?uje(t,e):kce(t,e)}function L1r(t,e){var r;e.tagID===H.SCRIPT&&((r=t.scriptHandler)===null||r===void 0||r.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function M1r(t,e){t._err(e,yt.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function Ece(t,e){if(t.openElements.currentTagId!==void 0&&Yqe.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=Ke.IN_TABLE_TEXT,e.type){case ri.CHARACTER:{aje(t,e);break}case ri.WHITESPACE_CHARACTER:{ije(t,e);break}}else U6(t,e)}function I1r(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_CAPTION}function P1r(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_COLUMN_GROUP}function N1r(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(st.COLGROUP,H.COLGROUP),t.insertionMode=Ke.IN_COLUMN_GROUP,_ce(t,e)}function B1r(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_TABLE_BODY}function $1r(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(st.TBODY,H.TBODY),t.insertionMode=Ke.IN_TABLE_BODY,xQ(t,e)}function F1r(t,e){t.openElements.hasInTableScope(H.TABLE)&&(t.openElements.popUntilTagNamePopped(H.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function z1r(t,e){Jqe(e)?t._appendElement(e,Ut.HTML):U6(t,e),e.ackSelfClosing=!0}function U1r(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,Ut.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function xE(t,e){switch(e.tagID){case H.TD:case H.TH:case H.TR:{$1r(t,e);break}case H.STYLE:case H.SCRIPT:case H.TEMPLATE:{Pp(t,e);break}case H.COL:{N1r(t,e);break}case H.FORM:{U1r(t,e);break}case H.TABLE:{F1r(t,e);break}case H.TBODY:case H.TFOOT:case H.THEAD:{B1r(t,e);break}case H.INPUT:{z1r(t,e);break}case H.CAPTION:{I1r(t,e);break}case H.COLGROUP:{P1r(t,e);break}default:U6(t,e)}}function z6(t,e){switch(e.tagID){case H.TABLE:{t.openElements.hasInTableScope(H.TABLE)&&(t.openElements.popUntilTagNamePopped(H.TABLE),t._resetInsertionMode());break}case H.TEMPLATE:{uA(t,e);break}case H.BODY:case H.CAPTION:case H.COL:case H.COLGROUP:case H.HTML:case H.TBODY:case H.TD:case H.TFOOT:case H.TH:case H.THEAD:case H.TR:break;default:U6(t,e)}}function U6(t,e){const r=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,vQ(t,e),t.fosterParentingEnabled=r}function ije(t,e){t.pendingCharacterTokens.push(e)}function aje(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function V6(t,e){let r=0;if(t.hasNonWhitespacePendingCharacterToken)for(;r0&&t.openElements.currentTagId===H.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===H.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===H.OPTGROUP&&t.openElements.pop();break}case H.OPTION:{t.openElements.currentTagId===H.OPTION&&t.openElements.pop();break}case H.SELECT:{t.openElements.hasInSelectScope(H.SELECT)&&(t.openElements.popUntilTagNamePopped(H.SELECT),t._resetInsertionMode());break}case H.TEMPLATE:{uA(t,e);break}}}function Y1r(t,e){const r=e.tagID;r===H.CAPTION||r===H.TABLE||r===H.TBODY||r===H.TFOOT||r===H.THEAD||r===H.TR||r===H.TD||r===H.TH?(t.openElements.popUntilTagNamePopped(H.SELECT),t._resetInsertionMode(),t._processStartTag(e)):lje(t,e)}function q1r(t,e){const r=e.tagID;r===H.CAPTION||r===H.TABLE||r===H.TBODY||r===H.TFOOT||r===H.THEAD||r===H.TR||r===H.TD||r===H.TH?t.openElements.hasInTableScope(r)&&(t.openElements.popUntilTagNamePopped(H.SELECT),t._resetInsertionMode(),t.onEndTag(e)):cje(t,e)}function j1r(t,e){switch(e.tagID){case H.BASE:case H.BASEFONT:case H.BGSOUND:case H.LINK:case H.META:case H.NOFRAMES:case H.SCRIPT:case H.STYLE:case H.TEMPLATE:case H.TITLE:{Pp(t,e);break}case H.CAPTION:case H.COLGROUP:case H.TBODY:case H.TFOOT:case H.THEAD:{t.tmplInsertionModeStack[0]=Ke.IN_TABLE,t.insertionMode=Ke.IN_TABLE,xE(t,e);break}case H.COL:{t.tmplInsertionModeStack[0]=Ke.IN_COLUMN_GROUP,t.insertionMode=Ke.IN_COLUMN_GROUP,_ce(t,e);break}case H.TR:{t.tmplInsertionModeStack[0]=Ke.IN_TABLE_BODY,t.insertionMode=Ke.IN_TABLE_BODY,xQ(t,e);break}case H.TD:case H.TH:{t.tmplInsertionModeStack[0]=Ke.IN_ROW,t.insertionMode=Ke.IN_ROW,wQ(t,e);break}default:t.tmplInsertionModeStack[0]=Ke.IN_BODY,t.insertionMode=Ke.IN_BODY,Mc(t,e)}}function X1r(t,e){e.tagID===H.TEMPLATE&&uA(t,e)}function uje(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(H.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):kce(t,e)}function K1r(t,e){e.tagID===H.HTML?Mc(t,e):AQ(t,e)}function hje(t,e){var r;if(e.tagID===H.HTML){if(t.fragmentContext||(t.insertionMode=Ke.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===H.HTML){t._setEndLocation(t.openElements.items[0],e);const n=t.openElements.items[1];n&&!(!((r=t.treeAdapter.getNodeSourceCodeLocation(n))===null||r===void 0)&&r.endTag)&&t._setEndLocation(n,e)}}else AQ(t,e)}function AQ(t,e){t.insertionMode=Ke.IN_BODY,vQ(t,e)}function Z1r(t,e){switch(e.tagID){case H.HTML:{Mc(t,e);break}case H.FRAMESET:{t._insertElement(e,Ut.HTML);break}case H.FRAME:{t._appendElement(e,Ut.HTML),e.ackSelfClosing=!0;break}case H.NOFRAMES:{Pp(t,e);break}}}function J1r(t,e){e.tagID===H.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==H.FRAMESET&&(t.insertionMode=Ke.AFTER_FRAMESET))}function ebr(t,e){switch(e.tagID){case H.HTML:{Mc(t,e);break}case H.NOFRAMES:{Pp(t,e);break}}}function tbr(t,e){e.tagID===H.HTML&&(t.insertionMode=Ke.AFTER_AFTER_FRAMESET)}function rbr(t,e){e.tagID===H.HTML?Mc(t,e):TQ(t,e)}function TQ(t,e){t.insertionMode=Ke.IN_BODY,vQ(t,e)}function nbr(t,e){switch(e.tagID){case H.HTML:{Mc(t,e);break}case H.NOFRAMES:{Pp(t,e);break}}}function ibr(t,e){e.chars=hs,t._insertCharacters(e)}function abr(t,e){t._insertCharacters(e),t.framesetOk=!1}function dje(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==Ut.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function sbr(t,e){if(wyr(e))dje(t),t._startTagOutsideForeignContent(e);else{const r=t._getAdjustedCurrentElement(),n=t.treeAdapter.getNamespaceURI(r);n===Ut.MATHML?Hqe(e):n===Ut.SVG&&(Ayr(e),Wqe(e)),Sce(e),e.selfClosing?t._appendElement(e,n):t._insertElement(e,n),e.ackSelfClosing=!0}}function obr(t,e){if(e.tagID===H.P||e.tagID===H.BR){dje(t),t._endTagOutsideForeignContent(e);return}for(let r=t.openElements.stackTop;r>0;r--){const n=t.openElements.items[r];if(t.treeAdapter.getNamespaceURI(n)===Ut.HTML){t._endTagOutsideForeignContent(e);break}const i=t.treeAdapter.getTagName(n);if(i.toLowerCase()===e.tagName){e.tagName=i,t.openElements.shortenToLength(r);break}}}st.AREA,st.BASE,st.BASEFONT,st.BGSOUND,st.BR,st.COL,st.EMBED,st.FRAME,st.HR,st.IMG,st.INPUT,st.KEYGEN,st.LINK,st.META,st.PARAM,st.SOURCE,st.TRACK,st.WBR;const lbr=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,cbr=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),fje={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function pje(t,e){const r=bbr(t),n=KWe("type",{handlers:{root:ubr,element:hbr,text:dbr,comment:mje,doctype:fbr,raw:gbr},unknown:mbr}),i={parser:r?new jqe(fje):jqe.getFragmentParser(void 0,fje),handle(o){n(o,i)},stitches:!1,options:e||{}};n(t,i),wE(i,Kg());const a=r?i.parser.document:i.parser.getFragment(),s=xvr(a,{file:i.options.file});return i.stitches&&k6(s,"comment",function(o,l,u){const h=o;if(h.value.stitch&&u&&l!==void 0){const d=u.children;return d[l]=h.value.stitch,l}}),s.type==="root"&&s.children.length===1&&s.children[0].type===t.type?s.children[0]:s}function gje(t,e){let r=-1;if(t)for(;++r4&&(e.parser.tokenizer.state=0);const r={type:ri.CHARACTER,chars:t.value,location:Q6(t)};wE(e,Kg(t)),e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken)}function fbr(t,e){const r={type:ri.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Q6(t)};wE(e,Kg(t)),e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken)}function pbr(t,e){e.stitches=!0;const r=xbr(t);if("children"in t&&"children"in r){const n=pje({type:"root",children:t.children},e.options);r.children=n.children}mje({type:"comment",value:{stitch:r}},e)}function mje(t,e){const r=t.value,n={type:ri.COMMENT,data:r,location:Q6(t)};wE(e,Kg(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function gbr(t,e){if(e.parser.tokenizer.preprocessor.html="",e.parser.tokenizer.preprocessor.pos=-1,e.parser.tokenizer.preprocessor.lastGapPos=-2,e.parser.tokenizer.preprocessor.gapStack=[],e.parser.tokenizer.preprocessor.skipNextNewLine=!1,e.parser.tokenizer.preprocessor.lastChunkWritten=!1,e.parser.tokenizer.preprocessor.endOfChunkHit=!1,e.parser.tokenizer.preprocessor.isEol=!1,vje(e,Kg(t)),e.parser.tokenizer.write(e.options.tagfilter?t.value.replace(lbr,"<$1$2"):t.value,!1),e.parser.tokenizer._runParsingLoop(),e.parser.tokenizer.state===72||e.parser.tokenizer.state===78){e.parser.tokenizer.preprocessor.lastChunkWritten=!0;const r=e.parser.tokenizer._consume();e.parser.tokenizer._callState(r)}}function mbr(t,e){const r=t;if(e.options.passThrough&&e.options.passThrough.includes(r.type))pbr(r,e);else{let n="";throw cbr.has(r.type)&&(n=". 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 `"+r.type+"` node"+n)}}function wE(t,e){vje(t,e);const r=t.parser.tokenizer.currentCharacterToken;r&&r.location&&(r.location.endLine=t.parser.tokenizer.preprocessor.line,r.location.endCol=t.parser.tokenizer.preprocessor.col+1,r.location.endOffset=t.parser.tokenizer.preprocessor.offset+1,t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)),t.parser.tokenizer.paused=!1,t.parser.tokenizer.inLoop=!1,t.parser.tokenizer.active=!1,t.parser.tokenizer.returnState=eo.DATA,t.parser.tokenizer.charRefCode=-1,t.parser.tokenizer.consumedAfterSnapshot=-1,t.parser.tokenizer.currentLocation=null,t.parser.tokenizer.currentCharacterToken=null,t.parser.tokenizer.currentToken=null,t.parser.tokenizer.currentAttr={name:"",value:""}}function vje(t,e){if(e&&e.offset!==void 0){const r={startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:-1,endCol:-1,endOffset:-1};t.parser.tokenizer.preprocessor.lineStartPos=-e.column+1,t.parser.tokenizer.preprocessor.droppedBufferSize=e.offset,t.parser.tokenizer.preprocessor.line=e.line,t.parser.tokenizer.currentLocation=r}}function vbr(t,e){const r=t.tagName.toLowerCase();if(e.parser.tokenizer.state===eo.PLAINTEXT)return;wE(e,Kg(t));const n=e.parser.openElements.current;let i="namespaceURI"in n?n.namespaceURI:lA.html;i===lA.html&&r==="svg"&&(i=lA.svg);const a=Cvr({...t,children:[]},{space:i===lA.svg?"svg":"html"}),s={type:ri.START_TAG,tagName:r,tagID:bE(r),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:Q6(t)};e.parser.currentToken=s,e.parser._processToken(e.parser.currentToken),e.parser.tokenizer.lastStartTagName=r}function ybr(t,e){const r=t.tagName.toLowerCase();if(!e.parser.tokenizer.inForeignNode&&Mvr.includes(r)||e.parser.tokenizer.state===eo.PLAINTEXT)return;wE(e,GV(t));const n={type:ri.END_TAG,tagName:r,tagID:bE(r),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Q6(t)};e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken),r===e.parser.tokenizer.lastStartTagName&&(e.parser.tokenizer.state===eo.RCDATA||e.parser.tokenizer.state===eo.RAWTEXT||e.parser.tokenizer.state===eo.SCRIPT_DATA)&&(e.parser.tokenizer.state=eo.DATA)}function bbr(t){const e=t.type==="root"?t.children[0]:t;return!!(e&&(e.type==="doctype"||e.type==="element"&&e.tagName.toLowerCase()==="html"))}function Q6(t){const e=Kg(t)||{line:void 0,column:void 0,offset:void 0},r=GV(t)||{line:void 0,column:void 0,offset:void 0};return{startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:r.line,endCol:r.column,endOffset:r.offset}}function xbr(t){return"children"in t?hE({...t,children:[]}):hE(t)}function wbr(t){return function(e,r){return pje(e,{...t,file:r})}}var Abr=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,Tbr=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,Sbr=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,Dce={Space_Separator:Abr,ID_Start:Tbr,ID_Continue:Sbr},to={isSpaceSeparator(t){return typeof t=="string"&&Dce.Space_Separator.test(t)},isIdStartChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t==="$"||t==="_"||Dce.ID_Start.test(t))},isIdContinueChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t>="0"&&t<="9"||t==="$"||t==="_"||t==="‌"||t==="‍"||Dce.ID_Continue.test(t))},isDigit(t){return typeof t=="string"&&/[0-9]/.test(t)},isHexDigit(t){return typeof t=="string"&&/[0-9A-Fa-f]/.test(t)}};let Lce,mu,Nv,SQ,Wb,Np,ml,Mce,G6;var Cbr=function(e,r){Lce=String(e),mu="start",Nv=[],SQ=0,Wb=1,Np=0,ml=void 0,Mce=void 0,G6=void 0;do ml=Obr(),_br[mu]();while(ml.type!=="eof");return typeof r=="function"?Ice({"":G6},"",r):G6};function Ice(t,e,r){const n=t[e];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let i=0;i]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.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:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},h={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},d={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},t.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},r,t.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},p=e.optional(i)+t.IDENT_RE+"\\s*\\(",g=["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"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["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"],w={type:m,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},A={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},S=[A,d,o,r,t.C_BLOCK_COMMENT_MODE,h,u],T={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:S.concat([{begin:/\(/,end:/\)/,keywords:w,contains:S.concat(["self"]),relevance:0}]),relevance:0},O={className:"function",begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:w,relevance:0},{begin:p,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,h]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[r,t.C_BLOCK_COMMENT_MODE,u,h,o,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",r,t.C_BLOCK_COMMENT_MODE,u,h,o]}]},o,r,t.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:w,illegal:"",keywords:w,contains:["self",o]},{begin:t.IDENT_RE+"::",keywords:w},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Wgr(t){const e={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"]},r=Hgr(t),n=r.keywords;return n.type=[...n.type,...e.type],n.literal=[...n.literal,...e.literal],n.built_in=[...n.built_in,...e.built_in],n._hints=e._hints,r.name="Arduino",r.aliases=["ino"],r.supersetOf="cpp",r}function Ygr(t){const e=t.regex,r={},n={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},n]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},a=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},o={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,r,i]};i.contains.push(o);const l={match:/\\"/},u={className:"string",begin:/'/,end:/'/},h={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,r]},f=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],p=t.SHEBANG({binary:`(${f.join("|")})`,relevance:10}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["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"],w=["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"],A=["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:m,literal:v,built_in:[...b,...x,"set","shopt",...w,...A]},contains:[p,t.SHEBANG(),g,d,a,s,y,o,l,u,h,r]}}function qgr(t){const e=t.regex,r=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="("+n+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",o={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.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:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},h={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},d={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},t.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},r,t.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},p=e.optional(i)+t.IDENT_RE+"\\s*\\(",v={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=[d,o,r,t.C_BLOCK_COMMENT_MODE,h,u],b={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:y.concat([{begin:/\(/,end:/\)/,keywords:v,contains:y.concat(["self"]),relevance:0}]),relevance:0},x={begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:v,relevance:0},{begin:p,returnBegin:!0,contains:[t.inherit(f,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[r,t.C_BLOCK_COMMENT_MODE,u,h,o,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",r,t.C_BLOCK_COMMENT_MODE,u,h,o]}]},o,r,t.C_BLOCK_COMMENT_MODE,d]};return{name:"C",aliases:["h"],keywords:v,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:d,strings:u,keywords:v}}}function jgr(t){const e=t.regex,r=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+n+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.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:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},h={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},d={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},t.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},r,t.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},p=e.optional(i)+t.IDENT_RE+"\\s*\\(",g=["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"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["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"],w={type:m,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},A={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},S=[A,d,o,r,t.C_BLOCK_COMMENT_MODE,h,u],T={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:S.concat([{begin:/\(/,end:/\)/,keywords:w,contains:S.concat(["self"]),relevance:0}]),relevance:0},O={className:"function",begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:w,relevance:0},{begin:p,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,h]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[r,t.C_BLOCK_COMMENT_MODE,u,h,o,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",r,t.C_BLOCK_COMMENT_MODE,u,h,o]}]},o,r,t.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:w,illegal:"",keywords:w,contains:["self",o]},{begin:t.IDENT_RE+"::",keywords:w},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Xgr(t){const e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],r=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],n=["default","false","null","true"],i=["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"],a=["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"],s={keyword:i.concat(a),built_in:e,literal:n},o=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},h={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},d=t.inherit(h,{illegal:/\n/}),f={className:"subst",begin:/\{/,end:/\}/,keywords:s},p=t.inherit(f,{illegal:/\n/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,p]},m={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]},v=t.inherit(m,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});f.contains=[m,g,h,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,l,t.C_BLOCK_COMMENT_MODE],p.contains=[v,g,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,l,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[u,m,g,h,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},b={begin:"<",end:">",contains:[{beginKeywords:"in out"},o]},x=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",w={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:s,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},y,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},o,b,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,b,t.C_LINE_COMMENT_MODE,t.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+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:s,contains:[{beginKeywords:r.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,b],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[y,l,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},w]}}const Kgr=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.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:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.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_-]*/}}),Zgr=["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"],Jgr=["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"],emr=[...Zgr,...Jgr],tmr=["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(),rmr=["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(),nmr=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),imr=["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 amr(t){const e=t.regex,r=Kgr(t),n={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",a=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",o=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[r.BLOCK_COMMENT,n,r.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},r.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+rmr.join("|")+")"},{begin:":(:)?("+nmr.join("|")+")"}]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+imr.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[r.BLOCK_COMMENT,r.HEXCOLOR,r.IMPORTANT,r.CSS_NUMBER_MODE,...o,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...o,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},r.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:tmr.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...o,r.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+emr.join("|")+")\\b"}]}}function smr(t){const e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.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 omr(t){const a={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:a,illegal:"LYe(t,e,r-1))}function umr(t){const e=t.regex,r="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",n=r+LYe("(?:<"+r+"~~~(?:\\s*,\\s*"+r+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+r,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},h={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,r),/\s+/,r,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,r],className:{1:"keyword",3:"title.class"},contains:[h,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+n+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[u,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,DYe,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},DYe,u]}}const MYe="[A-Za-z$_][0-9A-Za-z$_]*",hmr=["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"],dmr=["true","false","null","undefined","NaN","Infinity"],IYe=["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"],PYe=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],NYe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],fmr=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],pmr=[].concat(NYe,IYe,PYe);function gmr(t){const e=t.regex,r=(N,{after:F})=>{const B="",end:""},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(N,F)=>{const B=N[0].length+N.index,V=N.input[B];if(V==="<"||V===","){F.ignoreMatch();return}V===">"&&(r(N,{after:B})||F.ignoreMatch());let z;const U=N.input.substring(B);if(z=U.match(/^\s*=/)){F.ignoreMatch();return}if((z=U.match(/^\s+extends\s+/))&&z.index===0){F.ignoreMatch();return}}},o={$pattern:MYe,keyword:hmr,literal:dmr,built_in:pmr,"variable.language":fmr},l="[0-9](_?[0-9])*",u=`\\.(${l})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${h})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${h})\\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},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,f]},b={className:"comment",variants:[t.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:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},x=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,g,m,v,{match:/\$\d+/},d];f.contains=x.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(x)});const w=[].concat(b,f.contains),A=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(w)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:A},T={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,e.concat(n,"(",e.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},O={relevance:0,match:e.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:{_:[...IYe,...PYe]}},k={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},E={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S],illegal:/%/},_={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function I(N){return e.concat("(?!",N.join("|"),")")}const L={match:e.concat(/\b/,I([...NYe,"super","import"].map(N=>`${N}\\s*\\(`)),n,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},R={begin:e.concat(/\./,e.lookahead(e.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},D={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},S]},M="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",P={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(M)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:A,CLASS_REFERENCE:O},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),k,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,g,m,v,b,{match:/\$\d+/},d,O,{scope:"attr",match:n+e.lookahead(":"),relevance:0},P,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,t.REGEXP_MODE,{className:"function",begin:M,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:A}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},E,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[S,t.inherit(t.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},R,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[S]},L,_,T,D,{match:/\$[(.]/}]}}function mmr(t){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},n=["true","false","null"],i={scope:"literal",beginKeywords:n.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:n},contains:[e,r,t.QUOTE_STRING_MODE,i,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var pE="[0-9](_*[0-9])*",sQ=`\\.(${pE})`,oQ="[0-9a-fA-F](_*[0-9a-fA-F])*",vmr={className:"number",variants:[{begin:`(\\b(${pE})((${sQ})|\\.)?|(${sQ}))[eE][+-]?(${pE})[fFdD]?\\b`},{begin:`\\b(${pE})((${sQ})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${sQ})[fFdD]?\\b`},{begin:`\\b(${pE})[fFdD]\\b`},{begin:`\\b0[xX]((${oQ})\\.?|(${oQ})?\\.(${oQ}))[pP][+-]?(${pE})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${oQ})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function ymr(t){const e={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"},r={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},n={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},a={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},s={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[a,i]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,a,i]}]};i.contains.push(s);const o={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(s,{className:"string"}),"self"]}]},u=vmr,h=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:"type",begin:t.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},f=d;return f.variants[1].contains=[d],d.variants[1].contains=[f],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,h,r,n,o,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,t.C_LINE_COMMENT_MODE,h],relevance:0},t.C_LINE_COMMENT_MODE,h,o,l,s,t.C_NUMBER_MODE]},h]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},o,l]},s,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` +`},u]}}const bmr=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.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:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.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_-]*/}}),xmr=["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"],wmr=["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"],Amr=[...xmr,...wmr],Smr=["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(),BYe=["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(),$Ye=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Tmr=["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(),Cmr=BYe.concat($Ye).sort().reverse();function Omr(t){const e=bmr(t),r=Cmr,n="and or not only",i="[\\w-]+",a="("+i+"|@\\{"+i+"\\})",s=[],o=[],l=function(x){return{className:"string",begin:"~?"+x+".*?"+x}},u=function(x,w,A){return{className:x,begin:w,relevance:A}},h={$pattern:/[a-z-]+/,keyword:n,attribute:Smr.join(" ")},d={begin:"\\(",end:"\\)",contains:o,keywords:h,relevance:0};o.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,l("'"),l('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,d,u("variable","@@?"+i,10),u("variable","@\\{"+i+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);const f=o.concat({begin:/\{/,end:/\}/,contains:s}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(o)},g={begin:a+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Tmr.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:o}}]},m={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:h,returnEnd:!0,contains:o,relevance:0}},v={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:f}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:a,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,p,u("keyword","all\\b"),u("variable","@\\{"+i+"\\}"),{begin:"\\b("+Amr.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,u("selector-tag",a,0),u("selector-id","#"+a),u("selector-class","\\."+a,0),u("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+BYe.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+$Ye.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:f},{begin:"!important"},e.FUNCTION_DISPATCH]},b={begin:i+`:(:)?(${r.join("|")})`,returnBegin:!0,contains:[y]};return s.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,m,v,b,g,y,p,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}function kmr(t){const e="\\[=*\\[",r="\\]=*\\]",n={begin:e,end:r,contains:["self"]},i=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,r,{contains:[n],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:t.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:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:r,contains:[n],relevance:5}])}}function Emr(t){const e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},n={begin:"^[-\\*]{3,}",end:"$"},i={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}]},a={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},o=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,o,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},h={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},d=t.inherit(u,{contains:[]}),f=t.inherit(h,{contains:[]});u.contains.push(f),h.contains.push(d);let p=[r,l];return[u,h,d,f].forEach(y=>{y.contains=y.contains.concat(p)}),p=p.concat(u,h),{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}]}]},r,a,u,h,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},i,n,l,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Rmr(t){const e={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+"},r=/[a-zA-Z@][a-zA-Z0-9_]*/,o={"variable.language":["this","super"],$pattern:r,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:r,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:o,illegal:"/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}function Dmr(t){const e=t.regex,r=["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"],n=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:r.join(" ")},a={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},s={begin:/->\{/,end:/\}/},o={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[o]},u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},h=[t.BACKSLASH_ESCAPE,a,l],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(m,v,y="\\1")=>{const b=y==="\\1"?y:e.concat(y,v);return e.concat(e.concat("(?:",m,")"),v,/(?:\\.|[^\\\/])*?/,b,/(?:\\.|[^\\\/])*?/,y,n)},p=(m,v,y)=>e.concat(e.concat("(?:",m,")"),v,/(?:\\.|[^\\\/])*?/,y,n),g=[l,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:h,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:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:f("s|tr|y",e.either(...d,{capture:!0}))},{begin:f("s|tr|y","\\(","\\)")},{begin:f("s|tr|y","\\[","\\]")},{begin:f("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p("(?:m|qr)?",/\//,/\//)},{begin:p("m|qr",e.either(...d,{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:[t.TITLE_MODE,o]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,o,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return a.contains=g,s.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:g}}function Lmr(t){const e=t.regex,r=/(?![A-Za-z0-9])(?![$])/,n=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,r),i=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,r),a=e.concat(/[A-Z]+/,r),s={scope:"variable",match:"\\$+"+n},o={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=t.inherit(t.APOS_STRING_MODE,{illegal:null}),h=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(l)}),d={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(R,D)=>{D.data._beginMatch=R[1]||R[2]},"on:end":(R,D)=>{D.data._beginMatch!==R[1]&&D.ignoreMatch()}},f=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[ +]`,g={scope:"string",variants:[h,u,d,f]},m={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},v=["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"],w={keyword:y,literal:(R=>{const D=[];return R.forEach(M=>{D.push(M),M.toLowerCase()===M?D.push(M.toUpperCase()):D.push(M.toLowerCase())}),D})(v),built_in:b},A=R=>R.map(D=>D.replace(/\|\d+$/,"")),S={variants:[{match:[/new/,e.concat(p,"+"),e.concat("(?!",A(b).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},T=e.concat(n,"\\b(?!\\()"),O={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),T],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,e.concat(/::/,e.lookahead(/(?!class\b)/)),T],scope:{1:"title.class",3:"variable.constant"}},{match:[i,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},k={scope:"attr",match:e.concat(n,e.lookahead(":"),e.lookahead(/(?!::)/))},E={relevance:0,begin:/\(/,end:/\)/,keywords:w,contains:[k,s,O,t.C_BLOCK_COMMENT_MODE,g,m,S]},_={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",A(y).join("\\b|"),"|",A(b).join("\\b|"),"\\b)"),n,e.concat(p,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[E]};E.contains.push(_);const I=[k,O,t.C_BLOCK_COMMENT_MODE,g,m,S],L={begin:e.concat(/#\[\s*\\?/,e.either(i,a)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...I]},...I,{scope:"meta",variants:[{match:i},{match:a}]}]};return{case_insensitive:!1,keywords:w,contains:[L,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},o,{scope:"variable.language",match:/\$this\b/},s,_,O,{match:[/const/,/\s/,n],scope:{1:"keyword",3:"variable.constant"}},S,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:w,contains:["self",L,s,O,t.C_BLOCK_COMMENT_MODE,g,m]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},g,m]}}function Mmr(t){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},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function Imr(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Pmr(t){const e=t.regex,r=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),n=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],o={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:n,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:o,illegal:/#/},h={begin:/\{\{/,relevance:0},d={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,l,h,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,l,h,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:[t.BACKSLASH_ESCAPE,h,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,h,u]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},f="[0-9](_?[0-9])*",p=`(\\b(${f}))?\\.(${f})|\\b(${f})\\.`,g=`\\b|${n.join("|")}`,m={className:"number",relevance:0,variants:[{begin:`(\\b(${f})|(${p}))[eE][+-]?(${f})[jJ]?(?=${g})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${f})[jJ](?=${g})`}]},v={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:o,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:o,contains:["self",l,m,d,t.HASH_COMMENT_MODE]}]};return u.contains=[d,m,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[l,m,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},d,v,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[m,y,d]}]}}function Nmr(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function Bmr(t){const e=t.regex,r=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,n=e.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]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,a=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:r,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:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:r},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,n]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,n]},{scope:{1:"punctuation",2:"number"},match:[a,n]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,n]}]},{scope:{3:"operator"},match:[r,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:a},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function $mr(t){const e=t.regex,r="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",n=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=e.concat(n,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},o={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},u=[t.COMMENT("#","$",{contains:[o]}),t.COMMENT("^=begin","^=end",{contains:[o],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],h={className:"subst",begin:/#\{/,end:/\}/,keywords:s},d={className:"string",contains:[t.BACKSLASH_ESCAPE,h],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:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,h]})]}]},f="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",g={className:"number",relevance:0,variants:[{begin:`\\b(${f})(\\.(${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"}]},m={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},S=[d,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:s},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:n,scope:"title.class"},{match:[/def/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[m]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[d,{begin:r}],relevance:0},g,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,h],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,u),relevance:0}].concat(l,u);h.contains=S,m.contains=S;const E=[{begin:/^\s*=>/,starts:{end:"$",contains:S}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:s,contains:S}}];return u.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(E).concat(u).concat(S)}}function Fmr(t){const e=t.regex,r=/(r#)?/,n=e.concat(r,t.UNDERSCORE_IDENT_RE),i=e.concat(r,t.IDENT_RE),a={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,e.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",o=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],h=["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:t.IDENT_RE+"!?",type:h,keyword:o,literal:l,built_in:u},illegal:""},a]}}const zmr=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.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:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.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_-]*/}}),Umr=["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"],Vmr=["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"],Qmr=[...Umr,...Vmr],Gmr=["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(),Hmr=["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(),Wmr=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Ymr=["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 qmr(t){const e=zmr(t),r=Wmr,n=Hmr,i="@[a-z-]+",a="and or not only",o={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+Qmr.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+n.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+r.join("|")+")"},o,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Ymr.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:[e.BLOCK_COMMENT,o,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:Gmr.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},o,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function jmr(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function Xmr(t){const e=t.regex,r=t.COMMENT("--","$"),n={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],o=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],h=["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"],d=["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"],f=["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=h,g=[...u,...l].filter(A=>!h.includes(A)),m={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:e.concat(/\b/,e.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function b(A){return e.concat(/\b/,e.either(...A.map(S=>S.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:b(f),relevance:0};function w(A,{exceptions:S,when:T}={}){const O=T;return S=S||[],A.map(k=>k.match(/\|\d+$/)||S.includes(k)?k:O(k)?`${k}|0`:k)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:w(g,{when:A=>A.length<3}),literal:a,type:o,built_in:d},contains:[{scope:"type",match:b(s)},x,y,m,n,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,r,v]}}function FYe(t){return t?typeof t=="string"?t:t.source:null}function R6(t){return ua("(?=",t,")")}function ua(...t){return t.map(r=>FYe(r)).join("")}function Kmr(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function gu(...t){return"("+(Kmr(t).capture?"":"?:")+t.map(n=>FYe(n)).join("|")+")"}const uce=t=>ua(/\b/,t,/\w$/.test(t)?/\b/:/\B/),Zmr=["Protocol","Type"].map(uce),zYe=["init","self"].map(uce),Jmr=["Any","Self"],hce=["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"],UYe=["false","nil","true"],e0r=["assignment","associativity","higherThan","left","lowerThan","none","right"],t0r=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],VYe=["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"],QYe=gu(/[/=\-+!*%<>&|^~?]/,/[\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]/),GYe=gu(QYe,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),dce=ua(QYe,GYe,"*"),HYe=gu(/[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]/),lQ=gu(HYe,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),em=ua(HYe,lQ,"*"),cQ=ua(/[A-Z]/,lQ,"*"),r0r=["attached","autoclosure",ua(/convention\(/,gu("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",ua(/objc\(/,em,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],n0r=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function i0r(t){const e={match:/\s+/,relevance:0},r=t.COMMENT("/\\*","\\*/",{contains:["self"]}),n=[t.C_LINE_COMMENT_MODE,r],i={match:[/\./,gu(...Zmr,...zYe)],className:{2:"keyword"}},a={match:ua(/\./,gu(...hce)),relevance:0},s=hce.filter(Oe=>typeof Oe=="string").concat(["_|0"]),o=hce.filter(Oe=>typeof Oe!="string").concat(Jmr).map(uce),l={variants:[{className:"keyword",match:gu(...o,...zYe)}]},u={$pattern:gu(/\b\w+/,/#\w+/),keyword:s.concat(t0r),literal:UYe},h=[i,a,l],d={match:ua(/\./,gu(...VYe)),relevance:0},f={className:"built_in",match:ua(/\b/,gu(...VYe),/(?=\()/)},p=[d,f],g={match:/->/,relevance:0},m={className:"operator",relevance:0,variants:[{match:dce},{match:`\\.(\\.|${GYe})+`}]},v=[g,m],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/}]},w=(Oe="")=>({className:"subst",variants:[{match:ua(/\\/,Oe,/[0\\tnr"']/)},{match:ua(/\\/,Oe,/u\{[0-9a-fA-F]{1,8}\}/)}]}),A=(Oe="")=>({className:"subst",match:ua(/\\/,Oe,/[\t ]*(?:[\r\n]|\r\n)/)}),S=(Oe="")=>({className:"subst",label:"interpol",begin:ua(/\\/,Oe,/\(/),end:/\)/}),T=(Oe="")=>({begin:ua(Oe,/"""/),end:ua(/"""/,Oe),contains:[w(Oe),A(Oe),S(Oe)]}),O=(Oe="")=>({begin:ua(Oe,/"/),end:ua(/"/,Oe),contains:[w(Oe),S(Oe)]}),k={className:"string",variants:[T(),T("#"),T("##"),T("###"),O(),O("#"),O("##"),O("###")]},E=[t.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[t.BACKSLASH_ESCAPE]}],_={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:E},I=Oe=>{const $e=ua(Oe,/\//),he=ua(/\//,Oe);return{begin:$e,end:he,contains:[...E,{scope:"comment",begin:`#(?!.*${he})`,end:/$/}]}},L={scope:"regexp",variants:[I("###"),I("##"),I("#"),_]},R={match:ua(/`/,em,/`/)},D={className:"variable",match:/\$\d+/},M={className:"variable",match:`\\$${lQ}+`},P=[R,D,M],N={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:n0r,contains:[...v,x,k]}]}},F={scope:"keyword",match:ua(/@/,gu(...r0r),R6(gu(/\(/,/\s+/)))},B={scope:"meta",match:ua(/@/,em)},V=[N,F,B],z={match:R6(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:ua(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,lQ,"+")},{className:"type",match:cQ,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:ua(/\s+&\s+/,R6(cQ)),relevance:0}]},U={begin://,keywords:u,contains:[...n,...h,...V,g,z]};z.contains.push(U);const Q={match:ua(em,/\s*:/),keywords:"_|0",relevance:0},G={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",Q,...n,L,...h,...p,...v,x,k,...P,...V,z]},X={begin://,keywords:"repeat each",contains:[...n,z]},Y={begin:gu(R6(ua(em,/\s*:/)),R6(ua(em,/\s+/,em,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:em}]},le={begin:/\(/,end:/\)/,keywords:u,contains:[Y,...n,...h,...v,x,k,...V,z,G],endsParent:!0,illegal:/["']/},q={match:[/(func|macro)/,/\s+/,gu(R.match,em,dce)],className:{1:"keyword",3:"title.function"},contains:[X,le,e],illegal:[/\[/,/%/]},Z={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[X,le,e],illegal:/\[|%/},ee={match:[/operator/,/\s+/,dce],className:{1:"keyword",3:"title"}},re={begin:[/precedencegroup/,/\s+/,cQ],className:{1:"keyword",3:"title"},contains:[z],keywords:[...e0r,...UYe],end:/}/},ve={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},ae={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Ce={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,em,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[X,...h,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:cQ},...h],relevance:0}]};for(const Oe of k.variants){const $e=Oe.contains.find(fe=>fe.label==="interpol");$e.keywords=u;const he=[...h,...p,...v,x,k,...P];$e.contains=[...he,{begin:/\(/,end:/\)/,contains:["self",...he]}]}return{name:"Swift",keywords:u,contains:[...n,q,Z,ve,ae,Ce,ee,re,{beginKeywords:"import",end:/$/,contains:[...n],relevance:0},L,...h,...p,...v,x,k,...P,...V,z,G]}}const uQ="[A-Za-z$_][0-9A-Za-z$_]*",WYe=["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"],YYe=["true","false","null","undefined","NaN","Infinity"],qYe=["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"],jYe=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],XYe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],KYe=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ZYe=[].concat(XYe,qYe,jYe);function a0r(t){const e=t.regex,r=(N,{after:F})=>{const B="",end:""},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(N,F)=>{const B=N[0].length+N.index,V=N.input[B];if(V==="<"||V===","){F.ignoreMatch();return}V===">"&&(r(N,{after:B})||F.ignoreMatch());let z;const U=N.input.substring(B);if(z=U.match(/^\s*=/)){F.ignoreMatch();return}if((z=U.match(/^\s+extends\s+/))&&z.index===0){F.ignoreMatch();return}}},o={$pattern:uQ,keyword:WYe,literal:YYe,built_in:ZYe,"variable.language":KYe},l="[0-9](_?[0-9])*",u=`\\.(${l})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${h})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${h})\\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},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,f]},b={className:"comment",variants:[t.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:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},x=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,g,m,v,{match:/\$\d+/},d];f.contains=x.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(x)});const w=[].concat(b,f.contains),A=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(w)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:A},T={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,e.concat(n,"(",e.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},O={relevance:0,match:e.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:{_:[...qYe,...jYe]}},k={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},E={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S],illegal:/%/},_={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function I(N){return e.concat("(?!",N.join("|"),")")}const L={match:e.concat(/\b/,I([...XYe,"super","import"].map(N=>`${N}\\s*\\(`)),n,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},R={begin:e.concat(/\./,e.lookahead(e.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},D={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},S]},M="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",P={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(M)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:A,CLASS_REFERENCE:O},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),k,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,g,m,v,b,{match:/\$\d+/},d,O,{scope:"attr",match:n+e.lookahead(":"),relevance:0},P,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,t.REGEXP_MODE,{className:"function",begin:M,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:A}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},E,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[S,t.inherit(t.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},R,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[S]},L,_,T,D,{match:/\$[(.]/}]}}function s0r(t){const e=t.regex,r=a0r(t),n=uQ,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[r.exports.CLASS_REFERENCE]},o={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:uQ,keyword:WYe.concat(l),literal:YYe,built_in:ZYe.concat(i),"variable.language":KYe},h={className:"meta",begin:"@"+n},d=(m,v,y)=>{const b=m.contains.findIndex(x=>x.label===v);if(b===-1)throw new Error("can not find mode to replace");m.contains.splice(b,1,y)};Object.assign(r.keywords,u),r.exports.PARAMS_CONTAINS.push(h);const f=r.contains.find(m=>m.scope==="attr"),p=Object.assign({},f,{match:e.concat(n,e.lookahead(/\s*\?:/))});r.exports.PARAMS_CONTAINS.push([r.exports.CLASS_REFERENCE,f,p]),r.contains=r.contains.concat([h,a,s,p]),d(r,"shebang",t.SHEBANG()),d(r,"use_strict",o);const g=r.contains.find(m=>m.label==="func.def");return g.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}function o0r(t){const e=t.regex,r={className:"string",begin:/"(""|[^/n])"C\b/},n={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,o=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:e.concat(/# */,e.either(a,i),/ *#/)},{begin:e.concat(/# */,o,/ *#/)},{begin:e.concat(/# */,s,/ *#/)},{begin:e.concat(/# */,e.either(a,i),/ +/,e.either(s,o),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},h={className:"label",begin:/^\w+:/},d=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),f=t.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:[r,n,l,u,h,d,f,{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:[f]}]}}function l0r(t){t.regex;const e=t.COMMENT(/\(;/,/;\)/);e.contains.push("self");const r=t.COMMENT(/;;/,/$/),n=["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"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},a={className:"variable",begin:/\$[\w_]+/},s={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},o={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:n},contains:[r,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},a,s,i,t.QUOTE_STRING_MODE,l,u,o]}}function c0r(t){const e=t.regex,r=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),n=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(a,{begin:/\(/,end:/\)/}),o=t.inherit(t.APOS_STRING_MODE,{className:"string"}),l=t.inherit(t.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:[a,l,o,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[a,s,l,o]}]}]},t.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:r,relevance:0,starts:u}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(r,/>/))),contains:[{className:"name",begin:r,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function u0r(t){const e="true false yes no null",r="[\\w#;/?:@&=+$,.~*'()[\\]]+",n={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},o=t.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),f={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:e,relevance:0},g={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},m={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},v=[n,{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+!"+r},{className:"type",begin:"!<"+r+">"},{className:"type",begin:"!"+r},{className:"type",begin:"!!"+r},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},f,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},g,m,a,s],y=[...v];return y.pop(),y.push(o),p.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const h0r={arduino:Wgr,bash:Ygr,c:qgr,cpp:jgr,csharp:Xgr,css:amr,diff:smr,go:omr,graphql:lmr,ini:cmr,java:umr,javascript:gmr,json:mmr,kotlin:ymr,less:Omr,lua:kmr,makefile:Emr,markdown:_mr,objectivec:Rmr,perl:Dmr,php:Lmr,"php-template":Mmr,plaintext:Imr,python:Pmr,"python-repl":Nmr,r:Bmr,ruby:$mr,rust:Fmr,scss:qmr,shell:jmr,sql:Xmr,swift:i0r,typescript:s0r,vbnet:o0r,wasm:l0r,xml:c0r,yaml:u0r};function JYe(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{const r=t[e],n=typeof r;(n==="object"||n==="function")&&!Object.isFrozen(r)&&JYe(r)}),t}class eqe{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function tqe(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Vb(t,...e){const r=Object.create(null);for(const n in t)r[n]=t[n];return e.forEach(function(n){for(const i in n)r[i]=n[i]}),r}const d0r="",rqe=t=>!!t.scope,f0r=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const r=t.split(".");return[`${e}${r.shift()}`,...r.map((n,i)=>`${n}${"_".repeat(i+1)}`)].join(" ")}return`${e}${t}`};class p0r{constructor(e,r){this.buffer="",this.classPrefix=r.classPrefix,e.walk(this)}addText(e){this.buffer+=tqe(e)}openNode(e){if(!rqe(e))return;const r=f0r(e.scope,{prefix:this.classPrefix});this.span(r)}closeNode(e){rqe(e)&&(this.buffer+=d0r)}value(){return this.buffer}span(e){this.buffer+=``}}const nqe=(t={})=>{const e={children:[]};return Object.assign(e,t),e};class fce{constructor(){this.rootNode=nqe(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const r=nqe({scope:e});this.add(r),this.stack.push(r)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,r){return typeof r=="string"?e.addText(r):r.children&&(e.openNode(r),r.children.forEach(n=>this._walk(e,n)),e.closeNode(r)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(r=>typeof r=="string")?e.children=[e.children.join("")]:e.children.forEach(r=>{fce._collapse(r)}))}}class g0r extends fce{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,r){const n=e.root;r&&(n.scope=`language:${r}`),this.add(n)}toHTML(){return new p0r(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function D6(t){return t?typeof t=="string"?t:t.source:null}function iqe(t){return sA("(?=",t,")")}function m0r(t){return sA("(?:",t,")*")}function v0r(t){return sA("(?:",t,")?")}function sA(...t){return t.map(r=>D6(r)).join("")}function y0r(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function pce(...t){return"("+(y0r(t).capture?"":"?:")+t.map(n=>D6(n)).join("|")+")"}function aqe(t){return new RegExp(t.toString()+"|").exec("").length-1}function b0r(t,e){const r=t&&t.exec(e);return r&&r.index===0}const x0r=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function gce(t,{joinWith:e}){let r=0;return t.map(n=>{r+=1;const i=r;let a=D6(n),s="";for(;a.length>0;){const o=x0r.exec(a);if(!o){s+=a;break}s+=a.substring(0,o.index),a=a.substring(o.index+o[0].length),o[0][0]==="\\"&&o[1]?s+="\\"+String(Number(o[1])+i):(s+=o[0],o[0]==="("&&r++)}return s}).map(n=>`(${n})`).join(e)}const w0r=/\b\B/,sqe="[a-zA-Z]\\w*",mce="[a-zA-Z_]\\w*",oqe="\\b\\d+(\\.\\d+)?",lqe="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",cqe="\\b(0b[01]+)",A0r="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",S0r=(t={})=>{const e=/^#![ ]*\//;return t.binary&&(t.begin=sA(e,/.*\b/,t.binary,/\b.*/)),Vb({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(r,n)=>{r.index!==0&&n.ignoreMatch()}},t)},L6={begin:"\\\\[\\s\\S]",relevance:0},T0r={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[L6]},C0r={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[L6]},O0r={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/},hQ=function(t,e,r={}){const n=Vb({scope:"comment",begin:t,end:e,contains:[]},r);n.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 i=pce("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 n.contains.push({begin:sA(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},k0r=hQ("//","$"),E0r=hQ("/\\*","\\*/"),_0r=hQ("#","$"),R0r={scope:"number",begin:oqe,relevance:0},D0r={scope:"number",begin:lqe,relevance:0},L0r={scope:"number",begin:cqe,relevance:0},M0r={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[L6,{begin:/\[/,end:/\]/,relevance:0,contains:[L6]}]},I0r={scope:"title",begin:sqe,relevance:0},P0r={scope:"title",begin:mce,relevance:0},N0r={begin:"\\.\\s*"+mce,relevance:0};var dQ=Object.freeze({__proto__:null,APOS_STRING_MODE:T0r,BACKSLASH_ESCAPE:L6,BINARY_NUMBER_MODE:L0r,BINARY_NUMBER_RE:cqe,COMMENT:hQ,C_BLOCK_COMMENT_MODE:E0r,C_LINE_COMMENT_MODE:k0r,C_NUMBER_MODE:D0r,C_NUMBER_RE:lqe,END_SAME_AS_BEGIN:function(t){return Object.assign(t,{"on:begin":(e,r)=>{r.data._beginMatch=e[1]},"on:end":(e,r)=>{r.data._beginMatch!==e[1]&&r.ignoreMatch()}})},HASH_COMMENT_MODE:_0r,IDENT_RE:sqe,MATCH_NOTHING_RE:w0r,METHOD_GUARD:N0r,NUMBER_MODE:R0r,NUMBER_RE:oqe,PHRASAL_WORDS_MODE:O0r,QUOTE_STRING_MODE:C0r,REGEXP_MODE:M0r,RE_STARTERS_RE:A0r,SHEBANG:S0r,TITLE_MODE:I0r,UNDERSCORE_IDENT_RE:mce,UNDERSCORE_TITLE_MODE:P0r});function B0r(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function $0r(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function F0r(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=B0r,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function z0r(t,e){Array.isArray(t.illegal)&&(t.illegal=pce(...t.illegal))}function U0r(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function V0r(t,e){t.relevance===void 0&&(t.relevance=1)}const Q0r=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");const r=Object.assign({},t);Object.keys(t).forEach(n=>{delete t[n]}),t.keywords=r.keywords,t.begin=sA(r.beforeMatch,iqe(r.begin)),t.starts={relevance:0,contains:[Object.assign(r,{endsParent:!0})]},t.relevance=0,delete r.beforeMatch},G0r=["of","and","for","in","not","or","if","then","parent","list","value"],H0r="keyword";function uqe(t,e,r=H0r){const n=Object.create(null);return typeof t=="string"?i(r,t.split(" ")):Array.isArray(t)?i(r,t):Object.keys(t).forEach(function(a){Object.assign(n,uqe(t[a],e,a))}),n;function i(a,s){e&&(s=s.map(o=>o.toLowerCase())),s.forEach(function(o){const l=o.split("|");n[l[0]]=[a,W0r(l[0],l[1])]})}}function W0r(t,e){return e?Number(e):Y0r(t)?0:1}function Y0r(t){return G0r.includes(t.toLowerCase())}const hqe={},oA=t=>{console.error(t)},dqe=(t,...e)=>{console.log(`WARN: ${t}`,...e)},gE=(t,e)=>{hqe[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),hqe[`${t}/${e}`]=!0)},fQ=new Error;function fqe(t,e,{key:r}){let n=0;const i=t[r],a={},s={};for(let o=1;o<=e.length;o++)s[o+n]=i[o],a[o+n]=!0,n+=aqe(e[o-1]);t[r]=s,t[r]._emit=a,t[r]._multi=!0}function q0r(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw oA("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),fQ;if(typeof t.beginScope!="object"||t.beginScope===null)throw oA("beginScope must be object"),fQ;fqe(t,t.begin,{key:"beginScope"}),t.begin=gce(t.begin,{joinWith:""})}}function j0r(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw oA("skip, excludeEnd, returnEnd not compatible with endScope: {}"),fQ;if(typeof t.endScope!="object"||t.endScope===null)throw oA("endScope must be object"),fQ;fqe(t,t.end,{key:"endScope"}),t.end=gce(t.end,{joinWith:""})}}function X0r(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function K0r(t){X0r(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),q0r(t),j0r(t)}function Z0r(t){function e(s,o){return new RegExp(D6(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(o?"g":""))}class r{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(o,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,o]),this.matchAt+=aqe(o)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const o=this.regexes.map(l=>l[1]);this.matcherRe=e(gce(o,{joinWith:"|"}),!0),this.lastIndex=0}exec(o){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(o);if(!l)return null;const u=l.findIndex((d,f)=>f>0&&d!==void 0),h=this.matchIndexes[u];return l.splice(0,u),Object.assign(l,h)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(o){if(this.multiRegexes[o])return this.multiRegexes[o];const l=new r;return this.rules.slice(o).forEach(([u,h])=>l.addRule(u,h)),l.compile(),this.multiRegexes[o]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(o,l){this.rules.push([o,l]),l.type==="begin"&&this.count++}exec(o){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(o);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const h=this.getMatcher(0);h.lastIndex=this.lastIndex+1,u=h.exec(o)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function i(s){const o=new n;return s.contains.forEach(l=>o.addRule(l.begin,{rule:l,type:"begin"})),s.terminatorEnd&&o.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&o.addRule(s.illegal,{type:"illegal"}),o}function a(s,o){const l=s;if(s.isCompiled)return l;[$0r,U0r,K0r,Q0r].forEach(h=>h(s,o)),t.compilerExtensions.forEach(h=>h(s,o)),s.__beforeBegin=null,[F0r,z0r,V0r].forEach(h=>h(s,o)),s.isCompiled=!0;let u=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),u=s.keywords.$pattern,delete s.keywords.$pattern),u=u||/\w+/,s.keywords&&(s.keywords=uqe(s.keywords,t.case_insensitive)),l.keywordPatternRe=e(u,!0),o&&(s.begin||(s.begin=/\B|\b/),l.beginRe=e(l.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(l.endRe=e(l.end)),l.terminatorEnd=D6(l.end)||"",s.endsWithParent&&o.terminatorEnd&&(l.terminatorEnd+=(s.end?"|":"")+o.terminatorEnd)),s.illegal&&(l.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(h){return J0r(h==="self"?s:h)})),s.contains.forEach(function(h){a(h,l)}),s.starts&&a(s.starts,o),l.matcher=i(l),l}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=Vb(t.classNameAliases||{}),a(t)}function pqe(t){return t?t.endsWithParent||pqe(t.starts):!1}function J0r(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return Vb(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:pqe(t)?Vb(t,{starts:t.starts?Vb(t.starts):null}):Object.isFrozen(t)?Vb(t):t}var evr="11.11.1";class tvr extends Error{constructor(e,r){super(e),this.name="HTMLInjectionError",this.html=r}}const vce=tqe,gqe=Vb,mqe=Symbol("nomatch"),rvr=7,vqe=function(t){const e=Object.create(null),r=Object.create(null),n=[];let i=!0;const a="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let o={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:g0r};function l(M){return o.noHighlightRe.test(M)}function u(M){let P=M.className+" ";P+=M.parentNode?M.parentNode.className:"";const N=o.languageDetectRe.exec(P);if(N){const F=O(N[1]);return F||(dqe(a.replace("{}",N[1])),dqe("Falling back to no-highlight mode for this block.",M)),F?N[1]:"no-highlight"}return P.split(/\s+/).find(F=>l(F)||O(F))}function h(M,P,N){let F="",B="";typeof P=="object"?(F=M,N=P.ignoreIllegals,B=P.language):(gE("10.7.0","highlight(lang, code, ...args) has been deprecated."),gE("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),B=M,F=P),N===void 0&&(N=!0);const V={code:F,language:B};R("before:highlight",V);const z=V.result?V.result:d(V.language,V.code,N);return z.code=V.code,R("after:highlight",z),z}function d(M,P,N,F){const B=Object.create(null);function V(K,ce){return K.keywords[ce]}function z(){if(!he.keywords){Se.addText(ge);return}let K=0;he.keywordPatternRe.lastIndex=0;let ce=he.keywordPatternRe.exec(ge),be="";for(;ce;){be+=ge.substring(K,ce.index);const ne=Ce.case_insensitive?ce[0].toLowerCase():ce[0],j=V(he,ne);if(j){const[ie,pe]=j;if(Se.addText(be),be="",B[ne]=(B[ne]||0)+1,B[ne]<=rvr&&(Qe+=pe),ie.startsWith("_"))be+=ce[0];else{const te=Ce.classNameAliases[ie]||ie;G(ce[0],te)}}else be+=ce[0];K=he.keywordPatternRe.lastIndex,ce=he.keywordPatternRe.exec(ge)}be+=ge.substring(K),Se.addText(be)}function U(){if(ge==="")return;let K=null;if(typeof he.subLanguage=="string"){if(!e[he.subLanguage]){Se.addText(ge);return}K=d(he.subLanguage,ge,!0,fe[he.subLanguage]),fe[he.subLanguage]=K._top}else K=p(ge,he.subLanguage.length?he.subLanguage:null);he.relevance>0&&(Qe+=K.relevance),Se.__addSublanguage(K._emitter,K.language)}function Q(){he.subLanguage!=null?U():z(),ge=""}function G(K,ce){K!==""&&(Se.startScope(ce),Se.addText(K),Se.endScope())}function X(K,ce){let be=1;const ne=ce.length-1;for(;be<=ne;){if(!K._emit[be]){be++;continue}const j=Ce.classNameAliases[K[be]]||K[be],ie=ce[be];j?G(ie,j):(ge=ie,z(),ge=""),be++}}function Y(K,ce){return K.scope&&typeof K.scope=="string"&&Se.openNode(Ce.classNameAliases[K.scope]||K.scope),K.beginScope&&(K.beginScope._wrap?(G(ge,Ce.classNameAliases[K.beginScope._wrap]||K.beginScope._wrap),ge=""):K.beginScope._multi&&(X(K.beginScope,ce),ge="")),he=Object.create(K,{parent:{value:he}}),he}function le(K,ce,be){let ne=b0r(K.endRe,be);if(ne){if(K["on:end"]){const j=new eqe(K);K["on:end"](ce,j),j.isMatchIgnored&&(ne=!1)}if(ne){for(;K.endsParent&&K.parent;)K=K.parent;return K}}if(K.endsWithParent)return le(K.parent,ce,be)}function q(K){return he.matcher.regexIndex===0?(ge+=K[0],1):(qe=!0,0)}function Z(K){const ce=K[0],be=K.rule,ne=new eqe(be),j=[be.__beforeBegin,be["on:begin"]];for(const ie of j)if(ie&&(ie(K,ne),ne.isMatchIgnored))return q(ce);return be.skip?ge+=ce:(be.excludeBegin&&(ge+=ce),Q(),!be.returnBegin&&!be.excludeBegin&&(ge=ce)),Y(be,K),be.returnBegin?0:ce.length}function ee(K){const ce=K[0],be=P.substring(K.index),ne=le(he,K,be);if(!ne)return mqe;const j=he;he.endScope&&he.endScope._wrap?(Q(),G(ce,he.endScope._wrap)):he.endScope&&he.endScope._multi?(Q(),X(he.endScope,K)):j.skip?ge+=ce:(j.returnEnd||j.excludeEnd||(ge+=ce),Q(),j.excludeEnd&&(ge=ce));do he.scope&&Se.closeNode(),!he.skip&&!he.subLanguage&&(Qe+=he.relevance),he=he.parent;while(he!==ne.parent);return ne.starts&&Y(ne.starts,K),j.returnEnd?0:ce.length}function re(){const K=[];for(let ce=he;ce!==Ce;ce=ce.parent)ce.scope&&K.unshift(ce.scope);K.forEach(ce=>Se.openNode(ce))}let ve={};function ae(K,ce){const be=ce&&ce[0];if(ge+=K,be==null)return Q(),0;if(ve.type==="begin"&&ce.type==="end"&&ve.index===ce.index&&be===""){if(ge+=P.slice(ce.index,ce.index+1),!i){const ne=new Error(`0 width match regex (${M})`);throw ne.languageName=M,ne.badRule=ve.rule,ne}return 1}if(ve=ce,ce.type==="begin")return Z(ce);if(ce.type==="illegal"&&!N){const ne=new Error('Illegal lexeme "'+be+'" for mode "'+(he.scope||"")+'"');throw ne.mode=he,ne}else if(ce.type==="end"){const ne=ee(ce);if(ne!==mqe)return ne}if(ce.type==="illegal"&&be==="")return ge+=` +`,1;if(De>1e5&&De>ce.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ge+=be,be.length}const Ce=O(M);if(!Ce)throw oA(a.replace("{}",M)),new Error('Unknown language: "'+M+'"');const Oe=Z0r(Ce);let $e="",he=F||Oe;const fe={},Se=new o.__emitter(o);re();let ge="",Qe=0,Te=0,De=0,qe=!1;try{if(Ce.__emitTokens)Ce.__emitTokens(P,Se);else{for(he.matcher.considerAll();;){De++,qe?qe=!1:he.matcher.considerAll(),he.matcher.lastIndex=Te;const K=he.matcher.exec(P);if(!K)break;const ce=P.substring(Te,K.index),be=ae(ce,K);Te=K.index+be}ae(P.substring(Te))}return Se.finalize(),$e=Se.toHTML(),{language:M,value:$e,relevance:Qe,illegal:!1,_emitter:Se,_top:he}}catch(K){if(K.message&&K.message.includes("Illegal"))return{language:M,value:vce(P),illegal:!0,relevance:0,_illegalBy:{message:K.message,index:Te,context:P.slice(Te-100,Te+100),mode:K.mode,resultSoFar:$e},_emitter:Se};if(i)return{language:M,value:vce(P),illegal:!1,relevance:0,errorRaised:K,_emitter:Se,_top:he};throw K}}function f(M){const P={value:vce(M),illegal:!1,relevance:0,_top:s,_emitter:new o.__emitter(o)};return P._emitter.addText(M),P}function p(M,P){P=P||o.languages||Object.keys(e);const N=f(M),F=P.filter(O).filter(E).map(Q=>d(Q,M,!1));F.unshift(N);const B=F.sort((Q,G)=>{if(Q.relevance!==G.relevance)return G.relevance-Q.relevance;if(Q.language&&G.language){if(O(Q.language).supersetOf===G.language)return 1;if(O(G.language).supersetOf===Q.language)return-1}return 0}),[V,z]=B,U=V;return U.secondBest=z,U}function g(M,P,N){const F=P&&r[P]||N;M.classList.add("hljs"),M.classList.add(`language-${F}`)}function m(M){let P=null;const N=u(M);if(l(N))return;if(R("before:highlightElement",{el:M,language:N}),M.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",M);return}if(M.children.length>0&&(o.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(M)),o.throwUnescapedHTML))throw new tvr("One of your code blocks includes unescaped HTML.",M.innerHTML);P=M;const F=P.textContent,B=N?h(F,{language:N,ignoreIllegals:!0}):p(F);M.innerHTML=B.value,M.dataset.highlighted="yes",g(M,N,B.language),M.result={language:B.language,re:B.relevance,relevance:B.relevance},B.secondBest&&(M.secondBest={language:B.secondBest.language,relevance:B.secondBest.relevance}),R("after:highlightElement",{el:M,result:B,text:F})}function v(M){o=gqe(o,M)}const y=()=>{w(),gE("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function b(){w(),gE("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function w(){function M(){w()}if(document.readyState==="loading"){x||window.addEventListener("DOMContentLoaded",M,!1),x=!0;return}document.querySelectorAll(o.cssSelector).forEach(m)}function A(M,P){let N=null;try{N=P(t)}catch(F){if(oA("Language definition for '{}' could not be registered.".replace("{}",M)),i)oA(F);else throw F;N=s}N.name||(N.name=M),e[M]=N,N.rawDefinition=P.bind(null,t),N.aliases&&k(N.aliases,{languageName:M})}function S(M){delete e[M];for(const P of Object.keys(r))r[P]===M&&delete r[P]}function T(){return Object.keys(e)}function O(M){return M=(M||"").toLowerCase(),e[M]||e[r[M]]}function k(M,{languageName:P}){typeof M=="string"&&(M=[M]),M.forEach(N=>{r[N.toLowerCase()]=P})}function E(M){const P=O(M);return P&&!P.disableAutodetect}function _(M){M["before:highlightBlock"]&&!M["before:highlightElement"]&&(M["before:highlightElement"]=P=>{M["before:highlightBlock"](Object.assign({block:P.el},P))}),M["after:highlightBlock"]&&!M["after:highlightElement"]&&(M["after:highlightElement"]=P=>{M["after:highlightBlock"](Object.assign({block:P.el},P))})}function I(M){_(M),n.push(M)}function L(M){const P=n.indexOf(M);P!==-1&&n.splice(P,1)}function R(M,P){const N=M;n.forEach(function(F){F[N]&&F[N](P)})}function D(M){return gE("10.7.0","highlightBlock will be removed entirely in v12.0"),gE("10.7.0","Please use highlightElement now."),m(M)}Object.assign(t,{highlight:h,highlightAuto:p,highlightAll:w,highlightElement:m,highlightBlock:D,configure:v,initHighlighting:y,initHighlightingOnLoad:b,registerLanguage:A,unregisterLanguage:S,listLanguages:T,getLanguage:O,registerAliases:k,autoDetection:E,inherit:gqe,addPlugin:I,removePlugin:L}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=evr,t.regex={concat:sA,lookahead:iqe,either:pce,optional:v0r,anyNumberOfTimes:m0r};for(const M in dQ)typeof dQ[M]=="object"&&JYe(dQ[M]);return Object.assign(t,dQ),t},mE=vqe({});mE.newInstance=()=>vqe({});var nvr=mE;mE.HighlightJS=mE,mE.default=mE;const ivr=uh(nvr),yqe={},avr="hljs-";function svr(t){const e=ivr.newInstance();return t&&a(t),{highlight:r,highlightAuto:n,listLanguages:i,register:a,registerAlias:s,registered:o};function r(l,u,h){const d=h||yqe,f=typeof d.prefix=="string"?d.prefix:avr;if(!e.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");e.configure({__emitter:ovr,classPrefix:f});const p=e.highlight(u,{ignoreIllegals:!0,language:l});if(p.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:p.errorRaised});const g=p._emitter.root,m=g.data;return m.language=p.language,m.relevance=p.relevance,g}function n(l,u){const d=(u||yqe).subset||i();let f=-1,p=0,g;for(;++fp&&(p=v.data.relevance,g=v)}return g||{type:"root",children:[],data:{language:void 0,relevance:p}}}function i(){return e.listLanguages()}function a(l,u){if(typeof l=="string")e.registerLanguage(l,u);else{let h;for(h in l)Object.hasOwn(l,h)&&e.registerLanguage(h,l[h])}}function s(l,u){if(typeof l=="string")e.registerAliases(typeof u=="string"?u:[...u],{languageName:l});else{let h;for(h in l)if(Object.hasOwn(l,h)){const d=l[h];e.registerAliases(typeof d=="string"?d:[...d],{languageName:h})}}}function o(l){return!!e.getLanguage(l)}}class ovr{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e==="")return;const r=this.stack[this.stack.length-1],n=r.children[r.children.length-1];n&&n.type==="text"?n.value+=e:r.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,r){const n=this.stack[this.stack.length-1],i=e.root.children;r?n.children.push({type:"element",tagName:"span",properties:{className:[r]},children:i}):n.children.push(...i)}openNode(e){const r=this,n=e.split(".").map(function(s,o){return o?s+"_".repeat(o):r.options.classPrefix+s}),i=this.stack[this.stack.length-1],a={type:"element",tagName:"span",properties:{className:n},children:[]};i.children.push(a),this.stack.push(a)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const lvr={};function bqe(t){const e=t||lvr,r=e.aliases,n=e.detect||!1,i=e.languages||h0r,a=e.plainText,s=e.prefix,o=e.subset;let l="hljs";const u=svr(i);if(r&&u.registerAlias(r),s){const h=s.indexOf("-");l=h===-1?s:s.slice(0,h)}return function(h,d){k6(h,"element",function(f,p,g){if(f.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const m=cvr(f);if(m===!1||!m&&!n||m&&a&&a.includes(m))return;Array.isArray(f.properties.className)||(f.properties.className=[]),f.properties.className.includes(l)||f.properties.className.unshift(l);const v=$gr(f,{whitespace:"pre"});let y;try{y=m?u.highlight(m,v,{prefix:s}):u.highlightAuto(v,{prefix:s,subset:o})}catch(b){const x=b;if(m&&/Unknown language/.test(x.message)){d.message("Cannot highlight as `"+m+"`, it’s not registered",{ancestors:[g,f],cause:x,place:f.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw x}!m&&y.data&&y.data.language&&f.properties.className.push("language-"+y.data.language),y.children.length>0&&(f.children=y.children)})}}function cvr(t){const e=t.properties.className;let r=-1;if(!Array.isArray(e))return;let n;for(;++r-1&&a<=e.length){let s=0;for(;;){let o=r[s];if(o===void 0){const l=Sqe(e,r[s-1]);o=l===-1?e.length+1:l+1,r[s]=o}if(o>a)return{line:s+1,column:a-(s>0?r[s-1]:0)+1,offset:a};s++}}}function i(a){if(a&&typeof a.line=="number"&&typeof a.column=="number"&&!Number.isNaN(a.line)&&!Number.isNaN(a.column)){for(;r.length1?r[a.line-2]:0)+a.column-1;if(s=55296&&t<=57343}function Pvr(t){return t>=56320&&t<=57343}function Nvr(t,e){return(t-55296)*1024+9216+e}function _qe(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function Rqe(t){return t>=64976&&t<=65007||Ivr.has(t)}var yt;(function(t){t.controlCharacterInInputStream="control-character-in-input-stream",t.noncharacterInInputStream="noncharacter-in-input-stream",t.surrogateInInputStream="surrogate-in-input-stream",t.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",t.endTagWithAttributes="end-tag-with-attributes",t.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",t.unexpectedSolidusInTag="unexpected-solidus-in-tag",t.unexpectedNullCharacter="unexpected-null-character",t.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",t.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",t.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",t.missingEndTagName="missing-end-tag-name",t.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",t.unknownNamedCharacterReference="unknown-named-character-reference",t.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",t.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",t.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",t.eofBeforeTagName="eof-before-tag-name",t.eofInTag="eof-in-tag",t.missingAttributeValue="missing-attribute-value",t.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",t.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",t.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",t.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",t.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",t.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",t.missingDoctypePublicIdentifier="missing-doctype-public-identifier",t.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",t.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",t.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",t.cdataInHtmlContent="cdata-in-html-content",t.incorrectlyOpenedComment="incorrectly-opened-comment",t.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",t.eofInDoctype="eof-in-doctype",t.nestedComment="nested-comment",t.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",t.eofInComment="eof-in-comment",t.incorrectlyClosedComment="incorrectly-closed-comment",t.eofInCdata="eof-in-cdata",t.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",t.nullCharacterReference="null-character-reference",t.surrogateCharacterReference="surrogate-character-reference",t.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",t.controlCharacterReference="control-character-reference",t.noncharacterCharacterReference="noncharacter-character-reference",t.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",t.missingDoctypeName="missing-doctype-name",t.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",t.duplicateAttribute="duplicate-attribute",t.nonConformingDoctype="non-conforming-doctype",t.missingDoctype="missing-doctype",t.misplacedDoctype="misplaced-doctype",t.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",t.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",t.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",t.openElementsLeftAfterEof="open-elements-left-after-eof",t.abandonedHeadElementChild="abandoned-head-element-child",t.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",t.nestedNoscriptInHead="nested-noscript-in-head",t.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(yt||(yt={}));const Bvr=65536;class $vr{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=Bvr,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(e,r){const{line:n,col:i,offset:a}=this,s=i+r,o=a+r;return{code:e,startLine:n,endLine:n,startCol:s,endCol:s,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const r=this.html.charCodeAt(this.pos+1);if(Pvr(r))return this.pos++,this._addGap(),Nvr(e,r)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,Be.EOF;return this._err(yt.surrogateInInputStream),e}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(e,r){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=r}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,r){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(r)return this.html.startsWith(e,this.pos);for(let n=0;n=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,Be.EOF;const n=this.html.charCodeAt(r);return n===Be.CARRIAGE_RETURN?Be.LINE_FEED:n}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,Be.EOF;let e=this.html.charCodeAt(this.pos);return e===Be.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,Be.LINE_FEED):e===Be.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Eqe(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===Be.LINE_FEED||e===Be.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){_qe(e)?this._err(yt.controlCharacterInInputStream):Rqe(e)&&this._err(yt.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos=0;r--)if(t.attrs[r].name===e)return t.attrs[r].value;return null}const Fvr=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(t=>t.charCodeAt(0))),zvr=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 Uvr(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=zvr.get(t))!==null&&e!==void 0?e:t}var pl;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(pl||(pl={}));const Vvr=32;var Qb;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Qb||(Qb={}));function wce(t){return t>=pl.ZERO&&t<=pl.NINE}function Qvr(t){return t>=pl.UPPER_A&&t<=pl.UPPER_F||t>=pl.LOWER_A&&t<=pl.LOWER_F}function Gvr(t){return t>=pl.UPPER_A&&t<=pl.UPPER_Z||t>=pl.LOWER_A&&t<=pl.LOWER_Z||wce(t)}function Hvr(t){return t===pl.EQUALS||Gvr(t)}var gl;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(gl||(gl={}));var Pv;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(Pv||(Pv={}));class Wvr{constructor(e,r,n){this.decodeTree=e,this.emitCodePoint=r,this.errors=n,this.state=gl.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Pv.Strict}startEntity(e){this.decodeMode=e,this.state=gl.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,r){switch(this.state){case gl.EntityStart:return e.charCodeAt(r)===pl.NUM?(this.state=gl.NumericStart,this.consumed+=1,this.stateNumericStart(e,r+1)):(this.state=gl.NamedEntity,this.stateNamedEntity(e,r));case gl.NumericStart:return this.stateNumericStart(e,r);case gl.NumericDecimal:return this.stateNumericDecimal(e,r);case gl.NumericHex:return this.stateNumericHex(e,r);case gl.NamedEntity:return this.stateNamedEntity(e,r)}}stateNumericStart(e,r){return r>=e.length?-1:(e.charCodeAt(r)|Vvr)===pl.LOWER_X?(this.state=gl.NumericHex,this.consumed+=1,this.stateNumericHex(e,r+1)):(this.state=gl.NumericDecimal,this.stateNumericDecimal(e,r))}addToNumericResult(e,r,n,i){if(r!==n){const a=n-r;this.result=this.result*Math.pow(i,a)+Number.parseInt(e.substr(r,a),i),this.consumed+=a}}stateNumericHex(e,r){const n=r;for(;r>14;for(;r>14,a!==0){if(s===pl.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==Pv.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:r,decodeTree:n}=this,i=(n[r]&Qb.VALUE_LENGTH)>>14;return this.emitNamedEntityData(r,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,r,n){const{decodeTree:i}=this;return this.emitCodePoint(r===1?i[e]&~Qb.VALUE_LENGTH:i[e+1],n),r===3&&this.emitCodePoint(i[e+2],n),n}end(){var e;switch(this.state){case gl.NamedEntity:return this.result!==0&&(this.decodeMode!==Pv.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case gl.NumericDecimal:return this.emitNumericEntity(0,2);case gl.NumericHex:return this.emitNumericEntity(0,3);case gl.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case gl.EntityStart:return 0}}}function Yvr(t,e,r,n){const i=(e&Qb.BRANCH_LENGTH)>>7,a=e&Qb.JUMP_TABLE;if(i===0)return a!==0&&n===a?r:-1;if(a){const l=n-a;return l<0||l>=i?-1:t[r+l]-1}let s=r,o=s+i-1;for(;s<=o;){const l=s+o>>>1,u=t[l];if(un)o=l-1;else return t[l+i]}return-1}var Ut;(function(t){t.HTML="http://www.w3.org/1999/xhtml",t.MATHML="http://www.w3.org/1998/Math/MathML",t.SVG="http://www.w3.org/2000/svg",t.XLINK="http://www.w3.org/1999/xlink",t.XML="http://www.w3.org/XML/1998/namespace",t.XMLNS="http://www.w3.org/2000/xmlns/"})(Ut||(Ut={}));var cA;(function(t){t.TYPE="type",t.ACTION="action",t.ENCODING="encoding",t.PROMPT="prompt",t.NAME="name",t.COLOR="color",t.FACE="face",t.SIZE="size"})(cA||(cA={}));var kf;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(kf||(kf={}));var st;(function(t){t.A="a",t.ADDRESS="address",t.ANNOTATION_XML="annotation-xml",t.APPLET="applet",t.AREA="area",t.ARTICLE="article",t.ASIDE="aside",t.B="b",t.BASE="base",t.BASEFONT="basefont",t.BGSOUND="bgsound",t.BIG="big",t.BLOCKQUOTE="blockquote",t.BODY="body",t.BR="br",t.BUTTON="button",t.CAPTION="caption",t.CENTER="center",t.CODE="code",t.COL="col",t.COLGROUP="colgroup",t.DD="dd",t.DESC="desc",t.DETAILS="details",t.DIALOG="dialog",t.DIR="dir",t.DIV="div",t.DL="dl",t.DT="dt",t.EM="em",t.EMBED="embed",t.FIELDSET="fieldset",t.FIGCAPTION="figcaption",t.FIGURE="figure",t.FONT="font",t.FOOTER="footer",t.FOREIGN_OBJECT="foreignObject",t.FORM="form",t.FRAME="frame",t.FRAMESET="frameset",t.H1="h1",t.H2="h2",t.H3="h3",t.H4="h4",t.H5="h5",t.H6="h6",t.HEAD="head",t.HEADER="header",t.HGROUP="hgroup",t.HR="hr",t.HTML="html",t.I="i",t.IMG="img",t.IMAGE="image",t.INPUT="input",t.IFRAME="iframe",t.KEYGEN="keygen",t.LABEL="label",t.LI="li",t.LINK="link",t.LISTING="listing",t.MAIN="main",t.MALIGNMARK="malignmark",t.MARQUEE="marquee",t.MATH="math",t.MENU="menu",t.META="meta",t.MGLYPH="mglyph",t.MI="mi",t.MO="mo",t.MN="mn",t.MS="ms",t.MTEXT="mtext",t.NAV="nav",t.NOBR="nobr",t.NOFRAMES="noframes",t.NOEMBED="noembed",t.NOSCRIPT="noscript",t.OBJECT="object",t.OL="ol",t.OPTGROUP="optgroup",t.OPTION="option",t.P="p",t.PARAM="param",t.PLAINTEXT="plaintext",t.PRE="pre",t.RB="rb",t.RP="rp",t.RT="rt",t.RTC="rtc",t.RUBY="ruby",t.S="s",t.SCRIPT="script",t.SEARCH="search",t.SECTION="section",t.SELECT="select",t.SOURCE="source",t.SMALL="small",t.SPAN="span",t.STRIKE="strike",t.STRONG="strong",t.STYLE="style",t.SUB="sub",t.SUMMARY="summary",t.SUP="sup",t.TABLE="table",t.TBODY="tbody",t.TEMPLATE="template",t.TEXTAREA="textarea",t.TFOOT="tfoot",t.TD="td",t.TH="th",t.THEAD="thead",t.TITLE="title",t.TR="tr",t.TRACK="track",t.TT="tt",t.U="u",t.UL="ul",t.SVG="svg",t.VAR="var",t.WBR="wbr",t.XMP="xmp"})(st||(st={}));var H;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.A=1]="A",t[t.ADDRESS=2]="ADDRESS",t[t.ANNOTATION_XML=3]="ANNOTATION_XML",t[t.APPLET=4]="APPLET",t[t.AREA=5]="AREA",t[t.ARTICLE=6]="ARTICLE",t[t.ASIDE=7]="ASIDE",t[t.B=8]="B",t[t.BASE=9]="BASE",t[t.BASEFONT=10]="BASEFONT",t[t.BGSOUND=11]="BGSOUND",t[t.BIG=12]="BIG",t[t.BLOCKQUOTE=13]="BLOCKQUOTE",t[t.BODY=14]="BODY",t[t.BR=15]="BR",t[t.BUTTON=16]="BUTTON",t[t.CAPTION=17]="CAPTION",t[t.CENTER=18]="CENTER",t[t.CODE=19]="CODE",t[t.COL=20]="COL",t[t.COLGROUP=21]="COLGROUP",t[t.DD=22]="DD",t[t.DESC=23]="DESC",t[t.DETAILS=24]="DETAILS",t[t.DIALOG=25]="DIALOG",t[t.DIR=26]="DIR",t[t.DIV=27]="DIV",t[t.DL=28]="DL",t[t.DT=29]="DT",t[t.EM=30]="EM",t[t.EMBED=31]="EMBED",t[t.FIELDSET=32]="FIELDSET",t[t.FIGCAPTION=33]="FIGCAPTION",t[t.FIGURE=34]="FIGURE",t[t.FONT=35]="FONT",t[t.FOOTER=36]="FOOTER",t[t.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",t[t.FORM=38]="FORM",t[t.FRAME=39]="FRAME",t[t.FRAMESET=40]="FRAMESET",t[t.H1=41]="H1",t[t.H2=42]="H2",t[t.H3=43]="H3",t[t.H4=44]="H4",t[t.H5=45]="H5",t[t.H6=46]="H6",t[t.HEAD=47]="HEAD",t[t.HEADER=48]="HEADER",t[t.HGROUP=49]="HGROUP",t[t.HR=50]="HR",t[t.HTML=51]="HTML",t[t.I=52]="I",t[t.IMG=53]="IMG",t[t.IMAGE=54]="IMAGE",t[t.INPUT=55]="INPUT",t[t.IFRAME=56]="IFRAME",t[t.KEYGEN=57]="KEYGEN",t[t.LABEL=58]="LABEL",t[t.LI=59]="LI",t[t.LINK=60]="LINK",t[t.LISTING=61]="LISTING",t[t.MAIN=62]="MAIN",t[t.MALIGNMARK=63]="MALIGNMARK",t[t.MARQUEE=64]="MARQUEE",t[t.MATH=65]="MATH",t[t.MENU=66]="MENU",t[t.META=67]="META",t[t.MGLYPH=68]="MGLYPH",t[t.MI=69]="MI",t[t.MO=70]="MO",t[t.MN=71]="MN",t[t.MS=72]="MS",t[t.MTEXT=73]="MTEXT",t[t.NAV=74]="NAV",t[t.NOBR=75]="NOBR",t[t.NOFRAMES=76]="NOFRAMES",t[t.NOEMBED=77]="NOEMBED",t[t.NOSCRIPT=78]="NOSCRIPT",t[t.OBJECT=79]="OBJECT",t[t.OL=80]="OL",t[t.OPTGROUP=81]="OPTGROUP",t[t.OPTION=82]="OPTION",t[t.P=83]="P",t[t.PARAM=84]="PARAM",t[t.PLAINTEXT=85]="PLAINTEXT",t[t.PRE=86]="PRE",t[t.RB=87]="RB",t[t.RP=88]="RP",t[t.RT=89]="RT",t[t.RTC=90]="RTC",t[t.RUBY=91]="RUBY",t[t.S=92]="S",t[t.SCRIPT=93]="SCRIPT",t[t.SEARCH=94]="SEARCH",t[t.SECTION=95]="SECTION",t[t.SELECT=96]="SELECT",t[t.SOURCE=97]="SOURCE",t[t.SMALL=98]="SMALL",t[t.SPAN=99]="SPAN",t[t.STRIKE=100]="STRIKE",t[t.STRONG=101]="STRONG",t[t.STYLE=102]="STYLE",t[t.SUB=103]="SUB",t[t.SUMMARY=104]="SUMMARY",t[t.SUP=105]="SUP",t[t.TABLE=106]="TABLE",t[t.TBODY=107]="TBODY",t[t.TEMPLATE=108]="TEMPLATE",t[t.TEXTAREA=109]="TEXTAREA",t[t.TFOOT=110]="TFOOT",t[t.TD=111]="TD",t[t.TH=112]="TH",t[t.THEAD=113]="THEAD",t[t.TITLE=114]="TITLE",t[t.TR=115]="TR",t[t.TRACK=116]="TRACK",t[t.TT=117]="TT",t[t.U=118]="U",t[t.UL=119]="UL",t[t.SVG=120]="SVG",t[t.VAR=121]="VAR",t[t.WBR=122]="WBR",t[t.XMP=123]="XMP"})(H||(H={}));const qvr=new Map([[st.A,H.A],[st.ADDRESS,H.ADDRESS],[st.ANNOTATION_XML,H.ANNOTATION_XML],[st.APPLET,H.APPLET],[st.AREA,H.AREA],[st.ARTICLE,H.ARTICLE],[st.ASIDE,H.ASIDE],[st.B,H.B],[st.BASE,H.BASE],[st.BASEFONT,H.BASEFONT],[st.BGSOUND,H.BGSOUND],[st.BIG,H.BIG],[st.BLOCKQUOTE,H.BLOCKQUOTE],[st.BODY,H.BODY],[st.BR,H.BR],[st.BUTTON,H.BUTTON],[st.CAPTION,H.CAPTION],[st.CENTER,H.CENTER],[st.CODE,H.CODE],[st.COL,H.COL],[st.COLGROUP,H.COLGROUP],[st.DD,H.DD],[st.DESC,H.DESC],[st.DETAILS,H.DETAILS],[st.DIALOG,H.DIALOG],[st.DIR,H.DIR],[st.DIV,H.DIV],[st.DL,H.DL],[st.DT,H.DT],[st.EM,H.EM],[st.EMBED,H.EMBED],[st.FIELDSET,H.FIELDSET],[st.FIGCAPTION,H.FIGCAPTION],[st.FIGURE,H.FIGURE],[st.FONT,H.FONT],[st.FOOTER,H.FOOTER],[st.FOREIGN_OBJECT,H.FOREIGN_OBJECT],[st.FORM,H.FORM],[st.FRAME,H.FRAME],[st.FRAMESET,H.FRAMESET],[st.H1,H.H1],[st.H2,H.H2],[st.H3,H.H3],[st.H4,H.H4],[st.H5,H.H5],[st.H6,H.H6],[st.HEAD,H.HEAD],[st.HEADER,H.HEADER],[st.HGROUP,H.HGROUP],[st.HR,H.HR],[st.HTML,H.HTML],[st.I,H.I],[st.IMG,H.IMG],[st.IMAGE,H.IMAGE],[st.INPUT,H.INPUT],[st.IFRAME,H.IFRAME],[st.KEYGEN,H.KEYGEN],[st.LABEL,H.LABEL],[st.LI,H.LI],[st.LINK,H.LINK],[st.LISTING,H.LISTING],[st.MAIN,H.MAIN],[st.MALIGNMARK,H.MALIGNMARK],[st.MARQUEE,H.MARQUEE],[st.MATH,H.MATH],[st.MENU,H.MENU],[st.META,H.META],[st.MGLYPH,H.MGLYPH],[st.MI,H.MI],[st.MO,H.MO],[st.MN,H.MN],[st.MS,H.MS],[st.MTEXT,H.MTEXT],[st.NAV,H.NAV],[st.NOBR,H.NOBR],[st.NOFRAMES,H.NOFRAMES],[st.NOEMBED,H.NOEMBED],[st.NOSCRIPT,H.NOSCRIPT],[st.OBJECT,H.OBJECT],[st.OL,H.OL],[st.OPTGROUP,H.OPTGROUP],[st.OPTION,H.OPTION],[st.P,H.P],[st.PARAM,H.PARAM],[st.PLAINTEXT,H.PLAINTEXT],[st.PRE,H.PRE],[st.RB,H.RB],[st.RP,H.RP],[st.RT,H.RT],[st.RTC,H.RTC],[st.RUBY,H.RUBY],[st.S,H.S],[st.SCRIPT,H.SCRIPT],[st.SEARCH,H.SEARCH],[st.SECTION,H.SECTION],[st.SELECT,H.SELECT],[st.SOURCE,H.SOURCE],[st.SMALL,H.SMALL],[st.SPAN,H.SPAN],[st.STRIKE,H.STRIKE],[st.STRONG,H.STRONG],[st.STYLE,H.STYLE],[st.SUB,H.SUB],[st.SUMMARY,H.SUMMARY],[st.SUP,H.SUP],[st.TABLE,H.TABLE],[st.TBODY,H.TBODY],[st.TEMPLATE,H.TEMPLATE],[st.TEXTAREA,H.TEXTAREA],[st.TFOOT,H.TFOOT],[st.TD,H.TD],[st.TH,H.TH],[st.THEAD,H.THEAD],[st.TITLE,H.TITLE],[st.TR,H.TR],[st.TRACK,H.TRACK],[st.TT,H.TT],[st.U,H.U],[st.UL,H.UL],[st.SVG,H.SVG],[st.VAR,H.VAR],[st.WBR,H.WBR],[st.XMP,H.XMP]]);function bE(t){var e;return(e=qvr.get(t))!==null&&e!==void 0?e:H.UNKNOWN}const qt=H,jvr={[Ut.HTML]:new Set([qt.ADDRESS,qt.APPLET,qt.AREA,qt.ARTICLE,qt.ASIDE,qt.BASE,qt.BASEFONT,qt.BGSOUND,qt.BLOCKQUOTE,qt.BODY,qt.BR,qt.BUTTON,qt.CAPTION,qt.CENTER,qt.COL,qt.COLGROUP,qt.DD,qt.DETAILS,qt.DIR,qt.DIV,qt.DL,qt.DT,qt.EMBED,qt.FIELDSET,qt.FIGCAPTION,qt.FIGURE,qt.FOOTER,qt.FORM,qt.FRAME,qt.FRAMESET,qt.H1,qt.H2,qt.H3,qt.H4,qt.H5,qt.H6,qt.HEAD,qt.HEADER,qt.HGROUP,qt.HR,qt.HTML,qt.IFRAME,qt.IMG,qt.INPUT,qt.LI,qt.LINK,qt.LISTING,qt.MAIN,qt.MARQUEE,qt.MENU,qt.META,qt.NAV,qt.NOEMBED,qt.NOFRAMES,qt.NOSCRIPT,qt.OBJECT,qt.OL,qt.P,qt.PARAM,qt.PLAINTEXT,qt.PRE,qt.SCRIPT,qt.SECTION,qt.SELECT,qt.SOURCE,qt.STYLE,qt.SUMMARY,qt.TABLE,qt.TBODY,qt.TD,qt.TEMPLATE,qt.TEXTAREA,qt.TFOOT,qt.TH,qt.THEAD,qt.TITLE,qt.TR,qt.TRACK,qt.UL,qt.WBR,qt.XMP]),[Ut.MATHML]:new Set([qt.MI,qt.MO,qt.MN,qt.MS,qt.MTEXT,qt.ANNOTATION_XML]),[Ut.SVG]:new Set([qt.TITLE,qt.FOREIGN_OBJECT,qt.DESC]),[Ut.XLINK]:new Set,[Ut.XML]:new Set,[Ut.XMLNS]:new Set},Ace=new Set([qt.H1,qt.H2,qt.H3,qt.H4,qt.H5,qt.H6]);st.STYLE,st.SCRIPT,st.XMP,st.IFRAME,st.NOEMBED,st.NOFRAMES,st.PLAINTEXT;var Ve;(function(t){t[t.DATA=0]="DATA",t[t.RCDATA=1]="RCDATA",t[t.RAWTEXT=2]="RAWTEXT",t[t.SCRIPT_DATA=3]="SCRIPT_DATA",t[t.PLAINTEXT=4]="PLAINTEXT",t[t.TAG_OPEN=5]="TAG_OPEN",t[t.END_TAG_OPEN=6]="END_TAG_OPEN",t[t.TAG_NAME=7]="TAG_NAME",t[t.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",t[t.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",t[t.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",t[t.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",t[t.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",t[t.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",t[t.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",t[t.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",t[t.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",t[t.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",t[t.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",t[t.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",t[t.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",t[t.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",t[t.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",t[t.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",t[t.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",t[t.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",t[t.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",t[t.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",t[t.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",t[t.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",t[t.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",t[t.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",t[t.BOGUS_COMMENT=40]="BOGUS_COMMENT",t[t.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",t[t.COMMENT_START=42]="COMMENT_START",t[t.COMMENT_START_DASH=43]="COMMENT_START_DASH",t[t.COMMENT=44]="COMMENT",t[t.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",t[t.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",t[t.COMMENT_END_DASH=49]="COMMENT_END_DASH",t[t.COMMENT_END=50]="COMMENT_END",t[t.COMMENT_END_BANG=51]="COMMENT_END_BANG",t[t.DOCTYPE=52]="DOCTYPE",t[t.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",t[t.DOCTYPE_NAME=54]="DOCTYPE_NAME",t[t.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",t[t.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",t[t.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",t[t.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",t[t.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",t[t.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",t[t.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",t[t.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",t[t.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",t[t.CDATA_SECTION=68]="CDATA_SECTION",t[t.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",t[t.CDATA_SECTION_END=70]="CDATA_SECTION_END",t[t.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",t[t.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(Ve||(Ve={}));const eo={DATA:Ve.DATA,RCDATA:Ve.RCDATA,RAWTEXT:Ve.RAWTEXT,SCRIPT_DATA:Ve.SCRIPT_DATA,PLAINTEXT:Ve.PLAINTEXT,CDATA_SECTION:Ve.CDATA_SECTION};function Xvr(t){return t>=Be.DIGIT_0&&t<=Be.DIGIT_9}function M6(t){return t>=Be.LATIN_CAPITAL_A&&t<=Be.LATIN_CAPITAL_Z}function Kvr(t){return t>=Be.LATIN_SMALL_A&&t<=Be.LATIN_SMALL_Z}function Gb(t){return Kvr(t)||M6(t)}function Lqe(t){return Gb(t)||Xvr(t)}function gQ(t){return t+32}function Mqe(t){return t===Be.SPACE||t===Be.LINE_FEED||t===Be.TABULATION||t===Be.FORM_FEED}function Iqe(t){return Mqe(t)||t===Be.SOLIDUS||t===Be.GREATER_THAN_SIGN}function Zvr(t){return t===Be.NULL?yt.nullCharacterReference:t>1114111?yt.characterReferenceOutsideUnicodeRange:Eqe(t)?yt.surrogateCharacterReference:Rqe(t)?yt.noncharacterCharacterReference:_qe(t)||t===Be.CARRIAGE_RETURN?yt.controlCharacterReference:null}class Jvr{constructor(e,r){this.options=e,this.handler=r,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=Ve.DATA,this.returnState=Ve.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new $vr(r),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Wvr(Fvr,(n,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(n)},r.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(yt.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:n=>{this._err(yt.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+n)},validateNumericCharacterReference:n=>{const i=Zvr(n);i&&this._err(i,1)}}:void 0)}_err(e,r=0){var n,i;(i=(n=this.handler).onParseError)===null||i===void 0||i.call(n,this.preprocessor.getError(e,r))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e==null||e())}write(e,r,n){this.active=!0,this.preprocessor.write(e,r),this._runParsingLoop(),this.paused||n==null||n()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),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(e){this.consumedAfterSnapshot+=e;for(let r=0;r0&&this._err(yt.endTagWithAttributes),e.selfClosing&&this._err(yt.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case ri.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case ri.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case ri.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:ri.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,r){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=r;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,r)}_emitCodePoint(e){const r=Mqe(e)?ri.WHITESPACE_CHARACTER:e===Be.NULL?ri.NULL_CHARACTER:ri.CHARACTER;this._appendCharToCurrentCharacterToken(r,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(ri.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=Ve.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Pv.Attribute:Pv.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Ve.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Ve.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Ve.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case Ve.DATA:{this._stateData(e);break}case Ve.RCDATA:{this._stateRcdata(e);break}case Ve.RAWTEXT:{this._stateRawtext(e);break}case Ve.SCRIPT_DATA:{this._stateScriptData(e);break}case Ve.PLAINTEXT:{this._statePlaintext(e);break}case Ve.TAG_OPEN:{this._stateTagOpen(e);break}case Ve.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case Ve.TAG_NAME:{this._stateTagName(e);break}case Ve.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case Ve.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case Ve.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case Ve.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case Ve.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case Ve.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case Ve.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case Ve.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case Ve.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case Ve.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case Ve.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case Ve.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case Ve.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case Ve.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case Ve.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case Ve.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case Ve.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case Ve.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case Ve.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case Ve.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case Ve.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case Ve.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case Ve.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case Ve.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case Ve.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case Ve.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case Ve.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case Ve.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case Ve.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case Ve.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case Ve.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case Ve.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case Ve.BOGUS_COMMENT:{this._stateBogusComment(e);break}case Ve.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case Ve.COMMENT_START:{this._stateCommentStart(e);break}case Ve.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case Ve.COMMENT:{this._stateComment(e);break}case Ve.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case Ve.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case Ve.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case Ve.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case Ve.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case Ve.COMMENT_END:{this._stateCommentEnd(e);break}case Ve.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case Ve.DOCTYPE:{this._stateDoctype(e);break}case Ve.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case Ve.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case Ve.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case Ve.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case Ve.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case Ve.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case Ve.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case Ve.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case Ve.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case Ve.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case Ve.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case Ve.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case Ve.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case Ve.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case Ve.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case Ve.CDATA_SECTION:{this._stateCdataSection(e);break}case Ve.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case Ve.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case Ve.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case Ve.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case Be.LESS_THAN_SIGN:{this.state=Ve.TAG_OPEN;break}case Be.AMPERSAND:{this._startCharacterReference();break}case Be.NULL:{this._err(yt.unexpectedNullCharacter),this._emitCodePoint(e);break}case Be.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case Be.AMPERSAND:{this._startCharacterReference();break}case Be.LESS_THAN_SIGN:{this.state=Ve.RCDATA_LESS_THAN_SIGN;break}case Be.NULL:{this._err(yt.unexpectedNullCharacter),this._emitChars(hs);break}case Be.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case Be.LESS_THAN_SIGN:{this.state=Ve.RAWTEXT_LESS_THAN_SIGN;break}case Be.NULL:{this._err(yt.unexpectedNullCharacter),this._emitChars(hs);break}case Be.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case Be.LESS_THAN_SIGN:{this.state=Ve.SCRIPT_DATA_LESS_THAN_SIGN;break}case Be.NULL:{this._err(yt.unexpectedNullCharacter),this._emitChars(hs);break}case Be.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case Be.NULL:{this._err(yt.unexpectedNullCharacter),this._emitChars(hs);break}case Be.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(Gb(e))this._createStartTagToken(),this.state=Ve.TAG_NAME,this._stateTagName(e);else switch(e){case Be.EXCLAMATION_MARK:{this.state=Ve.MARKUP_DECLARATION_OPEN;break}case Be.SOLIDUS:{this.state=Ve.END_TAG_OPEN;break}case Be.QUESTION_MARK:{this._err(yt.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Ve.BOGUS_COMMENT,this._stateBogusComment(e);break}case Be.EOF:{this._err(yt.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(yt.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=Ve.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(Gb(e))this._createEndTagToken(),this.state=Ve.TAG_NAME,this._stateTagName(e);else switch(e){case Be.GREATER_THAN_SIGN:{this._err(yt.missingEndTagName),this.state=Ve.DATA;break}case Be.EOF:{this._err(yt.eofBeforeTagName),this._emitChars("");break}case Be.NULL:{this._err(yt.unexpectedNullCharacter),this.state=Ve.SCRIPT_DATA_ESCAPED,this._emitChars(hs);break}case Be.EOF:{this._err(yt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Ve.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===Be.SOLIDUS?this.state=Ve.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Gb(e)?(this._emitChars("<"),this.state=Ve.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=Ve.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){Gb(e)?(this.state=Ve.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("");break}case Be.NULL:{this._err(yt.unexpectedNullCharacter),this.state=Ve.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(hs);break}case Be.EOF:{this._err(yt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Ve.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===Be.SOLIDUS?(this.state=Ve.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=Ve.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Ah.SCRIPT,!1)&&Iqe(this.preprocessor.peek(Ah.SCRIPT.length))){this._emitCodePoint(e);for(let r=0;r0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,r){const n=this._indexOf(e);this.items[n]=r,n===this.stackTop&&(this.current=r)}insertAfter(e,r,n){const i=this._indexOf(e)+1;this.items.splice(i,0,r),this.tagIDs.splice(i,0,n),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(e){let r=this.stackTop+1;do r=this.tagIDs.lastIndexOf(e,r-1);while(r>0&&this.treeAdapter.getNamespaceURI(this.items[r])!==Ut.HTML);this.shortenToLength(Math.max(r,0))}shortenToLength(e){for(;this.stackTop>=e;){const r=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(r,this.stackTop=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===r)return n;return-1}clearBackTo(e,r){const n=this._indexOfTagNames(e,r);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(iyr,Ut.HTML)}clearBackToTableBodyContext(){this.clearBackTo(nyr,Ut.HTML)}clearBackToTableRowContext(){this.clearBackTo(ryr,Ut.HTML)}remove(e){const r=this._indexOf(e);r>=0&&(r===this.stackTop?this.pop():(this.items.splice(r,1),this.tagIDs.splice(r,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===H.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const r=this._indexOf(e)-1;return r>=0?this.items[r]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===H.HTML}hasInDynamicScope(e,r){for(let n=this.stackTop;n>=0;n--){const i=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case Ut.HTML:{if(i===e)return!0;if(r.has(i))return!1;break}case Ut.SVG:{if($qe.has(i))return!1;break}case Ut.MATHML:{if(Bqe.has(i))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,mQ)}hasInListItemScope(e){return this.hasInDynamicScope(e,eyr)}hasInButtonScope(e){return this.hasInDynamicScope(e,tyr)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const r=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case Ut.HTML:{if(Ace.has(r))return!0;if(mQ.has(r))return!1;break}case Ut.SVG:{if($qe.has(r))return!1;break}case Ut.MATHML:{if(Bqe.has(r))return!1;break}}}return!0}hasInTableScope(e){for(let r=this.stackTop;r>=0;r--)if(this.treeAdapter.getNamespaceURI(this.items[r])===Ut.HTML)switch(this.tagIDs[r]){case e:return!0;case H.TABLE:case H.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===Ut.HTML)switch(this.tagIDs[e]){case H.TBODY:case H.THEAD:case H.TFOOT:return!0;case H.TABLE:case H.HTML:return!1}return!0}hasInSelectScope(e){for(let r=this.stackTop;r>=0;r--)if(this.treeAdapter.getNamespaceURI(this.items[r])===Ut.HTML)switch(this.tagIDs[r]){case e:return!0;case H.OPTION:case H.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Pqe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Nqe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&Nqe.has(this.currentTagId);)this.pop()}}const Sce=3;var tm;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(tm||(tm={}));const Fqe={type:tm.Marker};class oyr{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,r){const n=[],i=r.length,a=this.treeAdapter.getTagName(e),s=this.treeAdapter.getNamespaceURI(e);for(let o=0;o[s.name,s.value]));let a=0;for(let s=0;si.get(l.name)===l.value)&&(a+=1,a>=Sce&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(Fqe)}pushElement(e,r){this._ensureNoahArkCondition(e),this.entries.unshift({type:tm.Element,element:e,token:r})}insertElementAfterBookmark(e,r){const n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:tm.Element,element:e,token:r})}removeEntry(e){const r=this.entries.indexOf(e);r!==-1&&this.entries.splice(r,1)}clearToLastMarker(){const e=this.entries.indexOf(Fqe);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const r=this.entries.find(n=>n.type===tm.Marker||this.treeAdapter.getTagName(n.element)===e);return r&&r.type===tm.Element?r:null}getElementEntry(e){return this.entries.find(r=>r.type===tm.Element&&r.element===e)}}const Hb={createDocument(){return{nodeName:"#document",mode:kf.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(t,e,r){return{nodeName:t,tagName:t,attrs:r,namespaceURI:e,childNodes:[],parentNode:null}},createCommentNode(t){return{nodeName:"#comment",data:t,parentNode:null}},createTextNode(t){return{nodeName:"#text",value:t,parentNode:null}},appendChild(t,e){t.childNodes.push(e),e.parentNode=t},insertBefore(t,e,r){const n=t.childNodes.indexOf(r);t.childNodes.splice(n,0,e),e.parentNode=t},setTemplateContent(t,e){t.content=e},getTemplateContent(t){return t.content},setDocumentType(t,e,r,n){const i=t.childNodes.find(a=>a.nodeName==="#documentType");if(i)i.name=e,i.publicId=r,i.systemId=n;else{const a={nodeName:"#documentType",name:e,publicId:r,systemId:n,parentNode:null};Hb.appendChild(t,a)}},setDocumentMode(t,e){t.mode=e},getDocumentMode(t){return t.mode},detachNode(t){if(t.parentNode){const e=t.parentNode.childNodes.indexOf(t);t.parentNode.childNodes.splice(e,1),t.parentNode=null}},insertText(t,e){if(t.childNodes.length>0){const r=t.childNodes[t.childNodes.length-1];if(Hb.isTextNode(r)){r.value+=e;return}}Hb.appendChild(t,Hb.createTextNode(e))},insertTextBefore(t,e,r){const n=t.childNodes[t.childNodes.indexOf(r)-1];n&&Hb.isTextNode(n)?n.value+=e:Hb.insertBefore(t,Hb.createTextNode(e),r)},adoptAttributes(t,e){const r=new Set(t.attrs.map(n=>n.name));for(let n=0;nt.startsWith(r))}function fyr(t){return t.name===zqe&&t.publicId===null&&(t.systemId===null||t.systemId===lyr)}function pyr(t){if(t.name!==zqe)return kf.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===cyr)return kf.QUIRKS;let{publicId:r}=t;if(r!==null){if(r=r.toLowerCase(),hyr.has(r))return kf.QUIRKS;let n=e===null?uyr:Uqe;if(Qqe(r,n))return kf.QUIRKS;if(n=e===null?Vqe:dyr,Qqe(r,n))return kf.LIMITED_QUIRKS}return kf.NO_QUIRKS}const Gqe={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},gyr="definitionurl",myr="definitionURL",vyr=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(t=>[t.toLowerCase(),t])),yyr=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Ut.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Ut.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Ut.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Ut.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Ut.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Ut.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Ut.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Ut.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Ut.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Ut.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Ut.XMLNS}]]),byr=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(t=>[t.toLowerCase(),t])),xyr=new Set([H.B,H.BIG,H.BLOCKQUOTE,H.BODY,H.BR,H.CENTER,H.CODE,H.DD,H.DIV,H.DL,H.DT,H.EM,H.EMBED,H.H1,H.H2,H.H3,H.H4,H.H5,H.H6,H.HEAD,H.HR,H.I,H.IMG,H.LI,H.LISTING,H.MENU,H.META,H.NOBR,H.OL,H.P,H.PRE,H.RUBY,H.S,H.SMALL,H.SPAN,H.STRONG,H.STRIKE,H.SUB,H.SUP,H.TABLE,H.TT,H.U,H.UL,H.VAR]);function wyr(t){const e=t.tagID;return e===H.FONT&&t.attrs.some(({name:n})=>n===cA.COLOR||n===cA.SIZE||n===cA.FACE)||xyr.has(e)}function Hqe(t){for(let e=0;e0&&this._setContextModes(e,r)}onItemPop(e,r){var n,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(i=(n=this.treeAdapter).onItemPop)===null||i===void 0||i.call(n,e,this.openElements.current),r){let a,s;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,s=this.fragmentContextID):{current:a,currentTagId:s}=this.openElements,this._setContextModes(a,s)}}_setContextModes(e,r){const n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===Ut.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&r!==void 0&&!this._isIntegrationPoint(r,e)}_switchToTextParsing(e,r){this._insertElement(e,Ut.HTML),this.tokenizer.state=r,this.originalInsertionMode=this.insertionMode,this.insertionMode=Ke.TEXT}switchToPlaintextParsing(){this.insertionMode=Ke.TEXT,this.originalInsertionMode=Ke.IN_BODY,this.tokenizer.state=eo.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===st.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Ut.HTML))switch(this.fragmentContextID){case H.TITLE:case H.TEXTAREA:{this.tokenizer.state=eo.RCDATA;break}case H.STYLE:case H.XMP:case H.IFRAME:case H.NOEMBED:case H.NOFRAMES:case H.NOSCRIPT:{this.tokenizer.state=eo.RAWTEXT;break}case H.SCRIPT:{this.tokenizer.state=eo.SCRIPT_DATA;break}case H.PLAINTEXT:{this.tokenizer.state=eo.PLAINTEXT;break}}}_setDocumentType(e){const r=e.name||"",n=e.publicId||"",i=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,r,n,i),e.location){const s=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));s&&this.treeAdapter.setNodeSourceCodeLocation(s,e.location)}}_attachElementToTree(e,r){if(this.options.sourceCodeLocationInfo){const n=r&&{...r,startTag:r};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const n=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(n??this.document,e)}}_appendElement(e,r){const n=this.treeAdapter.createElement(e.tagName,r,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,r){const n=this.treeAdapter.createElement(e.tagName,r,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,r){const n=this.treeAdapter.createElement(e,Ut.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,r)}_insertTemplate(e){const r=this.treeAdapter.createElement(e.tagName,Ut.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(r,n),this._attachElementToTree(r,e.location),this.openElements.push(r,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(st.HTML,Ut.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,H.HTML)}_appendCommentNode(e,r){const n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(r,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let r,n;if(this._shouldFosterParentOnInsertion()?({parent:r,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(r,e.chars,n):this.treeAdapter.insertText(r,e.chars)):(r=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(r,e.chars)),!e.location)return;const i=this.treeAdapter.getChildNodes(r),a=n?i.lastIndexOf(n):i.length,s=i[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(s)){const{endLine:l,endCol:u,endOffset:h}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(s,{endLine:l,endCol:u,endOffset:h})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,e.location)}_adoptNodes(e,r){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(r,n)}_setEndLocation(e,r){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&r.location){const n=r.location,i=this.treeAdapter.getTagName(e),a=r.type===ri.END_TAG&&i===r.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,a)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let r,n;return this.openElements.stackTop===0&&this.fragmentContext?(r=this.fragmentContext,n=this.fragmentContextID):{current:r,currentTagId:n}=this.openElements,e.tagID===H.SVG&&this.treeAdapter.getTagName(r)===st.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(r)===Ut.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===H.MGLYPH||e.tagID===H.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,r,Ut.HTML)}_processToken(e){switch(e.type){case ri.CHARACTER:{this.onCharacter(e);break}case ri.NULL_CHARACTER:{this.onNullCharacter(e);break}case ri.COMMENT:{this.onComment(e);break}case ri.DOCTYPE:{this.onDoctype(e);break}case ri.START_TAG:{this._processStartTag(e);break}case ri.END_TAG:{this.onEndTag(e);break}case ri.EOF:{this.onEof(e);break}case ri.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,r,n){const i=this.treeAdapter.getNamespaceURI(r),a=this.treeAdapter.getAttrList(r);return Cyr(e,i,a,n)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const r=this.activeFormattingElements.entries.findIndex(i=>i.type===tm.Marker||this.openElements.contains(i.element)),n=r===-1?e-1:r-1;for(let i=n;i>=0;i--){const a=this.activeFormattingElements.entries[i];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Ke.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(H.P),this.openElements.popUntilTagNamePopped(H.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case H.TR:{this.insertionMode=Ke.IN_ROW;return}case H.TBODY:case H.THEAD:case H.TFOOT:{this.insertionMode=Ke.IN_TABLE_BODY;return}case H.CAPTION:{this.insertionMode=Ke.IN_CAPTION;return}case H.COLGROUP:{this.insertionMode=Ke.IN_COLUMN_GROUP;return}case H.TABLE:{this.insertionMode=Ke.IN_TABLE;return}case H.BODY:{this.insertionMode=Ke.IN_BODY;return}case H.FRAMESET:{this.insertionMode=Ke.IN_FRAMESET;return}case H.SELECT:{this._resetInsertionModeForSelect(e);return}case H.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case H.HTML:{this.insertionMode=this.headElement?Ke.AFTER_HEAD:Ke.BEFORE_HEAD;return}case H.TD:case H.TH:{if(e>0){this.insertionMode=Ke.IN_CELL;return}break}case H.HEAD:{if(e>0){this.insertionMode=Ke.IN_HEAD;return}break}}this.insertionMode=Ke.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let r=e-1;r>0;r--){const n=this.openElements.tagIDs[r];if(n===H.TEMPLATE)break;if(n===H.TABLE){this.insertionMode=Ke.IN_SELECT_IN_TABLE;return}}this.insertionMode=Ke.IN_SELECT}_isElementCausesFosterParenting(e){return Yqe.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const r=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case H.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(r)===Ut.HTML)return{parent:this.treeAdapter.getTemplateContent(r),beforeElement:null};break}case H.TABLE:{const n=this.treeAdapter.getParentNode(r);return n?{parent:n,beforeElement:r}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const r=this._findFosterParentingLocation();r.beforeElement?this.treeAdapter.insertBefore(r.parent,e,r.beforeElement):this.treeAdapter.appendChild(r.parent,e)}_isSpecialElement(e,r){const n=this.treeAdapter.getNamespaceURI(e);return jvr[n].has(r)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){abr(this,e);return}switch(this.insertionMode){case Ke.INITIAL:{I6(this,e);break}case Ke.BEFORE_HTML:{P6(this,e);break}case Ke.BEFORE_HEAD:{N6(this,e);break}case Ke.IN_HEAD:{B6(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{$6(this,e);break}case Ke.AFTER_HEAD:{F6(this,e);break}case Ke.IN_BODY:case Ke.IN_CAPTION:case Ke.IN_CELL:case Ke.IN_TEMPLATE:{Kqe(this,e);break}case Ke.TEXT:case Ke.IN_SELECT:case Ke.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case Ke.IN_TABLE:case Ke.IN_TABLE_BODY:case Ke.IN_ROW:{Ece(this,e);break}case Ke.IN_TABLE_TEXT:{aje(this,e);break}case Ke.IN_COLUMN_GROUP:{bQ(this,e);break}case Ke.AFTER_BODY:{AQ(this,e);break}case Ke.AFTER_AFTER_BODY:{SQ(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){ibr(this,e);return}switch(this.insertionMode){case Ke.INITIAL:{I6(this,e);break}case Ke.BEFORE_HTML:{P6(this,e);break}case Ke.BEFORE_HEAD:{N6(this,e);break}case Ke.IN_HEAD:{B6(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{$6(this,e);break}case Ke.AFTER_HEAD:{F6(this,e);break}case Ke.TEXT:{this._insertCharacters(e);break}case Ke.IN_TABLE:case Ke.IN_TABLE_BODY:case Ke.IN_ROW:{Ece(this,e);break}case Ke.IN_COLUMN_GROUP:{bQ(this,e);break}case Ke.AFTER_BODY:{AQ(this,e);break}case Ke.AFTER_AFTER_BODY:{SQ(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){Oce(this,e);return}switch(this.insertionMode){case Ke.INITIAL:case Ke.BEFORE_HTML:case Ke.BEFORE_HEAD:case Ke.IN_HEAD:case Ke.IN_HEAD_NO_SCRIPT:case Ke.AFTER_HEAD:case Ke.IN_BODY:case Ke.IN_TABLE:case Ke.IN_CAPTION:case Ke.IN_COLUMN_GROUP:case Ke.IN_TABLE_BODY:case Ke.IN_ROW:case Ke.IN_CELL:case Ke.IN_SELECT:case Ke.IN_SELECT_IN_TABLE:case Ke.IN_TEMPLATE:case Ke.IN_FRAMESET:case Ke.AFTER_FRAMESET:{Oce(this,e);break}case Ke.IN_TABLE_TEXT:{V6(this,e);break}case Ke.AFTER_BODY:{Nyr(this,e);break}case Ke.AFTER_AFTER_BODY:case Ke.AFTER_AFTER_FRAMESET:{Byr(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case Ke.INITIAL:{$yr(this,e);break}case Ke.BEFORE_HEAD:case Ke.IN_HEAD:case Ke.IN_HEAD_NO_SCRIPT:case Ke.AFTER_HEAD:{this._err(e,yt.misplacedDoctype);break}case Ke.IN_TABLE_TEXT:{V6(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,yt.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?sbr(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case Ke.INITIAL:{I6(this,e);break}case Ke.BEFORE_HTML:{Fyr(this,e);break}case Ke.BEFORE_HEAD:{Uyr(this,e);break}case Ke.IN_HEAD:{Pp(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{Gyr(this,e);break}case Ke.AFTER_HEAD:{Wyr(this,e);break}case Ke.IN_BODY:{Mc(this,e);break}case Ke.IN_TABLE:{xE(this,e);break}case Ke.IN_TABLE_TEXT:{V6(this,e);break}case Ke.IN_CAPTION:{V1r(this,e);break}case Ke.IN_COLUMN_GROUP:{_ce(this,e);break}case Ke.IN_TABLE_BODY:{xQ(this,e);break}case Ke.IN_ROW:{wQ(this,e);break}case Ke.IN_CELL:{H1r(this,e);break}case Ke.IN_SELECT:{lje(this,e);break}case Ke.IN_SELECT_IN_TABLE:{Y1r(this,e);break}case Ke.IN_TEMPLATE:{j1r(this,e);break}case Ke.AFTER_BODY:{K1r(this,e);break}case Ke.IN_FRAMESET:{Z1r(this,e);break}case Ke.AFTER_FRAMESET:{ebr(this,e);break}case Ke.AFTER_AFTER_BODY:{rbr(this,e);break}case Ke.AFTER_AFTER_FRAMESET:{nbr(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?obr(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case Ke.INITIAL:{I6(this,e);break}case Ke.BEFORE_HTML:{zyr(this,e);break}case Ke.BEFORE_HEAD:{Vyr(this,e);break}case Ke.IN_HEAD:{Qyr(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{Hyr(this,e);break}case Ke.AFTER_HEAD:{Yyr(this,e);break}case Ke.IN_BODY:{yQ(this,e);break}case Ke.TEXT:{L1r(this,e);break}case Ke.IN_TABLE:{z6(this,e);break}case Ke.IN_TABLE_TEXT:{V6(this,e);break}case Ke.IN_CAPTION:{Q1r(this,e);break}case Ke.IN_COLUMN_GROUP:{G1r(this,e);break}case Ke.IN_TABLE_BODY:{Rce(this,e);break}case Ke.IN_ROW:{oje(this,e);break}case Ke.IN_CELL:{W1r(this,e);break}case Ke.IN_SELECT:{cje(this,e);break}case Ke.IN_SELECT_IN_TABLE:{q1r(this,e);break}case Ke.IN_TEMPLATE:{X1r(this,e);break}case Ke.AFTER_BODY:{hje(this,e);break}case Ke.IN_FRAMESET:{J1r(this,e);break}case Ke.AFTER_FRAMESET:{tbr(this,e);break}case Ke.AFTER_AFTER_BODY:{SQ(this,e);break}}}onEof(e){switch(this.insertionMode){case Ke.INITIAL:{I6(this,e);break}case Ke.BEFORE_HTML:{P6(this,e);break}case Ke.BEFORE_HEAD:{N6(this,e);break}case Ke.IN_HEAD:{B6(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{$6(this,e);break}case Ke.AFTER_HEAD:{F6(this,e);break}case Ke.IN_BODY:case Ke.IN_TABLE:case Ke.IN_CAPTION:case Ke.IN_COLUMN_GROUP:case Ke.IN_TABLE_BODY:case Ke.IN_ROW:case Ke.IN_CELL:case Ke.IN_SELECT:case Ke.IN_SELECT_IN_TABLE:{nje(this,e);break}case Ke.TEXT:{M1r(this,e);break}case Ke.IN_TABLE_TEXT:{V6(this,e);break}case Ke.IN_TEMPLATE:{uje(this,e);break}case Ke.AFTER_BODY:case Ke.IN_FRAMESET:case Ke.AFTER_FRAMESET:case Ke.AFTER_AFTER_BODY:case Ke.AFTER_AFTER_FRAMESET:{kce(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===Be.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case Ke.IN_HEAD:case Ke.IN_HEAD_NO_SCRIPT:case Ke.AFTER_HEAD:case Ke.TEXT:case Ke.IN_COLUMN_GROUP:case Ke.IN_SELECT:case Ke.IN_SELECT_IN_TABLE:case Ke.IN_FRAMESET:case Ke.AFTER_FRAMESET:{this._insertCharacters(e);break}case Ke.IN_BODY:case Ke.IN_CAPTION:case Ke.IN_CELL:case Ke.IN_TEMPLATE:case Ke.AFTER_BODY:case Ke.AFTER_AFTER_BODY:case Ke.AFTER_AFTER_FRAMESET:{Xqe(this,e);break}case Ke.IN_TABLE:case Ke.IN_TABLE_BODY:case Ke.IN_ROW:{Ece(this,e);break}case Ke.IN_TABLE_TEXT:{ije(this,e);break}}}};function Ryr(t,e){let r=t.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return r?t.openElements.contains(r.element)?t.openElements.hasInScope(e.tagID)||(r=null):(t.activeFormattingElements.removeEntry(r),r=null):rje(t,e),r}function Dyr(t,e){let r=null,n=t.openElements.stackTop;for(;n>=0;n--){const i=t.openElements.items[n];if(i===e.element)break;t._isSpecialElement(i,t.openElements.tagIDs[n])&&(r=i)}return r||(t.openElements.shortenToLength(Math.max(n,0)),t.activeFormattingElements.removeEntry(e)),r}function Lyr(t,e,r){let n=e,i=t.openElements.getCommonAncestor(e);for(let a=0,s=i;s!==r;a++,s=i){i=t.openElements.getCommonAncestor(s);const o=t.activeFormattingElements.getElementEntry(s),l=o&&a>=Eyr;!o||l?(l&&t.activeFormattingElements.removeEntry(o),t.openElements.remove(s)):(s=Myr(t,o),n===e&&(t.activeFormattingElements.bookmark=o),t.treeAdapter.detachNode(n),t.treeAdapter.appendChild(s,n),n=s)}return n}function Myr(t,e){const r=t.treeAdapter.getNamespaceURI(e.element),n=t.treeAdapter.createElement(e.token.tagName,r,e.token.attrs);return t.openElements.replace(e.element,n),e.element=n,n}function Iyr(t,e,r){const n=t.treeAdapter.getTagName(e),i=bE(n);if(t._isElementCausesFosterParenting(i))t._fosterParentElement(r);else{const a=t.treeAdapter.getNamespaceURI(e);i===H.TEMPLATE&&a===Ut.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,r)}}function Pyr(t,e,r){const n=t.treeAdapter.getNamespaceURI(r.element),{token:i}=r,a=t.treeAdapter.createElement(i.tagName,n,i.attrs);t._adoptNodes(e,a),t.treeAdapter.appendChild(e,a),t.activeFormattingElements.insertElementAfterBookmark(a,i),t.activeFormattingElements.removeEntry(r),t.openElements.remove(r.element),t.openElements.insertAfter(e,a,i.tagID)}function Cce(t,e){for(let r=0;r=r;n--)t._setEndLocation(t.openElements.items[n],e);if(!t.fragmentContext&&t.openElements.stackTop>=0){const n=t.openElements.items[0],i=t.treeAdapter.getNodeSourceCodeLocation(n);if(i&&!i.endTag&&(t._setEndLocation(n,e),t.openElements.stackTop>=1)){const a=t.openElements.items[1],s=t.treeAdapter.getNodeSourceCodeLocation(a);s&&!s.endTag&&t._setEndLocation(a,e)}}}}function $yr(t,e){t._setDocumentType(e);const r=e.forceQuirks?kf.QUIRKS:pyr(e);fyr(e)||t._err(e,yt.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,r),t.insertionMode=Ke.BEFORE_HTML}function I6(t,e){t._err(e,yt.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,kf.QUIRKS),t.insertionMode=Ke.BEFORE_HTML,t._processToken(e)}function Fyr(t,e){e.tagID===H.HTML?(t._insertElement(e,Ut.HTML),t.insertionMode=Ke.BEFORE_HEAD):P6(t,e)}function zyr(t,e){const r=e.tagID;(r===H.HTML||r===H.HEAD||r===H.BODY||r===H.BR)&&P6(t,e)}function P6(t,e){t._insertFakeRootElement(),t.insertionMode=Ke.BEFORE_HEAD,t._processToken(e)}function Uyr(t,e){switch(e.tagID){case H.HTML:{Mc(t,e);break}case H.HEAD:{t._insertElement(e,Ut.HTML),t.headElement=t.openElements.current,t.insertionMode=Ke.IN_HEAD;break}default:N6(t,e)}}function Vyr(t,e){const r=e.tagID;r===H.HEAD||r===H.BODY||r===H.HTML||r===H.BR?N6(t,e):t._err(e,yt.endTagWithoutMatchingOpenElement)}function N6(t,e){t._insertFakeElement(st.HEAD,H.HEAD),t.headElement=t.openElements.current,t.insertionMode=Ke.IN_HEAD,t._processToken(e)}function Pp(t,e){switch(e.tagID){case H.HTML:{Mc(t,e);break}case H.BASE:case H.BASEFONT:case H.BGSOUND:case H.LINK:case H.META:{t._appendElement(e,Ut.HTML),e.ackSelfClosing=!0;break}case H.TITLE:{t._switchToTextParsing(e,eo.RCDATA);break}case H.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,eo.RAWTEXT):(t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_HEAD_NO_SCRIPT);break}case H.NOFRAMES:case H.STYLE:{t._switchToTextParsing(e,eo.RAWTEXT);break}case H.SCRIPT:{t._switchToTextParsing(e,eo.SCRIPT_DATA);break}case H.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=Ke.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(Ke.IN_TEMPLATE);break}case H.HEAD:{t._err(e,yt.misplacedStartTagForHeadElement);break}default:B6(t,e)}}function Qyr(t,e){switch(e.tagID){case H.HEAD:{t.openElements.pop(),t.insertionMode=Ke.AFTER_HEAD;break}case H.BODY:case H.BR:case H.HTML:{B6(t,e);break}case H.TEMPLATE:{uA(t,e);break}default:t._err(e,yt.endTagWithoutMatchingOpenElement)}}function uA(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==H.TEMPLATE&&t._err(e,yt.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(H.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,yt.endTagWithoutMatchingOpenElement)}function B6(t,e){t.openElements.pop(),t.insertionMode=Ke.AFTER_HEAD,t._processToken(e)}function Gyr(t,e){switch(e.tagID){case H.HTML:{Mc(t,e);break}case H.BASEFONT:case H.BGSOUND:case H.HEAD:case H.LINK:case H.META:case H.NOFRAMES:case H.STYLE:{Pp(t,e);break}case H.NOSCRIPT:{t._err(e,yt.nestedNoscriptInHead);break}default:$6(t,e)}}function Hyr(t,e){switch(e.tagID){case H.NOSCRIPT:{t.openElements.pop(),t.insertionMode=Ke.IN_HEAD;break}case H.BR:{$6(t,e);break}default:t._err(e,yt.endTagWithoutMatchingOpenElement)}}function $6(t,e){const r=e.type===ri.EOF?yt.openElementsLeftAfterEof:yt.disallowedContentInNoscriptInHead;t._err(e,r),t.openElements.pop(),t.insertionMode=Ke.IN_HEAD,t._processToken(e)}function Wyr(t,e){switch(e.tagID){case H.HTML:{Mc(t,e);break}case H.BODY:{t._insertElement(e,Ut.HTML),t.framesetOk=!1,t.insertionMode=Ke.IN_BODY;break}case H.FRAMESET:{t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_FRAMESET;break}case H.BASE:case H.BASEFONT:case H.BGSOUND:case H.LINK:case H.META:case H.NOFRAMES:case H.SCRIPT:case H.STYLE:case H.TEMPLATE:case H.TITLE:{t._err(e,yt.abandonedHeadElementChild),t.openElements.push(t.headElement,H.HEAD),Pp(t,e),t.openElements.remove(t.headElement);break}case H.HEAD:{t._err(e,yt.misplacedStartTagForHeadElement);break}default:F6(t,e)}}function Yyr(t,e){switch(e.tagID){case H.BODY:case H.HTML:case H.BR:{F6(t,e);break}case H.TEMPLATE:{uA(t,e);break}default:t._err(e,yt.endTagWithoutMatchingOpenElement)}}function F6(t,e){t._insertFakeElement(st.BODY,H.BODY),t.insertionMode=Ke.IN_BODY,vQ(t,e)}function vQ(t,e){switch(e.type){case ri.CHARACTER:{Kqe(t,e);break}case ri.WHITESPACE_CHARACTER:{Xqe(t,e);break}case ri.COMMENT:{Oce(t,e);break}case ri.START_TAG:{Mc(t,e);break}case ri.END_TAG:{yQ(t,e);break}case ri.EOF:{nje(t,e);break}}}function Xqe(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function Kqe(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function qyr(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function jyr(t,e){const r=t.openElements.tryPeekProperlyNestedBodyElement();r&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(r,e.attrs))}function Xyr(t,e){const r=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&r&&(t.treeAdapter.detachNode(r),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_FRAMESET)}function Kyr(t,e){t.openElements.hasInButtonScope(H.P)&&t._closePElement(),t._insertElement(e,Ut.HTML)}function Zyr(t,e){t.openElements.hasInButtonScope(H.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&Ace.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,Ut.HTML)}function Jyr(t,e){t.openElements.hasInButtonScope(H.P)&&t._closePElement(),t._insertElement(e,Ut.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function e1r(t,e){const r=t.openElements.tmplCount>0;(!t.formElement||r)&&(t.openElements.hasInButtonScope(H.P)&&t._closePElement(),t._insertElement(e,Ut.HTML),r||(t.formElement=t.openElements.current))}function t1r(t,e){t.framesetOk=!1;const r=e.tagID;for(let n=t.openElements.stackTop;n>=0;n--){const i=t.openElements.tagIDs[n];if(r===H.LI&&i===H.LI||(r===H.DD||r===H.DT)&&(i===H.DD||i===H.DT)){t.openElements.generateImpliedEndTagsWithExclusion(i),t.openElements.popUntilTagNamePopped(i);break}if(i!==H.ADDRESS&&i!==H.DIV&&i!==H.P&&t._isSpecialElement(t.openElements.items[n],i))break}t.openElements.hasInButtonScope(H.P)&&t._closePElement(),t._insertElement(e,Ut.HTML)}function r1r(t,e){t.openElements.hasInButtonScope(H.P)&&t._closePElement(),t._insertElement(e,Ut.HTML),t.tokenizer.state=eo.PLAINTEXT}function n1r(t,e){t.openElements.hasInScope(H.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(H.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML),t.framesetOk=!1}function i1r(t,e){const r=t.activeFormattingElements.getElementEntryInScopeWithTagName(st.A);r&&(Cce(t,e),t.openElements.remove(r.element),t.activeFormattingElements.removeEntry(r)),t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function a1r(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function s1r(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(H.NOBR)&&(Cce(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,Ut.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function o1r(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function l1r(t,e){t.treeAdapter.getDocumentMode(t.document)!==kf.QUIRKS&&t.openElements.hasInButtonScope(H.P)&&t._closePElement(),t._insertElement(e,Ut.HTML),t.framesetOk=!1,t.insertionMode=Ke.IN_TABLE}function Zqe(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,Ut.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function Jqe(t){const e=Dqe(t,cA.TYPE);return e!=null&&e.toLowerCase()===Oyr}function c1r(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,Ut.HTML),Jqe(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function u1r(t,e){t._appendElement(e,Ut.HTML),e.ackSelfClosing=!0}function h1r(t,e){t.openElements.hasInButtonScope(H.P)&&t._closePElement(),t._appendElement(e,Ut.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function d1r(t,e){e.tagName=st.IMG,e.tagID=H.IMG,Zqe(t,e)}function f1r(t,e){t._insertElement(e,Ut.HTML),t.skipNextNewLine=!0,t.tokenizer.state=eo.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=Ke.TEXT}function p1r(t,e){t.openElements.hasInButtonScope(H.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,eo.RAWTEXT)}function g1r(t,e){t.framesetOk=!1,t._switchToTextParsing(e,eo.RAWTEXT)}function eje(t,e){t._switchToTextParsing(e,eo.RAWTEXT)}function m1r(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===Ke.IN_TABLE||t.insertionMode===Ke.IN_CAPTION||t.insertionMode===Ke.IN_TABLE_BODY||t.insertionMode===Ke.IN_ROW||t.insertionMode===Ke.IN_CELL?Ke.IN_SELECT_IN_TABLE:Ke.IN_SELECT}function v1r(t,e){t.openElements.currentTagId===H.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML)}function y1r(t,e){t.openElements.hasInScope(H.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,Ut.HTML)}function b1r(t,e){t.openElements.hasInScope(H.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(H.RTC),t._insertElement(e,Ut.HTML)}function x1r(t,e){t._reconstructActiveFormattingElements(),Hqe(e),Tce(e),e.selfClosing?t._appendElement(e,Ut.MATHML):t._insertElement(e,Ut.MATHML),e.ackSelfClosing=!0}function w1r(t,e){t._reconstructActiveFormattingElements(),Wqe(e),Tce(e),e.selfClosing?t._appendElement(e,Ut.SVG):t._insertElement(e,Ut.SVG),e.ackSelfClosing=!0}function tje(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML)}function Mc(t,e){switch(e.tagID){case H.I:case H.S:case H.B:case H.U:case H.EM:case H.TT:case H.BIG:case H.CODE:case H.FONT:case H.SMALL:case H.STRIKE:case H.STRONG:{a1r(t,e);break}case H.A:{i1r(t,e);break}case H.H1:case H.H2:case H.H3:case H.H4:case H.H5:case H.H6:{Zyr(t,e);break}case H.P:case H.DL:case H.OL:case H.UL:case H.DIV:case H.DIR:case H.NAV:case H.MAIN:case H.MENU:case H.ASIDE:case H.CENTER:case H.FIGURE:case H.FOOTER:case H.HEADER:case H.HGROUP:case H.DIALOG:case H.DETAILS:case H.ADDRESS:case H.ARTICLE:case H.SEARCH:case H.SECTION:case H.SUMMARY:case H.FIELDSET:case H.BLOCKQUOTE:case H.FIGCAPTION:{Kyr(t,e);break}case H.LI:case H.DD:case H.DT:{t1r(t,e);break}case H.BR:case H.IMG:case H.WBR:case H.AREA:case H.EMBED:case H.KEYGEN:{Zqe(t,e);break}case H.HR:{h1r(t,e);break}case H.RB:case H.RTC:{y1r(t,e);break}case H.RT:case H.RP:{b1r(t,e);break}case H.PRE:case H.LISTING:{Jyr(t,e);break}case H.XMP:{p1r(t,e);break}case H.SVG:{w1r(t,e);break}case H.HTML:{qyr(t,e);break}case H.BASE:case H.LINK:case H.META:case H.STYLE:case H.TITLE:case H.SCRIPT:case H.BGSOUND:case H.BASEFONT:case H.TEMPLATE:{Pp(t,e);break}case H.BODY:{jyr(t,e);break}case H.FORM:{e1r(t,e);break}case H.NOBR:{s1r(t,e);break}case H.MATH:{x1r(t,e);break}case H.TABLE:{l1r(t,e);break}case H.INPUT:{c1r(t,e);break}case H.PARAM:case H.TRACK:case H.SOURCE:{u1r(t,e);break}case H.IMAGE:{d1r(t,e);break}case H.BUTTON:{n1r(t,e);break}case H.APPLET:case H.OBJECT:case H.MARQUEE:{o1r(t,e);break}case H.IFRAME:{g1r(t,e);break}case H.SELECT:{m1r(t,e);break}case H.OPTION:case H.OPTGROUP:{v1r(t,e);break}case H.NOEMBED:case H.NOFRAMES:{eje(t,e);break}case H.FRAMESET:{Xyr(t,e);break}case H.TEXTAREA:{f1r(t,e);break}case H.NOSCRIPT:{t.options.scriptingEnabled?eje(t,e):tje(t,e);break}case H.PLAINTEXT:{r1r(t,e);break}case H.COL:case H.TH:case H.TD:case H.TR:case H.HEAD:case H.FRAME:case H.TBODY:case H.TFOOT:case H.THEAD:case H.CAPTION:case H.COLGROUP:break;default:tje(t,e)}}function A1r(t,e){if(t.openElements.hasInScope(H.BODY)&&(t.insertionMode=Ke.AFTER_BODY,t.options.sourceCodeLocationInfo)){const r=t.openElements.tryPeekProperlyNestedBodyElement();r&&t._setEndLocation(r,e)}}function S1r(t,e){t.openElements.hasInScope(H.BODY)&&(t.insertionMode=Ke.AFTER_BODY,hje(t,e))}function T1r(t,e){const r=e.tagID;t.openElements.hasInScope(r)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(r))}function C1r(t){const e=t.openElements.tmplCount>0,{formElement:r}=t;e||(t.formElement=null),(r||e)&&t.openElements.hasInScope(H.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(H.FORM):r&&t.openElements.remove(r))}function O1r(t){t.openElements.hasInButtonScope(H.P)||t._insertFakeElement(st.P,H.P),t._closePElement()}function k1r(t){t.openElements.hasInListItemScope(H.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(H.LI),t.openElements.popUntilTagNamePopped(H.LI))}function E1r(t,e){const r=e.tagID;t.openElements.hasInScope(r)&&(t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.popUntilTagNamePopped(r))}function _1r(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function R1r(t,e){const r=e.tagID;t.openElements.hasInScope(r)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(r),t.activeFormattingElements.clearToLastMarker())}function D1r(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(st.BR,H.BR),t.openElements.pop(),t.framesetOk=!1}function rje(t,e){const r=e.tagName,n=e.tagID;for(let i=t.openElements.stackTop;i>0;i--){const a=t.openElements.items[i],s=t.openElements.tagIDs[i];if(n===s&&(n!==H.UNKNOWN||t.treeAdapter.getTagName(a)===r)){t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.stackTop>=i&&t.openElements.shortenToLength(i);break}if(t._isSpecialElement(a,s))break}}function yQ(t,e){switch(e.tagID){case H.A:case H.B:case H.I:case H.S:case H.U:case H.EM:case H.TT:case H.BIG:case H.CODE:case H.FONT:case H.NOBR:case H.SMALL:case H.STRIKE:case H.STRONG:{Cce(t,e);break}case H.P:{O1r(t);break}case H.DL:case H.UL:case H.OL:case H.DIR:case H.DIV:case H.NAV:case H.PRE:case H.MAIN:case H.MENU:case H.ASIDE:case H.BUTTON:case H.CENTER:case H.FIGURE:case H.FOOTER:case H.HEADER:case H.HGROUP:case H.DIALOG:case H.ADDRESS:case H.ARTICLE:case H.DETAILS:case H.SEARCH:case H.SECTION:case H.SUMMARY:case H.LISTING:case H.FIELDSET:case H.BLOCKQUOTE:case H.FIGCAPTION:{T1r(t,e);break}case H.LI:{k1r(t);break}case H.DD:case H.DT:{E1r(t,e);break}case H.H1:case H.H2:case H.H3:case H.H4:case H.H5:case H.H6:{_1r(t);break}case H.BR:{D1r(t);break}case H.BODY:{A1r(t,e);break}case H.HTML:{S1r(t,e);break}case H.FORM:{C1r(t);break}case H.APPLET:case H.OBJECT:case H.MARQUEE:{R1r(t,e);break}case H.TEMPLATE:{uA(t,e);break}default:rje(t,e)}}function nje(t,e){t.tmplInsertionModeStack.length>0?uje(t,e):kce(t,e)}function L1r(t,e){var r;e.tagID===H.SCRIPT&&((r=t.scriptHandler)===null||r===void 0||r.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function M1r(t,e){t._err(e,yt.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function Ece(t,e){if(t.openElements.currentTagId!==void 0&&Yqe.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=Ke.IN_TABLE_TEXT,e.type){case ri.CHARACTER:{aje(t,e);break}case ri.WHITESPACE_CHARACTER:{ije(t,e);break}}else U6(t,e)}function I1r(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_CAPTION}function P1r(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_COLUMN_GROUP}function N1r(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(st.COLGROUP,H.COLGROUP),t.insertionMode=Ke.IN_COLUMN_GROUP,_ce(t,e)}function B1r(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_TABLE_BODY}function $1r(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(st.TBODY,H.TBODY),t.insertionMode=Ke.IN_TABLE_BODY,xQ(t,e)}function F1r(t,e){t.openElements.hasInTableScope(H.TABLE)&&(t.openElements.popUntilTagNamePopped(H.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function z1r(t,e){Jqe(e)?t._appendElement(e,Ut.HTML):U6(t,e),e.ackSelfClosing=!0}function U1r(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,Ut.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function xE(t,e){switch(e.tagID){case H.TD:case H.TH:case H.TR:{$1r(t,e);break}case H.STYLE:case H.SCRIPT:case H.TEMPLATE:{Pp(t,e);break}case H.COL:{N1r(t,e);break}case H.FORM:{U1r(t,e);break}case H.TABLE:{F1r(t,e);break}case H.TBODY:case H.TFOOT:case H.THEAD:{B1r(t,e);break}case H.INPUT:{z1r(t,e);break}case H.CAPTION:{I1r(t,e);break}case H.COLGROUP:{P1r(t,e);break}default:U6(t,e)}}function z6(t,e){switch(e.tagID){case H.TABLE:{t.openElements.hasInTableScope(H.TABLE)&&(t.openElements.popUntilTagNamePopped(H.TABLE),t._resetInsertionMode());break}case H.TEMPLATE:{uA(t,e);break}case H.BODY:case H.CAPTION:case H.COL:case H.COLGROUP:case H.HTML:case H.TBODY:case H.TD:case H.TFOOT:case H.TH:case H.THEAD:case H.TR:break;default:U6(t,e)}}function U6(t,e){const r=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,vQ(t,e),t.fosterParentingEnabled=r}function ije(t,e){t.pendingCharacterTokens.push(e)}function aje(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function V6(t,e){let r=0;if(t.hasNonWhitespacePendingCharacterToken)for(;r0&&t.openElements.currentTagId===H.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===H.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===H.OPTGROUP&&t.openElements.pop();break}case H.OPTION:{t.openElements.currentTagId===H.OPTION&&t.openElements.pop();break}case H.SELECT:{t.openElements.hasInSelectScope(H.SELECT)&&(t.openElements.popUntilTagNamePopped(H.SELECT),t._resetInsertionMode());break}case H.TEMPLATE:{uA(t,e);break}}}function Y1r(t,e){const r=e.tagID;r===H.CAPTION||r===H.TABLE||r===H.TBODY||r===H.TFOOT||r===H.THEAD||r===H.TR||r===H.TD||r===H.TH?(t.openElements.popUntilTagNamePopped(H.SELECT),t._resetInsertionMode(),t._processStartTag(e)):lje(t,e)}function q1r(t,e){const r=e.tagID;r===H.CAPTION||r===H.TABLE||r===H.TBODY||r===H.TFOOT||r===H.THEAD||r===H.TR||r===H.TD||r===H.TH?t.openElements.hasInTableScope(r)&&(t.openElements.popUntilTagNamePopped(H.SELECT),t._resetInsertionMode(),t.onEndTag(e)):cje(t,e)}function j1r(t,e){switch(e.tagID){case H.BASE:case H.BASEFONT:case H.BGSOUND:case H.LINK:case H.META:case H.NOFRAMES:case H.SCRIPT:case H.STYLE:case H.TEMPLATE:case H.TITLE:{Pp(t,e);break}case H.CAPTION:case H.COLGROUP:case H.TBODY:case H.TFOOT:case H.THEAD:{t.tmplInsertionModeStack[0]=Ke.IN_TABLE,t.insertionMode=Ke.IN_TABLE,xE(t,e);break}case H.COL:{t.tmplInsertionModeStack[0]=Ke.IN_COLUMN_GROUP,t.insertionMode=Ke.IN_COLUMN_GROUP,_ce(t,e);break}case H.TR:{t.tmplInsertionModeStack[0]=Ke.IN_TABLE_BODY,t.insertionMode=Ke.IN_TABLE_BODY,xQ(t,e);break}case H.TD:case H.TH:{t.tmplInsertionModeStack[0]=Ke.IN_ROW,t.insertionMode=Ke.IN_ROW,wQ(t,e);break}default:t.tmplInsertionModeStack[0]=Ke.IN_BODY,t.insertionMode=Ke.IN_BODY,Mc(t,e)}}function X1r(t,e){e.tagID===H.TEMPLATE&&uA(t,e)}function uje(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(H.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):kce(t,e)}function K1r(t,e){e.tagID===H.HTML?Mc(t,e):AQ(t,e)}function hje(t,e){var r;if(e.tagID===H.HTML){if(t.fragmentContext||(t.insertionMode=Ke.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===H.HTML){t._setEndLocation(t.openElements.items[0],e);const n=t.openElements.items[1];n&&!(!((r=t.treeAdapter.getNodeSourceCodeLocation(n))===null||r===void 0)&&r.endTag)&&t._setEndLocation(n,e)}}else AQ(t,e)}function AQ(t,e){t.insertionMode=Ke.IN_BODY,vQ(t,e)}function Z1r(t,e){switch(e.tagID){case H.HTML:{Mc(t,e);break}case H.FRAMESET:{t._insertElement(e,Ut.HTML);break}case H.FRAME:{t._appendElement(e,Ut.HTML),e.ackSelfClosing=!0;break}case H.NOFRAMES:{Pp(t,e);break}}}function J1r(t,e){e.tagID===H.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==H.FRAMESET&&(t.insertionMode=Ke.AFTER_FRAMESET))}function ebr(t,e){switch(e.tagID){case H.HTML:{Mc(t,e);break}case H.NOFRAMES:{Pp(t,e);break}}}function tbr(t,e){e.tagID===H.HTML&&(t.insertionMode=Ke.AFTER_AFTER_FRAMESET)}function rbr(t,e){e.tagID===H.HTML?Mc(t,e):SQ(t,e)}function SQ(t,e){t.insertionMode=Ke.IN_BODY,vQ(t,e)}function nbr(t,e){switch(e.tagID){case H.HTML:{Mc(t,e);break}case H.NOFRAMES:{Pp(t,e);break}}}function ibr(t,e){e.chars=hs,t._insertCharacters(e)}function abr(t,e){t._insertCharacters(e),t.framesetOk=!1}function dje(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==Ut.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function sbr(t,e){if(wyr(e))dje(t),t._startTagOutsideForeignContent(e);else{const r=t._getAdjustedCurrentElement(),n=t.treeAdapter.getNamespaceURI(r);n===Ut.MATHML?Hqe(e):n===Ut.SVG&&(Ayr(e),Wqe(e)),Tce(e),e.selfClosing?t._appendElement(e,n):t._insertElement(e,n),e.ackSelfClosing=!0}}function obr(t,e){if(e.tagID===H.P||e.tagID===H.BR){dje(t),t._endTagOutsideForeignContent(e);return}for(let r=t.openElements.stackTop;r>0;r--){const n=t.openElements.items[r];if(t.treeAdapter.getNamespaceURI(n)===Ut.HTML){t._endTagOutsideForeignContent(e);break}const i=t.treeAdapter.getTagName(n);if(i.toLowerCase()===e.tagName){e.tagName=i,t.openElements.shortenToLength(r);break}}}st.AREA,st.BASE,st.BASEFONT,st.BGSOUND,st.BR,st.COL,st.EMBED,st.FRAME,st.HR,st.IMG,st.INPUT,st.KEYGEN,st.LINK,st.META,st.PARAM,st.SOURCE,st.TRACK,st.WBR;const lbr=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,cbr=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),fje={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function pje(t,e){const r=bbr(t),n=KWe("type",{handlers:{root:ubr,element:hbr,text:dbr,comment:mje,doctype:fbr,raw:gbr},unknown:mbr}),i={parser:r?new jqe(fje):jqe.getFragmentParser(void 0,fje),handle(o){n(o,i)},stitches:!1,options:e||{}};n(t,i),wE(i,Kg());const a=r?i.parser.document:i.parser.getFragment(),s=xvr(a,{file:i.options.file});return i.stitches&&k6(s,"comment",function(o,l,u){const h=o;if(h.value.stitch&&u&&l!==void 0){const d=u.children;return d[l]=h.value.stitch,l}}),s.type==="root"&&s.children.length===1&&s.children[0].type===t.type?s.children[0]:s}function gje(t,e){let r=-1;if(t)for(;++r4&&(e.parser.tokenizer.state=0);const r={type:ri.CHARACTER,chars:t.value,location:Q6(t)};wE(e,Kg(t)),e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken)}function fbr(t,e){const r={type:ri.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Q6(t)};wE(e,Kg(t)),e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken)}function pbr(t,e){e.stitches=!0;const r=xbr(t);if("children"in t&&"children"in r){const n=pje({type:"root",children:t.children},e.options);r.children=n.children}mje({type:"comment",value:{stitch:r}},e)}function mje(t,e){const r=t.value,n={type:ri.COMMENT,data:r,location:Q6(t)};wE(e,Kg(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function gbr(t,e){if(e.parser.tokenizer.preprocessor.html="",e.parser.tokenizer.preprocessor.pos=-1,e.parser.tokenizer.preprocessor.lastGapPos=-2,e.parser.tokenizer.preprocessor.gapStack=[],e.parser.tokenizer.preprocessor.skipNextNewLine=!1,e.parser.tokenizer.preprocessor.lastChunkWritten=!1,e.parser.tokenizer.preprocessor.endOfChunkHit=!1,e.parser.tokenizer.preprocessor.isEol=!1,vje(e,Kg(t)),e.parser.tokenizer.write(e.options.tagfilter?t.value.replace(lbr,"<$1$2"):t.value,!1),e.parser.tokenizer._runParsingLoop(),e.parser.tokenizer.state===72||e.parser.tokenizer.state===78){e.parser.tokenizer.preprocessor.lastChunkWritten=!0;const r=e.parser.tokenizer._consume();e.parser.tokenizer._callState(r)}}function mbr(t,e){const r=t;if(e.options.passThrough&&e.options.passThrough.includes(r.type))pbr(r,e);else{let n="";throw cbr.has(r.type)&&(n=". 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 `"+r.type+"` node"+n)}}function wE(t,e){vje(t,e);const r=t.parser.tokenizer.currentCharacterToken;r&&r.location&&(r.location.endLine=t.parser.tokenizer.preprocessor.line,r.location.endCol=t.parser.tokenizer.preprocessor.col+1,r.location.endOffset=t.parser.tokenizer.preprocessor.offset+1,t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)),t.parser.tokenizer.paused=!1,t.parser.tokenizer.inLoop=!1,t.parser.tokenizer.active=!1,t.parser.tokenizer.returnState=eo.DATA,t.parser.tokenizer.charRefCode=-1,t.parser.tokenizer.consumedAfterSnapshot=-1,t.parser.tokenizer.currentLocation=null,t.parser.tokenizer.currentCharacterToken=null,t.parser.tokenizer.currentToken=null,t.parser.tokenizer.currentAttr={name:"",value:""}}function vje(t,e){if(e&&e.offset!==void 0){const r={startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:-1,endCol:-1,endOffset:-1};t.parser.tokenizer.preprocessor.lineStartPos=-e.column+1,t.parser.tokenizer.preprocessor.droppedBufferSize=e.offset,t.parser.tokenizer.preprocessor.line=e.line,t.parser.tokenizer.currentLocation=r}}function vbr(t,e){const r=t.tagName.toLowerCase();if(e.parser.tokenizer.state===eo.PLAINTEXT)return;wE(e,Kg(t));const n=e.parser.openElements.current;let i="namespaceURI"in n?n.namespaceURI:lA.html;i===lA.html&&r==="svg"&&(i=lA.svg);const a=Cvr({...t,children:[]},{space:i===lA.svg?"svg":"html"}),s={type:ri.START_TAG,tagName:r,tagID:bE(r),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:Q6(t)};e.parser.currentToken=s,e.parser._processToken(e.parser.currentToken),e.parser.tokenizer.lastStartTagName=r}function ybr(t,e){const r=t.tagName.toLowerCase();if(!e.parser.tokenizer.inForeignNode&&Mvr.includes(r)||e.parser.tokenizer.state===eo.PLAINTEXT)return;wE(e,GV(t));const n={type:ri.END_TAG,tagName:r,tagID:bE(r),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Q6(t)};e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken),r===e.parser.tokenizer.lastStartTagName&&(e.parser.tokenizer.state===eo.RCDATA||e.parser.tokenizer.state===eo.RAWTEXT||e.parser.tokenizer.state===eo.SCRIPT_DATA)&&(e.parser.tokenizer.state=eo.DATA)}function bbr(t){const e=t.type==="root"?t.children[0]:t;return!!(e&&(e.type==="doctype"||e.type==="element"&&e.tagName.toLowerCase()==="html"))}function Q6(t){const e=Kg(t)||{line:void 0,column:void 0,offset:void 0},r=GV(t)||{line:void 0,column:void 0,offset:void 0};return{startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:r.line,endCol:r.column,endOffset:r.offset}}function xbr(t){return"children"in t?hE({...t,children:[]}):hE(t)}function wbr(t){return function(e,r){return pje(e,{...t,file:r})}}var Abr=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,Sbr=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,Tbr=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,Dce={Space_Separator:Abr,ID_Start:Sbr,ID_Continue:Tbr},to={isSpaceSeparator(t){return typeof t=="string"&&Dce.Space_Separator.test(t)},isIdStartChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t==="$"||t==="_"||Dce.ID_Start.test(t))},isIdContinueChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t>="0"&&t<="9"||t==="$"||t==="_"||t==="‌"||t==="‍"||Dce.ID_Continue.test(t))},isDigit(t){return typeof t=="string"&&/[0-9]/.test(t)},isHexDigit(t){return typeof t=="string"&&/[0-9A-Fa-f]/.test(t)}};let Lce,mu,Nv,TQ,Wb,Np,ml,Mce,G6;var Cbr=function(e,r){Lce=String(e),mu="start",Nv=[],TQ=0,Wb=1,Np=0,ml=void 0,Mce=void 0,G6=void 0;do ml=Obr(),_br[mu]();while(ml.type!=="eof");return typeof r=="function"?Ice({"":G6},"",r):G6};function Ice(t,e,r){const n=t[e];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let i=0;i0;){const r=$v();if(!to.isHexDigit(r))throw ja(It());t+=It()}return String.fromCodePoint(parseInt(t,16))}const _br={start(){if(ml.type==="eof")throw dA();Nce()},beforePropertyName(){switch(ml.type){case"identifier":case"string":Mce=ml.value,mu="afterPropertyName";return;case"punctuator":CQ();return;case"eof":throw dA()}},afterPropertyName(){if(ml.type==="eof")throw dA();mu="beforePropertyValue"},beforePropertyValue(){if(ml.type==="eof")throw dA();Nce()},beforeArrayValue(){if(ml.type==="eof")throw dA();if(ml.type==="punctuator"&&ml.value==="]"){CQ();return}Nce()},afterPropertyValue(){if(ml.type==="eof")throw dA();switch(ml.value){case",":mu="beforePropertyName";return;case"}":CQ()}},afterArrayValue(){if(ml.type==="eof")throw dA();switch(ml.value){case",":mu="beforeArrayValue";return;case"]":CQ()}},end(){}};function Nce(){let t;switch(ml.type){case"punctuator":switch(ml.value){case"{":t={};break;case"[":t=[];break}break;case"null":case"boolean":case"numeric":case"string":t=ml.value;break}if(G6===void 0)G6=t;else{const e=Nv[Nv.length-1];Array.isArray(e)?e.push(t):Object.defineProperty(e,Mce,{value:t,writable:!0,enumerable:!0,configurable:!0})}if(t!==null&&typeof t=="object")Nv.push(t),Array.isArray(t)?mu="beforeArrayValue":mu="beforePropertyName";else{const e=Nv[Nv.length-1];e==null?mu="end":Array.isArray(e)?mu="afterArrayValue":mu="afterPropertyValue"}}function CQ(){Nv.pop();const t=Nv[Nv.length-1];t==null?mu="end":Array.isArray(t)?mu="afterArrayValue":mu="afterPropertyValue"}function ja(t){return OQ(t===void 0?`JSON5: invalid end of input at ${Wb}:${Np}`:`JSON5: invalid character '${xje(t)}' at ${Wb}:${Np}`)}function dA(){return OQ(`JSON5: invalid end of input at ${Wb}:${Np}`)}function bje(){return Np-=5,OQ(`JSON5: invalid identifier character at ${Wb}:${Np}`)}function Rbr(t){console.warn(`JSON5: '${xje(t)}' in strings is not valid ECMAScript; consider escaping`)}function xje(t){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[t])return e[t];if(t<" "){const r=t.charCodeAt(0).toString(16);return"\\x"+("00"+r).substring(r.length)}return t}function OQ(t){const e=new SyntaxError(t);return e.lineNumber=Wb,e.columnNumber=Np,e}var Dbr=function(e,r,n){const i=[];let a="",s,o,l="",u;if(r!=null&&typeof r=="object"&&!Array.isArray(r)&&(n=r.space,u=r.quote,r=r.replacer),typeof r=="function")o=r;else if(Array.isArray(r)){s=[];for(const m of r){let v;typeof m=="string"?v=m:(typeof m=="number"||m instanceof String||m instanceof Number)&&(v=String(m)),v!==void 0&&s.indexOf(v)<0&&s.push(v)}}return n instanceof Number?n=Number(n):n instanceof String&&(n=String(n)),typeof n=="number"?n>0&&(n=Math.min(10,Math.floor(n)),l=" ".substr(0,n)):typeof n=="string"&&(l=n.substr(0,10)),h("",{"":e});function h(m,v){let y=v[m];switch(y!=null&&(typeof y.toJSON5=="function"?y=y.toJSON5(m):typeof y.toJSON=="function"&&(y=y.toJSON(m))),o&&(y=o.call(v,m,y)),y instanceof Number?y=Number(y):y instanceof String?y=String(y):y instanceof Boolean&&(y=y.valueOf()),y){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof y=="string")return d(y);if(typeof y=="number")return String(y);if(typeof y=="object")return Array.isArray(y)?g(y):f(y)}function d(m){const v={"'":.1,'"':.2},y={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let b="";for(let w=0;wv[w]=0)throw TypeError("Converting circular structure to JSON5");i.push(m);let v=a;a=a+l;let y=s||Object.keys(m),b=[];for(const w of y){const A=h(w,m);if(A!==void 0){let T=p(w)+":";l!==""&&(T+=" "),T+=A,b.push(T)}}let x;if(b.length===0)x="{}";else{let w;if(l==="")w=b.join(","),x="{"+w+"}";else{let A=`, +`&&It(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw ja(It());case void 0:throw ja(It())}return It()}function Ebr(){let t="",e=$v();if(!to.isHexDigit(e)||(t+=It(),e=$v(),!to.isHexDigit(e)))throw ja(It());return t+=It(),String.fromCodePoint(parseInt(t,16))}function Pce(){let t="",e=4;for(;e-- >0;){const r=$v();if(!to.isHexDigit(r))throw ja(It());t+=It()}return String.fromCodePoint(parseInt(t,16))}const _br={start(){if(ml.type==="eof")throw dA();Nce()},beforePropertyName(){switch(ml.type){case"identifier":case"string":Mce=ml.value,mu="afterPropertyName";return;case"punctuator":CQ();return;case"eof":throw dA()}},afterPropertyName(){if(ml.type==="eof")throw dA();mu="beforePropertyValue"},beforePropertyValue(){if(ml.type==="eof")throw dA();Nce()},beforeArrayValue(){if(ml.type==="eof")throw dA();if(ml.type==="punctuator"&&ml.value==="]"){CQ();return}Nce()},afterPropertyValue(){if(ml.type==="eof")throw dA();switch(ml.value){case",":mu="beforePropertyName";return;case"}":CQ()}},afterArrayValue(){if(ml.type==="eof")throw dA();switch(ml.value){case",":mu="beforeArrayValue";return;case"]":CQ()}},end(){}};function Nce(){let t;switch(ml.type){case"punctuator":switch(ml.value){case"{":t={};break;case"[":t=[];break}break;case"null":case"boolean":case"numeric":case"string":t=ml.value;break}if(G6===void 0)G6=t;else{const e=Nv[Nv.length-1];Array.isArray(e)?e.push(t):Object.defineProperty(e,Mce,{value:t,writable:!0,enumerable:!0,configurable:!0})}if(t!==null&&typeof t=="object")Nv.push(t),Array.isArray(t)?mu="beforeArrayValue":mu="beforePropertyName";else{const e=Nv[Nv.length-1];e==null?mu="end":Array.isArray(e)?mu="afterArrayValue":mu="afterPropertyValue"}}function CQ(){Nv.pop();const t=Nv[Nv.length-1];t==null?mu="end":Array.isArray(t)?mu="afterArrayValue":mu="afterPropertyValue"}function ja(t){return OQ(t===void 0?`JSON5: invalid end of input at ${Wb}:${Np}`:`JSON5: invalid character '${xje(t)}' at ${Wb}:${Np}`)}function dA(){return OQ(`JSON5: invalid end of input at ${Wb}:${Np}`)}function bje(){return Np-=5,OQ(`JSON5: invalid identifier character at ${Wb}:${Np}`)}function Rbr(t){console.warn(`JSON5: '${xje(t)}' in strings is not valid ECMAScript; consider escaping`)}function xje(t){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[t])return e[t];if(t<" "){const r=t.charCodeAt(0).toString(16);return"\\x"+("00"+r).substring(r.length)}return t}function OQ(t){const e=new SyntaxError(t);return e.lineNumber=Wb,e.columnNumber=Np,e}var Dbr=function(e,r,n){const i=[];let a="",s,o,l="",u;if(r!=null&&typeof r=="object"&&!Array.isArray(r)&&(n=r.space,u=r.quote,r=r.replacer),typeof r=="function")o=r;else if(Array.isArray(r)){s=[];for(const m of r){let v;typeof m=="string"?v=m:(typeof m=="number"||m instanceof String||m instanceof Number)&&(v=String(m)),v!==void 0&&s.indexOf(v)<0&&s.push(v)}}return n instanceof Number?n=Number(n):n instanceof String&&(n=String(n)),typeof n=="number"?n>0&&(n=Math.min(10,Math.floor(n)),l=" ".substr(0,n)):typeof n=="string"&&(l=n.substr(0,10)),h("",{"":e});function h(m,v){let y=v[m];switch(y!=null&&(typeof y.toJSON5=="function"?y=y.toJSON5(m):typeof y.toJSON=="function"&&(y=y.toJSON(m))),o&&(y=o.call(v,m,y)),y instanceof Number?y=Number(y):y instanceof String?y=String(y):y instanceof Boolean&&(y=y.valueOf()),y){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof y=="string")return d(y);if(typeof y=="number")return String(y);if(typeof y=="object")return Array.isArray(y)?g(y):f(y)}function d(m){const v={"'":.1,'"':.2},y={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let b="";for(let w=0;wv[w]=0)throw TypeError("Converting circular structure to JSON5");i.push(m);let v=a;a=a+l;let y=s||Object.keys(m),b=[];for(const w of y){const A=h(w,m);if(A!==void 0){let S=p(w)+":";l!==""&&(S+=" "),S+=A,b.push(S)}}let x;if(b.length===0)x="{}";else{let w;if(l==="")w=b.join(","),x="{"+w+"}";else{let A=`, `+a;w=b.join(A),x=`{ `+a+w+`, `+v+"}"}}return i.pop(),a=v,x}function p(m){if(m.length===0)return d(m);const v=String.fromCodePoint(m.codePointAt(0));if(!to.isIdStartChar(v))return d(m);for(let y=v.length;y=0)throw TypeError("Converting circular structure to JSON5");i.push(m);let v=a;a=a+l;let y=[];for(let x=0;x30)throw new Error("ECharts option nesting is too deep");if(typeof t=="number"&&!Number.isFinite(t))throw new Error("ECharts option contains a non-finite number");if(typeof t=="string"&&Ibr.test(t.trim()))throw new Error("ECharts option contains an external resource");if(Array.isArray(t)){for(const r of t)kQ(r,e+1);return}if(W6(t))for(const[r,n]of Object.entries(t)){if(Mbr.has(r))throw new Error("ECharts option contains an unsafe key");kQ(n,e+1)}}function Pbr(t){var n;const e=t.trim(),r=e.match(/^(?:(?:const|let|var)\s+)?option\s*=\s*([\s\S]*?)\s*;?$/);return((n=r==null?void 0:r[1])==null?void 0:n.trim())||e}function Nbr(t,e){let r=1,n="",i=!1,a=!1,s=!1;for(let o=e+1;on+2)throw new Error("Invalid ECharts gradient argument count");const i=r.slice(0,n).map(Bbr),a=r[n],s=r[n+1]??!1;if(!Array.isArray(a)||typeof s!="boolean")throw new Error("Invalid ECharts gradient data");return t==="linear"?{type:t,x:i[0],y:i[1],x2:i[2],y2:i[3],colorStops:a,global:s}:{type:t,x:i[0],y:i[1],r:i[2],colorStops:a,global:s}}function Fbr(t,e){const r=/^(?:new\s+)?echarts\.graphic\.(LinearGradient|RadialGradient)\s*\(/;let n="",i=!1,a=!1,s=!1;for(let o=e;oLbr)throw new Error("ECharts option is too large");const r=zbr(Pbr(t));let n;try{n=wje.parse(r)}catch(s){throw/\bfunction\s*\(|=>/.test(r)?new Error("ECharts function callbacks are not supported"):s}if(!W6(n))throw new Error("ECharts option must be a data object");kQ(n);const i={...n};i.aria={...W6(i.aria)?i.aria:{},enabled:!0};const a=i.tooltip;return W6(a)?i.tooltip={...a,renderMode:"richText"}:Array.isArray(a)&&(i.tooltip=a.map(s=>W6(s)?{...s,renderMode:"richText"}:s)),e&&(i.animation=!1),i}function Yb({as:t="span",className:e="",duration:r=4,spread:n=20,children:i,style:a,...s}){const o=Math.min(Math.max(n,5),45);return W.jsx(t,{className:`text-shimmer${e?` ${e}`:""}`,style:{...a,backgroundImage:`linear-gradient(to right, hsl(var(--muted-foreground)) ${50-o}%, hsl(var(--foreground)) 50%, hsl(var(--muted-foreground)) ${50+o}%)`,animationDuration:`${r}s`},...s,children:i})}let Bce;function Vbr(){return Bce??(Bce=Promise.resolve().then(()=>JGr).catch(t=>{throw Bce=void 0,t})),Bce}function Qbr({source:t}){const{t:e}=Ea("conversation"),r=se.useRef(null),[n,i]=se.useState(!1),[a,s]=se.useState("");return se.useEffect(()=>{let o=!1,l,u,h;i(!1);try{h=Ubr(t,window.matchMedia("(prefers-reduced-motion: reduce)").matches),s("")}catch{s("invalid");return}return Vbr().then(d=>{const f=r.current;o||!f||(l=d.init(f,void 0,{renderer:"svg"}),l.setOption(h,{notMerge:!0}),typeof ResizeObserver<"u"&&(u=new ResizeObserver(()=>l==null?void 0:l.resize()),u.observe(f)),i(!0))}).catch(()=>{l==null||l.dispose(),l=void 0,o||s("render")}),()=>{o=!0,u==null||u.disconnect(),l==null||l.dispose()}},[t]),W.jsxs("div",{className:`echarts-diagram${a?" echarts-diagram--error":""}`,role:"img","aria-label":e("visualization.echartsAria"),"aria-busy":!n&&!a,children:[W.jsx("div",{ref:r,className:"echarts-diagram__canvas",hidden:!!a}),!n&&!a?W.jsx("div",{className:"echarts-diagram__state","aria-live":"polite",children:W.jsx(Yb,{duration:2.2,spread:15,children:e("visualization.rendering")})}):null,a?W.jsx("p",{className:"echarts-diagram__error",role:"alert",children:e(a==="invalid"?"visualization.invalidEcharts":"visualization.renderFailed")}):null]})}const Gbr=se.memo(Qbr);let Aje,Tje=Promise.resolve(),Hbr=0;function Wbr(){return Aje??(Aje=Promise.resolve().then(()=>uon).then(({default:t})=>(t.initialize({startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,theme:"neutral"}),t))),Aje}function Ybr(t){const e=Tje.then(async()=>{const r=await Wbr(),n=`mermaid-diagram-${Hbr+=1}`;return r.render(n,t)});return Tje=e.then(()=>{},()=>{}),e}function qbr({source:t}){const{t:e}=Ea("conversation"),r=se.useRef(null),[n,i]=se.useState(null),[a,s]=se.useState(!1);return se.useEffect(()=>{let o=!1;return i(null),s(!1),Ybr(t).then(l=>{o||i(l)}).catch(()=>{o||s(!0)}),()=>{o=!0}},[t]),se.useEffect(()=>{!(n!=null&&n.bindFunctions)||!r.current||n.bindFunctions(r.current)},[n]),a?W.jsx("div",{className:"mermaid-diagram mermaid-diagram--error",children:W.jsx("p",{className:"mermaid-diagram__error",role:"alert",children:e("visualization.mermaidFailed")})}):n?W.jsx("div",{ref:r,className:"mermaid-diagram",role:"img","aria-label":e("visualization.mermaidAria"),dangerouslySetInnerHTML:{__html:n.svg}}):W.jsx("div",{className:"mermaid-diagram mermaid-diagram--loading","aria-live":"polite",children:W.jsx(Yb,{duration:2.2,spread:15,children:e("visualization.rendering")})})}const jbr=se.memo(qbr);function Sje(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;eXbr(t,"name",{value:e,configurable:!0});function Fce(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}$ce(Fce,"setRef");function Cje(...t){return e=>{let r=!1;const n=t.map(i=>{const a=Fce(i,e);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let i=0;iKbr(t,"name",{value:e,configurable:!0});function fA(t){const e=se.forwardRef((r,n)=>{let{children:i,...a}=r,s=null,o=!1;const l=[];zce(i)&&typeof EQ=="function"&&(i=EQ(i._payload)),se.Children.forEach(i,f=>{var p;if(_je(f)){o=!0;const g=f;let m="child"in g.props?g.props.child:g.props.children;zce(m)&&typeof EQ=="function"&&(m=EQ(m._payload)),s=Jbr(g,m),l.push((p=s==null?void 0:s.props)==null?void 0:p.children)}else l.push(f)}),s?s=se.cloneElement(s,void 0,l):!o&&se.Children.count(i)===1&&se.isValidElement(i)&&(s=i);const u=s?Eje(s):void 0,h=Th(n,u);if(!s){if(i||i===0)throw new Error(o?rxr(t):txr(t));return i}const d=kje(a,s.props??{});return s.type!==se.Fragment&&(d.ref=n?h:u),se.cloneElement(s,d)});return e.displayName=`${t}.Slot`,e}Bp(fA,"createSlot");var Oje=Symbol.for("radix.slottable");function Zbr(t){const e=Bp(r=>"child"in r?r.children(r.child):r.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=Oje,e}Bp(Zbr,"createSlottable");var Jbr=Bp((t,e)=>{if("child"in t.props){const r=t.props.child;return se.isValidElement(r)?se.cloneElement(r,void 0,t.props.children(r.props.children)):null}return se.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function kje(t,e){const r={...e};for(const n in e){const i=t[n],a=e[n];/^on[A-Z]/.test(n)?i&&a?r[n]=(...o)=>{const l=a(...o);return i(...o),l}:i&&(r[n]=i):n==="style"?r[n]={...i,...a}:n==="className"&&(r[n]=[i,a].filter(Boolean).join(" "))}return{...t,...r}}Bp(kje,"mergeProps");function Eje(t){var n,i;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}Bp(Eje,"getElementRef");function _je(t){return se.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Oje}Bp(_je,"isSlottable");var exr=Symbol.for("react.lazy");function zce(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===exr&&"_payload"in t&&Rje(t._payload)}Bp(zce,"isLazyComponent");function Rje(t){return typeof t=="object"&&t!==null&&"then"in t}Bp(Rje,"isPromiseLike");var txr=Bp(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),rxr=Bp(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),EQ=Sw[" use ".trim().toString()],nxr=Object.defineProperty,ixr=(t,e)=>nxr(t,"name",{value:e,configurable:!0}),axr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$p=axr.reduce((t,e)=>{const r=fA(`Primitive.${e}`),n=se.forwardRef((i,a)=>{const{asChild:s,...o}=i,l=s?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),W.jsx(l,{...o,ref:a})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function Dje(t,e){t&&ak.flushSync(()=>t.dispatchEvent(e))}ixr(Dje,"dispatchDiscreteCustomEvent");var sxr=Object.defineProperty,Ef=(t,e)=>sxr(t,"name",{value:e,configurable:!0});function oxr(t,e){const r=se.createContext(e);r.displayName=t+"Context";const n=Ef(a=>{const{children:s,...o}=a,l=se.useMemo(()=>o,Object.values(o));return W.jsx(r.Provider,{value:l,children:s})},"Provider");n.displayName=t+"Provider";function i(a,s={}){const{optional:o=!1}=s,l=se.useContext(r);if(l)return l;if(e!==void 0)return e;if(!o)throw new Error(`\`${a}\` must be used within \`${t}\``)}return Ef(i,"useContext"),[n,i]}Ef(oxr,"createContext");function pA(t,e=[]){let r=[];function n(a,s){const o=se.createContext(s);o.displayName=a+"Context";const l=r.length;r=[...r,s];const u=Ef(d=>{var y;const{scope:f,children:p,...g}=d,m=((y=f==null?void 0:f[t])==null?void 0:y[l])||o,v=se.useMemo(()=>g,Object.values(g));return W.jsx(m.Provider,{value:v,children:p})},"Provider");u.displayName=a+"Provider";function h(d,f,p={}){var y;const{optional:g=!1}=p,m=((y=f==null?void 0:f[t])==null?void 0:y[l])||o,v=se.useContext(m);if(v)return v;if(s!==void 0)return s;if(!g)throw new Error(`\`${d}\` must be used within \`${a}\``)}return Ef(h,"useContext"),[u,h]}Ef(n,"createContext");const i=Ef(()=>{const a=r.map(s=>se.createContext(s));return Ef(function(o){const l=(o==null?void 0:o[t])||a;return se.useMemo(()=>({[`__scope${t}`]:{...o,[t]:l}}),[o,l])},"useScope")},"createScope");return i.scopeName=t,[n,Lje(i,...e)]}Ef(pA,"createContextScope");function Lje(...t){const e=t[0];if(t.length===1)return e;const r=Ef(()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return Ef(function(a){const s=n.reduce((o,{useScope:l,scopeName:u})=>{const d=l(a)[`__scope${u}`];return{...o,...d}},{});return se.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])},"useComposedScopes")},"createScope");return r.scopeName=e.scopeName,r}Ef(Lje,"composeContextScopes");var lxr=Object.defineProperty,vl=(t,e)=>lxr(t,"name",{value:e,configurable:!0});function Mje(t){const e=t+"CollectionProvider",[r,n]=pA(e),[i,a]=r(e,{collectionRef:{current:null},itemMap:new Map}),s=vl(m=>{const{scope:v,children:y}=m,b=se.useRef(null),x=se.useRef(new Map).current;return W.jsx(i,{scope:v,itemMap:x,collectionRef:b,children:y})},"CollectionProvider");s.displayName=e;const o=t+"CollectionSlot",l=fA(o),u=se.forwardRef((m,v)=>{const{scope:y,children:b}=m,x=a(o,y),w=Th(v,x.collectionRef);return W.jsx(l,{ref:w,children:b})});u.displayName=o;const h=t+"CollectionItemSlot",d="data-radix-collection-item",f=fA(h),p=se.forwardRef((m,v)=>{const{scope:y,children:b,...x}=m,w=se.useRef(null),A=Th(v,w),T=a(h,y);return se.useEffect(()=>(T.itemMap.set(w,{ref:w,...x}),()=>void T.itemMap.delete(w))),W.jsx(f,{[d]:"",ref:A,children:b})});p.displayName=h;function g(m){const v=a(t+"CollectionConsumer",m);return se.useCallback(()=>{const b=v.collectionRef.current;if(!b)return[];const x=Array.from(b.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((T,S)=>x.indexOf(T.ref.current)-x.indexOf(S.ref.current))},[v.collectionRef,v.itemMap])}return vl(g,"useCollection"),[{Provider:s,Slot:u,ItemSlot:p},g,n]}vl(Mje,"createCollection");var Ije=new WeakMap,Uce=(df=class extends Map{constructor(r){super(r);$Zt(this,Uo);SLe(this,Uo,[...super.keys()]),Ije.set(this,!0)}set(r,n){return Ije.get(this)&&(this.has(r)?cu(this,Uo)[cu(this,Uo).indexOf(r)]=r:cu(this,Uo).push(r)),super.set(r,n),this}insert(r,n,i){const a=this.has(n),s=cu(this,Uo).length,o=Vce(r);let l=o>=0?o:s+o;const u=l<0||l>=s?-1:l;if(u===this.size||a&&u===this.size-1||u===-1)return this.set(n,i),this;const h=this.size+(a?0:1);o<0&&l++;const d=[...cu(this,Uo)];let f,p=!1;for(let g=l;g=this.size&&(a=this.size-1),this.at(a)}keyFrom(r,n){const i=this.indexOf(r);if(i===-1)return;let a=i+n;return a<0&&(a=0),a>=this.size&&(a=this.size-1),this.keyAt(a)}find(r,n){let i=0;for(const a of this){if(Reflect.apply(r,n,[a,i,this]))return a;i++}}findIndex(r,n){let i=0;for(const a of this){if(Reflect.apply(r,n,[a,i,this]))return i;i++}return-1}filter(r,n){const i=[];let a=0;for(const s of this)Reflect.apply(r,n,[s,a,this])&&i.push(s),a++;return new df(i)}map(r,n){const i=[];let a=0;for(const s of this)i.push([s[0],Reflect.apply(r,n,[s,a,this])]),a++;return new df(i)}reduce(...r){const[n,i]=r;let a=0,s=i??this.at(0);for(const o of this)a===0&&r.length===1?s=o:s=Reflect.apply(n,this,[s,o,a,this]),a++;return s}reduceRight(...r){const[n,i]=r;let a=i??this.at(-1);for(let s=this.size-1;s>=0;s--){const o=this.at(s);s===this.size-1&&r.length===1?a=o:a=Reflect.apply(n,this,[a,o,s,this])}return a}toSorted(r){const n=[...this.entries()].sort(r);return new df(n)}toReversed(){const r=new df;for(let n=this.size-1;n>=0;n--){const i=this.keyAt(n),a=this.get(i);r.set(i,a)}return r}toSpliced(...r){const n=[...this.entries()];return n.splice(...r),new df(n)}slice(r,n){const i=new df;let a=this.size-1;if(r===void 0)return i;r<0&&(r=r+this.size),n!==void 0&&n>0&&(a=n-1);for(let s=r;s<=a;s++){const o=this.keyAt(s),l=this.get(o);i.set(o,l)}return i}every(r,n){let i=0;for(const a of this){if(!Reflect.apply(r,n,[a,i,this]))return!1;i++}return!0}some(r,n){let i=0;for(const a of this){if(Reflect.apply(r,n,[a,i,this]))return!0;i++}return!1}},Uo=new WeakMap,vl(df,"OrderedDict"),df);function _Q(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const r=Pje(t,e);return r===-1?void 0:t[r]}vl(_Q,"at");function Pje(t,e){const r=t.length,n=Vce(e),i=n>=0?n:r+n;return i<0||i>=r?-1:i}vl(Pje,"toSafeIndex");function Vce(t){return t!==t||t===0?0:Math.trunc(t)}vl(Vce,"toSafeInteger");function cxr(t){const e=t+"CollectionProvider",[r,n]=pA(e),[i,a]=r(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Uce,setItemMap:vl(()=>{},"setItemMap")}),s=vl(({state:x,...w})=>x?W.jsx(l,{...w,state:x}):W.jsx(o,{...w}),"CollectionProvider");s.displayName=e;const o=vl(x=>{const w=v();return W.jsx(l,{...x,state:w})},"CollectionInit");o.displayName=e+"Init";const l=vl(x=>{const{scope:w,children:A,state:T}=x,S=se.useRef(null),[O,k]=se.useState(null),E=Th(S,k),[_,I]=T;return se.useEffect(()=>{if(!O)return;const L=$je(()=>{});return L.observe(O,{childList:!0,subtree:!0}),()=>{L.disconnect()}},[O]),W.jsx(i,{scope:w,itemMap:_,setItemMap:I,collectionRef:E,collectionRefObject:S,collectionElement:O,children:A})},"CollectionProviderImpl");l.displayName=e+"Impl";const u=t+"CollectionSlot",h=fA(u),d=se.forwardRef((x,w)=>{const{scope:A,children:T}=x,S=a(u,A),O=Th(w,S.collectionRef);return W.jsx(h,{ref:O,children:T})});d.displayName=u;const f=t+"CollectionItemSlot",p="data-radix-collection-item",g=fA(f),m=se.forwardRef((x,w)=>{const{scope:A,children:T,...S}=x,O=se.useRef(null),[k,E]=se.useState(null),_=Th(w,O,E),I=a(f,A),{setItemMap:L}=I,R=se.useRef(S);Nje(R.current,S)||(R.current=S);const D=R.current;return se.useEffect(()=>{const M=D;return L(P=>k?P.has(k)?P.set(k,{...M,element:k}).toSorted(Qce):(P.set(k,{...M,element:k}),P.toSorted(Qce)):P),()=>{L(P=>!k||!P.has(k)?P:(P.delete(k),new Uce(P)))}},[k,D,L]),W.jsx(g,{[p]:"",ref:_,children:T})});m.displayName=f;function v(){return se.useState(new Uce)}vl(v,"useInitCollection");function y(x){const{itemMap:w}=a(t+"CollectionConsumer",x);return w}return vl(y,"useCollection"),[{Provider:s,Slot:d,ItemSlot:m},{createCollectionScope:n,useCollection:y,useInitCollection:v}]}vl(cxr,"createCollection");function Nje(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t==null||e==null)return!1;const r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(const i of r)if(!Object.prototype.hasOwnProperty.call(e,i)||t[i]!==e[i])return!1;return!0}vl(Nje,"shallowEqual");function Bje(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}vl(Bje,"isElementPreceding");function Qce(t,e){return!t[1].element||!e[1].element?0:Bje(t[1].element,e[1].element)?-1:1}vl(Qce,"sortByDocumentPosition");function $je(t){return new MutationObserver(r=>{for(const n of r)if(n.type==="childList"){t();return}})}vl($je,"getChildListObserver");var uxr=Object.defineProperty,TE=(t,e)=>uxr(t,"name",{value:e,configurable:!0}),Fje=!!(typeof window<"u"&&window.document&&window.document.createElement);function vu(t,e,{checkForDefaultPrevented:r=!0}={}){return TE(function(i){if(t==null||t(i),r===!1||!i||!i.defaultPrevented)return e==null?void 0:e(i)},"handleEvent")}TE(vu,"composeEventHandlers");function hxr(t){var e;if(!Fje)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}TE(hxr,"getOwnerWindow");function Gce(t){if(!Fje)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}TE(Gce,"getOwnerDocument");function zje(t,e=!1){const{activeElement:r}=Gce(t);if(!(r!=null&&r.nodeName))return null;if(Uje(r)&&r.contentDocument)return zje(r.contentDocument.body,e);if(e){const n=r.getAttribute("aria-activedescendant");if(n){const i=Gce(r).getElementById(n);if(i)return i}}return r}TE(zje,"getActiveElement");function Uje(t){return t.tagName==="IFRAME"}TE(Uje,"isFrame");var Fp=globalThis!=null&&globalThis.document?se.useLayoutEffect:()=>{},dxr=Object.defineProperty,fxr=(t,e)=>dxr(t,"name",{value:e,configurable:!0}),Vje=Sw[" useEffectEvent ".trim().toString()],Qje=Sw[" useInsertionEffect ".trim().toString()];function Gje(t){if(typeof Vje=="function")return Vje(t);const e=se.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Qje=="function"?Qje(()=>{e.current=t}):Fp(()=>{e.current=t}),se.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}fxr(Gje,"useEffectEvent");var pxr=Object.defineProperty,Y6=(t,e)=>pxr(t,"name",{value:e,configurable:!0}),gxr=Sw[" useInsertionEffect ".trim().toString()]||Fp;function SE({prop:t,defaultProp:e,onChange:r=Y6(()=>{},"onChange"),caller:n}){const[i,a,s]=Hje({defaultProp:e,onChange:r}),o=t!==void 0,l=o?t:i,u=se.useCallback(h=>{var d;if(o){const f=Wje(h)?h(t):h;f!==t&&((d=s.current)==null||d.call(s,f))}else a(h)},[o,t,a,s]);return[l,u]}Y6(SE,"useControllableState");function Hje({defaultProp:t,onChange:e}){const[r,n]=se.useState(t),i=se.useRef(r),a=se.useRef(e);return gxr(()=>{a.current=e},[e]),se.useEffect(()=>{var s;i.current!==r&&((s=a.current)==null||s.call(a,r),i.current=r)},[r,i]),[r,n,a]}Y6(Hje,"useUncontrolledState");function Wje(t){return typeof t=="function"}Y6(Wje,"isFunction");var Yje=Symbol("RADIX:SYNC_STATE");function mxr(t,e,r,n){const{prop:i,defaultProp:a,onChange:s,caller:o}=e,l=i!==void 0,u=Gje(s),h=[{...r,state:a}];n&&h.push(n);const[d,f]=se.useReducer((v,y)=>{if(y.type===Yje)return{...v,state:y.state};const b=t(v,y);return l&&!Object.is(b.state,v.state)&&u(b.state),b},...h),p=d.state,g=se.useRef(p);se.useEffect(()=>{g.current!==p&&(g.current=p,l||u(p))},[p,g,l]);const m=se.useMemo(()=>i!==void 0?{...d,state:i}:d,[d,i]);return se.useEffect(()=>{l&&!Object.is(i,d.state)&&f({type:Yje,state:i})},[i,d.state,l]),[m,f]}Y6(mxr,"useControllableStateReducer");var vxr=Object.defineProperty,Fv=(t,e)=>vxr(t,"name",{value:e,configurable:!0});function qje(t,e){return se.useReducer((r,n)=>e[r][n]??r,t)}Fv(qje,"useStateMachine");var jje=Fv(t=>{const{present:e,children:r}=t,n=Xje(e),i=typeof r=="function"?r({present:n.isPresent}):se.Children.only(r),a=Kje(n.ref,Zje(i));return typeof r=="function"||n.isPresent?se.cloneElement(i,{ref:a}):null},"Presence");function Xje(t){const[e,r]=se.useState(),n=se.useRef(null),i=se.useRef(t),a=se.useRef("none"),s=se.useRef(void 0),o=t?"mounted":"unmounted",[l,u]=qje(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return se.useEffect(()=>{l==="mounted"?(a.current=s.current??CE(n.current),s.current=void 0):a.current="none"},[l]),Fp(()=>{const h=n.current,d=i.current;if(d!==t){const p=a.current,g=CE(h);t?(s.current=g,u("MOUNT")):g==="none"||(h==null?void 0:h.display)==="none"?u("UNMOUNT"):u(d&&p!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,u]),Fp(()=>{if(e){let h;const d=e.ownerDocument.defaultView??window,f=Fv(g=>{const v=CE(n.current).includes(CSS.escape(g.animationName));if(g.target===e&&v&&(u("ANIMATION_END"),!i.current)){const y=e.style.animationFillMode;e.style.animationFillMode="forwards",h=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=y)})}},"handleAnimationEnd"),p=Fv(g=>{g.target===e&&(a.current=CE(n.current))},"handleAnimationStart");return e.addEventListener("animationstart",p),e.addEventListener("animationcancel",f),e.addEventListener("animationend",f),()=>{d.clearTimeout(h),e.removeEventListener("animationstart",p),e.removeEventListener("animationcancel",f),e.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[e,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:se.useCallback(h=>{if(h){const d=getComputedStyle(h);n.current=d,s.current=CE(d)}else n.current=null;r(h)},[])}}Fv(Xje,"usePresence");function Hce(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Fv(Hce,"setRef");function Kje(...t){const e=se.useRef(t);return e.current=t,se.useCallback(r=>{const n=e.current;let i=!1;const a=n.map(s=>{const o=Hce(s,r);return!i&&typeof o=="function"&&(i=!0),o});if(i)return()=>{for(let s=0;syxr(t,"name",{value:e,configurable:!0}),xxr=Sw[" useId ".trim().toString()]||(()=>{}),wxr=0;function Wce(t){const[e,r]=se.useState(xxr());return Fp(()=>{t||r(n=>n??String(wxr++))},[t]),t||(e?`radix-${e}`:"")}bxr(Wce,"useId");var Axr=Object.defineProperty,Txr=(t,e)=>Axr(t,"name",{value:e,configurable:!0}),Sxr=se.createContext(void 0);function Yce(t){const e=se.useContext(Sxr);return t||e||"ltr"}Txr(Yce,"useDirection");var Cxr=Object.defineProperty,Oxr=(t,e)=>Cxr(t,"name",{value:e,configurable:!0});function qb(t){const e=se.useRef(t);return se.useEffect(()=>{e.current=t}),se.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}Oxr(qb,"useCallbackRef");var kxr=Object.defineProperty,yl=(t,e)=>kxr(t,"name",{value:e,configurable:!0}),qce="dismissableLayer.update",Exr="dismissableLayer.pointerDownOutside",_xr="dismissableLayer.focusOutside",Jje,eXe=se.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Rxr=se.forwardRef(yl(function(e,r){const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:l,onDismiss:u,...h}=e,d=se.useContext(eXe),[f,p]=se.useState(null),g=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=se.useState({}),v=Th(r,p),y=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=b?y.indexOf(b):-1,w=f?y.indexOf(f):-1,A=d.layersWithOutsidePointerEventsDisabled.size>0,T=w>=x,S=se.useRef(!1),O=tXe(I=>{s==null||s(I),l==null||l(I),I.defaultPrevented||u==null||u()},{ownerDocument:g,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:se.useCallback(I=>{if(!(I instanceof Node))return!1;const L=[...d.branches].some(R=>R.contains(I));return T&&!L},[d.branches,T])}),k=rXe(I=>{if(i&&S.current)return;const L=I.target;[...d.branches].some(D=>D.contains(L))||(o==null||o(I),l==null||l(I),I.defaultPrevented||u==null||u())},g),E=f?w===y.length-1:!1,_=qb(I=>{I.key==="Escape"&&(a==null||a(I),!I.defaultPrevented&&u&&(I.preventDefault(),u()))});return se.useEffect(()=>{if(E)return g.addEventListener("keydown",_,{capture:!0}),()=>g.removeEventListener("keydown",_,{capture:!0})},[g,E,_]),se.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Jje=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),jce(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=Jje))}},[f,g,n,d]),se.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),jce())},[f,d]),se.useEffect(()=>{const I=yl(()=>m({}),"handleUpdate");return document.addEventListener(qce,I),()=>document.removeEventListener(qce,I)},[]),W.jsx($p.div,{...h,ref:v,style:{pointerEvents:A?T?"auto":"none":void 0,...e.style},onFocusCapture:vu(e.onFocusCapture,k.onFocusCapture),onBlurCapture:vu(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:vu(e.onPointerDownCapture,O.onPointerDownCapture)})},"DismissableLayer"));function Dxr(){const t=se.useContext(eXe),[e,r]=se.useState(null);return se.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),r}yl(Dxr,"useDismissableLayerSurface");var Lxr=yl(()=>!0,"IS_TRUE");function tXe(t,e){const{ownerDocument:r=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:n=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:s=Lxr}=e,o=qb(t),l=se.useRef(!1),u=se.useRef(!1),h=se.useRef(new Map),d=se.useRef(()=>{});return se.useEffect(()=>{function f(){u.current=!1,i.current=!1,h.current.clear()}yl(f,"resetOutsideInteraction");function p(){return Array.from(h.current.values()).some(Boolean)}yl(p,"isOutsideInteractionIntercepted");function g(x){if(!u.current)return;const w=x.target;w instanceof Node&&[...a].some(T=>T.contains(w))||h.current.set(x.type,!0),x.type==="click"&&window.setTimeout(()=>{u.current&&d.current()},0)}yl(g,"handleInteractionCapture");function m(x){u.current&&h.current.set(x.type,!1)}yl(m,"handleInteractionBubble");const v=yl(x=>{if(x.target&&!l.current){let w=function(){r.removeEventListener("click",d.current);const T=p();f(),T||Xce(Exr,o,A,{discrete:!0})};if(yl(w,"handleAndDispatchPointerDownOutsideEvent"),!s(x.target)){r.removeEventListener("click",d.current),f(),l.current=!1;return}const A={originalEvent:x};u.current=!0,i.current=n&&x.button===0,h.current.clear(),!n||x.button!==0?w():(r.removeEventListener("click",d.current),d.current=w,r.addEventListener("click",d.current,{once:!0}))}else r.removeEventListener("click",d.current),f();l.current=!1},"handlePointerDown"),y=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const x of y)r.addEventListener(x,g,!0),r.addEventListener(x,m);const b=window.setTimeout(()=>{r.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(b),r.removeEventListener("pointerdown",v),r.removeEventListener("click",d.current);for(const x of y)r.removeEventListener(x,g,!0),r.removeEventListener(x,m)}},[r,o,n,i,a,s]),{onPointerDownCapture:yl(()=>l.current=!0,"onPointerDownCapture")}}yl(tXe,"usePointerDownOutside");function rXe(t,e=globalThis==null?void 0:globalThis.document){const r=qb(t),n=se.useRef(!1);return se.useEffect(()=>{const i=yl(a=>{a.target&&!n.current&&Xce(_xr,r,{originalEvent:a},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,r]),{onFocusCapture:yl(()=>n.current=!0,"onFocusCapture"),onBlurCapture:yl(()=>n.current=!1,"onBlurCapture")}}yl(rXe,"useFocusOutside");function jce(){const t=new CustomEvent(qce);document.dispatchEvent(t)}yl(jce,"dispatchUpdate");function Xce(t,e,r,{discrete:n}){const i=r.originalEvent.target,a=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?Dje(i,a):i.dispatchEvent(a)}yl(Xce,"handleAndDispatchCustomEvent");var Mxr=Object.defineProperty,yu=(t,e)=>Mxr(t,"name",{value:e,configurable:!0}),Kce="focusScope.autoFocusOnMount",Zce="focusScope.autoFocusOnUnmount",nXe={bubbles:!1,cancelable:!0},Ixr=se.forwardRef(yu(function(e,r){const{loop:n=!1,trapped:i=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...o}=e,[l,u]=se.useState(null),h=qb(a),d=qb(s),f=se.useRef(null),p=Th(r,u),g=se.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;se.useEffect(()=>{if(i){let v=function(w){if(g.paused||!l)return;const A=w.target;l.contains(A)?f.current=A:zv(f.current,{select:!0})},y=function(w){if(g.paused||!l)return;const A=w.relatedTarget;A!==null&&(l.contains(A)||zv(f.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const T of w)T.removedNodes.length>0&&zv(l)};yu(v,"handleFocusIn"),yu(y,"handleFocusOut"),yu(b,"handleMutations"),document.addEventListener("focusin",v),document.addEventListener("focusout",y);const x=new MutationObserver(b);return l&&x.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),x.disconnect()}}},[i,l,g.paused]),se.useEffect(()=>{if(l){lXe.add(g);const v=document.activeElement;if(!l.contains(v)){const b=new CustomEvent(Kce,nXe);l.addEventListener(Kce,h),l.dispatchEvent(b),b.defaultPrevented||(iXe(uXe(Jce(l)),{select:!0}),document.activeElement===v&&zv(l))}return()=>{l.removeEventListener(Kce,h),setTimeout(()=>{const b=new CustomEvent(Zce,nXe);l.addEventListener(Zce,d),l.dispatchEvent(b),b.defaultPrevented||zv(v??document.body,{select:!0}),l.removeEventListener(Zce,d),lXe.remove(g)},0)}}},[l,h,d,g]);const m=se.useCallback(v=>{if(!n&&!i||g.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,b=document.activeElement;if(y&&b){const x=v.currentTarget,[w,A]=aXe(x);w&&A?!v.shiftKey&&b===A?(v.preventDefault(),n&&zv(w,{select:!0})):v.shiftKey&&b===w&&(v.preventDefault(),n&&zv(A,{select:!0})):b===x&&v.preventDefault()}},[n,i,g.paused]);return W.jsx($p.div,{tabIndex:-1,...o,ref:p,onKeyDown:m})},"FocusScope"));function iXe(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(zv(n,{select:e}),document.activeElement!==r)return}yu(iXe,"focusFirst");function aXe(t){const e=Jce(t),r=eue(e,t),n=eue(e.reverse(),t);return[r,n]}yu(aXe,"getTabbableEdges");function Jce(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:yu(n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;r.nextNode();)e.push(r.currentNode);return e}yu(Jce,"getTabbableCandidates");function eue(t,e){const r=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const n of t)if(!(r?!n.checkVisibility({checkVisibilityCSS:!0}):sXe(n,{upTo:e})))return n}yu(eue,"findVisible");function sXe(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}yu(sXe,"isHidden");function oXe(t){return t instanceof HTMLInputElement&&"select"in t}yu(oXe,"isSelectableInput");function zv(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&oXe(t)&&e&&t.select()}}yu(zv,"focus");var lXe=cXe();function cXe(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=tue(t,e),t.unshift(e)},remove(e){var r;t=tue(t,e),(r=t[0])==null||r.resume()}}}yu(cXe,"createFocusScopesStack");function tue(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}yu(tue,"arrayRemove");function uXe(t){return t.filter(e=>e.tagName!=="A")}yu(uXe,"removeLinks");var Pxr=Object.defineProperty,Nxr=(t,e)=>Pxr(t,"name",{value:e,configurable:!0}),Bxr=se.forwardRef(Nxr(function(e,r){var l;const{container:n,...i}=e,[a,s]=se.useState(!1);Fp(()=>s(!0),[]);const o=n||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?ak.createPortal(W.jsx($p.div,{...i,ref:r}),o):null},"Portal")),$xr=Object.defineProperty,rue=(t,e)=>$xr(t,"name",{value:e,configurable:!0}),RQ=0,rm=null;function Fxr(t){return nue(),t.children}rue(Fxr,"FocusGuards");function nue(){se.useEffect(()=>{rm||(rm={start:iue(),end:iue()});const{start:t,end:e}=rm;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),RQ++,()=>{RQ===1&&(rm==null||rm.start.remove(),rm==null||rm.end.remove(),rm=null),RQ=Math.max(0,RQ-1)}},[])}rue(nue,"useFocusGuards");function iue(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}rue(iue,"createFocusGuard");var nm=function(){return nm=Object.assign||function(e){for(var r,n=1,i=arguments.length;n"u")return r2r;var e=n2r(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},a2r=gXe(),OE="data-scroll-locked",s2r=function(t,e,r,n){var i=t.left,a=t.top,s=t.right,o=t.gap;return r===void 0&&(r="margin"),` +`||l==="\r")&&(a=!1);continue}if(s){l==="*"&&u==="/"&&(s=!1,o+=1);continue}if(n){i?i=!1:l==="\\"?i=!0:l===n&&(n="");continue}if(l==="/"&&u==="/"){a=!0,o+=1;continue}if(l==="/"&&u==="*"){s=!0,o+=1;continue}if(l==="'"||l==='"'){n=l;continue}const h=t.slice(o).match(r);if(h)return{index:o,openingIndex:o+h[0].lastIndexOf("("),type:h[1]==="LinearGradient"?"linear":"radial"}}}function zbr(t){let e=t,r=0;for(;;){const n=Fbr(e,r);if(!n)return e;const i=Nbr(e,n.openingIndex),a=e.slice(n.openingIndex+1,i),s=JSON.stringify($br(n.type,a));e=`${e.slice(0,n.index)}${s}${e.slice(i+1)}`,r=n.index+s.length}}function Ubr(t,e=!1){if(t.length>Lbr)throw new Error("ECharts option is too large");const r=zbr(Pbr(t));let n;try{n=wje.parse(r)}catch(s){throw/\bfunction\s*\(|=>/.test(r)?new Error("ECharts function callbacks are not supported"):s}if(!W6(n))throw new Error("ECharts option must be a data object");kQ(n);const i={...n};i.aria={...W6(i.aria)?i.aria:{},enabled:!0};const a=i.tooltip;return W6(a)?i.tooltip={...a,renderMode:"richText"}:Array.isArray(a)&&(i.tooltip=a.map(s=>W6(s)?{...s,renderMode:"richText"}:s)),e&&(i.animation=!1),i}function Yb({as:t="span",className:e="",duration:r=4,spread:n=20,children:i,style:a,...s}){const o=Math.min(Math.max(n,5),45);return W.jsx(t,{className:`text-shimmer${e?` ${e}`:""}`,style:{...a,backgroundImage:`linear-gradient(to right, hsl(var(--muted-foreground)) ${50-o}%, hsl(var(--foreground)) 50%, hsl(var(--muted-foreground)) ${50+o}%)`,animationDuration:`${r}s`},...s,children:i})}let Bce;function Vbr(){return Bce??(Bce=Promise.resolve().then(()=>JGr).catch(t=>{throw Bce=void 0,t})),Bce}function Qbr({source:t}){const{t:e}=Ea("conversation"),r=se.useRef(null),[n,i]=se.useState(!1),[a,s]=se.useState("");return se.useEffect(()=>{let o=!1,l,u,h;i(!1);try{h=Ubr(t,window.matchMedia("(prefers-reduced-motion: reduce)").matches),s("")}catch{s("invalid");return}return Vbr().then(d=>{const f=r.current;o||!f||(l=d.init(f,void 0,{renderer:"svg"}),l.setOption(h,{notMerge:!0}),typeof ResizeObserver<"u"&&(u=new ResizeObserver(()=>l==null?void 0:l.resize()),u.observe(f)),i(!0))}).catch(()=>{l==null||l.dispose(),l=void 0,o||s("render")}),()=>{o=!0,u==null||u.disconnect(),l==null||l.dispose()}},[t]),W.jsxs("div",{className:`echarts-diagram${a?" echarts-diagram--error":""}`,role:"img","aria-label":e("visualization.echartsAria"),"aria-busy":!n&&!a,children:[W.jsx("div",{ref:r,className:"echarts-diagram__canvas",hidden:!!a}),!n&&!a?W.jsx("div",{className:"echarts-diagram__state","aria-live":"polite",children:W.jsx(Yb,{duration:2.2,spread:15,children:e("visualization.rendering")})}):null,a?W.jsx("p",{className:"echarts-diagram__error",role:"alert",children:e(a==="invalid"?"visualization.invalidEcharts":"visualization.renderFailed")}):null]})}const Gbr=se.memo(Qbr);let Aje,Sje=Promise.resolve(),Hbr=0;function Wbr(){return Aje??(Aje=Promise.resolve().then(()=>uon).then(({default:t})=>(t.initialize({startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,theme:"neutral"}),t))),Aje}function Ybr(t){const e=Sje.then(async()=>{const r=await Wbr(),n=`mermaid-diagram-${Hbr+=1}`;return r.render(n,t)});return Sje=e.then(()=>{},()=>{}),e}function qbr({source:t}){const{t:e}=Ea("conversation"),r=se.useRef(null),[n,i]=se.useState(null),[a,s]=se.useState(!1);return se.useEffect(()=>{let o=!1;return i(null),s(!1),Ybr(t).then(l=>{o||i(l)}).catch(()=>{o||s(!0)}),()=>{o=!0}},[t]),se.useEffect(()=>{!(n!=null&&n.bindFunctions)||!r.current||n.bindFunctions(r.current)},[n]),a?W.jsx("div",{className:"mermaid-diagram mermaid-diagram--error",children:W.jsx("p",{className:"mermaid-diagram__error",role:"alert",children:e("visualization.mermaidFailed")})}):n?W.jsx("div",{ref:r,className:"mermaid-diagram",role:"img","aria-label":e("visualization.mermaidAria"),dangerouslySetInnerHTML:{__html:n.svg}}):W.jsx("div",{className:"mermaid-diagram mermaid-diagram--loading","aria-live":"polite",children:W.jsx(Yb,{duration:2.2,spread:15,children:e("visualization.rendering")})})}const jbr=se.memo(qbr);function Tje(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;eXbr(t,"name",{value:e,configurable:!0});function Fce(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}$ce(Fce,"setRef");function Cje(...t){return e=>{let r=!1;const n=t.map(i=>{const a=Fce(i,e);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let i=0;iKbr(t,"name",{value:e,configurable:!0});function fA(t){const e=se.forwardRef((r,n)=>{let{children:i,...a}=r,s=null,o=!1;const l=[];zce(i)&&typeof EQ=="function"&&(i=EQ(i._payload)),se.Children.forEach(i,f=>{var p;if(_je(f)){o=!0;const g=f;let m="child"in g.props?g.props.child:g.props.children;zce(m)&&typeof EQ=="function"&&(m=EQ(m._payload)),s=Jbr(g,m),l.push((p=s==null?void 0:s.props)==null?void 0:p.children)}else l.push(f)}),s?s=se.cloneElement(s,void 0,l):!o&&se.Children.count(i)===1&&se.isValidElement(i)&&(s=i);const u=s?Eje(s):void 0,h=Sh(n,u);if(!s){if(i||i===0)throw new Error(o?rxr(t):txr(t));return i}const d=kje(a,s.props??{});return s.type!==se.Fragment&&(d.ref=n?h:u),se.cloneElement(s,d)});return e.displayName=`${t}.Slot`,e}Bp(fA,"createSlot");var Oje=Symbol.for("radix.slottable");function Zbr(t){const e=Bp(r=>"child"in r?r.children(r.child):r.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=Oje,e}Bp(Zbr,"createSlottable");var Jbr=Bp((t,e)=>{if("child"in t.props){const r=t.props.child;return se.isValidElement(r)?se.cloneElement(r,void 0,t.props.children(r.props.children)):null}return se.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function kje(t,e){const r={...e};for(const n in e){const i=t[n],a=e[n];/^on[A-Z]/.test(n)?i&&a?r[n]=(...o)=>{const l=a(...o);return i(...o),l}:i&&(r[n]=i):n==="style"?r[n]={...i,...a}:n==="className"&&(r[n]=[i,a].filter(Boolean).join(" "))}return{...t,...r}}Bp(kje,"mergeProps");function Eje(t){var n,i;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}Bp(Eje,"getElementRef");function _je(t){return se.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Oje}Bp(_je,"isSlottable");var exr=Symbol.for("react.lazy");function zce(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===exr&&"_payload"in t&&Rje(t._payload)}Bp(zce,"isLazyComponent");function Rje(t){return typeof t=="object"&&t!==null&&"then"in t}Bp(Rje,"isPromiseLike");var txr=Bp(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),rxr=Bp(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),EQ=Tw[" use ".trim().toString()],nxr=Object.defineProperty,ixr=(t,e)=>nxr(t,"name",{value:e,configurable:!0}),axr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$p=axr.reduce((t,e)=>{const r=fA(`Primitive.${e}`),n=se.forwardRef((i,a)=>{const{asChild:s,...o}=i,l=s?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),W.jsx(l,{...o,ref:a})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function Dje(t,e){t&&ak.flushSync(()=>t.dispatchEvent(e))}ixr(Dje,"dispatchDiscreteCustomEvent");var sxr=Object.defineProperty,Ef=(t,e)=>sxr(t,"name",{value:e,configurable:!0});function oxr(t,e){const r=se.createContext(e);r.displayName=t+"Context";const n=Ef(a=>{const{children:s,...o}=a,l=se.useMemo(()=>o,Object.values(o));return W.jsx(r.Provider,{value:l,children:s})},"Provider");n.displayName=t+"Provider";function i(a,s={}){const{optional:o=!1}=s,l=se.useContext(r);if(l)return l;if(e!==void 0)return e;if(!o)throw new Error(`\`${a}\` must be used within \`${t}\``)}return Ef(i,"useContext"),[n,i]}Ef(oxr,"createContext");function pA(t,e=[]){let r=[];function n(a,s){const o=se.createContext(s);o.displayName=a+"Context";const l=r.length;r=[...r,s];const u=Ef(d=>{var y;const{scope:f,children:p,...g}=d,m=((y=f==null?void 0:f[t])==null?void 0:y[l])||o,v=se.useMemo(()=>g,Object.values(g));return W.jsx(m.Provider,{value:v,children:p})},"Provider");u.displayName=a+"Provider";function h(d,f,p={}){var y;const{optional:g=!1}=p,m=((y=f==null?void 0:f[t])==null?void 0:y[l])||o,v=se.useContext(m);if(v)return v;if(s!==void 0)return s;if(!g)throw new Error(`\`${d}\` must be used within \`${a}\``)}return Ef(h,"useContext"),[u,h]}Ef(n,"createContext");const i=Ef(()=>{const a=r.map(s=>se.createContext(s));return Ef(function(o){const l=(o==null?void 0:o[t])||a;return se.useMemo(()=>({[`__scope${t}`]:{...o,[t]:l}}),[o,l])},"useScope")},"createScope");return i.scopeName=t,[n,Lje(i,...e)]}Ef(pA,"createContextScope");function Lje(...t){const e=t[0];if(t.length===1)return e;const r=Ef(()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return Ef(function(a){const s=n.reduce((o,{useScope:l,scopeName:u})=>{const d=l(a)[`__scope${u}`];return{...o,...d}},{});return se.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])},"useComposedScopes")},"createScope");return r.scopeName=e.scopeName,r}Ef(Lje,"composeContextScopes");var lxr=Object.defineProperty,vl=(t,e)=>lxr(t,"name",{value:e,configurable:!0});function Mje(t){const e=t+"CollectionProvider",[r,n]=pA(e),[i,a]=r(e,{collectionRef:{current:null},itemMap:new Map}),s=vl(m=>{const{scope:v,children:y}=m,b=se.useRef(null),x=se.useRef(new Map).current;return W.jsx(i,{scope:v,itemMap:x,collectionRef:b,children:y})},"CollectionProvider");s.displayName=e;const o=t+"CollectionSlot",l=fA(o),u=se.forwardRef((m,v)=>{const{scope:y,children:b}=m,x=a(o,y),w=Sh(v,x.collectionRef);return W.jsx(l,{ref:w,children:b})});u.displayName=o;const h=t+"CollectionItemSlot",d="data-radix-collection-item",f=fA(h),p=se.forwardRef((m,v)=>{const{scope:y,children:b,...x}=m,w=se.useRef(null),A=Sh(v,w),S=a(h,y);return se.useEffect(()=>(S.itemMap.set(w,{ref:w,...x}),()=>void S.itemMap.delete(w))),W.jsx(f,{[d]:"",ref:A,children:b})});p.displayName=h;function g(m){const v=a(t+"CollectionConsumer",m);return se.useCallback(()=>{const b=v.collectionRef.current;if(!b)return[];const x=Array.from(b.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((S,T)=>x.indexOf(S.ref.current)-x.indexOf(T.ref.current))},[v.collectionRef,v.itemMap])}return vl(g,"useCollection"),[{Provider:s,Slot:u,ItemSlot:p},g,n]}vl(Mje,"createCollection");var Ije=new WeakMap,Uce=(df=class extends Map{constructor(r){super(r);$Zt(this,Uo);TLe(this,Uo,[...super.keys()]),Ije.set(this,!0)}set(r,n){return Ije.get(this)&&(this.has(r)?cu(this,Uo)[cu(this,Uo).indexOf(r)]=r:cu(this,Uo).push(r)),super.set(r,n),this}insert(r,n,i){const a=this.has(n),s=cu(this,Uo).length,o=Vce(r);let l=o>=0?o:s+o;const u=l<0||l>=s?-1:l;if(u===this.size||a&&u===this.size-1||u===-1)return this.set(n,i),this;const h=this.size+(a?0:1);o<0&&l++;const d=[...cu(this,Uo)];let f,p=!1;for(let g=l;g=this.size&&(a=this.size-1),this.at(a)}keyFrom(r,n){const i=this.indexOf(r);if(i===-1)return;let a=i+n;return a<0&&(a=0),a>=this.size&&(a=this.size-1),this.keyAt(a)}find(r,n){let i=0;for(const a of this){if(Reflect.apply(r,n,[a,i,this]))return a;i++}}findIndex(r,n){let i=0;for(const a of this){if(Reflect.apply(r,n,[a,i,this]))return i;i++}return-1}filter(r,n){const i=[];let a=0;for(const s of this)Reflect.apply(r,n,[s,a,this])&&i.push(s),a++;return new df(i)}map(r,n){const i=[];let a=0;for(const s of this)i.push([s[0],Reflect.apply(r,n,[s,a,this])]),a++;return new df(i)}reduce(...r){const[n,i]=r;let a=0,s=i??this.at(0);for(const o of this)a===0&&r.length===1?s=o:s=Reflect.apply(n,this,[s,o,a,this]),a++;return s}reduceRight(...r){const[n,i]=r;let a=i??this.at(-1);for(let s=this.size-1;s>=0;s--){const o=this.at(s);s===this.size-1&&r.length===1?a=o:a=Reflect.apply(n,this,[a,o,s,this])}return a}toSorted(r){const n=[...this.entries()].sort(r);return new df(n)}toReversed(){const r=new df;for(let n=this.size-1;n>=0;n--){const i=this.keyAt(n),a=this.get(i);r.set(i,a)}return r}toSpliced(...r){const n=[...this.entries()];return n.splice(...r),new df(n)}slice(r,n){const i=new df;let a=this.size-1;if(r===void 0)return i;r<0&&(r=r+this.size),n!==void 0&&n>0&&(a=n-1);for(let s=r;s<=a;s++){const o=this.keyAt(s),l=this.get(o);i.set(o,l)}return i}every(r,n){let i=0;for(const a of this){if(!Reflect.apply(r,n,[a,i,this]))return!1;i++}return!0}some(r,n){let i=0;for(const a of this){if(Reflect.apply(r,n,[a,i,this]))return!0;i++}return!1}},Uo=new WeakMap,vl(df,"OrderedDict"),df);function _Q(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const r=Pje(t,e);return r===-1?void 0:t[r]}vl(_Q,"at");function Pje(t,e){const r=t.length,n=Vce(e),i=n>=0?n:r+n;return i<0||i>=r?-1:i}vl(Pje,"toSafeIndex");function Vce(t){return t!==t||t===0?0:Math.trunc(t)}vl(Vce,"toSafeInteger");function cxr(t){const e=t+"CollectionProvider",[r,n]=pA(e),[i,a]=r(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Uce,setItemMap:vl(()=>{},"setItemMap")}),s=vl(({state:x,...w})=>x?W.jsx(l,{...w,state:x}):W.jsx(o,{...w}),"CollectionProvider");s.displayName=e;const o=vl(x=>{const w=v();return W.jsx(l,{...x,state:w})},"CollectionInit");o.displayName=e+"Init";const l=vl(x=>{const{scope:w,children:A,state:S}=x,T=se.useRef(null),[O,k]=se.useState(null),E=Sh(T,k),[_,I]=S;return se.useEffect(()=>{if(!O)return;const L=$je(()=>{});return L.observe(O,{childList:!0,subtree:!0}),()=>{L.disconnect()}},[O]),W.jsx(i,{scope:w,itemMap:_,setItemMap:I,collectionRef:E,collectionRefObject:T,collectionElement:O,children:A})},"CollectionProviderImpl");l.displayName=e+"Impl";const u=t+"CollectionSlot",h=fA(u),d=se.forwardRef((x,w)=>{const{scope:A,children:S}=x,T=a(u,A),O=Sh(w,T.collectionRef);return W.jsx(h,{ref:O,children:S})});d.displayName=u;const f=t+"CollectionItemSlot",p="data-radix-collection-item",g=fA(f),m=se.forwardRef((x,w)=>{const{scope:A,children:S,...T}=x,O=se.useRef(null),[k,E]=se.useState(null),_=Sh(w,O,E),I=a(f,A),{setItemMap:L}=I,R=se.useRef(T);Nje(R.current,T)||(R.current=T);const D=R.current;return se.useEffect(()=>{const M=D;return L(P=>k?P.has(k)?P.set(k,{...M,element:k}).toSorted(Qce):(P.set(k,{...M,element:k}),P.toSorted(Qce)):P),()=>{L(P=>!k||!P.has(k)?P:(P.delete(k),new Uce(P)))}},[k,D,L]),W.jsx(g,{[p]:"",ref:_,children:S})});m.displayName=f;function v(){return se.useState(new Uce)}vl(v,"useInitCollection");function y(x){const{itemMap:w}=a(t+"CollectionConsumer",x);return w}return vl(y,"useCollection"),[{Provider:s,Slot:d,ItemSlot:m},{createCollectionScope:n,useCollection:y,useInitCollection:v}]}vl(cxr,"createCollection");function Nje(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t==null||e==null)return!1;const r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(const i of r)if(!Object.prototype.hasOwnProperty.call(e,i)||t[i]!==e[i])return!1;return!0}vl(Nje,"shallowEqual");function Bje(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}vl(Bje,"isElementPreceding");function Qce(t,e){return!t[1].element||!e[1].element?0:Bje(t[1].element,e[1].element)?-1:1}vl(Qce,"sortByDocumentPosition");function $je(t){return new MutationObserver(r=>{for(const n of r)if(n.type==="childList"){t();return}})}vl($je,"getChildListObserver");var uxr=Object.defineProperty,SE=(t,e)=>uxr(t,"name",{value:e,configurable:!0}),Fje=!!(typeof window<"u"&&window.document&&window.document.createElement);function vu(t,e,{checkForDefaultPrevented:r=!0}={}){return SE(function(i){if(t==null||t(i),r===!1||!i||!i.defaultPrevented)return e==null?void 0:e(i)},"handleEvent")}SE(vu,"composeEventHandlers");function hxr(t){var e;if(!Fje)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}SE(hxr,"getOwnerWindow");function Gce(t){if(!Fje)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}SE(Gce,"getOwnerDocument");function zje(t,e=!1){const{activeElement:r}=Gce(t);if(!(r!=null&&r.nodeName))return null;if(Uje(r)&&r.contentDocument)return zje(r.contentDocument.body,e);if(e){const n=r.getAttribute("aria-activedescendant");if(n){const i=Gce(r).getElementById(n);if(i)return i}}return r}SE(zje,"getActiveElement");function Uje(t){return t.tagName==="IFRAME"}SE(Uje,"isFrame");var Fp=globalThis!=null&&globalThis.document?se.useLayoutEffect:()=>{},dxr=Object.defineProperty,fxr=(t,e)=>dxr(t,"name",{value:e,configurable:!0}),Vje=Tw[" useEffectEvent ".trim().toString()],Qje=Tw[" useInsertionEffect ".trim().toString()];function Gje(t){if(typeof Vje=="function")return Vje(t);const e=se.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Qje=="function"?Qje(()=>{e.current=t}):Fp(()=>{e.current=t}),se.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}fxr(Gje,"useEffectEvent");var pxr=Object.defineProperty,Y6=(t,e)=>pxr(t,"name",{value:e,configurable:!0}),gxr=Tw[" useInsertionEffect ".trim().toString()]||Fp;function TE({prop:t,defaultProp:e,onChange:r=Y6(()=>{},"onChange"),caller:n}){const[i,a,s]=Hje({defaultProp:e,onChange:r}),o=t!==void 0,l=o?t:i,u=se.useCallback(h=>{var d;if(o){const f=Wje(h)?h(t):h;f!==t&&((d=s.current)==null||d.call(s,f))}else a(h)},[o,t,a,s]);return[l,u]}Y6(TE,"useControllableState");function Hje({defaultProp:t,onChange:e}){const[r,n]=se.useState(t),i=se.useRef(r),a=se.useRef(e);return gxr(()=>{a.current=e},[e]),se.useEffect(()=>{var s;i.current!==r&&((s=a.current)==null||s.call(a,r),i.current=r)},[r,i]),[r,n,a]}Y6(Hje,"useUncontrolledState");function Wje(t){return typeof t=="function"}Y6(Wje,"isFunction");var Yje=Symbol("RADIX:SYNC_STATE");function mxr(t,e,r,n){const{prop:i,defaultProp:a,onChange:s,caller:o}=e,l=i!==void 0,u=Gje(s),h=[{...r,state:a}];n&&h.push(n);const[d,f]=se.useReducer((v,y)=>{if(y.type===Yje)return{...v,state:y.state};const b=t(v,y);return l&&!Object.is(b.state,v.state)&&u(b.state),b},...h),p=d.state,g=se.useRef(p);se.useEffect(()=>{g.current!==p&&(g.current=p,l||u(p))},[p,g,l]);const m=se.useMemo(()=>i!==void 0?{...d,state:i}:d,[d,i]);return se.useEffect(()=>{l&&!Object.is(i,d.state)&&f({type:Yje,state:i})},[i,d.state,l]),[m,f]}Y6(mxr,"useControllableStateReducer");var vxr=Object.defineProperty,Fv=(t,e)=>vxr(t,"name",{value:e,configurable:!0});function qje(t,e){return se.useReducer((r,n)=>e[r][n]??r,t)}Fv(qje,"useStateMachine");var jje=Fv(t=>{const{present:e,children:r}=t,n=Xje(e),i=typeof r=="function"?r({present:n.isPresent}):se.Children.only(r),a=Kje(n.ref,Zje(i));return typeof r=="function"||n.isPresent?se.cloneElement(i,{ref:a}):null},"Presence");function Xje(t){const[e,r]=se.useState(),n=se.useRef(null),i=se.useRef(t),a=se.useRef("none"),s=se.useRef(void 0),o=t?"mounted":"unmounted",[l,u]=qje(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return se.useEffect(()=>{l==="mounted"?(a.current=s.current??CE(n.current),s.current=void 0):a.current="none"},[l]),Fp(()=>{const h=n.current,d=i.current;if(d!==t){const p=a.current,g=CE(h);t?(s.current=g,u("MOUNT")):g==="none"||(h==null?void 0:h.display)==="none"?u("UNMOUNT"):u(d&&p!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,u]),Fp(()=>{if(e){let h;const d=e.ownerDocument.defaultView??window,f=Fv(g=>{const v=CE(n.current).includes(CSS.escape(g.animationName));if(g.target===e&&v&&(u("ANIMATION_END"),!i.current)){const y=e.style.animationFillMode;e.style.animationFillMode="forwards",h=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=y)})}},"handleAnimationEnd"),p=Fv(g=>{g.target===e&&(a.current=CE(n.current))},"handleAnimationStart");return e.addEventListener("animationstart",p),e.addEventListener("animationcancel",f),e.addEventListener("animationend",f),()=>{d.clearTimeout(h),e.removeEventListener("animationstart",p),e.removeEventListener("animationcancel",f),e.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[e,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:se.useCallback(h=>{if(h){const d=getComputedStyle(h);n.current=d,s.current=CE(d)}else n.current=null;r(h)},[])}}Fv(Xje,"usePresence");function Hce(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Fv(Hce,"setRef");function Kje(...t){const e=se.useRef(t);return e.current=t,se.useCallback(r=>{const n=e.current;let i=!1;const a=n.map(s=>{const o=Hce(s,r);return!i&&typeof o=="function"&&(i=!0),o});if(i)return()=>{for(let s=0;syxr(t,"name",{value:e,configurable:!0}),xxr=Tw[" useId ".trim().toString()]||(()=>{}),wxr=0;function Wce(t){const[e,r]=se.useState(xxr());return Fp(()=>{t||r(n=>n??String(wxr++))},[t]),t||(e?`radix-${e}`:"")}bxr(Wce,"useId");var Axr=Object.defineProperty,Sxr=(t,e)=>Axr(t,"name",{value:e,configurable:!0}),Txr=se.createContext(void 0);function Yce(t){const e=se.useContext(Txr);return t||e||"ltr"}Sxr(Yce,"useDirection");var Cxr=Object.defineProperty,Oxr=(t,e)=>Cxr(t,"name",{value:e,configurable:!0});function qb(t){const e=se.useRef(t);return se.useEffect(()=>{e.current=t}),se.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}Oxr(qb,"useCallbackRef");var kxr=Object.defineProperty,yl=(t,e)=>kxr(t,"name",{value:e,configurable:!0}),qce="dismissableLayer.update",Exr="dismissableLayer.pointerDownOutside",_xr="dismissableLayer.focusOutside",Jje,eXe=se.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Rxr=se.forwardRef(yl(function(e,r){const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:l,onDismiss:u,...h}=e,d=se.useContext(eXe),[f,p]=se.useState(null),g=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=se.useState({}),v=Sh(r,p),y=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=b?y.indexOf(b):-1,w=f?y.indexOf(f):-1,A=d.layersWithOutsidePointerEventsDisabled.size>0,S=w>=x,T=se.useRef(!1),O=tXe(I=>{s==null||s(I),l==null||l(I),I.defaultPrevented||u==null||u()},{ownerDocument:g,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:se.useCallback(I=>{if(!(I instanceof Node))return!1;const L=[...d.branches].some(R=>R.contains(I));return S&&!L},[d.branches,S])}),k=rXe(I=>{if(i&&T.current)return;const L=I.target;[...d.branches].some(D=>D.contains(L))||(o==null||o(I),l==null||l(I),I.defaultPrevented||u==null||u())},g),E=f?w===y.length-1:!1,_=qb(I=>{I.key==="Escape"&&(a==null||a(I),!I.defaultPrevented&&u&&(I.preventDefault(),u()))});return se.useEffect(()=>{if(E)return g.addEventListener("keydown",_,{capture:!0}),()=>g.removeEventListener("keydown",_,{capture:!0})},[g,E,_]),se.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Jje=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),jce(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=Jje))}},[f,g,n,d]),se.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),jce())},[f,d]),se.useEffect(()=>{const I=yl(()=>m({}),"handleUpdate");return document.addEventListener(qce,I),()=>document.removeEventListener(qce,I)},[]),W.jsx($p.div,{...h,ref:v,style:{pointerEvents:A?S?"auto":"none":void 0,...e.style},onFocusCapture:vu(e.onFocusCapture,k.onFocusCapture),onBlurCapture:vu(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:vu(e.onPointerDownCapture,O.onPointerDownCapture)})},"DismissableLayer"));function Dxr(){const t=se.useContext(eXe),[e,r]=se.useState(null);return se.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),r}yl(Dxr,"useDismissableLayerSurface");var Lxr=yl(()=>!0,"IS_TRUE");function tXe(t,e){const{ownerDocument:r=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:n=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:s=Lxr}=e,o=qb(t),l=se.useRef(!1),u=se.useRef(!1),h=se.useRef(new Map),d=se.useRef(()=>{});return se.useEffect(()=>{function f(){u.current=!1,i.current=!1,h.current.clear()}yl(f,"resetOutsideInteraction");function p(){return Array.from(h.current.values()).some(Boolean)}yl(p,"isOutsideInteractionIntercepted");function g(x){if(!u.current)return;const w=x.target;w instanceof Node&&[...a].some(S=>S.contains(w))||h.current.set(x.type,!0),x.type==="click"&&window.setTimeout(()=>{u.current&&d.current()},0)}yl(g,"handleInteractionCapture");function m(x){u.current&&h.current.set(x.type,!1)}yl(m,"handleInteractionBubble");const v=yl(x=>{if(x.target&&!l.current){let w=function(){r.removeEventListener("click",d.current);const S=p();f(),S||Xce(Exr,o,A,{discrete:!0})};if(yl(w,"handleAndDispatchPointerDownOutsideEvent"),!s(x.target)){r.removeEventListener("click",d.current),f(),l.current=!1;return}const A={originalEvent:x};u.current=!0,i.current=n&&x.button===0,h.current.clear(),!n||x.button!==0?w():(r.removeEventListener("click",d.current),d.current=w,r.addEventListener("click",d.current,{once:!0}))}else r.removeEventListener("click",d.current),f();l.current=!1},"handlePointerDown"),y=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const x of y)r.addEventListener(x,g,!0),r.addEventListener(x,m);const b=window.setTimeout(()=>{r.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(b),r.removeEventListener("pointerdown",v),r.removeEventListener("click",d.current);for(const x of y)r.removeEventListener(x,g,!0),r.removeEventListener(x,m)}},[r,o,n,i,a,s]),{onPointerDownCapture:yl(()=>l.current=!0,"onPointerDownCapture")}}yl(tXe,"usePointerDownOutside");function rXe(t,e=globalThis==null?void 0:globalThis.document){const r=qb(t),n=se.useRef(!1);return se.useEffect(()=>{const i=yl(a=>{a.target&&!n.current&&Xce(_xr,r,{originalEvent:a},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,r]),{onFocusCapture:yl(()=>n.current=!0,"onFocusCapture"),onBlurCapture:yl(()=>n.current=!1,"onBlurCapture")}}yl(rXe,"useFocusOutside");function jce(){const t=new CustomEvent(qce);document.dispatchEvent(t)}yl(jce,"dispatchUpdate");function Xce(t,e,r,{discrete:n}){const i=r.originalEvent.target,a=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?Dje(i,a):i.dispatchEvent(a)}yl(Xce,"handleAndDispatchCustomEvent");var Mxr=Object.defineProperty,yu=(t,e)=>Mxr(t,"name",{value:e,configurable:!0}),Kce="focusScope.autoFocusOnMount",Zce="focusScope.autoFocusOnUnmount",nXe={bubbles:!1,cancelable:!0},Ixr=se.forwardRef(yu(function(e,r){const{loop:n=!1,trapped:i=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...o}=e,[l,u]=se.useState(null),h=qb(a),d=qb(s),f=se.useRef(null),p=Sh(r,u),g=se.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;se.useEffect(()=>{if(i){let v=function(w){if(g.paused||!l)return;const A=w.target;l.contains(A)?f.current=A:zv(f.current,{select:!0})},y=function(w){if(g.paused||!l)return;const A=w.relatedTarget;A!==null&&(l.contains(A)||zv(f.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const S of w)S.removedNodes.length>0&&zv(l)};yu(v,"handleFocusIn"),yu(y,"handleFocusOut"),yu(b,"handleMutations"),document.addEventListener("focusin",v),document.addEventListener("focusout",y);const x=new MutationObserver(b);return l&&x.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),x.disconnect()}}},[i,l,g.paused]),se.useEffect(()=>{if(l){lXe.add(g);const v=document.activeElement;if(!l.contains(v)){const b=new CustomEvent(Kce,nXe);l.addEventListener(Kce,h),l.dispatchEvent(b),b.defaultPrevented||(iXe(uXe(Jce(l)),{select:!0}),document.activeElement===v&&zv(l))}return()=>{l.removeEventListener(Kce,h),setTimeout(()=>{const b=new CustomEvent(Zce,nXe);l.addEventListener(Zce,d),l.dispatchEvent(b),b.defaultPrevented||zv(v??document.body,{select:!0}),l.removeEventListener(Zce,d),lXe.remove(g)},0)}}},[l,h,d,g]);const m=se.useCallback(v=>{if(!n&&!i||g.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,b=document.activeElement;if(y&&b){const x=v.currentTarget,[w,A]=aXe(x);w&&A?!v.shiftKey&&b===A?(v.preventDefault(),n&&zv(w,{select:!0})):v.shiftKey&&b===w&&(v.preventDefault(),n&&zv(A,{select:!0})):b===x&&v.preventDefault()}},[n,i,g.paused]);return W.jsx($p.div,{tabIndex:-1,...o,ref:p,onKeyDown:m})},"FocusScope"));function iXe(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(zv(n,{select:e}),document.activeElement!==r)return}yu(iXe,"focusFirst");function aXe(t){const e=Jce(t),r=eue(e,t),n=eue(e.reverse(),t);return[r,n]}yu(aXe,"getTabbableEdges");function Jce(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:yu(n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;r.nextNode();)e.push(r.currentNode);return e}yu(Jce,"getTabbableCandidates");function eue(t,e){const r=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const n of t)if(!(r?!n.checkVisibility({checkVisibilityCSS:!0}):sXe(n,{upTo:e})))return n}yu(eue,"findVisible");function sXe(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}yu(sXe,"isHidden");function oXe(t){return t instanceof HTMLInputElement&&"select"in t}yu(oXe,"isSelectableInput");function zv(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&oXe(t)&&e&&t.select()}}yu(zv,"focus");var lXe=cXe();function cXe(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=tue(t,e),t.unshift(e)},remove(e){var r;t=tue(t,e),(r=t[0])==null||r.resume()}}}yu(cXe,"createFocusScopesStack");function tue(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}yu(tue,"arrayRemove");function uXe(t){return t.filter(e=>e.tagName!=="A")}yu(uXe,"removeLinks");var Pxr=Object.defineProperty,Nxr=(t,e)=>Pxr(t,"name",{value:e,configurable:!0}),Bxr=se.forwardRef(Nxr(function(e,r){var l;const{container:n,...i}=e,[a,s]=se.useState(!1);Fp(()=>s(!0),[]);const o=n||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?ak.createPortal(W.jsx($p.div,{...i,ref:r}),o):null},"Portal")),$xr=Object.defineProperty,rue=(t,e)=>$xr(t,"name",{value:e,configurable:!0}),RQ=0,rm=null;function Fxr(t){return nue(),t.children}rue(Fxr,"FocusGuards");function nue(){se.useEffect(()=>{rm||(rm={start:iue(),end:iue()});const{start:t,end:e}=rm;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),RQ++,()=>{RQ===1&&(rm==null||rm.start.remove(),rm==null||rm.end.remove(),rm=null),RQ=Math.max(0,RQ-1)}},[])}rue(nue,"useFocusGuards");function iue(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}rue(iue,"createFocusGuard");var nm=function(){return nm=Object.assign||function(e){for(var r,n=1,i=arguments.length;n"u")return r2r;var e=n2r(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},a2r=gXe(),OE="data-scroll-locked",s2r=function(t,e,r,n){var i=t.left,a=t.top,s=t.right,o=t.gap;return r===void 0&&(r="margin"),` .`.concat(Uxr,` { overflow: hidden `).concat(n,`; padding-right: `).concat(o,"px ").concat(n,`; @@ -265,35 +265,35 @@ https://github.com/highlightjs/highlight.js/issues/2277`),B=M,F=P),N===void 0&&( margin-right: `).concat(o,"px ").concat(n,`; `),r==="padding"&&"padding-right: ".concat(o,"px ").concat(n,";")].filter(Boolean).join(""),` } - + .`).concat(DQ,` { right: `).concat(o,"px ").concat(n,`; } - + .`).concat(LQ,` { margin-right: `).concat(o,"px ").concat(n,`; } - + .`).concat(DQ," .").concat(DQ,` { right: 0 `).concat(n,`; } - + .`).concat(LQ," .").concat(LQ,` { margin-right: 0 `).concat(n,`; } - + body[`).concat(OE,`] { `).concat(Vxr,": ").concat(o,`px; } `)},mXe=function(){var t=parseInt(document.body.getAttribute(OE)||"0",10);return isFinite(t)?t:0},o2r=function(){se.useEffect(function(){return document.body.setAttribute(OE,(mXe()+1).toString()),function(){var t=mXe()-1;t<=0?document.body.removeAttribute(OE):document.body.setAttribute(OE,t.toString())}},[])},l2r=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,i=n===void 0?"margin":n;o2r();var a=se.useMemo(function(){return i2r(i)},[i]);return se.createElement(a2r,{styles:s2r(a,!e,i,r?"":"!important")})},lue=!1;if(typeof window<"u")try{var IQ=Object.defineProperty({},"passive",{get:function(){return lue=!0,!0}});window.addEventListener("test",IQ,IQ),window.removeEventListener("test",IQ,IQ)}catch{lue=!1}var kE=lue?{passive:!1}:!1,c2r=function(t){return t.tagName==="TEXTAREA"},vXe=function(t,e){if(!(t instanceof Element))return!1;var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!c2r(t)&&r[e]==="visible")},u2r=function(t){return vXe(t,"overflowY")},h2r=function(t){return vXe(t,"overflowX")},yXe=function(t,e){var r=e.ownerDocument,n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=bXe(t,n);if(i){var a=xXe(t,n),s=a[1],o=a[2];if(s>o)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},d2r=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},f2r=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},bXe=function(t,e){return t==="v"?u2r(e):h2r(e)},xXe=function(t,e){return t==="v"?d2r(e):f2r(e)},p2r=function(t,e){return t==="h"&&e==="rtl"?-1:1},g2r=function(t,e,r,n,i){var a=p2r(t,window.getComputedStyle(e).direction),s=a*n,o=r.target,l=e.contains(o),u=!1,h=s>0,d=0,f=0;do{if(!o)break;var p=xXe(t,o),g=p[0],m=p[1],v=p[2],y=m-v-a*g;(g||y)&&bXe(t,o)&&(d+=y,f+=g);var b=o.parentNode;o=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!l&&o!==document.body||l&&(e.contains(o)||e===o));return(h&&Math.abs(d)<1||!h&&Math.abs(f)<1)&&(u=!0),u},PQ=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},wXe=function(t){return[t.deltaX,t.deltaY]},AXe=function(t){return t&&"current"in t?t.current:t},m2r=function(t,e){return t[0]===e[0]&&t[1]===e[1]},v2r=function(t){return` .block-interactivity-`.concat(t,` {pointer-events: none;} .allow-interactivity-`).concat(t,` {pointer-events: all;} -`)},y2r=0,EE=[];function b2r(t){var e=se.useRef([]),r=se.useRef([0,0]),n=se.useRef(),i=se.useState(y2r++)[0],a=se.useState(gXe)[0],s=se.useRef(t);se.useEffect(function(){s.current=t},[t]),se.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var m=zxr([t.lockRef.current],(t.shards||[]).map(AXe),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var o=se.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var y=PQ(m),b=r.current,x="deltaX"in m?m.deltaX:b[0]-y[0],w="deltaY"in m?m.deltaY:b[1]-y[1],A,T=m.target,S=Math.abs(x)>Math.abs(w)?"h":"v";if("touches"in m&&S==="h"&&T.type==="range")return!1;var O=window.getSelection(),k=O&&O.anchorNode,E=k?k===T||k.contains(T):!1;if(E)return!1;var _=yXe(S,T);if(!_)return!0;if(_?A=S:(A=S==="v"?"h":"v",_=yXe(S,T)),!_)return!1;if(!n.current&&"changedTouches"in m&&(x||w)&&(n.current=A),!A)return!0;var I=n.current||A;return g2r(I,v,m,I==="h"?x:w)},[]),l=se.useCallback(function(m){var v=m;if(!(!EE.length||EE[EE.length-1]!==a)){var y="deltaY"in v?wXe(v):PQ(v),b=e.current.filter(function(A){return A.name===v.type&&(A.target===v.target||v.target===A.shadowParent)&&m2r(A.delta,y)})[0];if(b&&b.should){v.cancelable&&v.preventDefault();return}if(!b){var x=(s.current.shards||[]).map(AXe).filter(Boolean).filter(function(A){return A.contains(v.target)}),w=x.length>0?o(v,x[0]):!s.current.noIsolation;w&&v.cancelable&&v.preventDefault()}}},[]),u=se.useCallback(function(m,v,y,b){var x={name:m,delta:v,target:y,should:b,shadowParent:x2r(y)};e.current.push(x),setTimeout(function(){e.current=e.current.filter(function(w){return w!==x})},1)},[]),h=se.useCallback(function(m){r.current=PQ(m),n.current=void 0},[]),d=se.useCallback(function(m){u(m.type,wXe(m),m.target,o(m,t.lockRef.current))},[]),f=se.useCallback(function(m){u(m.type,PQ(m),m.target,o(m,t.lockRef.current))},[]);se.useEffect(function(){return EE.push(a),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,kE),document.addEventListener("touchmove",l,kE),document.addEventListener("touchstart",h,kE),function(){EE=EE.filter(function(m){return m!==a}),document.removeEventListener("wheel",l,kE),document.removeEventListener("touchmove",l,kE),document.removeEventListener("touchstart",h,kE)}},[]);var p=t.removeScrollBar,g=t.inert;return se.createElement(se.Fragment,null,g?se.createElement(a,{styles:v2r(i)}):null,p?se.createElement(l2r,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function x2r(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const w2r=jxr(pXe,b2r);var TXe=se.forwardRef(function(t,e){return se.createElement(MQ,nm({},t,{ref:e,sideCar:w2r}))});TXe.classNames=MQ.classNames;var A2r=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},_E=new WeakMap,NQ=new WeakMap,BQ={},cue=0,SXe=function(t){return t&&(t.host||SXe(t.parentNode))},T2r=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=SXe(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},S2r=function(t,e,r,n){var i=T2r(e,Array.isArray(t)?t:[t]);BQ[r]||(BQ[r]=new WeakMap);var a=BQ[r],s=[],o=new Set,l=new Set(i),u=function(d){!d||o.has(d)||(o.add(d),u(d.parentNode))};i.forEach(u);var h=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(o.has(f))h(f);else try{var p=f.getAttribute(n),g=p!==null&&p!=="false",m=(_E.get(f)||0)+1,v=(a.get(f)||0)+1;_E.set(f,m),a.set(f,v),s.push(f),m===1&&g&&NQ.set(f,!0),v===1&&f.setAttribute(r,"true"),g||f.setAttribute(n,"true")}catch(y){console.error("aria-hidden: cannot operate on ",f,y)}})};return h(e),o.clear(),cue++,function(){s.forEach(function(d){var f=_E.get(d)-1,p=a.get(d)-1;_E.set(d,f),a.set(d,p),f||(NQ.has(d)||d.removeAttribute(n),NQ.delete(d)),p||d.removeAttribute(r)}),cue--,cue||(_E=new WeakMap,_E=new WeakMap,NQ=new WeakMap,BQ={})}},C2r=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=A2r(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live], script"))),S2r(n,i,r,"aria-hidden")):function(){return null}},O2r=Object.defineProperty,k2r=(t,e)=>O2r(t,"name",{value:e,configurable:!0});function CXe(t){const[e,r]=se.useState(void 0);return Fp(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let s,o;if("borderBoxSize"in a){const l=a.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,o=u.blockSize}else s=t.offsetWidth,o=t.offsetHeight;r({width:s,height:o})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}k2r(CXe,"useSize");const E2r=["top","right","bottom","left"],jb=Math.min,Uv=Math.max,$Q=Math.round,FQ=Math.floor,Vv=t=>({x:t,y:t}),_2r={left:"right",right:"left",bottom:"top",top:"bottom"};function OXe(t,e,r){return Uv(t,jb(e,r))}function Qv(t,e){return typeof t=="function"?t(e):t}function Xb(t){return t.split("-")[0]}function RE(t){return t.split("-")[1]}function uue(t){return t==="x"?"y":"x"}function hue(t){return t==="y"?"height":"width"}function im(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function due(t){return uue(im(t))}function R2r(t,e,r){r===void 0&&(r=!1);const n=RE(t),i=due(t),a=hue(i);let s=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(s=zQ(s)),[s,zQ(s)]}function D2r(t){const e=zQ(t);return[fue(t),e,fue(e)]}function fue(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const kXe=["left","right"],EXe=["right","left"],L2r=["top","bottom"],M2r=["bottom","top"];function I2r(t,e,r){switch(t){case"top":case"bottom":return r?e?EXe:kXe:e?kXe:EXe;case"left":case"right":return e?L2r:M2r;default:return[]}}function P2r(t,e,r,n){const i=RE(t);let a=I2r(Xb(t),r==="start",n);return i&&(a=a.map(s=>s+"-"+i),e&&(a=a.concat(a.map(fue)))),a}function zQ(t){const e=Xb(t);return _2r[e]+t.slice(e.length)}function N2r(t){var e,r,n,i;return{top:(e=t.top)!=null?e:0,right:(r=t.right)!=null?r:0,bottom:(n=t.bottom)!=null?n:0,left:(i=t.left)!=null?i:0}}function _Xe(t){return typeof t!="number"?N2r(t):{top:t,right:t,bottom:t,left:t}}function UQ(t){const{x:e,y:r,width:n,height:i}=t;return{width:n,height:i,top:r,left:e,right:e+n,bottom:r+i,x:e,y:r}}function RXe(t,e,r){let{reference:n,floating:i}=t;const a=im(e),s=due(e),o=hue(s),l=Xb(e),u=a==="y",h=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,f=n[o]/2-i[o]/2;let p;switch(l){case"top":p={x:h,y:n.y-i.height};break;case"bottom":p={x:h,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-i.width,y:d};break;default:p={x:n.x,y:n.y}}const g=RE(e);return g&&(p[s]+=f*(g==="end"?1:-1)*(r&&u?-1:1)),p}async function B2r(t,e){var r;e===void 0&&(e={});const{x:n,y:i,platform:a,rects:s,elements:o,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Qv(e,t),g=_Xe(p),v=o[f?d==="floating"?"reference":"floating":d],y=UQ(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(v)))==null||r?v:v.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(o.floating)),boundary:u,rootBoundary:h,strategy:l})),b=d==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,x=await(a.getOffsetParent==null?void 0:a.getOffsetParent(o.floating)),w=await(a.isElement==null?void 0:a.isElement(x))&&await(a.getScale==null?void 0:a.getScale(x))||{x:1,y:1},A=UQ(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:b,offsetParent:x,strategy:l}):b);return{top:(y.top-A.top+g.top)/w.y,bottom:(A.bottom-y.bottom+g.bottom)/w.y,left:(y.left-A.left+g.left)/w.x,right:(A.right-y.right+g.right)/w.x}}const $2r=50,F2r=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:a=[],platform:s}=r,o=s.detectOverflow?s:{...s,detectOverflow:B2r},l=await(s.isRTL==null?void 0:s.isRTL(e));let u=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:h,y:d}=RXe(u,n,l),f=n,p=0;const g={};for(let m=0;m({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:a,platform:s,elements:o,middlewareData:l}=e,{element:u,padding:h=0}=Qv(t,e)||{};if(u==null)return{};const d=_Xe(h),f={x:r,y:n},p=due(i),g=hue(p),m=await s.getDimensions(u),v=p==="y",y=v?"top":"left",b=v?"bottom":"right",x=v?"clientHeight":"clientWidth",w=a.reference[g]+a.reference[p]-f[p]-a.floating[g],A=f[p]-a.reference[p],T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let S=T?T[x]:0;(!S||!await(s.isElement==null?void 0:s.isElement(T)))&&(S=o.floating[x]||a.floating[g]);const O=w/2-A/2,k=S/2-m[g]/2-1,E=jb(d[y],k),_=jb(d[b],k),I=S-m[g]-_,L=S/2-m[g]/2+O,R=OXe(E,L,I),D=!l.arrow&&RE(i)!=null&&L!==R&&a.reference[g]/2-(LR<=0)){var _,I;const R=(((_=a.flip)==null?void 0:_.index)||0)+1,D=S[R];if(D&&(!(d==="alignment"?b!==im(D):!1)||E.every(N=>im(N.placement)===b?N.overflows[0]>0:!0)))return{data:{index:R,overflows:E},reset:{placement:D}};let M=(I=E.filter(P=>P.overflows[0]<=0).sort((P,N)=>P.overflows[1]-N.overflows[1])[0])==null?void 0:I.placement;if(!M)switch(p){case"bestFit":{var L;const P=(L=E.filter(N=>{if(T){const F=im(N.placement);return F===b||F==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(F=>F>0).reduce((F,B)=>F+B,0)]).sort((N,F)=>N[1]-F[1])[0])==null?void 0:L[0];P&&(M=P);break}case"initialPlacement":M=o;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function DXe(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function LXe(t){return E2r.some(e=>t[e]>=0)}const V2r=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r,platform:n}=e,{strategy:i="referenceHidden",...a}=Qv(t,e);switch(i){case"referenceHidden":{const s=await n.detectOverflow(e,{...a,elementContext:"reference"}),o=DXe(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:LXe(o)}}}case"escaped":{const s=await n.detectOverflow(e,{...a,altBoundary:!0}),o=DXe(s,r.floating);return{data:{escapedOffsets:o,escaped:LXe(o)}}}default:return{}}}}},MXe=new Set(["left","top"]);async function Q2r(t,e){const{placement:r,platform:n,elements:i}=t,a=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=Xb(r),o=RE(r),l=im(r)==="y",u=MXe.has(s)?-1:1,h=a&&l?-1:1,d=Qv(e,t);let{mainAxis:f,crossAxis:p,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return o&&typeof g=="number"&&(p=o==="end"?g*-1:g),l?{x:p*h,y:f*u}:{x:f*u,y:p*h}}const G2r=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:i,y:a,placement:s,middlewareData:o}=e,l=await Q2r(e,t);return s===((r=o.offset)==null?void 0:r.placement)&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:s}}}}},H2r=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i,platform:a}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:l={fn:b=>{let{x,y:w}=b;return{x,y:w}}},...u}=Qv(t,e),h={x:r,y:n},d=await a.detectOverflow(e,u),f=im(i),p=uue(f);let g=h[p],m=h[f];const v=(b,x)=>OXe(x+d[b==="y"?"top":"left"],x,x-d[b==="y"?"bottom":"right"]);s&&(g=v(p,g)),o&&(m=v(f,m));const y=l.fn({...e,[p]:g,[f]:m});return{...y,data:{x:y.x-r,y:y.y-n,enabled:{[p]:s,[f]:o}}}}}},W2r=function(t){return t===void 0&&(t={}),{options:t,fn(e){var r,n;const{x:i,y:a,placement:s,rects:o,middlewareData:l}=e,{offset:u=0,mainAxis:h=!0,crossAxis:d=!0}=Qv(t,e),f={x:i,y:a},p=im(s),g=uue(p);let m=f[g],v=f[p];const y=Qv(u,e),b=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:(r=y.mainAxis)!=null?r:0,crossAxis:(n=y.crossAxis)!=null?n:0};if(h){const A=g==="y"?"height":"width",T=o.reference[g]-o.floating[A]+b.mainAxis,S=o.reference[g]+o.reference[A]-b.mainAxis;mS&&(m=S)}if(d){var x,w;const A=g==="y"?"width":"height",T=MXe.has(Xb(s)),S=o.reference[p]-o.floating[A]+(T&&((x=l.offset)==null?void 0:x[p])||0)+(T?0:b.crossAxis),O=o.reference[p]+o.reference[A]+(T?0:((w=l.offset)==null?void 0:w[p])||0)-(T?b.crossAxis:0);vO&&(v=O)}return{[g]:m,[p]:v}}}},Y2r=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:r,rects:n,platform:i,elements:a}=e,{apply:s=()=>{},...o}=Qv(t,e),l=await i.detectOverflow(e,o),u=Xb(r),h=RE(r),d=im(r)==="y",{width:f,height:p}=n.floating;let g,m;u==="top"||u==="bottom"?(g=u,m=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(m=u,g=h==="end"?"top":"bottom");const v=p-l.top-l.bottom,y=f-l.left-l.right,b=jb(p-l[g],v),x=jb(f-l[m],y),w=e.middlewareData.shift,A=!w;let T=b,S=x;w!=null&&w.enabled.x&&(S=y),w!=null&&w.enabled.y&&(T=v),A&&!h&&(d?S=f-2*Uv(l.left,l.right):T=p-2*Uv(l.top,l.bottom)),await s({...e,availableWidth:S,availableHeight:T});const O=await i.getDimensions(a.floating);return f!==O.width||p!==O.height?{reset:{rects:!0}}:{}}}};function VQ(){return typeof window<"u"}function DE(t){return IXe(t)?(t.nodeName||"").toLowerCase():"#document"}function Ic(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Gv(t){var e;return(e=(IXe(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function IXe(t){return VQ()?t instanceof Node||t instanceof Ic(t).Node:!1}function am(t){return VQ()?t instanceof Element||t instanceof Ic(t).Element:!1}function sm(t){return VQ()?t instanceof HTMLElement||t instanceof Ic(t).HTMLElement:!1}function PXe(t){return!VQ()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ic(t).ShadowRoot}function QQ(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=om(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&i!=="inline"&&i!=="contents"}function q2r(t){return/^(table|td|th)$/.test(DE(t))}function GQ(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const j2r=/transform|translate|scale|rotate|perspective|filter/,X2r=/paint|layout|strict|content/,gA=t=>!!t&&t!=="none";let pue;function gue(t){const e=am(t)?om(t):t;return gA(e.transform)||gA(e.translate)||gA(e.scale)||gA(e.rotate)||gA(e.perspective)||!mue()&&(gA(e.backdropFilter)||gA(e.filter))||j2r.test(e.willChange||"")||X2r.test(e.contain||"")}function K2r(t){let e=mA(t);for(;sm(e)&&!q6(e);){if(gue(e))return e;if(GQ(e))return null;e=mA(e)}return null}function mue(){return pue==null&&(pue=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),pue}function q6(t){return/^(html|body|#document)$/.test(DE(t))}function om(t){return Ic(t).getComputedStyle(t)}function HQ(t){return am(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function mA(t){if(DE(t)==="html")return t;const e=t.assignedSlot||t.parentNode||PXe(t)&&t.host||Gv(t);return PXe(e)?e.host:e}function NXe(t){const e=mA(t);return q6(e)?(t.ownerDocument||t).body:sm(e)&&QQ(e)?e:NXe(e)}function j6(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=NXe(t),a=i===((n=t.ownerDocument)==null?void 0:n.body),s=Ic(i);if(a){const o=vue(s);return e.concat(s,s.visualViewport||[],QQ(i)?i:[],o&&r?j6(o):[])}else return e.concat(i,j6(i,[],r))}function vue(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function BXe(t){const e=om(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=sm(t),a=i?t.offsetWidth:r,s=i?t.offsetHeight:n,o=$Q(r)!==a||$Q(n)!==s;return o&&(r=a,n=s),{width:r,height:n,$:o}}function yue(t){return am(t)?t:t.contextElement}function LE(t){const e=yue(t);if(!sm(e))return Vv(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:a}=BXe(e);let s=(a?$Q(r.width):r.width)/n,o=(a?$Q(r.height):r.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!o||!Number.isFinite(o))&&(o=1),{x:s,y:o}}const Z2r=Vv(0);function $Xe(t){const e=Ic(t);return!mue()||!e.visualViewport?Z2r:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function J2r(t,e,r){return e===void 0&&(e=!1),!!r&&e&&r===Ic(t)}function vA(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),a=yue(t);let s=Vv(1);e&&(n?am(n)&&(s=LE(n)):s=LE(t));const o=J2r(a,r,n)?$Xe(a):Vv(0);let l=(i.left+o.x)/s.x,u=(i.top+o.y)/s.y,h=i.width/s.x,d=i.height/s.y;if(a&&n){const f=Ic(a),p=am(n)?Ic(n):n;let g=f,m=vue(g);for(;m&&p!==g;){const v=LE(m),y=m.getBoundingClientRect(),b=om(m),x=y.left+(m.clientLeft+parseFloat(b.paddingLeft))*v.x,w=y.top+(m.clientTop+parseFloat(b.paddingTop))*v.y;l*=v.x,u*=v.y,h*=v.x,d*=v.y,l+=x,u+=w,g=Ic(m),m=vue(g)}}return UQ({width:h,height:d,x:l,y:u})}function WQ(t,e){const r=HQ(t).scrollLeft;return e?e.left+r:vA(Gv(t)).left+r}function FXe(t,e){const r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-WQ(t,r),i=r.top+e.scrollTop;return{x:n,y:i}}function ewr(t){let{elements:e,rect:r,offsetParent:n,strategy:i}=t;const a=i==="fixed",s=Gv(n),o=e?GQ(e.floating):!1;if(n===s||o&&a)return r;let l={scrollLeft:0,scrollTop:0},u=Vv(1);const h=Vv(0),d=sm(n);if((d||!a)&&((DE(n)!=="body"||QQ(s))&&(l=HQ(n)),d)){const p=vA(n);u=LE(n),h.x=p.x+n.clientLeft,h.y=p.y+n.clientTop}const f=s&&!d&&!a?FXe(s,l):Vv(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+h.x+f.x,y:r.y*u.y-l.scrollTop*u.y+h.y+f.y}}function twr(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function rwr(t){const e=HQ(t),r=t.ownerDocument.body,n=Uv(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Uv(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-e.scrollLeft+WQ(t);const s=-e.scrollTop;return om(r).direction==="rtl"&&(a+=Uv(t.clientWidth,r.clientWidth)-n),{width:n,height:i,x:a,y:s}}const nwr=25;function iwr(t,e,r){r===void 0&&(r="viewport");const n=r==="layoutViewport",i=Ic(t),a=Gv(t),s=i.visualViewport;let o=a.clientWidth,l=a.clientHeight,u=0,h=0;if(s){const f=!mue()||e==="fixed";n?f||(u=-s.offsetLeft,h=-s.offsetTop):(o=s.width,l=s.height,f&&(u=s.offsetLeft,h=s.offsetTop))}if(WQ(a)<=0){const f=a.ownerDocument,p=f.body,g=getComputedStyle(p),m=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,v=Math.abs(a.clientWidth-p.clientWidth-m),y=getComputedStyle(a).scrollbarGutter==="stable both-edges"?v/2:v;y<=nwr&&(o-=y)}return{width:o,height:l,x:u,y:h}}function awr(t,e){const r=vA(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,a=LE(t),s=t.clientWidth*a.x,o=t.clientHeight*a.y,l=i*a.x,u=n*a.y;return{width:s,height:o,x:l,y:u}}function zXe(t,e,r){let n;if(e==="viewport"||e==="layoutViewport")n=iwr(t,r,e);else if(e==="document")n=rwr(Gv(t));else if(am(e))n=awr(e,r);else{const i=$Xe(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return UQ(n)}function swr(t,e){const r=e.get(t);if(r)return r;let n=j6(t,[],!1).filter(o=>am(o)&&DE(o)!=="body"),i=null;const a=om(t).position==="fixed";let s=a?mA(t):t;for(;am(s)&&!q6(s);){const o=om(s),l=gue(s),u=i?i.position:a?"fixed":"";!l&&(u==="fixed"||u==="absolute"&&o.position==="static")?n=n.filter(d=>d!==s):i=o,s=mA(s)}return e.set(t,n),n}function owr(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const s=[...r==="clippingAncestors"?GQ(e)?[]:swr(e,this._c):[].concat(r),n],o=zXe(e,s[0],i);let l=o.top,u=o.right,h=o.bottom,d=o.left;for(let f=1;f{o(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(O,{...T,root:a.ownerDocument})}catch{n=new IntersectionObserver(O,T)}n.observe(t)}const l=Ic(t),u=()=>o(r);return l.addEventListener("resize",u),o(!0),()=>{l.removeEventListener("resize",u),s()}}function pwr(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=yue(t),h=i||a?[...u?j6(u):[],...e?j6(e):[]]:[];h.forEach(y=>{i&&y.addEventListener("scroll",r),a&&y.addEventListener("resize",r)});const d=u&&o?fwr(u,r,a):null;let f=-1,p=null;s&&(p=new ResizeObserver(y=>{let[b]=y;b&&b.target===u&&p&&e&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(e)})),r()}),u&&!l&&p.observe(u),e&&p.observe(e));let g,m=l?vA(t):null;l&&v();function v(){const y=vA(t);m&&!QXe(m,y)&&r(),m=y,g=requestAnimationFrame(v)}return r(),()=>{var y;h.forEach(b=>{i&&b.removeEventListener("scroll",r),a&&b.removeEventListener("resize",r)}),d==null||d(),(y=p)==null||y.disconnect(),p=null,l&&cancelAnimationFrame(g)}}const gwr=G2r,mwr=H2r,vwr=U2r,ywr=Y2r,bwr=V2r,GXe=z2r,xwr=W2r,wwr=(t,e,r)=>{const n=new Map,i=r??{},a={...dwr,...i.platform,_c:n};return F2r(t,e,{...i,platform:a})};var Awr=typeof document<"u",Twr=function(){},YQ=Awr?se.useLayoutEffect:Twr;function qQ(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!qQ(t[n],e[n]))return!1;return!0}if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const a=i[n];if(!(a==="_owner"&&t.$$typeof)&&!qQ(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}function HXe(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function WXe(t,e){const r=HXe(t);return Math.round(e*r)/r}function xue(t){const e=se.useRef(t);return YQ(()=>{e.current=t}),e}function Swr(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:a,floating:s}={},transform:o=!0,whileElementsMounted:l,open:u}=t,[h,d]=se.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[f,p]=se.useState(n);qQ(f,n)||p(n);const[g,m]=se.useState(null),[v,y]=se.useState(null),b=se.useCallback(N=>{N!==T.current&&(T.current=N,m(N))},[]),x=se.useCallback(N=>{N!==S.current&&(S.current=N,y(N))},[]),w=a||g,A=s||v,T=se.useRef(null),S=se.useRef(null),O=se.useRef(h),k=l!=null,E=xue(l),_=xue(i),I=xue(u),L=se.useCallback(()=>{if(!T.current||!S.current)return;const N={placement:e,strategy:r,middleware:f};_.current&&(N.platform=_.current),wwr(T.current,S.current,N).then(F=>{const B={...F,isPositioned:I.current!==!1};R.current&&!qQ(O.current,B)&&(O.current=B,ak.flushSync(()=>{d(B)}))})},[f,e,r,_,I]);YQ(()=>{u===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,d(N=>({...N,isPositioned:!1})))},[u]);const R=se.useRef(!1);YQ(()=>(R.current=!0,()=>{R.current=!1}),[]),YQ(()=>{if(w&&(T.current=w),A&&(S.current=A),w&&A){if(E.current)return E.current(w,A,L);L()}},[w,A,L,E,k]);const D=se.useMemo(()=>({reference:T,floating:S,setReference:b,setFloating:x}),[b,x]),M=se.useMemo(()=>({reference:w,floating:A}),[w,A]),P=se.useMemo(()=>{const N={position:r,left:0,top:0};if(!M.floating)return N;const F=WXe(M.floating,h.x),B=WXe(M.floating,h.y);return o?{...N,transform:"translate("+F+"px, "+B+"px)",...HXe(M.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:F,top:B}},[r,o,M.floating,h.x,h.y]);return se.useMemo(()=>({...h,update:L,refs:D,elements:M,floatingStyles:P}),[h,L,D,M,P])}const Cwr=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:i}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?GXe({element:n.current,padding:i}).fn(r):{}:n?GXe({element:n,padding:i}).fn(r):{}}}},Owr=(t,e)=>{const r=gwr(t);return{name:r.name,fn:r.fn,options:[t,e]}},kwr=(t,e)=>{const r=mwr(t);return{name:r.name,fn:r.fn,options:[t,e]}},Ewr=(t,e)=>({fn:xwr(t).fn,options:[t,e]}),_wr=(t,e)=>{const r=vwr(t);return{name:r.name,fn:r.fn,options:[t,e]}},Rwr=(t,e)=>{const r=ywr(t);return{name:r.name,fn:r.fn,options:[t,e]}},Dwr=(t,e)=>{const r=bwr(t);return{name:r.name,fn:r.fn,options:[t,e]}},Lwr=(t,e)=>{const r=Cwr(t);return{name:r.name,fn:r.fn,options:[t,e]}};var Mwr=Object.defineProperty,Kb=(t,e)=>Mwr(t,"name",{value:e,configurable:!0}),YXe="Popper",[qXe,jXe]=pA(YXe),[Iwr,XXe]=qXe(YXe),Pwr=Kb(t=>{const{__scopePopper:e,children:r}=t,[n,i]=se.useState(null),[a,s]=se.useState(void 0);return W.jsx(Iwr,{scope:e,anchor:n,onAnchorChange:i,placementState:a,setPlacementState:s,children:r})},"Popper"),Nwr="PopperAnchor",Bwr=se.forwardRef(Kb(function(e,r){const{__scopePopper:n,virtualRef:i,...a}=e,s=XXe(Nwr,n),o=se.useRef(null),l=s.onAnchorChange,u=se.useCallback(m=>{o.current=m,m&&l(m)},[l]),h=Th(r,u),d=se.useRef(null);se.useEffect(()=>{if(!i)return;const m=d.current;d.current=i.current,m!==d.current&&l(d.current)});const f=s.placementState&&jQ(s.placementState),p=f==null?void 0:f[0],g=f==null?void 0:f[1];return i?null:W.jsx($p.div,{"data-radix-popper-side":p,"data-radix-popper-align":g,...a,ref:h})},"PopperAnchor")),KXe="PopperContent",[$wr,lni]=qXe(KXe),Fwr=se.forwardRef(Kb(function(e,r){var q,Z,ee,re,ve,ae,Ce;const{__scopePopper:n,side:i="bottom",sideOffset:a=0,align:s="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:h=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:g="optimized",onPlaced:m,...v}=e,y=XXe(KXe,n),[b,x]=se.useState(null),w=Th(r,x),[A,T]=se.useState(null),S=CXe(A),O=(S==null?void 0:S.width)??0,k=(S==null?void 0:S.height)??0,E=i+(s!=="center"?"-"+s:""),_=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},I=Array.isArray(h)?h:[h],L=I.length>0,R={padding:_,boundary:I.filter(ZXe),altBoundary:L},{refs:D,floatingStyles:M,placement:P,isPositioned:N,middlewareData:F}=Swr({strategy:"fixed",placement:E,whileElementsMounted:Kb((...Oe)=>pwr(...Oe,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:y.anchor},middleware:[Owr({mainAxis:a+k,alignmentAxis:o}),u&&kwr({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Ewr():void 0,...R}),u&&_wr({...R}),Rwr({...R,apply:Kb(({elements:Oe,rects:$e,availableWidth:he,availableHeight:fe})=>{const{width:Te,height:ge}=$e.reference,Qe=Oe.floating.style;Qe.setProperty("--radix-popper-available-width",`${he}px`),Qe.setProperty("--radix-popper-available-height",`${fe}px`),Qe.setProperty("--radix-popper-anchor-width",`${Te}px`),Qe.setProperty("--radix-popper-anchor-height",`${ge}px`)},"apply")}),A&&Lwr({element:A,padding:l}),zwr({arrowWidth:O,arrowHeight:k}),p&&Dwr({strategy:"referenceHidden",...R,boundary:L?R.boundary:void 0})]}),B=y.setPlacementState;Fp(()=>(B(P),()=>{B(void 0)}),[P,B]);const[V,z]=jQ(P),U=qb(m);Fp(()=>{N&&(U==null||U())},[N,U]);const Q=(q=F.arrow)==null?void 0:q.x,G=(Z=F.arrow)==null?void 0:Z.y,X=((ee=F.arrow)==null?void 0:ee.centerOffset)!==0,[Y,le]=se.useState();return Fp(()=>{b&&le(window.getComputedStyle(b).zIndex)},[b]),W.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:N?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[(re=F.transformOrigin)==null?void 0:re.x,(ve=F.transformOrigin)==null?void 0:ve.y].join(" "),...((ae=F.hide)==null?void 0:ae.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:W.jsx($wr,{scope:n,placedSide:V,placedAlign:z,onArrowChange:T,arrowX:Q,arrowY:G,shouldHideArrow:X,children:W.jsx($p.div,{"data-side":V,"data-align":z,...v,ref:w,style:{...v.style,animation:N?(Ce=v.style)==null?void 0:Ce.animation:"none"}})})})},"PopperContent"));function ZXe(t){return t!==null}Kb(ZXe,"isNotNull");var zwr=Kb(t=>({name:"transformOrigin",options:t,fn(e){var v,y,b;const{placement:r,rects:n,middlewareData:i}=e,s=((v=i.arrow)==null?void 0:v.centerOffset)!==0,o=s?0:t.arrowWidth,l=s?0:t.arrowHeight,[u,h]=jQ(r),d={start:"0%",center:"50%",end:"100%"}[h],f=(((y=i.arrow)==null?void 0:y.x)??0)+o/2,p=(((b=i.arrow)==null?void 0:b.y)??0)+l/2;let g="",m="";return u==="bottom"?(g=s?d:`${f}px`,m=`${-l}px`):u==="top"?(g=s?d:`${f}px`,m=`${n.floating.height+l}px`):u==="right"?(g=`${-l}px`,m=s?d:`${p}px`):u==="left"&&(g=`${n.floating.width+l}px`,m=s?d:`${p}px`),{data:{x:g,y:m}}}}),"transformOrigin");function jQ(t){const[e,r="center"]=t.split("-");return[e,r]}Kb(jQ,"getSideAndAlignFromPlacement");var Uwr=Pwr,Vwr=Bwr,Qwr=Fwr,Gwr=Object.defineProperty,wue=(t,e)=>Gwr(t,"name",{value:e,configurable:!0}),Aue=!1;function JXe(){const[t,e]=se.useState(Aue);return se.useEffect(()=>{Aue||(Aue=!0,e(!0))},[]),t}wue(JXe,"useIsHydrated");var eKe=Sw[" useSyncExternalStore ".trim().toString()];function tKe(){return()=>{}}wue(tKe,"subscribe");function rKe(){return eKe(tKe,()=>!0,()=>!1)}wue(rKe,"useIsHydratedModern");var Hwr=typeof eKe=="function"?rKe:JXe,Wwr=Object.defineProperty,yA=(t,e)=>Wwr(t,"name",{value:e,configurable:!0}),Tue="rovingFocusGroup.onEntryFocus",Ywr={bubbles:!1,cancelable:!0},XQ="RovingFocusGroup",[Sue,nKe,qwr]=Mje(XQ),[jwr,iKe]=pA(XQ,[qwr]),[Xwr,Kwr]=jwr(XQ),Zwr=se.forwardRef(yA(function(e,r){return W.jsx(Sue.Provider,{scope:e.__scopeRovingFocusGroup,children:W.jsx(Sue.Slot,{scope:e.__scopeRovingFocusGroup,children:W.jsx(Jwr,{...e,ref:r})})})},"RovingFocusGroup")),Jwr=se.forwardRef(yA(function(e,r){const{__scopeRovingFocusGroup:n,orientation:i,loop:a=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:h,preventScrollOnEntryFocus:d=!1,...f}=e,p=se.useRef(null),g=Th(r,p),m=Yce(s),[v,y]=SE({prop:o,defaultProp:l??null,onChange:u,caller:XQ}),[b,x]=se.useState(!1),w=qb(h),A=nKe(n),T=se.useRef(!1),[S,O]=se.useState(0);return se.useEffect(()=>{const k=p.current;if(k)return k.addEventListener(Tue,w),()=>k.removeEventListener(Tue,w)},[w]),W.jsx(Xwr,{scope:n,orientation:i,dir:m,loop:a,currentTabStopId:v,onItemFocus:se.useCallback(k=>y(k),[y]),onItemShiftTab:se.useCallback(()=>x(!0),[]),onFocusableItemAdd:se.useCallback(()=>O(k=>k+1),[]),onFocusableItemRemove:se.useCallback(()=>O(k=>k-1),[]),children:W.jsx($p.div,{tabIndex:b||S===0?-1:0,"data-orientation":i,...f,ref:g,style:{outline:"none",...e.style},onMouseDown:vu(e.onMouseDown,()=>{T.current=!0}),onFocus:vu(e.onFocus,k=>{const E=!T.current;if(k.target===k.currentTarget&&E&&!b){const _=new CustomEvent(Tue,Ywr);if(k.currentTarget.dispatchEvent(_),!_.defaultPrevented){const I=A().filter(P=>P.focusable),L=I.find(P=>P.active),R=I.find(P=>P.id===v),M=[L,R,...I].filter(Boolean).map(P=>P.ref.current);Cue(M,d)}}T.current=!1}),onBlur:vu(e.onBlur,()=>x(!1))})})},"RovingFocusGroupImpl")),eAr="RovingFocusGroupItem",tAr=se.forwardRef(yA(function(e,r){const{__scopeRovingFocusGroup:n,focusable:i=!0,active:a=!1,tabStopId:s,children:o,...l}=e,u=Wce(),h=s||u,d=Kwr(eAr,n),f=d.currentTabStopId===h,p=nKe(n),{onFocusableItemAdd:g,onFocusableItemRemove:m,currentTabStopId:v}=d,y=Hwr();return Fp(()=>{if(!(!y||!i))return g(),()=>m()},[y,i,g,m]),se.useEffect(()=>{if(!(y||!i))return g(),()=>m()},[y,i,g,m]),W.jsx(Sue.ItemSlot,{scope:n,id:h,focusable:i,active:a,children:W.jsx($p.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...l,ref:r,onMouseDown:vu(e.onMouseDown,b=>{i?d.onItemFocus(h):b.preventDefault()}),onFocus:vu(e.onFocus,()=>d.onItemFocus(h)),onKeyDown:vu(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){d.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const x=sKe(b,d.orientation,d.dir);if(x!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let A=p().filter(T=>T.focusable).map(T=>T.ref.current);if(x==="last")A.reverse();else if(x==="prev"||x==="next"){x==="prev"&&A.reverse();const T=A.indexOf(b.currentTarget);A=d.loop?oKe(A,T+1):A.slice(T+1)}setTimeout(()=>Cue(A))}}),children:typeof o=="function"?o({isCurrentTabStop:f,hasTabStop:v!=null}):o})})},"RovingFocusGroupItem")),rAr={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function aKe(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}yA(aKe,"getDirectionAwareKey");function sKe(t,e,r){const n=aKe(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return rAr[n]}yA(sKe,"getFocusIntent");function Cue(t,e=!1){const r=document.activeElement;for(const n of t)if(n===r||(n.focus({preventScroll:e}),document.activeElement!==r))return}yA(Cue,"focusFirst");function oKe(t,e){return t.map((r,n)=>t[(e+n)%t.length])}yA(oKe,"wrapArray");var nAr=Zwr,iAr=tAr,aAr=Object.defineProperty,Zb=(t,e)=>aAr(t,"name",{value:e,configurable:!0}),Oue="Popover",[lKe,cni]=pA(Oue,[jXe]),kue=jXe(),[sAr,ME]=lKe(Oue),oAr=Zb(t=>{const{__scopePopover:e,children:r,open:n,defaultOpen:i,onOpenChange:a,modal:s=!1}=t,o=kue(e),l=se.useRef(null),[u,h]=se.useState(!1),[d,f]=SE({prop:n,defaultProp:i??!1,onChange:a,caller:Oue});return W.jsx(Uwr,{...o,children:W.jsx(sAr,{scope:e,contentId:Wce(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:se.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:u,onCustomAnchorAdd:se.useCallback(()=>h(!0),[]),onCustomAnchorRemove:se.useCallback(()=>h(!1),[]),modal:s,children:r})})},"Popover"),lAr="PopoverTrigger",cAr=se.forwardRef(Zb(function(e,r){const{__scopePopover:n,...i}=e,a=ME(lAr,n),s=kue(n),o=Th(r,a.triggerRef),l=W.jsx($p.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":Eue(a.open),...i,ref:o,onClick:vu(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:W.jsx(Vwr,{asChild:!0,...s,children:l})},"PopoverTrigger")),cKe="PopoverPortal",[uAr,hAr]=lKe(cKe,{forceMount:void 0}),dAr=Zb(t=>{const{__scopePopover:e,forceMount:r,children:n,container:i}=t,a=ME(cKe,e);return W.jsx(uAr,{scope:e,forceMount:r,children:W.jsx(jje,{present:r||a.open,children:W.jsx(Bxr,{asChild:!0,container:i,children:n})})})},"PopoverPortal"),X6="PopoverContent",fAr=se.forwardRef(Zb(function(e,r){const n=hAr(X6,e.__scopePopover),{forceMount:i=n.forceMount,...a}=e,s=ME(X6,e.__scopePopover);return W.jsx(jje,{present:i||s.open,children:s.modal?W.jsx(gAr,{...a,ref:r}):W.jsx(mAr,{...a,ref:r})})},"PopoverContent")),pAr=fA("PopoverContent.RemoveScroll"),gAr=se.forwardRef(Zb(function(e,r){const n=ME(X6,e.__scopePopover),i=se.useRef(null),a=Th(r,i),s=se.useRef(!1);return se.useEffect(()=>{const o=i.current;if(o)return C2r(o)},[]),W.jsx(TXe,{as:pAr,allowPinchZoom:!0,children:W.jsx(uKe,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:vu(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),s.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:vu(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,h=l.button===2||u;s.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:vu(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),mAr=se.forwardRef(Zb(function(e,r){const n=ME(X6,e.__scopePopover),i=se.useRef(!1),a=se.useRef(!1);return W.jsx(uKe,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,s),s.defaultPrevented||(i.current||(l=n.triggerRef.current)==null||l.focus(),s.preventDefault()),i.current=!1,a.current=!1},onInteractOutside:s=>{var u,h;(u=e.onInteractOutside)==null||u.call(e,s),s.defaultPrevented||(i.current=!0,s.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=s.target;((h=n.triggerRef.current)==null?void 0:h.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&a.current&&s.preventDefault()}})},"PopoverContentNonModal")),uKe=se.forwardRef(Zb(function(e,r){const{__scopePopover:n,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:h,onInteractOutside:d,...f}=e,p=ME(X6,n),g=kue(n);return nue(),W.jsx(Ixr,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:a,onUnmountAutoFocus:s,children:W.jsx(Rxr,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:h,onDismiss:()=>p.onOpenChange(!1),deferPointerDownOutside:!0,children:W.jsx(Qwr,{"data-state":Eue(p.open),role:"dialog",id:p.contentId,...g,...f,ref:r,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl"));function Eue(t){return t?"open":"closed"}Zb(Eue,"getState");var vAr=oAr,yAr=cAr,bAr=dAr,xAr=fAr,wAr=Object.defineProperty,AAr=(t,e)=>wAr(t,"name",{value:e,configurable:!0}),TAr="Toggle",SAr=se.forwardRef(AAr(function(e,r){const{pressed:n,defaultPressed:i,onPressedChange:a,...s}=e,[o,l]=SE({prop:n,onChange:a,defaultProp:i??!1,caller:TAr});return W.jsx($p.button,{type:"button","aria-pressed":o,"data-state":o?"on":"off","data-disabled":e.disabled?"":void 0,...s,ref:r,onClick:vu(e.onClick,()=>{e.disabled||l(!o)})})},"Toggle")),CAr=Object.defineProperty,Jb=(t,e)=>CAr(t,"name",{value:e,configurable:!0}),IE="ToggleGroup",[hKe,uni]=pA(IE,[iKe]),dKe=iKe(),OAr=se.forwardRef(Jb(function(e,r){const{type:n,...i}=e;if(n==="single"){const a=i;return W.jsx(kAr,{role:"radiogroup",...a,ref:r})}if(n==="multiple"){const a=i;return W.jsx(EAr,{role:"toolbar",...a,ref:r})}throw new Error(`Missing prop \`type\` expected on \`${IE}\``)},"ToggleGroup")),[fKe,pKe]=hKe(IE),kAr=se.forwardRef(Jb(function(e,r){const{value:n,defaultValue:i,onValueChange:a=Jb(()=>{},"onValueChange"),...s}=e,[o,l]=SE({prop:n,defaultProp:i??"",onChange:a,caller:IE});return W.jsx(fKe,{scope:e.__scopeToggleGroup,type:"single",value:se.useMemo(()=>o?[o]:[],[o]),onItemActivate:l,onItemDeactivate:se.useCallback(()=>l(""),[l]),children:W.jsx(gKe,{...s,ref:r})})},"ToggleGroupImplSingle")),EAr=se.forwardRef(Jb(function(e,r){const{value:n,defaultValue:i,onValueChange:a=Jb(()=>{},"onValueChange"),...s}=e,[o,l]=SE({prop:n,defaultProp:i??[],onChange:a,caller:IE}),u=se.useCallback(d=>l((f=[])=>[...f,d]),[l]),h=se.useCallback(d=>l((f=[])=>f.filter(p=>p!==d)),[l]);return W.jsx(fKe,{scope:e.__scopeToggleGroup,type:"multiple",value:o,onItemActivate:u,onItemDeactivate:h,children:W.jsx(gKe,{...s,ref:r})})},"ToggleGroupImplMultiple")),[_Ar,RAr]=hKe(IE),gKe=se.forwardRef(Jb(function(e,r){const{__scopeToggleGroup:n,disabled:i=!1,rovingFocus:a=!0,orientation:s,dir:o,loop:l=!0,...u}=e,h=dKe(n),d=Yce(o),f={dir:d,...u};return W.jsx(_Ar,{scope:n,rovingFocus:a,disabled:i,children:a?W.jsx(nAr,{asChild:!0,...h,orientation:s,dir:d,loop:l,children:W.jsx($p.div,{...f,ref:r})}):W.jsx($p.div,{...f,ref:r})})},"ToggleGroupImpl")),_ue="ToggleGroupItem",DAr=se.forwardRef(Jb(function(e,r){const n=pKe(_ue,e.__scopeToggleGroup),i=RAr(_ue,e.__scopeToggleGroup),a=dKe(e.__scopeToggleGroup),s=n.value.includes(e.value),o=i.disabled||e.disabled,l={...e,pressed:s,disabled:o},u=se.useRef(null);return i.rovingFocus?W.jsx(iAr,{asChild:!0,...a,focusable:!o,active:s,ref:u,children:W.jsx(mKe,{...l,ref:r})}):W.jsx(mKe,{...l,ref:r})},"ToggleGroupItem")),mKe=se.forwardRef(Jb(function(e,r){const{__scopeToggleGroup:n,value:i,...a}=e,s=pKe(_ue,n),o={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},l=s.type==="single"?o:void 0;return W.jsx(SAr,{...l,...a,ref:r,onPressedChange:u=>{u?s.onItemActivate(i):s.onItemDeactivate(i)}})},"ToggleGroupItemImpl")),LAr=typeof xi=="object"&&xi&&xi.Object===Object&&xi,MAr=typeof self=="object"&&self&&self.Object===Object&&self;LAr||MAr||Function("return this")();var IAr=typeof window<"u"?se.useLayoutEffect:se.useEffect;function PAr(){const t=se.useRef(!1);return se.useEffect(()=>(t.current=!0,()=>{t.current=!1}),[]),se.useCallback(()=>t.current,[])}var vKe={width:void 0,height:void 0};function NAr(t){const{ref:e,box:r="content-box"}=t,[{width:n,height:i},a]=se.useState(vKe),s=PAr(),o=se.useRef({...vKe}),l=se.useRef(void 0);return l.current=t.onResize,se.useEffect(()=>{if(!e.current||typeof window>"u"||!("ResizeObserver"in window))return;const u=new ResizeObserver(([h])=>{const d=r==="border-box"?"borderBoxSize":r==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",f=yKe(h,d,"inlineSize"),p=yKe(h,d,"blockSize");if(o.current.width!==f||o.current.height!==p){const m={width:f,height:p};o.current.width=f,o.current.height=p,l.current?l.current(m):s()&&a(m)}});return u.observe(e.current,{box:r}),()=>{u.disconnect()}},[r,e,s]),{width:n,height:i}}function yKe(t,e,r){return t[e]?Array.isArray(t[e])?t[e][0][r]:t[e][r]:e==="contentBoxSize"?t.contentRect[r==="inlineSize"?"width":"height"]:void 0}function bKe(t,e){const r=se.useRef(t);IAr(()=>{r.current=t},[t]),se.useEffect(()=>{if(!e&&e!==0)return;const n=setTimeout(()=>{r.current()},e);return()=>{clearTimeout(n)}},[e])}const BAr={DEV:!1,MODE:"production"},PE=typeof{url:Va&&Va.tagName.toUpperCase()==="SCRIPT"&&Va.src||new URL("website-integration.js",document.baseURI).href}<"u"?BAr:void 0,$Ar=!!(PE!=null&&PE.DEV),FAr=typeof navigator<"u"&&/(jsdom|happy-dom)/i.test(navigator.userAgent)||typeof globalThis.happyDOM=="object",xKe=(PE==null?void 0:PE.MODE)==="test"||FAr,zAr=typeof window<"u",wKe=typeof document<"u",UAr=zAr&&wKe,AKe=t=>{const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const r=e.offsetWidth;let n=.985;r<=80?n=.96:r<=150?n=.97:r<=220?n=.98:r>600&&(n=.995),e.style.setProperty("--scale",n.toString())},Rue=(t,e)=>{const r=()=>{const s=setTimeout(t);return()=>{clearTimeout(s)}};if(!UAr||typeof window.requestAnimationFrame!="function"||wKe&&document.visibilityState==="hidden")return r();let i=2,a=window.requestAnimationFrame(function s(){i-=1,i===0?t():a=window.requestAnimationFrame(s)});return()=>{typeof window.cancelAnimationFrame=="function"&&window.cancelAnimationFrame(a)}},TKe=t=>Object.keys(t).reduce((r,n)=>{const i=t[n];if(i||i===0){const a=n.startsWith("--")?"":"--",s=typeof i=="number"?`${i}px`:i;r[`${a}${n}`]=s}return r},{}),Due=t=>{t.preventDefault()},SKe=t=>t.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex^="-"]), [contenteditable]'),Lue={SegmentedControl:"_SegmentedControl_1sl7d_1",SegmentedControlOption:"_SegmentedControlOption_1sl7d_140",SegmentedControlThumb:"_SegmentedControlThumb_1sl7d_219"},KQ=({value:t,onChange:e,children:r,block:n,pill:i=!0,size:a="md",gutterSize:s,className:o,onClick:l,...u})=>{const h=se.useRef(null),d=se.useRef(null),f=se.useCallback(g=>{const m=h.current,v=d.current;if(!m||!v)return;const y=m==null?void 0:m.querySelector('[data-state="on"]');if(!y)return;const b=m.clientWidth;let x=Math.floor(y.clientWidth);const w=y.offsetLeft;if(b-(x+w)<2&&(x=x-1),v.style.width=`${Math.floor(x)}px`,v.style.transform=`translateX(${w}px)`,m.scrollWidth>b){const A=b*.15,T=m.scrollLeft,S=y.offsetLeft,O=S+x;(ST+b-A)&&g&&y.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"})}},[]);NAr({ref:h,onResize:()=>{const g=d.current;if(!g)return;const m=g.style.transition;g.style.transition="",f(!1),g.style.transition=m}}),se.useLayoutEffect(()=>{const g=h.current,m=d.current;!g||!m||(f(!!m.style.transition),m.style.transition||Rue(()=>{m.style.transition="width 300ms var(--cubic-enter), transform 300ms var(--cubic-enter)"}))},[f,t,a,s,i]);const p=g=>{g&&e&&e(g)};return W.jsxs(OAr,{ref:h,className:AE(Lue.SegmentedControl,o),type:"single",value:t,loop:!1,onValueChange:p,onClick:l,"data-block":n?"":void 0,"data-pill":i?"":void 0,"data-size":a,"data-gutter-size":s,...u,children:[W.jsx("div",{className:Lue.SegmentedControlThumb,ref:d}),r]})},VAr=({children:t,...e})=>W.jsx(DAr,{className:Lue.SegmentedControlOption,...e,onPointerEnter:AKe,children:W.jsx("span",{className:"relative",children:t})});KQ.Option=VAr;function QAr({children:t,label:e,language:r,source:n,streaming:i=!1}){const{t:a}=Ea("conversation"),[s,o]=se.useState("preview"),l=i?"code":s;return W.jsxs("section",{className:"visualization-card","aria-label":a("visualization.cardAria",{label:e}),children:[W.jsx("div",{className:"visualization-card__toolbar",children:W.jsxs(KQ,{className:"visualization-card__tabs",value:l,size:"sm",gutterSize:"sm",pill:!1,"aria-label":a("visualization.viewAria",{label:e}),onChange:u=>{i||o(u)},children:[W.jsx(KQ.Option,{value:"preview",disabled:i,children:a("visualization.preview")}),W.jsx(KQ.Option,{value:"code",children:a("visualization.code")})]})}),W.jsx("div",{className:"visualization-card__body",children:l==="code"?W.jsx("pre",{className:"visualization-card__code",children:W.jsx("code",{className:`language-${r}`,children:n})}):t})]})}const GAr=se.memo(QAr);function HAr(t){const e=t==null?void 0:t.trim().toLowerCase();if(e==="mermaid")return"mermaid";if(e==="echart"||e==="echarts")return"echarts"}const CKe=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function Mue(t){return typeof t=="string"||typeof t=="number"?String(t):Array.isArray(t)?t.map(Mue).join(""):se.isValidElement(t)?Mue(t.props.children):""}function WAr(t){var n;const e=se.Children.toArray(t)[0];if(!se.isValidElement(e))return;const r=(n=e.props.className)==null?void 0:n.split(/\s+/).find(i=>i.startsWith("language-"));return HAr(r==null?void 0:r.slice(9))}function OKe(t){if(!t)return!1;try{const e=t.toLowerCase();return CKe.some(r=>e.includes(r))}catch{return!1}}function YAr(t){var n;const e=(n=t==null?void 0:t.properties)==null?void 0:n.href;if(!e)return!1;if(OKe(e))return!0;const r=t==null?void 0:t.children;if(r&&Array.isArray(r)){const i=r.map(a=>(a==null?void 0:a.value)||"").join("").toLowerCase();return CKe.some(a=>i.includes(a))}return!1}function qAr({text:t,className:e,allowRawHtml:r=!0,streaming:n=!1}){const{t:i}=Ea("conversation"),[a,s]=se.useState(null),o=(h,d)=>{if(h.src)return h.src;if(d){const f=g=>{var m;if(!g)return null;if(g.type==="source"&&((m=g.properties)!=null&&m.src))return g.properties.src;if(g.children)for(const v of g.children){const y=f(v);if(y)return y}return null},p=f({children:d});if(p)return p}return""},l=h=>{try{const f=new URL(h).pathname.split("/");return f[f.length-1]||"video.mp4"}catch{return"video.mp4"}},u=h=>h?Array.isArray(h)?h.map(d=>(d==null?void 0:d.value)||"").join("")||"video":(h==null?void 0:h.value)||"video":"video";return W.jsxs("div",{className:e?`md ${e}`:"md",children:[W.jsx(mfr,{remarkPlugins:[Dgr],rehypePlugins:r?[wbr,bqe]:[bqe],components:{pre:({node:h,children:d,...f})=>{const p=WAr(d);if(p==="mermaid"||p==="echarts"){const g=Mue(d).replace(/\n$/,"");return W.jsx(GAr,{label:p==="mermaid"?"Mermaid":"ECharts",language:p,source:g,streaming:n,children:p==="mermaid"?W.jsx(jbr,{source:g}):W.jsx(Gbr,{source:g})})}return W.jsx("pre",{...f,children:d})},a:({node:h,...d})=>{const f=d.href;if(f&&(OKe(f)||YAr(h))){const p=f,g=u(h==null?void 0:h.children);return W.jsxs("div",{className:"video-container",children:[W.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":i("markdown.playVideo",{name:g}),onClick:()=>s({src:p,title:g}),children:[W.jsx("video",{src:p,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),W.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:W.jsx(wV,{})})]}),W.jsx("div",{className:"video-caption",children:W.jsx("a",{href:p,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:g})})]})}return W.jsx("a",{...d,target:"_blank",rel:"noopener noreferrer"})},img:({node:h,src:d,alt:f,...p})=>{const g=W.jsx("img",{...p,src:d,alt:f??"",loading:"lazy"});return d?W.jsx(QWe,{src:d,children:W.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":i("markdown.enlargeImage",{name:f||i("markdown.image")}),children:[g,W.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:W.jsx(wV,{})})]})}):g},video:({node:h,src:d,children:f,...p})=>{const g=o({src:d},f);return g?W.jsx("div",{className:"video-container",children:W.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":i("markdown.enlargeVideo"),onClick:()=>s({src:g}),children:[W.jsx("video",{src:g,...p,playsInline:!0,className:"video-thumbnail",children:f}),W.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:W.jsx(wV,{})})]})}):W.jsx("video",{src:d,controls:!0,playsInline:!0,className:"video-inline",...p,children:f})}},children:t}),a&&W.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":i("markdown.videoPreview"),onClick:()=>s(null),children:W.jsxs("div",{className:"video-viewer",onClick:h=>h.stopPropagation(),children:[W.jsxs("div",{className:"video-viewer-header",children:[W.jsx("div",{className:"video-viewer-title",children:a.title||l(a.src)}),W.jsxs("nav",{className:"video-viewer-nav",children:[W.jsx("a",{href:a.src,download:a.title||l(a.src),"aria-label":i("markdown.downloadVideo"),title:i("markdown.downloadVideo"),className:"video-viewer-download",children:W.jsx(loe,{})}),W.jsx("button",{type:"button",className:"video-viewer-close","aria-label":i("markdown.close"),onClick:()=>s(null),children:W.jsx(jk,{})})]})]}),W.jsx("div",{className:"video-viewer-body",children:W.jsx("video",{src:a.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const ZQ=se.memo(qAr);function jAr({value:t,skillPrefix:e="/",onRemoveSkill:r,onRemoveAgent:n}){const{t:i}=Ea("conversation");return t.skills.length===0&&!t.targetAgent?null:W.jsxs("div",{className:"invocation-chips","aria-label":i("invocation.ariaLabel"),children:[t.skills.map(a=>W.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:a.description,children:[W.jsx(hir,{"aria-hidden":!0}),W.jsxs("span",{children:[e,a.name]}),r?W.jsx("button",{type:"button",onClick:()=>r(a.name),"aria-label":i("invocation.removeSkill",{name:a.name}),children:W.jsx(jk,{})}):null]},a.name)),t.targetAgent?W.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:t.targetAgent.description,children:[W.jsx(iir,{"aria-hidden":!0}),W.jsx("span",{children:t.targetAgent.name}),n?W.jsx("button",{type:"button",onClick:n,"aria-label":i("invocation.removeAgent",{name:t.targetAgent.name}),children:W.jsx(jk,{})}):null]}):null]})}const kKe="veadk_auth_qs",XAr=new Set(["view","source","sessionId","artifactSha256","validationReportSha256","projectId","versionId"]);let K6=null;function KAr(){if(K6!==null)return K6;const t=new URLSearchParams(window.location.search),e=new URLSearchParams,r=new URLSearchParams,n=t.get("view")==="runtime-deploy"&&t.get("source")==="intelligent-development";t.forEach((a,s)=>{(n&&XAr.has(s)?r:e).append(s,a)});const i=e.toString();if(i?(sessionStorage.setItem(kKe,i),K6=i):K6=sessionStorage.getItem(kKe)??"",i){const a=r.toString();window.history.replaceState(null,"",window.location.pathname+(a?`?${a}`:"")+window.location.hash)}return K6}function ZAr(t){const e=KAr();if(!e)return t;const r=new URL(t,window.location.origin);return new URLSearchParams(e).forEach((n,i)=>{r.searchParams.has(i)||r.searchParams.set(i,n)}),/^https?:\/\//i.test(t)?r.toString():r.pathname+r.search+r.hash}const JAr="";function eTr(t){try{const e=new URL(t);if(e.protocol!=="veadk-media:"||e.hostname!=="apps")return;const r=e.pathname.split("/").filter(Boolean).map(decodeURIComponent);return r.length!==7||r[1]!=="users"||r[3]!=="sessions"||r[5]!=="media"?void 0:`/web/media/${r.map(encodeURIComponent).filter((n,i)=>![1,3,5].includes(i)).join("/")}`}catch{return}}function tTr(t,e){if(e.startsWith("data:")||e.startsWith("blob:")||/^https?:/.test(e))return e;const r=eTr(e);if(!r)return e;const n=`${r}/content`;return ZAr(`${JAr}${n}`)}function Iue(t=""){return t.startsWith("image/")?"image":t.startsWith("video/")?"video":t==="application/pdf"?"pdf":t==="text/markdown"?"markdown":"text"}function EKe(t){var r,n,i,a;const e=Iue(t.mimeType);return e==="pdf"?"PDF":e==="markdown"?"MD":e==="video"?((n=(r=t.mimeType)==null?void 0:r.split("/")[1])==null?void 0:n.toUpperCase())??"VIDEO":e==="image"?((a=(i=t.mimeType)==null?void 0:i.split("/")[1])==null?void 0:a.toUpperCase())??"IMAGE":"TXT"}function _Ke(t){return t?t<1024?`${t} B`:t<1024*1024?`${Math.round(t/1024)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`:""}function RKe(t,e){return t.previewUrl?t.previewUrl:t.data?`data:${t.mimeType??"application/octet-stream"};base64,${t.data}`:t.uri?tTr(e,t.uri):""}function rTr({kind:t}){return t==="image"?W.jsx(cir,{}):t==="video"?W.jsx(lir,{}):t==="pdf"?W.jsx(oir,{}):W.jsx(SVe,{})}function nTr({appName:t,items:e,compact:r=!1,onRemove:n}){const{t:i}=Ea("conversation"),[a,s]=se.useState(null);return W.jsxs(W.Fragment,{children:[W.jsx("div",{className:`media-grid${r?" media-grid--compact":""}`,children:e.map(o=>{const l=Iue(o.mimeType),u=RKe(o,t),h=o.status==="uploading"||o.status==="error"||!u,d=W.jsxs("button",{type:"button",className:"media-card-main",disabled:h,onClick:l==="image"?void 0:()=>s(o),"aria-label":i("media.preview",{name:o.name??i("media.attachment")}),children:[l==="image"&&u?W.jsx("img",{className:"media-card-image",src:u,alt:o.name??i("media.image"),loading:"lazy"}):l==="video"&&u?W.jsxs("div",{className:"media-card-video-container",children:[W.jsx("video",{className:"media-card-video",src:u,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),W.jsx("span",{className:"media-card-video-play",children:W.jsx(uir,{})})]}):W.jsx("span",{className:"media-card-icon",children:W.jsx(rTr,{kind:l})}),W.jsxs("span",{className:"media-card-copy",children:[W.jsx("span",{className:"media-card-name",children:o.name??i("media.attachment")}),W.jsxs("span",{className:"media-card-meta",children:[W.jsx("span",{className:"media-card-type",children:EKe(o)}),o.status==="uploading"?W.jsxs(W.Fragment,{children:[W.jsx(Rv,{className:"media-card-spinner"})," ",i("media.uploading")]}):o.status==="error"?o.error??i("media.uploadFailed"):_Ke(o.sizeBytes)]})]}),!r&&o.status!=="uploading"&&o.status!=="error"?W.jsx(wV,{className:"media-card-open"}):null]});return W.jsxs(eA.div,{className:`media-card media-card--${l}${o.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[l==="image"&&!h?W.jsx(QWe,{src:u,children:d}):d,n?W.jsx("button",{type:"button",className:"media-card-remove","aria-label":i("media.remove",{name:o.name??i("media.attachment")}),onClick:()=>n(o.id),children:W.jsx(jk,{})}):null]},o.id)})}),W.jsx(mir,{children:a?W.jsx(iTr,{appName:t,item:a,onClose:()=>s(null)}):null})]})}function iTr({appName:t,item:e,onClose:r}){const{t:n}=Ea("conversation"),i=se.useMemo(()=>RKe(e,t),[t,e]),a=Iue(e.mimeType),[s,o]=se.useState(""),[l,u]=se.useState(a==="text"||a==="markdown"),[h,d]=se.useState("");return se.useEffect(()=>{const f=p=>{p.key==="Escape"&&r()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[r]),se.useEffect(()=>{if(a!=="text"&&a!=="markdown")return;const f=new AbortController;return u(!0),d(""),fetch(i,{signal:f.signal}).then(p=>{if(!p.ok)throw new Error(`HTTP ${p.status}`);return p.text()}).then(o).catch(p=>{f.signal.aborted||d(p instanceof Error?p.message:String(p))}).finally(()=>{f.signal.aborted||u(!1)}),()=>f.abort()},[a,i]),W.jsx(eA.div,{className:"media-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":n("media.previewDialog",{name:e.name??n("media.attachment")}),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:f=>{f.target===f.currentTarget&&r()},children:W.jsxs(eA.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:[W.jsxs("header",{className:"media-viewer-header",children:[W.jsxs("div",{children:[W.jsx("strong",{children:e.name??n("media.attachment")}),W.jsxs("span",{children:[EKe(e),e.sizeBytes?` · ${_Ke(e.sizeBytes)}`:""]})]}),W.jsxs("nav",{children:[W.jsx("a",{href:i,download:e.name,"aria-label":n("media.download"),children:W.jsx(loe,{})}),W.jsx("button",{type:"button",onClick:r,"aria-label":n("media.close"),children:W.jsx(jk,{})})]})]}),W.jsxs("div",{className:`media-viewer-body media-viewer-body--${a}`,children:[a==="image"?W.jsx("img",{src:i,alt:e.name??n("media.image")}):null,a==="video"?W.jsx("div",{className:"media-viewer-video-wrapper",children:W.jsx("video",{src:i,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,a==="pdf"?W.jsx("iframe",{src:i,title:e.name??"PDF"}):null,l?W.jsxs("div",{className:"media-viewer-loading",children:[W.jsx(Rv,{})," ",n("media.reading")]}):null,!l&&h?W.jsx("div",{className:"media-viewer-loading",children:n("media.loadFailed",{error:h})}):null,!l&&a==="markdown"?W.jsx("div",{className:"media-document",children:W.jsx(ZQ,{text:s})}):null,!l&&a==="text"?W.jsx("pre",{className:"media-document media-document--plain",children:s}):null]})]})})}function DKe(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),W.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 aTr(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),W.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),W.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),W.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 sTr(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.jsx("path",{className:"video-generate-icon__body",d:"M3.25 9h17.5v7.35a2.4 2.4 0 0 1-2.4 2.4H5.65a2.4 2.4 0 0 1-2.4-2.4V9Z"}),W.jsxs("g",{className:"video-generate-icon__clapper",children:[W.jsx("path",{d:"M3.25 9V7.65a2.4 2.4 0 0 1 2.4-2.4h12.7a2.4 2.4 0 0 1 2.4 2.4V9H3.25Z"}),W.jsx("path",{d:"M6.75 5.25 9.3 9M12 5.25 14.55 9M17.25 5.25 19.8 9"})]}),W.jsx("path",{d:"m10.25 11.45 4 2.55-4 2.55v-5.1Z"})]})}function oTr(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.jsx("path",{d:"M4.25 5.25h15.5v10.5H4.25zM8.25 19.75h7.5M12 15.75v4"}),W.jsx("path",{d:"m7.25 12.75 2.35-2.4 2.15 1.65 3.4-3.6 1.6 1.55"}),W.jsx("circle",{cx:"7.25",cy:"8.4",r:".7",fill:"currentColor",stroke:"none"})]})}function lTr(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.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"}),W.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"}),W.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function cTr(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),W.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),W.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),W.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function uTr(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.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"}),W.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"}),W.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 hTr(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),W.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),W.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"}),W.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function dTr(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.jsx("circle",{cx:"6",cy:"6.25",r:"2.25"}),W.jsx("circle",{cx:"18",cy:"6.25",r:"2.25"}),W.jsx("circle",{cx:"12",cy:"17.75",r:"2.25"}),W.jsx("path",{d:"m7.7 7.75 2.7 7.55M16.3 7.75l-2.7 7.55M8.25 6.25h7.5"})]})}function LKe(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.jsx("circle",{cx:"9",cy:"8",r:"3"}),W.jsx("path",{d:"M3.75 18.75c.45-3.05 2.2-4.65 5.25-4.65s4.8 1.6 5.25 4.65"}),W.jsx("path",{d:"M17.75 4.25v5.5M15 7h5.5M16 13.25h4.25M18.125 11.125v4.25"})]})}function fTr(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.jsx("rect",{x:"4",y:"4.25",width:"16",height:"5",rx:"1.5"}),W.jsx("rect",{x:"4",y:"14.75",width:"16",height:"5",rx:"1.5"}),W.jsx("path",{d:"M7.25 6.75h.01M7.25 17.25h.01M10 6.75h6.5M10 17.25h6.5"})]})}function pTr(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.jsx("path",{d:"M6 3.75h8l4 4v12.5H6V3.75Z"}),W.jsx("path",{d:"M14 3.75v4h4M8.75 11h6.5M8.75 14.25h6.5M8.75 17.5h4"})]})}function MKe(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.jsx("rect",{x:"3.75",y:"4.5",width:"16.5",height:"15",rx:"2.5"}),W.jsx("path",{d:"m7.5 9 2.75 2.5L7.5 14M12.5 14h4"}),W.jsx("path",{d:"M3.75 7.5h16.5",opacity:".62"})]})}function Pue(t){return W.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:W.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function gTr({definition:t,label:e,done:r,open:n,onToggle:i}){const{t:a}=Ea("conversation"),s=t.icon,o=r?t.doneLabel:t.runningLabel,l=e??a(`blocks.tools.${t.name}.${r?"done":"running"}`,{defaultValue:o});return W.jsxs("button",{type:"button",className:`builtin-tool-head${r?" is-done":" is-running"}`,"data-tool-tone":t.tone,onClick:i,"aria-expanded":n,children:[W.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:W.jsx(s,{})}),r?W.jsx("span",{className:"builtin-tool-label",children:l}):W.jsx(Yb,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:l}),W.jsx(Pue,{className:`builtin-tool-chevron${n?" is-open":""}`})]})}function wd(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)?t:void 0}function Jr(t){return typeof t=="string"?t:""}function IKe(t){return typeof t=="number"&&Number.isFinite(t)?t:0}function _f(t){return Array.isArray(t)?t:[]}function Nue(t){let e=t;if(typeof e=="string")try{e=JSON.parse(e)}catch{return{}}const r=wd(e)??{};return wd(r.result)??r}function JQ(t){if(typeof t=="string")try{return JQ(JSON.parse(t))}catch{return t}const e=wd(t);if(!e)return"";const r=wd(e.result);return Jr(e.error)||Jr(e.message)||Jr(r==null?void 0:r.error)||Jr(r==null?void 0:r.message)}function mTr(t){if(t.kind==="tool")return"tool";if(t.kind==="knowledge_base")return"knowledge_base";const e=wd(t.metadata),r=Jr(e==null?void 0:e.source_type).toLowerCase(),n=Jr(t.source).toLowerCase();return r==="skillhub"||n.startsWith("skill_hub:")?"skill_hub":"skill_space"}const PKe={tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknownSource:"Unknown source",unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"};function vTr(t,e){return t==="veadk_builtin_tools"?e.tool:t==="agentkit_knowledge"?e.knowledge:t.startsWith("skill_hub:")?`Skill Hub ${t.slice(10)}`:t.startsWith("skill_space:")?`${e.skillCenter} ${t.slice(12)}`:t||e.unknownSource}function yTr(t){return t==="veadk_builtin_tools"?"tool":t==="agentkit_knowledge"?"knowledge_base":t.startsWith("skill_hub:")?"skill_hub":"skill_space"}function bTr(t,e=PKe){const r=Nue(t),n=wd(r.capabilities)??{},i=_f(r.resources).flatMap(s=>{const o=wd(s);if(!o)return[];const l=o.kind==="tool"?"tool":o.kind==="knowledge_base"?"knowledge_base":"skill";return[{ref:Jr(o.ref),kind:l,category:mTr(o),name:Jr(o.name)||Jr(o.ref)||e.unnamedResource,description:Jr(o.description),source:Jr(o.source),version:Jr(o.version)}]}),a=_f(r.sources).flatMap(s=>{const o=wd(s);if(!o)return[];const l=Jr(o.source),u=Jr(o.status),h=u==="error"?"error":u==="skipped"?"skipped":"ok";return[{source:l,category:yTr(l),label:vTr(l,e),status:h,count:IKe(o.count),message:Jr(o.message),searchKeywords:_f(o.search_keywords).map(Jr).filter(Boolean)}]});return{collectionId:Jr(r.collection_id),capabilities:{googleAdkVersion:Jr(n.google_adk_version),agentTypes:_f(n.agent_types).map(Jr).filter(Boolean),maxOrchestrationDepth:IKe(n.max_orchestration_depth)},resources:i,sources:a,counts:{all:i.length,skill_hub:i.filter(s=>s.category==="skill_hub").length,skill_space:i.filter(s=>s.category==="skill_space").length,knowledge_base:i.filter(s=>s.category==="knowledge_base").length,tool:i.filter(s=>s.category==="tool").length}}}function xTr(t,e){return{resources:t.resources.filter(r=>r.category===e),sources:t.sources.filter(r=>r.category===e)}}function NKe(t,e,r=PKe){const n=Nue(t),i=Nue(e),a=new Map(_f(i.results).flatMap(h=>{const d=wd(h),f=Jr(d==null?void 0:d.name);return d&&f?[[f,d]]:[]})),s=_f(n.agents).flatMap(h=>{const d=wd(h),f=Jr(d==null?void 0:d.name);return d&&f?[d]:[]}),o=new Set(s.map(h=>Jr(h.name))),l=[...a.entries()].filter(([h])=>!o.has(h)).map(([h])=>({name:h})),u=[...s,...l].map(h=>{const d=Jr(h.name),f=_f(h.nodes).flatMap(S=>{const O=wd(S);return O?[O]:[]}),p=Jr(h.root_node),g=f.find(S=>Jr(S.id)===p),m=f.filter(S=>Jr(S.id)!==p).map(S=>({id:Jr(S.id)||r.unnamedAgent,type:Jr(S.type)||"llm",description:Jr(S.description)})),v=a.get(d),y=Jr(v==null?void 0:v.status),b=y==="failed"?"failed":y==="completed"?"completed":"running",x=BKe(v==null?void 0:v.resources),w=x.length>0?x:BKe(f.flatMap(S=>_f(S.resources))),A=$Ke(v==null?void 0:v.python_tools),T=A.length>0?A:$Ke(f.flatMap(S=>_f(S.python_tools)));return{name:d,description:Jr(v==null?void 0:v.description)||Jr(g==null?void 0:g.description)||Jr(h.task),task:Jr(h.task),rootType:Jr(v==null?void 0:v.root_type)||Jr(g==null?void 0:g.type)||"llm",nodeCount:f.length,subAgentCount:m.length,resourceCount:w.length,pythonToolCount:T.length,skills:w.filter(S=>S.kind==="skill"),knowledgeBases:w.filter(S=>S.kind==="knowledge_base"),builtinTools:w.filter(S=>S.kind==="tool"),pythonTools:T,subAgents:m,status:b,output:Jr(v==null?void 0:v.output),error:Jr(v==null?void 0:v.error)}});return{collectionId:Jr(i.collection_id)||Jr(n.collection_id),agents:u,completedCount:u.filter(h=>h.status==="completed").length,failedCount:u.filter(h=>h.status==="failed").length,runningCount:u.filter(h=>h.status==="running").length}}function wTr(t,e){return!!JQ(e)||NKe(t,e).failedCount>0}function BKe(t){const e=new Set;return _f(t).flatMap(r=>{const n=wd(r),i=Jr(n?n.ref:r);if(!i||e.has(i))return[];e.add(i);const a=Jr(n==null?void 0:n.kind),s=a==="tool"||i.startsWith("veadk_tool:")?"tool":a==="knowledge_base"||i.startsWith("agentkit_kb:")?"knowledge_base":"skill",o=i.split(":");return[{ref:i,kind:s,name:Jr(n==null?void 0:n.name)||o[o.length-1]||i,description:Jr(n==null?void 0:n.description),version:Jr(n==null?void 0:n.version),source:Jr(n==null?void 0:n.source)}]})}function $Ke(t){const e=new Set;return _f(t).flatMap(r=>{const n=wd(r),i=Jr(n==null?void 0:n.name),a=Jr(n==null?void 0:n.code),s=`${i}\0${a}`;return!n||!i||e.has(s)?[]:(e.add(s),[{name:i,description:Jr(n.description),code:a,entrypoint:Jr(n.entrypoint)||i,dependencies:_f(n.dependencies).map(Jr).filter(Boolean)}])})}const ATr=t=>{const e=se.Children.toArray(t),r=[];let n="";const i=()=>{n!==""&&(r.push(n),n="")};for(const a of e)if(!(a==null||typeof a=="boolean")){if(typeof a=="string"||typeof a=="number"){n+=String(a);continue}i(),r.push(a)}return i(),r},Bue=t=>{const e=ATr(t),r=se.Children.count(e);return se.Children.map(e,n=>{if(typeof n=="string"&&n.trim())return r<=1?n:W.jsx("span",{children:n});if(se.isValidElement(n)){const i=n,{children:a,...s}=i.props;return a!=null?se.cloneElement(i,s,Bue(a)):i}return n})},TTr={Badge:"_Badge_1viyg_1"},ex=({children:t,className:e,variant:r="soft",color:n="secondary",size:i="sm",pill:a,...s})=>W.jsx("div",{className:AE(TTr.Badge,e),"data-color":n,"data-size":i,"data-pill":a?"":void 0,"data-variant":r,...s,children:Bue(t)});se.createContext(null);const STr={LoadingIndicator:"_LoadingIndicator_7yl6f_1"},CTr=({className:t,size:e,strokeWidth:r,style:n,...i})=>W.jsx("div",{...i,className:AE(STr.LoadingIndicator,t),style:n||TKe({"indicator-size":e,"indicator-stroke":r})});function OTr(t){return e=>{t.forEach(r=>{typeof r=="function"?r(e):r!=null&&(r.current=e)})}}const kTr=()=>xKe,FKe=(t,e=!1,r="TransitionGroup")=>{const n=[];return se.Children.forEach(t,i=>{if(i&&typeof i=="object"&&"key"in i&&i.key)n.push(i);else if(e)throw new Error(`Child elements of <${r} /> must include a \`key\``)}),n},NE=()=>{},BE=t=>{const e=se.useRef(t);return e.current=t,se.useCallback(r=>e.current(r),[])};function ETr(t,e,r,n){const i=t.reduce((l,u)=>({...l,[u.key]:1}),{}),a=e.reduce((l,u)=>({...l,[u.component.key]:1}),{}),s=t.filter(l=>!a[l.key]).map(r),o=e.map(l=>({...l,component:t.find(({key:u})=>u===l.component.key)||l.component,shouldRender:!!i[l.component.key]}));return n==="append"?o.concat(s):s.concat(o)}function _Tr(t,e,r){if((xKe||$Ar)&&e&&r>1)throw new Error(`Cannot use forwardRef with multiple children in <${t} />`)}const RTr={TransitionGroupChild:"_TransitionGroupChild_1hv1z_1"},zKe={enter:!1,enterActive:!1,exit:!1,exitActive:!1,interrupted:!1},DTr=t=>({...zKe,enter:!t}),LTr=(t,e)=>{switch(e.type){case"enter-before":return{enter:!0,enterActive:!1,exit:!1,exitActive:!1,interrupted:t.interrupted||t.exit};case"enter-active":return{enter:!0,enterActive:!0,exit:!1,exitActive:!1,interrupted:!1};case"exit-before":return{enter:!1,enterActive:!1,exit:!0,exitActive:!1,interrupted:t.interrupted||t.enter};case"exit-active":return{enter:!1,enterActive:!1,exit:!0,exitActive:!0,interrupted:!1};case"done":default:return zKe}},MTr=({ref:t,as:e,children:r,className:n,transitionId:i,style:a,preventMountTransition:s,shouldRender:o,enterDuration:l,exitDuration:u,removeChild:h,onEnter:d,onEnterActive:f,onEnterComplete:p,onExit:g,onExitActive:m,onExitComplete:v})=>{const[y,b]=se.useReducer(LTr,DTr(s||!1)),x=se.useRef(!1),w=se.useRef(null),A=se.useRef(l);A.current=l;const T=se.useRef(u);T.current=u;const S=se.useRef(null),O=se.useCallback(k=>{const E=w.current;if(!(!E||k===S.current))switch(S.current=k,k){case"enter":d(E);break;case"enter-active":f(E);break;case"enter-complete":p(E);break;case"exit":g(E);break;case"exit-active":m(E);break;case"exit-complete":v(E);break}},[d,f,p,g,m,v]);return WLe.useLayoutEffect(()=>{if(!o){let _;b({type:"exit-before"}),O("exit");const I=Rue(()=>{b({type:"exit-active"}),O("exit-active"),_=window.setTimeout(()=>{O("exit-complete"),h()},T.current)});return()=>{I(),_!==void 0&&clearTimeout(_)}}if(s&&!x.current){x.current=!0;return}let k;b({type:"enter-before"}),O("enter");const E=Rue(()=>{b({type:"enter-active"}),O("enter-active"),k=window.setTimeout(()=>{b({type:"done"}),O("enter-complete")},A.current)});return()=>{E(),k!==void 0&&clearTimeout(k)}},[o,s,h,O]),se.useEffect(()=>()=>{x.current=!1},[]),W.jsx(e,{ref:OTr([w,t]),className:AE(n,RTr.TransitionGroupChild),"data-transition-id":i,style:a,"data-entering":y.enter?"":void 0,"data-entering-active":y.enterActive?"":void 0,"data-exiting":y.exit?"":void 0,"data-exiting-active":y.exitActive?"":void 0,"data-interrupted":y.interrupted?"":void 0,children:r})},ITr=t=>{const{enterMountDelay:e,preventMountTransition:r}=t,n=!r&&e!=null?e:null,[i,a]=se.useState(n==null);return bKe(()=>a(!0),i?null:n),i?W.jsx(MTr,{...t}):null},UKe=t=>{const{ref:e,as:r="span",children:n,className:i,transitionId:a,style:s,enterDuration:o=0,exitDuration:l=0,preventInitialTransition:u=!0,enterMountDelay:h,insertMethod:d="append",disableAnimations:f=kTr()}=t,p=BE(t.onEnter??NE),g=BE(t.onEnterActive??NE),m=BE(t.onEnterComplete??NE),v=BE(t.onExit??NE),y=BE(t.onExitActive??NE),b=BE(t.onExitComplete??NE);se.Children.forEach(n,T=>{if(T&&!T.key)throw new Error("Child elements of must include a `key`")});const x=se.useCallback(T=>({component:T,shouldRender:!0,removeChild:()=>{A(S=>S.filter(O=>T.key!==O.component.key))},onEnter:p,onEnterActive:g,onEnterComplete:m,onExit:v,onExitActive:y,onExitComplete:b}),[p,g,m,v,y,b]),[w,A]=se.useState(()=>FKe(n).map(T=>({...x(T),preventMountTransition:u})));return se.useLayoutEffect(()=>{A(T=>{const S=FKe(n);return ETr(S,T,x,d)})},[n,d,x]),_Tr("TransitionGroup",e,se.Children.count(n)),f?W.jsx(W.Fragment,{children:se.Children.map(n,T=>W.jsx(r,{ref:e,className:i,style:s,"data-transition-id":a,children:T}))}):W.jsx(W.Fragment,{children:w.map(({component:T,...S})=>W.jsx(ITr,{...S,as:r,className:i,transitionId:a,enterDuration:o,exitDuration:l,enterMountDelay:h,style:s,ref:e,children:T},T.key))})},$ue={Button:"_Button_1864l_1",ButtonInner:"_ButtonInner_1864l_4",ButtonLoader:"_ButtonLoader_1864l_749"},PTr=t=>{const{type:e="button",color:r="primary",variant:n="solid",pill:i=!0,uniform:a=!1,size:s="md",iconSize:o,gutterSize:l,loading:u,selected:h,block:d,opticallyAlign:f,children:p,className:g,onClick:m,disabled:v,disabledTone:y,inert:b=u,...x}=t,w=v||b,A=se.useCallback(T=>{v||m==null||m(T)},[m,v]);return W.jsxs("button",{type:e,className:AE($ue.Button,g),"data-color":r,"data-variant":n,"data-pill":i?"":void 0,"data-uniform":a?"":void 0,"data-size":s,"data-gutter-size":l,"data-icon-size":o,"data-loading":u?"":void 0,"data-selected":h?"":void 0,"data-block":d?"":void 0,"data-optically-align":f,onPointerEnter:AKe,disabled:w,"aria-disabled":w,tabIndex:w?-1:void 0,"data-disabled":v?"":void 0,"data-disabled-tone":v?y:void 0,onClick:A,...x,children:[W.jsx(UKe,{className:$ue.ButtonLoader,enterDuration:250,exitDuration:150,children:u&&W.jsx(CTr,{},"loader")}),W.jsx("span",{className:$ue.ButtonInner,children:Bue(p)})]})},NTr=t=>W.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...t,children:W.jsx("path",{d:"M14.5 4a5.5 5.5 0 0 0-5.078 7.616 1 1 0 0 1-.216 1.092l-4.749 4.75a1.475 1.475 0 0 0 2.086 2.085l4.749-4.749a1 1 0 0 1 1.092-.216A5.5 5.5 0 0 0 20 9.414l-1.293 1.293a3.828 3.828 0 1 1-5.414-5.414L14.585 4H14.5ZM7 9.5a7.5 7.5 0 0 1 9.969-7.084 1 1 0 0 1 .378 1.651l-2.64 2.64a1.829 1.829 0 0 0 2.586 2.586l2.64-2.64a1 1 0 0 1 1.651.378 7.5 7.5 0 0 1-9.328 9.627l-4.299 4.3a3.475 3.475 0 0 1-4.914-4.915l4.299-4.299A7.497 7.497 0 0 1 7 9.5Z"})}),BTr=t=>W.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...t,children:W.jsx("path",{d:"M8.99805 16.796C8.99805 15.4164 7.87961 14.2979 6.5 14.2979C5.12039 14.2979 4.00195 15.4164 4.00195 16.796C4.00196 18.1756 5.1204 19.294 6.5 19.294C7.8796 19.294 8.99804 18.1756 8.99805 16.796ZM19.748 15.0479C19.748 14.7729 19.525 14.5499 19.25 14.5499H15.75C15.475 14.5499 15.252 14.7729 15.252 15.0479V18.5479C15.252 18.823 15.475 19.046 15.75 19.046H19.25C19.525 19.046 19.748 18.823 19.748 18.5479V15.0479ZM10.0469 3.45125C11.077 2.15921 13.0849 2.20276 14.0498 3.58113L16.4189 6.96492L16.5205 7.12215C17.5046 8.76341 16.3301 10.9023 14.3691 10.9024H9.63086C7.60676 10.9023 6.42029 8.62316 7.58105 6.96492L9.9502 3.58113L10.0469 3.45125ZM12.4082 4.73055C12.2223 4.46497 11.842 4.44826 11.6318 4.68074L11.5918 4.73055L9.22266 8.11433C8.99176 8.44435 9.22808 8.89744 9.63086 8.89754H14.3691C14.7468 8.89745 14.9774 8.49957 14.8145 8.17781L14.7773 8.11433L12.4082 4.73055ZM11.002 16.796C11.0019 19.2824 8.98638 21.2979 6.5 21.2979C4.01362 21.2979 1.99806 19.2824 1.99805 16.796C1.99805 14.3096 4.01361 12.294 6.5 12.294C8.98639 12.294 11.002 14.3096 11.002 16.796ZM21.752 18.5479C21.752 19.9297 20.6318 21.0499 19.25 21.0499H15.75C14.3682 21.0499 13.248 19.9297 13.248 18.5479V15.0479C13.2481 13.6662 14.3682 12.546 15.75 12.546H19.25C20.6318 12.546 21.7519 13.6662 21.752 15.0479V18.5479Z",fill:"currentColor"})}),$Tr=t=>W.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...t,children:W.jsx("path",{fillRule:"evenodd",d:"M7.5 5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5ZM3 7.5a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM17 6a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm-4 2a4 4 0 1 1 8 0 4 4 0 0 1-8 0Zm-8.96 8.247C3.137 17.048 2.5 18.271 2.5 20a1 1 0 1 1-2 0c0-2.271.862-4.049 2.21-5.248C4.042 13.57 5.788 13 7.5 13s3.459.57 4.79 1.752c1.348 1.2 2.21 2.977 2.21 5.248a1 1 0 1 1-2 0c0-1.729-.638-2.952-1.54-3.753C10.042 15.43 8.788 15 7.5 15s-2.541.43-3.46 1.247Zm15.757-.607c-1.009-.638-2.338-.807-3.526-.472a1 1 0 0 1-.542-1.925c1.695-.478 3.616-.255 5.136.706 1.558.984 2.635 2.707 2.635 5.051a1 1 0 1 1-2 0c0-1.665-.732-2.746-1.703-3.36Z",clipRule:"evenodd"})});function FTr({branch:t}){return W.jsxs("div",{className:`branch-compare__body${t.status==="running"?" is-streaming":""}`,"aria-live":"polite",children:[t.content?W.jsx(ZQ,{text:t.content,streaming:t.status==="running"}):null,t.status==="running"?W.jsx("span",{className:"branch-compare__caret","aria-hidden":"true"}):null,t.error?W.jsx("p",{className:"branch-compare__error",children:t.error}):null]})}function zTr({args:t,response:e,status:r,onBranchSelect:n}){const{t:i}=Ea("conversation"),a=se.useMemo(()=>cVe(t,e,r),[t,e,r]),[s,o]=se.useState(0);return W.jsxs("section",{className:"branch-compare","aria-label":i("blocks.branchCompare.ariaLabel"),children:[W.jsx("div",{className:"branch-compare__tabs",role:"tablist","aria-label":i("blocks.branchCompare.selectDirection"),children:a.branches.map((l,u)=>W.jsx("button",{className:`branch-compare__tab${s===u?" is-active":""}`,type:"button",role:"tab","aria-selected":s===u,"aria-controls":`branch-compare-panel-${u}`,onClick:()=>o(u),children:W.jsx(ex,{color:"info",size:"sm",variant:"soft",children:l.label})},`${l.label}:${u}`))}),W.jsx("div",{className:"branch-compare__branches",children:a.branches.map((l,u)=>W.jsxs("article",{className:`branch-compare__branch${s===u?" is-active":""}`,id:`branch-compare-panel-${u}`,role:"tabpanel",children:[W.jsx("header",{className:"branch-compare__head",children:W.jsx(ex,{color:"info",size:"sm",variant:"soft",children:l.label})}),W.jsx(FTr,{branch:l}),W.jsx("footer",{className:"branch-compare__footer",children:W.jsx(PTr,{type:"button",color:"info",variant:"ghost",size:"sm",pill:!1,disabled:l.status!=="completed",onClick:()=>n==null?void 0:n(l),children:i("blocks.branchCompare.continue")})})]},`${l.label}:${u}`))})]})}function VKe({controlled:t,default:e,name:r,state:n="value"}){const{current:i}=se.useRef(t!==void 0),[a,s]=se.useState(e),o=i?t:a,l=se.useCallback(u=>{i||s(u)},[]);return[o,l]}const Fue={...Sw},QKe={};function bA(t,e){const r=se.useRef(QKe);return r.current===QKe&&(r.current=t(e)),r}const zue=Fue.useInsertionEffect,UTr=zue&&zue!==Fue.useLayoutEffect?zue:t=>t();function Kl(t){const e=bA(VTr).current;return e.next=t,UTr(e.effect),e.trampoline}function VTr(){const t={next:void 0,callback:QTr,trampoline:(...e)=>{var r;return(r=t.callback)==null?void 0:r.call(t,...e)},effect:()=>{t.callback=t.next}};return t}function QTr(){}const Sh=typeof document<"u"?se.useLayoutEffect:()=>{},GKe=se.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function GTr(){return se.useContext(GKe)}function HTr(t){const{children:e,elementsRef:r,labelsRef:n,onMapChange:i}=t,a=Kl(i),[,s]=se.useState(!1),o=bA(YTr).current,l=bA(WTr).current,u=se.useRef(0),h=se.useRef(!0),d=se.useRef([]),f=se.useRef(null),p=Kl(()=>{h.current||(h.current=!0,s(A=>!A))}),g=Kl((A,T)=>{l.set(A,T),p()}),m=Kl(A=>{l.delete(A),p()}),v=Kl(A=>{const T=new Map;return r.current.length=0,n&&(n.current.length=0),A.forEach(S=>{var O,k;T.set(S.element,{...S.registration.metadata??{},index:S.index}),r.current[S.index]=S.element,n&&(n.current[S.index]=S.registration.label!==void 0?S.registration.label:((k=(O=S.registration.textRef)==null?void 0:O.current)==null?void 0:k.textContent)??S.element.textContent)}),u.current=r.current.length,T});function y(A){var O;if((O=f.current)==null||O.disconnect(),f.current=null,typeof MutationObserver!="function"||A.length<2)return;const T=new MutationObserver(k=>{if(!XTr(k))return;let E=null;for(const _ of A)if(_.isConnected){if(E&&HKe(E,_)>0){T.disconnect(),p();return}E=_}});f.current=T;const S=new Set;for(let k=1;kT.observe(k,{childList:!0}))}const b=Kl(()=>{const[A,T]=qTr(l),S=v(A);y(T),d.current=A,h.current=!1,o.forEach(O=>O(S)),a(S)});Sh(()=>(h.current||v(d.current),()=>{r.current=[],n&&(n.current=[])}),[r,n,v]),Sh(()=>{h.current&&b()}),Sh(()=>()=>{var A;(A=f.current)==null||A.disconnect(),h.current=!0},[]);const x=Kl(A=>(o.add(A),()=>{o.delete(A)})),w=se.useMemo(()=>({register:g,unregister:m,subscribeMapChange:x,nextIndexRef:u}),[g,m,x,u]);return W.jsx(GKe.Provider,{value:w,children:e})}function WTr(){return new Map}function YTr(){return new Set}function qTr(t){const e=new Set,r=[],n=[];t.forEach((a,s)=>{if(!s.isConnected)return;const o=a.index,l={index:o??-1,element:s,registration:a};o===null?n.push(l):o>=0&&(e.add(o),r.push(l))});let i=0;return n.sort((a,s)=>HKe(a.element,s.element)),n.forEach(a=>{for(;e.has(i);)i+=1;a.index=i,r.push(a),i+=1}),e.size>0&&r.sort((a,s)=>a.index-s.index),[r,n.map(a=>a.element)]}function jTr(t,e){let r=t.parentElement;for(;r&&!r.contains(e);)r=r.parentElement;return r}function XTr(t){for(const e of t)for(let r=0;ra.searchParams.append("args[]",s)),`${e} error #${n}; visit ${a} for the full message.`}}const Z6=KTr("https://base-ui.com/production-error","Base UI"),WKe=se.createContext(void 0);function YKe(){const t=se.useContext(WKe);if(t===void 0)throw new Error(Z6(10));return t}function eG(t,e,r,n){const i=bA(qKe).current;return JTr(i,t,e,r,n)&&jKe(i,[t,e,r,n]),i.callback}function ZTr(t){const e=bA(qKe).current;return eSr(e,t)&&jKe(e,t),e.callback}function qKe(){return{callback:null,cleanup:null,refs:[]}}function JTr(t,e,r,n,i){return t.refs[0]!==e||t.refs[1]!==r||t.refs[2]!==n||t.refs[3]!==i}function eSr(t,e){return t.refs.length!==e.length||t.refs.some((r,n)=>r!==e[n])}function jKe(t,e){if(t.refs=e,e.every(r=>r==null)){t.callback=null;return}t.callback=r=>{if(t.cleanup&&(t.cleanup(),t.cleanup=null),r!=null){const n=Array(e.length).fill(null);for(let i=0;i{for(let i=0;i=t}function XKe(t){if(!se.isValidElement(t))return null;const e=t,r=e.props;return(rSr(19)?r==null?void 0:r.ref:e.ref)??null}function Uue(t,e){if(t&&!e)return t;if(!t&&e)return e;if(t||e)return{...t,...e}}const nSr=Object.freeze([]),$E=Object.freeze({});function iSr(t,e){const r={};for(const n in t){const i=t[n];if(e!=null&&e.hasOwnProperty(n)){const a=e[n](i);a!=null&&Object.assign(r,a);continue}i===!0?r[`data-${n.toLowerCase()}`]="":i&&(r[`data-${n.toLowerCase()}`]=i.toString())}return r}function aSr(t,e){return typeof t=="function"?t(e):t}function KKe(t,e){return typeof t=="function"?t(e):t}const Vue={};function Que(t,e,r,n,i){if(!r&&!n&&!t)return tG(e);let a=tG(t);return e&&(a=rG(a,e)),r&&(a=rG(a,r)),n&&(a=rG(a,n)),a}function sSr(t){if(t.length===0)return Vue;if(t.length===1)return tG(t[0]);let e=tG(t[0]);for(let r=1;r=65&&i<=90&&(typeof e=="function"||typeof e>"u")}function Gue(t){return typeof t=="function"}function JKe(t,e){return Gue(t)?t(e):t??Vue}function cSr(t,e){return e?t?(...r)=>{const n=r[0];if(rZe(n)){const a=n;nG(a);const s=e(...r);return a.baseUIHandlerPrevented||t==null||t(...r),s}const i=e(...r);return t==null||t(...r),i}:eZe(e):t}function eZe(t){return t&&((...e)=>{const r=e[0];return rZe(r)&&nG(r),t(...e)})}function nG(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPrevented=!0},t}function tZe(t,e){return e?t?e+" "+t:e:t}function rZe(t){return t!=null&&typeof t=="object"&&"nativeEvent"in t}function J6(t,e,r={}){const n=e.render,i=uSr(e,r);if(r.enabled===!1)return null;const a=r.state??$E;return fSr(t,n,i,a)}function uSr(t,e={}){const{className:r,style:n,render:i}=t,{state:a=$E,ref:s,props:o,stateAttributesMapping:l,enabled:u=!0}=e,h=u?aSr(r,a):void 0,d=u?KKe(n,a):void 0,f=u?iSr(a,l):$E,p=u&&o?hSr(o):void 0,g=u?Uue(f,p)??{}:$E;return typeof document<"u"&&(u?Array.isArray(s)?g.ref=ZTr([g.ref,XKe(i),...s]):g.ref=eG(g.ref,XKe(i),s):eG(null,null)),u?(h!==void 0&&(g.className=tZe(g.className,h)),d!==void 0&&(g.style=Uue(g.style,d)),g):$E}function hSr(t){return Array.isArray(t)?sSr(t):Que(void 0,t)}const dSr=Symbol.for("react.lazy");function fSr(t,e,r,n){if(e){if(typeof e=="function")return e(r,n);const i=Que(r,e.props);i.ref=r.ref;let a=e;return(a==null?void 0:a.$$typeof)===dSr&&(a=se.Children.toArray(e)[0]),se.cloneElement(a,i)}if(t&&typeof t=="string")return pSr(t,r);throw new Error(Z6(8))}function pSr(t,e){return t==="button"?se.createElement("button",{type:"button",...e,key:e.key}):t==="img"?se.createElement("img",{alt:"",...e,key:e.key}):se.createElement(t,e)}const gSr={value:()=>null},nZe=se.forwardRef(function(e,r){const{render:n,className:i,disabled:a=!1,hiddenUntilFound:s,keepMounted:o,loopFocus:l,onValueChange:u,multiple:h=!1,orientation:d="vertical",value:f,defaultValue:p,style:g,...m}=e,v=se.useMemo(()=>{if(f===void 0)return p??[]},[f,p]),y=se.useRef([]),[b,x]=VKe({controlled:f,default:v,name:"Accordion",state:"value"}),w=Kl((O,k,E)=>{if(h)if(k){const _=b.slice();if(_.push(O),u==null||u(_,E),E.isCanceled)return;x(_)}else{const _=b.filter(I=>I!==O);if(u==null||u(_,E),E.isCanceled)return;x(_)}else{const _=b[0]===O?[]:[O];if(u==null||u(_,E),E.isCanceled)return;x(_)}}),A=se.useMemo(()=>({value:b,disabled:a,orientation:d}),[b,a,d]),T=se.useMemo(()=>({disabled:a,handleValueChange:w,hiddenUntilFound:s??!1,keepMounted:o??!1,state:A,value:b}),[a,w,s,o,A,b]),S=J6("div",e,{state:A,ref:r,props:m,stateAttributesMapping:gSr});return W.jsx(WKe.Provider,{value:T,children:W.jsx(HTr,{elementsRef:y,children:S})})});let iZe=0;function mSr(t,e="mui"){const[r,n]=se.useState(t),i=t||r;return se.useEffect(()=>{r==null&&(iZe+=1,n(`${e}-${iZe}`))},[r,e]),i}const aZe=Fue.useId;function vSr(t,e){if(aZe!==void 0){const r=aZe();return`${e}-${r}`}return mSr(t,e)}function Hue(t){return vSr(t,"base-ui")}const ySr="none",bSr="trigger-press";function sZe(t,e,r,n){let i=!1,a=!1;const s=$E;return{reason:t,event:e??new Event("base-ui"),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:r,...s}}function xSr(t){se.useEffect(t,nSr)}const iG=null;let wSr=class{constructor(){Bn(this,"callbacks",[]);Bn(this,"callbacksCount",0);Bn(this,"nextId",1);Bn(this,"startId",1);Bn(this,"isScheduled",!1);Bn(this,"tick",e=>{var i;this.isScheduled=!1;const r=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let a=0;a=this.callbacks.length||(this.callbacks[r]=null,this.callbacksCount-=1)}},aG=new wSr;class Ad{constructor(){Bn(this,"currentId",iG);Bn(this,"cancel",()=>{this.currentId!==iG&&(aG.cancel(this.currentId),this.currentId=iG)});Bn(this,"disposeEffect",()=>this.cancel)}static create(){return new Ad}static request(e){return aG.request(e)}static cancel(e){return aG.cancel(e)}request(e){this.cancel(),this.currentId=aG.request(()=>{this.currentId=iG,e()})}}function ASr(){const t=bA(Ad.create).current;return xSr(t.disposeEffect),t}function TSr(t,e=!1,r=!1){const[n,i]=se.useState(t&&e?"idle":void 0),[a,s]=se.useState(t);return t&&!a&&(s(!0),i("starting")),!t&&a&&n!=="ending"&&!r&&i("ending"),!t&&!a&&n==="ending"&&i(void 0),Sh(()=>{if(!t&&a&&n!=="ending"&&r){const o=Ad.request(()=>{i("ending")});return()=>{Ad.cancel(o)}}},[t,a,n,r]),Sh(()=>{if(!t||e)return;const o=Ad.request(()=>{i(void 0)});return()=>{Ad.cancel(o)}},[e,t]),Sh(()=>{if(!t||!e)return;t&&a&&n!=="idle"&&i("starting");const o=Ad.request(()=>{i("idle")});return()=>{Ad.cancel(o)}},[e,t,a,n]),{mounted:a,setMounted:s,transitionStatus:n}}function SSr(t){const{open:e,defaultOpen:r,onOpenChange:n,disabled:i}=t,[a,s]=VKe({controlled:e,default:r,name:"Collapsible",state:"open"}),{mounted:o,setMounted:l,transitionStatus:u}=TSr(a,!0,!0),h=Hue(),[d,f]=se.useState(),p=d===null?void 0:d??h,g=Kl(m=>{const v=!a,y=sZe(bSr,m.nativeEvent);n(v,y),!y.isCanceled&&s(v)});return se.useMemo(()=>({defaultPanelId:h,disabled:i,handleTrigger:g,mounted:o,open:a,panelId:p,setMounted:l,setOpen:s,setPanelIdState:f,transitionStatus:u}),[h,i,g,o,a,p,l,s,f,u])}const oZe=se.createContext(void 0);function lZe(){const t=se.useContext(oZe);if(t===void 0)throw new Error(Z6(15));return t}function CSr(t={}){const{guess:e,label:r,metadata:n,textRef:i,index:a}=t,{register:s,unregister:o,subscribeMapChange:l,nextIndexRef:u}=GTr(),h=se.useRef(-1),[d,f]=se.useState(a==null&&e?()=>{if(h.current===-1){const v=u.current;u.current+=1,h.current=v}return h.current}:-1),p=a??d,g=se.useRef(null),m=se.useCallback(v=>{const y=g.current;y&&o(y),g.current=v,v&&s(v,{metadata:n??null,index:a??null,label:r,textRef:i})},[a,s,o,n,r,i]);return Sh(()=>{if(a==null)return l(v=>{var b;const y=g.current?(b=v.get(g.current))==null?void 0:b.index:null;y!=null&&f(y)})},[a,l]),{ref:m,index:p}}const cZe=se.createContext(void 0);function Wue(){const t=se.useContext(cZe);if(t===void 0)throw new Error(Z6(9));return t}let uZe=function(t){return t.startingStyle="data-starting-style",t.endingStyle="data-ending-style",t}({});const OSr={"data-starting-style":""},kSr={"data-ending-style":""},ESr={transitionStatus(t){return t==="starting"?OSr:t==="ending"?kSr:null}};let Yue=function(t){return t.open="data-open",t.closed="data-closed",t[t.startingStyle=uZe.startingStyle]="startingStyle",t[t.endingStyle=uZe.endingStyle]="endingStyle",t}({}),_Sr=function(t){return t.panelOpen="data-panel-open",t}({});const RSr={[Yue.open]:""},DSr={[Yue.closed]:""},LSr={open(t){return t?{[_Sr.panelOpen]:""}:null}},MSr={open(t){return t?RSr:DSr}};let ISr=function(t){return t.index="data-index",t.disabled="data-disabled",t.open="data-open",t}({});const que={...MSr,index:t=>({[ISr.index]:String(t)}),...ESr,value:()=>null},hZe=se.forwardRef(function(e,r){const{className:n,disabled:i=!1,onOpenChange:a,render:s,value:o,style:l,...u}=e,{ref:h,index:d}=CSr(),f=eG(r,h),{disabled:p,handleValueChange:g,state:m,value:v}=YKe(),y=Hue(),b=o??y,x=i||p,w=v.indexOf(b)!==-1,A=Kl((M,P)=>{a==null||a(M,P),!P.isCanceled&&g(b,M,P)}),T=SSr({open:w,onOpenChange:A,disabled:x}),S=se.useMemo(()=>({open:T.open,disabled:T.disabled,transitionStatus:T.transitionStatus}),[T.open,T.disabled,T.transitionStatus]),O=se.useMemo(()=>({...T,onOpenChange:A,state:S}),[T,S,A]),k=se.useMemo(()=>({...m,hidden:!w&&!T.mounted,index:d,disabled:x,open:w}),[T.mounted,x,d,w,m]),E=Hue(),[_,I]=se.useState(),L=_===null?void 0:_??E,R=se.useMemo(()=>({defaultTriggerId:E,open:w,state:k,setTriggerId:I,triggerId:L}),[E,w,k,I,L]),D=J6("div",e,{state:k,ref:f,props:u,stateAttributesMapping:que});return W.jsx(oZe.Provider,{value:O,children:W.jsx(cZe.Provider,{value:R,children:D})})}),dZe=se.forwardRef(function(e,r){const{render:n,className:i,style:a,...s}=e,{state:o}=Wue();return J6("h3",e,{state:o,ref:r,props:s,stateAttributesMapping:que})}),PSr=se.createContext(void 0);function NSr(t=!1){const e=se.useContext(PSr);if(e===void 0&&!t)throw new Error(Z6(16));return e}function BSr(t){const{focusableWhenDisabled:e,disabled:r,composite:n=!1,tabIndex:i=0,isNativeButton:a}=t,s=n&&e!==!1,o=n&&e===!1;return{props:se.useMemo(()=>{const u={onKeyDown(h){r&&e&&h.key!=="Tab"&&h.preventDefault()}};return n||(u.tabIndex=i,!a&&r&&(u.tabIndex=e?i:-1)),(a&&(e||s)||!a&&r)&&(u["aria-disabled"]=r),a&&(!e||o)&&(u.disabled=r),u},[n,r,e,s,o,a,i])}}function jue(t,e,{detail:r=0}={}){t.dispatchEvent(new(Ic(t)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:r,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}function $Sr(t={}){const{disabled:e=!1,focusableWhenDisabled:r,tabIndex:n=0,native:i=!0,composite:a}=t,s=se.useRef(null),o=NSr(!0),l=a??o!==void 0,{props:u}=BSr({focusableWhenDisabled:r,disabled:e,composite:l,tabIndex:n,isNativeButton:i}),h=se.useCallback(()=>{const p=s.current;Xue(p)&&l&&e&&u.disabled===void 0&&p.disabled&&(p.disabled=!1)},[e,u.disabled,l]);Sh(h,[h]);const d=se.useCallback((p={})=>{const{onClick:g,onMouseDown:m,onKeyUp:v,onKeyDown:y,onPointerDown:b,...x}=p;return Que({onClick(w){if(e){w.preventDefault();return}g==null||g(w)},onMouseDown(w){e||m==null||m(w)},onKeyDown(w){if(e||(nG(w),y==null||y(w),w.baseUIHandlerPrevented))return;const A=w.target===w.currentTarget,T=w.currentTarget,S=Xue(T),O=!i&&FSr(T),k=A&&(i?S:!O),E=w.key==="Enter",_=w.key===" ",I=T.getAttribute("role"),L=(I==null?void 0:I.startsWith("menuitem"))||I==="option"||I==="gridcell";if(A&&l&&_){if(w.defaultPrevented&&L)return;w.preventDefault(),(!i||S)&&(w.preventBaseUIHandler(),jue(T,w));return}if(!k||i||!_&&!E){A&&O&&_&&w.preventDefault();return}w.defaultPrevented||(w.preventDefault(),E&&(w.preventBaseUIHandler(),jue(T,w)))},onKeyUp(w){if(!e){if(nG(w),v==null||v(w),w.target===w.currentTarget&&i&&l&&Xue(w.currentTarget)&&w.key===" "){w.preventDefault();return}w.baseUIHandlerPrevented||w.target===w.currentTarget&&!i&&!l&&!w.defaultPrevented&&w.key===" "&&(w.preventBaseUIHandler(),jue(w.currentTarget,w))}},onPointerDown(w){if(e){w.preventDefault();return}b==null||b(w)}},i?{type:"button"}:{role:"button"},u,x)},[e,u,l,i]),f=Kl(p=>{s.current=p,h()});return{getButtonProps:d,buttonRef:f}}function Xue(t){return sm(t)&&t.tagName==="BUTTON"}function FSr(t){return sm(t)&&t.tagName==="A"&&!!t.href}const fZe=se.forwardRef(function(e,r){const{disabled:n,className:i,id:a,render:s,nativeButton:o=!0,style:l,...u}=e,{panelId:h,open:d,handleTrigger:f,disabled:p}=lZe(),g=n||p,{getButtonProps:m,buttonRef:v}=$Sr({disabled:g,focusableWhenDisabled:!0,native:o}),{defaultTriggerId:y,state:b,setTriggerId:x}=Wue(),w=a||void 0,A=w??y;return Sh(()=>(x(O=>w??(O===null?void 0:O)),()=>{x(O=>O===w?null:O)}),[w,x]),J6("button",e,{state:b,ref:[r,v],props:[{"aria-controls":d?h:void 0,"aria-expanded":d,id:A,onClick:f},u,m],stateAttributesMapping:LSr})});function zSr(t,e,r,n){return t.addEventListener(e,r,n),()=>{t.removeEventListener(e,r,n)}}function USr(t){const e=bA(VSr,t).current;return e.next=t,Sh(e.effect),e}function VSr(t){const e={current:t,next:t,effect:()=>{e.current=e.next}};return e}function QSr(t){return t==null?t:"current"in t?t.current:t}function pZe(t,e=!1){const r=ASr();return Kl((n,i=null)=>{r.cancel();const a=QSr(t);if(a==null)return;const s=a,o=()=>{ak.flushSync(n)};if(typeof s.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){n();return}function l(){Promise.all(s.getAnimations().map(u=>u.finished)).then(()=>{i!=null&&i.aborted||o()},()=>{if(i!=null&&i.aborted)return;if(s.getAnimations().some(h=>h.pending||h.playState!=="finished")){l();return}o()})}if(e){const u="data-starting-style";if(!s.hasAttribute(u)){r.request(l);return}const h=new MutationObserver(()=>{s.hasAttribute(u)||(h.disconnect(),l())});h.observe(s,{attributes:!0,attributeFilter:[u]}),i==null||i.addEventListener("abort",()=>h.disconnect(),{once:!0});return}r.request(l)})}function GSr(t){const{enabled:e=!0,open:r,ref:n,onComplete:i}=t,a=Kl(i),s=pZe(n,r);se.useEffect(()=>{if(!e)return;const o=new AbortController;return s(a,o.signal),()=>{o.abort()}},[e,r,a,s])}const eN={height:void 0,width:void 0};function HSr(t){const{externalRef:e,hiddenUntilFound:r,id:n,keepMounted:i,mounted:a,onOpenChange:s,open:o,setMounted:l,setOpen:u,transitionStatus:h}=t,d=se.useRef(null),f=se.useRef(null),[p,g]=se.useState(eN),m=se.useRef(eN),v=se.useRef(!1),y=se.useRef(o),b=se.useRef(!1),[x,w]=se.useState(!1),A=se.useRef(null),T=eG(e,d),S=USr(o),O=pZe(d),k=!o&&!a,E=x?"idle":h,_=o&&(y.current||b.current),I=!o&&a&&f.current==="css-animation"&&p.height===void 0&&p.width===void 0?m.current:p,L=r&&k&&f.current!=="css-animation",R=Kl((F,B=!0)=>{B&&(m.current=F),g(F)}),D=Kl(()=>{var F;(F=A.current)==null||F.call(A),A.current=null}),M=Kl(F=>{D(),A.current=()=>{A.current=null,F()}}),P=Kl(()=>{o&&a&&f.current==="css-animation"&&(b.current=!0)});Sh(()=>{!x||h==="starting"||w(!1)},[x,h]),se.useEffect(()=>()=>{P(),D()},[P,D]),Sh(()=>{const F=d.current;if(!F)return;!o&&A.current&&D();const B=WSr(F,_);if(f.current=B,o&&h==="idle"&&y.current&&B==="css-animation"){m.current=FE(F);return}if(o&&h==="starting"){const U=v.current;if(v.current=!1,B==="none"){R(FE(F)),w(!0);return}if(B==="css-transition"){const X=YSr(F);if(R(FE(F)),!U)return X;const Y=sG(F,"transition-duration","0s");return M(Y),w(!0),X}R(FE(F));const Q=sG(F,"animation-name","none");if(!U){Q();return}const G=sG(F,"animation-duration","0s");Q(),M(G),w(!0);return}if(!o&&a&&(h==="idle"||h==="starting")){if(y.current=!1,b.current=!1,B==="none"){R(eN,!1),l(!1);return}R(FE(F));return}if(h!=="ending")return;if(B==="none"){l(!1);return}const V=FE(F);if(!(V.height>0||V.width>0)){l(!1);return}R(V),B==="css-animation"&&sG(F,"animation-name","none")()},[a,o,D,R,l,M,_,h]),GSr({enabled:o&&a&&E==="idle",open:!0,ref:d,onComplete(){o&&R(eN,!1)}}),se.useEffect(()=>{if(o||!a||E!=="ending"||!d.current)return;const B=new AbortController;let V=-1;function z(){S.current||(l(!1),R(eN,!1))}return V=Ad.request(()=>{O(z,B.signal)}),()=>{Ad.cancel(V),B.abort()}},[S,a,o,E,O,R,l]),Sh(()=>{const F=d.current;!F||!r||!k||F.setAttribute("hidden","until-found")},[k,r]),se.useEffect(function(){const B=d.current;if(!B)return;function V(z){const U=sZe(ySr,z);s(!0,U),!U.isCanceled&&(v.current=!0,u(!0))}return zSr(B,"beforematch",V)},[s,u]);const N=i||r||a||o;return{height:I.height,props:{...L?{[Yue.startingStyle]:""}:void 0,hidden:k,id:n},ref:T,shouldPreventOpenAnimation:_,shouldRender:N,transitionStatus:E,width:I.width}}function FE(t){return{height:t.scrollHeight,width:t.scrollWidth}}function WSr(t,e){const r=Ic(t).getComputedStyle(t),n=(r.animationName.split(",").map(a=>a.trim()).some(a=>a!==""&&a!=="none")||e)&&gZe(r.animationDuration),i=gZe(r.transitionDuration);return n&&i||i?"css-transition":n?"css-animation":"none"}function gZe(t){return t.split(",").map(e=>e.trim()).some(e=>e!==""&&Number.parseFloat(e)>0)}function sG(t,e,r){const n=t.style.getPropertyValue(e),i=t.style.getPropertyPriority(e);return t.style.setProperty(e,r),()=>{if(n===""){t.style.removeProperty(e);return}t.style.setProperty(e,n,i)}}function YSr(t){const e={"justify-content":t.style.justifyContent,"align-items":t.style.alignItems,"align-content":t.style.alignContent,"justify-items":t.style.justifyItems};Object.keys(e).forEach(i=>{t.style.setProperty(i,"initial","important")});function r(){Object.entries(e).forEach(([i,a])=>{if(a===""){t.style.removeProperty(i);return}t.style.setProperty(i,a)})}const n=Ad.request(r);return()=>{Ad.cancel(n),r()}}let mZe=function(t){return t.accordionPanelHeight="--accordion-panel-height",t.accordionPanelWidth="--accordion-panel-width",t}({});const vZe=se.forwardRef(function(e,r){const{className:n,hiddenUntilFound:i,keepMounted:a,id:s,render:o,style:l,...u}=e,{hiddenUntilFound:h,keepMounted:d}=YKe(),{defaultPanelId:f,mounted:p,onOpenChange:g,open:m,setMounted:v,setOpen:y,setPanelIdState:b,transitionStatus:x}=lZe(),w=i??h,A=a??d,T=s||void 0,S=s??f;Sh(()=>(b(B=>T??(B===null?void 0:B)),()=>{b(B=>B===T?null:B)}),[T,b]);const{height:O,props:k,ref:E,shouldPreventOpenAnimation:_,shouldRender:I,transitionStatus:L,width:R}=HSr({externalRef:r,hiddenUntilFound:w,id:S,keepMounted:A,mounted:p,onOpenChange:g,open:m,setMounted:v,setOpen:y,transitionStatus:x}),{state:D,triggerId:M}=Wue(),P={...D,transitionStatus:L},N=KKe(l,P),F=J6("div",{...e,style:void 0},{state:P,ref:E,props:[k,{"aria-labelledby":M,role:"region",style:{[mZe.accordionPanelHeight]:O===void 0?"auto":`${O}px`,[mZe.accordionPanelWidth]:R===void 0?"auto":`${R}px`}},u,N?{style:N}:void 0,_?{style:{animationName:"none"}}:void 0],stateAttributesMapping:que});return I?F:null});function Kue(t){const e=se.useRef(t);return e.current=t,e}let zE=[],oG=!1;const yZe=t=>{var e,r;if(t.key==="Escape"){const[n]=zE;n&&(t.preventDefault(),(r=(e=n.callback).current)==null||r.call(e))}},bZe=()=>{zE.length>0&&!oG?(document.body.addEventListener("keydown",yZe),oG=!0):zE.length===0&&oG&&(document.body.removeEventListener("keydown",yZe),oG=!1)},qSr=t=>{zE.unshift(t),bZe()},jSr=({id:t})=>{zE=zE.filter(e=>e.id!==t),bZe()},XSr=(t,e)=>{const r=se.useId(),n=Kue(e);se.useEffect(()=>{if(!t)return;const i={id:r,callback:n};return qSr(i),()=>jSr(i)},[r,t,n])},KSr=(t,e)=>{const r=t.currentTarget,n={x:t.clientX,y:t.clientY},i=ZSr(n,r.getBoundingClientRect()),a=JSr(n,i),s=eCr(e.getBoundingClientRect());return rCr([...a,...s])};function ZSr(t,e){const r=Math.abs(e.top-t.y),n=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),a=Math.abs(e.left-t.x);switch(Math.min(r,n,i,a)){case a:return"left";case i:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function JSr(t,e,r=5){const n=[];switch(e){case"top":n.push({x:t.x-r,y:t.y+r},{x:t.x+r,y:t.y+r});break;case"bottom":n.push({x:t.x-r,y:t.y-r},{x:t.x+r,y:t.y-r});break;case"left":n.push({x:t.x+r,y:t.y-r},{x:t.x+r,y:t.y+r});break;case"right":n.push({x:t.x-r,y:t.y-r},{x:t.x-r,y:t.y+r});break}return n}function eCr(t){const{top:e,right:r,bottom:n,left:i}=t;return[{x:i,y:e},{x:r,y:e},{x:r,y:n},{x:i,y:n}]}function tCr(t,e){const{x:r,y:n}=t;let i=!1;for(let a=0,s=e.length-1;an!=f>n&&r<(d-u)*(n-h)/(f-h)+u&&(i=!i)}return i}function rCr(t){const e=t.slice();return e.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),nCr(e)}function nCr(t){if(t.length<=1)return t.slice();const e=[];for(let n=0;n=2;){const a=e[e.length-1],s=e[e.length-2];if((a.x-s.x)*(i.y-s.y)>=(a.y-s.y)*(i.x-s.x))e.pop();else break}e.push(i)}e.pop();const r=[];for(let n=t.length-1;n>=0;n--){const i=t[n];for(;r.length>=2;){const a=r[r.length-1],s=r[r.length-2];if((a.x-s.x)*(i.y-s.y)>=(a.y-s.y)*(i.x-s.x))r.pop();else break}r.push(i)}return r.pop(),e.length===1&&r.length===1&&e[0].x===r[0].x&&e[0].y===r[0].y?e:e.concat(r)}const xZe={Transition:"_Transition_1wdpp_1",Popover:"_Popover_1wdpp_3"},wZe=se.createContext(null),lG=()=>{const t=se.use(wZe);if(!t)throw new Error("Popover components must be wrapped in ");return t},tN=({open:t,onOpenChange:e,showOnHover:r=!1,hoverOpenDelay:n=150,children:i})=>{const[a,s]=se.useState(!1),[o,l]=se.useState(!1),u=se.useRef(null),h=se.useRef(null),d=se.useRef(void 0),f=se.useRef(!1),p=se.useRef(!1),g=t??a,[m,v]=se.useState(!1);bKe(()=>v(!1),m?500:null);const y=Kue(e),b=Kue(S=>{var O,k;clearTimeout(d.current),g!==S&&(S||(l(!1),r&&f.current&&((O=u.current)==null||O.focus()),f.current=!1),(k=y.current)==null||k.call(y,S),s(S),r&&v(S))}),x=se.useCallback(S=>{b.current(S)},[b]),w=se.useCallback(()=>{d.current=setTimeout(()=>x(!0),n)},[x,n]),A=se.useCallback(()=>{clearTimeout(d.current)},[]);se.useEffect(()=>()=>{clearTimeout(d.current)},[]);const T=se.useMemo(()=>({open:g,setOpen:x,shake:o,setShake:l,showOnHover:r,temporarilyPreventClickToClose:m,onTriggerEnter:w,onTriggerLeave:A,isPointerInTransitRef:p,triggerRef:u,contentRef:h,hoverOpenFocusedWithTab:f}),[g,x,o,l,r,m,f,p,w,A]);return W.jsx(wZe,{value:T,children:W.jsx(vAr,{open:g,onOpenChange:x,modal:!1,children:i})})},iCr=({children:t,onPointerDown:e,onClick:r})=>{const{setOpen:n,showOnHover:i,temporarilyPreventClickToClose:a,onTriggerEnter:s,onTriggerLeave:o,isPointerInTransitRef:l,triggerRef:u,contentRef:h}=lG(),d=se.useRef(!1),f=m=>{!(m.currentTarget.nodeName.toLocaleLowerCase()==="a")&&a&&(m.preventDefault(),m.stopPropagation())},p=m=>{m.pointerType!=="touch"&&!d.current&&!l.current&&(s(),d.current=!0)},g=()=>{d.current&&(o(),d.current=!1)};return W.jsx(yAr,{asChild:!0,ref:u,onPointerDown:m=>{f(m),e==null||e(m)},onClick:m=>{f(m),r==null||r(m)},onPointerMove:i?p:void 0,onPointerLeave:i?g:void 0,onFocus:i?()=>n(!0):void 0,onBlur:i?()=>{setTimeout(()=>{var m;(m=h.current)!=null&&m.contains(document.activeElement)||n(!1)},50)}:void 0,children:t})},AZe=({children:t,avoidCollisions:e,width:r,minWidth:n,maxWidth:i,side:a,sideOffset:s=8,align:o,alignOffset:l,translucent:u,className:h,autoFocus:d=!0})=>{const{showOnHover:f,shake:p,contentRef:g}=lG(),m=v=>{const y=g.current;if(y&&v.target===y&&v.key==="Tab"&&v.shiftKey){v.preventDefault(),v.stopPropagation();const b=SKe(y),x=b[b.length-1];x==null||x.focus()}};return se.useEffect(()=>{const v=g.current;!v||!d||v!=null&&v.contains(document.activeElement)||f||v.focus({preventScroll:!0})},[g,f,d]),W.jsx(xAr,{forceMount:!0,ref:g,className:AE(xZe.Popover,h),style:TKe({"popover-width":r,"popover-min-width":n,"popover-max-width":i}),onCloseAutoFocus:f?Due:void 0,"data-animate":p?"shake":void 0,"data-translucent":u?"true":void 0,side:a,sideOffset:s,align:o,alignOffset:l??(o==="center"?0:-5),avoidCollisions:e??!0,hideWhenDetached:!0,collisionPadding:20,onOpenAutoFocus:Due,onEscapeKeyDown:Due,onKeyDown:m,children:t})},aCr=t=>{const{setOpen:e,triggerRef:r,contentRef:n,isPointerInTransitRef:i,hoverOpenFocusedWithTab:a}=lG(),[s,o]=se.useState(null),l=se.useCallback(()=>{o(null),i.current=!1},[i]),u=se.useCallback((h,d)=>{const f=KSr(h,d);o(f),i.current=!0},[i]);return se.useEffect(()=>()=>l(),[l]),se.useEffect(()=>{const h=r.current,d=n.current;if(!h||!d)return;const f=g=>u(g,d),p=g=>u(g,h);return h.addEventListener("pointerleave",f),d.addEventListener("pointerleave",p),()=>{h.removeEventListener("pointerleave",f),d.removeEventListener("pointerleave",p)}},[n,r,u,l]),se.useEffect(()=>{if(!s)return;const h=d=>{const f=r.current,p=n.current,g=d.target,m={x:d.clientX,y:d.clientY},v=(f==null?void 0:f.contains(g))||(p==null?void 0:p.contains(g)),y=!tCr(m,s),b=g.hasAttribute("aria-haspopup");v?l():(y||b)&&(l(),e(!1))};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)},[s,e,l,r,n]),se.useEffect(()=>{const h=d=>{if(n.current&&d.key==="Tab"&&!d.shiftKey){const[f]=SKe(n.current);f&&(d.preventDefault(),f.focus(),a.current=!0,document.removeEventListener("keydown",h))}};return document.addEventListener("keydown",h),()=>{document.removeEventListener("keydown",h)}},[n,a]),W.jsx(AZe,{...t})},sCr=t=>{const{open:e,showOnHover:r,setOpen:n}=lG();return XSr(e,()=>{n(!1)}),W.jsx(bAr,{forceMount:!0,children:W.jsx(UKe,{enterDuration:600,exitDuration:300,className:xZe.Transition,disableAnimations:!0,children:e&&(r?W.jsx(aCr,{...t},"popover-hover"):W.jsx(AZe,{...t},"popover"))})})};tN.Trigger=iCr,tN.Content=sCr,se.createContext(null),se.createContext(null),se.createContext(null),se.createContext(null);function Zue(...t){return t.filter(Boolean).join(" ")}const TZe=[["14 90% 62%","28 96% 80%","3 44% 24%"],["198 72% 56%","217 88% 79%","189 42% 24%"],["263 66% 63%","291 72% 81%","242 39% 25%"],["146 49% 52%","169 66% 78%","158 38% 23%"],["334 72% 63%","15 87% 80%","350 41% 25%"]];function oCr(t){let e=2166136261;for(const s of t)e^=s.charCodeAt(0),e=Math.imul(e,16777619);const r=e>>>0,[n,i,a]=TZe[r%TZe.length];return{"--resource-identity-accent":n,"--resource-identity-glow":i,"--resource-identity-shadow":a,"--resource-identity-x":`${20+(r>>>7)%61}%`,"--resource-identity-y":`${18+(r>>>15)%57}%`}}function lCr({seed:t,className:e}){return W.jsx("span",{className:Zue("resource-card__identity-mark",e),style:oCr(t),"aria-hidden":"true"})}se.forwardRef(function({className:e,...r},n){return W.jsx("section",{ref:n,className:Zue("resource-results",e),...r})});function cCr({className:t,footer:e,actions:r,activateLabel:n,onActivate:i,children:a,...s}){return W.jsxs("article",{className:Zue("resource-card",i&&"is-interactive",t),...s,children:[i&&n?W.jsx("button",{type:"button",className:"resource-card__target","aria-label":n,title:n,onClick:i}):null,W.jsx("div",{className:"resource-card__content",children:a}),e||r?W.jsxs("footer",{className:"resource-card__footer",children:[e,r?W.jsx("div",{className:"resource-card__actions",children:r}):null]}):null]})}function uCr({leading:t,title:e,titleText:r,subtitle:n,status:i}){return W.jsxs("div",{className:"resource-card__header",children:[W.jsxs("div",{className:"resource-card__identity",children:[t,W.jsxs("div",{className:"resource-card__title-copy",children:[W.jsx("h3",{title:r,children:e}),n]})]}),i]})}function hCr({children:t,title:e}){return W.jsx("p",{className:"resource-card__description",title:e,children:t})}function dCr(t){return W.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...t,children:[W.jsx("path",{d:"M7.58 2.6a.667.667 0 0 0-.667-.667h-.666a.667.667 0 0 0-.667.667v10.667c0 .368.299.666.667.666h.666a.667.667 0 0 0 .667-.666V2.6Zm1.333 10.667A2 2 0 0 1 6.913 15.267h-.666a2 2 0 0 1-2-2V2.6a2 2 0 0 1 2-2h.666a2 2 0 0 1 2 2v10.667Z",fill:"currentColor"}),W.jsx("path",{d:"M11.88 5.045a.667.667 0 0 0-.801-.514l-.653.136a.667.667 0 0 0-.504.786l1.85 8.092c.081.358.44.589.8.514l.653-.137a.667.667 0 0 0 .504-.786L11.88 5.045Zm3.155 7.82a2 2 0 0 1-1.512 2.358l-.653.136a2 2 0 0 1-2.403-1.541L8.617 5.726a2 2 0 0 1 1.513-2.358l.652-.136a2 2 0 0 1 2.404 1.541l1.849 8.092Z",fill:"currentColor"}),W.jsx("path",{d:"M4.247 2.6a.667.667 0 0 0-.667-.667h-.667a.667.667 0 0 0-.666.667v10.667c0 .368.298.666.666.666h.667a.667.667 0 0 0 .667-.666V2.6ZM5.58 13.267a2 2 0 0 1-2 2h-.667a2 2 0 0 1-2-2V2.6a2 2 0 0 1 2-2h.667a2 2 0 0 1 2 2v10.667Z",fill:"currentColor"})]})}const fCr=["skill_hub","skill_space","knowledge_base","tool"];function SZe(t){return W.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:W.jsx("path",{d:"m4 6 4 4 4-4"})})}function CZe({label:t}){return W.jsx("div",{className:"create-agent-card__loading",role:"status","aria-label":t,children:[0,1,2].map(e=>W.jsxs("div",{className:"create-agent-card__skeleton-row","aria-hidden":"true",children:[W.jsx("span",{}),W.jsx("span",{})]},e))})}function pCr(t,e){return t.kind==="tool"?e("blocks.createAgents.builtinTool"):t.kind==="knowledge_base"?e("blocks.createAgents.knowledgeBase"):t.source.startsWith("skill_hub:")?"Skill Hub":t.source.startsWith("skill_space:")?e("blocks.createAgents.skillCenter"):"Skill"}function Jue({label:t,resources:e}){const{t:r}=Ea("conversation");return e.length===0?null:W.jsxs("section",{className:"create-agent-card__popover-section",children:[W.jsx("h4",{children:t}),W.jsx("div",{className:"create-agent-card__popover-list",children:e.map(n=>W.jsxs("div",{className:"create-agent-card__popover-item",children:[W.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[W.jsx("strong",{children:n.name}),W.jsx(ex,{color:"secondary",size:"sm",variant:"soft",children:pCr(n,r)})]}),n.description?W.jsx("p",{children:n.description}):null]},n.ref))})]})}function gCr({tools:t}){const{t:e}=Ea("conversation");return t.length===0?null:W.jsxs("section",{className:"create-agent-card__popover-section",children:[W.jsx("h4",{children:e("blocks.createAgents.selfAuthoredTools")}),W.jsx(nZe,{children:t.map((r,n)=>W.jsxs(hZe,{className:"create-agent-card__python-tool",value:`${r.name}:${n}`,children:[W.jsx(dZe,{className:"create-agent-card__python-tool-header",children:W.jsxs(fZe,{className:"create-agent-card__python-tool-trigger",children:[W.jsxs("span",{children:[W.jsx("strong",{children:r.name}),r.description?W.jsx("small",{children:r.description}):null]}),W.jsxs("span",{className:"create-agent-card__python-tool-meta",children:[W.jsx(ex,{color:"secondary",size:"sm",variant:"soft",children:e("blocks.createAgents.selfAuthoredTools")}),W.jsx(SZe,{className:"create-agent-card__python-tool-chevron"})]})]})}),W.jsxs(vZe,{className:"create-agent-card__python-tool-panel",children:[r.dependencies.length>0?W.jsx("div",{className:"create-agent-card__python-tool-dependencies",children:e("blocks.createAgents.dependencies",{items:r.dependencies.join(", ")})}):null,W.jsx("pre",{tabIndex:0,"aria-label":e("blocks.createAgents.fullCode",{name:r.name}),children:W.jsx("code",{children:r.code})})]})]},`${r.name}:${n}`))})]})}function mCr({agents:t}){const{t:e}=Ea("conversation");return t.length===0?null:W.jsxs("section",{className:"create-agent-card__popover-section",children:[W.jsx("h4",{children:e("blocks.createAgents.subAgents")}),W.jsx("div",{className:"create-agent-card__popover-list",children:t.map(r=>W.jsxs("div",{className:"create-agent-card__popover-item",children:[W.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[W.jsx("strong",{children:r.id}),W.jsx(ex,{color:"secondary",size:"sm",variant:"soft",children:e(`blocks.createAgents.agentTypes.${r.type}`,{defaultValue:r.type})})]}),r.description?W.jsx("p",{children:r.description}):null]},r.id))})]})}function cG({label:t,count:e,icon:r,children:n}){const{t:i}=Ea("conversation"),a=W.jsxs("button",{className:"create-agent-card__resource-metric",type:"button",disabled:e===0,"aria-label":i("blocks.createAgents.itemCount",{label:t,count:e}),children:[r,W.jsx("span",{children:e})]});return e===0?a:W.jsxs(tN,{showOnHover:!0,hoverOpenDelay:120,children:[W.jsx(tN.Trigger,{children:a}),W.jsx(tN.Content,{side:"top",align:"start",minWidth:"auto",maxWidth:360,className:"create-agent-card__resource-popover",children:n})]})}function vCr({response:t,status:e}){const{t:r}=Ea("conversation"),n=se.useMemo(()=>({tool:r("blocks.createAgents.sourceLabels.tool"),knowledge:r("blocks.createAgents.sourceLabels.knowledge"),skillCenter:r("blocks.createAgents.sourceLabels.skillCenter"),unknownSource:r("blocks.createAgents.sourceLabels.unknown"),unnamedResource:r("blocks.createAgents.unnamedResource"),unnamedAgent:r("blocks.createAgents.unnamedAgent")}),[r]),i=se.useMemo(()=>bTr(t,n),[n,t]),a=se.useMemo(()=>fCr.map(l=>{const u=xTr(i,l);return{value:l,label:r(`blocks.createAgents.categories.${l}`),...u,searchKeywords:[...new Set(u.sources.flatMap(h=>h.searchKeywords))]}}),[i,r]),s=e==="failed",o=s?JQ(t):"";return W.jsx("section",{className:"create-agent-tool-card","aria-label":r("blocks.createAgents.collectionAria"),children:e==="running"?W.jsx(CZe,{label:r("blocks.createAgents.retrieving")}):s?W.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[W.jsx("span",{className:"create-agent-card__message-title",children:r("blocks.createAgents.retrievalFailed")}),W.jsx("span",{children:o||r("blocks.createAgents.checkConfig")})]}):W.jsx(nZe,{className:"create-agent-card__accordion",children:a.map(l=>W.jsxs(hZe,{className:"create-agent-card__accordion-item",value:l.value,children:[W.jsx(dZe,{className:"create-agent-card__accordion-header",children:W.jsxs(fZe,{className:"create-agent-card__accordion-trigger",children:[W.jsx("span",{children:l.label}),W.jsxs("span",{className:"create-agent-card__accordion-meta",children:[W.jsx(ex,{color:"secondary",size:"sm",variant:"soft",children:l.sources.length===0?l.value==="skill_hub"?r("blocks.createAgents.notSearched"):r("blocks.createAgents.notConfigured"):l.resources.length}),W.jsx(SZe,{className:"create-agent-card__accordion-chevron"})]})]})}),W.jsx(vZe,{className:"create-agent-card__accordion-content",children:W.jsxs("div",{className:"create-agent-card__accordion-scroll",role:"region","aria-label":r("blocks.createAgents.resourceList",{label:l.label}),tabIndex:0,children:[l.value==="skill_hub"&&l.searchKeywords.length>0?W.jsxs("div",{className:"create-agent-card__search-keywords",children:[W.jsx("span",{children:r("blocks.createAgents.searchKeywords")}),W.jsx("span",{children:l.searchKeywords.join("、")})]}):null,l.resources.length>0?W.jsx("div",{className:"create-agent-card__resource-list",children:l.resources.map(u=>W.jsx("div",{className:"create-agent-card__resource",children:W.jsxs("div",{className:"create-agent-card__resource-main",children:[W.jsxs("div",{className:"create-agent-card__resource-title",children:[W.jsx("span",{className:"create-agent-card__resource-name",children:u.name}),u.version?W.jsx(ex,{className:"create-agent-card__resource-version",color:"secondary",size:"sm",variant:"soft",children:u.version}):null]}),u.description?W.jsx("p",{children:u.description}):null]})},u.ref))}):W.jsxs("div",{className:"create-agent-card__empty-category",children:[W.jsx("p",{children:l.sources.length===0?l.value==="skill_hub"?r("blocks.createAgents.skillHubSkipped"):r("blocks.createAgents.sourceSkipped",{label:l.label}):r("blocks.createAgents.noResources")}),l.sources.filter(u=>u.message).map(u=>W.jsx("p",{className:"create-agent-card__raw-source-error",children:u.message},u.source))]})]})})]},l.value))},i.collectionId||"collected-resources")})}function yCr({args:t,response:e,status:r}){const{t:n}=Ea("conversation"),i=se.useMemo(()=>({tool:n("blocks.createAgents.sourceLabels.tool"),knowledge:n("blocks.createAgents.sourceLabels.knowledge"),skillCenter:n("blocks.createAgents.sourceLabels.skillCenter"),unknownSource:n("blocks.createAgents.sourceLabels.unknown"),unnamedResource:n("blocks.createAgents.unnamedResource"),unnamedAgent:n("blocks.createAgents.unnamedAgent")}),[n]),a=se.useMemo(()=>NKe(t,e,i),[t,i,e]),s=r==="failed"?JQ(e):"";return W.jsxs("section",{className:"create-agent-tool-card is-agent-results","aria-label":n("blocks.createAgents.resultAria"),children:[s?W.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[W.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.creationFailed")}),W.jsx("span",{children:s})]}):null,a.agents.length>0?W.jsx("div",{className:"create-agent-card__agent-grid",children:a.agents.map(o=>{const l=r==="failed"?"failed":o.status,u=o.error||l==="failed"&&s,h=o.builtinTools.length+o.pythonTools.length;return W.jsxs(cCr,{className:`create-agent-card__agent-card${u?" is-error":""}`,children:[W.jsx(uCr,{leading:W.jsx(lCr,{seed:o.name}),title:o.name,titleText:o.name,status:W.jsx(ex,{color:"secondary",size:"sm",variant:"soft",children:n(`blocks.createAgents.agentTypes.${o.rootType}`,{defaultValue:o.rootType})})}),o.description?W.jsx(hCr,{children:o.description}):null,u?W.jsx("div",{className:"create-agent-card__agent-result is-error",role:"alert",children:u}):null,W.jsxs("div",{className:"create-agent-card__agent-resources","aria-label":n("blocks.createAgents.agentResources",{name:o.name}),children:[W.jsx(cG,{label:n("blocks.createAgents.skill"),count:o.skills.length,icon:W.jsx(BTr,{"aria-hidden":"true"}),children:W.jsx(Jue,{label:n("blocks.createAgents.skill"),resources:o.skills})}),W.jsx(cG,{label:n("blocks.createAgents.knowledgeBase"),count:o.knowledgeBases.length,icon:W.jsx(dCr,{"aria-hidden":"true"}),children:W.jsx(Jue,{label:n("blocks.createAgents.knowledgeBase"),resources:o.knowledgeBases})}),W.jsxs(cG,{label:n("blocks.createAgents.toolsLabel"),count:h,icon:W.jsx(NTr,{"aria-hidden":"true"}),children:[W.jsx(Jue,{label:n("blocks.createAgents.builtinTool"),resources:o.builtinTools}),W.jsx(gCr,{tools:o.pythonTools})]}),W.jsx(cG,{label:n("blocks.createAgents.subAgents"),count:o.subAgentCount,icon:W.jsx($Tr,{"aria-hidden":"true"}),children:W.jsx(mCr,{agents:o.subAgents})})]})]},o.name)})}):r==="running"?W.jsx(CZe,{label:n("blocks.createAgents.creating")}):W.jsxs("div",{className:"create-agent-card__message",children:[W.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.noAgents")}),W.jsx("span",{children:n("blocks.createAgents.noAgentResult")})]})]})}const bCr={web_search:{name:"web_search",runningLabel:"Searching the web",doneLabel:"Web search complete",tone:"search",icon:DKe},link_reader:{name:"link_reader",runningLabel:"Reading webpage",doneLabel:"Webpage read complete",tone:"search",icon:DKe},run_code:{name:"run_code",runningLabel:"Running code in the AgentKit sandbox",doneLabel:"Code execution completed in the AgentKit sandbox",tone:"sandbox",icon:hTr},list_envs:{name:"list_envs",runningLabel:"Checking available environments",doneLabel:"Available environments loaded",tone:"resources",icon:fTr},get_env_manifest:{name:"get_env_manifest",runningLabel:"Loading the environment manifest",doneLabel:"Environment manifest loaded",tone:"knowledge",icon:pTr},execute_in_sandbox:{name:"execute_in_sandbox",runningLabel:"Running a command in the environment",doneLabel:"Command completed in the environment",tone:"sandbox",icon:MKe},delegate_to_codex_sandbox:{name:"delegate_to_codex_sandbox",runningLabel:"Codex Sandbox is running",doneLabel:"Codex Sandbox completed",failedLabel:"Codex Sandbox failed",tone:"sandbox",icon:MKe},image_generate:{name:"image_generate",runningLabel:"Generating image",doneLabel:"Image generated",tone:"image",icon:aTr},video_generate:{name:"video_generate",runningLabel:"Generating video",doneLabel:"Video generated",tone:"video",icon:sTr},ppt_generate:{name:"ppt_generate",runningLabel:"Generating presentation",doneLabel:"Presentation generated",tone:"presentation",icon:oTr},load_memory:{name:"load_memory",runningLabel:"Searching long-term memory",doneLabel:"Memory search complete",tone:"memory",icon:lTr},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"Searching the knowledge base",doneLabel:"Knowledge base search complete",tone:"knowledge",icon:cTr},load_skill:{name:"load_skill",runningLabel:"Loading skill",doneLabel:"Skill loaded",tone:"skill",icon:uTr},collect_resources:{name:"collect_resources",runningLabel:"Collecting available resources",doneLabel:"Resource collection complete",failedLabel:"Resource collection failed",tone:"resources",icon:dTr,detailRenderer:vCr},create_agents:{name:"create_agents",runningLabel:"Creating and running agents",doneLabel:"Agent creation complete",failedLabel:"Agent creation failed",tone:"agent",icon:LKe,detailRenderer:yCr},branch_compare:{name:"branch_compare",runningLabel:"",doneLabel:"",failedLabel:"",tone:"search",icon:LKe,detailRenderer:zTr,hideHeader:!0}};function xCr(t){return bCr[t]}function OZe(t){return W.jsx("svg",{viewBox:"0 0 111 117",fill:"none","aria-hidden":"true",...t,children:W.jsx("path",{d:"M0 5.6016C7.82288e-05 0.621244 6.02226 -1.87314 9.54395 1.64847L40.1289 32.2334L68.5732 3.7891C69.5834 2.77903 70.9533 2.21099 72.3818 2.21097H82.7031C82.7917 2.20658 82.8806 2.20414 82.9697 2.20414H104.775C109.574 2.20427 111.977 8.00691 108.584 11.4004L64.916 55.0664C64.3075 55.8528 63.9436 56.7647 63.8242 57.6993C63.7142 56.4884 63.1964 55.3069 62.2695 54.3799L45.4082 37.5186H45.4072L40.124 32.2354L17.832 54.5284C16.7671 55.5933 16.2416 56.993 16.2549 58.3887C16.2417 59.7843 16.7672 61.1842 17.832 62.2491L39.9287 84.3467L9.54395 114.733C6.0223 118.255 0.000223474 115.761 0 110.78V5.6016ZM63.8018 58.8702C63.8962 59.9086 64.2936 60.9229 64.9961 61.7735L108.591 105.368C111.984 108.762 109.58 114.564 104.781 114.564H94.4336C94.3543 114.568 94.274 114.569 94.1934 114.569H72.3877C70.9592 114.569 69.5892 114.002 68.5791 112.992L39.9336 84.3467L58.4531 65.8282L58.4453 65.8203L62.2695 61.9981C63.1476 61.12 63.6567 60.0136 63.8018 58.8702Z",fill:"currentColor"})})}function wCr(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.jsx("path",{d:"M6 3h8l4 4v14H6Z"}),W.jsx("path",{d:"M14 3v5h5"}),W.jsx("path",{d:"m10 12-2 2 2 2M14 12l2 2-2 2"})]})}function ACr(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.jsx("path",{d:"M12 3 19 6v5c0 4.6-2.8 7.8-7 10-4.2-2.2-7-5.4-7-10V6l7-3Z"}),W.jsx("path",{d:"m9 12 2 2 4-4"})]})}qg.hasResourceBundle("en-US","workspaceTools")||qg.addResourceBundle("en-US","workspaceTools",y$e,!0,!0),qg.hasResourceBundle("zh-CN","workspaceTools")||qg.addResourceBundle("zh-CN","workspaceTools",RUe,!0,!0);function TCr(t,e){const r=new Map(t.map(s=>[s.path,s.content])),n=new Map(e.map(s=>[s.path,s.content])),i=new Set([...r.keys(),...n.keys()]),a=[];for(const s of[...i].sort((o,l)=>o.localeCompare(l))){const o=r.get(s),l=n.get(s);o!==l&&a.push({path:s,status:o===void 0?"added":l===void 0?"deleted":"modified",before:o??"",after:l??""})}return a}function xA(t){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...t}}function SCr(t){return W.jsx("svg",{...xA(t),children:W.jsx("path",{d:"m9 7-5 5 5 5M15 7l5 5-5 5M13.5 4l-3 16"})})}function ehe(t){return W.jsx("svg",{...xA(t),children:W.jsx("path",{d:"M6.5 3.75h7l4 4V20.25h-11zM13.5 3.75v4h4M9 12h6M9 15.5h4.5"})})}function CCr(t){return W.jsx("svg",{...xA(t),children:W.jsx("path",{d:"M3.75 7.25h6l1.75 2h8.75v9.25H3.75zM3.75 7.25V5.5h5l1.5 1.75"})})}function OCr(t){return W.jsx("svg",{...xA(t),children:W.jsx("path",{d:"m9 5 7 7-7 7"})})}function kCr(t){return W.jsx("svg",{...xA(t),children:W.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function ECr(t){return W.jsxs("svg",{...xA(t),children:[W.jsx("circle",{cx:"12",cy:"12",r:"3.25"}),W.jsx("path",{d:"M12 2.75v2M12 19.25v2M2.75 12h2M19.25 12h2M5.45 5.45l1.4 1.4M17.15 17.15l1.4 1.4M18.55 5.45l-1.4 1.4M6.85 17.15l-1.4 1.4"})]})}function _Cr(t){return W.jsx("svg",{...xA(t),children:W.jsx("path",{d:"M19.25 15.25A8 8 0 0 1 8.75 4.75a8 8 0 1 0 10.5 10.5Z"})})}const RCr=se.lazy(()=>Promise.resolve().then(()=>l1n)),DCr=se.lazy(()=>Promise.resolve().then(()=>z1n)),kZe="veadk-code-workspace-theme";function LCr(t){const e={name:"",children:new Map};for(const r of t){const n=r.path.split("/").filter(Boolean);let i=e;n.forEach((a,s)=>{let o=i.children.get(a);o||(o={name:a,children:new Map},i.children.set(a,o)),s===n.length-1&&(o.path=r.path),i=o})}return e}function MCr(t,e=!1){return[...t.children.values()].sort((r,n)=>{const i=r.children.size>0&&r.path===void 0,a=n.children.size>0&&n.path===void 0;return i!==a?e?i?1:-1:i?-1:1:r.name.localeCompare(n.name)})}function ICr(){if(typeof window>"u")return"light";try{return window.localStorage.getItem(kZe)==="dark"?"dark":"light"}catch{return"light"}}function PCr(t){return t===""?0:t.split(` -`).length}function EZe({project:t,open:e,onClose:r,onChange:n,readOnly:i=!1,comparison:a}){var L;const{t:s}=Ea("workspaceTools"),o=se.useId(),l=se.useRef(null),u=se.useRef(null),h=se.useRef(r),[d,f]=se.useState(ICr),p=se.useMemo(()=>a?TCr(a.baseProject.files,t.files):[],[a,t.files]),g=se.useMemo(()=>a?p.map(R=>({path:R.path,content:R.status==="deleted"?R.before:R.after})):t.files,[p,a,t.files]),m=se.useMemo(()=>new Map(p.map(R=>[R.path,R.status])),[p]),[v,y]=se.useState(((L=g[0])==null?void 0:L.path)??null),[b,x]=se.useState(new Set),w=se.useMemo(()=>LCr(g),[g]),A=g.find(R=>R.path===v)??null,T=p.find(R=>R.path===v)??null;if(h.current=r,se.useEffect(()=>{try{window.localStorage.setItem(kZe,d)}catch{}},[d]),se.useEffect(()=>{var P;if(!e)return;const R=document.body.style.overflow,D=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(P=u.current)==null||P.focus();const M=N=>{if(N.key==="Escape"){N.preventDefault(),h.current();return}if(N.key!=="Tab"||!l.current)return;const F=[...l.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')].filter(z=>z.offsetParent!==null);if(F.length===0)return;const B=F[0],V=F[F.length-1];N.shiftKey&&document.activeElement===B?(N.preventDefault(),V.focus()):!N.shiftKey&&document.activeElement===V&&(N.preventDefault(),B.focus())};return window.addEventListener("keydown",M),()=>{document.body.style.overflow=R,window.removeEventListener("keydown",M),D!=null&&D.isConnected&&D.focus()}},[e]),se.useEffect(()=>{A||g.length===0||y(g[0].path)},[g,A]),!e)return null;function S(R){x(D=>{const M=new Set(D);return M.has(R)?M.delete(R):M.add(R),M})}function O(R){return R?W.jsx("span",{className:`code-browser-change is-${R}`,children:s(`codeBrowser.change.${R}`)}):null}function k(R,D,M){return MCr(R,D===0).map(P=>{const N=M?`${M}/${P.name}`:P.name;if(!(P.children.size>0&&P.path===void 0)&&P.path){const V=m.get(P.path);return W.jsxs("button",{type:"button",className:`code-browser-file${v===P.path?" is-active":""}`,style:{paddingLeft:`${12+D*16}px`},onClick:()=>y(P.path??null),title:P.path,"aria-pressed":v===P.path,children:[W.jsx(ehe,{}),W.jsx("span",{children:P.name}),O(V)]},N)}const B=b.has(N);return W.jsxs("div",{children:[W.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+D*16}px`},onClick:()=>S(N),"aria-expanded":!B,children:[W.jsx(OCr,{className:B?"":"is-open"}),W.jsx(CCr,{}),W.jsx("span",{children:P.name})]}),!B&&k(P,D+1,N)]},N)})}function E(R){!A||a||n({...t,files:t.files.map(D=>D.path===A.path?{...D,content:R}:D)})}const _=d==="light"?"dark":"light",I=s(a?"codeBrowser.noChanges":"codeBrowser.chooseFile");return ak.createPortal(W.jsx("div",{className:"code-browser-backdrop",onMouseDown:R=>{R.target===R.currentTarget&&r()},children:W.jsxs("section",{ref:l,className:`code-browser-dialog is-${d}`,role:"dialog","aria-modal":"true","aria-labelledby":o,children:[W.jsxs("header",{className:"code-browser-head",children:[W.jsxs("div",{className:"code-browser-title-wrap",children:[W.jsx("span",{className:"code-browser-title-icon",children:W.jsx(SCr,{})}),W.jsxs("div",{children:[W.jsx("h2",{id:o,children:s(a?"codeBrowser.compareTitle":"codeBrowser.workspaceTitle")}),W.jsx("p",{title:t.name,children:t.name||s("codeBrowser.projectFallback")})]})]}),W.jsxs("div",{className:"code-browser-head-actions",children:[W.jsx("button",{type:"button",className:"code-browser-icon-button",onClick:()=>f(_),"aria-label":s("codeBrowser.switchTheme"),title:s("codeBrowser.switchThemeTitle",{theme:s(`codeBrowser.themes.${_}`)}),children:d==="light"?W.jsx(_Cr,{}):W.jsx(ECr,{})}),W.jsx("button",{ref:u,type:"button",className:"code-browser-icon-button",onClick:r,"aria-label":s("codeBrowser.closeWorkspace"),title:s("codeBrowser.close"),children:W.jsx(kCr,{})})]})]}),W.jsxs("div",{className:"code-browser-workspace",children:[W.jsxs("aside",{className:"code-browser-sidebar","aria-label":s(a?"codeBrowser.changedFiles":"codeBrowser.projectFiles"),children:[W.jsxs("div",{className:"code-browser-sidebar-head",children:[W.jsx("span",{children:s(a?"codeBrowser.changes":"codeBrowser.files")}),W.jsx("span",{children:g.length})]}),W.jsx("div",{className:"code-browser-tree",children:g.length>0?k(w,0,""):W.jsx("div",{className:"code-browser-empty",children:I})})]}),W.jsxs("main",{className:"code-browser-main",children:[W.jsx("div",{className:"code-browser-tabs",role:"tablist","aria-label":s("codeBrowser.openFiles"),children:A?W.jsxs("div",{className:"code-browser-tab",role:"tab","aria-selected":"true",children:[W.jsx(ehe,{}),W.jsx("span",{children:A.path.split("/").pop()}),O(T==null?void 0:T.status)]}):null}),W.jsxs("div",{className:"code-browser-path",children:[W.jsx(ehe,{}),W.jsx("span",{children:(A==null?void 0:A.path)??s("codeBrowser.noFileSelected")})]}),a?W.jsxs("div",{className:"code-browser-diff-labels","aria-label":s("codeBrowser.comparisonDirection"),children:[W.jsx("span",{children:a.baseLabel??s("codeBrowser.before")}),W.jsx("span",{children:a.targetLabel??s("codeBrowser.after")})]}):null,W.jsx("div",{className:"code-browser-editor",children:A?W.jsx(se.Suspense,{fallback:W.jsx("div",{className:"code-browser-empty",children:s("codeBrowser.loadingEditor")}),children:T?W.jsx(DCr,{before:T.before,after:T.after,path:T.path,theme:d}):W.jsx(RCr,{value:A.content,path:A.path,onChange:E,readOnly:i,theme:d})}):W.jsx("div",{className:"code-browser-empty",children:I})}),W.jsxs("footer",{className:"code-browser-statusbar",children:[W.jsx("span",{children:a?s("codeBrowser.changedFileCount",{count:p.length}):s("codeBrowser.fileCount",{count:t.files.length})}),W.jsx("span",{children:A?s("codeBrowser.lineCount",{count:PCr(A.content)}):"UTF-8"})]})]})]})]})}),document.body)}const _Ze="send_a2ui_json_to_client",NCr=28,BCr=3e3;function $Cr(t,e,r){let n=e;for(let i=0;i65535?2:1}return n}function FCr(t){return t<=4?1:Math.min(18,Math.max(2,Math.ceil(t/6)))}function RZe(t,e,r,n){const[i,a]=se.useState(()=>e?"":t),s=se.useRef(i),o=se.useRef(t),l=se.useRef(null),u=se.useRef(0),h=se.useRef(r);return o.current=t,h.current=r,se.useEffect(()=>{const d=s.current,f=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!e||f||!t.startsWith(d)){l.current!==null&&window.cancelAnimationFrame(l.current),l.current=null,d!==t&&(s.current=t,a(t));return}if(d===t||l.current!==null)return;const p=g=>{const m=o.current,v=s.current;if(!m.startsWith(v)){s.current=m,a(m),l.current=null;return}if(g-u.current{var d;(d=h.current)==null||d.call(h)},[i]),se.useEffect(()=>{i===t&&(n==null||n())},[i,n,t]),se.useEffect(()=>()=>{l.current!==null&&(window.cancelAnimationFrame(l.current),l.current=null)},[]),i}function zCr(){return W.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:W.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 UCr(){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[W.jsx("path",{d:"m4.5 7 1.8 1.8L9.5 5.5"}),W.jsx("path",{d:"M12 7h7.5"}),W.jsx("path",{d:"m4.5 13 1.8 1.8 3.2-3.3"}),W.jsx("path",{d:"M12 13h7.5"}),W.jsx("path",{d:"M5 19h4"}),W.jsx("path",{d:"M12 19h7.5"})]})}function VCr(){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[W.jsx("path",{d:"M5 5v7.25A3.75 3.75 0 0 0 8.75 16H19"}),W.jsx("path",{d:"m15.5 12.5 3.5 3.5-3.5 3.5"})]})}function QCr({activity:t}){const{t:e}=Ea("conversation"),r=[["Agent Session",t.agentSessionId],["Sandbox Session",t.sandboxSessionId],["Codex Thread",t.threadId]].filter(n=>!!n[1]);return r.length?W.jsx("dl",{className:"codex-sandbox-run__identity","aria-label":e("blocks.sandboxIdentity"),children:r.map(([n,i])=>W.jsxs("div",{children:[W.jsx("dt",{children:n}),W.jsx("dd",{title:i,children:i})]},n))}):null}function GCr(t,e,r){if(t!=="load_skill"||e==null||typeof e!="object"||Array.isArray(e))return;const n=e.skill_name;if(!(typeof n!="string"||!n.trim()))return r("blocks.useSkill",{name:n.trim()})}function DZe({text:t,done:e,answerStarted:r=!1,streaming:n=!1,onStreamFrame:i}){const{t:a}=Ea("conversation"),[s,o]=se.useState(!(e||r)),l=se.useRef(!1);se.useEffect(()=>{l.current||o(!(e||r))},[r,e]);const u=()=>{l.current=!0,o(g=>!g)},h=t.replace(/\r\n?/g,` +`)},y2r=0,EE=[];function b2r(t){var e=se.useRef([]),r=se.useRef([0,0]),n=se.useRef(),i=se.useState(y2r++)[0],a=se.useState(gXe)[0],s=se.useRef(t);se.useEffect(function(){s.current=t},[t]),se.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var m=zxr([t.lockRef.current],(t.shards||[]).map(AXe),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var o=se.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var y=PQ(m),b=r.current,x="deltaX"in m?m.deltaX:b[0]-y[0],w="deltaY"in m?m.deltaY:b[1]-y[1],A,S=m.target,T=Math.abs(x)>Math.abs(w)?"h":"v";if("touches"in m&&T==="h"&&S.type==="range")return!1;var O=window.getSelection(),k=O&&O.anchorNode,E=k?k===S||k.contains(S):!1;if(E)return!1;var _=yXe(T,S);if(!_)return!0;if(_?A=T:(A=T==="v"?"h":"v",_=yXe(T,S)),!_)return!1;if(!n.current&&"changedTouches"in m&&(x||w)&&(n.current=A),!A)return!0;var I=n.current||A;return g2r(I,v,m,I==="h"?x:w)},[]),l=se.useCallback(function(m){var v=m;if(!(!EE.length||EE[EE.length-1]!==a)){var y="deltaY"in v?wXe(v):PQ(v),b=e.current.filter(function(A){return A.name===v.type&&(A.target===v.target||v.target===A.shadowParent)&&m2r(A.delta,y)})[0];if(b&&b.should){v.cancelable&&v.preventDefault();return}if(!b){var x=(s.current.shards||[]).map(AXe).filter(Boolean).filter(function(A){return A.contains(v.target)}),w=x.length>0?o(v,x[0]):!s.current.noIsolation;w&&v.cancelable&&v.preventDefault()}}},[]),u=se.useCallback(function(m,v,y,b){var x={name:m,delta:v,target:y,should:b,shadowParent:x2r(y)};e.current.push(x),setTimeout(function(){e.current=e.current.filter(function(w){return w!==x})},1)},[]),h=se.useCallback(function(m){r.current=PQ(m),n.current=void 0},[]),d=se.useCallback(function(m){u(m.type,wXe(m),m.target,o(m,t.lockRef.current))},[]),f=se.useCallback(function(m){u(m.type,PQ(m),m.target,o(m,t.lockRef.current))},[]);se.useEffect(function(){return EE.push(a),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,kE),document.addEventListener("touchmove",l,kE),document.addEventListener("touchstart",h,kE),function(){EE=EE.filter(function(m){return m!==a}),document.removeEventListener("wheel",l,kE),document.removeEventListener("touchmove",l,kE),document.removeEventListener("touchstart",h,kE)}},[]);var p=t.removeScrollBar,g=t.inert;return se.createElement(se.Fragment,null,g?se.createElement(a,{styles:v2r(i)}):null,p?se.createElement(l2r,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function x2r(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const w2r=jxr(pXe,b2r);var SXe=se.forwardRef(function(t,e){return se.createElement(MQ,nm({},t,{ref:e,sideCar:w2r}))});SXe.classNames=MQ.classNames;var A2r=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},_E=new WeakMap,NQ=new WeakMap,BQ={},cue=0,TXe=function(t){return t&&(t.host||TXe(t.parentNode))},S2r=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=TXe(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},T2r=function(t,e,r,n){var i=S2r(e,Array.isArray(t)?t:[t]);BQ[r]||(BQ[r]=new WeakMap);var a=BQ[r],s=[],o=new Set,l=new Set(i),u=function(d){!d||o.has(d)||(o.add(d),u(d.parentNode))};i.forEach(u);var h=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(o.has(f))h(f);else try{var p=f.getAttribute(n),g=p!==null&&p!=="false",m=(_E.get(f)||0)+1,v=(a.get(f)||0)+1;_E.set(f,m),a.set(f,v),s.push(f),m===1&&g&&NQ.set(f,!0),v===1&&f.setAttribute(r,"true"),g||f.setAttribute(n,"true")}catch(y){console.error("aria-hidden: cannot operate on ",f,y)}})};return h(e),o.clear(),cue++,function(){s.forEach(function(d){var f=_E.get(d)-1,p=a.get(d)-1;_E.set(d,f),a.set(d,p),f||(NQ.has(d)||d.removeAttribute(n),NQ.delete(d)),p||d.removeAttribute(r)}),cue--,cue||(_E=new WeakMap,_E=new WeakMap,NQ=new WeakMap,BQ={})}},C2r=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=A2r(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live], script"))),T2r(n,i,r,"aria-hidden")):function(){return null}},O2r=Object.defineProperty,k2r=(t,e)=>O2r(t,"name",{value:e,configurable:!0});function CXe(t){const[e,r]=se.useState(void 0);return Fp(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let s,o;if("borderBoxSize"in a){const l=a.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,o=u.blockSize}else s=t.offsetWidth,o=t.offsetHeight;r({width:s,height:o})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}k2r(CXe,"useSize");const E2r=["top","right","bottom","left"],jb=Math.min,Uv=Math.max,$Q=Math.round,FQ=Math.floor,Vv=t=>({x:t,y:t}),_2r={left:"right",right:"left",bottom:"top",top:"bottom"};function OXe(t,e,r){return Uv(t,jb(e,r))}function Qv(t,e){return typeof t=="function"?t(e):t}function Xb(t){return t.split("-")[0]}function RE(t){return t.split("-")[1]}function uue(t){return t==="x"?"y":"x"}function hue(t){return t==="y"?"height":"width"}function im(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function due(t){return uue(im(t))}function R2r(t,e,r){r===void 0&&(r=!1);const n=RE(t),i=due(t),a=hue(i);let s=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(s=zQ(s)),[s,zQ(s)]}function D2r(t){const e=zQ(t);return[fue(t),e,fue(e)]}function fue(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const kXe=["left","right"],EXe=["right","left"],L2r=["top","bottom"],M2r=["bottom","top"];function I2r(t,e,r){switch(t){case"top":case"bottom":return r?e?EXe:kXe:e?kXe:EXe;case"left":case"right":return e?L2r:M2r;default:return[]}}function P2r(t,e,r,n){const i=RE(t);let a=I2r(Xb(t),r==="start",n);return i&&(a=a.map(s=>s+"-"+i),e&&(a=a.concat(a.map(fue)))),a}function zQ(t){const e=Xb(t);return _2r[e]+t.slice(e.length)}function N2r(t){var e,r,n,i;return{top:(e=t.top)!=null?e:0,right:(r=t.right)!=null?r:0,bottom:(n=t.bottom)!=null?n:0,left:(i=t.left)!=null?i:0}}function _Xe(t){return typeof t!="number"?N2r(t):{top:t,right:t,bottom:t,left:t}}function UQ(t){const{x:e,y:r,width:n,height:i}=t;return{width:n,height:i,top:r,left:e,right:e+n,bottom:r+i,x:e,y:r}}function RXe(t,e,r){let{reference:n,floating:i}=t;const a=im(e),s=due(e),o=hue(s),l=Xb(e),u=a==="y",h=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,f=n[o]/2-i[o]/2;let p;switch(l){case"top":p={x:h,y:n.y-i.height};break;case"bottom":p={x:h,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-i.width,y:d};break;default:p={x:n.x,y:n.y}}const g=RE(e);return g&&(p[s]+=f*(g==="end"?1:-1)*(r&&u?-1:1)),p}async function B2r(t,e){var r;e===void 0&&(e={});const{x:n,y:i,platform:a,rects:s,elements:o,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Qv(e,t),g=_Xe(p),v=o[f?d==="floating"?"reference":"floating":d],y=UQ(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(v)))==null||r?v:v.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(o.floating)),boundary:u,rootBoundary:h,strategy:l})),b=d==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,x=await(a.getOffsetParent==null?void 0:a.getOffsetParent(o.floating)),w=await(a.isElement==null?void 0:a.isElement(x))&&await(a.getScale==null?void 0:a.getScale(x))||{x:1,y:1},A=UQ(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:b,offsetParent:x,strategy:l}):b);return{top:(y.top-A.top+g.top)/w.y,bottom:(A.bottom-y.bottom+g.bottom)/w.y,left:(y.left-A.left+g.left)/w.x,right:(A.right-y.right+g.right)/w.x}}const $2r=50,F2r=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:a=[],platform:s}=r,o=s.detectOverflow?s:{...s,detectOverflow:B2r},l=await(s.isRTL==null?void 0:s.isRTL(e));let u=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:h,y:d}=RXe(u,n,l),f=n,p=0;const g={};for(let m=0;m({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:a,platform:s,elements:o,middlewareData:l}=e,{element:u,padding:h=0}=Qv(t,e)||{};if(u==null)return{};const d=_Xe(h),f={x:r,y:n},p=due(i),g=hue(p),m=await s.getDimensions(u),v=p==="y",y=v?"top":"left",b=v?"bottom":"right",x=v?"clientHeight":"clientWidth",w=a.reference[g]+a.reference[p]-f[p]-a.floating[g],A=f[p]-a.reference[p],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let T=S?S[x]:0;(!T||!await(s.isElement==null?void 0:s.isElement(S)))&&(T=o.floating[x]||a.floating[g]);const O=w/2-A/2,k=T/2-m[g]/2-1,E=jb(d[y],k),_=jb(d[b],k),I=T-m[g]-_,L=T/2-m[g]/2+O,R=OXe(E,L,I),D=!l.arrow&&RE(i)!=null&&L!==R&&a.reference[g]/2-(LR<=0)){var _,I;const R=(((_=a.flip)==null?void 0:_.index)||0)+1,D=T[R];if(D&&(!(d==="alignment"?b!==im(D):!1)||E.every(N=>im(N.placement)===b?N.overflows[0]>0:!0)))return{data:{index:R,overflows:E},reset:{placement:D}};let M=(I=E.filter(P=>P.overflows[0]<=0).sort((P,N)=>P.overflows[1]-N.overflows[1])[0])==null?void 0:I.placement;if(!M)switch(p){case"bestFit":{var L;const P=(L=E.filter(N=>{if(S){const F=im(N.placement);return F===b||F==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(F=>F>0).reduce((F,B)=>F+B,0)]).sort((N,F)=>N[1]-F[1])[0])==null?void 0:L[0];P&&(M=P);break}case"initialPlacement":M=o;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function DXe(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function LXe(t){return E2r.some(e=>t[e]>=0)}const V2r=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r,platform:n}=e,{strategy:i="referenceHidden",...a}=Qv(t,e);switch(i){case"referenceHidden":{const s=await n.detectOverflow(e,{...a,elementContext:"reference"}),o=DXe(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:LXe(o)}}}case"escaped":{const s=await n.detectOverflow(e,{...a,altBoundary:!0}),o=DXe(s,r.floating);return{data:{escapedOffsets:o,escaped:LXe(o)}}}default:return{}}}}},MXe=new Set(["left","top"]);async function Q2r(t,e){const{placement:r,platform:n,elements:i}=t,a=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=Xb(r),o=RE(r),l=im(r)==="y",u=MXe.has(s)?-1:1,h=a&&l?-1:1,d=Qv(e,t);let{mainAxis:f,crossAxis:p,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return o&&typeof g=="number"&&(p=o==="end"?g*-1:g),l?{x:p*h,y:f*u}:{x:f*u,y:p*h}}const G2r=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:i,y:a,placement:s,middlewareData:o}=e,l=await Q2r(e,t);return s===((r=o.offset)==null?void 0:r.placement)&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:s}}}}},H2r=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i,platform:a}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:l={fn:b=>{let{x,y:w}=b;return{x,y:w}}},...u}=Qv(t,e),h={x:r,y:n},d=await a.detectOverflow(e,u),f=im(i),p=uue(f);let g=h[p],m=h[f];const v=(b,x)=>OXe(x+d[b==="y"?"top":"left"],x,x-d[b==="y"?"bottom":"right"]);s&&(g=v(p,g)),o&&(m=v(f,m));const y=l.fn({...e,[p]:g,[f]:m});return{...y,data:{x:y.x-r,y:y.y-n,enabled:{[p]:s,[f]:o}}}}}},W2r=function(t){return t===void 0&&(t={}),{options:t,fn(e){var r,n;const{x:i,y:a,placement:s,rects:o,middlewareData:l}=e,{offset:u=0,mainAxis:h=!0,crossAxis:d=!0}=Qv(t,e),f={x:i,y:a},p=im(s),g=uue(p);let m=f[g],v=f[p];const y=Qv(u,e),b=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:(r=y.mainAxis)!=null?r:0,crossAxis:(n=y.crossAxis)!=null?n:0};if(h){const A=g==="y"?"height":"width",S=o.reference[g]-o.floating[A]+b.mainAxis,T=o.reference[g]+o.reference[A]-b.mainAxis;mT&&(m=T)}if(d){var x,w;const A=g==="y"?"width":"height",S=MXe.has(Xb(s)),T=o.reference[p]-o.floating[A]+(S&&((x=l.offset)==null?void 0:x[p])||0)+(S?0:b.crossAxis),O=o.reference[p]+o.reference[A]+(S?0:((w=l.offset)==null?void 0:w[p])||0)-(S?b.crossAxis:0);vO&&(v=O)}return{[g]:m,[p]:v}}}},Y2r=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:r,rects:n,platform:i,elements:a}=e,{apply:s=()=>{},...o}=Qv(t,e),l=await i.detectOverflow(e,o),u=Xb(r),h=RE(r),d=im(r)==="y",{width:f,height:p}=n.floating;let g,m;u==="top"||u==="bottom"?(g=u,m=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(m=u,g=h==="end"?"top":"bottom");const v=p-l.top-l.bottom,y=f-l.left-l.right,b=jb(p-l[g],v),x=jb(f-l[m],y),w=e.middlewareData.shift,A=!w;let S=b,T=x;w!=null&&w.enabled.x&&(T=y),w!=null&&w.enabled.y&&(S=v),A&&!h&&(d?T=f-2*Uv(l.left,l.right):S=p-2*Uv(l.top,l.bottom)),await s({...e,availableWidth:T,availableHeight:S});const O=await i.getDimensions(a.floating);return f!==O.width||p!==O.height?{reset:{rects:!0}}:{}}}};function VQ(){return typeof window<"u"}function DE(t){return IXe(t)?(t.nodeName||"").toLowerCase():"#document"}function Ic(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Gv(t){var e;return(e=(IXe(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function IXe(t){return VQ()?t instanceof Node||t instanceof Ic(t).Node:!1}function am(t){return VQ()?t instanceof Element||t instanceof Ic(t).Element:!1}function sm(t){return VQ()?t instanceof HTMLElement||t instanceof Ic(t).HTMLElement:!1}function PXe(t){return!VQ()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ic(t).ShadowRoot}function QQ(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=om(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&i!=="inline"&&i!=="contents"}function q2r(t){return/^(table|td|th)$/.test(DE(t))}function GQ(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const j2r=/transform|translate|scale|rotate|perspective|filter/,X2r=/paint|layout|strict|content/,gA=t=>!!t&&t!=="none";let pue;function gue(t){const e=am(t)?om(t):t;return gA(e.transform)||gA(e.translate)||gA(e.scale)||gA(e.rotate)||gA(e.perspective)||!mue()&&(gA(e.backdropFilter)||gA(e.filter))||j2r.test(e.willChange||"")||X2r.test(e.contain||"")}function K2r(t){let e=mA(t);for(;sm(e)&&!q6(e);){if(gue(e))return e;if(GQ(e))return null;e=mA(e)}return null}function mue(){return pue==null&&(pue=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),pue}function q6(t){return/^(html|body|#document)$/.test(DE(t))}function om(t){return Ic(t).getComputedStyle(t)}function HQ(t){return am(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function mA(t){if(DE(t)==="html")return t;const e=t.assignedSlot||t.parentNode||PXe(t)&&t.host||Gv(t);return PXe(e)?e.host:e}function NXe(t){const e=mA(t);return q6(e)?(t.ownerDocument||t).body:sm(e)&&QQ(e)?e:NXe(e)}function j6(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=NXe(t),a=i===((n=t.ownerDocument)==null?void 0:n.body),s=Ic(i);if(a){const o=vue(s);return e.concat(s,s.visualViewport||[],QQ(i)?i:[],o&&r?j6(o):[])}else return e.concat(i,j6(i,[],r))}function vue(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function BXe(t){const e=om(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=sm(t),a=i?t.offsetWidth:r,s=i?t.offsetHeight:n,o=$Q(r)!==a||$Q(n)!==s;return o&&(r=a,n=s),{width:r,height:n,$:o}}function yue(t){return am(t)?t:t.contextElement}function LE(t){const e=yue(t);if(!sm(e))return Vv(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:a}=BXe(e);let s=(a?$Q(r.width):r.width)/n,o=(a?$Q(r.height):r.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!o||!Number.isFinite(o))&&(o=1),{x:s,y:o}}const Z2r=Vv(0);function $Xe(t){const e=Ic(t);return!mue()||!e.visualViewport?Z2r:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function J2r(t,e,r){return e===void 0&&(e=!1),!!r&&e&&r===Ic(t)}function vA(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),a=yue(t);let s=Vv(1);e&&(n?am(n)&&(s=LE(n)):s=LE(t));const o=J2r(a,r,n)?$Xe(a):Vv(0);let l=(i.left+o.x)/s.x,u=(i.top+o.y)/s.y,h=i.width/s.x,d=i.height/s.y;if(a&&n){const f=Ic(a),p=am(n)?Ic(n):n;let g=f,m=vue(g);for(;m&&p!==g;){const v=LE(m),y=m.getBoundingClientRect(),b=om(m),x=y.left+(m.clientLeft+parseFloat(b.paddingLeft))*v.x,w=y.top+(m.clientTop+parseFloat(b.paddingTop))*v.y;l*=v.x,u*=v.y,h*=v.x,d*=v.y,l+=x,u+=w,g=Ic(m),m=vue(g)}}return UQ({width:h,height:d,x:l,y:u})}function WQ(t,e){const r=HQ(t).scrollLeft;return e?e.left+r:vA(Gv(t)).left+r}function FXe(t,e){const r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-WQ(t,r),i=r.top+e.scrollTop;return{x:n,y:i}}function ewr(t){let{elements:e,rect:r,offsetParent:n,strategy:i}=t;const a=i==="fixed",s=Gv(n),o=e?GQ(e.floating):!1;if(n===s||o&&a)return r;let l={scrollLeft:0,scrollTop:0},u=Vv(1);const h=Vv(0),d=sm(n);if((d||!a)&&((DE(n)!=="body"||QQ(s))&&(l=HQ(n)),d)){const p=vA(n);u=LE(n),h.x=p.x+n.clientLeft,h.y=p.y+n.clientTop}const f=s&&!d&&!a?FXe(s,l):Vv(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+h.x+f.x,y:r.y*u.y-l.scrollTop*u.y+h.y+f.y}}function twr(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function rwr(t){const e=HQ(t),r=t.ownerDocument.body,n=Uv(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Uv(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-e.scrollLeft+WQ(t);const s=-e.scrollTop;return om(r).direction==="rtl"&&(a+=Uv(t.clientWidth,r.clientWidth)-n),{width:n,height:i,x:a,y:s}}const nwr=25;function iwr(t,e,r){r===void 0&&(r="viewport");const n=r==="layoutViewport",i=Ic(t),a=Gv(t),s=i.visualViewport;let o=a.clientWidth,l=a.clientHeight,u=0,h=0;if(s){const f=!mue()||e==="fixed";n?f||(u=-s.offsetLeft,h=-s.offsetTop):(o=s.width,l=s.height,f&&(u=s.offsetLeft,h=s.offsetTop))}if(WQ(a)<=0){const f=a.ownerDocument,p=f.body,g=getComputedStyle(p),m=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,v=Math.abs(a.clientWidth-p.clientWidth-m),y=getComputedStyle(a).scrollbarGutter==="stable both-edges"?v/2:v;y<=nwr&&(o-=y)}return{width:o,height:l,x:u,y:h}}function awr(t,e){const r=vA(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,a=LE(t),s=t.clientWidth*a.x,o=t.clientHeight*a.y,l=i*a.x,u=n*a.y;return{width:s,height:o,x:l,y:u}}function zXe(t,e,r){let n;if(e==="viewport"||e==="layoutViewport")n=iwr(t,r,e);else if(e==="document")n=rwr(Gv(t));else if(am(e))n=awr(e,r);else{const i=$Xe(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return UQ(n)}function swr(t,e){const r=e.get(t);if(r)return r;let n=j6(t,[],!1).filter(o=>am(o)&&DE(o)!=="body"),i=null;const a=om(t).position==="fixed";let s=a?mA(t):t;for(;am(s)&&!q6(s);){const o=om(s),l=gue(s),u=i?i.position:a?"fixed":"";!l&&(u==="fixed"||u==="absolute"&&o.position==="static")?n=n.filter(d=>d!==s):i=o,s=mA(s)}return e.set(t,n),n}function owr(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const s=[...r==="clippingAncestors"?GQ(e)?[]:swr(e,this._c):[].concat(r),n],o=zXe(e,s[0],i);let l=o.top,u=o.right,h=o.bottom,d=o.left;for(let f=1;f{o(!1,1e-7)},1e3)}T=!1}try{n=new IntersectionObserver(O,{...S,root:a.ownerDocument})}catch{n=new IntersectionObserver(O,S)}n.observe(t)}const l=Ic(t),u=()=>o(r);return l.addEventListener("resize",u),o(!0),()=>{l.removeEventListener("resize",u),s()}}function pwr(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=yue(t),h=i||a?[...u?j6(u):[],...e?j6(e):[]]:[];h.forEach(y=>{i&&y.addEventListener("scroll",r),a&&y.addEventListener("resize",r)});const d=u&&o?fwr(u,r,a):null;let f=-1,p=null;s&&(p=new ResizeObserver(y=>{let[b]=y;b&&b.target===u&&p&&e&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(e)})),r()}),u&&!l&&p.observe(u),e&&p.observe(e));let g,m=l?vA(t):null;l&&v();function v(){const y=vA(t);m&&!QXe(m,y)&&r(),m=y,g=requestAnimationFrame(v)}return r(),()=>{var y;h.forEach(b=>{i&&b.removeEventListener("scroll",r),a&&b.removeEventListener("resize",r)}),d==null||d(),(y=p)==null||y.disconnect(),p=null,l&&cancelAnimationFrame(g)}}const gwr=G2r,mwr=H2r,vwr=U2r,ywr=Y2r,bwr=V2r,GXe=z2r,xwr=W2r,wwr=(t,e,r)=>{const n=new Map,i=r??{},a={...dwr,...i.platform,_c:n};return F2r(t,e,{...i,platform:a})};var Awr=typeof document<"u",Swr=function(){},YQ=Awr?se.useLayoutEffect:Swr;function qQ(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!qQ(t[n],e[n]))return!1;return!0}if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const a=i[n];if(!(a==="_owner"&&t.$$typeof)&&!qQ(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}function HXe(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function WXe(t,e){const r=HXe(t);return Math.round(e*r)/r}function xue(t){const e=se.useRef(t);return YQ(()=>{e.current=t}),e}function Twr(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:a,floating:s}={},transform:o=!0,whileElementsMounted:l,open:u}=t,[h,d]=se.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[f,p]=se.useState(n);qQ(f,n)||p(n);const[g,m]=se.useState(null),[v,y]=se.useState(null),b=se.useCallback(N=>{N!==S.current&&(S.current=N,m(N))},[]),x=se.useCallback(N=>{N!==T.current&&(T.current=N,y(N))},[]),w=a||g,A=s||v,S=se.useRef(null),T=se.useRef(null),O=se.useRef(h),k=l!=null,E=xue(l),_=xue(i),I=xue(u),L=se.useCallback(()=>{if(!S.current||!T.current)return;const N={placement:e,strategy:r,middleware:f};_.current&&(N.platform=_.current),wwr(S.current,T.current,N).then(F=>{const B={...F,isPositioned:I.current!==!1};R.current&&!qQ(O.current,B)&&(O.current=B,ak.flushSync(()=>{d(B)}))})},[f,e,r,_,I]);YQ(()=>{u===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,d(N=>({...N,isPositioned:!1})))},[u]);const R=se.useRef(!1);YQ(()=>(R.current=!0,()=>{R.current=!1}),[]),YQ(()=>{if(w&&(S.current=w),A&&(T.current=A),w&&A){if(E.current)return E.current(w,A,L);L()}},[w,A,L,E,k]);const D=se.useMemo(()=>({reference:S,floating:T,setReference:b,setFloating:x}),[b,x]),M=se.useMemo(()=>({reference:w,floating:A}),[w,A]),P=se.useMemo(()=>{const N={position:r,left:0,top:0};if(!M.floating)return N;const F=WXe(M.floating,h.x),B=WXe(M.floating,h.y);return o?{...N,transform:"translate("+F+"px, "+B+"px)",...HXe(M.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:F,top:B}},[r,o,M.floating,h.x,h.y]);return se.useMemo(()=>({...h,update:L,refs:D,elements:M,floatingStyles:P}),[h,L,D,M,P])}const Cwr=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:i}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?GXe({element:n.current,padding:i}).fn(r):{}:n?GXe({element:n,padding:i}).fn(r):{}}}},Owr=(t,e)=>{const r=gwr(t);return{name:r.name,fn:r.fn,options:[t,e]}},kwr=(t,e)=>{const r=mwr(t);return{name:r.name,fn:r.fn,options:[t,e]}},Ewr=(t,e)=>({fn:xwr(t).fn,options:[t,e]}),_wr=(t,e)=>{const r=vwr(t);return{name:r.name,fn:r.fn,options:[t,e]}},Rwr=(t,e)=>{const r=ywr(t);return{name:r.name,fn:r.fn,options:[t,e]}},Dwr=(t,e)=>{const r=bwr(t);return{name:r.name,fn:r.fn,options:[t,e]}},Lwr=(t,e)=>{const r=Cwr(t);return{name:r.name,fn:r.fn,options:[t,e]}};var Mwr=Object.defineProperty,Kb=(t,e)=>Mwr(t,"name",{value:e,configurable:!0}),YXe="Popper",[qXe,jXe]=pA(YXe),[Iwr,XXe]=qXe(YXe),Pwr=Kb(t=>{const{__scopePopper:e,children:r}=t,[n,i]=se.useState(null),[a,s]=se.useState(void 0);return W.jsx(Iwr,{scope:e,anchor:n,onAnchorChange:i,placementState:a,setPlacementState:s,children:r})},"Popper"),Nwr="PopperAnchor",Bwr=se.forwardRef(Kb(function(e,r){const{__scopePopper:n,virtualRef:i,...a}=e,s=XXe(Nwr,n),o=se.useRef(null),l=s.onAnchorChange,u=se.useCallback(m=>{o.current=m,m&&l(m)},[l]),h=Sh(r,u),d=se.useRef(null);se.useEffect(()=>{if(!i)return;const m=d.current;d.current=i.current,m!==d.current&&l(d.current)});const f=s.placementState&&jQ(s.placementState),p=f==null?void 0:f[0],g=f==null?void 0:f[1];return i?null:W.jsx($p.div,{"data-radix-popper-side":p,"data-radix-popper-align":g,...a,ref:h})},"PopperAnchor")),KXe="PopperContent",[$wr,lni]=qXe(KXe),Fwr=se.forwardRef(Kb(function(e,r){var q,Z,ee,re,ve,ae,Ce;const{__scopePopper:n,side:i="bottom",sideOffset:a=0,align:s="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:h=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:g="optimized",onPlaced:m,...v}=e,y=XXe(KXe,n),[b,x]=se.useState(null),w=Sh(r,x),[A,S]=se.useState(null),T=CXe(A),O=(T==null?void 0:T.width)??0,k=(T==null?void 0:T.height)??0,E=i+(s!=="center"?"-"+s:""),_=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},I=Array.isArray(h)?h:[h],L=I.length>0,R={padding:_,boundary:I.filter(ZXe),altBoundary:L},{refs:D,floatingStyles:M,placement:P,isPositioned:N,middlewareData:F}=Twr({strategy:"fixed",placement:E,whileElementsMounted:Kb((...Oe)=>pwr(...Oe,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:y.anchor},middleware:[Owr({mainAxis:a+k,alignmentAxis:o}),u&&kwr({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Ewr():void 0,...R}),u&&_wr({...R}),Rwr({...R,apply:Kb(({elements:Oe,rects:$e,availableWidth:he,availableHeight:fe})=>{const{width:Se,height:ge}=$e.reference,Qe=Oe.floating.style;Qe.setProperty("--radix-popper-available-width",`${he}px`),Qe.setProperty("--radix-popper-available-height",`${fe}px`),Qe.setProperty("--radix-popper-anchor-width",`${Se}px`),Qe.setProperty("--radix-popper-anchor-height",`${ge}px`)},"apply")}),A&&Lwr({element:A,padding:l}),zwr({arrowWidth:O,arrowHeight:k}),p&&Dwr({strategy:"referenceHidden",...R,boundary:L?R.boundary:void 0})]}),B=y.setPlacementState;Fp(()=>(B(P),()=>{B(void 0)}),[P,B]);const[V,z]=jQ(P),U=qb(m);Fp(()=>{N&&(U==null||U())},[N,U]);const Q=(q=F.arrow)==null?void 0:q.x,G=(Z=F.arrow)==null?void 0:Z.y,X=((ee=F.arrow)==null?void 0:ee.centerOffset)!==0,[Y,le]=se.useState();return Fp(()=>{b&&le(window.getComputedStyle(b).zIndex)},[b]),W.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:N?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[(re=F.transformOrigin)==null?void 0:re.x,(ve=F.transformOrigin)==null?void 0:ve.y].join(" "),...((ae=F.hide)==null?void 0:ae.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:W.jsx($wr,{scope:n,placedSide:V,placedAlign:z,onArrowChange:S,arrowX:Q,arrowY:G,shouldHideArrow:X,children:W.jsx($p.div,{"data-side":V,"data-align":z,...v,ref:w,style:{...v.style,animation:N?(Ce=v.style)==null?void 0:Ce.animation:"none"}})})})},"PopperContent"));function ZXe(t){return t!==null}Kb(ZXe,"isNotNull");var zwr=Kb(t=>({name:"transformOrigin",options:t,fn(e){var v,y,b;const{placement:r,rects:n,middlewareData:i}=e,s=((v=i.arrow)==null?void 0:v.centerOffset)!==0,o=s?0:t.arrowWidth,l=s?0:t.arrowHeight,[u,h]=jQ(r),d={start:"0%",center:"50%",end:"100%"}[h],f=(((y=i.arrow)==null?void 0:y.x)??0)+o/2,p=(((b=i.arrow)==null?void 0:b.y)??0)+l/2;let g="",m="";return u==="bottom"?(g=s?d:`${f}px`,m=`${-l}px`):u==="top"?(g=s?d:`${f}px`,m=`${n.floating.height+l}px`):u==="right"?(g=`${-l}px`,m=s?d:`${p}px`):u==="left"&&(g=`${n.floating.width+l}px`,m=s?d:`${p}px`),{data:{x:g,y:m}}}}),"transformOrigin");function jQ(t){const[e,r="center"]=t.split("-");return[e,r]}Kb(jQ,"getSideAndAlignFromPlacement");var Uwr=Pwr,Vwr=Bwr,Qwr=Fwr,Gwr=Object.defineProperty,wue=(t,e)=>Gwr(t,"name",{value:e,configurable:!0}),Aue=!1;function JXe(){const[t,e]=se.useState(Aue);return se.useEffect(()=>{Aue||(Aue=!0,e(!0))},[]),t}wue(JXe,"useIsHydrated");var eKe=Tw[" useSyncExternalStore ".trim().toString()];function tKe(){return()=>{}}wue(tKe,"subscribe");function rKe(){return eKe(tKe,()=>!0,()=>!1)}wue(rKe,"useIsHydratedModern");var Hwr=typeof eKe=="function"?rKe:JXe,Wwr=Object.defineProperty,yA=(t,e)=>Wwr(t,"name",{value:e,configurable:!0}),Sue="rovingFocusGroup.onEntryFocus",Ywr={bubbles:!1,cancelable:!0},XQ="RovingFocusGroup",[Tue,nKe,qwr]=Mje(XQ),[jwr,iKe]=pA(XQ,[qwr]),[Xwr,Kwr]=jwr(XQ),Zwr=se.forwardRef(yA(function(e,r){return W.jsx(Tue.Provider,{scope:e.__scopeRovingFocusGroup,children:W.jsx(Tue.Slot,{scope:e.__scopeRovingFocusGroup,children:W.jsx(Jwr,{...e,ref:r})})})},"RovingFocusGroup")),Jwr=se.forwardRef(yA(function(e,r){const{__scopeRovingFocusGroup:n,orientation:i,loop:a=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:h,preventScrollOnEntryFocus:d=!1,...f}=e,p=se.useRef(null),g=Sh(r,p),m=Yce(s),[v,y]=TE({prop:o,defaultProp:l??null,onChange:u,caller:XQ}),[b,x]=se.useState(!1),w=qb(h),A=nKe(n),S=se.useRef(!1),[T,O]=se.useState(0);return se.useEffect(()=>{const k=p.current;if(k)return k.addEventListener(Sue,w),()=>k.removeEventListener(Sue,w)},[w]),W.jsx(Xwr,{scope:n,orientation:i,dir:m,loop:a,currentTabStopId:v,onItemFocus:se.useCallback(k=>y(k),[y]),onItemShiftTab:se.useCallback(()=>x(!0),[]),onFocusableItemAdd:se.useCallback(()=>O(k=>k+1),[]),onFocusableItemRemove:se.useCallback(()=>O(k=>k-1),[]),children:W.jsx($p.div,{tabIndex:b||T===0?-1:0,"data-orientation":i,...f,ref:g,style:{outline:"none",...e.style},onMouseDown:vu(e.onMouseDown,()=>{S.current=!0}),onFocus:vu(e.onFocus,k=>{const E=!S.current;if(k.target===k.currentTarget&&E&&!b){const _=new CustomEvent(Sue,Ywr);if(k.currentTarget.dispatchEvent(_),!_.defaultPrevented){const I=A().filter(P=>P.focusable),L=I.find(P=>P.active),R=I.find(P=>P.id===v),M=[L,R,...I].filter(Boolean).map(P=>P.ref.current);Cue(M,d)}}S.current=!1}),onBlur:vu(e.onBlur,()=>x(!1))})})},"RovingFocusGroupImpl")),eAr="RovingFocusGroupItem",tAr=se.forwardRef(yA(function(e,r){const{__scopeRovingFocusGroup:n,focusable:i=!0,active:a=!1,tabStopId:s,children:o,...l}=e,u=Wce(),h=s||u,d=Kwr(eAr,n),f=d.currentTabStopId===h,p=nKe(n),{onFocusableItemAdd:g,onFocusableItemRemove:m,currentTabStopId:v}=d,y=Hwr();return Fp(()=>{if(!(!y||!i))return g(),()=>m()},[y,i,g,m]),se.useEffect(()=>{if(!(y||!i))return g(),()=>m()},[y,i,g,m]),W.jsx(Tue.ItemSlot,{scope:n,id:h,focusable:i,active:a,children:W.jsx($p.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...l,ref:r,onMouseDown:vu(e.onMouseDown,b=>{i?d.onItemFocus(h):b.preventDefault()}),onFocus:vu(e.onFocus,()=>d.onItemFocus(h)),onKeyDown:vu(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){d.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const x=sKe(b,d.orientation,d.dir);if(x!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let A=p().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")A.reverse();else if(x==="prev"||x==="next"){x==="prev"&&A.reverse();const S=A.indexOf(b.currentTarget);A=d.loop?oKe(A,S+1):A.slice(S+1)}setTimeout(()=>Cue(A))}}),children:typeof o=="function"?o({isCurrentTabStop:f,hasTabStop:v!=null}):o})})},"RovingFocusGroupItem")),rAr={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function aKe(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}yA(aKe,"getDirectionAwareKey");function sKe(t,e,r){const n=aKe(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return rAr[n]}yA(sKe,"getFocusIntent");function Cue(t,e=!1){const r=document.activeElement;for(const n of t)if(n===r||(n.focus({preventScroll:e}),document.activeElement!==r))return}yA(Cue,"focusFirst");function oKe(t,e){return t.map((r,n)=>t[(e+n)%t.length])}yA(oKe,"wrapArray");var nAr=Zwr,iAr=tAr,aAr=Object.defineProperty,Zb=(t,e)=>aAr(t,"name",{value:e,configurable:!0}),Oue="Popover",[lKe,cni]=pA(Oue,[jXe]),kue=jXe(),[sAr,ME]=lKe(Oue),oAr=Zb(t=>{const{__scopePopover:e,children:r,open:n,defaultOpen:i,onOpenChange:a,modal:s=!1}=t,o=kue(e),l=se.useRef(null),[u,h]=se.useState(!1),[d,f]=TE({prop:n,defaultProp:i??!1,onChange:a,caller:Oue});return W.jsx(Uwr,{...o,children:W.jsx(sAr,{scope:e,contentId:Wce(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:se.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:u,onCustomAnchorAdd:se.useCallback(()=>h(!0),[]),onCustomAnchorRemove:se.useCallback(()=>h(!1),[]),modal:s,children:r})})},"Popover"),lAr="PopoverTrigger",cAr=se.forwardRef(Zb(function(e,r){const{__scopePopover:n,...i}=e,a=ME(lAr,n),s=kue(n),o=Sh(r,a.triggerRef),l=W.jsx($p.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":Eue(a.open),...i,ref:o,onClick:vu(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:W.jsx(Vwr,{asChild:!0,...s,children:l})},"PopoverTrigger")),cKe="PopoverPortal",[uAr,hAr]=lKe(cKe,{forceMount:void 0}),dAr=Zb(t=>{const{__scopePopover:e,forceMount:r,children:n,container:i}=t,a=ME(cKe,e);return W.jsx(uAr,{scope:e,forceMount:r,children:W.jsx(jje,{present:r||a.open,children:W.jsx(Bxr,{asChild:!0,container:i,children:n})})})},"PopoverPortal"),X6="PopoverContent",fAr=se.forwardRef(Zb(function(e,r){const n=hAr(X6,e.__scopePopover),{forceMount:i=n.forceMount,...a}=e,s=ME(X6,e.__scopePopover);return W.jsx(jje,{present:i||s.open,children:s.modal?W.jsx(gAr,{...a,ref:r}):W.jsx(mAr,{...a,ref:r})})},"PopoverContent")),pAr=fA("PopoverContent.RemoveScroll"),gAr=se.forwardRef(Zb(function(e,r){const n=ME(X6,e.__scopePopover),i=se.useRef(null),a=Sh(r,i),s=se.useRef(!1);return se.useEffect(()=>{const o=i.current;if(o)return C2r(o)},[]),W.jsx(SXe,{as:pAr,allowPinchZoom:!0,children:W.jsx(uKe,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:vu(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),s.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:vu(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,h=l.button===2||u;s.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:vu(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),mAr=se.forwardRef(Zb(function(e,r){const n=ME(X6,e.__scopePopover),i=se.useRef(!1),a=se.useRef(!1);return W.jsx(uKe,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,s),s.defaultPrevented||(i.current||(l=n.triggerRef.current)==null||l.focus(),s.preventDefault()),i.current=!1,a.current=!1},onInteractOutside:s=>{var u,h;(u=e.onInteractOutside)==null||u.call(e,s),s.defaultPrevented||(i.current=!0,s.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=s.target;((h=n.triggerRef.current)==null?void 0:h.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&a.current&&s.preventDefault()}})},"PopoverContentNonModal")),uKe=se.forwardRef(Zb(function(e,r){const{__scopePopover:n,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:h,onInteractOutside:d,...f}=e,p=ME(X6,n),g=kue(n);return nue(),W.jsx(Ixr,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:a,onUnmountAutoFocus:s,children:W.jsx(Rxr,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:h,onDismiss:()=>p.onOpenChange(!1),deferPointerDownOutside:!0,children:W.jsx(Qwr,{"data-state":Eue(p.open),role:"dialog",id:p.contentId,...g,...f,ref:r,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl"));function Eue(t){return t?"open":"closed"}Zb(Eue,"getState");var vAr=oAr,yAr=cAr,bAr=dAr,xAr=fAr,wAr=Object.defineProperty,AAr=(t,e)=>wAr(t,"name",{value:e,configurable:!0}),SAr="Toggle",TAr=se.forwardRef(AAr(function(e,r){const{pressed:n,defaultPressed:i,onPressedChange:a,...s}=e,[o,l]=TE({prop:n,onChange:a,defaultProp:i??!1,caller:SAr});return W.jsx($p.button,{type:"button","aria-pressed":o,"data-state":o?"on":"off","data-disabled":e.disabled?"":void 0,...s,ref:r,onClick:vu(e.onClick,()=>{e.disabled||l(!o)})})},"Toggle")),CAr=Object.defineProperty,Jb=(t,e)=>CAr(t,"name",{value:e,configurable:!0}),IE="ToggleGroup",[hKe,uni]=pA(IE,[iKe]),dKe=iKe(),OAr=se.forwardRef(Jb(function(e,r){const{type:n,...i}=e;if(n==="single"){const a=i;return W.jsx(kAr,{role:"radiogroup",...a,ref:r})}if(n==="multiple"){const a=i;return W.jsx(EAr,{role:"toolbar",...a,ref:r})}throw new Error(`Missing prop \`type\` expected on \`${IE}\``)},"ToggleGroup")),[fKe,pKe]=hKe(IE),kAr=se.forwardRef(Jb(function(e,r){const{value:n,defaultValue:i,onValueChange:a=Jb(()=>{},"onValueChange"),...s}=e,[o,l]=TE({prop:n,defaultProp:i??"",onChange:a,caller:IE});return W.jsx(fKe,{scope:e.__scopeToggleGroup,type:"single",value:se.useMemo(()=>o?[o]:[],[o]),onItemActivate:l,onItemDeactivate:se.useCallback(()=>l(""),[l]),children:W.jsx(gKe,{...s,ref:r})})},"ToggleGroupImplSingle")),EAr=se.forwardRef(Jb(function(e,r){const{value:n,defaultValue:i,onValueChange:a=Jb(()=>{},"onValueChange"),...s}=e,[o,l]=TE({prop:n,defaultProp:i??[],onChange:a,caller:IE}),u=se.useCallback(d=>l((f=[])=>[...f,d]),[l]),h=se.useCallback(d=>l((f=[])=>f.filter(p=>p!==d)),[l]);return W.jsx(fKe,{scope:e.__scopeToggleGroup,type:"multiple",value:o,onItemActivate:u,onItemDeactivate:h,children:W.jsx(gKe,{...s,ref:r})})},"ToggleGroupImplMultiple")),[_Ar,RAr]=hKe(IE),gKe=se.forwardRef(Jb(function(e,r){const{__scopeToggleGroup:n,disabled:i=!1,rovingFocus:a=!0,orientation:s,dir:o,loop:l=!0,...u}=e,h=dKe(n),d=Yce(o),f={dir:d,...u};return W.jsx(_Ar,{scope:n,rovingFocus:a,disabled:i,children:a?W.jsx(nAr,{asChild:!0,...h,orientation:s,dir:d,loop:l,children:W.jsx($p.div,{...f,ref:r})}):W.jsx($p.div,{...f,ref:r})})},"ToggleGroupImpl")),_ue="ToggleGroupItem",DAr=se.forwardRef(Jb(function(e,r){const n=pKe(_ue,e.__scopeToggleGroup),i=RAr(_ue,e.__scopeToggleGroup),a=dKe(e.__scopeToggleGroup),s=n.value.includes(e.value),o=i.disabled||e.disabled,l={...e,pressed:s,disabled:o},u=se.useRef(null);return i.rovingFocus?W.jsx(iAr,{asChild:!0,...a,focusable:!o,active:s,ref:u,children:W.jsx(mKe,{...l,ref:r})}):W.jsx(mKe,{...l,ref:r})},"ToggleGroupItem")),mKe=se.forwardRef(Jb(function(e,r){const{__scopeToggleGroup:n,value:i,...a}=e,s=pKe(_ue,n),o={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},l=s.type==="single"?o:void 0;return W.jsx(TAr,{...l,...a,ref:r,onPressedChange:u=>{u?s.onItemActivate(i):s.onItemDeactivate(i)}})},"ToggleGroupItemImpl")),LAr=typeof xi=="object"&&xi&&xi.Object===Object&&xi,MAr=typeof self=="object"&&self&&self.Object===Object&&self;LAr||MAr||Function("return this")();var IAr=typeof window<"u"?se.useLayoutEffect:se.useEffect;function PAr(){const t=se.useRef(!1);return se.useEffect(()=>(t.current=!0,()=>{t.current=!1}),[]),se.useCallback(()=>t.current,[])}var vKe={width:void 0,height:void 0};function NAr(t){const{ref:e,box:r="content-box"}=t,[{width:n,height:i},a]=se.useState(vKe),s=PAr(),o=se.useRef({...vKe}),l=se.useRef(void 0);return l.current=t.onResize,se.useEffect(()=>{if(!e.current||typeof window>"u"||!("ResizeObserver"in window))return;const u=new ResizeObserver(([h])=>{const d=r==="border-box"?"borderBoxSize":r==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",f=yKe(h,d,"inlineSize"),p=yKe(h,d,"blockSize");if(o.current.width!==f||o.current.height!==p){const m={width:f,height:p};o.current.width=f,o.current.height=p,l.current?l.current(m):s()&&a(m)}});return u.observe(e.current,{box:r}),()=>{u.disconnect()}},[r,e,s]),{width:n,height:i}}function yKe(t,e,r){return t[e]?Array.isArray(t[e])?t[e][0][r]:t[e][r]:e==="contentBoxSize"?t.contentRect[r==="inlineSize"?"width":"height"]:void 0}function bKe(t,e){const r=se.useRef(t);IAr(()=>{r.current=t},[t]),se.useEffect(()=>{if(!e&&e!==0)return;const n=setTimeout(()=>{r.current()},e);return()=>{clearTimeout(n)}},[e])}const BAr={DEV:!1,MODE:"production"},PE=typeof{url:Va&&Va.tagName.toUpperCase()==="SCRIPT"&&Va.src||new URL("website-integration.js",document.baseURI).href}<"u"?BAr:void 0,$Ar=!!(PE!=null&&PE.DEV),FAr=typeof navigator<"u"&&/(jsdom|happy-dom)/i.test(navigator.userAgent)||typeof globalThis.happyDOM=="object",xKe=(PE==null?void 0:PE.MODE)==="test"||FAr,zAr=typeof window<"u",wKe=typeof document<"u",UAr=zAr&&wKe,AKe=t=>{const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const r=e.offsetWidth;let n=.985;r<=80?n=.96:r<=150?n=.97:r<=220?n=.98:r>600&&(n=.995),e.style.setProperty("--scale",n.toString())},Rue=(t,e)=>{const r=()=>{const s=setTimeout(t);return()=>{clearTimeout(s)}};if(!UAr||typeof window.requestAnimationFrame!="function"||wKe&&document.visibilityState==="hidden")return r();let i=2,a=window.requestAnimationFrame(function s(){i-=1,i===0?t():a=window.requestAnimationFrame(s)});return()=>{typeof window.cancelAnimationFrame=="function"&&window.cancelAnimationFrame(a)}},SKe=t=>Object.keys(t).reduce((r,n)=>{const i=t[n];if(i||i===0){const a=n.startsWith("--")?"":"--",s=typeof i=="number"?`${i}px`:i;r[`${a}${n}`]=s}return r},{}),Due=t=>{t.preventDefault()},TKe=t=>t.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex^="-"]), [contenteditable]'),Lue={SegmentedControl:"_SegmentedControl_1sl7d_1",SegmentedControlOption:"_SegmentedControlOption_1sl7d_140",SegmentedControlThumb:"_SegmentedControlThumb_1sl7d_219"},KQ=({value:t,onChange:e,children:r,block:n,pill:i=!0,size:a="md",gutterSize:s,className:o,onClick:l,...u})=>{const h=se.useRef(null),d=se.useRef(null),f=se.useCallback(g=>{const m=h.current,v=d.current;if(!m||!v)return;const y=m==null?void 0:m.querySelector('[data-state="on"]');if(!y)return;const b=m.clientWidth;let x=Math.floor(y.clientWidth);const w=y.offsetLeft;if(b-(x+w)<2&&(x=x-1),v.style.width=`${Math.floor(x)}px`,v.style.transform=`translateX(${w}px)`,m.scrollWidth>b){const A=b*.15,S=m.scrollLeft,T=y.offsetLeft,O=T+x;(TS+b-A)&&g&&y.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"})}},[]);NAr({ref:h,onResize:()=>{const g=d.current;if(!g)return;const m=g.style.transition;g.style.transition="",f(!1),g.style.transition=m}}),se.useLayoutEffect(()=>{const g=h.current,m=d.current;!g||!m||(f(!!m.style.transition),m.style.transition||Rue(()=>{m.style.transition="width 300ms var(--cubic-enter), transform 300ms var(--cubic-enter)"}))},[f,t,a,s,i]);const p=g=>{g&&e&&e(g)};return W.jsxs(OAr,{ref:h,className:AE(Lue.SegmentedControl,o),type:"single",value:t,loop:!1,onValueChange:p,onClick:l,"data-block":n?"":void 0,"data-pill":i?"":void 0,"data-size":a,"data-gutter-size":s,...u,children:[W.jsx("div",{className:Lue.SegmentedControlThumb,ref:d}),r]})},VAr=({children:t,...e})=>W.jsx(DAr,{className:Lue.SegmentedControlOption,...e,onPointerEnter:AKe,children:W.jsx("span",{className:"relative",children:t})});KQ.Option=VAr;function QAr({children:t,label:e,language:r,source:n,streaming:i=!1}){const{t:a}=Ea("conversation"),[s,o]=se.useState("preview"),l=i?"code":s;return W.jsxs("section",{className:"visualization-card","aria-label":a("visualization.cardAria",{label:e}),children:[W.jsx("div",{className:"visualization-card__toolbar",children:W.jsxs(KQ,{className:"visualization-card__tabs",value:l,size:"sm",gutterSize:"sm",pill:!1,"aria-label":a("visualization.viewAria",{label:e}),onChange:u=>{i||o(u)},children:[W.jsx(KQ.Option,{value:"preview",disabled:i,children:a("visualization.preview")}),W.jsx(KQ.Option,{value:"code",children:a("visualization.code")})]})}),W.jsx("div",{className:"visualization-card__body",children:l==="code"?W.jsx("pre",{className:"visualization-card__code",children:W.jsx("code",{className:`language-${r}`,children:n})}):t})]})}const GAr=se.memo(QAr);function HAr(t){const e=t==null?void 0:t.trim().toLowerCase();if(e==="mermaid")return"mermaid";if(e==="echart"||e==="echarts")return"echarts"}const CKe=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function Mue(t){return typeof t=="string"||typeof t=="number"?String(t):Array.isArray(t)?t.map(Mue).join(""):se.isValidElement(t)?Mue(t.props.children):""}function WAr(t){var n;const e=se.Children.toArray(t)[0];if(!se.isValidElement(e))return;const r=(n=e.props.className)==null?void 0:n.split(/\s+/).find(i=>i.startsWith("language-"));return HAr(r==null?void 0:r.slice(9))}function OKe(t){if(!t)return!1;try{const e=t.toLowerCase();return CKe.some(r=>e.includes(r))}catch{return!1}}function YAr(t){var n;const e=(n=t==null?void 0:t.properties)==null?void 0:n.href;if(!e)return!1;if(OKe(e))return!0;const r=t==null?void 0:t.children;if(r&&Array.isArray(r)){const i=r.map(a=>(a==null?void 0:a.value)||"").join("").toLowerCase();return CKe.some(a=>i.includes(a))}return!1}function qAr({text:t,className:e,allowRawHtml:r=!0,streaming:n=!1}){const{t:i}=Ea("conversation"),[a,s]=se.useState(null),o=(h,d)=>{if(h.src)return h.src;if(d){const f=g=>{var m;if(!g)return null;if(g.type==="source"&&((m=g.properties)!=null&&m.src))return g.properties.src;if(g.children)for(const v of g.children){const y=f(v);if(y)return y}return null},p=f({children:d});if(p)return p}return""},l=h=>{try{const f=new URL(h).pathname.split("/");return f[f.length-1]||"video.mp4"}catch{return"video.mp4"}},u=h=>h?Array.isArray(h)?h.map(d=>(d==null?void 0:d.value)||"").join("")||"video":(h==null?void 0:h.value)||"video":"video";return W.jsxs("div",{className:e?`md ${e}`:"md",children:[W.jsx(mfr,{remarkPlugins:[Dgr],rehypePlugins:r?[wbr,bqe]:[bqe],components:{pre:({node:h,children:d,...f})=>{const p=WAr(d);if(p==="mermaid"||p==="echarts"){const g=Mue(d).replace(/\n$/,"");return W.jsx(GAr,{label:p==="mermaid"?"Mermaid":"ECharts",language:p,source:g,streaming:n,children:p==="mermaid"?W.jsx(jbr,{source:g}):W.jsx(Gbr,{source:g})})}return W.jsx("pre",{...f,children:d})},a:({node:h,...d})=>{const f=d.href;if(f&&(OKe(f)||YAr(h))){const p=f,g=u(h==null?void 0:h.children);return W.jsxs("div",{className:"video-container",children:[W.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":i("markdown.playVideo",{name:g}),onClick:()=>s({src:p,title:g}),children:[W.jsx("video",{src:p,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),W.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:W.jsx(wV,{})})]}),W.jsx("div",{className:"video-caption",children:W.jsx("a",{href:p,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:g})})]})}return W.jsx("a",{...d,target:"_blank",rel:"noopener noreferrer"})},img:({node:h,src:d,alt:f,...p})=>{const g=W.jsx("img",{...p,src:d,alt:f??"",loading:"lazy"});return d?W.jsx(QWe,{src:d,children:W.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":i("markdown.enlargeImage",{name:f||i("markdown.image")}),children:[g,W.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:W.jsx(wV,{})})]})}):g},video:({node:h,src:d,children:f,...p})=>{const g=o({src:d},f);return g?W.jsx("div",{className:"video-container",children:W.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":i("markdown.enlargeVideo"),onClick:()=>s({src:g}),children:[W.jsx("video",{src:g,...p,playsInline:!0,className:"video-thumbnail",children:f}),W.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:W.jsx(wV,{})})]})}):W.jsx("video",{src:d,controls:!0,playsInline:!0,className:"video-inline",...p,children:f})}},children:t}),a&&W.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":i("markdown.videoPreview"),onClick:()=>s(null),children:W.jsxs("div",{className:"video-viewer",onClick:h=>h.stopPropagation(),children:[W.jsxs("div",{className:"video-viewer-header",children:[W.jsx("div",{className:"video-viewer-title",children:a.title||l(a.src)}),W.jsxs("nav",{className:"video-viewer-nav",children:[W.jsx("a",{href:a.src,download:a.title||l(a.src),"aria-label":i("markdown.downloadVideo"),title:i("markdown.downloadVideo"),className:"video-viewer-download",children:W.jsx(loe,{})}),W.jsx("button",{type:"button",className:"video-viewer-close","aria-label":i("markdown.close"),onClick:()=>s(null),children:W.jsx(jk,{})})]})]}),W.jsx("div",{className:"video-viewer-body",children:W.jsx("video",{src:a.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const ZQ=se.memo(qAr);function jAr({value:t,skillPrefix:e="/",onRemoveSkill:r,onRemoveAgent:n}){const{t:i}=Ea("conversation");return t.skills.length===0&&!t.targetAgent?null:W.jsxs("div",{className:"invocation-chips","aria-label":i("invocation.ariaLabel"),children:[t.skills.map(a=>W.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:a.description,children:[W.jsx(hir,{"aria-hidden":!0}),W.jsxs("span",{children:[e,a.name]}),r?W.jsx("button",{type:"button",onClick:()=>r(a.name),"aria-label":i("invocation.removeSkill",{name:a.name}),children:W.jsx(jk,{})}):null]},a.name)),t.targetAgent?W.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:t.targetAgent.description,children:[W.jsx(iir,{"aria-hidden":!0}),W.jsx("span",{children:t.targetAgent.name}),n?W.jsx("button",{type:"button",onClick:n,"aria-label":i("invocation.removeAgent",{name:t.targetAgent.name}),children:W.jsx(jk,{})}):null]}):null]})}const kKe="veadk_auth_qs",XAr=new Set(["view","source","sessionId","artifactSha256","validationReportSha256","projectId","versionId"]);let K6=null;function KAr(){if(K6!==null)return K6;const t=new URLSearchParams(window.location.search),e=new URLSearchParams,r=new URLSearchParams,n=t.get("view")==="runtime-deploy"&&t.get("source")==="intelligent-development";t.forEach((a,s)=>{(n&&XAr.has(s)?r:e).append(s,a)});const i=e.toString();if(i?(sessionStorage.setItem(kKe,i),K6=i):K6=sessionStorage.getItem(kKe)??"",i){const a=r.toString();window.history.replaceState(null,"",window.location.pathname+(a?`?${a}`:"")+window.location.hash)}return K6}function ZAr(t){const e=KAr();if(!e)return t;const r=new URL(t,window.location.origin);return new URLSearchParams(e).forEach((n,i)=>{r.searchParams.has(i)||r.searchParams.set(i,n)}),/^https?:\/\//i.test(t)?r.toString():r.pathname+r.search+r.hash}const JAr="";function eSr(t){try{const e=new URL(t);if(e.protocol!=="veadk-media:"||e.hostname!=="apps")return;const r=e.pathname.split("/").filter(Boolean).map(decodeURIComponent);return r.length!==7||r[1]!=="users"||r[3]!=="sessions"||r[5]!=="media"?void 0:`/web/media/${r.map(encodeURIComponent).filter((n,i)=>![1,3,5].includes(i)).join("/")}`}catch{return}}function tSr(t,e){if(e.startsWith("data:")||e.startsWith("blob:")||/^https?:/.test(e))return e;const r=eSr(e);if(!r)return e;const n=`${r}/content`;return ZAr(`${JAr}${n}`)}function Iue(t=""){return t.startsWith("image/")?"image":t.startsWith("video/")?"video":t==="application/pdf"?"pdf":t==="text/markdown"?"markdown":"text"}function EKe(t){var r,n,i,a;const e=Iue(t.mimeType);return e==="pdf"?"PDF":e==="markdown"?"MD":e==="video"?((n=(r=t.mimeType)==null?void 0:r.split("/")[1])==null?void 0:n.toUpperCase())??"VIDEO":e==="image"?((a=(i=t.mimeType)==null?void 0:i.split("/")[1])==null?void 0:a.toUpperCase())??"IMAGE":"TXT"}function _Ke(t){return t?t<1024?`${t} B`:t<1024*1024?`${Math.round(t/1024)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`:""}function RKe(t,e){return t.previewUrl?t.previewUrl:t.data?`data:${t.mimeType??"application/octet-stream"};base64,${t.data}`:t.uri?tSr(e,t.uri):""}function rSr({kind:t}){return t==="image"?W.jsx(cir,{}):t==="video"?W.jsx(lir,{}):t==="pdf"?W.jsx(oir,{}):W.jsx(TVe,{})}function nSr({appName:t,items:e,compact:r=!1,onRemove:n}){const{t:i}=Ea("conversation"),[a,s]=se.useState(null);return W.jsxs(W.Fragment,{children:[W.jsx("div",{className:`media-grid${r?" media-grid--compact":""}`,children:e.map(o=>{const l=Iue(o.mimeType),u=RKe(o,t),h=o.status==="uploading"||o.status==="error"||!u,d=W.jsxs("button",{type:"button",className:"media-card-main",disabled:h,onClick:l==="image"?void 0:()=>s(o),"aria-label":i("media.preview",{name:o.name??i("media.attachment")}),children:[l==="image"&&u?W.jsx("img",{className:"media-card-image",src:u,alt:o.name??i("media.image"),loading:"lazy"}):l==="video"&&u?W.jsxs("div",{className:"media-card-video-container",children:[W.jsx("video",{className:"media-card-video",src:u,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),W.jsx("span",{className:"media-card-video-play",children:W.jsx(uir,{})})]}):W.jsx("span",{className:"media-card-icon",children:W.jsx(rSr,{kind:l})}),W.jsxs("span",{className:"media-card-copy",children:[W.jsx("span",{className:"media-card-name",children:o.name??i("media.attachment")}),W.jsxs("span",{className:"media-card-meta",children:[W.jsx("span",{className:"media-card-type",children:EKe(o)}),o.status==="uploading"?W.jsxs(W.Fragment,{children:[W.jsx(Rv,{className:"media-card-spinner"})," ",i("media.uploading")]}):o.status==="error"?o.error??i("media.uploadFailed"):_Ke(o.sizeBytes)]})]}),!r&&o.status!=="uploading"&&o.status!=="error"?W.jsx(wV,{className:"media-card-open"}):null]});return W.jsxs(eA.div,{className:`media-card media-card--${l}${o.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[l==="image"&&!h?W.jsx(QWe,{src:u,children:d}):d,n?W.jsx("button",{type:"button",className:"media-card-remove","aria-label":i("media.remove",{name:o.name??i("media.attachment")}),onClick:()=>n(o.id),children:W.jsx(jk,{})}):null]},o.id)})}),W.jsx(mir,{children:a?W.jsx(iSr,{appName:t,item:a,onClose:()=>s(null)}):null})]})}function iSr({appName:t,item:e,onClose:r}){const{t:n}=Ea("conversation"),i=se.useMemo(()=>RKe(e,t),[t,e]),a=Iue(e.mimeType),[s,o]=se.useState(""),[l,u]=se.useState(a==="text"||a==="markdown"),[h,d]=se.useState("");return se.useEffect(()=>{const f=p=>{p.key==="Escape"&&r()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[r]),se.useEffect(()=>{if(a!=="text"&&a!=="markdown")return;const f=new AbortController;return u(!0),d(""),fetch(i,{signal:f.signal}).then(p=>{if(!p.ok)throw new Error(`HTTP ${p.status}`);return p.text()}).then(o).catch(p=>{f.signal.aborted||d(p instanceof Error?p.message:String(p))}).finally(()=>{f.signal.aborted||u(!1)}),()=>f.abort()},[a,i]),W.jsx(eA.div,{className:"media-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":n("media.previewDialog",{name:e.name??n("media.attachment")}),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:f=>{f.target===f.currentTarget&&r()},children:W.jsxs(eA.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:[W.jsxs("header",{className:"media-viewer-header",children:[W.jsxs("div",{children:[W.jsx("strong",{children:e.name??n("media.attachment")}),W.jsxs("span",{children:[EKe(e),e.sizeBytes?` · ${_Ke(e.sizeBytes)}`:""]})]}),W.jsxs("nav",{children:[W.jsx("a",{href:i,download:e.name,"aria-label":n("media.download"),children:W.jsx(loe,{})}),W.jsx("button",{type:"button",onClick:r,"aria-label":n("media.close"),children:W.jsx(jk,{})})]})]}),W.jsxs("div",{className:`media-viewer-body media-viewer-body--${a}`,children:[a==="image"?W.jsx("img",{src:i,alt:e.name??n("media.image")}):null,a==="video"?W.jsx("div",{className:"media-viewer-video-wrapper",children:W.jsx("video",{src:i,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,a==="pdf"?W.jsx("iframe",{src:i,title:e.name??"PDF"}):null,l?W.jsxs("div",{className:"media-viewer-loading",children:[W.jsx(Rv,{})," ",n("media.reading")]}):null,!l&&h?W.jsx("div",{className:"media-viewer-loading",children:n("media.loadFailed",{error:h})}):null,!l&&a==="markdown"?W.jsx("div",{className:"media-document",children:W.jsx(ZQ,{text:s})}):null,!l&&a==="text"?W.jsx("pre",{className:"media-document media-document--plain",children:s}):null]})]})})}function DKe(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),W.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 aSr(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),W.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),W.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),W.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 sSr(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.jsx("path",{className:"video-generate-icon__body",d:"M3.25 9h17.5v7.35a2.4 2.4 0 0 1-2.4 2.4H5.65a2.4 2.4 0 0 1-2.4-2.4V9Z"}),W.jsxs("g",{className:"video-generate-icon__clapper",children:[W.jsx("path",{d:"M3.25 9V7.65a2.4 2.4 0 0 1 2.4-2.4h12.7a2.4 2.4 0 0 1 2.4 2.4V9H3.25Z"}),W.jsx("path",{d:"M6.75 5.25 9.3 9M12 5.25 14.55 9M17.25 5.25 19.8 9"})]}),W.jsx("path",{d:"m10.25 11.45 4 2.55-4 2.55v-5.1Z"})]})}function oSr(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.jsx("path",{d:"M4.25 5.25h15.5v10.5H4.25zM8.25 19.75h7.5M12 15.75v4"}),W.jsx("path",{d:"m7.25 12.75 2.35-2.4 2.15 1.65 3.4-3.6 1.6 1.55"}),W.jsx("circle",{cx:"7.25",cy:"8.4",r:".7",fill:"currentColor",stroke:"none"})]})}function lSr(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.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"}),W.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"}),W.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function cSr(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),W.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),W.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),W.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function uSr(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.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"}),W.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"}),W.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 hSr(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),W.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),W.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"}),W.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function dSr(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.jsx("circle",{cx:"6",cy:"6.25",r:"2.25"}),W.jsx("circle",{cx:"18",cy:"6.25",r:"2.25"}),W.jsx("circle",{cx:"12",cy:"17.75",r:"2.25"}),W.jsx("path",{d:"m7.7 7.75 2.7 7.55M16.3 7.75l-2.7 7.55M8.25 6.25h7.5"})]})}function LKe(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.jsx("circle",{cx:"9",cy:"8",r:"3"}),W.jsx("path",{d:"M3.75 18.75c.45-3.05 2.2-4.65 5.25-4.65s4.8 1.6 5.25 4.65"}),W.jsx("path",{d:"M17.75 4.25v5.5M15 7h5.5M16 13.25h4.25M18.125 11.125v4.25"})]})}function fSr(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.jsx("rect",{x:"4",y:"4.25",width:"16",height:"5",rx:"1.5"}),W.jsx("rect",{x:"4",y:"14.75",width:"16",height:"5",rx:"1.5"}),W.jsx("path",{d:"M7.25 6.75h.01M7.25 17.25h.01M10 6.75h6.5M10 17.25h6.5"})]})}function pSr(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.jsx("path",{d:"M6 3.75h8l4 4v12.5H6V3.75Z"}),W.jsx("path",{d:"M14 3.75v4h4M8.75 11h6.5M8.75 14.25h6.5M8.75 17.5h4"})]})}function MKe(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.jsx("rect",{x:"3.75",y:"4.5",width:"16.5",height:"15",rx:"2.5"}),W.jsx("path",{d:"m7.5 9 2.75 2.5L7.5 14M12.5 14h4"}),W.jsx("path",{d:"M3.75 7.5h16.5",opacity:".62"})]})}function Pue(t){return W.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:W.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function gSr({definition:t,label:e,done:r,open:n,onToggle:i}){const{t:a}=Ea("conversation"),s=t.icon,o=r?t.doneLabel:t.runningLabel,l=e??a(`blocks.tools.${t.name}.${r?"done":"running"}`,{defaultValue:o});return W.jsxs("button",{type:"button",className:`builtin-tool-head${r?" is-done":" is-running"}`,"data-tool-tone":t.tone,onClick:i,"aria-expanded":n,children:[W.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:W.jsx(s,{})}),r?W.jsx("span",{className:"builtin-tool-label",children:l}):W.jsx(Yb,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:l}),W.jsx(Pue,{className:`builtin-tool-chevron${n?" is-open":""}`})]})}function wd(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)?t:void 0}function Jr(t){return typeof t=="string"?t:""}function IKe(t){return typeof t=="number"&&Number.isFinite(t)?t:0}function _f(t){return Array.isArray(t)?t:[]}function Nue(t){let e=t;if(typeof e=="string")try{e=JSON.parse(e)}catch{return{}}const r=wd(e)??{};return wd(r.result)??r}function JQ(t){if(typeof t=="string")try{return JQ(JSON.parse(t))}catch{return t}const e=wd(t);if(!e)return"";const r=wd(e.result);return Jr(e.error)||Jr(e.message)||Jr(r==null?void 0:r.error)||Jr(r==null?void 0:r.message)}function mSr(t){if(t.kind==="tool")return"tool";if(t.kind==="knowledge_base")return"knowledge_base";const e=wd(t.metadata),r=Jr(e==null?void 0:e.source_type).toLowerCase(),n=Jr(t.source).toLowerCase();return r==="skillhub"||n.startsWith("skill_hub:")?"skill_hub":"skill_space"}const PKe={tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknownSource:"Unknown source",unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"};function vSr(t,e){return t==="veadk_builtin_tools"?e.tool:t==="agentkit_knowledge"?e.knowledge:t.startsWith("skill_hub:")?`Skill Hub ${t.slice(10)}`:t.startsWith("skill_space:")?`${e.skillCenter} ${t.slice(12)}`:t||e.unknownSource}function ySr(t){return t==="veadk_builtin_tools"?"tool":t==="agentkit_knowledge"?"knowledge_base":t.startsWith("skill_hub:")?"skill_hub":"skill_space"}function bSr(t,e=PKe){const r=Nue(t),n=wd(r.capabilities)??{},i=_f(r.resources).flatMap(s=>{const o=wd(s);if(!o)return[];const l=o.kind==="tool"?"tool":o.kind==="knowledge_base"?"knowledge_base":"skill";return[{ref:Jr(o.ref),kind:l,category:mSr(o),name:Jr(o.name)||Jr(o.ref)||e.unnamedResource,description:Jr(o.description),source:Jr(o.source),version:Jr(o.version)}]}),a=_f(r.sources).flatMap(s=>{const o=wd(s);if(!o)return[];const l=Jr(o.source),u=Jr(o.status),h=u==="error"?"error":u==="skipped"?"skipped":"ok";return[{source:l,category:ySr(l),label:vSr(l,e),status:h,count:IKe(o.count),message:Jr(o.message),searchKeywords:_f(o.search_keywords).map(Jr).filter(Boolean)}]});return{collectionId:Jr(r.collection_id),capabilities:{googleAdkVersion:Jr(n.google_adk_version),agentTypes:_f(n.agent_types).map(Jr).filter(Boolean),maxOrchestrationDepth:IKe(n.max_orchestration_depth)},resources:i,sources:a,counts:{all:i.length,skill_hub:i.filter(s=>s.category==="skill_hub").length,skill_space:i.filter(s=>s.category==="skill_space").length,knowledge_base:i.filter(s=>s.category==="knowledge_base").length,tool:i.filter(s=>s.category==="tool").length}}}function xSr(t,e){return{resources:t.resources.filter(r=>r.category===e),sources:t.sources.filter(r=>r.category===e)}}function NKe(t,e,r=PKe){const n=Nue(t),i=Nue(e),a=new Map(_f(i.results).flatMap(h=>{const d=wd(h),f=Jr(d==null?void 0:d.name);return d&&f?[[f,d]]:[]})),s=_f(n.agents).flatMap(h=>{const d=wd(h),f=Jr(d==null?void 0:d.name);return d&&f?[d]:[]}),o=new Set(s.map(h=>Jr(h.name))),l=[...a.entries()].filter(([h])=>!o.has(h)).map(([h])=>({name:h})),u=[...s,...l].map(h=>{const d=Jr(h.name),f=_f(h.nodes).flatMap(T=>{const O=wd(T);return O?[O]:[]}),p=Jr(h.root_node),g=f.find(T=>Jr(T.id)===p),m=f.filter(T=>Jr(T.id)!==p).map(T=>({id:Jr(T.id)||r.unnamedAgent,type:Jr(T.type)||"llm",description:Jr(T.description)})),v=a.get(d),y=Jr(v==null?void 0:v.status),b=y==="failed"?"failed":y==="completed"?"completed":"running",x=BKe(v==null?void 0:v.resources),w=x.length>0?x:BKe(f.flatMap(T=>_f(T.resources))),A=$Ke(v==null?void 0:v.python_tools),S=A.length>0?A:$Ke(f.flatMap(T=>_f(T.python_tools)));return{name:d,description:Jr(v==null?void 0:v.description)||Jr(g==null?void 0:g.description)||Jr(h.task),task:Jr(h.task),rootType:Jr(v==null?void 0:v.root_type)||Jr(g==null?void 0:g.type)||"llm",nodeCount:f.length,subAgentCount:m.length,resourceCount:w.length,pythonToolCount:S.length,skills:w.filter(T=>T.kind==="skill"),knowledgeBases:w.filter(T=>T.kind==="knowledge_base"),builtinTools:w.filter(T=>T.kind==="tool"),pythonTools:S,subAgents:m,status:b,output:Jr(v==null?void 0:v.output),error:Jr(v==null?void 0:v.error)}});return{collectionId:Jr(i.collection_id)||Jr(n.collection_id),agents:u,completedCount:u.filter(h=>h.status==="completed").length,failedCount:u.filter(h=>h.status==="failed").length,runningCount:u.filter(h=>h.status==="running").length}}function wSr(t,e){return!!JQ(e)||NKe(t,e).failedCount>0}function BKe(t){const e=new Set;return _f(t).flatMap(r=>{const n=wd(r),i=Jr(n?n.ref:r);if(!i||e.has(i))return[];e.add(i);const a=Jr(n==null?void 0:n.kind),s=a==="tool"||i.startsWith("veadk_tool:")?"tool":a==="knowledge_base"||i.startsWith("agentkit_kb:")?"knowledge_base":"skill",o=i.split(":");return[{ref:i,kind:s,name:Jr(n==null?void 0:n.name)||o[o.length-1]||i,description:Jr(n==null?void 0:n.description),version:Jr(n==null?void 0:n.version),source:Jr(n==null?void 0:n.source)}]})}function $Ke(t){const e=new Set;return _f(t).flatMap(r=>{const n=wd(r),i=Jr(n==null?void 0:n.name),a=Jr(n==null?void 0:n.code),s=`${i}\0${a}`;return!n||!i||e.has(s)?[]:(e.add(s),[{name:i,description:Jr(n.description),code:a,entrypoint:Jr(n.entrypoint)||i,dependencies:_f(n.dependencies).map(Jr).filter(Boolean)}])})}const ASr=t=>{const e=se.Children.toArray(t),r=[];let n="";const i=()=>{n!==""&&(r.push(n),n="")};for(const a of e)if(!(a==null||typeof a=="boolean")){if(typeof a=="string"||typeof a=="number"){n+=String(a);continue}i(),r.push(a)}return i(),r},Bue=t=>{const e=ASr(t),r=se.Children.count(e);return se.Children.map(e,n=>{if(typeof n=="string"&&n.trim())return r<=1?n:W.jsx("span",{children:n});if(se.isValidElement(n)){const i=n,{children:a,...s}=i.props;return a!=null?se.cloneElement(i,s,Bue(a)):i}return n})},SSr={Badge:"_Badge_1viyg_1"},ex=({children:t,className:e,variant:r="soft",color:n="secondary",size:i="sm",pill:a,...s})=>W.jsx("div",{className:AE(SSr.Badge,e),"data-color":n,"data-size":i,"data-pill":a?"":void 0,"data-variant":r,...s,children:Bue(t)});se.createContext(null);const TSr={LoadingIndicator:"_LoadingIndicator_7yl6f_1"},CSr=({className:t,size:e,strokeWidth:r,style:n,...i})=>W.jsx("div",{...i,className:AE(TSr.LoadingIndicator,t),style:n||SKe({"indicator-size":e,"indicator-stroke":r})});function OSr(t){return e=>{t.forEach(r=>{typeof r=="function"?r(e):r!=null&&(r.current=e)})}}const kSr=()=>xKe,FKe=(t,e=!1,r="TransitionGroup")=>{const n=[];return se.Children.forEach(t,i=>{if(i&&typeof i=="object"&&"key"in i&&i.key)n.push(i);else if(e)throw new Error(`Child elements of <${r} /> must include a \`key\``)}),n},NE=()=>{},BE=t=>{const e=se.useRef(t);return e.current=t,se.useCallback(r=>e.current(r),[])};function ESr(t,e,r,n){const i=t.reduce((l,u)=>({...l,[u.key]:1}),{}),a=e.reduce((l,u)=>({...l,[u.component.key]:1}),{}),s=t.filter(l=>!a[l.key]).map(r),o=e.map(l=>({...l,component:t.find(({key:u})=>u===l.component.key)||l.component,shouldRender:!!i[l.component.key]}));return n==="append"?o.concat(s):s.concat(o)}function _Sr(t,e,r){if((xKe||$Ar)&&e&&r>1)throw new Error(`Cannot use forwardRef with multiple children in <${t} />`)}const RSr={TransitionGroupChild:"_TransitionGroupChild_1hv1z_1"},zKe={enter:!1,enterActive:!1,exit:!1,exitActive:!1,interrupted:!1},DSr=t=>({...zKe,enter:!t}),LSr=(t,e)=>{switch(e.type){case"enter-before":return{enter:!0,enterActive:!1,exit:!1,exitActive:!1,interrupted:t.interrupted||t.exit};case"enter-active":return{enter:!0,enterActive:!0,exit:!1,exitActive:!1,interrupted:!1};case"exit-before":return{enter:!1,enterActive:!1,exit:!0,exitActive:!1,interrupted:t.interrupted||t.enter};case"exit-active":return{enter:!1,enterActive:!1,exit:!0,exitActive:!0,interrupted:!1};case"done":default:return zKe}},MSr=({ref:t,as:e,children:r,className:n,transitionId:i,style:a,preventMountTransition:s,shouldRender:o,enterDuration:l,exitDuration:u,removeChild:h,onEnter:d,onEnterActive:f,onEnterComplete:p,onExit:g,onExitActive:m,onExitComplete:v})=>{const[y,b]=se.useReducer(LSr,DSr(s||!1)),x=se.useRef(!1),w=se.useRef(null),A=se.useRef(l);A.current=l;const S=se.useRef(u);S.current=u;const T=se.useRef(null),O=se.useCallback(k=>{const E=w.current;if(!(!E||k===T.current))switch(T.current=k,k){case"enter":d(E);break;case"enter-active":f(E);break;case"enter-complete":p(E);break;case"exit":g(E);break;case"exit-active":m(E);break;case"exit-complete":v(E);break}},[d,f,p,g,m,v]);return WLe.useLayoutEffect(()=>{if(!o){let _;b({type:"exit-before"}),O("exit");const I=Rue(()=>{b({type:"exit-active"}),O("exit-active"),_=window.setTimeout(()=>{O("exit-complete"),h()},S.current)});return()=>{I(),_!==void 0&&clearTimeout(_)}}if(s&&!x.current){x.current=!0;return}let k;b({type:"enter-before"}),O("enter");const E=Rue(()=>{b({type:"enter-active"}),O("enter-active"),k=window.setTimeout(()=>{b({type:"done"}),O("enter-complete")},A.current)});return()=>{E(),k!==void 0&&clearTimeout(k)}},[o,s,h,O]),se.useEffect(()=>()=>{x.current=!1},[]),W.jsx(e,{ref:OSr([w,t]),className:AE(n,RSr.TransitionGroupChild),"data-transition-id":i,style:a,"data-entering":y.enter?"":void 0,"data-entering-active":y.enterActive?"":void 0,"data-exiting":y.exit?"":void 0,"data-exiting-active":y.exitActive?"":void 0,"data-interrupted":y.interrupted?"":void 0,children:r})},ISr=t=>{const{enterMountDelay:e,preventMountTransition:r}=t,n=!r&&e!=null?e:null,[i,a]=se.useState(n==null);return bKe(()=>a(!0),i?null:n),i?W.jsx(MSr,{...t}):null},UKe=t=>{const{ref:e,as:r="span",children:n,className:i,transitionId:a,style:s,enterDuration:o=0,exitDuration:l=0,preventInitialTransition:u=!0,enterMountDelay:h,insertMethod:d="append",disableAnimations:f=kSr()}=t,p=BE(t.onEnter??NE),g=BE(t.onEnterActive??NE),m=BE(t.onEnterComplete??NE),v=BE(t.onExit??NE),y=BE(t.onExitActive??NE),b=BE(t.onExitComplete??NE);se.Children.forEach(n,S=>{if(S&&!S.key)throw new Error("Child elements of must include a `key`")});const x=se.useCallback(S=>({component:S,shouldRender:!0,removeChild:()=>{A(T=>T.filter(O=>S.key!==O.component.key))},onEnter:p,onEnterActive:g,onEnterComplete:m,onExit:v,onExitActive:y,onExitComplete:b}),[p,g,m,v,y,b]),[w,A]=se.useState(()=>FKe(n).map(S=>({...x(S),preventMountTransition:u})));return se.useLayoutEffect(()=>{A(S=>{const T=FKe(n);return ESr(T,S,x,d)})},[n,d,x]),_Sr("TransitionGroup",e,se.Children.count(n)),f?W.jsx(W.Fragment,{children:se.Children.map(n,S=>W.jsx(r,{ref:e,className:i,style:s,"data-transition-id":a,children:S}))}):W.jsx(W.Fragment,{children:w.map(({component:S,...T})=>W.jsx(ISr,{...T,as:r,className:i,transitionId:a,enterDuration:o,exitDuration:l,enterMountDelay:h,style:s,ref:e,children:S},S.key))})},$ue={Button:"_Button_1864l_1",ButtonInner:"_ButtonInner_1864l_4",ButtonLoader:"_ButtonLoader_1864l_749"},PSr=t=>{const{type:e="button",color:r="primary",variant:n="solid",pill:i=!0,uniform:a=!1,size:s="md",iconSize:o,gutterSize:l,loading:u,selected:h,block:d,opticallyAlign:f,children:p,className:g,onClick:m,disabled:v,disabledTone:y,inert:b=u,...x}=t,w=v||b,A=se.useCallback(S=>{v||m==null||m(S)},[m,v]);return W.jsxs("button",{type:e,className:AE($ue.Button,g),"data-color":r,"data-variant":n,"data-pill":i?"":void 0,"data-uniform":a?"":void 0,"data-size":s,"data-gutter-size":l,"data-icon-size":o,"data-loading":u?"":void 0,"data-selected":h?"":void 0,"data-block":d?"":void 0,"data-optically-align":f,onPointerEnter:AKe,disabled:w,"aria-disabled":w,tabIndex:w?-1:void 0,"data-disabled":v?"":void 0,"data-disabled-tone":v?y:void 0,onClick:A,...x,children:[W.jsx(UKe,{className:$ue.ButtonLoader,enterDuration:250,exitDuration:150,children:u&&W.jsx(CSr,{},"loader")}),W.jsx("span",{className:$ue.ButtonInner,children:Bue(p)})]})},NSr=t=>W.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...t,children:W.jsx("path",{d:"M14.5 4a5.5 5.5 0 0 0-5.078 7.616 1 1 0 0 1-.216 1.092l-4.749 4.75a1.475 1.475 0 0 0 2.086 2.085l4.749-4.749a1 1 0 0 1 1.092-.216A5.5 5.5 0 0 0 20 9.414l-1.293 1.293a3.828 3.828 0 1 1-5.414-5.414L14.585 4H14.5ZM7 9.5a7.5 7.5 0 0 1 9.969-7.084 1 1 0 0 1 .378 1.651l-2.64 2.64a1.829 1.829 0 0 0 2.586 2.586l2.64-2.64a1 1 0 0 1 1.651.378 7.5 7.5 0 0 1-9.328 9.627l-4.299 4.3a3.475 3.475 0 0 1-4.914-4.915l4.299-4.299A7.497 7.497 0 0 1 7 9.5Z"})}),BSr=t=>W.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...t,children:W.jsx("path",{d:"M8.99805 16.796C8.99805 15.4164 7.87961 14.2979 6.5 14.2979C5.12039 14.2979 4.00195 15.4164 4.00195 16.796C4.00196 18.1756 5.1204 19.294 6.5 19.294C7.8796 19.294 8.99804 18.1756 8.99805 16.796ZM19.748 15.0479C19.748 14.7729 19.525 14.5499 19.25 14.5499H15.75C15.475 14.5499 15.252 14.7729 15.252 15.0479V18.5479C15.252 18.823 15.475 19.046 15.75 19.046H19.25C19.525 19.046 19.748 18.823 19.748 18.5479V15.0479ZM10.0469 3.45125C11.077 2.15921 13.0849 2.20276 14.0498 3.58113L16.4189 6.96492L16.5205 7.12215C17.5046 8.76341 16.3301 10.9023 14.3691 10.9024H9.63086C7.60676 10.9023 6.42029 8.62316 7.58105 6.96492L9.9502 3.58113L10.0469 3.45125ZM12.4082 4.73055C12.2223 4.46497 11.842 4.44826 11.6318 4.68074L11.5918 4.73055L9.22266 8.11433C8.99176 8.44435 9.22808 8.89744 9.63086 8.89754H14.3691C14.7468 8.89745 14.9774 8.49957 14.8145 8.17781L14.7773 8.11433L12.4082 4.73055ZM11.002 16.796C11.0019 19.2824 8.98638 21.2979 6.5 21.2979C4.01362 21.2979 1.99806 19.2824 1.99805 16.796C1.99805 14.3096 4.01361 12.294 6.5 12.294C8.98639 12.294 11.002 14.3096 11.002 16.796ZM21.752 18.5479C21.752 19.9297 20.6318 21.0499 19.25 21.0499H15.75C14.3682 21.0499 13.248 19.9297 13.248 18.5479V15.0479C13.2481 13.6662 14.3682 12.546 15.75 12.546H19.25C20.6318 12.546 21.7519 13.6662 21.752 15.0479V18.5479Z",fill:"currentColor"})}),$Sr=t=>W.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...t,children:W.jsx("path",{fillRule:"evenodd",d:"M7.5 5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5ZM3 7.5a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM17 6a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm-4 2a4 4 0 1 1 8 0 4 4 0 0 1-8 0Zm-8.96 8.247C3.137 17.048 2.5 18.271 2.5 20a1 1 0 1 1-2 0c0-2.271.862-4.049 2.21-5.248C4.042 13.57 5.788 13 7.5 13s3.459.57 4.79 1.752c1.348 1.2 2.21 2.977 2.21 5.248a1 1 0 1 1-2 0c0-1.729-.638-2.952-1.54-3.753C10.042 15.43 8.788 15 7.5 15s-2.541.43-3.46 1.247Zm15.757-.607c-1.009-.638-2.338-.807-3.526-.472a1 1 0 0 1-.542-1.925c1.695-.478 3.616-.255 5.136.706 1.558.984 2.635 2.707 2.635 5.051a1 1 0 1 1-2 0c0-1.665-.732-2.746-1.703-3.36Z",clipRule:"evenodd"})});function FSr({branch:t}){return W.jsxs("div",{className:`branch-compare__body${t.status==="running"?" is-streaming":""}`,"aria-live":"polite",children:[t.content?W.jsx(ZQ,{text:t.content,streaming:t.status==="running"}):null,t.status==="running"?W.jsx("span",{className:"branch-compare__caret","aria-hidden":"true"}):null,t.error?W.jsx("p",{className:"branch-compare__error",children:t.error}):null]})}function zSr({args:t,response:e,status:r,onBranchSelect:n}){const{t:i}=Ea("conversation"),a=se.useMemo(()=>cVe(t,e,r),[t,e,r]),[s,o]=se.useState(0);return W.jsxs("section",{className:"branch-compare","aria-label":i("blocks.branchCompare.ariaLabel"),children:[W.jsx("div",{className:"branch-compare__tabs",role:"tablist","aria-label":i("blocks.branchCompare.selectDirection"),children:a.branches.map((l,u)=>W.jsx("button",{className:`branch-compare__tab${s===u?" is-active":""}`,type:"button",role:"tab","aria-selected":s===u,"aria-controls":`branch-compare-panel-${u}`,onClick:()=>o(u),children:W.jsx(ex,{color:"info",size:"sm",variant:"soft",children:l.label})},`${l.label}:${u}`))}),W.jsx("div",{className:"branch-compare__branches",children:a.branches.map((l,u)=>W.jsxs("article",{className:`branch-compare__branch${s===u?" is-active":""}`,id:`branch-compare-panel-${u}`,role:"tabpanel",children:[W.jsx("header",{className:"branch-compare__head",children:W.jsx(ex,{color:"info",size:"sm",variant:"soft",children:l.label})}),W.jsx(FSr,{branch:l}),W.jsx("footer",{className:"branch-compare__footer",children:W.jsx(PSr,{type:"button",color:"info",variant:"ghost",size:"sm",pill:!1,disabled:l.status!=="completed",onClick:()=>n==null?void 0:n(l),children:i("blocks.branchCompare.continue")})})]},`${l.label}:${u}`))})]})}function VKe({controlled:t,default:e,name:r,state:n="value"}){const{current:i}=se.useRef(t!==void 0),[a,s]=se.useState(e),o=i?t:a,l=se.useCallback(u=>{i||s(u)},[]);return[o,l]}const Fue={...Tw},QKe={};function bA(t,e){const r=se.useRef(QKe);return r.current===QKe&&(r.current=t(e)),r}const zue=Fue.useInsertionEffect,USr=zue&&zue!==Fue.useLayoutEffect?zue:t=>t();function Kl(t){const e=bA(VSr).current;return e.next=t,USr(e.effect),e.trampoline}function VSr(){const t={next:void 0,callback:QSr,trampoline:(...e)=>{var r;return(r=t.callback)==null?void 0:r.call(t,...e)},effect:()=>{t.callback=t.next}};return t}function QSr(){}const Th=typeof document<"u"?se.useLayoutEffect:()=>{},GKe=se.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function GSr(){return se.useContext(GKe)}function HSr(t){const{children:e,elementsRef:r,labelsRef:n,onMapChange:i}=t,a=Kl(i),[,s]=se.useState(!1),o=bA(YSr).current,l=bA(WSr).current,u=se.useRef(0),h=se.useRef(!0),d=se.useRef([]),f=se.useRef(null),p=Kl(()=>{h.current||(h.current=!0,s(A=>!A))}),g=Kl((A,S)=>{l.set(A,S),p()}),m=Kl(A=>{l.delete(A),p()}),v=Kl(A=>{const S=new Map;return r.current.length=0,n&&(n.current.length=0),A.forEach(T=>{var O,k;S.set(T.element,{...T.registration.metadata??{},index:T.index}),r.current[T.index]=T.element,n&&(n.current[T.index]=T.registration.label!==void 0?T.registration.label:((k=(O=T.registration.textRef)==null?void 0:O.current)==null?void 0:k.textContent)??T.element.textContent)}),u.current=r.current.length,S});function y(A){var O;if((O=f.current)==null||O.disconnect(),f.current=null,typeof MutationObserver!="function"||A.length<2)return;const S=new MutationObserver(k=>{if(!XSr(k))return;let E=null;for(const _ of A)if(_.isConnected){if(E&&HKe(E,_)>0){S.disconnect(),p();return}E=_}});f.current=S;const T=new Set;for(let k=1;kS.observe(k,{childList:!0}))}const b=Kl(()=>{const[A,S]=qSr(l),T=v(A);y(S),d.current=A,h.current=!1,o.forEach(O=>O(T)),a(T)});Th(()=>(h.current||v(d.current),()=>{r.current=[],n&&(n.current=[])}),[r,n,v]),Th(()=>{h.current&&b()}),Th(()=>()=>{var A;(A=f.current)==null||A.disconnect(),h.current=!0},[]);const x=Kl(A=>(o.add(A),()=>{o.delete(A)})),w=se.useMemo(()=>({register:g,unregister:m,subscribeMapChange:x,nextIndexRef:u}),[g,m,x,u]);return W.jsx(GKe.Provider,{value:w,children:e})}function WSr(){return new Map}function YSr(){return new Set}function qSr(t){const e=new Set,r=[],n=[];t.forEach((a,s)=>{if(!s.isConnected)return;const o=a.index,l={index:o??-1,element:s,registration:a};o===null?n.push(l):o>=0&&(e.add(o),r.push(l))});let i=0;return n.sort((a,s)=>HKe(a.element,s.element)),n.forEach(a=>{for(;e.has(i);)i+=1;a.index=i,r.push(a),i+=1}),e.size>0&&r.sort((a,s)=>a.index-s.index),[r,n.map(a=>a.element)]}function jSr(t,e){let r=t.parentElement;for(;r&&!r.contains(e);)r=r.parentElement;return r}function XSr(t){for(const e of t)for(let r=0;ra.searchParams.append("args[]",s)),`${e} error #${n}; visit ${a} for the full message.`}}const Z6=KSr("https://base-ui.com/production-error","Base UI"),WKe=se.createContext(void 0);function YKe(){const t=se.useContext(WKe);if(t===void 0)throw new Error(Z6(10));return t}function eG(t,e,r,n){const i=bA(qKe).current;return JSr(i,t,e,r,n)&&jKe(i,[t,e,r,n]),i.callback}function ZSr(t){const e=bA(qKe).current;return eTr(e,t)&&jKe(e,t),e.callback}function qKe(){return{callback:null,cleanup:null,refs:[]}}function JSr(t,e,r,n,i){return t.refs[0]!==e||t.refs[1]!==r||t.refs[2]!==n||t.refs[3]!==i}function eTr(t,e){return t.refs.length!==e.length||t.refs.some((r,n)=>r!==e[n])}function jKe(t,e){if(t.refs=e,e.every(r=>r==null)){t.callback=null;return}t.callback=r=>{if(t.cleanup&&(t.cleanup(),t.cleanup=null),r!=null){const n=Array(e.length).fill(null);for(let i=0;i{for(let i=0;i=t}function XKe(t){if(!se.isValidElement(t))return null;const e=t,r=e.props;return(rTr(19)?r==null?void 0:r.ref:e.ref)??null}function Uue(t,e){if(t&&!e)return t;if(!t&&e)return e;if(t||e)return{...t,...e}}const nTr=Object.freeze([]),$E=Object.freeze({});function iTr(t,e){const r={};for(const n in t){const i=t[n];if(e!=null&&e.hasOwnProperty(n)){const a=e[n](i);a!=null&&Object.assign(r,a);continue}i===!0?r[`data-${n.toLowerCase()}`]="":i&&(r[`data-${n.toLowerCase()}`]=i.toString())}return r}function aTr(t,e){return typeof t=="function"?t(e):t}function KKe(t,e){return typeof t=="function"?t(e):t}const Vue={};function Que(t,e,r,n,i){if(!r&&!n&&!t)return tG(e);let a=tG(t);return e&&(a=rG(a,e)),r&&(a=rG(a,r)),n&&(a=rG(a,n)),a}function sTr(t){if(t.length===0)return Vue;if(t.length===1)return tG(t[0]);let e=tG(t[0]);for(let r=1;r=65&&i<=90&&(typeof e=="function"||typeof e>"u")}function Gue(t){return typeof t=="function"}function JKe(t,e){return Gue(t)?t(e):t??Vue}function cTr(t,e){return e?t?(...r)=>{const n=r[0];if(rZe(n)){const a=n;nG(a);const s=e(...r);return a.baseUIHandlerPrevented||t==null||t(...r),s}const i=e(...r);return t==null||t(...r),i}:eZe(e):t}function eZe(t){return t&&((...e)=>{const r=e[0];return rZe(r)&&nG(r),t(...e)})}function nG(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPrevented=!0},t}function tZe(t,e){return e?t?e+" "+t:e:t}function rZe(t){return t!=null&&typeof t=="object"&&"nativeEvent"in t}function J6(t,e,r={}){const n=e.render,i=uTr(e,r);if(r.enabled===!1)return null;const a=r.state??$E;return fTr(t,n,i,a)}function uTr(t,e={}){const{className:r,style:n,render:i}=t,{state:a=$E,ref:s,props:o,stateAttributesMapping:l,enabled:u=!0}=e,h=u?aTr(r,a):void 0,d=u?KKe(n,a):void 0,f=u?iTr(a,l):$E,p=u&&o?hTr(o):void 0,g=u?Uue(f,p)??{}:$E;return typeof document<"u"&&(u?Array.isArray(s)?g.ref=ZSr([g.ref,XKe(i),...s]):g.ref=eG(g.ref,XKe(i),s):eG(null,null)),u?(h!==void 0&&(g.className=tZe(g.className,h)),d!==void 0&&(g.style=Uue(g.style,d)),g):$E}function hTr(t){return Array.isArray(t)?sTr(t):Que(void 0,t)}const dTr=Symbol.for("react.lazy");function fTr(t,e,r,n){if(e){if(typeof e=="function")return e(r,n);const i=Que(r,e.props);i.ref=r.ref;let a=e;return(a==null?void 0:a.$$typeof)===dTr&&(a=se.Children.toArray(e)[0]),se.cloneElement(a,i)}if(t&&typeof t=="string")return pTr(t,r);throw new Error(Z6(8))}function pTr(t,e){return t==="button"?se.createElement("button",{type:"button",...e,key:e.key}):t==="img"?se.createElement("img",{alt:"",...e,key:e.key}):se.createElement(t,e)}const gTr={value:()=>null},nZe=se.forwardRef(function(e,r){const{render:n,className:i,disabled:a=!1,hiddenUntilFound:s,keepMounted:o,loopFocus:l,onValueChange:u,multiple:h=!1,orientation:d="vertical",value:f,defaultValue:p,style:g,...m}=e,v=se.useMemo(()=>{if(f===void 0)return p??[]},[f,p]),y=se.useRef([]),[b,x]=VKe({controlled:f,default:v,name:"Accordion",state:"value"}),w=Kl((O,k,E)=>{if(h)if(k){const _=b.slice();if(_.push(O),u==null||u(_,E),E.isCanceled)return;x(_)}else{const _=b.filter(I=>I!==O);if(u==null||u(_,E),E.isCanceled)return;x(_)}else{const _=b[0]===O?[]:[O];if(u==null||u(_,E),E.isCanceled)return;x(_)}}),A=se.useMemo(()=>({value:b,disabled:a,orientation:d}),[b,a,d]),S=se.useMemo(()=>({disabled:a,handleValueChange:w,hiddenUntilFound:s??!1,keepMounted:o??!1,state:A,value:b}),[a,w,s,o,A,b]),T=J6("div",e,{state:A,ref:r,props:m,stateAttributesMapping:gTr});return W.jsx(WKe.Provider,{value:S,children:W.jsx(HSr,{elementsRef:y,children:T})})});let iZe=0;function mTr(t,e="mui"){const[r,n]=se.useState(t),i=t||r;return se.useEffect(()=>{r==null&&(iZe+=1,n(`${e}-${iZe}`))},[r,e]),i}const aZe=Fue.useId;function vTr(t,e){if(aZe!==void 0){const r=aZe();return`${e}-${r}`}return mTr(t,e)}function Hue(t){return vTr(t,"base-ui")}const yTr="none",bTr="trigger-press";function sZe(t,e,r,n){let i=!1,a=!1;const s=$E;return{reason:t,event:e??new Event("base-ui"),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:r,...s}}function xTr(t){se.useEffect(t,nTr)}const iG=null;let wTr=class{constructor(){Bn(this,"callbacks",[]);Bn(this,"callbacksCount",0);Bn(this,"nextId",1);Bn(this,"startId",1);Bn(this,"isScheduled",!1);Bn(this,"tick",e=>{var i;this.isScheduled=!1;const r=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let a=0;a=this.callbacks.length||(this.callbacks[r]=null,this.callbacksCount-=1)}},aG=new wTr;class Ad{constructor(){Bn(this,"currentId",iG);Bn(this,"cancel",()=>{this.currentId!==iG&&(aG.cancel(this.currentId),this.currentId=iG)});Bn(this,"disposeEffect",()=>this.cancel)}static create(){return new Ad}static request(e){return aG.request(e)}static cancel(e){return aG.cancel(e)}request(e){this.cancel(),this.currentId=aG.request(()=>{this.currentId=iG,e()})}}function ATr(){const t=bA(Ad.create).current;return xTr(t.disposeEffect),t}function STr(t,e=!1,r=!1){const[n,i]=se.useState(t&&e?"idle":void 0),[a,s]=se.useState(t);return t&&!a&&(s(!0),i("starting")),!t&&a&&n!=="ending"&&!r&&i("ending"),!t&&!a&&n==="ending"&&i(void 0),Th(()=>{if(!t&&a&&n!=="ending"&&r){const o=Ad.request(()=>{i("ending")});return()=>{Ad.cancel(o)}}},[t,a,n,r]),Th(()=>{if(!t||e)return;const o=Ad.request(()=>{i(void 0)});return()=>{Ad.cancel(o)}},[e,t]),Th(()=>{if(!t||!e)return;t&&a&&n!=="idle"&&i("starting");const o=Ad.request(()=>{i("idle")});return()=>{Ad.cancel(o)}},[e,t,a,n]),{mounted:a,setMounted:s,transitionStatus:n}}function TTr(t){const{open:e,defaultOpen:r,onOpenChange:n,disabled:i}=t,[a,s]=VKe({controlled:e,default:r,name:"Collapsible",state:"open"}),{mounted:o,setMounted:l,transitionStatus:u}=STr(a,!0,!0),h=Hue(),[d,f]=se.useState(),p=d===null?void 0:d??h,g=Kl(m=>{const v=!a,y=sZe(bTr,m.nativeEvent);n(v,y),!y.isCanceled&&s(v)});return se.useMemo(()=>({defaultPanelId:h,disabled:i,handleTrigger:g,mounted:o,open:a,panelId:p,setMounted:l,setOpen:s,setPanelIdState:f,transitionStatus:u}),[h,i,g,o,a,p,l,s,f,u])}const oZe=se.createContext(void 0);function lZe(){const t=se.useContext(oZe);if(t===void 0)throw new Error(Z6(15));return t}function CTr(t={}){const{guess:e,label:r,metadata:n,textRef:i,index:a}=t,{register:s,unregister:o,subscribeMapChange:l,nextIndexRef:u}=GSr(),h=se.useRef(-1),[d,f]=se.useState(a==null&&e?()=>{if(h.current===-1){const v=u.current;u.current+=1,h.current=v}return h.current}:-1),p=a??d,g=se.useRef(null),m=se.useCallback(v=>{const y=g.current;y&&o(y),g.current=v,v&&s(v,{metadata:n??null,index:a??null,label:r,textRef:i})},[a,s,o,n,r,i]);return Th(()=>{if(a==null)return l(v=>{var b;const y=g.current?(b=v.get(g.current))==null?void 0:b.index:null;y!=null&&f(y)})},[a,l]),{ref:m,index:p}}const cZe=se.createContext(void 0);function Wue(){const t=se.useContext(cZe);if(t===void 0)throw new Error(Z6(9));return t}let uZe=function(t){return t.startingStyle="data-starting-style",t.endingStyle="data-ending-style",t}({});const OTr={"data-starting-style":""},kTr={"data-ending-style":""},ETr={transitionStatus(t){return t==="starting"?OTr:t==="ending"?kTr:null}};let Yue=function(t){return t.open="data-open",t.closed="data-closed",t[t.startingStyle=uZe.startingStyle]="startingStyle",t[t.endingStyle=uZe.endingStyle]="endingStyle",t}({}),_Tr=function(t){return t.panelOpen="data-panel-open",t}({});const RTr={[Yue.open]:""},DTr={[Yue.closed]:""},LTr={open(t){return t?{[_Tr.panelOpen]:""}:null}},MTr={open(t){return t?RTr:DTr}};let ITr=function(t){return t.index="data-index",t.disabled="data-disabled",t.open="data-open",t}({});const que={...MTr,index:t=>({[ITr.index]:String(t)}),...ETr,value:()=>null},hZe=se.forwardRef(function(e,r){const{className:n,disabled:i=!1,onOpenChange:a,render:s,value:o,style:l,...u}=e,{ref:h,index:d}=CTr(),f=eG(r,h),{disabled:p,handleValueChange:g,state:m,value:v}=YKe(),y=Hue(),b=o??y,x=i||p,w=v.indexOf(b)!==-1,A=Kl((M,P)=>{a==null||a(M,P),!P.isCanceled&&g(b,M,P)}),S=TTr({open:w,onOpenChange:A,disabled:x}),T=se.useMemo(()=>({open:S.open,disabled:S.disabled,transitionStatus:S.transitionStatus}),[S.open,S.disabled,S.transitionStatus]),O=se.useMemo(()=>({...S,onOpenChange:A,state:T}),[S,T,A]),k=se.useMemo(()=>({...m,hidden:!w&&!S.mounted,index:d,disabled:x,open:w}),[S.mounted,x,d,w,m]),E=Hue(),[_,I]=se.useState(),L=_===null?void 0:_??E,R=se.useMemo(()=>({defaultTriggerId:E,open:w,state:k,setTriggerId:I,triggerId:L}),[E,w,k,I,L]),D=J6("div",e,{state:k,ref:f,props:u,stateAttributesMapping:que});return W.jsx(oZe.Provider,{value:O,children:W.jsx(cZe.Provider,{value:R,children:D})})}),dZe=se.forwardRef(function(e,r){const{render:n,className:i,style:a,...s}=e,{state:o}=Wue();return J6("h3",e,{state:o,ref:r,props:s,stateAttributesMapping:que})}),PTr=se.createContext(void 0);function NTr(t=!1){const e=se.useContext(PTr);if(e===void 0&&!t)throw new Error(Z6(16));return e}function BTr(t){const{focusableWhenDisabled:e,disabled:r,composite:n=!1,tabIndex:i=0,isNativeButton:a}=t,s=n&&e!==!1,o=n&&e===!1;return{props:se.useMemo(()=>{const u={onKeyDown(h){r&&e&&h.key!=="Tab"&&h.preventDefault()}};return n||(u.tabIndex=i,!a&&r&&(u.tabIndex=e?i:-1)),(a&&(e||s)||!a&&r)&&(u["aria-disabled"]=r),a&&(!e||o)&&(u.disabled=r),u},[n,r,e,s,o,a,i])}}function jue(t,e,{detail:r=0}={}){t.dispatchEvent(new(Ic(t)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:r,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}function $Tr(t={}){const{disabled:e=!1,focusableWhenDisabled:r,tabIndex:n=0,native:i=!0,composite:a}=t,s=se.useRef(null),o=NTr(!0),l=a??o!==void 0,{props:u}=BTr({focusableWhenDisabled:r,disabled:e,composite:l,tabIndex:n,isNativeButton:i}),h=se.useCallback(()=>{const p=s.current;Xue(p)&&l&&e&&u.disabled===void 0&&p.disabled&&(p.disabled=!1)},[e,u.disabled,l]);Th(h,[h]);const d=se.useCallback((p={})=>{const{onClick:g,onMouseDown:m,onKeyUp:v,onKeyDown:y,onPointerDown:b,...x}=p;return Que({onClick(w){if(e){w.preventDefault();return}g==null||g(w)},onMouseDown(w){e||m==null||m(w)},onKeyDown(w){if(e||(nG(w),y==null||y(w),w.baseUIHandlerPrevented))return;const A=w.target===w.currentTarget,S=w.currentTarget,T=Xue(S),O=!i&&FTr(S),k=A&&(i?T:!O),E=w.key==="Enter",_=w.key===" ",I=S.getAttribute("role"),L=(I==null?void 0:I.startsWith("menuitem"))||I==="option"||I==="gridcell";if(A&&l&&_){if(w.defaultPrevented&&L)return;w.preventDefault(),(!i||T)&&(w.preventBaseUIHandler(),jue(S,w));return}if(!k||i||!_&&!E){A&&O&&_&&w.preventDefault();return}w.defaultPrevented||(w.preventDefault(),E&&(w.preventBaseUIHandler(),jue(S,w)))},onKeyUp(w){if(!e){if(nG(w),v==null||v(w),w.target===w.currentTarget&&i&&l&&Xue(w.currentTarget)&&w.key===" "){w.preventDefault();return}w.baseUIHandlerPrevented||w.target===w.currentTarget&&!i&&!l&&!w.defaultPrevented&&w.key===" "&&(w.preventBaseUIHandler(),jue(w.currentTarget,w))}},onPointerDown(w){if(e){w.preventDefault();return}b==null||b(w)}},i?{type:"button"}:{role:"button"},u,x)},[e,u,l,i]),f=Kl(p=>{s.current=p,h()});return{getButtonProps:d,buttonRef:f}}function Xue(t){return sm(t)&&t.tagName==="BUTTON"}function FTr(t){return sm(t)&&t.tagName==="A"&&!!t.href}const fZe=se.forwardRef(function(e,r){const{disabled:n,className:i,id:a,render:s,nativeButton:o=!0,style:l,...u}=e,{panelId:h,open:d,handleTrigger:f,disabled:p}=lZe(),g=n||p,{getButtonProps:m,buttonRef:v}=$Tr({disabled:g,focusableWhenDisabled:!0,native:o}),{defaultTriggerId:y,state:b,setTriggerId:x}=Wue(),w=a||void 0,A=w??y;return Th(()=>(x(O=>w??(O===null?void 0:O)),()=>{x(O=>O===w?null:O)}),[w,x]),J6("button",e,{state:b,ref:[r,v],props:[{"aria-controls":d?h:void 0,"aria-expanded":d,id:A,onClick:f},u,m],stateAttributesMapping:LTr})});function zTr(t,e,r,n){return t.addEventListener(e,r,n),()=>{t.removeEventListener(e,r,n)}}function UTr(t){const e=bA(VTr,t).current;return e.next=t,Th(e.effect),e}function VTr(t){const e={current:t,next:t,effect:()=>{e.current=e.next}};return e}function QTr(t){return t==null?t:"current"in t?t.current:t}function pZe(t,e=!1){const r=ATr();return Kl((n,i=null)=>{r.cancel();const a=QTr(t);if(a==null)return;const s=a,o=()=>{ak.flushSync(n)};if(typeof s.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){n();return}function l(){Promise.all(s.getAnimations().map(u=>u.finished)).then(()=>{i!=null&&i.aborted||o()},()=>{if(i!=null&&i.aborted)return;if(s.getAnimations().some(h=>h.pending||h.playState!=="finished")){l();return}o()})}if(e){const u="data-starting-style";if(!s.hasAttribute(u)){r.request(l);return}const h=new MutationObserver(()=>{s.hasAttribute(u)||(h.disconnect(),l())});h.observe(s,{attributes:!0,attributeFilter:[u]}),i==null||i.addEventListener("abort",()=>h.disconnect(),{once:!0});return}r.request(l)})}function GTr(t){const{enabled:e=!0,open:r,ref:n,onComplete:i}=t,a=Kl(i),s=pZe(n,r);se.useEffect(()=>{if(!e)return;const o=new AbortController;return s(a,o.signal),()=>{o.abort()}},[e,r,a,s])}const eN={height:void 0,width:void 0};function HTr(t){const{externalRef:e,hiddenUntilFound:r,id:n,keepMounted:i,mounted:a,onOpenChange:s,open:o,setMounted:l,setOpen:u,transitionStatus:h}=t,d=se.useRef(null),f=se.useRef(null),[p,g]=se.useState(eN),m=se.useRef(eN),v=se.useRef(!1),y=se.useRef(o),b=se.useRef(!1),[x,w]=se.useState(!1),A=se.useRef(null),S=eG(e,d),T=UTr(o),O=pZe(d),k=!o&&!a,E=x?"idle":h,_=o&&(y.current||b.current),I=!o&&a&&f.current==="css-animation"&&p.height===void 0&&p.width===void 0?m.current:p,L=r&&k&&f.current!=="css-animation",R=Kl((F,B=!0)=>{B&&(m.current=F),g(F)}),D=Kl(()=>{var F;(F=A.current)==null||F.call(A),A.current=null}),M=Kl(F=>{D(),A.current=()=>{A.current=null,F()}}),P=Kl(()=>{o&&a&&f.current==="css-animation"&&(b.current=!0)});Th(()=>{!x||h==="starting"||w(!1)},[x,h]),se.useEffect(()=>()=>{P(),D()},[P,D]),Th(()=>{const F=d.current;if(!F)return;!o&&A.current&&D();const B=WTr(F,_);if(f.current=B,o&&h==="idle"&&y.current&&B==="css-animation"){m.current=FE(F);return}if(o&&h==="starting"){const U=v.current;if(v.current=!1,B==="none"){R(FE(F)),w(!0);return}if(B==="css-transition"){const X=YTr(F);if(R(FE(F)),!U)return X;const Y=sG(F,"transition-duration","0s");return M(Y),w(!0),X}R(FE(F));const Q=sG(F,"animation-name","none");if(!U){Q();return}const G=sG(F,"animation-duration","0s");Q(),M(G),w(!0);return}if(!o&&a&&(h==="idle"||h==="starting")){if(y.current=!1,b.current=!1,B==="none"){R(eN,!1),l(!1);return}R(FE(F));return}if(h!=="ending")return;if(B==="none"){l(!1);return}const V=FE(F);if(!(V.height>0||V.width>0)){l(!1);return}R(V),B==="css-animation"&&sG(F,"animation-name","none")()},[a,o,D,R,l,M,_,h]),GTr({enabled:o&&a&&E==="idle",open:!0,ref:d,onComplete(){o&&R(eN,!1)}}),se.useEffect(()=>{if(o||!a||E!=="ending"||!d.current)return;const B=new AbortController;let V=-1;function z(){T.current||(l(!1),R(eN,!1))}return V=Ad.request(()=>{O(z,B.signal)}),()=>{Ad.cancel(V),B.abort()}},[T,a,o,E,O,R,l]),Th(()=>{const F=d.current;!F||!r||!k||F.setAttribute("hidden","until-found")},[k,r]),se.useEffect(function(){const B=d.current;if(!B)return;function V(z){const U=sZe(yTr,z);s(!0,U),!U.isCanceled&&(v.current=!0,u(!0))}return zTr(B,"beforematch",V)},[s,u]);const N=i||r||a||o;return{height:I.height,props:{...L?{[Yue.startingStyle]:""}:void 0,hidden:k,id:n},ref:S,shouldPreventOpenAnimation:_,shouldRender:N,transitionStatus:E,width:I.width}}function FE(t){return{height:t.scrollHeight,width:t.scrollWidth}}function WTr(t,e){const r=Ic(t).getComputedStyle(t),n=(r.animationName.split(",").map(a=>a.trim()).some(a=>a!==""&&a!=="none")||e)&&gZe(r.animationDuration),i=gZe(r.transitionDuration);return n&&i||i?"css-transition":n?"css-animation":"none"}function gZe(t){return t.split(",").map(e=>e.trim()).some(e=>e!==""&&Number.parseFloat(e)>0)}function sG(t,e,r){const n=t.style.getPropertyValue(e),i=t.style.getPropertyPriority(e);return t.style.setProperty(e,r),()=>{if(n===""){t.style.removeProperty(e);return}t.style.setProperty(e,n,i)}}function YTr(t){const e={"justify-content":t.style.justifyContent,"align-items":t.style.alignItems,"align-content":t.style.alignContent,"justify-items":t.style.justifyItems};Object.keys(e).forEach(i=>{t.style.setProperty(i,"initial","important")});function r(){Object.entries(e).forEach(([i,a])=>{if(a===""){t.style.removeProperty(i);return}t.style.setProperty(i,a)})}const n=Ad.request(r);return()=>{Ad.cancel(n),r()}}let mZe=function(t){return t.accordionPanelHeight="--accordion-panel-height",t.accordionPanelWidth="--accordion-panel-width",t}({});const vZe=se.forwardRef(function(e,r){const{className:n,hiddenUntilFound:i,keepMounted:a,id:s,render:o,style:l,...u}=e,{hiddenUntilFound:h,keepMounted:d}=YKe(),{defaultPanelId:f,mounted:p,onOpenChange:g,open:m,setMounted:v,setOpen:y,setPanelIdState:b,transitionStatus:x}=lZe(),w=i??h,A=a??d,S=s||void 0,T=s??f;Th(()=>(b(B=>S??(B===null?void 0:B)),()=>{b(B=>B===S?null:B)}),[S,b]);const{height:O,props:k,ref:E,shouldPreventOpenAnimation:_,shouldRender:I,transitionStatus:L,width:R}=HTr({externalRef:r,hiddenUntilFound:w,id:T,keepMounted:A,mounted:p,onOpenChange:g,open:m,setMounted:v,setOpen:y,transitionStatus:x}),{state:D,triggerId:M}=Wue(),P={...D,transitionStatus:L},N=KKe(l,P),F=J6("div",{...e,style:void 0},{state:P,ref:E,props:[k,{"aria-labelledby":M,role:"region",style:{[mZe.accordionPanelHeight]:O===void 0?"auto":`${O}px`,[mZe.accordionPanelWidth]:R===void 0?"auto":`${R}px`}},u,N?{style:N}:void 0,_?{style:{animationName:"none"}}:void 0],stateAttributesMapping:que});return I?F:null});function Kue(t){const e=se.useRef(t);return e.current=t,e}let zE=[],oG=!1;const yZe=t=>{var e,r;if(t.key==="Escape"){const[n]=zE;n&&(t.preventDefault(),(r=(e=n.callback).current)==null||r.call(e))}},bZe=()=>{zE.length>0&&!oG?(document.body.addEventListener("keydown",yZe),oG=!0):zE.length===0&&oG&&(document.body.removeEventListener("keydown",yZe),oG=!1)},qTr=t=>{zE.unshift(t),bZe()},jTr=({id:t})=>{zE=zE.filter(e=>e.id!==t),bZe()},XTr=(t,e)=>{const r=se.useId(),n=Kue(e);se.useEffect(()=>{if(!t)return;const i={id:r,callback:n};return qTr(i),()=>jTr(i)},[r,t,n])},KTr=(t,e)=>{const r=t.currentTarget,n={x:t.clientX,y:t.clientY},i=ZTr(n,r.getBoundingClientRect()),a=JTr(n,i),s=eCr(e.getBoundingClientRect());return rCr([...a,...s])};function ZTr(t,e){const r=Math.abs(e.top-t.y),n=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),a=Math.abs(e.left-t.x);switch(Math.min(r,n,i,a)){case a:return"left";case i:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function JTr(t,e,r=5){const n=[];switch(e){case"top":n.push({x:t.x-r,y:t.y+r},{x:t.x+r,y:t.y+r});break;case"bottom":n.push({x:t.x-r,y:t.y-r},{x:t.x+r,y:t.y-r});break;case"left":n.push({x:t.x+r,y:t.y-r},{x:t.x+r,y:t.y+r});break;case"right":n.push({x:t.x-r,y:t.y-r},{x:t.x-r,y:t.y+r});break}return n}function eCr(t){const{top:e,right:r,bottom:n,left:i}=t;return[{x:i,y:e},{x:r,y:e},{x:r,y:n},{x:i,y:n}]}function tCr(t,e){const{x:r,y:n}=t;let i=!1;for(let a=0,s=e.length-1;an!=f>n&&r<(d-u)*(n-h)/(f-h)+u&&(i=!i)}return i}function rCr(t){const e=t.slice();return e.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),nCr(e)}function nCr(t){if(t.length<=1)return t.slice();const e=[];for(let n=0;n=2;){const a=e[e.length-1],s=e[e.length-2];if((a.x-s.x)*(i.y-s.y)>=(a.y-s.y)*(i.x-s.x))e.pop();else break}e.push(i)}e.pop();const r=[];for(let n=t.length-1;n>=0;n--){const i=t[n];for(;r.length>=2;){const a=r[r.length-1],s=r[r.length-2];if((a.x-s.x)*(i.y-s.y)>=(a.y-s.y)*(i.x-s.x))r.pop();else break}r.push(i)}return r.pop(),e.length===1&&r.length===1&&e[0].x===r[0].x&&e[0].y===r[0].y?e:e.concat(r)}const xZe={Transition:"_Transition_1wdpp_1",Popover:"_Popover_1wdpp_3"},wZe=se.createContext(null),lG=()=>{const t=se.use(wZe);if(!t)throw new Error("Popover components must be wrapped in ");return t},tN=({open:t,onOpenChange:e,showOnHover:r=!1,hoverOpenDelay:n=150,children:i})=>{const[a,s]=se.useState(!1),[o,l]=se.useState(!1),u=se.useRef(null),h=se.useRef(null),d=se.useRef(void 0),f=se.useRef(!1),p=se.useRef(!1),g=t??a,[m,v]=se.useState(!1);bKe(()=>v(!1),m?500:null);const y=Kue(e),b=Kue(T=>{var O,k;clearTimeout(d.current),g!==T&&(T||(l(!1),r&&f.current&&((O=u.current)==null||O.focus()),f.current=!1),(k=y.current)==null||k.call(y,T),s(T),r&&v(T))}),x=se.useCallback(T=>{b.current(T)},[b]),w=se.useCallback(()=>{d.current=setTimeout(()=>x(!0),n)},[x,n]),A=se.useCallback(()=>{clearTimeout(d.current)},[]);se.useEffect(()=>()=>{clearTimeout(d.current)},[]);const S=se.useMemo(()=>({open:g,setOpen:x,shake:o,setShake:l,showOnHover:r,temporarilyPreventClickToClose:m,onTriggerEnter:w,onTriggerLeave:A,isPointerInTransitRef:p,triggerRef:u,contentRef:h,hoverOpenFocusedWithTab:f}),[g,x,o,l,r,m,f,p,w,A]);return W.jsx(wZe,{value:S,children:W.jsx(vAr,{open:g,onOpenChange:x,modal:!1,children:i})})},iCr=({children:t,onPointerDown:e,onClick:r})=>{const{setOpen:n,showOnHover:i,temporarilyPreventClickToClose:a,onTriggerEnter:s,onTriggerLeave:o,isPointerInTransitRef:l,triggerRef:u,contentRef:h}=lG(),d=se.useRef(!1),f=m=>{!(m.currentTarget.nodeName.toLocaleLowerCase()==="a")&&a&&(m.preventDefault(),m.stopPropagation())},p=m=>{m.pointerType!=="touch"&&!d.current&&!l.current&&(s(),d.current=!0)},g=()=>{d.current&&(o(),d.current=!1)};return W.jsx(yAr,{asChild:!0,ref:u,onPointerDown:m=>{f(m),e==null||e(m)},onClick:m=>{f(m),r==null||r(m)},onPointerMove:i?p:void 0,onPointerLeave:i?g:void 0,onFocus:i?()=>n(!0):void 0,onBlur:i?()=>{setTimeout(()=>{var m;(m=h.current)!=null&&m.contains(document.activeElement)||n(!1)},50)}:void 0,children:t})},AZe=({children:t,avoidCollisions:e,width:r,minWidth:n,maxWidth:i,side:a,sideOffset:s=8,align:o,alignOffset:l,translucent:u,className:h,autoFocus:d=!0})=>{const{showOnHover:f,shake:p,contentRef:g}=lG(),m=v=>{const y=g.current;if(y&&v.target===y&&v.key==="Tab"&&v.shiftKey){v.preventDefault(),v.stopPropagation();const b=TKe(y),x=b[b.length-1];x==null||x.focus()}};return se.useEffect(()=>{const v=g.current;!v||!d||v!=null&&v.contains(document.activeElement)||f||v.focus({preventScroll:!0})},[g,f,d]),W.jsx(xAr,{forceMount:!0,ref:g,className:AE(xZe.Popover,h),style:SKe({"popover-width":r,"popover-min-width":n,"popover-max-width":i}),onCloseAutoFocus:f?Due:void 0,"data-animate":p?"shake":void 0,"data-translucent":u?"true":void 0,side:a,sideOffset:s,align:o,alignOffset:l??(o==="center"?0:-5),avoidCollisions:e??!0,hideWhenDetached:!0,collisionPadding:20,onOpenAutoFocus:Due,onEscapeKeyDown:Due,onKeyDown:m,children:t})},aCr=t=>{const{setOpen:e,triggerRef:r,contentRef:n,isPointerInTransitRef:i,hoverOpenFocusedWithTab:a}=lG(),[s,o]=se.useState(null),l=se.useCallback(()=>{o(null),i.current=!1},[i]),u=se.useCallback((h,d)=>{const f=KTr(h,d);o(f),i.current=!0},[i]);return se.useEffect(()=>()=>l(),[l]),se.useEffect(()=>{const h=r.current,d=n.current;if(!h||!d)return;const f=g=>u(g,d),p=g=>u(g,h);return h.addEventListener("pointerleave",f),d.addEventListener("pointerleave",p),()=>{h.removeEventListener("pointerleave",f),d.removeEventListener("pointerleave",p)}},[n,r,u,l]),se.useEffect(()=>{if(!s)return;const h=d=>{const f=r.current,p=n.current,g=d.target,m={x:d.clientX,y:d.clientY},v=(f==null?void 0:f.contains(g))||(p==null?void 0:p.contains(g)),y=!tCr(m,s),b=g.hasAttribute("aria-haspopup");v?l():(y||b)&&(l(),e(!1))};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)},[s,e,l,r,n]),se.useEffect(()=>{const h=d=>{if(n.current&&d.key==="Tab"&&!d.shiftKey){const[f]=TKe(n.current);f&&(d.preventDefault(),f.focus(),a.current=!0,document.removeEventListener("keydown",h))}};return document.addEventListener("keydown",h),()=>{document.removeEventListener("keydown",h)}},[n,a]),W.jsx(AZe,{...t})},sCr=t=>{const{open:e,showOnHover:r,setOpen:n}=lG();return XTr(e,()=>{n(!1)}),W.jsx(bAr,{forceMount:!0,children:W.jsx(UKe,{enterDuration:600,exitDuration:300,className:xZe.Transition,disableAnimations:!0,children:e&&(r?W.jsx(aCr,{...t},"popover-hover"):W.jsx(AZe,{...t},"popover"))})})};tN.Trigger=iCr,tN.Content=sCr,se.createContext(null),se.createContext(null),se.createContext(null),se.createContext(null);function Zue(...t){return t.filter(Boolean).join(" ")}const SZe=[["14 90% 62%","28 96% 80%","3 44% 24%"],["198 72% 56%","217 88% 79%","189 42% 24%"],["263 66% 63%","291 72% 81%","242 39% 25%"],["146 49% 52%","169 66% 78%","158 38% 23%"],["334 72% 63%","15 87% 80%","350 41% 25%"]];function oCr(t){let e=2166136261;for(const s of t)e^=s.charCodeAt(0),e=Math.imul(e,16777619);const r=e>>>0,[n,i,a]=SZe[r%SZe.length];return{"--resource-identity-accent":n,"--resource-identity-glow":i,"--resource-identity-shadow":a,"--resource-identity-x":`${20+(r>>>7)%61}%`,"--resource-identity-y":`${18+(r>>>15)%57}%`}}function lCr({seed:t,className:e}){return W.jsx("span",{className:Zue("resource-card__identity-mark",e),style:oCr(t),"aria-hidden":"true"})}se.forwardRef(function({className:e,...r},n){return W.jsx("section",{ref:n,className:Zue("resource-results",e),...r})});function cCr({className:t,footer:e,actions:r,activateLabel:n,onActivate:i,children:a,...s}){return W.jsxs("article",{className:Zue("resource-card",i&&"is-interactive",t),...s,children:[i&&n?W.jsx("button",{type:"button",className:"resource-card__target","aria-label":n,title:n,onClick:i}):null,W.jsx("div",{className:"resource-card__content",children:a}),e||r?W.jsxs("footer",{className:"resource-card__footer",children:[e,r?W.jsx("div",{className:"resource-card__actions",children:r}):null]}):null]})}function uCr({leading:t,title:e,titleText:r,subtitle:n,status:i}){return W.jsxs("div",{className:"resource-card__header",children:[W.jsxs("div",{className:"resource-card__identity",children:[t,W.jsxs("div",{className:"resource-card__title-copy",children:[W.jsx("h3",{title:r,children:e}),n]})]}),i]})}function hCr({children:t,title:e}){return W.jsx("p",{className:"resource-card__description",title:e,children:t})}function dCr(t){return W.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...t,children:[W.jsx("path",{d:"M7.58 2.6a.667.667 0 0 0-.667-.667h-.666a.667.667 0 0 0-.667.667v10.667c0 .368.299.666.667.666h.666a.667.667 0 0 0 .667-.666V2.6Zm1.333 10.667A2 2 0 0 1 6.913 15.267h-.666a2 2 0 0 1-2-2V2.6a2 2 0 0 1 2-2h.666a2 2 0 0 1 2 2v10.667Z",fill:"currentColor"}),W.jsx("path",{d:"M11.88 5.045a.667.667 0 0 0-.801-.514l-.653.136a.667.667 0 0 0-.504.786l1.85 8.092c.081.358.44.589.8.514l.653-.137a.667.667 0 0 0 .504-.786L11.88 5.045Zm3.155 7.82a2 2 0 0 1-1.512 2.358l-.653.136a2 2 0 0 1-2.403-1.541L8.617 5.726a2 2 0 0 1 1.513-2.358l.652-.136a2 2 0 0 1 2.404 1.541l1.849 8.092Z",fill:"currentColor"}),W.jsx("path",{d:"M4.247 2.6a.667.667 0 0 0-.667-.667h-.667a.667.667 0 0 0-.666.667v10.667c0 .368.298.666.666.666h.667a.667.667 0 0 0 .667-.666V2.6ZM5.58 13.267a2 2 0 0 1-2 2h-.667a2 2 0 0 1-2-2V2.6a2 2 0 0 1 2-2h.667a2 2 0 0 1 2 2v10.667Z",fill:"currentColor"})]})}const fCr=["skill_hub","skill_space","knowledge_base","tool"];function TZe(t){return W.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:W.jsx("path",{d:"m4 6 4 4 4-4"})})}function CZe({label:t}){return W.jsx("div",{className:"create-agent-card__loading",role:"status","aria-label":t,children:[0,1,2].map(e=>W.jsxs("div",{className:"create-agent-card__skeleton-row","aria-hidden":"true",children:[W.jsx("span",{}),W.jsx("span",{})]},e))})}function pCr(t,e){return t.kind==="tool"?e("blocks.createAgents.builtinTool"):t.kind==="knowledge_base"?e("blocks.createAgents.knowledgeBase"):t.source.startsWith("skill_hub:")?"Skill Hub":t.source.startsWith("skill_space:")?e("blocks.createAgents.skillCenter"):"Skill"}function Jue({label:t,resources:e}){const{t:r}=Ea("conversation");return e.length===0?null:W.jsxs("section",{className:"create-agent-card__popover-section",children:[W.jsx("h4",{children:t}),W.jsx("div",{className:"create-agent-card__popover-list",children:e.map(n=>W.jsxs("div",{className:"create-agent-card__popover-item",children:[W.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[W.jsx("strong",{children:n.name}),W.jsx(ex,{color:"secondary",size:"sm",variant:"soft",children:pCr(n,r)})]}),n.description?W.jsx("p",{children:n.description}):null]},n.ref))})]})}function gCr({tools:t}){const{t:e}=Ea("conversation");return t.length===0?null:W.jsxs("section",{className:"create-agent-card__popover-section",children:[W.jsx("h4",{children:e("blocks.createAgents.selfAuthoredTools")}),W.jsx(nZe,{children:t.map((r,n)=>W.jsxs(hZe,{className:"create-agent-card__python-tool",value:`${r.name}:${n}`,children:[W.jsx(dZe,{className:"create-agent-card__python-tool-header",children:W.jsxs(fZe,{className:"create-agent-card__python-tool-trigger",children:[W.jsxs("span",{children:[W.jsx("strong",{children:r.name}),r.description?W.jsx("small",{children:r.description}):null]}),W.jsxs("span",{className:"create-agent-card__python-tool-meta",children:[W.jsx(ex,{color:"secondary",size:"sm",variant:"soft",children:e("blocks.createAgents.selfAuthoredTools")}),W.jsx(TZe,{className:"create-agent-card__python-tool-chevron"})]})]})}),W.jsxs(vZe,{className:"create-agent-card__python-tool-panel",children:[r.dependencies.length>0?W.jsx("div",{className:"create-agent-card__python-tool-dependencies",children:e("blocks.createAgents.dependencies",{items:r.dependencies.join(", ")})}):null,W.jsx("pre",{tabIndex:0,"aria-label":e("blocks.createAgents.fullCode",{name:r.name}),children:W.jsx("code",{children:r.code})})]})]},`${r.name}:${n}`))})]})}function mCr({agents:t}){const{t:e}=Ea("conversation");return t.length===0?null:W.jsxs("section",{className:"create-agent-card__popover-section",children:[W.jsx("h4",{children:e("blocks.createAgents.subAgents")}),W.jsx("div",{className:"create-agent-card__popover-list",children:t.map(r=>W.jsxs("div",{className:"create-agent-card__popover-item",children:[W.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[W.jsx("strong",{children:r.id}),W.jsx(ex,{color:"secondary",size:"sm",variant:"soft",children:e(`blocks.createAgents.agentTypes.${r.type}`,{defaultValue:r.type})})]}),r.description?W.jsx("p",{children:r.description}):null]},r.id))})]})}function cG({label:t,count:e,icon:r,children:n}){const{t:i}=Ea("conversation"),a=W.jsxs("button",{className:"create-agent-card__resource-metric",type:"button",disabled:e===0,"aria-label":i("blocks.createAgents.itemCount",{label:t,count:e}),children:[r,W.jsx("span",{children:e})]});return e===0?a:W.jsxs(tN,{showOnHover:!0,hoverOpenDelay:120,children:[W.jsx(tN.Trigger,{children:a}),W.jsx(tN.Content,{side:"top",align:"start",minWidth:"auto",maxWidth:360,className:"create-agent-card__resource-popover",children:n})]})}function vCr({response:t,status:e}){const{t:r}=Ea("conversation"),n=se.useMemo(()=>({tool:r("blocks.createAgents.sourceLabels.tool"),knowledge:r("blocks.createAgents.sourceLabels.knowledge"),skillCenter:r("blocks.createAgents.sourceLabels.skillCenter"),unknownSource:r("blocks.createAgents.sourceLabels.unknown"),unnamedResource:r("blocks.createAgents.unnamedResource"),unnamedAgent:r("blocks.createAgents.unnamedAgent")}),[r]),i=se.useMemo(()=>bSr(t,n),[n,t]),a=se.useMemo(()=>fCr.map(l=>{const u=xSr(i,l);return{value:l,label:r(`blocks.createAgents.categories.${l}`),...u,searchKeywords:[...new Set(u.sources.flatMap(h=>h.searchKeywords))]}}),[i,r]),s=e==="failed",o=s?JQ(t):"";return W.jsx("section",{className:"create-agent-tool-card","aria-label":r("blocks.createAgents.collectionAria"),children:e==="running"?W.jsx(CZe,{label:r("blocks.createAgents.retrieving")}):s?W.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[W.jsx("span",{className:"create-agent-card__message-title",children:r("blocks.createAgents.retrievalFailed")}),W.jsx("span",{children:o||r("blocks.createAgents.checkConfig")})]}):W.jsx(nZe,{className:"create-agent-card__accordion",children:a.map(l=>W.jsxs(hZe,{className:"create-agent-card__accordion-item",value:l.value,children:[W.jsx(dZe,{className:"create-agent-card__accordion-header",children:W.jsxs(fZe,{className:"create-agent-card__accordion-trigger",children:[W.jsx("span",{children:l.label}),W.jsxs("span",{className:"create-agent-card__accordion-meta",children:[W.jsx(ex,{color:"secondary",size:"sm",variant:"soft",children:l.sources.length===0?l.value==="skill_hub"?r("blocks.createAgents.notSearched"):r("blocks.createAgents.notConfigured"):l.resources.length}),W.jsx(TZe,{className:"create-agent-card__accordion-chevron"})]})]})}),W.jsx(vZe,{className:"create-agent-card__accordion-content",children:W.jsxs("div",{className:"create-agent-card__accordion-scroll",role:"region","aria-label":r("blocks.createAgents.resourceList",{label:l.label}),tabIndex:0,children:[l.value==="skill_hub"&&l.searchKeywords.length>0?W.jsxs("div",{className:"create-agent-card__search-keywords",children:[W.jsx("span",{children:r("blocks.createAgents.searchKeywords")}),W.jsx("span",{children:l.searchKeywords.join("、")})]}):null,l.resources.length>0?W.jsx("div",{className:"create-agent-card__resource-list",children:l.resources.map(u=>W.jsx("div",{className:"create-agent-card__resource",children:W.jsxs("div",{className:"create-agent-card__resource-main",children:[W.jsxs("div",{className:"create-agent-card__resource-title",children:[W.jsx("span",{className:"create-agent-card__resource-name",children:u.name}),u.version?W.jsx(ex,{className:"create-agent-card__resource-version",color:"secondary",size:"sm",variant:"soft",children:u.version}):null]}),u.description?W.jsx("p",{children:u.description}):null]})},u.ref))}):W.jsxs("div",{className:"create-agent-card__empty-category",children:[W.jsx("p",{children:l.sources.length===0?l.value==="skill_hub"?r("blocks.createAgents.skillHubSkipped"):r("blocks.createAgents.sourceSkipped",{label:l.label}):r("blocks.createAgents.noResources")}),l.sources.filter(u=>u.message).map(u=>W.jsx("p",{className:"create-agent-card__raw-source-error",children:u.message},u.source))]})]})})]},l.value))},i.collectionId||"collected-resources")})}function yCr({args:t,response:e,status:r}){const{t:n}=Ea("conversation"),i=se.useMemo(()=>({tool:n("blocks.createAgents.sourceLabels.tool"),knowledge:n("blocks.createAgents.sourceLabels.knowledge"),skillCenter:n("blocks.createAgents.sourceLabels.skillCenter"),unknownSource:n("blocks.createAgents.sourceLabels.unknown"),unnamedResource:n("blocks.createAgents.unnamedResource"),unnamedAgent:n("blocks.createAgents.unnamedAgent")}),[n]),a=se.useMemo(()=>NKe(t,e,i),[t,i,e]),s=r==="failed"?JQ(e):"";return W.jsxs("section",{className:"create-agent-tool-card is-agent-results","aria-label":n("blocks.createAgents.resultAria"),children:[s?W.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[W.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.creationFailed")}),W.jsx("span",{children:s})]}):null,a.agents.length>0?W.jsx("div",{className:"create-agent-card__agent-grid",children:a.agents.map(o=>{const l=r==="failed"?"failed":o.status,u=o.error||l==="failed"&&s,h=o.builtinTools.length+o.pythonTools.length;return W.jsxs(cCr,{className:`create-agent-card__agent-card${u?" is-error":""}`,children:[W.jsx(uCr,{leading:W.jsx(lCr,{seed:o.name}),title:o.name,titleText:o.name,status:W.jsx(ex,{color:"secondary",size:"sm",variant:"soft",children:n(`blocks.createAgents.agentTypes.${o.rootType}`,{defaultValue:o.rootType})})}),o.description?W.jsx(hCr,{children:o.description}):null,u?W.jsx("div",{className:"create-agent-card__agent-result is-error",role:"alert",children:u}):null,W.jsxs("div",{className:"create-agent-card__agent-resources","aria-label":n("blocks.createAgents.agentResources",{name:o.name}),children:[W.jsx(cG,{label:n("blocks.createAgents.skill"),count:o.skills.length,icon:W.jsx(BSr,{"aria-hidden":"true"}),children:W.jsx(Jue,{label:n("blocks.createAgents.skill"),resources:o.skills})}),W.jsx(cG,{label:n("blocks.createAgents.knowledgeBase"),count:o.knowledgeBases.length,icon:W.jsx(dCr,{"aria-hidden":"true"}),children:W.jsx(Jue,{label:n("blocks.createAgents.knowledgeBase"),resources:o.knowledgeBases})}),W.jsxs(cG,{label:n("blocks.createAgents.toolsLabel"),count:h,icon:W.jsx(NSr,{"aria-hidden":"true"}),children:[W.jsx(Jue,{label:n("blocks.createAgents.builtinTool"),resources:o.builtinTools}),W.jsx(gCr,{tools:o.pythonTools})]}),W.jsx(cG,{label:n("blocks.createAgents.subAgents"),count:o.subAgentCount,icon:W.jsx($Sr,{"aria-hidden":"true"}),children:W.jsx(mCr,{agents:o.subAgents})})]})]},o.name)})}):r==="running"?W.jsx(CZe,{label:n("blocks.createAgents.creating")}):W.jsxs("div",{className:"create-agent-card__message",children:[W.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.noAgents")}),W.jsx("span",{children:n("blocks.createAgents.noAgentResult")})]})]})}const bCr={web_search:{name:"web_search",runningLabel:"Searching the web",doneLabel:"Web search complete",tone:"search",icon:DKe},link_reader:{name:"link_reader",runningLabel:"Reading webpage",doneLabel:"Webpage read complete",tone:"search",icon:DKe},run_code:{name:"run_code",runningLabel:"Running code in the AgentKit sandbox",doneLabel:"Code execution completed in the AgentKit sandbox",tone:"sandbox",icon:hSr},list_envs:{name:"list_envs",runningLabel:"Checking available environments",doneLabel:"Available environments loaded",tone:"resources",icon:fSr},get_env_manifest:{name:"get_env_manifest",runningLabel:"Loading the environment manifest",doneLabel:"Environment manifest loaded",tone:"knowledge",icon:pSr},execute_in_sandbox:{name:"execute_in_sandbox",runningLabel:"Running a command in the environment",doneLabel:"Command completed in the environment",tone:"sandbox",icon:MKe},delegate_to_codex_sandbox:{name:"delegate_to_codex_sandbox",runningLabel:"Codex Sandbox is running",doneLabel:"Codex Sandbox completed",failedLabel:"Codex Sandbox failed",tone:"sandbox",icon:MKe},image_generate:{name:"image_generate",runningLabel:"Generating image",doneLabel:"Image generated",tone:"image",icon:aSr},video_generate:{name:"video_generate",runningLabel:"Generating video",doneLabel:"Video generated",tone:"video",icon:sSr},ppt_generate:{name:"ppt_generate",runningLabel:"Generating presentation",doneLabel:"Presentation generated",tone:"presentation",icon:oSr},load_memory:{name:"load_memory",runningLabel:"Searching long-term memory",doneLabel:"Memory search complete",tone:"memory",icon:lSr},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"Searching the knowledge base",doneLabel:"Knowledge base search complete",tone:"knowledge",icon:cSr},load_skill:{name:"load_skill",runningLabel:"Loading skill",doneLabel:"Skill loaded",tone:"skill",icon:uSr},collect_resources:{name:"collect_resources",runningLabel:"Collecting available resources",doneLabel:"Resource collection complete",failedLabel:"Resource collection failed",tone:"resources",icon:dSr,detailRenderer:vCr},create_agents:{name:"create_agents",runningLabel:"Creating and running agents",doneLabel:"Agent creation complete",failedLabel:"Agent creation failed",tone:"agent",icon:LKe,detailRenderer:yCr},branch_compare:{name:"branch_compare",runningLabel:"",doneLabel:"",failedLabel:"",tone:"search",icon:LKe,detailRenderer:zSr,hideHeader:!0}};function xCr(t){return bCr[t]}function OZe(t){return W.jsx("svg",{viewBox:"0 0 111 117",fill:"none","aria-hidden":"true",...t,children:W.jsx("path",{d:"M0 5.6016C7.82288e-05 0.621244 6.02226 -1.87314 9.54395 1.64847L40.1289 32.2334L68.5732 3.7891C69.5834 2.77903 70.9533 2.21099 72.3818 2.21097H82.7031C82.7917 2.20658 82.8806 2.20414 82.9697 2.20414H104.775C109.574 2.20427 111.977 8.00691 108.584 11.4004L64.916 55.0664C64.3075 55.8528 63.9436 56.7647 63.8242 57.6993C63.7142 56.4884 63.1964 55.3069 62.2695 54.3799L45.4082 37.5186H45.4072L40.124 32.2354L17.832 54.5284C16.7671 55.5933 16.2416 56.993 16.2549 58.3887C16.2417 59.7843 16.7672 61.1842 17.832 62.2491L39.9287 84.3467L9.54395 114.733C6.0223 118.255 0.000223474 115.761 0 110.78V5.6016ZM63.8018 58.8702C63.8962 59.9086 64.2936 60.9229 64.9961 61.7735L108.591 105.368C111.984 108.762 109.58 114.564 104.781 114.564H94.4336C94.3543 114.568 94.274 114.569 94.1934 114.569H72.3877C70.9592 114.569 69.5892 114.002 68.5791 112.992L39.9336 84.3467L58.4531 65.8282L58.4453 65.8203L62.2695 61.9981C63.1476 61.12 63.6567 60.0136 63.8018 58.8702Z",fill:"currentColor"})})}function wCr(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.jsx("path",{d:"M6 3h8l4 4v14H6Z"}),W.jsx("path",{d:"M14 3v5h5"}),W.jsx("path",{d:"m10 12-2 2 2 2M14 12l2 2-2 2"})]})}function ACr(t){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[W.jsx("path",{d:"M12 3 19 6v5c0 4.6-2.8 7.8-7 10-4.2-2.2-7-5.4-7-10V6l7-3Z"}),W.jsx("path",{d:"m9 12 2 2 4-4"})]})}qg.hasResourceBundle("en-US","workspaceTools")||qg.addResourceBundle("en-US","workspaceTools",y$e,!0,!0),qg.hasResourceBundle("zh-CN","workspaceTools")||qg.addResourceBundle("zh-CN","workspaceTools",RUe,!0,!0);function SCr(t,e){const r=new Map(t.map(s=>[s.path,s.content])),n=new Map(e.map(s=>[s.path,s.content])),i=new Set([...r.keys(),...n.keys()]),a=[];for(const s of[...i].sort((o,l)=>o.localeCompare(l))){const o=r.get(s),l=n.get(s);o!==l&&a.push({path:s,status:o===void 0?"added":l===void 0?"deleted":"modified",before:o??"",after:l??""})}return a}function xA(t){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...t}}function TCr(t){return W.jsx("svg",{...xA(t),children:W.jsx("path",{d:"m9 7-5 5 5 5M15 7l5 5-5 5M13.5 4l-3 16"})})}function ehe(t){return W.jsx("svg",{...xA(t),children:W.jsx("path",{d:"M6.5 3.75h7l4 4V20.25h-11zM13.5 3.75v4h4M9 12h6M9 15.5h4.5"})})}function CCr(t){return W.jsx("svg",{...xA(t),children:W.jsx("path",{d:"M3.75 7.25h6l1.75 2h8.75v9.25H3.75zM3.75 7.25V5.5h5l1.5 1.75"})})}function OCr(t){return W.jsx("svg",{...xA(t),children:W.jsx("path",{d:"m9 5 7 7-7 7"})})}function kCr(t){return W.jsx("svg",{...xA(t),children:W.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function ECr(t){return W.jsxs("svg",{...xA(t),children:[W.jsx("circle",{cx:"12",cy:"12",r:"3.25"}),W.jsx("path",{d:"M12 2.75v2M12 19.25v2M2.75 12h2M19.25 12h2M5.45 5.45l1.4 1.4M17.15 17.15l1.4 1.4M18.55 5.45l-1.4 1.4M6.85 17.15l-1.4 1.4"})]})}function _Cr(t){return W.jsx("svg",{...xA(t),children:W.jsx("path",{d:"M19.25 15.25A8 8 0 0 1 8.75 4.75a8 8 0 1 0 10.5 10.5Z"})})}const RCr=se.lazy(()=>Promise.resolve().then(()=>l1n)),DCr=se.lazy(()=>Promise.resolve().then(()=>z1n)),kZe="veadk-code-workspace-theme";function LCr(t){const e={name:"",children:new Map};for(const r of t){const n=r.path.split("/").filter(Boolean);let i=e;n.forEach((a,s)=>{let o=i.children.get(a);o||(o={name:a,children:new Map},i.children.set(a,o)),s===n.length-1&&(o.path=r.path),i=o})}return e}function MCr(t,e=!1){return[...t.children.values()].sort((r,n)=>{const i=r.children.size>0&&r.path===void 0,a=n.children.size>0&&n.path===void 0;return i!==a?e?i?1:-1:i?-1:1:r.name.localeCompare(n.name)})}function ICr(){if(typeof window>"u")return"light";try{return window.localStorage.getItem(kZe)==="dark"?"dark":"light"}catch{return"light"}}function PCr(t){return t===""?0:t.split(` +`).length}function EZe({project:t,open:e,onClose:r,onChange:n,readOnly:i=!1,comparison:a}){var L;const{t:s}=Ea("workspaceTools"),o=se.useId(),l=se.useRef(null),u=se.useRef(null),h=se.useRef(r),[d,f]=se.useState(ICr),p=se.useMemo(()=>a?SCr(a.baseProject.files,t.files):[],[a,t.files]),g=se.useMemo(()=>a?p.map(R=>({path:R.path,content:R.status==="deleted"?R.before:R.after})):t.files,[p,a,t.files]),m=se.useMemo(()=>new Map(p.map(R=>[R.path,R.status])),[p]),[v,y]=se.useState(((L=g[0])==null?void 0:L.path)??null),[b,x]=se.useState(new Set),w=se.useMemo(()=>LCr(g),[g]),A=g.find(R=>R.path===v)??null,S=p.find(R=>R.path===v)??null;if(h.current=r,se.useEffect(()=>{try{window.localStorage.setItem(kZe,d)}catch{}},[d]),se.useEffect(()=>{var P;if(!e)return;const R=document.body.style.overflow,D=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(P=u.current)==null||P.focus();const M=N=>{if(N.key==="Escape"){N.preventDefault(),h.current();return}if(N.key!=="Tab"||!l.current)return;const F=[...l.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')].filter(z=>z.offsetParent!==null);if(F.length===0)return;const B=F[0],V=F[F.length-1];N.shiftKey&&document.activeElement===B?(N.preventDefault(),V.focus()):!N.shiftKey&&document.activeElement===V&&(N.preventDefault(),B.focus())};return window.addEventListener("keydown",M),()=>{document.body.style.overflow=R,window.removeEventListener("keydown",M),D!=null&&D.isConnected&&D.focus()}},[e]),se.useEffect(()=>{A||g.length===0||y(g[0].path)},[g,A]),!e)return null;function T(R){x(D=>{const M=new Set(D);return M.has(R)?M.delete(R):M.add(R),M})}function O(R){return R?W.jsx("span",{className:`code-browser-change is-${R}`,children:s(`codeBrowser.change.${R}`)}):null}function k(R,D,M){return MCr(R,D===0).map(P=>{const N=M?`${M}/${P.name}`:P.name;if(!(P.children.size>0&&P.path===void 0)&&P.path){const V=m.get(P.path);return W.jsxs("button",{type:"button",className:`code-browser-file${v===P.path?" is-active":""}`,style:{paddingLeft:`${12+D*16}px`},onClick:()=>y(P.path??null),title:P.path,"aria-pressed":v===P.path,children:[W.jsx(ehe,{}),W.jsx("span",{children:P.name}),O(V)]},N)}const B=b.has(N);return W.jsxs("div",{children:[W.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+D*16}px`},onClick:()=>T(N),"aria-expanded":!B,children:[W.jsx(OCr,{className:B?"":"is-open"}),W.jsx(CCr,{}),W.jsx("span",{children:P.name})]}),!B&&k(P,D+1,N)]},N)})}function E(R){!A||a||n({...t,files:t.files.map(D=>D.path===A.path?{...D,content:R}:D)})}const _=d==="light"?"dark":"light",I=s(a?"codeBrowser.noChanges":"codeBrowser.chooseFile");return ak.createPortal(W.jsx("div",{className:"code-browser-backdrop",onMouseDown:R=>{R.target===R.currentTarget&&r()},children:W.jsxs("section",{ref:l,className:`code-browser-dialog is-${d}`,role:"dialog","aria-modal":"true","aria-labelledby":o,children:[W.jsxs("header",{className:"code-browser-head",children:[W.jsxs("div",{className:"code-browser-title-wrap",children:[W.jsx("span",{className:"code-browser-title-icon",children:W.jsx(TCr,{})}),W.jsxs("div",{children:[W.jsx("h2",{id:o,children:s(a?"codeBrowser.compareTitle":"codeBrowser.workspaceTitle")}),W.jsx("p",{title:t.name,children:t.name||s("codeBrowser.projectFallback")})]})]}),W.jsxs("div",{className:"code-browser-head-actions",children:[W.jsx("button",{type:"button",className:"code-browser-icon-button",onClick:()=>f(_),"aria-label":s("codeBrowser.switchTheme"),title:s("codeBrowser.switchThemeTitle",{theme:s(`codeBrowser.themes.${_}`)}),children:d==="light"?W.jsx(_Cr,{}):W.jsx(ECr,{})}),W.jsx("button",{ref:u,type:"button",className:"code-browser-icon-button",onClick:r,"aria-label":s("codeBrowser.closeWorkspace"),title:s("codeBrowser.close"),children:W.jsx(kCr,{})})]})]}),W.jsxs("div",{className:"code-browser-workspace",children:[W.jsxs("aside",{className:"code-browser-sidebar","aria-label":s(a?"codeBrowser.changedFiles":"codeBrowser.projectFiles"),children:[W.jsxs("div",{className:"code-browser-sidebar-head",children:[W.jsx("span",{children:s(a?"codeBrowser.changes":"codeBrowser.files")}),W.jsx("span",{children:g.length})]}),W.jsx("div",{className:"code-browser-tree",children:g.length>0?k(w,0,""):W.jsx("div",{className:"code-browser-empty",children:I})})]}),W.jsxs("main",{className:"code-browser-main",children:[W.jsx("div",{className:"code-browser-tabs",role:"tablist","aria-label":s("codeBrowser.openFiles"),children:A?W.jsxs("div",{className:"code-browser-tab",role:"tab","aria-selected":"true",children:[W.jsx(ehe,{}),W.jsx("span",{children:A.path.split("/").pop()}),O(S==null?void 0:S.status)]}):null}),W.jsxs("div",{className:"code-browser-path",children:[W.jsx(ehe,{}),W.jsx("span",{children:(A==null?void 0:A.path)??s("codeBrowser.noFileSelected")})]}),a?W.jsxs("div",{className:"code-browser-diff-labels","aria-label":s("codeBrowser.comparisonDirection"),children:[W.jsx("span",{children:a.baseLabel??s("codeBrowser.before")}),W.jsx("span",{children:a.targetLabel??s("codeBrowser.after")})]}):null,W.jsx("div",{className:"code-browser-editor",children:A?W.jsx(se.Suspense,{fallback:W.jsx("div",{className:"code-browser-empty",children:s("codeBrowser.loadingEditor")}),children:S?W.jsx(DCr,{before:S.before,after:S.after,path:S.path,theme:d}):W.jsx(RCr,{value:A.content,path:A.path,onChange:E,readOnly:i,theme:d})}):W.jsx("div",{className:"code-browser-empty",children:I})}),W.jsxs("footer",{className:"code-browser-statusbar",children:[W.jsx("span",{children:a?s("codeBrowser.changedFileCount",{count:p.length}):s("codeBrowser.fileCount",{count:t.files.length})}),W.jsx("span",{children:A?s("codeBrowser.lineCount",{count:PCr(A.content)}):"UTF-8"})]})]})]})]})}),document.body)}const _Ze="send_a2ui_json_to_client",NCr=28,BCr=3e3;function $Cr(t,e,r){let n=e;for(let i=0;i65535?2:1}return n}function FCr(t){return t<=4?1:Math.min(18,Math.max(2,Math.ceil(t/6)))}function RZe(t,e,r,n){const[i,a]=se.useState(()=>e?"":t),s=se.useRef(i),o=se.useRef(t),l=se.useRef(null),u=se.useRef(0),h=se.useRef(r);return o.current=t,h.current=r,se.useEffect(()=>{const d=s.current,f=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!e||f||!t.startsWith(d)){l.current!==null&&window.cancelAnimationFrame(l.current),l.current=null,d!==t&&(s.current=t,a(t));return}if(d===t||l.current!==null)return;const p=g=>{const m=o.current,v=s.current;if(!m.startsWith(v)){s.current=m,a(m),l.current=null;return}if(g-u.current{var d;(d=h.current)==null||d.call(h)},[i]),se.useEffect(()=>{i===t&&(n==null||n())},[i,n,t]),se.useEffect(()=>()=>{l.current!==null&&(window.cancelAnimationFrame(l.current),l.current=null)},[]),i}function zCr(){return W.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:W.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 UCr(){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[W.jsx("path",{d:"m4.5 7 1.8 1.8L9.5 5.5"}),W.jsx("path",{d:"M12 7h7.5"}),W.jsx("path",{d:"m4.5 13 1.8 1.8 3.2-3.3"}),W.jsx("path",{d:"M12 13h7.5"}),W.jsx("path",{d:"M5 19h4"}),W.jsx("path",{d:"M12 19h7.5"})]})}function VCr(){return W.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[W.jsx("path",{d:"M5 5v7.25A3.75 3.75 0 0 0 8.75 16H19"}),W.jsx("path",{d:"m15.5 12.5 3.5 3.5-3.5 3.5"})]})}function QCr({activity:t}){const{t:e}=Ea("conversation"),r=[["Agent Session",t.agentSessionId],["Sandbox Session",t.sandboxSessionId],["Codex Thread",t.threadId]].filter(n=>!!n[1]);return r.length?W.jsx("dl",{className:"codex-sandbox-run__identity","aria-label":e("blocks.sandboxIdentity"),children:r.map(([n,i])=>W.jsxs("div",{children:[W.jsx("dt",{children:n}),W.jsx("dd",{title:i,children:i})]},n))}):null}function GCr(t,e,r){if(t!=="load_skill"||e==null||typeof e!="object"||Array.isArray(e))return;const n=e.skill_name;if(!(typeof n!="string"||!n.trim()))return r("blocks.useSkill",{name:n.trim()})}function DZe({text:t,done:e,answerStarted:r=!1,streaming:n=!1,onStreamFrame:i}){const{t:a}=Ea("conversation"),[s,o]=se.useState(!(e||r)),l=se.useRef(!1);se.useEffect(()=>{l.current||o(!(e||r))},[r,e]);const u=()=>{l.current=!0,o(g=>!g)},h=t.replace(/\r\n?/g,` `).trimStart().split(/\n{2,}/).map(g=>g.replace(/[^\S\n]*\n[^\S\n]*/g,(m,v,y)=>{const b=y[v-1]??"",x=y[v+m.length]??"";return!b||!x||new RegExp("\\p{Script=Han}","u").test(b)&&new RegExp("\\p{Script=Han}","u").test(x)||/[(\[{“‘/]/u.test(b)||/[),.\]},。!?;:、”’]/u.test(x)?"":" "})).join(` -`),d=RZe(h,!e||n,i),{ref:f,onScroll:p}=Xlr(d);return W.jsxs("div",{className:"block-thinking",children:[W.jsxs("button",{className:"think-head",onClick:u,type:"button",children:[W.jsx("span",{className:"think-icon","aria-hidden":"true",children:W.jsx(OZe,{className:`thinking-logo ${e?"":"is-active"}`})}),e?W.jsx("span",{className:"think-label think-label--done",children:a("blocks.thinkingDone")}):W.jsx(Yb,{className:"think-label",duration:2.4,spread:18,children:a("blocks.thinking")}),W.jsx(air,{className:`chev ${s?"open":""}`})]}),W.jsx("div",{className:`think-collapse ${s&&d?"open":""}`,children:W.jsx("div",{className:"think-collapse-inner",children:W.jsx("div",{className:"think-body scroll",ref:f,onScroll:p,children:d})})})]})}function HCr({text:t}){return W.jsx("div",{className:"block-progress",role:"status","aria-live":"polite","aria-atomic":"true",children:W.jsxs("div",{className:"think-head progress-head",children:[W.jsx("span",{className:"think-icon","aria-hidden":"true",children:W.jsx(OZe,{className:"thinking-logo is-active"})}),W.jsx(Yb,{className:"think-label",duration:2.4,spread:18,children:t})]})})}function WCr({value:t,onResolve:e,onResolveComparison:r,onDownload:n,onDeploy:i}){const{t:a,i18n:s}=Ea("conversation"),[o,l]=se.useState(t.files?t:null),[u,h]=se.useState(!1),[d,f]=se.useState(!1),[p,g]=se.useState(null),[m,v]=se.useState(null),[y,b]=se.useState(""),[x,w]=se.useState(null),A=new Date(t.validatedAt),T=t.validatedAt?Number.isNaN(A.getTime())?t.validatedAt:A.toLocaleString(s.resolvedLanguage??s.language,{hour12:!1}):a("blocks.justNow");se.useEffect(()=>{if(!x)return;const I=window.setTimeout(()=>w(null),BCr);return()=>window.clearTimeout(I)},[x]);async function S(){if(o)return o;if(!e)throw new Error(a("blocks.sourceUnavailable"));const I=await e(t);return l(I),I}async function O(){v("source"),b(""),w(null);try{await S(),h(!0)}catch(I){b(I instanceof Error?I.message:String(I))}finally{v(null)}}async function k(){if(n){v("download"),b(""),w(null);try{await n(t),w({message:a("blocks.downloadStarted")})}catch(I){b(I instanceof Error?I.message:String(I))}finally{v(null)}}}async function E(){if(r){v("compare"),b(""),w(null);try{const I=p??await r(t);g(I),f(!0)}catch(I){b(I instanceof Error?I.message:String(I))}finally{v(null)}}}async function _(){v("deploy"),b(""),w(null);try{i==null||i(await S())}catch(I){b(I instanceof Error?I.message:String(I))}finally{v(null)}}return W.jsxs(W.Fragment,{children:[W.jsxs("section",{className:`delivery-card${t.verified?" is-verified":" is-unverified"}`,"aria-label":t.verified?a("blocks.verifiedDelivery"):a("blocks.generatedSource"),children:[W.jsxs("header",{className:"delivery-card-header",children:[W.jsx("span",{className:"delivery-card-icon",children:t.verified?W.jsx(ACr,{}):W.jsx(wCr,{})}),W.jsxs("div",{children:[W.jsx("strong",{children:t.verified?a("blocks.verifiedDelivery"):a("blocks.generatedSource")}),W.jsx("span",{children:t.agentName})]})]}),W.jsxs("dl",{className:"delivery-card-grid",children:[W.jsxs("div",{children:[W.jsx("dt",{children:a("blocks.entryPoint")}),W.jsx("dd",{children:W.jsx("code",{children:t.entryPoint})})]}),W.jsxs("div",{children:[W.jsx("dt",{children:a("blocks.fileCount")}),W.jsx("dd",{children:t.fileCount})]}),W.jsxs("div",{children:[W.jsx("dt",{children:a("blocks.size")}),W.jsxs("dd",{children:[(t.artifactSize/1024).toFixed(1)," KiB"]})]}),W.jsxs("div",{children:[W.jsx("dt",{children:t.verified?a("blocks.validationTime"):a("blocks.generationTime")}),W.jsx("dd",{children:T})]})]}),W.jsxs("p",{className:"delivery-card-gates",children:[t.verified?a("blocks.checksPassed",{count:t.gateSummary.length}):a("blocks.sourceReady")," ","· ",W.jsx("code",{children:t.artifactSha256.slice(0,12)})]}),t.verified?null:W.jsx("p",{className:"delivery-card-guidance",children:a("blocks.sourceGuidance")}),W.jsxs("div",{className:"delivery-card-actions",children:[W.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void O(),disabled:!e||m!==null,children:[m==="source"?W.jsx(Rv,{className:"spin","aria-hidden":"true"}):null,a("blocks.viewSource")]}),t.projectId&&t.versionId&&t.parentVersionId?W.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void E(),disabled:!r||m!==null,children:[m==="compare"?W.jsx(Rv,{className:"spin","aria-hidden":"true"}):null,a(m==="compare"?"blocks.preparing":"blocks.viewChanges")]}):null,W.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void k(),disabled:!n||m!==null,"aria-busy":m==="download",children:[m==="download"?W.jsx(Rv,{className:"spin","aria-hidden":"true"}):null,a(m==="download"?"blocks.preparing":"blocks.downloadSource")]}),W.jsxs("button",{type:"button",onClick:()=>void _(),disabled:!t.deployable||!i||!e||m!==null,title:t.deployable?void 0:a("blocks.sourceNotReady"),children:[m==="deploy"?W.jsx(Rv,{className:"spin","aria-hidden":"true"}):null,a("blocks.manualDeploy")]})]}),y?W.jsx("p",{className:"delivery-card-error",role:"alert",children:y}):null,x?W.jsx("p",{className:"delivery-card-status",role:"status","aria-live":"polite",children:x.message}):null]}),W.jsx(EZe,{project:{name:t.agentName,files:(o==null?void 0:o.files)??[]},open:u,onClose:()=>h(!1),onChange:()=>{},readOnly:!0}),W.jsx(EZe,{project:{name:(p==null?void 0:p.target.agentName)??t.agentName,files:(p==null?void 0:p.target.files)??[]},comparison:p?{baseProject:{name:p.base.agentName,files:p.base.files??[]},baseLabel:a("blocks.beforeOptimization"),targetLabel:a("blocks.afterOptimization")}:void 0,open:d,onClose:()=>f(!1),onChange:()=>{},readOnly:!0})]})}function YCr(){return W.jsx(DZe,{text:"",done:!1})}const qCr=se.memo(function({text:e,streaming:r,onStreamFrame:n,onStreamComplete:i}){const a=RZe(e,r,n,i);return a?W.jsx("div",{className:"bubble",children:W.jsx(ZQ,{text:a,streaming:r})}):null});function jCr({title:t,summary:e,items:r,done:n}){const{t:i}=Ea("conversation"),[a,s]=se.useState(!n),o=se.useRef(!1);se.useEffect(()=>{o.current||s(!n)},[n]);const l=()=>{o.current=!0,s(u=>!u)};return W.jsxs("div",{className:"block-plan",children:[W.jsxs("button",{className:"plan-head",type:"button",onClick:l,"aria-expanded":r.length>0?a:void 0,disabled:r.length===0,children:[W.jsx("span",{className:"plan-icon","aria-hidden":"true",children:W.jsx(UCr,{})}),n?W.jsx("span",{className:"plan-title",children:t}):W.jsx(Yb,{className:"plan-title",duration:2.2,spread:15,children:t}),e?W.jsx("span",{className:"plan-summary",children:e}):null,r.length>0?W.jsx(Pue,{className:`plan-chevron${a?" is-open":""}`}):null]}),W.jsx("div",{className:`think-collapse ${a&&r.length>0?"open":""}`,children:W.jsx("div",{className:"think-collapse-inner",children:r.length>0?W.jsx("ol",{className:"plan-items",children:r.map((u,h)=>W.jsxs("li",{"data-status":u.status,children:[W.jsx("span",{className:"plan-item-marker","aria-hidden":"true"}),W.jsx("span",{className:"plan-item-text",children:u.text}),W.jsx("small",{children:i(`blocks.planStatuses.${u.status}`)})]},`${h}:${u.text}`))}):null})})]})}function XCr(t){if(!t||typeof t!="object")return[];const e=t,r=e.result;let n=[];if(Array.isArray(e.studio_artifacts))n=e.studio_artifacts;else if(r&&typeof r=="object"){const i=r.studio_artifacts;Array.isArray(i)&&(n=i)}return n.flatMap(i=>{if(!i||typeof i!="object")return[];const a=i;return typeof a.name=="string"&&typeof a.contentUrl=="string"?[{name:a.name,contentUrl:a.contentUrl}]:[]})}function KCr({name:t,args:e,response:r,done:n,status:i,defaultOpen:a=!1,retrying:s=!1,codexActivity:o,onBranchSelect:l,onAction:u}){const{t:h}=Ea("conversation"),f=t==="create_agents"&&n&&wTr(e,r)?"failed":i??(n?"completed":"running"),p=t==="create_agents"&&f==="failed"&&s,g=xCr(t),m=g==null?void 0:g.detailRenderer,v=(g==null?void 0:g.hideHeader)===!0,y=v||a||!!m||!!o,[b,x]=se.useState(y),w=se.useRef(!1);se.useEffect(()=>{!w.current&&y&&x(!0)},[y]);const A=()=>{w.current=!0,x(E=>!E)},T=t===_Ze?h("blocks.renderUi"):t,S=XCr(r),O=r==null?null:typeof r=="string"?r:JSON.stringify(r,null,2),k=O&&O.length>2e3?`${O.slice(0,2e3)} -${h("blocks.truncated")}`:O;return W.jsxs(eA.div,{className:`block-tool${g?" block-tool--builtin":""}`,"data-status":f,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[g&&!v?W.jsx(gTr,{definition:g,label:p?h("blocks.agentAdjusting"):f==="failed"?h(`blocks.tools.${g.name}.failed`,{defaultValue:g.failedLabel??g.doneLabel}):GCr(t,e,h),done:n,open:b,onToggle:A}):g?null:W.jsxs("button",{className:"tool-head tool-head--generic",onClick:A,type:"button","aria-expanded":b,children:[W.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:W.jsx(zCr,{})}),n?W.jsx("span",{className:"tool-name",children:T}):W.jsx(Yb,{className:"tool-name",duration:2.2,spread:15,children:T}),W.jsx(Pue,{className:`tool-chevron${b?" is-open":""}`})]}),W.jsx("div",{className:`${v?"":"think-collapse "}${b?"open":""}`,children:W.jsxs("div",{className:"think-collapse-inner",children:[o?W.jsxs("section",{className:"codex-sandbox-run","aria-label":h("blocks.sandboxDetails"),children:[W.jsxs("div",{className:"codex-sandbox-run__label",children:[W.jsxs("span",{className:"codex-sandbox-run__badge",children:[W.jsx(VCr,{}),W.jsx("span",{children:"Codex Sandbox"})]}),W.jsx("span",{className:"codex-sandbox-run__title",children:o.title})]}),W.jsx(QCr,{activity:o}),W.jsx("div",{className:"codex-sandbox-run__stream",children:o.items.length>0?W.jsx(LZe,{blocks:o.items.map(E=>E.block),streaming:!n,onAction:u}):W.jsx(Yb,{className:"codex-sandbox-run__empty",children:h("blocks.waitingCodex")})})]}):null,m?W.jsx(m,{args:e,response:r,status:f,onBranchSelect:l}):o?null:W.jsxs("div",{className:"tool-detail",children:[e!=null&&W.jsxs("div",{className:"tool-section",children:[W.jsx("div",{className:"tool-section-label",children:h("blocks.arguments")}),W.jsx("pre",{className:"tool-args",children:JSON.stringify(e,null,2)})]}),k!=null&&W.jsxs("div",{className:"tool-section",children:[W.jsx("div",{className:"tool-section-label",children:h("blocks.result")}),W.jsx("pre",{className:"tool-args tool-result",children:k})]}),S.length>0&&W.jsxs("div",{className:"tool-section",children:[W.jsx("div",{className:"tool-section-label",children:h("blocks.artifacts")}),W.jsx("div",{className:"studio-tool-artifacts",children:S.map(E=>W.jsx("a",{href:E.contentUrl,download:E.name,children:h("blocks.downloadNamed",{name:E.name})},`${E.contentUrl}:${E.name}`))})]})]})]})})]})}function ZCr({block:t,onDownload:e,onPreview:r}){const{t:n}=Ea("conversation"),[i,a]=se.useState(""),[s,o]=se.useState(""),[l,u]=se.useState(null);se.useEffect(()=>()=>{l&&URL.revokeObjectURL(l.url)},[l]);const h=()=>u(null),d=async(g,m)=>{if(e){a(`download:${g}`),o("");try{await e(g,m)}catch(v){o(v instanceof Error?v.message:String(v))}finally{a("")}}},f=async(g,m,v)=>{if(r){a(`preview:${v}`),o("");try{const y=await r(g,m);u({name:v,url:y})}catch(y){o(y instanceof Error?y.message:String(y))}finally{a("")}}},p=t.files.filter(g=>!g.filename.endsWith(".preview.webp"));return W.jsxs("div",{className:"artifact-list",children:[p.map(g=>{const m=`${g.filename.replace(/\.pptx$/i,"")}.preview.webp`,v=t.files.find(y=>y.filename===m);return W.jsxs("div",{className:"artifact-card",children:[W.jsx("span",{className:"artifact-card__icon","aria-hidden":"true",children:W.jsx(SVe,{})}),W.jsxs("span",{className:"artifact-card__copy",children:[W.jsx("span",{className:"artifact-card__name",children:g.filename}),W.jsx("span",{className:"artifact-card__hint",children:n("blocks.powerpoint")})]}),W.jsxs("span",{className:"artifact-card__actions",children:[v&&W.jsxs("button",{className:"artifact-card__action",type:"button",disabled:!r||i!=="",onClick:()=>void f(v.filename,v.version,g.filename),children:[i===`preview:${g.filename}`?W.jsx(Rv,{className:"spin"}):W.jsx(sir,{}),n("blocks.preview")]}),W.jsxs("button",{className:"artifact-card__action artifact-card__action--primary",type:"button",disabled:!e||i!=="",onClick:()=>void d(g.filename,g.version),children:[i===`download:${g.filename}`?W.jsx(Rv,{className:"spin"}):W.jsx(loe,{}),n("blocks.download")]})]})]},`${g.filename}:${g.version}`)}),s&&W.jsx("div",{className:"artifact-card__error",children:s}),l&&W.jsxs("div",{className:"artifact-preview",role:"dialog","aria-modal":"true","aria-label":n("blocks.previewDialog",{name:l.name}),children:[W.jsx("button",{className:"artifact-preview__backdrop",type:"button","aria-label":n("blocks.closePreview"),onClick:h}),W.jsxs("div",{className:"artifact-preview__panel",children:[W.jsxs("div",{className:"artifact-preview__header",children:[W.jsx("span",{children:l.name}),W.jsx("button",{type:"button","aria-label":n("blocks.closePreview"),onClick:h,children:W.jsx(jk,{})})]}),W.jsx("div",{className:"artifact-preview__canvas",children:W.jsx("img",{src:l.url,alt:n("blocks.slidePreview",{name:l.name})})})]})]})]})}function JCr({block:t,onAuth:e}){const{t:r}=Ea("conversation"),[n,i]=se.useState(t.done?"done":"idle"),[a,s]=se.useState(""),o=t.label||r("blocks.mcpToolset"),l=(()=>{try{return t.authUri?new URL(t.authUri).host:""}catch{return""}})(),u=async()=>{if(e){s(""),i("authorizing");try{await e(t),i("done")}catch(d){s(d instanceof Error?d.message:String(d)),i("idle")}}};return t.done||n==="done"?W.jsxs(eA.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[W.jsx(CVe,{className:"auth-card-icon auth-card-icon--done"}),W.jsx("span",{children:r("blocks.authorized",{tool:o})})]}):W.jsxs(eA.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[W.jsxs("div",{className:"auth-card-head",children:[W.jsx(CVe,{className:"auth-card-icon"}),W.jsx("span",{className:"auth-card-title",children:r("blocks.authorizationRequired",{tool:o})})]}),W.jsxs("p",{className:"auth-card-desc",children:[W.jsx(iVe,{t:r,i18nKey:"blocks.oauthDescription",values:{tool:o},components:{code:W.jsx("code",{className:"auth-card-code"})}}),l&&W.jsxs(W.Fragment,{children:[" ",W.jsx(iVe,{t:r,i18nKey:"blocks.oauthProvider",values:{provider:l},components:{code:W.jsx("code",{className:"auth-card-code"})}})," "]}),r("blocks.oauthContinue")]}),W.jsx("button",{className:"auth-card-btn",onClick:u,disabled:n==="authorizing"||!t.authUri,children:n==="authorizing"?W.jsxs(W.Fragment,{children:[W.jsx(Rv,{className:"cw-i spin"})," ",r("blocks.waitingAuthorization")]}):W.jsx(W.Fragment,{children:r("blocks.authorize")})}),!t.authUri&&W.jsx("div",{className:"auth-card-err",children:r("blocks.missingAuthorizationUrl")}),a&&W.jsx("div",{className:"auth-card-err",children:a})]})}function LZe({blocks:t,appName:e="",streaming:r=!1,onStreamFrame:n,onStreamComplete:i,onAction:a,onAuth:s,onArtifactDownload:o,onArtifactPreview:l,onResolveDelivery:u,onResolveDeliveryComparison:h,onDownloadDelivery:d,onDeployDelivery:f,onBranchSelect:p}){const g=t.reduce((m,v,y)=>v.kind==="text"?y:m,-1);return W.jsx(W.Fragment,{children:t.map((m,v)=>{switch(m.kind){case"progress":return W.jsx(HCr,{text:m.text},"build-progress");case"thinking":{const y=t.slice(v+1).some(b=>b.kind==="text"&&!!b.text.trim());return W.jsx(DZe,{text:m.text,done:m.done,answerStarted:y,streaming:r,onStreamFrame:n},v)}case"text":{const y=m.text.replace(/^\s+/,"");return y?W.jsx(qCr,{text:y,streaming:r,onStreamFrame:n,onStreamComplete:v===g?i:void 0},v):null}case"plan":return W.jsx(jCr,{title:m.title,summary:m.summary,items:m.items,done:m.done},v);case"attachment":return W.jsx(nTr,{appName:e,items:m.files},v);case"artifact":return W.jsx(ZCr,{block:m,onDownload:o,onPreview:l},v);case"delivery":return W.jsx(WCr,{value:m.value,onResolve:u,onResolveComparison:h,onDownload:d,onDeploy:f},v);case"invocation":return W.jsx(jAr,{value:m.value},v);case"tool":{if(m.name===_Ze&&m.done)return null;const y=m.name==="create_agents"&&t.slice(v+1).some(b=>b.kind==="tool"&&b.name==="create_agents");return W.jsx(KCr,{name:m.name,args:m.args,response:m.response,done:m.done,status:m.status,defaultOpen:m.defaultOpen,retrying:m.name==="create_agents"&&(r||y),codexActivity:m.codexActivity,onBranchSelect:p,onAction:a},v)}case"agent-transfer":return null;case"auth":return W.jsx(JCr,{block:m,onAuth:s},v);case"a2ui":return Ylr(m.messages).filter(y=>y.components[y.rootId]).map(y=>W.jsx(eA.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:W.jsx(jlr,{surface:y,onAction:a})},`${v}-${y.surfaceId}`));default:return null}})})}function eOr(t){return t.isComposing||t.keyCode===229}function tOr(t){return W.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:W.jsx("path",{d:"m6.5 11.5 5.5-5.5 5.5 5.5M12 6v12"})})}function rOr({value:t,placeholder:e,busy:r=!1,disabled:n=!1,onChange:i,onSubmit:a}){const{t:s}=Ea("conversation"),o=se.useRef(null),l=!!t.trim()&&!r&&!n;return se.useLayoutEffect(()=>{const u=o.current;u&&(u.style.height="auto",u.style.height=`${Math.min(u.scrollHeight,144)}px`)},[t]),W.jsx("form",{className:"composer compact-composer",onSubmit:u=>{u.preventDefault(),l&&a()},children:W.jsxs("div",{className:"composer-box",children:[W.jsx("div",{className:"composer-input-stack",children:W.jsx("textarea",{ref:o,className:"comp-input scroll",rows:1,value:t,disabled:n,placeholder:e??s("composer.placeholder"),"aria-label":s("composer.inputAria"),onChange:u=>i(u.target.value),onKeyDown:u=>{eOr(u.nativeEvent)||u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),l&&a())}})}),W.jsx("div",{className:"composer-submit-actions",children:W.jsx("button",{type:"submit",className:"comp-send",disabled:!l,"aria-label":s(r?"composer.generating":"composer.send"),children:W.jsx(tOr,{className:"icon"})})})]})})}const nOr=5,lm=12,the=12;function rN(t,e,r){return Math.min(Math.max(t,e),Math.max(e,r))}function iOr(){return W.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",children:W.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function MZe({studioOrigin:t,className:e=""}){const[r,n]=se.useState(!1);return W.jsx("img",{className:e,src:r?Pnr:`${t}/web/site-logo`,alt:"",onError:()=>n(!0)})}function rhe(t,e){return{role:e,blocks:[{kind:"text",text:t}],meta:{ts:Date.now()/1e3}}}function IZe(t,e){return t.text().then(r=>{try{const n=JSON.parse(r).detail;if(typeof n=="string"&&n)return n}catch{}return r.trim()||e})}function aOr({studioOrigin:t,token:e}){const{t:r,i18n:n}=Ea("websiteIntegration"),[i,a]=se.useState(!1),[s,o]=se.useState(""),[l,u]=se.useState([rhe(r("widget.greeting"),"assistant")]),[h,d]=se.useState(""),[f,p]=se.useState(""),[g,m]=se.useState(!1),v=se.useRef(null),y=se.useRef(null),b=se.useRef(null),x=se.useRef(null),w=se.useRef(null),A=se.useRef(!1),T=se.useRef(null),S=se.useRef(`website-${crypto.randomUUID()}`),O=se.useRef(crypto.randomUUID()),k=se.useCallback(()=>{const D=y.current,M=b.current;if(!D||!M||!x.current)return;const P=D.getBoundingClientRect(),N=M.offsetWidth,F=M.offsetHeight,B=window.innerWidth,V=window.innerHeight,z=P.left+P.width/2,U=P.top-lm,Q=V-P.bottom-lm,G=U>=F+the||U>=Q?P.top-F-the:P.bottom+the,X=z>=B/2?P.right-N:P.left,Y=rN(X,lm,B-N-lm),le=rN(G,lm,V-F-lm);M.style.left=`${Y}px`,M.style.top=`${le}px`,M.style.right="auto",M.style.bottom="auto",M.style.transformOrigin=`${rN(z-Y,0,N)}px ${P.top>=le+F?F:0}px`},[]),E=se.useCallback((D,M)=>{const P=y.current;if(!P)return;const N={x:rN(D,lm,window.innerWidth-P.offsetWidth-lm),y:rN(M,lm,window.innerHeight-P.offsetHeight-lm)};x.current=N,P.style.left=`${N.x}px`,P.style.top=`${N.y}px`,P.style.right="auto",P.style.bottom="auto",k()},[k]),_=se.useCallback(D=>{var F;const M=w.current;if(!M||M.pointerId!==D.pointerId)return;D.preventDefault();const P=D.clientX-M.start.x,N=D.clientY-M.start.y;!M.moved&&Math.hypot(P,N){var P;const M=w.current;!M||M.pointerId!==D.pointerId||(M.moved&&(A.current=!0,T.current!=null&&window.clearTimeout(T.current),T.current=window.setTimeout(()=>{A.current=!1,T.current=null},0)),w.current=null,(P=y.current)==null||P.classList.remove("is-dragging"))},[]),L=se.useCallback(()=>{requestAnimationFrame(()=>{const D=v.current;D&&(D.scrollTop=D.scrollHeight)})},[]);se.useEffect(()=>{const D=new AbortController;return fetch(`${t}/embed/session`,{method:"POST",headers:{"Accept-Language":n.resolvedLanguage||n.language,"Content-Type":"application/json"},body:JSON.stringify({token:e}),signal:D.signal}).then(async M=>{if(!M.ok)throw new Error(await IZe(M,r("widget.requestFailed",{status:M.status})));return M.json()}).then(M=>{if(!M.sessionToken)throw new Error(r("widget.sessionFailed"));d(M.sessionToken)}).catch(M=>{D.signal.aborted||p(M instanceof Error?M.message:r("widget.unauthorized"))}),()=>D.abort()},[n.language,n.resolvedLanguage,t,r,e]),se.useEffect(L,[g,L,l]),se.useEffect(()=>{if(!i||!x.current)return;const D=requestAnimationFrame(k);return()=>cancelAnimationFrame(D)},[i,k]),se.useEffect(()=>{var M;const D=()=>{const P=x.current;P&&E(P.x,P.y)};return window.addEventListener("resize",D),(M=window.visualViewport)==null||M.addEventListener("resize",D),()=>{var P;window.removeEventListener("resize",D),(P=window.visualViewport)==null||P.removeEventListener("resize",D)}},[E]),se.useEffect(()=>(window.addEventListener("pointermove",_,{passive:!1}),window.addEventListener("pointerup",I),window.addEventListener("pointercancel",I),()=>{window.removeEventListener("pointermove",_),window.removeEventListener("pointerup",I),window.removeEventListener("pointercancel",I)}),[I,_]),se.useEffect(()=>()=>{T.current!=null&&window.clearTimeout(T.current)},[]);const R=async()=>{const D=s.trim();if(!(!D||!h||g)){o(""),m(!0),u(M=>[...M,rhe(D,"user"),{role:"assistant",blocks:[],meta:{ts:Date.now()/1e3}}]);try{const M=await fetch(`${t}/embed/run_sse`,{method:"POST",headers:{"Accept-Language":n.resolvedLanguage||n.language,Authorization:`Bearer ${h}`,"Content-Type":"application/json"},body:JSON.stringify({message:D,userId:S.current,sessionId:O.current})});if(!M.ok||!M.body)throw new Error(await IZe(M,r("widget.requestFailed",{status:M.status})));let P=Ynr(),N={ts:Date.now()/1e3};for await(const F of Nnr(M)){const B=F,V=B.error??B.errorMessage??B.error_message;if(typeof V=="string"&&V)throw new Error(V);P=eir(P,B),N={author:B.author&&B.author!=="user"?B.author:N==null?void 0:N.author,ts:B.timestamp??(N==null?void 0:N.ts),eventId:B.id??(N==null?void 0:N.eventId),invocationId:B.invocationId??B.invocation_id??(N==null?void 0:N.invocationId)};const z={role:"assistant",blocks:P.blocks,meta:N};u(U=>[...U.slice(0,-1),z])}}catch(M){const P=M instanceof Error?M.message:r("widget.conversationFailed");u(N=>[...N.slice(0,-1),rhe(P,"assistant")])}finally{m(!1)}}};return W.jsxs("div",{className:"website-widget",children:[W.jsx("button",{ref:y,type:"button",className:"website-widget__launcher","aria-label":r(i?"widget.close":"widget.open"),"aria-expanded":i,onClick:()=>{if(A.current){A.current=!1,T.current!=null&&(window.clearTimeout(T.current),T.current=null);return}a(D=>!D)},onPointerDown:D=>{if(D.button!==0)return;const M=D.currentTarget.getBoundingClientRect();w.current={pointerId:D.pointerId,start:{x:D.clientX,y:D.clientY},origin:{x:M.left,y:M.top},moved:!1}},onDragStart:D=>D.preventDefault(),children:W.jsx(MZe,{studioOrigin:t,className:"website-widget__launcher-logo"})}),W.jsxs("section",{ref:b,className:`website-widget__panel${i?" is-open":""}`,"aria-label":r("widget.panelLabel"),"aria-hidden":!i,children:[W.jsxs("header",{className:"website-widget__header",children:[W.jsxs("div",{className:"website-widget__identity",children:[W.jsx("span",{className:"website-widget__identity-logo",children:W.jsx(MZe,{studioOrigin:t})}),W.jsxs("span",{className:"website-widget__identity-copy",children:[W.jsx("strong",{children:r("widget.assistant")}),W.jsx("span",{children:r("widget.online")})]})]}),W.jsx("button",{type:"button",className:"website-widget__close","aria-label":r("widget.close"),onClick:()=>a(!1),children:W.jsx(iOr,{})})]}),W.jsxs("div",{ref:v,className:`website-widget__transcript transcript${g?" is-streaming":""}`,"aria-live":"polite",children:[l.map((D,M)=>{if(D.role==="user"){const F=D.blocks.filter(B=>B.kind==="text").map(B=>B.kind==="text"?B.text:"").join("");return W.jsx("div",{className:"turn turn--user",children:W.jsx("div",{className:"bubble",children:W.jsx(ZQ,{text:F,allowRawHtml:!1})})},`user-${M}`)}const P=D.blocks.length===0,N=g&&M===l.length-1;return W.jsx("div",{className:"turn turn--assistant",children:P&&N?W.jsx(YCr,{}):W.jsx(LZe,{blocks:D.blocks,streaming:N,onStreamFrame:L,onAction:()=>{}})},`assistant-${M}`)}),f?W.jsx("div",{className:"website-widget__error",role:"alert",children:f}):null]}),W.jsx("div",{className:"website-widget__composer-slot",children:W.jsx(rOr,{value:s,busy:g,disabled:!h||!!f,onChange:o,onSubmit:()=>void R()})})]})]})}function sOr(){return window.__VEADK_WEBSITE_INTEGRATION_SCRIPT__??(document.currentScript instanceof HTMLScriptElement?document.currentScript:null)}const nN=sOr(),PZe=((PZt=nN==null?void 0:nN.dataset.token)==null?void 0:PZt.trim())??"";if(nN&&PZe&&!document.querySelector("[data-veadk-website-integration]")){const t=new URL(nN.src,window.location.href).origin,e=document.createElement("div");e.dataset.veadkWebsiteIntegration="",document.body.appendChild(e);const r=e.attachShadow({mode:"open"}),n=document.createElement("style");n.textContent=[Mnr,_nr,Lnr,Rnr,Dnr,Inr].join(` +`),d=RZe(h,!e||n,i),{ref:f,onScroll:p}=Xlr(d);return W.jsxs("div",{className:"block-thinking",children:[W.jsxs("button",{className:"think-head",onClick:u,type:"button",children:[W.jsx("span",{className:"think-icon","aria-hidden":"true",children:W.jsx(OZe,{className:`thinking-logo ${e?"":"is-active"}`})}),e?W.jsx("span",{className:"think-label think-label--done",children:a("blocks.thinkingDone")}):W.jsx(Yb,{className:"think-label",duration:2.4,spread:18,children:a("blocks.thinking")}),W.jsx(air,{className:`chev ${s?"open":""}`})]}),W.jsx("div",{className:`think-collapse ${s&&d?"open":""}`,children:W.jsx("div",{className:"think-collapse-inner",children:W.jsx("div",{className:"think-body scroll",ref:f,onScroll:p,children:d})})})]})}function HCr({text:t}){return W.jsx("div",{className:"block-progress",role:"status","aria-live":"polite","aria-atomic":"true",children:W.jsxs("div",{className:"think-head progress-head",children:[W.jsx("span",{className:"think-icon","aria-hidden":"true",children:W.jsx(OZe,{className:"thinking-logo is-active"})}),W.jsx(Yb,{className:"think-label",duration:2.4,spread:18,children:t})]})})}function WCr({value:t,onResolve:e,onResolveComparison:r,onDownload:n,onDeploy:i}){const{t:a,i18n:s}=Ea("conversation"),[o,l]=se.useState(t.files?t:null),[u,h]=se.useState(!1),[d,f]=se.useState(!1),[p,g]=se.useState(null),[m,v]=se.useState(null),[y,b]=se.useState(""),[x,w]=se.useState(null),A=new Date(t.validatedAt),S=t.validatedAt?Number.isNaN(A.getTime())?t.validatedAt:A.toLocaleString(s.resolvedLanguage??s.language,{hour12:!1}):a("blocks.justNow");se.useEffect(()=>{if(!x)return;const I=window.setTimeout(()=>w(null),BCr);return()=>window.clearTimeout(I)},[x]);async function T(){if(o)return o;if(!e)throw new Error(a("blocks.sourceUnavailable"));const I=await e(t);return l(I),I}async function O(){v("source"),b(""),w(null);try{await T(),h(!0)}catch(I){b(I instanceof Error?I.message:String(I))}finally{v(null)}}async function k(){if(n){v("download"),b(""),w(null);try{await n(t),w({message:a("blocks.downloadStarted")})}catch(I){b(I instanceof Error?I.message:String(I))}finally{v(null)}}}async function E(){if(r){v("compare"),b(""),w(null);try{const I=p??await r(t);g(I),f(!0)}catch(I){b(I instanceof Error?I.message:String(I))}finally{v(null)}}}async function _(){v("deploy"),b(""),w(null);try{i==null||i(await T())}catch(I){b(I instanceof Error?I.message:String(I))}finally{v(null)}}return W.jsxs(W.Fragment,{children:[W.jsxs("section",{className:`delivery-card${t.verified?" is-verified":" is-unverified"}`,"aria-label":t.verified?a("blocks.verifiedDelivery"):a("blocks.generatedSource"),children:[W.jsxs("header",{className:"delivery-card-header",children:[W.jsx("span",{className:"delivery-card-icon",children:t.verified?W.jsx(ACr,{}):W.jsx(wCr,{})}),W.jsxs("div",{children:[W.jsx("strong",{children:t.verified?a("blocks.verifiedDelivery"):a("blocks.generatedSource")}),W.jsx("span",{children:t.agentName})]})]}),W.jsxs("dl",{className:"delivery-card-grid",children:[W.jsxs("div",{children:[W.jsx("dt",{children:a("blocks.entryPoint")}),W.jsx("dd",{children:W.jsx("code",{children:t.entryPoint})})]}),W.jsxs("div",{children:[W.jsx("dt",{children:a("blocks.fileCount")}),W.jsx("dd",{children:t.fileCount})]}),W.jsxs("div",{children:[W.jsx("dt",{children:a("blocks.size")}),W.jsxs("dd",{children:[(t.artifactSize/1024).toFixed(1)," KiB"]})]}),W.jsxs("div",{children:[W.jsx("dt",{children:t.verified?a("blocks.validationTime"):a("blocks.generationTime")}),W.jsx("dd",{children:S})]})]}),W.jsxs("p",{className:"delivery-card-gates",children:[t.verified?a("blocks.checksPassed",{count:t.gateSummary.length}):a("blocks.sourceReady")," ","· ",W.jsx("code",{children:t.artifactSha256.slice(0,12)})]}),t.verified?null:W.jsx("p",{className:"delivery-card-guidance",children:a("blocks.sourceGuidance")}),W.jsxs("div",{className:"delivery-card-actions",children:[W.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void O(),disabled:!e||m!==null,children:[m==="source"?W.jsx(Rv,{className:"spin","aria-hidden":"true"}):null,a("blocks.viewSource")]}),t.projectId&&t.versionId&&t.parentVersionId?W.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void E(),disabled:!r||m!==null,children:[m==="compare"?W.jsx(Rv,{className:"spin","aria-hidden":"true"}):null,a(m==="compare"?"blocks.preparing":"blocks.viewChanges")]}):null,W.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void k(),disabled:!n||m!==null,"aria-busy":m==="download",children:[m==="download"?W.jsx(Rv,{className:"spin","aria-hidden":"true"}):null,a(m==="download"?"blocks.preparing":"blocks.downloadSource")]}),W.jsxs("button",{type:"button",onClick:()=>void _(),disabled:!t.deployable||!i||!e||m!==null,title:t.deployable?void 0:a("blocks.sourceNotReady"),children:[m==="deploy"?W.jsx(Rv,{className:"spin","aria-hidden":"true"}):null,a("blocks.manualDeploy")]})]}),y?W.jsx("p",{className:"delivery-card-error",role:"alert",children:y}):null,x?W.jsx("p",{className:"delivery-card-status",role:"status","aria-live":"polite",children:x.message}):null]}),W.jsx(EZe,{project:{name:t.agentName,files:(o==null?void 0:o.files)??[]},open:u,onClose:()=>h(!1),onChange:()=>{},readOnly:!0}),W.jsx(EZe,{project:{name:(p==null?void 0:p.target.agentName)??t.agentName,files:(p==null?void 0:p.target.files)??[]},comparison:p?{baseProject:{name:p.base.agentName,files:p.base.files??[]},baseLabel:a("blocks.beforeOptimization"),targetLabel:a("blocks.afterOptimization")}:void 0,open:d,onClose:()=>f(!1),onChange:()=>{},readOnly:!0})]})}function YCr(){return W.jsx(DZe,{text:"",done:!1})}const qCr=se.memo(function({text:e,streaming:r,onStreamFrame:n,onStreamComplete:i}){const a=RZe(e,r,n,i);return a?W.jsx("div",{className:"bubble",children:W.jsx(ZQ,{text:a,streaming:r})}):null});function jCr({title:t,summary:e,items:r,done:n}){const{t:i}=Ea("conversation"),[a,s]=se.useState(!n),o=se.useRef(!1);se.useEffect(()=>{o.current||s(!n)},[n]);const l=()=>{o.current=!0,s(u=>!u)};return W.jsxs("div",{className:"block-plan",children:[W.jsxs("button",{className:"plan-head",type:"button",onClick:l,"aria-expanded":r.length>0?a:void 0,disabled:r.length===0,children:[W.jsx("span",{className:"plan-icon","aria-hidden":"true",children:W.jsx(UCr,{})}),n?W.jsx("span",{className:"plan-title",children:t}):W.jsx(Yb,{className:"plan-title",duration:2.2,spread:15,children:t}),e?W.jsx("span",{className:"plan-summary",children:e}):null,r.length>0?W.jsx(Pue,{className:`plan-chevron${a?" is-open":""}`}):null]}),W.jsx("div",{className:`think-collapse ${a&&r.length>0?"open":""}`,children:W.jsx("div",{className:"think-collapse-inner",children:r.length>0?W.jsx("ol",{className:"plan-items",children:r.map((u,h)=>W.jsxs("li",{"data-status":u.status,children:[W.jsx("span",{className:"plan-item-marker","aria-hidden":"true"}),W.jsx("span",{className:"plan-item-text",children:u.text}),W.jsx("small",{children:i(`blocks.planStatuses.${u.status}`)})]},`${h}:${u.text}`))}):null})})]})}function XCr(t){if(!t||typeof t!="object")return[];const e=t,r=e.result;let n=[];if(Array.isArray(e.studio_artifacts))n=e.studio_artifacts;else if(r&&typeof r=="object"){const i=r.studio_artifacts;Array.isArray(i)&&(n=i)}return n.flatMap(i=>{if(!i||typeof i!="object")return[];const a=i;return typeof a.name=="string"&&typeof a.contentUrl=="string"?[{name:a.name,contentUrl:a.contentUrl}]:[]})}function KCr({name:t,args:e,response:r,done:n,status:i,defaultOpen:a=!1,retrying:s=!1,codexActivity:o,onBranchSelect:l,onAction:u}){const{t:h}=Ea("conversation"),f=t==="create_agents"&&n&&wSr(e,r)?"failed":i??(n?"completed":"running"),p=t==="create_agents"&&f==="failed"&&s,g=xCr(t),m=g==null?void 0:g.detailRenderer,v=(g==null?void 0:g.hideHeader)===!0,y=v||a||!!m||!!o,[b,x]=se.useState(y),w=se.useRef(!1);se.useEffect(()=>{!w.current&&y&&x(!0)},[y]);const A=()=>{w.current=!0,x(E=>!E)},S=t===_Ze?h("blocks.renderUi"):t,T=XCr(r),O=r==null?null:typeof r=="string"?r:JSON.stringify(r,null,2),k=O&&O.length>2e3?`${O.slice(0,2e3)} +${h("blocks.truncated")}`:O;return W.jsxs(eA.div,{className:`block-tool${g?" block-tool--builtin":""}`,"data-status":f,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[g&&!v?W.jsx(gSr,{definition:g,label:p?h("blocks.agentAdjusting"):f==="failed"?h(`blocks.tools.${g.name}.failed`,{defaultValue:g.failedLabel??g.doneLabel}):GCr(t,e,h),done:n,open:b,onToggle:A}):g?null:W.jsxs("button",{className:"tool-head tool-head--generic",onClick:A,type:"button","aria-expanded":b,children:[W.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:W.jsx(zCr,{})}),n?W.jsx("span",{className:"tool-name",children:S}):W.jsx(Yb,{className:"tool-name",duration:2.2,spread:15,children:S}),W.jsx(Pue,{className:`tool-chevron${b?" is-open":""}`})]}),W.jsx("div",{className:`${v?"":"think-collapse "}${b?"open":""}`,children:W.jsxs("div",{className:"think-collapse-inner",children:[o?W.jsxs("section",{className:"codex-sandbox-run","aria-label":h("blocks.sandboxDetails"),children:[W.jsxs("div",{className:"codex-sandbox-run__label",children:[W.jsxs("span",{className:"codex-sandbox-run__badge",children:[W.jsx(VCr,{}),W.jsx("span",{children:"Codex Sandbox"})]}),W.jsx("span",{className:"codex-sandbox-run__title",children:o.title})]}),W.jsx(QCr,{activity:o}),W.jsx("div",{className:"codex-sandbox-run__stream",children:o.items.length>0?W.jsx(LZe,{blocks:o.items.map(E=>E.block),streaming:!n,onAction:u}):W.jsx(Yb,{className:"codex-sandbox-run__empty",children:h("blocks.waitingCodex")})})]}):null,m?W.jsx(m,{args:e,response:r,status:f,onBranchSelect:l}):o?null:W.jsxs("div",{className:"tool-detail",children:[e!=null&&W.jsxs("div",{className:"tool-section",children:[W.jsx("div",{className:"tool-section-label",children:h("blocks.arguments")}),W.jsx("pre",{className:"tool-args",children:JSON.stringify(e,null,2)})]}),k!=null&&W.jsxs("div",{className:"tool-section",children:[W.jsx("div",{className:"tool-section-label",children:h("blocks.result")}),W.jsx("pre",{className:"tool-args tool-result",children:k})]}),T.length>0&&W.jsxs("div",{className:"tool-section",children:[W.jsx("div",{className:"tool-section-label",children:h("blocks.artifacts")}),W.jsx("div",{className:"studio-tool-artifacts",children:T.map(E=>W.jsx("a",{href:E.contentUrl,download:E.name,children:h("blocks.downloadNamed",{name:E.name})},`${E.contentUrl}:${E.name}`))})]})]})]})})]})}function ZCr({block:t,onDownload:e,onPreview:r}){const{t:n}=Ea("conversation"),[i,a]=se.useState(""),[s,o]=se.useState(""),[l,u]=se.useState(null);se.useEffect(()=>()=>{l&&URL.revokeObjectURL(l.url)},[l]);const h=()=>u(null),d=async(g,m)=>{if(e){a(`download:${g}`),o("");try{await e(g,m)}catch(v){o(v instanceof Error?v.message:String(v))}finally{a("")}}},f=async(g,m,v)=>{if(r){a(`preview:${v}`),o("");try{const y=await r(g,m);u({name:v,url:y})}catch(y){o(y instanceof Error?y.message:String(y))}finally{a("")}}},p=t.files.filter(g=>!g.filename.endsWith(".preview.webp"));return W.jsxs("div",{className:"artifact-list",children:[p.map(g=>{const m=`${g.filename.replace(/\.pptx$/i,"")}.preview.webp`,v=t.files.find(y=>y.filename===m);return W.jsxs("div",{className:"artifact-card",children:[W.jsx("span",{className:"artifact-card__icon","aria-hidden":"true",children:W.jsx(TVe,{})}),W.jsxs("span",{className:"artifact-card__copy",children:[W.jsx("span",{className:"artifact-card__name",children:g.filename}),W.jsx("span",{className:"artifact-card__hint",children:n("blocks.powerpoint")})]}),W.jsxs("span",{className:"artifact-card__actions",children:[v&&W.jsxs("button",{className:"artifact-card__action",type:"button",disabled:!r||i!=="",onClick:()=>void f(v.filename,v.version,g.filename),children:[i===`preview:${g.filename}`?W.jsx(Rv,{className:"spin"}):W.jsx(sir,{}),n("blocks.preview")]}),W.jsxs("button",{className:"artifact-card__action artifact-card__action--primary",type:"button",disabled:!e||i!=="",onClick:()=>void d(g.filename,g.version),children:[i===`download:${g.filename}`?W.jsx(Rv,{className:"spin"}):W.jsx(loe,{}),n("blocks.download")]})]})]},`${g.filename}:${g.version}`)}),s&&W.jsx("div",{className:"artifact-card__error",children:s}),l&&W.jsxs("div",{className:"artifact-preview",role:"dialog","aria-modal":"true","aria-label":n("blocks.previewDialog",{name:l.name}),children:[W.jsx("button",{className:"artifact-preview__backdrop",type:"button","aria-label":n("blocks.closePreview"),onClick:h}),W.jsxs("div",{className:"artifact-preview__panel",children:[W.jsxs("div",{className:"artifact-preview__header",children:[W.jsx("span",{children:l.name}),W.jsx("button",{type:"button","aria-label":n("blocks.closePreview"),onClick:h,children:W.jsx(jk,{})})]}),W.jsx("div",{className:"artifact-preview__canvas",children:W.jsx("img",{src:l.url,alt:n("blocks.slidePreview",{name:l.name})})})]})]})]})}function JCr({block:t,onAuth:e}){const{t:r}=Ea("conversation"),[n,i]=se.useState(t.done?"done":"idle"),[a,s]=se.useState(""),o=t.label||r("blocks.mcpToolset"),l=(()=>{try{return t.authUri?new URL(t.authUri).host:""}catch{return""}})(),u=async()=>{if(e){s(""),i("authorizing");try{await e(t),i("done")}catch(d){s(d instanceof Error?d.message:String(d)),i("idle")}}};return t.done||n==="done"?W.jsxs(eA.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[W.jsx(CVe,{className:"auth-card-icon auth-card-icon--done"}),W.jsx("span",{children:r("blocks.authorized",{tool:o})})]}):W.jsxs(eA.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[W.jsxs("div",{className:"auth-card-head",children:[W.jsx(CVe,{className:"auth-card-icon"}),W.jsx("span",{className:"auth-card-title",children:r("blocks.authorizationRequired",{tool:o})})]}),W.jsxs("p",{className:"auth-card-desc",children:[W.jsx(iVe,{t:r,i18nKey:"blocks.oauthDescription",values:{tool:o},components:{code:W.jsx("code",{className:"auth-card-code"})}}),l&&W.jsxs(W.Fragment,{children:[" ",W.jsx(iVe,{t:r,i18nKey:"blocks.oauthProvider",values:{provider:l},components:{code:W.jsx("code",{className:"auth-card-code"})}})," "]}),r("blocks.oauthContinue")]}),W.jsx("button",{className:"auth-card-btn",onClick:u,disabled:n==="authorizing"||!t.authUri,children:n==="authorizing"?W.jsxs(W.Fragment,{children:[W.jsx(Rv,{className:"cw-i spin"})," ",r("blocks.waitingAuthorization")]}):W.jsx(W.Fragment,{children:r("blocks.authorize")})}),!t.authUri&&W.jsx("div",{className:"auth-card-err",children:r("blocks.missingAuthorizationUrl")}),a&&W.jsx("div",{className:"auth-card-err",children:a})]})}function LZe({blocks:t,appName:e="",streaming:r=!1,onStreamFrame:n,onStreamComplete:i,onAction:a,onAuth:s,onArtifactDownload:o,onArtifactPreview:l,onResolveDelivery:u,onResolveDeliveryComparison:h,onDownloadDelivery:d,onDeployDelivery:f,onBranchSelect:p}){const g=t.reduce((m,v,y)=>v.kind==="text"?y:m,-1);return W.jsx(W.Fragment,{children:t.map((m,v)=>{switch(m.kind){case"progress":return W.jsx(HCr,{text:m.text},"build-progress");case"thinking":{const y=t.slice(v+1).some(b=>b.kind==="text"&&!!b.text.trim());return W.jsx(DZe,{text:m.text,done:m.done,answerStarted:y,streaming:r,onStreamFrame:n},v)}case"text":{const y=m.text.replace(/^\s+/,"");return y?W.jsx(qCr,{text:y,streaming:r,onStreamFrame:n,onStreamComplete:v===g?i:void 0},v):null}case"plan":return W.jsx(jCr,{title:m.title,summary:m.summary,items:m.items,done:m.done},v);case"attachment":return W.jsx(nSr,{appName:e,items:m.files},v);case"artifact":return W.jsx(ZCr,{block:m,onDownload:o,onPreview:l},v);case"delivery":return W.jsx(WCr,{value:m.value,onResolve:u,onResolveComparison:h,onDownload:d,onDeploy:f},v);case"invocation":return W.jsx(jAr,{value:m.value},v);case"tool":{if(m.name===_Ze&&m.done)return null;const y=m.name==="create_agents"&&t.slice(v+1).some(b=>b.kind==="tool"&&b.name==="create_agents");return W.jsx(KCr,{name:m.name,args:m.args,response:m.response,done:m.done,status:m.status,defaultOpen:m.defaultOpen,retrying:m.name==="create_agents"&&(r||y),codexActivity:m.codexActivity,onBranchSelect:p,onAction:a},v)}case"agent-transfer":return null;case"auth":return W.jsx(JCr,{block:m,onAuth:s},v);case"a2ui":return Ylr(m.messages).filter(y=>y.components[y.rootId]).map(y=>W.jsx(eA.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:W.jsx(jlr,{surface:y,onAction:a})},`${v}-${y.surfaceId}`));default:return null}})})}function eOr(t){return t.isComposing||t.keyCode===229}function tOr(t){return W.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:W.jsx("path",{d:"m6.5 11.5 5.5-5.5 5.5 5.5M12 6v12"})})}function rOr({value:t,placeholder:e,busy:r=!1,disabled:n=!1,onChange:i,onSubmit:a}){const{t:s}=Ea("conversation"),o=se.useRef(null),l=!!t.trim()&&!r&&!n;return se.useLayoutEffect(()=>{const u=o.current;u&&(u.style.height="auto",u.style.height=`${Math.min(u.scrollHeight,144)}px`)},[t]),W.jsx("form",{className:"composer compact-composer",onSubmit:u=>{u.preventDefault(),l&&a()},children:W.jsxs("div",{className:"composer-box",children:[W.jsx("div",{className:"composer-input-stack",children:W.jsx("textarea",{ref:o,className:"comp-input scroll",rows:1,value:t,disabled:n,placeholder:e??s("composer.placeholder"),"aria-label":s("composer.inputAria"),onChange:u=>i(u.target.value),onKeyDown:u=>{eOr(u.nativeEvent)||u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),l&&a())}})}),W.jsx("div",{className:"composer-submit-actions",children:W.jsx("button",{type:"submit",className:"comp-send",disabled:!l,"aria-label":s(r?"composer.generating":"composer.send"),children:W.jsx(tOr,{className:"icon"})})})]})})}const nOr=5,lm=12,the=12;function rN(t,e,r){return Math.min(Math.max(t,e),Math.max(e,r))}function iOr(){return W.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",children:W.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function MZe({studioOrigin:t,className:e=""}){const[r,n]=se.useState(!1);return W.jsx("img",{className:e,src:r?Pnr:`${t}/web/site-logo`,alt:"",onError:()=>n(!0)})}function rhe(t,e){return{role:e,blocks:[{kind:"text",text:t}],meta:{ts:Date.now()/1e3}}}function IZe(t,e){return t.text().then(r=>{try{const n=JSON.parse(r).detail;if(typeof n=="string"&&n)return n}catch{}return r.trim()||e})}function aOr({studioOrigin:t,token:e}){const{t:r,i18n:n}=Ea("websiteIntegration"),[i,a]=se.useState(!1),[s,o]=se.useState(""),[l,u]=se.useState([rhe(r("widget.greeting"),"assistant")]),[h,d]=se.useState(""),[f,p]=se.useState(""),[g,m]=se.useState(!1),v=se.useRef(null),y=se.useRef(null),b=se.useRef(null),x=se.useRef(null),w=se.useRef(null),A=se.useRef(!1),S=se.useRef(null),T=se.useRef(`website-${crypto.randomUUID()}`),O=se.useRef(crypto.randomUUID()),k=se.useCallback(()=>{const D=y.current,M=b.current;if(!D||!M||!x.current)return;const P=D.getBoundingClientRect(),N=M.offsetWidth,F=M.offsetHeight,B=window.innerWidth,V=window.innerHeight,z=P.left+P.width/2,U=P.top-lm,Q=V-P.bottom-lm,G=U>=F+the||U>=Q?P.top-F-the:P.bottom+the,X=z>=B/2?P.right-N:P.left,Y=rN(X,lm,B-N-lm),le=rN(G,lm,V-F-lm);M.style.left=`${Y}px`,M.style.top=`${le}px`,M.style.right="auto",M.style.bottom="auto",M.style.transformOrigin=`${rN(z-Y,0,N)}px ${P.top>=le+F?F:0}px`},[]),E=se.useCallback((D,M)=>{const P=y.current;if(!P)return;const N={x:rN(D,lm,window.innerWidth-P.offsetWidth-lm),y:rN(M,lm,window.innerHeight-P.offsetHeight-lm)};x.current=N,P.style.left=`${N.x}px`,P.style.top=`${N.y}px`,P.style.right="auto",P.style.bottom="auto",k()},[k]),_=se.useCallback(D=>{var F;const M=w.current;if(!M||M.pointerId!==D.pointerId)return;D.preventDefault();const P=D.clientX-M.start.x,N=D.clientY-M.start.y;!M.moved&&Math.hypot(P,N){var P;const M=w.current;!M||M.pointerId!==D.pointerId||(M.moved&&(A.current=!0,S.current!=null&&window.clearTimeout(S.current),S.current=window.setTimeout(()=>{A.current=!1,S.current=null},0)),w.current=null,(P=y.current)==null||P.classList.remove("is-dragging"))},[]),L=se.useCallback(()=>{requestAnimationFrame(()=>{const D=v.current;D&&(D.scrollTop=D.scrollHeight)})},[]);se.useEffect(()=>{const D=new AbortController;return fetch(`${t}/embed/session`,{method:"POST",headers:{"Accept-Language":n.resolvedLanguage||n.language,"Content-Type":"application/json"},body:JSON.stringify({token:e}),signal:D.signal}).then(async M=>{if(!M.ok)throw new Error(await IZe(M,r("widget.requestFailed",{status:M.status})));return M.json()}).then(M=>{if(!M.sessionToken)throw new Error(r("widget.sessionFailed"));d(M.sessionToken)}).catch(M=>{D.signal.aborted||p(M instanceof Error?M.message:r("widget.unauthorized"))}),()=>D.abort()},[n.language,n.resolvedLanguage,t,r,e]),se.useEffect(L,[g,L,l]),se.useEffect(()=>{if(!i||!x.current)return;const D=requestAnimationFrame(k);return()=>cancelAnimationFrame(D)},[i,k]),se.useEffect(()=>{var M;const D=()=>{const P=x.current;P&&E(P.x,P.y)};return window.addEventListener("resize",D),(M=window.visualViewport)==null||M.addEventListener("resize",D),()=>{var P;window.removeEventListener("resize",D),(P=window.visualViewport)==null||P.removeEventListener("resize",D)}},[E]),se.useEffect(()=>(window.addEventListener("pointermove",_,{passive:!1}),window.addEventListener("pointerup",I),window.addEventListener("pointercancel",I),()=>{window.removeEventListener("pointermove",_),window.removeEventListener("pointerup",I),window.removeEventListener("pointercancel",I)}),[I,_]),se.useEffect(()=>()=>{S.current!=null&&window.clearTimeout(S.current)},[]);const R=async()=>{const D=s.trim();if(!(!D||!h||g)){o(""),m(!0),u(M=>[...M,rhe(D,"user"),{role:"assistant",blocks:[],meta:{ts:Date.now()/1e3}}]);try{const M=await fetch(`${t}/embed/run_sse`,{method:"POST",headers:{"Accept-Language":n.resolvedLanguage||n.language,Authorization:`Bearer ${h}`,"Content-Type":"application/json"},body:JSON.stringify({message:D,userId:T.current,sessionId:O.current})});if(!M.ok||!M.body)throw new Error(await IZe(M,r("widget.requestFailed",{status:M.status})));let P=Ynr(),N={ts:Date.now()/1e3};for await(const F of Nnr(M)){const B=F,V=B.error??B.errorMessage??B.error_message;if(typeof V=="string"&&V)throw new Error(V);P=eir(P,B),N={author:B.author&&B.author!=="user"?B.author:N==null?void 0:N.author,ts:B.timestamp??(N==null?void 0:N.ts),eventId:B.id??(N==null?void 0:N.eventId),invocationId:B.invocationId??B.invocation_id??(N==null?void 0:N.invocationId)};const z={role:"assistant",blocks:P.blocks,meta:N};u(U=>[...U.slice(0,-1),z])}}catch(M){const P=M instanceof Error?M.message:r("widget.conversationFailed");u(N=>[...N.slice(0,-1),rhe(P,"assistant")])}finally{m(!1)}}};return W.jsxs("div",{className:"website-widget",children:[W.jsx("button",{ref:y,type:"button",className:"website-widget__launcher","aria-label":r(i?"widget.close":"widget.open"),"aria-expanded":i,onClick:()=>{if(A.current){A.current=!1,S.current!=null&&(window.clearTimeout(S.current),S.current=null);return}a(D=>!D)},onPointerDown:D=>{if(D.button!==0)return;const M=D.currentTarget.getBoundingClientRect();w.current={pointerId:D.pointerId,start:{x:D.clientX,y:D.clientY},origin:{x:M.left,y:M.top},moved:!1}},onDragStart:D=>D.preventDefault(),children:W.jsx(MZe,{studioOrigin:t,className:"website-widget__launcher-logo"})}),W.jsxs("section",{ref:b,className:`website-widget__panel${i?" is-open":""}`,"aria-label":r("widget.panelLabel"),"aria-hidden":!i,children:[W.jsxs("header",{className:"website-widget__header",children:[W.jsxs("div",{className:"website-widget__identity",children:[W.jsx("span",{className:"website-widget__identity-logo",children:W.jsx(MZe,{studioOrigin:t})}),W.jsxs("span",{className:"website-widget__identity-copy",children:[W.jsx("strong",{children:r("widget.assistant")}),W.jsx("span",{children:r("widget.online")})]})]}),W.jsx("button",{type:"button",className:"website-widget__close","aria-label":r("widget.close"),onClick:()=>a(!1),children:W.jsx(iOr,{})})]}),W.jsxs("div",{ref:v,className:`website-widget__transcript transcript${g?" is-streaming":""}`,"aria-live":"polite",children:[l.map((D,M)=>{if(D.role==="user"){const F=D.blocks.filter(B=>B.kind==="text").map(B=>B.kind==="text"?B.text:"").join("");return W.jsx("div",{className:"turn turn--user",children:W.jsx("div",{className:"bubble",children:W.jsx(ZQ,{text:F,allowRawHtml:!1})})},`user-${M}`)}const P=D.blocks.length===0,N=g&&M===l.length-1;return W.jsx("div",{className:"turn turn--assistant",children:P&&N?W.jsx(YCr,{}):W.jsx(LZe,{blocks:D.blocks,streaming:N,onStreamFrame:L,onAction:()=>{}})},`assistant-${M}`)}),f?W.jsx("div",{className:"website-widget__error",role:"alert",children:f}):null]}),W.jsx("div",{className:"website-widget__composer-slot",children:W.jsx(rOr,{value:s,busy:g,disabled:!h||!!f,onChange:o,onSubmit:()=>void R()})})]})]})}function sOr(){return window.__VEADK_WEBSITE_INTEGRATION_SCRIPT__??(document.currentScript instanceof HTMLScriptElement?document.currentScript:null)}const nN=sOr(),PZe=((PZt=nN==null?void 0:nN.dataset.token)==null?void 0:PZt.trim())??"";if(nN&&PZe&&!document.querySelector("[data-veadk-website-integration]")){const t=new URL(nN.src,window.location.href).origin,e=document.createElement("div");e.dataset.veadkWebsiteIntegration="",document.body.appendChild(e);const r=e.attachShadow({mode:"open"}),n=document.createElement("style");n.textContent=[Mnr,_nr,Lnr,Rnr,Dnr,Inr].join(` `);const i=document.createElement("div");r.append(n,i),Btr.createRoot(i).render(W.jsx(aOr,{studioOrigin:t,token:PZe}))}/*! ***************************************************************************** Copyright (c) Microsoft Corporation. @@ -307,7 +307,7 @@ ${h("blocks.truncated")}`:O;return W.jsxs(eA.div,{className:`block-tool${g?" blo LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ***************************************************************************** */var nhe=function(t,e){return nhe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},nhe(t,e)};function rt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");nhe(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var oOr=function(){function t(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return t}(),lOr=function(){function t(){this.browser=new oOr,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window<"u"}return t}(),Rn=new lOr;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(Rn.wxa=!0,Rn.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?Rn.worker=!0:!Rn.hasGlobalWindow||"Deno"in window||typeof navigator<"u"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Node.js")>-1?(Rn.node=!0,Rn.svgSupported=!0):cOr(navigator.userAgent,Rn);function cOr(t,e){var r=e.browser,n=t.match(/Firefox\/([\d.]+)/),i=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),a=t.match(/Edge?\/([\d.]+)/),s=/micromessenger/i.test(t);n&&(r.firefox=!0,r.version=n[1]),i&&(r.ie=!0,r.version=i[1]),a&&(r.edge=!0,r.version=a[1],r.newEdge=+a[1].split(".")[0]>18),s&&(r.weChat=!0),e.svgSupported=typeof SVGRect<"u",e.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,e.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&+r.version>=11);var o=e.domSupported=typeof document<"u";if(o){var l=document.documentElement.style;e.transform3dSupported=(r.ie&&"transition"in l||r.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in l)&&!("OTransition"in l),e.transformSupported=e.transform3dSupported||r.ie&&+r.version>=9}}var ihe=12,NZe="sans-serif",Hv=ihe+"px "+NZe,uOr=20,hOr=100,dOr="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function fOr(t){var e={};if(typeof JSON>"u")return e;for(var r=0;r=0)o=s*r.length;else for(var l=0;l=yOr&&(ohe=0),ohe++}function dG(){for(var t=[],e=0;e"u"&&typeof self<"u"?Rn.worker=!0:!Rn.hasGlobalWindow||"Deno"in window||typeof navigator<"u"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Node.js")>-1?(Rn.node=!0,Rn.svgSupported=!0):cOr(navigator.userAgent,Rn);function cOr(t,e){var r=e.browser,n=t.match(/Firefox\/([\d.]+)/),i=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),a=t.match(/Edge?\/([\d.]+)/),s=/micromessenger/i.test(t);n&&(r.firefox=!0,r.version=n[1]),i&&(r.ie=!0,r.version=i[1]),a&&(r.edge=!0,r.version=a[1],r.newEdge=+a[1].split(".")[0]>18),s&&(r.weChat=!0),e.svgSupported=typeof SVGRect<"u",e.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,e.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&+r.version>=11);var o=e.domSupported=typeof document<"u";if(o){var l=document.documentElement.style;e.transform3dSupported=(r.ie&&"transition"in l||r.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in l)&&!("OTransition"in l),e.transformSupported=e.transform3dSupported||r.ie&&+r.version>=9}}var ihe=12,NZe="sans-serif",Hv=ihe+"px "+NZe,uOr=20,hOr=100,dOr="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function fOr(t){var e={};if(typeof JSON>"u")return e;for(var r=0;r=0)o=s*r.length;else for(var l=0;l=yOr&&(ohe=0),ohe++}function dG(){for(var t=[],e=0;e>1)%2;o.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",n[l]+":0",i[u]+":0",n[1-l]+":auto",i[1-u]+":auto",""].join("!important;"),t.appendChild(s),r.push(s)}return e.clearMarkers=function(){de(r,function(h){h.parentNode&&h.parentNode.removeChild(h)})},r}function BOr(t,e,r){for(var n=r?"invTrans":"trans",i=e[n],a=e.srcCoords,s=[],o=[],l=!0,u=0;u<4;u++){var h=t[u].getBoundingClientRect(),d=2*u,f=h.left,p=h.top;s.push(f,p),l=l&&a&&f===a[d]&&p===a[d+1],o.push(t[u].offsetLeft,t[u].offsetTop)}return l&&i?i:(e.srcCoords=s,e[n]=r?qZe(o,s):qZe(s,o))}function jZe(t){return t.nodeName.toUpperCase()==="CANVAS"}var $Or=/([&<>"'])/g,FOr={"&":"&","<":"<",">":">",'"':""","'":"'"};function Nc(t){return t==null?"":(t+"").replace($Or,function(e,r){return FOr[r]})}var zOr=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,yhe=[],UOr=Rn.browser.firefox&&+Rn.browser.version.split(".")[0]<39;function bhe(t,e,r,n){return r=r||{},n?XZe(t,e,r):UOr&&e.layerX!=null&&e.layerX!==e.offsetX?(r.zrX=e.layerX,r.zrY=e.layerY):e.offsetX!=null?(r.zrX=e.offsetX,r.zrY=e.offsetY):XZe(t,e,r),r}function XZe(t,e,r){if(Rn.domSupported&&t.getBoundingClientRect){var n=e.clientX,i=e.clientY;if(jZe(t)){var a=t.getBoundingClientRect();r.zrX=n-a.left,r.zrY=i-a.top;return}else if(vhe(yhe,t,n,i)){r.zrX=yhe[0],r.zrY=yhe[1];return}}r.zrX=r.zrY=0}function xhe(t){return t||window.event}function Lf(t,e,r){if(e=xhe(e),e.zrX!=null)return e;var n=e.type,i=n&&n.indexOf("touch")>=0;if(i){var s=n!=="touchend"?e.targetTouches[0]:e.changedTouches[0];s&&bhe(t,s,e,r)}else{bhe(t,e,e,r);var a=VOr(e);e.zrDelta=a?a/120:-(e.detail||0)/3}var o=e.button;return e.which==null&&o!==void 0&&zOr.test(e.type)&&(e.which=o&1?1:o&2?3:o&4?2:0),e}function VOr(t){var e=t.wheelDelta;if(e)return e;var r=t.deltaX,n=t.deltaY;if(r==null||n==null)return e;var i=Math.abs(n!==0?n:r),a=n>0?-1:n<0?1:r>0?-1:1;return 3*i*a}function whe(t,e,r,n){t.addEventListener(e,r,n)}function QOr(t,e,r,n){t.removeEventListener(e,r,n)}var Kv=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0};function KZe(t){return t.which===2||t.which===3}var GOr=function(){function t(){this._track=[]}return t.prototype.recognize=function(e,r,n){return this._doTrack(e,r,n),this._recognize(e)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(e,r,n){var i=e.touches;if(i){for(var a={points:[],touches:[],target:r,event:e},s=0,o=i.length;s1&&n&&n.length>1){var a=ZZe(n)/ZZe(i);!isFinite(a)&&(a=1),e.pinchScale=a;var s=HOr(n);return e.pinchX=s[0],e.pinchY=s[1],{type:"pinch",target:t[0].target,event:e}}}}};function xa(){return[1,0,0,1,0,0]}function TA(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function ix(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Sd(t,e,r){var n=e[0]*r[0]+e[2]*r[1],i=e[1]*r[0]+e[3]*r[1],a=e[0]*r[2]+e[2]*r[3],s=e[1]*r[2]+e[3]*r[3],o=e[0]*r[4]+e[2]*r[5]+e[4],l=e[1]*r[4]+e[3]*r[5]+e[5];return t[0]=n,t[1]=i,t[2]=a,t[3]=s,t[4]=o,t[5]=l,t}function zp(t,e,r){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+r[0],t[5]=e[5]+r[1],t}function Zv(t,e,r,n){n===void 0&&(n=[0,0]);var i=e[0],a=e[2],s=e[4],o=e[1],l=e[3],u=e[5],h=Math.sin(r),d=Math.cos(r);return t[0]=i*d+o*h,t[1]=-i*h+o*d,t[2]=a*d+l*h,t[3]=-a*h+d*l,t[4]=d*(s-n[0])+h*(u-n[1])+n[0],t[5]=d*(u-n[1])-h*(s-n[0])+n[1],t}function bG(t,e,r){var n=r[0],i=r[1];return t[0]=e[0]*n,t[1]=e[1]*i,t[2]=e[2]*n,t[3]=e[3]*i,t[4]=e[4]*n,t[5]=e[5]*i,t}function Cd(t,e){var r=e[0],n=e[2],i=e[4],a=e[1],s=e[3],o=e[5],l=r*s-a*n;return l?(l=1/l,t[0]=s*l,t[1]=-a*l,t[2]=-n*l,t[3]=r*l,t[4]=(n*o-s*i)*l,t[5]=(a*i-r*o)*l,t):null}function JZe(t){var e=xa();return ix(e,t),e}const WOr=Object.freeze(Object.defineProperty({__proto__:null,clone:JZe,copy:ix,create:xa,identity:TA,invert:Cd,mul:Sd,rotate:Zv,scale:bG,translate:zp},Symbol.toStringTag,{value:"Module"}));var wr=function(){function t(e,r){this.x=e||0,this.y=r||0}return t.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(e,r){return this.x=e,this.y=r,this},t.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},t.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},t.prototype.scale=function(e){this.x*=e,this.y*=e},t.prototype.scaleAndAdd=function(e,r){this.x+=e.x*r,this.y+=e.y*r},t.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},t.prototype.dot=function(e){return this.x*e.x+this.y*e.y},t.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},t.prototype.distance=function(e){var r=this.x-e.x,n=this.y-e.y;return Math.sqrt(r*r+n*n)},t.prototype.distanceSquare=function(e){var r=this.x-e.x,n=this.y-e.y;return r*r+n*n},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(e){if(e){var r=this.x,n=this.y;return this.x=e[0]*r+e[2]*n+e[4],this.y=e[1]*r+e[3]*n+e[5],this}},t.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},t.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},t.set=function(e,r,n){e.x=r,e.y=n},t.copy=function(e,r){e.x=r.x,e.y=r.y},t.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},t.lenSquare=function(e){return e.x*e.x+e.y*e.y},t.dot=function(e,r){return e.x*r.x+e.y*r.y},t.add=function(e,r,n){e.x=r.x+n.x,e.y=r.y+n.y},t.sub=function(e,r,n){e.x=r.x-n.x,e.y=r.y-n.y},t.scale=function(e,r,n){e.x=r.x*n,e.y=r.y*n},t.scaleAndAdd=function(e,r,n,i){e.x=r.x+n.x*i,e.y=r.y+n.y*i},t.lerp=function(e,r,n,i){var a=1-i;e.x=a*r.x+i*n.x,e.y=a*r.y+i*n.y},t}(),SA=Math.min,HE=Math.max,The=Math.abs,eJe=["x","y"],YOr=["width","height"],CA=new wr,OA=new wr,kA=new wr,EA=new wr,Od=iJe(),dN=Od.minTv,She=Od.maxTv,fN=[0,0],fr=function(){function t(e,r,n,i){Che(this,e,r,n,i)}return t.set=function(e,r,n,i,a){return i<0&&(r=r+i,i=-i),a<0&&(n=n+a,a=-a),e.x=r,e.y=n,e.width=i,e.height=a,e},t.prototype.union=function(e){var r=SA(e.x,this.x),n=SA(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=HE(e.x+e.width,this.x+this.width)-r:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=HE(e.y+e.height,this.y+this.height)-n:this.height=e.height,this.x=r,this.y=n},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(e){return tJe(xa(),this,e)},t.prototype.intersect=function(e,r,n){return t.intersect(this,e,r,n)},t.intersect=function(e,r,n,i){n&&wr.set(n,0,0);var a=i&&i.outIntersectRect||null,s=i&&i.clamp;if(a&&(a.x=a.y=a.width=a.height=NaN),!e||!r)return!1;e instanceof t||(e=Che(jOr,e.x,e.y,e.width,e.height)),r instanceof t||(r=Che(XOr,r.x,r.y,r.width,r.height));var o=!!n;Od.reset(i,o);var l=Od.touchThreshold,u=e.x+l,h=e.x+e.width-l,d=e.y+l,f=e.y+e.height-l,p=r.x+l,g=r.x+r.width-l,m=r.y+l,v=r.y+r.height-l;if(u>h||d>f||p>g||m>v)return!1;var y=!(h=e.x&&r<=e.x+e.width&&n>=e.y&&n<=e.y+e.height},t.prototype.contain=function(e,r){return t.contain(this,e,r)},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){WE(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return this.width===0||this.height===0},t.create=function(e){return new t(e?e.x:0,e?e.y:0,e?e.width:0,e?e.height:0)},t.copy=function(e,r){return e.x=r.x,e.y=r.y,e.width=r.width,e.height=r.height,e},t.applyTransform=function(e,r,n){if(!n){e!==r&&WE(e,r);return}if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var i=n[0],a=n[3],s=n[4],o=n[5];e.x=r.x*i+s,e.y=r.y*a+o,e.width=r.width*i,e.height=r.height*a,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height);return}CA.x=kA.x=r.x,CA.y=EA.y=r.y,OA.x=EA.x=r.x+r.width,OA.y=kA.y=r.y+r.height,CA.transform(n),EA.transform(n),OA.transform(n),kA.transform(n),e.x=SA(CA.x,OA.x,kA.x,EA.x),e.y=SA(CA.y,OA.y,kA.y,EA.y);var l=HE(CA.x,OA.x,kA.x,EA.x),u=HE(CA.y,OA.y,kA.y,EA.y);e.width=l-e.x,e.height=u-e.y},t.calculateTransform=function(e,r,n){var i=n.width/r.width,a=n.height/r.height;return e=TA(e||[]),zp(e,e,Yv(Ohe,-r.x,-r.y)),bG(e,e,Yv(Ohe,i,a)),zp(e,e,Yv(Ohe,n.x,n.y)),e},t}(),xG=fr.create,Che=fr.set,WE=fr.copy,tJe=fr.calculateTransform,rJe=fr.applyTransform,qOr=fr.contain,jOr=new fr(0,0,0,0),XOr=new fr(0,0,0,0),Ohe=[];function nJe(t,e,r,n,i,a,s,o){var l=The(e-r),u=The(n-t),h=SA(l,u),d=eJe[i],f=eJe[1-i],p=YOr[i];e=u||!Od.bidirectional)&&(dN[d]=-u,dN[f]=0,Od.useDir&&Od.calcDirMTV())))}function iJe(){var t=0,e=new wr,r=new wr,n={minTv:new wr,maxTv:new wr,useDir:!1,dirMinTv:new wr,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(a,s){n.touchThreshold=0,a&&a.touchThreshold!=null&&(n.touchThreshold=HE(0,a.touchThreshold)),n.negativeSize=!1,s&&(n.minTv.set(1/0,1/0),n.maxTv.set(0,0),n.useDir=!1,a&&a.direction!=null&&(n.useDir=!0,n.dirMinTv.copy(n.minTv),r.copy(n.minTv),t=a.direction,n.bidirectional=a.bidirectional==null||!!a.bidirectional,n.bidirectional||e.set(Math.cos(t),Math.sin(t))))},calcDirMTV:function(){var a=n.minTv,s=n.dirMinTv,o=a.y*a.y+a.x*a.x,l=Math.sin(t),u=Math.cos(t),h=l*a.y+u*a.x;if(i(h)){i(a.x)&&i(a.y)&&s.set(0,0);return}if(r.x=o*u/h,r.y=o*l/h,i(r.x)&&i(r.y)){s.set(0,0);return}(n.bidirectional||e.dot(r)>0)&&r.len()=0;d--){var f=a[d];f!==i&&!f.ignore&&!f.ignoreCoarsePointer&&(!f.parent||!f.parent.ignoreCoarsePointer)&&(khe.copy(f.getBoundingRect()),f.transform&&khe.applyTransform(f.transform),khe.intersect(h)&&o.push(f))}if(o.length)for(var p=4,g=Math.PI/12,m=Math.PI*2,v=0;v4)return;this._downPoint=null}this.dispatchToElement(a,t,e)}});function tkr(t,e,r){if(t[t.rectHover?"rectContain":"contain"](e,r)){for(var n=t,i=void 0,a=!1;n;){if(n.ignoreClip&&(a=!0),!a){var s=n.getClipPath();if(s&&!s.contain(e,r))return!1}n.silent&&(i=!0);var o=n.__hostTarget;n=o?n.ignoreHostSilent?null:o:n.parent}return i?aJe:!0}return!1}function oJe(t,e,r,n,i){for(var a=t.length-1;a>=0;a--){var s=t[a],o=void 0;if(s!==i&&!s.ignore&&(o=tkr(s,r,n))&&(!e.topTarget&&(e.topTarget=s),o!==aJe)){e.target=s;break}}}function lJe(t,e,r){var n=t.painter;return e<0||e>n.getWidth()||r<0||r>n.getHeight()}var cJe=32,gN=7;function rkr(t){for(var e=0;t>=cJe;)e|=t&1,t>>=1;return t+e}function uJe(t,e,r,n){var i=e+1;if(i===r)return 1;if(n(t[i++],t[e])<0){for(;i=0;)i++;return i-e}function nkr(t,e,r){for(r--;e>>1,i(a,t[l])<0?o=l:s=l+1;var u=n-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;u>0;)t[s+u]=t[s+u-1],u--}t[s]=a}}function Ehe(t,e,r,n,i,a){var s=0,o=0,l=1;if(a(t,e[r+i])>0){for(o=n-i;l0;)s=l,l=(l<<1)+1,l<=0&&(l=o);l>o&&(l=o),s+=i,l+=i}else{for(o=i+1;lo&&(l=o);var u=s;s=i-l,l=i-u}for(s++;s>>1);a(t,e[r+h])>0?s=h+1:l=h}return l}function _he(t,e,r,n,i,a){var s=0,o=0,l=1;if(a(t,e[r+i])<0){for(o=i+1;lo&&(l=o);var u=s;s=i-l,l=i-u}else{for(o=n-i;l=0;)s=l,l=(l<<1)+1,l<=0&&(l=o);l>o&&(l=o),s+=i,l+=i}for(s++;s>>1);a(t,e[r+h])<0?l=h:s=h+1}return l}function ikr(t,e){var r=gN,n,i,a=0,s=[];n=[],i=[];function o(p,g){n[a]=p,i[a]=g,a+=1}function l(){for(;a>1;){var p=a-2;if(p>=1&&i[p-1]<=i[p]+i[p+1]||p>=2&&i[p-2]<=i[p]+i[p-1])i[p-1]i[p+1])break;h(p)}}function u(){for(;a>1;){var p=a-2;p>0&&i[p-1]=gN||S>=gN);if(O)break;A<0&&(A=0),A+=2}if(r=A,r<1&&(r=1),g===1){for(y=0;y=0;y--)t[T+y]=t[A+y];t[w]=s[x];return}for(var S=r;;){var O=0,k=0,E=!1;do if(e(s[x],t[b])<0){if(t[w--]=t[b--],O++,k=0,--g===0){E=!0;break}}else if(t[w--]=s[x--],k++,O=0,--v===1){E=!0;break}while((O|k)=0;y--)t[T+y]=t[A+y];if(g===0){E=!0;break}}if(t[w--]=s[x--],--v===1){E=!0;break}if(k=v-Ehe(t[b],s,0,v,v-1,e),k!==0){for(w-=k,x-=k,v-=k,T=w+1,A=x+1,y=0;y=gN||k>=gN);if(E)break;S<0&&(S=0),S+=2}if(r=S,r<1&&(r=1),v===1){for(w-=g,b-=g,T=w+1,A=b+1,y=g-1;y>=0;y--)t[T+y]=t[A+y];t[w]=s[x]}else{if(v===0)throw new Error;for(A=w-(v-1),y=0;yo&&(l=o),hJe(t,r,r+l,r+a,e),a=l}s.pushRun(r,a),s.mergeRuns(),i-=a,r+=a}while(i!==0);s.forceMergeRuns()}}var Oh=1,mN=2,YE=4,dJe=!1;function Rhe(){dJe||(dJe=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function fJe(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var akr=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=fJe}return t.prototype.traverse=function(e,r){for(var n=0;n=0&&this._roots.splice(i,1)},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t}(),AG;AG=Rn.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)};var vN={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return .5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return t===0?0:Math.pow(1024,t-1)},exponentialOut:function(t){return t===1?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return t===0?0:t===1?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(2,-10*(t-1))+2)},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,r=.1,n=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=n/4):e=n*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)))},elasticOut:function(t){var e,r=.1,n=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=n/4):e=n*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},elasticInOut:function(t){var e,r=.1,n=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=n/4):e=n*Math.asin(1/r)/(2*Math.PI),(t*=2)<1?-.5*(r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)):r*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?.5*(t*t*((e+1)*t-e)):.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-vN.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?vN.bounceIn(t*2)*.5:vN.bounceOut(t*2-1)*.5+.5}},TG=Math.pow,ax=Math.sqrt,SG=1e-8,pJe=1e-4,gJe=ax(3),CG=1/3,um=tx(),Mf=tx(),qE=tx();function sx(t){return t>-SG&&tSG||t<-SG}function Wo(t,e,r,n,i){var a=1-i;return a*a*(a*t+3*i*e)+i*i*(i*n+3*a*r)}function vJe(t,e,r,n,i){var a=1-i;return 3*(((e-t)*a+2*(r-e)*i)*a+(n-r)*i*i)}function OG(t,e,r,n,i,a){var s=n+3*(e-r)-t,o=3*(r-e*2+t),l=3*(e-t),u=t-i,h=o*o-3*s*l,d=o*l-9*s*u,f=l*l-3*o*u,p=0;if(sx(h)&&sx(d))if(sx(o))a[0]=0;else{var g=-l/o;g>=0&&g<=1&&(a[p++]=g)}else{var m=d*d-4*h*f;if(sx(m)){var v=d/h,g=-o/s+v,y=-v/2;g>=0&&g<=1&&(a[p++]=g),y>=0&&y<=1&&(a[p++]=y)}else if(m>0){var b=ax(m),x=h*o+1.5*s*(-d+b),w=h*o+1.5*s*(-d-b);x<0?x=-TG(-x,CG):x=TG(x,CG),w<0?w=-TG(-w,CG):w=TG(w,CG);var g=(-o-(x+w))/(3*s);g>=0&&g<=1&&(a[p++]=g)}else{var A=(2*h*o-3*s*d)/(2*ax(h*h*h)),T=Math.acos(A)/3,S=ax(h),O=Math.cos(T),g=(-o-2*S*O)/(3*s),y=(-o+S*(O+gJe*Math.sin(T)))/(3*s),k=(-o+S*(O-gJe*Math.sin(T)))/(3*s);g>=0&&g<=1&&(a[p++]=g),y>=0&&y<=1&&(a[p++]=y),k>=0&&k<=1&&(a[p++]=k)}}return p}function yJe(t,e,r,n,i){var a=6*r-12*e+6*t,s=9*e+3*n-3*t-9*r,o=3*e-3*t,l=0;if(sx(s)){if(mJe(a)){var u=-o/a;u>=0&&u<=1&&(i[l++]=u)}}else{var h=a*a-4*s*o;if(sx(h))i[0]=-a/(2*s);else if(h>0){var d=ax(h),u=(-a+d)/(2*s),f=(-a-d)/(2*s);u>=0&&u<=1&&(i[l++]=u),f>=0&&f<=1&&(i[l++]=f)}}return l}function ox(t,e,r,n,i,a){var s=(e-t)*i+t,o=(r-e)*i+e,l=(n-r)*i+r,u=(o-s)*i+s,h=(l-o)*i+o,d=(h-u)*i+u;a[0]=t,a[1]=s,a[2]=u,a[3]=d,a[4]=d,a[5]=h,a[6]=l,a[7]=n}function bJe(t,e,r,n,i,a,s,o,l,u,h){var d,f=.005,p=1/0,g,m,v,y;um[0]=l,um[1]=u;for(var b=0;b<1;b+=.05)Mf[0]=Wo(t,r,i,s,b),Mf[1]=Wo(e,n,a,o,b),v=nx(um,Mf),v=0&&v=0&&u<=1&&(i[l++]=u)}}else{var h=s*s-4*a*o;if(sx(h)){var u=-s/(2*a);u>=0&&u<=1&&(i[l++]=u)}else if(h>0){var d=ax(h),u=(-s+d)/(2*a),f=(-s-d)/(2*a);u>=0&&u<=1&&(i[l++]=u),f>=0&&f<=1&&(i[l++]=f)}}return l}function xJe(t,e,r){var n=t+r-2*e;return n===0?.5:(t-e)/n}function yN(t,e,r,n,i){var a=(e-t)*n+t,s=(r-e)*n+e,o=(s-a)*n+a;i[0]=t,i[1]=a,i[2]=o,i[3]=o,i[4]=s,i[5]=r}function wJe(t,e,r,n,i,a,s,o,l){var u,h=.005,d=1/0;um[0]=s,um[1]=o;for(var f=0;f<1;f+=.05){Mf[0]=bl(t,r,i,f),Mf[1]=bl(e,n,a,f);var p=nx(um,Mf);p=0&&p=1?1:OG(0,n,a,1,l,o)&&Wo(0,i,s,1,o[0])}}}var ukr=function(){function t(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||Xa,this.ondestroy=e.ondestroy||Xa,this.onrestart=e.onrestart||Xa,e.easing&&this.setEasing(e.easing)}return t.prototype.step=function(e,r){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),this._paused){this._pausedTime+=r;return}var n=this._life,i=e-this._startTime-this._pausedTime,a=i/n;a<0&&(a=0),a=Math.min(a,1);var s=this.easingFunc,o=s?s(a):a;if(this.onframe(o),a===1)if(this.loop){var l=i%n;this._startTime=e-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(e){this.easing=e,this.easingFunc=ur(e)?e:vN[e]||Lhe(e)},t}(),AJe=function(){function t(e){this.value=e}return t}(),hkr=function(){function t(){this._len=0}return t.prototype.insert=function(e){var r=new AJe(e);return this.insertEntry(r),r},t.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},t.prototype.remove=function(e){var r=e.prev,n=e.next;r?r.next=n:this.head=n,n?n.prev=r:this.tail=r,e.next=e.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t}(),jE=function(){function t(e){this._list=new hkr,this._maxSize=10,this._map={},this._maxSize=e}return t.prototype.put=function(e,r){var n=this._list,i=this._map,a=null;if(i[e]==null){var s=n.len(),o=this._lastRemovedEntry;if(s>=this._maxSize&&s>0){var l=n.head;n.remove(l),delete i[l.key],a=l.value,this._lastRemovedEntry=l}o?o.value=r:o=new AJe(r),o.key=e,n.insertEntry(o),i[e]=o}return a},t.prototype.get=function(e){var r=this._map[e],n=this._list;if(r!=null)return r!==n.tail&&(n.remove(r),n.insertEntry(r)),r.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}(),TJe={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Up(t){return t=Math.round(t),t<0?0:t>255?255:t}function dkr(t){return t=Math.round(t),t<0?0:t>360?360:t}function bN(t){return t<0?0:t>1?1:t}function kG(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?Up(parseFloat(e)/100*255):Up(parseInt(e,10))}function Jv(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?bN(parseFloat(e)/100):bN(parseFloat(e))}function Mhe(t,e,r){return r<0?r+=1:r>1&&(r-=1),r*6<1?t+(e-t)*r*6:r*2<1?e:r*3<2?t+(e-t)*(2/3-r)*6:t}function lx(t,e,r){return t+(e-t)*r}function If(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function Ihe(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var SJe=new jE(20),EG=null;function XE(t,e){EG&&Ihe(EG,e),EG=SJe.put(t,EG||e.slice())}function Bc(t,e){if(t){e=e||[];var r=SJe.get(t);if(r)return Ihe(e,r);t=t+"";var n=t.replace(/ /g,"").toLowerCase();if(n in TJe)return Ihe(e,TJe[n]),XE(t,e),e;var i=n.length;if(n.charAt(0)==="#"){if(i===4||i===5){var a=parseInt(n.slice(1,4),16);if(!(a>=0&&a<=4095)){If(e,0,0,0,1);return}return If(e,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,i===5?parseInt(n.slice(4),16)/15:1),XE(t,e),e}else if(i===7||i===9){var a=parseInt(n.slice(1,7),16);if(!(a>=0&&a<=16777215)){If(e,0,0,0,1);return}return If(e,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(n.slice(7),16)/255:1),XE(t,e),e}return}var s=n.indexOf("("),o=n.indexOf(")");if(s!==-1&&o+1===i){var l=n.substr(0,s),u=n.substr(s+1,o-(s+1)).split(","),h=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?If(e,+u[0],+u[1],+u[2],1):If(e,0,0,0,1);h=Jv(u.pop());case"rgb":if(u.length>=3)return If(e,kG(u[0]),kG(u[1]),kG(u[2]),u.length===3?h:Jv(u[3])),XE(t,e),e;If(e,0,0,0,1);return;case"hsla":if(u.length!==4){If(e,0,0,0,1);return}return u[3]=Jv(u[3]),Phe(u,e),XE(t,e),e;case"hsl":if(u.length!==3){If(e,0,0,0,1);return}return Phe(u,e),XE(t,e),e;default:return}}If(e,0,0,0,1)}}function Phe(t,e){var r=(parseFloat(t[0])%360+360)%360/360,n=Jv(t[1]),i=Jv(t[2]),a=i<=.5?i*(n+1):i+n-i*n,s=i*2-a;return e=e||[],If(e,Up(Mhe(s,a,r+1/3)*255),Up(Mhe(s,a,r)*255),Up(Mhe(s,a,r-1/3)*255),1),t.length===4&&(e[3]=t[3]),e}function fkr(t){if(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(e,r,n),a=Math.max(e,r,n),s=a-i,o=(a+i)/2,l,u;if(s===0)l=0,u=0;else{o<.5?u=s/(a+i):u=s/(2-a-i);var h=((a-e)/6+s/2)/s,d=((a-r)/6+s/2)/s,f=((a-n)/6+s/2)/s;e===a?l=f-d:r===a?l=1/3+h-f:n===a&&(l=2/3+d-h),l<0&&(l+=1),l>1&&(l-=1)}var p=[l*360,u,o];return t[3]!=null&&p.push(t[3]),p}}function _G(t,e){var r=Bc(t);if(r){for(var n=0;n<3;n++)e<0?r[n]=r[n]*(1-e)|0:r[n]=(255-r[n])*e+r[n]|0,r[n]>255?r[n]=255:r[n]<0&&(r[n]=0);return Pf(r,r.length===4?"rgba":"rgb")}}function pkr(t){var e=Bc(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function xN(t,e,r){if(!(!(e&&e.length)||!(t>=0&&t<=1))){r=r||[];var n=t*(e.length-1),i=Math.floor(n),a=Math.ceil(n),s=e[i],o=e[a],l=n-i;return r[0]=Up(lx(s[0],o[0],l)),r[1]=Up(lx(s[1],o[1],l)),r[2]=Up(lx(s[2],o[2],l)),r[3]=bN(lx(s[3],o[3],l)),r}}var gkr=xN;function Nhe(t,e,r){if(!(!(e&&e.length)||!(t>=0&&t<=1))){var n=t*(e.length-1),i=Math.floor(n),a=Math.ceil(n),s=Bc(e[i]),o=Bc(e[a]),l=n-i,u=Pf([Up(lx(s[0],o[0],l)),Up(lx(s[1],o[1],l)),Up(lx(s[2],o[2],l)),bN(lx(s[3],o[3],l))],"rgba");return r?{color:u,leftIndex:i,rightIndex:a,value:n}:u}}var mkr=Nhe;function ey(t,e,r,n){var i=Bc(t);if(t)return i=fkr(i),e!=null&&(i[0]=dkr(ur(e)?e(i[0]):e)),r!=null&&(i[1]=Jv(ur(r)?r(i[1]):r)),n!=null&&(i[2]=Jv(ur(n)?n(i[2]):n)),Pf(Phe(i),"rgba")}function wN(t,e){var r=Bc(t);if(r&&e!=null)return r[3]=bN(e),Pf(r,"rgba")}function Pf(t,e){if(!(!t||!t.length)){var r=t[0]+","+t[1]+","+t[2];return(e==="rgba"||e==="hsva"||e==="hsla")&&(r+=","+t[3]),e+"("+r+")"}}function AN(t,e){var r=Bc(t);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*e:0}function vkr(){return Pf([Math.round(Math.random()*255),Math.round(Math.random()*255),Math.round(Math.random()*255)],"rgb")}var CJe=new jE(100);function RG(t){if(Nt(t)){var e=CJe.get(t);return e||(e=_G(t,-.1),CJe.put(t,e)),e}else if(iN(t)){var r=ot({},t);return r.colorStops=vt(t.colorStops,function(n){return{offset:n.offset,color:_G(n.color,-.1)}}),r}return t}const ykr=Object.freeze(Object.defineProperty({__proto__:null,fastLerp:xN,fastMapToColor:gkr,lerp:Nhe,lift:_G,liftColor:RG,lum:AN,mapToColor:mkr,modifyAlpha:wN,modifyHSL:ey,parse:Bc,parseCssFloat:Jv,parseCssInt:kG,random:vkr,stringify:Pf,toHex:pkr},Symbol.toStringTag,{value:"Module"}));var DG=Math.round;function TN(t){var e;if(!t||t==="transparent")t="none";else if(typeof t=="string"&&t.indexOf("rgba")>-1){var r=Bc(t);r&&(t="rgb("+r[0]+","+r[1]+","+r[2]+")",e=r[3])}return{color:t,opacity:e??1}}var OJe=1e-4;function cx(t){return t-OJe}function LG(t){return DG(t*1e3)/1e3}function Bhe(t){return DG(t*1e4)/1e4}function bkr(t){return"matrix("+LG(t[0])+","+LG(t[1])+","+LG(t[2])+","+LG(t[3])+","+Bhe(t[4])+","+Bhe(t[5])+")"}var xkr={left:"start",right:"end",center:"middle",middle:"middle"};function wkr(t,e,r){return r==="top"?t+=e/2:r==="bottom"&&(t-=e/2),t}function Akr(t){return t&&(t.shadowBlur||t.shadowOffsetX||t.shadowOffsetY)}function Tkr(t){var e=t.style,r=t.getGlobalScale();return[e.shadowColor,(e.shadowBlur||0).toFixed(2),(e.shadowOffsetX||0).toFixed(2),(e.shadowOffsetY||0).toFixed(2),r[0],r[1]].join(",")}function kJe(t){return t&&!!t.image}function Skr(t){return t&&!!t.svgElement}function $he(t){return kJe(t)||Skr(t)}function EJe(t){return t.type==="linear"}function _Je(t){return t.type==="radial"}function RJe(t){return t&&(t.type==="linear"||t.type==="radial")}function MG(t){return"url(#"+t+")"}function DJe(t){var e=t.getGlobalScale(),r=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(r)/Math.log(10)),1)}function LJe(t){var e=t.x||0,r=t.y||0,n=(t.rotation||0)*lN,i=Jt(t.scaleX,1),a=Jt(t.scaleY,1),s=t.skewX||0,o=t.skewY||0,l=[];return(e||r)&&l.push("translate("+e+"px,"+r+"px)"),n&&l.push("rotate("+n+")"),(i!==1||a!==1)&&l.push("scale("+i+","+a+")"),(s||o)&&l.push("skew("+DG(s*lN)+"deg, "+DG(o*lN)+"deg)"),l.join(" ")}var Ckr=function(){return typeof Buffer<"u"&&typeof Buffer.from=="function"?function(t){return Buffer.from(t).toString("base64")}:typeof btoa=="function"&&typeof unescape=="function"&&typeof encodeURIComponent=="function"?function(t){return btoa(unescape(encodeURIComponent(t)))}:function(t){return null}}(),Fhe=Array.prototype.slice;function ty(t,e,r){return(e-t)*r+t}function zhe(t,e,r,n){for(var i=e.length,a=0;an?e:t,a=Math.min(r,n),s=i[a-1]||{color:[0,0,0,0],offset:0},o=a;os;if(o)n.length=s;else for(var l=a;l=1},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(e,r,n){this._needsSort=!0;var i=this.keyframes,a=i.length,s=!1,o=PJe,l=r;if(Zl(r)){var u=_kr(r);o=u,(u===1&&!zn(r[0])||u===2&&!zn(r[0][0]))&&(s=!0)}else if(zn(r)&&!Jl(r))o=NG;else if(Nt(r))if(!isNaN(+r))o=NG;else{var h=Bc(r);h&&(l=h,o=CN)}else if(iN(r)){var d=ot({},l);d.colorStops=vt(r.colorStops,function(p){return{offset:p.offset,color:Bc(p.color)}}),EJe(r)?o=Uhe:_Je(r)&&(o=Vhe),l=d}a===0?this.valType=o:(o!==this.valType||o===PJe)&&(s=!0),this.discrete=this.discrete||s;var f={time:e,value:l,rawValue:r,percent:0};return n&&(f.easing=n,f.easingFunc=ur(n)?n:vN[n]||Lhe(n)),i.push(f),f},t.prototype.prepare=function(e,r){var n=this.keyframes;this._needsSort&&n.sort(function(m,v){return m.time-v.time});for(var i=this.valType,a=n.length,s=n[a-1],o=this.discrete,l=$G(i),u=NJe(i),h=0;h=0&&!(s[h].percent<=r);h--);h=f(h,o-2)}else{for(h=d;hr);h++);h=f(h-1,o-2)}g=s[h+1],p=s[h]}if(p&&g){this._lastFr=h,this._lastFrP=r;var v=g.percent-p.percent,y=v===0?1:f((r-p.percent)/v,1);g.easingFunc&&(y=g.easingFunc(y));var b=n?this._additiveValue:u?ON:e[l];if(($G(a)||u)&&!b&&(b=this._additiveValue=[]),this.discrete)e[l]=y<1?p.rawValue:g.rawValue;else if($G(a))a===BG?zhe(b,p[i],g[i],y):Okr(b,p[i],g[i],y);else if(NJe(a)){var x=p[i],w=g[i],A=a===Uhe;e[l]={type:A?"linear":"radial",x:ty(x.x,w.x,y),y:ty(x.y,w.y,y),colorStops:vt(x.colorStops,function(S,O){var k=w.colorStops[O];return{offset:ty(S.offset,k.offset,y),color:PG(zhe([],S.color,k.color,y))}}),global:w.global},A?(e[l].x2=ty(x.x2,w.x2,y),e[l].y2=ty(x.y2,w.y2,y)):e[l].r=ty(x.r,w.r,y)}else if(u)zhe(b,p[i],g[i],y),n||(e[l]=PG(b));else{var T=ty(p[i],g[i],y);n?this._additiveValue=T:e[l]=T}n&&this._addToTarget(e)}}},t.prototype._addToTarget=function(e){var r=this.valType,n=this.propName,i=this._additiveValue;r===NG?e[n]=e[n]+i:r===CN?(Bc(e[n],ON),IG(ON,ON,i,1),e[n]=PG(ON)):r===BG?IG(e[n],e[n],i,1):r===IJe&&MJe(e[n],e[n],i,1)},t}(),Qhe=function(){function t(e,r,n,i){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=r,r&&i){dG("Can' use additive animation on looped animation.");return}this._additiveAnimators=i,this._allowDiscrete=n}return t.prototype.getMaxTime=function(){return this._maxTime},t.prototype.getDelay=function(){return this._delay},t.prototype.getLoop=function(){return this._loop},t.prototype.getTarget=function(){return this._target},t.prototype.changeTarget=function(e){this._target=e},t.prototype.when=function(e,r,n){return this.whenWithKeys(e,r,kn(r),n)},t.prototype.whenWithKeys=function(e,r,n,i){for(var a=this._tracks,s=0;s0&&l.addKeyframe(0,SN(u),i),this._trackKeys.push(o)}l.addKeyframe(e,SN(r[o]),i)}return this._maxTime=Math.max(this._maxTime,e),this},t.prototype.pause=function(){this._clip.pause(),this._paused=!0},t.prototype.resume=function(){this._clip.resume(),this._paused=!1},t.prototype.isPaused=function(){return!!this._paused},t.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var r=e.length,n=0;n0)){this._started=1;for(var r=this,n=[],i=this._maxTime||0,a=0;a1){var o=s.pop();a.addKeyframe(o.time,e[i]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},t}();function KE(){return new Date().getTime()}var Dkr=function(t){ha(e,t);function e(r){var n=t.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,r=r||{},n.stage=r.stage||{},n}return e.prototype.addClip=function(r){r.animation&&this.removeClip(r),this._head?(this._tail.next=r,r.prev=this._tail,r.next=null,this._tail=r):this._head=this._tail=r,r.animation=this},e.prototype.addAnimator=function(r){r.animation=this;var n=r.getClip();n&&this.addClip(n)},e.prototype.removeClip=function(r){if(r.animation){var n=r.prev,i=r.next;n?n.next=i:this._head=i,i?i.prev=n:this._tail=n,r.next=r.prev=r.animation=null}},e.prototype.removeAnimator=function(r){var n=r.getClip();n&&this.removeClip(n),r.animation=null},e.prototype.update=function(r){for(var n=KE()-this._pausedTime,i=n-this._time,a=this._head;a;){var s=a.next,o=a.step(n,i);o&&(a.ondestroy(),this.removeClip(a)),a=s}this._time=n,r||(this.trigger("frame",i),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var r=this;this._running=!0;function n(){r._running&&(AG(n),!r._paused&&r.update())}AG(n)},e.prototype.start=function(){this._running||(this._time=KE(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=KE(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=KE()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var r=this._head;r;){var n=r.next;r.prev=r.next=r.animation=null,r=n}this._head=this._tail=null},e.prototype.isFinished=function(){return this._head==null},e.prototype.animate=function(r,n){n=n||{},this.start();var i=new Qhe(r,n.loop);return this.addAnimator(i),i},e}(Df),Lkr=300,Ghe=Rn.domSupported,Hhe=function(){var t=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],e=["touchstart","touchend","touchmove"],r={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},n=vt(t,function(i){var a=i.replace("mouse","pointer");return r.hasOwnProperty(a)?a:i});return{mouse:t,touch:e,pointer:n}}(),BJe={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},$Je=!1;function Whe(t){var e=t.pointerType;return e==="pen"||e==="touch"}function Mkr(t){t.touching=!0,t.touchTimer!=null&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout(function(){t.touching=!1,t.touchTimer=null},700)}function Yhe(t){t&&(t.zrByTouch=!0)}function Ikr(t,e){return Lf(t.dom,new Pkr(t,e),!0)}function FJe(t,e){for(var r=e,n=!1;r&&r.nodeType!==9&&!(n=r.domBelongToZr||r!==e&&r===t.painterRoot);)r=r.parentNode;return n}var Pkr=function(){function t(e,r){this.stopPropagation=Xa,this.stopImmediatePropagation=Xa,this.preventDefault=Xa,this.type=r.type,this.target=this.currentTarget=e.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return t}(),Vp={mousedown:function(t){t=Lf(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=Lf(this.dom,t);var e=this.__mayPointerCapture;e&&(t.zrX!==e[0]||t.zrY!==e[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=Lf(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){t=Lf(this.dom,t);var e=t.toElement||t.relatedTarget;FJe(this,e)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){$Je=!0,t=Lf(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){$Je||(t=Lf(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){t=Lf(this.dom,t),Yhe(t),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),Vp.mousemove.call(this,t),Vp.mousedown.call(this,t)},touchmove:function(t){t=Lf(this.dom,t),Yhe(t),this.handler.processGesture(t,"change"),Vp.mousemove.call(this,t)},touchend:function(t){t=Lf(this.dom,t),Yhe(t),this.handler.processGesture(t,"end"),Vp.mouseup.call(this,t),+new Date-+this.__lastTouchMomentQJe||t<-QJe}var RA=[],ZE=[],Jhe=xa(),ede=Math.abs,hm=function(){function t(){}return t.prototype.getLocalTransform=function(e){return ux(this,e)},t.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},t.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},t.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},t.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},t.prototype.needLocalTransform=function(){return _A(this.rotation)||_A(this.x)||_A(this.y)||_A(this.scaleX-1)||_A(this.scaleY-1)||_A(this.skewX)||_A(this.skewY)},t.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,r=this.needLocalTransform(),n=this.transform;if(!(r||e)){n&&(VJe(n),this.invTransform=null);return}n=n||xa(),r?this.getLocalTransform(n):VJe(n),e&&(r?Sd(n,e,n):ix(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n),this.invTransform=this.invTransform||xa(),Cd(this.invTransform,n)},t.prototype._resolveGlobalScaleRatio=function(e){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(RA);var n=RA[0]<0?-1:1,i=RA[1]<0?-1:1,a=((RA[0]-n)*r+n)/RA[0]||0,s=((RA[1]-i)*r+i)/RA[1]||0;e[0]*=a,e[1]*=a,e[2]*=s,e[3]*=s}},t.prototype.getComputedTransform=function(){for(var e=this,r=[];e;)r.push(e),e=e.parent;for(;e=r.pop();)e.updateTransform();return this.transform},t.prototype.setLocalTransform=function(e){if(e){var r=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],i=Math.atan2(e[1],e[0]),a=Math.PI/2+i-Math.atan2(e[3],e[2]);n=Math.sqrt(n)*Math.cos(a),r=Math.sqrt(r),this.skewX=a,this.skewY=0,this.rotation=-i,this.x=+e[4],this.y=+e[5],this.scaleX=r,this.scaleY=n,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,r=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||xa(),Sd(ZE,e.invTransform,r),r=ZE);var n=this.originX,i=this.originY;(n||i)&&(Jhe[4]=n,Jhe[5]=i,Sd(ZE,r,Jhe),ZE[4]-=n,ZE[5]-=i,r=ZE),this.setLocalTransform(r)}},t.prototype.getGlobalScale=function(e){var r=this.transform;return e=e||[],r?(e[0]=Math.sqrt(r[0]*r[0]+r[1]*r[1]),e[1]=Math.sqrt(r[2]*r[2]+r[3]*r[3]),r[0]<0&&(e[0]=-e[0]),r[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},t.prototype.transformCoordToLocal=function(e,r){var n=[e,r],i=this.invTransform;return i&&Ka(n,n,i),n},t.prototype.transformCoordToGlobal=function(e,r){var n=[e,r],i=this.transform;return i&&Ka(n,n,i),n},t.prototype.getLineScale=function(){var e=this.transform;return e&&ede(e[0]-1)>1e-10&&ede(e[3]-1)>1e-10?Math.sqrt(ede(e[0]*e[3]-e[2]*e[1])):1},t.prototype.copyTransform=function(e){dm(this,e)},t.getLocalTransform=function(e,r){r=r||[];var n=e.originX||0,i=e.originY||0,a=e.scaleX,s=e.scaleY,o=e.anchorX,l=e.anchorY,u=e.rotation||0,h=e.x,d=e.y,f=e.skewX?Math.tan(e.skewX):0,p=e.skewY?Math.tan(-e.skewY):0;if(n||i||o||l){var g=n+o,m=i+l;r[4]=-g*a-f*m*s,r[5]=-m*s-p*g*a}else r[4]=r[5]=0;return r[0]=a,r[3]=s,r[1]=p*a,r[2]=f*s,u&&Zv(r,r,u),r[4]+=n+h,r[5]+=i+d,r},t.initDefaultProps=function(){var e=t.prototype;e.scaleX=e.scaleY=e.globalScaleRatio=1,e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0}(),t}(),ux=hm.getLocalTransform;function JE(){return new hm}var ry=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function dm(t,e){return UZe(t,e,ry)}function fm(t){UG||(UG=new jE(100)),t=t||Hv;var e=UG.get(t);return e||(e={font:t,strWidthCache:new jE(500),asciiWidthMap:null,asciiWidthMapTried:!1,stWideCharWidth:Ho.measureText("国",t).width,asciiCharWidth:Ho.measureText("a",t).width},UG.put(t,e)),e}var UG;function zkr(t){if(!(tde>=GJe)){t=t||Hv;for(var e=[],r=+new Date,n=0;n<=127;n++)e[n]=Ho.measureText(String.fromCharCode(n),t).width;var i=+new Date-r;return i>16?tde=GJe:i>2&&tde++,e}}var tde=0,GJe=5;function HJe(t,e){return t.asciiWidthMapTried||(t.asciiWidthMap=zkr(t.font),t.asciiWidthMapTried=!0),0<=e&&e<=127?t.asciiWidthMap!=null?t.asciiWidthMap[e]:t.asciiCharWidth:t.stWideCharWidth}function pm(t,e){var r=t.strWidthCache,n=r.get(e);return n==null&&(n=Ho.measureText(e,t.font).width,r.put(e,n)),n}function WJe(t,e,r,n){var i=pm(fm(e),t),a=kN(e),s=e_(0,i,r),o=DA(0,a,n),l=new fr(s,o,i,a);return l}function VG(t,e,r,n){var i=((t||"")+"").split(` -`),a=i.length;if(a===1)return WJe(i[0],e,r,n);for(var s=new fr(0,0,0,0),o=0;o=0?parseFloat(t)/100*e:parseFloat(t):t}function QG(t,e,r){var n=e.position||"inside",i=e.distance!=null?e.distance:5,a=r.height,s=r.width,o=a/2,l=r.x,u=r.y,h="left",d="top";if(n instanceof Array)l+=gm(n[0],r.width),u+=gm(n[1],r.height),h=null,d=null;else switch(n){case"left":l-=i,u+=o,h="right",d="middle";break;case"right":l+=i+s,u+=o,d="middle";break;case"top":l+=s/2,u-=i,h="center",d="bottom";break;case"bottom":l+=s/2,u+=a+i,h="center";break;case"inside":l+=s/2,u+=o,h="center",d="middle";break;case"insideLeft":l+=i,u+=o,d="middle";break;case"insideRight":l+=s-i,u+=o,h="right",d="middle";break;case"insideTop":l+=s/2,u+=i,h="center";break;case"insideBottom":l+=s/2,u+=a-i,h="center",d="bottom";break;case"insideTopLeft":l+=i,u+=i;break;case"insideTopRight":l+=s-i,u+=i,h="right";break;case"insideBottomLeft":l+=i,u+=a-i,d="bottom";break;case"insideBottomRight":l+=s-i,u+=a-i,h="right",d="bottom";break}return t=t||{},t.x=l,t.y=u,t.align=h,t.verticalAlign=d,t}var rde="__zr_normal__",nde=ry.concat(["ignore"]),Ukr=Rf(ry,function(t,e){return t[e]=!0,t},{ignore:!1}),t_={},Vkr=new fr(0,0,0,0),GG=[],HG=0,WG=1,YG=function(){function t(e){this.id=lhe(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return t.prototype._init=function(e){this.attr(e)},t.prototype.drift=function(e,r,n){switch(this.draggable){case"horizontal":r=0;break;case"vertical":e=0;break}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=e,i[5]+=r,this.decomposeTransform(),this.markRedraw()},t.prototype.beforeUpdate=function(){},t.prototype.afterUpdate=function(){},t.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},t.prototype.updateInnerText=function(e){var r=this._textContent;if(r&&(!r.ignore||e)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,a=r.innerTransformable,s=void 0,o=void 0,l=!1;a.parent=i?this:null;var u=!1;a.copyTransform(r);var h=n.position!=null,d=n.autoOverflowArea,f=void 0;if((d||h)&&(f=Vkr,n.layoutRect?f.copy(n.layoutRect):f.copy(this.getBoundingRect()),i||f.applyTransform(this.transform)),h){this.calculateTextPosition?this.calculateTextPosition(t_,n,f):QG(t_,n,f),a.x=t_.x,a.y=t_.y,s=t_.align,o=t_.verticalAlign;var p=n.origin;if(p&&n.rotation!=null){var g=void 0,m=void 0;p==="center"?(g=f.width*.5,m=f.height*.5):(g=gm(p[0],f.width),m=gm(p[1],f.height)),u=!0,a.originX=-a.x+g+(i?0:f.x),a.originY=-a.y+m+(i?0:f.y)}}n.rotation!=null&&(a.rotation=n.rotation);var v=n.offset;v&&(a.x+=v[0],a.y+=v[1],u||(a.originX=-v[0],a.originY=-v[1]));var y=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={});if(d){var b=y.overflowRect=y.overflowRect||new fr(0,0,0,0);a.getLocalTransform(GG),Cd(GG,GG),fr.copy(b,f),b.applyTransform(GG)}else y.overflowRect=null;var x=n.inside==null?typeof n.position=="string"&&n.position.indexOf("inside")>=0:n.inside,w=void 0,A=void 0,T=void 0;x&&this.canBeInsideText()?(w=n.insideFill,A=n.insideStroke,(w==null||w==="auto")&&(w=this.getInsideTextFill()),(A==null||A==="auto")&&(A=this.getInsideTextStroke(w),T=!0)):(w=n.outsideFill,A=n.outsideStroke,(w==null||w==="auto")&&(w=this.getOutsideFill()),(A==null||A==="auto")&&(A=this.getOutsideStroke(w),T=!0)),w=w||"#000",(w!==y.fill||A!==y.stroke||T!==y.autoStroke||s!==y.align||o!==y.verticalAlign)&&(l=!0,y.fill=w,y.stroke=A,y.autoStroke=T,y.align=s,y.verticalAlign=o,r.setDefaultTextStyle(y)),r.__dirty|=Oh,l&&r.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(e){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Zhe:Khe},t.prototype.getOutsideStroke=function(e){var r=this.__zr&&this.__zr.getBackgroundColor(),n=typeof r=="string"&&Bc(r);n||(n=[255,255,255,1]);for(var i=n[3],a=this.__zr.isDarkMode(),s=0;s<3;s++)n[s]=n[s]*i+(a?0:255)*(1-i);return n[3]=1,Pf(n,"rgba")},t.prototype.traverse=function(e,r){},t.prototype.attrKV=function(e,r){e==="textConfig"?this.setTextConfig(r):e==="textContent"?this.setTextContent(r):e==="clipPath"?this.setClipPath(r):e==="extra"?(this.extra=this.extra||{},ot(this.extra,r)):this[e]=r},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(e,r){if(typeof e=="string")this.attrKV(e,r);else if(yr(e))for(var n=e,i=kn(n),a=0;a0},t.prototype.getState=function(e){return this.states[e]},t.prototype.ensureState=function(e){var r=this.states;return r[e]||(r[e]={}),r[e]},t.prototype.clearStates=function(e){this.useState(rde,!1,e)},t.prototype.useState=function(e,r,n,i){var a=e===rde,s=this.hasState();if(!(!s&&a)){var o=this.currentStates,l=this.stateTransition;if(!(Ir(o,e)>=0&&(r||o.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(e)),u||(u=this.states&&this.states[e]),!u&&!a){dG("State "+e+" not exists.");return}a||this.saveCurrentToNormalState(u);var h=this._textContent,d=qJe(this,h,u,i);d&&!this.__inHover&&(this.__inHover=d),this._applyStateObj(e,u,this._normalState,r,XJe(this,n,l),l);var f=this._textGuide;return h&&h.useState(e,r,n,!!d),f&&f.useState(e,r,n,!!d),a?(this.currentStates=[],this._normalState={}):r?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!d&&this.__inHover&&(this.__inHover=HG,this.__dirty&=~Oh),u}}},t.prototype.useStates=function(e,r,n){if(!e.length)this.clearStates();else{var i=[],a=this.currentStates,s=e.length,o=s===a.length;if(o){for(var l=0;l=0){var n=this.currentStates.slice();n.splice(r,1),this.useStates(n)}},t.prototype.replaceState=function(e,r,n){var i=this.currentStates.slice(),a=Ir(i,e),s=Ir(i,r)>=0;a>=0?s?i.splice(a,1):i[a]=r:n&&!s&&i.push(r),this.useStates(i)},t.prototype.toggleState=function(e,r){r?this.useState(e,!0):this.removeState(e)},t.prototype._mergeStates=function(e){for(var r={},n,i=0;i=0&&a.splice(s,1)}),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},t.prototype.updateDuringAnimation=function(e){this.markRedraw()},t.prototype.stopAnimation=function(e,r){for(var n=this.animators,i=n.length,a=[],s=0;s0&&r.during&&a[0].during(function(g,m){r.during(m)});for(var f=0;f0||i.force&&!s.length){var O=void 0,k=void 0,E=void 0;if(o){k={},f&&(O={});for(var w=0;w0}var pr=function(t){ha(e,t);function e(r){var n=t.call(this)||this;return n.isGroup=!0,n._children=[],n.attr(r),n}return e.prototype.childrenRef=function(){return this._children},e.prototype.children=function(){return this._children.slice()},e.prototype.childAt=function(r){return this._children[r]},e.prototype.childOfName=function(r){for(var n=this._children,i=0;i=0&&(i.splice(a,0,r),this._doAdd(r))}return this},e.prototype.replace=function(r,n){var i=Ir(this._children,r);return i>=0&&this.replaceAt(n,i),this},e.prototype.replaceAt=function(r,n){var i=this._children,a=i[n];if(r&&r!==this&&r.parent!==this&&r!==a){i[n]=r,a.parent=null;var s=this.__zr;s&&a.removeSelfFromZr(s),this._doAdd(r)}return this},e.prototype._doAdd=function(r){r.parent&&r.parent.remove(r),r.parent=this;var n=this.__zr;n&&n!==r.__zr&&r.addSelfToZr(n),n&&n.refresh()},e.prototype.remove=function(r){var n=this.__zr,i=this._children,a=Ir(i,r);return a<0?this:(i.splice(a,1),r.parent=null,n&&r.removeSelfFromZr(n),n&&n.refresh(),this)},e.prototype.removeAll=function(){for(var r=this._children,n=this.__zr,i=0;i>1)%2;o.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",n[l]+":0",i[u]+":0",n[1-l]+":auto",i[1-u]+":auto",""].join("!important;"),t.appendChild(s),r.push(s)}return e.clearMarkers=function(){de(r,function(h){h.parentNode&&h.parentNode.removeChild(h)})},r}function BOr(t,e,r){for(var n=r?"invTrans":"trans",i=e[n],a=e.srcCoords,s=[],o=[],l=!0,u=0;u<4;u++){var h=t[u].getBoundingClientRect(),d=2*u,f=h.left,p=h.top;s.push(f,p),l=l&&a&&f===a[d]&&p===a[d+1],o.push(t[u].offsetLeft,t[u].offsetTop)}return l&&i?i:(e.srcCoords=s,e[n]=r?qZe(o,s):qZe(s,o))}function jZe(t){return t.nodeName.toUpperCase()==="CANVAS"}var $Or=/([&<>"'])/g,FOr={"&":"&","<":"<",">":">",'"':""","'":"'"};function Nc(t){return t==null?"":(t+"").replace($Or,function(e,r){return FOr[r]})}var zOr=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,yhe=[],UOr=Rn.browser.firefox&&+Rn.browser.version.split(".")[0]<39;function bhe(t,e,r,n){return r=r||{},n?XZe(t,e,r):UOr&&e.layerX!=null&&e.layerX!==e.offsetX?(r.zrX=e.layerX,r.zrY=e.layerY):e.offsetX!=null?(r.zrX=e.offsetX,r.zrY=e.offsetY):XZe(t,e,r),r}function XZe(t,e,r){if(Rn.domSupported&&t.getBoundingClientRect){var n=e.clientX,i=e.clientY;if(jZe(t)){var a=t.getBoundingClientRect();r.zrX=n-a.left,r.zrY=i-a.top;return}else if(vhe(yhe,t,n,i)){r.zrX=yhe[0],r.zrY=yhe[1];return}}r.zrX=r.zrY=0}function xhe(t){return t||window.event}function Lf(t,e,r){if(e=xhe(e),e.zrX!=null)return e;var n=e.type,i=n&&n.indexOf("touch")>=0;if(i){var s=n!=="touchend"?e.targetTouches[0]:e.changedTouches[0];s&&bhe(t,s,e,r)}else{bhe(t,e,e,r);var a=VOr(e);e.zrDelta=a?a/120:-(e.detail||0)/3}var o=e.button;return e.which==null&&o!==void 0&&zOr.test(e.type)&&(e.which=o&1?1:o&2?3:o&4?2:0),e}function VOr(t){var e=t.wheelDelta;if(e)return e;var r=t.deltaX,n=t.deltaY;if(r==null||n==null)return e;var i=Math.abs(n!==0?n:r),a=n>0?-1:n<0?1:r>0?-1:1;return 3*i*a}function whe(t,e,r,n){t.addEventListener(e,r,n)}function QOr(t,e,r,n){t.removeEventListener(e,r,n)}var Kv=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0};function KZe(t){return t.which===2||t.which===3}var GOr=function(){function t(){this._track=[]}return t.prototype.recognize=function(e,r,n){return this._doTrack(e,r,n),this._recognize(e)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(e,r,n){var i=e.touches;if(i){for(var a={points:[],touches:[],target:r,event:e},s=0,o=i.length;s1&&n&&n.length>1){var a=ZZe(n)/ZZe(i);!isFinite(a)&&(a=1),e.pinchScale=a;var s=HOr(n);return e.pinchX=s[0],e.pinchY=s[1],{type:"pinch",target:t[0].target,event:e}}}}};function xa(){return[1,0,0,1,0,0]}function SA(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function ix(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Td(t,e,r){var n=e[0]*r[0]+e[2]*r[1],i=e[1]*r[0]+e[3]*r[1],a=e[0]*r[2]+e[2]*r[3],s=e[1]*r[2]+e[3]*r[3],o=e[0]*r[4]+e[2]*r[5]+e[4],l=e[1]*r[4]+e[3]*r[5]+e[5];return t[0]=n,t[1]=i,t[2]=a,t[3]=s,t[4]=o,t[5]=l,t}function zp(t,e,r){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+r[0],t[5]=e[5]+r[1],t}function Zv(t,e,r,n){n===void 0&&(n=[0,0]);var i=e[0],a=e[2],s=e[4],o=e[1],l=e[3],u=e[5],h=Math.sin(r),d=Math.cos(r);return t[0]=i*d+o*h,t[1]=-i*h+o*d,t[2]=a*d+l*h,t[3]=-a*h+d*l,t[4]=d*(s-n[0])+h*(u-n[1])+n[0],t[5]=d*(u-n[1])-h*(s-n[0])+n[1],t}function bG(t,e,r){var n=r[0],i=r[1];return t[0]=e[0]*n,t[1]=e[1]*i,t[2]=e[2]*n,t[3]=e[3]*i,t[4]=e[4]*n,t[5]=e[5]*i,t}function Cd(t,e){var r=e[0],n=e[2],i=e[4],a=e[1],s=e[3],o=e[5],l=r*s-a*n;return l?(l=1/l,t[0]=s*l,t[1]=-a*l,t[2]=-n*l,t[3]=r*l,t[4]=(n*o-s*i)*l,t[5]=(a*i-r*o)*l,t):null}function JZe(t){var e=xa();return ix(e,t),e}const WOr=Object.freeze(Object.defineProperty({__proto__:null,clone:JZe,copy:ix,create:xa,identity:SA,invert:Cd,mul:Td,rotate:Zv,scale:bG,translate:zp},Symbol.toStringTag,{value:"Module"}));var wr=function(){function t(e,r){this.x=e||0,this.y=r||0}return t.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(e,r){return this.x=e,this.y=r,this},t.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},t.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},t.prototype.scale=function(e){this.x*=e,this.y*=e},t.prototype.scaleAndAdd=function(e,r){this.x+=e.x*r,this.y+=e.y*r},t.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},t.prototype.dot=function(e){return this.x*e.x+this.y*e.y},t.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},t.prototype.distance=function(e){var r=this.x-e.x,n=this.y-e.y;return Math.sqrt(r*r+n*n)},t.prototype.distanceSquare=function(e){var r=this.x-e.x,n=this.y-e.y;return r*r+n*n},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(e){if(e){var r=this.x,n=this.y;return this.x=e[0]*r+e[2]*n+e[4],this.y=e[1]*r+e[3]*n+e[5],this}},t.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},t.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},t.set=function(e,r,n){e.x=r,e.y=n},t.copy=function(e,r){e.x=r.x,e.y=r.y},t.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},t.lenSquare=function(e){return e.x*e.x+e.y*e.y},t.dot=function(e,r){return e.x*r.x+e.y*r.y},t.add=function(e,r,n){e.x=r.x+n.x,e.y=r.y+n.y},t.sub=function(e,r,n){e.x=r.x-n.x,e.y=r.y-n.y},t.scale=function(e,r,n){e.x=r.x*n,e.y=r.y*n},t.scaleAndAdd=function(e,r,n,i){e.x=r.x+n.x*i,e.y=r.y+n.y*i},t.lerp=function(e,r,n,i){var a=1-i;e.x=a*r.x+i*n.x,e.y=a*r.y+i*n.y},t}(),TA=Math.min,HE=Math.max,She=Math.abs,eJe=["x","y"],YOr=["width","height"],CA=new wr,OA=new wr,kA=new wr,EA=new wr,Od=iJe(),dN=Od.minTv,The=Od.maxTv,fN=[0,0],fr=function(){function t(e,r,n,i){Che(this,e,r,n,i)}return t.set=function(e,r,n,i,a){return i<0&&(r=r+i,i=-i),a<0&&(n=n+a,a=-a),e.x=r,e.y=n,e.width=i,e.height=a,e},t.prototype.union=function(e){var r=TA(e.x,this.x),n=TA(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=HE(e.x+e.width,this.x+this.width)-r:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=HE(e.y+e.height,this.y+this.height)-n:this.height=e.height,this.x=r,this.y=n},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(e){return tJe(xa(),this,e)},t.prototype.intersect=function(e,r,n){return t.intersect(this,e,r,n)},t.intersect=function(e,r,n,i){n&&wr.set(n,0,0);var a=i&&i.outIntersectRect||null,s=i&&i.clamp;if(a&&(a.x=a.y=a.width=a.height=NaN),!e||!r)return!1;e instanceof t||(e=Che(jOr,e.x,e.y,e.width,e.height)),r instanceof t||(r=Che(XOr,r.x,r.y,r.width,r.height));var o=!!n;Od.reset(i,o);var l=Od.touchThreshold,u=e.x+l,h=e.x+e.width-l,d=e.y+l,f=e.y+e.height-l,p=r.x+l,g=r.x+r.width-l,m=r.y+l,v=r.y+r.height-l;if(u>h||d>f||p>g||m>v)return!1;var y=!(h=e.x&&r<=e.x+e.width&&n>=e.y&&n<=e.y+e.height},t.prototype.contain=function(e,r){return t.contain(this,e,r)},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){WE(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return this.width===0||this.height===0},t.create=function(e){return new t(e?e.x:0,e?e.y:0,e?e.width:0,e?e.height:0)},t.copy=function(e,r){return e.x=r.x,e.y=r.y,e.width=r.width,e.height=r.height,e},t.applyTransform=function(e,r,n){if(!n){e!==r&&WE(e,r);return}if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var i=n[0],a=n[3],s=n[4],o=n[5];e.x=r.x*i+s,e.y=r.y*a+o,e.width=r.width*i,e.height=r.height*a,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height);return}CA.x=kA.x=r.x,CA.y=EA.y=r.y,OA.x=EA.x=r.x+r.width,OA.y=kA.y=r.y+r.height,CA.transform(n),EA.transform(n),OA.transform(n),kA.transform(n),e.x=TA(CA.x,OA.x,kA.x,EA.x),e.y=TA(CA.y,OA.y,kA.y,EA.y);var l=HE(CA.x,OA.x,kA.x,EA.x),u=HE(CA.y,OA.y,kA.y,EA.y);e.width=l-e.x,e.height=u-e.y},t.calculateTransform=function(e,r,n){var i=n.width/r.width,a=n.height/r.height;return e=SA(e||[]),zp(e,e,Yv(Ohe,-r.x,-r.y)),bG(e,e,Yv(Ohe,i,a)),zp(e,e,Yv(Ohe,n.x,n.y)),e},t}(),xG=fr.create,Che=fr.set,WE=fr.copy,tJe=fr.calculateTransform,rJe=fr.applyTransform,qOr=fr.contain,jOr=new fr(0,0,0,0),XOr=new fr(0,0,0,0),Ohe=[];function nJe(t,e,r,n,i,a,s,o){var l=She(e-r),u=She(n-t),h=TA(l,u),d=eJe[i],f=eJe[1-i],p=YOr[i];e=u||!Od.bidirectional)&&(dN[d]=-u,dN[f]=0,Od.useDir&&Od.calcDirMTV())))}function iJe(){var t=0,e=new wr,r=new wr,n={minTv:new wr,maxTv:new wr,useDir:!1,dirMinTv:new wr,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(a,s){n.touchThreshold=0,a&&a.touchThreshold!=null&&(n.touchThreshold=HE(0,a.touchThreshold)),n.negativeSize=!1,s&&(n.minTv.set(1/0,1/0),n.maxTv.set(0,0),n.useDir=!1,a&&a.direction!=null&&(n.useDir=!0,n.dirMinTv.copy(n.minTv),r.copy(n.minTv),t=a.direction,n.bidirectional=a.bidirectional==null||!!a.bidirectional,n.bidirectional||e.set(Math.cos(t),Math.sin(t))))},calcDirMTV:function(){var a=n.minTv,s=n.dirMinTv,o=a.y*a.y+a.x*a.x,l=Math.sin(t),u=Math.cos(t),h=l*a.y+u*a.x;if(i(h)){i(a.x)&&i(a.y)&&s.set(0,0);return}if(r.x=o*u/h,r.y=o*l/h,i(r.x)&&i(r.y)){s.set(0,0);return}(n.bidirectional||e.dot(r)>0)&&r.len()=0;d--){var f=a[d];f!==i&&!f.ignore&&!f.ignoreCoarsePointer&&(!f.parent||!f.parent.ignoreCoarsePointer)&&(khe.copy(f.getBoundingRect()),f.transform&&khe.applyTransform(f.transform),khe.intersect(h)&&o.push(f))}if(o.length)for(var p=4,g=Math.PI/12,m=Math.PI*2,v=0;v4)return;this._downPoint=null}this.dispatchToElement(a,t,e)}});function tkr(t,e,r){if(t[t.rectHover?"rectContain":"contain"](e,r)){for(var n=t,i=void 0,a=!1;n;){if(n.ignoreClip&&(a=!0),!a){var s=n.getClipPath();if(s&&!s.contain(e,r))return!1}n.silent&&(i=!0);var o=n.__hostTarget;n=o?n.ignoreHostSilent?null:o:n.parent}return i?aJe:!0}return!1}function oJe(t,e,r,n,i){for(var a=t.length-1;a>=0;a--){var s=t[a],o=void 0;if(s!==i&&!s.ignore&&(o=tkr(s,r,n))&&(!e.topTarget&&(e.topTarget=s),o!==aJe)){e.target=s;break}}}function lJe(t,e,r){var n=t.painter;return e<0||e>n.getWidth()||r<0||r>n.getHeight()}var cJe=32,gN=7;function rkr(t){for(var e=0;t>=cJe;)e|=t&1,t>>=1;return t+e}function uJe(t,e,r,n){var i=e+1;if(i===r)return 1;if(n(t[i++],t[e])<0){for(;i=0;)i++;return i-e}function nkr(t,e,r){for(r--;e>>1,i(a,t[l])<0?o=l:s=l+1;var u=n-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;u>0;)t[s+u]=t[s+u-1],u--}t[s]=a}}function Ehe(t,e,r,n,i,a){var s=0,o=0,l=1;if(a(t,e[r+i])>0){for(o=n-i;l0;)s=l,l=(l<<1)+1,l<=0&&(l=o);l>o&&(l=o),s+=i,l+=i}else{for(o=i+1;lo&&(l=o);var u=s;s=i-l,l=i-u}for(s++;s>>1);a(t,e[r+h])>0?s=h+1:l=h}return l}function _he(t,e,r,n,i,a){var s=0,o=0,l=1;if(a(t,e[r+i])<0){for(o=i+1;lo&&(l=o);var u=s;s=i-l,l=i-u}else{for(o=n-i;l=0;)s=l,l=(l<<1)+1,l<=0&&(l=o);l>o&&(l=o),s+=i,l+=i}for(s++;s>>1);a(t,e[r+h])<0?l=h:s=h+1}return l}function ikr(t,e){var r=gN,n,i,a=0,s=[];n=[],i=[];function o(p,g){n[a]=p,i[a]=g,a+=1}function l(){for(;a>1;){var p=a-2;if(p>=1&&i[p-1]<=i[p]+i[p+1]||p>=2&&i[p-2]<=i[p]+i[p-1])i[p-1]i[p+1])break;h(p)}}function u(){for(;a>1;){var p=a-2;p>0&&i[p-1]=gN||T>=gN);if(O)break;A<0&&(A=0),A+=2}if(r=A,r<1&&(r=1),g===1){for(y=0;y=0;y--)t[S+y]=t[A+y];t[w]=s[x];return}for(var T=r;;){var O=0,k=0,E=!1;do if(e(s[x],t[b])<0){if(t[w--]=t[b--],O++,k=0,--g===0){E=!0;break}}else if(t[w--]=s[x--],k++,O=0,--v===1){E=!0;break}while((O|k)=0;y--)t[S+y]=t[A+y];if(g===0){E=!0;break}}if(t[w--]=s[x--],--v===1){E=!0;break}if(k=v-Ehe(t[b],s,0,v,v-1,e),k!==0){for(w-=k,x-=k,v-=k,S=w+1,A=x+1,y=0;y=gN||k>=gN);if(E)break;T<0&&(T=0),T+=2}if(r=T,r<1&&(r=1),v===1){for(w-=g,b-=g,S=w+1,A=b+1,y=g-1;y>=0;y--)t[S+y]=t[A+y];t[w]=s[x]}else{if(v===0)throw new Error;for(A=w-(v-1),y=0;yo&&(l=o),hJe(t,r,r+l,r+a,e),a=l}s.pushRun(r,a),s.mergeRuns(),i-=a,r+=a}while(i!==0);s.forceMergeRuns()}}var Oh=1,mN=2,YE=4,dJe=!1;function Rhe(){dJe||(dJe=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function fJe(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var akr=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=fJe}return t.prototype.traverse=function(e,r){for(var n=0;n=0&&this._roots.splice(i,1)},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t}(),AG;AG=Rn.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)};var vN={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return .5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return t===0?0:Math.pow(1024,t-1)},exponentialOut:function(t){return t===1?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return t===0?0:t===1?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(2,-10*(t-1))+2)},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,r=.1,n=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=n/4):e=n*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)))},elasticOut:function(t){var e,r=.1,n=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=n/4):e=n*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},elasticInOut:function(t){var e,r=.1,n=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=n/4):e=n*Math.asin(1/r)/(2*Math.PI),(t*=2)<1?-.5*(r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)):r*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?.5*(t*t*((e+1)*t-e)):.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-vN.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?vN.bounceIn(t*2)*.5:vN.bounceOut(t*2-1)*.5+.5}},SG=Math.pow,ax=Math.sqrt,TG=1e-8,pJe=1e-4,gJe=ax(3),CG=1/3,um=tx(),Mf=tx(),qE=tx();function sx(t){return t>-TG&&tTG||t<-TG}function Wo(t,e,r,n,i){var a=1-i;return a*a*(a*t+3*i*e)+i*i*(i*n+3*a*r)}function vJe(t,e,r,n,i){var a=1-i;return 3*(((e-t)*a+2*(r-e)*i)*a+(n-r)*i*i)}function OG(t,e,r,n,i,a){var s=n+3*(e-r)-t,o=3*(r-e*2+t),l=3*(e-t),u=t-i,h=o*o-3*s*l,d=o*l-9*s*u,f=l*l-3*o*u,p=0;if(sx(h)&&sx(d))if(sx(o))a[0]=0;else{var g=-l/o;g>=0&&g<=1&&(a[p++]=g)}else{var m=d*d-4*h*f;if(sx(m)){var v=d/h,g=-o/s+v,y=-v/2;g>=0&&g<=1&&(a[p++]=g),y>=0&&y<=1&&(a[p++]=y)}else if(m>0){var b=ax(m),x=h*o+1.5*s*(-d+b),w=h*o+1.5*s*(-d-b);x<0?x=-SG(-x,CG):x=SG(x,CG),w<0?w=-SG(-w,CG):w=SG(w,CG);var g=(-o-(x+w))/(3*s);g>=0&&g<=1&&(a[p++]=g)}else{var A=(2*h*o-3*s*d)/(2*ax(h*h*h)),S=Math.acos(A)/3,T=ax(h),O=Math.cos(S),g=(-o-2*T*O)/(3*s),y=(-o+T*(O+gJe*Math.sin(S)))/(3*s),k=(-o+T*(O-gJe*Math.sin(S)))/(3*s);g>=0&&g<=1&&(a[p++]=g),y>=0&&y<=1&&(a[p++]=y),k>=0&&k<=1&&(a[p++]=k)}}return p}function yJe(t,e,r,n,i){var a=6*r-12*e+6*t,s=9*e+3*n-3*t-9*r,o=3*e-3*t,l=0;if(sx(s)){if(mJe(a)){var u=-o/a;u>=0&&u<=1&&(i[l++]=u)}}else{var h=a*a-4*s*o;if(sx(h))i[0]=-a/(2*s);else if(h>0){var d=ax(h),u=(-a+d)/(2*s),f=(-a-d)/(2*s);u>=0&&u<=1&&(i[l++]=u),f>=0&&f<=1&&(i[l++]=f)}}return l}function ox(t,e,r,n,i,a){var s=(e-t)*i+t,o=(r-e)*i+e,l=(n-r)*i+r,u=(o-s)*i+s,h=(l-o)*i+o,d=(h-u)*i+u;a[0]=t,a[1]=s,a[2]=u,a[3]=d,a[4]=d,a[5]=h,a[6]=l,a[7]=n}function bJe(t,e,r,n,i,a,s,o,l,u,h){var d,f=.005,p=1/0,g,m,v,y;um[0]=l,um[1]=u;for(var b=0;b<1;b+=.05)Mf[0]=Wo(t,r,i,s,b),Mf[1]=Wo(e,n,a,o,b),v=nx(um,Mf),v=0&&v=0&&u<=1&&(i[l++]=u)}}else{var h=s*s-4*a*o;if(sx(h)){var u=-s/(2*a);u>=0&&u<=1&&(i[l++]=u)}else if(h>0){var d=ax(h),u=(-s+d)/(2*a),f=(-s-d)/(2*a);u>=0&&u<=1&&(i[l++]=u),f>=0&&f<=1&&(i[l++]=f)}}return l}function xJe(t,e,r){var n=t+r-2*e;return n===0?.5:(t-e)/n}function yN(t,e,r,n,i){var a=(e-t)*n+t,s=(r-e)*n+e,o=(s-a)*n+a;i[0]=t,i[1]=a,i[2]=o,i[3]=o,i[4]=s,i[5]=r}function wJe(t,e,r,n,i,a,s,o,l){var u,h=.005,d=1/0;um[0]=s,um[1]=o;for(var f=0;f<1;f+=.05){Mf[0]=bl(t,r,i,f),Mf[1]=bl(e,n,a,f);var p=nx(um,Mf);p=0&&p=1?1:OG(0,n,a,1,l,o)&&Wo(0,i,s,1,o[0])}}}var ukr=function(){function t(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||Xa,this.ondestroy=e.ondestroy||Xa,this.onrestart=e.onrestart||Xa,e.easing&&this.setEasing(e.easing)}return t.prototype.step=function(e,r){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),this._paused){this._pausedTime+=r;return}var n=this._life,i=e-this._startTime-this._pausedTime,a=i/n;a<0&&(a=0),a=Math.min(a,1);var s=this.easingFunc,o=s?s(a):a;if(this.onframe(o),a===1)if(this.loop){var l=i%n;this._startTime=e-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(e){this.easing=e,this.easingFunc=ur(e)?e:vN[e]||Lhe(e)},t}(),AJe=function(){function t(e){this.value=e}return t}(),hkr=function(){function t(){this._len=0}return t.prototype.insert=function(e){var r=new AJe(e);return this.insertEntry(r),r},t.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},t.prototype.remove=function(e){var r=e.prev,n=e.next;r?r.next=n:this.head=n,n?n.prev=r:this.tail=r,e.next=e.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t}(),jE=function(){function t(e){this._list=new hkr,this._maxSize=10,this._map={},this._maxSize=e}return t.prototype.put=function(e,r){var n=this._list,i=this._map,a=null;if(i[e]==null){var s=n.len(),o=this._lastRemovedEntry;if(s>=this._maxSize&&s>0){var l=n.head;n.remove(l),delete i[l.key],a=l.value,this._lastRemovedEntry=l}o?o.value=r:o=new AJe(r),o.key=e,n.insertEntry(o),i[e]=o}return a},t.prototype.get=function(e){var r=this._map[e],n=this._list;if(r!=null)return r!==n.tail&&(n.remove(r),n.insertEntry(r)),r.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}(),SJe={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Up(t){return t=Math.round(t),t<0?0:t>255?255:t}function dkr(t){return t=Math.round(t),t<0?0:t>360?360:t}function bN(t){return t<0?0:t>1?1:t}function kG(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?Up(parseFloat(e)/100*255):Up(parseInt(e,10))}function Jv(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?bN(parseFloat(e)/100):bN(parseFloat(e))}function Mhe(t,e,r){return r<0?r+=1:r>1&&(r-=1),r*6<1?t+(e-t)*r*6:r*2<1?e:r*3<2?t+(e-t)*(2/3-r)*6:t}function lx(t,e,r){return t+(e-t)*r}function If(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function Ihe(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var TJe=new jE(20),EG=null;function XE(t,e){EG&&Ihe(EG,e),EG=TJe.put(t,EG||e.slice())}function Bc(t,e){if(t){e=e||[];var r=TJe.get(t);if(r)return Ihe(e,r);t=t+"";var n=t.replace(/ /g,"").toLowerCase();if(n in SJe)return Ihe(e,SJe[n]),XE(t,e),e;var i=n.length;if(n.charAt(0)==="#"){if(i===4||i===5){var a=parseInt(n.slice(1,4),16);if(!(a>=0&&a<=4095)){If(e,0,0,0,1);return}return If(e,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,i===5?parseInt(n.slice(4),16)/15:1),XE(t,e),e}else if(i===7||i===9){var a=parseInt(n.slice(1,7),16);if(!(a>=0&&a<=16777215)){If(e,0,0,0,1);return}return If(e,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(n.slice(7),16)/255:1),XE(t,e),e}return}var s=n.indexOf("("),o=n.indexOf(")");if(s!==-1&&o+1===i){var l=n.substr(0,s),u=n.substr(s+1,o-(s+1)).split(","),h=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?If(e,+u[0],+u[1],+u[2],1):If(e,0,0,0,1);h=Jv(u.pop());case"rgb":if(u.length>=3)return If(e,kG(u[0]),kG(u[1]),kG(u[2]),u.length===3?h:Jv(u[3])),XE(t,e),e;If(e,0,0,0,1);return;case"hsla":if(u.length!==4){If(e,0,0,0,1);return}return u[3]=Jv(u[3]),Phe(u,e),XE(t,e),e;case"hsl":if(u.length!==3){If(e,0,0,0,1);return}return Phe(u,e),XE(t,e),e;default:return}}If(e,0,0,0,1)}}function Phe(t,e){var r=(parseFloat(t[0])%360+360)%360/360,n=Jv(t[1]),i=Jv(t[2]),a=i<=.5?i*(n+1):i+n-i*n,s=i*2-a;return e=e||[],If(e,Up(Mhe(s,a,r+1/3)*255),Up(Mhe(s,a,r)*255),Up(Mhe(s,a,r-1/3)*255),1),t.length===4&&(e[3]=t[3]),e}function fkr(t){if(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(e,r,n),a=Math.max(e,r,n),s=a-i,o=(a+i)/2,l,u;if(s===0)l=0,u=0;else{o<.5?u=s/(a+i):u=s/(2-a-i);var h=((a-e)/6+s/2)/s,d=((a-r)/6+s/2)/s,f=((a-n)/6+s/2)/s;e===a?l=f-d:r===a?l=1/3+h-f:n===a&&(l=2/3+d-h),l<0&&(l+=1),l>1&&(l-=1)}var p=[l*360,u,o];return t[3]!=null&&p.push(t[3]),p}}function _G(t,e){var r=Bc(t);if(r){for(var n=0;n<3;n++)e<0?r[n]=r[n]*(1-e)|0:r[n]=(255-r[n])*e+r[n]|0,r[n]>255?r[n]=255:r[n]<0&&(r[n]=0);return Pf(r,r.length===4?"rgba":"rgb")}}function pkr(t){var e=Bc(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function xN(t,e,r){if(!(!(e&&e.length)||!(t>=0&&t<=1))){r=r||[];var n=t*(e.length-1),i=Math.floor(n),a=Math.ceil(n),s=e[i],o=e[a],l=n-i;return r[0]=Up(lx(s[0],o[0],l)),r[1]=Up(lx(s[1],o[1],l)),r[2]=Up(lx(s[2],o[2],l)),r[3]=bN(lx(s[3],o[3],l)),r}}var gkr=xN;function Nhe(t,e,r){if(!(!(e&&e.length)||!(t>=0&&t<=1))){var n=t*(e.length-1),i=Math.floor(n),a=Math.ceil(n),s=Bc(e[i]),o=Bc(e[a]),l=n-i,u=Pf([Up(lx(s[0],o[0],l)),Up(lx(s[1],o[1],l)),Up(lx(s[2],o[2],l)),bN(lx(s[3],o[3],l))],"rgba");return r?{color:u,leftIndex:i,rightIndex:a,value:n}:u}}var mkr=Nhe;function ey(t,e,r,n){var i=Bc(t);if(t)return i=fkr(i),e!=null&&(i[0]=dkr(ur(e)?e(i[0]):e)),r!=null&&(i[1]=Jv(ur(r)?r(i[1]):r)),n!=null&&(i[2]=Jv(ur(n)?n(i[2]):n)),Pf(Phe(i),"rgba")}function wN(t,e){var r=Bc(t);if(r&&e!=null)return r[3]=bN(e),Pf(r,"rgba")}function Pf(t,e){if(!(!t||!t.length)){var r=t[0]+","+t[1]+","+t[2];return(e==="rgba"||e==="hsva"||e==="hsla")&&(r+=","+t[3]),e+"("+r+")"}}function AN(t,e){var r=Bc(t);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*e:0}function vkr(){return Pf([Math.round(Math.random()*255),Math.round(Math.random()*255),Math.round(Math.random()*255)],"rgb")}var CJe=new jE(100);function RG(t){if(Nt(t)){var e=CJe.get(t);return e||(e=_G(t,-.1),CJe.put(t,e)),e}else if(iN(t)){var r=ot({},t);return r.colorStops=vt(t.colorStops,function(n){return{offset:n.offset,color:_G(n.color,-.1)}}),r}return t}const ykr=Object.freeze(Object.defineProperty({__proto__:null,fastLerp:xN,fastMapToColor:gkr,lerp:Nhe,lift:_G,liftColor:RG,lum:AN,mapToColor:mkr,modifyAlpha:wN,modifyHSL:ey,parse:Bc,parseCssFloat:Jv,parseCssInt:kG,random:vkr,stringify:Pf,toHex:pkr},Symbol.toStringTag,{value:"Module"}));var DG=Math.round;function SN(t){var e;if(!t||t==="transparent")t="none";else if(typeof t=="string"&&t.indexOf("rgba")>-1){var r=Bc(t);r&&(t="rgb("+r[0]+","+r[1]+","+r[2]+")",e=r[3])}return{color:t,opacity:e??1}}var OJe=1e-4;function cx(t){return t-OJe}function LG(t){return DG(t*1e3)/1e3}function Bhe(t){return DG(t*1e4)/1e4}function bkr(t){return"matrix("+LG(t[0])+","+LG(t[1])+","+LG(t[2])+","+LG(t[3])+","+Bhe(t[4])+","+Bhe(t[5])+")"}var xkr={left:"start",right:"end",center:"middle",middle:"middle"};function wkr(t,e,r){return r==="top"?t+=e/2:r==="bottom"&&(t-=e/2),t}function Akr(t){return t&&(t.shadowBlur||t.shadowOffsetX||t.shadowOffsetY)}function Skr(t){var e=t.style,r=t.getGlobalScale();return[e.shadowColor,(e.shadowBlur||0).toFixed(2),(e.shadowOffsetX||0).toFixed(2),(e.shadowOffsetY||0).toFixed(2),r[0],r[1]].join(",")}function kJe(t){return t&&!!t.image}function Tkr(t){return t&&!!t.svgElement}function $he(t){return kJe(t)||Tkr(t)}function EJe(t){return t.type==="linear"}function _Je(t){return t.type==="radial"}function RJe(t){return t&&(t.type==="linear"||t.type==="radial")}function MG(t){return"url(#"+t+")"}function DJe(t){var e=t.getGlobalScale(),r=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(r)/Math.log(10)),1)}function LJe(t){var e=t.x||0,r=t.y||0,n=(t.rotation||0)*lN,i=Jt(t.scaleX,1),a=Jt(t.scaleY,1),s=t.skewX||0,o=t.skewY||0,l=[];return(e||r)&&l.push("translate("+e+"px,"+r+"px)"),n&&l.push("rotate("+n+")"),(i!==1||a!==1)&&l.push("scale("+i+","+a+")"),(s||o)&&l.push("skew("+DG(s*lN)+"deg, "+DG(o*lN)+"deg)"),l.join(" ")}var Ckr=function(){return typeof Buffer<"u"&&typeof Buffer.from=="function"?function(t){return Buffer.from(t).toString("base64")}:typeof btoa=="function"&&typeof unescape=="function"&&typeof encodeURIComponent=="function"?function(t){return btoa(unescape(encodeURIComponent(t)))}:function(t){return null}}(),Fhe=Array.prototype.slice;function ty(t,e,r){return(e-t)*r+t}function zhe(t,e,r,n){for(var i=e.length,a=0;an?e:t,a=Math.min(r,n),s=i[a-1]||{color:[0,0,0,0],offset:0},o=a;os;if(o)n.length=s;else for(var l=a;l=1},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(e,r,n){this._needsSort=!0;var i=this.keyframes,a=i.length,s=!1,o=PJe,l=r;if(Zl(r)){var u=_kr(r);o=u,(u===1&&!zn(r[0])||u===2&&!zn(r[0][0]))&&(s=!0)}else if(zn(r)&&!Jl(r))o=NG;else if(Nt(r))if(!isNaN(+r))o=NG;else{var h=Bc(r);h&&(l=h,o=CN)}else if(iN(r)){var d=ot({},l);d.colorStops=vt(r.colorStops,function(p){return{offset:p.offset,color:Bc(p.color)}}),EJe(r)?o=Uhe:_Je(r)&&(o=Vhe),l=d}a===0?this.valType=o:(o!==this.valType||o===PJe)&&(s=!0),this.discrete=this.discrete||s;var f={time:e,value:l,rawValue:r,percent:0};return n&&(f.easing=n,f.easingFunc=ur(n)?n:vN[n]||Lhe(n)),i.push(f),f},t.prototype.prepare=function(e,r){var n=this.keyframes;this._needsSort&&n.sort(function(m,v){return m.time-v.time});for(var i=this.valType,a=n.length,s=n[a-1],o=this.discrete,l=$G(i),u=NJe(i),h=0;h=0&&!(s[h].percent<=r);h--);h=f(h,o-2)}else{for(h=d;hr);h++);h=f(h-1,o-2)}g=s[h+1],p=s[h]}if(p&&g){this._lastFr=h,this._lastFrP=r;var v=g.percent-p.percent,y=v===0?1:f((r-p.percent)/v,1);g.easingFunc&&(y=g.easingFunc(y));var b=n?this._additiveValue:u?ON:e[l];if(($G(a)||u)&&!b&&(b=this._additiveValue=[]),this.discrete)e[l]=y<1?p.rawValue:g.rawValue;else if($G(a))a===BG?zhe(b,p[i],g[i],y):Okr(b,p[i],g[i],y);else if(NJe(a)){var x=p[i],w=g[i],A=a===Uhe;e[l]={type:A?"linear":"radial",x:ty(x.x,w.x,y),y:ty(x.y,w.y,y),colorStops:vt(x.colorStops,function(T,O){var k=w.colorStops[O];return{offset:ty(T.offset,k.offset,y),color:PG(zhe([],T.color,k.color,y))}}),global:w.global},A?(e[l].x2=ty(x.x2,w.x2,y),e[l].y2=ty(x.y2,w.y2,y)):e[l].r=ty(x.r,w.r,y)}else if(u)zhe(b,p[i],g[i],y),n||(e[l]=PG(b));else{var S=ty(p[i],g[i],y);n?this._additiveValue=S:e[l]=S}n&&this._addToTarget(e)}}},t.prototype._addToTarget=function(e){var r=this.valType,n=this.propName,i=this._additiveValue;r===NG?e[n]=e[n]+i:r===CN?(Bc(e[n],ON),IG(ON,ON,i,1),e[n]=PG(ON)):r===BG?IG(e[n],e[n],i,1):r===IJe&&MJe(e[n],e[n],i,1)},t}(),Qhe=function(){function t(e,r,n,i){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=r,r&&i){dG("Can' use additive animation on looped animation.");return}this._additiveAnimators=i,this._allowDiscrete=n}return t.prototype.getMaxTime=function(){return this._maxTime},t.prototype.getDelay=function(){return this._delay},t.prototype.getLoop=function(){return this._loop},t.prototype.getTarget=function(){return this._target},t.prototype.changeTarget=function(e){this._target=e},t.prototype.when=function(e,r,n){return this.whenWithKeys(e,r,kn(r),n)},t.prototype.whenWithKeys=function(e,r,n,i){for(var a=this._tracks,s=0;s0&&l.addKeyframe(0,TN(u),i),this._trackKeys.push(o)}l.addKeyframe(e,TN(r[o]),i)}return this._maxTime=Math.max(this._maxTime,e),this},t.prototype.pause=function(){this._clip.pause(),this._paused=!0},t.prototype.resume=function(){this._clip.resume(),this._paused=!1},t.prototype.isPaused=function(){return!!this._paused},t.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var r=e.length,n=0;n0)){this._started=1;for(var r=this,n=[],i=this._maxTime||0,a=0;a1){var o=s.pop();a.addKeyframe(o.time,e[i]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},t}();function KE(){return new Date().getTime()}var Dkr=function(t){ha(e,t);function e(r){var n=t.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,r=r||{},n.stage=r.stage||{},n}return e.prototype.addClip=function(r){r.animation&&this.removeClip(r),this._head?(this._tail.next=r,r.prev=this._tail,r.next=null,this._tail=r):this._head=this._tail=r,r.animation=this},e.prototype.addAnimator=function(r){r.animation=this;var n=r.getClip();n&&this.addClip(n)},e.prototype.removeClip=function(r){if(r.animation){var n=r.prev,i=r.next;n?n.next=i:this._head=i,i?i.prev=n:this._tail=n,r.next=r.prev=r.animation=null}},e.prototype.removeAnimator=function(r){var n=r.getClip();n&&this.removeClip(n),r.animation=null},e.prototype.update=function(r){for(var n=KE()-this._pausedTime,i=n-this._time,a=this._head;a;){var s=a.next,o=a.step(n,i);o&&(a.ondestroy(),this.removeClip(a)),a=s}this._time=n,r||(this.trigger("frame",i),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var r=this;this._running=!0;function n(){r._running&&(AG(n),!r._paused&&r.update())}AG(n)},e.prototype.start=function(){this._running||(this._time=KE(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=KE(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=KE()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var r=this._head;r;){var n=r.next;r.prev=r.next=r.animation=null,r=n}this._head=this._tail=null},e.prototype.isFinished=function(){return this._head==null},e.prototype.animate=function(r,n){n=n||{},this.start();var i=new Qhe(r,n.loop);return this.addAnimator(i),i},e}(Df),Lkr=300,Ghe=Rn.domSupported,Hhe=function(){var t=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],e=["touchstart","touchend","touchmove"],r={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},n=vt(t,function(i){var a=i.replace("mouse","pointer");return r.hasOwnProperty(a)?a:i});return{mouse:t,touch:e,pointer:n}}(),BJe={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},$Je=!1;function Whe(t){var e=t.pointerType;return e==="pen"||e==="touch"}function Mkr(t){t.touching=!0,t.touchTimer!=null&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout(function(){t.touching=!1,t.touchTimer=null},700)}function Yhe(t){t&&(t.zrByTouch=!0)}function Ikr(t,e){return Lf(t.dom,new Pkr(t,e),!0)}function FJe(t,e){for(var r=e,n=!1;r&&r.nodeType!==9&&!(n=r.domBelongToZr||r!==e&&r===t.painterRoot);)r=r.parentNode;return n}var Pkr=function(){function t(e,r){this.stopPropagation=Xa,this.stopImmediatePropagation=Xa,this.preventDefault=Xa,this.type=r.type,this.target=this.currentTarget=e.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return t}(),Vp={mousedown:function(t){t=Lf(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=Lf(this.dom,t);var e=this.__mayPointerCapture;e&&(t.zrX!==e[0]||t.zrY!==e[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=Lf(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){t=Lf(this.dom,t);var e=t.toElement||t.relatedTarget;FJe(this,e)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){$Je=!0,t=Lf(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){$Je||(t=Lf(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){t=Lf(this.dom,t),Yhe(t),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),Vp.mousemove.call(this,t),Vp.mousedown.call(this,t)},touchmove:function(t){t=Lf(this.dom,t),Yhe(t),this.handler.processGesture(t,"change"),Vp.mousemove.call(this,t)},touchend:function(t){t=Lf(this.dom,t),Yhe(t),this.handler.processGesture(t,"end"),Vp.mouseup.call(this,t),+new Date-+this.__lastTouchMomentQJe||t<-QJe}var RA=[],ZE=[],Jhe=xa(),ede=Math.abs,hm=function(){function t(){}return t.prototype.getLocalTransform=function(e){return ux(this,e)},t.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},t.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},t.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},t.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},t.prototype.needLocalTransform=function(){return _A(this.rotation)||_A(this.x)||_A(this.y)||_A(this.scaleX-1)||_A(this.scaleY-1)||_A(this.skewX)||_A(this.skewY)},t.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,r=this.needLocalTransform(),n=this.transform;if(!(r||e)){n&&(VJe(n),this.invTransform=null);return}n=n||xa(),r?this.getLocalTransform(n):VJe(n),e&&(r?Td(n,e,n):ix(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n),this.invTransform=this.invTransform||xa(),Cd(this.invTransform,n)},t.prototype._resolveGlobalScaleRatio=function(e){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(RA);var n=RA[0]<0?-1:1,i=RA[1]<0?-1:1,a=((RA[0]-n)*r+n)/RA[0]||0,s=((RA[1]-i)*r+i)/RA[1]||0;e[0]*=a,e[1]*=a,e[2]*=s,e[3]*=s}},t.prototype.getComputedTransform=function(){for(var e=this,r=[];e;)r.push(e),e=e.parent;for(;e=r.pop();)e.updateTransform();return this.transform},t.prototype.setLocalTransform=function(e){if(e){var r=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],i=Math.atan2(e[1],e[0]),a=Math.PI/2+i-Math.atan2(e[3],e[2]);n=Math.sqrt(n)*Math.cos(a),r=Math.sqrt(r),this.skewX=a,this.skewY=0,this.rotation=-i,this.x=+e[4],this.y=+e[5],this.scaleX=r,this.scaleY=n,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,r=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||xa(),Td(ZE,e.invTransform,r),r=ZE);var n=this.originX,i=this.originY;(n||i)&&(Jhe[4]=n,Jhe[5]=i,Td(ZE,r,Jhe),ZE[4]-=n,ZE[5]-=i,r=ZE),this.setLocalTransform(r)}},t.prototype.getGlobalScale=function(e){var r=this.transform;return e=e||[],r?(e[0]=Math.sqrt(r[0]*r[0]+r[1]*r[1]),e[1]=Math.sqrt(r[2]*r[2]+r[3]*r[3]),r[0]<0&&(e[0]=-e[0]),r[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},t.prototype.transformCoordToLocal=function(e,r){var n=[e,r],i=this.invTransform;return i&&Ka(n,n,i),n},t.prototype.transformCoordToGlobal=function(e,r){var n=[e,r],i=this.transform;return i&&Ka(n,n,i),n},t.prototype.getLineScale=function(){var e=this.transform;return e&&ede(e[0]-1)>1e-10&&ede(e[3]-1)>1e-10?Math.sqrt(ede(e[0]*e[3]-e[2]*e[1])):1},t.prototype.copyTransform=function(e){dm(this,e)},t.getLocalTransform=function(e,r){r=r||[];var n=e.originX||0,i=e.originY||0,a=e.scaleX,s=e.scaleY,o=e.anchorX,l=e.anchorY,u=e.rotation||0,h=e.x,d=e.y,f=e.skewX?Math.tan(e.skewX):0,p=e.skewY?Math.tan(-e.skewY):0;if(n||i||o||l){var g=n+o,m=i+l;r[4]=-g*a-f*m*s,r[5]=-m*s-p*g*a}else r[4]=r[5]=0;return r[0]=a,r[3]=s,r[1]=p*a,r[2]=f*s,u&&Zv(r,r,u),r[4]+=n+h,r[5]+=i+d,r},t.initDefaultProps=function(){var e=t.prototype;e.scaleX=e.scaleY=e.globalScaleRatio=1,e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0}(),t}(),ux=hm.getLocalTransform;function JE(){return new hm}var ry=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function dm(t,e){return UZe(t,e,ry)}function fm(t){UG||(UG=new jE(100)),t=t||Hv;var e=UG.get(t);return e||(e={font:t,strWidthCache:new jE(500),asciiWidthMap:null,asciiWidthMapTried:!1,stWideCharWidth:Ho.measureText("国",t).width,asciiCharWidth:Ho.measureText("a",t).width},UG.put(t,e)),e}var UG;function zkr(t){if(!(tde>=GJe)){t=t||Hv;for(var e=[],r=+new Date,n=0;n<=127;n++)e[n]=Ho.measureText(String.fromCharCode(n),t).width;var i=+new Date-r;return i>16?tde=GJe:i>2&&tde++,e}}var tde=0,GJe=5;function HJe(t,e){return t.asciiWidthMapTried||(t.asciiWidthMap=zkr(t.font),t.asciiWidthMapTried=!0),0<=e&&e<=127?t.asciiWidthMap!=null?t.asciiWidthMap[e]:t.asciiCharWidth:t.stWideCharWidth}function pm(t,e){var r=t.strWidthCache,n=r.get(e);return n==null&&(n=Ho.measureText(e,t.font).width,r.put(e,n)),n}function WJe(t,e,r,n){var i=pm(fm(e),t),a=kN(e),s=e_(0,i,r),o=DA(0,a,n),l=new fr(s,o,i,a);return l}function VG(t,e,r,n){var i=((t||"")+"").split(` +`),a=i.length;if(a===1)return WJe(i[0],e,r,n);for(var s=new fr(0,0,0,0),o=0;o=0?parseFloat(t)/100*e:parseFloat(t):t}function QG(t,e,r){var n=e.position||"inside",i=e.distance!=null?e.distance:5,a=r.height,s=r.width,o=a/2,l=r.x,u=r.y,h="left",d="top";if(n instanceof Array)l+=gm(n[0],r.width),u+=gm(n[1],r.height),h=null,d=null;else switch(n){case"left":l-=i,u+=o,h="right",d="middle";break;case"right":l+=i+s,u+=o,d="middle";break;case"top":l+=s/2,u-=i,h="center",d="bottom";break;case"bottom":l+=s/2,u+=a+i,h="center";break;case"inside":l+=s/2,u+=o,h="center",d="middle";break;case"insideLeft":l+=i,u+=o,d="middle";break;case"insideRight":l+=s-i,u+=o,h="right",d="middle";break;case"insideTop":l+=s/2,u+=i,h="center";break;case"insideBottom":l+=s/2,u+=a-i,h="center",d="bottom";break;case"insideTopLeft":l+=i,u+=i;break;case"insideTopRight":l+=s-i,u+=i,h="right";break;case"insideBottomLeft":l+=i,u+=a-i,d="bottom";break;case"insideBottomRight":l+=s-i,u+=a-i,h="right",d="bottom";break}return t=t||{},t.x=l,t.y=u,t.align=h,t.verticalAlign=d,t}var rde="__zr_normal__",nde=ry.concat(["ignore"]),Ukr=Rf(ry,function(t,e){return t[e]=!0,t},{ignore:!1}),t_={},Vkr=new fr(0,0,0,0),GG=[],HG=0,WG=1,YG=function(){function t(e){this.id=lhe(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return t.prototype._init=function(e){this.attr(e)},t.prototype.drift=function(e,r,n){switch(this.draggable){case"horizontal":r=0;break;case"vertical":e=0;break}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=e,i[5]+=r,this.decomposeTransform(),this.markRedraw()},t.prototype.beforeUpdate=function(){},t.prototype.afterUpdate=function(){},t.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},t.prototype.updateInnerText=function(e){var r=this._textContent;if(r&&(!r.ignore||e)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,a=r.innerTransformable,s=void 0,o=void 0,l=!1;a.parent=i?this:null;var u=!1;a.copyTransform(r);var h=n.position!=null,d=n.autoOverflowArea,f=void 0;if((d||h)&&(f=Vkr,n.layoutRect?f.copy(n.layoutRect):f.copy(this.getBoundingRect()),i||f.applyTransform(this.transform)),h){this.calculateTextPosition?this.calculateTextPosition(t_,n,f):QG(t_,n,f),a.x=t_.x,a.y=t_.y,s=t_.align,o=t_.verticalAlign;var p=n.origin;if(p&&n.rotation!=null){var g=void 0,m=void 0;p==="center"?(g=f.width*.5,m=f.height*.5):(g=gm(p[0],f.width),m=gm(p[1],f.height)),u=!0,a.originX=-a.x+g+(i?0:f.x),a.originY=-a.y+m+(i?0:f.y)}}n.rotation!=null&&(a.rotation=n.rotation);var v=n.offset;v&&(a.x+=v[0],a.y+=v[1],u||(a.originX=-v[0],a.originY=-v[1]));var y=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={});if(d){var b=y.overflowRect=y.overflowRect||new fr(0,0,0,0);a.getLocalTransform(GG),Cd(GG,GG),fr.copy(b,f),b.applyTransform(GG)}else y.overflowRect=null;var x=n.inside==null?typeof n.position=="string"&&n.position.indexOf("inside")>=0:n.inside,w=void 0,A=void 0,S=void 0;x&&this.canBeInsideText()?(w=n.insideFill,A=n.insideStroke,(w==null||w==="auto")&&(w=this.getInsideTextFill()),(A==null||A==="auto")&&(A=this.getInsideTextStroke(w),S=!0)):(w=n.outsideFill,A=n.outsideStroke,(w==null||w==="auto")&&(w=this.getOutsideFill()),(A==null||A==="auto")&&(A=this.getOutsideStroke(w),S=!0)),w=w||"#000",(w!==y.fill||A!==y.stroke||S!==y.autoStroke||s!==y.align||o!==y.verticalAlign)&&(l=!0,y.fill=w,y.stroke=A,y.autoStroke=S,y.align=s,y.verticalAlign=o,r.setDefaultTextStyle(y)),r.__dirty|=Oh,l&&r.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(e){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Zhe:Khe},t.prototype.getOutsideStroke=function(e){var r=this.__zr&&this.__zr.getBackgroundColor(),n=typeof r=="string"&&Bc(r);n||(n=[255,255,255,1]);for(var i=n[3],a=this.__zr.isDarkMode(),s=0;s<3;s++)n[s]=n[s]*i+(a?0:255)*(1-i);return n[3]=1,Pf(n,"rgba")},t.prototype.traverse=function(e,r){},t.prototype.attrKV=function(e,r){e==="textConfig"?this.setTextConfig(r):e==="textContent"?this.setTextContent(r):e==="clipPath"?this.setClipPath(r):e==="extra"?(this.extra=this.extra||{},ot(this.extra,r)):this[e]=r},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(e,r){if(typeof e=="string")this.attrKV(e,r);else if(yr(e))for(var n=e,i=kn(n),a=0;a0},t.prototype.getState=function(e){return this.states[e]},t.prototype.ensureState=function(e){var r=this.states;return r[e]||(r[e]={}),r[e]},t.prototype.clearStates=function(e){this.useState(rde,!1,e)},t.prototype.useState=function(e,r,n,i){var a=e===rde,s=this.hasState();if(!(!s&&a)){var o=this.currentStates,l=this.stateTransition;if(!(Ir(o,e)>=0&&(r||o.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(e)),u||(u=this.states&&this.states[e]),!u&&!a){dG("State "+e+" not exists.");return}a||this.saveCurrentToNormalState(u);var h=this._textContent,d=qJe(this,h,u,i);d&&!this.__inHover&&(this.__inHover=d),this._applyStateObj(e,u,this._normalState,r,XJe(this,n,l),l);var f=this._textGuide;return h&&h.useState(e,r,n,!!d),f&&f.useState(e,r,n,!!d),a?(this.currentStates=[],this._normalState={}):r?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!d&&this.__inHover&&(this.__inHover=HG,this.__dirty&=~Oh),u}}},t.prototype.useStates=function(e,r,n){if(!e.length)this.clearStates();else{var i=[],a=this.currentStates,s=e.length,o=s===a.length;if(o){for(var l=0;l=0){var n=this.currentStates.slice();n.splice(r,1),this.useStates(n)}},t.prototype.replaceState=function(e,r,n){var i=this.currentStates.slice(),a=Ir(i,e),s=Ir(i,r)>=0;a>=0?s?i.splice(a,1):i[a]=r:n&&!s&&i.push(r),this.useStates(i)},t.prototype.toggleState=function(e,r){r?this.useState(e,!0):this.removeState(e)},t.prototype._mergeStates=function(e){for(var r={},n,i=0;i=0&&a.splice(s,1)}),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},t.prototype.updateDuringAnimation=function(e){this.markRedraw()},t.prototype.stopAnimation=function(e,r){for(var n=this.animators,i=n.length,a=[],s=0;s0&&r.during&&a[0].during(function(g,m){r.during(m)});for(var f=0;f0||i.force&&!s.length){var O=void 0,k=void 0,E=void 0;if(o){k={},f&&(O={});for(var w=0;w0}var pr=function(t){ha(e,t);function e(r){var n=t.call(this)||this;return n.isGroup=!0,n._children=[],n.attr(r),n}return e.prototype.childrenRef=function(){return this._children},e.prototype.children=function(){return this._children.slice()},e.prototype.childAt=function(r){return this._children[r]},e.prototype.childOfName=function(r){for(var n=this._children,i=0;i=0&&(i.splice(a,0,r),this._doAdd(r))}return this},e.prototype.replace=function(r,n){var i=Ir(this._children,r);return i>=0&&this.replaceAt(n,i),this},e.prototype.replaceAt=function(r,n){var i=this._children,a=i[n];if(r&&r!==this&&r.parent!==this&&r!==a){i[n]=r,a.parent=null;var s=this.__zr;s&&a.removeSelfFromZr(s),this._doAdd(r)}return this},e.prototype._doAdd=function(r){r.parent&&r.parent.remove(r),r.parent=this;var n=this.__zr;n&&n!==r.__zr&&r.addSelfToZr(n),n&&n.refresh()},e.prototype.remove=function(r){var n=this.__zr,i=this._children,a=Ir(i,r);return a<0?this:(i.splice(a,1),r.parent=null,n&&r.removeSelfFromZr(n),n&&n.refresh(),this)},e.prototype.removeAll=function(){for(var r=this._children,n=this.__zr,i=0;i0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},t.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._disposed||this._refresh({animUpdate:!1,refresh:!1,refreshHover:!0})},t.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},t.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},t.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},t.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},t.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},t.prototype.findHover=function(e,r){if(!this._disposed)return this.handler.findHover(e,r)},t.prototype.on=function(e,r,n){return this._disposed||this.handler.on(e,r,n),this},t.prototype.off=function(e,r){this._disposed||this.handler.off(e,r)},t.prototype.trigger=function(e,r){this._disposed||this.handler.trigger(e,r)},t.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),r=0;r0){if(t<=i)return s;if(t>=a)return o}else{if(t>=i)return s;if(t<=a)return o}else{if(t===i)return s;if(t===a)return o}return(t-i)/l*u+s}var Qt=iEr;function iEr(t,e,r){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%";break}return KG(t,e,r)}function KG(t,e,r){return Nt(t)?tet(t)?parseFloat(t)/100*e+(r||0):parseFloat(t):t==null?NaN:+t}function aEr(t){return Nt(t)&&tet(t)}function tet(t){return!!rEr(t).match(/%$/)}function Gn(t,e,r){return isNaN(e)?r?""+t:+t:(e=Ai(en(0,e),jG),t=(+t).toFixed(e),r?t:+t)}function sEr(t,e,r){return e==null&&(e=10),Gn(t,e,r)}function xl(t){return t.sort(function(e,r){return e-r}),t}function vm(t){if(t=+t,isNaN(t))return 0;if(t>1e-14){for(var e=1,r=0;r<15;r++,e*=10)if(mm(t*e)/e===t)return r}return ret(t)}function ret(t){var e=t.toString().toLowerCase(),r=e.indexOf("e"),n=r>0?+e.slice(r+1):0,i=r>0?r:e.length,a=e.indexOf("."),s=a<0?0:i-1-a;return en(0,s-n)}function oEr(t,e){var r=Nf(PA(t[1]-t[0])/EN),n=mm(PA(Za(e[1]-e[0]))/EN),i=Ai(en(-r+n,0),jG);return isFinite(i)?i:jG}function lde(t,e,r){var n=Za(t[1]-t[0]);if(!isFinite(n)||n===0)return NaN;var i=PA(2*Za(r||1)*Za(n))/EN,a=PA(Za(e))/EN,s=en(0,MA(-i+a));return isFinite(s)||(s=NaN),s}function lEr(t,e,r){if(!t[e])return 0;var n=net(t,r);return n[e]||0}function net(t,e){var r=Rf(t,function(p,g){return p+(isNaN(g)?0:g)},0);if(r===0)return[];for(var n=IA(10,e),i=vt(t,function(p){return(isNaN(p)?0:p)/r*n*100}),a=n*100,s=vt(i,function(p){return Nf(p)}),o=Rf(s,function(p,g){return p+g},0),l=vt(i,function(p,g){return p-s[g]});ou&&(u=l[d],h=d);++s[h],l[h]=0,++o}return vt(s,function(p){return p/n})}function NA(t,e){var r=en(vm(t),vm(e)),n=t+e;return r>jG?n:Gn(n,r)}var _N=IA(2,53)-1;function cde(t){var e=XG*2;return(t%e+e)%e}function BA(t){return t>-eet&&t=10&&e++,e}var iet=2;function JG(t,e){var r=ZG(t),n=IA(10,r),i=t/n,a;return e===iet?a=1:e?i<1.5?a=1:i<2.5?a=2:i<4?a=3:i<7?a=5:a=10:i<1?a=1:i<2?a=2:i<3?a=3:i<5?a=5:a=10,t=a*n,Gn(t,-r)}function eH(t,e){var r=(t.length-1)*e+1,n=Nf(r),i=+t[n-1],a=r-n;return a?i+a*(t[n]-i):i}function hde(t){t.sort(function(l,u){return o(l,u,0)?-1:1});for(var e=-1/0,r=1,n=0;n0?e.length:0),this.item=null,this.key=NaN,this},t.prototype.next=function(){return(this._step>0?this._idx=this._end)?(this.item=this._list[this._idx],this.key=this._idx=this._idx+this._step,!0):!1},t}();function yde(t){t.option=t.parentModel=t.ecModel=null}function rc(){return[1/0,-1/0]}function bde(t,e){ny(e)&&(et[1]&&(t[1]=e))}function vet(t,e){ny(e)&&et[1]&&(t[1]=e)}function EEr(t,e){zA(e[0],e[1])&&(e[0]t[1]&&(t[1]=e[1]))}function ny(t){return t!=null&&isFinite(t)}function zA(t,e){return ny(t)&&ny(e)&&t<=e}function _Er(t){var e=t[1]-t[0];return isFinite(e)&&e>=0}function tH(t){zA(t[0],t[1])&&t[0]>t[1]&&(t[0]=t[1])}function a_(){var t="__ec_once_"+REr++;return function(e,r){Kt(e,t)||(e[t]=1,r())}}var REr=fde();function rH(t,e,r){var n=Yt(),i=0;de(t,function(a){var s=e(a),o=n.get(s)||0;r&&r(a,o),!o&&!r&&(t[i++]=a),n.set(s,o+1)}),r||(t.length=i)}function DEr(t){return t.value+""}function LEr(t){return t+""}function xm(t,e){return Jt(e,!0)?t.seriesIndex+2:0}function bet(t,e,r){var n=t.getData().count();return{progressiveRender:r.progressiveEnabled&&e.incrementalPrepareRender&&n>=r.threshold,large:t.get("large")&&n>=t.get("largeThreshold"),modDataCount:t.get("progressiveChunkMode")==="mod"?t.getData().count():null}}function Ao(t,e){return{seriesType:t,overallReset:e}}function LN(t){return{overallReset:t}}var MEr=".",UA="___EC__COMPONENT__CONTAINER___",xet="___EC__EXTENDED_CLASS___";function wm(t){var e={main:"",sub:""};if(t){var r=t.split(MEr);e.main=r[0]||"",e.sub=r[1]||""}return e}function IEr(t){ec(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(t),'componentType "'+t+'" illegal')}function PEr(t){return!!(t&&t[xet])}function xde(t,e){t.$constructor=t,t.extend=function(r){var n=this,i;return NEr(n)?i=function(a){rt(s,a);function s(){return a.apply(this,arguments)||this}return s}(n):(i=function(){(r.$constructor||n).apply(this,arguments)},che(i,this)),ot(i.prototype,r),i[xet]=!0,i.extend=this.extend,i.superCall=FEr,i.superApply=zEr,i.superClass=n,i}}function NEr(t){return ur(t)&&/^class\s/.test(Function.prototype.toString.call(t))}function wet(t,e){t.extend=e.extend}var BEr=Math.round(Math.random()*10);function $Er(t){var e=["__\0is_clz",BEr++].join("_");t.prototype[e]=!0,t.isInstance=function(r){return!!(r&&r[e])}}function FEr(t,e){for(var r=[],n=2;n=0||a&&Ir(a,l)<0)){var u=n.getShallow(l,e);u!=null&&(s[t[o][0]]=u)}}return s}}var UEr=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],VEr=VA(UEr),QEr=function(){function t(){}return t.prototype.getAreaStyle=function(e,r){return VEr(this,e,r)},t}(),wde=new jE(50);function GEr(t){if(typeof t=="string"){var e=wde.get(t);return e&&e.image}else return t}function Ade(t,e,r,n,i){if(t)if(typeof t=="string"){if(e&&e.__zrImageSrc===t||!r)return e;var a=wde.get(t),s={hostEl:r,cb:n,cbPayload:i};return a?(e=a.image,!iH(e)&&a.pending.push(s)):(e=Ho.loadImage(t,Aet,Aet),e.__zrImageSrc=t,wde.put(t,e.__cachedImgObj={image:e,pending:[s]})),e}else return t;else return e}function Aet(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},t.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._disposed||this._refresh({animUpdate:!1,refresh:!1,refreshHover:!0})},t.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},t.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},t.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},t.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},t.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},t.prototype.findHover=function(e,r){if(!this._disposed)return this.handler.findHover(e,r)},t.prototype.on=function(e,r,n){return this._disposed||this.handler.on(e,r,n),this},t.prototype.off=function(e,r){this._disposed||this.handler.off(e,r)},t.prototype.trigger=function(e,r){this._disposed||this.handler.trigger(e,r)},t.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),r=0;r0){if(t<=i)return s;if(t>=a)return o}else{if(t>=i)return s;if(t<=a)return o}else{if(t===i)return s;if(t===a)return o}return(t-i)/l*u+s}var Qt=iEr;function iEr(t,e,r){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%";break}return KG(t,e,r)}function KG(t,e,r){return Nt(t)?tet(t)?parseFloat(t)/100*e+(r||0):parseFloat(t):t==null?NaN:+t}function aEr(t){return Nt(t)&&tet(t)}function tet(t){return!!rEr(t).match(/%$/)}function Gn(t,e,r){return isNaN(e)?r?""+t:+t:(e=Ai(en(0,e),jG),t=(+t).toFixed(e),r?t:+t)}function sEr(t,e,r){return e==null&&(e=10),Gn(t,e,r)}function xl(t){return t.sort(function(e,r){return e-r}),t}function vm(t){if(t=+t,isNaN(t))return 0;if(t>1e-14){for(var e=1,r=0;r<15;r++,e*=10)if(mm(t*e)/e===t)return r}return ret(t)}function ret(t){var e=t.toString().toLowerCase(),r=e.indexOf("e"),n=r>0?+e.slice(r+1):0,i=r>0?r:e.length,a=e.indexOf("."),s=a<0?0:i-1-a;return en(0,s-n)}function oEr(t,e){var r=Nf(PA(t[1]-t[0])/EN),n=mm(PA(Za(e[1]-e[0]))/EN),i=Ai(en(-r+n,0),jG);return isFinite(i)?i:jG}function lde(t,e,r){var n=Za(t[1]-t[0]);if(!isFinite(n)||n===0)return NaN;var i=PA(2*Za(r||1)*Za(n))/EN,a=PA(Za(e))/EN,s=en(0,MA(-i+a));return isFinite(s)||(s=NaN),s}function lEr(t,e,r){if(!t[e])return 0;var n=net(t,r);return n[e]||0}function net(t,e){var r=Rf(t,function(p,g){return p+(isNaN(g)?0:g)},0);if(r===0)return[];for(var n=IA(10,e),i=vt(t,function(p){return(isNaN(p)?0:p)/r*n*100}),a=n*100,s=vt(i,function(p){return Nf(p)}),o=Rf(s,function(p,g){return p+g},0),l=vt(i,function(p,g){return p-s[g]});ou&&(u=l[d],h=d);++s[h],l[h]=0,++o}return vt(s,function(p){return p/n})}function NA(t,e){var r=en(vm(t),vm(e)),n=t+e;return r>jG?n:Gn(n,r)}var _N=IA(2,53)-1;function cde(t){var e=XG*2;return(t%e+e)%e}function BA(t){return t>-eet&&t=10&&e++,e}var iet=2;function JG(t,e){var r=ZG(t),n=IA(10,r),i=t/n,a;return e===iet?a=1:e?i<1.5?a=1:i<2.5?a=2:i<4?a=3:i<7?a=5:a=10:i<1?a=1:i<2?a=2:i<3?a=3:i<5?a=5:a=10,t=a*n,Gn(t,-r)}function eH(t,e){var r=(t.length-1)*e+1,n=Nf(r),i=+t[n-1],a=r-n;return a?i+a*(t[n]-i):i}function hde(t){t.sort(function(l,u){return o(l,u,0)?-1:1});for(var e=-1/0,r=1,n=0;n0?e.length:0),this.item=null,this.key=NaN,this},t.prototype.next=function(){return(this._step>0?this._idx=this._end)?(this.item=this._list[this._idx],this.key=this._idx=this._idx+this._step,!0):!1},t}();function yde(t){t.option=t.parentModel=t.ecModel=null}function rc(){return[1/0,-1/0]}function bde(t,e){ny(e)&&(et[1]&&(t[1]=e))}function vet(t,e){ny(e)&&et[1]&&(t[1]=e)}function EEr(t,e){zA(e[0],e[1])&&(e[0]t[1]&&(t[1]=e[1]))}function ny(t){return t!=null&&isFinite(t)}function zA(t,e){return ny(t)&&ny(e)&&t<=e}function _Er(t){var e=t[1]-t[0];return isFinite(e)&&e>=0}function tH(t){zA(t[0],t[1])&&t[0]>t[1]&&(t[0]=t[1])}function a_(){var t="__ec_once_"+REr++;return function(e,r){Kt(e,t)||(e[t]=1,r())}}var REr=fde();function rH(t,e,r){var n=Yt(),i=0;de(t,function(a){var s=e(a),o=n.get(s)||0;r&&r(a,o),!o&&!r&&(t[i++]=a),n.set(s,o+1)}),r||(t.length=i)}function DEr(t){return t.value+""}function LEr(t){return t+""}function xm(t,e){return Jt(e,!0)?t.seriesIndex+2:0}function bet(t,e,r){var n=t.getData().count();return{progressiveRender:r.progressiveEnabled&&e.incrementalPrepareRender&&n>=r.threshold,large:t.get("large")&&n>=t.get("largeThreshold"),modDataCount:t.get("progressiveChunkMode")==="mod"?t.getData().count():null}}function Ao(t,e){return{seriesType:t,overallReset:e}}function LN(t){return{overallReset:t}}var MEr=".",UA="___EC__COMPONENT__CONTAINER___",xet="___EC__EXTENDED_CLASS___";function wm(t){var e={main:"",sub:""};if(t){var r=t.split(MEr);e.main=r[0]||"",e.sub=r[1]||""}return e}function IEr(t){ec(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(t),'componentType "'+t+'" illegal')}function PEr(t){return!!(t&&t[xet])}function xde(t,e){t.$constructor=t,t.extend=function(r){var n=this,i;return NEr(n)?i=function(a){rt(s,a);function s(){return a.apply(this,arguments)||this}return s}(n):(i=function(){(r.$constructor||n).apply(this,arguments)},che(i,this)),ot(i.prototype,r),i[xet]=!0,i.extend=this.extend,i.superCall=FEr,i.superApply=zEr,i.superClass=n,i}}function NEr(t){return ur(t)&&/^class\s/.test(Function.prototype.toString.call(t))}function wet(t,e){t.extend=e.extend}var BEr=Math.round(Math.random()*10);function $Er(t){var e=["__\0is_clz",BEr++].join("_");t.prototype[e]=!0,t.isInstance=function(r){return!!(r&&r[e])}}function FEr(t,e){for(var r=[],n=2;n=0||a&&Ir(a,l)<0)){var u=n.getShallow(l,e);u!=null&&(s[t[o][0]]=u)}}return s}}var UEr=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],VEr=VA(UEr),QEr=function(){function t(){}return t.prototype.getAreaStyle=function(e,r){return VEr(this,e,r)},t}(),wde=new jE(50);function GEr(t){if(typeof t=="string"){var e=wde.get(t);return e&&e.image}else return t}function Ade(t,e,r,n,i){if(t)if(typeof t=="string"){if(e&&e.__zrImageSrc===t||!r)return e;var a=wde.get(t),s={hostEl:r,cb:n,cbPayload:i};return a?(e=a.image,!iH(e)&&a.pending.push(s)):(e=Ho.loadImage(t,Aet,Aet),e.__zrImageSrc=t,wde.put(t,e.__cachedImgObj={image:e,pending:[s]})),e}else return t;else return e}function Aet(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e=o;u++)l-=o;var h=pm(s,r);return h>l&&(r="",h=0),l=t-h,i.ellipsis=r,i.ellipsisWidth=h,i.contentWidth=l,i.containerWidth=t,i}function Oet(t,e,r){var n=r.containerWidth,i=r.contentWidth,a=r.fontMeasureInfo;if(!n){t.textLine="",t.isTruncated=!1;return}var s=pm(a,e);if(s<=n){t.textLine=e,t.isTruncated=!1;return}for(var o=0;;o++){if(s<=i||o>=r.maxIterations){e+=r.ellipsis;break}var l=o===0?WEr(e,i,a):s>0?Math.floor(e.length*i/s):0;e=e.substr(0,l),s=pm(a,e)}e===""&&(e=r.placeholder),t.textLine=e,t.isTruncated=!0}function WEr(t,e,r){for(var n=0,i=0,a=t.length;iv&&p){var x=Math.floor(v/f);g=g||y.length>x,y=y.slice(0,x),b=y.length*f}if(i&&h&&m!=null)for(var w=Cet(m,u,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),A={},T=0;Tg&&Sde(a,s.substring(g,v),e,p),Sde(a,m[2],e,p,m[1]),g=Tde.lastIndex}gd){var F=a.lines.length;I>0?(k.tokens=k.tokens.slice(0,I),S(k,_,E),a.lines=a.lines.slice(0,O+1)):a.lines=a.lines.slice(0,O),a.isTruncated=a.isTruncated||a.lines.length0&&g+n.accumWidth>n.width&&(h=e.split(` +`):[];var b=y.length*f;if(v==null&&(v=b),b>v&&p){var x=Math.floor(v/f);g=g||y.length>x,y=y.slice(0,x),b=y.length*f}if(i&&h&&m!=null)for(var w=Cet(m,u,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),A={},S=0;Sg&&Tde(a,s.substring(g,v),e,p),Tde(a,m[2],e,p,m[1]),g=Sde.lastIndex}gd){var F=a.lines.length;I>0?(k.tokens=k.tokens.slice(0,I),T(k,_,E),a.lines=a.lines.slice(0,O+1)):a.lines=a.lines.slice(0,O),a.isTruncated=a.isTruncated||a.lines.length0&&g+n.accumWidth>n.width&&(h=e.split(` `),u=!0),n.accumWidth=g}else{var m=Eet(e,l,n.width,n.breakAll,n.accumWidth);n.accumWidth=m.accumWidth+p,d=m.linesWidths,h=m.lines}}h||(h=e.split(` `));for(var v=fm(l),y=0;y=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}var ZEr=Rf(",&?/;] ".split(""),function(t,e){return t[e]=!0,t},{});function JEr(t){return KEr(t)?!!ZEr[t]:!0}function Eet(t,e,r,n,i){for(var a=[],s=[],o="",l="",u=0,h=0,d=fm(e),f=0;fr:i+h+g>r){h?(o||l)&&(m?(o||(o=l,l="",u=0,h=u),a.push(o),s.push(h-u),l+=p,u+=g,o="",h=u):(l&&(o+=l,l="",u=0),a.push(o),s.push(h),o=p,h=g)):m?(a.push(l),s.push(u),l=p,u=g):(a.push(p),s.push(g));continue}h+=g,m?(l+=p,u+=g):(l&&(o+=l,l="",u=0),o+=p)}return l&&(o+=l),o&&(a.push(o),s.push(h)),a.length===1&&(h+=i),{accumWidth:h,lines:a,linesWidths:s}}function _et(t,e,r,n,i,a){if(t.baseX=r,t.baseY=n,t.outerWidth=t.outerHeight=null,!!e){var s=e.width*2,o=e.height*2;fr.set(Ret,e_(r,s,i),DA(n,o,a),s,o),fr.intersect(e,Ret,null,Det);var l=Det.outIntersectRect;t.outerWidth=l.width,t.outerHeight=l.height,t.baseX=e_(l.x,l.width,i,!0),t.baseY=DA(l.y,l.height,a,!0)}}var Ret=new fr(0,0,0,0),Det={outIntersectRect:{},clamp:!0};function Cde(t){return t!=null?t+="":t=""}function e_r(t){var e=Cde(t.text),r=t.font,n=pm(fm(r),e),i=kN(r);return Ode(t,n,i,null)}function Ode(t,e,r,n){var i=new fr(e_(t.x||0,e,t.textAlign),DA(t.y||0,r,t.textBaseline),e,r),a=n??(Let(t)?t.lineWidth:0);return a>0&&(i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a),i}function Let(t){var e=t.stroke;return e!=null&&e!=="none"&&t.lineWidth>0}var kde="__zr_style_"+Math.round(Math.random()*10),QA={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},aH={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};QA[kde]=!0;var Met=["z","z2","invisible"],t_r=["invisible"],$f=function(t){ha(e,t);function e(r){return t.call(this,r)||this}return e.prototype._init=function(r){for(var n=kn(r),i=0;i1e-4){o[0]=t-r,o[1]=e-n,l[0]=t+r,l[1]=e+n;return}if(sH[0]=Dde(i)*r+t,sH[1]=Rde(i)*n+e,oH[0]=Dde(a)*r+t,oH[1]=Rde(a)*n+e,u(o,sH,oH),h(l,sH,oH),i=i%GA,i<0&&(i=i+GA),a=a%GA,a<0&&(a=a+GA),i>a&&!s?a+=GA:ii&&(lH[0]=Dde(p)*r+t,lH[1]=Rde(p)*n+e,u(o,lH,o),h(l,lH,l))}var Ki={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},HA=[],WA=[],Am=[],dx=[],Tm=[],Sm=[],Lde=Math.min,Mde=Math.max,YA=Math.cos,qA=Math.sin,iy=Math.abs,Ide=Math.PI,fx=Ide*2,Pde=typeof Float32Array<"u",MN=[];function Nde(t){var e=Math.round(t/Ide*1e8)/1e8;return e%2*Ide}function uH(t,e){var r=Nde(t[0]);r<0&&(r+=fx);var n=r-t[0],i=t[1];i+=n,!e&&i-r>=fx?i=r+fx:e&&r-i>=fx?i=r-fx:!e&&r>i?i=r+(fx-Nde(r-i)):e&&r0&&(this._ux=iy(n/zG/e)||0,this._uy=iy(n/zG/r)||0)},t.prototype.setDPR=function(e){this.dpr=e},t.prototype.setContext=function(e){this._ctx=e},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(e,r){return this._drawPendingPt(),this.addData(Ki.M,e,r),this._ctx&&this._ctx.moveTo(e,r),this._x0=e,this._y0=r,this._xi=e,this._yi=r,this},t.prototype.lineTo=function(e,r){var n=iy(e-this._xi),i=iy(r-this._yi),a=n>this._ux||i>this._uy;if(this.addData(Ki.L,e,r),this._ctx&&a&&this._ctx.lineTo(e,r),a)this._xi=e,this._yi=r,this._pendingPtDist=0;else{var s=n*n+i*i;s>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=r,this._pendingPtDist=s)}return this},t.prototype.bezierCurveTo=function(e,r,n,i,a,s){return this._drawPendingPt(),this.addData(Ki.C,e,r,n,i,a,s),this._ctx&&this._ctx.bezierCurveTo(e,r,n,i,a,s),this._xi=a,this._yi=s,this},t.prototype.quadraticCurveTo=function(e,r,n,i){return this._drawPendingPt(),this.addData(Ki.Q,e,r,n,i),this._ctx&&this._ctx.quadraticCurveTo(e,r,n,i),this._xi=n,this._yi=i,this},t.prototype.arc=function(e,r,n,i,a,s){this._drawPendingPt(),MN[0]=i,MN[1]=a,uH(MN,s),i=MN[0],a=MN[1];var o=a-i;return this.addData(Ki.A,e,r,n,n,i,o,0,s?0:1),this._ctx&&this._ctx.arc(e,r,n,i,a,s),this._xi=YA(a)*n+e,this._yi=qA(a)*n+r,this},t.prototype.arcTo=function(e,r,n,i,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,r,n,i,a),this},t.prototype.rect=function(e,r,n,i){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,r,n,i),this.addData(Ki.R,e,r,n,i),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(Ki.Z);var e=this._ctx,r=this._x0,n=this._y0;return e&&e.closePath(),this._xi=r,this._yi=n,this},t.prototype.fill=function(e){e&&e.fill(),this.toStatic()},t.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},t.prototype.len=function(){return this._len},t.prototype.setData=function(e){if(this._saveData){var r=e.length;!(this.data&&this.data.length===r)&&Pde&&(this.data=new Float32Array(r));for(var n=0;n0&&s))for(var o=0;oh.length&&(this._expandData(),h=this.data);for(var d=0;d0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],r=0;r11&&(this.data=new Float32Array(e)))}},t.prototype.getBoundingRect=function(){Am[0]=Am[1]=Tm[0]=Tm[1]=Number.MAX_VALUE,dx[0]=dx[1]=Sm[0]=Sm[1]=-Number.MAX_VALUE;var e=this.data,r=0,n=0,i=0,a=0,s;for(s=0;sn||iy(x)>i||f===r-1)&&(m=Math.sqrt(b*b+x*x),a=v,s=y);break}case Ki.C:{var w=e[f++],A=e[f++],v=e[f++],y=e[f++],T=e[f++],S=e[f++];m=skr(a,s,w,A,v,y,T,S,10),a=T,s=S;break}case Ki.Q:{var w=e[f++],A=e[f++],v=e[f++],y=e[f++];m=lkr(a,s,w,A,v,y,10),a=v,s=y;break}case Ki.A:var O=e[f++],k=e[f++],E=e[f++],_=e[f++],I=e[f++],L=e[f++],R=L+I;f+=1,g&&(o=YA(I)*E+O,l=qA(I)*_+k),m=Mde(E,_)*Lde(fx,Math.abs(L)),a=YA(R)*E+O,s=qA(R)*_+k;break;case Ki.R:{o=a=e[f++],l=s=e[f++];var D=e[f++],M=e[f++];m=D*2+M*2;break}case Ki.Z:{var b=o-a,x=l-s;m=Math.sqrt(b*b+x*x),a=o,s=l;break}}m>=0&&(u[d++]=m,h+=m)}return this._pathLen=h,h},t.prototype.rebuildPath=function(e,r){var n=this.data,i=this._ux,a=this._uy,s=this._len,o,l,u,h,d,f,p=r<1,g,m,v=0,y=0,b,x=0,w,A;if(!(p&&(this._pathSegLen||this._calculateLength(),g=this._pathSegLen,m=this._pathLen,b=r*m,!b)))e:for(var T=0;T0&&(e.lineTo(w,A),x=0),S){case Ki.M:o=u=n[T++],l=h=n[T++],e.moveTo(u,h);break;case Ki.L:{d=n[T++],f=n[T++];var k=iy(d-u),E=iy(f-h);if(k>i||E>a){if(p){var _=g[y++];if(v+_>b){var I=(b-v)/_;e.lineTo(u*(1-I)+d*I,h*(1-I)+f*I);break e}v+=_}e.lineTo(d,f),u=d,h=f,x=0}else{var L=k*k+E*E;L>x&&(w=d,A=f,x=L)}break}case Ki.C:{var R=n[T++],D=n[T++],M=n[T++],P=n[T++],N=n[T++],F=n[T++];if(p){var _=g[y++];if(v+_>b){var I=(b-v)/_;ox(u,R,M,N,I,HA),ox(h,D,P,F,I,WA),e.bezierCurveTo(HA[1],WA[1],HA[2],WA[2],HA[3],WA[3]);break e}v+=_}e.bezierCurveTo(R,D,M,P,N,F),u=N,h=F;break}case Ki.Q:{var R=n[T++],D=n[T++],M=n[T++],P=n[T++];if(p){var _=g[y++];if(v+_>b){var I=(b-v)/_;yN(u,R,M,I,HA),yN(h,D,P,I,WA),e.quadraticCurveTo(HA[1],WA[1],HA[2],WA[2]);break e}v+=_}e.quadraticCurveTo(R,D,M,P),u=M,h=P;break}case Ki.A:var B=n[T++],V=n[T++],z=n[T++],U=n[T++],Q=n[T++],G=n[T++],X=n[T++],Y=!n[T++],le=z>U?z:U,q=iy(z-U)>.001,Z=Q+G,ee=!1;if(p){var _=g[y++];v+_>b&&(Z=Q+G*(b-v)/_,ee=!0),v+=_}if(q&&e.ellipse?e.ellipse(B,V,z,U,X,Q,Z,Y):e.arc(B,V,le,Q,Z,Y),ee)break e;O&&(o=YA(Q)*z+B,l=qA(Q)*U+V),u=YA(Z)*z+B,h=qA(Z)*U+V;break;case Ki.R:o=u=n[T],l=h=n[T+1],d=n[T++],f=n[T++];var re=n[T++],ve=n[T++];if(p){var _=g[y++];if(v+_>b){var ae=b-v;e.moveTo(d,f),e.lineTo(d+Lde(ae,re),f),ae-=re,ae>0&&e.lineTo(d+re,f+Lde(ae,ve)),ae-=ve,ae>0&&e.lineTo(d+Mde(re-ae,0),f+ve),ae-=re,ae>0&&e.lineTo(d,f+Mde(ve-ae,0));break e}v+=_}e.rect(d,f,re,ve);break;case Ki.Z:if(p){var _=g[y++];if(v+_>b){var I=(b-v)/_;e.lineTo(u*(1-I)+o*I,h*(1-I)+l*I);break e}v+=_}e.closePath(),u=o,h=l}}},t.prototype.clone=function(){var e=new t,r=this.data;return e.data=r.slice?r.slice():Array.prototype.slice.call(r),e._len=this._len,e},t.prototype.canSave=function(){return!!this._saveData},t.CMD=Ki,t.initDefaultProps=function(){var e=t.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),t}();function px(t,e,r,n,i,a,s){if(i===0)return!1;var o=i,l=0,u=t;if(s>e+o&&s>n+o||st+o&&a>r+o||ae+d&&h>n+d&&h>a+d&&h>o+d||ht+d&&u>r+d&&u>i+d&&u>s+d||ue+u&&l>n+u&&l>a+u||lt+u&&o>r+u&&o>i+u||or||h+ui&&(i+=IN);var f=Math.atan2(l,o);return f<0&&(f+=IN),f>=n&&f<=i||f+IN>=n&&f+IN<=i}function ay(t,e,r,n,i,a){if(a>e&&a>n||ai?o:0}var gx=Cm.CMD,jA=Math.PI*2,l_r=1e-4;function c_r(t,e){return Math.abs(t-e)e&&u>n&&u>a&&u>o||u1&&u_r(),p=Wo(e,n,a,o,Ff[0]),f>1&&(g=Wo(e,n,a,o,Ff[1]))),f===2?ve&&o>n&&o>a||o=0&&u<=1){for(var h=0,d=bl(e,n,a,u),f=0;fr||o<-r)return 0;var l=Math.sqrt(r*r-o*o);xu[0]=-l,xu[1]=l;var u=Math.abs(n-i);if(u<1e-4)return 0;if(u>=jA-1e-4){n=0,i=jA;var h=a?1:-1;return s>=xu[0]+t&&s<=xu[1]+t?h:0}if(n>i){var d=n;n=i,i=d}n<0&&(n+=jA,i+=jA);for(var f=0,p=0;p<2;p++){var g=xu[p];if(g+t>s){var m=Math.atan2(o,g),h=a?1:-1;m<0&&(m=jA+m),(m>=n&&m<=i||m+jA>=n&&m+jA<=i)&&(m>Math.PI/2&&m1&&(r||(o+=ay(l,u,h,d,n,i))),v&&(l=a[g],u=a[g+1],h=l,d=u),m){case gx.M:h=a[g++],d=a[g++],l=h,u=d;break;case gx.L:if(r){if(px(l,u,a[g],a[g+1],e,n,i))return!0}else o+=ay(l,u,a[g],a[g+1],n,i)||0;l=a[g++],u=a[g++];break;case gx.C:if(r){if(s_r(l,u,a[g++],a[g++],a[g++],a[g++],a[g],a[g+1],e,n,i))return!0}else o+=h_r(l,u,a[g++],a[g++],a[g++],a[g++],a[g],a[g+1],n,i)||0;l=a[g++],u=a[g++];break;case gx.Q:if(r){if(Bet(l,u,a[g++],a[g++],a[g],a[g+1],e,n,i))return!0}else o+=d_r(l,u,a[g++],a[g++],a[g],a[g+1],n,i)||0;l=a[g++],u=a[g++];break;case gx.A:var y=a[g++],b=a[g++],x=a[g++],w=a[g++],A=a[g++],T=a[g++];g+=1;var S=!!(1-a[g++]);f=Math.cos(A)*x+y,p=Math.sin(A)*w+b,v?(h=f,d=p):o+=ay(l,u,f,p,n,i);var O=(n-y)*w/x+y;if(r){if(o_r(y,b,w,A,A+T,S,e,O,i))return!0}else o+=f_r(y,b,w,A,A+T,S,O,i);l=Math.cos(A+T)*x+y,u=Math.sin(A+T)*w+b;break;case gx.R:h=l=a[g++],d=u=a[g++];var k=a[g++],E=a[g++];if(f=h+k,p=d+E,r){if(px(h,d,f,d,e,n,i)||px(f,d,f,p,e,n,i)||px(f,p,h,p,e,n,i)||px(h,p,h,d,e,n,i))return!0}else o+=ay(f,d,f,p,n,i),o+=ay(h,p,h,d,n,i);break;case gx.Z:if(r){if(px(l,u,h,d,e,n,i))return!0}else o+=ay(l,u,h,d,n,i);l=h,u=d;break}}return!r&&!c_r(u,d)&&(o+=ay(l,u,h,d,n,i)||0),o!==0}function p_r(t,e,r){return Fet(t,0,!1,e,r)}function g_r(t,e,r,n){return Fet(t,e,!0,r,n)}var hH=mr({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},QA),m_r={style:mr({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},aH.style)},Bde=ry.concat(["invisible","culling","z","z2","zlevel","parent"]),vn=function(t){ha(e,t);function e(r){return t.call(this,r)||this}return e.prototype.update=function(){var r=this;t.prototype.update.call(this);var n=this.style;if(n.decal){var i=this._decalEl=this._decalEl||new e;i.buildPath===e.prototype.buildPath&&(i.buildPath=function(l){r.buildPath(l,r.shape)}),i.silent=!0;var a=i.style;for(var s in n)a[s]!==n[s]&&(a[s]=n[s]);a.fill=n.fill?n.decal:null,a.decal=null,a.shadowColor=null,n.strokeFirst&&(a.stroke=null);for(var o=0;o.5?Khe:n>.2?Fkr:Zhe}else if(r)return Zhe}return Khe},e.prototype.getInsideTextStroke=function(r){var n=this.style.fill;if(Nt(n)){var i=this.__zr,a=!!(i&&i.isDarkMode()),s=AN(r,0)0))},e.prototype.hasFill=function(){var r=this.style,n=r.fill;return n!=null&&n!=="none"},e.prototype.getBoundingRect=function(){var r=this._rect,n=this.style,i=!r;if(i){var a=!1;this.path||(a=!0,this.createPathProxy());var s=this.path;(a||this.__dirty&YE)&&(s.beginPath(),this.buildPath(s,this.shape,!1),this.pathUpdated()),r=s.getBoundingRect()}if(this._rect=r,this.hasStroke()&&this.path&&this.path.len()>0){var o=this._rectStroke||(this._rectStroke=r.clone());if(this.__dirty||i){o.copy(r);var l=n.strokeNoScale?this.getLineScale():1,u=n.lineWidth;if(!this.hasFill()){var h=this.strokeContainThreshold;u=Math.max(u,h??4)}l>1e-10&&(o.width+=u/l,o.height+=u/l,o.x-=u/l/2,o.y-=u/l/2)}return o}return r},e.prototype.contain=function(r,n){var i=this.transformCoordToLocal(r,n),a=this.getBoundingRect(),s=this.style;if(r=i[0],n=i[1],a.contain(r,n)){var o=this.path;if(this.hasStroke()){var l=s.lineWidth,u=s.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),g_r(o,l/u,r,n)))return!0}if(this.hasFill())return p_r(o,r,n)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=YE,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(r){return this.animate("shape",r)},e.prototype.updateDuringAnimation=function(r){r==="style"?this.dirtyStyle():r==="shape"?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(r,n){r==="shape"?this.setShape(n):t.prototype.attrKV.call(this,r,n)},e.prototype.setShape=function(r,n){var i=this.shape;return i||(i=this.shape={}),typeof r=="string"?i[r]=n:ot(i,r),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&YE)},e.prototype.createStyle=function(r){return oN(hH,r)},e.prototype._innerSaveToNormal=function(r){t.prototype._innerSaveToNormal.call(this,r);var n=this._normalState;r.shape&&!n.shape&&(n.shape=ot({},this.shape))},e.prototype._applyStateObj=function(r,n,i,a,s,o){if(t.prototype._applyStateObj.call(this,r,n,i,a,s,o),this.__inHover!==WG){var l=!(n&&a),u;if(n&&n.shape?s?a?u=n.shape:(u=ot({},i.shape),ot(u,n.shape)):(u=ot({},a?this.shape:i.shape),ot(u,n.shape)):l&&(u=i.shape),u)if(s){this.shape=ot({},this.shape);for(var h={},d=kn(u),f=0;fi&&(d=o+l,o*=i/d,l*=i/d),u+h>i&&(d=u+h,u*=i/d,h*=i/d),l+u>a&&(d=l+u,l*=a/d,u*=a/d),o+h>a&&(d=o+h,o*=a/d,h*=a/d),t.moveTo(r+o,n),t.lineTo(r+i-l,n),l!==0&&t.arc(r+i-l,n+l,l,-Math.PI/2,0),t.lineTo(r+i,n+a-u),u!==0&&t.arc(r+i-u,n+a-u,u,0,Math.PI/2),t.lineTo(r+h,n+a),h!==0&&t.arc(r+h,n+a-h,h,Math.PI/2,Math.PI),t.lineTo(r,n+o),o!==0&&t.arc(r+o,n+o,o,Math.PI,Math.PI*1.5),t.closePath()}var o_=Math.round;function dH(t,e,r){if(e){var n=e.x1,i=e.x2,a=e.y1,s=e.y2;t.x1=n,t.x2=i,t.y1=a,t.y2=s;var o=r&&r.lineWidth;return o&&(o_(n*2)===o_(i*2)&&(t.x1=t.x2=Ed(n,o,!0)),o_(a*2)===o_(s*2)&&(t.y1=t.y2=Ed(a,o,!0))),t}}function zet(t,e,r){if(e){var n=e.x,i=e.y,a=e.width,s=e.height;t.x=n,t.y=i,t.width=a,t.height=s;var o=r&&r.lineWidth;return o&&(t.x=Ed(n,o,!0),t.y=Ed(i,o,!0),t.width=Math.max(Ed(n+a,o,!1)-t.x,a===0?0:1),t.height=Math.max(Ed(i+s,o,!1)-t.y,s===0?0:1)),t}}function Ed(t,e,r){if(!e)return t;var n=o_(t*2);return(n+o_(e))%2===0?n/2:(n+(r?1:-1))/2}var A_r=function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0}return t}(),T_r={},tn=function(t){ha(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new A_r},e.prototype.buildPath=function(r,n){var i,a,s,o;if(this.subPixelOptimize){var l=zet(T_r,n,this.style);i=l.x,a=l.y,s=l.width,o=l.height,l.r=n.r,n=l}else i=n.x,a=n.y,s=n.width,o=n.height;n.r?w_r(r,n):r.rect(i,a,s,o)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(vn);tn.prototype.type="rect";var Uet={fill:"#000"},Vet=2,Om={},S_r={style:mr({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},aH.style)},Pn=function(t){ha(e,t);function e(r){var n=t.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=Uet,n.attr(r),n}return e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){t.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var r=0;r0,I=0;I=0&&(R=T[L],R.align==="right");)this._placeToken(R,r,O,y,I,"right",x),k-=R.width,I-=R.width,L--;for(_+=(h-(_-v)-(b-I)-k)/2;E<=L;)R=T[E],this._placeToken(R,r,O,y,_+R.width/2,"center",x),_+=R.width,E++;y+=O}},e.prototype._placeToken=function(r,n,i,a,s,o,l){var u=n.rich[r.styleName]||{};u.text=r.text;var h=r.verticalAlign,d=a+i/2;h==="top"?d=a+r.height/2:h==="bottom"&&(d=a+i-r.height/2);var f=!r.isLineHolder&&$de(u);f&&this._renderBackground(u,n,o==="right"?s-r.width:o==="center"?s-r.width/2:s,d-r.height/2,r.width,r.height);var p=!!u.backgroundColor,g=r.textPadding;g&&(s=Xet(s,o,g),d-=r.height/2-g[0]-r.innerHeight/2);var m=this._getOrCreateChild(s_),v=m.createStyle();m.useStyle(v);var y=this._defaultStyle,b=!1,x=0,w=!1,A=jet("fill"in u?u.fill:"fill"in n?n.fill:(b=!0,y.fill)),T=qet("stroke"in u?u.stroke:"stroke"in n?n.stroke:!p&&!l&&(!y.autoStroke||b)?(x=Vet,w=!0,y.stroke):null),S=u.textShadowBlur>0||n.textShadowBlur>0;v.text=r.text,v.x=s,v.y=d,S&&(v.shadowBlur=u.textShadowBlur||n.textShadowBlur||0,v.shadowColor=u.textShadowColor||n.textShadowColor||"transparent",v.shadowOffsetX=u.textShadowOffsetX||n.textShadowOffsetX||0,v.shadowOffsetY=u.textShadowOffsetY||n.textShadowOffsetY||0),v.textAlign=o,v.textBaseline="middle",v.font=r.font||Hv,v.opacity=Ch(u.opacity,n.opacity,1),Het(v,u),T&&(v.lineWidth=Ch(u.lineWidth,n.lineWidth,x),v.lineDash=Jt(u.lineDash,n.lineDash),v.lineDashOffset=n.lineDashOffset||0,v.stroke=T),A&&(v.fill=A),m.setBoundingRect(Ode(v,r.contentWidth,r.contentHeight,w?0:null))},e.prototype._renderBackground=function(r,n,i,a,s,o){var l=r.backgroundColor,u=r.borderWidth,h=r.borderColor,d=l&&l.image,f=l&&!d,p=r.borderRadius,g=this,m,v;if(f||r.lineHeight||u&&h){m=this._getOrCreateChild(tn),m.useStyle(m.createStyle()),m.style.fill=null;var y=m.shape;y.x=i,y.y=a,y.width=s,y.height=o,y.r=p,m.dirtyShape()}if(f){var b=m.style;b.fill=l||null,b.fillOpacity=Jt(r.fillOpacity,1)}else if(d){v=this._getOrCreateChild(Yo),v.onload=function(){g.dirtyStyle()};var x=v.style;x.image=l.image,x.x=i,x.y=a,x.width=s,x.height=o}if(u&&h){var b=m.style;b.lineWidth=u,b.stroke=h,b.strokeOpacity=Jt(r.strokeOpacity,1),b.lineDash=r.borderDash,b.lineDashOffset=r.borderDashOffset||0,m.strokeContainThreshold=0,m.hasFill()&&m.hasStroke()&&(b.strokeFirst=!0,b.lineWidth*=2)}var w=(m||v).style;w.shadowBlur=r.shadowBlur||0,w.shadowColor=r.shadowColor||"transparent",w.shadowOffsetX=r.shadowOffsetX||0,w.shadowOffsetY=r.shadowOffsetY||0,w.opacity=Ch(r.opacity,n.opacity,1)},e.makeFont=function(r){var n="";return Wet(r)&&(n=[r.fontStyle,r.fontWeight,Get(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),n&&Td(n)||r.textFont||r.font},e}($f),C_r={left:!0,right:1,center:1},O_r={top:1,bottom:1,middle:1},Qet=["fontStyle","fontWeight","fontSize","fontFamily"];function Get(t){return typeof t=="string"&&(t.indexOf("px")!==-1||t.indexOf("rem")!==-1||t.indexOf("em")!==-1)?t:isNaN(+t)?ihe+"px":t+"px"}function Het(t,e){for(var r=0;r=0,a=!1;if(t instanceof vn){var s=att(t),o=i&&s.selectFill||s.normalFill,l=i&&s.selectStroke||s.normalStroke;if(u_(o)||u_(l)){n=n||{};var u=n.style||{};u.fill==="inherit"?(a=!0,n=ot({},n),u=ot({},u),u.fill=o):!u_(u.fill)&&u_(o)?(a=!0,n=ot({},n),u=ot({},u),u.fill=RG(o)):!u_(u.stroke)&&u_(l)&&(a||(n=ot({},n),u=ot({},u)),u.stroke=RG(l)),n.style=u}}if(n&&n.z2==null){a||(n=ot({},n));var h=t.z2EmphasisLift;n.z2=t.z2+(h??c_)}return n}function I_r(t,e,r){if(r&&r.z2==null){r=ot({},r);var n=t.z2SelectLift;r.z2=t.z2+(n??__r)}return r}function P_r(t,e,r){var n=Ir(t.currentStates,e)>=0,i=t.style.opacity,a=n?null:L_r(t,["opacity"],e,{opacity:1});r=r||{};var s=r.style||{};return s.opacity==null&&(r=ot({},r),s=ot({opacity:n?i:a.opacity*.1},s),r.style=s),r}function Hde(t,e){var r=this.states[t];if(this.style){if(t==="emphasis")return M_r(this,t,e,r);if(t==="blur")return P_r(this,t,r);if(t==="select")return I_r(this,t,r)}return r}function ZA(t){t.stateProxy=Hde;var e=t.getTextContent(),r=t.getTextGuideLine();e&&(e.stateProxy=Hde),r&&(r.stateProxy=Hde)}function utt(t,e){!gtt(t,e)&&!t.__highByOuter&&sy(t,stt)}function htt(t,e){!gtt(t,e)&&!t.__highByOuter&&sy(t,ott)}function oy(t,e){t.__highByOuter|=1<<(e||0),sy(t,stt)}function ly(t,e){!(t.__highByOuter&=~(1<<(e||0)))&&sy(t,ott)}function dtt(t){sy(t,Gde)}function Wde(t){sy(t,ltt)}function ftt(t){sy(t,R_r)}function ptt(t){sy(t,D_r)}function gtt(t,e){return t.__highDownSilentOnTouch&&e.zrByTouch}function mtt(t){var e=t.getModel(),r=[],n=[];e.eachComponent(function(i,a){var s=zde(a),o=rtt(t,a),l=i==="series";!l&&n.push(o),s.isBlured&&(o.group.traverse(function(u){ltt(u)}),l&&r.push(a)),s.isBlured=!1}),de(n,function(i){i&&i.toggleBlurSeries&&i.toggleBlurSeries(r,!1,e)})}function Yde(t,e,r,n){var i=n.getModel();r=r||"coordinateSystem";function a(u,h){for(var d=0;d0){var o={dataIndex:s,seriesIndex:r.seriesIndex};a!=null&&(o.dataType=a),e.push(o)}})}),e}function vx(t,e,r){JA(t,!0),sy(t,ZA),Xde(t,e,r)}function U_r(t){JA(t,!1)}function wa(t,e,r,n){n?U_r(t):vx(t,e,r)}function Xde(t,e,r){var n=Cr(t);e!=null?(n.focus=e,n.blurScope=r):n.focus&&(n.focus=null)}var ytt=["emphasis","blur","select"],V_r={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function To(t,e,r,n){r=r||"itemStyle";for(var i=0;i1&&(s*=Zde(g),o*=Zde(g));var m=(i===a?-1:1)*Zde((s*s*(o*o)-s*s*(p*p)-o*o*(f*f))/(s*s*(p*p)+o*o*(f*f)))||0,v=m*s*p/o,y=m*-o*f/s,b=(t+r)/2+xH(d)*v-bH(d)*y,x=(e+n)/2+bH(d)*v+xH(d)*y,w=Ttt([1,0],[(f-v)/s,(p-y)/o]),A=[(f-v)/s,(p-y)/o],T=[(-1*f-v)/s,(-1*p-y)/o],S=Ttt(A,T);if(Jde(A,T)<=-1&&(S=$N),Jde(A,T)>=1&&(S=0),S<0){var O=Math.round(S/$N*1e6)/1e6;S=$N*2+O%2*$N}h.addData(u,b,x,s,o,w,S,d,a)}var q_r=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,j_r=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function X_r(t){var e=new Cm;if(!t)return e;var r=0,n=0,i=r,a=n,s,o=Cm.CMD,l=t.match(q_r);if(!l)return e;for(var u=0;uR*R+D*D&&(O=E,k=_),{cx:O,cy:k,x0:-h,y0:-d,x1:O*(i/A-1),y1:k*(i/A-1)}}function n5r(t){var e;if(ft(t)){var r=t.length;if(!r)return t;r===1?e=[t[0],t[0],0,0]:r===2?e=[t[0],t[0],t[1],t[1]]:r===3?e=t.concat(t[2]):e=t}else e=[t,t,t,t];return e}function i5r(t,e){var r,n=UN(e.r,0),i=UN(e.r0||0,0),a=n>0,s=i>0;if(!(!a&&!s)){if(a||(n=i,i=0),i>n){var o=n;n=i,i=o}var l=e.startAngle,u=e.endAngle;if(!(isNaN(l)||isNaN(u))){var h=e.cx,d=e.cy,f=!!e.clockwise,p=Rtt(u-l),g=p>tfe&&p%tfe;if(g>Hp&&(p=g),!(n>Hp))t.moveTo(h,d);else if(p>tfe-Hp)t.moveTo(h+n*d_(l),d+n*eT(l)),t.arc(h,d,n,l,u,!f),i>Hp&&(t.moveTo(h+i*d_(u),d+i*eT(u)),t.arc(h,d,i,u,l,f));else{var m=void 0,v=void 0,y=void 0,b=void 0,x=void 0,w=void 0,A=void 0,T=void 0,S=void 0,O=void 0,k=void 0,E=void 0,_=void 0,I=void 0,L=void 0,R=void 0,D=n*d_(l),M=n*eT(l),P=i*d_(u),N=i*eT(u),F=p>Hp;if(F){var B=e.cornerRadius;B&&(r=n5r(B),m=r[0],v=r[1],y=r[2],b=r[3]);var V=Rtt(n-i)/2;if(x=_m(V,y),w=_m(V,b),A=_m(V,m),T=_m(V,v),k=S=UN(x,w),E=O=UN(A,T),(S>Hp||O>Hp)&&(_=n*d_(u),I=n*eT(u),L=i*d_(l),R=i*eT(l),p<_tt)){var z=r5r(D,M,L,R,_,I,P,N);if(z){var U=D-z[0],Q=M-z[1],G=_-z[0],X=I-z[1],Y=1/eT(t5r((U*G+Q*X)/(zN(U*U+Q*Q)*zN(G*G+X*X)))/2),le=zN(z[0]*z[0]+z[1]*z[1]);k=_m(S,(n-le)/(Y+1)),E=_m(O,(i-le)/(Y-1))}}}if(!F)t.moveTo(h+D,d+M);else if(k>Hp){var q=_m(y,k),Z=_m(b,k),ee=wH(L,R,D,M,n,q,f),re=wH(_,I,P,N,n,Z,f);t.moveTo(h+ee.cx+ee.x0,d+ee.cy+ee.y0),k0&&t.arc(h+ee.cx,d+ee.cy,q,$c(ee.y0,ee.x0),$c(ee.y1,ee.x1),!f),t.arc(h,d,n,$c(ee.cy+ee.y1,ee.cx+ee.x1),$c(re.cy+re.y1,re.cx+re.x1),!f),Z>0&&t.arc(h+re.cx,d+re.cy,Z,$c(re.y1,re.x1),$c(re.y0,re.x0),!f))}else t.moveTo(h+D,d+M),t.arc(h,d,n,l,u,!f);if(!(i>Hp)||!F)t.lineTo(h+P,d+N);else if(E>Hp){var q=_m(m,E),Z=_m(v,E),ee=wH(P,N,_,I,i,-Z,f),re=wH(D,M,L,R,i,-q,f);t.lineTo(h+ee.cx+ee.x0,d+ee.cy+ee.y0),E0&&t.arc(h+ee.cx,d+ee.cy,Z,$c(ee.y0,ee.x0),$c(ee.y1,ee.x1),!f),t.arc(h,d,i,$c(ee.cy+ee.y1,ee.cx+ee.x1),$c(re.cy+re.y1,re.cx+re.x1),f),q>0&&t.arc(h+re.cx,d+re.cy,q,$c(re.y1,re.x1),$c(re.y0,re.x0),!f))}else t.lineTo(h+P,d+N),t.arc(h,d,i,u,l,f)}t.closePath()}}}var a5r=function(){function t(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return t}(),nc=function(t){ha(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new a5r},e.prototype.buildPath=function(r,n){i5r(r,n)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(vn);nc.prototype.type="sector";var s5r=function(){function t(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return t}(),f_=function(t){ha(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new s5r},e.prototype.buildPath=function(r,n){var i=n.cx,a=n.cy,s=Math.PI*2;r.moveTo(i+n.r,a),r.arc(i,a,n.r,0,s,!1),r.moveTo(i+n.r0,a),r.arc(i,a,n.r0,0,s,!0)},e}(vn);f_.prototype.type="ring";function o5r(t,e,r,n){var i=[],a=[],s=[],o=[],l,u,h,d;if(n){h=[1/0,1/0],d=[-1/0,-1/0];for(var f=0,p=t.length;f=2){if(n){var a=o5r(i,n,r,e.smoothConstraint);t.moveTo(i[0][0],i[0][1]);for(var s=i.length,o=0;o<(r?s:s-1);o++){var l=a[o*2],u=a[o*2+1],h=i[(o+1)%s];t.bezierCurveTo(l[0],l[1],u[0],u[1],h[0],h[1])}}else{t.moveTo(i[0][0],i[0][1]);for(var o=1,d=i.length;onT[1]){if(a=!1,Tl.negativeSize||n)return a;var l=AH(nT[0]-rT[1]),u=AH(rT[0]-nT[1]);nfe(l,u)>SH.len()&&(l=u||!Tl.bidirectional)&&(wr.scale(TH,o,-u*i),Tl.useDir&&Tl.calcDirMTV()))}}return a},t.prototype._getProjMinMaxOnAxis=function(e,r,n){for(var i=this._axes[e],a=this._origin,s=r[0].dot(i)+a[e],o=s,l=s,u=1;u0){var d=h.duration,f=h.delay,p=h.easing,g={duration:d,delay:f||0,easing:p,done:a,force:!!a||!!s,setToFinal:!u,scope:t,during:s};o?e.animateFrom(r,g):e.animateTo(r,g)}else e.stopAnimation(),!o&&e.attr(r),s&&s(1),a&&a()}function Hn(t,e,r,n,i,a){ife("update",t,e,r,n,i,a)}function ia(t,e,r,n,i,a){ife("enter",t,e,r,n,i,a)}function m_(t){if(!t.__zr)return!0;for(var e=0;eZa(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function Gtt(t){return!t.isGroup}function A5r(t){return t.shape!=null}function HN(t,e,r){if(!t||!e)return;function n(s){var o={};return s.traverse(function(l){Gtt(l)&&l.anid&&(o[l.anid]=l)}),o}function i(s){var o={x:s.x,y:s.y,rotation:s.rotation};return A5r(s)&&(o.shape=lr(s.shape)),o}var a=n(t);e.traverse(function(s){if(Gtt(s)&&s.anid){var o=a[s.anid];if(o){var l=i(s);s.attr(i(o)),Hn(s,l,r,Cr(s).dataIndex)}}})}function lfe(t,e){return vt(t,function(r){var n=r[0];n=en(n,e.x),n=Ai(n,e.x+e.width);var i=r[1];return i=en(i,e.y),i=Ai(i,e.y+e.height),[n,i]})}function Htt(t,e){var r=en(t.x,e.x),n=Ai(t.x+t.width,e.x+e.width),i=en(t.y,e.y),a=Ai(t.y+t.height,e.y+e.height);if(n>=r&&a>=i)return{x:r,y:i,width:n-r,height:a-i}}function x_(t,e,r){var n=ot({rectHover:!0},e),i=n.style={strokeNoScale:!0};if(r=r||{x:-1,y:-1,width:2,height:2},t)return t.indexOf("image://")===0?(i.image=t.slice(8),mr(i,r),new Yo(n)):y_(t.replace("path://",""),n,r,"center")}function WN(t,e,r,n,i){for(var a=0,s=i[i.length-1];a1)return!1;var v=cfe(p,g,h,d)/f;return!(v<0||v>1)}function cfe(t,e,r,n){return t*n-r*e}function T5r(t){return t<=1e-6&&t>=-1e-6}function aT(t,e,r,n,i){return e==null||(zn(e)?Ra[0]=Ra[1]=Ra[2]=Ra[3]=e:(Ra[0]=e[0],Ra[1]=e[1],Ra[2]=e[2],Ra[3]=e[3]),n&&(Ra[0]=en(0,Ra[0]),Ra[1]=en(0,Ra[1]),Ra[2]=en(0,Ra[2]),Ra[3]=en(0,Ra[3])),r&&(Ra[0]=-Ra[0],Ra[1]=-Ra[1],Ra[2]=-Ra[2],Ra[3]=-Ra[3]),Ytt(t,Ra,"x","width",3,1,i&&i[0]||0),Ytt(t,Ra,"y","height",0,2,i&&i[1]||0)),t}var Ra=[0,0,0,0];function Ytt(t,e,r,n,i,a,s){var o=e[a]+e[i],l=t[n];t[n]+=o,s=en(0,Ai(s,l)),t[n]=0?-e[i]:e[a]>=0?l+e[a]:Za(o)>1e-8?(l-s)*e[i]/o:0):t[r]-=e[i]}function uy(t){var e=t.itemTooltipOption,r=t.componentModel,n=t.itemName,i=Nt(e)?{formatter:e}:e,a=r.mainType,s=r.componentIndex,o={componentType:a,name:n,$vars:["name"]};o[a+"Index"]=s;var l=t.formatterParamsExtra;l&&de(kn(l),function(h){Kt(o,h)||(o[h]=l[h],o.$vars.push(h))});var u=Cr(t.el);u.componentMainType=a,u.componentIndex=s,u.tooltipConfig={name:n,option:mr({content:n,encodeHTMLContent:!0,formatterParams:o},i)}}function ufe(t,e){var r;t.isGroup&&(r=e(t)),r||t.traverse(e)}function bx(t,e){if(t)if(ft(t))for(var r=0;re&&(e=s),se&&(r=e=0),{min:r,max:e}}function _H(t,e,r){jtt(t,e,r,-1/0)}function jtt(t,e,r,n){if(t.ignoreModelZ)return n;var i=t.getTextContent(),a=t.getTextGuideLine(),s=t.isGroup;if(s)for(var o=t.childrenRef(),l=0;l=0&&o.push(l)}),o}}function xx(t,e){return Vr(Vr({},t,!0),e,!0)}const P5r={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},N5r={time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}};var MH="ZH",bfe="EN",T_=bfe,IH={},xfe={},art=Rn.domSupported?function(){var t=(document.documentElement.lang||navigator.language||navigator.browserLanguage||T_).toUpperCase();return t.indexOf(MH)>-1?MH:T_}():T_;function wfe(t,e){t=t.toUpperCase(),xfe[t]=new yn(e),IH[t]=e}function B5r(t){if(Nt(t)){var e=IH[t.toUpperCase()]||{};return t===MH||t===bfe?lr(e):Vr(lr(e),lr(IH[T_]),!1)}else return Vr(lr(t),lr(IH[T_]),!1)}function Afe(t){return xfe[t]}function $5r(){return xfe[T_]}wfe(bfe,P5r),wfe(MH,N5r);var Tfe=null;function F5r(t){Tfe||(Tfe=t)}function Ns(){return Tfe}function srt(t,e){var r=Ns(),n=e.breakOption,i=e.breakParsed;return!i&&r&&(i=r.parseAxisBreakOption(n,t)),i}function PH(t){var e=t.brk;return e?e.breaks:[]}function NH(t){var e=t.brk;return e?e.hasBreaks():!1}var Sfe=1e3,Cfe=Sfe*60,jN=Cfe*60,Vf=jN*24,ort=Vf*365,z5r={year:/({yyyy}|{yy})/,month:/({MMMM}|{MMM}|{MM}|{M})/,day:/({dd}|{d})/,hour:/({HH}|{H}|{hh}|{h})/,minute:/({mm}|{m})/,second:/({ss}|{s})/,millisecond:/({SSS}|{S})/},BH={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}"},U5r="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}",$H="{yyyy}-{MM}-{dd}",lrt={year:"{yyyy}",month:"{yyyy}-{MM}",day:$H,hour:$H+" "+BH.hour,minute:$H+" "+BH.minute,second:$H+" "+BH.second,millisecond:U5r},Ld=["year","month","day","hour","minute","second","millisecond"],V5r=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function Q5r(t){return!Nt(t)&&!ur(t)?G5r(t):t}function G5r(t){t=t||{};var e={},r=!0;return de(Ld,function(n){r&&(r=t[n]==null)}),de(Ld,function(n,i){var a=t[n];e[n]={};for(var s=null,o=i;o>=0;o--){var l=Ld[o],u=yr(a)&&!ft(a)?a[l]:a,h=void 0;ft(u)?(h=u.slice(),s=h[0]||""):Nt(u)?(s=u,h=[s]):(s==null?s=BH[n]:z5r[l].test(s)||(s=e[l][l][0]+" "+s),h=[s],r&&(h[1]="{primary|"+s+"}")),e[n][l]=h}}),e}function Au(t,e){return t+="","0000".substr(0,e-t.length)+t}function XN(t){switch(t){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return t}}function H5r(t){return t===XN(t)}function W5r(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function KN(t,e,r,n){var i=ym(t),a=i[crt(r)](),s=i[Ofe(r)]()+1,o=Math.floor((s-1)/3)+1,l=i[kfe(r)](),u=i["get"+(r?"UTC":"")+"Day"](),h=i[Efe(r)](),d=(h-1)%12+1,f=i[_fe(r)](),p=i[Rfe(r)](),g=i[Dfe(r)](),m=h>=12?"pm":"am",v=m.toUpperCase(),y=n instanceof yn?n:Afe(n||art)||$5r(),b=y.getModel("time"),x=b.get("month"),w=b.get("monthAbbr"),A=b.get("dayOfWeek"),T=b.get("dayOfWeekAbbr");return(e||"").replace(/{a}/g,m+"").replace(/{A}/g,v+"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,Au(a%100+"",2)).replace(/{Q}/g,o+"").replace(/{MMMM}/g,x[s-1]).replace(/{MMM}/g,w[s-1]).replace(/{MM}/g,Au(s,2)).replace(/{M}/g,s+"").replace(/{dd}/g,Au(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,A[u]).replace(/{ee}/g,T[u]).replace(/{e}/g,u+"").replace(/{HH}/g,Au(h,2)).replace(/{H}/g,h+"").replace(/{hh}/g,Au(d+"",2)).replace(/{h}/g,d+"").replace(/{mm}/g,Au(f,2)).replace(/{m}/g,f+"").replace(/{ss}/g,Au(p,2)).replace(/{s}/g,p+"").replace(/{SSS}/g,Au(g,3)).replace(/{S}/g,g+"")}function Y5r(t,e,r,n,i){var a=null;if(Nt(r))a=r;else if(ur(r)){var s={time:t.time,level:t.time?t.time.level:0},o=Ns();o&&o.makeAxisLabelFormatterParamBreak(s,t.break),a=r(t.value,e,s)}else{var l=t.time;if(l){var u=r[l.lowerTimeUnit][l.upperTimeUnit];a=u[Math.min(l.level,u.length-1)]||""}else{var h=S_(t.value,i);a=r[h][h][0]}}return KN(new Date(t.value),a,i,n)}function S_(t,e){var r=ym(t),n=r[Ofe(e)]()+1,i=r[kfe(e)](),a=r[Efe(e)](),s=r[_fe(e)](),o=r[Rfe(e)](),l=r[Dfe(e)](),u=l===0,h=u&&o===0,d=h&&s===0,f=d&&a===0,p=f&&i===1,g=p&&n===1;return g?"year":p?"month":f?"day":d?"hour":h?"minute":u?"second":"millisecond"}function FH(t,e,r){switch(e){case"year":t[urt(r)](0);case"month":t[hrt(r)](1);case"day":t[drt(r)](0);case"hour":t[frt(r)](0);case"minute":t[prt(r)](0);case"second":t[grt(r)](0)}return t}function crt(t){return t?"getUTCFullYear":"getFullYear"}function Ofe(t){return t?"getUTCMonth":"getMonth"}function kfe(t){return t?"getUTCDate":"getDate"}function Efe(t){return t?"getUTCHours":"getHours"}function _fe(t){return t?"getUTCMinutes":"getMinutes"}function Rfe(t){return t?"getUTCSeconds":"getSeconds"}function Dfe(t){return t?"getUTCMilliseconds":"getMilliseconds"}function q5r(t){return t?"setUTCFullYear":"setFullYear"}function urt(t){return t?"setUTCMonth":"setMonth"}function hrt(t){return t?"setUTCDate":"setDate"}function drt(t){return t?"setUTCHours":"setHours"}function frt(t){return t?"setUTCMinutes":"setMinutes"}function prt(t){return t?"setUTCSeconds":"setSeconds"}function grt(t){return t?"setUTCMilliseconds":"setMilliseconds"}function j5r(t,e,r,n,i,a,s,o){var l=new Pn({style:{text:t,font:e,align:r,verticalAlign:n,padding:i,rich:a,overflow:s?"truncate":null,lineHeight:o}});return l.getBoundingRect()}function Lfe(t){if(!dde(t))return Nt(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function Mfe(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,function(r,n){return n.toUpperCase()}),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}var C_=aN;function Ife(t,e,r){var n="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function i(h){return h&&Td(h)?h:"-"}function a(h){return Bf(h)}var s=e==="time",o=t instanceof Date;if(s||o){var l=s?ym(t):t;if(isNaN(+l)){if(o)return"-"}else return KN(l,n,r)}if(e==="ordinal")return pG(t)?i(t):zn(t)&&a(t)?t+"":"-";var u=bm(t);return a(u)?Lfe(u):pG(t)?i(t):typeof t=="boolean"?t+"":"-"}var mrt=["a","b","c","d","e","f","g"],Pfe=function(t,e){return"{"+t+(e??"")+"}"};function Nfe(t,e,r){ft(e)||(e=[e]);var n=e.length;if(!n)return"";for(var i=e[0].$vars||[],a=0;a':'';var s=r.markerId||"markerX";return{renderMode:a,content:"{"+s+"|} ",style:i==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:n}:{width:10,height:10,borderRadius:5,backgroundColor:n}}}function X5r(t,e,r){(t==="week"||t==="month"||t==="quarter"||t==="half-year"||t==="year")&&(t=`MM-dd -yyyy`);var n=ym(e),i=r?"getUTC":"get",a=n[i+"FullYear"](),s=n[i+"Month"]()+1,o=n[i+"Date"](),l=n[i+"Hours"](),u=n[i+"Minutes"](),h=n[i+"Seconds"](),d=n[i+"Milliseconds"]();return t=t.replace("MM",Au(s,2)).replace("M",s).replace("yyyy",a).replace("yy",Au(a%100+"",2)).replace("dd",Au(o,2)).replace("d",o).replace("hh",Au(l,2)).replace("h",l).replace("mm",Au(u,2)).replace("m",u).replace("ss",Au(h,2)).replace("s",h).replace("SSS",Au(d,3)),t}function K5r(t){return t&&t.charAt(0).toUpperCase()+t.substr(1)}function cT(t,e){return e=e||"transparent",Nt(t)?t:yr(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}function zH(t,e){if(e==="_blank"||e==="blank"){var r=window.open();r.opener=null,r.location.href=t}else window.open(t,e)}var UH={},Bfe={},O_=function(){function t(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return t.prototype.create=function(e,r){this._nonSeriesBoxMasterList=n(UH),this._normalMasterList=n(Bfe);function n(i,a){var s=[];return de(i,function(o,l){var u=o.create(e,r);s=s.concat(u||[])}),s}},t.prototype.update=function(e,r){de(this._normalMasterList,function(n){n.update&&n.update(e,r)})},t.prototype.getCoordinateSystems=function(){return this._normalMasterList.concat(this._nonSeriesBoxMasterList)},t.register=function(e,r){if(e==="matrix"||e==="calendar"){UH[e]=r;return}Bfe[e]=r},t.get=function(e){return Bfe[e]||UH[e]},t}();function Z5r(t){return!!UH[t]}var J5r=1,brt=2;function e4r(t){xrt.set(t.fullType,{getCoord2:void 0}).getCoord2=t.getCoord2}var xrt=Yt();function wrt(t){var e=t.getShallow("coord",!0),r=J5r;if(e==null){var n=xrt.get(t.type);n&&n.getCoord2&&(r=brt,e=n.getCoord2(t))}return{coord:e,from:r}}var k_=0,VH=1,Art=2;function Trt(t,e){var r=t.getShallow("coordinateSystem"),n=t.getShallow("coordinateSystemUsage",!0),i=k_;if(r){var a=t.mainType==="series";n==null&&(n=a?"data":"box"),n==="data"?(i=VH,a||(i=k_)):n==="box"&&(i=Art,!a&&!Z5r(r)&&(i=k_))}return{coordSysType:r,kind:i}}function ZN(t){var e=t.targetModel,r=t.coordSysType,n=t.coordSysProvider,i=t.isDefaultDataCoordSys;t.allowNotFound;var a=Trt(e),s=a.kind,o=a.coordSysType;if(i&&s!==VH&&(s=VH,o=r),s===k_||o!==r)return k_;var l=n(r,e);return l?(s===VH?e.coordinateSystem=l:e.boxCoordinateSystem=l,s):k_}var Srt=function(t,e){var r=e.getReferringComponents(t,ds).models[0];return r&&r.coordinateSystem},QH=de,Crt=["left","right","top","bottom","width","height"],uT=[["width","left","right"],["height","top","bottom"]];function $fe(t,e,r,n,i){var a=0,s=0;n==null&&(n=1/0),i==null&&(i=1/0);var o=0;e.eachChild(function(l,u){var h=l.getBoundingRect(),d=e.childAt(u+1),f=d&&d.getBoundingRect(),p,g;if(t==="horizontal"){var m=h.width+(f?-f.x+h.x:0);p=a+m,p>n||l.newline?(a=0,p=m,s+=o+r,o=h.height):o=Math.max(o,h.height)}else{var v=h.height+(f?-f.y+h.y:0);g=s+v,g>i||l.newline?(a+=o+r,s=0,g=v,o=h.width):o=Math.max(o,h.width)}l.newline||(l.x=a,l.y=s,l.markRedraw(),t==="horizontal"?a=p+r:s=g+r)})}var hT=$fe;qr($fe,"vertical"),qr($fe,"horizontal");function Ort(t,e){return{left:t.getShallow("left",e),top:t.getShallow("top",e),right:t.getShallow("right",e),bottom:t.getShallow("bottom",e),width:t.getShallow("width",e),height:t.getShallow("height",e)}}function t4r(t,e){var r=Co(t,e,{enableLayoutOnlyByCenter:!0}),n=t.getBoxLayoutParams(),i,a;if(r.type===JN.point)a=r.refPoint,i=da(n,{width:e.getWidth(),height:e.getHeight()});else{var s=t.get("center"),o=ft(s)?s:[s,s];i=da(n,r.refContainer),a=r.boxCoordFrom===brt?r.refPoint:[Qt(o[0],i.width)+i.x,Qt(o[1],i.height)+i.y]}return{viewRect:i,center:a}}function krt(t,e){var r=t4r(t,e),n=r.viewRect,i=r.center,a=t.get("radius");ft(a)||(a=[0,a]);var s=Qt(n.width,e.getWidth()),o=Qt(n.height,e.getHeight()),l=Math.min(s,o),u=Qt(a[0],l/2),h=Qt(a[1],l/2);return{cx:i[0],cy:i[1],r0:u,r:h,viewRect:n}}function da(t,e,r){r=C_(r||0);var n=e.width,i=e.height,a=Qt(t.left,n),s=Qt(t.top,i),o=Qt(t.right,n),l=Qt(t.bottom,i),u=Qt(t.width,n),h=Qt(t.height,i),d=r[2]+r[0],f=r[1]+r[3],p=t.aspect;switch(isNaN(u)&&(u=n-o-f-a),isNaN(h)&&(h=i-l-d-s),p!=null&&(isNaN(u)&&isNaN(h)&&(p>n/i?u=n*.8:h=i*.8),isNaN(u)&&(u=p*h),isNaN(h)&&(h=u/p)),isNaN(a)&&(a=n-o-u-f),isNaN(s)&&(s=i-l-h-d),t.left||t.right){case"center":a=n/2-u/2-r[3];break;case"right":a=n-u-f;break}switch(t.top||t.bottom){case"middle":case"center":s=i/2-h/2-r[0];break;case"bottom":s=i-h-d;break}a=a||0,s=s||0,isNaN(u)&&(u=n-f-a-(o||0)),isNaN(h)&&(h=i-d-s-(l||0));var g=new fr((e.x||0)+a+r[3],(e.y||0)+s+r[0],u,h);return g.margin=r,g}function Ert(t,e,r){var n=t.getShallow("preserveAspect",!0);if(!n)return e;var i=e.width/e.height;if(Math.abs(Math.atan(r)-Math.atan(i))<1e-9)return e;var a=t.getShallow("preserveAspectAlign",!0),s=t.getShallow("preserveAspectVerticalAlign",!0),o={width:e.width,height:e.height},l=n==="cover";return i>r&&!l||i=m)return d;for(var v=0;v=0;l--)o=Vr(o,i[l],!0);n.defaultOption=o}return n.defaultOption},e.prototype.getReferringComponents=function(r,n){var i=r+"Index",a=r+"Id";return i_(this.ecModel,r,{index:this.get(i,!0),id:this.get(a,!0)},n)},e.prototype.getBoxLayoutParams=function(){return Ort(this,!1)},e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(r){this.option.zlevel=r},e.protoInitialize=function(){var r=e.prototype;r.type="component",r.id="",r.name="",r.mainType="",r.subType="",r.componentIndex=0}(),e}(yn);wet(fn,yn),nH(fn),M5r(fn),I5r(fn,i4r);function i4r(t){var e=[];return de(fn.getClassesByMainType(t),function(r){e=e.concat(r.dependencies||r.prototype.dependencies||[])}),e=vt(e,function(r){return wm(r).main}),t!=="dataset"&&Ir(e,"dataset")<=0&&e.unshift("dataset"),e}var et={color:{},darkColor:{},size:{}},Bs=et.color={theme:["#5070dd","#b6d634","#505372","#ff994d","#0ca8df","#ffd10a","#fb628b","#785db0","#3fbe95"],neutral00:"#fff",neutral05:"#f4f7fd",neutral10:"#e8ebf0",neutral15:"#dbdee4",neutral20:"#cfd2d7",neutral25:"#c3c5cb",neutral30:"#b7b9be",neutral35:"#aaacb2",neutral40:"#9ea0a5",neutral45:"#929399",neutral50:"#86878c",neutral55:"#797b7f",neutral60:"#6d6e73",neutral65:"#616266",neutral70:"#54555a",neutral75:"#48494d",neutral80:"#3c3c41",neutral85:"#303034",neutral90:"#232328",neutral95:"#17171b",neutral99:"#000",accent05:"#eff1f9",accent10:"#e0e4f2",accent15:"#d0d6ec",accent20:"#c0c9e6",accent25:"#b1bbdf",accent30:"#a1aed9",accent35:"#91a0d3",accent40:"#8292cc",accent45:"#7285c6",accent50:"#6578ba",accent55:"#5c6da9",accent60:"#536298",accent65:"#4a5787",accent70:"#404c76",accent75:"#374165",accent80:"#2e3654",accent85:"#252b43",accent90:"#1b2032",accent95:"#121521",transparent:"rgba(0,0,0,0)",highlight:"rgba(255,231,130,0.8)"};ot(Bs,{primary:Bs.neutral80,secondary:Bs.neutral70,tertiary:Bs.neutral60,quaternary:Bs.neutral50,disabled:Bs.neutral20,border:Bs.neutral30,borderTint:Bs.neutral20,borderShade:Bs.neutral40,background:Bs.neutral05,backgroundTint:"rgba(234,237,245,0.5)",backgroundTransparent:"rgba(255,255,255,0)",backgroundShade:Bs.neutral10,shadow:"rgba(0,0,0,0.2)",shadowTint:"rgba(129,130,136,0.2)",axisLine:Bs.neutral70,axisLineTint:Bs.neutral40,axisTick:Bs.neutral70,axisTickMinor:Bs.neutral60,axisLabel:Bs.neutral70,axisSplitLine:Bs.neutral15,axisMinorSplitLine:Bs.neutral05});for(var fT in Bs)if(Bs.hasOwnProperty(fT)){var Rrt=Bs[fT];fT==="theme"?et.darkColor.theme=Bs.theme.slice():fT==="highlight"?et.darkColor.highlight="rgba(255,231,130,0.4)":fT.indexOf("accent")===0?et.darkColor[fT]=ey(Rrt,null,function(t){return t*.5},function(t){return Math.min(1,1.3-t)}):et.darkColor[fT]=ey(Rrt,null,function(t){return t*.9},function(t){return 1-Math.pow(t,1.5)})}et.size={xxs:2,xs:5,s:10,m:15,l:20,xl:30,xxl:40,xxxl:50};var Drt="";typeof navigator<"u"&&(Drt=navigator.platform||"");var E_="rgba(0, 0, 0, 0.2)",Lrt=et.color.theme[0],a4r=ey(Lrt,null,null,.9);const Mrt={darkMode:"auto",colorBy:"series",color:et.color.theme,gradientColor:[a4r,Lrt],aria:{decal:{decals:[{color:E_,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:E_,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:E_,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:E_,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:E_,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:E_,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:Drt.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var ac={Must:1,Might:2,Not:3},Irt=Qr();function s4r(t){Irt(t).datasetMap=Yt()}function Prt(t,e,r){var n={},i=zfe(e);if(!i||!t)return n;var a=[],s=[],o=e.ecModel,l=Irt(o).datasetMap,u=i.uid+"_"+r.seriesLayoutBy,h,d;t=t.slice(),de(t,function(m,v){var y=yr(m)?m:t[v]={name:m};y.type==="ordinal"&&h==null&&(h=v,d=g(y)),n[y.name]=[]});var f=l.get(u)||l.set(u,{categoryWayDim:d,valueWayDim:0});de(t,function(m,v){var y=m.name,b=g(m);if(h==null){var x=f.valueWayDim;p(n[y],x,b),p(s,x,b),f.valueWayDim+=b}else if(h===v)p(n[y],0,b),p(a,0,b);else{var x=f.categoryWayDim;p(n[y],x,b),p(s,x,b),f.categoryWayDim+=b}});function p(m,v,y){for(var b=0;be)return t[n];return t[r-1]}function Frt(t,e,r,n,i,a,s){a=a||t;var o=e(a),l=o.paletteIdx||0,u=o.paletteNameMap=o.paletteNameMap||{};if(u.hasOwnProperty(i))return u[i];var h=s==null||!n?r:h4r(n,s);if(h=h||r,!(!h||!h.length)){var d=h[l];return i&&(u[i]=d),o.paletteIdx=(l+1)%h.length,d}}function d4r(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}var HH,t8,zrt,Urt="\0_ec_inner",f4r=1,Gfe=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(r,n,i,a,s,o){a=a||{},this.option=null,this._theme=new yn(a),this._locale=new yn(s),this._optionManager=o},e.prototype.setOption=function(r,n,i){var a=Grt(n);this._optionManager.setOption(r,i,a),this._resetOption(null,a)},e.prototype.resetOption=function(r,n){return this._resetOption(r,Grt(n))},e.prototype._resetOption=function(r,n){var i=!1,a=this._optionManager;if(!r||r==="recreate"){var s=a.mountOption(r==="recreate");!this.option||r==="recreate"?zrt(this,s):(this.restoreData(),this._mergeOption(s,n)),i=!0}if((r==="timeline"||r==="media")&&this.restoreData(),!r||r==="recreate"||r==="timeline"){var o=a.getTimelineOption(this);o&&(i=!0,this._mergeOption(o,n))}if(!r||r==="recreate"||r==="media"){var l=a.getMediaOption(this);l.length&&de(l,function(u){i=!0,this._mergeOption(u,n)},this)}return i},e.prototype.mergeOption=function(r){this._mergeOption(r,null)},e.prototype._mergeOption=function(r,n){var i=this.option,a=this._componentsMap,s=this._componentsCount,o=[],l=Yt(),u=n&&n.replaceMergeMainTypeMap;s4r(this),de(r,function(d,f){d!=null&&(fn.hasClass(f)?f&&(o.push(f),l.set(f,!0)):i[f]=i[f]==null?lr(d):Vr(i[f],d,!0))}),u&&u.each(function(d,f){fn.hasClass(f)&&!l.get(f)&&(o.push(f),l.set(f,!0))}),fn.topologicalTravel(o,fn.getAllClassMainTypes(),h,this);function h(d){var f=c4r(this,d,Qi(r[d])),p=a.get(d),g=p?u&&u.get(d)?"replaceMerge":"normalMerge":"replaceAll",m=fet(p,f,g);wEr(m,d,fn),i[d]=null,a.set(d,null),s.set(d,0);var v=[],y=[],b=0,x;de(m,function(w,A){var T=w.existing,S=w.newOption;if(!S)T&&(T.mergeOption({},this),T.optionUpdated({},!1));else{var O=d==="series",k=fn.getClass(d,w.keyInfo.subType,!O);if(!k)return;if(d==="tooltip"){if(x)return;x=!0}if(T&&T.constructor===k)T.name=w.keyInfo.name,T.mergeOption(S,this),T.optionUpdated(S,!1);else{var E=ot({componentIndex:A},w.keyInfo);T=new k(S,this,this,E),ot(T,E),w.brandNew&&(T.__requireNewView=!0),T.init(S,this,this),T.optionUpdated(null,!0)}}T?(v.push(T.option),y.push(T),b++):(v.push(void 0),y.push(void 0))},this),i[d]=v,a.set(d,y),s.set(d,b),d==="series"&&HH(this)}this._seriesIndices||HH(this)},e.prototype.getOption=function(){var r=lr(this.option);return de(r,function(n,i){if(fn.hasClass(i)){for(var a=Qi(n),s=a.length,o=!1,l=s-1;l>=0;l--)a[l]&&!DN(a[l])?o=!0:(a[l]=null,!o&&s--);a.length=s,r[i]=a}}),delete r[Urt],r},e.prototype.setTheme=function(r){this._theme=new yn(r),this._resetOption("recreate",null)},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(r){this._payload=r},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(r,n){var i=this._componentsMap.get(r);if(i){var a=i[n||0];if(a)return a;if(n==null){for(var s=0;s=e:r==="max"?t<=e:t===e}function w4r(t,e){return t.join(",")===e.join(",")}var Yp=de,r8=yr,Hrt=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function Hfe(t){var e=t&&t.itemStyle;if(e)for(var r=0,n=Hrt.length;r0?r[s-1].seriesModel:null)}),D4r(r)}})}function D4r(t){de(t,function(e,r){var n=[],i=[NaN,NaN],a=[e.stackResultDimension,e.stackedOverDimension],s=e.data,o=e.isStackedByIndex,l=e.seriesModel.get("stackStrategy")||"samesign";s.modify(a,function(u,h,d){var f=s.get(e.stackedDimension,d);if(isNaN(f))return i;var p,g;o?g=s.getRawIndex(d):p=s.get(e.stackedByDimension,d);for(var m=NaN,v=r-1;v>=0;v--){var y=t[v];if(o||(g=y.data.rawIndexOf(y.stackedByDimension,p)),g>=0){var b=y.data.getByRawIndex(y.stackResultDimension,g);if(l==="all"||l==="positive"&&b>0||l==="negative"&&b<0||l==="samesign"&&f>=0&&b>0||l==="samesign"&&f<=0&&b<0){f=NA(f,b),m=b;break}}}return n[0]=f,n[1]=m,n})})}var WH=function(){function t(e){this.data=e.data||(e.sourceFormat===Qp?{}:[]),this.sourceFormat=e.sourceFormat||Jet,this.seriesLayoutBy=e.seriesLayoutBy||Gp,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var r=this.dimensionsDefine=e.dimensionsDefine;if(r)for(var n=0;nm&&(m=x)}p[0]=g,p[1]=m}},i=function(){return this._data?this._data.length/this._dimSize:0};rnt=(e={},e[wl+"_"+Gp]={pure:!0,appendData:a},e[wl+"_"+XA]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[Rd]={pure:!0,appendData:a},e[Qp]={pure:!0,appendData:function(s){var o=this._data;de(s,function(l,u){for(var h=o[u]||(o[u]=[]),d=0;d<(l||[]).length;d++)h.push(l[d])})}},e[_d]={appendData:a},e[mx]={persistent:!1,pure:!0,appendData:function(s){this._data=s},clean:function(){this._offset+=this.count(),this._data=null}},e);function a(s){for(var o=0;o=0&&(m=s.interpolatedValue[v])}return m!=null?m+"":""})}},t.prototype.getRawValue=function(e,r){return __(this.getData(r),e)},t.prototype.formatTooltip=function(e,r,n){},t}();function unt(t){var e,r;return yr(t)?t.type&&(r=t):e=t,{text:e,frag:r}}function a8(t){return new F4r(t)}var F4r=function(){function t(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return t.prototype.perform=function(e){var r=this._upstream,n=e&&e.skip;if(this._dirty&&r){var i=this.context;i.data=i.outputData=r.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!n&&(a=this._plan(this.context));var s=h(this._modBy),o=this._modDataCount||0,l=h(e&&e.modBy),u=e&&e.modDataCount||0;(s!==l||o!==u)&&(a="reset");function h(b){return!(b>=1)&&(b=1),b}var d;(this._dirty||a==="reset")&&(this._dirty=!1,d=this._doReset(n)),this._modBy=l,this._modDataCount=u;var f=e&&e.step;if(r?this._dueEnd=r._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var p=this._dueIndex,g=Math.min(f!=null?this._dueIndex+f:1/0,this._dueEnd);if(!n&&(d||p1&&n>0?o:s}};return a;function s(){return e=t?null:le},gte:function(t,e){return t>=e}},U4r=function(){function t(e,r){if(!zn(r)){var n="";ii(n)}this._opFn=fnt[e],this._rvalFloat=bm(r)}return t.prototype.evaluate=function(e){return zn(e)?this._opFn(e,this._rvalFloat):this._opFn(bm(e),this._rvalFloat)},t}(),pnt=function(){function t(e,r){var n=e==="desc";this._resultLT=n?1:-1,r==null&&(r=n?"min":"max"),this._incomparable=r==="min"?-1/0:1/0}return t.prototype.evaluate=function(e,r){var n=zn(e)?e:bm(e),i=zn(r)?r:bm(r),a=isNaN(n),s=isNaN(i);if(a&&(n=this._incomparable),s&&(i=this._incomparable),a&&s){var o=Nt(e),l=Nt(r);o&&(n=l?e:0),l&&(i=o?r:0)}return ni?-this._resultLT:0},t}(),V4r=function(){function t(e,r){this._rval=r,this._isEQ=e,this._rvalTypeof=typeof r,this._rvalFloat=bm(r)}return t.prototype.evaluate=function(e){var r=e===this._rval;if(!r){var n=typeof e;n!==this._rvalTypeof&&(n==="number"||this._rvalTypeof==="number")&&(r=bm(e)===this._rvalFloat)}return this._isEQ?r:!r},t}();function Q4r(t,e){return t==="eq"||t==="ne"?new V4r(t==="eq",e):Kt(fnt,t)?new U4r(t,e):null}function gnt(t){var e="",r=-1/0,n=-1/0,i=1/0,a=1/0;return t&&(t.g!=null&&(e+="G"+t.g,r=t.g),t.ge!=null&&(e+="GE"+t.ge,n=t.ge),t.l!=null&&(e+="L"+t.l,i=t.l),t.le!=null&&(e+="LE"+t.le,a=t.le)),{key:e,g:r,ge:n,l:i,le:a}}function mnt(t,e){return e>t.g&&e>=t.ge&&e65535?J4r:e3r}function t3r(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function wnt(t,e,r,n,i){var a=xnt[r||"float"];if(i){var s=t[e],o=s&&s.length;if(o!==n){for(var l=new a(n),u=0;uv[1]&&(v[1]=m)}return this._rawCount=this._count=l,{start:o,end:l}},t.prototype._initDataFromProvider=function(e,r,n){for(var i=this._provider,a=this._chunks,s=this._dimensions,o=s.length,l=this._rawExtent,u=vt(s,function(b){return b.property}),h=0;hy[1]&&(y[1]=v)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=r,this._extent=[]},t.prototype.count=function(){return this._count},t.prototype.get=function(e,r){if(!(r>=0&&r=0&&r=this._rawCount||e<0)return-1;if(!this._indices)return e;var r=this._indices,n=r[e];if(n!=null&&ne)a=s-1;else return s}return-1},t.prototype.getIndices=function(){var e,r=this._indices;if(r){var n=r.constructor,i=this._count;if(n===Array){e=new n(i);for(var a=0;a=d&&b<=f||isNaN(b))&&(l[u++]=m),m++}g=!0}else if(a===2){for(var v=p[i[0]],x=p[i[1]],w=e[i[1]][0],A=e[i[1]][1],y=0;y=d&&b<=f||isNaN(b))&&(T>=w&&T<=A||isNaN(T))&&(l[u++]=m),m++}g=!0}}if(!g)if(a===1)for(var y=0;y=d&&b<=f||isNaN(b))&&(l[u++]=S)}else for(var y=0;ye[E][1])&&(O=!1)}O&&(l[u++]=r.getRawIndex(y))}return uy[1]&&(y[1]=v)}}}},t.prototype.lttbDownSample=function(e,r){var n=this.clone([e],!0),i=n._chunks,a=i[e],s=this.count(),o=0,l=Math.floor(1/r),u=this.getRawIndex(0),h,d,f,p=new(R_(this._rawCount))(Math.min((Math.ceil(s/l)+2)*2,s));p[o++]=u;for(var g=1;gh&&(h=d,f=w)}_>0&&_o&&(m=o-h);for(var v=0;vg&&(g=b,p=h+v)}var x=this.getRawIndex(d),w=this.getRawIndex(p);dh-g&&(l=h-g,o.length=l);for(var m=0;md[1]&&(d[1]=y),f[p++]=b}return a._count=p,a._indices=f,a._updateGetRawIdx(),a},t.prototype.each=function(e,r){if(this._count)for(var n=e.length,i=this._chunks,a=0,s=this.count();ap&&(p=v))}return l[h]=[f,p]},t.prototype.getRawDataItem=function(e){var r=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(r);for(var n=[],i=this._chunks,a=0;a=0?this._indices[e]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=function(){function e(r,n,i,a){return Ax(r[a],this._dimensions[a])}Jfe={arrayRows:e,objectRows:function(r,n,i,a){return Ax(r[n],this._dimensions[a])},keyedColumns:e,original:function(r,n,i,a){var s=r&&(r.value==null?r:r.value);return Ax(s instanceof Array?s[a]:s,this._dimensions[a])},typedArray:function(r,n,i,a){return r[a]}}}(),t}(),Ant=function(){function t(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return t.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},t.prototype._setLocalSource=function(e,r){this._sourceList=e,this._upstreamSignList=r,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},t.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},t.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,r=this._getUpstreamSourceManagers(),n=!!r.length,i,a;if(jH(e)){var s=e,o=void 0,l=void 0,u=void 0;if(n){var h=r[0];h.prepareSource(),u=h.getSource(),o=u.data,l=u.sourceFormat,a=[h._getVersionSign()]}else o=s.get("data",!0),l=bu(o)?mx:_d,a=[];var d=this._getSourceMetaRawOption()||{},f=u&&u.metaRawOption||{},p=Jt(d.seriesLayoutBy,f.seriesLayoutBy)||null,g=Jt(d.sourceHeader,f.sourceHeader),m=Jt(d.dimensions,f.dimensions),v=p!==f.seriesLayoutBy||!!g!=!!f.sourceHeader||m;i=v?[qfe(o,{seriesLayoutBy:p,sourceHeader:g,dimensions:m},l)]:[]}else{var y=e;if(n){var b=this._applyTransform(r);i=b.sourceList,a=b.upstreamSignList}else{var x=y.get("source",!0);i=[qfe(x,this._getSourceMetaRawOption(),null)],a=[]}}this._setLocalSource(i,a)},t.prototype._applyTransform=function(e){var r=this._sourceHost,n=r.get("transform",!0),i=r.get("fromTransformResult",!0);if(i!=null){var a="";e.length!==1&&Snt(a)}var s,o=[],l=[];return de(e,function(u){u.prepareSource();var h=u.getSource(i||0),d="";i!=null&&!h&&Snt(d),o.push(h),l.push(u._getVersionSign())}),n?s=K4r(n,o,{datasetIndex:r.componentIndex}):i!=null&&(s=[L4r(o[0])]),{sourceList:s,upstreamSignList:l}},t.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),r=0;rr:i+h+g>r){h?(o||l)&&(m?(o||(o=l,l="",u=0,h=u),a.push(o),s.push(h-u),l+=p,u+=g,o="",h=u):(l&&(o+=l,l="",u=0),a.push(o),s.push(h),o=p,h=g)):m?(a.push(l),s.push(u),l=p,u=g):(a.push(p),s.push(g));continue}h+=g,m?(l+=p,u+=g):(l&&(o+=l,l="",u=0),o+=p)}return l&&(o+=l),o&&(a.push(o),s.push(h)),a.length===1&&(h+=i),{accumWidth:h,lines:a,linesWidths:s}}function _et(t,e,r,n,i,a){if(t.baseX=r,t.baseY=n,t.outerWidth=t.outerHeight=null,!!e){var s=e.width*2,o=e.height*2;fr.set(Ret,e_(r,s,i),DA(n,o,a),s,o),fr.intersect(e,Ret,null,Det);var l=Det.outIntersectRect;t.outerWidth=l.width,t.outerHeight=l.height,t.baseX=e_(l.x,l.width,i,!0),t.baseY=DA(l.y,l.height,a,!0)}}var Ret=new fr(0,0,0,0),Det={outIntersectRect:{},clamp:!0};function Cde(t){return t!=null?t+="":t=""}function e_r(t){var e=Cde(t.text),r=t.font,n=pm(fm(r),e),i=kN(r);return Ode(t,n,i,null)}function Ode(t,e,r,n){var i=new fr(e_(t.x||0,e,t.textAlign),DA(t.y||0,r,t.textBaseline),e,r),a=n??(Let(t)?t.lineWidth:0);return a>0&&(i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a),i}function Let(t){var e=t.stroke;return e!=null&&e!=="none"&&t.lineWidth>0}var kde="__zr_style_"+Math.round(Math.random()*10),QA={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},aH={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};QA[kde]=!0;var Met=["z","z2","invisible"],t_r=["invisible"],$f=function(t){ha(e,t);function e(r){return t.call(this,r)||this}return e.prototype._init=function(r){for(var n=kn(r),i=0;i1e-4){o[0]=t-r,o[1]=e-n,l[0]=t+r,l[1]=e+n;return}if(sH[0]=Dde(i)*r+t,sH[1]=Rde(i)*n+e,oH[0]=Dde(a)*r+t,oH[1]=Rde(a)*n+e,u(o,sH,oH),h(l,sH,oH),i=i%GA,i<0&&(i=i+GA),a=a%GA,a<0&&(a=a+GA),i>a&&!s?a+=GA:ii&&(lH[0]=Dde(p)*r+t,lH[1]=Rde(p)*n+e,u(o,lH,o),h(l,lH,l))}var Ki={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},HA=[],WA=[],Am=[],dx=[],Sm=[],Tm=[],Lde=Math.min,Mde=Math.max,YA=Math.cos,qA=Math.sin,iy=Math.abs,Ide=Math.PI,fx=Ide*2,Pde=typeof Float32Array<"u",MN=[];function Nde(t){var e=Math.round(t/Ide*1e8)/1e8;return e%2*Ide}function uH(t,e){var r=Nde(t[0]);r<0&&(r+=fx);var n=r-t[0],i=t[1];i+=n,!e&&i-r>=fx?i=r+fx:e&&r-i>=fx?i=r-fx:!e&&r>i?i=r+(fx-Nde(r-i)):e&&r0&&(this._ux=iy(n/zG/e)||0,this._uy=iy(n/zG/r)||0)},t.prototype.setDPR=function(e){this.dpr=e},t.prototype.setContext=function(e){this._ctx=e},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(e,r){return this._drawPendingPt(),this.addData(Ki.M,e,r),this._ctx&&this._ctx.moveTo(e,r),this._x0=e,this._y0=r,this._xi=e,this._yi=r,this},t.prototype.lineTo=function(e,r){var n=iy(e-this._xi),i=iy(r-this._yi),a=n>this._ux||i>this._uy;if(this.addData(Ki.L,e,r),this._ctx&&a&&this._ctx.lineTo(e,r),a)this._xi=e,this._yi=r,this._pendingPtDist=0;else{var s=n*n+i*i;s>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=r,this._pendingPtDist=s)}return this},t.prototype.bezierCurveTo=function(e,r,n,i,a,s){return this._drawPendingPt(),this.addData(Ki.C,e,r,n,i,a,s),this._ctx&&this._ctx.bezierCurveTo(e,r,n,i,a,s),this._xi=a,this._yi=s,this},t.prototype.quadraticCurveTo=function(e,r,n,i){return this._drawPendingPt(),this.addData(Ki.Q,e,r,n,i),this._ctx&&this._ctx.quadraticCurveTo(e,r,n,i),this._xi=n,this._yi=i,this},t.prototype.arc=function(e,r,n,i,a,s){this._drawPendingPt(),MN[0]=i,MN[1]=a,uH(MN,s),i=MN[0],a=MN[1];var o=a-i;return this.addData(Ki.A,e,r,n,n,i,o,0,s?0:1),this._ctx&&this._ctx.arc(e,r,n,i,a,s),this._xi=YA(a)*n+e,this._yi=qA(a)*n+r,this},t.prototype.arcTo=function(e,r,n,i,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,r,n,i,a),this},t.prototype.rect=function(e,r,n,i){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,r,n,i),this.addData(Ki.R,e,r,n,i),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(Ki.Z);var e=this._ctx,r=this._x0,n=this._y0;return e&&e.closePath(),this._xi=r,this._yi=n,this},t.prototype.fill=function(e){e&&e.fill(),this.toStatic()},t.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},t.prototype.len=function(){return this._len},t.prototype.setData=function(e){if(this._saveData){var r=e.length;!(this.data&&this.data.length===r)&&Pde&&(this.data=new Float32Array(r));for(var n=0;n0&&s))for(var o=0;oh.length&&(this._expandData(),h=this.data);for(var d=0;d0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],r=0;r11&&(this.data=new Float32Array(e)))}},t.prototype.getBoundingRect=function(){Am[0]=Am[1]=Sm[0]=Sm[1]=Number.MAX_VALUE,dx[0]=dx[1]=Tm[0]=Tm[1]=-Number.MAX_VALUE;var e=this.data,r=0,n=0,i=0,a=0,s;for(s=0;sn||iy(x)>i||f===r-1)&&(m=Math.sqrt(b*b+x*x),a=v,s=y);break}case Ki.C:{var w=e[f++],A=e[f++],v=e[f++],y=e[f++],S=e[f++],T=e[f++];m=skr(a,s,w,A,v,y,S,T,10),a=S,s=T;break}case Ki.Q:{var w=e[f++],A=e[f++],v=e[f++],y=e[f++];m=lkr(a,s,w,A,v,y,10),a=v,s=y;break}case Ki.A:var O=e[f++],k=e[f++],E=e[f++],_=e[f++],I=e[f++],L=e[f++],R=L+I;f+=1,g&&(o=YA(I)*E+O,l=qA(I)*_+k),m=Mde(E,_)*Lde(fx,Math.abs(L)),a=YA(R)*E+O,s=qA(R)*_+k;break;case Ki.R:{o=a=e[f++],l=s=e[f++];var D=e[f++],M=e[f++];m=D*2+M*2;break}case Ki.Z:{var b=o-a,x=l-s;m=Math.sqrt(b*b+x*x),a=o,s=l;break}}m>=0&&(u[d++]=m,h+=m)}return this._pathLen=h,h},t.prototype.rebuildPath=function(e,r){var n=this.data,i=this._ux,a=this._uy,s=this._len,o,l,u,h,d,f,p=r<1,g,m,v=0,y=0,b,x=0,w,A;if(!(p&&(this._pathSegLen||this._calculateLength(),g=this._pathSegLen,m=this._pathLen,b=r*m,!b)))e:for(var S=0;S0&&(e.lineTo(w,A),x=0),T){case Ki.M:o=u=n[S++],l=h=n[S++],e.moveTo(u,h);break;case Ki.L:{d=n[S++],f=n[S++];var k=iy(d-u),E=iy(f-h);if(k>i||E>a){if(p){var _=g[y++];if(v+_>b){var I=(b-v)/_;e.lineTo(u*(1-I)+d*I,h*(1-I)+f*I);break e}v+=_}e.lineTo(d,f),u=d,h=f,x=0}else{var L=k*k+E*E;L>x&&(w=d,A=f,x=L)}break}case Ki.C:{var R=n[S++],D=n[S++],M=n[S++],P=n[S++],N=n[S++],F=n[S++];if(p){var _=g[y++];if(v+_>b){var I=(b-v)/_;ox(u,R,M,N,I,HA),ox(h,D,P,F,I,WA),e.bezierCurveTo(HA[1],WA[1],HA[2],WA[2],HA[3],WA[3]);break e}v+=_}e.bezierCurveTo(R,D,M,P,N,F),u=N,h=F;break}case Ki.Q:{var R=n[S++],D=n[S++],M=n[S++],P=n[S++];if(p){var _=g[y++];if(v+_>b){var I=(b-v)/_;yN(u,R,M,I,HA),yN(h,D,P,I,WA),e.quadraticCurveTo(HA[1],WA[1],HA[2],WA[2]);break e}v+=_}e.quadraticCurveTo(R,D,M,P),u=M,h=P;break}case Ki.A:var B=n[S++],V=n[S++],z=n[S++],U=n[S++],Q=n[S++],G=n[S++],X=n[S++],Y=!n[S++],le=z>U?z:U,q=iy(z-U)>.001,Z=Q+G,ee=!1;if(p){var _=g[y++];v+_>b&&(Z=Q+G*(b-v)/_,ee=!0),v+=_}if(q&&e.ellipse?e.ellipse(B,V,z,U,X,Q,Z,Y):e.arc(B,V,le,Q,Z,Y),ee)break e;O&&(o=YA(Q)*z+B,l=qA(Q)*U+V),u=YA(Z)*z+B,h=qA(Z)*U+V;break;case Ki.R:o=u=n[S],l=h=n[S+1],d=n[S++],f=n[S++];var re=n[S++],ve=n[S++];if(p){var _=g[y++];if(v+_>b){var ae=b-v;e.moveTo(d,f),e.lineTo(d+Lde(ae,re),f),ae-=re,ae>0&&e.lineTo(d+re,f+Lde(ae,ve)),ae-=ve,ae>0&&e.lineTo(d+Mde(re-ae,0),f+ve),ae-=re,ae>0&&e.lineTo(d,f+Mde(ve-ae,0));break e}v+=_}e.rect(d,f,re,ve);break;case Ki.Z:if(p){var _=g[y++];if(v+_>b){var I=(b-v)/_;e.lineTo(u*(1-I)+o*I,h*(1-I)+l*I);break e}v+=_}e.closePath(),u=o,h=l}}},t.prototype.clone=function(){var e=new t,r=this.data;return e.data=r.slice?r.slice():Array.prototype.slice.call(r),e._len=this._len,e},t.prototype.canSave=function(){return!!this._saveData},t.CMD=Ki,t.initDefaultProps=function(){var e=t.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),t}();function px(t,e,r,n,i,a,s){if(i===0)return!1;var o=i,l=0,u=t;if(s>e+o&&s>n+o||st+o&&a>r+o||ae+d&&h>n+d&&h>a+d&&h>o+d||ht+d&&u>r+d&&u>i+d&&u>s+d||ue+u&&l>n+u&&l>a+u||lt+u&&o>r+u&&o>i+u||or||h+ui&&(i+=IN);var f=Math.atan2(l,o);return f<0&&(f+=IN),f>=n&&f<=i||f+IN>=n&&f+IN<=i}function ay(t,e,r,n,i,a){if(a>e&&a>n||ai?o:0}var gx=Cm.CMD,jA=Math.PI*2,l_r=1e-4;function c_r(t,e){return Math.abs(t-e)e&&u>n&&u>a&&u>o||u1&&u_r(),p=Wo(e,n,a,o,Ff[0]),f>1&&(g=Wo(e,n,a,o,Ff[1]))),f===2?ve&&o>n&&o>a||o=0&&u<=1){for(var h=0,d=bl(e,n,a,u),f=0;fr||o<-r)return 0;var l=Math.sqrt(r*r-o*o);xu[0]=-l,xu[1]=l;var u=Math.abs(n-i);if(u<1e-4)return 0;if(u>=jA-1e-4){n=0,i=jA;var h=a?1:-1;return s>=xu[0]+t&&s<=xu[1]+t?h:0}if(n>i){var d=n;n=i,i=d}n<0&&(n+=jA,i+=jA);for(var f=0,p=0;p<2;p++){var g=xu[p];if(g+t>s){var m=Math.atan2(o,g),h=a?1:-1;m<0&&(m=jA+m),(m>=n&&m<=i||m+jA>=n&&m+jA<=i)&&(m>Math.PI/2&&m1&&(r||(o+=ay(l,u,h,d,n,i))),v&&(l=a[g],u=a[g+1],h=l,d=u),m){case gx.M:h=a[g++],d=a[g++],l=h,u=d;break;case gx.L:if(r){if(px(l,u,a[g],a[g+1],e,n,i))return!0}else o+=ay(l,u,a[g],a[g+1],n,i)||0;l=a[g++],u=a[g++];break;case gx.C:if(r){if(s_r(l,u,a[g++],a[g++],a[g++],a[g++],a[g],a[g+1],e,n,i))return!0}else o+=h_r(l,u,a[g++],a[g++],a[g++],a[g++],a[g],a[g+1],n,i)||0;l=a[g++],u=a[g++];break;case gx.Q:if(r){if(Bet(l,u,a[g++],a[g++],a[g],a[g+1],e,n,i))return!0}else o+=d_r(l,u,a[g++],a[g++],a[g],a[g+1],n,i)||0;l=a[g++],u=a[g++];break;case gx.A:var y=a[g++],b=a[g++],x=a[g++],w=a[g++],A=a[g++],S=a[g++];g+=1;var T=!!(1-a[g++]);f=Math.cos(A)*x+y,p=Math.sin(A)*w+b,v?(h=f,d=p):o+=ay(l,u,f,p,n,i);var O=(n-y)*w/x+y;if(r){if(o_r(y,b,w,A,A+S,T,e,O,i))return!0}else o+=f_r(y,b,w,A,A+S,T,O,i);l=Math.cos(A+S)*x+y,u=Math.sin(A+S)*w+b;break;case gx.R:h=l=a[g++],d=u=a[g++];var k=a[g++],E=a[g++];if(f=h+k,p=d+E,r){if(px(h,d,f,d,e,n,i)||px(f,d,f,p,e,n,i)||px(f,p,h,p,e,n,i)||px(h,p,h,d,e,n,i))return!0}else o+=ay(f,d,f,p,n,i),o+=ay(h,p,h,d,n,i);break;case gx.Z:if(r){if(px(l,u,h,d,e,n,i))return!0}else o+=ay(l,u,h,d,n,i);l=h,u=d;break}}return!r&&!c_r(u,d)&&(o+=ay(l,u,h,d,n,i)||0),o!==0}function p_r(t,e,r){return Fet(t,0,!1,e,r)}function g_r(t,e,r,n){return Fet(t,e,!0,r,n)}var hH=mr({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},QA),m_r={style:mr({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},aH.style)},Bde=ry.concat(["invisible","culling","z","z2","zlevel","parent"]),vn=function(t){ha(e,t);function e(r){return t.call(this,r)||this}return e.prototype.update=function(){var r=this;t.prototype.update.call(this);var n=this.style;if(n.decal){var i=this._decalEl=this._decalEl||new e;i.buildPath===e.prototype.buildPath&&(i.buildPath=function(l){r.buildPath(l,r.shape)}),i.silent=!0;var a=i.style;for(var s in n)a[s]!==n[s]&&(a[s]=n[s]);a.fill=n.fill?n.decal:null,a.decal=null,a.shadowColor=null,n.strokeFirst&&(a.stroke=null);for(var o=0;o.5?Khe:n>.2?Fkr:Zhe}else if(r)return Zhe}return Khe},e.prototype.getInsideTextStroke=function(r){var n=this.style.fill;if(Nt(n)){var i=this.__zr,a=!!(i&&i.isDarkMode()),s=AN(r,0)0))},e.prototype.hasFill=function(){var r=this.style,n=r.fill;return n!=null&&n!=="none"},e.prototype.getBoundingRect=function(){var r=this._rect,n=this.style,i=!r;if(i){var a=!1;this.path||(a=!0,this.createPathProxy());var s=this.path;(a||this.__dirty&YE)&&(s.beginPath(),this.buildPath(s,this.shape,!1),this.pathUpdated()),r=s.getBoundingRect()}if(this._rect=r,this.hasStroke()&&this.path&&this.path.len()>0){var o=this._rectStroke||(this._rectStroke=r.clone());if(this.__dirty||i){o.copy(r);var l=n.strokeNoScale?this.getLineScale():1,u=n.lineWidth;if(!this.hasFill()){var h=this.strokeContainThreshold;u=Math.max(u,h??4)}l>1e-10&&(o.width+=u/l,o.height+=u/l,o.x-=u/l/2,o.y-=u/l/2)}return o}return r},e.prototype.contain=function(r,n){var i=this.transformCoordToLocal(r,n),a=this.getBoundingRect(),s=this.style;if(r=i[0],n=i[1],a.contain(r,n)){var o=this.path;if(this.hasStroke()){var l=s.lineWidth,u=s.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),g_r(o,l/u,r,n)))return!0}if(this.hasFill())return p_r(o,r,n)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=YE,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(r){return this.animate("shape",r)},e.prototype.updateDuringAnimation=function(r){r==="style"?this.dirtyStyle():r==="shape"?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(r,n){r==="shape"?this.setShape(n):t.prototype.attrKV.call(this,r,n)},e.prototype.setShape=function(r,n){var i=this.shape;return i||(i=this.shape={}),typeof r=="string"?i[r]=n:ot(i,r),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&YE)},e.prototype.createStyle=function(r){return oN(hH,r)},e.prototype._innerSaveToNormal=function(r){t.prototype._innerSaveToNormal.call(this,r);var n=this._normalState;r.shape&&!n.shape&&(n.shape=ot({},this.shape))},e.prototype._applyStateObj=function(r,n,i,a,s,o){if(t.prototype._applyStateObj.call(this,r,n,i,a,s,o),this.__inHover!==WG){var l=!(n&&a),u;if(n&&n.shape?s?a?u=n.shape:(u=ot({},i.shape),ot(u,n.shape)):(u=ot({},a?this.shape:i.shape),ot(u,n.shape)):l&&(u=i.shape),u)if(s){this.shape=ot({},this.shape);for(var h={},d=kn(u),f=0;fi&&(d=o+l,o*=i/d,l*=i/d),u+h>i&&(d=u+h,u*=i/d,h*=i/d),l+u>a&&(d=l+u,l*=a/d,u*=a/d),o+h>a&&(d=o+h,o*=a/d,h*=a/d),t.moveTo(r+o,n),t.lineTo(r+i-l,n),l!==0&&t.arc(r+i-l,n+l,l,-Math.PI/2,0),t.lineTo(r+i,n+a-u),u!==0&&t.arc(r+i-u,n+a-u,u,0,Math.PI/2),t.lineTo(r+h,n+a),h!==0&&t.arc(r+h,n+a-h,h,Math.PI/2,Math.PI),t.lineTo(r,n+o),o!==0&&t.arc(r+o,n+o,o,Math.PI,Math.PI*1.5),t.closePath()}var o_=Math.round;function dH(t,e,r){if(e){var n=e.x1,i=e.x2,a=e.y1,s=e.y2;t.x1=n,t.x2=i,t.y1=a,t.y2=s;var o=r&&r.lineWidth;return o&&(o_(n*2)===o_(i*2)&&(t.x1=t.x2=Ed(n,o,!0)),o_(a*2)===o_(s*2)&&(t.y1=t.y2=Ed(a,o,!0))),t}}function zet(t,e,r){if(e){var n=e.x,i=e.y,a=e.width,s=e.height;t.x=n,t.y=i,t.width=a,t.height=s;var o=r&&r.lineWidth;return o&&(t.x=Ed(n,o,!0),t.y=Ed(i,o,!0),t.width=Math.max(Ed(n+a,o,!1)-t.x,a===0?0:1),t.height=Math.max(Ed(i+s,o,!1)-t.y,s===0?0:1)),t}}function Ed(t,e,r){if(!e)return t;var n=o_(t*2);return(n+o_(e))%2===0?n/2:(n+(r?1:-1))/2}var A_r=function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0}return t}(),S_r={},tn=function(t){ha(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new A_r},e.prototype.buildPath=function(r,n){var i,a,s,o;if(this.subPixelOptimize){var l=zet(S_r,n,this.style);i=l.x,a=l.y,s=l.width,o=l.height,l.r=n.r,n=l}else i=n.x,a=n.y,s=n.width,o=n.height;n.r?w_r(r,n):r.rect(i,a,s,o)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(vn);tn.prototype.type="rect";var Uet={fill:"#000"},Vet=2,Om={},T_r={style:mr({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},aH.style)},Pn=function(t){ha(e,t);function e(r){var n=t.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=Uet,n.attr(r),n}return e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){t.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var r=0;r0,I=0;I=0&&(R=S[L],R.align==="right");)this._placeToken(R,r,O,y,I,"right",x),k-=R.width,I-=R.width,L--;for(_+=(h-(_-v)-(b-I)-k)/2;E<=L;)R=S[E],this._placeToken(R,r,O,y,_+R.width/2,"center",x),_+=R.width,E++;y+=O}},e.prototype._placeToken=function(r,n,i,a,s,o,l){var u=n.rich[r.styleName]||{};u.text=r.text;var h=r.verticalAlign,d=a+i/2;h==="top"?d=a+r.height/2:h==="bottom"&&(d=a+i-r.height/2);var f=!r.isLineHolder&&$de(u);f&&this._renderBackground(u,n,o==="right"?s-r.width:o==="center"?s-r.width/2:s,d-r.height/2,r.width,r.height);var p=!!u.backgroundColor,g=r.textPadding;g&&(s=Xet(s,o,g),d-=r.height/2-g[0]-r.innerHeight/2);var m=this._getOrCreateChild(s_),v=m.createStyle();m.useStyle(v);var y=this._defaultStyle,b=!1,x=0,w=!1,A=jet("fill"in u?u.fill:"fill"in n?n.fill:(b=!0,y.fill)),S=qet("stroke"in u?u.stroke:"stroke"in n?n.stroke:!p&&!l&&(!y.autoStroke||b)?(x=Vet,w=!0,y.stroke):null),T=u.textShadowBlur>0||n.textShadowBlur>0;v.text=r.text,v.x=s,v.y=d,T&&(v.shadowBlur=u.textShadowBlur||n.textShadowBlur||0,v.shadowColor=u.textShadowColor||n.textShadowColor||"transparent",v.shadowOffsetX=u.textShadowOffsetX||n.textShadowOffsetX||0,v.shadowOffsetY=u.textShadowOffsetY||n.textShadowOffsetY||0),v.textAlign=o,v.textBaseline="middle",v.font=r.font||Hv,v.opacity=Ch(u.opacity,n.opacity,1),Het(v,u),S&&(v.lineWidth=Ch(u.lineWidth,n.lineWidth,x),v.lineDash=Jt(u.lineDash,n.lineDash),v.lineDashOffset=n.lineDashOffset||0,v.stroke=S),A&&(v.fill=A),m.setBoundingRect(Ode(v,r.contentWidth,r.contentHeight,w?0:null))},e.prototype._renderBackground=function(r,n,i,a,s,o){var l=r.backgroundColor,u=r.borderWidth,h=r.borderColor,d=l&&l.image,f=l&&!d,p=r.borderRadius,g=this,m,v;if(f||r.lineHeight||u&&h){m=this._getOrCreateChild(tn),m.useStyle(m.createStyle()),m.style.fill=null;var y=m.shape;y.x=i,y.y=a,y.width=s,y.height=o,y.r=p,m.dirtyShape()}if(f){var b=m.style;b.fill=l||null,b.fillOpacity=Jt(r.fillOpacity,1)}else if(d){v=this._getOrCreateChild(Yo),v.onload=function(){g.dirtyStyle()};var x=v.style;x.image=l.image,x.x=i,x.y=a,x.width=s,x.height=o}if(u&&h){var b=m.style;b.lineWidth=u,b.stroke=h,b.strokeOpacity=Jt(r.strokeOpacity,1),b.lineDash=r.borderDash,b.lineDashOffset=r.borderDashOffset||0,m.strokeContainThreshold=0,m.hasFill()&&m.hasStroke()&&(b.strokeFirst=!0,b.lineWidth*=2)}var w=(m||v).style;w.shadowBlur=r.shadowBlur||0,w.shadowColor=r.shadowColor||"transparent",w.shadowOffsetX=r.shadowOffsetX||0,w.shadowOffsetY=r.shadowOffsetY||0,w.opacity=Ch(r.opacity,n.opacity,1)},e.makeFont=function(r){var n="";return Wet(r)&&(n=[r.fontStyle,r.fontWeight,Get(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),n&&Sd(n)||r.textFont||r.font},e}($f),C_r={left:!0,right:1,center:1},O_r={top:1,bottom:1,middle:1},Qet=["fontStyle","fontWeight","fontSize","fontFamily"];function Get(t){return typeof t=="string"&&(t.indexOf("px")!==-1||t.indexOf("rem")!==-1||t.indexOf("em")!==-1)?t:isNaN(+t)?ihe+"px":t+"px"}function Het(t,e){for(var r=0;r=0,a=!1;if(t instanceof vn){var s=att(t),o=i&&s.selectFill||s.normalFill,l=i&&s.selectStroke||s.normalStroke;if(u_(o)||u_(l)){n=n||{};var u=n.style||{};u.fill==="inherit"?(a=!0,n=ot({},n),u=ot({},u),u.fill=o):!u_(u.fill)&&u_(o)?(a=!0,n=ot({},n),u=ot({},u),u.fill=RG(o)):!u_(u.stroke)&&u_(l)&&(a||(n=ot({},n),u=ot({},u)),u.stroke=RG(l)),n.style=u}}if(n&&n.z2==null){a||(n=ot({},n));var h=t.z2EmphasisLift;n.z2=t.z2+(h??c_)}return n}function I_r(t,e,r){if(r&&r.z2==null){r=ot({},r);var n=t.z2SelectLift;r.z2=t.z2+(n??__r)}return r}function P_r(t,e,r){var n=Ir(t.currentStates,e)>=0,i=t.style.opacity,a=n?null:L_r(t,["opacity"],e,{opacity:1});r=r||{};var s=r.style||{};return s.opacity==null&&(r=ot({},r),s=ot({opacity:n?i:a.opacity*.1},s),r.style=s),r}function Hde(t,e){var r=this.states[t];if(this.style){if(t==="emphasis")return M_r(this,t,e,r);if(t==="blur")return P_r(this,t,r);if(t==="select")return I_r(this,t,r)}return r}function ZA(t){t.stateProxy=Hde;var e=t.getTextContent(),r=t.getTextGuideLine();e&&(e.stateProxy=Hde),r&&(r.stateProxy=Hde)}function utt(t,e){!gtt(t,e)&&!t.__highByOuter&&sy(t,stt)}function htt(t,e){!gtt(t,e)&&!t.__highByOuter&&sy(t,ott)}function oy(t,e){t.__highByOuter|=1<<(e||0),sy(t,stt)}function ly(t,e){!(t.__highByOuter&=~(1<<(e||0)))&&sy(t,ott)}function dtt(t){sy(t,Gde)}function Wde(t){sy(t,ltt)}function ftt(t){sy(t,R_r)}function ptt(t){sy(t,D_r)}function gtt(t,e){return t.__highDownSilentOnTouch&&e.zrByTouch}function mtt(t){var e=t.getModel(),r=[],n=[];e.eachComponent(function(i,a){var s=zde(a),o=rtt(t,a),l=i==="series";!l&&n.push(o),s.isBlured&&(o.group.traverse(function(u){ltt(u)}),l&&r.push(a)),s.isBlured=!1}),de(n,function(i){i&&i.toggleBlurSeries&&i.toggleBlurSeries(r,!1,e)})}function Yde(t,e,r,n){var i=n.getModel();r=r||"coordinateSystem";function a(u,h){for(var d=0;d0){var o={dataIndex:s,seriesIndex:r.seriesIndex};a!=null&&(o.dataType=a),e.push(o)}})}),e}function vx(t,e,r){JA(t,!0),sy(t,ZA),Xde(t,e,r)}function U_r(t){JA(t,!1)}function wa(t,e,r,n){n?U_r(t):vx(t,e,r)}function Xde(t,e,r){var n=Cr(t);e!=null?(n.focus=e,n.blurScope=r):n.focus&&(n.focus=null)}var ytt=["emphasis","blur","select"],V_r={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function So(t,e,r,n){r=r||"itemStyle";for(var i=0;i1&&(s*=Zde(g),o*=Zde(g));var m=(i===a?-1:1)*Zde((s*s*(o*o)-s*s*(p*p)-o*o*(f*f))/(s*s*(p*p)+o*o*(f*f)))||0,v=m*s*p/o,y=m*-o*f/s,b=(t+r)/2+xH(d)*v-bH(d)*y,x=(e+n)/2+bH(d)*v+xH(d)*y,w=Stt([1,0],[(f-v)/s,(p-y)/o]),A=[(f-v)/s,(p-y)/o],S=[(-1*f-v)/s,(-1*p-y)/o],T=Stt(A,S);if(Jde(A,S)<=-1&&(T=$N),Jde(A,S)>=1&&(T=0),T<0){var O=Math.round(T/$N*1e6)/1e6;T=$N*2+O%2*$N}h.addData(u,b,x,s,o,w,T,d,a)}var q_r=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,j_r=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function X_r(t){var e=new Cm;if(!t)return e;var r=0,n=0,i=r,a=n,s,o=Cm.CMD,l=t.match(q_r);if(!l)return e;for(var u=0;uR*R+D*D&&(O=E,k=_),{cx:O,cy:k,x0:-h,y0:-d,x1:O*(i/A-1),y1:k*(i/A-1)}}function n5r(t){var e;if(ft(t)){var r=t.length;if(!r)return t;r===1?e=[t[0],t[0],0,0]:r===2?e=[t[0],t[0],t[1],t[1]]:r===3?e=t.concat(t[2]):e=t}else e=[t,t,t,t];return e}function i5r(t,e){var r,n=UN(e.r,0),i=UN(e.r0||0,0),a=n>0,s=i>0;if(!(!a&&!s)){if(a||(n=i,i=0),i>n){var o=n;n=i,i=o}var l=e.startAngle,u=e.endAngle;if(!(isNaN(l)||isNaN(u))){var h=e.cx,d=e.cy,f=!!e.clockwise,p=Rtt(u-l),g=p>tfe&&p%tfe;if(g>Hp&&(p=g),!(n>Hp))t.moveTo(h,d);else if(p>tfe-Hp)t.moveTo(h+n*d_(l),d+n*eS(l)),t.arc(h,d,n,l,u,!f),i>Hp&&(t.moveTo(h+i*d_(u),d+i*eS(u)),t.arc(h,d,i,u,l,f));else{var m=void 0,v=void 0,y=void 0,b=void 0,x=void 0,w=void 0,A=void 0,S=void 0,T=void 0,O=void 0,k=void 0,E=void 0,_=void 0,I=void 0,L=void 0,R=void 0,D=n*d_(l),M=n*eS(l),P=i*d_(u),N=i*eS(u),F=p>Hp;if(F){var B=e.cornerRadius;B&&(r=n5r(B),m=r[0],v=r[1],y=r[2],b=r[3]);var V=Rtt(n-i)/2;if(x=_m(V,y),w=_m(V,b),A=_m(V,m),S=_m(V,v),k=T=UN(x,w),E=O=UN(A,S),(T>Hp||O>Hp)&&(_=n*d_(u),I=n*eS(u),L=i*d_(l),R=i*eS(l),p<_tt)){var z=r5r(D,M,L,R,_,I,P,N);if(z){var U=D-z[0],Q=M-z[1],G=_-z[0],X=I-z[1],Y=1/eS(t5r((U*G+Q*X)/(zN(U*U+Q*Q)*zN(G*G+X*X)))/2),le=zN(z[0]*z[0]+z[1]*z[1]);k=_m(T,(n-le)/(Y+1)),E=_m(O,(i-le)/(Y-1))}}}if(!F)t.moveTo(h+D,d+M);else if(k>Hp){var q=_m(y,k),Z=_m(b,k),ee=wH(L,R,D,M,n,q,f),re=wH(_,I,P,N,n,Z,f);t.moveTo(h+ee.cx+ee.x0,d+ee.cy+ee.y0),k0&&t.arc(h+ee.cx,d+ee.cy,q,$c(ee.y0,ee.x0),$c(ee.y1,ee.x1),!f),t.arc(h,d,n,$c(ee.cy+ee.y1,ee.cx+ee.x1),$c(re.cy+re.y1,re.cx+re.x1),!f),Z>0&&t.arc(h+re.cx,d+re.cy,Z,$c(re.y1,re.x1),$c(re.y0,re.x0),!f))}else t.moveTo(h+D,d+M),t.arc(h,d,n,l,u,!f);if(!(i>Hp)||!F)t.lineTo(h+P,d+N);else if(E>Hp){var q=_m(m,E),Z=_m(v,E),ee=wH(P,N,_,I,i,-Z,f),re=wH(D,M,L,R,i,-q,f);t.lineTo(h+ee.cx+ee.x0,d+ee.cy+ee.y0),E0&&t.arc(h+ee.cx,d+ee.cy,Z,$c(ee.y0,ee.x0),$c(ee.y1,ee.x1),!f),t.arc(h,d,i,$c(ee.cy+ee.y1,ee.cx+ee.x1),$c(re.cy+re.y1,re.cx+re.x1),f),q>0&&t.arc(h+re.cx,d+re.cy,q,$c(re.y1,re.x1),$c(re.y0,re.x0),!f))}else t.lineTo(h+P,d+N),t.arc(h,d,i,u,l,f)}t.closePath()}}}var a5r=function(){function t(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return t}(),nc=function(t){ha(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new a5r},e.prototype.buildPath=function(r,n){i5r(r,n)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(vn);nc.prototype.type="sector";var s5r=function(){function t(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return t}(),f_=function(t){ha(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new s5r},e.prototype.buildPath=function(r,n){var i=n.cx,a=n.cy,s=Math.PI*2;r.moveTo(i+n.r,a),r.arc(i,a,n.r,0,s,!1),r.moveTo(i+n.r0,a),r.arc(i,a,n.r0,0,s,!0)},e}(vn);f_.prototype.type="ring";function o5r(t,e,r,n){var i=[],a=[],s=[],o=[],l,u,h,d;if(n){h=[1/0,1/0],d=[-1/0,-1/0];for(var f=0,p=t.length;f=2){if(n){var a=o5r(i,n,r,e.smoothConstraint);t.moveTo(i[0][0],i[0][1]);for(var s=i.length,o=0;o<(r?s:s-1);o++){var l=a[o*2],u=a[o*2+1],h=i[(o+1)%s];t.bezierCurveTo(l[0],l[1],u[0],u[1],h[0],h[1])}}else{t.moveTo(i[0][0],i[0][1]);for(var o=1,d=i.length;onS[1]){if(a=!1,Sl.negativeSize||n)return a;var l=AH(nS[0]-rS[1]),u=AH(rS[0]-nS[1]);nfe(l,u)>TH.len()&&(l=u||!Sl.bidirectional)&&(wr.scale(SH,o,-u*i),Sl.useDir&&Sl.calcDirMTV()))}}return a},t.prototype._getProjMinMaxOnAxis=function(e,r,n){for(var i=this._axes[e],a=this._origin,s=r[0].dot(i)+a[e],o=s,l=s,u=1;u0){var d=h.duration,f=h.delay,p=h.easing,g={duration:d,delay:f||0,easing:p,done:a,force:!!a||!!s,setToFinal:!u,scope:t,during:s};o?e.animateFrom(r,g):e.animateTo(r,g)}else e.stopAnimation(),!o&&e.attr(r),s&&s(1),a&&a()}function Hn(t,e,r,n,i,a){ife("update",t,e,r,n,i,a)}function ia(t,e,r,n,i,a){ife("enter",t,e,r,n,i,a)}function m_(t){if(!t.__zr)return!0;for(var e=0;eZa(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function Gtt(t){return!t.isGroup}function A5r(t){return t.shape!=null}function HN(t,e,r){if(!t||!e)return;function n(s){var o={};return s.traverse(function(l){Gtt(l)&&l.anid&&(o[l.anid]=l)}),o}function i(s){var o={x:s.x,y:s.y,rotation:s.rotation};return A5r(s)&&(o.shape=lr(s.shape)),o}var a=n(t);e.traverse(function(s){if(Gtt(s)&&s.anid){var o=a[s.anid];if(o){var l=i(s);s.attr(i(o)),Hn(s,l,r,Cr(s).dataIndex)}}})}function lfe(t,e){return vt(t,function(r){var n=r[0];n=en(n,e.x),n=Ai(n,e.x+e.width);var i=r[1];return i=en(i,e.y),i=Ai(i,e.y+e.height),[n,i]})}function Htt(t,e){var r=en(t.x,e.x),n=Ai(t.x+t.width,e.x+e.width),i=en(t.y,e.y),a=Ai(t.y+t.height,e.y+e.height);if(n>=r&&a>=i)return{x:r,y:i,width:n-r,height:a-i}}function x_(t,e,r){var n=ot({rectHover:!0},e),i=n.style={strokeNoScale:!0};if(r=r||{x:-1,y:-1,width:2,height:2},t)return t.indexOf("image://")===0?(i.image=t.slice(8),mr(i,r),new Yo(n)):y_(t.replace("path://",""),n,r,"center")}function WN(t,e,r,n,i){for(var a=0,s=i[i.length-1];a1)return!1;var v=cfe(p,g,h,d)/f;return!(v<0||v>1)}function cfe(t,e,r,n){return t*n-r*e}function S5r(t){return t<=1e-6&&t>=-1e-6}function aS(t,e,r,n,i){return e==null||(zn(e)?Ra[0]=Ra[1]=Ra[2]=Ra[3]=e:(Ra[0]=e[0],Ra[1]=e[1],Ra[2]=e[2],Ra[3]=e[3]),n&&(Ra[0]=en(0,Ra[0]),Ra[1]=en(0,Ra[1]),Ra[2]=en(0,Ra[2]),Ra[3]=en(0,Ra[3])),r&&(Ra[0]=-Ra[0],Ra[1]=-Ra[1],Ra[2]=-Ra[2],Ra[3]=-Ra[3]),Ytt(t,Ra,"x","width",3,1,i&&i[0]||0),Ytt(t,Ra,"y","height",0,2,i&&i[1]||0)),t}var Ra=[0,0,0,0];function Ytt(t,e,r,n,i,a,s){var o=e[a]+e[i],l=t[n];t[n]+=o,s=en(0,Ai(s,l)),t[n]=0?-e[i]:e[a]>=0?l+e[a]:Za(o)>1e-8?(l-s)*e[i]/o:0):t[r]-=e[i]}function uy(t){var e=t.itemTooltipOption,r=t.componentModel,n=t.itemName,i=Nt(e)?{formatter:e}:e,a=r.mainType,s=r.componentIndex,o={componentType:a,name:n,$vars:["name"]};o[a+"Index"]=s;var l=t.formatterParamsExtra;l&&de(kn(l),function(h){Kt(o,h)||(o[h]=l[h],o.$vars.push(h))});var u=Cr(t.el);u.componentMainType=a,u.componentIndex=s,u.tooltipConfig={name:n,option:mr({content:n,encodeHTMLContent:!0,formatterParams:o},i)}}function ufe(t,e){var r;t.isGroup&&(r=e(t)),r||t.traverse(e)}function bx(t,e){if(t)if(ft(t))for(var r=0;re&&(e=s),se&&(r=e=0),{min:r,max:e}}function _H(t,e,r){jtt(t,e,r,-1/0)}function jtt(t,e,r,n){if(t.ignoreModelZ)return n;var i=t.getTextContent(),a=t.getTextGuideLine(),s=t.isGroup;if(s)for(var o=t.childrenRef(),l=0;l=0&&o.push(l)}),o}}function xx(t,e){return Vr(Vr({},t,!0),e,!0)}const P5r={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},N5r={time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}};var MH="ZH",bfe="EN",S_=bfe,IH={},xfe={},art=Rn.domSupported?function(){var t=(document.documentElement.lang||navigator.language||navigator.browserLanguage||S_).toUpperCase();return t.indexOf(MH)>-1?MH:S_}():S_;function wfe(t,e){t=t.toUpperCase(),xfe[t]=new yn(e),IH[t]=e}function B5r(t){if(Nt(t)){var e=IH[t.toUpperCase()]||{};return t===MH||t===bfe?lr(e):Vr(lr(e),lr(IH[S_]),!1)}else return Vr(lr(t),lr(IH[S_]),!1)}function Afe(t){return xfe[t]}function $5r(){return xfe[S_]}wfe(bfe,P5r),wfe(MH,N5r);var Sfe=null;function F5r(t){Sfe||(Sfe=t)}function Ns(){return Sfe}function srt(t,e){var r=Ns(),n=e.breakOption,i=e.breakParsed;return!i&&r&&(i=r.parseAxisBreakOption(n,t)),i}function PH(t){var e=t.brk;return e?e.breaks:[]}function NH(t){var e=t.brk;return e?e.hasBreaks():!1}var Tfe=1e3,Cfe=Tfe*60,jN=Cfe*60,Vf=jN*24,ort=Vf*365,z5r={year:/({yyyy}|{yy})/,month:/({MMMM}|{MMM}|{MM}|{M})/,day:/({dd}|{d})/,hour:/({HH}|{H}|{hh}|{h})/,minute:/({mm}|{m})/,second:/({ss}|{s})/,millisecond:/({SSS}|{S})/},BH={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}"},U5r="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}",$H="{yyyy}-{MM}-{dd}",lrt={year:"{yyyy}",month:"{yyyy}-{MM}",day:$H,hour:$H+" "+BH.hour,minute:$H+" "+BH.minute,second:$H+" "+BH.second,millisecond:U5r},Ld=["year","month","day","hour","minute","second","millisecond"],V5r=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function Q5r(t){return!Nt(t)&&!ur(t)?G5r(t):t}function G5r(t){t=t||{};var e={},r=!0;return de(Ld,function(n){r&&(r=t[n]==null)}),de(Ld,function(n,i){var a=t[n];e[n]={};for(var s=null,o=i;o>=0;o--){var l=Ld[o],u=yr(a)&&!ft(a)?a[l]:a,h=void 0;ft(u)?(h=u.slice(),s=h[0]||""):Nt(u)?(s=u,h=[s]):(s==null?s=BH[n]:z5r[l].test(s)||(s=e[l][l][0]+" "+s),h=[s],r&&(h[1]="{primary|"+s+"}")),e[n][l]=h}}),e}function Au(t,e){return t+="","0000".substr(0,e-t.length)+t}function XN(t){switch(t){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return t}}function H5r(t){return t===XN(t)}function W5r(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function KN(t,e,r,n){var i=ym(t),a=i[crt(r)](),s=i[Ofe(r)]()+1,o=Math.floor((s-1)/3)+1,l=i[kfe(r)](),u=i["get"+(r?"UTC":"")+"Day"](),h=i[Efe(r)](),d=(h-1)%12+1,f=i[_fe(r)](),p=i[Rfe(r)](),g=i[Dfe(r)](),m=h>=12?"pm":"am",v=m.toUpperCase(),y=n instanceof yn?n:Afe(n||art)||$5r(),b=y.getModel("time"),x=b.get("month"),w=b.get("monthAbbr"),A=b.get("dayOfWeek"),S=b.get("dayOfWeekAbbr");return(e||"").replace(/{a}/g,m+"").replace(/{A}/g,v+"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,Au(a%100+"",2)).replace(/{Q}/g,o+"").replace(/{MMMM}/g,x[s-1]).replace(/{MMM}/g,w[s-1]).replace(/{MM}/g,Au(s,2)).replace(/{M}/g,s+"").replace(/{dd}/g,Au(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,A[u]).replace(/{ee}/g,S[u]).replace(/{e}/g,u+"").replace(/{HH}/g,Au(h,2)).replace(/{H}/g,h+"").replace(/{hh}/g,Au(d+"",2)).replace(/{h}/g,d+"").replace(/{mm}/g,Au(f,2)).replace(/{m}/g,f+"").replace(/{ss}/g,Au(p,2)).replace(/{s}/g,p+"").replace(/{SSS}/g,Au(g,3)).replace(/{S}/g,g+"")}function Y5r(t,e,r,n,i){var a=null;if(Nt(r))a=r;else if(ur(r)){var s={time:t.time,level:t.time?t.time.level:0},o=Ns();o&&o.makeAxisLabelFormatterParamBreak(s,t.break),a=r(t.value,e,s)}else{var l=t.time;if(l){var u=r[l.lowerTimeUnit][l.upperTimeUnit];a=u[Math.min(l.level,u.length-1)]||""}else{var h=T_(t.value,i);a=r[h][h][0]}}return KN(new Date(t.value),a,i,n)}function T_(t,e){var r=ym(t),n=r[Ofe(e)]()+1,i=r[kfe(e)](),a=r[Efe(e)](),s=r[_fe(e)](),o=r[Rfe(e)](),l=r[Dfe(e)](),u=l===0,h=u&&o===0,d=h&&s===0,f=d&&a===0,p=f&&i===1,g=p&&n===1;return g?"year":p?"month":f?"day":d?"hour":h?"minute":u?"second":"millisecond"}function FH(t,e,r){switch(e){case"year":t[urt(r)](0);case"month":t[hrt(r)](1);case"day":t[drt(r)](0);case"hour":t[frt(r)](0);case"minute":t[prt(r)](0);case"second":t[grt(r)](0)}return t}function crt(t){return t?"getUTCFullYear":"getFullYear"}function Ofe(t){return t?"getUTCMonth":"getMonth"}function kfe(t){return t?"getUTCDate":"getDate"}function Efe(t){return t?"getUTCHours":"getHours"}function _fe(t){return t?"getUTCMinutes":"getMinutes"}function Rfe(t){return t?"getUTCSeconds":"getSeconds"}function Dfe(t){return t?"getUTCMilliseconds":"getMilliseconds"}function q5r(t){return t?"setUTCFullYear":"setFullYear"}function urt(t){return t?"setUTCMonth":"setMonth"}function hrt(t){return t?"setUTCDate":"setDate"}function drt(t){return t?"setUTCHours":"setHours"}function frt(t){return t?"setUTCMinutes":"setMinutes"}function prt(t){return t?"setUTCSeconds":"setSeconds"}function grt(t){return t?"setUTCMilliseconds":"setMilliseconds"}function j5r(t,e,r,n,i,a,s,o){var l=new Pn({style:{text:t,font:e,align:r,verticalAlign:n,padding:i,rich:a,overflow:s?"truncate":null,lineHeight:o}});return l.getBoundingRect()}function Lfe(t){if(!dde(t))return Nt(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function Mfe(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,function(r,n){return n.toUpperCase()}),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}var C_=aN;function Ife(t,e,r){var n="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function i(h){return h&&Sd(h)?h:"-"}function a(h){return Bf(h)}var s=e==="time",o=t instanceof Date;if(s||o){var l=s?ym(t):t;if(isNaN(+l)){if(o)return"-"}else return KN(l,n,r)}if(e==="ordinal")return pG(t)?i(t):zn(t)&&a(t)?t+"":"-";var u=bm(t);return a(u)?Lfe(u):pG(t)?i(t):typeof t=="boolean"?t+"":"-"}var mrt=["a","b","c","d","e","f","g"],Pfe=function(t,e){return"{"+t+(e??"")+"}"};function Nfe(t,e,r){ft(e)||(e=[e]);var n=e.length;if(!n)return"";for(var i=e[0].$vars||[],a=0;a':'';var s=r.markerId||"markerX";return{renderMode:a,content:"{"+s+"|} ",style:i==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:n}:{width:10,height:10,borderRadius:5,backgroundColor:n}}}function X5r(t,e,r){(t==="week"||t==="month"||t==="quarter"||t==="half-year"||t==="year")&&(t=`MM-dd +yyyy`);var n=ym(e),i=r?"getUTC":"get",a=n[i+"FullYear"](),s=n[i+"Month"]()+1,o=n[i+"Date"](),l=n[i+"Hours"](),u=n[i+"Minutes"](),h=n[i+"Seconds"](),d=n[i+"Milliseconds"]();return t=t.replace("MM",Au(s,2)).replace("M",s).replace("yyyy",a).replace("yy",Au(a%100+"",2)).replace("dd",Au(o,2)).replace("d",o).replace("hh",Au(l,2)).replace("h",l).replace("mm",Au(u,2)).replace("m",u).replace("ss",Au(h,2)).replace("s",h).replace("SSS",Au(d,3)),t}function K5r(t){return t&&t.charAt(0).toUpperCase()+t.substr(1)}function cS(t,e){return e=e||"transparent",Nt(t)?t:yr(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}function zH(t,e){if(e==="_blank"||e==="blank"){var r=window.open();r.opener=null,r.location.href=t}else window.open(t,e)}var UH={},Bfe={},O_=function(){function t(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return t.prototype.create=function(e,r){this._nonSeriesBoxMasterList=n(UH),this._normalMasterList=n(Bfe);function n(i,a){var s=[];return de(i,function(o,l){var u=o.create(e,r);s=s.concat(u||[])}),s}},t.prototype.update=function(e,r){de(this._normalMasterList,function(n){n.update&&n.update(e,r)})},t.prototype.getCoordinateSystems=function(){return this._normalMasterList.concat(this._nonSeriesBoxMasterList)},t.register=function(e,r){if(e==="matrix"||e==="calendar"){UH[e]=r;return}Bfe[e]=r},t.get=function(e){return Bfe[e]||UH[e]},t}();function Z5r(t){return!!UH[t]}var J5r=1,brt=2;function e4r(t){xrt.set(t.fullType,{getCoord2:void 0}).getCoord2=t.getCoord2}var xrt=Yt();function wrt(t){var e=t.getShallow("coord",!0),r=J5r;if(e==null){var n=xrt.get(t.type);n&&n.getCoord2&&(r=brt,e=n.getCoord2(t))}return{coord:e,from:r}}var k_=0,VH=1,Art=2;function Srt(t,e){var r=t.getShallow("coordinateSystem"),n=t.getShallow("coordinateSystemUsage",!0),i=k_;if(r){var a=t.mainType==="series";n==null&&(n=a?"data":"box"),n==="data"?(i=VH,a||(i=k_)):n==="box"&&(i=Art,!a&&!Z5r(r)&&(i=k_))}return{coordSysType:r,kind:i}}function ZN(t){var e=t.targetModel,r=t.coordSysType,n=t.coordSysProvider,i=t.isDefaultDataCoordSys;t.allowNotFound;var a=Srt(e),s=a.kind,o=a.coordSysType;if(i&&s!==VH&&(s=VH,o=r),s===k_||o!==r)return k_;var l=n(r,e);return l?(s===VH?e.coordinateSystem=l:e.boxCoordinateSystem=l,s):k_}var Trt=function(t,e){var r=e.getReferringComponents(t,ds).models[0];return r&&r.coordinateSystem},QH=de,Crt=["left","right","top","bottom","width","height"],uS=[["width","left","right"],["height","top","bottom"]];function $fe(t,e,r,n,i){var a=0,s=0;n==null&&(n=1/0),i==null&&(i=1/0);var o=0;e.eachChild(function(l,u){var h=l.getBoundingRect(),d=e.childAt(u+1),f=d&&d.getBoundingRect(),p,g;if(t==="horizontal"){var m=h.width+(f?-f.x+h.x:0);p=a+m,p>n||l.newline?(a=0,p=m,s+=o+r,o=h.height):o=Math.max(o,h.height)}else{var v=h.height+(f?-f.y+h.y:0);g=s+v,g>i||l.newline?(a+=o+r,s=0,g=v,o=h.width):o=Math.max(o,h.width)}l.newline||(l.x=a,l.y=s,l.markRedraw(),t==="horizontal"?a=p+r:s=g+r)})}var hS=$fe;qr($fe,"vertical"),qr($fe,"horizontal");function Ort(t,e){return{left:t.getShallow("left",e),top:t.getShallow("top",e),right:t.getShallow("right",e),bottom:t.getShallow("bottom",e),width:t.getShallow("width",e),height:t.getShallow("height",e)}}function t4r(t,e){var r=Co(t,e,{enableLayoutOnlyByCenter:!0}),n=t.getBoxLayoutParams(),i,a;if(r.type===JN.point)a=r.refPoint,i=da(n,{width:e.getWidth(),height:e.getHeight()});else{var s=t.get("center"),o=ft(s)?s:[s,s];i=da(n,r.refContainer),a=r.boxCoordFrom===brt?r.refPoint:[Qt(o[0],i.width)+i.x,Qt(o[1],i.height)+i.y]}return{viewRect:i,center:a}}function krt(t,e){var r=t4r(t,e),n=r.viewRect,i=r.center,a=t.get("radius");ft(a)||(a=[0,a]);var s=Qt(n.width,e.getWidth()),o=Qt(n.height,e.getHeight()),l=Math.min(s,o),u=Qt(a[0],l/2),h=Qt(a[1],l/2);return{cx:i[0],cy:i[1],r0:u,r:h,viewRect:n}}function da(t,e,r){r=C_(r||0);var n=e.width,i=e.height,a=Qt(t.left,n),s=Qt(t.top,i),o=Qt(t.right,n),l=Qt(t.bottom,i),u=Qt(t.width,n),h=Qt(t.height,i),d=r[2]+r[0],f=r[1]+r[3],p=t.aspect;switch(isNaN(u)&&(u=n-o-f-a),isNaN(h)&&(h=i-l-d-s),p!=null&&(isNaN(u)&&isNaN(h)&&(p>n/i?u=n*.8:h=i*.8),isNaN(u)&&(u=p*h),isNaN(h)&&(h=u/p)),isNaN(a)&&(a=n-o-u-f),isNaN(s)&&(s=i-l-h-d),t.left||t.right){case"center":a=n/2-u/2-r[3];break;case"right":a=n-u-f;break}switch(t.top||t.bottom){case"middle":case"center":s=i/2-h/2-r[0];break;case"bottom":s=i-h-d;break}a=a||0,s=s||0,isNaN(u)&&(u=n-f-a-(o||0)),isNaN(h)&&(h=i-d-s-(l||0));var g=new fr((e.x||0)+a+r[3],(e.y||0)+s+r[0],u,h);return g.margin=r,g}function Ert(t,e,r){var n=t.getShallow("preserveAspect",!0);if(!n)return e;var i=e.width/e.height;if(Math.abs(Math.atan(r)-Math.atan(i))<1e-9)return e;var a=t.getShallow("preserveAspectAlign",!0),s=t.getShallow("preserveAspectVerticalAlign",!0),o={width:e.width,height:e.height},l=n==="cover";return i>r&&!l||i=m)return d;for(var v=0;v=0;l--)o=Vr(o,i[l],!0);n.defaultOption=o}return n.defaultOption},e.prototype.getReferringComponents=function(r,n){var i=r+"Index",a=r+"Id";return i_(this.ecModel,r,{index:this.get(i,!0),id:this.get(a,!0)},n)},e.prototype.getBoxLayoutParams=function(){return Ort(this,!1)},e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(r){this.option.zlevel=r},e.protoInitialize=function(){var r=e.prototype;r.type="component",r.id="",r.name="",r.mainType="",r.subType="",r.componentIndex=0}(),e}(yn);wet(fn,yn),nH(fn),M5r(fn),I5r(fn,i4r);function i4r(t){var e=[];return de(fn.getClassesByMainType(t),function(r){e=e.concat(r.dependencies||r.prototype.dependencies||[])}),e=vt(e,function(r){return wm(r).main}),t!=="dataset"&&Ir(e,"dataset")<=0&&e.unshift("dataset"),e}var et={color:{},darkColor:{},size:{}},Bs=et.color={theme:["#5070dd","#b6d634","#505372","#ff994d","#0ca8df","#ffd10a","#fb628b","#785db0","#3fbe95"],neutral00:"#fff",neutral05:"#f4f7fd",neutral10:"#e8ebf0",neutral15:"#dbdee4",neutral20:"#cfd2d7",neutral25:"#c3c5cb",neutral30:"#b7b9be",neutral35:"#aaacb2",neutral40:"#9ea0a5",neutral45:"#929399",neutral50:"#86878c",neutral55:"#797b7f",neutral60:"#6d6e73",neutral65:"#616266",neutral70:"#54555a",neutral75:"#48494d",neutral80:"#3c3c41",neutral85:"#303034",neutral90:"#232328",neutral95:"#17171b",neutral99:"#000",accent05:"#eff1f9",accent10:"#e0e4f2",accent15:"#d0d6ec",accent20:"#c0c9e6",accent25:"#b1bbdf",accent30:"#a1aed9",accent35:"#91a0d3",accent40:"#8292cc",accent45:"#7285c6",accent50:"#6578ba",accent55:"#5c6da9",accent60:"#536298",accent65:"#4a5787",accent70:"#404c76",accent75:"#374165",accent80:"#2e3654",accent85:"#252b43",accent90:"#1b2032",accent95:"#121521",transparent:"rgba(0,0,0,0)",highlight:"rgba(255,231,130,0.8)"};ot(Bs,{primary:Bs.neutral80,secondary:Bs.neutral70,tertiary:Bs.neutral60,quaternary:Bs.neutral50,disabled:Bs.neutral20,border:Bs.neutral30,borderTint:Bs.neutral20,borderShade:Bs.neutral40,background:Bs.neutral05,backgroundTint:"rgba(234,237,245,0.5)",backgroundTransparent:"rgba(255,255,255,0)",backgroundShade:Bs.neutral10,shadow:"rgba(0,0,0,0.2)",shadowTint:"rgba(129,130,136,0.2)",axisLine:Bs.neutral70,axisLineTint:Bs.neutral40,axisTick:Bs.neutral70,axisTickMinor:Bs.neutral60,axisLabel:Bs.neutral70,axisSplitLine:Bs.neutral15,axisMinorSplitLine:Bs.neutral05});for(var fS in Bs)if(Bs.hasOwnProperty(fS)){var Rrt=Bs[fS];fS==="theme"?et.darkColor.theme=Bs.theme.slice():fS==="highlight"?et.darkColor.highlight="rgba(255,231,130,0.4)":fS.indexOf("accent")===0?et.darkColor[fS]=ey(Rrt,null,function(t){return t*.5},function(t){return Math.min(1,1.3-t)}):et.darkColor[fS]=ey(Rrt,null,function(t){return t*.9},function(t){return 1-Math.pow(t,1.5)})}et.size={xxs:2,xs:5,s:10,m:15,l:20,xl:30,xxl:40,xxxl:50};var Drt="";typeof navigator<"u"&&(Drt=navigator.platform||"");var E_="rgba(0, 0, 0, 0.2)",Lrt=et.color.theme[0],a4r=ey(Lrt,null,null,.9);const Mrt={darkMode:"auto",colorBy:"series",color:et.color.theme,gradientColor:[a4r,Lrt],aria:{decal:{decals:[{color:E_,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:E_,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:E_,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:E_,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:E_,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:E_,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:Drt.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var ac={Must:1,Might:2,Not:3},Irt=Qr();function s4r(t){Irt(t).datasetMap=Yt()}function Prt(t,e,r){var n={},i=zfe(e);if(!i||!t)return n;var a=[],s=[],o=e.ecModel,l=Irt(o).datasetMap,u=i.uid+"_"+r.seriesLayoutBy,h,d;t=t.slice(),de(t,function(m,v){var y=yr(m)?m:t[v]={name:m};y.type==="ordinal"&&h==null&&(h=v,d=g(y)),n[y.name]=[]});var f=l.get(u)||l.set(u,{categoryWayDim:d,valueWayDim:0});de(t,function(m,v){var y=m.name,b=g(m);if(h==null){var x=f.valueWayDim;p(n[y],x,b),p(s,x,b),f.valueWayDim+=b}else if(h===v)p(n[y],0,b),p(a,0,b);else{var x=f.categoryWayDim;p(n[y],x,b),p(s,x,b),f.categoryWayDim+=b}});function p(m,v,y){for(var b=0;be)return t[n];return t[r-1]}function Frt(t,e,r,n,i,a,s){a=a||t;var o=e(a),l=o.paletteIdx||0,u=o.paletteNameMap=o.paletteNameMap||{};if(u.hasOwnProperty(i))return u[i];var h=s==null||!n?r:h4r(n,s);if(h=h||r,!(!h||!h.length)){var d=h[l];return i&&(u[i]=d),o.paletteIdx=(l+1)%h.length,d}}function d4r(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}var HH,t8,zrt,Urt="\0_ec_inner",f4r=1,Gfe=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(r,n,i,a,s,o){a=a||{},this.option=null,this._theme=new yn(a),this._locale=new yn(s),this._optionManager=o},e.prototype.setOption=function(r,n,i){var a=Grt(n);this._optionManager.setOption(r,i,a),this._resetOption(null,a)},e.prototype.resetOption=function(r,n){return this._resetOption(r,Grt(n))},e.prototype._resetOption=function(r,n){var i=!1,a=this._optionManager;if(!r||r==="recreate"){var s=a.mountOption(r==="recreate");!this.option||r==="recreate"?zrt(this,s):(this.restoreData(),this._mergeOption(s,n)),i=!0}if((r==="timeline"||r==="media")&&this.restoreData(),!r||r==="recreate"||r==="timeline"){var o=a.getTimelineOption(this);o&&(i=!0,this._mergeOption(o,n))}if(!r||r==="recreate"||r==="media"){var l=a.getMediaOption(this);l.length&&de(l,function(u){i=!0,this._mergeOption(u,n)},this)}return i},e.prototype.mergeOption=function(r){this._mergeOption(r,null)},e.prototype._mergeOption=function(r,n){var i=this.option,a=this._componentsMap,s=this._componentsCount,o=[],l=Yt(),u=n&&n.replaceMergeMainTypeMap;s4r(this),de(r,function(d,f){d!=null&&(fn.hasClass(f)?f&&(o.push(f),l.set(f,!0)):i[f]=i[f]==null?lr(d):Vr(i[f],d,!0))}),u&&u.each(function(d,f){fn.hasClass(f)&&!l.get(f)&&(o.push(f),l.set(f,!0))}),fn.topologicalTravel(o,fn.getAllClassMainTypes(),h,this);function h(d){var f=c4r(this,d,Qi(r[d])),p=a.get(d),g=p?u&&u.get(d)?"replaceMerge":"normalMerge":"replaceAll",m=fet(p,f,g);wEr(m,d,fn),i[d]=null,a.set(d,null),s.set(d,0);var v=[],y=[],b=0,x;de(m,function(w,A){var S=w.existing,T=w.newOption;if(!T)S&&(S.mergeOption({},this),S.optionUpdated({},!1));else{var O=d==="series",k=fn.getClass(d,w.keyInfo.subType,!O);if(!k)return;if(d==="tooltip"){if(x)return;x=!0}if(S&&S.constructor===k)S.name=w.keyInfo.name,S.mergeOption(T,this),S.optionUpdated(T,!1);else{var E=ot({componentIndex:A},w.keyInfo);S=new k(T,this,this,E),ot(S,E),w.brandNew&&(S.__requireNewView=!0),S.init(T,this,this),S.optionUpdated(null,!0)}}S?(v.push(S.option),y.push(S),b++):(v.push(void 0),y.push(void 0))},this),i[d]=v,a.set(d,y),s.set(d,b),d==="series"&&HH(this)}this._seriesIndices||HH(this)},e.prototype.getOption=function(){var r=lr(this.option);return de(r,function(n,i){if(fn.hasClass(i)){for(var a=Qi(n),s=a.length,o=!1,l=s-1;l>=0;l--)a[l]&&!DN(a[l])?o=!0:(a[l]=null,!o&&s--);a.length=s,r[i]=a}}),delete r[Urt],r},e.prototype.setTheme=function(r){this._theme=new yn(r),this._resetOption("recreate",null)},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(r){this._payload=r},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(r,n){var i=this._componentsMap.get(r);if(i){var a=i[n||0];if(a)return a;if(n==null){for(var s=0;s=e:r==="max"?t<=e:t===e}function w4r(t,e){return t.join(",")===e.join(",")}var Yp=de,r8=yr,Hrt=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function Hfe(t){var e=t&&t.itemStyle;if(e)for(var r=0,n=Hrt.length;r0?r[s-1].seriesModel:null)}),D4r(r)}})}function D4r(t){de(t,function(e,r){var n=[],i=[NaN,NaN],a=[e.stackResultDimension,e.stackedOverDimension],s=e.data,o=e.isStackedByIndex,l=e.seriesModel.get("stackStrategy")||"samesign";s.modify(a,function(u,h,d){var f=s.get(e.stackedDimension,d);if(isNaN(f))return i;var p,g;o?g=s.getRawIndex(d):p=s.get(e.stackedByDimension,d);for(var m=NaN,v=r-1;v>=0;v--){var y=t[v];if(o||(g=y.data.rawIndexOf(y.stackedByDimension,p)),g>=0){var b=y.data.getByRawIndex(y.stackResultDimension,g);if(l==="all"||l==="positive"&&b>0||l==="negative"&&b<0||l==="samesign"&&f>=0&&b>0||l==="samesign"&&f<=0&&b<0){f=NA(f,b),m=b;break}}}return n[0]=f,n[1]=m,n})})}var WH=function(){function t(e){this.data=e.data||(e.sourceFormat===Qp?{}:[]),this.sourceFormat=e.sourceFormat||Jet,this.seriesLayoutBy=e.seriesLayoutBy||Gp,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var r=this.dimensionsDefine=e.dimensionsDefine;if(r)for(var n=0;nm&&(m=x)}p[0]=g,p[1]=m}},i=function(){return this._data?this._data.length/this._dimSize:0};rnt=(e={},e[wl+"_"+Gp]={pure:!0,appendData:a},e[wl+"_"+XA]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[Rd]={pure:!0,appendData:a},e[Qp]={pure:!0,appendData:function(s){var o=this._data;de(s,function(l,u){for(var h=o[u]||(o[u]=[]),d=0;d<(l||[]).length;d++)h.push(l[d])})}},e[_d]={appendData:a},e[mx]={persistent:!1,pure:!0,appendData:function(s){this._data=s},clean:function(){this._offset+=this.count(),this._data=null}},e);function a(s){for(var o=0;o=0&&(m=s.interpolatedValue[v])}return m!=null?m+"":""})}},t.prototype.getRawValue=function(e,r){return __(this.getData(r),e)},t.prototype.formatTooltip=function(e,r,n){},t}();function unt(t){var e,r;return yr(t)?t.type&&(r=t):e=t,{text:e,frag:r}}function a8(t){return new F4r(t)}var F4r=function(){function t(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return t.prototype.perform=function(e){var r=this._upstream,n=e&&e.skip;if(this._dirty&&r){var i=this.context;i.data=i.outputData=r.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!n&&(a=this._plan(this.context));var s=h(this._modBy),o=this._modDataCount||0,l=h(e&&e.modBy),u=e&&e.modDataCount||0;(s!==l||o!==u)&&(a="reset");function h(b){return!(b>=1)&&(b=1),b}var d;(this._dirty||a==="reset")&&(this._dirty=!1,d=this._doReset(n)),this._modBy=l,this._modDataCount=u;var f=e&&e.step;if(r?this._dueEnd=r._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var p=this._dueIndex,g=Math.min(f!=null?this._dueIndex+f:1/0,this._dueEnd);if(!n&&(d||p1&&n>0?o:s}};return a;function s(){return e=t?null:le},gte:function(t,e){return t>=e}},U4r=function(){function t(e,r){if(!zn(r)){var n="";ii(n)}this._opFn=fnt[e],this._rvalFloat=bm(r)}return t.prototype.evaluate=function(e){return zn(e)?this._opFn(e,this._rvalFloat):this._opFn(bm(e),this._rvalFloat)},t}(),pnt=function(){function t(e,r){var n=e==="desc";this._resultLT=n?1:-1,r==null&&(r=n?"min":"max"),this._incomparable=r==="min"?-1/0:1/0}return t.prototype.evaluate=function(e,r){var n=zn(e)?e:bm(e),i=zn(r)?r:bm(r),a=isNaN(n),s=isNaN(i);if(a&&(n=this._incomparable),s&&(i=this._incomparable),a&&s){var o=Nt(e),l=Nt(r);o&&(n=l?e:0),l&&(i=o?r:0)}return ni?-this._resultLT:0},t}(),V4r=function(){function t(e,r){this._rval=r,this._isEQ=e,this._rvalTypeof=typeof r,this._rvalFloat=bm(r)}return t.prototype.evaluate=function(e){var r=e===this._rval;if(!r){var n=typeof e;n!==this._rvalTypeof&&(n==="number"||this._rvalTypeof==="number")&&(r=bm(e)===this._rvalFloat)}return this._isEQ?r:!r},t}();function Q4r(t,e){return t==="eq"||t==="ne"?new V4r(t==="eq",e):Kt(fnt,t)?new U4r(t,e):null}function gnt(t){var e="",r=-1/0,n=-1/0,i=1/0,a=1/0;return t&&(t.g!=null&&(e+="G"+t.g,r=t.g),t.ge!=null&&(e+="GE"+t.ge,n=t.ge),t.l!=null&&(e+="L"+t.l,i=t.l),t.le!=null&&(e+="LE"+t.le,a=t.le)),{key:e,g:r,ge:n,l:i,le:a}}function mnt(t,e){return e>t.g&&e>=t.ge&&e65535?J4r:e3r}function t3r(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function wnt(t,e,r,n,i){var a=xnt[r||"float"];if(i){var s=t[e],o=s&&s.length;if(o!==n){for(var l=new a(n),u=0;uv[1]&&(v[1]=m)}return this._rawCount=this._count=l,{start:o,end:l}},t.prototype._initDataFromProvider=function(e,r,n){for(var i=this._provider,a=this._chunks,s=this._dimensions,o=s.length,l=this._rawExtent,u=vt(s,function(b){return b.property}),h=0;hy[1]&&(y[1]=v)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=r,this._extent=[]},t.prototype.count=function(){return this._count},t.prototype.get=function(e,r){if(!(r>=0&&r=0&&r=this._rawCount||e<0)return-1;if(!this._indices)return e;var r=this._indices,n=r[e];if(n!=null&&ne)a=s-1;else return s}return-1},t.prototype.getIndices=function(){var e,r=this._indices;if(r){var n=r.constructor,i=this._count;if(n===Array){e=new n(i);for(var a=0;a=d&&b<=f||isNaN(b))&&(l[u++]=m),m++}g=!0}else if(a===2){for(var v=p[i[0]],x=p[i[1]],w=e[i[1]][0],A=e[i[1]][1],y=0;y=d&&b<=f||isNaN(b))&&(S>=w&&S<=A||isNaN(S))&&(l[u++]=m),m++}g=!0}}if(!g)if(a===1)for(var y=0;y=d&&b<=f||isNaN(b))&&(l[u++]=T)}else for(var y=0;ye[E][1])&&(O=!1)}O&&(l[u++]=r.getRawIndex(y))}return uy[1]&&(y[1]=v)}}}},t.prototype.lttbDownSample=function(e,r){var n=this.clone([e],!0),i=n._chunks,a=i[e],s=this.count(),o=0,l=Math.floor(1/r),u=this.getRawIndex(0),h,d,f,p=new(R_(this._rawCount))(Math.min((Math.ceil(s/l)+2)*2,s));p[o++]=u;for(var g=1;gh&&(h=d,f=w)}_>0&&_o&&(m=o-h);for(var v=0;vg&&(g=b,p=h+v)}var x=this.getRawIndex(d),w=this.getRawIndex(p);dh-g&&(l=h-g,o.length=l);for(var m=0;md[1]&&(d[1]=y),f[p++]=b}return a._count=p,a._indices=f,a._updateGetRawIdx(),a},t.prototype.each=function(e,r){if(this._count)for(var n=e.length,i=this._chunks,a=0,s=this.count();ap&&(p=v))}return l[h]=[f,p]},t.prototype.getRawDataItem=function(e){var r=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(r);for(var n=[],i=this._chunks,a=0;a=0?this._indices[e]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=function(){function e(r,n,i,a){return Ax(r[a],this._dimensions[a])}Jfe={arrayRows:e,objectRows:function(r,n,i,a){return Ax(r[n],this._dimensions[a])},keyedColumns:e,original:function(r,n,i,a){var s=r&&(r.value==null?r:r.value);return Ax(s instanceof Array?s[a]:s,this._dimensions[a])},typedArray:function(r,n,i,a){return r[a]}}}(),t}(),Ant=function(){function t(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return t.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},t.prototype._setLocalSource=function(e,r){this._sourceList=e,this._upstreamSignList=r,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},t.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},t.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,r=this._getUpstreamSourceManagers(),n=!!r.length,i,a;if(jH(e)){var s=e,o=void 0,l=void 0,u=void 0;if(n){var h=r[0];h.prepareSource(),u=h.getSource(),o=u.data,l=u.sourceFormat,a=[h._getVersionSign()]}else o=s.get("data",!0),l=bu(o)?mx:_d,a=[];var d=this._getSourceMetaRawOption()||{},f=u&&u.metaRawOption||{},p=Jt(d.seriesLayoutBy,f.seriesLayoutBy)||null,g=Jt(d.sourceHeader,f.sourceHeader),m=Jt(d.dimensions,f.dimensions),v=p!==f.seriesLayoutBy||!!g!=!!f.sourceHeader||m;i=v?[qfe(o,{seriesLayoutBy:p,sourceHeader:g,dimensions:m},l)]:[]}else{var y=e;if(n){var b=this._applyTransform(r);i=b.sourceList,a=b.upstreamSignList}else{var x=y.get("source",!0);i=[qfe(x,this._getSourceMetaRawOption(),null)],a=[]}}this._setLocalSource(i,a)},t.prototype._applyTransform=function(e){var r=this._sourceHost,n=r.get("transform",!0),i=r.get("fromTransformResult",!0);if(i!=null){var a="";e.length!==1&&Tnt(a)}var s,o=[],l=[];return de(e,function(u){u.prepareSource();var h=u.getSource(i||0),d="";i!=null&&!h&&Tnt(d),o.push(h),l.push(u._getVersionSign())}),n?s=K4r(n,o,{datasetIndex:r.componentIndex}):i!=null&&(s=[L4r(o[0])]),{sourceList:s,upstreamSignList:l}},t.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),r=0;r1||r>0&&!t.noHeader;return de(t.blocks,function(i){var a=Ent(i);a>=e&&(e=a+ +(n&&(!a||tpe(i)&&!i.noHeader)))}),e}return 0}function a3r(t,e,r,n){var i=e.noHeader,a=o3r(Ent(e)),s=[],o=e.blocks||[];ec(!o||ft(o)),o=o||[];var l=t.orderMode;if(e.sortBlocks&&l){o=o.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(Kt(u,l)){var h=new pnt(u[l],null);o.sort(function(m,v){return h.evaluate(m.sortParam,v.sortParam)})}else l==="seriesDesc"&&o.reverse()}de(o,function(m,v){var y=e.valueFormatter,b=knt(m)(y?ot(ot({},t),{valueFormatter:y}):t,m,v>0?a.html:0,n);b!=null&&s.push(b)});var d=t.renderMode==="richText"?s.join(a.richText):rpe(n,s.join(""),i?r:a.html);if(i)return d;var f=Ife(e.header,"ordinal",t.useUTC),p=Ont(n,t.renderMode).nameStyle,g=Cnt(n);return t.renderMode==="richText"?Rnt(t,f,p)+a.richText+d:rpe(n,'
'+Nc(f)+"
"+d,r)}function s3r(t,e,r,n){var i=t.renderMode,a=e.noName,s=e.noValue,o=!e.markerType,l=e.name,u=t.useUTC,h=e.valueFormatter||t.valueFormatter||function(w){return w=ft(w)?w:[w],vt(w,function(A,T){return Ife(A,ft(p)?p[T]:p,u)})};if(!(a&&s)){var d=o?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||et.color.secondary,i),f=a?"":Ife(l,"ordinal",u),p=e.valueType,g=s?[]:h(e.value,e.rawDataIndex),m=!o||!a,v=!o&&a,y=Ont(n,i),b=y.nameStyle,x=y.valueStyle;return i==="richText"?(o?"":d)+(a?"":Rnt(t,f,b))+(s?"":u3r(t,g,m,v,x)):rpe(n,(o?"":d)+(a?"":l3r(f,!o,b))+(s?"":c3r(g,m,v,x)),r)}}function _nt(t,e,r,n,i,a){if(t){var s=knt(t),o={useUTC:i,renderMode:r,orderMode:n,markupStyleCreator:e,valueFormatter:t.valueFormatter};return s(o,t,0,a)}}function o3r(t){return{html:n3r[t],richText:i3r[t]}}function rpe(t,e,r){var n='
',i="margin: "+r+"px 0 0",a=Cnt(t);return'
'+e+n+"
"}function l3r(t,e,r){var n=e?"margin-left:2px":"";return''+Nc(t)+""}function c3r(t,e,r,n){var i=r?"10px":"20px",a=e?"float:right;margin-left:"+i:"";return t=ft(t)?t:[t],''+vt(t,function(s){return Nc(s)}).join("  ")+""}function Rnt(t,e,r){return t.markupStyleCreator.wrapRichTextStyle(e,r)}function u3r(t,e,r,n,i){var a=[i],s=n?10:20;return r&&a.push({padding:[0,0,0,s],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(ft(e)?e.join(" "):e,a)}function Dnt(t,e){var r=t.getData().getItemVisual(e,"style"),n=r[t.visualDrawType];return cT(n)}function Lnt(t,e){var r=t.get("padding");return r??(e==="richText"?[8,10]:10)}var npe=function(){function t(){this.richTextStyles={},this._nextStyleNameId=fde()}return t.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},t.prototype.makeTooltipMarker=function(e,r,n){var i=n==="richText"?this._generateStyleName():null,a=yrt({color:r,type:e,renderMode:n,markerId:i});return Nt(a)?a:(this.richTextStyles[i]=a.style,a.content)},t.prototype.wrapRichTextStyle=function(e,r){var n={};ft(r)?de(r,function(a){return ot(n,a)}):ot(n,r);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+e+"}"},t}();function Mnt(t){var e=t.series,r=t.dataIndex,n=t.multipleSeries,i=e.getData(),a=i.mapDimensionsAll("defaultedTooltip"),s=a.length,o=e.getRawValue(r),l=ft(o),u=Dnt(e,r),h,d,f,p;if(s>1||l&&!s){var g=h3r(o,e,r,a,u);h=g.inlineValues,d=g.inlineValueTypes,f=g.blocks,p=g.inlineValues[0]}else if(s){var m=i.getDimensionInfo(a[0]);p=h=__(i,r,a[0]),d=m.type}else p=h=l?o[0]:o;var v=pde(e),y=v&&e.name||"",b=i.getName(r),x=n?y:b;return no("section",{header:y,noHeader:n||!v,sortParam:p,blocks:[no("nameValue",{markerType:"item",markerColor:u,name:x,noName:!Td(x),value:h,valueType:d,rawDataIndex:i.getRawIndex(r)})].concat(f||[])})}function h3r(t,e,r,n,i){var a=e.getData(),s=Rf(t,function(d,f,p){var g=a.getDimensionInfo(p);return d=d||g&&g.tooltip!==!1&&g.displayName!=null},!1),o=[],l=[],u=[];n.length?de(n,function(d){h(__(a,r,d),d)}):de(t,h);function h(d,f){var p=a.getDimensionInfo(f);!p||p.otherDims.tooltip===!1||(s?u.push(no("nameValue",{markerType:"subItem",markerColor:i,name:p.displayName,value:d,valueType:p.type})):(o.push(d),l.push(p.type)))}return{inlineValues:o,inlineValueTypes:l,blocks:u}}var Tx=Qr();function XH(t,e){return t.getName(e)||t.getId(e)}var KH="__universalTransitionEnabled",Ri=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._selectedDataIndicesMap={},r}return e.prototype.init=function(r,n,i){this.seriesIndex=this.componentIndex,this.dataTask=a8({count:f3r,reset:p3r}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,i);var a=Tx(this).sourceManager=new Ant(this);a.prepareSource();var s=this.getInitialData(r,i);Pnt(s,this),this.dataTask.context.data=s,Tx(this).dataBeforeProcessed=s,Int(this),this._initSelectedMapFromData(s)},e.prototype.mergeDefaultAndTheme=function(r,n){var i=e8(this),a=i?dT(r):{},s=this.subType;fn.hasClass(s)&&(s+="Series"),Vr(r,n.getTheme().get(this.subType)),Vr(r,this.getDefaultOption()),$A(r,"label",["show"]),this.fillDataTextStyle(r.data),i&&Rm(r,a,i)},e.prototype.mergeOption=function(r,n){r=Vr(this.option,r,!0),this.fillDataTextStyle(r.data);var i=e8(this);i&&Rm(this.option,r,i);var a=Tx(this).sourceManager;a.dirty(),a.prepareSource();var s=this.getInitialData(r,n);Pnt(s,this),this.dataTask.dirty(),this.dataTask.context.data=s,Tx(this).dataBeforeProcessed=s,Int(this),this._initSelectedMapFromData(s)},e.prototype.fillDataTextStyle=function(r){if(r&&!bu(r))for(var n=["show"],i=0;i=0&&f<0)&&(d=A,f=w,p=0),w===f&&(h[p++]=v))}return h.length=p,h},e.prototype.formatTooltip=function(r,n,i){return Mnt({series:this,dataIndex:r,multipleSeries:n})},e.prototype.isAnimationEnabled=function(){var r=this.ecModel;if(Rn.node&&!(r&&r.ssr))return!1;var n=this.getShallow("animation");return n&&this.getData().count()>this.getShallow("animationThreshold")&&(n=!1),!!n},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(r,n,i){var a=this.ecModel,s=Vfe.prototype.getColorFromPalette.call(this,r,n,i);return s||(s=a.getColorFromPalette(r,n,i)),s},e.prototype.coordDimToDataDim=function(r){return this.getRawData().mapDimensionsAll(r)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(r,n){this._innerSelect(this.getData(n),r)},e.prototype.unselect=function(r,n){var i=this.option.selectedMap;if(i){var a=this.option.selectedMode,s=this.getData(n);if(a==="series"||i==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var o=0;o=0&&i.push(s)}return i},e.prototype.isSelected=function(r,n){var i=this.option.selectedMap;if(!i)return!1;var a=this.getData(n);return(i==="all"||i[XH(a,r)])&&!a.getItemModel(r).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[KH])return!0;var r=this.option.universalTransition;return r?r===!0?!0:r&&r.enabled:!1},e.prototype._innerSelect=function(r,n){var i,a,s=this.option,o=s.selectedMode,l=n.length;if(!(!o||!l)){if(o==="series")s.selectedMap="all";else if(o==="multiple"){yr(s.selectedMap)||(s.selectedMap={});for(var u=s.selectedMap,h=0;h0&&this._innerSelect(r,n)}},e.registerClass=function(r){return fn.registerClass(r)},e.protoInitialize=function(){var r=e.prototype;r.type="series.__base__",r.seriesIndex=0,r.ignoreStyleOnData=!1,r.hasSymbolVisual=!1,r.defaultSymbol="circle",r.visualStyleAccessPath="itemStyle",r.visualDrawType="fill"}(),e}(fn);Is(Ri,qH),Is(Ri,Vfe),wet(Ri,fn);function Int(t){var e=t.name;pde(t)||(t.name=d3r(t)||e)}function d3r(t){var e=t.getRawData(),r=e.mapDimensionsAll("seriesName"),n=[];return de(r,function(i){var a=e.getDimensionInfo(i);a.displayName&&n.push(a.displayName)}),n.join(" ")}function f3r(t){return t.model.getRawData().count()}function p3r(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),g3r}function g3r(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Pnt(t,e){de(QE(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),function(r){t.wrapMethod(r,qr(m3r,e))})}function m3r(t,e){var r=ipe(t);return r&&r.setOutputEnd((e||this).count()),e}function ipe(t){var e=(t.ecModel||{}).scheduler,r=e&&e.getPipeline(t.uid);if(r){var n=r.currentTask;if(n){var i=n.agentStubMap;i&&(n=i.get(t.uid))}return n}}var Hi=function(){function t(){this.group=new pr,this.uid=lT("viewComponent")}return t.prototype.init=function(e,r){},t.prototype.render=function(e,r,n,i){},t.prototype.dispose=function(e,r){},t.prototype.updateView=function(e,r,n,i){},t.prototype.updateLayout=function(e,r,n,i){},t.prototype.updateVisual=function(e,r,n,i){},t.prototype.toggleBlurSeries=function(e,r,n){},t.prototype.eachRendered=function(e){var r=this.group;r&&r.traverse(e)},t}();xde(Hi),nH(Hi);function yT(){var t=Qr();return function(e){var r=t(e),n=e.pipelineContext,i=!!r.large,a=!!r.progressiveRender,s=r.large=!!(n&&n.large),o=r.progressiveRender=!!(n&&n.progressiveRender);return(i!==s||a!==o)&&"reset"}}var Nnt=Qr(),v3r=yT(),Ti=function(){function t(){this.group=new pr,this.uid=lT("viewChart"),this.renderTask=a8({plan:y3r,reset:b3r}),this.renderTask.context={view:this}}return t.prototype.init=function(e,r){},t.prototype.render=function(e,r,n,i){},t.prototype.highlight=function(e,r,n,i){var a=e.getData(i&&i.dataType);a&&$nt(a,i,"emphasis")},t.prototype.downplay=function(e,r,n,i){var a=e.getData(i&&i.dataType);a&&$nt(a,i,"normal")},t.prototype.remove=function(e,r){this.group.removeAll()},t.prototype.dispose=function(e,r){},t.prototype.updateView=function(e,r,n,i){this.render(e,r,n,i)},t.prototype.updateVisual=function(e,r,n,i){this.render(e,r,n,i)},t.prototype.eachRendered=function(e){bx(this.group,e)},t.markUpdateMethod=function(e,r){Nnt(e).updateMethod=r},t.protoInitialize=function(){var e=t.prototype;e.type="chart"}(),t}();function Bnt(t,e,r){t&&BN(t)&&(e==="emphasis"?oy:ly)(t,r)}function $nt(t,e,r){var n=FA(t,e),i=e&&e.highlightKey!=null?G_r(e.highlightKey):null;n!=null?de(Qi(n),function(a){Bnt(t.getItemGraphicEl(a),r,i)}):t.eachItemGraphicEl(function(a){Bnt(a,r,i)})}xde(Ti),nH(Ti);function y3r(t){return v3r(t.model)}function b3r(t){var e=t.model,r=t.ecModel,n=t.api,i=t.payload,a=e.pipelineContext.progressiveRender,s=t.view,o=i&&Nnt(i).updateMethod,l=a?"incrementalPrepareRender":o&&s[o]?o:"render";return l!=="render"&&s[l](e,r,n,i),x3r[l]}var x3r={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}},ZH="\0__throttleOriginMethod",Fnt="\0__throttleRate",znt="\0__throttleType";function JH(t,e,r){var n,i=0,a=0,s=null,o,l,u,h;e=e||0;function d(){a=new Date().getTime(),s=null,t.apply(l,u||[])}var f=function(){for(var p=[],g=0;g=0?d():s=setTimeout(d,-o),i=n};return f.clear=function(){s&&(clearTimeout(s),s=null)},f.debounceNextCall=function(p){h=p},f}function D_(t,e,r,n){var i=t[e];if(i){var a=i[ZH]||i,s=i[znt],o=i[Fnt];if(o!==r||s!==n){if(r==null||!n)return t[e]=a;i=t[e]=JH(a,r,n==="debounce"),i[ZH]=a,i[znt]=n,i[Fnt]=r}return i}}function s8(t,e){var r=t[e];r&&r[ZH]&&(r.clear&&r.clear(),t[e]=r[ZH])}var Unt=Qr(),Vnt={itemStyle:VA(irt,!0),lineStyle:VA(nrt,!0)},w3r={lineStyle:"stroke",itemStyle:"fill"};function Qnt(t,e){var r=t.visualStyleMapper||Vnt[e];return r||(console.warn("Unknown style type '"+e+"'."),Vnt.itemStyle)}function Gnt(t,e){var r=t.visualDrawType||w3r[e];return r||(console.warn("Unknown style type '"+e+"'."),"fill")}var A3r={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var r=t.getData(),n=t.visualStyleAccessPath||"itemStyle",i=t.getModel(n),a=Qnt(t,n),s=a(i),o=i.getShallow("decal");o&&(r.setVisual("decal",o),o.dirty=!0);var l=Gnt(t,n),u=s[l],h=ur(u)?u:null,d=s.fill==="auto"||s.stroke==="auto";if(!s[l]||h||d){var f=t.getColorFromPalette(t.name,null,e.getSeriesCount());s[l]||(s[l]=f,r.setVisual("colorFromPalette",!0)),s.fill=s.fill==="auto"||ur(s.fill)?f:s.fill,s.stroke=s.stroke==="auto"||ur(s.stroke)?f:s.stroke}if(r.setVisual("style",s),r.setVisual("drawType",l),!e.isSeriesFiltered(t)&&h)return r.setVisual("colorFromPalette",!1),{dataEach:function(p,g){var m=t.getDataParams(g),v=ot({},s);v[l]=h(m),p.setItemVisual(g,"style",v)}}}},o8=new yn,T3r={createOnAllSeries:!0,reset:function(t,e){if(!t.ignoreStyleOnData){var r=t.getData(),n=t.visualStyleAccessPath||"itemStyle",i=Qnt(t,n),a=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(s,o){var l=s.getRawDataItem(o);if(l&&l[n]){o8.option=l[n];var u=i(o8),h=s.ensureUniqueItemVisual(o,"style");ot(h,u),o8.option.decal&&(s.setItemVisual(o,"decal",o8.option.decal),o8.option.decal.dirty=!0),a in u&&s.setItemVisual(o,"colorFromPalette",!1)}}:null}}}},S3r={performRawSeries:!0,overallReset:function(t){var e=Yt();t.eachSeries(function(r){if(!r.isColorBySeries()){var n=r.type+"-"+r.getColorBy();Unt(r).scope=e.get(n)||e.set(n,{})}}),t.eachSeries(function(r){if(!r.isColorBySeries()){var n=r.getRawData(),i={},a=r.getData(),s=Unt(r).scope,o=r.visualStyleAccessPath||"itemStyle",l=Gnt(r,o);a.each(function(u){var h=a.getRawIndex(u);i[h]=u}),n.each(function(u){var h=i[u],d=a.getItemVisual(h,"colorFromPalette");if(d){var f=a.ensureUniqueItemVisual(h,"style"),p=n.getName(u)||u+"",g=n.count();f[l]=r.getColorFromPalette(p,s,g)}})}})}},eW=Math.PI;function C3r(t,e){e=e||{},mr(e,{text:"loading",textColor:et.color.primary,fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255,255,255,0.8)",showSpinner:!0,color:et.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var r=new pr,n=new tn({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});r.add(n);var i=new Pn({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new tn({style:{fill:"none"},textContent:i,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});r.add(a);var s;return e.showSpinner&&(s=new VN({shape:{startAngle:-eW/2,endAngle:-eW/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001}),s.animateShape(!0).when(1e3,{endAngle:eW*3/2}).start("circularInOut"),s.animateShape(!0).when(1e3,{startAngle:eW*3/2}).delay(300).start("circularInOut"),r.add(s)),r.resize=function(){var o=i.getBoundingRect().width,l=e.showSpinner?e.spinnerRadius:0,u=(t.getWidth()-l*2-(e.showSpinner&&o?10:0)-o)/2-(e.showSpinner&&o?0:5+o/2)+(e.showSpinner?0:o/2)+(o?0:l),h=t.getHeight()/2;e.showSpinner&&s.setShape({cx:u,cy:h}),a.setShape({x:u-l,y:h-l,width:l*2,height:l*2}),n.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},r.resize(),r}var Hnt=function(){function t(e,r,n,i){this._stageTaskMap=Yt(),this.ecInstance=e,this.api=r,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return t.prototype.restoreData=function(e,r){e.restoreData(r),this._stageTaskMap.each(function(n){var i=n.overallTask;i&&i.dirty()})},t.prototype.getPerformArgs=function(e,r){if(e.__pipeline){var n=this._pipelineMap.get(e.__pipeline.id),i=n.context,a=!r&&n.progressiveEnabled&&(!i||i.progressiveRender)&&e.__idxInPipeline>n.blockIndex,s=a?n.step:null,o=i&&i.modDataCount,l=o!=null?Math.ceil(o/s):null;return{step:s,modBy:l,modDataCount:o}}},t.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},t.prototype.updateStreamModes=function(e,r){var n=this._pipelineMap.get(e.uid),i=e.__preparePipelineContext?e.__preparePipelineContext(r,n):bet(e,r,n);e.pipelineContext=n.context=i},t.prototype.restorePipelines=function(e,r){var n=this,i=n._pipelineMap=Yt();r.eachSeries(function(a){var s=e.painter.type==="canvas"&&a.getProgressive(),o=a.uid;i.set(o,{id:o,head:null,tail:null,threshold:a.getProgressiveThreshold(),progressiveEnabled:s&&!(a.preventIncremental&&a.preventIncremental()),blockIndex:-1,step:Math.round(s||700),count:0}),n._pipe(a,a.dataTask)})},t.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,r=this.api.getModel(),n=this.api;de(this._allHandlers,function(i){var a=e.get(i.uid)||e.set(i.uid,{}),s="";ec(!(i.reset&&i.overallReset),s),i.reset&&this._createSeriesStageTask(i,a,r,n),i.overallReset&&this._createOverallStageTask(i,a,r,n)},this)},t.prototype.prepareView=function(e,r,n,i){var a=e.renderTask,s=a.context;s.model=r,s.ecModel=n,s.api=i,a.__block=!e.incrementalPrepareRender,this._pipe(r,a)},t.prototype.performDataProcessorTasks=function(e,r){this._performStageTasks(this._dataProcessorHandlers,e,r,{block:!0})},t.prototype.performVisualTasks=function(e,r,n){this._performStageTasks(this._visualHandlers,e,r,n)},t.prototype._performStageTasks=function(e,r,n,i){i=i||{};var a=!1,s=this;de(e,function(l,u){if(!(i.visualType&&i.visualType!==l.visualType)){var h=s._stageTaskMap.get(l.uid),d=h.seriesTaskMap,f=h.overallTask;if(f){var p,g=f.agentStubMap;g.each(function(v){o(i,v)&&(v.dirty(),p=!0)}),p&&f.dirty(),s.updatePayload(f,n);var m=s.getPerformArgs(f,i.block);g.each(function(v){v.perform(m)}),f.perform(m)&&(a=!0)}else d&&d.each(function(v,y){o(i,v)&&v.dirty();var b=s.getPerformArgs(v,i.block);b.skip=!l.performRawSeries&&r.isSeriesFiltered(v.context.model),s.updatePayload(v,n),v.perform(b)&&(a=!0)})}});function o(l,u){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(u.__pipeline.id))}this.unfinished=a||this.unfinished},t.prototype.performSeriesTasks=function(e){var r;e.eachSeries(function(n){r=n.dataTask.perform()||r}),this.unfinished=r||this.unfinished},t.prototype.plan=function(){this._pipelineMap.each(function(e){var r=e.tail;do{if(r.__block){e.blockIndex=r.__idxInPipeline;break}r=r.getUpstream()}while(r)})},t.prototype.updatePayload=function(e,r){r!=="remain"&&(e.context.payload=r)},t.prototype._createSeriesStageTask=function(e,r,n,i){var a=this,s=r.seriesTaskMap,o=r.seriesTaskMap=Yt(),l=e.seriesType,u=e.getTargetSeries;e.createOnAllSeries?n.eachRawSeries(h):l?n.eachRawSeriesByType(l,h):u&&u(n,i).each(h);function h(d){var f=d.uid,p=o.set(f,s&&s.get(f)||a8({plan:R3r,reset:D3r,count:M3r}));p.context={model:d,ecModel:n,api:i,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:a},a._pipe(d,p)}},t.prototype._createOverallStageTask=function(e,r,n,i){var a=this,s=r.overallTask=r.overallTask||a8({reset:O3r});s.context={ecModel:n,api:i,overallReset:e.overallReset,scheduler:a};var o=s.agentStubMap,l=s.agentStubMap=Yt(),u=e.seriesType,h=e.getTargetSeries,d=e.dirtyOnOverallProgress,f=!1,p="";ec(!e.createOnAllSeries,p),u?n.eachRawSeriesByType(u,g):h?h(n,i).each(g):de(n.getSeries(),g);function g(m){var v=m.uid,y=l.set(v,o&&o.get(v)||(f=!0,a8({reset:k3r,onDirty:_3r})));y.context={model:m,dirtyOnOverallProgress:d},y.agent=s,y.__block=d,a._pipe(m,y)}f&&s.dirty()},t.prototype._pipe=function(e,r){var n=e.uid,i=this._pipelineMap.get(n);!i.head&&(i.head=r),i.tail&&i.tail.pipe(r),i.tail=r,r.__idxInPipeline=i.count++,r.__pipeline=i},t.wrapStageHandler=function(e,r){return ur(e)&&(e={overallReset:e,seriesType:I3r(e)}),e.uid=lT("stageHandler"),r&&(e.visualType=r),e},t}();function O3r(t){t.overallReset(t.ecModel,t.api,t.payload)}function k3r(t){return t.dirtyOnOverallProgress&&E3r}function E3r(){this.agent.dirty(),this.getDownstream().dirty()}function _3r(){this.agent&&this.agent.dirty()}function R3r(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function D3r(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=Qi(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?vt(e,function(r,n){return Wnt(n)}):L3r}var L3r=Wnt(0);function Wnt(t){return function(e,r){var n=r.data,i=r.resetDefines[t];if(i&&i.dataEach)for(var a=e.start;a0&&p===u.length-f.length){var g=u.slice(0,p);g!=="data"&&(r.mainType=g,r[f.toLowerCase()]=l,h=!0)}}o.hasOwnProperty(u)&&(n[u]=l,h=!0),h||(i[u]=l)})}return{cptQuery:r,dataQuery:n,otherQuery:i}},t.prototype.filter=function(e,r){var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,a=n.packedEvent,s=n.model,o=n.view;if(!s||!o)return!0;var l=r.cptQuery,u=r.dataQuery;return h(l,s,"mainType")&&h(l,s,"subType")&&h(l,s,"index","componentIndex")&&h(l,s,"name")&&h(l,s,"id")&&h(u,a,"name")&&h(u,a,"dataIndex")&&h(u,a,"dataType")&&(!o.filterForExposedEvent||o.filterForExposedEvent(e,r.otherQuery,i,a));function h(d,f,p,g){return d[p]==null||f[g||p]===d[p]}},t.prototype.afterTrigger=function(){this.eventInfo=null},t}(),ape=["symbol","symbolSize","symbolRotate","symbolOffset"],Znt=ape.concat(["symbolKeepAspect"]),N3r={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var r=t.getData();if(t.legendIcon&&r.setVisual("legendIcon",t.legendIcon),!t.hasSymbolVisual)return;for(var n={},i={},a=!1,s=0;s=0&&wT(l)?l:.5;var u=t.createRadialGradient(s,o,0,s,o,l);return u}function ope(t,e,r){for(var n=e.type==="radial"?tRr(t,e,r):eRr(t,e,r),i=e.colorStops,a=0;a0)?null:t==="dashed"?[4*e,2*e]:t==="dotted"?[e]:zn(t)?[t]:ft(t)?t:null}function lpe(t){var e=t.style,r=e.lineDash&&e.lineWidth>0&&nRr(e.lineDash,e.lineWidth),n=e.lineDashOffset;if(r){var i=e.strokeNoScale&&t.getLineScale?t.getLineScale():1;i&&i!==1&&(r=vt(r,function(a){return a/i}),n/=i)}return[r,n]}var iRr=new Cm(!0);function aW(t){var e=t.stroke;return!(e==null||e==="none"||!(t.lineWidth>0))}function sit(t){return typeof t=="string"&&t!=="none"}function sW(t){var e=t.fill;return e!=null&&e!=="none"}function oit(t,e){if(e.fillOpacity!=null&&e.fillOpacity!==1){var r=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=r}else t.fill()}function lit(t,e){if(e.strokeOpacity!=null&&e.strokeOpacity!==1){var r=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=r}else t.stroke()}function cpe(t,e,r){var n=Ade(e.image,e.__image,r);if(iH(n)){var i=t.createPattern(n,e.repeat||"repeat");if(typeof DOMMatrix=="function"&&i&&i.setTransform){var a=new DOMMatrix;a.translateSelf(e.x||0,e.y||0),a.rotateSelf(0,0,(e.rotation||0)*lN),a.scaleSelf(e.scaleX||1,e.scaleY||1),i.setTransform(a)}return i}}function aRr(t,e,r,n,i){var a,s=aW(r),o=sW(r),l=r.strokePercent,u=l<1,h=!e.path;(!e.silent||u)&&h&&e.createPathProxy();var d=e.path||iRr,f=e.__dirty;if(!n){var p=r.fill,g=r.stroke,m=o&&!!p.colorStops,v=s&&!!g.colorStops,y=o&&!!p.image,b=s&&!!g.image,x=void 0,w=void 0,A=void 0,T=void 0,S=void 0;(m||v)&&(S=e.getBoundingRect()),m&&(x=f?ope(t,p,S):e.__canvasFillGradient,e.__canvasFillGradient=x),v&&(w=f?ope(t,g,S):e.__canvasStrokeGradient,e.__canvasStrokeGradient=w),y&&(A=f||!e.__canvasFillPattern?cpe(t,p,e):e.__canvasFillPattern,e.__canvasFillPattern=A),b&&(T=f||!e.__canvasStrokePattern?cpe(t,g,e):e.__canvasStrokePattern,e.__canvasStrokePattern=T),m?t.fillStyle=x:y&&(A?t.fillStyle=A:o=!1),v?t.strokeStyle=w:b&&(T?t.strokeStyle=T:s=!1)}var O=e.getGlobalScale();d.setScale(O[0],O[1],e.segmentIgnoreThreshold);var k,E;t.setLineDash&&r.lineDash&&(a=lpe(e),k=a[0],E=a[1]);var _=!0;(h||f&YE)&&(d.setDPR(t.dpr),u?d.setContext(null):(d.setContext(t),_=!1),d.reset(),e.buildPath(d,e.shape,n),d.toStatic(),e.pathUpdated()),_&&d.rebuildPath(t,u?l:1),k&&(t.setLineDash(k),t.lineDashOffset=E),n?(i.batchFill=o,i.batchStroke=s):r.strokeFirst?(s&&lit(t,r),o&&oit(t,r)):(o&&oit(t,r),s&&lit(t,r)),k&&t.setLineDash([])}function sRr(t,e,r){var n=e.__image=Ade(r.image,e.__image,e,e.onload);if(!(!n||!iH(n))){var i=r.x||0,a=r.y||0,s=e.getWidth(),o=e.getHeight(),l=n.width/n.height;if(s==null&&o!=null?s=o*l:o==null&&s!=null?o=s/l:s==null&&o==null&&(s=n.width,o=n.height),r.sWidth&&r.sHeight){var u=r.sx||0,h=r.sy||0;t.drawImage(n,u,h,r.sWidth,r.sHeight,i,a,s,o)}else if(r.sx&&r.sy){var u=r.sx,h=r.sy,d=s-u,f=o-h;t.drawImage(n,u,h,d,f,i,a,s,o)}else t.drawImage(n,i,a,s,o)}}function oRr(t,e,r){var n,i=r.text;if(i!=null&&(i+=""),i){t.font=r.font||Hv,t.textAlign=r.textAlign,t.textBaseline=r.textBaseline;var a=void 0,s=void 0;t.setLineDash&&r.lineDash&&(n=lpe(e),a=n[0],s=n[1]),a&&(t.setLineDash(a),t.lineDashOffset=s),r.strokeFirst?(aW(r)&&t.strokeText(i,r.x,r.y),sW(r)&&t.fillText(i,r.x,r.y)):(sW(r)&&t.fillText(i,r.x,r.y),aW(r)&&t.strokeText(i,r.x,r.y)),a&&t.setLineDash([])}}var cit=["shadowBlur","shadowOffsetX","shadowOffsetY"],uit=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function hit(t,e,r,n,i){var a=!1;if(!n&&(r=r||{},e===r))return!1;if(n||e.opacity!==r.opacity){Tu(t,i),a=!0;var s=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(s)?QA.opacity:s}(n||e.blend!==r.blend)&&(a||(Tu(t,i),a=!0),t.globalCompositeOperation=e.blend||QA.blend);for(var o=0;o0&&r.unfinished);r.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.isSSR=function(){return this._ssr},e.prototype.setOption=function(r,n,i){if(!this[Oo]){if(this._disposed){this.id;return}var a,s,o;if(yr(n)&&(i=n.lazyUpdate,a=n.silent,s=n.replaceMerge,o=n.transition,n=n.notMerge),this[Oo]=!0,z_(this),!this._model||n){var l=new v4r(this._api),u=this._theme,h=this._model=new Gfe;h.scheduler=this._scheduler,h.ssr=this._ssr,h.init(null,null,null,u,this._locale,l)}this._model.setOption(r,{replaceMerge:s},Tpe);var d={seriesTransition:o,optionChanged:!0};if(i)this[Sl]={silent:a,updateParams:d},this[Oo]=!1,this.getZr().wakeUp();else{try{TT(this),dy.update.call(this,null,d)}catch(f){throw this[Sl]=null,this[Oo]=!1,f}this._ssr||this._zr.flush(),this[Sl]=null,this[Oo]=!1,$_.call(this,a),F_.call(this,a)}}},e.prototype.setTheme=function(r,n){if(!this[Oo]){if(this._disposed){this.id;return}var i=this._model;if(i){var a=n&&n.silent,s=null;this[Sl]&&(a==null&&(a=this[Sl].silent),s=this[Sl].updateParams,this[Sl]=null),this[Oo]=!0,z_(this);try{this._updateTheme(r),i.setTheme(this._theme),TT(this),dy.update.call(this,{type:"setTheme"},s)}catch(o){throw this[Oo]=!1,o}this[Oo]=!1,$_.call(this,a),F_.call(this,a)}}},e.prototype._updateTheme=function(r){Nt(r)&&(r=Uit[r]),r&&(r=lr(r),r&&Krt(r,!0),this._theme=r)},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||Rn.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(r){return this.renderToCanvas(r)},e.prototype.renderToCanvas=function(r){r=r||{};var n=this._zr.painter;return n.getRenderedCanvas({backgroundColor:r.backgroundColor||this._model.get("backgroundColor"),pixelRatio:r.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(r){r=r||{};var n=this._zr.painter;return n.renderToString({useViewBox:r.useViewBox})},e.prototype.getSvgDataURL=function(){var r=this._zr,n=r.storage.getDisplayList();return de(n,function(i){i.stopAnimation(null,!0)}),r.painter.toDataURL()},e.prototype.getDataURL=function(r){if(this._disposed){this.id;return}r=r||{};var n=r.excludeComponents,i=this._model,a=[],s=this;de(n,function(l){i.eachComponent({mainType:l},function(u){var h=s._componentsMap[u.__viewId];h.group.ignore||(a.push(h),h.group.ignore=!0)})});var o=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(r).toDataURL("image/"+(r&&r.type||"png"));return de(a,function(l){l.group.ignore=!1}),o},e.prototype.getConnectedDataURL=function(r){if(this._disposed){this.id;return}var n=r.type==="svg",i=this.group,a=Math.min,s=Math.max,o=1/0;if(gW[i]){var l=o,u=o,h=-o,d=-o,f=[],p=r&&r.pixelRatio||this.getDevicePixelRatio();de(ST,function(x,w){if(x.group===i){var A=n?x.getZr().painter.getSvgDom().innerHTML:x.renderToCanvas(lr(r)),T=x.getDom().getBoundingClientRect();l=a(T.left,l),u=a(T.top,u),h=s(T.right,h),d=s(T.bottom,d),f.push({dom:A,left:T.left,top:T.top})}}),l*=p,u*=p,h*=p,d*=p;var g=h-l,m=d-u,v=Ho.createCanvas(),y=sde(v,{renderer:n?"svg":"canvas"});if(y.resize({width:g,height:m}),n){var b="";return de(f,function(x){var w=x.left-l,A=x.top-u;b+=''+x.dom+""}),y.painter.getSvgRoot().innerHTML=b,r.connectedBackgroundColor&&y.painter.setBackgroundColor(r.connectedBackgroundColor),y.refreshImmediately(),y.painter.toDataURL()}else return r.connectedBackgroundColor&&y.add(new tn({shape:{x:0,y:0,width:g,height:m},style:{fill:r.connectedBackgroundColor}})),de(f,function(x){var w=new Yo({style:{x:x.left*p-l,y:x.top*p-u,image:x.dom}});y.add(w)}),y.refreshImmediately(),v.toDataURL("image/"+(r&&r.type||"png"))}else return this.getDataURL(r)},e.prototype.convertToPixel=function(r,n,i){return uW(this,"convertToPixel",r,n,i)},e.prototype.convertToLayout=function(r,n,i){return uW(this,"convertToLayout",r,n,i)},e.prototype.convertFromPixel=function(r,n,i){return uW(this,"convertFromPixel",r,n,i)},e.prototype.containPixel=function(r,n){if(this._disposed){this.id;return}var i=this._model,a,s=n_(i,r);return de(s,function(o,l){l.indexOf("Models")>=0&&de(o,function(u){var h=u.coordinateSystem;if(h&&h.containPoint)a=a||!!h.containPoint(n);else if(l==="seriesModels"){var d=this._chartsMap[u.__viewId];d&&d.containPoint&&(a=a||d.containPoint(n,u))}},this)},this),!!a},e.prototype.getVisual=function(r,n){var i=this._model,a=n_(i,r,{defaultMainType:"series"}),s=a.seriesModel,o=s.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?o.indexOfRawIndex(a.dataIndex):null;return l!=null?spe(o,l,n):u8(o,n)},e.prototype.getViewOfComponentModel=function(r){return this._componentsMap[r.__viewId]},e.prototype.getViewOfSeriesModel=function(r){return this._chartsMap[r.__viewId]},e.prototype._initEvents=function(){var r=this;de(LRr,function(i){var a=function(s){var o=r.getModel(),l=s.target,u,h=i==="globalout";if(h?u={}:l&&bT(l,function(m){var v=Cr(m);if(v&&v.dataIndex!=null){var y=v.dataModel||o.getSeriesByIndex(v.seriesIndex);return u=y&&y.getDataParams(v.dataIndex,v.dataType,l)||{},!0}else if(v.eventData)return u=ot({},v.eventData),!0},!0),u){var d=u.componentType,f=u.componentIndex;(d==="markLine"||d==="markPoint"||d==="markArea")&&(d="series",f=u.seriesIndex);var p=d&&f!=null&&o.getComponent(d,f),g=p&&r[p.mainType==="series"?"_chartsMap":"_componentsMap"][p.__viewId];u.event=s,u.type=i,r._$eventProcessor.eventInfo={targetEl:l,packedEvent:u,model:p,view:g},r.trigger(i,u)}};a.zrEventfulCallAtLast=!0,r._zr.on(i,a,r)});var n=this._messageCenter;de(wpe,function(i,a){n.on(a,function(s){r.trigger(a,s)})}),$3r(n,this,this._api)},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0;var r=this.getDom();r&&get(this.getDom(),Cpe,"");var n=this,i=n._api,a=n._model;de(n._componentsViews,function(s){s.dispose(a,i)}),de(n._chartsViews,function(s){s.dispose(a,i)}),n._zr.dispose(),n._dom=n._model=n._chartsMap=n._componentsMap=n._chartsViews=n._componentsViews=n._scheduler=n._api=n._zr=n._throttledZrFlush=n._theme=n._coordSysMgr=n._messageCenter=null,delete ST[n.id]},e.prototype.resize=function(r){if(!this[Oo]){if(this._disposed){this.id;return}this._zr.resize(r);var n=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!n){var i=n.resetOption("media"),a=r&&r.silent;this[Sl]&&(a==null&&(a=this[Sl].silent),i=!0,this[Sl]=null),this[Oo]=!0,z_(this);try{i&&TT(this),dy.update.call(this,{type:"resize",animation:ot({duration:0},r&&r.animation)})}catch(s){throw this[Oo]=!1,s}this[Oo]=!1,$_.call(this,a),F_.call(this,a)}}},e.prototype.showLoading=function(r,n){if(this._disposed){this.id;return}if(yr(r)&&(n=r,r=""),r=r||"default",this.hideLoading(),!!Spe[r]){var i=Spe[r](this._api,n),a=this._zr;this._loadingFX=i,a.add(i)}},e.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},e.prototype.makeActionFromEvent=function(r){var n=ot({},r);return n.type=xpe[r.type],n},e.prototype.dispatchAction=function(r,n){if(this._disposed){this.id;return}if(yr(n)||(n={silent:!!n}),!!fW[r.type]&&this._model){if(this[Oo]){this._pendingActions.push(r);return}var i=n.silent;vpe.call(this,r,i);var a=n.flush;a?this._zr.flush():a!==!1&&Rn.browser.weChat&&this._throttledZrFlush(),$_.call(this,i),F_.call(this,i)}},e.prototype.updateLabelLayout=function(){Gf.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(r){if(this._disposed){this.id;return}var n=r.seriesIndex,i=this.getModel(),a=i.getSeriesByIndex(n);a.appendData(r),this._scheduler.unfinished=!0,this.getZr().wakeUp()},e.internalField=function(){TT=function(d){U3r(d._model);var f=d._scheduler;f.restorePipelines(d._zr,d._model),f.prepareStageTasks(),gpe(d,!0),gpe(d,!1),f.plan()},gpe=function(d,f){for(var p=d._model,g=d._scheduler,m=f?d._componentsViews:d._chartsViews,v=f?d._componentsMap:d._chartsMap,y=d._zr,b=d._api,x=0;xJt(f.get("hoverLayerThreshold"),Mrt.hoverLayerThreshold)&&!Rn.node&&!Rn.worker;(d._usingTHL||v)&&(f.eachSeries(function(y){if(!y.preventUsingHoverLayer){var b=d._chartsMap[y.__viewId];b.__alive&&b.eachRendered(function(x){var w=x.states.emphasis;w&&w.hoverLayer!==v_&&(w.hoverLayer=v?ztt:Ftt)})}}),d._usingTHL=v)}}function o(d,f){var p=d.get("blendMode")||null;f.eachRendered(function(g){g.isGroup||(g.style.blend=p)})}function l(d,f){if(!d.preventAutoZ){var p=sT(d);f.eachRendered(function(g){return _H(g,p.z,p.zlevel),!0})}}function u(d,f){f.eachRendered(function(p){if(!m_(p)){var g=p.getTextContent(),m=p.getTextGuideLine();p.stateTransition&&(p.stateTransition=null),g&&g.stateTransition&&(g.stateTransition=null),m&&m.stateTransition&&(m.stateTransition=null),p.hasState()?(p.prevStates=p.currentStates,p.clearStates()):p.prevStates&&(p.prevStates=null)}})}function h(d,f){var p=d.getModel("stateAnimation"),g=d.isAnimationEnabled(),m=p.get("duration"),v=m>0?{duration:m,delay:p.get("delay"),easing:p.get("easing")}:null;f.eachRendered(function(y){if(y.states&&y.states.emphasis){if(m_(y))return;if(y instanceof vn&&H_r(y),y.__dirty){var b=y.prevStates;b&&y.useStates(b)}if(g){y.stateTransition=v;var x=y.getTextContent(),w=y.getTextGuideLine();x&&(x.stateTransition=v),w&&(w.stateTransition=v)}y.__dirty&&a(y)}})}$it=function(d){return new(function(f){rt(p,f);function p(){return f!==null&&f.apply(this,arguments)||this}return p.prototype.getCoordinateSystems=function(){return d._coordSysMgr.getCoordinateSystems()},p.prototype.getComponentByElement=function(g){for(;g;){var m=g.__ecComponentInfo;if(m!=null)return d._model.getComponent(m.mainType,m.index);g=g.parent}},p.prototype.enterEmphasis=function(g,m){oy(g,m),Hf(d)},p.prototype.leaveEmphasis=function(g,m){ly(g,m),Hf(d)},p.prototype.enterBlur=function(g){dtt(g),Hf(d)},p.prototype.leaveBlur=function(g){Wde(g),Hf(d)},p.prototype.enterSelect=function(g){ftt(g),Hf(d)},p.prototype.leaveSelect=function(g){ptt(g),Hf(d)},p.prototype.getModel=function(){return d.getModel()},p.prototype.getViewOfComponentModel=function(g){return d.getViewOfComponentModel(g)},p.prototype.getViewOfSeriesModel=function(g){return d.getViewOfSeriesModel(g)},p.prototype.getECUpdateCycleVersion=function(){return d[lW]},p.prototype.usingTHL=function(){return d._usingTHL},p}(ttt))(d)},Fit=function(d){function f(p,g){for(var m=0;m=0)){Yit.push(r);var s=Hnt.wrapStageHandler(r,i);s.__prio=e,s.__raw=r,t.push(s)}}function Dpe(t,e){Spe[t]=e}function VRr(t){BZe({createCanvas:t})}function qit(t,e,r){var n=rit("registerMap");n&&n(t,e,r)}function QRr(t){var e=rit("getMap");return e&&e(t)}var jit=X4r;Sx(dpe,A3r),Sx(oW,T3r),Sx(oW,S3r),Sx(dpe,N3r),Sx(oW,B3r),Sx(Oit,gRr),Epe(Krt),_pe(wRr,_4r),Dpe("default",C3r),qp({type:KA,event:KA,update:KA},Xa),qp({type:pH,event:pH,update:pH},Xa),qp({type:gH,event:Qde,update:gH,action:Xa,refineEvent:Lpe,publishNonRefinedEvent:!0}),qp({type:Vde,event:Qde,update:Vde,action:Xa,refineEvent:Lpe,publishNonRefinedEvent:!0}),qp({type:mH,event:Qde,update:mH,action:Xa,refineEvent:Lpe,publishNonRefinedEvent:!0});function Lpe(t,e,r,n){return{eventContent:{selected:z_r(r),isFromClick:e.isFromClick||!1}}}kpe("default",{}),kpe("dark",Knt);var GRr={},Xit=[],HRr={registerPreprocessor:Epe,registerProcessor:_pe,registerPostInit:Qit,registerPostUpdate:Git,registerUpdateLifecycle:mW,registerAction:qp,registerCoordinateSystem:Hit,registerLayout:Wit,registerVisual:Sx,registerTransform:jit,registerLoading:Dpe,registerMap:qit,registerImpl:F3r,PRIORITY:kit,ComponentModel:fn,ComponentView:Hi,SeriesModel:Ri,ChartView:Ti,registerComponentModel:function(t){fn.registerClass(t)},registerComponentView:function(t){Hi.registerClass(t)},registerSeriesModel:function(t){Ri.registerClass(t)},registerChartView:function(t){Ti.registerClass(t)},registerCustomSeries:function(t,e){iit(t,e)},registerSubTypeDefaulter:function(t,e){fn.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){KJe(t,e)}};function Yr(t){if(ft(t)){de(t,function(e){Yr(e)});return}Ir(Xit,t)>=0||(Xit.push(t),ur(t)&&(t={install:t}),t.install(HRr))}function h8(t){return t==null?0:t.length||1}function Kit(t){return t}var fy=function(){function t(e,r,n,i,a,s){this._old=e,this._new=r,this._oldKeyGetter=n||Kit,this._newKeyGetter=i||Kit,this.context=a,this._diffModeMultiple=s==="multiple"}return t.prototype.add=function(e){return this._add=e,this},t.prototype.update=function(e){return this._update=e,this},t.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},t.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},t.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},t.prototype.remove=function(e){return this._remove=e,this},t.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},t.prototype._executeOneToOne=function(){var e=this._old,r=this._new,n={},i=new Array(e.length),a=new Array(r.length);this._initIndexMap(e,null,i,"_oldKeyGetter"),this._initIndexMap(r,n,a,"_newKeyGetter");for(var s=0;s1){var h=l.shift();l.length===1&&(n[o]=l[0]),this._update&&this._update(h,s)}else u===1?(n[o]=null,this._update&&this._update(l,s)):this._remove&&this._remove(s)}this._performRestAdd(a,n)},t.prototype._executeMultiple=function(){var e=this._old,r=this._new,n={},i={},a=[],s=[];this._initIndexMap(e,n,a,"_oldKeyGetter"),this._initIndexMap(r,i,s,"_newKeyGetter");for(var o=0;o1&&f===1)this._updateManyToOne&&this._updateManyToOne(h,u),i[l]=null;else if(d===1&&f>1)this._updateOneToMany&&this._updateOneToMany(h,u),i[l]=null;else if(d===1&&f===1)this._update&&this._update(h,u),i[l]=null;else if(d>1&&f>1)this._updateManyToMany&&this._updateManyToMany(h,u),i[l]=null;else if(d>1)for(var p=0;p1)for(var o=0;o30}var d8=yr,Cx=vt,KRr=typeof Int32Array>"u"?Array:Int32Array,ZRr="e\0\0",rat=-1,JRr=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],eDr=["_approximateExtent"],nat,bW,f8,p8,Ppe,g8,Npe,zc=function(){function t(e,r){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","minmaxDownSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","minmaxDownSample","lttbDownSample"];var n,i=!1;Jit(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(i=!0,n=e),n=n||["x","y"];for(var a={},s=[],o={},l=!1,u={},h=0;h=r)){var n=this._store,i=n.getProvider();this._updateOrdinalMeta();var a=this._nameList,s=this._idList,o=i.getSource().sourceFormat,l=o===_d;if(l&&!i.pure)for(var u=[],h=e;h0},t.prototype.ensureUniqueItemVisual=function(e,r){var n=this._itemVisuals,i=n[e];i||(i=n[e]={});var a=i[r];return a==null&&(a=this.getVisual(r),ft(a)?a=a.slice():d8(a)&&(a=ot({},a)),i[r]=a),a},t.prototype.setItemVisual=function(e,r,n){var i=this._itemVisuals[e]||{};this._itemVisuals[e]=i,d8(r)?ot(i,r):i[r]=n},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(e,r){d8(e)?ot(this._layout,e):this._layout[e]=r},t.prototype.getLayout=function(e){return this._layout[e]},t.prototype.getItemLayout=function(e){return this._itemLayouts[e]},t.prototype.setItemLayout=function(e,r,n){this._itemLayouts[e]=n?ot(this._itemLayouts[e]||{},r):r},t.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},t.prototype.setItemGraphicEl=function(e,r){var n=this.hostModel&&this.hostModel.seriesIndex;Fde(n,this.dataType,e,r),this._graphicEls[e]=r},t.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},t.prototype.eachItemGraphicEl=function(e,r){de(this._graphicEls,function(n,i){n&&e&&e.call(r,n,i)})},t.prototype.cloneShallow=function(e){return e||(e=new t(this._schema?this._schema:Cx(this.dimensions,this._getDimInfo,this),this.hostModel)),Ppe(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(e,r){var n=this[e];ur(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var i=n.apply(this,arguments);return r.apply(this,[i].concat(gG(arguments)))})},t.internalField=function(){nat=function(e){var r=e._invertedIndicesMap;de(r,function(n,i){var a=e._dimInfos[i],s=a.ordinalMeta,o=e._store;if(s){n=r[i]=new KRr(s.categories.length);for(var l=0;l1&&(l+="__ec__"+h),i[r]=l}}}(),t}();function tDr(t,e){return U_(t,e).dimensions}function U_(t,e){Yfe(t)||(t=jfe(t)),e=e||{};var r=e.coordDimensions||[],n=e.dimensionsDefine||t.dimensionsDefine||[],i=Yt(),a=[],s=rDr(t,r,n,e.dimensionsCount),o=e.canOmitUnusedDimensions&&tat(s),l=n===t.dimensionsDefine,u=l?eat(t):Ipe(n),h=e.encodeDefine;!h&&e.encodeDefaulter&&(h=e.encodeDefaulter(t,s));for(var d=Yt(h),f=new ynt(s),p=0;p0&&(k.name=k.name+(E-1))}),new Zit({source:t,dimensions:a,fullDimensionCount:s,dimensionOmitted:o})}function rDr(t,e,r,n){var i=Math.max(t.dimensionsDetectedCount||1,e.length,r.length,n||0);return de(e,function(a){var s;yr(a)&&(s=a.dimsDef)&&(i=Math.max(i,s.length))}),i}function nDr(t,e,r){if(r||e.hasKey(t)){for(var n=0;e.hasKey(t+n);)n++;t+=n}return e.set(t,!0),t}var iDr=function(){function t(e){this.coordSysDims=[],this.axisMap=Yt(),this.categoryAxisMap=Yt(),this.coordSysName=e}return t}();function aDr(t){var e=t.get("coordinateSystem"),r=new iDr(e),n=sDr[e];if(n)return n(t,r,r.axisMap,r.categoryAxisMap),r}var sDr={cartesian2d:function(t,e,r,n){var i=t.getReferringComponents("xAxis",ds).models[0],a=t.getReferringComponents("yAxis",ds).models[0];e.coordSysDims=["x","y"],r.set("x",i),r.set("y",a),V_(i)&&(n.set("x",i),e.firstCategoryDimIndex=0),V_(a)&&(n.set("y",a),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,r,n){var i=t.getReferringComponents("singleAxis",ds).models[0];e.coordSysDims=["single"],r.set("single",i),V_(i)&&(n.set("single",i),e.firstCategoryDimIndex=0)},polar:function(t,e,r,n){var i=t.getReferringComponents("polar",ds).models[0],a=i.findAxisModel("radiusAxis"),s=i.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],r.set("radius",a),r.set("angle",s),V_(a)&&(n.set("radius",a),e.firstCategoryDimIndex=0),V_(s)&&(n.set("angle",s),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},geo:function(t,e,r,n){e.coordSysDims=["lng","lat"]},parallel:function(t,e,r,n){var i=t.ecModel,a=i.getComponent("parallel",t.get("parallelIndex")),s=e.coordSysDims=a.dimensions.slice();de(a.parallelAxisIndex,function(o,l){var u=i.getComponent("parallelAxis",o),h=s[l];r.set(h,u),V_(u)&&(n.set(h,u),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=l))})},matrix:function(t,e,r,n){var i=t.getReferringComponents("matrix",ds).models[0];e.coordSysDims=["x","y"];var a=i.getDimensionModel("x"),s=i.getDimensionModel("y");r.set("x",a),r.set("y",s),n.set("x",a),n.set("y",s)}};function V_(t){return t.get("type")==="category"}function iat(t,e,r){r=r||{};var n=r.byIndex,i=r.stackedCoordDimension,a,s,o;oDr(e)?a=e:(s=e.schema,a=s.dimensions,o=e.store);var l=!!(t&&t.get("stack")),u,h,d,f,p=!0;function g(w){return w.type!=="ordinal"&&w.type!=="time"}if(de(a,function(w,A){Nt(w)&&(a[A]=w={name:w}),g(w)||(p=!1)}),de(a,function(w,A){l&&!w.isExtraCoord&&(!n&&!u&&w.ordinalMeta&&(u=w),!h&&g(w)&&(!p||w.coordDim!=="x"&&w.coordDim!=="angle")&&(!i||i===w.coordDim)&&(h=w))}),h&&!n&&!u&&(n=!0),h){d="__\0ecstackresult_"+t.id,f="__\0ecstackedover_"+t.id,u&&(u.createInvertedIndices=!0);var m=h.coordDim,v=h.type,y=0;de(a,function(w){w.coordDim===m&&y++});var b={name:d,coordDim:m,coordDimIndex:y,type:v,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},x={name:f,coordDim:f,coordDimIndex:y+1,type:v,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};s?(o&&(b.storeDimIndex=o.ensureCalculationDimension(f,v),x.storeDimIndex=o.ensureCalculationDimension(d,v)),s.appendCalculationDimension(b),s.appendCalculationDimension(x)):(a.push(b),a.push(x))}return{stackedDimension:h&&h.name,stackedByDimension:u&&u.name,isStackedByIndex:n,stackedOverDimension:f,stackResultDimension:d}}function oDr(t){return!Jit(t.schema)}function py(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function Bpe(t,e){return py(t,e)?t.getCalculationInfo("stackResultDimension"):e}function lDr(t,e){var r=t.get("coordinateSystem"),n=O_.get(r),i;return e&&e.coordSysDims&&(i=vt(e.coordSysDims,function(a){var s={name:a},o=e.axisMap.get(a);if(o){var l=o.get("type");s.type=vW(l)}return s})),i||(i=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),i}function cDr(t,e,r){var n,i;return r&&de(t,function(a,s){var o=a.coordDim,l=r.categoryAxisMap.get(o);l&&(n==null&&(n=s),a.ordinalMeta=l.getOrdinalMeta(),e&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(i=!0)}),!i&&n!=null&&(t[n].otherDims.itemName=0),n}function Dm(t,e,r){r=r||{};var n=e.getSourceManager(),i,a=!1;t?(a=!0,i=jfe(t)):(i=n.getSource(),a=i.sourceFormat===_d);var s=aDr(e),o=lDr(e,s),l=r.useEncodeDefaulter,u=ur(l)?l:l?qr(Prt,o,e):null,h={coordDimensions:o,generateCoord:r.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},d=U_(i,h),f=cDr(d.dimensions,r.createInvertedIndices,s),p=a?null:n.getSharedDataStore(d),g=iat(e,{schema:d,store:p}),m=new zc(d,e);m.setCalculationInfo(g);var v=f!=null&&uDr(i)?function(y,b,x,w){return w===f?x:this.defaultDimValueGetter(y,b,x,w)}:null;return m.hasItemOption=!1,m.initData(a?i:p,null,v),m}function uDr(t){if(t.sourceFormat===_d){var e=hDr(t.data||[]);return!ft(r_(e))}}function hDr(t){for(var e=0;e=e[0]&&t<=e[1]},getExtent:function(){return this._extents[Rh].slice()},getExtentUnsafe:function(t){return this._extents[t]},setExtent:function(t,e){oat(this._extents,Rh,t,e)},setExtent2:function(t,e,r){var n=this._extents;n[t]||(n[t]=n[Rh].slice()),oat(n,t,e,r)},freeze:function(){}};function oat(t,e,r,n){zA(r,n)&&(t[e][0]=r,t[e][1]=n)}function lat(t){return AW(t)||Q_(t)}function AW(t){return t.type==="interval"}function b8(t){return t.type==="time"}function Q_(t){return t.type==="log"}function Uc(t){return t.type==="ordinal"}function vDr(t){var e=ZG(t),r=IA(10,e),n=mm(t/r);return n?n===2?n=3:n===3?n=5:n*=2:n=1,Gn(n*r,-e)}function CT(t){return vm(t)+2}function TW(t,e){return PA(t)/PA(e)}function Vpe(t,e,r){var n=r&&r.lookup;if(n){for(var i=0;i1&&a/s>2&&(i=Math.round(Math.ceil(i/s)*s)),i!==n[0]&&l(n[0],!0,!0);for(var o=i;o<=n[1];o+=s)l(o,!1,o===n[0]||o===n[1]);o-s!==n[1]&&l(n[1],!0,!0);function l(u,h,d){r({value:u,offInterval:h},d)}}var x8=function(t){rt(e,t);function e(r){var n=t.call(this)||this;n.type="ordinal",n.parse=e.parse,Fpe(n,e.decoratedMethods);var i=r.ordinalMeta;i||(i=new m8({})),ft(i)&&(i=new m8({categories:vt(i,function(s){return yr(s)?s.value:s})})),n._ordinalMeta=i;var a=$pe(null,null,r.extent||[0,i.categories.length-1]);return n._mapper=a.mapper,zpe(n),n}return e.parse=function(r){return r==null?r=NaN:Nt(r)?(r=this._ordinalMeta.getOrdinal(r),r==null&&(r=NaN)):r=mm(r),r},e.prototype.getTicks=function(){var r=[];return uat(this,0,function(n){r.push(n)}),r},e.prototype.getMinorTicks=function(r){},e.prototype.setSortInfo=function(r){if(r==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var n=r.ordinalNumbers,i=this._ordinalNumbersByTick=[],a=this._ticksByOrdinalNumber=[],s=0,o=this._ordinalMeta.categories.length,l=Ai(o,n.length);s=0&&r=0&&r=0&&rs[0]&&ms[1]||!isFinite(m)||!isFinite(s[1]))break}else{if(v>g)break;m=Ai(m,s[1]),v===g&&(m=s[1])}if(d.push({value:m}),m=Gn(m+i,o),u){var y=u.calcNiceTickMultiple(m,p);y>=0&&(m=Gn(m+y*i,o))}if(d.length>0&&m===d[d.length-1].value)break;if(d.length>f)return[]}var b=d.length?d[d.length-1].value:s[1];return a[1]>b&&d.push({value:r.expandToNicedExtent?Gn(b+i,o):a[1]}),h&&l.pruneTicksByBreak(r.pruneByBreak,d,u.breaks,function(x){return x.value},n.interval,a),h&&r.breakTicks!=="none"&&l.addBreaksToTicks(d,u.breaks,a),d},e.prototype.getMinorTicks=function(r){return Qpe(this,r,PH(this),this._cfg.interval)},e.prototype.getLabel=function(r,n){if(r==null)return"";var i=n&&n.precision;i==null?i=vm(r.value)||0:i==="auto"&&(i=this._cfg.intervalPrecision);var a=Gn(r.value,i,!0);return Lfe(a)},e.type="interval",e}(jp);jp.registerClass(Ox);var bDr=function(t,e,r,n){for(;r>>1;t[i][1]16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function wDr(t){var e=30*Vf;return t/=e,t>6?6:t>3?3:t>2?2:1}function ADr(t){return t/=jN,t>12?12:t>6?6:t>3.5?4:t>2?2:1}function fat(t,e){return t/=e?Cfe:Sfe,t>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function TDr(t){return en(JG(t,!0),1)}function SDr(t,e,r){var n=Math.max(0,Ir(Ld,e)-1);return FH(new Date(t),Ld[n],r).getTime()}function CDr(t,e){var r=new Date(0);r[t](1);var n=r.getTime();r[t](1+e);var i=r.getTime()-n;return function(a,s){return Math.max(0,Math.round((s-a)/i))}}function ODr(t,e,r,n,i,a){var s=3e3,o=V5r,l=0;function u(M,P,N,F,B,V,z){for(var U=CDr(B,M),Q=P,G=new Date(Q);Qs));)if(G[B](G[F]()+M),Q=G.getTime(),a){var X=a.calcNiceTickMultiple(Q,U);X>0&&(G[B](G[F]()+X*M),Q=G.getTime())}z.push({value:Q,notAdd:Q>n[1]})}function h(M,P,N){var F=[],B=!P.length;if(!dat(XN(M),n[0],n[1],r)){B&&(P=[{value:SDr(n[0],M,r)},{value:n[1]}]);for(var V=0;V=n[0]&&z<=n[1]&&u(Q,z,U,G,X,Y,F),M==="year"&&N.length>1&&V===0&&N.unshift({value:N[0].value-Q})}}for(var V=0;V=n[0]&&w<=n[1]&&p++)}var A=i/e;if(p>A*1.5&&g>A/1.5||(d.push(b),p>A||t===o[m]))break}f=[]}}}for(var T=ni(vt(d,function(M){return ni(M,function(P){return P.value>=n[0]&&P.value<=n[1]&&!P.notAdd})}),function(M){return M.length>0}),S=T.length-1,O=[],m=0;mn[0])&&O.unshift({value:n[0],time:{level:0,upperTimeUnit:R,lowerTimeUnit:R},notNice:!0}),(!L||L.valueo&&(a=o);var l=CW.length,u=Math.min(bDr(CW,a,0,l),l-1),h=CW[u][1],d=CW[Math.max(u-1,0)][0];t.setTimeInterval({approxInterval:a,interval:h,minLevelUnit:d})};jp.registerClass(hat);var OW=0,kW=1,EDr=2,pat=function(t){rt(e,t);function e(r){var n=t.call(this)||this;n.type="log",n.parse=Ox.parse,n.base=r.logBase||10;var i=[],a=[],s=n._lookup={from:i,to:a};i[OW]=i[kW]=a[OW]=a[kW]=NaN,Fpe(n,e.mapperMethods);var o=Ns(),l=r.breakOption,u={lookup:s};return o&&o.parseAxisBreakOptionInwardTransform(l,n,{noNegative:!0},EDr,u),n.powStub=new Ox({breakParsed:u.original}),n.intervalStub=new Ox({breakParsed:u.transformed}),zpe(n,n.intervalStub),n}return e.prototype.getTicks=function(r){var n=this.base,i=this.powStub,a=Ns(),s=this.intervalStub,o=s.getExtent(),l=i.getExtent(),u={lookup:{from:o,to:l}};return vt(s.getTicks(r||{}),function(h){var d=h.value,f=Vpe(d,n,u),p;if(a){var g=a.getTicksBreakOutwardTransform(this,h,PH(i),this._lookup);g&&(p=g.vBreak,f=g.tickVal)}return{value:f,break:p}},this)},e.prototype.getMinorTicks=function(r){return Qpe(this,r,PH(this.powStub),this.intervalStub.getConfig().interval)},e.prototype.getLabel=function(r,n){return this.intervalStub.getLabel(r,n)},e.type="log",e.mapperMethods={needTransform:function(){return!0},normalize:function(r){return this.intervalStub.normalize(TW(r,this.base))},scale:function(r){return Vpe(this.intervalStub.scale(r),this.base,null)},transformIn:function(r,n){return r=TW(r,this.base),n&&n.depth===gy?r:this.intervalStub.transformIn(r,n)},transformOut:function(r,n){var i=n?n.depth:null;return gat.depth=i,mat.lookup=this._lookup,Vpe(i===gy?r:this.intervalStub.transformOut(r,gat),this.base,mat)},contain:function(r){return this.powStub.contain(r)},setExtent:function(r,n){this.setExtent2(Rh,r,n)},setExtent2:function(r,n,i){if(!(!zA(n,i)||n<=0||i<=0)){var a=vat,s=vat;if(r===Rh){var o=this._lookup;a=o.to,s=o.from}this.powStub.setExtent2(r,a[OW]=n,a[kW]=i);var l=this.base;this.intervalStub.setExtent2(r,s[OW]=TW(n,l),s[kW]=TW(i,l))}},getFilter:function(){return{g:0}},sanitize:function(r,n){return zA(n[0],n[1])&&Bf(r)&&r<=0&&(r=n[0]),r},getDefaultStartValue:function(){return 1},getExtent:function(){return this.powStub.getExtent()},getExtentUnsafe:function(r,n){return n===null?this.powStub.getExtentUnsafe(r,null):this.intervalStub.getExtentUnsafe(r,n)}},e}(jp);jp.registerClass(pat);var gat={},mat={},vat=[],yat={value:1,category:1,time:1,log:1},bat=Qr();function w8(t){var e=t.get("type");return(e==null||!Kt(yat,e)&&!jp.getClass(e))&&(e="value"),e}function G_(t,e,r){var n=Ns(),i;switch(n&&(i=xat(t,e,r)),e){case"category":return new x8({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:rc()});case"time":return new hat({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC"),breakOption:i});case"log":return new pat({logBase:t.get("logBase"),breakOption:i});case"value":return new Ox({breakOption:i});default:return new(jp.getClass(e)||Ox)({})}}function _Dr(t,e,r){var n=t.getExtentUnsafe(Rh,null),i=n[0],a=n[1];return zA(i,a)?i===e||a===e?DDr:ie?RDr:Gpe:Gpe}var RDr=1,DDr=2,Gpe=3;function LDr(t){bat(t).noOnMyZero=!0}function MDr(t){return bat(t).noOnMyZero}function A8(t){var e=t.getLabelModel().get("formatter");if(t.type==="time"){var r=Q5r(e);return function(i,a){return t.scale.getFormattedLabel(i,a,r)}}else{if(Nt(e))return function(i){var a=t.scale.getLabel(i),s=e.replace("{value}",a??"");return s};if(ur(e)){if(t.type==="category")return function(i,a){return e(EW(t,i),i.value-t.scale.getExtent()[0],null)};var n=Ns();return function(i,a){var s=null;return n&&(s=n.makeAxisLabelFormatterParamBreak(s,i.break)),e(EW(t,i),a,s)}}else return function(i){return t.scale.getLabel(i)}}}function EW(t,e){var r=t.scale;return Uc(r)?r.getLabel(e):e.value}function Hpe(t){var e=t.get("interval");return e??"auto"}function IDr(t){return t.type==="category"&&Hpe(t.getLabelModel())===0}function PDr(t,e){var r={};return de(t.mapDimensionsAll(e),function(n){r[Bpe(t,n)]=!0}),kn(r)}function H_(t){return t==="middle"||t==="center"}function T8(t){return t.getShallow("show")}function xat(t,e,r){var n=t.get("breaks",!0);if(n!=null)return!Ns()||!r||!NDr(e)?void 0:n}function NDr(t){return t!=="category"}function wat(t,e,r,n,i,a){var s=Q_(t),o=s?t.intervalStub:t;if(o.setExtent(n[0],n[1]),s){var l=t.powStub,u={depth:gy},h=t.transformOut(n[0],u),d=t.transformOut(n[1],u),f=yDr(r,n);e[0]&&!f[0]&&(h=i[0]),e[1]&&!f[1]&&(d=i[1]),l.setExtent(h,d)}o.setConfig(a)}function W_(t,e){return Uc(t)?t.getRawOrdinalNumber(e.value):e.value}function S8(t,e){return Uc(t)&&!!e.get("boundaryGap")}var Y_=function(){function t(){}return t.prototype.needIncludeZero=function(){return!this.option.scale},t.prototype.getCoordSysModel=function(){},t}(),BDr=a_(),_W="|&",q_=Qr(),Aat=-2,$Dr=-1,FDr=Qr();function Wpe(t,e){var r=t.model,n=q_(M_(r.ecModel)).keyed,i=n&&n.get(e);return i&&i.get(r.uid)}function zDr(t,e){return Sat(Wpe(t,e))}function UDr(t,e){var r=[];return Tat(t.model.ecModel,function(n){for(var i=0;i0&&d[1]>0&&!f[0]&&(d[0]=0),d[0]<0&&d[1]<0&&!f[1]&&(d[1]=0));var w=!1;d[0]>d[1]&&(d.reverse(),w=!0);var A=C8(e,r.get("startValue",!0)),T=A!=null;!Bf(A)&&i&&(A=e.getDefaultStartValue?e.getDefaultStartValue():0),Bf(A)&&(T||!b||x)&&(Ad[1]&&!f[1]&&(d[1]=A,f[1]=!0));var S=this._i={scale:e,dataMM:h,noZoomEffMM:d,zoomMM:[],fixMM:f,zoomFixMM:[!1,!1],startValue:A,isBlank:y,incl0:x,tggAxInv:w,ctnShp:a};Eat(S,d)}return t.prototype.makeNoZoom=function(){return this._i.noZoomEffMM.slice()},t.prototype.makeFinal=function(){var e=this._i,r=e.zoomMM,n=e.noZoomEffMM,i=e.zoomFixMM,a=e.fixMM,s={fixMM:a,zoomFixMM:i,isBlank:e.isBlank,incl0:e.incl0,tggAxInv:e.tggAxInv,ctnShp:e.ctnShp,effMM:n.slice()},o=s.effMM;return r[0]!=null&&(o[0]=r[0],a[0]=i[0]=!0),r[1]!=null&&(o[1]=r[1],a[1]=i[1]=!0),Eat(e,o),s},t.prototype.makeRenderInfo=function(){return{startValue:this._i.startValue}},t.prototype.setZoomMM=function(e,r){this._i.zoomMM[e]=r},t}();function Eat(t,e){var r=t.scale,n=t.dataMM;r.sanitize&&(e[0]=r.sanitize(e[0],n),e[1]=r.sanitize(e[1],n),tH(e))}function C8(t,e){return e==null?null:Jl(e)?NaN:t.parse(e)}function jDr(t,e){var r;if(Uc(t))r=[0,0];else{var n=e.get("boundaryGap");typeof n=="boolean"&&(n=null),r=ft(n)?n:[n,n]}return[_at(r[0]),_at(r[1])]}function _at(t){return gm(typeof t=="boolean"?0:t,1)||0}function Rat(t){var e=WDr(t.scale);return e.extent||(e.extent=rc()),e}function XDr(t,e){Rat(t).dimIdxInCoord=e.get(t.dim)}function ET(t,e){var r=t.scale,n=t.model,i=t.dim;r.rawExtentInfo||KDr(r,t,i,n,e)}function KDr(t,e,r,n,i){var a=Rat(e),s=a.extent,o=!1;VDr(e,function(h){if(h.boxCoordinateSystem){var d=wrt(h).coord,f=a.dimIdxInCoord;if(f>=0){if(ft(d)){var p=d[f];p!=null&&!ft(p)&&bde(s,t.parse(p))}}}else if(h.coordinateSystem){var g=h.getData();if(g){var m=t.getFilter?t.getFilter():null;de(PDr(g,r),function(v){EEr(s,g.getApproximateExtent(v,m))})}h.__requireStartValue&&h.__requireStartValue(e)&&(o=!0)}});var l=JDr(t,e,n),u=new kat(t,n,s,o,l);Dat(t,u,i),a.extent=null}function ZDr(t,e){var r=t.scale;Dat(r,new kat(r,t.model,e,!1,!1),qDr)}function Dat(t,e,r){t.rawExtentInfo=e,e.from=r}function DW(t,e){Kpe.set(t,e)}var Kpe=Yt();function Lat(t,e,r,n,i){t.rawExtentInfo||ZDr({scale:t,model:e},i||rc());var a=t.rawExtentInfo.makeFinal(),s=a.effMM;return t.setExtent(s[0],s[1]),t.setBlank(a.isBlank),n&&a.tggAxInv&&r&&!r.get("legacyMinMaxDontInverseAxis")&&(n.inverse=!n.inverse),a}function JDr(t,e,r){var n=S8(t,r),i=r.get("containShape",!0);if(i==null&&!n&&(i=!0),!i)return!1;var a=!1;return Cat(e,function(s){a=!!Kpe.get(s)||a}),a}function eLr(t,e,r,n){if(r.ctnShp){var i;if(Cat(t,function(o){var l=Kpe.get(o);if(l){var u=l(t,n);u&&(i=i||[0,0],vet(i,u[0]),yet(i,u[1]),LDr(t))}}),!!i){var a=e.getExtent();if(Uc(e))t.onBand||e.setExtent2(v8,Ai(a[0],a[0]+i[0]),en(a[1],a[1]+i[1]));else{var s=a.slice();r.zoomFixMM[0]||(s[0]=Ai(s[0],e.transformOut(e.transformIn(s[0],null)+i[0],null))),r.zoomFixMM[1]||(s[1]=en(s[1],e.transformOut(e.transformIn(s[1],null)+i[1],null))),(s[0]a[1])&&e.setExtent2(v8,s[0],s[1])}}}}function Mat(t,e){var r=Q_(t),n=r?t.intervalStub:t,i=e.fixMinMax||[],a=r?t.getExtent():null,s=n.getExtent(),o=cat(s,i,e.rawExtentResult);n.setExtent(o[0],o[1]),o=n.getExtent();var l=r?rLr(n,e):tLr(n,e),u=l.intervalPrecision,h=l.interval,d=e.userInterval;d!=null&&(l.interval=d,l.intervalPrecision=CT(d)),i[0]||(o[0]=Gn(Nf(o[0]/h)*h,u)),i[1]||(o[1]=Gn(MA(o[1]/h)*h,u)),d!=null&&(l.niceExtent=o.slice()),wat(t,i,s,o,a,l)}function tLr(t,e){var r=SW(e.splitNumber,5),n=wW(t),i=e.minInterval,a=e.maxInterval,s=JG(n/r,!0);i!=null&&sa&&(s=a);var o=CT(s),l=t.getExtent(),u=[Gn(MA(l[0]/s)*s,o),Gn(Nf(l[1]/s)*s,o)];return{interval:s,intervalPrecision:o,niceExtent:u}}function rLr(t,e){var r=SW(e.splitNumber,10),n=t.getExtent(),i=wW(t),a=en(ude(i),1),s=r/i*a;s<=.5&&(a*=10);var o=CT(a),l=[Gn(MA(n[0]/a)*a,o),Gn(Nf(n[1]/a)*a,o)];return{intervalPrecision:o,interval:a,niceExtent:l}}function X_(t){var e=t.scale,r=t.model,n=r.axis,i=r.ecModel;Iat(e,r,n,i,null)}function Iat(t,e,r,n,i){var a=Lat(t,e,n,r,i),s=AW(t)||b8(t);Pat(t,{splitNumber:e.get("splitNumber"),fixMinMax:a.fixMM,userInterval:e.get("interval"),minInterval:s?e.get("minInterval"):null,maxInterval:s?e.get("maxInterval"):null,rawExtentResult:a}),r&&n&&eLr(r,t,a,n)}function Pat(t,e){nLr[t.type](t,e)}var nLr={interval:Mat,log:Mat,time:kDr,ordinal:Xa};function iLr(t){return Dm(null,t)}var aLr={isDimensionStacked:py,enableDataStack:iat,getStackedDimension:Bpe};function sLr(t,e){var r=e;e instanceof yn||(r=new yn(e));var n=w8(r),i=G_(r,n,!1);return t[1]i&&(n=s,i=l)}if(n)return dLr(n.exterior);var u=this.getBoundingRect();return[u.x+u.width/2,u.y+u.height/2]},e.prototype.getBoundingRect=function(r){var n=this._rect;if(n&&!r)return n;var i=[1/0,1/0],a=[-1/0,-1/0],s=this.geometries;return de(s,function(o){o.type==="polygon"?Bat(o.exterior,i,a,r):de(o.points,function(l){Bat(l,i,a,r)})}),isFinite(i[0])&&isFinite(i[1])&&isFinite(a[0])&&isFinite(a[1])||(i[0]=i[1]=a[0]=a[1]=0),n=new fr(i[0],i[1],a[0]-i[0],a[1]-i[1]),r||(this._rect=n),n},e.prototype.contain=function(r){var n=this.getBoundingRect(),i=this.geometries;if(!n.contain(r[0],r[1]))return!1;e:for(var a=0,s=i.length;a>1^-(o&1),l=l>>1^-(l&1),o+=i,l+=a,i=o,a=l,n.push([o/r,l/r])}return n}function ege(t,e){return t=pLr(t),vt(ni(t.features,function(r){return r.geometry&&r.properties&&r.geometry.coordinates.length>0}),function(r){var n=r.properties,i=r.geometry,a=[];switch(i.type){case"Polygon":var s=i.coordinates;a.push(new Fat(s[0],s.slice(1)));break;case"MultiPolygon":de(i.coordinates,function(l){l[0]&&a.push(new Fat(l[0],l.slice(1)))});break;case"LineString":a.push(new zat([i.coordinates]));break;case"MultiLineString":a.push(new zat(i.coordinates))}var o=new Uat(n[e||"name"],a,n.cp);return o.properties=n,o})}const gLr=Object.freeze(Object.defineProperty({__proto__:null,MAX_SAFE_INTEGER:_N,asc:xl,getPercentWithPrecision:lEr,getPixelPrecision:oEr,getPrecision:vm,getPrecisionSafe:ret,isNumeric:dde,isRadianAroundZero:BA,linearMap:jn,nice:JG,numericToNumber:bm,parseDate:ym,parsePercent:Qt,quantile:eH,quantity:ude,quantityExponent:ZG,reformIntervals:hde,remRadian:cde,round:sEr},Symbol.toStringTag,{value:"Module"})),mLr=Object.freeze(Object.defineProperty({__proto__:null,format:KN,parse:ym,roundTime:FH},Symbol.toStringTag,{value:"Module"})),vLr=Object.freeze(Object.defineProperty({__proto__:null,Arc:VN,BezierCurve:p_,BoundingRect:fr,Circle:Em,CompoundPath:QN,Ellipse:FN,Group:pr,Image:Yo,IncrementalDisplayable:Ntt,Line:Ps,LinearGradient:tT,Polygon:ic,Polyline:Al,RadialGradient:rfe,Rect:tn,Ring:f_,Sector:nc,Text:Pn,clipPointsByRect:lfe,clipRectByRect:Htt,createIcon:x_,extendPath:Vtt,extendShape:Utt,getShapeClass:GN,getTransform:iT,initProps:ia,makeImage:sfe,makePath:y_,mergePath:Dd,registerShape:Uf,resizePath:ofe,updateProps:Hn},Symbol.toStringTag,{value:"Module"})),yLr=Object.freeze(Object.defineProperty({__proto__:null,addCommas:Lfe,capitalFirst:K5r,encodeHTML:Nc,formatTime:X5r,formatTpl:Nfe,getTextRect:j5r,getTooltipMarker:yrt,normalizeCssArray:C_,toCamelCase:Mfe,truncateText:HEr},Symbol.toStringTag,{value:"Module"})),bLr=Object.freeze(Object.defineProperty({__proto__:null,bind:Ht,clone:lr,curry:qr,defaults:mr,each:de,extend:ot,filter:ni,indexOf:Ir,inherits:che,isArray:ft,isFunction:ur,isObject:yr,isString:Nt,map:vt,merge:Vr,reduce:Rf},Symbol.toStringTag,{value:"Module"}));var xLr=Qr(),O8=Qr(),Xp={estimate:1,determine:2};function LW(t){return{out:{noPxChangeTryDetermine:[]},kind:t}}function wLr(t,e){var r=t.getLabelModel().get("customValues");if(r){var n=t.scale;return{labels:vt(Qat(r,n),function(i,a){return{formattedLabel:A8(t)(i,a),rawLabel:n.getLabel(i),tick:i}})}}return t.type==="category"?TLr(t,e):CLr(t)}function ALr(t,e,r){var n=t.scale,i=t.getTickModel().get("customValues");return i?{ticks:Qat(i,n)}:t.type==="category"?SLr(t,e):{ticks:n.getTicks(r)}}function Qat(t,e){var r=e.getExtent(),n=[];return de(t,function(i){i=e.parse(i),i>=r[0]&&i<=r[1]&&n.push(i)}),rH(n,LEr,null),xl(n),vt(n,function(i){return{value:i}})}function TLr(t,e){var r=t.getLabelModel(),n=Gat(t,r,e);return!r.get("show")||t.scale.isBlank()?{labels:[]}:n}function Gat(t,e,r){var n=kLr(t),i=Hpe(e),a=r.kind===Xp.estimate;if(!a){var s=Wat(n,i);if(s)return s}var o,l;ur(i)?o=MW(t,i,!1):(l=i==="auto"?ELr(t,r):i,o=MW(t,l,!1));var u={labels:o,labelCategoryInterval:l};return a?r.out.noPxChangeTryDetermine.push(function(){return tge(n,i,u),!0}):tge(n,i,u),u}function SLr(t,e){var r=OLr(t),n=Hpe(e),i=Wat(r,n);if(i)return i;var a,s;if((!e.get("show")||t.scale.isBlank())&&(a=[]),ur(n))a=MW(t,n,!0);else if(n==="auto"){var o=Gat(t,t.getLabelModel(),LW(Xp.determine));s=o.labelCategoryInterval,a=vt(o.labels,function(l){return l.tick})}else s=n,a=MW(t,s,!0);return tge(r,n,{ticks:a,tickCategoryInterval:s})}function CLr(t){var e=t.scale.getTicks(),r=A8(t);return{labels:vt(e,function(n,i){return{formattedLabel:r(n,i),rawLabel:t.scale.getLabel(n),tick:n}})}}var OLr=Hat("axisTick"),kLr=Hat("axisLabel");function Hat(t){return function(r){return O8(r)[t]||(O8(r)[t]={list:[]})}}function Wat(t,e){for(var r=0;rh&&(u=Math.max(1,Math.floor(l/h)));for(var d=o[0],f=t.dataToCoord(d+1)-t.dataToCoord(d),p=Math.abs(f*Math.cos(a)),g=Math.abs(f*Math.sin(a)),m=0,v=0;d<=o[1];d+=u){var y=0,b=0,x=VG(i({value:d}),n.font,"center","top");y=x.width*1.3,b=x.height*1.3,m=Math.max(m,y,7),v=Math.max(v,b,7)}var w=m/p,A=v/g;isNaN(w)&&(w=1/0),isNaN(A)&&(A=1/0);var T=Math.max(0,Math.floor(Math.min(w,A)));if(r===Xp.estimate)return e.out.noPxChangeTryDetermine.push(Ht(RLr,null,t,T,l)),T;var S=Yat(t,T,l);return S??T}function RLr(t,e,r){return Yat(t,e,r)==null}function Yat(t,e,r){var n=xLr(t.model),i=t.getExtent(),a=n.lastAutoInterval,s=n.lastTickCount;if(a!=null&&s!=null&&Math.abs(a-e)<=1&&Math.abs(s-r)<=1&&a>e&&n.axisExtent0===i[0]&&n.axisExtent1===i[1])return a;n.lastTickCount=r,n.lastAutoInterval=e,n.axisExtent0=i[0],n.axisExtent1=i[1]}function DLr(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function MW(t,e,r){var n=A8(t),i=t.scale,a=[],s=ur(e);return uat(i,s?0:e,function(o,l){var u=i.getLabel(o);if(s){var h=!!e(o.value,u);if(o.offInterval=!h,!h&&!l)return}a.push(r?o:{formattedLabel:n(o),rawLabel:u,tick:o})}),a}var LLr=.8;function sc(t,e){e=e||{};var r={w:NaN,w2:NaN},n=t.scale,i=e.fromStat,a=e.min,s=gDr(n);Bf(s)||(s=NaN);var o=t.getExtent(),l=Za(o[1]-o[0]);return Uc(n)?MLr(r,t,s,l):i&&ILr(r,t,s,l,i),a!=null&&(r.w=Bf(r.w)?en(a,r.w):a),r}function MLr(t,e,r,n){var i=e.onBand,a=r+(i?1:0);a===0&&(a=1),t.w=n/a,!i&&r&&n&&(t.w2=t.w*r/n)}function ILr(t,e,r,n,i){var a=!1,s=-1/0;de(i.key?[zDr(e,i.key)]:UDr(e,i.sers||[]),function(o){var l=o.liPosMinGap;l!=null&&(l>0?(l>s&&(s=l),a=!1):l===Aat&&(a=!0))}),Bf(r)&&r>0&&Bf(s)?(t.w=n/r*s,t.w2=s):a&&(t.w=n*LLr,t.w2=t.w*r/n)}var qat=[0,1],Wf=function(){function t(e,r,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=r,this._extent=n||[0,0]}return t.prototype.contain=function(e){var r=this._extent,n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return e>=n&&e<=i},t.prototype.containData=function(e){return this.scale.contain(this.scale.parse(e))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.setExtent=function(e,r){var n=this._extent;n[0]=e,n[1]=r},t.prototype.dataToCoord=function(e,r){var n=this.scale;return e=n.normalize(n.parse(e)),jn(e,qat,jat(this),r)},t.prototype.coordToData=function(e,r){var n=jn(e,jat(this),qat,r);return this.scale.scale(n)},t.prototype.pointToData=function(e,r){},t.prototype.getTicksCoords=function(e){e=e||{};var r=e.tickModel||this.getTickModel(),n=ALr(this,r,{breakTicks:e.breakTicks,pruneByBreak:e.pruneByBreak}),i=vt(n.ticks,function(o){return{coord:this.dataToCoord(W_(this.scale,o)),tick:o}},this),a=r.get("alignWithLabel"),s=PLr(this,i,a);return vt(i,function(o){return{coord:o.coord,tickValue:o.tick.value,onBand:s}})},t.prototype.getMinorTicksCoords=function(){if(Uc(this.scale))return[];var e=this.model.getModel("minorTick"),r=e.get("splitNumber");r>0&&r<100||(r=5);var n=this.scale.getMinorTicks(r),i=vt(n,function(a){return vt(a,function(s){return{coord:this.dataToCoord(s),tickValue:s}},this)},this);return i},t.prototype.getViewLabels=function(e){return e=e||LW(Xp.determine),wLr(this,e).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){return sc(this,{min:1}).w},t.prototype.calculateCategoryInterval=function(e){return e=e||LW(Xp.determine),_Lr(this,e)},t}();function jat(t){var e=t.getExtent();if(t.onBand){var r=e[1]-e[0],n=r/t.scale.count()/2;e[0]+=n,e[1]-=n}return e}function PLr(t,e,r){var n=e.length;if(!t.onBand||r||!n)return!1;var i=sc(t).w;if(!i)return!1;de(e,function(o){o.coord-=i/2});var a=t.scale.getExtent(),s=e[n-1];return s.tick.offInterval&&e.pop(),e.push({coord:s.coord+i,tick:{value:a[1]+1}}),!0}function NLr(t){var e=fn.extend(t);return fn.registerClass(e),e}function BLr(t){var e=Hi.extend(t);return Hi.registerClass(e),e}function $Lr(t){var e=Ri.extend(t);return Ri.registerClass(e),e}function FLr(t){var e=Ti.extend(t);return Ti.registerClass(e),e}var k8=Math.PI*2,RT=Cm.CMD,zLr=["top","right","bottom","left"];function ULr(t,e,r,n,i){var a=r.width,s=r.height;switch(t){case"top":n.set(r.x+a/2,r.y-e),i.set(0,-1);break;case"bottom":n.set(r.x+a/2,r.y+s+e),i.set(0,1);break;case"left":n.set(r.x-e,r.y+s/2),i.set(-1,0);break;case"right":n.set(r.x+a+e,r.y+s/2),i.set(1,0);break}}function VLr(t,e,r,n,i,a,s,o,l){s-=t,o-=e;var u=Math.sqrt(s*s+o*o);s/=u,o/=u;var h=s*r+t,d=o*r+e;if(Math.abs(n-i)%k8<1e-4)return l[0]=h,l[1]=d,u-r;if(a){var f=n;n=kd(i),i=kd(f)}else n=kd(n),i=kd(i);n>i&&(i+=k8);var p=Math.atan2(o,s);if(p<0&&(p+=k8),p>=n&&p<=i||p+k8>=n&&p+k8<=i)return l[0]=h,l[1]=d,u-r;var g=r*Math.cos(n)+t,m=r*Math.sin(n)+e,v=r*Math.cos(i)+t,y=r*Math.sin(i)+e,b=(g-s)*(g-s)+(m-o)*(m-o),x=(v-s)*(v-s)+(y-o)*(y-o);return b0){e=e/180*Math.PI,Zp.fromArray(t[0]),aa.fromArray(t[1]),Fs.fromArray(t[2]),wr.sub(Lm,Zp,aa),wr.sub(Mm,Fs,aa);var r=Lm.len(),n=Mm.len();if(!(r<.001||n<.001)){Lm.scale(1/r),Mm.scale(1/n);var i=Lm.dot(Mm),a=Math.cos(e);if(a1&&wr.copy(Su,Fs),Su.toArray(t[1])}}}}function HLr(t,e,r){if(r<=180&&r>0){r=r/180*Math.PI,Zp.fromArray(t[0]),aa.fromArray(t[1]),Fs.fromArray(t[2]),wr.sub(Lm,aa,Zp),wr.sub(Mm,Fs,aa);var n=Lm.len(),i=Mm.len();if(!(n<.001||i<.001)){Lm.scale(1/n),Mm.scale(1/i);var a=Lm.dot(e),s=Math.cos(r);if(a=l)wr.copy(Su,Fs);else{Su.scaleAndAdd(Mm,o/Math.tan(Math.PI/2-h));var d=Fs.x!==aa.x?(Su.x-aa.x)/(Fs.x-aa.x):(Su.y-aa.y)/(Fs.y-aa.y);if(isNaN(d))return;d<0?wr.copy(Su,aa):d>1&&wr.copy(Su,Fs)}Su.toArray(t[1])}}}}function rge(t,e,r,n){var i=r==="normal",a=i?t:t.ensureState(r);a.ignore=e;var s=n.get("smooth");s=s===!0?.3:Math.max(+s,0)||0,a.shape=a.shape||{},a.shape.smooth=s;var o=n.getModel("lineStyle").getLineStyle();i?t.useStyle(o):a.style=o}function WLr(t,e){var r=e.smooth,n=e.points;if(n)if(t.moveTo(n[0][0],n[0][1]),r>0&&n.length>=3){var i=qv(n[0],n[1]),a=qv(n[1],n[2]);if(!i||!a){t.lineTo(n[1][0],n[1][1]),t.lineTo(n[2][0],n[2][1]);return}var s=Math.min(i,a)*r,o=hN([],n[1],n[0],s/i),l=hN([],n[1],n[2],s/a),u=hN([],o,l,.5);t.bezierCurveTo(o[0],o[1],o[0],o[1],u[0],u[1]),t.bezierCurveTo(l[0],l[1],l[0],l[1],n[2][0],n[2][1])}else for(var h=1;h0){w(E*k,0,a);var _=E+S;_<0&&A(-_*k,1)}else A(-S*k,1)}}function w(S,O,k){S!==0&&(h=!0);for(var E=O;E0)for(var _=0;_0;_--){var D=k[_-1]*R;w(-D,_,a)}}}function T(S){var O=S<0?-1:1;S=Math.abs(S);for(var k=Math.ceil(S/(a-1)),E=0;E0?w(k,0,E+1):w(-k,a-E-1,a),S-=k,S<=0)return}return h}function jLr(t){for(var e=0;e=0&&n.attr(a.oldLayoutSelect),Ir(f,"emphasis")>=0&&n.attr(a.oldLayoutEmphasis)),Hn(n,u,r,l)}else if(n.attr(u),!w_(n).valueAnimation){var d=Jt(n.style.opacity,1);n.style.opacity=0,ia(n,{style:{opacity:d}},r,l)}if(a.oldLayout=u,n.states.select){var p=a.oldLayoutSelect={};FW(p,u,zW),FW(p,n.states.select,zW)}if(n.states.emphasis){var g=a.oldLayoutEmphasis={};FW(g,u,zW),FW(g,n.states.emphasis,zW)}rrt(n,l,h,r,r)}if(i&&!i.ignore&&!i.invisible){var a=ZLr(i),s=a.oldLayout,m={points:i.shape.points};s?(i.attr({shape:s}),Hn(i,{shape:m},r)):(i.setShape(m),i.style.strokePercent=0,ia(i,{style:{strokePercent:1}},r)),a.oldLayout=m}},t}(),uge=Qr();function eMr(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){var i=uge(r).labelManager;i||(i=uge(r).labelManager=new JLr),i.clearLabels()}),t.registerUpdateLifecycle("series:layoutlabels",function(e,r,n){var i=uge(r).labelManager;de(n.updatedSeries,function(a){i.addLabelsOfSeries(r.getViewOfSeriesModel(a))}),i.updateLayoutConfig(r),i.layout(r),i.processLabelsOverall()})}var hge=Math.sin,dge=Math.cos,sst=Math.PI,DT=Math.PI*2,tMr=180/sst,ost=function(){function t(){}return t.prototype.reset=function(e){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,e||4)},t.prototype.moveTo=function(e,r){this._add("M",e,r)},t.prototype.lineTo=function(e,r){this._add("L",e,r)},t.prototype.bezierCurveTo=function(e,r,n,i,a,s){this._add("C",e,r,n,i,a,s)},t.prototype.quadraticCurveTo=function(e,r,n,i){this._add("Q",e,r,n,i)},t.prototype.arc=function(e,r,n,i,a,s){this.ellipse(e,r,n,n,0,i,a,s)},t.prototype.ellipse=function(e,r,n,i,a,s,o,l){var u=o-s,h=!l,d=Math.abs(u),f=cx(d-DT)||(h?u>=DT:-u>=DT),p=u>0?u%DT:u%DT+DT,g=!1;f?g=!0:cx(d)?g=!1:g=p>=sst==!!h;var m=e+n*dge(s),v=r+i*hge(s);this._start&&this._add("M",m,v);var y=Math.round(a*tMr);if(f){var b=1/this._p,x=(h?1:-1)*(DT-b);this._add("A",n,i,y,1,+h,e+n*dge(s+x),r+i*hge(s+x)),b>.01&&this._add("A",n,i,y,0,+h,m,v)}else{var w=e+n*dge(o),A=r+i*hge(o);this._add("A",n,i,y,+g,+h,w,A)}},t.prototype.rect=function(e,r,n,i){this._add("M",e,r),this._add("l",n,0),this._add("l",0,i),this._add("l",-n,0),this._add("Z")},t.prototype.closePath=function(){this._d.length>0&&this._add("Z")},t.prototype._add=function(e,r,n,i,a,s,o,l,u){for(var h=[],d=this._p,f=1;f"}function uMr(t){return""}function gge(t,e){e=e||{};var r=e.newline?` +`];function no(t,e){return e.type=t,e}function tpe(t){return t.type==="section"}function knt(t){return tpe(t)?a3r:s3r}function Ent(t){if(tpe(t)){var e=0,r=t.blocks.length,n=r>1||r>0&&!t.noHeader;return de(t.blocks,function(i){var a=Ent(i);a>=e&&(e=a+ +(n&&(!a||tpe(i)&&!i.noHeader)))}),e}return 0}function a3r(t,e,r,n){var i=e.noHeader,a=o3r(Ent(e)),s=[],o=e.blocks||[];ec(!o||ft(o)),o=o||[];var l=t.orderMode;if(e.sortBlocks&&l){o=o.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(Kt(u,l)){var h=new pnt(u[l],null);o.sort(function(m,v){return h.evaluate(m.sortParam,v.sortParam)})}else l==="seriesDesc"&&o.reverse()}de(o,function(m,v){var y=e.valueFormatter,b=knt(m)(y?ot(ot({},t),{valueFormatter:y}):t,m,v>0?a.html:0,n);b!=null&&s.push(b)});var d=t.renderMode==="richText"?s.join(a.richText):rpe(n,s.join(""),i?r:a.html);if(i)return d;var f=Ife(e.header,"ordinal",t.useUTC),p=Ont(n,t.renderMode).nameStyle,g=Cnt(n);return t.renderMode==="richText"?Rnt(t,f,p)+a.richText+d:rpe(n,'
'+Nc(f)+"
"+d,r)}function s3r(t,e,r,n){var i=t.renderMode,a=e.noName,s=e.noValue,o=!e.markerType,l=e.name,u=t.useUTC,h=e.valueFormatter||t.valueFormatter||function(w){return w=ft(w)?w:[w],vt(w,function(A,S){return Ife(A,ft(p)?p[S]:p,u)})};if(!(a&&s)){var d=o?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||et.color.secondary,i),f=a?"":Ife(l,"ordinal",u),p=e.valueType,g=s?[]:h(e.value,e.rawDataIndex),m=!o||!a,v=!o&&a,y=Ont(n,i),b=y.nameStyle,x=y.valueStyle;return i==="richText"?(o?"":d)+(a?"":Rnt(t,f,b))+(s?"":u3r(t,g,m,v,x)):rpe(n,(o?"":d)+(a?"":l3r(f,!o,b))+(s?"":c3r(g,m,v,x)),r)}}function _nt(t,e,r,n,i,a){if(t){var s=knt(t),o={useUTC:i,renderMode:r,orderMode:n,markupStyleCreator:e,valueFormatter:t.valueFormatter};return s(o,t,0,a)}}function o3r(t){return{html:n3r[t],richText:i3r[t]}}function rpe(t,e,r){var n='
',i="margin: "+r+"px 0 0",a=Cnt(t);return'
'+e+n+"
"}function l3r(t,e,r){var n=e?"margin-left:2px":"";return''+Nc(t)+""}function c3r(t,e,r,n){var i=r?"10px":"20px",a=e?"float:right;margin-left:"+i:"";return t=ft(t)?t:[t],''+vt(t,function(s){return Nc(s)}).join("  ")+""}function Rnt(t,e,r){return t.markupStyleCreator.wrapRichTextStyle(e,r)}function u3r(t,e,r,n,i){var a=[i],s=n?10:20;return r&&a.push({padding:[0,0,0,s],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(ft(e)?e.join(" "):e,a)}function Dnt(t,e){var r=t.getData().getItemVisual(e,"style"),n=r[t.visualDrawType];return cS(n)}function Lnt(t,e){var r=t.get("padding");return r??(e==="richText"?[8,10]:10)}var npe=function(){function t(){this.richTextStyles={},this._nextStyleNameId=fde()}return t.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},t.prototype.makeTooltipMarker=function(e,r,n){var i=n==="richText"?this._generateStyleName():null,a=yrt({color:r,type:e,renderMode:n,markerId:i});return Nt(a)?a:(this.richTextStyles[i]=a.style,a.content)},t.prototype.wrapRichTextStyle=function(e,r){var n={};ft(r)?de(r,function(a){return ot(n,a)}):ot(n,r);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+e+"}"},t}();function Mnt(t){var e=t.series,r=t.dataIndex,n=t.multipleSeries,i=e.getData(),a=i.mapDimensionsAll("defaultedTooltip"),s=a.length,o=e.getRawValue(r),l=ft(o),u=Dnt(e,r),h,d,f,p;if(s>1||l&&!s){var g=h3r(o,e,r,a,u);h=g.inlineValues,d=g.inlineValueTypes,f=g.blocks,p=g.inlineValues[0]}else if(s){var m=i.getDimensionInfo(a[0]);p=h=__(i,r,a[0]),d=m.type}else p=h=l?o[0]:o;var v=pde(e),y=v&&e.name||"",b=i.getName(r),x=n?y:b;return no("section",{header:y,noHeader:n||!v,sortParam:p,blocks:[no("nameValue",{markerType:"item",markerColor:u,name:x,noName:!Sd(x),value:h,valueType:d,rawDataIndex:i.getRawIndex(r)})].concat(f||[])})}function h3r(t,e,r,n,i){var a=e.getData(),s=Rf(t,function(d,f,p){var g=a.getDimensionInfo(p);return d=d||g&&g.tooltip!==!1&&g.displayName!=null},!1),o=[],l=[],u=[];n.length?de(n,function(d){h(__(a,r,d),d)}):de(t,h);function h(d,f){var p=a.getDimensionInfo(f);!p||p.otherDims.tooltip===!1||(s?u.push(no("nameValue",{markerType:"subItem",markerColor:i,name:p.displayName,value:d,valueType:p.type})):(o.push(d),l.push(p.type)))}return{inlineValues:o,inlineValueTypes:l,blocks:u}}var Sx=Qr();function XH(t,e){return t.getName(e)||t.getId(e)}var KH="__universalTransitionEnabled",Ri=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._selectedDataIndicesMap={},r}return e.prototype.init=function(r,n,i){this.seriesIndex=this.componentIndex,this.dataTask=a8({count:f3r,reset:p3r}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,i);var a=Sx(this).sourceManager=new Ant(this);a.prepareSource();var s=this.getInitialData(r,i);Pnt(s,this),this.dataTask.context.data=s,Sx(this).dataBeforeProcessed=s,Int(this),this._initSelectedMapFromData(s)},e.prototype.mergeDefaultAndTheme=function(r,n){var i=e8(this),a=i?dS(r):{},s=this.subType;fn.hasClass(s)&&(s+="Series"),Vr(r,n.getTheme().get(this.subType)),Vr(r,this.getDefaultOption()),$A(r,"label",["show"]),this.fillDataTextStyle(r.data),i&&Rm(r,a,i)},e.prototype.mergeOption=function(r,n){r=Vr(this.option,r,!0),this.fillDataTextStyle(r.data);var i=e8(this);i&&Rm(this.option,r,i);var a=Sx(this).sourceManager;a.dirty(),a.prepareSource();var s=this.getInitialData(r,n);Pnt(s,this),this.dataTask.dirty(),this.dataTask.context.data=s,Sx(this).dataBeforeProcessed=s,Int(this),this._initSelectedMapFromData(s)},e.prototype.fillDataTextStyle=function(r){if(r&&!bu(r))for(var n=["show"],i=0;i=0&&f<0)&&(d=A,f=w,p=0),w===f&&(h[p++]=v))}return h.length=p,h},e.prototype.formatTooltip=function(r,n,i){return Mnt({series:this,dataIndex:r,multipleSeries:n})},e.prototype.isAnimationEnabled=function(){var r=this.ecModel;if(Rn.node&&!(r&&r.ssr))return!1;var n=this.getShallow("animation");return n&&this.getData().count()>this.getShallow("animationThreshold")&&(n=!1),!!n},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(r,n,i){var a=this.ecModel,s=Vfe.prototype.getColorFromPalette.call(this,r,n,i);return s||(s=a.getColorFromPalette(r,n,i)),s},e.prototype.coordDimToDataDim=function(r){return this.getRawData().mapDimensionsAll(r)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(r,n){this._innerSelect(this.getData(n),r)},e.prototype.unselect=function(r,n){var i=this.option.selectedMap;if(i){var a=this.option.selectedMode,s=this.getData(n);if(a==="series"||i==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var o=0;o=0&&i.push(s)}return i},e.prototype.isSelected=function(r,n){var i=this.option.selectedMap;if(!i)return!1;var a=this.getData(n);return(i==="all"||i[XH(a,r)])&&!a.getItemModel(r).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[KH])return!0;var r=this.option.universalTransition;return r?r===!0?!0:r&&r.enabled:!1},e.prototype._innerSelect=function(r,n){var i,a,s=this.option,o=s.selectedMode,l=n.length;if(!(!o||!l)){if(o==="series")s.selectedMap="all";else if(o==="multiple"){yr(s.selectedMap)||(s.selectedMap={});for(var u=s.selectedMap,h=0;h0&&this._innerSelect(r,n)}},e.registerClass=function(r){return fn.registerClass(r)},e.protoInitialize=function(){var r=e.prototype;r.type="series.__base__",r.seriesIndex=0,r.ignoreStyleOnData=!1,r.hasSymbolVisual=!1,r.defaultSymbol="circle",r.visualStyleAccessPath="itemStyle",r.visualDrawType="fill"}(),e}(fn);Is(Ri,qH),Is(Ri,Vfe),wet(Ri,fn);function Int(t){var e=t.name;pde(t)||(t.name=d3r(t)||e)}function d3r(t){var e=t.getRawData(),r=e.mapDimensionsAll("seriesName"),n=[];return de(r,function(i){var a=e.getDimensionInfo(i);a.displayName&&n.push(a.displayName)}),n.join(" ")}function f3r(t){return t.model.getRawData().count()}function p3r(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),g3r}function g3r(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Pnt(t,e){de(QE(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),function(r){t.wrapMethod(r,qr(m3r,e))})}function m3r(t,e){var r=ipe(t);return r&&r.setOutputEnd((e||this).count()),e}function ipe(t){var e=(t.ecModel||{}).scheduler,r=e&&e.getPipeline(t.uid);if(r){var n=r.currentTask;if(n){var i=n.agentStubMap;i&&(n=i.get(t.uid))}return n}}var Hi=function(){function t(){this.group=new pr,this.uid=lS("viewComponent")}return t.prototype.init=function(e,r){},t.prototype.render=function(e,r,n,i){},t.prototype.dispose=function(e,r){},t.prototype.updateView=function(e,r,n,i){},t.prototype.updateLayout=function(e,r,n,i){},t.prototype.updateVisual=function(e,r,n,i){},t.prototype.toggleBlurSeries=function(e,r,n){},t.prototype.eachRendered=function(e){var r=this.group;r&&r.traverse(e)},t}();xde(Hi),nH(Hi);function yS(){var t=Qr();return function(e){var r=t(e),n=e.pipelineContext,i=!!r.large,a=!!r.progressiveRender,s=r.large=!!(n&&n.large),o=r.progressiveRender=!!(n&&n.progressiveRender);return(i!==s||a!==o)&&"reset"}}var Nnt=Qr(),v3r=yS(),Si=function(){function t(){this.group=new pr,this.uid=lS("viewChart"),this.renderTask=a8({plan:y3r,reset:b3r}),this.renderTask.context={view:this}}return t.prototype.init=function(e,r){},t.prototype.render=function(e,r,n,i){},t.prototype.highlight=function(e,r,n,i){var a=e.getData(i&&i.dataType);a&&$nt(a,i,"emphasis")},t.prototype.downplay=function(e,r,n,i){var a=e.getData(i&&i.dataType);a&&$nt(a,i,"normal")},t.prototype.remove=function(e,r){this.group.removeAll()},t.prototype.dispose=function(e,r){},t.prototype.updateView=function(e,r,n,i){this.render(e,r,n,i)},t.prototype.updateVisual=function(e,r,n,i){this.render(e,r,n,i)},t.prototype.eachRendered=function(e){bx(this.group,e)},t.markUpdateMethod=function(e,r){Nnt(e).updateMethod=r},t.protoInitialize=function(){var e=t.prototype;e.type="chart"}(),t}();function Bnt(t,e,r){t&&BN(t)&&(e==="emphasis"?oy:ly)(t,r)}function $nt(t,e,r){var n=FA(t,e),i=e&&e.highlightKey!=null?G_r(e.highlightKey):null;n!=null?de(Qi(n),function(a){Bnt(t.getItemGraphicEl(a),r,i)}):t.eachItemGraphicEl(function(a){Bnt(a,r,i)})}xde(Si),nH(Si);function y3r(t){return v3r(t.model)}function b3r(t){var e=t.model,r=t.ecModel,n=t.api,i=t.payload,a=e.pipelineContext.progressiveRender,s=t.view,o=i&&Nnt(i).updateMethod,l=a?"incrementalPrepareRender":o&&s[o]?o:"render";return l!=="render"&&s[l](e,r,n,i),x3r[l]}var x3r={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}},ZH="\0__throttleOriginMethod",Fnt="\0__throttleRate",znt="\0__throttleType";function JH(t,e,r){var n,i=0,a=0,s=null,o,l,u,h;e=e||0;function d(){a=new Date().getTime(),s=null,t.apply(l,u||[])}var f=function(){for(var p=[],g=0;g=0?d():s=setTimeout(d,-o),i=n};return f.clear=function(){s&&(clearTimeout(s),s=null)},f.debounceNextCall=function(p){h=p},f}function D_(t,e,r,n){var i=t[e];if(i){var a=i[ZH]||i,s=i[znt],o=i[Fnt];if(o!==r||s!==n){if(r==null||!n)return t[e]=a;i=t[e]=JH(a,r,n==="debounce"),i[ZH]=a,i[znt]=n,i[Fnt]=r}return i}}function s8(t,e){var r=t[e];r&&r[ZH]&&(r.clear&&r.clear(),t[e]=r[ZH])}var Unt=Qr(),Vnt={itemStyle:VA(irt,!0),lineStyle:VA(nrt,!0)},w3r={lineStyle:"stroke",itemStyle:"fill"};function Qnt(t,e){var r=t.visualStyleMapper||Vnt[e];return r||(console.warn("Unknown style type '"+e+"'."),Vnt.itemStyle)}function Gnt(t,e){var r=t.visualDrawType||w3r[e];return r||(console.warn("Unknown style type '"+e+"'."),"fill")}var A3r={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var r=t.getData(),n=t.visualStyleAccessPath||"itemStyle",i=t.getModel(n),a=Qnt(t,n),s=a(i),o=i.getShallow("decal");o&&(r.setVisual("decal",o),o.dirty=!0);var l=Gnt(t,n),u=s[l],h=ur(u)?u:null,d=s.fill==="auto"||s.stroke==="auto";if(!s[l]||h||d){var f=t.getColorFromPalette(t.name,null,e.getSeriesCount());s[l]||(s[l]=f,r.setVisual("colorFromPalette",!0)),s.fill=s.fill==="auto"||ur(s.fill)?f:s.fill,s.stroke=s.stroke==="auto"||ur(s.stroke)?f:s.stroke}if(r.setVisual("style",s),r.setVisual("drawType",l),!e.isSeriesFiltered(t)&&h)return r.setVisual("colorFromPalette",!1),{dataEach:function(p,g){var m=t.getDataParams(g),v=ot({},s);v[l]=h(m),p.setItemVisual(g,"style",v)}}}},o8=new yn,S3r={createOnAllSeries:!0,reset:function(t,e){if(!t.ignoreStyleOnData){var r=t.getData(),n=t.visualStyleAccessPath||"itemStyle",i=Qnt(t,n),a=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(s,o){var l=s.getRawDataItem(o);if(l&&l[n]){o8.option=l[n];var u=i(o8),h=s.ensureUniqueItemVisual(o,"style");ot(h,u),o8.option.decal&&(s.setItemVisual(o,"decal",o8.option.decal),o8.option.decal.dirty=!0),a in u&&s.setItemVisual(o,"colorFromPalette",!1)}}:null}}}},T3r={performRawSeries:!0,overallReset:function(t){var e=Yt();t.eachSeries(function(r){if(!r.isColorBySeries()){var n=r.type+"-"+r.getColorBy();Unt(r).scope=e.get(n)||e.set(n,{})}}),t.eachSeries(function(r){if(!r.isColorBySeries()){var n=r.getRawData(),i={},a=r.getData(),s=Unt(r).scope,o=r.visualStyleAccessPath||"itemStyle",l=Gnt(r,o);a.each(function(u){var h=a.getRawIndex(u);i[h]=u}),n.each(function(u){var h=i[u],d=a.getItemVisual(h,"colorFromPalette");if(d){var f=a.ensureUniqueItemVisual(h,"style"),p=n.getName(u)||u+"",g=n.count();f[l]=r.getColorFromPalette(p,s,g)}})}})}},eW=Math.PI;function C3r(t,e){e=e||{},mr(e,{text:"loading",textColor:et.color.primary,fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255,255,255,0.8)",showSpinner:!0,color:et.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var r=new pr,n=new tn({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});r.add(n);var i=new Pn({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new tn({style:{fill:"none"},textContent:i,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});r.add(a);var s;return e.showSpinner&&(s=new VN({shape:{startAngle:-eW/2,endAngle:-eW/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001}),s.animateShape(!0).when(1e3,{endAngle:eW*3/2}).start("circularInOut"),s.animateShape(!0).when(1e3,{startAngle:eW*3/2}).delay(300).start("circularInOut"),r.add(s)),r.resize=function(){var o=i.getBoundingRect().width,l=e.showSpinner?e.spinnerRadius:0,u=(t.getWidth()-l*2-(e.showSpinner&&o?10:0)-o)/2-(e.showSpinner&&o?0:5+o/2)+(e.showSpinner?0:o/2)+(o?0:l),h=t.getHeight()/2;e.showSpinner&&s.setShape({cx:u,cy:h}),a.setShape({x:u-l,y:h-l,width:l*2,height:l*2}),n.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},r.resize(),r}var Hnt=function(){function t(e,r,n,i){this._stageTaskMap=Yt(),this.ecInstance=e,this.api=r,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return t.prototype.restoreData=function(e,r){e.restoreData(r),this._stageTaskMap.each(function(n){var i=n.overallTask;i&&i.dirty()})},t.prototype.getPerformArgs=function(e,r){if(e.__pipeline){var n=this._pipelineMap.get(e.__pipeline.id),i=n.context,a=!r&&n.progressiveEnabled&&(!i||i.progressiveRender)&&e.__idxInPipeline>n.blockIndex,s=a?n.step:null,o=i&&i.modDataCount,l=o!=null?Math.ceil(o/s):null;return{step:s,modBy:l,modDataCount:o}}},t.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},t.prototype.updateStreamModes=function(e,r){var n=this._pipelineMap.get(e.uid),i=e.__preparePipelineContext?e.__preparePipelineContext(r,n):bet(e,r,n);e.pipelineContext=n.context=i},t.prototype.restorePipelines=function(e,r){var n=this,i=n._pipelineMap=Yt();r.eachSeries(function(a){var s=e.painter.type==="canvas"&&a.getProgressive(),o=a.uid;i.set(o,{id:o,head:null,tail:null,threshold:a.getProgressiveThreshold(),progressiveEnabled:s&&!(a.preventIncremental&&a.preventIncremental()),blockIndex:-1,step:Math.round(s||700),count:0}),n._pipe(a,a.dataTask)})},t.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,r=this.api.getModel(),n=this.api;de(this._allHandlers,function(i){var a=e.get(i.uid)||e.set(i.uid,{}),s="";ec(!(i.reset&&i.overallReset),s),i.reset&&this._createSeriesStageTask(i,a,r,n),i.overallReset&&this._createOverallStageTask(i,a,r,n)},this)},t.prototype.prepareView=function(e,r,n,i){var a=e.renderTask,s=a.context;s.model=r,s.ecModel=n,s.api=i,a.__block=!e.incrementalPrepareRender,this._pipe(r,a)},t.prototype.performDataProcessorTasks=function(e,r){this._performStageTasks(this._dataProcessorHandlers,e,r,{block:!0})},t.prototype.performVisualTasks=function(e,r,n){this._performStageTasks(this._visualHandlers,e,r,n)},t.prototype._performStageTasks=function(e,r,n,i){i=i||{};var a=!1,s=this;de(e,function(l,u){if(!(i.visualType&&i.visualType!==l.visualType)){var h=s._stageTaskMap.get(l.uid),d=h.seriesTaskMap,f=h.overallTask;if(f){var p,g=f.agentStubMap;g.each(function(v){o(i,v)&&(v.dirty(),p=!0)}),p&&f.dirty(),s.updatePayload(f,n);var m=s.getPerformArgs(f,i.block);g.each(function(v){v.perform(m)}),f.perform(m)&&(a=!0)}else d&&d.each(function(v,y){o(i,v)&&v.dirty();var b=s.getPerformArgs(v,i.block);b.skip=!l.performRawSeries&&r.isSeriesFiltered(v.context.model),s.updatePayload(v,n),v.perform(b)&&(a=!0)})}});function o(l,u){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(u.__pipeline.id))}this.unfinished=a||this.unfinished},t.prototype.performSeriesTasks=function(e){var r;e.eachSeries(function(n){r=n.dataTask.perform()||r}),this.unfinished=r||this.unfinished},t.prototype.plan=function(){this._pipelineMap.each(function(e){var r=e.tail;do{if(r.__block){e.blockIndex=r.__idxInPipeline;break}r=r.getUpstream()}while(r)})},t.prototype.updatePayload=function(e,r){r!=="remain"&&(e.context.payload=r)},t.prototype._createSeriesStageTask=function(e,r,n,i){var a=this,s=r.seriesTaskMap,o=r.seriesTaskMap=Yt(),l=e.seriesType,u=e.getTargetSeries;e.createOnAllSeries?n.eachRawSeries(h):l?n.eachRawSeriesByType(l,h):u&&u(n,i).each(h);function h(d){var f=d.uid,p=o.set(f,s&&s.get(f)||a8({plan:R3r,reset:D3r,count:M3r}));p.context={model:d,ecModel:n,api:i,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:a},a._pipe(d,p)}},t.prototype._createOverallStageTask=function(e,r,n,i){var a=this,s=r.overallTask=r.overallTask||a8({reset:O3r});s.context={ecModel:n,api:i,overallReset:e.overallReset,scheduler:a};var o=s.agentStubMap,l=s.agentStubMap=Yt(),u=e.seriesType,h=e.getTargetSeries,d=e.dirtyOnOverallProgress,f=!1,p="";ec(!e.createOnAllSeries,p),u?n.eachRawSeriesByType(u,g):h?h(n,i).each(g):de(n.getSeries(),g);function g(m){var v=m.uid,y=l.set(v,o&&o.get(v)||(f=!0,a8({reset:k3r,onDirty:_3r})));y.context={model:m,dirtyOnOverallProgress:d},y.agent=s,y.__block=d,a._pipe(m,y)}f&&s.dirty()},t.prototype._pipe=function(e,r){var n=e.uid,i=this._pipelineMap.get(n);!i.head&&(i.head=r),i.tail&&i.tail.pipe(r),i.tail=r,r.__idxInPipeline=i.count++,r.__pipeline=i},t.wrapStageHandler=function(e,r){return ur(e)&&(e={overallReset:e,seriesType:I3r(e)}),e.uid=lS("stageHandler"),r&&(e.visualType=r),e},t}();function O3r(t){t.overallReset(t.ecModel,t.api,t.payload)}function k3r(t){return t.dirtyOnOverallProgress&&E3r}function E3r(){this.agent.dirty(),this.getDownstream().dirty()}function _3r(){this.agent&&this.agent.dirty()}function R3r(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function D3r(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=Qi(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?vt(e,function(r,n){return Wnt(n)}):L3r}var L3r=Wnt(0);function Wnt(t){return function(e,r){var n=r.data,i=r.resetDefines[t];if(i&&i.dataEach)for(var a=e.start;a0&&p===u.length-f.length){var g=u.slice(0,p);g!=="data"&&(r.mainType=g,r[f.toLowerCase()]=l,h=!0)}}o.hasOwnProperty(u)&&(n[u]=l,h=!0),h||(i[u]=l)})}return{cptQuery:r,dataQuery:n,otherQuery:i}},t.prototype.filter=function(e,r){var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,a=n.packedEvent,s=n.model,o=n.view;if(!s||!o)return!0;var l=r.cptQuery,u=r.dataQuery;return h(l,s,"mainType")&&h(l,s,"subType")&&h(l,s,"index","componentIndex")&&h(l,s,"name")&&h(l,s,"id")&&h(u,a,"name")&&h(u,a,"dataIndex")&&h(u,a,"dataType")&&(!o.filterForExposedEvent||o.filterForExposedEvent(e,r.otherQuery,i,a));function h(d,f,p,g){return d[p]==null||f[g||p]===d[p]}},t.prototype.afterTrigger=function(){this.eventInfo=null},t}(),ape=["symbol","symbolSize","symbolRotate","symbolOffset"],Znt=ape.concat(["symbolKeepAspect"]),N3r={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var r=t.getData();if(t.legendIcon&&r.setVisual("legendIcon",t.legendIcon),!t.hasSymbolVisual)return;for(var n={},i={},a=!1,s=0;s=0&&wS(l)?l:.5;var u=t.createRadialGradient(s,o,0,s,o,l);return u}function ope(t,e,r){for(var n=e.type==="radial"?tRr(t,e,r):eRr(t,e,r),i=e.colorStops,a=0;a0)?null:t==="dashed"?[4*e,2*e]:t==="dotted"?[e]:zn(t)?[t]:ft(t)?t:null}function lpe(t){var e=t.style,r=e.lineDash&&e.lineWidth>0&&nRr(e.lineDash,e.lineWidth),n=e.lineDashOffset;if(r){var i=e.strokeNoScale&&t.getLineScale?t.getLineScale():1;i&&i!==1&&(r=vt(r,function(a){return a/i}),n/=i)}return[r,n]}var iRr=new Cm(!0);function aW(t){var e=t.stroke;return!(e==null||e==="none"||!(t.lineWidth>0))}function sit(t){return typeof t=="string"&&t!=="none"}function sW(t){var e=t.fill;return e!=null&&e!=="none"}function oit(t,e){if(e.fillOpacity!=null&&e.fillOpacity!==1){var r=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=r}else t.fill()}function lit(t,e){if(e.strokeOpacity!=null&&e.strokeOpacity!==1){var r=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=r}else t.stroke()}function cpe(t,e,r){var n=Ade(e.image,e.__image,r);if(iH(n)){var i=t.createPattern(n,e.repeat||"repeat");if(typeof DOMMatrix=="function"&&i&&i.setTransform){var a=new DOMMatrix;a.translateSelf(e.x||0,e.y||0),a.rotateSelf(0,0,(e.rotation||0)*lN),a.scaleSelf(e.scaleX||1,e.scaleY||1),i.setTransform(a)}return i}}function aRr(t,e,r,n,i){var a,s=aW(r),o=sW(r),l=r.strokePercent,u=l<1,h=!e.path;(!e.silent||u)&&h&&e.createPathProxy();var d=e.path||iRr,f=e.__dirty;if(!n){var p=r.fill,g=r.stroke,m=o&&!!p.colorStops,v=s&&!!g.colorStops,y=o&&!!p.image,b=s&&!!g.image,x=void 0,w=void 0,A=void 0,S=void 0,T=void 0;(m||v)&&(T=e.getBoundingRect()),m&&(x=f?ope(t,p,T):e.__canvasFillGradient,e.__canvasFillGradient=x),v&&(w=f?ope(t,g,T):e.__canvasStrokeGradient,e.__canvasStrokeGradient=w),y&&(A=f||!e.__canvasFillPattern?cpe(t,p,e):e.__canvasFillPattern,e.__canvasFillPattern=A),b&&(S=f||!e.__canvasStrokePattern?cpe(t,g,e):e.__canvasStrokePattern,e.__canvasStrokePattern=S),m?t.fillStyle=x:y&&(A?t.fillStyle=A:o=!1),v?t.strokeStyle=w:b&&(S?t.strokeStyle=S:s=!1)}var O=e.getGlobalScale();d.setScale(O[0],O[1],e.segmentIgnoreThreshold);var k,E;t.setLineDash&&r.lineDash&&(a=lpe(e),k=a[0],E=a[1]);var _=!0;(h||f&YE)&&(d.setDPR(t.dpr),u?d.setContext(null):(d.setContext(t),_=!1),d.reset(),e.buildPath(d,e.shape,n),d.toStatic(),e.pathUpdated()),_&&d.rebuildPath(t,u?l:1),k&&(t.setLineDash(k),t.lineDashOffset=E),n?(i.batchFill=o,i.batchStroke=s):r.strokeFirst?(s&&lit(t,r),o&&oit(t,r)):(o&&oit(t,r),s&&lit(t,r)),k&&t.setLineDash([])}function sRr(t,e,r){var n=e.__image=Ade(r.image,e.__image,e,e.onload);if(!(!n||!iH(n))){var i=r.x||0,a=r.y||0,s=e.getWidth(),o=e.getHeight(),l=n.width/n.height;if(s==null&&o!=null?s=o*l:o==null&&s!=null?o=s/l:s==null&&o==null&&(s=n.width,o=n.height),r.sWidth&&r.sHeight){var u=r.sx||0,h=r.sy||0;t.drawImage(n,u,h,r.sWidth,r.sHeight,i,a,s,o)}else if(r.sx&&r.sy){var u=r.sx,h=r.sy,d=s-u,f=o-h;t.drawImage(n,u,h,d,f,i,a,s,o)}else t.drawImage(n,i,a,s,o)}}function oRr(t,e,r){var n,i=r.text;if(i!=null&&(i+=""),i){t.font=r.font||Hv,t.textAlign=r.textAlign,t.textBaseline=r.textBaseline;var a=void 0,s=void 0;t.setLineDash&&r.lineDash&&(n=lpe(e),a=n[0],s=n[1]),a&&(t.setLineDash(a),t.lineDashOffset=s),r.strokeFirst?(aW(r)&&t.strokeText(i,r.x,r.y),sW(r)&&t.fillText(i,r.x,r.y)):(sW(r)&&t.fillText(i,r.x,r.y),aW(r)&&t.strokeText(i,r.x,r.y)),a&&t.setLineDash([])}}var cit=["shadowBlur","shadowOffsetX","shadowOffsetY"],uit=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function hit(t,e,r,n,i){var a=!1;if(!n&&(r=r||{},e===r))return!1;if(n||e.opacity!==r.opacity){Su(t,i),a=!0;var s=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(s)?QA.opacity:s}(n||e.blend!==r.blend)&&(a||(Su(t,i),a=!0),t.globalCompositeOperation=e.blend||QA.blend);for(var o=0;o0&&r.unfinished);r.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.isSSR=function(){return this._ssr},e.prototype.setOption=function(r,n,i){if(!this[Oo]){if(this._disposed){this.id;return}var a,s,o;if(yr(n)&&(i=n.lazyUpdate,a=n.silent,s=n.replaceMerge,o=n.transition,n=n.notMerge),this[Oo]=!0,z_(this),!this._model||n){var l=new v4r(this._api),u=this._theme,h=this._model=new Gfe;h.scheduler=this._scheduler,h.ssr=this._ssr,h.init(null,null,null,u,this._locale,l)}this._model.setOption(r,{replaceMerge:s},Spe);var d={seriesTransition:o,optionChanged:!0};if(i)this[Tl]={silent:a,updateParams:d},this[Oo]=!1,this.getZr().wakeUp();else{try{SS(this),dy.update.call(this,null,d)}catch(f){throw this[Tl]=null,this[Oo]=!1,f}this._ssr||this._zr.flush(),this[Tl]=null,this[Oo]=!1,$_.call(this,a),F_.call(this,a)}}},e.prototype.setTheme=function(r,n){if(!this[Oo]){if(this._disposed){this.id;return}var i=this._model;if(i){var a=n&&n.silent,s=null;this[Tl]&&(a==null&&(a=this[Tl].silent),s=this[Tl].updateParams,this[Tl]=null),this[Oo]=!0,z_(this);try{this._updateTheme(r),i.setTheme(this._theme),SS(this),dy.update.call(this,{type:"setTheme"},s)}catch(o){throw this[Oo]=!1,o}this[Oo]=!1,$_.call(this,a),F_.call(this,a)}}},e.prototype._updateTheme=function(r){Nt(r)&&(r=Uit[r]),r&&(r=lr(r),r&&Krt(r,!0),this._theme=r)},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||Rn.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(r){return this.renderToCanvas(r)},e.prototype.renderToCanvas=function(r){r=r||{};var n=this._zr.painter;return n.getRenderedCanvas({backgroundColor:r.backgroundColor||this._model.get("backgroundColor"),pixelRatio:r.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(r){r=r||{};var n=this._zr.painter;return n.renderToString({useViewBox:r.useViewBox})},e.prototype.getSvgDataURL=function(){var r=this._zr,n=r.storage.getDisplayList();return de(n,function(i){i.stopAnimation(null,!0)}),r.painter.toDataURL()},e.prototype.getDataURL=function(r){if(this._disposed){this.id;return}r=r||{};var n=r.excludeComponents,i=this._model,a=[],s=this;de(n,function(l){i.eachComponent({mainType:l},function(u){var h=s._componentsMap[u.__viewId];h.group.ignore||(a.push(h),h.group.ignore=!0)})});var o=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(r).toDataURL("image/"+(r&&r.type||"png"));return de(a,function(l){l.group.ignore=!1}),o},e.prototype.getConnectedDataURL=function(r){if(this._disposed){this.id;return}var n=r.type==="svg",i=this.group,a=Math.min,s=Math.max,o=1/0;if(gW[i]){var l=o,u=o,h=-o,d=-o,f=[],p=r&&r.pixelRatio||this.getDevicePixelRatio();de(TS,function(x,w){if(x.group===i){var A=n?x.getZr().painter.getSvgDom().innerHTML:x.renderToCanvas(lr(r)),S=x.getDom().getBoundingClientRect();l=a(S.left,l),u=a(S.top,u),h=s(S.right,h),d=s(S.bottom,d),f.push({dom:A,left:S.left,top:S.top})}}),l*=p,u*=p,h*=p,d*=p;var g=h-l,m=d-u,v=Ho.createCanvas(),y=sde(v,{renderer:n?"svg":"canvas"});if(y.resize({width:g,height:m}),n){var b="";return de(f,function(x){var w=x.left-l,A=x.top-u;b+=''+x.dom+""}),y.painter.getSvgRoot().innerHTML=b,r.connectedBackgroundColor&&y.painter.setBackgroundColor(r.connectedBackgroundColor),y.refreshImmediately(),y.painter.toDataURL()}else return r.connectedBackgroundColor&&y.add(new tn({shape:{x:0,y:0,width:g,height:m},style:{fill:r.connectedBackgroundColor}})),de(f,function(x){var w=new Yo({style:{x:x.left*p-l,y:x.top*p-u,image:x.dom}});y.add(w)}),y.refreshImmediately(),v.toDataURL("image/"+(r&&r.type||"png"))}else return this.getDataURL(r)},e.prototype.convertToPixel=function(r,n,i){return uW(this,"convertToPixel",r,n,i)},e.prototype.convertToLayout=function(r,n,i){return uW(this,"convertToLayout",r,n,i)},e.prototype.convertFromPixel=function(r,n,i){return uW(this,"convertFromPixel",r,n,i)},e.prototype.containPixel=function(r,n){if(this._disposed){this.id;return}var i=this._model,a,s=n_(i,r);return de(s,function(o,l){l.indexOf("Models")>=0&&de(o,function(u){var h=u.coordinateSystem;if(h&&h.containPoint)a=a||!!h.containPoint(n);else if(l==="seriesModels"){var d=this._chartsMap[u.__viewId];d&&d.containPoint&&(a=a||d.containPoint(n,u))}},this)},this),!!a},e.prototype.getVisual=function(r,n){var i=this._model,a=n_(i,r,{defaultMainType:"series"}),s=a.seriesModel,o=s.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?o.indexOfRawIndex(a.dataIndex):null;return l!=null?spe(o,l,n):u8(o,n)},e.prototype.getViewOfComponentModel=function(r){return this._componentsMap[r.__viewId]},e.prototype.getViewOfSeriesModel=function(r){return this._chartsMap[r.__viewId]},e.prototype._initEvents=function(){var r=this;de(LRr,function(i){var a=function(s){var o=r.getModel(),l=s.target,u,h=i==="globalout";if(h?u={}:l&&bS(l,function(m){var v=Cr(m);if(v&&v.dataIndex!=null){var y=v.dataModel||o.getSeriesByIndex(v.seriesIndex);return u=y&&y.getDataParams(v.dataIndex,v.dataType,l)||{},!0}else if(v.eventData)return u=ot({},v.eventData),!0},!0),u){var d=u.componentType,f=u.componentIndex;(d==="markLine"||d==="markPoint"||d==="markArea")&&(d="series",f=u.seriesIndex);var p=d&&f!=null&&o.getComponent(d,f),g=p&&r[p.mainType==="series"?"_chartsMap":"_componentsMap"][p.__viewId];u.event=s,u.type=i,r._$eventProcessor.eventInfo={targetEl:l,packedEvent:u,model:p,view:g},r.trigger(i,u)}};a.zrEventfulCallAtLast=!0,r._zr.on(i,a,r)});var n=this._messageCenter;de(wpe,function(i,a){n.on(a,function(s){r.trigger(a,s)})}),$3r(n,this,this._api)},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0;var r=this.getDom();r&&get(this.getDom(),Cpe,"");var n=this,i=n._api,a=n._model;de(n._componentsViews,function(s){s.dispose(a,i)}),de(n._chartsViews,function(s){s.dispose(a,i)}),n._zr.dispose(),n._dom=n._model=n._chartsMap=n._componentsMap=n._chartsViews=n._componentsViews=n._scheduler=n._api=n._zr=n._throttledZrFlush=n._theme=n._coordSysMgr=n._messageCenter=null,delete TS[n.id]},e.prototype.resize=function(r){if(!this[Oo]){if(this._disposed){this.id;return}this._zr.resize(r);var n=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!n){var i=n.resetOption("media"),a=r&&r.silent;this[Tl]&&(a==null&&(a=this[Tl].silent),i=!0,this[Tl]=null),this[Oo]=!0,z_(this);try{i&&SS(this),dy.update.call(this,{type:"resize",animation:ot({duration:0},r&&r.animation)})}catch(s){throw this[Oo]=!1,s}this[Oo]=!1,$_.call(this,a),F_.call(this,a)}}},e.prototype.showLoading=function(r,n){if(this._disposed){this.id;return}if(yr(r)&&(n=r,r=""),r=r||"default",this.hideLoading(),!!Tpe[r]){var i=Tpe[r](this._api,n),a=this._zr;this._loadingFX=i,a.add(i)}},e.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},e.prototype.makeActionFromEvent=function(r){var n=ot({},r);return n.type=xpe[r.type],n},e.prototype.dispatchAction=function(r,n){if(this._disposed){this.id;return}if(yr(n)||(n={silent:!!n}),!!fW[r.type]&&this._model){if(this[Oo]){this._pendingActions.push(r);return}var i=n.silent;vpe.call(this,r,i);var a=n.flush;a?this._zr.flush():a!==!1&&Rn.browser.weChat&&this._throttledZrFlush(),$_.call(this,i),F_.call(this,i)}},e.prototype.updateLabelLayout=function(){Gf.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(r){if(this._disposed){this.id;return}var n=r.seriesIndex,i=this.getModel(),a=i.getSeriesByIndex(n);a.appendData(r),this._scheduler.unfinished=!0,this.getZr().wakeUp()},e.internalField=function(){SS=function(d){U3r(d._model);var f=d._scheduler;f.restorePipelines(d._zr,d._model),f.prepareStageTasks(),gpe(d,!0),gpe(d,!1),f.plan()},gpe=function(d,f){for(var p=d._model,g=d._scheduler,m=f?d._componentsViews:d._chartsViews,v=f?d._componentsMap:d._chartsMap,y=d._zr,b=d._api,x=0;xJt(f.get("hoverLayerThreshold"),Mrt.hoverLayerThreshold)&&!Rn.node&&!Rn.worker;(d._usingTHL||v)&&(f.eachSeries(function(y){if(!y.preventUsingHoverLayer){var b=d._chartsMap[y.__viewId];b.__alive&&b.eachRendered(function(x){var w=x.states.emphasis;w&&w.hoverLayer!==v_&&(w.hoverLayer=v?ztt:Ftt)})}}),d._usingTHL=v)}}function o(d,f){var p=d.get("blendMode")||null;f.eachRendered(function(g){g.isGroup||(g.style.blend=p)})}function l(d,f){if(!d.preventAutoZ){var p=sS(d);f.eachRendered(function(g){return _H(g,p.z,p.zlevel),!0})}}function u(d,f){f.eachRendered(function(p){if(!m_(p)){var g=p.getTextContent(),m=p.getTextGuideLine();p.stateTransition&&(p.stateTransition=null),g&&g.stateTransition&&(g.stateTransition=null),m&&m.stateTransition&&(m.stateTransition=null),p.hasState()?(p.prevStates=p.currentStates,p.clearStates()):p.prevStates&&(p.prevStates=null)}})}function h(d,f){var p=d.getModel("stateAnimation"),g=d.isAnimationEnabled(),m=p.get("duration"),v=m>0?{duration:m,delay:p.get("delay"),easing:p.get("easing")}:null;f.eachRendered(function(y){if(y.states&&y.states.emphasis){if(m_(y))return;if(y instanceof vn&&H_r(y),y.__dirty){var b=y.prevStates;b&&y.useStates(b)}if(g){y.stateTransition=v;var x=y.getTextContent(),w=y.getTextGuideLine();x&&(x.stateTransition=v),w&&(w.stateTransition=v)}y.__dirty&&a(y)}})}$it=function(d){return new(function(f){rt(p,f);function p(){return f!==null&&f.apply(this,arguments)||this}return p.prototype.getCoordinateSystems=function(){return d._coordSysMgr.getCoordinateSystems()},p.prototype.getComponentByElement=function(g){for(;g;){var m=g.__ecComponentInfo;if(m!=null)return d._model.getComponent(m.mainType,m.index);g=g.parent}},p.prototype.enterEmphasis=function(g,m){oy(g,m),Hf(d)},p.prototype.leaveEmphasis=function(g,m){ly(g,m),Hf(d)},p.prototype.enterBlur=function(g){dtt(g),Hf(d)},p.prototype.leaveBlur=function(g){Wde(g),Hf(d)},p.prototype.enterSelect=function(g){ftt(g),Hf(d)},p.prototype.leaveSelect=function(g){ptt(g),Hf(d)},p.prototype.getModel=function(){return d.getModel()},p.prototype.getViewOfComponentModel=function(g){return d.getViewOfComponentModel(g)},p.prototype.getViewOfSeriesModel=function(g){return d.getViewOfSeriesModel(g)},p.prototype.getECUpdateCycleVersion=function(){return d[lW]},p.prototype.usingTHL=function(){return d._usingTHL},p}(ttt))(d)},Fit=function(d){function f(p,g){for(var m=0;m=0)){Yit.push(r);var s=Hnt.wrapStageHandler(r,i);s.__prio=e,s.__raw=r,t.push(s)}}function Dpe(t,e){Tpe[t]=e}function VRr(t){BZe({createCanvas:t})}function qit(t,e,r){var n=rit("registerMap");n&&n(t,e,r)}function QRr(t){var e=rit("getMap");return e&&e(t)}var jit=X4r;Tx(dpe,A3r),Tx(oW,S3r),Tx(oW,T3r),Tx(dpe,N3r),Tx(oW,B3r),Tx(Oit,gRr),Epe(Krt),_pe(wRr,_4r),Dpe("default",C3r),qp({type:KA,event:KA,update:KA},Xa),qp({type:pH,event:pH,update:pH},Xa),qp({type:gH,event:Qde,update:gH,action:Xa,refineEvent:Lpe,publishNonRefinedEvent:!0}),qp({type:Vde,event:Qde,update:Vde,action:Xa,refineEvent:Lpe,publishNonRefinedEvent:!0}),qp({type:mH,event:Qde,update:mH,action:Xa,refineEvent:Lpe,publishNonRefinedEvent:!0});function Lpe(t,e,r,n){return{eventContent:{selected:z_r(r),isFromClick:e.isFromClick||!1}}}kpe("default",{}),kpe("dark",Knt);var GRr={},Xit=[],HRr={registerPreprocessor:Epe,registerProcessor:_pe,registerPostInit:Qit,registerPostUpdate:Git,registerUpdateLifecycle:mW,registerAction:qp,registerCoordinateSystem:Hit,registerLayout:Wit,registerVisual:Tx,registerTransform:jit,registerLoading:Dpe,registerMap:qit,registerImpl:F3r,PRIORITY:kit,ComponentModel:fn,ComponentView:Hi,SeriesModel:Ri,ChartView:Si,registerComponentModel:function(t){fn.registerClass(t)},registerComponentView:function(t){Hi.registerClass(t)},registerSeriesModel:function(t){Ri.registerClass(t)},registerChartView:function(t){Si.registerClass(t)},registerCustomSeries:function(t,e){iit(t,e)},registerSubTypeDefaulter:function(t,e){fn.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){KJe(t,e)}};function Yr(t){if(ft(t)){de(t,function(e){Yr(e)});return}Ir(Xit,t)>=0||(Xit.push(t),ur(t)&&(t={install:t}),t.install(HRr))}function h8(t){return t==null?0:t.length||1}function Kit(t){return t}var fy=function(){function t(e,r,n,i,a,s){this._old=e,this._new=r,this._oldKeyGetter=n||Kit,this._newKeyGetter=i||Kit,this.context=a,this._diffModeMultiple=s==="multiple"}return t.prototype.add=function(e){return this._add=e,this},t.prototype.update=function(e){return this._update=e,this},t.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},t.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},t.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},t.prototype.remove=function(e){return this._remove=e,this},t.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},t.prototype._executeOneToOne=function(){var e=this._old,r=this._new,n={},i=new Array(e.length),a=new Array(r.length);this._initIndexMap(e,null,i,"_oldKeyGetter"),this._initIndexMap(r,n,a,"_newKeyGetter");for(var s=0;s1){var h=l.shift();l.length===1&&(n[o]=l[0]),this._update&&this._update(h,s)}else u===1?(n[o]=null,this._update&&this._update(l,s)):this._remove&&this._remove(s)}this._performRestAdd(a,n)},t.prototype._executeMultiple=function(){var e=this._old,r=this._new,n={},i={},a=[],s=[];this._initIndexMap(e,n,a,"_oldKeyGetter"),this._initIndexMap(r,i,s,"_newKeyGetter");for(var o=0;o1&&f===1)this._updateManyToOne&&this._updateManyToOne(h,u),i[l]=null;else if(d===1&&f>1)this._updateOneToMany&&this._updateOneToMany(h,u),i[l]=null;else if(d===1&&f===1)this._update&&this._update(h,u),i[l]=null;else if(d>1&&f>1)this._updateManyToMany&&this._updateManyToMany(h,u),i[l]=null;else if(d>1)for(var p=0;p1)for(var o=0;o30}var d8=yr,Cx=vt,KRr=typeof Int32Array>"u"?Array:Int32Array,ZRr="e\0\0",rat=-1,JRr=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],eDr=["_approximateExtent"],nat,bW,f8,p8,Ppe,g8,Npe,zc=function(){function t(e,r){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","minmaxDownSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","minmaxDownSample","lttbDownSample"];var n,i=!1;Jit(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(i=!0,n=e),n=n||["x","y"];for(var a={},s=[],o={},l=!1,u={},h=0;h=r)){var n=this._store,i=n.getProvider();this._updateOrdinalMeta();var a=this._nameList,s=this._idList,o=i.getSource().sourceFormat,l=o===_d;if(l&&!i.pure)for(var u=[],h=e;h0},t.prototype.ensureUniqueItemVisual=function(e,r){var n=this._itemVisuals,i=n[e];i||(i=n[e]={});var a=i[r];return a==null&&(a=this.getVisual(r),ft(a)?a=a.slice():d8(a)&&(a=ot({},a)),i[r]=a),a},t.prototype.setItemVisual=function(e,r,n){var i=this._itemVisuals[e]||{};this._itemVisuals[e]=i,d8(r)?ot(i,r):i[r]=n},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(e,r){d8(e)?ot(this._layout,e):this._layout[e]=r},t.prototype.getLayout=function(e){return this._layout[e]},t.prototype.getItemLayout=function(e){return this._itemLayouts[e]},t.prototype.setItemLayout=function(e,r,n){this._itemLayouts[e]=n?ot(this._itemLayouts[e]||{},r):r},t.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},t.prototype.setItemGraphicEl=function(e,r){var n=this.hostModel&&this.hostModel.seriesIndex;Fde(n,this.dataType,e,r),this._graphicEls[e]=r},t.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},t.prototype.eachItemGraphicEl=function(e,r){de(this._graphicEls,function(n,i){n&&e&&e.call(r,n,i)})},t.prototype.cloneShallow=function(e){return e||(e=new t(this._schema?this._schema:Cx(this.dimensions,this._getDimInfo,this),this.hostModel)),Ppe(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(e,r){var n=this[e];ur(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var i=n.apply(this,arguments);return r.apply(this,[i].concat(gG(arguments)))})},t.internalField=function(){nat=function(e){var r=e._invertedIndicesMap;de(r,function(n,i){var a=e._dimInfos[i],s=a.ordinalMeta,o=e._store;if(s){n=r[i]=new KRr(s.categories.length);for(var l=0;l1&&(l+="__ec__"+h),i[r]=l}}}(),t}();function tDr(t,e){return U_(t,e).dimensions}function U_(t,e){Yfe(t)||(t=jfe(t)),e=e||{};var r=e.coordDimensions||[],n=e.dimensionsDefine||t.dimensionsDefine||[],i=Yt(),a=[],s=rDr(t,r,n,e.dimensionsCount),o=e.canOmitUnusedDimensions&&tat(s),l=n===t.dimensionsDefine,u=l?eat(t):Ipe(n),h=e.encodeDefine;!h&&e.encodeDefaulter&&(h=e.encodeDefaulter(t,s));for(var d=Yt(h),f=new ynt(s),p=0;p0&&(k.name=k.name+(E-1))}),new Zit({source:t,dimensions:a,fullDimensionCount:s,dimensionOmitted:o})}function rDr(t,e,r,n){var i=Math.max(t.dimensionsDetectedCount||1,e.length,r.length,n||0);return de(e,function(a){var s;yr(a)&&(s=a.dimsDef)&&(i=Math.max(i,s.length))}),i}function nDr(t,e,r){if(r||e.hasKey(t)){for(var n=0;e.hasKey(t+n);)n++;t+=n}return e.set(t,!0),t}var iDr=function(){function t(e){this.coordSysDims=[],this.axisMap=Yt(),this.categoryAxisMap=Yt(),this.coordSysName=e}return t}();function aDr(t){var e=t.get("coordinateSystem"),r=new iDr(e),n=sDr[e];if(n)return n(t,r,r.axisMap,r.categoryAxisMap),r}var sDr={cartesian2d:function(t,e,r,n){var i=t.getReferringComponents("xAxis",ds).models[0],a=t.getReferringComponents("yAxis",ds).models[0];e.coordSysDims=["x","y"],r.set("x",i),r.set("y",a),V_(i)&&(n.set("x",i),e.firstCategoryDimIndex=0),V_(a)&&(n.set("y",a),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,r,n){var i=t.getReferringComponents("singleAxis",ds).models[0];e.coordSysDims=["single"],r.set("single",i),V_(i)&&(n.set("single",i),e.firstCategoryDimIndex=0)},polar:function(t,e,r,n){var i=t.getReferringComponents("polar",ds).models[0],a=i.findAxisModel("radiusAxis"),s=i.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],r.set("radius",a),r.set("angle",s),V_(a)&&(n.set("radius",a),e.firstCategoryDimIndex=0),V_(s)&&(n.set("angle",s),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},geo:function(t,e,r,n){e.coordSysDims=["lng","lat"]},parallel:function(t,e,r,n){var i=t.ecModel,a=i.getComponent("parallel",t.get("parallelIndex")),s=e.coordSysDims=a.dimensions.slice();de(a.parallelAxisIndex,function(o,l){var u=i.getComponent("parallelAxis",o),h=s[l];r.set(h,u),V_(u)&&(n.set(h,u),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=l))})},matrix:function(t,e,r,n){var i=t.getReferringComponents("matrix",ds).models[0];e.coordSysDims=["x","y"];var a=i.getDimensionModel("x"),s=i.getDimensionModel("y");r.set("x",a),r.set("y",s),n.set("x",a),n.set("y",s)}};function V_(t){return t.get("type")==="category"}function iat(t,e,r){r=r||{};var n=r.byIndex,i=r.stackedCoordDimension,a,s,o;oDr(e)?a=e:(s=e.schema,a=s.dimensions,o=e.store);var l=!!(t&&t.get("stack")),u,h,d,f,p=!0;function g(w){return w.type!=="ordinal"&&w.type!=="time"}if(de(a,function(w,A){Nt(w)&&(a[A]=w={name:w}),g(w)||(p=!1)}),de(a,function(w,A){l&&!w.isExtraCoord&&(!n&&!u&&w.ordinalMeta&&(u=w),!h&&g(w)&&(!p||w.coordDim!=="x"&&w.coordDim!=="angle")&&(!i||i===w.coordDim)&&(h=w))}),h&&!n&&!u&&(n=!0),h){d="__\0ecstackresult_"+t.id,f="__\0ecstackedover_"+t.id,u&&(u.createInvertedIndices=!0);var m=h.coordDim,v=h.type,y=0;de(a,function(w){w.coordDim===m&&y++});var b={name:d,coordDim:m,coordDimIndex:y,type:v,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},x={name:f,coordDim:f,coordDimIndex:y+1,type:v,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};s?(o&&(b.storeDimIndex=o.ensureCalculationDimension(f,v),x.storeDimIndex=o.ensureCalculationDimension(d,v)),s.appendCalculationDimension(b),s.appendCalculationDimension(x)):(a.push(b),a.push(x))}return{stackedDimension:h&&h.name,stackedByDimension:u&&u.name,isStackedByIndex:n,stackedOverDimension:f,stackResultDimension:d}}function oDr(t){return!Jit(t.schema)}function py(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function Bpe(t,e){return py(t,e)?t.getCalculationInfo("stackResultDimension"):e}function lDr(t,e){var r=t.get("coordinateSystem"),n=O_.get(r),i;return e&&e.coordSysDims&&(i=vt(e.coordSysDims,function(a){var s={name:a},o=e.axisMap.get(a);if(o){var l=o.get("type");s.type=vW(l)}return s})),i||(i=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),i}function cDr(t,e,r){var n,i;return r&&de(t,function(a,s){var o=a.coordDim,l=r.categoryAxisMap.get(o);l&&(n==null&&(n=s),a.ordinalMeta=l.getOrdinalMeta(),e&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(i=!0)}),!i&&n!=null&&(t[n].otherDims.itemName=0),n}function Dm(t,e,r){r=r||{};var n=e.getSourceManager(),i,a=!1;t?(a=!0,i=jfe(t)):(i=n.getSource(),a=i.sourceFormat===_d);var s=aDr(e),o=lDr(e,s),l=r.useEncodeDefaulter,u=ur(l)?l:l?qr(Prt,o,e):null,h={coordDimensions:o,generateCoord:r.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},d=U_(i,h),f=cDr(d.dimensions,r.createInvertedIndices,s),p=a?null:n.getSharedDataStore(d),g=iat(e,{schema:d,store:p}),m=new zc(d,e);m.setCalculationInfo(g);var v=f!=null&&uDr(i)?function(y,b,x,w){return w===f?x:this.defaultDimValueGetter(y,b,x,w)}:null;return m.hasItemOption=!1,m.initData(a?i:p,null,v),m}function uDr(t){if(t.sourceFormat===_d){var e=hDr(t.data||[]);return!ft(r_(e))}}function hDr(t){for(var e=0;e=e[0]&&t<=e[1]},getExtent:function(){return this._extents[Rh].slice()},getExtentUnsafe:function(t){return this._extents[t]},setExtent:function(t,e){oat(this._extents,Rh,t,e)},setExtent2:function(t,e,r){var n=this._extents;n[t]||(n[t]=n[Rh].slice()),oat(n,t,e,r)},freeze:function(){}};function oat(t,e,r,n){zA(r,n)&&(t[e][0]=r,t[e][1]=n)}function lat(t){return AW(t)||Q_(t)}function AW(t){return t.type==="interval"}function b8(t){return t.type==="time"}function Q_(t){return t.type==="log"}function Uc(t){return t.type==="ordinal"}function vDr(t){var e=ZG(t),r=IA(10,e),n=mm(t/r);return n?n===2?n=3:n===3?n=5:n*=2:n=1,Gn(n*r,-e)}function CS(t){return vm(t)+2}function SW(t,e){return PA(t)/PA(e)}function Vpe(t,e,r){var n=r&&r.lookup;if(n){for(var i=0;i1&&a/s>2&&(i=Math.round(Math.ceil(i/s)*s)),i!==n[0]&&l(n[0],!0,!0);for(var o=i;o<=n[1];o+=s)l(o,!1,o===n[0]||o===n[1]);o-s!==n[1]&&l(n[1],!0,!0);function l(u,h,d){r({value:u,offInterval:h},d)}}var x8=function(t){rt(e,t);function e(r){var n=t.call(this)||this;n.type="ordinal",n.parse=e.parse,Fpe(n,e.decoratedMethods);var i=r.ordinalMeta;i||(i=new m8({})),ft(i)&&(i=new m8({categories:vt(i,function(s){return yr(s)?s.value:s})})),n._ordinalMeta=i;var a=$pe(null,null,r.extent||[0,i.categories.length-1]);return n._mapper=a.mapper,zpe(n),n}return e.parse=function(r){return r==null?r=NaN:Nt(r)?(r=this._ordinalMeta.getOrdinal(r),r==null&&(r=NaN)):r=mm(r),r},e.prototype.getTicks=function(){var r=[];return uat(this,0,function(n){r.push(n)}),r},e.prototype.getMinorTicks=function(r){},e.prototype.setSortInfo=function(r){if(r==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var n=r.ordinalNumbers,i=this._ordinalNumbersByTick=[],a=this._ticksByOrdinalNumber=[],s=0,o=this._ordinalMeta.categories.length,l=Ai(o,n.length);s=0&&r=0&&r=0&&rs[0]&&ms[1]||!isFinite(m)||!isFinite(s[1]))break}else{if(v>g)break;m=Ai(m,s[1]),v===g&&(m=s[1])}if(d.push({value:m}),m=Gn(m+i,o),u){var y=u.calcNiceTickMultiple(m,p);y>=0&&(m=Gn(m+y*i,o))}if(d.length>0&&m===d[d.length-1].value)break;if(d.length>f)return[]}var b=d.length?d[d.length-1].value:s[1];return a[1]>b&&d.push({value:r.expandToNicedExtent?Gn(b+i,o):a[1]}),h&&l.pruneTicksByBreak(r.pruneByBreak,d,u.breaks,function(x){return x.value},n.interval,a),h&&r.breakTicks!=="none"&&l.addBreaksToTicks(d,u.breaks,a),d},e.prototype.getMinorTicks=function(r){return Qpe(this,r,PH(this),this._cfg.interval)},e.prototype.getLabel=function(r,n){if(r==null)return"";var i=n&&n.precision;i==null?i=vm(r.value)||0:i==="auto"&&(i=this._cfg.intervalPrecision);var a=Gn(r.value,i,!0);return Lfe(a)},e.type="interval",e}(jp);jp.registerClass(Ox);var bDr=function(t,e,r,n){for(;r>>1;t[i][1]16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function wDr(t){var e=30*Vf;return t/=e,t>6?6:t>3?3:t>2?2:1}function ADr(t){return t/=jN,t>12?12:t>6?6:t>3.5?4:t>2?2:1}function fat(t,e){return t/=e?Cfe:Tfe,t>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function SDr(t){return en(JG(t,!0),1)}function TDr(t,e,r){var n=Math.max(0,Ir(Ld,e)-1);return FH(new Date(t),Ld[n],r).getTime()}function CDr(t,e){var r=new Date(0);r[t](1);var n=r.getTime();r[t](1+e);var i=r.getTime()-n;return function(a,s){return Math.max(0,Math.round((s-a)/i))}}function ODr(t,e,r,n,i,a){var s=3e3,o=V5r,l=0;function u(M,P,N,F,B,V,z){for(var U=CDr(B,M),Q=P,G=new Date(Q);Qs));)if(G[B](G[F]()+M),Q=G.getTime(),a){var X=a.calcNiceTickMultiple(Q,U);X>0&&(G[B](G[F]()+X*M),Q=G.getTime())}z.push({value:Q,notAdd:Q>n[1]})}function h(M,P,N){var F=[],B=!P.length;if(!dat(XN(M),n[0],n[1],r)){B&&(P=[{value:TDr(n[0],M,r)},{value:n[1]}]);for(var V=0;V=n[0]&&z<=n[1]&&u(Q,z,U,G,X,Y,F),M==="year"&&N.length>1&&V===0&&N.unshift({value:N[0].value-Q})}}for(var V=0;V=n[0]&&w<=n[1]&&p++)}var A=i/e;if(p>A*1.5&&g>A/1.5||(d.push(b),p>A||t===o[m]))break}f=[]}}}for(var S=ni(vt(d,function(M){return ni(M,function(P){return P.value>=n[0]&&P.value<=n[1]&&!P.notAdd})}),function(M){return M.length>0}),T=S.length-1,O=[],m=0;mn[0])&&O.unshift({value:n[0],time:{level:0,upperTimeUnit:R,lowerTimeUnit:R},notNice:!0}),(!L||L.valueo&&(a=o);var l=CW.length,u=Math.min(bDr(CW,a,0,l),l-1),h=CW[u][1],d=CW[Math.max(u-1,0)][0];t.setTimeInterval({approxInterval:a,interval:h,minLevelUnit:d})};jp.registerClass(hat);var OW=0,kW=1,EDr=2,pat=function(t){rt(e,t);function e(r){var n=t.call(this)||this;n.type="log",n.parse=Ox.parse,n.base=r.logBase||10;var i=[],a=[],s=n._lookup={from:i,to:a};i[OW]=i[kW]=a[OW]=a[kW]=NaN,Fpe(n,e.mapperMethods);var o=Ns(),l=r.breakOption,u={lookup:s};return o&&o.parseAxisBreakOptionInwardTransform(l,n,{noNegative:!0},EDr,u),n.powStub=new Ox({breakParsed:u.original}),n.intervalStub=new Ox({breakParsed:u.transformed}),zpe(n,n.intervalStub),n}return e.prototype.getTicks=function(r){var n=this.base,i=this.powStub,a=Ns(),s=this.intervalStub,o=s.getExtent(),l=i.getExtent(),u={lookup:{from:o,to:l}};return vt(s.getTicks(r||{}),function(h){var d=h.value,f=Vpe(d,n,u),p;if(a){var g=a.getTicksBreakOutwardTransform(this,h,PH(i),this._lookup);g&&(p=g.vBreak,f=g.tickVal)}return{value:f,break:p}},this)},e.prototype.getMinorTicks=function(r){return Qpe(this,r,PH(this.powStub),this.intervalStub.getConfig().interval)},e.prototype.getLabel=function(r,n){return this.intervalStub.getLabel(r,n)},e.type="log",e.mapperMethods={needTransform:function(){return!0},normalize:function(r){return this.intervalStub.normalize(SW(r,this.base))},scale:function(r){return Vpe(this.intervalStub.scale(r),this.base,null)},transformIn:function(r,n){return r=SW(r,this.base),n&&n.depth===gy?r:this.intervalStub.transformIn(r,n)},transformOut:function(r,n){var i=n?n.depth:null;return gat.depth=i,mat.lookup=this._lookup,Vpe(i===gy?r:this.intervalStub.transformOut(r,gat),this.base,mat)},contain:function(r){return this.powStub.contain(r)},setExtent:function(r,n){this.setExtent2(Rh,r,n)},setExtent2:function(r,n,i){if(!(!zA(n,i)||n<=0||i<=0)){var a=vat,s=vat;if(r===Rh){var o=this._lookup;a=o.to,s=o.from}this.powStub.setExtent2(r,a[OW]=n,a[kW]=i);var l=this.base;this.intervalStub.setExtent2(r,s[OW]=SW(n,l),s[kW]=SW(i,l))}},getFilter:function(){return{g:0}},sanitize:function(r,n){return zA(n[0],n[1])&&Bf(r)&&r<=0&&(r=n[0]),r},getDefaultStartValue:function(){return 1},getExtent:function(){return this.powStub.getExtent()},getExtentUnsafe:function(r,n){return n===null?this.powStub.getExtentUnsafe(r,null):this.intervalStub.getExtentUnsafe(r,n)}},e}(jp);jp.registerClass(pat);var gat={},mat={},vat=[],yat={value:1,category:1,time:1,log:1},bat=Qr();function w8(t){var e=t.get("type");return(e==null||!Kt(yat,e)&&!jp.getClass(e))&&(e="value"),e}function G_(t,e,r){var n=Ns(),i;switch(n&&(i=xat(t,e,r)),e){case"category":return new x8({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:rc()});case"time":return new hat({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC"),breakOption:i});case"log":return new pat({logBase:t.get("logBase"),breakOption:i});case"value":return new Ox({breakOption:i});default:return new(jp.getClass(e)||Ox)({})}}function _Dr(t,e,r){var n=t.getExtentUnsafe(Rh,null),i=n[0],a=n[1];return zA(i,a)?i===e||a===e?DDr:ie?RDr:Gpe:Gpe}var RDr=1,DDr=2,Gpe=3;function LDr(t){bat(t).noOnMyZero=!0}function MDr(t){return bat(t).noOnMyZero}function A8(t){var e=t.getLabelModel().get("formatter");if(t.type==="time"){var r=Q5r(e);return function(i,a){return t.scale.getFormattedLabel(i,a,r)}}else{if(Nt(e))return function(i){var a=t.scale.getLabel(i),s=e.replace("{value}",a??"");return s};if(ur(e)){if(t.type==="category")return function(i,a){return e(EW(t,i),i.value-t.scale.getExtent()[0],null)};var n=Ns();return function(i,a){var s=null;return n&&(s=n.makeAxisLabelFormatterParamBreak(s,i.break)),e(EW(t,i),a,s)}}else return function(i){return t.scale.getLabel(i)}}}function EW(t,e){var r=t.scale;return Uc(r)?r.getLabel(e):e.value}function Hpe(t){var e=t.get("interval");return e??"auto"}function IDr(t){return t.type==="category"&&Hpe(t.getLabelModel())===0}function PDr(t,e){var r={};return de(t.mapDimensionsAll(e),function(n){r[Bpe(t,n)]=!0}),kn(r)}function H_(t){return t==="middle"||t==="center"}function S8(t){return t.getShallow("show")}function xat(t,e,r){var n=t.get("breaks",!0);if(n!=null)return!Ns()||!r||!NDr(e)?void 0:n}function NDr(t){return t!=="category"}function wat(t,e,r,n,i,a){var s=Q_(t),o=s?t.intervalStub:t;if(o.setExtent(n[0],n[1]),s){var l=t.powStub,u={depth:gy},h=t.transformOut(n[0],u),d=t.transformOut(n[1],u),f=yDr(r,n);e[0]&&!f[0]&&(h=i[0]),e[1]&&!f[1]&&(d=i[1]),l.setExtent(h,d)}o.setConfig(a)}function W_(t,e){return Uc(t)?t.getRawOrdinalNumber(e.value):e.value}function T8(t,e){return Uc(t)&&!!e.get("boundaryGap")}var Y_=function(){function t(){}return t.prototype.needIncludeZero=function(){return!this.option.scale},t.prototype.getCoordSysModel=function(){},t}(),BDr=a_(),_W="|&",q_=Qr(),Aat=-2,$Dr=-1,FDr=Qr();function Wpe(t,e){var r=t.model,n=q_(M_(r.ecModel)).keyed,i=n&&n.get(e);return i&&i.get(r.uid)}function zDr(t,e){return Tat(Wpe(t,e))}function UDr(t,e){var r=[];return Sat(t.model.ecModel,function(n){for(var i=0;i0&&d[1]>0&&!f[0]&&(d[0]=0),d[0]<0&&d[1]<0&&!f[1]&&(d[1]=0));var w=!1;d[0]>d[1]&&(d.reverse(),w=!0);var A=C8(e,r.get("startValue",!0)),S=A!=null;!Bf(A)&&i&&(A=e.getDefaultStartValue?e.getDefaultStartValue():0),Bf(A)&&(S||!b||x)&&(Ad[1]&&!f[1]&&(d[1]=A,f[1]=!0));var T=this._i={scale:e,dataMM:h,noZoomEffMM:d,zoomMM:[],fixMM:f,zoomFixMM:[!1,!1],startValue:A,isBlank:y,incl0:x,tggAxInv:w,ctnShp:a};Eat(T,d)}return t.prototype.makeNoZoom=function(){return this._i.noZoomEffMM.slice()},t.prototype.makeFinal=function(){var e=this._i,r=e.zoomMM,n=e.noZoomEffMM,i=e.zoomFixMM,a=e.fixMM,s={fixMM:a,zoomFixMM:i,isBlank:e.isBlank,incl0:e.incl0,tggAxInv:e.tggAxInv,ctnShp:e.ctnShp,effMM:n.slice()},o=s.effMM;return r[0]!=null&&(o[0]=r[0],a[0]=i[0]=!0),r[1]!=null&&(o[1]=r[1],a[1]=i[1]=!0),Eat(e,o),s},t.prototype.makeRenderInfo=function(){return{startValue:this._i.startValue}},t.prototype.setZoomMM=function(e,r){this._i.zoomMM[e]=r},t}();function Eat(t,e){var r=t.scale,n=t.dataMM;r.sanitize&&(e[0]=r.sanitize(e[0],n),e[1]=r.sanitize(e[1],n),tH(e))}function C8(t,e){return e==null?null:Jl(e)?NaN:t.parse(e)}function jDr(t,e){var r;if(Uc(t))r=[0,0];else{var n=e.get("boundaryGap");typeof n=="boolean"&&(n=null),r=ft(n)?n:[n,n]}return[_at(r[0]),_at(r[1])]}function _at(t){return gm(typeof t=="boolean"?0:t,1)||0}function Rat(t){var e=WDr(t.scale);return e.extent||(e.extent=rc()),e}function XDr(t,e){Rat(t).dimIdxInCoord=e.get(t.dim)}function ES(t,e){var r=t.scale,n=t.model,i=t.dim;r.rawExtentInfo||KDr(r,t,i,n,e)}function KDr(t,e,r,n,i){var a=Rat(e),s=a.extent,o=!1;VDr(e,function(h){if(h.boxCoordinateSystem){var d=wrt(h).coord,f=a.dimIdxInCoord;if(f>=0){if(ft(d)){var p=d[f];p!=null&&!ft(p)&&bde(s,t.parse(p))}}}else if(h.coordinateSystem){var g=h.getData();if(g){var m=t.getFilter?t.getFilter():null;de(PDr(g,r),function(v){EEr(s,g.getApproximateExtent(v,m))})}h.__requireStartValue&&h.__requireStartValue(e)&&(o=!0)}});var l=JDr(t,e,n),u=new kat(t,n,s,o,l);Dat(t,u,i),a.extent=null}function ZDr(t,e){var r=t.scale;Dat(r,new kat(r,t.model,e,!1,!1),qDr)}function Dat(t,e,r){t.rawExtentInfo=e,e.from=r}function DW(t,e){Kpe.set(t,e)}var Kpe=Yt();function Lat(t,e,r,n,i){t.rawExtentInfo||ZDr({scale:t,model:e},i||rc());var a=t.rawExtentInfo.makeFinal(),s=a.effMM;return t.setExtent(s[0],s[1]),t.setBlank(a.isBlank),n&&a.tggAxInv&&r&&!r.get("legacyMinMaxDontInverseAxis")&&(n.inverse=!n.inverse),a}function JDr(t,e,r){var n=T8(t,r),i=r.get("containShape",!0);if(i==null&&!n&&(i=!0),!i)return!1;var a=!1;return Cat(e,function(s){a=!!Kpe.get(s)||a}),a}function eLr(t,e,r,n){if(r.ctnShp){var i;if(Cat(t,function(o){var l=Kpe.get(o);if(l){var u=l(t,n);u&&(i=i||[0,0],vet(i,u[0]),yet(i,u[1]),LDr(t))}}),!!i){var a=e.getExtent();if(Uc(e))t.onBand||e.setExtent2(v8,Ai(a[0],a[0]+i[0]),en(a[1],a[1]+i[1]));else{var s=a.slice();r.zoomFixMM[0]||(s[0]=Ai(s[0],e.transformOut(e.transformIn(s[0],null)+i[0],null))),r.zoomFixMM[1]||(s[1]=en(s[1],e.transformOut(e.transformIn(s[1],null)+i[1],null))),(s[0]a[1])&&e.setExtent2(v8,s[0],s[1])}}}}function Mat(t,e){var r=Q_(t),n=r?t.intervalStub:t,i=e.fixMinMax||[],a=r?t.getExtent():null,s=n.getExtent(),o=cat(s,i,e.rawExtentResult);n.setExtent(o[0],o[1]),o=n.getExtent();var l=r?rLr(n,e):tLr(n,e),u=l.intervalPrecision,h=l.interval,d=e.userInterval;d!=null&&(l.interval=d,l.intervalPrecision=CS(d)),i[0]||(o[0]=Gn(Nf(o[0]/h)*h,u)),i[1]||(o[1]=Gn(MA(o[1]/h)*h,u)),d!=null&&(l.niceExtent=o.slice()),wat(t,i,s,o,a,l)}function tLr(t,e){var r=TW(e.splitNumber,5),n=wW(t),i=e.minInterval,a=e.maxInterval,s=JG(n/r,!0);i!=null&&sa&&(s=a);var o=CS(s),l=t.getExtent(),u=[Gn(MA(l[0]/s)*s,o),Gn(Nf(l[1]/s)*s,o)];return{interval:s,intervalPrecision:o,niceExtent:u}}function rLr(t,e){var r=TW(e.splitNumber,10),n=t.getExtent(),i=wW(t),a=en(ude(i),1),s=r/i*a;s<=.5&&(a*=10);var o=CS(a),l=[Gn(MA(n[0]/a)*a,o),Gn(Nf(n[1]/a)*a,o)];return{intervalPrecision:o,interval:a,niceExtent:l}}function X_(t){var e=t.scale,r=t.model,n=r.axis,i=r.ecModel;Iat(e,r,n,i,null)}function Iat(t,e,r,n,i){var a=Lat(t,e,n,r,i),s=AW(t)||b8(t);Pat(t,{splitNumber:e.get("splitNumber"),fixMinMax:a.fixMM,userInterval:e.get("interval"),minInterval:s?e.get("minInterval"):null,maxInterval:s?e.get("maxInterval"):null,rawExtentResult:a}),r&&n&&eLr(r,t,a,n)}function Pat(t,e){nLr[t.type](t,e)}var nLr={interval:Mat,log:Mat,time:kDr,ordinal:Xa};function iLr(t){return Dm(null,t)}var aLr={isDimensionStacked:py,enableDataStack:iat,getStackedDimension:Bpe};function sLr(t,e){var r=e;e instanceof yn||(r=new yn(e));var n=w8(r),i=G_(r,n,!1);return t[1]i&&(n=s,i=l)}if(n)return dLr(n.exterior);var u=this.getBoundingRect();return[u.x+u.width/2,u.y+u.height/2]},e.prototype.getBoundingRect=function(r){var n=this._rect;if(n&&!r)return n;var i=[1/0,1/0],a=[-1/0,-1/0],s=this.geometries;return de(s,function(o){o.type==="polygon"?Bat(o.exterior,i,a,r):de(o.points,function(l){Bat(l,i,a,r)})}),isFinite(i[0])&&isFinite(i[1])&&isFinite(a[0])&&isFinite(a[1])||(i[0]=i[1]=a[0]=a[1]=0),n=new fr(i[0],i[1],a[0]-i[0],a[1]-i[1]),r||(this._rect=n),n},e.prototype.contain=function(r){var n=this.getBoundingRect(),i=this.geometries;if(!n.contain(r[0],r[1]))return!1;e:for(var a=0,s=i.length;a>1^-(o&1),l=l>>1^-(l&1),o+=i,l+=a,i=o,a=l,n.push([o/r,l/r])}return n}function ege(t,e){return t=pLr(t),vt(ni(t.features,function(r){return r.geometry&&r.properties&&r.geometry.coordinates.length>0}),function(r){var n=r.properties,i=r.geometry,a=[];switch(i.type){case"Polygon":var s=i.coordinates;a.push(new Fat(s[0],s.slice(1)));break;case"MultiPolygon":de(i.coordinates,function(l){l[0]&&a.push(new Fat(l[0],l.slice(1)))});break;case"LineString":a.push(new zat([i.coordinates]));break;case"MultiLineString":a.push(new zat(i.coordinates))}var o=new Uat(n[e||"name"],a,n.cp);return o.properties=n,o})}const gLr=Object.freeze(Object.defineProperty({__proto__:null,MAX_SAFE_INTEGER:_N,asc:xl,getPercentWithPrecision:lEr,getPixelPrecision:oEr,getPrecision:vm,getPrecisionSafe:ret,isNumeric:dde,isRadianAroundZero:BA,linearMap:jn,nice:JG,numericToNumber:bm,parseDate:ym,parsePercent:Qt,quantile:eH,quantity:ude,quantityExponent:ZG,reformIntervals:hde,remRadian:cde,round:sEr},Symbol.toStringTag,{value:"Module"})),mLr=Object.freeze(Object.defineProperty({__proto__:null,format:KN,parse:ym,roundTime:FH},Symbol.toStringTag,{value:"Module"})),vLr=Object.freeze(Object.defineProperty({__proto__:null,Arc:VN,BezierCurve:p_,BoundingRect:fr,Circle:Em,CompoundPath:QN,Ellipse:FN,Group:pr,Image:Yo,IncrementalDisplayable:Ntt,Line:Ps,LinearGradient:tS,Polygon:ic,Polyline:Al,RadialGradient:rfe,Rect:tn,Ring:f_,Sector:nc,Text:Pn,clipPointsByRect:lfe,clipRectByRect:Htt,createIcon:x_,extendPath:Vtt,extendShape:Utt,getShapeClass:GN,getTransform:iS,initProps:ia,makeImage:sfe,makePath:y_,mergePath:Dd,registerShape:Uf,resizePath:ofe,updateProps:Hn},Symbol.toStringTag,{value:"Module"})),yLr=Object.freeze(Object.defineProperty({__proto__:null,addCommas:Lfe,capitalFirst:K5r,encodeHTML:Nc,formatTime:X5r,formatTpl:Nfe,getTextRect:j5r,getTooltipMarker:yrt,normalizeCssArray:C_,toCamelCase:Mfe,truncateText:HEr},Symbol.toStringTag,{value:"Module"})),bLr=Object.freeze(Object.defineProperty({__proto__:null,bind:Ht,clone:lr,curry:qr,defaults:mr,each:de,extend:ot,filter:ni,indexOf:Ir,inherits:che,isArray:ft,isFunction:ur,isObject:yr,isString:Nt,map:vt,merge:Vr,reduce:Rf},Symbol.toStringTag,{value:"Module"}));var xLr=Qr(),O8=Qr(),Xp={estimate:1,determine:2};function LW(t){return{out:{noPxChangeTryDetermine:[]},kind:t}}function wLr(t,e){var r=t.getLabelModel().get("customValues");if(r){var n=t.scale;return{labels:vt(Qat(r,n),function(i,a){return{formattedLabel:A8(t)(i,a),rawLabel:n.getLabel(i),tick:i}})}}return t.type==="category"?SLr(t,e):CLr(t)}function ALr(t,e,r){var n=t.scale,i=t.getTickModel().get("customValues");return i?{ticks:Qat(i,n)}:t.type==="category"?TLr(t,e):{ticks:n.getTicks(r)}}function Qat(t,e){var r=e.getExtent(),n=[];return de(t,function(i){i=e.parse(i),i>=r[0]&&i<=r[1]&&n.push(i)}),rH(n,LEr,null),xl(n),vt(n,function(i){return{value:i}})}function SLr(t,e){var r=t.getLabelModel(),n=Gat(t,r,e);return!r.get("show")||t.scale.isBlank()?{labels:[]}:n}function Gat(t,e,r){var n=kLr(t),i=Hpe(e),a=r.kind===Xp.estimate;if(!a){var s=Wat(n,i);if(s)return s}var o,l;ur(i)?o=MW(t,i,!1):(l=i==="auto"?ELr(t,r):i,o=MW(t,l,!1));var u={labels:o,labelCategoryInterval:l};return a?r.out.noPxChangeTryDetermine.push(function(){return tge(n,i,u),!0}):tge(n,i,u),u}function TLr(t,e){var r=OLr(t),n=Hpe(e),i=Wat(r,n);if(i)return i;var a,s;if((!e.get("show")||t.scale.isBlank())&&(a=[]),ur(n))a=MW(t,n,!0);else if(n==="auto"){var o=Gat(t,t.getLabelModel(),LW(Xp.determine));s=o.labelCategoryInterval,a=vt(o.labels,function(l){return l.tick})}else s=n,a=MW(t,s,!0);return tge(r,n,{ticks:a,tickCategoryInterval:s})}function CLr(t){var e=t.scale.getTicks(),r=A8(t);return{labels:vt(e,function(n,i){return{formattedLabel:r(n,i),rawLabel:t.scale.getLabel(n),tick:n}})}}var OLr=Hat("axisTick"),kLr=Hat("axisLabel");function Hat(t){return function(r){return O8(r)[t]||(O8(r)[t]={list:[]})}}function Wat(t,e){for(var r=0;rh&&(u=Math.max(1,Math.floor(l/h)));for(var d=o[0],f=t.dataToCoord(d+1)-t.dataToCoord(d),p=Math.abs(f*Math.cos(a)),g=Math.abs(f*Math.sin(a)),m=0,v=0;d<=o[1];d+=u){var y=0,b=0,x=VG(i({value:d}),n.font,"center","top");y=x.width*1.3,b=x.height*1.3,m=Math.max(m,y,7),v=Math.max(v,b,7)}var w=m/p,A=v/g;isNaN(w)&&(w=1/0),isNaN(A)&&(A=1/0);var S=Math.max(0,Math.floor(Math.min(w,A)));if(r===Xp.estimate)return e.out.noPxChangeTryDetermine.push(Ht(RLr,null,t,S,l)),S;var T=Yat(t,S,l);return T??S}function RLr(t,e,r){return Yat(t,e,r)==null}function Yat(t,e,r){var n=xLr(t.model),i=t.getExtent(),a=n.lastAutoInterval,s=n.lastTickCount;if(a!=null&&s!=null&&Math.abs(a-e)<=1&&Math.abs(s-r)<=1&&a>e&&n.axisExtent0===i[0]&&n.axisExtent1===i[1])return a;n.lastTickCount=r,n.lastAutoInterval=e,n.axisExtent0=i[0],n.axisExtent1=i[1]}function DLr(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function MW(t,e,r){var n=A8(t),i=t.scale,a=[],s=ur(e);return uat(i,s?0:e,function(o,l){var u=i.getLabel(o);if(s){var h=!!e(o.value,u);if(o.offInterval=!h,!h&&!l)return}a.push(r?o:{formattedLabel:n(o),rawLabel:u,tick:o})}),a}var LLr=.8;function sc(t,e){e=e||{};var r={w:NaN,w2:NaN},n=t.scale,i=e.fromStat,a=e.min,s=gDr(n);Bf(s)||(s=NaN);var o=t.getExtent(),l=Za(o[1]-o[0]);return Uc(n)?MLr(r,t,s,l):i&&ILr(r,t,s,l,i),a!=null&&(r.w=Bf(r.w)?en(a,r.w):a),r}function MLr(t,e,r,n){var i=e.onBand,a=r+(i?1:0);a===0&&(a=1),t.w=n/a,!i&&r&&n&&(t.w2=t.w*r/n)}function ILr(t,e,r,n,i){var a=!1,s=-1/0;de(i.key?[zDr(e,i.key)]:UDr(e,i.sers||[]),function(o){var l=o.liPosMinGap;l!=null&&(l>0?(l>s&&(s=l),a=!1):l===Aat&&(a=!0))}),Bf(r)&&r>0&&Bf(s)?(t.w=n/r*s,t.w2=s):a&&(t.w=n*LLr,t.w2=t.w*r/n)}var qat=[0,1],Wf=function(){function t(e,r,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=r,this._extent=n||[0,0]}return t.prototype.contain=function(e){var r=this._extent,n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return e>=n&&e<=i},t.prototype.containData=function(e){return this.scale.contain(this.scale.parse(e))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.setExtent=function(e,r){var n=this._extent;n[0]=e,n[1]=r},t.prototype.dataToCoord=function(e,r){var n=this.scale;return e=n.normalize(n.parse(e)),jn(e,qat,jat(this),r)},t.prototype.coordToData=function(e,r){var n=jn(e,jat(this),qat,r);return this.scale.scale(n)},t.prototype.pointToData=function(e,r){},t.prototype.getTicksCoords=function(e){e=e||{};var r=e.tickModel||this.getTickModel(),n=ALr(this,r,{breakTicks:e.breakTicks,pruneByBreak:e.pruneByBreak}),i=vt(n.ticks,function(o){return{coord:this.dataToCoord(W_(this.scale,o)),tick:o}},this),a=r.get("alignWithLabel"),s=PLr(this,i,a);return vt(i,function(o){return{coord:o.coord,tickValue:o.tick.value,onBand:s}})},t.prototype.getMinorTicksCoords=function(){if(Uc(this.scale))return[];var e=this.model.getModel("minorTick"),r=e.get("splitNumber");r>0&&r<100||(r=5);var n=this.scale.getMinorTicks(r),i=vt(n,function(a){return vt(a,function(s){return{coord:this.dataToCoord(s),tickValue:s}},this)},this);return i},t.prototype.getViewLabels=function(e){return e=e||LW(Xp.determine),wLr(this,e).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){return sc(this,{min:1}).w},t.prototype.calculateCategoryInterval=function(e){return e=e||LW(Xp.determine),_Lr(this,e)},t}();function jat(t){var e=t.getExtent();if(t.onBand){var r=e[1]-e[0],n=r/t.scale.count()/2;e[0]+=n,e[1]-=n}return e}function PLr(t,e,r){var n=e.length;if(!t.onBand||r||!n)return!1;var i=sc(t).w;if(!i)return!1;de(e,function(o){o.coord-=i/2});var a=t.scale.getExtent(),s=e[n-1];return s.tick.offInterval&&e.pop(),e.push({coord:s.coord+i,tick:{value:a[1]+1}}),!0}function NLr(t){var e=fn.extend(t);return fn.registerClass(e),e}function BLr(t){var e=Hi.extend(t);return Hi.registerClass(e),e}function $Lr(t){var e=Ri.extend(t);return Ri.registerClass(e),e}function FLr(t){var e=Si.extend(t);return Si.registerClass(e),e}var k8=Math.PI*2,RS=Cm.CMD,zLr=["top","right","bottom","left"];function ULr(t,e,r,n,i){var a=r.width,s=r.height;switch(t){case"top":n.set(r.x+a/2,r.y-e),i.set(0,-1);break;case"bottom":n.set(r.x+a/2,r.y+s+e),i.set(0,1);break;case"left":n.set(r.x-e,r.y+s/2),i.set(-1,0);break;case"right":n.set(r.x+a+e,r.y+s/2),i.set(1,0);break}}function VLr(t,e,r,n,i,a,s,o,l){s-=t,o-=e;var u=Math.sqrt(s*s+o*o);s/=u,o/=u;var h=s*r+t,d=o*r+e;if(Math.abs(n-i)%k8<1e-4)return l[0]=h,l[1]=d,u-r;if(a){var f=n;n=kd(i),i=kd(f)}else n=kd(n),i=kd(i);n>i&&(i+=k8);var p=Math.atan2(o,s);if(p<0&&(p+=k8),p>=n&&p<=i||p+k8>=n&&p+k8<=i)return l[0]=h,l[1]=d,u-r;var g=r*Math.cos(n)+t,m=r*Math.sin(n)+e,v=r*Math.cos(i)+t,y=r*Math.sin(i)+e,b=(g-s)*(g-s)+(m-o)*(m-o),x=(v-s)*(v-s)+(y-o)*(y-o);return b0){e=e/180*Math.PI,Zp.fromArray(t[0]),aa.fromArray(t[1]),Fs.fromArray(t[2]),wr.sub(Lm,Zp,aa),wr.sub(Mm,Fs,aa);var r=Lm.len(),n=Mm.len();if(!(r<.001||n<.001)){Lm.scale(1/r),Mm.scale(1/n);var i=Lm.dot(Mm),a=Math.cos(e);if(a1&&wr.copy(Tu,Fs),Tu.toArray(t[1])}}}}function HLr(t,e,r){if(r<=180&&r>0){r=r/180*Math.PI,Zp.fromArray(t[0]),aa.fromArray(t[1]),Fs.fromArray(t[2]),wr.sub(Lm,aa,Zp),wr.sub(Mm,Fs,aa);var n=Lm.len(),i=Mm.len();if(!(n<.001||i<.001)){Lm.scale(1/n),Mm.scale(1/i);var a=Lm.dot(e),s=Math.cos(r);if(a=l)wr.copy(Tu,Fs);else{Tu.scaleAndAdd(Mm,o/Math.tan(Math.PI/2-h));var d=Fs.x!==aa.x?(Tu.x-aa.x)/(Fs.x-aa.x):(Tu.y-aa.y)/(Fs.y-aa.y);if(isNaN(d))return;d<0?wr.copy(Tu,aa):d>1&&wr.copy(Tu,Fs)}Tu.toArray(t[1])}}}}function rge(t,e,r,n){var i=r==="normal",a=i?t:t.ensureState(r);a.ignore=e;var s=n.get("smooth");s=s===!0?.3:Math.max(+s,0)||0,a.shape=a.shape||{},a.shape.smooth=s;var o=n.getModel("lineStyle").getLineStyle();i?t.useStyle(o):a.style=o}function WLr(t,e){var r=e.smooth,n=e.points;if(n)if(t.moveTo(n[0][0],n[0][1]),r>0&&n.length>=3){var i=qv(n[0],n[1]),a=qv(n[1],n[2]);if(!i||!a){t.lineTo(n[1][0],n[1][1]),t.lineTo(n[2][0],n[2][1]);return}var s=Math.min(i,a)*r,o=hN([],n[1],n[0],s/i),l=hN([],n[1],n[2],s/a),u=hN([],o,l,.5);t.bezierCurveTo(o[0],o[1],o[0],o[1],u[0],u[1]),t.bezierCurveTo(l[0],l[1],l[0],l[1],n[2][0],n[2][1])}else for(var h=1;h0){w(E*k,0,a);var _=E+T;_<0&&A(-_*k,1)}else A(-T*k,1)}}function w(T,O,k){T!==0&&(h=!0);for(var E=O;E0)for(var _=0;_0;_--){var D=k[_-1]*R;w(-D,_,a)}}}function S(T){var O=T<0?-1:1;T=Math.abs(T);for(var k=Math.ceil(T/(a-1)),E=0;E0?w(k,0,E+1):w(-k,a-E-1,a),T-=k,T<=0)return}return h}function jLr(t){for(var e=0;e=0&&n.attr(a.oldLayoutSelect),Ir(f,"emphasis")>=0&&n.attr(a.oldLayoutEmphasis)),Hn(n,u,r,l)}else if(n.attr(u),!w_(n).valueAnimation){var d=Jt(n.style.opacity,1);n.style.opacity=0,ia(n,{style:{opacity:d}},r,l)}if(a.oldLayout=u,n.states.select){var p=a.oldLayoutSelect={};FW(p,u,zW),FW(p,n.states.select,zW)}if(n.states.emphasis){var g=a.oldLayoutEmphasis={};FW(g,u,zW),FW(g,n.states.emphasis,zW)}rrt(n,l,h,r,r)}if(i&&!i.ignore&&!i.invisible){var a=ZLr(i),s=a.oldLayout,m={points:i.shape.points};s?(i.attr({shape:s}),Hn(i,{shape:m},r)):(i.setShape(m),i.style.strokePercent=0,ia(i,{style:{strokePercent:1}},r)),a.oldLayout=m}},t}(),uge=Qr();function eMr(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){var i=uge(r).labelManager;i||(i=uge(r).labelManager=new JLr),i.clearLabels()}),t.registerUpdateLifecycle("series:layoutlabels",function(e,r,n){var i=uge(r).labelManager;de(n.updatedSeries,function(a){i.addLabelsOfSeries(r.getViewOfSeriesModel(a))}),i.updateLayoutConfig(r),i.layout(r),i.processLabelsOverall()})}var hge=Math.sin,dge=Math.cos,sst=Math.PI,DS=Math.PI*2,tMr=180/sst,ost=function(){function t(){}return t.prototype.reset=function(e){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,e||4)},t.prototype.moveTo=function(e,r){this._add("M",e,r)},t.prototype.lineTo=function(e,r){this._add("L",e,r)},t.prototype.bezierCurveTo=function(e,r,n,i,a,s){this._add("C",e,r,n,i,a,s)},t.prototype.quadraticCurveTo=function(e,r,n,i){this._add("Q",e,r,n,i)},t.prototype.arc=function(e,r,n,i,a,s){this.ellipse(e,r,n,n,0,i,a,s)},t.prototype.ellipse=function(e,r,n,i,a,s,o,l){var u=o-s,h=!l,d=Math.abs(u),f=cx(d-DS)||(h?u>=DS:-u>=DS),p=u>0?u%DS:u%DS+DS,g=!1;f?g=!0:cx(d)?g=!1:g=p>=sst==!!h;var m=e+n*dge(s),v=r+i*hge(s);this._start&&this._add("M",m,v);var y=Math.round(a*tMr);if(f){var b=1/this._p,x=(h?1:-1)*(DS-b);this._add("A",n,i,y,1,+h,e+n*dge(s+x),r+i*hge(s+x)),b>.01&&this._add("A",n,i,y,0,+h,m,v)}else{var w=e+n*dge(o),A=r+i*hge(o);this._add("A",n,i,y,+g,+h,w,A)}},t.prototype.rect=function(e,r,n,i){this._add("M",e,r),this._add("l",n,0),this._add("l",0,i),this._add("l",-n,0),this._add("Z")},t.prototype.closePath=function(){this._d.length>0&&this._add("Z")},t.prototype._add=function(e,r,n,i,a,s,o,l,u){for(var h=[],d=this._p,f=1;f"}function uMr(t){return""}function gge(t,e){e=e||{};var r=e.newline?` `:"";function n(i){var a=i.children,s=i.tag,o=i.attrs,l=i.text;return cMr(s,o)+(s!=="style"?Nc(l):l||"")+(a?""+r+vt(a,function(u){return n(u)}).join(r)+r:"")+uMr(s)}return n(t)}function hMr(t,e,r){r=r||{};var n=r.newline?` -`:"",i=" {"+n,a=n+"}",s=vt(kn(t),function(l){return l+i+vt(kn(t[l]),function(u){return u+":"+t[l][u]+";"}).join(n)+a}).join(n),o=vt(kn(e),function(l){return"@keyframes "+l+i+vt(kn(e[l]),function(u){return u+i+vt(kn(e[l][u]),function(h){var d=e[l][u][h];return h==="d"&&(d='path("'+d+'")'),h+":"+d+";"}).join(n)+a}).join(n)+a}).join(n);return!s&&!o?"":[""].join(n)}function mge(t){return{zrId:t,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function dst(t,e,r,n){return jo("svg","root",{width:t,height:e,xmlns:lst,"xmlns:xlink":cst,version:"1.1",baseProfile:"full",viewBox:n?"0 0 "+t+" "+e:!1},r)}var dMr=0;function fst(){return dMr++}var pst={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},LT="transform-origin";function fMr(t,e,r){var n=ot({},t.shape);ot(n,e),t.buildPath(r,n);var i=new ost;return i.reset(DJe(t)),r.rebuildPath(i,1),i.generateStr(),i.getStr()}function pMr(t,e){var r=e.originX,n=e.originY;(r||n)&&(t[LT]=r+"px "+n+"px")}var gMr={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function gst(t,e){var r=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[r]=t,r}function mMr(t,e,r){var n=t.shape.paths,i={},a,s;if(de(n,function(l){var u=mge(r.zrId);u.animation=!0,UW(l,{},u,!0);var h=u.cssAnims,d=u.cssNodes,f=kn(h),p=f.length;if(p){s=f[p-1];var g=h[s];for(var m in g){var v=g[m];i[m]=i[m]||{d:""},i[m].d+=v.d||""}for(var y in d){var b=d[y].animation;b.indexOf(s)>=0&&(a=b)}}}),!!a){e.d=!1;var o=gst(i,r);return a.replace(s,o)}}function mst(t){return Nt(t)?pst[t]?"cubic-bezier("+pst[t]+")":Lhe(t)?t:"":""}function UW(t,e,r,n){var i=t.animators,a=i.length,s=[];if(t instanceof QN){var o=mMr(t,e,r);if(o)s.push(o);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var Y=gst(S,r);return Y+" "+b[0]+" both"}}for(var v in l){var o=m(l[v]);o&&s.push(o)}if(s.length){var y=r.zrId+"-cls-"+fst();r.cssNodes["."+y]={animation:s.join(",")},e.class=y}}function vMr(t,e,r){if(!t.ignore)if(t.isSilent()){var n={"pointer-events":"none"};vst(n,e,r)}else{var i=t.states.emphasis&&t.states.emphasis.style?t.states.emphasis.style:{},a=i.fill;if(!a){var s=t.style&&t.style.fill,o=t.states.select&&t.states.select.style&&t.states.select.style.fill,l=t.currentStates.indexOf("select")>=0&&o||s;l&&(a=RG(l))}var u=i.lineWidth;if(u){var h=!i.strokeNoScale&&t.transform?t.transform[0]:1;u=u/h}var n={cursor:"pointer"};a&&(n.fill=a),i.stroke&&(n.stroke=i.stroke),u&&(n["stroke-width"]=u),vst(n,e,r)}}function vst(t,e,r,n){var i=JSON.stringify(t),a=r.cssStyleCache[i];a||(a=r.zrId+"-cls-"+fst(),r.cssStyleCache[i]=a,r.cssNodes["."+a+":hover"]=t),e.class=e.class?e.class+" "+a:a}var E8=Math.round;function yst(t){return t&&Nt(t.src)}function bst(t){return t&&ur(t.toDataURL)}function vge(t,e,r,n){sMr(function(i,a){var s=i==="fill"||i==="stroke";s&&RJe(a)?Cst(e,t,i,n):s&&$he(a)?Ost(r,t,i,n):t[i]=a,s&&n.ssr&&a==="none"&&(t["pointer-events"]="visible")},e,r,!1),SMr(r,t,n)}function yge(t,e){var r=ZJe(e);r&&(r.each(function(n,i){n!=null&&(t[(ust+i).toLowerCase()]=n+"")}),e.isSilent()&&(t[ust+"silent"]="true"))}function xst(t){return cx(t[0]-1)&&cx(t[1])&&cx(t[2])&&cx(t[3]-1)}function yMr(t){return cx(t[4])&&cx(t[5])}function bge(t,e,r){if(e&&!(yMr(e)&&xst(e))){var n=1e4;t.transform=xst(e)?"translate("+E8(e[4]*n)/n+" "+E8(e[5]*n)/n+")":bkr(e)}}function wst(t,e,r){for(var n=t.points,i=[],a=0;a"u"){var v="Image width/height must been given explictly in svg-ssr renderer.";ec(f,v),ec(p,v)}else if(f==null||p==null){var y=function(E,_){if(E){var I=E.elm,L=f||_.width,R=p||_.height;E.tag==="pattern"&&(u?(R=1,L/=a.width):h&&(L=1,R/=a.height)),E.attrs.width=L,E.attrs.height=R,I&&(I.setAttribute("width",L),I.setAttribute("height",R))}},b=Ade(g,null,t,function(E){l||y(T,E),y(d,E)});b&&b.width&&b.height&&(f=f||b.width,p=p||b.height)}d=jo("image","img",{href:g,width:f,height:p}),s.width=f,s.height=p}else i.svgElement&&(d=lr(i.svgElement),s.width=i.svgWidth,s.height=i.svgHeight);if(d){var x,w;l?x=w=1:u?(w=1,x=s.width/a.width):h?(x=1,w=s.height/a.height):s.patternUnits="userSpaceOnUse",x!=null&&!isNaN(x)&&(s.width=x),w!=null&&!isNaN(w)&&(s.height=w);var A=LJe(i);A&&(s.patternTransform=A);var T=jo("pattern","",s,[d]),S=gge(T),O=n.patternCache,k=O[S];k||(k=n.zrId+"-p"+n.patternIdx++,O[S]=k,s.id=k,T=n.defs[k]=jo("pattern",k,s,[d])),e[r]=MG(k)}}function CMr(t,e,r){var n=r.clipPathCache,i=r.defs,a=n[t.id];if(!a){a=r.zrId+"-c"+r.clipPathIdx++;var s={id:a};n[t.id]=a,i[a]=jo("clipPath",a,s,[Tst(t,r)])}e["clip-path"]=MG(a)}function kst(t){return document.createTextNode(t)}function MT(t,e,r){t.insertBefore(e,r)}function Est(t,e){t.removeChild(e)}function _st(t,e){t.appendChild(e)}function Rst(t){return t.parentNode}function Dst(t){return t.nextSibling}function xge(t,e){t.textContent=e}var Lst=58,OMr=120,kMr=jo("","");function wge(t){return t===void 0}function Pm(t){return t!==void 0}function EMr(t,e,r){for(var n={},i=e;i<=r;++i){var a=t[i].key;a!==void 0&&(n[a]=i)}return n}function _8(t,e){var r=t.key===e.key,n=t.tag===e.tag;return n&&r}function R8(t){var e,r=t.children,n=t.tag;if(Pm(n)){var i=t.elm=hst(n);if(Age(kMr,t),ft(r))for(e=0;ea?(g=r[l+1]==null?null:r[l+1].elm,Mst(t,g,r,i,l)):VW(t,e,n,a))}function K_(t,e){var r=e.elm=t.elm,n=t.children,i=e.children;t!==e&&(Age(t,e),wge(e.text)?Pm(n)&&Pm(i)?n!==i&&_Mr(r,n,i):Pm(i)?(Pm(t.text)&&xge(r,""),Mst(r,null,i,0,i.length-1)):Pm(n)?VW(r,n,0,n.length-1):Pm(t.text)&&xge(r,""):t.text!==e.text&&(Pm(n)&&VW(r,n,0,n.length-1),xge(r,e.text)))}function RMr(t,e){if(_8(t,e))K_(t,e);else{var r=t.elm,n=Rst(r);R8(e),n!==null&&(MT(n,e.elm,Dst(r)),VW(n,[t],0,0))}return e}var DMr=0,LMr=function(){function t(e,r,n){if(this.type="svg",this.configLayer=MMr(),this.storage=r,this._opts=n=ot({},n),this.root=e,this._id="zr"+DMr++,this._oldVNode=dst(n.width,n.height),e&&!n.ssr){var i=this._viewport=document.createElement("div");i.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=hst("svg");Age(null,this._oldVNode),i.appendChild(a),e.appendChild(i)}this.resize(n.width,n.height)}return t.prototype.getType=function(){return this.type},t.prototype.getViewportRoot=function(){return this._viewport},t.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},t.prototype.getSvgDom=function(){return this._svgDom},t.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style="position:absolute;left:0;top:0;user-select:none",RMr(this._oldVNode,e),this._oldVNode=e}},t.prototype.renderOneToVNode=function(e){return Sst(e,mge(this._id))},t.prototype.renderToVNode=function(e){e=e||{};var r=this.storage.getDisplayList(!0),n=this._width,i=this._height,a=mge(this._id);a.animation=e.animation,a.willUpdate=e.willUpdate,a.compress=e.compress,a.emphasis=e.emphasis,a.ssr=this._opts.ssr;var s=[],o=this._bgVNode=IMr(n,i,this._backgroundColor,a);o&&s.push(o);var l=e.compress?null:this._mainVNode=jo("g","main",{},[]);this._paintList(r,a,l?l.children:s),l&&s.push(l);var u=vt(kn(a.defs),function(f){return a.defs[f]});if(u.length&&s.push(jo("defs","defs",{},u)),e.animation){var h=hMr(a.cssNodes,a.cssAnims,{newline:!0});if(h){var d=jo("style","stl",{},[],h);s.push(d)}}return dst(n,i,s,e.useViewBox)},t.prototype.renderToString=function(e){return e=e||{},gge(this.renderToVNode({animation:Jt(e.cssAnimation,!0),emphasis:Jt(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:Jt(e.useViewBox,!0)}),{newline:!0})},t.prototype.setBackgroundColor=function(e){this._backgroundColor=e},t.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},t.prototype._paintList=function(e,r,n){for(var i=e.length,a=[],s=0,o,l,u=0,h=0;h=0&&!(f&&l&&f[m]===l[m]);m--);for(var v=g-1;v>m;v--)s--,o=a[s-1];for(var y=m+1;y=o)}}for(var d=Pst(this),f=d.startIdx;f=0)&&(s=!0)}),!(!s&&!a.__dirty)){var o=n._opts.useDirtyRect&&!Tge(a)?a.createRepaintRects(e,r,n._width,n._height):null,l=n._i.layerStack[0],u=!0;if(a.__dirty){u=!1,a.__dirty=!1;var h=a.zlevel===l.zl&&a.zlevel2===l.zl2?n._backgroundColor:null;a.clear(!1,h,o)}QW(a,function(d){var f=n._paintPerCursor(a,d,e,o,u);i=i&&f})}},GW),Rn.wxa&&Vc(this._i,function(a){a&&a.ctx&&a.ctx.draw&&a.ctx.draw()}),i},t.prototype._paintPerCursor=function(e,r,n,i,a){var s=e.ctx;if(i)if(!i.length)r.drawIdx=r.endIdx;else for(var o=this.dpr,l=0;l=r.endIdx},t.prototype._paintPerCursorInRect=function(e,r,n,i,a){for(var s={inHover:!1,allClipped:!1,prevEl:null,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{contentRetained:a}},o=e.ctx,l=Tge(e),u=l&&Ho.getTime(),h=r.drawIdx,d=r.notClearIdx,f=d>=0?Math.min(d,h):h;f15){f++;break}}}}N_(o,s),r.drawIdx=Math.max(f,h)},t.prototype.getLayer=function(e,r){return this._ensureLayer(e,0,r)},t.prototype._ensureLayer=function(e,r,n){r=r||0;var i=this._singleCanvas;i&&!this._needsManuallyCompositing&&(e=IT,r=0);var a=Oge(this._i,e)[r];return a||(a=$st("zr_"+e+"."+r,this,e,r),this._layerConfig[e]&&Vr(a,this._layerConfig[e],!0),(n||i&&e!==IT)&&(a.virtual=!0),this._insertLayer(a,e,r,!1),a.initContext()),a},t.prototype.insertLayer=function(e,r){this._insertLayer(r,e,0,!1)},t.prototype._insertLayer=function(e,r,n,i){var a=this._i,s=a.layers,o=a.layerStack,l=this._domRoot,u=null;if(!(s[r]&&s[r][n])&&BMr(e)){for(var h=o.length,d=0;d0&&(u=Oge(a,o[d-1].zl)[o[d-1].zl2]),o.splice(d,0,{zl:r,zl2:n}),Oge(a,r)[n]=e,!i&&!e.virtual)if(u){var f=u.dom;f.nextSibling?l.insertBefore(e.dom,f.nextSibling):l.appendChild(e.dom)}else l.firstChild?l.insertBefore(e.dom,l.firstChild):l.appendChild(e.dom);e.painter||(e.painter=this)}},t.prototype.eachLayer=function(e,r){return Vc(this._i,function(n,i){e.call(r,n,i)})},t.prototype.eachBuiltinLayer=function(e,r){return Vc(this._i,function(n,i){e.call(r,n,i)},D8)},t.prototype.eachOtherLayer=function(e,r){return Vc(this._i,function(n,i){e.call(r,n,i)},kge)},t.prototype.getLayers=function(){var e={};return Vc(this._i,function(r,n,i){e[r.id]=r}),e},t.prototype._updateLayerStatus=function(e,r){var n=this;if(n._singleCanvas)for(var i=1;i=0;x--){var w=b.get(y[x]);if(!w.used)v.__dirty=!0,b.removeKey(y[x]),y.splice(x,1);else{var A=w.endIdxNew;(Tge(v)?A=0;i--){var a=r[i];if(a.zl===e){var s=n[e][a.zl2];if(s.__builtin__)continue;if(r.splice(i,1),n[e][a.zl2]=void 0,!s.virtual){var o=s.dom.parentNode;o&&o.removeChild(s.dom)}}}},t.prototype.resize=function(e,r){if(this._domRoot.style){var n=this._domRoot;n.style.display="none";var i=this._opts,a=this.root;e!=null&&(i.width=e),r!=null&&(i.height=r),e=P_(a,0,i),r=P_(a,1,i),n.style.display="",(this._width!==e||r!==this._height)&&(n.style.width=e+"px",n.style.height=r+"px",Vc(this._i,function(s){s.resize(e,r)}),this.refresh({paintAll:!0})),this._width=e,this._height=r}else{if(e==null||r==null)return;this._width=e,this._height=r,this._ensureLayer(IT).resize(e,r)}return this},t.prototype.clearLayer=function(e){de(this._i.layers[e],function(r){r&&!r.__builtin__&&r.clear()})},t.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._i=null},t.prototype.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._i.layers[IT][0].dom;var r=new Nst("image",this,e.pixelRatio||this.dpr);r.initContext(),r.clear(!1,e.backgroundColor||this._backgroundColor);var n=r.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var i=r.dom.width,a=r.dom.height;Vc(this._i,function(d){d.__builtin__?n.drawImage(d.dom,0,0,i,a):d.renderToCanvas&&(n.save(),d.renderToCanvas(n),n.restore())})}else{for(var s={inHover:!1,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{}},o=this.storage.getDisplayList(!0),l=0,u=o.length;l-1&&(u.style.stroke=u.style.fill,u.style.fill=et.color.neutral00,u.style.lineWidth=2),n},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:6,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1,triggerEvent:!1},e}(Ri);function Z_(t,e){var r=t.mapDimensionsAll("defaultedLabel"),n=r.length;if(n===1){var i=__(t,e,r[0]);return i!=null?i+"":null}else if(n){for(var a=[],s=0;s=0&&n.push(e[a])}return n.join(" ")}var L8=function(t){rt(e,t);function e(r,n,i,a){var s=t.call(this)||this;return s.updateData(r,n,i,a),s}return e.prototype._createSymbol=function(r,n,i,a,s,o){this.removeAll();var l=$s(r,-1,-1,2,2,null,o);l.attr({z2:Jt(s,100),culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),l.drift=GMr,this._symbolType=r,this.add(l)},e.prototype.stopSymbolAnimation=function(r){this.childAt(0).stopAnimation(null,r)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){oy(this.childAt(0))},e.prototype.downplay=function(){ly(this.childAt(0))},e.prototype.setZ=function(r,n){var i=this.childAt(0);i.zlevel=r,i.z=n},e.prototype.setDraggable=function(r,n){var i=this.childAt(0);i.draggable=r,i.cursor=!n&&r?"move":i.cursor},e.prototype.updateData=function(r,n,i,a){this.silent=!1;var s=r.getItemVisual(n,"symbol")||"circle",o=r.hostModel,l=e.getSymbolSize(r,n),u=e.getSymbolZ2(r,n),h=s!==this._symbolType,d=a&&a.disableAnimation;if(h){var f=r.getItemVisual(n,"symbolKeepAspect");this._createSymbol(s,r,n,l,u,f)}else{var p=this.childAt(0);p.silent=!1;var g={scaleX:l[0]/2,scaleY:l[1]/2};d?p.attr(g):Hn(p,g,o,n),zf(p)}if(this._updateCommon(r,n,l,i,a),h){var p=this.childAt(0);if(!d){var g={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:p.style.opacity}};p.scaleX=p.scaleY=0,p.style.opacity=0,ia(p,g,o,n)}}d&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(r,n,i,a,s){var o=this.childAt(0),l=r.hostModel,u,h,d,f,p,g,m,v,y;if(a&&(u=a.emphasisItemStyle,h=a.blurItemStyle,d=a.selectItemStyle,f=a.focus,p=a.blurScope,m=a.labelStatesModels,v=a.hoverScale,y=a.cursorStyle,g=a.emphasisDisabled),!a||r.hasItemOption){var b=a&&a.itemModel?a.itemModel:r.getItemModel(n),x=b.getModel("emphasis");u=x.getModel("itemStyle").getItemStyle(),d=b.getModel(["select","itemStyle"]).getItemStyle(),h=b.getModel(["blur","itemStyle"]).getItemStyle(),f=x.get("focus"),p=x.get("blurScope"),g=x.get("disabled"),m=So(b),v=x.getShallow("scale"),y=b.getShallow("cursor")}var w=r.getItemVisual(n,"symbolRotate");o.attr("rotation",(w||0)*Math.PI/180||0);var A=xT(r.getItemVisual(n,"symbolOffset"),i);A&&(o.x=A[0],o.y=A[1]),y&&o.attr("cursor",y);var T=r.getItemVisual(n,"style"),S=T.fill;if(o instanceof Yo){var O=o.style;o.useStyle(ot({image:O.image,x:O.x,y:O.y,width:O.width,height:O.height},T))}else o.__isEmptyBrush?o.useStyle(ot({},T)):o.useStyle(T),o.style.decal=null,o.setColor(S,s&&s.symbolInnerColor),o.style.strokeNoScale=!0;var k=r.getItemVisual(n,"liftZ"),E=this._z2;k!=null?E==null&&(this._z2=o.z2,o.z2+=k):E!=null&&(o.z2=E,this._z2=null);var _=s&&s.useNameLabel;qo(o,m,{labelFetcher:l,labelDataIndex:n,defaultText:I,inheritColor:S,defaultOpacity:T.opacity});function I(D){return _?r.getName(D):Z_(r,D)}this._sizeX=i[0]/2,this._sizeY=i[1]/2;var L=o.ensureState("emphasis");L.style=u,o.ensureState("select").style=d,o.ensureState("blur").style=h;var R=v==null||v===!0?Math.max(1.1,3/this._sizeY):isFinite(v)&&v>0?+v:1;L.scaleX=this._sizeX*R,L.scaleY=this._sizeY*R,this.setSymbolScale(1),wa(this,f,p,g)},e.prototype.setSymbolScale=function(r){this.scaleX=this.scaleY=r},e.prototype.fadeOut=function(r,n,i){var a=this.childAt(0),s=Cr(this).dataIndex,o=i&&i.animation;if(this.silent=a.silent=!0,i&&i.fadeLabel){var l=a.getTextContent();l&&yx(l,{style:{opacity:0}},n,{dataIndex:s,removeOpt:o,cb:function(){a.removeTextContent()}})}else a.removeTextContent();yx(a,{style:{opacity:0},scaleX:0,scaleY:0},n,{dataIndex:s,cb:r,removeOpt:o})},e.getSymbolSize=function(r,n){return I_(r.getItemVisual(n,"symbolSize"))},e.getSymbolZ2=function(r,n){return r.getItemVisual(n,"z2")},e}(pr);function GMr(t,e){this.parent.drift(t,e)}function HW(t,e,r,n){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(n&&n.isIgnore&&n.isIgnore(r))&&!(n&&n.clipShape&&!n.clipShape.contain(e[0],e[1]))&&t.getItemVisual(r,"symbol")!=="none"}function Vst(t){return t!=null&&!yr(t)&&(t={isIgnore:t}),t||{}}function Qst(t){var e=t.hostModel,r=e.getModel("emphasis");return{emphasisItemStyle:r.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:r.get("focus"),blurScope:r.get("blurScope"),emphasisDisabled:r.get("disabled"),hoverScale:r.get("scale"),labelStatesModels:So(e),cursorStyle:e.get("cursor")}}function Gst(t,e,r,n,i,a,s){var o=new t(e,r,n,i);return o.setPosition(a),e.setItemGraphicEl(r,o),s.add(o),o}var M8=function(){function t(e){this.group=new pr,this._SymbolCtor=e||L8}return t.prototype.updateData=function(e,r){this._progressiveEls=null,r=Vst(r);var n=this.group,i=e.hostModel,a=this._data,s=this._SymbolCtor,o=r.disableAnimation,l=this._seriesScope=Qst(e),u={disableAnimation:o},h=r.getSymbolPoint||function(d){return e.getItemLayout(d)};a||n.removeAll(),e.diff(a).add(function(d){var f=h(d);HW(e,f,d,r)&&Gst(s,e,d,l,u,f,n)}).update(function(d,f){var p=a.getItemGraphicEl(f),g=h(d);if(!HW(e,g,d,r)){n.remove(p);return}var m=e.getItemVisual(d,"symbol")||"circle",v=p&&p.getSymbolType&&p.getSymbolType();if(!p||v&&v!==m)n.remove(p),p=new s(e,d,l,u),p.setPosition(g);else{p.updateData(e,d,l,u);var y={x:g[0],y:g[1]};o?p.attr(y):Hn(p,y,i)}n.add(p),e.setItemGraphicEl(d,p)}).remove(function(d){var f=a.getItemGraphicEl(d);f&&f.fadeOut(function(){n.remove(f)},i)}).execute(),this._getSymbolPoint=h,this._data=e},t.prototype.updateLayout=function(e){var r=this._data;if(r)for(var n=this,i=r.getStore(),a=0,s=i.count();a0?r=n[0]:n[1]<0&&(r=n[1]),r}function Wst(t,e,r,n){var i=NaN;t.stacked&&(i=r.get(r.getCalculationInfo("stackedOverDimension"),n)),isNaN(i)&&(i=t.valueStart);var a=t.baseDataOffset,s=[];return s[a]=r.get(t.baseDim,n),s[1-a]=i,e.dataToPoint(s)}function Yf(t,e){return!isFinite(t)||!isFinite(e)}var WMr=typeof Float32Array!==l_?Float32Array:void 0,YMr=typeof Float64Array!==l_?Float64Array:void 0;function Nm(t){return Ege({ctor:WMr},t).arr}function Ege(t,e){var r=t.arr,n=t.ctor;if(e>_N&&(e=_N),!r||t.typed&&r.length=i||m<0)break;if(Yf(y,b)){if(l){m+=a;continue}break}if(m===r)t[a>0?"moveTo":"lineTo"](y,b),d=y,f=b;else{var x=y-u,w=b-h;if(x*x+w*w<.5){m+=a;continue}if(s>0){for(var A=m+a,T=e[A*2],S=e[A*2+1];T===y&&S===b&&v=n||Yf(T,S))p=y,g=b;else{E=T-u,_=S-h;var R=y-u,D=T-y,M=b-h,P=S-b,N=void 0,F=void 0;if(o==="x"){N=Math.abs(R),F=Math.abs(D);var B=E>0?1:-1;p=y-B*N*s,g=b,I=y+B*F*s,L=b}else if(o==="y"){N=Math.abs(M),F=Math.abs(P);var V=_>0?1:-1;p=y,g=b-V*N*s,I=y,L=b+V*F*s}else N=Math.sqrt(R*R+M*M),F=Math.sqrt(D*D+P*P),k=F/(F+N),p=y-E*s*(1-k),g=b-_*s*(1-k),I=y+E*s*k,L=b+_*s*k,I=kx(I,Ex(T,y)),L=kx(L,Ex(S,b)),I=Ex(I,kx(T,y)),L=Ex(L,kx(S,b)),E=I-y,_=L-b,p=y-E*N/F,g=b-_*N/F,p=kx(p,Ex(u,y)),g=kx(g,Ex(h,b)),p=Ex(p,kx(u,y)),g=Ex(g,kx(h,b)),E=y-p,_=b-g,I=y+E*F/N,L=b+_*F/N}t.bezierCurveTo(d,f,p,g,y,b),d=I,f=L}else t.lineTo(y,b)}u=y,h=b,m+=a}return v}var Yst=function(){function t(){this.smooth=0,this.smoothConstraint=!0}return t}(),XMr=function(t){rt(e,t);function e(r){var n=t.call(this,r)||this;return n.type="ec-polyline",n}return e.prototype.getDefaultStyle=function(){return{stroke:et.color.neutral99,fill:null}},e.prototype.getDefaultShape=function(){return new Yst},e.prototype.buildPath=function(r,n){var i=n.points,a=0,s=i.length/2;if(n.connectNulls){for(;s>0&&Yf(i[s*2-2],i[s*2-1]);s--);for(;a=0){var w=u?(g-l)*x+l:(p-o)*x+o;return u?[r,w]:[w,r]}o=p,l=g;break;case s.C:p=a[d++],g=a[d++],m=a[d++],v=a[d++],y=a[d++],b=a[d++];var A=u?OG(o,p,m,y,r,h):OG(l,g,v,b,r,h);if(A>0)for(var T=0;T=0){var w=u?Wo(l,g,v,b,S):Wo(o,p,m,y,S);return u?[r,w]:[w,r]}}o=y,l=b;break}}},e}(vn),KMr=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Yst),qst=function(t){rt(e,t);function e(r){var n=t.call(this,r)||this;return n.type="ec-polygon",n}return e.prototype.getDefaultShape=function(){return new KMr},e.prototype.buildPath=function(r,n){var i=n.points,a=n.stackedOnPoints,s=0,o=i.length/2,l=n.smoothMonotone;if(n.connectNulls){for(;o>0&&Yf(i[o*2-2],i[o*2-1]);o--);for(;s=0,a=t.fill||et.color.neutral99;not(n,e);var s=n.textFill==null;return i?s&&(n.textFill=r.insideFill||et.color.neutral00,!n.textStroke&&r.insideStroke&&(n.textStroke=r.insideStroke),!n.textStroke&&(n.textStroke=a),n.textStrokeWidth==null&&(n.textStrokeWidth=2)):(s&&(n.textFill=t.fill||r.outsideFill||et.color.neutral00),!n.textStroke&&r.outsideStroke&&(n.textStroke=r.outsideStroke)),n.text=e.text,n.rich=e.rich,de(e.rich,function(o){not(o,o)}),n}function not(t,e){e&&(Kt(e,"fill")&&(t.textFill=e.fill),Kt(e,"stroke")&&(t.textStroke=e.fill),Kt(e,"lineWidth")&&(t.textStrokeWidth=e.lineWidth),Kt(e,"font")&&(t.font=e.font),Kt(e,"fontStyle")&&(t.fontStyle=e.fontStyle),Kt(e,"fontWeight")&&(t.fontWeight=e.fontWeight),Kt(e,"fontSize")&&(t.fontSize=e.fontSize),Kt(e,"fontFamily")&&(t.fontFamily=e.fontFamily),Kt(e,"align")&&(t.textAlign=e.align),Kt(e,"verticalAlign")&&(t.textVerticalAlign=e.verticalAlign),Kt(e,"lineHeight")&&(t.textLineHeight=e.lineHeight),Kt(e,"width")&&(t.textWidth=e.width),Kt(e,"height")&&(t.textHeight=e.height),Kt(e,"backgroundColor")&&(t.textBackgroundColor=e.backgroundColor),Kt(e,"padding")&&(t.textPadding=e.padding),Kt(e,"borderColor")&&(t.textBorderColor=e.borderColor),Kt(e,"borderWidth")&&(t.textBorderWidth=e.borderWidth),Kt(e,"borderRadius")&&(t.textBorderRadius=e.borderRadius),Kt(e,"shadowColor")&&(t.textBoxShadowColor=e.shadowColor),Kt(e,"shadowBlur")&&(t.textBoxShadowBlur=e.shadowBlur),Kt(e,"shadowOffsetX")&&(t.textBoxShadowOffsetX=e.shadowOffsetX),Kt(e,"shadowOffsetY")&&(t.textBoxShadowOffsetY=e.shadowOffsetY),Kt(e,"textShadowColor")&&(t.textShadowColor=e.textShadowColor),Kt(e,"textShadowBlur")&&(t.textShadowBlur=e.textShadowBlur),Kt(e,"textShadowOffsetX")&&(t.textShadowOffsetX=e.textShadowOffsetX),Kt(e,"textShadowOffsetY")&&(t.textShadowOffsetY=e.textShadowOffsetY))}function iot(t,e){if(t.length===e.length){for(var r=0;re){a?r.push(s(a,l,e)):i&&r.push(s(i,l,0),s(i,l,e));break}else i&&(r.push(s(i,l,0)),i=null),r.push(l),a=l}return r}function eIr(t,e,r){var n=t.getVisual("visualMeta");if(!(!n||!n.length||!t.count())&&e.type==="cartesian2d"){for(var i,a,s=n.length-1;s>=0;s--){var o=t.getDimensionInfo(n[s].dimension);if(i=o&&o.coordDim,i==="x"||i==="y"){a=n[s];break}}if(a){var l=e.getAxis(i),u=vt(a.stops,function(x){return{coord:l.toGlobalCoord(l.dataToCoord(x.value)),color:x.color}}),h=u.length,d=a.outerColors.slice();h&&u[0].coord>u[h-1].coord&&(u.reverse(),d.reverse());var f=JMr(u,i==="x"?r.getWidth():r.getHeight()),p=f.length;if(!p&&h)return u[0].coord<0?d[1]?d[1]:u[h-1].color:d[0]?d[0]:u[0].color;var g=10,m=f[0].coord-g,v=f[p-1].coord+g,y=v-m;if(y<.001)return"transparent";de(f,function(x){x.offset=(x.coord-m)/y}),f.push({offset:p?f[p-1].offset:.5,color:d[1]||"transparent"}),f.unshift({offset:p?f[0].offset:.5,color:d[0]||"transparent"});var b=new tT(0,0,0,0,f,!0);return b[i]=m,b[i+"2"]=v,b}}}function tIr(t,e,r){var n=t.get("showAllSymbol"),i=n==="auto";if(!(n&&!i)){var a=r.getAxesByScale("ordinal")[0];if(a&&!(i&&rIr(a,e))){var s=e.mapDimension(a.dim),o={};return de(a.getViewLabels(),function(l){l.tick.offInterval||(o[W_(a.scale,l.tick)]=1)}),function(l){return!o.hasOwnProperty(e.get(s,l))}}}}function rIr(t,e){var r=t.getExtent(),n=Math.abs(r[1]-r[0])/t.scale.count();isNaN(n)&&(n=0);for(var i=e.count(),a=Math.max(1,Math.round(i/5)),s=0;sn)return!1;return!0}function nIr(t){for(var e=t.length/2;e>0&&Yf(t[e*2-2],t[e*2-1]);e--);return e-1}function lot(t,e){return[t[e*2],t[e*2+1]]}function iIr(t,e,r){for(var n=t.length/2,i=r==="x"?0:1,a,s,o=0,l=-1,u=0;u=e||a>=e&&s<=e){l=u;break}o=u,a=s}return{range:[o,l],t:(e-a)/(s-a)}}function cot(t){if(t.get(["endLabel","show"]))return!0;for(var e=0;e0&&r.get(["emphasis","lineStyle","width"])==="bolder"){var F=g.getState("emphasis").style;F.lineWidth=+g.style.lineWidth+1}Cr(g).seriesIndex=r.seriesIndex,wa(g,M,P,N);var B=oot(r.get("smooth")),V=r.get("smoothMonotone");if(g.setShape({smooth:B,smoothMonotone:V,connectNulls:S}),m){var z=o.getCalculationInfo("stackedOnSeries"),U=0;m.useStyle(mr(u.getAreaStyle(),{fill:I,opacity:.7,lineJoin:"bevel",decal:o.getVisual("style").decal})),z&&(U=oot(z.get("smooth"))),m.setShape({smooth:B,stackedOnSmooth:U,smoothMonotone:V,connectNulls:S}),To(m,r,"areaStyle"),Cr(m).seriesIndex=r.seriesIndex,wa(m,M,P,N)}var Q=this._changePolyState;o.eachItemGraphicEl(function(q){q&&(q.onHoverStateChange=Q)}),this._polyline.onHoverStateChange=Q,this._data=o,this._coordSys=a,this._stackedOnPoints=A,this._points=h,this._step=E,this._valueOrigin=x;var G=r.get("triggerEvent"),X=r.get("triggerLineEvent"),Y=X===!0||G===!0||G==="line",le=X===!0||G===!0||G==="area";this.packEventData(r,g,Y),m&&this.packEventData(r,m,le)},e.prototype.packEventData=function(r,n,i){Cr(n).eventData=i?{componentType:"series",componentSubType:"line",componentIndex:r.componentIndex,seriesIndex:r.seriesIndex,seriesName:r.name,seriesType:"line",selfType:n===this._polygon?"area":"line"}:null},e.prototype.highlight=function(r,n,i,a){var s=r.getData(),o=FA(s,a);if(this._changePolyState("emphasis"),!(o instanceof Array)&&o!=null&&o>=0){var l=s.getLayout("points"),u=s.getItemGraphicEl(o);if(!u){var h=l[o*2],d=l[o*2+1];if(Yf(h,d)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(h,d))return;var f=r.get("zlevel")||0,p=r.get("z")||0;u=new L8(s,o),u.x=h,u.y=d,u.setZ(f,p);var g=u.getSymbolPath().getTextContent();g&&(g.zlevel=f,g.z=p,g.z2=this._polyline.z2+1),u.__temp=!0,s.setItemGraphicEl(o,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else Ti.prototype.highlight.call(this,r,n,i,a)},e.prototype.downplay=function(r,n,i,a){var s=r.getData(),o=FA(s,a);if(this._changePolyState("normal"),o!=null&&o>=0){var l=s.getItemGraphicEl(o);l&&(l.__temp?(s.setItemGraphicEl(o,null),this.group.remove(l)):l.downplay())}else Ti.prototype.downplay.call(this,r,n,i,a)},e.prototype._changePolyState=function(r){var n=this._polygon;yH(this._polyline,r),n&&yH(n,r)},e.prototype._newPolyline=function(r){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new XMr({shape:{points:r},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(n),this._polyline=n,n},e.prototype._newPolygon=function(r,n){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new qst({shape:{points:r,stackedOnPoints:n},segmentIgnoreThreshold:2}),this._lineGroup.add(i),this._polygon=i,i},e.prototype._initSymbolLabelAnimation=function(r,n,i){var a,s,o=n.getBaseAxis(),l=o.inverse;n.type==="cartesian2d"?(a=o.isHorizontal(),s=!1):n.type==="polar"&&(a=o.dim==="angle",s=!0);var u=r.hostModel,h=u.get("animationDuration");ur(h)&&(h=h(null));var d=u.get("animationDelay")||0,f=ur(d)?d(null):d;r.eachItemGraphicEl(function(p,g){var m=p;if(m){var v=[p.x,p.y],y=void 0,b=void 0,x=void 0;if(i)if(s){var w=i,A=n.pointToCoord(v);a?(y=w.startAngle,b=w.endAngle,x=-A[1]/180*Math.PI):(y=w.r0,b=w.r,x=A[0])}else{var T=i;a?(y=T.x,b=T.x+T.width,x=p.x):(y=T.y+T.height,b=T.y,x=p.y)}var S=b===y?0:(x-y)/(b-y);l&&(S=1-S);var O=ur(d)?d(g):h*S+f,k=m.getSymbolPath(),E=k.getTextContent();m.attr({scaleX:0,scaleY:0}),m.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:O}),E&&E.animateFrom({style:{opacity:0}},{duration:300,delay:O}),k.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(r,n,i){var a=r.getModel("endLabel");if(cot(r)){var s=r.getData(),o=this._polyline,l=s.getLayout("points");if(!l){o.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new Pn({z2:200}),u.ignoreClip=!0,o.setTextContent(this._endLabel),o.disableLabelAnimation=!0);var h=nIr(l);h>=0&&(qo(o,So(r,"endLabel"),{inheritColor:i,labelFetcher:r,labelDataIndex:h,defaultText:function(d,f,p){return p!=null?Ust(s,p):Z_(s,d)},enableTextSetter:!0},aIr(a,n)),o.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(r,n,i,a,s,o,l){var u=this._endLabel,h=this._polyline;if(u){r<1&&a.originalX==null&&(a.originalX=u.x,a.originalY=u.y);var d=i.getLayout("points"),f=i.hostModel,p=f.get("connectNulls"),g=o.get("precision"),m=o.get("distance")||0,v=l.getBaseAxis(),y=v.isHorizontal(),b=v.inverse,x=n.shape,w=b?y?x.x:x.y+x.height:y?x.x+x.width:x.y,A=(y?m:0)*(b?-1:1),T=(y?0:-m)*(b?-1:1),S=y?"x":"y",O=iIr(d,w,S),k=O.range,E=k[1]-k[0],_=void 0;if(E>=1){if(E>1&&!p){var I=lot(d,k[0]);u.attr({x:I[0]+A,y:I[1]+T}),s&&(_=f.getRawValue(k[0]))}else{var I=h.getPointOn(w,S);I&&u.attr({x:I[0]+A,y:I[1]+T});var L=f.getRawValue(k[0]),R=f.getRawValue(k[1]);s&&(_=met(i,g,L,R,O.t))}a.lastFrameIndex=k[0]}else{var D=r===1||a.lastFrameIndex>0?k[0]:0,I=lot(d,D);s&&(_=f.getRawValue(D)),u.attr({x:I[0]+A,y:I[1]+T})}if(s){var M=w_(u);typeof M.setLabelText=="function"&&M.setLabelText(_)}}},e.prototype._doUpdateAnimation=function(r,n,i,a,s,o,l){var u=this._polyline,h=this._polygon,d=r.hostModel,f=jMr(this._data,r,this._stackedOnPoints,n,this._coordSys,i,this._valueOrigin),p=f.current,g=f.stackedOnCurrent,m=f.next,v=f.stackedOnNext;if(s&&(g=_x(f.stackedOnCurrent,f.current,i,s,l),p=_x(f.current,null,i,s,l),v=_x(f.stackedOnNext,f.next,i,s,l),m=_x(f.next,null,i,s,l)),sot(p,m)>3e3||h&&sot(g,v)>3e3){u.stopAnimation(),u.setShape({points:m}),h&&(h.stopAnimation(),h.setShape({points:m,stackedOnPoints:v}));return}u.shape.__points=f.current,u.shape.points=p;var y={shape:{points:m}};f.current!==p&&(y.shape.__points=f.next),u.stopAnimation(),Hn(u,y,d),h&&(h.setShape({points:p,stackedOnPoints:g}),h.stopAnimation(),Hn(h,{shape:{stackedOnPoints:v}},d),u.shape.points!==h.shape.points&&(h.shape.points=u.shape.points));for(var b=[],x=f.status,w=0;we&&(e=t[r]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,r=0;r10&&s.type==="cartesian2d"&&a){var l=s.getBaseAxis(),u=s.getOtherAxis(l),h=l.getExtent(),d=n.getDevicePixelRatio(),f=Math.abs(h[1]-h[0])*(d||1),p=Math.round(o/f);if(isFinite(p)&&p>1){a==="lttb"?e.setData(i.lttbDownSample(i.mapDimension(u.dim),1/p)):a==="minmax"&&e.setData(i.minmaxDownSample(i.mapDimension(u.dim),1/p));var g=void 0;Nt(a)?g=oIr[a]:ur(a)&&(g=a),g&&e.setData(i.downSample(i.mapDimension(u.dim),1/p,g,lIr))}}}}}function cIr(t){t.registerChartView(sIr),t.registerSeriesModel(QMr),t.registerLayout(B8("line",!0)),t.registerVisual({seriesType:"line",reset:function(e){var r=e.getData(),n=e.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=r.getVisual("style").fill),r.setVisual("legendLineStyle",n)}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,uot("line"))}var hot=function(t){rt(e,t);function e(r,n,i,a,s){var o=t.call(this,r,n,i)||this;return o.index=0,o.type=a||"value",o.position=s||"bottom",o}return e.prototype.isHorizontal=function(){var r=this.position;return r==="top"||r==="bottom"},e.prototype.getGlobalExtent=function(r){var n=this.getExtent();return n[0]=this.toGlobalCoord(n[0]),n[1]=this.toGlobalCoord(n[1]),r&&n[0]>n[1]&&n.reverse(),n},e.prototype.pointToData=function(r,n){return this.coordToData(this.toLocalCoord(r[this.dim==="x"?0:1]),n)},e.prototype.setCategorySortInfo=function(r){if(this.type!=="category")return!1;this.model.option.categorySortInfo=r,this.scale.setSortInfo(r)},e}(Wf),Dge=null;function uIr(t){Dge||(Dge=t)}function $8(){return Dge}var WW="expandAxisBreak",dot="collapseAxisBreak",fot="toggleAxisBreak",Lge="axisbreakchanged",hIr={type:WW,event:Lge,update:"update",refineEvent:Mge},dIr={type:dot,event:Lge,update:"update",refineEvent:Mge},fIr={type:fot,event:Lge,update:"update",refineEvent:Mge};function Mge(t,e,r,n){var i=[];return de(t,function(a){i=i.concat(a.eventBreaks)}),{eventContent:{breaks:i}}}function pIr(t){t.registerAction(hIr,e),t.registerAction(dIr,e),t.registerAction(fIr,e);function e(r,n){var i=[],a=n_(n,r);function s(o,l){de(a[o],function(u){var h=u.updateAxisBreaks(r);de(h.breaks,function(d){var f;i.push(mr((f={},f[l]=u.componentIndex,f),d))})})}return s("xAxisModels","xAxisIndex"),s("yAxisModels","yAxisIndex"),s("singleAxisModels","singleAxisIndex"),{eventBreaks:i}}}var Rx=Math.PI,gIr=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],mIr=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],BT=Qr(),pot=Qr(),got=function(){function t(e){this.recordMap={},this.resolveAxisNameOverlap=e}return t.prototype.ensureRecord=function(e){var r=e.axis.dim,n=e.componentIndex,i=this.recordMap,a=i[r]||(i[r]=[]);return a[n]||(a[n]={ready:{}})},t}();function vIr(t,e,r,n){var i=r.axis,a=e.ensureRecord(r),s=[],o,l=Pge(t.axisName)&&H_(t.nameLocation);de(n,function(g){var m=Im(g);if(!(!m||m.label.ignore)){s.push(m);var v=a.transGroup;l&&(v.transform?Cd(F8,v.transform):TA(F8),m.transform&&Sd(F8,F8,m.transform),fr.copy(YW,m.localRect),YW.applyTransform(F8),o?o.union(YW):fr.copy(o=new fr(0,0,0,0),YW))}});var u=Math.abs(a.dirVec.x)>.1?"x":"y",h=a.transGroup[u];if(s.sort(function(g,m){return Math.abs(g.label[u]-h)-Math.abs(m.label[u]-h)}),l&&o){var d=i.getExtent(),f=Math.min(d[0],d[1]),p=Math.max(d[0],d[1])-f;o.union(new fr(f,0,p,1))}a.stOccupiedRect=o,a.labelInfoList=s}var F8=xa(),YW=new fr(0,0,0,0),mot=function(t,e,r,n,i,a){if(H_(t.nameLocation)){var s=a.stOccupiedRect;s&&vot(qLr({},s,a.transGroup.transform),n,i)}else yot(a.labelInfoList,a.dirVec,n,i)};function vot(t,e,r){var n=new wr;$W(t,e,n,{direction:Math.atan2(r.y,r.x),bidirectional:!1,touchThreshold:.05})&&sge(e,n)}function yot(t,e,r,n){for(var i=wr.dot(n,e)>=0,a=0,s=t.length;a0?"top":"bottom",a="center"):BA(i-Rx)?(s=n>0?"bottom":"top",a="center"):(s="middle",i>0&&i0?"right":"left":a=n>0?"left":"right"),{rotation:i,textAlign:a,textVerticalAlign:s}},t.makeAxisEventDataBase=function(e){var r={componentType:e.mainType,componentIndex:e.componentIndex};return r[e.mainType+"Index"]=e.componentIndex,r},t.isLabelSilent=function(e){var r=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||r&&r.show)},t}(),yIr=["axisLine","axisTickLabelEstimate","axisTickLabelDetermine","axisName"],bIr={axisLine:function(t,e,r,n,i,a,s){var o=n.get(["axisLine","show"]);if(o==="auto"&&(o=!0,t.raw.axisLineAutoShow!=null&&(o=!!t.raw.axisLineAutoShow)),!!o){var l=n.axis.getExtent(),u=a.transform,h=[l[0],0],d=[l[1],0],f=h[0]>d[0];u&&(Ka(h,h,u),Ka(d,d,u));var p=ot({lineCap:"round"},n.getModel(["axisLine","lineStyle"]).getLineStyle()),g={strokeContainThreshold:t.raw.strokeContainThreshold||5,silent:!0,z2:1,style:p};if(n.get(["axisLine","breakLine"])&&NH(n.axis.scale))$8().buildAxisBreakLine(n,i,a,g);else{var m=new Ps(ot({shape:{x1:h[0],y1:h[1],x2:d[0],y2:d[1]}},g));b_(m.shape,m.style.lineWidth),m.anid="line",i.add(m)}var v=n.get(["axisLine","symbol"]);if(v!=null){var y=n.get(["axisLine","symbolSize"]);Nt(v)&&(v=[v,v]),(Nt(y)||zn(y))&&(y=[y,y]);var b=xT(n.get(["axisLine","symbolOffset"])||0,y),x=y[0],w=y[1];de([{rotate:t.rotation+Math.PI/2,offset:b[0],r:0},{rotate:t.rotation-Math.PI/2,offset:b[1],r:Math.sqrt((h[0]-d[0])*(h[0]-d[0])+(h[1]-d[1])*(h[1]-d[1]))}],function(A,T){if(v[T]!=="none"&&v[T]!=null){var S=$s(v[T],-x/2,-w/2,x,w,p.stroke,!0),O=A.r+A.offset,k=f?d:h;S.attr({rotation:A.rotate,x:k[0]+O*Math.cos(t.rotation),y:k[1]-O*Math.sin(t.rotation),silent:!0,z2:11}),i.add(S)}})}}},axisTickLabelEstimate:function(t,e,r,n,i,a,s,o){var l=wot(e,i,o);l&&bot(t,e,r,n,i,a,s,Xp.estimate)},axisTickLabelDetermine:function(t,e,r,n,i,a,s,o){var l=wot(e,i,o);l&&bot(t,e,r,n,i,a,s,Xp.determine);var u=TIr(t,i,a,n);AIr(t,e.labelLayoutList,u),SIr(t,i,a,n,t.tickDirection)},axisName:function(t,e,r,n,i,a,s,o){var l=r.ensureRecord(n);e.nameEl&&(i.remove(e.nameEl),e.nameEl=l.nameLayout=l.nameLocation=null);var u=t.axisName;if(Pge(u)){var h=t.nameLocation,d=t.nameDirection,f=n.getModel("nameTextStyle"),p=n.get("nameGap")||0,g=n.axis.getExtent(),m=n.axis.inverse?-1:1,v=new wr(0,0),y=new wr(0,0);h==="start"?(v.x=g[0]-m*p,y.x=-m):h==="end"?(v.x=g[1]+m*p,y.x=m):(v.x=(g[0]+g[1])/2,v.y=t.labelOffset+d*p,y.y=d);var b=xa();y.transform(Zv(b,b,t.rotation));var x=n.get("nameRotate");x!=null&&(x=x*Rx/180);var w,A;H_(h)?w=Ou.innerTextLayout(t.rotation,x??t.rotation,d):(w=xIr(t.rotation,h,x||0,g),A=t.raw.axisNameAvailableWidth,A!=null&&(A=Math.abs(A/Math.sin(w.rotation)),!isFinite(A)&&(A=null)));var T=f.getFont(),S=n.get("nameTruncate",!0)||{},O=S.ellipsis,k=Pc(t.raw.nameTruncateMaxWidth,S.maxWidth,A),E=o.nameMarginLevel||0,_=new Pn({x:v.x,y:v.y,rotation:w.rotation,silent:Ou.isLabelSilent(n),style:Gi(f,{text:u,font:T,overflow:"truncate",width:k,ellipsis:O,fill:f.getTextColor()||n.get(["axisLine","lineStyle","color"]),align:f.get("align")||w.textAlign,verticalAlign:f.get("verticalAlign")||w.textVerticalAlign}),z2:1});if(uy({el:_,componentModel:n,itemName:u}),_.__fullText=u,_.anid="name",n.get("triggerEvent")){var I=Ou.makeAxisEventDataBase(n);I.targetType="axisName",I.name=u,Cr(_).eventData=I}a.add(_),_.updateTransform(),e.nameEl=_;var L=l.nameLayout=Im({label:_,priority:_.z2,defaultAttr:{ignore:_.ignore},marginDefault:H_(h)?gIr[E]:mIr[E]});if(l.nameLocation=h,i.add(_),_.decomposeTransform(),t.shouldNameMoveOverlap&&L){var R=r.ensureRecord(n);r.resolveAxisNameOverlap(t,r,n,L,y,R)}}}};function bot(t,e,r,n,i,a,s,o){Aot(e)||CIr(t,e,i,o,n,s);var l=e.labelLayoutList;OIr(t,n,l,a),_Ir(n,t.rotation,l);var u=t.optionHideOverlap;wIr(n,l,u),u&&ist(ni(l,function(h){return h&&!h.label.ignore})),vIr(t,r,n,l)}function xIr(t,e,r,n){var i=cde(r-t),a,s,o=n[0]>n[1],l=e==="start"&&!o||e!=="start"&&o;return BA(i-Rx/2)?(s=l?"bottom":"top",a="center"):BA(i-Rx*1.5)?(s=l?"top":"bottom",a="center"):(s="middle",iRx/2?a=l?"left":"right":a=l?"right":"left"),{rotation:i,textAlign:a,textVerticalAlign:s}}function wIr(t,e,r){var n=t.axis,i=t.get(["axisLabel","customValues"]);if(IDr(n))return;function a(u,h,d){var f=Im(e[h]),p=Im(e[d]),g=n.scale;if(!(!f||!p)){if(u==null){if(!r&&i)return;var m=BT(f.label).labelInfo.tick;if(b8(g)&&m.notNice||Uc(g)&&m.offInterval){e5(f.label);return}}if(u===!1||f.suggestIgnore){e5(f.label);return}if(p.suggestIgnore){e5(p.label);return}var v=.1;if(!r){var y=[0,0,0,0];f=oge({marginForce:y},f),p=oge({marginForce:y},p)}$W(f,p,null,{touchThreshold:v})&&e5(u?p.label:f.label)}}var s=t.get(["axisLabel","showMinLabel"]),o=t.get(["axisLabel","showMaxLabel"]),l=e.length;a(s,0,1),a(o,l-1,l-2)}function AIr(t,e,r){t.showMinorTicks||de(e,function(n){if(n&&n.label.ignore)for(var i=0;i=0&&x(T,w,A.getStore())})}var p=0;if(f(function(x,w,A){n.set(w.uid,1),(!i||!i.hasKey(w.uid))&&(s=!0),p+=A.count()}),(!i||i.keys().length!==n.keys().length)&&(s=!0),!s&&a!=null){e.liPosMinGap=a;return}Ege($T,p);var g=0;f(function(x,w,A){for(var T=0,S=A.count();T0&&b0?Aat:$Dr,r.serUids=n}var $T=Ege({ctor:YMr},50);function jW(t){return function(e,r){var n=sc(e,{fromStat:{key:t}});if(Bf(n.w2))return[-n.w2/2,n.w2/2]}}function FT(t){return t+_W}function zT(t,e){return t+_W+e}function Nge(t){return PIr(),{liPosMinGap:!Uc(t.scale)}}var Bm="bar",z8="pictorialBar";function Tot(t,e,r,n){jpe(t,{key:e,seriesType:r,coordSysType:n,getMetrics:Nge})}function Sot(t){var e=t.scale.rawExtentInfo.makeRenderInfo().startValue;return e}var Cot={left:0,right:0,top:0,bottom:0},XW=["25%","25%"],Jp="cartesian2d",BIr=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.mergeDefaultAndTheme=function(r,n){var i=dT(r.outerBounds);t.prototype.mergeDefaultAndTheme.apply(this,arguments),i&&r.outerBounds&&Rm(r.outerBounds,i)},e.prototype.mergeOption=function(r,n){t.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&r.outerBounds&&Rm(this.option.outerBounds,r.outerBounds)},e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"15%",top:65,right:"10%",bottom:80,containLabel:!1,outerBoundsMode:"auto",outerBounds:Cot,outerBoundsContain:"all",outerBoundsClampWidth:XW[0],outerBoundsClampHeight:XW[1],backgroundColor:et.color.transparent,borderWidth:1,borderColor:et.color.neutral30},e}(fn),$Ir=a_(),Bge="__ec_stack_";function Oot(t){return t.get("stack")||Bge+t.seriesIndex}function FIr(t){if(Uc(t.axis.scale)){for(var e=sc(t.axis),r=[],n=0;nx&&(x=b),x!==h&&(v.width=x,r-=x+u*x,n--)}}),h=(r-l)/(n+(n-1)*u),h=en(h,0);var d=0,f;de(s,function(m){var v=o[m];v.width||(v.width=h),f=v,d+=v.width*(1+u)}),f&&(d-=f.width*u);var p={},g=-d/2;return de(s,function(m){var v=o[m];p[m]=p[m]||{bandWidth:e,offset:g,width:v.width},g+=v.width*(1+u)}),p}function Eot(t){return{seriesType:t,overallReset:function(e){var r=zT(t,Jp);Ype(e,r,function(n){var i=zIr(n,t);OT(n,r,function(a){var s=i.columnMap[Oot(a)];a.getData().setLayout({bandWidth:s.bandWidth,offset:s.offset,size:s.width})})})}}}function _ot(t){return{seriesType:t,plan:yT(),reset:function(e){if(RIr(e)){var r=e.getData(),n=e.coordinateSystem,i=n.getBaseAxis(),a=n.getOtherAxis(i),s=r.getDimensionIndex(r.mapDimension(a.dim)),o=r.getDimensionIndex(r.mapDimension(i.dim)),l=e.get("showBackground",!0),u=r.mapDimension(a.dim),h=r.getCalculationInfo("stackResultDimension"),d=py(r,u)&&!!r.getCalculationInfo("stackedOnSeries"),f=a.isHorizontal(),p=a.toGlobalCoord(a.dataToCoord(Sot(a))),g=Rot(e),m=e.get("barMinHeight")||0,v=h&&r.getDimensionIndex(h),y=r.getLayout("size"),b=r.getLayout("offset");return{progress:function(x,w){for(var A=x.count,T=g&&Nm(A*3),S=g&&l&&Nm(A*3),O=g&&Nm(A),k=n.master.getRect(),E=f?k.width:k.height,_,I=w.getStore(),L=0;(_=x.next())!=null;){var R=I.get(d?v:s,_),D=I.get(o,_),M=p,P=void 0;d&&(P=+R-I.get(s,_));var N=void 0,F=void 0,B=void 0,V=void 0;if(f){var z=n.dataToPoint([R,D]);d&&(M=n.dataToPoint([P,D])[0]),N=M,F=z[1]+b,B=z[0]-M,V=y,Za(B)v){x=(T+b)/2;break}A===1&&(w=S-g[0].tickValue)}x==null&&(b?b&&(x=g[g.length-1].coord):x=g[0].coord),o[p]=f.toGlobalCoord(x)}});else{var l=this.getData(),u=l.getLayout("offset"),h=l.getLayout("size"),d=a.getBaseAxis().isHorizontal()?0:1;o[d]+=u+h/2}return o}return[NaN,NaN]},e.prototype.__requireStartValue=function(r){return this.getBaseAxis()!==r},e.type="series.__base_bar__",e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod",defaultBarGap:"10%"},e}(Ri);Ri.registerClass(U8);var QIr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.getInitialData=function(){return Dm(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},e.prototype.getProgressive=function(){return this.get("large")?this.get("progressive"):!1},e.prototype.__preparePipelineContext=function(r,n){var i=bet(this,r,n);return i.progressiveRender&&(i.large=!0),i},e.prototype.brushSelector=function(r,n,i){return i.rect(n.getItemLayout(r))},e.type="series."+Bm,e.dependencies=["grid","polar"],e.defaultOption=xx(U8.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:et.color.primary,borderWidth:2}},realtimeSort:!1}),e}(U8),GIr=function(){function t(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return t}(),KW=function(t){rt(e,t);function e(r){var n=t.call(this,r)||this;return n.type="sausage",n}return e.prototype.getDefaultShape=function(){return new GIr},e.prototype.buildPath=function(r,n){var i=n.cx,a=n.cy,s=Math.max(n.r0||0,0),o=Math.max(n.r,0),l=(o-s)*.5,u=s+l,h=n.startAngle,d=n.endAngle,f=n.clockwise,p=Math.PI*2,g=f?d-hMath.PI/2&&ho)return!0;o=d}return!1},e.prototype._isOrderDifferentInView=function(r,n){for(var i=n.scale,a=i.getExtent(),s=Math.max(0,a[0]),o=Math.min(a[1],i.getOrdinalMeta().categories.length-1);s<=o;++s)if(r.ordinalNumbers[s]!==i.getRawOrdinalNumber(s))return!0},e.prototype._updateSortWithinSameData=function(r,n,i,a){if(this._isOrderChangedWithinSameData(r,n,i)){var s=this._dataSort(r,i,n);this._isOrderDifferentInView(s,i)&&(this._removeOnRenderedListener(a),a.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",axisId:i.index,sortInfo:s}))}},e.prototype._dispatchInitSort=function(r,n,i){var a=n.baseAxis,s=this._dataSort(r,a,function(o){return r.get(r.mapDimension(n.otherAxis.dim),o)});i.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",isInitSort:!0,axisId:a.index,sortInfo:s})},e.prototype.remove=function(r,n){this._clear(this._model),this._removeOnRenderedListener(n)},e.prototype.dispose=function(r,n){this._removeOnRenderedListener(n)},e.prototype._removeOnRenderedListener=function(r){this._onRendered&&(r.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(r){var n=this.group,i=this._data;r&&r.isAnimationEnabled()&&i&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],i.eachItemGraphicEl(function(a){cy(a,r,Cr(a).dataIndex)})):n.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type=Bm,e}(Ti),Lot={cartesian2d:function(t,e){var r=e.width<0?-1:1,n=e.height<0?-1:1;r<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height);var i=t.x+t.width,a=t.y+t.height,s=$ge(e.x,t.x),o=Fge(e.x+e.width,i),l=$ge(e.y,t.y),u=Fge(e.y+e.height,a),h=oi?o:s,e.y=d&&l>a?u:l,e.width=h?0:o-s,e.height=d?0:u-l,r<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height),h||d},polar:function(t,e){var r=e.r0<=e.r?1:-1;if(r<0){var n=e.r;e.r=e.r0,e.r0=n}var i=Fge(e.r,t.r),a=$ge(e.r0,t.r0);e.r=i,e.r0=a;var s=i-a<0;if(r<0){var n=e.r;e.r=e.r0,e.r0=n}return s}},Mot={cartesian2d:function(t,e,r,n,i,a,s,o,l){var u=new tn({shape:ot({},n),z2:1});if(u.__dataIndex=r,u.name="item",a){var h=u.shape,d=i?"height":"width";h[d]=0}return u},polar:function(t,e,r,n,i,a,s,o,l){var u=!i&&l?KW:nc,h=new u({shape:n,z2:1});h.name="item";var d=Bot(i);if(h.calculateTextPosition=HIr(d,{isRoundCap:u===KW}),a){var f=h.shape,p=i?"r":"endAngle",g={};f[p]=i?n.r0:n.startAngle,g[p]=n[p],(o?Hn:ia)(h,{shape:g},a)}return h}};function qIr(t,e){var r=t.get("realtimeSort",!0),n=e.getBaseAxis();if(r&&n.type==="category"&&e.type==="cartesian2d")return{baseAxis:n,otherAxis:e.getOtherAxis(n)}}function Iot(t,e,r,n,i,a,s,o){var l,u;a?(u={x:n.x,width:n.width},l={y:n.y,height:n.height}):(u={y:n.y,height:n.height},l={x:n.x,width:n.width}),o||(s?Hn:ia)(r,{shape:l},e,i,null);var h=e?t.baseAxis.model:null;(s?Hn:ia)(r,{shape:u},h,i)}function Pot(t,e){for(var r=0;r0?1:-1,s=n.height>0?1:-1;return{x:n.x+a*i/2,y:n.y+s*i/2,width:n.width-a*i,height:n.height-s*i}},polar:function(t,e,r){var n=t.getItemLayout(e);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}}};function KIr(t){return t.startAngle!=null&&t.endAngle!=null&&t.startAngle===t.endAngle}function Bot(t){return function(e){var r=e?"Arc":"Angle";return function(n){switch(n){case"start":case"insideStart":case"end":case"insideEnd":return n+r;default:return n}}}(t)}function $ot(t,e,r,n,i,a,s,o){var l=e.getItemVisual(r,"style");if(o){if(!a.get("roundCap")){var h=t.shape,d=$m(n.getModel("itemStyle"),h,!0);ot(h,d),t.setShape(h)}}else{var u=n.get(["itemStyle","borderRadius"])||0;t.setShape("r",u)}t.useStyle(l);var f=n.getShallow("cursor");f&&t.attr("cursor",f);var p=o?s?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":s?rPr(i,a.coordinateSystem):nPr(i,a.coordinateSystem),g=So(n);qo(t,g,{labelFetcher:a,labelDataIndex:r,defaultText:Z_(a.getData(),r),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:p});var m=t.getTextContent();if(o&&m){var v=n.get(["label","position"]);t.textConfig.inside=v==="middle"?!0:null,WIr(t,v==="outside"?p:v,Bot(s),n.get(["label","rotate"]))}trt(m,g,a.getRawValue(r),function(b){return Ust(e,b)});var y=n.getModel(["emphasis"]);wa(t,y.get("focus"),y.get("blurScope"),y.get("disabled")),To(t,n),KIr(i)&&(t.style.fill="none",t.style.stroke="none",de(t.states,function(b){b.style&&(b.style.fill=b.style.stroke="none")}))}function ZIr(t,e){var r=t.get(["itemStyle","borderColor"]);if(!r||r==="none")return 0;var n=t.get(["itemStyle","borderWidth"])||0,i=isNaN(e.width)?Number.MAX_VALUE:Math.abs(e.width),a=isNaN(e.height)?Number.MAX_VALUE:Math.abs(e.height);return Math.min(n,i,a)}var JIr=function(){function t(){}return t}(),Fot=function(t){rt(e,t);function e(r){var n=t.call(this,r)||this;return n.type="largeBar",n}return e.prototype.getDefaultShape=function(){return new JIr},e.prototype.buildPath=function(r,n){for(var i=n.points,a=this.baseDimIdx,s=1-this.baseDimIdx,o=[],l=[],u=this.barWidth,h=0;h=0?r:null},30,!1);function ePr(t,e,r){for(var n=t.baseDimIdx,i=1-n,a=t.shape.points,s=t.largeDataIndices,o=[],l=[],u=t.barWidth,h=0,d=a.length/3;h=o[0]&&e<=o[0]+l[0]&&r>=o[1]&&r<=o[1]+l[1])return s[h]}return-1}function Vot(t,e,r){if(NT(r,"cartesian2d")){var n=e,i=r.getArea();return{x:t?n.x:i.x,y:t?i.y:n.y,width:t?n.width:i.width,height:t?i.height:n.height}}else{var i=r.getArea(),a=e;return{cx:i.cx,cy:i.cy,r0:t?i.r0:a.r0,r:t?i.r:a.r,startAngle:t?a.startAngle:0,endAngle:t?a.endAngle:Math.PI*2}}}function tPr(t,e,r){var n=t.type==="polar"?nc:tn;return new n({shape:Vot(e,r,t),silent:!0,z2:0})}function rPr(t,e){if(t.height===0){var r=e.getOtherAxis(e.getBaseAxis());return r.inverse?"bottom":"top"}return t.height>0?"bottom":"top"}function nPr(t,e){if(t.width===0){var r=e.getOtherAxis(e.getBaseAxis());return r.inverse?"left":"right"}return t.width>=0?"right":"left"}function iPr(t){t.registerChartView(YIr),t.registerSeriesModel(QIr),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,Eot(Bm)),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,_ot(Bm)),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,uot(Bm)),t.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(e,r){var n=e.componentType||"series";r.eachComponent({mainType:n,query:e},function(i){e.sortInfo&&i.axis.setCategorySortInfo(e.sortInfo)})}),Dot(t)}function V8(t){return{seriesType:t,reset:function(e,r){var n=r.findComponents({mainType:"legend"});if(!(!n||!n.length)){var i=e.getData();i.filterSelf(function(a){for(var s=i.getName(a),o=0;o=0},t.prototype.indexOfName=function(e){var r=this._getDataWithEncodedVisual();return r.indexOfName(e)},t.prototype.getItemVisual=function(e,r){var n=this._getDataWithEncodedVisual();return n.getItemVisual(e,r)},t}(),Dx="pie",aPr=Qr(),Qot=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new r5(Ht(this.getData,this),Ht(this.getRawData,this)),this._defaultLabelLine(r)},e.prototype.mergeOption=function(){t.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return t5(this,{coordDimensions:["value"],encodeDefaulter:qr(Ffe,this)})},e.prototype.getDataParams=function(r){var n=this.getData(),i=aPr(n),a=i.seats;if(!a){var s=[];n.each(n.mapDimension("value"),function(l){s.push(l)}),a=i.seats=net(s,n.hostModel.get("percentPrecision"))}var o=t.prototype.getDataParams.call(this,r);return o.percent=a[r]||0,o.$vars.push("percent"),o},e.prototype._defaultLabelLine=function(r){$A(r,"labelLine",["show"]);var n=r.labelLine,i=r.emphasis.labelLine;n.show=n.show&&r.label.show,i.show=i.show&&r.emphasis.label.show},e.type="series."+Dx,e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"50%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,coordinateSystemUsage:"box",left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:30,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}(Ri);e4r({fullType:Qot.type,getCoord2:function(t){return t.getShallow("center")}});var sPr=Math.PI/180;function Got(t,e,r,n,i,a,s,o,l,u){if(t.length<2)return;function h(m){for(var v=m.rB,y=v*v,b=0;br?y:v,A=Math.abs(x.label.y-r);if(A>=w.maxY){var T=x.label.x-e-x.len2*i,S=n+x.len,O=Math.abs(T)t.unconstrainedWidth?null:f:null;n.setStyle("width",p)}Wot(a,n)}}}function Wot(t,e){Yot.rect=t,rst(Yot,e,lPr)}var lPr={minMarginForce:[null,0,null,0],marginDefault:[1,0,1,0]},Yot={};function zge(t){return t.position==="center"}function cPr(t){var e=t.getData(),r=[],n,i,a=!1,s=(t.get("minShowLabelAngle")||0)*sPr,o=e.getLayout("viewRect"),l=e.getLayout("r"),u=o.width,h=o.x,d=o.y,f=o.height;function p(T){T.ignore=!0}function g(T){if(!T.ignore)return!0;for(var S in T.states)if(T.states[S].ignore===!1)return!0;return!1}e.each(function(T){var S=e.getItemGraphicEl(T),O=S.shape,k=S.getTextContent(),E=S.getTextGuideLine(),_=e.getItemModel(T),I=_.getModel("label"),L=I.get("position")||_.get(["emphasis","label","position"]),R=I.get("distanceToLabelLine"),D=I.get("alignTo"),M=Qt(I.get("edgeDistance"),u),P=I.get("bleedMargin");P==null&&(P=Math.min(u,f)>200?10:2);var N=_.getModel("labelLine"),F=N.get("length");F=Qt(F,u);var B=N.get("length2");if(B=Qt(B,u),Math.abs(O.endAngle-O.startAngle)0?"right":"left":z>0?"left":"right"}var Ce=Math.PI,Oe=0,$e=I.get("rotate");if(zn($e))Oe=$e*(Ce/180);else if(L==="center")Oe=0;else if($e==="radial"||$e===!0){var he=z<0?-V+Ce:-V;Oe=he}else if($e==="tangential"||$e==="tangential-noflip"&&L!=="outside"&&L!=="outer"){var fe=Math.atan2(z,U);fe<0&&(fe=Ce*2+fe);var Te=U>0;Te&&$e!=="tangential-noflip"&&(fe=Ce+fe),Oe=fe-Ce}if(a=!!Oe,k.x=Q,k.y=G,k.rotation=Oe,k.setStyle({verticalAlign:"middle"}),le){k.setStyle({align:Y});var Qe=k.states.select;Qe&&(Qe.x+=k.x,Qe.y+=k.y)}else{var ge=new fr(0,0,0,0);Wot(ge,k),r.push({label:k,labelLine:E,position:L,len:F,len2:B,minTurnAngle:N.get("minTurnAngle"),maxSurfaceAngle:N.get("maxSurfaceAngle"),surfaceNormal:new wr(z,U),linePoints:X,textAlign:Y,labelDistance:R,labelAlignTo:D,edgeDistance:M,bleedMargin:P,rect:ge,unconstrainedWidth:ge.width,labelStyleWidth:k.style.width})}S.setTextConfig({inside:le})}}),!a&&t.get("avoidLabelOverlap")&&oPr(r,n,i,l,u,f,h,d);for(var m=0;mN?(B=R+S*N/2,V=B):(B=R+k,V=F-k),n.setItemLayout(P,{angle:N,startAngle:B,endAngle:V,clockwise:x,cx:s,cy:o,r0:u,r:w?jn(M,T,[u,l]):l}),R=F}),I0){for(var h=s.getItemLayout(0),d=1;isNaN(h&&h.startAngle)&&d=a.r0}},e.type=Dx,e}(Ti);function pPr(t){return{seriesType:t,reset:function(e,r){var n=e.getData();n.filterSelf(function(i){var a=n.mapDimension("value"),s=n.get(a,i);return!(zn(s)&&!isNaN(s)&&s<0)})}}}function gPr(t){t.registerChartView(fPr),t.registerSeriesModel(Qot),eit(Dx,t.registerAction),t.registerLayout(uPr),t.registerProcessor(V8(Dx)),t.registerProcessor(pPr(Dx))}var mPr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.hasSymbolVisual=!0,r}return e.prototype.getInitialData=function(r,n){return Dm(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var r=this.option.progressive;return r??(this.option.large?5e3:this.get("progressive"))},e.prototype.getProgressiveThreshold=function(){var r=this.option.progressiveThreshold;return r??(this.option.large?1e4:this.get("progressiveThreshold"))},e.prototype.brushSelector=function(r,n,i){return i.point(n.getItemLayout(r))},e.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},e.type="series.scatter",e.dependencies=["grid","polar","geo","singleAxis","calendar","matrix"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:et.color.primary}},universalTransition:{divideShape:"clone"}},e}(Ri),Xot=4,vPr=function(){function t(){}return t}(),yPr=function(t){rt(e,t);function e(r){var n=t.call(this,r)||this;return n._off=0,n.hoverDataIdx=-1,n}return e.prototype.getDefaultShape=function(){return new vPr},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.beforeBrush=function(r){r&&!r.contentRetained&&this.reset()},e.prototype.buildPath=function(r,n){var i=n.points,a=n.size,s=this.symbolProxy,o=s.shape,l=r.getContext?r.getContext():r,u=l&&a[0]=0;u--){var h=u*2,d=a[h]-o/2,f=a[h+1]-l/2;if(r>=d&&n>=f&&r<=d+o&&n<=f+l)return u}return-1},e.prototype.contain=function(r,n){var i=this.transformCoordToLocal(r,n),a=this.getBoundingRect();if(r=i[0],n=i[1],a.contain(r,n)){var s=this.hoverDataIdx=this.findDataIndex(r,n);return s>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var r=this._rect;if(!r){for(var n=this.shape,i=n.points,a=n.size,s=a[0],o=a[1],l=1/0,u=1/0,h=-1/0,d=-1/0,f=0;f=0&&(u.dataIndex=d+(e.startIndex||0))})},t.prototype.remove=function(){this._clear()},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}(),xPr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){var a=r.getData(),s=this._updateSymbolDraw(a,r);s.updateData(a,Uge(r)),this._finished=!0},e.prototype.incrementalPrepareRender=function(r,n,i){var a=r.getData(),s=this._updateSymbolDraw(a,r);s.incrementalPrepareUpdate(a),this._finished=!1},e.prototype.incrementalRender=function(r,n,i){this._symbolDraw.incrementalUpdate(r,n.getData(),xm(n),Uge(n)),this._finished=r.end===n.getData().count()},e.prototype.updateTransform=function(r,n,i){var a=r.getData();if(this.group.dirty(),this._finished){var s=B8("").reset(r,n,i);s.progress&&s.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout(Uge(r))}else return{update:!0}},e.prototype.eachRendered=function(r){this._symbolDraw&&this._symbolDraw.eachRendered(r)},e.prototype._updateSymbolDraw=function(r,n){var i=this._symbolDraw,a=n.pipelineContext,s=a.large;return(!i||s!==this._isLargeDraw)&&(i&&i.remove(),i=this._symbolDraw=s?new bPr:new M8,this._isLargeDraw=s,this.group.removeAll()),this.group.add(i.group),i},e.prototype.remove=function(r,n){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(Ti);function Uge(t){return{clipShape:Kst(t)}}var Vge=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",ds).models[0]},e.type="cartesian2dAxis",e}(fn);Is(Vge,Y_);var Kot={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:"auto",onZeroAxisIndex:null,lineStyle:{color:et.color.axisLine,width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15],breakLine:!0},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12,color:et.color.axisLabel,textMargin:[0,3]},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:et.color.axisSplitLine,width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:[et.color.backgroundTint,et.color.backgroundTransparent]}},breakArea:{show:!0,itemStyle:{color:et.color.neutral00,borderColor:et.color.border,borderWidth:1,borderType:[3,3],opacity:.6},zigzagAmplitude:4,zigzagMinSpan:4,zigzagMaxSpan:20,zigzagZ:100,expandOnClick:!0},breakLabelLayout:{moveOverlap:"auto"}},wPr=Vr({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto",show:"auto"},axisLabel:{interval:"auto"}},Kot),Qge=Vr({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:et.color.axisMinorSplitLine,width:1}}},Kot),APr=Vr({splitNumber:6,axisLabel:{rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},Qge),TPr=mr({logBase:10},Qge);const Zot={category:wPr,value:Qge,time:APr,log:TPr};function n5(t,e,r,n){de(yat,function(i,a){var s=Vr(Vr({},Zot[a],!0),n,!0),o=function(l){rt(u,l);function u(){var h=l!==null&&l.apply(this,arguments)||this;return h.type=e+"Axis."+a,h}return u.prototype.mergeDefaultAndTheme=function(h,d){var f=e8(this),p=f?dT(h):{},g=d.getTheme();Vr(h,g.get(a+"Axis")),Vr(h,this.getDefaultOption()),h.type=Jot(h),f&&Rm(h,p,f)},u.prototype.optionUpdated=function(){var h=this.option;h.type==="category"&&(this.__ordinalMeta=m8.createByAxisModel(this))},u.prototype.getCategories=function(h){var d=this.option;if(d.type==="category")return h?d.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.prototype.updateAxisBreaks=function(h){var d=$8();return d?d.updateModelAxisBreak(this,h):{breaks:[]}},u.type=e+"Axis."+a,u.defaultOption=s,u}(r);t.registerComponentModel(o)}),t.registerSubTypeDefaulter(e+"Axis",Jot)}function Jot(t){return t.type||(t.data?"category":"value")}var SPr=function(){function t(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return t.prototype.getAxis=function(e){return this._axes[e]},t.prototype.getAxes=function(){return vt(this._dimList,function(e){return this._axes[e]},this)},t.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),ni(this.getAxes(),function(r){return r.scale.type===e})},t.prototype.addAxis=function(e){var r=e.dim;this._axes[r]=e,this._dimList.push(r)},t}(),rY=["x","y"];function elt(t){return(t.type==="interval"||t.type==="time")&&!NH(t)}var CPr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=Jp,r.dimensions=rY,r}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!elt(r)||!elt(n))){var i=xW(r,null),a=xW(n,null),s=this.dataToPoint([i[0],a[0]]),o=this.dataToPoint([i[1],a[1]]),l=i[1]-i[0],u=a[1]-a[0];if(!(!l||!u)){var h=(o[0]-s[0])/l,d=(o[1]-s[1])/u,f=s[0]-i[0]*h,p=s[1]-a[0]*d,g=this._transform=[h,0,0,d,f,p];this._invTransform=Cd([],g)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(r){var n=this.getAxis("x"),i=this.getAxis("y");return n.contain(n.toLocalCoord(r[0]))&&i.contain(i.toLocalCoord(r[1]))},e.prototype.containData=function(r){return this.getAxis("x").containData(r[0])&&this.getAxis("y").containData(r[1])},e.prototype.containZone=function(r,n){var i=this.dataToPoint(r),a=this.dataToPoint(n),s=this.getArea(),o=new fr(i[0],i[1],a[0]-i[0],a[1]-i[1]);return s.intersect(o)},e.prototype.dataToPoint=function(r,n,i){i=i||[];var a=r[0],s=r[1];if(this._transform&&a!=null&&isFinite(a)&&s!=null&&isFinite(s))return Ka(i,r,this._transform);var o=this.getAxis("x"),l=this.getAxis("y");return i[0]=o.toGlobalCoord(o.dataToCoord(a,n)),i[1]=l.toGlobalCoord(l.dataToCoord(s,n)),i},e.prototype.clampData=function(r,n){var i=this.getAxis("x").scale,a=this.getAxis("y").scale,s=i.getExtent(),o=a.getExtent(),l=i.parse(r[0]),u=a.parse(r[1]);return n=n||[],n[0]=Math.min(Math.max(Math.min(s[0],s[1]),l),Math.max(s[0],s[1])),n[1]=Math.min(Math.max(Math.min(o[0],o[1]),u),Math.max(o[0],o[1])),n},e.prototype.pointToData=function(r,n,i){if(i=i||[],this._invTransform)return Ka(i,r,this._invTransform);var a=this.getAxis("x"),s=this.getAxis("y");return i[0]=a.coordToData(a.toLocalCoord(r[0]),n),i[1]=s.coordToData(s.toLocalCoord(r[1]),n),i},e.prototype.getOtherAxis=function(r){return this.getAxis(r.dim==="x"?"y":"x")},e.prototype.getArea=function(r){r=r||0;var n=this.getAxis("x").getGlobalExtent(),i=this.getAxis("y").getGlobalExtent(),a=Math.min(n[0],n[1])-r,s=Math.min(i[0],i[1])-r,o=Math.max(n[0],n[1])-a+r,l=Math.max(i[0],i[1])-s+r;return new fr(a,s,o,l)},e}(SPr);function tlt(t,e){var r=t.scale,n=t.model,i=Lat(r,n,n.ecModel,t,null),a=Q_(r),s=Q_(e)?e.intervalStub:e,o=a?r.intervalStub:r,l=r.base,u=s.getTicks(),h=s.getTicks({expandToNicedExtent:!0}),d=u.length-1,f,p,g;if(d===1)f=p=0,g=1;else if(d===2){var m=Za(u[0].value-u[1].value),v=Za(u[1].value-u[2].value);f=p=0,m===v?g=2:(g=1,m=S[1])return!0})):w[1]?(k=S[1],R(function(){if(N(),L=Gn(I-E*g,_),D(),O<=S[0])return!0})):R(function(){L=Gn(MA(S[0]/E)*E,_),I=Gn(Nf(S[1]/E)*E,_);var z=mm((I-L)/E);if(z<=g){var U=g-z,Q=void 0,G=i.incl0||a;if(G&&S[0]===0)Q=[0,U];else if(G&&S[1]===0)Q=[U,0];else{var X=Nf(U/2);Q=U%2===0?[X,X]:O+k=S[1])return!0}})}wat(r,w,T,[O,k],A,{interval:E,intervalCount:g,intervalPrecision:_,niceExtent:[L,I]})}var rlt=[[3,1],[0,2]],OPr=function(){function t(e,r,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=rY,this._initCartesian(e,r,n),this.model=e}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(e,r){var n=this._axesMap;de(this._axesList,function(s){ET(s,j_);var o=s.scale;Uc(o)&&o.setSortInfo(s.model.get("categorySortInfo"))});function i(s){for(var o=kn(s),l=[],u=o.length-1;u>=0;u--){var h=s[+o[u]];h.__alignTo?l.push(h):X_(h)}de(l,function(d){EPr(d,d.__alignTo)?X_(d):tlt(d,d.__alignTo.scale)})}i(n.x),i(n.y);var a={};de(n.x,function(s){nlt(n,"y",s,a)}),de(n.y,function(s){nlt(n,"x",s,a)}),this.resize(this.model,r)},t.prototype.resize=function(e,r,n){var i=Co(e,r),a=this._rect=da(e.getBoxLayoutParams(),i.refContainer),s=this._axesMap,o=this._coordsList,l=e.get("containLabel");if(Gge(s,a),!n){var u=DPr(a,o,s,l,r),h=void 0;if(l)Hge?(Hge(this._axesList,a),Gge(s,a)):h=olt(a.clone(),"axisLabel",null,a,s,u,i);else{var d=LPr(e,a,i),f=d.outerBoundsRect,p=d.parsedOuterBoundsContain,g=d.outerBoundsClamp;f&&(h=olt(f,p,g,a,s,u,i))}llt(a,s,Xp.determine,null,h,i),de(this._coordsList,function(m){m.calcAffineTransform()})}},t.prototype.getAxis=function(e,r){var n=this._axesMap[e];if(n!=null)return n[r||0]},t.prototype.getAxes=function(){return this._axesList.slice()},t.prototype.getCartesian=function(e,r){if(e!=null&&r!=null){var n="x"+e+"y"+r;return this._coordsMap[n]}yr(e)&&(r=e.yAxisIndex,e=e.xAxisIndex);for(var i=0,a=this._coordsList;i=0;i--){var a=t[+e[i]];lat(a.scale)&&xat(a.model,a.type,!0)==null&&(a.model.get("alignTicks")&&a.model.get("interval")==null?n.push(a):r=a)}r||(r=n.pop()),r&&de(n,function(s){s.__alignTo=r})}function EPr(t,e){return NH(t.scale)||NH(e.scale)||e.scale.getTicks().length<2}function _Pr(t,e){var r=t.getExtent(),n=r[0]+r[1];t.toGlobalCoord=t.dim==="x"?function(i){return i+e}:function(i){return n-i+e},t.toLocalCoord=t.dim==="x"?function(i){return i-e}:function(i){return n-i+e}}function Gge(t,e){de(t.x,function(r){return slt(r,e.x,e.width)}),de(t.y,function(r){return slt(r,e.y,e.height)})}function slt(t,e,r){var n=[0,r],i=t.inverse?1:0;t.setExtent(n[i],n[1-i]),_Pr(t,e)}var Hge;function RPr(t){Hge=t}function olt(t,e,r,n,i,a,s){llt(n,i,Xp.estimate,e,!1,s);var o=[0,0,0,0];u(0),u(1),h(n,0,NaN),h(n,1,NaN);var l=Wv(o,function(f){return f>0})==null;return aT(n,o,!0,!0,r),Gge(i,n),l;function u(f){de(i[Mr[f]],function(p){if(T8(p.model)){var g=a.ensureRecord(p.model),m=g.labelInfoList;if(m)for(var v=0;v0&&!Jl(p)&&p>1e-4&&(f/=p),f}}function DPr(t,e,r,n,i){var a=new got(MPr);return de(r,function(s){return de(s,function(o){if(T8(o.model)){var l=!n;o.axisBuilder=LIr(t,e,o.model,i,a,l)}})}),a}function llt(t,e,r,n,i,a){var s=r===Xp.determine;de(e,function(u){return de(u,function(h){T8(h.model)&&(MIr(h.axisBuilder,t,h.model),h.axisBuilder.build(s?{axisTickLabelDetermine:!0}:{axisTickLabelEstimate:!0},{noPxChange:i}))})});var o={x:0,y:0};l(0),l(1);function l(u){o[Mr[1-u]]=t[xs[u]]<=a.refContainer[xs[u]]*.5?0:1-u===1?2:1}de(e,function(u,h){return de(u,function(d){T8(d.model)&&((n==="all"||s)&&d.axisBuilder.build({axisName:!0},{nameMarginLevel:o[h]}),s&&d.axisBuilder.build({axisLine:!0}))})})}function LPr(t,e,r){var n,i=t.get("outerBoundsMode",!0);i==="same"?n=e.clone():(i==null||i==="auto")&&(n=da(t.get("outerBounds",!0)||Cot,r.refContainer));var a=t.get("outerBoundsContain",!0),s;a==null||a==="auto"||Ir(["all","axisLabel"],a)<0?s="all":s=a;var o=[KG(Jt(t.get("outerBoundsClampWidth",!0),XW[0]),e.width),KG(Jt(t.get("outerBoundsClampHeight",!0),XW[1]),e.height)];return{outerBoundsRect:n,parsedOuterBoundsContain:s,outerBoundsClamp:o}}var MPr=function(t,e,r,n,i,a){var s=r.axis.dim==="x"?"y":"x";mot(t,e,r,n,i,a),H_(t.nameLocation)||de(e.recordMap[s],function(o){o&&o.labelInfoList&&o.dirVec&&yot(o.labelInfoList,o.dirVec,n,i)})};function IPr(t,e){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return PPr(r,t,e),r.seriesInvolved&&BPr(r,t),r}function PPr(t,e,r){var n=e.getComponent("tooltip"),i=e.getComponent("axisPointer"),a=i.get("link",!0)||[],s=[];de(r.getCoordinateSystems(),function(o){if(!o.axisPointerEnabled)return;var l=Q8(o.model),u=t.coordSysAxesInfo[l]={};t.coordSysMap[l]=o;var h=o.model,d=h.getModel("tooltip",n);if(de(o.getAxes(),qr(m,!1,null)),o.getTooltipAxes&&n&&d.get("show")){var f=d.get("trigger")==="axis",p=d.get(["axisPointer","type"])==="cross",g=o.getTooltipAxes(d.get(["axisPointer","axis"]));(f||p)&&de(g.baseAxes,qr(m,p?"cross":!0,f)),p&&de(g.otherAxes,qr(m,"cross",!1))}function m(v,y,b){var x=b.model.getModel("axisPointer",i),w=x.get("show");if(!(!w||w==="auto"&&!v&&!qge(x))){y==null&&(y=x.get("triggerTooltip")),x=v?NPr(b,d,i,e,v,y):x;var A=x.get("snap"),T=x.get("triggerEmphasis"),S=Q8(b.model),O=y||A||b.type==="category",k=t.axesInfo[S]={key:S,axis:b,coordSys:o,axisPointerModel:x,triggerTooltip:y,triggerEmphasis:T,involveSeries:O,snap:A,useHandle:qge(x),seriesModels:[],linkGroup:null};u[S]=k,t.seriesInvolved=t.seriesInvolved||O;var E=$Pr(a,b);if(E!=null){var _=s[E]||(s[E]={axesInfo:{}});_.axesInfo[S]=k,_.mapper=a[E].mapper,k.linkGroup=_}}}})}function NPr(t,e,r,n,i,a){var s=e.getModel("axisPointer"),o=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};de(o,function(f){l[f]=lr(s.get(f))}),l.snap=t.type!=="category"&&!!a,s.get("type")==="cross"&&(l.type="line");var u=l.label||(l.label={});if(u.show==null&&(u.show=!1),i==="cross"){var h=s.get(["label","show"]);if(u.show=h??!0,!a){var d=l.lineStyle=s.get("crossStyle");d&&mr(u,d.textStyle)}}return t.model.getModel("axisPointer",new yn(l,r,n))}function BPr(t,e){e.eachSeries(function(r){var n=r.coordinateSystem,i=r.get(["tooltip","trigger"],!0),a=r.get(["tooltip","show"],!0);!n||!n.model||i==="none"||i===!1||i==="item"||a===!1||r.get(["axisPointer","show"],!0)===!1||de(t.coordSysAxesInfo[Q8(n.model)],function(s){var o=s.axis;n.getAxis(o.dim)===o&&(s.seriesModels.push(r),s.seriesDataCount==null&&(s.seriesDataCount=0),s.seriesDataCount+=r.getData().count())})})}function $Pr(t,e){for(var r=e.model,n=e.dim,i=0;i=0||t===e}function FPr(t){var e=Yge(t);if(e){var r=e.axisPointerModel,n=e.axis.scale,i=r.option,a=r.get("status"),s=r.get("value");s!=null&&(s=n.parse(s));var o=qge(r);a==null&&(i.status=o?"show":"hide");var l=n.getExtent();(s==null||s>l[1])&&(s=l[1]),s0;return s&&o}var YPr=Qr();function mlt(t,e,r,n){if(t instanceof hot){var i=t.scale.type;if(i!=="ordinal")return r}var a=t.model,s=a.get("jitter");if(!(s>0))return r;var o=a.get("jitterOverlap"),l=a.get("jitterMargin")||0,u=Uc(t.scale)?sc(t).w:null;return o?vlt(r,s,u,n):qPr(t,e,r,n,s,l)}function vlt(t,e,r,n){if(r===null)return t+(Math.random()-.5)*e;var i=r-n*2,a=Math.min(Math.max(0,e),i);return t+(Math.random()-.5)*a}function qPr(t,e,r,n,i,a){var s=YPr(t);s.items||(s.items=[]);var o=s.items,l=ylt(o,e,r,n,i,a,1),u=ylt(o,e,r,n,i,a,-1),h=Math.abs(l-r)i/2||d&&f>d/2-n?vlt(r,i,d,n):(o.push({fixedCoord:e,floatCoord:h,r:n}),h)}function ylt(t,e,r,n,i,a,s){for(var o=r,l=0;li/2)return Number.MAX_VALUE;if(s===1&&g>o||s===-1&&g0&&!m.min?m.min=0:m.min!=null&&m.min<0&&!m.max&&(m.max=0);var v=u;m.color!=null&&(v=mr({color:m.color},u));var y=Vr(lr(m),{boundaryGap:r,splitNumber:n,clockwise:i,scale:a,axisLine:s,axisTick:o,axisLabel:l,name:m.text,showName:h,nameLocation:"end",nameGap:f,nameTextStyle:v,triggerEvent:p},!1);if(Nt(d)){var b=y.name;y.name=d.replace("{value}",b??"")}else ur(d)&&(y.name=d(y.name,y));var x=new yn(y,null,this.ecModel);return Is(x,Y_.prototype),x.mainType="radar",x.componentIndex=this.componentIndex,x.uid=lT("ec_radar"),x},this);this._indicatorModels=g},e.prototype.getIndicatorModels=function(){return this._indicatorModels},e.type=blt,e.defaultOption={z:0,center:["50%","50%"],radius:"50%",startAngle:90,clockwise:!1,axisName:{show:!0,color:et.color.axisLabel},boundaryGap:[0,0],splitNumber:xlt,axisNameGap:15,scale:!1,shape:"polygon",axisLine:Vr({lineStyle:{color:et.color.neutral20}},H8.axisLine),axisLabel:aY(H8.axisLabel,!1),axisTick:aY(H8.axisTick,!1),splitLine:aY(H8.splitLine,!0),splitArea:aY(H8.splitArea,!0),indicator:[]},e}(fn),n6r=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){var a=this.group;a.removeAll(),this._buildAxes(r,i),this._buildSplitLineAndArea(r)},e.prototype._buildAxes=function(r,n){var i=r.coordinateSystem,a=i.getIndicatorAxes(),s=vt(a,function(o){var l=o.model.get("showName")?o.name:"",u=new Ou(o.model,n,{axisName:l,position:[i.cx,i.cy],rotation:o.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return u});de(s,function(o){o.build(),this.group.add(o.group)},this)},e.prototype._buildSplitLineAndArea=function(r){var n=r.coordinateSystem,i=n.getIndicatorAxes();if(!i.length)return;var a=r.get("shape"),s=r.getModel("splitLine"),o=r.getModel("splitArea"),l=s.getModel("lineStyle"),u=o.getModel("areaStyle"),h=s.get("show"),d=o.get("show"),f=l.get("color"),p=u.get("color"),g=ft(f)?f:[f],m=ft(p)?p:[p],v=[],y=[];function b(D,M,P){var N=P%M.length;return D[N]=D[N]||[],N}if(a==="circle")for(var x=i[0].getTicksCoords(),w=n.cx,A=n.cy,T=0;T3?1.4:s>1?1.2:1.1,h=a>0?u:1/u;this._checkTriggerMoveZoom(this,"zoom","zoomOnMouseWheel",r,{scale:h,originX:o,originY:l,isAvailableBehavior:null})}if(i){var d=Math.abs(a),f=(a>0?1:-1)*(d>3?.4:d>1?.15:.05);this._checkTriggerMoveZoom(this,"scrollMove","moveOnMouseWheel",r,{scrollDelta:f,originX:o,originY:l,isAvailableBehavior:null})}}}},e.prototype._pinchHandler=function(r){if(!(Tlt(this._zr,"globalPan")||Y8(r))){var n=r.pinchScale>1?1.1:1/1.1;this._checkTriggerMoveZoom(this,"zoom",null,r,{scale:n,originX:r.pinchX,originY:r.pinchY,isAvailableBehavior:null})}},e.prototype._checkTriggerMoveZoom=function(r,n,i,a,s){r._checkPointer(a,s.originX,s.originY)&&(Kv(a.event),a.__ecRoamConsumed=!0,Clt(r,n,i,a,s))},e}(Df);function Y8(t){return t.__ecRoamConsumed}var f6r=Qr();function sY(t){var e=f6r(t);return e.roam=e.roam||{},e.uniform=e.uniform||{},e}function q8(t,e,r,n){for(var i=sY(t),a=i.roam,s=a[e]=a[e]||[],o=0;o=4&&(h={x:parseFloat(f[0]||0),y:parseFloat(f[1]||0),width:parseFloat(f[2]),height:parseFloat(f[3])})}if(h&&o!=null&&l!=null&&(d=Nlt(h,{x:0,y:0,width:o,height:l}),!r.ignoreViewBox)){var p=i;i=new pr,i.add(p),p.scaleX=p.scaleY=d.scale,p.x=d.x,p.y=d.y}return!r.ignoreRootClip&&o!=null&&l!=null&&i.setClipPath(new tn({shape:{x:0,y:0,width:o,height:l}})),{root:i,width:o,height:l,viewBoxRect:h,viewBoxTransform:d,named:a}},t.prototype._parseNode=function(e,r,n,i,a,s){var o=e.nodeName.toLowerCase(),l,u=i;if(o==="defs"&&(a=!0),o==="text"&&(s=!0),o==="defs"||o==="switch")l=r;else{if(!a){var h=Zge[o];if(h&&Kt(Zge,o)){l=h.call(this,e,r);var d=e.getAttribute("name");if(d){var f={name:d,namedFrom:null,svgNodeTagLower:o,el:l};n.push(f),o==="g"&&(u=f)}else i&&n.push({name:i.name,namedFrom:i,svgNodeTagLower:o,el:l});r.add(l)}}var p=_lt[o];if(p&&Kt(_lt,o)){var g=p.call(this,e),m=e.getAttribute("id");m&&(this._defs[m]=g)}}if(l&&l.isGroup)for(var v=e.firstChild;v;)v.nodeType===1?this._parseNode(v,l,n,u,a,s):v.nodeType===3&&s&&this._parseText(v,l),v=v.nextSibling},t.prototype._parseText=function(e,r){var n=new s_({style:{text:e.textContent},silent:!0,x:this._textX||0,y:this._textY||0});qf(r,n),Md(e,n,this._defsUsePending,!1,!1),v6r(n,r);var i=n.style,a=i.fontSize;a&&a<9&&(i.fontSize=9,n.scaleX*=a/9,n.scaleY*=a/9);var s=(i.fontSize||i.fontFamily)&&[i.fontStyle,i.fontWeight,(i.fontSize||12)+"px",i.fontFamily||"sans-serif"].join(" ");i.font=s;var o=n.getBoundingRect();return this._textX+=o.width,r.add(n),n},t.internalField=function(){Zge={g:function(e,r){var n=new pr;return qf(r,n),Md(e,n,this._defsUsePending,!1,!1),n},rect:function(e,r){var n=new tn;return qf(r,n),Md(e,n,this._defsUsePending,!1,!1),n.setShape({x:parseFloat(e.getAttribute("x")||"0"),y:parseFloat(e.getAttribute("y")||"0"),width:parseFloat(e.getAttribute("width")||"0"),height:parseFloat(e.getAttribute("height")||"0")}),n.silent=!0,n},circle:function(e,r){var n=new Em;return qf(r,n),Md(e,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),r:parseFloat(e.getAttribute("r")||"0")}),n.silent=!0,n},line:function(e,r){var n=new Ps;return qf(r,n),Md(e,n,this._defsUsePending,!1,!1),n.setShape({x1:parseFloat(e.getAttribute("x1")||"0"),y1:parseFloat(e.getAttribute("y1")||"0"),x2:parseFloat(e.getAttribute("x2")||"0"),y2:parseFloat(e.getAttribute("y2")||"0")}),n.silent=!0,n},ellipse:function(e,r){var n=new FN;return qf(r,n),Md(e,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),rx:parseFloat(e.getAttribute("rx")||"0"),ry:parseFloat(e.getAttribute("ry")||"0")}),n.silent=!0,n},polygon:function(e,r){var n=e.getAttribute("points"),i;n&&(i=Llt(n));var a=new ic({shape:{points:i||[]},silent:!0});return qf(r,a),Md(e,a,this._defsUsePending,!1,!1),a},polyline:function(e,r){var n=e.getAttribute("points"),i;n&&(i=Llt(n));var a=new Al({shape:{points:i||[]},silent:!0});return qf(r,a),Md(e,a,this._defsUsePending,!1,!1),a},image:function(e,r){var n=new Yo;return qf(r,n),Md(e,n,this._defsUsePending,!1,!1),n.setStyle({image:e.getAttribute("xlink:href")||e.getAttribute("href"),x:+e.getAttribute("x"),y:+e.getAttribute("y"),width:+e.getAttribute("width"),height:+e.getAttribute("height")}),n.silent=!0,n},text:function(e,r){var n=e.getAttribute("x")||"0",i=e.getAttribute("y")||"0",a=e.getAttribute("dx")||"0",s=e.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(a),this._textY=parseFloat(i)+parseFloat(s);var o=new pr;return qf(r,o),Md(e,o,this._defsUsePending,!1,!0),o},tspan:function(e,r){var n=e.getAttribute("x"),i=e.getAttribute("y");n!=null&&(this._textX=parseFloat(n)),i!=null&&(this._textY=parseFloat(i));var a=e.getAttribute("dx")||"0",s=e.getAttribute("dy")||"0",o=new pr;return qf(r,o),Md(e,o,this._defsUsePending,!1,!0),this._textX+=parseFloat(a),this._textY+=parseFloat(s),o},path:function(e,r){var n=e.getAttribute("d")||"",i=Ett(n);return qf(r,i),Md(e,i,this._defsUsePending,!1,!1),i.silent=!0,i}}}(),t}(),_lt={lineargradient:function(t){var e=parseInt(t.getAttribute("x1")||"0",10),r=parseInt(t.getAttribute("y1")||"0",10),n=parseInt(t.getAttribute("x2")||"10",10),i=parseInt(t.getAttribute("y2")||"0",10),a=new tT(e,r,n,i);return Rlt(t,a),Dlt(t,a),a},radialgradient:function(t){var e=parseInt(t.getAttribute("cx")||"0",10),r=parseInt(t.getAttribute("cy")||"0",10),n=parseInt(t.getAttribute("r")||"0",10),i=new rfe(e,r,n);return Rlt(t,i),Dlt(t,i),i}};function Rlt(t,e){var r=t.getAttribute("gradientUnits");r==="userSpaceOnUse"&&(e.global=!0)}function Dlt(t,e){for(var r=t.firstChild;r;){if(r.nodeType===1&&r.nodeName.toLocaleLowerCase()==="stop"){var n=r.getAttribute("offset"),i=void 0;n&&n.indexOf("%")>0?i=parseInt(n,10)/100:n?i=parseFloat(n):i=0;var a={};Plt(r,a,a);var s=a.stopColor||r.getAttribute("stop-color")||"#000000",o=a.stopOpacity||r.getAttribute("stop-opacity");if(o){var l=Bc(s),u=l&&l[3];u&&(l[3]*=Jv(o),s=Pf(l,"rgba"))}e.colorStops.push({offset:i,color:s})}r=r.nextSibling}}function qf(t,e){t&&t.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),mr(e.__inheritedStyle,t.__inheritedStyle))}function Llt(t){for(var e=uY(t),r=[],n=0;n0;a-=2){var s=n[a],o=n[a-1],l=uY(s);switch(i=i||xa(),o){case"translate":zp(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":bG(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":Zv(i,i,-parseFloat(l[0])*Jge,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":var u=Math.tan(parseFloat(l[0])*Jge);Sd(i,[1,0,u,1,0,0],i);break;case"skewY":var h=Math.tan(parseFloat(l[0])*Jge);Sd(i,[1,h,0,1,0,0],i);break;case"matrix":i[0]=parseFloat(l[0]),i[1]=parseFloat(l[1]),i[2]=parseFloat(l[2]),i[3]=parseFloat(l[3]),i[4]=parseFloat(l[4]),i[5]=parseFloat(l[5]);break}}e.setLocalTransform(i)}}var Ilt=/([^\s:;]+)\s*:\s*([^:;]+)/g;function Plt(t,e,r){var n=t.getAttribute("style");if(n){Ilt.lastIndex=0;for(var i;(i=Ilt.exec(n))!=null;){var a=i[1],s=Kt(lY,a)?lY[a]:null;s&&(e[s]=i[2]);var o=Kt(cY,a)?cY[a]:null;o&&(r[o]=i[2])}}}function T6r(t,e,r){for(var n=0;n1e-6;Z8[0]=s?(i[0]-n.x)/a:i[0],Z8[1]=s?(i[1]-n.y)/a:i[1],Ka(Z8,Z8,t.mtRawInv);var o=q6r(t,Z8);Zlt(e,o,a),de(r,function(l){l!==e&&Zlt(l,o.slice(),a)})}var Z8=[];function Zlt(t,e,r){var n=t.option;n.center=e,n.zoom=r}function lme(t,e){if(e){var r=e.min||0,n=e.max||1/0;t=Math.max(Math.min(n,t),r)}return t}function Jlt(t,e){var r=e.getShallow("nodeScaleRatio",!0)||1,n=t;return((n.zoom-1)*r+1)/(n.trans[Fm].scaleX||1)}function bY(t,e,r,n,i,a,s,o){var l=yY(t);if(!l){r.disable();return}r.enable(Jt(t.get("roam"),s),{api:e,zInfo:{component:t},triggerInfo:{roamTrigger:t.get("roamTrigger"),isInSelf:n,isInClip:function(h,d,f){return!i||i.contain(d,f)}}});function u(h){var d=t.mainType,f=ffe(mr({type:tct(d,t.subType,ett)},h));o&&(f.componentType=d),f[d+"Id"]=t.id,e.dispatchAction(f)}r.off("pan").off("zoom").on("pan",function(h){a&&a("pan"),u({dx:h.dx,dy:h.dy})}).on("zoom",function(h){a&&a("zoom"),u({zoom:h.scale,originX:h.originX,originY:h.originY})})}function ect(t){return function(e,r,n){return cme.copy(t.getBoundingRect()),cme.applyTransform(t.getComputedTransform()),cme.contain(r,n)}}var cme=new fr(0,0,0,0);function ume(t,e,r){var n=tct(e,r,ett);t.registerAction({type:n,event:n,update:"none"},function(i,a,s){a.eachComponent(mde(i,e,r),function(o){Ylt(i,o),qlt(i,o,a,s)})})}function tct(t,e,r){return(t!==km?t:e==="map"?"geo":e)+r}function rct(t){return t.zoom!=null}function hme(t,e,r,n,i,a,s){var o=new hY(null,Klt(t.ecModel,e));return gY(o,r,n,i,a),s?mY(o,s.x,s.y,s.width,s.height):mY(o,r,n,i,a),nme(o,t),o}var dme=["rect","circle","line","ellipse","polygon","polyline","path"],X6r=Yt(dme),K6r=Yt(dme.concat(["g"])),Z6r=Yt(dme.concat(["g"])),nct=Qr();function xY(t){var e=t.getItemStyle(),r=t.get("areaColor");return r!=null&&(e.fill=r),e}function ict(t){var e=t.style;e&&(e.stroke=e.stroke||e.fill,e.fill=null)}var act=function(){function t(e){var r=this.group=new pr,n=this._transformGroup=new pr;r.add(n),this.uid=lT("ec_map_draw"),this._controller=new VT(e.getZr()),n.add(this._regionsGroup=new pr),n.add(this._svgGroup=new pr)}return t.prototype.draw=function(e,r,n,i,a){var s=this,o=e.getData&&e.getData();a5(e)&&r.eachComponent({mainType:"series",subType:"map"},function(m){!o&&m.getHostGeoModel()===e&&(o=m.getData())});var l=e.coordinateSystem,u=l.view,h=this._regionsGroup,d=this._transformGroup,f=!h.childAt(0)||a,p;l.shouldClip()?(p=tme(null,u),this.group.setClipPath(new tn({shape:p.clone()}))):this.group.removeClipPath(),Lx(d,WT,u,f?null:e);var g=o&&o.getVisual("visualMeta")&&o.getVisual("visualMeta").length>0;l.resourceType==="geoJSON"?this._buildGeoJSON(u,n,l,e,o,g):l.resourceType==="geoSVG"&&this._buildSVG(u,n,l,e,o,g),bY(e,n,this._controller,function(m,v,y){return e.coordinateSystem.containPoint([v,y])},p,function(){s._mouseDownFlag=!1},!1,!0),this._updateMapSelectHandler(e,h,n,i)},t.prototype.__updateOnOwnRoam=function(e){Lx(this._transformGroup,WT,e.coordinateSystem.view,null)},t.prototype._buildGeoJSON=function(e,r,n,i,a,s){var o=this._regionsGroupByName=Yt(),l=Yt(),u=this._regionsGroup,h=n.projection,d=h&&h.stream,f=ux(K8(null,e,HT));function p(v,y){return y&&(v=y(v)),v&&Ka([],v,f)}function g(v){for(var y=[],b=!d&&h&&h.project,x=0;x=0)&&(h=t);var d=s?{normal:{align:"center",verticalAlign:"middle"}}:null;qo(r,So(i),{labelFetcher:h,labelDataIndex:u,defaultText:n},d);var f=r.getTextContent();if(f&&(nct(f).ignore=f.ignore,r.textConfig&&s)){var p=r.getBoundingRect().clone();r.textConfig.layoutRect=p,r.textConfig.position=[(s[0]-p.x)/p.width*100+"%",(s[1]-p.y)/p.height*100+"%"]}r.disableLabelAnimation=!0}else r.removeTextContent(),r.removeTextConfig(),r.disableLabelAnimation=null}function lct(t,e,r,n,i,a){e?e.setItemGraphicEl(a,r):Cr(r).eventData={componentType:"geo",componentIndex:t.componentIndex,geoIndex:t.componentIndex,name:n,region:i&&i.option||{}}}function cct(t,e,r,n,i){e||uy({el:r,componentModel:t,itemName:n,itemTooltipOption:i.get("tooltip")})}function uct(t,e,r,n){e.highDownSilentOnTouch=!!t.get("selectedMode");var i=n.getModel("emphasis"),a=i.get("focus");return wa(e,a,i.get("blurScope"),i.get("disabled")),a5(t)&&Q_r(e,t,r),a}function hct(t,e,r){var n=[],i;function a(){i=[]}function s(){i.length&&(n.push(i),i=[])}var o=e({polygonStart:a,polygonEnd:s,lineStart:a,lineEnd:s,point:function(l,u){isFinite(l)&&isFinite(u)&&i.push([l,u])},sphere:function(){}});return!r&&o.polygonStart(),de(t,function(l){o.lineStart();for(var u=0;u-1&&(i.style.stroke=i.style.fill,i.style.fill=et.color.neutral00,i.style.lineWidth=2),i},e.prototype.__ownRoamView=function(){return wY(this)?this.coordinateSystem.view:null},e.type="series."+YT,e.dependencies=["geo"],e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:et.color.tertiary},itemStyle:{borderWidth:.5,borderColor:et.color.border,areaColor:et.color.background},emphasis:{label:{show:!0,color:et.color.primary},itemStyle:{areaColor:et.color.highlight}},select:{label:{show:!0,color:et.color.primary},itemStyle:{color:et.color.highlight}},nameProperty:"name"},e}(Ri);function dct(t){return t.indexOf("i")===0}function wY(t){return J8(t.seriesGroup)===t&&!t.getHostGeoModel()}function J8(t){return t.f[0]}function fme(t,e){var r={};return t.eachRawSeriesByType(YT,function(n){var i=n.getHostGeoModel(),a=i?"o"+i.id:"i"+n.getMapType(),s=r[a]=r[a]||{f:[],r:[]};!t.isSeriesFiltered(n)&&!e&&s.f.push(n),s.r.push(n)}),r}var eNr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=YT,r}return e.prototype.render=function(r,n,i,a){if(!(a&&a.type==="mapToggleSelect"&&a.from===this.uid)){var s=this.group;if(s.removeAll(),!r.getHostGeoModel()){var o=this._mapDraw;o&&a&&a.type==="geoRoam"&&o.resetForLabelLayout(),a&&a.type==="geoRoam"&&a.componentType==="series"&&a.seriesId===r.id?o&&s.add(o.group):wY(r)?(o=o||(this._mapDraw=new act(i)),s.add(o.group),o.draw(r,n,i,this,a)):this._clearMapDraw(),r.get("showLegendSymbol")&&n.getComponent("legend")&&this._renderSymbols(r)}}},e.prototype.__updateOnOwnRoam=function(r,n,i){var a=this._mapDraw;wY(n)&&a&&a.__updateOnOwnRoam(n)},e.prototype.remove=function(){this._clearMapDraw(),this.group.removeAll()},e.prototype.dispose=function(){this._clearMapDraw()},e.prototype._clearMapDraw=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},e.prototype._renderSymbols=function(r){var n=r.originalData,i=this.group;n.each(n.mapDimension("value"),function(a,s){if(!isNaN(a)){var o=n.getItemLayout(s);if(!(!o||!o.point)){var l=o.point,u=o.offset,h=new Em({style:{fill:r.getData().getVisual("style").fill},shape:{cx:l[0]+u*9,cy:l[1],r:3},silent:!0,z2:8+(u?0:c_+1)});if(!u){var d=J8(r.seriesGroup).getData(),f=n.getName(s),p=d.indexOfName(f),g=n.getItemModel(s),m=g.getModel("label"),v=d.getItemGraphicEl(p);qo(h,So(g),{labelFetcher:{getFormattedLabel:function(y,b){return r.getFormattedLabel(p,b)}},defaultText:f}),h.disableLabelAnimation=!0,m.get("position")||h.setTextConfig({position:"bottom"}),v.onHoverStateChange=function(y){yH(h,y)}}i.add(h)}}})},e.type=YT,e}(Ti),tNr={geoJSON:{aspectScale:.75,invertLongitute:!0},geoSVG:{aspectScale:1,invertLongitute:!1}},fct=["lng","lat"],pct=function(t){rt(e,t);function e(r,n,i){var a=t.call(this)||this;a.dimensions=fct,a.type="geo",a._nameCoordMap=Yt(),a.name=r;var s=i.projection,o=vy.load(n,i.nameMap,i.nameProperty),l=vy.getGeoResource(n);a.resourceType=l?l.type:null;var u=a.regions=o.regions,h=tNr[l.type];a._clip=i.clip;var d=s?!1:h.invertLongitute;a.view=new hY(d,Klt(i.ecModel,i.api),a),a.map=n,a._regionsMap=o.regionsMap,a.regions=o.regions,a.projection=s;var f;if(s)for(var p=0;p1?(w.width=x,w.height=x/v):(w.height=x,w.width=x*v),w.y=b[1]-w.height/2,w.x=b[0]-w.width/2;else{var A=t.getBoxLayoutParams();A.aspect=v,w=da(A,m),w=Ert(t,w,v)}mY(r,w.x,w.y,w.width,w.height),nme(r,t)}function rNr(t,e){de(e.get("geoCoord"),function(r,n){t.addGeoCoord(n,r)})}var nNr=function(){function t(){this.dimensions=fct}return t.prototype.create=function(e,r){var n=[];function i(a){return{nameProperty:a.get("nameProperty"),aspectScale:a.get("aspectScale"),projection:a.get("projection"),clip:a.getShallow("clip",!0)}}return e.eachComponent("geo",function(a,s){var o=a.get("map"),l=new pct(o+s,o,ot({nameMap:a.get("nameMap"),api:r,ecModel:e},i(a)));n.push(l),a.coordinateSystem=l,l.model=a,l.resize=mct,l.resize(a,r)}),e.eachSeries(function(a){ZN({targetModel:a,coordSysType:"geo",coordSysProvider:function(){var s=a.subType===YT?a.getHostGeoModel():a.getReferringComponents("geo",ds).models[0];return s&&s.coordinateSystem},allowNotFound:!0})}),de(fme(e,!0),function(a,s){if(dct(s)){var o=a.r[0],l=[];de(a.r,function(f){l.push(f.get("nameMap")),f.seriesGroup=null});var u=s.slice(1),h=new pct(u,u,ot({nameMap:fG(l),api:r,ecModel:e},i(o))),d;de(a.r,function(f){d=Jt(d,f.get("scaleLimit"))}),n.push(h),h.resize=mct,h.resize(o,r),de(a.r,function(f){f.coordinateSystem=h,rNr(h,f)})}}),n},t.prototype.getFilledRegions=function(e,r,n,i){for(var a=(e||[]).slice(),s=Yt(),o=0;o=0;s--){var o=i[s];o.hierNode={defaultAncestor:null,ancestor:o,prelim:0,modifier:0,change:0,shift:0,i:s,thread:null},r.push(o)}}function pNr(t,e){var r=t.isExpand?t.children:[],n=t.parentNode.children,i=t.hierNode.i?n[t.hierNode.i-1]:null;if(r.length){mNr(t);var a=(r[0].hierNode.prelim+r[r.length-1].hierNode.prelim)/2;i?(t.hierNode.prelim=i.hierNode.prelim+e(t,i),t.hierNode.modifier=t.hierNode.prelim-a):t.hierNode.prelim=a}else i&&(t.hierNode.prelim=i.hierNode.prelim+e(t,i));t.parentNode.hierNode.defaultAncestor=vNr(t,i,t.parentNode.hierNode.defaultAncestor||n[0],e)}function gNr(t){var e=t.hierNode.prelim+t.parentNode.hierNode.modifier;t.setLayout({x:e},!0),t.hierNode.modifier+=t.parentNode.hierNode.modifier}function bct(t){return arguments.length?t:xNr}function eB(t,e){return t-=Math.PI/2,{x:e*Math.cos(t),y:e*Math.sin(t)}}function mNr(t){for(var e=t.children,r=e.length,n=0,i=0;--r>=0;){var a=e[r];a.hierNode.prelim+=n,a.hierNode.modifier+=n,i+=a.hierNode.change,n+=a.hierNode.shift+i}}function vNr(t,e,r,n){if(e){for(var i=t,a=t,s=a.parentNode.children[0],o=e,l=i.hierNode.modifier,u=a.hierNode.modifier,h=s.hierNode.modifier,d=o.hierNode.modifier;o=pme(o),a=gme(a),o&&a;){i=pme(i),s=gme(s),i.hierNode.ancestor=t;var f=o.hierNode.prelim+d-a.hierNode.prelim-u+n(o,a);f>0&&(bNr(yNr(o,t,r),t,f),u+=f,l+=f),d+=o.hierNode.modifier,u+=a.hierNode.modifier,l+=i.hierNode.modifier,h+=s.hierNode.modifier}o&&!pme(i)&&(i.hierNode.thread=o,i.hierNode.modifier+=d-l),a&&!gme(s)&&(s.hierNode.thread=a,s.hierNode.modifier+=u-h,r=t)}return r}function pme(t){var e=t.children;return e.length&&t.isExpand?e[e.length-1]:t.hierNode.thread}function gme(t){var e=t.children;return e.length&&t.isExpand?e[0]:t.hierNode.thread}function yNr(t,e,r){return t.hierNode.ancestor.parentNode===e.parentNode?t.hierNode.ancestor:r}function bNr(t,e,r){var n=r/(e.hierNode.i-t.hierNode.i);e.hierNode.change-=n,e.hierNode.shift+=r,e.hierNode.modifier+=r,e.hierNode.prelim+=r,t.hierNode.change+=n}function xNr(t,e){return t.parentNode===e.parentNode?1:2}var jf=Qr();function xct(t){var e=t.mainData,r=t.datas;r||(r={main:e},t.datasAttr={main:"data"}),t.datas=t.mainData=null,wct(e,r,t),de(r,function(n){de(e.TRANSFERABLE_METHODS,function(i){n.wrapMethod(i,qr(wNr,t))})}),e.wrapMethod("cloneShallow",qr(TNr,t)),de(e.CHANGABLE_METHODS,function(n){e.wrapMethod(n,qr(ANr,t))}),ec(r[e.dataType]===e)}function wNr(t,e){if(ONr(this)){var r=ot({},jf(this).datas);r[this.dataType]=e,wct(e,r,t)}else mme(e,this.dataType,jf(this).mainData,t);return e}function ANr(t,e){return t.struct&&t.struct.update(),e}function TNr(t,e){return de(jf(e).datas,function(r,n){r!==e&&mme(r.cloneShallow(),n,e,t)}),e}function SNr(t){var e=jf(this).mainData;return t==null||e==null?e:jf(e).datas[t]}function CNr(){var t=jf(this).mainData;return t==null?[{data:t}]:vt(kn(jf(t).datas),function(e){return{type:e,data:jf(t).datas[e]}})}function ONr(t){return jf(t).mainData===t}function wct(t,e,r){jf(t).datas={},de(e,function(n,i){mme(n,i,t,r)})}function mme(t,e,r,n){jf(r).datas[e]=t,jf(t).mainData=r,t.dataType=e,n.struct&&(t[n.structAttr]=n.struct,n.struct[n.datasAttr[e]]=t),t.getLinkedData=SNr,t.getLinkedDataAll=CNr}var kNr=function(){function t(e,r){this.depth=0,this.height=0,this.dataIndex=-1,this.children=[],this.viewChildren=[],this.isExpand=!1,this.name=e||"",this.hostTree=r}return t.prototype.isRemoved=function(){return this.dataIndex<0},t.prototype.eachNode=function(e,r,n){ur(e)&&(n=r,r=e,e=null),e=e||{},Nt(e)&&(e={order:e});var i=e.order||"preorder",a=this[e.attr||"children"],s;i==="preorder"&&(s=r.call(n,this));for(var o=0;!s&&or&&(r=i.height)}this.height=r+1},t.prototype.getNodeById=function(e){if(this.getId()===e)return this;for(var r=0,n=this.children,i=n.length;r=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,r)},t.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},t.prototype.getModel=function(e){if(!(this.dataIndex<0)){var r=this.hostTree,n=r.data.getItemModel(this.dataIndex);return n.getModel(e)}},t.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},t.prototype.setVisual=function(e,r){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,r)},t.prototype.getVisual=function(e){return this.hostTree.data.getItemVisual(this.dataIndex,e)},t.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},t.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},t.prototype.getChildIndex=function(){if(this.parentNode){for(var e=this.parentNode.children,r=0;r=0){var n=r.getData().tree.root,i=t.targetNode;if(Nt(i)&&(i=n.getNodeById(i)),i&&n.contains(i))return{node:i};var a=t.targetNodeId;if(a!=null&&(i=n.getNodeById(a)))return{node:i}}}function Act(t){for(var e=[];t;)t=t.parentNode,t&&e.push(t);return e.reverse()}function yme(t,e){var r=Act(t);return Ir(r,e)>=0}function AY(t,e){for(var r=[];t;){var n=t.dataIndex;r.push({name:t.name,dataIndex:n,value:e.getRawValue(n)}),t=t.parentNode}return r.reverse(),r}var qT="tree",_Nr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.hasSymbolVisual=!0,r.ignoreStyleOnData=!0,r}return e.prototype.getInitialData=function(r){var n={name:r.name,children:r.data},i=r.leaves||{},a=new yn(i,this,this.ecModel),s=vme.createTree(n,this,o);function o(d){d.wrapMethod("getItemModel",function(f,p){var g=s.getNodeByDataIndex(p);return g&&g.children.length&&g.isExpand||(f.parentModel=a),f})}var l=0;s.eachNode("preorder",function(d){d.depth>l&&(l=d.depth)});var u=r.expandAndCollapse,h=u&&r.initialTreeDepth>=0?r.initialTreeDepth:l;return s.root.eachNode("preorder",function(d){var f=d.hostTree.data.getRawDataItem(d.dataIndex);d.isExpand=f&&f.collapsed!=null?!f.collapsed:d.depth<=h}),s.data},e.prototype.getOrient=function(){var r=this.get("orient");return r==="horizontal"?r="LR":r==="vertical"&&(r="TB"),r},e.prototype.formatTooltip=function(r,n,i){for(var a=this.getData().tree,s=a.root.children[0],o=a.getNodeByDataIndex(r),l=o.getValue(),u=o.name;o&&o!==s;)u=o.parentNode.name+"."+u,o=o.parentNode;return no("nameValue",{name:u,value:l,noValue:isNaN(l)||l==null})},e.prototype.getDataParams=function(r){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(r);return n.treeAncestors=AY(i,this),n.collapsed=!i.isExpand,n},e.prototype.__ownRoamView=function(){return this.coordinateSystem},e.type="series."+qT,e.layoutMode="box",e.defaultOption={z:2,coordinateSystemUsage:"box",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,roamTrigger:"global",nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:et.color.borderTint,width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},e}(Ri),RNr=function(){function t(){this.parentPoint=[],this.childPoints=[]}return t}(),DNr=function(t){rt(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:et.color.neutral99,fill:null}},e.prototype.getDefaultShape=function(){return new RNr},e.prototype.buildPath=function(r,n){var i=n.childPoints,a=i.length,s=n.parentPoint,o=i[0],l=i[a-1];if(a===1){r.moveTo(s[0],s[1]),r.lineTo(o[0],o[1]);return}var u=n.orient,h=u==="TB"||u==="BT"?0:1,d=1-h,f=Qt(n.forkPosition,1),p=[];p[h]=s[h],p[d]=s[d]+(l[d]-s[d])*f,r.moveTo(s[0],s[1]),r.lineTo(p[0],p[1]),r.moveTo(o[0],o[1]),p[h]=o[h],r.lineTo(p[0],p[1]),p[h]=l[h],r.lineTo(p[0],p[1]),r.lineTo(l[0],l[1]);for(var g=1;gb.x,A||(w=w-Math.PI));var S=A?"left":"right",O=o.getModel("label"),k=O.get("rotate"),E=k*(Math.PI/180),_=v.getTextContent();_&&(v.setTextConfig({position:O.get("position")||S,rotation:k==null?-w:E,origin:"center"}),_.setStyle("verticalAlign","middle"))}var I=o.get(["emphasis","focus"]),L=I==="relative"?QE(s.getAncestorsIndices(),s.getDescendantIndices()):I==="ancestor"?s.getAncestorsIndices():I==="descendant"?s.getDescendantIndices():null;L&&(Cr(r).focus=L),MNr(i,s,h,r,g,p,m,n),r.__edge&&(r.onHoverStateChange=function(R){if(R!=="blur"){var D=s.parentNode&&t.getItemGraphicEl(s.parentNode.dataIndex);D&&D.hoverState===PN||yH(r.__edge,R)}})}function MNr(t,e,r,n,i,a,s,o){var l=e.getModel(),u=t.get("edgeShape"),h=t.get("layout"),d=t.getOrient(),f=t.get(["lineStyle","curveness"]),p=t.get("edgeForkPosition"),g=l.getModel("lineStyle").getLineStyle(),m=n.__edge;if(u==="curve")e.parentNode&&e.parentNode!==r&&(m||(m=n.__edge=new p_({shape:bme(h,d,f,i,i)})),Hn(m,{shape:bme(h,d,f,a,s)},t));else if(u==="polyline"&&h==="orthogonal"&&e!==r&&e.children&&e.children.length!==0&&e.isExpand===!0){for(var v=e.children,y=[],b=0;b=0;a--)r.push(i[a])}}function PNr(t,e){t.eachSeriesByType("tree",function(r){NNr(r,e)})}function NNr(t,e){var r=Co(t,e).refContainer,n=da(t.getBoxLayoutParams(),r);t.layoutInfo=n;var i=t.get("layout"),a=0,s=0,o=null;i==="radial"?(a=2*Math.PI,s=Math.min(n.height,n.width)/2,o=bct(function(w,A){return(w.parentNode===A.parentNode?1:2)/w.depth})):(a=n.width,s=n.height,o=bct());var l=t.getData().tree.root,u=l.children[0];if(u){fNr(l),INr(u,pNr,o),l.hierNode.modifier=-u.hierNode.prelim,rB(u,gNr);var h=u,d=u,f=u;rB(u,function(w){var A=w.getLayout().x;Ad.getLayout().x&&(d=w),w.depth>f.depth&&(f=w)});var p=h===d?1:o(h,d)/2,g=p-h.getLayout().x,m=0,v=0,y=0,b=0;if(i==="radial")m=a/(d.getLayout().x+p+g),v=s/(f.depth-1||1),rB(u,function(w){y=(w.getLayout().x+g)*m,b=(w.depth-1)*v;var A=eB(y,b);w.setLayout({x:A.x,y:A.y,rawX:y,rawY:b},!0)});else{var x=t.getOrient();x==="RL"||x==="LR"?(v=s/(d.getLayout().x+p+g),m=a/(f.depth-1||1),rB(u,function(w){b=(w.getLayout().x+g)*v,y=x==="LR"?(w.depth-1)*m:a-(w.depth-1)*m,w.setLayout({x:y,y:b},!0)})):(x==="TB"||x==="BT")&&(m=a/(d.getLayout().x+p+g),v=s/(f.depth-1||1),rB(u,function(w){y=(w.getLayout().x+g)*m,b=x==="TB"?(w.depth-1)*v:s-(w.depth-1)*v,w.setLayout({x:y,y:b},!0)}))}}}function BNr(t){t.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(e,r){r.eachComponent({mainType:km,subType:qT,query:e},function(n){var i=e.dataIndex,a=n.getData().tree,s=a.getNodeByDataIndex(i);s.isExpand=!s.isExpand})}),ume(t,km,qT)}var $Nr=Ao(qT,FNr);function FNr(t){t.eachSeriesByType(qT,function(e){var r=e.getData(),n=r.tree;n.eachNode(function(i){var a=i.getModel(),s=a.getModel("itemStyle").getItemStyle(),o=r.ensureUniqueItemVisual(i.dataIndex,"style");ot(o,s)})})}function zNr(t){t.registerChartView(LNr),t.registerSeriesModel(_Nr),t.registerLayout(PNr),t.registerVisual($Nr),BNr(t)}var Ect=["treemapZoomToNode","treemapRender","treemapMove"];function UNr(t){for(var e=0;e1;)a=a.parentNode;var s=Qfe(t.ecModel,a.name||a.dataIndex+"",n);i.setVisual("decal",s)})}var VNr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.preventUsingHoverLayer=!0,r}return e.prototype.getInitialData=function(r,n){var i={name:r.name,children:r.data};Rct(i);var a=r.levels||[],s=this.designatedVisualItemStyle={},o=new yn({itemStyle:s},this,n);a=r.levels=QNr(a,n);var l=vt(a||[],function(d){return new yn(d,o,n)},this),u=vme.createTree(i,this,h);function h(d){d.wrapMethod("getItemModel",function(f,p){var g=u.getNodeByDataIndex(p),m=g?l[g.depth]:null;return f.parentModel=m||o,f})}return u.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.formatTooltip=function(r,n,i){var a=this.getData(),s=this.getRawValue(r),o=a.getName(r);return no("nameValue",{name:o,value:s})},e.prototype.getDataParams=function(r){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(r);return n.treeAncestors=AY(i,this),n.treePathInfo=n.treeAncestors,n},e.prototype.setLayoutInfo=function(r){this.layoutInfo=this.layoutInfo||{},ot(this.layoutInfo,r)},e.prototype.mapIdToIndex=function(r){var n=this._idIndexMap;n||(n=this._idIndexMap=Yt(),this._idIndexMapCount=0);var i=n.get(r);return i==null&&n.set(r,i=this._idIndexMapCount++),i},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(r){r?this._viewRoot=r:r=this._viewRoot;var n=this.getRawData().tree.root;(!r||r!==n&&!n.contains(r))&&(this._viewRoot=n)},e.prototype.enableAriaDecal=function(){_ct(this)},e.type="series.treemap",e.layoutMode="box",e.defaultOption={progressive:0,coordinateSystemUsage:"box",left:et.size.l,top:et.size.xxxl,right:et.size.l,bottom:et.size.xxxl,sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.32*.32,scaleLimit:{max:5,min:.2},roam:!0,roamTrigger:"global",nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",bottom:et.size.m,emptyItemWidth:25,itemStyle:{color:et.color.backgroundShade,textStyle:{color:et.color.secondary}},emphasis:{itemStyle:{color:et.color.background}}},label:{show:!0,distance:0,padding:5,position:"inside",color:et.color.neutral00,overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:et.color.neutral00,borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},e}(Ri);function Rct(t){var e=0;de(t.children,function(n){Rct(n);var i=n.value;ft(i)&&(i=i[0]),e+=i});var r=t.value;ft(r)&&(r=r[0]),(r==null||isNaN(r))&&(r=e),r<0&&(r=0),ft(t.value)?t.value[0]=r:t.value=r}function QNr(t,e){var r=Qi(e.get("color")),n=Qi(e.get(["aria","decal","decals"]));if(r){t=t||[];var i,a;de(t,function(o){var l=new yn(o),u=l.get("color"),h=l.get("decal");(l.get(["itemStyle","color"])||u&&u!=="none")&&(i=!0),(l.get(["itemStyle","decal"])||h&&h!=="none")&&(a=!0)});var s=t[0]||(t[0]={});return i||(s.color=r.slice()),!a&&n&&(s.decal=n.slice()),t}}var GNr=8,Dct=8,xme=5,HNr=function(){function t(e){this.group=new pr,e.add(this.group)}return t.prototype.render=function(e,r,n,i){var a=e.getModel("breadcrumb"),s=this.group;if(s.removeAll(),!(!a.get("show")||!n)){var o=a.getModel("itemStyle"),l=a.getModel("emphasis"),u=o.getModel("textStyle"),h=l.getModel(["itemStyle","textStyle"]),d=Co(e,r).refContainer,f={left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},p={emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]},g=da(f,d);this._prepare(n,p,u),this._renderContent(e,p,g,o,l,u,h,i),GH(s,f,d)}},t.prototype._prepare=function(e,r,n){for(var i=e;i;i=i.parentNode){var a=wo(i.getModel().get("name"),""),s=n.getTextRect(a),o=Math.max(s.width+GNr*2,r.emptyItemWidth);r.totalWidth+=o+Dct,r.renderList.push({node:i,text:a,width:o})}},t.prototype._renderContent=function(e,r,n,i,a,s,o,l){for(var u=0,h=r.emptyItemWidth,d=e.get(["breadcrumb","height"]),f=r.totalWidth,p=r.renderList,g=a.getModel("itemStyle").getItemStyle(),m=p.length-1;m>=0;m--){var v=p[m],y=v.node,b=v.width,x=v.text;f>n.width&&(f-=b-h,b=h,x=null);var w=new ic({shape:{points:WNr(u,0,b,d,m===p.length-1,m===0)},style:mr(i.getItemStyle(),{lineJoin:"bevel"}),textContent:new Pn({style:Gi(s,{text:x})}),textConfig:{position:"inside"},z2:c_*1e4,onclick:qr(l,y)});w.disableLabelAnimation=!0,w.getTextContent().ensureState("emphasis").style=Gi(o,{text:x}),w.ensureState("emphasis").style=g,wa(w,a.get("focus"),a.get("blurScope"),a.get("disabled")),this.group.add(w),YNr(w,e,y),u+=b+Dct}},t.prototype.remove=function(){this.group.removeAll()},t}();function WNr(t,e,r,n,i,a){var s=[[i?t:t-xme,e],[t+r,e],[t+r,e+n],[i?t:t-xme,e+n]];return!a&&s.splice(2,0,[t+r+xme,e+n/2]),!i&&s.push([t,e+n/2]),s}function YNr(t,e,r){Cr(t).eventData={componentType:"series",componentSubType:"treemap",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:r&&r.dataIndex,name:r&&r.name},treePathInfo:r&&AY(r,e)}}var qNr=function(){function t(){this._storage=[],this._elExistsMap={}}return t.prototype.add=function(e,r,n,i,a){return this._elExistsMap[e.id]?!1:(this._elExistsMap[e.id]=!0,this._storage.push({el:e,target:r,duration:n,delay:i,easing:a}),!0)},t.prototype.finished=function(e){return this._finishedCallback=e,this},t.prototype.start=function(){for(var e=this,r=this._storage.length,n=function(){r--,r<=0&&(e._storage.length=0,e._elExistsMap={},e._finishedCallback&&e._finishedCallback())},i=0,a=this._storage.length;i=0;l--){var u=i[n==="asc"?s-l-1:l].getValue();u/r*eo[1]&&(o[1]=u)})),{sum:n,dataExtent:o}}function i8r(t,e,r){for(var n=0,i=1/0,a=0,s=void 0,o=t.length;an&&(n=s));var l=t.area*t.area,u=e*e*r;return l?nB(u*n/l,l/(u*i)):1/0}function Ict(t,e,r,n,i){var a=e===r.width?0:1,s=1-a,o=["x","y"],l=["width","height"],u=r[o[a]],h=e?t.area/e:0;(i||h>r[l[s]])&&(h=r[l[s]]);for(var d=0,f=t.length;d_N&&(h=_N),i=l}hzct||Math.abs(r.dy)>zct)){var n=this.seriesModel.getData().tree.root;if(!n)return;var i=n.getLayout();if(!i)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:i.x+r.dx,y:i.y+r.dy,width:i.width,height:i.height}})}},e.prototype._onZoom=function(r){var n=r.originX,i=r.originY,a=r.scale,s=this.seriesModel;if(this._state!=="animating"){var o=s.getData().tree.root;if(!o)return;var l=o.getLayout();if(!l)return;var u=new fr(l.x,l.y,l.width,l.height),h=s.layoutInfo,d=Bct(h,l),f=d*a;f=$ct(f,s);var p=f/d;n-=h.x,i-=h.y;var g=xa();zp(g,g,[-n,-i]),bG(g,g,[p,p]),zp(g,g,[n,i]),u.applyTransform(g),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:u.x,y:u.y,width:u.width,height:u.height}})}},e.prototype._initEvents=function(r){var n=this;r.on("click",function(i){if(n._state==="ready"){var a=n.seriesModel.get("nodeClick",!0);if(a){var s=n.findTarget(i.offsetX,i.offsetY);if(s){var o=s.node;if(o.getLayout().isLeafRoot)n._rootToNode(s);else if(a==="zoomToNode")n._zoomToNode(s);else if(a==="link"){var l=o.hostTree.data.getItemModel(o.dataIndex),u=l.get("link",!0),h=l.get("target",!0)||"blank";u&&zH(u,h)}}}}},this)},e.prototype._renderBreadcrumb=function(r,n,i){var a=this;i||(i=r.get("leafDepth",!0)!=null?{node:r.getViewRoot()}:this.findTarget(n.getWidth()/2,n.getHeight()/2),i||(i={node:r.getData().tree.root})),(this._breadcrumb||(this._breadcrumb=new HNr(this.group))).render(r,n,i.node,function(s){a._state!=="animating"&&(yme(r.getViewRoot(),s)?a._rootToNode({node:s}):a._zoomToNode({node:s}))})},e.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=iB(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},e.prototype.dispose=function(){this._clearController()},e.prototype._zoomToNode=function(r){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:r.node})},e.prototype._rootToNode=function(r){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:r.node})},e.prototype.findTarget=function(r,n){var i,a=this.seriesModel.getViewRoot();return a.eachNode({attr:"viewChildren",order:"preorder"},function(s){var o=this._storage.background[s.getRawIndex()];if(o){var l=o.transformCoordToLocal(r,n),u=o.shape;if(u.x<=l[0]&&l[0]<=u.x+u.width&&u.y<=l[1]&&l[1]<=u.y+u.height)i={node:s,offsetX:l[0],offsetY:l[1]};else return!1}},this),i},e.type="treemap",e}(Ti);function iB(){return{nodeGroup:[],background:[],content:[]}}function h8r(t,e,r,n,i,a,s,o,l,u){if(!s)return;var h=s.getLayout(),d=t.getData(),f=s.getModel();if(d.setItemGraphicEl(s.dataIndex,null),!h||!h.isInView)return;var p=h.width,g=h.height,m=h.borderWidth,v=h.invisible,y=s.getRawIndex(),b=o&&o.getRawIndex(),x=s.viewChildren,w=h.upperHeight,A=x&&x.length,T=f.getModel("itemStyle"),S=f.getModel(["emphasis","itemStyle"]),O=f.getModel(["blur","itemStyle"]),k=f.getModel(["select","itemStyle"]),E=T.get("borderRadius")||0,_=G("nodeGroup",Ame);if(!_)return;if(l.add(_),_.x=h.x||0,_.y=h.y||0,_.markRedraw(),SY(_).nodeWidth=p,SY(_).nodeHeight=g,h.isAboveViewRoot)return _;var I=G("background",Fct,u,l8r);I&&B(_,I,A&&h.upperLabelHeight);var L=f.getModel("emphasis"),R=L.get("focus"),D=L.get("blurScope"),M=L.get("disabled"),P=R==="ancestor"?s.getAncestorsIndices():R==="descendant"?s.getDescendantIndices():R;if(A)BN(_)&&JA(_,!1),I&&(JA(I,!M),d.setItemGraphicEl(s.dataIndex,I),Xde(I,P,D));else{var N=G("content",Fct,u,c8r);N&&V(_,N),I.disableMorphing=!0,I&&BN(I)&&JA(I,!1),JA(_,!M),d.setItemGraphicEl(s.dataIndex,_);var F=f.getShallow("cursor");F&&N.attr("cursor",F),Xde(_,P,D)}return _;function B(le,q,Z){var ee=Cr(q);if(ee.dataIndex=s.dataIndex,ee.seriesIndex=t.seriesIndex,q.setShape({x:0,y:0,width:p,height:g,r:E}),v)z(q);else{q.invisible=!1;var re=s.getVisual("style"),ve=re.stroke,ae=Qct(T);ae.fill=ve;var Ce=jT(S);Ce.fill=S.get("borderColor");var Oe=jT(O);Oe.fill=O.get("borderColor");var $e=jT(k);if($e.fill=k.get("borderColor"),Z){var he=p-2*m;U(q,ve,re.opacity,{x:m,y:0,width:he,height:w})}else q.removeTextContent();q.setStyle(ae),q.ensureState("emphasis").style=Ce,q.ensureState("blur").style=Oe,q.ensureState("select").style=$e,ZA(q)}le.add(q)}function V(le,q){var Z=Cr(q);Z.dataIndex=s.dataIndex,Z.seriesIndex=t.seriesIndex;var ee=Math.max(p-2*m,0),re=Math.max(g-2*m,0);if(q.culling=!0,q.setShape({x:m,y:m,width:ee,height:re,r:E}),v)z(q);else{q.invisible=!1;var ve=s.getVisual("style"),ae=ve.fill,Ce=Qct(T);Ce.fill=ae,Ce.decal=ve.decal;var Oe=jT(S),$e=jT(O),he=jT(k);U(q,ae,ve.opacity,null),q.setStyle(Ce),q.ensureState("emphasis").style=Oe,q.ensureState("blur").style=$e,q.ensureState("select").style=he,ZA(q)}le.add(q)}function z(le){!le.invisible&&a.push(le)}function U(le,q,Z,ee){var re=f.getModel(ee?Vct:Uct),ve=wo(f.get("name"),null),ae=re.getShallow("show");qo(le,So(f,ee?Vct:Uct),{defaultText:ae?ve:null,inheritColor:q,defaultOpacity:Z,labelFetcher:t,labelDataIndex:s.dataIndex});var Ce=le.getTextContent();if(Ce){var Oe=Ce.style,$e=aN(Oe.padding||0);ee&&(le.setTextConfig({layoutRect:ee}),Ce.disableLabelLayout=!0),Ce.beforeUpdate=function(){var fe=Math.max((ee?ee.width:le.shape.width)-$e[1]-$e[3],0),Te=Math.max((ee?ee.height:le.shape.height)-$e[0]-$e[2],0);(Oe.width!==fe||Oe.height!==Te)&&Ce.setStyle({width:fe,height:Te})},Oe.truncateMinChar=2,Oe.lineOverflow="truncate",Q(Oe,ee,h);var he=Ce.getState("emphasis");Q(he?he.style:null,ee,h)}}function Q(le,q,Z){var ee=le?le.text:null;if(!q&&Z.isLeafRoot&&ee!=null){var re=t.get("drillDownIcon",!0);le.text=re?re+" "+ee:ee}}function G(le,q,Z,ee){var re=b!=null&&r[le][b],ve=i[le];return re?(r[le][b]=null,X(ve,re)):v||(re=new q,re instanceof $f&&(re.z2=d8r(Z,ee)),Y(ve,re)),e[le][y]=re}function X(le,q){var Z=le[y]={};q instanceof Ame?(Z.oldX=q.x,Z.oldY=q.y):Z.oldShape=ot({},q.shape)}function Y(le,q){var Z=le[y]={},ee=s.parentNode,re=q instanceof pr;if(ee&&(!n||n.direction==="drillDown")){var ve=0,ae=0,Ce=i.background[ee.getRawIndex()];!n&&Ce&&Ce.oldShape&&(ve=Ce.oldShape.width,ae=Ce.oldShape.height),re?(Z.oldX=0,Z.oldY=ae):Z.oldShape={x:ve,y:ae,width:0,height:0}}Z.fadein=!re}}function d8r(t,e){return t*o8r+e}var aB=de,f8r=yr,CY=-1,Xo=function(){function t(e){var r=e.mappingMethod,n=e.type,i=this.option=lr(e);this.type=n,this.mappingMethod=r,this._normalizeData=m8r[r];var a=t.visualHandlers[n];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[r],r==="piecewise"?(Tme(i),p8r(i)):r==="category"?i.categories?g8r(i):Tme(i,!0):(ec(r!=="linear"||i.dataExtent),Tme(i))}return t.prototype.mapValueToVisual=function(e){var r=this._normalizeData(e);return this._normalizedToVisual(r,e)},t.prototype.getNormalizer=function(){return Ht(this._normalizeData,this)},t.listVisualTypes=function(){return kn(t.visualHandlers)},t.isValidType=function(e){return t.visualHandlers.hasOwnProperty(e)},t.eachVisual=function(e,r,n){yr(e)?de(e,r,n):r.call(n,e)},t.mapVisual=function(e,r,n){var i,a=ft(e)?[]:yr(e)?{}:(i=!0,null);return t.eachVisual(e,function(s,o){var l=r.call(n,s,o);i?a=l:a[o]=l}),a},t.retrieveVisuals=function(e){var r={},n;return e&&aB(t.visualHandlers,function(i,a){e.hasOwnProperty(a)&&(r[a]=e[a],n=!0)}),n?r:null},t.prepareVisualTypes=function(e){if(ft(e))e=e.slice();else if(f8r(e)){var r=[];aB(e,function(n,i){r.push(i)}),e=r}else return[];return e.sort(function(n,i){return i==="color"&&n!=="color"&&n.indexOf("color")===0?1:-1}),e},t.dependsOn=function(e,r){return r==="color"?!!(e&&e.indexOf(r)===0):e===r},t.findPieceIndex=function(e,r,n){for(var i,a=1/0,s=0,o=r.length;s=0;a--)n[a]==null&&(delete r[e[a]],e.pop())}function Tme(t,e){var r=t.visual,n=[];yr(r)?aB(r,function(a){n.push(a)}):r!=null&&n.push(r);var i={color:1,symbol:1};!e&&n.length===1&&!i.hasOwnProperty(t.type)&&(n[1]=n[0]),Hct(t,n)}function OY(t){return{applyVisual:function(e,r,n){var i=this.mapValueToVisual(e);n("color",t(r("color"),i))},_normalizedToVisual:Sme([0,1])}}function Gct(t){var e=this.option.visual;return e[Math.round(jn(t,[0,1],[0,e.length-1],!0))]||{}}function sB(t){return function(e,r,n){n(t,this.mapValueToVisual(e))}}function oB(t){var e=this.option.visual;return e[this.option.loop&&t!==CY?t%e.length:t]}function XT(){return this.option.visual[0]}function Sme(t){return{linear:function(e){return jn(e,t,this.option.visual,!0)},category:oB,piecewise:function(e,r){var n=Cme.call(this,r);return n==null&&(n=jn(e,t,this.option.visual,!0)),n},fixed:XT}}function Cme(t){var e=this.option,r=e.pieceList;if(e.hasSpecialVisual){var n=Xo.findPieceIndex(t,r),i=r[n];if(i&&i.visual)return i.visual[this.type]}}function Hct(t,e){return t.visual=e,t.type==="color"&&(t.parsedVisual=vt(e,function(r){var n=Bc(r);return n||[0,0,0,1]})),e}var m8r={linear:function(t){return jn(t,this.option.dataExtent,[0,1],!0)},piecewise:function(t){var e=this.option.pieceList,r=Xo.findPieceIndex(t,e,!0);if(r!=null)return jn(r,[0,e.length-1],[0,1],!0)},category:function(t){var e=this.option.categories?this.option.categoryMap[t]:t;return e??CY},fixed:Xa};function kY(t,e,r){return t?e<=r:e=r.length||m===r[m.depth]){var y=A8r(i,l,m,v,g,n);Yct(m,y,r,n)}})}}}function b8r(t,e,r){var n=ot({},e),i=r.designatedVisualItemStyle;return de(["color","colorAlpha","colorSaturation"],function(a){i[a]=e[a];var s=t.get(a);i[a]=null,s!=null&&(n[a]=s)}),n}function qct(t){var e=Ome(t,"color");if(e){var r=Ome(t,"colorAlpha"),n=Ome(t,"colorSaturation");return n&&(e=ey(e,null,null,n)),r&&(e=wN(e,r)),e}}function x8r(t,e){return e!=null?ey(e,null,null,t):null}function Ome(t,e){var r=t[e];if(r!=null&&r!=="none")return r}function w8r(t,e,r,n,i,a){if(!(!a||!a.length)){var s=kme(e,"color")||i.color!=null&&i.color!=="none"&&(kme(e,"colorAlpha")||kme(e,"colorSaturation"));if(s){var o=e.get("visualMin"),l=e.get("visualMax"),u=r.dataExtent.slice();o!=null&&ou[1]&&(u[1]=l);var h=e.get("colorMappingBy"),d={type:s.name,dataExtent:u,visual:s.range};d.type==="color"&&(h==="index"||h==="id")?(d.mappingMethod="category",d.loop=!0):d.mappingMethod="linear";var f=new Xo(d);return Wct(f).drColorMappingBy=h,f}}}function kme(t,e){var r=t.get(e);return ft(r)&&r.length?{name:e,range:r}:null}function A8r(t,e,r,n,i,a){var s=ot({},e);if(i){var o=i.type,l=o==="color"&&Wct(i).drColorMappingBy,u=l==="index"?n:l==="id"?a.mapIdToIndex(r.getId()):r.getValue(t.get("visualDimension"));s[o]=i.mapValueToVisual(u)}return s}function T8r(t){t.registerSeriesModel(VNr),t.registerChartView(u8r),t.registerVisual(y8r),t.registerLayout(JNr),UNr(t)}function s5(t){return"_EC_"+t}var S8r=function(){function t(e){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=e||!1}return t.prototype.isDirected=function(){return this._directed},t.prototype.addNode=function(e,r){e=e==null?""+r:""+e;var n=this._nodesMap;if(!n[s5(e)]){var i=new KT(e,r);return i.hostGraph=this,this.nodes.push(i),n[s5(e)]=i,i}},t.prototype.getNodeByIndex=function(e){var r=this.data.getRawIndex(e);return this.nodes[r]},t.prototype.getNodeById=function(e){return this._nodesMap[s5(e)]},t.prototype.addEdge=function(e,r,n){var i=this._nodesMap,a=this._edgesMap;if(zn(e)&&(e=this.nodes[e]),zn(r)&&(r=this.nodes[r]),e instanceof KT||(e=i[s5(e)]),r instanceof KT||(r=i[s5(r)]),!(!e||!r)){var s=e.id+"-"+r.id,o=new jct(e,r,n);return o.hostGraph=this,this._directed&&(e.outEdges.push(o),r.inEdges.push(o)),e.edges.push(o),e!==r&&r.edges.push(o),this.edges.push(o),a[s]=o,o}},t.prototype.getEdgeByIndex=function(e){var r=this.edgeData.getRawIndex(e);return this.edges[r]},t.prototype.getEdge=function(e,r){e instanceof KT&&(e=e.id),r instanceof KT&&(r=r.id);var n=this._edgesMap;return this._directed?n[e+"-"+r]:n[e+"-"+r]||n[r+"-"+e]},t.prototype.eachNode=function(e,r){for(var n=this.nodes,i=n.length,a=0;a=0&&e.call(r,n[a],a)},t.prototype.eachEdge=function(e,r){for(var n=this.edges,i=n.length,a=0;a=0&&n[a].node1.dataIndex>=0&&n[a].node2.dataIndex>=0&&e.call(r,n[a],a)},t.prototype.breadthFirstTraverse=function(e,r,n,i){if(r instanceof KT||(r=this._nodesMap[s5(r)]),!!r){for(var a=n==="out"?"outEdges":n==="in"?"inEdges":"edges",s=0;s=0&&l.node2.dataIndex>=0});for(var a=0,s=i.length;a=0&&!e.hasKey(g)&&(e.set(g,!0),s.push(p.node1))}for(l=0;l=0&&!e.hasKey(x)&&(e.set(x,!0),o.push(b.node2))}}}return{edge:e.keys(),node:r.keys()}},t}(),jct=function(){function t(e,r,n){this.dataIndex=-1,this.node1=e,this.node2=r,this.dataIndex=n??-1}return t.prototype.getModel=function(e){if(!(this.dataIndex<0)){var r=this.hostGraph,n=r.edgeData.getItemModel(this.dataIndex);return n.getModel(e)}},t.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},t.prototype.getTrajectoryDataIndices=function(){var e=Yt(),r=Yt();e.set(this.dataIndex,!0);for(var n=[this.node1],i=[this.node2],a=0;a=0&&!e.hasKey(d)&&(e.set(d,!0),n.push(h.node1))}for(a=0;a=0&&!e.hasKey(m)&&(e.set(m,!0),i.push(g.node2))}return{edge:e.keys(),node:r.keys()}},t}();function Xct(t,e){return{getValue:function(r){var n=this[t][e];return n.getStore().get(n.getDimensionIndex(r||"value"),this.dataIndex)},setVisual:function(r,n){this.dataIndex>=0&&this[t][e].setItemVisual(this.dataIndex,r,n)},getVisual:function(r){return this[t][e].getItemVisual(this.dataIndex,r)},setLayout:function(r,n){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,r,n)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}}Is(KT,Xct("hostGraph","data")),Is(jct,Xct("hostGraph","edgeData"));function Eme(t,e,r,n,i){for(var a=new S8r(n),s=0;s "+f)),u++)}var p=r.get("coordinateSystem"),g;if(p==="cartesian2d"||p==="polar"||p==="matrix")g=Dm(t,r);else{var m=O_.get(p),v=m?m.dimensions||[]:[];Ir(v,"value")<0&&v.concat(["value"]);var y=U_(t,{coordDimensions:v,encodeDefine:r.getEncode()}).dimensions;g=new zc(y,r),g.initData(t)}var b=new zc(["value"],r);return b.initData(l,o),i&&i(g,b),xct({mainData:g,struct:a,structAttr:"graph",datas:{node:g,edge:b},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var _me="-->",EY=function(t){return t.get("autoCurveness")||null},Kct=function(t,e){var r=EY(t),n=20,i=[];if(zn(r))n=r;else if(ft(r)){t.__curvenessList=r;return}e>n&&(n=e);var a=n%2?n+2:n+3;i=[];for(var s=0;s "),value:s.value,noValue:s.value==null})}var d=Mnt({series:this,dataIndex:r,multipleSeries:n});return d},e.prototype._updateCategoriesData=function(){var r=vt(this.option.categories||[],function(i){return i.value!=null?i:ot({value:0},i)}),n=new zc(["value"],this);n.initData(r),this._categoriesData=n,this._categoriesModels=n.mapArray(function(i){return n.getItemModel(i)})},e.prototype.isAnimationEnabled=function(){return t.prototype.isAnimationEnabled.call(this)&&!(this.get("layout")==="force"&&this.get(["force","layoutAnimation"]))},e.prototype.__ownRoamView=function(){var r=this.coordinateSystem;return Wlt(r)&&r},e.type="series."+ku,e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:et.color.neutral50,width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:et.color.primary}}},e}(Ri);function _Y(t){return t instanceof Array||(t=[t,t]),t}var R8r=Ao(ku,D8r);function D8r(t){t.eachSeriesByType(ku,function(e){var r=e.getGraph(),n=e.getEdgeData(),i=_Y(e.get("edgeSymbol")),a=_Y(e.get("edgeSymbolSize"));n.setVisual("fromSymbol",i&&i[0]),n.setVisual("toSymbol",i&&i[1]),n.setVisual("fromSymbolSize",a&&a[0]),n.setVisual("toSymbolSize",a&&a[1]),n.setVisual("style",e.getModel("lineStyle").getLineStyle()),n.each(function(s){var o=n.getItemModel(s),l=r.getEdgeByIndex(s),u=_Y(o.getShallow("symbol",!0)),h=_Y(o.getShallow("symbolSize",!0)),d=o.getModel("lineStyle").getLineStyle(),f=n.ensureUniqueItemVisual(s,"style");switch(ot(f,d),f.stroke){case"source":{var p=l.node1.getVisual("style");f.stroke=p&&p.fill;break}case"target":{var p=l.node2.getVisual("style");f.stroke=p&&p.fill;break}}u[0]&&l.setVisual("fromSymbol",u[0]),u[1]&&l.setVisual("toSymbol",u[1]),h[0]&&l.setVisual("fromSymbolSize",h[0]),h[1]&&l.setVisual("toSymbolSize",h[1])})})}function Jct(t){var e=t.coordinateSystem;if(!(e&&e.type!=="view")){var r=t.getGraph();r.eachNode(function(n){var i=n.getModel();n.setLayout([+i.get("x"),+i.get("y")])}),Lme(r,t)}}function Lme(t,e){t.eachEdge(function(r,n){var i=Ch(r.getModel().get(["lineStyle","curveness"]),-Dme(r,e,n,!0),0),a=cm(r.node1.getLayout()),s=cm(r.node2.getLayout()),o=[a,s];+i&&o.push([(a[0]+s[0])/2-(a[1]-s[1])*i,(a[1]+s[1])/2-(s[0]-a[0])*i]),r.setLayout(o)})}var L8r=Ao(ku,M8r);function M8r(t,e){t.eachSeriesByType(ku,function(r){var n=r.get("layout"),i=r.coordinateSystem;if(i&&i.type!=="view"){var a=r.getData(),s=[];de(i.dimensions,function(f){s=s.concat(a.mapDimensionsAll(f))});for(var o=0;o0&&(A[0]=-A[0],A[1]=-A[1]);var S=w[0]<0?-1:1;if(a.__position!=="start"&&a.__position!=="end"){var O=-Math.atan2(w[1],w[0]);d[0].8?"left":f[0]<-.8?"right":"center",m=f[1]>.8?"top":f[1]<-.8?"bottom":"middle";break;case"start":a.x=-f[0]*y+h[0],a.y=-f[1]*b+h[1],g=f[0]>.8?"right":f[0]<-.8?"left":"center",m=f[1]>.8?"bottom":f[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":a.x=y*S+h[0],a.y=h[1]+k,g=w[0]<0?"right":"left",a.originX=-y*S,a.originY=-k;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":a.x=T[0],a.y=T[1]+k,g="center",a.originY=-k;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":a.x=-y*S+d[0],a.y=d[1]+k,g=w[0]>=0?"right":"left",a.originX=y*S,a.originY=-k;break}a.scaleX=a.scaleY=s,a.setStyle({verticalAlign:a.__verticalAlign||m,align:a.__align||g})}},e}(pr),zme=function(){function t(e){this.group=new pr,this._LineCtor=e||Fme}return t.prototype.updateData=function(e){var r=this;this._progressiveEls=null;var n=this,i=n.group,a=n._lineData;n._lineData=e,a||i.removeAll();var s=lut(e);e.diff(a).add(function(o){r._doAdd(e,o,s)}).update(function(o,l){r._doUpdate(a,e,l,o,s)}).remove(function(o){i.remove(a.getItemGraphicEl(o))}).execute()},t.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl(function(r,n){r.updateLayout(e,n)},this)},t.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=lut(e),this._lineData=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(e,r,n){this._progressiveEls=[];function i(l){!l.isGroup&&!Q8r(l)&&(l.incremental=n,l.ensureState("emphasis").hoverLayer=v_)}for(var a=e.start;a0}function lut(t){var e=t.hostModel,r=e.getModel("emphasis");return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:r.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:r.get("disabled"),blurScope:r.get("blurScope"),focus:r.get("focus"),labelStatesModels:So(e)}}function cut(t){return isNaN(t[0])||isNaN(t[1])}function Ume(t){return t&&!cut(t[0])&&!cut(t[1])}var Vme=[],Qme=[],Gme=[],l5=bl,Hme=nx,uut=Math.abs;function hut(t,e,r){for(var n=t[0],i=t[1],a=t[2],s=1/0,o,l=r*r,u=.1,h=.1;h<=.9;h+=.1){Vme[0]=l5(n[0],i[0],a[0],h),Vme[1]=l5(n[1],i[1],a[1],h);var d=uut(Hme(Vme,e)-l);d=0?o=o+u:o=o-u:g>=0?o=o-u:o=o+u}return o}function Wme(t,e){var r=[],n=yN,i=[[],[],[]],a=[[],[]],s=[];e/=2,t.eachEdge(function(o,l){var u=o.getLayout(),h=o.getVisual("fromSymbol"),d=o.getVisual("toSymbol");u.__original||(u.__original=[cm(u[0]),cm(u[1])],u[2]&&u.__original.push(cm(u[2])));var f=u.__original;if(u[2]!=null){if(tc(i[0],f[0]),tc(i[1],f[2]),tc(i[2],f[1]),h&&h!=="none"){var p=uB(o.node1),g=hut(i,f[0],p*e);n(i[0][0],i[1][0],i[2][0],g,r),i[0][0]=r[3],i[1][0]=r[4],n(i[0][1],i[1][1],i[2][1],g,r),i[0][1]=r[3],i[1][1]=r[4]}if(d&&d!=="none"){var p=uB(o.node2),g=hut(i,f[1],p*e);n(i[0][0],i[1][0],i[2][0],g,r),i[1][0]=r[1],i[2][0]=r[2],n(i[0][1],i[1][1],i[2][1],g,r),i[1][1]=r[1],i[2][1]=r[2]}tc(u[0],i[0]),tc(u[1],i[2]),tc(u[2],i[1])}else{if(tc(a[0],f[0]),tc(a[1],f[1]),rx(s,a[1],a[0]),AA(s,s),h&&h!=="none"){var p=uB(o.node1);mG(a[0],a[0],s,p*e)}if(d&&d!=="none"){var p=uB(o.node2);mG(a[1],a[1],s,-p*e)}tc(u[0],a[0]),tc(u[1],a[1])}})}var dut=Qr();function G8r(t){if(t)return dut(t).bridge}function fut(t,e){t&&(dut(t).bridge=e)}var H8r=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=ku,r}return e.prototype.init=function(r,n){var i=new M8,a=new zme,s=this.group,o=new pr;this._controller=new VT(n.getZr()),o.add(i.group),o.add(a.group),s.add(o),this._symbolDraw=i,this._lineDraw=a,this._mainGroup=o,this._firstRender=!0},e.prototype.render=function(r,n,i){var a=this,s=yY(r),o=!1;this._model=r,this._api=i,this._active=!0;var l=this._mainGroup,u=this._getThumbnailInfo();u&&u.bridge.reset(i);var h=this._symbolDraw,d=this._lineDraw;s&&Lx(l,Fm,s,this._firstRender?null:r),Wme(r.getGraph(),cB(r));var f=r.getData();h.updateData(f);var p=r.getEdgeData();d.updateData(p),this._updateNodeAndLinkScale(),s&&bY(r,i,this._controller,function(w,A,T){return r.coordinateSystem.containPoint([A,T])},null),clearTimeout(this._layoutTimeout);var g=r.forceLayout,m=r.get(["force","layoutAnimation"]);g&&(o=!0,this._startForceLayoutIteration(g,i,m));var v=r.get("layout");f.graph.eachNode(function(w){var A=w.dataIndex,T=w.getGraphicEl(),S=w.getModel();if(T){T.off("drag").off("dragend");var O=S.get("draggable");O&&T.on("drag",function(E){switch(v){case"force":g.warmUp(),!a._layouting&&a._startForceLayoutIteration(g,i,m),g.setFixed(A),f.setItemLayout(A,[T.x,T.y]);break;case"circular":f.setItemLayout(A,[T.x,T.y]),w.setLayout({fixed:!0},!0),Ime(r,"symbolSize",w,[E.offsetX,E.offsetY]),a.updateLayout(r);break;case"none":default:f.setItemLayout(A,[T.x,T.y]),Lme(r.getGraph(),r),a.updateLayout(r);break}}).on("dragend",function(){g&&g.setUnfixed(A)}),T.setDraggable(O,!!S.get("cursor"));var k=S.get(["emphasis","focus"]);k==="adjacency"&&(Cr(T).focus=w.getAdjacentDataIndices())}}),f.graph.eachEdge(function(w){var A=w.getGraphicEl(),T=w.getModel().get(["emphasis","focus"]);A&&T==="adjacency"&&(Cr(A).focus={edge:[w.dataIndex],node:[w.node1.dataIndex,w.node2.dataIndex]})});var y=r.get("layout")==="circular"&&r.get(["circular","rotateLabel"]),b=f.getLayout("cx"),x=f.getLayout("cy");f.graph.eachNode(function(w){tut(w,y,b,x)}),this._firstRender=!1,o||this._renderThumbnail(r,i,this._symbolDraw,this._lineDraw)},e.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose()},e.prototype._startForceLayoutIteration=function(r,n,i){var a=this,s=!1;(function o(){r.step(function(l){a.updateLayout(a._model),(l||!s)&&(s=!0,a._renderThumbnail(a._model,n,a._symbolDraw,a._lineDraw)),(a._layouting=!l)&&(i?a._layoutTimeout=setTimeout(o,16):o())})})()},e.prototype.__updateOnOwnRoam=function(r,n,i){var a=yY(n);!this._active||!a||(Lx(this._mainGroup,Fm,a,null),rct(r)&&(this._updateNodeAndLinkScale(),Wme(n.getGraph(),cB(n)),this._lineDraw.updateLayout(),i.updateLabelLayout()),this._updateThumbnailWindow())},e.prototype._updateNodeAndLinkScale=function(){var r=this._model,n=r.getData(),i=cB(r);n.eachItemGraphicEl(function(a,s){a&&a.setSymbolScale(i)})},e.prototype.updateLayout=function(r){this._active&&(Wme(r.getGraph(),cB(r)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout())},e.prototype.remove=function(){this._active=!1,clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove(),this._controller&&this._controller.disable()},e.prototype._getThumbnailInfo=function(){var r=this._model,n=r.coordinateSystem;if(n.type==="view"){var i=G8r(r);if(i)return{bridge:i,coordSys:n}}},e.prototype._updateThumbnailWindow=function(){var r=this._getThumbnailInfo();r&&r.bridge.updateWindow(fY(null,r.coordSys),this._api)},e.prototype._renderThumbnail=function(r,n,i,a){var s=this._getThumbnailInfo();if(s){var o=new pr,l=i.group.children(),u=a.group.children(),h=new pr,d=new pr;o.add(d),o.add(h);for(var f=0;f "),value:a.value,noValue:a.value==null})}return no("nameValue",{name:a.name,value:a.value,noValue:a.value==null})},e.prototype.getDataParams=function(r,n){var i=t.prototype.getDataParams.call(this,r,n);if(n==="node"){var a=this.getData(),s=this.getGraph().getNodeByIndex(r);if(i.name==null&&(i.name=a.getName(r)),i.value==null){var o=s.getLayout().value;i.value=o}}return i},e.type="series."+hB,e.defaultOption={z:2,coordinateSystem:"none",legendHoverLink:!0,colorBy:"data",left:0,top:0,right:0,bottom:0,width:null,height:null,center:["50%","50%"],radius:["70%","80%"],clockwise:!0,startAngle:90,endAngle:"auto",minAngle:0,padAngle:3,itemStyle:{borderRadius:[0,0,5,5]},lineStyle:{width:0,color:"source",opacity:.2},label:{show:!0,position:"outside",distance:5},emphasis:{focus:"adjacency",lineStyle:{opacity:.5}}},e}(Ri),put=function(t){rt(e,t);function e(r,n,i){var a=t.call(this)||this;Cr(a).dataType="node",a.z2=2;var s=new Pn;return a.setTextContent(s),a.updateData(r,n,i,!0),a}return e.prototype.updateData=function(r,n,i,a){var s=this,o=r.graph.getNodeByIndex(n),l=r.hostModel,u=o.getModel(),h=u.getModel("emphasis"),d=r.getItemLayout(n),f=ot($m(u.getModel("itemStyle"),d,!0),d),p=this;if(isNaN(f.startAngle)){p.setShape(f);return}a?p.setShape(f):Hn(p,{shape:f},l,n);var g=ot($m(u.getModel("itemStyle"),d,!0),d);s.setShape(g),s.useStyle(r.getItemVisual(n,"style")),To(s,u),this._updateLabel(l,u,o),r.setItemGraphicEl(n,p),To(p,u,"itemStyle");var m=h.get("focus");wa(this,m==="adjacency"?o.getAdjacentDataIndices():m,h.get("blurScope"),h.get("disabled"))},e.prototype._updateLabel=function(r,n,i){var a=this.getTextContent(),s=i.getLayout(),o=(s.startAngle+s.endAngle)/2,l=Math.cos(o),u=Math.sin(o),h=n.getModel("label");a.ignore=!h.get("show");var d=So(n),f=i.getVisual("style");qo(a,d,{labelFetcher:{getFormattedLabel:function(b,x,w,A,T,S){return r.getFormattedLabel(b,x,"node",A,Ch(T,d.normal&&d.normal.get("formatter"),n.get("name")),S)}},labelDataIndex:i.dataIndex,defaultText:i.dataIndex+"",inheritColor:f.fill,defaultOpacity:f.opacity,defaultOutsidePosition:"startArc"});var p=h.get("position")||"outside",g=h.get("distance")||0,m;p==="outside"?m=s.r+g:m=(s.r+s.r0)/2,this.textConfig={inside:p!=="outside"};var v=p!=="outside"?h.get("align")||"center":l>0?"left":"right",y=p!=="outside"?h.get("verticalAlign")||"middle":u>0?"top":"bottom";a.attr({x:l*m+s.cx,y:u*m+s.cy,rotation:0,style:{align:v,verticalAlign:y}})},e}(nc),Z8r=function(t){rt(e,t);function e(r,n,i,a){var s=t.call(this)||this;return Cr(s).dataType="edge",s.updateData(r,n,i,a,!0),s}return e.prototype.buildPath=function(r,n){r.moveTo(n.s1[0],n.s1[1]);var i=.7,a=n.clockwise;r.arc(n.cx,n.cy,n.r,n.sStartAngle,n.sEndAngle,!a),r.bezierCurveTo((n.cx-n.s2[0])*i+n.s2[0],(n.cy-n.s2[1])*i+n.s2[1],(n.cx-n.t1[0])*i+n.t1[0],(n.cy-n.t1[1])*i+n.t1[1],n.t1[0],n.t1[1]),r.arc(n.cx,n.cy,n.r,n.tStartAngle,n.tEndAngle,!a),r.bezierCurveTo((n.cx-n.t2[0])*i+n.t2[0],(n.cy-n.t2[1])*i+n.t2[1],(n.cx-n.s1[0])*i+n.s1[0],(n.cy-n.s1[1])*i+n.s1[1],n.s1[0],n.s1[1]),r.closePath()},e.prototype.updateData=function(r,n,i,a,s){var o=r.hostModel,l=n.graph.getEdgeByIndex(i),u=l.getLayout(),h=l.node1.getModel(),d=n.getItemModel(l.dataIndex),f=d.getModel("lineStyle"),p=d.getModel("emphasis"),g=p.get("focus"),m=ot($m(h.getModel("itemStyle"),u,!0),u),v=this;if(isNaN(m.sStartAngle)||isNaN(m.tStartAngle)){v.setShape(m);return}s?(v.setShape(m),gut(v,l,r,f)):(zf(v),gut(v,l,r,f),Hn(v,{shape:m},o,i)),wa(this,g==="adjacency"?l.getAdjacentDataIndices():g,p.get("blurScope"),p.get("disabled")),To(v,d,"lineStyle"),n.setItemGraphicEl(l.dataIndex,v)},e}(vn);function gut(t,e,r,n){var i=e.node1,a=e.node2,s=t.style;t.setStyle(n.getLineStyle());var o=n.get("color");switch(o){case"source":s.fill=r.getItemVisual(i.dataIndex,"style").fill,s.decal=i.getVisual("style").decal;break;case"target":s.fill=r.getItemVisual(a.dataIndex,"style").fill,s.decal=a.getVisual("style").decal;break;case"gradient":var l=r.getItemVisual(i.dataIndex,"style").fill,u=r.getItemVisual(a.dataIndex,"style").fill;if(Nt(l)&&Nt(u)){var h=t.shape,d=(h.s1[0]+h.s2[0])/2,f=(h.s1[1]+h.s2[1])/2,p=(h.t1[0]+h.t2[0])/2,g=(h.t1[1]+h.t2[1])/2;s.fill=new tT(d,f,p,g,[{offset:0,color:l},{offset:1,color:u}],!0)}break}}var J8r=Math.PI/180,eBr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=hB,r}return e.prototype.init=function(r,n){},e.prototype.render=function(r,n,i){var a=r.getData(),s=this._data,o=this.group,l=-r.get("startAngle")*J8r;if(a.diff(s).add(function(h){var d=a.getItemLayout(h);if(d){var f=new put(a,h,l);Cr(f).dataIndex=h,o.add(f)}}).update(function(h,d){var f=s.getItemGraphicEl(d),p=a.getItemLayout(h);if(!p){f&&cy(f,r,d);return}f?f.updateData(a,h,l):f=new put(a,h,l),o.add(f)}).remove(function(h){var d=s.getItemGraphicEl(h);d&&cy(d,r,h)}).execute(),!s){var u=r.get("center");this.group.scaleX=.01,this.group.scaleY=.01,this.group.originX=Qt(u[0],i.getWidth()),this.group.originY=Qt(u[1],i.getHeight()),ia(this.group,{scaleX:1,scaleY:1},r)}this._data=a,this.renderEdges(r,l)},e.prototype.renderEdges=function(r,n){var i=r.getData(),a=r.getEdgeData(),s=this._edgeData,o=this.group;a.diff(s).add(function(l){var u=new Z8r(i,a,l,n);Cr(u).dataIndex=l,o.add(u)}).update(function(l,u){var h=s.getItemGraphicEl(u);h.updateData(i,a,l,n),o.add(h)}).remove(function(l){var u=s.getItemGraphicEl(l);u&&cy(u,r,l)}).execute(),this._edgeData=a},e.prototype.dispose=function(){},e.type=hB,e}(Ti),Yme=Math.PI/180,tBr=Ao(hB,rBr);function rBr(t,e){t.eachSeriesByType(hB,function(r){nBr(r,e)})}function nBr(t,e){var r=t.getData(),n=r.graph,i=t.getEdgeData(),a=i.count();if(a){var s=krt(t,e),o=s.cx,l=s.cy,u=s.r,h=s.r0,d=Math.max((t.get("padAngle")||0)*Yme,0),f=Math.max((t.get("minAngle")||0)*Yme,0),p=-t.get("startAngle")*Yme,g=p+Math.PI*2,m=t.get("clockwise"),v=m?1:-1,y=[p,g];uH(y,!m);var b=y[0],x=y[1],w=x-b,A=r.getSum("value")===0&&i.getSum("value")===0,T=[],S=0;n.eachEdge(function(N){var F=A?1:N.getValue("value");A&&(F>0||f)&&(S+=2);var B=N.node1.dataIndex,V=N.node2.dataIndex;T[B]=(T[B]||0)+F,T[V]=(T[V]||0)+F});var O=0;if(n.eachNode(function(N){var F=N.getValue("value");isNaN(F)||(T[N.dataIndex]=Math.max(F,T[N.dataIndex]||0)),!A&&(T[N.dataIndex]>0||f)&&S++,O+=T[N.dataIndex]||0}),!(S===0||O===0)){d*S>=Math.abs(w)&&(d=Math.max(0,(Math.abs(w)-f*S)/S)),(d+f)*S>=Math.abs(w)&&(f=(Math.abs(w)-d*S)/S);var k=(w-d*S*v)/O,E=0,_=0,I=0;n.eachNode(function(N){var F=T[N.dataIndex]||0,B=k*(O?F:1)*v;Math.abs(B)_){var R=E/_;n.eachNode(function(N){var F=N.getLayout().angle;Math.abs(F)>=f?N.setLayout({angle:F*R,ratio:R},!0):N.setLayout({angle:f,ratio:f===0?1:F/f},!0)})}else n.eachNode(function(N){if(!L){var F=N.getLayout().angle,B=Math.min(F/I,1),V=B*E;F-Vf&&f>0){var B=L?1:Math.min(F/I,1),V=F-f,z=Math.min(V,Math.min(D,E*B));D-=z,N.setLayout({angle:F-z,ratio:(F-z)/F},!0)}else f>0&&N.setLayout({angle:f,ratio:F===0?1:f/F},!0)}});var M=b,P=[];n.eachNode(function(N){var F=Math.max(N.getLayout().angle,f);N.setLayout({cx:o,cy:l,r0:h,r:u,startAngle:M,endAngle:M+F*v,clockwise:m},!0),P[N.dataIndex]=M,M+=(F+d)*v}),n.eachEdge(function(N){var F=A?1:N.getValue("value"),B=k*(O?F:1)*v,V=N.node1.dataIndex,z=P[V]||0,U=Math.abs((N.node1.getLayout().ratio||1)*B),Q=z+U*v,G=[o+h*Math.cos(z),l+h*Math.sin(z)],X=[o+h*Math.cos(Q),l+h*Math.sin(Q)],Y=N.node2.dataIndex,le=P[Y]||0,q=Math.abs((N.node2.getLayout().ratio||1)*B),Z=le+q*v,ee=[o+h*Math.cos(le),l+h*Math.sin(le)],re=[o+h*Math.cos(Z),l+h*Math.sin(Z)];N.setLayout({s1:G,s2:X,sStartAngle:z,sEndAngle:Q,t1:ee,t2:re,tStartAngle:le,tEndAngle:Z,cx:o,cy:l,r:h,value:F,clockwise:m}),P[V]=Q,P[Y]=Z})}}}function iBr(t){t.registerChartView(eBr),t.registerSeriesModel(K8r),t.registerLayout(t.PRIORITY.VISUAL.POST_CHART_LAYOUT,tBr),t.registerProcessor(V8("chord"))}var aBr=function(){function t(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return t}(),sBr=function(t){rt(e,t);function e(r){var n=t.call(this,r)||this;return n.type="pointer",n}return e.prototype.getDefaultShape=function(){return new aBr},e.prototype.buildPath=function(r,n){var i=Math.cos,a=Math.sin,s=n.r,o=n.width,l=n.angle,u=n.x-i(l)*o*(o>=s/3?1:2),h=n.y-a(l)*o*(o>=s/3?1:2);l=n.angle-Math.PI/2,r.moveTo(u,h),r.lineTo(n.x+i(l)*o,n.y+a(l)*o),r.lineTo(n.x+i(n.angle)*s,n.y+a(n.angle)*s),r.lineTo(n.x-i(l)*o,n.y-a(l)*o),r.lineTo(u,h)},e}(vn);function oBr(t,e){var r=t.get("center"),n=e.getWidth(),i=e.getHeight(),a=Math.min(n,i),s=Qt(r[0],e.getWidth()),o=Qt(r[1],e.getHeight()),l=Qt(t.get("radius"),a/2);return{cx:s,cy:o,r:l}}function RY(t,e){var r=t==null?"":t+"";return e&&(Nt(e)?r=e.replace("{value}",r):ur(e)&&(r=e(t))),r}var lBr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){this.group.removeAll();var a=r.get(["axisLine","lineStyle","color"]),s=oBr(r,i);this._renderMain(r,n,i,a,s),this._data=r.getData()},e.prototype.dispose=function(){},e.prototype._renderMain=function(r,n,i,a,s){var o=this.group,l=r.get("clockwise"),u=-r.get("startAngle")/180*Math.PI,h=-r.get("endAngle")/180*Math.PI,d=r.getModel("axisLine"),f=d.get("roundCap"),p=f?KW:nc,g=d.get("show"),m=d.getModel("lineStyle"),v=m.get("width"),y=[u,h];uH(y,!l),u=y[0],h=y[1];for(var b=h-u,x=u,w=[],A=0;g&&A=k&&(E===0?0:a[E-1][0])Math.PI/2&&(Q+=Math.PI)):U==="tangential"?Q=-O-Math.PI/2:zn(U)&&(Q=U*Math.PI/180),Q===0?d.add(new Pn({style:Gi(x,{text:F,x:V,y:z,verticalAlign:D<-.8?"top":D>.8?"bottom":"middle",align:R<-.4?"left":R>.4?"right":"center"},{inheritColor:B}),silent:!0})):d.add(new Pn({style:Gi(x,{text:F,x:V,y:z,verticalAlign:"middle",align:"center"},{inheritColor:B}),silent:!0,originX:V,originY:z,rotation:Q}))}if(b.get("show")&&M!==w){var P=b.get("distance");P=P?P+h:h;for(var G=0;G<=A;G++){R=Math.cos(O),D=Math.sin(O);var X=new Ps({shape:{x1:R*(g-P)+f,y1:D*(g-P)+p,x2:R*(g-S-P)+f,y2:D*(g-S-P)+p},silent:!0,style:I});I.stroke==="auto"&&X.setStyle({stroke:a((M+G/A)/w)}),d.add(X),O+=E}O-=E}else O+=k}},e.prototype._renderPointer=function(r,n,i,a,s,o,l,u,h){var d=this.group,f=this._data,p=this._progressEls,g=[],m=r.get(["pointer","show"]),v=r.getModel("progress"),y=v.get("show"),b=r.getData(),x=b.mapDimension("value"),w=+r.get("min"),A=+r.get("max"),T=[w,A],S=[o,l];function O(E,_){var I=b.getItemModel(E),L=I.getModel("pointer"),R=Qt(L.get("width"),s.r),D=Qt(L.get("length"),s.r),M=r.get(["pointer","icon"]),P=L.get("offsetCenter"),N=Qt(P[0],s.r),F=Qt(P[1],s.r),B=L.get("keepAspect"),V;return M?V=$s(M,N-R/2,F-D,R,D,null,B):V=new sBr({shape:{angle:-Math.PI/2,width:R,r:D,x:N,y:F}}),V.rotation=-(_+Math.PI/2),V.x=s.cx,V.y=s.cy,V}function k(E,_){var I=v.get("roundCap"),L=I?KW:nc,R=v.get("overlap"),D=R?v.get("width"):h/b.count(),M=R?s.r-D:s.r-(E+1)*D,P=R?s.r:s.r-E*D,N=new L({shape:{startAngle:o,endAngle:_,cx:s.cx,cy:s.cy,clockwise:u,r0:M,r:P}});return R&&(N.z2=jn(b.get(x,E),[w,A],[100,0],!0)),N}(y||m)&&(b.diff(f).add(function(E){var _=b.get(x,E);if(m){var I=O(E,o);ia(I,{rotation:-((isNaN(+_)?S[0]:jn(_,T,S,!0))+Math.PI/2)},r),d.add(I),b.setItemGraphicEl(E,I)}if(y){var L=k(E,o),R=v.get("clip");ia(L,{shape:{endAngle:jn(_,T,S,R)}},r),d.add(L),Fde(r.seriesIndex,b.dataType,E,L),g[E]=L}}).update(function(E,_){var I=b.get(x,E);if(m){var L=f.getItemGraphicEl(_),R=L?L.rotation:o,D=O(E,R);D.rotation=R,Hn(D,{rotation:-((isNaN(+I)?S[0]:jn(I,T,S,!0))+Math.PI/2)},r),d.add(D),b.setItemGraphicEl(E,D)}if(y){var M=p[_],P=M?M.shape.endAngle:o,N=k(E,P),F=v.get("clip");Hn(N,{shape:{endAngle:jn(I,T,S,F)}},r),d.add(N),Fde(r.seriesIndex,b.dataType,E,N),g[E]=N}}).execute(),b.each(function(E){var _=b.getItemModel(E),I=_.getModel("emphasis"),L=I.get("focus"),R=I.get("blurScope"),D=I.get("disabled"),M=a(jn(b.get(x,E),T,[0,1],!0));if(m){var P=b.getItemGraphicEl(E),N=b.getItemVisual(E,"style"),F=N.fill;if(P instanceof Yo){var B=P.style;P.useStyle(ot({image:B.image,x:B.x,y:B.y,width:B.width,height:B.height},N))}else P.useStyle(N),P.type!=="pointer"&&P.setColor(F);P.setStyle(_.getModel(["pointer","itemStyle"]).getItemStyle()),P.style.fill==="auto"&&P.setStyle("fill",M),P.z2EmphasisLift=0,To(P,_),wa(P,L,R,D)}if(y){var V=g[E];V.useStyle(b.getItemVisual(E,"style")),V.setStyle(_.getModel(["progress","itemStyle"]).getItemStyle()),V.style.fill==="auto"&&V.setStyle("fill",M),V.z2EmphasisLift=0,To(V,_),wa(V,L,R,D)}}),this._progressEls=g)},e.prototype._renderAnchor=function(r,n){var i=r.getModel("anchor"),a=i.get("show");if(a){var s=i.get("size"),o=i.get("icon"),l=i.get("offsetCenter"),u=i.get("keepAspect"),h=$s(o,n.cx-s/2+Qt(l[0],n.r),n.cy-s/2+Qt(l[1],n.r),s,s,null,u);h.z2=i.get("showAbove")?1:0,h.setStyle(i.getModel("itemStyle").getItemStyle()),this.group.add(h)}},e.prototype._renderTitleAndDetail=function(r,n,i,a,s){var o=this,l=r.getData(),u=l.mapDimension("value"),h=+r.get("min"),d=+r.get("max"),f=new pr,p=[],g=[],m=r.isAnimationEnabled(),v=r.get(["pointer","showAbove"]);l.diff(this._data).add(function(y){p[y]=new Pn({silent:!0}),g[y]=new Pn({silent:!0})}).update(function(y,b){p[y]=o._titleEls[b],g[y]=o._detailEls[b]}).execute(),l.each(function(y){var b=l.getItemModel(y),x=l.get(u,y),w=new pr,A=a(jn(x,[h,d],[0,1],!0)),T=b.getModel("title");if(T.get("show")){var S=T.get("offsetCenter"),O=s.cx+Qt(S[0],s.r),k=s.cy+Qt(S[1],s.r),E=p[y];E.attr({z2:v?0:2,style:Gi(T,{x:O,y:k,text:l.getName(y),align:"center",verticalAlign:"middle"},{inheritColor:A})}),w.add(E)}var _=b.getModel("detail");if(_.get("show")){var I=_.get("offsetCenter"),L=s.cx+Qt(I[0],s.r),R=s.cy+Qt(I[1],s.r),D=Qt(_.get("width"),s.r),M=Qt(_.get("height"),s.r),P=r.get(["progress","show"])?l.getItemVisual(y,"style").fill:A,E=g[y],N=_.get("formatter");E.attr({z2:v?0:2,style:Gi(_,{x:L,y:R,text:RY(x,N),width:isNaN(D)?null:D,height:isNaN(M)?null:M,align:"center",verticalAlign:"middle"},{inheritColor:P})}),trt(E,{normal:_},x,function(B){return RY(B,N)}),m&&rrt(E,y,l,r,{getFormattedLabel:function(B,V,z,U,Q,G){return RY(G?G.interpolatedValue:x,N)}}),w.add(E)}f.add(w)}),this.group.add(f),this._titleEls=p,this._detailEls=g},e.type="gauge",e}(Ti),cBr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.visualStyleAccessPath="itemStyle",r}return e.prototype.getInitialData=function(r,n){return t5(this,["value"])},e.type="series.gauge",e.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,et.color.neutral10]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:et.color.axisTick,width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:et.color.axisTickMinor,width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:et.color.axisLabel,fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:et.color.neutral00,borderWidth:0,borderColor:et.color.theme[0]}},title:{show:!0,offsetCenter:[0,"20%"],color:et.color.secondary,fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:et.color.transparent,borderWidth:0,borderColor:et.color.neutral40,width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:et.color.primary,fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},e}(Ri);function uBr(t){t.registerChartView(lBr),t.registerSeriesModel(cBr)}var c5="funnel",hBr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new r5(Ht(this.getData,this),Ht(this.getRawData,this)),this._defaultLabelLine(r)},e.prototype.getInitialData=function(r,n){return t5(this,{coordDimensions:["value"],encodeDefaulter:qr(Ffe,this)})},e.prototype._defaultLabelLine=function(r){$A(r,"labelLine",["show"]);var n=r.labelLine,i=r.emphasis.labelLine;n.show=n.show&&r.label.show,i.show=i.show&&r.emphasis.label.show},e.prototype.getDataParams=function(r){var n=this.getData(),i=t.prototype.getDataParams.call(this,r),a=n.mapDimension("value"),s=n.getSum(a);return i.percent=s?+(n.get(a,r)/s*100).toFixed(2):0,i.$vars.push("percent"),i},e.type="series."+c5,e.defaultOption={coordinateSystemUsage:"box",z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:65,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:et.color.neutral00,borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:et.color.primary}}},e}(Ri),dBr=["itemStyle","opacity"],fBr=function(t){rt(e,t);function e(r,n){var i=t.call(this)||this,a=i,s=new Al,o=new Pn;return a.setTextContent(o),i.setTextGuideLine(s),i.updateData(r,n,!0),i}return e.prototype.updateData=function(r,n,i){var a=this,s=r.hostModel,o=r.getItemModel(n),l=r.getItemLayout(n),u=o.getModel("emphasis"),h=o.get(dBr);h=h??1,i||zf(a),a.useStyle(r.getItemVisual(n,"style")),a.style.lineJoin="round",i?(a.setShape({points:l.points}),a.style.opacity=0,ia(a,{style:{opacity:h}},s,n)):Hn(a,{style:{opacity:h},shape:{points:l.points}},s,n),To(a,o),this._updateLabel(r,n),wa(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(r,n){var i=this,a=this.getTextGuideLine(),s=i.getTextContent(),o=r.hostModel,l=r.getItemModel(n),u=r.getItemLayout(n),h=u.label,d=r.getItemVisual(n,"style"),f=d.fill;qo(s,So(l),{labelFetcher:r.hostModel,labelDataIndex:n,defaultOpacity:d.opacity,defaultText:r.getName(n)},{normal:{align:h.textAlign,verticalAlign:h.verticalAlign}});var p=l.getModel("label"),g=p.get("color"),m=g==="inherit"?f:null;i.setTextConfig({local:!0,inside:!!h.inside,insideStroke:m,outsideFill:m});var v=h.linePoints;a.setShape({points:v}),i.textGuideLineConfig={anchor:v?new wr(v[0][0],v[0][1]):null},Hn(s,{style:{x:h.x,y:h.y}},o,n),s.attr({rotation:h.rotation,originX:h.x,originY:h.y,z2:10}),nge(i,ige(l),{stroke:f})},e}(ic),pBr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=c5,r.ignoreLabelLineUpdate=!0,r}return e.prototype.render=function(r,n,i){var a=r.getData(),s=this._data,o=this.group;a.diff(s).add(function(l){var u=new fBr(a,l);a.setItemGraphicEl(l,u),o.add(u)}).update(function(l,u){var h=s.getItemGraphicEl(u);h.updateData(a,l),o.add(h),a.setItemGraphicEl(l,h)}).remove(function(l){var u=s.getItemGraphicEl(l);cy(u,r,l)}).execute(),this._data=a},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.prototype.dispose=function(){},e.type=c5,e}(Ti);function gBr(t,e){for(var r=t.mapDimension("value"),n=t.mapArray(r,function(l){return l}),i=[],a=e==="ascending",s=0,o=t.count();s-1&&(s="left"),r&&Ir(["left","right"],s)>-1&&(s="bottom")),s==="left"?(m=(u[3][0]+u[0][0])/2,v=(u[3][1]+u[0][1])/2,y=m-x,f=y-5,d="right"):s==="right"?(m=(u[1][0]+u[2][0])/2,v=(u[1][1]+u[2][1])/2,y=m+x,f=y+5,d="left"):s==="top"?(m=(u[3][0]+u[0][0])/2,v=(u[3][1]+u[0][1])/2,b=v-x,p=b-5,d="center"):s==="bottom"?(m=(u[1][0]+u[2][0])/2,v=(u[1][1]+u[2][1])/2,b=v+x,p=b+5,d="center"):s==="rightTop"?(m=r?u[3][0]:u[1][0],v=r?u[3][1]:u[1][1],r?(b=v-x,p=b-5,d="center"):(y=m+x,f=y+5,d="top")):s==="rightBottom"?(m=u[2][0],v=u[2][1],r?(b=v+x,p=b+5,d="center"):(y=m+x,f=y+5,d="bottom")):s==="leftTop"?(m=u[0][0],v=r?u[0][1]:u[1][1],r?(b=v-x,p=b-5,d="center"):(y=m-x,f=y-5,d="right")):s==="leftBottom"?(m=r?u[1][0]:u[3][0],v=r?u[1][1]:u[2][1],r?(b=v+x,p=b+5,d="center"):(y=m-x,f=y-5,d="right")):(m=(u[1][0]+u[2][0])/2,v=(u[1][1]+u[2][1])/2,r?(b=v+x,p=b+5,d="center"):(y=m+x,f=y+5,d="left")),r?(y=m,f=y):(b=v,p=b),g=[[m,v],[y,b]]}l.label={linePoints:g,x:f,y:p,verticalAlign:"middle",textAlign:d,inside:h}})}var vBr=Ao(c5,yBr);function yBr(t,e){t.eachSeriesByType(c5,function(r){var n=r.getData(),i=n.mapDimension("value"),a=r.get("sort"),s=Co(r,e),o=da(r.getBoxLayoutParams(),s.refContainer),l=mut(r),u=o.width,h=o.height,d=gBr(n,a),f=o.x,p=o.y,g=l?[Qt(r.get("minSize"),h),Qt(r.get("maxSize"),h)]:[Qt(r.get("minSize"),u),Qt(r.get("maxSize"),u)],m=n.getDataExtent(i),v=r.get("min"),y=r.get("max");v==null&&(v=Math.min(m[0],0)),y==null&&(y=m[1]);var b=r.get("funnelAlign"),x=r.get("gap"),w=l?u:h,A=(w-x*(n.count()-1))/n.count(),T=function(D,M){if(l){var P=n.get(i,D)||0,N=jn(P,[v,y],g,!0),F=void 0;switch(b){case"top":F=p;break;case"center":F=p+(h-N)/2;break;case"bottom":F=p+(h-N);break}return[[M,F],[M,F+N]]}var B=n.get(i,D)||0,V=jn(B,[v,y],g,!0),z;switch(b){case"left":z=f;break;case"center":z=f+(u-V)/2;break;case"right":z=f+u-V;break}return[[z,M],[z+V,M]]};a==="ascending"&&(A=-A,x=-x,l?f+=u:p+=h,d=d.reverse());for(var S=0;SLBr)return;var i=this._model.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]);i.behavior!=="none"&&this._dispatchExpand({axisExpandWindow:i.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(t){if(!(this._mouseDownPoint||!jme(this,"mousemove"))){var e=this._model,r=e.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]),n=r.behavior;n==="jump"&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand(n==="none"?null:{axisExpandWindow:r.axisExpandWindow,animation:n==="jump"?null:{duration:0}})}}};function jme(t,e){var r=t._model;return r.get("axisExpandable")&&r.get("axisExpandTriggerOn")===e}var DY="parallel",Xme=DY,PBr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(){t.prototype.init.apply(this,arguments),this.mergeOption({})},e.prototype.mergeOption=function(r){var n=this.option;r&&Vr(n,r,!0),this._initDimensions()},e.prototype.contains=function(r,n){var i=r.get("parallelIndex");return i!=null&&n.getComponent("parallel",i)===this},e.prototype.setAxisExpand=function(r){de(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],function(n){r.hasOwnProperty(n)&&(this.option[n]=r[n])},this)},e.prototype._initDimensions=function(){var r=this.dimensions=[],n=this.parallelAxisIndex=[],i=ni(this.ecModel.queryComponents({mainType:"parallelAxis"}),function(a){return(a.get("parallelIndex")||0)===this.componentIndex},this);de(i,function(a){r.push("dim"+a.get("dim")),n.push(a.componentIndex)})},e.type=Xme,e.dependencies=["parallelAxis"],e.layoutMode="box",e.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},e}(fn),NBr=function(t){rt(e,t);function e(r,n,i,a,s){var o=t.call(this,r,n,i)||this;return o.type=a||"value",o.axisIndex=s,o}return e.prototype.isHorizontal=function(){return this.coordinateSystem.getModel().get("layout")!=="horizontal"},e}(Wf);function Ix(t,e,r,n,i,a){t=t||0;var s=NA(r[1],-r[0]);if(i!=null&&(i=u5(i,[0,s])),a!=null&&(a=Math.max(a,i??0)),n==="all"){var o=Math.abs(NA(e[1],-e[0]));o=u5(o,[0,s]),i=a=u5(o,[i,a]),n=0}e[0]=u5(e[0],r),e[1]=u5(e[1],r);var l=Kme(e,n);e[n]+=t;var u=i||0,h=r.slice();l.sign<0?h[0]=NA(h[0],u):h[1]=NA(h[1],-u),e[n]=u5(e[n],h);var d;return d=Kme(e,n),i!=null&&(d.sign!==l.sign||d.spana&&(e[1-n]=NA(e[n],d.sign*a)),e}function Kme(t,e){var r=t[e]-t[1-e];return{span:Math.abs(r),sign:r>0?-1:r<0?1:e?-1:1}}function u5(t,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,t))}var BBr=function(){function t(e,r,n){this.type=DY,this._axesMap=Yt(),this._axesLayout={},this.dimensions=e.dimensions,this._model=e,this._init(e,r,n)}return t.prototype._init=function(e,r,n){var i=e.dimensions,a=e.parallelAxisIndex;de(i,function(s,o){var l=a[o],u=r.getComponent("parallelAxis",l),h=w8(u),d=this._axesMap.set(s,new NBr(s,G_(u,h,!1),[0,0],h,l));d.onBand=S8(d.scale,u),d.inverse=u.get("inverse"),u.axis=d,d.model=u,d.coordinateSystem=u.coordinateSystem=this},this)},t.prototype.update=function(e,r){de(this.dimensions,function(n){var i=this._axesMap.get(n);ET(i,j_),X_(i)},this)},t.prototype.containPoint=function(e){var r=this._makeLayoutInfo(),n=r.axisBase,i=r.layoutBase,a=r.pixelDimIndex,s=e[1-a],o=e[a];return s>=n&&s<=n+r.axisLength&&o>=i&&o<=i+r.layoutLength},t.prototype.getModel=function(){return this._model},t.prototype.resize=function(e,r){var n=Co(e,r).refContainer;this._rect=da(e.getBoxLayoutParams(),n),this._layoutAxes()},t.prototype.getRect=function(){return this._rect},t.prototype._makeLayoutInfo=function(){var e=this._model,r=this._rect,n=["x","y"],i=["width","height"],a=e.get("layout"),s=a==="horizontal"?0:1,o=r[i[s]],l=[0,o],u=this.dimensions.length,h=LY(e.get("axisExpandWidth"),l),d=LY(e.get("axisExpandCount")||0,[0,u]),f=e.get("axisExpandable")&&u>3&&u>d&&d>1&&h>0&&o>0,p=e.get("axisExpandWindow"),g;if(p)g=LY(p[1]-p[0],l),p[1]=p[0]+g;else{g=LY(h*(d-1),l);var m=e.get("axisExpandCenter")||Nf(u/2);p=[h*m-g/2],p[1]=p[0]+g}var v=(o-g)/(u-d);v<3&&(v=0);var y=[Nf(Gn(p[0]/h,1))+1,MA(Gn(p[1]/h,1))-1],b=v/h*p[0];return{layout:a,pixelDimIndex:s,layoutBase:r[n[s]],layoutLength:o,axisBase:r[n[1-s]],axisLength:r[i[1-s]],axisExpandable:f,axisExpandWidth:h,axisCollapseWidth:v,axisExpandWindow:p,axisCount:u,winInnerIndices:y,axisExpandWindow0Pos:b}},t.prototype._layoutAxes=function(){var e=this._rect,r=this._axesMap,n=this.dimensions,i=this._makeLayoutInfo(),a=i.layout;r.each(function(s){var o=[0,i.axisLength],l=s.inverse?1:0;s.setExtent(o[l],o[1-l])}),de(n,function(s,o){var l=(i.axisExpandable?FBr:$Br)(o,i),u={horizontal:{x:l.position,y:i.axisLength},vertical:{x:0,y:l.position}},h={horizontal:XG/2,vertical:0},d=[u[a].x+e.x,u[a].y+e.y],f=h[a],p=xa();Zv(p,p,f),zp(p,p,d),this._axesLayout[s]={position:d,rotation:f,transform:p,axisNameAvailableWidth:l.axisNameAvailableWidth,axisLabelShow:l.axisLabelShow,nameTruncateMaxWidth:l.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},t.prototype.getAxis=function(e){return this._axesMap.get(e)},t.prototype.dataToPoint=function(e,r){return this.axisCoordToPoint(this._axesMap.get(r).dataToCoord(e),r)},t.prototype.eachActiveState=function(e,r,n,i){n==null&&(n=0),i==null&&(i=e.count());var a=this._axesMap,s=this.dimensions,o=[],l=[];de(s,function(v){o.push(e.mapDimension(v)),l.push(a.get(v).model)});for(var u=this.hasAxisBrushed(),h=n;ha*(1-d[0])?(u="jump",l=o-a*(1-d[2])):(l=o-a*d[1])>=0&&(l=o-a*(1-d[1]))<=0&&(l=0),l*=r.axisExpandWidth/h,l?Ix(l,i,s,"all"):u="none";else{var p=i[1]-i[0],g=s[1]*o/p;i=[en(0,g-p/2)],i[1]=Ai(s[1],i[0]+p),i[0]=i[1]-p}return{axisExpandWindow:i,behavior:u}},t}();function LY(t,e){return Ai(en(t,e[0]),e[1])}function $Br(t,e){var r=e.layoutLength/(e.axisCount-1);return{position:r*t,axisNameAvailableWidth:r,axisLabelShow:!0}}function FBr(t,e){var r=e.layoutLength,n=e.axisExpandWidth,i=e.axisCount,a=e.axisCollapseWidth,s=e.winInnerIndices,o,l=a,u=!1,h;return t=0;i--)xl(n[i])},e.prototype.getActiveState=function(r){var n=this.activeIntervals;if(!n.length)return"normal";if(r==null||isNaN(+r))return"inactive";if(n.length===1){var i=n[0];if(i[0]<=r&&r<=i[1])return"active"}else for(var a=0,s=n.length;aGBr}function kut(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function Eut(t,e,r,n){var i=new pr;return i.add(new tn({name:"main",style:a0e(r),silent:!0,draggable:!0,cursor:"move",drift:qr(Dut,t,e,i,["n","s","w","e"]),ondragend:qr(JT,e,{isEnd:!0})})),de(n,function(a){i.add(new tn({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:qr(Dut,t,e,i,a),ondragend:qr(JT,e,{isEnd:!0})}))}),i}function _ut(t,e,r,n){var i=n.brushStyle.lineWidth||0,a=h5(i,HBr),s=r[0][0],o=r[1][0],l=s-i/2,u=o-i/2,h=r[0][1],d=r[1][1],f=h-a+i/2,p=d-a+i/2,g=h-s,m=d-o,v=g+i,y=m+i;yy(t,e,"main",s,o,g,m),n.transformable&&(yy(t,e,"w",l,u,a,y),yy(t,e,"e",f,u,a,y),yy(t,e,"n",l,u,v,a),yy(t,e,"s",l,p,v,a),yy(t,e,"nw",l,u,a,a),yy(t,e,"ne",f,u,a,a),yy(t,e,"sw",l,p,a,a),yy(t,e,"se",f,p,a,a))}function i0e(t,e){var r=e.__brushOption,n=r.transformable,i=e.childAt(0);i.useStyle(a0e(r)),i.attr({silent:!n,cursor:n?"move":"default"}),de([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var s=e.childOfName(a.join("")),o=a.length===1?s0e(t,a[0]):KBr(t,a);s&&s.attr({silent:!n,invisible:!n,cursor:n?YBr[o]+"-resize":null})})}function yy(t,e,r,n,i,a,s){var o=e.childOfName(r);o&&o.setShape(JBr(o0e(t,e,[[n,i],[n+a,i+s]])))}function a0e(t){return mr({strokeNoScale:!0},t.brushStyle)}function Rut(t,e,r,n){var i=[dB(t,r),dB(e,n)],a=[h5(t,r),h5(e,n)];return[[i[0],a[0]],[i[1],a[1]]]}function XBr(t){return iT(t.group)}function s0e(t,e){var r={w:"left",e:"right",n:"top",s:"bottom"},n={left:"w",right:"e",top:"n",bottom:"s"},i=kH(r[e],XBr(t));return n[i]}function KBr(t,e){var r=[s0e(t,e[0]),s0e(t,e[1])];return(r[0]==="e"||r[0]==="w")&&r.reverse(),r.join("")}function Dut(t,e,r,n,i,a){var s=r.__brushOption,o=t.toRectRange(s.range),l=Lut(e,i,a);de(n,function(u){var h=WBr[u];o[h[0]][h[1]]+=l[h[0]]}),s.range=t.fromRectRange(Rut(o[0][0],o[1][0],o[0][1],o[1][1])),e0e(e,r),JT(e,{isEnd:!1})}function ZBr(t,e,r,n){var i=e.__brushOption.range,a=Lut(t,r,n);de(i,function(s){s[0]+=a[0],s[1]+=a[1]}),e0e(t,e),JT(t,{isEnd:!1})}function Lut(t,e,r){var n=t.group,i=n.transformCoordToLocal(e,r),a=n.transformCoordToLocal(0,0);return[i[0]-a[0],i[1]-a[1]]}function o0e(t,e,r){var n=Out(t,e);return n&&n!==ZT?n.clipPath(r,t._transform):lr(r)}function JBr(t){var e=dB(t[0][0],t[1][0]),r=dB(t[0][1],t[1][1]),n=h5(t[0][0],t[1][0]),i=h5(t[0][1],t[1][1]);return{x:e,y:r,width:n-e,height:i-r}}function e7r(t,e,r){if(!(!t._brushType||r7r(t,e.offsetX,e.offsetY))){var n=t._zr,i=t._covers,a=r0e(t,e,r);if(!t._dragging)for(var s=0;sn.getWidth()||r<0||r>n.getHeight()}var MY={lineX:Nut(0),lineY:Nut(1),rect:{createCover:function(t,e){function r(n){return n}return Eut({toRectRange:r,fromRectRange:r},t,e,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(t){var e=kut(t);return Rut(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(t,e,r,n){_ut(t,e,r,n)},updateCommon:i0e,contain:c0e},polygon:{createCover:function(t,e){var r=new pr;return r.add(new Al({name:"main",style:a0e(e),silent:!0})),r},getCreatingRange:function(t){return t},endCreating:function(t,e){e.remove(e.childAt(0)),e.add(new ic({name:"main",draggable:!0,drift:qr(ZBr,t,e),ondragend:qr(JT,t,{isEnd:!0})}))},updateCoverShape:function(t,e,r,n){e.childAt(0).setShape({points:o0e(t,e,r)})},updateCommon:i0e,contain:c0e}};function Nut(t){return{createCover:function(e,r){return Eut({toRectRange:function(n){var i=[n,[0,100]];return t&&i.reverse(),i},fromRectRange:function(n){return n[t]}},e,r,[[["w"],["e"]],[["n"],["s"]]][t])},getCreatingRange:function(e){var r=kut(e),n=dB(r[0][t],r[1][t]),i=h5(r[0][t],r[1][t]);return[n,i]},updateCoverShape:function(e,r,n,i){var a,s=Out(e,r);if(s!==ZT&&s.getLinearBrushOtherExtent)a=s.getLinearBrushOtherExtent(t);else{var o=e._zr;a=[0,[o.getWidth(),o.getHeight()][1-t]]}var l=[n,a];t&&l.reverse(),_ut(e,r,l,i)},updateCommon:i0e,contain:c0e}}function But(t){return t=u0e(t),function(e){return lfe(e,t)}}function $ut(t,e){return t=u0e(t),function(r){var n=e??r,i=n?t.width:t.height,a=n?t.x:t.y;return[a,a+(i||0)]}}function Fut(t,e,r){var n=u0e(t);return function(i,a){return n.contain(a[0],a[1])&&!Slt(i,e,r)}}function u0e(t){return fr.create(t)}var n7r=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r,n){t.prototype.init.apply(this,arguments),(this._brushController=new Jme(n.getZr())).on("brush",Ht(this._onBrush,this))},e.prototype.render=function(r,n,i,a){if(!i7r(r,n,a)){this.axisModel=r,this.api=i,this.group.removeAll();var s=this._axisGroup;if(this._axisGroup=new pr,this.group.add(this._axisGroup),!!r.get("show")){var o=s7r(r,n),l=o.coordinateSystem,u=r.getAreaSelectStyle(),h=u.width,d=r.axis.dim,f=l.getAxisLayout(d),p=ot({strokeContainThreshold:h},f),g=new Ou(r,i,p);g.build(),this._axisGroup.add(g.group),this._refreshBrushController(p,u,r,o,h,i),HN(s,this._axisGroup,r)}}},e.prototype._refreshBrushController=function(r,n,i,a,s,o){var l=i.axis.getExtent(),u=l[1]-l[0],h=Math.min(30,Math.abs(u)*.1),d=fr.create({x:l[0],y:-s/2,width:u,height:s});d.x-=h,d.width+=2*h,this._brushController.mount({enableGlobalPan:!0,rotation:r.rotation,x:r.position[0],y:r.position[1]}).setPanels([{panelId:"pl",clipPath:But(d),isTargetByCursor:Fut(d,o,a),getLinearBrushOtherExtent:$ut(d,0)}]).enableBrush({brushType:"lineX",brushStyle:n,removeOnClick:!0}).updateCovers(a7r(i))},e.prototype._onBrush=function(r){var n=r.areas,i=this.axisModel,a=i.axis,s=vt(n,function(o){return[a.coordToData(o.range[0],!0),a.coordToData(o.range[1],!0)]});(!i.option.realtime===r.isEnd||r.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:i.id,intervals:s})},e.prototype.dispose=function(){this._brushController.dispose()},e.type="parallelAxis",e}(Hi);function i7r(t,e,r){return r&&r.type==="axisAreaSelect"&&e.findComponents({mainType:"parallelAxis",query:r})[0]===t}function a7r(t){var e=t.axis;return vt(t.activeIntervals,function(r){return{brushType:"lineX",panelId:"pl",range:[e.dataToCoord(r[0],!0),e.dataToCoord(r[1],!0)]}})}function s7r(t,e){return e.getComponent("parallel",t.get("parallelIndex"))}var o7r={type:"axisAreaSelect",event:"axisAreaSelected"};function l7r(t){t.registerAction(o7r,function(e,r){r.eachComponent({mainType:"parallelAxis",query:e},function(n){n.axis.model.setActiveIntervals(e.intervals)})}),t.registerAction("parallelAxisExpand",function(e,r){r.eachComponent({mainType:"parallel",query:e},function(n){n.setAxisExpand(e)})})}var c7r={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function zut(t){t.registerComponentView(MBr),t.registerComponentModel(PBr),t.registerCoordinateSystem("parallel",UBr),t.registerPreprocessor(_Br),t.registerComponentModel(Zme),t.registerComponentView(n7r),n5(t,"parallel",Zme,c7r),l7r(t)}function u7r(t){Yr(zut),t.registerChartView(wBr),t.registerSeriesModel(SBr),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,EBr)}var by="sankey",h7r=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.getInitialData=function(r,n){var i=r.edges||r.links||[],a=r.data||r.nodes||[],s=r.levels||[];this.levelModels=[];for(var o=this.levelModels,l=0;l=0&&(o[s[l].depth]=new yn(s[l],this,n));var u=Eme(a,i,this,!0,h);return u.data;function h(d,f){d.wrapMethod("getItemModel",function(p,g){var m=p.parentModel,v=m.getData().getItemLayout(g);if(v){var y=v.depth,b=m.levelModels[y];b&&(p.parentModel=b)}return p}),f.wrapMethod("getItemModel",function(p,g){var m=p.parentModel,v=m.getGraph().getEdgeByIndex(g),y=v.node1.getLayout();if(y){var b=y.depth,x=m.levelModels[b];x&&(p.parentModel=x)}return p})}},e.prototype.setNodePosition=function(r,n){var i=this.option.data||this.option.nodes,a=i[r];a.localX=n[0],a.localY=n[1]},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.formatTooltip=function(r,n,i){function a(p){return isNaN(p)||p==null}if(i==="edge"){var s=this.getDataParams(r,i),o=s.data,l=s.value,u=o.source+" -- "+o.target;return no("nameValue",{name:u,value:l,noValue:a(l)})}else{var h=this.getGraph().getNodeByIndex(r),d=h.getLayout().value,f=this.getDataParams(r,i).data.name;return no("nameValue",{name:f!=null?f+"":null,value:d,noValue:a(d)})}},e.prototype.optionUpdated=function(){},e.prototype.getDataParams=function(r,n){var i=t.prototype.getDataParams.call(this,r,n);if(i.value==null&&n==="node"){var a=this.getGraph().getNodeByIndex(r),s=a.getLayout().value;i.value=s}return i},e.prototype.__ownRoamView=function(){return this.coordinateSystem},e.type="series."+by,e.layoutMode="box",e.defaultOption={z:2,coordinateSystemUsage:"box",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,roam:!1,roamTrigger:"global",center:null,zoom:1,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:et.color.neutral50,opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:et.color.primary}},animationEasing:"linear",animationDuration:1e3},e}(Ri),d7r=function(){function t(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0}return t}(),f7r=function(t){rt(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new d7r},e.prototype.buildPath=function(r,n){var i=n.extent;r.moveTo(n.x1,n.y1),r.bezierCurveTo(n.cpx1,n.cpy1,n.cpx2,n.cpy2,n.x2,n.y2),n.orient==="vertical"?(r.lineTo(n.x2+i,n.y2),r.bezierCurveTo(n.cpx2+i,n.cpy2,n.cpx1+i,n.cpy1,n.x1+i,n.y1)):(r.lineTo(n.x2,n.y2+i),r.bezierCurveTo(n.cpx2,n.cpy2+i,n.cpx1,n.cpy1+i,n.x1,n.y1+i)),r.closePath()},e.prototype.highlight=function(){oy(this)},e.prototype.downplay=function(){ly(this)},e}(vn),p7r=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=by,r._mainGroup=new pr,r}return e.prototype.init=function(r,n){this._controller=new VT(n.getZr()),this.group.add(this._mainGroup),this._firstRender=!0},e.prototype.render=function(r,n,i){var a=r.getGraph(),s=this._mainGroup,o=r.layoutInfo,l=o.width,u=o.height,h=r.getData(),d=r.getData("edge"),f=r.get("orient");s.removeAll(),s.x=o.x,s.y=o.y,this._updateViewCoordSys(r,i),bY(r,i,this._controller,ect(s),null),a.eachEdge(function(p){var g=new f7r,m=Cr(g);m.dataIndex=p.dataIndex,m.seriesIndex=r.seriesIndex,m.dataType="edge";var v=p.getModel(),y=v.getModel("lineStyle"),b=y.get("curveness"),x=p.node1.getLayout(),w=p.node1.getModel(),A=w.get("localX"),T=w.get("localY"),S=p.node2.getLayout(),O=p.node2.getModel(),k=O.get("localX"),E=O.get("localY"),_=p.getLayout(),I,L,R,D,M,P,N,F;g.shape.extent=Math.max(1,_.dy),g.shape.orient=f,f==="vertical"?(I=(A!=null?A*l:x.x)+_.sy,L=(T!=null?T*u:x.y)+x.dy,R=(k!=null?k*l:S.x)+_.ty,D=E!=null?E*u:S.y,M=I,P=L*(1-b)+D*b,N=R,F=L*b+D*(1-b)):(I=(A!=null?A*l:x.x)+x.dx,L=(T!=null?T*u:x.y)+_.sy,R=k!=null?k*l:S.x,D=(E!=null?E*u:S.y)+_.ty,M=I*(1-b)+R*b,P=L,N=I*b+R*(1-b),F=D),g.setShape({x1:I,y1:L,x2:R,y2:D,cpx1:M,cpy1:P,cpx2:N,cpy2:F}),g.useStyle(y.getItemStyle()),Uut(g.style,f,p);var B=""+v.get("value"),V=So(v,"edgeLabel");qo(g,V,{labelFetcher:{getFormattedLabel:function(Q,G,X,Y,le,q){return r.getFormattedLabel(Q,G,"edge",Y,Ch(le,V.normal&&V.normal.get("formatter"),B),q)}},labelDataIndex:p.dataIndex,defaultText:B}),g.setTextConfig({position:"inside"});var z=v.getModel("emphasis");To(g,v,"lineStyle",function(Q){var G=Q.getItemStyle();return Uut(G,f,p),G}),s.add(g),d.setItemGraphicEl(p.dataIndex,g);var U=z.get("focus");wa(g,U==="adjacency"?p.getAdjacentDataIndices():U==="trajectory"?p.getTrajectoryDataIndices():U,z.get("blurScope"),z.get("disabled"))}),a.eachNode(function(p){var g=p.getLayout(),m=p.getModel(),v=m.get("localX"),y=m.get("localY"),b=m.getModel("emphasis"),x=m.get(["itemStyle","borderRadius"])||0,w=new tn({shape:{x:v!=null?v*l:g.x,y:y!=null?y*u:g.y,width:g.dx,height:g.dy,r:x},style:m.getModel("itemStyle").getItemStyle(),z2:10});qo(w,So(m),{labelFetcher:{getFormattedLabel:function(T,S){return r.getFormattedLabel(T,S,"node")}},labelDataIndex:p.dataIndex,defaultText:p.id}),w.disableLabelAnimation=!0,w.setStyle("fill",p.getVisual("color")),w.setStyle("decal",p.getVisual("style").decal),To(w,m),s.add(w),h.setItemGraphicEl(p.dataIndex,w),Cr(w).dataType="node";var A=b.get("focus");wa(w,A==="adjacency"?p.getAdjacentDataIndices():A==="trajectory"?p.getTrajectoryDataIndices():A,b.get("blurScope"),b.get("disabled"))}),h.eachItemGraphicEl(function(p,g){var m=h.getItemModel(g);m.get("draggable")&&(p.drift=function(v,y){this.shape.x+=v,this.shape.y+=y,this.dirty(),i.dispatchAction({type:"dragNode",seriesId:r.id,dataIndex:h.getRawIndex(g),localX:this.shape.x/l,localY:this.shape.y/u})},p.draggable=!0,p.cursor="move")}),!this._data&&r.isAnimationEnabled()&&s.setClipPath(g7r(s.getBoundingRect(),r,function(){s.removeClipPath()})),this._data=r.getData(),this._firstRender=!1},e.prototype.__updateOnOwnRoam=function(r,n,i){Lx(this.group,Fm,n.coordinateSystem,null)},e.prototype.dispose=function(){this._controller&&this._controller.dispose()},e.prototype._updateViewCoordSys=function(r,n){var i=r.layoutInfo,a=r.coordinateSystem=hme(r,n,i.x,i.y,i.width,i.height);Lx(this.group,Fm,a,this._firstRender?null:r)},e.type=by,e}(Ti);function Uut(t,e,r){switch(t.fill){case"source":t.fill=r.node1.getVisual("color"),t.decal=r.node1.getVisual("style").decal;break;case"target":t.fill=r.node2.getVisual("color"),t.decal=r.node2.getVisual("style").decal;break;case"gradient":var n=r.node1.getVisual("color"),i=r.node2.getVisual("color");Nt(n)&&Nt(i)&&(t.fill=new tT(0,0,+(e==="horizontal"),+(e==="vertical"),[{color:n,offset:0},{color:i,offset:1}]))}}function g7r(t,e,r){var n=new tn({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return ia(n,{shape:{width:t.width+20}},e,r),n}var m7r=Ao(by,v7r);function v7r(t,e){t.eachSeriesByType(by,function(r){var n=r.get("nodeWidth"),i=r.get("nodeGap"),a=Co(r,e).refContainer,s=da(r.getBoxLayoutParams(),a);r.layoutInfo=s;var o=s.width,l=s.height,u=r.getGraph(),h=u.nodes,d=u.edges;b7r(h);var f=ni(h,function(v){return v.getLayout().value===0}),p=f.length!==0?0:r.get("layoutIterations"),g=r.get("orient"),m=r.get("nodeAlign");y7r(h,d,n,i,o,l,p,g,m)})}function y7r(t,e,r,n,i,a,s,o,l){x7r(t,e,r,i,a,o,l),S7r(t,e,a,i,n,s,o),M7r(t,o)}function b7r(t){de(t,function(e){var r=Nx(e.outEdges,IY),n=Nx(e.inEdges,IY),i=e.getValue()||0,a=Math.max(r,n,i);e.setLayout({value:a},!0)})}function x7r(t,e,r,n,i,a,s){for(var o=[],l=[],u=[],h=[],d=0,f=0;f=0;y&&v.depth>p&&(p=v.depth),m.setLayout({depth:y?v.depth:d},!0),a==="vertical"?m.setLayout({dy:r},!0):m.setLayout({dx:r},!0);for(var b=0;bd-1?p:d-1;s&&s!=="left"&&w7r(t,s,a,S);var O=a==="vertical"?(i-r)/S:(n-r)/S;T7r(t,O,a)}function Vut(t){var e=t.hostGraph.data.getRawDataItem(t.dataIndex);return e.depth!=null&&e.depth>=0}function w7r(t,e,r,n){if(e==="right"){for(var i=[],a=t,s=0;a.length;){for(var o=0;o0;a--)l*=.99,k7r(o,l,s),h0e(o,i,r,n,s),L7r(o,l,s),h0e(o,i,r,n,s)}function C7r(t,e){var r=[],n=e==="vertical"?"y":"x",i=vde(t,function(a){return a.getLayout()[n]});return xl(i.keys),de(i.keys,function(a){r.push(i.buckets.get(a))}),r}function O7r(t,e,r,n,i,a){var s=1/0;de(t,function(o){var l=o.length,u=0;de(o,function(d){u+=d.getLayout().value});var h=a==="vertical"?(n-(l-1)*i)/u:(r-(l-1)*i)/u;h0&&(o=l.getLayout()[a]+u,i==="vertical"?l.setLayout({x:o},!0):l.setLayout({y:o},!0)),h=l.getLayout()[a]+l.getLayout()[f]+e;var g=i==="vertical"?n:r;if(u=h-e-g,u>0){o=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:o},!0):l.setLayout({y:o},!0),h=o;for(var p=d-2;p>=0;--p)l=s[p],u=l.getLayout()[a]+l.getLayout()[f]+e-h,u>0&&(o=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:o},!0):l.setLayout({y:o},!0)),h=l.getLayout()[a]}})}function k7r(t,e,r){de(t.slice().reverse(),function(n){de(n,function(i){if(i.outEdges.length){var a=Nx(i.outEdges,E7r,r)/Nx(i.outEdges,IY);if(isNaN(a)){var s=i.outEdges.length;a=s?Nx(i.outEdges,_7r,r)/s:0}if(r==="vertical"){var o=i.getLayout().x+(a-Px(i,r))*e;i.setLayout({x:o},!0)}else{var l=i.getLayout().y+(a-Px(i,r))*e;i.setLayout({y:l},!0)}}})})}function E7r(t,e){return Px(t.node2,e)*t.getValue()}function _7r(t,e){return Px(t.node2,e)}function R7r(t,e){return Px(t.node1,e)*t.getValue()}function D7r(t,e){return Px(t.node1,e)}function Px(t,e){return e==="vertical"?t.getLayout().x+t.getLayout().dx/2:t.getLayout().y+t.getLayout().dy/2}function IY(t){return t.getValue()}function Nx(t,e,r){for(var n=0,i=t.length,a=-1;++as&&(s=l)}),de(n,function(o){var l=new Xo({type:"color",mappingMethod:"linear",dataExtent:[a,s],visual:e.get("color")}),u=l.mapValueToVisual(o.getLayout().value),h=o.getModel().get(["itemStyle","color"]);h!=null?(o.setVisual("color",h),o.setVisual("style",{fill:h})):(o.setVisual("color",u),o.setVisual("style",{fill:u}))})}i.length&&de(i,function(o){var l=o.getModel().get("lineStyle");o.setVisual("style",l)})})}function N7r(t){t.registerChartView(p7r),t.registerSeriesModel(h7r),t.registerLayout(m7r),t.registerVisual(I7r),t.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(e,r){r.eachComponent({mainType:km,subType:by,query:e},function(n){n.setNodePosition(e.dataIndex,[e.localX,e.localY])})}),ume(t,km,by)}var Qut=function(){function t(){}return t.prototype._hasEncodeRule=function(e){var r=this.getEncode();return r&&r.get(e)!=null},t.prototype.getInitialData=function(e,r){var n,i=r.getComponent("xAxis",this.get("xAxisIndex")),a=r.getComponent("yAxis",this.get("yAxisIndex")),s=i.get("type"),o=a.get("type"),l,u=e.layout;s==="category"?(u="horizontal",n=i.getOrdinalMeta(),l=!this._hasEncodeRule("x")):o==="category"&&(u="vertical",n=a.getOrdinalMeta(),l=!this._hasEncodeRule("y")),u||(u=o==="time"?"vertical":"horizontal"),this._layout=u;var h=["x","y"],d=u==="horizontal"?0:1,f=this._baseAxisDim=h[d],p=h[1-d],g=[i,a],m=g[d].get("type"),v=g[1-d].get("type"),y=e.data;if(y&&l){var b=[];de(y,function(A,T){var S;ft(A)?(S=A.slice(),A.unshift(T)):ft(A.value)?(S=ot({},A),S.value=S.value.slice(),A.value.unshift(T)):S=A,b.push(S)}),e.data=b}var x=this.defaultValueDimensions,w=[{name:f,type:vW(m),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:p,type:vW(v),dimsDef:x.slice()}];return t5(this,{coordDimensions:w,dimensionsCount:x.length+1,encodeDefaulter:qr(Prt,w,this)})},t.prototype.getBaseAxis=function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis},t.prototype.getWhiskerBoxesLayout=function(){return this._layout},t}();function PY(t,e){for(var r=e.ends.length,n=0,i=0;im){var w=[y,x];n.push(w)}}}return{boxData:r,outliers:n}}var q7r={type:"echarts:boxplot",transform:function(e){var r=e.upstream;if(r.sourceFormat!==wl){var n="";ii(n)}var i=Y7r(r.getRawData(),e.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};function j7r(t){t.registerSeriesModel(Gut),t.registerChartView(B7r),t.registerLayout(V7r),t.registerTransform(q7r),W7r(t)}var Bx="candlestick",Yut=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.defaultValueDimensions=[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],r}return e.prototype.getShadowDim=function(){return"open"},e.prototype.brushSelector=function(r,n,i){var a=n.getItemLayout(r);return a&&i.rect(a.brushRect)},e.type="series."+Bx,e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,clip:!0,itemStyle:{color:"#eb5454",color0:"#47b262",borderColor:"#eb5454",borderColor0:"#47b262",borderColorDoji:null,borderWidth:1},emphasis:{itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},e}(Ri);Is(Yut,Qut,!0);var X7r=["itemStyle","borderColor"],K7r=["itemStyle","borderColor0"],Z7r=["itemStyle","borderColorDoji"],J7r=["itemStyle","color"],e$r=["itemStyle","color0"];function d0e(t,e){return e.get(t>0?J7r:e$r)}function f0e(t,e){return e.get(t===0?Z7r:t>0?X7r:K7r)}var t$r={seriesType:Bx,plan:yT(),performRawSeries:!0,reset:function(t,e){if(!e.isSeriesFiltered(t)){var r=t.pipelineContext.large;return!r&&{progress:function(n,i){for(var a;(a=n.next())!=null;){var s=i.getItemModel(a),o=i.getItemLayout(a).sign,l=s.getItemStyle();l.fill=d0e(o,s),l.stroke=f0e(o,s)||l.fill;var u=i.ensureUniqueItemVisual(a,"style");ot(u,l)}}}}}},r$r=["color","borderColor"],n$r=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(r),this._isLargeDraw?this._renderLarge(r):this._renderNormal(r)},e.prototype.incrementalPrepareRender=function(r,n,i){this._clear(),this._updateDrawMode(r)},e.prototype.incrementalRender=function(r,n,i,a){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(r,n):this._incrementalRenderNormal(r,n)},e.prototype.eachRendered=function(r){bx(this._progressiveEls||this.group,r)},e.prototype._updateDrawMode=function(r){var n=r.pipelineContext.large;(this._isLargeDraw==null||n!==this._isLargeDraw)&&(this._isLargeDraw=n,this._clear())},e.prototype._renderNormal=function(r){var n=r.getData(),i=this._data,a=this.group,s=n.getLayout("isSimpleBox"),o=r.get("clip",!0),l=r.coordinateSystem,u=l.getArea&&l.getArea(),h=o&&PT(l,!1,r);this._data||a.removeAll();var d=qut(r);n.diff(i).add(function(f){if(n.hasValue(f)){var p=n.getItemLayout(f),g=o?PY(u,p):I8;if(g===N8)return;var m=p0e(p,f,d,!0);ia(m,{shape:{points:p.ends}},r,f),J_(g===P8,m,h),g0e(m,n,f,s),a.add(m),n.setItemGraphicEl(f,m)}}).update(function(f,p){var g=i.getItemGraphicEl(p);if(!n.hasValue(f)){a.remove(g);return}var m=n.getItemLayout(f),v=o?PY(u,m):I8;if(v===N8){a.remove(g);return}g?(Hn(g,{shape:{points:m.ends}},r,f),zf(g)):g=p0e(m,f,d),g0e(g,n,f,s),J_(v===P8,g,h),a.add(g),n.setItemGraphicEl(f,g)}).remove(function(f){var p=i.getItemGraphicEl(f);p&&a.remove(p)}).execute(),this._data=n},e.prototype._renderLarge=function(r){this._clear(),jut(r,this.group);var n=r.get("clip",!0)?PT(r.coordinateSystem,!1,r):null;J_(!!n,this.group,n)},e.prototype._incrementalRenderNormal=function(r,n){for(var i=n.getData(),a=i.getLayout("isSimpleBox"),s=qut(n),o;(o=r.next())!=null;){var l=i.getItemLayout(o),u=p0e(l,o,s);g0e(u,i,o,a),u.incremental=xm(n),this.group.add(u),this._progressiveEls.push(u)}},e.prototype._incrementalRenderLarge=function(r,n){jut(n,this.group,this._progressiveEls,!0)},e.prototype.remove=function(r){this._clear()},e.prototype._clear=function(){this.group.removeAll(),J_(!1,this.group,null),this._data=null},e.type=Bx,e}(Ti),i$r=function(){function t(){}return t}(),a$r=function(t){rt(e,t);function e(r){var n=t.call(this,r)||this;return n.type="normalCandlestickBox",n}return e.prototype.getDefaultShape=function(){return new i$r},e.prototype.buildPath=function(r,n){var i=n.points;this.__simpleBox?(r.moveTo(i[4][0],i[4][1]),r.lineTo(i[6][0],i[6][1])):(r.moveTo(i[0][0],i[0][1]),r.lineTo(i[1][0],i[1][1]),r.lineTo(i[2][0],i[2][1]),r.lineTo(i[3][0],i[3][1]),r.closePath(),r.moveTo(i[4][0],i[4][1]),r.lineTo(i[5][0],i[5][1]),r.moveTo(i[6][0],i[6][1]),r.lineTo(i[7][0],i[7][1]))},e}(vn);function p0e(t,e,r,n){var i=t.ends;return new a$r({shape:{points:n?s$r(i,r,t):i},z2:100})}function g0e(t,e,r,n){var i=e.getItemModel(r);t.useStyle(e.getItemVisual(r,"style")),t.style.strokeNoScale=!0;var a=i.getShallow("cursor");a&&t.attr("cursor",a),t.__simpleBox=n,To(t,i);var s=e.getItemLayout(r).sign;de(t.states,function(l,u){var h=i.getModel(u),d=d0e(s,h),f=f0e(s,h)||d,p=l.style||(l.style={});d&&(p.fill=d),f&&(p.stroke=f)});var o=i.getModel("emphasis");wa(t,o.get("focus"),o.get("blurScope"),o.get("disabled"))}function s$r(t,e,r){return vt(t,function(n){return n=n.slice(),n[e]=r.initBaseline,n})}function qut(t){return t.getWhiskerBoxesLayout()==="horizontal"?1:0}var o$r=function(){function t(){}return t}(),m0e=function(t){rt(e,t);function e(r){var n=t.call(this,r)||this;return n.type="largeCandlestickBox",n}return e.prototype.getDefaultShape=function(){return new o$r},e.prototype.buildPath=function(r,n){for(var i=n.points,a=0;aA?_[a]:E[a],ends:R,brushRect:F(T,S,x)})}function P(V,z){var U=[];return U[i]=z,U[a]=V,isNaN(z)||isNaN(V)?[NaN,NaN]:e.dataToPoint(U)}function N(V,z,U){var Q=z.slice(),G=z.slice();Q[i]=OH(Q[i]+n/2,1,!1),G[i]=OH(G[i]-n/2,1,!0),U?V.push(Q,G):V.push(G,Q)}function F(V,z,U){var Q=P(V,U),G=P(z,U);return Q[i]-=n/2,G[i]-=n/2,{x:Q[0],y:Q[1],width:a?n:G[0]-Q[0],height:a?G[1]-Q[1]:n}}function B(V){return V[i]=OH(V[i],1),V}}function g(m,v){for(var y=Nm(m.count*4),b=0,x,w=[],A=[],T,S=v.getStore(),O=!!t.get(["itemStyle","borderColorDoji"]);(T=m.next())!=null;){var k=S.get(o,T),E=S.get(u,T),_=S.get(h,T),I=S.get(d,T),L=S.get(f,T);if(isNaN(k)||isNaN(I)||isNaN(L)){y[b++]=NaN,b+=3;continue}y[b++]=Xut(S,T,E,_,h,O),w[i]=k,w[a]=I,x=e.dataToPoint(w,null,A),y[b++]=x?x[0]:NaN,y[b++]=x?x[1]:NaN,w[a]=L,x=e.dataToPoint(w,null,A),y[b++]=x?x[1]:NaN}v.setLayout("largePoints",y)}}};function Xut(t,e,r,n,i,a){var s;return r>n?s=-1:r0?t.get(i,e-1)<=n?1:-1:1,s}function h$r(t,e){var r=t.getBaseAxis(),n=sc(r,{fromStat:{key:FT(Bx)},min:1}).w,i=Qt(Jt(t.get("barMaxWidth"),n),n),a=Qt(Jt(t.get("barMinWidth"),1),n),s=t.get("barWidth");return s!=null?Qt(s,n):en(Ai(n/2,i),a)}function d$r(t){c$r(t,function(){var e=FT(Bx);jpe(t,{key:e,seriesType:Bx,getMetrics:Nge}),DW(e,jW(e))})}function f$r(t){t.registerChartView(n$r),t.registerSeriesModel(Yut),t.registerPreprocessor(l$r),t.registerVisual(t$r),t.registerLayout(u$r),d$r(t)}function Kut(t,e){var r=e.rippleEffectColor||e.color;t.eachChild(function(n){n.attr({z:e.z,zlevel:e.zlevel,style:{stroke:e.brushType==="stroke"?r:null,fill:e.brushType==="fill"?r:null}})})}var p$r=function(t){rt(e,t);function e(r,n){var i=t.call(this)||this,a=new L8(r,n),s=new pr;return i.add(a),i.add(s),i.updateData(r,n),i}return e.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},e.prototype.startEffectAnimation=function(r){for(var n=r.symbolType,i=r.color,a=r.rippleNumber,s=this.childAt(1),o=0;o0&&(o=this._getLineLength(a)/h*1e3),o!==this._period||l!==this._loop||u!==this._roundTrip){a.stopAnimation();var f=void 0;ur(d)?f=d(i):f=d,a.__t>0&&(f=-o*a.__t),this._animateSymbol(a,o,f,l,u)}this._period=o,this._loop=l,this._roundTrip=u}},e.prototype._animateSymbol=function(r,n,i,a,s){if(n>0){r.__t=0;var o=this,l=r.animate("",a).when(s?n*2:n,{__t:s?2:1}).delay(i).during(function(){o._updateSymbolPosition(r)});a||l.done(function(){o.remove(r)}),l.start()}},e.prototype._getLineLength=function(r){return qv(r.__p1,r.__cp1)+qv(r.__cp1,r.__p2)},e.prototype._updateAnimationPoints=function(r,n){r.__p1=n[0],r.__p2=n[1],r.__cp1=n[2]||[(n[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2]},e.prototype.updateData=function(r,n,i){this.childAt(0).updateData(r,n,i),this._updateEffectSymbol(r,n)},e.prototype._updateSymbolPosition=function(r){var n=r.__p1,i=r.__p2,a=r.__cp1,s=r.__t<=1?r.__t:2-r.__t,o=[r.x,r.y],l=o.slice(),u=bl,h=Dhe;o[0]=u(n[0],a[0],i[0],s),o[1]=u(n[1],a[1],i[1],s);var d=r.__t<=1?h(n[0],a[0],i[0],s):h(i[0],a[0],n[0],1-s),f=r.__t<=1?h(n[1],a[1],i[1],s):h(i[1],a[1],n[1],1-s);r.rotation=-Math.atan2(f,d)-Math.PI/2,(this._symbolType==="line"||this._symbolType==="rect"||this._symbolType==="roundRect")&&(r.__lastT!==void 0&&r.__lastT=0&&!(a[l]<=n);l--);l=Math.min(l,s-2)}else{for(l=o;ln);l++);l=Math.min(l-1,s-2)}var h=(n-a[l])/(a[l+1]-a[l]),d=i[l],f=i[l+1];r.x=d[0]*(1-h)+h*f[0],r.y=d[1]*(1-h)+h*f[1];var p=r.__t<=1?f[0]-d[0]:d[0]-f[0],g=r.__t<=1?f[1]-d[1]:d[1]-f[1];r.rotation=-Math.atan2(g,p)-Math.PI/2,this._lastFrame=l,this._lastFramePercent=n,r.ignore=!1}},e}(Jut),b$r=function(){function t(){this.polyline=!1,this.curveness=0,this.segs=[]}return t}(),x$r=function(t){rt(e,t);function e(r){var n=t.call(this,r)||this;return n._off=0,n.hoverDataIdx=-1,n}return e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.beforeBrush=function(r){r&&!r.contentRetained&&this.reset()},e.prototype.getDefaultStyle=function(){return{stroke:et.color.neutral99,fill:null}},e.prototype.getDefaultShape=function(){return new b$r},e.prototype.buildPath=function(r,n){var i=n.segs,a=n.curveness,s;if(n.polyline)for(s=this._off;s0){r.moveTo(i[s++],i[s++]);for(var l=1;l0){var p=(u+d)/2-(h-f)*a,g=(h+f)/2-(d-u)*a;r.quadraticCurveTo(p,g,d,f)}else r.lineTo(d,f)}this.incremental&&(this._off=s,this.notClear=!0)},e.prototype.findDataIndex=function(r,n){var i=this.shape,a=i.segs,s=i.curveness,o=this.style.lineWidth;if(i.polyline)for(var l=0,u=0;u0)for(var d=a[u++],f=a[u++],p=1;p0){var v=(d+g)/2-(f-m)*s,y=(f+m)/2-(g-d)*s;if(Bet(d,f,v,y,g,m,o,r,n))return l}else if(px(d,f,g,m,o,r,n))return l;l++}return-1},e.prototype.contain=function(r,n){var i=this.transformCoordToLocal(r,n),a=this.getBoundingRect();if(r=i[0],n=i[1],a.contain(r,n)){var s=this.hoverDataIdx=this.findDataIndex(r,n);return s>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var r=this._rect;if(!r){for(var n=this.shape,i=n.segs,a=1/0,s=1/0,o=-1/0,l=-1/0,u=0;u0&&(s.dataIndex=l+e.__startIndex)})},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}(),tht={seriesType:"lines",plan:yT(),reset:function(t){var e=t.coordinateSystem;if(e){var r=t.get("polyline"),n=t.pipelineContext.large;return{progress:function(i,a){var s=[];if(n){var o=void 0,l=i.end-i.start;if(r){for(var u=0,h=i.start;h0&&h&&u.configLayer(o,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(l/10+.9,1),0)}),s.updateData(a);var d=r.get("clip",!0)&&PT(r.coordinateSystem,!1,r);d?this.group.setClipPath(d):this.group.removeClipPath(),this._lastZlevel=o,this._finished=!0},e.prototype.incrementalPrepareRender=function(r,n,i){var a=r.getData(),s=this._updateLineDraw(a,r);s.incrementalPrepareUpdate(a),this._clearLayer(i),this._finished=!1},e.prototype.incrementalRender=function(r,n,i){this._lineDraw.incrementalUpdate(r,n.getData(),xm(n)),this._finished=r.end===n.getData().count()},e.prototype.eachRendered=function(r){this._lineDraw&&this._lineDraw.eachRendered(r)},e.prototype.updateTransform=function(r,n,i){var a=r.getData(),s=this._lineDraw;if(!this._finished||!s||!s.updateLayout)return{update:!0};var o=tht.reset(r,n,i);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),s.updateLayout(),this._clearLayer(i)},e.prototype._updateLineDraw=function(r,n){var i=this._lineDraw,a=this._showEffect(n),s=!!n.get("polyline"),o=n.pipelineContext,l=o.large;return(!i||a!==this._hasEffet||s!==this._isPolyline||l!==this._isLargeDraw)&&(i&&i.remove(),i=this._lineDraw=l?new w$r:new zme(s?a?y$r:eht:a?Jut:Fme),this._hasEffet=a,this._isPolyline=s,this._isLargeDraw=l),this.group.add(i.group),i},e.prototype._showEffect=function(r){return!!r.get(["effect","show"])},e.prototype._clearLayer=function(r){var n=pfe(r);n&&this._lastZlevel!=null&&n.getLayer(this._lastZlevel).clear(!0)},e.prototype.remove=function(r,n){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(n)},e.prototype.dispose=function(r,n){this.remove(r,n)},e.type="lines",e}(Ti),T$r=typeof Uint32Array>"u"?Array:Uint32Array,S$r=typeof Float64Array>"u"?Array:Float64Array;function rht(t){var e=t.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(t.data=vt(e,function(r){var n=[r[0].coord,r[1].coord],i={coords:n};return r[0].name&&(i.fromName=r[0].name),r[1].name&&(i.toName=r[1].name),fG([i,r[0],r[1]])}))}var C$r=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.visualStyleAccessPath="lineStyle",r.visualDrawType="stroke",r}return e.prototype.init=function(r){r.data=r.data||[],rht(r);var n=this._processFlatCoordsArray(r.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(r.data=new Float32Array(n.count)),t.prototype.init.apply(this,arguments)},e.prototype.mergeOption=function(r){if(rht(r),r.data){var n=this._processFlatCoordsArray(r.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(r.data=new Float32Array(n.count))}t.prototype.mergeOption.apply(this,arguments)},e.prototype.appendData=function(r){var n=this._processFlatCoordsArray(r.data);n.flatCoords&&(this._flatCoords?(this._flatCoords=QE(this._flatCoords,n.flatCoords),this._flatCoordsOffset=QE(this._flatCoordsOffset,n.flatCoordsOffset)):(this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset),r.data=new Float32Array(n.count)),this.getRawData().appendData(r.data)},e.prototype._getCoordsFromItemModel=function(r){var n=this.getData().getItemModel(r),i=n.option instanceof Array?n.option:n.getShallow("coords");return i},e.prototype.getLineCoordsCount=function(r){return this._flatCoordsOffset?this._flatCoordsOffset[r*2+1]:this._getCoordsFromItemModel(r).length},e.prototype.getLineCoords=function(r,n){if(this._flatCoordsOffset){for(var i=this._flatCoordsOffset[r*2],a=this._flatCoordsOffset[r*2+1],s=0;s ")}return no("nameValue",{name:l,value:s,noValue:s==null||isNaN(s)})},e.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},e.prototype.getProgressive=function(){var r=this.option.progressive;return r??(this.option.large?1e4:this.get("progressive"))},e.prototype.getProgressiveThreshold=function(){var r=this.option.progressiveThreshold;return r??(this.option.large?2e4:this.get("progressiveThreshold"))},e.prototype.getZLevelKey=function(){var r=this.getModel("effect"),n=r.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:r.get("show")&&n>0?n+"":""},e.type="series.lines",e.dependencies=["grid","polar","geo","calendar"],e.defaultOption={coordinateSystem:"geo",z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},e}(Ri);function NY(t){return t instanceof Array||(t=[t,t]),t}var O$r={seriesType:"lines",reset:function(t){var e=NY(t.get("symbol")),r=NY(t.get("symbolSize")),n=t.getData();n.setVisual("fromSymbol",e&&e[0]),n.setVisual("toSymbol",e&&e[1]),n.setVisual("fromSymbolSize",r&&r[0]),n.setVisual("toSymbolSize",r&&r[1]);function i(a,s){var o=a.getItemModel(s),l=NY(o.getShallow("symbol",!0)),u=NY(o.getShallow("symbolSize",!0));l[0]&&a.setItemVisual(s,"fromSymbol",l[0]),l[1]&&a.setItemVisual(s,"toSymbol",l[1]),u[0]&&a.setItemVisual(s,"fromSymbolSize",u[0]),u[1]&&a.setItemVisual(s,"toSymbolSize",u[1])}return{dataEach:n.hasItemOption?i:null}}};function k$r(t){t.registerChartView(A$r),t.registerSeriesModel(C$r),t.registerLayout(tht),t.registerVisual(O$r)}var E$r=256,_$r=function(){function t(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=Ho.createCanvas();this.canvas=e}return t.prototype.update=function(e,r,n,i,a,s){var o=this._getBrush(),l=this._getGradient(a,"inRange"),u=this._getGradient(a,"outOfRange"),h=this.pointSize+this.blurSize,d=this.canvas,f=d.getContext("2d"),p=e.length;d.width=r,d.height=n;for(var g=0;g0){var I=s(x)?l:u;x>0&&(x=x*E+O),A[T++]=I[_],A[T++]=I[_+1],A[T++]=I[_+2],A[T++]=I[_+3]*x*256}else T+=4}return f.putImageData(w,0,0),d},t.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=Ho.createCanvas()),r=this.pointSize+this.blurSize,n=r*2;e.width=n,e.height=n;var i=e.getContext("2d");return i.clearRect(0,0,n,n),i.shadowOffsetX=n,i.shadowBlur=this.blurSize,i.shadowColor=et.color.neutral99,i.beginPath(),i.arc(-r,r,this.pointSize,0,Math.PI*2,!0),i.closePath(),i.fill(),e},t.prototype._getGradient=function(e,r){for(var n=this._gradientPixels,i=n[r]||(n[r]=new Uint8ClampedArray(256*4)),a=[0,0,0,0],s=0,o=0;o<256;o++)e[r](o/255,!0,a),i[s++]=a[0],i[s++]=a[1],i[s++]=a[2],i[s++]=a[3];return i},t}();function R$r(t,e,r){var n=t[1]-t[0];e=vt(e,function(s){return{interval:[(s.interval[0]-t[0])/n,(s.interval[1]-t[0])/n]}});var i=e.length,a=0;return function(s){var o;for(o=a;o=0;o--){var l=e[o].interval;if(l[0]<=s&&s<=l[1]){a=o;break}}return o>=0&&o=e[0]&&n<=e[1]}}var L$r=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){var a;n.eachComponent("visualMap",function(o){o.eachTargetSeries(function(l){l===r&&(a=o)})}),this._progressiveEls=null,this.group.removeAll();var s=r.coordinateSystem;s.type==="cartesian2d"||s.type==="calendar"||s.type==="matrix"?this._renderOnGridLike(r,i,0,r.getData().count()):Zst(s)&&this._renderOnGeo(s,r,a,i)},e.prototype.incrementalPrepareRender=function(r,n,i){this.group.removeAll()},e.prototype.incrementalRender=function(r,n,i,a){var s=n.coordinateSystem;s&&(Zst(s)?this.render(n,i,a):(this._progressiveEls=[],this._renderOnGridLike(n,a,r.start,r.end,!0)))},e.prototype.eachRendered=function(r){bx(this._progressiveEls||this.group,r)},e.prototype._renderOnGridLike=function(r,n,i,a,s){var o=r.coordinateSystem,l=NT(o,"cartesian2d"),u=NT(o,"matrix"),h,d,f,p;if(l){var g=o.getAxis("x"),m=o.getAxis("y");h=sc(g).w+.5,d=sc(m).w+.5,f=g.scale.getExtent(),p=m.scale.getExtent()}for(var v=this.group,y=r.getData(),b=r.getModel(["emphasis","itemStyle"]).getItemStyle(),x=r.getModel(["blur","itemStyle"]).getItemStyle(),w=r.getModel(["select","itemStyle"]).getItemStyle(),A=r.get(["itemStyle","borderRadius"]),T=So(r),S=r.getModel("emphasis"),O=S.get("focus"),k=S.get("blurScope"),E=S.get("disabled"),_=l||u?[y.mapDimension("x"),y.mapDimension("y"),y.mapDimension("value")]:[y.mapDimension("time"),y.mapDimension("value")],I=i;If[1]||Mp[1])continue;var P=o.dataToPoint([D,M]);L=new tn({shape:{x:P[0]-h/2,y:P[1]-d/2,width:h,height:d},style:R})}else if(u){var N=o.dataToLayout([y.get(_[0],I),y.get(_[1],I)]).rect;if(Jl(N.x))continue;L=new tn({z2:1,shape:N,style:R})}else{if(isNaN(y.get(_[1],I)))continue;var F=o.dataToLayout([y.get(_[0],I)]),N=F.contentRect||F.rect;if(Jl(N.x)||Jl(N.y))continue;L=new tn({z2:1,shape:N,style:R})}if(y.hasItemOption){var B=y.getItemModel(I),V=B.getModel("emphasis");b=V.getModel("itemStyle").getItemStyle(),x=B.getModel(["blur","itemStyle"]).getItemStyle(),w=B.getModel(["select","itemStyle"]).getItemStyle(),A=B.get(["itemStyle","borderRadius"]),O=V.get("focus"),k=V.get("blurScope"),E=V.get("disabled"),T=So(B)}L.shape.r=A;var z=r.getRawValue(I),U="-";z&&z[2]!=null&&(U=z[2]+""),qo(L,T,{labelFetcher:r,labelDataIndex:I,defaultOpacity:R.opacity,defaultText:U}),L.ensureState("emphasis").style=b,L.ensureState("blur").style=x,L.ensureState("select").style=w,wa(L,O,k,E),L.incremental=xm(r,s),s&&(L.states.emphasis.hoverLayer=v_),v.add(L),y.setItemGraphicEl(I,L),this._progressiveEls&&this._progressiveEls.push(L)}},e.prototype._renderOnGeo=function(r,n,i,a){var s=i.targetVisuals.inRange,o=i.targetVisuals.outOfRange,l=n.getData(),u=this._hmLayer||this._hmLayer||new _$r;u.blurSize=n.get("blurSize"),u.pointSize=n.get("pointSize"),u.minOpacity=n.get("minOpacity"),u.maxOpacity=n.get("maxOpacity");var h=r.getViewRect().clone(),d=r.getRoamTransform();h.applyTransform(d);var f=Math.max(h.x,0),p=Math.max(h.y,0),g=Math.min(h.width+h.x,a.getWidth()),m=Math.min(h.height+h.y,a.getHeight()),v=g-f,y=m-p,b=[l.mapDimension("lng"),l.mapDimension("lat"),l.mapDimension("value")],x=l.mapArray(b,function(S,O,k){var E=r.dataToPoint([S,O]);return E[0]-=f,E[1]-=p,E.push(k),E}),w=i.getExtent(),A=i.type==="visualMap.continuous"?D$r(w,i.option.range):R$r(w,i.getPieceList(),i.option.selected);u.update(x,v,y,s.color.getNormalizer(),{inRange:s.color.getColorMapper(),outOfRange:o.color.getColorMapper()},A);var T=new Yo({style:{width:v,height:y,x:f,y:p,image:u.canvas},silent:!0});this.group.add(T)},e.type="heatmap",e}(Ti),M$r=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.getInitialData=function(r,n){return Dm(null,this,{generateCoord:"value"})},e.prototype.preventIncremental=function(){var r=O_.get(this.get("coordinateSystem"));if(r&&r.dimensions)return r.dimensions[0]==="lng"&&r.dimensions[1]==="lat"},e.type="series.heatmap",e.dependencies=["grid","geo","calendar","matrix"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:et.color.primary}}},e}(Ri);function I$r(t){t.registerChartView(L$r),t.registerSeriesModel(M$r)}var P$r=["itemStyle","borderWidth"],nht=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],y0e=new Em,N$r=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=z8,r}return e.prototype.render=function(r,n,i){var a=this.group,s=r.getData(),o=this._data,l=r.coordinateSystem,u=l.getBaseAxis(),h=u.isHorizontal(),d=l.master.getRect(),f={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:r,coordSys:l,coordSysExtent:[[d.x,d.x+d.width],[d.y,d.y+d.height]],isHorizontal:h,valueDim:nht[+h],categoryDim:nht[1-+h]};s.diff(o).add(function(g){if(s.hasValue(g)){var m=uht(s,g),v=iht(s,g,m,f),y=hht(s,f,v);s.setItemGraphicEl(g,y),a.add(y),pht(y,f,v)}}).update(function(g,m){var v=o.getItemGraphicEl(m);if(!s.hasValue(g)){a.remove(v);return}var y=uht(s,g),b=iht(s,g,y,f),x=fht(s,b);v&&x!==v.__pictorialShapeStr&&(a.remove(v),s.setItemGraphicEl(g,null),v=null),v?Q$r(v,f,b):v=hht(s,f,b,!0),s.setItemGraphicEl(g,v),v.__pictorialSymbolMeta=b,a.add(v),pht(v,f,b)}).remove(function(g){var m=o.getItemGraphicEl(g);m&&dht(o,g,m.__pictorialSymbolMeta.animationModel,m)}).execute();var p=r.get("clip",!0)?PT(r.coordinateSystem,!1,r):null;return p?a.setClipPath(p):a.removeClipPath(),this._data=s,this.group},e.prototype.remove=function(r,n){var i=this.group,a=this._data;r.get("animation")?a&&a.eachItemGraphicEl(function(s){dht(a,Cr(s).dataIndex,r,s)}):i.removeAll()},e.type=z8,e}(Ti);function iht(t,e,r,n){var i=t.getItemLayout(e),a=r.get("symbolRepeat"),s=r.get("symbolClip"),o=r.get("symbolPosition")||"start",l=r.get("symbolRotate"),u=(l||0)*Math.PI/180||0,h=r.get("symbolPatternSize")||2,d=r.isAnimationEnabled(),f={dataIndex:e,layout:i,itemModel:r,symbolType:t.getItemVisual(e,"symbol")||"circle",style:t.getItemVisual(e,"style"),symbolClip:s,symbolRepeat:a,symbolRepeatDirection:r.get("symbolRepeatDirection"),symbolPatternSize:h,rotation:u,animationModel:d?r:null,hoverScale:d&&r.get(["emphasis","scale"]),z2:r.getShallow("z",!0)||0};B$r(r,a,i,n,f),$$r(t,e,i,a,s,f.boundingLength,f.pxSign,h,n,f),F$r(r,f.symbolScale,u,n,f);var p=f.symbolSize,g=xT(r.get("symbolOffset"),p);return z$r(r,p,i,a,s,g,o,f.valueLineWidth,f.boundingLength,f.repeatCutLength,n,f),f}function B$r(t,e,r,n,i){var a=n.valueDim,s=t.get("symbolBoundingData"),o=n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()),l=o.toGlobalCoord(o.dataToCoord(0)),u=1-+(r[a.wh]<=0),h;if(ft(s)){var d=[b0e(o,s[0])-l,b0e(o,s[1])-l];d[1]=0?1:-1:h>0?1:-1}function b0e(t,e){return t.toGlobalCoord(t.dataToCoord(t.scale.parse(e)))}function $$r(t,e,r,n,i,a,s,o,l,u){var h=l.valueDim,d=l.categoryDim,f=Math.abs(r[d.wh]),p=t.getItemVisual(e,"symbolSize"),g;ft(p)?g=p.slice():p==null?g=["100%","100%"]:g=[p,p],g[d.index]=Qt(g[d.index],f),g[h.index]=Qt(g[h.index],n?f:Math.abs(a)),u.symbolSize=g;var m=u.symbolScale=[g[0]/o,g[1]/o];m[h.index]*=(l.isHorizontal?-1:1)*s}function F$r(t,e,r,n,i){var a=t.get(P$r)||0;a&&(y0e.attr({scaleX:e[0],scaleY:e[1],rotation:r}),y0e.updateTransform(),a/=y0e.getLineScale(),a*=e[n.valueDim.index]),i.valueLineWidth=a||0}function z$r(t,e,r,n,i,a,s,o,l,u,h,d){var f=h.categoryDim,p=h.valueDim,g=d.pxSign,m=Math.max(e[p.index]+o,0),v=m;if(n){var y=Math.abs(l),b=Pc(t.get("symbolMargin"),"15%")+"",x=!1;b.lastIndexOf("!")===b.length-1&&(x=!0,b=b.slice(0,b.length-1));var w=Qt(b,e[p.index]),A=Math.max(m+w*2,0),T=x?0:w*2,S=dde(n),O=S?n:ght((y+T)/A),k=y-O*m;w=k/2/(x?O:Math.max(O-1,1)),A=m+w*2,T=x?0:w*2,!S&&n!=="fixed"&&(O=u?ght((Math.abs(u)+T)/A):0),v=O*A-T,d.repeatTimes=O,d.symbolMargin=w}var E=g*(v/2),_=d.pathPosition=[];_[f.index]=r[f.wh]/2,_[p.index]=s==="start"?E:s==="end"?l-E:l/2,a&&(_[0]+=a[0],_[1]+=a[1]);var I=d.bundlePosition=[];I[f.index]=r[f.xy],I[p.index]=r[p.xy];var L=d.barRectShape=ot({},r);L[p.wh]=g*Math.max(Math.abs(r[p.wh]),Math.abs(_[p.index]+E)),L[f.wh]=r[f.wh];var R=d.clipShape={};R[f.xy]=-r[f.xy],R[f.wh]=h.ecSize[f.wh],R[p.xy]=0,R[p.wh]=r[p.wh]}function aht(t){var e=t.symbolPatternSize,r=$s(t.symbolType,-e/2,-e/2,e,e);return r.attr({culling:!0}),r.type!=="image"&&r.setStyle({strokeNoScale:!0}),r}function sht(t,e,r,n){var i=t.__pictorialBundle,a=r.symbolSize,s=r.valueLineWidth,o=r.pathPosition,l=e.valueDim,u=r.repeatTimes||0,h=0,d=a[e.valueDim.index]+s+r.symbolMargin*2;for(x0e(t,function(m){m.__pictorialAnimationIndex=h,m.__pictorialRepeatTimes=u,h0:y<0)&&(b=u-1-m),v[l.index]=d*(b-u/2+.5)+o[l.index],{x:v[0],y:v[1],scaleX:r.symbolScale[0],scaleY:r.symbolScale[1],rotation:r.rotation}}}function oht(t,e,r,n){var i=t.__pictorialBundle,a=t.__pictorialMainPath;a?d5(a,null,{x:r.pathPosition[0],y:r.pathPosition[1],scaleX:r.symbolScale[0],scaleY:r.symbolScale[1],rotation:r.rotation},r,n):(a=t.__pictorialMainPath=aht(r),i.add(a),d5(a,{x:r.pathPosition[0],y:r.pathPosition[1],scaleX:0,scaleY:0,rotation:r.rotation},{scaleX:r.symbolScale[0],scaleY:r.symbolScale[1]},r,n))}function lht(t,e,r){var n=ot({},e.barRectShape),i=t.__pictorialBarRect;i?d5(i,null,{shape:n},e,r):(i=t.__pictorialBarRect=new tn({z2:2,shape:n,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),i.disableMorphing=!0,t.add(i))}function cht(t,e,r,n){if(r.symbolClip){var i=t.__pictorialClipPath,a=ot({},r.clipShape),s=e.valueDim,o=r.animationModel,l=r.dataIndex;if(i)Hn(i,{shape:a},o,l);else{a[s.wh]=0,i=new tn({shape:a}),t.__pictorialBundle.setClipPath(i),t.__pictorialClipPath=i;var u={};u[s.wh]=r.clipShape[s.wh],oT[n?"updateProps":"initProps"](i,{shape:u},o,l)}}}function uht(t,e){var r=t.getItemModel(e);return r.getAnimationDelayParams=U$r,r.isAnimationEnabled=V$r,r}function U$r(t){return{index:t.__pictorialAnimationIndex,count:t.__pictorialRepeatTimes}}function V$r(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function hht(t,e,r,n){var i=new pr,a=new pr;return i.add(a),i.__pictorialBundle=a,a.x=r.bundlePosition[0],a.y=r.bundlePosition[1],r.symbolRepeat?sht(i,e,r):oht(i,e,r),lht(i,r,n),cht(i,e,r,n),i.__pictorialShapeStr=fht(t,r),i.__pictorialSymbolMeta=r,i}function Q$r(t,e,r){var n=r.animationModel,i=r.dataIndex,a=t.__pictorialBundle;Hn(a,{x:r.bundlePosition[0],y:r.bundlePosition[1]},n,i),r.symbolRepeat?sht(t,e,r,!0):oht(t,e,r,!0),lht(t,r,!0),cht(t,e,r,!0)}function dht(t,e,r,n){var i=n.__pictorialBarRect;i&&i.removeTextContent();var a=[];x0e(n,function(s){a.push(s)}),n.__pictorialMainPath&&a.push(n.__pictorialMainPath),n.__pictorialClipPath&&(r=null),de(a,function(s){yx(s,{scaleX:0,scaleY:0},r,e,function(){n.parent&&n.parent.remove(n)})}),t.setItemGraphicEl(e,null)}function fht(t,e){return[t.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function x0e(t,e,r){de(t.__pictorialBundle.children(),function(n){n!==t.__pictorialBarRect&&e.call(r,n)})}function d5(t,e,r,n,i,a){e&&t.attr(e),n.symbolClip&&!i?r&&t.attr(r):r&&oT[i?"updateProps":"initProps"](t,r,n.animationModel,n.dataIndex,a)}function pht(t,e,r){var n=r.dataIndex,i=r.itemModel,a=i.getModel("emphasis"),s=a.getModel("itemStyle").getItemStyle(),o=i.getModel(["blur","itemStyle"]).getItemStyle(),l=i.getModel(["select","itemStyle"]).getItemStyle(),u=i.getShallow("cursor"),h=a.get("focus"),d=a.get("blurScope"),f=a.get("scale");x0e(t,function(m){if(m instanceof Yo){var v=m.style;m.useStyle(ot({image:v.image,x:v.x,y:v.y,width:v.width,height:v.height},r.style))}else m.useStyle(r.style);var y=m.ensureState("emphasis");y.style=s,f&&(y.scaleX=m.scaleX*1.1,y.scaleY=m.scaleY*1.1),m.ensureState("blur").style=o,m.ensureState("select").style=l,u&&(m.cursor=u),m.z2=r.z2});var p=e.valueDim.posDesc[+(r.boundingLength>0)],g=t.__pictorialBarRect;g.ignoreClip=!0,qo(g,So(i),{labelFetcher:e.seriesModel,labelDataIndex:n,defaultText:Z_(e.seriesModel.getData(),n),inheritColor:r.style.fill,defaultOpacity:r.style.opacity,defaultOutsidePosition:p}),wa(t,h,d,a.get("disabled"))}function ght(t){var e=Math.round(t);return Math.abs(t-e)<1e-4?e:Math.ceil(t)}var G$r=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.hasSymbolVisual=!0,r.defaultSymbol="roundRect",r}return e.prototype.getInitialData=function(r){return r.stack=null,t.prototype.getInitialData.apply(this,arguments)},e.type="series."+z8,e.dependencies=["grid"],e.defaultOption=xx(U8.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",clip:!1,progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:et.color.primary}}}),e}(U8);function H$r(t){t.registerChartView(N$r),t.registerSeriesModel(G$r),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,Eot(z8)),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,_ot(z8)),Dot(t)}var w0e=2,f5="themeRiver",W$r=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new r5(Ht(this.getData,this),Ht(this.getRawData,this))},e.prototype.fixData=function(r){var n=r.length,i={},a=vde(r,function(f){return i.hasOwnProperty(f[0]+"")||(i[f[0]+""]=-1),f[2]}),s=[];a.buckets.each(function(f,p){s.push({name:p,dataList:f})});for(var o=s.length,l=0;la&&(a=o),n.push(o)}for(var u=0;ua&&(a=d)}return{y0:i,max:a}}function Z$r(t){t.registerChartView(Y$r),t.registerSeriesModel(W$r),t.registerLayout(j$r),t.registerProcessor(V8(f5))}var J$r=2,e9r=4,vht=function(t){rt(e,t);function e(r,n,i,a){var s=t.call(this)||this;s.z2=J$r,s.textConfig={inside:!0},Cr(s).seriesIndex=n.seriesIndex;var o=new Pn({z2:e9r,silent:r.getModel().get(["label","silent"])});return s.setTextContent(o),s.updateData(!0,r,n,i,a),s}return e.prototype.updateData=function(r,n,i,a,s){this.node=n,n.piece=this,i=i||this._seriesModel,a=a||this._ecModel;var o=this;Cr(o).dataIndex=n.dataIndex;var l=n.getModel(),u=l.getModel("emphasis"),h=n.getLayout(),d=ot({},h);d.label=null;var f=n.getVisual("style");f.lineJoin="bevel";var p=n.getVisual("decal");p&&(f.decal=B_(p,s));var g=$m(l.getModel("itemStyle"),d,!0);ot(d,g),de(wu,function(b){var x=o.ensureState(b),w=l.getModel([b,"itemStyle"]);x.style=w.getItemStyle();var A=$m(w,d);A&&(x.shape=A)}),r?(o.setShape(d),o.shape.r=h.r0,ia(o,{shape:{r:h.r}},i,n.dataIndex)):(Hn(o,{shape:d},i),zf(o)),o.useStyle(f),this._updateLabel(i);var m=l.getShallow("cursor");m&&o.attr("cursor",m),this._seriesModel=i||this._seriesModel,this._ecModel=a||this._ecModel;var v=u.get("focus"),y=v==="relative"?QE(n.getAncestorsIndices(),n.getDescendantIndices()):v==="ancestor"?n.getAncestorsIndices():v==="descendant"?n.getDescendantIndices():v;wa(this,y,u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(r){var n=this,i=this.node.getModel(),a=i.getModel("label"),s=this.node.getLayout(),o=s.endAngle-s.startAngle,l=(s.startAngle+s.endAngle)/2,u=Math.cos(l),h=Math.sin(l),d=this,f=d.getTextContent(),p=this.node.dataIndex,g=a.get("minAngle")/180*Math.PI,m=a.get("show")&&!(g!=null&&Math.abs(o)R&&!BA(M-R)&&M0?(s.virtualPiece?s.virtualPiece.updateData(!1,b,r,n,i):(s.virtualPiece=new vht(b,r,n,i),h.add(s.virtualPiece)),x.piece.off("click"),s.virtualPiece.on("click",function(w){s._rootToNode(x.parentNode)})):s.virtualPiece&&(h.remove(s.virtualPiece),s.virtualPiece=null)}},e.prototype._initEvents=function(){var r=this;this.group.off("click"),this.group.on("click",function(n){var i=!1,a=r.seriesModel.getViewRoot();a.eachNode(function(s){if(!i&&s.piece&&s.piece===n.target){var o=s.getModel().get("nodeClick");if(o==="rootToNode")r._rootToNode(s);else if(o==="link"){var l=s.getModel(),u=l.get("link");if(u){var h=l.get("target",!0)||"_blank";zH(u,h)}}i=!0}})})},e.prototype._rootToNode=function(r){r!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:A0e,from:this.uid,seriesId:this.seriesModel.id,targetNode:r})},e.prototype.containPoint=function(r,n){var i=n.getData(),a=i.getItemLayout(0);if(a){var s=r[0]-a.cx,o=r[1]-a.cy,l=Math.sqrt(s*s+o*o);return l<=a.r&&l>=a.r0}},e.type=eS,e}(Ti),a9r=Ao(eS,s9r);function s9r(t){var e={};function r(n,i,a){if(n.depth===0)return et.color.neutral50;for(var s=n;s&&s.depth>1;)s=s.parentNode;var o=i.getColorFromPalette(s.name||s.dataIndex+"",e);return n.depth>1&&Nt(o)&&(o=_G(o,(n.depth-1)/(a-1)*.5)),o}t.eachSeriesByType(eS,function(n){var i=n.getData(),a=i.tree;a.eachNode(function(s){var o=s.getModel(),l=o.getModel("itemStyle").getItemStyle();l.fill||(l.fill=r(s,n,a.root.height));var u=i.ensureUniqueItemVisual(s.dataIndex,"style");ot(u,l)})})}var xht=Math.PI/180,o9r=Ao(eS,l9r);function l9r(t,e){t.eachSeriesByType(eS,function(r){var n=r.get("center"),i=r.get("radius");ft(i)||(i=[0,i]),ft(n)||(n=[n,n]);var a=e.getWidth(),s=e.getHeight(),o=Math.min(a,s),l=Qt(n[0],a),u=Qt(n[1],s),h=Qt(i[0],o/2),d=Qt(i[1],o/2),f=-r.get("startAngle")*xht,p=r.get("minAngle")*xht,g=r.getData().tree.root,m=r.getViewRoot(),v=m.depth,y=r.get("sort");y!=null&&wht(m,y);var b=0;de(m.children,function(D){!isNaN(D.getValue())&&b++});var x=m.getValue(),w=Math.PI/(x||b)*2,A=m.depth>0,T=m.height-(A?-1:1),S=(d-h)/(T||1),O=r.get("clockwise"),k=r.get("stillShowZeroSum"),E=O?1:-1,_=function(D,M){if(D){var P=M;if(D!==g){var N=D.getValue(),F=x===0&&k?w:N*w;Fn[1]&&n.reverse(),{coordSys:{type:"polar",cx:t.cx,cy:t.cy,r:n[1],r0:n[0]},api:{coord:function(i){var a=e.dataToRadius(i[0]),s=r.dataToAngle(i[1]),o=t.coordToPoint([a,s]);return o.push(a,s*Math.PI/180),o},size:Ht(b9r,t)}}}function w9r(t){var e=t.getRect(),r=t.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:t.getCellWidth(),cellHeight:t.getCellHeight(),rangeInfo:{start:r.start,end:r.end,weeks:r.weeks,dayCount:r.allDay}},api:{coord:function(n,i){return t.dataToPoint(n,i)},layout:function(n,i){return t.dataToLayout(n,i)}}}}function A9r(t){var e=t.getRect();return{coordSys:{type:"matrix",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(r,n){return t.dataToPoint(r,n)},layout:function(r,n){return t.dataToLayout(r,n)}}}}var Tht={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},Sht=kn(Tht);Rf(ry,function(t,e){return t[e]=1,t},{}),ry.join(", ");var BY=["","style","shape","extra"],p5=Qr();function T0e(t,e,r,n,i){var a=t+"Animation",s=g_(t,n,i)||{},o=p5(e).userDuring;return s.duration>0&&(s.during=o?Ht(k9r,{el:e,userDuring:o}):null,s.setToFinal=!0,s.scope=t),ot(s,r[a]),s}function $Y(t,e,r,n){n=n||{};var i=n.dataIndex,a=n.isInit,s=n.clearStyle,o=r.isAnimationEnabled(),l=p5(t),u=e.style;l.userDuring=e.during;var h={},d={};if(_9r(t,e,d),t.type==="compound")for(var f=t.shape.paths,p=e.shape.paths,g=0;g0&&t.animateFrom(v,y)}else S9r(t,e,i||0,r,h);Cht(t,e),u?t.dirty():t.markRedraw()}function Cht(t,e){for(var r=p5(t).leaveToProps,n=0;n0&&t.animateFrom(i,a)}}function C9r(t,e){Kt(e,"silent")&&(t.silent=e.silent),Kt(e,"ignore")&&(t.ignore=e.ignore),t instanceof $f&&Kt(e,"invisible")&&(t.invisible=e.invisible),t instanceof vn&&Kt(e,"autoBatch")&&(t.autoBatch=e.autoBatch)}var Um={},O9r={setTransform:function(t,e){return Um.el[t]=e,this},getTransform:function(t){return Um.el[t]},setShape:function(t,e){var r=Um.el,n=r.shape||(r.shape={});return n[t]=e,r.dirtyShape&&r.dirtyShape(),this},getShape:function(t){var e=Um.el.shape;if(e)return e[t]},setStyle:function(t,e){var r=Um.el,n=r.style;return n&&(n[t]=e,r.dirtyStyle&&r.dirtyStyle()),this},getStyle:function(t){var e=Um.el.style;if(e)return e[t]},setExtra:function(t,e){var r=Um.el.extra||(Um.el.extra={});return r[t]=e,this},getExtra:function(t){var e=Um.el.extra;if(e)return e[t]}};function k9r(){var t=this,e=t.el;if(e){var r=p5(e).userDuring,n=t.userDuring;if(r!==n){t.el=t.userDuring=null;return}Um.el=e,n(O9r)}}function Oht(t,e,r,n){var i=r[t];if(i){var a=e[t],s;if(a){var o=r.transition,l=i.transition;if(l)if(!s&&(s=n[t]={}),tS(l))ot(s,a);else for(var u=Qi(l),h=0;h=0){!s&&(s=n[t]={});for(var p=kn(a),h=0;h=0)){var f=t.getAnimationStyleProps(),p=f?f.style:null;if(p){!a&&(a=n.style={});for(var g=kn(r),u=0;u=0?e.getStore().get(N,M):void 0}var F=e.get(P.name,M),B=P&&P.ordinalMeta;return B?B.categories[F]:F}function S(D,M){M==null&&(M=h);var P=e.getItemVisual(M,"style"),N=P&&P.fill,F=P&&P.opacity,B=x(M,$x).getItemStyle();N!=null&&(B.fill=N),F!=null&&(B.opacity=F);var V={inheritColor:Nt(N)?N:et.color.neutral99},z=w(M,$x),U=Gi(z,null,V,!1,!0);U.text=z.getShallow("show")?Jt(t.getFormattedLabel(M,$x),Z_(e,M)):null;var Q=LH(z,V,!1);return E(D,B),B=rot(B,U,Q),D&&k(B,D),B.legacy=!0,B}function O(D,M){M==null&&(M=h);var P=x(M,wy).getItemStyle(),N=w(M,wy),F=Gi(N,null,null,!0,!0);F.text=N.getShallow("show")?Ch(t.getFormattedLabel(M,wy),t.getFormattedLabel(M,$x),Z_(e,M)):null;var B=LH(N,null,!0);return E(D,P),P=rot(P,F,B),D&&k(P,D),P.legacy=!0,P}function k(D,M){for(var P in M)Kt(M,P)&&(D[P]=M[P])}function E(D,M){D&&(D.textFill&&(M.textFill=D.textFill),D.textPosition&&(M.textPosition=D.textPosition))}function _(D,M){if(M==null&&(M=h),Kt(Aht,D)){var P=e.getItemVisual(M,"style");return P?P[Aht[D]]:null}if(Kt(h9r,D))return e.getItemVisual(M,D)}function I(D){if(s.type==="cartesian2d"){var M=s.getBaseAxis();return FIr(mr({axis:M},D))}}function L(){return r.getCurrentSeriesIndices()}function R(D){return mfe(D,r)}}function z9r(t){var e={};return de(t.dimensions,function(r){var n=t.getDimensionInfo(r);if(!n.isExtraCoord){var i=n.coordDim,a=e[i]=e[i]||[];a[n.coordDimIndex]=t.getDimensionIndex(r)}}),e}function M0e(t,e,r,n,i,a,s){if(!n){a.remove(e);return}var o=I0e(t,e,r,n,i,a);return o&&s.setItemGraphicEl(r,o),o&&wa(o,n.focus,n.blurScope,n.emphasisDisabled),o}function I0e(t,e,r,n,i,a){var s=-1,o=e;e&&Dht(e,n,i)&&(s=Ir(a.childrenRef(),e),e=null);var l=!e,u=e;u?u.clearStates():(u=D0e(n),o&&N9r(o,u)),n.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),n.tooltipDisabled&&(u.tooltipDisabled=!0),Xf.normal.cfg=Xf.normal.conOpt=Xf.emphasis.cfg=Xf.emphasis.conOpt=Xf.blur.cfg=Xf.blur.conOpt=Xf.select.cfg=Xf.select.conOpt=null,Xf.isLegacy=!1,V9r(u,r,n,i,l,Xf),U9r(u,r,n,i,l),L0e(t,u,r,n,Xf,i,l),Kt(n,"info")&&(xy(u).info=n.info);for(var h=0;h=0?a.replaceAt(u,s):a.add(u),u}function Dht(t,e,r){var n=xy(t),i=e.type,a=e.shape,s=e.style;return r.isUniversalTransitionEnabled()||i!=null&&i!==n.customGraphicType||i==="path"&&Y9r(a)&&Pht(a)!==n.customPathData||i==="image"&&Kt(s,"image")&&s.image!==n.customImagePath}function U9r(t,e,r,n,i){var a=r.clipPath;if(a===!1)t&&t.getClipPath()&&t.removeClipPath();else if(a){var s=t.getClipPath();s&&Dht(s,a,n)&&(s=null),s||(s=D0e(a),t.setClipPath(s)),L0e(null,s,e,a,null,n,i)}}function V9r(t,e,r,n,i,a){if(!(t.isGroup||t.type==="compoundPath")){Lht(r,null,a),Lht(r,wy,a);var s=a.normal.conOpt,o=a.emphasis.conOpt,l=a.blur.conOpt,u=a.select.conOpt;if(s!=null||o!=null||u!=null||l!=null){var h=t.getTextContent();if(s===!1)h&&t.removeTextContent();else{s=a.normal.conOpt=s||{type:"text"},h?h.clearStates():(h=D0e(s),t.setTextContent(h)),L0e(null,h,e,s,null,n,i);for(var d=s&&s.style,f=0;f=h;p--){var g=e.childAt(p);G9r(e,g,i)}}}function G9r(t,e,r){e&&FY(e,xy(t).option,r)}function H9r(t){new fy(t.oldChildren,t.newChildren,Mht,Mht,t).add(Iht).update(Iht).remove(W9r).execute()}function Mht(t,e){var r=t&&t.name;return r??I9r+e}function Iht(t,e){var r=this.context,n=t!=null?r.newChildren[t]:null,i=e!=null?r.oldChildren[e]:null;I0e(r.api,i,r.dataIndex,n,r.seriesModel,r.group)}function W9r(t){var e=this.context,r=e.oldChildren[t];r&&FY(r,xy(r).option,e.seriesModel)}function Pht(t){return t&&(t.pathData||t.d)}function Y9r(t){return t&&(Kt(t,"pathData")||Kt(t,"d"))}function q9r(t){t.registerChartView(B9r),t.registerSeriesModel(d9r)}var rS=Qr(),Nht=lr,N0e=Ht,B0e=function(){function t(){this._dragging=!1,this.animationThreshold=15}return t.prototype.render=function(e,r,n,i){var a=r.get("value"),s=r.get("status");if(this._axisModel=e,this._axisPointerModel=r,this._api=n,!(!i&&this._lastValue===a&&this._lastStatus===s)){this._lastValue=a,this._lastStatus=s;var o=this._group,l=this._handle;if(!s||s==="hide"){o&&o.hide(),l&&l.hide();return}o&&o.show(),l&&l.show();var u={};this.makeElOption(u,a,e,r,n);var h=u.graphicKey;h!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=h;var d=this._moveAnimation=this.determineAnimation(e,r);if(!o)o=this._group=new pr,this.createPointerEl(o,u,e,r),this.createLabelEl(o,u,e,r),n.getZr().add(o);else{var f=qr(Bht,r,d);this.updatePointerEl(o,u,f),this.updateLabelEl(o,u,f,r)}zht(o,r,!0),this._renderHandle(a)}},t.prototype.remove=function(e){this.clear(e)},t.prototype.dispose=function(e){this.clear(e)},t.prototype.determineAnimation=function(e,r){var n=r.get("animation"),i=e.axis,a=i.type==="category",s=r.get("snap");if(!s&&!a)return!1;if(n==="auto"||n==null){var o=this.animationThreshold;if(a&&sc(i).w>o)return!0;if(s){var l=Yge(e).seriesDataCount,u=i.getExtent();return Math.abs(u[0]-u[1])/l>o}return!1}return n===!0},t.prototype.makeElOption=function(e,r,n,i,a){},t.prototype.createPointerEl=function(e,r,n,i){var a=r.pointer;if(a){var s=rS(e).pointerEl=new oT[a.type](Nht(r.pointer));e.add(s)}},t.prototype.createLabelEl=function(e,r,n,i){if(r.label){var a=rS(e).labelEl=new Pn(Nht(r.label));e.add(a),Fht(a,i)}},t.prototype.updatePointerEl=function(e,r,n){var i=rS(e).pointerEl;i&&r.pointer&&(i.setStyle(r.pointer.style),n(i,{shape:r.pointer.shape}))},t.prototype.updateLabelEl=function(e,r,n,i){var a=rS(e).labelEl;a&&(a.setStyle(r.label.style),n(a,{x:r.label.x,y:r.label.y}),Fht(a,i))},t.prototype._renderHandle=function(e){if(!(this._dragging||!this.updateHandleTransform)){var r=this._axisPointerModel,n=this._api.getZr(),i=this._handle,a=r.getModel("handle"),s=r.get("status");if(!a.get("show")||!s||s==="hide"){i&&n.remove(i),this._handle=null;return}var o;this._handle||(o=!0,i=this._handle=x_(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){Kv(u.event)},onmousedown:N0e(this._onHandleDragMove,this,0,0),drift:N0e(this._onHandleDragMove,this),ondragend:N0e(this._onHandleDragEnd,this)}),n.add(i)),zht(i,r,!1),i.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");ft(l)||(l=[l,l]),i.scaleX=l[0]/2,i.scaleY=l[1]/2,D_(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,o)}},t.prototype._moveHandleToValue=function(e,r){Bht(this._axisPointerModel,!r&&this._moveAnimation,this._handle,$0e(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(e,r){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform($0e(n),[e,r],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr($0e(i)),rS(n).lastProp=null,this._doDispatchAxisPointer()}},t.prototype._doDispatchAxisPointer=function(){var e=this._handle;if(e){var r=this._payloadInfo,n=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:r.cursorPoint[0],y:r.cursorPoint[1],tooltipOption:r.tooltipOption,axesInfo:[{axisDim:n.axis.dim,axisIndex:n.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){this._dragging=!1;var e=this._handle;if(e){var r=this._axisPointerModel.get("value");this._moveHandleToValue(r),this._api.dispatchAction({type:"hideTip"})}},t.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var r=e.getZr(),n=this._group,i=this._handle;r&&n&&(this._lastGraphicKey=null,n&&r.remove(n),i&&r.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),s8(this,"_doDispatchAxisPointer")},t.prototype.doClear=function(){},t.prototype.buildLabel=function(e,r,n){return n=n||0,{x:e[n],y:e[1-n],width:r[n],height:r[1-n]}},t}();function Bht(t,e,r,n){$ht(rS(r).lastProp,n)||(rS(r).lastProp=n,e?Hn(r,n,t):(r.stopAnimation(),r.attr(n)))}function $ht(t,e){if(yr(t)&&yr(e)){var r=!0;return de(e,function(n,i){r=r&&$ht(t[i],n)}),!!r}else return t===e}function Fht(t,e){t[e.get(["label","show"])?"show":"hide"]()}function $0e(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function zht(t,e,r){var n=e.get("z"),i=e.get("zlevel");t&&t.traverse(function(a){a.type!=="group"&&(n!=null&&(a.z=n),i!=null&&(a.zlevel=i),a.silent=r)})}function F0e(t){var e=t.get("type"),r=t.getModel(e+"Style"),n;return e==="line"?(n=r.getLineStyle(),n.fill=null):e==="shadow"&&(n=r.getAreaStyle(),n.stroke=null),n}function Uht(t,e,r,n,i){var a=r.get("value"),s=Vht(a,e.axis,e.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),o=r.getModel("label"),l=C_(o.get("padding")||0),u=o.getFont(),h=VG(s,u),d=i.position,f=h.width+l[1]+l[3],p=h.height+l[0]+l[2],g=i.align;g==="right"&&(d[0]-=f),g==="center"&&(d[0]-=f/2);var m=i.verticalAlign;m==="bottom"&&(d[1]-=p),m==="middle"&&(d[1]-=p/2),j9r(d,f,p,n);var v=o.get("backgroundColor");(!v||v==="auto")&&(v=e.get(["axisLine","lineStyle","color"])),t.label={x:d[0],y:d[1],style:Gi(o,{text:s,font:u,fill:o.getTextColor(),padding:l,backgroundColor:v}),z2:10}}function j9r(t,e,r,n){var i=n.getWidth(),a=n.getHeight();t[0]=Math.min(t[0]+e,i)-e,t[1]=Math.min(t[1]+r,a)-r,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}function Vht(t,e,r,n,i){t=e.scale.parse(t);var a=e.scale.getLabel({value:t},{precision:i.precision}),s=i.formatter;if(s){var o={value:EW(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};de(n,function(l){var u=r.getSeriesByIndex(l.seriesIndex),h=l.dataIndexInside,d=u&&u.getDataParams(h);d&&o.seriesData.push(d)}),Nt(s)?a=s.replace("{value}",a):ur(s)&&(a=s(o))}return a}function z0e(t,e,r){var n=xa();return Zv(n,n,r.rotation),zp(n,n,r.position),Wp([t.dataToCoord(e),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],n)}function Qht(t,e,r,n,i,a){var s=Ou.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=i.get(["label","margin"]),Uht(e,n,i,a,{position:z0e(n.axis,t,r),align:s.textAlign,verticalAlign:s.textVerticalAlign})}function U0e(t,e,r){return r=r||0,{x1:t[r],y1:t[1-r],x2:e[r],y2:e[1-r]}}function Ght(t,e,r){return r=r||0,{x:t[r],y:t[1-r],width:e[r],height:e[1-r]}}function Hht(t,e,r,n,i,a){return{cx:t,cy:e,r0:r,r:n,startAngle:i,endAngle:a,clockwise:!0}}function V0e(t,e,r){return sc(t,{fromStat:{sers:vt(e,function(n){return r.getSeriesByIndex(n.seriesIndex)})},min:1}).w}function Q0e(t,e,r){return[en(Ai(e[0],e[1]),t-r/2),Ai(t+r/2,en(e[0],e[1]))]}var X9r=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.makeElOption=function(r,n,i,a,s){var o=i.axis,l=o.grid,u=a.get("type"),h=o.getGlobalExtent(),d=Wht(l,o).getOtherAxis(o).getGlobalExtent(),f=o.toGlobalCoord(o.dataToCoord(n,!0));if(u&&u!=="none"){var p=F0e(a),g=K9r[u](o,f,h,d,a.get("seriesDataIndices"),a.ecModel);g.style=p,r.graphicKey=g.type,r.pointer=g}var m=qW(l.getRect(),i);Qht(n,r,m,i,a,s)},e.prototype.getHandleTransform=function(r,n,i){var a=qW(n.axis.grid.getRect(),n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var s=z0e(n.axis,r,a);return{x:s[0],y:s[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(r,n,i,a){var s=i.axis,o=s.grid,l=s.getGlobalExtent(!0),u=Wht(o,s).getOtherAxis(s).getGlobalExtent(),h=s.dim==="x"?0:1,d=[r.x,r.y];d[h]+=n[h],d[h]=Ai(l[1],d[h]),d[h]=en(l[0],d[h]);var f=(u[1]+u[0])/2,p=[f,f];p[h]=d[h];var g=[{verticalAlign:"middle"},{align:"center"}];return{x:d[0],y:d[1],rotation:r.rotation,cursorPoint:p,tooltipOption:g[h]}},e}(B0e);function Wht(t,e){var r={};return r[e.dim+"AxisIndex"]=e.index,t.getCartesian(r)}var K9r={line:function(t,e,r,n){var i=U0e([e,n[0]],[e,n[1]],Yht(t));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(t,e,r,n,i,a){var s=V0e(t,i,a),o=n[1]-n[0],l=Q0e(e,r,s),u=l[0],h=l[1];return{type:"Rect",shape:Ght([u,n[0]],[h-u,o],Yht(t))}}};function Yht(t){return t.dim==="x"?0:1}var Z9r=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="axisPointer",e.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:et.color.border,width:1,type:"dashed"},shadowStyle:{color:et.color.shadowTint},label:{show:!0,formatter:null,precision:"auto",margin:3,color:et.color.neutral00,padding:[5,7,5,7],backgroundColor:et.color.accent60,borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:et.color.accent40,throttle:40}},e}(fn),Ay=Qr(),J9r=de;function qht(t,e,r){if(!Rn.node){var n=e.getZr();Ay(n).records||(Ay(n).records={}),eFr(n,e);var i=Ay(n).records[t]||(Ay(n).records[t]={});i.handler=r}}function eFr(t,e){if(Ay(t).initialized)return;Ay(t).initialized=!0,r("click",qr(G0e,"click")),r("mousemove",qr(G0e,"mousemove")),r("mousewheel",qr(G0e,"mousewheel")),r("globalout",rFr);function r(n,i){t.on(n,function(a){var s=nFr(e);J9r(Ay(t).records,function(o){o&&i(o,a,s.dispatchAction)}),tFr(s.pendings,e)})}}function tFr(t,e){var r=t.showTip.length,n=t.hideTip.length,i;r?i=t.showTip[r-1]:n&&(i=t.hideTip[n-1]),i&&(i.dispatchAction=null,e.dispatchAction(i))}function rFr(t,e,r){t.handler("leave",null,r)}function G0e(t,e,r,n){e.handler(t,r,n)}function nFr(t){var e={showTip:[],hideTip:[]},r=function(n){var i=e[n.type];i?i.push(n):(n.dispatchAction=r,t.dispatchAction(n))};return{dispatchAction:r,pendings:e}}function H0e(t,e){if(!Rn.node){var r=e.getZr(),n=(Ay(r).records||{})[t];n&&(Ay(r).records[t]=null)}}var iFr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){var a=n.getComponent("tooltip"),s=r.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click|mousewheel";qht("axisPointer",i,function(o,l,u){s!=="none"&&(o==="leave"||s.indexOf(o)>=0)&&u({type:"updateAxisPointer",currTrigger:o,x:l&&l.offsetX,y:l&&l.offsetY})})},e.prototype.remove=function(r,n){H0e("axisPointer",n)},e.prototype.dispose=function(r,n){H0e("axisPointer",n)},e.type="axisPointer",e}(Hi);function jht(t,e){var r=[],n=t.seriesIndex,i;if(n==null||!(i=e.getSeriesByIndex(n)))return{point:[]};var a=i.getData(),s=FA(a,t);if(s==null||s<0||ft(s))return{point:[]};var o=a.getItemGraphicEl(s),l=i.coordinateSystem;if(i.getTooltipPosition)r=i.getTooltipPosition(s)||[];else if(l&&l.dataToPoint)if(t.isStacked){var u=l.getBaseAxis(),h=l.getOtherAxis(u),d=h.dim,f=u.dim,p=d==="x"||d==="radius"?1:0,g=a.mapDimension(f),m=[];m[p]=a.get(g,s),m[1-p]=a.get(a.getCalculationInfo("stackResultDimension"),s),r=l.dataToPoint(m)||[]}else r=l.dataToPoint(a.getValues(vt(l.dimensions,function(y){return a.mapDimension(y)}),s))||[];else if(o){var v=o.getBoundingRect().clone();v.applyTransform(o.transform),r=[v.x+v.width/2,v.y+v.height/2]}return{point:r,el:o}}var Xht=Qr();function aFr(t,e,r){var n=t.currTrigger,i=[t.x,t.y],a=t,s=t.dispatchAction||Ht(r.dispatchAction,r),o=e.getComponent("axisPointer").coordSysAxesInfo;if(o){VY(i)&&(i=jht({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},e).point);var l=VY(i),u=a.axesInfo,h=o.axesInfo,d=n==="leave"||VY(i),f={},p={},g={list:[],map:{}},m={showPointer:qr(oFr,p),showTooltip:qr(lFr,g)};de(o.coordSysMap,function(y,b){var x=l||y.containPoint(i);de(o.coordSysAxesInfo[b],function(w,A){var T=w.axis,S=dFr(u,w);if(!d&&x&&(!u||S)){var O=S&&S.value;O==null&&!l&&(O=T.pointToData(i)),O!=null&&Kht(w,O,m,!1,f)}})});var v={};return de(h,function(y,b){var x=y.linkGroup;x&&!p[b]&&de(x.axesInfo,function(w,A){var T=p[A];if(w!==y&&T){var S=T.value;x.mapper&&(S=y.axis.scale.parse(x.mapper(S,Zht(w),Zht(y)))),v[y.key]=S}})}),de(v,function(y,b){Kht(h[b],y,m,!0,f)}),cFr(p,h,f),uFr(g,i,t,s),hFr(h,s,r),f}}function Kht(t,e,r,n,i){var a=t.axis;if(!(a.scale.isBlank()||!a.containData(e))){if(!t.involveSeries){r.showPointer(t,e);return}var s=sFr(e,t),o=s.payloadBatch,l=s.snapToValue;o[0]&&i.seriesIndex==null&&ot(i,o[0]),!n&&t.snap&&a.containData(l)&&l!=null&&(e=l),r.showPointer(t,e,o),r.showTooltip(t,s,l)}}function sFr(t,e){var r=e.axis,n=r.dim,i=t,a=[],s=Number.MAX_VALUE,o=-1;return de(e.seriesModels,function(l,u){var h=l.getData().mapDimensionsAll(n),d,f;if(l.getAxisTooltipData){var p=l.getAxisTooltipData(h,t,r);f=p.dataIndices,d=p.nestestValue}else{if(f=l.indicesOfNearest(n,h[0],t,r.type==="category"?.5:null),!f.length)return;d=l.getData().get(h[0],f[0])}if(Bf(d)){var g=t-d,m=Math.abs(g);m<=s&&((m=0&&o<0)&&(s=m,o=g,i=d,a.length=0),de(f,function(v){a.push({seriesIndex:l.seriesIndex,dataIndexInside:v,dataIndex:l.getData().getRawIndex(v)})}))}}),{payloadBatch:a,snapToValue:i}}function oFr(t,e,r,n){t[e.key]={value:r,payloadBatch:n}}function lFr(t,e,r,n){var i=r.payloadBatch,a=e.axis,s=a.model,o=e.axisPointerModel;if(!(!e.triggerTooltip||!i.length)){var l=e.coordSys.model,u=Q8(l),h=t.map[u];h||(h=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(h)),h.dataByAxis.push({axisDim:a.dim,axisIndex:s.componentIndex,axisType:s.type,axisId:s.id,value:n,valueLabelOpt:{precision:o.get(["label","precision"]),formatter:o.get(["label","formatter"])},seriesDataIndices:i.slice()})}}function cFr(t,e,r){var n=r.axesInfo=[];de(e,function(i,a){var s=i.axisPointerModel.option,o=t[a];o?(!i.useHandle&&(s.status="show"),s.value=o.value,s.seriesDataIndices=(o.payloadBatch||[]).slice()):!i.useHandle&&(s.status="hide"),s.status==="show"&&n.push({axisDim:i.axis.dim,axisIndex:i.axis.model.componentIndex,value:s.value})})}function uFr(t,e,r,n){if(VY(e)||!t.list.length){n({type:"hideTip"});return}var i=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:r.tooltipOption,position:r.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:t.list})}function hFr(t,e,r){var n=r.getZr(),i="axisPointerLastHighlights",a=Xht(n)[i]||{},s=Xht(n)[i]={};de(t,function(h,d){var f=h.axisPointerModel.option;f.status==="show"&&h.triggerEmphasis&&de(f.seriesDataIndices,function(p){s[p.seriesIndex+"|"+p.dataIndex]=p})});var o=[],l=[];function u(h){return{seriesIndex:h.seriesIndex,dataIndex:h.dataIndex}}de(a,function(h,d){!s[d]&&l.push(u(h))}),de(s,function(h,d){!a[d]&&o.push(u(h))}),l.length&&r.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),o.length&&r.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:o})}function dFr(t,e){for(var r=0;r<(t||[]).length;r++){var n=t[r];if(e.axis.dim===n.axisDim&&e.axis.model.componentIndex===n.axisIndex)return n}}function Zht(t){var e=t.axis.model,r={},n=r.axisDim=t.axis.dim;return r.axisIndex=r[n+"AxisIndex"]=e.componentIndex,r.axisName=r[n+"AxisName"]=e.name,r.axisId=r[n+"AxisId"]=e.id,r}function VY(t){return!t||t[0]==null||isNaN(t[0])||t[1]==null||isNaN(t[1])}function fB(t){UT.registerAxisPointerClass("CartesianAxisPointer",X9r),t.registerComponentModel(Z9r),t.registerComponentView(iFr),t.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var r=e.axisPointer.link;r&&!ft(r)&&(e.axisPointer.link=[r])}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,{overallReset:function(e,r){e.getComponent("axisPointer").coordSysAxesInfo=IPr(e,r)}}),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},aFr)}function fFr(t){Yr(glt),Yr(fB)}var pFr=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.makeElOption=function(r,n,i,a,s){var o=i.axis;o.dim==="angle"&&(this.animationThreshold=Math.PI/18);var l=o.polar,u=o.getExtent(),h=l.getOtherAxis(o).getExtent(),d=o.dataToCoord(n),f=a.get("type");if(f&&f!=="none"){var p=F0e(a),g=mFr[f](o,l,d,u,h,a.get("seriesDataIndices"),a.ecModel);g.style=p,r.graphicKey=g.type,r.pointer=g}var m=a.get(["label","margin"]),v=gFr(n,i,a,l,m);Uht(r,i,a,s,v)},e}(B0e);function gFr(t,e,r,n,i){var a=e.axis,s=a.dataToCoord(t),o=n.getAngleAxis().getExtent()[0];o=o/180*Math.PI;var l=n.getRadiusAxis().getExtent(),u,h,d;if(a.dim==="radius"){var f=xa();Zv(f,f,o),zp(f,f,[n.cx,n.cy]),u=Wp([s,-i],f);var p=e.getModel("axisLabel").get("rotate")||0,g=Ou.innerTextLayout(o,p*Math.PI/180,-1);h=g.textAlign,d=g.textVerticalAlign}else{var m=l[1];u=n.coordToPoint([m+i,s]);var v=n.cx,y=n.cy;h=Math.abs(u[0]-v)/m<.3?"center":u[0]>v?"left":"right",d=Math.abs(u[1]-y)/m<.3?"middle":u[1]>y?"top":"bottom"}return{position:u,align:h,verticalAlign:d}}var mFr={line:function(t,e,r,n,i){return t.dim==="angle"?{type:"Line",shape:U0e(e.coordToPoint([i[0],r]),e.coordToPoint([i[1],r]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r}}},shadow:function(t,e,r,n,i,a,s){var o=Math.PI/180,l=V0e(t,a,s),u;if(t.dim==="angle")u=Hht(e.cx,e.cy,i[0],i[1],(-r-l/2)*o,(-r+l/2)*o);else{var h=Q0e(r,n,l),d=h[0],f=h[1];u=Hht(e.cx,e.cy,d,f,0,Math.PI*2)}return{type:"Sector",shape:u}}},Vm="polar",Jht=Vm,vFr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.findAxisModel=function(r){var n,i=this.ecModel;return i.eachComponent(r,function(a){a.getCoordSysModel()===this&&(n=a)},this),n},e.type=Vm,e.dependencies=["radiusAxis","angleAxis"],e.defaultOption={z:0,center:["50%","50%"],radius:"80%"},e}(fn),W0e=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",ds).models[0]},e.type="polarAxis",e}(fn);Is(W0e,Y_);var yFr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="angleAxis",e}(W0e),bFr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="radiusAxis",e}(W0e),Y0e=function(t){rt(e,t);function e(r,n){return t.call(this,"radius",r,n)||this}return e.prototype.pointToData=function(r,n){return this.polar.pointToData(r,n)[this.dim==="radius"?0:1]},e}(Wf);Y0e.prototype.dataToRadius=Wf.prototype.dataToCoord,Y0e.prototype.radiusToData=Wf.prototype.coordToData;var xFr=Qr(),q0e=function(t){rt(e,t);function e(r,n){return t.call(this,"angle",r,n||[0,360])||this}return e.prototype.pointToData=function(r,n){return this.polar.pointToData(r,n)[this.dim==="radius"?0:1]},e.prototype.calculateCategoryInterval=function(){var r=this,n=r.getLabelModel(),i=r.scale,a=i.getExtent(),s=i.count();if(a[1]-a[0]<1)return 0;var o=a[0],l=r.dataToCoord(o+1)-r.dataToCoord(o),u=Math.abs(l),h=VG(o==null?"":o+"",n.getFont(),"center","top"),d=Math.max(h.height,7),f=d/u;isNaN(f)&&(f=1/0);var p=Math.max(0,Math.floor(f)),g=xFr(r.model),m=g.lastAutoInterval,v=g.lastTickCount;return m!=null&&v!=null&&Math.abs(m-p)<=1&&Math.abs(v-s)<=1&&m>p?p=m:(g.lastTickCount=s,g.lastAutoInterval=p),p},e}(Wf);q0e.prototype.dataToAngle=Wf.prototype.dataToCoord,q0e.prototype.angleToData=Wf.prototype.coordToData;var edt=["radius","angle"],wFr=function(){function t(e){this.dimensions=edt,this.type=Vm,this.cx=0,this.cy=0,this._radiusAxis=new Y0e,this._angleAxis=new q0e,this.axisPointerEnabled=!0,this.name=e||"",this._radiusAxis.polar=this._angleAxis.polar=this}return t.prototype.containPoint=function(e){var r=this.pointToCoord(e);return this._radiusAxis.contain(r[0])&&this._angleAxis.contain(r[1])},t.prototype.containData=function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},t.prototype.getAxis=function(e){var r="_"+e+"Axis";return this[r]},t.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},t.prototype.getAxesByScale=function(e){var r=[],n=this._angleAxis,i=this._radiusAxis;return n.scale.type===e&&r.push(n),i.scale.type===e&&r.push(i),r},t.prototype.getAngleAxis=function(){return this._angleAxis},t.prototype.getRadiusAxis=function(){return this._radiusAxis},t.prototype.getOtherAxis=function(e){var r=this._angleAxis;return e===r?this._radiusAxis:r},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},t.prototype.getTooltipAxes=function(e){var r=e!=null&&e!=="auto"?this.getAxis(e):this.getBaseAxis();return{baseAxes:[r],otherAxes:[this.getOtherAxis(r)]}},t.prototype.dataToPoint=function(e,r,n){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],r),this._angleAxis.dataToAngle(e[1],r)],n)},t.prototype.pointToData=function(e,r,n){n=n||[];var i=this.pointToCoord(e);return n[0]=this._radiusAxis.radiusToData(i[0],r),n[1]=this._angleAxis.angleToData(i[1],r),n},t.prototype.pointToCoord=function(e){var r=e[0]-this.cx,n=e[1]-this.cy,i=this.getAngleAxis(),a=i.getExtent(),s=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]);i.inverse?s=o-360:o=s+360;var l=Math.sqrt(r*r+n*n);r/=l,n/=l;for(var u=Math.atan2(-n,r)/Math.PI*180,h=uo;)u+=h*360;return[l,u]},t.prototype.coordToPoint=function(e,r){r=r||[];var n=e[0],i=e[1]/180*Math.PI;return r[0]=Math.cos(i)*n+this.cx,r[1]=-Math.sin(i)*n+this.cy,r},t.prototype.getArea=function(){var e=this.getAngleAxis(),r=this.getRadiusAxis(),n=r.getExtent().slice();n[0]>n[1]&&n.reverse();var i=e.getExtent(),a=Math.PI/180,s=1e-4;return{cx:this.cx,cy:this.cy,r0:n[0],r:n[1],startAngle:-i[0]*a,endAngle:-i[1]*a,clockwise:e.inverse,contain:function(o,l){var u=o-this.cx,h=l-this.cy,d=u*u+h*h,f=this.r,p=this.r0;return f!==p&&d-s<=f*f&&d+s>=p*p},x:this.cx-n[1],y:this.cy-n[1],width:n[1]*2,height:n[1]*2}},t.prototype.convertToPixel=function(e,r,n){var i=tdt(r);return i===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,r,n){var i=tdt(r);return i===this?this.pointToData(n):null},t}();function tdt(t){var e=t.seriesModel,r=t.polarModel;return r&&r.coordinateSystem||e&&e.coordinateSystem}function AFr(t,e,r){var n=e.get("center"),i=Co(e,r).refContainer;t.cx=Qt(n[0],i.width)+i.x,t.cy=Qt(n[1],i.height)+i.y;var a=t.getRadiusAxis(),s=Math.min(i.width,i.height)/2,o=e.get("radius");o==null?o=[0,"100%"]:ft(o)||(o=[0,o]);var l=[Qt(o[0],s),Qt(o[1],s)];a.inverse?a.setExtent(l[1],l[0]):a.setExtent(l[0],l[1])}function TFr(t,e){var r=this,n=r.getAngleAxis(),i=r.getRadiusAxis();if(ET(n,j_),ET(i,j_),X_(n),X_(i),n.type==="category"&&!n.onBand){var a=n.getExtent(),s=360/n.scale.count();n.inverse?a[1]+=s:a[1]-=s,n.setExtent(a[0],a[1])}}function SFr(t){return t.mainType==="angleAxis"}function rdt(t,e){var r;if(t.type=w8(e),t.scale=G_(e,t.type,!1),t.onBand=S8(t.scale,e),t.inverse=e.get("inverse"),SFr(e)){t.inverse=t.inverse!==e.get("clockwise");var n=e.get("startAngle"),i=(r=e.get("endAngle"))!==null&&r!==void 0?r:n+(t.inverse?-360:360);t.setExtent(n,i)}e.axis=t,t.model=e}var CFr={dimensions:edt,create:function(t,e){var r=[];return t.eachComponent(Jht,function(n,i){var a=new wFr(i+"");a.update=TFr;var s=a.getRadiusAxis(),o=a.getAngleAxis(),l=n.findAxisModel("radiusAxis"),u=n.findAxisModel("angleAxis");rdt(s,l),rdt(o,u),AFr(a,n,e),r.push(a),n.coordinateSystem=a,a.model=n}),t.eachSeries(function(n){if(n.get("coordinateSystem")===Vm){var i=n.getReferringComponents(Jht,ds).models[0],a=n.coordinateSystem=i.coordinateSystem;a&&(kT(a.getRadiusAxis(),n,Vm),kT(a.getAngleAxis(),n,Vm))}}),r}},OFr=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function QY(t,e,r){e[1]>e[0]&&(e=e.slice().reverse());var n=t.coordToPoint([e[0],r]),i=t.coordToPoint([e[1],r]);return{x1:n[0],y1:n[1],x2:i[0],y2:i[1]}}function GY(t){var e=t.getRadiusAxis();return e.inverse?0:1}function ndt(t){var e=t[0],r=t[t.length-1];e&&r&&Math.abs(Math.abs(e.coord-r.coord)-360)<1e-4&&t.pop()}var kFr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.axisPointerClass="PolarAxisPointer",r}return e.prototype.render=function(r,n){if(this.group.removeAll(),!!r.get("show")){var i=r.axis,a=i.polar,s=a.getRadiusAxis().getExtent(),o=i.getTicksCoords({breakTicks:"none"}),l=i.getMinorTicksCoords(),u=[];de(i.getViewLabels(),function(h){if(!h.tick.offInterval){h=lr(h);var d=i.scale;h.coord=i.dataToCoord(W_(d,h.tick)),u.push(h)}}),ndt(u),ndt(o),de(OFr,function(h){r.get([h,"show"])&&(!i.scale.isBlank()||h==="axisLine")&&EFr[h](this.group,r,a,o,l,s,u)},this)}},e.type="angleAxis",e}(UT),EFr={axisLine:function(t,e,r,n,i,a){var s=e.getModel(["axisLine","lineStyle"]),o=r.getAngleAxis(),l=Math.PI/180,u=o.getExtent(),h=GY(r),d=h?0:1,f,p=Math.abs(u[1]-u[0])===360?"Circle":"Arc";a[d]===0?f=new oT[p]({shape:{cx:r.cx,cy:r.cy,r:a[h],startAngle:-u[0]*l,endAngle:-u[1]*l,clockwise:o.inverse},style:s.getLineStyle(),z2:1,silent:!0}):f=new f_({shape:{cx:r.cx,cy:r.cy,r:a[h],r0:a[d]},style:s.getLineStyle(),z2:1,silent:!0}),f.style.fill=null,t.add(f)},axisTick:function(t,e,r,n,i,a){var s=e.getModel("axisTick"),o=(s.get("inside")?-1:1)*s.get("length"),l=a[GY(r)],u=vt(n,function(h){return new Ps({shape:QY(r,[l,l+o],h.coord)})});t.add(Dd(u,{style:mr(s.getModel("lineStyle").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})}))},minorTick:function(t,e,r,n,i,a){if(i.length){for(var s=e.getModel("axisTick"),o=e.getModel("minorTick"),l=(s.get("inside")?-1:1)*o.get("length"),u=a[GY(r)],h=[],d=0;dy?"left":"right",w=Math.abs(v[1]-b)/m<.3?"middle":v[1]>b?"top":"bottom";if(o&&o[g]){var A=o[g];yr(A)&&A.textStyle&&(p=new yn(A.textStyle,l,l.ecModel))}var T=new Pn({silent:Ou.isLabelSilent(e),style:Gi(p,{x:v[0],y:v[1],fill:p.getTextColor()||e.get(["axisLine","lineStyle","color"]),text:d.formattedLabel,align:x,verticalAlign:w})});if(t.add(T),uy({el:T,componentModel:e,itemName:d.formattedLabel,formatterParamsExtra:{isTruncated:function(){return T.isTruncated},value:d.rawLabel,tickIndex:f}}),h){var S=Ou.makeAxisEventDataBase(e);S.targetType="axisLabel",S.value=d.rawLabel,Cr(T).eventData=S}},this)},splitLine:function(t,e,r,n,i,a){var s=e.getModel("splitLine"),o=s.getModel("lineStyle"),l=o.get("color"),u=0;l=l instanceof Array?l:[l];for(var h=[],d=0;d=0?"p":"n",k=x;y&&(n[a][S]||(n[a][S]={p:x,n:x}),k=n[a][S][O]);var E=void 0,_=void 0,I=void 0,L=void 0;if(h.dim==="radius"){var R=h.dataToCoord(T)-x,D=t.dataToCoord(S);Za(R)=L})}}function BFr(t,e){var r=zT(e,Vm),n=sc(t,{fromStat:{key:r},min:1}).w,i=n,a=0,s="20%",o="30%",l={};OT(t,r,function(v){var y=idt(v);l[y]||a++,l[y]=l[y]||{width:0,maxWidth:0};var b=Qt(v.get("barWidth"),n),x=Qt(v.get("barMaxWidth"),n),w=v.get("barGap"),A=v.get("barCategoryGap");b&&!l[y].width&&(b=Ai(i,b),l[y].width=b,i-=b),x&&(l[y].maxWidth=x),w!=null&&(o=w),A!=null&&(s=A)});var u={},h=Qt(s,n),d=Qt(o,1),f=(i-h)/(a+(a-1)*d);f=en(f,0),de(l,function(v,y){var b=v.maxWidth;b&&b=r.y&&e[1]<=r.y+r.height:n.contain(n.toLocalCoord(e[1]))&&e[0]>=r.y&&e[0]<=r.y+r.height},t.prototype.pointToData=function(e,r,n){n=n||[];var i=this.getAxis();return n[0]=i.coordToData(i.toLocalCoord(e[i.orient==="horizontal"?0:1])),n},t.prototype.dataToPoint=function(e,r,n){var i=this.getAxis(),a=this.getRect();n=n||[];var s=i.orient==="horizontal"?0:1;return e instanceof Array&&(e=e[0]),n[s]=i.toGlobalCoord(i.dataToCoord(+e)),n[1-s]=s===0?a.y+a.height/2:a.x+a.width/2,n},t.prototype.convertToPixel=function(e,r,n){var i=sdt(r);return i===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,r,n){var i=sdt(r);return i===this?this.pointToData(n):null},t}();function sdt(t){var e=t.seriesModel,r=t.singleAxisModel;return r&&r.coordinateSystem||e&&e.coordinateSystem}function qFr(t,e){var r=[];return t.eachComponent(Xge,function(n,i){var a=new YFr(n,t,e);a.name="single_"+i,a.resize(n,e),n.coordinateSystem=a,r.push(a)}),t.eachSeries(function(n){if(n.get("coordinateSystem")===HPr){var i=n.getReferringComponents(Xge,ds).models[0],a=n.coordinateSystem=i&&i.coordinateSystem;a&&kT(a.getAxis(),n,nY)}}),r}var jFr={create:qFr,dimensions:adt},odt=["x","y"],XFr=["width","height"],KFr=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.makeElOption=function(r,n,i,a,s){var o=i.axis,l=o.coordinateSystem,u=HY(o),h=WY(l,u),d=WY(l,1-u),f=l.dataToPoint(n)[0],p=a.get("type");if(p&&p!=="none"){var g=F0e(a),m=ZFr[p](o,f,h,d,a.get("seriesDataIndices"),a.ecModel);m.style=g,r.graphicKey=m.type,r.pointer=m}var v=j0e(i);Qht(n,r,v,i,a,s)},e.prototype.getHandleTransform=function(r,n,i){var a=j0e(n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var s=z0e(n.axis,r,a);return{x:s[0],y:s[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(r,n,i,a){var s=i.axis,o=s.coordinateSystem,l=HY(s),u=WY(o,l),h=[r.x,r.y];h[l]+=n[l],h[l]=Math.min(u[1],h[l]),h[l]=Math.max(u[0],h[l]);var d=WY(o,1-l),f=(d[1]+d[0])/2,p=[f,f];return p[l]=h[l],{x:h[0],y:h[1],rotation:r.rotation,cursorPoint:p,tooltipOption:{verticalAlign:"middle"}}},e}(B0e),ZFr={line:function(t,e,r,n){var i=U0e([e,n[0]],[e,n[1]],HY(t));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(t,e,r,n,i,a){var s=V0e(t,i,a),o=n[1]-n[0],l=Q0e(e,r,s),u=l[0],h=l[1];return{type:"Rect",shape:Ght([u,n[0]],[h-u,o],HY(t))}}};function HY(t){return t.isHorizontal()?0:1}function WY(t,e){var r=t.getRect();return[r[odt[e]],r[odt[e]]+r[XFr[e]]]}var JFr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="single",e}(Hi);function ezr(t){Yr(fB),UT.registerAxisPointerClass("SingleAxisPointer",KFr),t.registerComponentView(JFr),t.registerComponentView(GFr),t.registerComponentModel(iY),n5(t,"single",iY,iY.defaultOption),t.registerCoordinateSystem("single",jFr)}var tzr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r,n,i){var a=dT(r);t.prototype.init.apply(this,arguments),ldt(r,a)},e.prototype.mergeOption=function(r){t.prototype.mergeOption.apply(this,arguments),ldt(this.option,r)},e.prototype.getCellSize=function(){return this.option.cellSize},e.type="calendar",e.layoutMode="box",e.defaultOption={z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:et.color.axisLine,width:1,type:"solid"}},itemStyle:{color:et.color.neutral00,borderWidth:1,borderColor:et.color.neutral10},dayLabel:{show:!0,firstDay:0,position:"start",margin:et.size.s,color:et.color.secondary},monthLabel:{show:!0,position:"start",margin:et.size.s,align:"center",formatter:null,color:et.color.secondary},yearLabel:{show:!0,position:null,margin:et.size.xl,formatter:null,color:et.color.quaternary,fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},e}(fn);function ldt(t,e){var r=t.cellSize,n;ft(r)?n=r:n=t.cellSize=[r,r],n.length===1&&(n[1]=n[0]);var i=vt([0,1],function(a){return r4r(e,a)&&(n[a]="auto"),n[a]!=null&&n[a]!=="auto"});Rm(t,e,{type:"box",ignoreSize:i})}var rzr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){var a=this.group;a.removeAll();var s=r.coordinateSystem,o=s.getRangeInfo(),l=s.getOrient(),u=n.getLocaleModel();this._renderDayRect(r,o,a),this._renderLines(r,o,l,a),this._renderYearText(r,o,l,a),this._renderMonthText(r,u,l,a),this._renderWeekText(r,u,o,l,a)},e.prototype._renderDayRect=function(r,n,i){for(var a=r.coordinateSystem,s=r.getModel("itemStyle").getItemStyle(),o=a.getCellWidth(),l=a.getCellHeight(),u=n.start.time;u<=n.end.time;u=a.getNextNDay(u,1).time){var h=a.dataToCalendarLayout([u],!1).tl,d=new tn({shape:{x:h[0],y:h[1],width:o,height:l},cursor:"default",style:s});i.add(d)}},e.prototype._renderLines=function(r,n,i,a){var s=this,o=r.coordinateSystem,l=r.getModel(["splitLine","lineStyle"]).getLineStyle(),u=r.get(["splitLine","show"]),h=l.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var d=n.start,f=0;d.time<=n.end.time;f++){g(d.formatedDate),f===0&&(d=o.getDateInfo(n.start.y+"-"+n.start.m));var p=d.date;p.setMonth(p.getMonth()+1),d=o.getDateInfo(p)}g(o.getNextNDay(n.end.time,1).formatedDate);function g(m){s._firstDayOfMonth.push(o.getDateInfo(m)),s._firstDayPoints.push(o.dataToCalendarLayout([m],!1).tl);var v=s._getLinePointsOfOneWeek(r,m,i);s._tlpoints.push(v[0]),s._blpoints.push(v[v.length-1]),u&&s._drawSplitline(v,l,a)}u&&this._drawSplitline(s._getEdgesPoints(s._tlpoints,h,i),l,a),u&&this._drawSplitline(s._getEdgesPoints(s._blpoints,h,i),l,a)},e.prototype._getEdgesPoints=function(r,n,i){var a=[r[0].slice(),r[r.length-1].slice()],s=i==="horizontal"?0:1;return a[0][s]=a[0][s]-n/2,a[1][s]=a[1][s]+n/2,a},e.prototype._drawSplitline=function(r,n,i){var a=new Al({z2:20,shape:{points:r},style:n});i.add(a)},e.prototype._getLinePointsOfOneWeek=function(r,n,i){for(var a=r.coordinateSystem,s=a.getDateInfo(n),o=[],l=0;l<7;l++){var u=a.getNextNDay(s.time,l),h=a.dataToCalendarLayout([u.time],!1);o[2*u.day]=h.tl,o[2*u.day+1]=h[i==="horizontal"?"bl":"tr"]}return o},e.prototype._formatterLabel=function(r,n){return Nt(r)&&r?vrt(r,n):ur(r)?r(n):n.nameMap},e.prototype._yearTextPositionControl=function(r,n,i,a,s){var o=n[0],l=n[1],u=["center","bottom"];a==="bottom"?(l+=s,u=["center","top"]):a==="left"?o-=s:a==="right"?(o+=s,u=["center","top"]):l-=s;var h=0;return(a==="left"||a==="right")&&(h=Math.PI/2),{rotation:h,x:o,y:l,style:{align:u[0],verticalAlign:u[1]}}},e.prototype._renderYearText=function(r,n,i,a){var s=r.getModel("yearLabel");if(s.get("show")){var o=s.get("margin"),l=s.get("position");l||(l=i!=="horizontal"?"top":"left");var u=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],h=(u[0][0]+u[1][0])/2,d=(u[0][1]+u[1][1])/2,f=i==="horizontal"?0:1,p={top:[h,u[f][1]],bottom:[h,u[1-f][1]],left:[u[1-f][0],d],right:[u[f][0],d]},g=n.start.y;+n.end.y>+n.start.y&&(g=g+"-"+n.end.y);var m=s.get("formatter"),v={start:n.start.y,end:n.end.y,nameMap:g},y=this._formatterLabel(m,v),b=new Pn({z2:30,style:Gi(s,{text:y}),silent:s.get("silent")});b.attr(this._yearTextPositionControl(b,p[l],i,l,o)),a.add(b)}},e.prototype._monthTextPositionControl=function(r,n,i,a,s){var o="left",l="top",u=r[0],h=r[1];return i==="horizontal"?(h=h+s,n&&(o="center"),a==="start"&&(l="bottom")):(u=u+s,n&&(l="middle"),a==="start"&&(o="right")),{x:u,y:h,align:o,verticalAlign:l}},e.prototype._renderMonthText=function(r,n,i,a){var s=r.getModel("monthLabel");if(s.get("show")){var o=s.get("nameMap"),l=s.get("margin"),u=s.get("position"),h=s.get("align"),d=[this._tlpoints,this._blpoints];(!o||Nt(o))&&(o&&(n=Afe(o)||n),o=n.get(["time","monthAbbr"])||[]);var f=u==="start"?0:1,p=i==="horizontal"?0:1;l=u==="start"?-l:l;for(var g=h==="center",m=s.get("silent"),v=0;v=a.start.time&&i.timeo.end.time&&r.reverse(),r},t.prototype._getRangeInfo=function(e){var r=[this.getDateInfo(e[0]),this.getDateInfo(e[1])],n;r[0].time>r[1].time&&(n=!0,r.reverse());var i=Math.floor(r[1].time/X0e)-Math.floor(r[0].time/X0e)+1,a=new Date(r[0].time),s=a.getDate(),o=r[1].date.getDate();a.setDate(s+i-1);var l=a.getDate();if(l!==o)for(var u=a.getTime()-r[1].time>0?1:-1;(l=a.getDate())!==o&&(a.getTime()-r[1].time)*u>0;)i-=u,a.setDate(l-u);var h=Math.floor((i+r[0].day+6)/7),d=n?-h+1:h-1;return n&&r.reverse(),{range:[r[0].formatedDate,r[1].formatedDate],start:r[0],end:r[1],allDay:i,weeks:h,nthWeek:d,fweek:r[0].day,lweek:r[1].day}},t.prototype._getDateByWeeksAndDay=function(e,r,n){var i=this._getRangeInfo(n);if(e>i.weeks||e===0&&ri.lweek)return null;var a=(e-1)*7-i.fweek+r,s=new Date(i.start.time);return s.setDate(+i.start.d+a),this.getDateInfo(s)},t.create=function(e,r){var n=[];return e.eachComponent("calendar",function(i){var a=new t(i,e,r);n.push(a),i.coordinateSystem=a}),e.eachComponent(function(i,a){ZN({targetModel:a,coordSysType:"calendar",coordSysProvider:Srt})}),n},t.dimensions=["time","value"],t}();function K0e(t){var e=t.calendarModel,r=t.seriesModel,n=e?e.coordinateSystem:r?r.coordinateSystem:null;return n}function izr(t){t.registerComponentModel(tzr),t.registerComponentView(rzr),t.registerCoordinateSystem("calendar",nzr)}var Ty={level:1,leaf:2,nonLeaf:3},Sy={none:0,all:1,body:2,corner:3};function Z0e(t,e,r){var n=e[Mr[r]].getCell(t);return!n&&zn(t)&&t<0&&(n=e[Mr[1-r]].getUnitLayoutInfo(r,Math.round(t))),n}function cdt(t){var e=t||[];return e[0]=e[0]||[],e[1]=e[1]||[],e[0][0]=e[0][1]=e[1][0]=e[1][1]=NaN,e}function udt(t,e,r,n,i){hdt(t[0],e,i,r,n,0),hdt(t[1],e,i,r,n,1)}function hdt(t,e,r,n,i,a){t[0]=1/0,t[1]=-1/0;var s=n[a],o=ft(s)?s:[s],l=o.length,u=!!r;if(l>=1?(ddt(t,e,o,u,i,a,0),l>1&&ddt(t,e,o,u,i,a,l-1)):t[0]=t[1]=NaN,u){var h=-i[Mr[1-a]].getLocatorCount(a),d=i[Mr[a]].getLocatorCount(a)-1;r===Sy.body?h=en(0,h):r===Sy.corner&&(d=Ai(-1,d)),d=e[0]&&t[0]<=e[1]}function gdt(t,e){t.id.set(e[0][0],e[1][0]),t.span.set(e[0][1]-t.id.x+1,e[1][1]-t.id.y+1)}function ozr(t,e){t[0][0]=e[0][0],t[0][1]=e[0][1],t[1][0]=e[1][0],t[1][1]=e[1][1]}function mdt(t,e,r,n){var i=Z0e(e[n][0],r,n),a=Z0e(e[n][1],r,n);t[Mr[n]]=t[xs[n]]=NaN,i&&a&&(t[Mr[n]]=i.xy,t[xs[n]]=a.xy+a.wh-i.xy)}function pB(t,e,r,n){return t[Mr[e]]=r,t[Mr[1-e]]=n,t}function lzr(t){return t&&(t.type===Ty.leaf||t.type===Ty.nonLeaf)?t:null}function qY(){return{x:NaN,y:NaN,width:NaN,height:NaN}}var vdt=function(){function t(e,r){this._cells=[],this._levels=[],this.dim=e,this.dimIdx=e==="x"?0:1,this._model=r,this._uniqueValueGen=czr(e);var n=r.get("data",!0),i=r.get("length",!0);if(n!=null&&!ft(n)&&(n=[]),n)this._initByDimModelData(n);else if(i!=null){n=Array(i);for(var a=0;a=1,x=r[Mr[n]],w=a.getLocatorCount(n)-1,A=new hx;for(s.resetLayoutIterator(A,n);A.next();)T(A.item);for(a.resetLayoutIterator(A,n);A.next();)T(A.item);function T(S){Jl(S.wh)&&(S.wh=y),S.xy=x,S.id[Mr[n]]===w&&!b&&(S.wh=r[Mr[n]]+r[xs[n]]-S.xy),x+=S.wh}}function Cdt(t,e){for(var r=e[Mr[t]].resetCellIterator();r.next();){var n=r.item;JY(n.rect,t,n.id,n.span,e),JY(n.rect,1-t,n.id,n.span,e),n.type===Ty.nonLeaf&&(n.xy=n.rect[Mr[t]],n.wh=n.rect[xs[t]])}}function Odt(t,e){t.travelExistingCells(function(r){var n=r.span;if(n){var i=r.spanRect,a=r.id;JY(i,0,a,n,e),JY(i,1,a,n,e)}})}function JY(t,e,r,n,i){t[xs[e]]=0;var a=r[Mr[e]],s=a<0?i[Mr[1-e]]:i[Mr[e]],o=s.getUnitLayoutInfo(e,r[Mr[e]]);if(t[Mr[e]]=o.xy,t[xs[e]]=o.wh,n[Mr[e]]>1){var l=s.getUnitLayoutInfo(e,r[Mr[e]]+n[Mr[e]]-1);t[xs[e]]=l.xy+l.wh-o.xy}}function Azr(t,e,r){var n=KG(t,r[xs[e]]);return ive(n,r[xs[e]])}function ive(t,e){return Math.max(Math.min(t,Jt(e,1/0)),0)}function ave(t){var e=t.matrixModel,r=t.seriesModel,n=e?e.coordinateSystem:r?r.coordinateSystem:null;return n}var oc={inBody:1,inCorner:2,outside:3},Qm={x:null,y:null,point:[]};function kdt(t,e,r,n,i){var a=r[Mr[e]],s=r[Mr[1-e]],o=a.getUnitLayoutInfo(e,a.getLocatorCount(e)-1),l=a.getUnitLayoutInfo(e,0),u=s.getUnitLayoutInfo(e,-s.getLocatorCount(e)),h=s.shouldShow()?s.getUnitLayoutInfo(e,-1):null,d=t.point[e]=n[e];if(!l&&!h){t[Mr[e]]=oc.outside;return}if(i===Sy.body){l?(t[Mr[e]]=oc.inBody,d=Ai(o.xy+o.wh,en(l.xy,d)),t.point[e]=d):t[Mr[e]]=oc.outside;return}else if(i===Sy.corner){h?(t[Mr[e]]=oc.inCorner,d=Ai(h.xy+h.wh,en(u.xy,d)),t.point[e]=d):t[Mr[e]]=oc.outside;return}var f=l?l.xy:h?h.xy+h.wh:NaN,p=u?u.xy:f,g=o?o.xy+o.wh:f;if(dg){if(!i){t[Mr[e]]=oc.outside;return}d=g}t.point[e]=d,t[Mr[e]]=f<=d&&d<=g?oc.inBody:p<=d&&d<=f?oc.inCorner:oc.outside}function Edt(t,e,r,n){var i=1-r;if(t[Mr[r]]!==oc.outside)for(n[Mr[r]].resetCellIterator(nve);nve.next();){var a=nve.item;if(Rdt(t.point[r],a.rect,r)&&Rdt(t.point[i],a.rect,i)){e[r]=a.ordinal,e[i]=a.id[Mr[i]];return}}}function _dt(t,e,r,n){if(t[Mr[r]]!==oc.outside){var i=t[Mr[r]]===oc.inCorner?n[Mr[1-r]]:n[Mr[r]];for(i.resetLayoutIterator(ZY,r);ZY.next();)if(Tzr(t.point[r],ZY.item)){e[r]=ZY.item.id[Mr[r]];return}}}function Tzr(t,e){return e.xy<=t&&t<=e.xy+e.wh}function Rdt(t,e,r){return e[Mr[r]]<=t&&t<=e[Mr[r]]+e[xs[r]]}function Szr(t){t.registerComponentModel(fzr),t.registerComponentView(yzr),t.registerCoordinateSystem("matrix",wzr)}function Czr(t,e){var r=t.existing;if(e.id=t.keyInfo.id,!e.type&&r&&(e.type=r.type),e.parentId==null){var n=e.parentOption;n?e.parentId=n.id:r&&(e.parentId=r.parentId)}e.parentOption=null}function Ddt(t,e){var r;return de(e,function(n){t[n]!=null&&t[n]!=="auto"&&(r=!0)}),r}function Ozr(t,e,r){var n=ot({},r),i=t[e],a=r.$action||"merge";a==="merge"?i?(Vr(i,n,!0),Rm(i,n,{ignoreSize:!0}),_rt(r,i),eq(r,i),eq(r,i,"shape"),eq(r,i,"style"),eq(r,i,"extra"),r.clipPath=i.clipPath):t[e]=n:a==="replace"?t[e]=n:a==="remove"&&i&&(t[e]=null)}var Ldt=["transition","enterFrom","leaveTo"],kzr=Ldt.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function eq(t,e,r){if(r&&(!t[r]&&e[r]&&(t[r]={}),t=t[r],e=e[r]),!(!t||!e))for(var n=r?Ldt:kzr,i=0;i=0;h--){var d=i[h],f=wo(d.id,null),p=f!=null?s.get(f):null;if(p){var g=p.parent,y=Kf(g),b=g===a?{width:o,height:l}:{width:y.width,height:y.height},x={},w=GH(p,d,b,null,{hv:d.hv,boundingMode:d.bounding},x);if(!Kf(p).isNew&&w){for(var A=d.transition,T={},S=0;S=0)?T[O]=k:p[O]=k}Hn(p,T,r,0)}else p.attr(x)}}},e.prototype._clear=function(){var r=this,n=this._elMap;n.each(function(i){tq(i,Kf(i).option,n,r._lastGraphicModel)}),this._elMap=Yt()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(Hi);function sve(t){var e=Kt(Mdt,t)?Mdt[t]:GN(t),r=new e({});return Kf(r).type=t,r}function Idt(t,e,r,n){var i=sve(r);return e.add(i),n.set(t,i),Kf(i).id=t,Kf(i).isNew=!0,i}function tq(t,e,r,n){var i=t&&t.parent;i&&(t.type==="group"&&t.traverse(function(a){tq(a,e,r,n)}),FY(t,e,n),r.removeKey(Kf(t).id))}function Pdt(t,e,r,n){t.isGroup||de([["cursor",$f.prototype.cursor],["zlevel",n||0],["z",r||0],["z2",0]],function(i){var a=i[0];Kt(e,a)?t[a]=Jt(e[a],i[1]):t[a]==null&&(t[a]=i[1])}),de(kn(e),function(i){if(i.indexOf("on")===0){var a=e[i];t[i]=ur(a)?a:null}}),Kt(e,"draggable")&&(t.draggable=e.draggable),e.name!=null&&(t.name=e.name),e.id!=null&&(t.id=e.id)}function Dzr(t){return t=ot({},t),de(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(Crt),function(e){delete t[e]}),t}function Lzr(t,e,r){var n=Cr(t).eventData;!t.silent&&!t.ignore&&!n&&(n=Cr(t).eventData={componentType:"graphic",componentIndex:e.componentIndex,name:t.name}),n&&(n.info=r.info)}function Mzr(t){t.registerComponentModel(_zr),t.registerComponentView(Rzr),t.registerPreprocessor(function(e){var r=e.graphic;ft(r)?!r[0]||!r[0].elements?e.graphic=[{elements:r}]:e.graphic=[e.graphic[0]]:r&&!r.elements&&(e.graphic=[{elements:[r]}])})}var Ndt=["x","y","radius","angle","single"],Izr=Qr(),Pzr=["cartesian2d","polar","singleAxis"];function Nzr(t){var e=t.get("coordinateSystem");return Ir(Pzr,e)>=0}function zx(t){return t+"Axis"}function Bzr(t,e){var r=Yt(),n=[],i=Yt();t.eachComponent({mainType:"dataZoom",query:e},function(h){i.get(h.uid)||o(h)});var a;do a=!1,t.eachComponent("dataZoom",s);while(a);function s(h){!i.get(h.uid)&&l(h)&&(o(h),a=!0)}function o(h){i.set(h.uid,!0),n.push(h),u(h)}function l(h){var d=!1;return h.eachTargetAxis(function(f,p){var g=r.get(f);g&&g[p]&&(d=!0)}),d}function u(h){h.eachTargetAxis(function(d,f){(r.get(d)||r.set(d,[]))[f]=!0})}return n}function Bdt(t){var e=t.ecModel,r={infoList:[],infoMap:Yt()};return t.eachTargetAxis(function(n,i){var a=e.getComponent(zx(n),i);if(a){var s=a.getCoordSysModel();if(s){var o=s.uid,l=r.infoMap.get(o);l||(l={model:s,axisModels:[]},r.infoList.push(l),r.infoMap.set(o,l)),l.axisModels.push(a)}}}),r}function $dt(t){var e=Izr(ait(t));return e.axisProxyMap||(e.axisProxyMap=Yt())}function rq(t){if(t)return $dt(t.ecModel).get(t.uid)}function $zr(t,e){$dt(t.ecModel).set(t.uid,e)}function Fdt(t,e){var r=e.getAxisModel().axis.__alignTo;return r&&t.getAxisProxy(r.dim,r.model.componentIndex)?rq(r.model):null}var ove=function(){function t(){this.indexList=[],this.indexMap=[]}return t.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},t}(),mB=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r._autoThrottle=!0,r._noTarget=!0,r._rangePropMode=["percent","percent"],r}return e.prototype.init=function(r,n,i){var a=zdt(r);this.settledOption=a,this.mergeDefaultAndTheme(r,i),this._doInit(a)},e.prototype.mergeOption=function(r){var n=zdt(r);Vr(this.option,r,!0),Vr(this.settledOption,n,!0),this._doInit(n)},e.prototype._doInit=function(r){var n=this.option;this._setDefaultThrottle(r),this._updateRangeUse(r);var i=this.settledOption;de([["start","startValue"],["end","endValue"]],function(a,s){this._rangePropMode[s]==="value"&&(n[a[0]]=i[a[0]]=null)},this),this._resetTarget()},e.prototype._resetTarget=function(){var r=this.get("orient",!0),n=this._targetAxisInfoMap=Yt(),i=this._fillSpecifiedTargetAxis(n);i?this._orient=r||this._makeAutoOrientByTargetAxis():(this._orient=r||"horizontal",this._fillAutoTargetAxisByOrient(n,this._orient)),this._noTarget=!0,n.each(function(a){a.indexList.length&&(this._noTarget=!1)},this)},e.prototype._fillSpecifiedTargetAxis=function(r){var n=!1;return de(Ndt,function(i){var a=this.getReferringComponents(zx(i),CEr);if(a.specified){n=!0;var s=new ove;de(a.models,function(o){s.add(o.componentIndex)}),r.set(i,s)}},this),n},e.prototype._fillAutoTargetAxisByOrient=function(r,n){var i=this.ecModel,a=!0;if(a){var s=n==="vertical"?"y":"x",o=i.findComponents({mainType:s+"Axis"});l(o,s)}if(a){var o=i.findComponents({mainType:"singleAxis",filter:function(h){return h.get("orient",!0)===n}});l(o,"single")}function l(u,h){var d=u[0];if(d){var f=new ove;if(f.add(d.componentIndex),r.set(h,f),a=!1,h==="x"||h==="y"){var p=d.getReferringComponents("grid",ds).models[0];p&&de(u,function(g){d.componentIndex!==g.componentIndex&&p===g.getReferringComponents("grid",ds).models[0]&&f.add(g.componentIndex)})}}}a&&de(Ndt,function(u){if(a){var h=i.findComponents({mainType:zx(u),filter:function(f){return f.get("type",!0)==="category"}});if(h[0]){var d=new ove;d.add(h[0].componentIndex),r.set(u,d),a=!1}}},this)},e.prototype._makeAutoOrientByTargetAxis=function(){var r;return this.eachTargetAxis(function(n){!r&&(r=n)},this),r==="y"?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(r){if(r.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var n=this.ecModel.option;this.option.throttle=n.animation&&n.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(r){var n=this._rangePropMode,i=this.get("rangeMode");de([["start","startValue"],["end","endValue"]],function(a,s){var o=r[a[0]]!=null,l=r[a[1]]!=null;o&&!l?n[s]="percent":!o&&l?n[s]="value":i?n[s]=i[s]:o&&(n[s]="percent")})},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var r;return this.eachTargetAxis(function(n,i){r==null&&(r=this.ecModel.getComponent(zx(n),i))},this),r},e.prototype.eachTargetAxis=function(r,n){this._targetAxisInfoMap.each(function(i,a){de(i.indexList,function(s){r.call(n,a,s)})})},e.prototype.getAxisProxy=function(r,n){return rq(this.getAxisModel(r,n))},e.prototype.getAxisModel=function(r,n){var i=this._targetAxisInfoMap.get(r);if(i&&i.indexMap[n])return this.ecModel.getComponent(zx(r),n)},e.prototype.setRawRange=function(r){var n=this.option,i=this.settledOption;de([["start","startValue"],["end","endValue"]],function(a){(r[a[0]]!=null||r[a[1]]!=null)&&(n[a[0]]=i[a[0]]=r[a[0]],n[a[1]]=i[a[1]]=r[a[1]])},this),this._updateRangeUse(r)},e.prototype.setCalculatedRange=function(r){var n=this.option;de(["start","startValue","end","endValue"],function(i){n[i]=r[i]})},e.prototype.getPercentRange=function(){var r=this.findRepresentativeAxisProxy();if(r)return r.getWindow().percent},e.prototype.getValueRange=function(r,n){if(r==null&&n==null){var i=this.findRepresentativeAxisProxy();if(i)return i.getWindow().value}else return this.getAxisProxy(r,n).getWindow().value},e.prototype.findRepresentativeAxisProxy=function(r){if(r)return rq(r);for(var n,i=this._targetAxisInfoMap.keys(),a=0;as[1];if(x&&!w&&!A)return!0;x&&(v=!0),w&&(g=!0),A&&(m=!0)}return v&&g&&m})}else de(h,function(p){if(a==="empty")l.setData(u=u.map(p,function(m){return o(m)?m:NaN}));else{var g={};g[p]=s,u.selectRange(g)}});de(h,function(p){u.setApproximateExtent(s,p)})}});function o(l){return l>=s[0]&&l<=s[1]}},t.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},r=this._dataZoomModel,n=this._extent;de(["min","max"],function(i){var a=r.get(i+"Span"),s=r.get(i+"ValueSpan");s!=null&&(s=this.getAxisModel().axis.scale.parse(s)),s!=null?a=jn(n[0]+s,n,[0,100],!0):a!=null&&(s=jn(a,[0,100],n,!0)-n[0]),e[i+"Span"]=a,e[i+"ValueSpan"]=s},this)},t}(),Vzr={dirtyOnOverallProgress:!0,getTargetSeries:function(t){function e(i){t.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(s,o){var l=t.getComponent(zx(s),o);i(s,o,l,a)})})}var r=[];e(function(i,a,s,o){if(!rq(s)){var l=new Uzr(i,a,o,t);r.push(l),$zr(s,l)}});var n=Yt();return de(r,function(i){de(i.getTargetSeriesModels(),function(a){n.set(a.uid,a)})}),n},overallReset:function(t,e){t.eachComponent("dataZoom",function(r){var n=[];r.eachTargetAxis(function(i,a){var s=r.getAxisProxy(i,a),o=Fdt(r,s);o?n.push([s,o]):s.reset(r,null)}),de(n,function(i){i[0].reset(r,i[1].getWindow().percentInverted)}),r.eachTargetAxis(function(i,a){r.getAxisProxy(i,a).filterData(r,e)})}),t.eachComponent("dataZoom",function(r){var n=r.findRepresentativeAxisProxy();if(n){var i=n.getWindow(),a=i.percent,s=i.value;r.setCalculatedRange({start:a[0],end:a[1],startValue:s[0],endValue:s[1]})}})}};function Qzr(t){t.registerAction("dataZoom",function(e,r){var n=Bzr(r,e);de(n,function(i){i.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var Gzr=a_();function cve(t){Gzr(t,function(){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,Vzr),Qzr(t),t.registerSubTypeDefaulter("dataZoom",function(){return"slider"})})}function Hzr(t){t.registerComponentModel(Fzr),t.registerComponentView(zzr),cve(t)}var Gm=function(){function t(){}return t}(),Udt={};function m5(t,e){Udt[t]=e}function Vdt(t){return Udt[t]}var Wzr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r,n,i){var a=i.getTheme().get("toolbox"),s=a?a.feature:null;s&&(this._themeFeatureOption=ot({},s),a.feature={}),t.prototype.init.call(this,r,n,i),s&&(a.feature=s)},e.prototype.optionUpdated=function(){de(this.option.feature,function(r,n){var i=this._themeFeatureOption,a=Vdt(n);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(this.ecModel)),i&&i[n]&&(Vr(r,i[n]),i[n]=null),Vr(r,a.defaultOption))},this)},e.type="toolbox",e.layoutMode={type:"box",ignoreSize:!0},e.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:et.color.border,borderRadius:0,borderWidth:0,padding:et.size.m,itemSize:15,itemGap:et.size.s,showTitle:!0,iconStyle:{borderColor:et.color.accent50,color:"none"},emphasis:{iconStyle:{borderColor:et.color.accent70}},tooltip:{show:!1,position:"bottom"}},e}(fn);function Qdt(t,e){var r=C_(e.get("padding")),n=e.getItemStyle(["color","opacity"]);n.fill=e.get("backgroundColor");var i=new tn({shape:{x:t.x-r[3],y:t.y-r[0],width:t.width+r[1]+r[3],height:t.height+r[0]+r[2],r:e.get("borderRadius")},style:n,silent:!0,z2:-1});return i}var Yzr=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(r,n,i,a){var s=this.group;if(s.removeAll(),!r.get("show"))return;var o=+r.get("itemSize"),l=r.get("orient")==="vertical",u=r.get("feature")||{},h=this._features||(this._features=Yt()),d=[];de(u,function(b,x){d.push(x)}),new fy(this._featureNames||[],d).add(f).update(f).remove(qr(f,null)).execute(),this._featureNames=ni(d,function(b){return h.hasKey(b)});function f(b,x){var w=b!=null&&x==null,A=b!=null&&x!=null,T=b==null,S=w||A?d[b]:d[x],O=u[S],k=w||A?new yn(O,r,n):null,E=k&&k.get("show"),_;if(w){if(!E)return;if(qzr(S))_={onclick:k.option.onclick,featureName:S};else{var I=Vdt(S);if(!I)return;_=new I}h.set(S,_)}else _=h.get(S);if(T||!E){Gdt(_)&&_.dispose&&_.dispose(n,i),h.removeKey(S);return}a&&a.newTitle!=null&&a.featureName===S&&(O.title=a.newTitle),w&&(_.uid=lT("toolbox-feature")),_.model=k,_.ecModel=n,_.api=i,p(k,_,S),k.setIconStatus=function(L,R){var D=this.option,M=this.iconPaths;D.iconStatus=D.iconStatus||{},D.iconStatus[L]=R,M[L]&&(R==="emphasis"?oy:ly)(M[L])},Gdt(_)&&_.render&&_.render(k,n,i,a)}function p(b,x,w){var A=b.getModel("iconStyle"),T=b.getModel(["emphasis","iconStyle"]),S=x instanceof Gm&&x.getIcons?x.getIcons():b.get("icon"),O=b.get("title")||{},k,E;Nt(S)?(k={},k[w]=S):k=S,Nt(O)?(E={},E[w]=O):E=O;var _=b.iconPaths={};de(k,function(I,L){var R=x_(I,{},{x:-o/2,y:-o/2,width:o,height:o});R.setStyle(A.getItemStyle());var D=R.ensureState("emphasis");D.style=T.getItemStyle();var M=new Pn({style:{text:E[L],align:T.get("textAlign"),borderRadius:T.get("textBorderRadius"),padding:T.get("textPadding"),fill:null,font:mfe({fontStyle:T.get("textFontStyle"),fontFamily:T.get("textFontFamily"),fontSize:T.get("textFontSize"),fontWeight:T.get("textFontWeight")},n)},ignore:!0});R.setTextContent(M),uy({el:R,componentModel:r,itemName:L,formatterParamsExtra:{title:E[L]}}),R.__title=E[L],R.on("mouseover",function(){var P=T.getItemStyle(),N=l?r.get("right")==null&&r.get("left")!=="right"?"right":"left":r.get("bottom")==null&&r.get("top")!=="bottom"?"bottom":"top";M.setStyle({fill:T.get("textFill")||P.fill||P.stroke||et.color.neutral99,backgroundColor:T.get("textBackgroundColor")}),R.setTextConfig({position:T.get("textPosition")||N}),M.ignore=!r.get("showTitle"),i.enterEmphasis(this)}).on("mouseout",function(){b.get(["iconStatus",L])!=="emphasis"&&i.leaveEmphasis(this),M.hide()}),(b.get(["iconStatus",L])==="emphasis"?oy:ly)(R),s.add(R),R.on("click",Ht(x.onclick,x,n,i,L)),_[L]=R})}var g=Co(r,i).refContainer,m=r.getBoxLayoutParams(),v=r.get("padding"),y=da(m,g,v);hT(r.get("orient"),s,r.get("itemGap"),y.width,y.height),GH(s,m,g,v),s.add(Qdt(s.getBoundingRect(),r)),l||s.eachChild(function(b){var x=b.__title,w=b.ensureState("emphasis"),A=w.textConfig||(w.textConfig={}),T=b.getTextContent(),S=T&&T.ensureState("emphasis");if(S&&!ur(S)&&x){var O=S.style||(S.style={}),k=VG(x,Pn.makeFont(O)),E=b.x+s.x,_=b.y+s.y+o,I=!1;_+k.height>i.getHeight()&&(A.position="top",I=!0);var L=I?-5-k.height:o+10;E+k.width/2>i.getWidth()?(A.position=["100%",L],O.align="right"):E-k.width/2<0&&(A.position=[0,L],O.align="left")}})},e.prototype.updateView=function(r,n,i,a){de(this._features,function(s){s&&s instanceof Gm&&s.updateView&&s.updateView(s.model,n,i,a)})},e.prototype.dispose=function(r,n){de(this._features,function(i){i&&i instanceof Gm&&i.dispose&&i.dispose(r,n)})},e.type="toolbox",e}(Hi);function qzr(t){return t.indexOf("my")===0}function Gdt(t){return t instanceof Gm}var jzr=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.onclick=function(r,n){var i=this.model,a=i.get("name")||r.get("title.0.text")||"echarts",s=n.getZr().painter.getType()==="svg",o=s?"svg":i.get("type",!0)||"png",l=n.getConnectedDataURL({type:o,backgroundColor:i.get("backgroundColor",!0)||r.get("backgroundColor")||et.color.neutral00,connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")}),u=Rn.browser;if(typeof MouseEvent=="function"&&(u.newEdge||!u.ie&&!u.edge)){var h=document.createElement("a");h.download=a+"."+o,h.target="_blank",h.href=l;var d=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});h.dispatchEvent(d)}else if(window.navigator.msSaveOrOpenBlob||s){var f=l.split(","),p=f[0].indexOf("base64")>-1,g=s?decodeURIComponent(f[1]):f[1];p&&(g=window.atob(g));var m=a+"."+o;if(window.navigator.msSaveOrOpenBlob){for(var v=g.length,y=new Uint8Array(v);v--;)y[v]=g.charCodeAt(v);var b=new Blob([y]);window.navigator.msSaveOrOpenBlob(b,m)}else{var x=document.createElement("iframe");document.body.appendChild(x);var w=x.contentWindow,A=w.document;A.open("image/svg+xml","replace"),A.write(g),A.close(),w.focus(),A.execCommand("SaveAs",!0,m),document.body.removeChild(x)}}else{var T=i.get("lang"),S='',O=window.open();O.document.write(S),O.document.title=a}},e.getDefaultOption=function(r){var n={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:r.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:et.color.neutral00,name:"",excludeComponents:["toolbox"],lang:r.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return n},e}(Gm),Hdt="__ec_magicType_stack__",Xzr=[["line","bar"],["stack"]],Kzr=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getIcons=function(){var r=this.model,n=r.get("icon"),i={};return de(r.get("type"),function(a){n[a]&&(i[a]=n[a])}),i},e.getDefaultOption=function(r){var n={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:r.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}};return n},e.prototype.onclick=function(r,n,i){var a=this.model,s=a.get(["seriesIndex",i]);if(Wdt[i]){var o={series:[]},l=function(d){var f=d.subType,p=d.id,g=Wdt[i](f,p,d,a);g&&(mr(g,d.option),o.series.push(g));var m=d.coordinateSystem;if(m&&m.type==="cartesian2d"&&(i==="line"||i==="bar")){var v=m.getAxesByScale("ordinal")[0];if(v){var y=v.dim,b=y+"Axis",x=d.getReferringComponents(b,ds).models[0],w=x.componentIndex;o[b]=o[b]||[];for(var A=0;A<=w;A++)o[b][w]=o[b][w]||{};o[b][w].boundaryGap=i==="bar"}}};de(Xzr,function(d){Ir(d,i)>=0&&de(d,function(f){a.setIconStatus(f,"normal")})}),a.setIconStatus(i,"emphasis"),r.eachComponent({mainType:"series",query:s==null?null:{seriesIndex:s}},l);var u,h=i;i==="stack"&&(u=Vr({stack:a.option.title.tiled,tiled:a.option.title.stack},a.option.title),a.get(["iconStatus",i])!=="emphasis"&&(h="tiled")),n.dispatchAction({type:"changeMagicType",currentType:h,newOption:o,newTitle:u,featureName:"magicType"})}},e}(Gm),Wdt={line:function(t,e,r,n){if(t==="bar")return Vr({id:e,type:"line",data:r.get("data"),stack:r.get("stack"),markPoint:r.get("markPoint"),markLine:r.get("markLine")},n.get(["option","line"])||{},!0)},bar:function(t,e,r,n){if(t==="line")return Vr({id:e,type:"bar",data:r.get("data"),stack:r.get("stack"),markPoint:r.get("markPoint"),markLine:r.get("markLine")},n.get(["option","bar"])||{},!0)},stack:function(t,e,r,n){var i=r.get("stack")===Hdt;if(t==="line"||t==="bar")return n.setIconStatus("stack",i?"normal":"emphasis"),Vr({id:e,stack:i?"":Hdt},n.get(["option","stack"])||{},!0)}};qp({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)});var nq=new Array(60).join("-"),v5=" ";function Zzr(t){var e={},r=[],n=[];return t.eachRawSeries(function(i){var a=i.coordinateSystem;if(a&&(a.type==="cartesian2d"||a.type==="polar")){var s=a.getBaseAxis();if(s.type==="category"){var o=IIr(s);e[o]||(e[o]={categoryAxis:s,valueAxis:a.getOtherAxis(s),series:[]},n.push({axisDim:s.dim,axisIndex:s.index})),e[o].series.push(i)}else r.push(i)}else r.push(i)}),{seriesGroupByCategoryAxis:e,other:r,meta:n}}function Jzr(t){var e=[];return de(t,function(r,n){var i=r.categoryAxis,a=r.valueAxis,s=a.dim,o=[" "].concat(vt(r.series,function(p){return p.name})),l=[i.model.getCategories()];de(r.series,function(p){var g=p.getRawData();l.push(p.getRawData().mapArray(g.mapDimension(s),function(m){return m}))});for(var u=[o.join(v5)],h=0;h"].join(n)}function mge(t){return{zrId:t,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function dst(t,e,r,n){return jo("svg","root",{width:t,height:e,xmlns:lst,"xmlns:xlink":cst,version:"1.1",baseProfile:"full",viewBox:n?"0 0 "+t+" "+e:!1},r)}var dMr=0;function fst(){return dMr++}var pst={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},LS="transform-origin";function fMr(t,e,r){var n=ot({},t.shape);ot(n,e),t.buildPath(r,n);var i=new ost;return i.reset(DJe(t)),r.rebuildPath(i,1),i.generateStr(),i.getStr()}function pMr(t,e){var r=e.originX,n=e.originY;(r||n)&&(t[LS]=r+"px "+n+"px")}var gMr={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function gst(t,e){var r=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[r]=t,r}function mMr(t,e,r){var n=t.shape.paths,i={},a,s;if(de(n,function(l){var u=mge(r.zrId);u.animation=!0,UW(l,{},u,!0);var h=u.cssAnims,d=u.cssNodes,f=kn(h),p=f.length;if(p){s=f[p-1];var g=h[s];for(var m in g){var v=g[m];i[m]=i[m]||{d:""},i[m].d+=v.d||""}for(var y in d){var b=d[y].animation;b.indexOf(s)>=0&&(a=b)}}}),!!a){e.d=!1;var o=gst(i,r);return a.replace(s,o)}}function mst(t){return Nt(t)?pst[t]?"cubic-bezier("+pst[t]+")":Lhe(t)?t:"":""}function UW(t,e,r,n){var i=t.animators,a=i.length,s=[];if(t instanceof QN){var o=mMr(t,e,r);if(o)s.push(o);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var Y=gst(T,r);return Y+" "+b[0]+" both"}}for(var v in l){var o=m(l[v]);o&&s.push(o)}if(s.length){var y=r.zrId+"-cls-"+fst();r.cssNodes["."+y]={animation:s.join(",")},e.class=y}}function vMr(t,e,r){if(!t.ignore)if(t.isSilent()){var n={"pointer-events":"none"};vst(n,e,r)}else{var i=t.states.emphasis&&t.states.emphasis.style?t.states.emphasis.style:{},a=i.fill;if(!a){var s=t.style&&t.style.fill,o=t.states.select&&t.states.select.style&&t.states.select.style.fill,l=t.currentStates.indexOf("select")>=0&&o||s;l&&(a=RG(l))}var u=i.lineWidth;if(u){var h=!i.strokeNoScale&&t.transform?t.transform[0]:1;u=u/h}var n={cursor:"pointer"};a&&(n.fill=a),i.stroke&&(n.stroke=i.stroke),u&&(n["stroke-width"]=u),vst(n,e,r)}}function vst(t,e,r,n){var i=JSON.stringify(t),a=r.cssStyleCache[i];a||(a=r.zrId+"-cls-"+fst(),r.cssStyleCache[i]=a,r.cssNodes["."+a+":hover"]=t),e.class=e.class?e.class+" "+a:a}var E8=Math.round;function yst(t){return t&&Nt(t.src)}function bst(t){return t&&ur(t.toDataURL)}function vge(t,e,r,n){sMr(function(i,a){var s=i==="fill"||i==="stroke";s&&RJe(a)?Cst(e,t,i,n):s&&$he(a)?Ost(r,t,i,n):t[i]=a,s&&n.ssr&&a==="none"&&(t["pointer-events"]="visible")},e,r,!1),TMr(r,t,n)}function yge(t,e){var r=ZJe(e);r&&(r.each(function(n,i){n!=null&&(t[(ust+i).toLowerCase()]=n+"")}),e.isSilent()&&(t[ust+"silent"]="true"))}function xst(t){return cx(t[0]-1)&&cx(t[1])&&cx(t[2])&&cx(t[3]-1)}function yMr(t){return cx(t[4])&&cx(t[5])}function bge(t,e,r){if(e&&!(yMr(e)&&xst(e))){var n=1e4;t.transform=xst(e)?"translate("+E8(e[4]*n)/n+" "+E8(e[5]*n)/n+")":bkr(e)}}function wst(t,e,r){for(var n=t.points,i=[],a=0;a"u"){var v="Image width/height must been given explictly in svg-ssr renderer.";ec(f,v),ec(p,v)}else if(f==null||p==null){var y=function(E,_){if(E){var I=E.elm,L=f||_.width,R=p||_.height;E.tag==="pattern"&&(u?(R=1,L/=a.width):h&&(L=1,R/=a.height)),E.attrs.width=L,E.attrs.height=R,I&&(I.setAttribute("width",L),I.setAttribute("height",R))}},b=Ade(g,null,t,function(E){l||y(S,E),y(d,E)});b&&b.width&&b.height&&(f=f||b.width,p=p||b.height)}d=jo("image","img",{href:g,width:f,height:p}),s.width=f,s.height=p}else i.svgElement&&(d=lr(i.svgElement),s.width=i.svgWidth,s.height=i.svgHeight);if(d){var x,w;l?x=w=1:u?(w=1,x=s.width/a.width):h?(x=1,w=s.height/a.height):s.patternUnits="userSpaceOnUse",x!=null&&!isNaN(x)&&(s.width=x),w!=null&&!isNaN(w)&&(s.height=w);var A=LJe(i);A&&(s.patternTransform=A);var S=jo("pattern","",s,[d]),T=gge(S),O=n.patternCache,k=O[T];k||(k=n.zrId+"-p"+n.patternIdx++,O[T]=k,s.id=k,S=n.defs[k]=jo("pattern",k,s,[d])),e[r]=MG(k)}}function CMr(t,e,r){var n=r.clipPathCache,i=r.defs,a=n[t.id];if(!a){a=r.zrId+"-c"+r.clipPathIdx++;var s={id:a};n[t.id]=a,i[a]=jo("clipPath",a,s,[Sst(t,r)])}e["clip-path"]=MG(a)}function kst(t){return document.createTextNode(t)}function MS(t,e,r){t.insertBefore(e,r)}function Est(t,e){t.removeChild(e)}function _st(t,e){t.appendChild(e)}function Rst(t){return t.parentNode}function Dst(t){return t.nextSibling}function xge(t,e){t.textContent=e}var Lst=58,OMr=120,kMr=jo("","");function wge(t){return t===void 0}function Pm(t){return t!==void 0}function EMr(t,e,r){for(var n={},i=e;i<=r;++i){var a=t[i].key;a!==void 0&&(n[a]=i)}return n}function _8(t,e){var r=t.key===e.key,n=t.tag===e.tag;return n&&r}function R8(t){var e,r=t.children,n=t.tag;if(Pm(n)){var i=t.elm=hst(n);if(Age(kMr,t),ft(r))for(e=0;ea?(g=r[l+1]==null?null:r[l+1].elm,Mst(t,g,r,i,l)):VW(t,e,n,a))}function K_(t,e){var r=e.elm=t.elm,n=t.children,i=e.children;t!==e&&(Age(t,e),wge(e.text)?Pm(n)&&Pm(i)?n!==i&&_Mr(r,n,i):Pm(i)?(Pm(t.text)&&xge(r,""),Mst(r,null,i,0,i.length-1)):Pm(n)?VW(r,n,0,n.length-1):Pm(t.text)&&xge(r,""):t.text!==e.text&&(Pm(n)&&VW(r,n,0,n.length-1),xge(r,e.text)))}function RMr(t,e){if(_8(t,e))K_(t,e);else{var r=t.elm,n=Rst(r);R8(e),n!==null&&(MS(n,e.elm,Dst(r)),VW(n,[t],0,0))}return e}var DMr=0,LMr=function(){function t(e,r,n){if(this.type="svg",this.configLayer=MMr(),this.storage=r,this._opts=n=ot({},n),this.root=e,this._id="zr"+DMr++,this._oldVNode=dst(n.width,n.height),e&&!n.ssr){var i=this._viewport=document.createElement("div");i.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=hst("svg");Age(null,this._oldVNode),i.appendChild(a),e.appendChild(i)}this.resize(n.width,n.height)}return t.prototype.getType=function(){return this.type},t.prototype.getViewportRoot=function(){return this._viewport},t.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},t.prototype.getSvgDom=function(){return this._svgDom},t.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style="position:absolute;left:0;top:0;user-select:none",RMr(this._oldVNode,e),this._oldVNode=e}},t.prototype.renderOneToVNode=function(e){return Tst(e,mge(this._id))},t.prototype.renderToVNode=function(e){e=e||{};var r=this.storage.getDisplayList(!0),n=this._width,i=this._height,a=mge(this._id);a.animation=e.animation,a.willUpdate=e.willUpdate,a.compress=e.compress,a.emphasis=e.emphasis,a.ssr=this._opts.ssr;var s=[],o=this._bgVNode=IMr(n,i,this._backgroundColor,a);o&&s.push(o);var l=e.compress?null:this._mainVNode=jo("g","main",{},[]);this._paintList(r,a,l?l.children:s),l&&s.push(l);var u=vt(kn(a.defs),function(f){return a.defs[f]});if(u.length&&s.push(jo("defs","defs",{},u)),e.animation){var h=hMr(a.cssNodes,a.cssAnims,{newline:!0});if(h){var d=jo("style","stl",{},[],h);s.push(d)}}return dst(n,i,s,e.useViewBox)},t.prototype.renderToString=function(e){return e=e||{},gge(this.renderToVNode({animation:Jt(e.cssAnimation,!0),emphasis:Jt(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:Jt(e.useViewBox,!0)}),{newline:!0})},t.prototype.setBackgroundColor=function(e){this._backgroundColor=e},t.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},t.prototype._paintList=function(e,r,n){for(var i=e.length,a=[],s=0,o,l,u=0,h=0;h=0&&!(f&&l&&f[m]===l[m]);m--);for(var v=g-1;v>m;v--)s--,o=a[s-1];for(var y=m+1;y=o)}}for(var d=Pst(this),f=d.startIdx;f=0)&&(s=!0)}),!(!s&&!a.__dirty)){var o=n._opts.useDirtyRect&&!Sge(a)?a.createRepaintRects(e,r,n._width,n._height):null,l=n._i.layerStack[0],u=!0;if(a.__dirty){u=!1,a.__dirty=!1;var h=a.zlevel===l.zl&&a.zlevel2===l.zl2?n._backgroundColor:null;a.clear(!1,h,o)}QW(a,function(d){var f=n._paintPerCursor(a,d,e,o,u);i=i&&f})}},GW),Rn.wxa&&Vc(this._i,function(a){a&&a.ctx&&a.ctx.draw&&a.ctx.draw()}),i},t.prototype._paintPerCursor=function(e,r,n,i,a){var s=e.ctx;if(i)if(!i.length)r.drawIdx=r.endIdx;else for(var o=this.dpr,l=0;l=r.endIdx},t.prototype._paintPerCursorInRect=function(e,r,n,i,a){for(var s={inHover:!1,allClipped:!1,prevEl:null,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{contentRetained:a}},o=e.ctx,l=Sge(e),u=l&&Ho.getTime(),h=r.drawIdx,d=r.notClearIdx,f=d>=0?Math.min(d,h):h;f15){f++;break}}}}N_(o,s),r.drawIdx=Math.max(f,h)},t.prototype.getLayer=function(e,r){return this._ensureLayer(e,0,r)},t.prototype._ensureLayer=function(e,r,n){r=r||0;var i=this._singleCanvas;i&&!this._needsManuallyCompositing&&(e=IS,r=0);var a=Oge(this._i,e)[r];return a||(a=$st("zr_"+e+"."+r,this,e,r),this._layerConfig[e]&&Vr(a,this._layerConfig[e],!0),(n||i&&e!==IS)&&(a.virtual=!0),this._insertLayer(a,e,r,!1),a.initContext()),a},t.prototype.insertLayer=function(e,r){this._insertLayer(r,e,0,!1)},t.prototype._insertLayer=function(e,r,n,i){var a=this._i,s=a.layers,o=a.layerStack,l=this._domRoot,u=null;if(!(s[r]&&s[r][n])&&BMr(e)){for(var h=o.length,d=0;d0&&(u=Oge(a,o[d-1].zl)[o[d-1].zl2]),o.splice(d,0,{zl:r,zl2:n}),Oge(a,r)[n]=e,!i&&!e.virtual)if(u){var f=u.dom;f.nextSibling?l.insertBefore(e.dom,f.nextSibling):l.appendChild(e.dom)}else l.firstChild?l.insertBefore(e.dom,l.firstChild):l.appendChild(e.dom);e.painter||(e.painter=this)}},t.prototype.eachLayer=function(e,r){return Vc(this._i,function(n,i){e.call(r,n,i)})},t.prototype.eachBuiltinLayer=function(e,r){return Vc(this._i,function(n,i){e.call(r,n,i)},D8)},t.prototype.eachOtherLayer=function(e,r){return Vc(this._i,function(n,i){e.call(r,n,i)},kge)},t.prototype.getLayers=function(){var e={};return Vc(this._i,function(r,n,i){e[r.id]=r}),e},t.prototype._updateLayerStatus=function(e,r){var n=this;if(n._singleCanvas)for(var i=1;i=0;x--){var w=b.get(y[x]);if(!w.used)v.__dirty=!0,b.removeKey(y[x]),y.splice(x,1);else{var A=w.endIdxNew;(Sge(v)?A=0;i--){var a=r[i];if(a.zl===e){var s=n[e][a.zl2];if(s.__builtin__)continue;if(r.splice(i,1),n[e][a.zl2]=void 0,!s.virtual){var o=s.dom.parentNode;o&&o.removeChild(s.dom)}}}},t.prototype.resize=function(e,r){if(this._domRoot.style){var n=this._domRoot;n.style.display="none";var i=this._opts,a=this.root;e!=null&&(i.width=e),r!=null&&(i.height=r),e=P_(a,0,i),r=P_(a,1,i),n.style.display="",(this._width!==e||r!==this._height)&&(n.style.width=e+"px",n.style.height=r+"px",Vc(this._i,function(s){s.resize(e,r)}),this.refresh({paintAll:!0})),this._width=e,this._height=r}else{if(e==null||r==null)return;this._width=e,this._height=r,this._ensureLayer(IS).resize(e,r)}return this},t.prototype.clearLayer=function(e){de(this._i.layers[e],function(r){r&&!r.__builtin__&&r.clear()})},t.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._i=null},t.prototype.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._i.layers[IS][0].dom;var r=new Nst("image",this,e.pixelRatio||this.dpr);r.initContext(),r.clear(!1,e.backgroundColor||this._backgroundColor);var n=r.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var i=r.dom.width,a=r.dom.height;Vc(this._i,function(d){d.__builtin__?n.drawImage(d.dom,0,0,i,a):d.renderToCanvas&&(n.save(),d.renderToCanvas(n),n.restore())})}else{for(var s={inHover:!1,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{}},o=this.storage.getDisplayList(!0),l=0,u=o.length;l-1&&(u.style.stroke=u.style.fill,u.style.fill=et.color.neutral00,u.style.lineWidth=2),n},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:6,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1,triggerEvent:!1},e}(Ri);function Z_(t,e){var r=t.mapDimensionsAll("defaultedLabel"),n=r.length;if(n===1){var i=__(t,e,r[0]);return i!=null?i+"":null}else if(n){for(var a=[],s=0;s=0&&n.push(e[a])}return n.join(" ")}var L8=function(t){rt(e,t);function e(r,n,i,a){var s=t.call(this)||this;return s.updateData(r,n,i,a),s}return e.prototype._createSymbol=function(r,n,i,a,s,o){this.removeAll();var l=$s(r,-1,-1,2,2,null,o);l.attr({z2:Jt(s,100),culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),l.drift=GMr,this._symbolType=r,this.add(l)},e.prototype.stopSymbolAnimation=function(r){this.childAt(0).stopAnimation(null,r)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){oy(this.childAt(0))},e.prototype.downplay=function(){ly(this.childAt(0))},e.prototype.setZ=function(r,n){var i=this.childAt(0);i.zlevel=r,i.z=n},e.prototype.setDraggable=function(r,n){var i=this.childAt(0);i.draggable=r,i.cursor=!n&&r?"move":i.cursor},e.prototype.updateData=function(r,n,i,a){this.silent=!1;var s=r.getItemVisual(n,"symbol")||"circle",o=r.hostModel,l=e.getSymbolSize(r,n),u=e.getSymbolZ2(r,n),h=s!==this._symbolType,d=a&&a.disableAnimation;if(h){var f=r.getItemVisual(n,"symbolKeepAspect");this._createSymbol(s,r,n,l,u,f)}else{var p=this.childAt(0);p.silent=!1;var g={scaleX:l[0]/2,scaleY:l[1]/2};d?p.attr(g):Hn(p,g,o,n),zf(p)}if(this._updateCommon(r,n,l,i,a),h){var p=this.childAt(0);if(!d){var g={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:p.style.opacity}};p.scaleX=p.scaleY=0,p.style.opacity=0,ia(p,g,o,n)}}d&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(r,n,i,a,s){var o=this.childAt(0),l=r.hostModel,u,h,d,f,p,g,m,v,y;if(a&&(u=a.emphasisItemStyle,h=a.blurItemStyle,d=a.selectItemStyle,f=a.focus,p=a.blurScope,m=a.labelStatesModels,v=a.hoverScale,y=a.cursorStyle,g=a.emphasisDisabled),!a||r.hasItemOption){var b=a&&a.itemModel?a.itemModel:r.getItemModel(n),x=b.getModel("emphasis");u=x.getModel("itemStyle").getItemStyle(),d=b.getModel(["select","itemStyle"]).getItemStyle(),h=b.getModel(["blur","itemStyle"]).getItemStyle(),f=x.get("focus"),p=x.get("blurScope"),g=x.get("disabled"),m=To(b),v=x.getShallow("scale"),y=b.getShallow("cursor")}var w=r.getItemVisual(n,"symbolRotate");o.attr("rotation",(w||0)*Math.PI/180||0);var A=xS(r.getItemVisual(n,"symbolOffset"),i);A&&(o.x=A[0],o.y=A[1]),y&&o.attr("cursor",y);var S=r.getItemVisual(n,"style"),T=S.fill;if(o instanceof Yo){var O=o.style;o.useStyle(ot({image:O.image,x:O.x,y:O.y,width:O.width,height:O.height},S))}else o.__isEmptyBrush?o.useStyle(ot({},S)):o.useStyle(S),o.style.decal=null,o.setColor(T,s&&s.symbolInnerColor),o.style.strokeNoScale=!0;var k=r.getItemVisual(n,"liftZ"),E=this._z2;k!=null?E==null&&(this._z2=o.z2,o.z2+=k):E!=null&&(o.z2=E,this._z2=null);var _=s&&s.useNameLabel;qo(o,m,{labelFetcher:l,labelDataIndex:n,defaultText:I,inheritColor:T,defaultOpacity:S.opacity});function I(D){return _?r.getName(D):Z_(r,D)}this._sizeX=i[0]/2,this._sizeY=i[1]/2;var L=o.ensureState("emphasis");L.style=u,o.ensureState("select").style=d,o.ensureState("blur").style=h;var R=v==null||v===!0?Math.max(1.1,3/this._sizeY):isFinite(v)&&v>0?+v:1;L.scaleX=this._sizeX*R,L.scaleY=this._sizeY*R,this.setSymbolScale(1),wa(this,f,p,g)},e.prototype.setSymbolScale=function(r){this.scaleX=this.scaleY=r},e.prototype.fadeOut=function(r,n,i){var a=this.childAt(0),s=Cr(this).dataIndex,o=i&&i.animation;if(this.silent=a.silent=!0,i&&i.fadeLabel){var l=a.getTextContent();l&&yx(l,{style:{opacity:0}},n,{dataIndex:s,removeOpt:o,cb:function(){a.removeTextContent()}})}else a.removeTextContent();yx(a,{style:{opacity:0},scaleX:0,scaleY:0},n,{dataIndex:s,cb:r,removeOpt:o})},e.getSymbolSize=function(r,n){return I_(r.getItemVisual(n,"symbolSize"))},e.getSymbolZ2=function(r,n){return r.getItemVisual(n,"z2")},e}(pr);function GMr(t,e){this.parent.drift(t,e)}function HW(t,e,r,n){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(n&&n.isIgnore&&n.isIgnore(r))&&!(n&&n.clipShape&&!n.clipShape.contain(e[0],e[1]))&&t.getItemVisual(r,"symbol")!=="none"}function Vst(t){return t!=null&&!yr(t)&&(t={isIgnore:t}),t||{}}function Qst(t){var e=t.hostModel,r=e.getModel("emphasis");return{emphasisItemStyle:r.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:r.get("focus"),blurScope:r.get("blurScope"),emphasisDisabled:r.get("disabled"),hoverScale:r.get("scale"),labelStatesModels:To(e),cursorStyle:e.get("cursor")}}function Gst(t,e,r,n,i,a,s){var o=new t(e,r,n,i);return o.setPosition(a),e.setItemGraphicEl(r,o),s.add(o),o}var M8=function(){function t(e){this.group=new pr,this._SymbolCtor=e||L8}return t.prototype.updateData=function(e,r){this._progressiveEls=null,r=Vst(r);var n=this.group,i=e.hostModel,a=this._data,s=this._SymbolCtor,o=r.disableAnimation,l=this._seriesScope=Qst(e),u={disableAnimation:o},h=r.getSymbolPoint||function(d){return e.getItemLayout(d)};a||n.removeAll(),e.diff(a).add(function(d){var f=h(d);HW(e,f,d,r)&&Gst(s,e,d,l,u,f,n)}).update(function(d,f){var p=a.getItemGraphicEl(f),g=h(d);if(!HW(e,g,d,r)){n.remove(p);return}var m=e.getItemVisual(d,"symbol")||"circle",v=p&&p.getSymbolType&&p.getSymbolType();if(!p||v&&v!==m)n.remove(p),p=new s(e,d,l,u),p.setPosition(g);else{p.updateData(e,d,l,u);var y={x:g[0],y:g[1]};o?p.attr(y):Hn(p,y,i)}n.add(p),e.setItemGraphicEl(d,p)}).remove(function(d){var f=a.getItemGraphicEl(d);f&&f.fadeOut(function(){n.remove(f)},i)}).execute(),this._getSymbolPoint=h,this._data=e},t.prototype.updateLayout=function(e){var r=this._data;if(r)for(var n=this,i=r.getStore(),a=0,s=i.count();a0?r=n[0]:n[1]<0&&(r=n[1]),r}function Wst(t,e,r,n){var i=NaN;t.stacked&&(i=r.get(r.getCalculationInfo("stackedOverDimension"),n)),isNaN(i)&&(i=t.valueStart);var a=t.baseDataOffset,s=[];return s[a]=r.get(t.baseDim,n),s[1-a]=i,e.dataToPoint(s)}function Yf(t,e){return!isFinite(t)||!isFinite(e)}var WMr=typeof Float32Array!==l_?Float32Array:void 0,YMr=typeof Float64Array!==l_?Float64Array:void 0;function Nm(t){return Ege({ctor:WMr},t).arr}function Ege(t,e){var r=t.arr,n=t.ctor;if(e>_N&&(e=_N),!r||t.typed&&r.length=i||m<0)break;if(Yf(y,b)){if(l){m+=a;continue}break}if(m===r)t[a>0?"moveTo":"lineTo"](y,b),d=y,f=b;else{var x=y-u,w=b-h;if(x*x+w*w<.5){m+=a;continue}if(s>0){for(var A=m+a,S=e[A*2],T=e[A*2+1];S===y&&T===b&&v=n||Yf(S,T))p=y,g=b;else{E=S-u,_=T-h;var R=y-u,D=S-y,M=b-h,P=T-b,N=void 0,F=void 0;if(o==="x"){N=Math.abs(R),F=Math.abs(D);var B=E>0?1:-1;p=y-B*N*s,g=b,I=y+B*F*s,L=b}else if(o==="y"){N=Math.abs(M),F=Math.abs(P);var V=_>0?1:-1;p=y,g=b-V*N*s,I=y,L=b+V*F*s}else N=Math.sqrt(R*R+M*M),F=Math.sqrt(D*D+P*P),k=F/(F+N),p=y-E*s*(1-k),g=b-_*s*(1-k),I=y+E*s*k,L=b+_*s*k,I=kx(I,Ex(S,y)),L=kx(L,Ex(T,b)),I=Ex(I,kx(S,y)),L=Ex(L,kx(T,b)),E=I-y,_=L-b,p=y-E*N/F,g=b-_*N/F,p=kx(p,Ex(u,y)),g=kx(g,Ex(h,b)),p=Ex(p,kx(u,y)),g=Ex(g,kx(h,b)),E=y-p,_=b-g,I=y+E*F/N,L=b+_*F/N}t.bezierCurveTo(d,f,p,g,y,b),d=I,f=L}else t.lineTo(y,b)}u=y,h=b,m+=a}return v}var Yst=function(){function t(){this.smooth=0,this.smoothConstraint=!0}return t}(),XMr=function(t){rt(e,t);function e(r){var n=t.call(this,r)||this;return n.type="ec-polyline",n}return e.prototype.getDefaultStyle=function(){return{stroke:et.color.neutral99,fill:null}},e.prototype.getDefaultShape=function(){return new Yst},e.prototype.buildPath=function(r,n){var i=n.points,a=0,s=i.length/2;if(n.connectNulls){for(;s>0&&Yf(i[s*2-2],i[s*2-1]);s--);for(;a=0){var w=u?(g-l)*x+l:(p-o)*x+o;return u?[r,w]:[w,r]}o=p,l=g;break;case s.C:p=a[d++],g=a[d++],m=a[d++],v=a[d++],y=a[d++],b=a[d++];var A=u?OG(o,p,m,y,r,h):OG(l,g,v,b,r,h);if(A>0)for(var S=0;S=0){var w=u?Wo(l,g,v,b,T):Wo(o,p,m,y,T);return u?[r,w]:[w,r]}}o=y,l=b;break}}},e}(vn),KMr=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Yst),qst=function(t){rt(e,t);function e(r){var n=t.call(this,r)||this;return n.type="ec-polygon",n}return e.prototype.getDefaultShape=function(){return new KMr},e.prototype.buildPath=function(r,n){var i=n.points,a=n.stackedOnPoints,s=0,o=i.length/2,l=n.smoothMonotone;if(n.connectNulls){for(;o>0&&Yf(i[o*2-2],i[o*2-1]);o--);for(;s=0,a=t.fill||et.color.neutral99;not(n,e);var s=n.textFill==null;return i?s&&(n.textFill=r.insideFill||et.color.neutral00,!n.textStroke&&r.insideStroke&&(n.textStroke=r.insideStroke),!n.textStroke&&(n.textStroke=a),n.textStrokeWidth==null&&(n.textStrokeWidth=2)):(s&&(n.textFill=t.fill||r.outsideFill||et.color.neutral00),!n.textStroke&&r.outsideStroke&&(n.textStroke=r.outsideStroke)),n.text=e.text,n.rich=e.rich,de(e.rich,function(o){not(o,o)}),n}function not(t,e){e&&(Kt(e,"fill")&&(t.textFill=e.fill),Kt(e,"stroke")&&(t.textStroke=e.fill),Kt(e,"lineWidth")&&(t.textStrokeWidth=e.lineWidth),Kt(e,"font")&&(t.font=e.font),Kt(e,"fontStyle")&&(t.fontStyle=e.fontStyle),Kt(e,"fontWeight")&&(t.fontWeight=e.fontWeight),Kt(e,"fontSize")&&(t.fontSize=e.fontSize),Kt(e,"fontFamily")&&(t.fontFamily=e.fontFamily),Kt(e,"align")&&(t.textAlign=e.align),Kt(e,"verticalAlign")&&(t.textVerticalAlign=e.verticalAlign),Kt(e,"lineHeight")&&(t.textLineHeight=e.lineHeight),Kt(e,"width")&&(t.textWidth=e.width),Kt(e,"height")&&(t.textHeight=e.height),Kt(e,"backgroundColor")&&(t.textBackgroundColor=e.backgroundColor),Kt(e,"padding")&&(t.textPadding=e.padding),Kt(e,"borderColor")&&(t.textBorderColor=e.borderColor),Kt(e,"borderWidth")&&(t.textBorderWidth=e.borderWidth),Kt(e,"borderRadius")&&(t.textBorderRadius=e.borderRadius),Kt(e,"shadowColor")&&(t.textBoxShadowColor=e.shadowColor),Kt(e,"shadowBlur")&&(t.textBoxShadowBlur=e.shadowBlur),Kt(e,"shadowOffsetX")&&(t.textBoxShadowOffsetX=e.shadowOffsetX),Kt(e,"shadowOffsetY")&&(t.textBoxShadowOffsetY=e.shadowOffsetY),Kt(e,"textShadowColor")&&(t.textShadowColor=e.textShadowColor),Kt(e,"textShadowBlur")&&(t.textShadowBlur=e.textShadowBlur),Kt(e,"textShadowOffsetX")&&(t.textShadowOffsetX=e.textShadowOffsetX),Kt(e,"textShadowOffsetY")&&(t.textShadowOffsetY=e.textShadowOffsetY))}function iot(t,e){if(t.length===e.length){for(var r=0;re){a?r.push(s(a,l,e)):i&&r.push(s(i,l,0),s(i,l,e));break}else i&&(r.push(s(i,l,0)),i=null),r.push(l),a=l}return r}function eIr(t,e,r){var n=t.getVisual("visualMeta");if(!(!n||!n.length||!t.count())&&e.type==="cartesian2d"){for(var i,a,s=n.length-1;s>=0;s--){var o=t.getDimensionInfo(n[s].dimension);if(i=o&&o.coordDim,i==="x"||i==="y"){a=n[s];break}}if(a){var l=e.getAxis(i),u=vt(a.stops,function(x){return{coord:l.toGlobalCoord(l.dataToCoord(x.value)),color:x.color}}),h=u.length,d=a.outerColors.slice();h&&u[0].coord>u[h-1].coord&&(u.reverse(),d.reverse());var f=JMr(u,i==="x"?r.getWidth():r.getHeight()),p=f.length;if(!p&&h)return u[0].coord<0?d[1]?d[1]:u[h-1].color:d[0]?d[0]:u[0].color;var g=10,m=f[0].coord-g,v=f[p-1].coord+g,y=v-m;if(y<.001)return"transparent";de(f,function(x){x.offset=(x.coord-m)/y}),f.push({offset:p?f[p-1].offset:.5,color:d[1]||"transparent"}),f.unshift({offset:p?f[0].offset:.5,color:d[0]||"transparent"});var b=new tS(0,0,0,0,f,!0);return b[i]=m,b[i+"2"]=v,b}}}function tIr(t,e,r){var n=t.get("showAllSymbol"),i=n==="auto";if(!(n&&!i)){var a=r.getAxesByScale("ordinal")[0];if(a&&!(i&&rIr(a,e))){var s=e.mapDimension(a.dim),o={};return de(a.getViewLabels(),function(l){l.tick.offInterval||(o[W_(a.scale,l.tick)]=1)}),function(l){return!o.hasOwnProperty(e.get(s,l))}}}}function rIr(t,e){var r=t.getExtent(),n=Math.abs(r[1]-r[0])/t.scale.count();isNaN(n)&&(n=0);for(var i=e.count(),a=Math.max(1,Math.round(i/5)),s=0;sn)return!1;return!0}function nIr(t){for(var e=t.length/2;e>0&&Yf(t[e*2-2],t[e*2-1]);e--);return e-1}function lot(t,e){return[t[e*2],t[e*2+1]]}function iIr(t,e,r){for(var n=t.length/2,i=r==="x"?0:1,a,s,o=0,l=-1,u=0;u=e||a>=e&&s<=e){l=u;break}o=u,a=s}return{range:[o,l],t:(e-a)/(s-a)}}function cot(t){if(t.get(["endLabel","show"]))return!0;for(var e=0;e0&&r.get(["emphasis","lineStyle","width"])==="bolder"){var F=g.getState("emphasis").style;F.lineWidth=+g.style.lineWidth+1}Cr(g).seriesIndex=r.seriesIndex,wa(g,M,P,N);var B=oot(r.get("smooth")),V=r.get("smoothMonotone");if(g.setShape({smooth:B,smoothMonotone:V,connectNulls:T}),m){var z=o.getCalculationInfo("stackedOnSeries"),U=0;m.useStyle(mr(u.getAreaStyle(),{fill:I,opacity:.7,lineJoin:"bevel",decal:o.getVisual("style").decal})),z&&(U=oot(z.get("smooth"))),m.setShape({smooth:B,stackedOnSmooth:U,smoothMonotone:V,connectNulls:T}),So(m,r,"areaStyle"),Cr(m).seriesIndex=r.seriesIndex,wa(m,M,P,N)}var Q=this._changePolyState;o.eachItemGraphicEl(function(q){q&&(q.onHoverStateChange=Q)}),this._polyline.onHoverStateChange=Q,this._data=o,this._coordSys=a,this._stackedOnPoints=A,this._points=h,this._step=E,this._valueOrigin=x;var G=r.get("triggerEvent"),X=r.get("triggerLineEvent"),Y=X===!0||G===!0||G==="line",le=X===!0||G===!0||G==="area";this.packEventData(r,g,Y),m&&this.packEventData(r,m,le)},e.prototype.packEventData=function(r,n,i){Cr(n).eventData=i?{componentType:"series",componentSubType:"line",componentIndex:r.componentIndex,seriesIndex:r.seriesIndex,seriesName:r.name,seriesType:"line",selfType:n===this._polygon?"area":"line"}:null},e.prototype.highlight=function(r,n,i,a){var s=r.getData(),o=FA(s,a);if(this._changePolyState("emphasis"),!(o instanceof Array)&&o!=null&&o>=0){var l=s.getLayout("points"),u=s.getItemGraphicEl(o);if(!u){var h=l[o*2],d=l[o*2+1];if(Yf(h,d)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(h,d))return;var f=r.get("zlevel")||0,p=r.get("z")||0;u=new L8(s,o),u.x=h,u.y=d,u.setZ(f,p);var g=u.getSymbolPath().getTextContent();g&&(g.zlevel=f,g.z=p,g.z2=this._polyline.z2+1),u.__temp=!0,s.setItemGraphicEl(o,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else Si.prototype.highlight.call(this,r,n,i,a)},e.prototype.downplay=function(r,n,i,a){var s=r.getData(),o=FA(s,a);if(this._changePolyState("normal"),o!=null&&o>=0){var l=s.getItemGraphicEl(o);l&&(l.__temp?(s.setItemGraphicEl(o,null),this.group.remove(l)):l.downplay())}else Si.prototype.downplay.call(this,r,n,i,a)},e.prototype._changePolyState=function(r){var n=this._polygon;yH(this._polyline,r),n&&yH(n,r)},e.prototype._newPolyline=function(r){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new XMr({shape:{points:r},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(n),this._polyline=n,n},e.prototype._newPolygon=function(r,n){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new qst({shape:{points:r,stackedOnPoints:n},segmentIgnoreThreshold:2}),this._lineGroup.add(i),this._polygon=i,i},e.prototype._initSymbolLabelAnimation=function(r,n,i){var a,s,o=n.getBaseAxis(),l=o.inverse;n.type==="cartesian2d"?(a=o.isHorizontal(),s=!1):n.type==="polar"&&(a=o.dim==="angle",s=!0);var u=r.hostModel,h=u.get("animationDuration");ur(h)&&(h=h(null));var d=u.get("animationDelay")||0,f=ur(d)?d(null):d;r.eachItemGraphicEl(function(p,g){var m=p;if(m){var v=[p.x,p.y],y=void 0,b=void 0,x=void 0;if(i)if(s){var w=i,A=n.pointToCoord(v);a?(y=w.startAngle,b=w.endAngle,x=-A[1]/180*Math.PI):(y=w.r0,b=w.r,x=A[0])}else{var S=i;a?(y=S.x,b=S.x+S.width,x=p.x):(y=S.y+S.height,b=S.y,x=p.y)}var T=b===y?0:(x-y)/(b-y);l&&(T=1-T);var O=ur(d)?d(g):h*T+f,k=m.getSymbolPath(),E=k.getTextContent();m.attr({scaleX:0,scaleY:0}),m.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:O}),E&&E.animateFrom({style:{opacity:0}},{duration:300,delay:O}),k.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(r,n,i){var a=r.getModel("endLabel");if(cot(r)){var s=r.getData(),o=this._polyline,l=s.getLayout("points");if(!l){o.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new Pn({z2:200}),u.ignoreClip=!0,o.setTextContent(this._endLabel),o.disableLabelAnimation=!0);var h=nIr(l);h>=0&&(qo(o,To(r,"endLabel"),{inheritColor:i,labelFetcher:r,labelDataIndex:h,defaultText:function(d,f,p){return p!=null?Ust(s,p):Z_(s,d)},enableTextSetter:!0},aIr(a,n)),o.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(r,n,i,a,s,o,l){var u=this._endLabel,h=this._polyline;if(u){r<1&&a.originalX==null&&(a.originalX=u.x,a.originalY=u.y);var d=i.getLayout("points"),f=i.hostModel,p=f.get("connectNulls"),g=o.get("precision"),m=o.get("distance")||0,v=l.getBaseAxis(),y=v.isHorizontal(),b=v.inverse,x=n.shape,w=b?y?x.x:x.y+x.height:y?x.x+x.width:x.y,A=(y?m:0)*(b?-1:1),S=(y?0:-m)*(b?-1:1),T=y?"x":"y",O=iIr(d,w,T),k=O.range,E=k[1]-k[0],_=void 0;if(E>=1){if(E>1&&!p){var I=lot(d,k[0]);u.attr({x:I[0]+A,y:I[1]+S}),s&&(_=f.getRawValue(k[0]))}else{var I=h.getPointOn(w,T);I&&u.attr({x:I[0]+A,y:I[1]+S});var L=f.getRawValue(k[0]),R=f.getRawValue(k[1]);s&&(_=met(i,g,L,R,O.t))}a.lastFrameIndex=k[0]}else{var D=r===1||a.lastFrameIndex>0?k[0]:0,I=lot(d,D);s&&(_=f.getRawValue(D)),u.attr({x:I[0]+A,y:I[1]+S})}if(s){var M=w_(u);typeof M.setLabelText=="function"&&M.setLabelText(_)}}},e.prototype._doUpdateAnimation=function(r,n,i,a,s,o,l){var u=this._polyline,h=this._polygon,d=r.hostModel,f=jMr(this._data,r,this._stackedOnPoints,n,this._coordSys,i,this._valueOrigin),p=f.current,g=f.stackedOnCurrent,m=f.next,v=f.stackedOnNext;if(s&&(g=_x(f.stackedOnCurrent,f.current,i,s,l),p=_x(f.current,null,i,s,l),v=_x(f.stackedOnNext,f.next,i,s,l),m=_x(f.next,null,i,s,l)),sot(p,m)>3e3||h&&sot(g,v)>3e3){u.stopAnimation(),u.setShape({points:m}),h&&(h.stopAnimation(),h.setShape({points:m,stackedOnPoints:v}));return}u.shape.__points=f.current,u.shape.points=p;var y={shape:{points:m}};f.current!==p&&(y.shape.__points=f.next),u.stopAnimation(),Hn(u,y,d),h&&(h.setShape({points:p,stackedOnPoints:g}),h.stopAnimation(),Hn(h,{shape:{stackedOnPoints:v}},d),u.shape.points!==h.shape.points&&(h.shape.points=u.shape.points));for(var b=[],x=f.status,w=0;we&&(e=t[r]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,r=0;r10&&s.type==="cartesian2d"&&a){var l=s.getBaseAxis(),u=s.getOtherAxis(l),h=l.getExtent(),d=n.getDevicePixelRatio(),f=Math.abs(h[1]-h[0])*(d||1),p=Math.round(o/f);if(isFinite(p)&&p>1){a==="lttb"?e.setData(i.lttbDownSample(i.mapDimension(u.dim),1/p)):a==="minmax"&&e.setData(i.minmaxDownSample(i.mapDimension(u.dim),1/p));var g=void 0;Nt(a)?g=oIr[a]:ur(a)&&(g=a),g&&e.setData(i.downSample(i.mapDimension(u.dim),1/p,g,lIr))}}}}}function cIr(t){t.registerChartView(sIr),t.registerSeriesModel(QMr),t.registerLayout(B8("line",!0)),t.registerVisual({seriesType:"line",reset:function(e){var r=e.getData(),n=e.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=r.getVisual("style").fill),r.setVisual("legendLineStyle",n)}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,uot("line"))}var hot=function(t){rt(e,t);function e(r,n,i,a,s){var o=t.call(this,r,n,i)||this;return o.index=0,o.type=a||"value",o.position=s||"bottom",o}return e.prototype.isHorizontal=function(){var r=this.position;return r==="top"||r==="bottom"},e.prototype.getGlobalExtent=function(r){var n=this.getExtent();return n[0]=this.toGlobalCoord(n[0]),n[1]=this.toGlobalCoord(n[1]),r&&n[0]>n[1]&&n.reverse(),n},e.prototype.pointToData=function(r,n){return this.coordToData(this.toLocalCoord(r[this.dim==="x"?0:1]),n)},e.prototype.setCategorySortInfo=function(r){if(this.type!=="category")return!1;this.model.option.categorySortInfo=r,this.scale.setSortInfo(r)},e}(Wf),Dge=null;function uIr(t){Dge||(Dge=t)}function $8(){return Dge}var WW="expandAxisBreak",dot="collapseAxisBreak",fot="toggleAxisBreak",Lge="axisbreakchanged",hIr={type:WW,event:Lge,update:"update",refineEvent:Mge},dIr={type:dot,event:Lge,update:"update",refineEvent:Mge},fIr={type:fot,event:Lge,update:"update",refineEvent:Mge};function Mge(t,e,r,n){var i=[];return de(t,function(a){i=i.concat(a.eventBreaks)}),{eventContent:{breaks:i}}}function pIr(t){t.registerAction(hIr,e),t.registerAction(dIr,e),t.registerAction(fIr,e);function e(r,n){var i=[],a=n_(n,r);function s(o,l){de(a[o],function(u){var h=u.updateAxisBreaks(r);de(h.breaks,function(d){var f;i.push(mr((f={},f[l]=u.componentIndex,f),d))})})}return s("xAxisModels","xAxisIndex"),s("yAxisModels","yAxisIndex"),s("singleAxisModels","singleAxisIndex"),{eventBreaks:i}}}var Rx=Math.PI,gIr=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],mIr=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],BS=Qr(),pot=Qr(),got=function(){function t(e){this.recordMap={},this.resolveAxisNameOverlap=e}return t.prototype.ensureRecord=function(e){var r=e.axis.dim,n=e.componentIndex,i=this.recordMap,a=i[r]||(i[r]=[]);return a[n]||(a[n]={ready:{}})},t}();function vIr(t,e,r,n){var i=r.axis,a=e.ensureRecord(r),s=[],o,l=Pge(t.axisName)&&H_(t.nameLocation);de(n,function(g){var m=Im(g);if(!(!m||m.label.ignore)){s.push(m);var v=a.transGroup;l&&(v.transform?Cd(F8,v.transform):SA(F8),m.transform&&Td(F8,F8,m.transform),fr.copy(YW,m.localRect),YW.applyTransform(F8),o?o.union(YW):fr.copy(o=new fr(0,0,0,0),YW))}});var u=Math.abs(a.dirVec.x)>.1?"x":"y",h=a.transGroup[u];if(s.sort(function(g,m){return Math.abs(g.label[u]-h)-Math.abs(m.label[u]-h)}),l&&o){var d=i.getExtent(),f=Math.min(d[0],d[1]),p=Math.max(d[0],d[1])-f;o.union(new fr(f,0,p,1))}a.stOccupiedRect=o,a.labelInfoList=s}var F8=xa(),YW=new fr(0,0,0,0),mot=function(t,e,r,n,i,a){if(H_(t.nameLocation)){var s=a.stOccupiedRect;s&&vot(qLr({},s,a.transGroup.transform),n,i)}else yot(a.labelInfoList,a.dirVec,n,i)};function vot(t,e,r){var n=new wr;$W(t,e,n,{direction:Math.atan2(r.y,r.x),bidirectional:!1,touchThreshold:.05})&&sge(e,n)}function yot(t,e,r,n){for(var i=wr.dot(n,e)>=0,a=0,s=t.length;a0?"top":"bottom",a="center"):BA(i-Rx)?(s=n>0?"bottom":"top",a="center"):(s="middle",i>0&&i0?"right":"left":a=n>0?"left":"right"),{rotation:i,textAlign:a,textVerticalAlign:s}},t.makeAxisEventDataBase=function(e){var r={componentType:e.mainType,componentIndex:e.componentIndex};return r[e.mainType+"Index"]=e.componentIndex,r},t.isLabelSilent=function(e){var r=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||r&&r.show)},t}(),yIr=["axisLine","axisTickLabelEstimate","axisTickLabelDetermine","axisName"],bIr={axisLine:function(t,e,r,n,i,a,s){var o=n.get(["axisLine","show"]);if(o==="auto"&&(o=!0,t.raw.axisLineAutoShow!=null&&(o=!!t.raw.axisLineAutoShow)),!!o){var l=n.axis.getExtent(),u=a.transform,h=[l[0],0],d=[l[1],0],f=h[0]>d[0];u&&(Ka(h,h,u),Ka(d,d,u));var p=ot({lineCap:"round"},n.getModel(["axisLine","lineStyle"]).getLineStyle()),g={strokeContainThreshold:t.raw.strokeContainThreshold||5,silent:!0,z2:1,style:p};if(n.get(["axisLine","breakLine"])&&NH(n.axis.scale))$8().buildAxisBreakLine(n,i,a,g);else{var m=new Ps(ot({shape:{x1:h[0],y1:h[1],x2:d[0],y2:d[1]}},g));b_(m.shape,m.style.lineWidth),m.anid="line",i.add(m)}var v=n.get(["axisLine","symbol"]);if(v!=null){var y=n.get(["axisLine","symbolSize"]);Nt(v)&&(v=[v,v]),(Nt(y)||zn(y))&&(y=[y,y]);var b=xS(n.get(["axisLine","symbolOffset"])||0,y),x=y[0],w=y[1];de([{rotate:t.rotation+Math.PI/2,offset:b[0],r:0},{rotate:t.rotation-Math.PI/2,offset:b[1],r:Math.sqrt((h[0]-d[0])*(h[0]-d[0])+(h[1]-d[1])*(h[1]-d[1]))}],function(A,S){if(v[S]!=="none"&&v[S]!=null){var T=$s(v[S],-x/2,-w/2,x,w,p.stroke,!0),O=A.r+A.offset,k=f?d:h;T.attr({rotation:A.rotate,x:k[0]+O*Math.cos(t.rotation),y:k[1]-O*Math.sin(t.rotation),silent:!0,z2:11}),i.add(T)}})}}},axisTickLabelEstimate:function(t,e,r,n,i,a,s,o){var l=wot(e,i,o);l&&bot(t,e,r,n,i,a,s,Xp.estimate)},axisTickLabelDetermine:function(t,e,r,n,i,a,s,o){var l=wot(e,i,o);l&&bot(t,e,r,n,i,a,s,Xp.determine);var u=SIr(t,i,a,n);AIr(t,e.labelLayoutList,u),TIr(t,i,a,n,t.tickDirection)},axisName:function(t,e,r,n,i,a,s,o){var l=r.ensureRecord(n);e.nameEl&&(i.remove(e.nameEl),e.nameEl=l.nameLayout=l.nameLocation=null);var u=t.axisName;if(Pge(u)){var h=t.nameLocation,d=t.nameDirection,f=n.getModel("nameTextStyle"),p=n.get("nameGap")||0,g=n.axis.getExtent(),m=n.axis.inverse?-1:1,v=new wr(0,0),y=new wr(0,0);h==="start"?(v.x=g[0]-m*p,y.x=-m):h==="end"?(v.x=g[1]+m*p,y.x=m):(v.x=(g[0]+g[1])/2,v.y=t.labelOffset+d*p,y.y=d);var b=xa();y.transform(Zv(b,b,t.rotation));var x=n.get("nameRotate");x!=null&&(x=x*Rx/180);var w,A;H_(h)?w=Ou.innerTextLayout(t.rotation,x??t.rotation,d):(w=xIr(t.rotation,h,x||0,g),A=t.raw.axisNameAvailableWidth,A!=null&&(A=Math.abs(A/Math.sin(w.rotation)),!isFinite(A)&&(A=null)));var S=f.getFont(),T=n.get("nameTruncate",!0)||{},O=T.ellipsis,k=Pc(t.raw.nameTruncateMaxWidth,T.maxWidth,A),E=o.nameMarginLevel||0,_=new Pn({x:v.x,y:v.y,rotation:w.rotation,silent:Ou.isLabelSilent(n),style:Gi(f,{text:u,font:S,overflow:"truncate",width:k,ellipsis:O,fill:f.getTextColor()||n.get(["axisLine","lineStyle","color"]),align:f.get("align")||w.textAlign,verticalAlign:f.get("verticalAlign")||w.textVerticalAlign}),z2:1});if(uy({el:_,componentModel:n,itemName:u}),_.__fullText=u,_.anid="name",n.get("triggerEvent")){var I=Ou.makeAxisEventDataBase(n);I.targetType="axisName",I.name=u,Cr(_).eventData=I}a.add(_),_.updateTransform(),e.nameEl=_;var L=l.nameLayout=Im({label:_,priority:_.z2,defaultAttr:{ignore:_.ignore},marginDefault:H_(h)?gIr[E]:mIr[E]});if(l.nameLocation=h,i.add(_),_.decomposeTransform(),t.shouldNameMoveOverlap&&L){var R=r.ensureRecord(n);r.resolveAxisNameOverlap(t,r,n,L,y,R)}}}};function bot(t,e,r,n,i,a,s,o){Aot(e)||CIr(t,e,i,o,n,s);var l=e.labelLayoutList;OIr(t,n,l,a),_Ir(n,t.rotation,l);var u=t.optionHideOverlap;wIr(n,l,u),u&&ist(ni(l,function(h){return h&&!h.label.ignore})),vIr(t,r,n,l)}function xIr(t,e,r,n){var i=cde(r-t),a,s,o=n[0]>n[1],l=e==="start"&&!o||e!=="start"&&o;return BA(i-Rx/2)?(s=l?"bottom":"top",a="center"):BA(i-Rx*1.5)?(s=l?"top":"bottom",a="center"):(s="middle",iRx/2?a=l?"left":"right":a=l?"right":"left"),{rotation:i,textAlign:a,textVerticalAlign:s}}function wIr(t,e,r){var n=t.axis,i=t.get(["axisLabel","customValues"]);if(IDr(n))return;function a(u,h,d){var f=Im(e[h]),p=Im(e[d]),g=n.scale;if(!(!f||!p)){if(u==null){if(!r&&i)return;var m=BS(f.label).labelInfo.tick;if(b8(g)&&m.notNice||Uc(g)&&m.offInterval){e5(f.label);return}}if(u===!1||f.suggestIgnore){e5(f.label);return}if(p.suggestIgnore){e5(p.label);return}var v=.1;if(!r){var y=[0,0,0,0];f=oge({marginForce:y},f),p=oge({marginForce:y},p)}$W(f,p,null,{touchThreshold:v})&&e5(u?p.label:f.label)}}var s=t.get(["axisLabel","showMinLabel"]),o=t.get(["axisLabel","showMaxLabel"]),l=e.length;a(s,0,1),a(o,l-1,l-2)}function AIr(t,e,r){t.showMinorTicks||de(e,function(n){if(n&&n.label.ignore)for(var i=0;i=0&&x(S,w,A.getStore())})}var p=0;if(f(function(x,w,A){n.set(w.uid,1),(!i||!i.hasKey(w.uid))&&(s=!0),p+=A.count()}),(!i||i.keys().length!==n.keys().length)&&(s=!0),!s&&a!=null){e.liPosMinGap=a;return}Ege($S,p);var g=0;f(function(x,w,A){for(var S=0,T=A.count();S0&&b0?Aat:$Dr,r.serUids=n}var $S=Ege({ctor:YMr},50);function jW(t){return function(e,r){var n=sc(e,{fromStat:{key:t}});if(Bf(n.w2))return[-n.w2/2,n.w2/2]}}function FS(t){return t+_W}function zS(t,e){return t+_W+e}function Nge(t){return PIr(),{liPosMinGap:!Uc(t.scale)}}var Bm="bar",z8="pictorialBar";function Sot(t,e,r,n){jpe(t,{key:e,seriesType:r,coordSysType:n,getMetrics:Nge})}function Tot(t){var e=t.scale.rawExtentInfo.makeRenderInfo().startValue;return e}var Cot={left:0,right:0,top:0,bottom:0},XW=["25%","25%"],Jp="cartesian2d",BIr=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.mergeDefaultAndTheme=function(r,n){var i=dS(r.outerBounds);t.prototype.mergeDefaultAndTheme.apply(this,arguments),i&&r.outerBounds&&Rm(r.outerBounds,i)},e.prototype.mergeOption=function(r,n){t.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&r.outerBounds&&Rm(this.option.outerBounds,r.outerBounds)},e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"15%",top:65,right:"10%",bottom:80,containLabel:!1,outerBoundsMode:"auto",outerBounds:Cot,outerBoundsContain:"all",outerBoundsClampWidth:XW[0],outerBoundsClampHeight:XW[1],backgroundColor:et.color.transparent,borderWidth:1,borderColor:et.color.neutral30},e}(fn),$Ir=a_(),Bge="__ec_stack_";function Oot(t){return t.get("stack")||Bge+t.seriesIndex}function FIr(t){if(Uc(t.axis.scale)){for(var e=sc(t.axis),r=[],n=0;nx&&(x=b),x!==h&&(v.width=x,r-=x+u*x,n--)}}),h=(r-l)/(n+(n-1)*u),h=en(h,0);var d=0,f;de(s,function(m){var v=o[m];v.width||(v.width=h),f=v,d+=v.width*(1+u)}),f&&(d-=f.width*u);var p={},g=-d/2;return de(s,function(m){var v=o[m];p[m]=p[m]||{bandWidth:e,offset:g,width:v.width},g+=v.width*(1+u)}),p}function Eot(t){return{seriesType:t,overallReset:function(e){var r=zS(t,Jp);Ype(e,r,function(n){var i=zIr(n,t);OS(n,r,function(a){var s=i.columnMap[Oot(a)];a.getData().setLayout({bandWidth:s.bandWidth,offset:s.offset,size:s.width})})})}}}function _ot(t){return{seriesType:t,plan:yS(),reset:function(e){if(RIr(e)){var r=e.getData(),n=e.coordinateSystem,i=n.getBaseAxis(),a=n.getOtherAxis(i),s=r.getDimensionIndex(r.mapDimension(a.dim)),o=r.getDimensionIndex(r.mapDimension(i.dim)),l=e.get("showBackground",!0),u=r.mapDimension(a.dim),h=r.getCalculationInfo("stackResultDimension"),d=py(r,u)&&!!r.getCalculationInfo("stackedOnSeries"),f=a.isHorizontal(),p=a.toGlobalCoord(a.dataToCoord(Tot(a))),g=Rot(e),m=e.get("barMinHeight")||0,v=h&&r.getDimensionIndex(h),y=r.getLayout("size"),b=r.getLayout("offset");return{progress:function(x,w){for(var A=x.count,S=g&&Nm(A*3),T=g&&l&&Nm(A*3),O=g&&Nm(A),k=n.master.getRect(),E=f?k.width:k.height,_,I=w.getStore(),L=0;(_=x.next())!=null;){var R=I.get(d?v:s,_),D=I.get(o,_),M=p,P=void 0;d&&(P=+R-I.get(s,_));var N=void 0,F=void 0,B=void 0,V=void 0;if(f){var z=n.dataToPoint([R,D]);d&&(M=n.dataToPoint([P,D])[0]),N=M,F=z[1]+b,B=z[0]-M,V=y,Za(B)v){x=(S+b)/2;break}A===1&&(w=T-g[0].tickValue)}x==null&&(b?b&&(x=g[g.length-1].coord):x=g[0].coord),o[p]=f.toGlobalCoord(x)}});else{var l=this.getData(),u=l.getLayout("offset"),h=l.getLayout("size"),d=a.getBaseAxis().isHorizontal()?0:1;o[d]+=u+h/2}return o}return[NaN,NaN]},e.prototype.__requireStartValue=function(r){return this.getBaseAxis()!==r},e.type="series.__base_bar__",e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod",defaultBarGap:"10%"},e}(Ri);Ri.registerClass(U8);var QIr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.getInitialData=function(){return Dm(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},e.prototype.getProgressive=function(){return this.get("large")?this.get("progressive"):!1},e.prototype.__preparePipelineContext=function(r,n){var i=bet(this,r,n);return i.progressiveRender&&(i.large=!0),i},e.prototype.brushSelector=function(r,n,i){return i.rect(n.getItemLayout(r))},e.type="series."+Bm,e.dependencies=["grid","polar"],e.defaultOption=xx(U8.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:et.color.primary,borderWidth:2}},realtimeSort:!1}),e}(U8),GIr=function(){function t(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return t}(),KW=function(t){rt(e,t);function e(r){var n=t.call(this,r)||this;return n.type="sausage",n}return e.prototype.getDefaultShape=function(){return new GIr},e.prototype.buildPath=function(r,n){var i=n.cx,a=n.cy,s=Math.max(n.r0||0,0),o=Math.max(n.r,0),l=(o-s)*.5,u=s+l,h=n.startAngle,d=n.endAngle,f=n.clockwise,p=Math.PI*2,g=f?d-hMath.PI/2&&ho)return!0;o=d}return!1},e.prototype._isOrderDifferentInView=function(r,n){for(var i=n.scale,a=i.getExtent(),s=Math.max(0,a[0]),o=Math.min(a[1],i.getOrdinalMeta().categories.length-1);s<=o;++s)if(r.ordinalNumbers[s]!==i.getRawOrdinalNumber(s))return!0},e.prototype._updateSortWithinSameData=function(r,n,i,a){if(this._isOrderChangedWithinSameData(r,n,i)){var s=this._dataSort(r,i,n);this._isOrderDifferentInView(s,i)&&(this._removeOnRenderedListener(a),a.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",axisId:i.index,sortInfo:s}))}},e.prototype._dispatchInitSort=function(r,n,i){var a=n.baseAxis,s=this._dataSort(r,a,function(o){return r.get(r.mapDimension(n.otherAxis.dim),o)});i.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",isInitSort:!0,axisId:a.index,sortInfo:s})},e.prototype.remove=function(r,n){this._clear(this._model),this._removeOnRenderedListener(n)},e.prototype.dispose=function(r,n){this._removeOnRenderedListener(n)},e.prototype._removeOnRenderedListener=function(r){this._onRendered&&(r.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(r){var n=this.group,i=this._data;r&&r.isAnimationEnabled()&&i&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],i.eachItemGraphicEl(function(a){cy(a,r,Cr(a).dataIndex)})):n.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type=Bm,e}(Si),Lot={cartesian2d:function(t,e){var r=e.width<0?-1:1,n=e.height<0?-1:1;r<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height);var i=t.x+t.width,a=t.y+t.height,s=$ge(e.x,t.x),o=Fge(e.x+e.width,i),l=$ge(e.y,t.y),u=Fge(e.y+e.height,a),h=oi?o:s,e.y=d&&l>a?u:l,e.width=h?0:o-s,e.height=d?0:u-l,r<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height),h||d},polar:function(t,e){var r=e.r0<=e.r?1:-1;if(r<0){var n=e.r;e.r=e.r0,e.r0=n}var i=Fge(e.r,t.r),a=$ge(e.r0,t.r0);e.r=i,e.r0=a;var s=i-a<0;if(r<0){var n=e.r;e.r=e.r0,e.r0=n}return s}},Mot={cartesian2d:function(t,e,r,n,i,a,s,o,l){var u=new tn({shape:ot({},n),z2:1});if(u.__dataIndex=r,u.name="item",a){var h=u.shape,d=i?"height":"width";h[d]=0}return u},polar:function(t,e,r,n,i,a,s,o,l){var u=!i&&l?KW:nc,h=new u({shape:n,z2:1});h.name="item";var d=Bot(i);if(h.calculateTextPosition=HIr(d,{isRoundCap:u===KW}),a){var f=h.shape,p=i?"r":"endAngle",g={};f[p]=i?n.r0:n.startAngle,g[p]=n[p],(o?Hn:ia)(h,{shape:g},a)}return h}};function qIr(t,e){var r=t.get("realtimeSort",!0),n=e.getBaseAxis();if(r&&n.type==="category"&&e.type==="cartesian2d")return{baseAxis:n,otherAxis:e.getOtherAxis(n)}}function Iot(t,e,r,n,i,a,s,o){var l,u;a?(u={x:n.x,width:n.width},l={y:n.y,height:n.height}):(u={y:n.y,height:n.height},l={x:n.x,width:n.width}),o||(s?Hn:ia)(r,{shape:l},e,i,null);var h=e?t.baseAxis.model:null;(s?Hn:ia)(r,{shape:u},h,i)}function Pot(t,e){for(var r=0;r0?1:-1,s=n.height>0?1:-1;return{x:n.x+a*i/2,y:n.y+s*i/2,width:n.width-a*i,height:n.height-s*i}},polar:function(t,e,r){var n=t.getItemLayout(e);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}}};function KIr(t){return t.startAngle!=null&&t.endAngle!=null&&t.startAngle===t.endAngle}function Bot(t){return function(e){var r=e?"Arc":"Angle";return function(n){switch(n){case"start":case"insideStart":case"end":case"insideEnd":return n+r;default:return n}}}(t)}function $ot(t,e,r,n,i,a,s,o){var l=e.getItemVisual(r,"style");if(o){if(!a.get("roundCap")){var h=t.shape,d=$m(n.getModel("itemStyle"),h,!0);ot(h,d),t.setShape(h)}}else{var u=n.get(["itemStyle","borderRadius"])||0;t.setShape("r",u)}t.useStyle(l);var f=n.getShallow("cursor");f&&t.attr("cursor",f);var p=o?s?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":s?rPr(i,a.coordinateSystem):nPr(i,a.coordinateSystem),g=To(n);qo(t,g,{labelFetcher:a,labelDataIndex:r,defaultText:Z_(a.getData(),r),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:p});var m=t.getTextContent();if(o&&m){var v=n.get(["label","position"]);t.textConfig.inside=v==="middle"?!0:null,WIr(t,v==="outside"?p:v,Bot(s),n.get(["label","rotate"]))}trt(m,g,a.getRawValue(r),function(b){return Ust(e,b)});var y=n.getModel(["emphasis"]);wa(t,y.get("focus"),y.get("blurScope"),y.get("disabled")),So(t,n),KIr(i)&&(t.style.fill="none",t.style.stroke="none",de(t.states,function(b){b.style&&(b.style.fill=b.style.stroke="none")}))}function ZIr(t,e){var r=t.get(["itemStyle","borderColor"]);if(!r||r==="none")return 0;var n=t.get(["itemStyle","borderWidth"])||0,i=isNaN(e.width)?Number.MAX_VALUE:Math.abs(e.width),a=isNaN(e.height)?Number.MAX_VALUE:Math.abs(e.height);return Math.min(n,i,a)}var JIr=function(){function t(){}return t}(),Fot=function(t){rt(e,t);function e(r){var n=t.call(this,r)||this;return n.type="largeBar",n}return e.prototype.getDefaultShape=function(){return new JIr},e.prototype.buildPath=function(r,n){for(var i=n.points,a=this.baseDimIdx,s=1-this.baseDimIdx,o=[],l=[],u=this.barWidth,h=0;h=0?r:null},30,!1);function ePr(t,e,r){for(var n=t.baseDimIdx,i=1-n,a=t.shape.points,s=t.largeDataIndices,o=[],l=[],u=t.barWidth,h=0,d=a.length/3;h=o[0]&&e<=o[0]+l[0]&&r>=o[1]&&r<=o[1]+l[1])return s[h]}return-1}function Vot(t,e,r){if(NS(r,"cartesian2d")){var n=e,i=r.getArea();return{x:t?n.x:i.x,y:t?i.y:n.y,width:t?n.width:i.width,height:t?i.height:n.height}}else{var i=r.getArea(),a=e;return{cx:i.cx,cy:i.cy,r0:t?i.r0:a.r0,r:t?i.r:a.r,startAngle:t?a.startAngle:0,endAngle:t?a.endAngle:Math.PI*2}}}function tPr(t,e,r){var n=t.type==="polar"?nc:tn;return new n({shape:Vot(e,r,t),silent:!0,z2:0})}function rPr(t,e){if(t.height===0){var r=e.getOtherAxis(e.getBaseAxis());return r.inverse?"bottom":"top"}return t.height>0?"bottom":"top"}function nPr(t,e){if(t.width===0){var r=e.getOtherAxis(e.getBaseAxis());return r.inverse?"left":"right"}return t.width>=0?"right":"left"}function iPr(t){t.registerChartView(YIr),t.registerSeriesModel(QIr),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,Eot(Bm)),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,_ot(Bm)),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,uot(Bm)),t.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(e,r){var n=e.componentType||"series";r.eachComponent({mainType:n,query:e},function(i){e.sortInfo&&i.axis.setCategorySortInfo(e.sortInfo)})}),Dot(t)}function V8(t){return{seriesType:t,reset:function(e,r){var n=r.findComponents({mainType:"legend"});if(!(!n||!n.length)){var i=e.getData();i.filterSelf(function(a){for(var s=i.getName(a),o=0;o=0},t.prototype.indexOfName=function(e){var r=this._getDataWithEncodedVisual();return r.indexOfName(e)},t.prototype.getItemVisual=function(e,r){var n=this._getDataWithEncodedVisual();return n.getItemVisual(e,r)},t}(),Dx="pie",aPr=Qr(),Qot=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new r5(Ht(this.getData,this),Ht(this.getRawData,this)),this._defaultLabelLine(r)},e.prototype.mergeOption=function(){t.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return t5(this,{coordDimensions:["value"],encodeDefaulter:qr(Ffe,this)})},e.prototype.getDataParams=function(r){var n=this.getData(),i=aPr(n),a=i.seats;if(!a){var s=[];n.each(n.mapDimension("value"),function(l){s.push(l)}),a=i.seats=net(s,n.hostModel.get("percentPrecision"))}var o=t.prototype.getDataParams.call(this,r);return o.percent=a[r]||0,o.$vars.push("percent"),o},e.prototype._defaultLabelLine=function(r){$A(r,"labelLine",["show"]);var n=r.labelLine,i=r.emphasis.labelLine;n.show=n.show&&r.label.show,i.show=i.show&&r.emphasis.label.show},e.type="series."+Dx,e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"50%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,coordinateSystemUsage:"box",left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:30,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}(Ri);e4r({fullType:Qot.type,getCoord2:function(t){return t.getShallow("center")}});var sPr=Math.PI/180;function Got(t,e,r,n,i,a,s,o,l,u){if(t.length<2)return;function h(m){for(var v=m.rB,y=v*v,b=0;br?y:v,A=Math.abs(x.label.y-r);if(A>=w.maxY){var S=x.label.x-e-x.len2*i,T=n+x.len,O=Math.abs(S)t.unconstrainedWidth?null:f:null;n.setStyle("width",p)}Wot(a,n)}}}function Wot(t,e){Yot.rect=t,rst(Yot,e,lPr)}var lPr={minMarginForce:[null,0,null,0],marginDefault:[1,0,1,0]},Yot={};function zge(t){return t.position==="center"}function cPr(t){var e=t.getData(),r=[],n,i,a=!1,s=(t.get("minShowLabelAngle")||0)*sPr,o=e.getLayout("viewRect"),l=e.getLayout("r"),u=o.width,h=o.x,d=o.y,f=o.height;function p(S){S.ignore=!0}function g(S){if(!S.ignore)return!0;for(var T in S.states)if(S.states[T].ignore===!1)return!0;return!1}e.each(function(S){var T=e.getItemGraphicEl(S),O=T.shape,k=T.getTextContent(),E=T.getTextGuideLine(),_=e.getItemModel(S),I=_.getModel("label"),L=I.get("position")||_.get(["emphasis","label","position"]),R=I.get("distanceToLabelLine"),D=I.get("alignTo"),M=Qt(I.get("edgeDistance"),u),P=I.get("bleedMargin");P==null&&(P=Math.min(u,f)>200?10:2);var N=_.getModel("labelLine"),F=N.get("length");F=Qt(F,u);var B=N.get("length2");if(B=Qt(B,u),Math.abs(O.endAngle-O.startAngle)0?"right":"left":z>0?"left":"right"}var Ce=Math.PI,Oe=0,$e=I.get("rotate");if(zn($e))Oe=$e*(Ce/180);else if(L==="center")Oe=0;else if($e==="radial"||$e===!0){var he=z<0?-V+Ce:-V;Oe=he}else if($e==="tangential"||$e==="tangential-noflip"&&L!=="outside"&&L!=="outer"){var fe=Math.atan2(z,U);fe<0&&(fe=Ce*2+fe);var Se=U>0;Se&&$e!=="tangential-noflip"&&(fe=Ce+fe),Oe=fe-Ce}if(a=!!Oe,k.x=Q,k.y=G,k.rotation=Oe,k.setStyle({verticalAlign:"middle"}),le){k.setStyle({align:Y});var Qe=k.states.select;Qe&&(Qe.x+=k.x,Qe.y+=k.y)}else{var ge=new fr(0,0,0,0);Wot(ge,k),r.push({label:k,labelLine:E,position:L,len:F,len2:B,minTurnAngle:N.get("minTurnAngle"),maxSurfaceAngle:N.get("maxSurfaceAngle"),surfaceNormal:new wr(z,U),linePoints:X,textAlign:Y,labelDistance:R,labelAlignTo:D,edgeDistance:M,bleedMargin:P,rect:ge,unconstrainedWidth:ge.width,labelStyleWidth:k.style.width})}T.setTextConfig({inside:le})}}),!a&&t.get("avoidLabelOverlap")&&oPr(r,n,i,l,u,f,h,d);for(var m=0;mN?(B=R+T*N/2,V=B):(B=R+k,V=F-k),n.setItemLayout(P,{angle:N,startAngle:B,endAngle:V,clockwise:x,cx:s,cy:o,r0:u,r:w?jn(M,S,[u,l]):l}),R=F}),I0){for(var h=s.getItemLayout(0),d=1;isNaN(h&&h.startAngle)&&d=a.r0}},e.type=Dx,e}(Si);function pPr(t){return{seriesType:t,reset:function(e,r){var n=e.getData();n.filterSelf(function(i){var a=n.mapDimension("value"),s=n.get(a,i);return!(zn(s)&&!isNaN(s)&&s<0)})}}}function gPr(t){t.registerChartView(fPr),t.registerSeriesModel(Qot),eit(Dx,t.registerAction),t.registerLayout(uPr),t.registerProcessor(V8(Dx)),t.registerProcessor(pPr(Dx))}var mPr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.hasSymbolVisual=!0,r}return e.prototype.getInitialData=function(r,n){return Dm(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var r=this.option.progressive;return r??(this.option.large?5e3:this.get("progressive"))},e.prototype.getProgressiveThreshold=function(){var r=this.option.progressiveThreshold;return r??(this.option.large?1e4:this.get("progressiveThreshold"))},e.prototype.brushSelector=function(r,n,i){return i.point(n.getItemLayout(r))},e.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},e.type="series.scatter",e.dependencies=["grid","polar","geo","singleAxis","calendar","matrix"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:et.color.primary}},universalTransition:{divideShape:"clone"}},e}(Ri),Xot=4,vPr=function(){function t(){}return t}(),yPr=function(t){rt(e,t);function e(r){var n=t.call(this,r)||this;return n._off=0,n.hoverDataIdx=-1,n}return e.prototype.getDefaultShape=function(){return new vPr},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.beforeBrush=function(r){r&&!r.contentRetained&&this.reset()},e.prototype.buildPath=function(r,n){var i=n.points,a=n.size,s=this.symbolProxy,o=s.shape,l=r.getContext?r.getContext():r,u=l&&a[0]=0;u--){var h=u*2,d=a[h]-o/2,f=a[h+1]-l/2;if(r>=d&&n>=f&&r<=d+o&&n<=f+l)return u}return-1},e.prototype.contain=function(r,n){var i=this.transformCoordToLocal(r,n),a=this.getBoundingRect();if(r=i[0],n=i[1],a.contain(r,n)){var s=this.hoverDataIdx=this.findDataIndex(r,n);return s>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var r=this._rect;if(!r){for(var n=this.shape,i=n.points,a=n.size,s=a[0],o=a[1],l=1/0,u=1/0,h=-1/0,d=-1/0,f=0;f=0&&(u.dataIndex=d+(e.startIndex||0))})},t.prototype.remove=function(){this._clear()},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}(),xPr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){var a=r.getData(),s=this._updateSymbolDraw(a,r);s.updateData(a,Uge(r)),this._finished=!0},e.prototype.incrementalPrepareRender=function(r,n,i){var a=r.getData(),s=this._updateSymbolDraw(a,r);s.incrementalPrepareUpdate(a),this._finished=!1},e.prototype.incrementalRender=function(r,n,i){this._symbolDraw.incrementalUpdate(r,n.getData(),xm(n),Uge(n)),this._finished=r.end===n.getData().count()},e.prototype.updateTransform=function(r,n,i){var a=r.getData();if(this.group.dirty(),this._finished){var s=B8("").reset(r,n,i);s.progress&&s.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout(Uge(r))}else return{update:!0}},e.prototype.eachRendered=function(r){this._symbolDraw&&this._symbolDraw.eachRendered(r)},e.prototype._updateSymbolDraw=function(r,n){var i=this._symbolDraw,a=n.pipelineContext,s=a.large;return(!i||s!==this._isLargeDraw)&&(i&&i.remove(),i=this._symbolDraw=s?new bPr:new M8,this._isLargeDraw=s,this.group.removeAll()),this.group.add(i.group),i},e.prototype.remove=function(r,n){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(Si);function Uge(t){return{clipShape:Kst(t)}}var Vge=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",ds).models[0]},e.type="cartesian2dAxis",e}(fn);Is(Vge,Y_);var Kot={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:"auto",onZeroAxisIndex:null,lineStyle:{color:et.color.axisLine,width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15],breakLine:!0},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12,color:et.color.axisLabel,textMargin:[0,3]},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:et.color.axisSplitLine,width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:[et.color.backgroundTint,et.color.backgroundTransparent]}},breakArea:{show:!0,itemStyle:{color:et.color.neutral00,borderColor:et.color.border,borderWidth:1,borderType:[3,3],opacity:.6},zigzagAmplitude:4,zigzagMinSpan:4,zigzagMaxSpan:20,zigzagZ:100,expandOnClick:!0},breakLabelLayout:{moveOverlap:"auto"}},wPr=Vr({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto",show:"auto"},axisLabel:{interval:"auto"}},Kot),Qge=Vr({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:et.color.axisMinorSplitLine,width:1}}},Kot),APr=Vr({splitNumber:6,axisLabel:{rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},Qge),SPr=mr({logBase:10},Qge);const Zot={category:wPr,value:Qge,time:APr,log:SPr};function n5(t,e,r,n){de(yat,function(i,a){var s=Vr(Vr({},Zot[a],!0),n,!0),o=function(l){rt(u,l);function u(){var h=l!==null&&l.apply(this,arguments)||this;return h.type=e+"Axis."+a,h}return u.prototype.mergeDefaultAndTheme=function(h,d){var f=e8(this),p=f?dS(h):{},g=d.getTheme();Vr(h,g.get(a+"Axis")),Vr(h,this.getDefaultOption()),h.type=Jot(h),f&&Rm(h,p,f)},u.prototype.optionUpdated=function(){var h=this.option;h.type==="category"&&(this.__ordinalMeta=m8.createByAxisModel(this))},u.prototype.getCategories=function(h){var d=this.option;if(d.type==="category")return h?d.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.prototype.updateAxisBreaks=function(h){var d=$8();return d?d.updateModelAxisBreak(this,h):{breaks:[]}},u.type=e+"Axis."+a,u.defaultOption=s,u}(r);t.registerComponentModel(o)}),t.registerSubTypeDefaulter(e+"Axis",Jot)}function Jot(t){return t.type||(t.data?"category":"value")}var TPr=function(){function t(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return t.prototype.getAxis=function(e){return this._axes[e]},t.prototype.getAxes=function(){return vt(this._dimList,function(e){return this._axes[e]},this)},t.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),ni(this.getAxes(),function(r){return r.scale.type===e})},t.prototype.addAxis=function(e){var r=e.dim;this._axes[r]=e,this._dimList.push(r)},t}(),rY=["x","y"];function elt(t){return(t.type==="interval"||t.type==="time")&&!NH(t)}var CPr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=Jp,r.dimensions=rY,r}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!elt(r)||!elt(n))){var i=xW(r,null),a=xW(n,null),s=this.dataToPoint([i[0],a[0]]),o=this.dataToPoint([i[1],a[1]]),l=i[1]-i[0],u=a[1]-a[0];if(!(!l||!u)){var h=(o[0]-s[0])/l,d=(o[1]-s[1])/u,f=s[0]-i[0]*h,p=s[1]-a[0]*d,g=this._transform=[h,0,0,d,f,p];this._invTransform=Cd([],g)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(r){var n=this.getAxis("x"),i=this.getAxis("y");return n.contain(n.toLocalCoord(r[0]))&&i.contain(i.toLocalCoord(r[1]))},e.prototype.containData=function(r){return this.getAxis("x").containData(r[0])&&this.getAxis("y").containData(r[1])},e.prototype.containZone=function(r,n){var i=this.dataToPoint(r),a=this.dataToPoint(n),s=this.getArea(),o=new fr(i[0],i[1],a[0]-i[0],a[1]-i[1]);return s.intersect(o)},e.prototype.dataToPoint=function(r,n,i){i=i||[];var a=r[0],s=r[1];if(this._transform&&a!=null&&isFinite(a)&&s!=null&&isFinite(s))return Ka(i,r,this._transform);var o=this.getAxis("x"),l=this.getAxis("y");return i[0]=o.toGlobalCoord(o.dataToCoord(a,n)),i[1]=l.toGlobalCoord(l.dataToCoord(s,n)),i},e.prototype.clampData=function(r,n){var i=this.getAxis("x").scale,a=this.getAxis("y").scale,s=i.getExtent(),o=a.getExtent(),l=i.parse(r[0]),u=a.parse(r[1]);return n=n||[],n[0]=Math.min(Math.max(Math.min(s[0],s[1]),l),Math.max(s[0],s[1])),n[1]=Math.min(Math.max(Math.min(o[0],o[1]),u),Math.max(o[0],o[1])),n},e.prototype.pointToData=function(r,n,i){if(i=i||[],this._invTransform)return Ka(i,r,this._invTransform);var a=this.getAxis("x"),s=this.getAxis("y");return i[0]=a.coordToData(a.toLocalCoord(r[0]),n),i[1]=s.coordToData(s.toLocalCoord(r[1]),n),i},e.prototype.getOtherAxis=function(r){return this.getAxis(r.dim==="x"?"y":"x")},e.prototype.getArea=function(r){r=r||0;var n=this.getAxis("x").getGlobalExtent(),i=this.getAxis("y").getGlobalExtent(),a=Math.min(n[0],n[1])-r,s=Math.min(i[0],i[1])-r,o=Math.max(n[0],n[1])-a+r,l=Math.max(i[0],i[1])-s+r;return new fr(a,s,o,l)},e}(TPr);function tlt(t,e){var r=t.scale,n=t.model,i=Lat(r,n,n.ecModel,t,null),a=Q_(r),s=Q_(e)?e.intervalStub:e,o=a?r.intervalStub:r,l=r.base,u=s.getTicks(),h=s.getTicks({expandToNicedExtent:!0}),d=u.length-1,f,p,g;if(d===1)f=p=0,g=1;else if(d===2){var m=Za(u[0].value-u[1].value),v=Za(u[1].value-u[2].value);f=p=0,m===v?g=2:(g=1,m=T[1])return!0})):w[1]?(k=T[1],R(function(){if(N(),L=Gn(I-E*g,_),D(),O<=T[0])return!0})):R(function(){L=Gn(MA(T[0]/E)*E,_),I=Gn(Nf(T[1]/E)*E,_);var z=mm((I-L)/E);if(z<=g){var U=g-z,Q=void 0,G=i.incl0||a;if(G&&T[0]===0)Q=[0,U];else if(G&&T[1]===0)Q=[U,0];else{var X=Nf(U/2);Q=U%2===0?[X,X]:O+k=T[1])return!0}})}wat(r,w,S,[O,k],A,{interval:E,intervalCount:g,intervalPrecision:_,niceExtent:[L,I]})}var rlt=[[3,1],[0,2]],OPr=function(){function t(e,r,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=rY,this._initCartesian(e,r,n),this.model=e}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(e,r){var n=this._axesMap;de(this._axesList,function(s){ES(s,j_);var o=s.scale;Uc(o)&&o.setSortInfo(s.model.get("categorySortInfo"))});function i(s){for(var o=kn(s),l=[],u=o.length-1;u>=0;u--){var h=s[+o[u]];h.__alignTo?l.push(h):X_(h)}de(l,function(d){EPr(d,d.__alignTo)?X_(d):tlt(d,d.__alignTo.scale)})}i(n.x),i(n.y);var a={};de(n.x,function(s){nlt(n,"y",s,a)}),de(n.y,function(s){nlt(n,"x",s,a)}),this.resize(this.model,r)},t.prototype.resize=function(e,r,n){var i=Co(e,r),a=this._rect=da(e.getBoxLayoutParams(),i.refContainer),s=this._axesMap,o=this._coordsList,l=e.get("containLabel");if(Gge(s,a),!n){var u=DPr(a,o,s,l,r),h=void 0;if(l)Hge?(Hge(this._axesList,a),Gge(s,a)):h=olt(a.clone(),"axisLabel",null,a,s,u,i);else{var d=LPr(e,a,i),f=d.outerBoundsRect,p=d.parsedOuterBoundsContain,g=d.outerBoundsClamp;f&&(h=olt(f,p,g,a,s,u,i))}llt(a,s,Xp.determine,null,h,i),de(this._coordsList,function(m){m.calcAffineTransform()})}},t.prototype.getAxis=function(e,r){var n=this._axesMap[e];if(n!=null)return n[r||0]},t.prototype.getAxes=function(){return this._axesList.slice()},t.prototype.getCartesian=function(e,r){if(e!=null&&r!=null){var n="x"+e+"y"+r;return this._coordsMap[n]}yr(e)&&(r=e.yAxisIndex,e=e.xAxisIndex);for(var i=0,a=this._coordsList;i=0;i--){var a=t[+e[i]];lat(a.scale)&&xat(a.model,a.type,!0)==null&&(a.model.get("alignTicks")&&a.model.get("interval")==null?n.push(a):r=a)}r||(r=n.pop()),r&&de(n,function(s){s.__alignTo=r})}function EPr(t,e){return NH(t.scale)||NH(e.scale)||e.scale.getTicks().length<2}function _Pr(t,e){var r=t.getExtent(),n=r[0]+r[1];t.toGlobalCoord=t.dim==="x"?function(i){return i+e}:function(i){return n-i+e},t.toLocalCoord=t.dim==="x"?function(i){return i-e}:function(i){return n-i+e}}function Gge(t,e){de(t.x,function(r){return slt(r,e.x,e.width)}),de(t.y,function(r){return slt(r,e.y,e.height)})}function slt(t,e,r){var n=[0,r],i=t.inverse?1:0;t.setExtent(n[i],n[1-i]),_Pr(t,e)}var Hge;function RPr(t){Hge=t}function olt(t,e,r,n,i,a,s){llt(n,i,Xp.estimate,e,!1,s);var o=[0,0,0,0];u(0),u(1),h(n,0,NaN),h(n,1,NaN);var l=Wv(o,function(f){return f>0})==null;return aS(n,o,!0,!0,r),Gge(i,n),l;function u(f){de(i[Mr[f]],function(p){if(S8(p.model)){var g=a.ensureRecord(p.model),m=g.labelInfoList;if(m)for(var v=0;v0&&!Jl(p)&&p>1e-4&&(f/=p),f}}function DPr(t,e,r,n,i){var a=new got(MPr);return de(r,function(s){return de(s,function(o){if(S8(o.model)){var l=!n;o.axisBuilder=LIr(t,e,o.model,i,a,l)}})}),a}function llt(t,e,r,n,i,a){var s=r===Xp.determine;de(e,function(u){return de(u,function(h){S8(h.model)&&(MIr(h.axisBuilder,t,h.model),h.axisBuilder.build(s?{axisTickLabelDetermine:!0}:{axisTickLabelEstimate:!0},{noPxChange:i}))})});var o={x:0,y:0};l(0),l(1);function l(u){o[Mr[1-u]]=t[xs[u]]<=a.refContainer[xs[u]]*.5?0:1-u===1?2:1}de(e,function(u,h){return de(u,function(d){S8(d.model)&&((n==="all"||s)&&d.axisBuilder.build({axisName:!0},{nameMarginLevel:o[h]}),s&&d.axisBuilder.build({axisLine:!0}))})})}function LPr(t,e,r){var n,i=t.get("outerBoundsMode",!0);i==="same"?n=e.clone():(i==null||i==="auto")&&(n=da(t.get("outerBounds",!0)||Cot,r.refContainer));var a=t.get("outerBoundsContain",!0),s;a==null||a==="auto"||Ir(["all","axisLabel"],a)<0?s="all":s=a;var o=[KG(Jt(t.get("outerBoundsClampWidth",!0),XW[0]),e.width),KG(Jt(t.get("outerBoundsClampHeight",!0),XW[1]),e.height)];return{outerBoundsRect:n,parsedOuterBoundsContain:s,outerBoundsClamp:o}}var MPr=function(t,e,r,n,i,a){var s=r.axis.dim==="x"?"y":"x";mot(t,e,r,n,i,a),H_(t.nameLocation)||de(e.recordMap[s],function(o){o&&o.labelInfoList&&o.dirVec&&yot(o.labelInfoList,o.dirVec,n,i)})};function IPr(t,e){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return PPr(r,t,e),r.seriesInvolved&&BPr(r,t),r}function PPr(t,e,r){var n=e.getComponent("tooltip"),i=e.getComponent("axisPointer"),a=i.get("link",!0)||[],s=[];de(r.getCoordinateSystems(),function(o){if(!o.axisPointerEnabled)return;var l=Q8(o.model),u=t.coordSysAxesInfo[l]={};t.coordSysMap[l]=o;var h=o.model,d=h.getModel("tooltip",n);if(de(o.getAxes(),qr(m,!1,null)),o.getTooltipAxes&&n&&d.get("show")){var f=d.get("trigger")==="axis",p=d.get(["axisPointer","type"])==="cross",g=o.getTooltipAxes(d.get(["axisPointer","axis"]));(f||p)&&de(g.baseAxes,qr(m,p?"cross":!0,f)),p&&de(g.otherAxes,qr(m,"cross",!1))}function m(v,y,b){var x=b.model.getModel("axisPointer",i),w=x.get("show");if(!(!w||w==="auto"&&!v&&!qge(x))){y==null&&(y=x.get("triggerTooltip")),x=v?NPr(b,d,i,e,v,y):x;var A=x.get("snap"),S=x.get("triggerEmphasis"),T=Q8(b.model),O=y||A||b.type==="category",k=t.axesInfo[T]={key:T,axis:b,coordSys:o,axisPointerModel:x,triggerTooltip:y,triggerEmphasis:S,involveSeries:O,snap:A,useHandle:qge(x),seriesModels:[],linkGroup:null};u[T]=k,t.seriesInvolved=t.seriesInvolved||O;var E=$Pr(a,b);if(E!=null){var _=s[E]||(s[E]={axesInfo:{}});_.axesInfo[T]=k,_.mapper=a[E].mapper,k.linkGroup=_}}}})}function NPr(t,e,r,n,i,a){var s=e.getModel("axisPointer"),o=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};de(o,function(f){l[f]=lr(s.get(f))}),l.snap=t.type!=="category"&&!!a,s.get("type")==="cross"&&(l.type="line");var u=l.label||(l.label={});if(u.show==null&&(u.show=!1),i==="cross"){var h=s.get(["label","show"]);if(u.show=h??!0,!a){var d=l.lineStyle=s.get("crossStyle");d&&mr(u,d.textStyle)}}return t.model.getModel("axisPointer",new yn(l,r,n))}function BPr(t,e){e.eachSeries(function(r){var n=r.coordinateSystem,i=r.get(["tooltip","trigger"],!0),a=r.get(["tooltip","show"],!0);!n||!n.model||i==="none"||i===!1||i==="item"||a===!1||r.get(["axisPointer","show"],!0)===!1||de(t.coordSysAxesInfo[Q8(n.model)],function(s){var o=s.axis;n.getAxis(o.dim)===o&&(s.seriesModels.push(r),s.seriesDataCount==null&&(s.seriesDataCount=0),s.seriesDataCount+=r.getData().count())})})}function $Pr(t,e){for(var r=e.model,n=e.dim,i=0;i=0||t===e}function FPr(t){var e=Yge(t);if(e){var r=e.axisPointerModel,n=e.axis.scale,i=r.option,a=r.get("status"),s=r.get("value");s!=null&&(s=n.parse(s));var o=qge(r);a==null&&(i.status=o?"show":"hide");var l=n.getExtent();(s==null||s>l[1])&&(s=l[1]),s0;return s&&o}var YPr=Qr();function mlt(t,e,r,n){if(t instanceof hot){var i=t.scale.type;if(i!=="ordinal")return r}var a=t.model,s=a.get("jitter");if(!(s>0))return r;var o=a.get("jitterOverlap"),l=a.get("jitterMargin")||0,u=Uc(t.scale)?sc(t).w:null;return o?vlt(r,s,u,n):qPr(t,e,r,n,s,l)}function vlt(t,e,r,n){if(r===null)return t+(Math.random()-.5)*e;var i=r-n*2,a=Math.min(Math.max(0,e),i);return t+(Math.random()-.5)*a}function qPr(t,e,r,n,i,a){var s=YPr(t);s.items||(s.items=[]);var o=s.items,l=ylt(o,e,r,n,i,a,1),u=ylt(o,e,r,n,i,a,-1),h=Math.abs(l-r)i/2||d&&f>d/2-n?vlt(r,i,d,n):(o.push({fixedCoord:e,floatCoord:h,r:n}),h)}function ylt(t,e,r,n,i,a,s){for(var o=r,l=0;li/2)return Number.MAX_VALUE;if(s===1&&g>o||s===-1&&g0&&!m.min?m.min=0:m.min!=null&&m.min<0&&!m.max&&(m.max=0);var v=u;m.color!=null&&(v=mr({color:m.color},u));var y=Vr(lr(m),{boundaryGap:r,splitNumber:n,clockwise:i,scale:a,axisLine:s,axisTick:o,axisLabel:l,name:m.text,showName:h,nameLocation:"end",nameGap:f,nameTextStyle:v,triggerEvent:p},!1);if(Nt(d)){var b=y.name;y.name=d.replace("{value}",b??"")}else ur(d)&&(y.name=d(y.name,y));var x=new yn(y,null,this.ecModel);return Is(x,Y_.prototype),x.mainType="radar",x.componentIndex=this.componentIndex,x.uid=lS("ec_radar"),x},this);this._indicatorModels=g},e.prototype.getIndicatorModels=function(){return this._indicatorModels},e.type=blt,e.defaultOption={z:0,center:["50%","50%"],radius:"50%",startAngle:90,clockwise:!1,axisName:{show:!0,color:et.color.axisLabel},boundaryGap:[0,0],splitNumber:xlt,axisNameGap:15,scale:!1,shape:"polygon",axisLine:Vr({lineStyle:{color:et.color.neutral20}},H8.axisLine),axisLabel:aY(H8.axisLabel,!1),axisTick:aY(H8.axisTick,!1),splitLine:aY(H8.splitLine,!0),splitArea:aY(H8.splitArea,!0),indicator:[]},e}(fn),n6r=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){var a=this.group;a.removeAll(),this._buildAxes(r,i),this._buildSplitLineAndArea(r)},e.prototype._buildAxes=function(r,n){var i=r.coordinateSystem,a=i.getIndicatorAxes(),s=vt(a,function(o){var l=o.model.get("showName")?o.name:"",u=new Ou(o.model,n,{axisName:l,position:[i.cx,i.cy],rotation:o.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return u});de(s,function(o){o.build(),this.group.add(o.group)},this)},e.prototype._buildSplitLineAndArea=function(r){var n=r.coordinateSystem,i=n.getIndicatorAxes();if(!i.length)return;var a=r.get("shape"),s=r.getModel("splitLine"),o=r.getModel("splitArea"),l=s.getModel("lineStyle"),u=o.getModel("areaStyle"),h=s.get("show"),d=o.get("show"),f=l.get("color"),p=u.get("color"),g=ft(f)?f:[f],m=ft(p)?p:[p],v=[],y=[];function b(D,M,P){var N=P%M.length;return D[N]=D[N]||[],N}if(a==="circle")for(var x=i[0].getTicksCoords(),w=n.cx,A=n.cy,S=0;S3?1.4:s>1?1.2:1.1,h=a>0?u:1/u;this._checkTriggerMoveZoom(this,"zoom","zoomOnMouseWheel",r,{scale:h,originX:o,originY:l,isAvailableBehavior:null})}if(i){var d=Math.abs(a),f=(a>0?1:-1)*(d>3?.4:d>1?.15:.05);this._checkTriggerMoveZoom(this,"scrollMove","moveOnMouseWheel",r,{scrollDelta:f,originX:o,originY:l,isAvailableBehavior:null})}}}},e.prototype._pinchHandler=function(r){if(!(Slt(this._zr,"globalPan")||Y8(r))){var n=r.pinchScale>1?1.1:1/1.1;this._checkTriggerMoveZoom(this,"zoom",null,r,{scale:n,originX:r.pinchX,originY:r.pinchY,isAvailableBehavior:null})}},e.prototype._checkTriggerMoveZoom=function(r,n,i,a,s){r._checkPointer(a,s.originX,s.originY)&&(Kv(a.event),a.__ecRoamConsumed=!0,Clt(r,n,i,a,s))},e}(Df);function Y8(t){return t.__ecRoamConsumed}var f6r=Qr();function sY(t){var e=f6r(t);return e.roam=e.roam||{},e.uniform=e.uniform||{},e}function q8(t,e,r,n){for(var i=sY(t),a=i.roam,s=a[e]=a[e]||[],o=0;o=4&&(h={x:parseFloat(f[0]||0),y:parseFloat(f[1]||0),width:parseFloat(f[2]),height:parseFloat(f[3])})}if(h&&o!=null&&l!=null&&(d=Nlt(h,{x:0,y:0,width:o,height:l}),!r.ignoreViewBox)){var p=i;i=new pr,i.add(p),p.scaleX=p.scaleY=d.scale,p.x=d.x,p.y=d.y}return!r.ignoreRootClip&&o!=null&&l!=null&&i.setClipPath(new tn({shape:{x:0,y:0,width:o,height:l}})),{root:i,width:o,height:l,viewBoxRect:h,viewBoxTransform:d,named:a}},t.prototype._parseNode=function(e,r,n,i,a,s){var o=e.nodeName.toLowerCase(),l,u=i;if(o==="defs"&&(a=!0),o==="text"&&(s=!0),o==="defs"||o==="switch")l=r;else{if(!a){var h=Zge[o];if(h&&Kt(Zge,o)){l=h.call(this,e,r);var d=e.getAttribute("name");if(d){var f={name:d,namedFrom:null,svgNodeTagLower:o,el:l};n.push(f),o==="g"&&(u=f)}else i&&n.push({name:i.name,namedFrom:i,svgNodeTagLower:o,el:l});r.add(l)}}var p=_lt[o];if(p&&Kt(_lt,o)){var g=p.call(this,e),m=e.getAttribute("id");m&&(this._defs[m]=g)}}if(l&&l.isGroup)for(var v=e.firstChild;v;)v.nodeType===1?this._parseNode(v,l,n,u,a,s):v.nodeType===3&&s&&this._parseText(v,l),v=v.nextSibling},t.prototype._parseText=function(e,r){var n=new s_({style:{text:e.textContent},silent:!0,x:this._textX||0,y:this._textY||0});qf(r,n),Md(e,n,this._defsUsePending,!1,!1),v6r(n,r);var i=n.style,a=i.fontSize;a&&a<9&&(i.fontSize=9,n.scaleX*=a/9,n.scaleY*=a/9);var s=(i.fontSize||i.fontFamily)&&[i.fontStyle,i.fontWeight,(i.fontSize||12)+"px",i.fontFamily||"sans-serif"].join(" ");i.font=s;var o=n.getBoundingRect();return this._textX+=o.width,r.add(n),n},t.internalField=function(){Zge={g:function(e,r){var n=new pr;return qf(r,n),Md(e,n,this._defsUsePending,!1,!1),n},rect:function(e,r){var n=new tn;return qf(r,n),Md(e,n,this._defsUsePending,!1,!1),n.setShape({x:parseFloat(e.getAttribute("x")||"0"),y:parseFloat(e.getAttribute("y")||"0"),width:parseFloat(e.getAttribute("width")||"0"),height:parseFloat(e.getAttribute("height")||"0")}),n.silent=!0,n},circle:function(e,r){var n=new Em;return qf(r,n),Md(e,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),r:parseFloat(e.getAttribute("r")||"0")}),n.silent=!0,n},line:function(e,r){var n=new Ps;return qf(r,n),Md(e,n,this._defsUsePending,!1,!1),n.setShape({x1:parseFloat(e.getAttribute("x1")||"0"),y1:parseFloat(e.getAttribute("y1")||"0"),x2:parseFloat(e.getAttribute("x2")||"0"),y2:parseFloat(e.getAttribute("y2")||"0")}),n.silent=!0,n},ellipse:function(e,r){var n=new FN;return qf(r,n),Md(e,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),rx:parseFloat(e.getAttribute("rx")||"0"),ry:parseFloat(e.getAttribute("ry")||"0")}),n.silent=!0,n},polygon:function(e,r){var n=e.getAttribute("points"),i;n&&(i=Llt(n));var a=new ic({shape:{points:i||[]},silent:!0});return qf(r,a),Md(e,a,this._defsUsePending,!1,!1),a},polyline:function(e,r){var n=e.getAttribute("points"),i;n&&(i=Llt(n));var a=new Al({shape:{points:i||[]},silent:!0});return qf(r,a),Md(e,a,this._defsUsePending,!1,!1),a},image:function(e,r){var n=new Yo;return qf(r,n),Md(e,n,this._defsUsePending,!1,!1),n.setStyle({image:e.getAttribute("xlink:href")||e.getAttribute("href"),x:+e.getAttribute("x"),y:+e.getAttribute("y"),width:+e.getAttribute("width"),height:+e.getAttribute("height")}),n.silent=!0,n},text:function(e,r){var n=e.getAttribute("x")||"0",i=e.getAttribute("y")||"0",a=e.getAttribute("dx")||"0",s=e.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(a),this._textY=parseFloat(i)+parseFloat(s);var o=new pr;return qf(r,o),Md(e,o,this._defsUsePending,!1,!0),o},tspan:function(e,r){var n=e.getAttribute("x"),i=e.getAttribute("y");n!=null&&(this._textX=parseFloat(n)),i!=null&&(this._textY=parseFloat(i));var a=e.getAttribute("dx")||"0",s=e.getAttribute("dy")||"0",o=new pr;return qf(r,o),Md(e,o,this._defsUsePending,!1,!0),this._textX+=parseFloat(a),this._textY+=parseFloat(s),o},path:function(e,r){var n=e.getAttribute("d")||"",i=Ett(n);return qf(r,i),Md(e,i,this._defsUsePending,!1,!1),i.silent=!0,i}}}(),t}(),_lt={lineargradient:function(t){var e=parseInt(t.getAttribute("x1")||"0",10),r=parseInt(t.getAttribute("y1")||"0",10),n=parseInt(t.getAttribute("x2")||"10",10),i=parseInt(t.getAttribute("y2")||"0",10),a=new tS(e,r,n,i);return Rlt(t,a),Dlt(t,a),a},radialgradient:function(t){var e=parseInt(t.getAttribute("cx")||"0",10),r=parseInt(t.getAttribute("cy")||"0",10),n=parseInt(t.getAttribute("r")||"0",10),i=new rfe(e,r,n);return Rlt(t,i),Dlt(t,i),i}};function Rlt(t,e){var r=t.getAttribute("gradientUnits");r==="userSpaceOnUse"&&(e.global=!0)}function Dlt(t,e){for(var r=t.firstChild;r;){if(r.nodeType===1&&r.nodeName.toLocaleLowerCase()==="stop"){var n=r.getAttribute("offset"),i=void 0;n&&n.indexOf("%")>0?i=parseInt(n,10)/100:n?i=parseFloat(n):i=0;var a={};Plt(r,a,a);var s=a.stopColor||r.getAttribute("stop-color")||"#000000",o=a.stopOpacity||r.getAttribute("stop-opacity");if(o){var l=Bc(s),u=l&&l[3];u&&(l[3]*=Jv(o),s=Pf(l,"rgba"))}e.colorStops.push({offset:i,color:s})}r=r.nextSibling}}function qf(t,e){t&&t.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),mr(e.__inheritedStyle,t.__inheritedStyle))}function Llt(t){for(var e=uY(t),r=[],n=0;n0;a-=2){var s=n[a],o=n[a-1],l=uY(s);switch(i=i||xa(),o){case"translate":zp(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":bG(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":Zv(i,i,-parseFloat(l[0])*Jge,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":var u=Math.tan(parseFloat(l[0])*Jge);Td(i,[1,0,u,1,0,0],i);break;case"skewY":var h=Math.tan(parseFloat(l[0])*Jge);Td(i,[1,h,0,1,0,0],i);break;case"matrix":i[0]=parseFloat(l[0]),i[1]=parseFloat(l[1]),i[2]=parseFloat(l[2]),i[3]=parseFloat(l[3]),i[4]=parseFloat(l[4]),i[5]=parseFloat(l[5]);break}}e.setLocalTransform(i)}}var Ilt=/([^\s:;]+)\s*:\s*([^:;]+)/g;function Plt(t,e,r){var n=t.getAttribute("style");if(n){Ilt.lastIndex=0;for(var i;(i=Ilt.exec(n))!=null;){var a=i[1],s=Kt(lY,a)?lY[a]:null;s&&(e[s]=i[2]);var o=Kt(cY,a)?cY[a]:null;o&&(r[o]=i[2])}}}function S6r(t,e,r){for(var n=0;n1e-6;Z8[0]=s?(i[0]-n.x)/a:i[0],Z8[1]=s?(i[1]-n.y)/a:i[1],Ka(Z8,Z8,t.mtRawInv);var o=q6r(t,Z8);Zlt(e,o,a),de(r,function(l){l!==e&&Zlt(l,o.slice(),a)})}var Z8=[];function Zlt(t,e,r){var n=t.option;n.center=e,n.zoom=r}function lme(t,e){if(e){var r=e.min||0,n=e.max||1/0;t=Math.max(Math.min(n,t),r)}return t}function Jlt(t,e){var r=e.getShallow("nodeScaleRatio",!0)||1,n=t;return((n.zoom-1)*r+1)/(n.trans[Fm].scaleX||1)}function bY(t,e,r,n,i,a,s,o){var l=yY(t);if(!l){r.disable();return}r.enable(Jt(t.get("roam"),s),{api:e,zInfo:{component:t},triggerInfo:{roamTrigger:t.get("roamTrigger"),isInSelf:n,isInClip:function(h,d,f){return!i||i.contain(d,f)}}});function u(h){var d=t.mainType,f=ffe(mr({type:tct(d,t.subType,ett)},h));o&&(f.componentType=d),f[d+"Id"]=t.id,e.dispatchAction(f)}r.off("pan").off("zoom").on("pan",function(h){a&&a("pan"),u({dx:h.dx,dy:h.dy})}).on("zoom",function(h){a&&a("zoom"),u({zoom:h.scale,originX:h.originX,originY:h.originY})})}function ect(t){return function(e,r,n){return cme.copy(t.getBoundingRect()),cme.applyTransform(t.getComputedTransform()),cme.contain(r,n)}}var cme=new fr(0,0,0,0);function ume(t,e,r){var n=tct(e,r,ett);t.registerAction({type:n,event:n,update:"none"},function(i,a,s){a.eachComponent(mde(i,e,r),function(o){Ylt(i,o),qlt(i,o,a,s)})})}function tct(t,e,r){return(t!==km?t:e==="map"?"geo":e)+r}function rct(t){return t.zoom!=null}function hme(t,e,r,n,i,a,s){var o=new hY(null,Klt(t.ecModel,e));return gY(o,r,n,i,a),s?mY(o,s.x,s.y,s.width,s.height):mY(o,r,n,i,a),nme(o,t),o}var dme=["rect","circle","line","ellipse","polygon","polyline","path"],X6r=Yt(dme),K6r=Yt(dme.concat(["g"])),Z6r=Yt(dme.concat(["g"])),nct=Qr();function xY(t){var e=t.getItemStyle(),r=t.get("areaColor");return r!=null&&(e.fill=r),e}function ict(t){var e=t.style;e&&(e.stroke=e.stroke||e.fill,e.fill=null)}var act=function(){function t(e){var r=this.group=new pr,n=this._transformGroup=new pr;r.add(n),this.uid=lS("ec_map_draw"),this._controller=new VS(e.getZr()),n.add(this._regionsGroup=new pr),n.add(this._svgGroup=new pr)}return t.prototype.draw=function(e,r,n,i,a){var s=this,o=e.getData&&e.getData();a5(e)&&r.eachComponent({mainType:"series",subType:"map"},function(m){!o&&m.getHostGeoModel()===e&&(o=m.getData())});var l=e.coordinateSystem,u=l.view,h=this._regionsGroup,d=this._transformGroup,f=!h.childAt(0)||a,p;l.shouldClip()?(p=tme(null,u),this.group.setClipPath(new tn({shape:p.clone()}))):this.group.removeClipPath(),Lx(d,WS,u,f?null:e);var g=o&&o.getVisual("visualMeta")&&o.getVisual("visualMeta").length>0;l.resourceType==="geoJSON"?this._buildGeoJSON(u,n,l,e,o,g):l.resourceType==="geoSVG"&&this._buildSVG(u,n,l,e,o,g),bY(e,n,this._controller,function(m,v,y){return e.coordinateSystem.containPoint([v,y])},p,function(){s._mouseDownFlag=!1},!1,!0),this._updateMapSelectHandler(e,h,n,i)},t.prototype.__updateOnOwnRoam=function(e){Lx(this._transformGroup,WS,e.coordinateSystem.view,null)},t.prototype._buildGeoJSON=function(e,r,n,i,a,s){var o=this._regionsGroupByName=Yt(),l=Yt(),u=this._regionsGroup,h=n.projection,d=h&&h.stream,f=ux(K8(null,e,HS));function p(v,y){return y&&(v=y(v)),v&&Ka([],v,f)}function g(v){for(var y=[],b=!d&&h&&h.project,x=0;x=0)&&(h=t);var d=s?{normal:{align:"center",verticalAlign:"middle"}}:null;qo(r,To(i),{labelFetcher:h,labelDataIndex:u,defaultText:n},d);var f=r.getTextContent();if(f&&(nct(f).ignore=f.ignore,r.textConfig&&s)){var p=r.getBoundingRect().clone();r.textConfig.layoutRect=p,r.textConfig.position=[(s[0]-p.x)/p.width*100+"%",(s[1]-p.y)/p.height*100+"%"]}r.disableLabelAnimation=!0}else r.removeTextContent(),r.removeTextConfig(),r.disableLabelAnimation=null}function lct(t,e,r,n,i,a){e?e.setItemGraphicEl(a,r):Cr(r).eventData={componentType:"geo",componentIndex:t.componentIndex,geoIndex:t.componentIndex,name:n,region:i&&i.option||{}}}function cct(t,e,r,n,i){e||uy({el:r,componentModel:t,itemName:n,itemTooltipOption:i.get("tooltip")})}function uct(t,e,r,n){e.highDownSilentOnTouch=!!t.get("selectedMode");var i=n.getModel("emphasis"),a=i.get("focus");return wa(e,a,i.get("blurScope"),i.get("disabled")),a5(t)&&Q_r(e,t,r),a}function hct(t,e,r){var n=[],i;function a(){i=[]}function s(){i.length&&(n.push(i),i=[])}var o=e({polygonStart:a,polygonEnd:s,lineStart:a,lineEnd:s,point:function(l,u){isFinite(l)&&isFinite(u)&&i.push([l,u])},sphere:function(){}});return!r&&o.polygonStart(),de(t,function(l){o.lineStart();for(var u=0;u-1&&(i.style.stroke=i.style.fill,i.style.fill=et.color.neutral00,i.style.lineWidth=2),i},e.prototype.__ownRoamView=function(){return wY(this)?this.coordinateSystem.view:null},e.type="series."+YS,e.dependencies=["geo"],e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:et.color.tertiary},itemStyle:{borderWidth:.5,borderColor:et.color.border,areaColor:et.color.background},emphasis:{label:{show:!0,color:et.color.primary},itemStyle:{areaColor:et.color.highlight}},select:{label:{show:!0,color:et.color.primary},itemStyle:{color:et.color.highlight}},nameProperty:"name"},e}(Ri);function dct(t){return t.indexOf("i")===0}function wY(t){return J8(t.seriesGroup)===t&&!t.getHostGeoModel()}function J8(t){return t.f[0]}function fme(t,e){var r={};return t.eachRawSeriesByType(YS,function(n){var i=n.getHostGeoModel(),a=i?"o"+i.id:"i"+n.getMapType(),s=r[a]=r[a]||{f:[],r:[]};!t.isSeriesFiltered(n)&&!e&&s.f.push(n),s.r.push(n)}),r}var eNr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=YS,r}return e.prototype.render=function(r,n,i,a){if(!(a&&a.type==="mapToggleSelect"&&a.from===this.uid)){var s=this.group;if(s.removeAll(),!r.getHostGeoModel()){var o=this._mapDraw;o&&a&&a.type==="geoRoam"&&o.resetForLabelLayout(),a&&a.type==="geoRoam"&&a.componentType==="series"&&a.seriesId===r.id?o&&s.add(o.group):wY(r)?(o=o||(this._mapDraw=new act(i)),s.add(o.group),o.draw(r,n,i,this,a)):this._clearMapDraw(),r.get("showLegendSymbol")&&n.getComponent("legend")&&this._renderSymbols(r)}}},e.prototype.__updateOnOwnRoam=function(r,n,i){var a=this._mapDraw;wY(n)&&a&&a.__updateOnOwnRoam(n)},e.prototype.remove=function(){this._clearMapDraw(),this.group.removeAll()},e.prototype.dispose=function(){this._clearMapDraw()},e.prototype._clearMapDraw=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},e.prototype._renderSymbols=function(r){var n=r.originalData,i=this.group;n.each(n.mapDimension("value"),function(a,s){if(!isNaN(a)){var o=n.getItemLayout(s);if(!(!o||!o.point)){var l=o.point,u=o.offset,h=new Em({style:{fill:r.getData().getVisual("style").fill},shape:{cx:l[0]+u*9,cy:l[1],r:3},silent:!0,z2:8+(u?0:c_+1)});if(!u){var d=J8(r.seriesGroup).getData(),f=n.getName(s),p=d.indexOfName(f),g=n.getItemModel(s),m=g.getModel("label"),v=d.getItemGraphicEl(p);qo(h,To(g),{labelFetcher:{getFormattedLabel:function(y,b){return r.getFormattedLabel(p,b)}},defaultText:f}),h.disableLabelAnimation=!0,m.get("position")||h.setTextConfig({position:"bottom"}),v.onHoverStateChange=function(y){yH(h,y)}}i.add(h)}}})},e.type=YS,e}(Si),tNr={geoJSON:{aspectScale:.75,invertLongitute:!0},geoSVG:{aspectScale:1,invertLongitute:!1}},fct=["lng","lat"],pct=function(t){rt(e,t);function e(r,n,i){var a=t.call(this)||this;a.dimensions=fct,a.type="geo",a._nameCoordMap=Yt(),a.name=r;var s=i.projection,o=vy.load(n,i.nameMap,i.nameProperty),l=vy.getGeoResource(n);a.resourceType=l?l.type:null;var u=a.regions=o.regions,h=tNr[l.type];a._clip=i.clip;var d=s?!1:h.invertLongitute;a.view=new hY(d,Klt(i.ecModel,i.api),a),a.map=n,a._regionsMap=o.regionsMap,a.regions=o.regions,a.projection=s;var f;if(s)for(var p=0;p1?(w.width=x,w.height=x/v):(w.height=x,w.width=x*v),w.y=b[1]-w.height/2,w.x=b[0]-w.width/2;else{var A=t.getBoxLayoutParams();A.aspect=v,w=da(A,m),w=Ert(t,w,v)}mY(r,w.x,w.y,w.width,w.height),nme(r,t)}function rNr(t,e){de(e.get("geoCoord"),function(r,n){t.addGeoCoord(n,r)})}var nNr=function(){function t(){this.dimensions=fct}return t.prototype.create=function(e,r){var n=[];function i(a){return{nameProperty:a.get("nameProperty"),aspectScale:a.get("aspectScale"),projection:a.get("projection"),clip:a.getShallow("clip",!0)}}return e.eachComponent("geo",function(a,s){var o=a.get("map"),l=new pct(o+s,o,ot({nameMap:a.get("nameMap"),api:r,ecModel:e},i(a)));n.push(l),a.coordinateSystem=l,l.model=a,l.resize=mct,l.resize(a,r)}),e.eachSeries(function(a){ZN({targetModel:a,coordSysType:"geo",coordSysProvider:function(){var s=a.subType===YS?a.getHostGeoModel():a.getReferringComponents("geo",ds).models[0];return s&&s.coordinateSystem},allowNotFound:!0})}),de(fme(e,!0),function(a,s){if(dct(s)){var o=a.r[0],l=[];de(a.r,function(f){l.push(f.get("nameMap")),f.seriesGroup=null});var u=s.slice(1),h=new pct(u,u,ot({nameMap:fG(l),api:r,ecModel:e},i(o))),d;de(a.r,function(f){d=Jt(d,f.get("scaleLimit"))}),n.push(h),h.resize=mct,h.resize(o,r),de(a.r,function(f){f.coordinateSystem=h,rNr(h,f)})}}),n},t.prototype.getFilledRegions=function(e,r,n,i){for(var a=(e||[]).slice(),s=Yt(),o=0;o=0;s--){var o=i[s];o.hierNode={defaultAncestor:null,ancestor:o,prelim:0,modifier:0,change:0,shift:0,i:s,thread:null},r.push(o)}}function pNr(t,e){var r=t.isExpand?t.children:[],n=t.parentNode.children,i=t.hierNode.i?n[t.hierNode.i-1]:null;if(r.length){mNr(t);var a=(r[0].hierNode.prelim+r[r.length-1].hierNode.prelim)/2;i?(t.hierNode.prelim=i.hierNode.prelim+e(t,i),t.hierNode.modifier=t.hierNode.prelim-a):t.hierNode.prelim=a}else i&&(t.hierNode.prelim=i.hierNode.prelim+e(t,i));t.parentNode.hierNode.defaultAncestor=vNr(t,i,t.parentNode.hierNode.defaultAncestor||n[0],e)}function gNr(t){var e=t.hierNode.prelim+t.parentNode.hierNode.modifier;t.setLayout({x:e},!0),t.hierNode.modifier+=t.parentNode.hierNode.modifier}function bct(t){return arguments.length?t:xNr}function eB(t,e){return t-=Math.PI/2,{x:e*Math.cos(t),y:e*Math.sin(t)}}function mNr(t){for(var e=t.children,r=e.length,n=0,i=0;--r>=0;){var a=e[r];a.hierNode.prelim+=n,a.hierNode.modifier+=n,i+=a.hierNode.change,n+=a.hierNode.shift+i}}function vNr(t,e,r,n){if(e){for(var i=t,a=t,s=a.parentNode.children[0],o=e,l=i.hierNode.modifier,u=a.hierNode.modifier,h=s.hierNode.modifier,d=o.hierNode.modifier;o=pme(o),a=gme(a),o&&a;){i=pme(i),s=gme(s),i.hierNode.ancestor=t;var f=o.hierNode.prelim+d-a.hierNode.prelim-u+n(o,a);f>0&&(bNr(yNr(o,t,r),t,f),u+=f,l+=f),d+=o.hierNode.modifier,u+=a.hierNode.modifier,l+=i.hierNode.modifier,h+=s.hierNode.modifier}o&&!pme(i)&&(i.hierNode.thread=o,i.hierNode.modifier+=d-l),a&&!gme(s)&&(s.hierNode.thread=a,s.hierNode.modifier+=u-h,r=t)}return r}function pme(t){var e=t.children;return e.length&&t.isExpand?e[e.length-1]:t.hierNode.thread}function gme(t){var e=t.children;return e.length&&t.isExpand?e[0]:t.hierNode.thread}function yNr(t,e,r){return t.hierNode.ancestor.parentNode===e.parentNode?t.hierNode.ancestor:r}function bNr(t,e,r){var n=r/(e.hierNode.i-t.hierNode.i);e.hierNode.change-=n,e.hierNode.shift+=r,e.hierNode.modifier+=r,e.hierNode.prelim+=r,t.hierNode.change+=n}function xNr(t,e){return t.parentNode===e.parentNode?1:2}var jf=Qr();function xct(t){var e=t.mainData,r=t.datas;r||(r={main:e},t.datasAttr={main:"data"}),t.datas=t.mainData=null,wct(e,r,t),de(r,function(n){de(e.TRANSFERABLE_METHODS,function(i){n.wrapMethod(i,qr(wNr,t))})}),e.wrapMethod("cloneShallow",qr(SNr,t)),de(e.CHANGABLE_METHODS,function(n){e.wrapMethod(n,qr(ANr,t))}),ec(r[e.dataType]===e)}function wNr(t,e){if(ONr(this)){var r=ot({},jf(this).datas);r[this.dataType]=e,wct(e,r,t)}else mme(e,this.dataType,jf(this).mainData,t);return e}function ANr(t,e){return t.struct&&t.struct.update(),e}function SNr(t,e){return de(jf(e).datas,function(r,n){r!==e&&mme(r.cloneShallow(),n,e,t)}),e}function TNr(t){var e=jf(this).mainData;return t==null||e==null?e:jf(e).datas[t]}function CNr(){var t=jf(this).mainData;return t==null?[{data:t}]:vt(kn(jf(t).datas),function(e){return{type:e,data:jf(t).datas[e]}})}function ONr(t){return jf(t).mainData===t}function wct(t,e,r){jf(t).datas={},de(e,function(n,i){mme(n,i,t,r)})}function mme(t,e,r,n){jf(r).datas[e]=t,jf(t).mainData=r,t.dataType=e,n.struct&&(t[n.structAttr]=n.struct,n.struct[n.datasAttr[e]]=t),t.getLinkedData=TNr,t.getLinkedDataAll=CNr}var kNr=function(){function t(e,r){this.depth=0,this.height=0,this.dataIndex=-1,this.children=[],this.viewChildren=[],this.isExpand=!1,this.name=e||"",this.hostTree=r}return t.prototype.isRemoved=function(){return this.dataIndex<0},t.prototype.eachNode=function(e,r,n){ur(e)&&(n=r,r=e,e=null),e=e||{},Nt(e)&&(e={order:e});var i=e.order||"preorder",a=this[e.attr||"children"],s;i==="preorder"&&(s=r.call(n,this));for(var o=0;!s&&or&&(r=i.height)}this.height=r+1},t.prototype.getNodeById=function(e){if(this.getId()===e)return this;for(var r=0,n=this.children,i=n.length;r=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,r)},t.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},t.prototype.getModel=function(e){if(!(this.dataIndex<0)){var r=this.hostTree,n=r.data.getItemModel(this.dataIndex);return n.getModel(e)}},t.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},t.prototype.setVisual=function(e,r){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,r)},t.prototype.getVisual=function(e){return this.hostTree.data.getItemVisual(this.dataIndex,e)},t.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},t.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},t.prototype.getChildIndex=function(){if(this.parentNode){for(var e=this.parentNode.children,r=0;r=0){var n=r.getData().tree.root,i=t.targetNode;if(Nt(i)&&(i=n.getNodeById(i)),i&&n.contains(i))return{node:i};var a=t.targetNodeId;if(a!=null&&(i=n.getNodeById(a)))return{node:i}}}function Act(t){for(var e=[];t;)t=t.parentNode,t&&e.push(t);return e.reverse()}function yme(t,e){var r=Act(t);return Ir(r,e)>=0}function AY(t,e){for(var r=[];t;){var n=t.dataIndex;r.push({name:t.name,dataIndex:n,value:e.getRawValue(n)}),t=t.parentNode}return r.reverse(),r}var qS="tree",_Nr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.hasSymbolVisual=!0,r.ignoreStyleOnData=!0,r}return e.prototype.getInitialData=function(r){var n={name:r.name,children:r.data},i=r.leaves||{},a=new yn(i,this,this.ecModel),s=vme.createTree(n,this,o);function o(d){d.wrapMethod("getItemModel",function(f,p){var g=s.getNodeByDataIndex(p);return g&&g.children.length&&g.isExpand||(f.parentModel=a),f})}var l=0;s.eachNode("preorder",function(d){d.depth>l&&(l=d.depth)});var u=r.expandAndCollapse,h=u&&r.initialTreeDepth>=0?r.initialTreeDepth:l;return s.root.eachNode("preorder",function(d){var f=d.hostTree.data.getRawDataItem(d.dataIndex);d.isExpand=f&&f.collapsed!=null?!f.collapsed:d.depth<=h}),s.data},e.prototype.getOrient=function(){var r=this.get("orient");return r==="horizontal"?r="LR":r==="vertical"&&(r="TB"),r},e.prototype.formatTooltip=function(r,n,i){for(var a=this.getData().tree,s=a.root.children[0],o=a.getNodeByDataIndex(r),l=o.getValue(),u=o.name;o&&o!==s;)u=o.parentNode.name+"."+u,o=o.parentNode;return no("nameValue",{name:u,value:l,noValue:isNaN(l)||l==null})},e.prototype.getDataParams=function(r){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(r);return n.treeAncestors=AY(i,this),n.collapsed=!i.isExpand,n},e.prototype.__ownRoamView=function(){return this.coordinateSystem},e.type="series."+qS,e.layoutMode="box",e.defaultOption={z:2,coordinateSystemUsage:"box",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,roamTrigger:"global",nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:et.color.borderTint,width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},e}(Ri),RNr=function(){function t(){this.parentPoint=[],this.childPoints=[]}return t}(),DNr=function(t){rt(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:et.color.neutral99,fill:null}},e.prototype.getDefaultShape=function(){return new RNr},e.prototype.buildPath=function(r,n){var i=n.childPoints,a=i.length,s=n.parentPoint,o=i[0],l=i[a-1];if(a===1){r.moveTo(s[0],s[1]),r.lineTo(o[0],o[1]);return}var u=n.orient,h=u==="TB"||u==="BT"?0:1,d=1-h,f=Qt(n.forkPosition,1),p=[];p[h]=s[h],p[d]=s[d]+(l[d]-s[d])*f,r.moveTo(s[0],s[1]),r.lineTo(p[0],p[1]),r.moveTo(o[0],o[1]),p[h]=o[h],r.lineTo(p[0],p[1]),p[h]=l[h],r.lineTo(p[0],p[1]),r.lineTo(l[0],l[1]);for(var g=1;gb.x,A||(w=w-Math.PI));var T=A?"left":"right",O=o.getModel("label"),k=O.get("rotate"),E=k*(Math.PI/180),_=v.getTextContent();_&&(v.setTextConfig({position:O.get("position")||T,rotation:k==null?-w:E,origin:"center"}),_.setStyle("verticalAlign","middle"))}var I=o.get(["emphasis","focus"]),L=I==="relative"?QE(s.getAncestorsIndices(),s.getDescendantIndices()):I==="ancestor"?s.getAncestorsIndices():I==="descendant"?s.getDescendantIndices():null;L&&(Cr(r).focus=L),MNr(i,s,h,r,g,p,m,n),r.__edge&&(r.onHoverStateChange=function(R){if(R!=="blur"){var D=s.parentNode&&t.getItemGraphicEl(s.parentNode.dataIndex);D&&D.hoverState===PN||yH(r.__edge,R)}})}function MNr(t,e,r,n,i,a,s,o){var l=e.getModel(),u=t.get("edgeShape"),h=t.get("layout"),d=t.getOrient(),f=t.get(["lineStyle","curveness"]),p=t.get("edgeForkPosition"),g=l.getModel("lineStyle").getLineStyle(),m=n.__edge;if(u==="curve")e.parentNode&&e.parentNode!==r&&(m||(m=n.__edge=new p_({shape:bme(h,d,f,i,i)})),Hn(m,{shape:bme(h,d,f,a,s)},t));else if(u==="polyline"&&h==="orthogonal"&&e!==r&&e.children&&e.children.length!==0&&e.isExpand===!0){for(var v=e.children,y=[],b=0;b=0;a--)r.push(i[a])}}function PNr(t,e){t.eachSeriesByType("tree",function(r){NNr(r,e)})}function NNr(t,e){var r=Co(t,e).refContainer,n=da(t.getBoxLayoutParams(),r);t.layoutInfo=n;var i=t.get("layout"),a=0,s=0,o=null;i==="radial"?(a=2*Math.PI,s=Math.min(n.height,n.width)/2,o=bct(function(w,A){return(w.parentNode===A.parentNode?1:2)/w.depth})):(a=n.width,s=n.height,o=bct());var l=t.getData().tree.root,u=l.children[0];if(u){fNr(l),INr(u,pNr,o),l.hierNode.modifier=-u.hierNode.prelim,rB(u,gNr);var h=u,d=u,f=u;rB(u,function(w){var A=w.getLayout().x;Ad.getLayout().x&&(d=w),w.depth>f.depth&&(f=w)});var p=h===d?1:o(h,d)/2,g=p-h.getLayout().x,m=0,v=0,y=0,b=0;if(i==="radial")m=a/(d.getLayout().x+p+g),v=s/(f.depth-1||1),rB(u,function(w){y=(w.getLayout().x+g)*m,b=(w.depth-1)*v;var A=eB(y,b);w.setLayout({x:A.x,y:A.y,rawX:y,rawY:b},!0)});else{var x=t.getOrient();x==="RL"||x==="LR"?(v=s/(d.getLayout().x+p+g),m=a/(f.depth-1||1),rB(u,function(w){b=(w.getLayout().x+g)*v,y=x==="LR"?(w.depth-1)*m:a-(w.depth-1)*m,w.setLayout({x:y,y:b},!0)})):(x==="TB"||x==="BT")&&(m=a/(d.getLayout().x+p+g),v=s/(f.depth-1||1),rB(u,function(w){y=(w.getLayout().x+g)*m,b=x==="TB"?(w.depth-1)*v:s-(w.depth-1)*v,w.setLayout({x:y,y:b},!0)}))}}}function BNr(t){t.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(e,r){r.eachComponent({mainType:km,subType:qS,query:e},function(n){var i=e.dataIndex,a=n.getData().tree,s=a.getNodeByDataIndex(i);s.isExpand=!s.isExpand})}),ume(t,km,qS)}var $Nr=Ao(qS,FNr);function FNr(t){t.eachSeriesByType(qS,function(e){var r=e.getData(),n=r.tree;n.eachNode(function(i){var a=i.getModel(),s=a.getModel("itemStyle").getItemStyle(),o=r.ensureUniqueItemVisual(i.dataIndex,"style");ot(o,s)})})}function zNr(t){t.registerChartView(LNr),t.registerSeriesModel(_Nr),t.registerLayout(PNr),t.registerVisual($Nr),BNr(t)}var Ect=["treemapZoomToNode","treemapRender","treemapMove"];function UNr(t){for(var e=0;e1;)a=a.parentNode;var s=Qfe(t.ecModel,a.name||a.dataIndex+"",n);i.setVisual("decal",s)})}var VNr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.preventUsingHoverLayer=!0,r}return e.prototype.getInitialData=function(r,n){var i={name:r.name,children:r.data};Rct(i);var a=r.levels||[],s=this.designatedVisualItemStyle={},o=new yn({itemStyle:s},this,n);a=r.levels=QNr(a,n);var l=vt(a||[],function(d){return new yn(d,o,n)},this),u=vme.createTree(i,this,h);function h(d){d.wrapMethod("getItemModel",function(f,p){var g=u.getNodeByDataIndex(p),m=g?l[g.depth]:null;return f.parentModel=m||o,f})}return u.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.formatTooltip=function(r,n,i){var a=this.getData(),s=this.getRawValue(r),o=a.getName(r);return no("nameValue",{name:o,value:s})},e.prototype.getDataParams=function(r){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(r);return n.treeAncestors=AY(i,this),n.treePathInfo=n.treeAncestors,n},e.prototype.setLayoutInfo=function(r){this.layoutInfo=this.layoutInfo||{},ot(this.layoutInfo,r)},e.prototype.mapIdToIndex=function(r){var n=this._idIndexMap;n||(n=this._idIndexMap=Yt(),this._idIndexMapCount=0);var i=n.get(r);return i==null&&n.set(r,i=this._idIndexMapCount++),i},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(r){r?this._viewRoot=r:r=this._viewRoot;var n=this.getRawData().tree.root;(!r||r!==n&&!n.contains(r))&&(this._viewRoot=n)},e.prototype.enableAriaDecal=function(){_ct(this)},e.type="series.treemap",e.layoutMode="box",e.defaultOption={progressive:0,coordinateSystemUsage:"box",left:et.size.l,top:et.size.xxxl,right:et.size.l,bottom:et.size.xxxl,sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.32*.32,scaleLimit:{max:5,min:.2},roam:!0,roamTrigger:"global",nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",bottom:et.size.m,emptyItemWidth:25,itemStyle:{color:et.color.backgroundShade,textStyle:{color:et.color.secondary}},emphasis:{itemStyle:{color:et.color.background}}},label:{show:!0,distance:0,padding:5,position:"inside",color:et.color.neutral00,overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:et.color.neutral00,borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},e}(Ri);function Rct(t){var e=0;de(t.children,function(n){Rct(n);var i=n.value;ft(i)&&(i=i[0]),e+=i});var r=t.value;ft(r)&&(r=r[0]),(r==null||isNaN(r))&&(r=e),r<0&&(r=0),ft(t.value)?t.value[0]=r:t.value=r}function QNr(t,e){var r=Qi(e.get("color")),n=Qi(e.get(["aria","decal","decals"]));if(r){t=t||[];var i,a;de(t,function(o){var l=new yn(o),u=l.get("color"),h=l.get("decal");(l.get(["itemStyle","color"])||u&&u!=="none")&&(i=!0),(l.get(["itemStyle","decal"])||h&&h!=="none")&&(a=!0)});var s=t[0]||(t[0]={});return i||(s.color=r.slice()),!a&&n&&(s.decal=n.slice()),t}}var GNr=8,Dct=8,xme=5,HNr=function(){function t(e){this.group=new pr,e.add(this.group)}return t.prototype.render=function(e,r,n,i){var a=e.getModel("breadcrumb"),s=this.group;if(s.removeAll(),!(!a.get("show")||!n)){var o=a.getModel("itemStyle"),l=a.getModel("emphasis"),u=o.getModel("textStyle"),h=l.getModel(["itemStyle","textStyle"]),d=Co(e,r).refContainer,f={left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},p={emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]},g=da(f,d);this._prepare(n,p,u),this._renderContent(e,p,g,o,l,u,h,i),GH(s,f,d)}},t.prototype._prepare=function(e,r,n){for(var i=e;i;i=i.parentNode){var a=wo(i.getModel().get("name"),""),s=n.getTextRect(a),o=Math.max(s.width+GNr*2,r.emptyItemWidth);r.totalWidth+=o+Dct,r.renderList.push({node:i,text:a,width:o})}},t.prototype._renderContent=function(e,r,n,i,a,s,o,l){for(var u=0,h=r.emptyItemWidth,d=e.get(["breadcrumb","height"]),f=r.totalWidth,p=r.renderList,g=a.getModel("itemStyle").getItemStyle(),m=p.length-1;m>=0;m--){var v=p[m],y=v.node,b=v.width,x=v.text;f>n.width&&(f-=b-h,b=h,x=null);var w=new ic({shape:{points:WNr(u,0,b,d,m===p.length-1,m===0)},style:mr(i.getItemStyle(),{lineJoin:"bevel"}),textContent:new Pn({style:Gi(s,{text:x})}),textConfig:{position:"inside"},z2:c_*1e4,onclick:qr(l,y)});w.disableLabelAnimation=!0,w.getTextContent().ensureState("emphasis").style=Gi(o,{text:x}),w.ensureState("emphasis").style=g,wa(w,a.get("focus"),a.get("blurScope"),a.get("disabled")),this.group.add(w),YNr(w,e,y),u+=b+Dct}},t.prototype.remove=function(){this.group.removeAll()},t}();function WNr(t,e,r,n,i,a){var s=[[i?t:t-xme,e],[t+r,e],[t+r,e+n],[i?t:t-xme,e+n]];return!a&&s.splice(2,0,[t+r+xme,e+n/2]),!i&&s.push([t,e+n/2]),s}function YNr(t,e,r){Cr(t).eventData={componentType:"series",componentSubType:"treemap",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:r&&r.dataIndex,name:r&&r.name},treePathInfo:r&&AY(r,e)}}var qNr=function(){function t(){this._storage=[],this._elExistsMap={}}return t.prototype.add=function(e,r,n,i,a){return this._elExistsMap[e.id]?!1:(this._elExistsMap[e.id]=!0,this._storage.push({el:e,target:r,duration:n,delay:i,easing:a}),!0)},t.prototype.finished=function(e){return this._finishedCallback=e,this},t.prototype.start=function(){for(var e=this,r=this._storage.length,n=function(){r--,r<=0&&(e._storage.length=0,e._elExistsMap={},e._finishedCallback&&e._finishedCallback())},i=0,a=this._storage.length;i=0;l--){var u=i[n==="asc"?s-l-1:l].getValue();u/r*eo[1]&&(o[1]=u)})),{sum:n,dataExtent:o}}function i8r(t,e,r){for(var n=0,i=1/0,a=0,s=void 0,o=t.length;an&&(n=s));var l=t.area*t.area,u=e*e*r;return l?nB(u*n/l,l/(u*i)):1/0}function Ict(t,e,r,n,i){var a=e===r.width?0:1,s=1-a,o=["x","y"],l=["width","height"],u=r[o[a]],h=e?t.area/e:0;(i||h>r[l[s]])&&(h=r[l[s]]);for(var d=0,f=t.length;d_N&&(h=_N),i=l}hzct||Math.abs(r.dy)>zct)){var n=this.seriesModel.getData().tree.root;if(!n)return;var i=n.getLayout();if(!i)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:i.x+r.dx,y:i.y+r.dy,width:i.width,height:i.height}})}},e.prototype._onZoom=function(r){var n=r.originX,i=r.originY,a=r.scale,s=this.seriesModel;if(this._state!=="animating"){var o=s.getData().tree.root;if(!o)return;var l=o.getLayout();if(!l)return;var u=new fr(l.x,l.y,l.width,l.height),h=s.layoutInfo,d=Bct(h,l),f=d*a;f=$ct(f,s);var p=f/d;n-=h.x,i-=h.y;var g=xa();zp(g,g,[-n,-i]),bG(g,g,[p,p]),zp(g,g,[n,i]),u.applyTransform(g),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:u.x,y:u.y,width:u.width,height:u.height}})}},e.prototype._initEvents=function(r){var n=this;r.on("click",function(i){if(n._state==="ready"){var a=n.seriesModel.get("nodeClick",!0);if(a){var s=n.findTarget(i.offsetX,i.offsetY);if(s){var o=s.node;if(o.getLayout().isLeafRoot)n._rootToNode(s);else if(a==="zoomToNode")n._zoomToNode(s);else if(a==="link"){var l=o.hostTree.data.getItemModel(o.dataIndex),u=l.get("link",!0),h=l.get("target",!0)||"blank";u&&zH(u,h)}}}}},this)},e.prototype._renderBreadcrumb=function(r,n,i){var a=this;i||(i=r.get("leafDepth",!0)!=null?{node:r.getViewRoot()}:this.findTarget(n.getWidth()/2,n.getHeight()/2),i||(i={node:r.getData().tree.root})),(this._breadcrumb||(this._breadcrumb=new HNr(this.group))).render(r,n,i.node,function(s){a._state!=="animating"&&(yme(r.getViewRoot(),s)?a._rootToNode({node:s}):a._zoomToNode({node:s}))})},e.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=iB(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},e.prototype.dispose=function(){this._clearController()},e.prototype._zoomToNode=function(r){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:r.node})},e.prototype._rootToNode=function(r){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:r.node})},e.prototype.findTarget=function(r,n){var i,a=this.seriesModel.getViewRoot();return a.eachNode({attr:"viewChildren",order:"preorder"},function(s){var o=this._storage.background[s.getRawIndex()];if(o){var l=o.transformCoordToLocal(r,n),u=o.shape;if(u.x<=l[0]&&l[0]<=u.x+u.width&&u.y<=l[1]&&l[1]<=u.y+u.height)i={node:s,offsetX:l[0],offsetY:l[1]};else return!1}},this),i},e.type="treemap",e}(Si);function iB(){return{nodeGroup:[],background:[],content:[]}}function h8r(t,e,r,n,i,a,s,o,l,u){if(!s)return;var h=s.getLayout(),d=t.getData(),f=s.getModel();if(d.setItemGraphicEl(s.dataIndex,null),!h||!h.isInView)return;var p=h.width,g=h.height,m=h.borderWidth,v=h.invisible,y=s.getRawIndex(),b=o&&o.getRawIndex(),x=s.viewChildren,w=h.upperHeight,A=x&&x.length,S=f.getModel("itemStyle"),T=f.getModel(["emphasis","itemStyle"]),O=f.getModel(["blur","itemStyle"]),k=f.getModel(["select","itemStyle"]),E=S.get("borderRadius")||0,_=G("nodeGroup",Ame);if(!_)return;if(l.add(_),_.x=h.x||0,_.y=h.y||0,_.markRedraw(),TY(_).nodeWidth=p,TY(_).nodeHeight=g,h.isAboveViewRoot)return _;var I=G("background",Fct,u,l8r);I&&B(_,I,A&&h.upperLabelHeight);var L=f.getModel("emphasis"),R=L.get("focus"),D=L.get("blurScope"),M=L.get("disabled"),P=R==="ancestor"?s.getAncestorsIndices():R==="descendant"?s.getDescendantIndices():R;if(A)BN(_)&&JA(_,!1),I&&(JA(I,!M),d.setItemGraphicEl(s.dataIndex,I),Xde(I,P,D));else{var N=G("content",Fct,u,c8r);N&&V(_,N),I.disableMorphing=!0,I&&BN(I)&&JA(I,!1),JA(_,!M),d.setItemGraphicEl(s.dataIndex,_);var F=f.getShallow("cursor");F&&N.attr("cursor",F),Xde(_,P,D)}return _;function B(le,q,Z){var ee=Cr(q);if(ee.dataIndex=s.dataIndex,ee.seriesIndex=t.seriesIndex,q.setShape({x:0,y:0,width:p,height:g,r:E}),v)z(q);else{q.invisible=!1;var re=s.getVisual("style"),ve=re.stroke,ae=Qct(S);ae.fill=ve;var Ce=jS(T);Ce.fill=T.get("borderColor");var Oe=jS(O);Oe.fill=O.get("borderColor");var $e=jS(k);if($e.fill=k.get("borderColor"),Z){var he=p-2*m;U(q,ve,re.opacity,{x:m,y:0,width:he,height:w})}else q.removeTextContent();q.setStyle(ae),q.ensureState("emphasis").style=Ce,q.ensureState("blur").style=Oe,q.ensureState("select").style=$e,ZA(q)}le.add(q)}function V(le,q){var Z=Cr(q);Z.dataIndex=s.dataIndex,Z.seriesIndex=t.seriesIndex;var ee=Math.max(p-2*m,0),re=Math.max(g-2*m,0);if(q.culling=!0,q.setShape({x:m,y:m,width:ee,height:re,r:E}),v)z(q);else{q.invisible=!1;var ve=s.getVisual("style"),ae=ve.fill,Ce=Qct(S);Ce.fill=ae,Ce.decal=ve.decal;var Oe=jS(T),$e=jS(O),he=jS(k);U(q,ae,ve.opacity,null),q.setStyle(Ce),q.ensureState("emphasis").style=Oe,q.ensureState("blur").style=$e,q.ensureState("select").style=he,ZA(q)}le.add(q)}function z(le){!le.invisible&&a.push(le)}function U(le,q,Z,ee){var re=f.getModel(ee?Vct:Uct),ve=wo(f.get("name"),null),ae=re.getShallow("show");qo(le,To(f,ee?Vct:Uct),{defaultText:ae?ve:null,inheritColor:q,defaultOpacity:Z,labelFetcher:t,labelDataIndex:s.dataIndex});var Ce=le.getTextContent();if(Ce){var Oe=Ce.style,$e=aN(Oe.padding||0);ee&&(le.setTextConfig({layoutRect:ee}),Ce.disableLabelLayout=!0),Ce.beforeUpdate=function(){var fe=Math.max((ee?ee.width:le.shape.width)-$e[1]-$e[3],0),Se=Math.max((ee?ee.height:le.shape.height)-$e[0]-$e[2],0);(Oe.width!==fe||Oe.height!==Se)&&Ce.setStyle({width:fe,height:Se})},Oe.truncateMinChar=2,Oe.lineOverflow="truncate",Q(Oe,ee,h);var he=Ce.getState("emphasis");Q(he?he.style:null,ee,h)}}function Q(le,q,Z){var ee=le?le.text:null;if(!q&&Z.isLeafRoot&&ee!=null){var re=t.get("drillDownIcon",!0);le.text=re?re+" "+ee:ee}}function G(le,q,Z,ee){var re=b!=null&&r[le][b],ve=i[le];return re?(r[le][b]=null,X(ve,re)):v||(re=new q,re instanceof $f&&(re.z2=d8r(Z,ee)),Y(ve,re)),e[le][y]=re}function X(le,q){var Z=le[y]={};q instanceof Ame?(Z.oldX=q.x,Z.oldY=q.y):Z.oldShape=ot({},q.shape)}function Y(le,q){var Z=le[y]={},ee=s.parentNode,re=q instanceof pr;if(ee&&(!n||n.direction==="drillDown")){var ve=0,ae=0,Ce=i.background[ee.getRawIndex()];!n&&Ce&&Ce.oldShape&&(ve=Ce.oldShape.width,ae=Ce.oldShape.height),re?(Z.oldX=0,Z.oldY=ae):Z.oldShape={x:ve,y:ae,width:0,height:0}}Z.fadein=!re}}function d8r(t,e){return t*o8r+e}var aB=de,f8r=yr,CY=-1,Xo=function(){function t(e){var r=e.mappingMethod,n=e.type,i=this.option=lr(e);this.type=n,this.mappingMethod=r,this._normalizeData=m8r[r];var a=t.visualHandlers[n];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[r],r==="piecewise"?(Sme(i),p8r(i)):r==="category"?i.categories?g8r(i):Sme(i,!0):(ec(r!=="linear"||i.dataExtent),Sme(i))}return t.prototype.mapValueToVisual=function(e){var r=this._normalizeData(e);return this._normalizedToVisual(r,e)},t.prototype.getNormalizer=function(){return Ht(this._normalizeData,this)},t.listVisualTypes=function(){return kn(t.visualHandlers)},t.isValidType=function(e){return t.visualHandlers.hasOwnProperty(e)},t.eachVisual=function(e,r,n){yr(e)?de(e,r,n):r.call(n,e)},t.mapVisual=function(e,r,n){var i,a=ft(e)?[]:yr(e)?{}:(i=!0,null);return t.eachVisual(e,function(s,o){var l=r.call(n,s,o);i?a=l:a[o]=l}),a},t.retrieveVisuals=function(e){var r={},n;return e&&aB(t.visualHandlers,function(i,a){e.hasOwnProperty(a)&&(r[a]=e[a],n=!0)}),n?r:null},t.prepareVisualTypes=function(e){if(ft(e))e=e.slice();else if(f8r(e)){var r=[];aB(e,function(n,i){r.push(i)}),e=r}else return[];return e.sort(function(n,i){return i==="color"&&n!=="color"&&n.indexOf("color")===0?1:-1}),e},t.dependsOn=function(e,r){return r==="color"?!!(e&&e.indexOf(r)===0):e===r},t.findPieceIndex=function(e,r,n){for(var i,a=1/0,s=0,o=r.length;s=0;a--)n[a]==null&&(delete r[e[a]],e.pop())}function Sme(t,e){var r=t.visual,n=[];yr(r)?aB(r,function(a){n.push(a)}):r!=null&&n.push(r);var i={color:1,symbol:1};!e&&n.length===1&&!i.hasOwnProperty(t.type)&&(n[1]=n[0]),Hct(t,n)}function OY(t){return{applyVisual:function(e,r,n){var i=this.mapValueToVisual(e);n("color",t(r("color"),i))},_normalizedToVisual:Tme([0,1])}}function Gct(t){var e=this.option.visual;return e[Math.round(jn(t,[0,1],[0,e.length-1],!0))]||{}}function sB(t){return function(e,r,n){n(t,this.mapValueToVisual(e))}}function oB(t){var e=this.option.visual;return e[this.option.loop&&t!==CY?t%e.length:t]}function XS(){return this.option.visual[0]}function Tme(t){return{linear:function(e){return jn(e,t,this.option.visual,!0)},category:oB,piecewise:function(e,r){var n=Cme.call(this,r);return n==null&&(n=jn(e,t,this.option.visual,!0)),n},fixed:XS}}function Cme(t){var e=this.option,r=e.pieceList;if(e.hasSpecialVisual){var n=Xo.findPieceIndex(t,r),i=r[n];if(i&&i.visual)return i.visual[this.type]}}function Hct(t,e){return t.visual=e,t.type==="color"&&(t.parsedVisual=vt(e,function(r){var n=Bc(r);return n||[0,0,0,1]})),e}var m8r={linear:function(t){return jn(t,this.option.dataExtent,[0,1],!0)},piecewise:function(t){var e=this.option.pieceList,r=Xo.findPieceIndex(t,e,!0);if(r!=null)return jn(r,[0,e.length-1],[0,1],!0)},category:function(t){var e=this.option.categories?this.option.categoryMap[t]:t;return e??CY},fixed:Xa};function kY(t,e,r){return t?e<=r:e=r.length||m===r[m.depth]){var y=A8r(i,l,m,v,g,n);Yct(m,y,r,n)}})}}}function b8r(t,e,r){var n=ot({},e),i=r.designatedVisualItemStyle;return de(["color","colorAlpha","colorSaturation"],function(a){i[a]=e[a];var s=t.get(a);i[a]=null,s!=null&&(n[a]=s)}),n}function qct(t){var e=Ome(t,"color");if(e){var r=Ome(t,"colorAlpha"),n=Ome(t,"colorSaturation");return n&&(e=ey(e,null,null,n)),r&&(e=wN(e,r)),e}}function x8r(t,e){return e!=null?ey(e,null,null,t):null}function Ome(t,e){var r=t[e];if(r!=null&&r!=="none")return r}function w8r(t,e,r,n,i,a){if(!(!a||!a.length)){var s=kme(e,"color")||i.color!=null&&i.color!=="none"&&(kme(e,"colorAlpha")||kme(e,"colorSaturation"));if(s){var o=e.get("visualMin"),l=e.get("visualMax"),u=r.dataExtent.slice();o!=null&&ou[1]&&(u[1]=l);var h=e.get("colorMappingBy"),d={type:s.name,dataExtent:u,visual:s.range};d.type==="color"&&(h==="index"||h==="id")?(d.mappingMethod="category",d.loop=!0):d.mappingMethod="linear";var f=new Xo(d);return Wct(f).drColorMappingBy=h,f}}}function kme(t,e){var r=t.get(e);return ft(r)&&r.length?{name:e,range:r}:null}function A8r(t,e,r,n,i,a){var s=ot({},e);if(i){var o=i.type,l=o==="color"&&Wct(i).drColorMappingBy,u=l==="index"?n:l==="id"?a.mapIdToIndex(r.getId()):r.getValue(t.get("visualDimension"));s[o]=i.mapValueToVisual(u)}return s}function S8r(t){t.registerSeriesModel(VNr),t.registerChartView(u8r),t.registerVisual(y8r),t.registerLayout(JNr),UNr(t)}function s5(t){return"_EC_"+t}var T8r=function(){function t(e){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=e||!1}return t.prototype.isDirected=function(){return this._directed},t.prototype.addNode=function(e,r){e=e==null?""+r:""+e;var n=this._nodesMap;if(!n[s5(e)]){var i=new KS(e,r);return i.hostGraph=this,this.nodes.push(i),n[s5(e)]=i,i}},t.prototype.getNodeByIndex=function(e){var r=this.data.getRawIndex(e);return this.nodes[r]},t.prototype.getNodeById=function(e){return this._nodesMap[s5(e)]},t.prototype.addEdge=function(e,r,n){var i=this._nodesMap,a=this._edgesMap;if(zn(e)&&(e=this.nodes[e]),zn(r)&&(r=this.nodes[r]),e instanceof KS||(e=i[s5(e)]),r instanceof KS||(r=i[s5(r)]),!(!e||!r)){var s=e.id+"-"+r.id,o=new jct(e,r,n);return o.hostGraph=this,this._directed&&(e.outEdges.push(o),r.inEdges.push(o)),e.edges.push(o),e!==r&&r.edges.push(o),this.edges.push(o),a[s]=o,o}},t.prototype.getEdgeByIndex=function(e){var r=this.edgeData.getRawIndex(e);return this.edges[r]},t.prototype.getEdge=function(e,r){e instanceof KS&&(e=e.id),r instanceof KS&&(r=r.id);var n=this._edgesMap;return this._directed?n[e+"-"+r]:n[e+"-"+r]||n[r+"-"+e]},t.prototype.eachNode=function(e,r){for(var n=this.nodes,i=n.length,a=0;a=0&&e.call(r,n[a],a)},t.prototype.eachEdge=function(e,r){for(var n=this.edges,i=n.length,a=0;a=0&&n[a].node1.dataIndex>=0&&n[a].node2.dataIndex>=0&&e.call(r,n[a],a)},t.prototype.breadthFirstTraverse=function(e,r,n,i){if(r instanceof KS||(r=this._nodesMap[s5(r)]),!!r){for(var a=n==="out"?"outEdges":n==="in"?"inEdges":"edges",s=0;s=0&&l.node2.dataIndex>=0});for(var a=0,s=i.length;a=0&&!e.hasKey(g)&&(e.set(g,!0),s.push(p.node1))}for(l=0;l=0&&!e.hasKey(x)&&(e.set(x,!0),o.push(b.node2))}}}return{edge:e.keys(),node:r.keys()}},t}(),jct=function(){function t(e,r,n){this.dataIndex=-1,this.node1=e,this.node2=r,this.dataIndex=n??-1}return t.prototype.getModel=function(e){if(!(this.dataIndex<0)){var r=this.hostGraph,n=r.edgeData.getItemModel(this.dataIndex);return n.getModel(e)}},t.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},t.prototype.getTrajectoryDataIndices=function(){var e=Yt(),r=Yt();e.set(this.dataIndex,!0);for(var n=[this.node1],i=[this.node2],a=0;a=0&&!e.hasKey(d)&&(e.set(d,!0),n.push(h.node1))}for(a=0;a=0&&!e.hasKey(m)&&(e.set(m,!0),i.push(g.node2))}return{edge:e.keys(),node:r.keys()}},t}();function Xct(t,e){return{getValue:function(r){var n=this[t][e];return n.getStore().get(n.getDimensionIndex(r||"value"),this.dataIndex)},setVisual:function(r,n){this.dataIndex>=0&&this[t][e].setItemVisual(this.dataIndex,r,n)},getVisual:function(r){return this[t][e].getItemVisual(this.dataIndex,r)},setLayout:function(r,n){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,r,n)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}}Is(KS,Xct("hostGraph","data")),Is(jct,Xct("hostGraph","edgeData"));function Eme(t,e,r,n,i){for(var a=new T8r(n),s=0;s "+f)),u++)}var p=r.get("coordinateSystem"),g;if(p==="cartesian2d"||p==="polar"||p==="matrix")g=Dm(t,r);else{var m=O_.get(p),v=m?m.dimensions||[]:[];Ir(v,"value")<0&&v.concat(["value"]);var y=U_(t,{coordDimensions:v,encodeDefine:r.getEncode()}).dimensions;g=new zc(y,r),g.initData(t)}var b=new zc(["value"],r);return b.initData(l,o),i&&i(g,b),xct({mainData:g,struct:a,structAttr:"graph",datas:{node:g,edge:b},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var _me="-->",EY=function(t){return t.get("autoCurveness")||null},Kct=function(t,e){var r=EY(t),n=20,i=[];if(zn(r))n=r;else if(ft(r)){t.__curvenessList=r;return}e>n&&(n=e);var a=n%2?n+2:n+3;i=[];for(var s=0;s "),value:s.value,noValue:s.value==null})}var d=Mnt({series:this,dataIndex:r,multipleSeries:n});return d},e.prototype._updateCategoriesData=function(){var r=vt(this.option.categories||[],function(i){return i.value!=null?i:ot({value:0},i)}),n=new zc(["value"],this);n.initData(r),this._categoriesData=n,this._categoriesModels=n.mapArray(function(i){return n.getItemModel(i)})},e.prototype.isAnimationEnabled=function(){return t.prototype.isAnimationEnabled.call(this)&&!(this.get("layout")==="force"&&this.get(["force","layoutAnimation"]))},e.prototype.__ownRoamView=function(){var r=this.coordinateSystem;return Wlt(r)&&r},e.type="series."+ku,e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:et.color.neutral50,width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:et.color.primary}}},e}(Ri);function _Y(t){return t instanceof Array||(t=[t,t]),t}var R8r=Ao(ku,D8r);function D8r(t){t.eachSeriesByType(ku,function(e){var r=e.getGraph(),n=e.getEdgeData(),i=_Y(e.get("edgeSymbol")),a=_Y(e.get("edgeSymbolSize"));n.setVisual("fromSymbol",i&&i[0]),n.setVisual("toSymbol",i&&i[1]),n.setVisual("fromSymbolSize",a&&a[0]),n.setVisual("toSymbolSize",a&&a[1]),n.setVisual("style",e.getModel("lineStyle").getLineStyle()),n.each(function(s){var o=n.getItemModel(s),l=r.getEdgeByIndex(s),u=_Y(o.getShallow("symbol",!0)),h=_Y(o.getShallow("symbolSize",!0)),d=o.getModel("lineStyle").getLineStyle(),f=n.ensureUniqueItemVisual(s,"style");switch(ot(f,d),f.stroke){case"source":{var p=l.node1.getVisual("style");f.stroke=p&&p.fill;break}case"target":{var p=l.node2.getVisual("style");f.stroke=p&&p.fill;break}}u[0]&&l.setVisual("fromSymbol",u[0]),u[1]&&l.setVisual("toSymbol",u[1]),h[0]&&l.setVisual("fromSymbolSize",h[0]),h[1]&&l.setVisual("toSymbolSize",h[1])})})}function Jct(t){var e=t.coordinateSystem;if(!(e&&e.type!=="view")){var r=t.getGraph();r.eachNode(function(n){var i=n.getModel();n.setLayout([+i.get("x"),+i.get("y")])}),Lme(r,t)}}function Lme(t,e){t.eachEdge(function(r,n){var i=Ch(r.getModel().get(["lineStyle","curveness"]),-Dme(r,e,n,!0),0),a=cm(r.node1.getLayout()),s=cm(r.node2.getLayout()),o=[a,s];+i&&o.push([(a[0]+s[0])/2-(a[1]-s[1])*i,(a[1]+s[1])/2-(s[0]-a[0])*i]),r.setLayout(o)})}var L8r=Ao(ku,M8r);function M8r(t,e){t.eachSeriesByType(ku,function(r){var n=r.get("layout"),i=r.coordinateSystem;if(i&&i.type!=="view"){var a=r.getData(),s=[];de(i.dimensions,function(f){s=s.concat(a.mapDimensionsAll(f))});for(var o=0;o0&&(A[0]=-A[0],A[1]=-A[1]);var T=w[0]<0?-1:1;if(a.__position!=="start"&&a.__position!=="end"){var O=-Math.atan2(w[1],w[0]);d[0].8?"left":f[0]<-.8?"right":"center",m=f[1]>.8?"top":f[1]<-.8?"bottom":"middle";break;case"start":a.x=-f[0]*y+h[0],a.y=-f[1]*b+h[1],g=f[0]>.8?"right":f[0]<-.8?"left":"center",m=f[1]>.8?"bottom":f[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":a.x=y*T+h[0],a.y=h[1]+k,g=w[0]<0?"right":"left",a.originX=-y*T,a.originY=-k;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":a.x=S[0],a.y=S[1]+k,g="center",a.originY=-k;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":a.x=-y*T+d[0],a.y=d[1]+k,g=w[0]>=0?"right":"left",a.originX=y*T,a.originY=-k;break}a.scaleX=a.scaleY=s,a.setStyle({verticalAlign:a.__verticalAlign||m,align:a.__align||g})}},e}(pr),zme=function(){function t(e){this.group=new pr,this._LineCtor=e||Fme}return t.prototype.updateData=function(e){var r=this;this._progressiveEls=null;var n=this,i=n.group,a=n._lineData;n._lineData=e,a||i.removeAll();var s=lut(e);e.diff(a).add(function(o){r._doAdd(e,o,s)}).update(function(o,l){r._doUpdate(a,e,l,o,s)}).remove(function(o){i.remove(a.getItemGraphicEl(o))}).execute()},t.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl(function(r,n){r.updateLayout(e,n)},this)},t.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=lut(e),this._lineData=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(e,r,n){this._progressiveEls=[];function i(l){!l.isGroup&&!Q8r(l)&&(l.incremental=n,l.ensureState("emphasis").hoverLayer=v_)}for(var a=e.start;a0}function lut(t){var e=t.hostModel,r=e.getModel("emphasis");return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:r.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:r.get("disabled"),blurScope:r.get("blurScope"),focus:r.get("focus"),labelStatesModels:To(e)}}function cut(t){return isNaN(t[0])||isNaN(t[1])}function Ume(t){return t&&!cut(t[0])&&!cut(t[1])}var Vme=[],Qme=[],Gme=[],l5=bl,Hme=nx,uut=Math.abs;function hut(t,e,r){for(var n=t[0],i=t[1],a=t[2],s=1/0,o,l=r*r,u=.1,h=.1;h<=.9;h+=.1){Vme[0]=l5(n[0],i[0],a[0],h),Vme[1]=l5(n[1],i[1],a[1],h);var d=uut(Hme(Vme,e)-l);d=0?o=o+u:o=o-u:g>=0?o=o-u:o=o+u}return o}function Wme(t,e){var r=[],n=yN,i=[[],[],[]],a=[[],[]],s=[];e/=2,t.eachEdge(function(o,l){var u=o.getLayout(),h=o.getVisual("fromSymbol"),d=o.getVisual("toSymbol");u.__original||(u.__original=[cm(u[0]),cm(u[1])],u[2]&&u.__original.push(cm(u[2])));var f=u.__original;if(u[2]!=null){if(tc(i[0],f[0]),tc(i[1],f[2]),tc(i[2],f[1]),h&&h!=="none"){var p=uB(o.node1),g=hut(i,f[0],p*e);n(i[0][0],i[1][0],i[2][0],g,r),i[0][0]=r[3],i[1][0]=r[4],n(i[0][1],i[1][1],i[2][1],g,r),i[0][1]=r[3],i[1][1]=r[4]}if(d&&d!=="none"){var p=uB(o.node2),g=hut(i,f[1],p*e);n(i[0][0],i[1][0],i[2][0],g,r),i[1][0]=r[1],i[2][0]=r[2],n(i[0][1],i[1][1],i[2][1],g,r),i[1][1]=r[1],i[2][1]=r[2]}tc(u[0],i[0]),tc(u[1],i[2]),tc(u[2],i[1])}else{if(tc(a[0],f[0]),tc(a[1],f[1]),rx(s,a[1],a[0]),AA(s,s),h&&h!=="none"){var p=uB(o.node1);mG(a[0],a[0],s,p*e)}if(d&&d!=="none"){var p=uB(o.node2);mG(a[1],a[1],s,-p*e)}tc(u[0],a[0]),tc(u[1],a[1])}})}var dut=Qr();function G8r(t){if(t)return dut(t).bridge}function fut(t,e){t&&(dut(t).bridge=e)}var H8r=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=ku,r}return e.prototype.init=function(r,n){var i=new M8,a=new zme,s=this.group,o=new pr;this._controller=new VS(n.getZr()),o.add(i.group),o.add(a.group),s.add(o),this._symbolDraw=i,this._lineDraw=a,this._mainGroup=o,this._firstRender=!0},e.prototype.render=function(r,n,i){var a=this,s=yY(r),o=!1;this._model=r,this._api=i,this._active=!0;var l=this._mainGroup,u=this._getThumbnailInfo();u&&u.bridge.reset(i);var h=this._symbolDraw,d=this._lineDraw;s&&Lx(l,Fm,s,this._firstRender?null:r),Wme(r.getGraph(),cB(r));var f=r.getData();h.updateData(f);var p=r.getEdgeData();d.updateData(p),this._updateNodeAndLinkScale(),s&&bY(r,i,this._controller,function(w,A,S){return r.coordinateSystem.containPoint([A,S])},null),clearTimeout(this._layoutTimeout);var g=r.forceLayout,m=r.get(["force","layoutAnimation"]);g&&(o=!0,this._startForceLayoutIteration(g,i,m));var v=r.get("layout");f.graph.eachNode(function(w){var A=w.dataIndex,S=w.getGraphicEl(),T=w.getModel();if(S){S.off("drag").off("dragend");var O=T.get("draggable");O&&S.on("drag",function(E){switch(v){case"force":g.warmUp(),!a._layouting&&a._startForceLayoutIteration(g,i,m),g.setFixed(A),f.setItemLayout(A,[S.x,S.y]);break;case"circular":f.setItemLayout(A,[S.x,S.y]),w.setLayout({fixed:!0},!0),Ime(r,"symbolSize",w,[E.offsetX,E.offsetY]),a.updateLayout(r);break;case"none":default:f.setItemLayout(A,[S.x,S.y]),Lme(r.getGraph(),r),a.updateLayout(r);break}}).on("dragend",function(){g&&g.setUnfixed(A)}),S.setDraggable(O,!!T.get("cursor"));var k=T.get(["emphasis","focus"]);k==="adjacency"&&(Cr(S).focus=w.getAdjacentDataIndices())}}),f.graph.eachEdge(function(w){var A=w.getGraphicEl(),S=w.getModel().get(["emphasis","focus"]);A&&S==="adjacency"&&(Cr(A).focus={edge:[w.dataIndex],node:[w.node1.dataIndex,w.node2.dataIndex]})});var y=r.get("layout")==="circular"&&r.get(["circular","rotateLabel"]),b=f.getLayout("cx"),x=f.getLayout("cy");f.graph.eachNode(function(w){tut(w,y,b,x)}),this._firstRender=!1,o||this._renderThumbnail(r,i,this._symbolDraw,this._lineDraw)},e.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose()},e.prototype._startForceLayoutIteration=function(r,n,i){var a=this,s=!1;(function o(){r.step(function(l){a.updateLayout(a._model),(l||!s)&&(s=!0,a._renderThumbnail(a._model,n,a._symbolDraw,a._lineDraw)),(a._layouting=!l)&&(i?a._layoutTimeout=setTimeout(o,16):o())})})()},e.prototype.__updateOnOwnRoam=function(r,n,i){var a=yY(n);!this._active||!a||(Lx(this._mainGroup,Fm,a,null),rct(r)&&(this._updateNodeAndLinkScale(),Wme(n.getGraph(),cB(n)),this._lineDraw.updateLayout(),i.updateLabelLayout()),this._updateThumbnailWindow())},e.prototype._updateNodeAndLinkScale=function(){var r=this._model,n=r.getData(),i=cB(r);n.eachItemGraphicEl(function(a,s){a&&a.setSymbolScale(i)})},e.prototype.updateLayout=function(r){this._active&&(Wme(r.getGraph(),cB(r)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout())},e.prototype.remove=function(){this._active=!1,clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove(),this._controller&&this._controller.disable()},e.prototype._getThumbnailInfo=function(){var r=this._model,n=r.coordinateSystem;if(n.type==="view"){var i=G8r(r);if(i)return{bridge:i,coordSys:n}}},e.prototype._updateThumbnailWindow=function(){var r=this._getThumbnailInfo();r&&r.bridge.updateWindow(fY(null,r.coordSys),this._api)},e.prototype._renderThumbnail=function(r,n,i,a){var s=this._getThumbnailInfo();if(s){var o=new pr,l=i.group.children(),u=a.group.children(),h=new pr,d=new pr;o.add(d),o.add(h);for(var f=0;f "),value:a.value,noValue:a.value==null})}return no("nameValue",{name:a.name,value:a.value,noValue:a.value==null})},e.prototype.getDataParams=function(r,n){var i=t.prototype.getDataParams.call(this,r,n);if(n==="node"){var a=this.getData(),s=this.getGraph().getNodeByIndex(r);if(i.name==null&&(i.name=a.getName(r)),i.value==null){var o=s.getLayout().value;i.value=o}}return i},e.type="series."+hB,e.defaultOption={z:2,coordinateSystem:"none",legendHoverLink:!0,colorBy:"data",left:0,top:0,right:0,bottom:0,width:null,height:null,center:["50%","50%"],radius:["70%","80%"],clockwise:!0,startAngle:90,endAngle:"auto",minAngle:0,padAngle:3,itemStyle:{borderRadius:[0,0,5,5]},lineStyle:{width:0,color:"source",opacity:.2},label:{show:!0,position:"outside",distance:5},emphasis:{focus:"adjacency",lineStyle:{opacity:.5}}},e}(Ri),put=function(t){rt(e,t);function e(r,n,i){var a=t.call(this)||this;Cr(a).dataType="node",a.z2=2;var s=new Pn;return a.setTextContent(s),a.updateData(r,n,i,!0),a}return e.prototype.updateData=function(r,n,i,a){var s=this,o=r.graph.getNodeByIndex(n),l=r.hostModel,u=o.getModel(),h=u.getModel("emphasis"),d=r.getItemLayout(n),f=ot($m(u.getModel("itemStyle"),d,!0),d),p=this;if(isNaN(f.startAngle)){p.setShape(f);return}a?p.setShape(f):Hn(p,{shape:f},l,n);var g=ot($m(u.getModel("itemStyle"),d,!0),d);s.setShape(g),s.useStyle(r.getItemVisual(n,"style")),So(s,u),this._updateLabel(l,u,o),r.setItemGraphicEl(n,p),So(p,u,"itemStyle");var m=h.get("focus");wa(this,m==="adjacency"?o.getAdjacentDataIndices():m,h.get("blurScope"),h.get("disabled"))},e.prototype._updateLabel=function(r,n,i){var a=this.getTextContent(),s=i.getLayout(),o=(s.startAngle+s.endAngle)/2,l=Math.cos(o),u=Math.sin(o),h=n.getModel("label");a.ignore=!h.get("show");var d=To(n),f=i.getVisual("style");qo(a,d,{labelFetcher:{getFormattedLabel:function(b,x,w,A,S,T){return r.getFormattedLabel(b,x,"node",A,Ch(S,d.normal&&d.normal.get("formatter"),n.get("name")),T)}},labelDataIndex:i.dataIndex,defaultText:i.dataIndex+"",inheritColor:f.fill,defaultOpacity:f.opacity,defaultOutsidePosition:"startArc"});var p=h.get("position")||"outside",g=h.get("distance")||0,m;p==="outside"?m=s.r+g:m=(s.r+s.r0)/2,this.textConfig={inside:p!=="outside"};var v=p!=="outside"?h.get("align")||"center":l>0?"left":"right",y=p!=="outside"?h.get("verticalAlign")||"middle":u>0?"top":"bottom";a.attr({x:l*m+s.cx,y:u*m+s.cy,rotation:0,style:{align:v,verticalAlign:y}})},e}(nc),Z8r=function(t){rt(e,t);function e(r,n,i,a){var s=t.call(this)||this;return Cr(s).dataType="edge",s.updateData(r,n,i,a,!0),s}return e.prototype.buildPath=function(r,n){r.moveTo(n.s1[0],n.s1[1]);var i=.7,a=n.clockwise;r.arc(n.cx,n.cy,n.r,n.sStartAngle,n.sEndAngle,!a),r.bezierCurveTo((n.cx-n.s2[0])*i+n.s2[0],(n.cy-n.s2[1])*i+n.s2[1],(n.cx-n.t1[0])*i+n.t1[0],(n.cy-n.t1[1])*i+n.t1[1],n.t1[0],n.t1[1]),r.arc(n.cx,n.cy,n.r,n.tStartAngle,n.tEndAngle,!a),r.bezierCurveTo((n.cx-n.t2[0])*i+n.t2[0],(n.cy-n.t2[1])*i+n.t2[1],(n.cx-n.s1[0])*i+n.s1[0],(n.cy-n.s1[1])*i+n.s1[1],n.s1[0],n.s1[1]),r.closePath()},e.prototype.updateData=function(r,n,i,a,s){var o=r.hostModel,l=n.graph.getEdgeByIndex(i),u=l.getLayout(),h=l.node1.getModel(),d=n.getItemModel(l.dataIndex),f=d.getModel("lineStyle"),p=d.getModel("emphasis"),g=p.get("focus"),m=ot($m(h.getModel("itemStyle"),u,!0),u),v=this;if(isNaN(m.sStartAngle)||isNaN(m.tStartAngle)){v.setShape(m);return}s?(v.setShape(m),gut(v,l,r,f)):(zf(v),gut(v,l,r,f),Hn(v,{shape:m},o,i)),wa(this,g==="adjacency"?l.getAdjacentDataIndices():g,p.get("blurScope"),p.get("disabled")),So(v,d,"lineStyle"),n.setItemGraphicEl(l.dataIndex,v)},e}(vn);function gut(t,e,r,n){var i=e.node1,a=e.node2,s=t.style;t.setStyle(n.getLineStyle());var o=n.get("color");switch(o){case"source":s.fill=r.getItemVisual(i.dataIndex,"style").fill,s.decal=i.getVisual("style").decal;break;case"target":s.fill=r.getItemVisual(a.dataIndex,"style").fill,s.decal=a.getVisual("style").decal;break;case"gradient":var l=r.getItemVisual(i.dataIndex,"style").fill,u=r.getItemVisual(a.dataIndex,"style").fill;if(Nt(l)&&Nt(u)){var h=t.shape,d=(h.s1[0]+h.s2[0])/2,f=(h.s1[1]+h.s2[1])/2,p=(h.t1[0]+h.t2[0])/2,g=(h.t1[1]+h.t2[1])/2;s.fill=new tS(d,f,p,g,[{offset:0,color:l},{offset:1,color:u}],!0)}break}}var J8r=Math.PI/180,eBr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=hB,r}return e.prototype.init=function(r,n){},e.prototype.render=function(r,n,i){var a=r.getData(),s=this._data,o=this.group,l=-r.get("startAngle")*J8r;if(a.diff(s).add(function(h){var d=a.getItemLayout(h);if(d){var f=new put(a,h,l);Cr(f).dataIndex=h,o.add(f)}}).update(function(h,d){var f=s.getItemGraphicEl(d),p=a.getItemLayout(h);if(!p){f&&cy(f,r,d);return}f?f.updateData(a,h,l):f=new put(a,h,l),o.add(f)}).remove(function(h){var d=s.getItemGraphicEl(h);d&&cy(d,r,h)}).execute(),!s){var u=r.get("center");this.group.scaleX=.01,this.group.scaleY=.01,this.group.originX=Qt(u[0],i.getWidth()),this.group.originY=Qt(u[1],i.getHeight()),ia(this.group,{scaleX:1,scaleY:1},r)}this._data=a,this.renderEdges(r,l)},e.prototype.renderEdges=function(r,n){var i=r.getData(),a=r.getEdgeData(),s=this._edgeData,o=this.group;a.diff(s).add(function(l){var u=new Z8r(i,a,l,n);Cr(u).dataIndex=l,o.add(u)}).update(function(l,u){var h=s.getItemGraphicEl(u);h.updateData(i,a,l,n),o.add(h)}).remove(function(l){var u=s.getItemGraphicEl(l);u&&cy(u,r,l)}).execute(),this._edgeData=a},e.prototype.dispose=function(){},e.type=hB,e}(Si),Yme=Math.PI/180,tBr=Ao(hB,rBr);function rBr(t,e){t.eachSeriesByType(hB,function(r){nBr(r,e)})}function nBr(t,e){var r=t.getData(),n=r.graph,i=t.getEdgeData(),a=i.count();if(a){var s=krt(t,e),o=s.cx,l=s.cy,u=s.r,h=s.r0,d=Math.max((t.get("padAngle")||0)*Yme,0),f=Math.max((t.get("minAngle")||0)*Yme,0),p=-t.get("startAngle")*Yme,g=p+Math.PI*2,m=t.get("clockwise"),v=m?1:-1,y=[p,g];uH(y,!m);var b=y[0],x=y[1],w=x-b,A=r.getSum("value")===0&&i.getSum("value")===0,S=[],T=0;n.eachEdge(function(N){var F=A?1:N.getValue("value");A&&(F>0||f)&&(T+=2);var B=N.node1.dataIndex,V=N.node2.dataIndex;S[B]=(S[B]||0)+F,S[V]=(S[V]||0)+F});var O=0;if(n.eachNode(function(N){var F=N.getValue("value");isNaN(F)||(S[N.dataIndex]=Math.max(F,S[N.dataIndex]||0)),!A&&(S[N.dataIndex]>0||f)&&T++,O+=S[N.dataIndex]||0}),!(T===0||O===0)){d*T>=Math.abs(w)&&(d=Math.max(0,(Math.abs(w)-f*T)/T)),(d+f)*T>=Math.abs(w)&&(f=(Math.abs(w)-d*T)/T);var k=(w-d*T*v)/O,E=0,_=0,I=0;n.eachNode(function(N){var F=S[N.dataIndex]||0,B=k*(O?F:1)*v;Math.abs(B)_){var R=E/_;n.eachNode(function(N){var F=N.getLayout().angle;Math.abs(F)>=f?N.setLayout({angle:F*R,ratio:R},!0):N.setLayout({angle:f,ratio:f===0?1:F/f},!0)})}else n.eachNode(function(N){if(!L){var F=N.getLayout().angle,B=Math.min(F/I,1),V=B*E;F-Vf&&f>0){var B=L?1:Math.min(F/I,1),V=F-f,z=Math.min(V,Math.min(D,E*B));D-=z,N.setLayout({angle:F-z,ratio:(F-z)/F},!0)}else f>0&&N.setLayout({angle:f,ratio:F===0?1:f/F},!0)}});var M=b,P=[];n.eachNode(function(N){var F=Math.max(N.getLayout().angle,f);N.setLayout({cx:o,cy:l,r0:h,r:u,startAngle:M,endAngle:M+F*v,clockwise:m},!0),P[N.dataIndex]=M,M+=(F+d)*v}),n.eachEdge(function(N){var F=A?1:N.getValue("value"),B=k*(O?F:1)*v,V=N.node1.dataIndex,z=P[V]||0,U=Math.abs((N.node1.getLayout().ratio||1)*B),Q=z+U*v,G=[o+h*Math.cos(z),l+h*Math.sin(z)],X=[o+h*Math.cos(Q),l+h*Math.sin(Q)],Y=N.node2.dataIndex,le=P[Y]||0,q=Math.abs((N.node2.getLayout().ratio||1)*B),Z=le+q*v,ee=[o+h*Math.cos(le),l+h*Math.sin(le)],re=[o+h*Math.cos(Z),l+h*Math.sin(Z)];N.setLayout({s1:G,s2:X,sStartAngle:z,sEndAngle:Q,t1:ee,t2:re,tStartAngle:le,tEndAngle:Z,cx:o,cy:l,r:h,value:F,clockwise:m}),P[V]=Q,P[Y]=Z})}}}function iBr(t){t.registerChartView(eBr),t.registerSeriesModel(K8r),t.registerLayout(t.PRIORITY.VISUAL.POST_CHART_LAYOUT,tBr),t.registerProcessor(V8("chord"))}var aBr=function(){function t(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return t}(),sBr=function(t){rt(e,t);function e(r){var n=t.call(this,r)||this;return n.type="pointer",n}return e.prototype.getDefaultShape=function(){return new aBr},e.prototype.buildPath=function(r,n){var i=Math.cos,a=Math.sin,s=n.r,o=n.width,l=n.angle,u=n.x-i(l)*o*(o>=s/3?1:2),h=n.y-a(l)*o*(o>=s/3?1:2);l=n.angle-Math.PI/2,r.moveTo(u,h),r.lineTo(n.x+i(l)*o,n.y+a(l)*o),r.lineTo(n.x+i(n.angle)*s,n.y+a(n.angle)*s),r.lineTo(n.x-i(l)*o,n.y-a(l)*o),r.lineTo(u,h)},e}(vn);function oBr(t,e){var r=t.get("center"),n=e.getWidth(),i=e.getHeight(),a=Math.min(n,i),s=Qt(r[0],e.getWidth()),o=Qt(r[1],e.getHeight()),l=Qt(t.get("radius"),a/2);return{cx:s,cy:o,r:l}}function RY(t,e){var r=t==null?"":t+"";return e&&(Nt(e)?r=e.replace("{value}",r):ur(e)&&(r=e(t))),r}var lBr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){this.group.removeAll();var a=r.get(["axisLine","lineStyle","color"]),s=oBr(r,i);this._renderMain(r,n,i,a,s),this._data=r.getData()},e.prototype.dispose=function(){},e.prototype._renderMain=function(r,n,i,a,s){var o=this.group,l=r.get("clockwise"),u=-r.get("startAngle")/180*Math.PI,h=-r.get("endAngle")/180*Math.PI,d=r.getModel("axisLine"),f=d.get("roundCap"),p=f?KW:nc,g=d.get("show"),m=d.getModel("lineStyle"),v=m.get("width"),y=[u,h];uH(y,!l),u=y[0],h=y[1];for(var b=h-u,x=u,w=[],A=0;g&&A=k&&(E===0?0:a[E-1][0])Math.PI/2&&(Q+=Math.PI)):U==="tangential"?Q=-O-Math.PI/2:zn(U)&&(Q=U*Math.PI/180),Q===0?d.add(new Pn({style:Gi(x,{text:F,x:V,y:z,verticalAlign:D<-.8?"top":D>.8?"bottom":"middle",align:R<-.4?"left":R>.4?"right":"center"},{inheritColor:B}),silent:!0})):d.add(new Pn({style:Gi(x,{text:F,x:V,y:z,verticalAlign:"middle",align:"center"},{inheritColor:B}),silent:!0,originX:V,originY:z,rotation:Q}))}if(b.get("show")&&M!==w){var P=b.get("distance");P=P?P+h:h;for(var G=0;G<=A;G++){R=Math.cos(O),D=Math.sin(O);var X=new Ps({shape:{x1:R*(g-P)+f,y1:D*(g-P)+p,x2:R*(g-T-P)+f,y2:D*(g-T-P)+p},silent:!0,style:I});I.stroke==="auto"&&X.setStyle({stroke:a((M+G/A)/w)}),d.add(X),O+=E}O-=E}else O+=k}},e.prototype._renderPointer=function(r,n,i,a,s,o,l,u,h){var d=this.group,f=this._data,p=this._progressEls,g=[],m=r.get(["pointer","show"]),v=r.getModel("progress"),y=v.get("show"),b=r.getData(),x=b.mapDimension("value"),w=+r.get("min"),A=+r.get("max"),S=[w,A],T=[o,l];function O(E,_){var I=b.getItemModel(E),L=I.getModel("pointer"),R=Qt(L.get("width"),s.r),D=Qt(L.get("length"),s.r),M=r.get(["pointer","icon"]),P=L.get("offsetCenter"),N=Qt(P[0],s.r),F=Qt(P[1],s.r),B=L.get("keepAspect"),V;return M?V=$s(M,N-R/2,F-D,R,D,null,B):V=new sBr({shape:{angle:-Math.PI/2,width:R,r:D,x:N,y:F}}),V.rotation=-(_+Math.PI/2),V.x=s.cx,V.y=s.cy,V}function k(E,_){var I=v.get("roundCap"),L=I?KW:nc,R=v.get("overlap"),D=R?v.get("width"):h/b.count(),M=R?s.r-D:s.r-(E+1)*D,P=R?s.r:s.r-E*D,N=new L({shape:{startAngle:o,endAngle:_,cx:s.cx,cy:s.cy,clockwise:u,r0:M,r:P}});return R&&(N.z2=jn(b.get(x,E),[w,A],[100,0],!0)),N}(y||m)&&(b.diff(f).add(function(E){var _=b.get(x,E);if(m){var I=O(E,o);ia(I,{rotation:-((isNaN(+_)?T[0]:jn(_,S,T,!0))+Math.PI/2)},r),d.add(I),b.setItemGraphicEl(E,I)}if(y){var L=k(E,o),R=v.get("clip");ia(L,{shape:{endAngle:jn(_,S,T,R)}},r),d.add(L),Fde(r.seriesIndex,b.dataType,E,L),g[E]=L}}).update(function(E,_){var I=b.get(x,E);if(m){var L=f.getItemGraphicEl(_),R=L?L.rotation:o,D=O(E,R);D.rotation=R,Hn(D,{rotation:-((isNaN(+I)?T[0]:jn(I,S,T,!0))+Math.PI/2)},r),d.add(D),b.setItemGraphicEl(E,D)}if(y){var M=p[_],P=M?M.shape.endAngle:o,N=k(E,P),F=v.get("clip");Hn(N,{shape:{endAngle:jn(I,S,T,F)}},r),d.add(N),Fde(r.seriesIndex,b.dataType,E,N),g[E]=N}}).execute(),b.each(function(E){var _=b.getItemModel(E),I=_.getModel("emphasis"),L=I.get("focus"),R=I.get("blurScope"),D=I.get("disabled"),M=a(jn(b.get(x,E),S,[0,1],!0));if(m){var P=b.getItemGraphicEl(E),N=b.getItemVisual(E,"style"),F=N.fill;if(P instanceof Yo){var B=P.style;P.useStyle(ot({image:B.image,x:B.x,y:B.y,width:B.width,height:B.height},N))}else P.useStyle(N),P.type!=="pointer"&&P.setColor(F);P.setStyle(_.getModel(["pointer","itemStyle"]).getItemStyle()),P.style.fill==="auto"&&P.setStyle("fill",M),P.z2EmphasisLift=0,So(P,_),wa(P,L,R,D)}if(y){var V=g[E];V.useStyle(b.getItemVisual(E,"style")),V.setStyle(_.getModel(["progress","itemStyle"]).getItemStyle()),V.style.fill==="auto"&&V.setStyle("fill",M),V.z2EmphasisLift=0,So(V,_),wa(V,L,R,D)}}),this._progressEls=g)},e.prototype._renderAnchor=function(r,n){var i=r.getModel("anchor"),a=i.get("show");if(a){var s=i.get("size"),o=i.get("icon"),l=i.get("offsetCenter"),u=i.get("keepAspect"),h=$s(o,n.cx-s/2+Qt(l[0],n.r),n.cy-s/2+Qt(l[1],n.r),s,s,null,u);h.z2=i.get("showAbove")?1:0,h.setStyle(i.getModel("itemStyle").getItemStyle()),this.group.add(h)}},e.prototype._renderTitleAndDetail=function(r,n,i,a,s){var o=this,l=r.getData(),u=l.mapDimension("value"),h=+r.get("min"),d=+r.get("max"),f=new pr,p=[],g=[],m=r.isAnimationEnabled(),v=r.get(["pointer","showAbove"]);l.diff(this._data).add(function(y){p[y]=new Pn({silent:!0}),g[y]=new Pn({silent:!0})}).update(function(y,b){p[y]=o._titleEls[b],g[y]=o._detailEls[b]}).execute(),l.each(function(y){var b=l.getItemModel(y),x=l.get(u,y),w=new pr,A=a(jn(x,[h,d],[0,1],!0)),S=b.getModel("title");if(S.get("show")){var T=S.get("offsetCenter"),O=s.cx+Qt(T[0],s.r),k=s.cy+Qt(T[1],s.r),E=p[y];E.attr({z2:v?0:2,style:Gi(S,{x:O,y:k,text:l.getName(y),align:"center",verticalAlign:"middle"},{inheritColor:A})}),w.add(E)}var _=b.getModel("detail");if(_.get("show")){var I=_.get("offsetCenter"),L=s.cx+Qt(I[0],s.r),R=s.cy+Qt(I[1],s.r),D=Qt(_.get("width"),s.r),M=Qt(_.get("height"),s.r),P=r.get(["progress","show"])?l.getItemVisual(y,"style").fill:A,E=g[y],N=_.get("formatter");E.attr({z2:v?0:2,style:Gi(_,{x:L,y:R,text:RY(x,N),width:isNaN(D)?null:D,height:isNaN(M)?null:M,align:"center",verticalAlign:"middle"},{inheritColor:P})}),trt(E,{normal:_},x,function(B){return RY(B,N)}),m&&rrt(E,y,l,r,{getFormattedLabel:function(B,V,z,U,Q,G){return RY(G?G.interpolatedValue:x,N)}}),w.add(E)}f.add(w)}),this.group.add(f),this._titleEls=p,this._detailEls=g},e.type="gauge",e}(Si),cBr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.visualStyleAccessPath="itemStyle",r}return e.prototype.getInitialData=function(r,n){return t5(this,["value"])},e.type="series.gauge",e.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,et.color.neutral10]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:et.color.axisTick,width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:et.color.axisTickMinor,width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:et.color.axisLabel,fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:et.color.neutral00,borderWidth:0,borderColor:et.color.theme[0]}},title:{show:!0,offsetCenter:[0,"20%"],color:et.color.secondary,fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:et.color.transparent,borderWidth:0,borderColor:et.color.neutral40,width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:et.color.primary,fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},e}(Ri);function uBr(t){t.registerChartView(lBr),t.registerSeriesModel(cBr)}var c5="funnel",hBr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new r5(Ht(this.getData,this),Ht(this.getRawData,this)),this._defaultLabelLine(r)},e.prototype.getInitialData=function(r,n){return t5(this,{coordDimensions:["value"],encodeDefaulter:qr(Ffe,this)})},e.prototype._defaultLabelLine=function(r){$A(r,"labelLine",["show"]);var n=r.labelLine,i=r.emphasis.labelLine;n.show=n.show&&r.label.show,i.show=i.show&&r.emphasis.label.show},e.prototype.getDataParams=function(r){var n=this.getData(),i=t.prototype.getDataParams.call(this,r),a=n.mapDimension("value"),s=n.getSum(a);return i.percent=s?+(n.get(a,r)/s*100).toFixed(2):0,i.$vars.push("percent"),i},e.type="series."+c5,e.defaultOption={coordinateSystemUsage:"box",z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:65,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:et.color.neutral00,borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:et.color.primary}}},e}(Ri),dBr=["itemStyle","opacity"],fBr=function(t){rt(e,t);function e(r,n){var i=t.call(this)||this,a=i,s=new Al,o=new Pn;return a.setTextContent(o),i.setTextGuideLine(s),i.updateData(r,n,!0),i}return e.prototype.updateData=function(r,n,i){var a=this,s=r.hostModel,o=r.getItemModel(n),l=r.getItemLayout(n),u=o.getModel("emphasis"),h=o.get(dBr);h=h??1,i||zf(a),a.useStyle(r.getItemVisual(n,"style")),a.style.lineJoin="round",i?(a.setShape({points:l.points}),a.style.opacity=0,ia(a,{style:{opacity:h}},s,n)):Hn(a,{style:{opacity:h},shape:{points:l.points}},s,n),So(a,o),this._updateLabel(r,n),wa(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(r,n){var i=this,a=this.getTextGuideLine(),s=i.getTextContent(),o=r.hostModel,l=r.getItemModel(n),u=r.getItemLayout(n),h=u.label,d=r.getItemVisual(n,"style"),f=d.fill;qo(s,To(l),{labelFetcher:r.hostModel,labelDataIndex:n,defaultOpacity:d.opacity,defaultText:r.getName(n)},{normal:{align:h.textAlign,verticalAlign:h.verticalAlign}});var p=l.getModel("label"),g=p.get("color"),m=g==="inherit"?f:null;i.setTextConfig({local:!0,inside:!!h.inside,insideStroke:m,outsideFill:m});var v=h.linePoints;a.setShape({points:v}),i.textGuideLineConfig={anchor:v?new wr(v[0][0],v[0][1]):null},Hn(s,{style:{x:h.x,y:h.y}},o,n),s.attr({rotation:h.rotation,originX:h.x,originY:h.y,z2:10}),nge(i,ige(l),{stroke:f})},e}(ic),pBr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=c5,r.ignoreLabelLineUpdate=!0,r}return e.prototype.render=function(r,n,i){var a=r.getData(),s=this._data,o=this.group;a.diff(s).add(function(l){var u=new fBr(a,l);a.setItemGraphicEl(l,u),o.add(u)}).update(function(l,u){var h=s.getItemGraphicEl(u);h.updateData(a,l),o.add(h),a.setItemGraphicEl(l,h)}).remove(function(l){var u=s.getItemGraphicEl(l);cy(u,r,l)}).execute(),this._data=a},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.prototype.dispose=function(){},e.type=c5,e}(Si);function gBr(t,e){for(var r=t.mapDimension("value"),n=t.mapArray(r,function(l){return l}),i=[],a=e==="ascending",s=0,o=t.count();s-1&&(s="left"),r&&Ir(["left","right"],s)>-1&&(s="bottom")),s==="left"?(m=(u[3][0]+u[0][0])/2,v=(u[3][1]+u[0][1])/2,y=m-x,f=y-5,d="right"):s==="right"?(m=(u[1][0]+u[2][0])/2,v=(u[1][1]+u[2][1])/2,y=m+x,f=y+5,d="left"):s==="top"?(m=(u[3][0]+u[0][0])/2,v=(u[3][1]+u[0][1])/2,b=v-x,p=b-5,d="center"):s==="bottom"?(m=(u[1][0]+u[2][0])/2,v=(u[1][1]+u[2][1])/2,b=v+x,p=b+5,d="center"):s==="rightTop"?(m=r?u[3][0]:u[1][0],v=r?u[3][1]:u[1][1],r?(b=v-x,p=b-5,d="center"):(y=m+x,f=y+5,d="top")):s==="rightBottom"?(m=u[2][0],v=u[2][1],r?(b=v+x,p=b+5,d="center"):(y=m+x,f=y+5,d="bottom")):s==="leftTop"?(m=u[0][0],v=r?u[0][1]:u[1][1],r?(b=v-x,p=b-5,d="center"):(y=m-x,f=y-5,d="right")):s==="leftBottom"?(m=r?u[1][0]:u[3][0],v=r?u[1][1]:u[2][1],r?(b=v+x,p=b+5,d="center"):(y=m-x,f=y-5,d="right")):(m=(u[1][0]+u[2][0])/2,v=(u[1][1]+u[2][1])/2,r?(b=v+x,p=b+5,d="center"):(y=m+x,f=y+5,d="left")),r?(y=m,f=y):(b=v,p=b),g=[[m,v],[y,b]]}l.label={linePoints:g,x:f,y:p,verticalAlign:"middle",textAlign:d,inside:h}})}var vBr=Ao(c5,yBr);function yBr(t,e){t.eachSeriesByType(c5,function(r){var n=r.getData(),i=n.mapDimension("value"),a=r.get("sort"),s=Co(r,e),o=da(r.getBoxLayoutParams(),s.refContainer),l=mut(r),u=o.width,h=o.height,d=gBr(n,a),f=o.x,p=o.y,g=l?[Qt(r.get("minSize"),h),Qt(r.get("maxSize"),h)]:[Qt(r.get("minSize"),u),Qt(r.get("maxSize"),u)],m=n.getDataExtent(i),v=r.get("min"),y=r.get("max");v==null&&(v=Math.min(m[0],0)),y==null&&(y=m[1]);var b=r.get("funnelAlign"),x=r.get("gap"),w=l?u:h,A=(w-x*(n.count()-1))/n.count(),S=function(D,M){if(l){var P=n.get(i,D)||0,N=jn(P,[v,y],g,!0),F=void 0;switch(b){case"top":F=p;break;case"center":F=p+(h-N)/2;break;case"bottom":F=p+(h-N);break}return[[M,F],[M,F+N]]}var B=n.get(i,D)||0,V=jn(B,[v,y],g,!0),z;switch(b){case"left":z=f;break;case"center":z=f+(u-V)/2;break;case"right":z=f+u-V;break}return[[z,M],[z+V,M]]};a==="ascending"&&(A=-A,x=-x,l?f+=u:p+=h,d=d.reverse());for(var T=0;TLBr)return;var i=this._model.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]);i.behavior!=="none"&&this._dispatchExpand({axisExpandWindow:i.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(t){if(!(this._mouseDownPoint||!jme(this,"mousemove"))){var e=this._model,r=e.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]),n=r.behavior;n==="jump"&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand(n==="none"?null:{axisExpandWindow:r.axisExpandWindow,animation:n==="jump"?null:{duration:0}})}}};function jme(t,e){var r=t._model;return r.get("axisExpandable")&&r.get("axisExpandTriggerOn")===e}var DY="parallel",Xme=DY,PBr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(){t.prototype.init.apply(this,arguments),this.mergeOption({})},e.prototype.mergeOption=function(r){var n=this.option;r&&Vr(n,r,!0),this._initDimensions()},e.prototype.contains=function(r,n){var i=r.get("parallelIndex");return i!=null&&n.getComponent("parallel",i)===this},e.prototype.setAxisExpand=function(r){de(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],function(n){r.hasOwnProperty(n)&&(this.option[n]=r[n])},this)},e.prototype._initDimensions=function(){var r=this.dimensions=[],n=this.parallelAxisIndex=[],i=ni(this.ecModel.queryComponents({mainType:"parallelAxis"}),function(a){return(a.get("parallelIndex")||0)===this.componentIndex},this);de(i,function(a){r.push("dim"+a.get("dim")),n.push(a.componentIndex)})},e.type=Xme,e.dependencies=["parallelAxis"],e.layoutMode="box",e.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},e}(fn),NBr=function(t){rt(e,t);function e(r,n,i,a,s){var o=t.call(this,r,n,i)||this;return o.type=a||"value",o.axisIndex=s,o}return e.prototype.isHorizontal=function(){return this.coordinateSystem.getModel().get("layout")!=="horizontal"},e}(Wf);function Ix(t,e,r,n,i,a){t=t||0;var s=NA(r[1],-r[0]);if(i!=null&&(i=u5(i,[0,s])),a!=null&&(a=Math.max(a,i??0)),n==="all"){var o=Math.abs(NA(e[1],-e[0]));o=u5(o,[0,s]),i=a=u5(o,[i,a]),n=0}e[0]=u5(e[0],r),e[1]=u5(e[1],r);var l=Kme(e,n);e[n]+=t;var u=i||0,h=r.slice();l.sign<0?h[0]=NA(h[0],u):h[1]=NA(h[1],-u),e[n]=u5(e[n],h);var d;return d=Kme(e,n),i!=null&&(d.sign!==l.sign||d.spana&&(e[1-n]=NA(e[n],d.sign*a)),e}function Kme(t,e){var r=t[e]-t[1-e];return{span:Math.abs(r),sign:r>0?-1:r<0?1:e?-1:1}}function u5(t,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,t))}var BBr=function(){function t(e,r,n){this.type=DY,this._axesMap=Yt(),this._axesLayout={},this.dimensions=e.dimensions,this._model=e,this._init(e,r,n)}return t.prototype._init=function(e,r,n){var i=e.dimensions,a=e.parallelAxisIndex;de(i,function(s,o){var l=a[o],u=r.getComponent("parallelAxis",l),h=w8(u),d=this._axesMap.set(s,new NBr(s,G_(u,h,!1),[0,0],h,l));d.onBand=T8(d.scale,u),d.inverse=u.get("inverse"),u.axis=d,d.model=u,d.coordinateSystem=u.coordinateSystem=this},this)},t.prototype.update=function(e,r){de(this.dimensions,function(n){var i=this._axesMap.get(n);ES(i,j_),X_(i)},this)},t.prototype.containPoint=function(e){var r=this._makeLayoutInfo(),n=r.axisBase,i=r.layoutBase,a=r.pixelDimIndex,s=e[1-a],o=e[a];return s>=n&&s<=n+r.axisLength&&o>=i&&o<=i+r.layoutLength},t.prototype.getModel=function(){return this._model},t.prototype.resize=function(e,r){var n=Co(e,r).refContainer;this._rect=da(e.getBoxLayoutParams(),n),this._layoutAxes()},t.prototype.getRect=function(){return this._rect},t.prototype._makeLayoutInfo=function(){var e=this._model,r=this._rect,n=["x","y"],i=["width","height"],a=e.get("layout"),s=a==="horizontal"?0:1,o=r[i[s]],l=[0,o],u=this.dimensions.length,h=LY(e.get("axisExpandWidth"),l),d=LY(e.get("axisExpandCount")||0,[0,u]),f=e.get("axisExpandable")&&u>3&&u>d&&d>1&&h>0&&o>0,p=e.get("axisExpandWindow"),g;if(p)g=LY(p[1]-p[0],l),p[1]=p[0]+g;else{g=LY(h*(d-1),l);var m=e.get("axisExpandCenter")||Nf(u/2);p=[h*m-g/2],p[1]=p[0]+g}var v=(o-g)/(u-d);v<3&&(v=0);var y=[Nf(Gn(p[0]/h,1))+1,MA(Gn(p[1]/h,1))-1],b=v/h*p[0];return{layout:a,pixelDimIndex:s,layoutBase:r[n[s]],layoutLength:o,axisBase:r[n[1-s]],axisLength:r[i[1-s]],axisExpandable:f,axisExpandWidth:h,axisCollapseWidth:v,axisExpandWindow:p,axisCount:u,winInnerIndices:y,axisExpandWindow0Pos:b}},t.prototype._layoutAxes=function(){var e=this._rect,r=this._axesMap,n=this.dimensions,i=this._makeLayoutInfo(),a=i.layout;r.each(function(s){var o=[0,i.axisLength],l=s.inverse?1:0;s.setExtent(o[l],o[1-l])}),de(n,function(s,o){var l=(i.axisExpandable?FBr:$Br)(o,i),u={horizontal:{x:l.position,y:i.axisLength},vertical:{x:0,y:l.position}},h={horizontal:XG/2,vertical:0},d=[u[a].x+e.x,u[a].y+e.y],f=h[a],p=xa();Zv(p,p,f),zp(p,p,d),this._axesLayout[s]={position:d,rotation:f,transform:p,axisNameAvailableWidth:l.axisNameAvailableWidth,axisLabelShow:l.axisLabelShow,nameTruncateMaxWidth:l.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},t.prototype.getAxis=function(e){return this._axesMap.get(e)},t.prototype.dataToPoint=function(e,r){return this.axisCoordToPoint(this._axesMap.get(r).dataToCoord(e),r)},t.prototype.eachActiveState=function(e,r,n,i){n==null&&(n=0),i==null&&(i=e.count());var a=this._axesMap,s=this.dimensions,o=[],l=[];de(s,function(v){o.push(e.mapDimension(v)),l.push(a.get(v).model)});for(var u=this.hasAxisBrushed(),h=n;ha*(1-d[0])?(u="jump",l=o-a*(1-d[2])):(l=o-a*d[1])>=0&&(l=o-a*(1-d[1]))<=0&&(l=0),l*=r.axisExpandWidth/h,l?Ix(l,i,s,"all"):u="none";else{var p=i[1]-i[0],g=s[1]*o/p;i=[en(0,g-p/2)],i[1]=Ai(s[1],i[0]+p),i[0]=i[1]-p}return{axisExpandWindow:i,behavior:u}},t}();function LY(t,e){return Ai(en(t,e[0]),e[1])}function $Br(t,e){var r=e.layoutLength/(e.axisCount-1);return{position:r*t,axisNameAvailableWidth:r,axisLabelShow:!0}}function FBr(t,e){var r=e.layoutLength,n=e.axisExpandWidth,i=e.axisCount,a=e.axisCollapseWidth,s=e.winInnerIndices,o,l=a,u=!1,h;return t=0;i--)xl(n[i])},e.prototype.getActiveState=function(r){var n=this.activeIntervals;if(!n.length)return"normal";if(r==null||isNaN(+r))return"inactive";if(n.length===1){var i=n[0];if(i[0]<=r&&r<=i[1])return"active"}else for(var a=0,s=n.length;aGBr}function kut(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function Eut(t,e,r,n){var i=new pr;return i.add(new tn({name:"main",style:a0e(r),silent:!0,draggable:!0,cursor:"move",drift:qr(Dut,t,e,i,["n","s","w","e"]),ondragend:qr(JS,e,{isEnd:!0})})),de(n,function(a){i.add(new tn({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:qr(Dut,t,e,i,a),ondragend:qr(JS,e,{isEnd:!0})}))}),i}function _ut(t,e,r,n){var i=n.brushStyle.lineWidth||0,a=h5(i,HBr),s=r[0][0],o=r[1][0],l=s-i/2,u=o-i/2,h=r[0][1],d=r[1][1],f=h-a+i/2,p=d-a+i/2,g=h-s,m=d-o,v=g+i,y=m+i;yy(t,e,"main",s,o,g,m),n.transformable&&(yy(t,e,"w",l,u,a,y),yy(t,e,"e",f,u,a,y),yy(t,e,"n",l,u,v,a),yy(t,e,"s",l,p,v,a),yy(t,e,"nw",l,u,a,a),yy(t,e,"ne",f,u,a,a),yy(t,e,"sw",l,p,a,a),yy(t,e,"se",f,p,a,a))}function i0e(t,e){var r=e.__brushOption,n=r.transformable,i=e.childAt(0);i.useStyle(a0e(r)),i.attr({silent:!n,cursor:n?"move":"default"}),de([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var s=e.childOfName(a.join("")),o=a.length===1?s0e(t,a[0]):KBr(t,a);s&&s.attr({silent:!n,invisible:!n,cursor:n?YBr[o]+"-resize":null})})}function yy(t,e,r,n,i,a,s){var o=e.childOfName(r);o&&o.setShape(JBr(o0e(t,e,[[n,i],[n+a,i+s]])))}function a0e(t){return mr({strokeNoScale:!0},t.brushStyle)}function Rut(t,e,r,n){var i=[dB(t,r),dB(e,n)],a=[h5(t,r),h5(e,n)];return[[i[0],a[0]],[i[1],a[1]]]}function XBr(t){return iS(t.group)}function s0e(t,e){var r={w:"left",e:"right",n:"top",s:"bottom"},n={left:"w",right:"e",top:"n",bottom:"s"},i=kH(r[e],XBr(t));return n[i]}function KBr(t,e){var r=[s0e(t,e[0]),s0e(t,e[1])];return(r[0]==="e"||r[0]==="w")&&r.reverse(),r.join("")}function Dut(t,e,r,n,i,a){var s=r.__brushOption,o=t.toRectRange(s.range),l=Lut(e,i,a);de(n,function(u){var h=WBr[u];o[h[0]][h[1]]+=l[h[0]]}),s.range=t.fromRectRange(Rut(o[0][0],o[1][0],o[0][1],o[1][1])),e0e(e,r),JS(e,{isEnd:!1})}function ZBr(t,e,r,n){var i=e.__brushOption.range,a=Lut(t,r,n);de(i,function(s){s[0]+=a[0],s[1]+=a[1]}),e0e(t,e),JS(t,{isEnd:!1})}function Lut(t,e,r){var n=t.group,i=n.transformCoordToLocal(e,r),a=n.transformCoordToLocal(0,0);return[i[0]-a[0],i[1]-a[1]]}function o0e(t,e,r){var n=Out(t,e);return n&&n!==ZS?n.clipPath(r,t._transform):lr(r)}function JBr(t){var e=dB(t[0][0],t[1][0]),r=dB(t[0][1],t[1][1]),n=h5(t[0][0],t[1][0]),i=h5(t[0][1],t[1][1]);return{x:e,y:r,width:n-e,height:i-r}}function e7r(t,e,r){if(!(!t._brushType||r7r(t,e.offsetX,e.offsetY))){var n=t._zr,i=t._covers,a=r0e(t,e,r);if(!t._dragging)for(var s=0;sn.getWidth()||r<0||r>n.getHeight()}var MY={lineX:Nut(0),lineY:Nut(1),rect:{createCover:function(t,e){function r(n){return n}return Eut({toRectRange:r,fromRectRange:r},t,e,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(t){var e=kut(t);return Rut(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(t,e,r,n){_ut(t,e,r,n)},updateCommon:i0e,contain:c0e},polygon:{createCover:function(t,e){var r=new pr;return r.add(new Al({name:"main",style:a0e(e),silent:!0})),r},getCreatingRange:function(t){return t},endCreating:function(t,e){e.remove(e.childAt(0)),e.add(new ic({name:"main",draggable:!0,drift:qr(ZBr,t,e),ondragend:qr(JS,t,{isEnd:!0})}))},updateCoverShape:function(t,e,r,n){e.childAt(0).setShape({points:o0e(t,e,r)})},updateCommon:i0e,contain:c0e}};function Nut(t){return{createCover:function(e,r){return Eut({toRectRange:function(n){var i=[n,[0,100]];return t&&i.reverse(),i},fromRectRange:function(n){return n[t]}},e,r,[[["w"],["e"]],[["n"],["s"]]][t])},getCreatingRange:function(e){var r=kut(e),n=dB(r[0][t],r[1][t]),i=h5(r[0][t],r[1][t]);return[n,i]},updateCoverShape:function(e,r,n,i){var a,s=Out(e,r);if(s!==ZS&&s.getLinearBrushOtherExtent)a=s.getLinearBrushOtherExtent(t);else{var o=e._zr;a=[0,[o.getWidth(),o.getHeight()][1-t]]}var l=[n,a];t&&l.reverse(),_ut(e,r,l,i)},updateCommon:i0e,contain:c0e}}function But(t){return t=u0e(t),function(e){return lfe(e,t)}}function $ut(t,e){return t=u0e(t),function(r){var n=e??r,i=n?t.width:t.height,a=n?t.x:t.y;return[a,a+(i||0)]}}function Fut(t,e,r){var n=u0e(t);return function(i,a){return n.contain(a[0],a[1])&&!Tlt(i,e,r)}}function u0e(t){return fr.create(t)}var n7r=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r,n){t.prototype.init.apply(this,arguments),(this._brushController=new Jme(n.getZr())).on("brush",Ht(this._onBrush,this))},e.prototype.render=function(r,n,i,a){if(!i7r(r,n,a)){this.axisModel=r,this.api=i,this.group.removeAll();var s=this._axisGroup;if(this._axisGroup=new pr,this.group.add(this._axisGroup),!!r.get("show")){var o=s7r(r,n),l=o.coordinateSystem,u=r.getAreaSelectStyle(),h=u.width,d=r.axis.dim,f=l.getAxisLayout(d),p=ot({strokeContainThreshold:h},f),g=new Ou(r,i,p);g.build(),this._axisGroup.add(g.group),this._refreshBrushController(p,u,r,o,h,i),HN(s,this._axisGroup,r)}}},e.prototype._refreshBrushController=function(r,n,i,a,s,o){var l=i.axis.getExtent(),u=l[1]-l[0],h=Math.min(30,Math.abs(u)*.1),d=fr.create({x:l[0],y:-s/2,width:u,height:s});d.x-=h,d.width+=2*h,this._brushController.mount({enableGlobalPan:!0,rotation:r.rotation,x:r.position[0],y:r.position[1]}).setPanels([{panelId:"pl",clipPath:But(d),isTargetByCursor:Fut(d,o,a),getLinearBrushOtherExtent:$ut(d,0)}]).enableBrush({brushType:"lineX",brushStyle:n,removeOnClick:!0}).updateCovers(a7r(i))},e.prototype._onBrush=function(r){var n=r.areas,i=this.axisModel,a=i.axis,s=vt(n,function(o){return[a.coordToData(o.range[0],!0),a.coordToData(o.range[1],!0)]});(!i.option.realtime===r.isEnd||r.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:i.id,intervals:s})},e.prototype.dispose=function(){this._brushController.dispose()},e.type="parallelAxis",e}(Hi);function i7r(t,e,r){return r&&r.type==="axisAreaSelect"&&e.findComponents({mainType:"parallelAxis",query:r})[0]===t}function a7r(t){var e=t.axis;return vt(t.activeIntervals,function(r){return{brushType:"lineX",panelId:"pl",range:[e.dataToCoord(r[0],!0),e.dataToCoord(r[1],!0)]}})}function s7r(t,e){return e.getComponent("parallel",t.get("parallelIndex"))}var o7r={type:"axisAreaSelect",event:"axisAreaSelected"};function l7r(t){t.registerAction(o7r,function(e,r){r.eachComponent({mainType:"parallelAxis",query:e},function(n){n.axis.model.setActiveIntervals(e.intervals)})}),t.registerAction("parallelAxisExpand",function(e,r){r.eachComponent({mainType:"parallel",query:e},function(n){n.setAxisExpand(e)})})}var c7r={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function zut(t){t.registerComponentView(MBr),t.registerComponentModel(PBr),t.registerCoordinateSystem("parallel",UBr),t.registerPreprocessor(_Br),t.registerComponentModel(Zme),t.registerComponentView(n7r),n5(t,"parallel",Zme,c7r),l7r(t)}function u7r(t){Yr(zut),t.registerChartView(wBr),t.registerSeriesModel(TBr),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,EBr)}var by="sankey",h7r=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.getInitialData=function(r,n){var i=r.edges||r.links||[],a=r.data||r.nodes||[],s=r.levels||[];this.levelModels=[];for(var o=this.levelModels,l=0;l=0&&(o[s[l].depth]=new yn(s[l],this,n));var u=Eme(a,i,this,!0,h);return u.data;function h(d,f){d.wrapMethod("getItemModel",function(p,g){var m=p.parentModel,v=m.getData().getItemLayout(g);if(v){var y=v.depth,b=m.levelModels[y];b&&(p.parentModel=b)}return p}),f.wrapMethod("getItemModel",function(p,g){var m=p.parentModel,v=m.getGraph().getEdgeByIndex(g),y=v.node1.getLayout();if(y){var b=y.depth,x=m.levelModels[b];x&&(p.parentModel=x)}return p})}},e.prototype.setNodePosition=function(r,n){var i=this.option.data||this.option.nodes,a=i[r];a.localX=n[0],a.localY=n[1]},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.formatTooltip=function(r,n,i){function a(p){return isNaN(p)||p==null}if(i==="edge"){var s=this.getDataParams(r,i),o=s.data,l=s.value,u=o.source+" -- "+o.target;return no("nameValue",{name:u,value:l,noValue:a(l)})}else{var h=this.getGraph().getNodeByIndex(r),d=h.getLayout().value,f=this.getDataParams(r,i).data.name;return no("nameValue",{name:f!=null?f+"":null,value:d,noValue:a(d)})}},e.prototype.optionUpdated=function(){},e.prototype.getDataParams=function(r,n){var i=t.prototype.getDataParams.call(this,r,n);if(i.value==null&&n==="node"){var a=this.getGraph().getNodeByIndex(r),s=a.getLayout().value;i.value=s}return i},e.prototype.__ownRoamView=function(){return this.coordinateSystem},e.type="series."+by,e.layoutMode="box",e.defaultOption={z:2,coordinateSystemUsage:"box",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,roam:!1,roamTrigger:"global",center:null,zoom:1,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:et.color.neutral50,opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:et.color.primary}},animationEasing:"linear",animationDuration:1e3},e}(Ri),d7r=function(){function t(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0}return t}(),f7r=function(t){rt(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new d7r},e.prototype.buildPath=function(r,n){var i=n.extent;r.moveTo(n.x1,n.y1),r.bezierCurveTo(n.cpx1,n.cpy1,n.cpx2,n.cpy2,n.x2,n.y2),n.orient==="vertical"?(r.lineTo(n.x2+i,n.y2),r.bezierCurveTo(n.cpx2+i,n.cpy2,n.cpx1+i,n.cpy1,n.x1+i,n.y1)):(r.lineTo(n.x2,n.y2+i),r.bezierCurveTo(n.cpx2,n.cpy2+i,n.cpx1,n.cpy1+i,n.x1,n.y1+i)),r.closePath()},e.prototype.highlight=function(){oy(this)},e.prototype.downplay=function(){ly(this)},e}(vn),p7r=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=by,r._mainGroup=new pr,r}return e.prototype.init=function(r,n){this._controller=new VS(n.getZr()),this.group.add(this._mainGroup),this._firstRender=!0},e.prototype.render=function(r,n,i){var a=r.getGraph(),s=this._mainGroup,o=r.layoutInfo,l=o.width,u=o.height,h=r.getData(),d=r.getData("edge"),f=r.get("orient");s.removeAll(),s.x=o.x,s.y=o.y,this._updateViewCoordSys(r,i),bY(r,i,this._controller,ect(s),null),a.eachEdge(function(p){var g=new f7r,m=Cr(g);m.dataIndex=p.dataIndex,m.seriesIndex=r.seriesIndex,m.dataType="edge";var v=p.getModel(),y=v.getModel("lineStyle"),b=y.get("curveness"),x=p.node1.getLayout(),w=p.node1.getModel(),A=w.get("localX"),S=w.get("localY"),T=p.node2.getLayout(),O=p.node2.getModel(),k=O.get("localX"),E=O.get("localY"),_=p.getLayout(),I,L,R,D,M,P,N,F;g.shape.extent=Math.max(1,_.dy),g.shape.orient=f,f==="vertical"?(I=(A!=null?A*l:x.x)+_.sy,L=(S!=null?S*u:x.y)+x.dy,R=(k!=null?k*l:T.x)+_.ty,D=E!=null?E*u:T.y,M=I,P=L*(1-b)+D*b,N=R,F=L*b+D*(1-b)):(I=(A!=null?A*l:x.x)+x.dx,L=(S!=null?S*u:x.y)+_.sy,R=k!=null?k*l:T.x,D=(E!=null?E*u:T.y)+_.ty,M=I*(1-b)+R*b,P=L,N=I*b+R*(1-b),F=D),g.setShape({x1:I,y1:L,x2:R,y2:D,cpx1:M,cpy1:P,cpx2:N,cpy2:F}),g.useStyle(y.getItemStyle()),Uut(g.style,f,p);var B=""+v.get("value"),V=To(v,"edgeLabel");qo(g,V,{labelFetcher:{getFormattedLabel:function(Q,G,X,Y,le,q){return r.getFormattedLabel(Q,G,"edge",Y,Ch(le,V.normal&&V.normal.get("formatter"),B),q)}},labelDataIndex:p.dataIndex,defaultText:B}),g.setTextConfig({position:"inside"});var z=v.getModel("emphasis");So(g,v,"lineStyle",function(Q){var G=Q.getItemStyle();return Uut(G,f,p),G}),s.add(g),d.setItemGraphicEl(p.dataIndex,g);var U=z.get("focus");wa(g,U==="adjacency"?p.getAdjacentDataIndices():U==="trajectory"?p.getTrajectoryDataIndices():U,z.get("blurScope"),z.get("disabled"))}),a.eachNode(function(p){var g=p.getLayout(),m=p.getModel(),v=m.get("localX"),y=m.get("localY"),b=m.getModel("emphasis"),x=m.get(["itemStyle","borderRadius"])||0,w=new tn({shape:{x:v!=null?v*l:g.x,y:y!=null?y*u:g.y,width:g.dx,height:g.dy,r:x},style:m.getModel("itemStyle").getItemStyle(),z2:10});qo(w,To(m),{labelFetcher:{getFormattedLabel:function(S,T){return r.getFormattedLabel(S,T,"node")}},labelDataIndex:p.dataIndex,defaultText:p.id}),w.disableLabelAnimation=!0,w.setStyle("fill",p.getVisual("color")),w.setStyle("decal",p.getVisual("style").decal),So(w,m),s.add(w),h.setItemGraphicEl(p.dataIndex,w),Cr(w).dataType="node";var A=b.get("focus");wa(w,A==="adjacency"?p.getAdjacentDataIndices():A==="trajectory"?p.getTrajectoryDataIndices():A,b.get("blurScope"),b.get("disabled"))}),h.eachItemGraphicEl(function(p,g){var m=h.getItemModel(g);m.get("draggable")&&(p.drift=function(v,y){this.shape.x+=v,this.shape.y+=y,this.dirty(),i.dispatchAction({type:"dragNode",seriesId:r.id,dataIndex:h.getRawIndex(g),localX:this.shape.x/l,localY:this.shape.y/u})},p.draggable=!0,p.cursor="move")}),!this._data&&r.isAnimationEnabled()&&s.setClipPath(g7r(s.getBoundingRect(),r,function(){s.removeClipPath()})),this._data=r.getData(),this._firstRender=!1},e.prototype.__updateOnOwnRoam=function(r,n,i){Lx(this.group,Fm,n.coordinateSystem,null)},e.prototype.dispose=function(){this._controller&&this._controller.dispose()},e.prototype._updateViewCoordSys=function(r,n){var i=r.layoutInfo,a=r.coordinateSystem=hme(r,n,i.x,i.y,i.width,i.height);Lx(this.group,Fm,a,this._firstRender?null:r)},e.type=by,e}(Si);function Uut(t,e,r){switch(t.fill){case"source":t.fill=r.node1.getVisual("color"),t.decal=r.node1.getVisual("style").decal;break;case"target":t.fill=r.node2.getVisual("color"),t.decal=r.node2.getVisual("style").decal;break;case"gradient":var n=r.node1.getVisual("color"),i=r.node2.getVisual("color");Nt(n)&&Nt(i)&&(t.fill=new tS(0,0,+(e==="horizontal"),+(e==="vertical"),[{color:n,offset:0},{color:i,offset:1}]))}}function g7r(t,e,r){var n=new tn({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return ia(n,{shape:{width:t.width+20}},e,r),n}var m7r=Ao(by,v7r);function v7r(t,e){t.eachSeriesByType(by,function(r){var n=r.get("nodeWidth"),i=r.get("nodeGap"),a=Co(r,e).refContainer,s=da(r.getBoxLayoutParams(),a);r.layoutInfo=s;var o=s.width,l=s.height,u=r.getGraph(),h=u.nodes,d=u.edges;b7r(h);var f=ni(h,function(v){return v.getLayout().value===0}),p=f.length!==0?0:r.get("layoutIterations"),g=r.get("orient"),m=r.get("nodeAlign");y7r(h,d,n,i,o,l,p,g,m)})}function y7r(t,e,r,n,i,a,s,o,l){x7r(t,e,r,i,a,o,l),T7r(t,e,a,i,n,s,o),M7r(t,o)}function b7r(t){de(t,function(e){var r=Nx(e.outEdges,IY),n=Nx(e.inEdges,IY),i=e.getValue()||0,a=Math.max(r,n,i);e.setLayout({value:a},!0)})}function x7r(t,e,r,n,i,a,s){for(var o=[],l=[],u=[],h=[],d=0,f=0;f=0;y&&v.depth>p&&(p=v.depth),m.setLayout({depth:y?v.depth:d},!0),a==="vertical"?m.setLayout({dy:r},!0):m.setLayout({dx:r},!0);for(var b=0;bd-1?p:d-1;s&&s!=="left"&&w7r(t,s,a,T);var O=a==="vertical"?(i-r)/T:(n-r)/T;S7r(t,O,a)}function Vut(t){var e=t.hostGraph.data.getRawDataItem(t.dataIndex);return e.depth!=null&&e.depth>=0}function w7r(t,e,r,n){if(e==="right"){for(var i=[],a=t,s=0;a.length;){for(var o=0;o0;a--)l*=.99,k7r(o,l,s),h0e(o,i,r,n,s),L7r(o,l,s),h0e(o,i,r,n,s)}function C7r(t,e){var r=[],n=e==="vertical"?"y":"x",i=vde(t,function(a){return a.getLayout()[n]});return xl(i.keys),de(i.keys,function(a){r.push(i.buckets.get(a))}),r}function O7r(t,e,r,n,i,a){var s=1/0;de(t,function(o){var l=o.length,u=0;de(o,function(d){u+=d.getLayout().value});var h=a==="vertical"?(n-(l-1)*i)/u:(r-(l-1)*i)/u;h0&&(o=l.getLayout()[a]+u,i==="vertical"?l.setLayout({x:o},!0):l.setLayout({y:o},!0)),h=l.getLayout()[a]+l.getLayout()[f]+e;var g=i==="vertical"?n:r;if(u=h-e-g,u>0){o=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:o},!0):l.setLayout({y:o},!0),h=o;for(var p=d-2;p>=0;--p)l=s[p],u=l.getLayout()[a]+l.getLayout()[f]+e-h,u>0&&(o=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:o},!0):l.setLayout({y:o},!0)),h=l.getLayout()[a]}})}function k7r(t,e,r){de(t.slice().reverse(),function(n){de(n,function(i){if(i.outEdges.length){var a=Nx(i.outEdges,E7r,r)/Nx(i.outEdges,IY);if(isNaN(a)){var s=i.outEdges.length;a=s?Nx(i.outEdges,_7r,r)/s:0}if(r==="vertical"){var o=i.getLayout().x+(a-Px(i,r))*e;i.setLayout({x:o},!0)}else{var l=i.getLayout().y+(a-Px(i,r))*e;i.setLayout({y:l},!0)}}})})}function E7r(t,e){return Px(t.node2,e)*t.getValue()}function _7r(t,e){return Px(t.node2,e)}function R7r(t,e){return Px(t.node1,e)*t.getValue()}function D7r(t,e){return Px(t.node1,e)}function Px(t,e){return e==="vertical"?t.getLayout().x+t.getLayout().dx/2:t.getLayout().y+t.getLayout().dy/2}function IY(t){return t.getValue()}function Nx(t,e,r){for(var n=0,i=t.length,a=-1;++as&&(s=l)}),de(n,function(o){var l=new Xo({type:"color",mappingMethod:"linear",dataExtent:[a,s],visual:e.get("color")}),u=l.mapValueToVisual(o.getLayout().value),h=o.getModel().get(["itemStyle","color"]);h!=null?(o.setVisual("color",h),o.setVisual("style",{fill:h})):(o.setVisual("color",u),o.setVisual("style",{fill:u}))})}i.length&&de(i,function(o){var l=o.getModel().get("lineStyle");o.setVisual("style",l)})})}function N7r(t){t.registerChartView(p7r),t.registerSeriesModel(h7r),t.registerLayout(m7r),t.registerVisual(I7r),t.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(e,r){r.eachComponent({mainType:km,subType:by,query:e},function(n){n.setNodePosition(e.dataIndex,[e.localX,e.localY])})}),ume(t,km,by)}var Qut=function(){function t(){}return t.prototype._hasEncodeRule=function(e){var r=this.getEncode();return r&&r.get(e)!=null},t.prototype.getInitialData=function(e,r){var n,i=r.getComponent("xAxis",this.get("xAxisIndex")),a=r.getComponent("yAxis",this.get("yAxisIndex")),s=i.get("type"),o=a.get("type"),l,u=e.layout;s==="category"?(u="horizontal",n=i.getOrdinalMeta(),l=!this._hasEncodeRule("x")):o==="category"&&(u="vertical",n=a.getOrdinalMeta(),l=!this._hasEncodeRule("y")),u||(u=o==="time"?"vertical":"horizontal"),this._layout=u;var h=["x","y"],d=u==="horizontal"?0:1,f=this._baseAxisDim=h[d],p=h[1-d],g=[i,a],m=g[d].get("type"),v=g[1-d].get("type"),y=e.data;if(y&&l){var b=[];de(y,function(A,S){var T;ft(A)?(T=A.slice(),A.unshift(S)):ft(A.value)?(T=ot({},A),T.value=T.value.slice(),A.value.unshift(S)):T=A,b.push(T)}),e.data=b}var x=this.defaultValueDimensions,w=[{name:f,type:vW(m),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:p,type:vW(v),dimsDef:x.slice()}];return t5(this,{coordDimensions:w,dimensionsCount:x.length+1,encodeDefaulter:qr(Prt,w,this)})},t.prototype.getBaseAxis=function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis},t.prototype.getWhiskerBoxesLayout=function(){return this._layout},t}();function PY(t,e){for(var r=e.ends.length,n=0,i=0;im){var w=[y,x];n.push(w)}}}return{boxData:r,outliers:n}}var q7r={type:"echarts:boxplot",transform:function(e){var r=e.upstream;if(r.sourceFormat!==wl){var n="";ii(n)}var i=Y7r(r.getRawData(),e.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};function j7r(t){t.registerSeriesModel(Gut),t.registerChartView(B7r),t.registerLayout(V7r),t.registerTransform(q7r),W7r(t)}var Bx="candlestick",Yut=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.defaultValueDimensions=[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],r}return e.prototype.getShadowDim=function(){return"open"},e.prototype.brushSelector=function(r,n,i){var a=n.getItemLayout(r);return a&&i.rect(a.brushRect)},e.type="series."+Bx,e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,clip:!0,itemStyle:{color:"#eb5454",color0:"#47b262",borderColor:"#eb5454",borderColor0:"#47b262",borderColorDoji:null,borderWidth:1},emphasis:{itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},e}(Ri);Is(Yut,Qut,!0);var X7r=["itemStyle","borderColor"],K7r=["itemStyle","borderColor0"],Z7r=["itemStyle","borderColorDoji"],J7r=["itemStyle","color"],e$r=["itemStyle","color0"];function d0e(t,e){return e.get(t>0?J7r:e$r)}function f0e(t,e){return e.get(t===0?Z7r:t>0?X7r:K7r)}var t$r={seriesType:Bx,plan:yS(),performRawSeries:!0,reset:function(t,e){if(!e.isSeriesFiltered(t)){var r=t.pipelineContext.large;return!r&&{progress:function(n,i){for(var a;(a=n.next())!=null;){var s=i.getItemModel(a),o=i.getItemLayout(a).sign,l=s.getItemStyle();l.fill=d0e(o,s),l.stroke=f0e(o,s)||l.fill;var u=i.ensureUniqueItemVisual(a,"style");ot(u,l)}}}}}},r$r=["color","borderColor"],n$r=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(r),this._isLargeDraw?this._renderLarge(r):this._renderNormal(r)},e.prototype.incrementalPrepareRender=function(r,n,i){this._clear(),this._updateDrawMode(r)},e.prototype.incrementalRender=function(r,n,i,a){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(r,n):this._incrementalRenderNormal(r,n)},e.prototype.eachRendered=function(r){bx(this._progressiveEls||this.group,r)},e.prototype._updateDrawMode=function(r){var n=r.pipelineContext.large;(this._isLargeDraw==null||n!==this._isLargeDraw)&&(this._isLargeDraw=n,this._clear())},e.prototype._renderNormal=function(r){var n=r.getData(),i=this._data,a=this.group,s=n.getLayout("isSimpleBox"),o=r.get("clip",!0),l=r.coordinateSystem,u=l.getArea&&l.getArea(),h=o&&PS(l,!1,r);this._data||a.removeAll();var d=qut(r);n.diff(i).add(function(f){if(n.hasValue(f)){var p=n.getItemLayout(f),g=o?PY(u,p):I8;if(g===N8)return;var m=p0e(p,f,d,!0);ia(m,{shape:{points:p.ends}},r,f),J_(g===P8,m,h),g0e(m,n,f,s),a.add(m),n.setItemGraphicEl(f,m)}}).update(function(f,p){var g=i.getItemGraphicEl(p);if(!n.hasValue(f)){a.remove(g);return}var m=n.getItemLayout(f),v=o?PY(u,m):I8;if(v===N8){a.remove(g);return}g?(Hn(g,{shape:{points:m.ends}},r,f),zf(g)):g=p0e(m,f,d),g0e(g,n,f,s),J_(v===P8,g,h),a.add(g),n.setItemGraphicEl(f,g)}).remove(function(f){var p=i.getItemGraphicEl(f);p&&a.remove(p)}).execute(),this._data=n},e.prototype._renderLarge=function(r){this._clear(),jut(r,this.group);var n=r.get("clip",!0)?PS(r.coordinateSystem,!1,r):null;J_(!!n,this.group,n)},e.prototype._incrementalRenderNormal=function(r,n){for(var i=n.getData(),a=i.getLayout("isSimpleBox"),s=qut(n),o;(o=r.next())!=null;){var l=i.getItemLayout(o),u=p0e(l,o,s);g0e(u,i,o,a),u.incremental=xm(n),this.group.add(u),this._progressiveEls.push(u)}},e.prototype._incrementalRenderLarge=function(r,n){jut(n,this.group,this._progressiveEls,!0)},e.prototype.remove=function(r){this._clear()},e.prototype._clear=function(){this.group.removeAll(),J_(!1,this.group,null),this._data=null},e.type=Bx,e}(Si),i$r=function(){function t(){}return t}(),a$r=function(t){rt(e,t);function e(r){var n=t.call(this,r)||this;return n.type="normalCandlestickBox",n}return e.prototype.getDefaultShape=function(){return new i$r},e.prototype.buildPath=function(r,n){var i=n.points;this.__simpleBox?(r.moveTo(i[4][0],i[4][1]),r.lineTo(i[6][0],i[6][1])):(r.moveTo(i[0][0],i[0][1]),r.lineTo(i[1][0],i[1][1]),r.lineTo(i[2][0],i[2][1]),r.lineTo(i[3][0],i[3][1]),r.closePath(),r.moveTo(i[4][0],i[4][1]),r.lineTo(i[5][0],i[5][1]),r.moveTo(i[6][0],i[6][1]),r.lineTo(i[7][0],i[7][1]))},e}(vn);function p0e(t,e,r,n){var i=t.ends;return new a$r({shape:{points:n?s$r(i,r,t):i},z2:100})}function g0e(t,e,r,n){var i=e.getItemModel(r);t.useStyle(e.getItemVisual(r,"style")),t.style.strokeNoScale=!0;var a=i.getShallow("cursor");a&&t.attr("cursor",a),t.__simpleBox=n,So(t,i);var s=e.getItemLayout(r).sign;de(t.states,function(l,u){var h=i.getModel(u),d=d0e(s,h),f=f0e(s,h)||d,p=l.style||(l.style={});d&&(p.fill=d),f&&(p.stroke=f)});var o=i.getModel("emphasis");wa(t,o.get("focus"),o.get("blurScope"),o.get("disabled"))}function s$r(t,e,r){return vt(t,function(n){return n=n.slice(),n[e]=r.initBaseline,n})}function qut(t){return t.getWhiskerBoxesLayout()==="horizontal"?1:0}var o$r=function(){function t(){}return t}(),m0e=function(t){rt(e,t);function e(r){var n=t.call(this,r)||this;return n.type="largeCandlestickBox",n}return e.prototype.getDefaultShape=function(){return new o$r},e.prototype.buildPath=function(r,n){for(var i=n.points,a=0;aA?_[a]:E[a],ends:R,brushRect:F(S,T,x)})}function P(V,z){var U=[];return U[i]=z,U[a]=V,isNaN(z)||isNaN(V)?[NaN,NaN]:e.dataToPoint(U)}function N(V,z,U){var Q=z.slice(),G=z.slice();Q[i]=OH(Q[i]+n/2,1,!1),G[i]=OH(G[i]-n/2,1,!0),U?V.push(Q,G):V.push(G,Q)}function F(V,z,U){var Q=P(V,U),G=P(z,U);return Q[i]-=n/2,G[i]-=n/2,{x:Q[0],y:Q[1],width:a?n:G[0]-Q[0],height:a?G[1]-Q[1]:n}}function B(V){return V[i]=OH(V[i],1),V}}function g(m,v){for(var y=Nm(m.count*4),b=0,x,w=[],A=[],S,T=v.getStore(),O=!!t.get(["itemStyle","borderColorDoji"]);(S=m.next())!=null;){var k=T.get(o,S),E=T.get(u,S),_=T.get(h,S),I=T.get(d,S),L=T.get(f,S);if(isNaN(k)||isNaN(I)||isNaN(L)){y[b++]=NaN,b+=3;continue}y[b++]=Xut(T,S,E,_,h,O),w[i]=k,w[a]=I,x=e.dataToPoint(w,null,A),y[b++]=x?x[0]:NaN,y[b++]=x?x[1]:NaN,w[a]=L,x=e.dataToPoint(w,null,A),y[b++]=x?x[1]:NaN}v.setLayout("largePoints",y)}}};function Xut(t,e,r,n,i,a){var s;return r>n?s=-1:r0?t.get(i,e-1)<=n?1:-1:1,s}function h$r(t,e){var r=t.getBaseAxis(),n=sc(r,{fromStat:{key:FS(Bx)},min:1}).w,i=Qt(Jt(t.get("barMaxWidth"),n),n),a=Qt(Jt(t.get("barMinWidth"),1),n),s=t.get("barWidth");return s!=null?Qt(s,n):en(Ai(n/2,i),a)}function d$r(t){c$r(t,function(){var e=FS(Bx);jpe(t,{key:e,seriesType:Bx,getMetrics:Nge}),DW(e,jW(e))})}function f$r(t){t.registerChartView(n$r),t.registerSeriesModel(Yut),t.registerPreprocessor(l$r),t.registerVisual(t$r),t.registerLayout(u$r),d$r(t)}function Kut(t,e){var r=e.rippleEffectColor||e.color;t.eachChild(function(n){n.attr({z:e.z,zlevel:e.zlevel,style:{stroke:e.brushType==="stroke"?r:null,fill:e.brushType==="fill"?r:null}})})}var p$r=function(t){rt(e,t);function e(r,n){var i=t.call(this)||this,a=new L8(r,n),s=new pr;return i.add(a),i.add(s),i.updateData(r,n),i}return e.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},e.prototype.startEffectAnimation=function(r){for(var n=r.symbolType,i=r.color,a=r.rippleNumber,s=this.childAt(1),o=0;o0&&(o=this._getLineLength(a)/h*1e3),o!==this._period||l!==this._loop||u!==this._roundTrip){a.stopAnimation();var f=void 0;ur(d)?f=d(i):f=d,a.__t>0&&(f=-o*a.__t),this._animateSymbol(a,o,f,l,u)}this._period=o,this._loop=l,this._roundTrip=u}},e.prototype._animateSymbol=function(r,n,i,a,s){if(n>0){r.__t=0;var o=this,l=r.animate("",a).when(s?n*2:n,{__t:s?2:1}).delay(i).during(function(){o._updateSymbolPosition(r)});a||l.done(function(){o.remove(r)}),l.start()}},e.prototype._getLineLength=function(r){return qv(r.__p1,r.__cp1)+qv(r.__cp1,r.__p2)},e.prototype._updateAnimationPoints=function(r,n){r.__p1=n[0],r.__p2=n[1],r.__cp1=n[2]||[(n[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2]},e.prototype.updateData=function(r,n,i){this.childAt(0).updateData(r,n,i),this._updateEffectSymbol(r,n)},e.prototype._updateSymbolPosition=function(r){var n=r.__p1,i=r.__p2,a=r.__cp1,s=r.__t<=1?r.__t:2-r.__t,o=[r.x,r.y],l=o.slice(),u=bl,h=Dhe;o[0]=u(n[0],a[0],i[0],s),o[1]=u(n[1],a[1],i[1],s);var d=r.__t<=1?h(n[0],a[0],i[0],s):h(i[0],a[0],n[0],1-s),f=r.__t<=1?h(n[1],a[1],i[1],s):h(i[1],a[1],n[1],1-s);r.rotation=-Math.atan2(f,d)-Math.PI/2,(this._symbolType==="line"||this._symbolType==="rect"||this._symbolType==="roundRect")&&(r.__lastT!==void 0&&r.__lastT=0&&!(a[l]<=n);l--);l=Math.min(l,s-2)}else{for(l=o;ln);l++);l=Math.min(l-1,s-2)}var h=(n-a[l])/(a[l+1]-a[l]),d=i[l],f=i[l+1];r.x=d[0]*(1-h)+h*f[0],r.y=d[1]*(1-h)+h*f[1];var p=r.__t<=1?f[0]-d[0]:d[0]-f[0],g=r.__t<=1?f[1]-d[1]:d[1]-f[1];r.rotation=-Math.atan2(g,p)-Math.PI/2,this._lastFrame=l,this._lastFramePercent=n,r.ignore=!1}},e}(Jut),b$r=function(){function t(){this.polyline=!1,this.curveness=0,this.segs=[]}return t}(),x$r=function(t){rt(e,t);function e(r){var n=t.call(this,r)||this;return n._off=0,n.hoverDataIdx=-1,n}return e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.beforeBrush=function(r){r&&!r.contentRetained&&this.reset()},e.prototype.getDefaultStyle=function(){return{stroke:et.color.neutral99,fill:null}},e.prototype.getDefaultShape=function(){return new b$r},e.prototype.buildPath=function(r,n){var i=n.segs,a=n.curveness,s;if(n.polyline)for(s=this._off;s0){r.moveTo(i[s++],i[s++]);for(var l=1;l0){var p=(u+d)/2-(h-f)*a,g=(h+f)/2-(d-u)*a;r.quadraticCurveTo(p,g,d,f)}else r.lineTo(d,f)}this.incremental&&(this._off=s,this.notClear=!0)},e.prototype.findDataIndex=function(r,n){var i=this.shape,a=i.segs,s=i.curveness,o=this.style.lineWidth;if(i.polyline)for(var l=0,u=0;u0)for(var d=a[u++],f=a[u++],p=1;p0){var v=(d+g)/2-(f-m)*s,y=(f+m)/2-(g-d)*s;if(Bet(d,f,v,y,g,m,o,r,n))return l}else if(px(d,f,g,m,o,r,n))return l;l++}return-1},e.prototype.contain=function(r,n){var i=this.transformCoordToLocal(r,n),a=this.getBoundingRect();if(r=i[0],n=i[1],a.contain(r,n)){var s=this.hoverDataIdx=this.findDataIndex(r,n);return s>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var r=this._rect;if(!r){for(var n=this.shape,i=n.segs,a=1/0,s=1/0,o=-1/0,l=-1/0,u=0;u0&&(s.dataIndex=l+e.__startIndex)})},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}(),tht={seriesType:"lines",plan:yS(),reset:function(t){var e=t.coordinateSystem;if(e){var r=t.get("polyline"),n=t.pipelineContext.large;return{progress:function(i,a){var s=[];if(n){var o=void 0,l=i.end-i.start;if(r){for(var u=0,h=i.start;h0&&h&&u.configLayer(o,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(l/10+.9,1),0)}),s.updateData(a);var d=r.get("clip",!0)&&PS(r.coordinateSystem,!1,r);d?this.group.setClipPath(d):this.group.removeClipPath(),this._lastZlevel=o,this._finished=!0},e.prototype.incrementalPrepareRender=function(r,n,i){var a=r.getData(),s=this._updateLineDraw(a,r);s.incrementalPrepareUpdate(a),this._clearLayer(i),this._finished=!1},e.prototype.incrementalRender=function(r,n,i){this._lineDraw.incrementalUpdate(r,n.getData(),xm(n)),this._finished=r.end===n.getData().count()},e.prototype.eachRendered=function(r){this._lineDraw&&this._lineDraw.eachRendered(r)},e.prototype.updateTransform=function(r,n,i){var a=r.getData(),s=this._lineDraw;if(!this._finished||!s||!s.updateLayout)return{update:!0};var o=tht.reset(r,n,i);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),s.updateLayout(),this._clearLayer(i)},e.prototype._updateLineDraw=function(r,n){var i=this._lineDraw,a=this._showEffect(n),s=!!n.get("polyline"),o=n.pipelineContext,l=o.large;return(!i||a!==this._hasEffet||s!==this._isPolyline||l!==this._isLargeDraw)&&(i&&i.remove(),i=this._lineDraw=l?new w$r:new zme(s?a?y$r:eht:a?Jut:Fme),this._hasEffet=a,this._isPolyline=s,this._isLargeDraw=l),this.group.add(i.group),i},e.prototype._showEffect=function(r){return!!r.get(["effect","show"])},e.prototype._clearLayer=function(r){var n=pfe(r);n&&this._lastZlevel!=null&&n.getLayer(this._lastZlevel).clear(!0)},e.prototype.remove=function(r,n){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(n)},e.prototype.dispose=function(r,n){this.remove(r,n)},e.type="lines",e}(Si),S$r=typeof Uint32Array>"u"?Array:Uint32Array,T$r=typeof Float64Array>"u"?Array:Float64Array;function rht(t){var e=t.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(t.data=vt(e,function(r){var n=[r[0].coord,r[1].coord],i={coords:n};return r[0].name&&(i.fromName=r[0].name),r[1].name&&(i.toName=r[1].name),fG([i,r[0],r[1]])}))}var C$r=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.visualStyleAccessPath="lineStyle",r.visualDrawType="stroke",r}return e.prototype.init=function(r){r.data=r.data||[],rht(r);var n=this._processFlatCoordsArray(r.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(r.data=new Float32Array(n.count)),t.prototype.init.apply(this,arguments)},e.prototype.mergeOption=function(r){if(rht(r),r.data){var n=this._processFlatCoordsArray(r.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(r.data=new Float32Array(n.count))}t.prototype.mergeOption.apply(this,arguments)},e.prototype.appendData=function(r){var n=this._processFlatCoordsArray(r.data);n.flatCoords&&(this._flatCoords?(this._flatCoords=QE(this._flatCoords,n.flatCoords),this._flatCoordsOffset=QE(this._flatCoordsOffset,n.flatCoordsOffset)):(this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset),r.data=new Float32Array(n.count)),this.getRawData().appendData(r.data)},e.prototype._getCoordsFromItemModel=function(r){var n=this.getData().getItemModel(r),i=n.option instanceof Array?n.option:n.getShallow("coords");return i},e.prototype.getLineCoordsCount=function(r){return this._flatCoordsOffset?this._flatCoordsOffset[r*2+1]:this._getCoordsFromItemModel(r).length},e.prototype.getLineCoords=function(r,n){if(this._flatCoordsOffset){for(var i=this._flatCoordsOffset[r*2],a=this._flatCoordsOffset[r*2+1],s=0;s ")}return no("nameValue",{name:l,value:s,noValue:s==null||isNaN(s)})},e.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},e.prototype.getProgressive=function(){var r=this.option.progressive;return r??(this.option.large?1e4:this.get("progressive"))},e.prototype.getProgressiveThreshold=function(){var r=this.option.progressiveThreshold;return r??(this.option.large?2e4:this.get("progressiveThreshold"))},e.prototype.getZLevelKey=function(){var r=this.getModel("effect"),n=r.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:r.get("show")&&n>0?n+"":""},e.type="series.lines",e.dependencies=["grid","polar","geo","calendar"],e.defaultOption={coordinateSystem:"geo",z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},e}(Ri);function NY(t){return t instanceof Array||(t=[t,t]),t}var O$r={seriesType:"lines",reset:function(t){var e=NY(t.get("symbol")),r=NY(t.get("symbolSize")),n=t.getData();n.setVisual("fromSymbol",e&&e[0]),n.setVisual("toSymbol",e&&e[1]),n.setVisual("fromSymbolSize",r&&r[0]),n.setVisual("toSymbolSize",r&&r[1]);function i(a,s){var o=a.getItemModel(s),l=NY(o.getShallow("symbol",!0)),u=NY(o.getShallow("symbolSize",!0));l[0]&&a.setItemVisual(s,"fromSymbol",l[0]),l[1]&&a.setItemVisual(s,"toSymbol",l[1]),u[0]&&a.setItemVisual(s,"fromSymbolSize",u[0]),u[1]&&a.setItemVisual(s,"toSymbolSize",u[1])}return{dataEach:n.hasItemOption?i:null}}};function k$r(t){t.registerChartView(A$r),t.registerSeriesModel(C$r),t.registerLayout(tht),t.registerVisual(O$r)}var E$r=256,_$r=function(){function t(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=Ho.createCanvas();this.canvas=e}return t.prototype.update=function(e,r,n,i,a,s){var o=this._getBrush(),l=this._getGradient(a,"inRange"),u=this._getGradient(a,"outOfRange"),h=this.pointSize+this.blurSize,d=this.canvas,f=d.getContext("2d"),p=e.length;d.width=r,d.height=n;for(var g=0;g0){var I=s(x)?l:u;x>0&&(x=x*E+O),A[S++]=I[_],A[S++]=I[_+1],A[S++]=I[_+2],A[S++]=I[_+3]*x*256}else S+=4}return f.putImageData(w,0,0),d},t.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=Ho.createCanvas()),r=this.pointSize+this.blurSize,n=r*2;e.width=n,e.height=n;var i=e.getContext("2d");return i.clearRect(0,0,n,n),i.shadowOffsetX=n,i.shadowBlur=this.blurSize,i.shadowColor=et.color.neutral99,i.beginPath(),i.arc(-r,r,this.pointSize,0,Math.PI*2,!0),i.closePath(),i.fill(),e},t.prototype._getGradient=function(e,r){for(var n=this._gradientPixels,i=n[r]||(n[r]=new Uint8ClampedArray(256*4)),a=[0,0,0,0],s=0,o=0;o<256;o++)e[r](o/255,!0,a),i[s++]=a[0],i[s++]=a[1],i[s++]=a[2],i[s++]=a[3];return i},t}();function R$r(t,e,r){var n=t[1]-t[0];e=vt(e,function(s){return{interval:[(s.interval[0]-t[0])/n,(s.interval[1]-t[0])/n]}});var i=e.length,a=0;return function(s){var o;for(o=a;o=0;o--){var l=e[o].interval;if(l[0]<=s&&s<=l[1]){a=o;break}}return o>=0&&o=e[0]&&n<=e[1]}}var L$r=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){var a;n.eachComponent("visualMap",function(o){o.eachTargetSeries(function(l){l===r&&(a=o)})}),this._progressiveEls=null,this.group.removeAll();var s=r.coordinateSystem;s.type==="cartesian2d"||s.type==="calendar"||s.type==="matrix"?this._renderOnGridLike(r,i,0,r.getData().count()):Zst(s)&&this._renderOnGeo(s,r,a,i)},e.prototype.incrementalPrepareRender=function(r,n,i){this.group.removeAll()},e.prototype.incrementalRender=function(r,n,i,a){var s=n.coordinateSystem;s&&(Zst(s)?this.render(n,i,a):(this._progressiveEls=[],this._renderOnGridLike(n,a,r.start,r.end,!0)))},e.prototype.eachRendered=function(r){bx(this._progressiveEls||this.group,r)},e.prototype._renderOnGridLike=function(r,n,i,a,s){var o=r.coordinateSystem,l=NS(o,"cartesian2d"),u=NS(o,"matrix"),h,d,f,p;if(l){var g=o.getAxis("x"),m=o.getAxis("y");h=sc(g).w+.5,d=sc(m).w+.5,f=g.scale.getExtent(),p=m.scale.getExtent()}for(var v=this.group,y=r.getData(),b=r.getModel(["emphasis","itemStyle"]).getItemStyle(),x=r.getModel(["blur","itemStyle"]).getItemStyle(),w=r.getModel(["select","itemStyle"]).getItemStyle(),A=r.get(["itemStyle","borderRadius"]),S=To(r),T=r.getModel("emphasis"),O=T.get("focus"),k=T.get("blurScope"),E=T.get("disabled"),_=l||u?[y.mapDimension("x"),y.mapDimension("y"),y.mapDimension("value")]:[y.mapDimension("time"),y.mapDimension("value")],I=i;If[1]||Mp[1])continue;var P=o.dataToPoint([D,M]);L=new tn({shape:{x:P[0]-h/2,y:P[1]-d/2,width:h,height:d},style:R})}else if(u){var N=o.dataToLayout([y.get(_[0],I),y.get(_[1],I)]).rect;if(Jl(N.x))continue;L=new tn({z2:1,shape:N,style:R})}else{if(isNaN(y.get(_[1],I)))continue;var F=o.dataToLayout([y.get(_[0],I)]),N=F.contentRect||F.rect;if(Jl(N.x)||Jl(N.y))continue;L=new tn({z2:1,shape:N,style:R})}if(y.hasItemOption){var B=y.getItemModel(I),V=B.getModel("emphasis");b=V.getModel("itemStyle").getItemStyle(),x=B.getModel(["blur","itemStyle"]).getItemStyle(),w=B.getModel(["select","itemStyle"]).getItemStyle(),A=B.get(["itemStyle","borderRadius"]),O=V.get("focus"),k=V.get("blurScope"),E=V.get("disabled"),S=To(B)}L.shape.r=A;var z=r.getRawValue(I),U="-";z&&z[2]!=null&&(U=z[2]+""),qo(L,S,{labelFetcher:r,labelDataIndex:I,defaultOpacity:R.opacity,defaultText:U}),L.ensureState("emphasis").style=b,L.ensureState("blur").style=x,L.ensureState("select").style=w,wa(L,O,k,E),L.incremental=xm(r,s),s&&(L.states.emphasis.hoverLayer=v_),v.add(L),y.setItemGraphicEl(I,L),this._progressiveEls&&this._progressiveEls.push(L)}},e.prototype._renderOnGeo=function(r,n,i,a){var s=i.targetVisuals.inRange,o=i.targetVisuals.outOfRange,l=n.getData(),u=this._hmLayer||this._hmLayer||new _$r;u.blurSize=n.get("blurSize"),u.pointSize=n.get("pointSize"),u.minOpacity=n.get("minOpacity"),u.maxOpacity=n.get("maxOpacity");var h=r.getViewRect().clone(),d=r.getRoamTransform();h.applyTransform(d);var f=Math.max(h.x,0),p=Math.max(h.y,0),g=Math.min(h.width+h.x,a.getWidth()),m=Math.min(h.height+h.y,a.getHeight()),v=g-f,y=m-p,b=[l.mapDimension("lng"),l.mapDimension("lat"),l.mapDimension("value")],x=l.mapArray(b,function(T,O,k){var E=r.dataToPoint([T,O]);return E[0]-=f,E[1]-=p,E.push(k),E}),w=i.getExtent(),A=i.type==="visualMap.continuous"?D$r(w,i.option.range):R$r(w,i.getPieceList(),i.option.selected);u.update(x,v,y,s.color.getNormalizer(),{inRange:s.color.getColorMapper(),outOfRange:o.color.getColorMapper()},A);var S=new Yo({style:{width:v,height:y,x:f,y:p,image:u.canvas},silent:!0});this.group.add(S)},e.type="heatmap",e}(Si),M$r=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.getInitialData=function(r,n){return Dm(null,this,{generateCoord:"value"})},e.prototype.preventIncremental=function(){var r=O_.get(this.get("coordinateSystem"));if(r&&r.dimensions)return r.dimensions[0]==="lng"&&r.dimensions[1]==="lat"},e.type="series.heatmap",e.dependencies=["grid","geo","calendar","matrix"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:et.color.primary}}},e}(Ri);function I$r(t){t.registerChartView(L$r),t.registerSeriesModel(M$r)}var P$r=["itemStyle","borderWidth"],nht=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],y0e=new Em,N$r=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=z8,r}return e.prototype.render=function(r,n,i){var a=this.group,s=r.getData(),o=this._data,l=r.coordinateSystem,u=l.getBaseAxis(),h=u.isHorizontal(),d=l.master.getRect(),f={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:r,coordSys:l,coordSysExtent:[[d.x,d.x+d.width],[d.y,d.y+d.height]],isHorizontal:h,valueDim:nht[+h],categoryDim:nht[1-+h]};s.diff(o).add(function(g){if(s.hasValue(g)){var m=uht(s,g),v=iht(s,g,m,f),y=hht(s,f,v);s.setItemGraphicEl(g,y),a.add(y),pht(y,f,v)}}).update(function(g,m){var v=o.getItemGraphicEl(m);if(!s.hasValue(g)){a.remove(v);return}var y=uht(s,g),b=iht(s,g,y,f),x=fht(s,b);v&&x!==v.__pictorialShapeStr&&(a.remove(v),s.setItemGraphicEl(g,null),v=null),v?Q$r(v,f,b):v=hht(s,f,b,!0),s.setItemGraphicEl(g,v),v.__pictorialSymbolMeta=b,a.add(v),pht(v,f,b)}).remove(function(g){var m=o.getItemGraphicEl(g);m&&dht(o,g,m.__pictorialSymbolMeta.animationModel,m)}).execute();var p=r.get("clip",!0)?PS(r.coordinateSystem,!1,r):null;return p?a.setClipPath(p):a.removeClipPath(),this._data=s,this.group},e.prototype.remove=function(r,n){var i=this.group,a=this._data;r.get("animation")?a&&a.eachItemGraphicEl(function(s){dht(a,Cr(s).dataIndex,r,s)}):i.removeAll()},e.type=z8,e}(Si);function iht(t,e,r,n){var i=t.getItemLayout(e),a=r.get("symbolRepeat"),s=r.get("symbolClip"),o=r.get("symbolPosition")||"start",l=r.get("symbolRotate"),u=(l||0)*Math.PI/180||0,h=r.get("symbolPatternSize")||2,d=r.isAnimationEnabled(),f={dataIndex:e,layout:i,itemModel:r,symbolType:t.getItemVisual(e,"symbol")||"circle",style:t.getItemVisual(e,"style"),symbolClip:s,symbolRepeat:a,symbolRepeatDirection:r.get("symbolRepeatDirection"),symbolPatternSize:h,rotation:u,animationModel:d?r:null,hoverScale:d&&r.get(["emphasis","scale"]),z2:r.getShallow("z",!0)||0};B$r(r,a,i,n,f),$$r(t,e,i,a,s,f.boundingLength,f.pxSign,h,n,f),F$r(r,f.symbolScale,u,n,f);var p=f.symbolSize,g=xS(r.get("symbolOffset"),p);return z$r(r,p,i,a,s,g,o,f.valueLineWidth,f.boundingLength,f.repeatCutLength,n,f),f}function B$r(t,e,r,n,i){var a=n.valueDim,s=t.get("symbolBoundingData"),o=n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()),l=o.toGlobalCoord(o.dataToCoord(0)),u=1-+(r[a.wh]<=0),h;if(ft(s)){var d=[b0e(o,s[0])-l,b0e(o,s[1])-l];d[1]=0?1:-1:h>0?1:-1}function b0e(t,e){return t.toGlobalCoord(t.dataToCoord(t.scale.parse(e)))}function $$r(t,e,r,n,i,a,s,o,l,u){var h=l.valueDim,d=l.categoryDim,f=Math.abs(r[d.wh]),p=t.getItemVisual(e,"symbolSize"),g;ft(p)?g=p.slice():p==null?g=["100%","100%"]:g=[p,p],g[d.index]=Qt(g[d.index],f),g[h.index]=Qt(g[h.index],n?f:Math.abs(a)),u.symbolSize=g;var m=u.symbolScale=[g[0]/o,g[1]/o];m[h.index]*=(l.isHorizontal?-1:1)*s}function F$r(t,e,r,n,i){var a=t.get(P$r)||0;a&&(y0e.attr({scaleX:e[0],scaleY:e[1],rotation:r}),y0e.updateTransform(),a/=y0e.getLineScale(),a*=e[n.valueDim.index]),i.valueLineWidth=a||0}function z$r(t,e,r,n,i,a,s,o,l,u,h,d){var f=h.categoryDim,p=h.valueDim,g=d.pxSign,m=Math.max(e[p.index]+o,0),v=m;if(n){var y=Math.abs(l),b=Pc(t.get("symbolMargin"),"15%")+"",x=!1;b.lastIndexOf("!")===b.length-1&&(x=!0,b=b.slice(0,b.length-1));var w=Qt(b,e[p.index]),A=Math.max(m+w*2,0),S=x?0:w*2,T=dde(n),O=T?n:ght((y+S)/A),k=y-O*m;w=k/2/(x?O:Math.max(O-1,1)),A=m+w*2,S=x?0:w*2,!T&&n!=="fixed"&&(O=u?ght((Math.abs(u)+S)/A):0),v=O*A-S,d.repeatTimes=O,d.symbolMargin=w}var E=g*(v/2),_=d.pathPosition=[];_[f.index]=r[f.wh]/2,_[p.index]=s==="start"?E:s==="end"?l-E:l/2,a&&(_[0]+=a[0],_[1]+=a[1]);var I=d.bundlePosition=[];I[f.index]=r[f.xy],I[p.index]=r[p.xy];var L=d.barRectShape=ot({},r);L[p.wh]=g*Math.max(Math.abs(r[p.wh]),Math.abs(_[p.index]+E)),L[f.wh]=r[f.wh];var R=d.clipShape={};R[f.xy]=-r[f.xy],R[f.wh]=h.ecSize[f.wh],R[p.xy]=0,R[p.wh]=r[p.wh]}function aht(t){var e=t.symbolPatternSize,r=$s(t.symbolType,-e/2,-e/2,e,e);return r.attr({culling:!0}),r.type!=="image"&&r.setStyle({strokeNoScale:!0}),r}function sht(t,e,r,n){var i=t.__pictorialBundle,a=r.symbolSize,s=r.valueLineWidth,o=r.pathPosition,l=e.valueDim,u=r.repeatTimes||0,h=0,d=a[e.valueDim.index]+s+r.symbolMargin*2;for(x0e(t,function(m){m.__pictorialAnimationIndex=h,m.__pictorialRepeatTimes=u,h0:y<0)&&(b=u-1-m),v[l.index]=d*(b-u/2+.5)+o[l.index],{x:v[0],y:v[1],scaleX:r.symbolScale[0],scaleY:r.symbolScale[1],rotation:r.rotation}}}function oht(t,e,r,n){var i=t.__pictorialBundle,a=t.__pictorialMainPath;a?d5(a,null,{x:r.pathPosition[0],y:r.pathPosition[1],scaleX:r.symbolScale[0],scaleY:r.symbolScale[1],rotation:r.rotation},r,n):(a=t.__pictorialMainPath=aht(r),i.add(a),d5(a,{x:r.pathPosition[0],y:r.pathPosition[1],scaleX:0,scaleY:0,rotation:r.rotation},{scaleX:r.symbolScale[0],scaleY:r.symbolScale[1]},r,n))}function lht(t,e,r){var n=ot({},e.barRectShape),i=t.__pictorialBarRect;i?d5(i,null,{shape:n},e,r):(i=t.__pictorialBarRect=new tn({z2:2,shape:n,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),i.disableMorphing=!0,t.add(i))}function cht(t,e,r,n){if(r.symbolClip){var i=t.__pictorialClipPath,a=ot({},r.clipShape),s=e.valueDim,o=r.animationModel,l=r.dataIndex;if(i)Hn(i,{shape:a},o,l);else{a[s.wh]=0,i=new tn({shape:a}),t.__pictorialBundle.setClipPath(i),t.__pictorialClipPath=i;var u={};u[s.wh]=r.clipShape[s.wh],oS[n?"updateProps":"initProps"](i,{shape:u},o,l)}}}function uht(t,e){var r=t.getItemModel(e);return r.getAnimationDelayParams=U$r,r.isAnimationEnabled=V$r,r}function U$r(t){return{index:t.__pictorialAnimationIndex,count:t.__pictorialRepeatTimes}}function V$r(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function hht(t,e,r,n){var i=new pr,a=new pr;return i.add(a),i.__pictorialBundle=a,a.x=r.bundlePosition[0],a.y=r.bundlePosition[1],r.symbolRepeat?sht(i,e,r):oht(i,e,r),lht(i,r,n),cht(i,e,r,n),i.__pictorialShapeStr=fht(t,r),i.__pictorialSymbolMeta=r,i}function Q$r(t,e,r){var n=r.animationModel,i=r.dataIndex,a=t.__pictorialBundle;Hn(a,{x:r.bundlePosition[0],y:r.bundlePosition[1]},n,i),r.symbolRepeat?sht(t,e,r,!0):oht(t,e,r,!0),lht(t,r,!0),cht(t,e,r,!0)}function dht(t,e,r,n){var i=n.__pictorialBarRect;i&&i.removeTextContent();var a=[];x0e(n,function(s){a.push(s)}),n.__pictorialMainPath&&a.push(n.__pictorialMainPath),n.__pictorialClipPath&&(r=null),de(a,function(s){yx(s,{scaleX:0,scaleY:0},r,e,function(){n.parent&&n.parent.remove(n)})}),t.setItemGraphicEl(e,null)}function fht(t,e){return[t.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function x0e(t,e,r){de(t.__pictorialBundle.children(),function(n){n!==t.__pictorialBarRect&&e.call(r,n)})}function d5(t,e,r,n,i,a){e&&t.attr(e),n.symbolClip&&!i?r&&t.attr(r):r&&oS[i?"updateProps":"initProps"](t,r,n.animationModel,n.dataIndex,a)}function pht(t,e,r){var n=r.dataIndex,i=r.itemModel,a=i.getModel("emphasis"),s=a.getModel("itemStyle").getItemStyle(),o=i.getModel(["blur","itemStyle"]).getItemStyle(),l=i.getModel(["select","itemStyle"]).getItemStyle(),u=i.getShallow("cursor"),h=a.get("focus"),d=a.get("blurScope"),f=a.get("scale");x0e(t,function(m){if(m instanceof Yo){var v=m.style;m.useStyle(ot({image:v.image,x:v.x,y:v.y,width:v.width,height:v.height},r.style))}else m.useStyle(r.style);var y=m.ensureState("emphasis");y.style=s,f&&(y.scaleX=m.scaleX*1.1,y.scaleY=m.scaleY*1.1),m.ensureState("blur").style=o,m.ensureState("select").style=l,u&&(m.cursor=u),m.z2=r.z2});var p=e.valueDim.posDesc[+(r.boundingLength>0)],g=t.__pictorialBarRect;g.ignoreClip=!0,qo(g,To(i),{labelFetcher:e.seriesModel,labelDataIndex:n,defaultText:Z_(e.seriesModel.getData(),n),inheritColor:r.style.fill,defaultOpacity:r.style.opacity,defaultOutsidePosition:p}),wa(t,h,d,a.get("disabled"))}function ght(t){var e=Math.round(t);return Math.abs(t-e)<1e-4?e:Math.ceil(t)}var G$r=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.hasSymbolVisual=!0,r.defaultSymbol="roundRect",r}return e.prototype.getInitialData=function(r){return r.stack=null,t.prototype.getInitialData.apply(this,arguments)},e.type="series."+z8,e.dependencies=["grid"],e.defaultOption=xx(U8.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",clip:!1,progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:et.color.primary}}}),e}(U8);function H$r(t){t.registerChartView(N$r),t.registerSeriesModel(G$r),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,Eot(z8)),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,_ot(z8)),Dot(t)}var w0e=2,f5="themeRiver",W$r=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new r5(Ht(this.getData,this),Ht(this.getRawData,this))},e.prototype.fixData=function(r){var n=r.length,i={},a=vde(r,function(f){return i.hasOwnProperty(f[0]+"")||(i[f[0]+""]=-1),f[2]}),s=[];a.buckets.each(function(f,p){s.push({name:p,dataList:f})});for(var o=s.length,l=0;la&&(a=o),n.push(o)}for(var u=0;ua&&(a=d)}return{y0:i,max:a}}function Z$r(t){t.registerChartView(Y$r),t.registerSeriesModel(W$r),t.registerLayout(j$r),t.registerProcessor(V8(f5))}var J$r=2,e9r=4,vht=function(t){rt(e,t);function e(r,n,i,a){var s=t.call(this)||this;s.z2=J$r,s.textConfig={inside:!0},Cr(s).seriesIndex=n.seriesIndex;var o=new Pn({z2:e9r,silent:r.getModel().get(["label","silent"])});return s.setTextContent(o),s.updateData(!0,r,n,i,a),s}return e.prototype.updateData=function(r,n,i,a,s){this.node=n,n.piece=this,i=i||this._seriesModel,a=a||this._ecModel;var o=this;Cr(o).dataIndex=n.dataIndex;var l=n.getModel(),u=l.getModel("emphasis"),h=n.getLayout(),d=ot({},h);d.label=null;var f=n.getVisual("style");f.lineJoin="bevel";var p=n.getVisual("decal");p&&(f.decal=B_(p,s));var g=$m(l.getModel("itemStyle"),d,!0);ot(d,g),de(wu,function(b){var x=o.ensureState(b),w=l.getModel([b,"itemStyle"]);x.style=w.getItemStyle();var A=$m(w,d);A&&(x.shape=A)}),r?(o.setShape(d),o.shape.r=h.r0,ia(o,{shape:{r:h.r}},i,n.dataIndex)):(Hn(o,{shape:d},i),zf(o)),o.useStyle(f),this._updateLabel(i);var m=l.getShallow("cursor");m&&o.attr("cursor",m),this._seriesModel=i||this._seriesModel,this._ecModel=a||this._ecModel;var v=u.get("focus"),y=v==="relative"?QE(n.getAncestorsIndices(),n.getDescendantIndices()):v==="ancestor"?n.getAncestorsIndices():v==="descendant"?n.getDescendantIndices():v;wa(this,y,u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(r){var n=this,i=this.node.getModel(),a=i.getModel("label"),s=this.node.getLayout(),o=s.endAngle-s.startAngle,l=(s.startAngle+s.endAngle)/2,u=Math.cos(l),h=Math.sin(l),d=this,f=d.getTextContent(),p=this.node.dataIndex,g=a.get("minAngle")/180*Math.PI,m=a.get("show")&&!(g!=null&&Math.abs(o)R&&!BA(M-R)&&M0?(s.virtualPiece?s.virtualPiece.updateData(!1,b,r,n,i):(s.virtualPiece=new vht(b,r,n,i),h.add(s.virtualPiece)),x.piece.off("click"),s.virtualPiece.on("click",function(w){s._rootToNode(x.parentNode)})):s.virtualPiece&&(h.remove(s.virtualPiece),s.virtualPiece=null)}},e.prototype._initEvents=function(){var r=this;this.group.off("click"),this.group.on("click",function(n){var i=!1,a=r.seriesModel.getViewRoot();a.eachNode(function(s){if(!i&&s.piece&&s.piece===n.target){var o=s.getModel().get("nodeClick");if(o==="rootToNode")r._rootToNode(s);else if(o==="link"){var l=s.getModel(),u=l.get("link");if(u){var h=l.get("target",!0)||"_blank";zH(u,h)}}i=!0}})})},e.prototype._rootToNode=function(r){r!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:A0e,from:this.uid,seriesId:this.seriesModel.id,targetNode:r})},e.prototype.containPoint=function(r,n){var i=n.getData(),a=i.getItemLayout(0);if(a){var s=r[0]-a.cx,o=r[1]-a.cy,l=Math.sqrt(s*s+o*o);return l<=a.r&&l>=a.r0}},e.type=eT,e}(Si),a9r=Ao(eT,s9r);function s9r(t){var e={};function r(n,i,a){if(n.depth===0)return et.color.neutral50;for(var s=n;s&&s.depth>1;)s=s.parentNode;var o=i.getColorFromPalette(s.name||s.dataIndex+"",e);return n.depth>1&&Nt(o)&&(o=_G(o,(n.depth-1)/(a-1)*.5)),o}t.eachSeriesByType(eT,function(n){var i=n.getData(),a=i.tree;a.eachNode(function(s){var o=s.getModel(),l=o.getModel("itemStyle").getItemStyle();l.fill||(l.fill=r(s,n,a.root.height));var u=i.ensureUniqueItemVisual(s.dataIndex,"style");ot(u,l)})})}var xht=Math.PI/180,o9r=Ao(eT,l9r);function l9r(t,e){t.eachSeriesByType(eT,function(r){var n=r.get("center"),i=r.get("radius");ft(i)||(i=[0,i]),ft(n)||(n=[n,n]);var a=e.getWidth(),s=e.getHeight(),o=Math.min(a,s),l=Qt(n[0],a),u=Qt(n[1],s),h=Qt(i[0],o/2),d=Qt(i[1],o/2),f=-r.get("startAngle")*xht,p=r.get("minAngle")*xht,g=r.getData().tree.root,m=r.getViewRoot(),v=m.depth,y=r.get("sort");y!=null&&wht(m,y);var b=0;de(m.children,function(D){!isNaN(D.getValue())&&b++});var x=m.getValue(),w=Math.PI/(x||b)*2,A=m.depth>0,S=m.height-(A?-1:1),T=(d-h)/(S||1),O=r.get("clockwise"),k=r.get("stillShowZeroSum"),E=O?1:-1,_=function(D,M){if(D){var P=M;if(D!==g){var N=D.getValue(),F=x===0&&k?w:N*w;Fn[1]&&n.reverse(),{coordSys:{type:"polar",cx:t.cx,cy:t.cy,r:n[1],r0:n[0]},api:{coord:function(i){var a=e.dataToRadius(i[0]),s=r.dataToAngle(i[1]),o=t.coordToPoint([a,s]);return o.push(a,s*Math.PI/180),o},size:Ht(b9r,t)}}}function w9r(t){var e=t.getRect(),r=t.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:t.getCellWidth(),cellHeight:t.getCellHeight(),rangeInfo:{start:r.start,end:r.end,weeks:r.weeks,dayCount:r.allDay}},api:{coord:function(n,i){return t.dataToPoint(n,i)},layout:function(n,i){return t.dataToLayout(n,i)}}}}function A9r(t){var e=t.getRect();return{coordSys:{type:"matrix",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(r,n){return t.dataToPoint(r,n)},layout:function(r,n){return t.dataToLayout(r,n)}}}}var Sht={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},Tht=kn(Sht);Rf(ry,function(t,e){return t[e]=1,t},{}),ry.join(", ");var BY=["","style","shape","extra"],p5=Qr();function S0e(t,e,r,n,i){var a=t+"Animation",s=g_(t,n,i)||{},o=p5(e).userDuring;return s.duration>0&&(s.during=o?Ht(k9r,{el:e,userDuring:o}):null,s.setToFinal=!0,s.scope=t),ot(s,r[a]),s}function $Y(t,e,r,n){n=n||{};var i=n.dataIndex,a=n.isInit,s=n.clearStyle,o=r.isAnimationEnabled(),l=p5(t),u=e.style;l.userDuring=e.during;var h={},d={};if(_9r(t,e,d),t.type==="compound")for(var f=t.shape.paths,p=e.shape.paths,g=0;g0&&t.animateFrom(v,y)}else T9r(t,e,i||0,r,h);Cht(t,e),u?t.dirty():t.markRedraw()}function Cht(t,e){for(var r=p5(t).leaveToProps,n=0;n0&&t.animateFrom(i,a)}}function C9r(t,e){Kt(e,"silent")&&(t.silent=e.silent),Kt(e,"ignore")&&(t.ignore=e.ignore),t instanceof $f&&Kt(e,"invisible")&&(t.invisible=e.invisible),t instanceof vn&&Kt(e,"autoBatch")&&(t.autoBatch=e.autoBatch)}var Um={},O9r={setTransform:function(t,e){return Um.el[t]=e,this},getTransform:function(t){return Um.el[t]},setShape:function(t,e){var r=Um.el,n=r.shape||(r.shape={});return n[t]=e,r.dirtyShape&&r.dirtyShape(),this},getShape:function(t){var e=Um.el.shape;if(e)return e[t]},setStyle:function(t,e){var r=Um.el,n=r.style;return n&&(n[t]=e,r.dirtyStyle&&r.dirtyStyle()),this},getStyle:function(t){var e=Um.el.style;if(e)return e[t]},setExtra:function(t,e){var r=Um.el.extra||(Um.el.extra={});return r[t]=e,this},getExtra:function(t){var e=Um.el.extra;if(e)return e[t]}};function k9r(){var t=this,e=t.el;if(e){var r=p5(e).userDuring,n=t.userDuring;if(r!==n){t.el=t.userDuring=null;return}Um.el=e,n(O9r)}}function Oht(t,e,r,n){var i=r[t];if(i){var a=e[t],s;if(a){var o=r.transition,l=i.transition;if(l)if(!s&&(s=n[t]={}),tT(l))ot(s,a);else for(var u=Qi(l),h=0;h=0){!s&&(s=n[t]={});for(var p=kn(a),h=0;h=0)){var f=t.getAnimationStyleProps(),p=f?f.style:null;if(p){!a&&(a=n.style={});for(var g=kn(r),u=0;u=0?e.getStore().get(N,M):void 0}var F=e.get(P.name,M),B=P&&P.ordinalMeta;return B?B.categories[F]:F}function T(D,M){M==null&&(M=h);var P=e.getItemVisual(M,"style"),N=P&&P.fill,F=P&&P.opacity,B=x(M,$x).getItemStyle();N!=null&&(B.fill=N),F!=null&&(B.opacity=F);var V={inheritColor:Nt(N)?N:et.color.neutral99},z=w(M,$x),U=Gi(z,null,V,!1,!0);U.text=z.getShallow("show")?Jt(t.getFormattedLabel(M,$x),Z_(e,M)):null;var Q=LH(z,V,!1);return E(D,B),B=rot(B,U,Q),D&&k(B,D),B.legacy=!0,B}function O(D,M){M==null&&(M=h);var P=x(M,wy).getItemStyle(),N=w(M,wy),F=Gi(N,null,null,!0,!0);F.text=N.getShallow("show")?Ch(t.getFormattedLabel(M,wy),t.getFormattedLabel(M,$x),Z_(e,M)):null;var B=LH(N,null,!0);return E(D,P),P=rot(P,F,B),D&&k(P,D),P.legacy=!0,P}function k(D,M){for(var P in M)Kt(M,P)&&(D[P]=M[P])}function E(D,M){D&&(D.textFill&&(M.textFill=D.textFill),D.textPosition&&(M.textPosition=D.textPosition))}function _(D,M){if(M==null&&(M=h),Kt(Aht,D)){var P=e.getItemVisual(M,"style");return P?P[Aht[D]]:null}if(Kt(h9r,D))return e.getItemVisual(M,D)}function I(D){if(s.type==="cartesian2d"){var M=s.getBaseAxis();return FIr(mr({axis:M},D))}}function L(){return r.getCurrentSeriesIndices()}function R(D){return mfe(D,r)}}function z9r(t){var e={};return de(t.dimensions,function(r){var n=t.getDimensionInfo(r);if(!n.isExtraCoord){var i=n.coordDim,a=e[i]=e[i]||[];a[n.coordDimIndex]=t.getDimensionIndex(r)}}),e}function M0e(t,e,r,n,i,a,s){if(!n){a.remove(e);return}var o=I0e(t,e,r,n,i,a);return o&&s.setItemGraphicEl(r,o),o&&wa(o,n.focus,n.blurScope,n.emphasisDisabled),o}function I0e(t,e,r,n,i,a){var s=-1,o=e;e&&Dht(e,n,i)&&(s=Ir(a.childrenRef(),e),e=null);var l=!e,u=e;u?u.clearStates():(u=D0e(n),o&&N9r(o,u)),n.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),n.tooltipDisabled&&(u.tooltipDisabled=!0),Xf.normal.cfg=Xf.normal.conOpt=Xf.emphasis.cfg=Xf.emphasis.conOpt=Xf.blur.cfg=Xf.blur.conOpt=Xf.select.cfg=Xf.select.conOpt=null,Xf.isLegacy=!1,V9r(u,r,n,i,l,Xf),U9r(u,r,n,i,l),L0e(t,u,r,n,Xf,i,l),Kt(n,"info")&&(xy(u).info=n.info);for(var h=0;h=0?a.replaceAt(u,s):a.add(u),u}function Dht(t,e,r){var n=xy(t),i=e.type,a=e.shape,s=e.style;return r.isUniversalTransitionEnabled()||i!=null&&i!==n.customGraphicType||i==="path"&&Y9r(a)&&Pht(a)!==n.customPathData||i==="image"&&Kt(s,"image")&&s.image!==n.customImagePath}function U9r(t,e,r,n,i){var a=r.clipPath;if(a===!1)t&&t.getClipPath()&&t.removeClipPath();else if(a){var s=t.getClipPath();s&&Dht(s,a,n)&&(s=null),s||(s=D0e(a),t.setClipPath(s)),L0e(null,s,e,a,null,n,i)}}function V9r(t,e,r,n,i,a){if(!(t.isGroup||t.type==="compoundPath")){Lht(r,null,a),Lht(r,wy,a);var s=a.normal.conOpt,o=a.emphasis.conOpt,l=a.blur.conOpt,u=a.select.conOpt;if(s!=null||o!=null||u!=null||l!=null){var h=t.getTextContent();if(s===!1)h&&t.removeTextContent();else{s=a.normal.conOpt=s||{type:"text"},h?h.clearStates():(h=D0e(s),t.setTextContent(h)),L0e(null,h,e,s,null,n,i);for(var d=s&&s.style,f=0;f=h;p--){var g=e.childAt(p);G9r(e,g,i)}}}function G9r(t,e,r){e&&FY(e,xy(t).option,r)}function H9r(t){new fy(t.oldChildren,t.newChildren,Mht,Mht,t).add(Iht).update(Iht).remove(W9r).execute()}function Mht(t,e){var r=t&&t.name;return r??I9r+e}function Iht(t,e){var r=this.context,n=t!=null?r.newChildren[t]:null,i=e!=null?r.oldChildren[e]:null;I0e(r.api,i,r.dataIndex,n,r.seriesModel,r.group)}function W9r(t){var e=this.context,r=e.oldChildren[t];r&&FY(r,xy(r).option,e.seriesModel)}function Pht(t){return t&&(t.pathData||t.d)}function Y9r(t){return t&&(Kt(t,"pathData")||Kt(t,"d"))}function q9r(t){t.registerChartView(B9r),t.registerSeriesModel(d9r)}var rT=Qr(),Nht=lr,N0e=Ht,B0e=function(){function t(){this._dragging=!1,this.animationThreshold=15}return t.prototype.render=function(e,r,n,i){var a=r.get("value"),s=r.get("status");if(this._axisModel=e,this._axisPointerModel=r,this._api=n,!(!i&&this._lastValue===a&&this._lastStatus===s)){this._lastValue=a,this._lastStatus=s;var o=this._group,l=this._handle;if(!s||s==="hide"){o&&o.hide(),l&&l.hide();return}o&&o.show(),l&&l.show();var u={};this.makeElOption(u,a,e,r,n);var h=u.graphicKey;h!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=h;var d=this._moveAnimation=this.determineAnimation(e,r);if(!o)o=this._group=new pr,this.createPointerEl(o,u,e,r),this.createLabelEl(o,u,e,r),n.getZr().add(o);else{var f=qr(Bht,r,d);this.updatePointerEl(o,u,f),this.updateLabelEl(o,u,f,r)}zht(o,r,!0),this._renderHandle(a)}},t.prototype.remove=function(e){this.clear(e)},t.prototype.dispose=function(e){this.clear(e)},t.prototype.determineAnimation=function(e,r){var n=r.get("animation"),i=e.axis,a=i.type==="category",s=r.get("snap");if(!s&&!a)return!1;if(n==="auto"||n==null){var o=this.animationThreshold;if(a&&sc(i).w>o)return!0;if(s){var l=Yge(e).seriesDataCount,u=i.getExtent();return Math.abs(u[0]-u[1])/l>o}return!1}return n===!0},t.prototype.makeElOption=function(e,r,n,i,a){},t.prototype.createPointerEl=function(e,r,n,i){var a=r.pointer;if(a){var s=rT(e).pointerEl=new oS[a.type](Nht(r.pointer));e.add(s)}},t.prototype.createLabelEl=function(e,r,n,i){if(r.label){var a=rT(e).labelEl=new Pn(Nht(r.label));e.add(a),Fht(a,i)}},t.prototype.updatePointerEl=function(e,r,n){var i=rT(e).pointerEl;i&&r.pointer&&(i.setStyle(r.pointer.style),n(i,{shape:r.pointer.shape}))},t.prototype.updateLabelEl=function(e,r,n,i){var a=rT(e).labelEl;a&&(a.setStyle(r.label.style),n(a,{x:r.label.x,y:r.label.y}),Fht(a,i))},t.prototype._renderHandle=function(e){if(!(this._dragging||!this.updateHandleTransform)){var r=this._axisPointerModel,n=this._api.getZr(),i=this._handle,a=r.getModel("handle"),s=r.get("status");if(!a.get("show")||!s||s==="hide"){i&&n.remove(i),this._handle=null;return}var o;this._handle||(o=!0,i=this._handle=x_(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){Kv(u.event)},onmousedown:N0e(this._onHandleDragMove,this,0,0),drift:N0e(this._onHandleDragMove,this),ondragend:N0e(this._onHandleDragEnd,this)}),n.add(i)),zht(i,r,!1),i.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");ft(l)||(l=[l,l]),i.scaleX=l[0]/2,i.scaleY=l[1]/2,D_(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,o)}},t.prototype._moveHandleToValue=function(e,r){Bht(this._axisPointerModel,!r&&this._moveAnimation,this._handle,$0e(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(e,r){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform($0e(n),[e,r],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr($0e(i)),rT(n).lastProp=null,this._doDispatchAxisPointer()}},t.prototype._doDispatchAxisPointer=function(){var e=this._handle;if(e){var r=this._payloadInfo,n=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:r.cursorPoint[0],y:r.cursorPoint[1],tooltipOption:r.tooltipOption,axesInfo:[{axisDim:n.axis.dim,axisIndex:n.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){this._dragging=!1;var e=this._handle;if(e){var r=this._axisPointerModel.get("value");this._moveHandleToValue(r),this._api.dispatchAction({type:"hideTip"})}},t.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var r=e.getZr(),n=this._group,i=this._handle;r&&n&&(this._lastGraphicKey=null,n&&r.remove(n),i&&r.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),s8(this,"_doDispatchAxisPointer")},t.prototype.doClear=function(){},t.prototype.buildLabel=function(e,r,n){return n=n||0,{x:e[n],y:e[1-n],width:r[n],height:r[1-n]}},t}();function Bht(t,e,r,n){$ht(rT(r).lastProp,n)||(rT(r).lastProp=n,e?Hn(r,n,t):(r.stopAnimation(),r.attr(n)))}function $ht(t,e){if(yr(t)&&yr(e)){var r=!0;return de(e,function(n,i){r=r&&$ht(t[i],n)}),!!r}else return t===e}function Fht(t,e){t[e.get(["label","show"])?"show":"hide"]()}function $0e(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function zht(t,e,r){var n=e.get("z"),i=e.get("zlevel");t&&t.traverse(function(a){a.type!=="group"&&(n!=null&&(a.z=n),i!=null&&(a.zlevel=i),a.silent=r)})}function F0e(t){var e=t.get("type"),r=t.getModel(e+"Style"),n;return e==="line"?(n=r.getLineStyle(),n.fill=null):e==="shadow"&&(n=r.getAreaStyle(),n.stroke=null),n}function Uht(t,e,r,n,i){var a=r.get("value"),s=Vht(a,e.axis,e.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),o=r.getModel("label"),l=C_(o.get("padding")||0),u=o.getFont(),h=VG(s,u),d=i.position,f=h.width+l[1]+l[3],p=h.height+l[0]+l[2],g=i.align;g==="right"&&(d[0]-=f),g==="center"&&(d[0]-=f/2);var m=i.verticalAlign;m==="bottom"&&(d[1]-=p),m==="middle"&&(d[1]-=p/2),j9r(d,f,p,n);var v=o.get("backgroundColor");(!v||v==="auto")&&(v=e.get(["axisLine","lineStyle","color"])),t.label={x:d[0],y:d[1],style:Gi(o,{text:s,font:u,fill:o.getTextColor(),padding:l,backgroundColor:v}),z2:10}}function j9r(t,e,r,n){var i=n.getWidth(),a=n.getHeight();t[0]=Math.min(t[0]+e,i)-e,t[1]=Math.min(t[1]+r,a)-r,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}function Vht(t,e,r,n,i){t=e.scale.parse(t);var a=e.scale.getLabel({value:t},{precision:i.precision}),s=i.formatter;if(s){var o={value:EW(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};de(n,function(l){var u=r.getSeriesByIndex(l.seriesIndex),h=l.dataIndexInside,d=u&&u.getDataParams(h);d&&o.seriesData.push(d)}),Nt(s)?a=s.replace("{value}",a):ur(s)&&(a=s(o))}return a}function z0e(t,e,r){var n=xa();return Zv(n,n,r.rotation),zp(n,n,r.position),Wp([t.dataToCoord(e),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],n)}function Qht(t,e,r,n,i,a){var s=Ou.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=i.get(["label","margin"]),Uht(e,n,i,a,{position:z0e(n.axis,t,r),align:s.textAlign,verticalAlign:s.textVerticalAlign})}function U0e(t,e,r){return r=r||0,{x1:t[r],y1:t[1-r],x2:e[r],y2:e[1-r]}}function Ght(t,e,r){return r=r||0,{x:t[r],y:t[1-r],width:e[r],height:e[1-r]}}function Hht(t,e,r,n,i,a){return{cx:t,cy:e,r0:r,r:n,startAngle:i,endAngle:a,clockwise:!0}}function V0e(t,e,r){return sc(t,{fromStat:{sers:vt(e,function(n){return r.getSeriesByIndex(n.seriesIndex)})},min:1}).w}function Q0e(t,e,r){return[en(Ai(e[0],e[1]),t-r/2),Ai(t+r/2,en(e[0],e[1]))]}var X9r=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.makeElOption=function(r,n,i,a,s){var o=i.axis,l=o.grid,u=a.get("type"),h=o.getGlobalExtent(),d=Wht(l,o).getOtherAxis(o).getGlobalExtent(),f=o.toGlobalCoord(o.dataToCoord(n,!0));if(u&&u!=="none"){var p=F0e(a),g=K9r[u](o,f,h,d,a.get("seriesDataIndices"),a.ecModel);g.style=p,r.graphicKey=g.type,r.pointer=g}var m=qW(l.getRect(),i);Qht(n,r,m,i,a,s)},e.prototype.getHandleTransform=function(r,n,i){var a=qW(n.axis.grid.getRect(),n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var s=z0e(n.axis,r,a);return{x:s[0],y:s[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(r,n,i,a){var s=i.axis,o=s.grid,l=s.getGlobalExtent(!0),u=Wht(o,s).getOtherAxis(s).getGlobalExtent(),h=s.dim==="x"?0:1,d=[r.x,r.y];d[h]+=n[h],d[h]=Ai(l[1],d[h]),d[h]=en(l[0],d[h]);var f=(u[1]+u[0])/2,p=[f,f];p[h]=d[h];var g=[{verticalAlign:"middle"},{align:"center"}];return{x:d[0],y:d[1],rotation:r.rotation,cursorPoint:p,tooltipOption:g[h]}},e}(B0e);function Wht(t,e){var r={};return r[e.dim+"AxisIndex"]=e.index,t.getCartesian(r)}var K9r={line:function(t,e,r,n){var i=U0e([e,n[0]],[e,n[1]],Yht(t));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(t,e,r,n,i,a){var s=V0e(t,i,a),o=n[1]-n[0],l=Q0e(e,r,s),u=l[0],h=l[1];return{type:"Rect",shape:Ght([u,n[0]],[h-u,o],Yht(t))}}};function Yht(t){return t.dim==="x"?0:1}var Z9r=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="axisPointer",e.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:et.color.border,width:1,type:"dashed"},shadowStyle:{color:et.color.shadowTint},label:{show:!0,formatter:null,precision:"auto",margin:3,color:et.color.neutral00,padding:[5,7,5,7],backgroundColor:et.color.accent60,borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:et.color.accent40,throttle:40}},e}(fn),Ay=Qr(),J9r=de;function qht(t,e,r){if(!Rn.node){var n=e.getZr();Ay(n).records||(Ay(n).records={}),eFr(n,e);var i=Ay(n).records[t]||(Ay(n).records[t]={});i.handler=r}}function eFr(t,e){if(Ay(t).initialized)return;Ay(t).initialized=!0,r("click",qr(G0e,"click")),r("mousemove",qr(G0e,"mousemove")),r("mousewheel",qr(G0e,"mousewheel")),r("globalout",rFr);function r(n,i){t.on(n,function(a){var s=nFr(e);J9r(Ay(t).records,function(o){o&&i(o,a,s.dispatchAction)}),tFr(s.pendings,e)})}}function tFr(t,e){var r=t.showTip.length,n=t.hideTip.length,i;r?i=t.showTip[r-1]:n&&(i=t.hideTip[n-1]),i&&(i.dispatchAction=null,e.dispatchAction(i))}function rFr(t,e,r){t.handler("leave",null,r)}function G0e(t,e,r,n){e.handler(t,r,n)}function nFr(t){var e={showTip:[],hideTip:[]},r=function(n){var i=e[n.type];i?i.push(n):(n.dispatchAction=r,t.dispatchAction(n))};return{dispatchAction:r,pendings:e}}function H0e(t,e){if(!Rn.node){var r=e.getZr(),n=(Ay(r).records||{})[t];n&&(Ay(r).records[t]=null)}}var iFr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){var a=n.getComponent("tooltip"),s=r.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click|mousewheel";qht("axisPointer",i,function(o,l,u){s!=="none"&&(o==="leave"||s.indexOf(o)>=0)&&u({type:"updateAxisPointer",currTrigger:o,x:l&&l.offsetX,y:l&&l.offsetY})})},e.prototype.remove=function(r,n){H0e("axisPointer",n)},e.prototype.dispose=function(r,n){H0e("axisPointer",n)},e.type="axisPointer",e}(Hi);function jht(t,e){var r=[],n=t.seriesIndex,i;if(n==null||!(i=e.getSeriesByIndex(n)))return{point:[]};var a=i.getData(),s=FA(a,t);if(s==null||s<0||ft(s))return{point:[]};var o=a.getItemGraphicEl(s),l=i.coordinateSystem;if(i.getTooltipPosition)r=i.getTooltipPosition(s)||[];else if(l&&l.dataToPoint)if(t.isStacked){var u=l.getBaseAxis(),h=l.getOtherAxis(u),d=h.dim,f=u.dim,p=d==="x"||d==="radius"?1:0,g=a.mapDimension(f),m=[];m[p]=a.get(g,s),m[1-p]=a.get(a.getCalculationInfo("stackResultDimension"),s),r=l.dataToPoint(m)||[]}else r=l.dataToPoint(a.getValues(vt(l.dimensions,function(y){return a.mapDimension(y)}),s))||[];else if(o){var v=o.getBoundingRect().clone();v.applyTransform(o.transform),r=[v.x+v.width/2,v.y+v.height/2]}return{point:r,el:o}}var Xht=Qr();function aFr(t,e,r){var n=t.currTrigger,i=[t.x,t.y],a=t,s=t.dispatchAction||Ht(r.dispatchAction,r),o=e.getComponent("axisPointer").coordSysAxesInfo;if(o){VY(i)&&(i=jht({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},e).point);var l=VY(i),u=a.axesInfo,h=o.axesInfo,d=n==="leave"||VY(i),f={},p={},g={list:[],map:{}},m={showPointer:qr(oFr,p),showTooltip:qr(lFr,g)};de(o.coordSysMap,function(y,b){var x=l||y.containPoint(i);de(o.coordSysAxesInfo[b],function(w,A){var S=w.axis,T=dFr(u,w);if(!d&&x&&(!u||T)){var O=T&&T.value;O==null&&!l&&(O=S.pointToData(i)),O!=null&&Kht(w,O,m,!1,f)}})});var v={};return de(h,function(y,b){var x=y.linkGroup;x&&!p[b]&&de(x.axesInfo,function(w,A){var S=p[A];if(w!==y&&S){var T=S.value;x.mapper&&(T=y.axis.scale.parse(x.mapper(T,Zht(w),Zht(y)))),v[y.key]=T}})}),de(v,function(y,b){Kht(h[b],y,m,!0,f)}),cFr(p,h,f),uFr(g,i,t,s),hFr(h,s,r),f}}function Kht(t,e,r,n,i){var a=t.axis;if(!(a.scale.isBlank()||!a.containData(e))){if(!t.involveSeries){r.showPointer(t,e);return}var s=sFr(e,t),o=s.payloadBatch,l=s.snapToValue;o[0]&&i.seriesIndex==null&&ot(i,o[0]),!n&&t.snap&&a.containData(l)&&l!=null&&(e=l),r.showPointer(t,e,o),r.showTooltip(t,s,l)}}function sFr(t,e){var r=e.axis,n=r.dim,i=t,a=[],s=Number.MAX_VALUE,o=-1;return de(e.seriesModels,function(l,u){var h=l.getData().mapDimensionsAll(n),d,f;if(l.getAxisTooltipData){var p=l.getAxisTooltipData(h,t,r);f=p.dataIndices,d=p.nestestValue}else{if(f=l.indicesOfNearest(n,h[0],t,r.type==="category"?.5:null),!f.length)return;d=l.getData().get(h[0],f[0])}if(Bf(d)){var g=t-d,m=Math.abs(g);m<=s&&((m=0&&o<0)&&(s=m,o=g,i=d,a.length=0),de(f,function(v){a.push({seriesIndex:l.seriesIndex,dataIndexInside:v,dataIndex:l.getData().getRawIndex(v)})}))}}),{payloadBatch:a,snapToValue:i}}function oFr(t,e,r,n){t[e.key]={value:r,payloadBatch:n}}function lFr(t,e,r,n){var i=r.payloadBatch,a=e.axis,s=a.model,o=e.axisPointerModel;if(!(!e.triggerTooltip||!i.length)){var l=e.coordSys.model,u=Q8(l),h=t.map[u];h||(h=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(h)),h.dataByAxis.push({axisDim:a.dim,axisIndex:s.componentIndex,axisType:s.type,axisId:s.id,value:n,valueLabelOpt:{precision:o.get(["label","precision"]),formatter:o.get(["label","formatter"])},seriesDataIndices:i.slice()})}}function cFr(t,e,r){var n=r.axesInfo=[];de(e,function(i,a){var s=i.axisPointerModel.option,o=t[a];o?(!i.useHandle&&(s.status="show"),s.value=o.value,s.seriesDataIndices=(o.payloadBatch||[]).slice()):!i.useHandle&&(s.status="hide"),s.status==="show"&&n.push({axisDim:i.axis.dim,axisIndex:i.axis.model.componentIndex,value:s.value})})}function uFr(t,e,r,n){if(VY(e)||!t.list.length){n({type:"hideTip"});return}var i=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:r.tooltipOption,position:r.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:t.list})}function hFr(t,e,r){var n=r.getZr(),i="axisPointerLastHighlights",a=Xht(n)[i]||{},s=Xht(n)[i]={};de(t,function(h,d){var f=h.axisPointerModel.option;f.status==="show"&&h.triggerEmphasis&&de(f.seriesDataIndices,function(p){s[p.seriesIndex+"|"+p.dataIndex]=p})});var o=[],l=[];function u(h){return{seriesIndex:h.seriesIndex,dataIndex:h.dataIndex}}de(a,function(h,d){!s[d]&&l.push(u(h))}),de(s,function(h,d){!a[d]&&o.push(u(h))}),l.length&&r.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),o.length&&r.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:o})}function dFr(t,e){for(var r=0;r<(t||[]).length;r++){var n=t[r];if(e.axis.dim===n.axisDim&&e.axis.model.componentIndex===n.axisIndex)return n}}function Zht(t){var e=t.axis.model,r={},n=r.axisDim=t.axis.dim;return r.axisIndex=r[n+"AxisIndex"]=e.componentIndex,r.axisName=r[n+"AxisName"]=e.name,r.axisId=r[n+"AxisId"]=e.id,r}function VY(t){return!t||t[0]==null||isNaN(t[0])||t[1]==null||isNaN(t[1])}function fB(t){US.registerAxisPointerClass("CartesianAxisPointer",X9r),t.registerComponentModel(Z9r),t.registerComponentView(iFr),t.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var r=e.axisPointer.link;r&&!ft(r)&&(e.axisPointer.link=[r])}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,{overallReset:function(e,r){e.getComponent("axisPointer").coordSysAxesInfo=IPr(e,r)}}),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},aFr)}function fFr(t){Yr(glt),Yr(fB)}var pFr=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.makeElOption=function(r,n,i,a,s){var o=i.axis;o.dim==="angle"&&(this.animationThreshold=Math.PI/18);var l=o.polar,u=o.getExtent(),h=l.getOtherAxis(o).getExtent(),d=o.dataToCoord(n),f=a.get("type");if(f&&f!=="none"){var p=F0e(a),g=mFr[f](o,l,d,u,h,a.get("seriesDataIndices"),a.ecModel);g.style=p,r.graphicKey=g.type,r.pointer=g}var m=a.get(["label","margin"]),v=gFr(n,i,a,l,m);Uht(r,i,a,s,v)},e}(B0e);function gFr(t,e,r,n,i){var a=e.axis,s=a.dataToCoord(t),o=n.getAngleAxis().getExtent()[0];o=o/180*Math.PI;var l=n.getRadiusAxis().getExtent(),u,h,d;if(a.dim==="radius"){var f=xa();Zv(f,f,o),zp(f,f,[n.cx,n.cy]),u=Wp([s,-i],f);var p=e.getModel("axisLabel").get("rotate")||0,g=Ou.innerTextLayout(o,p*Math.PI/180,-1);h=g.textAlign,d=g.textVerticalAlign}else{var m=l[1];u=n.coordToPoint([m+i,s]);var v=n.cx,y=n.cy;h=Math.abs(u[0]-v)/m<.3?"center":u[0]>v?"left":"right",d=Math.abs(u[1]-y)/m<.3?"middle":u[1]>y?"top":"bottom"}return{position:u,align:h,verticalAlign:d}}var mFr={line:function(t,e,r,n,i){return t.dim==="angle"?{type:"Line",shape:U0e(e.coordToPoint([i[0],r]),e.coordToPoint([i[1],r]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r}}},shadow:function(t,e,r,n,i,a,s){var o=Math.PI/180,l=V0e(t,a,s),u;if(t.dim==="angle")u=Hht(e.cx,e.cy,i[0],i[1],(-r-l/2)*o,(-r+l/2)*o);else{var h=Q0e(r,n,l),d=h[0],f=h[1];u=Hht(e.cx,e.cy,d,f,0,Math.PI*2)}return{type:"Sector",shape:u}}},Vm="polar",Jht=Vm,vFr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.findAxisModel=function(r){var n,i=this.ecModel;return i.eachComponent(r,function(a){a.getCoordSysModel()===this&&(n=a)},this),n},e.type=Vm,e.dependencies=["radiusAxis","angleAxis"],e.defaultOption={z:0,center:["50%","50%"],radius:"80%"},e}(fn),W0e=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",ds).models[0]},e.type="polarAxis",e}(fn);Is(W0e,Y_);var yFr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="angleAxis",e}(W0e),bFr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="radiusAxis",e}(W0e),Y0e=function(t){rt(e,t);function e(r,n){return t.call(this,"radius",r,n)||this}return e.prototype.pointToData=function(r,n){return this.polar.pointToData(r,n)[this.dim==="radius"?0:1]},e}(Wf);Y0e.prototype.dataToRadius=Wf.prototype.dataToCoord,Y0e.prototype.radiusToData=Wf.prototype.coordToData;var xFr=Qr(),q0e=function(t){rt(e,t);function e(r,n){return t.call(this,"angle",r,n||[0,360])||this}return e.prototype.pointToData=function(r,n){return this.polar.pointToData(r,n)[this.dim==="radius"?0:1]},e.prototype.calculateCategoryInterval=function(){var r=this,n=r.getLabelModel(),i=r.scale,a=i.getExtent(),s=i.count();if(a[1]-a[0]<1)return 0;var o=a[0],l=r.dataToCoord(o+1)-r.dataToCoord(o),u=Math.abs(l),h=VG(o==null?"":o+"",n.getFont(),"center","top"),d=Math.max(h.height,7),f=d/u;isNaN(f)&&(f=1/0);var p=Math.max(0,Math.floor(f)),g=xFr(r.model),m=g.lastAutoInterval,v=g.lastTickCount;return m!=null&&v!=null&&Math.abs(m-p)<=1&&Math.abs(v-s)<=1&&m>p?p=m:(g.lastTickCount=s,g.lastAutoInterval=p),p},e}(Wf);q0e.prototype.dataToAngle=Wf.prototype.dataToCoord,q0e.prototype.angleToData=Wf.prototype.coordToData;var edt=["radius","angle"],wFr=function(){function t(e){this.dimensions=edt,this.type=Vm,this.cx=0,this.cy=0,this._radiusAxis=new Y0e,this._angleAxis=new q0e,this.axisPointerEnabled=!0,this.name=e||"",this._radiusAxis.polar=this._angleAxis.polar=this}return t.prototype.containPoint=function(e){var r=this.pointToCoord(e);return this._radiusAxis.contain(r[0])&&this._angleAxis.contain(r[1])},t.prototype.containData=function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},t.prototype.getAxis=function(e){var r="_"+e+"Axis";return this[r]},t.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},t.prototype.getAxesByScale=function(e){var r=[],n=this._angleAxis,i=this._radiusAxis;return n.scale.type===e&&r.push(n),i.scale.type===e&&r.push(i),r},t.prototype.getAngleAxis=function(){return this._angleAxis},t.prototype.getRadiusAxis=function(){return this._radiusAxis},t.prototype.getOtherAxis=function(e){var r=this._angleAxis;return e===r?this._radiusAxis:r},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},t.prototype.getTooltipAxes=function(e){var r=e!=null&&e!=="auto"?this.getAxis(e):this.getBaseAxis();return{baseAxes:[r],otherAxes:[this.getOtherAxis(r)]}},t.prototype.dataToPoint=function(e,r,n){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],r),this._angleAxis.dataToAngle(e[1],r)],n)},t.prototype.pointToData=function(e,r,n){n=n||[];var i=this.pointToCoord(e);return n[0]=this._radiusAxis.radiusToData(i[0],r),n[1]=this._angleAxis.angleToData(i[1],r),n},t.prototype.pointToCoord=function(e){var r=e[0]-this.cx,n=e[1]-this.cy,i=this.getAngleAxis(),a=i.getExtent(),s=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]);i.inverse?s=o-360:o=s+360;var l=Math.sqrt(r*r+n*n);r/=l,n/=l;for(var u=Math.atan2(-n,r)/Math.PI*180,h=uo;)u+=h*360;return[l,u]},t.prototype.coordToPoint=function(e,r){r=r||[];var n=e[0],i=e[1]/180*Math.PI;return r[0]=Math.cos(i)*n+this.cx,r[1]=-Math.sin(i)*n+this.cy,r},t.prototype.getArea=function(){var e=this.getAngleAxis(),r=this.getRadiusAxis(),n=r.getExtent().slice();n[0]>n[1]&&n.reverse();var i=e.getExtent(),a=Math.PI/180,s=1e-4;return{cx:this.cx,cy:this.cy,r0:n[0],r:n[1],startAngle:-i[0]*a,endAngle:-i[1]*a,clockwise:e.inverse,contain:function(o,l){var u=o-this.cx,h=l-this.cy,d=u*u+h*h,f=this.r,p=this.r0;return f!==p&&d-s<=f*f&&d+s>=p*p},x:this.cx-n[1],y:this.cy-n[1],width:n[1]*2,height:n[1]*2}},t.prototype.convertToPixel=function(e,r,n){var i=tdt(r);return i===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,r,n){var i=tdt(r);return i===this?this.pointToData(n):null},t}();function tdt(t){var e=t.seriesModel,r=t.polarModel;return r&&r.coordinateSystem||e&&e.coordinateSystem}function AFr(t,e,r){var n=e.get("center"),i=Co(e,r).refContainer;t.cx=Qt(n[0],i.width)+i.x,t.cy=Qt(n[1],i.height)+i.y;var a=t.getRadiusAxis(),s=Math.min(i.width,i.height)/2,o=e.get("radius");o==null?o=[0,"100%"]:ft(o)||(o=[0,o]);var l=[Qt(o[0],s),Qt(o[1],s)];a.inverse?a.setExtent(l[1],l[0]):a.setExtent(l[0],l[1])}function SFr(t,e){var r=this,n=r.getAngleAxis(),i=r.getRadiusAxis();if(ES(n,j_),ES(i,j_),X_(n),X_(i),n.type==="category"&&!n.onBand){var a=n.getExtent(),s=360/n.scale.count();n.inverse?a[1]+=s:a[1]-=s,n.setExtent(a[0],a[1])}}function TFr(t){return t.mainType==="angleAxis"}function rdt(t,e){var r;if(t.type=w8(e),t.scale=G_(e,t.type,!1),t.onBand=T8(t.scale,e),t.inverse=e.get("inverse"),TFr(e)){t.inverse=t.inverse!==e.get("clockwise");var n=e.get("startAngle"),i=(r=e.get("endAngle"))!==null&&r!==void 0?r:n+(t.inverse?-360:360);t.setExtent(n,i)}e.axis=t,t.model=e}var CFr={dimensions:edt,create:function(t,e){var r=[];return t.eachComponent(Jht,function(n,i){var a=new wFr(i+"");a.update=SFr;var s=a.getRadiusAxis(),o=a.getAngleAxis(),l=n.findAxisModel("radiusAxis"),u=n.findAxisModel("angleAxis");rdt(s,l),rdt(o,u),AFr(a,n,e),r.push(a),n.coordinateSystem=a,a.model=n}),t.eachSeries(function(n){if(n.get("coordinateSystem")===Vm){var i=n.getReferringComponents(Jht,ds).models[0],a=n.coordinateSystem=i.coordinateSystem;a&&(kS(a.getRadiusAxis(),n,Vm),kS(a.getAngleAxis(),n,Vm))}}),r}},OFr=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function QY(t,e,r){e[1]>e[0]&&(e=e.slice().reverse());var n=t.coordToPoint([e[0],r]),i=t.coordToPoint([e[1],r]);return{x1:n[0],y1:n[1],x2:i[0],y2:i[1]}}function GY(t){var e=t.getRadiusAxis();return e.inverse?0:1}function ndt(t){var e=t[0],r=t[t.length-1];e&&r&&Math.abs(Math.abs(e.coord-r.coord)-360)<1e-4&&t.pop()}var kFr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.axisPointerClass="PolarAxisPointer",r}return e.prototype.render=function(r,n){if(this.group.removeAll(),!!r.get("show")){var i=r.axis,a=i.polar,s=a.getRadiusAxis().getExtent(),o=i.getTicksCoords({breakTicks:"none"}),l=i.getMinorTicksCoords(),u=[];de(i.getViewLabels(),function(h){if(!h.tick.offInterval){h=lr(h);var d=i.scale;h.coord=i.dataToCoord(W_(d,h.tick)),u.push(h)}}),ndt(u),ndt(o),de(OFr,function(h){r.get([h,"show"])&&(!i.scale.isBlank()||h==="axisLine")&&EFr[h](this.group,r,a,o,l,s,u)},this)}},e.type="angleAxis",e}(US),EFr={axisLine:function(t,e,r,n,i,a){var s=e.getModel(["axisLine","lineStyle"]),o=r.getAngleAxis(),l=Math.PI/180,u=o.getExtent(),h=GY(r),d=h?0:1,f,p=Math.abs(u[1]-u[0])===360?"Circle":"Arc";a[d]===0?f=new oS[p]({shape:{cx:r.cx,cy:r.cy,r:a[h],startAngle:-u[0]*l,endAngle:-u[1]*l,clockwise:o.inverse},style:s.getLineStyle(),z2:1,silent:!0}):f=new f_({shape:{cx:r.cx,cy:r.cy,r:a[h],r0:a[d]},style:s.getLineStyle(),z2:1,silent:!0}),f.style.fill=null,t.add(f)},axisTick:function(t,e,r,n,i,a){var s=e.getModel("axisTick"),o=(s.get("inside")?-1:1)*s.get("length"),l=a[GY(r)],u=vt(n,function(h){return new Ps({shape:QY(r,[l,l+o],h.coord)})});t.add(Dd(u,{style:mr(s.getModel("lineStyle").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})}))},minorTick:function(t,e,r,n,i,a){if(i.length){for(var s=e.getModel("axisTick"),o=e.getModel("minorTick"),l=(s.get("inside")?-1:1)*o.get("length"),u=a[GY(r)],h=[],d=0;dy?"left":"right",w=Math.abs(v[1]-b)/m<.3?"middle":v[1]>b?"top":"bottom";if(o&&o[g]){var A=o[g];yr(A)&&A.textStyle&&(p=new yn(A.textStyle,l,l.ecModel))}var S=new Pn({silent:Ou.isLabelSilent(e),style:Gi(p,{x:v[0],y:v[1],fill:p.getTextColor()||e.get(["axisLine","lineStyle","color"]),text:d.formattedLabel,align:x,verticalAlign:w})});if(t.add(S),uy({el:S,componentModel:e,itemName:d.formattedLabel,formatterParamsExtra:{isTruncated:function(){return S.isTruncated},value:d.rawLabel,tickIndex:f}}),h){var T=Ou.makeAxisEventDataBase(e);T.targetType="axisLabel",T.value=d.rawLabel,Cr(S).eventData=T}},this)},splitLine:function(t,e,r,n,i,a){var s=e.getModel("splitLine"),o=s.getModel("lineStyle"),l=o.get("color"),u=0;l=l instanceof Array?l:[l];for(var h=[],d=0;d=0?"p":"n",k=x;y&&(n[a][T]||(n[a][T]={p:x,n:x}),k=n[a][T][O]);var E=void 0,_=void 0,I=void 0,L=void 0;if(h.dim==="radius"){var R=h.dataToCoord(S)-x,D=t.dataToCoord(T);Za(R)=L})}}function BFr(t,e){var r=zS(e,Vm),n=sc(t,{fromStat:{key:r},min:1}).w,i=n,a=0,s="20%",o="30%",l={};OS(t,r,function(v){var y=idt(v);l[y]||a++,l[y]=l[y]||{width:0,maxWidth:0};var b=Qt(v.get("barWidth"),n),x=Qt(v.get("barMaxWidth"),n),w=v.get("barGap"),A=v.get("barCategoryGap");b&&!l[y].width&&(b=Ai(i,b),l[y].width=b,i-=b),x&&(l[y].maxWidth=x),w!=null&&(o=w),A!=null&&(s=A)});var u={},h=Qt(s,n),d=Qt(o,1),f=(i-h)/(a+(a-1)*d);f=en(f,0),de(l,function(v,y){var b=v.maxWidth;b&&b=r.y&&e[1]<=r.y+r.height:n.contain(n.toLocalCoord(e[1]))&&e[0]>=r.y&&e[0]<=r.y+r.height},t.prototype.pointToData=function(e,r,n){n=n||[];var i=this.getAxis();return n[0]=i.coordToData(i.toLocalCoord(e[i.orient==="horizontal"?0:1])),n},t.prototype.dataToPoint=function(e,r,n){var i=this.getAxis(),a=this.getRect();n=n||[];var s=i.orient==="horizontal"?0:1;return e instanceof Array&&(e=e[0]),n[s]=i.toGlobalCoord(i.dataToCoord(+e)),n[1-s]=s===0?a.y+a.height/2:a.x+a.width/2,n},t.prototype.convertToPixel=function(e,r,n){var i=sdt(r);return i===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,r,n){var i=sdt(r);return i===this?this.pointToData(n):null},t}();function sdt(t){var e=t.seriesModel,r=t.singleAxisModel;return r&&r.coordinateSystem||e&&e.coordinateSystem}function qFr(t,e){var r=[];return t.eachComponent(Xge,function(n,i){var a=new YFr(n,t,e);a.name="single_"+i,a.resize(n,e),n.coordinateSystem=a,r.push(a)}),t.eachSeries(function(n){if(n.get("coordinateSystem")===HPr){var i=n.getReferringComponents(Xge,ds).models[0],a=n.coordinateSystem=i&&i.coordinateSystem;a&&kS(a.getAxis(),n,nY)}}),r}var jFr={create:qFr,dimensions:adt},odt=["x","y"],XFr=["width","height"],KFr=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.makeElOption=function(r,n,i,a,s){var o=i.axis,l=o.coordinateSystem,u=HY(o),h=WY(l,u),d=WY(l,1-u),f=l.dataToPoint(n)[0],p=a.get("type");if(p&&p!=="none"){var g=F0e(a),m=ZFr[p](o,f,h,d,a.get("seriesDataIndices"),a.ecModel);m.style=g,r.graphicKey=m.type,r.pointer=m}var v=j0e(i);Qht(n,r,v,i,a,s)},e.prototype.getHandleTransform=function(r,n,i){var a=j0e(n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var s=z0e(n.axis,r,a);return{x:s[0],y:s[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(r,n,i,a){var s=i.axis,o=s.coordinateSystem,l=HY(s),u=WY(o,l),h=[r.x,r.y];h[l]+=n[l],h[l]=Math.min(u[1],h[l]),h[l]=Math.max(u[0],h[l]);var d=WY(o,1-l),f=(d[1]+d[0])/2,p=[f,f];return p[l]=h[l],{x:h[0],y:h[1],rotation:r.rotation,cursorPoint:p,tooltipOption:{verticalAlign:"middle"}}},e}(B0e),ZFr={line:function(t,e,r,n){var i=U0e([e,n[0]],[e,n[1]],HY(t));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(t,e,r,n,i,a){var s=V0e(t,i,a),o=n[1]-n[0],l=Q0e(e,r,s),u=l[0],h=l[1];return{type:"Rect",shape:Ght([u,n[0]],[h-u,o],HY(t))}}};function HY(t){return t.isHorizontal()?0:1}function WY(t,e){var r=t.getRect();return[r[odt[e]],r[odt[e]]+r[XFr[e]]]}var JFr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="single",e}(Hi);function ezr(t){Yr(fB),US.registerAxisPointerClass("SingleAxisPointer",KFr),t.registerComponentView(JFr),t.registerComponentView(GFr),t.registerComponentModel(iY),n5(t,"single",iY,iY.defaultOption),t.registerCoordinateSystem("single",jFr)}var tzr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r,n,i){var a=dS(r);t.prototype.init.apply(this,arguments),ldt(r,a)},e.prototype.mergeOption=function(r){t.prototype.mergeOption.apply(this,arguments),ldt(this.option,r)},e.prototype.getCellSize=function(){return this.option.cellSize},e.type="calendar",e.layoutMode="box",e.defaultOption={z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:et.color.axisLine,width:1,type:"solid"}},itemStyle:{color:et.color.neutral00,borderWidth:1,borderColor:et.color.neutral10},dayLabel:{show:!0,firstDay:0,position:"start",margin:et.size.s,color:et.color.secondary},monthLabel:{show:!0,position:"start",margin:et.size.s,align:"center",formatter:null,color:et.color.secondary},yearLabel:{show:!0,position:null,margin:et.size.xl,formatter:null,color:et.color.quaternary,fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},e}(fn);function ldt(t,e){var r=t.cellSize,n;ft(r)?n=r:n=t.cellSize=[r,r],n.length===1&&(n[1]=n[0]);var i=vt([0,1],function(a){return r4r(e,a)&&(n[a]="auto"),n[a]!=null&&n[a]!=="auto"});Rm(t,e,{type:"box",ignoreSize:i})}var rzr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){var a=this.group;a.removeAll();var s=r.coordinateSystem,o=s.getRangeInfo(),l=s.getOrient(),u=n.getLocaleModel();this._renderDayRect(r,o,a),this._renderLines(r,o,l,a),this._renderYearText(r,o,l,a),this._renderMonthText(r,u,l,a),this._renderWeekText(r,u,o,l,a)},e.prototype._renderDayRect=function(r,n,i){for(var a=r.coordinateSystem,s=r.getModel("itemStyle").getItemStyle(),o=a.getCellWidth(),l=a.getCellHeight(),u=n.start.time;u<=n.end.time;u=a.getNextNDay(u,1).time){var h=a.dataToCalendarLayout([u],!1).tl,d=new tn({shape:{x:h[0],y:h[1],width:o,height:l},cursor:"default",style:s});i.add(d)}},e.prototype._renderLines=function(r,n,i,a){var s=this,o=r.coordinateSystem,l=r.getModel(["splitLine","lineStyle"]).getLineStyle(),u=r.get(["splitLine","show"]),h=l.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var d=n.start,f=0;d.time<=n.end.time;f++){g(d.formatedDate),f===0&&(d=o.getDateInfo(n.start.y+"-"+n.start.m));var p=d.date;p.setMonth(p.getMonth()+1),d=o.getDateInfo(p)}g(o.getNextNDay(n.end.time,1).formatedDate);function g(m){s._firstDayOfMonth.push(o.getDateInfo(m)),s._firstDayPoints.push(o.dataToCalendarLayout([m],!1).tl);var v=s._getLinePointsOfOneWeek(r,m,i);s._tlpoints.push(v[0]),s._blpoints.push(v[v.length-1]),u&&s._drawSplitline(v,l,a)}u&&this._drawSplitline(s._getEdgesPoints(s._tlpoints,h,i),l,a),u&&this._drawSplitline(s._getEdgesPoints(s._blpoints,h,i),l,a)},e.prototype._getEdgesPoints=function(r,n,i){var a=[r[0].slice(),r[r.length-1].slice()],s=i==="horizontal"?0:1;return a[0][s]=a[0][s]-n/2,a[1][s]=a[1][s]+n/2,a},e.prototype._drawSplitline=function(r,n,i){var a=new Al({z2:20,shape:{points:r},style:n});i.add(a)},e.prototype._getLinePointsOfOneWeek=function(r,n,i){for(var a=r.coordinateSystem,s=a.getDateInfo(n),o=[],l=0;l<7;l++){var u=a.getNextNDay(s.time,l),h=a.dataToCalendarLayout([u.time],!1);o[2*u.day]=h.tl,o[2*u.day+1]=h[i==="horizontal"?"bl":"tr"]}return o},e.prototype._formatterLabel=function(r,n){return Nt(r)&&r?vrt(r,n):ur(r)?r(n):n.nameMap},e.prototype._yearTextPositionControl=function(r,n,i,a,s){var o=n[0],l=n[1],u=["center","bottom"];a==="bottom"?(l+=s,u=["center","top"]):a==="left"?o-=s:a==="right"?(o+=s,u=["center","top"]):l-=s;var h=0;return(a==="left"||a==="right")&&(h=Math.PI/2),{rotation:h,x:o,y:l,style:{align:u[0],verticalAlign:u[1]}}},e.prototype._renderYearText=function(r,n,i,a){var s=r.getModel("yearLabel");if(s.get("show")){var o=s.get("margin"),l=s.get("position");l||(l=i!=="horizontal"?"top":"left");var u=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],h=(u[0][0]+u[1][0])/2,d=(u[0][1]+u[1][1])/2,f=i==="horizontal"?0:1,p={top:[h,u[f][1]],bottom:[h,u[1-f][1]],left:[u[1-f][0],d],right:[u[f][0],d]},g=n.start.y;+n.end.y>+n.start.y&&(g=g+"-"+n.end.y);var m=s.get("formatter"),v={start:n.start.y,end:n.end.y,nameMap:g},y=this._formatterLabel(m,v),b=new Pn({z2:30,style:Gi(s,{text:y}),silent:s.get("silent")});b.attr(this._yearTextPositionControl(b,p[l],i,l,o)),a.add(b)}},e.prototype._monthTextPositionControl=function(r,n,i,a,s){var o="left",l="top",u=r[0],h=r[1];return i==="horizontal"?(h=h+s,n&&(o="center"),a==="start"&&(l="bottom")):(u=u+s,n&&(l="middle"),a==="start"&&(o="right")),{x:u,y:h,align:o,verticalAlign:l}},e.prototype._renderMonthText=function(r,n,i,a){var s=r.getModel("monthLabel");if(s.get("show")){var o=s.get("nameMap"),l=s.get("margin"),u=s.get("position"),h=s.get("align"),d=[this._tlpoints,this._blpoints];(!o||Nt(o))&&(o&&(n=Afe(o)||n),o=n.get(["time","monthAbbr"])||[]);var f=u==="start"?0:1,p=i==="horizontal"?0:1;l=u==="start"?-l:l;for(var g=h==="center",m=s.get("silent"),v=0;v=a.start.time&&i.timeo.end.time&&r.reverse(),r},t.prototype._getRangeInfo=function(e){var r=[this.getDateInfo(e[0]),this.getDateInfo(e[1])],n;r[0].time>r[1].time&&(n=!0,r.reverse());var i=Math.floor(r[1].time/X0e)-Math.floor(r[0].time/X0e)+1,a=new Date(r[0].time),s=a.getDate(),o=r[1].date.getDate();a.setDate(s+i-1);var l=a.getDate();if(l!==o)for(var u=a.getTime()-r[1].time>0?1:-1;(l=a.getDate())!==o&&(a.getTime()-r[1].time)*u>0;)i-=u,a.setDate(l-u);var h=Math.floor((i+r[0].day+6)/7),d=n?-h+1:h-1;return n&&r.reverse(),{range:[r[0].formatedDate,r[1].formatedDate],start:r[0],end:r[1],allDay:i,weeks:h,nthWeek:d,fweek:r[0].day,lweek:r[1].day}},t.prototype._getDateByWeeksAndDay=function(e,r,n){var i=this._getRangeInfo(n);if(e>i.weeks||e===0&&ri.lweek)return null;var a=(e-1)*7-i.fweek+r,s=new Date(i.start.time);return s.setDate(+i.start.d+a),this.getDateInfo(s)},t.create=function(e,r){var n=[];return e.eachComponent("calendar",function(i){var a=new t(i,e,r);n.push(a),i.coordinateSystem=a}),e.eachComponent(function(i,a){ZN({targetModel:a,coordSysType:"calendar",coordSysProvider:Trt})}),n},t.dimensions=["time","value"],t}();function K0e(t){var e=t.calendarModel,r=t.seriesModel,n=e?e.coordinateSystem:r?r.coordinateSystem:null;return n}function izr(t){t.registerComponentModel(tzr),t.registerComponentView(rzr),t.registerCoordinateSystem("calendar",nzr)}var Sy={level:1,leaf:2,nonLeaf:3},Ty={none:0,all:1,body:2,corner:3};function Z0e(t,e,r){var n=e[Mr[r]].getCell(t);return!n&&zn(t)&&t<0&&(n=e[Mr[1-r]].getUnitLayoutInfo(r,Math.round(t))),n}function cdt(t){var e=t||[];return e[0]=e[0]||[],e[1]=e[1]||[],e[0][0]=e[0][1]=e[1][0]=e[1][1]=NaN,e}function udt(t,e,r,n,i){hdt(t[0],e,i,r,n,0),hdt(t[1],e,i,r,n,1)}function hdt(t,e,r,n,i,a){t[0]=1/0,t[1]=-1/0;var s=n[a],o=ft(s)?s:[s],l=o.length,u=!!r;if(l>=1?(ddt(t,e,o,u,i,a,0),l>1&&ddt(t,e,o,u,i,a,l-1)):t[0]=t[1]=NaN,u){var h=-i[Mr[1-a]].getLocatorCount(a),d=i[Mr[a]].getLocatorCount(a)-1;r===Ty.body?h=en(0,h):r===Ty.corner&&(d=Ai(-1,d)),d=e[0]&&t[0]<=e[1]}function gdt(t,e){t.id.set(e[0][0],e[1][0]),t.span.set(e[0][1]-t.id.x+1,e[1][1]-t.id.y+1)}function ozr(t,e){t[0][0]=e[0][0],t[0][1]=e[0][1],t[1][0]=e[1][0],t[1][1]=e[1][1]}function mdt(t,e,r,n){var i=Z0e(e[n][0],r,n),a=Z0e(e[n][1],r,n);t[Mr[n]]=t[xs[n]]=NaN,i&&a&&(t[Mr[n]]=i.xy,t[xs[n]]=a.xy+a.wh-i.xy)}function pB(t,e,r,n){return t[Mr[e]]=r,t[Mr[1-e]]=n,t}function lzr(t){return t&&(t.type===Sy.leaf||t.type===Sy.nonLeaf)?t:null}function qY(){return{x:NaN,y:NaN,width:NaN,height:NaN}}var vdt=function(){function t(e,r){this._cells=[],this._levels=[],this.dim=e,this.dimIdx=e==="x"?0:1,this._model=r,this._uniqueValueGen=czr(e);var n=r.get("data",!0),i=r.get("length",!0);if(n!=null&&!ft(n)&&(n=[]),n)this._initByDimModelData(n);else if(i!=null){n=Array(i);for(var a=0;a=1,x=r[Mr[n]],w=a.getLocatorCount(n)-1,A=new hx;for(s.resetLayoutIterator(A,n);A.next();)S(A.item);for(a.resetLayoutIterator(A,n);A.next();)S(A.item);function S(T){Jl(T.wh)&&(T.wh=y),T.xy=x,T.id[Mr[n]]===w&&!b&&(T.wh=r[Mr[n]]+r[xs[n]]-T.xy),x+=T.wh}}function Cdt(t,e){for(var r=e[Mr[t]].resetCellIterator();r.next();){var n=r.item;JY(n.rect,t,n.id,n.span,e),JY(n.rect,1-t,n.id,n.span,e),n.type===Sy.nonLeaf&&(n.xy=n.rect[Mr[t]],n.wh=n.rect[xs[t]])}}function Odt(t,e){t.travelExistingCells(function(r){var n=r.span;if(n){var i=r.spanRect,a=r.id;JY(i,0,a,n,e),JY(i,1,a,n,e)}})}function JY(t,e,r,n,i){t[xs[e]]=0;var a=r[Mr[e]],s=a<0?i[Mr[1-e]]:i[Mr[e]],o=s.getUnitLayoutInfo(e,r[Mr[e]]);if(t[Mr[e]]=o.xy,t[xs[e]]=o.wh,n[Mr[e]]>1){var l=s.getUnitLayoutInfo(e,r[Mr[e]]+n[Mr[e]]-1);t[xs[e]]=l.xy+l.wh-o.xy}}function Azr(t,e,r){var n=KG(t,r[xs[e]]);return ive(n,r[xs[e]])}function ive(t,e){return Math.max(Math.min(t,Jt(e,1/0)),0)}function ave(t){var e=t.matrixModel,r=t.seriesModel,n=e?e.coordinateSystem:r?r.coordinateSystem:null;return n}var oc={inBody:1,inCorner:2,outside:3},Qm={x:null,y:null,point:[]};function kdt(t,e,r,n,i){var a=r[Mr[e]],s=r[Mr[1-e]],o=a.getUnitLayoutInfo(e,a.getLocatorCount(e)-1),l=a.getUnitLayoutInfo(e,0),u=s.getUnitLayoutInfo(e,-s.getLocatorCount(e)),h=s.shouldShow()?s.getUnitLayoutInfo(e,-1):null,d=t.point[e]=n[e];if(!l&&!h){t[Mr[e]]=oc.outside;return}if(i===Ty.body){l?(t[Mr[e]]=oc.inBody,d=Ai(o.xy+o.wh,en(l.xy,d)),t.point[e]=d):t[Mr[e]]=oc.outside;return}else if(i===Ty.corner){h?(t[Mr[e]]=oc.inCorner,d=Ai(h.xy+h.wh,en(u.xy,d)),t.point[e]=d):t[Mr[e]]=oc.outside;return}var f=l?l.xy:h?h.xy+h.wh:NaN,p=u?u.xy:f,g=o?o.xy+o.wh:f;if(dg){if(!i){t[Mr[e]]=oc.outside;return}d=g}t.point[e]=d,t[Mr[e]]=f<=d&&d<=g?oc.inBody:p<=d&&d<=f?oc.inCorner:oc.outside}function Edt(t,e,r,n){var i=1-r;if(t[Mr[r]]!==oc.outside)for(n[Mr[r]].resetCellIterator(nve);nve.next();){var a=nve.item;if(Rdt(t.point[r],a.rect,r)&&Rdt(t.point[i],a.rect,i)){e[r]=a.ordinal,e[i]=a.id[Mr[i]];return}}}function _dt(t,e,r,n){if(t[Mr[r]]!==oc.outside){var i=t[Mr[r]]===oc.inCorner?n[Mr[1-r]]:n[Mr[r]];for(i.resetLayoutIterator(ZY,r);ZY.next();)if(Szr(t.point[r],ZY.item)){e[r]=ZY.item.id[Mr[r]];return}}}function Szr(t,e){return e.xy<=t&&t<=e.xy+e.wh}function Rdt(t,e,r){return e[Mr[r]]<=t&&t<=e[Mr[r]]+e[xs[r]]}function Tzr(t){t.registerComponentModel(fzr),t.registerComponentView(yzr),t.registerCoordinateSystem("matrix",wzr)}function Czr(t,e){var r=t.existing;if(e.id=t.keyInfo.id,!e.type&&r&&(e.type=r.type),e.parentId==null){var n=e.parentOption;n?e.parentId=n.id:r&&(e.parentId=r.parentId)}e.parentOption=null}function Ddt(t,e){var r;return de(e,function(n){t[n]!=null&&t[n]!=="auto"&&(r=!0)}),r}function Ozr(t,e,r){var n=ot({},r),i=t[e],a=r.$action||"merge";a==="merge"?i?(Vr(i,n,!0),Rm(i,n,{ignoreSize:!0}),_rt(r,i),eq(r,i),eq(r,i,"shape"),eq(r,i,"style"),eq(r,i,"extra"),r.clipPath=i.clipPath):t[e]=n:a==="replace"?t[e]=n:a==="remove"&&i&&(t[e]=null)}var Ldt=["transition","enterFrom","leaveTo"],kzr=Ldt.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function eq(t,e,r){if(r&&(!t[r]&&e[r]&&(t[r]={}),t=t[r],e=e[r]),!(!t||!e))for(var n=r?Ldt:kzr,i=0;i=0;h--){var d=i[h],f=wo(d.id,null),p=f!=null?s.get(f):null;if(p){var g=p.parent,y=Kf(g),b=g===a?{width:o,height:l}:{width:y.width,height:y.height},x={},w=GH(p,d,b,null,{hv:d.hv,boundingMode:d.bounding},x);if(!Kf(p).isNew&&w){for(var A=d.transition,S={},T=0;T=0)?S[O]=k:p[O]=k}Hn(p,S,r,0)}else p.attr(x)}}},e.prototype._clear=function(){var r=this,n=this._elMap;n.each(function(i){tq(i,Kf(i).option,n,r._lastGraphicModel)}),this._elMap=Yt()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(Hi);function sve(t){var e=Kt(Mdt,t)?Mdt[t]:GN(t),r=new e({});return Kf(r).type=t,r}function Idt(t,e,r,n){var i=sve(r);return e.add(i),n.set(t,i),Kf(i).id=t,Kf(i).isNew=!0,i}function tq(t,e,r,n){var i=t&&t.parent;i&&(t.type==="group"&&t.traverse(function(a){tq(a,e,r,n)}),FY(t,e,n),r.removeKey(Kf(t).id))}function Pdt(t,e,r,n){t.isGroup||de([["cursor",$f.prototype.cursor],["zlevel",n||0],["z",r||0],["z2",0]],function(i){var a=i[0];Kt(e,a)?t[a]=Jt(e[a],i[1]):t[a]==null&&(t[a]=i[1])}),de(kn(e),function(i){if(i.indexOf("on")===0){var a=e[i];t[i]=ur(a)?a:null}}),Kt(e,"draggable")&&(t.draggable=e.draggable),e.name!=null&&(t.name=e.name),e.id!=null&&(t.id=e.id)}function Dzr(t){return t=ot({},t),de(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(Crt),function(e){delete t[e]}),t}function Lzr(t,e,r){var n=Cr(t).eventData;!t.silent&&!t.ignore&&!n&&(n=Cr(t).eventData={componentType:"graphic",componentIndex:e.componentIndex,name:t.name}),n&&(n.info=r.info)}function Mzr(t){t.registerComponentModel(_zr),t.registerComponentView(Rzr),t.registerPreprocessor(function(e){var r=e.graphic;ft(r)?!r[0]||!r[0].elements?e.graphic=[{elements:r}]:e.graphic=[e.graphic[0]]:r&&!r.elements&&(e.graphic=[{elements:[r]}])})}var Ndt=["x","y","radius","angle","single"],Izr=Qr(),Pzr=["cartesian2d","polar","singleAxis"];function Nzr(t){var e=t.get("coordinateSystem");return Ir(Pzr,e)>=0}function zx(t){return t+"Axis"}function Bzr(t,e){var r=Yt(),n=[],i=Yt();t.eachComponent({mainType:"dataZoom",query:e},function(h){i.get(h.uid)||o(h)});var a;do a=!1,t.eachComponent("dataZoom",s);while(a);function s(h){!i.get(h.uid)&&l(h)&&(o(h),a=!0)}function o(h){i.set(h.uid,!0),n.push(h),u(h)}function l(h){var d=!1;return h.eachTargetAxis(function(f,p){var g=r.get(f);g&&g[p]&&(d=!0)}),d}function u(h){h.eachTargetAxis(function(d,f){(r.get(d)||r.set(d,[]))[f]=!0})}return n}function Bdt(t){var e=t.ecModel,r={infoList:[],infoMap:Yt()};return t.eachTargetAxis(function(n,i){var a=e.getComponent(zx(n),i);if(a){var s=a.getCoordSysModel();if(s){var o=s.uid,l=r.infoMap.get(o);l||(l={model:s,axisModels:[]},r.infoList.push(l),r.infoMap.set(o,l)),l.axisModels.push(a)}}}),r}function $dt(t){var e=Izr(ait(t));return e.axisProxyMap||(e.axisProxyMap=Yt())}function rq(t){if(t)return $dt(t.ecModel).get(t.uid)}function $zr(t,e){$dt(t.ecModel).set(t.uid,e)}function Fdt(t,e){var r=e.getAxisModel().axis.__alignTo;return r&&t.getAxisProxy(r.dim,r.model.componentIndex)?rq(r.model):null}var ove=function(){function t(){this.indexList=[],this.indexMap=[]}return t.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},t}(),mB=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r._autoThrottle=!0,r._noTarget=!0,r._rangePropMode=["percent","percent"],r}return e.prototype.init=function(r,n,i){var a=zdt(r);this.settledOption=a,this.mergeDefaultAndTheme(r,i),this._doInit(a)},e.prototype.mergeOption=function(r){var n=zdt(r);Vr(this.option,r,!0),Vr(this.settledOption,n,!0),this._doInit(n)},e.prototype._doInit=function(r){var n=this.option;this._setDefaultThrottle(r),this._updateRangeUse(r);var i=this.settledOption;de([["start","startValue"],["end","endValue"]],function(a,s){this._rangePropMode[s]==="value"&&(n[a[0]]=i[a[0]]=null)},this),this._resetTarget()},e.prototype._resetTarget=function(){var r=this.get("orient",!0),n=this._targetAxisInfoMap=Yt(),i=this._fillSpecifiedTargetAxis(n);i?this._orient=r||this._makeAutoOrientByTargetAxis():(this._orient=r||"horizontal",this._fillAutoTargetAxisByOrient(n,this._orient)),this._noTarget=!0,n.each(function(a){a.indexList.length&&(this._noTarget=!1)},this)},e.prototype._fillSpecifiedTargetAxis=function(r){var n=!1;return de(Ndt,function(i){var a=this.getReferringComponents(zx(i),CEr);if(a.specified){n=!0;var s=new ove;de(a.models,function(o){s.add(o.componentIndex)}),r.set(i,s)}},this),n},e.prototype._fillAutoTargetAxisByOrient=function(r,n){var i=this.ecModel,a=!0;if(a){var s=n==="vertical"?"y":"x",o=i.findComponents({mainType:s+"Axis"});l(o,s)}if(a){var o=i.findComponents({mainType:"singleAxis",filter:function(h){return h.get("orient",!0)===n}});l(o,"single")}function l(u,h){var d=u[0];if(d){var f=new ove;if(f.add(d.componentIndex),r.set(h,f),a=!1,h==="x"||h==="y"){var p=d.getReferringComponents("grid",ds).models[0];p&&de(u,function(g){d.componentIndex!==g.componentIndex&&p===g.getReferringComponents("grid",ds).models[0]&&f.add(g.componentIndex)})}}}a&&de(Ndt,function(u){if(a){var h=i.findComponents({mainType:zx(u),filter:function(f){return f.get("type",!0)==="category"}});if(h[0]){var d=new ove;d.add(h[0].componentIndex),r.set(u,d),a=!1}}},this)},e.prototype._makeAutoOrientByTargetAxis=function(){var r;return this.eachTargetAxis(function(n){!r&&(r=n)},this),r==="y"?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(r){if(r.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var n=this.ecModel.option;this.option.throttle=n.animation&&n.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(r){var n=this._rangePropMode,i=this.get("rangeMode");de([["start","startValue"],["end","endValue"]],function(a,s){var o=r[a[0]]!=null,l=r[a[1]]!=null;o&&!l?n[s]="percent":!o&&l?n[s]="value":i?n[s]=i[s]:o&&(n[s]="percent")})},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var r;return this.eachTargetAxis(function(n,i){r==null&&(r=this.ecModel.getComponent(zx(n),i))},this),r},e.prototype.eachTargetAxis=function(r,n){this._targetAxisInfoMap.each(function(i,a){de(i.indexList,function(s){r.call(n,a,s)})})},e.prototype.getAxisProxy=function(r,n){return rq(this.getAxisModel(r,n))},e.prototype.getAxisModel=function(r,n){var i=this._targetAxisInfoMap.get(r);if(i&&i.indexMap[n])return this.ecModel.getComponent(zx(r),n)},e.prototype.setRawRange=function(r){var n=this.option,i=this.settledOption;de([["start","startValue"],["end","endValue"]],function(a){(r[a[0]]!=null||r[a[1]]!=null)&&(n[a[0]]=i[a[0]]=r[a[0]],n[a[1]]=i[a[1]]=r[a[1]])},this),this._updateRangeUse(r)},e.prototype.setCalculatedRange=function(r){var n=this.option;de(["start","startValue","end","endValue"],function(i){n[i]=r[i]})},e.prototype.getPercentRange=function(){var r=this.findRepresentativeAxisProxy();if(r)return r.getWindow().percent},e.prototype.getValueRange=function(r,n){if(r==null&&n==null){var i=this.findRepresentativeAxisProxy();if(i)return i.getWindow().value}else return this.getAxisProxy(r,n).getWindow().value},e.prototype.findRepresentativeAxisProxy=function(r){if(r)return rq(r);for(var n,i=this._targetAxisInfoMap.keys(),a=0;as[1];if(x&&!w&&!A)return!0;x&&(v=!0),w&&(g=!0),A&&(m=!0)}return v&&g&&m})}else de(h,function(p){if(a==="empty")l.setData(u=u.map(p,function(m){return o(m)?m:NaN}));else{var g={};g[p]=s,u.selectRange(g)}});de(h,function(p){u.setApproximateExtent(s,p)})}});function o(l){return l>=s[0]&&l<=s[1]}},t.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},r=this._dataZoomModel,n=this._extent;de(["min","max"],function(i){var a=r.get(i+"Span"),s=r.get(i+"ValueSpan");s!=null&&(s=this.getAxisModel().axis.scale.parse(s)),s!=null?a=jn(n[0]+s,n,[0,100],!0):a!=null&&(s=jn(a,[0,100],n,!0)-n[0]),e[i+"Span"]=a,e[i+"ValueSpan"]=s},this)},t}(),Vzr={dirtyOnOverallProgress:!0,getTargetSeries:function(t){function e(i){t.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(s,o){var l=t.getComponent(zx(s),o);i(s,o,l,a)})})}var r=[];e(function(i,a,s,o){if(!rq(s)){var l=new Uzr(i,a,o,t);r.push(l),$zr(s,l)}});var n=Yt();return de(r,function(i){de(i.getTargetSeriesModels(),function(a){n.set(a.uid,a)})}),n},overallReset:function(t,e){t.eachComponent("dataZoom",function(r){var n=[];r.eachTargetAxis(function(i,a){var s=r.getAxisProxy(i,a),o=Fdt(r,s);o?n.push([s,o]):s.reset(r,null)}),de(n,function(i){i[0].reset(r,i[1].getWindow().percentInverted)}),r.eachTargetAxis(function(i,a){r.getAxisProxy(i,a).filterData(r,e)})}),t.eachComponent("dataZoom",function(r){var n=r.findRepresentativeAxisProxy();if(n){var i=n.getWindow(),a=i.percent,s=i.value;r.setCalculatedRange({start:a[0],end:a[1],startValue:s[0],endValue:s[1]})}})}};function Qzr(t){t.registerAction("dataZoom",function(e,r){var n=Bzr(r,e);de(n,function(i){i.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var Gzr=a_();function cve(t){Gzr(t,function(){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,Vzr),Qzr(t),t.registerSubTypeDefaulter("dataZoom",function(){return"slider"})})}function Hzr(t){t.registerComponentModel(Fzr),t.registerComponentView(zzr),cve(t)}var Gm=function(){function t(){}return t}(),Udt={};function m5(t,e){Udt[t]=e}function Vdt(t){return Udt[t]}var Wzr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r,n,i){var a=i.getTheme().get("toolbox"),s=a?a.feature:null;s&&(this._themeFeatureOption=ot({},s),a.feature={}),t.prototype.init.call(this,r,n,i),s&&(a.feature=s)},e.prototype.optionUpdated=function(){de(this.option.feature,function(r,n){var i=this._themeFeatureOption,a=Vdt(n);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(this.ecModel)),i&&i[n]&&(Vr(r,i[n]),i[n]=null),Vr(r,a.defaultOption))},this)},e.type="toolbox",e.layoutMode={type:"box",ignoreSize:!0},e.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:et.color.border,borderRadius:0,borderWidth:0,padding:et.size.m,itemSize:15,itemGap:et.size.s,showTitle:!0,iconStyle:{borderColor:et.color.accent50,color:"none"},emphasis:{iconStyle:{borderColor:et.color.accent70}},tooltip:{show:!1,position:"bottom"}},e}(fn);function Qdt(t,e){var r=C_(e.get("padding")),n=e.getItemStyle(["color","opacity"]);n.fill=e.get("backgroundColor");var i=new tn({shape:{x:t.x-r[3],y:t.y-r[0],width:t.width+r[1]+r[3],height:t.height+r[0]+r[2],r:e.get("borderRadius")},style:n,silent:!0,z2:-1});return i}var Yzr=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(r,n,i,a){var s=this.group;if(s.removeAll(),!r.get("show"))return;var o=+r.get("itemSize"),l=r.get("orient")==="vertical",u=r.get("feature")||{},h=this._features||(this._features=Yt()),d=[];de(u,function(b,x){d.push(x)}),new fy(this._featureNames||[],d).add(f).update(f).remove(qr(f,null)).execute(),this._featureNames=ni(d,function(b){return h.hasKey(b)});function f(b,x){var w=b!=null&&x==null,A=b!=null&&x!=null,S=b==null,T=w||A?d[b]:d[x],O=u[T],k=w||A?new yn(O,r,n):null,E=k&&k.get("show"),_;if(w){if(!E)return;if(qzr(T))_={onclick:k.option.onclick,featureName:T};else{var I=Vdt(T);if(!I)return;_=new I}h.set(T,_)}else _=h.get(T);if(S||!E){Gdt(_)&&_.dispose&&_.dispose(n,i),h.removeKey(T);return}a&&a.newTitle!=null&&a.featureName===T&&(O.title=a.newTitle),w&&(_.uid=lS("toolbox-feature")),_.model=k,_.ecModel=n,_.api=i,p(k,_,T),k.setIconStatus=function(L,R){var D=this.option,M=this.iconPaths;D.iconStatus=D.iconStatus||{},D.iconStatus[L]=R,M[L]&&(R==="emphasis"?oy:ly)(M[L])},Gdt(_)&&_.render&&_.render(k,n,i,a)}function p(b,x,w){var A=b.getModel("iconStyle"),S=b.getModel(["emphasis","iconStyle"]),T=x instanceof Gm&&x.getIcons?x.getIcons():b.get("icon"),O=b.get("title")||{},k,E;Nt(T)?(k={},k[w]=T):k=T,Nt(O)?(E={},E[w]=O):E=O;var _=b.iconPaths={};de(k,function(I,L){var R=x_(I,{},{x:-o/2,y:-o/2,width:o,height:o});R.setStyle(A.getItemStyle());var D=R.ensureState("emphasis");D.style=S.getItemStyle();var M=new Pn({style:{text:E[L],align:S.get("textAlign"),borderRadius:S.get("textBorderRadius"),padding:S.get("textPadding"),fill:null,font:mfe({fontStyle:S.get("textFontStyle"),fontFamily:S.get("textFontFamily"),fontSize:S.get("textFontSize"),fontWeight:S.get("textFontWeight")},n)},ignore:!0});R.setTextContent(M),uy({el:R,componentModel:r,itemName:L,formatterParamsExtra:{title:E[L]}}),R.__title=E[L],R.on("mouseover",function(){var P=S.getItemStyle(),N=l?r.get("right")==null&&r.get("left")!=="right"?"right":"left":r.get("bottom")==null&&r.get("top")!=="bottom"?"bottom":"top";M.setStyle({fill:S.get("textFill")||P.fill||P.stroke||et.color.neutral99,backgroundColor:S.get("textBackgroundColor")}),R.setTextConfig({position:S.get("textPosition")||N}),M.ignore=!r.get("showTitle"),i.enterEmphasis(this)}).on("mouseout",function(){b.get(["iconStatus",L])!=="emphasis"&&i.leaveEmphasis(this),M.hide()}),(b.get(["iconStatus",L])==="emphasis"?oy:ly)(R),s.add(R),R.on("click",Ht(x.onclick,x,n,i,L)),_[L]=R})}var g=Co(r,i).refContainer,m=r.getBoxLayoutParams(),v=r.get("padding"),y=da(m,g,v);hS(r.get("orient"),s,r.get("itemGap"),y.width,y.height),GH(s,m,g,v),s.add(Qdt(s.getBoundingRect(),r)),l||s.eachChild(function(b){var x=b.__title,w=b.ensureState("emphasis"),A=w.textConfig||(w.textConfig={}),S=b.getTextContent(),T=S&&S.ensureState("emphasis");if(T&&!ur(T)&&x){var O=T.style||(T.style={}),k=VG(x,Pn.makeFont(O)),E=b.x+s.x,_=b.y+s.y+o,I=!1;_+k.height>i.getHeight()&&(A.position="top",I=!0);var L=I?-5-k.height:o+10;E+k.width/2>i.getWidth()?(A.position=["100%",L],O.align="right"):E-k.width/2<0&&(A.position=[0,L],O.align="left")}})},e.prototype.updateView=function(r,n,i,a){de(this._features,function(s){s&&s instanceof Gm&&s.updateView&&s.updateView(s.model,n,i,a)})},e.prototype.dispose=function(r,n){de(this._features,function(i){i&&i instanceof Gm&&i.dispose&&i.dispose(r,n)})},e.type="toolbox",e}(Hi);function qzr(t){return t.indexOf("my")===0}function Gdt(t){return t instanceof Gm}var jzr=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.onclick=function(r,n){var i=this.model,a=i.get("name")||r.get("title.0.text")||"echarts",s=n.getZr().painter.getType()==="svg",o=s?"svg":i.get("type",!0)||"png",l=n.getConnectedDataURL({type:o,backgroundColor:i.get("backgroundColor",!0)||r.get("backgroundColor")||et.color.neutral00,connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")}),u=Rn.browser;if(typeof MouseEvent=="function"&&(u.newEdge||!u.ie&&!u.edge)){var h=document.createElement("a");h.download=a+"."+o,h.target="_blank",h.href=l;var d=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});h.dispatchEvent(d)}else if(window.navigator.msSaveOrOpenBlob||s){var f=l.split(","),p=f[0].indexOf("base64")>-1,g=s?decodeURIComponent(f[1]):f[1];p&&(g=window.atob(g));var m=a+"."+o;if(window.navigator.msSaveOrOpenBlob){for(var v=g.length,y=new Uint8Array(v);v--;)y[v]=g.charCodeAt(v);var b=new Blob([y]);window.navigator.msSaveOrOpenBlob(b,m)}else{var x=document.createElement("iframe");document.body.appendChild(x);var w=x.contentWindow,A=w.document;A.open("image/svg+xml","replace"),A.write(g),A.close(),w.focus(),A.execCommand("SaveAs",!0,m),document.body.removeChild(x)}}else{var S=i.get("lang"),T='',O=window.open();O.document.write(T),O.document.title=a}},e.getDefaultOption=function(r){var n={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:r.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:et.color.neutral00,name:"",excludeComponents:["toolbox"],lang:r.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return n},e}(Gm),Hdt="__ec_magicType_stack__",Xzr=[["line","bar"],["stack"]],Kzr=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getIcons=function(){var r=this.model,n=r.get("icon"),i={};return de(r.get("type"),function(a){n[a]&&(i[a]=n[a])}),i},e.getDefaultOption=function(r){var n={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:r.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}};return n},e.prototype.onclick=function(r,n,i){var a=this.model,s=a.get(["seriesIndex",i]);if(Wdt[i]){var o={series:[]},l=function(d){var f=d.subType,p=d.id,g=Wdt[i](f,p,d,a);g&&(mr(g,d.option),o.series.push(g));var m=d.coordinateSystem;if(m&&m.type==="cartesian2d"&&(i==="line"||i==="bar")){var v=m.getAxesByScale("ordinal")[0];if(v){var y=v.dim,b=y+"Axis",x=d.getReferringComponents(b,ds).models[0],w=x.componentIndex;o[b]=o[b]||[];for(var A=0;A<=w;A++)o[b][w]=o[b][w]||{};o[b][w].boundaryGap=i==="bar"}}};de(Xzr,function(d){Ir(d,i)>=0&&de(d,function(f){a.setIconStatus(f,"normal")})}),a.setIconStatus(i,"emphasis"),r.eachComponent({mainType:"series",query:s==null?null:{seriesIndex:s}},l);var u,h=i;i==="stack"&&(u=Vr({stack:a.option.title.tiled,tiled:a.option.title.stack},a.option.title),a.get(["iconStatus",i])!=="emphasis"&&(h="tiled")),n.dispatchAction({type:"changeMagicType",currentType:h,newOption:o,newTitle:u,featureName:"magicType"})}},e}(Gm),Wdt={line:function(t,e,r,n){if(t==="bar")return Vr({id:e,type:"line",data:r.get("data"),stack:r.get("stack"),markPoint:r.get("markPoint"),markLine:r.get("markLine")},n.get(["option","line"])||{},!0)},bar:function(t,e,r,n){if(t==="line")return Vr({id:e,type:"bar",data:r.get("data"),stack:r.get("stack"),markPoint:r.get("markPoint"),markLine:r.get("markLine")},n.get(["option","bar"])||{},!0)},stack:function(t,e,r,n){var i=r.get("stack")===Hdt;if(t==="line"||t==="bar")return n.setIconStatus("stack",i?"normal":"emphasis"),Vr({id:e,stack:i?"":Hdt},n.get(["option","stack"])||{},!0)}};qp({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)});var nq=new Array(60).join("-"),v5=" ";function Zzr(t){var e={},r=[],n=[];return t.eachRawSeries(function(i){var a=i.coordinateSystem;if(a&&(a.type==="cartesian2d"||a.type==="polar")){var s=a.getBaseAxis();if(s.type==="category"){var o=IIr(s);e[o]||(e[o]={categoryAxis:s,valueAxis:a.getOtherAxis(s),series:[]},n.push({axisDim:s.dim,axisIndex:s.index})),e[o].series.push(i)}else r.push(i)}else r.push(i)}),{seriesGroupByCategoryAxis:e,other:r,meta:n}}function Jzr(t){var e=[];return de(t,function(r,n){var i=r.categoryAxis,a=r.valueAxis,s=a.dim,o=[" "].concat(vt(r.series,function(p){return p.name})),l=[i.model.getCategories()];de(r.series,function(p){var g=p.getRawData();l.push(p.getRawData().mapArray(g.mapDimension(s),function(m){return m}))});for(var u=[o.join(v5)],h=0;h=0)return!0}var uve=new RegExp("["+v5+"]+","g");function nUr(t){for(var e=t.split(/\n+/g),r=iq(e.shift()).split(uve),n=[],i=vt(r,function(l){return{name:l,data:[]}}),a=0;a=0;a--){var s=r[a];if(s[i])break}if(a<0){var o=t.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(o){var l=o.getPercentRange();r[0][i]={dataZoomId:i,start:l[0],end:l[1]}}}}),r.push(e)}function cUr(t){var e=hve(t),r=e[e.length-1];e.length>1&&e.pop();var n={};return Ydt(r,function(i,a){for(var s=e.length-1;s>=0;s--)if(i=e[s][a],i){n[a]=i;break}}),n}function uUr(t){qdt(t).snapshots=null}function hUr(t){return hve(t).length}function hve(t){var e=qdt(t);return e.snapshots||(e.snapshots=[{}]),e.snapshots}var dUr=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.onclick=function(r,n){uUr(r),n.dispatchAction({type:"restore",from:this.uid})},e.getDefaultOption=function(r){var n={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:r.getLocaleModel().get(["toolbox","restore","title"])};return n},e}(Gm);qp({type:"restore",event:"restore",update:"prepareAndUpdate"},function(t,e){e.resetOption("recreate")});var fUr=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],dve=function(){function t(e,r,n){var i=this;this._targetInfoList=[];var a=jdt(r,e);de(pUr,function(s,o){(!n||!n.include||Ir(n.include,o)>=0)&&s(a,i._targetInfoList)})}return t.prototype.setOutputRanges=function(e,r){return this.matchOutputRanges(e,r,function(n,i,a){if((n.coordRanges||(n.coordRanges=[])).push(i),!n.coordRange){n.coordRange=i;var s=pve[n.brushType](0,a,i);n.__rangeOffset={offset:Jdt[n.brushType](s.values,n.range,[1,1]),xyMinMax:s.xyMinMax}}}),e},t.prototype.matchOutputRanges=function(e,r,n){de(e,function(i){var a=this.findTargetInfo(i,r);a&&a!==!0&&de(a.coordSyses,function(s){var o=pve[i.brushType](1,s,i.range,!0);n(i,o.values,s,r)})},this)},t.prototype.setInputRanges=function(e,r){de(e,function(n){var i=this.findTargetInfo(n,r);if(n.range=n.range||[],i&&i!==!0){n.panelId=i.panelId;var a=pve[n.brushType](0,i.coordSys,n.coordRange),s=n.__rangeOffset;n.range=s?Jdt[n.brushType](a.values,s.offset,gUr(a.xyMinMax,s.xyMinMax)):a.values}},this)},t.prototype.makePanelOpts=function(e,r){return vt(this._targetInfoList,function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:r?r(n):null,clipPath:But(i),isTargetByCursor:Fut(i,e,n.coordSysModel),getLinearBrushOtherExtent:$ut(i)}})},t.prototype.controlSeries=function(e,r,n){var i=this.findTargetInfo(e,n);return i===!0||i&&Ir(i.coordSyses,r.coordinateSystem)>=0},t.prototype.findTargetInfo=function(e,r){for(var n=this._targetInfoList,i=jdt(r,e),a=0;at[1]&&t.reverse(),t}function jdt(t,e){return n_(t,e,{includeMainTypes:fUr})}var pUr={grid:function(t,e){var r=t.xAxisModels,n=t.yAxisModels,i=t.gridModels,a=Yt(),s={},o={};!r&&!n&&!i||(de(r,function(l){var u=l.axis.grid.model;a.set(u.id,u),s[u.id]=!0}),de(n,function(l){var u=l.axis.grid.model;a.set(u.id,u),o[u.id]=!0}),de(i,function(l){a.set(l.id,l),s[l.id]=!0,o[l.id]=!0}),a.each(function(l){var u=l.coordinateSystem,h=[];de(u.getCartesians(),function(d,f){(Ir(r,d.getAxis("x").model)>=0||Ir(n,d.getAxis("y").model)>=0)&&h.push(d)}),e.push({panelId:"grid--"+l.id,gridModel:l,coordSysModel:l,coordSys:h[0],coordSyses:h,getPanelRect:Kdt.grid,xAxisDeclared:s[l.id],yAxisDeclared:o[l.id]})}))},geo:function(t,e){de(t.geoModels,function(r){var n=r.coordinateSystem;e.push({panelId:"geo--"+r.id,geoModel:r,coordSysModel:r,coordSys:n,coordSyses:[n],getPanelRect:Kdt.geo})})}},Xdt=[function(t,e){var r=t.xAxisModel,n=t.yAxisModel,i=t.gridModel;return!i&&r&&(i=r.axis.grid.model),!i&&n&&(i=n.axis.grid.model),i&&i===e.gridModel},function(t,e){var r=t.geoModel;return r&&r===e.geoModel}],Kdt={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys.view,e=$lt(null,t);return rJe(e,e,fY(null,t)),e}},pve={lineX:qr(Zdt,0),lineY:qr(Zdt,1),rect:function(t,e,r,n){var i=t?e.pointToData([r[0][0],r[1][0]],n):e.dataToPoint([r[0][0],r[1][0]],n),a=t?e.pointToData([r[0][1],r[1][1]],n):e.dataToPoint([r[0][1],r[1][1]],n),s=[fve([i[0],a[0]]),fve([i[1],a[1]])];return{values:s,xyMinMax:s}},polygon:function(t,e,r,n){var i=[rc(),rc()],a=vt(r,function(s){var o=t?e.pointToData(s,n):e.dataToPoint(s,n);return i[0][0]=Math.min(i[0][0],o[0]),i[1][0]=Math.min(i[1][0],o[1]),i[0][1]=Math.max(i[0][1],o[0]),i[1][1]=Math.max(i[1][1],o[1]),o});return{values:a,xyMinMax:i}}};function Zdt(t,e,r,n){var i=r.getAxis(["x","y"][t]),a=fve(vt([0,1],function(o){return e?i.coordToData(i.toLocalCoord(n[o]),!0):i.toGlobalCoord(i.dataToCoord(n[o]))})),s=[];return s[t]=a,s[1-t]=[NaN,NaN],{values:a,xyMinMax:s}}var Jdt={lineX:qr(eft,0),lineY:qr(eft,1),rect:function(t,e,r){return[[t[0][0]-r[0]*e[0][0],t[0][1]-r[0]*e[0][1]],[t[1][0]-r[1]*e[1][0],t[1][1]-r[1]*e[1][1]]]},polygon:function(t,e,r){return vt(t,function(n,i){return[n[0]-r[0]*e[i][0],n[1]-r[1]*e[i][1]]})}};function eft(t,e,r,n){return[e[0]-n[t]*r[0],e[1]-n[t]*r[1]]}function gUr(t,e){var r=tft(t),n=tft(e),i=[r[0]/n[0],r[1]/n[1]];return isNaN(i[0])&&(i[0]=1),isNaN(i[1])&&(i[1]=1),i}function tft(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}var gve=de,mUr=xEr("toolbox-dataZoom_"),vUr={x:"width",y:"height"},yUr=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(r,n,i,a){this._brushController||(this._brushController=new Jme(i.getZr()),this._brushController.on("brush",Ht(this._onBrush,this)).mount()),wUr(r,n,this,a,i),xUr(r,n)},e.prototype.onclick=function(r,n,i){bUr[i].call(this)},e.prototype.dispose=function(r,n){this._brushController&&this._brushController.dispose()},e.prototype._onBrush=function(r){var n=r.areas;if(!r.isEnd||!n.length)return;var i={},a=this.ecModel;this._brushController.updateCovers([]);var s=new dve(mve(this.model),a,{include:["grid"]});s.matchOutputRanges(n,a,function(u,h,d){if(d.type==="cartesian2d"){var f=d.master.getRect().clone(),p=u.brushType;p==="rect"?(o("x",d,f,h[0]),o("y",d,f,h[1])):o({lineX:"x",lineY:"y"}[p],d,f,h)}}),lUr(a,i),this._dispatchZoomAction(i);function o(u,h,d,f){var p=h.getAxis(u),g=p.model,m=l(u,g,a),v=m.findRepresentativeAxisProxy(g).getMinMaxSpan(),y=p.scale.getExtent();(v.minValueSpan!=null||v.maxValueSpan!=null)&&(f=Ix(0,f.slice(),y,0,v.minValueSpan,v.maxValueSpan));var b=lde(y,d[vUr[u]],.5);m&&(i[m.id]={dataZoomId:m.id,startValue:isFinite(b)?Gn(f[0],b):f[0],endValue:isFinite(b)?Gn(f[1],b):f[1]})}function l(u,h,d){var f;return d.eachComponent({mainType:"dataZoom",subType:"select"},function(p){var g=p.getAxisModel(u,h.componentIndex);g&&(f=p)}),f}},e.prototype._dispatchZoomAction=function(r){var n=[];gve(r,function(i,a){n.push(lr(i))}),n.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:n})},e.getDefaultOption=function(r){var n={show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:r.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:et.color.backgroundTint}};return n},e}(Gm),bUr={zoom:function(){var t=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:t})},back:function(){this._dispatchZoomAction(cUr(this.ecModel))}};function mve(t){var e={xAxisIndex:t.get("xAxisIndex",!0),yAxisIndex:t.get("yAxisIndex",!0),xAxisId:t.get("xAxisId",!0),yAxisId:t.get("yAxisId",!0)};return e.xAxisIndex==null&&e.xAxisId==null&&(e.xAxisIndex="all"),e.yAxisIndex==null&&e.yAxisId==null&&(e.yAxisIndex="all"),e}function xUr(t,e){t.setIconStatus("back",hUr(e)>1?"emphasis":"normal")}function wUr(t,e,r,n,i){var a=r._isZoomActive;n&&n.type==="takeGlobalCursor"&&(a=n.key==="dataZoomSelect"?n.dataZoomSelectActive:!1),r._isZoomActive=a,t.setIconStatus("zoom",a?"emphasis":"normal");var s=new dve(mve(t),e,{include:["grid"]}),o=s.makePanelOpts(i,function(l){return l.xAxisDeclared&&!l.yAxisDeclared?"lineX":!l.xAxisDeclared&&l.yAxisDeclared?"lineY":"rect"});r._brushController.setPanels(o).enableBrush(a&&o.length?{brushType:"auto",brushStyle:t.getModel("brushStyle").getItemStyle()}:!1)}l4r("dataZoom",function(t){var e=t.getComponent("toolbox",0),r=["feature","dataZoom"];if(!e||e.get(r)==null)return;var n=e.getModel(r),i=[],a=mve(n),s=n_(t,a);gve(s.xAxisModels,function(l){return o(l,"xAxis","xAxisIndex")}),gve(s.yAxisModels,function(l){return o(l,"yAxis","yAxisIndex")});function o(l,u,h){var d=l.componentIndex,f={type:"select",$fromToolbox:!0,filterMode:n.get("filterMode",!0)||"filter",id:mUr+u+d};f[h]=d,i.push(f)}return i});function AUr(t){t.registerComponentModel(Wzr),t.registerComponentView(Yzr),m5("saveAsImage",jzr),m5("magicType",Kzr),m5("dataView",sUr),m5("dataZoom",yUr),m5("restore",dUr),Yr(Hzr)}var TUr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click|mousewheel",alwaysShowContent:!1,renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,displayTransition:!0,enterable:!1,backgroundColor:et.color.neutral00,shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:et.color.border,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:et.color.borderShade,width:1,type:"dashed",textStyle:{}}},textStyle:{color:et.color.tertiary,fontSize:14}},e}(fn);function rft(t){var e=t.get("confine");return e!=null?!!e:t.get("renderMode")==="richText"}function nft(t){if(Rn.domSupported){for(var e=document.documentElement.style,r=0,n=t.length;r-1?(o+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(o+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var h=u*Math.PI/180,d=s+i,f=d*Math.abs(Math.cos(h))+d*Math.abs(Math.sin(h)),p=Math.round(((f-Math.SQRT2*i)/2+Math.SQRT2*i-(f-d)/2)*100)/100;o+=";"+a+":-"+p+"px";var g=e+" solid "+i+"px;",m=["position:absolute;width:"+s+"px;height:"+s+"px;z-index:-1;",o+";"+l+";","border-bottom:"+g,"border-right:"+g,"background-color:"+n+";"];return'
'}function RUr(t,e,r){var n="cubic-bezier(0.23,1,0.32,1)",i="",a="";return r&&(i=" "+t/2+"s "+n,a="opacity"+i+",visibility"+i),e||(i=" "+t+"s "+n,a+=(a.length?",":"")+(Rn.transformSupported?""+vve+i:",left"+i+",top"+i)),OUr+":"+a}function sft(t,e,r){var n=t.toFixed(0)+"px",i=e.toFixed(0)+"px";if(!Rn.transformSupported)return r?"top:"+i+";left:"+n+";":[["top",i],["left",n]];var a=Rn.transform3dSupported,s="translate"+(a?"3d":"")+"("+n+","+i+(a?",0":"")+")";return r?"top:0;left:0;"+vve+":"+s+";":[["top",0],["left",0],[ift,s]]}function DUr(t){var e=[],r=t.get("fontSize"),n=t.getTextColor();n&&e.push("color:"+n),e.push("font:"+t.getFont());var i=Jt(t.get("lineHeight"),Math.round(r*3/2));r&&e.push("line-height:"+i+"px");var a=t.get("textShadowColor"),s=t.get("textShadowBlur")||0,o=t.get("textShadowOffsetX")||0,l=t.get("textShadowOffsetY")||0;return a&&s&&e.push("text-shadow:"+o+"px "+l+"px "+s+"px "+a),de(["decoration","align"],function(u){var h=t.get(u);h&&e.push("text-"+u+":"+h)}),e.join(";")}function LUr(t,e,r,n){var i=[],a=t.get("transitionDuration"),s=t.get("backgroundColor"),o=t.get("shadowBlur"),l=t.get("shadowColor"),u=t.get("shadowOffsetX"),h=t.get("shadowOffsetY"),d=t.getModel("textStyle"),f=Lnt(t,"html"),p=u+"px "+h+"px "+o+"px "+l;return i.push("box-shadow:"+p),e&&a>0&&i.push(RUr(a,r,n)),s&&i.push("background-color:"+s),de(["width","color","radius"],function(g){var m="border-"+g,v=Mfe(m),y=t.get(v);y!=null&&i.push(m+":"+y+(g==="color"?"":"px"))}),i.push(DUr(d)),f!=null&&i.push("padding:"+C_(f).join("px ")+"px"),i.join(";")+";"}function oft(t,e,r,n,i){var a=e&&e.painter;if(r){var s=a&&a.getViewportRoot();s&&IOr(t,s,r,n,i)}else{t[0]=n,t[1]=i;var o=a&&a.getViewportRootOffset();o&&(t[0]+=o.offsetLeft,t[1]+=o.offsetTop)}t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var MUr=function(){function t(e,r){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,Rn.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var i=this._zr=e.getZr(),a=r.appendTo,s=a&&(Nt(a)?document.querySelector(a):wA(a)?a:ur(a)&&a(e.getDom()));oft(this._styleCoord,i,s,e.getWidth()/2,e.getHeight()/2),(s||e.getDom()).appendChild(n),this._api=e,this._container=s;var o=this;n.onmouseenter=function(){o._enterable&&(clearTimeout(o._hideTimeout),o._show=!0),o._inContent=!0},n.onmousemove=function(l){if(l=l||window.event,!o._enterable){var u=i.handler,h=i.painter.getViewportRoot();Lf(h,l,!0),u.dispatch("mousemove",l)}},n.onmouseleave=function(){o._inContent=!1,o._enterable&&o._show&&o.hideLater(o._hideDelay)}}return t.prototype.update=function(e){if(!this._container){var r=this._api.getDom(),n=CUr(r,"position"),i=r.style;i.position!=="absolute"&&n!=="absolute"&&(i.position="relative")}var a=e.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this._enableDisplayTransition=e.get("displayTransition")&&e.get("transitionDuration")>0,this.el.className=e.get("className")||""},t.prototype.show=function(e,r){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=n.style,a=this._styleCoord;n.innerHTML?i.cssText=kUr+LUr(e,!this._firstShow,this._longHide,this._enableDisplayTransition)+sft(a[0],a[1],!0)+("border-color:"+cT(r)+";")+(e.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):i.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},t.prototype.setContent=function(e,r,n,i,a){var s=this.el;if(e==null){s.innerHTML="";return}var o="";if(Nt(a)&&n.get("trigger")==="item"&&!rft(n)&&(o=_Ur(n,i,a)),Nt(e))s.innerHTML=e+o;else if(e){s.innerHTML="",ft(e)||(e=[e]);for(var l=0;l=0?this._tryShow(a,s):i==="leave"&&this._hide(s))},this))},e.prototype._keepShow=function(){var r=this._tooltipModel,n=this._ecModel,i=this._api,a=r.get("triggerOn");if(r.get("trigger")!=="axis"&&(this._lastDataByCoordSys=null,this._cbParamsList=null),this._lastX!=null&&this._lastY!=null&&a!=="none"&&a!=="click"){var s=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!i.isDisposed()&&s.manuallyShowTip(r,n,i,{x:s._lastX,y:s._lastY,dataByCoordSys:s._lastDataByCoordSys})})}},e.prototype.manuallyShowTip=function(r,n,i,a){if(!(a.from===this.uid||Rn.node||!i.getDom())){var s=uft(a,i);this._ticket="";var o=a.dataByCoordSys,l=zUr(a,n,i);if(l){var u=l.el.getBoundingRect().clone();u.applyTransform(l.el.transform),this._tryShow({offsetX:u.x+u.width/2,offsetY:u.y+u.height/2,target:l.el,position:a.position,positionDefault:"bottom"},s)}else if(a.tooltip&&a.x!=null&&a.y!=null){var h=PUr;h.x=a.x,h.y=a.y,h.update(),Cr(h).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:h},s)}else if(o)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:o,tooltipOption:a.tooltipOption},s);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(r,n,i,a))return;var d=jht(a,n),f=d.point[0],p=d.point[1];f!=null&&p!=null&&this._tryShow({offsetX:f,offsetY:p,target:d.el,position:a.position,positionDefault:"bottom"},s)}else a.x!=null&&a.y!=null&&(i.dispatchAction({type:"updateAxisPointer",x:a.x,y:a.y}),this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,target:i.getZr().findHover(a.x,a.y).target},s))}},e.prototype.manuallyHideTip=function(r,n,i,a){var s=this._tooltipContent;this._tooltipModel&&s.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,this._cbParamsList=null,a.from!==this.uid&&this._hide(uft(a,i))},e.prototype._manuallyAxisShowTip=function(r,n,i,a){var s=a.seriesIndex,o=a.dataIndex,l=n.getComponent("axisPointer").coordSysAxesInfo;if(!(s==null||o==null||l==null)){var u=n.getSeriesByIndex(s);if(u){var h=u.getData(),d=vB([h.getItemModel(o),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(d.get("trigger")==="axis")return i.dispatchAction({type:"updateAxisPointer",seriesIndex:s,dataIndex:o,position:a.position}),!0}}},e.prototype._tryShow=function(r,n){var i=r.target,a=this._tooltipModel;if(a){this._lastX=r.offsetX,this._lastY=r.offsetY;var s=r.dataByCoordSys;if(s&&s.length)this._showAxisTooltip(s,r);else if(i){var o=Cr(i);if(o.ssrType==="legend")return;this._lastDataByCoordSys=null,this._cbParamsList=null;var l,u;bT(i,function(h){if(h.tooltipDisabled)return l=u=null,!0;l||u||(Cr(h).dataIndex!=null?l=h:Cr(h).tooltipConfig!=null&&(u=h))},!0),l?this._showSeriesItemTooltip(r,l,n):u?this._showComponentItemTooltip(r,u,n):this._hide(n)}else this._lastDataByCoordSys=null,this._cbParamsList=null,this._hide(n)}},e.prototype._showOrMove=function(r,n){var i=r.get("showDelay");n=Ht(n,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(n,i):n()},e.prototype._showAxisTooltip=function(r,n){var i=this._ecModel,a=this._tooltipModel,s=[n.offsetX,n.offsetY],o=vB([n.tooltipOption],a),l=this._renderMode,u=[],h=no("section",{blocks:[],noHeader:!0}),d=[],f=new npe;de(r,function(b){de(b.dataByAxis,function(x){var w=i.getComponent(x.axisDim+"Axis",x.axisIndex),A=x.value,T=w.axis,S=T.scale.parse(A);if(!(!w||A==null)){var O=Vht(A,T,i,x.seriesDataIndices,x.valueLabelOpt),k=no("section",{header:O,noHeader:!Td(O),sortBlocks:!0,blocks:[]});h.blocks.push(k),de(x.seriesDataIndices,function(E){var _=i.getSeriesByIndex(E.seriesIndex),I=E.dataIndexInside,L=_.getDataParams(I);if(!(L.dataIndex<0)){L.axisDim=x.axisDim,L.axisIndex=x.axisIndex,L.axisType=x.axisType,L.axisId=x.axisId,L.axisValue=EW(w.axis,{value:S}),L.axisValueLabel=O,L.marker=f.makeTooltipMarker("item",cT(L.color),l);var R=unt(_.formatTooltip(I,!0,null)),D=R.frag;if(D){var M=vB([_],a).get("valueFormatter");k.blocks.push(M?ot({valueFormatter:M},D):D)}R.text&&d.push(R.text),u.push(L)}})}})}),h.blocks.reverse(),d.reverse();var p=n.position,g=o.get("order"),m=_nt(h,f,l,g,i.get("useUTC"),o.get("textStyle"));m&&d.unshift(m);var v=l==="richText"?` - -`:"
",y=d.join(v);this._showOrMove(o,function(){this._updateContentNotChangedOnAxis(r,u)?this._updatePosition(o,p,s[0],s[1],this._tooltipContent,u):this._showTooltipContent(o,y,u,Math.random()+"",s[0],s[1],p,null,f)})},e.prototype._showSeriesItemTooltip=function(r,n,i){var a=this._ecModel,s=Cr(n),o=s.seriesIndex,l=a.getSeriesByIndex(o),u=s.dataModel||l,h=s.dataIndex,d=s.dataType,f=u.getData(d),p=this._renderMode,g=r.positionDefault,m=vB([f.getItemModel(h),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,g?{position:g}:null),v=m.get("trigger");if(!(v!=null&&v!=="item")){var y=u.getDataParams(h,d),b=new npe;y.marker=b.makeTooltipMarker("item",cT(y.color),p);var x=unt(u.formatTooltip(h,!1,d)),w=m.get("order"),A=m.get("valueFormatter"),T=x.frag,S=T?_nt(A?ot({valueFormatter:A},T):T,b,p,w,a.get("useUTC"),m.get("textStyle")):x.text,O="item_"+u.name+"_"+h;this._showOrMove(m,function(){this._showTooltipContent(m,S,y,O,r.offsetX,r.offsetY,r.position,r.target,b)}),i({type:"showTip",dataIndexInside:h,dataIndex:f.getRawIndex(h),seriesIndex:o,from:this.uid})}},e.prototype._showComponentItemTooltip=function(r,n,i){var a=this._renderMode==="html",s=Cr(n),o=s.tooltipConfig,l=o.option||{},u=l.encodeHTMLContent;if(Nt(l)){var h=l;l={content:h,formatter:h},u=!0}u&&a&&l.content&&(l=lr(l),l.content=Nc(l.content));var d=[l],f=this._ecModel.getComponent(s.componentMainType,s.componentIndex);f&&d.push(f),d.push({formatter:l.content});var p=r.positionDefault,g=vB(d,this._tooltipModel,p?{position:p}:null),m=g.get("content"),v=Math.random()+"",y=new npe;this._showOrMove(g,function(){var b=lr(g.get("formatterParams")||{});this._showTooltipContent(g,m,b,v,r.offsetX,r.offsetY,r.position,n,y)}),i({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(r,n,i,a,s,o,l,u,h){if(this._ticket="",!(!r.get("showContent")||!r.get("show"))){var d=this._tooltipContent;d.setEnterable(r.get("enterable"));var f=r.get("formatter");l=l||r.get("position");var p=n,g=this._getNearestPoint([s,o],i,r.get("trigger"),r.get("borderColor"),r.get("defaultBorderColor",!0)),m=g.color;if(f)if(Nt(f)){var v=r.ecModel.get("useUTC"),y=ft(i)?i[0]:i,b=y&&y.axisType&&y.axisType.indexOf("time")>=0;p=f,b&&(p=KN(y.axisValue,p,v)),p=Nfe(p,i,!0)}else if(ur(f)){var x=Ht(function(w,A){w===this._ticket&&(d.setContent(A,h,r,m,l),this._updatePosition(r,l,s,o,d,i,u))},this);this._ticket=a,p=f(i,a,x)}else p=f;d.setContent(p,h,r,m,l),d.show(r,m),this._updatePosition(r,l,s,o,d,i,u)}},e.prototype._getNearestPoint=function(r,n,i,a,s){if(i==="axis"||ft(n))return{color:a||s};if(!ft(n))return{color:a||n.color||n.borderColor}},e.prototype._updatePosition=function(r,n,i,a,s,o,l){var u=this._api.getWidth(),h=this._api.getHeight();n=n||r.get("position");var d=s.getSize(),f=r.get("align"),p=r.get("verticalAlign"),g=l&&l.getBoundingRect().clone();if(l&&g.applyTransform(l.transform),ur(n)&&(n=n([i,a],o,s.el,g,{viewSize:[u,h],contentSize:d.slice()})),ft(n))i=Qt(n[0],u),a=Qt(n[1],h);else if(yr(n)){var m=n;m.width=d[0],m.height=d[1];var v=da(m,{width:u,height:h});i=v.x,a=v.y,f=null,p=null}else if(Nt(n)&&l){var y=FUr(n,g,d,r.get("borderWidth"));i=y[0],a=y[1]}else{var y=BUr(i,a,s,u,h,f?null:20,p?null:20);i=y[0],a=y[1]}if(f&&(i-=hft(f)?d[0]/2:f==="right"?d[0]:0),p&&(a-=hft(p)?d[1]/2:p==="bottom"?d[1]:0),rft(r)){var y=$Ur(i,a,s,u,h);i=y[0],a=y[1]}s.moveTo(i,a)},e.prototype._updateContentNotChangedOnAxis=function(r,n){var i=this._lastDataByCoordSys,a=this._cbParamsList,s=!!i&&i.length===r.length;return s&&de(i,function(o,l){var u=o.dataByAxis||[],h=r[l]||{},d=h.dataByAxis||[];s=s&&u.length===d.length,s&&de(u,function(f,p){var g=d[p]||{},m=f.seriesDataIndices||[],v=g.seriesDataIndices||[];s=s&&f.value===g.value&&f.axisType===g.axisType&&f.axisId===g.axisId&&m.length===v.length,s&&de(m,function(y,b){var x=v[b];s=s&&y.seriesIndex===x.seriesIndex&&y.dataIndex===x.dataIndex}),a&&de(f.seriesDataIndices,function(y){var b=y.seriesIndex,x=n[b],w=a[b];x&&w&&w.data!==x.data&&(s=!1)})})}),this._lastDataByCoordSys=r,this._cbParamsList=n,!!s},e.prototype._hide=function(r){this._lastDataByCoordSys=null,this._cbParamsList=null,r({type:"hideTip",from:this.uid})},e.prototype.dispose=function(r,n){Rn.node||!n.getDom()||(s8(this,"_updatePosition"),this._tooltipContent.dispose(),H0e("itemTooltip",n),this._tooltipContent=null,this._tooltipModel=null,this._lastDataByCoordSys=null,this._cbParamsList=null)},e.type="tooltip",e}(Hi);function vB(t,e,r){var n=e.ecModel,i;r?(i=new yn(r,n,n),i=new yn(e.option,i,n)):i=e;for(var a=t.length-1;a>=0;a--){var s=t[a];s&&(s instanceof yn&&(s=s.get("tooltip",!0)),Nt(s)&&(s={formatter:s}),s&&(i=new yn(s,i,n)))}return i}function uft(t,e){return t.dispatchAction||Ht(e.dispatchAction,e)}function BUr(t,e,r,n,i,a,s){var o=r.getSize(),l=o[0],u=o[1];return a!=null&&(t+l+a+2>n?t-=l+a:t+=a),s!=null&&(e+u+s>i?e-=u+s:e+=s),[t,e]}function $Ur(t,e,r,n,i){var a=r.getSize(),s=a[0],o=a[1];return t=Math.min(t+s,n)-s,e=Math.min(e+o,i)-o,t=Math.max(t,0),e=Math.max(e,0),[t,e]}function FUr(t,e,r,n){var i=r[0],a=r[1],s=Math.ceil(Math.SQRT2*n)+8,o=0,l=0,u=e.width,h=e.height;switch(t){case"inside":o=e.x+u/2-i/2,l=e.y+h/2-a/2;break;case"top":o=e.x+u/2-i/2,l=e.y-a-s;break;case"bottom":o=e.x+u/2-i/2,l=e.y+h+s;break;case"left":o=e.x-i-s,l=e.y+h/2-a/2;break;case"right":o=e.x+u+s,l=e.y+h/2-a/2}return[o,l]}function hft(t){return t==="center"||t==="middle"}function zUr(t,e,r){var n=gde(t).queryOptionMap,i=n.keys()[0];if(!(!i||i==="series")){var a=i_(e,i,n.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}),s=a.models[0];if(s){var o=r.getViewOfComponentModel(s),l;if(o.group.traverse(function(u){var h=Cr(u).tooltipConfig;if(h&&h.name===t.name)return l=u,!0}),l)return{componentMainType:i,componentIndex:s.componentIndex,el:l}}}}function UUr(t){Yr(fB),t.registerComponentModel(TUr),t.registerComponentView(NUr),t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Xa),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Xa)}var VUr=["rect","polygon","keep","clear"];function QUr(t,e){var r=Qi(t?t.brush:[]);if(r.length){var n=[];de(r,function(l){var u=l.hasOwnProperty("toolbox")?l.toolbox:[];u instanceof Array&&(n=n.concat(u))});var i=t&&t.toolbox;ft(i)&&(i=i[0]),i||(i={feature:{}},t.toolbox=[i]);var a=i.feature||(i.feature={}),s=a.brush||(a.brush={}),o=s.type||(s.type=[]);o.push.apply(o,n),rH(o,function(l){return l+""},null),e&&!o.length&&o.push.apply(o,VUr)}}var dft=de;function fft(t){if(t){for(var e in t)if(t.hasOwnProperty(e))return!0}}function yve(t,e,r){var n={};return dft(e,function(a){var s=n[a]=i();dft(t[a],function(o,l){if(Xo.isValidType(l)){var u={type:l,visual:o};r&&r(u,a),s[l]=new Xo(u),l==="opacity"&&(u=lr(u),u.type="colorAlpha",s.__hidden.__alphaForOpacity=new Xo(u))}})}),n;function i(){var a=function(){};a.prototype.__hidden=a.prototype;var s=new a;return s}}function pft(t,e,r){var n;de(r,function(i){e.hasOwnProperty(i)&&fft(e[i])&&(n=!0)}),n&&de(r,function(i){e.hasOwnProperty(i)&&fft(e[i])?t[i]=lr(e[i]):delete t[i]})}function GUr(t,e,r,n,i,a){var s={};de(t,function(d){var f=Xo.prepareVisualTypes(e[d]);s[d]=f});var o;function l(d){return spe(r,o,d)}function u(d,f){Jnt(r,o,d,f)}r.each(h);function h(d,f){o=d;var p=r.getRawDataItem(o);if(!(p&&p.visualMap===!1))for(var g=n.call(i,d),m=e[g],v=s[g],y=0,b=v.length;ye[0][1]&&(e[0][1]=a[0]),a[1]e[1][1]&&(e[1][1]=a[1])}return e&&xft(e)}};function xft(t){return new fr(t[0][0],t[1][0],t[0][1]-t[0][0],t[1][1]-t[1][0])}var JUr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r,n){this.ecModel=r,this.api=n,this.model,(this._brushController=new Jme(n.getZr())).on("brush",Ht(this._onBrush,this)).mount()},e.prototype.render=function(r,n,i,a){this.model=r,this._updateController(r,n,i,a)},e.prototype.updateTransform=function(r,n,i,a){yft(n),this._updateController(r,n,i,a)},e.prototype.updateVisual=function(r,n,i,a){this.updateTransform(r,n,i,a)},e.prototype.updateView=function(r,n,i,a){this._updateController(r,n,i,a)},e.prototype._updateController=function(r,n,i,a){(!a||a.$from!==r.id)&&this._brushController.setPanels(r.brushTargetManager.makePanelOpts(i)).enableBrush(r.brushOption).updateCovers(r.areas.slice())},e.prototype.dispose=function(){this._brushController.dispose()},e.prototype._onBrush=function(r){var n=this.model.id,i=this.model.brushTargetManager.setOutputRanges(r.areas,this.ecModel);(!r.isEnd||r.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:n,areas:lr(i),$from:n}),r.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:n,areas:lr(i),$from:n})},e.type="brush",e}(Hi),eVr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.areas=[],r.brushOption={},r}return e.prototype.optionUpdated=function(r,n){var i=this.option;!n&&pft(i,r,["inBrush","outOfBrush"]);var a=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:this.option.defaultOutOfBrushColor},a.hasOwnProperty("liftZ")||(a.liftZ=5)},e.prototype.setAreas=function(r){r&&(this.areas=vt(r,function(n){return wft(this.option,n)},this))},e.prototype.setBrushOption=function(r){this.brushOption=wft(this.option,r),this.brushType=this.brushOption.brushType},e.type="brush",e.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],e.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:et.color.backgroundTint,borderColor:et.color.borderTint},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4,defaultOutOfBrushColor:et.color.disabled},e}(fn);function wft(t,e){return Vr({brushType:t.brushType,brushMode:t.brushMode,transformable:t.transformable,brushStyle:new yn(t.brushStyle).getItemStyle(),removeOnClick:t.removeOnClick,z:t.z},e,!0)}var tVr=["rect","polygon","lineX","lineY","keep","clear"],rVr=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(r,n,i){var a,s,o;n.eachComponent({mainType:"brush"},function(l){a=l.brushType,s=l.brushOption.brushMode||"single",o=o||!!l.areas.length}),this._brushType=a,this._brushMode=s,de(r.get("type",!0),function(l){r.setIconStatus(l,(l==="keep"?s==="multiple":l==="clear"?o:l===a)?"emphasis":"normal")})},e.prototype.updateView=function(r,n,i){this.render(r,n,i)},e.prototype.getIcons=function(){var r=this.model,n=r.get("icon",!0),i={};return de(r.get("type",!0),function(a){n[a]&&(i[a]=n[a])}),i},e.prototype.onclick=function(r,n,i){var a=this._brushType,s=this._brushMode;i==="clear"?(n.dispatchAction({type:"axisAreaSelect",intervals:[]}),n.dispatchAction({type:"brush",command:"clear",areas:[]})):n.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:i==="keep"?a:a===i?!1:i,brushMode:i==="keep"?s==="multiple"?"single":"multiple":s}})},e.getDefaultOption=function(r){var n={show:!0,type:tVr.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:r.getLocaleModel().get(["toolbox","brush","title"])};return n},e}(Gm);function nVr(t){t.registerComponentView(JUr),t.registerComponentModel(eVr),t.registerPreprocessor(QUr),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,YUr),t.registerAction({type:"brush",event:"brush",update:"updateVisual"},function(e,r){r.eachComponent({mainType:"brush",query:e},function(n){n.setAreas(e.areas)})}),t.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},Xa),t.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},Xa),m5("brush",rVr)}var iVr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.layoutMode={type:"box",ignoreSize:!0},r}return e.type="title",e.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:"center",top:et.size.m,backgroundColor:et.color.transparent,borderColor:et.color.primary,borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:et.color.primary},subtextStyle:{fontSize:12,color:et.color.quaternary}},e}(fn),aVr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){if(this.group.removeAll(),!!r.get("show")){var a=this.group,s=r.getModel("textStyle"),o=r.getModel("subtextStyle"),l=r.get("textAlign"),u=Jt(r.get("textBaseline"),r.get("textVerticalAlign")),h=new Pn({style:Gi(s,{text:r.get("text"),fill:s.getTextColor()},{disableBox:!0}),z2:10}),d=h.getBoundingRect(),f=r.get("subtext"),p=new Pn({style:Gi(o,{text:f,fill:o.getTextColor(),y:d.height+r.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),g=r.get("link"),m=r.get("sublink"),v=r.get("triggerEvent",!0);h.silent=!g&&!v,p.silent=!m&&!v,g&&h.on("click",function(){zH(g,"_"+r.get("target"))}),m&&p.on("click",function(){zH(m,"_"+r.get("subtarget"))}),Cr(h).eventData=Cr(p).eventData=v?{componentType:"title",componentIndex:r.componentIndex}:null,a.add(h),f&&a.add(p);var y=a.getBoundingRect(),b=r.getBoxLayoutParams();b.width=y.width,b.height=y.height;var x=Co(r,i),w=da(b,x.refContainer,r.get("padding"));l||(l=r.get("left")||r.get("right"),l==="middle"&&(l="center"),l==="right"?w.x+=w.width:l==="center"&&(w.x+=w.width/2)),u||(u=r.get("top")||r.get("bottom"),u==="center"&&(u="middle"),u==="bottom"?w.y+=w.height:u==="middle"&&(w.y+=w.height/2),u=u||"top"),a.x=w.x,a.y=w.y,a.markRedraw();var A={align:l,verticalAlign:u};h.setStyle(A),p.setStyle(A),y=a.getBoundingRect();var T=w.margin,S=r.getItemStyle(["color","opacity"]);S.fill=r.get("backgroundColor");var O=new tn({shape:{x:y.x-T[3],y:y.y-T[0],width:y.width+T[1]+T[3],height:y.height+T[0]+T[2],r:r.get("borderRadius")},style:S,subPixelOptimize:!0,silent:!0});a.add(O)}},e.type="title",e}(Hi);function sVr(t){t.registerComponentModel(iVr),t.registerComponentView(aVr)}var Aft=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.layoutMode="box",r}return e.prototype.init=function(r,n,i){this.mergeDefaultAndTheme(r,i),this._initData()},e.prototype.mergeOption=function(r){t.prototype.mergeOption.apply(this,arguments),this._initData()},e.prototype.setCurrentIndex=function(r){r==null&&(r=this.option.currentIndex);var n=this._data.count();this.option.loop?r=(r%n+n)%n:(r>=n&&(r=n-1),r<0&&(r=0)),this.option.currentIndex=r},e.prototype.getCurrentIndex=function(){return this.option.currentIndex},e.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},e.prototype.setPlayState=function(r){this.option.autoPlay=!!r},e.prototype.getPlayState=function(){return!!this.option.autoPlay},e.prototype._initData=function(){var r=this.option,n=r.data||[],i=r.axisType,a=this._names=[],s;i==="category"?(s=[],de(n,function(u,h){var d=wo(r_(u),""),f;yr(u)?(f=lr(u),f.value=h):f=h,s.push(f),a.push(d)})):s=n;var o={category:"ordinal",time:"time",value:"number"}[i]||"number",l=this._data=new zc([{name:"value",type:o}],this);l.initData(s,a)},e.prototype.getData=function(){return this._data},e.prototype.getCategories=function(){if(this.get("axisType")==="category")return this._names.slice()},e.type="timeline",e.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:et.size.m,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:et.color.secondary},data:[]},e}(fn),Tft=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="timeline.slider",e.defaultOption=xx(Aft.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:et.color.border,borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:et.color.accent10},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:et.color.tertiary},itemStyle:{color:et.color.accent20,borderWidth:0},checkpointStyle:{symbol:"circle",symbolSize:15,color:et.color.accent50,borderColor:et.color.accent50,borderWidth:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(0, 0, 0, 0)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M15 0C23.2843 0 30 6.71573 30 15C30 23.2843 23.2843 30 15 30C6.71573 30 0 23.2843 0 15C0 6.71573 6.71573 0 15 0ZM15 3C8.37258 3 3 8.37258 3 15C3 21.6274 8.37258 27 15 27C21.6274 27 27 21.6274 27 15C27 8.37258 21.6274 3 15 3ZM11.5 10.6699C11.5 9.90014 12.3333 9.41887 13 9.80371L20.5 14.1338C21.1667 14.5187 21.1667 15.4813 20.5 15.8662L13 20.1963C12.3333 20.5811 11.5 20.0999 11.5 19.3301V10.6699Z",stopIcon:"path://M15 0C23.2843 0 30 6.71573 30 15C30 23.2843 23.2843 30 15 30C6.71573 30 0 23.2843 0 15C0 6.71573 6.71573 0 15 0ZM15 3C8.37258 3 3 8.37258 3 15C3 21.6274 8.37258 27 15 27C21.6274 27 27 21.6274 27 15C27 8.37258 21.6274 3 15 3ZM11.5 10C12.3284 10 13 10.6716 13 11.5V18.5C13 19.3284 12.3284 20 11.5 20C10.6716 20 10 19.3284 10 18.5V11.5C10 10.6716 10.6716 10 11.5 10ZM18.5 10C19.3284 10 20 10.6716 20 11.5V18.5C20 19.3284 19.3284 20 18.5 20C17.6716 20 17 19.3284 17 18.5V11.5C17 10.6716 17.6716 10 18.5 10Z",nextIcon:"path://M0.838834 18.7383C0.253048 18.1525 0.253048 17.2028 0.838834 16.617L7.55635 9.89949L0.838834 3.18198C0.253048 2.59619 0.253048 1.64645 0.838834 1.06066C1.42462 0.474874 2.37437 0.474874 2.96015 1.06066L10.7383 8.83883L10.8412 8.95277C11.2897 9.50267 11.2897 10.2963 10.8412 10.8462L10.7383 10.9602L2.96015 18.7383C2.37437 19.3241 1.42462 19.3241 0.838834 18.7383Z",prevIcon:"path://M10.9602 1.06066C11.5459 1.64645 11.5459 2.59619 10.9602 3.18198L4.24264 9.89949L10.9602 16.617C11.5459 17.2028 11.5459 18.1525 10.9602 18.7383C10.3744 19.3241 9.42462 19.3241 8.83883 18.7383L1.06066 10.9602L0.957771 10.8462C0.509245 10.2963 0.509245 9.50267 0.957771 8.95277L1.06066 8.83883L8.83883 1.06066C9.42462 0.474874 10.3744 0.474874 10.9602 1.06066Z",prevBtnSize:18,nextBtnSize:18,color:et.color.accent50,borderColor:et.color.accent50,borderWidth:0},emphasis:{label:{show:!0,color:et.color.accent60},itemStyle:{color:et.color.accent60,borderColor:et.color.accent60},controlStyle:{color:et.color.accent70,borderColor:et.color.accent70}},progress:{lineStyle:{color:et.color.accent30},itemStyle:{color:et.color.accent40}},data:[]}),e}(Aft);Is(Tft,qH.prototype);var oVr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="timeline",e}(Hi),lVr=function(t){rt(e,t);function e(r,n,i,a){var s=t.call(this,r,n,i)||this;return s.type=a||"value",s}return e.prototype.getLabelModel=function(){return this.model.getModel("label")},e.prototype.isHorizontal=function(){return this.model.get("orient")==="horizontal"},e}(Wf),wve=Math.PI,Sft=Qr(),cVr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r,n){this.api=n},e.prototype.render=function(r,n,i){if(this.model=r,this.api=i,this.ecModel=n,this.group.removeAll(),r.get("show",!0)){var a=this._layout(r,i),s=this._createGroup("_mainGroup"),o=this._createGroup("_labelGroup"),l=this._axis=this._createAxis(a,r);r.formatTooltip=function(u){var h=l.scale.getLabel({value:u});return no("nameValue",{noName:!0,value:h})},de(["AxisLine","AxisTick","Control","CurrentPointer"],function(u){this["_render"+u](a,s,l,r)},this),this._renderAxisLabel(a,o,l,r),this._position(a,r)}this._doPlayStop(),this._updateTicksStatus()},e.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},e.prototype.dispose=function(){this._clearTimer()},e.prototype._layout=function(r,n){var i=r.get(["label","position"]),a=r.get("orient"),s=uVr(r,n),o;i==null||i==="auto"?o=a==="horizontal"?s.y+s.height/2=0||o==="+"?"left":"right"},u={horizontal:o>=0||o==="+"?"top":"bottom",vertical:"middle"},h={horizontal:0,vertical:wve/2},d=a==="vertical"?s.height:s.width,f=r.getModel("controlStyle"),p=f.get("show",!0),g=p?f.get("itemSize"):0,m=p?f.get("itemGap"):0,v=g+m,y=r.get(["label","rotate"])||0;y=y*wve/180;var b,x,w,A=f.get("position",!0),T=p&&f.get("showPlayBtn",!0),S=p&&f.get("showPrevBtn",!0),O=p&&f.get("showNextBtn",!0),k=0,E=d;A==="left"||A==="bottom"?(T&&(b=[0,0],k+=v),S&&(x=[k,0],k+=v),O&&(w=[E-g,0],E-=v)):(T&&(b=[E-g,0],E-=v),S&&(x=[0,0],k+=v),O&&(w=[E-g,0],E-=v));var _=[k,E];return r.get("inverse")&&_.reverse(),{viewRect:s,mainLength:d,orient:a,rotation:h[a],labelRotation:y,labelPosOpt:o,labelAlign:r.get(["label","align"])||l[a],labelBaseline:r.get(["label","verticalAlign"])||r.get(["label","baseline"])||u[a],playPosition:b,prevBtnPosition:x,nextBtnPosition:w,axisExtent:_,controlSize:g,controlGap:m}},e.prototype._position=function(r,n){var i=this._mainGroup,a=this._labelGroup,s=r.viewRect;if(r.orient==="vertical"){var o=xa(),l=s.x,u=s.y+s.height;zp(o,o,[-l,-u]),Zv(o,o,-wve/2),zp(o,o,[l,u]),s=s.clone(),s.applyTransform(o)}var h=b(s),d=b(i.getBoundingRect()),f=b(a.getBoundingRect()),p=[i.x,i.y],g=[a.x,a.y];g[0]=p[0]=h[0][0];var m=r.labelPosOpt;if(m==null||Nt(m)){var v=m==="+"?0:1;x(p,d,h,1,v),x(g,f,h,1,1-v)}else{var v=m>=0?0:1;x(p,d,h,1,v),g[1]=p[1]+m}i.setPosition(p),a.setPosition(g),i.rotation=a.rotation=r.rotation,y(i),y(a);function y(w){w.originX=h[0][0]-w.x,w.originY=h[1][0]-w.y}function b(w){return[[w.x,w.x+w.width],[w.y,w.y+w.height]]}function x(w,A,T,S,O){w[S]+=T[S][O]-A[S][O]}},e.prototype._createAxis=function(r,n){var i=n.getData(),a=n.get("axisType")||n.get("type");a!=="category"&&a!=="time"&&(a="value");var s=G_(n,a,!1);s.getTicks=function(){return i.mapArray(["value"],function(u){return{value:u}})};var o=i.getDataExtent("value");s.setExtent(o[0],o[1]),Pat(s,{fixMinMax:[!0,!0]});var l=new lVr("value",s,r.axisExtent,a);return l.model=n,l},e.prototype._createGroup=function(r){var n=this[r]=new pr;return this.group.add(n),n},e.prototype._renderAxisLine=function(r,n,i,a){var s=i.getExtent();if(a.get(["lineStyle","show"])){var o=new Ps({shape:{x1:s[0],y1:0,x2:s[1],y2:0},style:ot({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});n.add(o);var l=this._progressLine=new Ps({shape:{x1:s[0],x2:this._currentPointer?this._currentPointer.x:s[0],y1:0,y2:0},style:mr({lineCap:"round",lineWidth:o.style.lineWidth},a.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});n.add(l)}},e.prototype._renderAxisTick=function(r,n,i,a){var s=this,o=a.getData(),l=i.scale.getTicks();this._tickSymbols=[],de(l,function(u){var h=i.dataToCoord(u.value),d=o.getItemModel(u.value),f=d.getModel("itemStyle"),p=d.getModel(["emphasis","itemStyle"]),g=d.getModel(["progress","itemStyle"]),m={x:h,y:0,onclick:Ht(s._changeTimeline,s,u.value)},v=Cft(d,f,n,m);v.ensureState("emphasis").style=p.getItemStyle(),v.ensureState("progress").style=g.getItemStyle(),vx(v);var y=Cr(v);d.get("tooltip")?(y.dataIndex=u.value,y.dataModel=a):y.dataIndex=y.dataModel=null,s._tickSymbols.push(v)})},e.prototype._renderAxisLabel=function(r,n,i,a){var s=this,o=i.getLabelModel();if(o.get("show")){var l=a.getData(),u=i.getViewLabels();this._tickLabels=[],de(u,function(h){if(!h.tick.offInterval){var d=h.tick.value,f=l.getItemModel(d),p=f.getModel("label"),g=f.getModel(["emphasis","label"]),m=f.getModel(["progress","label"]),v=i.dataToCoord(d),y=new Pn({x:v,y:0,rotation:r.labelRotation-r.rotation,onclick:Ht(s._changeTimeline,s,d),silent:!1,style:Gi(p,{text:h.formattedLabel,align:r.labelAlign,verticalAlign:r.labelBaseline})});y.ensureState("emphasis").style=Gi(g),y.ensureState("progress").style=Gi(m),n.add(y),vx(y),Sft(y).dataIndex=d,s._tickLabels.push(y)}})}},e.prototype._renderControl=function(r,n,i,a){var s=r.controlSize,o=r.rotation,l=a.getModel("controlStyle").getItemStyle(),u=a.getModel(["emphasis","controlStyle"]).getItemStyle(),h=a.getPlayState(),d=a.get("inverse",!0);f(r.nextBtnPosition,"next",Ht(this._changeTimeline,this,d?"-":"+")),f(r.prevBtnPosition,"prev",Ht(this._changeTimeline,this,d?"+":"-")),f(r.playPosition,h?"stop":"play",Ht(this._handlePlayClick,this,!h),!0);function f(p,g,m,v){if(p){var y=gm(Jt(a.get(["controlStyle",g+"BtnSize"]),s),s),b=[0,-y/2,y,y],x=hVr(a,g+"Icon",b,{x:p[0],y:p[1],originX:s/2,originY:0,rotation:v?-o:0,rectHover:!0,style:l,onclick:m});x.ensureState("emphasis").style=u,n.add(x),vx(x)}}},e.prototype._renderCurrentPointer=function(r,n,i,a){var s=a.getData(),o=a.getCurrentIndex(),l=s.getItemModel(o).getModel("checkpointStyle"),u=this,h={onCreate:function(d){d.draggable=!0,d.drift=Ht(u._handlePointerDrag,u),d.ondragend=Ht(u._handlePointerDragend,u),Oft(d,u._progressLine,o,i,a,!0)},onUpdate:function(d){Oft(d,u._progressLine,o,i,a)}};this._currentPointer=Cft(l,l,this._mainGroup,{},this._currentPointer,h)},e.prototype._handlePlayClick=function(r){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:r,from:this.uid})},e.prototype._handlePointerDrag=function(r,n,i){this._clearTimer(),this._pointerChangeTimeline([i.offsetX,i.offsetY])},e.prototype._handlePointerDragend=function(r){this._pointerChangeTimeline([r.offsetX,r.offsetY],!0)},e.prototype._pointerChangeTimeline=function(r,n){var i=this._toAxisCoord(r)[0],a=this._axis,s=xl(a.getExtent().slice());i>s[1]&&(i=s[1]),i=0&&(o[s]=+o[s].toFixed(g)),[o,p]}var lq={min:qr(oq,"min"),max:qr(oq,"max"),average:qr(oq,"average"),median:qr(oq,"median")};function bB(t,e){if(e){var r=t.getData(),n=t.coordinateSystem,i=n&&n.dimensions;if(!vVr(e)&&!ft(e.coord)&&ft(i)){var a=Eft(e,r,n,t);if(e=lr(e),e.type&&lq[e.type]&&a.baseAxis&&a.valueAxis){var s=Ir(i,a.baseAxis.dim),o=Ir(i,a.valueAxis.dim),l=lq[e.type](r,a.valueAxis.dim,a.baseDataDim,a.valueDataDim,s,o);e.coord=l[0],e.value=l[1]}else e.coord=[e.xAxis!=null?e.xAxis:e.radiusAxis,e.yAxis!=null?e.yAxis:e.angleAxis]}if(e.coord==null||!ft(i)){e.coord=[];var u=t.getBaseAxis();if(u&&e.type&&lq[e.type]){var h=n.getOtherAxis(u);h&&(e.value=cq(r,r.mapDimension(h.dim),e.type))}}else for(var d=e.coord,f=0;f<2;f++)lq[d[f]]&&(d[f]=cq(r,r.mapDimension(i[f]),d[f]));return e}}function Eft(t,e,r,n){var i={};return t.valueIndex!=null||t.valueDim!=null?(i.valueDataDim=t.valueIndex!=null?e.getDimension(t.valueIndex):t.valueDim,i.valueAxis=r.getAxis(yVr(n,i.valueDataDim)),i.baseAxis=r.getOtherAxis(i.valueAxis),i.baseDataDim=e.mapDimension(i.baseAxis.dim)):(i.baseAxis=n.getBaseAxis(),i.valueAxis=r.getOtherAxis(i.baseAxis),i.baseDataDim=e.mapDimension(i.baseAxis.dim),i.valueDataDim=e.mapDimension(i.valueAxis.dim)),i}function yVr(t,e){var r=t.getData().getDimensionInfo(e);return r&&r.coordDim}function xB(t,e){return t&&t.containData&&e.coord&&!Tve(e)?t.containData(e.coord):!0}function bVr(t,e,r){return t&&t.containZone&&e.coord&&r.coord&&!Tve(e)&&!Tve(r)?t.containZone(e.coord,r.coord):!0}function _ft(t,e){return t?function(r,n,i,a){var s=a<2?r.coord&&r.coord[a]:r.value;return Ax(s,e[a])}:function(r,n,i,a){return Ax(r.value,e[a])}}function cq(t,e,r){if(r==="average"){var n=0,i=0;return t.each(e,function(a,s){isNaN(a)||(n+=a,i++)}),n/i}else return r==="median"?t.getMedian(e):t.getDataExtent(e)[r==="max"?1:0]}var Sve=Qr(),Cve=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(){this.markerGroupMap=Yt()},e.prototype.render=function(r,n,i){var a=this,s=this.markerGroupMap;s.each(function(o){Sve(o).keep=!1}),n.eachSeries(function(o){var l=Hm.getMarkerModelFromSeries(o,a.type);l&&a.renderSeries(o,l,n,i)}),s.each(function(o){!Sve(o).keep&&a.group.remove(o.group)}),xVr(n,s,this.type)},e.prototype.markKeep=function(r){Sve(r).keep=!0},e.prototype.toggleBlurSeries=function(r,n){var i=this;de(r,function(a){var s=Hm.getMarkerModelFromSeries(a,i.type);if(s){var o=s.getData();o.eachItemGraphicEl(function(l){l&&(n?dtt(l):Wde(l))})}})},e.type="marker",e}(Hi);function xVr(t,e,r){t.eachSeries(function(n){var i=Hm.getMarkerModelFromSeries(n,r),a=e.get(n.id);if(i&&a&&a.group){var s=sT(i),o=s.z,l=s.zlevel;_H(a.group,o,l)}})}function Rft(t,e,r){var n=e.coordinateSystem,i=r.getWidth(),a=r.getHeight(),s=n&&n.getArea&&n.getArea();t.each(function(o){var l=t.getItemModel(o),u=l.get("relativeTo")==="coordinate",h=u?s?s.width:0:i,d=u?s?s.height:0:a,f=u&&s?s.x:0,p=u&&s?s.y:0,g,m=Qt(l.get("x"),h)+f,v=Qt(l.get("y"),d)+p;if(!isNaN(m)&&!isNaN(v))g=[m,v];else if(e.getMarkerPosition)g=e.getMarkerPosition(t.getValues(t.dimensions,o));else if(n){var y=t.get(n.dimensions[0],o),b=t.get(n.dimensions[1],o);g=n.dataToPoint([y,b])}isNaN(m)||(g[0]=m),isNaN(v)||(g[1]=v),t.setItemLayout(o,g)})}var wVr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.updateTransform=function(r,n,i){n.eachSeries(function(a){var s=Hm.getMarkerModelFromSeries(a,"markPoint");s&&(Rft(s.getData(),a,i),this.markerGroupMap.get(a.id).updateLayout())},this)},e.prototype.renderSeries=function(r,n,i,a){var s=r.coordinateSystem,o=r.id,l=r.getData(),u=this.markerGroupMap,h=u.get(o)||u.set(o,new M8),d=AVr(s,r,n);n.setData(d),Rft(n.getData(),r,a),d.each(function(f){var p=d.getItemModel(f),g=p.getShallow("symbol"),m=p.getShallow("symbolSize"),v=p.getShallow("symbolRotate"),y=p.getShallow("symbolOffset"),b=p.getShallow("symbolKeepAspect");if(ur(g)||ur(m)||ur(v)||ur(y)){var x=n.getRawValue(f),w=n.getDataParams(f);ur(g)&&(g=g(x,w)),ur(m)&&(m=m(x,w)),ur(v)&&(v=v(x,w)),ur(y)&&(y=y(x,w))}var A=p.getModel("itemStyle").getItemStyle(),T=p.get("z2"),S=u8(l,"color");A.fill||(A.fill=S),d.setItemVisual(f,{z2:Jt(T,0),symbol:g,symbolSize:m,symbolRotate:v,symbolOffset:y,symbolKeepAspect:b,style:A})}),h.updateData(d),this.group.add(h.group),d.eachItemGraphicEl(function(f){f.traverse(function(p){Cr(p).dataModel=n})}),this.markKeep(h),h.group.silent=n.get("silent")||r.get("silent")},e.type="markPoint",e}(Cve);function AVr(t,e,r){var n;t?n=vt(t&&t.dimensions,function(o){var l=e.getData(),u=l.getDimensionInfo(l.mapDimension(o))||{};return ot(ot({},u),{name:o,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new zc(n,r),a=vt(r.get("data"),qr(bB,e));t&&(a=ni(a,qr(xB,t)));var s=_ft(!!t,n);return i.initData(a,null,s),i}function TVr(t){t.registerComponentModel(mVr),t.registerComponentView(wVr),t.registerPreprocessor(function(e){Ave(e.series,"markPoint")&&(e.markPoint=e.markPoint||{})})}var SVr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.createMarkerModelFromSeries=function(r,n,i){return new e(r,n,i)},e.type="markLine",e.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},e}(Hm),uq=Qr(),CVr=function(t,e,r,n){var i=t.getData(),a;if(ft(n))a=n;else{var s=n.type;if(s==="min"||s==="max"||s==="average"||s==="median"||n.xAxis!=null||n.yAxis!=null){var o=void 0,l=void 0;if(n.yAxis!=null||n.xAxis!=null)o=e.getAxis(n.yAxis!=null?"y":"x"),l=Pc(n.yAxis,n.xAxis);else{var u=Eft(n,i,e,t);o=u.valueAxis;var h=Bpe(i,u.valueDataDim);l=cq(i,h,s)}var d=o.dim==="x"?0:1,f=1-d,p=lr(n),g={coord:[]};p.type=null,p.coord=[],p.coord[f]=-1/0,g.coord[f]=1/0;var m=r.get("precision");m>=0&&zn(l)&&(l=+l.toFixed(Math.min(m,20))),p.coord[d]=g.coord[d]=l,a=[p,g,{type:s,valueIndex:n.valueIndex,value:l}]}else a=[]}var v=[bB(t,a[0]),bB(t,a[1]),ot({},a[2])];return v[2].type=v[2].type||null,Vr(v[2],v[0]),Vr(v[2],v[1]),v};function hq(t){return!isNaN(t)&&!isFinite(t)}function Dft(t,e,r,n){var i=1-t,a=n.dimensions[t];return hq(e[i])&&hq(r[i])&&e[t]===r[t]&&n.getAxis(a).containData(e[t])}function OVr(t,e){if(t.type==="cartesian2d"){var r=e[0].coord,n=e[1].coord;if(r&&n&&(Dft(1,r,n,t)||Dft(0,r,n,t)))return!0}return xB(t,e[0])&&xB(t,e[1])}function Ove(t,e,r,n,i){var a=n.coordinateSystem,s=t.getItemModel(e),o,l=Qt(s.get("x"),i.getWidth()),u=Qt(s.get("y"),i.getHeight());if(!isNaN(l)&&!isNaN(u))o=[l,u];else{if(n.getMarkerPosition)o=n.getMarkerPosition(t.getValues(t.dimensions,e));else{var h=a.dimensions,d=t.get(h[0],e),f=t.get(h[1],e);o=a.dataToPoint([d,f])}if(NT(a,"cartesian2d")){var p=a.getAxis("x"),g=a.getAxis("y"),h=a.dimensions;hq(t.get(h[0],e))?o[0]=p.toGlobalCoord(p.getExtent()[r?0:1]):hq(t.get(h[1],e))&&(o[1]=g.toGlobalCoord(g.getExtent()[r?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}t.setItemLayout(e,o)}var kVr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.updateTransform=function(r,n,i){n.eachSeries(function(a){var s=Hm.getMarkerModelFromSeries(a,"markLine");if(s){var o=s.getData(),l=uq(s).from,u=uq(s).to;l.each(function(h){Ove(l,h,!0,a,i),Ove(u,h,!1,a,i)}),o.each(function(h){o.setItemLayout(h,[l.getItemLayout(h),u.getItemLayout(h)])}),this.markerGroupMap.get(a.id).updateLayout()}},this)},e.prototype.renderSeries=function(r,n,i,a){var s=r.coordinateSystem,o=r.id,l=r.getData(),u=this.markerGroupMap,h=u.get(o)||u.set(o,new zme);this.group.add(h.group);var d=EVr(s,r,n),f=d.from,p=d.to,g=d.line;uq(n).from=f,uq(n).to=p,n.setData(g);var m=n.get("symbol"),v=n.get("symbolSize"),y=n.get("symbolRotate"),b=n.get("symbolOffset");ft(m)||(m=[m,m]),ft(v)||(v=[v,v]),ft(y)||(y=[y,y]),ft(b)||(b=[b,b]),d.from.each(function(w){x(f,w,!0),x(p,w,!1)}),g.each(function(w){var A=g.getItemModel(w),T=A.getModel("lineStyle").getLineStyle();g.setItemLayout(w,[f.getItemLayout(w),p.getItemLayout(w)]);var S=A.get("z2");T.stroke==null&&(T.stroke=f.getItemVisual(w,"style").fill),g.setItemVisual(w,{z2:Jt(S,0),fromSymbolKeepAspect:f.getItemVisual(w,"symbolKeepAspect"),fromSymbolOffset:f.getItemVisual(w,"symbolOffset"),fromSymbolRotate:f.getItemVisual(w,"symbolRotate"),fromSymbolSize:f.getItemVisual(w,"symbolSize"),fromSymbol:f.getItemVisual(w,"symbol"),toSymbolKeepAspect:p.getItemVisual(w,"symbolKeepAspect"),toSymbolOffset:p.getItemVisual(w,"symbolOffset"),toSymbolRotate:p.getItemVisual(w,"symbolRotate"),toSymbolSize:p.getItemVisual(w,"symbolSize"),toSymbol:p.getItemVisual(w,"symbol"),style:T})}),h.updateData(g),d.line.eachItemGraphicEl(function(w){Cr(w).dataModel=n,w.traverse(function(A){Cr(A).dataModel=n})});function x(w,A,T){var S=w.getItemModel(A);Ove(w,A,T,r,a);var O=S.getModel("itemStyle").getItemStyle();O.fill==null&&(O.fill=u8(l,"color")),w.setItemVisual(A,{symbolKeepAspect:S.get("symbolKeepAspect"),symbolOffset:Jt(S.get("symbolOffset",!0),b[T?0:1]),symbolRotate:Jt(S.get("symbolRotate",!0),y[T?0:1]),symbolSize:Jt(S.get("symbolSize"),v[T?0:1]),symbol:Jt(S.get("symbol",!0),m[T?0:1]),style:O})}this.markKeep(h),h.group.silent=n.get("silent")||r.get("silent")},e.type="markLine",e}(Cve);function EVr(t,e,r){var n;t?n=vt(t&&t.dimensions,function(u){var h=e.getData(),d=h.getDimensionInfo(h.mapDimension(u))||{};return ot(ot({},d),{name:u,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new zc(n,r),a=new zc(n,r),s=new zc([],r),o=vt(r.get("data"),qr(CVr,e,t,r));t&&(o=ni(o,qr(OVr,t)));var l=_ft(!!t,n);return i.initData(vt(o,function(u){return u[0]}),null,l),a.initData(vt(o,function(u){return u[1]}),null,l),s.initData(vt(o,function(u){return u[2]})),s.hasItemOption=!0,{from:i,to:a,line:s}}function _Vr(t){t.registerComponentModel(SVr),t.registerComponentView(kVr),t.registerPreprocessor(function(e){Ave(e.series,"markLine")&&(e.markLine=e.markLine||{})})}var RVr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.createMarkerModelFromSeries=function(r,n,i){return new e(r,n,i)},e.type="markArea",e.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},e}(Hm),dq=Qr(),DVr=function(t,e,r,n){var i=n[0],a=n[1];if(!(!i||!a)){var s=bB(t,i),o=bB(t,a),l=s.coord,u=o.coord;l[0]=Pc(l[0],-1/0),l[1]=Pc(l[1],-1/0),u[0]=Pc(u[0],1/0),u[1]=Pc(u[1],1/0);var h=fG([{},s,o]);return h.coord=[s.coord,o.coord],h.x0=s.x,h.y0=s.y,h.x1=o.x,h.y1=o.y,h}};function fq(t){return!isNaN(t)&&!isFinite(t)}function Lft(t,e,r,n){var i=1-t;return fq(e[i])&&fq(r[i])}function LVr(t,e){var r=e.coord[0],n=e.coord[1],i={coord:r,x:e.x0,y:e.y0},a={coord:n,x:e.x1,y:e.y1};return NT(t,"cartesian2d")?r&&n&&(Lft(1,r,n)||Lft(0,r,n))?!0:bVr(t,i,a):xB(t,i)||xB(t,a)}function Mft(t,e,r,n,i){var a=n.coordinateSystem,s=t.getItemModel(e),o,l=Qt(s.get(r[0]),i.getWidth()),u=Qt(s.get(r[1]),i.getHeight());if(!isNaN(l)&&!isNaN(u))o=[l,u];else{if(n.getMarkerPosition){var h=t.getValues(["x0","y0"],e),d=t.getValues(["x1","y1"],e),f=a.clampData(h),p=a.clampData(d),g=[];r[0]==="x0"?g[0]=f[0]>p[0]?d[0]:h[0]:g[0]=f[0]>p[0]?h[0]:d[0],r[1]==="y0"?g[1]=f[1]>p[1]?d[1]:h[1]:g[1]=f[1]>p[1]?h[1]:d[1],o=n.getMarkerPosition(g,r,!0)}else{var m=t.get(r[0],e),v=t.get(r[1],e),y=[m,v];a.clampData&&a.clampData(y,y),o=a.dataToPoint(y,!0)}if(NT(a,"cartesian2d")){var b=a.getAxis("x"),x=a.getAxis("y"),m=t.get(r[0],e),v=t.get(r[1],e);fq(m)?o[0]=b.toGlobalCoord(b.getExtent()[r[0]==="x0"?0:1]):fq(v)&&(o[1]=x.toGlobalCoord(x.getExtent()[r[1]==="y0"?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}return o}var Ift=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],MVr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.updateTransform=function(r,n,i){n.eachSeries(function(a){var s=Hm.getMarkerModelFromSeries(a,"markArea");if(s){var o=s.getData();o.each(function(l){var u=vt(Ift,function(d){return Mft(o,l,d,a,i)});o.setItemLayout(l,u);var h=o.getItemGraphicEl(l);h.setShape("points",u)})}},this)},e.prototype.renderSeries=function(r,n,i,a){var s=r.coordinateSystem,o=r.id,l=r.getData(),u=this.markerGroupMap,h=u.get(o)||u.set(o,{group:new pr});this.group.add(h.group),this.markKeep(h);var d=IVr(s,r,n);n.setData(d),d.each(function(f){var p=vt(Ift,function(E){return Mft(d,f,E,r,a)}),g=s.getAxis("x").scale,m=s.getAxis("y").scale,v=g.getExtent(),y=m.getExtent(),b=[g.parse(d.get("x0",f)),g.parse(d.get("x1",f))],x=[m.parse(d.get("y0",f)),m.parse(d.get("y1",f))];xl(b),xl(x);var w=!(v[0]>b[1]||v[1]x[1]||y[1]=0},e.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",bottom:et.size.m,align:"auto",backgroundColor:et.color.transparent,borderColor:et.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:et.color.disabled,inactiveBorderColor:et.color.disabled,inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:et.color.disabled,inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:et.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:et.color.tertiary,borderWidth:1,borderColor:et.color.border},emphasis:{selectorLabel:{show:!0,color:et.color.quaternary}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},e}(fn),y5=qr,Eve=de,pq=pr,Pft=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.newlineDisabled=!1,r}return e.prototype.init=function(){this.group.add(this._contentGroup=new pq),this.group.add(this._selectorGroup=new pq),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(r,n,i){var a=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!r.get("show",!0)){var s=r.get("align"),o=r.get("orient");(!s||s==="auto")&&(s=r.get("left")==="right"&&o==="vertical"?"right":"left");var l=r.get("selector",!0),u=r.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=o==="horizontal"?"end":"start"),this.renderInner(s,r,n,i,l,o,u);var h=Co(r,i).refContainer,d=r.getBoxLayoutParams(),f=r.get("padding"),p=da(d,h,f),g=this.layoutInner(r,s,p,a,l,u),m=da(mr({width:g.width,height:g.height},d),h,f);this.group.x=m.x-g.x,this.group.y=m.y-g.y,this.group.markRedraw(),this.group.add(this._backgroundEl=Qdt(g,r))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(r,n,i,a,s,o,l){var u=this.getContentGroup(),h=Yt(),d=n.get("selectedMode"),f=n.get("triggerEvent"),p=[];i.eachRawSeries(function(g){!g.get("legendHoverLink")&&p.push(g.id)}),Eve(n.getData(),function(g,m){var v=this,y=g.get("name");if(!this.newlineDisabled&&(y===""||y===` -`)){var b=new pq;b.newline=!0,u.add(b);return}var x=i.getSeriesByName(y)[0];if(!h.get(y))if(x){var w=x.getData(),A=w.getVisual("legendLineStyle")||{},T=w.getVisual("legendIcon"),S=w.getVisual("style"),O=this._createItem(x,y,m,g,n,r,A,S,T,d,a);O.on("click",y5(Nft,y,null,a,p)).on("mouseover",y5(_ve,x.name,null,a,p)).on("mouseout",y5(Rve,x.name,null,a,p)),i.ssr&&O.eachChild(function(k){var E=Cr(k);E.seriesIndex=x.seriesIndex,E.dataIndex=m,E.ssrType="legend"}),f&&O.eachChild(function(k){v.packEventData(k,n,x,m,y)}),h.set(y,!0)}else i.eachRawSeries(function(k){var E=this;if(!h.get(y)&&k.legendVisualProvider){var _=k.legendVisualProvider;if(!_.containName(y))return;var I=_.indexOfName(y),L=_.getItemVisual(I,"style"),R=_.getItemVisual(I,"legendIcon"),D=Bc(L.fill);D&&D[3]===0&&(D[3]=.2,L=ot(ot({},L),{fill:Pf(D,"rgba")}));var M=this._createItem(k,y,m,g,n,r,{},L,R,d,a);M.on("click",y5(Nft,null,y,a,p)).on("mouseover",y5(_ve,null,y,a,p)).on("mouseout",y5(Rve,null,y,a,p)),i.ssr&&M.eachChild(function(P){var N=Cr(P);N.seriesIndex=k.seriesIndex,N.dataIndex=m,N.ssrType="legend"}),f&&M.eachChild(function(P){E.packEventData(P,n,k,m,y)}),h.set(y,!0)}},this)},this),s&&this._createSelector(s,n,a,o,l)},e.prototype.packEventData=function(r,n,i,a,s){var o={componentType:"legend",componentIndex:n.componentIndex,dataIndex:a,value:s,seriesIndex:i.seriesIndex};Cr(r).eventData=o},e.prototype._createSelector=function(r,n,i,a,s){var o=this.getSelectorGroup();Eve(r,function(u){var h=u.type,d=new Pn({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:h==="all"?"legendAllSelect":"legendInverseSelect",legendId:n.id})}});o.add(d);var f=n.getModel("selectorLabel"),p=n.getModel(["emphasis","selectorLabel"]);qo(d,{normal:f,emphasis:p},{defaultText:u.title}),vx(d)})},e.prototype._createItem=function(r,n,i,a,s,o,l,u,h,d,f){var p=r.visualDrawType,g=s.get("itemWidth"),m=s.get("itemHeight"),v=s.isSelected(n),y=a.get("symbolRotate"),b=a.get("symbolKeepAspect"),x=a.get("icon");h=x||h||"roundRect";var w=BVr(h,a,l,u,p,v,f),A=new pq,T=a.getModel("textStyle");if(ur(r.getLegendIcon)&&(!x||x==="inherit"))A.add(r.getLegendIcon({itemWidth:g,itemHeight:m,icon:h,iconRotate:y,itemStyle:w.itemStyle,lineStyle:w.lineStyle,symbolKeepAspect:b}));else{var S=x==="inherit"&&r.getData().getVisual("symbol")?y==="inherit"?r.getData().getVisual("symbolRotate"):y:0;A.add($Vr({itemWidth:g,itemHeight:m,icon:h,iconRotate:S,itemStyle:w.itemStyle,symbolKeepAspect:b}))}var O=o==="left"?g+5:-5,k=o,E=s.get("formatter"),_=n;Nt(E)&&E?_=E.replace("{name}",n??""):ur(E)&&(_=E(n));var I=v?T.getTextColor():a.get("inactiveColor");A.add(new Pn({style:Gi(T,{text:_,x:O,y:m/2,fill:I,align:k,verticalAlign:"middle"},{inheritColor:I})}));var L=new tn({shape:A.getBoundingRect(),style:{fill:"transparent"}}),R=a.getModel("tooltip");return R.get("show")&&uy({el:L,componentModel:s,itemName:n,itemTooltipOption:R.option}),A.add(L),A.eachChild(function(D){D.silent=!0}),L.silent=!d,this.getContentGroup().add(A),vx(A),A.__legendDataIndex=i,A},e.prototype.layoutInner=function(r,n,i,a,s,o){var l=this.getContentGroup(),u=this.getSelectorGroup();hT(r.get("orient"),l,r.get("itemGap"),i.width,i.height);var h=l.getBoundingRect(),d=[-h.x,-h.y];if(u.markRedraw(),l.markRedraw(),s){hT("horizontal",u,r.get("selectorItemGap",!0));var f=u.getBoundingRect(),p=[-f.x,-f.y],g=r.get("selectorButtonGap",!0),m=r.getOrient().index,v=m===0?"width":"height",y=m===0?"height":"width",b=m===0?"y":"x";o==="end"?p[m]+=h[v]+g:d[m]+=f[v]+g,p[1-m]+=h[y]/2-f[y]/2,u.x=p[0],u.y=p[1],l.x=d[0],l.y=d[1];var x={x:0,y:0};return x[v]=h[v]+g+f[v],x[y]=Math.max(h[y],f[y]),x[b]=Math.min(0,f[b]+p[1-m]),x}else return l.x=d[0],l.y=d[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(Hi);function BVr(t,e,r,n,i,a,s){function o(v,y){v.lineWidth==="auto"&&(v.lineWidth=y.lineWidth>0?2:0),Eve(v,function(b,x){v[x]==="inherit"&&(v[x]=y[x])})}var l=e.getModel("itemStyle"),u=l.getItemStyle(),h=t.lastIndexOf("empty",0)===0?"fill":"stroke",d=l.getShallow("decal");u.decal=!d||d==="inherit"?n.decal:B_(d,s),u.fill==="inherit"&&(u.fill=n[i]),u.stroke==="inherit"&&(u.stroke=n[h]),u.opacity==="inherit"&&(u.opacity=(i==="fill"?n:r).opacity),o(u,n);var f=e.getModel("lineStyle"),p=f.getLineStyle();if(o(p,r),u.fill==="auto"&&(u.fill=n.fill),u.stroke==="auto"&&(u.stroke=n.fill),p.stroke==="auto"&&(p.stroke=n.fill),!a){var g=e.get("inactiveBorderWidth"),m=u[h];u.lineWidth=g==="auto"?n.lineWidth>0&&m?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),p.stroke=f.get("inactiveColor"),p.lineWidth=f.get("inactiveWidth")}return{itemStyle:u,lineStyle:p}}function $Vr(t){var e=t.icon||"roundRect",r=$s(e,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill,t.symbolKeepAspect);return r.setStyle(t.itemStyle),r.rotation=(t.iconRotate||0)*Math.PI/180,r.setOrigin([t.itemWidth/2,t.itemHeight/2]),e.indexOf("empty")>-1&&(r.style.stroke=r.style.fill,r.style.fill=et.color.neutral00,r.style.lineWidth=2),r}function Nft(t,e,r,n){Rve(t,e,r,n),r.dispatchAction({type:"legendToggleSelect",name:t??e}),_ve(t,e,r,n)}function _ve(t,e,r,n){r.usingTHL()||r.dispatchAction({type:"highlight",seriesName:t,name:e,excludeSeriesId:n})}function Rve(t,e,r,n){r.usingTHL()||r.dispatchAction({type:"downplay",seriesName:t,name:e,excludeSeriesId:n})}function wB(t,e,r){var n=t==="allSelect"||t==="inverseSelect",i={},a=[];r.eachComponent({mainType:"legend",query:e},function(o){n?o[t]():o[t](e.name),Bft(o,i),a.push(o.componentIndex)});var s={};return r.eachComponent("legend",function(o){de(i,function(l,u){o[l?"select":"unSelect"](u)}),Bft(o,s)}),n?{selected:s,legendIndex:a}:{name:e.name,selected:s}}function Bft(t,e){var r=e||{};return de(t.getData(),function(n){var i=n.get("name");if(!(i===` -`||i==="")){var a=t.isSelected(i);Kt(r,i)?r[i]=r[i]&&a:r[i]=a}}),r}function FVr(t){t.registerAction("legendToggleSelect","legendselectchanged",qr(wB,"toggleSelected")),t.registerAction("legendAllSelect","legendselectall",qr(wB,"allSelect")),t.registerAction("legendInverseSelect","legendinverseselect",qr(wB,"inverseSelect")),t.registerAction("legendSelect","legendselected",qr(wB,"select")),t.registerAction("legendUnSelect","legendunselected",qr(wB,"unSelect"))}var zVr=LN(UVr);function UVr(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.filterSeries(function(r){for(var n=0;ni[s],v=[-p.x,-p.y];n||(v[a]=h[u]);var y=[0,0],b=[-g.x,-g.y],x=Jt(r.get("pageButtonGap",!0),r.get("itemGap",!0));if(m){var w=r.get("pageButtonPosition",!0);w==="end"?b[a]+=i[s]-g[s]:y[a]+=g[s]+x}b[1-a]+=p[o]/2-g[o]/2,h.setPosition(v),d.setPosition(y),f.setPosition(b);var A={x:0,y:0};if(A[s]=m?i[s]:p[s],A[o]=Math.max(p[o],g[o]),A[l]=Math.min(0,g[l]+b[1-a]),d.__rectSize=i[s],m){var T={x:0,y:0};T[s]=Math.max(i[s]-g[s]-x,0),T[o]=A[o],d.setClipPath(new tn({shape:T})),d.__rectSize=T[s]}else f.eachChild(function(O){O.attr({invisible:!0,silent:!0})});var S=this._getPageInfo(r);return S.pageIndex!=null&&Hn(h,{x:S.contentPosition[0],y:S.contentPosition[1]},m?r:null),this._updatePageInfoView(r,S),A},e.prototype._pageGo=function(r,n,i){var a=this._getPageInfo(n)[r];a!=null&&i.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:n.id})},e.prototype._updatePageInfoView=function(r,n){var i=this._controllerGroup;de(["pagePrev","pageNext"],function(h){var d=h+"DataIndex",f=n[d]!=null,p=i.childOfName(h);p&&(p.setStyle("fill",f?r.get("pageIconColor",!0):r.get("pageIconInactiveColor",!0)),p.cursor=f?"pointer":"default")});var a=i.childOfName("pageText"),s=r.get("pageFormatter"),o=n.pageIndex,l=o!=null?o+1:0,u=n.pageCount;a&&s&&a.setStyle("text",Nt(s)?s.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):s({current:l,total:u}))},e.prototype._getPageInfo=function(r){var n=r.get("scrollDataIndex",!0),i=this.getContentGroup(),a=this._containerGroup.__rectSize,s=r.getOrient().index,o=Dve[s],l=Lve[s],u=this._findTargetItemIndex(n),h=i.children(),d=h[u],f=h.length,p=f?1:0,g={contentPosition:[i.x,i.y],pageCount:p,pageIndex:p-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!d)return g;var m=w(d);g.contentPosition[s]=-m.s;for(var v=u+1,y=m,b=m,x=null;v<=f;++v)x=w(h[v]),(!x&&b.e>y.s+a||x&&!A(x,y.s))&&(b.i>y.i?y=b:y=x,y&&(g.pageNextDataIndex==null&&(g.pageNextDataIndex=y.i),++g.pageCount)),b=x;for(var v=u-1,y=m,b=m,x=null;v>=-1;--v)x=w(h[v]),(!x||!A(b,x.s))&&y.i=S&&T.s<=S+a}},e.prototype._findTargetItemIndex=function(r){if(!this._showController)return 0;var n,i=this.getContentGroup(),a;return i.eachChild(function(s,o){var l=s.__legendDataIndex;a==null&&l!=null&&(a=o),l===r&&(n=o)}),n??a},e.type="legend.scroll",e}(Pft);function GVr(t){t.registerAction("legendScroll","legendscroll",function(e,r){var n=e.scrollDataIndex;n!=null&&r.eachComponent({mainType:"legend",subType:"scroll",query:e},function(i){i.setScrollDataIndex(n)})})}function HVr(t){Yr($ft),t.registerComponentModel(VVr),t.registerComponentView(QVr),GVr(t)}function WVr(t){Yr($ft),Yr(HVr)}var YVr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="dataZoom.inside",e.defaultOption=xx(mB.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(mB),Mve=Qr();function qVr(t,e,r){Mve(t).coordSysRecordMap.each(function(n){var i=n.dataZoomInfoMap.get(e.uid);i&&(i.getRange=r)})}function jVr(t,e){for(var r=Mve(t).coordSysRecordMap,n=r.keys(),i=0;ia[i+n]&&(n=d),s=s&&h.get("preventDefaultMouseMove",!0),o=Jt(h.get("cursorGrab",!0),o),l=Jt(h.get("cursorGrabbing",!0),l)}),{controlType:n,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!s,api:r,zInfo:{component:e.model},triggerInfo:{roamTrigger:null,isInSelf:e.containsPoint},cursorGrab:o,cursorGrabbing:l}}}function eQr(t){t.registerUpdateLifecycle("coordsys:aftercreate",function(e,r){var n=Mve(r),i=n.coordSysRecordMap||(n.coordSysRecordMap=Yt());i.each(function(a){a.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var s=Bdt(a);de(s.infoList,function(o){var l=o.model.uid,u=i.get(l)||i.set(l,XVr(r,o.model)),h=u.dataZoomInfoMap||(u.dataZoomInfoMap=Yt());h.set(a.uid,{dzReferCoordSysInfo:o,model:a,getRange:null})})}),i.each(function(a){var s=a.controller,o,l=a.dataZoomInfoMap;if(l){var u=l.keys()[0];u!=null&&(o=l.get(u))}if(!o){Uft(i,a);return}var h=JVr(l,a,r);s.enable(h.controlType,h.opt),D_(a,"dispatchAction",o.model.get("throttle",!0),"fixRate")})})}var tQr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataZoom.inside",r}return e.prototype.render=function(r,n,i){if(t.prototype.render.apply(this,arguments),r.noTarget()){this._clear();return}this.range=r.getPercentRange(),qVr(i,r,{pan:Ht(Ive.pan,this),zoom:Ht(Ive.zoom,this),scrollMove:Ht(Ive.scrollMove,this)})},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){jVr(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(lve),Ive={zoom:function(t,e,r,n){var i=this.range,a=i.slice(),s=t.axisModels[0];if(s){var o=Pve[e](null,[n.originX,n.originY],s,r,t),l=(o.signal>0?o.pixelStart+o.pixelLength-o.pixel:o.pixel-o.pixelStart)/o.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/n.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var h=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(Ix(0,a,[0,100],0,h.minSpan,h.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:Vft(function(t,e,r,n,i,a){var s=Pve[n]([a.oldX,a.oldY],[a.newX,a.newY],e,i,r);return s.signal*(t[1]-t[0])*s.pixel/s.pixelLength}),scrollMove:Vft(function(t,e,r,n,i,a){var s=Pve[n]([0,0],[a.scrollDelta,a.scrollDelta],e,i,r);return s.signal*(t[1]-t[0])*a.scrollDelta})};function Vft(t){return function(e,r,n,i){var a=this.range,s=a.slice(),o=e.axisModels[0];if(o){var l=t(s,o,e,r,n,i);if(Ix(l,s,[0,100],"all"),this.range=s,a[0]!==s[0]||a[1]!==s[1])return s}}}var Pve={grid:function(t,e,r,n,i){var a=r.axis,s={},o=i.model.coordinateSystem.getRect();return t=t||[0,0],a.dim==="x"?(s.pixel=e[0]-t[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s},polar:function(t,e,r,n,i){var a=r.axis,s={},o=i.model.coordinateSystem,l=o.getRadiusAxis().getExtent(),u=o.getAngleAxis().getExtent();return t=t?o.pointToCoord(t):[0,0],e=o.pointToCoord(e),r.mainType==="radiusAxis"?(s.pixel=e[0]-t[0],s.pixelLength=l[1]-l[0],s.pixelStart=l[0],s.signal=a.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=u[1]-u[0],s.pixelStart=u[0],s.signal=a.inverse?-1:1),s},singleAxis:function(t,e,r,n,i){var a=r.axis,s=i.model.coordinateSystem.getRect(),o={};return t=t||[0,0],a.orient==="horizontal"?(o.pixel=e[0]-t[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=e[1]-t[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o}};function Qft(t){cve(t),t.registerComponentModel(YVr),t.registerComponentView(tQr),eQr(t)}var rQr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=xx(mB.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:et.color.accent10,borderRadius:0,backgroundColor:et.color.transparent,dataBackground:{lineStyle:{color:et.color.accent30,width:.5},areaStyle:{color:et.color.accent20,opacity:.2}},selectedDataBackground:{lineStyle:{color:et.color.accent40,width:.5},areaStyle:{color:et.color.accent20,opacity:.3}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:et.color.neutral00,borderColor:et.color.accent20},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:et.color.accent40,opacity:.5},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:et.color.tertiary},brushSelect:!0,brushStyle:{color:et.color.accent30,opacity:.3},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:et.color.accent40},moveHandleStyle:{opacity:.8}},defaultLocationEdgeGap:15}),e}(mB),AB=tn,nQr=1,Nve=30,iQr=7,TB="horizontal",Gft="vertical",aQr=5,sQr=["line","bar","candlestick","scatter"],oQr={easing:"cubicOut",duration:100,delay:0},lQr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r._displayables={},r}return e.prototype.init=function(r,n){this.api=n,this._onBrush=Ht(this._onBrush,this),this._onBrushEnd=Ht(this._onBrushEnd,this)},e.prototype.render=function(r,n,i,a){if(t.prototype.render.apply(this,arguments),D_(this,"_dispatchZoomAction",r.get("throttle"),"fixRate"),this._orient=r.getOrient(),r.get("show")===!1){this.group.removeAll();return}if(r.noTarget()){this._clear(),this.group.removeAll();return}(!a||a.type!=="dataZoom"||a.from!==this.uid)&&this._buildView(),this._updateView()},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){s8(this,"_dispatchZoomAction");var r=this.api.getZr();r.off("mousemove",this._onBrush),r.off("mouseup",this._onBrushEnd)},e.prototype._buildView=function(){var r=this.group;r.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var n=this._displayables.sliderGroup=new pr;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),r.add(n),this._positionGroup()},e.prototype._resetLocation=function(){var r=this.dataZoomModel,n=this.api,i=r.get("brushSelect"),a=i?iQr:0,s=Co(r,n).refContainer,o=this._findCoordRect(),l=r.get("defaultLocationEdgeGap",!0)||0,u=this._orient===TB?{right:s.width-o.x-o.width,top:s.height-Nve-l-a,width:o.width,height:Nve}:{right:l,top:o.y,width:Nve,height:o.height},h=dT(r.option);de(["right","top","width","height"],function(f){h[f]==="ph"&&(h[f]=u[f])});var d=da(h,s);this._location={x:d.x,y:d.y},this._size=[d.width,d.height],this._orient===Gft&&this._size.reverse()},e.prototype._positionGroup=function(){var r=this.group,n=this._location,i=this._orient,a=this.dataZoomModel.getFirstTargetAxisModel(),s=a&&a.get("inverse"),o=this._displayables.sliderGroup,l=(this._dataShadowInfo||{}).otherAxisInverse;o.attr(i===TB&&!s?{scaleY:l?1:-1,scaleX:1}:i===TB&&s?{scaleY:l?1:-1,scaleX:-1}:i===Gft&&!s?{scaleY:l?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:l?-1:1,scaleX:-1,rotation:Math.PI/2});var u=r.getBoundingRect([o]),h=isNaN(u.x)?0:u.x,d=isNaN(u.y)?0:u.y;r.x=n.x-h,r.y=n.y-d,r.markRedraw()},e.prototype._getViewExtent=function(){return[0,this._size[0]]},e.prototype._renderBackground=function(){var r=this.dataZoomModel,n=this._size,i=this._displayables.sliderGroup,a=r.get("brushSelect");i.add(new AB({silent:!0,shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:r.get("backgroundColor")},z2:-40}));var s=new AB({shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:"transparent"},z2:0,onclick:Ht(this._onClickPanel,this)}),o=this.api.getZr();a?(s.on("mousedown",this._onBrushStart,this),s.cursor="crosshair",o.on("mousemove",this._onBrush),o.on("mouseup",this._onBrushEnd)):(o.off("mousemove",this._onBrush),o.off("mouseup",this._onBrushEnd)),i.add(s)},e.prototype._renderDataShadow=function(){var r=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!r)return;var n=this._size,i=this._shadowSize||[],a=r.series,s=a.getRawData(),o=a.getShadowDim&&a.getShadowDim(),l=o&&s.getDimensionInfo(o)?a.getShadowDim():r.otherDim;if(l==null)return;var u=this._shadowPolygonPts,h=this._shadowPolylinePts;if(s!==this._shadowData||l!==this._shadowDim||n[0]!==i[0]||n[1]!==i[1]){var d=s.getDataExtent(r.thisDim),f=s.getDataExtent(l),p=(f[1]-f[0])*.3;f=[f[0]-p,f[1]+p];var g=[0,n[1]],m=[0,n[0]],v=[[n[0],0],[0,0]],y=[],b=m[1]/Math.max(1,s.count()-1),x=n[0]/(d[1]-d[0]),w=r.thisAxis.type==="time",A=-b,T=Math.round(s.count()/n[0]),S;s.each([r.thisDim,l],function(I,L,R){if(T>0&&R%T){w||(A+=b);return}A=w?(+I-d[0])*x:A+b;var D=L==null||isNaN(L)||L==="",M=D?0:jn(L,f,g,!0);D&&!S&&R?(v.push([v[v.length-1][0],0]),y.push([y[y.length-1][0],0])):!D&&S&&(v.push([A,0]),y.push([A,0])),D||(v.push([A,M]),y.push([A,M])),S=D}),u=this._shadowPolygonPts=v,h=this._shadowPolylinePts=y}this._shadowData=s,this._shadowDim=l,this._shadowSize=[n[0],n[1]];var O=this.dataZoomModel;function k(I){var L=O.getModel(I?"selectedDataBackground":"dataBackground"),R=new pr,D=new ic({shape:{points:u},segmentIgnoreThreshold:1,style:L.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),M=new Al({shape:{points:h},segmentIgnoreThreshold:1,style:L.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return R.add(D),R.add(M),R}for(var E=0;E<3;E++){var _=k(E===1);this._displayables.sliderGroup.add(_),this._displayables.dataShadowSegs.push(_)}},e.prototype._prepareDataShadowInfo=function(){var r=this.dataZoomModel,n=r.get("showDataShadow");if(n!==!1){var i,a=this.ecModel;return r.eachTargetAxis(function(s,o){var l=r.getAxisProxy(s,o).getTargetSeriesModels();de(l,function(u){if(!i&&!(n!==!0&&Ir(sQr,u.get("type"))<0)){var h=a.getComponent(zx(s),o).axis,d=cQr(s),f,p=u.coordinateSystem;d!=null&&p.getOtherAxis&&(f=p.getOtherAxis(h).inverse),d=u.getData().mapDimension(d);var g=u.getData().mapDimension(s);i={thisAxis:h,series:u,thisDim:g,otherDim:d,otherAxisInverse:f}}},this)},this),i}},e.prototype._renderHandle=function(){var r=this.group,n=this._displayables,i=n.handles=[null,null],a=n.handleLabels=[null,null],s=this._displayables.sliderGroup,o=this._size,l=this.dataZoomModel,u=this.api,h=l.get("borderRadius")||0,d=l.get("brushSelect"),f=n.filler=new AB({silent:d,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});s.add(f),s.add(new AB({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:o[0],height:o[1],r:h},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:nQr,fill:et.color.transparent}})),de([0,1],function(x){var w=l.get("handleIcon");!nW[w]&&w.indexOf("path://")<0&&w.indexOf("image://")<0&&(w="path://"+w);var A=$s(w,-1,0,2,2,null,!0);A.attr({cursor:uQr(this._orient),draggable:!0,drift:Ht(this._onDragMove,this,x),ondragend:Ht(this._onDragEnd,this),onmouseover:Ht(this._onOverDataInfoTriggerArea,this,!0),onmouseout:Ht(this._onOverDataInfoTriggerArea,this,!1),z2:5});var T=A.getBoundingRect(),S=l.get("handleSize");this._handleHeight=Qt(S,this._size[1]),this._handleWidth=T.width/T.height*this._handleHeight,A.setStyle(l.getModel("handleStyle").getItemStyle()),A.style.strokeNoScale=!0,A.rectHover=!0,A.ensureState("emphasis").style=l.getModel(["emphasis","handleStyle"]).getItemStyle(),vx(A);var O=l.get("handleColor");O!=null&&(A.style.fill=O),s.add(i[x]=A);var k=l.getModel("textStyle"),E=l.get("handleLabel")||{},_=E.show||!1;r.add(a[x]=new Pn({silent:!0,invisible:!_,style:Gi(k,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:k.getTextColor(),font:k.getFont()}),z2:10}))},this);var p=f;if(d){var g=Qt(l.get("moveHandleSize"),o[1]),m=n.moveHandle=new tn({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:o[1]-.5,height:g}}),v=g*.8,y=n.moveHandleIcon=$s(l.get("moveHandleIcon"),-v/2,-v/2,v,v,et.color.neutral00,!0);y.silent=!0,y.y=o[1]+g/2-.5,m.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var b=Math.min(o[1]/2,Math.max(g,10));p=n.moveZone=new tn({invisible:!0,shape:{y:o[1]-b,height:g+b}}),p.on("mouseover",function(){u.enterEmphasis(m)}).on("mouseout",function(){u.leaveEmphasis(m)}),s.add(m),s.add(y),s.add(p)}p.attr({draggable:!0,cursor:"grab",drift:Ht(this._onActualMoveZoneDrift,this),ondragstart:Ht(this._onActualMoveZoneDragStart,this),ondragend:Ht(this._onActualMoveZoneDragEnd,this),onmouseover:Ht(this._onOverDataInfoTriggerArea,this,!0),onmouseout:Ht(this._onOverDataInfoTriggerArea,this,!1)})},e.prototype._resetInterval=function(){var r=this._range=this.dataZoomModel.getPercentRange(),n=this._getViewExtent();this._handleEnds=[jn(r[0],[0,100],n,!0),jn(r[1],[0,100],n,!0)]},e.prototype._updateInterval=function(r,n){var i=this.dataZoomModel,a=this._handleEnds,s=this._getViewExtent(),o=i.findRepresentativeAxisProxy().getMinMaxSpan(),l=[0,100];Ix(n,a,s,i.get("zoomLock")?"all":r,o.minSpan!=null?jn(o.minSpan,l,s,!0):null,o.maxSpan!=null?jn(o.maxSpan,l,s,!0):null);var u=this._range,h=this._range=xl([jn(a[0],s,l,!0),jn(a[1],s,l,!0)]);return!u||u[0]!==h[0]||u[1]!==h[1]},e.prototype._updateView=function(r){var n=this._displayables,i=this._handleEnds,a=xl(i.slice()),s=this._size;de([0,1],function(p){var g=n.handles[p],m=this._handleHeight;g.attr({scaleX:m/2,scaleY:m/2,x:i[p]+(p?-1:1),y:s[1]/2-m/2})},this),n.filler.setShape({x:a[0],y:0,width:a[1]-a[0],height:s[1]});var o={x:a[0],width:a[1]-a[0]};n.moveHandle&&(n.moveHandle.setShape(o),n.moveZone.setShape(o),n.moveZone.getBoundingRect(),n.moveHandleIcon&&n.moveHandleIcon.attr("x",o.x+o.width/2));for(var l=n.dataShadowSegs,u=[0,a[0],a[1],s[0]],h=0;hn[0]||i[1]<0||i[1]>n[1])){var a=this._handleEnds,s=(a[0]+a[1])/2,o=this._updateInterval("all",i[0]-s);this._updateView(),o&&this._dispatchZoomAction(!1)}},e.prototype._onBrushStart=function(r){var n=r.offsetX,i=r.offsetY;this._brushStart=new wr(n,i),this._brushing=!0,this._brushStartTime=+new Date},e.prototype._onBrushEnd=function(r){if(this._brushing){var n=this._displayables.brushRect;if(this._brushing=!1,!!n){n.attr("ignore",!0);var i=n.shape,a=+new Date;if(!(a-this._brushStartTime<200&&Math.abs(i.width)<5)){var s=this._getViewExtent(),o=[0,100],l=this._handleEnds=[i.x,i.x+i.width],u=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();Ix(0,l,s,0,u.minSpan!=null?jn(u.minSpan,o,s,!0):null,u.maxSpan!=null?jn(u.maxSpan,o,s,!0):null),this._range=xl([jn(l[0],s,o,!0),jn(l[1],s,o,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(r){this._brushing&&(Kv(r.event),this._updateBrushRect(r.offsetX,r.offsetY))},e.prototype._updateBrushRect=function(r,n){var i=this._displayables,a=this.dataZoomModel,s=i.brushRect;s||(s=i.brushRect=new AB({silent:!0,style:a.getModel("brushStyle").getItemStyle()}),i.sliderGroup.add(s)),s.attr("ignore",!1);var o=this._brushStart,l=this._displayables.sliderGroup,u=l.transformCoordToLocal(r,n),h=l.transformCoordToLocal(o.x,o.y),d=this._size;u[0]=Math.max(Math.min(d[0],u[0]),0),s.setShape({x:h[0],y:0,width:u[0]-h[0],height:d[1]})},e.prototype._dispatchZoomAction=function(r){var n=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:r?oQr:null,start:n[0],end:n[1]})},e.prototype._findCoordRect=function(){var r,n=Bdt(this.dataZoomModel).infoList;if(!r&&n.length){var i=n[0].model.coordinateSystem;r=i.getRect&&i.getRect()}if(!r){var a=this.api.getWidth(),s=this.api.getHeight();r={x:a*.2,y:s*.2,width:a*.6,height:s*.6}}return r},e.type="dataZoom.slider",e}(lve);function Hft(t,e,r,n){var i=t.get("labelFormatter"),a=t.get("labelPrecision");(a==null||a==="auto")&&(a=r.valuePrecision);var s=r.value[e],o=s==null||isNaN(s)?"":Uc(n)||b8(n)?n.getLabel({value:Math.round(s)}):isFinite(a)?Gn(s,a,!0):s+"";return ur(i)?i(s,o):Nt(i)?i.replace("{value}",o):o}function cQr(t){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[t]}function uQr(t){return t==="vertical"?"ns-resize":"ew-resize"}function Wft(t){t.registerComponentModel(rQr),t.registerComponentView(lQr),cve(t)}function hQr(t){Yr(Qft),Yr(Wft)}var Yft={get:function(t,e,r){var n=lr((dQr[t]||{})[e]);return r&&ft(n)?n[n.length-1]:n}},dQr={color:{active:["#006edd","#e0ffff"],inactive:[et.color.transparent]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},qft=Xo.mapVisual,fQr=Xo.eachVisual,pQr=ft,Bve=de,gQr=xl,mQr=jn,gq=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.stateList=["inRange","outOfRange"],r.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],r.layoutMode={type:"box",ignoreSize:!0},r.dataBound=[-1/0,1/0],r.targetVisuals={},r.controllerVisuals={},r}return e.prototype.init=function(r,n,i){this.mergeDefaultAndTheme(r,i)},e.prototype.optionUpdated=function(r,n){var i=this.option;!n&&pft(i,r,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},e.prototype.resetVisual=function(r){var n=this.stateList;r=Ht(r,this),this.controllerVisuals=yve(this.option.controller,n,r),this.targetVisuals=yve(this.option.target,n,r)},e.prototype.getItemSymbol=function(){return null},e.prototype.getTargetSeriesIndices=function(){var r=this,n=this.option.seriesTargets;if(n){var i=[];return Bve(n,function(l){if(l.seriesIndex!=null)i.push(l.seriesIndex);else if(l.seriesId!=null){var u;r.ecModel.eachSeries(function(h){h.id===l.seriesId&&(u=h)}),u&&i.push(u.componentIndex)}}),i}var a=this.option.seriesId,s=this.option.seriesIndex;s==null&&a==null&&(s="all");var o=i_(this.ecModel,"series",{index:s,id:a},{useDefault:!1,enableAll:!0,enableNone:!1}).models;return vt(o,function(l){return l.componentIndex})},e.prototype.eachTargetSeries=function(r,n){de(this.getTargetSeriesIndices(),function(i){var a=this.ecModel.getSeriesByIndex(i);a&&r.call(n,a)},this)},e.prototype.isTargetSeries=function(r){var n=!1;return this.eachTargetSeries(function(i){i===r&&(n=!0)}),n},e.prototype.formatValueText=function(r,n,i){var a=this.option,s=a.precision,o=this.dataBound,l=a.formatter,u;i=i||["<",">"],ft(r)&&(r=r.slice(),u=!0);var h=n?r:u?[d(r[0]),d(r[1])]:d(r);if(Nt(l))return l.replace("{value}",u?h[0]:h).replace("{value2}",u?h[1]:h);if(ur(l))return u?l(r[0],r[1]):l(r);if(u)return r[0]===o[0]?i[0]+" "+h[1]:r[1]===o[1]?i[1]+" "+h[0]:h[0]+" - "+h[1];return h;function d(f){return f===o[0]?"min":f===o[1]?"max":(+f).toFixed(Math.min(s,20))}},e.prototype.resetExtent=function(){var r=this.option,n=gQr([r.min,r.max]);this._dataExtent=n},e.prototype.getDimension=function(r){var n=this,i=this.option.seriesTargets;if(i){var a=Wv(i,function(s){return s.seriesIndex!=null&&s.seriesIndex===r||s.seriesId!=null&&s.seriesId===n.ecModel.getSeriesByIndex(r).id});if(a)return a.dimension}return this.option.dimension},e.prototype.getDataDimensionIndex=function(r){var n=r.hostModel.seriesIndex,i=this.getDimension(n);if(i!=null)return r.getDimensionIndex(i);for(var a=r.dimensions,s=a.length-1;s>=0;s--){var o=a[s],l=r.getDimensionInfo(o);if(!l.isCalculationCoord)return l.storeDimIndex}},e.prototype.getExtent=function(){return this._dataExtent.slice()},e.prototype.completeVisualOption=function(){var r=this.ecModel,n=this.option,i={inRange:n.inRange,outOfRange:n.outOfRange},a=n.target||(n.target={}),s=n.controller||(n.controller={});Vr(a,i),Vr(s,i);var o=this.isCategory();l.call(this,a),l.call(this,s),u.call(this,a,"inRange","outOfRange"),h.call(this,s);function l(d){pQr(n.color)&&!d.inRange&&(d.inRange={color:n.color.slice().reverse()}),d.inRange=d.inRange||{color:r.get("gradientColor")}}function u(d,f,p){var g=d[f],m=d[p];g&&!m&&(m=d[p]={},Bve(g,function(v,y){if(Xo.isValidType(y)){var b=Yft.get(y,"inactive",o);b!=null&&(m[y]=b,y==="color"&&!m.hasOwnProperty("opacity")&&!m.hasOwnProperty("colorAlpha")&&(m.opacity=[0,0]))}}))}function h(d){var f=(d.inRange||{}).symbol||(d.outOfRange||{}).symbol,p=(d.inRange||{}).symbolSize||(d.outOfRange||{}).symbolSize,g=this.get("inactiveColor"),m=this.getItemSymbol(),v=m||"roundRect";Bve(this.stateList,function(y){var b=this.itemSize,x=d[y];x||(x=d[y]={color:o?g:[g]}),x.symbol==null&&(x.symbol=f&&lr(f)||(o?v:[v])),x.symbolSize==null&&(x.symbolSize=p&&lr(p)||(o?b[0]:[b[0],b[0]])),x.symbol=qft(x.symbol,function(T){return T==="none"?v:T});var w=x.symbolSize;if(w!=null){var A=-1/0;fQr(w,function(T){T>A&&(A=T)}),x.symbolSize=qft(w,function(T){return mQr(T,[0,A],[0,b[0]],!0)})}},this)}},e.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},e.prototype.isCategory=function(){return!!this.option.categories},e.prototype.setSelected=function(r){},e.prototype.getSelected=function(){return null},e.prototype.getValueState=function(r){return null},e.prototype.getVisualMeta=function(r){return null},e.type="visualMap",e.dependencies=["series"],e.defaultOption={show:!0,z:4,min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:et.color.transparent,borderColor:et.color.borderTint,contentColor:et.color.theme[0],inactiveColor:et.color.disabled,borderWidth:0,padding:et.size.m,textGap:10,precision:0,textStyle:{color:et.color.secondary}},e}(fn),jft=[20,140],vQr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.optionUpdated=function(r,n){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(i){i.mappingMethod="linear",i.dataExtent=this.getExtent()}),this._resetRange()},e.prototype.resetItemSize=function(){t.prototype.resetItemSize.apply(this,arguments);var r=this.itemSize;(r[0]==null||isNaN(r[0]))&&(r[0]=jft[0]),(r[1]==null||isNaN(r[1]))&&(r[1]=jft[1])},e.prototype._resetRange=function(){var r=this.getExtent(),n=this.option.range;!n||n.auto?(r.auto=1,this.option.range=r):ft(n)&&(n[0]>n[1]&&n.reverse(),n[0]=Math.max(n[0],r[0]),n[1]=Math.min(n[1],r[1]))},e.prototype.completeVisualOption=function(){t.prototype.completeVisualOption.apply(this,arguments),de(this.stateList,function(r){var n=this.option.controller[r].symbolSize;n&&n[0]!==n[1]&&(n[0]=n[1]/3)},this)},e.prototype.setSelected=function(r){this.option.range=r.slice(),this._resetRange()},e.prototype.getSelected=function(){var r=this.getExtent(),n=xl((this.get("range")||[]).slice());return n[0]>r[1]&&(n[0]=r[1]),n[1]>r[1]&&(n[1]=r[1]),n[0]=i[1]||r<=n[1])?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(r){var n=[];return this.eachTargetSeries(function(i){var a=[],s=i.getData();s.each(this.getDataDimensionIndex(s),function(o,l){r[0]<=o&&o<=r[1]&&a.push(l)},this),n.push({seriesId:i.id,dataIndex:a})},this),n},e.prototype.getVisualMeta=function(r){var n=Xft(this,"outOfRange",this.getExtent()),i=Xft(this,"inRange",this.option.range.slice()),a=[];function s(p,g){a.push({value:p,color:r(p,g)})}for(var o=0,l=0,u=i.length,h=n.length;lr[1])break;a.push({color:this.getControllerVisual(l,"color",n),offset:o/i})}return a.push({color:this.getControllerVisual(r[1],"color",n),offset:1}),a},e.prototype._createBarPoints=function(r,n){var i=this.visualMapModel.itemSize;return[[i[0]-n[0],r[0]],[i[0],r[0]],[i[0],r[1]],[i[0]-n[1],r[1]]]},e.prototype._createBarGroup=function(r){var n=this._orient,i=this.visualMapModel.get("inverse");return new pr(n==="horizontal"&&!i?{scaleX:r==="bottom"?1:-1,rotation:Math.PI/2}:n==="horizontal"&&i?{scaleX:r==="bottom"?-1:1,rotation:-Math.PI/2}:n==="vertical"&&!i?{scaleX:r==="left"?1:-1,scaleY:-1}:{scaleX:r==="left"?1:-1})},e.prototype._updateHandle=function(r,n){if(this._useHandle){var i=this._shapes,a=this.visualMapModel,s=i.handleThumbs,o=i.handleLabels,l=a.itemSize,u=a.getExtent(),h=this._applyTransform("left",i.mainGroup);yQr([0,1],function(d){var f=s[d];f.setStyle("fill",n.handlesColor[d]),f.y=r[d];var p=Wm(r[d],[0,l[1]],u,!0),g=this.getControllerVisual(p,"symbolSize");f.scaleX=f.scaleY=g/l[0],f.x=l[0]-g/2;var m=Wp(i.handleLabelPoints[d],iT(f,this.group));if(this._orient==="horizontal"){var v=h==="left"||h==="top"?(l[0]-g)/2:(l[0]-g)/-2;m[1]+=v}o[d].setStyle({x:m[0],y:m[1],text:a.formatValueText(this._dataInterval[d]),verticalAlign:"middle",align:this._orient==="vertical"?this._applyTransform("left",i.mainGroup):"center"})},this)}},e.prototype._showIndicator=function(r,n,i,a){var s=this.visualMapModel,o=s.getExtent(),l=s.itemSize,u=[0,l[1]],h=this._shapes,d=h.indicator;if(d){d.attr("invisible",!1);var f={convertOpacityToAlpha:!0},p=this.getControllerVisual(r,"color",f),g=this.getControllerVisual(r,"symbolSize"),m=Wm(r,o,u,!0),v=l[0]-g/2,y={x:d.x,y:d.y};d.y=m,d.x=v;var b=Wp(h.indicatorLabelPoint,iT(d,this.group)),x=h.indicatorLabel;x.attr("invisible",!1);var w=this._applyTransform("left",h.mainGroup),A=this._orient,T=A==="horizontal";x.setStyle({text:(i||"")+s.formatValueText(n),verticalAlign:T?w:"middle",align:T?"center":w});var S={x:v,y:m,style:{fill:p}},O={style:{x:b[0],y:b[1]}};if(s.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var k={duration:100,easing:"cubicInOut",additive:!0};d.x=y.x,d.y=y.y,d.animateTo(S,k),x.animateTo(O,k)}else d.attr(S),x.attr(O);this._firstShowIndicator=!1;var E=this._shapes.handleLabels;if(E)for(var _=0;_s[1]&&(d[1]=1/0),n&&(d[0]===-1/0?this._showIndicator(h,d[1],"< ",l):d[1]===1/0?this._showIndicator(h,d[0],"> ",l):this._showIndicator(h,h,"≈ ",l));var f=this._hoverLinkDataIndices,p=[];(n||rpt(i))&&(p=this._hoverLinkDataIndices=i.findTargetDataIndices(d));var g=TEr(f,p);this._dispatchHighDown("downplay",mq(g[0],i)),this._dispatchHighDown("highlight",mq(g[1],i))}},e.prototype._hoverLinkFromSeriesMouseOver=function(r){var n;if(bT(r.target,function(l){var u=Cr(l);if(u.dataIndex!=null)return n=u,!0},!0),!!n){var i=this.ecModel.getSeriesByIndex(n.seriesIndex),a=this.visualMapModel;if(a.isTargetSeries(i)){var s=i.getData(n.dataType),o=s.getStore().get(a.getDataDimensionIndex(s),n.dataIndex);isNaN(o)||this._showIndicator(o,o)}}},e.prototype._hideIndicator=function(){var r=this._shapes;r.indicator&&r.indicator.attr("invisible",!0),r.indicatorLabel&&r.indicatorLabel.attr("invisible",!0);var n=this._shapes.handleLabels;if(n)for(var i=0;i=0&&(a.dimension=s,n.push(a))}}),t.getData().setVisual("visualMeta",n)}}];function OQr(t,e,r,n){for(var i=e.targetVisuals[n],a=Xo.prepareVisualTypes(i),s={color:u8(t.getData(),"color")},o=0,l=a.length;o0:e.splitNumber>0)||e.calculable)?"continuous":"piecewise"}),t.registerAction(TQr,SQr),de(CQr,function(e){t.registerVisual(t.PRIORITY.VISUAL.COMPONENT,e)}),t.registerPreprocessor(kQr))}function opt(t){t.registerComponentModel(vQr),t.registerComponentView(wQr),spt(t)}var EQr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r._pieceList=[],r}return e.prototype.optionUpdated=function(r,n){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var i=this._mode=this._determineMode();this._pieceList=[],_Qr[this._mode].call(this,this._pieceList),this._resetSelected(r,n);var a=this.option.categories;this.resetVisual(function(s,o){i==="categories"?(s.mappingMethod="category",s.categories=lr(a)):(s.dataExtent=this.getExtent(),s.mappingMethod="piecewise",s.pieceList=vt(this._pieceList,function(l){return l=lr(l),o!=="inRange"&&(l.visual=null),l}))})},e.prototype.completeVisualOption=function(){var r=this.option,n={},i=Xo.listVisualTypes(),a=this.isCategory();de(r.pieces,function(o){de(i,function(l){o.hasOwnProperty(l)&&(n[l]=1)})}),de(n,function(o,l){var u=!1;de(this.stateList,function(h){u=u||s(r,h,l)||s(r.target,h,l)},this),!u&&de(this.stateList,function(h){(r[h]||(r[h]={}))[l]=Yft.get(l,h==="inRange"?"active":"inactive",a)})},this);function s(o,l,u){return o&&o[l]&&o[l].hasOwnProperty(u)}t.prototype.completeVisualOption.apply(this,arguments)},e.prototype._resetSelected=function(r,n){var i=this.option,a=this._pieceList,s=(n?i:r).selected||{};if(i.selected=s,de(a,function(l,u){var h=this.getSelectedMapKey(l);s.hasOwnProperty(h)||(s[h]=!0)},this),i.selectedMode==="single"){var o=!1;de(a,function(l,u){var h=this.getSelectedMapKey(l);s[h]&&(o?s[h]=!1:o=!0)},this)}},e.prototype.getItemSymbol=function(){return this.get("itemSymbol")},e.prototype.getSelectedMapKey=function(r){return this._mode==="categories"?r.value+"":r.index+""},e.prototype.getPieceList=function(){return this._pieceList},e.prototype._determineMode=function(){var r=this.option;return r.pieces&&r.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},e.prototype.setSelected=function(r){this.option.selected=lr(r)},e.prototype.getValueState=function(r){var n=Xo.findPieceIndex(r,this._pieceList);return n!=null&&this.option.selected[this.getSelectedMapKey(this._pieceList[n])]?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(r){var n=[],i=this._pieceList;return this.eachTargetSeries(function(a){var s=[],o=a.getData();o.each(this.getDataDimensionIndex(o),function(l,u){var h=Xo.findPieceIndex(l,i);h===r&&s.push(u)},this),n.push({seriesId:a.id,dataIndex:s})},this),n},e.prototype.getRepresentValue=function(r){var n;if(this.isCategory())n=r.value;else if(r.value!=null)n=r.value;else{var i=r.interval||[];n=i[0]===-1/0&&i[1]===1/0?0:(i[0]+i[1])/2}return n},e.prototype.getVisualMeta=function(r){if(this.isCategory())return;var n=[],i=["",""],a=this;function s(h,d){var f=a.getRepresentValue({interval:h});d||(d=a.getValueState(f));var p=r(f,d);h[0]===-1/0?i[0]=p:h[1]===1/0?i[1]=p:n.push({value:h[0],color:p},{value:h[1],color:p})}var o=this._pieceList.slice();if(!o.length)o.push({interval:[-1/0,1/0]});else{var l=o[0].interval[0];l!==-1/0&&o.unshift({interval:[-1/0,l]}),l=o[o.length-1].interval[1],l!==1/0&&o.push({interval:[l,1/0]})}var u=-1/0;return de(o,function(h){var d=h.interval;d&&(d[0]>u&&s([u,d[0]],"outOfRange"),s(d.slice()),u=d[1])},this),{stops:n,outerColors:i}},e.type="visualMap.piecewise",e.defaultOption=xx(gq.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),e}(gq),_Qr={splitNumber:function(t){var e=this.option,r=Math.min(e.precision,20),n=this.getExtent(),i=e.splitNumber;i=Math.max(parseInt(i,10),1),e.splitNumber=i;for(var a=(n[1]-n[0])/i;+a.toFixed(r)!==a&&r<5;)r++;e.precision=r,a=+a.toFixed(r),e.minOpen&&t.push({interval:[-1/0,n[0]],close:[0,0]});for(var s=0,o=n[0];s","≥"][n[0]]];r.text=r.text||this.formatValueText(r.value!=null?r.value:r.interval,!1,i)},this)}};function lpt(t,e){var r=t.inverse;(t.orient==="vertical"?!r:r)&&e.reverse()}var RQr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.doRender=function(){var r=this.group;r.removeAll();var n=this.visualMapModel,i=n.get("textGap"),a=n.textStyleModel,s=this._getItemAlign(),o=n.itemSize,l=this._getViewData(),u=l.endsText,h=Pc(n.get("showLabel",!0),!u),d=!n.get("selectedMode");u&&this._renderEndsText(r,u[0],o,h,s),de(l.viewPieceList,function(f){var p=f.piece,g=new pr;g.onclick=Ht(this._onItemClick,this,p),this._enableHoverLink(g,f.indexInModelPieceList);var m=n.getRepresentValue(p);if(this._createItemSymbol(g,m,[0,0,o[0],o[1]],d),h){var v=this.visualMapModel.getValueState(m),y=a.get("align")||s;g.add(new Pn({style:Gi(a,{x:y==="right"?-i:o[0]+i,y:o[1]/2,text:p.text,verticalAlign:a.get("verticalAlign")||"middle",align:y,opacity:Jt(a.get("opacity"),v==="outOfRange"?.5:1)}),silent:d}))}r.add(g)},this),u&&this._renderEndsText(r,u[1],o,h,s),hT(n.get("orient"),r,n.get("itemGap")),this.renderBackground(r),this.positionGroup(r)},e.prototype._enableHoverLink=function(r,n){var i=this;r.on("mouseover",function(){return a("highlight")}).on("mouseout",function(){return a("downplay")});var a=function(s){var o=i.visualMapModel;o.option.hoverLink&&i.api.dispatchAction({type:s,batch:mq(o.findTargetDataIndices(n),o)})}},e.prototype._getItemAlign=function(){var r=this.visualMapModel,n=r.option;if(n.orient==="vertical")return Jft(r,this.api,r.itemSize);var i=n.align;return(!i||i==="auto")&&(i="left"),i},e.prototype._renderEndsText=function(r,n,i,a,s){if(n){var o=new pr,l=this.visualMapModel.textStyleModel;o.add(new Pn({style:Gi(l,{x:a?s==="right"?i[0]:0:i[0]/2,y:i[1]/2,verticalAlign:"middle",align:a?s:"center",text:n})})),r.add(o)}},e.prototype._getViewData=function(){var r=this.visualMapModel,n=vt(r.getPieceList(),function(o,l){return{piece:o,indexInModelPieceList:l}}),i=r.get("text"),a=r.get("orient"),s=r.get("inverse");return(a==="horizontal"?s:!s)?n.reverse():i&&(i=i.slice().reverse()),{viewPieceList:n,endsText:i}},e.prototype._createItemSymbol=function(r,n,i,a){var s=$s(this.getControllerVisual(n,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(n,"color"));s.silent=a,r.add(s)},e.prototype._onItemClick=function(r){var n=this.visualMapModel,i=n.option,a=i.selectedMode;if(a){var s=lr(i.selected),o=n.getSelectedMapKey(r);a==="single"||a===!0?(s[o]=!0,de(s,function(l,u){s[u]=u===o})):s[o]=!s[o],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:s})}},e.type="visualMap.piecewise",e}(Kft);function cpt(t){t.registerComponentModel(EQr),t.registerComponentView(RQr),spt(t)}function DQr(t){Yr(opt),Yr(cpt)}var LQr=function(){function t(e){this._thumbnailModel=e}return t.prototype.reset=function(e){this._renderVersion=e.getECUpdateCycleVersion()},t.prototype.renderContent=function(e){var r=e.api.getViewOfComponentModel(this._thumbnailModel);r&&(e.group.silent=!0,r.renderContent({group:e.group,targetTrans:e.targetTrans,z2Range:qtt(e.group),roamType:e.roamType,viewportRect:e.viewportRect,renderVersion:this._renderVersion}))},t.prototype.updateWindow=function(e,r){var n=r.getViewOfComponentModel(this._thumbnailModel);n&&n.updateWindow({targetTrans:e,renderVersion:this._renderVersion})},t}(),MQr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.preventAutoZ=!0,r}return e.prototype.optionUpdated=function(r,n){this._updateBridge()},e.prototype._updateBridge=function(){var r=this._birdge=this._birdge||new LQr(this);if(this._target=null,this.ecModel.eachSeries(function(i){fut(i,null)}),this.shouldShow()){var n=this.getTarget();fut(n.baseMapProvider,r)}},e.prototype.shouldShow=function(){return this.getShallow("show",!0)},e.prototype.getBridge=function(){return this._birdge},e.prototype.getTarget=function(){if(this._target)return this._target;var r=this.getReferringComponents("series",{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];return r?r.subType!=="graph"&&(r=null):r=this.ecModel.queryComponents({mainType:"series",subType:"graph"})[0],this._target={baseMapProvider:r},this._target},e.type="thumbnail",e.layoutMode="box",e.dependencies=["series","geo"],e.defaultOption={show:!0,right:1,bottom:1,height:"25%",width:"25%",itemStyle:{borderColor:et.color.border,borderWidth:2},windowStyle:{borderWidth:1,color:et.color.neutral30,borderColor:et.color.neutral40,opacity:.3},z:10},e}(fn),IQr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){if(this._api=i,this._model=r,this._coordSys||(this._coordSys=new hY),!this._isEnabled()){this._clear();return}this._renderVersion=i.getECUpdateCycleVersion();var a=this.group;a.removeAll();var s=r.getModel("itemStyle"),o=s.getItemStyle();o.fill==null&&(o.fill=n.get("backgroundColor")||et.color.neutral00);var l=Co(r,i).refContainer,u=da(Ort(r,!0),l),h=o.lineWidth||0,d=this._contentRect=aT(u.clone(),h/2,!0,!0),f=new pr;a.add(f),f.setClipPath(new tn({shape:d.plain()}));var p=this._targetGroup=new pr;f.add(p);var g=u.plain();g.r=s.getShallow("borderRadius",!0),a.add(this._bgRect=new tn({style:o,shape:g,silent:!1,cursor:"grab"}));var m=r.getModel("windowStyle"),v=m.getShallow("borderRadius",!0);f.add(this._windowRect=new tn({shape:{x:0,y:0,width:0,height:0,r:v},style:m.getItemStyle(),silent:!1,cursor:"grab"})),this._dealRenderContent(),this._dealUpdateWindow(),hpt(r,this)},e.prototype.renderContent=function(r){this._bridgeRendered=r,this._isEnabled()&&(this._dealRenderContent(),this._dealUpdateWindow(),hpt(this._model,this))},e.prototype._dealRenderContent=function(){var r=this._bridgeRendered;if(!(!r||r.renderVersion!==this._renderVersion)){var n=this._targetGroup,i=this._coordSys,a=this._contentRect;if(n.removeAll(),!!r){var s=r.group,o=s.getBoundingRect();n.add(s),this._bgRect.z2=r.z2Range.min-10,gY(i,o.x,o.y,o.width,o.height);var l=da({left:"center",top:"center",aspect:o.width/o.height},a);mY(i,l.x,l.y,l.width,l.height),K8(s,i,HT),s.dirty(),this._windowRect.z2=r.z2Range.max+10,this._resetRoamController(r.roamType)}}},e.prototype.updateWindow=function(r){var n=this._bridgeRendered;n&&n.renderVersion===r.renderVersion&&(n.targetTrans=r.targetTrans),this._isEnabled()&&this._dealUpdateWindow()},e.prototype._dealUpdateWindow=function(){var r=this._bridgeRendered;if(!(!r||r.renderVersion!==this._renderVersion)){var n=Cd([],r.targetTrans),i=Sd([],fY(null,this._coordSys),n);this._transThisToTarget=Cd([],i);var a=r.viewportRect;a?a=a.clone():a=new fr(0,0,this._api.getWidth(),this._api.getHeight()),a.applyTransform(i);var s=this._windowRect,o=s.shape.r;s.setShape(mr({r:o},a))}},e.prototype._resetRoamController=function(r){var n=this,i=this._api,a=this._roamController;if(a||(a=this._roamController=new VT(i.getZr())),!r||!this._isEnabled()){a.disable();return}a.enable(r,{api:i,zInfo:{component:this._model},triggerInfo:{roamTrigger:null,isInSelf:function(s,o,l){return n._contentRect.contain(o,l)}}}),a.off("pan").off("zoom").on("pan",Ht(this._onPan,this)).on("zoom",Ht(this._onZoom,this))},e.prototype._onPan=function(r){var n=this._transThisToTarget;if(!(!this._isEnabled()||!n)){var i=Ka([],[r.oldX,r.oldY],n),a=Ka([],[r.oldX-r.dx,r.oldY-r.dy],n);this._api.dispatchAction(upt(this._model.getTarget().baseMapProvider,{dx:a[0]-i[0],dy:a[1]-i[1]}))}},e.prototype._onZoom=function(r){var n=this._transThisToTarget;if(!(!this._isEnabled()||!n)){var i=Ka([],[r.originX,r.originY],n);this._api.dispatchAction(upt(this._model.getTarget().baseMapProvider,{zoom:1/r.scale,originX:i[0],originY:i[1]}))}},e.prototype._isEnabled=function(){var r=this._model;if(!r||!r.shouldShow())return!1;var n=r.getTarget().baseMapProvider;return!!n},e.prototype._clear=function(){this.group.removeAll(),this._bridgeRendered=null,this._roamController&&this._roamController.disable()},e.prototype.remove=function(){this._clear()},e.prototype.dispose=function(){this._clear()},e.type="thumbnail",e}(Hi);function upt(t,e){var r=t.mainType==="series"?t.subType+"Roam":t.mainType+"Roam",n={type:r};return n[t.mainType+"Id"]=t.id,ot(n,e),n}function hpt(t,e){var r=sT(t);_H(e.group,r.z,r.zlevel)}function PQr(t){t.registerComponentModel(MQr),t.registerComponentView(IQr)}var NQr={label:{enabled:!0},decal:{show:!1}},dpt=Qr(),fpt=Qr(),BQr=LN($Qr);function $Qr(t,e){var r=t.getModel("aria");if(!r.get("enabled"))return;var n=fpt(t).scope||(fpt(t).scope={}),i=lr(NQr);Vr(i.label,t.getLocaleModel().get("aria"),!1),Vr(r.option,i,!1),a(),s();function a(){var h=r.getModel("decal"),d=h.get("show");if(d){var f=Yt();t.eachSeries(function(p){p.isColorBySeries()||(dpt(p).scope=f.get(p.type)||f.set(p.type,{}))}),t.eachSeries(function(p){if(ur(p.enableAriaDecal)){p.enableAriaDecal();return}var g=p.getData();if(p.isColorBySeries()){var x=Qfe(p.ecModel,p.name,n,t.getSeriesCount()),w=g.getVisual("decal");g.setVisual("decal",A(w,x))}else{var m=p.getRawData(),v={},y=dpt(p).scope;g.each(function(T){var S=g.getRawIndex(T);v[S]=T});var b=m.count();m.each(function(T){var S=v[T],O=m.getName(T)||T+"",k=Qfe(p.ecModel,O,y,b),E=g.getItemVisual(S,"decal");g.setItemVisual(S,"decal",A(E,k))})}function A(T,S){var O=T?ot(ot({},S),T):S;return O.dirty=!0,O}})}}function s(){var h=e.getZr().dom;if(h){var d=t.getLocaleModel().get("aria"),f=r.getModel("label");if(f.option=mr(f.option,d),!!f.get("enabled")){if(h.setAttribute("role","img"),f.get("description")){h.setAttribute("aria-label",f.get("description"));return}var p=t.getSeriesCount(),g=f.get(["data","maxCount"])||10,m=f.get(["series","maxCount"])||10,v=Math.min(p,m),y;if(!(p<1)){var b=l();if(b){var x=f.get(["general","withTitle"]);y=o(x,{title:b})}else y=f.get(["general","withoutTitle"]);var w=[],A=p>1?f.get(["series","multiple","prefix"]):f.get(["series","single","prefix"]);y+=o(A,{seriesCount:p}),t.eachSeries(function(k,E){if(E1?f.get(["series","multiple",L]):f.get(["series","single",L]),_=o(_,{seriesId:k.seriesIndex,seriesName:k.get("name"),seriesType:u(k.subType)});var R=k.getData();if(R.count()>g){var D=f.get(["data","partialData"]);_+=o(D,{displayCnt:g})}else _+=f.get(["data","allData"]);for(var M=f.get(["data","separator","middle"]),P=f.get(["data","separator","end"]),N=f.get(["data","excludeDimensionId"]),F=[],B=0;B":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},UQr=function(){function t(e){var r=this._condVal=Nt(e)?new RegExp(e):QZe(e)?e:null;if(r==null){var n="";ii(n)}}return t.prototype.evaluate=function(e){var r=typeof e;return Nt(r)?this._condVal.test(e):zn(r)?this._condVal.test(e+""):!1},t}(),VQr=function(){function t(){}return t.prototype.evaluate=function(){return this.value},t}(),QQr=function(){function t(){}return t.prototype.evaluate=function(){for(var e=this.children,r=0;r2&&n.push(i),i=[L,R]}function h(L,R,D,M){x5(L,D)&&x5(R,M)||i.push(L,R,D,M,D,M)}function d(L,R,D,M,P,N){var F=Math.abs(R-L),B=Math.tan(F/4)*4/3,V=RO:_2&&n.push(i),n}function Uve(t,e,r,n,i,a,s,o,l,u){if(x5(t,r)&&x5(e,n)&&x5(i,s)&&x5(a,o)){l.push(s,o);return}var h=2/u,d=h*h,f=s-t,p=o-e,g=Math.sqrt(f*f+p*p);f/=g,p/=g;var m=r-t,v=n-e,y=i-s,b=a-o,x=m*m+v*v,w=y*y+b*b;if(x=0&&O=0){l.push(s,o);return}var k=[],E=[];ox(t,r,i,s,.5,k),ox(e,n,a,o,.5,E),Uve(k[0],E[0],k[1],E[1],k[2],E[2],k[3],E[3],l,u),Uve(k[4],E[4],k[5],E[5],k[6],E[6],k[7],E[7],l,u)}function nGr(t,e){var r=zve(t),n=[];e=e||1;for(var i=0;i0)for(var u=0;uMath.abs(u),d=vpt([l,u],h?0:1,e),f=(h?o:u)/d.length,p=0;pi,s=vpt([n,i],a?0:1,e),o=a?"width":"height",l=a?"height":"width",u=a?"x":"y",h=a?"y":"x",d=t[o]/s.length,f=0;f1?null:new wr(m*l+t,m*u+e)}function sGr(t,e,r){var n=new wr;wr.sub(n,r,e),n.normalize();var i=new wr;wr.sub(i,t,e);var a=i.dot(n);return a}function w5(t,e){var r=t[t.length-1];r&&r[0]===e[0]&&r[1]===e[1]||t.push(e)}function oGr(t,e,r){for(var n=t.length,i=[],a=0;as?(u.x=h.x=o+a/2,u.y=l,h.y=l+s):(u.y=h.y=l+s/2,u.x=o,h.x=o+a),oGr(e,u,h)}function vq(t,e,r,n){if(r===1)n.push(e);else{var i=Math.floor(r/2),a=t(e);vq(t,a[0],i,n),vq(t,a[1],r-i,n)}return n}function lGr(t,e){for(var r=[],n=0;n0;u/=2){var h=0,d=0;(t&u)>0&&(h=1),(e&u)>0&&(d=1),o+=u*u*(3*h^d),d===0&&(h===1&&(t=u-1-t,e=u-1-e),l=t,t=e,e=l)}return o}function xq(t){var e=1/0,r=1/0,n=-1/0,i=-1/0,a=vt(t,function(o){var l=o.getBoundingRect(),u=o.getComputedTransform(),h=l.x+l.width/2+(u?u[4]:0),d=l.y+l.height/2+(u?u[5]:0);return e=Math.min(h,e),r=Math.min(d,r),n=Math.max(h,n),i=Math.max(d,i),[h,d]}),s=vt(a,function(o,l){return{cp:o,z:vGr(o[0],o[1],e,r,n,i),path:t[l]}});return s.sort(function(o,l){return o.z-l.z}).map(function(o){return o.path})}function Opt(t){return hGr(t.path,t.count)}function Qve(){return{fromIndividuals:[],toIndividuals:[],count:0}}function yGr(t,e,r){var n=[];function i(A){for(var T=0;T=0;i--)if(!r[i].many.length){var l=r[o].many;if(l.length<=1)if(o)o=0;else return r;var a=l.length,u=Math.ceil(a/2);r[i].many=l.slice(u,a),r[o].many=l.slice(0,u),o++}return r}var xGr={clone:function(t){for(var e=[],r=1-Math.pow(1-t.path.style.opacity,1/t.count),n=0;n0))return;var o=n.getModel("universalTransition").get("delay"),l=ot({setToFinal:!0},s),u,h;kpt(t)&&(u=t,h=e),kpt(e)&&(u=e,h=t);function d(y,b,x,w,A){var T=y.many,S=y.one;if(T.length===1&&!A){var O=b?T[0]:S,k=b?S:T[0];if(yq(O))d({many:[O],one:k},!0,x,w,!0);else{var E=o?mr({delay:o(x,w)},l):l;Vve(O,k,E),a(O,k,O,k,E)}}else for(var _=mr({dividePath:xGr[r],individualDelay:o&&function(P,N,F,B){return o(P+x,w)}},l),I=b?yGr(T,S,_):bGr(S,T,_),L=I.fromIndividuals,R=I.toIndividuals,D=L.length,M=0;Me.length,p=u?Ept(h,u):Ept(f?e:t,[f?t:e]),g=0,m=0;m_pt))for(var a=n.getIndices(),s=0;s0&&T.group.traverse(function(O){O instanceof vn&&!O.animators.length&&O.animateFrom({style:{opacity:0}},S)})})}function Ppt(t){var e=t.getModel("universalTransition").get("seriesKey");return e||t.id}function Npt(t){return ft(t)?t.sort().join(","):t}function Vx(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function kGr(t,e){var r=Yt(),n=Yt(),i=Yt();return de(t.oldSeries,function(a,s){var o=t.oldDataGroupIds[s],l=t.oldData[s],u=Ppt(a),h=Npt(u);n.set(h,{dataGroupId:o,data:l}),ft(u)&&de(u,function(d){i.set(d,{key:h,dataGroupId:o,data:l})})}),de(e.updatedSeries,function(a){if(a.isUniversalTransitionEnabled()&&a.isAnimationEnabled()){var s=a.get("dataGroupId"),o=a.getData(),l=Ppt(a),u=Npt(l),h=n.get(u);if(h)r.set(u,{oldSeries:[{dataGroupId:h.dataGroupId,divide:Vx(h.data),data:h.data}],newSeries:[{dataGroupId:s,divide:Vx(o),data:o}]});else if(ft(l)){var d=[];de(l,function(g){var m=n.get(g);m.data&&d.push({dataGroupId:m.dataGroupId,divide:Vx(m.data),data:m.data})}),d.length&&r.set(u,{oldSeries:d,newSeries:[{dataGroupId:s,data:o,divide:Vx(o)}]})}else{var f=i.get(l);if(f){var p=r.get(f.key);p||(p={oldSeries:[{dataGroupId:f.dataGroupId,data:f.data,divide:Vx(f.data)}],newSeries:[]},r.set(f.key,p)),p.newSeries.push({dataGroupId:s,data:o,divide:Vx(o)})}}}}),r}function Bpt(t,e){for(var r=0;r=0&&i.push({dataGroupId:e.oldDataGroupIds[o],data:e.oldData[o],divide:Vx(e.oldData[o]),groupIdDim:s.dimension})}),de(Qi(t.to),function(s){var o=Bpt(r.updatedSeries,s);if(o>=0){var l=r.updatedSeries[o].getData();a.push({dataGroupId:e.oldDataGroupIds[o],data:l,divide:Vx(l),groupIdDim:s.dimension})}}),i.length>0&&a.length>0&&Ipt(i,a,n)}function _Gr(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){de(Qi(n.seriesTransition),function(i){de(Qi(i.to),function(a){for(var s=n.updatedSeries,o=0;oo.vmin?n+=o.vmin-i+(e-o.vmin)/(o.vmax-o.vmin)*o.gapReal:n+=e-i,i=o.vmax,a=!1;break}n+=o.vmin-i+o.gapReal,i=o.vmax}return a&&(n+=e-i),n},transformOut:function(e,r){if(r&&r.depth===gy)return e;for(var n=$pt,i=Fpt,a=!0,s=0,o=0;ou?s=l.vmin+(e-u)/(h-u)*(l.vmax-l.vmin):s=i+e-n,i=l.vmax,a=!1;break}n=h,i=l.vmax}return a&&(s=i+e-n),s}},t}();function DGr(t,e){return new RGr(t,e)}var $pt=0,Fpt=0;function LGr(t,e){var r=0,n={tpAbs:{span:0,val:0},tpPrct:{span:0,val:0}},i=function(){return{has:!1,span:NaN,inExtFrac:NaN,val:NaN}},a={S:{tpAbs:i(),tpPrct:i()},E:{tpAbs:i(),tpPrct:i()}};de(t.breaks,function(o){var l=o.gapParsed;l.type==="tpPrct"&&(r+=l.val);var u=Yve(o,e);if(u){var h=u.vmin!==o.vmin,d=u.vmax!==o.vmax,f=u.vmax-u.vmin;if(!(h&&d))if(h||d){var p=h?"S":"E";a[p][l.type].has=!0,a[p][l.type].span=f,a[p][l.type].inExtFrac=f/(o.vmax-o.vmin),a[p][l.type].val=l.val}else n[l.type].span+=f,n[l.type].val+=l.val}});var s=r*(0+(e[1]-e[0])+(n.tpAbs.val-n.tpAbs.span)+(a.S.tpAbs.has?(a.S.tpAbs.val-a.S.tpAbs.span)*a.S.tpAbs.inExtFrac:0)+(a.E.tpAbs.has?(a.E.tpAbs.val-a.E.tpAbs.span)*a.E.tpAbs.inExtFrac:0)-n.tpPrct.span-(a.S.tpPrct.has?a.S.tpPrct.span*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.span*a.E.tpPrct.inExtFrac:0))/(1-n.tpPrct.val-(a.S.tpPrct.has?a.S.tpPrct.val*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.val*a.E.tpPrct.inExtFrac:0));de(t.breaks,function(o){var l=o.gapParsed;l.type==="tpPrct"&&(o.gapReal=r!==0?en(s,0)*l.val/r:0),l.type==="tpAbs"&&(o.gapReal=l.val),o.gapReal==null&&(o.gapReal=0)})}function MGr(t,e,r,n,i,a){t!=="no"&&de(r,function(s){var o=Yve(s,a);if(o)for(var l=e.length-1;l>=0;l--){var u=e[l],h=n(u),d=i*3/4;h>o.vmin-d&&he[0]&&r=0&&s<1-1e-5}de(t,function(s){if(!(!s||s.start==null||s.end==null)&&!s.isExpanded){var o={breakOption:lr(s),vmin:e.parse(s.start),vmax:e.parse(s.end),gapParsed:{type:"tpAbs",val:0},gapReal:null};if(s.gap!=null){var l=!1;if(Nt(s.gap)){var u=Td(s.gap);if(u.match(/%$/)){var h=parseFloat(u)/100;i(h)||(h=0),o.gapParsed.type="tpPrct",o.gapParsed.val=h,l=!0}}if(!l){var d=e.parse(s.gap);(!isFinite(d)||d<0)&&(d=0),o.gapParsed.type="tpAbs",o.gapParsed.val=d}}if(o.vmin===o.vmax&&(o.gapParsed.type="tpAbs",o.gapParsed.val=0),r&&r.noNegative&&de(["vmin","vmax"],function(p){o[p]<0&&(o[p]=0)}),o.vmin>o.vmax){var f=o.vmax;o.vmax=o.vmin,o.vmin=f}n.push(o)}}),n.sort(function(s,o){return s.vmin-o.vmin});var a=-1/0;return de(n,function(s,o){a>s.vmin&&(n[o]=null),a=s.vmax}),{breaks:ni(n,function(s){return!!s})}}function jve(t,e){return Xve(e)===Xve(t)}function Xve(t){return t.start+"_\0_"+t.end}function PGr(t,e,r){var n=[];de(t,function(a,s){var o=e(a);o&&o.type==="vmin"&&n.push([s])}),de(t,function(a,s){var o=e(a);if(o&&o.type==="vmax"){var l=Wv(n,function(u){return jve(e(t[u[0]]).parsedBreak.breakOption,o.parsedBreak.breakOption)});l&&l.push(s)}});var i=[];return de(n,function(a){a.length===2&&i.push(r?a:[t[a[0]],t[a[1]]])}),i}function NGr(t,e,r,n){if(e.break){var i=e.break.parsedBreak,a=Wv(r,function(h){return jve(h.breakOption,e.break.parsedBreak.breakOption)}),s={lookup:n,depth:gy},o=t.transformOut(i.vmin,s),l=t.transformOut(i.vmax,s),u={vmin:o,vmax:l,breakOption:i.breakOption,gapParsed:lr(a.gapParsed),gapReal:i.gapReal};return{tickVal:u[e.break.type],vBreak:{type:e.break.type,parsedBreak:u}}}}function BGr(t,e,r,n,i){i.original=qve(t,e,r);var a=i.transformed=qve(t,e,r),s=i.lookup;a.breaks=vt(a.breaks,function(o,l){var u={depth:gy},h=e.transformIn(o.vmin,u),d=e.transformIn(o.vmax,u),f={type:o.gapParsed.type,val:o.gapParsed.type==="tpAbs"?e.transformIn(o.vmin+o.gapParsed.val,u)-h:o.gapParsed.val};return s.from[n+l]=h,s.to[n+l]=o.vmin,s.from[n+l+1]=d,s.to[n+l+1]=o.vmax,{vmin:h,vmax:d,gapParsed:f,gapReal:o.gapReal,breakOption:o.breakOption}})}var $Gr={vmin:"start",vmax:"end"};function FGr(t,e){return e&&(t=t||{},t.break={type:$Gr[e.type],start:e.parsedBreak.vmin,end:e.parsedBreak.vmax}),t}function zGr(){F5r({createBreakScaleMapper:DGr,pruneTicksByBreak:MGr,addBreaksToTicks:IGr,parseAxisBreakOption:qve,identifyAxisBreak:jve,serializeAxisBreakIdentifier:Xve,retrieveAxisBreakPairs:PGr,getTicksBreakOutwardTransform:NGr,parseAxisBreakOptionInwardTransform:BGr,makeAxisLabelFormatterParamBreak:FGr})}var zpt=Qr();function UGr(t,e){var r=Wv(t,function(n){return Ns().identifyAxisBreak(n.parsedBreak.breakOption,e.breakOption)});return r||t.push(r={zigzagRandomList:[],parsedBreak:e,shouldRemove:!1}),r}function VGr(t){de(t,function(e){return e.shouldRemove=!0})}function QGr(t){for(var e=t.length-1;e>=0;e--)t[e].shouldRemove&&t.splice(e,1)}function GGr(t,e,r,n,i){var a=r.axis;if(a.scale.isBlank()||!Ns())return;var s=Ns().retrieveAxisBreakPairs(a.scale.getTicks({breakTicks:"only_break"}),function(k){return k.break},!1);if(!s.length)return;var o=r.getModel("breakArea"),l=o.get("zigzagAmplitude"),u=o.get("zigzagMinSpan"),h=o.get("zigzagMaxSpan");u=Math.max(2,u||0),h=Math.max(u,h||0);var d=o.get("expandOnClick"),f=o.get("zigzagZ"),p=o.getModel("itemStyle"),g=p.getItemStyle(),m=g.stroke,v=g.lineWidth,y=g.lineDash,b=g.fill,x=new pr({ignoreModelZ:!0}),w=a.isHorizontal(),A=zpt(e).visualList||(zpt(e).visualList=[]);VGr(A);for(var T=function(k){var E=s[k][0].break.parsedBreak,_=[];_[0]=a.toGlobalCoord(a.dataToCoord(E.vmin,!0)),_[1]=a.toGlobalCoord(a.dataToCoord(E.vmax,!0)),_[1]<_[0]&&_.reverse();var I=UGr(A,E);I.shouldRemove=!1;var L=new pr;O(I.zigzagRandomList,L,_[0],_[1],w,E),d&&L.on("click",function(){var R={type:WW,breaks:[{start:E.breakOption.start,end:E.breakOption.end}]};R[a.dim+"AxisIndex"]=r.componentIndex,i.dispatchAction(R)}),L.silent=!d,x.add(L)},S=0;S=N;X&&(U=N);var Y=[],le=[];Y[M]=_,le[M]=I,!G&&!X&&(Y[M]+=z?-l:l,le[M]-=z?l:-l),Y[P]=U,le[P]=U,B.push(Y),V.push(le);var q=void 0;if(Qb[1]&&b.reverse(),{coordPair:b,brkId:Ns().serializeAxisBreakIdentifier(y.breakOption)}});l.sort(function(v,y){return v.coordPair[0]-y.coordPair[0]});for(var u=s[0],h=null,d=0;d=0?l[0].width:l[1].width),f=(d+h.x)/2-u.x,p=Math.min(f,f-h.x),g=Math.max(f,f-h.x),m=g<0?g:p>0?p:0;o=(f-m)/h.x}var v=new wr,y=new wr;wr.scale(v,n,-o),wr.scale(y,n,1-o),sge(r[0],v),sge(r[1],y)}function YGr(t,e){var r={breaks:[]};return de(e.breaks,function(n){if(n){var i=Wv(t.get("breaks",!0),function(o){return Ns().identifyAxisBreak(o,n)});if(i){var a=e.type,s={isExpanded:!!i.isExpanded};i.isExpanded=a===WW?!0:a===dot?!1:a===fot?!i.isExpanded:i.isExpanded,r.breaks.push({start:i.start,end:i.end,isExpanded:!!i.isExpanded,old:s})}}}),r}function qGr(){uIr({adjustBreakLabelPair:WGr,buildAxisBreakLine:HGr,rectCoordBuildBreakAxis:GGr,updateModelAxisBreak:YGr})}function jGr(t){pIr(t),zGr(),qGr()}function XGr(){RPr(KGr)}function KGr(t,e){de(t,function(r){if(!r.model.get(["axisLabel","inside"])){var n=ZGr(r);if(n){var i=r.isHorizontal()?"height":"width",a=r.model.get(["axisLabel","margin"]);e[i]-=n[i]+a,r.position==="top"?e.y+=n.height+a:r.position==="left"&&(e.x+=n.width+a)}}})}function ZGr(t){var e=t.model,r=t.scale;if(!e.get(["axisLabel","show"])||r.isBlank())return;var n,i,a=r.getExtent();r instanceof x8?i=r.count():(n=r.getTicks(),i=n.length);var s=t.getLabelModel(),o=A8(t),l,u=1;i>40&&(u=Math.ceil(i/40));for(var h=0;hUpt(t,"name",{value:e,configurable:!0}),wq=(t,e)=>{for(var r in e)Upt(t,r,{get:e[r],enumerable:!0})},Vpt={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(xi,function(){var r=1e3,n=6e4,i=36e5,a="millisecond",s="second",o="minute",l="hour",u="day",h="week",d="month",f="quarter",p="year",g="date",m="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(R){var D=["th","st","nd","rd"],M=R%100;return"["+R+(D[(M-20)%10]||D[M]||D[0])+"]"}},x=function(R,D,M){var P=String(R);return!P||P.length>=D?R:""+Array(D+1-P.length).join(M)+R},w={s:x,z:function(R){var D=-R.utcOffset(),M=Math.abs(D),P=Math.floor(M/60),N=M%60;return(D<=0?"+":"-")+x(P,2,"0")+":"+x(N,2,"0")},m:function R(D,M){if(D.date()1)return R(B[0])}else{var V=D.name;T[V]=D,N=V}return!P&&N&&(A=N),N||!P&&A},E=function(R,D){if(O(R))return R.clone();var M=typeof D=="object"?D:{};return M.date=R,M.args=arguments,new I(M)},_=w;_.l=k,_.i=O,_.w=function(R,D){return E(R,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var I=function(){function R(M){this.$L=k(M.locale,null,!0),this.parse(M),this.$x=this.$x||M.x||{},this[S]=!0}var D=R.prototype;return D.parse=function(M){this.$d=function(P){var N=P.date,F=P.utc;if(N===null)return new Date(NaN);if(_.u(N))return new Date;if(N instanceof Date)return new Date(N);if(typeof N=="string"&&!/Z$/i.test(N)){var B=N.match(v);if(B){var V=B[2]-1||0,z=(B[7]||"0").substring(0,3);return F?new Date(Date.UTC(B[1],V,B[3]||1,B[4]||0,B[5]||0,B[6]||0,z)):new Date(B[1],V,B[3]||1,B[4]||0,B[5]||0,B[6]||0,z)}}return new Date(N)}(M),this.init()},D.init=function(){var M=this.$d;this.$y=M.getFullYear(),this.$M=M.getMonth(),this.$D=M.getDate(),this.$W=M.getDay(),this.$H=M.getHours(),this.$m=M.getMinutes(),this.$s=M.getSeconds(),this.$ms=M.getMilliseconds()},D.$utils=function(){return _},D.isValid=function(){return this.$d.toString()!==m},D.isSame=function(M,P){var N=E(M);return this.startOf(P)<=N&&N<=this.endOf(P)},D.isAfter=function(M,P){return E(M){},"trace"),debug:C((...t)=>{},"debug"),info:C((...t)=>{},"info"),warn:C((...t)=>{},"warn"),error:C((...t)=>{},"error"),fatal:C((...t)=>{},"fatal")},Kve=C(function(t="fatal"){let e=Cy.fatal;typeof t=="string"?t.toLowerCase()in Cy&&(e=Cy[t]):typeof t=="number"&&(e=t),me.trace=()=>{},me.debug=()=>{},me.info=()=>{},me.warn=()=>{},me.error=()=>{},me.fatal=()=>{},e<=Cy.fatal&&(me.fatal=console.error?console.error.bind(console,Zf("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Zf("FATAL"))),e<=Cy.error&&(me.error=console.error?console.error.bind(console,Zf("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Zf("ERROR"))),e<=Cy.warn&&(me.warn=console.warn?console.warn.bind(console,Zf("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Zf("WARN"))),e<=Cy.info&&(me.info=console.info?console.info.bind(console,Zf("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Zf("INFO"))),e<=Cy.debug&&(me.debug=console.debug?console.debug.bind(console,Zf("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Zf("DEBUG"))),e<=Cy.trace&&(me.trace=console.debug?console.debug.bind(console,Zf("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Zf("TRACE")))},"setLogLevel"),Zf=C(t=>`%c${Cl().format("ss.SSS")} : ${t} : `,"format");const Aq={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t),hsl2rgb:({h:t,s:e,l:r},n)=>{if(!e)return r*2.55;t/=360,e/=100,r/=100;const i=r<.5?r*(1+e):r+e-r*e,a=2*r-i;switch(n){case"r":return Aq.hue2rgb(a,i,t+1/3)*255;case"g":return Aq.hue2rgb(a,i,t)*255;case"b":return Aq.hue2rgb(a,i,t-1/3)*255}},rgb2hsl:({r:t,g:e,b:r},n)=>{t/=255,e/=255,r/=255;const i=Math.max(t,e,r),a=Math.min(t,e,r),s=(i+a)/2;if(n==="l")return s*100;if(i===a)return 0;const o=i-a,l=s>.5?o/(2-i-a):o/(i+a);if(n==="s")return l*100;switch(i){case t:return((e-r)/o+(ee>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t)),round:t=>Math.round(t*1e10)/1e10},unit:{dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}}},Qx={};for(let t=0;t<=255;t++)Qx[t]=Sn.unit.dec2hex(t);const Qc={ALL:0,RGB:1,HSL:2};let tHr=class{constructor(){this.type=Qc.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=Qc.ALL}is(e){return this.type===e}};class rHr{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new tHr}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=Qc.ALL,this}_ensureHSL(){const e=this.data,{h:r,s:n,l:i}=e;r===void 0&&(e.h=Sn.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=Sn.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=Sn.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r,g:n,b:i}=e;r===void 0&&(e.r=Sn.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=Sn.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=Sn.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,r=e.r;return!this.type.is(Qc.HSL)&&r!==void 0?r:(this._ensureHSL(),Sn.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,r=e.g;return!this.type.is(Qc.HSL)&&r!==void 0?r:(this._ensureHSL(),Sn.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,r=e.b;return!this.type.is(Qc.HSL)&&r!==void 0?r:(this._ensureHSL(),Sn.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,r=e.h;return!this.type.is(Qc.RGB)&&r!==void 0?r:(this._ensureRGB(),Sn.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,r=e.s;return!this.type.is(Qc.RGB)&&r!==void 0?r:(this._ensureRGB(),Sn.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,r=e.l;return!this.type.is(Qc.RGB)&&r!==void 0?r:(this._ensureRGB(),Sn.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(Qc.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(Qc.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(Qc.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(Qc.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(Qc.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(Qc.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const Tq=new rHr({r:0,g:0,b:0,a:0},"transparent"),T5={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(T5.re);if(!e)return;const r=e[1],n=parseInt(r,16),i=r.length,a=i%4===0,s=i>4,o=s?1:17,l=s?8:4,u=a?0:-1,h=s?255:15;return Tq.set({r:(n>>l*(u+3)&h)*o,g:(n>>l*(u+2)&h)*o,b:(n>>l*(u+1)&h)*o,a:a?(n&h)*o/255:1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`#${Qx[Math.round(e)]}${Qx[Math.round(r)]}${Qx[Math.round(n)]}${Qx[Math.round(i*255)]}`:`#${Qx[Math.round(e)]}${Qx[Math.round(r)]}${Qx[Math.round(n)]}`}},sS={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(sS.hueRe);if(e){const[,r,n]=e;switch(n){case"grad":return Sn.channel.clamp.h(parseFloat(r)*.9);case"rad":return Sn.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return Sn.channel.clamp.h(parseFloat(r)*360)}}return Sn.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const r=t.match(sS.re);if(!r)return;const[,n,i,a,s,o]=r;return Tq.set({h:sS._hue2deg(n),s:Sn.channel.clamp.s(parseFloat(i)),l:Sn.channel.clamp.l(parseFloat(a)),a:s?Sn.channel.clamp.a(o?parseFloat(s)/100:parseFloat(s)):1},t)},stringify:t=>{const{h:e,s:r,l:n,a:i}=t;return i<1?`hsla(${Sn.lang.round(e)}, ${Sn.lang.round(r)}%, ${Sn.lang.round(n)}%, ${i})`:`hsl(${Sn.lang.round(e)}, ${Sn.lang.round(r)}%, ${Sn.lang.round(n)}%)`}},CB={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();const e=CB.colors[t];if(e)return T5.parse(e)},stringify:t=>{const e=T5.stringify(t);for(const r in CB.colors)if(CB.colors[r]===e)return r}},OB={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:t=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const r=t.match(OB.re);if(!r)return;const[,n,i,a,s,o,l,u,h]=r;return Tq.set({r:Sn.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:Sn.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:Sn.channel.clamp.b(l?parseFloat(o)*2.55:parseFloat(o)),a:u?Sn.channel.clamp.a(h?parseFloat(u)/100:parseFloat(u)):1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`rgba(${Sn.lang.round(e)}, ${Sn.lang.round(r)}, ${Sn.lang.round(n)}, ${Sn.lang.round(i)})`:`rgb(${Sn.lang.round(e)}, ${Sn.lang.round(r)}, ${Sn.lang.round(n)})`}},eg={format:{keyword:CB,hex:T5,rgb:OB,rgba:OB,hsl:sS,hsla:sS},parse:t=>{if(typeof t!="string")return t;const e=T5.parse(t)||OB.parse(t)||sS.parse(t)||CB.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(Qc.HSL)||t.data.r===void 0?sS.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?OB.stringify(t):T5.stringify(t)},Qpt=(t,e)=>{const r=eg.parse(t);for(const n in e)r[n]=Sn.channel.clamp[n](e[n]);return eg.stringify(r)},tg=(t,e,r=0,n=1)=>{if(typeof t!="number")return Qpt(t,{a:e});const i=Tq.set({r:Sn.channel.clamp.r(t),g:Sn.channel.clamp.g(e),b:Sn.channel.clamp.b(r),a:Sn.channel.clamp.a(n)});return eg.stringify(i)},Zve=(t,e)=>Sn.lang.round(eg.parse(t)[e]),nHr=t=>{const{r:e,g:r,b:n}=eg.parse(t),i=.2126*Sn.channel.toLinear(e)+.7152*Sn.channel.toLinear(r)+.0722*Sn.channel.toLinear(n);return Sn.lang.round(i)},iHr=t=>nHr(t)>=.5,Eu=t=>!iHr(t),Jve=(t,e,r)=>{const n=eg.parse(t),i=n[e],a=Sn.channel.clamp[e](i+r);return i!==a&&(n[e]=a),eg.stringify(n)},ht=(t,e)=>Jve(t,"l",e),dt=(t,e)=>Jve(t,"l",-e),Gpt=(t,e)=>Jve(t,"a",-e),xe=(t,e)=>{const r=eg.parse(t),n={};for(const i in e)e[i]&&(n[i]=r[i]+e[i]);return Qpt(t,n)},aHr=(t,e,r=50)=>{const{r:n,g:i,b:a,a:s}=eg.parse(t),{r:o,g:l,b:u,a:h}=eg.parse(e),d=r/100,f=d*2-1,p=s-h,m=((f*p===-1?f:(f+p)/(1+f*p))+1)/2,v=1-m,y=n*m+o*v,b=i*m+l*v,x=a*m+u*v,w=s*d+h*(1-d);return tg(y,b,x,w)},nt=(t,e=100)=>{const r=eg.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,aHr(r,t,e)};/*! @license DOMPurify 3.4.14 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.14/LICENSE */function Hpt(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r2?n-2:0),a=2;a1?r-1:0),i=1;i"u"?null:ko(BigInt.prototype.toString),Jpt=typeof Symbol>"u"?null:ko(Symbol.prototype.toString),Dh=ko(Object.prototype.hasOwnProperty),RB=ko(Object.prototype.toString),Gc=ko(RegExp.prototype.test),lS=bHr(TypeError);function ko(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:EB;if(Ypt&&Ypt(t,null),!C5(e))return t;let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const a=r(i);a!==i&&(hHr(e)||(e[n]=a),i=a)}t[i]=!0}return t}function xHr(t){for(let e=0;e/g),kHr=Ol(/\${[\w\W]*/g),EHr=Ol(/^data-[\-\w.\u00B7-\uFFFF]+$/),_Hr=Ol(/^aria-[\-\w]+$/),igt=Ol(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),RHr=Ol(/^(?:\w+script|data):/i),DHr=Ol(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),LHr=Ol(/^html$/i),MHr=Ol(/^[a-z][.\w]*(-[.\w]+)+$/i),agt=Ol(/<[/\w!]/g),sgt=Ol(/<[/\w]/g),IHr=Ol(/<\/no(script|embed|frames)/i),PHr=Ol(/\/>/i),Pd={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ogt=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],NHr=Ko(Di({},ogt)),BHr=function(){const t={};return oS(ogt,e=>{t[e]=Ol(new RegExp("])","i"))}),Ko(t)}(),$Hr=function(){return typeof window>"u"?null:window},FHr=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const a="dompurify"+(n?"#"+n:"");try{return e.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},lgt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Gx=function(e,r,n,i){return Dh(e,r)&&C5(e[r])?Di(i.base?Id(i.base):{},e[r],i.transform):n},oye=function(e,r,n){const i=Dh(e,r)?e[r]:void 0;return i&&typeof i=="object"?Id(i):n()};function cgt(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$Hr();const e=Gt=>cgt(Gt);if(e.version="3.4.14",e.removed=[],!t||!t.document||t.document.nodeType!==Pd.document||!t.Element)return e.isSupported=!1,e;let r=t.document;const n=r,i=n.currentScript;t.DocumentFragment;const a=t.HTMLTemplateElement,s=t.Node,o=t.Element,l=t.NodeFilter,u=t.NamedNodeMap;u===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,d=t.trustedTypes,f=o.prototype,p=rg(f,"cloneNode"),g=rg(f,"remove"),m=rg(f,"nextSibling"),v=rg(f,"childNodes"),y=rg(f,"parentNode"),b=rg(f,"shadowRoot"),x=rg(f,"attributes"),w=s&&s.prototype?rg(s.prototype,"nodeType"):null,A=s&&s.prototype?rg(s.prototype,"nodeName"):null,T=s&&s.prototype?rg(s.prototype,"ownerDocument"):null,S=function(ze){return w?w(ze):ze.nodeType},O=function(ze){return A?A(ze):ze.nodeName};if(typeof a=="function"){const Gt=r.createElement("template");Gt.content&&Gt.content.ownerDocument&&(r=Gt.content.ownerDocument)}let k,E="",_,I=!1,L=0;const R=function(){if(L>0)throw lS('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},D=function(ze){R(),L++;try{return k.createHTML(ze)}finally{L--}},M=function(ze){R(),L++;try{return k.createScriptURL(ze)}finally{L--}},P=function(){return I||(_=FHr(d,i),I=!0),_},N=r,F=N.implementation,B=N.createNodeIterator,V=N.createDocumentFragment,z=N.getElementsByTagName,U=n.importNode;let Q=lgt();e.isSupported=typeof Wpt=="function"&&typeof y=="function"&&F&&F.createHTMLDocument!==void 0;const G=CHr,X=OHr,Y=kHr,le=EHr,q=_Hr,Z=RHr,ee=DHr,re=MHr;let ve=igt,ae=null;const Ce=Di({},[...egt,...nye,...iye,...aye,...tgt]);let Oe=null;const $e=Di({},[...rgt,...sye,...ngt,...Sq]);let he=Object.seal(S5(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),fe=null,Te=null;const ge=Object.seal(S5(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Qe=!0,Se=!0,De=!1,qe=!0,K=!1,ce=!0,be=!1,ne=!1,j=null,ie=null,pe=!1,te=!1,ye=!1,oe=!1,_e=!0,Le=!1;const Ye="user-content-";let Pe=!0,Xe=!1,Ne={},Ze=null;const Ge=Di({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let lt=null;const Fe=Di({},["audio","video","img","source","image","track"]);let wt=null;const Me=Di({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Rt="http://www.w3.org/1998/Math/MathML",Lt="http://www.w3.org/2000/svg",ut="http://www.w3.org/1999/xhtml";let Xt=ut,Ft=!1,gt=null;const Ae=Di({},[Rt,Lt,ut],rye),zt=Ko(["mi","mo","mn","ms","mtext"]);let kt=Di({},zt);const At=Ko(["annotation-xml"]);let Mt=Di({},At);const jr=Di({},["title","style","font","a","script"]);let Re=null;const at=["application/xhtml+xml","text/html"],xt="text/html";let Ct=null,gr=null;const Xr=r.createElement("form"),$r=function(ze){return ze instanceof RegExp||ze instanceof Function},un=function(){let ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(gr&&gr===ze)return;(!ze||typeof ze!="object")&&(ze={}),ze=Id(ze),Re=at.indexOf(ze.PARSER_MEDIA_TYPE)===-1?xt:ze.PARSER_MEDIA_TYPE,Ct=Re==="application/xhtml+xml"?rye:EB,ae=Gx(ze,"ALLOWED_TAGS",Ce,{transform:Ct}),Oe=Gx(ze,"ALLOWED_ATTR",$e,{transform:Ct}),gt=Gx(ze,"ALLOWED_NAMESPACES",Ae,{transform:rye}),wt=Gx(ze,"ADD_URI_SAFE_ATTR",Me,{transform:Ct,base:Me}),lt=Gx(ze,"ADD_DATA_URI_TAGS",Fe,{transform:Ct,base:Fe}),Ze=Gx(ze,"FORBID_CONTENTS",Ge,{transform:Ct}),fe=Gx(ze,"FORBID_TAGS",Id({}),{transform:Ct}),Te=Gx(ze,"FORBID_ATTR",Id({}),{transform:Ct}),Ne=Dh(ze,"USE_PROFILES")?ze.USE_PROFILES&&typeof ze.USE_PROFILES=="object"?Id(ze.USE_PROFILES):ze.USE_PROFILES:!1,Qe=ze.ALLOW_ARIA_ATTR!==!1,Se=ze.ALLOW_DATA_ATTR!==!1,De=ze.ALLOW_UNKNOWN_PROTOCOLS||!1,qe=ze.ALLOW_SELF_CLOSE_IN_ATTR!==!1,K=ze.SAFE_FOR_TEMPLATES||!1,ce=ze.SAFE_FOR_XML!==!1,be=ze.WHOLE_DOCUMENT||!1,te=ze.RETURN_DOM||!1,ye=ze.RETURN_DOM_FRAGMENT||!1,oe=ze.RETURN_TRUSTED_TYPE||!1,pe=ze.FORCE_BODY||!1,_e=ze.SANITIZE_DOM!==!1,Le=ze.SANITIZE_NAMED_PROPS||!1,Pe=ze.KEEP_CONTENT!==!1,Xe=ze.IN_PLACE||!1,ve=AHr(ze.ALLOWED_URI_REGEXP)?ze.ALLOWED_URI_REGEXP:igt,Xt=typeof ze.NAMESPACE=="string"?ze.NAMESPACE:ut,kt=oye(ze,"MATHML_TEXT_INTEGRATION_POINTS",()=>Di({},zt)),Mt=oye(ze,"HTML_INTEGRATION_POINTS",()=>Di({},At));const it=oye(ze,"CUSTOM_ELEMENT_HANDLING",()=>S5(null));if(he=S5(null),Dh(it,"tagNameCheck")&&$r(it.tagNameCheck)&&(he.tagNameCheck=it.tagNameCheck),Dh(it,"attributeNameCheck")&&$r(it.attributeNameCheck)&&(he.attributeNameCheck=it.attributeNameCheck),Dh(it,"allowCustomizedBuiltInElements")&&typeof it.allowCustomizedBuiltInElements=="boolean"&&(he.allowCustomizedBuiltInElements=it.allowCustomizedBuiltInElements),Ol(he),K&&(Se=!1),ye&&(te=!0),Ne&&(ae=Di({},tgt),Oe=S5(null),Ne.html===!0&&(Di(ae,egt),Di(Oe,rgt)),Ne.svg===!0&&(Di(ae,nye),Di(Oe,sye),Di(Oe,Sq)),Ne.svgFilters===!0&&(Di(ae,iye),Di(Oe,sye),Di(Oe,Sq)),Ne.mathMl===!0&&(Di(ae,aye),Di(Oe,ngt),Di(Oe,Sq))),ge.tagCheck=null,ge.attributeCheck=null,Dh(ze,"ADD_TAGS")&&(typeof ze.ADD_TAGS=="function"?ge.tagCheck=ze.ADD_TAGS:C5(ze.ADD_TAGS)&&(ae===Ce&&(ae=Id(ae)),Di(ae,ze.ADD_TAGS,Ct))),Dh(ze,"ADD_ATTR")&&(typeof ze.ADD_ATTR=="function"?ge.attributeCheck=ze.ADD_ATTR:C5(ze.ADD_ATTR)&&(Oe===$e&&(Oe=Id(Oe)),Di(Oe,ze.ADD_ATTR,Ct))),Dh(ze,"ADD_FORBID_CONTENTS")&&C5(ze.ADD_FORBID_CONTENTS)&&(Ze===Ge&&(Ze=Id(Ze)),Di(Ze,ze.ADD_FORBID_CONTENTS,Ct)),Pe&&(ae["#text"]=!0),be&&Di(ae,["html","head","body"]),ae.table&&(Di(ae,["tbody"]),delete fe.tbody),ze.TRUSTED_TYPES_POLICY){if(typeof ze.TRUSTED_TYPES_POLICY.createHTML!="function")throw lS('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ze.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw lS('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Pt=k;k=ze.TRUSTED_TYPES_POLICY;try{E=D("")}catch(ar){throw k=Pt,ar}}else ze.TRUSTED_TYPES_POLICY===null?(k=void 0,E=""):(k===void 0&&(k=P()),k&&typeof E=="string"&&(E=D("")));Ko&&Ko(ze),gr=ze},zr=Di({},[...nye,...iye,...THr]),On=Di({},[...aye,...SHr]),Nr=function(ze,it,Pt){return it.namespaceURI===ut?ze==="svg":it.namespaceURI===Rt?ze==="svg"&&(Pt==="annotation-xml"||kt[Pt]):!!zr[ze]},hn=function(ze,it,Pt){return it.namespaceURI===ut?ze==="math":it.namespaceURI===Lt?ze==="math"&&Mt[Pt]:!!On[ze]},ti=function(ze,it,Pt){return it.namespaceURI===Lt&&!Mt[Pt]||it.namespaceURI===Rt&&!kt[Pt]?!1:!On[ze]&&(jr[ze]||!zr[ze])},pt=function(ze){let it=y(ze);(!it||!it.tagName)&&(it={namespaceURI:Xt,tagName:"template"});const Pt=EB(ze.tagName),ar=EB(it.tagName);return gt[ze.namespaceURI]?ze.namespaceURI===Lt?Nr(Pt,it,ar):ze.namespaceURI===Rt?hn(Pt,it,ar):ze.namespaceURI===ut?ti(Pt,it,ar):!!(Re==="application/xhtml+xml"&>[ze.namespaceURI]):!1},Tt=function(ze){kB(e.removed,{element:ze});try{y(ze).removeChild(ze)}catch{if(g(ze),!y(ze))throw lS("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},sr=function(ze,it,Pt){try{ze.removeAttributeNode(it)}catch{try{ze.removeAttribute(Pt)}catch{}}},Kr=function(ze){St(ze);const it=v(ze);if(it){const ar=[];oS(it,Ur=>{kB(ar,Ur)}),oS(ar,Ur=>{try{g(Ur)}catch{}})}const Pt=x(ze);if(Pt)for(let ar=Pt.length-1;ar>=0;--ar){const Ur=Pt[ar],_n=Ur&&Ur.name;typeof _n=="string"&&sr(ze,Ur,_n)}},Ln=function(ze,it,Pt){if(!Pt)try{Pt=it.getAttributeNode(ze)}catch{Pt=null}kB(e.removed,{attribute:Pt||null,from:it});try{Pt?it.removeAttributeNode(Pt):it.removeAttribute(ze)}catch{try{it.removeAttribute(ze)}catch{}}if(ze==="is")if(te||ye)try{Tt(it)}catch{}else try{it.setAttribute(ze,"")}catch{}},Et=function(ze){const it=x(ze);if(it)for(let Pt=it.length-1;Pt>=0;--Pt){const ar=it[Pt],Ur=ar&&ar.name;typeof Ur!="string"||Oe[Ct(Ur)]||sr(ze,ar,Ur)}},St=function(ze){const it=[ze];for(;it.length>0;){const Pt=it.pop();S(Pt)===Pd.element&&Et(Pt);const Ur=v(Pt);if(Ur)for(let _n=Ur.length-1;_n>=0;--_n)it.push(Ur[_n])}},Vt=function(ze,it){return ce?ze==="patchsrc"?!0:ze==="for"&&it!=="label"&&it!=="output":!1},mt=function(ze){if(!ce)return;const it=[ze];for(;it.length>0;){const Pt=it.pop(),ar=S(Pt);if(ar===Pd.processingInstruction||ar===Pd.comment&&Gc(sgt,Pt.data)){try{g(Pt)}catch{}continue}if(ar===Pd.element){const _n=Pt,Ua=Ct(O(Pt));try{_n.hasAttribute&&_n.hasAttribute("patchsrc")&&_n.removeAttribute("patchsrc"),_n.hasAttribute&&_n.hasAttribute("for")&&Vt("for",Ua)&&_n.removeAttribute("for")}catch{}}const Ur=v(Pt);if(Ur)for(let _n=Ur.length-1;_n>=0;--_n)it.push(Ur[_n])}},Sr=function(ze){let it=null,Pt=null;if(pe)ze=""+ze;else{const _n=Xpt(ze,/^[\r\n\t ]+/);Pt=_n&&_n[0]}Re==="application/xhtml+xml"&&Xt===ut&&(ze=''+ze+"");const ar=k?D(ze):ze;if(Xt===ut)try{it=new h().parseFromString(ar,Re)}catch{}if(!it||!it.documentElement){it=F.createDocument(Xt,"template",null);try{it.documentElement.innerHTML=Ft?E:ar}catch{}}const Ur=it.body||it.documentElement;return ze&&Pt&&Ur.insertBefore(r.createTextNode(Pt),Ur.childNodes[0]||null),Xt===ut?z.call(it,be?"html":"body")[0]:be?it.documentElement:Ur},Ie=function(ze){const it=T?T(ze):ze.ownerDocument;return B.call(it||ze,ze,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Xi=function(ze){return ze=_B(ze,G," "),ze=_B(ze,X," "),ze=_B(ze,Y," "),ze},Ue=function(ze){var it;ze.normalize();const Pt=T?T(ze):ze.ownerDocument,ar=B.call(Pt||ze,ze,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let Ur=ar.nextNode();for(;Ur;)Ur.data=Xi(Ur.data),Ur=ar.nextNode();const _n=(it=ze.querySelectorAll)===null||it===void 0?void 0:it.call(ze,"template");_n&&oS(_n,Ua=>{li(Ua.content)&&Ue(Ua.content)})},Mn=function(ze){const it=A?A(ze):null;return typeof it!="string"||Ct(it)!=="form"?!1:typeof ze.nodeName!="string"||typeof ze.textContent!="string"||typeof ze.removeChild!="function"||ze.attributes!==x(ze)||typeof ze.removeAttribute!="function"||typeof ze.setAttribute!="function"||typeof ze.namespaceURI!="string"||typeof ze.insertBefore!="function"||typeof ze.hasChildNodes!="function"||ze.nodeType!==w(ze)||ze.childNodes!==v(ze)},li=function(ze){if(!w||typeof ze!="object"||ze===null)return!1;try{return w(ze)===Pd.documentFragment}catch{return!1}},Es=function(ze){if(!w||typeof ze!="object"||ze===null)return!1;try{return typeof w(ze)=="number"}catch{return!1}};function Vn(Gt,ze,it){Gt.length!==0&&oS(Gt,Pt=>{Pt.call(e,ze,it,gr)})}const oa=function(ze,it){return!!(ce&&ze.hasChildNodes()&&!Es(ze.firstElementChild)&&Gc(agt,ze.textContent)&&Gc(agt,ze.innerHTML)||ce&&ze.namespaceURI===ut&&NHr[it]&&(Es(ze.firstElementChild)||typeof ze.textContent=="string"&&Gc(BHr[it],ze.textContent))||ze.nodeType===Pd.processingInstruction||ce&&ze.nodeType===Pd.comment&&Gc(sgt,ze.data))},ci=function(ze,it){if(ze instanceof RegExp)return Gc(ze,it);if(ze instanceof Function){for(var Pt=arguments.length,ar=new Array(Pt>2?Pt-2:0),Ur=2;Ur=0;--Ua){const _s=ze===Pt?p(Ur[Ua],!0):Ur[Ua];ar.insertBefore(_s,m(ze))}}}return Tt(ze),!0},zg=function(ze,it,Pt,ar){return ze.length===0?it:it===Pt||it===ar?Id(it):it},lv=function(ze,it){return ze===it||y(ze)!==null?!1:(Xe&&St(ze),!0)},ek=function(ze,it){if(Vn(Q.beforeSanitizeElements,ze,null),lv(ze,it))return!0;if(Mn(ze))return Tt(ze),!0;const Pt=Ct(O(ze));if(ae=zg(Q.uponSanitizeElement,ae,Ce,j),Vn(Q.uponSanitizeElement,ze,{tagName:Pt,allowedTags:ae}),lv(ze,it))return!0;if(oa(ze,Pt))return Tt(ze),!0;if(fe[Pt]||!(ge.tagCheck instanceof Function&&ge.tagCheck(Pt))&&!ae[Pt]){const Ur=lu(ze,Pt,it);return Ur===!1&&Vn(Q.afterSanitizeElements,ze,null),Ur}if(S(ze)===Pd.element&&!pt(ze)||(Pt==="noscript"||Pt==="noembed"||Pt==="noframes")&&Gc(IHr,ze.innerHTML))return Tt(ze),!0;if(K&&ze.nodeType===Pd.text){const Ur=Xi(ze.textContent);ze.textContent!==Ur&&(kB(e.removed,{element:ze.cloneNode()}),ze.textContent=Ur)}return Vn(Q.afterSanitizeElements,ze,null),!1},tk=function(ze,it,Pt){if(Te[it]||Vt(it,ze)||_e&&(it==="id"||it==="name")&&(Pt in r||Pt in Xr))return!1;const ar=Oe[it]||ge.attributeCheck instanceof Function&&ge.attributeCheck(it,ze);return Se&&Gc(le,it)||Qe&&Gc(q,it)?!0:ar?wt[it]||Gc(ve,_B(Pt,ee,""))||(it==="src"||it==="xlink:href"||it==="href")&&ze!=="script"&&Kpt(Pt,"data:")===0&<[ze]||De&&!Gc(Z,_B(Pt,ee,""))?!0:!Pt:ul(ze)&&ci(he.tagNameCheck,ze)&&ci(he.attributeNameCheck,it,ze)||it==="is"&&he.allowCustomizedBuiltInElements&&ci(he.tagNameCheck,Pt)},rk=Di({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ul=function(ze){return!rk[EB(ze)]&&Gc(re,ze)},nd=function(ze,it,Pt,ar){if(k&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!Pt)switch(d.getAttributeType(ze,it)){case"TrustedHTML":return D(ar);case"TrustedScriptURL":return M(ar)}return ar},Ec=function(ze,it,Pt,ar){try{Pt?ze.setAttributeNS(Pt,it,ar):ze.setAttribute(it,ar),Mn(ze)?Tt(ze):jpt(e.removed)}catch{Ln(it,ze)}},Vo=function(ze){Vn(Q.beforeSanitizeAttributes,ze,null);const it=ze.attributes;if(!it||Mn(ze))return;Oe=zg(Q.uponSanitizeAttribute,Oe,$e,ie);const Pt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Oe,forceKeepAttr:void 0};let ar=it.length;const Ur=Ct(ze.nodeName);for(;ar--;){const _n=it[ar],Ua=_n.name,_s=_n.namespaceURI,id=_n.value,ad=Ct(Ua),TLe=id;let ch=Ua==="value"?TLe:mHr(TLe);if(Pt.attrName=ad,Pt.attrValue=ch,Pt.keepAttr=!0,Pt.forceKeepAttr=void 0,Vn(Q.uponSanitizeAttribute,ze,Pt),ch=Pt.attrValue,Le&&(ad==="id"||ad==="name")&&Kpt(ch,Ye)!==0&&(Ln(Ua,ze,_n),ch=Ye+ch),ce&&Gc(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,ch)){Ln(Ua,ze,_n);continue}if(ad==="attributename"&&Xpt(ch,"href")){Ln(Ua,ze,_n);continue}if(!Pt.forceKeepAttr){if(!Pt.keepAttr){Ln(Ua,ze,_n);continue}if(!qe&&Gc(PHr,ch)){Ln(Ua,ze,_n);continue}if(K&&(ch=Xi(ch)),!tk(Ur,ad,ch)){Ln(Ua,ze,_n);continue}ch=nd(Ur,ad,_s,ch),ch!==TLe&&Ec(ze,Ua,_s,ch)}}Vn(Q.afterSanitizeAttributes,ze,null)},ff=function(ze){let it=null;const Pt=Ie(ze);for(Vn(Q.beforeSanitizeShadowDOM,ze,null);it=Pt.nextNode();)if(Vn(Q.uponSanitizeShadowNode,it,null),ek(it,ze),Vo(it),li(it.content)&&ff(it.content),S(it)===Pd.element){const ar=b(it);li(ar)&&(Tw(ar),ff(ar))}Vn(Q.afterSanitizeShadowDOM,ze,null)},Tw=function(ze){const it=[{node:ze,shadow:null}];for(;it.length>0;){const Pt=it.pop();if(Pt.shadow){ff(Pt.shadow);continue}const ar=Pt.node,_n=S(ar)===Pd.element,Ua=v(ar);if(Ua)for(let _s=Ua.length-1;_s>=0;--_s)it.push({node:Ua[_s],shadow:null});if(_n){const _s=A?A(ar):null;if(typeof _s=="string"&&Ct(_s)==="template"){const id=ar.content;li(id)&&it.push({node:id,shadow:null})}}if(_n){const _s=b(ar);li(_s)&&it.push({node:null,shadow:_s},{node:_s,shadow:null})}}};return e.sanitize=function(Gt){let ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},it=null,Pt=null,ar=null,Ur=null;if(Ft=!Gt,Ft&&(Gt=""),typeof Gt!="string"&&!Es(Gt)&&(Gt=wHr(Gt),typeof Gt!="string"))throw lS("dirty is not a string, aborting");if(!e.isSupported)return Gt;ne?(ae=j,Oe=ie):un(ze),(Q.uponSanitizeElement.length>0||Q.uponSanitizeAttribute.length>0)&&(ae=Id(ae)),Q.uponSanitizeAttribute.length>0&&(Oe=Id(Oe)),e.removed=[];const _n=Xe&&typeof Gt!="string"&&Es(Gt);if(_n){mt(Gt);const id=O(Gt);if(typeof id=="string"){const ad=Ct(id);if(!ae[ad]||fe[ad])throw Kr(Gt),lS("root node is forbidden and cannot be sanitized in-place")}if(Mn(Gt))throw Kr(Gt),lS("root node is clobbered and cannot be sanitized in-place");try{Tw(Gt)}catch(ad){throw Kr(Gt),ad}}else if(Es(Gt))it=Sr(""),Pt=it.ownerDocument.importNode(Gt,!0),Pt.nodeType===Pd.element&&Pt.nodeName==="BODY"||Pt.nodeName==="HTML"?it=Pt:it.appendChild(Pt),Tw(Pt);else{if(!te&&!K&&!be&&Gt.indexOf("<")===-1)return k&&oe?D(Gt):Gt;if(it=Sr(Gt),!it)return te?null:oe?E:""}it&&pe&&Tt(it.firstChild);const Ua=_n?Gt:it;try{const id=Ie(Ua);for(;ar=id.nextNode();)ek(ar,Ua),Vo(ar),li(ar.content)&&ff(ar.content)}catch(id){throw _n&&(Kr(Gt),oS(e.removed,ad=>{ad.element&&St(ad.element)})),id}if(_n)return oS(e.removed,id=>{id.element&&St(id.element)}),K&&Ue(Gt),Gt;if(te){if(K&&Ue(it),ye)for(Ur=V.call(it.ownerDocument);it.firstChild;)Ur.appendChild(it.firstChild);else Ur=it;return(Oe.shadowroot||Oe.shadowrootmode)&&(Ur=U.call(n,Ur,!0)),Ur}let _s=be?it.outerHTML:it.innerHTML;return be&&ae["!doctype"]&&it.ownerDocument&&it.ownerDocument.doctype&&it.ownerDocument.doctype.name&&Gc(LHr,it.ownerDocument.doctype.name)&&(_s=" -`+_s),K&&(_s=Xi(_s)),k&&oe?D(_s):_s},e.setConfig=function(){let Gt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};un(Gt),ne=!0,j=ae,ie=Oe},e.clearConfig=function(){gr=null,ne=!1,j=null,ie=null,k=_,E=""},e.isValidAttribute=function(Gt,ze,it){gr||un({});const Pt=Ct(Gt),ar=Ct(ze);return tk(Pt,ar,it)},e.addHook=function(Gt,ze){typeof ze=="function"&&Dh(Q,Gt)&&kB(Q[Gt],ze)},e.removeHook=function(Gt,ze){if(Dh(Q,Gt)){if(ze!==void 0){const it=pHr(Q[Gt],ze);return it===-1?void 0:gHr(Q[Gt],it,1)[0]}return jpt(Q[Gt])}},e.removeHooks=function(Gt){Dh(Q,Gt)&&(Q[Gt]=[])},e.removeAllHooks=function(){Q=lgt()},e}var Oy=cgt(),lye=C((t,e,{depth:r=2}={})=>{const n={depth:r};if(Array.isArray(e)&&!Array.isArray(t))return e.forEach(i=>lye(t,i,n)),t;if(Array.isArray(e)&&Array.isArray(t))return e.forEach(i=>{t.includes(i)||t.push(i)}),t;if(t==null||r<=0)return t!=null&&typeof t=="object"&&typeof e=="object"?Object.assign(t,e):e;if(e!=null&&typeof t=="object"&&typeof e=="object"){const i=t;Object.entries(e).forEach(([a,s])=>{if(typeof s=="object"){if(s===null)return;Object.hasOwn(t,a)||Object.defineProperty(t,a,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),i[a]===void 0&&(i[a]=Array.isArray(s)?[]:{}),typeof i[a]=="object"&&(i[a]=lye(i[a],s,{depth:r-1}))}else typeof i[a]!="object"&&(Object.hasOwn(t,a)?i[a]=s:Object.defineProperty(t,a,{value:s,writable:!0,enumerable:!0,configurable:!0}))})}return t},"assignWithDepth"),Eo=lye,qm="#ffffff",jm="#f2f2f2",bn=C((t,e)=>e?xe(t,{s:-40,l:10}):xe(t,{s:-40,l:-10}),"mkBorder"),zHr=(hD=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f,p,g,m,v,y,b,x,w,A,T,S,O,k,E,_,I,L,R,D,M,P,N,F,B,V,z,U,Q,G,X,Y,le,q,Z,ee,re,ve,ae;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||xe(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||xe(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||bn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||bn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||bn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||nt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||nt(this.tertiaryColor),this.lineColor=this.lineColor||nt(this.background),this.arrowheadColor=this.arrowheadColor||nt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?dt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||dt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||nt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||ht(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||dt(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||dt(this.mainBkg,10)):(this.rowOdd=this.rowOdd||ht(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||ht(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||xe(this.primaryColor,{h:30}),this.cScale4=this.cScale4||xe(this.primaryColor,{h:60}),this.cScale5=this.cScale5||xe(this.primaryColor,{h:90}),this.cScale6=this.cScale6||xe(this.primaryColor,{h:120}),this.cScale7=this.cScale7||xe(this.primaryColor,{h:150}),this.cScale8=this.cScale8||xe(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||xe(this.primaryColor,{h:270}),this.cScale10=this.cScale10||xe(this.primaryColor,{h:300}),this.cScale11=this.cScale11||xe(this.primaryColor,{h:330}),this.darkMode)for(let Ce=0;Ce{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(hD,"Theme"),hD),UHr=C(t=>{const e=new zHr;return e.calculate(t),e},"getThemeVariables"),VHr=(dD=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=ht(this.primaryColor,16),this.tertiaryColor=xe(this.primaryColor,{h:-160}),this.primaryBorderColor=nt(this.background),this.secondaryBorderColor=bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=bn(this.tertiaryColor,this.darkMode),this.primaryTextColor=nt(this.primaryColor),this.secondaryTextColor=nt(this.secondaryColor),this.tertiaryTextColor=nt(this.tertiaryColor),this.lineColor=nt(this.background),this.textColor=nt(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=ht(nt("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=tg(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=dt("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=dt(this.sectionBkgColor,10),this.taskBorderColor=tg(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=tg(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||ht(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||dt(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,v,y,b,x,w,A,T,S,O,k,E,_,I,L,R,D,M,P,N,F,B,V,z,U,Q,G,X,Y,le,q,Z,ee,re,ve;this.secondBkg=ht(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=ht(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=ht(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=nt(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=xe(this.primaryColor,{h:64}),this.fillType3=xe(this.secondaryColor,{h:64}),this.fillType4=xe(this.primaryColor,{h:-64}),this.fillType5=xe(this.secondaryColor,{h:-64}),this.fillType6=xe(this.primaryColor,{h:128}),this.fillType7=xe(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||xe(this.primaryColor,{h:30}),this.cScale4=this.cScale4||xe(this.primaryColor,{h:60}),this.cScale5=this.cScale5||xe(this.primaryColor,{h:90}),this.cScale6=this.cScale6||xe(this.primaryColor,{h:120}),this.cScale7=this.cScale7||xe(this.primaryColor,{h:150}),this.cScale8=this.cScale8||xe(this.primaryColor,{h:210}),this.cScale9=this.cScale9||xe(this.primaryColor,{h:270}),this.cScale10=this.cScale10||xe(this.primaryColor,{h:300}),this.cScale11=this.cScale11||xe(this.primaryColor,{h:330});for(let ae=0;ae{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(dD,"Theme"),dD),QHr=C(t=>{const e=new VHr;return e.calculate(t),e},"getThemeVariables"),GHr=(fD=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=xe(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=xe(this.primaryColor,{h:-160}),this.primaryBorderColor=bn(this.primaryColor,this.darkMode),this.secondaryBorderColor=bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=bn(this.tertiaryColor,this.darkMode),this.primaryTextColor=nt(this.primaryColor),this.secondaryTextColor=nt(this.secondaryColor),this.tertiaryTextColor=nt(this.tertiaryColor),this.lineColor=nt(this.background),this.textColor=nt(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=bn(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=tg(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,v,y,b,x,w,A,T,S,O,k,E,_,I,L,R,D,M,P,N,F,B,V,z,U,Q,G,X,Y,le,q,Z,ee,re,ve;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||xe(this.primaryColor,{h:30}),this.cScale4=this.cScale4||xe(this.primaryColor,{h:60}),this.cScale5=this.cScale5||xe(this.primaryColor,{h:90}),this.cScale6=this.cScale6||xe(this.primaryColor,{h:120}),this.cScale7=this.cScale7||xe(this.primaryColor,{h:150}),this.cScale8=this.cScale8||xe(this.primaryColor,{h:210}),this.cScale9=this.cScale9||xe(this.primaryColor,{h:270}),this.cScale10=this.cScale10||xe(this.primaryColor,{h:300}),this.cScale11=this.cScale11||xe(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||dt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||dt(this.tertiaryColor,40);for(let ae=0;ae{this[n]==="calculated"&&(this[n]=void 0)}),typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(fD,"Theme"),fD),ky=C(t=>{const e=new GHr;return e.calculate(t),e},"getThemeVariables"),HHr=(pD=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=ht("#cde498",10),this.primaryBorderColor=bn(this.primaryColor,this.darkMode),this.secondaryBorderColor=bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=bn(this.tertiaryColor,this.darkMode),this.primaryTextColor=nt(this.primaryColor),this.secondaryTextColor=nt(this.secondaryColor),this.tertiaryTextColor=nt(this.primaryColor),this.lineColor=nt(this.background),this.textColor=nt(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,v,y,b,x,w,A,T,S,O,k,E,_,I,L,R,D,M,P,N,F,B,V,z,U,Q,G,X,Y,le,q,Z,ee,re,ve;this.actorBorder=dt(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||xe(this.primaryColor,{h:30}),this.cScale4=this.cScale4||xe(this.primaryColor,{h:60}),this.cScale5=this.cScale5||xe(this.primaryColor,{h:90}),this.cScale6=this.cScale6||xe(this.primaryColor,{h:120}),this.cScale7=this.cScale7||xe(this.primaryColor,{h:150}),this.cScale8=this.cScale8||xe(this.primaryColor,{h:210}),this.cScale9=this.cScale9||xe(this.primaryColor,{h:270}),this.cScale10=this.cScale10||xe(this.primaryColor,{h:300}),this.cScale11=this.cScale11||xe(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||dt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||dt(this.tertiaryColor,40);for(let ae=0;ae{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(pD,"Theme"),pD),WHr=C(t=>{const e=new HHr;return e.calculate(t),e},"getThemeVariables"),YHr=(gD=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=ht(this.contrast,55),this.background="#ffffff",this.tertiaryColor=xe(this.primaryColor,{h:-160}),this.primaryBorderColor=bn(this.primaryColor,this.darkMode),this.secondaryBorderColor=bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=bn(this.tertiaryColor,this.darkMode),this.primaryTextColor=nt(this.primaryColor),this.secondaryTextColor=nt(this.secondaryColor),this.tertiaryTextColor=nt(this.tertiaryColor),this.lineColor=nt(this.background),this.textColor=nt(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||ht(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,v,y,b,x,w,A,T,S,O,k,E,_,I,L,R,D,M,P,N,F,B,V,z,U,Q,G,X,Y,le,q,Z,ee,re,ve;this.secondBkg=ht(this.contrast,55),this.border2=this.contrast,this.actorBorder=ht(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let ae=0;ae{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(gD,"Theme"),gD),qHr=C(t=>{const e=new YHr;return e.calculate(t),e},"getThemeVariables"),jHr=(mD=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=bn(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||xe(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||xe(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||bn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||bn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||bn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||nt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||nt(this.tertiaryColor),this.lineColor=this.lineColor||nt(this.background),this.arrowheadColor=this.arrowheadColor||nt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?dt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||dt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||nt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=xe(e,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||ht(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||e,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||n,this.cScale3=this.cScale3||xe(e,{h:30}),this.cScale4=this.cScale4||xe(e,{h:60}),this.cScale5=this.cScale5||xe(e,{h:90}),this.cScale6=this.cScale6||xe(e,{h:120}),this.cScale7=this.cScale7||xe(e,{h:150}),this.cScale8=this.cScale8||xe(e,{h:210,l:150}),this.cScale9=this.cScale9||xe(e,{h:270}),this.cScale10=this.cScale10||xe(e,{h:300}),this.cScale11=this.cScale11||xe(e,{h:330}),this.darkMode)for(let v=0;v{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(mD,"Theme"),mD),XHr=C(t=>{const e=new jHr;return e.calculate(t),e},"getThemeVariables"),KHr=(vD=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=ht(this.primaryColor,16),this.tertiaryColor=xe(this.primaryColor,{h:-160}),this.primaryBorderColor=nt(this.background),this.secondaryBorderColor=bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=bn(this.tertiaryColor,this.darkMode),this.primaryTextColor=nt(this.primaryColor),this.secondaryTextColor=nt(this.secondaryColor),this.tertiaryTextColor=nt(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=ht(nt("#323D47"),10),this.border1="#ccc",this.border2=tg(255,255,255,.25),this.arrowheadColor=nt(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||xe(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||xe(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||bn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||bn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||bn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||nt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||nt(this.tertiaryColor),this.lineColor=this.lineColor||nt(this.background),this.arrowheadColor=this.arrowheadColor||nt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?dt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||dt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||nt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||ht(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||xe(this.primaryColor,{h:30}),this.cScale4=this.cScale4||xe(this.primaryColor,{h:60}),this.cScale5=this.cScale5||xe(this.primaryColor,{h:90}),this.cScale6=this.cScale6||xe(this.primaryColor,{h:120}),this.cScale7=this.cScale7||xe(this.primaryColor,{h:150}),this.cScale8=this.cScale8||xe(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||xe(this.primaryColor,{h:270}),this.cScale10=this.cScale10||xe(this.primaryColor,{h:300}),this.cScale11=this.cScale11||xe(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(vD,"Theme"),vD),ZHr=C(t=>{const e=new KHr;return e.calculate(t),e},"getThemeVariables"),JHr=(yD=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=bn("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||xe(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||xe(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||bn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||bn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||bn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||nt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||nt(this.tertiaryColor),this.lineColor=this.lineColor||nt(this.background),this.arrowheadColor=this.arrowheadColor||nt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?dt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||dt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||nt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=xe(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||ht(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let v=0;v{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(yD,"Theme"),yD),eWr=C(t=>{const e=new JHr;return e.calculate(t),e},"getThemeVariables"),tWr=(bD=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=ht(this.primaryColor,16),this.tertiaryColor=xe(this.primaryColor,{h:-160}),this.primaryBorderColor=nt(this.background),this.secondaryBorderColor=bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=bn(this.tertiaryColor,this.darkMode),this.primaryTextColor=nt(this.primaryColor),this.secondaryTextColor=nt(this.secondaryColor),this.tertiaryTextColor=nt(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=ht(nt("#323D47"),10),this.border1="#ccc",this.border2=tg(255,255,255,.25),this.arrowheadColor=nt(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||xe(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||xe(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||bn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||bn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||bn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||nt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||nt(this.tertiaryColor),this.lineColor=this.lineColor||nt(this.background),this.arrowheadColor=this.arrowheadColor||nt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?dt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||dt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||nt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||ht(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||xe(this.primaryColor,{h:30}),this.cScale4=this.cScale4||xe(this.primaryColor,{h:60}),this.cScale5=this.cScale5||xe(this.primaryColor,{h:90}),this.cScale6=this.cScale6||xe(this.primaryColor,{h:120}),this.cScale7=this.cScale7||xe(this.primaryColor,{h:150}),this.cScale8=this.cScale8||xe(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||xe(this.primaryColor,{h:270}),this.cScale10=this.cScale10||xe(this.primaryColor,{h:300}),this.cScale11=this.cScale11||xe(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(bD,"Theme"),bD),rWr=C(t=>{const e=new tWr;return e.calculate(t),e},"getThemeVariables"),nWr=(xD=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=bn(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||xe(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||xe(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||bn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||bn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||bn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||nt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||nt(this.tertiaryColor),this.lineColor=this.lineColor||nt(this.background),this.arrowheadColor=this.arrowheadColor||nt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?dt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||dt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||nt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=xe(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||ht(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let v=0;v{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(xD,"Theme"),xD),iWr=C(t=>{const e=new nWr;return e.calculate(t),e},"getThemeVariables"),aWr=(wD=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=ht(this.primaryColor,16),this.tertiaryColor=xe(this.primaryColor,{h:-160}),this.primaryBorderColor=nt(this.background),this.secondaryBorderColor=bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=bn(this.tertiaryColor,this.darkMode),this.primaryTextColor=nt(this.primaryColor),this.secondaryTextColor=nt(this.secondaryColor),this.tertiaryTextColor=nt(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=ht(nt("#323D47"),10),this.border1="#ccc",this.border2=tg(255,255,255,.25),this.arrowheadColor=nt(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||xe(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||xe(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||bn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||bn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||bn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||nt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||nt(this.tertiaryColor),this.lineColor=this.lineColor||nt(this.background),this.arrowheadColor=this.arrowheadColor||nt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?dt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||dt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||nt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||ht(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(wD,"Theme"),wD),sWr=C(t=>{const e=new aWr;return e.calculate(t),e},"getThemeVariables"),Ey={base:{getThemeVariables:UHr},dark:{getThemeVariables:QHr},default:{getThemeVariables:ky},forest:{getThemeVariables:WHr},neutral:{getThemeVariables:qHr},neo:{getThemeVariables:XHr},"neo-dark":{getThemeVariables:ZHr},redux:{getThemeVariables:eWr},"redux-dark":{getThemeVariables:rWr},"redux-color":{getThemeVariables:iWr},"redux-dark-color":{getThemeVariables:sWr}},lc={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},swimlane:{useMaxWidth:!0,lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:"right",highlightSlice:""},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},ugt={...lc,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:Ey.default.getThemeVariables(),sequence:{...lc.sequence,messageFont:C(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:C(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:C(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...lc.gantt,tickInterval:void 0,useWidth:void 0},c4:{...lc.c4,useWidth:void 0,personFont:C(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...lc.flowchart,inheritDir:!1},external_personFont:C(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:C(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:C(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:C(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:C(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:C(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:C(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:C(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:C(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:C(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:C(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:C(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:C(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:C(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:C(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:C(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:C(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:C(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:C(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:C(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:C(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...lc.pie,useWidth:984},xyChart:{...lc.xyChart,useWidth:void 0},requirement:{...lc.requirement,useWidth:void 0},packet:{...lc.packet},eventmodeling:{...lc.eventmodeling},treeView:{...lc.treeView,useWidth:void 0},radar:{...lc.radar},railroad:{...lc.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...lc.ishikawa},sankey:{...lc.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...lc.venn},cynefin:{...lc.cynefin}},hgt=C((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...hgt(t[n],"")]:[...r,e+n],[]),"keyify"),oWr=new Set(hgt(ugt,"")),Xn=ugt,lWr={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},cWr=C((t,e)=>{for(const r of Object.keys(t)){const n=t[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof n!="string"||!e.test(n))&&(me.debug("sanitize deleting dictionary entry:",r,n),delete t[r])}},"sanitizeDictionaryConfig"),Cq=C(t=>{if(me.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>Cq(e));return}for(const e of Object.keys(t)){if(me.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!oWr.has(e)||t[e]==null){me.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){const n=lWr[e];n?cWr(t[e],n):(me.debug("sanitizing object",e),Cq(t[e]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(me.debug("sanitizing css option",e),t[e]=dgt(t[e]))}if(t.themeVariables)for(const e of Object.keys(t.themeVariables)){const r=t.themeVariables[e];r!=null&&r.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}me.debug("After sanitization",t)}},"sanitizeDirective"),dgt=C(t=>{let e=0,r=0;for(const n of t){if(e!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),Lh=Eo({},O5),Oq,cS=[],DB=Eo({},O5),LB=C((t,e)=>{let r=Eo({},t),n={};for(const i of e)ggt(i),n=Eo(n,i);if(r=Eo(r,n),n.theme&&n.theme in Ey){const i=Eo({},Oq),a=Eo(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in Ey&&(r.themeVariables=Ey[r.theme].getThemeVariables(a))}return DB=r,gWr(DB),DB},"updateCurrentConfig"),uWr=C(t=>(Lh=Eo({},O5),Lh=Eo(Lh,t),t.theme&&Ey[t.theme]&&(Lh.themeVariables=Ey[t.theme].getThemeVariables(t.themeVariables)),LB(Lh,cS),Lh),"setSiteConfig"),hWr=C(t=>{Oq=Eo({},t)},"saveConfigFromInitialize"),dWr=C(t=>(Lh=Eo(Lh,t),LB(Lh,cS),Lh),"updateSiteConfig"),fgt=C(()=>Eo({},Lh),"getSiteConfig"),pgt=C(t=>(LB(DB,[t]),Dr()),"setConfig"),Dr=C(()=>Eo({},DB),"getConfig"),ggt=C(t=>{t&&(["secure",...Lh.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(me.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])}),Object.keys(t).forEach(e=>{e.startsWith("__")&&delete t[e]}),Object.keys(t).forEach(e=>{typeof t[e]=="string"&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],typeof t[e]=="object"&&ggt(t[e])}))},"sanitize"),fWr=C(t=>{var e;Cq(t),t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),cS.push(t),LB(Lh,cS)},"addDirective"),kq=C((t=Lh)=>{cS=[],LB(t,cS)},"reset"),pWr={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},mgt={},vgt=C(t=>{mgt[t]||(me.warn(pWr[t]),mgt[t]=!0)},"issueWarning"),gWr=C(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&vgt("LAZY_LOAD_DEPRECATED")},"checkConfig"),ygt=C(()=>{let t={};Oq&&(t=Eo(t,Oq));for(const e of cS)t=Eo(t,e);return t},"getUserDefinedConfig"),Zi=C(t=>{var e,r;return((e=t.flowchart)==null?void 0:e.htmlLabels)!=null&&vgt("FLOWCHART_HTML_LABELS_DEPRECATED"),Xm(t.htmlLabels??((r=t.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),bgt=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,MB=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,mWr=/\s*%%.*\n/gm,xgt=(AD=class extends Error{constructor(e){super(e),this.name="UnknownDiagramError"}},C(AD,"UnknownDiagramError"),AD),uS={},cye=C(function(t,e){t=t.replace(bgt,"").replace(MB,"").replace(mWr,` -`);for(const[r,{detector:n}]of Object.entries(uS))if(n(t,e))return r;throw new xgt(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),uye=C((...t)=>{for(const{id:e,detector:r,loader:n}of t)wgt(e,r,n)},"registerLazyLoadedDiagrams"),wgt=C((t,e,r)=>{uS[t]&&me.warn(`Detector with key ${t} already exists. Overwriting.`),uS[t]={detector:e,loader:r},me.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),vWr=C(t=>uS[t].loader,"getDiagramLoader"),k5=//gi,yWr=C(t=>t?Cgt(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),bWr=(()=>{let t=!1;return()=>{t||(Agt(),t=!0)}})();function Agt(){const t="data-temp-href-target";Oy.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),Oy.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener"))})}C(Agt,"setupDompurifyHooks");var Tgt=C(t=>(bWr(),Oy.sanitize(t)),"removeScript"),Sgt=C((t,e)=>{if(Zi(e)){const r=e.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?t=Tgt(t):r!=="loose"&&(t=Cgt(t),t=t.replace(//g,">"),t=t.replace(/=/g,"="),t=TWr(t))}return t},"sanitizeMore"),ai=C((t,e)=>t&&(e.dompurifyConfig?t=Oy.sanitize(Sgt(t,e),e.dompurifyConfig).toString():t=Oy.sanitize(Sgt(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),xWr=C((t,e)=>typeof t=="string"?ai(t,e):t.flat().map(r=>ai(r,e)),"sanitizeTextOrArray"),wWr=C(t=>k5.test(t),"hasBreaks"),AWr=C(t=>t.split(k5),"splitBreaks"),TWr=C(t=>t.replace(/#br#/g,"
"),"placeholderToBreak"),Cgt=C(t=>t.replace(k5,"#br#"),"breakToPlaceholder"),Eq=C(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),SWr=C(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),CWr=C(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),Hx=C(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,t.split(e).length-1),"countOccurrence"),OWr=C((t,e)=>{const r=hye(t,"~"),n=hye(e,"~");return r===1&&n===1},"shouldCombineSets"),kWr=C(t=>{const e=hye(t,"~");let r=!1;if(e<=1)return t;e%2!==0&&t.startsWith("~")&&(t=t.substring(1),r=!0);const n=[...t];let i=n.indexOf("~"),a=n.lastIndexOf("~");for(;i!==-1&&a!==-1&&i!==a;)n[i]="<",n[a]=">",i=n.indexOf("~"),a=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")},"processSet"),Ogt=C(()=>window.MathMLElement!==void 0,"isMathMLSupported"),dye=/\$\$(.*?)\$\$/g,io=C(t=>{var e;return(((e=t.match(dye))==null?void 0:e.length)??0)>0},"hasKatex"),IB=C(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await _q(t,e),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0";const n=document.querySelector("body");n==null||n.insertAdjacentElement("beforeend",r);const i={width:r.clientWidth,height:r.clientHeight};return r.remove(),i},"calculateMathMLDimensions"),EWr=C(async(t,e)=>{if(!io(t))return t;if(!(Ogt()||e.legacyMathML||e.forceLegacyMathML))return t.replace(dye,"MathML is unsupported in this environment.");{const{default:r}=await Promise.resolve().then(()=>Mxn),n=e.forceLegacyMathML||!Ogt()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(k5).map(i=>io(i)?`
${i}
`:`
${i}
`).join("").replace(dye,(i,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),_q=C(async(t,e)=>ai(await EWr(t,e),e),"renderKatexSanitized"),jt={getRows:yWr,sanitizeText:ai,sanitizeTextOrArray:xWr,hasBreaks:wWr,splitBreaks:AWr,lineBreakRegex:k5,removeScript:Tgt,getUrl:Eq,evaluate:Xm,getMax:SWr,getMin:CWr},_Wr=C(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),RWr=C(function(t,e,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${e}px;`)):(n.set("height",t),n.set("width",e)),n},"calculateSvgSizeAttrs"),zs=C(function(t,e,r,n){const i=RWr(e,r,n);_Wr(t,i)},"configureSvgSize"),E5=C(function(t,e,r,n){const i=e.node().getBBox(),a=i.width,s=i.height;me.info(`SVG bounds: ${a}x${s}`,i);let o=0,l=0;me.info(`Graph bounds: ${o}x${l}`,t),o=a+r*2,l=s+r*2,me.info(`Calculated bounds: ${o}x${l}`),zs(e,l,o,n);const u=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;e.attr("viewBox",u)},"setupGraphViewbox"),Rq={};function fye(t){return[...t.cssRules].map(e=>e.cssText).join(` +*`,"g")),n={series:[]};return de(r,function(i,a){if(rUr(i)){var s=nUr(i),o=e[a],l=o.axisDim+"Axis";o&&(n[l]=n[l]||[],n[l][o.axisIndex]={data:s.categories},n.series=n.series.concat(s.series))}else{var s=iUr(i);n.series.push(s)}}),n}var sUr=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.onclick=function(r,n){setTimeout(function(){n.dispatchAction({type:"hideTip"})});var i=n.getDom(),a=this.model;this._dom&&i.removeChild(this._dom);var s=document.createElement("div");s.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",s.style.backgroundColor=a.get("backgroundColor")||et.color.neutral00;var o=document.createElement("h4"),l=a.get("lang")||[];o.innerHTML=l[0]||a.get("title"),o.style.cssText="margin:10px 20px",o.style.color=a.get("textColor");var u=document.createElement("div"),h=document.createElement("textarea");u.style.cssText="overflow:auto";var d=a.get("optionToContent"),f=a.get("contentToOption"),p=tUr(r);if(ur(d)){var g=d(n.getOption());Nt(g)?u.innerHTML=g:wA(g)&&u.appendChild(g)}else{h.readOnly=a.get("readOnly");var m=h.style;m.cssText="display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none",m.color=a.get("textColor"),m.borderColor=a.get("textareaBorderColor"),m.backgroundColor=a.get("textareaColor"),h.value=p.value,u.appendChild(h)}var v=p.meta,y=document.createElement("div");y.style.cssText="position:absolute;bottom:5px;left:0;right:0";var b="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",x=document.createElement("div"),w=document.createElement("div");b+=";background-color:"+a.get("buttonColor"),b+=";color:"+a.get("buttonTextColor");var A=this;function S(){i.removeChild(s),A._dom=null}whe(x,"click",S),whe(w,"click",function(){if(f==null&&d!=null||f!=null&&d==null){S();return}var T;try{ur(f)?T=f(u,n.getOption()):T=aUr(h.value,v)}catch(O){throw S(),new Error("Data view format error "+O)}T&&n.dispatchAction({type:"changeDataView",newOption:T}),S()}),x.innerHTML=l[1],w.innerHTML=l[2],w.style.cssText=x.style.cssText=b,!a.get("readOnly")&&y.appendChild(w),y.appendChild(x),s.appendChild(o),s.appendChild(u),s.appendChild(y),u.style.height=i.clientHeight-80+"px",i.appendChild(s),this._dom=s},e.prototype.dispose=function(r,n){this._dom&&n.getDom().removeChild(this._dom)},e.getDefaultOption=function(r){var n={show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:r.getLocaleModel().get(["toolbox","dataView","title"]),lang:r.getLocaleModel().get(["toolbox","dataView","lang"]),backgroundColor:et.color.background,textColor:et.color.primary,textareaColor:et.color.background,textareaBorderColor:et.color.border,buttonColor:et.color.accent50,buttonTextColor:et.color.neutral00};return n},e}(Gm);function oUr(t,e){return vt(t,function(r,n){var i=e&&e[n];if(yr(i)&&!ft(i)){var a=yr(r)&&!ft(r);a||(r={value:r});var s=i.name!=null&&r.name==null;return r=mr(r,i),s&&delete r.name,r}else return r})}qp({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},function(t,e){var r=[];de(t.newOption.series,function(n){var i=e.getSeriesByName(n.name)[0];if(!i)r.push(ot({type:"scatter"},n));else{var a=i.get("data");r.push({name:n.name,data:oUr(n.data,a)})}}),e.mergeOption(mr({series:r},t.newOption))});var Ydt=de,qdt=Qr();function lUr(t,e){var r=hve(t);Ydt(e,function(n,i){for(var a=r.length-1;a>=0;a--){var s=r[a];if(s[i])break}if(a<0){var o=t.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(o){var l=o.getPercentRange();r[0][i]={dataZoomId:i,start:l[0],end:l[1]}}}}),r.push(e)}function cUr(t){var e=hve(t),r=e[e.length-1];e.length>1&&e.pop();var n={};return Ydt(r,function(i,a){for(var s=e.length-1;s>=0;s--)if(i=e[s][a],i){n[a]=i;break}}),n}function uUr(t){qdt(t).snapshots=null}function hUr(t){return hve(t).length}function hve(t){var e=qdt(t);return e.snapshots||(e.snapshots=[{}]),e.snapshots}var dUr=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.onclick=function(r,n){uUr(r),n.dispatchAction({type:"restore",from:this.uid})},e.getDefaultOption=function(r){var n={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:r.getLocaleModel().get(["toolbox","restore","title"])};return n},e}(Gm);qp({type:"restore",event:"restore",update:"prepareAndUpdate"},function(t,e){e.resetOption("recreate")});var fUr=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],dve=function(){function t(e,r,n){var i=this;this._targetInfoList=[];var a=jdt(r,e);de(pUr,function(s,o){(!n||!n.include||Ir(n.include,o)>=0)&&s(a,i._targetInfoList)})}return t.prototype.setOutputRanges=function(e,r){return this.matchOutputRanges(e,r,function(n,i,a){if((n.coordRanges||(n.coordRanges=[])).push(i),!n.coordRange){n.coordRange=i;var s=pve[n.brushType](0,a,i);n.__rangeOffset={offset:Jdt[n.brushType](s.values,n.range,[1,1]),xyMinMax:s.xyMinMax}}}),e},t.prototype.matchOutputRanges=function(e,r,n){de(e,function(i){var a=this.findTargetInfo(i,r);a&&a!==!0&&de(a.coordSyses,function(s){var o=pve[i.brushType](1,s,i.range,!0);n(i,o.values,s,r)})},this)},t.prototype.setInputRanges=function(e,r){de(e,function(n){var i=this.findTargetInfo(n,r);if(n.range=n.range||[],i&&i!==!0){n.panelId=i.panelId;var a=pve[n.brushType](0,i.coordSys,n.coordRange),s=n.__rangeOffset;n.range=s?Jdt[n.brushType](a.values,s.offset,gUr(a.xyMinMax,s.xyMinMax)):a.values}},this)},t.prototype.makePanelOpts=function(e,r){return vt(this._targetInfoList,function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:r?r(n):null,clipPath:But(i),isTargetByCursor:Fut(i,e,n.coordSysModel),getLinearBrushOtherExtent:$ut(i)}})},t.prototype.controlSeries=function(e,r,n){var i=this.findTargetInfo(e,n);return i===!0||i&&Ir(i.coordSyses,r.coordinateSystem)>=0},t.prototype.findTargetInfo=function(e,r){for(var n=this._targetInfoList,i=jdt(r,e),a=0;at[1]&&t.reverse(),t}function jdt(t,e){return n_(t,e,{includeMainTypes:fUr})}var pUr={grid:function(t,e){var r=t.xAxisModels,n=t.yAxisModels,i=t.gridModels,a=Yt(),s={},o={};!r&&!n&&!i||(de(r,function(l){var u=l.axis.grid.model;a.set(u.id,u),s[u.id]=!0}),de(n,function(l){var u=l.axis.grid.model;a.set(u.id,u),o[u.id]=!0}),de(i,function(l){a.set(l.id,l),s[l.id]=!0,o[l.id]=!0}),a.each(function(l){var u=l.coordinateSystem,h=[];de(u.getCartesians(),function(d,f){(Ir(r,d.getAxis("x").model)>=0||Ir(n,d.getAxis("y").model)>=0)&&h.push(d)}),e.push({panelId:"grid--"+l.id,gridModel:l,coordSysModel:l,coordSys:h[0],coordSyses:h,getPanelRect:Kdt.grid,xAxisDeclared:s[l.id],yAxisDeclared:o[l.id]})}))},geo:function(t,e){de(t.geoModels,function(r){var n=r.coordinateSystem;e.push({panelId:"geo--"+r.id,geoModel:r,coordSysModel:r,coordSys:n,coordSyses:[n],getPanelRect:Kdt.geo})})}},Xdt=[function(t,e){var r=t.xAxisModel,n=t.yAxisModel,i=t.gridModel;return!i&&r&&(i=r.axis.grid.model),!i&&n&&(i=n.axis.grid.model),i&&i===e.gridModel},function(t,e){var r=t.geoModel;return r&&r===e.geoModel}],Kdt={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys.view,e=$lt(null,t);return rJe(e,e,fY(null,t)),e}},pve={lineX:qr(Zdt,0),lineY:qr(Zdt,1),rect:function(t,e,r,n){var i=t?e.pointToData([r[0][0],r[1][0]],n):e.dataToPoint([r[0][0],r[1][0]],n),a=t?e.pointToData([r[0][1],r[1][1]],n):e.dataToPoint([r[0][1],r[1][1]],n),s=[fve([i[0],a[0]]),fve([i[1],a[1]])];return{values:s,xyMinMax:s}},polygon:function(t,e,r,n){var i=[rc(),rc()],a=vt(r,function(s){var o=t?e.pointToData(s,n):e.dataToPoint(s,n);return i[0][0]=Math.min(i[0][0],o[0]),i[1][0]=Math.min(i[1][0],o[1]),i[0][1]=Math.max(i[0][1],o[0]),i[1][1]=Math.max(i[1][1],o[1]),o});return{values:a,xyMinMax:i}}};function Zdt(t,e,r,n){var i=r.getAxis(["x","y"][t]),a=fve(vt([0,1],function(o){return e?i.coordToData(i.toLocalCoord(n[o]),!0):i.toGlobalCoord(i.dataToCoord(n[o]))})),s=[];return s[t]=a,s[1-t]=[NaN,NaN],{values:a,xyMinMax:s}}var Jdt={lineX:qr(eft,0),lineY:qr(eft,1),rect:function(t,e,r){return[[t[0][0]-r[0]*e[0][0],t[0][1]-r[0]*e[0][1]],[t[1][0]-r[1]*e[1][0],t[1][1]-r[1]*e[1][1]]]},polygon:function(t,e,r){return vt(t,function(n,i){return[n[0]-r[0]*e[i][0],n[1]-r[1]*e[i][1]]})}};function eft(t,e,r,n){return[e[0]-n[t]*r[0],e[1]-n[t]*r[1]]}function gUr(t,e){var r=tft(t),n=tft(e),i=[r[0]/n[0],r[1]/n[1]];return isNaN(i[0])&&(i[0]=1),isNaN(i[1])&&(i[1]=1),i}function tft(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}var gve=de,mUr=xEr("toolbox-dataZoom_"),vUr={x:"width",y:"height"},yUr=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(r,n,i,a){this._brushController||(this._brushController=new Jme(i.getZr()),this._brushController.on("brush",Ht(this._onBrush,this)).mount()),wUr(r,n,this,a,i),xUr(r,n)},e.prototype.onclick=function(r,n,i){bUr[i].call(this)},e.prototype.dispose=function(r,n){this._brushController&&this._brushController.dispose()},e.prototype._onBrush=function(r){var n=r.areas;if(!r.isEnd||!n.length)return;var i={},a=this.ecModel;this._brushController.updateCovers([]);var s=new dve(mve(this.model),a,{include:["grid"]});s.matchOutputRanges(n,a,function(u,h,d){if(d.type==="cartesian2d"){var f=d.master.getRect().clone(),p=u.brushType;p==="rect"?(o("x",d,f,h[0]),o("y",d,f,h[1])):o({lineX:"x",lineY:"y"}[p],d,f,h)}}),lUr(a,i),this._dispatchZoomAction(i);function o(u,h,d,f){var p=h.getAxis(u),g=p.model,m=l(u,g,a),v=m.findRepresentativeAxisProxy(g).getMinMaxSpan(),y=p.scale.getExtent();(v.minValueSpan!=null||v.maxValueSpan!=null)&&(f=Ix(0,f.slice(),y,0,v.minValueSpan,v.maxValueSpan));var b=lde(y,d[vUr[u]],.5);m&&(i[m.id]={dataZoomId:m.id,startValue:isFinite(b)?Gn(f[0],b):f[0],endValue:isFinite(b)?Gn(f[1],b):f[1]})}function l(u,h,d){var f;return d.eachComponent({mainType:"dataZoom",subType:"select"},function(p){var g=p.getAxisModel(u,h.componentIndex);g&&(f=p)}),f}},e.prototype._dispatchZoomAction=function(r){var n=[];gve(r,function(i,a){n.push(lr(i))}),n.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:n})},e.getDefaultOption=function(r){var n={show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:r.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:et.color.backgroundTint}};return n},e}(Gm),bUr={zoom:function(){var t=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:t})},back:function(){this._dispatchZoomAction(cUr(this.ecModel))}};function mve(t){var e={xAxisIndex:t.get("xAxisIndex",!0),yAxisIndex:t.get("yAxisIndex",!0),xAxisId:t.get("xAxisId",!0),yAxisId:t.get("yAxisId",!0)};return e.xAxisIndex==null&&e.xAxisId==null&&(e.xAxisIndex="all"),e.yAxisIndex==null&&e.yAxisId==null&&(e.yAxisIndex="all"),e}function xUr(t,e){t.setIconStatus("back",hUr(e)>1?"emphasis":"normal")}function wUr(t,e,r,n,i){var a=r._isZoomActive;n&&n.type==="takeGlobalCursor"&&(a=n.key==="dataZoomSelect"?n.dataZoomSelectActive:!1),r._isZoomActive=a,t.setIconStatus("zoom",a?"emphasis":"normal");var s=new dve(mve(t),e,{include:["grid"]}),o=s.makePanelOpts(i,function(l){return l.xAxisDeclared&&!l.yAxisDeclared?"lineX":!l.xAxisDeclared&&l.yAxisDeclared?"lineY":"rect"});r._brushController.setPanels(o).enableBrush(a&&o.length?{brushType:"auto",brushStyle:t.getModel("brushStyle").getItemStyle()}:!1)}l4r("dataZoom",function(t){var e=t.getComponent("toolbox",0),r=["feature","dataZoom"];if(!e||e.get(r)==null)return;var n=e.getModel(r),i=[],a=mve(n),s=n_(t,a);gve(s.xAxisModels,function(l){return o(l,"xAxis","xAxisIndex")}),gve(s.yAxisModels,function(l){return o(l,"yAxis","yAxisIndex")});function o(l,u,h){var d=l.componentIndex,f={type:"select",$fromToolbox:!0,filterMode:n.get("filterMode",!0)||"filter",id:mUr+u+d};f[h]=d,i.push(f)}return i});function AUr(t){t.registerComponentModel(Wzr),t.registerComponentView(Yzr),m5("saveAsImage",jzr),m5("magicType",Kzr),m5("dataView",sUr),m5("dataZoom",yUr),m5("restore",dUr),Yr(Hzr)}var SUr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click|mousewheel",alwaysShowContent:!1,renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,displayTransition:!0,enterable:!1,backgroundColor:et.color.neutral00,shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:et.color.border,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:et.color.borderShade,width:1,type:"dashed",textStyle:{}}},textStyle:{color:et.color.tertiary,fontSize:14}},e}(fn);function rft(t){var e=t.get("confine");return e!=null?!!e:t.get("renderMode")==="richText"}function nft(t){if(Rn.domSupported){for(var e=document.documentElement.style,r=0,n=t.length;r-1?(o+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(o+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var h=u*Math.PI/180,d=s+i,f=d*Math.abs(Math.cos(h))+d*Math.abs(Math.sin(h)),p=Math.round(((f-Math.SQRT2*i)/2+Math.SQRT2*i-(f-d)/2)*100)/100;o+=";"+a+":-"+p+"px";var g=e+" solid "+i+"px;",m=["position:absolute;width:"+s+"px;height:"+s+"px;z-index:-1;",o+";"+l+";","border-bottom:"+g,"border-right:"+g,"background-color:"+n+";"];return'
'}function RUr(t,e,r){var n="cubic-bezier(0.23,1,0.32,1)",i="",a="";return r&&(i=" "+t/2+"s "+n,a="opacity"+i+",visibility"+i),e||(i=" "+t+"s "+n,a+=(a.length?",":"")+(Rn.transformSupported?""+vve+i:",left"+i+",top"+i)),OUr+":"+a}function sft(t,e,r){var n=t.toFixed(0)+"px",i=e.toFixed(0)+"px";if(!Rn.transformSupported)return r?"top:"+i+";left:"+n+";":[["top",i],["left",n]];var a=Rn.transform3dSupported,s="translate"+(a?"3d":"")+"("+n+","+i+(a?",0":"")+")";return r?"top:0;left:0;"+vve+":"+s+";":[["top",0],["left",0],[ift,s]]}function DUr(t){var e=[],r=t.get("fontSize"),n=t.getTextColor();n&&e.push("color:"+n),e.push("font:"+t.getFont());var i=Jt(t.get("lineHeight"),Math.round(r*3/2));r&&e.push("line-height:"+i+"px");var a=t.get("textShadowColor"),s=t.get("textShadowBlur")||0,o=t.get("textShadowOffsetX")||0,l=t.get("textShadowOffsetY")||0;return a&&s&&e.push("text-shadow:"+o+"px "+l+"px "+s+"px "+a),de(["decoration","align"],function(u){var h=t.get(u);h&&e.push("text-"+u+":"+h)}),e.join(";")}function LUr(t,e,r,n){var i=[],a=t.get("transitionDuration"),s=t.get("backgroundColor"),o=t.get("shadowBlur"),l=t.get("shadowColor"),u=t.get("shadowOffsetX"),h=t.get("shadowOffsetY"),d=t.getModel("textStyle"),f=Lnt(t,"html"),p=u+"px "+h+"px "+o+"px "+l;return i.push("box-shadow:"+p),e&&a>0&&i.push(RUr(a,r,n)),s&&i.push("background-color:"+s),de(["width","color","radius"],function(g){var m="border-"+g,v=Mfe(m),y=t.get(v);y!=null&&i.push(m+":"+y+(g==="color"?"":"px"))}),i.push(DUr(d)),f!=null&&i.push("padding:"+C_(f).join("px ")+"px"),i.join(";")+";"}function oft(t,e,r,n,i){var a=e&&e.painter;if(r){var s=a&&a.getViewportRoot();s&&IOr(t,s,r,n,i)}else{t[0]=n,t[1]=i;var o=a&&a.getViewportRootOffset();o&&(t[0]+=o.offsetLeft,t[1]+=o.offsetTop)}t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var MUr=function(){function t(e,r){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,Rn.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var i=this._zr=e.getZr(),a=r.appendTo,s=a&&(Nt(a)?document.querySelector(a):wA(a)?a:ur(a)&&a(e.getDom()));oft(this._styleCoord,i,s,e.getWidth()/2,e.getHeight()/2),(s||e.getDom()).appendChild(n),this._api=e,this._container=s;var o=this;n.onmouseenter=function(){o._enterable&&(clearTimeout(o._hideTimeout),o._show=!0),o._inContent=!0},n.onmousemove=function(l){if(l=l||window.event,!o._enterable){var u=i.handler,h=i.painter.getViewportRoot();Lf(h,l,!0),u.dispatch("mousemove",l)}},n.onmouseleave=function(){o._inContent=!1,o._enterable&&o._show&&o.hideLater(o._hideDelay)}}return t.prototype.update=function(e){if(!this._container){var r=this._api.getDom(),n=CUr(r,"position"),i=r.style;i.position!=="absolute"&&n!=="absolute"&&(i.position="relative")}var a=e.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this._enableDisplayTransition=e.get("displayTransition")&&e.get("transitionDuration")>0,this.el.className=e.get("className")||""},t.prototype.show=function(e,r){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=n.style,a=this._styleCoord;n.innerHTML?i.cssText=kUr+LUr(e,!this._firstShow,this._longHide,this._enableDisplayTransition)+sft(a[0],a[1],!0)+("border-color:"+cS(r)+";")+(e.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):i.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},t.prototype.setContent=function(e,r,n,i,a){var s=this.el;if(e==null){s.innerHTML="";return}var o="";if(Nt(a)&&n.get("trigger")==="item"&&!rft(n)&&(o=_Ur(n,i,a)),Nt(e))s.innerHTML=e+o;else if(e){s.innerHTML="",ft(e)||(e=[e]);for(var l=0;l=0?this._tryShow(a,s):i==="leave"&&this._hide(s))},this))},e.prototype._keepShow=function(){var r=this._tooltipModel,n=this._ecModel,i=this._api,a=r.get("triggerOn");if(r.get("trigger")!=="axis"&&(this._lastDataByCoordSys=null,this._cbParamsList=null),this._lastX!=null&&this._lastY!=null&&a!=="none"&&a!=="click"){var s=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!i.isDisposed()&&s.manuallyShowTip(r,n,i,{x:s._lastX,y:s._lastY,dataByCoordSys:s._lastDataByCoordSys})})}},e.prototype.manuallyShowTip=function(r,n,i,a){if(!(a.from===this.uid||Rn.node||!i.getDom())){var s=uft(a,i);this._ticket="";var o=a.dataByCoordSys,l=zUr(a,n,i);if(l){var u=l.el.getBoundingRect().clone();u.applyTransform(l.el.transform),this._tryShow({offsetX:u.x+u.width/2,offsetY:u.y+u.height/2,target:l.el,position:a.position,positionDefault:"bottom"},s)}else if(a.tooltip&&a.x!=null&&a.y!=null){var h=PUr;h.x=a.x,h.y=a.y,h.update(),Cr(h).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:h},s)}else if(o)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:o,tooltipOption:a.tooltipOption},s);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(r,n,i,a))return;var d=jht(a,n),f=d.point[0],p=d.point[1];f!=null&&p!=null&&this._tryShow({offsetX:f,offsetY:p,target:d.el,position:a.position,positionDefault:"bottom"},s)}else a.x!=null&&a.y!=null&&(i.dispatchAction({type:"updateAxisPointer",x:a.x,y:a.y}),this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,target:i.getZr().findHover(a.x,a.y).target},s))}},e.prototype.manuallyHideTip=function(r,n,i,a){var s=this._tooltipContent;this._tooltipModel&&s.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,this._cbParamsList=null,a.from!==this.uid&&this._hide(uft(a,i))},e.prototype._manuallyAxisShowTip=function(r,n,i,a){var s=a.seriesIndex,o=a.dataIndex,l=n.getComponent("axisPointer").coordSysAxesInfo;if(!(s==null||o==null||l==null)){var u=n.getSeriesByIndex(s);if(u){var h=u.getData(),d=vB([h.getItemModel(o),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(d.get("trigger")==="axis")return i.dispatchAction({type:"updateAxisPointer",seriesIndex:s,dataIndex:o,position:a.position}),!0}}},e.prototype._tryShow=function(r,n){var i=r.target,a=this._tooltipModel;if(a){this._lastX=r.offsetX,this._lastY=r.offsetY;var s=r.dataByCoordSys;if(s&&s.length)this._showAxisTooltip(s,r);else if(i){var o=Cr(i);if(o.ssrType==="legend")return;this._lastDataByCoordSys=null,this._cbParamsList=null;var l,u;bS(i,function(h){if(h.tooltipDisabled)return l=u=null,!0;l||u||(Cr(h).dataIndex!=null?l=h:Cr(h).tooltipConfig!=null&&(u=h))},!0),l?this._showSeriesItemTooltip(r,l,n):u?this._showComponentItemTooltip(r,u,n):this._hide(n)}else this._lastDataByCoordSys=null,this._cbParamsList=null,this._hide(n)}},e.prototype._showOrMove=function(r,n){var i=r.get("showDelay");n=Ht(n,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(n,i):n()},e.prototype._showAxisTooltip=function(r,n){var i=this._ecModel,a=this._tooltipModel,s=[n.offsetX,n.offsetY],o=vB([n.tooltipOption],a),l=this._renderMode,u=[],h=no("section",{blocks:[],noHeader:!0}),d=[],f=new npe;de(r,function(b){de(b.dataByAxis,function(x){var w=i.getComponent(x.axisDim+"Axis",x.axisIndex),A=x.value,S=w.axis,T=S.scale.parse(A);if(!(!w||A==null)){var O=Vht(A,S,i,x.seriesDataIndices,x.valueLabelOpt),k=no("section",{header:O,noHeader:!Sd(O),sortBlocks:!0,blocks:[]});h.blocks.push(k),de(x.seriesDataIndices,function(E){var _=i.getSeriesByIndex(E.seriesIndex),I=E.dataIndexInside,L=_.getDataParams(I);if(!(L.dataIndex<0)){L.axisDim=x.axisDim,L.axisIndex=x.axisIndex,L.axisType=x.axisType,L.axisId=x.axisId,L.axisValue=EW(w.axis,{value:T}),L.axisValueLabel=O,L.marker=f.makeTooltipMarker("item",cS(L.color),l);var R=unt(_.formatTooltip(I,!0,null)),D=R.frag;if(D){var M=vB([_],a).get("valueFormatter");k.blocks.push(M?ot({valueFormatter:M},D):D)}R.text&&d.push(R.text),u.push(L)}})}})}),h.blocks.reverse(),d.reverse();var p=n.position,g=o.get("order"),m=_nt(h,f,l,g,i.get("useUTC"),o.get("textStyle"));m&&d.unshift(m);var v=l==="richText"?` + +`:"
",y=d.join(v);this._showOrMove(o,function(){this._updateContentNotChangedOnAxis(r,u)?this._updatePosition(o,p,s[0],s[1],this._tooltipContent,u):this._showTooltipContent(o,y,u,Math.random()+"",s[0],s[1],p,null,f)})},e.prototype._showSeriesItemTooltip=function(r,n,i){var a=this._ecModel,s=Cr(n),o=s.seriesIndex,l=a.getSeriesByIndex(o),u=s.dataModel||l,h=s.dataIndex,d=s.dataType,f=u.getData(d),p=this._renderMode,g=r.positionDefault,m=vB([f.getItemModel(h),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,g?{position:g}:null),v=m.get("trigger");if(!(v!=null&&v!=="item")){var y=u.getDataParams(h,d),b=new npe;y.marker=b.makeTooltipMarker("item",cS(y.color),p);var x=unt(u.formatTooltip(h,!1,d)),w=m.get("order"),A=m.get("valueFormatter"),S=x.frag,T=S?_nt(A?ot({valueFormatter:A},S):S,b,p,w,a.get("useUTC"),m.get("textStyle")):x.text,O="item_"+u.name+"_"+h;this._showOrMove(m,function(){this._showTooltipContent(m,T,y,O,r.offsetX,r.offsetY,r.position,r.target,b)}),i({type:"showTip",dataIndexInside:h,dataIndex:f.getRawIndex(h),seriesIndex:o,from:this.uid})}},e.prototype._showComponentItemTooltip=function(r,n,i){var a=this._renderMode==="html",s=Cr(n),o=s.tooltipConfig,l=o.option||{},u=l.encodeHTMLContent;if(Nt(l)){var h=l;l={content:h,formatter:h},u=!0}u&&a&&l.content&&(l=lr(l),l.content=Nc(l.content));var d=[l],f=this._ecModel.getComponent(s.componentMainType,s.componentIndex);f&&d.push(f),d.push({formatter:l.content});var p=r.positionDefault,g=vB(d,this._tooltipModel,p?{position:p}:null),m=g.get("content"),v=Math.random()+"",y=new npe;this._showOrMove(g,function(){var b=lr(g.get("formatterParams")||{});this._showTooltipContent(g,m,b,v,r.offsetX,r.offsetY,r.position,n,y)}),i({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(r,n,i,a,s,o,l,u,h){if(this._ticket="",!(!r.get("showContent")||!r.get("show"))){var d=this._tooltipContent;d.setEnterable(r.get("enterable"));var f=r.get("formatter");l=l||r.get("position");var p=n,g=this._getNearestPoint([s,o],i,r.get("trigger"),r.get("borderColor"),r.get("defaultBorderColor",!0)),m=g.color;if(f)if(Nt(f)){var v=r.ecModel.get("useUTC"),y=ft(i)?i[0]:i,b=y&&y.axisType&&y.axisType.indexOf("time")>=0;p=f,b&&(p=KN(y.axisValue,p,v)),p=Nfe(p,i,!0)}else if(ur(f)){var x=Ht(function(w,A){w===this._ticket&&(d.setContent(A,h,r,m,l),this._updatePosition(r,l,s,o,d,i,u))},this);this._ticket=a,p=f(i,a,x)}else p=f;d.setContent(p,h,r,m,l),d.show(r,m),this._updatePosition(r,l,s,o,d,i,u)}},e.prototype._getNearestPoint=function(r,n,i,a,s){if(i==="axis"||ft(n))return{color:a||s};if(!ft(n))return{color:a||n.color||n.borderColor}},e.prototype._updatePosition=function(r,n,i,a,s,o,l){var u=this._api.getWidth(),h=this._api.getHeight();n=n||r.get("position");var d=s.getSize(),f=r.get("align"),p=r.get("verticalAlign"),g=l&&l.getBoundingRect().clone();if(l&&g.applyTransform(l.transform),ur(n)&&(n=n([i,a],o,s.el,g,{viewSize:[u,h],contentSize:d.slice()})),ft(n))i=Qt(n[0],u),a=Qt(n[1],h);else if(yr(n)){var m=n;m.width=d[0],m.height=d[1];var v=da(m,{width:u,height:h});i=v.x,a=v.y,f=null,p=null}else if(Nt(n)&&l){var y=FUr(n,g,d,r.get("borderWidth"));i=y[0],a=y[1]}else{var y=BUr(i,a,s,u,h,f?null:20,p?null:20);i=y[0],a=y[1]}if(f&&(i-=hft(f)?d[0]/2:f==="right"?d[0]:0),p&&(a-=hft(p)?d[1]/2:p==="bottom"?d[1]:0),rft(r)){var y=$Ur(i,a,s,u,h);i=y[0],a=y[1]}s.moveTo(i,a)},e.prototype._updateContentNotChangedOnAxis=function(r,n){var i=this._lastDataByCoordSys,a=this._cbParamsList,s=!!i&&i.length===r.length;return s&&de(i,function(o,l){var u=o.dataByAxis||[],h=r[l]||{},d=h.dataByAxis||[];s=s&&u.length===d.length,s&&de(u,function(f,p){var g=d[p]||{},m=f.seriesDataIndices||[],v=g.seriesDataIndices||[];s=s&&f.value===g.value&&f.axisType===g.axisType&&f.axisId===g.axisId&&m.length===v.length,s&&de(m,function(y,b){var x=v[b];s=s&&y.seriesIndex===x.seriesIndex&&y.dataIndex===x.dataIndex}),a&&de(f.seriesDataIndices,function(y){var b=y.seriesIndex,x=n[b],w=a[b];x&&w&&w.data!==x.data&&(s=!1)})})}),this._lastDataByCoordSys=r,this._cbParamsList=n,!!s},e.prototype._hide=function(r){this._lastDataByCoordSys=null,this._cbParamsList=null,r({type:"hideTip",from:this.uid})},e.prototype.dispose=function(r,n){Rn.node||!n.getDom()||(s8(this,"_updatePosition"),this._tooltipContent.dispose(),H0e("itemTooltip",n),this._tooltipContent=null,this._tooltipModel=null,this._lastDataByCoordSys=null,this._cbParamsList=null)},e.type="tooltip",e}(Hi);function vB(t,e,r){var n=e.ecModel,i;r?(i=new yn(r,n,n),i=new yn(e.option,i,n)):i=e;for(var a=t.length-1;a>=0;a--){var s=t[a];s&&(s instanceof yn&&(s=s.get("tooltip",!0)),Nt(s)&&(s={formatter:s}),s&&(i=new yn(s,i,n)))}return i}function uft(t,e){return t.dispatchAction||Ht(e.dispatchAction,e)}function BUr(t,e,r,n,i,a,s){var o=r.getSize(),l=o[0],u=o[1];return a!=null&&(t+l+a+2>n?t-=l+a:t+=a),s!=null&&(e+u+s>i?e-=u+s:e+=s),[t,e]}function $Ur(t,e,r,n,i){var a=r.getSize(),s=a[0],o=a[1];return t=Math.min(t+s,n)-s,e=Math.min(e+o,i)-o,t=Math.max(t,0),e=Math.max(e,0),[t,e]}function FUr(t,e,r,n){var i=r[0],a=r[1],s=Math.ceil(Math.SQRT2*n)+8,o=0,l=0,u=e.width,h=e.height;switch(t){case"inside":o=e.x+u/2-i/2,l=e.y+h/2-a/2;break;case"top":o=e.x+u/2-i/2,l=e.y-a-s;break;case"bottom":o=e.x+u/2-i/2,l=e.y+h+s;break;case"left":o=e.x-i-s,l=e.y+h/2-a/2;break;case"right":o=e.x+u+s,l=e.y+h/2-a/2}return[o,l]}function hft(t){return t==="center"||t==="middle"}function zUr(t,e,r){var n=gde(t).queryOptionMap,i=n.keys()[0];if(!(!i||i==="series")){var a=i_(e,i,n.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}),s=a.models[0];if(s){var o=r.getViewOfComponentModel(s),l;if(o.group.traverse(function(u){var h=Cr(u).tooltipConfig;if(h&&h.name===t.name)return l=u,!0}),l)return{componentMainType:i,componentIndex:s.componentIndex,el:l}}}}function UUr(t){Yr(fB),t.registerComponentModel(SUr),t.registerComponentView(NUr),t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Xa),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Xa)}var VUr=["rect","polygon","keep","clear"];function QUr(t,e){var r=Qi(t?t.brush:[]);if(r.length){var n=[];de(r,function(l){var u=l.hasOwnProperty("toolbox")?l.toolbox:[];u instanceof Array&&(n=n.concat(u))});var i=t&&t.toolbox;ft(i)&&(i=i[0]),i||(i={feature:{}},t.toolbox=[i]);var a=i.feature||(i.feature={}),s=a.brush||(a.brush={}),o=s.type||(s.type=[]);o.push.apply(o,n),rH(o,function(l){return l+""},null),e&&!o.length&&o.push.apply(o,VUr)}}var dft=de;function fft(t){if(t){for(var e in t)if(t.hasOwnProperty(e))return!0}}function yve(t,e,r){var n={};return dft(e,function(a){var s=n[a]=i();dft(t[a],function(o,l){if(Xo.isValidType(l)){var u={type:l,visual:o};r&&r(u,a),s[l]=new Xo(u),l==="opacity"&&(u=lr(u),u.type="colorAlpha",s.__hidden.__alphaForOpacity=new Xo(u))}})}),n;function i(){var a=function(){};a.prototype.__hidden=a.prototype;var s=new a;return s}}function pft(t,e,r){var n;de(r,function(i){e.hasOwnProperty(i)&&fft(e[i])&&(n=!0)}),n&&de(r,function(i){e.hasOwnProperty(i)&&fft(e[i])?t[i]=lr(e[i]):delete t[i]})}function GUr(t,e,r,n,i,a){var s={};de(t,function(d){var f=Xo.prepareVisualTypes(e[d]);s[d]=f});var o;function l(d){return spe(r,o,d)}function u(d,f){Jnt(r,o,d,f)}r.each(h);function h(d,f){o=d;var p=r.getRawDataItem(o);if(!(p&&p.visualMap===!1))for(var g=n.call(i,d),m=e[g],v=s[g],y=0,b=v.length;ye[0][1]&&(e[0][1]=a[0]),a[1]e[1][1]&&(e[1][1]=a[1])}return e&&xft(e)}};function xft(t){return new fr(t[0][0],t[1][0],t[0][1]-t[0][0],t[1][1]-t[1][0])}var JUr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r,n){this.ecModel=r,this.api=n,this.model,(this._brushController=new Jme(n.getZr())).on("brush",Ht(this._onBrush,this)).mount()},e.prototype.render=function(r,n,i,a){this.model=r,this._updateController(r,n,i,a)},e.prototype.updateTransform=function(r,n,i,a){yft(n),this._updateController(r,n,i,a)},e.prototype.updateVisual=function(r,n,i,a){this.updateTransform(r,n,i,a)},e.prototype.updateView=function(r,n,i,a){this._updateController(r,n,i,a)},e.prototype._updateController=function(r,n,i,a){(!a||a.$from!==r.id)&&this._brushController.setPanels(r.brushTargetManager.makePanelOpts(i)).enableBrush(r.brushOption).updateCovers(r.areas.slice())},e.prototype.dispose=function(){this._brushController.dispose()},e.prototype._onBrush=function(r){var n=this.model.id,i=this.model.brushTargetManager.setOutputRanges(r.areas,this.ecModel);(!r.isEnd||r.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:n,areas:lr(i),$from:n}),r.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:n,areas:lr(i),$from:n})},e.type="brush",e}(Hi),eVr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.areas=[],r.brushOption={},r}return e.prototype.optionUpdated=function(r,n){var i=this.option;!n&&pft(i,r,["inBrush","outOfBrush"]);var a=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:this.option.defaultOutOfBrushColor},a.hasOwnProperty("liftZ")||(a.liftZ=5)},e.prototype.setAreas=function(r){r&&(this.areas=vt(r,function(n){return wft(this.option,n)},this))},e.prototype.setBrushOption=function(r){this.brushOption=wft(this.option,r),this.brushType=this.brushOption.brushType},e.type="brush",e.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],e.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:et.color.backgroundTint,borderColor:et.color.borderTint},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4,defaultOutOfBrushColor:et.color.disabled},e}(fn);function wft(t,e){return Vr({brushType:t.brushType,brushMode:t.brushMode,transformable:t.transformable,brushStyle:new yn(t.brushStyle).getItemStyle(),removeOnClick:t.removeOnClick,z:t.z},e,!0)}var tVr=["rect","polygon","lineX","lineY","keep","clear"],rVr=function(t){rt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(r,n,i){var a,s,o;n.eachComponent({mainType:"brush"},function(l){a=l.brushType,s=l.brushOption.brushMode||"single",o=o||!!l.areas.length}),this._brushType=a,this._brushMode=s,de(r.get("type",!0),function(l){r.setIconStatus(l,(l==="keep"?s==="multiple":l==="clear"?o:l===a)?"emphasis":"normal")})},e.prototype.updateView=function(r,n,i){this.render(r,n,i)},e.prototype.getIcons=function(){var r=this.model,n=r.get("icon",!0),i={};return de(r.get("type",!0),function(a){n[a]&&(i[a]=n[a])}),i},e.prototype.onclick=function(r,n,i){var a=this._brushType,s=this._brushMode;i==="clear"?(n.dispatchAction({type:"axisAreaSelect",intervals:[]}),n.dispatchAction({type:"brush",command:"clear",areas:[]})):n.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:i==="keep"?a:a===i?!1:i,brushMode:i==="keep"?s==="multiple"?"single":"multiple":s}})},e.getDefaultOption=function(r){var n={show:!0,type:tVr.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:r.getLocaleModel().get(["toolbox","brush","title"])};return n},e}(Gm);function nVr(t){t.registerComponentView(JUr),t.registerComponentModel(eVr),t.registerPreprocessor(QUr),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,YUr),t.registerAction({type:"brush",event:"brush",update:"updateVisual"},function(e,r){r.eachComponent({mainType:"brush",query:e},function(n){n.setAreas(e.areas)})}),t.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},Xa),t.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},Xa),m5("brush",rVr)}var iVr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.layoutMode={type:"box",ignoreSize:!0},r}return e.type="title",e.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:"center",top:et.size.m,backgroundColor:et.color.transparent,borderColor:et.color.primary,borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:et.color.primary},subtextStyle:{fontSize:12,color:et.color.quaternary}},e}(fn),aVr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){if(this.group.removeAll(),!!r.get("show")){var a=this.group,s=r.getModel("textStyle"),o=r.getModel("subtextStyle"),l=r.get("textAlign"),u=Jt(r.get("textBaseline"),r.get("textVerticalAlign")),h=new Pn({style:Gi(s,{text:r.get("text"),fill:s.getTextColor()},{disableBox:!0}),z2:10}),d=h.getBoundingRect(),f=r.get("subtext"),p=new Pn({style:Gi(o,{text:f,fill:o.getTextColor(),y:d.height+r.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),g=r.get("link"),m=r.get("sublink"),v=r.get("triggerEvent",!0);h.silent=!g&&!v,p.silent=!m&&!v,g&&h.on("click",function(){zH(g,"_"+r.get("target"))}),m&&p.on("click",function(){zH(m,"_"+r.get("subtarget"))}),Cr(h).eventData=Cr(p).eventData=v?{componentType:"title",componentIndex:r.componentIndex}:null,a.add(h),f&&a.add(p);var y=a.getBoundingRect(),b=r.getBoxLayoutParams();b.width=y.width,b.height=y.height;var x=Co(r,i),w=da(b,x.refContainer,r.get("padding"));l||(l=r.get("left")||r.get("right"),l==="middle"&&(l="center"),l==="right"?w.x+=w.width:l==="center"&&(w.x+=w.width/2)),u||(u=r.get("top")||r.get("bottom"),u==="center"&&(u="middle"),u==="bottom"?w.y+=w.height:u==="middle"&&(w.y+=w.height/2),u=u||"top"),a.x=w.x,a.y=w.y,a.markRedraw();var A={align:l,verticalAlign:u};h.setStyle(A),p.setStyle(A),y=a.getBoundingRect();var S=w.margin,T=r.getItemStyle(["color","opacity"]);T.fill=r.get("backgroundColor");var O=new tn({shape:{x:y.x-S[3],y:y.y-S[0],width:y.width+S[1]+S[3],height:y.height+S[0]+S[2],r:r.get("borderRadius")},style:T,subPixelOptimize:!0,silent:!0});a.add(O)}},e.type="title",e}(Hi);function sVr(t){t.registerComponentModel(iVr),t.registerComponentView(aVr)}var Aft=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.layoutMode="box",r}return e.prototype.init=function(r,n,i){this.mergeDefaultAndTheme(r,i),this._initData()},e.prototype.mergeOption=function(r){t.prototype.mergeOption.apply(this,arguments),this._initData()},e.prototype.setCurrentIndex=function(r){r==null&&(r=this.option.currentIndex);var n=this._data.count();this.option.loop?r=(r%n+n)%n:(r>=n&&(r=n-1),r<0&&(r=0)),this.option.currentIndex=r},e.prototype.getCurrentIndex=function(){return this.option.currentIndex},e.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},e.prototype.setPlayState=function(r){this.option.autoPlay=!!r},e.prototype.getPlayState=function(){return!!this.option.autoPlay},e.prototype._initData=function(){var r=this.option,n=r.data||[],i=r.axisType,a=this._names=[],s;i==="category"?(s=[],de(n,function(u,h){var d=wo(r_(u),""),f;yr(u)?(f=lr(u),f.value=h):f=h,s.push(f),a.push(d)})):s=n;var o={category:"ordinal",time:"time",value:"number"}[i]||"number",l=this._data=new zc([{name:"value",type:o}],this);l.initData(s,a)},e.prototype.getData=function(){return this._data},e.prototype.getCategories=function(){if(this.get("axisType")==="category")return this._names.slice()},e.type="timeline",e.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:et.size.m,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:et.color.secondary},data:[]},e}(fn),Sft=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="timeline.slider",e.defaultOption=xx(Aft.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:et.color.border,borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:et.color.accent10},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:et.color.tertiary},itemStyle:{color:et.color.accent20,borderWidth:0},checkpointStyle:{symbol:"circle",symbolSize:15,color:et.color.accent50,borderColor:et.color.accent50,borderWidth:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(0, 0, 0, 0)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M15 0C23.2843 0 30 6.71573 30 15C30 23.2843 23.2843 30 15 30C6.71573 30 0 23.2843 0 15C0 6.71573 6.71573 0 15 0ZM15 3C8.37258 3 3 8.37258 3 15C3 21.6274 8.37258 27 15 27C21.6274 27 27 21.6274 27 15C27 8.37258 21.6274 3 15 3ZM11.5 10.6699C11.5 9.90014 12.3333 9.41887 13 9.80371L20.5 14.1338C21.1667 14.5187 21.1667 15.4813 20.5 15.8662L13 20.1963C12.3333 20.5811 11.5 20.0999 11.5 19.3301V10.6699Z",stopIcon:"path://M15 0C23.2843 0 30 6.71573 30 15C30 23.2843 23.2843 30 15 30C6.71573 30 0 23.2843 0 15C0 6.71573 6.71573 0 15 0ZM15 3C8.37258 3 3 8.37258 3 15C3 21.6274 8.37258 27 15 27C21.6274 27 27 21.6274 27 15C27 8.37258 21.6274 3 15 3ZM11.5 10C12.3284 10 13 10.6716 13 11.5V18.5C13 19.3284 12.3284 20 11.5 20C10.6716 20 10 19.3284 10 18.5V11.5C10 10.6716 10.6716 10 11.5 10ZM18.5 10C19.3284 10 20 10.6716 20 11.5V18.5C20 19.3284 19.3284 20 18.5 20C17.6716 20 17 19.3284 17 18.5V11.5C17 10.6716 17.6716 10 18.5 10Z",nextIcon:"path://M0.838834 18.7383C0.253048 18.1525 0.253048 17.2028 0.838834 16.617L7.55635 9.89949L0.838834 3.18198C0.253048 2.59619 0.253048 1.64645 0.838834 1.06066C1.42462 0.474874 2.37437 0.474874 2.96015 1.06066L10.7383 8.83883L10.8412 8.95277C11.2897 9.50267 11.2897 10.2963 10.8412 10.8462L10.7383 10.9602L2.96015 18.7383C2.37437 19.3241 1.42462 19.3241 0.838834 18.7383Z",prevIcon:"path://M10.9602 1.06066C11.5459 1.64645 11.5459 2.59619 10.9602 3.18198L4.24264 9.89949L10.9602 16.617C11.5459 17.2028 11.5459 18.1525 10.9602 18.7383C10.3744 19.3241 9.42462 19.3241 8.83883 18.7383L1.06066 10.9602L0.957771 10.8462C0.509245 10.2963 0.509245 9.50267 0.957771 8.95277L1.06066 8.83883L8.83883 1.06066C9.42462 0.474874 10.3744 0.474874 10.9602 1.06066Z",prevBtnSize:18,nextBtnSize:18,color:et.color.accent50,borderColor:et.color.accent50,borderWidth:0},emphasis:{label:{show:!0,color:et.color.accent60},itemStyle:{color:et.color.accent60,borderColor:et.color.accent60},controlStyle:{color:et.color.accent70,borderColor:et.color.accent70}},progress:{lineStyle:{color:et.color.accent30},itemStyle:{color:et.color.accent40}},data:[]}),e}(Aft);Is(Sft,qH.prototype);var oVr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="timeline",e}(Hi),lVr=function(t){rt(e,t);function e(r,n,i,a){var s=t.call(this,r,n,i)||this;return s.type=a||"value",s}return e.prototype.getLabelModel=function(){return this.model.getModel("label")},e.prototype.isHorizontal=function(){return this.model.get("orient")==="horizontal"},e}(Wf),wve=Math.PI,Tft=Qr(),cVr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r,n){this.api=n},e.prototype.render=function(r,n,i){if(this.model=r,this.api=i,this.ecModel=n,this.group.removeAll(),r.get("show",!0)){var a=this._layout(r,i),s=this._createGroup("_mainGroup"),o=this._createGroup("_labelGroup"),l=this._axis=this._createAxis(a,r);r.formatTooltip=function(u){var h=l.scale.getLabel({value:u});return no("nameValue",{noName:!0,value:h})},de(["AxisLine","AxisTick","Control","CurrentPointer"],function(u){this["_render"+u](a,s,l,r)},this),this._renderAxisLabel(a,o,l,r),this._position(a,r)}this._doPlayStop(),this._updateTicksStatus()},e.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},e.prototype.dispose=function(){this._clearTimer()},e.prototype._layout=function(r,n){var i=r.get(["label","position"]),a=r.get("orient"),s=uVr(r,n),o;i==null||i==="auto"?o=a==="horizontal"?s.y+s.height/2=0||o==="+"?"left":"right"},u={horizontal:o>=0||o==="+"?"top":"bottom",vertical:"middle"},h={horizontal:0,vertical:wve/2},d=a==="vertical"?s.height:s.width,f=r.getModel("controlStyle"),p=f.get("show",!0),g=p?f.get("itemSize"):0,m=p?f.get("itemGap"):0,v=g+m,y=r.get(["label","rotate"])||0;y=y*wve/180;var b,x,w,A=f.get("position",!0),S=p&&f.get("showPlayBtn",!0),T=p&&f.get("showPrevBtn",!0),O=p&&f.get("showNextBtn",!0),k=0,E=d;A==="left"||A==="bottom"?(S&&(b=[0,0],k+=v),T&&(x=[k,0],k+=v),O&&(w=[E-g,0],E-=v)):(S&&(b=[E-g,0],E-=v),T&&(x=[0,0],k+=v),O&&(w=[E-g,0],E-=v));var _=[k,E];return r.get("inverse")&&_.reverse(),{viewRect:s,mainLength:d,orient:a,rotation:h[a],labelRotation:y,labelPosOpt:o,labelAlign:r.get(["label","align"])||l[a],labelBaseline:r.get(["label","verticalAlign"])||r.get(["label","baseline"])||u[a],playPosition:b,prevBtnPosition:x,nextBtnPosition:w,axisExtent:_,controlSize:g,controlGap:m}},e.prototype._position=function(r,n){var i=this._mainGroup,a=this._labelGroup,s=r.viewRect;if(r.orient==="vertical"){var o=xa(),l=s.x,u=s.y+s.height;zp(o,o,[-l,-u]),Zv(o,o,-wve/2),zp(o,o,[l,u]),s=s.clone(),s.applyTransform(o)}var h=b(s),d=b(i.getBoundingRect()),f=b(a.getBoundingRect()),p=[i.x,i.y],g=[a.x,a.y];g[0]=p[0]=h[0][0];var m=r.labelPosOpt;if(m==null||Nt(m)){var v=m==="+"?0:1;x(p,d,h,1,v),x(g,f,h,1,1-v)}else{var v=m>=0?0:1;x(p,d,h,1,v),g[1]=p[1]+m}i.setPosition(p),a.setPosition(g),i.rotation=a.rotation=r.rotation,y(i),y(a);function y(w){w.originX=h[0][0]-w.x,w.originY=h[1][0]-w.y}function b(w){return[[w.x,w.x+w.width],[w.y,w.y+w.height]]}function x(w,A,S,T,O){w[T]+=S[T][O]-A[T][O]}},e.prototype._createAxis=function(r,n){var i=n.getData(),a=n.get("axisType")||n.get("type");a!=="category"&&a!=="time"&&(a="value");var s=G_(n,a,!1);s.getTicks=function(){return i.mapArray(["value"],function(u){return{value:u}})};var o=i.getDataExtent("value");s.setExtent(o[0],o[1]),Pat(s,{fixMinMax:[!0,!0]});var l=new lVr("value",s,r.axisExtent,a);return l.model=n,l},e.prototype._createGroup=function(r){var n=this[r]=new pr;return this.group.add(n),n},e.prototype._renderAxisLine=function(r,n,i,a){var s=i.getExtent();if(a.get(["lineStyle","show"])){var o=new Ps({shape:{x1:s[0],y1:0,x2:s[1],y2:0},style:ot({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});n.add(o);var l=this._progressLine=new Ps({shape:{x1:s[0],x2:this._currentPointer?this._currentPointer.x:s[0],y1:0,y2:0},style:mr({lineCap:"round",lineWidth:o.style.lineWidth},a.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});n.add(l)}},e.prototype._renderAxisTick=function(r,n,i,a){var s=this,o=a.getData(),l=i.scale.getTicks();this._tickSymbols=[],de(l,function(u){var h=i.dataToCoord(u.value),d=o.getItemModel(u.value),f=d.getModel("itemStyle"),p=d.getModel(["emphasis","itemStyle"]),g=d.getModel(["progress","itemStyle"]),m={x:h,y:0,onclick:Ht(s._changeTimeline,s,u.value)},v=Cft(d,f,n,m);v.ensureState("emphasis").style=p.getItemStyle(),v.ensureState("progress").style=g.getItemStyle(),vx(v);var y=Cr(v);d.get("tooltip")?(y.dataIndex=u.value,y.dataModel=a):y.dataIndex=y.dataModel=null,s._tickSymbols.push(v)})},e.prototype._renderAxisLabel=function(r,n,i,a){var s=this,o=i.getLabelModel();if(o.get("show")){var l=a.getData(),u=i.getViewLabels();this._tickLabels=[],de(u,function(h){if(!h.tick.offInterval){var d=h.tick.value,f=l.getItemModel(d),p=f.getModel("label"),g=f.getModel(["emphasis","label"]),m=f.getModel(["progress","label"]),v=i.dataToCoord(d),y=new Pn({x:v,y:0,rotation:r.labelRotation-r.rotation,onclick:Ht(s._changeTimeline,s,d),silent:!1,style:Gi(p,{text:h.formattedLabel,align:r.labelAlign,verticalAlign:r.labelBaseline})});y.ensureState("emphasis").style=Gi(g),y.ensureState("progress").style=Gi(m),n.add(y),vx(y),Tft(y).dataIndex=d,s._tickLabels.push(y)}})}},e.prototype._renderControl=function(r,n,i,a){var s=r.controlSize,o=r.rotation,l=a.getModel("controlStyle").getItemStyle(),u=a.getModel(["emphasis","controlStyle"]).getItemStyle(),h=a.getPlayState(),d=a.get("inverse",!0);f(r.nextBtnPosition,"next",Ht(this._changeTimeline,this,d?"-":"+")),f(r.prevBtnPosition,"prev",Ht(this._changeTimeline,this,d?"+":"-")),f(r.playPosition,h?"stop":"play",Ht(this._handlePlayClick,this,!h),!0);function f(p,g,m,v){if(p){var y=gm(Jt(a.get(["controlStyle",g+"BtnSize"]),s),s),b=[0,-y/2,y,y],x=hVr(a,g+"Icon",b,{x:p[0],y:p[1],originX:s/2,originY:0,rotation:v?-o:0,rectHover:!0,style:l,onclick:m});x.ensureState("emphasis").style=u,n.add(x),vx(x)}}},e.prototype._renderCurrentPointer=function(r,n,i,a){var s=a.getData(),o=a.getCurrentIndex(),l=s.getItemModel(o).getModel("checkpointStyle"),u=this,h={onCreate:function(d){d.draggable=!0,d.drift=Ht(u._handlePointerDrag,u),d.ondragend=Ht(u._handlePointerDragend,u),Oft(d,u._progressLine,o,i,a,!0)},onUpdate:function(d){Oft(d,u._progressLine,o,i,a)}};this._currentPointer=Cft(l,l,this._mainGroup,{},this._currentPointer,h)},e.prototype._handlePlayClick=function(r){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:r,from:this.uid})},e.prototype._handlePointerDrag=function(r,n,i){this._clearTimer(),this._pointerChangeTimeline([i.offsetX,i.offsetY])},e.prototype._handlePointerDragend=function(r){this._pointerChangeTimeline([r.offsetX,r.offsetY],!0)},e.prototype._pointerChangeTimeline=function(r,n){var i=this._toAxisCoord(r)[0],a=this._axis,s=xl(a.getExtent().slice());i>s[1]&&(i=s[1]),i=0&&(o[s]=+o[s].toFixed(g)),[o,p]}var lq={min:qr(oq,"min"),max:qr(oq,"max"),average:qr(oq,"average"),median:qr(oq,"median")};function bB(t,e){if(e){var r=t.getData(),n=t.coordinateSystem,i=n&&n.dimensions;if(!vVr(e)&&!ft(e.coord)&&ft(i)){var a=Eft(e,r,n,t);if(e=lr(e),e.type&&lq[e.type]&&a.baseAxis&&a.valueAxis){var s=Ir(i,a.baseAxis.dim),o=Ir(i,a.valueAxis.dim),l=lq[e.type](r,a.valueAxis.dim,a.baseDataDim,a.valueDataDim,s,o);e.coord=l[0],e.value=l[1]}else e.coord=[e.xAxis!=null?e.xAxis:e.radiusAxis,e.yAxis!=null?e.yAxis:e.angleAxis]}if(e.coord==null||!ft(i)){e.coord=[];var u=t.getBaseAxis();if(u&&e.type&&lq[e.type]){var h=n.getOtherAxis(u);h&&(e.value=cq(r,r.mapDimension(h.dim),e.type))}}else for(var d=e.coord,f=0;f<2;f++)lq[d[f]]&&(d[f]=cq(r,r.mapDimension(i[f]),d[f]));return e}}function Eft(t,e,r,n){var i={};return t.valueIndex!=null||t.valueDim!=null?(i.valueDataDim=t.valueIndex!=null?e.getDimension(t.valueIndex):t.valueDim,i.valueAxis=r.getAxis(yVr(n,i.valueDataDim)),i.baseAxis=r.getOtherAxis(i.valueAxis),i.baseDataDim=e.mapDimension(i.baseAxis.dim)):(i.baseAxis=n.getBaseAxis(),i.valueAxis=r.getOtherAxis(i.baseAxis),i.baseDataDim=e.mapDimension(i.baseAxis.dim),i.valueDataDim=e.mapDimension(i.valueAxis.dim)),i}function yVr(t,e){var r=t.getData().getDimensionInfo(e);return r&&r.coordDim}function xB(t,e){return t&&t.containData&&e.coord&&!Sve(e)?t.containData(e.coord):!0}function bVr(t,e,r){return t&&t.containZone&&e.coord&&r.coord&&!Sve(e)&&!Sve(r)?t.containZone(e.coord,r.coord):!0}function _ft(t,e){return t?function(r,n,i,a){var s=a<2?r.coord&&r.coord[a]:r.value;return Ax(s,e[a])}:function(r,n,i,a){return Ax(r.value,e[a])}}function cq(t,e,r){if(r==="average"){var n=0,i=0;return t.each(e,function(a,s){isNaN(a)||(n+=a,i++)}),n/i}else return r==="median"?t.getMedian(e):t.getDataExtent(e)[r==="max"?1:0]}var Tve=Qr(),Cve=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(){this.markerGroupMap=Yt()},e.prototype.render=function(r,n,i){var a=this,s=this.markerGroupMap;s.each(function(o){Tve(o).keep=!1}),n.eachSeries(function(o){var l=Hm.getMarkerModelFromSeries(o,a.type);l&&a.renderSeries(o,l,n,i)}),s.each(function(o){!Tve(o).keep&&a.group.remove(o.group)}),xVr(n,s,this.type)},e.prototype.markKeep=function(r){Tve(r).keep=!0},e.prototype.toggleBlurSeries=function(r,n){var i=this;de(r,function(a){var s=Hm.getMarkerModelFromSeries(a,i.type);if(s){var o=s.getData();o.eachItemGraphicEl(function(l){l&&(n?dtt(l):Wde(l))})}})},e.type="marker",e}(Hi);function xVr(t,e,r){t.eachSeries(function(n){var i=Hm.getMarkerModelFromSeries(n,r),a=e.get(n.id);if(i&&a&&a.group){var s=sS(i),o=s.z,l=s.zlevel;_H(a.group,o,l)}})}function Rft(t,e,r){var n=e.coordinateSystem,i=r.getWidth(),a=r.getHeight(),s=n&&n.getArea&&n.getArea();t.each(function(o){var l=t.getItemModel(o),u=l.get("relativeTo")==="coordinate",h=u?s?s.width:0:i,d=u?s?s.height:0:a,f=u&&s?s.x:0,p=u&&s?s.y:0,g,m=Qt(l.get("x"),h)+f,v=Qt(l.get("y"),d)+p;if(!isNaN(m)&&!isNaN(v))g=[m,v];else if(e.getMarkerPosition)g=e.getMarkerPosition(t.getValues(t.dimensions,o));else if(n){var y=t.get(n.dimensions[0],o),b=t.get(n.dimensions[1],o);g=n.dataToPoint([y,b])}isNaN(m)||(g[0]=m),isNaN(v)||(g[1]=v),t.setItemLayout(o,g)})}var wVr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.updateTransform=function(r,n,i){n.eachSeries(function(a){var s=Hm.getMarkerModelFromSeries(a,"markPoint");s&&(Rft(s.getData(),a,i),this.markerGroupMap.get(a.id).updateLayout())},this)},e.prototype.renderSeries=function(r,n,i,a){var s=r.coordinateSystem,o=r.id,l=r.getData(),u=this.markerGroupMap,h=u.get(o)||u.set(o,new M8),d=AVr(s,r,n);n.setData(d),Rft(n.getData(),r,a),d.each(function(f){var p=d.getItemModel(f),g=p.getShallow("symbol"),m=p.getShallow("symbolSize"),v=p.getShallow("symbolRotate"),y=p.getShallow("symbolOffset"),b=p.getShallow("symbolKeepAspect");if(ur(g)||ur(m)||ur(v)||ur(y)){var x=n.getRawValue(f),w=n.getDataParams(f);ur(g)&&(g=g(x,w)),ur(m)&&(m=m(x,w)),ur(v)&&(v=v(x,w)),ur(y)&&(y=y(x,w))}var A=p.getModel("itemStyle").getItemStyle(),S=p.get("z2"),T=u8(l,"color");A.fill||(A.fill=T),d.setItemVisual(f,{z2:Jt(S,0),symbol:g,symbolSize:m,symbolRotate:v,symbolOffset:y,symbolKeepAspect:b,style:A})}),h.updateData(d),this.group.add(h.group),d.eachItemGraphicEl(function(f){f.traverse(function(p){Cr(p).dataModel=n})}),this.markKeep(h),h.group.silent=n.get("silent")||r.get("silent")},e.type="markPoint",e}(Cve);function AVr(t,e,r){var n;t?n=vt(t&&t.dimensions,function(o){var l=e.getData(),u=l.getDimensionInfo(l.mapDimension(o))||{};return ot(ot({},u),{name:o,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new zc(n,r),a=vt(r.get("data"),qr(bB,e));t&&(a=ni(a,qr(xB,t)));var s=_ft(!!t,n);return i.initData(a,null,s),i}function SVr(t){t.registerComponentModel(mVr),t.registerComponentView(wVr),t.registerPreprocessor(function(e){Ave(e.series,"markPoint")&&(e.markPoint=e.markPoint||{})})}var TVr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.createMarkerModelFromSeries=function(r,n,i){return new e(r,n,i)},e.type="markLine",e.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},e}(Hm),uq=Qr(),CVr=function(t,e,r,n){var i=t.getData(),a;if(ft(n))a=n;else{var s=n.type;if(s==="min"||s==="max"||s==="average"||s==="median"||n.xAxis!=null||n.yAxis!=null){var o=void 0,l=void 0;if(n.yAxis!=null||n.xAxis!=null)o=e.getAxis(n.yAxis!=null?"y":"x"),l=Pc(n.yAxis,n.xAxis);else{var u=Eft(n,i,e,t);o=u.valueAxis;var h=Bpe(i,u.valueDataDim);l=cq(i,h,s)}var d=o.dim==="x"?0:1,f=1-d,p=lr(n),g={coord:[]};p.type=null,p.coord=[],p.coord[f]=-1/0,g.coord[f]=1/0;var m=r.get("precision");m>=0&&zn(l)&&(l=+l.toFixed(Math.min(m,20))),p.coord[d]=g.coord[d]=l,a=[p,g,{type:s,valueIndex:n.valueIndex,value:l}]}else a=[]}var v=[bB(t,a[0]),bB(t,a[1]),ot({},a[2])];return v[2].type=v[2].type||null,Vr(v[2],v[0]),Vr(v[2],v[1]),v};function hq(t){return!isNaN(t)&&!isFinite(t)}function Dft(t,e,r,n){var i=1-t,a=n.dimensions[t];return hq(e[i])&&hq(r[i])&&e[t]===r[t]&&n.getAxis(a).containData(e[t])}function OVr(t,e){if(t.type==="cartesian2d"){var r=e[0].coord,n=e[1].coord;if(r&&n&&(Dft(1,r,n,t)||Dft(0,r,n,t)))return!0}return xB(t,e[0])&&xB(t,e[1])}function Ove(t,e,r,n,i){var a=n.coordinateSystem,s=t.getItemModel(e),o,l=Qt(s.get("x"),i.getWidth()),u=Qt(s.get("y"),i.getHeight());if(!isNaN(l)&&!isNaN(u))o=[l,u];else{if(n.getMarkerPosition)o=n.getMarkerPosition(t.getValues(t.dimensions,e));else{var h=a.dimensions,d=t.get(h[0],e),f=t.get(h[1],e);o=a.dataToPoint([d,f])}if(NS(a,"cartesian2d")){var p=a.getAxis("x"),g=a.getAxis("y"),h=a.dimensions;hq(t.get(h[0],e))?o[0]=p.toGlobalCoord(p.getExtent()[r?0:1]):hq(t.get(h[1],e))&&(o[1]=g.toGlobalCoord(g.getExtent()[r?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}t.setItemLayout(e,o)}var kVr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.updateTransform=function(r,n,i){n.eachSeries(function(a){var s=Hm.getMarkerModelFromSeries(a,"markLine");if(s){var o=s.getData(),l=uq(s).from,u=uq(s).to;l.each(function(h){Ove(l,h,!0,a,i),Ove(u,h,!1,a,i)}),o.each(function(h){o.setItemLayout(h,[l.getItemLayout(h),u.getItemLayout(h)])}),this.markerGroupMap.get(a.id).updateLayout()}},this)},e.prototype.renderSeries=function(r,n,i,a){var s=r.coordinateSystem,o=r.id,l=r.getData(),u=this.markerGroupMap,h=u.get(o)||u.set(o,new zme);this.group.add(h.group);var d=EVr(s,r,n),f=d.from,p=d.to,g=d.line;uq(n).from=f,uq(n).to=p,n.setData(g);var m=n.get("symbol"),v=n.get("symbolSize"),y=n.get("symbolRotate"),b=n.get("symbolOffset");ft(m)||(m=[m,m]),ft(v)||(v=[v,v]),ft(y)||(y=[y,y]),ft(b)||(b=[b,b]),d.from.each(function(w){x(f,w,!0),x(p,w,!1)}),g.each(function(w){var A=g.getItemModel(w),S=A.getModel("lineStyle").getLineStyle();g.setItemLayout(w,[f.getItemLayout(w),p.getItemLayout(w)]);var T=A.get("z2");S.stroke==null&&(S.stroke=f.getItemVisual(w,"style").fill),g.setItemVisual(w,{z2:Jt(T,0),fromSymbolKeepAspect:f.getItemVisual(w,"symbolKeepAspect"),fromSymbolOffset:f.getItemVisual(w,"symbolOffset"),fromSymbolRotate:f.getItemVisual(w,"symbolRotate"),fromSymbolSize:f.getItemVisual(w,"symbolSize"),fromSymbol:f.getItemVisual(w,"symbol"),toSymbolKeepAspect:p.getItemVisual(w,"symbolKeepAspect"),toSymbolOffset:p.getItemVisual(w,"symbolOffset"),toSymbolRotate:p.getItemVisual(w,"symbolRotate"),toSymbolSize:p.getItemVisual(w,"symbolSize"),toSymbol:p.getItemVisual(w,"symbol"),style:S})}),h.updateData(g),d.line.eachItemGraphicEl(function(w){Cr(w).dataModel=n,w.traverse(function(A){Cr(A).dataModel=n})});function x(w,A,S){var T=w.getItemModel(A);Ove(w,A,S,r,a);var O=T.getModel("itemStyle").getItemStyle();O.fill==null&&(O.fill=u8(l,"color")),w.setItemVisual(A,{symbolKeepAspect:T.get("symbolKeepAspect"),symbolOffset:Jt(T.get("symbolOffset",!0),b[S?0:1]),symbolRotate:Jt(T.get("symbolRotate",!0),y[S?0:1]),symbolSize:Jt(T.get("symbolSize"),v[S?0:1]),symbol:Jt(T.get("symbol",!0),m[S?0:1]),style:O})}this.markKeep(h),h.group.silent=n.get("silent")||r.get("silent")},e.type="markLine",e}(Cve);function EVr(t,e,r){var n;t?n=vt(t&&t.dimensions,function(u){var h=e.getData(),d=h.getDimensionInfo(h.mapDimension(u))||{};return ot(ot({},d),{name:u,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new zc(n,r),a=new zc(n,r),s=new zc([],r),o=vt(r.get("data"),qr(CVr,e,t,r));t&&(o=ni(o,qr(OVr,t)));var l=_ft(!!t,n);return i.initData(vt(o,function(u){return u[0]}),null,l),a.initData(vt(o,function(u){return u[1]}),null,l),s.initData(vt(o,function(u){return u[2]})),s.hasItemOption=!0,{from:i,to:a,line:s}}function _Vr(t){t.registerComponentModel(TVr),t.registerComponentView(kVr),t.registerPreprocessor(function(e){Ave(e.series,"markLine")&&(e.markLine=e.markLine||{})})}var RVr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.createMarkerModelFromSeries=function(r,n,i){return new e(r,n,i)},e.type="markArea",e.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},e}(Hm),dq=Qr(),DVr=function(t,e,r,n){var i=n[0],a=n[1];if(!(!i||!a)){var s=bB(t,i),o=bB(t,a),l=s.coord,u=o.coord;l[0]=Pc(l[0],-1/0),l[1]=Pc(l[1],-1/0),u[0]=Pc(u[0],1/0),u[1]=Pc(u[1],1/0);var h=fG([{},s,o]);return h.coord=[s.coord,o.coord],h.x0=s.x,h.y0=s.y,h.x1=o.x,h.y1=o.y,h}};function fq(t){return!isNaN(t)&&!isFinite(t)}function Lft(t,e,r,n){var i=1-t;return fq(e[i])&&fq(r[i])}function LVr(t,e){var r=e.coord[0],n=e.coord[1],i={coord:r,x:e.x0,y:e.y0},a={coord:n,x:e.x1,y:e.y1};return NS(t,"cartesian2d")?r&&n&&(Lft(1,r,n)||Lft(0,r,n))?!0:bVr(t,i,a):xB(t,i)||xB(t,a)}function Mft(t,e,r,n,i){var a=n.coordinateSystem,s=t.getItemModel(e),o,l=Qt(s.get(r[0]),i.getWidth()),u=Qt(s.get(r[1]),i.getHeight());if(!isNaN(l)&&!isNaN(u))o=[l,u];else{if(n.getMarkerPosition){var h=t.getValues(["x0","y0"],e),d=t.getValues(["x1","y1"],e),f=a.clampData(h),p=a.clampData(d),g=[];r[0]==="x0"?g[0]=f[0]>p[0]?d[0]:h[0]:g[0]=f[0]>p[0]?h[0]:d[0],r[1]==="y0"?g[1]=f[1]>p[1]?d[1]:h[1]:g[1]=f[1]>p[1]?h[1]:d[1],o=n.getMarkerPosition(g,r,!0)}else{var m=t.get(r[0],e),v=t.get(r[1],e),y=[m,v];a.clampData&&a.clampData(y,y),o=a.dataToPoint(y,!0)}if(NS(a,"cartesian2d")){var b=a.getAxis("x"),x=a.getAxis("y"),m=t.get(r[0],e),v=t.get(r[1],e);fq(m)?o[0]=b.toGlobalCoord(b.getExtent()[r[0]==="x0"?0:1]):fq(v)&&(o[1]=x.toGlobalCoord(x.getExtent()[r[1]==="y0"?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}return o}var Ift=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],MVr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.updateTransform=function(r,n,i){n.eachSeries(function(a){var s=Hm.getMarkerModelFromSeries(a,"markArea");if(s){var o=s.getData();o.each(function(l){var u=vt(Ift,function(d){return Mft(o,l,d,a,i)});o.setItemLayout(l,u);var h=o.getItemGraphicEl(l);h.setShape("points",u)})}},this)},e.prototype.renderSeries=function(r,n,i,a){var s=r.coordinateSystem,o=r.id,l=r.getData(),u=this.markerGroupMap,h=u.get(o)||u.set(o,{group:new pr});this.group.add(h.group),this.markKeep(h);var d=IVr(s,r,n);n.setData(d),d.each(function(f){var p=vt(Ift,function(E){return Mft(d,f,E,r,a)}),g=s.getAxis("x").scale,m=s.getAxis("y").scale,v=g.getExtent(),y=m.getExtent(),b=[g.parse(d.get("x0",f)),g.parse(d.get("x1",f))],x=[m.parse(d.get("y0",f)),m.parse(d.get("y1",f))];xl(b),xl(x);var w=!(v[0]>b[1]||v[1]x[1]||y[1]=0},e.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",bottom:et.size.m,align:"auto",backgroundColor:et.color.transparent,borderColor:et.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:et.color.disabled,inactiveBorderColor:et.color.disabled,inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:et.color.disabled,inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:et.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:et.color.tertiary,borderWidth:1,borderColor:et.color.border},emphasis:{selectorLabel:{show:!0,color:et.color.quaternary}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},e}(fn),y5=qr,Eve=de,pq=pr,Pft=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.newlineDisabled=!1,r}return e.prototype.init=function(){this.group.add(this._contentGroup=new pq),this.group.add(this._selectorGroup=new pq),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(r,n,i){var a=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!r.get("show",!0)){var s=r.get("align"),o=r.get("orient");(!s||s==="auto")&&(s=r.get("left")==="right"&&o==="vertical"?"right":"left");var l=r.get("selector",!0),u=r.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=o==="horizontal"?"end":"start"),this.renderInner(s,r,n,i,l,o,u);var h=Co(r,i).refContainer,d=r.getBoxLayoutParams(),f=r.get("padding"),p=da(d,h,f),g=this.layoutInner(r,s,p,a,l,u),m=da(mr({width:g.width,height:g.height},d),h,f);this.group.x=m.x-g.x,this.group.y=m.y-g.y,this.group.markRedraw(),this.group.add(this._backgroundEl=Qdt(g,r))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(r,n,i,a,s,o,l){var u=this.getContentGroup(),h=Yt(),d=n.get("selectedMode"),f=n.get("triggerEvent"),p=[];i.eachRawSeries(function(g){!g.get("legendHoverLink")&&p.push(g.id)}),Eve(n.getData(),function(g,m){var v=this,y=g.get("name");if(!this.newlineDisabled&&(y===""||y===` +`)){var b=new pq;b.newline=!0,u.add(b);return}var x=i.getSeriesByName(y)[0];if(!h.get(y))if(x){var w=x.getData(),A=w.getVisual("legendLineStyle")||{},S=w.getVisual("legendIcon"),T=w.getVisual("style"),O=this._createItem(x,y,m,g,n,r,A,T,S,d,a);O.on("click",y5(Nft,y,null,a,p)).on("mouseover",y5(_ve,x.name,null,a,p)).on("mouseout",y5(Rve,x.name,null,a,p)),i.ssr&&O.eachChild(function(k){var E=Cr(k);E.seriesIndex=x.seriesIndex,E.dataIndex=m,E.ssrType="legend"}),f&&O.eachChild(function(k){v.packEventData(k,n,x,m,y)}),h.set(y,!0)}else i.eachRawSeries(function(k){var E=this;if(!h.get(y)&&k.legendVisualProvider){var _=k.legendVisualProvider;if(!_.containName(y))return;var I=_.indexOfName(y),L=_.getItemVisual(I,"style"),R=_.getItemVisual(I,"legendIcon"),D=Bc(L.fill);D&&D[3]===0&&(D[3]=.2,L=ot(ot({},L),{fill:Pf(D,"rgba")}));var M=this._createItem(k,y,m,g,n,r,{},L,R,d,a);M.on("click",y5(Nft,null,y,a,p)).on("mouseover",y5(_ve,null,y,a,p)).on("mouseout",y5(Rve,null,y,a,p)),i.ssr&&M.eachChild(function(P){var N=Cr(P);N.seriesIndex=k.seriesIndex,N.dataIndex=m,N.ssrType="legend"}),f&&M.eachChild(function(P){E.packEventData(P,n,k,m,y)}),h.set(y,!0)}},this)},this),s&&this._createSelector(s,n,a,o,l)},e.prototype.packEventData=function(r,n,i,a,s){var o={componentType:"legend",componentIndex:n.componentIndex,dataIndex:a,value:s,seriesIndex:i.seriesIndex};Cr(r).eventData=o},e.prototype._createSelector=function(r,n,i,a,s){var o=this.getSelectorGroup();Eve(r,function(u){var h=u.type,d=new Pn({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:h==="all"?"legendAllSelect":"legendInverseSelect",legendId:n.id})}});o.add(d);var f=n.getModel("selectorLabel"),p=n.getModel(["emphasis","selectorLabel"]);qo(d,{normal:f,emphasis:p},{defaultText:u.title}),vx(d)})},e.prototype._createItem=function(r,n,i,a,s,o,l,u,h,d,f){var p=r.visualDrawType,g=s.get("itemWidth"),m=s.get("itemHeight"),v=s.isSelected(n),y=a.get("symbolRotate"),b=a.get("symbolKeepAspect"),x=a.get("icon");h=x||h||"roundRect";var w=BVr(h,a,l,u,p,v,f),A=new pq,S=a.getModel("textStyle");if(ur(r.getLegendIcon)&&(!x||x==="inherit"))A.add(r.getLegendIcon({itemWidth:g,itemHeight:m,icon:h,iconRotate:y,itemStyle:w.itemStyle,lineStyle:w.lineStyle,symbolKeepAspect:b}));else{var T=x==="inherit"&&r.getData().getVisual("symbol")?y==="inherit"?r.getData().getVisual("symbolRotate"):y:0;A.add($Vr({itemWidth:g,itemHeight:m,icon:h,iconRotate:T,itemStyle:w.itemStyle,symbolKeepAspect:b}))}var O=o==="left"?g+5:-5,k=o,E=s.get("formatter"),_=n;Nt(E)&&E?_=E.replace("{name}",n??""):ur(E)&&(_=E(n));var I=v?S.getTextColor():a.get("inactiveColor");A.add(new Pn({style:Gi(S,{text:_,x:O,y:m/2,fill:I,align:k,verticalAlign:"middle"},{inheritColor:I})}));var L=new tn({shape:A.getBoundingRect(),style:{fill:"transparent"}}),R=a.getModel("tooltip");return R.get("show")&&uy({el:L,componentModel:s,itemName:n,itemTooltipOption:R.option}),A.add(L),A.eachChild(function(D){D.silent=!0}),L.silent=!d,this.getContentGroup().add(A),vx(A),A.__legendDataIndex=i,A},e.prototype.layoutInner=function(r,n,i,a,s,o){var l=this.getContentGroup(),u=this.getSelectorGroup();hS(r.get("orient"),l,r.get("itemGap"),i.width,i.height);var h=l.getBoundingRect(),d=[-h.x,-h.y];if(u.markRedraw(),l.markRedraw(),s){hS("horizontal",u,r.get("selectorItemGap",!0));var f=u.getBoundingRect(),p=[-f.x,-f.y],g=r.get("selectorButtonGap",!0),m=r.getOrient().index,v=m===0?"width":"height",y=m===0?"height":"width",b=m===0?"y":"x";o==="end"?p[m]+=h[v]+g:d[m]+=f[v]+g,p[1-m]+=h[y]/2-f[y]/2,u.x=p[0],u.y=p[1],l.x=d[0],l.y=d[1];var x={x:0,y:0};return x[v]=h[v]+g+f[v],x[y]=Math.max(h[y],f[y]),x[b]=Math.min(0,f[b]+p[1-m]),x}else return l.x=d[0],l.y=d[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(Hi);function BVr(t,e,r,n,i,a,s){function o(v,y){v.lineWidth==="auto"&&(v.lineWidth=y.lineWidth>0?2:0),Eve(v,function(b,x){v[x]==="inherit"&&(v[x]=y[x])})}var l=e.getModel("itemStyle"),u=l.getItemStyle(),h=t.lastIndexOf("empty",0)===0?"fill":"stroke",d=l.getShallow("decal");u.decal=!d||d==="inherit"?n.decal:B_(d,s),u.fill==="inherit"&&(u.fill=n[i]),u.stroke==="inherit"&&(u.stroke=n[h]),u.opacity==="inherit"&&(u.opacity=(i==="fill"?n:r).opacity),o(u,n);var f=e.getModel("lineStyle"),p=f.getLineStyle();if(o(p,r),u.fill==="auto"&&(u.fill=n.fill),u.stroke==="auto"&&(u.stroke=n.fill),p.stroke==="auto"&&(p.stroke=n.fill),!a){var g=e.get("inactiveBorderWidth"),m=u[h];u.lineWidth=g==="auto"?n.lineWidth>0&&m?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),p.stroke=f.get("inactiveColor"),p.lineWidth=f.get("inactiveWidth")}return{itemStyle:u,lineStyle:p}}function $Vr(t){var e=t.icon||"roundRect",r=$s(e,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill,t.symbolKeepAspect);return r.setStyle(t.itemStyle),r.rotation=(t.iconRotate||0)*Math.PI/180,r.setOrigin([t.itemWidth/2,t.itemHeight/2]),e.indexOf("empty")>-1&&(r.style.stroke=r.style.fill,r.style.fill=et.color.neutral00,r.style.lineWidth=2),r}function Nft(t,e,r,n){Rve(t,e,r,n),r.dispatchAction({type:"legendToggleSelect",name:t??e}),_ve(t,e,r,n)}function _ve(t,e,r,n){r.usingTHL()||r.dispatchAction({type:"highlight",seriesName:t,name:e,excludeSeriesId:n})}function Rve(t,e,r,n){r.usingTHL()||r.dispatchAction({type:"downplay",seriesName:t,name:e,excludeSeriesId:n})}function wB(t,e,r){var n=t==="allSelect"||t==="inverseSelect",i={},a=[];r.eachComponent({mainType:"legend",query:e},function(o){n?o[t]():o[t](e.name),Bft(o,i),a.push(o.componentIndex)});var s={};return r.eachComponent("legend",function(o){de(i,function(l,u){o[l?"select":"unSelect"](u)}),Bft(o,s)}),n?{selected:s,legendIndex:a}:{name:e.name,selected:s}}function Bft(t,e){var r=e||{};return de(t.getData(),function(n){var i=n.get("name");if(!(i===` +`||i==="")){var a=t.isSelected(i);Kt(r,i)?r[i]=r[i]&&a:r[i]=a}}),r}function FVr(t){t.registerAction("legendToggleSelect","legendselectchanged",qr(wB,"toggleSelected")),t.registerAction("legendAllSelect","legendselectall",qr(wB,"allSelect")),t.registerAction("legendInverseSelect","legendinverseselect",qr(wB,"inverseSelect")),t.registerAction("legendSelect","legendselected",qr(wB,"select")),t.registerAction("legendUnSelect","legendunselected",qr(wB,"unSelect"))}var zVr=LN(UVr);function UVr(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.filterSeries(function(r){for(var n=0;ni[s],v=[-p.x,-p.y];n||(v[a]=h[u]);var y=[0,0],b=[-g.x,-g.y],x=Jt(r.get("pageButtonGap",!0),r.get("itemGap",!0));if(m){var w=r.get("pageButtonPosition",!0);w==="end"?b[a]+=i[s]-g[s]:y[a]+=g[s]+x}b[1-a]+=p[o]/2-g[o]/2,h.setPosition(v),d.setPosition(y),f.setPosition(b);var A={x:0,y:0};if(A[s]=m?i[s]:p[s],A[o]=Math.max(p[o],g[o]),A[l]=Math.min(0,g[l]+b[1-a]),d.__rectSize=i[s],m){var S={x:0,y:0};S[s]=Math.max(i[s]-g[s]-x,0),S[o]=A[o],d.setClipPath(new tn({shape:S})),d.__rectSize=S[s]}else f.eachChild(function(O){O.attr({invisible:!0,silent:!0})});var T=this._getPageInfo(r);return T.pageIndex!=null&&Hn(h,{x:T.contentPosition[0],y:T.contentPosition[1]},m?r:null),this._updatePageInfoView(r,T),A},e.prototype._pageGo=function(r,n,i){var a=this._getPageInfo(n)[r];a!=null&&i.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:n.id})},e.prototype._updatePageInfoView=function(r,n){var i=this._controllerGroup;de(["pagePrev","pageNext"],function(h){var d=h+"DataIndex",f=n[d]!=null,p=i.childOfName(h);p&&(p.setStyle("fill",f?r.get("pageIconColor",!0):r.get("pageIconInactiveColor",!0)),p.cursor=f?"pointer":"default")});var a=i.childOfName("pageText"),s=r.get("pageFormatter"),o=n.pageIndex,l=o!=null?o+1:0,u=n.pageCount;a&&s&&a.setStyle("text",Nt(s)?s.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):s({current:l,total:u}))},e.prototype._getPageInfo=function(r){var n=r.get("scrollDataIndex",!0),i=this.getContentGroup(),a=this._containerGroup.__rectSize,s=r.getOrient().index,o=Dve[s],l=Lve[s],u=this._findTargetItemIndex(n),h=i.children(),d=h[u],f=h.length,p=f?1:0,g={contentPosition:[i.x,i.y],pageCount:p,pageIndex:p-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!d)return g;var m=w(d);g.contentPosition[s]=-m.s;for(var v=u+1,y=m,b=m,x=null;v<=f;++v)x=w(h[v]),(!x&&b.e>y.s+a||x&&!A(x,y.s))&&(b.i>y.i?y=b:y=x,y&&(g.pageNextDataIndex==null&&(g.pageNextDataIndex=y.i),++g.pageCount)),b=x;for(var v=u-1,y=m,b=m,x=null;v>=-1;--v)x=w(h[v]),(!x||!A(b,x.s))&&y.i=T&&S.s<=T+a}},e.prototype._findTargetItemIndex=function(r){if(!this._showController)return 0;var n,i=this.getContentGroup(),a;return i.eachChild(function(s,o){var l=s.__legendDataIndex;a==null&&l!=null&&(a=o),l===r&&(n=o)}),n??a},e.type="legend.scroll",e}(Pft);function GVr(t){t.registerAction("legendScroll","legendscroll",function(e,r){var n=e.scrollDataIndex;n!=null&&r.eachComponent({mainType:"legend",subType:"scroll",query:e},function(i){i.setScrollDataIndex(n)})})}function HVr(t){Yr($ft),t.registerComponentModel(VVr),t.registerComponentView(QVr),GVr(t)}function WVr(t){Yr($ft),Yr(HVr)}var YVr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="dataZoom.inside",e.defaultOption=xx(mB.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(mB),Mve=Qr();function qVr(t,e,r){Mve(t).coordSysRecordMap.each(function(n){var i=n.dataZoomInfoMap.get(e.uid);i&&(i.getRange=r)})}function jVr(t,e){for(var r=Mve(t).coordSysRecordMap,n=r.keys(),i=0;ia[i+n]&&(n=d),s=s&&h.get("preventDefaultMouseMove",!0),o=Jt(h.get("cursorGrab",!0),o),l=Jt(h.get("cursorGrabbing",!0),l)}),{controlType:n,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!s,api:r,zInfo:{component:e.model},triggerInfo:{roamTrigger:null,isInSelf:e.containsPoint},cursorGrab:o,cursorGrabbing:l}}}function eQr(t){t.registerUpdateLifecycle("coordsys:aftercreate",function(e,r){var n=Mve(r),i=n.coordSysRecordMap||(n.coordSysRecordMap=Yt());i.each(function(a){a.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var s=Bdt(a);de(s.infoList,function(o){var l=o.model.uid,u=i.get(l)||i.set(l,XVr(r,o.model)),h=u.dataZoomInfoMap||(u.dataZoomInfoMap=Yt());h.set(a.uid,{dzReferCoordSysInfo:o,model:a,getRange:null})})}),i.each(function(a){var s=a.controller,o,l=a.dataZoomInfoMap;if(l){var u=l.keys()[0];u!=null&&(o=l.get(u))}if(!o){Uft(i,a);return}var h=JVr(l,a,r);s.enable(h.controlType,h.opt),D_(a,"dispatchAction",o.model.get("throttle",!0),"fixRate")})})}var tQr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataZoom.inside",r}return e.prototype.render=function(r,n,i){if(t.prototype.render.apply(this,arguments),r.noTarget()){this._clear();return}this.range=r.getPercentRange(),qVr(i,r,{pan:Ht(Ive.pan,this),zoom:Ht(Ive.zoom,this),scrollMove:Ht(Ive.scrollMove,this)})},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){jVr(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(lve),Ive={zoom:function(t,e,r,n){var i=this.range,a=i.slice(),s=t.axisModels[0];if(s){var o=Pve[e](null,[n.originX,n.originY],s,r,t),l=(o.signal>0?o.pixelStart+o.pixelLength-o.pixel:o.pixel-o.pixelStart)/o.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/n.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var h=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(Ix(0,a,[0,100],0,h.minSpan,h.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:Vft(function(t,e,r,n,i,a){var s=Pve[n]([a.oldX,a.oldY],[a.newX,a.newY],e,i,r);return s.signal*(t[1]-t[0])*s.pixel/s.pixelLength}),scrollMove:Vft(function(t,e,r,n,i,a){var s=Pve[n]([0,0],[a.scrollDelta,a.scrollDelta],e,i,r);return s.signal*(t[1]-t[0])*a.scrollDelta})};function Vft(t){return function(e,r,n,i){var a=this.range,s=a.slice(),o=e.axisModels[0];if(o){var l=t(s,o,e,r,n,i);if(Ix(l,s,[0,100],"all"),this.range=s,a[0]!==s[0]||a[1]!==s[1])return s}}}var Pve={grid:function(t,e,r,n,i){var a=r.axis,s={},o=i.model.coordinateSystem.getRect();return t=t||[0,0],a.dim==="x"?(s.pixel=e[0]-t[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s},polar:function(t,e,r,n,i){var a=r.axis,s={},o=i.model.coordinateSystem,l=o.getRadiusAxis().getExtent(),u=o.getAngleAxis().getExtent();return t=t?o.pointToCoord(t):[0,0],e=o.pointToCoord(e),r.mainType==="radiusAxis"?(s.pixel=e[0]-t[0],s.pixelLength=l[1]-l[0],s.pixelStart=l[0],s.signal=a.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=u[1]-u[0],s.pixelStart=u[0],s.signal=a.inverse?-1:1),s},singleAxis:function(t,e,r,n,i){var a=r.axis,s=i.model.coordinateSystem.getRect(),o={};return t=t||[0,0],a.orient==="horizontal"?(o.pixel=e[0]-t[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=e[1]-t[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o}};function Qft(t){cve(t),t.registerComponentModel(YVr),t.registerComponentView(tQr),eQr(t)}var rQr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=xx(mB.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:et.color.accent10,borderRadius:0,backgroundColor:et.color.transparent,dataBackground:{lineStyle:{color:et.color.accent30,width:.5},areaStyle:{color:et.color.accent20,opacity:.2}},selectedDataBackground:{lineStyle:{color:et.color.accent40,width:.5},areaStyle:{color:et.color.accent20,opacity:.3}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:et.color.neutral00,borderColor:et.color.accent20},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:et.color.accent40,opacity:.5},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:et.color.tertiary},brushSelect:!0,brushStyle:{color:et.color.accent30,opacity:.3},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:et.color.accent40},moveHandleStyle:{opacity:.8}},defaultLocationEdgeGap:15}),e}(mB),AB=tn,nQr=1,Nve=30,iQr=7,SB="horizontal",Gft="vertical",aQr=5,sQr=["line","bar","candlestick","scatter"],oQr={easing:"cubicOut",duration:100,delay:0},lQr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r._displayables={},r}return e.prototype.init=function(r,n){this.api=n,this._onBrush=Ht(this._onBrush,this),this._onBrushEnd=Ht(this._onBrushEnd,this)},e.prototype.render=function(r,n,i,a){if(t.prototype.render.apply(this,arguments),D_(this,"_dispatchZoomAction",r.get("throttle"),"fixRate"),this._orient=r.getOrient(),r.get("show")===!1){this.group.removeAll();return}if(r.noTarget()){this._clear(),this.group.removeAll();return}(!a||a.type!=="dataZoom"||a.from!==this.uid)&&this._buildView(),this._updateView()},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){s8(this,"_dispatchZoomAction");var r=this.api.getZr();r.off("mousemove",this._onBrush),r.off("mouseup",this._onBrushEnd)},e.prototype._buildView=function(){var r=this.group;r.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var n=this._displayables.sliderGroup=new pr;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),r.add(n),this._positionGroup()},e.prototype._resetLocation=function(){var r=this.dataZoomModel,n=this.api,i=r.get("brushSelect"),a=i?iQr:0,s=Co(r,n).refContainer,o=this._findCoordRect(),l=r.get("defaultLocationEdgeGap",!0)||0,u=this._orient===SB?{right:s.width-o.x-o.width,top:s.height-Nve-l-a,width:o.width,height:Nve}:{right:l,top:o.y,width:Nve,height:o.height},h=dS(r.option);de(["right","top","width","height"],function(f){h[f]==="ph"&&(h[f]=u[f])});var d=da(h,s);this._location={x:d.x,y:d.y},this._size=[d.width,d.height],this._orient===Gft&&this._size.reverse()},e.prototype._positionGroup=function(){var r=this.group,n=this._location,i=this._orient,a=this.dataZoomModel.getFirstTargetAxisModel(),s=a&&a.get("inverse"),o=this._displayables.sliderGroup,l=(this._dataShadowInfo||{}).otherAxisInverse;o.attr(i===SB&&!s?{scaleY:l?1:-1,scaleX:1}:i===SB&&s?{scaleY:l?1:-1,scaleX:-1}:i===Gft&&!s?{scaleY:l?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:l?-1:1,scaleX:-1,rotation:Math.PI/2});var u=r.getBoundingRect([o]),h=isNaN(u.x)?0:u.x,d=isNaN(u.y)?0:u.y;r.x=n.x-h,r.y=n.y-d,r.markRedraw()},e.prototype._getViewExtent=function(){return[0,this._size[0]]},e.prototype._renderBackground=function(){var r=this.dataZoomModel,n=this._size,i=this._displayables.sliderGroup,a=r.get("brushSelect");i.add(new AB({silent:!0,shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:r.get("backgroundColor")},z2:-40}));var s=new AB({shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:"transparent"},z2:0,onclick:Ht(this._onClickPanel,this)}),o=this.api.getZr();a?(s.on("mousedown",this._onBrushStart,this),s.cursor="crosshair",o.on("mousemove",this._onBrush),o.on("mouseup",this._onBrushEnd)):(o.off("mousemove",this._onBrush),o.off("mouseup",this._onBrushEnd)),i.add(s)},e.prototype._renderDataShadow=function(){var r=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!r)return;var n=this._size,i=this._shadowSize||[],a=r.series,s=a.getRawData(),o=a.getShadowDim&&a.getShadowDim(),l=o&&s.getDimensionInfo(o)?a.getShadowDim():r.otherDim;if(l==null)return;var u=this._shadowPolygonPts,h=this._shadowPolylinePts;if(s!==this._shadowData||l!==this._shadowDim||n[0]!==i[0]||n[1]!==i[1]){var d=s.getDataExtent(r.thisDim),f=s.getDataExtent(l),p=(f[1]-f[0])*.3;f=[f[0]-p,f[1]+p];var g=[0,n[1]],m=[0,n[0]],v=[[n[0],0],[0,0]],y=[],b=m[1]/Math.max(1,s.count()-1),x=n[0]/(d[1]-d[0]),w=r.thisAxis.type==="time",A=-b,S=Math.round(s.count()/n[0]),T;s.each([r.thisDim,l],function(I,L,R){if(S>0&&R%S){w||(A+=b);return}A=w?(+I-d[0])*x:A+b;var D=L==null||isNaN(L)||L==="",M=D?0:jn(L,f,g,!0);D&&!T&&R?(v.push([v[v.length-1][0],0]),y.push([y[y.length-1][0],0])):!D&&T&&(v.push([A,0]),y.push([A,0])),D||(v.push([A,M]),y.push([A,M])),T=D}),u=this._shadowPolygonPts=v,h=this._shadowPolylinePts=y}this._shadowData=s,this._shadowDim=l,this._shadowSize=[n[0],n[1]];var O=this.dataZoomModel;function k(I){var L=O.getModel(I?"selectedDataBackground":"dataBackground"),R=new pr,D=new ic({shape:{points:u},segmentIgnoreThreshold:1,style:L.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),M=new Al({shape:{points:h},segmentIgnoreThreshold:1,style:L.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return R.add(D),R.add(M),R}for(var E=0;E<3;E++){var _=k(E===1);this._displayables.sliderGroup.add(_),this._displayables.dataShadowSegs.push(_)}},e.prototype._prepareDataShadowInfo=function(){var r=this.dataZoomModel,n=r.get("showDataShadow");if(n!==!1){var i,a=this.ecModel;return r.eachTargetAxis(function(s,o){var l=r.getAxisProxy(s,o).getTargetSeriesModels();de(l,function(u){if(!i&&!(n!==!0&&Ir(sQr,u.get("type"))<0)){var h=a.getComponent(zx(s),o).axis,d=cQr(s),f,p=u.coordinateSystem;d!=null&&p.getOtherAxis&&(f=p.getOtherAxis(h).inverse),d=u.getData().mapDimension(d);var g=u.getData().mapDimension(s);i={thisAxis:h,series:u,thisDim:g,otherDim:d,otherAxisInverse:f}}},this)},this),i}},e.prototype._renderHandle=function(){var r=this.group,n=this._displayables,i=n.handles=[null,null],a=n.handleLabels=[null,null],s=this._displayables.sliderGroup,o=this._size,l=this.dataZoomModel,u=this.api,h=l.get("borderRadius")||0,d=l.get("brushSelect"),f=n.filler=new AB({silent:d,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});s.add(f),s.add(new AB({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:o[0],height:o[1],r:h},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:nQr,fill:et.color.transparent}})),de([0,1],function(x){var w=l.get("handleIcon");!nW[w]&&w.indexOf("path://")<0&&w.indexOf("image://")<0&&(w="path://"+w);var A=$s(w,-1,0,2,2,null,!0);A.attr({cursor:uQr(this._orient),draggable:!0,drift:Ht(this._onDragMove,this,x),ondragend:Ht(this._onDragEnd,this),onmouseover:Ht(this._onOverDataInfoTriggerArea,this,!0),onmouseout:Ht(this._onOverDataInfoTriggerArea,this,!1),z2:5});var S=A.getBoundingRect(),T=l.get("handleSize");this._handleHeight=Qt(T,this._size[1]),this._handleWidth=S.width/S.height*this._handleHeight,A.setStyle(l.getModel("handleStyle").getItemStyle()),A.style.strokeNoScale=!0,A.rectHover=!0,A.ensureState("emphasis").style=l.getModel(["emphasis","handleStyle"]).getItemStyle(),vx(A);var O=l.get("handleColor");O!=null&&(A.style.fill=O),s.add(i[x]=A);var k=l.getModel("textStyle"),E=l.get("handleLabel")||{},_=E.show||!1;r.add(a[x]=new Pn({silent:!0,invisible:!_,style:Gi(k,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:k.getTextColor(),font:k.getFont()}),z2:10}))},this);var p=f;if(d){var g=Qt(l.get("moveHandleSize"),o[1]),m=n.moveHandle=new tn({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:o[1]-.5,height:g}}),v=g*.8,y=n.moveHandleIcon=$s(l.get("moveHandleIcon"),-v/2,-v/2,v,v,et.color.neutral00,!0);y.silent=!0,y.y=o[1]+g/2-.5,m.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var b=Math.min(o[1]/2,Math.max(g,10));p=n.moveZone=new tn({invisible:!0,shape:{y:o[1]-b,height:g+b}}),p.on("mouseover",function(){u.enterEmphasis(m)}).on("mouseout",function(){u.leaveEmphasis(m)}),s.add(m),s.add(y),s.add(p)}p.attr({draggable:!0,cursor:"grab",drift:Ht(this._onActualMoveZoneDrift,this),ondragstart:Ht(this._onActualMoveZoneDragStart,this),ondragend:Ht(this._onActualMoveZoneDragEnd,this),onmouseover:Ht(this._onOverDataInfoTriggerArea,this,!0),onmouseout:Ht(this._onOverDataInfoTriggerArea,this,!1)})},e.prototype._resetInterval=function(){var r=this._range=this.dataZoomModel.getPercentRange(),n=this._getViewExtent();this._handleEnds=[jn(r[0],[0,100],n,!0),jn(r[1],[0,100],n,!0)]},e.prototype._updateInterval=function(r,n){var i=this.dataZoomModel,a=this._handleEnds,s=this._getViewExtent(),o=i.findRepresentativeAxisProxy().getMinMaxSpan(),l=[0,100];Ix(n,a,s,i.get("zoomLock")?"all":r,o.minSpan!=null?jn(o.minSpan,l,s,!0):null,o.maxSpan!=null?jn(o.maxSpan,l,s,!0):null);var u=this._range,h=this._range=xl([jn(a[0],s,l,!0),jn(a[1],s,l,!0)]);return!u||u[0]!==h[0]||u[1]!==h[1]},e.prototype._updateView=function(r){var n=this._displayables,i=this._handleEnds,a=xl(i.slice()),s=this._size;de([0,1],function(p){var g=n.handles[p],m=this._handleHeight;g.attr({scaleX:m/2,scaleY:m/2,x:i[p]+(p?-1:1),y:s[1]/2-m/2})},this),n.filler.setShape({x:a[0],y:0,width:a[1]-a[0],height:s[1]});var o={x:a[0],width:a[1]-a[0]};n.moveHandle&&(n.moveHandle.setShape(o),n.moveZone.setShape(o),n.moveZone.getBoundingRect(),n.moveHandleIcon&&n.moveHandleIcon.attr("x",o.x+o.width/2));for(var l=n.dataShadowSegs,u=[0,a[0],a[1],s[0]],h=0;hn[0]||i[1]<0||i[1]>n[1])){var a=this._handleEnds,s=(a[0]+a[1])/2,o=this._updateInterval("all",i[0]-s);this._updateView(),o&&this._dispatchZoomAction(!1)}},e.prototype._onBrushStart=function(r){var n=r.offsetX,i=r.offsetY;this._brushStart=new wr(n,i),this._brushing=!0,this._brushStartTime=+new Date},e.prototype._onBrushEnd=function(r){if(this._brushing){var n=this._displayables.brushRect;if(this._brushing=!1,!!n){n.attr("ignore",!0);var i=n.shape,a=+new Date;if(!(a-this._brushStartTime<200&&Math.abs(i.width)<5)){var s=this._getViewExtent(),o=[0,100],l=this._handleEnds=[i.x,i.x+i.width],u=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();Ix(0,l,s,0,u.minSpan!=null?jn(u.minSpan,o,s,!0):null,u.maxSpan!=null?jn(u.maxSpan,o,s,!0):null),this._range=xl([jn(l[0],s,o,!0),jn(l[1],s,o,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(r){this._brushing&&(Kv(r.event),this._updateBrushRect(r.offsetX,r.offsetY))},e.prototype._updateBrushRect=function(r,n){var i=this._displayables,a=this.dataZoomModel,s=i.brushRect;s||(s=i.brushRect=new AB({silent:!0,style:a.getModel("brushStyle").getItemStyle()}),i.sliderGroup.add(s)),s.attr("ignore",!1);var o=this._brushStart,l=this._displayables.sliderGroup,u=l.transformCoordToLocal(r,n),h=l.transformCoordToLocal(o.x,o.y),d=this._size;u[0]=Math.max(Math.min(d[0],u[0]),0),s.setShape({x:h[0],y:0,width:u[0]-h[0],height:d[1]})},e.prototype._dispatchZoomAction=function(r){var n=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:r?oQr:null,start:n[0],end:n[1]})},e.prototype._findCoordRect=function(){var r,n=Bdt(this.dataZoomModel).infoList;if(!r&&n.length){var i=n[0].model.coordinateSystem;r=i.getRect&&i.getRect()}if(!r){var a=this.api.getWidth(),s=this.api.getHeight();r={x:a*.2,y:s*.2,width:a*.6,height:s*.6}}return r},e.type="dataZoom.slider",e}(lve);function Hft(t,e,r,n){var i=t.get("labelFormatter"),a=t.get("labelPrecision");(a==null||a==="auto")&&(a=r.valuePrecision);var s=r.value[e],o=s==null||isNaN(s)?"":Uc(n)||b8(n)?n.getLabel({value:Math.round(s)}):isFinite(a)?Gn(s,a,!0):s+"";return ur(i)?i(s,o):Nt(i)?i.replace("{value}",o):o}function cQr(t){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[t]}function uQr(t){return t==="vertical"?"ns-resize":"ew-resize"}function Wft(t){t.registerComponentModel(rQr),t.registerComponentView(lQr),cve(t)}function hQr(t){Yr(Qft),Yr(Wft)}var Yft={get:function(t,e,r){var n=lr((dQr[t]||{})[e]);return r&&ft(n)?n[n.length-1]:n}},dQr={color:{active:["#006edd","#e0ffff"],inactive:[et.color.transparent]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},qft=Xo.mapVisual,fQr=Xo.eachVisual,pQr=ft,Bve=de,gQr=xl,mQr=jn,gq=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.stateList=["inRange","outOfRange"],r.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],r.layoutMode={type:"box",ignoreSize:!0},r.dataBound=[-1/0,1/0],r.targetVisuals={},r.controllerVisuals={},r}return e.prototype.init=function(r,n,i){this.mergeDefaultAndTheme(r,i)},e.prototype.optionUpdated=function(r,n){var i=this.option;!n&&pft(i,r,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},e.prototype.resetVisual=function(r){var n=this.stateList;r=Ht(r,this),this.controllerVisuals=yve(this.option.controller,n,r),this.targetVisuals=yve(this.option.target,n,r)},e.prototype.getItemSymbol=function(){return null},e.prototype.getTargetSeriesIndices=function(){var r=this,n=this.option.seriesTargets;if(n){var i=[];return Bve(n,function(l){if(l.seriesIndex!=null)i.push(l.seriesIndex);else if(l.seriesId!=null){var u;r.ecModel.eachSeries(function(h){h.id===l.seriesId&&(u=h)}),u&&i.push(u.componentIndex)}}),i}var a=this.option.seriesId,s=this.option.seriesIndex;s==null&&a==null&&(s="all");var o=i_(this.ecModel,"series",{index:s,id:a},{useDefault:!1,enableAll:!0,enableNone:!1}).models;return vt(o,function(l){return l.componentIndex})},e.prototype.eachTargetSeries=function(r,n){de(this.getTargetSeriesIndices(),function(i){var a=this.ecModel.getSeriesByIndex(i);a&&r.call(n,a)},this)},e.prototype.isTargetSeries=function(r){var n=!1;return this.eachTargetSeries(function(i){i===r&&(n=!0)}),n},e.prototype.formatValueText=function(r,n,i){var a=this.option,s=a.precision,o=this.dataBound,l=a.formatter,u;i=i||["<",">"],ft(r)&&(r=r.slice(),u=!0);var h=n?r:u?[d(r[0]),d(r[1])]:d(r);if(Nt(l))return l.replace("{value}",u?h[0]:h).replace("{value2}",u?h[1]:h);if(ur(l))return u?l(r[0],r[1]):l(r);if(u)return r[0]===o[0]?i[0]+" "+h[1]:r[1]===o[1]?i[1]+" "+h[0]:h[0]+" - "+h[1];return h;function d(f){return f===o[0]?"min":f===o[1]?"max":(+f).toFixed(Math.min(s,20))}},e.prototype.resetExtent=function(){var r=this.option,n=gQr([r.min,r.max]);this._dataExtent=n},e.prototype.getDimension=function(r){var n=this,i=this.option.seriesTargets;if(i){var a=Wv(i,function(s){return s.seriesIndex!=null&&s.seriesIndex===r||s.seriesId!=null&&s.seriesId===n.ecModel.getSeriesByIndex(r).id});if(a)return a.dimension}return this.option.dimension},e.prototype.getDataDimensionIndex=function(r){var n=r.hostModel.seriesIndex,i=this.getDimension(n);if(i!=null)return r.getDimensionIndex(i);for(var a=r.dimensions,s=a.length-1;s>=0;s--){var o=a[s],l=r.getDimensionInfo(o);if(!l.isCalculationCoord)return l.storeDimIndex}},e.prototype.getExtent=function(){return this._dataExtent.slice()},e.prototype.completeVisualOption=function(){var r=this.ecModel,n=this.option,i={inRange:n.inRange,outOfRange:n.outOfRange},a=n.target||(n.target={}),s=n.controller||(n.controller={});Vr(a,i),Vr(s,i);var o=this.isCategory();l.call(this,a),l.call(this,s),u.call(this,a,"inRange","outOfRange"),h.call(this,s);function l(d){pQr(n.color)&&!d.inRange&&(d.inRange={color:n.color.slice().reverse()}),d.inRange=d.inRange||{color:r.get("gradientColor")}}function u(d,f,p){var g=d[f],m=d[p];g&&!m&&(m=d[p]={},Bve(g,function(v,y){if(Xo.isValidType(y)){var b=Yft.get(y,"inactive",o);b!=null&&(m[y]=b,y==="color"&&!m.hasOwnProperty("opacity")&&!m.hasOwnProperty("colorAlpha")&&(m.opacity=[0,0]))}}))}function h(d){var f=(d.inRange||{}).symbol||(d.outOfRange||{}).symbol,p=(d.inRange||{}).symbolSize||(d.outOfRange||{}).symbolSize,g=this.get("inactiveColor"),m=this.getItemSymbol(),v=m||"roundRect";Bve(this.stateList,function(y){var b=this.itemSize,x=d[y];x||(x=d[y]={color:o?g:[g]}),x.symbol==null&&(x.symbol=f&&lr(f)||(o?v:[v])),x.symbolSize==null&&(x.symbolSize=p&&lr(p)||(o?b[0]:[b[0],b[0]])),x.symbol=qft(x.symbol,function(S){return S==="none"?v:S});var w=x.symbolSize;if(w!=null){var A=-1/0;fQr(w,function(S){S>A&&(A=S)}),x.symbolSize=qft(w,function(S){return mQr(S,[0,A],[0,b[0]],!0)})}},this)}},e.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},e.prototype.isCategory=function(){return!!this.option.categories},e.prototype.setSelected=function(r){},e.prototype.getSelected=function(){return null},e.prototype.getValueState=function(r){return null},e.prototype.getVisualMeta=function(r){return null},e.type="visualMap",e.dependencies=["series"],e.defaultOption={show:!0,z:4,min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:et.color.transparent,borderColor:et.color.borderTint,contentColor:et.color.theme[0],inactiveColor:et.color.disabled,borderWidth:0,padding:et.size.m,textGap:10,precision:0,textStyle:{color:et.color.secondary}},e}(fn),jft=[20,140],vQr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.optionUpdated=function(r,n){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(i){i.mappingMethod="linear",i.dataExtent=this.getExtent()}),this._resetRange()},e.prototype.resetItemSize=function(){t.prototype.resetItemSize.apply(this,arguments);var r=this.itemSize;(r[0]==null||isNaN(r[0]))&&(r[0]=jft[0]),(r[1]==null||isNaN(r[1]))&&(r[1]=jft[1])},e.prototype._resetRange=function(){var r=this.getExtent(),n=this.option.range;!n||n.auto?(r.auto=1,this.option.range=r):ft(n)&&(n[0]>n[1]&&n.reverse(),n[0]=Math.max(n[0],r[0]),n[1]=Math.min(n[1],r[1]))},e.prototype.completeVisualOption=function(){t.prototype.completeVisualOption.apply(this,arguments),de(this.stateList,function(r){var n=this.option.controller[r].symbolSize;n&&n[0]!==n[1]&&(n[0]=n[1]/3)},this)},e.prototype.setSelected=function(r){this.option.range=r.slice(),this._resetRange()},e.prototype.getSelected=function(){var r=this.getExtent(),n=xl((this.get("range")||[]).slice());return n[0]>r[1]&&(n[0]=r[1]),n[1]>r[1]&&(n[1]=r[1]),n[0]=i[1]||r<=n[1])?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(r){var n=[];return this.eachTargetSeries(function(i){var a=[],s=i.getData();s.each(this.getDataDimensionIndex(s),function(o,l){r[0]<=o&&o<=r[1]&&a.push(l)},this),n.push({seriesId:i.id,dataIndex:a})},this),n},e.prototype.getVisualMeta=function(r){var n=Xft(this,"outOfRange",this.getExtent()),i=Xft(this,"inRange",this.option.range.slice()),a=[];function s(p,g){a.push({value:p,color:r(p,g)})}for(var o=0,l=0,u=i.length,h=n.length;lr[1])break;a.push({color:this.getControllerVisual(l,"color",n),offset:o/i})}return a.push({color:this.getControllerVisual(r[1],"color",n),offset:1}),a},e.prototype._createBarPoints=function(r,n){var i=this.visualMapModel.itemSize;return[[i[0]-n[0],r[0]],[i[0],r[0]],[i[0],r[1]],[i[0]-n[1],r[1]]]},e.prototype._createBarGroup=function(r){var n=this._orient,i=this.visualMapModel.get("inverse");return new pr(n==="horizontal"&&!i?{scaleX:r==="bottom"?1:-1,rotation:Math.PI/2}:n==="horizontal"&&i?{scaleX:r==="bottom"?-1:1,rotation:-Math.PI/2}:n==="vertical"&&!i?{scaleX:r==="left"?1:-1,scaleY:-1}:{scaleX:r==="left"?1:-1})},e.prototype._updateHandle=function(r,n){if(this._useHandle){var i=this._shapes,a=this.visualMapModel,s=i.handleThumbs,o=i.handleLabels,l=a.itemSize,u=a.getExtent(),h=this._applyTransform("left",i.mainGroup);yQr([0,1],function(d){var f=s[d];f.setStyle("fill",n.handlesColor[d]),f.y=r[d];var p=Wm(r[d],[0,l[1]],u,!0),g=this.getControllerVisual(p,"symbolSize");f.scaleX=f.scaleY=g/l[0],f.x=l[0]-g/2;var m=Wp(i.handleLabelPoints[d],iS(f,this.group));if(this._orient==="horizontal"){var v=h==="left"||h==="top"?(l[0]-g)/2:(l[0]-g)/-2;m[1]+=v}o[d].setStyle({x:m[0],y:m[1],text:a.formatValueText(this._dataInterval[d]),verticalAlign:"middle",align:this._orient==="vertical"?this._applyTransform("left",i.mainGroup):"center"})},this)}},e.prototype._showIndicator=function(r,n,i,a){var s=this.visualMapModel,o=s.getExtent(),l=s.itemSize,u=[0,l[1]],h=this._shapes,d=h.indicator;if(d){d.attr("invisible",!1);var f={convertOpacityToAlpha:!0},p=this.getControllerVisual(r,"color",f),g=this.getControllerVisual(r,"symbolSize"),m=Wm(r,o,u,!0),v=l[0]-g/2,y={x:d.x,y:d.y};d.y=m,d.x=v;var b=Wp(h.indicatorLabelPoint,iS(d,this.group)),x=h.indicatorLabel;x.attr("invisible",!1);var w=this._applyTransform("left",h.mainGroup),A=this._orient,S=A==="horizontal";x.setStyle({text:(i||"")+s.formatValueText(n),verticalAlign:S?w:"middle",align:S?"center":w});var T={x:v,y:m,style:{fill:p}},O={style:{x:b[0],y:b[1]}};if(s.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var k={duration:100,easing:"cubicInOut",additive:!0};d.x=y.x,d.y=y.y,d.animateTo(T,k),x.animateTo(O,k)}else d.attr(T),x.attr(O);this._firstShowIndicator=!1;var E=this._shapes.handleLabels;if(E)for(var _=0;_s[1]&&(d[1]=1/0),n&&(d[0]===-1/0?this._showIndicator(h,d[1],"< ",l):d[1]===1/0?this._showIndicator(h,d[0],"> ",l):this._showIndicator(h,h,"≈ ",l));var f=this._hoverLinkDataIndices,p=[];(n||rpt(i))&&(p=this._hoverLinkDataIndices=i.findTargetDataIndices(d));var g=SEr(f,p);this._dispatchHighDown("downplay",mq(g[0],i)),this._dispatchHighDown("highlight",mq(g[1],i))}},e.prototype._hoverLinkFromSeriesMouseOver=function(r){var n;if(bS(r.target,function(l){var u=Cr(l);if(u.dataIndex!=null)return n=u,!0},!0),!!n){var i=this.ecModel.getSeriesByIndex(n.seriesIndex),a=this.visualMapModel;if(a.isTargetSeries(i)){var s=i.getData(n.dataType),o=s.getStore().get(a.getDataDimensionIndex(s),n.dataIndex);isNaN(o)||this._showIndicator(o,o)}}},e.prototype._hideIndicator=function(){var r=this._shapes;r.indicator&&r.indicator.attr("invisible",!0),r.indicatorLabel&&r.indicatorLabel.attr("invisible",!0);var n=this._shapes.handleLabels;if(n)for(var i=0;i=0&&(a.dimension=s,n.push(a))}}),t.getData().setVisual("visualMeta",n)}}];function OQr(t,e,r,n){for(var i=e.targetVisuals[n],a=Xo.prepareVisualTypes(i),s={color:u8(t.getData(),"color")},o=0,l=a.length;o0:e.splitNumber>0)||e.calculable)?"continuous":"piecewise"}),t.registerAction(SQr,TQr),de(CQr,function(e){t.registerVisual(t.PRIORITY.VISUAL.COMPONENT,e)}),t.registerPreprocessor(kQr))}function opt(t){t.registerComponentModel(vQr),t.registerComponentView(wQr),spt(t)}var EQr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r._pieceList=[],r}return e.prototype.optionUpdated=function(r,n){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var i=this._mode=this._determineMode();this._pieceList=[],_Qr[this._mode].call(this,this._pieceList),this._resetSelected(r,n);var a=this.option.categories;this.resetVisual(function(s,o){i==="categories"?(s.mappingMethod="category",s.categories=lr(a)):(s.dataExtent=this.getExtent(),s.mappingMethod="piecewise",s.pieceList=vt(this._pieceList,function(l){return l=lr(l),o!=="inRange"&&(l.visual=null),l}))})},e.prototype.completeVisualOption=function(){var r=this.option,n={},i=Xo.listVisualTypes(),a=this.isCategory();de(r.pieces,function(o){de(i,function(l){o.hasOwnProperty(l)&&(n[l]=1)})}),de(n,function(o,l){var u=!1;de(this.stateList,function(h){u=u||s(r,h,l)||s(r.target,h,l)},this),!u&&de(this.stateList,function(h){(r[h]||(r[h]={}))[l]=Yft.get(l,h==="inRange"?"active":"inactive",a)})},this);function s(o,l,u){return o&&o[l]&&o[l].hasOwnProperty(u)}t.prototype.completeVisualOption.apply(this,arguments)},e.prototype._resetSelected=function(r,n){var i=this.option,a=this._pieceList,s=(n?i:r).selected||{};if(i.selected=s,de(a,function(l,u){var h=this.getSelectedMapKey(l);s.hasOwnProperty(h)||(s[h]=!0)},this),i.selectedMode==="single"){var o=!1;de(a,function(l,u){var h=this.getSelectedMapKey(l);s[h]&&(o?s[h]=!1:o=!0)},this)}},e.prototype.getItemSymbol=function(){return this.get("itemSymbol")},e.prototype.getSelectedMapKey=function(r){return this._mode==="categories"?r.value+"":r.index+""},e.prototype.getPieceList=function(){return this._pieceList},e.prototype._determineMode=function(){var r=this.option;return r.pieces&&r.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},e.prototype.setSelected=function(r){this.option.selected=lr(r)},e.prototype.getValueState=function(r){var n=Xo.findPieceIndex(r,this._pieceList);return n!=null&&this.option.selected[this.getSelectedMapKey(this._pieceList[n])]?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(r){var n=[],i=this._pieceList;return this.eachTargetSeries(function(a){var s=[],o=a.getData();o.each(this.getDataDimensionIndex(o),function(l,u){var h=Xo.findPieceIndex(l,i);h===r&&s.push(u)},this),n.push({seriesId:a.id,dataIndex:s})},this),n},e.prototype.getRepresentValue=function(r){var n;if(this.isCategory())n=r.value;else if(r.value!=null)n=r.value;else{var i=r.interval||[];n=i[0]===-1/0&&i[1]===1/0?0:(i[0]+i[1])/2}return n},e.prototype.getVisualMeta=function(r){if(this.isCategory())return;var n=[],i=["",""],a=this;function s(h,d){var f=a.getRepresentValue({interval:h});d||(d=a.getValueState(f));var p=r(f,d);h[0]===-1/0?i[0]=p:h[1]===1/0?i[1]=p:n.push({value:h[0],color:p},{value:h[1],color:p})}var o=this._pieceList.slice();if(!o.length)o.push({interval:[-1/0,1/0]});else{var l=o[0].interval[0];l!==-1/0&&o.unshift({interval:[-1/0,l]}),l=o[o.length-1].interval[1],l!==1/0&&o.push({interval:[l,1/0]})}var u=-1/0;return de(o,function(h){var d=h.interval;d&&(d[0]>u&&s([u,d[0]],"outOfRange"),s(d.slice()),u=d[1])},this),{stops:n,outerColors:i}},e.type="visualMap.piecewise",e.defaultOption=xx(gq.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),e}(gq),_Qr={splitNumber:function(t){var e=this.option,r=Math.min(e.precision,20),n=this.getExtent(),i=e.splitNumber;i=Math.max(parseInt(i,10),1),e.splitNumber=i;for(var a=(n[1]-n[0])/i;+a.toFixed(r)!==a&&r<5;)r++;e.precision=r,a=+a.toFixed(r),e.minOpen&&t.push({interval:[-1/0,n[0]],close:[0,0]});for(var s=0,o=n[0];s","≥"][n[0]]];r.text=r.text||this.formatValueText(r.value!=null?r.value:r.interval,!1,i)},this)}};function lpt(t,e){var r=t.inverse;(t.orient==="vertical"?!r:r)&&e.reverse()}var RQr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.doRender=function(){var r=this.group;r.removeAll();var n=this.visualMapModel,i=n.get("textGap"),a=n.textStyleModel,s=this._getItemAlign(),o=n.itemSize,l=this._getViewData(),u=l.endsText,h=Pc(n.get("showLabel",!0),!u),d=!n.get("selectedMode");u&&this._renderEndsText(r,u[0],o,h,s),de(l.viewPieceList,function(f){var p=f.piece,g=new pr;g.onclick=Ht(this._onItemClick,this,p),this._enableHoverLink(g,f.indexInModelPieceList);var m=n.getRepresentValue(p);if(this._createItemSymbol(g,m,[0,0,o[0],o[1]],d),h){var v=this.visualMapModel.getValueState(m),y=a.get("align")||s;g.add(new Pn({style:Gi(a,{x:y==="right"?-i:o[0]+i,y:o[1]/2,text:p.text,verticalAlign:a.get("verticalAlign")||"middle",align:y,opacity:Jt(a.get("opacity"),v==="outOfRange"?.5:1)}),silent:d}))}r.add(g)},this),u&&this._renderEndsText(r,u[1],o,h,s),hS(n.get("orient"),r,n.get("itemGap")),this.renderBackground(r),this.positionGroup(r)},e.prototype._enableHoverLink=function(r,n){var i=this;r.on("mouseover",function(){return a("highlight")}).on("mouseout",function(){return a("downplay")});var a=function(s){var o=i.visualMapModel;o.option.hoverLink&&i.api.dispatchAction({type:s,batch:mq(o.findTargetDataIndices(n),o)})}},e.prototype._getItemAlign=function(){var r=this.visualMapModel,n=r.option;if(n.orient==="vertical")return Jft(r,this.api,r.itemSize);var i=n.align;return(!i||i==="auto")&&(i="left"),i},e.prototype._renderEndsText=function(r,n,i,a,s){if(n){var o=new pr,l=this.visualMapModel.textStyleModel;o.add(new Pn({style:Gi(l,{x:a?s==="right"?i[0]:0:i[0]/2,y:i[1]/2,verticalAlign:"middle",align:a?s:"center",text:n})})),r.add(o)}},e.prototype._getViewData=function(){var r=this.visualMapModel,n=vt(r.getPieceList(),function(o,l){return{piece:o,indexInModelPieceList:l}}),i=r.get("text"),a=r.get("orient"),s=r.get("inverse");return(a==="horizontal"?s:!s)?n.reverse():i&&(i=i.slice().reverse()),{viewPieceList:n,endsText:i}},e.prototype._createItemSymbol=function(r,n,i,a){var s=$s(this.getControllerVisual(n,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(n,"color"));s.silent=a,r.add(s)},e.prototype._onItemClick=function(r){var n=this.visualMapModel,i=n.option,a=i.selectedMode;if(a){var s=lr(i.selected),o=n.getSelectedMapKey(r);a==="single"||a===!0?(s[o]=!0,de(s,function(l,u){s[u]=u===o})):s[o]=!s[o],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:s})}},e.type="visualMap.piecewise",e}(Kft);function cpt(t){t.registerComponentModel(EQr),t.registerComponentView(RQr),spt(t)}function DQr(t){Yr(opt),Yr(cpt)}var LQr=function(){function t(e){this._thumbnailModel=e}return t.prototype.reset=function(e){this._renderVersion=e.getECUpdateCycleVersion()},t.prototype.renderContent=function(e){var r=e.api.getViewOfComponentModel(this._thumbnailModel);r&&(e.group.silent=!0,r.renderContent({group:e.group,targetTrans:e.targetTrans,z2Range:qtt(e.group),roamType:e.roamType,viewportRect:e.viewportRect,renderVersion:this._renderVersion}))},t.prototype.updateWindow=function(e,r){var n=r.getViewOfComponentModel(this._thumbnailModel);n&&n.updateWindow({targetTrans:e,renderVersion:this._renderVersion})},t}(),MQr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.preventAutoZ=!0,r}return e.prototype.optionUpdated=function(r,n){this._updateBridge()},e.prototype._updateBridge=function(){var r=this._birdge=this._birdge||new LQr(this);if(this._target=null,this.ecModel.eachSeries(function(i){fut(i,null)}),this.shouldShow()){var n=this.getTarget();fut(n.baseMapProvider,r)}},e.prototype.shouldShow=function(){return this.getShallow("show",!0)},e.prototype.getBridge=function(){return this._birdge},e.prototype.getTarget=function(){if(this._target)return this._target;var r=this.getReferringComponents("series",{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];return r?r.subType!=="graph"&&(r=null):r=this.ecModel.queryComponents({mainType:"series",subType:"graph"})[0],this._target={baseMapProvider:r},this._target},e.type="thumbnail",e.layoutMode="box",e.dependencies=["series","geo"],e.defaultOption={show:!0,right:1,bottom:1,height:"25%",width:"25%",itemStyle:{borderColor:et.color.border,borderWidth:2},windowStyle:{borderWidth:1,color:et.color.neutral30,borderColor:et.color.neutral40,opacity:.3},z:10},e}(fn),IQr=function(t){rt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){if(this._api=i,this._model=r,this._coordSys||(this._coordSys=new hY),!this._isEnabled()){this._clear();return}this._renderVersion=i.getECUpdateCycleVersion();var a=this.group;a.removeAll();var s=r.getModel("itemStyle"),o=s.getItemStyle();o.fill==null&&(o.fill=n.get("backgroundColor")||et.color.neutral00);var l=Co(r,i).refContainer,u=da(Ort(r,!0),l),h=o.lineWidth||0,d=this._contentRect=aS(u.clone(),h/2,!0,!0),f=new pr;a.add(f),f.setClipPath(new tn({shape:d.plain()}));var p=this._targetGroup=new pr;f.add(p);var g=u.plain();g.r=s.getShallow("borderRadius",!0),a.add(this._bgRect=new tn({style:o,shape:g,silent:!1,cursor:"grab"}));var m=r.getModel("windowStyle"),v=m.getShallow("borderRadius",!0);f.add(this._windowRect=new tn({shape:{x:0,y:0,width:0,height:0,r:v},style:m.getItemStyle(),silent:!1,cursor:"grab"})),this._dealRenderContent(),this._dealUpdateWindow(),hpt(r,this)},e.prototype.renderContent=function(r){this._bridgeRendered=r,this._isEnabled()&&(this._dealRenderContent(),this._dealUpdateWindow(),hpt(this._model,this))},e.prototype._dealRenderContent=function(){var r=this._bridgeRendered;if(!(!r||r.renderVersion!==this._renderVersion)){var n=this._targetGroup,i=this._coordSys,a=this._contentRect;if(n.removeAll(),!!r){var s=r.group,o=s.getBoundingRect();n.add(s),this._bgRect.z2=r.z2Range.min-10,gY(i,o.x,o.y,o.width,o.height);var l=da({left:"center",top:"center",aspect:o.width/o.height},a);mY(i,l.x,l.y,l.width,l.height),K8(s,i,HS),s.dirty(),this._windowRect.z2=r.z2Range.max+10,this._resetRoamController(r.roamType)}}},e.prototype.updateWindow=function(r){var n=this._bridgeRendered;n&&n.renderVersion===r.renderVersion&&(n.targetTrans=r.targetTrans),this._isEnabled()&&this._dealUpdateWindow()},e.prototype._dealUpdateWindow=function(){var r=this._bridgeRendered;if(!(!r||r.renderVersion!==this._renderVersion)){var n=Cd([],r.targetTrans),i=Td([],fY(null,this._coordSys),n);this._transThisToTarget=Cd([],i);var a=r.viewportRect;a?a=a.clone():a=new fr(0,0,this._api.getWidth(),this._api.getHeight()),a.applyTransform(i);var s=this._windowRect,o=s.shape.r;s.setShape(mr({r:o},a))}},e.prototype._resetRoamController=function(r){var n=this,i=this._api,a=this._roamController;if(a||(a=this._roamController=new VS(i.getZr())),!r||!this._isEnabled()){a.disable();return}a.enable(r,{api:i,zInfo:{component:this._model},triggerInfo:{roamTrigger:null,isInSelf:function(s,o,l){return n._contentRect.contain(o,l)}}}),a.off("pan").off("zoom").on("pan",Ht(this._onPan,this)).on("zoom",Ht(this._onZoom,this))},e.prototype._onPan=function(r){var n=this._transThisToTarget;if(!(!this._isEnabled()||!n)){var i=Ka([],[r.oldX,r.oldY],n),a=Ka([],[r.oldX-r.dx,r.oldY-r.dy],n);this._api.dispatchAction(upt(this._model.getTarget().baseMapProvider,{dx:a[0]-i[0],dy:a[1]-i[1]}))}},e.prototype._onZoom=function(r){var n=this._transThisToTarget;if(!(!this._isEnabled()||!n)){var i=Ka([],[r.originX,r.originY],n);this._api.dispatchAction(upt(this._model.getTarget().baseMapProvider,{zoom:1/r.scale,originX:i[0],originY:i[1]}))}},e.prototype._isEnabled=function(){var r=this._model;if(!r||!r.shouldShow())return!1;var n=r.getTarget().baseMapProvider;return!!n},e.prototype._clear=function(){this.group.removeAll(),this._bridgeRendered=null,this._roamController&&this._roamController.disable()},e.prototype.remove=function(){this._clear()},e.prototype.dispose=function(){this._clear()},e.type="thumbnail",e}(Hi);function upt(t,e){var r=t.mainType==="series"?t.subType+"Roam":t.mainType+"Roam",n={type:r};return n[t.mainType+"Id"]=t.id,ot(n,e),n}function hpt(t,e){var r=sS(t);_H(e.group,r.z,r.zlevel)}function PQr(t){t.registerComponentModel(MQr),t.registerComponentView(IQr)}var NQr={label:{enabled:!0},decal:{show:!1}},dpt=Qr(),fpt=Qr(),BQr=LN($Qr);function $Qr(t,e){var r=t.getModel("aria");if(!r.get("enabled"))return;var n=fpt(t).scope||(fpt(t).scope={}),i=lr(NQr);Vr(i.label,t.getLocaleModel().get("aria"),!1),Vr(r.option,i,!1),a(),s();function a(){var h=r.getModel("decal"),d=h.get("show");if(d){var f=Yt();t.eachSeries(function(p){p.isColorBySeries()||(dpt(p).scope=f.get(p.type)||f.set(p.type,{}))}),t.eachSeries(function(p){if(ur(p.enableAriaDecal)){p.enableAriaDecal();return}var g=p.getData();if(p.isColorBySeries()){var x=Qfe(p.ecModel,p.name,n,t.getSeriesCount()),w=g.getVisual("decal");g.setVisual("decal",A(w,x))}else{var m=p.getRawData(),v={},y=dpt(p).scope;g.each(function(S){var T=g.getRawIndex(S);v[T]=S});var b=m.count();m.each(function(S){var T=v[S],O=m.getName(S)||S+"",k=Qfe(p.ecModel,O,y,b),E=g.getItemVisual(T,"decal");g.setItemVisual(T,"decal",A(E,k))})}function A(S,T){var O=S?ot(ot({},T),S):T;return O.dirty=!0,O}})}}function s(){var h=e.getZr().dom;if(h){var d=t.getLocaleModel().get("aria"),f=r.getModel("label");if(f.option=mr(f.option,d),!!f.get("enabled")){if(h.setAttribute("role","img"),f.get("description")){h.setAttribute("aria-label",f.get("description"));return}var p=t.getSeriesCount(),g=f.get(["data","maxCount"])||10,m=f.get(["series","maxCount"])||10,v=Math.min(p,m),y;if(!(p<1)){var b=l();if(b){var x=f.get(["general","withTitle"]);y=o(x,{title:b})}else y=f.get(["general","withoutTitle"]);var w=[],A=p>1?f.get(["series","multiple","prefix"]):f.get(["series","single","prefix"]);y+=o(A,{seriesCount:p}),t.eachSeries(function(k,E){if(E1?f.get(["series","multiple",L]):f.get(["series","single",L]),_=o(_,{seriesId:k.seriesIndex,seriesName:k.get("name"),seriesType:u(k.subType)});var R=k.getData();if(R.count()>g){var D=f.get(["data","partialData"]);_+=o(D,{displayCnt:g})}else _+=f.get(["data","allData"]);for(var M=f.get(["data","separator","middle"]),P=f.get(["data","separator","end"]),N=f.get(["data","excludeDimensionId"]),F=[],B=0;B":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},UQr=function(){function t(e){var r=this._condVal=Nt(e)?new RegExp(e):QZe(e)?e:null;if(r==null){var n="";ii(n)}}return t.prototype.evaluate=function(e){var r=typeof e;return Nt(r)?this._condVal.test(e):zn(r)?this._condVal.test(e+""):!1},t}(),VQr=function(){function t(){}return t.prototype.evaluate=function(){return this.value},t}(),QQr=function(){function t(){}return t.prototype.evaluate=function(){for(var e=this.children,r=0;r2&&n.push(i),i=[L,R]}function h(L,R,D,M){x5(L,D)&&x5(R,M)||i.push(L,R,D,M,D,M)}function d(L,R,D,M,P,N){var F=Math.abs(R-L),B=Math.tan(F/4)*4/3,V=RO:_2&&n.push(i),n}function Uve(t,e,r,n,i,a,s,o,l,u){if(x5(t,r)&&x5(e,n)&&x5(i,s)&&x5(a,o)){l.push(s,o);return}var h=2/u,d=h*h,f=s-t,p=o-e,g=Math.sqrt(f*f+p*p);f/=g,p/=g;var m=r-t,v=n-e,y=i-s,b=a-o,x=m*m+v*v,w=y*y+b*b;if(x=0&&O=0){l.push(s,o);return}var k=[],E=[];ox(t,r,i,s,.5,k),ox(e,n,a,o,.5,E),Uve(k[0],E[0],k[1],E[1],k[2],E[2],k[3],E[3],l,u),Uve(k[4],E[4],k[5],E[5],k[6],E[6],k[7],E[7],l,u)}function nGr(t,e){var r=zve(t),n=[];e=e||1;for(var i=0;i0)for(var u=0;uMath.abs(u),d=vpt([l,u],h?0:1,e),f=(h?o:u)/d.length,p=0;pi,s=vpt([n,i],a?0:1,e),o=a?"width":"height",l=a?"height":"width",u=a?"x":"y",h=a?"y":"x",d=t[o]/s.length,f=0;f1?null:new wr(m*l+t,m*u+e)}function sGr(t,e,r){var n=new wr;wr.sub(n,r,e),n.normalize();var i=new wr;wr.sub(i,t,e);var a=i.dot(n);return a}function w5(t,e){var r=t[t.length-1];r&&r[0]===e[0]&&r[1]===e[1]||t.push(e)}function oGr(t,e,r){for(var n=t.length,i=[],a=0;as?(u.x=h.x=o+a/2,u.y=l,h.y=l+s):(u.y=h.y=l+s/2,u.x=o,h.x=o+a),oGr(e,u,h)}function vq(t,e,r,n){if(r===1)n.push(e);else{var i=Math.floor(r/2),a=t(e);vq(t,a[0],i,n),vq(t,a[1],r-i,n)}return n}function lGr(t,e){for(var r=[],n=0;n0;u/=2){var h=0,d=0;(t&u)>0&&(h=1),(e&u)>0&&(d=1),o+=u*u*(3*h^d),d===0&&(h===1&&(t=u-1-t,e=u-1-e),l=t,t=e,e=l)}return o}function xq(t){var e=1/0,r=1/0,n=-1/0,i=-1/0,a=vt(t,function(o){var l=o.getBoundingRect(),u=o.getComputedTransform(),h=l.x+l.width/2+(u?u[4]:0),d=l.y+l.height/2+(u?u[5]:0);return e=Math.min(h,e),r=Math.min(d,r),n=Math.max(h,n),i=Math.max(d,i),[h,d]}),s=vt(a,function(o,l){return{cp:o,z:vGr(o[0],o[1],e,r,n,i),path:t[l]}});return s.sort(function(o,l){return o.z-l.z}).map(function(o){return o.path})}function Opt(t){return hGr(t.path,t.count)}function Qve(){return{fromIndividuals:[],toIndividuals:[],count:0}}function yGr(t,e,r){var n=[];function i(A){for(var S=0;S=0;i--)if(!r[i].many.length){var l=r[o].many;if(l.length<=1)if(o)o=0;else return r;var a=l.length,u=Math.ceil(a/2);r[i].many=l.slice(u,a),r[o].many=l.slice(0,u),o++}return r}var xGr={clone:function(t){for(var e=[],r=1-Math.pow(1-t.path.style.opacity,1/t.count),n=0;n0))return;var o=n.getModel("universalTransition").get("delay"),l=ot({setToFinal:!0},s),u,h;kpt(t)&&(u=t,h=e),kpt(e)&&(u=e,h=t);function d(y,b,x,w,A){var S=y.many,T=y.one;if(S.length===1&&!A){var O=b?S[0]:T,k=b?T:S[0];if(yq(O))d({many:[O],one:k},!0,x,w,!0);else{var E=o?mr({delay:o(x,w)},l):l;Vve(O,k,E),a(O,k,O,k,E)}}else for(var _=mr({dividePath:xGr[r],individualDelay:o&&function(P,N,F,B){return o(P+x,w)}},l),I=b?yGr(S,T,_):bGr(T,S,_),L=I.fromIndividuals,R=I.toIndividuals,D=L.length,M=0;Me.length,p=u?Ept(h,u):Ept(f?e:t,[f?t:e]),g=0,m=0;m_pt))for(var a=n.getIndices(),s=0;s0&&S.group.traverse(function(O){O instanceof vn&&!O.animators.length&&O.animateFrom({style:{opacity:0}},T)})})}function Ppt(t){var e=t.getModel("universalTransition").get("seriesKey");return e||t.id}function Npt(t){return ft(t)?t.sort().join(","):t}function Vx(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function kGr(t,e){var r=Yt(),n=Yt(),i=Yt();return de(t.oldSeries,function(a,s){var o=t.oldDataGroupIds[s],l=t.oldData[s],u=Ppt(a),h=Npt(u);n.set(h,{dataGroupId:o,data:l}),ft(u)&&de(u,function(d){i.set(d,{key:h,dataGroupId:o,data:l})})}),de(e.updatedSeries,function(a){if(a.isUniversalTransitionEnabled()&&a.isAnimationEnabled()){var s=a.get("dataGroupId"),o=a.getData(),l=Ppt(a),u=Npt(l),h=n.get(u);if(h)r.set(u,{oldSeries:[{dataGroupId:h.dataGroupId,divide:Vx(h.data),data:h.data}],newSeries:[{dataGroupId:s,divide:Vx(o),data:o}]});else if(ft(l)){var d=[];de(l,function(g){var m=n.get(g);m.data&&d.push({dataGroupId:m.dataGroupId,divide:Vx(m.data),data:m.data})}),d.length&&r.set(u,{oldSeries:d,newSeries:[{dataGroupId:s,data:o,divide:Vx(o)}]})}else{var f=i.get(l);if(f){var p=r.get(f.key);p||(p={oldSeries:[{dataGroupId:f.dataGroupId,data:f.data,divide:Vx(f.data)}],newSeries:[]},r.set(f.key,p)),p.newSeries.push({dataGroupId:s,data:o,divide:Vx(o)})}}}}),r}function Bpt(t,e){for(var r=0;r=0&&i.push({dataGroupId:e.oldDataGroupIds[o],data:e.oldData[o],divide:Vx(e.oldData[o]),groupIdDim:s.dimension})}),de(Qi(t.to),function(s){var o=Bpt(r.updatedSeries,s);if(o>=0){var l=r.updatedSeries[o].getData();a.push({dataGroupId:e.oldDataGroupIds[o],data:l,divide:Vx(l),groupIdDim:s.dimension})}}),i.length>0&&a.length>0&&Ipt(i,a,n)}function _Gr(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){de(Qi(n.seriesTransition),function(i){de(Qi(i.to),function(a){for(var s=n.updatedSeries,o=0;oo.vmin?n+=o.vmin-i+(e-o.vmin)/(o.vmax-o.vmin)*o.gapReal:n+=e-i,i=o.vmax,a=!1;break}n+=o.vmin-i+o.gapReal,i=o.vmax}return a&&(n+=e-i),n},transformOut:function(e,r){if(r&&r.depth===gy)return e;for(var n=$pt,i=Fpt,a=!0,s=0,o=0;ou?s=l.vmin+(e-u)/(h-u)*(l.vmax-l.vmin):s=i+e-n,i=l.vmax,a=!1;break}n=h,i=l.vmax}return a&&(s=i+e-n),s}},t}();function DGr(t,e){return new RGr(t,e)}var $pt=0,Fpt=0;function LGr(t,e){var r=0,n={tpAbs:{span:0,val:0},tpPrct:{span:0,val:0}},i=function(){return{has:!1,span:NaN,inExtFrac:NaN,val:NaN}},a={S:{tpAbs:i(),tpPrct:i()},E:{tpAbs:i(),tpPrct:i()}};de(t.breaks,function(o){var l=o.gapParsed;l.type==="tpPrct"&&(r+=l.val);var u=Yve(o,e);if(u){var h=u.vmin!==o.vmin,d=u.vmax!==o.vmax,f=u.vmax-u.vmin;if(!(h&&d))if(h||d){var p=h?"S":"E";a[p][l.type].has=!0,a[p][l.type].span=f,a[p][l.type].inExtFrac=f/(o.vmax-o.vmin),a[p][l.type].val=l.val}else n[l.type].span+=f,n[l.type].val+=l.val}});var s=r*(0+(e[1]-e[0])+(n.tpAbs.val-n.tpAbs.span)+(a.S.tpAbs.has?(a.S.tpAbs.val-a.S.tpAbs.span)*a.S.tpAbs.inExtFrac:0)+(a.E.tpAbs.has?(a.E.tpAbs.val-a.E.tpAbs.span)*a.E.tpAbs.inExtFrac:0)-n.tpPrct.span-(a.S.tpPrct.has?a.S.tpPrct.span*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.span*a.E.tpPrct.inExtFrac:0))/(1-n.tpPrct.val-(a.S.tpPrct.has?a.S.tpPrct.val*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.val*a.E.tpPrct.inExtFrac:0));de(t.breaks,function(o){var l=o.gapParsed;l.type==="tpPrct"&&(o.gapReal=r!==0?en(s,0)*l.val/r:0),l.type==="tpAbs"&&(o.gapReal=l.val),o.gapReal==null&&(o.gapReal=0)})}function MGr(t,e,r,n,i,a){t!=="no"&&de(r,function(s){var o=Yve(s,a);if(o)for(var l=e.length-1;l>=0;l--){var u=e[l],h=n(u),d=i*3/4;h>o.vmin-d&&he[0]&&r=0&&s<1-1e-5}de(t,function(s){if(!(!s||s.start==null||s.end==null)&&!s.isExpanded){var o={breakOption:lr(s),vmin:e.parse(s.start),vmax:e.parse(s.end),gapParsed:{type:"tpAbs",val:0},gapReal:null};if(s.gap!=null){var l=!1;if(Nt(s.gap)){var u=Sd(s.gap);if(u.match(/%$/)){var h=parseFloat(u)/100;i(h)||(h=0),o.gapParsed.type="tpPrct",o.gapParsed.val=h,l=!0}}if(!l){var d=e.parse(s.gap);(!isFinite(d)||d<0)&&(d=0),o.gapParsed.type="tpAbs",o.gapParsed.val=d}}if(o.vmin===o.vmax&&(o.gapParsed.type="tpAbs",o.gapParsed.val=0),r&&r.noNegative&&de(["vmin","vmax"],function(p){o[p]<0&&(o[p]=0)}),o.vmin>o.vmax){var f=o.vmax;o.vmax=o.vmin,o.vmin=f}n.push(o)}}),n.sort(function(s,o){return s.vmin-o.vmin});var a=-1/0;return de(n,function(s,o){a>s.vmin&&(n[o]=null),a=s.vmax}),{breaks:ni(n,function(s){return!!s})}}function jve(t,e){return Xve(e)===Xve(t)}function Xve(t){return t.start+"_\0_"+t.end}function PGr(t,e,r){var n=[];de(t,function(a,s){var o=e(a);o&&o.type==="vmin"&&n.push([s])}),de(t,function(a,s){var o=e(a);if(o&&o.type==="vmax"){var l=Wv(n,function(u){return jve(e(t[u[0]]).parsedBreak.breakOption,o.parsedBreak.breakOption)});l&&l.push(s)}});var i=[];return de(n,function(a){a.length===2&&i.push(r?a:[t[a[0]],t[a[1]]])}),i}function NGr(t,e,r,n){if(e.break){var i=e.break.parsedBreak,a=Wv(r,function(h){return jve(h.breakOption,e.break.parsedBreak.breakOption)}),s={lookup:n,depth:gy},o=t.transformOut(i.vmin,s),l=t.transformOut(i.vmax,s),u={vmin:o,vmax:l,breakOption:i.breakOption,gapParsed:lr(a.gapParsed),gapReal:i.gapReal};return{tickVal:u[e.break.type],vBreak:{type:e.break.type,parsedBreak:u}}}}function BGr(t,e,r,n,i){i.original=qve(t,e,r);var a=i.transformed=qve(t,e,r),s=i.lookup;a.breaks=vt(a.breaks,function(o,l){var u={depth:gy},h=e.transformIn(o.vmin,u),d=e.transformIn(o.vmax,u),f={type:o.gapParsed.type,val:o.gapParsed.type==="tpAbs"?e.transformIn(o.vmin+o.gapParsed.val,u)-h:o.gapParsed.val};return s.from[n+l]=h,s.to[n+l]=o.vmin,s.from[n+l+1]=d,s.to[n+l+1]=o.vmax,{vmin:h,vmax:d,gapParsed:f,gapReal:o.gapReal,breakOption:o.breakOption}})}var $Gr={vmin:"start",vmax:"end"};function FGr(t,e){return e&&(t=t||{},t.break={type:$Gr[e.type],start:e.parsedBreak.vmin,end:e.parsedBreak.vmax}),t}function zGr(){F5r({createBreakScaleMapper:DGr,pruneTicksByBreak:MGr,addBreaksToTicks:IGr,parseAxisBreakOption:qve,identifyAxisBreak:jve,serializeAxisBreakIdentifier:Xve,retrieveAxisBreakPairs:PGr,getTicksBreakOutwardTransform:NGr,parseAxisBreakOptionInwardTransform:BGr,makeAxisLabelFormatterParamBreak:FGr})}var zpt=Qr();function UGr(t,e){var r=Wv(t,function(n){return Ns().identifyAxisBreak(n.parsedBreak.breakOption,e.breakOption)});return r||t.push(r={zigzagRandomList:[],parsedBreak:e,shouldRemove:!1}),r}function VGr(t){de(t,function(e){return e.shouldRemove=!0})}function QGr(t){for(var e=t.length-1;e>=0;e--)t[e].shouldRemove&&t.splice(e,1)}function GGr(t,e,r,n,i){var a=r.axis;if(a.scale.isBlank()||!Ns())return;var s=Ns().retrieveAxisBreakPairs(a.scale.getTicks({breakTicks:"only_break"}),function(k){return k.break},!1);if(!s.length)return;var o=r.getModel("breakArea"),l=o.get("zigzagAmplitude"),u=o.get("zigzagMinSpan"),h=o.get("zigzagMaxSpan");u=Math.max(2,u||0),h=Math.max(u,h||0);var d=o.get("expandOnClick"),f=o.get("zigzagZ"),p=o.getModel("itemStyle"),g=p.getItemStyle(),m=g.stroke,v=g.lineWidth,y=g.lineDash,b=g.fill,x=new pr({ignoreModelZ:!0}),w=a.isHorizontal(),A=zpt(e).visualList||(zpt(e).visualList=[]);VGr(A);for(var S=function(k){var E=s[k][0].break.parsedBreak,_=[];_[0]=a.toGlobalCoord(a.dataToCoord(E.vmin,!0)),_[1]=a.toGlobalCoord(a.dataToCoord(E.vmax,!0)),_[1]<_[0]&&_.reverse();var I=UGr(A,E);I.shouldRemove=!1;var L=new pr;O(I.zigzagRandomList,L,_[0],_[1],w,E),d&&L.on("click",function(){var R={type:WW,breaks:[{start:E.breakOption.start,end:E.breakOption.end}]};R[a.dim+"AxisIndex"]=r.componentIndex,i.dispatchAction(R)}),L.silent=!d,x.add(L)},T=0;T=N;X&&(U=N);var Y=[],le=[];Y[M]=_,le[M]=I,!G&&!X&&(Y[M]+=z?-l:l,le[M]-=z?l:-l),Y[P]=U,le[P]=U,B.push(Y),V.push(le);var q=void 0;if(Qb[1]&&b.reverse(),{coordPair:b,brkId:Ns().serializeAxisBreakIdentifier(y.breakOption)}});l.sort(function(v,y){return v.coordPair[0]-y.coordPair[0]});for(var u=s[0],h=null,d=0;d=0?l[0].width:l[1].width),f=(d+h.x)/2-u.x,p=Math.min(f,f-h.x),g=Math.max(f,f-h.x),m=g<0?g:p>0?p:0;o=(f-m)/h.x}var v=new wr,y=new wr;wr.scale(v,n,-o),wr.scale(y,n,1-o),sge(r[0],v),sge(r[1],y)}function YGr(t,e){var r={breaks:[]};return de(e.breaks,function(n){if(n){var i=Wv(t.get("breaks",!0),function(o){return Ns().identifyAxisBreak(o,n)});if(i){var a=e.type,s={isExpanded:!!i.isExpanded};i.isExpanded=a===WW?!0:a===dot?!1:a===fot?!i.isExpanded:i.isExpanded,r.breaks.push({start:i.start,end:i.end,isExpanded:!!i.isExpanded,old:s})}}}),r}function qGr(){uIr({adjustBreakLabelPair:WGr,buildAxisBreakLine:HGr,rectCoordBuildBreakAxis:GGr,updateModelAxisBreak:YGr})}function jGr(t){pIr(t),zGr(),qGr()}function XGr(){RPr(KGr)}function KGr(t,e){de(t,function(r){if(!r.model.get(["axisLabel","inside"])){var n=ZGr(r);if(n){var i=r.isHorizontal()?"height":"width",a=r.model.get(["axisLabel","margin"]);e[i]-=n[i]+a,r.position==="top"?e.y+=n.height+a:r.position==="left"&&(e.x+=n.width+a)}}})}function ZGr(t){var e=t.model,r=t.scale;if(!e.get(["axisLabel","show"])||r.isBlank())return;var n,i,a=r.getExtent();r instanceof x8?i=r.count():(n=r.getTicks(),i=n.length);var s=t.getLabelModel(),o=A8(t),l,u=1;i>40&&(u=Math.ceil(i/40));for(var h=0;hUpt(t,"name",{value:e,configurable:!0}),wq=(t,e)=>{for(var r in e)Upt(t,r,{get:e[r],enumerable:!0})},Vpt={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(xi,function(){var r=1e3,n=6e4,i=36e5,a="millisecond",s="second",o="minute",l="hour",u="day",h="week",d="month",f="quarter",p="year",g="date",m="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(R){var D=["th","st","nd","rd"],M=R%100;return"["+R+(D[(M-20)%10]||D[M]||D[0])+"]"}},x=function(R,D,M){var P=String(R);return!P||P.length>=D?R:""+Array(D+1-P.length).join(M)+R},w={s:x,z:function(R){var D=-R.utcOffset(),M=Math.abs(D),P=Math.floor(M/60),N=M%60;return(D<=0?"+":"-")+x(P,2,"0")+":"+x(N,2,"0")},m:function R(D,M){if(D.date()1)return R(B[0])}else{var V=D.name;S[V]=D,N=V}return!P&&N&&(A=N),N||!P&&A},E=function(R,D){if(O(R))return R.clone();var M=typeof D=="object"?D:{};return M.date=R,M.args=arguments,new I(M)},_=w;_.l=k,_.i=O,_.w=function(R,D){return E(R,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var I=function(){function R(M){this.$L=k(M.locale,null,!0),this.parse(M),this.$x=this.$x||M.x||{},this[T]=!0}var D=R.prototype;return D.parse=function(M){this.$d=function(P){var N=P.date,F=P.utc;if(N===null)return new Date(NaN);if(_.u(N))return new Date;if(N instanceof Date)return new Date(N);if(typeof N=="string"&&!/Z$/i.test(N)){var B=N.match(v);if(B){var V=B[2]-1||0,z=(B[7]||"0").substring(0,3);return F?new Date(Date.UTC(B[1],V,B[3]||1,B[4]||0,B[5]||0,B[6]||0,z)):new Date(B[1],V,B[3]||1,B[4]||0,B[5]||0,B[6]||0,z)}}return new Date(N)}(M),this.init()},D.init=function(){var M=this.$d;this.$y=M.getFullYear(),this.$M=M.getMonth(),this.$D=M.getDate(),this.$W=M.getDay(),this.$H=M.getHours(),this.$m=M.getMinutes(),this.$s=M.getSeconds(),this.$ms=M.getMilliseconds()},D.$utils=function(){return _},D.isValid=function(){return this.$d.toString()!==m},D.isSame=function(M,P){var N=E(M);return this.startOf(P)<=N&&N<=this.endOf(P)},D.isAfter=function(M,P){return E(M){},"trace"),debug:C((...t)=>{},"debug"),info:C((...t)=>{},"info"),warn:C((...t)=>{},"warn"),error:C((...t)=>{},"error"),fatal:C((...t)=>{},"fatal")},Kve=C(function(t="fatal"){let e=Cy.fatal;typeof t=="string"?t.toLowerCase()in Cy&&(e=Cy[t]):typeof t=="number"&&(e=t),me.trace=()=>{},me.debug=()=>{},me.info=()=>{},me.warn=()=>{},me.error=()=>{},me.fatal=()=>{},e<=Cy.fatal&&(me.fatal=console.error?console.error.bind(console,Zf("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Zf("FATAL"))),e<=Cy.error&&(me.error=console.error?console.error.bind(console,Zf("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Zf("ERROR"))),e<=Cy.warn&&(me.warn=console.warn?console.warn.bind(console,Zf("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Zf("WARN"))),e<=Cy.info&&(me.info=console.info?console.info.bind(console,Zf("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Zf("INFO"))),e<=Cy.debug&&(me.debug=console.debug?console.debug.bind(console,Zf("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Zf("DEBUG"))),e<=Cy.trace&&(me.trace=console.debug?console.debug.bind(console,Zf("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Zf("TRACE")))},"setLogLevel"),Zf=C(t=>`%c${Cl().format("ss.SSS")} : ${t} : `,"format");const Aq={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t),hsl2rgb:({h:t,s:e,l:r},n)=>{if(!e)return r*2.55;t/=360,e/=100,r/=100;const i=r<.5?r*(1+e):r+e-r*e,a=2*r-i;switch(n){case"r":return Aq.hue2rgb(a,i,t+1/3)*255;case"g":return Aq.hue2rgb(a,i,t)*255;case"b":return Aq.hue2rgb(a,i,t-1/3)*255}},rgb2hsl:({r:t,g:e,b:r},n)=>{t/=255,e/=255,r/=255;const i=Math.max(t,e,r),a=Math.min(t,e,r),s=(i+a)/2;if(n==="l")return s*100;if(i===a)return 0;const o=i-a,l=s>.5?o/(2-i-a):o/(i+a);if(n==="s")return l*100;switch(i){case t:return((e-r)/o+(ee>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t)),round:t=>Math.round(t*1e10)/1e10},unit:{dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}}},Qx={};for(let t=0;t<=255;t++)Qx[t]=Tn.unit.dec2hex(t);const Qc={ALL:0,RGB:1,HSL:2};let tHr=class{constructor(){this.type=Qc.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=Qc.ALL}is(e){return this.type===e}};class rHr{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new tHr}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=Qc.ALL,this}_ensureHSL(){const e=this.data,{h:r,s:n,l:i}=e;r===void 0&&(e.h=Tn.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=Tn.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=Tn.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r,g:n,b:i}=e;r===void 0&&(e.r=Tn.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=Tn.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=Tn.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,r=e.r;return!this.type.is(Qc.HSL)&&r!==void 0?r:(this._ensureHSL(),Tn.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,r=e.g;return!this.type.is(Qc.HSL)&&r!==void 0?r:(this._ensureHSL(),Tn.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,r=e.b;return!this.type.is(Qc.HSL)&&r!==void 0?r:(this._ensureHSL(),Tn.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,r=e.h;return!this.type.is(Qc.RGB)&&r!==void 0?r:(this._ensureRGB(),Tn.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,r=e.s;return!this.type.is(Qc.RGB)&&r!==void 0?r:(this._ensureRGB(),Tn.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,r=e.l;return!this.type.is(Qc.RGB)&&r!==void 0?r:(this._ensureRGB(),Tn.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(Qc.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(Qc.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(Qc.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(Qc.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(Qc.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(Qc.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const Sq=new rHr({r:0,g:0,b:0,a:0},"transparent"),S5={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(S5.re);if(!e)return;const r=e[1],n=parseInt(r,16),i=r.length,a=i%4===0,s=i>4,o=s?1:17,l=s?8:4,u=a?0:-1,h=s?255:15;return Sq.set({r:(n>>l*(u+3)&h)*o,g:(n>>l*(u+2)&h)*o,b:(n>>l*(u+1)&h)*o,a:a?(n&h)*o/255:1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`#${Qx[Math.round(e)]}${Qx[Math.round(r)]}${Qx[Math.round(n)]}${Qx[Math.round(i*255)]}`:`#${Qx[Math.round(e)]}${Qx[Math.round(r)]}${Qx[Math.round(n)]}`}},sT={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(sT.hueRe);if(e){const[,r,n]=e;switch(n){case"grad":return Tn.channel.clamp.h(parseFloat(r)*.9);case"rad":return Tn.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return Tn.channel.clamp.h(parseFloat(r)*360)}}return Tn.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const r=t.match(sT.re);if(!r)return;const[,n,i,a,s,o]=r;return Sq.set({h:sT._hue2deg(n),s:Tn.channel.clamp.s(parseFloat(i)),l:Tn.channel.clamp.l(parseFloat(a)),a:s?Tn.channel.clamp.a(o?parseFloat(s)/100:parseFloat(s)):1},t)},stringify:t=>{const{h:e,s:r,l:n,a:i}=t;return i<1?`hsla(${Tn.lang.round(e)}, ${Tn.lang.round(r)}%, ${Tn.lang.round(n)}%, ${i})`:`hsl(${Tn.lang.round(e)}, ${Tn.lang.round(r)}%, ${Tn.lang.round(n)}%)`}},CB={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();const e=CB.colors[t];if(e)return S5.parse(e)},stringify:t=>{const e=S5.stringify(t);for(const r in CB.colors)if(CB.colors[r]===e)return r}},OB={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:t=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const r=t.match(OB.re);if(!r)return;const[,n,i,a,s,o,l,u,h]=r;return Sq.set({r:Tn.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:Tn.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:Tn.channel.clamp.b(l?parseFloat(o)*2.55:parseFloat(o)),a:u?Tn.channel.clamp.a(h?parseFloat(u)/100:parseFloat(u)):1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`rgba(${Tn.lang.round(e)}, ${Tn.lang.round(r)}, ${Tn.lang.round(n)}, ${Tn.lang.round(i)})`:`rgb(${Tn.lang.round(e)}, ${Tn.lang.round(r)}, ${Tn.lang.round(n)})`}},eg={format:{keyword:CB,hex:S5,rgb:OB,rgba:OB,hsl:sT,hsla:sT},parse:t=>{if(typeof t!="string")return t;const e=S5.parse(t)||OB.parse(t)||sT.parse(t)||CB.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(Qc.HSL)||t.data.r===void 0?sT.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?OB.stringify(t):S5.stringify(t)},Qpt=(t,e)=>{const r=eg.parse(t);for(const n in e)r[n]=Tn.channel.clamp[n](e[n]);return eg.stringify(r)},tg=(t,e,r=0,n=1)=>{if(typeof t!="number")return Qpt(t,{a:e});const i=Sq.set({r:Tn.channel.clamp.r(t),g:Tn.channel.clamp.g(e),b:Tn.channel.clamp.b(r),a:Tn.channel.clamp.a(n)});return eg.stringify(i)},Zve=(t,e)=>Tn.lang.round(eg.parse(t)[e]),nHr=t=>{const{r:e,g:r,b:n}=eg.parse(t),i=.2126*Tn.channel.toLinear(e)+.7152*Tn.channel.toLinear(r)+.0722*Tn.channel.toLinear(n);return Tn.lang.round(i)},iHr=t=>nHr(t)>=.5,Eu=t=>!iHr(t),Jve=(t,e,r)=>{const n=eg.parse(t),i=n[e],a=Tn.channel.clamp[e](i+r);return i!==a&&(n[e]=a),eg.stringify(n)},ht=(t,e)=>Jve(t,"l",e),dt=(t,e)=>Jve(t,"l",-e),Gpt=(t,e)=>Jve(t,"a",-e),xe=(t,e)=>{const r=eg.parse(t),n={};for(const i in e)e[i]&&(n[i]=r[i]+e[i]);return Qpt(t,n)},aHr=(t,e,r=50)=>{const{r:n,g:i,b:a,a:s}=eg.parse(t),{r:o,g:l,b:u,a:h}=eg.parse(e),d=r/100,f=d*2-1,p=s-h,m=((f*p===-1?f:(f+p)/(1+f*p))+1)/2,v=1-m,y=n*m+o*v,b=i*m+l*v,x=a*m+u*v,w=s*d+h*(1-d);return tg(y,b,x,w)},nt=(t,e=100)=>{const r=eg.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,aHr(r,t,e)};/*! @license DOMPurify 3.4.14 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.14/LICENSE */function Hpt(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r2?n-2:0),a=2;a1?r-1:0),i=1;i"u"?null:ko(BigInt.prototype.toString),Jpt=typeof Symbol>"u"?null:ko(Symbol.prototype.toString),Dh=ko(Object.prototype.hasOwnProperty),RB=ko(Object.prototype.toString),Gc=ko(RegExp.prototype.test),lT=bHr(TypeError);function ko(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:EB;if(Ypt&&Ypt(t,null),!C5(e))return t;let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const a=r(i);a!==i&&(hHr(e)||(e[n]=a),i=a)}t[i]=!0}return t}function xHr(t){for(let e=0;e/g),kHr=Ol(/\${[\w\W]*/g),EHr=Ol(/^data-[\-\w.\u00B7-\uFFFF]+$/),_Hr=Ol(/^aria-[\-\w]+$/),igt=Ol(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),RHr=Ol(/^(?:\w+script|data):/i),DHr=Ol(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),LHr=Ol(/^html$/i),MHr=Ol(/^[a-z][.\w]*(-[.\w]+)+$/i),agt=Ol(/<[/\w!]/g),sgt=Ol(/<[/\w]/g),IHr=Ol(/<\/no(script|embed|frames)/i),PHr=Ol(/\/>/i),Pd={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ogt=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],NHr=Ko(Di({},ogt)),BHr=function(){const t={};return oT(ogt,e=>{t[e]=Ol(new RegExp("])","i"))}),Ko(t)}(),$Hr=function(){return typeof window>"u"?null:window},FHr=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const a="dompurify"+(n?"#"+n:"");try{return e.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},lgt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Gx=function(e,r,n,i){return Dh(e,r)&&C5(e[r])?Di(i.base?Id(i.base):{},e[r],i.transform):n},oye=function(e,r,n){const i=Dh(e,r)?e[r]:void 0;return i&&typeof i=="object"?Id(i):n()};function cgt(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$Hr();const e=Gt=>cgt(Gt);if(e.version="3.4.14",e.removed=[],!t||!t.document||t.document.nodeType!==Pd.document||!t.Element)return e.isSupported=!1,e;let r=t.document;const n=r,i=n.currentScript;t.DocumentFragment;const a=t.HTMLTemplateElement,s=t.Node,o=t.Element,l=t.NodeFilter,u=t.NamedNodeMap;u===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,d=t.trustedTypes,f=o.prototype,p=rg(f,"cloneNode"),g=rg(f,"remove"),m=rg(f,"nextSibling"),v=rg(f,"childNodes"),y=rg(f,"parentNode"),b=rg(f,"shadowRoot"),x=rg(f,"attributes"),w=s&&s.prototype?rg(s.prototype,"nodeType"):null,A=s&&s.prototype?rg(s.prototype,"nodeName"):null,S=s&&s.prototype?rg(s.prototype,"ownerDocument"):null,T=function(ze){return w?w(ze):ze.nodeType},O=function(ze){return A?A(ze):ze.nodeName};if(typeof a=="function"){const Gt=r.createElement("template");Gt.content&&Gt.content.ownerDocument&&(r=Gt.content.ownerDocument)}let k,E="",_,I=!1,L=0;const R=function(){if(L>0)throw lT('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},D=function(ze){R(),L++;try{return k.createHTML(ze)}finally{L--}},M=function(ze){R(),L++;try{return k.createScriptURL(ze)}finally{L--}},P=function(){return I||(_=FHr(d,i),I=!0),_},N=r,F=N.implementation,B=N.createNodeIterator,V=N.createDocumentFragment,z=N.getElementsByTagName,U=n.importNode;let Q=lgt();e.isSupported=typeof Wpt=="function"&&typeof y=="function"&&F&&F.createHTMLDocument!==void 0;const G=CHr,X=OHr,Y=kHr,le=EHr,q=_Hr,Z=RHr,ee=DHr,re=MHr;let ve=igt,ae=null;const Ce=Di({},[...egt,...nye,...iye,...aye,...tgt]);let Oe=null;const $e=Di({},[...rgt,...sye,...ngt,...Tq]);let he=Object.seal(T5(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),fe=null,Se=null;const ge=Object.seal(T5(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Qe=!0,Te=!0,De=!1,qe=!0,K=!1,ce=!0,be=!1,ne=!1,j=null,ie=null,pe=!1,te=!1,ye=!1,oe=!1,_e=!0,Le=!1;const Ye="user-content-";let Pe=!0,Xe=!1,Ne={},Ze=null;const Ge=Di({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let lt=null;const Fe=Di({},["audio","video","img","source","image","track"]);let wt=null;const Me=Di({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Rt="http://www.w3.org/1998/Math/MathML",Lt="http://www.w3.org/2000/svg",ut="http://www.w3.org/1999/xhtml";let Xt=ut,Ft=!1,gt=null;const Ae=Di({},[Rt,Lt,ut],rye),zt=Ko(["mi","mo","mn","ms","mtext"]);let kt=Di({},zt);const At=Ko(["annotation-xml"]);let Mt=Di({},At);const jr=Di({},["title","style","font","a","script"]);let Re=null;const at=["application/xhtml+xml","text/html"],xt="text/html";let Ct=null,gr=null;const Xr=r.createElement("form"),$r=function(ze){return ze instanceof RegExp||ze instanceof Function},un=function(){let ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(gr&&gr===ze)return;(!ze||typeof ze!="object")&&(ze={}),ze=Id(ze),Re=at.indexOf(ze.PARSER_MEDIA_TYPE)===-1?xt:ze.PARSER_MEDIA_TYPE,Ct=Re==="application/xhtml+xml"?rye:EB,ae=Gx(ze,"ALLOWED_TAGS",Ce,{transform:Ct}),Oe=Gx(ze,"ALLOWED_ATTR",$e,{transform:Ct}),gt=Gx(ze,"ALLOWED_NAMESPACES",Ae,{transform:rye}),wt=Gx(ze,"ADD_URI_SAFE_ATTR",Me,{transform:Ct,base:Me}),lt=Gx(ze,"ADD_DATA_URI_TAGS",Fe,{transform:Ct,base:Fe}),Ze=Gx(ze,"FORBID_CONTENTS",Ge,{transform:Ct}),fe=Gx(ze,"FORBID_TAGS",Id({}),{transform:Ct}),Se=Gx(ze,"FORBID_ATTR",Id({}),{transform:Ct}),Ne=Dh(ze,"USE_PROFILES")?ze.USE_PROFILES&&typeof ze.USE_PROFILES=="object"?Id(ze.USE_PROFILES):ze.USE_PROFILES:!1,Qe=ze.ALLOW_ARIA_ATTR!==!1,Te=ze.ALLOW_DATA_ATTR!==!1,De=ze.ALLOW_UNKNOWN_PROTOCOLS||!1,qe=ze.ALLOW_SELF_CLOSE_IN_ATTR!==!1,K=ze.SAFE_FOR_TEMPLATES||!1,ce=ze.SAFE_FOR_XML!==!1,be=ze.WHOLE_DOCUMENT||!1,te=ze.RETURN_DOM||!1,ye=ze.RETURN_DOM_FRAGMENT||!1,oe=ze.RETURN_TRUSTED_TYPE||!1,pe=ze.FORCE_BODY||!1,_e=ze.SANITIZE_DOM!==!1,Le=ze.SANITIZE_NAMED_PROPS||!1,Pe=ze.KEEP_CONTENT!==!1,Xe=ze.IN_PLACE||!1,ve=AHr(ze.ALLOWED_URI_REGEXP)?ze.ALLOWED_URI_REGEXP:igt,Xt=typeof ze.NAMESPACE=="string"?ze.NAMESPACE:ut,kt=oye(ze,"MATHML_TEXT_INTEGRATION_POINTS",()=>Di({},zt)),Mt=oye(ze,"HTML_INTEGRATION_POINTS",()=>Di({},At));const it=oye(ze,"CUSTOM_ELEMENT_HANDLING",()=>T5(null));if(he=T5(null),Dh(it,"tagNameCheck")&&$r(it.tagNameCheck)&&(he.tagNameCheck=it.tagNameCheck),Dh(it,"attributeNameCheck")&&$r(it.attributeNameCheck)&&(he.attributeNameCheck=it.attributeNameCheck),Dh(it,"allowCustomizedBuiltInElements")&&typeof it.allowCustomizedBuiltInElements=="boolean"&&(he.allowCustomizedBuiltInElements=it.allowCustomizedBuiltInElements),Ol(he),K&&(Te=!1),ye&&(te=!0),Ne&&(ae=Di({},tgt),Oe=T5(null),Ne.html===!0&&(Di(ae,egt),Di(Oe,rgt)),Ne.svg===!0&&(Di(ae,nye),Di(Oe,sye),Di(Oe,Tq)),Ne.svgFilters===!0&&(Di(ae,iye),Di(Oe,sye),Di(Oe,Tq)),Ne.mathMl===!0&&(Di(ae,aye),Di(Oe,ngt),Di(Oe,Tq))),ge.tagCheck=null,ge.attributeCheck=null,Dh(ze,"ADD_TAGS")&&(typeof ze.ADD_TAGS=="function"?ge.tagCheck=ze.ADD_TAGS:C5(ze.ADD_TAGS)&&(ae===Ce&&(ae=Id(ae)),Di(ae,ze.ADD_TAGS,Ct))),Dh(ze,"ADD_ATTR")&&(typeof ze.ADD_ATTR=="function"?ge.attributeCheck=ze.ADD_ATTR:C5(ze.ADD_ATTR)&&(Oe===$e&&(Oe=Id(Oe)),Di(Oe,ze.ADD_ATTR,Ct))),Dh(ze,"ADD_FORBID_CONTENTS")&&C5(ze.ADD_FORBID_CONTENTS)&&(Ze===Ge&&(Ze=Id(Ze)),Di(Ze,ze.ADD_FORBID_CONTENTS,Ct)),Pe&&(ae["#text"]=!0),be&&Di(ae,["html","head","body"]),ae.table&&(Di(ae,["tbody"]),delete fe.tbody),ze.TRUSTED_TYPES_POLICY){if(typeof ze.TRUSTED_TYPES_POLICY.createHTML!="function")throw lT('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ze.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw lT('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Pt=k;k=ze.TRUSTED_TYPES_POLICY;try{E=D("")}catch(ar){throw k=Pt,ar}}else ze.TRUSTED_TYPES_POLICY===null?(k=void 0,E=""):(k===void 0&&(k=P()),k&&typeof E=="string"&&(E=D("")));Ko&&Ko(ze),gr=ze},zr=Di({},[...nye,...iye,...SHr]),On=Di({},[...aye,...THr]),Nr=function(ze,it,Pt){return it.namespaceURI===ut?ze==="svg":it.namespaceURI===Rt?ze==="svg"&&(Pt==="annotation-xml"||kt[Pt]):!!zr[ze]},hn=function(ze,it,Pt){return it.namespaceURI===ut?ze==="math":it.namespaceURI===Lt?ze==="math"&&Mt[Pt]:!!On[ze]},ti=function(ze,it,Pt){return it.namespaceURI===Lt&&!Mt[Pt]||it.namespaceURI===Rt&&!kt[Pt]?!1:!On[ze]&&(jr[ze]||!zr[ze])},pt=function(ze){let it=y(ze);(!it||!it.tagName)&&(it={namespaceURI:Xt,tagName:"template"});const Pt=EB(ze.tagName),ar=EB(it.tagName);return gt[ze.namespaceURI]?ze.namespaceURI===Lt?Nr(Pt,it,ar):ze.namespaceURI===Rt?hn(Pt,it,ar):ze.namespaceURI===ut?ti(Pt,it,ar):!!(Re==="application/xhtml+xml"&>[ze.namespaceURI]):!1},St=function(ze){kB(e.removed,{element:ze});try{y(ze).removeChild(ze)}catch{if(g(ze),!y(ze))throw lT("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},sr=function(ze,it,Pt){try{ze.removeAttributeNode(it)}catch{try{ze.removeAttribute(Pt)}catch{}}},Kr=function(ze){Tt(ze);const it=v(ze);if(it){const ar=[];oT(it,Ur=>{kB(ar,Ur)}),oT(ar,Ur=>{try{g(Ur)}catch{}})}const Pt=x(ze);if(Pt)for(let ar=Pt.length-1;ar>=0;--ar){const Ur=Pt[ar],_n=Ur&&Ur.name;typeof _n=="string"&&sr(ze,Ur,_n)}},Ln=function(ze,it,Pt){if(!Pt)try{Pt=it.getAttributeNode(ze)}catch{Pt=null}kB(e.removed,{attribute:Pt||null,from:it});try{Pt?it.removeAttributeNode(Pt):it.removeAttribute(ze)}catch{try{it.removeAttribute(ze)}catch{}}if(ze==="is")if(te||ye)try{St(it)}catch{}else try{it.setAttribute(ze,"")}catch{}},Et=function(ze){const it=x(ze);if(it)for(let Pt=it.length-1;Pt>=0;--Pt){const ar=it[Pt],Ur=ar&&ar.name;typeof Ur!="string"||Oe[Ct(Ur)]||sr(ze,ar,Ur)}},Tt=function(ze){const it=[ze];for(;it.length>0;){const Pt=it.pop();T(Pt)===Pd.element&&Et(Pt);const Ur=v(Pt);if(Ur)for(let _n=Ur.length-1;_n>=0;--_n)it.push(Ur[_n])}},Vt=function(ze,it){return ce?ze==="patchsrc"?!0:ze==="for"&&it!=="label"&&it!=="output":!1},mt=function(ze){if(!ce)return;const it=[ze];for(;it.length>0;){const Pt=it.pop(),ar=T(Pt);if(ar===Pd.processingInstruction||ar===Pd.comment&&Gc(sgt,Pt.data)){try{g(Pt)}catch{}continue}if(ar===Pd.element){const _n=Pt,Ua=Ct(O(Pt));try{_n.hasAttribute&&_n.hasAttribute("patchsrc")&&_n.removeAttribute("patchsrc"),_n.hasAttribute&&_n.hasAttribute("for")&&Vt("for",Ua)&&_n.removeAttribute("for")}catch{}}const Ur=v(Pt);if(Ur)for(let _n=Ur.length-1;_n>=0;--_n)it.push(Ur[_n])}},Tr=function(ze){let it=null,Pt=null;if(pe)ze=""+ze;else{const _n=Xpt(ze,/^[\r\n\t ]+/);Pt=_n&&_n[0]}Re==="application/xhtml+xml"&&Xt===ut&&(ze=''+ze+"");const ar=k?D(ze):ze;if(Xt===ut)try{it=new h().parseFromString(ar,Re)}catch{}if(!it||!it.documentElement){it=F.createDocument(Xt,"template",null);try{it.documentElement.innerHTML=Ft?E:ar}catch{}}const Ur=it.body||it.documentElement;return ze&&Pt&&Ur.insertBefore(r.createTextNode(Pt),Ur.childNodes[0]||null),Xt===ut?z.call(it,be?"html":"body")[0]:be?it.documentElement:Ur},Ie=function(ze){const it=S?S(ze):ze.ownerDocument;return B.call(it||ze,ze,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Xi=function(ze){return ze=_B(ze,G," "),ze=_B(ze,X," "),ze=_B(ze,Y," "),ze},Ue=function(ze){var it;ze.normalize();const Pt=S?S(ze):ze.ownerDocument,ar=B.call(Pt||ze,ze,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let Ur=ar.nextNode();for(;Ur;)Ur.data=Xi(Ur.data),Ur=ar.nextNode();const _n=(it=ze.querySelectorAll)===null||it===void 0?void 0:it.call(ze,"template");_n&&oT(_n,Ua=>{li(Ua.content)&&Ue(Ua.content)})},Mn=function(ze){const it=A?A(ze):null;return typeof it!="string"||Ct(it)!=="form"?!1:typeof ze.nodeName!="string"||typeof ze.textContent!="string"||typeof ze.removeChild!="function"||ze.attributes!==x(ze)||typeof ze.removeAttribute!="function"||typeof ze.setAttribute!="function"||typeof ze.namespaceURI!="string"||typeof ze.insertBefore!="function"||typeof ze.hasChildNodes!="function"||ze.nodeType!==w(ze)||ze.childNodes!==v(ze)},li=function(ze){if(!w||typeof ze!="object"||ze===null)return!1;try{return w(ze)===Pd.documentFragment}catch{return!1}},Es=function(ze){if(!w||typeof ze!="object"||ze===null)return!1;try{return typeof w(ze)=="number"}catch{return!1}};function Vn(Gt,ze,it){Gt.length!==0&&oT(Gt,Pt=>{Pt.call(e,ze,it,gr)})}const oa=function(ze,it){return!!(ce&&ze.hasChildNodes()&&!Es(ze.firstElementChild)&&Gc(agt,ze.textContent)&&Gc(agt,ze.innerHTML)||ce&&ze.namespaceURI===ut&&NHr[it]&&(Es(ze.firstElementChild)||typeof ze.textContent=="string"&&Gc(BHr[it],ze.textContent))||ze.nodeType===Pd.processingInstruction||ce&&ze.nodeType===Pd.comment&&Gc(sgt,ze.data))},ci=function(ze,it){if(ze instanceof RegExp)return Gc(ze,it);if(ze instanceof Function){for(var Pt=arguments.length,ar=new Array(Pt>2?Pt-2:0),Ur=2;Ur=0;--Ua){const _s=ze===Pt?p(Ur[Ua],!0):Ur[Ua];ar.insertBefore(_s,m(ze))}}}return St(ze),!0},zg=function(ze,it,Pt,ar){return ze.length===0?it:it===Pt||it===ar?Id(it):it},lv=function(ze,it){return ze===it||y(ze)!==null?!1:(Xe&&Tt(ze),!0)},ek=function(ze,it){if(Vn(Q.beforeSanitizeElements,ze,null),lv(ze,it))return!0;if(Mn(ze))return St(ze),!0;const Pt=Ct(O(ze));if(ae=zg(Q.uponSanitizeElement,ae,Ce,j),Vn(Q.uponSanitizeElement,ze,{tagName:Pt,allowedTags:ae}),lv(ze,it))return!0;if(oa(ze,Pt))return St(ze),!0;if(fe[Pt]||!(ge.tagCheck instanceof Function&&ge.tagCheck(Pt))&&!ae[Pt]){const Ur=lu(ze,Pt,it);return Ur===!1&&Vn(Q.afterSanitizeElements,ze,null),Ur}if(T(ze)===Pd.element&&!pt(ze)||(Pt==="noscript"||Pt==="noembed"||Pt==="noframes")&&Gc(IHr,ze.innerHTML))return St(ze),!0;if(K&&ze.nodeType===Pd.text){const Ur=Xi(ze.textContent);ze.textContent!==Ur&&(kB(e.removed,{element:ze.cloneNode()}),ze.textContent=Ur)}return Vn(Q.afterSanitizeElements,ze,null),!1},tk=function(ze,it,Pt){if(Se[it]||Vt(it,ze)||_e&&(it==="id"||it==="name")&&(Pt in r||Pt in Xr))return!1;const ar=Oe[it]||ge.attributeCheck instanceof Function&&ge.attributeCheck(it,ze);return Te&&Gc(le,it)||Qe&&Gc(q,it)?!0:ar?wt[it]||Gc(ve,_B(Pt,ee,""))||(it==="src"||it==="xlink:href"||it==="href")&&ze!=="script"&&Kpt(Pt,"data:")===0&<[ze]||De&&!Gc(Z,_B(Pt,ee,""))?!0:!Pt:ul(ze)&&ci(he.tagNameCheck,ze)&&ci(he.attributeNameCheck,it,ze)||it==="is"&&he.allowCustomizedBuiltInElements&&ci(he.tagNameCheck,Pt)},rk=Di({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ul=function(ze){return!rk[EB(ze)]&&Gc(re,ze)},nd=function(ze,it,Pt,ar){if(k&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!Pt)switch(d.getAttributeType(ze,it)){case"TrustedHTML":return D(ar);case"TrustedScriptURL":return M(ar)}return ar},Ec=function(ze,it,Pt,ar){try{Pt?ze.setAttributeNS(Pt,it,ar):ze.setAttribute(it,ar),Mn(ze)?St(ze):jpt(e.removed)}catch{Ln(it,ze)}},Vo=function(ze){Vn(Q.beforeSanitizeAttributes,ze,null);const it=ze.attributes;if(!it||Mn(ze))return;Oe=zg(Q.uponSanitizeAttribute,Oe,$e,ie);const Pt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Oe,forceKeepAttr:void 0};let ar=it.length;const Ur=Ct(ze.nodeName);for(;ar--;){const _n=it[ar],Ua=_n.name,_s=_n.namespaceURI,id=_n.value,ad=Ct(Ua),SLe=id;let ch=Ua==="value"?SLe:mHr(SLe);if(Pt.attrName=ad,Pt.attrValue=ch,Pt.keepAttr=!0,Pt.forceKeepAttr=void 0,Vn(Q.uponSanitizeAttribute,ze,Pt),ch=Pt.attrValue,Le&&(ad==="id"||ad==="name")&&Kpt(ch,Ye)!==0&&(Ln(Ua,ze,_n),ch=Ye+ch),ce&&Gc(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,ch)){Ln(Ua,ze,_n);continue}if(ad==="attributename"&&Xpt(ch,"href")){Ln(Ua,ze,_n);continue}if(!Pt.forceKeepAttr){if(!Pt.keepAttr){Ln(Ua,ze,_n);continue}if(!qe&&Gc(PHr,ch)){Ln(Ua,ze,_n);continue}if(K&&(ch=Xi(ch)),!tk(Ur,ad,ch)){Ln(Ua,ze,_n);continue}ch=nd(Ur,ad,_s,ch),ch!==SLe&&Ec(ze,Ua,_s,ch)}}Vn(Q.afterSanitizeAttributes,ze,null)},ff=function(ze){let it=null;const Pt=Ie(ze);for(Vn(Q.beforeSanitizeShadowDOM,ze,null);it=Pt.nextNode();)if(Vn(Q.uponSanitizeShadowNode,it,null),ek(it,ze),Vo(it),li(it.content)&&ff(it.content),T(it)===Pd.element){const ar=b(it);li(ar)&&(Sw(ar),ff(ar))}Vn(Q.afterSanitizeShadowDOM,ze,null)},Sw=function(ze){const it=[{node:ze,shadow:null}];for(;it.length>0;){const Pt=it.pop();if(Pt.shadow){ff(Pt.shadow);continue}const ar=Pt.node,_n=T(ar)===Pd.element,Ua=v(ar);if(Ua)for(let _s=Ua.length-1;_s>=0;--_s)it.push({node:Ua[_s],shadow:null});if(_n){const _s=A?A(ar):null;if(typeof _s=="string"&&Ct(_s)==="template"){const id=ar.content;li(id)&&it.push({node:id,shadow:null})}}if(_n){const _s=b(ar);li(_s)&&it.push({node:null,shadow:_s},{node:_s,shadow:null})}}};return e.sanitize=function(Gt){let ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},it=null,Pt=null,ar=null,Ur=null;if(Ft=!Gt,Ft&&(Gt=""),typeof Gt!="string"&&!Es(Gt)&&(Gt=wHr(Gt),typeof Gt!="string"))throw lT("dirty is not a string, aborting");if(!e.isSupported)return Gt;ne?(ae=j,Oe=ie):un(ze),(Q.uponSanitizeElement.length>0||Q.uponSanitizeAttribute.length>0)&&(ae=Id(ae)),Q.uponSanitizeAttribute.length>0&&(Oe=Id(Oe)),e.removed=[];const _n=Xe&&typeof Gt!="string"&&Es(Gt);if(_n){mt(Gt);const id=O(Gt);if(typeof id=="string"){const ad=Ct(id);if(!ae[ad]||fe[ad])throw Kr(Gt),lT("root node is forbidden and cannot be sanitized in-place")}if(Mn(Gt))throw Kr(Gt),lT("root node is clobbered and cannot be sanitized in-place");try{Sw(Gt)}catch(ad){throw Kr(Gt),ad}}else if(Es(Gt))it=Tr(""),Pt=it.ownerDocument.importNode(Gt,!0),Pt.nodeType===Pd.element&&Pt.nodeName==="BODY"||Pt.nodeName==="HTML"?it=Pt:it.appendChild(Pt),Sw(Pt);else{if(!te&&!K&&!be&&Gt.indexOf("<")===-1)return k&&oe?D(Gt):Gt;if(it=Tr(Gt),!it)return te?null:oe?E:""}it&&pe&&St(it.firstChild);const Ua=_n?Gt:it;try{const id=Ie(Ua);for(;ar=id.nextNode();)ek(ar,Ua),Vo(ar),li(ar.content)&&ff(ar.content)}catch(id){throw _n&&(Kr(Gt),oT(e.removed,ad=>{ad.element&&Tt(ad.element)})),id}if(_n)return oT(e.removed,id=>{id.element&&Tt(id.element)}),K&&Ue(Gt),Gt;if(te){if(K&&Ue(it),ye)for(Ur=V.call(it.ownerDocument);it.firstChild;)Ur.appendChild(it.firstChild);else Ur=it;return(Oe.shadowroot||Oe.shadowrootmode)&&(Ur=U.call(n,Ur,!0)),Ur}let _s=be?it.outerHTML:it.innerHTML;return be&&ae["!doctype"]&&it.ownerDocument&&it.ownerDocument.doctype&&it.ownerDocument.doctype.name&&Gc(LHr,it.ownerDocument.doctype.name)&&(_s=" +`+_s),K&&(_s=Xi(_s)),k&&oe?D(_s):_s},e.setConfig=function(){let Gt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};un(Gt),ne=!0,j=ae,ie=Oe},e.clearConfig=function(){gr=null,ne=!1,j=null,ie=null,k=_,E=""},e.isValidAttribute=function(Gt,ze,it){gr||un({});const Pt=Ct(Gt),ar=Ct(ze);return tk(Pt,ar,it)},e.addHook=function(Gt,ze){typeof ze=="function"&&Dh(Q,Gt)&&kB(Q[Gt],ze)},e.removeHook=function(Gt,ze){if(Dh(Q,Gt)){if(ze!==void 0){const it=pHr(Q[Gt],ze);return it===-1?void 0:gHr(Q[Gt],it,1)[0]}return jpt(Q[Gt])}},e.removeHooks=function(Gt){Dh(Q,Gt)&&(Q[Gt]=[])},e.removeAllHooks=function(){Q=lgt()},e}var Oy=cgt(),lye=C((t,e,{depth:r=2}={})=>{const n={depth:r};if(Array.isArray(e)&&!Array.isArray(t))return e.forEach(i=>lye(t,i,n)),t;if(Array.isArray(e)&&Array.isArray(t))return e.forEach(i=>{t.includes(i)||t.push(i)}),t;if(t==null||r<=0)return t!=null&&typeof t=="object"&&typeof e=="object"?Object.assign(t,e):e;if(e!=null&&typeof t=="object"&&typeof e=="object"){const i=t;Object.entries(e).forEach(([a,s])=>{if(typeof s=="object"){if(s===null)return;Object.hasOwn(t,a)||Object.defineProperty(t,a,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),i[a]===void 0&&(i[a]=Array.isArray(s)?[]:{}),typeof i[a]=="object"&&(i[a]=lye(i[a],s,{depth:r-1}))}else typeof i[a]!="object"&&(Object.hasOwn(t,a)?i[a]=s:Object.defineProperty(t,a,{value:s,writable:!0,enumerable:!0,configurable:!0}))})}return t},"assignWithDepth"),Eo=lye,qm="#ffffff",jm="#f2f2f2",bn=C((t,e)=>e?xe(t,{s:-40,l:10}):xe(t,{s:-40,l:-10}),"mkBorder"),zHr=(hD=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f,p,g,m,v,y,b,x,w,A,S,T,O,k,E,_,I,L,R,D,M,P,N,F,B,V,z,U,Q,G,X,Y,le,q,Z,ee,re,ve,ae;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||xe(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||xe(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||bn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||bn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||bn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||nt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||nt(this.tertiaryColor),this.lineColor=this.lineColor||nt(this.background),this.arrowheadColor=this.arrowheadColor||nt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?dt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||dt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||nt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||ht(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||dt(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||dt(this.mainBkg,10)):(this.rowOdd=this.rowOdd||ht(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||ht(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||xe(this.primaryColor,{h:30}),this.cScale4=this.cScale4||xe(this.primaryColor,{h:60}),this.cScale5=this.cScale5||xe(this.primaryColor,{h:90}),this.cScale6=this.cScale6||xe(this.primaryColor,{h:120}),this.cScale7=this.cScale7||xe(this.primaryColor,{h:150}),this.cScale8=this.cScale8||xe(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||xe(this.primaryColor,{h:270}),this.cScale10=this.cScale10||xe(this.primaryColor,{h:300}),this.cScale11=this.cScale11||xe(this.primaryColor,{h:330}),this.darkMode)for(let Ce=0;Ce{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(hD,"Theme"),hD),UHr=C(t=>{const e=new zHr;return e.calculate(t),e},"getThemeVariables"),VHr=(dD=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=ht(this.primaryColor,16),this.tertiaryColor=xe(this.primaryColor,{h:-160}),this.primaryBorderColor=nt(this.background),this.secondaryBorderColor=bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=bn(this.tertiaryColor,this.darkMode),this.primaryTextColor=nt(this.primaryColor),this.secondaryTextColor=nt(this.secondaryColor),this.tertiaryTextColor=nt(this.tertiaryColor),this.lineColor=nt(this.background),this.textColor=nt(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=ht(nt("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=tg(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=dt("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=dt(this.sectionBkgColor,10),this.taskBorderColor=tg(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=tg(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||ht(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||dt(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,v,y,b,x,w,A,S,T,O,k,E,_,I,L,R,D,M,P,N,F,B,V,z,U,Q,G,X,Y,le,q,Z,ee,re,ve;this.secondBkg=ht(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=ht(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=ht(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=nt(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=xe(this.primaryColor,{h:64}),this.fillType3=xe(this.secondaryColor,{h:64}),this.fillType4=xe(this.primaryColor,{h:-64}),this.fillType5=xe(this.secondaryColor,{h:-64}),this.fillType6=xe(this.primaryColor,{h:128}),this.fillType7=xe(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||xe(this.primaryColor,{h:30}),this.cScale4=this.cScale4||xe(this.primaryColor,{h:60}),this.cScale5=this.cScale5||xe(this.primaryColor,{h:90}),this.cScale6=this.cScale6||xe(this.primaryColor,{h:120}),this.cScale7=this.cScale7||xe(this.primaryColor,{h:150}),this.cScale8=this.cScale8||xe(this.primaryColor,{h:210}),this.cScale9=this.cScale9||xe(this.primaryColor,{h:270}),this.cScale10=this.cScale10||xe(this.primaryColor,{h:300}),this.cScale11=this.cScale11||xe(this.primaryColor,{h:330});for(let ae=0;ae{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(dD,"Theme"),dD),QHr=C(t=>{const e=new VHr;return e.calculate(t),e},"getThemeVariables"),GHr=(fD=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=xe(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=xe(this.primaryColor,{h:-160}),this.primaryBorderColor=bn(this.primaryColor,this.darkMode),this.secondaryBorderColor=bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=bn(this.tertiaryColor,this.darkMode),this.primaryTextColor=nt(this.primaryColor),this.secondaryTextColor=nt(this.secondaryColor),this.tertiaryTextColor=nt(this.tertiaryColor),this.lineColor=nt(this.background),this.textColor=nt(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=bn(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=tg(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,v,y,b,x,w,A,S,T,O,k,E,_,I,L,R,D,M,P,N,F,B,V,z,U,Q,G,X,Y,le,q,Z,ee,re,ve;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||xe(this.primaryColor,{h:30}),this.cScale4=this.cScale4||xe(this.primaryColor,{h:60}),this.cScale5=this.cScale5||xe(this.primaryColor,{h:90}),this.cScale6=this.cScale6||xe(this.primaryColor,{h:120}),this.cScale7=this.cScale7||xe(this.primaryColor,{h:150}),this.cScale8=this.cScale8||xe(this.primaryColor,{h:210}),this.cScale9=this.cScale9||xe(this.primaryColor,{h:270}),this.cScale10=this.cScale10||xe(this.primaryColor,{h:300}),this.cScale11=this.cScale11||xe(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||dt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||dt(this.tertiaryColor,40);for(let ae=0;ae{this[n]==="calculated"&&(this[n]=void 0)}),typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(fD,"Theme"),fD),ky=C(t=>{const e=new GHr;return e.calculate(t),e},"getThemeVariables"),HHr=(pD=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=ht("#cde498",10),this.primaryBorderColor=bn(this.primaryColor,this.darkMode),this.secondaryBorderColor=bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=bn(this.tertiaryColor,this.darkMode),this.primaryTextColor=nt(this.primaryColor),this.secondaryTextColor=nt(this.secondaryColor),this.tertiaryTextColor=nt(this.primaryColor),this.lineColor=nt(this.background),this.textColor=nt(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,v,y,b,x,w,A,S,T,O,k,E,_,I,L,R,D,M,P,N,F,B,V,z,U,Q,G,X,Y,le,q,Z,ee,re,ve;this.actorBorder=dt(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||xe(this.primaryColor,{h:30}),this.cScale4=this.cScale4||xe(this.primaryColor,{h:60}),this.cScale5=this.cScale5||xe(this.primaryColor,{h:90}),this.cScale6=this.cScale6||xe(this.primaryColor,{h:120}),this.cScale7=this.cScale7||xe(this.primaryColor,{h:150}),this.cScale8=this.cScale8||xe(this.primaryColor,{h:210}),this.cScale9=this.cScale9||xe(this.primaryColor,{h:270}),this.cScale10=this.cScale10||xe(this.primaryColor,{h:300}),this.cScale11=this.cScale11||xe(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||dt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||dt(this.tertiaryColor,40);for(let ae=0;ae{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(pD,"Theme"),pD),WHr=C(t=>{const e=new HHr;return e.calculate(t),e},"getThemeVariables"),YHr=(gD=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=ht(this.contrast,55),this.background="#ffffff",this.tertiaryColor=xe(this.primaryColor,{h:-160}),this.primaryBorderColor=bn(this.primaryColor,this.darkMode),this.secondaryBorderColor=bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=bn(this.tertiaryColor,this.darkMode),this.primaryTextColor=nt(this.primaryColor),this.secondaryTextColor=nt(this.secondaryColor),this.tertiaryTextColor=nt(this.tertiaryColor),this.lineColor=nt(this.background),this.textColor=nt(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||ht(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,v,y,b,x,w,A,S,T,O,k,E,_,I,L,R,D,M,P,N,F,B,V,z,U,Q,G,X,Y,le,q,Z,ee,re,ve;this.secondBkg=ht(this.contrast,55),this.border2=this.contrast,this.actorBorder=ht(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let ae=0;ae{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(gD,"Theme"),gD),qHr=C(t=>{const e=new YHr;return e.calculate(t),e},"getThemeVariables"),jHr=(mD=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=bn(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||xe(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||xe(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||bn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||bn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||bn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||nt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||nt(this.tertiaryColor),this.lineColor=this.lineColor||nt(this.background),this.arrowheadColor=this.arrowheadColor||nt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?dt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||dt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||nt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=xe(e,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||ht(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||e,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||n,this.cScale3=this.cScale3||xe(e,{h:30}),this.cScale4=this.cScale4||xe(e,{h:60}),this.cScale5=this.cScale5||xe(e,{h:90}),this.cScale6=this.cScale6||xe(e,{h:120}),this.cScale7=this.cScale7||xe(e,{h:150}),this.cScale8=this.cScale8||xe(e,{h:210,l:150}),this.cScale9=this.cScale9||xe(e,{h:270}),this.cScale10=this.cScale10||xe(e,{h:300}),this.cScale11=this.cScale11||xe(e,{h:330}),this.darkMode)for(let v=0;v{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(mD,"Theme"),mD),XHr=C(t=>{const e=new jHr;return e.calculate(t),e},"getThemeVariables"),KHr=(vD=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=ht(this.primaryColor,16),this.tertiaryColor=xe(this.primaryColor,{h:-160}),this.primaryBorderColor=nt(this.background),this.secondaryBorderColor=bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=bn(this.tertiaryColor,this.darkMode),this.primaryTextColor=nt(this.primaryColor),this.secondaryTextColor=nt(this.secondaryColor),this.tertiaryTextColor=nt(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=ht(nt("#323D47"),10),this.border1="#ccc",this.border2=tg(255,255,255,.25),this.arrowheadColor=nt(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||xe(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||xe(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||bn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||bn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||bn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||nt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||nt(this.tertiaryColor),this.lineColor=this.lineColor||nt(this.background),this.arrowheadColor=this.arrowheadColor||nt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?dt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||dt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||nt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||ht(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||xe(this.primaryColor,{h:30}),this.cScale4=this.cScale4||xe(this.primaryColor,{h:60}),this.cScale5=this.cScale5||xe(this.primaryColor,{h:90}),this.cScale6=this.cScale6||xe(this.primaryColor,{h:120}),this.cScale7=this.cScale7||xe(this.primaryColor,{h:150}),this.cScale8=this.cScale8||xe(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||xe(this.primaryColor,{h:270}),this.cScale10=this.cScale10||xe(this.primaryColor,{h:300}),this.cScale11=this.cScale11||xe(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(vD,"Theme"),vD),ZHr=C(t=>{const e=new KHr;return e.calculate(t),e},"getThemeVariables"),JHr=(yD=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=bn("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||xe(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||xe(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||bn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||bn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||bn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||nt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||nt(this.tertiaryColor),this.lineColor=this.lineColor||nt(this.background),this.arrowheadColor=this.arrowheadColor||nt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?dt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||dt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||nt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=xe(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||ht(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let v=0;v{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(yD,"Theme"),yD),eWr=C(t=>{const e=new JHr;return e.calculate(t),e},"getThemeVariables"),tWr=(bD=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=ht(this.primaryColor,16),this.tertiaryColor=xe(this.primaryColor,{h:-160}),this.primaryBorderColor=nt(this.background),this.secondaryBorderColor=bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=bn(this.tertiaryColor,this.darkMode),this.primaryTextColor=nt(this.primaryColor),this.secondaryTextColor=nt(this.secondaryColor),this.tertiaryTextColor=nt(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=ht(nt("#323D47"),10),this.border1="#ccc",this.border2=tg(255,255,255,.25),this.arrowheadColor=nt(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||xe(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||xe(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||bn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||bn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||bn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||nt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||nt(this.tertiaryColor),this.lineColor=this.lineColor||nt(this.background),this.arrowheadColor=this.arrowheadColor||nt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?dt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||dt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||nt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||ht(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||xe(this.primaryColor,{h:30}),this.cScale4=this.cScale4||xe(this.primaryColor,{h:60}),this.cScale5=this.cScale5||xe(this.primaryColor,{h:90}),this.cScale6=this.cScale6||xe(this.primaryColor,{h:120}),this.cScale7=this.cScale7||xe(this.primaryColor,{h:150}),this.cScale8=this.cScale8||xe(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||xe(this.primaryColor,{h:270}),this.cScale10=this.cScale10||xe(this.primaryColor,{h:300}),this.cScale11=this.cScale11||xe(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(bD,"Theme"),bD),rWr=C(t=>{const e=new tWr;return e.calculate(t),e},"getThemeVariables"),nWr=(xD=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=bn(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||xe(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||xe(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||bn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||bn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||bn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||nt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||nt(this.tertiaryColor),this.lineColor=this.lineColor||nt(this.background),this.arrowheadColor=this.arrowheadColor||nt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?dt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||dt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||nt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=xe(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||ht(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let v=0;v{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(xD,"Theme"),xD),iWr=C(t=>{const e=new nWr;return e.calculate(t),e},"getThemeVariables"),aWr=(wD=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=ht(this.primaryColor,16),this.tertiaryColor=xe(this.primaryColor,{h:-160}),this.primaryBorderColor=nt(this.background),this.secondaryBorderColor=bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=bn(this.tertiaryColor,this.darkMode),this.primaryTextColor=nt(this.primaryColor),this.secondaryTextColor=nt(this.secondaryColor),this.tertiaryTextColor=nt(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=ht(nt("#323D47"),10),this.border1="#ccc",this.border2=tg(255,255,255,.25),this.arrowheadColor=nt(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||xe(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||xe(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||bn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||bn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||bn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||bn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||nt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||nt(this.tertiaryColor),this.lineColor=this.lineColor||nt(this.background),this.arrowheadColor=this.arrowheadColor||nt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?dt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||dt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||nt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||ht(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},C(wD,"Theme"),wD),sWr=C(t=>{const e=new aWr;return e.calculate(t),e},"getThemeVariables"),Ey={base:{getThemeVariables:UHr},dark:{getThemeVariables:QHr},default:{getThemeVariables:ky},forest:{getThemeVariables:WHr},neutral:{getThemeVariables:qHr},neo:{getThemeVariables:XHr},"neo-dark":{getThemeVariables:ZHr},redux:{getThemeVariables:eWr},"redux-dark":{getThemeVariables:rWr},"redux-color":{getThemeVariables:iWr},"redux-dark-color":{getThemeVariables:sWr}},lc={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},swimlane:{useMaxWidth:!0,lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:"right",highlightSlice:""},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},ugt={...lc,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:Ey.default.getThemeVariables(),sequence:{...lc.sequence,messageFont:C(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:C(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:C(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...lc.gantt,tickInterval:void 0,useWidth:void 0},c4:{...lc.c4,useWidth:void 0,personFont:C(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...lc.flowchart,inheritDir:!1},external_personFont:C(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:C(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:C(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:C(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:C(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:C(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:C(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:C(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:C(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:C(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:C(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:C(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:C(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:C(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:C(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:C(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:C(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:C(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:C(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:C(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:C(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...lc.pie,useWidth:984},xyChart:{...lc.xyChart,useWidth:void 0},requirement:{...lc.requirement,useWidth:void 0},packet:{...lc.packet},eventmodeling:{...lc.eventmodeling},treeView:{...lc.treeView,useWidth:void 0},radar:{...lc.radar},railroad:{...lc.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...lc.ishikawa},sankey:{...lc.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...lc.venn},cynefin:{...lc.cynefin}},hgt=C((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...hgt(t[n],"")]:[...r,e+n],[]),"keyify"),oWr=new Set(hgt(ugt,"")),Xn=ugt,lWr={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},cWr=C((t,e)=>{for(const r of Object.keys(t)){const n=t[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof n!="string"||!e.test(n))&&(me.debug("sanitize deleting dictionary entry:",r,n),delete t[r])}},"sanitizeDictionaryConfig"),Cq=C(t=>{if(me.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>Cq(e));return}for(const e of Object.keys(t)){if(me.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!oWr.has(e)||t[e]==null){me.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){const n=lWr[e];n?cWr(t[e],n):(me.debug("sanitizing object",e),Cq(t[e]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(me.debug("sanitizing css option",e),t[e]=dgt(t[e]))}if(t.themeVariables)for(const e of Object.keys(t.themeVariables)){const r=t.themeVariables[e];r!=null&&r.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}me.debug("After sanitization",t)}},"sanitizeDirective"),dgt=C(t=>{let e=0,r=0;for(const n of t){if(e!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),Lh=Eo({},O5),Oq,cT=[],DB=Eo({},O5),LB=C((t,e)=>{let r=Eo({},t),n={};for(const i of e)ggt(i),n=Eo(n,i);if(r=Eo(r,n),n.theme&&n.theme in Ey){const i=Eo({},Oq),a=Eo(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in Ey&&(r.themeVariables=Ey[r.theme].getThemeVariables(a))}return DB=r,gWr(DB),DB},"updateCurrentConfig"),uWr=C(t=>(Lh=Eo({},O5),Lh=Eo(Lh,t),t.theme&&Ey[t.theme]&&(Lh.themeVariables=Ey[t.theme].getThemeVariables(t.themeVariables)),LB(Lh,cT),Lh),"setSiteConfig"),hWr=C(t=>{Oq=Eo({},t)},"saveConfigFromInitialize"),dWr=C(t=>(Lh=Eo(Lh,t),LB(Lh,cT),Lh),"updateSiteConfig"),fgt=C(()=>Eo({},Lh),"getSiteConfig"),pgt=C(t=>(LB(DB,[t]),Dr()),"setConfig"),Dr=C(()=>Eo({},DB),"getConfig"),ggt=C(t=>{t&&(["secure",...Lh.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(me.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])}),Object.keys(t).forEach(e=>{e.startsWith("__")&&delete t[e]}),Object.keys(t).forEach(e=>{typeof t[e]=="string"&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],typeof t[e]=="object"&&ggt(t[e])}))},"sanitize"),fWr=C(t=>{var e;Cq(t),t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),cT.push(t),LB(Lh,cT)},"addDirective"),kq=C((t=Lh)=>{cT=[],LB(t,cT)},"reset"),pWr={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},mgt={},vgt=C(t=>{mgt[t]||(me.warn(pWr[t]),mgt[t]=!0)},"issueWarning"),gWr=C(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&vgt("LAZY_LOAD_DEPRECATED")},"checkConfig"),ygt=C(()=>{let t={};Oq&&(t=Eo(t,Oq));for(const e of cT)t=Eo(t,e);return t},"getUserDefinedConfig"),Zi=C(t=>{var e,r;return((e=t.flowchart)==null?void 0:e.htmlLabels)!=null&&vgt("FLOWCHART_HTML_LABELS_DEPRECATED"),Xm(t.htmlLabels??((r=t.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),bgt=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,MB=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,mWr=/\s*%%.*\n/gm,xgt=(AD=class extends Error{constructor(e){super(e),this.name="UnknownDiagramError"}},C(AD,"UnknownDiagramError"),AD),uT={},cye=C(function(t,e){t=t.replace(bgt,"").replace(MB,"").replace(mWr,` +`);for(const[r,{detector:n}]of Object.entries(uT))if(n(t,e))return r;throw new xgt(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),uye=C((...t)=>{for(const{id:e,detector:r,loader:n}of t)wgt(e,r,n)},"registerLazyLoadedDiagrams"),wgt=C((t,e,r)=>{uT[t]&&me.warn(`Detector with key ${t} already exists. Overwriting.`),uT[t]={detector:e,loader:r},me.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),vWr=C(t=>uT[t].loader,"getDiagramLoader"),k5=//gi,yWr=C(t=>t?Cgt(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),bWr=(()=>{let t=!1;return()=>{t||(Agt(),t=!0)}})();function Agt(){const t="data-temp-href-target";Oy.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),Oy.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener"))})}C(Agt,"setupDompurifyHooks");var Sgt=C(t=>(bWr(),Oy.sanitize(t)),"removeScript"),Tgt=C((t,e)=>{if(Zi(e)){const r=e.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?t=Sgt(t):r!=="loose"&&(t=Cgt(t),t=t.replace(//g,">"),t=t.replace(/=/g,"="),t=SWr(t))}return t},"sanitizeMore"),ai=C((t,e)=>t&&(e.dompurifyConfig?t=Oy.sanitize(Tgt(t,e),e.dompurifyConfig).toString():t=Oy.sanitize(Tgt(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),xWr=C((t,e)=>typeof t=="string"?ai(t,e):t.flat().map(r=>ai(r,e)),"sanitizeTextOrArray"),wWr=C(t=>k5.test(t),"hasBreaks"),AWr=C(t=>t.split(k5),"splitBreaks"),SWr=C(t=>t.replace(/#br#/g,"
"),"placeholderToBreak"),Cgt=C(t=>t.replace(k5,"#br#"),"breakToPlaceholder"),Eq=C(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),TWr=C(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),CWr=C(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),Hx=C(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,t.split(e).length-1),"countOccurrence"),OWr=C((t,e)=>{const r=hye(t,"~"),n=hye(e,"~");return r===1&&n===1},"shouldCombineSets"),kWr=C(t=>{const e=hye(t,"~");let r=!1;if(e<=1)return t;e%2!==0&&t.startsWith("~")&&(t=t.substring(1),r=!0);const n=[...t];let i=n.indexOf("~"),a=n.lastIndexOf("~");for(;i!==-1&&a!==-1&&i!==a;)n[i]="<",n[a]=">",i=n.indexOf("~"),a=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")},"processSet"),Ogt=C(()=>window.MathMLElement!==void 0,"isMathMLSupported"),dye=/\$\$(.*?)\$\$/g,io=C(t=>{var e;return(((e=t.match(dye))==null?void 0:e.length)??0)>0},"hasKatex"),IB=C(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await _q(t,e),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0";const n=document.querySelector("body");n==null||n.insertAdjacentElement("beforeend",r);const i={width:r.clientWidth,height:r.clientHeight};return r.remove(),i},"calculateMathMLDimensions"),EWr=C(async(t,e)=>{if(!io(t))return t;if(!(Ogt()||e.legacyMathML||e.forceLegacyMathML))return t.replace(dye,"MathML is unsupported in this environment.");{const{default:r}=await Promise.resolve().then(()=>Mxn),n=e.forceLegacyMathML||!Ogt()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(k5).map(i=>io(i)?`
${i}
`:`
${i}
`).join("").replace(dye,(i,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),_q=C(async(t,e)=>ai(await EWr(t,e),e),"renderKatexSanitized"),jt={getRows:yWr,sanitizeText:ai,sanitizeTextOrArray:xWr,hasBreaks:wWr,splitBreaks:AWr,lineBreakRegex:k5,removeScript:Sgt,getUrl:Eq,evaluate:Xm,getMax:TWr,getMin:CWr},_Wr=C(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),RWr=C(function(t,e,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${e}px;`)):(n.set("height",t),n.set("width",e)),n},"calculateSvgSizeAttrs"),zs=C(function(t,e,r,n){const i=RWr(e,r,n);_Wr(t,i)},"configureSvgSize"),E5=C(function(t,e,r,n){const i=e.node().getBBox(),a=i.width,s=i.height;me.info(`SVG bounds: ${a}x${s}`,i);let o=0,l=0;me.info(`Graph bounds: ${o}x${l}`,t),o=a+r*2,l=s+r*2,me.info(`Calculated bounds: ${o}x${l}`),zs(e,l,o,n);const u=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;e.attr("viewBox",u)},"setupGraphViewbox"),Rq={};function fye(t){return[...t.cssRules].map(e=>e.cssText).join(` `)}C(fye,"cssStyleSheetToString");var DWr=C((t,e,r,n)=>{let i="";return t in Rq&&Rq[t]?i=Rq[t]({...r,svgId:n}):me.warn(`No theme found for ${t}`),`& { font-family: ${r.fontFamily}; font-size: ${r.fontSize}; @@ -493,23 +493,23 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho ${e} `},"getStyles"),LWr=C((t,e)=>{e!==void 0&&(Rq[t]=e)},"addStylesForDiagram"),MWr=DWr,pye={};wq(pye,{clear:()=>Aa,getAccDescription:()=>ts,getAccTitle:()=>Ja,getDiagramTitle:()=>La,setAccDescription:()=>es,setAccTitle:()=>Da,setDiagramTitle:()=>rs});var gye="",mye="",vye="",yye=C(t=>ai(t,Dr()),"sanitizeText"),Aa=C(()=>{gye="",vye="",mye=""},"clear"),Da=C(t=>{gye=yye(t).replace(/^\s+/g,"")},"setAccTitle"),Ja=C(()=>gye,"getAccTitle"),es=C(t=>{vye=yye(t).replace(/\n\s+/g,` -`)},"setAccDescription"),ts=C(()=>vye,"getAccDescription"),rs=C(t=>{mye=yye(t)},"setDiagramTitle"),La=C(()=>mye,"getDiagramTitle"),kgt=me,IWr=Kve,He=Dr,bye=pgt,Egt=O5,xye=C(t=>ai(t,He()),"sanitizeText"),wye=E5,PWr=C(()=>pye,"getCommonDb"),Dq={},Lq=C((t,e,r)=>{var n;Dq[t]&&kgt.warn(`Diagram with id ${t} already registered. Overwriting.`),Dq[t]=e,r&&wgt(t,r),LWr(t,e.styles),(n=e.injectUtils)==null||n.call(e,kgt,IWr,He,xye,wye,PWr(),()=>{})},"registerDiagram"),Aye=C(t=>{if(t in Dq)return Dq[t];throw new NWr(t)},"getDiagram"),NWr=(TD=class extends Error{constructor(e){super(`Diagram ${e} not found.`)}},C(TD,"DiagramNotFoundError"),TD);function Mq(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function BWr(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function Tye(t){let e,r,n;t.length!==2?(e=Mq,r=(o,l)=>Mq(t(o),l),n=(o,l)=>t(o)-l):(e=t===Mq||t===BWr?t:$Wr,r=t,n=t);function i(o,l,u=0,h=o.length){if(u>>1;r(o[d],l)<0?u=d+1:h=d}while(u>>1;r(o[d],l)<=0?u=d+1:h=d}while(uu&&n(o[d-1],l)>-n(o[d],l)?d-1:d}return{left:i,center:s,right:a}}function $Wr(){return 0}function FWr(t){return t===null?NaN:+t}const zWr=Tye(Mq).right;Tye(FWr).center;class _gt extends Map{constructor(e,r=QWr){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const[n,i]of e)this.set(n,i)}get(e){return super.get(Rgt(this,e))}has(e){return super.has(Rgt(this,e))}set(e,r){return super.set(UWr(this,e),r)}delete(e){return super.delete(VWr(this,e))}}function Rgt({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function UWr({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function VWr({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function QWr(t){return t!==null&&typeof t=="object"?t.valueOf():t}const GWr=Math.sqrt(50),HWr=Math.sqrt(10),WWr=Math.sqrt(2);function Iq(t,e,r){const n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),s=a>=GWr?10:a>=HWr?5:a>=WWr?2:1;let o,l,u;return i<0?(u=Math.pow(10,-i)/s,o=Math.round(t*u),l=Math.round(e*u),o/ue&&--l,u=-u):(u=Math.pow(10,i)*s,o=Math.round(t/u),l=Math.round(e/u),o*ue&&--l),l0))return[];if(t===e)return[t];const n=e=i))return[];const o=a-i+1,l=new Array(o);if(n)if(s<0)for(let u=0;u=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}function jWr(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function XWr(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,a=new Array(i);++n+t(e)}function tYr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function rYr(){return!this.__axis}function Lgt(t,e){var r=[],n=null,i=null,a=6,s=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=t===Pq||t===Nq?-1:1,h=t===Nq||t===Oye?"x":"y",d=t===Pq||t===kye?ZWr:JWr;function f(p){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),m=i??(e.tickFormat?e.tickFormat.apply(e,r):KWr),v=Math.max(a,0)+o,y=e.range(),b=+y[0]+l,x=+y[y.length-1]+l,w=(e.bandwidth?tYr:eYr)(e.copy(),l),A=p.selection?p.selection():p,T=A.selectAll(".domain").data([null]),S=A.selectAll(".tick").data(g,e).order(),O=S.exit(),k=S.enter().append("g").attr("class","tick"),E=S.select("line"),_=S.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),S=S.merge(k),E=E.merge(k.append("line").attr("stroke","currentColor").attr(h+"2",u*a)),_=_.merge(k.append("text").attr("fill","currentColor").attr(h,u*v).attr("dy",t===Pq?"0em":t===kye?"0.71em":"0.32em")),p!==A&&(T=T.transition(p),S=S.transition(p),E=E.transition(p),_=_.transition(p),O=O.transition(p).attr("opacity",Dgt).attr("transform",function(I){return isFinite(I=w(I))?d(I+l):this.getAttribute("transform")}),k.attr("opacity",Dgt).attr("transform",function(I){var L=this.parentNode.__axis;return d((L&&isFinite(L=L(I))?L:w(I))+l)})),O.remove(),T.attr("d",t===Nq||t===Oye?s?"M"+u*s+","+b+"H"+l+"V"+x+"H"+u*s:"M"+l+","+b+"V"+x:s?"M"+b+","+u*s+"V"+l+"H"+x+"V"+u*s:"M"+b+","+l+"H"+x),S.attr("opacity",1).attr("transform",function(I){return d(w(I)+l)}),E.attr(h+"2",u*a),_.attr(h,u*v).text(m),A.filter(rYr).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Oye?"start":t===Nq?"end":"middle"),A.each(function(){this.__axis=w})}return f.scale=function(p){return arguments.length?(e=p,f):e},f.ticks=function(){return r=Array.from(arguments),f},f.tickArguments=function(p){return arguments.length?(r=p==null?[]:Array.from(p),f):r.slice()},f.tickValues=function(p){return arguments.length?(n=p==null?null:Array.from(p),f):n&&n.slice()},f.tickFormat=function(p){return arguments.length?(i=p,f):i},f.tickSize=function(p){return arguments.length?(a=s=+p,f):a},f.tickSizeInner=function(p){return arguments.length?(a=+p,f):a},f.tickSizeOuter=function(p){return arguments.length?(s=+p,f):s},f.tickPadding=function(p){return arguments.length?(o=+p,f):o},f.offset=function(p){return arguments.length?(l=+p,f):l},f}function nYr(t){return Lgt(Pq,t)}function iYr(t){return Lgt(kye,t)}var aYr={value:()=>{}};function Mgt(){for(var t=0,e=arguments.length,r={},n;t=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}Bq.prototype=Mgt.prototype={constructor:Bq,on:function(t,e){var r=this._,n=sYr(t+"",r),i,a=-1,s=n.length;if(arguments.length<2){for(;++a0)for(var r=new Array(i),n=0,i,a;n=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),Pgt.hasOwnProperty(e)?{space:Pgt[e],local:t}:t}function lYr(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===Eye&&e.documentElement.namespaceURI===Eye?e.createElement(t):e.createElementNS(r,t)}}function cYr(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Ngt(t){var e=$q(t);return(e.local?cYr:lYr)(e)}function uYr(){}function _ye(t){return t==null?uYr:function(){return this.querySelector(t)}}function hYr(t){typeof t!="function"&&(t=_ye(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i=x&&(x=b+1);!(A=v[x])&&++x=0;)(s=n[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function NYr(t){t||(t=BYr);function e(d,f){return d&&f?t(d.__data__,f.__data__):!d-!f}for(var r=this._groups,n=r.length,i=new Array(n),a=0;ae?1:t>=e?0:NaN}function $Yr(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function FYr(){return Array.from(this)}function zYr(){for(var t=this._groups,e=0,r=t.length;e1?this.each((e==null?KYr:typeof e=="function"?JYr:ZYr)(t,e,r??"")):_5(this.node(),t)}function _5(t,e){return t.style.getPropertyValue(e)||Ugt(t).getComputedStyle(t,null).getPropertyValue(e)}function tqr(t){return function(){delete this[t]}}function rqr(t,e){return function(){this[t]=e}}function nqr(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function iqr(t,e){return arguments.length>1?this.each((e==null?tqr:typeof e=="function"?nqr:rqr)(t,e)):this.node()[t]}function Vgt(t){return t.trim().split(/^|\s+/)}function Rye(t){return t.classList||new Qgt(t)}function Qgt(t){this._node=t,this._names=Vgt(t.getAttribute("class")||"")}Qgt.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Ggt(t,e){for(var r=Rye(t),n=-1,i=e.length;++n=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function Lqr(t){return function(){var e=this.__on;if(e){for(var r=0,n=-1,i=e.length,a;r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?Vq(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?Vq(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Uqr.exec(t))?new Hc(e[1],e[2],e[3],1):(e=Vqr.exec(t))?new Hc(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Qqr.exec(t))?Vq(e[1],e[2],e[3],e[4]):(e=Gqr.exec(t))?Vq(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Hqr.exec(t))?tmt(e[1],e[2]/100,e[3]/100,1):(e=Wqr.exec(t))?tmt(e[1],e[2]/100,e[3]/100,e[4]):qgt.hasOwnProperty(t)?Kgt(qgt[t]):t==="transparent"?new Hc(NaN,NaN,NaN,0):null}function Kgt(t){return new Hc(t>>16&255,t>>8&255,t&255,1)}function Vq(t,e,r,n){return n<=0&&(t=e=r=NaN),new Hc(t,e,r,n)}function Zgt(t){return t instanceof hS||(t=dS(t)),t?(t=t.rgb(),new Hc(t.r,t.g,t.b,t.opacity)):new Hc}function Dye(t,e,r,n){return arguments.length===1?Zgt(t):new Hc(t,e,r,n??1)}function Hc(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}NB(Hc,Dye,zq(hS,{brighter(t){return t=t==null?Uq:Math.pow(Uq,t),new Hc(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?BB:Math.pow(BB,t),new Hc(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Hc(fS(this.r),fS(this.g),fS(this.b),Qq(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:Jgt,formatHex:Jgt,formatHex8:jqr,formatRgb:emt,toString:emt}));function Jgt(){return`#${pS(this.r)}${pS(this.g)}${pS(this.b)}`}function jqr(){return`#${pS(this.r)}${pS(this.g)}${pS(this.b)}${pS((isNaN(this.opacity)?1:this.opacity)*255)}`}function emt(){const t=Qq(this.opacity);return`${t===1?"rgb(":"rgba("}${fS(this.r)}, ${fS(this.g)}, ${fS(this.b)}${t===1?")":`, ${t})`}`}function Qq(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function fS(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function pS(t){return t=fS(t),(t<16?"0":"")+t.toString(16)}function tmt(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new ng(t,e,r,n)}function rmt(t){if(t instanceof ng)return new ng(t.h,t.s,t.l,t.opacity);if(t instanceof hS||(t=dS(t)),!t)return new ng;if(t instanceof ng)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),s=NaN,o=a-i,l=(a+i)/2;return o?(e===a?s=(r-n)/o+(r0&&l<1?0:s,new ng(s,o,l,t.opacity)}function Xqr(t,e,r,n){return arguments.length===1?rmt(t):new ng(t,e,r,n??1)}function ng(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}NB(ng,Xqr,zq(hS,{brighter(t){return t=t==null?Uq:Math.pow(Uq,t),new ng(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?BB:Math.pow(BB,t),new ng(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new Hc(Lye(t>=240?t-240:t+120,i,n),Lye(t,i,n),Lye(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new ng(nmt(this.h),Gq(this.s),Gq(this.l),Qq(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 t=Qq(this.opacity);return`${t===1?"hsl(":"hsla("}${nmt(this.h)}, ${Gq(this.s)*100}%, ${Gq(this.l)*100}%${t===1?")":`, ${t})`}`}}));function nmt(t){return t=(t||0)%360,t<0?t+360:t}function Gq(t){return Math.max(0,Math.min(1,t||0))}function Lye(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const Kqr=Math.PI/180,Zqr=180/Math.PI,Hq=18,imt=.96422,amt=1,smt=.82521,omt=4/29,D5=6/29,lmt=3*D5*D5,Jqr=D5*D5*D5;function cmt(t){if(t instanceof Zm)return new Zm(t.l,t.a,t.b,t.opacity);if(t instanceof _y)return umt(t);t instanceof Hc||(t=Zgt(t));var e=Nye(t.r),r=Nye(t.g),n=Nye(t.b),i=Mye((.2225045*e+.7168786*r+.0606169*n)/amt),a,s;return e===r&&r===n?a=s=i:(a=Mye((.4360747*e+.3850649*r+.1430804*n)/imt),s=Mye((.0139322*e+.0971045*r+.7141733*n)/smt)),new Zm(116*i-16,500*(a-i),200*(i-s),t.opacity)}function ejr(t,e,r,n){return arguments.length===1?cmt(t):new Zm(t,e,r,n??1)}function Zm(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}NB(Zm,ejr,zq(hS,{brighter(t){return new Zm(this.l+Hq*(t??1),this.a,this.b,this.opacity)},darker(t){return new Zm(this.l-Hq*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return e=imt*Iye(e),t=amt*Iye(t),r=smt*Iye(r),new Hc(Pye(3.1338561*e-1.6168667*t-.4906146*r),Pye(-.9787684*e+1.9161415*t+.033454*r),Pye(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function Mye(t){return t>Jqr?Math.pow(t,1/3):t/lmt+omt}function Iye(t){return t>D5?t*t*t:lmt*(t-omt)}function Pye(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Nye(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function tjr(t){if(t instanceof _y)return new _y(t.h,t.c,t.l,t.opacity);if(t instanceof Zm||(t=cmt(t)),t.a===0&&t.b===0)return new _y(NaN,0()=>t;function hmt(t,e){return function(r){return t+r*e}}function rjr(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function njr(t,e){var r=e-t;return r?hmt(t,r>180||r<-180?r-360*Math.round(r/360):r):Wq(isNaN(t)?e:t)}function ijr(t){return(t=+t)==1?FB:function(e,r){return r-e?rjr(e,r,t):Wq(isNaN(e)?r:e)}}function FB(t,e){var r=e-t;return r?hmt(t,r):Wq(isNaN(t)?e:t)}const Yq=function t(e){var r=ijr(e);function n(i,a){var s=r((i=Dye(i)).r,(a=Dye(a)).r),o=r(i.g,a.g),l=r(i.b,a.b),u=FB(i.opacity,a.opacity);return function(h){return i.r=s(h),i.g=o(h),i.b=l(h),i.opacity=u(h),i+""}}return n.gamma=t,n}(1);function ajr(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(a){for(i=0;ir&&(a=e.slice(r,a),o[s]?o[s]+=a:o[++s]=a),(n=n[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,l.push({i:s,x:ig(n,i)})),r=Fye.lastIndex;return r180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,n)-2,x:ig(u,h)})):h&&d.push(i(d)+"rotate("+h+n)}function o(u,h,d,f){u!==h?f.push({i:d.push(i(d)+"skewX(",null,n)-2,x:ig(u,h)}):h&&d.push(i(d)+"skewX("+h+n)}function l(u,h,d,f,p,g){if(u!==d||h!==f){var m=p.push(i(p)+"scale(",null,",",null,")");g.push({i:m-4,x:ig(u,d)},{i:m-2,x:ig(h,f)})}else(d!==1||f!==1)&&p.push(i(p)+"scale("+d+","+f+")")}return function(u,h){var d=[],f=[];return u=t(u),h=t(h),a(u.translateX,u.translateY,h.translateX,h.translateY,d,f),s(u.rotate,h.rotate,d,f),o(u.skewX,h.skewX,d,f),l(u.scaleX,u.scaleY,h.scaleX,h.scaleY,d,f),u=h=null,function(p){for(var g=-1,m=f.length,v;++g=0&&t._call.call(void 0,e),t=t._next;--L5}function bmt(){gS=(Xq=QB.now())+Kq,L5=zB=0;try{xjr()}finally{L5=0,Ajr(),gS=0}}function wjr(){var t=QB.now(),e=t-Xq;e>mmt&&(Kq-=e,Xq=t)}function Ajr(){for(var t,e=jq,r,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:jq=r);VB=t,Qye(n)}function Qye(t){if(!L5){zB&&(zB=clearTimeout(zB));var e=t-gS;e>24?(t<1/0&&(zB=setTimeout(bmt,t-QB.now()-Kq)),UB&&(UB=clearInterval(UB))):(UB||(Xq=QB.now(),UB=setInterval(wjr,mmt)),L5=1,vmt(bmt))}}function xmt(t,e,r){var n=new Zq;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var Tjr=Mgt("start","end","cancel","interrupt"),Sjr=[],wmt=0,Amt=1,Gye=2,Jq=3,Tmt=4,Hye=5,ej=6;function tj(t,e,r,n,i,a){var s=t.__transition;if(!s)t.__transition={};else if(r in s)return;Cjr(t,r,{name:e,index:n,group:i,on:Tjr,tween:Sjr,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:wmt})}function Wye(t,e){var r=ag(t,e);if(r.state>wmt)throw new Error("too late; already scheduled");return r}function Jm(t,e){var r=ag(t,e);if(r.state>Jq)throw new Error("too late; already running");return r}function ag(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function Cjr(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=ymt(a,0,r.time);function a(u){r.state=Amt,r.timer.restart(s,r.delay,r.time),r.delay<=u&&s(u-r.delay)}function s(u){var h,d,f,p;if(r.state!==Amt)return l();for(h in n)if(p=n[h],p.name===r.name){if(p.state===Jq)return xmt(s);p.state===Tmt?(p.state=ej,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete n[h]):+hGye&&n.state=0&&(e=e.slice(0,r)),!e||e==="start"})}function rXr(t,e,r){var n,i,a=tXr(e)?Wye:Jm;return function(){var s=a(this,t),o=s.on;o!==n&&(i=(n=o).copy()).on(e,r),s.on=i}}function nXr(t,e){var r=this._id;return arguments.length<2?ag(this.node(),r).on.on(t):this.each(rXr(r,t,e))}function iXr(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function aXr(){return this.on("end.remove",iXr(this._id))}function sXr(t){var e=this._name,r=this._id;typeof t!="function"&&(t=_ye(t));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s=0))throw new Error(`invalid digits: ${t}`);if(e>15)return kmt;const r=10**e;return function(n){this._+=n[0];for(let i=1,a=n.length;imS)if(!(Math.abs(d*l-u*h)>mS)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let p=n-s,g=i-o,m=l*l+u*u,v=p*p+g*g,y=Math.sqrt(m),b=Math.sqrt(f),x=a*Math.tan((qye-Math.acos((m+f-v)/(2*y*b)))/2),w=x/b,A=x/y;Math.abs(w-1)>mS&&this._append`L${e+w*h},${r+w*d}`,this._append`A${a},${a},0,0,${+(d*p>h*g)},${this._x1=e+A*l},${this._y1=r+A*u}`}}arc(e,r,n,i,a,s){if(e=+e,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(i),l=n*Math.sin(i),u=e+o,h=r+l,d=1^s,f=s?i-a:a-i;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>mS||Math.abs(this._y1-h)>mS)&&this._append`L${u},${h}`,n&&(f<0&&(f=f%jye+jye),f>DXr?this._append`A${n},${n},0,1,${d},${e-o},${r-l}A${n},${n},0,1,${d},${this._x1=u},${this._y1=h}`:f>mS&&this._append`A${n},${n},0,${+(f>=qye)},${d},${this._x1=e+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(e,r,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};function IXr(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function rj(t,e){if(!isFinite(t)||t===0)return null;var r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function M5(t){return t=rj(Math.abs(t)),t?t[1]:NaN}function PXr(t,e){return function(r,n){for(var i=r.length,a=[],s=0,o=t[0],l=0;i>0&&o>0&&(l+o+1>n&&(o=Math.max(1,n-l)),a.push(r.substring(i-=o,i+o)),!((l+=o+1)>n));)o=t[s=(s+1)%t.length];return a.reverse().join(e)}}function NXr(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var BXr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function nj(t){if(!(e=BXr.exec(t)))throw new Error("invalid format: "+t);var e;return new Xye({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}nj.prototype=Xye.prototype;function Xye(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Xye.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function $Xr(t){e:for(var e=t.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(i+1):t}var ij;function FXr(t,e){var r=rj(t,e);if(!r)return ij=void 0,t.toPrecision(e);var n=r[0],i=r[1],a=i-(ij=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return a===s?n:a>s?n+new Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+rj(t,Math.max(0,e+a-1))[0]}function Emt(t,e){var r=rj(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const _mt={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:IXr,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Emt(t*100,e),r:Emt,s:FXr,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Rmt(t){return t}var Dmt=Array.prototype.map,Lmt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function zXr(t){var e=t.grouping===void 0||t.thousands===void 0?Rmt:PXr(Dmt.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?Rmt:NXr(Dmt.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",o=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(d,f){d=nj(d);var p=d.fill,g=d.align,m=d.sign,v=d.symbol,y=d.zero,b=d.width,x=d.comma,w=d.precision,A=d.trim,T=d.type;T==="n"?(x=!0,T="g"):_mt[T]||(w===void 0&&(w=12),A=!0,T="g"),(y||p==="0"&&g==="=")&&(y=!0,p="0",g="=");var S=(f&&f.prefix!==void 0?f.prefix:"")+(v==="$"?r:v==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():""),O=(v==="$"?n:/[%p]/.test(T)?s:"")+(f&&f.suffix!==void 0?f.suffix:""),k=_mt[T],E=/[defgprs%]/.test(T);w=w===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function _(I){var L=S,R=O,D,M,P;if(T==="c")R=k(I)+R,I="";else{I=+I;var N=I<0||1/I<0;if(I=isNaN(I)?l:k(Math.abs(I),w),A&&(I=$Xr(I)),N&&+I==0&&m!=="+"&&(N=!1),L=(N?m==="("?m:o:m==="-"||m==="("?"":m)+L,R=(T==="s"&&!isNaN(I)&&ij!==void 0?Lmt[8+ij/3]:"")+R+(N&&m==="("?")":""),E){for(D=-1,M=I.length;++DP||P>57){R=(P===46?i+I.slice(D+1):I.slice(D))+R,I=I.slice(0,D);break}}}x&&!y&&(I=e(I,1/0));var F=L.length+I.length+R.length,B=F>1)+L+I+R+B.slice(F);break;default:I=B+L+I+R;break}return a(I)}return _.toString=function(){return d+""},_}function h(d,f){var p=Math.max(-8,Math.min(8,Math.floor(M5(f)/3)))*3,g=Math.pow(10,-p),m=u((d=nj(d),d.type="f",d),{suffix:Lmt[8+p/3]});return function(v){return m(g*v)}}return{format:u,formatPrefix:h}}var aj,vS,Mmt;UXr({thousands:",",grouping:[3],currency:["$",""]});function UXr(t){return aj=zXr(t),vS=aj.format,Mmt=aj.formatPrefix,aj}function VXr(t){return Math.max(0,-M5(Math.abs(t)))}function QXr(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(M5(e)/3)))*3-M5(Math.abs(t)))}function GXr(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,M5(e)-M5(t))+1}function HXr(t){var e=0,r=t.children,n=r&&r.length;if(!n)e=1;else for(;--n>=0;)e+=r[n].value;t.value=e}function WXr(){return this.eachAfter(HXr)}function YXr(t,e){let r=-1;for(const n of this)t.call(e,n,++r,this);return this}function qXr(t,e){for(var r=this,n=[r],i,a,s=-1;r=n.pop();)if(t.call(e,r,++s,this),i=r.children)for(a=i.length-1;a>=0;--a)n.push(i[a]);return this}function jXr(t,e){for(var r=this,n=[r],i=[],a,s,o,l=-1;r=n.pop();)if(i.push(r),a=r.children)for(s=0,o=a.length;s=0;)r+=n[i].value;e.value=r})}function ZXr(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function JXr(t){for(var e=this,r=eKr(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n}function eKr(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;for(t=r.pop(),e=n.pop();t===e;)i=t,t=r.pop(),e=n.pop();return i}function tKr(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function rKr(){return Array.from(this)}function nKr(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function iKr(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*aKr(){var t=this,e,r=[t],n,i,a;do for(e=r.reverse(),r=[];t=e.pop();)if(yield t,n=t.children)for(i=0,a=n.length;i=0;--o)i.push(a=s[o]=new sj(s[o])),a.parent=n,a.depth=n.depth+1;return r.eachBefore(uKr)}function sKr(){return Kye(this).eachBefore(cKr)}function oKr(t){return t.children}function lKr(t){return Array.isArray(t)?t[1]:null}function cKr(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function uKr(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function sj(t){this.data=t,this.depth=this.height=0,this.parent=null}sj.prototype=Kye.prototype={constructor:sj,count:WXr,each:YXr,eachAfter:jXr,eachBefore:qXr,find:XXr,sum:KXr,sort:ZXr,path:JXr,ancestors:tKr,descendants:rKr,leaves:nKr,links:iKr,copy:sKr,[Symbol.iterator]:aKr};function hKr(t){if(typeof t!="function")throw new Error;return t}function GB(){return 0}function HB(t){return function(){return t}}function dKr(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function fKr(t,e,r,n,i){for(var a=t.children,s,o=-1,l=a.length,u=t.value&&(n-e)/t.value;++ob&&(b=u),T=v*v*A,x=Math.max(b/T,T/y),x>w){v-=u;break}w=x}s.push(l={value:v,dice:p1?n:1)},r}(gKr);function yKr(){var t=vKr,e=!1,r=1,n=1,i=[0],a=GB,s=GB,o=GB,l=GB,u=GB;function h(f){return f.x0=f.y0=0,f.x1=r,f.y1=n,f.eachBefore(d),i=[0],e&&f.eachBefore(dKr),f}function d(f){var p=i[f.depth],g=f.x0+p,m=f.y0+p,v=f.x1-p,y=f.y1-p;ve&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function AKr(t,e,r){var n=t[0],i=t[1],a=e[0],s=e[1];return i2?TKr:AKr,l=u=null,d}function d(f){return f==null||isNaN(f=+f)?a:(l||(l=o(t.map(n),e,r)))(n(s(f)))}return d.invert=function(f){return s(i((u||(u=o(e,t.map(n),ig)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,xKr),h()):t.slice()},d.range=function(f){return arguments.length?(e=Array.from(f),h()):e.slice()},d.rangeRound=function(f){return e=Array.from(f),r=djr,h()},d.clamp=function(f){return arguments.length?(s=f?!0:I5,h()):s!==I5},d.interpolate=function(f){return arguments.length?(r=f,h()):r},d.unknown=function(f){return arguments.length?(a=f,d):a},function(f,p){return n=f,i=p,h()}}function Bmt(){return SKr()(I5,I5)}function CKr(t,e,r,n){var i=Cye(t,e,r),a;switch(n=nj(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=QXr(i,s))&&(n.precision=a),Mmt(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=GXr(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=VXr(i))&&(n.precision=a-(n.type==="%")*2);break}}return vS(n)}function OKr(t){var e=t.domain;return t.ticks=function(r){var n=e();return YWr(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return CKr(i[0],i[i.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),i=0,a=n.length-1,s=n[i],o=n[a],l,u,h=10;for(o0;){if(u=Sye(s,o,r),u===l)return n[i]=s,n[a]=o,e(n);if(u>0)s=Math.floor(s/u)*u,o=Math.ceil(o/u)*u;else if(u<0)s=Math.ceil(s*u)/u,o=Math.floor(o*u)/u;else break;l=u}return t},t}function P5(){var t=Bmt();return t.copy=function(){return Nmt(t,P5())},oj.apply(t,arguments),OKr(t)}function kKr(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],a=t[n],s;return a(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{const s=i(a),o=i.ceil(a);return a-s(e(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,o)=>{const l=[];if(a=i.ceil(a),o=o==null?1:Math.floor(o),!(a0))return l;let u;do l.push(u=new Date(+a)),e(a,o),t(a);while(uZo(s=>{if(s>=s)for(;t(s),!a(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;e(s,-1),!a(s););else for(;--o>=0;)for(;e(s,1),!a(s););}),r&&(i.count=(a,s)=>(e1e.setTime(+a),t1e.setTime(+s),t(e1e),t(t1e),Math.floor(r(e1e,t1e))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?s=>n(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const N5=Zo(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);N5.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Zo(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):N5),N5.range;const Ly=1e3,Jf=Ly*60,My=Jf*60,Iy=My*24,r1e=Iy*7,$mt=Iy*30,n1e=Iy*365,Wx=Zo(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Ly)},(t,e)=>(e-t)/Ly,t=>t.getUTCSeconds());Wx.range;const WB=Zo(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Ly)},(t,e)=>{t.setTime(+t+e*Jf)},(t,e)=>(e-t)/Jf,t=>t.getMinutes());WB.range,Zo(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Jf)},(t,e)=>(e-t)/Jf,t=>t.getUTCMinutes()).range;const YB=Zo(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Ly-t.getMinutes()*Jf)},(t,e)=>{t.setTime(+t+e*My)},(t,e)=>(e-t)/My,t=>t.getHours());YB.range,Zo(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*My)},(t,e)=>(e-t)/My,t=>t.getUTCHours()).range;const bS=Zo(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Jf)/Iy,t=>t.getDate()-1);bS.range;const i1e=Zo(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Iy,t=>t.getUTCDate()-1);i1e.range,Zo(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Iy,t=>Math.floor(t/Iy)).range;function xS(t){return Zo(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*Jf)/r1e)}const qB=xS(0),jB=xS(1),Fmt=xS(2),zmt=xS(3),wS=xS(4),Umt=xS(5),Vmt=xS(6);qB.range,jB.range,Fmt.range,zmt.range,wS.range,Umt.range,Vmt.range;function AS(t){return Zo(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/r1e)}const Qmt=AS(0),lj=AS(1),EKr=AS(2),_Kr=AS(3),B5=AS(4),RKr=AS(5),DKr=AS(6);Qmt.range,lj.range,EKr.range,_Kr.range,B5.range,RKr.range,DKr.range;const XB=Zo(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());XB.range,Zo(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()).range;const Py=Zo(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Py.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Zo(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)}),Py.range;const TS=Zo(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());TS.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Zo(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)}),TS.range;function LKr(t,e,r,n,i,a){const s=[[Wx,1,Ly],[Wx,5,5*Ly],[Wx,15,15*Ly],[Wx,30,30*Ly],[a,1,Jf],[a,5,5*Jf],[a,15,15*Jf],[a,30,30*Jf],[i,1,My],[i,3,3*My],[i,6,6*My],[i,12,12*My],[n,1,Iy],[n,2,2*Iy],[r,1,r1e],[e,1,$mt],[e,3,3*$mt],[t,1,n1e]];function o(u,h,d){const f=hv).right(s,f);if(p===s.length)return t.every(Cye(u/n1e,h/n1e,d));if(p===0)return N5.every(Math.max(Cye(u,h,d),1));const[g,m]=s[f/s[p-1][2]53)return null;"w"in re||(re.w=1),"Z"in re?(ae=s1e(KB(re.y,0,1)),Ce=ae.getUTCDay(),ae=Ce>4||Ce===0?lj.ceil(ae):lj(ae),ae=i1e.offset(ae,(re.V-1)*7),re.y=ae.getUTCFullYear(),re.m=ae.getUTCMonth(),re.d=ae.getUTCDate()+(re.w+6)%7):(ae=a1e(KB(re.y,0,1)),Ce=ae.getDay(),ae=Ce>4||Ce===0?jB.ceil(ae):jB(ae),ae=bS.offset(ae,(re.V-1)*7),re.y=ae.getFullYear(),re.m=ae.getMonth(),re.d=ae.getDate()+(re.w+6)%7)}else("W"in re||"U"in re)&&("w"in re||(re.w="u"in re?re.u%7:"W"in re?1:0),Ce="Z"in re?s1e(KB(re.y,0,1)).getUTCDay():a1e(KB(re.y,0,1)).getDay(),re.m=0,re.d="W"in re?(re.w+6)%7+re.W*7-(Ce+5)%7:re.w+re.U*7-(Ce+6)%7);return"Z"in re?(re.H+=re.Z/100|0,re.M+=re.Z%100,s1e(re)):a1e(re)}}function O(q,Z,ee,re){for(var ve=0,ae=Z.length,Ce=ee.length,Oe,$e;ve=Ce)return-1;if(Oe=Z.charCodeAt(ve++),Oe===37){if(Oe=Z.charAt(ve++),$e=A[Oe in Gmt?Z.charAt(ve++):Oe],!$e||(re=$e(q,ee,re))<0)return-1}else if(Oe!=ee.charCodeAt(re++))return-1}return re}function k(q,Z,ee){var re=u.exec(Z.slice(ee));return re?(q.p=h.get(re[0].toLowerCase()),ee+re[0].length):-1}function E(q,Z,ee){var re=p.exec(Z.slice(ee));return re?(q.w=g.get(re[0].toLowerCase()),ee+re[0].length):-1}function _(q,Z,ee){var re=d.exec(Z.slice(ee));return re?(q.w=f.get(re[0].toLowerCase()),ee+re[0].length):-1}function I(q,Z,ee){var re=y.exec(Z.slice(ee));return re?(q.m=b.get(re[0].toLowerCase()),ee+re[0].length):-1}function L(q,Z,ee){var re=m.exec(Z.slice(ee));return re?(q.m=v.get(re[0].toLowerCase()),ee+re[0].length):-1}function R(q,Z,ee){return O(q,e,Z,ee)}function D(q,Z,ee){return O(q,r,Z,ee)}function M(q,Z,ee){return O(q,n,Z,ee)}function P(q){return s[q.getDay()]}function N(q){return a[q.getDay()]}function F(q){return l[q.getMonth()]}function B(q){return o[q.getMonth()]}function V(q){return i[+(q.getHours()>=12)]}function z(q){return 1+~~(q.getMonth()/3)}function U(q){return s[q.getUTCDay()]}function Q(q){return a[q.getUTCDay()]}function G(q){return l[q.getUTCMonth()]}function X(q){return o[q.getUTCMonth()]}function Y(q){return i[+(q.getUTCHours()>=12)]}function le(q){return 1+~~(q.getUTCMonth()/3)}return{format:function(q){var Z=T(q+="",x);return Z.toString=function(){return q},Z},parse:function(q){var Z=S(q+="",!1);return Z.toString=function(){return q},Z},utcFormat:function(q){var Z=T(q+="",w);return Z.toString=function(){return q},Z},utcParse:function(q){var Z=S(q+="",!0);return Z.toString=function(){return q},Z}}}var Gmt={"-":"",_:" ",0:"0"},kl=/^\s*\d+/,NKr=/^%/,BKr=/[\\^$*+?|[\]().{}]/g;function Bi(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a[e.toLowerCase(),r]))}function FKr(t,e,r){var n=kl.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function zKr(t,e,r){var n=kl.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function UKr(t,e,r){var n=kl.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function VKr(t,e,r){var n=kl.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function QKr(t,e,r){var n=kl.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function Hmt(t,e,r){var n=kl.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Wmt(t,e,r){var n=kl.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function GKr(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function HKr(t,e,r){var n=kl.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function WKr(t,e,r){var n=kl.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Ymt(t,e,r){var n=kl.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function YKr(t,e,r){var n=kl.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function qmt(t,e,r){var n=kl.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function qKr(t,e,r){var n=kl.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function jKr(t,e,r){var n=kl.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function XKr(t,e,r){var n=kl.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function KKr(t,e,r){var n=kl.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function ZKr(t,e,r){var n=NKr.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function JKr(t,e,r){var n=kl.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function eZr(t,e,r){var n=kl.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function jmt(t,e){return Bi(t.getDate(),e,2)}function tZr(t,e){return Bi(t.getHours(),e,2)}function rZr(t,e){return Bi(t.getHours()%12||12,e,2)}function nZr(t,e){return Bi(1+bS.count(Py(t),t),e,3)}function Xmt(t,e){return Bi(t.getMilliseconds(),e,3)}function iZr(t,e){return Xmt(t,e)+"000"}function aZr(t,e){return Bi(t.getMonth()+1,e,2)}function sZr(t,e){return Bi(t.getMinutes(),e,2)}function oZr(t,e){return Bi(t.getSeconds(),e,2)}function lZr(t){var e=t.getDay();return e===0?7:e}function cZr(t,e){return Bi(qB.count(Py(t)-1,t),e,2)}function Kmt(t){var e=t.getDay();return e>=4||e===0?wS(t):wS.ceil(t)}function uZr(t,e){return t=Kmt(t),Bi(wS.count(Py(t),t)+(Py(t).getDay()===4),e,2)}function hZr(t){return t.getDay()}function dZr(t,e){return Bi(jB.count(Py(t)-1,t),e,2)}function fZr(t,e){return Bi(t.getFullYear()%100,e,2)}function pZr(t,e){return t=Kmt(t),Bi(t.getFullYear()%100,e,2)}function gZr(t,e){return Bi(t.getFullYear()%1e4,e,4)}function mZr(t,e){var r=t.getDay();return t=r>=4||r===0?wS(t):wS.ceil(t),Bi(t.getFullYear()%1e4,e,4)}function vZr(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Bi(e/60|0,"0",2)+Bi(e%60,"0",2)}function Zmt(t,e){return Bi(t.getUTCDate(),e,2)}function yZr(t,e){return Bi(t.getUTCHours(),e,2)}function bZr(t,e){return Bi(t.getUTCHours()%12||12,e,2)}function xZr(t,e){return Bi(1+i1e.count(TS(t),t),e,3)}function Jmt(t,e){return Bi(t.getUTCMilliseconds(),e,3)}function wZr(t,e){return Jmt(t,e)+"000"}function AZr(t,e){return Bi(t.getUTCMonth()+1,e,2)}function TZr(t,e){return Bi(t.getUTCMinutes(),e,2)}function SZr(t,e){return Bi(t.getUTCSeconds(),e,2)}function CZr(t){var e=t.getUTCDay();return e===0?7:e}function OZr(t,e){return Bi(Qmt.count(TS(t)-1,t),e,2)}function e0t(t){var e=t.getUTCDay();return e>=4||e===0?B5(t):B5.ceil(t)}function kZr(t,e){return t=e0t(t),Bi(B5.count(TS(t),t)+(TS(t).getUTCDay()===4),e,2)}function EZr(t){return t.getUTCDay()}function _Zr(t,e){return Bi(lj.count(TS(t)-1,t),e,2)}function RZr(t,e){return Bi(t.getUTCFullYear()%100,e,2)}function DZr(t,e){return t=e0t(t),Bi(t.getUTCFullYear()%100,e,2)}function LZr(t,e){return Bi(t.getUTCFullYear()%1e4,e,4)}function MZr(t,e){var r=t.getUTCDay();return t=r>=4||r===0?B5(t):B5.ceil(t),Bi(t.getUTCFullYear()%1e4,e,4)}function IZr(){return"+0000"}function t0t(){return"%"}function r0t(t){return+t}function n0t(t){return Math.floor(+t/1e3)}var $5,cj;PZr({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function PZr(t){return $5=PKr(t),cj=$5.format,$5.parse,$5.utcFormat,$5.utcParse,$5}function NZr(t){return new Date(t)}function BZr(t){return t instanceof Date?+t:+new Date(+t)}function i0t(t,e,r,n,i,a,s,o,l,u){var h=Bmt(),d=h.invert,f=h.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),v=u("%I %p"),y=u("%a %d"),b=u("%b %d"),x=u("%B"),w=u("%Y");function A(T){return(l(T)1?0:t<-1?e7:Math.acos(t)}function s0t(t){return t>=1?uj:t<=-1?-uj:Math.asin(t)}function o0t(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);e=n}return t},()=>new MXr(e)}function QZr(t){return t.innerRadius}function GZr(t){return t.outerRadius}function HZr(t){return t.startAngle}function WZr(t){return t.endAngle}function YZr(t){return t&&t.padAngle}function qZr(t,e,r,n,i,a,s,o){var l=r-t,u=n-e,h=s-i,d=o-a,f=d*l-h*u;if(!(f*fR*R+D*D&&(O=E,k=_),{cx:O,cy:k,x01:-h,y01:-d,x11:O*(i/A-1),y11:k*(i/A-1)}}function z5(){var t=QZr,e=GZr,r=ao(0),n=null,i=HZr,a=WZr,s=YZr,o=null,l=o0t(u);function u(){var h,d,f=+t.apply(this,arguments),p=+e.apply(this,arguments),g=i.apply(this,arguments)-uj,m=a.apply(this,arguments)-uj,v=a0t(m-g),y=m>g;if(o||(o=h=l()),pYc))o.moveTo(0,0);else if(v>hj-Yc)o.moveTo(p*SS(g),p*e0(g)),o.arc(0,0,p,g,m,!y),f>Yc&&(o.moveTo(f*SS(m),f*e0(m)),o.arc(0,0,f,m,g,y));else{var b=g,x=m,w=g,A=m,T=v,S=v,O=s.apply(this,arguments)/2,k=O>Yc&&(n?+n.apply(this,arguments):F5(f*f+p*p)),E=o1e(a0t(p-f)/2,+r.apply(this,arguments)),_=E,I=E,L,R;if(k>Yc){var D=s0t(k/f*e0(O)),M=s0t(k/p*e0(O));(T-=D*2)>Yc?(D*=y?1:-1,w+=D,A-=D):(T=0,w=A=(g+m)/2),(S-=M*2)>Yc?(M*=y?1:-1,b+=M,x-=M):(S=0,b=x=(g+m)/2)}var P=p*SS(b),N=p*e0(b),F=f*SS(A),B=f*e0(A);if(E>Yc){var V=p*SS(x),z=p*e0(x),U=f*SS(w),Q=f*e0(w),G;if(vYc?I>Yc?(L=dj(U,Q,P,N,p,I,y),R=dj(V,z,F,B,p,I,y),o.moveTo(L.cx+L.x01,L.cy+L.y01),IYc)||!(T>Yc)?o.lineTo(F,B):_>Yc?(L=dj(F,B,V,z,f,-_,y),R=dj(P,N,U,Q,f,-_,y),o.lineTo(L.cx+L.x01,L.cy+L.y01),_t?1:e>=t?0:NaN}function ZZr(t){return t}function JZr(){var t=ZZr,e=KZr,r=null,n=ao(0),i=ao(hj),a=ao(0);function s(o){var l,u=(o=l0t(o)).length,h,d,f=0,p=new Array(u),g=new Array(u),m=+n.apply(this,arguments),v=Math.min(hj,Math.max(-hj,i.apply(this,arguments)-m)),y,b=Math.min(Math.abs(v)/u,a.apply(this,arguments)),x=b*(v<0?-1:1),w;for(l=0;l0&&(f+=w);for(e!=null?p.sort(function(A,T){return e(g[A],g[T])}):r!=null&&p.sort(function(A,T){return r(o[A],o[T])}),l=0,d=f?(v-u*x)/f:0;l0?w*d:0)+x,g[h]={data:o[h],index:l,value:w,startAngle:m,endAngle:y,padAngle:b};return g}return s.value=function(o){return arguments.length?(t=typeof o=="function"?o:ao(+o),s):t},s.sortValues=function(o){return arguments.length?(e=o,r=null,s):e},s.sort=function(o){return arguments.length?(r=o,e=null,s):r},s.startAngle=function(o){return arguments.length?(n=typeof o=="function"?o:ao(+o),s):n},s.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:ao(+o),s):i},s.padAngle=function(o){return arguments.length?(a=typeof o=="function"?o:ao(+o),s):a},s}class u0t{constructor(e,r){this._context=e,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,r){switch(e=+e,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,r,e,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,e,this._y0,e,r);break}}this._x0=e,this._y0=r}}function h0t(t){return new u0t(t,!0)}function d0t(t){return new u0t(t,!1)}function Yx(){}function fj(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function pj(t){this._context=t}pj.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:fj(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:fj(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function n7(t){return new pj(t)}function f0t(t){this._context=t}f0t.prototype={areaStart:Yx,areaEnd:Yx,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:fj(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function eJr(t){return new f0t(t)}function p0t(t){this._context=t}p0t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:fj(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function tJr(t){return new p0t(t)}function g0t(t,e){this._basis=new pj(t),this._beta=e}g0t.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n=t[0],i=e[0],a=t[r]-n,s=e[r]-i,o=-1,l;++o<=r;)l=o/r,this._basis.point(this._beta*t[o]+(1-this._beta)*(n+l*a),this._beta*e[o]+(1-this._beta)*(i+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const rJr=function t(e){function r(n){return e===1?new pj(n):new g0t(n,e)}return r.beta=function(n){return t(+n)},r}(.85);function gj(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function l1e(t,e){this._context=t,this._k=(1-e)/6}l1e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:gj(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:gj(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const m0t=function t(e){function r(n){return new l1e(n,e)}return r.tension=function(n){return t(+n)},r}(0);function c1e(t,e){this._context=t,this._k=(1-e)/6}c1e.prototype={areaStart:Yx,areaEnd:Yx,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:gj(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const nJr=function t(e){function r(n){return new c1e(n,e)}return r.tension=function(n){return t(+n)},r}(0);function u1e(t,e){this._context=t,this._k=(1-e)/6}u1e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:gj(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const iJr=function t(e){function r(n){return new u1e(n,e)}return r.tension=function(n){return t(+n)},r}(0);function h1e(t,e,r){var n=t._x1,i=t._y1,a=t._x2,s=t._y2;if(t._l01_a>Yc){var o=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*o-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*o-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Yc){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*u+t._x1*t._l23_2a-e*t._l12_2a)/h,s=(s*u+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,i,a,s,t._x2,t._y2)}function v0t(t,e){this._context=t,this._alpha=e}v0t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:h1e(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const y0t=function t(e){function r(n){return e?new v0t(n,e):new l1e(n,0)}return r.alpha=function(n){return t(+n)},r}(.5);function b0t(t,e){this._context=t,this._alpha=e}b0t.prototype={areaStart:Yx,areaEnd:Yx,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:h1e(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const aJr=function t(e){function r(n){return e?new b0t(n,e):new c1e(n,0)}return r.alpha=function(n){return t(+n)},r}(.5);function x0t(t,e){this._context=t,this._alpha=e}x0t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:h1e(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const sJr=function t(e){function r(n){return e?new x0t(n,e):new u1e(n,0)}return r.alpha=function(n){return t(+n)},r}(.5);function w0t(t){this._context=t}w0t.prototype={areaStart:Yx,areaEnd:Yx,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function oJr(t){return new w0t(t)}function A0t(t){return t<0?-1:1}function T0t(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),s=(r-t._y1)/(i||n<0&&-0),o=(a*i+s*n)/(n+i);return(A0t(a)+A0t(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function S0t(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function d1e(t,e,r){var n=t._x0,i=t._y0,a=t._x1,s=t._y1,o=(a-n)/3;t._context.bezierCurveTo(n+o,i+o*e,a-o,s-o*r,a,s)}function mj(t){this._context=t}mj.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:d1e(this,this._t0,S0t(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,d1e(this,S0t(this,r=T0t(this,t,e)),r);break;default:d1e(this,this._t0,r=T0t(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function C0t(t){this._context=new O0t(t)}(C0t.prototype=Object.create(mj.prototype)).point=function(t,e){mj.prototype.point.call(this,e,t)};function O0t(t){this._context=t}O0t.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,i,a){this._context.bezierCurveTo(e,t,n,r,a,i)}};function k0t(t){return new mj(t)}function E0t(t){return new C0t(t)}function _0t(t){this._context=t}_0t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var n=R0t(t),i=R0t(e),a=0,s=1;s=0;--e)i[e]=(s[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e}};function L0t(t){return new vj(t,.5)}function M0t(t){return new vj(t,0)}function I0t(t){return new vj(t,1)}function i7(t,e,r){this.k=t,this.x=e,this.y=r}i7.prototype={constructor:i7,scale:function(t){return t===1?this:new i7(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new i7(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},i7.prototype;var qc=C(t=>{var i;const{securityLevel:e}=He();let r=Ot("body");if(e==="sandbox"){const s=((i=Ot(`#i${t}`).node())==null?void 0:i.contentDocument)??document;r=Ot(s.body)}return r.select(`#${t}`)},"selectSvgElement");function f1e(t){return typeof t>"u"||t===null}C(f1e,"isNothing");function P0t(t){return typeof t=="object"&&t!==null}C(P0t,"isObject");function N0t(t){return Array.isArray(t)?t:f1e(t)?[]:[t]}C(N0t,"toArray");function B0t(t,e){var r,n,i,a;if(e)for(a=Object.keys(e),r=0,n=a.length;rvye,"getAccDescription"),rs=C(t=>{mye=yye(t)},"setDiagramTitle"),La=C(()=>mye,"getDiagramTitle"),kgt=me,IWr=Kve,He=Dr,bye=pgt,Egt=O5,xye=C(t=>ai(t,He()),"sanitizeText"),wye=E5,PWr=C(()=>pye,"getCommonDb"),Dq={},Lq=C((t,e,r)=>{var n;Dq[t]&&kgt.warn(`Diagram with id ${t} already registered. Overwriting.`),Dq[t]=e,r&&wgt(t,r),LWr(t,e.styles),(n=e.injectUtils)==null||n.call(e,kgt,IWr,He,xye,wye,PWr(),()=>{})},"registerDiagram"),Aye=C(t=>{if(t in Dq)return Dq[t];throw new NWr(t)},"getDiagram"),NWr=(SD=class extends Error{constructor(e){super(`Diagram ${e} not found.`)}},C(SD,"DiagramNotFoundError"),SD);function Mq(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function BWr(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function Sye(t){let e,r,n;t.length!==2?(e=Mq,r=(o,l)=>Mq(t(o),l),n=(o,l)=>t(o)-l):(e=t===Mq||t===BWr?t:$Wr,r=t,n=t);function i(o,l,u=0,h=o.length){if(u>>1;r(o[d],l)<0?u=d+1:h=d}while(u>>1;r(o[d],l)<=0?u=d+1:h=d}while(uu&&n(o[d-1],l)>-n(o[d],l)?d-1:d}return{left:i,center:s,right:a}}function $Wr(){return 0}function FWr(t){return t===null?NaN:+t}const zWr=Sye(Mq).right;Sye(FWr).center;class _gt extends Map{constructor(e,r=QWr){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const[n,i]of e)this.set(n,i)}get(e){return super.get(Rgt(this,e))}has(e){return super.has(Rgt(this,e))}set(e,r){return super.set(UWr(this,e),r)}delete(e){return super.delete(VWr(this,e))}}function Rgt({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function UWr({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function VWr({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function QWr(t){return t!==null&&typeof t=="object"?t.valueOf():t}const GWr=Math.sqrt(50),HWr=Math.sqrt(10),WWr=Math.sqrt(2);function Iq(t,e,r){const n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),s=a>=GWr?10:a>=HWr?5:a>=WWr?2:1;let o,l,u;return i<0?(u=Math.pow(10,-i)/s,o=Math.round(t*u),l=Math.round(e*u),o/ue&&--l,u=-u):(u=Math.pow(10,i)*s,o=Math.round(t/u),l=Math.round(e/u),o*ue&&--l),l0))return[];if(t===e)return[t];const n=e=i))return[];const o=a-i+1,l=new Array(o);if(n)if(s<0)for(let u=0;u=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}function jWr(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function XWr(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,a=new Array(i);++n+t(e)}function tYr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function rYr(){return!this.__axis}function Lgt(t,e){var r=[],n=null,i=null,a=6,s=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=t===Pq||t===Nq?-1:1,h=t===Nq||t===Oye?"x":"y",d=t===Pq||t===kye?ZWr:JWr;function f(p){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),m=i??(e.tickFormat?e.tickFormat.apply(e,r):KWr),v=Math.max(a,0)+o,y=e.range(),b=+y[0]+l,x=+y[y.length-1]+l,w=(e.bandwidth?tYr:eYr)(e.copy(),l),A=p.selection?p.selection():p,S=A.selectAll(".domain").data([null]),T=A.selectAll(".tick").data(g,e).order(),O=T.exit(),k=T.enter().append("g").attr("class","tick"),E=T.select("line"),_=T.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),T=T.merge(k),E=E.merge(k.append("line").attr("stroke","currentColor").attr(h+"2",u*a)),_=_.merge(k.append("text").attr("fill","currentColor").attr(h,u*v).attr("dy",t===Pq?"0em":t===kye?"0.71em":"0.32em")),p!==A&&(S=S.transition(p),T=T.transition(p),E=E.transition(p),_=_.transition(p),O=O.transition(p).attr("opacity",Dgt).attr("transform",function(I){return isFinite(I=w(I))?d(I+l):this.getAttribute("transform")}),k.attr("opacity",Dgt).attr("transform",function(I){var L=this.parentNode.__axis;return d((L&&isFinite(L=L(I))?L:w(I))+l)})),O.remove(),S.attr("d",t===Nq||t===Oye?s?"M"+u*s+","+b+"H"+l+"V"+x+"H"+u*s:"M"+l+","+b+"V"+x:s?"M"+b+","+u*s+"V"+l+"H"+x+"V"+u*s:"M"+b+","+l+"H"+x),T.attr("opacity",1).attr("transform",function(I){return d(w(I)+l)}),E.attr(h+"2",u*a),_.attr(h,u*v).text(m),A.filter(rYr).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Oye?"start":t===Nq?"end":"middle"),A.each(function(){this.__axis=w})}return f.scale=function(p){return arguments.length?(e=p,f):e},f.ticks=function(){return r=Array.from(arguments),f},f.tickArguments=function(p){return arguments.length?(r=p==null?[]:Array.from(p),f):r.slice()},f.tickValues=function(p){return arguments.length?(n=p==null?null:Array.from(p),f):n&&n.slice()},f.tickFormat=function(p){return arguments.length?(i=p,f):i},f.tickSize=function(p){return arguments.length?(a=s=+p,f):a},f.tickSizeInner=function(p){return arguments.length?(a=+p,f):a},f.tickSizeOuter=function(p){return arguments.length?(s=+p,f):s},f.tickPadding=function(p){return arguments.length?(o=+p,f):o},f.offset=function(p){return arguments.length?(l=+p,f):l},f}function nYr(t){return Lgt(Pq,t)}function iYr(t){return Lgt(kye,t)}var aYr={value:()=>{}};function Mgt(){for(var t=0,e=arguments.length,r={},n;t=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}Bq.prototype=Mgt.prototype={constructor:Bq,on:function(t,e){var r=this._,n=sYr(t+"",r),i,a=-1,s=n.length;if(arguments.length<2){for(;++a0)for(var r=new Array(i),n=0,i,a;n=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),Pgt.hasOwnProperty(e)?{space:Pgt[e],local:t}:t}function lYr(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===Eye&&e.documentElement.namespaceURI===Eye?e.createElement(t):e.createElementNS(r,t)}}function cYr(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Ngt(t){var e=$q(t);return(e.local?cYr:lYr)(e)}function uYr(){}function _ye(t){return t==null?uYr:function(){return this.querySelector(t)}}function hYr(t){typeof t!="function"&&(t=_ye(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i=x&&(x=b+1);!(A=v[x])&&++x=0;)(s=n[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function NYr(t){t||(t=BYr);function e(d,f){return d&&f?t(d.__data__,f.__data__):!d-!f}for(var r=this._groups,n=r.length,i=new Array(n),a=0;ae?1:t>=e?0:NaN}function $Yr(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function FYr(){return Array.from(this)}function zYr(){for(var t=this._groups,e=0,r=t.length;e1?this.each((e==null?KYr:typeof e=="function"?JYr:ZYr)(t,e,r??"")):_5(this.node(),t)}function _5(t,e){return t.style.getPropertyValue(e)||Ugt(t).getComputedStyle(t,null).getPropertyValue(e)}function tqr(t){return function(){delete this[t]}}function rqr(t,e){return function(){this[t]=e}}function nqr(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function iqr(t,e){return arguments.length>1?this.each((e==null?tqr:typeof e=="function"?nqr:rqr)(t,e)):this.node()[t]}function Vgt(t){return t.trim().split(/^|\s+/)}function Rye(t){return t.classList||new Qgt(t)}function Qgt(t){this._node=t,this._names=Vgt(t.getAttribute("class")||"")}Qgt.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Ggt(t,e){for(var r=Rye(t),n=-1,i=e.length;++n=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function Lqr(t){return function(){var e=this.__on;if(e){for(var r=0,n=-1,i=e.length,a;r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?Vq(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?Vq(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Uqr.exec(t))?new Hc(e[1],e[2],e[3],1):(e=Vqr.exec(t))?new Hc(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Qqr.exec(t))?Vq(e[1],e[2],e[3],e[4]):(e=Gqr.exec(t))?Vq(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Hqr.exec(t))?tmt(e[1],e[2]/100,e[3]/100,1):(e=Wqr.exec(t))?tmt(e[1],e[2]/100,e[3]/100,e[4]):qgt.hasOwnProperty(t)?Kgt(qgt[t]):t==="transparent"?new Hc(NaN,NaN,NaN,0):null}function Kgt(t){return new Hc(t>>16&255,t>>8&255,t&255,1)}function Vq(t,e,r,n){return n<=0&&(t=e=r=NaN),new Hc(t,e,r,n)}function Zgt(t){return t instanceof hT||(t=dT(t)),t?(t=t.rgb(),new Hc(t.r,t.g,t.b,t.opacity)):new Hc}function Dye(t,e,r,n){return arguments.length===1?Zgt(t):new Hc(t,e,r,n??1)}function Hc(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}NB(Hc,Dye,zq(hT,{brighter(t){return t=t==null?Uq:Math.pow(Uq,t),new Hc(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?BB:Math.pow(BB,t),new Hc(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Hc(fT(this.r),fT(this.g),fT(this.b),Qq(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:Jgt,formatHex:Jgt,formatHex8:jqr,formatRgb:emt,toString:emt}));function Jgt(){return`#${pT(this.r)}${pT(this.g)}${pT(this.b)}`}function jqr(){return`#${pT(this.r)}${pT(this.g)}${pT(this.b)}${pT((isNaN(this.opacity)?1:this.opacity)*255)}`}function emt(){const t=Qq(this.opacity);return`${t===1?"rgb(":"rgba("}${fT(this.r)}, ${fT(this.g)}, ${fT(this.b)}${t===1?")":`, ${t})`}`}function Qq(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function fT(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function pT(t){return t=fT(t),(t<16?"0":"")+t.toString(16)}function tmt(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new ng(t,e,r,n)}function rmt(t){if(t instanceof ng)return new ng(t.h,t.s,t.l,t.opacity);if(t instanceof hT||(t=dT(t)),!t)return new ng;if(t instanceof ng)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),s=NaN,o=a-i,l=(a+i)/2;return o?(e===a?s=(r-n)/o+(r0&&l<1?0:s,new ng(s,o,l,t.opacity)}function Xqr(t,e,r,n){return arguments.length===1?rmt(t):new ng(t,e,r,n??1)}function ng(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}NB(ng,Xqr,zq(hT,{brighter(t){return t=t==null?Uq:Math.pow(Uq,t),new ng(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?BB:Math.pow(BB,t),new ng(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new Hc(Lye(t>=240?t-240:t+120,i,n),Lye(t,i,n),Lye(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new ng(nmt(this.h),Gq(this.s),Gq(this.l),Qq(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 t=Qq(this.opacity);return`${t===1?"hsl(":"hsla("}${nmt(this.h)}, ${Gq(this.s)*100}%, ${Gq(this.l)*100}%${t===1?")":`, ${t})`}`}}));function nmt(t){return t=(t||0)%360,t<0?t+360:t}function Gq(t){return Math.max(0,Math.min(1,t||0))}function Lye(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const Kqr=Math.PI/180,Zqr=180/Math.PI,Hq=18,imt=.96422,amt=1,smt=.82521,omt=4/29,D5=6/29,lmt=3*D5*D5,Jqr=D5*D5*D5;function cmt(t){if(t instanceof Zm)return new Zm(t.l,t.a,t.b,t.opacity);if(t instanceof _y)return umt(t);t instanceof Hc||(t=Zgt(t));var e=Nye(t.r),r=Nye(t.g),n=Nye(t.b),i=Mye((.2225045*e+.7168786*r+.0606169*n)/amt),a,s;return e===r&&r===n?a=s=i:(a=Mye((.4360747*e+.3850649*r+.1430804*n)/imt),s=Mye((.0139322*e+.0971045*r+.7141733*n)/smt)),new Zm(116*i-16,500*(a-i),200*(i-s),t.opacity)}function ejr(t,e,r,n){return arguments.length===1?cmt(t):new Zm(t,e,r,n??1)}function Zm(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}NB(Zm,ejr,zq(hT,{brighter(t){return new Zm(this.l+Hq*(t??1),this.a,this.b,this.opacity)},darker(t){return new Zm(this.l-Hq*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return e=imt*Iye(e),t=amt*Iye(t),r=smt*Iye(r),new Hc(Pye(3.1338561*e-1.6168667*t-.4906146*r),Pye(-.9787684*e+1.9161415*t+.033454*r),Pye(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function Mye(t){return t>Jqr?Math.pow(t,1/3):t/lmt+omt}function Iye(t){return t>D5?t*t*t:lmt*(t-omt)}function Pye(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Nye(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function tjr(t){if(t instanceof _y)return new _y(t.h,t.c,t.l,t.opacity);if(t instanceof Zm||(t=cmt(t)),t.a===0&&t.b===0)return new _y(NaN,0()=>t;function hmt(t,e){return function(r){return t+r*e}}function rjr(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function njr(t,e){var r=e-t;return r?hmt(t,r>180||r<-180?r-360*Math.round(r/360):r):Wq(isNaN(t)?e:t)}function ijr(t){return(t=+t)==1?FB:function(e,r){return r-e?rjr(e,r,t):Wq(isNaN(e)?r:e)}}function FB(t,e){var r=e-t;return r?hmt(t,r):Wq(isNaN(t)?e:t)}const Yq=function t(e){var r=ijr(e);function n(i,a){var s=r((i=Dye(i)).r,(a=Dye(a)).r),o=r(i.g,a.g),l=r(i.b,a.b),u=FB(i.opacity,a.opacity);return function(h){return i.r=s(h),i.g=o(h),i.b=l(h),i.opacity=u(h),i+""}}return n.gamma=t,n}(1);function ajr(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(a){for(i=0;ir&&(a=e.slice(r,a),o[s]?o[s]+=a:o[++s]=a),(n=n[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,l.push({i:s,x:ig(n,i)})),r=Fye.lastIndex;return r180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,n)-2,x:ig(u,h)})):h&&d.push(i(d)+"rotate("+h+n)}function o(u,h,d,f){u!==h?f.push({i:d.push(i(d)+"skewX(",null,n)-2,x:ig(u,h)}):h&&d.push(i(d)+"skewX("+h+n)}function l(u,h,d,f,p,g){if(u!==d||h!==f){var m=p.push(i(p)+"scale(",null,",",null,")");g.push({i:m-4,x:ig(u,d)},{i:m-2,x:ig(h,f)})}else(d!==1||f!==1)&&p.push(i(p)+"scale("+d+","+f+")")}return function(u,h){var d=[],f=[];return u=t(u),h=t(h),a(u.translateX,u.translateY,h.translateX,h.translateY,d,f),s(u.rotate,h.rotate,d,f),o(u.skewX,h.skewX,d,f),l(u.scaleX,u.scaleY,h.scaleX,h.scaleY,d,f),u=h=null,function(p){for(var g=-1,m=f.length,v;++g=0&&t._call.call(void 0,e),t=t._next;--L5}function bmt(){gT=(Xq=QB.now())+Kq,L5=zB=0;try{xjr()}finally{L5=0,Ajr(),gT=0}}function wjr(){var t=QB.now(),e=t-Xq;e>mmt&&(Kq-=e,Xq=t)}function Ajr(){for(var t,e=jq,r,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:jq=r);VB=t,Qye(n)}function Qye(t){if(!L5){zB&&(zB=clearTimeout(zB));var e=t-gT;e>24?(t<1/0&&(zB=setTimeout(bmt,t-QB.now()-Kq)),UB&&(UB=clearInterval(UB))):(UB||(Xq=QB.now(),UB=setInterval(wjr,mmt)),L5=1,vmt(bmt))}}function xmt(t,e,r){var n=new Zq;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var Sjr=Mgt("start","end","cancel","interrupt"),Tjr=[],wmt=0,Amt=1,Gye=2,Jq=3,Smt=4,Hye=5,ej=6;function tj(t,e,r,n,i,a){var s=t.__transition;if(!s)t.__transition={};else if(r in s)return;Cjr(t,r,{name:e,index:n,group:i,on:Sjr,tween:Tjr,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:wmt})}function Wye(t,e){var r=ag(t,e);if(r.state>wmt)throw new Error("too late; already scheduled");return r}function Jm(t,e){var r=ag(t,e);if(r.state>Jq)throw new Error("too late; already running");return r}function ag(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function Cjr(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=ymt(a,0,r.time);function a(u){r.state=Amt,r.timer.restart(s,r.delay,r.time),r.delay<=u&&s(u-r.delay)}function s(u){var h,d,f,p;if(r.state!==Amt)return l();for(h in n)if(p=n[h],p.name===r.name){if(p.state===Jq)return xmt(s);p.state===Smt?(p.state=ej,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete n[h]):+hGye&&n.state=0&&(e=e.slice(0,r)),!e||e==="start"})}function rXr(t,e,r){var n,i,a=tXr(e)?Wye:Jm;return function(){var s=a(this,t),o=s.on;o!==n&&(i=(n=o).copy()).on(e,r),s.on=i}}function nXr(t,e){var r=this._id;return arguments.length<2?ag(this.node(),r).on.on(t):this.each(rXr(r,t,e))}function iXr(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function aXr(){return this.on("end.remove",iXr(this._id))}function sXr(t){var e=this._name,r=this._id;typeof t!="function"&&(t=_ye(t));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s=0))throw new Error(`invalid digits: ${t}`);if(e>15)return kmt;const r=10**e;return function(n){this._+=n[0];for(let i=1,a=n.length;imT)if(!(Math.abs(d*l-u*h)>mT)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let p=n-s,g=i-o,m=l*l+u*u,v=p*p+g*g,y=Math.sqrt(m),b=Math.sqrt(f),x=a*Math.tan((qye-Math.acos((m+f-v)/(2*y*b)))/2),w=x/b,A=x/y;Math.abs(w-1)>mT&&this._append`L${e+w*h},${r+w*d}`,this._append`A${a},${a},0,0,${+(d*p>h*g)},${this._x1=e+A*l},${this._y1=r+A*u}`}}arc(e,r,n,i,a,s){if(e=+e,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(i),l=n*Math.sin(i),u=e+o,h=r+l,d=1^s,f=s?i-a:a-i;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>mT||Math.abs(this._y1-h)>mT)&&this._append`L${u},${h}`,n&&(f<0&&(f=f%jye+jye),f>DXr?this._append`A${n},${n},0,1,${d},${e-o},${r-l}A${n},${n},0,1,${d},${this._x1=u},${this._y1=h}`:f>mT&&this._append`A${n},${n},0,${+(f>=qye)},${d},${this._x1=e+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(e,r,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};function IXr(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function rj(t,e){if(!isFinite(t)||t===0)return null;var r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function M5(t){return t=rj(Math.abs(t)),t?t[1]:NaN}function PXr(t,e){return function(r,n){for(var i=r.length,a=[],s=0,o=t[0],l=0;i>0&&o>0&&(l+o+1>n&&(o=Math.max(1,n-l)),a.push(r.substring(i-=o,i+o)),!((l+=o+1)>n));)o=t[s=(s+1)%t.length];return a.reverse().join(e)}}function NXr(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var BXr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function nj(t){if(!(e=BXr.exec(t)))throw new Error("invalid format: "+t);var e;return new Xye({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}nj.prototype=Xye.prototype;function Xye(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Xye.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function $Xr(t){e:for(var e=t.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(i+1):t}var ij;function FXr(t,e){var r=rj(t,e);if(!r)return ij=void 0,t.toPrecision(e);var n=r[0],i=r[1],a=i-(ij=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return a===s?n:a>s?n+new Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+rj(t,Math.max(0,e+a-1))[0]}function Emt(t,e){var r=rj(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const _mt={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:IXr,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Emt(t*100,e),r:Emt,s:FXr,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Rmt(t){return t}var Dmt=Array.prototype.map,Lmt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function zXr(t){var e=t.grouping===void 0||t.thousands===void 0?Rmt:PXr(Dmt.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?Rmt:NXr(Dmt.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",o=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(d,f){d=nj(d);var p=d.fill,g=d.align,m=d.sign,v=d.symbol,y=d.zero,b=d.width,x=d.comma,w=d.precision,A=d.trim,S=d.type;S==="n"?(x=!0,S="g"):_mt[S]||(w===void 0&&(w=12),A=!0,S="g"),(y||p==="0"&&g==="=")&&(y=!0,p="0",g="=");var T=(f&&f.prefix!==void 0?f.prefix:"")+(v==="$"?r:v==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():""),O=(v==="$"?n:/[%p]/.test(S)?s:"")+(f&&f.suffix!==void 0?f.suffix:""),k=_mt[S],E=/[defgprs%]/.test(S);w=w===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function _(I){var L=T,R=O,D,M,P;if(S==="c")R=k(I)+R,I="";else{I=+I;var N=I<0||1/I<0;if(I=isNaN(I)?l:k(Math.abs(I),w),A&&(I=$Xr(I)),N&&+I==0&&m!=="+"&&(N=!1),L=(N?m==="("?m:o:m==="-"||m==="("?"":m)+L,R=(S==="s"&&!isNaN(I)&&ij!==void 0?Lmt[8+ij/3]:"")+R+(N&&m==="("?")":""),E){for(D=-1,M=I.length;++DP||P>57){R=(P===46?i+I.slice(D+1):I.slice(D))+R,I=I.slice(0,D);break}}}x&&!y&&(I=e(I,1/0));var F=L.length+I.length+R.length,B=F>1)+L+I+R+B.slice(F);break;default:I=B+L+I+R;break}return a(I)}return _.toString=function(){return d+""},_}function h(d,f){var p=Math.max(-8,Math.min(8,Math.floor(M5(f)/3)))*3,g=Math.pow(10,-p),m=u((d=nj(d),d.type="f",d),{suffix:Lmt[8+p/3]});return function(v){return m(g*v)}}return{format:u,formatPrefix:h}}var aj,vT,Mmt;UXr({thousands:",",grouping:[3],currency:["$",""]});function UXr(t){return aj=zXr(t),vT=aj.format,Mmt=aj.formatPrefix,aj}function VXr(t){return Math.max(0,-M5(Math.abs(t)))}function QXr(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(M5(e)/3)))*3-M5(Math.abs(t)))}function GXr(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,M5(e)-M5(t))+1}function HXr(t){var e=0,r=t.children,n=r&&r.length;if(!n)e=1;else for(;--n>=0;)e+=r[n].value;t.value=e}function WXr(){return this.eachAfter(HXr)}function YXr(t,e){let r=-1;for(const n of this)t.call(e,n,++r,this);return this}function qXr(t,e){for(var r=this,n=[r],i,a,s=-1;r=n.pop();)if(t.call(e,r,++s,this),i=r.children)for(a=i.length-1;a>=0;--a)n.push(i[a]);return this}function jXr(t,e){for(var r=this,n=[r],i=[],a,s,o,l=-1;r=n.pop();)if(i.push(r),a=r.children)for(s=0,o=a.length;s=0;)r+=n[i].value;e.value=r})}function ZXr(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function JXr(t){for(var e=this,r=eKr(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n}function eKr(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;for(t=r.pop(),e=n.pop();t===e;)i=t,t=r.pop(),e=n.pop();return i}function tKr(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function rKr(){return Array.from(this)}function nKr(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function iKr(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*aKr(){var t=this,e,r=[t],n,i,a;do for(e=r.reverse(),r=[];t=e.pop();)if(yield t,n=t.children)for(i=0,a=n.length;i=0;--o)i.push(a=s[o]=new sj(s[o])),a.parent=n,a.depth=n.depth+1;return r.eachBefore(uKr)}function sKr(){return Kye(this).eachBefore(cKr)}function oKr(t){return t.children}function lKr(t){return Array.isArray(t)?t[1]:null}function cKr(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function uKr(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function sj(t){this.data=t,this.depth=this.height=0,this.parent=null}sj.prototype=Kye.prototype={constructor:sj,count:WXr,each:YXr,eachAfter:jXr,eachBefore:qXr,find:XXr,sum:KXr,sort:ZXr,path:JXr,ancestors:tKr,descendants:rKr,leaves:nKr,links:iKr,copy:sKr,[Symbol.iterator]:aKr};function hKr(t){if(typeof t!="function")throw new Error;return t}function GB(){return 0}function HB(t){return function(){return t}}function dKr(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function fKr(t,e,r,n,i){for(var a=t.children,s,o=-1,l=a.length,u=t.value&&(n-e)/t.value;++ob&&(b=u),S=v*v*A,x=Math.max(b/S,S/y),x>w){v-=u;break}w=x}s.push(l={value:v,dice:p1?n:1)},r}(gKr);function yKr(){var t=vKr,e=!1,r=1,n=1,i=[0],a=GB,s=GB,o=GB,l=GB,u=GB;function h(f){return f.x0=f.y0=0,f.x1=r,f.y1=n,f.eachBefore(d),i=[0],e&&f.eachBefore(dKr),f}function d(f){var p=i[f.depth],g=f.x0+p,m=f.y0+p,v=f.x1-p,y=f.y1-p;ve&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function AKr(t,e,r){var n=t[0],i=t[1],a=e[0],s=e[1];return i2?SKr:AKr,l=u=null,d}function d(f){return f==null||isNaN(f=+f)?a:(l||(l=o(t.map(n),e,r)))(n(s(f)))}return d.invert=function(f){return s(i((u||(u=o(e,t.map(n),ig)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,xKr),h()):t.slice()},d.range=function(f){return arguments.length?(e=Array.from(f),h()):e.slice()},d.rangeRound=function(f){return e=Array.from(f),r=djr,h()},d.clamp=function(f){return arguments.length?(s=f?!0:I5,h()):s!==I5},d.interpolate=function(f){return arguments.length?(r=f,h()):r},d.unknown=function(f){return arguments.length?(a=f,d):a},function(f,p){return n=f,i=p,h()}}function Bmt(){return TKr()(I5,I5)}function CKr(t,e,r,n){var i=Cye(t,e,r),a;switch(n=nj(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=QXr(i,s))&&(n.precision=a),Mmt(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=GXr(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=VXr(i))&&(n.precision=a-(n.type==="%")*2);break}}return vT(n)}function OKr(t){var e=t.domain;return t.ticks=function(r){var n=e();return YWr(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return CKr(i[0],i[i.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),i=0,a=n.length-1,s=n[i],o=n[a],l,u,h=10;for(o0;){if(u=Tye(s,o,r),u===l)return n[i]=s,n[a]=o,e(n);if(u>0)s=Math.floor(s/u)*u,o=Math.ceil(o/u)*u;else if(u<0)s=Math.ceil(s*u)/u,o=Math.floor(o*u)/u;else break;l=u}return t},t}function P5(){var t=Bmt();return t.copy=function(){return Nmt(t,P5())},oj.apply(t,arguments),OKr(t)}function kKr(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],a=t[n],s;return a(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{const s=i(a),o=i.ceil(a);return a-s(e(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,o)=>{const l=[];if(a=i.ceil(a),o=o==null?1:Math.floor(o),!(a0))return l;let u;do l.push(u=new Date(+a)),e(a,o),t(a);while(uZo(s=>{if(s>=s)for(;t(s),!a(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;e(s,-1),!a(s););else for(;--o>=0;)for(;e(s,1),!a(s););}),r&&(i.count=(a,s)=>(e1e.setTime(+a),t1e.setTime(+s),t(e1e),t(t1e),Math.floor(r(e1e,t1e))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?s=>n(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const N5=Zo(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);N5.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Zo(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):N5),N5.range;const Ly=1e3,Jf=Ly*60,My=Jf*60,Iy=My*24,r1e=Iy*7,$mt=Iy*30,n1e=Iy*365,Wx=Zo(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Ly)},(t,e)=>(e-t)/Ly,t=>t.getUTCSeconds());Wx.range;const WB=Zo(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Ly)},(t,e)=>{t.setTime(+t+e*Jf)},(t,e)=>(e-t)/Jf,t=>t.getMinutes());WB.range,Zo(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Jf)},(t,e)=>(e-t)/Jf,t=>t.getUTCMinutes()).range;const YB=Zo(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Ly-t.getMinutes()*Jf)},(t,e)=>{t.setTime(+t+e*My)},(t,e)=>(e-t)/My,t=>t.getHours());YB.range,Zo(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*My)},(t,e)=>(e-t)/My,t=>t.getUTCHours()).range;const bT=Zo(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Jf)/Iy,t=>t.getDate()-1);bT.range;const i1e=Zo(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Iy,t=>t.getUTCDate()-1);i1e.range,Zo(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Iy,t=>Math.floor(t/Iy)).range;function xT(t){return Zo(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*Jf)/r1e)}const qB=xT(0),jB=xT(1),Fmt=xT(2),zmt=xT(3),wT=xT(4),Umt=xT(5),Vmt=xT(6);qB.range,jB.range,Fmt.range,zmt.range,wT.range,Umt.range,Vmt.range;function AT(t){return Zo(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/r1e)}const Qmt=AT(0),lj=AT(1),EKr=AT(2),_Kr=AT(3),B5=AT(4),RKr=AT(5),DKr=AT(6);Qmt.range,lj.range,EKr.range,_Kr.range,B5.range,RKr.range,DKr.range;const XB=Zo(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());XB.range,Zo(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()).range;const Py=Zo(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Py.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Zo(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)}),Py.range;const ST=Zo(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());ST.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Zo(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)}),ST.range;function LKr(t,e,r,n,i,a){const s=[[Wx,1,Ly],[Wx,5,5*Ly],[Wx,15,15*Ly],[Wx,30,30*Ly],[a,1,Jf],[a,5,5*Jf],[a,15,15*Jf],[a,30,30*Jf],[i,1,My],[i,3,3*My],[i,6,6*My],[i,12,12*My],[n,1,Iy],[n,2,2*Iy],[r,1,r1e],[e,1,$mt],[e,3,3*$mt],[t,1,n1e]];function o(u,h,d){const f=hv).right(s,f);if(p===s.length)return t.every(Cye(u/n1e,h/n1e,d));if(p===0)return N5.every(Math.max(Cye(u,h,d),1));const[g,m]=s[f/s[p-1][2]53)return null;"w"in re||(re.w=1),"Z"in re?(ae=s1e(KB(re.y,0,1)),Ce=ae.getUTCDay(),ae=Ce>4||Ce===0?lj.ceil(ae):lj(ae),ae=i1e.offset(ae,(re.V-1)*7),re.y=ae.getUTCFullYear(),re.m=ae.getUTCMonth(),re.d=ae.getUTCDate()+(re.w+6)%7):(ae=a1e(KB(re.y,0,1)),Ce=ae.getDay(),ae=Ce>4||Ce===0?jB.ceil(ae):jB(ae),ae=bT.offset(ae,(re.V-1)*7),re.y=ae.getFullYear(),re.m=ae.getMonth(),re.d=ae.getDate()+(re.w+6)%7)}else("W"in re||"U"in re)&&("w"in re||(re.w="u"in re?re.u%7:"W"in re?1:0),Ce="Z"in re?s1e(KB(re.y,0,1)).getUTCDay():a1e(KB(re.y,0,1)).getDay(),re.m=0,re.d="W"in re?(re.w+6)%7+re.W*7-(Ce+5)%7:re.w+re.U*7-(Ce+6)%7);return"Z"in re?(re.H+=re.Z/100|0,re.M+=re.Z%100,s1e(re)):a1e(re)}}function O(q,Z,ee,re){for(var ve=0,ae=Z.length,Ce=ee.length,Oe,$e;ve=Ce)return-1;if(Oe=Z.charCodeAt(ve++),Oe===37){if(Oe=Z.charAt(ve++),$e=A[Oe in Gmt?Z.charAt(ve++):Oe],!$e||(re=$e(q,ee,re))<0)return-1}else if(Oe!=ee.charCodeAt(re++))return-1}return re}function k(q,Z,ee){var re=u.exec(Z.slice(ee));return re?(q.p=h.get(re[0].toLowerCase()),ee+re[0].length):-1}function E(q,Z,ee){var re=p.exec(Z.slice(ee));return re?(q.w=g.get(re[0].toLowerCase()),ee+re[0].length):-1}function _(q,Z,ee){var re=d.exec(Z.slice(ee));return re?(q.w=f.get(re[0].toLowerCase()),ee+re[0].length):-1}function I(q,Z,ee){var re=y.exec(Z.slice(ee));return re?(q.m=b.get(re[0].toLowerCase()),ee+re[0].length):-1}function L(q,Z,ee){var re=m.exec(Z.slice(ee));return re?(q.m=v.get(re[0].toLowerCase()),ee+re[0].length):-1}function R(q,Z,ee){return O(q,e,Z,ee)}function D(q,Z,ee){return O(q,r,Z,ee)}function M(q,Z,ee){return O(q,n,Z,ee)}function P(q){return s[q.getDay()]}function N(q){return a[q.getDay()]}function F(q){return l[q.getMonth()]}function B(q){return o[q.getMonth()]}function V(q){return i[+(q.getHours()>=12)]}function z(q){return 1+~~(q.getMonth()/3)}function U(q){return s[q.getUTCDay()]}function Q(q){return a[q.getUTCDay()]}function G(q){return l[q.getUTCMonth()]}function X(q){return o[q.getUTCMonth()]}function Y(q){return i[+(q.getUTCHours()>=12)]}function le(q){return 1+~~(q.getUTCMonth()/3)}return{format:function(q){var Z=S(q+="",x);return Z.toString=function(){return q},Z},parse:function(q){var Z=T(q+="",!1);return Z.toString=function(){return q},Z},utcFormat:function(q){var Z=S(q+="",w);return Z.toString=function(){return q},Z},utcParse:function(q){var Z=T(q+="",!0);return Z.toString=function(){return q},Z}}}var Gmt={"-":"",_:" ",0:"0"},kl=/^\s*\d+/,NKr=/^%/,BKr=/[\\^$*+?|[\]().{}]/g;function Bi(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a[e.toLowerCase(),r]))}function FKr(t,e,r){var n=kl.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function zKr(t,e,r){var n=kl.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function UKr(t,e,r){var n=kl.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function VKr(t,e,r){var n=kl.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function QKr(t,e,r){var n=kl.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function Hmt(t,e,r){var n=kl.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Wmt(t,e,r){var n=kl.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function GKr(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function HKr(t,e,r){var n=kl.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function WKr(t,e,r){var n=kl.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Ymt(t,e,r){var n=kl.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function YKr(t,e,r){var n=kl.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function qmt(t,e,r){var n=kl.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function qKr(t,e,r){var n=kl.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function jKr(t,e,r){var n=kl.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function XKr(t,e,r){var n=kl.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function KKr(t,e,r){var n=kl.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function ZKr(t,e,r){var n=NKr.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function JKr(t,e,r){var n=kl.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function eZr(t,e,r){var n=kl.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function jmt(t,e){return Bi(t.getDate(),e,2)}function tZr(t,e){return Bi(t.getHours(),e,2)}function rZr(t,e){return Bi(t.getHours()%12||12,e,2)}function nZr(t,e){return Bi(1+bT.count(Py(t),t),e,3)}function Xmt(t,e){return Bi(t.getMilliseconds(),e,3)}function iZr(t,e){return Xmt(t,e)+"000"}function aZr(t,e){return Bi(t.getMonth()+1,e,2)}function sZr(t,e){return Bi(t.getMinutes(),e,2)}function oZr(t,e){return Bi(t.getSeconds(),e,2)}function lZr(t){var e=t.getDay();return e===0?7:e}function cZr(t,e){return Bi(qB.count(Py(t)-1,t),e,2)}function Kmt(t){var e=t.getDay();return e>=4||e===0?wT(t):wT.ceil(t)}function uZr(t,e){return t=Kmt(t),Bi(wT.count(Py(t),t)+(Py(t).getDay()===4),e,2)}function hZr(t){return t.getDay()}function dZr(t,e){return Bi(jB.count(Py(t)-1,t),e,2)}function fZr(t,e){return Bi(t.getFullYear()%100,e,2)}function pZr(t,e){return t=Kmt(t),Bi(t.getFullYear()%100,e,2)}function gZr(t,e){return Bi(t.getFullYear()%1e4,e,4)}function mZr(t,e){var r=t.getDay();return t=r>=4||r===0?wT(t):wT.ceil(t),Bi(t.getFullYear()%1e4,e,4)}function vZr(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Bi(e/60|0,"0",2)+Bi(e%60,"0",2)}function Zmt(t,e){return Bi(t.getUTCDate(),e,2)}function yZr(t,e){return Bi(t.getUTCHours(),e,2)}function bZr(t,e){return Bi(t.getUTCHours()%12||12,e,2)}function xZr(t,e){return Bi(1+i1e.count(ST(t),t),e,3)}function Jmt(t,e){return Bi(t.getUTCMilliseconds(),e,3)}function wZr(t,e){return Jmt(t,e)+"000"}function AZr(t,e){return Bi(t.getUTCMonth()+1,e,2)}function SZr(t,e){return Bi(t.getUTCMinutes(),e,2)}function TZr(t,e){return Bi(t.getUTCSeconds(),e,2)}function CZr(t){var e=t.getUTCDay();return e===0?7:e}function OZr(t,e){return Bi(Qmt.count(ST(t)-1,t),e,2)}function e0t(t){var e=t.getUTCDay();return e>=4||e===0?B5(t):B5.ceil(t)}function kZr(t,e){return t=e0t(t),Bi(B5.count(ST(t),t)+(ST(t).getUTCDay()===4),e,2)}function EZr(t){return t.getUTCDay()}function _Zr(t,e){return Bi(lj.count(ST(t)-1,t),e,2)}function RZr(t,e){return Bi(t.getUTCFullYear()%100,e,2)}function DZr(t,e){return t=e0t(t),Bi(t.getUTCFullYear()%100,e,2)}function LZr(t,e){return Bi(t.getUTCFullYear()%1e4,e,4)}function MZr(t,e){var r=t.getUTCDay();return t=r>=4||r===0?B5(t):B5.ceil(t),Bi(t.getUTCFullYear()%1e4,e,4)}function IZr(){return"+0000"}function t0t(){return"%"}function r0t(t){return+t}function n0t(t){return Math.floor(+t/1e3)}var $5,cj;PZr({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function PZr(t){return $5=PKr(t),cj=$5.format,$5.parse,$5.utcFormat,$5.utcParse,$5}function NZr(t){return new Date(t)}function BZr(t){return t instanceof Date?+t:+new Date(+t)}function i0t(t,e,r,n,i,a,s,o,l,u){var h=Bmt(),d=h.invert,f=h.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),v=u("%I %p"),y=u("%a %d"),b=u("%b %d"),x=u("%B"),w=u("%Y");function A(S){return(l(S)1?0:t<-1?e7:Math.acos(t)}function s0t(t){return t>=1?uj:t<=-1?-uj:Math.asin(t)}function o0t(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);e=n}return t},()=>new MXr(e)}function QZr(t){return t.innerRadius}function GZr(t){return t.outerRadius}function HZr(t){return t.startAngle}function WZr(t){return t.endAngle}function YZr(t){return t&&t.padAngle}function qZr(t,e,r,n,i,a,s,o){var l=r-t,u=n-e,h=s-i,d=o-a,f=d*l-h*u;if(!(f*fR*R+D*D&&(O=E,k=_),{cx:O,cy:k,x01:-h,y01:-d,x11:O*(i/A-1),y11:k*(i/A-1)}}function z5(){var t=QZr,e=GZr,r=ao(0),n=null,i=HZr,a=WZr,s=YZr,o=null,l=o0t(u);function u(){var h,d,f=+t.apply(this,arguments),p=+e.apply(this,arguments),g=i.apply(this,arguments)-uj,m=a.apply(this,arguments)-uj,v=a0t(m-g),y=m>g;if(o||(o=h=l()),pYc))o.moveTo(0,0);else if(v>hj-Yc)o.moveTo(p*TT(g),p*e0(g)),o.arc(0,0,p,g,m,!y),f>Yc&&(o.moveTo(f*TT(m),f*e0(m)),o.arc(0,0,f,m,g,y));else{var b=g,x=m,w=g,A=m,S=v,T=v,O=s.apply(this,arguments)/2,k=O>Yc&&(n?+n.apply(this,arguments):F5(f*f+p*p)),E=o1e(a0t(p-f)/2,+r.apply(this,arguments)),_=E,I=E,L,R;if(k>Yc){var D=s0t(k/f*e0(O)),M=s0t(k/p*e0(O));(S-=D*2)>Yc?(D*=y?1:-1,w+=D,A-=D):(S=0,w=A=(g+m)/2),(T-=M*2)>Yc?(M*=y?1:-1,b+=M,x-=M):(T=0,b=x=(g+m)/2)}var P=p*TT(b),N=p*e0(b),F=f*TT(A),B=f*e0(A);if(E>Yc){var V=p*TT(x),z=p*e0(x),U=f*TT(w),Q=f*e0(w),G;if(vYc?I>Yc?(L=dj(U,Q,P,N,p,I,y),R=dj(V,z,F,B,p,I,y),o.moveTo(L.cx+L.x01,L.cy+L.y01),IYc)||!(S>Yc)?o.lineTo(F,B):_>Yc?(L=dj(F,B,V,z,f,-_,y),R=dj(P,N,U,Q,f,-_,y),o.lineTo(L.cx+L.x01,L.cy+L.y01),_t?1:e>=t?0:NaN}function ZZr(t){return t}function JZr(){var t=ZZr,e=KZr,r=null,n=ao(0),i=ao(hj),a=ao(0);function s(o){var l,u=(o=l0t(o)).length,h,d,f=0,p=new Array(u),g=new Array(u),m=+n.apply(this,arguments),v=Math.min(hj,Math.max(-hj,i.apply(this,arguments)-m)),y,b=Math.min(Math.abs(v)/u,a.apply(this,arguments)),x=b*(v<0?-1:1),w;for(l=0;l0&&(f+=w);for(e!=null?p.sort(function(A,S){return e(g[A],g[S])}):r!=null&&p.sort(function(A,S){return r(o[A],o[S])}),l=0,d=f?(v-u*x)/f:0;l0?w*d:0)+x,g[h]={data:o[h],index:l,value:w,startAngle:m,endAngle:y,padAngle:b};return g}return s.value=function(o){return arguments.length?(t=typeof o=="function"?o:ao(+o),s):t},s.sortValues=function(o){return arguments.length?(e=o,r=null,s):e},s.sort=function(o){return arguments.length?(r=o,e=null,s):r},s.startAngle=function(o){return arguments.length?(n=typeof o=="function"?o:ao(+o),s):n},s.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:ao(+o),s):i},s.padAngle=function(o){return arguments.length?(a=typeof o=="function"?o:ao(+o),s):a},s}class u0t{constructor(e,r){this._context=e,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,r){switch(e=+e,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,r,e,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,e,this._y0,e,r);break}}this._x0=e,this._y0=r}}function h0t(t){return new u0t(t,!0)}function d0t(t){return new u0t(t,!1)}function Yx(){}function fj(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function pj(t){this._context=t}pj.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:fj(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:fj(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function n7(t){return new pj(t)}function f0t(t){this._context=t}f0t.prototype={areaStart:Yx,areaEnd:Yx,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:fj(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function eJr(t){return new f0t(t)}function p0t(t){this._context=t}p0t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:fj(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function tJr(t){return new p0t(t)}function g0t(t,e){this._basis=new pj(t),this._beta=e}g0t.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n=t[0],i=e[0],a=t[r]-n,s=e[r]-i,o=-1,l;++o<=r;)l=o/r,this._basis.point(this._beta*t[o]+(1-this._beta)*(n+l*a),this._beta*e[o]+(1-this._beta)*(i+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const rJr=function t(e){function r(n){return e===1?new pj(n):new g0t(n,e)}return r.beta=function(n){return t(+n)},r}(.85);function gj(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function l1e(t,e){this._context=t,this._k=(1-e)/6}l1e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:gj(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:gj(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const m0t=function t(e){function r(n){return new l1e(n,e)}return r.tension=function(n){return t(+n)},r}(0);function c1e(t,e){this._context=t,this._k=(1-e)/6}c1e.prototype={areaStart:Yx,areaEnd:Yx,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:gj(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const nJr=function t(e){function r(n){return new c1e(n,e)}return r.tension=function(n){return t(+n)},r}(0);function u1e(t,e){this._context=t,this._k=(1-e)/6}u1e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:gj(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const iJr=function t(e){function r(n){return new u1e(n,e)}return r.tension=function(n){return t(+n)},r}(0);function h1e(t,e,r){var n=t._x1,i=t._y1,a=t._x2,s=t._y2;if(t._l01_a>Yc){var o=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*o-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*o-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Yc){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*u+t._x1*t._l23_2a-e*t._l12_2a)/h,s=(s*u+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,i,a,s,t._x2,t._y2)}function v0t(t,e){this._context=t,this._alpha=e}v0t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:h1e(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const y0t=function t(e){function r(n){return e?new v0t(n,e):new l1e(n,0)}return r.alpha=function(n){return t(+n)},r}(.5);function b0t(t,e){this._context=t,this._alpha=e}b0t.prototype={areaStart:Yx,areaEnd:Yx,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:h1e(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const aJr=function t(e){function r(n){return e?new b0t(n,e):new c1e(n,0)}return r.alpha=function(n){return t(+n)},r}(.5);function x0t(t,e){this._context=t,this._alpha=e}x0t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:h1e(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const sJr=function t(e){function r(n){return e?new x0t(n,e):new u1e(n,0)}return r.alpha=function(n){return t(+n)},r}(.5);function w0t(t){this._context=t}w0t.prototype={areaStart:Yx,areaEnd:Yx,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function oJr(t){return new w0t(t)}function A0t(t){return t<0?-1:1}function S0t(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),s=(r-t._y1)/(i||n<0&&-0),o=(a*i+s*n)/(n+i);return(A0t(a)+A0t(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function T0t(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function d1e(t,e,r){var n=t._x0,i=t._y0,a=t._x1,s=t._y1,o=(a-n)/3;t._context.bezierCurveTo(n+o,i+o*e,a-o,s-o*r,a,s)}function mj(t){this._context=t}mj.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:d1e(this,this._t0,T0t(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,d1e(this,T0t(this,r=S0t(this,t,e)),r);break;default:d1e(this,this._t0,r=S0t(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function C0t(t){this._context=new O0t(t)}(C0t.prototype=Object.create(mj.prototype)).point=function(t,e){mj.prototype.point.call(this,e,t)};function O0t(t){this._context=t}O0t.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,i,a){this._context.bezierCurveTo(e,t,n,r,a,i)}};function k0t(t){return new mj(t)}function E0t(t){return new C0t(t)}function _0t(t){this._context=t}_0t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var n=R0t(t),i=R0t(e),a=0,s=1;s=0;--e)i[e]=(s[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e}};function L0t(t){return new vj(t,.5)}function M0t(t){return new vj(t,0)}function I0t(t){return new vj(t,1)}function i7(t,e,r){this.k=t,this.x=e,this.y=r}i7.prototype={constructor:i7,scale:function(t){return t===1?this:new i7(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new i7(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},i7.prototype;var qc=C(t=>{var i;const{securityLevel:e}=He();let r=Ot("body");if(e==="sandbox"){const s=((i=Ot(`#i${t}`).node())==null?void 0:i.contentDocument)??document;r=Ot(s.body)}return r.select(`#${t}`)},"selectSvgElement");function f1e(t){return typeof t>"u"||t===null}C(f1e,"isNothing");function P0t(t){return typeof t=="object"&&t!==null}C(P0t,"isObject");function N0t(t){return Array.isArray(t)?t:f1e(t)?[]:[t]}C(N0t,"toArray");function B0t(t,e){var r,n,i,a;if(e)for(a=Object.keys(e),r=0,n=a.length;ro&&(a=" ... ",e=n-o+a.length),r-n>o&&(s=" ...",r=n+o-s.length),{str:a+t.slice(e,r).replace(/\t/g,"→")+s,pos:n-e+a.length}}C(yj,"getLine");function bj(t,e){return Jo.repeat(" ",e-t.length)+t}C(bj,"padStart");function z0t(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],i=[],a,s=-1;a=r.exec(t.buffer);)i.push(a.index),n.push(a.index+a[0].length),t.position<=a.index&&s<0&&(s=n.length-2);s<0&&(s=n.length-1);var o="",l,u,h=Math.min(t.line+e.linesAfter,i.length).toString().length,d=e.maxLength-(e.indent+h+3);for(l=1;l<=e.linesBefore&&!(s-l<0);l++)u=yj(t.buffer,n[s-l],i[s-l],t.position-(n[s]-n[s-l]),d),o=Jo.repeat(" ",e.indent)+bj((t.line-l+1).toString(),h)+" | "+u.str+` `+o;for(u=yj(t.buffer,n[s],i[s],t.position,d),o+=Jo.repeat(" ",e.indent)+bj((t.line+1).toString(),h)+" | "+u.str+` `,o+=Jo.repeat("-",e.indent+h+3+u.pos)+`^ `,l=1;l<=e.linesAfter&&!(s+l>=i.length);l++)u=yj(t.buffer,n[s+l],i[s+l],t.position-(n[s]-n[s+l]),d),o+=Jo.repeat(" ",e.indent)+bj((t.line+l+1).toString(),h)+" | "+u.str+` -`;return o.replace(/\n$/,"")}C(z0t,"makeSnippet");var pJr=z0t,gJr=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],mJr=["scalar","sequence","mapping"];function U0t(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}C(U0t,"compileStyleAliases");function V0t(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(gJr.indexOf(r)===-1)throw new Mh('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=U0t(e.styleAliases||null),mJr.indexOf(this.kind)===-1)throw new Mh('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}C(V0t,"Type$1");var jc=V0t;function g1e(t,e){var r=[];return t[e].forEach(function(n){var i=r.length;r.forEach(function(a,s){a.tag===n.tag&&a.kind===n.kind&&a.multi===n.multi&&(i=s)}),r[i]=n}),r}C(g1e,"compileList");function Q0t(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,r;function n(i){i.multi?(t.multi[i.kind].push(i),t.multi.fallback.push(i)):t[i.kind][i.tag]=t.fallback[i.tag]=i}for(C(n,"collectType"),e=0,r=arguments.length;e=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:C(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},"octal"),decimal:C(function(t){return t.toString(10)},"decimal"),hexadecimal:C(function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),CJr=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function rvt(t){return!(t===null||!CJr.test(t)||t[t.length-1]==="_")}C(rvt,"resolveYamlFloat");function nvt(t){var e,r;return e=t.replace(/_/g,"").toLowerCase(),r=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}C(nvt,"constructYamlFloat");var OJr=/^[-+]?[0-9]+e/;function ivt(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Jo.isNegativeZero(t))return"-0.0";return r=t.toString(10),OJr.test(r)?r.replace("e",".e"):r}C(ivt,"representYamlFloat");function avt(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||Jo.isNegativeZero(t))}C(avt,"isFloat");var kJr=new jc("tag:yaml.org,2002:float",{kind:"scalar",resolve:rvt,construct:nvt,predicate:avt,represent:ivt,defaultStyle:"lowercase"}),svt=wJr.extend({implicit:[AJr,TJr,SJr,kJr]}),EJr=svt,ovt=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),lvt=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function cvt(t){return t===null?!1:ovt.exec(t)!==null||lvt.exec(t)!==null}C(cvt,"resolveYamlTimestamp");function uvt(t){var e,r,n,i,a,s,o,l=0,u=null,h,d,f;if(e=ovt.exec(t),e===null&&(e=lvt.exec(t)),e===null)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(r,n,i));if(a=+e[4],s=+e[5],o=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(h=+e[10],d=+(e[11]||0),u=(h*60+d)*6e4,e[9]==="-"&&(u=-u)),f=new Date(Date.UTC(r,n,i,a,s,o,l)),u&&f.setTime(f.getTime()-u),f}C(uvt,"constructYamlTimestamp");function hvt(t){return t.toISOString()}C(hvt,"representYamlTimestamp");var _Jr=new jc("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:cvt,construct:uvt,instanceOf:Date,represent:hvt});function dvt(t){return t==="<<"||t===null}C(dvt,"resolveYamlMerge");var RJr=new jc("tag:yaml.org,2002:merge",{kind:"scalar",resolve:dvt}),m1e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`;function fvt(t){if(t===null)return!1;var e,r,n=0,i=t.length,a=m1e;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8===0}C(fvt,"resolveYamlBinary");function pvt(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,a=m1e,s=0,o=[];for(e=0;e>16&255),o.push(s>>8&255),o.push(s&255)),s=s<<6|a.indexOf(n.charAt(e));return r=i%4*6,r===0?(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)):r===18?(o.push(s>>10&255),o.push(s>>2&255)):r===12&&o.push(s>>4&255),new Uint8Array(o)}C(pvt,"constructYamlBinary");function gvt(t){var e="",r=0,n,i,a=t.length,s=m1e;for(n=0;n>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]),r=(r<<8)+t[n];return i=a%3,i===0?(e+=s[r>>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]):i===2?(e+=s[r>>10&63],e+=s[r>>4&63],e+=s[r<<2&63],e+=s[64]):i===1&&(e+=s[r>>2&63],e+=s[r<<4&63],e+=s[64],e+=s[64]),e}C(gvt,"representYamlBinary");function mvt(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}C(mvt,"isBinary");var DJr=new jc("tag:yaml.org,2002:binary",{kind:"scalar",resolve:fvt,construct:pvt,predicate:mvt,represent:gvt}),LJr=Object.prototype.hasOwnProperty,MJr=Object.prototype.toString;function vvt(t){if(t===null)return!0;var e=[],r,n,i,a,s,o=t;for(r=0,n=o.length;r>10)+55296,(t-65536&1023)+56320)}C(Lvt,"charFromCodepoint");function x1e(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}C(x1e,"setProperty");var Mvt=new Array(256),Ivt=new Array(256);for(OS=0;OS<256;OS++)Mvt[OS]=b1e(OS)?1:0,Ivt[OS]=b1e(OS);var OS;function Pvt(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||Tvt,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}C(Pvt,"State$1");function w1e(t,e){var r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=pJr(r),new Mh(e,r)}C(w1e,"generateError");function Gr(t,e){throw w1e(t,e)}C(Gr,"throwError");function a7(t,e){t.onWarning&&t.onWarning.call(null,w1e(t,e))}C(a7,"throwWarning");var Nvt={YAML:C(function(e,r,n){var i,a,s;e.version!==null&&Gr(e,"duplication of %YAML directive"),n.length!==1&&Gr(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&Gr(e,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),s=parseInt(i[2],10),a!==1&&Gr(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&a7(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:C(function(e,r,n){var i,a;n.length!==2&&Gr(e,"TAG directive accepts exactly two arguments"),i=n[0],a=n[1],kvt.test(i)||Gr(e,"ill-formed tag handle (first argument) of the TAG directive"),qx.call(e.tagMap,i)&&Gr(e,'there is a previously declared suffix for "'+i+'" tag handle'),Evt.test(a)||Gr(e,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{Gr(e,"tag prefix is malformed: "+a)}e.tagMap[i]=a},"handleTagDirective")};function Ny(t,e,r,n){var i,a,s,o;if(e1&&(t.result+=Jo.repeat(` -`,e-1))}C(Sj,"writeFoldedLines");function Bvt(t,e,r){var n,i,a,s,o,l,u,h,d=t.kind,f=t.result,p;if(p=t.input.charCodeAt(t.position),_u(p)||CS(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=t.input.charCodeAt(t.position+1),_u(i)||r&&CS(i)))return!1;for(t.kind="scalar",t.result="",a=s=t.position,o=!1;p!==0;){if(p===58){if(i=t.input.charCodeAt(t.position+1),_u(i)||r&&CS(i))break}else if(p===35){if(n=t.input.charCodeAt(t.position-1),_u(n))break}else{if(t.position===t.lineStart&&s7(t)||r&&CS(p))break;if(sg(p))if(l=t.line,u=t.lineStart,h=t.lineIndent,so(t,!1,-1),t.lineIndent>=e){o=!0,p=t.input.charCodeAt(t.position);continue}else{t.position=s,t.line=l,t.lineStart=u,t.lineIndent=h;break}}o&&(Ny(t,a,s,!1),Sj(t,t.line-l),a=s=t.position,o=!1),jx(p)||(s=t.position+1),p=t.input.charCodeAt(++t.position)}return Ny(t,a,s,!1),t.result?!0:(t.kind=d,t.result=f,!1)}C(Bvt,"readPlainScalar");function $vt(t,e){var r,n,i;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(Ny(t,n,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)n=t.position,t.position++,i=t.position;else return!0;else sg(r)?(Ny(t,n,i,!0),Sj(t,so(t,!1,e)),n=i=t.position):t.position===t.lineStart&&s7(t)?Gr(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);Gr(t,"unexpected end of the stream within a single quoted scalar")}C($vt,"readSingleQuotedScalar");function Fvt(t,e){var r,n,i,a,s,o;if(o=t.input.charCodeAt(t.position),o!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(o=t.input.charCodeAt(t.position))!==0;){if(o===34)return Ny(t,r,t.position,!0),t.position++,!0;if(o===92){if(Ny(t,r,t.position,!0),o=t.input.charCodeAt(++t.position),sg(o))so(t,!1,e);else if(o<256&&Mvt[o])t.result+=Ivt[o],t.position++;else if((s=Rvt(o))>0){for(i=s,a=0;i>0;i--)o=t.input.charCodeAt(++t.position),(s=_vt(o))>=0?a=(a<<4)+s:Gr(t,"expected hexadecimal character");t.result+=Lvt(a),t.position++}else Gr(t,"unknown escape sequence");r=n=t.position}else sg(o)?(Ny(t,r,n,!0),Sj(t,so(t,!1,e)),r=n=t.position):t.position===t.lineStart&&s7(t)?Gr(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}Gr(t,"unexpected end of the stream within a double quoted scalar")}C(Fvt,"readDoubleQuotedScalar");function zvt(t,e){var r=!0,n,i,a,s=t.tag,o,l=t.anchor,u,h,d,f,p,g=Object.create(null),m,v,y,b;if(b=t.input.charCodeAt(t.position),b===91)h=93,p=!1,o=[];else if(b===123)h=125,p=!0,o={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=o),b=t.input.charCodeAt(++t.position);b!==0;){if(so(t,!0,e),b=t.input.charCodeAt(t.position),b===h)return t.position++,t.tag=s,t.anchor=l,t.kind=p?"mapping":"sequence",t.result=o,!0;r?b===44&&Gr(t,"expected the node content, but found ','"):Gr(t,"missed comma between flow collection entries"),v=m=y=null,d=f=!1,b===63&&(u=t.input.charCodeAt(t.position+1),_u(u)&&(d=f=!0,t.position++,so(t,!0,e))),n=t.line,i=t.lineStart,a=t.position,ES(t,e,wj,!1,!0),v=t.tag,m=t.result,so(t,!0,e),b=t.input.charCodeAt(t.position),(f||t.line===n)&&b===58&&(d=!0,b=t.input.charCodeAt(++t.position),so(t,!0,e),ES(t,e,wj,!1,!0),y=t.result),p?kS(t,o,g,v,m,y,n,i,a):d?o.push(kS(t,null,g,v,m,y,n,i,a)):o.push(m),so(t,!0,e),b=t.input.charCodeAt(t.position),b===44?(r=!0,b=t.input.charCodeAt(++t.position)):r=!1}Gr(t,"unexpected end of the stream within a flow collection")}C(zvt,"readFlowCollection");function Uvt(t,e){var r,n,i=v1e,a=!1,s=!1,o=e,l=0,u=!1,h,d;if(d=t.input.charCodeAt(t.position),d===124)n=!1;else if(d===62)n=!0;else return!1;for(t.kind="scalar",t.result="";d!==0;)if(d=t.input.charCodeAt(++t.position),d===43||d===45)v1e===i?i=d===43?Ovt:FJr:Gr(t,"repeat of a chomping mode identifier");else if((h=Dvt(d))>=0)h===0?Gr(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?Gr(t,"repeat of an indentation width identifier"):(o=e+h-1,s=!0);else break;if(jx(d)){do d=t.input.charCodeAt(++t.position);while(jx(d));if(d===35)do d=t.input.charCodeAt(++t.position);while(!sg(d)&&d!==0)}for(;d!==0;){for(Tj(t),t.lineIndent=0,d=t.input.charCodeAt(t.position);(!s||t.lineIndento&&(o=t.lineIndent),sg(d)){l++;continue}if(t.lineIndent=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:C(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},"octal"),decimal:C(function(t){return t.toString(10)},"decimal"),hexadecimal:C(function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),CJr=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function rvt(t){return!(t===null||!CJr.test(t)||t[t.length-1]==="_")}C(rvt,"resolveYamlFloat");function nvt(t){var e,r;return e=t.replace(/_/g,"").toLowerCase(),r=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}C(nvt,"constructYamlFloat");var OJr=/^[-+]?[0-9]+e/;function ivt(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Jo.isNegativeZero(t))return"-0.0";return r=t.toString(10),OJr.test(r)?r.replace("e",".e"):r}C(ivt,"representYamlFloat");function avt(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||Jo.isNegativeZero(t))}C(avt,"isFloat");var kJr=new jc("tag:yaml.org,2002:float",{kind:"scalar",resolve:rvt,construct:nvt,predicate:avt,represent:ivt,defaultStyle:"lowercase"}),svt=wJr.extend({implicit:[AJr,SJr,TJr,kJr]}),EJr=svt,ovt=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),lvt=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function cvt(t){return t===null?!1:ovt.exec(t)!==null||lvt.exec(t)!==null}C(cvt,"resolveYamlTimestamp");function uvt(t){var e,r,n,i,a,s,o,l=0,u=null,h,d,f;if(e=ovt.exec(t),e===null&&(e=lvt.exec(t)),e===null)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(r,n,i));if(a=+e[4],s=+e[5],o=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(h=+e[10],d=+(e[11]||0),u=(h*60+d)*6e4,e[9]==="-"&&(u=-u)),f=new Date(Date.UTC(r,n,i,a,s,o,l)),u&&f.setTime(f.getTime()-u),f}C(uvt,"constructYamlTimestamp");function hvt(t){return t.toISOString()}C(hvt,"representYamlTimestamp");var _Jr=new jc("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:cvt,construct:uvt,instanceOf:Date,represent:hvt});function dvt(t){return t==="<<"||t===null}C(dvt,"resolveYamlMerge");var RJr=new jc("tag:yaml.org,2002:merge",{kind:"scalar",resolve:dvt}),m1e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= +\r`;function fvt(t){if(t===null)return!1;var e,r,n=0,i=t.length,a=m1e;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8===0}C(fvt,"resolveYamlBinary");function pvt(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,a=m1e,s=0,o=[];for(e=0;e>16&255),o.push(s>>8&255),o.push(s&255)),s=s<<6|a.indexOf(n.charAt(e));return r=i%4*6,r===0?(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)):r===18?(o.push(s>>10&255),o.push(s>>2&255)):r===12&&o.push(s>>4&255),new Uint8Array(o)}C(pvt,"constructYamlBinary");function gvt(t){var e="",r=0,n,i,a=t.length,s=m1e;for(n=0;n>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]),r=(r<<8)+t[n];return i=a%3,i===0?(e+=s[r>>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]):i===2?(e+=s[r>>10&63],e+=s[r>>4&63],e+=s[r<<2&63],e+=s[64]):i===1&&(e+=s[r>>2&63],e+=s[r<<4&63],e+=s[64],e+=s[64]),e}C(gvt,"representYamlBinary");function mvt(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}C(mvt,"isBinary");var DJr=new jc("tag:yaml.org,2002:binary",{kind:"scalar",resolve:fvt,construct:pvt,predicate:mvt,represent:gvt}),LJr=Object.prototype.hasOwnProperty,MJr=Object.prototype.toString;function vvt(t){if(t===null)return!0;var e=[],r,n,i,a,s,o=t;for(r=0,n=o.length;r>10)+55296,(t-65536&1023)+56320)}C(Lvt,"charFromCodepoint");function x1e(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}C(x1e,"setProperty");var Mvt=new Array(256),Ivt=new Array(256);for(OT=0;OT<256;OT++)Mvt[OT]=b1e(OT)?1:0,Ivt[OT]=b1e(OT);var OT;function Pvt(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||Svt,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}C(Pvt,"State$1");function w1e(t,e){var r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=pJr(r),new Mh(e,r)}C(w1e,"generateError");function Gr(t,e){throw w1e(t,e)}C(Gr,"throwError");function a7(t,e){t.onWarning&&t.onWarning.call(null,w1e(t,e))}C(a7,"throwWarning");var Nvt={YAML:C(function(e,r,n){var i,a,s;e.version!==null&&Gr(e,"duplication of %YAML directive"),n.length!==1&&Gr(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&Gr(e,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),s=parseInt(i[2],10),a!==1&&Gr(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&a7(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:C(function(e,r,n){var i,a;n.length!==2&&Gr(e,"TAG directive accepts exactly two arguments"),i=n[0],a=n[1],kvt.test(i)||Gr(e,"ill-formed tag handle (first argument) of the TAG directive"),qx.call(e.tagMap,i)&&Gr(e,'there is a previously declared suffix for "'+i+'" tag handle'),Evt.test(a)||Gr(e,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{Gr(e,"tag prefix is malformed: "+a)}e.tagMap[i]=a},"handleTagDirective")};function Ny(t,e,r,n){var i,a,s,o;if(e1&&(t.result+=Jo.repeat(` +`,e-1))}C(Tj,"writeFoldedLines");function Bvt(t,e,r){var n,i,a,s,o,l,u,h,d=t.kind,f=t.result,p;if(p=t.input.charCodeAt(t.position),_u(p)||CT(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=t.input.charCodeAt(t.position+1),_u(i)||r&&CT(i)))return!1;for(t.kind="scalar",t.result="",a=s=t.position,o=!1;p!==0;){if(p===58){if(i=t.input.charCodeAt(t.position+1),_u(i)||r&&CT(i))break}else if(p===35){if(n=t.input.charCodeAt(t.position-1),_u(n))break}else{if(t.position===t.lineStart&&s7(t)||r&&CT(p))break;if(sg(p))if(l=t.line,u=t.lineStart,h=t.lineIndent,so(t,!1,-1),t.lineIndent>=e){o=!0,p=t.input.charCodeAt(t.position);continue}else{t.position=s,t.line=l,t.lineStart=u,t.lineIndent=h;break}}o&&(Ny(t,a,s,!1),Tj(t,t.line-l),a=s=t.position,o=!1),jx(p)||(s=t.position+1),p=t.input.charCodeAt(++t.position)}return Ny(t,a,s,!1),t.result?!0:(t.kind=d,t.result=f,!1)}C(Bvt,"readPlainScalar");function $vt(t,e){var r,n,i;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(Ny(t,n,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)n=t.position,t.position++,i=t.position;else return!0;else sg(r)?(Ny(t,n,i,!0),Tj(t,so(t,!1,e)),n=i=t.position):t.position===t.lineStart&&s7(t)?Gr(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);Gr(t,"unexpected end of the stream within a single quoted scalar")}C($vt,"readSingleQuotedScalar");function Fvt(t,e){var r,n,i,a,s,o;if(o=t.input.charCodeAt(t.position),o!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(o=t.input.charCodeAt(t.position))!==0;){if(o===34)return Ny(t,r,t.position,!0),t.position++,!0;if(o===92){if(Ny(t,r,t.position,!0),o=t.input.charCodeAt(++t.position),sg(o))so(t,!1,e);else if(o<256&&Mvt[o])t.result+=Ivt[o],t.position++;else if((s=Rvt(o))>0){for(i=s,a=0;i>0;i--)o=t.input.charCodeAt(++t.position),(s=_vt(o))>=0?a=(a<<4)+s:Gr(t,"expected hexadecimal character");t.result+=Lvt(a),t.position++}else Gr(t,"unknown escape sequence");r=n=t.position}else sg(o)?(Ny(t,r,n,!0),Tj(t,so(t,!1,e)),r=n=t.position):t.position===t.lineStart&&s7(t)?Gr(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}Gr(t,"unexpected end of the stream within a double quoted scalar")}C(Fvt,"readDoubleQuotedScalar");function zvt(t,e){var r=!0,n,i,a,s=t.tag,o,l=t.anchor,u,h,d,f,p,g=Object.create(null),m,v,y,b;if(b=t.input.charCodeAt(t.position),b===91)h=93,p=!1,o=[];else if(b===123)h=125,p=!0,o={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=o),b=t.input.charCodeAt(++t.position);b!==0;){if(so(t,!0,e),b=t.input.charCodeAt(t.position),b===h)return t.position++,t.tag=s,t.anchor=l,t.kind=p?"mapping":"sequence",t.result=o,!0;r?b===44&&Gr(t,"expected the node content, but found ','"):Gr(t,"missed comma between flow collection entries"),v=m=y=null,d=f=!1,b===63&&(u=t.input.charCodeAt(t.position+1),_u(u)&&(d=f=!0,t.position++,so(t,!0,e))),n=t.line,i=t.lineStart,a=t.position,ET(t,e,wj,!1,!0),v=t.tag,m=t.result,so(t,!0,e),b=t.input.charCodeAt(t.position),(f||t.line===n)&&b===58&&(d=!0,b=t.input.charCodeAt(++t.position),so(t,!0,e),ET(t,e,wj,!1,!0),y=t.result),p?kT(t,o,g,v,m,y,n,i,a):d?o.push(kT(t,null,g,v,m,y,n,i,a)):o.push(m),so(t,!0,e),b=t.input.charCodeAt(t.position),b===44?(r=!0,b=t.input.charCodeAt(++t.position)):r=!1}Gr(t,"unexpected end of the stream within a flow collection")}C(zvt,"readFlowCollection");function Uvt(t,e){var r,n,i=v1e,a=!1,s=!1,o=e,l=0,u=!1,h,d;if(d=t.input.charCodeAt(t.position),d===124)n=!1;else if(d===62)n=!0;else return!1;for(t.kind="scalar",t.result="";d!==0;)if(d=t.input.charCodeAt(++t.position),d===43||d===45)v1e===i?i=d===43?Ovt:FJr:Gr(t,"repeat of a chomping mode identifier");else if((h=Dvt(d))>=0)h===0?Gr(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?Gr(t,"repeat of an indentation width identifier"):(o=e+h-1,s=!0);else break;if(jx(d)){do d=t.input.charCodeAt(++t.position);while(jx(d));if(d===35)do d=t.input.charCodeAt(++t.position);while(!sg(d)&&d!==0)}for(;d!==0;){for(Sj(t),t.lineIndent=0,d=t.input.charCodeAt(t.position);(!s||t.lineIndento&&(o=t.lineIndent),sg(d)){l++;continue}if(t.lineIndente)&&l!==0)Gr(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(v&&(s=t.line,o=t.lineStart,l=t.position),ES(t,e,Aj,!0,i)&&(v?g=t.result:m=t.result),v||(kS(t,d,f,p,g,m,s,o,l),p=g=m=null),so(t,!0,-1),b=t.input.charCodeAt(t.position)),(t.line===a||t.lineIndent>e)&&b!==0)Gr(t,"bad indentation of a mapping entry");else if(t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndent tag; it should be "scalar", not "'+t.kind+'"'),d=0,f=t.implicitTypes.length;d"),t.result!==null&&g.kind!==t.kind&&Gr(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+g.kind+'", not "'+t.kind+'"'),g.resolve(t.result,t.tag)?(t.result=g.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):Gr(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||h}C(ES,"composeNode");function Wvt(t){var e=t.position,r,n,i,a=!1,s;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(s=t.input.charCodeAt(t.position))!==0&&(so(t,!0,-1),s=t.input.charCodeAt(t.position),!(t.lineIndent>0||s!==37));){for(a=!0,s=t.input.charCodeAt(++t.position),r=t.position;s!==0&&!_u(s);)s=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),i=[],n.length<1&&Gr(t,"directive name must not be less than one character in length");s!==0;){for(;jx(s);)s=t.input.charCodeAt(++t.position);if(s===35){do s=t.input.charCodeAt(++t.position);while(s!==0&&!sg(s));break}if(sg(s))break;for(r=t.position;s!==0&&!_u(s);)s=t.input.charCodeAt(++t.position);i.push(t.input.slice(r,t.position))}s!==0&&Tj(t),qx.call(Nvt,n)?Nvt[n](t,n,i):a7(t,'unknown document directive "'+n+'"')}if(so(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,so(t,!0,-1)):a&&Gr(t,"directives end mark is expected"),ES(t,t.lineIndent-1,Aj,!1,!0),so(t,!0,-1),t.checkLineBreaks&&UJr.test(t.input.slice(e,t.position))&&a7(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&s7(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,so(t,!0,-1));return}if(t.position"u"&&(r=e,e=null);var n=S1e(t,r);if(typeof e!="function")return n;for(var i=0,a=n.length;ie)&&l!==0)Gr(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(v&&(s=t.line,o=t.lineStart,l=t.position),ET(t,e,Aj,!0,i)&&(v?g=t.result:m=t.result),v||(kT(t,d,f,p,g,m,s,o,l),p=g=m=null),so(t,!0,-1),b=t.input.charCodeAt(t.position)),(t.line===a||t.lineIndent>e)&&b!==0)Gr(t,"bad indentation of a mapping entry");else if(t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndent tag; it should be "scalar", not "'+t.kind+'"'),d=0,f=t.implicitTypes.length;d"),t.result!==null&&g.kind!==t.kind&&Gr(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+g.kind+'", not "'+t.kind+'"'),g.resolve(t.result,t.tag)?(t.result=g.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):Gr(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||h}C(ET,"composeNode");function Wvt(t){var e=t.position,r,n,i,a=!1,s;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(s=t.input.charCodeAt(t.position))!==0&&(so(t,!0,-1),s=t.input.charCodeAt(t.position),!(t.lineIndent>0||s!==37));){for(a=!0,s=t.input.charCodeAt(++t.position),r=t.position;s!==0&&!_u(s);)s=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),i=[],n.length<1&&Gr(t,"directive name must not be less than one character in length");s!==0;){for(;jx(s);)s=t.input.charCodeAt(++t.position);if(s===35){do s=t.input.charCodeAt(++t.position);while(s!==0&&!sg(s));break}if(sg(s))break;for(r=t.position;s!==0&&!_u(s);)s=t.input.charCodeAt(++t.position);i.push(t.input.slice(r,t.position))}s!==0&&Sj(t),qx.call(Nvt,n)?Nvt[n](t,n,i):a7(t,'unknown document directive "'+n+'"')}if(so(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,so(t,!0,-1)):a&&Gr(t,"directives end mark is expected"),ET(t,t.lineIndent-1,Aj,!1,!0),so(t,!0,-1),t.checkLineBreaks&&UJr.test(t.input.slice(e,t.position))&&a7(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&s7(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,so(t,!0,-1));return}if(t.position"u"&&(r=e,e=null);var n=T1e(t,r);if(typeof e!="function")return n;for(var i=0,a=n.length;i=55296&&r<=56319&&e+1=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}C(Q5,"codePointAt");function R1e(t){var e=/^\n* /;return e.test(t)}C(R1e,"needIndentIndicator");var oyt=1,D1e=2,lyt=3,cyt=4,G5=5;function uyt(t,e,r,n,i,a,s,o){var l,u=0,h=null,d=!1,f=!1,p=n!==-1,g=-1,m=ayt(Q5(t,0))&&syt(Q5(t,t.length-1));if(e||s)for(l=0;l=65536?l+=2:l++){if(u=Q5(t,l),!V5(u))return G5;m=m&&_1e(u,h,o),h=u}else{for(l=0;l=65536?l+=2:l++){if(u=Q5(t,l),u===o7)d=!0,p&&(f=f||l-g-1>n&&t[g+1]!==" ",g=l);else if(!V5(u))return G5;m=m&&_1e(u,h,o),h=u}f=f||p&&l-g-1>n&&t[g+1]!==" "}return!d&&!f?m&&!s&&!i(t)?oyt:a===l7?G5:D1e:r>9&&R1e(t)?G5:s?a===l7?G5:D1e:f?cyt:lyt}C(uyt,"chooseScalarStyle");function hyt(t,e,r,n,i){t.dump=function(){if(e.length===0)return t.quotingType===l7?'""':"''";if(!t.noCompatMode&&(len.indexOf(e)!==-1||cen.test(e)))return t.quotingType===l7?'"'+e+'"':"'"+e+"'";var a=t.indent*Math.max(1,r),s=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-a),o=n||t.flowLevel>-1&&r>=t.flowLevel;function l(u){return iyt(t,u)}switch(C(l,"testAmbiguity"),uyt(e,o,t.indent,s,l,t.quotingType,t.forceQuotes&&!n,i)){case oyt:return e;case D1e:return"'"+e.replace(/'/g,"''")+"'";case lyt:return"|"+L1e(e,t.indent)+M1e(k1e(e,a));case cyt:return">"+L1e(e,t.indent)+M1e(k1e(dyt(e,s),a));case G5:return'"'+fyt(e)+'"';default:throw new Mh("impossible error: invalid scalar style")}}()}C(hyt,"writeScalar");function L1e(t,e){var r=R1e(t)?String(e):"",n=t[t.length-1]===` @@ -528,11 +528,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho js-yaml/dist/js-yaml.mjs: (*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *) - */var fen=C(t=>{const{handDrawnSeed:e}=He();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),H5=C(t=>{const e=pen([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),pen=C(t=>{const e=new Map;return t.forEach(r=>{const[n,i]=r.split(":");e.set(n.trim(),i==null?void 0:i.trim())}),e},"styles2Map"),B1e=C(t=>t==="color"||t==="font-size"||t==="font-family"||t==="font-weight"||t==="font-style"||t==="text-decoration"||t==="text-align"||t==="text-transform"||t==="line-height"||t==="letter-spacing"||t==="word-spacing"||t==="text-shadow"||t==="text-overflow"||t==="white-space"||t==="word-wrap"||t==="word-break"||t==="overflow-wrap"||t==="hyphens","isLabelStyle"),Or=C(t=>{const{stylesArray:e}=H5(t),r=[],n=[],i=[],a=[];return e.forEach(s=>{const o=s[0];B1e(o)?r.push(s.join(":")+" !important"):(n.push(s.join(":")+" !important"),o.includes("stroke")&&i.push(s.join(":")+" !important"),o==="fill"&&a.push(s.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:a}},"styles2String"),_r=C((t,e)=>{var l;const{themeVariables:r,handDrawnSeed:n}=He(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:s}=H5(t);return Object.assign({roughness:.7,fill:s.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:s.get("stroke")||i,seed:n,strokeWidth:((l=s.get("stroke-width"))==null?void 0:l.replace("px",""))||1.3,fillLineDash:[0,0],strokeLineDash:gen(s.get("stroke-dasharray"))},e)},"userNodeOverrides"),gen=C(t=>{if(!t)return[0,0];const e=t.trim().split(/\s+/).map(Number);if(e.length===1){const i=isNaN(e[0])?0:e[0];return[i,i]}const r=isNaN(e[0])?0:e[0],n=isNaN(e[1])?0:e[1];return[r,n]},"getStrokeDashArray"),yyt={},El={};Object.defineProperty(El,"__esModule",{value:!0}),El.BLANK_URL=El.relativeFirstCharacters=El.whitespaceEscapeCharsRegex=El.urlSchemeRegex=El.ctrlCharactersRegex=El.htmlCtrlEntityRegex=El.htmlEntitiesRegex=El.invalidProtocolRegex=void 0,El.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,El.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,El.htmlCtrlEntityRegex=/&(newline|tab);/gi,El.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,El.urlSchemeRegex=/^.+(:|:)/gim,El.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,El.relativeFirstCharacters=[".","/"],El.BLANK_URL="about:blank",Object.defineProperty(yyt,"__esModule",{value:!0});var _S=yyt.sanitizeUrl=ben,Kc=El;function men(t){return Kc.relativeFirstCharacters.indexOf(t[0])>-1}function ven(t){var e=t.replace(Kc.ctrlCharactersRegex,"");return e.replace(Kc.htmlEntitiesRegex,function(r,n){return String.fromCharCode(n)})}function yen(t){return URL.canParse(t)}function byt(t){try{return decodeURIComponent(t)}catch{return t}}function ben(t){if(!t)return Kc.BLANK_URL;var e,r=byt(t.trim());do r=ven(r).replace(Kc.htmlCtrlEntityRegex,"").replace(Kc.ctrlCharactersRegex,"").replace(Kc.whitespaceEscapeCharsRegex,"").trim(),r=byt(r),e=r.match(Kc.ctrlCharactersRegex)||r.match(Kc.htmlEntitiesRegex)||r.match(Kc.htmlCtrlEntityRegex)||r.match(Kc.whitespaceEscapeCharsRegex);while(e&&e.length>0);var n=r;if(!n)return Kc.BLANK_URL;if(men(n))return n;var i=n.trimStart(),a=i.match(Kc.urlSchemeRegex);if(!a)return n;var s=a[0].toLowerCase().trim();if(Kc.invalidProtocolRegex.test(s))return Kc.BLANK_URL;var o=i.replace(/\\/g,"/");if(s==="mailto:"||s.includes("://"))return o;if(s==="http:"||s==="https:"){if(!yen(o))return Kc.BLANK_URL;var l=new URL(o);return l.protocol=l.protocol.toLowerCase(),l.hostname=l.hostname.toLowerCase(),l.toString()}return o}function xen(t){return Array.isArray(t)}function $1e(t){var r;if(typeof t!="object"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!=="[object Object]"){const n=t[Symbol.toStringTag];return n==null||!((r=Object.getOwnPropertyDescriptor(t,Symbol.toStringTag))!=null&&r.writable)?!1:t.toString()===`[object ${n}]`}let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function wen(){}function xyt(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function u7(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const wyt="[object RegExp]",F1e="[object String]",z1e="[object Number]",U1e="[object Boolean]",V1e="[object Arguments]",Ayt="[object Symbol]",Tyt="[object Date]",Syt="[object Map]",Cyt="[object Set]",Oyt="[object Array]",kyt="[object ArrayBuffer]",Eyt="[object Object]",_yt="[object DataView]",Ryt="[object Uint8Array]",Dyt="[object Uint8ClampedArray]",Lyt="[object Uint16Array]",Myt="[object Uint32Array]",Iyt="[object Int8Array]",Pyt="[object Int16Array]",Nyt="[object Int32Array]",Byt="[object Float32Array]",$yt="[object Float64Array]",Fyt=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||function(){return this}();function Q1e(t){return typeof Fyt.Buffer<"u"&&Fyt.Buffer.isBuffer(t)}function Aen(t){return Number.isSafeInteger(t)&&t>=0}function zyt(t){return t!=null&&typeof t!="function"&&Aen(t.length)}function Ten(t){return t==="__proto__"}function Rj(t){return t==null||typeof t!="object"&&typeof t!="function"}function G1e(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Sen(t,e){return W5(t,void 0,t,new Map,e)}function W5(t,e,r,n=new Map,i=void 0){const a=i==null?void 0:i(t,e,r,n);if(a!==void 0)return a;if(Rj(t))return t;if(n.has(t))return n.get(t);if(Array.isArray(t)){const s=new Array(t.length);n.set(t,s);for(let o=0;o{if(typeof t=="object"){if(u7(t)==="[object Object]"&&typeof t.constructor!="function"){const s={};return a.set(t,s),og(s,t,i,a),s}switch(Object.prototype.toString.call(t)){case z1e:case F1e:case U1e:{const s=new t.constructor(t==null?void 0:t.valueOf());return og(s,t),s}case V1e:{const s={};return og(s,t),s.length=t.length,s[Symbol.iterator]=t[Symbol.iterator],s}default:return}}})}function Uyt(t){return Oen(t)}function H1e(t){return t!==null&&typeof t=="object"&&u7(t)==="[object Arguments]"}function W1e(t){return typeof t=="object"&&t!==null}function ken(t){return W1e(t)&&zyt(t)}function h7(t){return G1e(t)}function Een(t){const e=t==null?void 0:t.constructor;return t===(typeof e=="function"?e.prototype:Object.prototype)}function d7(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");const r=function(...n){const i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);const s=t.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(d7.Cache||Map),r}d7.Cache=Map;function _en(t){if(Rj(t))return t;const e=u7(t);if(!Ren(t))return{};if(xen(t)){const n=Array.from(t);return t.length>0&&typeof t[0]=="string"&&Object.hasOwn(t,"index")&&(n.index=t.index,n.input=t.input),n}if(h7(t)){const n=t,i=n.constructor;return new i(n.buffer,n.byteOffset,n.length)}if(e==="[object ArrayBuffer]")return new ArrayBuffer(t.byteLength);if(e==="[object DataView]"){const n=t,i=n.buffer,a=n.byteOffset,s=n.byteLength,o=new ArrayBuffer(s),l=new Uint8Array(i,a,s);return new Uint8Array(o).set(l),new DataView(o)}if(e==="[object Boolean]"||e==="[object Number]"||e==="[object String]"){const n=t.constructor,i=new n(t.valueOf());return e==="[object String]"?Len(i,t):Y1e(i,t),i}if(e==="[object Date]")return new Date(Number(t));if(e==="[object RegExp]"){const n=t,i=new RegExp(n.source,n.flags);return i.lastIndex=n.lastIndex,i}if(e==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(t));if(e==="[object Map]"){const n=t,i=new Map;return n.forEach((a,s)=>{i.set(s,a)}),i}if(e==="[object Set]"){const n=t,i=new Set;return n.forEach(a=>{i.add(a)}),i}if(e==="[object Arguments]"){const n=t,i={};return Y1e(i,n),i.length=n.length,i[Symbol.iterator]=n[Symbol.iterator],i}const r={};return Men(r,t),Y1e(r,t),Den(r,t),r}function Ren(t){switch(u7(t)){case V1e:case Oyt:case kyt:case _yt:case U1e:case Tyt:case Byt:case $yt:case Iyt:case Pyt:case Nyt:case Syt:case z1e:case Eyt:case wyt:case Cyt:case F1e:case Ayt:case Ryt:case Dyt:case Lyt:case Myt:return!0;default:return!1}}function Y1e(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}function Den(t,e){const r=Object.getOwnPropertySymbols(e);for(let n=0;n=r)&&(t[n]=e[n])}function Men(t,e){const r=Object.getPrototypeOf(e);r!==null&&typeof e.constructor=="function"&&Object.setPrototypeOf(t,r)}function Ien(t){if(Rj(t))return t;if(Array.isArray(t)||G1e(t)||t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);const e=Object.getPrototypeOf(t);if(e==null)return Object.assign(Object.create(e),t);const r=e.constructor;if(t instanceof Date||t instanceof Map||t instanceof Set)return new r(t);if(t instanceof RegExp){const n=new r(t);return n.lastIndex=t.lastIndex,n}if(t instanceof DataView)return new r(t.buffer.slice(0));if(t instanceof Error){let n;return t instanceof AggregateError?n=new r(t.errors,t.message,{cause:t.cause}):n=new r(t.message,{cause:t.cause}),n.stack=t.stack,Object.assign(n,t),n}return typeof File<"u"&&t instanceof File?new r([t],t.name,{type:t.type,lastModified:t.lastModified}):typeof t=="object"?Object.assign(Object.create(e),t):t}function Pen(t,...e){const r=e.slice(0,-1),n=e[e.length-1];let i=t;for(let a=0;ar!=="constructor").length===0:e.length===0}return!0}var Qyt="​",Ben={curveBasis:n7,curveBasisClosed:eJr,curveBasisOpen:tJr,curveBumpX:h0t,curveBumpY:d0t,curveBundle:rJr,curveCardinalClosed:nJr,curveCardinalOpen:iJr,curveCardinal:m0t,curveCatmullRomClosed:aJr,curveCatmullRomOpen:sJr,curveCatmullRom:y0t,curveLinear:t7,curveLinearClosed:oJr,curveMonotoneX:k0t,curveMonotoneY:E0t,curveNatural:D0t,curveStep:L0t,curveStepAfter:I0t,curveStepBefore:M0t},$en=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Fen=C(function(t,e){const r=Gyt(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const s=r.map(o=>o.args);Cq(s),n=Eo(n,[...s])}else n=r.args;if(!n)return;let i=cye(t,e);const a="config";return n[a]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[a],delete n[a]),n},"detectInit"),Gyt=C(function(t,e=null){var r,n;try{const i=new RegExp(`[%]{2}(?![{]${$en.source})(?=[}][%]{2}).* -`,"ig");t=t.trim().replace(i,"").replace(/'/gm,'"'),me.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let a;const s=[];for(;(a=MB.exec(t))!==null;)if(a.index===MB.lastIndex&&MB.lastIndex++,a&&!e||e&&((r=a[1])!=null&&r.match(e))||e&&((n=a[2])!=null&&n.match(e))){const o=a[1]?a[1]:a[2],l=a[3]?a[3].trim():a[4]?JSON.parse(a[4].trim()):null;s.push({type:o,args:l})}return s.length===0?{type:t,args:null}:s.length===1?s[0]:s}catch(i){return me.error(`ERROR: ${i.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),zen=C(function(t){return t.replace(MB,"")},"removeDirectives"),Uen=C(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function q1e(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return Ben[r]??e}C(q1e,"interpolateToCurve");function Hyt(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?_S(r):r}C(Hyt,"formatUrl");var Ven=C((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let a=window;for(let s=0;s{r+=j1e(i,e),e=i});const n=r/2;return X1e(t,n)}C(Wyt,"traverseEdge");function Yyt(t){return t.length===1?t[0]:Wyt(t)}C(Yyt,"calcLabelPosition");var qyt=C((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),X1e=C((t,e)=>{let r,n=e;for(const i of t){if(r){const a=j1e(i,r);if(a===0)return r;if(a=1)return{x:i.x,y:i.y};if(s>0&&s<1)return{x:qyt((1-s)*r.x+s*i.x,5),y:qyt((1-s)*r.y+s*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),Qen=C((t,e,r)=>{me.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=X1e(e,25),a=t?10:5,s=Math.atan2(e[0].y-i.y,e[0].x-i.x),o={x:0,y:0};return o.x=Math.sin(s)*a+(e[0].x+i.x)/2,o.y=-Math.cos(s)*a+(e[0].y+i.y)/2,o},"calcCardinalityPosition");function jyt(t,e,r){const n=structuredClone(r);me.info("our points",n),e!=="start_left"&&e!=="start_right"&&n.reverse();const i=25+t,a=X1e(n,i),s=10+t*.5,o=Math.atan2(n[0].y-a.y,n[0].x-a.x),l={x:0,y:0};return e==="start_left"?(l.x=Math.sin(o+Math.PI)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o+Math.PI)*s+(n[0].y+a.y)/2):e==="end_right"?(l.x=Math.sin(o-Math.PI)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o-Math.PI)*s+(n[0].y+a.y)/2-5):e==="end_left"?(l.x=Math.sin(o)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2-5):(l.x=Math.sin(o)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2),l}C(jyt,"calcTerminalLabelPosition");function K1e(t){let e="",r="";for(const n of t)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":e=e+n+";");return{style:e,labelStyle:r}}C(K1e,"getStylesFromArray");var Xyt=0,Kyt=C(()=>(Xyt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Xyt),"generateId");function Zyt(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;iZyt(t.length),"random"),Gen=C(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),Hen=C(function(t,e){const r=e.text.replace(jt.lineBreakRegex," "),[,n]=By(e.fontSize),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.style("font-family",e.fontFamily),i.style("font-size",n),i.style("font-weight",e.fontWeight),i.attr("fill",e.fill),e.class!==void 0&&i.attr("class",e.class);const a=i.append("tspan");return a.attr("x",e.x+e.textMargin*2),a.attr("fill",e.fill),a.text(r),i},"drawSimpleText"),f7=d7((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},r),jt.lineBreakRegex.test(t)))return t;const n=t.split(" ").filter(Boolean),i=[];let a="";return n.forEach((s,o)=>{const l=Ru(`${s} `,r),u=Ru(a,r);if(l>e){const{hyphenatedStrings:f,remainingWord:p}=Wen(s,e,"-",r);i.push(a,...f),a=p}else u+l>=e?(i.push(a),a=s):a=[a,s].filter(Boolean).join(" ");o+1===n.length&&i.push(a)}),i.filter(s=>s!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),Wen=d7((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const i=[...t],a=[];let s="";return i.forEach((o,l)=>{const u=`${s}${o}`;if(Ru(u,n)>=e){const d=l+1,f=i.length===d,p=`${u}${r}`;a.push(f?u:p),s=""}else s=u}),{hyphenatedStrings:a,remainingWord:s}},(t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);function Lj(t,e){return Mj(t,e).height}C(Lj,"calculateTextHeight");function Ru(t,e){return Mj(t,e).width}C(Ru,"calculateTextWidth");var Mj=d7((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,a]=By(r),s=["sans-serif",n],o=t.split(jt.lineBreakRegex),l=[],u=Ot("body");if(!u.remove)return{width:0,height:0,lineHeight:0};const h=u.append("svg");for(const f of s){let p=0;const g={width:0,height:0,lineHeight:0};for(const m of o){const v=Gen();v.text=m||Qyt;const y=Hen(h,v).style("font-size",a).style("font-weight",i).style("font-family",f),b=(y._groups||y)[0][0].getBBox();if(b.width===0&&b.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,b.width)),p=Math.round(b.height),g.height+=p,g.lineHeight=Math.round(Math.max(g.lineHeight,p))}l.push(g)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),Yen=(SD=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},C(SD,"InitIDGenerator"),SD),Ij,qen=C(function(t){return Ij=Ij||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Ij.innerHTML=t,unescape(Ij.textContent)},"entityDecode");function Z1e(t){return"str"in t}C(Z1e,"isDetailedError");var jen=C((t,e,r,n)=>{var a;if(!n)return;const i=(a=t.node())==null?void 0:a.getBBox();i&&t.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)},"insertTitle"),By=C(t=>{if(typeof t=="number")return[t,t+"px"];const e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");function ns(t,e){return Nen({},t,e)}C(ns,"cleanAndMerge");var ln={assignWithDepth:Eo,wrapLabel:f7,calculateTextHeight:Lj,calculateTextWidth:Ru,calculateTextDimensions:Mj,cleanAndMerge:ns,detectInit:Fen,detectDirective:Gyt,isSubstringInArray:Uen,interpolateToCurve:q1e,calcLabelPosition:Yyt,calcCardinalityPosition:Qen,calcTerminalLabelPosition:jyt,formatUrl:Hyt,getStylesFromArray:K1e,generateId:Kyt,random:Jyt,runFunc:Ven,entityDecode:qen,insertTitle:jen,isLabelCoordinateInPath:e1t,parseFontSize:By,InitIDGenerator:Yen},Xen=C(function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/#\w+;/g,function(r){const n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"fl°°"+n+"¶ß":"fl°"+n+"¶ß"}),e},"encodeEntities"),$y=C(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),Y5=C((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function _l(t){return t??null}C(_l,"handleUndefinedAttr");function e1t(t,e){const r=Math.round(t.x),n=Math.round(t.y),i=e.replace(/(\d+\.\d+)/g,a=>Math.round(parseFloat(a)).toString());return i.includes(r.toString())||i.includes(n.toString())}C(e1t,"isLabelCoordinateInPath");var q5=C(({flowchart:t})=>{var i,a;const e=((i=t==null?void 0:t.subGraphTitleMargin)==null?void 0:i.top)??0,r=((a=t==null?void 0:t.subGraphTitleMargin)==null?void 0:a.bottom)??0,n=e+r;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:n}},"getSubGraphTitleMargins");async function J1e(t,e){const r=t.getElementsByTagName("img");if(!r||r.length===0)return;const n=e.replace(/]*>/g,"").trim()==="";await Promise.all([...r].map(i=>new Promise(a=>{function s(){if(i.style.display="flex",i.style.flexDirection="column",n){const o=He().fontSize?He().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[u=Xn.fontSize]=By(o),h=u*l+"px";i.style.minWidth=h,i.style.maxWidth=h}else i.style.width="100%";a(i)}C(s,"setupImage"),setTimeout(()=>{i.complete&&s()}),i.addEventListener("error",s),i.addEventListener("load",s)})))}C(J1e,"configureLabelImages");const Ken=Object.freeze({left:0,top:0,width:16,height:16}),Pj=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),t1t=Object.freeze({...Ken,...Pj}),Zen=Object.freeze({...t1t,body:"",hidden:!1}),Jen=Object.freeze({width:null,height:null}),etn=Object.freeze({...Jen,...Pj}),ttn=(t,e,r,n="")=>{const i=t.split(":");if(t.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;n=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const o=i.pop(),l=i.pop(),u={provider:i.length>0?i[0]:n,prefix:l,name:o};return ebe(u)?u:null}const a=i[0],s=a.split("-");if(s.length>1){const o={provider:n,prefix:s.shift(),name:s.join("-")};return ebe(o)?o:null}if(r&&n===""){const o={provider:n,prefix:"",name:a};return ebe(o,r)?o:null}return null},ebe=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function rtn(t,e){const r={};!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0);const n=((t.rotate||0)+(e.rotate||0))%4;return n&&(r.rotate=n),r}function r1t(t,e){const r=rtn(t,e);for(const n in Zen)n in Pj?n in t&&!(n in r)&&(r[n]=Pj[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function ntn(t,e){const r=t.icons,n=t.aliases||Object.create(null),i=Object.create(null);function a(s){if(r[s])return i[s]=[];if(!(s in i)){i[s]=null;const o=n[s]&&n[s].parent,l=o&&a(o);l&&(i[s]=[o].concat(l))}return i[s]}return(e||Object.keys(r).concat(Object.keys(n))).forEach(a),i}function n1t(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let a={};function s(o){a=r1t(n[o]||i[o],a)}return s(e),r.forEach(s),r1t(t,a)}function itn(t,e){if(t.icons[e])return n1t(t,e,[]);const r=ntn(t,[e])[e];return r?n1t(t,e,r):null}const atn=/(-?[0-9.]*[0-9]+[0-9.]*)/g,stn=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function i1t(t,e,r){if(e===1)return t;if(r=r||100,typeof t=="number")return Math.ceil(t*e*r)/r;if(typeof t!="string")return t;const n=t.split(atn);if(n===null||!n.length)return t;const i=[];let a=n.shift(),s=stn.test(a);for(;;){if(s){const o=parseFloat(a);isNaN(o)?i.push(a):i.push(Math.ceil(o*e*r)/r)}else i.push(a);if(a=n.shift(),a===void 0)return i.join("");s=!s}}function otn(t,e="defs"){let r="";const n=t.indexOf("<"+e);for(;n>=0;){const i=t.indexOf(">",n),a=t.indexOf("",a);if(s===-1)break;r+=t.slice(i+1,a).trim(),t=t.slice(0,n).trim()+t.slice(s+1)}return{defs:r,content:t}}function ltn(t,e){return t?""+t+""+e:e}function ctn(t,e,r){const n=otn(t);return ltn(n.defs,e+n.content+r)}const utn=t=>t==="unset"||t==="undefined"||t==="none";function htn(t,e){const r={...t1t,...t},n={...etn,...e},i={left:r.left,top:r.top,width:r.width,height:r.height};let a=r.body;[r,n].forEach(m=>{const v=[],y=m.hFlip,b=m.vFlip;let x=m.rotate;y?b?x+=2:(v.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),v.push("scale(-1 1)"),i.top=i.left=0):b&&(v.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),v.push("scale(1 -1)"),i.top=i.left=0);let w;switch(x<0&&(x-=Math.floor(x/4)*4),x=x%4,x){case 1:w=i.height/2+i.top,v.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:v.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:w=i.width/2+i.left,v.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}x%2===1&&(i.left!==i.top&&(w=i.left,i.left=i.top,i.top=w),i.width!==i.height&&(w=i.width,i.width=i.height,i.height=w)),v.length&&(a=ctn(a,'',""))});const s=n.width,o=n.height,l=i.width,u=i.height;let h,d;s===null?(d=o===null?"1em":o==="auto"?u:o,h=i1t(d,l/u)):(h=s==="auto"?l:s,d=o===null?i1t(h,u/l):o==="auto"?u:o);const f={},p=(m,v)=>{utn(v)||(f[m]=v.toString())};p("width",h),p("height",d);const g=[i.left,i.top,l,u];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:a}}const dtn=/\sid="(\S+)"/g,a1t=new Map;function ftn(t){t=t.replace(/[0-9]+$/,"")||"a";const e=a1t.get(t)||0;return a1t.set(t,e+1),e?`${t}${e}`:t}function ptn(t){const e=[];let r;for(;r=dtn.exec(t);)e.push(r[1]);if(!e.length)return t;const n="suffix"+(Math.random()*16777216|Date.now()).toString(16);return e.forEach(i=>{const a=ftn(i),s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+a+n+"$3")}),t=t.replace(new RegExp(n,"g"),""),t}function gtn(t,e){let r=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in e)r+=" "+n+'="'+e[n]+'"';return'"+t+""}var s1t={body:'?',height:80,width:80},tbe=new Map,o1t=new Map,rbe=C(t=>{for(const e of t){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(me.debug("Registering icon pack:",e.name),"loader"in e)o1t.set(e.name,e.loader);else if("icons"in e)tbe.set(e.name,e.icons);else throw me.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),l1t=C(async(t,e)=>{const r=ttn(t,!0,e!==void 0);if(!r)throw new Error(`Invalid icon name: ${t}`);const n=r.prefix||e;if(!n)throw new Error(`Icon name must contain a prefix: ${t}`);let i=tbe.get(n);if(!i){const s=o1t.get(n);if(!s)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await s(),prefix:n},tbe.set(n,i)}catch(o){throw me.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=itn(i,r.name);if(!a)throw new Error(`Icon not found: ${t}`);return a},"getRegisteredIconData"),mtn=C(async t=>{try{return await l1t(t),!0}catch{return!1}},"isIconAvailable"),Fy=C(async(t,e,r)=>{let n;try{n=await l1t(t,e==null?void 0:e.fallbackPrefix)}catch(s){me.error(s),n=s1t}const i=htn(n,e),a=gtn(ptn(i.body),{...i.attributes,...r});return ai(a,Dr())},"getIconSVG");function nbe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var RS=nbe();function c1t(t){RS=t}var p7={exec:()=>null};function $i(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(Du.caret,"$1"),r=r.replace(i,s),n},getRegex:()=>new RegExp(r,e)};return n}var vtn=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},ytn=/^(?:[ \t]*(?:\n|$))+/,btn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,xtn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,g7=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,wtn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ibe=/(?:[*+-]|\d{1,9}[.)])/,u1t=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,h1t=$i(u1t).replace(/bull/g,ibe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Atn=$i(u1t).replace(/bull/g,ibe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),abe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ttn=/^[^\n]+/,sbe=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Stn=$i(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",sbe).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ctn=$i(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ibe).getRegex(),Nj="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",obe=/|$))/,Otn=$i("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",obe).replace("tag",Nj).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),d1t=$i(abe).replace("hr",g7).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Nj).getRegex(),ktn=$i(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",d1t).getRegex(),lbe={blockquote:ktn,code:btn,def:Stn,fences:xtn,heading:wtn,hr:g7,html:Otn,lheading:h1t,list:Ctn,newline:ytn,paragraph:d1t,table:p7,text:Ttn},f1t=$i("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",g7).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Nj).getRegex(),Etn={...lbe,lheading:Atn,table:f1t,paragraph:$i(abe).replace("hr",g7).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",f1t).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Nj).getRegex()},_tn={...lbe,html:$i(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",obe).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:p7,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$i(abe).replace("hr",g7).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",h1t).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Rtn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Dtn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,p1t=/^( {2,}|\\)\n(?!\s*$)/,Ltn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",vtn?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),v1t=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Btn=$i(v1t,"u").replace(/punct/g,Bj).getRegex(),$tn=$i(v1t,"u").replace(/punct/g,m1t).getRegex(),y1t="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ftn=$i(y1t,"gu").replace(/notPunctSpace/g,g1t).replace(/punctSpace/g,cbe).replace(/punct/g,Bj).getRegex(),ztn=$i(y1t,"gu").replace(/notPunctSpace/g,Ptn).replace(/punctSpace/g,Itn).replace(/punct/g,m1t).getRegex(),Utn=$i("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,g1t).replace(/punctSpace/g,cbe).replace(/punct/g,Bj).getRegex(),Vtn=$i(/\\(punct)/,"gu").replace(/punct/g,Bj).getRegex(),Qtn=$i(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Gtn=$i(obe).replace("(?:-->|$)","-->").getRegex(),Htn=$i("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Gtn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),$j=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Wtn=$i(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",$j).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),b1t=$i(/^!?\[(label)\]\[(ref)\]/).replace("label",$j).replace("ref",sbe).getRegex(),x1t=$i(/^!?\[(ref)\](?:\[\])?/).replace("ref",sbe).getRegex(),Ytn=$i("reflink|nolink(?!\\()","g").replace("reflink",b1t).replace("nolink",x1t).getRegex(),w1t=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ube={_backpedal:p7,anyPunctuation:Vtn,autolink:Qtn,blockSkip:Ntn,br:p1t,code:Dtn,del:p7,emStrongLDelim:Btn,emStrongRDelimAst:Ftn,emStrongRDelimUnd:Utn,escape:Rtn,link:Wtn,nolink:x1t,punctuation:Mtn,reflink:b1t,reflinkSearch:Ytn,tag:Htn,text:Ltn,url:p7},qtn={...ube,link:$i(/^!?\[(label)\]\((.*?)\)/).replace("label",$j).getRegex(),reflink:$i(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",$j).getRegex()},hbe={...ube,emStrongRDelimAst:ztn,emStrongLDelim:$tn,url:$i(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",w1t).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:$i(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},A1t=t=>Xtn[t];function r0(t,e){if(e){if(Du.escapeTest.test(t))return t.replace(Du.escapeReplace,A1t)}else if(Du.escapeTestNoEncode.test(t))return t.replace(Du.escapeReplaceNoEncode,A1t);return t}function T1t(t){try{t=encodeURI(t).replace(Du.percentDecode,"%")}catch{return null}return t}function S1t(t,e){var a;let r=t.replace(Du.findPipe,(s,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(Du.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!((a=n.at(-1))!=null&&a.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length0?-2:-1}function C1t(t,e,r,n,i){let a=e.href,s=e.title||null,o=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:s,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function Ztn(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(` + */var fen=C(t=>{const{handDrawnSeed:e}=He();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),H5=C(t=>{const e=pen([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),pen=C(t=>{const e=new Map;return t.forEach(r=>{const[n,i]=r.split(":");e.set(n.trim(),i==null?void 0:i.trim())}),e},"styles2Map"),B1e=C(t=>t==="color"||t==="font-size"||t==="font-family"||t==="font-weight"||t==="font-style"||t==="text-decoration"||t==="text-align"||t==="text-transform"||t==="line-height"||t==="letter-spacing"||t==="word-spacing"||t==="text-shadow"||t==="text-overflow"||t==="white-space"||t==="word-wrap"||t==="word-break"||t==="overflow-wrap"||t==="hyphens","isLabelStyle"),Or=C(t=>{const{stylesArray:e}=H5(t),r=[],n=[],i=[],a=[];return e.forEach(s=>{const o=s[0];B1e(o)?r.push(s.join(":")+" !important"):(n.push(s.join(":")+" !important"),o.includes("stroke")&&i.push(s.join(":")+" !important"),o==="fill"&&a.push(s.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:a}},"styles2String"),_r=C((t,e)=>{var l;const{themeVariables:r,handDrawnSeed:n}=He(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:s}=H5(t);return Object.assign({roughness:.7,fill:s.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:s.get("stroke")||i,seed:n,strokeWidth:((l=s.get("stroke-width"))==null?void 0:l.replace("px",""))||1.3,fillLineDash:[0,0],strokeLineDash:gen(s.get("stroke-dasharray"))},e)},"userNodeOverrides"),gen=C(t=>{if(!t)return[0,0];const e=t.trim().split(/\s+/).map(Number);if(e.length===1){const i=isNaN(e[0])?0:e[0];return[i,i]}const r=isNaN(e[0])?0:e[0],n=isNaN(e[1])?0:e[1];return[r,n]},"getStrokeDashArray"),yyt={},El={};Object.defineProperty(El,"__esModule",{value:!0}),El.BLANK_URL=El.relativeFirstCharacters=El.whitespaceEscapeCharsRegex=El.urlSchemeRegex=El.ctrlCharactersRegex=El.htmlCtrlEntityRegex=El.htmlEntitiesRegex=El.invalidProtocolRegex=void 0,El.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,El.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,El.htmlCtrlEntityRegex=/&(newline|tab);/gi,El.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,El.urlSchemeRegex=/^.+(:|:)/gim,El.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,El.relativeFirstCharacters=[".","/"],El.BLANK_URL="about:blank",Object.defineProperty(yyt,"__esModule",{value:!0});var _T=yyt.sanitizeUrl=ben,Kc=El;function men(t){return Kc.relativeFirstCharacters.indexOf(t[0])>-1}function ven(t){var e=t.replace(Kc.ctrlCharactersRegex,"");return e.replace(Kc.htmlEntitiesRegex,function(r,n){return String.fromCharCode(n)})}function yen(t){return URL.canParse(t)}function byt(t){try{return decodeURIComponent(t)}catch{return t}}function ben(t){if(!t)return Kc.BLANK_URL;var e,r=byt(t.trim());do r=ven(r).replace(Kc.htmlCtrlEntityRegex,"").replace(Kc.ctrlCharactersRegex,"").replace(Kc.whitespaceEscapeCharsRegex,"").trim(),r=byt(r),e=r.match(Kc.ctrlCharactersRegex)||r.match(Kc.htmlEntitiesRegex)||r.match(Kc.htmlCtrlEntityRegex)||r.match(Kc.whitespaceEscapeCharsRegex);while(e&&e.length>0);var n=r;if(!n)return Kc.BLANK_URL;if(men(n))return n;var i=n.trimStart(),a=i.match(Kc.urlSchemeRegex);if(!a)return n;var s=a[0].toLowerCase().trim();if(Kc.invalidProtocolRegex.test(s))return Kc.BLANK_URL;var o=i.replace(/\\/g,"/");if(s==="mailto:"||s.includes("://"))return o;if(s==="http:"||s==="https:"){if(!yen(o))return Kc.BLANK_URL;var l=new URL(o);return l.protocol=l.protocol.toLowerCase(),l.hostname=l.hostname.toLowerCase(),l.toString()}return o}function xen(t){return Array.isArray(t)}function $1e(t){var r;if(typeof t!="object"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!=="[object Object]"){const n=t[Symbol.toStringTag];return n==null||!((r=Object.getOwnPropertyDescriptor(t,Symbol.toStringTag))!=null&&r.writable)?!1:t.toString()===`[object ${n}]`}let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function wen(){}function xyt(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function u7(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const wyt="[object RegExp]",F1e="[object String]",z1e="[object Number]",U1e="[object Boolean]",V1e="[object Arguments]",Ayt="[object Symbol]",Syt="[object Date]",Tyt="[object Map]",Cyt="[object Set]",Oyt="[object Array]",kyt="[object ArrayBuffer]",Eyt="[object Object]",_yt="[object DataView]",Ryt="[object Uint8Array]",Dyt="[object Uint8ClampedArray]",Lyt="[object Uint16Array]",Myt="[object Uint32Array]",Iyt="[object Int8Array]",Pyt="[object Int16Array]",Nyt="[object Int32Array]",Byt="[object Float32Array]",$yt="[object Float64Array]",Fyt=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||function(){return this}();function Q1e(t){return typeof Fyt.Buffer<"u"&&Fyt.Buffer.isBuffer(t)}function Aen(t){return Number.isSafeInteger(t)&&t>=0}function zyt(t){return t!=null&&typeof t!="function"&&Aen(t.length)}function Sen(t){return t==="__proto__"}function Rj(t){return t==null||typeof t!="object"&&typeof t!="function"}function G1e(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Ten(t,e){return W5(t,void 0,t,new Map,e)}function W5(t,e,r,n=new Map,i=void 0){const a=i==null?void 0:i(t,e,r,n);if(a!==void 0)return a;if(Rj(t))return t;if(n.has(t))return n.get(t);if(Array.isArray(t)){const s=new Array(t.length);n.set(t,s);for(let o=0;o{if(typeof t=="object"){if(u7(t)==="[object Object]"&&typeof t.constructor!="function"){const s={};return a.set(t,s),og(s,t,i,a),s}switch(Object.prototype.toString.call(t)){case z1e:case F1e:case U1e:{const s=new t.constructor(t==null?void 0:t.valueOf());return og(s,t),s}case V1e:{const s={};return og(s,t),s.length=t.length,s[Symbol.iterator]=t[Symbol.iterator],s}default:return}}})}function Uyt(t){return Oen(t)}function H1e(t){return t!==null&&typeof t=="object"&&u7(t)==="[object Arguments]"}function W1e(t){return typeof t=="object"&&t!==null}function ken(t){return W1e(t)&&zyt(t)}function h7(t){return G1e(t)}function Een(t){const e=t==null?void 0:t.constructor;return t===(typeof e=="function"?e.prototype:Object.prototype)}function d7(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");const r=function(...n){const i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);const s=t.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(d7.Cache||Map),r}d7.Cache=Map;function _en(t){if(Rj(t))return t;const e=u7(t);if(!Ren(t))return{};if(xen(t)){const n=Array.from(t);return t.length>0&&typeof t[0]=="string"&&Object.hasOwn(t,"index")&&(n.index=t.index,n.input=t.input),n}if(h7(t)){const n=t,i=n.constructor;return new i(n.buffer,n.byteOffset,n.length)}if(e==="[object ArrayBuffer]")return new ArrayBuffer(t.byteLength);if(e==="[object DataView]"){const n=t,i=n.buffer,a=n.byteOffset,s=n.byteLength,o=new ArrayBuffer(s),l=new Uint8Array(i,a,s);return new Uint8Array(o).set(l),new DataView(o)}if(e==="[object Boolean]"||e==="[object Number]"||e==="[object String]"){const n=t.constructor,i=new n(t.valueOf());return e==="[object String]"?Len(i,t):Y1e(i,t),i}if(e==="[object Date]")return new Date(Number(t));if(e==="[object RegExp]"){const n=t,i=new RegExp(n.source,n.flags);return i.lastIndex=n.lastIndex,i}if(e==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(t));if(e==="[object Map]"){const n=t,i=new Map;return n.forEach((a,s)=>{i.set(s,a)}),i}if(e==="[object Set]"){const n=t,i=new Set;return n.forEach(a=>{i.add(a)}),i}if(e==="[object Arguments]"){const n=t,i={};return Y1e(i,n),i.length=n.length,i[Symbol.iterator]=n[Symbol.iterator],i}const r={};return Men(r,t),Y1e(r,t),Den(r,t),r}function Ren(t){switch(u7(t)){case V1e:case Oyt:case kyt:case _yt:case U1e:case Syt:case Byt:case $yt:case Iyt:case Pyt:case Nyt:case Tyt:case z1e:case Eyt:case wyt:case Cyt:case F1e:case Ayt:case Ryt:case Dyt:case Lyt:case Myt:return!0;default:return!1}}function Y1e(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}function Den(t,e){const r=Object.getOwnPropertySymbols(e);for(let n=0;n=r)&&(t[n]=e[n])}function Men(t,e){const r=Object.getPrototypeOf(e);r!==null&&typeof e.constructor=="function"&&Object.setPrototypeOf(t,r)}function Ien(t){if(Rj(t))return t;if(Array.isArray(t)||G1e(t)||t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);const e=Object.getPrototypeOf(t);if(e==null)return Object.assign(Object.create(e),t);const r=e.constructor;if(t instanceof Date||t instanceof Map||t instanceof Set)return new r(t);if(t instanceof RegExp){const n=new r(t);return n.lastIndex=t.lastIndex,n}if(t instanceof DataView)return new r(t.buffer.slice(0));if(t instanceof Error){let n;return t instanceof AggregateError?n=new r(t.errors,t.message,{cause:t.cause}):n=new r(t.message,{cause:t.cause}),n.stack=t.stack,Object.assign(n,t),n}return typeof File<"u"&&t instanceof File?new r([t],t.name,{type:t.type,lastModified:t.lastModified}):typeof t=="object"?Object.assign(Object.create(e),t):t}function Pen(t,...e){const r=e.slice(0,-1),n=e[e.length-1];let i=t;for(let a=0;ar!=="constructor").length===0:e.length===0}return!0}var Qyt="​",Ben={curveBasis:n7,curveBasisClosed:eJr,curveBasisOpen:tJr,curveBumpX:h0t,curveBumpY:d0t,curveBundle:rJr,curveCardinalClosed:nJr,curveCardinalOpen:iJr,curveCardinal:m0t,curveCatmullRomClosed:aJr,curveCatmullRomOpen:sJr,curveCatmullRom:y0t,curveLinear:t7,curveLinearClosed:oJr,curveMonotoneX:k0t,curveMonotoneY:E0t,curveNatural:D0t,curveStep:L0t,curveStepAfter:I0t,curveStepBefore:M0t},$en=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Fen=C(function(t,e){const r=Gyt(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const s=r.map(o=>o.args);Cq(s),n=Eo(n,[...s])}else n=r.args;if(!n)return;let i=cye(t,e);const a="config";return n[a]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[a],delete n[a]),n},"detectInit"),Gyt=C(function(t,e=null){var r,n;try{const i=new RegExp(`[%]{2}(?![{]${$en.source})(?=[}][%]{2}).* +`,"ig");t=t.trim().replace(i,"").replace(/'/gm,'"'),me.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let a;const s=[];for(;(a=MB.exec(t))!==null;)if(a.index===MB.lastIndex&&MB.lastIndex++,a&&!e||e&&((r=a[1])!=null&&r.match(e))||e&&((n=a[2])!=null&&n.match(e))){const o=a[1]?a[1]:a[2],l=a[3]?a[3].trim():a[4]?JSON.parse(a[4].trim()):null;s.push({type:o,args:l})}return s.length===0?{type:t,args:null}:s.length===1?s[0]:s}catch(i){return me.error(`ERROR: ${i.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),zen=C(function(t){return t.replace(MB,"")},"removeDirectives"),Uen=C(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function q1e(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return Ben[r]??e}C(q1e,"interpolateToCurve");function Hyt(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?_T(r):r}C(Hyt,"formatUrl");var Ven=C((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let a=window;for(let s=0;s{r+=j1e(i,e),e=i});const n=r/2;return X1e(t,n)}C(Wyt,"traverseEdge");function Yyt(t){return t.length===1?t[0]:Wyt(t)}C(Yyt,"calcLabelPosition");var qyt=C((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),X1e=C((t,e)=>{let r,n=e;for(const i of t){if(r){const a=j1e(i,r);if(a===0)return r;if(a=1)return{x:i.x,y:i.y};if(s>0&&s<1)return{x:qyt((1-s)*r.x+s*i.x,5),y:qyt((1-s)*r.y+s*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),Qen=C((t,e,r)=>{me.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=X1e(e,25),a=t?10:5,s=Math.atan2(e[0].y-i.y,e[0].x-i.x),o={x:0,y:0};return o.x=Math.sin(s)*a+(e[0].x+i.x)/2,o.y=-Math.cos(s)*a+(e[0].y+i.y)/2,o},"calcCardinalityPosition");function jyt(t,e,r){const n=structuredClone(r);me.info("our points",n),e!=="start_left"&&e!=="start_right"&&n.reverse();const i=25+t,a=X1e(n,i),s=10+t*.5,o=Math.atan2(n[0].y-a.y,n[0].x-a.x),l={x:0,y:0};return e==="start_left"?(l.x=Math.sin(o+Math.PI)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o+Math.PI)*s+(n[0].y+a.y)/2):e==="end_right"?(l.x=Math.sin(o-Math.PI)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o-Math.PI)*s+(n[0].y+a.y)/2-5):e==="end_left"?(l.x=Math.sin(o)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2-5):(l.x=Math.sin(o)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2),l}C(jyt,"calcTerminalLabelPosition");function K1e(t){let e="",r="";for(const n of t)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":e=e+n+";");return{style:e,labelStyle:r}}C(K1e,"getStylesFromArray");var Xyt=0,Kyt=C(()=>(Xyt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Xyt),"generateId");function Zyt(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;iZyt(t.length),"random"),Gen=C(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),Hen=C(function(t,e){const r=e.text.replace(jt.lineBreakRegex," "),[,n]=By(e.fontSize),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.style("font-family",e.fontFamily),i.style("font-size",n),i.style("font-weight",e.fontWeight),i.attr("fill",e.fill),e.class!==void 0&&i.attr("class",e.class);const a=i.append("tspan");return a.attr("x",e.x+e.textMargin*2),a.attr("fill",e.fill),a.text(r),i},"drawSimpleText"),f7=d7((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},r),jt.lineBreakRegex.test(t)))return t;const n=t.split(" ").filter(Boolean),i=[];let a="";return n.forEach((s,o)=>{const l=Ru(`${s} `,r),u=Ru(a,r);if(l>e){const{hyphenatedStrings:f,remainingWord:p}=Wen(s,e,"-",r);i.push(a,...f),a=p}else u+l>=e?(i.push(a),a=s):a=[a,s].filter(Boolean).join(" ");o+1===n.length&&i.push(a)}),i.filter(s=>s!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),Wen=d7((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const i=[...t],a=[];let s="";return i.forEach((o,l)=>{const u=`${s}${o}`;if(Ru(u,n)>=e){const d=l+1,f=i.length===d,p=`${u}${r}`;a.push(f?u:p),s=""}else s=u}),{hyphenatedStrings:a,remainingWord:s}},(t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);function Lj(t,e){return Mj(t,e).height}C(Lj,"calculateTextHeight");function Ru(t,e){return Mj(t,e).width}C(Ru,"calculateTextWidth");var Mj=d7((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,a]=By(r),s=["sans-serif",n],o=t.split(jt.lineBreakRegex),l=[],u=Ot("body");if(!u.remove)return{width:0,height:0,lineHeight:0};const h=u.append("svg");for(const f of s){let p=0;const g={width:0,height:0,lineHeight:0};for(const m of o){const v=Gen();v.text=m||Qyt;const y=Hen(h,v).style("font-size",a).style("font-weight",i).style("font-family",f),b=(y._groups||y)[0][0].getBBox();if(b.width===0&&b.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,b.width)),p=Math.round(b.height),g.height+=p,g.lineHeight=Math.round(Math.max(g.lineHeight,p))}l.push(g)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),Yen=(TD=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},C(TD,"InitIDGenerator"),TD),Ij,qen=C(function(t){return Ij=Ij||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Ij.innerHTML=t,unescape(Ij.textContent)},"entityDecode");function Z1e(t){return"str"in t}C(Z1e,"isDetailedError");var jen=C((t,e,r,n)=>{var a;if(!n)return;const i=(a=t.node())==null?void 0:a.getBBox();i&&t.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)},"insertTitle"),By=C(t=>{if(typeof t=="number")return[t,t+"px"];const e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");function ns(t,e){return Nen({},t,e)}C(ns,"cleanAndMerge");var ln={assignWithDepth:Eo,wrapLabel:f7,calculateTextHeight:Lj,calculateTextWidth:Ru,calculateTextDimensions:Mj,cleanAndMerge:ns,detectInit:Fen,detectDirective:Gyt,isSubstringInArray:Uen,interpolateToCurve:q1e,calcLabelPosition:Yyt,calcCardinalityPosition:Qen,calcTerminalLabelPosition:jyt,formatUrl:Hyt,getStylesFromArray:K1e,generateId:Kyt,random:Jyt,runFunc:Ven,entityDecode:qen,insertTitle:jen,isLabelCoordinateInPath:e1t,parseFontSize:By,InitIDGenerator:Yen},Xen=C(function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/#\w+;/g,function(r){const n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"fl°°"+n+"¶ß":"fl°"+n+"¶ß"}),e},"encodeEntities"),$y=C(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),Y5=C((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function _l(t){return t??null}C(_l,"handleUndefinedAttr");function e1t(t,e){const r=Math.round(t.x),n=Math.round(t.y),i=e.replace(/(\d+\.\d+)/g,a=>Math.round(parseFloat(a)).toString());return i.includes(r.toString())||i.includes(n.toString())}C(e1t,"isLabelCoordinateInPath");var q5=C(({flowchart:t})=>{var i,a;const e=((i=t==null?void 0:t.subGraphTitleMargin)==null?void 0:i.top)??0,r=((a=t==null?void 0:t.subGraphTitleMargin)==null?void 0:a.bottom)??0,n=e+r;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:n}},"getSubGraphTitleMargins");async function J1e(t,e){const r=t.getElementsByTagName("img");if(!r||r.length===0)return;const n=e.replace(/]*>/g,"").trim()==="";await Promise.all([...r].map(i=>new Promise(a=>{function s(){if(i.style.display="flex",i.style.flexDirection="column",n){const o=He().fontSize?He().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[u=Xn.fontSize]=By(o),h=u*l+"px";i.style.minWidth=h,i.style.maxWidth=h}else i.style.width="100%";a(i)}C(s,"setupImage"),setTimeout(()=>{i.complete&&s()}),i.addEventListener("error",s),i.addEventListener("load",s)})))}C(J1e,"configureLabelImages");const Ken=Object.freeze({left:0,top:0,width:16,height:16}),Pj=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),t1t=Object.freeze({...Ken,...Pj}),Zen=Object.freeze({...t1t,body:"",hidden:!1}),Jen=Object.freeze({width:null,height:null}),etn=Object.freeze({...Jen,...Pj}),ttn=(t,e,r,n="")=>{const i=t.split(":");if(t.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;n=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const o=i.pop(),l=i.pop(),u={provider:i.length>0?i[0]:n,prefix:l,name:o};return ebe(u)?u:null}const a=i[0],s=a.split("-");if(s.length>1){const o={provider:n,prefix:s.shift(),name:s.join("-")};return ebe(o)?o:null}if(r&&n===""){const o={provider:n,prefix:"",name:a};return ebe(o,r)?o:null}return null},ebe=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function rtn(t,e){const r={};!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0);const n=((t.rotate||0)+(e.rotate||0))%4;return n&&(r.rotate=n),r}function r1t(t,e){const r=rtn(t,e);for(const n in Zen)n in Pj?n in t&&!(n in r)&&(r[n]=Pj[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function ntn(t,e){const r=t.icons,n=t.aliases||Object.create(null),i=Object.create(null);function a(s){if(r[s])return i[s]=[];if(!(s in i)){i[s]=null;const o=n[s]&&n[s].parent,l=o&&a(o);l&&(i[s]=[o].concat(l))}return i[s]}return(e||Object.keys(r).concat(Object.keys(n))).forEach(a),i}function n1t(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let a={};function s(o){a=r1t(n[o]||i[o],a)}return s(e),r.forEach(s),r1t(t,a)}function itn(t,e){if(t.icons[e])return n1t(t,e,[]);const r=ntn(t,[e])[e];return r?n1t(t,e,r):null}const atn=/(-?[0-9.]*[0-9]+[0-9.]*)/g,stn=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function i1t(t,e,r){if(e===1)return t;if(r=r||100,typeof t=="number")return Math.ceil(t*e*r)/r;if(typeof t!="string")return t;const n=t.split(atn);if(n===null||!n.length)return t;const i=[];let a=n.shift(),s=stn.test(a);for(;;){if(s){const o=parseFloat(a);isNaN(o)?i.push(a):i.push(Math.ceil(o*e*r)/r)}else i.push(a);if(a=n.shift(),a===void 0)return i.join("");s=!s}}function otn(t,e="defs"){let r="";const n=t.indexOf("<"+e);for(;n>=0;){const i=t.indexOf(">",n),a=t.indexOf("",a);if(s===-1)break;r+=t.slice(i+1,a).trim(),t=t.slice(0,n).trim()+t.slice(s+1)}return{defs:r,content:t}}function ltn(t,e){return t?""+t+""+e:e}function ctn(t,e,r){const n=otn(t);return ltn(n.defs,e+n.content+r)}const utn=t=>t==="unset"||t==="undefined"||t==="none";function htn(t,e){const r={...t1t,...t},n={...etn,...e},i={left:r.left,top:r.top,width:r.width,height:r.height};let a=r.body;[r,n].forEach(m=>{const v=[],y=m.hFlip,b=m.vFlip;let x=m.rotate;y?b?x+=2:(v.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),v.push("scale(-1 1)"),i.top=i.left=0):b&&(v.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),v.push("scale(1 -1)"),i.top=i.left=0);let w;switch(x<0&&(x-=Math.floor(x/4)*4),x=x%4,x){case 1:w=i.height/2+i.top,v.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:v.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:w=i.width/2+i.left,v.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}x%2===1&&(i.left!==i.top&&(w=i.left,i.left=i.top,i.top=w),i.width!==i.height&&(w=i.width,i.width=i.height,i.height=w)),v.length&&(a=ctn(a,'',""))});const s=n.width,o=n.height,l=i.width,u=i.height;let h,d;s===null?(d=o===null?"1em":o==="auto"?u:o,h=i1t(d,l/u)):(h=s==="auto"?l:s,d=o===null?i1t(h,u/l):o==="auto"?u:o);const f={},p=(m,v)=>{utn(v)||(f[m]=v.toString())};p("width",h),p("height",d);const g=[i.left,i.top,l,u];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:a}}const dtn=/\sid="(\S+)"/g,a1t=new Map;function ftn(t){t=t.replace(/[0-9]+$/,"")||"a";const e=a1t.get(t)||0;return a1t.set(t,e+1),e?`${t}${e}`:t}function ptn(t){const e=[];let r;for(;r=dtn.exec(t);)e.push(r[1]);if(!e.length)return t;const n="suffix"+(Math.random()*16777216|Date.now()).toString(16);return e.forEach(i=>{const a=ftn(i),s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+a+n+"$3")}),t=t.replace(new RegExp(n,"g"),""),t}function gtn(t,e){let r=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in e)r+=" "+n+'="'+e[n]+'"';return'"+t+""}var s1t={body:'?',height:80,width:80},tbe=new Map,o1t=new Map,rbe=C(t=>{for(const e of t){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(me.debug("Registering icon pack:",e.name),"loader"in e)o1t.set(e.name,e.loader);else if("icons"in e)tbe.set(e.name,e.icons);else throw me.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),l1t=C(async(t,e)=>{const r=ttn(t,!0,e!==void 0);if(!r)throw new Error(`Invalid icon name: ${t}`);const n=r.prefix||e;if(!n)throw new Error(`Icon name must contain a prefix: ${t}`);let i=tbe.get(n);if(!i){const s=o1t.get(n);if(!s)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await s(),prefix:n},tbe.set(n,i)}catch(o){throw me.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=itn(i,r.name);if(!a)throw new Error(`Icon not found: ${t}`);return a},"getRegisteredIconData"),mtn=C(async t=>{try{return await l1t(t),!0}catch{return!1}},"isIconAvailable"),Fy=C(async(t,e,r)=>{let n;try{n=await l1t(t,e==null?void 0:e.fallbackPrefix)}catch(s){me.error(s),n=s1t}const i=htn(n,e),a=gtn(ptn(i.body),{...i.attributes,...r});return ai(a,Dr())},"getIconSVG");function nbe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var RT=nbe();function c1t(t){RT=t}var p7={exec:()=>null};function $i(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(Du.caret,"$1"),r=r.replace(i,s),n},getRegex:()=>new RegExp(r,e)};return n}var vtn=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^
/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},ytn=/^(?:[ \t]*(?:\n|$))+/,btn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,xtn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,g7=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,wtn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ibe=/(?:[*+-]|\d{1,9}[.)])/,u1t=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,h1t=$i(u1t).replace(/bull/g,ibe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Atn=$i(u1t).replace(/bull/g,ibe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),abe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Stn=/^[^\n]+/,sbe=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ttn=$i(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",sbe).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ctn=$i(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ibe).getRegex(),Nj="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",obe=/|$))/,Otn=$i("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",obe).replace("tag",Nj).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),d1t=$i(abe).replace("hr",g7).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Nj).getRegex(),ktn=$i(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",d1t).getRegex(),lbe={blockquote:ktn,code:btn,def:Ttn,fences:xtn,heading:wtn,hr:g7,html:Otn,lheading:h1t,list:Ctn,newline:ytn,paragraph:d1t,table:p7,text:Stn},f1t=$i("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",g7).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Nj).getRegex(),Etn={...lbe,lheading:Atn,table:f1t,paragraph:$i(abe).replace("hr",g7).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",f1t).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Nj).getRegex()},_tn={...lbe,html:$i(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",obe).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:p7,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$i(abe).replace("hr",g7).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",h1t).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Rtn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Dtn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,p1t=/^( {2,}|\\)\n(?!\s*$)/,Ltn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",vtn?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),v1t=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Btn=$i(v1t,"u").replace(/punct/g,Bj).getRegex(),$tn=$i(v1t,"u").replace(/punct/g,m1t).getRegex(),y1t="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ftn=$i(y1t,"gu").replace(/notPunctSpace/g,g1t).replace(/punctSpace/g,cbe).replace(/punct/g,Bj).getRegex(),ztn=$i(y1t,"gu").replace(/notPunctSpace/g,Ptn).replace(/punctSpace/g,Itn).replace(/punct/g,m1t).getRegex(),Utn=$i("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,g1t).replace(/punctSpace/g,cbe).replace(/punct/g,Bj).getRegex(),Vtn=$i(/\\(punct)/,"gu").replace(/punct/g,Bj).getRegex(),Qtn=$i(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Gtn=$i(obe).replace("(?:-->|$)","-->").getRegex(),Htn=$i("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Gtn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),$j=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Wtn=$i(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",$j).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),b1t=$i(/^!?\[(label)\]\[(ref)\]/).replace("label",$j).replace("ref",sbe).getRegex(),x1t=$i(/^!?\[(ref)\](?:\[\])?/).replace("ref",sbe).getRegex(),Ytn=$i("reflink|nolink(?!\\()","g").replace("reflink",b1t).replace("nolink",x1t).getRegex(),w1t=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ube={_backpedal:p7,anyPunctuation:Vtn,autolink:Qtn,blockSkip:Ntn,br:p1t,code:Dtn,del:p7,emStrongLDelim:Btn,emStrongRDelimAst:Ftn,emStrongRDelimUnd:Utn,escape:Rtn,link:Wtn,nolink:x1t,punctuation:Mtn,reflink:b1t,reflinkSearch:Ytn,tag:Htn,text:Ltn,url:p7},qtn={...ube,link:$i(/^!?\[(label)\]\((.*?)\)/).replace("label",$j).getRegex(),reflink:$i(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",$j).getRegex()},hbe={...ube,emStrongRDelimAst:ztn,emStrongLDelim:$tn,url:$i(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",w1t).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:$i(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},A1t=t=>Xtn[t];function r0(t,e){if(e){if(Du.escapeTest.test(t))return t.replace(Du.escapeReplace,A1t)}else if(Du.escapeTestNoEncode.test(t))return t.replace(Du.escapeReplaceNoEncode,A1t);return t}function S1t(t){try{t=encodeURI(t).replace(Du.percentDecode,"%")}catch{return null}return t}function T1t(t,e){var a;let r=t.replace(Du.findPipe,(s,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(Du.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!((a=n.at(-1))!=null&&a.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length0?-2:-1}function C1t(t,e,r,n,i){let a=e.href,s=e.title||null,o=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:s,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function Ztn(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(` `).map(a=>{let s=a.match(r.other.beginningSpace);if(s===null)return a;let[o]=s;return o.length>=i.length?a.slice(i.length):a}).join(` -`)}var zj=class{constructor(e){Bn(this,"options");Bn(this,"rules");Bn(this,"lexer");this.options=e||RS}space(e){let r=this.rules.block.newline.exec(e);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(e){let r=this.rules.block.code.exec(e);if(r){let n=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:v7(n,` +`)}var zj=class{constructor(e){Bn(this,"options");Bn(this,"rules");Bn(this,"lexer");this.options=e||RT}space(e){let r=this.rules.block.newline.exec(e);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(e){let r=this.rules.block.code.exec(e);if(r){let n=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:v7(n,` `)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=Ztn(n,r[3]||"",this.rules);return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(e){let r=this.rules.block.heading.exec(e);if(r){let n=r[2].trim();if(this.rules.other.endingHash.test(n)){let i=v7(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let r=this.rules.block.hr.exec(e);if(r)return{type:"hr",raw:v7(r[0],` `)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=v7(r[0],` `).split(` @@ -548,13 +548,13 @@ ${d}`:d;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo `);continue}}return{type:"blockquote",raw:i,tokens:s,text:a}}}list(e){let r=this.rules.block.list.exec(e);if(r){let n=r[1].trim(),i=n.length>1,a={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let s=this.rules.other.listItemRegex(n),o=!1;for(;e;){let u=!1,h="",d="";if(!(r=s.exec(e))||this.rules.block.hr.test(e))break;h=r[0],e=e.substring(h.length);let f=r[2].split(` `,1)[0].replace(this.rules.other.listReplaceTabs,b=>" ".repeat(3*b.length)),p=e.split(` `,1)[0],g=!f.trim(),m=0;if(this.options.pedantic?(m=2,d=f.trimStart()):g?m=r[1].length+1:(m=r[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,d=f.slice(m),m+=r[1].length),g&&this.rules.other.blankLine.test(p)&&(h+=p+` -`,e=e.substring(p.length+1),u=!0),!u){let b=this.rules.other.nextBulletRegex(m),x=this.rules.other.hrRegex(m),w=this.rules.other.fencesBeginRegex(m),A=this.rules.other.headingBeginRegex(m),T=this.rules.other.htmlBeginRegex(m);for(;e;){let S=e.split(` -`,1)[0],O;if(p=S,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),O=p):O=p.replace(this.rules.other.tabCharGlobal," "),w.test(p)||A.test(p)||T.test(p)||b.test(p)||x.test(p))break;if(O.search(this.rules.other.nonSpaceChar)>=m||!p.trim())d+=` +`,e=e.substring(p.length+1),u=!0),!u){let b=this.rules.other.nextBulletRegex(m),x=this.rules.other.hrRegex(m),w=this.rules.other.fencesBeginRegex(m),A=this.rules.other.headingBeginRegex(m),S=this.rules.other.htmlBeginRegex(m);for(;e;){let T=e.split(` +`,1)[0],O;if(p=T,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),O=p):O=p.replace(this.rules.other.tabCharGlobal," "),w.test(p)||A.test(p)||S.test(p)||b.test(p)||x.test(p))break;if(O.search(this.rules.other.nonSpaceChar)>=m||!p.trim())d+=` `+O.slice(m);else{if(g||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(f)||A.test(f)||x.test(f))break;d+=` -`+p}!g&&!p.trim()&&(g=!0),h+=S+` -`,e=e.substring(S.length+1),f=O.slice(m)}}a.loose||(o?a.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(o=!0));let v=null,y;this.options.gfm&&(v=this.rules.other.listIsTask.exec(d),v&&(y=v[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:h,task:!!v,checked:y,loose:!1,text:d,tokens:[]}),a.raw+=h}let l=a.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let u=0;uf.type==="space"),d=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));a.loose=d}if(a.loose)for(let u=0;u({text:u,tokens:this.lexer.inline(u),header:!1,align:s.align[h]})));return s}}lheading(e){let r=this.rules.block.lheading.exec(e);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(e){let r=this.rules.block.paragraph.exec(e);if(r){let n=r[1].charAt(r[1].length-1)===` -`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){let r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(e){let r=this.rules.inline.tag.exec(e);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(e){let r=this.rules.inline.link.exec(e);if(r){let n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=v7(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=Ktn(r[2],"()");if(s===-2)return;if(s>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let i=r[2],a="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],a=s[3])}else a=r[3]?r[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),C1t(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(e,r){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[i.toLowerCase()];if(!a){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return C1t(n,a,n[0],this.lexer,this.rules)}}emStrong(e,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,s,o,l=a,u=0,h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*e.length+a);(i=h.exec(r))!=null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(o=[...s].length,i[3]||i[4]){l+=o;continue}else if((i[5]||i[6])&&a%3&&!((a+o)%3)){u+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+u);let d=[...i[0]][0].length,f=e.slice(0,a+i.index+d+o);if(Math.min(a,o)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){let r=this.rules.inline.code.exec(e);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(e){let r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e){let r=this.rules.inline.del.exec(e);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(e){let r=this.rules.inline.autolink.exec(e);if(r){let n,i;return r[2]==="@"?(n=r[1],i="mailto:"+n):(n=r[1],i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let r;if(r=this.rules.inline.url.exec(e)){let i,a;if(r[2]==="@")i=r[0],a="mailto:"+i;else{let s;do s=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(s!==r[0]);i=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let r=this.rules.inline.text.exec(e);if(r){let n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}},lg=class CLe{constructor(e){Bn(this,"tokens");Bn(this,"options");Bn(this,"state");Bn(this,"tokenizer");Bn(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||RS,this.options.tokenizer=this.options.tokenizer||new zj,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:Du,block:Fj.normal,inline:m7.normal};this.options.pedantic?(r.block=Fj.pedantic,r.inline=m7.pedantic):this.options.gfm&&(r.block=Fj.gfm,this.options.breaks?r.inline=m7.breaks:r.inline=m7.gfm),this.tokenizer.rules=r}static get rules(){return{block:Fj,inline:m7}}static lex(e,r){return new CLe(r).lex(e)}static lexInline(e,r){return new CLe(r).inlineTokens(e)}lex(e){e=e.replace(Du.carriageReturn,` +`+p}!g&&!p.trim()&&(g=!0),h+=T+` +`,e=e.substring(T.length+1),f=O.slice(m)}}a.loose||(o?a.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(o=!0));let v=null,y;this.options.gfm&&(v=this.rules.other.listIsTask.exec(d),v&&(y=v[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:h,task:!!v,checked:y,loose:!1,text:d,tokens:[]}),a.raw+=h}let l=a.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let u=0;uf.type==="space"),d=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));a.loose=d}if(a.loose)for(let u=0;u({text:u,tokens:this.lexer.inline(u),header:!1,align:s.align[h]})));return s}}lheading(e){let r=this.rules.block.lheading.exec(e);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(e){let r=this.rules.block.paragraph.exec(e);if(r){let n=r[1].charAt(r[1].length-1)===` +`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){let r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(e){let r=this.rules.inline.tag.exec(e);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(e){let r=this.rules.inline.link.exec(e);if(r){let n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=v7(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=Ktn(r[2],"()");if(s===-2)return;if(s>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let i=r[2],a="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],a=s[3])}else a=r[3]?r[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),C1t(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(e,r){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[i.toLowerCase()];if(!a){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return C1t(n,a,n[0],this.lexer,this.rules)}}emStrong(e,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,s,o,l=a,u=0,h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*e.length+a);(i=h.exec(r))!=null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(o=[...s].length,i[3]||i[4]){l+=o;continue}else if((i[5]||i[6])&&a%3&&!((a+o)%3)){u+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+u);let d=[...i[0]][0].length,f=e.slice(0,a+i.index+d+o);if(Math.min(a,o)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){let r=this.rules.inline.code.exec(e);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(e){let r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e){let r=this.rules.inline.del.exec(e);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(e){let r=this.rules.inline.autolink.exec(e);if(r){let n,i;return r[2]==="@"?(n=r[1],i="mailto:"+n):(n=r[1],i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let r;if(r=this.rules.inline.url.exec(e)){let i,a;if(r[2]==="@")i=r[0],a="mailto:"+i;else{let s;do s=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(s!==r[0]);i=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let r=this.rules.inline.text.exec(e);if(r){let n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}},lg=class CLe{constructor(e){Bn(this,"tokens");Bn(this,"options");Bn(this,"state");Bn(this,"tokenizer");Bn(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||RT,this.options.tokenizer=this.options.tokenizer||new zj,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:Du,block:Fj.normal,inline:m7.normal};this.options.pedantic?(r.block=Fj.pedantic,r.inline=m7.pedantic):this.options.gfm&&(r.block=Fj.gfm,this.options.breaks?r.inline=m7.breaks:r.inline=m7.gfm),this.tokenizer.rules=r}static get rules(){return{block:Fj,inline:m7}}static lex(e,r){return new CLe(r).lex(e)}static lexInline(e,r){return new CLe(r).inlineTokens(e)}lex(e){e=e.replace(Du.carriageReturn,` `),this.blockTokens(e,this.tokens);for(let r=0;r(o=u.call({lexer:this},e,r))?(e=e.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);let u=r.at(-1);o.raw.length===1&&u!==void 0?u.raw+=` `:r.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(` `)?"":` @@ -568,7 +568,7 @@ ${d}`:d;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o),n=l.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(` `)?"":` `)+o.raw,u.text+=` -`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var l,u,h,d,f;let n=e,i=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)p.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)a=i[2]?i[2].length:0,n=n.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((u=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:u.call({lexer:this},n))??n;let s=!1,o="";for(;e;){s||(o=""),s=!1;let p;if((d=(h=this.options.extensions)==null?void 0:h.inline)!=null&&d.some(m=>(p=m.call({lexer:this},e,r))?(e=e.substring(p.raw.length),r.push(p),!0):!1))continue;if(p=this.tokenizer.escape(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.tag(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.link(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(p.raw.length);let m=r.at(-1);p.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(p=this.tokenizer.emStrong(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.codespan(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.br(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.del(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.autolink(e)){e=e.substring(p.raw.length),r.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(e))){e=e.substring(p.raw.length),r.push(p);continue}let g=e;if((f=this.options.extensions)!=null&&f.startInline){let m=1/0,v=e.slice(1),y;this.options.extensions.startInline.forEach(b=>{y=b.call({lexer:this},v),typeof y=="number"&&y>=0&&(m=Math.min(m,y))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(p=this.tokenizer.inlineText(g)){e=e.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(o=p.raw.slice(-1)),s=!0;let m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return r}},Uj=class{constructor(e){Bn(this,"options");Bn(this,"parser");this.options=e||RS}space(e){return""}code({text:e,lang:r,escaped:n}){var s;let i=(s=(r||"").match(Du.notSpaceStart))==null?void 0:s[0],a=e.replace(Du.endingNewline,"")+` +`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var l,u,h,d,f;let n=e,i=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)p.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)a=i[2]?i[2].length:0,n=n.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((u=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:u.call({lexer:this},n))??n;let s=!1,o="";for(;e;){s||(o=""),s=!1;let p;if((d=(h=this.options.extensions)==null?void 0:h.inline)!=null&&d.some(m=>(p=m.call({lexer:this},e,r))?(e=e.substring(p.raw.length),r.push(p),!0):!1))continue;if(p=this.tokenizer.escape(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.tag(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.link(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(p.raw.length);let m=r.at(-1);p.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(p=this.tokenizer.emStrong(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.codespan(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.br(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.del(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.autolink(e)){e=e.substring(p.raw.length),r.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(e))){e=e.substring(p.raw.length),r.push(p);continue}let g=e;if((f=this.options.extensions)!=null&&f.startInline){let m=1/0,v=e.slice(1),y;this.options.extensions.startInline.forEach(b=>{y=b.call({lexer:this},v),typeof y=="number"&&y>=0&&(m=Math.min(m,y))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(p=this.tokenizer.inlineText(g)){e=e.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(o=p.raw.slice(-1)),s=!0;let m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return r}},Uj=class{constructor(e){Bn(this,"options");Bn(this,"parser");this.options=e||RT}space(e){return""}code({text:e,lang:r,escaped:n}){var s;let i=(s=(r||"").match(Du.notSpaceStart))==null?void 0:s[0],a=e.replace(Du.endingNewline,"")+` `;return i?'
'+(n?a:r0(a,!0))+`
`:"
"+(n?a:r0(a,!0))+`
`}blockquote({tokens:e}){return`
@@ -586,9 +586,9 @@ ${this.parser.parse(e)}
`}tablerow({text:e}){return` ${e} `}tablecell(e){let r=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+r+` -`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${r0(e,!0)}`}br(e){return"
"}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:r,tokens:n}){let i=this.parser.parseInline(n),a=T1t(e);if(a===null)return i;e=a;let s='
",s}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=T1t(e);if(a===null)return r0(n);e=a;let s=`${n}{let u=o[l].flat(1/0);n=n.concat(this.walkTokens(u,r))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,r)))}}return n}use(...e){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let s=r.renderers[a.name];s?r.renderers[a.name]=function(...o){let l=a.renderer.apply(this,o);return l===!1&&(l=s.apply(this,o)),l}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=r[a.level];s?s.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),i.extensions=r),n.renderer){let a=this.defaults.renderer||new Uj(this.defaults);for(let s in n.renderer){if(!(s in a))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,l=n.renderer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new zj(this.defaults);for(let s in n.tokenizer){if(!(s in a))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,l=n.tokenizer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new y7;for(let s in n.hooks){if(!(s in a))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,l=n.hooks[o],u=a[o];y7.passThroughHooks.has(s)?a[o]=h=>{if(this.defaults.async&&y7.passThroughHooksRespectAsync.has(s))return(async()=>{let f=await l.call(a,h);return u.call(a,f)})();let d=l.call(a,h);return u.call(a,d)}:a[o]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(a,h);return f===!1&&(f=await u.apply(a,h)),f})();let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(s.call(this,o)),a&&(l=l.concat(a.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return lg.lex(e,r??this.defaults)}parser(e,r){return cg.parse(e,r??this.defaults)}parseMarkdown(e){return(r,n)=>{let i={...n},a={...this.defaults,...i},s=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=e),a.async)return(async()=>{let o=a.hooks?await a.hooks.preprocess(r):r,l=await(a.hooks?await a.hooks.provideLexer():e?lg.lex:lg.lexInline)(o,a),u=a.hooks?await a.hooks.processAllTokens(l):l;a.walkTokens&&await Promise.all(this.walkTokens(u,a.walkTokens));let h=await(a.hooks?await a.hooks.provideParser():e?cg.parse:cg.parseInline)(u,a);return a.hooks?await a.hooks.postprocess(h):h})().catch(s);try{a.hooks&&(r=a.hooks.preprocess(r));let o=(a.hooks?a.hooks.provideLexer():e?lg.lex:lg.lexInline)(r,a);a.hooks&&(o=a.hooks.processAllTokens(o)),a.walkTokens&&this.walkTokens(o,a.walkTokens);let l=(a.hooks?a.hooks.provideParser():e?cg.parse:cg.parseInline)(o,a);return a.hooks&&(l=a.hooks.postprocess(l)),l}catch(o){return s(o)}}}onError(e,r){return n=>{if(n.message+=` -Please report this to https://github.com/markedjs/marked.`,e){let i="

An error occurred:

"+r0(n.message+"",!0)+"
";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},DS=new Jtn;function Ji(t,e){return DS.parse(t,e)}Ji.options=Ji.setOptions=function(t){return DS.setOptions(t),Ji.defaults=DS.defaults,c1t(Ji.defaults),Ji},Ji.getDefaults=nbe,Ji.defaults=RS,Ji.use=function(...t){return DS.use(...t),Ji.defaults=DS.defaults,c1t(Ji.defaults),Ji},Ji.walkTokens=function(t,e){return DS.walkTokens(t,e)},Ji.parseInline=DS.parseInline,Ji.Parser=cg,Ji.parser=cg.parse,Ji.Renderer=Uj,Ji.TextRenderer=dbe,Ji.Lexer=lg,Ji.lexer=lg.lex,Ji.Tokenizer=zj,Ji.Hooks=y7,Ji.parse=Ji,Ji.options,Ji.setOptions,Ji.use,Ji.walkTokens,Ji.parseInline,cg.parse,lg.lex;function O1t(t){for(var e=[],r=1;r${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${r0(e,!0)}`}br(e){return"
"}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:r,tokens:n}){let i=this.parser.parseInline(n),a=S1t(e);if(a===null)return i;e=a;let s='
",s}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=S1t(e);if(a===null)return r0(n);e=a;let s=`${n}{let u=o[l].flat(1/0);n=n.concat(this.walkTokens(u,r))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,r)))}}return n}use(...e){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let s=r.renderers[a.name];s?r.renderers[a.name]=function(...o){let l=a.renderer.apply(this,o);return l===!1&&(l=s.apply(this,o)),l}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=r[a.level];s?s.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),i.extensions=r),n.renderer){let a=this.defaults.renderer||new Uj(this.defaults);for(let s in n.renderer){if(!(s in a))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,l=n.renderer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new zj(this.defaults);for(let s in n.tokenizer){if(!(s in a))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,l=n.tokenizer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new y7;for(let s in n.hooks){if(!(s in a))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,l=n.hooks[o],u=a[o];y7.passThroughHooks.has(s)?a[o]=h=>{if(this.defaults.async&&y7.passThroughHooksRespectAsync.has(s))return(async()=>{let f=await l.call(a,h);return u.call(a,f)})();let d=l.call(a,h);return u.call(a,d)}:a[o]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(a,h);return f===!1&&(f=await u.apply(a,h)),f})();let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(s.call(this,o)),a&&(l=l.concat(a.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return lg.lex(e,r??this.defaults)}parser(e,r){return cg.parse(e,r??this.defaults)}parseMarkdown(e){return(r,n)=>{let i={...n},a={...this.defaults,...i},s=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=e),a.async)return(async()=>{let o=a.hooks?await a.hooks.preprocess(r):r,l=await(a.hooks?await a.hooks.provideLexer():e?lg.lex:lg.lexInline)(o,a),u=a.hooks?await a.hooks.processAllTokens(l):l;a.walkTokens&&await Promise.all(this.walkTokens(u,a.walkTokens));let h=await(a.hooks?await a.hooks.provideParser():e?cg.parse:cg.parseInline)(u,a);return a.hooks?await a.hooks.postprocess(h):h})().catch(s);try{a.hooks&&(r=a.hooks.preprocess(r));let o=(a.hooks?a.hooks.provideLexer():e?lg.lex:lg.lexInline)(r,a);a.hooks&&(o=a.hooks.processAllTokens(o)),a.walkTokens&&this.walkTokens(o,a.walkTokens);let l=(a.hooks?a.hooks.provideParser():e?cg.parse:cg.parseInline)(o,a);return a.hooks&&(l=a.hooks.postprocess(l)),l}catch(o){return s(o)}}}onError(e,r){return n=>{if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,e){let i="

An error occurred:

"+r0(n.message+"",!0)+"
";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},DT=new Jtn;function Ji(t,e){return DT.parse(t,e)}Ji.options=Ji.setOptions=function(t){return DT.setOptions(t),Ji.defaults=DT.defaults,c1t(Ji.defaults),Ji},Ji.getDefaults=nbe,Ji.defaults=RT,Ji.use=function(...t){return DT.use(...t),Ji.defaults=DT.defaults,c1t(Ji.defaults),Ji},Ji.walkTokens=function(t,e){return DT.walkTokens(t,e)},Ji.parseInline=DT.parseInline,Ji.Parser=cg,Ji.parser=cg.parse,Ji.Renderer=Uj,Ji.TextRenderer=dbe,Ji.Lexer=lg,Ji.lexer=lg.lex,Ji.Tokenizer=zj,Ji.Hooks=y7,Ji.parse=Ji,Ji.options,Ji.setOptions,Ji.use,Ji.walkTokens,Ji.parseInline,cg.parse,lg.lex;function O1t(t){for(var e=[],r=1;r/gi).map(e=>{var r;return((r=e.trim().match(/<[^>]+>|[^\s<>]+/g))==null?void 0:r.map(n=>({content:n,type:"normal"})))??[]})}C(E1t,"nonMarkdownToLines");function _1t(t,e={}){const r=k1t(t,e),n=Ji.lexer(r),i=[[]];let a=0;function s(o,l="normal"){o.type==="text"?o.text.split(` `).forEach((h,d)=>{d!==0&&(a++,i.push([])),h.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&i[a].push({content:f,type:l})})}):o.type==="strong"||o.type==="em"?o.tokens.forEach(u=>{s(u,o.type)}):o.type==="html"&&i[a].push({content:o.text,type:"normal"})}return C(s,"processNode"),n.forEach(o=>{var l;o.type==="paragraph"?(l=o.tokens)==null||l.forEach(u=>{s(u)}):o.type==="html"?i[a].push({content:o.text,type:"normal"}):i[a].push({content:o.raw,type:"normal"})}),i}C(_1t,"markdownToLines");function R1t(t){return t?`

${t.replace(/\\n|\n/g,"
")}

`:""}C(R1t,"nonMarkdownToHTML");function D1t(t,{markdownAutoWrap:e}={}){const r=Ji.lexer(t);function n(i){var a,s,o;return i.type==="text"?e===!1?i.text.replace(/\n */g,"
").replace(/ /g," "):i.text.replace(/\n */g,"
"):i.type==="strong"?`${(a=i.tokens)==null?void 0:a.map(n).join("")}`:i.type==="em"?`${(s=i.tokens)==null?void 0:s.map(n).join("")}`:i.type==="paragraph"?`

${(o=i.tokens)==null?void 0:o.map(n).join("")}

`:i.type==="space"?"":i.type==="html"?`${i.text}`:i.type==="escape"?i.text:(me.warn(`Unsupported markdown: ${i.type}`),i.raw)}return C(n,"output"),r.map(n).join("")}C(D1t,"markdownToHTML");function L1t(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}C(L1t,"splitTextToChars");function M1t(t,e){const r=L1t(e.content);return fbe(t,[],r,e.type)}C(M1t,"splitWordToFitWidth");function fbe(t,e,r,n){if(r.length===0)return[{content:e.join(""),type:n},{content:"",type:n}];const[i,...a]=r,s=[...e,i];return t([{content:s.join(""),type:n}])?fbe(t,s,a,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}C(fbe,"splitWordToFitWidthRecursion");function I1t(t,e){if(t.some(({content:r})=>r.includes(` `)))throw new Error("splitLineToFitWidth does not support newlines in the line");return Vj(t,e)}C(I1t,"splitLineToFitWidth");function Vj(t,e,r=[],n=[]){if(t.length===0)return n.length>0&&r.push(n),r.length>0?r:[];let i="";t[0].content===" "&&(i=" ",t.shift());const a=t.shift()??{content:" ",type:"normal"},s=[...n];if(i!==""&&s.push({content:i,type:"normal"}),s.push(a),e(s))return Vj(t,e,r,s);if(n.length>0)r.push(n),t.unshift(a);else if(a.content){const[o,l]=M1t(e,a);r.push([o]),l.content&&t.unshift(l)}return Vj(t,e,r)}C(Vj,"splitLineToFitWidthRecursion");function pbe(t,e){e&&t.attr("style",e)}C(pbe,"applyStyle");var P1t=16384;async function N1t(t,e,r,n,i=!1,a=Dr()){const s=t.append("foreignObject");s.attr("width",`${Math.min(10*r,P1t)}px`),s.attr("height",`${Math.min(10*r,P1t)}px`);const o=s.append("xhtml:div"),l=io(e.label)?await _q(e.label.replace(jt.lineBreakRegex,` -`),a):ai(e.label,a),u=e.isNode?"nodeLabel":"edgeLabel",h=o.append("span");h.html(l),pbe(h,e.labelStyle),h.attr("class",`${u} ${n}`),pbe(o,e.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(o.style("max-width",r+"px"),o.style("text-align","center")),o.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&o.attr("class","labelBkg");let d=o.node().getBoundingClientRect();return d.width===r&&(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",r+"px"),d=o.node().getBoundingClientRect()),s.node()}C(N1t,"addHtmlSpan");function Qj(t,e,r,n=!1){const i=t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em");return n&&i.attr("text-anchor","middle"),i}C(Qj,"createTspan");function B1t(t,e,r){const n=t.append("text"),i=Qj(n,1,e);Gj(i,r);const a=i.node().getComputedTextLength();return n.remove(),a}C(B1t,"computeWidthOfText");function $1t(t,e,r){var s;const n=t.append("text"),i=Qj(n,1,e);Gj(i,[{content:r,type:"normal"}]);const a=(s=i.node())==null?void 0:s.getBoundingClientRect();return a&&n.remove(),a}C($1t,"computeDimensionOfText");function F1t(t,e,r,n=!1,i=!1){const s=e.append("g"),o=s.insert("rect").attr("class","background").attr("style","stroke: none"),l=s.append("text").attr("y","-10.1");i&&l.attr("text-anchor","middle");let u=0;for(const h of r){const d=C(p=>B1t(s,1.1,p)<=t,"checkWidth"),f=d(h)?[h]:I1t(h,d);for(const p of f){const g=Qj(l,u,1.1,i);Gj(g,p),u++}}if(n){const h=l.node().getBBox(),d=2;return o.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),s.node()}else return l.node()}C(F1t,"createFormattedText");function gbe(t){const e=/&(amp|lt|gt);/g;return t.replace(e,(r,n)=>{switch(n){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}C(gbe,"decodeHTMLEntities");function Gj(t,e){t.text(""),e.forEach((r,n)=>{const i=t.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");n===0?i.text(gbe(r.content)):i.text(" "+gbe(r.content))})}C(Gj,"updateTextContentAndStyles");async function z1t(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,s)=>(r.push((async()=>{const o=`${a}:${s}`;return await mtn(o)?await Fy(o,void 0,{class:"label-icon"}):``})()),i));const n=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}C(z1t,"replaceIconSubstring");var Zc=C(async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,markdown:s=!0,isNode:o=!0,width:l=200,addSvgBackground:u=!1}={},h)=>{if(me.debug("XYZ createText",e,r,n,i,a,o,"addSvgBackground: ",u),a){const d=s?D1t(e,h):R1t(e),f=await z1t($y(d),h),p=e.replace(/\\\\/g,"\\"),g={isNode:o,label:io(e)?p:f,labelStyle:r.replace("fill:","color:")};return await N1t(t,g,l,i,u,h)}else{const d=$y(e.replace(//g,"
")),f=s?_1t(d.replace("
","
"),h):E1t(d),p=F1t(l,t,f,e?u:!1,!o);if(o){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Ot(p).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");Ot(p).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Ot(p).select("text").attr("style",m)}return n?Ot(p).selectAll("tspan.text-outer-tspan").classed("title-row",!0):Ot(p).selectAll("tspan.text-outer-tspan").classed("row",!0),p}},"createText");function mbe(t,e,r){if(t&&t.length){const[n,i]=e,a=Math.PI/180*r,s=Math.cos(a),o=Math.sin(a);for(const l of t){const[u,h]=l;l[0]=(u-n)*s-(h-i)*o+n,l[1]=(u-n)*o+(h-i)*s+i}}}function ern(t,e){return t[0]===e[0]&&t[1]===e[1]}function trn(t,e,r,n=1){const i=r,a=Math.max(e,.1),s=t[0]&&t[0][0]&&typeof t[0][0]=="number"?[t]:t,o=[0,0];if(i)for(const u of s)mbe(u,o,i);const l=function(u,h,d){const f=[];for(const b of u){const x=[...b];ern(x[0],x[x.length-1])||x.push([x[0][0],x[0][1]]),x.length>2&&f.push(x)}const p=[];h=Math.max(h,.1);const g=[];for(const b of f)for(let x=0;xb.yminx.ymin?1:b.xx.x?1:b.ymax===x.ymax?0:(b.ymax-x.ymax)/Math.abs(b.ymax-x.ymax)),!g.length)return p;let m=[],v=g[0].ymin,y=0;for(;m.length||g.length;){if(g.length){let b=-1;for(let x=0;xv);x++)b=x;g.splice(0,b+1).forEach(x=>{m.push({s:v,edge:x})})}if(m=m.filter(b=>!(b.edge.ymax<=v)),m.sort((b,x)=>b.edge.x===x.edge.x?0:(b.edge.x-x.edge.x)/Math.abs(b.edge.x-x.edge.x)),(d!==1||y%h==0)&&m.length>1)for(let b=0;b=m.length)break;const w=m[b].edge,A=m[x].edge;p.push([[Math.round(w.x),v],[Math.round(A.x),v]])}v+=d,m.forEach(b=>{b.edge.x=b.edge.x+d*b.edge.islope}),y++}return p}(s,a,n);if(i){for(const u of s)mbe(u,o,-i);(function(u,h,d){const f=[];u.forEach(p=>f.push(...p)),mbe(f,h,d)})(l,o,-i)}return l}function b7(t,e){var r;const n=e.hachureAngle+90;let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.round(Math.max(i,.1));let a=1;return e.roughness>=1&&(((r=e.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=i),trn(t,i,n,a||1)}class vbe{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=b7(e,r);return{type:"fillSketch",ops:this.renderLines(n,r)}}renderLines(e,r){const n=[];for(const i of e)n.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],r));return n}}function Hj(t){const e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}class rrn extends vbe{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=b7(e,Object.assign({},r,{hachureGap:n})),a=Math.PI/180*r.hachureAngle,s=[],o=.5*n*Math.cos(a),l=.5*n*Math.sin(a);for(const[u,h]of i)Hj([u,h])&&s.push([[u[0]-o,u[1]+l],[...h]],[[u[0]+o,u[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(s,r)}}}class nrn extends vbe{fillPolygons(e,r){const n=this._fillPolygons(e,r),i=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(e,i);return n.ops=n.ops.concat(a.ops),n}}let irn=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=b7(e,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(n,r)}dotsOnLines(e,r){const n=[];let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);const s=i/4;for(const o of e){const l=Hj(o),u=l/i,h=Math.ceil(u)-1,d=l-h*i,f=(o[0][0]+o[1][0])/2-i/4,p=Math.min(o[0][1],o[1][1]);for(let g=0;g{const o=Hj(s),l=Math.floor(o/(n+i)),u=(o+i-l*(n+i))/2;let h=s[0],d=s[1];h[0]>d[0]&&(h=s[1],d=s[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let p=0;p{const s=Hj(a),o=Math.round(s/(2*r));let l=a[0],u=a[1];l[0]>u[0]&&(l=a[1],u=a[0]);const h=Math.atan((u[1]-l[1])/(u[0]-l[0]));for(let d=0;dh%2?u+r:u+e);a.push({key:"C",data:l}),e=l[4],r=l[5];break}case"Q":a.push({key:"Q",data:[...o]}),e=o[2],r=o[3];break;case"q":{const l=o.map((u,h)=>h%2?u+r:u+e);a.push({key:"Q",data:l}),e=l[2],r=l[3];break}case"A":a.push({key:"A",data:[...o]}),e=o[5],r=o[6];break;case"a":e+=o[5],r+=o[6],a.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],e,r]});break;case"H":a.push({key:"H",data:[...o]}),e=o[0];break;case"h":e+=o[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...o]}),r=o[0];break;case"v":r+=o[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...o]}),e=o[2],r=o[3];break;case"s":{const l=o.map((u,h)=>h%2?u+r:u+e);a.push({key:"S",data:l}),e=l[2],r=l[3];break}case"T":a.push({key:"T",data:[...o]}),e=o[0],r=o[1];break;case"t":e+=o[0],r+=o[1],a.push({key:"T",data:[e,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=n,r=i}return a}function Q1t(t){const e=[];let r="",n=0,i=0,a=0,s=0,o=0,l=0;for(const{key:u,data:h}of t){switch(u){case"M":e.push({key:"M",data:[...h]}),[n,i]=h,[a,s]=h;break;case"C":e.push({key:"C",data:[...h]}),n=h[4],i=h[5],o=h[2],l=h[3];break;case"L":e.push({key:"L",data:[...h]}),[n,i]=h;break;case"H":n=h[0],e.push({key:"L",data:[n,i]});break;case"V":i=h[0],e.push({key:"L",data:[n,i]});break;case"S":{let d=0,f=0;r==="C"||r==="S"?(d=n+(n-o),f=i+(i-l)):(d=n,f=i),e.push({key:"C",data:[d,f,...h]}),o=h[0],l=h[1],n=h[2],i=h[3];break}case"T":{const[d,f]=h;let p=0,g=0;r==="Q"||r==="T"?(p=n+(n-o),g=i+(i-l)):(p=n,g=i);const m=n+2*(p-n)/3,v=i+2*(g-i)/3,y=d+2*(p-d)/3,b=f+2*(g-f)/3;e.push({key:"C",data:[m,v,y,b,d,f]}),o=p,l=g,n=d,i=f;break}case"Q":{const[d,f,p,g]=h,m=n+2*(d-n)/3,v=i+2*(f-i)/3,y=p+2*(d-p)/3,b=g+2*(f-g)/3;e.push({key:"C",data:[m,v,y,b,p,g]}),o=d,l=f,n=p,i=g;break}case"A":{const d=Math.abs(h[0]),f=Math.abs(h[1]),p=h[2],g=h[3],m=h[4],v=h[5],y=h[6];d===0||f===0?(e.push({key:"C",data:[n,i,v,y,v,y]}),n=v,i=y):(n!==v||i!==y)&&(G1t(n,i,v,y,d,f,p,g,m).forEach(function(b){e.push({key:"C",data:b})}),n=v,i=y);break}case"Z":e.push({key:"Z",data:[]}),n=a,i=s}r=u}return e}function x7(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function G1t(t,e,r,n,i,a,s,o,l,u){const h=(d=s,Math.PI*d/180);var d;let f=[],p=0,g=0,m=0,v=0;if(u)[p,g,m,v]=u;else{[t,e]=x7(t,e,-h),[r,n]=x7(r,n,-h);const L=(t-r)/2,R=(e-n)/2;let D=L*L/(i*i)+R*R/(a*a);D>1&&(D=Math.sqrt(D),i*=D,a*=D);const M=i*i,P=a*a,N=M*P-M*R*R-P*L*L,F=M*R*R+P*L*L,B=(o===l?-1:1)*Math.sqrt(Math.abs(N/F));m=B*i*R/a+(t+r)/2,v=B*-a*L/i+(e+n)/2,p=Math.asin(parseFloat(((e-v)/a).toFixed(9))),g=Math.asin(parseFloat(((n-v)/a).toFixed(9))),tg&&(p-=2*Math.PI),!l&&g>p&&(g-=2*Math.PI)}let y=g-p;if(Math.abs(y)>120*Math.PI/180){const L=g,R=r,D=n;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=G1t(r=m+i*Math.cos(g),n=v+a*Math.sin(g),R,D,i,a,s,0,l,[g,L,m,v])}y=g-p;const b=Math.cos(p),x=Math.sin(p),w=Math.cos(g),A=Math.sin(g),T=Math.tan(y/4),S=4/3*i*T,O=4/3*a*T,k=[t,e],E=[t+S*x,e-O*b],_=[r+S*A,n-O*w],I=[r,n];if(E[0]=2*k[0]-E[0],E[1]=2*k[1]-E[1],u)return[E,_,I].concat(f);{f=[E,_,I].concat(f);const L=[];for(let R=0;R2){const i=[];for(let a=0;a2*Math.PI&&(p=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,v=Math.min(m/2,(g-p)/2),y=J1t(v,u,h,d,f,p,g,1,l);if(!l.disableMultiStroke){const b=J1t(v,u,h,d,f,p,g,1.5,l);y.push(...b)}return s&&(o?y.push(...Xx(u,h,u+d*Math.cos(p),h+f*Math.sin(p),l),...Xx(u,h,u+d*Math.cos(g),h+f*Math.sin(g),l)):y.push({op:"lineTo",data:[u,h]},{op:"lineTo",data:[u+d*Math.cos(p),h+f*Math.sin(p)]})),{type:"path",ops:y}}function j1t(t,e){const r=Q1t(V1t(xbe(t))),n=[];let i=[0,0],a=[0,0];for(const{key:s,data:o}of r)switch(s){case"M":a=[o[0],o[1]],i=[o[0],o[1]];break;case"L":n.push(...Xx(a[0],a[1],o[0],o[1],e)),a=[o[0],o[1]];break;case"C":{const[l,u,h,d,f,p]=o;n.push(...hrn(l,u,h,d,f,p,a,e)),a=[f,p];break}case"Z":n.push(...Xx(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function Abe(t,e){const r=[];for(const n of t)if(n.length){const i=e.maxRandomnessOffset||0,a=n.length;if(a>2){r.push({op:"move",data:[n[0][0]+xn(i,e),n[0][1]+xn(i,e)]});for(let s=1;s500?.4:-.0016668*l+1.233334;let h=i.maxRandomnessOffset||0;h*h*100>o&&(h=l/10);const d=h/2,f=.2+.2*K1t(i);let p=i.bowing*i.maxRandomnessOffset*(n-e)/200,g=i.bowing*i.maxRandomnessOffset*(t-r)/200;p=xn(p,i,u),g=xn(g,i,u);const m=[],v=()=>xn(d,i,u),y=()=>xn(h,i,u),b=i.preserveVertices;return s?m.push({op:"move",data:[t+(b?0:v()),e+(b?0:v())]}):m.push({op:"move",data:[t+(b?0:xn(h,i,u)),e+(b?0:xn(h,i,u))]}),s?m.push({op:"bcurveTo",data:[p+t+(r-t)*f+v(),g+e+(n-e)*f+v(),p+t+2*(r-t)*f+v(),g+e+2*(n-e)*f+v(),r+(b?0:v()),n+(b?0:v())]}):m.push({op:"bcurveTo",data:[p+t+(r-t)*f+y(),g+e+(n-e)*f+y(),p+t+2*(r-t)*f+y(),g+e+2*(n-e)*f+y(),r+(b?0:y()),n+(b?0:y())]}),m}function jj(t,e,r){if(!t.length)return[];const n=[];n.push([t[0][0]+xn(e,r),t[0][1]+xn(e,r)]),n.push([t[0][0]+xn(e,r),t[0][1]+xn(e,r)]);for(let i=1;i3){const a=[],s=1-r.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let o=1;o+21&&i.push(o)):i.push(o),i.push(t[e+3])}else{const l=t[e+0],u=t[e+1],h=t[e+2],d=t[e+3],f=LS(l,u,.5),p=LS(u,h,.5),g=LS(h,d,.5),m=LS(f,p,.5),v=LS(p,g,.5),y=LS(m,v,.5);Sbe([l,f,m,y],0,r,i),Sbe([y,v,g,d],0,r,i)}var a,s;return i}function frn(t,e){return Zj(t,0,t.length,e)}function Zj(t,e,r,n,i){const a=i||[],s=t[e],o=t[r-1];let l=0,u=1;for(let h=e+1;hl&&(l=d,u=h)}return Math.sqrt(l)>n?(Zj(t,e,u+1,n,a),Zj(t,u,r,n,a)):(a.length||a.push(s),a.push(o)),a}function Cbe(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let a=0;a0?Zj(n,0,n.length,r):n}const Bd="none";class Jj{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,r,n){return{shape:e,sets:r||[],options:n||this.defaultOptions}}line(e,r,n,i,a){const s=this._o(a);return this._d("line",[H1t(e,r,n,i,s)],s)}rectangle(e,r,n,i,a){const s=this._o(a),o=[],l=urn(e,r,n,i,s);if(s.fill){const u=[[e,r],[e+n,r],[e+n,r+i],[e,r+i]];s.fillStyle==="solid"?o.push(Abe([u],s)):o.push(j5([u],s))}return s.stroke!==Bd&&o.push(l),this._d("rectangle",o,s)}ellipse(e,r,n,i,a){const s=this._o(a),o=[],l=Y1t(n,i,s),u=wbe(e,r,s,l);if(s.fill)if(s.fillStyle==="solid"){const h=wbe(e,r,s,l).opset;h.type="fillPath",o.push(h)}else o.push(j5([u.estimatedPoints],s));return s.stroke!==Bd&&o.push(u.opset),this._d("ellipse",o,s)}circle(e,r,n,i){const a=this.ellipse(e,r,n,n,i);return a.shape="circle",a}linearPath(e,r){const n=this._o(r);return this._d("linearPath",[Yj(e,!1,n)],n)}arc(e,r,n,i,a,s,o=!1,l){const u=this._o(l),h=[],d=q1t(e,r,n,i,a,s,o,!0,u);if(o&&u.fill)if(u.fillStyle==="solid"){const f=Object.assign({},u);f.disableMultiStroke=!0;const p=q1t(e,r,n,i,a,s,!0,!1,f);p.type="fillPath",h.push(p)}else h.push(function(f,p,g,m,v,y,b){const x=f,w=p;let A=Math.abs(g/2),T=Math.abs(m/2);A+=xn(.01*A,b),T+=xn(.01*T,b);let S=v,O=y;for(;S<0;)S+=2*Math.PI,O+=2*Math.PI;O-S>2*Math.PI&&(S=0,O=2*Math.PI);const k=(O-S)/b.curveStepCount,E=[];for(let _=S;_<=O;_+=k)E.push([x+A*Math.cos(_),w+T*Math.sin(_)]);return E.push([x+A*Math.cos(O),w+T*Math.sin(O)]),E.push([x,w]),j5([E],b)}(e,r,n,i,a,s,u));return u.stroke!==Bd&&h.push(d),this._d("arc",h,u)}curve(e,r){const n=this._o(r),i=[],a=W1t(e,n);if(n.fill&&n.fill!==Bd)if(n.fillStyle==="solid"){const s=W1t(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{const s=[],o=e;if(o.length){const l=typeof o[0][0]=="number"?[o]:o;for(const u of l)u.length<3?s.push(...u):u.length===3?s.push(...Cbe(ebt([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):s.push(...Cbe(ebt(u),10,(1+n.roughness)/2))}s.length&&i.push(j5([s],n))}return n.stroke!==Bd&&i.push(a),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],a=Yj(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(Abe([e],n)):i.push(j5([e],n))),n.stroke!==Bd&&i.push(a),this._d("polygon",i,n)}path(e,r){const n=this._o(r),i=[];if(!e)return this._d("path",i,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const a=n.fill&&n.fill!=="transparent"&&n.fill!==Bd,s=n.stroke!==Bd,o=!!(n.simplification&&n.simplification<1),l=function(h,d,f){const p=Q1t(V1t(xbe(h))),g=[];let m=[],v=[0,0],y=[];const b=()=>{y.length>=4&&m.push(...Cbe(y,d)),y=[]},x=()=>{b(),m.length&&(g.push(m),m=[])};for(const{key:A,data:T}of p)switch(A){case"M":x(),v=[T[0],T[1]],m.push(v);break;case"L":b(),m.push([T[0],T[1]]);break;case"C":if(!y.length){const S=m.length?m[m.length-1]:v;y.push([S[0],S[1]])}y.push([T[0],T[1]]),y.push([T[2],T[3]]),y.push([T[4],T[5]]);break;case"Z":b(),m.push([v[0],v[1]])}if(x(),!f)return g;const w=[];for(const A of g){const T=frn(A,f);T.length&&w.push(T)}return w}(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),u=j1t(e,n);if(a)if(n.fillStyle==="solid")if(l.length===1){const h=j1t(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else i.push(Abe(l,n));else i.push(j5(l,n));return s&&(o?l.forEach(h=>{i.push(Yj(h,!1,n))}):i.push(u)),this._d("path",i,n)}opsToPath(e,r){let n="";for(const i of e.ops){const a=typeof r=="number"&&r>=0?i.data.map(s=>+s.toFixed(r)):i.data;switch(i.op){case"move":n+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":n+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":n+=`L${a[0]} ${a[1]} `}}return n.trim()}toPaths(e){const r=e.sets||[],n=e.options||this.defaultOptions,i=[];for(const a of r){let s=null;switch(a.type){case"path":s={d:this.opsToPath(a),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Bd};break;case"fillPath":s={d:this.opsToPath(a),stroke:Bd,strokeWidth:0,fill:n.fill||Bd};break;case"fillSketch":s=this.fillSketch(a,n)}s&&i.push(s)}return i}fillSketch(e,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(e),stroke:r.fill||Bd,strokeWidth:n,fill:Bd}}_mergedShape(e){return e.filter((r,n)=>n===0||r.op!=="move")}}class prn{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new Jj(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.ctx,a=e.options.fixedDecimalPlaceDigits;for(const s of r)switch(s.type){case"path":i.save(),i.strokeStyle=n.stroke==="none"?"transparent":n.stroke,i.lineWidth=n.strokeWidth,n.strokeLineDash&&i.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(i.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(i,s,a),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";const o=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,s,a,o),i.restore();break}case"fillSketch":this.fillSketch(i,s,n)}}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=i,this._drawToContext(e,r,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,r,n,i="nonzero"){e.beginPath();for(const a of r.ops){const s=typeof n=="number"&&n>=0?a.data.map(o=>+o.toFixed(n)):a.data;switch(a.op){case"move":e.moveTo(s[0],s[1]);break;case"bcurveTo":e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":e.lineTo(s[0],s[1])}}r.type==="fillPath"?e.fill(i):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,r,n,i,a){const s=this.gen.line(e,r,n,i,a);return this.draw(s),s}rectangle(e,r,n,i,a){const s=this.gen.rectangle(e,r,n,i,a);return this.draw(s),s}ellipse(e,r,n,i,a){const s=this.gen.ellipse(e,r,n,i,a);return this.draw(s),s}circle(e,r,n,i){const a=this.gen.circle(e,r,n,i);return this.draw(a),a}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n),n}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n),n}arc(e,r,n,i,a,s,o=!1,l){const u=this.gen.arc(e,r,n,i,a,s,o,l);return this.draw(u),u}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n),n}path(e,r){const n=this.gen.path(e,r);return this.draw(n),n}}const eX="http://www.w3.org/2000/svg";class grn{constructor(e,r){this.svg=e,this.gen=new Jj(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(eX,"g"),s=e.options.fixedDecimalPlaceDigits;for(const o of r){let l=null;switch(o.type){case"path":l=i.createElementNS(eX,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke",n.stroke),l.setAttribute("stroke-width",n.strokeWidth+""),l.setAttribute("fill","none"),n.strokeLineDash&&l.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":l=i.createElementNS(eX,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",n.fill||""),e.shape!=="curve"&&e.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(i,o,n)}l&&a.appendChild(l)}return a}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);const a=e.createElementNS(eX,"path");return a.setAttribute("d",this.opsToPath(r,n.fixedDecimalPlaceDigits)),a.setAttribute("stroke",n.fill||""),a.setAttribute("stroke-width",i+""),a.setAttribute("fill","none"),n.fillLineDash&&a.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,r){return this.gen.opsToPath(e,r)}line(e,r,n,i,a){const s=this.gen.line(e,r,n,i,a);return this.draw(s)}rectangle(e,r,n,i,a){const s=this.gen.rectangle(e,r,n,i,a);return this.draw(s)}ellipse(e,r,n,i,a){const s=this.gen.ellipse(e,r,n,i,a);return this.draw(s)}circle(e,r,n,i){const a=this.gen.circle(e,r,n,i);return this.draw(a)}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n)}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n)}arc(e,r,n,i,a,s,o=!1,l){const u=this.gen.arc(e,r,n,i,a,s,o,l);return this.draw(u)}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n)}path(e,r){const n=this.gen.path(e,r);return this.draw(n)}}var Er={canvas:(t,e)=>new prn(t,e),svg:(t,e)=>new grn(t,e),generator:t=>new Jj(t),newSeed:()=>Jj.newSeed()},pn=C(async(t,e,r)=>{var p,g;let n;const i=e.useHtmlLabels||Xm((p=He())==null?void 0:p.htmlLabels);r?n=r:n="node default";const a=t.insert("g").attr("class",n).attr("id",e.domId||e.id),s=a.insert("g").attr("class","label").attr("style",_l(e.labelStyle));let o;e.label===void 0?o="":o=typeof e.label=="string"?e.label:e.label[0];const l=!!e.icon||!!e.img,u=e.labelType==="markdown",h=await Zc(s,ai($y(o),He()),{useHtmlLabels:i,width:e.width||((g=He().flowchart)==null?void 0:g.wrappingWidth),classes:u?"markdown-node-label":"",style:e.labelStyle,addSvgBackground:l,markdown:u},He());let d=h.getBBox();const f=((e==null?void 0:e.padding)??0)/2;if(i){const m=h.children[0],v=Ot(h);await J1e(m,o),d=m.getBoundingClientRect(),v.attr("width",d.width),v.attr("height",d.height)}return i?s.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):s.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&s.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:a,bbox:d,halfPadding:f,label:s}},"labelHelper"),Obe=C(async(t,e,r)=>{var l,u;const n=r.useHtmlLabels??Zi(He()),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await Zc(i,ai($y(e),He()),{useHtmlLabels:n,width:r.width||((u=(l=He())==null?void 0:l.flowchart)==null?void 0:u.wrappingWidth),style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let s=a.getBBox();const o=r.padding/2;if(Zi(He())){const h=a.children[0],d=Ot(a);s=h.getBoundingClientRect(),d.attr("width",s.width),d.attr("height",s.height)}return n?i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):i.attr("transform","translate(0, "+-s.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:t,bbox:s,halfPadding:o,label:i}},"insertLabel"),Pr=C((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),rn=C((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function Si(t){const e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}C(Si,"createPathFromPoints");function Kx(t,e,r,n,i,a){const s=[],l=r-t,u=n-e,h=l/a,d=2*Math.PI/h,f=e+u/2;for(let p=0;p<=50;p++){const g=p/50,m=t+g*l,v=f+i*Math.sin(d*(m-t));s.push({x:m,y:v})}return s}C(Kx,"generateFullSineWavePoints");function A7(t,e,r,n,i,a){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dl.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),n=e.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",n);const i=e.find(l=>l.getAttribute("fill")!=="none"),a=e.find(l=>l.getAttribute("stroke")!=="none"),s=C((l,u)=>(l==null?void 0:l.getAttribute(u))??void 0,"getAttr");if(i){const l={fill:s(i,"fill"),"fill-opacity":s(i,"fill-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}if(a){const l={stroke:s(a,"stroke"),"stroke-width":s(a,"stroke-width")??"1","stroke-opacity":s(a,"stroke-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}const o=document.createElementNS("http://www.w3.org/2000/svg","g");return o.appendChild(r),o}C(kbe,"mergePaths");var mrn=C((t,e)=>{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),MS=mrn,vrn=C(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=He(),o=Zi(s);return await Zc(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),Zx=vrn,Jx=C((t,e,r,n,i)=>["M",t+i,e,"H",t+r-i,"A",i,i,0,0,1,t+r,e+i,"V",e+n-i,"A",i,i,0,0,1,t+r-i,e+n,"H",t+i,"A",i,i,0,0,1,t,e+n-i,"V",e+i,"A",i,i,0,0,1,t+i,e,"Z"].join(" "),"createRoundedRectPathD"),yrn=C(async(t,e)=>{const r=He(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,o=s,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:d}=Or(e),f=t.insert("g").attr("class","cluster swimlane "+(e.cssClasses||"")).attr("id",e.id).attr("data-id",e.id).attr("data-et","cluster").attr("data-look",e.look),p=Xm(r.flowchart.htmlLabels),g=e.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),v=await Zc(m,e.label,{style:e.labelStyle,useHtmlLabels:p,isNode:!0,width:e.width});let y=v.getBBox();if(p){const L=v.children[0],R=Ot(v);y=L.getBoundingClientRect(),R.attr("width",y.width),R.attr("height",y.height)}const b=e.padding??0,x=e.width<=y.width+b?y.width+b:e.width;e.width<=y.width+b?e.diff=(x-e.width)/2-b:e.diff=-b;const w=e.height,A=e.y-w/2,T=e.y+w/2,S=e.x-x/2,O=e.swimlaneContentTop!==void 0?e.swimlaneContentTop:A+w/3,k=g?4:0,E=y.height+2*k;let _,I;if(g){const L=Math.max(E,y.height+2*k),R=S+L,D=Math.max(0,x-L);if(e.look==="handDrawn"){const N=Er.svg(f),F=_r(e,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),B=_r(e,{roughness:.7,fill:"none",stroke:o,seed:i}),V=N.rectangle(S,A,L,w,F);_=f.insert(()=>V,":first-child");const z=N.rectangle(R,A,D,w,B);I=f.insert(()=>z,":first-child"),_.select("path:nth-child(2)").attr("style",h.join(";")),_.select("path").attr("style",d.join(";").replace("fill","stroke"))}else _=f.insert("rect",":first-child"),I=f.insert("rect",":first-child"),_.attr("class","swimlane-title").attr("style",u).attr("x",S).attr("y",A).attr("width",L).attr("height",w).attr("fill",a).attr("stroke",o),I.attr("class","swimlane-body").attr("style",u).attr("x",R).attr("y",A).attr("width",D).attr("height",w).attr("fill","none").attr("stroke",o);const M=S+L/2,P=e.y;m.attr("transform",`translate(${M}, ${P}) rotate(-90) translate(${-y.width/2}, ${-y.height/2})`)}else{const L=Math.max(0,O-A),R=Math.min(E,L),D=A+R,M=Math.max(0,T-D),P=e.x-x/2;if(e.look==="handDrawn"){const B=Er.svg(f),V=_r(e,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),z=_r(e,{roughness:.7,fill:"none",stroke:o,seed:i}),U=B.rectangle(P,A,x,R,V);_=f.insert(()=>U,":first-child");const Q=B.rectangle(P,D,x,M,z);I=f.insert(()=>Q,":first-child"),_.select("path:nth-child(2)").attr("style",h.join(";")),_.select("path").attr("style",d.join(";").replace("fill","stroke"))}else _=f.insert("rect",":first-child"),I=f.insert("rect",":first-child"),_.attr("class","swimlane-title").attr("style",u).attr("x",P).attr("y",A).attr("width",x).attr("height",R).attr("fill",a).attr("stroke",o),I.attr("class","swimlane-body").attr("style",u).attr("x",P).attr("y",D).attr("width",x).attr("height",M).attr("fill","none").attr("stroke",o);const N=e.x-y.width/2,F=A+(R-y.height)/2;m.attr("transform",`translate(${N}, ${F})`)}if(me.trace("Swimlane data ",e,JSON.stringify(e)),l){const L=m.select("span");L&&L.attr("style",l)}return e.offsetX=0,e.width=x,e.height=w,e.offsetY=y.height-b/2,e.intersect=function(L){return MS(e,L)},{cluster:f,labelBBox:y}},"swimlane"),tbt=C(async(t,e)=>{me.info("Creating subgraph rect for ",e.id,e);const r=He(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=Or(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=Zi(r),p=d.insert("g").attr("class","cluster-label ");let g;e.labelType==="markdown"?g=await Zc(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width}):g=await Zx(p,e.label,e.labelStyle||"",!1,!0);let m=g.getBBox();if(Zi(r)){const S=g.children[0],O=Ot(g);m=S.getBoundingClientRect(),O.attr("width",m.width),O.attr("height",m.height)}const v=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(v-e.width)/2-e.padding:e.diff=-e.padding;const y=e.height,b=e.x-v/2,x=e.y-y/2;me.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const S=Er.svg(d),O=_r(e,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),k=S.path(Jx(b,x,v,y,0),O);w=d.insert(()=>(me.debug("Rough node insert CXC",k),k),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",b).attr("y",x).attr("width",v).attr("height",y);const{subGraphTitleTopMargin:A}=q5(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+A})`),o){const S=p.select("span");S&&S.attr("style",o)}const T=w.node().getBBox();return e.offsetX=0,e.width=T.width,e.height=T.height,e.offsetY=m.height-e.padding/2,e.intersect=function(S){return MS(e,S)},{cluster:d,labelBBox:m}},"rect"),brn=C((t,e)=>{const r=t.insert("g").attr("class","note-cluster").attr("id",e.domId),n=r.insert("rect",":first-child"),i=0*e.padding,a=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2-a).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");const s=n.node().getBBox();return e.width=s.width,e.height=s.height,e.intersect=function(o){return MS(e,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),xrn=C(async(t,e)=>{const r=He(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:a,compositeBackground:s,compositeTitleBackground:o,nodeBorder:l}=n,u=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-id",e.id).attr("data-look",e.look),h=u.insert("g",":first-child"),d=u.insert("g").attr("class","cluster-label");let f=u.append("rect");const p=await Zx(d,e.label,e.labelStyle,void 0,!0);let g=p.getBBox();if(Zi(r)){const k=p.children[0],E=Ot(p);g=k.getBoundingClientRect(),E.attr("width",g.width),E.attr("height",g.height)}const m=0*e.padding,v=m/2,y=(e.width<=g.width+e.padding?g.width+e.padding:e.width)+m;e.width<=g.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const b=e.height+m,x=e.height+m-g.height-6,w=e.x-y/2,A=e.y-b/2;e.width=y;const T=e.y-e.height/2-v+g.height+2;let S;if(e.look==="handDrawn"){const k=e.cssClasses.includes("statediagram-cluster-alt"),E=Er.svg(u),_=e.rx||e.ry?E.path(Jx(w,A,y,b,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:i}):E.rectangle(w,A,y,b,{seed:i});S=u.insert(()=>_,":first-child");const I=E.rectangle(w,T,y,x,{fill:k?a:s,fillStyle:k?"hachure":"solid",stroke:l,seed:i});S=u.insert(()=>_,":first-child"),f=u.insert(()=>I)}else S=h.insert("rect",":first-child"),S.attr("class","outer").attr("x",w).attr("y",A).attr("width",y).attr("height",b).attr("data-look",e.look),f.attr("class","inner").attr("x",w).attr("y",T).attr("width",y).attr("height",x);d.attr("transform",`translate(${e.x-g.width/2}, ${A+1-(Zi(r)?0:3)})`);const O=S.node().getBBox();return e.height=O.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(k){return MS(e,k)},{cluster:u,labelBBox:g}},"roundedWithTitle"),wrn=C(async(t,e)=>{me.info("Creating subgraph rect for ",e.id,e);const r=He(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=Or(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=Zi(r),p=d.insert("g").attr("class","cluster-label "),g=await Zc(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width});let m=g.getBBox();if(Zi(r)){const S=g.children[0],O=Ot(g);m=S.getBoundingClientRect(),O.attr("width",m.width),O.attr("height",m.height)}const v=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(v-e.width)/2-e.padding:e.diff=-e.padding;const y=e.height,b=e.x-v/2,x=e.y-y/2;me.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const S=Er.svg(d),O=_r(e,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:i}),k=S.path(Jx(b,x,v,y,e.rx),O);w=d.insert(()=>(me.debug("Rough node insert CXC",k),k),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",b).attr("y",x).attr("width",v).attr("height",y);const{subGraphTitleTopMargin:A}=q5(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+A})`),o){const S=p.select("span");S&&S.attr("style",o)}const T=w.node().getBBox();return e.offsetX=0,e.width=T.width,e.height=T.height,e.offsetY=m.height-e.padding/2,e.intersect=function(S){return MS(e,S)},{cluster:d,labelBBox:m}},"kanbanSection"),Arn=C((t,e)=>{const r=He(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:a}=n,s=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-look",e.look),o=s.insert("g",":first-child"),l=0*e.padding,u=e.width+l;e.diff=-e.padding;const h=e.height+l,d=e.x-u/2,f=e.y-h/2;e.width=u;let p;if(e.look==="handDrawn"){const v=Er.svg(s).rectangle(d,f,u,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});p=s.insert(()=>v,":first-child")}else{p=o.insert("rect",":first-child");let m="outer";e.look,m="divider",p.attr("class",m).attr("x",d).attr("y",f).attr("width",u).attr("height",h).attr("data-look",e.look)}const g=p.node().getBBox();return e.height=g.height,e.offsetX=0,e.offsetY=0,e.intersect=function(m){return MS(e,m)},{cluster:s,labelBBox:{}}},"divider"),Trn=tbt,Srn={rect:tbt,squareRect:Trn,roundedWithTitle:xrn,noteGroup:brn,divider:Arn,kanbanSection:wrn,swimlane:yrn},rbt=new Map,tX=C(async(t,e)=>{const r=e.shape||"rect",n=await Srn[r](t,e);return rbt.set(e.id,n),n},"insertCluster"),nbt=C(()=>{rbt=new Map},"clear");function ibt(t,e){return t.intersect(e)}C(ibt,"intersectNode");var Crn=ibt;function abt(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x0}C(Ebe,"sameSign");var krn=lbt;function cbt(t,e,r){let n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(h){s=Math.min(s,h.x),o=Math.min(o,h.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));let l=n-t.width/2-s,u=i-t.height/2-o;for(let h=0;h1&&a.sort(function(h,d){let f=h.x-r.x,p=h.y-r.y,g=Math.sqrt(f*f+p*p),m=d.x-r.x,v=d.y-r.y,y=Math.sqrt(m*m+v*v);return gh,":first-child");return d.attr("class","anchor").attr("style",_l(o)),Pr(e,d),e.intersect=function(f){return me.info("Circle intersect",e,s,f),Tr.circle(e,s,f)},a}C(ubt,"anchor");function _be(t,e,r,n,i,a,s){const l=(t+r)/2,u=(e+n)/2,h=Math.atan2(n-e,r-t),d=(r-t)/2,f=(n-e)/2,p=d/i,g=f/a,m=Math.sqrt(p**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const v=Math.sqrt(1-m**2),y=l+v*a*Math.sin(h)*(s?-1:1),b=u-v*i*Math.cos(h)*(s?-1:1),x=Math.atan2((e-b)/a,(t-y)/i);let A=Math.atan2((n-b)/a,(r-y)/i)-x;s&&A<0&&(A+=2*Math.PI),!s&&A>0&&(A-=2*Math.PI);const T=[];for(let S=0;S<20;S++){const O=S/19,k=x+O*A,E=y+i*Math.cos(k),_=b+a*Math.sin(k);T.push({x:E,y:_})}return T}C(_be,"generateArcPoints");function hbt(t,e,r){const[n,i]=[e,r].sort((a,s)=>s-a);return i*(1-Math.sqrt(1-(t/n/2)**2))}C(hbt,"calculateArcSagitta");async function dbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=C(k=>k+s,"calcTotalHeight"),l=C(k=>{const E=k/2;return[E/(2.5+k/50),E]},"calcEllipseRadius"),{shapeSvg:u,bbox:h}=await pn(t,e,rn(e)),d=o(e!=null&&e.height?e==null?void 0:e.height:h.height),[f,p]=l(d),g=hbt(d,f,p),v=(e!=null&&e.width?e==null?void 0:e.width:h.width)+a*2+g-g,y=d,{cssStyles:b}=e,x=[{x:v/2,y:-y/2},{x:-v/2,y:-y/2},..._be(-v/2,-y/2,-v/2,y/2,f,p,!1),{x:v/2,y:y/2},..._be(v/2,y/2,v/2,-y/2,f,p,!0)],w=Er.svg(u),A=_r(e,{});e.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");const T=Si(x),S=w.path(T,A),O=u.insert(()=>S,":first-child");return O.attr("class","basic label-container outer-path"),b&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",b),n&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",n),O.attr("transform",`translate(${f/2}, 0)`),Pr(e,O),e.intersect=function(k){return Tr.polygon(e,x,k)},u}C(dbt,"bowTieRect");function zy(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}C(zy,"insertPolygonShape");var rX=12;async function fbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?28:i,s=e.look==="neo"?24:i,{shapeSvg:o,bbox:l}=await pn(t,e,rn(e)),u=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a+rX),h=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?s*2:s),d=0,f=u,p=-h,g=0,m=[{x:d+rX,y:p},{x:f,y:p},{x:f,y:g},{x:d,y:g},{x:d,y:p+rX},{x:d+rX,y:p}];let v;const{cssStyles:y}=e;if(e.look==="handDrawn"){const b=Er.svg(o),x=_r(e,{}),w=Si(m),A=b.path(w,x);v=o.insert(()=>A,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),y&&v.attr("style",y)}else v=zy(o,u,h,m);return n&&v.attr("style",n),Pr(e,v),e.intersect=function(b){return Tr.polygon(e,m,b)},o}C(fbt,"card");function pbt(t,e){const{nodeStyles:r}=Or(e);e.label="";const n=t.insert("g").attr("class",rn(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,a=Math.max(28,e.width??0),s=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],o=Er.svg(n),l=_r(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=Si(s),h=o.path(u,l),d=n.insert(()=>h,":first-child");return i&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",i),r&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(f){return Tr.polygon(e,s,f)},n}C(pbt,"choice");async function Rbe(t,e,r){const{labelStyles:n,nodeStyles:i}=Or(e);e.labelStyle=n;const{shapeSvg:a,bbox:s,halfPadding:o}=await pn(t,e,rn(e)),l=16,u=(r==null?void 0:r.padding)??o,h=e.look==="neo"?s.width/2+l*2:s.width/2+u;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=Er.svg(a),g=_r(e,{}),m=p.circle(0,0,h*2,g);d=a.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",_l(f))}else d=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0);return Pr(e,d),e.calcIntersect=function(p,g){const m=p.width/2;return Tr.circle(p,m,g)},e.intersect=function(p){return me.info("Circle intersect",e,h,p),Tr.circle(e,h,p)},a}C(Rbe,"circle");function gbt(t){const e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=t*2,i={x:n/2*e,y:n/2*r},a={x:-(n/2)*e,y:n/2*r},s={x:-(n/2)*e,y:-(n/2)*r},o={x:n/2*e,y:-(n/2)*r};return`M ${a.x},${a.y} L ${o.x},${o.y} - M ${i.x},${i.y} L ${s.x},${s.y}`}C(gbt,"createLine");function mbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r,e.label="";const i=t.insert("g").attr("class",rn(e)).attr("id",e.domId??e.id),a=Math.max(30,(e==null?void 0:e.width)??0),{cssStyles:s}=e,o=Er.svg(i),l=_r(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=o.circle(0,0,a*2,l),h=gbt(a),d=o.path(h,l),f=i.insert(()=>u,":first-child");return f.insert(()=>d),f.attr("class","outer-path"),s&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",s),n&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",n),Pr(e,f),e.intersect=function(p){return me.info("crossedCircle intersect",e,{radius:a,point:p}),Tr.circle(e,a,p)},i}C(mbt,"crossedCircle");function Uy(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dA,":first-child").attr("stroke-opacity",0),T.insert(()=>x,":first-child"),T.attr("class","text"),f&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",n),T.attr("transform",`translate(${d}, 0)`),s.attr("transform",`translate(${-u/2+d-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Pr(e,T),e.intersect=function(S){return Tr.polygon(e,g,S)},i}C(vbt,"curlyBraceLeft");function Vy(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dA,":first-child").attr("stroke-opacity",0),T.insert(()=>x,":first-child"),T.attr("class","text"),f&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",n),T.attr("transform",`translate(${-d}, 0)`),s.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Pr(e,T),e.intersect=function(S){return Tr.polygon(e,g,S)},i}C(ybt,"curlyBraceRight");function cc(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dk,":first-child").attr("stroke-opacity",0),E.insert(()=>w,":first-child"),E.insert(()=>S,":first-child"),E.attr("class","text"),f&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(${d-d/4}, 0)`),s.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Pr(e,E),e.intersect=function(_){return Tr.polygon(e,m,_)},i}C(bbt,"curlyBraces");async function xbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=20,l=5,{shapeSvg:u,bbox:h}=await pn(t,e,rn(e)),d=Math.max(o,(h.width+a*2)*1.25,(e==null?void 0:e.width)??0),f=Math.max(l,h.height+s*2,(e==null?void 0:e.height)??0),p=f/2,{cssStyles:g}=e,m=Er.svg(u),v=_r(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const y=d,b=f,x=y-p,w=b/4,A=[{x,y:0},{x:w,y:0},{x:0,y:b/2},{x:w,y:b},{x,y:b},...A7(-x,-b/2,p,50,270,90)],T=Si(A),S=m.path(T,v),O=u.insert(()=>S,":first-child");return O.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&O.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&O.selectChildren("path").attr("style",n),O.attr("transform",`translate(${-d/2}, ${-f/2})`),Pr(e,O),e.intersect=function(k){return Tr.polygon(e,A,k)},u}C(xbt,"curvedTrapezoid");var _rn=C((t,e,r,n,i,a)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),Rrn=C((t,e,r,n,i,a)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),Drn=C((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),wbt=8,Abt=8;async function Tbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?24:i,s=e.look==="neo"?24:i;if(e.width||e.height){const v=e.width??0;e.width=(e.width??0)-s,e.widthA,":first-child"),g=o.insert(()=>w,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const v=_rn(0,0,h,p,d,f);g=o.insert("path",":first-child").attr("d",v).attr("class","basic label-container outer-path").attr("style",_l(m)).attr("style",n)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),Pr(e,g),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(e.padding??0)/1.5-(l.y-(l.top??0))})`),e.intersect=function(v){const y=Tr.rect(e,v),b=y.x-(e.x??0);if(d!=0&&(Math.abs(b)<(e.width??0)/2||Math.abs(b)==(e.width??0)/2&&Math.abs(y.y-(e.y??0))>(e.height??0)/2-f)){let x=f*f*(1-b*b/(d*d));x>0&&(x=Math.sqrt(x)),x=f-x,v.y-(e.y??0)>0&&(x=-x),y.y+=x}return y},o}C(Tbt,"cylinder");async function X5(t,e,r){const{labelStyles:n,nodeStyles:i}=Or(e);e.labelStyle=n;const{shapeSvg:a,bbox:s}=await pn(t,e,rn(e)),o=Math.max(s.width+r.labelPaddingX*2,(e==null?void 0:e.width)||0),l=Math.max(s.height+r.labelPaddingY*2,(e==null?void 0:e.height)||0),u=-o/2,h=-l/2;let d,{rx:f,ry:p}=e;const{cssStyles:g}=e;if(r!=null&&r.rx&&r.ry&&(f=r.rx,p=r.ry),e.look==="handDrawn"){const m=Er.svg(a),v=_r(e,{}),y=f||p?m.path(Jx(u,h,o,l,f||0),v):m.rectangle(u,h,o,l,v);d=a.insert(()=>y,":first-child"),d.attr("class","basic label-container").attr("style",_l(g))}else d=a.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",i).attr("rx",_l(f)).attr("ry",_l(p)).attr("x",u).attr("y",h).attr("width",o).attr("height",l);return Pr(e,d),e.calcIntersect=function(m,v){return Tr.rect(m,v)},e.intersect=function(m){return Tr.rect(e,m)},a}C(X5,"drawRect");async function Sbt(t,e){const{cssClasses:r,labelPaddingX:n,labelPaddingY:i,padding:a,width:s,height:o}=e,l={rx:0,ry:0,labelPaddingX:n??(a??0)*2,labelPaddingY:i??a??0},u=await X5(t,e,l);if(e.look==="handDrawn"){const p=Er.svg(u),g=_r(e,{}),m=u.select(".basic.label-container > path:nth-child(2)"),v=m.node();if(!v)return u;let y=null;if(v instanceof SVGGraphicsElement)y=v.getBBox();else return u;return u.insert(()=>p.line(y.x,y.y,y.x+y.width,y.y,g),".basic.label-container g.label"),u.insert(()=>p.line(y.x,y.y+y.height,y.x+y.width,y.y+y.height,g),".basic.label-container g.label"),m.remove(),u}const h=u.select(".basic.label-container"),d=(Number(h.attr("width"))||s)??0,f=(Number(h.attr("height"))||o)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),u}C(Sbt,"datastore");async function Cbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?16:e.padding??0,{shapeSvg:s,bbox:o,label:l}=await pn(t,e,rn(e)),u=o.width+i,h=o.height+a,d=h*.2,f=-u/2,p=-h/2-d/2,{cssStyles:g}=e,m=Er.svg(s),v=_r(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const y=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],b=m.polygon(y.map(w=>[w.x,w.y]),v),x=s.insert(()=>b,":first-child");return x.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",n),l.attr("transform",`translate(${f+(e.padding??0)/2-(o.x-(o.left??0))}, ${p+d+(e.padding??0)/2-(o.y-(o.top??0))})`),Pr(e,x),e.intersect=function(w){return Tr.rect(e,w)},s}C(Cbt,"dividedRectangle");async function Obt(t,e){var p,g;const{labelStyles:r,nodeStyles:n}=Or(e),i=e.look==="neo"?12:5;e.labelStyle=r;const a=e.padding??0,s=e.look==="neo"?16:a,{shapeSvg:o,bbox:l}=await pn(t,e,rn(e)),u=(e!=null&&e.width?(e==null?void 0:e.width)/2:l.width/2)+(s??0),h=u-i;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const m=Er.svg(o),v=_r(e,{roughness:.2,strokeWidth:2.5}),y=_r(e,{roughness:.2,strokeWidth:1.5}),b=m.circle(0,0,u*2,v),x=m.circle(0,0,h*2,y);d=o.insert("g",":first-child"),d.attr("class",_l(e.cssClasses)).attr("style",_l(f)),(p=d.node())==null||p.appendChild(b),(g=d.node())==null||g.appendChild(x)}else{d=o.insert("g",":first-child");const m=d.insert("circle",":first-child"),v=d.insert("circle");d.attr("class","basic label-container").attr("style",n),m.attr("class","outer-circle").attr("style",n).attr("r",u).attr("cx",0).attr("cy",0),v.attr("class","inner-circle").attr("style",n).attr("r",h).attr("cx",0).attr("cy",0)}return Pr(e,d),e.intersect=function(m){return me.info("DoubleCircle intersect",e,u,m),Tr.circle(e,u,m)},o}C(Obt,"doublecircle");function kbt(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Or(e);e.label="",e.labelStyle=n;const a=t.insert("g").attr("class",rn(e)).attr("id",e.domId??e.id),s=7,{cssStyles:o}=e,l=Er.svg(a),{nodeBorder:u}=r,h=_r(e,{fillStyle:"solid"});e.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,s*2,h),f=a.insert(()=>d,":first-child");return f.selectAll("path").attr("style",`fill: ${u} !important;`),o&&o.length>0&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",o),i&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",i),Pr(e,f),e.intersect=function(p){return me.info("filledCircle intersect",e,{radius:s,point:p}),Tr.circle(e,s,p)},a}C(kbt,"filledCircle");var Ebt=10,_bt=10;async function Rbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.height=(e==null?void 0:e.height)??0,e.heighty,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),e.width=u,e.height=h,Pr(e,b),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-h/2+(e.padding??0)/2+(o.y-(o.top??0))})`),e.intersect=function(x){return me.info("Triangle intersect",e,f,x),Tr.polygon(e,f,x)},s}C(Rbt,"flippedTriangle");function Dbt(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:a}=Or(e);e.label="";const s=t.insert("g").attr("class",rn(e)).attr("id",e.domId??e.id),{cssStyles:o}=e;let l=Math.max(70,(e==null?void 0:e.width)??0),u=Math.max(10,(e==null?void 0:e.height)??0);r==="LR"&&(l=Math.max(10,(e==null?void 0:e.width)??0),u=Math.max(70,(e==null?void 0:e.height)??0));const h=-1*l/2,d=-1*u/2,f=Er.svg(s),p=_r(e,{stroke:i.lineColor,fill:i.lineColor});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=f.rectangle(h,d,l,u,p),m=s.insert(()=>g,":first-child");o&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",o),a&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",a),Pr(e,m);const v=(n==null?void 0:n.padding)??0;return e.width&&e.height&&(e.width+=v/2||0,e.height+=v/2||0),e.intersect=function(y){return Tr.rect(e,y)},s}C(Dbt,"forkJoin");async function Lbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=15,a=10,s=e.look==="neo"?16:e.padding??0,o=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.height=((e==null?void 0:e.height)??0)-o*2,e.heightb,":first-child");return x.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),Pr(e,x),e.intersect=function(w){return me.info("Pill intersect",e,{radius:f,point:w}),Tr.polygon(e,v,w)},l}C(Lbt,"halfRoundedRectangle");var Lrn=C((t,e,r,n,i)=>[`M${t+i},${e}`,`L${t+r-i},${e}`,`L${t+r},${e-n/2}`,`L${t+r-i},${e-n}`,`L${t+i},${e-n}`,`L${t},${e-n/2}`,"Z"].join(" "),"createHexagonPathD");async function Mbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e),i=e.look==="neo"?3.5:4;e.labelStyle=r;const a=e.padding??0,s=70,o=32,l=e.look==="neo"?s:a,u=e.look==="neo"?o:a;if(e.width||e.height){const x=(e.height??0)/i;e.width=((e==null?void 0:e.width)??0)-2*x-u,e.height=(e.height??0)-l}const{shapeSvg:h,bbox:d}=await pn(t,e,rn(e)),f=(e!=null&&e.height?e==null?void 0:e.height:d.height)+l,p=f/i,g=(e!=null&&e.width?e==null?void 0:e.width:d.width)+2*p+u,m=[{x:p,y:0},{x:g-p,y:0},{x:g,y:-f/2},{x:g-p,y:-f},{x:p,y:-f},{x:0,y:-f/2}];let v;const{cssStyles:y}=e;if(e.look==="handDrawn"){const b=Er.svg(h),x=_r(e,{}),w=Lrn(0,0,g,f,p),A=b.path(w,x);v=h.insert(()=>A,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),y&&v.attr("style",y)}else v=zy(h,g,f,m);return n&&v.attr("style",n),e.width=g,e.height=f,Pr(e,v),e.intersect=function(b){return Tr.polygon(e,m,b)},h}C(Mbt,"hexagon");async function Ibt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.label="",e.labelStyle=r;const{shapeSvg:i}=await pn(t,e,rn(e)),a=Math.max(30,(e==null?void 0:e.width)??0),s=Math.max(30,(e==null?void 0:e.height)??0),{cssStyles:o}=e,l=Er.svg(i),u=_r(e,{});e.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const h=[{x:0,y:0},{x:a,y:0},{x:0,y:s},{x:a,y:s}],d=Si(h),f=l.path(d,u),p=i.insert(()=>f,":first-child");return p.attr("class","basic label-container outer-path"),o&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",o),n&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",n),p.attr("transform",`translate(${-a/2}, ${-s/2})`),Pr(e,p),e.intersect=function(g){return me.info("Pill intersect",e,{points:h}),Tr.polygon(e,h,g)},i}C(Ibt,"hourglass");async function Pbt(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Or(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await pn(t,e,"icon-shape default"),f=e.pos==="t",p=o,g=o,{nodeBorder:m}=r,{stylesMap:v}=H5(e),y=-g/2,b=-p/2,x=e.label?8:0,w=Er.svg(u),A=_r(e,{stroke:"none",fill:"none"});e.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");const T=w.rectangle(y,b,g,p,A),S=Math.max(g,h.width),O=p+h.height+x,k=w.rectangle(-S/2,-O/2,S,O,{...A,fill:"transparent",stroke:"none"}),E=u.insert(()=>T,":first-child"),_=u.insert(()=>k);if(e.icon){const I=u.append("g");I.html(`${await Fy(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const L=I.node().getBBox(),R=L.width,D=L.height,M=L.x,P=L.y;I.attr("transform",`translate(${-R/2-M},${f?h.height/2+x/2-D/2-P:-h.height/2-x/2-D/2-P})`),I.attr("style",`color: ${v.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-O/2:O/2-h.height})`),E.attr("transform",`translate(0,${f?h.height/2+x/2:-h.height/2-x/2})`),Pr(e,_),e.intersect=function(I){if(me.info("iconSquare intersect",e,I),!e.label)return Tr.rect(e,I);const L=e.x??0,R=e.y??0,D=e.height??0;let M=[];return f?M=[{x:L-h.width/2,y:R-D/2},{x:L+h.width/2,y:R-D/2},{x:L+h.width/2,y:R-D/2+h.height+x},{x:L+g/2,y:R-D/2+h.height+x},{x:L+g/2,y:R+D/2},{x:L-g/2,y:R+D/2},{x:L-g/2,y:R-D/2+h.height+x},{x:L-h.width/2,y:R-D/2+h.height+x}]:M=[{x:L-g/2,y:R-D/2},{x:L+g/2,y:R-D/2},{x:L+g/2,y:R-D/2+p},{x:L+h.width/2,y:R-D/2+p},{x:L+h.width/2/2,y:R+D/2},{x:L-h.width/2,y:R+D/2},{x:L-h.width/2,y:R-D/2+p},{x:L-g/2,y:R-D/2+p}],Tr.polygon(e,M,I)},u}C(Pbt,"icon");async function Nbt(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Or(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await pn(t,e,"icon-shape default"),f=20,p=e.label?8:0,g=e.pos==="t",{nodeBorder:m,mainBkg:v}=r,{stylesMap:y}=H5(e),b=Er.svg(u),x=_r(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const w=y.get("fill");x.stroke=w??v;const A=u.append("g");e.icon&&A.html(`${await Fy(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const T=A.node().getBBox(),S=T.width,O=T.height,k=T.x,E=T.y,_=Math.max(S,O)*Math.SQRT2+f*2,I=b.circle(0,0,_,x),L=Math.max(_,h.width),R=_+h.height+p,D=b.rectangle(-L/2,-R/2,L,R,{...x,fill:"transparent",stroke:"none"}),M=u.insert(()=>I,":first-child"),P=u.insert(()=>D);return A.attr("transform",`translate(${-S/2-k},${g?h.height/2+p/2-O/2-E:-h.height/2-p/2-O/2-E})`),A.attr("style",`color: ${y.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-R/2:R/2-h.height})`),M.attr("transform",`translate(0,${g?h.height/2+p/2:-h.height/2-p/2})`),Pr(e,P),e.intersect=function(N){return me.info("iconSquare intersect",e,N),Tr.rect(e,N)},u}C(Nbt,"iconCircle");async function Bbt(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Or(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await pn(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:v,mainBkg:y}=r,{stylesMap:b}=H5(e),x=-m/2,w=-g/2,A=e.label?8:0,T=Er.svg(u),S=_r(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const O=b.get("fill");S.stroke=O??y;const k=T.path(Jx(x,w,m,g,5),S),E=Math.max(m,h.width),_=g+h.height+A,I=T.rectangle(-E/2,-_/2,E,_,{...S,fill:"transparent",stroke:"none"}),L=u.insert(()=>k,":first-child").attr("class","icon-shape2"),R=u.insert(()=>I);if(e.icon){const D=u.append("g");D.html(`${await Fy(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const M=D.node().getBBox(),P=M.width,N=M.height,F=M.x,B=M.y;D.attr("transform",`translate(${-P/2-F},${p?h.height/2+A/2-N/2-B:-h.height/2-A/2-N/2-B})`),D.attr("style",`color: ${b.get("stroke")??v};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-_/2:_/2-h.height})`),L.attr("transform",`translate(0,${p?h.height/2+A/2:-h.height/2-A/2})`),Pr(e,R),e.intersect=function(D){if(me.info("iconSquare intersect",e,D),!e.label)return Tr.rect(e,D);const M=e.x??0,P=e.y??0,N=e.height??0;let F=[];return p?F=[{x:M-h.width/2,y:P-N/2},{x:M+h.width/2,y:P-N/2},{x:M+h.width/2,y:P-N/2+h.height+A},{x:M+m/2,y:P-N/2+h.height+A},{x:M+m/2,y:P+N/2},{x:M-m/2,y:P+N/2},{x:M-m/2,y:P-N/2+h.height+A},{x:M-h.width/2,y:P-N/2+h.height+A}]:F=[{x:M-m/2,y:P-N/2},{x:M+m/2,y:P-N/2},{x:M+m/2,y:P-N/2+g},{x:M+h.width/2,y:P-N/2+g},{x:M+h.width/2/2,y:P+N/2},{x:M-h.width/2,y:P+N/2},{x:M-h.width/2,y:P-N/2+g},{x:M-m/2,y:P-N/2+g}],Tr.polygon(e,F,D)},u}C(Bbt,"iconRounded");async function $bt(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Or(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await pn(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:v,mainBkg:y}=r,{stylesMap:b}=H5(e),x=-m/2,w=-g/2,A=e.label?8:0,T=Er.svg(u),S=_r(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const O=b.get("fill");S.stroke=O??y;const k=T.path(Jx(x,w,m,g,.1),S),E=Math.max(m,h.width),_=g+h.height+A,I=T.rectangle(-E/2,-_/2,E,_,{...S,fill:"transparent",stroke:"none"}),L=u.insert(()=>k,":first-child"),R=u.insert(()=>I);if(e.icon){const D=u.append("g");D.html(`${await Fy(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const M=D.node().getBBox(),P=M.width,N=M.height,F=M.x,B=M.y;D.attr("transform",`translate(${-P/2-F},${p?h.height/2+A/2-N/2-B:-h.height/2-A/2-N/2-B})`),D.attr("style",`color: ${b.get("stroke")??v};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-_/2:_/2-h.height})`),L.attr("transform",`translate(0,${p?h.height/2+A/2:-h.height/2-A/2})`),Pr(e,R),e.intersect=function(D){if(me.info("iconSquare intersect",e,D),!e.label)return Tr.rect(e,D);const M=e.x??0,P=e.y??0,N=e.height??0;let F=[];return p?F=[{x:M-h.width/2,y:P-N/2},{x:M+h.width/2,y:P-N/2},{x:M+h.width/2,y:P-N/2+h.height+A},{x:M+m/2,y:P-N/2+h.height+A},{x:M+m/2,y:P+N/2},{x:M-m/2,y:P+N/2},{x:M-m/2,y:P-N/2+h.height+A},{x:M-h.width/2,y:P-N/2+h.height+A}]:F=[{x:M-m/2,y:P-N/2},{x:M+m/2,y:P-N/2},{x:M+m/2,y:P-N/2+g},{x:M+h.width/2,y:P-N/2+g},{x:M+h.width/2/2,y:P+N/2},{x:M-h.width/2,y:P+N/2},{x:M-h.width/2,y:P-N/2+g},{x:M-m/2,y:P-N/2+g}],Tr.polygon(e,F,D)},u}C($bt,"iconSquare");async function Fbt(t,e,{config:{flowchart:r}}){const n=new Image;n.src=(e==null?void 0:e.img)??"",await n.decode();const i=Number(n.naturalWidth.toString().replace("px","")),a=Number(n.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/a;const{labelStyles:s}=Or(e);e.labelStyle=s;const o=r==null?void 0:r.wrappingWidth;e.defaultWidth=r==null?void 0:r.wrappingWidth;const l=Math.max(e.label?o??0:0,(e==null?void 0:e.assetWidth)??i),u=e.constraint==="on"&&e!=null&&e.assetHeight?e.assetHeight*e.imageAspectRatio:l,h=e.constraint==="on"?u/e.imageAspectRatio:(e==null?void 0:e.assetHeight)??a;e.width=Math.max(u,o??0);const{shapeSvg:d,bbox:f,label:p}=await pn(t,e,"image-shape default"),g=e.pos==="t",m=-u/2,v=-h/2,y=e.label?8:0,b=Er.svg(d),x=_r(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const w=b.rectangle(m,v,u,h,x),A=Math.max(u,f.width),T=h+f.height+y,S=b.rectangle(-A/2,-T/2,A,T,{...x,fill:"none",stroke:"none"}),O=d.insert(()=>w,":first-child"),k=d.insert(()=>S);if(e.img){const E=d.append("image");E.attr("href",e.img),E.attr("width",u),E.attr("height",h),E.attr("preserveAspectRatio","none"),E.attr("transform",`translate(${-u/2},${g?T/2-h:-T/2})`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-y/2:h/2-f.height/2+y/2})`),O.attr("transform",`translate(0,${g?f.height/2+y/2:-f.height/2-y/2})`),Pr(e,k),e.intersect=function(E){if(me.info("iconSquare intersect",e,E),!e.label)return Tr.rect(e,E);const _=e.x??0,I=e.y??0,L=e.height??0;let R=[];return g?R=[{x:_-f.width/2,y:I-L/2},{x:_+f.width/2,y:I-L/2},{x:_+f.width/2,y:I-L/2+f.height+y},{x:_+u/2,y:I-L/2+f.height+y},{x:_+u/2,y:I+L/2},{x:_-u/2,y:I+L/2},{x:_-u/2,y:I-L/2+f.height+y},{x:_-f.width/2,y:I-L/2+f.height+y}]:R=[{x:_-u/2,y:I-L/2},{x:_+u/2,y:I-L/2},{x:_+u/2,y:I-L/2+h},{x:_+f.width/2,y:I-L/2+h},{x:_+f.width/2/2,y:I+L/2},{x:_-f.width/2,y:I+L/2},{x:_-f.width/2,y:I-L/2+h},{x:_-u/2,y:I-L/2+h}],Tr.polygon(e,R,E)},d}C(Fbt,"imageSquare");async function zbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await pn(t,e,rn(e)),u=Math.max(l.width+(s??0)*2,(e==null?void 0:e.width)??0),h=Math.max(l.height+(a??0)*2,(e==null?void 0:e.height)??0),d=[{x:0,y:0},{x:u,y:0},{x:u+3*h/6,y:-h},{x:-3*h/6,y:-h}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Er.svg(o),m=_r(e,{}),v=Si(d),y=g.path(v,m);f=o.insert(()=>y,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),p&&f.attr("style",p)}else f=zy(o,u,h,d);return n&&f.attr("style",n),e.width=u,e.height=h,Pr(e,f),e.intersect=function(g){return Tr.polygon(e,d,g)},o}C(zbt,"inv_trapezoid");async function Ubt(t,e){const{shapeSvg:r,bbox:n,label:i}=await pn(t,e,"label"),a=r.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),i.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),Pr(e,a),e.intersect=function(l){return Tr.rect(e,l)},r}C(Ubt,"labelRect");async function Vbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await pn(t,e,rn(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:0,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:-(3*u)/6,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Er.svg(o),m=_r(e,{}),v=Si(d),y=g.path(v,m);f=o.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=zy(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Pr(e,f),e.intersect=function(g){return Tr.polygon(e,d,g)},o}C(Vbt,"lean_left");async function Qbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await pn(t,e,rn(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:-3*u/6,y:0},{x:h,y:0},{x:h+3*u/6,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Er.svg(o),m=_r(e,{}),v=Si(d),y=g.path(v,m);f=o.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=zy(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Pr(e,f),e.intersect=function(g){return Tr.polygon(e,d,g)},o}C(Qbt,"lean_right");function Gbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.label="",e.labelStyle=r;const i=t.insert("g").attr("class",rn(e)).attr("id",e.domId??e.id),{cssStyles:a}=e,s=Math.max(35,(e==null?void 0:e.width)??0),o=Math.max(35,(e==null?void 0:e.height)??0),l=7,u=[{x:s,y:0},{x:0,y:o+l/2},{x:s-2*l,y:o+l/2},{x:0,y:2*o},{x:s,y:o-l/2},{x:2*l,y:o-l/2}],h=Er.svg(i),d=_r(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=Si(u),p=h.path(f,d),g=i.insert(()=>p,":first-child");return g.attr("class","outer-path"),a&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",a),n&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",n),g.attr("transform",`translate(-${s/2},${-o})`),Pr(e,g),e.intersect=function(m){return me.info("lightningBolt intersect",e,m),Tr.polygon(e,u,m)},i}C(Gbt,"lightningBolt");var Mrn=C((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),Irn=C((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),Prn=C((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Hbt=10,Wbt=10;async function Ybt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?24:i;if(e.width||e.height){const y=e.width??0;e.width=(e.width??0)-a,e.widthT,":first-child").attr("class","line"),m=o.insert(()=>A,":first-child"),m.attr("class","basic label-container"),v&&m.attr("style",v)}else{const y=Mrn(0,0,h,p,d,f,g);m=o.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",_l(v)).attr("style",n)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),Pr(e,m),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+f-(l.y-(l.top??0))})`),e.intersect=function(y){const b=Tr.rect(e,y),x=b.x-(e.x??0);if(d!=0&&(Math.abs(x)<(e.width??0)/2||Math.abs(x)==(e.width??0)/2&&Math.abs(b.y-(e.y??0))>(e.height??0)/2-f)){let w=f*f*(1-x*x/(d*d));w>0&&(w=Math.sqrt(w)),w=f-w,y.y-(e.y??0)>0&&(w=-w),b.y+=w}return b},o}C(Ybt,"linedCylinder");async function qbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;if(e.width||e.height){const w=e.width;e.width=(w??0)*10/11-a*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-s*2,e.height<10&&(e.height=10)}const{shapeSvg:o,bbox:l,label:u}=await pn(t,e,rn(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+(a??0)*2,d=(e!=null&&e.height?e==null?void 0:e.height:l.height)+(s??0)*2,f=e.look==="neo"?d/4:d/8,p=d+f,{cssStyles:g}=e,m=Er.svg(o),v=_r(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const y=[{x:-h/2-h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:p/2},...Kx(-h/2-h/2*.1,p/2,h/2+h/2*.1,p/2,f,.8),{x:h/2+h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:-p/2},{x:-h/2,y:-p/2},{x:-h/2,y:p/2*1.1},{x:-h/2,y:-p/2}],b=m.polygon(y.map(w=>[w.x,w.y]),v),x=o.insert(()=>b,":first-child");return x.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",n),x.attr("transform",`translate(0,${-f/2})`),u.attr("transform",`translate(${-h/2+(e.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(e.padding??0)-f/2-(l.y-(l.top??0))})`),Pr(e,x),e.intersect=function(w){return Tr.polygon(e,y,w)},o}C(qbt,"linedWaveEdgedRect");async function jbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=e.look==="neo"?10:5;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-2*o,10),e.height=Math.max(((e==null?void 0:e.height)??0)-s*2-2*o,10));const{shapeSvg:l,bbox:u,label:h}=await pn(t,e,rn(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+a*2+2*o,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+s*2+2*o,p=d-2*o,g=f-2*o,m=-p/2,v=-g/2,{cssStyles:y}=e,b=Er.svg(l),x=_r(e,{}),w=[{x:m-o,y:v+o},{x:m-o,y:v+g+o},{x:m+p-o,y:v+g+o},{x:m+p-o,y:v+g},{x:m+p,y:v+g},{x:m+p,y:v+g-o},{x:m+p+o,y:v+g-o},{x:m+p+o,y:v-o},{x:m+o,y:v-o},{x:m+o,y:v},{x:m,y:v},{x:m,y:v+o}],A=[{x:m,y:v+o},{x:m+p-o,y:v+o},{x:m+p-o,y:v+g},{x:m+p,y:v+g},{x:m+p,y:v},{x:m,y:v}];e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const T=Si(w);let S=b.path(T,x);const O=Si(A);let k=b.path(O,x);e.look!=="handDrawn"&&(S=kbe(S),k=kbe(k));const E=l.insert("g",":first-child");return E.insert(()=>S),E.insert(()=>k),E.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",y),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),h.attr("transform",`translate(${-(u.width/2)-o-(u.x-(u.left??0))}, ${-(u.height/2)+o-(u.y-(u.top??0))})`),Pr(e,E),e.intersect=function(_){return Tr.polygon(e,w,_)},l}C(jbt,"multiRect");async function Xbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await pn(t,e,rn(e)),o=e.padding??0,l=e.look==="neo"?16:o,u=e.look==="neo"?12:o;let h=!0;(e.width||e.height)&&(h=!1,e.width=((e==null?void 0:e.width)??0)-l*2,e.height=((e==null?void 0:e.height)??0)-u*3);const d=Math.max(a.width,(e==null?void 0:e.width)??0)+l*2,f=Math.max(a.height,(e==null?void 0:e.height)??0)+u*3,p=e.look==="neo"?f/4:f/8,g=f+(h?p/2:-p/2),m=-d/2,v=-g/2,y=10,{cssStyles:b}=e,x=Kx(m-y,v+g+y,m+d-y,v+g+y,p,.8),w=x==null?void 0:x[x.length-1],A=[{x:m-y,y:v+y},{x:m-y,y:v+g+y},...x,{x:m+d-y,y:w.y-y},{x:m+d,y:w.y-y},{x:m+d,y:w.y-2*y},{x:m+d+y,y:w.y-2*y},{x:m+d+y,y:v-y},{x:m+y,y:v-y},{x:m+y,y:v},{x:m,y:v},{x:m,y:v+y}],T=[{x:m,y:v+y},{x:m+d-y,y:v+y},{x:m+d-y,y:w.y-y},{x:m+d,y:w.y-y},{x:m+d,y:v},{x:m,y:v}],S=Er.svg(i),O=_r(e,{});e.look!=="handDrawn"&&(O.roughness=0,O.fillStyle="solid");const k=Si(A),E=S.path(k,O),_=Si(T),I=S.path(_,O),L=i.insert(()=>E,":first-child");return L.insert(()=>I),L.attr("class","basic label-container outer-path"),b&&e.look!=="handDrawn"&&L.selectAll("path").attr("style",b),n&&e.look!=="handDrawn"&&L.selectAll("path").attr("style",n),L.attr("transform",`translate(0,${-p/2})`),s.attr("transform",`translate(${-(a.width/2)-y-(a.x-(a.left??0))}, ${-(a.height/2)+y-p/2-(a.y-(a.top??0))})`),Pr(e,L),e.intersect=function(R){return Tr.polygon(e,A,R)},i}C(Xbt,"multiWaveEdgedRectangle");async function Kbt(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Or(e);e.labelStyle=n,e.useHtmlLabels||Zi(Dr())||(e.centerLabel=!0);const{shapeSvg:s,bbox:o,label:l}=await pn(t,e,rn(e)),u=Math.max(o.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),h=Math.max(o.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),d=-u/2,f=-h/2,{cssStyles:p}=e,g=Er.svg(s),m=_r(e,{fill:r.noteBkgColor,stroke:r.noteBorderColor});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const v=g.rectangle(d,f,u,h,m),y=s.insert(()=>v,":first-child");return y.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),p&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",p),i&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",i),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Pr(e,y),e.intersect=function(b){return Tr.rect(e,b)},s}C(Kbt,"note");var Nrn=C((t,e,r)=>[`M${t+r/2},${e}`,`L${t+r},${e-r/2}`,`L${t+r/2},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function Zbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await pn(t,e,rn(e)),s=a.width+(e.padding??0),o=a.height+(e.padding??0),l=s+o,u=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=Er.svg(i),g=_r(e,{}),m=Nrn(0,0,l),v=p.path(m,g);d=i.insert(()=>v,":first-child").attr("transform",`translate(${-l/2+u}, ${l/2})`),f&&d.attr("style",f)}else d=zy(i,l,l,h),d.attr("transform",`translate(${-l/2+u}, ${l/2})`);return n&&d.attr("style",n),Pr(e,d),e.calcIntersect=function(p,g){const m=p.width,v=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],y=Tr.polygon(p,v,g);return{x:y.x-.5,y:y.y-.5}},e.intersect=function(p){return this.calcIntersect(e,p)},i}C(Zbt,"question");async function Jbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?21:i??0,s=e.look==="neo"?12:i??0,{shapeSvg:o,bbox:l,label:u}=await pn(t,e,rn(e)),h=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a),d=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?s*2:s),f=-h/2,p=-d/2,g=p/2,m=[{x:f+g,y:p},{x:f,y:0},{x:f+g,y:-p},{x:-f,y:-p},{x:-f,y:p}],{cssStyles:v}=e,y=Er.svg(o),b=_r(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const x=Si(m),w=y.path(x,b),A=o.insert(()=>w,":first-child");return A.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",n),A.attr("transform",`translate(${-g/2},0)`),u.attr("transform",`translate(${-g/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),Pr(e,A),e.intersect=function(T){return Tr.polygon(e,m,T)},o}C(Jbt,"rect_left_inv_arrow");async function ext(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;let i;e.cssClasses?i="node "+e.cssClasses:i="node default";const a=t.insert("g").attr("class",i).attr("id",e.domId||e.id),s=a.insert("g"),o=a.insert("g").attr("class","label").attr("style",n),l=e.description,u=e.label,h=await Zx(o,u,e.labelStyle,!0,!0);let d={width:0,height:0};if(Zi(He())){const O=h.children[0],k=Ot(h);d=O.getBoundingClientRect(),k.attr("width",d.width),k.attr("height",d.height)}me.info("Text 2",l);const f=l||[],p=h.getBBox(),g=await Zx(o,Array.isArray(f)?f.join("
"):f,e.labelStyle,!0,!0),m=g.children[0],v=Ot(g);d=m.getBoundingClientRect(),v.attr("width",d.width),v.attr("height",d.height);const y=(e.padding||0)/2;Ot(g).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+y+5)+")"),Ot(h).attr("transform","translate( "+(d.width(me.debug("Rough node insert CXC",E),_),":first-child"),T=a.insert(()=>(me.debug("Rough node insert CXC",E),E),":first-child")}else T=s.insert("rect",":first-child"),S=s.insert("line"),T.attr("class","outer title-state").attr("style",n).attr("x",-d.width/2-y).attr("y",-d.height/2-y).attr("width",d.width+(e.padding||0)).attr("height",d.height+(e.padding||0)),S.attr("class","divider").attr("x1",-d.width/2-y).attr("x2",d.width/2+y).attr("y1",-d.height/2-y+p.height+y).attr("y2",-d.height/2-y+p.height+y);return Pr(e,T),e.intersect=function(O){return Tr.rect(e,O)},a}C(ext,"rectWithTitle");async function txt(t,e,{config:{themeVariables:r}}){const n=(r==null?void 0:r.radius)??5,i={rx:n,ry:n,labelPaddingX:((e==null?void 0:e.padding)??0)*1,labelPaddingY:((e==null?void 0:e.padding)??0)*1};return X5(t,e,i)}C(txt,"roundedRect");var IS=8;async function rxt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?12:e.padding??0,{shapeSvg:s,bbox:o,label:l}=await pn(t,e,rn(e)),u=((e==null?void 0:e.width)??o.width)+i*2+(e.look==="neo"?IS:IS*2),h=((e==null?void 0:e.height)??o.height)+a*2,d=u-IS,f=h,p=IS-u/2,g=-h/2,{cssStyles:m}=e,v=Er.svg(s),y=_r(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const b=[{x:p,y:g},{x:p+d,y:g},{x:p+d,y:g+f},{x:p-IS,y:g+f},{x:p-IS,y:g},{x:p,y:g},{x:p,y:g+f}],x=v.polygon(b.map(A=>[A.x,A.y]),y),w=s.insert(()=>x,":first-child");return w.attr("class","basic label-container outer-path").attr("style",_l(m)),n&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),m&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),l.attr("transform",`translate(${IS/2-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Pr(e,w),e.intersect=function(A){return Tr.rect(e,A)},s}C(rxt,"shadedProcess");async function nxt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-a*2,10),e.height=Math.max(((e==null?void 0:e.height)??0)/1.5-s*2,10));const{shapeSvg:o,bbox:l,label:u}=await pn(t,e,rn(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2,d=((e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2)*1.5,f=h,p=d/1.5,g=-f/2,m=-p/2,{cssStyles:v}=e,y=Er.svg(o),b=_r(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const x=[{x:g,y:m},{x:g,y:m+p},{x:g+f,y:m+p},{x:g+f,y:m-p/2}],w=Si(x),A=y.path(w,b),T=o.insert(()=>A,":first-child");return T.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",v),n&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",n),T.attr("transform",`translate(0, ${p/4})`),u.attr("transform",`translate(${-f/2+(e.padding??0)-(l.x-(l.left??0))}, ${-p/4+(e.padding??0)-(l.y-(l.top??0))})`),Pr(e,T),e.intersect=function(S){return Tr.polygon(e,x,S)},o}C(nxt,"slopedRect");async function ixt(t,e){const r=e.padding??0,n=e.look==="neo"?16:r*2,i=e.look==="neo"?12:r,a={rx:0,ry:0,labelPaddingX:e.labelPaddingX??n,labelPaddingY:i};return X5(t,e,a)}C(ixt,"squareRect");async function axt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?20:i,s=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await pn(t,e,rn(e)),u=l.height+(e.look==="neo"?s*2:s),h=l.width+u/4+(e.look==="neo"?a*2:a),d=u/2,{cssStyles:f}=e,p=Er.svg(o),g=_r(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-h/2+d,y:-u/2},{x:h/2-d,y:-u/2},...A7(-h/2+d,0,d,50,90,270),{x:h/2-d,y:u/2},...A7(h/2-d,0,d,50,270,450)],v=Si(m),y=p.path(v,g),b=o.insert(()=>y,":first-child");return b.attr("class","basic label-container outer-path"),f&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",f),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),Pr(e,b),e.intersect=function(x){return Tr.polygon(e,m,x)},o}C(axt,"stadium");async function sxt(t,e){const r={rx:e.look==="neo"?3:5,ry:e.look==="neo"?3:5};return X5(t,e,r)}C(sxt,"state");function oxt(t,e,{config:{themeVariables:r}}){var b,x;const{labelStyles:n,nodeStyles:i}=Or(e);e.labelStyle=n;const{cssStyles:a}=e,{lineColor:s,stateBorder:o,nodeBorder:l,nodeShadow:u}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const h=t.insert("g").attr("class","node default").attr("id",e.domId??e.id),d=Er.svg(h),f=_r(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=d.circle(0,0,e.width,{...f,stroke:s,strokeWidth:2}),g=o??l,m=(e.width??0)*5/14,v=d.circle(0,0,m,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),y=h.insert(()=>p,":first-child");if(y.insert(()=>v),e.look!=="handDrawn"&&y.attr("class","outer-path"),a&&y.selectAll("path").attr("style",a),i&&y.selectAll("path").attr("style",i),e.width<25&&u&&e.look!=="handDrawn"){const w=((x=(b=t.node())==null?void 0:b.ownerSVGElement)==null?void 0:x.id)??"",A=w?`${w}-drop-shadow-small`:"drop-shadow-small";y.attr("style",`filter:url(#${A})`)}return Pr(e,y),e.intersect=function(w){return Tr.circle(e,(e.width??0)/2,w)},h}C(oxt,"stateEnd");function lxt(t,e,{config:{themeVariables:r}}){var o,l;const{lineColor:n,nodeShadow:i}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const a=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let s;if(e.look==="handDrawn"){const h=Er.svg(a).circle(0,0,e.width,fen(n));s=a.insert(()=>h),s.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14)}else s=a.insert("circle",":first-child"),s.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14);if(e.width<25&&i&&e.look!=="handDrawn"){const u=((l=(o=t.node())==null?void 0:o.ownerSVGElement)==null?void 0:l.id)??"",h=u?`${u}-drop-shadow-small`:"drop-shadow-small";s.attr("style",`filter:url(#${h})`)}return Pr(e,s),e.intersect=function(u){return Tr.circle(e,(e.width??7)/2,u)},a}C(lxt,"stateStart");var K5=8;async function cxt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=(e==null?void 0:e.padding)??8,a=e.look==="neo"?28:i,s=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await pn(t,e,rn(e)),u=((e==null?void 0:e.width)??l.width)+2*K5+a,h=((e==null?void 0:e.height)??l.height)+s,d=u-2*K5,f=h,p=-u/2,g=-h/2,m=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(e.look==="handDrawn"){const v=Er.svg(o),y=_r(e,{}),b=v.rectangle(p,g,d+16,f,y),x=v.line(p+K5,g,p+K5,g+f,y),w=v.line(p+K5+d,g,p+K5+d,g+f,y);o.insert(()=>x,":first-child"),o.insert(()=>w,":first-child");const A=o.insert(()=>b,":first-child"),{cssStyles:T}=e;A.attr("class","basic label-container").attr("style",_l(T)),Pr(e,A)}else{const v=zy(o,d,f,m);n&&v.attr("style",n),Pr(e,v)}return e.intersect=function(v){return Tr.polygon(e,m,v)},o}C(cxt,"subroutine");var Dbe=.2;async function uxt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;(e.width||e.height)&&(e.height=Math.max(((e==null?void 0:e.height)??0)-s*2,10),e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-Dbe*(e.height+s*2),10));const{shapeSvg:o,bbox:l}=await pn(t,e,rn(e)),u=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2,h=Dbe*u,d=Dbe*u,p=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2+h-h,g=u,m=-p/2,v=-g/2,{cssStyles:y}=e,b=Er.svg(o),x=_r(e,{}),w=[{x:m-h/2,y:v},{x:m+p+h/2,y:v},{x:m+p+h/2,y:v+g},{x:m-h/2,y:v+g}],A=[{x:m+p-h/2,y:v+g},{x:m+p+h/2,y:v+g},{x:m+p+h/2,y:v+g-d}];e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const T=Si(w),S=b.path(T,x),O=Si(A),k=b.path(O,{...x,fillStyle:"solid"}),E=o.insert(()=>k,":first-child");return E.insert(()=>S,":first-child"),E.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",y),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),Pr(e,E),e.intersect=function(_){return Tr.polygon(e,w,_)},o}C(uxt,"taggedRect");async function hxt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await pn(t,e,rn(e)),o=Math.max(a.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),l=Math.max(a.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),u=l/8,h=.2*o,d=.2*l,f=l+u,{cssStyles:p}=e,g=Er.svg(i),m=_r(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const v=[{x:-o/2-o/2*.1,y:f/2},...Kx(-o/2-o/2*.1,f/2,o/2+o/2*.1,f/2,u,.8),{x:o/2+o/2*.1,y:-f/2},{x:-o/2-o/2*.1,y:-f/2}],y=-o/2+o/2*.1,b=-f/2-d*.4,x=[{x:y+o-h,y:(b+l)*1.3},{x:y+o,y:b+l-d},{x:y+o,y:(b+l)*.9},...Kx(y+o,(b+l)*1.25,y+o-h,(b+l)*1.3,-l*.02,.5)],w=Si(v),A=g.path(w,m),T=Si(x),S=g.path(T,{...m,fillStyle:"solid"}),O=i.insert(()=>S,":first-child");return O.insert(()=>A,":first-child"),O.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",n),O.attr("transform",`translate(0,${-u/2})`),s.attr("transform",`translate(${-o/2+(e.padding??0)-(a.x-(a.left??0))},${-l/2+(e.padding??0)-u/2-(a.y-(a.top??0))})`),Pr(e,O),e.intersect=function(k){return Tr.polygon(e,v,k)},i}C(hxt,"taggedWaveEdgedRectangle");async function dxt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await pn(t,e,rn(e)),s=Math.max(a.width+(e.padding??0),(e==null?void 0:e.width)||0),o=Math.max(a.height+(e.padding??0),(e==null?void 0:e.height)||0),l=-s/2,u=-o/2,h=i.insert("rect",":first-child");return h.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",l).attr("y",u).attr("width",s).attr("height",o),Pr(e,h),e.intersect=function(d){return Tr.rect(e,d)},i}C(dxt,"text");var Brn=C((t,e,r,n,i,a)=>`M${t},${e} +`),a):ai(e.label,a),u=e.isNode?"nodeLabel":"edgeLabel",h=o.append("span");h.html(l),pbe(h,e.labelStyle),h.attr("class",`${u} ${n}`),pbe(o,e.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(o.style("max-width",r+"px"),o.style("text-align","center")),o.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&o.attr("class","labelBkg");let d=o.node().getBoundingClientRect();return d.width===r&&(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",r+"px"),d=o.node().getBoundingClientRect()),s.node()}C(N1t,"addHtmlSpan");function Qj(t,e,r,n=!1){const i=t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em");return n&&i.attr("text-anchor","middle"),i}C(Qj,"createTspan");function B1t(t,e,r){const n=t.append("text"),i=Qj(n,1,e);Gj(i,r);const a=i.node().getComputedTextLength();return n.remove(),a}C(B1t,"computeWidthOfText");function $1t(t,e,r){var s;const n=t.append("text"),i=Qj(n,1,e);Gj(i,[{content:r,type:"normal"}]);const a=(s=i.node())==null?void 0:s.getBoundingClientRect();return a&&n.remove(),a}C($1t,"computeDimensionOfText");function F1t(t,e,r,n=!1,i=!1){const s=e.append("g"),o=s.insert("rect").attr("class","background").attr("style","stroke: none"),l=s.append("text").attr("y","-10.1");i&&l.attr("text-anchor","middle");let u=0;for(const h of r){const d=C(p=>B1t(s,1.1,p)<=t,"checkWidth"),f=d(h)?[h]:I1t(h,d);for(const p of f){const g=Qj(l,u,1.1,i);Gj(g,p),u++}}if(n){const h=l.node().getBBox(),d=2;return o.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),s.node()}else return l.node()}C(F1t,"createFormattedText");function gbe(t){const e=/&(amp|lt|gt);/g;return t.replace(e,(r,n)=>{switch(n){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}C(gbe,"decodeHTMLEntities");function Gj(t,e){t.text(""),e.forEach((r,n)=>{const i=t.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");n===0?i.text(gbe(r.content)):i.text(" "+gbe(r.content))})}C(Gj,"updateTextContentAndStyles");async function z1t(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,s)=>(r.push((async()=>{const o=`${a}:${s}`;return await mtn(o)?await Fy(o,void 0,{class:"label-icon"}):``})()),i));const n=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}C(z1t,"replaceIconSubstring");var Zc=C(async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,markdown:s=!0,isNode:o=!0,width:l=200,addSvgBackground:u=!1}={},h)=>{if(me.debug("XYZ createText",e,r,n,i,a,o,"addSvgBackground: ",u),a){const d=s?D1t(e,h):R1t(e),f=await z1t($y(d),h),p=e.replace(/\\\\/g,"\\"),g={isNode:o,label:io(e)?p:f,labelStyle:r.replace("fill:","color:")};return await N1t(t,g,l,i,u,h)}else{const d=$y(e.replace(//g,"
")),f=s?_1t(d.replace("
","
"),h):E1t(d),p=F1t(l,t,f,e?u:!1,!o);if(o){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Ot(p).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");Ot(p).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Ot(p).select("text").attr("style",m)}return n?Ot(p).selectAll("tspan.text-outer-tspan").classed("title-row",!0):Ot(p).selectAll("tspan.text-outer-tspan").classed("row",!0),p}},"createText");function mbe(t,e,r){if(t&&t.length){const[n,i]=e,a=Math.PI/180*r,s=Math.cos(a),o=Math.sin(a);for(const l of t){const[u,h]=l;l[0]=(u-n)*s-(h-i)*o+n,l[1]=(u-n)*o+(h-i)*s+i}}}function ern(t,e){return t[0]===e[0]&&t[1]===e[1]}function trn(t,e,r,n=1){const i=r,a=Math.max(e,.1),s=t[0]&&t[0][0]&&typeof t[0][0]=="number"?[t]:t,o=[0,0];if(i)for(const u of s)mbe(u,o,i);const l=function(u,h,d){const f=[];for(const b of u){const x=[...b];ern(x[0],x[x.length-1])||x.push([x[0][0],x[0][1]]),x.length>2&&f.push(x)}const p=[];h=Math.max(h,.1);const g=[];for(const b of f)for(let x=0;xb.yminx.ymin?1:b.xx.x?1:b.ymax===x.ymax?0:(b.ymax-x.ymax)/Math.abs(b.ymax-x.ymax)),!g.length)return p;let m=[],v=g[0].ymin,y=0;for(;m.length||g.length;){if(g.length){let b=-1;for(let x=0;xv);x++)b=x;g.splice(0,b+1).forEach(x=>{m.push({s:v,edge:x})})}if(m=m.filter(b=>!(b.edge.ymax<=v)),m.sort((b,x)=>b.edge.x===x.edge.x?0:(b.edge.x-x.edge.x)/Math.abs(b.edge.x-x.edge.x)),(d!==1||y%h==0)&&m.length>1)for(let b=0;b=m.length)break;const w=m[b].edge,A=m[x].edge;p.push([[Math.round(w.x),v],[Math.round(A.x),v]])}v+=d,m.forEach(b=>{b.edge.x=b.edge.x+d*b.edge.islope}),y++}return p}(s,a,n);if(i){for(const u of s)mbe(u,o,-i);(function(u,h,d){const f=[];u.forEach(p=>f.push(...p)),mbe(f,h,d)})(l,o,-i)}return l}function b7(t,e){var r;const n=e.hachureAngle+90;let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.round(Math.max(i,.1));let a=1;return e.roughness>=1&&(((r=e.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=i),trn(t,i,n,a||1)}class vbe{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=b7(e,r);return{type:"fillSketch",ops:this.renderLines(n,r)}}renderLines(e,r){const n=[];for(const i of e)n.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],r));return n}}function Hj(t){const e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}class rrn extends vbe{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=b7(e,Object.assign({},r,{hachureGap:n})),a=Math.PI/180*r.hachureAngle,s=[],o=.5*n*Math.cos(a),l=.5*n*Math.sin(a);for(const[u,h]of i)Hj([u,h])&&s.push([[u[0]-o,u[1]+l],[...h]],[[u[0]+o,u[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(s,r)}}}class nrn extends vbe{fillPolygons(e,r){const n=this._fillPolygons(e,r),i=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(e,i);return n.ops=n.ops.concat(a.ops),n}}let irn=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=b7(e,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(n,r)}dotsOnLines(e,r){const n=[];let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);const s=i/4;for(const o of e){const l=Hj(o),u=l/i,h=Math.ceil(u)-1,d=l-h*i,f=(o[0][0]+o[1][0])/2-i/4,p=Math.min(o[0][1],o[1][1]);for(let g=0;g{const o=Hj(s),l=Math.floor(o/(n+i)),u=(o+i-l*(n+i))/2;let h=s[0],d=s[1];h[0]>d[0]&&(h=s[1],d=s[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let p=0;p{const s=Hj(a),o=Math.round(s/(2*r));let l=a[0],u=a[1];l[0]>u[0]&&(l=a[1],u=a[0]);const h=Math.atan((u[1]-l[1])/(u[0]-l[0]));for(let d=0;dh%2?u+r:u+e);a.push({key:"C",data:l}),e=l[4],r=l[5];break}case"Q":a.push({key:"Q",data:[...o]}),e=o[2],r=o[3];break;case"q":{const l=o.map((u,h)=>h%2?u+r:u+e);a.push({key:"Q",data:l}),e=l[2],r=l[3];break}case"A":a.push({key:"A",data:[...o]}),e=o[5],r=o[6];break;case"a":e+=o[5],r+=o[6],a.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],e,r]});break;case"H":a.push({key:"H",data:[...o]}),e=o[0];break;case"h":e+=o[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...o]}),r=o[0];break;case"v":r+=o[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...o]}),e=o[2],r=o[3];break;case"s":{const l=o.map((u,h)=>h%2?u+r:u+e);a.push({key:"S",data:l}),e=l[2],r=l[3];break}case"T":a.push({key:"T",data:[...o]}),e=o[0],r=o[1];break;case"t":e+=o[0],r+=o[1],a.push({key:"T",data:[e,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=n,r=i}return a}function Q1t(t){const e=[];let r="",n=0,i=0,a=0,s=0,o=0,l=0;for(const{key:u,data:h}of t){switch(u){case"M":e.push({key:"M",data:[...h]}),[n,i]=h,[a,s]=h;break;case"C":e.push({key:"C",data:[...h]}),n=h[4],i=h[5],o=h[2],l=h[3];break;case"L":e.push({key:"L",data:[...h]}),[n,i]=h;break;case"H":n=h[0],e.push({key:"L",data:[n,i]});break;case"V":i=h[0],e.push({key:"L",data:[n,i]});break;case"S":{let d=0,f=0;r==="C"||r==="S"?(d=n+(n-o),f=i+(i-l)):(d=n,f=i),e.push({key:"C",data:[d,f,...h]}),o=h[0],l=h[1],n=h[2],i=h[3];break}case"T":{const[d,f]=h;let p=0,g=0;r==="Q"||r==="T"?(p=n+(n-o),g=i+(i-l)):(p=n,g=i);const m=n+2*(p-n)/3,v=i+2*(g-i)/3,y=d+2*(p-d)/3,b=f+2*(g-f)/3;e.push({key:"C",data:[m,v,y,b,d,f]}),o=p,l=g,n=d,i=f;break}case"Q":{const[d,f,p,g]=h,m=n+2*(d-n)/3,v=i+2*(f-i)/3,y=p+2*(d-p)/3,b=g+2*(f-g)/3;e.push({key:"C",data:[m,v,y,b,p,g]}),o=d,l=f,n=p,i=g;break}case"A":{const d=Math.abs(h[0]),f=Math.abs(h[1]),p=h[2],g=h[3],m=h[4],v=h[5],y=h[6];d===0||f===0?(e.push({key:"C",data:[n,i,v,y,v,y]}),n=v,i=y):(n!==v||i!==y)&&(G1t(n,i,v,y,d,f,p,g,m).forEach(function(b){e.push({key:"C",data:b})}),n=v,i=y);break}case"Z":e.push({key:"Z",data:[]}),n=a,i=s}r=u}return e}function x7(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function G1t(t,e,r,n,i,a,s,o,l,u){const h=(d=s,Math.PI*d/180);var d;let f=[],p=0,g=0,m=0,v=0;if(u)[p,g,m,v]=u;else{[t,e]=x7(t,e,-h),[r,n]=x7(r,n,-h);const L=(t-r)/2,R=(e-n)/2;let D=L*L/(i*i)+R*R/(a*a);D>1&&(D=Math.sqrt(D),i*=D,a*=D);const M=i*i,P=a*a,N=M*P-M*R*R-P*L*L,F=M*R*R+P*L*L,B=(o===l?-1:1)*Math.sqrt(Math.abs(N/F));m=B*i*R/a+(t+r)/2,v=B*-a*L/i+(e+n)/2,p=Math.asin(parseFloat(((e-v)/a).toFixed(9))),g=Math.asin(parseFloat(((n-v)/a).toFixed(9))),tg&&(p-=2*Math.PI),!l&&g>p&&(g-=2*Math.PI)}let y=g-p;if(Math.abs(y)>120*Math.PI/180){const L=g,R=r,D=n;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=G1t(r=m+i*Math.cos(g),n=v+a*Math.sin(g),R,D,i,a,s,0,l,[g,L,m,v])}y=g-p;const b=Math.cos(p),x=Math.sin(p),w=Math.cos(g),A=Math.sin(g),S=Math.tan(y/4),T=4/3*i*S,O=4/3*a*S,k=[t,e],E=[t+T*x,e-O*b],_=[r+T*A,n-O*w],I=[r,n];if(E[0]=2*k[0]-E[0],E[1]=2*k[1]-E[1],u)return[E,_,I].concat(f);{f=[E,_,I].concat(f);const L=[];for(let R=0;R2){const i=[];for(let a=0;a2*Math.PI&&(p=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,v=Math.min(m/2,(g-p)/2),y=J1t(v,u,h,d,f,p,g,1,l);if(!l.disableMultiStroke){const b=J1t(v,u,h,d,f,p,g,1.5,l);y.push(...b)}return s&&(o?y.push(...Xx(u,h,u+d*Math.cos(p),h+f*Math.sin(p),l),...Xx(u,h,u+d*Math.cos(g),h+f*Math.sin(g),l)):y.push({op:"lineTo",data:[u,h]},{op:"lineTo",data:[u+d*Math.cos(p),h+f*Math.sin(p)]})),{type:"path",ops:y}}function j1t(t,e){const r=Q1t(V1t(xbe(t))),n=[];let i=[0,0],a=[0,0];for(const{key:s,data:o}of r)switch(s){case"M":a=[o[0],o[1]],i=[o[0],o[1]];break;case"L":n.push(...Xx(a[0],a[1],o[0],o[1],e)),a=[o[0],o[1]];break;case"C":{const[l,u,h,d,f,p]=o;n.push(...hrn(l,u,h,d,f,p,a,e)),a=[f,p];break}case"Z":n.push(...Xx(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function Abe(t,e){const r=[];for(const n of t)if(n.length){const i=e.maxRandomnessOffset||0,a=n.length;if(a>2){r.push({op:"move",data:[n[0][0]+xn(i,e),n[0][1]+xn(i,e)]});for(let s=1;s500?.4:-.0016668*l+1.233334;let h=i.maxRandomnessOffset||0;h*h*100>o&&(h=l/10);const d=h/2,f=.2+.2*K1t(i);let p=i.bowing*i.maxRandomnessOffset*(n-e)/200,g=i.bowing*i.maxRandomnessOffset*(t-r)/200;p=xn(p,i,u),g=xn(g,i,u);const m=[],v=()=>xn(d,i,u),y=()=>xn(h,i,u),b=i.preserveVertices;return s?m.push({op:"move",data:[t+(b?0:v()),e+(b?0:v())]}):m.push({op:"move",data:[t+(b?0:xn(h,i,u)),e+(b?0:xn(h,i,u))]}),s?m.push({op:"bcurveTo",data:[p+t+(r-t)*f+v(),g+e+(n-e)*f+v(),p+t+2*(r-t)*f+v(),g+e+2*(n-e)*f+v(),r+(b?0:v()),n+(b?0:v())]}):m.push({op:"bcurveTo",data:[p+t+(r-t)*f+y(),g+e+(n-e)*f+y(),p+t+2*(r-t)*f+y(),g+e+2*(n-e)*f+y(),r+(b?0:y()),n+(b?0:y())]}),m}function jj(t,e,r){if(!t.length)return[];const n=[];n.push([t[0][0]+xn(e,r),t[0][1]+xn(e,r)]),n.push([t[0][0]+xn(e,r),t[0][1]+xn(e,r)]);for(let i=1;i3){const a=[],s=1-r.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let o=1;o+21&&i.push(o)):i.push(o),i.push(t[e+3])}else{const l=t[e+0],u=t[e+1],h=t[e+2],d=t[e+3],f=LT(l,u,.5),p=LT(u,h,.5),g=LT(h,d,.5),m=LT(f,p,.5),v=LT(p,g,.5),y=LT(m,v,.5);Tbe([l,f,m,y],0,r,i),Tbe([y,v,g,d],0,r,i)}var a,s;return i}function frn(t,e){return Zj(t,0,t.length,e)}function Zj(t,e,r,n,i){const a=i||[],s=t[e],o=t[r-1];let l=0,u=1;for(let h=e+1;hl&&(l=d,u=h)}return Math.sqrt(l)>n?(Zj(t,e,u+1,n,a),Zj(t,u,r,n,a)):(a.length||a.push(s),a.push(o)),a}function Cbe(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let a=0;a0?Zj(n,0,n.length,r):n}const Bd="none";class Jj{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,r,n){return{shape:e,sets:r||[],options:n||this.defaultOptions}}line(e,r,n,i,a){const s=this._o(a);return this._d("line",[H1t(e,r,n,i,s)],s)}rectangle(e,r,n,i,a){const s=this._o(a),o=[],l=urn(e,r,n,i,s);if(s.fill){const u=[[e,r],[e+n,r],[e+n,r+i],[e,r+i]];s.fillStyle==="solid"?o.push(Abe([u],s)):o.push(j5([u],s))}return s.stroke!==Bd&&o.push(l),this._d("rectangle",o,s)}ellipse(e,r,n,i,a){const s=this._o(a),o=[],l=Y1t(n,i,s),u=wbe(e,r,s,l);if(s.fill)if(s.fillStyle==="solid"){const h=wbe(e,r,s,l).opset;h.type="fillPath",o.push(h)}else o.push(j5([u.estimatedPoints],s));return s.stroke!==Bd&&o.push(u.opset),this._d("ellipse",o,s)}circle(e,r,n,i){const a=this.ellipse(e,r,n,n,i);return a.shape="circle",a}linearPath(e,r){const n=this._o(r);return this._d("linearPath",[Yj(e,!1,n)],n)}arc(e,r,n,i,a,s,o=!1,l){const u=this._o(l),h=[],d=q1t(e,r,n,i,a,s,o,!0,u);if(o&&u.fill)if(u.fillStyle==="solid"){const f=Object.assign({},u);f.disableMultiStroke=!0;const p=q1t(e,r,n,i,a,s,!0,!1,f);p.type="fillPath",h.push(p)}else h.push(function(f,p,g,m,v,y,b){const x=f,w=p;let A=Math.abs(g/2),S=Math.abs(m/2);A+=xn(.01*A,b),S+=xn(.01*S,b);let T=v,O=y;for(;T<0;)T+=2*Math.PI,O+=2*Math.PI;O-T>2*Math.PI&&(T=0,O=2*Math.PI);const k=(O-T)/b.curveStepCount,E=[];for(let _=T;_<=O;_+=k)E.push([x+A*Math.cos(_),w+S*Math.sin(_)]);return E.push([x+A*Math.cos(O),w+S*Math.sin(O)]),E.push([x,w]),j5([E],b)}(e,r,n,i,a,s,u));return u.stroke!==Bd&&h.push(d),this._d("arc",h,u)}curve(e,r){const n=this._o(r),i=[],a=W1t(e,n);if(n.fill&&n.fill!==Bd)if(n.fillStyle==="solid"){const s=W1t(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{const s=[],o=e;if(o.length){const l=typeof o[0][0]=="number"?[o]:o;for(const u of l)u.length<3?s.push(...u):u.length===3?s.push(...Cbe(ebt([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):s.push(...Cbe(ebt(u),10,(1+n.roughness)/2))}s.length&&i.push(j5([s],n))}return n.stroke!==Bd&&i.push(a),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],a=Yj(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(Abe([e],n)):i.push(j5([e],n))),n.stroke!==Bd&&i.push(a),this._d("polygon",i,n)}path(e,r){const n=this._o(r),i=[];if(!e)return this._d("path",i,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const a=n.fill&&n.fill!=="transparent"&&n.fill!==Bd,s=n.stroke!==Bd,o=!!(n.simplification&&n.simplification<1),l=function(h,d,f){const p=Q1t(V1t(xbe(h))),g=[];let m=[],v=[0,0],y=[];const b=()=>{y.length>=4&&m.push(...Cbe(y,d)),y=[]},x=()=>{b(),m.length&&(g.push(m),m=[])};for(const{key:A,data:S}of p)switch(A){case"M":x(),v=[S[0],S[1]],m.push(v);break;case"L":b(),m.push([S[0],S[1]]);break;case"C":if(!y.length){const T=m.length?m[m.length-1]:v;y.push([T[0],T[1]])}y.push([S[0],S[1]]),y.push([S[2],S[3]]),y.push([S[4],S[5]]);break;case"Z":b(),m.push([v[0],v[1]])}if(x(),!f)return g;const w=[];for(const A of g){const S=frn(A,f);S.length&&w.push(S)}return w}(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),u=j1t(e,n);if(a)if(n.fillStyle==="solid")if(l.length===1){const h=j1t(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else i.push(Abe(l,n));else i.push(j5(l,n));return s&&(o?l.forEach(h=>{i.push(Yj(h,!1,n))}):i.push(u)),this._d("path",i,n)}opsToPath(e,r){let n="";for(const i of e.ops){const a=typeof r=="number"&&r>=0?i.data.map(s=>+s.toFixed(r)):i.data;switch(i.op){case"move":n+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":n+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":n+=`L${a[0]} ${a[1]} `}}return n.trim()}toPaths(e){const r=e.sets||[],n=e.options||this.defaultOptions,i=[];for(const a of r){let s=null;switch(a.type){case"path":s={d:this.opsToPath(a),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Bd};break;case"fillPath":s={d:this.opsToPath(a),stroke:Bd,strokeWidth:0,fill:n.fill||Bd};break;case"fillSketch":s=this.fillSketch(a,n)}s&&i.push(s)}return i}fillSketch(e,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(e),stroke:r.fill||Bd,strokeWidth:n,fill:Bd}}_mergedShape(e){return e.filter((r,n)=>n===0||r.op!=="move")}}class prn{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new Jj(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.ctx,a=e.options.fixedDecimalPlaceDigits;for(const s of r)switch(s.type){case"path":i.save(),i.strokeStyle=n.stroke==="none"?"transparent":n.stroke,i.lineWidth=n.strokeWidth,n.strokeLineDash&&i.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(i.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(i,s,a),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";const o=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,s,a,o),i.restore();break}case"fillSketch":this.fillSketch(i,s,n)}}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=i,this._drawToContext(e,r,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,r,n,i="nonzero"){e.beginPath();for(const a of r.ops){const s=typeof n=="number"&&n>=0?a.data.map(o=>+o.toFixed(n)):a.data;switch(a.op){case"move":e.moveTo(s[0],s[1]);break;case"bcurveTo":e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":e.lineTo(s[0],s[1])}}r.type==="fillPath"?e.fill(i):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,r,n,i,a){const s=this.gen.line(e,r,n,i,a);return this.draw(s),s}rectangle(e,r,n,i,a){const s=this.gen.rectangle(e,r,n,i,a);return this.draw(s),s}ellipse(e,r,n,i,a){const s=this.gen.ellipse(e,r,n,i,a);return this.draw(s),s}circle(e,r,n,i){const a=this.gen.circle(e,r,n,i);return this.draw(a),a}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n),n}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n),n}arc(e,r,n,i,a,s,o=!1,l){const u=this.gen.arc(e,r,n,i,a,s,o,l);return this.draw(u),u}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n),n}path(e,r){const n=this.gen.path(e,r);return this.draw(n),n}}const eX="http://www.w3.org/2000/svg";class grn{constructor(e,r){this.svg=e,this.gen=new Jj(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(eX,"g"),s=e.options.fixedDecimalPlaceDigits;for(const o of r){let l=null;switch(o.type){case"path":l=i.createElementNS(eX,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke",n.stroke),l.setAttribute("stroke-width",n.strokeWidth+""),l.setAttribute("fill","none"),n.strokeLineDash&&l.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":l=i.createElementNS(eX,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",n.fill||""),e.shape!=="curve"&&e.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(i,o,n)}l&&a.appendChild(l)}return a}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);const a=e.createElementNS(eX,"path");return a.setAttribute("d",this.opsToPath(r,n.fixedDecimalPlaceDigits)),a.setAttribute("stroke",n.fill||""),a.setAttribute("stroke-width",i+""),a.setAttribute("fill","none"),n.fillLineDash&&a.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,r){return this.gen.opsToPath(e,r)}line(e,r,n,i,a){const s=this.gen.line(e,r,n,i,a);return this.draw(s)}rectangle(e,r,n,i,a){const s=this.gen.rectangle(e,r,n,i,a);return this.draw(s)}ellipse(e,r,n,i,a){const s=this.gen.ellipse(e,r,n,i,a);return this.draw(s)}circle(e,r,n,i){const a=this.gen.circle(e,r,n,i);return this.draw(a)}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n)}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n)}arc(e,r,n,i,a,s,o=!1,l){const u=this.gen.arc(e,r,n,i,a,s,o,l);return this.draw(u)}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n)}path(e,r){const n=this.gen.path(e,r);return this.draw(n)}}var Er={canvas:(t,e)=>new prn(t,e),svg:(t,e)=>new grn(t,e),generator:t=>new Jj(t),newSeed:()=>Jj.newSeed()},pn=C(async(t,e,r)=>{var p,g;let n;const i=e.useHtmlLabels||Xm((p=He())==null?void 0:p.htmlLabels);r?n=r:n="node default";const a=t.insert("g").attr("class",n).attr("id",e.domId||e.id),s=a.insert("g").attr("class","label").attr("style",_l(e.labelStyle));let o;e.label===void 0?o="":o=typeof e.label=="string"?e.label:e.label[0];const l=!!e.icon||!!e.img,u=e.labelType==="markdown",h=await Zc(s,ai($y(o),He()),{useHtmlLabels:i,width:e.width||((g=He().flowchart)==null?void 0:g.wrappingWidth),classes:u?"markdown-node-label":"",style:e.labelStyle,addSvgBackground:l,markdown:u},He());let d=h.getBBox();const f=((e==null?void 0:e.padding)??0)/2;if(i){const m=h.children[0],v=Ot(h);await J1e(m,o),d=m.getBoundingClientRect(),v.attr("width",d.width),v.attr("height",d.height)}return i?s.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):s.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&s.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:a,bbox:d,halfPadding:f,label:s}},"labelHelper"),Obe=C(async(t,e,r)=>{var l,u;const n=r.useHtmlLabels??Zi(He()),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await Zc(i,ai($y(e),He()),{useHtmlLabels:n,width:r.width||((u=(l=He())==null?void 0:l.flowchart)==null?void 0:u.wrappingWidth),style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let s=a.getBBox();const o=r.padding/2;if(Zi(He())){const h=a.children[0],d=Ot(a);s=h.getBoundingClientRect(),d.attr("width",s.width),d.attr("height",s.height)}return n?i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):i.attr("transform","translate(0, "+-s.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:t,bbox:s,halfPadding:o,label:i}},"insertLabel"),Pr=C((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),rn=C((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function Ti(t){const e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}C(Ti,"createPathFromPoints");function Kx(t,e,r,n,i,a){const s=[],l=r-t,u=n-e,h=l/a,d=2*Math.PI/h,f=e+u/2;for(let p=0;p<=50;p++){const g=p/50,m=t+g*l,v=f+i*Math.sin(d*(m-t));s.push({x:m,y:v})}return s}C(Kx,"generateFullSineWavePoints");function A7(t,e,r,n,i,a){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dl.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),n=e.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",n);const i=e.find(l=>l.getAttribute("fill")!=="none"),a=e.find(l=>l.getAttribute("stroke")!=="none"),s=C((l,u)=>(l==null?void 0:l.getAttribute(u))??void 0,"getAttr");if(i){const l={fill:s(i,"fill"),"fill-opacity":s(i,"fill-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}if(a){const l={stroke:s(a,"stroke"),"stroke-width":s(a,"stroke-width")??"1","stroke-opacity":s(a,"stroke-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}const o=document.createElementNS("http://www.w3.org/2000/svg","g");return o.appendChild(r),o}C(kbe,"mergePaths");var mrn=C((t,e)=>{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),MT=mrn,vrn=C(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=He(),o=Zi(s);return await Zc(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),Zx=vrn,Jx=C((t,e,r,n,i)=>["M",t+i,e,"H",t+r-i,"A",i,i,0,0,1,t+r,e+i,"V",e+n-i,"A",i,i,0,0,1,t+r-i,e+n,"H",t+i,"A",i,i,0,0,1,t,e+n-i,"V",e+i,"A",i,i,0,0,1,t+i,e,"Z"].join(" "),"createRoundedRectPathD"),yrn=C(async(t,e)=>{const r=He(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,o=s,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:d}=Or(e),f=t.insert("g").attr("class","cluster swimlane "+(e.cssClasses||"")).attr("id",e.id).attr("data-id",e.id).attr("data-et","cluster").attr("data-look",e.look),p=Xm(r.flowchart.htmlLabels),g=e.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),v=await Zc(m,e.label,{style:e.labelStyle,useHtmlLabels:p,isNode:!0,width:e.width});let y=v.getBBox();if(p){const L=v.children[0],R=Ot(v);y=L.getBoundingClientRect(),R.attr("width",y.width),R.attr("height",y.height)}const b=e.padding??0,x=e.width<=y.width+b?y.width+b:e.width;e.width<=y.width+b?e.diff=(x-e.width)/2-b:e.diff=-b;const w=e.height,A=e.y-w/2,S=e.y+w/2,T=e.x-x/2,O=e.swimlaneContentTop!==void 0?e.swimlaneContentTop:A+w/3,k=g?4:0,E=y.height+2*k;let _,I;if(g){const L=Math.max(E,y.height+2*k),R=T+L,D=Math.max(0,x-L);if(e.look==="handDrawn"){const N=Er.svg(f),F=_r(e,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),B=_r(e,{roughness:.7,fill:"none",stroke:o,seed:i}),V=N.rectangle(T,A,L,w,F);_=f.insert(()=>V,":first-child");const z=N.rectangle(R,A,D,w,B);I=f.insert(()=>z,":first-child"),_.select("path:nth-child(2)").attr("style",h.join(";")),_.select("path").attr("style",d.join(";").replace("fill","stroke"))}else _=f.insert("rect",":first-child"),I=f.insert("rect",":first-child"),_.attr("class","swimlane-title").attr("style",u).attr("x",T).attr("y",A).attr("width",L).attr("height",w).attr("fill",a).attr("stroke",o),I.attr("class","swimlane-body").attr("style",u).attr("x",R).attr("y",A).attr("width",D).attr("height",w).attr("fill","none").attr("stroke",o);const M=T+L/2,P=e.y;m.attr("transform",`translate(${M}, ${P}) rotate(-90) translate(${-y.width/2}, ${-y.height/2})`)}else{const L=Math.max(0,O-A),R=Math.min(E,L),D=A+R,M=Math.max(0,S-D),P=e.x-x/2;if(e.look==="handDrawn"){const B=Er.svg(f),V=_r(e,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),z=_r(e,{roughness:.7,fill:"none",stroke:o,seed:i}),U=B.rectangle(P,A,x,R,V);_=f.insert(()=>U,":first-child");const Q=B.rectangle(P,D,x,M,z);I=f.insert(()=>Q,":first-child"),_.select("path:nth-child(2)").attr("style",h.join(";")),_.select("path").attr("style",d.join(";").replace("fill","stroke"))}else _=f.insert("rect",":first-child"),I=f.insert("rect",":first-child"),_.attr("class","swimlane-title").attr("style",u).attr("x",P).attr("y",A).attr("width",x).attr("height",R).attr("fill",a).attr("stroke",o),I.attr("class","swimlane-body").attr("style",u).attr("x",P).attr("y",D).attr("width",x).attr("height",M).attr("fill","none").attr("stroke",o);const N=e.x-y.width/2,F=A+(R-y.height)/2;m.attr("transform",`translate(${N}, ${F})`)}if(me.trace("Swimlane data ",e,JSON.stringify(e)),l){const L=m.select("span");L&&L.attr("style",l)}return e.offsetX=0,e.width=x,e.height=w,e.offsetY=y.height-b/2,e.intersect=function(L){return MT(e,L)},{cluster:f,labelBBox:y}},"swimlane"),tbt=C(async(t,e)=>{me.info("Creating subgraph rect for ",e.id,e);const r=He(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=Or(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=Zi(r),p=d.insert("g").attr("class","cluster-label ");let g;e.labelType==="markdown"?g=await Zc(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width}):g=await Zx(p,e.label,e.labelStyle||"",!1,!0);let m=g.getBBox();if(Zi(r)){const T=g.children[0],O=Ot(g);m=T.getBoundingClientRect(),O.attr("width",m.width),O.attr("height",m.height)}const v=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(v-e.width)/2-e.padding:e.diff=-e.padding;const y=e.height,b=e.x-v/2,x=e.y-y/2;me.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const T=Er.svg(d),O=_r(e,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),k=T.path(Jx(b,x,v,y,0),O);w=d.insert(()=>(me.debug("Rough node insert CXC",k),k),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",b).attr("y",x).attr("width",v).attr("height",y);const{subGraphTitleTopMargin:A}=q5(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+A})`),o){const T=p.select("span");T&&T.attr("style",o)}const S=w.node().getBBox();return e.offsetX=0,e.width=S.width,e.height=S.height,e.offsetY=m.height-e.padding/2,e.intersect=function(T){return MT(e,T)},{cluster:d,labelBBox:m}},"rect"),brn=C((t,e)=>{const r=t.insert("g").attr("class","note-cluster").attr("id",e.domId),n=r.insert("rect",":first-child"),i=0*e.padding,a=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2-a).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");const s=n.node().getBBox();return e.width=s.width,e.height=s.height,e.intersect=function(o){return MT(e,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),xrn=C(async(t,e)=>{const r=He(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:a,compositeBackground:s,compositeTitleBackground:o,nodeBorder:l}=n,u=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-id",e.id).attr("data-look",e.look),h=u.insert("g",":first-child"),d=u.insert("g").attr("class","cluster-label");let f=u.append("rect");const p=await Zx(d,e.label,e.labelStyle,void 0,!0);let g=p.getBBox();if(Zi(r)){const k=p.children[0],E=Ot(p);g=k.getBoundingClientRect(),E.attr("width",g.width),E.attr("height",g.height)}const m=0*e.padding,v=m/2,y=(e.width<=g.width+e.padding?g.width+e.padding:e.width)+m;e.width<=g.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const b=e.height+m,x=e.height+m-g.height-6,w=e.x-y/2,A=e.y-b/2;e.width=y;const S=e.y-e.height/2-v+g.height+2;let T;if(e.look==="handDrawn"){const k=e.cssClasses.includes("statediagram-cluster-alt"),E=Er.svg(u),_=e.rx||e.ry?E.path(Jx(w,A,y,b,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:i}):E.rectangle(w,A,y,b,{seed:i});T=u.insert(()=>_,":first-child");const I=E.rectangle(w,S,y,x,{fill:k?a:s,fillStyle:k?"hachure":"solid",stroke:l,seed:i});T=u.insert(()=>_,":first-child"),f=u.insert(()=>I)}else T=h.insert("rect",":first-child"),T.attr("class","outer").attr("x",w).attr("y",A).attr("width",y).attr("height",b).attr("data-look",e.look),f.attr("class","inner").attr("x",w).attr("y",S).attr("width",y).attr("height",x);d.attr("transform",`translate(${e.x-g.width/2}, ${A+1-(Zi(r)?0:3)})`);const O=T.node().getBBox();return e.height=O.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(k){return MT(e,k)},{cluster:u,labelBBox:g}},"roundedWithTitle"),wrn=C(async(t,e)=>{me.info("Creating subgraph rect for ",e.id,e);const r=He(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=Or(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=Zi(r),p=d.insert("g").attr("class","cluster-label "),g=await Zc(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width});let m=g.getBBox();if(Zi(r)){const T=g.children[0],O=Ot(g);m=T.getBoundingClientRect(),O.attr("width",m.width),O.attr("height",m.height)}const v=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(v-e.width)/2-e.padding:e.diff=-e.padding;const y=e.height,b=e.x-v/2,x=e.y-y/2;me.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const T=Er.svg(d),O=_r(e,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:i}),k=T.path(Jx(b,x,v,y,e.rx),O);w=d.insert(()=>(me.debug("Rough node insert CXC",k),k),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",b).attr("y",x).attr("width",v).attr("height",y);const{subGraphTitleTopMargin:A}=q5(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+A})`),o){const T=p.select("span");T&&T.attr("style",o)}const S=w.node().getBBox();return e.offsetX=0,e.width=S.width,e.height=S.height,e.offsetY=m.height-e.padding/2,e.intersect=function(T){return MT(e,T)},{cluster:d,labelBBox:m}},"kanbanSection"),Arn=C((t,e)=>{const r=He(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:a}=n,s=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-look",e.look),o=s.insert("g",":first-child"),l=0*e.padding,u=e.width+l;e.diff=-e.padding;const h=e.height+l,d=e.x-u/2,f=e.y-h/2;e.width=u;let p;if(e.look==="handDrawn"){const v=Er.svg(s).rectangle(d,f,u,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});p=s.insert(()=>v,":first-child")}else{p=o.insert("rect",":first-child");let m="outer";e.look,m="divider",p.attr("class",m).attr("x",d).attr("y",f).attr("width",u).attr("height",h).attr("data-look",e.look)}const g=p.node().getBBox();return e.height=g.height,e.offsetX=0,e.offsetY=0,e.intersect=function(m){return MT(e,m)},{cluster:s,labelBBox:{}}},"divider"),Srn=tbt,Trn={rect:tbt,squareRect:Srn,roundedWithTitle:xrn,noteGroup:brn,divider:Arn,kanbanSection:wrn,swimlane:yrn},rbt=new Map,tX=C(async(t,e)=>{const r=e.shape||"rect",n=await Trn[r](t,e);return rbt.set(e.id,n),n},"insertCluster"),nbt=C(()=>{rbt=new Map},"clear");function ibt(t,e){return t.intersect(e)}C(ibt,"intersectNode");var Crn=ibt;function abt(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x0}C(Ebe,"sameSign");var krn=lbt;function cbt(t,e,r){let n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(h){s=Math.min(s,h.x),o=Math.min(o,h.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));let l=n-t.width/2-s,u=i-t.height/2-o;for(let h=0;h1&&a.sort(function(h,d){let f=h.x-r.x,p=h.y-r.y,g=Math.sqrt(f*f+p*p),m=d.x-r.x,v=d.y-r.y,y=Math.sqrt(m*m+v*v);return gh,":first-child");return d.attr("class","anchor").attr("style",_l(o)),Pr(e,d),e.intersect=function(f){return me.info("Circle intersect",e,s,f),Sr.circle(e,s,f)},a}C(ubt,"anchor");function _be(t,e,r,n,i,a,s){const l=(t+r)/2,u=(e+n)/2,h=Math.atan2(n-e,r-t),d=(r-t)/2,f=(n-e)/2,p=d/i,g=f/a,m=Math.sqrt(p**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const v=Math.sqrt(1-m**2),y=l+v*a*Math.sin(h)*(s?-1:1),b=u-v*i*Math.cos(h)*(s?-1:1),x=Math.atan2((e-b)/a,(t-y)/i);let A=Math.atan2((n-b)/a,(r-y)/i)-x;s&&A<0&&(A+=2*Math.PI),!s&&A>0&&(A-=2*Math.PI);const S=[];for(let T=0;T<20;T++){const O=T/19,k=x+O*A,E=y+i*Math.cos(k),_=b+a*Math.sin(k);S.push({x:E,y:_})}return S}C(_be,"generateArcPoints");function hbt(t,e,r){const[n,i]=[e,r].sort((a,s)=>s-a);return i*(1-Math.sqrt(1-(t/n/2)**2))}C(hbt,"calculateArcSagitta");async function dbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=C(k=>k+s,"calcTotalHeight"),l=C(k=>{const E=k/2;return[E/(2.5+k/50),E]},"calcEllipseRadius"),{shapeSvg:u,bbox:h}=await pn(t,e,rn(e)),d=o(e!=null&&e.height?e==null?void 0:e.height:h.height),[f,p]=l(d),g=hbt(d,f,p),v=(e!=null&&e.width?e==null?void 0:e.width:h.width)+a*2+g-g,y=d,{cssStyles:b}=e,x=[{x:v/2,y:-y/2},{x:-v/2,y:-y/2},..._be(-v/2,-y/2,-v/2,y/2,f,p,!1),{x:v/2,y:y/2},..._be(v/2,y/2,v/2,-y/2,f,p,!0)],w=Er.svg(u),A=_r(e,{});e.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");const S=Ti(x),T=w.path(S,A),O=u.insert(()=>T,":first-child");return O.attr("class","basic label-container outer-path"),b&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",b),n&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",n),O.attr("transform",`translate(${f/2}, 0)`),Pr(e,O),e.intersect=function(k){return Sr.polygon(e,x,k)},u}C(dbt,"bowTieRect");function zy(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}C(zy,"insertPolygonShape");var rX=12;async function fbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?28:i,s=e.look==="neo"?24:i,{shapeSvg:o,bbox:l}=await pn(t,e,rn(e)),u=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a+rX),h=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?s*2:s),d=0,f=u,p=-h,g=0,m=[{x:d+rX,y:p},{x:f,y:p},{x:f,y:g},{x:d,y:g},{x:d,y:p+rX},{x:d+rX,y:p}];let v;const{cssStyles:y}=e;if(e.look==="handDrawn"){const b=Er.svg(o),x=_r(e,{}),w=Ti(m),A=b.path(w,x);v=o.insert(()=>A,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),y&&v.attr("style",y)}else v=zy(o,u,h,m);return n&&v.attr("style",n),Pr(e,v),e.intersect=function(b){return Sr.polygon(e,m,b)},o}C(fbt,"card");function pbt(t,e){const{nodeStyles:r}=Or(e);e.label="";const n=t.insert("g").attr("class",rn(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,a=Math.max(28,e.width??0),s=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],o=Er.svg(n),l=_r(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=Ti(s),h=o.path(u,l),d=n.insert(()=>h,":first-child");return i&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",i),r&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(f){return Sr.polygon(e,s,f)},n}C(pbt,"choice");async function Rbe(t,e,r){const{labelStyles:n,nodeStyles:i}=Or(e);e.labelStyle=n;const{shapeSvg:a,bbox:s,halfPadding:o}=await pn(t,e,rn(e)),l=16,u=(r==null?void 0:r.padding)??o,h=e.look==="neo"?s.width/2+l*2:s.width/2+u;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=Er.svg(a),g=_r(e,{}),m=p.circle(0,0,h*2,g);d=a.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",_l(f))}else d=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0);return Pr(e,d),e.calcIntersect=function(p,g){const m=p.width/2;return Sr.circle(p,m,g)},e.intersect=function(p){return me.info("Circle intersect",e,h,p),Sr.circle(e,h,p)},a}C(Rbe,"circle");function gbt(t){const e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=t*2,i={x:n/2*e,y:n/2*r},a={x:-(n/2)*e,y:n/2*r},s={x:-(n/2)*e,y:-(n/2)*r},o={x:n/2*e,y:-(n/2)*r};return`M ${a.x},${a.y} L ${o.x},${o.y} + M ${i.x},${i.y} L ${s.x},${s.y}`}C(gbt,"createLine");function mbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r,e.label="";const i=t.insert("g").attr("class",rn(e)).attr("id",e.domId??e.id),a=Math.max(30,(e==null?void 0:e.width)??0),{cssStyles:s}=e,o=Er.svg(i),l=_r(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=o.circle(0,0,a*2,l),h=gbt(a),d=o.path(h,l),f=i.insert(()=>u,":first-child");return f.insert(()=>d),f.attr("class","outer-path"),s&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",s),n&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",n),Pr(e,f),e.intersect=function(p){return me.info("crossedCircle intersect",e,{radius:a,point:p}),Sr.circle(e,a,p)},i}C(mbt,"crossedCircle");function Uy(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dA,":first-child").attr("stroke-opacity",0),S.insert(()=>x,":first-child"),S.attr("class","text"),f&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${d}, 0)`),s.attr("transform",`translate(${-u/2+d-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Pr(e,S),e.intersect=function(T){return Sr.polygon(e,g,T)},i}C(vbt,"curlyBraceLeft");function Vy(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dA,":first-child").attr("stroke-opacity",0),S.insert(()=>x,":first-child"),S.attr("class","text"),f&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${-d}, 0)`),s.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Pr(e,S),e.intersect=function(T){return Sr.polygon(e,g,T)},i}C(ybt,"curlyBraceRight");function cc(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dk,":first-child").attr("stroke-opacity",0),E.insert(()=>w,":first-child"),E.insert(()=>T,":first-child"),E.attr("class","text"),f&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(${d-d/4}, 0)`),s.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Pr(e,E),e.intersect=function(_){return Sr.polygon(e,m,_)},i}C(bbt,"curlyBraces");async function xbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=20,l=5,{shapeSvg:u,bbox:h}=await pn(t,e,rn(e)),d=Math.max(o,(h.width+a*2)*1.25,(e==null?void 0:e.width)??0),f=Math.max(l,h.height+s*2,(e==null?void 0:e.height)??0),p=f/2,{cssStyles:g}=e,m=Er.svg(u),v=_r(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const y=d,b=f,x=y-p,w=b/4,A=[{x,y:0},{x:w,y:0},{x:0,y:b/2},{x:w,y:b},{x,y:b},...A7(-x,-b/2,p,50,270,90)],S=Ti(A),T=m.path(S,v),O=u.insert(()=>T,":first-child");return O.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&O.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&O.selectChildren("path").attr("style",n),O.attr("transform",`translate(${-d/2}, ${-f/2})`),Pr(e,O),e.intersect=function(k){return Sr.polygon(e,A,k)},u}C(xbt,"curvedTrapezoid");var _rn=C((t,e,r,n,i,a)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),Rrn=C((t,e,r,n,i,a)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),Drn=C((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),wbt=8,Abt=8;async function Sbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?24:i,s=e.look==="neo"?24:i;if(e.width||e.height){const v=e.width??0;e.width=(e.width??0)-s,e.widthA,":first-child"),g=o.insert(()=>w,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const v=_rn(0,0,h,p,d,f);g=o.insert("path",":first-child").attr("d",v).attr("class","basic label-container outer-path").attr("style",_l(m)).attr("style",n)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),Pr(e,g),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(e.padding??0)/1.5-(l.y-(l.top??0))})`),e.intersect=function(v){const y=Sr.rect(e,v),b=y.x-(e.x??0);if(d!=0&&(Math.abs(b)<(e.width??0)/2||Math.abs(b)==(e.width??0)/2&&Math.abs(y.y-(e.y??0))>(e.height??0)/2-f)){let x=f*f*(1-b*b/(d*d));x>0&&(x=Math.sqrt(x)),x=f-x,v.y-(e.y??0)>0&&(x=-x),y.y+=x}return y},o}C(Sbt,"cylinder");async function X5(t,e,r){const{labelStyles:n,nodeStyles:i}=Or(e);e.labelStyle=n;const{shapeSvg:a,bbox:s}=await pn(t,e,rn(e)),o=Math.max(s.width+r.labelPaddingX*2,(e==null?void 0:e.width)||0),l=Math.max(s.height+r.labelPaddingY*2,(e==null?void 0:e.height)||0),u=-o/2,h=-l/2;let d,{rx:f,ry:p}=e;const{cssStyles:g}=e;if(r!=null&&r.rx&&r.ry&&(f=r.rx,p=r.ry),e.look==="handDrawn"){const m=Er.svg(a),v=_r(e,{}),y=f||p?m.path(Jx(u,h,o,l,f||0),v):m.rectangle(u,h,o,l,v);d=a.insert(()=>y,":first-child"),d.attr("class","basic label-container").attr("style",_l(g))}else d=a.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",i).attr("rx",_l(f)).attr("ry",_l(p)).attr("x",u).attr("y",h).attr("width",o).attr("height",l);return Pr(e,d),e.calcIntersect=function(m,v){return Sr.rect(m,v)},e.intersect=function(m){return Sr.rect(e,m)},a}C(X5,"drawRect");async function Tbt(t,e){const{cssClasses:r,labelPaddingX:n,labelPaddingY:i,padding:a,width:s,height:o}=e,l={rx:0,ry:0,labelPaddingX:n??(a??0)*2,labelPaddingY:i??a??0},u=await X5(t,e,l);if(e.look==="handDrawn"){const p=Er.svg(u),g=_r(e,{}),m=u.select(".basic.label-container > path:nth-child(2)"),v=m.node();if(!v)return u;let y=null;if(v instanceof SVGGraphicsElement)y=v.getBBox();else return u;return u.insert(()=>p.line(y.x,y.y,y.x+y.width,y.y,g),".basic.label-container g.label"),u.insert(()=>p.line(y.x,y.y+y.height,y.x+y.width,y.y+y.height,g),".basic.label-container g.label"),m.remove(),u}const h=u.select(".basic.label-container"),d=(Number(h.attr("width"))||s)??0,f=(Number(h.attr("height"))||o)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),u}C(Tbt,"datastore");async function Cbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?16:e.padding??0,{shapeSvg:s,bbox:o,label:l}=await pn(t,e,rn(e)),u=o.width+i,h=o.height+a,d=h*.2,f=-u/2,p=-h/2-d/2,{cssStyles:g}=e,m=Er.svg(s),v=_r(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const y=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],b=m.polygon(y.map(w=>[w.x,w.y]),v),x=s.insert(()=>b,":first-child");return x.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",n),l.attr("transform",`translate(${f+(e.padding??0)/2-(o.x-(o.left??0))}, ${p+d+(e.padding??0)/2-(o.y-(o.top??0))})`),Pr(e,x),e.intersect=function(w){return Sr.rect(e,w)},s}C(Cbt,"dividedRectangle");async function Obt(t,e){var p,g;const{labelStyles:r,nodeStyles:n}=Or(e),i=e.look==="neo"?12:5;e.labelStyle=r;const a=e.padding??0,s=e.look==="neo"?16:a,{shapeSvg:o,bbox:l}=await pn(t,e,rn(e)),u=(e!=null&&e.width?(e==null?void 0:e.width)/2:l.width/2)+(s??0),h=u-i;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const m=Er.svg(o),v=_r(e,{roughness:.2,strokeWidth:2.5}),y=_r(e,{roughness:.2,strokeWidth:1.5}),b=m.circle(0,0,u*2,v),x=m.circle(0,0,h*2,y);d=o.insert("g",":first-child"),d.attr("class",_l(e.cssClasses)).attr("style",_l(f)),(p=d.node())==null||p.appendChild(b),(g=d.node())==null||g.appendChild(x)}else{d=o.insert("g",":first-child");const m=d.insert("circle",":first-child"),v=d.insert("circle");d.attr("class","basic label-container").attr("style",n),m.attr("class","outer-circle").attr("style",n).attr("r",u).attr("cx",0).attr("cy",0),v.attr("class","inner-circle").attr("style",n).attr("r",h).attr("cx",0).attr("cy",0)}return Pr(e,d),e.intersect=function(m){return me.info("DoubleCircle intersect",e,u,m),Sr.circle(e,u,m)},o}C(Obt,"doublecircle");function kbt(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Or(e);e.label="",e.labelStyle=n;const a=t.insert("g").attr("class",rn(e)).attr("id",e.domId??e.id),s=7,{cssStyles:o}=e,l=Er.svg(a),{nodeBorder:u}=r,h=_r(e,{fillStyle:"solid"});e.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,s*2,h),f=a.insert(()=>d,":first-child");return f.selectAll("path").attr("style",`fill: ${u} !important;`),o&&o.length>0&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",o),i&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",i),Pr(e,f),e.intersect=function(p){return me.info("filledCircle intersect",e,{radius:s,point:p}),Sr.circle(e,s,p)},a}C(kbt,"filledCircle");var Ebt=10,_bt=10;async function Rbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.height=(e==null?void 0:e.height)??0,e.heighty,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),e.width=u,e.height=h,Pr(e,b),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-h/2+(e.padding??0)/2+(o.y-(o.top??0))})`),e.intersect=function(x){return me.info("Triangle intersect",e,f,x),Sr.polygon(e,f,x)},s}C(Rbt,"flippedTriangle");function Dbt(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:a}=Or(e);e.label="";const s=t.insert("g").attr("class",rn(e)).attr("id",e.domId??e.id),{cssStyles:o}=e;let l=Math.max(70,(e==null?void 0:e.width)??0),u=Math.max(10,(e==null?void 0:e.height)??0);r==="LR"&&(l=Math.max(10,(e==null?void 0:e.width)??0),u=Math.max(70,(e==null?void 0:e.height)??0));const h=-1*l/2,d=-1*u/2,f=Er.svg(s),p=_r(e,{stroke:i.lineColor,fill:i.lineColor});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=f.rectangle(h,d,l,u,p),m=s.insert(()=>g,":first-child");o&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",o),a&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",a),Pr(e,m);const v=(n==null?void 0:n.padding)??0;return e.width&&e.height&&(e.width+=v/2||0,e.height+=v/2||0),e.intersect=function(y){return Sr.rect(e,y)},s}C(Dbt,"forkJoin");async function Lbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=15,a=10,s=e.look==="neo"?16:e.padding??0,o=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.height=((e==null?void 0:e.height)??0)-o*2,e.heightb,":first-child");return x.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),Pr(e,x),e.intersect=function(w){return me.info("Pill intersect",e,{radius:f,point:w}),Sr.polygon(e,v,w)},l}C(Lbt,"halfRoundedRectangle");var Lrn=C((t,e,r,n,i)=>[`M${t+i},${e}`,`L${t+r-i},${e}`,`L${t+r},${e-n/2}`,`L${t+r-i},${e-n}`,`L${t+i},${e-n}`,`L${t},${e-n/2}`,"Z"].join(" "),"createHexagonPathD");async function Mbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e),i=e.look==="neo"?3.5:4;e.labelStyle=r;const a=e.padding??0,s=70,o=32,l=e.look==="neo"?s:a,u=e.look==="neo"?o:a;if(e.width||e.height){const x=(e.height??0)/i;e.width=((e==null?void 0:e.width)??0)-2*x-u,e.height=(e.height??0)-l}const{shapeSvg:h,bbox:d}=await pn(t,e,rn(e)),f=(e!=null&&e.height?e==null?void 0:e.height:d.height)+l,p=f/i,g=(e!=null&&e.width?e==null?void 0:e.width:d.width)+2*p+u,m=[{x:p,y:0},{x:g-p,y:0},{x:g,y:-f/2},{x:g-p,y:-f},{x:p,y:-f},{x:0,y:-f/2}];let v;const{cssStyles:y}=e;if(e.look==="handDrawn"){const b=Er.svg(h),x=_r(e,{}),w=Lrn(0,0,g,f,p),A=b.path(w,x);v=h.insert(()=>A,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),y&&v.attr("style",y)}else v=zy(h,g,f,m);return n&&v.attr("style",n),e.width=g,e.height=f,Pr(e,v),e.intersect=function(b){return Sr.polygon(e,m,b)},h}C(Mbt,"hexagon");async function Ibt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.label="",e.labelStyle=r;const{shapeSvg:i}=await pn(t,e,rn(e)),a=Math.max(30,(e==null?void 0:e.width)??0),s=Math.max(30,(e==null?void 0:e.height)??0),{cssStyles:o}=e,l=Er.svg(i),u=_r(e,{});e.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const h=[{x:0,y:0},{x:a,y:0},{x:0,y:s},{x:a,y:s}],d=Ti(h),f=l.path(d,u),p=i.insert(()=>f,":first-child");return p.attr("class","basic label-container outer-path"),o&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",o),n&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",n),p.attr("transform",`translate(${-a/2}, ${-s/2})`),Pr(e,p),e.intersect=function(g){return me.info("Pill intersect",e,{points:h}),Sr.polygon(e,h,g)},i}C(Ibt,"hourglass");async function Pbt(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Or(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await pn(t,e,"icon-shape default"),f=e.pos==="t",p=o,g=o,{nodeBorder:m}=r,{stylesMap:v}=H5(e),y=-g/2,b=-p/2,x=e.label?8:0,w=Er.svg(u),A=_r(e,{stroke:"none",fill:"none"});e.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");const S=w.rectangle(y,b,g,p,A),T=Math.max(g,h.width),O=p+h.height+x,k=w.rectangle(-T/2,-O/2,T,O,{...A,fill:"transparent",stroke:"none"}),E=u.insert(()=>S,":first-child"),_=u.insert(()=>k);if(e.icon){const I=u.append("g");I.html(`${await Fy(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const L=I.node().getBBox(),R=L.width,D=L.height,M=L.x,P=L.y;I.attr("transform",`translate(${-R/2-M},${f?h.height/2+x/2-D/2-P:-h.height/2-x/2-D/2-P})`),I.attr("style",`color: ${v.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-O/2:O/2-h.height})`),E.attr("transform",`translate(0,${f?h.height/2+x/2:-h.height/2-x/2})`),Pr(e,_),e.intersect=function(I){if(me.info("iconSquare intersect",e,I),!e.label)return Sr.rect(e,I);const L=e.x??0,R=e.y??0,D=e.height??0;let M=[];return f?M=[{x:L-h.width/2,y:R-D/2},{x:L+h.width/2,y:R-D/2},{x:L+h.width/2,y:R-D/2+h.height+x},{x:L+g/2,y:R-D/2+h.height+x},{x:L+g/2,y:R+D/2},{x:L-g/2,y:R+D/2},{x:L-g/2,y:R-D/2+h.height+x},{x:L-h.width/2,y:R-D/2+h.height+x}]:M=[{x:L-g/2,y:R-D/2},{x:L+g/2,y:R-D/2},{x:L+g/2,y:R-D/2+p},{x:L+h.width/2,y:R-D/2+p},{x:L+h.width/2/2,y:R+D/2},{x:L-h.width/2,y:R+D/2},{x:L-h.width/2,y:R-D/2+p},{x:L-g/2,y:R-D/2+p}],Sr.polygon(e,M,I)},u}C(Pbt,"icon");async function Nbt(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Or(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await pn(t,e,"icon-shape default"),f=20,p=e.label?8:0,g=e.pos==="t",{nodeBorder:m,mainBkg:v}=r,{stylesMap:y}=H5(e),b=Er.svg(u),x=_r(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const w=y.get("fill");x.stroke=w??v;const A=u.append("g");e.icon&&A.html(`${await Fy(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const S=A.node().getBBox(),T=S.width,O=S.height,k=S.x,E=S.y,_=Math.max(T,O)*Math.SQRT2+f*2,I=b.circle(0,0,_,x),L=Math.max(_,h.width),R=_+h.height+p,D=b.rectangle(-L/2,-R/2,L,R,{...x,fill:"transparent",stroke:"none"}),M=u.insert(()=>I,":first-child"),P=u.insert(()=>D);return A.attr("transform",`translate(${-T/2-k},${g?h.height/2+p/2-O/2-E:-h.height/2-p/2-O/2-E})`),A.attr("style",`color: ${y.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-R/2:R/2-h.height})`),M.attr("transform",`translate(0,${g?h.height/2+p/2:-h.height/2-p/2})`),Pr(e,P),e.intersect=function(N){return me.info("iconSquare intersect",e,N),Sr.rect(e,N)},u}C(Nbt,"iconCircle");async function Bbt(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Or(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await pn(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:v,mainBkg:y}=r,{stylesMap:b}=H5(e),x=-m/2,w=-g/2,A=e.label?8:0,S=Er.svg(u),T=_r(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const O=b.get("fill");T.stroke=O??y;const k=S.path(Jx(x,w,m,g,5),T),E=Math.max(m,h.width),_=g+h.height+A,I=S.rectangle(-E/2,-_/2,E,_,{...T,fill:"transparent",stroke:"none"}),L=u.insert(()=>k,":first-child").attr("class","icon-shape2"),R=u.insert(()=>I);if(e.icon){const D=u.append("g");D.html(`${await Fy(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const M=D.node().getBBox(),P=M.width,N=M.height,F=M.x,B=M.y;D.attr("transform",`translate(${-P/2-F},${p?h.height/2+A/2-N/2-B:-h.height/2-A/2-N/2-B})`),D.attr("style",`color: ${b.get("stroke")??v};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-_/2:_/2-h.height})`),L.attr("transform",`translate(0,${p?h.height/2+A/2:-h.height/2-A/2})`),Pr(e,R),e.intersect=function(D){if(me.info("iconSquare intersect",e,D),!e.label)return Sr.rect(e,D);const M=e.x??0,P=e.y??0,N=e.height??0;let F=[];return p?F=[{x:M-h.width/2,y:P-N/2},{x:M+h.width/2,y:P-N/2},{x:M+h.width/2,y:P-N/2+h.height+A},{x:M+m/2,y:P-N/2+h.height+A},{x:M+m/2,y:P+N/2},{x:M-m/2,y:P+N/2},{x:M-m/2,y:P-N/2+h.height+A},{x:M-h.width/2,y:P-N/2+h.height+A}]:F=[{x:M-m/2,y:P-N/2},{x:M+m/2,y:P-N/2},{x:M+m/2,y:P-N/2+g},{x:M+h.width/2,y:P-N/2+g},{x:M+h.width/2/2,y:P+N/2},{x:M-h.width/2,y:P+N/2},{x:M-h.width/2,y:P-N/2+g},{x:M-m/2,y:P-N/2+g}],Sr.polygon(e,F,D)},u}C(Bbt,"iconRounded");async function $bt(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Or(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await pn(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:v,mainBkg:y}=r,{stylesMap:b}=H5(e),x=-m/2,w=-g/2,A=e.label?8:0,S=Er.svg(u),T=_r(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const O=b.get("fill");T.stroke=O??y;const k=S.path(Jx(x,w,m,g,.1),T),E=Math.max(m,h.width),_=g+h.height+A,I=S.rectangle(-E/2,-_/2,E,_,{...T,fill:"transparent",stroke:"none"}),L=u.insert(()=>k,":first-child"),R=u.insert(()=>I);if(e.icon){const D=u.append("g");D.html(`${await Fy(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const M=D.node().getBBox(),P=M.width,N=M.height,F=M.x,B=M.y;D.attr("transform",`translate(${-P/2-F},${p?h.height/2+A/2-N/2-B:-h.height/2-A/2-N/2-B})`),D.attr("style",`color: ${b.get("stroke")??v};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-_/2:_/2-h.height})`),L.attr("transform",`translate(0,${p?h.height/2+A/2:-h.height/2-A/2})`),Pr(e,R),e.intersect=function(D){if(me.info("iconSquare intersect",e,D),!e.label)return Sr.rect(e,D);const M=e.x??0,P=e.y??0,N=e.height??0;let F=[];return p?F=[{x:M-h.width/2,y:P-N/2},{x:M+h.width/2,y:P-N/2},{x:M+h.width/2,y:P-N/2+h.height+A},{x:M+m/2,y:P-N/2+h.height+A},{x:M+m/2,y:P+N/2},{x:M-m/2,y:P+N/2},{x:M-m/2,y:P-N/2+h.height+A},{x:M-h.width/2,y:P-N/2+h.height+A}]:F=[{x:M-m/2,y:P-N/2},{x:M+m/2,y:P-N/2},{x:M+m/2,y:P-N/2+g},{x:M+h.width/2,y:P-N/2+g},{x:M+h.width/2/2,y:P+N/2},{x:M-h.width/2,y:P+N/2},{x:M-h.width/2,y:P-N/2+g},{x:M-m/2,y:P-N/2+g}],Sr.polygon(e,F,D)},u}C($bt,"iconSquare");async function Fbt(t,e,{config:{flowchart:r}}){const n=new Image;n.src=(e==null?void 0:e.img)??"",await n.decode();const i=Number(n.naturalWidth.toString().replace("px","")),a=Number(n.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/a;const{labelStyles:s}=Or(e);e.labelStyle=s;const o=r==null?void 0:r.wrappingWidth;e.defaultWidth=r==null?void 0:r.wrappingWidth;const l=Math.max(e.label?o??0:0,(e==null?void 0:e.assetWidth)??i),u=e.constraint==="on"&&e!=null&&e.assetHeight?e.assetHeight*e.imageAspectRatio:l,h=e.constraint==="on"?u/e.imageAspectRatio:(e==null?void 0:e.assetHeight)??a;e.width=Math.max(u,o??0);const{shapeSvg:d,bbox:f,label:p}=await pn(t,e,"image-shape default"),g=e.pos==="t",m=-u/2,v=-h/2,y=e.label?8:0,b=Er.svg(d),x=_r(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const w=b.rectangle(m,v,u,h,x),A=Math.max(u,f.width),S=h+f.height+y,T=b.rectangle(-A/2,-S/2,A,S,{...x,fill:"none",stroke:"none"}),O=d.insert(()=>w,":first-child"),k=d.insert(()=>T);if(e.img){const E=d.append("image");E.attr("href",e.img),E.attr("width",u),E.attr("height",h),E.attr("preserveAspectRatio","none"),E.attr("transform",`translate(${-u/2},${g?S/2-h:-S/2})`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-y/2:h/2-f.height/2+y/2})`),O.attr("transform",`translate(0,${g?f.height/2+y/2:-f.height/2-y/2})`),Pr(e,k),e.intersect=function(E){if(me.info("iconSquare intersect",e,E),!e.label)return Sr.rect(e,E);const _=e.x??0,I=e.y??0,L=e.height??0;let R=[];return g?R=[{x:_-f.width/2,y:I-L/2},{x:_+f.width/2,y:I-L/2},{x:_+f.width/2,y:I-L/2+f.height+y},{x:_+u/2,y:I-L/2+f.height+y},{x:_+u/2,y:I+L/2},{x:_-u/2,y:I+L/2},{x:_-u/2,y:I-L/2+f.height+y},{x:_-f.width/2,y:I-L/2+f.height+y}]:R=[{x:_-u/2,y:I-L/2},{x:_+u/2,y:I-L/2},{x:_+u/2,y:I-L/2+h},{x:_+f.width/2,y:I-L/2+h},{x:_+f.width/2/2,y:I+L/2},{x:_-f.width/2,y:I+L/2},{x:_-f.width/2,y:I-L/2+h},{x:_-u/2,y:I-L/2+h}],Sr.polygon(e,R,E)},d}C(Fbt,"imageSquare");async function zbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await pn(t,e,rn(e)),u=Math.max(l.width+(s??0)*2,(e==null?void 0:e.width)??0),h=Math.max(l.height+(a??0)*2,(e==null?void 0:e.height)??0),d=[{x:0,y:0},{x:u,y:0},{x:u+3*h/6,y:-h},{x:-3*h/6,y:-h}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Er.svg(o),m=_r(e,{}),v=Ti(d),y=g.path(v,m);f=o.insert(()=>y,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),p&&f.attr("style",p)}else f=zy(o,u,h,d);return n&&f.attr("style",n),e.width=u,e.height=h,Pr(e,f),e.intersect=function(g){return Sr.polygon(e,d,g)},o}C(zbt,"inv_trapezoid");async function Ubt(t,e){const{shapeSvg:r,bbox:n,label:i}=await pn(t,e,"label"),a=r.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),i.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),Pr(e,a),e.intersect=function(l){return Sr.rect(e,l)},r}C(Ubt,"labelRect");async function Vbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await pn(t,e,rn(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:0,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:-(3*u)/6,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Er.svg(o),m=_r(e,{}),v=Ti(d),y=g.path(v,m);f=o.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=zy(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Pr(e,f),e.intersect=function(g){return Sr.polygon(e,d,g)},o}C(Vbt,"lean_left");async function Qbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await pn(t,e,rn(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:-3*u/6,y:0},{x:h,y:0},{x:h+3*u/6,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Er.svg(o),m=_r(e,{}),v=Ti(d),y=g.path(v,m);f=o.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=zy(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Pr(e,f),e.intersect=function(g){return Sr.polygon(e,d,g)},o}C(Qbt,"lean_right");function Gbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.label="",e.labelStyle=r;const i=t.insert("g").attr("class",rn(e)).attr("id",e.domId??e.id),{cssStyles:a}=e,s=Math.max(35,(e==null?void 0:e.width)??0),o=Math.max(35,(e==null?void 0:e.height)??0),l=7,u=[{x:s,y:0},{x:0,y:o+l/2},{x:s-2*l,y:o+l/2},{x:0,y:2*o},{x:s,y:o-l/2},{x:2*l,y:o-l/2}],h=Er.svg(i),d=_r(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=Ti(u),p=h.path(f,d),g=i.insert(()=>p,":first-child");return g.attr("class","outer-path"),a&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",a),n&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",n),g.attr("transform",`translate(-${s/2},${-o})`),Pr(e,g),e.intersect=function(m){return me.info("lightningBolt intersect",e,m),Sr.polygon(e,u,m)},i}C(Gbt,"lightningBolt");var Mrn=C((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),Irn=C((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),Prn=C((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Hbt=10,Wbt=10;async function Ybt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?24:i;if(e.width||e.height){const y=e.width??0;e.width=(e.width??0)-a,e.widthS,":first-child").attr("class","line"),m=o.insert(()=>A,":first-child"),m.attr("class","basic label-container"),v&&m.attr("style",v)}else{const y=Mrn(0,0,h,p,d,f,g);m=o.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",_l(v)).attr("style",n)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),Pr(e,m),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+f-(l.y-(l.top??0))})`),e.intersect=function(y){const b=Sr.rect(e,y),x=b.x-(e.x??0);if(d!=0&&(Math.abs(x)<(e.width??0)/2||Math.abs(x)==(e.width??0)/2&&Math.abs(b.y-(e.y??0))>(e.height??0)/2-f)){let w=f*f*(1-x*x/(d*d));w>0&&(w=Math.sqrt(w)),w=f-w,y.y-(e.y??0)>0&&(w=-w),b.y+=w}return b},o}C(Ybt,"linedCylinder");async function qbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;if(e.width||e.height){const w=e.width;e.width=(w??0)*10/11-a*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-s*2,e.height<10&&(e.height=10)}const{shapeSvg:o,bbox:l,label:u}=await pn(t,e,rn(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+(a??0)*2,d=(e!=null&&e.height?e==null?void 0:e.height:l.height)+(s??0)*2,f=e.look==="neo"?d/4:d/8,p=d+f,{cssStyles:g}=e,m=Er.svg(o),v=_r(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const y=[{x:-h/2-h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:p/2},...Kx(-h/2-h/2*.1,p/2,h/2+h/2*.1,p/2,f,.8),{x:h/2+h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:-p/2},{x:-h/2,y:-p/2},{x:-h/2,y:p/2*1.1},{x:-h/2,y:-p/2}],b=m.polygon(y.map(w=>[w.x,w.y]),v),x=o.insert(()=>b,":first-child");return x.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",n),x.attr("transform",`translate(0,${-f/2})`),u.attr("transform",`translate(${-h/2+(e.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(e.padding??0)-f/2-(l.y-(l.top??0))})`),Pr(e,x),e.intersect=function(w){return Sr.polygon(e,y,w)},o}C(qbt,"linedWaveEdgedRect");async function jbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=e.look==="neo"?10:5;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-2*o,10),e.height=Math.max(((e==null?void 0:e.height)??0)-s*2-2*o,10));const{shapeSvg:l,bbox:u,label:h}=await pn(t,e,rn(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+a*2+2*o,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+s*2+2*o,p=d-2*o,g=f-2*o,m=-p/2,v=-g/2,{cssStyles:y}=e,b=Er.svg(l),x=_r(e,{}),w=[{x:m-o,y:v+o},{x:m-o,y:v+g+o},{x:m+p-o,y:v+g+o},{x:m+p-o,y:v+g},{x:m+p,y:v+g},{x:m+p,y:v+g-o},{x:m+p+o,y:v+g-o},{x:m+p+o,y:v-o},{x:m+o,y:v-o},{x:m+o,y:v},{x:m,y:v},{x:m,y:v+o}],A=[{x:m,y:v+o},{x:m+p-o,y:v+o},{x:m+p-o,y:v+g},{x:m+p,y:v+g},{x:m+p,y:v},{x:m,y:v}];e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const S=Ti(w);let T=b.path(S,x);const O=Ti(A);let k=b.path(O,x);e.look!=="handDrawn"&&(T=kbe(T),k=kbe(k));const E=l.insert("g",":first-child");return E.insert(()=>T),E.insert(()=>k),E.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",y),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),h.attr("transform",`translate(${-(u.width/2)-o-(u.x-(u.left??0))}, ${-(u.height/2)+o-(u.y-(u.top??0))})`),Pr(e,E),e.intersect=function(_){return Sr.polygon(e,w,_)},l}C(jbt,"multiRect");async function Xbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await pn(t,e,rn(e)),o=e.padding??0,l=e.look==="neo"?16:o,u=e.look==="neo"?12:o;let h=!0;(e.width||e.height)&&(h=!1,e.width=((e==null?void 0:e.width)??0)-l*2,e.height=((e==null?void 0:e.height)??0)-u*3);const d=Math.max(a.width,(e==null?void 0:e.width)??0)+l*2,f=Math.max(a.height,(e==null?void 0:e.height)??0)+u*3,p=e.look==="neo"?f/4:f/8,g=f+(h?p/2:-p/2),m=-d/2,v=-g/2,y=10,{cssStyles:b}=e,x=Kx(m-y,v+g+y,m+d-y,v+g+y,p,.8),w=x==null?void 0:x[x.length-1],A=[{x:m-y,y:v+y},{x:m-y,y:v+g+y},...x,{x:m+d-y,y:w.y-y},{x:m+d,y:w.y-y},{x:m+d,y:w.y-2*y},{x:m+d+y,y:w.y-2*y},{x:m+d+y,y:v-y},{x:m+y,y:v-y},{x:m+y,y:v},{x:m,y:v},{x:m,y:v+y}],S=[{x:m,y:v+y},{x:m+d-y,y:v+y},{x:m+d-y,y:w.y-y},{x:m+d,y:w.y-y},{x:m+d,y:v},{x:m,y:v}],T=Er.svg(i),O=_r(e,{});e.look!=="handDrawn"&&(O.roughness=0,O.fillStyle="solid");const k=Ti(A),E=T.path(k,O),_=Ti(S),I=T.path(_,O),L=i.insert(()=>E,":first-child");return L.insert(()=>I),L.attr("class","basic label-container outer-path"),b&&e.look!=="handDrawn"&&L.selectAll("path").attr("style",b),n&&e.look!=="handDrawn"&&L.selectAll("path").attr("style",n),L.attr("transform",`translate(0,${-p/2})`),s.attr("transform",`translate(${-(a.width/2)-y-(a.x-(a.left??0))}, ${-(a.height/2)+y-p/2-(a.y-(a.top??0))})`),Pr(e,L),e.intersect=function(R){return Sr.polygon(e,A,R)},i}C(Xbt,"multiWaveEdgedRectangle");async function Kbt(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Or(e);e.labelStyle=n,e.useHtmlLabels||Zi(Dr())||(e.centerLabel=!0);const{shapeSvg:s,bbox:o,label:l}=await pn(t,e,rn(e)),u=Math.max(o.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),h=Math.max(o.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),d=-u/2,f=-h/2,{cssStyles:p}=e,g=Er.svg(s),m=_r(e,{fill:r.noteBkgColor,stroke:r.noteBorderColor});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const v=g.rectangle(d,f,u,h,m),y=s.insert(()=>v,":first-child");return y.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),p&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",p),i&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",i),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Pr(e,y),e.intersect=function(b){return Sr.rect(e,b)},s}C(Kbt,"note");var Nrn=C((t,e,r)=>[`M${t+r/2},${e}`,`L${t+r},${e-r/2}`,`L${t+r/2},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function Zbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await pn(t,e,rn(e)),s=a.width+(e.padding??0),o=a.height+(e.padding??0),l=s+o,u=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=Er.svg(i),g=_r(e,{}),m=Nrn(0,0,l),v=p.path(m,g);d=i.insert(()=>v,":first-child").attr("transform",`translate(${-l/2+u}, ${l/2})`),f&&d.attr("style",f)}else d=zy(i,l,l,h),d.attr("transform",`translate(${-l/2+u}, ${l/2})`);return n&&d.attr("style",n),Pr(e,d),e.calcIntersect=function(p,g){const m=p.width,v=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],y=Sr.polygon(p,v,g);return{x:y.x-.5,y:y.y-.5}},e.intersect=function(p){return this.calcIntersect(e,p)},i}C(Zbt,"question");async function Jbt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?21:i??0,s=e.look==="neo"?12:i??0,{shapeSvg:o,bbox:l,label:u}=await pn(t,e,rn(e)),h=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a),d=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?s*2:s),f=-h/2,p=-d/2,g=p/2,m=[{x:f+g,y:p},{x:f,y:0},{x:f+g,y:-p},{x:-f,y:-p},{x:-f,y:p}],{cssStyles:v}=e,y=Er.svg(o),b=_r(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const x=Ti(m),w=y.path(x,b),A=o.insert(()=>w,":first-child");return A.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",n),A.attr("transform",`translate(${-g/2},0)`),u.attr("transform",`translate(${-g/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),Pr(e,A),e.intersect=function(S){return Sr.polygon(e,m,S)},o}C(Jbt,"rect_left_inv_arrow");async function ext(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;let i;e.cssClasses?i="node "+e.cssClasses:i="node default";const a=t.insert("g").attr("class",i).attr("id",e.domId||e.id),s=a.insert("g"),o=a.insert("g").attr("class","label").attr("style",n),l=e.description,u=e.label,h=await Zx(o,u,e.labelStyle,!0,!0);let d={width:0,height:0};if(Zi(He())){const O=h.children[0],k=Ot(h);d=O.getBoundingClientRect(),k.attr("width",d.width),k.attr("height",d.height)}me.info("Text 2",l);const f=l||[],p=h.getBBox(),g=await Zx(o,Array.isArray(f)?f.join("
"):f,e.labelStyle,!0,!0),m=g.children[0],v=Ot(g);d=m.getBoundingClientRect(),v.attr("width",d.width),v.attr("height",d.height);const y=(e.padding||0)/2;Ot(g).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+y+5)+")"),Ot(h).attr("transform","translate( "+(d.width(me.debug("Rough node insert CXC",E),_),":first-child"),S=a.insert(()=>(me.debug("Rough node insert CXC",E),E),":first-child")}else S=s.insert("rect",":first-child"),T=s.insert("line"),S.attr("class","outer title-state").attr("style",n).attr("x",-d.width/2-y).attr("y",-d.height/2-y).attr("width",d.width+(e.padding||0)).attr("height",d.height+(e.padding||0)),T.attr("class","divider").attr("x1",-d.width/2-y).attr("x2",d.width/2+y).attr("y1",-d.height/2-y+p.height+y).attr("y2",-d.height/2-y+p.height+y);return Pr(e,S),e.intersect=function(O){return Sr.rect(e,O)},a}C(ext,"rectWithTitle");async function txt(t,e,{config:{themeVariables:r}}){const n=(r==null?void 0:r.radius)??5,i={rx:n,ry:n,labelPaddingX:((e==null?void 0:e.padding)??0)*1,labelPaddingY:((e==null?void 0:e.padding)??0)*1};return X5(t,e,i)}C(txt,"roundedRect");var IT=8;async function rxt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?12:e.padding??0,{shapeSvg:s,bbox:o,label:l}=await pn(t,e,rn(e)),u=((e==null?void 0:e.width)??o.width)+i*2+(e.look==="neo"?IT:IT*2),h=((e==null?void 0:e.height)??o.height)+a*2,d=u-IT,f=h,p=IT-u/2,g=-h/2,{cssStyles:m}=e,v=Er.svg(s),y=_r(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const b=[{x:p,y:g},{x:p+d,y:g},{x:p+d,y:g+f},{x:p-IT,y:g+f},{x:p-IT,y:g},{x:p,y:g},{x:p,y:g+f}],x=v.polygon(b.map(A=>[A.x,A.y]),y),w=s.insert(()=>x,":first-child");return w.attr("class","basic label-container outer-path").attr("style",_l(m)),n&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),m&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),l.attr("transform",`translate(${IT/2-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Pr(e,w),e.intersect=function(A){return Sr.rect(e,A)},s}C(rxt,"shadedProcess");async function nxt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-a*2,10),e.height=Math.max(((e==null?void 0:e.height)??0)/1.5-s*2,10));const{shapeSvg:o,bbox:l,label:u}=await pn(t,e,rn(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2,d=((e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2)*1.5,f=h,p=d/1.5,g=-f/2,m=-p/2,{cssStyles:v}=e,y=Er.svg(o),b=_r(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const x=[{x:g,y:m},{x:g,y:m+p},{x:g+f,y:m+p},{x:g+f,y:m-p/2}],w=Ti(x),A=y.path(w,b),S=o.insert(()=>A,":first-child");return S.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",v),n&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",n),S.attr("transform",`translate(0, ${p/4})`),u.attr("transform",`translate(${-f/2+(e.padding??0)-(l.x-(l.left??0))}, ${-p/4+(e.padding??0)-(l.y-(l.top??0))})`),Pr(e,S),e.intersect=function(T){return Sr.polygon(e,x,T)},o}C(nxt,"slopedRect");async function ixt(t,e){const r=e.padding??0,n=e.look==="neo"?16:r*2,i=e.look==="neo"?12:r,a={rx:0,ry:0,labelPaddingX:e.labelPaddingX??n,labelPaddingY:i};return X5(t,e,a)}C(ixt,"squareRect");async function axt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?20:i,s=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await pn(t,e,rn(e)),u=l.height+(e.look==="neo"?s*2:s),h=l.width+u/4+(e.look==="neo"?a*2:a),d=u/2,{cssStyles:f}=e,p=Er.svg(o),g=_r(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-h/2+d,y:-u/2},{x:h/2-d,y:-u/2},...A7(-h/2+d,0,d,50,90,270),{x:h/2-d,y:u/2},...A7(h/2-d,0,d,50,270,450)],v=Ti(m),y=p.path(v,g),b=o.insert(()=>y,":first-child");return b.attr("class","basic label-container outer-path"),f&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",f),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),Pr(e,b),e.intersect=function(x){return Sr.polygon(e,m,x)},o}C(axt,"stadium");async function sxt(t,e){const r={rx:e.look==="neo"?3:5,ry:e.look==="neo"?3:5};return X5(t,e,r)}C(sxt,"state");function oxt(t,e,{config:{themeVariables:r}}){var b,x;const{labelStyles:n,nodeStyles:i}=Or(e);e.labelStyle=n;const{cssStyles:a}=e,{lineColor:s,stateBorder:o,nodeBorder:l,nodeShadow:u}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const h=t.insert("g").attr("class","node default").attr("id",e.domId??e.id),d=Er.svg(h),f=_r(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=d.circle(0,0,e.width,{...f,stroke:s,strokeWidth:2}),g=o??l,m=(e.width??0)*5/14,v=d.circle(0,0,m,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),y=h.insert(()=>p,":first-child");if(y.insert(()=>v),e.look!=="handDrawn"&&y.attr("class","outer-path"),a&&y.selectAll("path").attr("style",a),i&&y.selectAll("path").attr("style",i),e.width<25&&u&&e.look!=="handDrawn"){const w=((x=(b=t.node())==null?void 0:b.ownerSVGElement)==null?void 0:x.id)??"",A=w?`${w}-drop-shadow-small`:"drop-shadow-small";y.attr("style",`filter:url(#${A})`)}return Pr(e,y),e.intersect=function(w){return Sr.circle(e,(e.width??0)/2,w)},h}C(oxt,"stateEnd");function lxt(t,e,{config:{themeVariables:r}}){var o,l;const{lineColor:n,nodeShadow:i}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const a=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let s;if(e.look==="handDrawn"){const h=Er.svg(a).circle(0,0,e.width,fen(n));s=a.insert(()=>h),s.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14)}else s=a.insert("circle",":first-child"),s.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14);if(e.width<25&&i&&e.look!=="handDrawn"){const u=((l=(o=t.node())==null?void 0:o.ownerSVGElement)==null?void 0:l.id)??"",h=u?`${u}-drop-shadow-small`:"drop-shadow-small";s.attr("style",`filter:url(#${h})`)}return Pr(e,s),e.intersect=function(u){return Sr.circle(e,(e.width??7)/2,u)},a}C(lxt,"stateStart");var K5=8;async function cxt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=(e==null?void 0:e.padding)??8,a=e.look==="neo"?28:i,s=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await pn(t,e,rn(e)),u=((e==null?void 0:e.width)??l.width)+2*K5+a,h=((e==null?void 0:e.height)??l.height)+s,d=u-2*K5,f=h,p=-u/2,g=-h/2,m=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(e.look==="handDrawn"){const v=Er.svg(o),y=_r(e,{}),b=v.rectangle(p,g,d+16,f,y),x=v.line(p+K5,g,p+K5,g+f,y),w=v.line(p+K5+d,g,p+K5+d,g+f,y);o.insert(()=>x,":first-child"),o.insert(()=>w,":first-child");const A=o.insert(()=>b,":first-child"),{cssStyles:S}=e;A.attr("class","basic label-container").attr("style",_l(S)),Pr(e,A)}else{const v=zy(o,d,f,m);n&&v.attr("style",n),Pr(e,v)}return e.intersect=function(v){return Sr.polygon(e,m,v)},o}C(cxt,"subroutine");var Dbe=.2;async function uxt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;(e.width||e.height)&&(e.height=Math.max(((e==null?void 0:e.height)??0)-s*2,10),e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-Dbe*(e.height+s*2),10));const{shapeSvg:o,bbox:l}=await pn(t,e,rn(e)),u=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2,h=Dbe*u,d=Dbe*u,p=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2+h-h,g=u,m=-p/2,v=-g/2,{cssStyles:y}=e,b=Er.svg(o),x=_r(e,{}),w=[{x:m-h/2,y:v},{x:m+p+h/2,y:v},{x:m+p+h/2,y:v+g},{x:m-h/2,y:v+g}],A=[{x:m+p-h/2,y:v+g},{x:m+p+h/2,y:v+g},{x:m+p+h/2,y:v+g-d}];e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const S=Ti(w),T=b.path(S,x),O=Ti(A),k=b.path(O,{...x,fillStyle:"solid"}),E=o.insert(()=>k,":first-child");return E.insert(()=>T,":first-child"),E.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",y),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),Pr(e,E),e.intersect=function(_){return Sr.polygon(e,w,_)},o}C(uxt,"taggedRect");async function hxt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await pn(t,e,rn(e)),o=Math.max(a.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),l=Math.max(a.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),u=l/8,h=.2*o,d=.2*l,f=l+u,{cssStyles:p}=e,g=Er.svg(i),m=_r(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const v=[{x:-o/2-o/2*.1,y:f/2},...Kx(-o/2-o/2*.1,f/2,o/2+o/2*.1,f/2,u,.8),{x:o/2+o/2*.1,y:-f/2},{x:-o/2-o/2*.1,y:-f/2}],y=-o/2+o/2*.1,b=-f/2-d*.4,x=[{x:y+o-h,y:(b+l)*1.3},{x:y+o,y:b+l-d},{x:y+o,y:(b+l)*.9},...Kx(y+o,(b+l)*1.25,y+o-h,(b+l)*1.3,-l*.02,.5)],w=Ti(v),A=g.path(w,m),S=Ti(x),T=g.path(S,{...m,fillStyle:"solid"}),O=i.insert(()=>T,":first-child");return O.insert(()=>A,":first-child"),O.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",n),O.attr("transform",`translate(0,${-u/2})`),s.attr("transform",`translate(${-o/2+(e.padding??0)-(a.x-(a.left??0))},${-l/2+(e.padding??0)-u/2-(a.y-(a.top??0))})`),Pr(e,O),e.intersect=function(k){return Sr.polygon(e,v,k)},i}C(hxt,"taggedWaveEdgedRectangle");async function dxt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await pn(t,e,rn(e)),s=Math.max(a.width+(e.padding??0),(e==null?void 0:e.width)||0),o=Math.max(a.height+(e.padding??0),(e==null?void 0:e.height)||0),l=-s/2,u=-o/2,h=i.insert("rect",":first-child");return h.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",l).attr("y",u).attr("width",s).attr("height",o),Pr(e,h),e.intersect=function(d){return Sr.rect(e,d)},i}C(dxt,"text");var Brn=C((t,e,r,n,i,a)=>`M${t},${e} a${i},${a} 0,0,1 0,${-n} l${r},0 a${i},${a} 0,0,1 0,${n} M${r},${-n} a${i},${a} 0,0,0 0,${n} - l${-r},0`,"createCylinderPathD"),$rn=C((t,e,r,n,i,a)=>[`M${t},${e}`,`M${t+r},${e}`,`a${i},${a} 0,0,0 0,${-n}`,`l${-r},0`,`a${i},${a} 0,0,0 0,${n}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),Frn=C((t,e,r,n,i,a)=>[`M${t+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),fxt=5,pxt=10;async function gxt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?12:i/2;if(e.width||e.height){const m=e.height??0;e.height=(e.height??0)-a,e.heightx,":first-child"),g=s.insert(()=>b,":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const m=Brn(0,0,f,u,d,h);g=s.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",_l(p)).attr("style",n),g.attr("class","basic label-container outer-path"),p&&g.selectAll("path").attr("style",p),n&&g.selectAll("path").attr("style",n)}return g.attr("label-offset-x",d),g.attr("transform",`translate(${-f/2}, ${u/2} )`),l.attr("transform",`translate(${-(o.width/2)-d-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Pr(e,g),e.intersect=function(m){const v=Tr.rect(e,m),y=v.y-(e.y??0);if(h!=0&&(Math.abs(y)<(e.height??0)/2||Math.abs(y)==(e.height??0)/2&&Math.abs(v.x-(e.x??0))>(e.width??0)/2-d)){let b=d*d*(1-y*y/(h*h));b!=0&&(b=Math.sqrt(Math.abs(b))),b=d-b,m.x-(e.x??0)>0&&(b=-b),v.x+=b}return v},s}C(gxt,"tiltedCylinder");async function mxt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=(e.look==="neo",i),s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await pn(t,e,rn(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:-3*u/6,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Er.svg(o),m=_r(e,{}),v=Si(d),y=g.path(v,m);f=o.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=zy(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Pr(e,f),e.intersect=function(g){return Tr.polygon(e,d,g)},o}C(mxt,"trapezoid");async function vxt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=15,l=5;(e.width||e.height)&&(e.height=(e.height??0)-s*2,e.heightb,":first-child");return x.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),Pr(e,x),e.intersect=function(w){return Tr.polygon(e,v,w)},u}C(vxt,"trapezoidalPentagon");var yxt=10,bxt=10;async function xxt(t,e){var w;const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.width=(((e==null?void 0:e.width)??0)-a)/2,e.widthb,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),e.width=h,e.height=d,Pr(e,x),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${d/2-(o.height+(e.padding??0)/(u?2:1)-(o.y-(o.top??0)))})`),e.intersect=function(A){return me.info("Triangle intersect",e,p,A),Tr.polygon(e,p,A)},s}C(xxt,"triangle");async function wxt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;let o=!0;(e.width||e.height)&&(o=!1,e.width=((e==null?void 0:e.width)??0)-a*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-s*2,e.height<10&&(e.height=10));const{shapeSvg:l,bbox:u,label:h}=await pn(t,e,rn(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+(a??0)*2,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+(s??0)*2,p=e.look==="neo"?f/4:f/8,g=f+(o?p:-p),{cssStyles:m}=e,y=14-d,b=y>0?y/2:0,x=Er.svg(l),w=_r(e,{});e.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const A=[{x:-d/2-b,y:g/2},...Kx(-d/2-b,g/2,d/2+b,g/2,p,.8),{x:d/2+b,y:-g/2},{x:-d/2-b,y:-g/2}],T=Si(A),S=x.path(T,w),O=l.insert(()=>S,":first-child");return O.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",n),O.attr("transform",`translate(0,${-p/2})`),h.attr("transform",`translate(${-d/2+(e.padding??0)-(u.x-(u.left??0))},${-f/2+(e.padding??0)-p-(u.y-(u.top??0))})`),Pr(e,O),e.intersect=function(k){return Tr.polygon(e,A,k)},l}C(wxt,"waveEdgedRectangle");async function Axt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?20:i;if(e.width||e.height){e.width=(e==null?void 0:e.width)??0,e.width<20&&(e.width=20),e.height=(e==null?void 0:e.height)??0,e.height<10&&(e.height=10);const w=Math.min(e.height*.2,e.height/4);e.height=Math.ceil(e.height-s-w*(20/9)),e.width=e.width-a*2}const{shapeSvg:o,bbox:l}=await pn(t,e,rn(e)),u=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2,h=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s,d=h/8,f=h+d*2,{cssStyles:p}=e,g=Er.svg(o),m=_r(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const v=[{x:-u/2,y:f/2},...Kx(-u/2,f/2,u/2,f/2,d,1),{x:u/2,y:-f/2},...Kx(u/2,-f/2,-u/2,-f/2,d,-1)],y=Si(v),b=g.path(y,m),x=o.insert(()=>b,":first-child");return x.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",n),Pr(e,x),e.intersect=function(w){return Tr.polygon(e,v,w)},o}C(Axt,"waveRectangle");var Us=10;async function Txt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-i*2-Us,10),e.height=Math.max(((e==null?void 0:e.height)??0)-a*2-Us,10));const{shapeSvg:s,bbox:o,label:l}=await pn(t,e,rn(e)),u=(e!=null&&e.width?e==null?void 0:e.width:o.width)+i*2+Us,h=(e!=null&&e.height?e==null?void 0:e.height:o.height)+a*2+Us,d=u-Us,f=h-Us,p=-d/2,g=-f/2,{cssStyles:m}=e,v=Er.svg(s),y=_r(e,{}),b=[{x:p-Us,y:g-Us},{x:p-Us,y:g+f},{x:p+d,y:g+f},{x:p+d,y:g-Us}],x=`M${p-Us},${g-Us} L${p+d},${g-Us} L${p+d},${g+f} L${p-Us},${g+f} L${p-Us},${g-Us} + l${-r},0`,"createCylinderPathD"),$rn=C((t,e,r,n,i,a)=>[`M${t},${e}`,`M${t+r},${e}`,`a${i},${a} 0,0,0 0,${-n}`,`l${-r},0`,`a${i},${a} 0,0,0 0,${n}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),Frn=C((t,e,r,n,i,a)=>[`M${t+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),fxt=5,pxt=10;async function gxt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?12:i/2;if(e.width||e.height){const m=e.height??0;e.height=(e.height??0)-a,e.heightx,":first-child"),g=s.insert(()=>b,":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const m=Brn(0,0,f,u,d,h);g=s.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",_l(p)).attr("style",n),g.attr("class","basic label-container outer-path"),p&&g.selectAll("path").attr("style",p),n&&g.selectAll("path").attr("style",n)}return g.attr("label-offset-x",d),g.attr("transform",`translate(${-f/2}, ${u/2} )`),l.attr("transform",`translate(${-(o.width/2)-d-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Pr(e,g),e.intersect=function(m){const v=Sr.rect(e,m),y=v.y-(e.y??0);if(h!=0&&(Math.abs(y)<(e.height??0)/2||Math.abs(y)==(e.height??0)/2&&Math.abs(v.x-(e.x??0))>(e.width??0)/2-d)){let b=d*d*(1-y*y/(h*h));b!=0&&(b=Math.sqrt(Math.abs(b))),b=d-b,m.x-(e.x??0)>0&&(b=-b),v.x+=b}return v},s}C(gxt,"tiltedCylinder");async function mxt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=(e.look==="neo",i),s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await pn(t,e,rn(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:-3*u/6,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Er.svg(o),m=_r(e,{}),v=Ti(d),y=g.path(v,m);f=o.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=zy(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Pr(e,f),e.intersect=function(g){return Sr.polygon(e,d,g)},o}C(mxt,"trapezoid");async function vxt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=15,l=5;(e.width||e.height)&&(e.height=(e.height??0)-s*2,e.heightb,":first-child");return x.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),Pr(e,x),e.intersect=function(w){return Sr.polygon(e,v,w)},u}C(vxt,"trapezoidalPentagon");var yxt=10,bxt=10;async function xxt(t,e){var w;const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.width=(((e==null?void 0:e.width)??0)-a)/2,e.widthb,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),e.width=h,e.height=d,Pr(e,x),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${d/2-(o.height+(e.padding??0)/(u?2:1)-(o.y-(o.top??0)))})`),e.intersect=function(A){return me.info("Triangle intersect",e,p,A),Sr.polygon(e,p,A)},s}C(xxt,"triangle");async function wxt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;let o=!0;(e.width||e.height)&&(o=!1,e.width=((e==null?void 0:e.width)??0)-a*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-s*2,e.height<10&&(e.height=10));const{shapeSvg:l,bbox:u,label:h}=await pn(t,e,rn(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+(a??0)*2,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+(s??0)*2,p=e.look==="neo"?f/4:f/8,g=f+(o?p:-p),{cssStyles:m}=e,y=14-d,b=y>0?y/2:0,x=Er.svg(l),w=_r(e,{});e.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const A=[{x:-d/2-b,y:g/2},...Kx(-d/2-b,g/2,d/2+b,g/2,p,.8),{x:d/2+b,y:-g/2},{x:-d/2-b,y:-g/2}],S=Ti(A),T=x.path(S,w),O=l.insert(()=>T,":first-child");return O.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&O.selectAll("path").attr("style",n),O.attr("transform",`translate(0,${-p/2})`),h.attr("transform",`translate(${-d/2+(e.padding??0)-(u.x-(u.left??0))},${-f/2+(e.padding??0)-p-(u.y-(u.top??0))})`),Pr(e,O),e.intersect=function(k){return Sr.polygon(e,A,k)},l}C(wxt,"waveEdgedRectangle");async function Axt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?20:i;if(e.width||e.height){e.width=(e==null?void 0:e.width)??0,e.width<20&&(e.width=20),e.height=(e==null?void 0:e.height)??0,e.height<10&&(e.height=10);const w=Math.min(e.height*.2,e.height/4);e.height=Math.ceil(e.height-s-w*(20/9)),e.width=e.width-a*2}const{shapeSvg:o,bbox:l}=await pn(t,e,rn(e)),u=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2,h=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s,d=h/8,f=h+d*2,{cssStyles:p}=e,g=Er.svg(o),m=_r(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const v=[{x:-u/2,y:f/2},...Kx(-u/2,f/2,u/2,f/2,d,1),{x:u/2,y:-f/2},...Kx(u/2,-f/2,-u/2,-f/2,d,-1)],y=Ti(v),b=g.path(y,m),x=o.insert(()=>b,":first-child");return x.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",n),Pr(e,x),e.intersect=function(w){return Sr.polygon(e,v,w)},o}C(Axt,"waveRectangle");var Us=10;async function Sxt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-i*2-Us,10),e.height=Math.max(((e==null?void 0:e.height)??0)-a*2-Us,10));const{shapeSvg:s,bbox:o,label:l}=await pn(t,e,rn(e)),u=(e!=null&&e.width?e==null?void 0:e.width:o.width)+i*2+Us,h=(e!=null&&e.height?e==null?void 0:e.height:o.height)+a*2+Us,d=u-Us,f=h-Us,p=-d/2,g=-f/2,{cssStyles:m}=e,v=Er.svg(s),y=_r(e,{}),b=[{x:p-Us,y:g-Us},{x:p-Us,y:g+f},{x:p+d,y:g+f},{x:p+d,y:g-Us}],x=`M${p-Us},${g-Us} L${p+d},${g-Us} L${p+d},${g+f} L${p-Us},${g+f} L${p-Us},${g-Us} M${p-Us},${g} L${p+d},${g} - M${p},${g-Us} L${p},${g+f}`;e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const w=v.path(x,y),A=s.insert(()=>w,":first-child");return A.attr("transform",`translate(${Us/2}, ${Us/2})`),A.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",n),l.attr("transform",`translate(${-(o.width/2)+Us/2-(o.x-(o.left??0))}, ${-(o.height/2)+Us/2-(o.y-(o.top??0))})`),Pr(e,A),e.intersect=function(T){return Tr.polygon(e,b,T)},s}C(Txt,"windowPane");var Sxt=new Set(["redux-color","redux-dark-color"]),zrn=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function Lbe(t,e){var X,Y,le,q;const r=e;r.alias&&(e.label=r.alias);const{theme:n,themeVariables:i}=Dr(),{rowEven:a,rowOdd:s,nodeBorder:o,borderColorArray:l}=i;if(e.look==="handDrawn"){const{themeVariables:Z}=Dr(),{background:ee}=Z,re={...e,id:e.id+"-background",domId:(e.domId||e.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${ee}`]};await Lbe(t,re)}const u=Dr();e.useHtmlLabels=u.htmlLabels;let h=((X=u.er)==null?void 0:X.diagramPadding)??10,d=((Y=u.er)==null?void 0:Y.entityPadding)??6;const{cssStyles:f}=e,{labelStyles:p,nodeStyles:g}=Or(e);if(r.attributes.length===0&&e.label){const Z={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};Ru(e.label,u)+Z.labelPaddingX*20){const Z=y.width+h*2-(A+T+S+O);A+=Z/_,T+=Z/_,S>0&&(S+=Z/_),O>0&&(O+=Z/_)}const L=A+T+S+O,R=Er.svg(v),D=_r(e,{});e.look!=="handDrawn"&&(D.roughness=0,D.fillStyle="solid");let M=0;w.length>0&&(M=w.reduce((Z,ee)=>Z+((ee==null?void 0:ee.rowHeight)??0),0));const P=Math.max(I.width+h*2,(e==null?void 0:e.width)||0,L),N=Math.max((M??0)+y.height,(e==null?void 0:e.height)||0),F=-P/2,B=-N/2;if(v.selectAll("g:not(:first-child)").each((Z,ee,re)=>{const ve=Ot(re[ee]),ae=ve.attr("transform");let Ce=0,Oe=0;if(ae){const he=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(ae);he&&(Ce=parseFloat(he[1]),Oe=parseFloat(he[2]),ve.attr("class").includes("attribute-name")?Ce+=A:ve.attr("class").includes("attribute-keys")?Ce+=A+T:ve.attr("class").includes("attribute-comment")&&(Ce+=A+T+S))}ve.attr("transform",`translate(${F+h/2+Ce}, ${Oe+B+y.height+d/2})`)}),v.select(".name").attr("transform","translate("+-y.width/2+", "+(B+d/2)+")"),n!=null&&Sxt.has(n)){const Z=r.colorIndex??0;v.attr("data-color-id",`color-${Z%l.length}`)}const V=R.rectangle(F,B,P,N,D),z=v.insert(()=>V,":first-child").attr("class","outer-path").attr("style",f.join(""));x.push(0);for(const[Z,ee]of w.entries()){const ve=(Z+1)%2===0&&ee.yOffset!==0,ae=R.rectangle(F,y.height+B+(ee==null?void 0:ee.yOffset),P,ee==null?void 0:ee.rowHeight,{...D,fill:ve?a:s,stroke:o});v.insert(()=>ae,"g.label").attr("style",f.join("")).attr("class",`row-rect-${ve?"even":"odd"}`)}const U=1e-4;let Q=J5(F,y.height+B,P+F,y.height+B,U),G=R.polygon(Q.map(Z=>[Z.x,Z.y]),D);if(v.insert(()=>G).attr("class","divider"),Q=J5(A+F,y.height+B,A+F,N+B,U),G=R.polygon(Q.map(Z=>[Z.x,Z.y]),D),v.insert(()=>G).attr("class","divider"),k){const Z=A+T+F;Q=J5(Z,y.height+B,Z,N+B,U),G=R.polygon(Q.map(ee=>[ee.x,ee.y]),D),v.insert(()=>G).attr("class","divider")}if(E){const Z=A+T+S+F;Q=J5(Z,y.height+B,Z,N+B,U),G=R.polygon(Q.map(ee=>[ee.x,ee.y]),D),v.insert(()=>G).attr("class","divider")}for(const Z of x){const ee=y.height+B+Z;Q=J5(F,ee,P+F,ee,U),G=R.polygon(Q.map(re=>[re.x,re.y]),D),v.insert(()=>G).attr("class","divider")}if(Pr(e,z),g&&e.look!=="handDrawn")if(n!=null&&zrn.has(n))v.selectAll("path").attr("style",g);else{const Z=g.split(";"),ee=(q=Z==null?void 0:Z.filter(re=>re.includes("stroke")))==null?void 0:q.map(re=>`${re}`).join("; ");v.selectAll("path").attr("style",ee??""),v.selectAll(".row-rect-even path").attr("style",g)}return e.intersect=function(Z){return Tr.rect(e,Z)},v}C(Lbe,"erBox");async function Z5(t,e,r,n=0,i=0,a=[],s=""){const o=t.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",s);e!==Hx(e)&&(e=Hx(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await Zc(o,e,{width:Ru(e,r)+100,style:s,useHtmlLabels:r.htmlLabels},r));if(e.includes("<")||e.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let u=l.getBBox();if(Xm(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=Ot(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}return u}C(Z5,"addText");function J5(t,e,r,n,i){return t===r?[{x:t-i/2,y:e},{x:t+i/2,y:e},{x:r+i/2,y:n},{x:r-i/2,y:n}]:[{x:t,y:e-i/2},{x:t,y:e+i/2},{x:r,y:n+i/2},{x:r,y:n-i/2}]}C(J5,"lineToPolygon");async function Cxt(t,e,r,n,i=r.class.padding??12){const a=n?0:3,s=t.insert("g").attr("class",rn(e)).attr("id",e.domId||e.id);let o=null,l=null,u=null,h=null,d=0,f=0,p=0;if(o=s.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const b=e.annotations[0];await T7(o,{text:`«${b}»`},0),d=o.node().getBBox().height}l=s.insert("g").attr("class","label-group text"),await T7(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,u=s.insert("g").attr("class","members-group text");let m=0;for(const b of e.members){const x=await T7(u,b,m,[b.parseClassifier()]);m+=x+a}p=u.node().getBBox().height,p<=0&&(p=i/2),h=s.insert("g").attr("class","methods-group text");let v=0;for(const b of e.methods){const x=await T7(h,b,v,[b.parseClassifier()]);v+=x+a}let y=s.node().getBBox();if(o!==null){const b=o.node().getBBox();o.attr("transform",`translate(${-b.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),y=s.node().getBBox(),u.attr("transform",`translate(0, ${d+f+i*2})`),y=s.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(p?p+i*4:i*2)})`),y=s.node().getBBox(),{shapeSvg:s,bbox:y}}C(Cxt,"textHelper");async function T7(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),a=Dr();let s="useHtmlLabels"in e?e.useHtmlLabels:Xm(a.htmlLabels)??!0,o="";"text"in e?o=e.text:o=e.label,!s&&o.startsWith("\\")&&(o=o.substring(1)),io(o)&&(s=!0);const l=await Zc(i,xye($y(o)),{width:Ru(o,a)+50,classes:"markdown-node-label",useHtmlLabels:s},a);let u,h=1;if(s){const d=l.children[0],f=Ot(l);h=d.innerHTML.split("
").length,d.innerHTML.includes("")&&(h+=d.innerHTML.split("").length-1);const p=d.getElementsByTagName("img");if(p){const g=o.replace(/]*>/g,"").trim()==="";await Promise.all([...p].map(m=>new Promise(v=>{function y(){var b;if(m.style.display="flex",m.style.flexDirection="column",g){const x=((b=a.fontSize)==null?void 0:b.toString())??window.getComputedStyle(document.body).fontSize,A=parseInt(x,10)*5+"px";m.style.minWidth=A,m.style.maxWidth=A}else m.style.width="100%";v(m)}C(y,"setupImage"),setTimeout(()=>{m.complete&&y()}),m.addEventListener("error",y),m.addEventListener("load",y)})))}u=d.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{n.includes("font-weight: bolder")&&Ot(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=o[0]+o.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),o[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),u=l.getBBox()}return i.attr("transform","translate(0,"+(-u.height/(2*h)+r)+")"),u.height}C(T7,"addText");async function Oxt(t,e){var R,D;const r=He(),{themeVariables:n}=r,{useGradient:i}=n,a=r.class.padding??12,s=a,o=e.useHtmlLabels??Xm(r.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:u,bbox:h}=await Cxt(t,e,r,o,s),{labelStyles:d,nodeStyles:f}=Or(e);e.labelStyle=d,e.cssStyles=l.styles||"";const p=((R=l.styles)==null?void 0:R.join(";"))||f||"";e.cssStyles||(e.cssStyles=p.replaceAll("!important","").split(";"));const g=l.members.length===0&&l.methods.length===0&&!((D=r.class)!=null&&D.hideEmptyMembersBox),m=Er.svg(u),v=_r(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const y=Math.max(e.width??0,h.width);let b=Math.max(e.height??0,h.height);const x=(e.height??0)>h.height;l.members.length===0&&l.methods.length===0?b+=s:l.members.length>0&&l.methods.length===0&&(b+=s*2);const w=-y/2,A=-b/2;let T=g?a*2:l.members.length===0&&l.methods.length===0?-a:0;x&&(T=a*2);const S=m.rectangle(w-a,A-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0),y+2*a,b+2*a+T,v),O=u.insert(()=>S,":first-child");O.attr("class","basic label-container outer-path");const k=O.node().getBBox(),E=u.select(".annotation-group").node().getBBox().height-(g?a/2:0)||0,_=u.select(".label-group").node().getBBox().height-(g?a/2:0)||0,I=u.select(".members-group").node().getBBox().height-(g?a/2:0)||0,L=(E+_+A+a-(A-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0)))/2;if(u.selectAll(".text").each((M,P,N)=>{var Q,G;const F=Ot(N[P]),B=F.attr("transform");let V=0;if(B){const Y=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(B);Y&&(V=parseFloat(Y[2]))}let z=V+A+a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0);if(F.attr("class").includes("methods-group")){const X=Math.max(I,s/2);x?z=Math.max(L,E+_+X+A+s*2+a)+s*2:z=E+_+X+A+s*4+a}l.members.length===0&&l.methods.length===0&&((Q=r.class)!=null&&Q.hideEmptyMembersBox)&&(l.annotations.length>0?z=V-s:z=V),o||(z-=4);let U=w;(F.attr("class").includes("label-group")||F.attr("class").includes("annotation-group"))&&(U=-((G=F.node())==null?void 0:G.getBBox().width)/2||0,u.selectAll("text").each(function(X,Y,le){window.getComputedStyle(le[Y]).textAnchor==="middle"&&(U=0)})),F.attr("transform",`translate(${U}, ${z})`)}),l.members.length>0||l.methods.length>0||g){const M=E+_+A+a,P=m.line(k.x,M,k.x+k.width,M+.001,v);u.insert(()=>P).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(g||l.members.length>0||l.methods.length>0){const M=E+_+I+A+s*2+a,P=m.line(k.x,x?Math.max(L,M):M,k.x+k.width,(x?Math.max(L,M):M)+.001,v);u.insert(()=>P).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(l.look!=="handDrawn"&&u.selectAll("path").attr("style",p),O.select(":nth-child(2)").attr("style",p),u.selectAll(".divider").select("path").attr("style",p),e.labelStyle?u.selectAll("span").attr("style",e.labelStyle):u.selectAll("span").attr("style",p),!o){const M=RegExp(/color\s*:\s*([^;]*)/),P=M.exec(p);if(P){const N=P[0].replace("color","fill");u.selectAll("tspan").attr("style",N)}else if(d){const N=M.exec(d);if(N){const F=N[0].replace("color","fill");u.selectAll("tspan").attr("style",F)}}}return Pr(e,O),e.intersect=function(M){return Tr.rect(e,M)},u}C(Oxt,"classBox");async function kxt(t,e){var k,E;const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e,a=e,s=20,o=20,l="verifyMethod"in e,u=rn(e),{themeVariables:h}=He(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,p=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let g;l?g=await n0(p,`<<${i.type}>>`,0,e.labelStyle):g=await n0(p,"<<Element>>",0,e.labelStyle);let m=g;const v=await n0(p,i.name,m,e.labelStyle+"; font-weight: bold;");if(m+=v+o,l){const _=await n0(p,`${i.requirementId?`ID: ${i.requirementId}`:""}`,m,e.labelStyle);m+=_;const I=await n0(p,`${i.text?`Text: ${i.text}`:""}`,m,e.labelStyle);m+=I;const L=await n0(p,`${i.risk?`Risk: ${i.risk}`:""}`,m,e.labelStyle);m+=L,await n0(p,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,m,e.labelStyle)}else{const _=await n0(p,`${a.type?`Type: ${a.type}`:""}`,m,e.labelStyle);m+=_,await n0(p,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,m,e.labelStyle)}const y=(((k=p.node())==null?void 0:k.getBBox().width)??200)+s,b=(((E=p.node())==null?void 0:E.getBBox().height)??200)+s,x=-y/2,w=-b/2,A=Er.svg(p),T=_r(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const S=A.rectangle(x,w,y,b,T),O=p.insert(()=>S,":first-child");if(O.attr("class","basic label-container outer-path").attr("style",n),d!=null&&d.length){const _=e.colorIndex??0;p.attr("data-color-id",`color-${_%d.length}`)}if(p.selectAll(".label").each((_,I,L)=>{const R=Ot(L[I]),D=R.attr("transform");let M=0,P=0;if(D){const V=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(D);V&&(M=parseFloat(V[1]),P=parseFloat(V[2]))}const N=P-b/2;let F=x+s/2;(I===0||I===1)&&(F=M),R.attr("transform",`translate(${F}, ${N+s})`)}),m>g+v+o){const _=w+g+v+o;let I;if(e.look==="neo"){const D=[[x,_],[x+y,_],[x+y,_+.001],[x,_+.001]];I=A.polygon(D,T)}else I=A.line(x,_,x+y,_,T);p.insert(()=>I).attr("class","divider")}return Pr(e,O),e.intersect=function(_){return Tr.rect(e,_)},n&&e.look!=="handDrawn"&&(f||d!=null&&d.length)&&p.selectAll("path").attr("style",n),p}C(kxt,"requirementBox");async function n0(t,e,r,n=""){if(e==="")return 0;const i=t.insert("g").attr("class","label").attr("style",n),a=He(),s=a.htmlLabels??!0,o=await Zc(i,xye($y(e)),{width:Ru(e,a)+50,classes:"markdown-node-label",useHtmlLabels:s,style:n},a);let l;if(s){const u=o.children[0],h=Ot(o);l=u.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const u=o.children[0];for(const h of u.children)n&&h.setAttribute("style",n);l=o.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}C(n0,"addText");var Urn=C(t=>{switch(t){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function Ext(t,e,{config:r}){var I,L;const{labelStyles:n,nodeStyles:i}=Or(e);e.labelStyle=n||"";const a=10,s=e.width;e.width=(e.width??200)-10;const{shapeSvg:o,bbox:l,label:u}=await pn(t,e,rn(e)),h=e.padding||10;let d="",f;"ticket"in e&&e.ticket&&((I=r==null?void 0:r.kanban)!=null&&I.ticketBaseUrl)&&(d=(L=r==null?void 0:r.kanban)==null?void 0:L.ticketBaseUrl.replace("#TICKET#",e.ticket),f=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const p={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await Obe(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await Obe(o,"ticket"in e&&e.ticket||"",p);const{label:v,bbox:y}=await Obe(o,"assigned"in e&&e.assigned||"",p);e.width=s;const b=10,x=(e==null?void 0:e.width)||0,w=Math.max(m.height,y.height)/2,A=Math.max(l.height+b*2,(e==null?void 0:e.height)||0)+w,T=-x/2,S=-A/2;u.attr("transform","translate("+(h-x/2)+", "+(-w-l.height/2)+")"),g.attr("transform","translate("+(h-x/2)+", "+(-w+l.height/2)+")"),v.attr("transform","translate("+(h+x/2-y.width-2*a)+", "+(-w+l.height/2)+")");let O;const{rx:k,ry:E}=e,{cssStyles:_}=e;if(e.look==="handDrawn"){const R=Er.svg(o),D=_r(e,{}),M=k||E?R.path(Jx(T,S,x,A,k||0),D):R.rectangle(T,S,x,A,D);O=o.insert(()=>M,":first-child"),O.attr("class","basic label-container").attr("style",_||null)}else{O=o.insert("rect",":first-child"),O.attr("class","basic label-container __APA__").attr("style",i).attr("rx",k??5).attr("ry",E??5).attr("x",T).attr("y",S).attr("width",x).attr("height",A);const R="priority"in e&&e.priority;if(R){const D=o.append("line"),M=T+2,P=S+Math.floor((k??0)/2),N=S+A-Math.floor((k??0)/2);D.attr("x1",M).attr("y1",P).attr("x2",M).attr("y2",N).attr("stroke-width","4").attr("stroke",Urn(R))}}return Pr(e,O),e.height=A,e.intersect=function(R){return Tr.rect(e,R)},o}C(Ext,"kanbanItem");async function _xt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await pn(t,e,rn(e)),l=a.width+10*s,u=a.height+8*s,h=.15*l,{cssStyles:d}=e,f=a.width+20,p=a.height+20,g=Math.max(l,f),m=Math.max(u,p);o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`);let v;const y=`M0 0 + M${p},${g-Us} L${p},${g+f}`;e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const w=v.path(x,y),A=s.insert(()=>w,":first-child");return A.attr("transform",`translate(${Us/2}, ${Us/2})`),A.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",n),l.attr("transform",`translate(${-(o.width/2)+Us/2-(o.x-(o.left??0))}, ${-(o.height/2)+Us/2-(o.y-(o.top??0))})`),Pr(e,A),e.intersect=function(S){return Sr.polygon(e,b,S)},s}C(Sxt,"windowPane");var Txt=new Set(["redux-color","redux-dark-color"]),zrn=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function Lbe(t,e){var X,Y,le,q;const r=e;r.alias&&(e.label=r.alias);const{theme:n,themeVariables:i}=Dr(),{rowEven:a,rowOdd:s,nodeBorder:o,borderColorArray:l}=i;if(e.look==="handDrawn"){const{themeVariables:Z}=Dr(),{background:ee}=Z,re={...e,id:e.id+"-background",domId:(e.domId||e.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${ee}`]};await Lbe(t,re)}const u=Dr();e.useHtmlLabels=u.htmlLabels;let h=((X=u.er)==null?void 0:X.diagramPadding)??10,d=((Y=u.er)==null?void 0:Y.entityPadding)??6;const{cssStyles:f}=e,{labelStyles:p,nodeStyles:g}=Or(e);if(r.attributes.length===0&&e.label){const Z={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};Ru(e.label,u)+Z.labelPaddingX*20){const Z=y.width+h*2-(A+S+T+O);A+=Z/_,S+=Z/_,T>0&&(T+=Z/_),O>0&&(O+=Z/_)}const L=A+S+T+O,R=Er.svg(v),D=_r(e,{});e.look!=="handDrawn"&&(D.roughness=0,D.fillStyle="solid");let M=0;w.length>0&&(M=w.reduce((Z,ee)=>Z+((ee==null?void 0:ee.rowHeight)??0),0));const P=Math.max(I.width+h*2,(e==null?void 0:e.width)||0,L),N=Math.max((M??0)+y.height,(e==null?void 0:e.height)||0),F=-P/2,B=-N/2;if(v.selectAll("g:not(:first-child)").each((Z,ee,re)=>{const ve=Ot(re[ee]),ae=ve.attr("transform");let Ce=0,Oe=0;if(ae){const he=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(ae);he&&(Ce=parseFloat(he[1]),Oe=parseFloat(he[2]),ve.attr("class").includes("attribute-name")?Ce+=A:ve.attr("class").includes("attribute-keys")?Ce+=A+S:ve.attr("class").includes("attribute-comment")&&(Ce+=A+S+T))}ve.attr("transform",`translate(${F+h/2+Ce}, ${Oe+B+y.height+d/2})`)}),v.select(".name").attr("transform","translate("+-y.width/2+", "+(B+d/2)+")"),n!=null&&Txt.has(n)){const Z=r.colorIndex??0;v.attr("data-color-id",`color-${Z%l.length}`)}const V=R.rectangle(F,B,P,N,D),z=v.insert(()=>V,":first-child").attr("class","outer-path").attr("style",f.join(""));x.push(0);for(const[Z,ee]of w.entries()){const ve=(Z+1)%2===0&&ee.yOffset!==0,ae=R.rectangle(F,y.height+B+(ee==null?void 0:ee.yOffset),P,ee==null?void 0:ee.rowHeight,{...D,fill:ve?a:s,stroke:o});v.insert(()=>ae,"g.label").attr("style",f.join("")).attr("class",`row-rect-${ve?"even":"odd"}`)}const U=1e-4;let Q=J5(F,y.height+B,P+F,y.height+B,U),G=R.polygon(Q.map(Z=>[Z.x,Z.y]),D);if(v.insert(()=>G).attr("class","divider"),Q=J5(A+F,y.height+B,A+F,N+B,U),G=R.polygon(Q.map(Z=>[Z.x,Z.y]),D),v.insert(()=>G).attr("class","divider"),k){const Z=A+S+F;Q=J5(Z,y.height+B,Z,N+B,U),G=R.polygon(Q.map(ee=>[ee.x,ee.y]),D),v.insert(()=>G).attr("class","divider")}if(E){const Z=A+S+T+F;Q=J5(Z,y.height+B,Z,N+B,U),G=R.polygon(Q.map(ee=>[ee.x,ee.y]),D),v.insert(()=>G).attr("class","divider")}for(const Z of x){const ee=y.height+B+Z;Q=J5(F,ee,P+F,ee,U),G=R.polygon(Q.map(re=>[re.x,re.y]),D),v.insert(()=>G).attr("class","divider")}if(Pr(e,z),g&&e.look!=="handDrawn")if(n!=null&&zrn.has(n))v.selectAll("path").attr("style",g);else{const Z=g.split(";"),ee=(q=Z==null?void 0:Z.filter(re=>re.includes("stroke")))==null?void 0:q.map(re=>`${re}`).join("; ");v.selectAll("path").attr("style",ee??""),v.selectAll(".row-rect-even path").attr("style",g)}return e.intersect=function(Z){return Sr.rect(e,Z)},v}C(Lbe,"erBox");async function Z5(t,e,r,n=0,i=0,a=[],s=""){const o=t.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",s);e!==Hx(e)&&(e=Hx(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await Zc(o,e,{width:Ru(e,r)+100,style:s,useHtmlLabels:r.htmlLabels},r));if(e.includes("<")||e.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let u=l.getBBox();if(Xm(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=Ot(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}return u}C(Z5,"addText");function J5(t,e,r,n,i){return t===r?[{x:t-i/2,y:e},{x:t+i/2,y:e},{x:r+i/2,y:n},{x:r-i/2,y:n}]:[{x:t,y:e-i/2},{x:t,y:e+i/2},{x:r,y:n+i/2},{x:r,y:n-i/2}]}C(J5,"lineToPolygon");async function Cxt(t,e,r,n,i=r.class.padding??12){const a=n?0:3,s=t.insert("g").attr("class",rn(e)).attr("id",e.domId||e.id);let o=null,l=null,u=null,h=null,d=0,f=0,p=0;if(o=s.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const b=e.annotations[0];await S7(o,{text:`«${b}»`},0),d=o.node().getBBox().height}l=s.insert("g").attr("class","label-group text"),await S7(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,u=s.insert("g").attr("class","members-group text");let m=0;for(const b of e.members){const x=await S7(u,b,m,[b.parseClassifier()]);m+=x+a}p=u.node().getBBox().height,p<=0&&(p=i/2),h=s.insert("g").attr("class","methods-group text");let v=0;for(const b of e.methods){const x=await S7(h,b,v,[b.parseClassifier()]);v+=x+a}let y=s.node().getBBox();if(o!==null){const b=o.node().getBBox();o.attr("transform",`translate(${-b.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),y=s.node().getBBox(),u.attr("transform",`translate(0, ${d+f+i*2})`),y=s.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(p?p+i*4:i*2)})`),y=s.node().getBBox(),{shapeSvg:s,bbox:y}}C(Cxt,"textHelper");async function S7(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),a=Dr();let s="useHtmlLabels"in e?e.useHtmlLabels:Xm(a.htmlLabels)??!0,o="";"text"in e?o=e.text:o=e.label,!s&&o.startsWith("\\")&&(o=o.substring(1)),io(o)&&(s=!0);const l=await Zc(i,xye($y(o)),{width:Ru(o,a)+50,classes:"markdown-node-label",useHtmlLabels:s},a);let u,h=1;if(s){const d=l.children[0],f=Ot(l);h=d.innerHTML.split("
").length,d.innerHTML.includes("")&&(h+=d.innerHTML.split("").length-1);const p=d.getElementsByTagName("img");if(p){const g=o.replace(/]*>/g,"").trim()==="";await Promise.all([...p].map(m=>new Promise(v=>{function y(){var b;if(m.style.display="flex",m.style.flexDirection="column",g){const x=((b=a.fontSize)==null?void 0:b.toString())??window.getComputedStyle(document.body).fontSize,A=parseInt(x,10)*5+"px";m.style.minWidth=A,m.style.maxWidth=A}else m.style.width="100%";v(m)}C(y,"setupImage"),setTimeout(()=>{m.complete&&y()}),m.addEventListener("error",y),m.addEventListener("load",y)})))}u=d.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{n.includes("font-weight: bolder")&&Ot(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=o[0]+o.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),o[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),u=l.getBBox()}return i.attr("transform","translate(0,"+(-u.height/(2*h)+r)+")"),u.height}C(S7,"addText");async function Oxt(t,e){var R,D;const r=He(),{themeVariables:n}=r,{useGradient:i}=n,a=r.class.padding??12,s=a,o=e.useHtmlLabels??Xm(r.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:u,bbox:h}=await Cxt(t,e,r,o,s),{labelStyles:d,nodeStyles:f}=Or(e);e.labelStyle=d,e.cssStyles=l.styles||"";const p=((R=l.styles)==null?void 0:R.join(";"))||f||"";e.cssStyles||(e.cssStyles=p.replaceAll("!important","").split(";"));const g=l.members.length===0&&l.methods.length===0&&!((D=r.class)!=null&&D.hideEmptyMembersBox),m=Er.svg(u),v=_r(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const y=Math.max(e.width??0,h.width);let b=Math.max(e.height??0,h.height);const x=(e.height??0)>h.height;l.members.length===0&&l.methods.length===0?b+=s:l.members.length>0&&l.methods.length===0&&(b+=s*2);const w=-y/2,A=-b/2;let S=g?a*2:l.members.length===0&&l.methods.length===0?-a:0;x&&(S=a*2);const T=m.rectangle(w-a,A-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0),y+2*a,b+2*a+S,v),O=u.insert(()=>T,":first-child");O.attr("class","basic label-container outer-path");const k=O.node().getBBox(),E=u.select(".annotation-group").node().getBBox().height-(g?a/2:0)||0,_=u.select(".label-group").node().getBBox().height-(g?a/2:0)||0,I=u.select(".members-group").node().getBBox().height-(g?a/2:0)||0,L=(E+_+A+a-(A-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0)))/2;if(u.selectAll(".text").each((M,P,N)=>{var Q,G;const F=Ot(N[P]),B=F.attr("transform");let V=0;if(B){const Y=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(B);Y&&(V=parseFloat(Y[2]))}let z=V+A+a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0);if(F.attr("class").includes("methods-group")){const X=Math.max(I,s/2);x?z=Math.max(L,E+_+X+A+s*2+a)+s*2:z=E+_+X+A+s*4+a}l.members.length===0&&l.methods.length===0&&((Q=r.class)!=null&&Q.hideEmptyMembersBox)&&(l.annotations.length>0?z=V-s:z=V),o||(z-=4);let U=w;(F.attr("class").includes("label-group")||F.attr("class").includes("annotation-group"))&&(U=-((G=F.node())==null?void 0:G.getBBox().width)/2||0,u.selectAll("text").each(function(X,Y,le){window.getComputedStyle(le[Y]).textAnchor==="middle"&&(U=0)})),F.attr("transform",`translate(${U}, ${z})`)}),l.members.length>0||l.methods.length>0||g){const M=E+_+A+a,P=m.line(k.x,M,k.x+k.width,M+.001,v);u.insert(()=>P).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(g||l.members.length>0||l.methods.length>0){const M=E+_+I+A+s*2+a,P=m.line(k.x,x?Math.max(L,M):M,k.x+k.width,(x?Math.max(L,M):M)+.001,v);u.insert(()=>P).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(l.look!=="handDrawn"&&u.selectAll("path").attr("style",p),O.select(":nth-child(2)").attr("style",p),u.selectAll(".divider").select("path").attr("style",p),e.labelStyle?u.selectAll("span").attr("style",e.labelStyle):u.selectAll("span").attr("style",p),!o){const M=RegExp(/color\s*:\s*([^;]*)/),P=M.exec(p);if(P){const N=P[0].replace("color","fill");u.selectAll("tspan").attr("style",N)}else if(d){const N=M.exec(d);if(N){const F=N[0].replace("color","fill");u.selectAll("tspan").attr("style",F)}}}return Pr(e,O),e.intersect=function(M){return Sr.rect(e,M)},u}C(Oxt,"classBox");async function kxt(t,e){var k,E;const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e,a=e,s=20,o=20,l="verifyMethod"in e,u=rn(e),{themeVariables:h}=He(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,p=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let g;l?g=await n0(p,`<<${i.type}>>`,0,e.labelStyle):g=await n0(p,"<<Element>>",0,e.labelStyle);let m=g;const v=await n0(p,i.name,m,e.labelStyle+"; font-weight: bold;");if(m+=v+o,l){const _=await n0(p,`${i.requirementId?`ID: ${i.requirementId}`:""}`,m,e.labelStyle);m+=_;const I=await n0(p,`${i.text?`Text: ${i.text}`:""}`,m,e.labelStyle);m+=I;const L=await n0(p,`${i.risk?`Risk: ${i.risk}`:""}`,m,e.labelStyle);m+=L,await n0(p,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,m,e.labelStyle)}else{const _=await n0(p,`${a.type?`Type: ${a.type}`:""}`,m,e.labelStyle);m+=_,await n0(p,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,m,e.labelStyle)}const y=(((k=p.node())==null?void 0:k.getBBox().width)??200)+s,b=(((E=p.node())==null?void 0:E.getBBox().height)??200)+s,x=-y/2,w=-b/2,A=Er.svg(p),S=_r(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const T=A.rectangle(x,w,y,b,S),O=p.insert(()=>T,":first-child");if(O.attr("class","basic label-container outer-path").attr("style",n),d!=null&&d.length){const _=e.colorIndex??0;p.attr("data-color-id",`color-${_%d.length}`)}if(p.selectAll(".label").each((_,I,L)=>{const R=Ot(L[I]),D=R.attr("transform");let M=0,P=0;if(D){const V=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(D);V&&(M=parseFloat(V[1]),P=parseFloat(V[2]))}const N=P-b/2;let F=x+s/2;(I===0||I===1)&&(F=M),R.attr("transform",`translate(${F}, ${N+s})`)}),m>g+v+o){const _=w+g+v+o;let I;if(e.look==="neo"){const D=[[x,_],[x+y,_],[x+y,_+.001],[x,_+.001]];I=A.polygon(D,S)}else I=A.line(x,_,x+y,_,S);p.insert(()=>I).attr("class","divider")}return Pr(e,O),e.intersect=function(_){return Sr.rect(e,_)},n&&e.look!=="handDrawn"&&(f||d!=null&&d.length)&&p.selectAll("path").attr("style",n),p}C(kxt,"requirementBox");async function n0(t,e,r,n=""){if(e==="")return 0;const i=t.insert("g").attr("class","label").attr("style",n),a=He(),s=a.htmlLabels??!0,o=await Zc(i,xye($y(e)),{width:Ru(e,a)+50,classes:"markdown-node-label",useHtmlLabels:s,style:n},a);let l;if(s){const u=o.children[0],h=Ot(o);l=u.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const u=o.children[0];for(const h of u.children)n&&h.setAttribute("style",n);l=o.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}C(n0,"addText");var Urn=C(t=>{switch(t){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function Ext(t,e,{config:r}){var I,L;const{labelStyles:n,nodeStyles:i}=Or(e);e.labelStyle=n||"";const a=10,s=e.width;e.width=(e.width??200)-10;const{shapeSvg:o,bbox:l,label:u}=await pn(t,e,rn(e)),h=e.padding||10;let d="",f;"ticket"in e&&e.ticket&&((I=r==null?void 0:r.kanban)!=null&&I.ticketBaseUrl)&&(d=(L=r==null?void 0:r.kanban)==null?void 0:L.ticketBaseUrl.replace("#TICKET#",e.ticket),f=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const p={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await Obe(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await Obe(o,"ticket"in e&&e.ticket||"",p);const{label:v,bbox:y}=await Obe(o,"assigned"in e&&e.assigned||"",p);e.width=s;const b=10,x=(e==null?void 0:e.width)||0,w=Math.max(m.height,y.height)/2,A=Math.max(l.height+b*2,(e==null?void 0:e.height)||0)+w,S=-x/2,T=-A/2;u.attr("transform","translate("+(h-x/2)+", "+(-w-l.height/2)+")"),g.attr("transform","translate("+(h-x/2)+", "+(-w+l.height/2)+")"),v.attr("transform","translate("+(h+x/2-y.width-2*a)+", "+(-w+l.height/2)+")");let O;const{rx:k,ry:E}=e,{cssStyles:_}=e;if(e.look==="handDrawn"){const R=Er.svg(o),D=_r(e,{}),M=k||E?R.path(Jx(S,T,x,A,k||0),D):R.rectangle(S,T,x,A,D);O=o.insert(()=>M,":first-child"),O.attr("class","basic label-container").attr("style",_||null)}else{O=o.insert("rect",":first-child"),O.attr("class","basic label-container __APA__").attr("style",i).attr("rx",k??5).attr("ry",E??5).attr("x",S).attr("y",T).attr("width",x).attr("height",A);const R="priority"in e&&e.priority;if(R){const D=o.append("line"),M=S+2,P=T+Math.floor((k??0)/2),N=T+A-Math.floor((k??0)/2);D.attr("x1",M).attr("y1",P).attr("x2",M).attr("y2",N).attr("stroke-width","4").attr("stroke",Urn(R))}}return Pr(e,O),e.height=A,e.intersect=function(R){return Sr.rect(e,R)},o}C(Ext,"kanbanItem");async function _xt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await pn(t,e,rn(e)),l=a.width+10*s,u=a.height+8*s,h=.15*l,{cssStyles:d}=e,f=a.width+20,p=a.height+20,g=Math.max(l,f),m=Math.max(u,p);o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`);let v;const y=`M0 0 a${h},${h} 1 0,0 ${g*.25},${-1*m*.1} a${h},${h} 1 0,0 ${g*.25},0 a${h},${h} 1 0,0 ${g*.25},0 @@ -625,7 +625,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="

An error a${h},${h} 1 0,0 ${-1*g*.1},${-1*m*.33} a${h*.8},${h*.8} 1 0,0 0,${-1*m*.34} a${h},${h} 1 0,0 ${g*.1},${-1*m*.33} - H0 V0 Z`;if(e.look==="handDrawn"){const b=Er.svg(i),x=_r(e,{}),w=b.path(y,x);v=i.insert(()=>w,":first-child"),v.attr("class","basic label-container").attr("style",_l(d))}else v=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",y);return v.attr("transform",`translate(${-g/2}, ${-m/2})`),Pr(e,v),e.calcIntersect=function(b,x){return Tr.rect(b,x)},e.intersect=function(b){return me.info("Bang intersect",e,b),Tr.rect(e,b)},i}C(_xt,"bang");async function Rxt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await pn(t,e,rn(e)),l=a.width+2*s,u=a.height+2*s,h=.15*l,d=.25*l,f=.35*l,p=.2*l,{cssStyles:g}=e;let m;const v=`M0 0 + H0 V0 Z`;if(e.look==="handDrawn"){const b=Er.svg(i),x=_r(e,{}),w=b.path(y,x);v=i.insert(()=>w,":first-child"),v.attr("class","basic label-container").attr("style",_l(d))}else v=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",y);return v.attr("transform",`translate(${-g/2}, ${-m/2})`),Pr(e,v),e.calcIntersect=function(b,x){return Sr.rect(b,x)},e.intersect=function(b){return me.info("Bang intersect",e,b),Sr.rect(e,b)},i}C(_xt,"bang");async function Rxt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await pn(t,e,rn(e)),l=a.width+2*s,u=a.height+2*s,h=.15*l,d=.25*l,f=.35*l,p=.2*l,{cssStyles:g}=e;let m;const v=`M0 0 a${h},${h} 0 0,1 ${l*.25},${-1*l*.1} a${f},${f} 1 0,1 ${l*.4},${-1*l*.1} a${d},${d} 1 0,1 ${l*.35},${l*.2} @@ -639,7 +639,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="

An error a${h},${h} 1 0,1 ${-1*l*.1},${-1*u*.35} a${p},${p} 1 0,1 ${l*.1},${-1*u*.65} - H0 V0 Z`;if(e.look==="handDrawn"){const y=Er.svg(i),b=_r(e,{}),x=y.path(v,b);m=i.insert(()=>x,":first-child"),m.attr("class","basic label-container").attr("style",_l(g))}else m=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",v);return o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),m.attr("transform",`translate(${-l/2}, ${-u/2})`),Pr(e,m),e.calcIntersect=function(y,b){return Tr.rect(y,b)},e.intersect=function(y){return me.info("Cloud intersect",e,y),Tr.rect(e,y)},i}C(Rxt,"cloud");async function Dxt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await pn(t,e,rn(e)),l=a.width+8*s,u=a.height+2*s,h=5,d=e.look==="neo"?` + H0 V0 Z`;if(e.look==="handDrawn"){const y=Er.svg(i),b=_r(e,{}),x=y.path(v,b);m=i.insert(()=>x,":first-child"),m.attr("class","basic label-container").attr("style",_l(g))}else m=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",v);return o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),m.attr("transform",`translate(${-l/2}, ${-u/2})`),Pr(e,m),e.calcIntersect=function(y,b){return Sr.rect(y,b)},e.intersect=function(y){return me.info("Cloud intersect",e,y),Sr.rect(e,y)},i}C(Rxt,"cloud");async function Dxt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await pn(t,e,rn(e)),l=a.width+8*s,u=a.height+2*s,h=5,d=e.look==="neo"?` M${-l/2} ${u/2-h} v${-u+2*h} q0,-${h} ${h},-${h} @@ -659,17 +659,17 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="

An error h${-(l-2*h)} q${-h},0 ${-h},${-h} Z - `;if(!e.domId)throw new Error(`defaultMindmapNode: node "${e.id}" is missing a domId — was render.ts domId prefixing skipped?`);const f=i.append("path").attr("id",e.domId).attr("class","node-bkg node-"+e.type).attr("style",n).attr("d",d);return i.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",u/2).attr("x2",l/2).attr("y2",u/2),o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>o.node()),Pr(e,f),e.calcIntersect=function(p,g){return Tr.rect(p,g)},e.intersect=function(p){return Tr.rect(e,p)},i}C(Dxt,"defaultMindmapNode");async function Lxt(t,e){const r={padding:e.padding??0};return Rbe(t,e,r)}C(Lxt,"mindmapCircle");var Vrn=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:ixt},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:txt},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:axt},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:cxt},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Tbt},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:Sbt},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Rbe},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:_xt},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Rxt},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:Zbt},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Mbt},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Qbt},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Vbt},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:mxt},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:zbt},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Obt},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:dxt},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:fbt},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:rxt},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:lxt},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:oxt},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Dbt},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Ibt},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:vbt},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:ybt},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:bbt},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Gbt},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:wxt},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Lbt},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:gxt},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:Ybt},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:xbt},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Cbt},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:xxt},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Txt},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:kbt},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:vxt},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Rbt},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:nxt},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:Xbt},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:jbt},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:dbt},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:mbt},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:hxt},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:uxt},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:Axt},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:Jbt},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:qbt}],Qrn=C(()=>{const e=[...Object.entries({state:sxt,choice:pbt,note:Kbt,rectWithTitle:ext,labelRect:Ubt,iconSquare:$bt,iconCircle:Nbt,icon:Pbt,iconRounded:Bbt,imageSquare:Fbt,anchor:ubt,kanbanItem:Ext,mindmapCircle:Lxt,defaultMindmapNode:Dxt,classBox:Oxt,erBox:Lbe,requirementBox:kxt}),...Vrn.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),Mxt=Qrn();function Ixt(t){return t in Mxt}C(Ixt,"isValidShape");var nX=new Map;async function S7(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const a=e.shape?Mxt[e.shape]:void 0;if(!a)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let s;r.config.securityLevel==="sandbox"?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s??null),i=await a(n,e,r)}else i=await a(t,e,r),n=i;return n.attr("data-look",_l(e.look)),e.tooltip&&i.attr("title",e.tooltip),nX.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}C(S7,"insertNode");var Grn=C((t,e)=>{nX.set(e.id,t)},"setNodeElem"),Pxt=C(()=>{nX.clear()},"clear"),iX=C(t=>{const e=nX.get(t.id);me.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode"),i0=C((t,e)=>{if(e)return"translate("+-t.width/2+", "+-t.height/2+")";const r=t.x??0,n=t.y??0;return"translate("+-(r+t.width/2)+", "+-(n+t.height/2)+")"},"computeLabelTransform"),Rl={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},Nxt={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function C7(t,e){if(t===void 0||e===void 0)return{angle:0,deltaX:0,deltaY:0};t=fs(t),e=fs(e);const[r,n]=[t.x,t.y],[i,a]=[e.x,e.y],s=i-r,o=a-n;return{angle:Math.atan(o/s),deltaX:s,deltaY:o}}C(C7,"calculateDeltaAndAngle");var fs=C(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),Bxt=C(t=>({x:C(function(e,r,n){let i=0;const a=fs(n[0]).x=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Rl,t.arrowTypeEnd)){const{angle:p,deltaX:g}=C7(n[n.length-1],n[n.length-2]);i=Rl[t.arrowTypeEnd]*Math.cos(p)*(g>=0?1:-1)}const s=Math.abs(fs(e).x-fs(n[n.length-1]).x),o=Math.abs(fs(e).y-fs(n[n.length-1]).y),l=Math.abs(fs(e).x-fs(n[0]).x),u=Math.abs(fs(e).y-fs(n[0]).y),h=Rl[t.arrowTypeStart],d=Rl[t.arrowTypeEnd],f=1;if(s0&&o0&&u=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Rl,t.arrowTypeEnd)){const{angle:p,deltaY:g}=C7(n[n.length-1],n[n.length-2]);i=Rl[t.arrowTypeEnd]*Math.abs(Math.sin(p))*(g>=0?1:-1)}const s=Math.abs(fs(e).y-fs(n[n.length-1]).y),o=Math.abs(fs(e).x-fs(n[n.length-1]).x),l=Math.abs(fs(e).y-fs(n[0]).y),u=Math.abs(fs(e).x-fs(n[0]).x),h=Rl[t.arrowTypeStart],d=Rl[t.arrowTypeEnd],f=1;if(s0&&o0&&u{e.arrowTypeStart&&$xt(t,"start",e.arrowTypeStart,r,n,i,a,s),e.arrowTypeEnd&&$xt(t,"end",e.arrowTypeEnd,r,n,i,a,s)},"addEdgeMarkers"),Wrn={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},Yrn=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],$xt=C((t,e,r,n,i,a,s=!1,o)=>{var g;const l=Wrn[r],u=l&&Yrn.includes(l.type);if(!l){me.warn(`Unknown arrow type: ${r}`);return}const h=l.type,p=`${i}_${a}-${h}${e==="start"?"Start":"End"}${s&&u?"-margin":""}`;if(o&&o.trim()!==""){const m=o.replace(/[^\dA-Za-z]/g,"_"),v=`${p}_${m}`;if(!document.getElementById(v)){const y=document.getElementById(p);if(y){const b=y.cloneNode(!0);b.id=v,b.querySelectorAll("path, circle, line").forEach(w=>{w.setAttribute("stroke",o),l.fill&&w.setAttribute("fill",o)}),(g=y.parentNode)==null||g.appendChild(b)}}t.attr(`marker-${e}`,`url(${n}#${v})`)}else t.attr(`marker-${e}`,`url(${n}#${p})`)},"addEdgeMarker"),qrn=C(t=>{var e,r;return typeof t=="string"?t:(r=(e=He())==null?void 0:e.flowchart)==null?void 0:r.curve},"resolveEdgeCurveType"),O7=new Map,oo=new Map,Fxt=C(()=>{O7.clear(),oo.clear()},"clear"),k7=C(t=>t?typeof t=="string"?t:t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),aX=C(async(t,e)=>{const r=He();let n=Zi(r);const{labelStyles:i}=Or(e);e.labelStyle=i;const a=t.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label").attr("data-id",e.id),o=e.labelType==="markdown",u=await Zc(t,e.label,{style:k7(e.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1,markdown:o,width:o?void 0:void 0},r);s.node().appendChild(u),me.info("abc82",e,e.labelType);let h=u.getBBox(),d=h;if(n){const p=u.children[0],g=Ot(u);h=p.getBoundingClientRect(),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const p=Ot(u).select("text").node();p&&typeof p.getBBox=="function"&&(d=p.getBBox())}s.attr("transform",i0(d,n)),O7.set(e.id,a),e.width=h.width,e.height=h.height;let f;if(e.startLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Zx(g,e.startLabelLeft,k7(e.labelStyle)||"",!1,!1);f=m;let v=m.getBBox();if(n){const y=m.children[0],b=Ot(m);v=y.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",i0(v,n)),oo.get(e.id)||oo.set(e.id,{}),oo.get(e.id).startLeft=p,E7(f,e.startLabelLeft)}if(e.startLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Zx(g,e.startLabelRight,k7(e.labelStyle)||"",!1,!1);f=m;let v=m.getBBox();if(n){const y=m.children[0],b=Ot(m);v=y.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",i0(v,n)),oo.get(e.id)||oo.set(e.id,{}),oo.get(e.id).startRight=p,E7(f,e.startLabelRight)}if(e.endLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Zx(p,e.endLabelLeft,k7(e.labelStyle)||"",!1,!1);f=m;let v=m.getBBox();if(n){const y=m.children[0],b=Ot(m);v=y.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",i0(v,n)),oo.get(e.id)||oo.set(e.id,{}),oo.get(e.id).endLeft=p,E7(f,e.endLabelLeft)}if(e.endLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Zx(p,e.endLabelRight,k7(e.labelStyle)||"",!1,!1);f=m;let v=m.getBBox();if(n){const y=m.children[0],b=Ot(m);v=y.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",i0(v,n)),oo.get(e.id)||oo.set(e.id,{}),oo.get(e.id).endRight=p,E7(f,e.endLabelRight)}return u},"insertEdgeLabel");function E7(t,e){Zi(He())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}C(E7,"setTerminalWidth");var zxt=C((t,e)=>{me.debug("Moving label abc88 ",t.id,t.label,O7.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=He(),{subGraphTitleTotalMargin:i}=q5(n);if(t.label){const a=O7.get(t.id);let s=t.x,o=t.y;if(r){const l=ln.calcLabelPosition(r);me.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t.startLabelLeft){const a=oo.get(t.id).startLeft;let s=t.x,o=t.y;if(r){const l=ln.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=oo.get(t.id).startRight;let s=t.x,o=t.y;if(r){const l=ln.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=oo.get(t.id).endLeft;let s=t.x,o=t.y;if(r){const l=ln.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=oo.get(t.id).endRight;let s=t.x,o=t.y;if(r){const l=ln.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),jrn=C((t,e)=>{var s;if(!(t!=null&&t.isLabelEdge)||!((s=t==null?void 0:t.id)!=null&&s.endsWith("-to-label"))||!Array.isArray(e)||e.length!==2)return e;const[r,n]=e,i=Math.abs(n.x-r.x),a=Math.abs(n.y-r.y);return i<.001||a<.001?e:a>=i?[r,{x:r.x,y:n.y},n]:[r,{x:n.x,y:r.y},n]},"orthogonalizeToLabelClippedPoints"),Xrn=C((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),Krn=C((t,e,r)=>{me.debug(`intersection calc abc89: + `;if(!e.domId)throw new Error(`defaultMindmapNode: node "${e.id}" is missing a domId — was render.ts domId prefixing skipped?`);const f=i.append("path").attr("id",e.domId).attr("class","node-bkg node-"+e.type).attr("style",n).attr("d",d);return i.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",u/2).attr("x2",l/2).attr("y2",u/2),o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>o.node()),Pr(e,f),e.calcIntersect=function(p,g){return Sr.rect(p,g)},e.intersect=function(p){return Sr.rect(e,p)},i}C(Dxt,"defaultMindmapNode");async function Lxt(t,e){const r={padding:e.padding??0};return Rbe(t,e,r)}C(Lxt,"mindmapCircle");var Vrn=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:ixt},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:txt},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:axt},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:cxt},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Sbt},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:Tbt},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Rbe},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:_xt},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Rxt},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:Zbt},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Mbt},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Qbt},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Vbt},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:mxt},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:zbt},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Obt},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:dxt},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:fbt},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:rxt},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:lxt},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:oxt},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Dbt},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Ibt},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:vbt},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:ybt},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:bbt},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Gbt},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:wxt},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Lbt},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:gxt},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:Ybt},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:xbt},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Cbt},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:xxt},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Sxt},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:kbt},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:vxt},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Rbt},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:nxt},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:Xbt},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:jbt},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:dbt},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:mbt},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:hxt},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:uxt},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:Axt},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:Jbt},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:qbt}],Qrn=C(()=>{const e=[...Object.entries({state:sxt,choice:pbt,note:Kbt,rectWithTitle:ext,labelRect:Ubt,iconSquare:$bt,iconCircle:Nbt,icon:Pbt,iconRounded:Bbt,imageSquare:Fbt,anchor:ubt,kanbanItem:Ext,mindmapCircle:Lxt,defaultMindmapNode:Dxt,classBox:Oxt,erBox:Lbe,requirementBox:kxt}),...Vrn.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),Mxt=Qrn();function Ixt(t){return t in Mxt}C(Ixt,"isValidShape");var nX=new Map;async function T7(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const a=e.shape?Mxt[e.shape]:void 0;if(!a)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let s;r.config.securityLevel==="sandbox"?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s??null),i=await a(n,e,r)}else i=await a(t,e,r),n=i;return n.attr("data-look",_l(e.look)),e.tooltip&&i.attr("title",e.tooltip),nX.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}C(T7,"insertNode");var Grn=C((t,e)=>{nX.set(e.id,t)},"setNodeElem"),Pxt=C(()=>{nX.clear()},"clear"),iX=C(t=>{const e=nX.get(t.id);me.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode"),i0=C((t,e)=>{if(e)return"translate("+-t.width/2+", "+-t.height/2+")";const r=t.x??0,n=t.y??0;return"translate("+-(r+t.width/2)+", "+-(n+t.height/2)+")"},"computeLabelTransform"),Rl={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},Nxt={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function C7(t,e){if(t===void 0||e===void 0)return{angle:0,deltaX:0,deltaY:0};t=fs(t),e=fs(e);const[r,n]=[t.x,t.y],[i,a]=[e.x,e.y],s=i-r,o=a-n;return{angle:Math.atan(o/s),deltaX:s,deltaY:o}}C(C7,"calculateDeltaAndAngle");var fs=C(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),Bxt=C(t=>({x:C(function(e,r,n){let i=0;const a=fs(n[0]).x=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Rl,t.arrowTypeEnd)){const{angle:p,deltaX:g}=C7(n[n.length-1],n[n.length-2]);i=Rl[t.arrowTypeEnd]*Math.cos(p)*(g>=0?1:-1)}const s=Math.abs(fs(e).x-fs(n[n.length-1]).x),o=Math.abs(fs(e).y-fs(n[n.length-1]).y),l=Math.abs(fs(e).x-fs(n[0]).x),u=Math.abs(fs(e).y-fs(n[0]).y),h=Rl[t.arrowTypeStart],d=Rl[t.arrowTypeEnd],f=1;if(s0&&o0&&u=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Rl,t.arrowTypeEnd)){const{angle:p,deltaY:g}=C7(n[n.length-1],n[n.length-2]);i=Rl[t.arrowTypeEnd]*Math.abs(Math.sin(p))*(g>=0?1:-1)}const s=Math.abs(fs(e).y-fs(n[n.length-1]).y),o=Math.abs(fs(e).x-fs(n[n.length-1]).x),l=Math.abs(fs(e).y-fs(n[0]).y),u=Math.abs(fs(e).x-fs(n[0]).x),h=Rl[t.arrowTypeStart],d=Rl[t.arrowTypeEnd],f=1;if(s0&&o0&&u{e.arrowTypeStart&&$xt(t,"start",e.arrowTypeStart,r,n,i,a,s),e.arrowTypeEnd&&$xt(t,"end",e.arrowTypeEnd,r,n,i,a,s)},"addEdgeMarkers"),Wrn={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},Yrn=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],$xt=C((t,e,r,n,i,a,s=!1,o)=>{var g;const l=Wrn[r],u=l&&Yrn.includes(l.type);if(!l){me.warn(`Unknown arrow type: ${r}`);return}const h=l.type,p=`${i}_${a}-${h}${e==="start"?"Start":"End"}${s&&u?"-margin":""}`;if(o&&o.trim()!==""){const m=o.replace(/[^\dA-Za-z]/g,"_"),v=`${p}_${m}`;if(!document.getElementById(v)){const y=document.getElementById(p);if(y){const b=y.cloneNode(!0);b.id=v,b.querySelectorAll("path, circle, line").forEach(w=>{w.setAttribute("stroke",o),l.fill&&w.setAttribute("fill",o)}),(g=y.parentNode)==null||g.appendChild(b)}}t.attr(`marker-${e}`,`url(${n}#${v})`)}else t.attr(`marker-${e}`,`url(${n}#${p})`)},"addEdgeMarker"),qrn=C(t=>{var e,r;return typeof t=="string"?t:(r=(e=He())==null?void 0:e.flowchart)==null?void 0:r.curve},"resolveEdgeCurveType"),O7=new Map,oo=new Map,Fxt=C(()=>{O7.clear(),oo.clear()},"clear"),k7=C(t=>t?typeof t=="string"?t:t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),aX=C(async(t,e)=>{const r=He();let n=Zi(r);const{labelStyles:i}=Or(e);e.labelStyle=i;const a=t.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label").attr("data-id",e.id),o=e.labelType==="markdown",u=await Zc(t,e.label,{style:k7(e.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1,markdown:o,width:o?void 0:void 0},r);s.node().appendChild(u),me.info("abc82",e,e.labelType);let h=u.getBBox(),d=h;if(n){const p=u.children[0],g=Ot(u);h=p.getBoundingClientRect(),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const p=Ot(u).select("text").node();p&&typeof p.getBBox=="function"&&(d=p.getBBox())}s.attr("transform",i0(d,n)),O7.set(e.id,a),e.width=h.width,e.height=h.height;let f;if(e.startLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Zx(g,e.startLabelLeft,k7(e.labelStyle)||"",!1,!1);f=m;let v=m.getBBox();if(n){const y=m.children[0],b=Ot(m);v=y.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",i0(v,n)),oo.get(e.id)||oo.set(e.id,{}),oo.get(e.id).startLeft=p,E7(f,e.startLabelLeft)}if(e.startLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Zx(g,e.startLabelRight,k7(e.labelStyle)||"",!1,!1);f=m;let v=m.getBBox();if(n){const y=m.children[0],b=Ot(m);v=y.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",i0(v,n)),oo.get(e.id)||oo.set(e.id,{}),oo.get(e.id).startRight=p,E7(f,e.startLabelRight)}if(e.endLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Zx(p,e.endLabelLeft,k7(e.labelStyle)||"",!1,!1);f=m;let v=m.getBBox();if(n){const y=m.children[0],b=Ot(m);v=y.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",i0(v,n)),oo.get(e.id)||oo.set(e.id,{}),oo.get(e.id).endLeft=p,E7(f,e.endLabelLeft)}if(e.endLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Zx(p,e.endLabelRight,k7(e.labelStyle)||"",!1,!1);f=m;let v=m.getBBox();if(n){const y=m.children[0],b=Ot(m);v=y.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",i0(v,n)),oo.get(e.id)||oo.set(e.id,{}),oo.get(e.id).endRight=p,E7(f,e.endLabelRight)}return u},"insertEdgeLabel");function E7(t,e){Zi(He())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}C(E7,"setTerminalWidth");var zxt=C((t,e)=>{me.debug("Moving label abc88 ",t.id,t.label,O7.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=He(),{subGraphTitleTotalMargin:i}=q5(n);if(t.label){const a=O7.get(t.id);let s=t.x,o=t.y;if(r){const l=ln.calcLabelPosition(r);me.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t.startLabelLeft){const a=oo.get(t.id).startLeft;let s=t.x,o=t.y;if(r){const l=ln.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=oo.get(t.id).startRight;let s=t.x,o=t.y;if(r){const l=ln.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=oo.get(t.id).endLeft;let s=t.x,o=t.y;if(r){const l=ln.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=oo.get(t.id).endRight;let s=t.x,o=t.y;if(r){const l=ln.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),jrn=C((t,e)=>{var s;if(!(t!=null&&t.isLabelEdge)||!((s=t==null?void 0:t.id)!=null&&s.endsWith("-to-label"))||!Array.isArray(e)||e.length!==2)return e;const[r,n]=e,i=Math.abs(n.x-r.x),a=Math.abs(n.y-r.y);return i<.001||a<.001?e:a>=i?[r,{x:r.x,y:n.y},n]:[r,{x:n.x,y:r.y},n]},"orthogonalizeToLabelClippedPoints"),Xrn=C((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),Krn=C((t,e,r)=>{me.debug(`intersection calc abc89: outsidePoint: ${JSON.stringify(e)} insidePoint : ${JSON.stringify(r)} - node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{me.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(me.info("abc88 checking point",a,e),!Xrn(e,a)&&!i){const s=Krn(e,n,a);me.debug("abc88 inside",a,n,s),me.debug("abc88 intersection",s,e);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)?me.warn("abc88 no intersect",s,r):r.push(s),i=!0}else me.warn("abc88 outside",a,n),n=a,i||r.push(a)}),me.debug("returning points",r),r},"cutPathAtIntersect");function Vxt(t){const e=[],r=[];for(let n=1;n5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===s.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-s.y)>5)&&(e.push(a),r.push(n))}return{cornerPoints:e,cornerPointPositions:r}}C(Vxt,"extractCornerPoints");var Qxt=C(function(t,e,r){const n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),s=r/a;return{x:e.x-s*n,y:e.y-s*i}},"findAdjacentPoint"),Zrn=C(function(t){const{cornerPointPositions:e}=Vxt(t),r=[];for(let n=0;n10&&Math.abs(a.y-i.y)>=10){me.debug("Corner point fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));const p=5;s.x===o.x?f={x:u<0?o.x-p+d:o.x+p-d,y:h<0?o.y-d:o.y+d}:f={x:u<0?o.x-d:o.x+d,y:h<0?o.y-p+d:o.y+p-d}}else me.debug("Corner point skipping fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));r.push(f,l)}else r.push(t[n]);return r},"fixCorners"),Jrn=C((t,e,r)=>{const n=t-e-r,i=2,a=2,s=i+a,o=Math.floor(n/s),l=Array(o).fill(`${i} ${a}`).join(" ");return`0 ${e} ${l} ${r}`},"generateDashArray"),Mbe=C(function(t,e,r,n,i,a,s,o=!1){var N;if(!s)throw new Error(`insertEdge: missing diagramId for edge "${e.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l,layout:u}=He();let h=e.points,d=!1;const f=i;var p=a;const g=[];for(const F in e.cssCompiledStyles)B1e(F)||g.push(e.cssCompiledStyles[F]);if(u==="swimlane"){if(p.intersect&&f.intersect&&Array.isArray(h)&&h.length>=2)if(h.length===2)h=[f.intersect(h[0]),p.intersect(h[1])];else{const F=h.slice(1,-1),B=F[0],V=F[F.length-1],z=.5,U=Math.abs(h[h.length-1].x-V.x)!Number.isNaN(F.y));const y=qrn(e.curve);y!=="rounded"&&(v=Zrn(v));let b=t7;switch(y){case"linear":b=t7;break;case"basis":b=n7;break;case"cardinal":b=m0t;break;case"bumpX":b=h0t;break;case"bumpY":b=d0t;break;case"catmullRom":b=y0t;break;case"monotoneX":b=k0t;break;case"monotoneY":b=E0t;break;case"natural":b=D0t;break;case"step":b=L0t;break;case"stepAfter":b=I0t;break;case"stepBefore":b=M0t;break;case"rounded":b=t7;break;default:b=n7}const{x,y:w}=Bxt(e),A=r7().x(x).y(w).curve(b);let T;switch(e.thickness){case"normal":T="edge-thickness-normal";break;case"thick":T="edge-thickness-thick";break;case"invisible":T="edge-thickness-invisible";break;default:T="edge-thickness-normal"}switch(e.pattern){case"solid":T+=" edge-pattern-solid";break;case"dotted":T+=" edge-pattern-dotted";break;case"dashed":T+=" edge-pattern-dashed";break;default:T+=" edge-pattern-solid"}let S,O=y==="rounded"?Gxt(Hxt(v,e),5):A(v);const k=Array.isArray(e.style)?e.style:[e.style];let E=k.find(F=>F==null?void 0:F.startsWith("stroke:")),_="";e.animate&&(_="edge-animation-fast"),e.animation&&(_="edge-animation-"+e.animation);let I=!1;if(e.look==="handDrawn"){const F=Er.svg(t);Object.assign([],v);const B=F.path(O,{roughness:.3,seed:l});T+=" transition",S=Ot(B).select("path").attr("id",`${s}-${e.id}`).attr("class"," "+T+(e.classes?" "+e.classes:"")+(_?" "+_:"")).attr("style",k?k.reduce((z,U)=>z+";"+U,""):"");let V=S.attr("d");S.attr("d",V),t.node().appendChild(S.node())}else{const F=g.join(";"),B=k?k.reduce((X,Y)=>X+Y+";",""):"",V=(F?F+";"+B+";":B)+";"+(k?k.reduce((X,Y)=>X+";"+Y,""):"");S=t.append("path").attr("d",O).attr("id",`${s}-${e.id}`).attr("class"," "+T+(e.classes?" "+e.classes:"")+(_?" "+_:"")).attr("style",V),E=(N=V.match(/stroke:([^;]+)/))==null?void 0:N[1],I=e.animate===!0||!!e.animation||F.includes("animation");const z=S.node(),U=typeof z.getTotalLength=="function"?z.getTotalLength():0,Q=Nxt[e.arrowTypeStart]||0,G=Nxt[e.arrowTypeEnd]||0;if(e.look==="neo"&&!I){const Y=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?Jrn(U,Q,G):`0 ${Q} ${U-Q-G} ${G}`}; stroke-dashoffset: 0;`;S.attr("style",Y+S.attr("style"))}}S.attr("data-edge",!0),S.attr("data-et","edge"),S.attr("data-id",e.id),S.attr("data-points",m),S.attr("data-look",_l(e.look)),e.showPoints&&v.forEach(F=>{t.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",F.x).attr("cy",F.y)});let L="";(He().flowchart.arrowMarkerAbsolute||He().state.arrowMarkerAbsolute)&&(L=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,L=L.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),me.info("arrowTypeStart",e.arrowTypeStart),me.info("arrowTypeEnd",e.arrowTypeEnd);const R=!I&&(e==null?void 0:e.look)==="neo";Hrn(S,e,L,s,n,R,E);const D=Math.floor(h.length/2),M=h[D];ln.isLabelCoordinateInPath(M,S.attr("d"))||(d=!0);let P={};return d&&(P.updatedPath=h),P.originalPath=e.points,P},"insertEdge");function Gxt(t,e){if(t.length<2)return"";let r="";const n=t.length,i=1e-5;for(let a=0;a({...i}));if(t.length>=2&&Rl[e.arrowTypeStart]){const i=Rl[e.arrowTypeStart],a=t[0],s=t[1],{angle:o}=Ibe(a,s),l=i*Math.cos(o),u=i*Math.sin(o);r[0].x=a.x+l,r[0].y=a.y+u}const n=t.length;if(n>=2&&Rl[e.arrowTypeEnd]){const i=Rl[e.arrowTypeEnd],a=t[n-1],s=t[n-2],{angle:o}=Ibe(s,a),l=i*Math.cos(o),u=i*Math.sin(o);r[n-1].x=a.x-l,r[n-1].y=a.y-u}return r}C(Hxt,"applyMarkerOffsetsToPoints");var enn=C((t,e,r,n)=>{e.forEach(i=>{Tnn[i](t,r,n)})},"insertMarkers"),tnn=C((t,e,r)=>{me.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),t.append("marker").attr("id",r+"_"+e+"-extensionStart-margin").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd-margin").attr("class","marker extension "+e).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),rnn=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart-margin").attr("class","marker composition "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd-margin").attr("class","marker composition "+e).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),nnn=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart-margin").attr("class","marker aggregation "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd-margin").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),inn=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart-margin").attr("class","marker dependency "+e).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd-margin").attr("class","marker dependency "+e).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),ann=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart-margin").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd-margin").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),snn=C((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),onn=C((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),lnn=C((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossEnd-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),t.append("marker").attr("id",r+"_"+e+"-crossStart-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),cnn=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),unn=C((t,e,r)=>{const n=Dr(),{themeVariables:i}=n,{transitionColor:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${a}`)},"barbNeo"),hnn=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),dnn=C((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),fnn=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),pnn=C((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),gnn=C((t,e,r)=>{const n=Dr(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${a}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${a}`)},"only_one_neo"),mnn=C((t,e,r)=>{const n=Dr(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:s}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");o.append("circle").attr("fill",s??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),o.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${a}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",s??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${a}`)},"zero_or_one_neo"),vnn=C((t,e,r)=>{const n=Dr(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${a}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${a}`)},"one_or_more_neo"),ynn=C((t,e,r)=>{const n=Dr(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:s}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");o.append("circle").attr("fill",s??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),o.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${a}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",s??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${a}`)},"zero_or_more_neo"),bnn=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0 + node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{me.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(me.info("abc88 checking point",a,e),!Xrn(e,a)&&!i){const s=Krn(e,n,a);me.debug("abc88 inside",a,n,s),me.debug("abc88 intersection",s,e);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)?me.warn("abc88 no intersect",s,r):r.push(s),i=!0}else me.warn("abc88 outside",a,n),n=a,i||r.push(a)}),me.debug("returning points",r),r},"cutPathAtIntersect");function Vxt(t){const e=[],r=[];for(let n=1;n5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===s.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-s.y)>5)&&(e.push(a),r.push(n))}return{cornerPoints:e,cornerPointPositions:r}}C(Vxt,"extractCornerPoints");var Qxt=C(function(t,e,r){const n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),s=r/a;return{x:e.x-s*n,y:e.y-s*i}},"findAdjacentPoint"),Zrn=C(function(t){const{cornerPointPositions:e}=Vxt(t),r=[];for(let n=0;n10&&Math.abs(a.y-i.y)>=10){me.debug("Corner point fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));const p=5;s.x===o.x?f={x:u<0?o.x-p+d:o.x+p-d,y:h<0?o.y-d:o.y+d}:f={x:u<0?o.x-d:o.x+d,y:h<0?o.y-p+d:o.y+p-d}}else me.debug("Corner point skipping fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));r.push(f,l)}else r.push(t[n]);return r},"fixCorners"),Jrn=C((t,e,r)=>{const n=t-e-r,i=2,a=2,s=i+a,o=Math.floor(n/s),l=Array(o).fill(`${i} ${a}`).join(" ");return`0 ${e} ${l} ${r}`},"generateDashArray"),Mbe=C(function(t,e,r,n,i,a,s,o=!1){var N;if(!s)throw new Error(`insertEdge: missing diagramId for edge "${e.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l,layout:u}=He();let h=e.points,d=!1;const f=i;var p=a;const g=[];for(const F in e.cssCompiledStyles)B1e(F)||g.push(e.cssCompiledStyles[F]);if(u==="swimlane"){if(p.intersect&&f.intersect&&Array.isArray(h)&&h.length>=2)if(h.length===2)h=[f.intersect(h[0]),p.intersect(h[1])];else{const F=h.slice(1,-1),B=F[0],V=F[F.length-1],z=.5,U=Math.abs(h[h.length-1].x-V.x)!Number.isNaN(F.y));const y=qrn(e.curve);y!=="rounded"&&(v=Zrn(v));let b=t7;switch(y){case"linear":b=t7;break;case"basis":b=n7;break;case"cardinal":b=m0t;break;case"bumpX":b=h0t;break;case"bumpY":b=d0t;break;case"catmullRom":b=y0t;break;case"monotoneX":b=k0t;break;case"monotoneY":b=E0t;break;case"natural":b=D0t;break;case"step":b=L0t;break;case"stepAfter":b=I0t;break;case"stepBefore":b=M0t;break;case"rounded":b=t7;break;default:b=n7}const{x,y:w}=Bxt(e),A=r7().x(x).y(w).curve(b);let S;switch(e.thickness){case"normal":S="edge-thickness-normal";break;case"thick":S="edge-thickness-thick";break;case"invisible":S="edge-thickness-invisible";break;default:S="edge-thickness-normal"}switch(e.pattern){case"solid":S+=" edge-pattern-solid";break;case"dotted":S+=" edge-pattern-dotted";break;case"dashed":S+=" edge-pattern-dashed";break;default:S+=" edge-pattern-solid"}let T,O=y==="rounded"?Gxt(Hxt(v,e),5):A(v);const k=Array.isArray(e.style)?e.style:[e.style];let E=k.find(F=>F==null?void 0:F.startsWith("stroke:")),_="";e.animate&&(_="edge-animation-fast"),e.animation&&(_="edge-animation-"+e.animation);let I=!1;if(e.look==="handDrawn"){const F=Er.svg(t);Object.assign([],v);const B=F.path(O,{roughness:.3,seed:l});S+=" transition",T=Ot(B).select("path").attr("id",`${s}-${e.id}`).attr("class"," "+S+(e.classes?" "+e.classes:"")+(_?" "+_:"")).attr("style",k?k.reduce((z,U)=>z+";"+U,""):"");let V=T.attr("d");T.attr("d",V),t.node().appendChild(T.node())}else{const F=g.join(";"),B=k?k.reduce((X,Y)=>X+Y+";",""):"",V=(F?F+";"+B+";":B)+";"+(k?k.reduce((X,Y)=>X+";"+Y,""):"");T=t.append("path").attr("d",O).attr("id",`${s}-${e.id}`).attr("class"," "+S+(e.classes?" "+e.classes:"")+(_?" "+_:"")).attr("style",V),E=(N=V.match(/stroke:([^;]+)/))==null?void 0:N[1],I=e.animate===!0||!!e.animation||F.includes("animation");const z=T.node(),U=typeof z.getTotalLength=="function"?z.getTotalLength():0,Q=Nxt[e.arrowTypeStart]||0,G=Nxt[e.arrowTypeEnd]||0;if(e.look==="neo"&&!I){const Y=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?Jrn(U,Q,G):`0 ${Q} ${U-Q-G} ${G}`}; stroke-dashoffset: 0;`;T.attr("style",Y+T.attr("style"))}}T.attr("data-edge",!0),T.attr("data-et","edge"),T.attr("data-id",e.id),T.attr("data-points",m),T.attr("data-look",_l(e.look)),e.showPoints&&v.forEach(F=>{t.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",F.x).attr("cy",F.y)});let L="";(He().flowchart.arrowMarkerAbsolute||He().state.arrowMarkerAbsolute)&&(L=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,L=L.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),me.info("arrowTypeStart",e.arrowTypeStart),me.info("arrowTypeEnd",e.arrowTypeEnd);const R=!I&&(e==null?void 0:e.look)==="neo";Hrn(T,e,L,s,n,R,E);const D=Math.floor(h.length/2),M=h[D];ln.isLabelCoordinateInPath(M,T.attr("d"))||(d=!0);let P={};return d&&(P.updatedPath=h),P.originalPath=e.points,P},"insertEdge");function Gxt(t,e){if(t.length<2)return"";let r="";const n=t.length,i=1e-5;for(let a=0;a({...i}));if(t.length>=2&&Rl[e.arrowTypeStart]){const i=Rl[e.arrowTypeStart],a=t[0],s=t[1],{angle:o}=Ibe(a,s),l=i*Math.cos(o),u=i*Math.sin(o);r[0].x=a.x+l,r[0].y=a.y+u}const n=t.length;if(n>=2&&Rl[e.arrowTypeEnd]){const i=Rl[e.arrowTypeEnd],a=t[n-1],s=t[n-2],{angle:o}=Ibe(s,a),l=i*Math.cos(o),u=i*Math.sin(o);r[n-1].x=a.x-l,r[n-1].y=a.y-u}return r}C(Hxt,"applyMarkerOffsetsToPoints");var enn=C((t,e,r,n)=>{e.forEach(i=>{Snn[i](t,r,n)})},"insertMarkers"),tnn=C((t,e,r)=>{me.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),t.append("marker").attr("id",r+"_"+e+"-extensionStart-margin").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd-margin").attr("class","marker extension "+e).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),rnn=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart-margin").attr("class","marker composition "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd-margin").attr("class","marker composition "+e).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),nnn=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart-margin").attr("class","marker aggregation "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd-margin").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),inn=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart-margin").attr("class","marker dependency "+e).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd-margin").attr("class","marker dependency "+e).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),ann=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart-margin").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd-margin").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),snn=C((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),onn=C((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),lnn=C((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossEnd-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),t.append("marker").attr("id",r+"_"+e+"-crossStart-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),cnn=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),unn=C((t,e,r)=>{const n=Dr(),{themeVariables:i}=n,{transitionColor:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${a}`)},"barbNeo"),hnn=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),dnn=C((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),fnn=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),pnn=C((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),gnn=C((t,e,r)=>{const n=Dr(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${a}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${a}`)},"only_one_neo"),mnn=C((t,e,r)=>{const n=Dr(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:s}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");o.append("circle").attr("fill",s??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),o.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${a}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",s??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${a}`)},"zero_or_one_neo"),vnn=C((t,e,r)=>{const n=Dr(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${a}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${a}`)},"one_or_more_neo"),ynn=C((t,e,r)=>{const n=Dr(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:s}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");o.append("circle").attr("fill",s??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),o.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${a}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",s??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${a}`)},"zero_or_more_neo"),bnn=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0 L20,10 M20,10 L0,20`)},"requirement_arrow"),xnn=C((t,e,r)=>{const n=Dr(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${a}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0 L20,10 M20,10 - L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),wnn=C((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),Ann=C((t,e,r)=>{const n=Dr(),{themeVariables:i}=n,{strokeWidth:a}=i,s=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");s.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),s.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),s.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),s.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),Tnn={extension:tnn,composition:rnn,aggregation:nnn,dependency:inn,lollipop:ann,point:snn,circle:onn,cross:lnn,barb:cnn,barbNeo:unn,only_one:hnn,zero_or_one:dnn,one_or_more:fnn,zero_or_more:pnn,only_one_neo:gnn,zero_or_one_neo:mnn,one_or_more_neo:vnn,zero_or_more_neo:ynn,requirement_arrow:bnn,requirement_contains:wnn,requirement_arrow_neo:xnn,requirement_contains_neo:Ann},Pbe=enn,Snn={common:jt,getConfig:Dr,insertCluster:tX,insertEdge:Mbe,insertEdgeLabel:aX,insertMarkers:Pbe,insertNode:S7,interpolateToCurve:q1e,labelHelper:pn,log:me,positionEdgeLabel:zxt},_7={},Wxt=C(t=>{for(const e of t)_7[e.name]=e},"registerLayoutLoaders"),Cnn=C(()=>{Wxt([{name:"dagre",loader:C(async()=>await Promise.resolve().then(()=>vkn),"loader")},{name:"swimlane",loader:C(async()=>await Promise.resolve().then(()=>_kn),"loader")},{name:"cose-bilkent",loader:C(async()=>await Promise.resolve().then(()=>gDn),"loader")}])},"registerDefaultLayoutLoaders");Cnn();var e4=C(async(t,e,r)=>{if(!(t.layoutAlgorithm in _7))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);if(t.diagramId)for(const d of t.nodes){const f=d.domId||d.id;d.domId=`${t.diagramId}-${f}`}const n=_7[t.layoutAlgorithm],i=await n.loader(),{theme:a,themeVariables:s}=t.config,{useGradient:o,gradientStart:l,gradientStop:u}=s,h=e.attr("id");if(e.append("defs").append("filter").attr("id",`${h}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a!=null&&a.includes("dark")?"#FFFFFF":"#000000"}`),e.append("defs").append("filter").attr("id",`${h}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a!=null&&a.includes("dark")?"#FFFFFF":"#000000"}`),o){const d=e.append("linearGradient").attr("id",e.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");d.append("svg:stop").attr("offset","0%").attr("stop-color",l).attr("stop-opacity",1),d.append("svg:stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}return i.render(t,e,Snn,{algorithm:n.algorithm},r)},"render"),R7=C((t="",{fallback:e="dagre"}={})=>{if(t in _7)return t;if(e in _7)return me.warn(`Layout algorithm ${t} is not registered. Using ${e} as fallback.`),e;throw new Error(`Both layout algorithms ${t} and ${e} are not registered.`)},"getRegisteredLayoutAlgorithm"),Nbe="comm",Yxt="rule",qxt="decl",Onn="@media",knn="@import",Enn="@supports",_nn="@namespace",Bbe="@keyframes",jxt="@layer",Rnn="@scope",Dnn=Math.abs,D7=String.fromCharCode;function Xxt(t){return t.trim()}function $be(t,e,r){return t.replace(e,r)}function t4(t,e){return t.charCodeAt(e)|0}function r4(t,e,r){return t.slice(e,r)}function a0(t){return t.length}function Kxt(t){return t.length}function sX(t,e){return e.push(t),t}var oX=1,n4=1,Zxt=0,ep=0,_o=0,i4="";function Fbe(t,e,r,n,i,a,s,o){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:oX,column:n4,length:s,return:"",siblings:o}}function Lnn(){return _o}function Mnn(){return _o=ep>0?t4(i4,--ep):0,n4--,_o===10&&(n4=1,oX--),_o}function ug(){return _o=ep2||L7(_o)>3?"":" "}function Bnn(t,e){for(;--e&&ug()&&!(_o<48||_o>102||_o>57&&_o<65||_o>70&&_o<97););return cX(t,lX()+(e<6&&e2()==32&&ug()==32))}function Ube(t){for(;ug();)switch(_o){case t:return ep;case 34:case 39:t!==34&&t!==39&&Ube(_o);break;case 40:t===41&&Ube(t);break;case 92:ug();break}return ep}function $nn(t,e){for(;ug()&&t+_o!==57;)if(t+_o===84&&e2()===47)break;return"/*"+cX(e,ep-1)+"*"+D7(t===47?t:ug())}function Fnn(t){for(;!L7(e2());)ug();return cX(t,ep)}function znn(t){return Pnn(uX("",null,null,null,[""],t=Inn(t),0,[0],t))}function uX(t,e,r,n,i,a,s,o,l){for(var u=0,h=0,d=s,f=0,p=0,g=0,m=1,v=1,y=1,b=0,x=0,w="",A=i,T=a,S=n,O=w;v;)switch(g=x,x=ug()){case 40:g!=108&&t4(O,d-1)==58?(b++,O+="("):O+=zbe(x);break;case 41:b--,O+=")";break;case 34:case 39:case 91:O+=zbe(x);break;case 9:case 10:case 13:case 32:if(b>0){O+=D7(x);break}O+=Nnn(g);break;case 92:O+=Bnn(lX()-1,7);continue;case 47:switch(e2()){case 42:case 47:sX(Unn($nn(ug(),lX()),e,r,l),l),(L7(g||1)==5||L7(e2()||1)==5)&&a0(O)&&r4(O,-1,void 0)!==" "&&(O+=" ");break;default:O+="/"}break;case 123*m:o[u++]=a0(O)*y;case 125*m:case 59:case 0:if(b>0&&x){O+=D7(x);break}switch(x){case 0:case 125:v=0;case 59+h:y==-1&&(O=$be(O,/\f/g,"")),p>0&&(a0(O)-d||m===0)&&sX(p>32?e2t(O+";",n,r,d-1,l):e2t($be(O," ","")+";",n,r,d-2,l),l);break;case 59:O+=";";default:if(sX(S=Jxt(O,e,r,u,h,i,o,w,A=[],T=[],d,a),a),x===123)if(h===0)uX(O,e,S,S,A,a,d,o,T);else{switch(f){case 99:if(t4(O,3)===110)break;case 108:if(t4(O,2)===97)break;default:h=0;case 100:case 109:case 115:}h?uX(t,S,S,n&&sX(Jxt(t,S,S,0,0,i,o,w,i,A=[],d,T),T),i,T,d,o,n?A:T):uX(O,S,S,S,[""],T,0,o,T)}}u=h=p=0,m=y=1,w=O="",d=s;break;case 58:d=1+a0(O),p=g;default:if(m<1){if(x==123)--m;else if(x==125&&m++==0&&Mnn()==125)continue}switch(O+=D7(x),x*m){case 38:y=h>0?1:(O+="\f",-1);break;case 44:if(b>0)break;o[u++]=(a0(O)-1)*y,y=1;break;case 64:e2()===45&&(O+=zbe(ug())),f=e2(),h=d=a0(w=O+=Fnn(lX())),x++;break;case 45:g===45&&a0(O)==2&&(m=0)}}return a}function Jxt(t,e,r,n,i,a,s,o,l,u,h,d){for(var f=i-1,p=i===0?a:[""],g=Kxt(p),m=0,v=0,y=0;m0?p[b]+" "+x:$be(x,/&\f/g,p[b])))&&(l[y++]=w);return Fbe(t,e,r,i===0?Yxt:o,l,u,h,d)}function Unn(t,e,r,n){return Fbe(t,e,r,Nbe,D7(Lnn()),r4(t,2,-2),0,n)}function e2t(t,e,r,n,i){return Fbe(t,e,r,qxt,r4(t,0,n),r4(t,n+1,-1),n,i)}function Vbe(t,e){for(var r="",n=0;n/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),Hnn=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>uLn);return{id:t2t,diagram:t}},"loader"),Wnn={id:t2t,detector:Gnn,loader:Hnn},Ynn=Wnn,r2t="flowchart",qnn=C((t,e)=>{var r,n;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"?!1:/^\s*graph/.test(t)},"detector"),jnn=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Fke);return{id:r2t,diagram:t}},"loader"),Xnn={id:r2t,detector:qnn,loader:jnn},Knn=Xnn,n2t="flowchart-v2",Znn=C((t,e)=>{var r,n,i;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"&&(e.layout="elk"),/^\s*graph/.test(t)&&((i=e==null?void 0:e.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(t))},"detector"),Jnn=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Fke);return{id:n2t,diagram:t}},"loader"),ein={id:n2t,detector:Znn,loader:Jnn},tin=ein,i2t="swimlane",rin=C(t=>/^\s*swimlane-beta\b/.test(t),"detector"),nin=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>CLn);return{id:i2t,diagram:t}},"loader"),iin={id:i2t,detector:rin,loader:nin},ain=iin,a2t="er",sin=C(t=>/^\s*erDiagram/.test(t),"detector"),oin=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>MLn);return{id:a2t,diagram:t}},"loader"),lin={id:a2t,detector:sin,loader:oin},cin=lin,s2t="gitGraph",uin=C(t=>/^\s*gitGraph/.test(t),"detector"),hin=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>NQn);return{id:s2t,diagram:t}},"loader"),din={id:s2t,detector:uin,loader:hin},fin=din,o2t="gantt",pin=C(t=>/^\s*gantt/.test(t),"detector"),gin=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>NGn);return{id:o2t,diagram:t}},"loader"),min={id:o2t,detector:pin,loader:gin},vin=min,l2t="info",yin=C(t=>/^\s*info/.test(t),"detector"),bin=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>GGn);return{id:l2t,diagram:t}},"loader"),xin={id:l2t,detector:yin,loader:bin},c2t="pie",win=C(t=>/^\s*pie/.test(t),"detector"),Ain=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>oHn);return{id:c2t,diagram:t}},"loader"),Tin={id:c2t,detector:win,loader:Ain},u2t="quadrantChart",Sin=C(t=>/^\s*quadrantChart/.test(t),"detector"),Cin=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>gHn);return{id:u2t,diagram:t}},"loader"),Oin={id:u2t,detector:Sin,loader:Cin},kin=Oin,h2t="xychart",Ein=C(t=>/^\s*xychart(-beta)?/.test(t),"detector"),_in=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>RHn);return{id:h2t,diagram:t}},"loader"),Rin={id:h2t,detector:Ein,loader:_in},Din=Rin,d2t="requirement",Lin=C(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),Min=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>$Hn);return{id:d2t,diagram:t}},"loader"),Iin={id:d2t,detector:Lin,loader:Min},Pin=Iin,f2t="sequence",Nin=C(t=>/^\s*sequenceDiagram/.test(t),"detector"),Bin=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>MWn);return{id:f2t,diagram:t}},"loader"),$in={id:f2t,detector:Nin,loader:Bin},Fin=$in,p2t="class",zin=C((t,e)=>{var r;return((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(t)},"detector"),Uin=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>FWn);return{id:p2t,diagram:t}},"loader"),Vin={id:p2t,detector:zin,loader:Uin},Qin=Vin,g2t="classDiagram",Gin=C((t,e)=>{var r;return/^\s*classDiagram/.test(t)&&((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(t)},"detector"),Hin=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>UWn);return{id:g2t,diagram:t}},"loader"),Win={id:g2t,detector:Gin,loader:Hin},Yin=Win,m2t="state",qin=C((t,e)=>{var r;return((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(t)},"detector"),jin=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>RYn);return{id:m2t,diagram:t}},"loader"),Xin={id:m2t,detector:qin,loader:jin},Kin=Xin,v2t="stateDiagram",Zin=C((t,e)=>{var r;return!!(/^\s*stateDiagram-v2/.test(t)||/^\s*stateDiagram/.test(t)&&((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),Jin=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>LYn);return{id:v2t,diagram:t}},"loader"),ean={id:v2t,detector:Zin,loader:Jin},tan=ean,y2t="journey",ran=C(t=>/^\s*journey/.test(t),"detector"),nan=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>eqn);return{id:y2t,diagram:t}},"loader"),ian={id:y2t,detector:ran,loader:nan},aan=ian,san=C((t,e,r)=>{me.debug(`rendering svg for syntax error -`);const n=qc(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),zs(n,100,512,!0),i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),b2t={draw:san},oan=b2t,lan={db:{},renderer:b2t,parser:{parse:C(()=>{},"parse")}},can=lan,x2t="flowchart-elk",uan=C((t,e={})=>{var r;return/^\s*flowchart-elk/.test(t)||/^\s*(flowchart|graph)/.test(t)&&((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(e.layout="elk",!0):!1},"detector"),han=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Fke);return{id:x2t,diagram:t}},"loader"),dan={id:x2t,detector:uan,loader:han},fan=dan,w2t="timeline",pan=C(t=>/^\s*timeline/.test(t),"detector"),gan=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>_qn);return{id:w2t,diagram:t}},"loader"),man={id:w2t,detector:pan,loader:gan},van=man,A2t="mindmap",yan=C(t=>/^\s*mindmap/.test(t),"detector"),ban=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Hqn);return{id:A2t,diagram:t}},"loader"),xan={id:A2t,detector:yan,loader:ban},wan=xan,T2t="kanban",Aan=C(t=>/^\s*kanban/.test(t),"detector"),Tan=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>hjn);return{id:T2t,diagram:t}},"loader"),San={id:T2t,detector:Aan,loader:Tan},Can=San,S2t="sankey",Oan=C(t=>/^\s*sankey(-beta)?/.test(t),"detector"),kan=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Xjn);return{id:S2t,diagram:t}},"loader"),Ean={id:S2t,detector:Oan,loader:kan},_an=Ean,C2t="packet",Ran=C(t=>/^\s*packet(-beta)?/.test(t),"detector"),Dan=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>oXn);return{id:C2t,diagram:t}},"loader"),Lan={id:C2t,detector:Ran,loader:Dan},O2t="radar",Man=C(t=>/^\s*radar-beta/.test(t),"detector"),Ian=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>EXn);return{id:O2t,diagram:t}},"loader"),Pan={id:O2t,detector:Man,loader:Ian},k2t="block",Nan=C(t=>/^\s*block(-beta)?/.test(t),"detector"),Ban=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>tZn);return{id:k2t,diagram:t}},"loader"),$an={id:k2t,detector:Nan,loader:Ban},Fan=$an,E2t="treeView",zan=C(t=>/^\s*treeView-beta/.test(t),"detector"),Uan=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>CZn);return{id:E2t,diagram:t}},"loader"),Van={id:E2t,detector:zan,loader:Uan},Qan=Van,_2t="architecture",Gan=C(t=>/^\s*architecture/.test(t),"detector"),Han=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>jZn);return{id:_2t,diagram:t}},"loader"),Wan={id:_2t,detector:Gan,loader:Han},Yan=Wan,R2t="eventmodeling",qan=C(t=>/^\s*eventmodeling/.test(t),"detector"),jan=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>hJn);return{id:R2t,diagram:t}},"loader"),Xan={id:R2t,detector:qan,loader:jan},Kan=Xan,D2t="ishikawa",Zan=C(t=>/^\s*ishikawa(-beta)?\b/i.test(t),"detector"),Jan=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>EJn);return{id:D2t,diagram:t}},"loader"),esn={id:D2t,detector:Zan,loader:Jan},L2t="venn",tsn=C(t=>/^\s*venn-beta/.test(t),"detector"),rsn=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>fei);return{id:L2t,diagram:t}},"loader"),nsn={id:L2t,detector:tsn,loader:rsn},isn=nsn,M2t="treemap",asn=C(t=>/^\s*treemap/.test(t),"detector"),ssn=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Sei);return{id:M2t,diagram:t}},"loader"),osn={id:M2t,detector:asn,loader:ssn},I2t="wardley",lsn=C(t=>/^\s*wardley-beta/i.test(t),"detector"),csn=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Nei);return{id:I2t,diagram:t}},"loader"),usn={id:I2t,detector:lsn,loader:csn},hsn=usn,P2t="cynefin",dsn=C(t=>/^\s*cynefin-beta(?:[\s:]|$)/.test(t),"detector"),fsn=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Jei);return{id:P2t,diagram:t}},"loader"),psn={id:P2t,detector:dsn,loader:fsn},N2t="railroad",gsn=C(t=>/^\s*railroad-beta/i.test(t),"detector"),msn=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Sti);return{id:N2t,diagram:t}},"loader"),vsn={id:N2t,detector:gsn,loader:msn},B2t="railroadEbnf",ysn=C(t=>/^\s*railroad-ebnf-beta/i.test(t),"detector"),bsn=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Mti);return{id:B2t,diagram:t}},"loader"),xsn={id:B2t,detector:ysn,loader:bsn},$2t="railroadAbnf",wsn=C(t=>/^\s*railroad-abnf-beta/i.test(t),"detector"),Asn=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Qti);return{id:$2t,diagram:t}},"loader"),Tsn={id:$2t,detector:wsn,loader:Asn},F2t="railroadPeg",Ssn=C(t=>/^\s*railroad-peg-beta/i.test(t),"detector"),Csn=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Jti);return{id:F2t,diagram:t}},"loader"),Osn={id:F2t,detector:Ssn,loader:Csn},z2t=!1,hX=C(()=>{z2t||(z2t=!0,Lq("error",can,t=>t.toLowerCase().trim()==="error"),Lq("---",{db:{clear:C(()=>{},"clear")},styles:{},renderer:{draw:C(()=>{},"draw")},parser:{parse:C(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:C(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),uye(fan,wan,Yan),uye(Ynn,Can,Yin,Qin,cin,vin,xin,Tin,Pin,Fin,ain,tin,Knn,van,fin,tan,Kin,aan,kin,_an,Lan,Din,Fan,Kan,Qan,Pan,esn,osn,vsn,xsn,Tsn,Osn,isn,hsn,psn))},"addDiagrams"),ksn=C(async()=>{me.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(uS).map(async([r,{detector:n,loader:i}])=>{if(i)try{Aye(r)}catch{try{const{diagram:a,id:s}=await i();Lq(s,a,n)}catch(a){throw me.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete uS[r],a}}}))).filter(r=>r.status==="rejected");if(e.length>0){me.error(`Failed to load ${e.length} external diagrams`);for(const r of e)me.error(r);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),Esn="graphics-document document";function U2t(t,e){t.attr("role",Esn),e!==""&&t.attr("aria-roledescription",e)}C(U2t,"setA11yDiagramInfo");function V2t(t,e,r,n){if(t.insert!==void 0){if(r){const i=`chart-desc-${n}`;t.attr("aria-describedby",i),t.insert("desc",":first-child").attr("id",i).text(r)}if(e){const i=`chart-title-${n}`;t.attr("aria-labelledby",i),t.insert("title",":first-child").attr("id",i).text(e)}}}C(V2t,"addSVGa11yTitleDescription");var Qbe=(XO=class{constructor(e,r,n,i,a){this.type=e,this.text=r,this.db=n,this.parser=i,this.renderer=a}static async fromText(e,r={}){var u,h;const n=Dr(),i=cye(e,n);e=Xen(e)+` + L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),wnn=C((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),Ann=C((t,e,r)=>{const n=Dr(),{themeVariables:i}=n,{strokeWidth:a}=i,s=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");s.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),s.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),s.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),s.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),Snn={extension:tnn,composition:rnn,aggregation:nnn,dependency:inn,lollipop:ann,point:snn,circle:onn,cross:lnn,barb:cnn,barbNeo:unn,only_one:hnn,zero_or_one:dnn,one_or_more:fnn,zero_or_more:pnn,only_one_neo:gnn,zero_or_one_neo:mnn,one_or_more_neo:vnn,zero_or_more_neo:ynn,requirement_arrow:bnn,requirement_contains:wnn,requirement_arrow_neo:xnn,requirement_contains_neo:Ann},Pbe=enn,Tnn={common:jt,getConfig:Dr,insertCluster:tX,insertEdge:Mbe,insertEdgeLabel:aX,insertMarkers:Pbe,insertNode:T7,interpolateToCurve:q1e,labelHelper:pn,log:me,positionEdgeLabel:zxt},_7={},Wxt=C(t=>{for(const e of t)_7[e.name]=e},"registerLayoutLoaders"),Cnn=C(()=>{Wxt([{name:"dagre",loader:C(async()=>await Promise.resolve().then(()=>vkn),"loader")},{name:"swimlane",loader:C(async()=>await Promise.resolve().then(()=>_kn),"loader")},{name:"cose-bilkent",loader:C(async()=>await Promise.resolve().then(()=>gDn),"loader")}])},"registerDefaultLayoutLoaders");Cnn();var e4=C(async(t,e,r)=>{if(!(t.layoutAlgorithm in _7))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);if(t.diagramId)for(const d of t.nodes){const f=d.domId||d.id;d.domId=`${t.diagramId}-${f}`}const n=_7[t.layoutAlgorithm],i=await n.loader(),{theme:a,themeVariables:s}=t.config,{useGradient:o,gradientStart:l,gradientStop:u}=s,h=e.attr("id");if(e.append("defs").append("filter").attr("id",`${h}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a!=null&&a.includes("dark")?"#FFFFFF":"#000000"}`),e.append("defs").append("filter").attr("id",`${h}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a!=null&&a.includes("dark")?"#FFFFFF":"#000000"}`),o){const d=e.append("linearGradient").attr("id",e.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");d.append("svg:stop").attr("offset","0%").attr("stop-color",l).attr("stop-opacity",1),d.append("svg:stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}return i.render(t,e,Tnn,{algorithm:n.algorithm},r)},"render"),R7=C((t="",{fallback:e="dagre"}={})=>{if(t in _7)return t;if(e in _7)return me.warn(`Layout algorithm ${t} is not registered. Using ${e} as fallback.`),e;throw new Error(`Both layout algorithms ${t} and ${e} are not registered.`)},"getRegisteredLayoutAlgorithm"),Nbe="comm",Yxt="rule",qxt="decl",Onn="@media",knn="@import",Enn="@supports",_nn="@namespace",Bbe="@keyframes",jxt="@layer",Rnn="@scope",Dnn=Math.abs,D7=String.fromCharCode;function Xxt(t){return t.trim()}function $be(t,e,r){return t.replace(e,r)}function t4(t,e){return t.charCodeAt(e)|0}function r4(t,e,r){return t.slice(e,r)}function a0(t){return t.length}function Kxt(t){return t.length}function sX(t,e){return e.push(t),t}var oX=1,n4=1,Zxt=0,ep=0,_o=0,i4="";function Fbe(t,e,r,n,i,a,s,o){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:oX,column:n4,length:s,return:"",siblings:o}}function Lnn(){return _o}function Mnn(){return _o=ep>0?t4(i4,--ep):0,n4--,_o===10&&(n4=1,oX--),_o}function ug(){return _o=ep2||L7(_o)>3?"":" "}function Bnn(t,e){for(;--e&&ug()&&!(_o<48||_o>102||_o>57&&_o<65||_o>70&&_o<97););return cX(t,lX()+(e<6&&e2()==32&&ug()==32))}function Ube(t){for(;ug();)switch(_o){case t:return ep;case 34:case 39:t!==34&&t!==39&&Ube(_o);break;case 40:t===41&&Ube(t);break;case 92:ug();break}return ep}function $nn(t,e){for(;ug()&&t+_o!==57;)if(t+_o===84&&e2()===47)break;return"/*"+cX(e,ep-1)+"*"+D7(t===47?t:ug())}function Fnn(t){for(;!L7(e2());)ug();return cX(t,ep)}function znn(t){return Pnn(uX("",null,null,null,[""],t=Inn(t),0,[0],t))}function uX(t,e,r,n,i,a,s,o,l){for(var u=0,h=0,d=s,f=0,p=0,g=0,m=1,v=1,y=1,b=0,x=0,w="",A=i,S=a,T=n,O=w;v;)switch(g=x,x=ug()){case 40:g!=108&&t4(O,d-1)==58?(b++,O+="("):O+=zbe(x);break;case 41:b--,O+=")";break;case 34:case 39:case 91:O+=zbe(x);break;case 9:case 10:case 13:case 32:if(b>0){O+=D7(x);break}O+=Nnn(g);break;case 92:O+=Bnn(lX()-1,7);continue;case 47:switch(e2()){case 42:case 47:sX(Unn($nn(ug(),lX()),e,r,l),l),(L7(g||1)==5||L7(e2()||1)==5)&&a0(O)&&r4(O,-1,void 0)!==" "&&(O+=" ");break;default:O+="/"}break;case 123*m:o[u++]=a0(O)*y;case 125*m:case 59:case 0:if(b>0&&x){O+=D7(x);break}switch(x){case 0:case 125:v=0;case 59+h:y==-1&&(O=$be(O,/\f/g,"")),p>0&&(a0(O)-d||m===0)&&sX(p>32?e2t(O+";",n,r,d-1,l):e2t($be(O," ","")+";",n,r,d-2,l),l);break;case 59:O+=";";default:if(sX(T=Jxt(O,e,r,u,h,i,o,w,A=[],S=[],d,a),a),x===123)if(h===0)uX(O,e,T,T,A,a,d,o,S);else{switch(f){case 99:if(t4(O,3)===110)break;case 108:if(t4(O,2)===97)break;default:h=0;case 100:case 109:case 115:}h?uX(t,T,T,n&&sX(Jxt(t,T,T,0,0,i,o,w,i,A=[],d,S),S),i,S,d,o,n?A:S):uX(O,T,T,T,[""],S,0,o,S)}}u=h=p=0,m=y=1,w=O="",d=s;break;case 58:d=1+a0(O),p=g;default:if(m<1){if(x==123)--m;else if(x==125&&m++==0&&Mnn()==125)continue}switch(O+=D7(x),x*m){case 38:y=h>0?1:(O+="\f",-1);break;case 44:if(b>0)break;o[u++]=(a0(O)-1)*y,y=1;break;case 64:e2()===45&&(O+=zbe(ug())),f=e2(),h=d=a0(w=O+=Fnn(lX())),x++;break;case 45:g===45&&a0(O)==2&&(m=0)}}return a}function Jxt(t,e,r,n,i,a,s,o,l,u,h,d){for(var f=i-1,p=i===0?a:[""],g=Kxt(p),m=0,v=0,y=0;m0?p[b]+" "+x:$be(x,/&\f/g,p[b])))&&(l[y++]=w);return Fbe(t,e,r,i===0?Yxt:o,l,u,h,d)}function Unn(t,e,r,n){return Fbe(t,e,r,Nbe,D7(Lnn()),r4(t,2,-2),0,n)}function e2t(t,e,r,n,i){return Fbe(t,e,r,qxt,r4(t,0,n),r4(t,n+1,-1),n,i)}function Vbe(t,e){for(var r="",n=0;n/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),Hnn=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>uLn);return{id:t2t,diagram:t}},"loader"),Wnn={id:t2t,detector:Gnn,loader:Hnn},Ynn=Wnn,r2t="flowchart",qnn=C((t,e)=>{var r,n;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"?!1:/^\s*graph/.test(t)},"detector"),jnn=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Fke);return{id:r2t,diagram:t}},"loader"),Xnn={id:r2t,detector:qnn,loader:jnn},Knn=Xnn,n2t="flowchart-v2",Znn=C((t,e)=>{var r,n,i;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"&&(e.layout="elk"),/^\s*graph/.test(t)&&((i=e==null?void 0:e.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(t))},"detector"),Jnn=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Fke);return{id:n2t,diagram:t}},"loader"),ein={id:n2t,detector:Znn,loader:Jnn},tin=ein,i2t="swimlane",rin=C(t=>/^\s*swimlane-beta\b/.test(t),"detector"),nin=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>CLn);return{id:i2t,diagram:t}},"loader"),iin={id:i2t,detector:rin,loader:nin},ain=iin,a2t="er",sin=C(t=>/^\s*erDiagram/.test(t),"detector"),oin=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>MLn);return{id:a2t,diagram:t}},"loader"),lin={id:a2t,detector:sin,loader:oin},cin=lin,s2t="gitGraph",uin=C(t=>/^\s*gitGraph/.test(t),"detector"),hin=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>NQn);return{id:s2t,diagram:t}},"loader"),din={id:s2t,detector:uin,loader:hin},fin=din,o2t="gantt",pin=C(t=>/^\s*gantt/.test(t),"detector"),gin=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>NGn);return{id:o2t,diagram:t}},"loader"),min={id:o2t,detector:pin,loader:gin},vin=min,l2t="info",yin=C(t=>/^\s*info/.test(t),"detector"),bin=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>GGn);return{id:l2t,diagram:t}},"loader"),xin={id:l2t,detector:yin,loader:bin},c2t="pie",win=C(t=>/^\s*pie/.test(t),"detector"),Ain=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>oHn);return{id:c2t,diagram:t}},"loader"),Sin={id:c2t,detector:win,loader:Ain},u2t="quadrantChart",Tin=C(t=>/^\s*quadrantChart/.test(t),"detector"),Cin=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>gHn);return{id:u2t,diagram:t}},"loader"),Oin={id:u2t,detector:Tin,loader:Cin},kin=Oin,h2t="xychart",Ein=C(t=>/^\s*xychart(-beta)?/.test(t),"detector"),_in=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>RHn);return{id:h2t,diagram:t}},"loader"),Rin={id:h2t,detector:Ein,loader:_in},Din=Rin,d2t="requirement",Lin=C(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),Min=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>$Hn);return{id:d2t,diagram:t}},"loader"),Iin={id:d2t,detector:Lin,loader:Min},Pin=Iin,f2t="sequence",Nin=C(t=>/^\s*sequenceDiagram/.test(t),"detector"),Bin=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>MWn);return{id:f2t,diagram:t}},"loader"),$in={id:f2t,detector:Nin,loader:Bin},Fin=$in,p2t="class",zin=C((t,e)=>{var r;return((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(t)},"detector"),Uin=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>FWn);return{id:p2t,diagram:t}},"loader"),Vin={id:p2t,detector:zin,loader:Uin},Qin=Vin,g2t="classDiagram",Gin=C((t,e)=>{var r;return/^\s*classDiagram/.test(t)&&((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(t)},"detector"),Hin=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>UWn);return{id:g2t,diagram:t}},"loader"),Win={id:g2t,detector:Gin,loader:Hin},Yin=Win,m2t="state",qin=C((t,e)=>{var r;return((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(t)},"detector"),jin=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>RYn);return{id:m2t,diagram:t}},"loader"),Xin={id:m2t,detector:qin,loader:jin},Kin=Xin,v2t="stateDiagram",Zin=C((t,e)=>{var r;return!!(/^\s*stateDiagram-v2/.test(t)||/^\s*stateDiagram/.test(t)&&((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),Jin=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>LYn);return{id:v2t,diagram:t}},"loader"),ean={id:v2t,detector:Zin,loader:Jin},tan=ean,y2t="journey",ran=C(t=>/^\s*journey/.test(t),"detector"),nan=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>eqn);return{id:y2t,diagram:t}},"loader"),ian={id:y2t,detector:ran,loader:nan},aan=ian,san=C((t,e,r)=>{me.debug(`rendering svg for syntax error +`);const n=qc(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),zs(n,100,512,!0),i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),b2t={draw:san},oan=b2t,lan={db:{},renderer:b2t,parser:{parse:C(()=>{},"parse")}},can=lan,x2t="flowchart-elk",uan=C((t,e={})=>{var r;return/^\s*flowchart-elk/.test(t)||/^\s*(flowchart|graph)/.test(t)&&((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(e.layout="elk",!0):!1},"detector"),han=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Fke);return{id:x2t,diagram:t}},"loader"),dan={id:x2t,detector:uan,loader:han},fan=dan,w2t="timeline",pan=C(t=>/^\s*timeline/.test(t),"detector"),gan=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>_qn);return{id:w2t,diagram:t}},"loader"),man={id:w2t,detector:pan,loader:gan},van=man,A2t="mindmap",yan=C(t=>/^\s*mindmap/.test(t),"detector"),ban=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Hqn);return{id:A2t,diagram:t}},"loader"),xan={id:A2t,detector:yan,loader:ban},wan=xan,S2t="kanban",Aan=C(t=>/^\s*kanban/.test(t),"detector"),San=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>hjn);return{id:S2t,diagram:t}},"loader"),Tan={id:S2t,detector:Aan,loader:San},Can=Tan,T2t="sankey",Oan=C(t=>/^\s*sankey(-beta)?/.test(t),"detector"),kan=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Xjn);return{id:T2t,diagram:t}},"loader"),Ean={id:T2t,detector:Oan,loader:kan},_an=Ean,C2t="packet",Ran=C(t=>/^\s*packet(-beta)?/.test(t),"detector"),Dan=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>oXn);return{id:C2t,diagram:t}},"loader"),Lan={id:C2t,detector:Ran,loader:Dan},O2t="radar",Man=C(t=>/^\s*radar-beta/.test(t),"detector"),Ian=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>EXn);return{id:O2t,diagram:t}},"loader"),Pan={id:O2t,detector:Man,loader:Ian},k2t="block",Nan=C(t=>/^\s*block(-beta)?/.test(t),"detector"),Ban=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>tZn);return{id:k2t,diagram:t}},"loader"),$an={id:k2t,detector:Nan,loader:Ban},Fan=$an,E2t="treeView",zan=C(t=>/^\s*treeView-beta/.test(t),"detector"),Uan=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>CZn);return{id:E2t,diagram:t}},"loader"),Van={id:E2t,detector:zan,loader:Uan},Qan=Van,_2t="architecture",Gan=C(t=>/^\s*architecture/.test(t),"detector"),Han=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>jZn);return{id:_2t,diagram:t}},"loader"),Wan={id:_2t,detector:Gan,loader:Han},Yan=Wan,R2t="eventmodeling",qan=C(t=>/^\s*eventmodeling/.test(t),"detector"),jan=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>hJn);return{id:R2t,diagram:t}},"loader"),Xan={id:R2t,detector:qan,loader:jan},Kan=Xan,D2t="ishikawa",Zan=C(t=>/^\s*ishikawa(-beta)?\b/i.test(t),"detector"),Jan=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>EJn);return{id:D2t,diagram:t}},"loader"),esn={id:D2t,detector:Zan,loader:Jan},L2t="venn",tsn=C(t=>/^\s*venn-beta/.test(t),"detector"),rsn=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>fei);return{id:L2t,diagram:t}},"loader"),nsn={id:L2t,detector:tsn,loader:rsn},isn=nsn,M2t="treemap",asn=C(t=>/^\s*treemap/.test(t),"detector"),ssn=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Tei);return{id:M2t,diagram:t}},"loader"),osn={id:M2t,detector:asn,loader:ssn},I2t="wardley",lsn=C(t=>/^\s*wardley-beta/i.test(t),"detector"),csn=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Nei);return{id:I2t,diagram:t}},"loader"),usn={id:I2t,detector:lsn,loader:csn},hsn=usn,P2t="cynefin",dsn=C(t=>/^\s*cynefin-beta(?:[\s:]|$)/.test(t),"detector"),fsn=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Jei);return{id:P2t,diagram:t}},"loader"),psn={id:P2t,detector:dsn,loader:fsn},N2t="railroad",gsn=C(t=>/^\s*railroad-beta/i.test(t),"detector"),msn=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Tti);return{id:N2t,diagram:t}},"loader"),vsn={id:N2t,detector:gsn,loader:msn},B2t="railroadEbnf",ysn=C(t=>/^\s*railroad-ebnf-beta/i.test(t),"detector"),bsn=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Mti);return{id:B2t,diagram:t}},"loader"),xsn={id:B2t,detector:ysn,loader:bsn},$2t="railroadAbnf",wsn=C(t=>/^\s*railroad-abnf-beta/i.test(t),"detector"),Asn=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Qti);return{id:$2t,diagram:t}},"loader"),Ssn={id:$2t,detector:wsn,loader:Asn},F2t="railroadPeg",Tsn=C(t=>/^\s*railroad-peg-beta/i.test(t),"detector"),Csn=C(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Jti);return{id:F2t,diagram:t}},"loader"),Osn={id:F2t,detector:Tsn,loader:Csn},z2t=!1,hX=C(()=>{z2t||(z2t=!0,Lq("error",can,t=>t.toLowerCase().trim()==="error"),Lq("---",{db:{clear:C(()=>{},"clear")},styles:{},renderer:{draw:C(()=>{},"draw")},parser:{parse:C(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:C(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),uye(fan,wan,Yan),uye(Ynn,Can,Yin,Qin,cin,vin,xin,Sin,Pin,Fin,ain,tin,Knn,van,fin,tan,Kin,aan,kin,_an,Lan,Din,Fan,Kan,Qan,Pan,esn,osn,vsn,xsn,Ssn,Osn,isn,hsn,psn))},"addDiagrams"),ksn=C(async()=>{me.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(uT).map(async([r,{detector:n,loader:i}])=>{if(i)try{Aye(r)}catch{try{const{diagram:a,id:s}=await i();Lq(s,a,n)}catch(a){throw me.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete uT[r],a}}}))).filter(r=>r.status==="rejected");if(e.length>0){me.error(`Failed to load ${e.length} external diagrams`);for(const r of e)me.error(r);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),Esn="graphics-document document";function U2t(t,e){t.attr("role",Esn),e!==""&&t.attr("aria-roledescription",e)}C(U2t,"setA11yDiagramInfo");function V2t(t,e,r,n){if(t.insert!==void 0){if(r){const i=`chart-desc-${n}`;t.attr("aria-describedby",i),t.insert("desc",":first-child").attr("id",i).text(r)}if(e){const i=`chart-title-${n}`;t.attr("aria-labelledby",i),t.insert("title",":first-child").attr("id",i).text(e)}}}C(V2t,"addSVGa11yTitleDescription");var Qbe=(XO=class{constructor(e,r,n,i,a){this.type=e,this.text=r,this.db=n,this.parser=i,this.renderer=a}static async fromText(e,r={}){var u,h;const n=Dr(),i=cye(e,n);e=Xen(e)+` `;try{Aye(i)}catch{const d=vWr(i);if(!d)throw new xgt(`Diagram ${i} not found.`);const{id:f,diagram:p}=await d();Lq(f,p)}const{db:a,parser:s,renderer:o,init:l}=Aye(i);return s.parser&&(s.parser.yy=a),(u=a.clear)==null||u.call(a),l==null||l(n),r.title&&((h=a.setDiagramTitle)==null||h.call(a,r.title)),await s.parse(e),new XO(i,e,a,s,o)}async render(e,r){await this.renderer.draw(this.text,e,r,this)}getParser(){return this.parser}getType(){return this.type}},C(XO,"Diagram"),XO),Q2t=[],_sn=C(()=>{Q2t.forEach(t=>{t()}),Q2t=[]},"attachFunctions"),Rsn=C(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function G2t(t){const e=t.match(bgt);if(!e)return{text:t,metadata:{}};const r=e[1],n=r?e[2].split(` `).map(s=>s.startsWith(r)?s.slice(r.length):s).join(` `):e[2];let i=_j(n,{schema:Ej})??{};i=typeof i=="object"&&!Array.isArray(i)?i:{};const a={};return i.displayMode&&(a.displayMode=i.displayMode.toString()),i.title&&(a.title=i.title.toString()),i.config&&(a.config=i.config),{text:t.slice(e[0].length),metadata:a}}C(G2t,"extractFrontMatter");var Dsn=C(t=>t.replace(/\r\n?/g,` @@ -677,21 +677,21 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="

An error `}else n+=`${t.themeCSS} `;return n+fye(r)},"createCssStyles"),Xsn=C((t,e)=>Vbe(znn(`${t}{${e}}`),Qnn([C(function(n,i,a,s){if(n.type==="rule"&&Array.isArray(n.props)){if(n.parent&&n.parent.type===Bbe)return;n.props=n.props.map(o=>o===t&&Array.isArray(n.children)&&n.children.every(u=>u.type!=="decl"?!1:new Set(["font-family","font-size","fill"]).has(u.props))||(o.startsWith(`${t} `)||o.startsWith(`${t}>`))&&!o.startsWith(`${t} ||`)?o:`${t} ${o}`)}else n.type.startsWith("@")&&([...[Onn,Enn,jxt,Rnn,"@container","@starting-style"],Bbe].includes(n.type)||(me.warn(`Removing unsupported at-rule ${n.type} from CSS`),n.type=Nbe))},"addNamespace"),Vnn])),"compileCSS"),Ksn=C((t,e,r,n)=>{const i=jsn(t,r),a=MWr(e,i,{...t.themeVariables,theme:t.theme,look:t.look},n);return Xsn(n,a)},"createUserStyles"),Zsn=C((t="",e,r)=>{let n=t;return!r&&!e&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=$y(n),n=n.replace(/
/g,"
"),n},"cleanUpSvgCode"),Jsn=C((t="",e)=>{var i,a;const r=(a=(i=e==null?void 0:e.viewBox)==null?void 0:i.baseVal)!=null&&a.height?e.viewBox.baseVal.height+"px":Vsn,n=H2t(`${t}`);return``},"putIntoIFrame"),q2t=C((t,e,r,n,i)=>{const a=t.append("div");a.attr("id",r),n&&a.attr("style",n);const s=a.append("svg").attr("id",e).attr("width","100%").attr("xmlns",$sn);return i&&s.attr("xmlns:xlink",i),s.append("g"),t},"appendDivSvgG");function Wbe(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}C(Wbe,"sandboxedIframe");var eon=C((t,e,r,n)=>{var i,a,s;(i=t.getElementById(e))==null||i.remove(),(a=t.getElementById(r))==null||a.remove(),(s=t.getElementById(n))==null||s.remove()},"removeExistingElements"),ton=C(async function(t,e,r){var I,L,R,D,M,P;hX();const n=Hbe(e);e=n.code;const i=Dr();me.debug(i),e.length>((i==null?void 0:i.maxTextSize)??Isn)&&(e=Psn);const a=`#${t}`,s="i"+t,o="#"+s,l="d"+t,u="#"+l,h=C(()=>{const F=Ot(f?o:u).node();F&&"remove"in F&&F.remove()},"removeTempElements");let d=Ot(document.body);const f=i.securityLevel===Nsn,p=i.securityLevel===Bsn,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const N=Wbe(Ot(r),s);d=Ot(N.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=Ot(r);q2t(d,t,l,`font-family: ${g}`,Fsn)}else{if(eon(document,t,l,s),f){const N=Wbe(Ot(document.body),s);d=Ot(N.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=Ot("body");q2t(d,t,l)}let m,v;try{m=await Qbe.fromText(e,{title:n.title})}catch(N){if(i.suppressErrorRendering)throw h(),N;m=await Qbe.fromText("error"),v=N}const y=d.select(u).node(),b=m.type,x=y.firstChild,w=x.firstChild,A=(L=(I=m.renderer).getClasses)==null?void 0:L.call(I,e,m),T=Ksn(i,b,A,a),S=document.createElement("style");S.innerHTML=T,x.insertBefore(S,w);try{await m.renderer.draw(e,t,"11.16.1",m)}catch(N){throw i.suppressErrorRendering?h():oan.draw(e,t,"11.16.1"),N}const O=d.select(`${u} svg`),k=(D=(R=m.db).getAccTitle)==null?void 0:D.call(R),E=(P=(M=m.db).getAccDescription)==null?void 0:P.call(M);K2t(b,O,k,E),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",zsn);let _=d.select(u).node().innerHTML;if(me.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),_=Zsn(_,f,Xm(i.arrowMarkerAbsolute)),f){const N=d.select(u+" svg").node();_=Jsn(_,N)}else p||(_=Oy.sanitize(_,{ADD_TAGS:Ysn,ADD_ATTR:qsn,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(_sn(),v)throw v;return h(),{diagramType:b,svg:_,bindFunctions:m.db.bindFunctions}},"render");function j2t(t={}){var n;const e=Eo({},t);e!=null&&e.fontFamily&&!((n=e.themeVariables)!=null&&n.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),hWr(e),e!=null&&e.theme&&e.theme in Ey?e.themeVariables=Ey[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=Ey.default.getThemeVariables(e.themeVariables));const r=typeof e=="object"?uWr(e):fgt();Kve(r.logLevel),hX()}C(j2t,"initialize");var X2t=C((t,e={})=>{const{code:r}=Gbe(t);return Qbe.fromText(r,e)},"getDiagramFromText");function K2t(t,e,r,n){U2t(e,t),V2t(e,r,n,e.attr("id"))}C(K2t,"addA11yInfo");var PS=Object.freeze({render:ton,parse:W2t,getDiagramFromText:X2t,initialize:j2t,getConfig:Dr,setConfig:pgt,getSiteConfig:fgt,updateSiteConfig:dWr,reset:C(()=>{kq()},"reset"),globalReset:C(()=>{kq(O5)},"globalReset"),defaultConfig:O5});Kve(Dr().logLevel),kq(Dr());var ron=C((t,e,r)=>{me.warn(t),Z1e(t)?(r&&r(t.str,t.hash),e.push({...t,message:t.str,error:t})):(r&&r(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))},"handleError"),Z2t=C(async function(t={querySelector:".mermaid"}){try{await non(t)}catch(e){if(Z1e(e)&&me.error(e.str),$d.parseError&&$d.parseError(e),!t.suppressErrors)throw me.error("Use the suppressErrors option to suppress these errors"),e}},"run"),non=C(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=PS.getConfig();me.debug(`${t?"":"No "}Callback function found`);let i;if(r)i=r;else if(e)i=document.querySelectorAll(e);else throw new Error("Nodes and querySelector are both undefined");me.debug(`Found ${i.length} diagrams`),(n==null?void 0:n.startOnLoad)!==void 0&&(me.debug("Start On Load: "+(n==null?void 0:n.startOnLoad)),PS.updateSiteConfig({startOnLoad:n==null?void 0:n.startOnLoad}));const a=new ln.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let s;const o=[];for(const l of Array.from(i)){if(me.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const u=`mermaid-${a.next()}`;s=l.innerHTML,s=O1t(ln.entityDecode(s)).trim().replace(//gi,"
");const h=ln.detectInit(s);h&&me.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await rwt(u,s,l);l.innerHTML=d,t&&await t(u),f&&f(l)}catch(d){ron(d,o,$d.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),J2t=C(function(t){PS.initialize(t)},"initialize"),ion=C(async function(t,e,r){me.warn("mermaid.init is deprecated. Please use run instead."),t&&J2t(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await Z2t(n)},"init"),aon=C(async(t,{lazyLoad:e=!0}={})=>{hX(),uye(...t),e===!1&&await ksn()},"registerExternalDiagrams"),ewt=C(function(){if($d.startOnLoad){const{startOnLoad:t}=PS.getConfig();t&&$d.run().catch(e=>me.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",ewt,!1);var son=C(function(t){$d.parseError=t},"setParseErrorHandler"),dX=[],Ybe=!1,twt=C(async()=>{if(!Ybe){for(Ybe=!0;dX.length>0;){const t=dX.shift();if(t)try{await t()}catch(e){me.error("Error executing queue",e)}}Ybe=!1}},"executeQueue"),oon=C(async(t,e)=>new Promise((r,n)=>{const i=C(()=>new Promise((a,s)=>{PS.parse(t,e).then(o=>{a(o),r(o)},o=>{var l;me.error("Error parsing",o),(l=$d.parseError)==null||l.call($d,o),s(o),n(o)})}),"performCall");dX.push(i),twt().catch(n)}),"parse"),rwt=C((t,e,r)=>new Promise((n,i)=>{const a=C(()=>new Promise((s,o)=>{PS.render(t,e,r).then(l=>{s(l),n(l)},l=>{var u;me.error("Error parsing",l),(u=$d.parseError)==null||u.call($d,l),o(l),i(l)})}),"performCall");dX.push(a),twt().catch(i)}),"render"),lon=C(()=>Object.keys(uS).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),$d={startOnLoad:!0,mermaidAPI:PS,parse:oon,render:rwt,init:ion,run:Z2t,registerExternalDiagrams:aon,registerLayoutLoaders:Wxt,initialize:J2t,parseError:void 0,contentLoaded:ewt,setParseErrorHandler:son,detectType:cye,registerIconPacks:rbe,getRegisteredDiagramsMetadata:lon},con=$d;/*! Check if previously processed *//*! +`},"putIntoIFrame"),q2t=C((t,e,r,n,i)=>{const a=t.append("div");a.attr("id",r),n&&a.attr("style",n);const s=a.append("svg").attr("id",e).attr("width","100%").attr("xmlns",$sn);return i&&s.attr("xmlns:xlink",i),s.append("g"),t},"appendDivSvgG");function Wbe(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}C(Wbe,"sandboxedIframe");var eon=C((t,e,r,n)=>{var i,a,s;(i=t.getElementById(e))==null||i.remove(),(a=t.getElementById(r))==null||a.remove(),(s=t.getElementById(n))==null||s.remove()},"removeExistingElements"),ton=C(async function(t,e,r){var I,L,R,D,M,P;hX();const n=Hbe(e);e=n.code;const i=Dr();me.debug(i),e.length>((i==null?void 0:i.maxTextSize)??Isn)&&(e=Psn);const a=`#${t}`,s="i"+t,o="#"+s,l="d"+t,u="#"+l,h=C(()=>{const F=Ot(f?o:u).node();F&&"remove"in F&&F.remove()},"removeTempElements");let d=Ot(document.body);const f=i.securityLevel===Nsn,p=i.securityLevel===Bsn,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const N=Wbe(Ot(r),s);d=Ot(N.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=Ot(r);q2t(d,t,l,`font-family: ${g}`,Fsn)}else{if(eon(document,t,l,s),f){const N=Wbe(Ot(document.body),s);d=Ot(N.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=Ot("body");q2t(d,t,l)}let m,v;try{m=await Qbe.fromText(e,{title:n.title})}catch(N){if(i.suppressErrorRendering)throw h(),N;m=await Qbe.fromText("error"),v=N}const y=d.select(u).node(),b=m.type,x=y.firstChild,w=x.firstChild,A=(L=(I=m.renderer).getClasses)==null?void 0:L.call(I,e,m),S=Ksn(i,b,A,a),T=document.createElement("style");T.innerHTML=S,x.insertBefore(T,w);try{await m.renderer.draw(e,t,"11.16.1",m)}catch(N){throw i.suppressErrorRendering?h():oan.draw(e,t,"11.16.1"),N}const O=d.select(`${u} svg`),k=(D=(R=m.db).getAccTitle)==null?void 0:D.call(R),E=(P=(M=m.db).getAccDescription)==null?void 0:P.call(M);K2t(b,O,k,E),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",zsn);let _=d.select(u).node().innerHTML;if(me.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),_=Zsn(_,f,Xm(i.arrowMarkerAbsolute)),f){const N=d.select(u+" svg").node();_=Jsn(_,N)}else p||(_=Oy.sanitize(_,{ADD_TAGS:Ysn,ADD_ATTR:qsn,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(_sn(),v)throw v;return h(),{diagramType:b,svg:_,bindFunctions:m.db.bindFunctions}},"render");function j2t(t={}){var n;const e=Eo({},t);e!=null&&e.fontFamily&&!((n=e.themeVariables)!=null&&n.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),hWr(e),e!=null&&e.theme&&e.theme in Ey?e.themeVariables=Ey[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=Ey.default.getThemeVariables(e.themeVariables));const r=typeof e=="object"?uWr(e):fgt();Kve(r.logLevel),hX()}C(j2t,"initialize");var X2t=C((t,e={})=>{const{code:r}=Gbe(t);return Qbe.fromText(r,e)},"getDiagramFromText");function K2t(t,e,r,n){U2t(e,t),V2t(e,r,n,e.attr("id"))}C(K2t,"addA11yInfo");var PT=Object.freeze({render:ton,parse:W2t,getDiagramFromText:X2t,initialize:j2t,getConfig:Dr,setConfig:pgt,getSiteConfig:fgt,updateSiteConfig:dWr,reset:C(()=>{kq()},"reset"),globalReset:C(()=>{kq(O5)},"globalReset"),defaultConfig:O5});Kve(Dr().logLevel),kq(Dr());var ron=C((t,e,r)=>{me.warn(t),Z1e(t)?(r&&r(t.str,t.hash),e.push({...t,message:t.str,error:t})):(r&&r(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))},"handleError"),Z2t=C(async function(t={querySelector:".mermaid"}){try{await non(t)}catch(e){if(Z1e(e)&&me.error(e.str),$d.parseError&&$d.parseError(e),!t.suppressErrors)throw me.error("Use the suppressErrors option to suppress these errors"),e}},"run"),non=C(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=PT.getConfig();me.debug(`${t?"":"No "}Callback function found`);let i;if(r)i=r;else if(e)i=document.querySelectorAll(e);else throw new Error("Nodes and querySelector are both undefined");me.debug(`Found ${i.length} diagrams`),(n==null?void 0:n.startOnLoad)!==void 0&&(me.debug("Start On Load: "+(n==null?void 0:n.startOnLoad)),PT.updateSiteConfig({startOnLoad:n==null?void 0:n.startOnLoad}));const a=new ln.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let s;const o=[];for(const l of Array.from(i)){if(me.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const u=`mermaid-${a.next()}`;s=l.innerHTML,s=O1t(ln.entityDecode(s)).trim().replace(//gi,"
");const h=ln.detectInit(s);h&&me.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await rwt(u,s,l);l.innerHTML=d,t&&await t(u),f&&f(l)}catch(d){ron(d,o,$d.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),J2t=C(function(t){PT.initialize(t)},"initialize"),ion=C(async function(t,e,r){me.warn("mermaid.init is deprecated. Please use run instead."),t&&J2t(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await Z2t(n)},"init"),aon=C(async(t,{lazyLoad:e=!0}={})=>{hX(),uye(...t),e===!1&&await ksn()},"registerExternalDiagrams"),ewt=C(function(){if($d.startOnLoad){const{startOnLoad:t}=PT.getConfig();t&&$d.run().catch(e=>me.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",ewt,!1);var son=C(function(t){$d.parseError=t},"setParseErrorHandler"),dX=[],Ybe=!1,twt=C(async()=>{if(!Ybe){for(Ybe=!0;dX.length>0;){const t=dX.shift();if(t)try{await t()}catch(e){me.error("Error executing queue",e)}}Ybe=!1}},"executeQueue"),oon=C(async(t,e)=>new Promise((r,n)=>{const i=C(()=>new Promise((a,s)=>{PT.parse(t,e).then(o=>{a(o),r(o)},o=>{var l;me.error("Error parsing",o),(l=$d.parseError)==null||l.call($d,o),s(o),n(o)})}),"performCall");dX.push(i),twt().catch(n)}),"parse"),rwt=C((t,e,r)=>new Promise((n,i)=>{const a=C(()=>new Promise((s,o)=>{PT.render(t,e,r).then(l=>{s(l),n(l)},l=>{var u;me.error("Error parsing",l),(u=$d.parseError)==null||u.call($d,l),o(l),i(l)})}),"performCall");dX.push(a),twt().catch(i)}),"render"),lon=C(()=>Object.keys(uT).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),$d={startOnLoad:!0,mermaidAPI:PT,parse:oon,render:rwt,init:ion,run:Z2t,registerExternalDiagrams:aon,registerLayoutLoaders:Wxt,initialize:J2t,parseError:void 0,contentLoaded:ewt,setParseErrorHandler:son,detectType:cye,registerIconPacks:rbe,getRegisteredDiagramsMetadata:lon},con=$d;/*! Check if previously processed *//*! * Wait for document loaded before starting the execution - */const uon=Object.freeze(Object.defineProperty({__proto__:null,default:con},Symbol.toStringTag,{value:"Module"})),nwt=1024;let hon=0,tp=class{constructor(e,r){this.from=e,this.to=r}};class En{constructor(e={}){this.id=hon++,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=Ro.match(e)),r=>{let n=e(r);return n===void 0?null:[this,n]}}}En.closedBy=new En({deserialize:t=>t.split(" ")}),En.openedBy=new En({deserialize:t=>t.split(" ")}),En.group=new En({deserialize:t=>t.split(" ")}),En.isolate=new En({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}}),En.contextHash=new En({perNode:!0}),En.lookAhead=new En({perNode:!0}),En.mounted=new En({perNode:!0});class a4{constructor(e,r,n,i=!1){this.tree=e,this.overlay=r,this.parser=n,this.bracketed=i}static get(e){return e&&e.props&&e.props[En.mounted.id]}}const don=Object.create(null);class Ro{constructor(e,r,n,i=0){this.name=e,this.props=r,this.id=n,this.flags=i}static define(e){let r=e.props&&e.props.length?Object.create(null):don,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Ro(e.name||"",r,e.id,n);if(e.props){for(let a of e.props)if(Array.isArray(a)||(a=a(i)),a){if(a[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");r[a[0].id]=a[1]}}return i}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 r=this.prop(En.group);return r?r.indexOf(e)>-1:!1}return this.id==e}static match(e){let r=Object.create(null);for(let n in e)for(let i of n.split(" "))r[i]=e[n];return n=>{for(let i=n.prop(En.group),a=-1;a<(i?i.length:0);a++){let s=r[a<0?n.name:i[a]];if(s)return s}}}}Ro.none=new Ro("",Object.create(null),0,8);class s4{constructor(e){this.types=e;for(let r=0;r0;for(let l=this.cursor(s|Wi.IncludeAnonymous);;){let u=!1;if(l.from<=a&&l.to>=i&&(!o&&l.type.isAnonymous||r(l)!==!1)){if(l.firstChild())continue;u=!0}for(;u&&n&&(o||!l.type.isAnonymous)&&n(l),!l.nextSibling();){if(!l.parent())return;u=!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 r in this.props)e.push([+r,this.props[r]]);return e}balance(e={}){return this.children.length<=8?this:Kbe(Ro.none,this.children,this.positions,0,this.children.length,0,this.length,(r,n,i)=>new si(this.type,r,n,i,this.propValues),e.makeTree||((r,n,i)=>new si(Ro.none,r,n,i)))}static build(e){return mon(e)}}si.empty=new si(Ro.none,[],[],0);class qbe{constructor(e,r){this.buffer=e,this.index=r}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 qbe(this.buffer,this.index)}}class t2{constructor(e,r,n){this.buffer=e,this.length=r,this.set=n}get type(){return Ro.none}toString(){let e=[];for(let r=0;r0));l=s[l+3]);return o}slice(e,r,n){let i=this.buffer,a=new Uint16Array(r-e),s=0;for(let o=e,l=0;o=e&&re;case 1:return r<=e&&n>e;case 2:return n>e;case 4:return!0}}function M7(t,e,r,n){for(var i;t.from==t.to||(r<1?t.from>=e:t.from>e)||(r>-1?t.to<=e:t.to0?o.length:-1;e!=u;e+=r){let h=o[e],d=l[e]+s.from,f;if(!(!(a&Wi.EnterBracketed&&h instanceof si&&(f=a4.get(h))&&!f.overlay&&f.bracketed&&n>=d&&n<=d+h.length)&&!awt(i,n,d,d+h.length))){if(h instanceof t2){if(a&Wi.ExcludeBuffers)continue;let p=h.findChild(0,h.buffer.length,r,n-d,i);if(p>-1)return new s0(new fon(s,h,e,d),null,p)}else if(a&Wi.IncludeAnonymous||!h.type.isAnonymous||Xbe(h)){let p;if(!(a&Wi.IgnoreMounts)&&(p=a4.get(h))&&!p.overlay)return new hie(p.tree,d,e,s);let g=new hie(h,d,e,s);return a&Wi.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(r<0?h.children.length-1:0,r,n,i,a)}}}if(a&Wi.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+r:e=r<0?-1:s._parent._tree.children.length,s=s._parent,!s))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,r,n=0){let i;if(!(n&Wi.IgnoreOverlays)&&(i=a4.get(this._tree))&&i.overlay){let a=e-this.from,s=n&Wi.EnterBracketed&&i.bracketed;for(let{from:o,to:l}of i.overlay)if((r>0||s?o<=a:o=a:l>a))return new hie(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,r,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 owt(t,e,r,n){let i=t.cursor(),a=[];if(!i.firstChild())return a;if(r!=null){for(let s=!1;!s;)if(s=i.type.is(r),!i.nextSibling())return a}for(;;){if(n!=null&&i.type.is(n))return a;if(i.type.is(e)&&a.push(i.node),!i.nextSibling())return n==null?a:[]}}function jbe(t,e,r=e.length-1){for(let n=t;r>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[r]&&e[r]!=n.name)return!1;r--}}return!0}class fon{constructor(e,r,n,i){this.parent=e,this.buffer=r,this.index=n,this.start=i}}class s0 extends swt{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,r,n){super(),this.context=e,this._parent=r,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,r,n){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],e,r-this.context.start,n);return a<0?null:new s0(this.context,this,a)}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,r,n=0){if(n&Wi.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],r>0?1:-1,e-this.context.start,r);return a<0?null:new s0(this.context,this,a)}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,r=e.buffer[this.index+3];return r<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new s0(this.context,this._parent,r):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,r=this._parent?this._parent.index+4:0;return this.index==r?this.externalSibling(-1):new s0(this.context,this._parent,e.findChild(r,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],r=[],{buffer:n}=this.context,i=this.index+4,a=n.buffer[this.index+3];if(a>i){let s=n.buffer[this.index+1];e.push(n.slice(i,a,s)),r.push(0)}return new si(this.type,e,r,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function lwt(t){if(!t.length)return null;let e=0,r=t[0];for(let a=1;ar.from||s.to=e){let o=new rp(s.tree,s.overlay[0].from+a.from,-1,a);(i||(i=[n])).push(M7(o,e,r,!1))}}return i?lwt(i):n}class pX{get name(){return this.type.name}constructor(e,r=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=r&~Wi.EnterBracketed,e instanceof rp)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,r){this.index=e;let{start:n,buffer:i}=this.buffer;return this.type=r||i.set.types[i.buffer[e]],this.from=n+i.buffer[e+1],this.to=n+i.buffer[e+2],!0}yield(e){return e?e instanceof rp?(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,r,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,r,n,this.mode));let{buffer:i}=this.buffer,a=i.findChild(this.index+4,i.buffer[this.index+3],e,r-this.buffer.start,n);return a<0?!1:(this.stack.push(this.index),this.yieldBuf(a))}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,r,n=this.mode){return this.buffer?n&Wi.ExcludeBuffers?!1:this.enterChild(1,e,r):this.yield(this._tree.enter(e,r,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Wi.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Wi.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:r}=this.buffer,n=this.stack.length-1;if(e<0){let i=n<0?0:this.stack[n]+4;if(this.index!=i)return this.yieldBuf(r.findChild(i,this.index,-1,0,4))}else{let i=r.buffer[this.index+3];if(i<(n<0?r.buffer.length:r.buffer[this.stack[n]+3]))return this.yieldBuf(i)}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 r,n,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let a=r+e,s=e<0?-1:n._tree.children.length;a!=s;a+=e){let o=n._tree.children[a];if(this.mode&Wi.IncludeAnonymous||o instanceof t2||!o.type.isAnonymous||Xbe(o))return!1}return!0}move(e,r){if(r&&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,r=0){for(;(this.from==this.to||(r<1?this.from>=e:this.from>e)||(r>-1?this.to<=e:this.to=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;r=s,n=a+1;break e}i=this.stack[--a]}for(let i=n;i=0;a--){if(a<0)return jbe(this._tree,e,i);let s=n[r.buffer[this.stack[a]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function Xbe(t){return t.children.some(e=>e instanceof t2||!e.type.isAnonymous||Xbe(e))}function mon(t){var e;let{buffer:r,nodeSet:n,maxBufferLength:i=nwt,reused:a=[],minRepeatType:s=n.types.length}=t,o=Array.isArray(r)?new qbe(r,r.length):r,l=n.types,u=0,h=0;function d(A,T,S,O,k,E){let{id:_,start:I,end:L,size:R}=o,D=h,M=u;if(R<0)if(o.next(),R==-1){let V=a[_];S.push(V),O.push(I-A);return}else if(R==-3){u=_;return}else if(R==-4){h=_;return}else throw new RangeError(`Unrecognized record size: ${R}`);let P=l[_],N,F,B=I-A;if(L-I<=i&&(F=v(o.pos-T,k))){let V=new Uint16Array(F.size-F.skip),z=o.pos-F.size,U=V.length;for(;o.pos>z;)U=y(F.start,V,U);N=new t2(V,L-F.start,n),B=F.start-A}else{let V=o.pos-R;o.next();let z=[],U=[],Q=_>=s?_:-1,G=0,X=L;for(;o.pos>V;)Q>=0&&o.id==Q&&o.size>=0?(o.end<=X-i&&(g(z,U,I,G,o.end,X,Q,D,M),G=z.length,X=o.end),o.next()):E>2500?f(I,V,z,U):d(I,V,z,U,Q,E+1);if(Q>=0&&G>0&&G-1&&G>0){let Y=p(P,M);N=Kbe(P,z,U,0,z.length,0,L-I,Y,Y)}else N=m(P,z,U,L-I,D-L,M)}S.push(N),O.push(B)}function f(A,T,S,O){let k=[],E=0,_=-1;for(;o.pos>T;){let{id:I,start:L,end:R,size:D}=o;if(D>4)o.next();else{if(_>-1&&L<_)break;_<0&&(_=R-i),k.push(I,L,R),E++,o.next()}}if(E){let I=new Uint16Array(E*4),L=k[k.length-2];for(let R=k.length-3,D=0;R>=0;R-=3)I[D++]=k[R],I[D++]=k[R+1]-L,I[D++]=k[R+2]-L,I[D++]=D;S.push(new t2(I,k[2]-L,n)),O.push(L-A)}}function p(A,T){return(S,O,k)=>{let E=0,_=S.length-1,I,L;if(_>=0&&(I=S[_])instanceof si){if(!_&&I.type==A&&I.length==k)return I;(L=I.prop(En.lookAhead))&&(E=O[_]+I.length+L)}return m(A,S,O,k,E,T)}}function g(A,T,S,O,k,E,_,I,L){let R=[],D=[];for(;A.length>O;)R.push(A.pop()),D.push(T.pop()+S-k);A.push(m(n.types[_],R,D,E-k,I-E,L)),T.push(k-S)}function m(A,T,S,O,k,E,_){if(E){let I=[En.contextHash,E];_=_?[I].concat(_):[I]}if(k>25){let I=[En.lookAhead,k];_=_?[I].concat(_):[I]}return new si(A,T,S,O,_)}function v(A,T){let S=o.fork(),O=0,k=0,E=0,_=S.end-i,I={size:0,start:0,skip:0};e:for(let L=S.pos-A;S.pos>L;){let R=S.size;if(S.id==T&&R>=0){I.size=O,I.start=k,I.skip=E,E+=4,O+=4,S.next();continue}let D=S.pos-R;if(R<0||D=s?4:0,P=S.start;for(S.next();S.pos>D;){if(S.size<0)if(S.size==-3||S.size==-4)M+=4;else break e;else S.id>=s&&(M+=4);S.next()}k=P,O+=R,E+=M}return(T<0||O==A)&&(I.size=O,I.start=k,I.skip=E),I.size>4?I:void 0}function y(A,T,S){let{id:O,start:k,end:E,size:_}=o;if(o.next(),_>=0&&O4){let L=o.pos-(_-4);for(;o.pos>L;)S=y(A,T,S)}T[--S]=I,T[--S]=E-A,T[--S]=k-A,T[--S]=O}else _==-3?u=O:_==-4&&(h=O);return S}let b=[],x=[];for(;o.pos>0;)d(t.start||0,t.bufferStart||0,b,x,-1,0);let w=(e=t.length)!==null&&e!==void 0?e:b.length?x[0]+b[0].length:0;return new si(l[t.topID],b.reverse(),x.reverse(),w)}const cwt=new WeakMap;function gX(t,e){if(!t.isAnonymous||e instanceof t2||e.type!=t)return 1;let r=cwt.get(e);if(r==null){r=1;for(let n of e.children){if(n.type!=t||!(n instanceof si)){r=1;break}r+=gX(t,n)}cwt.set(e,r)}return r}function Kbe(t,e,r,n,i,a,s,o,l){let u=0;for(let g=n;g=h)break;T+=S}if(x==w+1){if(T>h){let S=g[w];p(S.children,S.positions,0,S.children.length,m[w]+b);continue}d.push(g[w])}else{let S=m[x-1]+g[x-1].length-A;d.push(Kbe(t,g,m,w,x,A,S,null,l))}f.push(A+b-a)}}return p(e,r,n,i,0),(o||l)(d,f,s)}class Zbe{constructor(){this.map=new WeakMap}setBuffer(e,r,n){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(r,n)}getBuffer(e,r){let n=this.map.get(e);return n&&n.get(r)}set(e,r){e instanceof s0?this.setBuffer(e.context.buffer,e.index,r):e instanceof rp&&this.map.set(e.tree,r)}get(e){return e instanceof s0?this.getBuffer(e.context.buffer,e.index):e instanceof rp?this.map.get(e.tree):void 0}cursorSet(e,r){e.buffer?this.setBuffer(e.buffer.buffer,e.index,r):this.map.set(e.tree,r)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Qy{constructor(e,r,n,i,a=!1,s=!1){this.from=e,this.to=r,this.tree=n,this.offset=i,this.open=(a?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,r=[],n=!1){let i=[new Qy(0,e.length,e,0,!1,n)];for(let a of r)a.to>e.length&&i.push(a);return i}static applyChanges(e,r,n=128){if(!r.length)return e;let i=[],a=1,s=e.length?e[0]:null;for(let o=0,l=0,u=0;;o++){let h=o=n)for(;s&&s.from=f.from||d<=f.to||u){let p=Math.max(f.from,l)-u,g=Math.min(f.to,d)-u;f=p>=g?null:new Qy(p,g,f.tree,f.offset+u,o>0,!!h)}if(f&&i.push(f),s.to>d)break;s=anew tp(i.from,i.to)):[new tp(0,0)]:[new tp(0,e.length)],this.createParse(e,r||[],n)}parse(e,r,n){let i=this.startParse(e,r,n);for(;;){let a=i.advance();if(a)return a}}};class von{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,r){return this.string.slice(e,r)}}function uwt(t){return(e,r,n,i)=>new bon(e,t,r,n,i)}class hwt{constructor(e,r,n,i,a,s){this.parser=e,this.parse=r,this.overlay=n,this.bracketed=i,this.target=a,this.from=s}}function dwt(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class yon{constructor(e,r,n,i,a,s,o,l){this.parser=e,this.predicate=r,this.mounts=n,this.index=i,this.start=a,this.bracketed=s,this.target=o,this.prev=l,this.depth=0,this.ranges=[]}}const Jbe=new En({perNode:!0});class bon{constructor(e,r,n,i,a){this.nest=r,this.input=n,this.fragments=i,this.ranges=a,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 i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new si(n.type,n.children,n.positions,n.length,n.propValues.concat([[Jbe,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],r=e.parse.advance();if(r){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[En.mounted.id]=new a4(r,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 r=this.innerDone;r=this.stoppedAt)o=!1;else if(e.hasNode(i)){if(r){let u=r.mounts.find(h=>h.frag.from<=i.from&&h.frag.to>=i.to&&h.mount.overlay);if(u)for(let h of u.mount.overlay){let d=h.from+u.pos,f=h.to+u.pos;d>=i.from&&f<=i.to&&!r.ranges.some(p=>p.fromd)&&r.ranges.push({from:d,to:f})}}o=!1}else if(n&&(s=xon(n.ranges,i.from,i.to)))o=s!=2;else if(!i.type.isAnonymous&&(a=this.nest(i,this.input))&&(i.fromnew tp(d.from-i.from,d.to-i.from)):null,!!a.bracketed,i.tree,h.length?h[0].from:i.from)),a.overlay?h.length&&(n={ranges:h,depth:0,prev:n}):o=!1}}else if(r&&(l=r.predicate(i))&&(l===!0&&(l=new tp(i.from,i.to)),l.from=0&&r.ranges[u].to==l.from?r.ranges[u]={from:r.ranges[u].from,to:l.to}:r.ranges.push(l)}if(o&&i.firstChild())r&&r.depth++,n&&n.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(r&&!--r.depth){let u=gwt(this.ranges,r.ranges);u.length&&(dwt(u),this.inner.splice(r.index,0,new hwt(r.parser,r.parser.startParse(this.input,mwt(r.mounts,u),u),r.ranges.map(h=>new tp(h.from-r.start,h.to-r.start)),r.bracketed,r.target,u[0].from))),r=r.prev}n&&!--n.depth&&(n=n.prev)}}}}function xon(t,e,r){for(let n of t){if(n.from>=r)break;if(n.to>e)return n.from<=e&&n.to>=r?2:1}return 0}function fwt(t,e,r,n,i,a){if(e=e&&r.enter(n,1,Wi.IgnoreOverlays|Wi.ExcludeBuffers)))if(r.to<=e)r.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 r=this.cursor.tree;;){if(r==e.tree)return!0;if(r.children.length&&r.positions[0]==0&&r.children[0]instanceof si)r=r.children[0];else break}return!1}}let Aon=class{constructor(e){var r;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(r=n.tree.prop(Jbe))!==null&&r!==void 0?r:n.to,this.inner=new pwt(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 r=this.curFrag=this.fragments[this.fragI];this.curTo=(e=r.tree.prop(Jbe))!==null&&e!==void 0?e:r.to,this.inner=new pwt(r.tree,-r.offset)}}findMounts(e,r){var n;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let a=this.inner.cursor.node;a;a=a.parent){let s=(n=a.tree)===null||n===void 0?void 0:n.prop(En.mounted);if(s&&s.parser==r)for(let o=this.fragI;o=a.to)break;l.tree==this.curFrag.tree&&i.push({frag:l,pos:a.from-l.offset,mount:s})}}}return i}};function gwt(t,e){let r=null,n=e;for(let i=1,a=0;i=o)break;l.to<=s||(r||(n=r=e.slice()),l.fromo&&r.splice(a+1,0,new tp(o,l.to))):l.to>o?r[a--]=new tp(o,l.to):r.splice(a--,1))}}return n}function Ton(t,e,r,n){let i=0,a=0,s=!1,o=!1,l=-1e9,u=[];for(;;){let h=i==t.length?1e9:s?t[i].to:t[i].from,d=a==e.length?1e9:o?e[a].to:e[a].from;if(s!=o){let f=Math.max(l,r),p=Math.min(h,d,n);fnew tp(f.from+n,f.to+n)),d=Ton(e,h,l,u);for(let f=0,p=l;;f++){let g=f==d.length,m=g?u:d[f].from;if(m>p&&r.push(new Qy(p,m,i.tree,-s,a.from>=p||a.openStart,a.to<=m||a.openEnd)),g)break;p=d[f].to}}else r.push(new Qy(l,u,i.tree,-s,a.from>=s||a.openStart,a.to<=o||a.openEnd))}return r}let exe=[],vwt=[];(()=>{let t="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,r=0;e>1;if(t=vwt[n])e=n+1;else return!0;if(e==r)return!1}}function ywt(t){return t>=127462&&t<=127487}const bwt=8205;function Con(t,e,r=!0,n=!0){return(r?xwt:Oon)(t,e,n)}function xwt(t,e,r){if(e==t.length)return e;e&&wwt(t.charCodeAt(e))&&Awt(t.charCodeAt(e-1))&&e--;let n=txe(t,e);for(e+=Twt(n);e=0&&ywt(txe(t,s));)a++,s-=2;if(a%2==0)break;e+=2}else break}return e}function Oon(t,e,r){for(;e>1;){let n=xwt(t,e-2,r);if(n=56320&&t<57344}function Awt(t){return t>=55296&&t<56320}function Twt(t){return t<65536?1:2}class vi{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,r,n){[e,r]=o4(this,e,r);let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(r,this.length,i,1),vX.from(i,this.length-(r-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,r=this.length){[e,r]=o4(this,e,r);let n=[];return this.decompose(e,r,n,0),vX.from(n,r-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let r=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),i=new I7(this),a=new I7(e);for(let s=r,o=r;;){if(i.next(s),a.next(s),s=0,i.lineBreak!=a.lineBreak||i.done!=a.done||i.value!=a.value)return!1;if(o+=i.value.length,i.done||o>=n)return!0}}iter(e=1){return new I7(this,e)}iterRange(e,r=this.length){return new Cwt(this,e,r)}iterLines(e,r){let n;if(e==null)n=this.iter();else{r==null&&(r=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,r==this.lines+1?this.length:r<=1?0:this.line(r-1).to))}return new Owt(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]?vi.empty:e.length<=32?new lo(e):vX.from(lo.split(e,[]))}}class lo extends vi{constructor(e,r=kon(e)){super(),this.text=e,this.length=r}get lines(){return this.text.length}get children(){return null}lineInner(e,r,n,i){for(let a=0;;a++){let s=this.text[a],o=i+s.length;if((r?n:o)>=e)return new Eon(i,o,n,s);i=o+1,n++}}decompose(e,r,n,i){let a=e<=0&&r>=this.length?this:new lo(Swt(this.text,e,r),Math.min(r,this.length)-Math.max(0,e));if(i&1){let s=n.pop(),o=yX(a.text,s.text.slice(),0,a.length);if(o.length<=32)n.push(new lo(o,s.length+a.length));else{let l=o.length>>1;n.push(new lo(o.slice(0,l)),new lo(o.slice(l)))}}else n.push(a)}replace(e,r,n){if(!(n instanceof lo))return super.replace(e,r,n);[e,r]=o4(this,e,r);let i=yX(this.text,yX(n.text,Swt(this.text,0,e)),r),a=this.length+n.length-(r-e);return i.length<=32?new lo(i,a):vX.from(lo.split(i,[]),a)}sliceString(e,r=this.length,n=` + */const uon=Object.freeze(Object.defineProperty({__proto__:null,default:con},Symbol.toStringTag,{value:"Module"})),nwt=1024;let hon=0,tp=class{constructor(e,r){this.from=e,this.to=r}};class En{constructor(e={}){this.id=hon++,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=Ro.match(e)),r=>{let n=e(r);return n===void 0?null:[this,n]}}}En.closedBy=new En({deserialize:t=>t.split(" ")}),En.openedBy=new En({deserialize:t=>t.split(" ")}),En.group=new En({deserialize:t=>t.split(" ")}),En.isolate=new En({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}}),En.contextHash=new En({perNode:!0}),En.lookAhead=new En({perNode:!0}),En.mounted=new En({perNode:!0});class a4{constructor(e,r,n,i=!1){this.tree=e,this.overlay=r,this.parser=n,this.bracketed=i}static get(e){return e&&e.props&&e.props[En.mounted.id]}}const don=Object.create(null);class Ro{constructor(e,r,n,i=0){this.name=e,this.props=r,this.id=n,this.flags=i}static define(e){let r=e.props&&e.props.length?Object.create(null):don,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Ro(e.name||"",r,e.id,n);if(e.props){for(let a of e.props)if(Array.isArray(a)||(a=a(i)),a){if(a[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");r[a[0].id]=a[1]}}return i}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 r=this.prop(En.group);return r?r.indexOf(e)>-1:!1}return this.id==e}static match(e){let r=Object.create(null);for(let n in e)for(let i of n.split(" "))r[i]=e[n];return n=>{for(let i=n.prop(En.group),a=-1;a<(i?i.length:0);a++){let s=r[a<0?n.name:i[a]];if(s)return s}}}}Ro.none=new Ro("",Object.create(null),0,8);class s4{constructor(e){this.types=e;for(let r=0;r0;for(let l=this.cursor(s|Wi.IncludeAnonymous);;){let u=!1;if(l.from<=a&&l.to>=i&&(!o&&l.type.isAnonymous||r(l)!==!1)){if(l.firstChild())continue;u=!0}for(;u&&n&&(o||!l.type.isAnonymous)&&n(l),!l.nextSibling();){if(!l.parent())return;u=!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 r in this.props)e.push([+r,this.props[r]]);return e}balance(e={}){return this.children.length<=8?this:Kbe(Ro.none,this.children,this.positions,0,this.children.length,0,this.length,(r,n,i)=>new si(this.type,r,n,i,this.propValues),e.makeTree||((r,n,i)=>new si(Ro.none,r,n,i)))}static build(e){return mon(e)}}si.empty=new si(Ro.none,[],[],0);class qbe{constructor(e,r){this.buffer=e,this.index=r}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 qbe(this.buffer,this.index)}}class t2{constructor(e,r,n){this.buffer=e,this.length=r,this.set=n}get type(){return Ro.none}toString(){let e=[];for(let r=0;r0));l=s[l+3]);return o}slice(e,r,n){let i=this.buffer,a=new Uint16Array(r-e),s=0;for(let o=e,l=0;o=e&&re;case 1:return r<=e&&n>e;case 2:return n>e;case 4:return!0}}function M7(t,e,r,n){for(var i;t.from==t.to||(r<1?t.from>=e:t.from>e)||(r>-1?t.to<=e:t.to0?o.length:-1;e!=u;e+=r){let h=o[e],d=l[e]+s.from,f;if(!(!(a&Wi.EnterBracketed&&h instanceof si&&(f=a4.get(h))&&!f.overlay&&f.bracketed&&n>=d&&n<=d+h.length)&&!awt(i,n,d,d+h.length))){if(h instanceof t2){if(a&Wi.ExcludeBuffers)continue;let p=h.findChild(0,h.buffer.length,r,n-d,i);if(p>-1)return new s0(new fon(s,h,e,d),null,p)}else if(a&Wi.IncludeAnonymous||!h.type.isAnonymous||Xbe(h)){let p;if(!(a&Wi.IgnoreMounts)&&(p=a4.get(h))&&!p.overlay)return new hie(p.tree,d,e,s);let g=new hie(h,d,e,s);return a&Wi.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(r<0?h.children.length-1:0,r,n,i,a)}}}if(a&Wi.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+r:e=r<0?-1:s._parent._tree.children.length,s=s._parent,!s))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,r,n=0){let i;if(!(n&Wi.IgnoreOverlays)&&(i=a4.get(this._tree))&&i.overlay){let a=e-this.from,s=n&Wi.EnterBracketed&&i.bracketed;for(let{from:o,to:l}of i.overlay)if((r>0||s?o<=a:o=a:l>a))return new hie(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,r,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 owt(t,e,r,n){let i=t.cursor(),a=[];if(!i.firstChild())return a;if(r!=null){for(let s=!1;!s;)if(s=i.type.is(r),!i.nextSibling())return a}for(;;){if(n!=null&&i.type.is(n))return a;if(i.type.is(e)&&a.push(i.node),!i.nextSibling())return n==null?a:[]}}function jbe(t,e,r=e.length-1){for(let n=t;r>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[r]&&e[r]!=n.name)return!1;r--}}return!0}class fon{constructor(e,r,n,i){this.parent=e,this.buffer=r,this.index=n,this.start=i}}class s0 extends swt{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,r,n){super(),this.context=e,this._parent=r,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,r,n){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],e,r-this.context.start,n);return a<0?null:new s0(this.context,this,a)}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,r,n=0){if(n&Wi.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],r>0?1:-1,e-this.context.start,r);return a<0?null:new s0(this.context,this,a)}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,r=e.buffer[this.index+3];return r<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new s0(this.context,this._parent,r):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,r=this._parent?this._parent.index+4:0;return this.index==r?this.externalSibling(-1):new s0(this.context,this._parent,e.findChild(r,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],r=[],{buffer:n}=this.context,i=this.index+4,a=n.buffer[this.index+3];if(a>i){let s=n.buffer[this.index+1];e.push(n.slice(i,a,s)),r.push(0)}return new si(this.type,e,r,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function lwt(t){if(!t.length)return null;let e=0,r=t[0];for(let a=1;ar.from||s.to=e){let o=new rp(s.tree,s.overlay[0].from+a.from,-1,a);(i||(i=[n])).push(M7(o,e,r,!1))}}return i?lwt(i):n}class pX{get name(){return this.type.name}constructor(e,r=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=r&~Wi.EnterBracketed,e instanceof rp)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,r){this.index=e;let{start:n,buffer:i}=this.buffer;return this.type=r||i.set.types[i.buffer[e]],this.from=n+i.buffer[e+1],this.to=n+i.buffer[e+2],!0}yield(e){return e?e instanceof rp?(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,r,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,r,n,this.mode));let{buffer:i}=this.buffer,a=i.findChild(this.index+4,i.buffer[this.index+3],e,r-this.buffer.start,n);return a<0?!1:(this.stack.push(this.index),this.yieldBuf(a))}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,r,n=this.mode){return this.buffer?n&Wi.ExcludeBuffers?!1:this.enterChild(1,e,r):this.yield(this._tree.enter(e,r,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Wi.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Wi.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:r}=this.buffer,n=this.stack.length-1;if(e<0){let i=n<0?0:this.stack[n]+4;if(this.index!=i)return this.yieldBuf(r.findChild(i,this.index,-1,0,4))}else{let i=r.buffer[this.index+3];if(i<(n<0?r.buffer.length:r.buffer[this.stack[n]+3]))return this.yieldBuf(i)}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 r,n,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let a=r+e,s=e<0?-1:n._tree.children.length;a!=s;a+=e){let o=n._tree.children[a];if(this.mode&Wi.IncludeAnonymous||o instanceof t2||!o.type.isAnonymous||Xbe(o))return!1}return!0}move(e,r){if(r&&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,r=0){for(;(this.from==this.to||(r<1?this.from>=e:this.from>e)||(r>-1?this.to<=e:this.to=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;r=s,n=a+1;break e}i=this.stack[--a]}for(let i=n;i=0;a--){if(a<0)return jbe(this._tree,e,i);let s=n[r.buffer[this.stack[a]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function Xbe(t){return t.children.some(e=>e instanceof t2||!e.type.isAnonymous||Xbe(e))}function mon(t){var e;let{buffer:r,nodeSet:n,maxBufferLength:i=nwt,reused:a=[],minRepeatType:s=n.types.length}=t,o=Array.isArray(r)?new qbe(r,r.length):r,l=n.types,u=0,h=0;function d(A,S,T,O,k,E){let{id:_,start:I,end:L,size:R}=o,D=h,M=u;if(R<0)if(o.next(),R==-1){let V=a[_];T.push(V),O.push(I-A);return}else if(R==-3){u=_;return}else if(R==-4){h=_;return}else throw new RangeError(`Unrecognized record size: ${R}`);let P=l[_],N,F,B=I-A;if(L-I<=i&&(F=v(o.pos-S,k))){let V=new Uint16Array(F.size-F.skip),z=o.pos-F.size,U=V.length;for(;o.pos>z;)U=y(F.start,V,U);N=new t2(V,L-F.start,n),B=F.start-A}else{let V=o.pos-R;o.next();let z=[],U=[],Q=_>=s?_:-1,G=0,X=L;for(;o.pos>V;)Q>=0&&o.id==Q&&o.size>=0?(o.end<=X-i&&(g(z,U,I,G,o.end,X,Q,D,M),G=z.length,X=o.end),o.next()):E>2500?f(I,V,z,U):d(I,V,z,U,Q,E+1);if(Q>=0&&G>0&&G-1&&G>0){let Y=p(P,M);N=Kbe(P,z,U,0,z.length,0,L-I,Y,Y)}else N=m(P,z,U,L-I,D-L,M)}T.push(N),O.push(B)}function f(A,S,T,O){let k=[],E=0,_=-1;for(;o.pos>S;){let{id:I,start:L,end:R,size:D}=o;if(D>4)o.next();else{if(_>-1&&L<_)break;_<0&&(_=R-i),k.push(I,L,R),E++,o.next()}}if(E){let I=new Uint16Array(E*4),L=k[k.length-2];for(let R=k.length-3,D=0;R>=0;R-=3)I[D++]=k[R],I[D++]=k[R+1]-L,I[D++]=k[R+2]-L,I[D++]=D;T.push(new t2(I,k[2]-L,n)),O.push(L-A)}}function p(A,S){return(T,O,k)=>{let E=0,_=T.length-1,I,L;if(_>=0&&(I=T[_])instanceof si){if(!_&&I.type==A&&I.length==k)return I;(L=I.prop(En.lookAhead))&&(E=O[_]+I.length+L)}return m(A,T,O,k,E,S)}}function g(A,S,T,O,k,E,_,I,L){let R=[],D=[];for(;A.length>O;)R.push(A.pop()),D.push(S.pop()+T-k);A.push(m(n.types[_],R,D,E-k,I-E,L)),S.push(k-T)}function m(A,S,T,O,k,E,_){if(E){let I=[En.contextHash,E];_=_?[I].concat(_):[I]}if(k>25){let I=[En.lookAhead,k];_=_?[I].concat(_):[I]}return new si(A,S,T,O,_)}function v(A,S){let T=o.fork(),O=0,k=0,E=0,_=T.end-i,I={size:0,start:0,skip:0};e:for(let L=T.pos-A;T.pos>L;){let R=T.size;if(T.id==S&&R>=0){I.size=O,I.start=k,I.skip=E,E+=4,O+=4,T.next();continue}let D=T.pos-R;if(R<0||D=s?4:0,P=T.start;for(T.next();T.pos>D;){if(T.size<0)if(T.size==-3||T.size==-4)M+=4;else break e;else T.id>=s&&(M+=4);T.next()}k=P,O+=R,E+=M}return(S<0||O==A)&&(I.size=O,I.start=k,I.skip=E),I.size>4?I:void 0}function y(A,S,T){let{id:O,start:k,end:E,size:_}=o;if(o.next(),_>=0&&O4){let L=o.pos-(_-4);for(;o.pos>L;)T=y(A,S,T)}S[--T]=I,S[--T]=E-A,S[--T]=k-A,S[--T]=O}else _==-3?u=O:_==-4&&(h=O);return T}let b=[],x=[];for(;o.pos>0;)d(t.start||0,t.bufferStart||0,b,x,-1,0);let w=(e=t.length)!==null&&e!==void 0?e:b.length?x[0]+b[0].length:0;return new si(l[t.topID],b.reverse(),x.reverse(),w)}const cwt=new WeakMap;function gX(t,e){if(!t.isAnonymous||e instanceof t2||e.type!=t)return 1;let r=cwt.get(e);if(r==null){r=1;for(let n of e.children){if(n.type!=t||!(n instanceof si)){r=1;break}r+=gX(t,n)}cwt.set(e,r)}return r}function Kbe(t,e,r,n,i,a,s,o,l){let u=0;for(let g=n;g=h)break;S+=T}if(x==w+1){if(S>h){let T=g[w];p(T.children,T.positions,0,T.children.length,m[w]+b);continue}d.push(g[w])}else{let T=m[x-1]+g[x-1].length-A;d.push(Kbe(t,g,m,w,x,A,T,null,l))}f.push(A+b-a)}}return p(e,r,n,i,0),(o||l)(d,f,s)}class Zbe{constructor(){this.map=new WeakMap}setBuffer(e,r,n){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(r,n)}getBuffer(e,r){let n=this.map.get(e);return n&&n.get(r)}set(e,r){e instanceof s0?this.setBuffer(e.context.buffer,e.index,r):e instanceof rp&&this.map.set(e.tree,r)}get(e){return e instanceof s0?this.getBuffer(e.context.buffer,e.index):e instanceof rp?this.map.get(e.tree):void 0}cursorSet(e,r){e.buffer?this.setBuffer(e.buffer.buffer,e.index,r):this.map.set(e.tree,r)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Qy{constructor(e,r,n,i,a=!1,s=!1){this.from=e,this.to=r,this.tree=n,this.offset=i,this.open=(a?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,r=[],n=!1){let i=[new Qy(0,e.length,e,0,!1,n)];for(let a of r)a.to>e.length&&i.push(a);return i}static applyChanges(e,r,n=128){if(!r.length)return e;let i=[],a=1,s=e.length?e[0]:null;for(let o=0,l=0,u=0;;o++){let h=o=n)for(;s&&s.from=f.from||d<=f.to||u){let p=Math.max(f.from,l)-u,g=Math.min(f.to,d)-u;f=p>=g?null:new Qy(p,g,f.tree,f.offset+u,o>0,!!h)}if(f&&i.push(f),s.to>d)break;s=anew tp(i.from,i.to)):[new tp(0,0)]:[new tp(0,e.length)],this.createParse(e,r||[],n)}parse(e,r,n){let i=this.startParse(e,r,n);for(;;){let a=i.advance();if(a)return a}}};class von{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,r){return this.string.slice(e,r)}}function uwt(t){return(e,r,n,i)=>new bon(e,t,r,n,i)}class hwt{constructor(e,r,n,i,a,s){this.parser=e,this.parse=r,this.overlay=n,this.bracketed=i,this.target=a,this.from=s}}function dwt(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class yon{constructor(e,r,n,i,a,s,o,l){this.parser=e,this.predicate=r,this.mounts=n,this.index=i,this.start=a,this.bracketed=s,this.target=o,this.prev=l,this.depth=0,this.ranges=[]}}const Jbe=new En({perNode:!0});class bon{constructor(e,r,n,i,a){this.nest=r,this.input=n,this.fragments=i,this.ranges=a,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 i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new si(n.type,n.children,n.positions,n.length,n.propValues.concat([[Jbe,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],r=e.parse.advance();if(r){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[En.mounted.id]=new a4(r,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 r=this.innerDone;r=this.stoppedAt)o=!1;else if(e.hasNode(i)){if(r){let u=r.mounts.find(h=>h.frag.from<=i.from&&h.frag.to>=i.to&&h.mount.overlay);if(u)for(let h of u.mount.overlay){let d=h.from+u.pos,f=h.to+u.pos;d>=i.from&&f<=i.to&&!r.ranges.some(p=>p.fromd)&&r.ranges.push({from:d,to:f})}}o=!1}else if(n&&(s=xon(n.ranges,i.from,i.to)))o=s!=2;else if(!i.type.isAnonymous&&(a=this.nest(i,this.input))&&(i.fromnew tp(d.from-i.from,d.to-i.from)):null,!!a.bracketed,i.tree,h.length?h[0].from:i.from)),a.overlay?h.length&&(n={ranges:h,depth:0,prev:n}):o=!1}}else if(r&&(l=r.predicate(i))&&(l===!0&&(l=new tp(i.from,i.to)),l.from=0&&r.ranges[u].to==l.from?r.ranges[u]={from:r.ranges[u].from,to:l.to}:r.ranges.push(l)}if(o&&i.firstChild())r&&r.depth++,n&&n.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(r&&!--r.depth){let u=gwt(this.ranges,r.ranges);u.length&&(dwt(u),this.inner.splice(r.index,0,new hwt(r.parser,r.parser.startParse(this.input,mwt(r.mounts,u),u),r.ranges.map(h=>new tp(h.from-r.start,h.to-r.start)),r.bracketed,r.target,u[0].from))),r=r.prev}n&&!--n.depth&&(n=n.prev)}}}}function xon(t,e,r){for(let n of t){if(n.from>=r)break;if(n.to>e)return n.from<=e&&n.to>=r?2:1}return 0}function fwt(t,e,r,n,i,a){if(e=e&&r.enter(n,1,Wi.IgnoreOverlays|Wi.ExcludeBuffers)))if(r.to<=e)r.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 r=this.cursor.tree;;){if(r==e.tree)return!0;if(r.children.length&&r.positions[0]==0&&r.children[0]instanceof si)r=r.children[0];else break}return!1}}let Aon=class{constructor(e){var r;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(r=n.tree.prop(Jbe))!==null&&r!==void 0?r:n.to,this.inner=new pwt(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 r=this.curFrag=this.fragments[this.fragI];this.curTo=(e=r.tree.prop(Jbe))!==null&&e!==void 0?e:r.to,this.inner=new pwt(r.tree,-r.offset)}}findMounts(e,r){var n;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let a=this.inner.cursor.node;a;a=a.parent){let s=(n=a.tree)===null||n===void 0?void 0:n.prop(En.mounted);if(s&&s.parser==r)for(let o=this.fragI;o=a.to)break;l.tree==this.curFrag.tree&&i.push({frag:l,pos:a.from-l.offset,mount:s})}}}return i}};function gwt(t,e){let r=null,n=e;for(let i=1,a=0;i=o)break;l.to<=s||(r||(n=r=e.slice()),l.fromo&&r.splice(a+1,0,new tp(o,l.to))):l.to>o?r[a--]=new tp(o,l.to):r.splice(a--,1))}}return n}function Son(t,e,r,n){let i=0,a=0,s=!1,o=!1,l=-1e9,u=[];for(;;){let h=i==t.length?1e9:s?t[i].to:t[i].from,d=a==e.length?1e9:o?e[a].to:e[a].from;if(s!=o){let f=Math.max(l,r),p=Math.min(h,d,n);fnew tp(f.from+n,f.to+n)),d=Son(e,h,l,u);for(let f=0,p=l;;f++){let g=f==d.length,m=g?u:d[f].from;if(m>p&&r.push(new Qy(p,m,i.tree,-s,a.from>=p||a.openStart,a.to<=m||a.openEnd)),g)break;p=d[f].to}}else r.push(new Qy(l,u,i.tree,-s,a.from>=s||a.openStart,a.to<=o||a.openEnd))}return r}let exe=[],vwt=[];(()=>{let t="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,r=0;e>1;if(t=vwt[n])e=n+1;else return!0;if(e==r)return!1}}function ywt(t){return t>=127462&&t<=127487}const bwt=8205;function Con(t,e,r=!0,n=!0){return(r?xwt:Oon)(t,e,n)}function xwt(t,e,r){if(e==t.length)return e;e&&wwt(t.charCodeAt(e))&&Awt(t.charCodeAt(e-1))&&e--;let n=txe(t,e);for(e+=Swt(n);e=0&&ywt(txe(t,s));)a++,s-=2;if(a%2==0)break;e+=2}else break}return e}function Oon(t,e,r){for(;e>1;){let n=xwt(t,e-2,r);if(n=56320&&t<57344}function Awt(t){return t>=55296&&t<56320}function Swt(t){return t<65536?1:2}class vi{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,r,n){[e,r]=o4(this,e,r);let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(r,this.length,i,1),vX.from(i,this.length-(r-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,r=this.length){[e,r]=o4(this,e,r);let n=[];return this.decompose(e,r,n,0),vX.from(n,r-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let r=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),i=new I7(this),a=new I7(e);for(let s=r,o=r;;){if(i.next(s),a.next(s),s=0,i.lineBreak!=a.lineBreak||i.done!=a.done||i.value!=a.value)return!1;if(o+=i.value.length,i.done||o>=n)return!0}}iter(e=1){return new I7(this,e)}iterRange(e,r=this.length){return new Cwt(this,e,r)}iterLines(e,r){let n;if(e==null)n=this.iter();else{r==null&&(r=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,r==this.lines+1?this.length:r<=1?0:this.line(r-1).to))}return new Owt(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]?vi.empty:e.length<=32?new lo(e):vX.from(lo.split(e,[]))}}class lo extends vi{constructor(e,r=kon(e)){super(),this.text=e,this.length=r}get lines(){return this.text.length}get children(){return null}lineInner(e,r,n,i){for(let a=0;;a++){let s=this.text[a],o=i+s.length;if((r?n:o)>=e)return new Eon(i,o,n,s);i=o+1,n++}}decompose(e,r,n,i){let a=e<=0&&r>=this.length?this:new lo(Twt(this.text,e,r),Math.min(r,this.length)-Math.max(0,e));if(i&1){let s=n.pop(),o=yX(a.text,s.text.slice(),0,a.length);if(o.length<=32)n.push(new lo(o,s.length+a.length));else{let l=o.length>>1;n.push(new lo(o.slice(0,l)),new lo(o.slice(l)))}}else n.push(a)}replace(e,r,n){if(!(n instanceof lo))return super.replace(e,r,n);[e,r]=o4(this,e,r);let i=yX(this.text,yX(n.text,Twt(this.text,0,e)),r),a=this.length+n.length-(r-e);return i.length<=32?new lo(i,a):vX.from(lo.split(i,[]),a)}sliceString(e,r=this.length,n=` `){[e,r]=o4(this,e,r);let i="";for(let a=0,s=0;a<=r&&se&&s&&(i+=n),ea&&(i+=o.slice(Math.max(0,e-a),r-a)),a=l+1}return i}flatten(e){for(let r of this.text)e.push(r)}scanIdentical(){return 0}static split(e,r){let n=[],i=-1;for(let a of e)n.push(a),i+=a.length+1,n.length==32&&(r.push(new lo(n,i)),n=[],i=-1);return i>-1&&r.push(new lo(n,i)),r}}let vX=class qI extends vi{constructor(e,r){super(),this.children=e,this.length=r,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,r,n,i){for(let a=0;;a++){let s=this.children[a],o=i+s.length,l=n+s.lines-1;if((r?l:o)>=e)return s.lineInner(e,r,n,i);i=o+1,n=l+1}}decompose(e,r,n,i){for(let a=0,s=0;s<=r&&a=s){let u=i&((s<=e?1:0)|(l>=r?2:0));s>=e&&l<=r&&!u?n.push(o):o.decompose(e-s,r-s,n,u)}s=l+1}}replace(e,r,n){if([e,r]=o4(this,e,r),n.lines=a&&r<=o){let l=s.replace(e-a,r-a,n),u=this.lines-s.lines+l.lines;if(l.lines>4&&l.lines>u>>6){let h=this.children.slice();return h[i]=l,new qI(h,this.length-(r-e)+n.length)}return super.replace(a,o,l)}a=o+1}return super.replace(e,r,n)}sliceString(e,r=this.length,n=` -`){[e,r]=o4(this,e,r);let i="";for(let a=0,s=0;ae&&a&&(i+=n),es&&(i+=o.sliceString(e-s,r-s,n)),s=l+1}return i}flatten(e){for(let r of this.children)r.flatten(e)}scanIdentical(e,r){if(!(e instanceof qI))return 0;let n=0,[i,a,s,o]=r>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=r,a+=r){if(i==s||a==o)return n;let l=this.children[i],u=e.children[a];if(l!=u)return n+l.scanIdentical(u,r);n+=l.length+1}}static from(e,r=e.reduce((n,i)=>n+i.length+1,-1)){let n=0;for(let p of e)n+=p.lines;if(n<32){let p=[];for(let g of e)g.flatten(p);return new lo(p,r)}let i=Math.max(32,n>>5),a=i<<1,s=i>>1,o=[],l=0,u=-1,h=[];function d(p){let g;if(p.lines>a&&p instanceof qI)for(let m of p.children)d(m);else p.lines>s&&(l>s||!l)?(f(),o.push(p)):p instanceof lo&&l&&(g=h[h.length-1])instanceof lo&&p.lines+g.lines<=32?(l+=p.lines,u+=p.length+1,h[h.length-1]=new lo(g.text.concat(p.text),g.length+1+p.length)):(l+p.lines>i&&f(),l+=p.lines,u+=p.length+1,h.push(p))}function f(){l!=0&&(o.push(h.length==1?h[0]:qI.from(h,u)),u=-1,l=h.length=0)}for(let p of e)d(p);return f(),o.length==1?o[0]:new qI(o,r)}};vi.empty=new lo([""],0);function kon(t){let e=-1;for(let r of t)e+=r.length+1;return e}function yX(t,e,r=0,n=1e9){for(let i=0,a=0,s=!0;a=r&&(l>n&&(o=o.slice(0,n-i)),i0?1:(e instanceof lo?e.text.length:e.children.length)<<1]}nextInner(e,r){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],a=this.offsets[n],s=a>>1,o=i instanceof lo?i.text.length:i.children.length;if(s==(r>0?o:0)){if(n==0)return this.done=!0,this.value="",this;r>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((a&1)==(r>0?0:1)){if(this.offsets[n]+=r,e==0)return this.lineBreak=!0,this.value=` -`,this;e--}else if(i instanceof lo){let l=i.text[s+(r<0?-1:0)];if(this.offsets[n]+=r,l.length>Math.max(0,e))return this.value=e==0?l:r>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[s+(r<0?-1:0)];e>l.length?(e-=l.length,this.offsets[n]+=r):(r<0&&this.offsets[n]--,this.nodes.push(l),this.offsets.push(r>0?1:(l instanceof lo?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Cwt{constructor(e,r,n){this.value="",this.done=!1,this.cursor=new I7(e,r>n?-1:1),this.pos=r>n?e.length:0,this.from=Math.min(r,n),this.to=Math.max(r,n)}nextInner(e,r){if(r<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,r<0?this.pos-this.to:this.from-this.pos);let n=r<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*r,this.value=i.length<=n?i:r<0?i.slice(i.length-n):i.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 Owt{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:r,lineBreak:n,value:i}=this.inner.next(e);return r&&this.afterBreak?(this.value="",this.afterBreak=!1):r?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(vi.prototype[Symbol.iterator]=function(){return this.iter()},I7.prototype[Symbol.iterator]=Cwt.prototype[Symbol.iterator]=Owt.prototype[Symbol.iterator]=function(){return this});let Eon=class{constructor(e,r,n,i){this.from=e,this.to=r,this.number=n,this.text=i}get length(){return this.to-this.from}};function o4(t,e,r){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,r))]}function Dl(t,e,r=!0,n=!0){return Con(t,e,r,n)}function _on(t){return t>=56320&&t<57344}function Ron(t){return t>=55296&&t<56320}function Ph(t,e){let r=t.charCodeAt(e);if(!Ron(r)||e+1==t.length)return r;let n=t.charCodeAt(e+1);return _on(n)?(r-55296<<10)+(n-56320)+65536:r}function rxe(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function o0(t){return t<65536?1:2}const nxe=/\r\n?|\n/;var uc=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(uc||(uc={}));class l0{constructor(e){this.sections=e}get length(){let e=0;for(let r=0;re)return a+(e-i);a+=o}else{if(n!=uc.Simple&&u>=e&&(n==uc.TrackDel&&ie||n==uc.TrackBefore&&ie))return null;if(u>e||u==e&&r<0&&!o)return e==i||r<0?a:a+l;a+=l}i=u}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return a}touchesRange(e,r=e){for(let n=0,i=0;n=0&&i<=r&&o>=e)return ir?"cover":!0;i=o}return!1}toString(){let e="";for(let r=0;r=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(r=>typeof r!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new l0(e)}static create(e){return new l0(e)}}class co extends l0{constructor(e,r){super(e),this.inserted=r}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return ixe(this,(r,n,i,a,s)=>e=e.replace(i,i+(n-r),s),!1),e}mapDesc(e,r=!1){return axe(this,e,r,!0)}invert(e){let r=this.sections.slice(),n=[];for(let i=0,a=0;i=0){r[i]=o,r[i+1]=s;let l=i>>1;for(;n.length0&&r2(n,r,a.text),a.forward(h),o+=h}let u=e[s++];for(;o>1].toJSON()))}return e}static of(e,r,n){let i=[],a=[],s=0,o=null;function l(h=!1){if(!h&&!i.length)return;sf||d<0||f>r)throw new RangeError(`Invalid change range ${d} to ${f} (in doc of length ${r})`);let g=p?typeof p=="string"?vi.of(p.split(n||nxe)):p:vi.empty,m=g.length;if(d==f&&m==0)return;ds&&Jc(i,d-s,-1),Jc(i,f-d,m),r2(a,i,g),s=f}}return u(e),l(!o),o}static empty(e){return new co(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let r=[],n=[];for(let i=0;io&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(a.length==1)r.push(a[0],0);else{for(;n.length=0&&r<=0&&r==t[i+1]?t[i]+=e:i>=0&&e==0&&t[i]==0?t[i+1]+=r:n?(t[i]+=e,t[i+1]+=r):t.push(e,r)}function r2(t,e,r){if(r.length==0)return;let n=e.length-2>>1;if(n>1])),!(r||s==t.sections.length||t.sections[s+1]<0);)o=t.sections[s++],l=t.sections[s++];e(i,u,a,h,d),i=u,a=h}}}function axe(t,e,r,n=!1){let i=[],a=n?[]:null,s=new P7(t),o=new P7(e);for(let l=-1;;){if(s.done&&o.len||o.done&&s.len)throw new Error("Mismatched change set lengths");if(s.ins==-1&&o.ins==-1){let u=Math.min(s.len,o.len);Jc(i,u,-1),s.forward(u),o.forward(u)}else if(o.ins>=0&&(s.ins<0||l==s.i||s.off==0&&(o.len=0&&l=0){let u=0,h=s.len;for(;h;)if(o.ins==-1){let d=Math.min(h,o.len);u+=d,h-=d,o.forward(d)}else if(o.ins==0&&o.lenl||s.ins>=0&&s.len>l)&&(o||n.length>u),a.forward2(l),s.forward(l)}}}}class P7{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return r>=e.length?vi.empty:e[r]}textBit(e){let{inserted:r}=this.set,n=this.i-2>>1;return n>=r.length&&!e?vi.empty:r[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)}}let N7=class kLe{constructor(e,r,n,i){this.from=e,this.to=r,this.flags=n,this.goalColumn=i}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,r=-1){let n,i;return this.empty?n=i=e.mapPos(this.from,r):(n=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new kLe(n,i,this.flags,this.goalColumn)}extend(e,r=e,n=0){if(e<=this.anchor&&r>=this.anchor)return bt.range(e,r,void 0,void 0,n);let i=Math.abs(e-this.anchor)>Math.abs(r-this.anchor)?e:r;return bt.range(this.anchor,i,void 0,void 0,n)}eq(e,r=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!r||!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 bt.range(e.anchor,e.head)}static create(e,r,n,i){return new kLe(e,r,n,i)}};class bt{constructor(e,r){this.ranges=e,this.mainIndex=r}map(e,r=-1){return e.empty?this:bt.create(this.ranges.map(n=>n.map(e,r)),this.mainIndex)}eq(e,r=!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 bt(e.ranges.map(r=>N7.fromJSON(r)),e.main)}static single(e,r=e){return new bt([bt.range(e,r)],0)}static create(e,r=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,i=0;ii.from-a.from),r=e.indexOf(n);for(let i=1;ia.head?bt.range(l,o):bt.range(o,l))}}return new bt(e,r)}}function Ewt(t,e){for(let r of t.ranges)if(r.to>e)throw new RangeError("Selection points outside of document")}let sxe=0;class vr{constructor(e,r,n,i,a){this.combine=e,this.compareInput=r,this.compare=n,this.isStatic=i,this.id=sxe++,this.default=e([]),this.extensions=typeof a=="function"?a(this):a}get reader(){return this}static define(e={}){return new vr(e.combine||(r=>r),e.compareInput||((r,n)=>r===n),e.compare||(e.combine?(r,n)=>r===n:oxe),!!e.static,e.enables)}of(e){return new bX([],this,0,e)}compute(e,r){if(this.isStatic)throw new Error("Can't compute a static facet");return new bX(e,this,1,r)}computeN(e,r){if(this.isStatic)throw new Error("Can't compute a static facet");return new bX(e,this,2,r)}from(e,r){return r||(r=n=>n),this.compute([e],n=>r(n.field(e)))}}function oxe(t,e){return t==e||t.length==e.length&&t.every((r,n)=>r===e[n])}class bX{constructor(e,r,n,i){this.dependencies=e,this.facet=r,this.type=n,this.value=i,this.id=sxe++}dynamicSlot(e){var r;let n=this.value,i=this.facet.compareInput,a=this.id,s=e[a]>>1,o=this.type==2,l=!1,u=!1,h=[];for(let d of this.dependencies)d=="doc"?l=!0:d=="selection"?u=!0:((r=e[d.id])!==null&&r!==void 0?r:1)&1||h.push(e[d.id]);return{create(d){return d.values[s]=n(d),1},update(d,f){if(l&&f.docChanged||u&&(f.docChanged||f.selection)||lxe(d,h)){let p=n(d);if(o?!_wt(p,d.values[s],i):!i(p,d.values[s]))return d.values[s]=p,1}return 0},reconfigure:(d,f)=>{let p,g=f.config.address[a];if(g!=null){let m=AX(f,g);if(this.dependencies.every(v=>v instanceof vr?f.facet(v)===d.facet(v):v instanceof Vs?f.field(v,!1)==d.field(v,!1):!0)||(o?_wt(p=n(d),m,i):i(p=n(d),m)))return d.values[s]=m,0}else p=n(d);return d.values[s]=p,1}}}get extension(){return this}}function _wt(t,e,r){if(t.length!=e.length)return!1;for(let n=0;nt[l.id]),i=r.map(l=>l.type),a=n.filter(l=>!(l&1)),s=t[e.id]>>1;function o(l){let u=[];for(let h=0;hn===i),e);return e.provide&&(r.provides=e.provide(r)),r}create(e){let r=e.facet(xX).find(n=>n.field==this);return((r==null?void 0:r.create)||this.createF)(e)}slot(e){let r=e[this.id]>>1;return{create:n=>(n.values[r]=this.create(n),1),update:(n,i)=>{let a=n.values[r],s=this.updateF(a,i);return this.compareF(a,s)?0:(n.values[r]=s,1)},reconfigure:(n,i)=>{let a=n.facet(xX),s=i.facet(xX),o;return(o=a.find(l=>l.field==this))&&o!=s.find(l=>l.field==this)?(n.values[r]=o.create(n),1):i.config.address[this.id]!=null?(n.values[r]=i.field(this),0):(n.values[r]=this.create(n),1)}}}init(e){return[this,xX.of({field:this,create:e})]}get extension(){return this}}const NS={lowest:4,low:3,default:2,high:1,highest:0};function B7(t){return e=>new Rwt(e,t)}const Fd={highest:B7(NS.highest),high:B7(NS.high),default:B7(NS.default),low:B7(NS.low),lowest:B7(NS.lowest)};class Rwt{constructor(e,r){this.inner=e,this.prec=r}get extension(){return this}}class l4{of(e){return new cxe(this,e)}reconfigure(e){return l4.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class cxe{constructor(e,r){this.compartment=e,this.inner=r}get extension(){return this}}class wX{constructor(e,r,n,i,a,s){for(this.base=e,this.compartments=r,this.dynamicSlots=n,this.address=i,this.staticValues=a,this.facets=s,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,r,n){let i=[],a=Object.create(null),s=new Map;for(let f of Lon(e,r,s))f instanceof Vs?i.push(f):(a[f.facet.id]||(a[f.facet.id]=[])).push(f);let o=Object.create(null),l=[],u=[];for(let f of i)o[f.id]=u.length<<1,u.push(p=>f.slot(p));let h=n==null?void 0:n.config.facets;for(let f in a){let p=a[f],g=p[0].facet,m=h&&h[f]||[];if(p.every(v=>v.type==0))if(o[g.id]=l.length<<1|1,oxe(m,p))l.push(n.facet(g));else{let v=g.combine(p.map(y=>y.value));l.push(n&&g.compare(v,n.facet(g))?n.facet(g):v)}else{for(let v of p)v.type==0?(o[v.id]=l.length<<1|1,l.push(v.value)):(o[v.id]=u.length<<1,u.push(y=>v.dynamicSlot(y)));o[g.id]=u.length<<1,u.push(v=>Don(v,g,p))}}let d=u.map(f=>f(o));return new wX(e,s,d,o,l,a)}}function Lon(t,e,r){let n=[[],[],[],[],[]],i=new Map;function a(s,o){let l=i.get(s);if(l!=null){if(l<=o)return;let u=n[l].indexOf(s);u>-1&&n[l].splice(u,1),s instanceof cxe&&r.delete(s.compartment)}if(i.set(s,o),Array.isArray(s))for(let u of s)a(u,o);else if(s instanceof cxe){if(r.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=e.get(s.compartment)||s.inner;r.set(s.compartment,u),a(u,o)}else if(s instanceof Rwt)a(s.inner,s.prec);else if(s instanceof Vs)n[o].push(s),s.provides&&a(s.provides,o);else if(s instanceof bX)n[o].push(s),s.facet.extensions&&a(s.facet.extensions,NS.default);else{let u=s.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${s}).`);if(u==s)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(u,o)}}return a(t,NS.default),n.reduce((s,o)=>s.concat(o))}function $7(t,e){if(e&1)return 2;let r=e>>1,n=t.status[r];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;t.status[r]=4;let i=t.computeSlot(t,t.config.dynamicSlots[r]);return t.status[r]=2|i}function AX(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const Dwt=vr.define(),uxe=vr.define({combine:t=>t.some(e=>e),static:!0}),Lwt=vr.define({combine:t=>t.length?t[0]:void 0,static:!0}),Mwt=vr.define(),Iwt=vr.define(),Pwt=vr.define(),Nwt=vr.define({combine:t=>t.length?t[0]:!1});let c0=class{constructor(e,r){this.type=e,this.value=r}static define(){return new Mon}};class Mon{of(e){return new c0(this,e)}}class Ion{constructor(e){this.map=e}of(e){return new nn(this,e)}}class nn{constructor(e,r){this.type=e,this.value=r}map(e){let r=this.type.map(this.value,e);return r===void 0?void 0:r==this.value?this:new nn(this.type,r)}is(e){return this.type==e}static define(e={}){return new Ion(e.map||(r=>r))}static mapEffects(e,r){if(!e.length)return e;let n=[];for(let i of e){let a=i.map(r);a&&n.push(a)}return n}}nn.reconfigure=nn.define(),nn.appendConfig=nn.define();class Do{constructor(e,r,n,i,a,s){this.startState=e,this.changes=r,this.selection=n,this.effects=i,this.annotations=a,this.scrollIntoView=s,this._doc=null,this._state=null,n&&Ewt(n,r.newLength),a.some(o=>o.type==Do.time)||(this.annotations=a.concat(Do.time.of(Date.now())))}static create(e,r,n,i,a,s){return new Do(e,r,n,i,a,s)}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 r of this.annotations)if(r.type==e)return r.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let r=this.annotation(Do.userEvent);return!!(r&&(r==e||r.length>e.length&&r.slice(0,e.length)==e&&r[e.length]=="."))}}Do.time=c0.define(),Do.userEvent=c0.define(),Do.addToHistory=c0.define(),Do.remote=c0.define();function Pon(t,e){let r=[];for(let n=0,i=0;;){let a,s;if(n=t[n]))a=t[n++],s=t[n++];else if(i=0;i--){let a=n[i](t);a instanceof Do?t=a:Array.isArray(a)&&a.length==1&&a[0]instanceof Do?t=a[0]:t=$wt(e,c4(a),!1)}return t}function Bon(t){let e=t.startState,r=e.facet(Pwt),n=t;for(let i=r.length-1;i>=0;i--){let a=r[i](t);a&&Object.keys(a).length&&(n=Bwt(n,hxe(e,a,t.changes.newLength),!0))}return n==t?t:Do.create(e,t.changes,t.selection,n.effects,n.annotations,n.scrollIntoView)}const $on=[];function c4(t){return t==null?$on:Array.isArray(t)?t:[t]}var ps=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(ps||(ps={}));const Fon=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let dxe;try{dxe=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function zon(t){if(dxe)return dxe.test(t);for(let e=0;e"€"&&(r.toUpperCase()!=r.toLowerCase()||Fon.test(r)))return!0}return!1}function Uon(t){return e=>{if(!/\S/.test(e))return ps.Space;if(zon(e))return ps.Word;for(let r=0;r-1)return ps.Word;return ps.Other}}class Kn{constructor(e,r,n,i,a,s){this.config=e,this.doc=r,this.selection=n,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=a,s&&(s._state=this);for(let o=0;oi.set(u,l)),r=null),i.set(o.value.compartment,o.value.extension)):o.is(nn.reconfigure)?(r=null,n=o.value):o.is(nn.appendConfig)&&(r=null,n=c4(n).concat(o.value));let a;r?a=e.startState.values.slice():(r=wX.resolve(n,i,this),a=new Kn(r,this.doc,this.selection,r.dynamicSlots.map(()=>null),(l,u)=>u.reconfigure(l,this),null).values);let s=e.startState.facet(uxe)?e.newSelection:e.newSelection.asSingle();new Kn(r,e.newDoc,s,a,(o,l)=>l.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:e},range:bt.cursor(r.from+e.length)}))}changeByRange(e){let r=this.selection,n=e(r.ranges[0]),i=this.changes(n.changes),a=[n.range],s=c4(n.effects);for(let o=1;os.spec.fromJSON(o,l)))}}return Kn.create({doc:e.doc,selection:bt.fromJSON(e.selection),extensions:r.extensions?i.concat([r.extensions]):i})}static create(e={}){let r=wX.resolve(e.extensions||[],new Map),n=e.doc instanceof vi?e.doc:vi.of((e.doc||"").split(r.staticFacet(Kn.lineSeparator)||nxe)),i=e.selection?e.selection instanceof bt?e.selection:bt.single(e.selection.anchor,e.selection.head):bt.single(0);return Ewt(i,n.length),r.staticFacet(uxe)||(i=i.asSingle()),new Kn(r,n,i,r.dynamicSlots.map(()=>null),(a,s)=>s.create(a),null)}get tabSize(){return this.facet(Kn.tabSize)}get lineBreak(){return this.facet(Kn.lineSeparator)||` -`}get readOnly(){return this.facet(Nwt)}phrase(e,...r){for(let n of this.facet(Kn.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return r.length&&(e=e.replace(/\$(\$|\d*)/g,(n,i)=>{if(i=="$")return"$";let a=+(i||1);return!a||a>r.length?n:r[a-1]})),e}languageDataAt(e,r,n=-1){let i=[];for(let a of this.facet(Dwt))for(let s of a(this,r,n))Object.prototype.hasOwnProperty.call(s,e)&&i.push(s[e]);return i}charCategorizer(e){let r=this.languageDataAt("wordChars",e);return Uon(r.length?r[0]:"")}wordAt(e){let{text:r,from:n,length:i}=this.doc.lineAt(e),a=this.charCategorizer(e),s=e-n,o=e-n;for(;s>0;){let l=Dl(r,s,!1);if(a(r.slice(l,s))!=ps.Word)break;s=l}for(;ot.length?t[0]:4}),Kn.lineSeparator=Lwt,Kn.readOnly=Nwt,Kn.phrases=vr.define({compare(t,e){let r=Object.keys(t),n=Object.keys(e);return r.length==n.length&&r.every(i=>t[i]==e[i])}}),Kn.languageData=Dwt,Kn.changeFilter=Mwt,Kn.transactionFilter=Iwt,Kn.transactionExtender=Pwt,l4.reconfigure=nn.define();function u0(t,e,r={}){let n={};for(let i of t)for(let a of Object.keys(i)){let s=i[a],o=n[a];if(o===void 0)n[a]=s;else if(!(o===s||s===void 0))if(Object.hasOwnProperty.call(r,a))n[a]=r[a](o,s);else throw new Error("Config merge conflict for field "+a)}for(let i in e)n[i]===void 0&&(n[i]=e[i]);return n}class n2{eq(e){return this==e}range(e,r=e){return pxe.create(e,r,this)}}n2.prototype.startSide=n2.prototype.endSide=0,n2.prototype.point=!1,n2.prototype.mapMode=uc.TrackDel;function fxe(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let pxe=class FZt{constructor(e,r,n){this.from=e,this.to=r,this.value=n}static create(e,r,n){return new FZt(e,r,n)}};function gxe(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}let Von=class zZt{constructor(e,r,n,i){this.from=e,this.to=r,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,r,n,i=0){let a=n?this.to:this.from;for(let s=i,o=a.length;;){if(s==o)return s;let l=s+o>>1,u=a[l]-e||(n?this.value[l].endSide:this.value[l].startSide)-r;if(l==s)return u>=0?s:o;u>=0?o=l:s=l+1}}between(e,r,n,i){for(let a=this.findIndex(r,-1e9,!0),s=this.findIndex(n,1e9,!1,a);ap||f==p&&u.startSide>0&&u.endSide<=0)continue;(p-f||u.endSide-u.startSide)<0||(s<0&&(s=f),u.point&&(o=Math.max(o,p-f)),n.push(u),i.push(f-s),a.push(p-s))}return{mapped:n.length?new zZt(i,a,n,o):null,pos:s}}};class Zn{constructor(e,r,n,i){this.chunkPos=e,this.chunk=r,this.nextLayer=n,this.maxPoint=i}static create(e,r,n,i){return new Zn(e,r,n,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let r of this.chunk)e+=r.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:r=[],sort:n=!1,filterFrom:i=0,filterTo:a=this.length}=e,s=e.filter;if(r.length==0&&!s)return this;if(n&&(r=r.slice().sort(gxe)),this.isEmpty)return r.length?Zn.of(r):this;let o=new zwt(this,null,-1).goto(0),l=0,u=[],h=new Lu;for(;o.value||l=0){let d=r[l++];h.addInner(d.from,d.to,d.value)||u.push(d)}else o.rangeIndex==1&&o.chunkIndexthis.chunkEnd(o.chunkIndex)||ao.to||a=a&&e<=a+s.length&&s.between(a,e-a,r-a,n)===!1)return}this.nextLayer.between(e,r,n)}}iter(e=0){return F7.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,r=0){return F7.from(e).goto(r)}static compare(e,r,n,i,a=-1){let s=e.filter(d=>d.maxPoint>0||!d.isEmpty&&d.maxPoint>=a),o=r.filter(d=>d.maxPoint>0||!d.isEmpty&&d.maxPoint>=a),l=Fwt(s,o,n),u=new z7(s,l,a),h=new z7(o,l,a);n.iterGaps((d,f,p)=>Uwt(u,d,h,f,p,i)),n.empty&&n.length==0&&Uwt(u,0,h,0,0,i)}static eq(e,r,n=0,i){i==null&&(i=999999999);let a=e.filter(h=>!h.isEmpty&&r.indexOf(h)<0),s=r.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(a.length!=s.length)return!1;if(!a.length)return!0;let o=Fwt(a,s),l=new z7(a,o,0).goto(n),u=new z7(s,o,0).goto(n);for(;;){if(l.to!=u.to||!vxe(l.active,u.active)||l.point&&(!u.point||!fxe(l.point,u.point)))return!1;if(l.to>i)return!0;l.next(),u.next()}}static spans(e,r,n,i,a=-1){let s=new z7(e,null,a).goto(r),o=r,l=s.openStart;for(;;){let u=Math.min(s.to,n);if(s.point){let h=s.activeForPoint(s.to),d=s.pointFromo&&(i.span(o,u,s.active,l),l=s.openEnd(u));if(s.to>n)return l+(s.point&&s.to>n?1:0);o=s.to,s.next()}}static of(e,r=!1){let n=new Lu;for(let i of e instanceof pxe?[e]:r?Qon(e):e)n.add(i.from,i.to,i.value);return n.finish()}static join(e){if(!e.length)return Zn.empty;let r=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let i=e[n];i!=Zn.empty;i=i.nextLayer)r=new Zn(i.chunkPos,i.chunk,r,Math.max(i.maxPoint,r.maxPoint));return r}}Zn.empty=new Zn([],[],null,-1);function Qon(t){if(t.length>1)for(let e=t[0],r=1;r0)return t.slice().sort(gxe);e=n}return t}Zn.empty.nextLayer=Zn.empty;class Lu{finishChunk(e){this.chunks.push(new Von(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,r,n){this.addInner(e,r,n)||(this.nextLayer||(this.nextLayer=new Lu)).add(e,r,n)}addInner(e,r,n){let i=e-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(r-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=r,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,r-e)),!0)}addChunk(e,r){if((e-this.lastTo||r.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,r.maxPoint),this.chunks.push(r),this.chunkPos.push(e);let n=r.value.length-1;return this.last=r.value[n],this.lastFrom=r.from[n]+e,this.lastTo=r.to[n]+e,!0}finish(){return this.finishInner(Zn.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let r=Zn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,r}}function Fwt(t,e,r){let n=new Map;for(let a of t)for(let s=0;s=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&i.push(new zwt(s,r,n,a));return i.length==1?i[0]:new F7(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,r=-1e9){for(let n of this.heap)n.goto(e,r);for(let n=this.heap.length>>1;n>=0;n--)mxe(this.heap,n);return this.next(),this}forward(e,r){for(let n of this.heap)n.forward(e,r);for(let n=this.heap.length>>1;n>=0;n--)mxe(this.heap,n);(this.to-e||this.value.endSide-r)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),mxe(this.heap,0)}}}function mxe(t,e){for(let r=t[e];;){let n=(e<<1)+1;if(n>=t.length)break;let i=t[n];if(n+1=0&&(i=t[n+1],n++),r.compare(i)<0)break;t[n]=r,t[e]=i,e=n}}class z7{constructor(e,r,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=F7.from(e,r,n)}goto(e,r=-1e9){return this.cursor.goto(e,r),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=r,this.openStart=-1,this.next(),this}forward(e,r){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-r)<0;)this.removeActive(this.minActive);this.cursor.forward(e,r)}removeActive(e){TX(this.active,e),TX(this.activeTo,e),TX(this.activeRank,e),this.minActive=Vwt(this.active,this.activeTo)}addActive(e){let r=0,{value:n,to:i,rank:a}=this.cursor;for(;r0;)r++;SX(this.active,r,n),SX(this.activeTo,r,i),SX(this.activeRank,r,a),e&&SX(e,r,this.cursor.from),this.minActive=Vwt(this.active,this.activeTo)}next(){let e=this.to,r=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&TX(n,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let a=this.cursor.value;if(!a.point)this.addActive(n),this.cursor.next();else if(r&&this.cursor.to==this.to&&this.cursor.from=0&&n[i]=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&r.push(this.active[n]);return r.reverse()}openEnd(e){let r=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)r++;return r}}function Uwt(t,e,r,n,i,a){t.goto(e),r.goto(n);let s=n+i,o=n,l=n-e,u=!!a.boundChange;for(let h=!1;;){let d=t.to+l-r.to,f=d||t.endSide-r.endSide,p=f<0?t.to+l:r.to,g=Math.min(p,s);if(t.point||r.point?(t.point&&r.point&&fxe(t.point,r.point)&&vxe(t.activeForPoint(t.to),r.activeForPoint(r.to))||a.comparePoint(o,g,t.point,r.point),h=!1):(h&&a.boundChange(o),g>o&&!vxe(t.active,r.active)&&a.compareRange(o,g,t.active,r.active),u&&gs)break;o=p,f<=0&&t.next(),f>=0&&r.next()}}function vxe(t,e){if(t.length!=e.length)return!1;for(let r=0;r=e;n--)t[n+1]=t[n];t[e]=r}function Vwt(t,e){let r=-1,n=1e9;for(let i=0;i=e)return i;if(i==t.length)break;a+=t.charCodeAt(i)==9?r-a%r:1,i=Dl(t,i)}return n===!0?-1:t.length}const bxe="ͼ",Qwt=typeof Symbol>"u"?"__"+bxe:Symbol.for(bxe),xxe=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Gwt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Gy{constructor(e,r){this.rules=[];let{finish:n}=r||{};function i(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function a(s,o,l,u){let h=[],d=/^@(\w+)\b/.exec(s[0]),f=d&&d[1]=="keyframes";if(d&&o==null)return l.push(s[0]+";");for(let p in o){let g=o[p];if(/&/.test(p))a(p.split(/,\s*/).map(m=>s.map(v=>m.replace(/&/,v))).reduce((m,v)=>m.concat(v)),g,l);else if(g&&typeof g=="object"){if(!d)throw new RangeError("The value of a property ("+p+") should be a primitive value.");a(i(p),g,h,f)}else g!=null&&h.push(p.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+g+";")}(h.length||f)&&l.push((n&&!d&&!u?s.map(n):s).join(", ")+" {"+h.join(" ")+"}")}for(let s in e)a(i(s),e[s],this.rules)}getRules(){return this.rules.join(` +`){[e,r]=o4(this,e,r);let i="";for(let a=0,s=0;ae&&a&&(i+=n),es&&(i+=o.sliceString(e-s,r-s,n)),s=l+1}return i}flatten(e){for(let r of this.children)r.flatten(e)}scanIdentical(e,r){if(!(e instanceof qI))return 0;let n=0,[i,a,s,o]=r>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=r,a+=r){if(i==s||a==o)return n;let l=this.children[i],u=e.children[a];if(l!=u)return n+l.scanIdentical(u,r);n+=l.length+1}}static from(e,r=e.reduce((n,i)=>n+i.length+1,-1)){let n=0;for(let p of e)n+=p.lines;if(n<32){let p=[];for(let g of e)g.flatten(p);return new lo(p,r)}let i=Math.max(32,n>>5),a=i<<1,s=i>>1,o=[],l=0,u=-1,h=[];function d(p){let g;if(p.lines>a&&p instanceof qI)for(let m of p.children)d(m);else p.lines>s&&(l>s||!l)?(f(),o.push(p)):p instanceof lo&&l&&(g=h[h.length-1])instanceof lo&&p.lines+g.lines<=32?(l+=p.lines,u+=p.length+1,h[h.length-1]=new lo(g.text.concat(p.text),g.length+1+p.length)):(l+p.lines>i&&f(),l+=p.lines,u+=p.length+1,h.push(p))}function f(){l!=0&&(o.push(h.length==1?h[0]:qI.from(h,u)),u=-1,l=h.length=0)}for(let p of e)d(p);return f(),o.length==1?o[0]:new qI(o,r)}};vi.empty=new lo([""],0);function kon(t){let e=-1;for(let r of t)e+=r.length+1;return e}function yX(t,e,r=0,n=1e9){for(let i=0,a=0,s=!0;a=r&&(l>n&&(o=o.slice(0,n-i)),i0?1:(e instanceof lo?e.text.length:e.children.length)<<1]}nextInner(e,r){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],a=this.offsets[n],s=a>>1,o=i instanceof lo?i.text.length:i.children.length;if(s==(r>0?o:0)){if(n==0)return this.done=!0,this.value="",this;r>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((a&1)==(r>0?0:1)){if(this.offsets[n]+=r,e==0)return this.lineBreak=!0,this.value=` +`,this;e--}else if(i instanceof lo){let l=i.text[s+(r<0?-1:0)];if(this.offsets[n]+=r,l.length>Math.max(0,e))return this.value=e==0?l:r>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[s+(r<0?-1:0)];e>l.length?(e-=l.length,this.offsets[n]+=r):(r<0&&this.offsets[n]--,this.nodes.push(l),this.offsets.push(r>0?1:(l instanceof lo?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Cwt{constructor(e,r,n){this.value="",this.done=!1,this.cursor=new I7(e,r>n?-1:1),this.pos=r>n?e.length:0,this.from=Math.min(r,n),this.to=Math.max(r,n)}nextInner(e,r){if(r<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,r<0?this.pos-this.to:this.from-this.pos);let n=r<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*r,this.value=i.length<=n?i:r<0?i.slice(i.length-n):i.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 Owt{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:r,lineBreak:n,value:i}=this.inner.next(e);return r&&this.afterBreak?(this.value="",this.afterBreak=!1):r?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(vi.prototype[Symbol.iterator]=function(){return this.iter()},I7.prototype[Symbol.iterator]=Cwt.prototype[Symbol.iterator]=Owt.prototype[Symbol.iterator]=function(){return this});let Eon=class{constructor(e,r,n,i){this.from=e,this.to=r,this.number=n,this.text=i}get length(){return this.to-this.from}};function o4(t,e,r){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,r))]}function Dl(t,e,r=!0,n=!0){return Con(t,e,r,n)}function _on(t){return t>=56320&&t<57344}function Ron(t){return t>=55296&&t<56320}function Ph(t,e){let r=t.charCodeAt(e);if(!Ron(r)||e+1==t.length)return r;let n=t.charCodeAt(e+1);return _on(n)?(r-55296<<10)+(n-56320)+65536:r}function rxe(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function o0(t){return t<65536?1:2}const nxe=/\r\n?|\n/;var uc=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(uc||(uc={}));class l0{constructor(e){this.sections=e}get length(){let e=0;for(let r=0;re)return a+(e-i);a+=o}else{if(n!=uc.Simple&&u>=e&&(n==uc.TrackDel&&ie||n==uc.TrackBefore&&ie))return null;if(u>e||u==e&&r<0&&!o)return e==i||r<0?a:a+l;a+=l}i=u}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return a}touchesRange(e,r=e){for(let n=0,i=0;n=0&&i<=r&&o>=e)return ir?"cover":!0;i=o}return!1}toString(){let e="";for(let r=0;r=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(r=>typeof r!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new l0(e)}static create(e){return new l0(e)}}class co extends l0{constructor(e,r){super(e),this.inserted=r}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return ixe(this,(r,n,i,a,s)=>e=e.replace(i,i+(n-r),s),!1),e}mapDesc(e,r=!1){return axe(this,e,r,!0)}invert(e){let r=this.sections.slice(),n=[];for(let i=0,a=0;i=0){r[i]=o,r[i+1]=s;let l=i>>1;for(;n.length0&&r2(n,r,a.text),a.forward(h),o+=h}let u=e[s++];for(;o>1].toJSON()))}return e}static of(e,r,n){let i=[],a=[],s=0,o=null;function l(h=!1){if(!h&&!i.length)return;sf||d<0||f>r)throw new RangeError(`Invalid change range ${d} to ${f} (in doc of length ${r})`);let g=p?typeof p=="string"?vi.of(p.split(n||nxe)):p:vi.empty,m=g.length;if(d==f&&m==0)return;ds&&Jc(i,d-s,-1),Jc(i,f-d,m),r2(a,i,g),s=f}}return u(e),l(!o),o}static empty(e){return new co(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let r=[],n=[];for(let i=0;io&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(a.length==1)r.push(a[0],0);else{for(;n.length=0&&r<=0&&r==t[i+1]?t[i]+=e:i>=0&&e==0&&t[i]==0?t[i+1]+=r:n?(t[i]+=e,t[i+1]+=r):t.push(e,r)}function r2(t,e,r){if(r.length==0)return;let n=e.length-2>>1;if(n>1])),!(r||s==t.sections.length||t.sections[s+1]<0);)o=t.sections[s++],l=t.sections[s++];e(i,u,a,h,d),i=u,a=h}}}function axe(t,e,r,n=!1){let i=[],a=n?[]:null,s=new P7(t),o=new P7(e);for(let l=-1;;){if(s.done&&o.len||o.done&&s.len)throw new Error("Mismatched change set lengths");if(s.ins==-1&&o.ins==-1){let u=Math.min(s.len,o.len);Jc(i,u,-1),s.forward(u),o.forward(u)}else if(o.ins>=0&&(s.ins<0||l==s.i||s.off==0&&(o.len=0&&l=0){let u=0,h=s.len;for(;h;)if(o.ins==-1){let d=Math.min(h,o.len);u+=d,h-=d,o.forward(d)}else if(o.ins==0&&o.lenl||s.ins>=0&&s.len>l)&&(o||n.length>u),a.forward2(l),s.forward(l)}}}}class P7{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return r>=e.length?vi.empty:e[r]}textBit(e){let{inserted:r}=this.set,n=this.i-2>>1;return n>=r.length&&!e?vi.empty:r[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)}}let N7=class kLe{constructor(e,r,n,i){this.from=e,this.to=r,this.flags=n,this.goalColumn=i}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,r=-1){let n,i;return this.empty?n=i=e.mapPos(this.from,r):(n=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new kLe(n,i,this.flags,this.goalColumn)}extend(e,r=e,n=0){if(e<=this.anchor&&r>=this.anchor)return bt.range(e,r,void 0,void 0,n);let i=Math.abs(e-this.anchor)>Math.abs(r-this.anchor)?e:r;return bt.range(this.anchor,i,void 0,void 0,n)}eq(e,r=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!r||!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 bt.range(e.anchor,e.head)}static create(e,r,n,i){return new kLe(e,r,n,i)}};class bt{constructor(e,r){this.ranges=e,this.mainIndex=r}map(e,r=-1){return e.empty?this:bt.create(this.ranges.map(n=>n.map(e,r)),this.mainIndex)}eq(e,r=!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 bt(e.ranges.map(r=>N7.fromJSON(r)),e.main)}static single(e,r=e){return new bt([bt.range(e,r)],0)}static create(e,r=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,i=0;ii.from-a.from),r=e.indexOf(n);for(let i=1;ia.head?bt.range(l,o):bt.range(o,l))}}return new bt(e,r)}}function Ewt(t,e){for(let r of t.ranges)if(r.to>e)throw new RangeError("Selection points outside of document")}let sxe=0;class vr{constructor(e,r,n,i,a){this.combine=e,this.compareInput=r,this.compare=n,this.isStatic=i,this.id=sxe++,this.default=e([]),this.extensions=typeof a=="function"?a(this):a}get reader(){return this}static define(e={}){return new vr(e.combine||(r=>r),e.compareInput||((r,n)=>r===n),e.compare||(e.combine?(r,n)=>r===n:oxe),!!e.static,e.enables)}of(e){return new bX([],this,0,e)}compute(e,r){if(this.isStatic)throw new Error("Can't compute a static facet");return new bX(e,this,1,r)}computeN(e,r){if(this.isStatic)throw new Error("Can't compute a static facet");return new bX(e,this,2,r)}from(e,r){return r||(r=n=>n),this.compute([e],n=>r(n.field(e)))}}function oxe(t,e){return t==e||t.length==e.length&&t.every((r,n)=>r===e[n])}class bX{constructor(e,r,n,i){this.dependencies=e,this.facet=r,this.type=n,this.value=i,this.id=sxe++}dynamicSlot(e){var r;let n=this.value,i=this.facet.compareInput,a=this.id,s=e[a]>>1,o=this.type==2,l=!1,u=!1,h=[];for(let d of this.dependencies)d=="doc"?l=!0:d=="selection"?u=!0:((r=e[d.id])!==null&&r!==void 0?r:1)&1||h.push(e[d.id]);return{create(d){return d.values[s]=n(d),1},update(d,f){if(l&&f.docChanged||u&&(f.docChanged||f.selection)||lxe(d,h)){let p=n(d);if(o?!_wt(p,d.values[s],i):!i(p,d.values[s]))return d.values[s]=p,1}return 0},reconfigure:(d,f)=>{let p,g=f.config.address[a];if(g!=null){let m=AX(f,g);if(this.dependencies.every(v=>v instanceof vr?f.facet(v)===d.facet(v):v instanceof Vs?f.field(v,!1)==d.field(v,!1):!0)||(o?_wt(p=n(d),m,i):i(p=n(d),m)))return d.values[s]=m,0}else p=n(d);return d.values[s]=p,1}}}get extension(){return this}}function _wt(t,e,r){if(t.length!=e.length)return!1;for(let n=0;nt[l.id]),i=r.map(l=>l.type),a=n.filter(l=>!(l&1)),s=t[e.id]>>1;function o(l){let u=[];for(let h=0;hn===i),e);return e.provide&&(r.provides=e.provide(r)),r}create(e){let r=e.facet(xX).find(n=>n.field==this);return((r==null?void 0:r.create)||this.createF)(e)}slot(e){let r=e[this.id]>>1;return{create:n=>(n.values[r]=this.create(n),1),update:(n,i)=>{let a=n.values[r],s=this.updateF(a,i);return this.compareF(a,s)?0:(n.values[r]=s,1)},reconfigure:(n,i)=>{let a=n.facet(xX),s=i.facet(xX),o;return(o=a.find(l=>l.field==this))&&o!=s.find(l=>l.field==this)?(n.values[r]=o.create(n),1):i.config.address[this.id]!=null?(n.values[r]=i.field(this),0):(n.values[r]=this.create(n),1)}}}init(e){return[this,xX.of({field:this,create:e})]}get extension(){return this}}const NT={lowest:4,low:3,default:2,high:1,highest:0};function B7(t){return e=>new Rwt(e,t)}const Fd={highest:B7(NT.highest),high:B7(NT.high),default:B7(NT.default),low:B7(NT.low),lowest:B7(NT.lowest)};class Rwt{constructor(e,r){this.inner=e,this.prec=r}get extension(){return this}}class l4{of(e){return new cxe(this,e)}reconfigure(e){return l4.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class cxe{constructor(e,r){this.compartment=e,this.inner=r}get extension(){return this}}class wX{constructor(e,r,n,i,a,s){for(this.base=e,this.compartments=r,this.dynamicSlots=n,this.address=i,this.staticValues=a,this.facets=s,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,r,n){let i=[],a=Object.create(null),s=new Map;for(let f of Lon(e,r,s))f instanceof Vs?i.push(f):(a[f.facet.id]||(a[f.facet.id]=[])).push(f);let o=Object.create(null),l=[],u=[];for(let f of i)o[f.id]=u.length<<1,u.push(p=>f.slot(p));let h=n==null?void 0:n.config.facets;for(let f in a){let p=a[f],g=p[0].facet,m=h&&h[f]||[];if(p.every(v=>v.type==0))if(o[g.id]=l.length<<1|1,oxe(m,p))l.push(n.facet(g));else{let v=g.combine(p.map(y=>y.value));l.push(n&&g.compare(v,n.facet(g))?n.facet(g):v)}else{for(let v of p)v.type==0?(o[v.id]=l.length<<1|1,l.push(v.value)):(o[v.id]=u.length<<1,u.push(y=>v.dynamicSlot(y)));o[g.id]=u.length<<1,u.push(v=>Don(v,g,p))}}let d=u.map(f=>f(o));return new wX(e,s,d,o,l,a)}}function Lon(t,e,r){let n=[[],[],[],[],[]],i=new Map;function a(s,o){let l=i.get(s);if(l!=null){if(l<=o)return;let u=n[l].indexOf(s);u>-1&&n[l].splice(u,1),s instanceof cxe&&r.delete(s.compartment)}if(i.set(s,o),Array.isArray(s))for(let u of s)a(u,o);else if(s instanceof cxe){if(r.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=e.get(s.compartment)||s.inner;r.set(s.compartment,u),a(u,o)}else if(s instanceof Rwt)a(s.inner,s.prec);else if(s instanceof Vs)n[o].push(s),s.provides&&a(s.provides,o);else if(s instanceof bX)n[o].push(s),s.facet.extensions&&a(s.facet.extensions,NT.default);else{let u=s.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${s}).`);if(u==s)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(u,o)}}return a(t,NT.default),n.reduce((s,o)=>s.concat(o))}function $7(t,e){if(e&1)return 2;let r=e>>1,n=t.status[r];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;t.status[r]=4;let i=t.computeSlot(t,t.config.dynamicSlots[r]);return t.status[r]=2|i}function AX(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const Dwt=vr.define(),uxe=vr.define({combine:t=>t.some(e=>e),static:!0}),Lwt=vr.define({combine:t=>t.length?t[0]:void 0,static:!0}),Mwt=vr.define(),Iwt=vr.define(),Pwt=vr.define(),Nwt=vr.define({combine:t=>t.length?t[0]:!1});let c0=class{constructor(e,r){this.type=e,this.value=r}static define(){return new Mon}};class Mon{of(e){return new c0(this,e)}}class Ion{constructor(e){this.map=e}of(e){return new nn(this,e)}}class nn{constructor(e,r){this.type=e,this.value=r}map(e){let r=this.type.map(this.value,e);return r===void 0?void 0:r==this.value?this:new nn(this.type,r)}is(e){return this.type==e}static define(e={}){return new Ion(e.map||(r=>r))}static mapEffects(e,r){if(!e.length)return e;let n=[];for(let i of e){let a=i.map(r);a&&n.push(a)}return n}}nn.reconfigure=nn.define(),nn.appendConfig=nn.define();class Do{constructor(e,r,n,i,a,s){this.startState=e,this.changes=r,this.selection=n,this.effects=i,this.annotations=a,this.scrollIntoView=s,this._doc=null,this._state=null,n&&Ewt(n,r.newLength),a.some(o=>o.type==Do.time)||(this.annotations=a.concat(Do.time.of(Date.now())))}static create(e,r,n,i,a,s){return new Do(e,r,n,i,a,s)}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 r of this.annotations)if(r.type==e)return r.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let r=this.annotation(Do.userEvent);return!!(r&&(r==e||r.length>e.length&&r.slice(0,e.length)==e&&r[e.length]=="."))}}Do.time=c0.define(),Do.userEvent=c0.define(),Do.addToHistory=c0.define(),Do.remote=c0.define();function Pon(t,e){let r=[];for(let n=0,i=0;;){let a,s;if(n=t[n]))a=t[n++],s=t[n++];else if(i=0;i--){let a=n[i](t);a instanceof Do?t=a:Array.isArray(a)&&a.length==1&&a[0]instanceof Do?t=a[0]:t=$wt(e,c4(a),!1)}return t}function Bon(t){let e=t.startState,r=e.facet(Pwt),n=t;for(let i=r.length-1;i>=0;i--){let a=r[i](t);a&&Object.keys(a).length&&(n=Bwt(n,hxe(e,a,t.changes.newLength),!0))}return n==t?t:Do.create(e,t.changes,t.selection,n.effects,n.annotations,n.scrollIntoView)}const $on=[];function c4(t){return t==null?$on:Array.isArray(t)?t:[t]}var ps=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(ps||(ps={}));const Fon=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let dxe;try{dxe=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function zon(t){if(dxe)return dxe.test(t);for(let e=0;e"€"&&(r.toUpperCase()!=r.toLowerCase()||Fon.test(r)))return!0}return!1}function Uon(t){return e=>{if(!/\S/.test(e))return ps.Space;if(zon(e))return ps.Word;for(let r=0;r-1)return ps.Word;return ps.Other}}class Kn{constructor(e,r,n,i,a,s){this.config=e,this.doc=r,this.selection=n,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=a,s&&(s._state=this);for(let o=0;oi.set(u,l)),r=null),i.set(o.value.compartment,o.value.extension)):o.is(nn.reconfigure)?(r=null,n=o.value):o.is(nn.appendConfig)&&(r=null,n=c4(n).concat(o.value));let a;r?a=e.startState.values.slice():(r=wX.resolve(n,i,this),a=new Kn(r,this.doc,this.selection,r.dynamicSlots.map(()=>null),(l,u)=>u.reconfigure(l,this),null).values);let s=e.startState.facet(uxe)?e.newSelection:e.newSelection.asSingle();new Kn(r,e.newDoc,s,a,(o,l)=>l.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:e},range:bt.cursor(r.from+e.length)}))}changeByRange(e){let r=this.selection,n=e(r.ranges[0]),i=this.changes(n.changes),a=[n.range],s=c4(n.effects);for(let o=1;os.spec.fromJSON(o,l)))}}return Kn.create({doc:e.doc,selection:bt.fromJSON(e.selection),extensions:r.extensions?i.concat([r.extensions]):i})}static create(e={}){let r=wX.resolve(e.extensions||[],new Map),n=e.doc instanceof vi?e.doc:vi.of((e.doc||"").split(r.staticFacet(Kn.lineSeparator)||nxe)),i=e.selection?e.selection instanceof bt?e.selection:bt.single(e.selection.anchor,e.selection.head):bt.single(0);return Ewt(i,n.length),r.staticFacet(uxe)||(i=i.asSingle()),new Kn(r,n,i,r.dynamicSlots.map(()=>null),(a,s)=>s.create(a),null)}get tabSize(){return this.facet(Kn.tabSize)}get lineBreak(){return this.facet(Kn.lineSeparator)||` +`}get readOnly(){return this.facet(Nwt)}phrase(e,...r){for(let n of this.facet(Kn.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return r.length&&(e=e.replace(/\$(\$|\d*)/g,(n,i)=>{if(i=="$")return"$";let a=+(i||1);return!a||a>r.length?n:r[a-1]})),e}languageDataAt(e,r,n=-1){let i=[];for(let a of this.facet(Dwt))for(let s of a(this,r,n))Object.prototype.hasOwnProperty.call(s,e)&&i.push(s[e]);return i}charCategorizer(e){let r=this.languageDataAt("wordChars",e);return Uon(r.length?r[0]:"")}wordAt(e){let{text:r,from:n,length:i}=this.doc.lineAt(e),a=this.charCategorizer(e),s=e-n,o=e-n;for(;s>0;){let l=Dl(r,s,!1);if(a(r.slice(l,s))!=ps.Word)break;s=l}for(;ot.length?t[0]:4}),Kn.lineSeparator=Lwt,Kn.readOnly=Nwt,Kn.phrases=vr.define({compare(t,e){let r=Object.keys(t),n=Object.keys(e);return r.length==n.length&&r.every(i=>t[i]==e[i])}}),Kn.languageData=Dwt,Kn.changeFilter=Mwt,Kn.transactionFilter=Iwt,Kn.transactionExtender=Pwt,l4.reconfigure=nn.define();function u0(t,e,r={}){let n={};for(let i of t)for(let a of Object.keys(i)){let s=i[a],o=n[a];if(o===void 0)n[a]=s;else if(!(o===s||s===void 0))if(Object.hasOwnProperty.call(r,a))n[a]=r[a](o,s);else throw new Error("Config merge conflict for field "+a)}for(let i in e)n[i]===void 0&&(n[i]=e[i]);return n}class n2{eq(e){return this==e}range(e,r=e){return pxe.create(e,r,this)}}n2.prototype.startSide=n2.prototype.endSide=0,n2.prototype.point=!1,n2.prototype.mapMode=uc.TrackDel;function fxe(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let pxe=class FZt{constructor(e,r,n){this.from=e,this.to=r,this.value=n}static create(e,r,n){return new FZt(e,r,n)}};function gxe(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}let Von=class zZt{constructor(e,r,n,i){this.from=e,this.to=r,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,r,n,i=0){let a=n?this.to:this.from;for(let s=i,o=a.length;;){if(s==o)return s;let l=s+o>>1,u=a[l]-e||(n?this.value[l].endSide:this.value[l].startSide)-r;if(l==s)return u>=0?s:o;u>=0?o=l:s=l+1}}between(e,r,n,i){for(let a=this.findIndex(r,-1e9,!0),s=this.findIndex(n,1e9,!1,a);ap||f==p&&u.startSide>0&&u.endSide<=0)continue;(p-f||u.endSide-u.startSide)<0||(s<0&&(s=f),u.point&&(o=Math.max(o,p-f)),n.push(u),i.push(f-s),a.push(p-s))}return{mapped:n.length?new zZt(i,a,n,o):null,pos:s}}};class Zn{constructor(e,r,n,i){this.chunkPos=e,this.chunk=r,this.nextLayer=n,this.maxPoint=i}static create(e,r,n,i){return new Zn(e,r,n,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let r of this.chunk)e+=r.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:r=[],sort:n=!1,filterFrom:i=0,filterTo:a=this.length}=e,s=e.filter;if(r.length==0&&!s)return this;if(n&&(r=r.slice().sort(gxe)),this.isEmpty)return r.length?Zn.of(r):this;let o=new zwt(this,null,-1).goto(0),l=0,u=[],h=new Lu;for(;o.value||l=0){let d=r[l++];h.addInner(d.from,d.to,d.value)||u.push(d)}else o.rangeIndex==1&&o.chunkIndexthis.chunkEnd(o.chunkIndex)||ao.to||a=a&&e<=a+s.length&&s.between(a,e-a,r-a,n)===!1)return}this.nextLayer.between(e,r,n)}}iter(e=0){return F7.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,r=0){return F7.from(e).goto(r)}static compare(e,r,n,i,a=-1){let s=e.filter(d=>d.maxPoint>0||!d.isEmpty&&d.maxPoint>=a),o=r.filter(d=>d.maxPoint>0||!d.isEmpty&&d.maxPoint>=a),l=Fwt(s,o,n),u=new z7(s,l,a),h=new z7(o,l,a);n.iterGaps((d,f,p)=>Uwt(u,d,h,f,p,i)),n.empty&&n.length==0&&Uwt(u,0,h,0,0,i)}static eq(e,r,n=0,i){i==null&&(i=999999999);let a=e.filter(h=>!h.isEmpty&&r.indexOf(h)<0),s=r.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(a.length!=s.length)return!1;if(!a.length)return!0;let o=Fwt(a,s),l=new z7(a,o,0).goto(n),u=new z7(s,o,0).goto(n);for(;;){if(l.to!=u.to||!vxe(l.active,u.active)||l.point&&(!u.point||!fxe(l.point,u.point)))return!1;if(l.to>i)return!0;l.next(),u.next()}}static spans(e,r,n,i,a=-1){let s=new z7(e,null,a).goto(r),o=r,l=s.openStart;for(;;){let u=Math.min(s.to,n);if(s.point){let h=s.activeForPoint(s.to),d=s.pointFromo&&(i.span(o,u,s.active,l),l=s.openEnd(u));if(s.to>n)return l+(s.point&&s.to>n?1:0);o=s.to,s.next()}}static of(e,r=!1){let n=new Lu;for(let i of e instanceof pxe?[e]:r?Qon(e):e)n.add(i.from,i.to,i.value);return n.finish()}static join(e){if(!e.length)return Zn.empty;let r=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let i=e[n];i!=Zn.empty;i=i.nextLayer)r=new Zn(i.chunkPos,i.chunk,r,Math.max(i.maxPoint,r.maxPoint));return r}}Zn.empty=new Zn([],[],null,-1);function Qon(t){if(t.length>1)for(let e=t[0],r=1;r0)return t.slice().sort(gxe);e=n}return t}Zn.empty.nextLayer=Zn.empty;class Lu{finishChunk(e){this.chunks.push(new Von(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,r,n){this.addInner(e,r,n)||(this.nextLayer||(this.nextLayer=new Lu)).add(e,r,n)}addInner(e,r,n){let i=e-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(r-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=r,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,r-e)),!0)}addChunk(e,r){if((e-this.lastTo||r.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,r.maxPoint),this.chunks.push(r),this.chunkPos.push(e);let n=r.value.length-1;return this.last=r.value[n],this.lastFrom=r.from[n]+e,this.lastTo=r.to[n]+e,!0}finish(){return this.finishInner(Zn.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let r=Zn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,r}}function Fwt(t,e,r){let n=new Map;for(let a of t)for(let s=0;s=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&i.push(new zwt(s,r,n,a));return i.length==1?i[0]:new F7(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,r=-1e9){for(let n of this.heap)n.goto(e,r);for(let n=this.heap.length>>1;n>=0;n--)mxe(this.heap,n);return this.next(),this}forward(e,r){for(let n of this.heap)n.forward(e,r);for(let n=this.heap.length>>1;n>=0;n--)mxe(this.heap,n);(this.to-e||this.value.endSide-r)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),mxe(this.heap,0)}}}function mxe(t,e){for(let r=t[e];;){let n=(e<<1)+1;if(n>=t.length)break;let i=t[n];if(n+1=0&&(i=t[n+1],n++),r.compare(i)<0)break;t[n]=r,t[e]=i,e=n}}class z7{constructor(e,r,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=F7.from(e,r,n)}goto(e,r=-1e9){return this.cursor.goto(e,r),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=r,this.openStart=-1,this.next(),this}forward(e,r){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-r)<0;)this.removeActive(this.minActive);this.cursor.forward(e,r)}removeActive(e){SX(this.active,e),SX(this.activeTo,e),SX(this.activeRank,e),this.minActive=Vwt(this.active,this.activeTo)}addActive(e){let r=0,{value:n,to:i,rank:a}=this.cursor;for(;r0;)r++;TX(this.active,r,n),TX(this.activeTo,r,i),TX(this.activeRank,r,a),e&&TX(e,r,this.cursor.from),this.minActive=Vwt(this.active,this.activeTo)}next(){let e=this.to,r=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&SX(n,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let a=this.cursor.value;if(!a.point)this.addActive(n),this.cursor.next();else if(r&&this.cursor.to==this.to&&this.cursor.from=0&&n[i]=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&r.push(this.active[n]);return r.reverse()}openEnd(e){let r=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)r++;return r}}function Uwt(t,e,r,n,i,a){t.goto(e),r.goto(n);let s=n+i,o=n,l=n-e,u=!!a.boundChange;for(let h=!1;;){let d=t.to+l-r.to,f=d||t.endSide-r.endSide,p=f<0?t.to+l:r.to,g=Math.min(p,s);if(t.point||r.point?(t.point&&r.point&&fxe(t.point,r.point)&&vxe(t.activeForPoint(t.to),r.activeForPoint(r.to))||a.comparePoint(o,g,t.point,r.point),h=!1):(h&&a.boundChange(o),g>o&&!vxe(t.active,r.active)&&a.compareRange(o,g,t.active,r.active),u&&gs)break;o=p,f<=0&&t.next(),f>=0&&r.next()}}function vxe(t,e){if(t.length!=e.length)return!1;for(let r=0;r=e;n--)t[n+1]=t[n];t[e]=r}function Vwt(t,e){let r=-1,n=1e9;for(let i=0;i=e)return i;if(i==t.length)break;a+=t.charCodeAt(i)==9?r-a%r:1,i=Dl(t,i)}return n===!0?-1:t.length}const bxe="ͼ",Qwt=typeof Symbol>"u"?"__"+bxe:Symbol.for(bxe),xxe=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Gwt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Gy{constructor(e,r){this.rules=[];let{finish:n}=r||{};function i(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function a(s,o,l,u){let h=[],d=/^@(\w+)\b/.exec(s[0]),f=d&&d[1]=="keyframes";if(d&&o==null)return l.push(s[0]+";");for(let p in o){let g=o[p];if(/&/.test(p))a(p.split(/,\s*/).map(m=>s.map(v=>m.replace(/&/,v))).reduce((m,v)=>m.concat(v)),g,l);else if(g&&typeof g=="object"){if(!d)throw new RangeError("The value of a property ("+p+") should be a primitive value.");a(i(p),g,h,f)}else g!=null&&h.push(p.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+g+";")}(h.length||f)&&l.push((n&&!d&&!u?s.map(n):s).join(", ")+" {"+h.join(" ")+"}")}for(let s in e)a(i(s),e[s],this.rules)}getRules(){return this.rules.join(` `)}static newName(){let e=Gwt[Qwt]||1;return Gwt[Qwt]=e+1,bxe+e.toString(36)}static mount(e,r,n){let i=e[xxe],a=n&&n.nonce;i?a&&i.setNonce(a):i=new Gon(e,a),i.mount(Array.isArray(r)?r:[r],e)}}let Hwt=new Map;class Gon{constructor(e,r){let n=e.ownerDocument||e,i=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let a=Hwt.get(n);if(a)return e[xxe]=a;this.sheet=new i.CSSStyleSheet,Hwt.set(n,this)}else this.styleTag=n.createElement("style"),r&&this.styleTag.setAttribute("nonce",r);this.modules=[],e[xxe]=this}mount(e,r){let n=this.sheet,i=0,a=0;for(let s=0;s-1&&(this.modules.splice(l,1),a--,l=-1),l==-1){if(this.modules.splice(a++,0,o),n)for(let u=0;u",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Hon=typeof navigator<"u"&&/Mac/.test(navigator.platform),Won=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),hc=0;hc<10;hc++)i2[48+hc]=i2[96+hc]=String(hc);for(var hc=1;hc<=24;hc++)i2[hc+111]="F"+hc;for(var hc=65;hc<=90;hc++)i2[hc]=String.fromCharCode(hc+32),U7[hc]=String.fromCharCode(hc);for(var wxe in i2)U7.hasOwnProperty(wxe)||(U7[wxe]=i2[wxe]);function Yon(t){var e=Hon&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Won&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",r=!e&&t.key||(t.shiftKey?U7:i2)[t.keyCode]||t.key||"Unidentified";return r=="Esc"&&(r="Escape"),r=="Del"&&(r="Delete"),r=="Left"&&(r="ArrowLeft"),r=="Up"&&(r="ArrowUp"),r=="Right"&&(r="ArrowRight"),r=="Down"&&(r="ArrowDown"),r}function fa(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,r=arguments[1];if(r&&typeof r=="object"&&r.nodeType==null&&!Array.isArray(r)){for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)){var i=r[n];typeof i=="string"?t.setAttribute(n,i):i!=null&&(t[n]=i)}e++}for(;e2);var br={mac:Xwt||/Mac/.test(Mu.platform),windows:/Win/.test(Mu.platform),linux:/Linux|X11/.test(Mu.platform),ie:CX,ie_version:Ywt?Axe.documentMode||6:Sxe?+Sxe[1]:Txe?+Txe[1]:0,gecko:qwt,gecko_version:qwt?+(/Firefox\/(\d+)/.exec(Mu.userAgent)||[0,0])[1]:0,chrome:!!Cxe,chrome_version:Cxe?+Cxe[1]:0,ios:Xwt,android:/Android\b/.test(Mu.userAgent),webkit:jwt,webkit_version:jwt?+(/\bAppleWebKit\/(\d+)/.exec(Mu.userAgent)||[0,0])[1]:0,safari:Oxe,safari_version:Oxe?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Mu.userAgent)||[0,0])[1]:0,tabSize:Axe.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function kxe(t,e){for(let r in t)r=="class"&&e.class?e.class+=" "+t.class:r=="style"&&e.style?e.style+=";"+t.style:e[r]=t[r];return e}const OX=Object.create(null);function Exe(t,e,r){if(t==e)return!0;t||(t=OX),e||(e=OX);let n=Object.keys(t),i=Object.keys(e);if(n.length-0!=i.length-0)return!1;for(let a of n)if(a!=r&&(i.indexOf(a)==-1||t[a]!==e[a]))return!1;return!0}function qon(t,e){for(let r=t.attributes.length-1;r>=0;r--){let n=t.attributes[r].name;e[n]==null&&t.removeAttribute(n)}for(let r in e){let n=e[r];r=="style"?t.style.cssText=n:t.getAttribute(r)!=n&&t.setAttribute(r,n)}}function Kwt(t,e,r){let n=!1;if(e)for(let i in e)r&&i in r||(n=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(r)for(let i in r)e&&e[i]==r[i]||(n=!0,i=="style"?t.style.cssText=r[i]:t.setAttribute(i,r[i]));return n}function jon(t){let e=Object.create(null);for(let r=0;r0?3e8:-4e8:r>0?1e8:-1e8,new BS(e,r,r,n,e.widget||null,!1)}static replace(e){let r=!!e.block,n,i;if(e.isBlockGap)n=-5e8,i=4e8;else{let{start:a,end:s}=Zwt(e,r);n=(a?r?-3e8:-1:5e8)-1,i=(s?r?2e8:1:-6e8)+1}return new BS(e,n,i,r,e.widget||null,!0)}static line(e){return new Q7(e)}static set(e,r=!1){return Zn.of(e,r)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Ar.none=Zn.empty;class V7 extends Ar{constructor(e){let{start:r,end:n}=Zwt(e);super(r?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?kxe(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||OX}eq(e){return this==e||e instanceof V7&&this.tagName==e.tagName&&Exe(this.attrs,e.attrs)}range(e,r=e){if(e>=r)throw new RangeError("Mark decorations may not be empty");return super.range(e,r)}}V7.prototype.point=!1;class Q7 extends Ar{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Q7&&this.spec.class==e.spec.class&&Exe(this.spec.attributes,e.spec.attributes)}range(e,r=e){if(r!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,r)}}Q7.prototype.mapMode=uc.TrackBefore,Q7.prototype.point=!0;class BS extends Ar{constructor(e,r,n,i,a,s){super(r,n,a,e),this.block=i,this.isReplace=s,this.mapMode=i?r<=0?uc.TrackBefore:uc.TrackAfter:uc.TrackDel}get type(){return this.startSide!=this.endSide?dc.WidgetRange:this.startSide<=0?dc.WidgetBefore:dc.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof BS&&Xon(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,r=e){if(this.isReplace&&(e>r||e==r&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&r!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,r)}}BS.prototype.point=!0;function Zwt(t,e=!1){let{inclusiveStart:r,inclusiveEnd:n}=t;return r==null&&(r=t.inclusive),n==null&&(n=t.inclusive),{start:r??e,end:n??e}}function Xon(t,e){return t==e||!!(t&&e&&t.compare(e))}function u4(t,e,r,n=0){let i=r.length-1;i>=0&&r[i]+n>=t?r[i]=Math.max(r[i],e):r.push(t,e)}class G7 extends n2{constructor(e,r,n){super(),this.tagName=e,this.attributes=r,this.rank=n}eq(e){return e==this||e instanceof G7&&this.tagName==e.tagName&&Exe(this.attributes,e.attributes)}static create(e){return new G7(e.tagName,e.attributes||OX,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,r=!1){return Zn.of(e,r)}}G7.prototype.startSide=G7.prototype.endSide=-1;function H7(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function _xe(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function W7(t,e){if(!e.anchorNode)return!1;try{return _xe(t,e.anchorNode)}catch{return!1}}function Y7(t){return t.nodeType==3?X7(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function q7(t,e,r,n){return r?Jwt(t,e,r,n,-1)||Jwt(t,e,r,n,1):!1}function a2(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function kX(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function Jwt(t,e,r,n,i){for(;;){if(t==r&&e==n)return!0;if(e==(i<0?0:Hy(t))){if(t.nodeName=="DIV")return!1;let a=t.parentNode;if(!a||a.nodeType!=1)return!1;e=a2(t)+(i<0?0:1),t=a}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?Hy(t):0}else return!1}}function Hy(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function j7(t,e){let{left:r,right:n}=t;if(r==n)return t;let i=e?r:n;return{left:i,right:i,top:t.top,bottom:t.bottom}}function Kon(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function eAt(t,e){let r=e.width/t.offsetWidth,n=e.height/t.offsetHeight;return(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.width-t.offsetWidth)<1)&&(r=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-t.offsetHeight)<1)&&(n=1),{scaleX:r,scaleY:n}}function Zon(t,e,r,n,i,a,s,o){let l=t.ownerDocument,u=l.defaultView||window;for(let h=t,d=!1;h&&!d;)if(h.nodeType==1){let f,p=h==l.body,g=1,m=1;if(p)f=Kon(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(d=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let b=h.getBoundingClientRect();({scaleX:g,scaleY:m}=eAt(h,b)),f={left:b.left,right:b.left+h.clientWidth*g,top:b.top,bottom:b.top+h.clientHeight*m}}let v=0,y=0;if(i=="nearest")e.top0&&e.bottom>f.bottom+y&&(y=e.bottom-f.bottom+s)):e.bottom>f.bottom-s&&(y=e.bottom-f.bottom+s,r<0&&e.top-y0&&e.right>f.right+v&&(v=e.right-f.right+a)):e.right>f.right-a&&(v=e.right-f.right+a,r<0&&e.leftf.bottom||e.leftf.right)&&(e={left:Math.max(e.left,f.left),right:Math.min(e.right,f.right),top:Math.max(e.top,f.top),bottom:Math.min(e.bottom,f.bottom)}),h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function tAt(t,e=!0){let r=t.ownerDocument,n=null,i=null;for(let a=t.parentNode;a&&!(a==r.body||(!e||n)&&i);)if(a.nodeType==1)!i&&a.scrollHeight>a.clientHeight&&(i=a),e&&!n&&a.scrollWidth>a.clientWidth&&(n=a),a=a.assignedSlot||a.parentNode;else if(a.nodeType==11)a=a.host;else break;return{x:n,y:i}}class Jon{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:r,focusNode:n}=e;this.set(r,Math.min(e.anchorOffset,r?Hy(r):0),n,Math.min(e.focusOffset,n?Hy(n):0))}set(e,r,n,i){this.anchorNode=e,this.anchorOffset=r,this.focusNode=n,this.focusOffset=i}}let $S=null;br.safari&&br.safari_version>=26&&($S=!1);function rAt(t){if(t.setActive)return t.setActive();if($S)return t.focus($S);let e=[];for(let r=t;r&&(e.push(r,r.scrollTop,r.scrollLeft),r!=r.ownerDocument);r=r.parentNode);if(t.focus($S==null?{get preventScroll(){return $S={preventScroll:!0},!0}}:void 0),!$S){$S=!1;for(let r=0;rMath.max(0,t.document.documentElement.scrollHeight-t.innerHeight-4):t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function aAt(t,e){for(let r=t,n=e;;){if(r.nodeType==3&&n>0)return{node:r,offset:n};if(r.nodeType==1&&n>0){if(r.contentEditable=="false")return null;r=r.childNodes[n-1],n=Hy(r)}else if(r.parentNode&&!kX(r))n=a2(r),r=r.parentNode;else return null}}function sAt(t,e){for(let r=t,n=e;;){if(r.nodeType==3&&n=r){if(o.level==n)return s;(a<0||(i!=0?i<0?o.fromr:e[a].level>o.level))&&(a=s)}}if(a<0)throw new RangeError("Index out of range");return a}}function cAt(t,e){if(t.length!=e.length)return!1;for(let r=0;r=0;m-=3)if(h0[m+1]==-p){let v=h0[m+2],y=v&2?i:v&4?v&1?a:i:0;y&&(Sa[d]=Sa[h0[m]]=y),o=m;break}}else{if(h0.length==189)break;h0[o++]=d,h0[o++]=f,h0[o++]=l}else if((g=Sa[d])==2||g==1){let m=g==i;l=m?0:1;for(let v=o-3;v>=0;v-=3){let y=h0[v+2];if(y&2)break;if(m)h0[v+2]|=2;else{if(y&4)break;h0[v+2]|=4}}}}}function oln(t,e,r,n){for(let i=0,a=n;i<=r.length;i++){let s=i?r[i-1].to:t,o=il;)g==v&&(g=r[--m].from,v=m?r[m-1].to:t),Sa[--g]=p;l=h}else a=u,l++}}}function Lxe(t,e,r,n,i,a,s){let o=n%2?2:1;if(n%2==i%2)for(let l=e,u=0;ll&&s.push(new d0(l,m.from,p));let v=m.direction==FS!=!(p%2);Mxe(t,v?n+1:n,i,m.inner,m.from,m.to,s),l=m.to}g=m.to}else{if(g==r||(h?Sa[g]!=o:Sa[g]==o))break;g++}f?Lxe(t,l,g,n+1,i,f,s):le;){let h=!0,d=!1;if(!u||l>a[u-1].to){let m=Sa[l-1];m!=o&&(h=!1,d=m==16)}let f=!h&&o==1?[]:null,p=h?n:n+1,g=l;e:for(;;)if(u&&g==a[u-1].to){if(d)break e;let m=a[--u];if(!h)for(let v=m.from,y=u;;){if(v==e)break e;if(y&&a[y-1].to==v)v=a[--y].from;else{if(Sa[v-1]==o)break e;break}}if(f)f.push(m);else{m.toSa.length;)Sa[Sa.length]=256;let n=[],i=e==FS?0:1;return Mxe(t,i,i,r,0,t.length,n),n}function uAt(t){return[new d0(0,t,0)]}let hAt="";function cln(t,e,r,n,i){var a;let s=n.head-t.from,o=d0.find(e,s,(a=n.bidiLevel)!==null&&a!==void 0?a:-1,n.assoc),l=e[o],u=l.side(i,r);if(s==u){let f=o+=i?1:-1;if(f<0||f>=e.length)return null;l=e[o=f],s=l.side(!i,r),u=l.side(i,r)}let h=Dl(t.text,s,l.forward(i,r));(hl.to)&&(h=u),hAt=t.text.slice(Math.min(s,h),Math.max(s,h));let d=o==(i?e.length-1:0)?null:e[o+(i?1:-1)];return d&&h==u&&d.level+(i?0:1)t.some(e=>e)}),bAt=vr.define({combine:t=>t.some(e=>e)}),xAt=vr.define();class d4{constructor(e,r,n,i,a,s=!1){this.range=e,this.y=r,this.x=n,this.yMargin=i,this.xMargin=a,this.isSnapshot=s}map(e){return e.empty?this:new d4(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new d4(bt.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const EX=nn.define({map:(t,e)=>t.map(e)}),wAt=nn.define();function Nh(t,e,r){let n=t.facet(gAt);n.length?n[0](e):window.onerror&&window.onerror(String(e),r,void 0,void 0,e)||(r?console.error(r+":",e):console.error(e))}const Wy=vr.define({combine:t=>t.length?t[0]:!0});let hln=0;const f4=vr.define({combine(t){return t.filter((e,r)=>{for(let n=0;n{let l=[];return s&&l.push(_X.of(u=>{let h=u.plugin(o);return h?s(h):Ar.none})),a&&l.push(a(o)),l})}static fromClass(e,r){return ws.define((n,i)=>new e(n,i),r)}}class Bxe{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let r=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(r)}catch(n){if(Nh(r.state,n,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(r){Nh(e.state,r,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var r;if(!((r=this.value)===null||r===void 0)&&r.destroy)try{this.value.destroy()}catch(n){Nh(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const AAt=vr.define(),$xe=vr.define(),_X=vr.define(),TAt=vr.define(),Fxe=vr.define(),K7=vr.define(),SAt=vr.define();function CAt(t,e){let r=t.state.facet(SAt);if(!r.length)return r;let n=r.map(a=>a instanceof Function?a(t):a),i=[];return Zn.spans(n,e.from,e.to,{point(){},span(a,s,o,l){let u=a-e.from,h=s-e.from,d=i;for(let f=o.length-1;f>=0;f--,l--){let p=o[f].spec.bidiIsolate,g;if(p==null&&(p=uln(e.text,u,h)),l>0&&d.length&&(g=d[d.length-1]).to==u&&g.direction==p)g.to=h,d=g.inner;else{let m={from:u,to:h,direction:p,inner:[]};d.push(m),d=m.inner}}}}),i}const OAt=vr.define();function zxe(t){let e=0,r=0,n=0,i=0;for(let a of t.state.facet(OAt)){let s=a(t);s&&(s.left!=null&&(e=Math.max(e,s.left)),s.right!=null&&(r=Math.max(r,s.right)),s.top!=null&&(n=Math.max(n,s.top)),s.bottom!=null&&(i=Math.max(i,s.bottom)))}return{left:e,right:r,top:n,bottom:i}}const Z7=vr.define();class np{constructor(e,r,n,i){this.fromA=e,this.toA=r,this.fromB=n,this.toB=i}join(e){return new np(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let r=e.length,n=this;for(;r>0;r--){let i=e[r-1];if(!(i.fromA>n.toA)){if(i.toAi.push(new np(a,s,o,l))),this.changedRanges=i}static create(e,r,n){return new RX(e,r,n)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const dln=[];class Qs{constructor(e,r,n=0){this.dom=e,this.length=r,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return dln}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let r=this.domAttrs;r&&qon(this.dom,r)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,r=this.posAtStart){let n=r;for(let i of this.children){if(i==e)return n;n+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,r,n){return null}domPosFor(e,r){let n=a2(this.dom),i=this.length?e>0:r>0;return new dg(this.parent.dom,n+(i?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof LX)return e;return null}static get(e){return e.cmTile}}class DX extends Qs{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let r=this.dom,n=null,i,a=(e==null?void 0:e.node)==r?e:null,s=0;for(let o of this.children){if(o.sync(e),s+=o.length+o.breakAfter,i=n?n.nextSibling:r.firstChild,a&&i!=o.dom&&(a.written=!0),o.dom.parentNode==r)for(;i&&i!=o.dom;)i=kAt(i);else r.insertBefore(o.dom,i);n=o.dom}for(i=n?n.nextSibling:r.firstChild,a&&i&&(a.written=!0);i;)i=kAt(i);this.length=s}}function kAt(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class LX extends DX{constructor(e,r){super(r),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let r=Qs.get(e);if(r&&this.owns(r))return r;e=e.parentNode}}blockTiles(e){for(let r=[],n=this,i=0,a=0;;)if(i==n.children.length){if(!r.length)return;n=n.parent,n.breakAfter&&a++,i=r.pop()}else{let s=n.children[i++];if(s instanceof Yy)r.push(i),n=s,i=0;else{let o=a+s.length,l=e(s,a);if(l!==void 0)return l;a=o+s.breakAfter}}}resolveBlock(e,r){let n,i=-1,a,s=-1;if(this.blockTiles((o,l)=>{let u=l+o.length;if(e>=l&&e<=u){if(o.isWidget()&&r>=-1&&r<=1){if(o.flags&32)return!0;o.flags&16&&(n=void 0)}(le||e==l&&(r>1?o.length:o.covers(-1)))&&(!a||!o.isWidget()&&a.isWidget())&&(a=o,s=e-l)}}),!n&&!a)throw new Error("No tile at position "+e);return n&&r<0||!a?{tile:n,offset:i}:{tile:a,offset:s}}}class Yy extends DX{constructor(e,r){super(e),this.wrapper=r}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,r){let n=new Yy(r||document.createElement(e.tagName),e);return r||(n.flags|=4),n}}class p4 extends DX{constructor(e,r){super(e),this.attrs=r}isLine(){return!0}static start(e,r,n){let i=new p4(r||document.createElement("div"),e);return(!r||!n)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,r,n){let i=null,a=-1,s=null,o=-1;function l(h,d){for(let f=0,p=0;f=d&&(g.isComposite()?l(g,d-p):(!s||s.isHidden&&(r>0&&!(s.flags&32)||n&&pln(s,g)))&&(m>d||g.flags&32)?(s=g,o=d-p):(pi&&(e=i);let a=e,s=e,o=0;e==0&&r<0||e==i&&r>=0?br.chrome||br.gecko||(e?(a--,o=1):s=0)?0:l.length-1];return br.safari&&!o&&u.width==0&&(u=Array.prototype.find.call(l,h=>h.width)||u),n==null?u:j7(u,(o?o>0:r<0)==n)}static of(e,r){let n=new zS(r||document.createTextNode(e),e);return r||(n.flags|=2),n}}class US extends Qs{constructor(e,r,n,i){super(e,r,i),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,r){return this.coordsInWidget(e,r,!1)}coordsInWidget(e,r,n){let i=this.widget.coordsAt(this.dom,e,r);if(i)return i;if(n)return j7(this.dom.getBoundingClientRect(),this.length?e==0:r<=0);{let a=this.dom.getClientRects(),s=null;if(!a.length)return null;let o=this.flags&16?!0:this.flags&32?!1:e>0;for(let l=o?a.length-1:0;s=a[l],!(e>0?l==0:l==a.length-1||s.top0==n)}}class gln{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,r,n){let{tile:i,index:a,beforeBreak:s,parents:o}=this;for(;e||r>0;)if(i.isComposite())if(s){if(!e)break;n&&n.break(),e--,s=!1}else if(a==i.children.length){if(!e&&!o.length)break;n&&n.leave(i),s=!!i.breakAfter,{tile:i,index:a}=o.pop(),a++}else{let l=i.children[a],u=l.breakAfter;(r>0?l.length<=e:l.length=0;o--){let l=r.marks[o],u=i.lastChild;if(u instanceof Bh&&u.mark.eq(l.mark))u.dom!=l.dom&&u.setDOM(Uxe(l.dom)),i=u;else{if(this.cache.reused.get(l)){let d=Qs.get(l.dom);d&&d.setDOM(Uxe(l.dom))}let h=Bh.of(l.mark,l.dom);i.append(h),i=h}this.cache.reused.set(l,2)}let a=Qs.get(e.text);a&&this.cache.reused.set(a,2);let s=new zS(e.text,e.text.nodeValue);s.flags|=8,this.pos=e.range.toB,i.append(s)}addInlineWidget(e,r,n){let i=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);i||this.flushBuffer();let a=this.ensureMarks(r,n);!i&&!(e.flags&16)&&a.append(this.getBuffer(1)),a.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,r,n){this.flushBuffer(),this.ensureMarks(r,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let r=this.afterWidget||this.lastBlock;r.length+=e,this.pos+=e}addLineStart(e,r){var n;e||(e=_At);let i=p4.start(e,r||((n=this.cache.find(p4))===null||n===void 0?void 0:n.dom),!!r);this.getBlockPos().append(this.lastBlock=this.curLine=i)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,r){var n;let i=this.curLine;for(let a=e.length-1;a>=0;a--){let s=e[a],o;if(r>0&&(o=i.lastChild)&&o instanceof Bh&&o.mark.eq(s))i=o,r--;else{let l=Bh.of(s,(n=this.cache.find(Bh,u=>u.mark.eq(s)))===null||n===void 0?void 0:n.dom);i.append(l),i=l,r=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!EAt(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(br.ios&&EAt(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Vxe,0,32)||new US(Vxe.toDOM(),0,Vxe,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to=this.pos){let r=e.rank*102+e.value.rank,n=new mln(e.from,e.to,e.value,r),i=this.wrappers.length;for(;i>0&&(this.wrappers[i-1].rank-n.rank||this.wrappers[i-1].to-n.to)<0;)i--;this.wrappers.splice(i,0,n)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let r=this.root;for(let n of this.wrappers){let i=r.lastChild;if(n.froms.wrapper.eq(n.wrapper)))===null||e===void 0?void 0:e.dom);r.append(a),r=a}}return r}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let r=2|(e<0?16:32),n=this.cache.find(MX,void 0,1);return n&&(n.flags=r),n||new MX(r)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class yln{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:i,lineBreak:a,done:s}=this.cursor.next(this.skipCount);if(this.skipCount=0,s)throw new Error("Ran out of text content when drawing inline views");this.text=i;let o=this.textOff=Math.min(e,i.length);return a?null:i.slice(0,o)}let r=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,r);return this.textOff=r,n}}const IX=[US,p4,zS,Bh,MX,Yy,LX];for(let t=0;t[]),this.index=IX.map(()=>0),this.reused=new Map}add(e){let r=e.constructor.bucket,n=this.buckets[r];n.length<6?n.push(e):n[this.index[r]=(this.index[r]+1)%6]=e}find(e,r,n=2){let i=e.bucket,a=this.buckets[i],s=this.index[i];for(let o=0;o{if(this.cache.add(s),s.isComposite())return!1},enter:s=>this.cache.add(s),leave:()=>{},break:()=>{}}}run(e,r){let n=r&&this.getCompositionContext(r.text);for(let i=0,a=0,s=0;;){let o=si){let u=l-i;this.preserve(u,!s,!o),i=l,a+=u}if(!o)break;r&&o.fromA<=r.range.fromA&&o.toA>=r.range.toA?(this.forward(o.fromA,r.range.fromA,r.range.fromA{if(s.isWidget())if(this.openWidget)this.builder.continueWidget(l-o);else{let u=l>0||o{s.isLine()?this.builder.addLineStart(s.attrs,this.cache.maybeReuse(s)):(this.cache.add(s),s instanceof Bh&&i.unshift(s.mark)),this.openWidget=!1},leave:s=>{s.isLine()?i.length&&(i.length=a=0):s instanceof Bh&&(i.shift(),a=Math.min(a,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,r){let n=null,i=this.builder,a=-1,s=Zn.spans(this.decorations,e,r,{point:(o,l,u,h,d,f)=>{if(u instanceof BS){if(this.disallowBlockEffectsFor[f]){if(u.block)throw new RangeError("Block decorations may not be specified via plugins");if(l>this.view.state.doc.lineAt(o).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(a=h.length,d>h.length)i.continueWidget(l-o);else{let p=u.widget||(u.block?g4.block:g4.inline),g=wln(u),m=this.cache.findWidget(p,l-o,g)||US.of(p,this.view,l-o,g);u.block?(u.startSide>0&&i.addLineStartIfNotCovered(n),i.addBlockWidget(m)):(i.ensureLine(n),i.addInlineWidget(m,h,d))}n=null}else n=Aln(n,u);l>o&&this.text.skip(l-o)},span:(o,l,u,h)=>{for(let d=o;d-1&&(this.openWidget=s>a),this.openWidget||i.addLineStartIfNotCovered(n),this.openMarks=s}forward(e,r,n=1){r-e<=10?this.old.advance(r-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(r-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let r=[],n=null;for(let i=e.parentNode;;i=i.parentNode){let a=Qs.get(i);if(i==this.view.contentDOM)break;a instanceof Bh?r.push(a):a!=null&&a.isLine()?n=a:a instanceof Yy||(i.nodeName=="DIV"&&!n&&i!=this.view.contentDOM?n=new p4(i,_At):n||r.push(Bh.of(new V7({tagName:i.nodeName.toLowerCase(),attributes:jon(i)}),i)))}return{line:n,marks:r}}}function EAt(t,e){let r=n=>{for(let i of n.children)if((e?i.isText():i.length)||r(i))return!0;return!1};return r(t)}function wln(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}const _At={class:"cm-line"};function Aln(t,e){let r=e.spec.attributes,n=e.spec.class;return!r&&!n||(t||(t={class:"cm-line"}),r&&kxe(r,t),n&&(t.class+=" "+n)),t}function Tln(t){let e=[];for(let r=t.parents.length;r>1;r--){let n=r==t.parents.length?t.tile:t.parents[r].tile;n instanceof Bh&&e.push(n.mark)}return e}function Uxe(t){let e=Qs.get(t);return e&&e.setDOM(t.cloneNode()),t}class g4 extends Iu{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}g4.inline=new g4("span"),g4.block=new g4("div");const Vxe=new class extends Iu{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class RAt{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Ar.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new LX(e,e.contentDOM),this.updateInner([new np(0,0,0,e.state.doc.length)],null)}update(e){var r;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:h,toA:d})=>dthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((r=this.domChanged)===null||r===void 0)&&r.newSel?i=this.domChanged.newSel.head:!Lln(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let a=i>-1?Cln(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:h,to:d}=this.hasComposition;n=new np(h,d,e.changes.mapPos(h,-1),e.changes.mapPos(d,1)).addToSet(n.slice())}this.hasComposition=a?{from:a.range.fromB,to:a.range.toB}:null,(br.ie||br.chrome)&&!a&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,o=this.blockWrappers;this.updateDeco();let l=Eln(s,this.decorations,e.changes);l.length&&(n=np.extendWithRanges(n,l));let u=Rln(o,this.blockWrappers,e.changes);return u.length&&(n=np.extendWithRanges(n,u)),a&&!n.some(h=>h.fromA<=a.range.fromA&&h.toA>=a.range.toA)&&(n=a.range.addToSet(n.slice())),this.tile.flags&2&&n.length==0?!1:(this.updateInner(n,a),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,r){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(r||e.length){let s=this.tile,o=new xln(this.view,s,this.blockWrappers,this.decorations,this.dynamicDecorationMap);r&&Qs.get(r.text)&&o.cache.reused.set(Qs.get(r.text),2),this.tile=o.run(e,r),Qxe(s,o.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let a=br.chrome||br.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(a),a&&(a.written||n.selectionRange.focusNode!=a.node||!this.tile.dom.contains(a.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];if(this.view.viewport.from||this.view.viewport.to-1)&&W7(n,this.view.observer.selectionRange)&&!(i&&n.contains(i));if(!(a||r||s))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,u,h;if(l.empty?h=u=this.inlineDOMNearPos(l.anchor,l.assoc||1):(h=this.inlineDOMNearPos(l.head,l.head==l.from?1:-1),u=this.inlineDOMNearPos(l.anchor,l.anchor==l.from?1:-1)),br.gecko&&l.empty&&!this.hasComposition&&Sln(u)){let f=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(f,u.node.childNodes[u.offset]||null)),u=h=new dg(f,0),o=!0}let d=this.view.observer.selectionRange;(o||!d.focusNode||(!q7(u.node,u.offset,d.anchorNode,d.anchorOffset)||!q7(h.node,h.offset,d.focusNode,d.focusOffset))&&!this.suppressWidgetCursorChange(d,l))&&(this.view.observer.ignore(()=>{br.android&&br.chrome&&n.contains(d.focusNode)&&Dln(d.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let f=H7(this.view.root);if(f)if(l.empty){if(br.gecko){let p=Oln(u.node,u.offset);if(p&&p!=3){let g=(p==1?aAt:sAt)(u.node,u.offset);g&&(u=new dg(g.node,g.offset))}}f.collapse(u.node,u.offset),l.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=l.bidiLevel)}else if(f.extend){f.collapse(u.node,u.offset);try{f.extend(h.node,h.offset)}catch{}}else{let p=document.createRange();l.anchor>l.head&&([u,h]=[h,u]),p.setEnd(h.node,h.offset),p.setStart(u.node,u.offset),f.removeAllRanges(),f.addRange(p)}s&&this.view.root.activeElement==n&&(n.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(u,h)),this.impreciseAnchor=u.precise?null:new dg(d.anchorNode,d.anchorOffset),this.impreciseHead=h.precise?null:new dg(d.focusNode,d.focusOffset)}suppressWidgetCursorChange(e,r){return this.hasComposition&&r.empty&&q7(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==r.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,r=e.state.selection.main,n=H7(e.root),{anchorNode:i,anchorOffset:a}=e.observer.selectionRange;if(!n||!r.empty||!r.assoc||!n.modify)return;let s=this.lineAt(r.head,r.assoc);if(!s)return;let o=s.posAtStart;if(r.head==o||r.head==o+s.length)return;let l=this.coordsAt(r.head,-1),u=this.coordsAt(r.head,1);if(!l||!u||l.bottom>u.top)return;let h=this.domAtPos(r.head+r.assoc,r.assoc);n.collapse(h.node,h.offset),n.modify("move",r.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let d=e.observer.selectionRange;e.docView.posFromDOM(d.anchorNode,d.anchorOffset)!=r.from&&n.collapse(i,a)}posFromDOM(e,r){let n=this.tile.nearest(e);if(!n)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let i=n.posAtStart;if(n.isComposite()){let a;if(e==n.dom)a=n.dom.childNodes[r];else{let s=Hy(e)==0?0:r==0?-1:1;for(;;){let o=e.parentNode;if(o==n.dom)break;s==0&&o.firstChild!=o.lastChild&&(e==o.firstChild?s=-1:s=1),e=o}s<0?a=e:a=e.nextSibling}if(a==n.dom.firstChild)return i;for(;a&&!Qs.get(a);)a=a.nextSibling;if(!a)return i+n.length;for(let s=0,o=i;;s++){let l=n.children[s];if(l.dom==a)return o;o+=l.length+l.breakAfter}}else return n.isText()?e==n.dom?i+r:i+(r?n.length:0):i}domAtPos(e,r){let{tile:n,offset:i}=this.tile.resolveBlock(e,r);return n.isWidget()?n.domPosFor(i,r):n.domIn(i,r)}inlineDOMNearPos(e,r){let n,i=-1,a=!1,s,o=-1,l=!1;return this.tile.blockTiles((u,h)=>{if(u.isWidget()){if(u.flags&32&&h>=e)return!0;u.flags&16&&(a=!0)}else{let d=h+u.length;if(h<=e&&(n=u,i=e-h,a=d=e&&!s&&(s=u,o=e-h,l=h>e),h>e&&s)return!0}}),!n&&!s?this.domAtPos(e,r):(a&&s?n=null:l&&n&&(s=null),n&&r<0||!s?n.domIn(i,r):s.domIn(o,r))}coordsAt(e,r,n){let{tile:i,offset:a}=this.tile.resolveBlock(e,r);return i.isWidget()?i.widget instanceof Gxe?null:i.coordsInWidget(a,r,!0):i.coordsIn(a,r,n)}lineAt(e,r){let{tile:n}=this.tile.resolveBlock(e,r);return n.isLine()?n:null}coordsForChar(e){let{tile:r,offset:n}=this.tile.resolveBlock(e,1);if(!r.isLine())return null;function i(a,s){if(a.isComposite())for(let o of a.children){if(o.length>=s){let l=i(o,s);if(l)return l}if(s-=o.length,s<0)break}else if(a.isText()&&sMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,l=this.view.textDirection==Ta.LTR,u=0,h=(d,f,p)=>{for(let g=0;gi);g++){let m=d.children[g],v=f+m.length,y=m.dom.getBoundingClientRect(),{height:b}=y;if(p&&!g&&(u+=y.top-p.top),m instanceof Yy)v>n&&h(m,f,y);else if(f>=n&&(u>0&&r.push(-u),r.push(b+u),u=0,s)){let x=m.dom.lastChild,w=x?Y7(x):[];if(w.length){let A=w[w.length-1],T=l?A.right-y.left:y.right-A.left;T>o&&(o=T,this.minWidth=a,this.minWidthFrom=f,this.minWidthTo=v)}}p&&g==d.children.length-1&&(u+=p.bottom-y.bottom),f=v+m.breakAfter}};return h(this.tile,0,null),r}textDirectionAt(e){let{tile:r}=this.tile.resolveBlock(e,1);return getComputedStyle(r.dom).direction=="rtl"?Ta.RTL:Ta.LTR}measureTextSize(){let e=this.tile.blockTiles(s=>{if(s.isLine()&&s.children.length&&s.length<=20){let o=0,l;for(let u of s.children){if(!u.isText()||/[^ -~]/.test(u.text))return;let h=Y7(u.dom);if(h.length!=1)return;o+=h[0].width,l=h[0].height}if(o)return{lineHeight:s.dom.getBoundingClientRect().height,charWidth:o/s.length,textHeight:l}}});if(e)return e;let r=document.createElement("div"),n,i,a;return r.className="cm-line",r.style.width="99999px",r.style.position="absolute",r.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(r);let s=Y7(r.firstChild)[0];n=r.getBoundingClientRect().height,i=s&&s.width?s.width/27:7,a=s&&s.height?s.height:n,r.remove()}),{lineHeight:n,charWidth:i,textHeight:a}}computeBlockGapDeco(){let e=[],r=this.view.viewState;for(let n=0,i=0;;i++){let a=i==r.viewports.length?null:r.viewports[i],s=a?a.from-1:this.view.state.doc.length;if(s>n){let o=(r.lineBlockAt(s).bottom-r.lineBlockAt(n).top)/this.view.scaleY;e.push(Ar.replace({widget:new Gxe(o),block:!0,inclusive:!0,isBlockGap:!0}).range(n,s))}if(!a)break;n=a.to+1}return Ar.set(e)}updateDeco(){let e=1,r=this.view.state.facet(_X).map(a=>(this.dynamicDecorationMap[e++]=typeof a=="function")?a(this.view):a),n=!1,i=this.view.state.facet(Fxe).map((a,s)=>{let o=typeof a=="function";return o&&(n=!0),o?a(this.view):a});for(i.length&&(this.dynamicDecorationMap[e++]=n,r.push(Zn.join(i))),this.decorations=[this.editContextFormatting,...r,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];etypeof a=="function"?a(this.view):a)}scrollIntoView(e){if(e.isSnapshot){let u=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=u.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let u of this.view.state.facet(xAt))try{if(u(this.view,e.range,e))return!0}catch(h){Nh(this.view.state,h,"scroll handler")}let{range:r}=e,n=this.coordsAt(r.head,r.assoc||(r.head>r.anchor?-1:1)),i;if(!n)return;!r.empty&&(i=this.coordsAt(r.anchor,r.anchor>r.head?-1:1))&&(n={left:Math.min(n.left,i.left),top:Math.min(n.top,i.top),right:Math.max(n.right,i.right),bottom:Math.max(n.bottom,i.bottom)});let a=zxe(this.view),s={left:n.left-a.left,top:n.top-a.top,right:n.right+a.right,bottom:n.bottom+a.bottom},{offsetWidth:o,offsetHeight:l}=this.view.scrollDOM;if(Zon(this.view.scrollDOM,s,r.head1&&(n.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||n.bottomn.isWidget()||n.children.some(r);return r(this.tile.resolveBlock(e,1).tile)}destroy(){Qxe(this.tile)}}function Qxe(t,e){let r=e==null?void 0:e.get(t);if(r!=1){r==null&&t.destroy();for(let n of t.children)Qxe(n,e)}}function Sln(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function DAt(t,e){let r=t.observer.selectionRange;if(!r.focusNode)return null;let n=aAt(r.focusNode,r.focusOffset),i=sAt(r.focusNode,r.focusOffset),a=n||i;if(i&&n&&i.node!=n.node){let o=Qs.get(i.node);if(!o||o.isText()&&o.text!=i.node.nodeValue)a=i;else if(t.docView.lastCompositionAfterCursor){let l=Qs.get(n.node);!l||l.isText()&&l.text!=n.node.nodeValue||(a=i)}}if(t.docView.lastCompositionAfterCursor=a!=n,!a)return null;let s=e-a.offset;return{from:s,to:s+a.node.nodeValue.length,node:a.node}}function Cln(t,e,r){let n=DAt(t,r);if(!n)return null;let{node:i,from:a,to:s}=n,o=i.nodeValue;if(/[\n\r]/.test(o)||t.state.doc.sliceString(n.from,n.to)!=o)return null;let l=e.invertedDesc;return{range:new np(l.mapPos(a),l.mapPos(s),a,s),text:i}}function Oln(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e{ne.from&&(r=!0)}),r}class Gxe extends Iu{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function Mln(t,e,r=1){let n=t.charCategorizer(e),i=t.doc.lineAt(e),a=e-i.from;if(i.length==0)return bt.cursor(e);a==0?r=1:a==i.length&&(r=-1);let s=a,o=a;r<0?s=Dl(i.text,a,!1):o=Dl(i.text,a);let l=n(i.text.slice(s,o));for(;s>0;){let u=Dl(i.text,s,!1);if(n(i.text.slice(u,s))!=l)break;s=u}for(;ot.defaultLineHeight*1.5){let o=t.viewState.heightOracle.textHeight,l=Math.floor((i-r.top-(t.defaultLineHeight-o)*.5)/o);a+=l*t.viewState.heightOracle.lineLength}let s=t.state.sliceDoc(r.from,r.to);return r.from+yxe(s,a,t.state.tabSize)}function Hxe(t,e,r){let n=t.lineBlockAt(e);if(Array.isArray(n.type)){let i;for(let a of n.type){if(a.from>e)break;if(!(a.toe)return a;(!i||a.type==dc.Text&&(i.type!=a.type||(r<0?a.frome)))&&(i=a)}}return i||n}return n}function Pln(t,e,r,n){let i=Hxe(t,e.head,e.assoc||-1),a=!n||i.type!=dc.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(a){let s=t.dom.getBoundingClientRect(),o=t.textDirectionAt(i.from),l=t.posAtCoords({x:r==(o==Ta.LTR)?s.right-1:s.left+1,y:(a.top+a.bottom)/2});if(l!=null)return bt.cursor(l,r?-1:1)}return bt.cursor(r?i.to:i.from,r?-1:1)}function LAt(t,e,r,n){let i=t.state.doc.lineAt(e.head),a=t.bidiSpans(i),s=t.textDirectionAt(i.from);for(let o=e,l=null;;){let u=cln(i,a,s,o,r),h=hAt;if(!u){if(i.number==(r?t.state.doc.lines:1))return o;h=` -`,i=t.state.doc.line(i.number+(r?1:-1)),a=t.bidiSpans(i),u=t.visualLineSide(i,!r)}if(l){if(!l(h))return o}else{if(!n)return u;l=n(h)}o=u}}function Nln(t,e,r){let n=t.state.charCategorizer(e),i=n(r);return a=>{let s=n(a);return i==ps.Space&&(i=s),i==s}}function Bln(t,e,r,n){let i=e.head,a=r?1:-1;if(i==(r?t.state.doc.length:0))return bt.cursor(i,e.assoc);let s=e.goalColumn,o,l=t.contentDOM.getBoundingClientRect(),u=t.coordsAtPos(i,e.assoc||((e.empty?r:e.head==e.from)?1:-1)),h=t.documentTop;if(u)s==null&&(s=u.left-l.left),o=a<0?u.top:u.bottom;else{let g=t.viewState.lineBlockAt(i);s==null&&(s=Math.min(l.right-l.left,t.defaultCharacterWidth*(i-g.from))),o=(a<0?g.top:g.bottom)+h}let d=l.left+s,f=t.viewState.heightOracle.textHeight>>1,p=n??f;for(let g=0;;g+=f){let m=o+(p+g)*a,v=Yxe(t,{x:d,y:m},!1,a);if(r?m>l.bottom:mo:b{if(e>a&&ei(t)),r.from,e.head>r.from?-1:1);return n==r.from?r:bt.cursor(n,nt.viewState.docHeight)return new f0(t.state.doc.length,-1);if(u=t.elementAtHeight(l),n==null)break;if(u.type==dc.Text){if(n<0?u.tot.viewport.to)break;let f=t.docView.coordsAt(n<0?u.from:u.to,n>0?-1:1);if(f&&(n<0?f.top<=l+a:f.bottom>=l+a))break}let d=t.viewState.heightOracle.textHeight/2;l=n>0?u.bottom+d:u.top-d}if(t.viewport.from>=u.to||t.viewport.to<=u.from){if(r)return null;if(u.type==dc.Text){let d=Iln(t,i,u,s,o);return new f0(d,d==u.from?1:-1)}}if(u.type!=dc.Text)return l<(u.top+u.bottom)/2?new f0(u.from,1):new f0(u.to,-1);let h=t.docView.lineAt(u.from,2);return(!h||h.length!=u.length)&&(h=t.docView.lineAt(u.from,-2)),new $ln(t,s,o,t.textDirectionAt(u.from)).scanTile(h,u.from)}class $ln{constructor(e,r,n,i){this.view=e,this.x=r,this.y=n,this.baseDir=i,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to1||n.length&&(n[0].level!=this.baseDir||n[0].to+i.from>1;t:if(s.has(m)){let y=i+Math.floor(Math.random()*g);for(let b=0;b1)){if(b.bottomthis.y)(!u||u.top>b.top)&&(u=b),x=-1;else{let w=b.left>this.x?this.x-b.left:b.right(g+g+m)/3)return this.y=l.bottom-1,this.scan(e,r,!0);if(u&&u.top<(g+m+m)/3)return this.y=u.top+1,this.scan(e,r,!0)}let p=(o?this.dirAt(e[h],1):this.baseDir)==Ta.LTR;return{i:h,after:this.x>(f.left+f.right)/2==p}}scanText(e,r){let n=[];for(let a=0;a{let s=n[a]-r,o=n[a+1]-r;return X7(e.dom,s,o).getClientRects()});return i.after?new f0(n[i.i+1],-1):new f0(n[i.i],1)}scanTile(e,r){if(!e.length)return new f0(r,1);if(e.children.length==1){let o=e.children[0];if(o.isText())return this.scanText(o,r);if(o.isComposite())return this.scanTile(o,r)}let n=[r];for(let o=0,l=r;o{let l=e.children[o];return l.flags&48?null:(l.dom.nodeType==1?l.dom:X7(l.dom,0,l.length)).getClientRects()}),a=e.children[i.i],s=n[i.i];return a.isText()?this.scanText(a,s):a.isComposite()?this.scanTile(a,s):i.after?new f0(n[i.i+1],-1):new f0(s,1)}}const m4="￿";class Fln{constructor(e,r){this.points=e,this.view=r,this.text="",this.lineSeparator=r.state.facet(Kn.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=m4}readRange(e,r){if(!e)return this;let n=e.parentNode;for(let i=e;;){this.findPointBefore(n,i);let a=this.text.length;this.readNode(i);let s=Qs.get(i),o=i.nextSibling;if(o==r){s!=null&&s.breakAfter&&!o&&n!=this.view.contentDOM&&this.lineBreak();break}let l=Qs.get(o);(s&&l?s.breakAfter:(s?s.breakAfter:kX(i))||kX(o)&&(i.nodeName!="BR"||s!=null&&s.isWidget())&&this.text.length>a)&&!Uln(o,r)&&this.lineBreak(),i=o}return this.findPointBefore(n,r),this}readTextNode(e){let r=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,r.length));for(let n=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let a=-1,s=1,o;if(this.lineSeparator?(a=r.indexOf(this.lineSeparator,n),s=this.lineSeparator.length):(o=i.exec(r))&&(a=o.index,s=o[0].length),this.append(r.slice(n,a<0?r.length:a)),a<0)break;if(this.lineBreak(),s>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=s-1);n=a+s}}readNode(e){let r=Qs.get(e),n=r&&r.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let i=n.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,r){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==r&&(n.pos=this.text.length)}findPointInside(e,r){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(zln(e,n.node,n.offset)?r:0))}}function zln(t,e,r){for(;;){if(!e||r-1;let{impreciseHead:a,impreciseAnchor:s}=e.docView,o=e.state.selection;if(e.state.readOnly&&r>-1)this.newSel=null;else if(r>-1&&(this.bounds=PAt(e.docView.tile,r,n,0))){let l=a||s?[]:Gln(e),u=new Fln(l,e);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=Hln(l,this.bounds.from)}else{let l=e.observer.selectionRange,u=a&&a.node==l.focusNode&&a.offset==l.focusOffset||!_xe(e.contentDOM,l.focusNode)?o.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),h=s&&s.node==l.anchorNode&&s.offset==l.anchorOffset||!_xe(e.contentDOM,l.anchorNode)?o.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),d=e.viewport;if((br.ios||br.chrome)&&u!=h&&Math.min(u,h)<=o.main.from&&Math.max(u,h)>=o.main.to&&(d.from>0||d.to-1&&o.ranges.length>1)this.newSel=o.replaceRange(bt.range(h,u));else if(e.lineWrapping&&h==u&&!(o.main.empty&&o.main.head==u)&&e.inputState.lastTouchTime>Date.now()-100){let f=e.coordsAtPos(u,-1),p=0;f&&(p=e.inputState.lastTouchY<=f.bottom?-1:1),this.newSel=bt.create([bt.cursor(u,p)])}else this.newSel=bt.single(h,u)}}}function PAt(t,e,r,n){if(t.isComposite()){let i=-1,a=-1,s=-1,o=-1;for(let l=0,u=n,h=n;lr)return PAt(d,e,r,u);if(f>=e&&i==-1&&(i=l,a=u),u>r&&d.dom.parentNode==t.dom){s=l,o=h;break}h=f,u=f+d.breakAfter}return{from:a,to:o<0?n+t.length:o,startDOM:(i?t.children[i-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:s=0?t.children[s].dom:null}}else return t.isText()?{from:n,to:n+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function NAt(t,e){let r,{newSel:n}=e,{state:i}=t,a=i.selection.main,s=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,u=a.from,h=null;(s===8||br.android&&e.text.length=o&&a.to<=l&&(e.typeOver||d!=e.text)&&d.slice(0,a.from-o)==e.text.slice(0,a.from-o)&&d.slice(a.to-o)==e.text.slice(f=e.text.length-(d.length-(a.to-o)))?r={from:a.from,to:a.to,insert:vi.of(e.text.slice(a.from-o,f).split(m4))}:(p=BAt(d,e.text,u-o,h))&&(br.chrome&&s==13&&p.toB==p.from+2&&e.text.slice(p.from,p.toB)==m4+m4&&p.toB--,r={from:o+p.from,to:o+p.toA,insert:vi.of(e.text.slice(p.from,p.toB).split(m4))})}else n&&(!t.hasFocus&&i.facet(Wy)||PX(n,a))&&(n=null);if(!r&&!n)return!1;if((br.mac||br.android)&&r&&r.from==r.to&&r.from==a.head-1&&/^\. ?$/.test(r.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(n&&r.insert.length==2&&(n=bt.single(n.main.anchor-1,n.main.head-1)),r={from:r.from,to:r.to,insert:vi.of([r.insert.toString().replace("."," ")])}):i.doc.lineAt(a.from).toDate.now()-50?r={from:a.from,to:a.to,insert:i.toText(t.inputState.insertingText)}:br.chrome&&r&&r.from==r.to&&r.from==a.head&&r.insert.toString()==` - `&&t.lineWrapping&&(n&&(n=bt.single(n.main.anchor-1,n.main.head-1)),r={from:a.from,to:a.to,insert:vi.of([" "])}),r)return qxe(t,r,n,s);if(n&&!PX(n,a)){let o=!1,l="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(o=!0),l=t.inputState.lastSelectionOrigin,l=="select.pointer"&&(n=MAt(i.facet(K7).map(u=>u(t)),n))),t.dispatch({selection:n,scrollIntoView:o,userEvent:l}),!0}else return!1}function qxe(t,e,r,n=-1){if(br.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(br.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&h4(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||n==8&&e.insert.lengthi.head)&&h4(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&h4(t.contentDOM,"Delete",46)))return!0;let a=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let s,o=()=>s||(s=Qln(t,e,r));return t.state.facet(mAt).some(l=>l(t,e.from,e.to,a,o))||t.dispatch(o()),!0}function Qln(t,e,r){let n,i=t.state,a=i.selection.main,s=-1;if(e.from==e.to&&e.froma.to){let l=e.fromd(t)),u,l);e.from==h&&(s=h)}if(s>-1)n={changes:e,selection:bt.cursor(e.from+e.insert.length,-1)};else if(e.from>=a.from&&e.to<=a.to&&e.to-e.from>=(a.to-a.from)/3&&(!r||r.main.empty&&r.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let l=a.frome.to?i.sliceDoc(e.to,a.to):"";n=i.replaceSelection(t.state.toText(l+e.insert.sliceString(0,void 0,t.state.lineBreak)+u))}else{let l=i.changes(e),u=r&&r.main.to<=l.newLength?r.main:void 0;if(i.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=a.to+10&&e.to>=a.to-10){let h=t.state.sliceDoc(e.from,e.to),d,f=r&&DAt(t,r.main.head);if(f){let g=e.insert.length-(e.to-e.from);d={from:f.from,to:f.to-g}}else d=t.state.doc.lineAt(a.head);let p=a.to-e.to;n=i.changeByRange(g=>{if(g.from==a.from&&g.to==a.to)return{changes:l,range:u||g.map(l)};let m=g.to-p,v=m-h.length;if(t.state.sliceDoc(v,m)!=h||m>=d.from&&v<=d.to)return{range:g};let y=i.changes({from:v,to:m,insert:e.insert}),b=g.to-a.to;return{changes:y,range:u?bt.range(Math.max(0,u.anchor+b),Math.max(0,u.head+b)):g.map(y)}})}else n={changes:l,selection:u&&i.selection.replaceRange(u)}}let o="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,o+=".compose",t.inputState.compositionFirstChange&&(o+=".start",t.inputState.compositionFirstChange=!1)),i.update(n,{userEvent:o,scrollIntoView:!0})}function BAt(t,e,r,n){let i=Math.min(t.length,e.length),a=0;for(;a0&&o>0&&t.charCodeAt(s-1)==e.charCodeAt(o-1);)s--,o--;if(n=="end"){let l=Math.max(0,a-Math.min(s,o));r-=s+l-a}if(s=s?a-r:0;a-=l,o=a+(o-s),s=a}else if(o=o?a-r:0;a-=l,s=a+(s-o),o=a}return{from:a,toA:s,toB:o}}function Gln(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:r,anchorOffset:n,focusNode:i,focusOffset:a}=t.observer.selectionRange;return r&&(e.push(new IAt(r,n)),(i!=r||a!=n)&&e.push(new IAt(i,a))),e}function Hln(t,e){if(t.length==0)return null;let r=t[0].pos,n=t.length==2?t[1].pos:r;return r>-1&&n>-1?bt.single(r+e,n+e):null}function PX(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class Wln{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,br.safari&&e.contentDOM.addEventListener("input",()=>null),br.gecko&&lcn(e.contentDOM.ownerDocument)}handleEvent(e){!tcn(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,r){let n=this.handlers[e];if(n){for(let i of n.observers)i(this.view,r);for(let i of n.handlers){if(r.defaultPrevented)break;if(i(this.view,r)){r.preventDefault();break}}}}ensureHandlers(e){let r=qln(e),n=this.handlers,i=this.view.contentDOM;for(let a in r)if(a!="scroll"){let s=!r[a].handlers.length,o=n[a];o&&s!=!o.handlers.length&&(i.removeEventListener(a,this.handleEvent),o=null),o||i.addEventListener(a,this.handleEvent,{passive:s})}for(let a in n)a!="scroll"&&!r[a]&&i.removeEventListener(a,this.handleEvent);this.handlers=r}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&zAt.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),br.android&&br.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(br.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(FAt.some(r=>r.keyCode==e.keyCode)&&!e.ctrlKey||jln.indexOf(e.key)>-1&&e.ctrlKey)){let r={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};return r.shiftKey&&br.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&Yln(this.view.win)&&(r.shiftKey=!1),this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:r},setTimeout(()=>this.flushIOSKey(),250),!0}return e.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let r=this.pendingIOSKey;return!r||r.key=="Enter"&&e&&e.from0?!0:br.safari&&!br.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function Yln(t){return t.visualViewport?t.visualViewport.height*t.visualViewport.scale/t.document.documentElement.clientHeight<.85:!1}function $At(t,e){return(r,n)=>{try{return e.call(t,n,r)}catch(i){Nh(r.state,i)}}}function qln(t){let e=Object.create(null);function r(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of t){let i=n.spec,a=i&&i.plugin.domEventHandlers,s=i&&i.plugin.domEventObservers;if(a)for(let o in a){let l=a[o];l&&r(o).handlers.push($At(n.value,l))}if(s)for(let o in s){let l=s[o];l&&r(o).observers.push($At(n.value,l))}}for(let n in fg)r(n).handlers.push(fg[n]);for(let n in Pu)r(n).observers.push(Pu[n]);return e}const FAt=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],jln="dthko",zAt=[16,17,18,20,91,92,224,225],NX=6;function BX(t){return Math.max(0,t)*.7+8}function Xln(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class Kln{constructor(e,r,n,i){this.view=e,this.startEvent=r,this.style=n,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=r,this.scrollParents=tAt(e.contentDOM),this.atoms=e.state.facet(K7).map(s=>s(e));let a=e.contentDOM.ownerDocument;a.addEventListener("mousemove",this.move=this.move.bind(this)),a.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=r.shiftKey,this.multiple=e.state.facet(Kn.allowMultipleSelections)&&Zln(e,r),this.dragging=ecn(e,r)&&YAt(r)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Xln(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let r=0,n=0,i=0,a=0,s=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:s}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:a,bottom:o}=this.scrollParents.y.getBoundingClientRect());let l=zxe(this.view);e.clientX-l.left<=i+NX?r=-BX(i-e.clientX):e.clientX+l.right>=s-NX&&(r=BX(e.clientX-s)),e.clientY-l.top<=a+NX?n=-BX(a-e.clientY):e.clientY+l.bottom>=o-NX&&(n=BX(e.clientY-o)),this.setScrollSpeed(r,n)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,r){this.scrollSpeed={x:e,y:r},e||r?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:r}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),r&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=r,r=0),(e||r)&&this.view.win.scrollBy(e,r),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:r}=this,n=MAt(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(r.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(r=>r.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Zln(t,e){let r=t.state.facet(dAt);return r.length?r[0](e):br.mac?e.metaKey:e.ctrlKey}function Jln(t,e){let r=t.state.facet(fAt);return r.length?r[0](e):br.mac?!e.altKey:!e.ctrlKey}function ecn(t,e){let{main:r}=t.state.selection;if(r.empty)return!1;let n=H7(t.root);if(!n||n.rangeCount==0)return!0;let i=n.getRangeAt(0).getClientRects();for(let a=0;a=e.clientX&&s.top<=e.clientY&&s.bottom>=e.clientY)return!0}return!1}function tcn(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let r=e.target,n;r!=t.contentDOM;r=r.parentNode)if(!r||r.nodeType==11||(n=Qs.get(r))&&n.isWidget()&&!n.isHidden&&n.widget.ignoreEvent(e))return!1;return!0}const fg=Object.create(null),Pu=Object.create(null),UAt=br.ie&&br.ie_version<15||br.ios&&br.webkit_version<604;function rcn(t){let e=t.dom.parentNode;if(!e)return;let r=e.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout(()=>{t.focus(),r.remove(),VAt(t,r.value)},50)}function $X(t,e,r){for(let n of t.facet(e))r=n(r,t);return r}function VAt(t,e){e=$X(t.state,Pxe,e);let{state:r}=t,n,i=1,a=r.toText(e),s=a.lines==r.selection.ranges.length;if(jxe!=null&&r.selection.ranges.every(l=>l.empty)&&jxe==a.toString()){let l=-1;n=r.changeByRange(u=>{let h=r.doc.lineAt(u.from);if(h.from==l)return{range:u};l=h.from;let d=r.toText((s?a.line(i++).text:e)+r.lineBreak);return{changes:{from:h.from,insert:d},range:bt.cursor(u.from+d.length)}})}else s?n=r.changeByRange(l=>{let u=a.line(i++);return{changes:{from:l.from,to:l.to,insert:u.text},range:bt.cursor(l.from+u.length)}}):n=r.replaceSelection(a);t.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}Pu.scroll=t=>{let e=t.inputState;e.lastScrollTop=t.scrollDOM.scrollTop,e.lastScrollLeft=t.scrollDOM.scrollLeft,br.ios&&!e.touchActive&&(e.lastIOSMomentumScroll=Date.now())},Pu.wheel=Pu.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()},fg.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1),Pu.touchstart=(t,e)=>{let r=t.inputState,n=e.targetTouches[0];r.touchActive=!0,r.lastTouchTime=Date.now(),n&&(r.lastTouchX=n.clientX,r.lastTouchY=n.clientY),r.setSelectionOrigin("select.pointer")},Pu.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")},Pu.touchend=(t,e)=>{t.inputState.touchActive=!1},fg.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let r=null;for(let n of t.state.facet(pAt))if(r=n(t,e),r)break;if(!r&&e.button==0&&(r=icn(t,e)),r){let n=!t.hasFocus;t.inputState.startMouseSelection(new Kln(t,e,r,n)),n&&t.observer.ignore(()=>{rAt(t.contentDOM);let a=t.root.activeElement;a&&!a.contains(t.contentDOM)&&a.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function QAt(t,e,r,n){if(n==1)return bt.cursor(e,r);if(n==2)return Mln(t.state,e,r);{let i=t.docView.lineAt(e,r),a=t.state.doc.lineAt(i?i.posAtEnd:e),s=i?i.posAtStart:a.from,o=i?i.posAtEnd:a.to;return oDate.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(HAt+1)%3:1}function icn(t,e){let r=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),n=YAt(e),i=t.state.selection;return{update(a){a.docChanged&&(r.pos=a.changes.mapPos(r.pos),i=i.map(a.changes))},get(a,s,o){let l=t.posAndSideAtCoords({x:a.clientX,y:a.clientY},!1),u,h=QAt(t,l.pos,l.assoc,n);if(r.pos!=l.pos&&!s){let d=QAt(t,r.pos,r.assoc,n),f=Math.min(d.from,h.from),p=Math.max(d.to,h.to);h=f1&&(u=acn(i,l.pos))?u:o?i.addRange(h):bt.create([h])}}}function acn(t,e){for(let r=0;r=e)return bt.create(t.ranges.slice(0,r).concat(t.ranges.slice(r+1)),t.mainIndex==r?0:t.mainIndex-(t.mainIndex>r?1:0))}return null}fg.dragstart=(t,e)=>{let{selection:{main:r}}=t.state;if(e.target.draggable){let i=t.docView.tile.nearest(e.target);if(i&&i.isWidget()){let a=i.posAtStart,s=a+i.length;(a>=r.to||s<=r.from)&&(r=bt.undirectionalRange(a,s))}}let{inputState:n}=t;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=r,e.dataTransfer&&(e.dataTransfer.setData("Text",$X(t.state,Nxe,t.state.sliceDoc(r.from,r.to))),e.dataTransfer.effectAllowed="copyMove"),!1},fg.dragend=t=>(t.inputState.draggedContent=null,!1);function qAt(t,e,r,n){if(r=$X(t.state,Pxe,r),!r)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:a}=t.inputState,s=n&&a&&Jln(t,e)?{from:a.from,to:a.to}:null,o={from:i,insert:r},l=t.state.changes(s?[s,o]:o);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:s?"move.drop":"input.drop"}),t.inputState.draggedContent=null}fg.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let r=e.dataTransfer.files;if(r&&r.length){let n=Array(r.length),i=0,a=()=>{++i==r.length&&qAt(t,e,n.filter(s=>s!=null).join(t.state.lineBreak),!1)};for(let s=0;s{/[\x00-\x08\x0e-\x1f]{2}/.test(o.result)||(n[s]=o.result),a()},o.readAsText(r[s])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return qAt(t,e,n,!0),!0}return!1},fg.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let r=UAt?null:e.clipboardData;return r?(VAt(t,r.getData("text/plain")||r.getData("text/uri-list")),!0):(rcn(t),!1)};function scn(t,e){let r=t.dom.parentNode;if(!r)return;let n=r.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),t.focus()},50)}function ocn(t){let e=[],r=[],n=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),r.push(i));if(!e.length){let i=-1;for(let{from:a}of t.selection.ranges){let s=t.doc.lineAt(a);s.number>i&&(e.push(s.text),r.push({from:s.from,to:Math.min(t.doc.length,s.to+1)})),i=s.number}n=!0}return{text:$X(t,Nxe,e.join(t.lineBreak)),ranges:r,linewise:n}}let jxe=null;fg.copy=fg.cut=(t,e)=>{if(!W7(t.contentDOM,t.observer.selectionRange))return!1;let{text:r,ranges:n,linewise:i}=ocn(t.state);if(!r&&!i)return!1;jxe=i?r:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let a=UAt?null:e.clipboardData;return a?(a.clearData(),a.setData("text/plain",r),!0):(scn(t,r),!1)};const jAt=c0.define();function XAt(t,e){let r=[];for(let n of t.facet(vAt)){let i=n(t,e);i&&r.push(i)}return r.length?t.update({effects:r,annotations:jAt.of(!0)}):null}function KAt(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let r=XAt(t.state,e);r?t.dispatch(r):t.update([])}},10)}Pu.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),KAt(t)},Pu.blur=t=>{t.observer.clearSelectionRange(),KAt(t)},Pu.compositionstart=Pu.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))},Pu.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,br.chrome&&br.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))},Pu.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()},fg.beforeinput=(t,e)=>{var r,n;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let a=(r=e.dataTransfer)===null||r===void 0?void 0:r.getData("text/plain"),s=e.getTargetRanges();if(a&&s.length){let o=s[0],l=t.posAtDOM(o.startContainer,o.startOffset),u=t.posAtDOM(o.endContainer,o.endOffset);return qxe(t,{from:l,to:u,insert:t.state.toText(a)},null),!0}}let i;if(br.chrome&&br.android&&(i=FAt.find(a=>a.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let a=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>a+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return br.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),br.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>Pu.compositionend(t,e),20),!1};const ZAt=new Set;function lcn(t){ZAt.has(t)||(ZAt.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const JAt=["pre-wrap","normal","pre-line","break-spaces"];let v4=!1;function eTt(){v4=!1}class ccn{constructor(e){this.lineWrapping=e,this.doc=vi.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,r){let n=this.doc.lineAt(r).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((r-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return JAt.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let r=!1;for(let n=0;n-1,l=Math.abs(r-this.lineHeight)>.3||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=r,this.charWidth=n,this.textHeight=i,this.lineLength=a,l){this.heightSamples={};for(let u=0;u0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>FX&&(v4=!0),this.height=e)}replace(e,r,n){return Nu.of(n)}decomposeLeft(e,r){r.push(this)}decomposeRight(e,r){r.push(this)}applyChanges(e,r,n,i){let a=this,s=n.doc;for(let o=i.length-1;o>=0;o--){let{fromA:l,toA:u,fromB:h,toB:d}=i[o],f=a.lineAt(l,Ma.ByPosNoHeight,n.setDoc(r),0,0),p=f.to>=u?f:a.lineAt(u,Ma.ByPosNoHeight,n,0,0);for(d+=p.to-u,u=p.to;o>0&&f.from<=i[o-1].toA;)l=i[o-1].fromA,h=i[o-1].fromB,o--,la*2){let o=e[r-1];o.break?e.splice(--r,1,o.left,null,o.right):e.splice(--r,1,o.left,o.right),n+=1+o.break,i-=o.size}else if(a>i*2){let o=e[n];o.break?e.splice(n,1,o.left,null,o.right):e.splice(n,1,o.left,o.right),n+=2+o.break,a-=o.size}else break;else if(i=a&&s(this.lineAt(0,Ma.ByPos,n,i,a))}setMeasuredHeight(e){let r=e.heights[e.index++];r<0?(this.spaceAbove=-r,r=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(r)}updateHeight(e,r=0,n=!1,i){return i&&i.from<=r&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class zd extends tTt{constructor(e,r,n){super(e,r,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,r){return new pg(r,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,r,n){let i=n[0];return n.length==1&&(i instanceof zd||i instanceof fc&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof fc?i=new zd(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):Nu.of(n)}updateHeight(e,r=0,n=!1,i){return i&&i.from<=r&&i.more?this.setMeasuredHeight(i):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class fc extends Nu{constructor(e){super(e,0)}heightMetrics(e,r){let n=e.doc.lineAt(r).number,i=e.doc.lineAt(r+this.length).number,a=i-n+1,s,o=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*a);s=l/a,this.length>a+1&&(o=(this.height-l)/(this.length-a-1))}else s=this.height/a;return{firstLine:n,lastLine:i,perLine:s,perChar:o}}blockAt(e,r,n,i){let{firstLine:a,lastLine:s,perLine:o,perChar:l}=this.heightMetrics(r,i);if(r.lineWrapping){let u=i+(e0){let a=n[n.length-1];a instanceof fc?n[n.length-1]=new fc(a.length+i):n.push(null,new fc(i-1))}if(e>0){let a=n[0];a instanceof fc?n[0]=new fc(e+a.length):n.unshift(new fc(e-1),null)}return Nu.of(n)}decomposeLeft(e,r){r.push(new fc(e-1),null)}decomposeRight(e,r){r.push(null,new fc(this.length-e-1))}updateHeight(e,r=0,n=!1,i){let a=r+this.length;if(i&&i.from<=r+this.length&&i.more){let s=[],o=Math.max(r,i.from),l=-1;for(i.from>r&&s.push(new fc(i.from-r-1).updateHeight(e,r));o<=a&&i.more;){let h=e.doc.lineAt(o).length;s.length&&s.push(null);let d=i.heights[i.index++],f=0;d<0&&(f=-d,d=i.heights[i.index++]),l==-1?l=d:Math.abs(d-l)>=FX&&(l=-2);let p=new zd(h,d,f);p.outdated=!1,s.push(p),o+=h+1}o<=a&&s.push(null,new fc(a-o).updateHeight(e,o));let u=Nu.of(s);return(l<0||Math.abs(u.height-this.height)>=FX||Math.abs(l-this.heightMetrics(e,r).perLine)>=FX)&&(v4=!0),zX(this,u)}else(n||this.outdated)&&(this.setHeight(e.heightForGap(r,r+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class dcn extends Nu{constructor(e,r,n){super(e.length+r+n.length,e.height+n.height,r|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,r,n,i){let a=n+this.left.height;return eo))return u;let h=r==Ma.ByPosNoHeight?Ma.ByPosNoHeight:Ma.ByPos;return l?u.join(this.right.lineAt(o,h,n,s,o)):this.left.lineAt(o,h,n,i,a).join(u)}forEachLine(e,r,n,i,a,s){let o=i+this.left.height,l=a+this.left.length+this.break;if(this.break)e=l&&this.right.forEachLine(e,r,n,o,l,s);else{let u=this.lineAt(l,Ma.ByPos,n,i,a);e=e&&u.from<=r&&s(u),r>u.to&&this.right.forEachLine(u.to+1,r,n,o,l,s)}}replace(e,r,n){let i=this.left.length+this.break;if(rthis.left.length)return this.balanced(this.left,this.right.replace(e-i,r-i,n));let a=[];e>0&&this.decomposeLeft(e,a);let s=a.length;for(let o of n)a.push(o);if(e>0&&rTt(a,s-1),r=n&&r.push(null)),e>n&&this.right.decomposeLeft(e-n,r)}decomposeRight(e,r){let n=this.left.length,i=n+this.break;if(e>=i)return this.right.decomposeRight(e-i,r);e2*r.size||r.size>2*e.size?Nu.of(this.break?[e,null,r]:[e,r]):(this.left=zX(this.left,e),this.right=zX(this.right,r),this.setHeight(e.height+r.height),this.outdated=e.outdated||r.outdated,this.size=e.size+r.size,this.length=e.length+this.break+r.length,this)}updateHeight(e,r=0,n=!1,i){let{left:a,right:s}=this,o=r+a.length+this.break,l=null;return i&&i.from<=r+a.length&&i.more?l=a=a.updateHeight(e,r,n,i):a.updateHeight(e,r,n),i&&i.from<=o+s.length&&i.more?l=s=s.updateHeight(e,o,n,i):s.updateHeight(e,o,n),l?this.balanced(a,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function rTt(t,e){let r,n;t[e]==null&&(r=t[e-1])instanceof fc&&(n=t[e+1])instanceof fc&&t.splice(e-1,3,new fc(r.length+1+n.length))}const fcn=5;class Xxe{constructor(e,r){this.pos=e,this.oracle=r,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,r){if(this.lineStart>-1){let n=Math.min(r,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof zd?i.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new zd(n-this.pos,-1,0)),this.writtenTo=n,r>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=r}point(e,r,n){if(e=fcn)&&this.addLineDeco(i,a,s)}else r>e&&this.span(e,r);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:r}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=r,this.writtenToe&&this.nodes.push(new zd(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,r){let n=new fc(r-e);return this.oracle.doc.lineAt(e).to==r&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof zd)return e;let r=new zd(0,-1,0);return this.nodes.push(r),r}addBlock(e){this.enterLine();let r=e.deco;r&&r.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,r&&r.endSide>0&&(this.covering=e)}addLineDeco(e,r,n){let i=this.ensureLine();i.length+=n,i.collapsed+=n,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=r,this.writtenTo=this.pos=this.pos+n}finish(e){let r=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(r instanceof zd)&&!this.isCovered?this.nodes.push(new zd(0,-1,0)):(this.writtenToh.clientHeight||h.scrollWidth>h.clientWidth)&&d.overflow!="visible"){let f=h.getBoundingClientRect();a=Math.max(a,f.left),s=Math.min(s,f.right),o=Math.max(o,f.top),l=Math.min(u==t.parentNode?i.innerHeight:l,f.bottom)}u=d.position=="absolute"||d.position=="fixed"?h.offsetParent:h.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:a-r.left,right:Math.max(a,s)-r.left,top:o-(r.top+e),bottom:Math.max(o,l)-(r.top+e)}}function vcn(t){let e=t.getBoundingClientRect(),r=t.ownerDocument.defaultView||window;return e.left0&&e.top0}function ycn(t,e){let r=t.getBoundingClientRect();return{left:0,right:r.right-r.left,top:e,bottom:r.bottom-(r.top+e)}}class Kxe{constructor(e,r,n,i){this.from=e,this.to=r,this.size=n,this.displaySize=i}static same(e,r){if(e.length!=r.length)return!1;for(let n=0;ntypeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new ccn(n),this.stateDeco=aTt(r),this.heightMap=Nu.empty().applyChanges(this.stateDeco,vi.empty,this.heightOracle.setDoc(r.doc),[new np(0,0,0,r.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ar.set(this.lineGaps.map(i=>i.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:r}=this.state.selection;for(let n=0;n<=1;n++){let i=n?r.head:r.anchor;if(!e.some(({from:a,to:s})=>i>=a&&i<=s)){let{from:a,to:s}=this.lineBlockAt(i);e.push(new UX(a,s))}}return this.viewports=e.sort((n,i)=>n.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?iTt:new Zxe(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(e$(e,this.scaler))})}update(e,r=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=aTt(this.state);let i=e.changedRanges,a=np.extendWithRanges(i,pcn(n,this.stateDeco,e?e.changes:co.empty(this.state.doc.length))),s=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);eTt(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),a),(this.heightMap.height!=s||v4)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=s);let l=a.length?this.mapViewport(this.viewport,e.changes):this.viewport;(r&&(r.range.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,r));let u=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(u||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),r&&(this.scrollTarget=r),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(bAt)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,r=e.contentDOM,n=window.getComputedStyle(r),i=this.heightOracle,a=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?Ta.RTL:Ta.LTR;let s=this.heightOracle.mustRefreshForWrapping(a)||this.mustMeasureContent==="refresh",o=r.getBoundingClientRect(),l=s||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let u=0,h=0;if(o.width&&o.height){let{scaleX:A,scaleY:T}=eAt(r,o);(A>.005&&Math.abs(this.scaleX-A)>.005||T>.005&&Math.abs(this.scaleY-T)>.005)&&(this.scaleX=A,this.scaleY=T,u|=16,s=l=!0)}let d=(parseInt(n.paddingTop)||0)*this.scaleY,f=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=d||this.paddingBottom!=f)&&(this.paddingTop=d,this.paddingBottom=f,u|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,u|=16);let p=tAt(this.view.contentDOM,!1).y;p!=this.scrollParent&&(this.scrollParent=p,this.scrollAnchorHeight=-1,this.scrollOffset=0);let g=this.getScrollOffset();this.scrollOffset!=g&&(this.scrollAnchorHeight=-1,this.scrollOffset=g),this.scrolledToBottom=iAt(this.scrollParent||e.win);let m=(this.printing?ycn:mcn)(r,this.paddingTop),v=m.top-this.pixelViewport.top,y=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let b=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(b!=this.inView&&(this.inView=b,b&&(l=!0)),!this.inView&&!this.scrollTarget&&!vcn(e.dom))return 0;let x=o.width;if((this.contentDOMWidth!=x||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,u|=16),l){let A=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(A)&&(s=!0),s||i.lineWrapping&&Math.abs(x-this.contentDOMWidth)>i.charWidth){let{lineHeight:T,charWidth:S,textHeight:O}=e.docView.measureTextSize();s=T>0&&i.refresh(a,T,S,O,Math.max(5,x/S),A),s&&(e.docView.minWidth=0,u|=16)}v>0&&y>0?h=Math.max(v,y):v<0&&y<0&&(h=Math.min(v,y)),eTt();for(let T of this.viewports){let S=T.from==this.viewport.from?A:e.docView.measureVisibleLineHeights(T);this.heightMap=(s?Nu.empty().applyChanges(this.stateDeco,vi.empty,this.heightOracle,[new np(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,s,new ucn(T.from,S))}v4&&(u|=2)}let w=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return w&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),u|=this.updateForViewport()),(u&2||w)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,e)),u|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),u}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,r){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,a=this.heightOracle,{visibleTop:s,visibleBottom:o}=this,l=new UX(i.lineAt(s-n*1e3,Ma.ByHeight,a,0,0).from,i.lineAt(o+(1-n)*1e3,Ma.ByHeight,a,0,0).to);if(r){let{head:u}=r.range;if(ul.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),d=i.lineAt(u,Ma.ByPos,a,0,0),f;r.y=="center"?f=(d.top+d.bottom)/2-h/2:r.y=="start"||r.y=="nearest"&&u=o+Math.max(10,Math.min(n,250)))&&i>s-2*1e3&&a>1,s=i<<1;if(this.defaultTextDirection!=Ta.LTR&&!n)return[];let o=[],l=(h,d,f,p)=>{if(d-hh&&yy.from>=f.from&&y.to<=f.to&&Math.abs(y.from-h)y.fromb));if(!v){if(dx.from<=d&&x.to>=d)){let x=r.moveToLineBoundary(bt.cursor(d),!1,!0).head;x>h&&(d=x)}let y=this.gapSize(f,h,d,p),b=n||y<2e6?y:2e6;v=new Kxe(h,d,y,b)}o.push(v)},u=h=>{if(h.length2e6)for(let T of e)T.from>=h.from&&T.fromh.from&&l(h.from,p,h,d),gr.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let r=this.stateDeco;this.lineGaps.length&&(r=r.concat(this.lineGapDeco));let n=[];Zn.spans(r,this.viewport.from,this.viewport.to,{span(a,s){n.push({from:a,to:s})},point(){}},20);let i=0;if(n.length!=this.visibleRanges.length)i=12;else for(let a=0;a=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(r=>r.from<=e&&r.to>=e)||e$(this.heightMap.lineAt(e,Ma.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(r=>r.top<=e&&r.bottom>=e)||e$(this.heightMap.lineAt(this.scaler.fromDOM(e),Ma.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let r=this.lineBlockAtHeight(e+8);return r.from>=this.viewport.from||this.viewportLines[0].top-e>200?r:this.viewportLines[0]}elementAtHeight(e){return e$(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class UX{constructor(e,r){this.from=e,this.to=r}}function xcn(t,e,r){let n=[],i=t,a=0;return Zn.spans(r,t,e,{span(){},point(s,o){s>i&&(n.push({from:i,to:s}),a+=s-i),i=o}},20),i=1)return e[e.length-1].to;let n=Math.floor(t*r);for(let i=0;;i++){let{from:a,to:s}=e[i],o=s-a;if(n<=o)return a+n;n-=o}}function QX(t,e){let r=0;for(let{from:n,to:i}of t.ranges){if(e<=i){r+=e-n;break}r+=i-n}return r/t.total}function wcn(t,e){for(let r of t)if(e(r))return r}const iTt={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function aTt(t){let e=t.facet(_X).filter(n=>typeof n!="function"),r=t.facet(Fxe).filter(n=>typeof n!="function");return r.length&&e.push(Zn.join(r)),e}class Zxe{constructor(e,r,n){let i=0,a=0,s=0;this.viewports=n.map(({from:o,to:l})=>{let u=r.lineAt(o,Ma.ByPos,e,0,0).top,h=r.lineAt(l,Ma.ByPos,e,0,0).bottom;return i+=h-u,{from:o,to:l,top:u,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(r.height-i);for(let o of this.viewports)o.domTop=s+(o.top-a)*this.scale,s=o.domBottom=o.domTop+(o.bottom-o.top),a=o.bottom}toDOM(e){for(let r=0,n=0,i=0;;r++){let a=rr.from==e.viewports[n].from&&r.to==e.viewports[n].to):!1}}function e$(t,e){if(e.scale==1)return t;let r=e.toDOM(t.top),n=e.toDOM(t.bottom);return new pg(t.from,t.length,r,n-r,Array.isArray(t._content)?t._content.map(i=>e$(i,e)):t._content)}const GX=vr.define({combine:t=>t.join(" ")}),Jxe=vr.define({combine:t=>t.indexOf(!0)>-1}),e2e=Gy.newName(),sTt=Gy.newName(),oTt=Gy.newName(),lTt={"&light":"."+sTt,"&dark":"."+oTt};function t2e(t,e,r){return new Gy(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,i=>{if(i=="&")return t;if(!r||!r[i])throw new RangeError(`Unsupported selector: ${i}`);return r[i]}):t+" "+n}})}const Acn=t2e("."+e2e,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},lTt),Tcn={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},r2e=br.ie&&br.ie_version<=11;class Scn{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Jon,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(r=>{for(let n of r)this.queue.push(n);(br.ie&&br.ie_version<=11||br.ios&&e.composing)&&r.some(n=>n.type=="childList"&&n.removedNodes.length||n.type=="characterData"&&n.oldValue.length>n.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&br.android&&e.constructor.EDIT_CONTEXT!==!1&&!(br.chrome&&br.chrome_version<126)&&(this.editContext=new Ocn(e),e.state.facet(Wy)&&(e.contentDOM.editContext=this.editContext.editContext)),r2e&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var r;((r=this.view.docView)===null||r===void 0?void 0:r.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),r.length>0&&r[r.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(r=>{r.length>0&&r[r.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((r,n)=>r!=e[n]))){this.gapIntersection.disconnect();for(let r of e)this.gapIntersection.observe(r);this.gaps=e}}onSelectionChange(e){let r=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,i=this.selectionRange;if(n.state.facet(Wy)?n.root.activeElement!=this.dom:!W7(this.dom,i))return;let a=i.anchorNode&&n.docView.tile.nearest(i.anchorNode);if(a&&a.isWidget()&&a.widget.ignoreEvent(e)){r||(this.selectionChanged=!1);return}(br.ie&&br.ie_version<=11||br.android&&br.chrome)&&!n.state.selection.main.empty&&i.focusNode&&q7(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,r=H7(e.root);if(!r)return!1;let n=br.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&Ccn(this.view,r)||r;if(!n||this.selectionRange.eq(n))return!1;let i=W7(this.dom,n);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let a=this.delayedAndroidKey;a&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=a.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&a.force&&h4(this.dom,a.key,a.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:r,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let r=-1,n=-1,i=!1;for(let a of e){let s=this.readMutation(a);s&&(s.typeOver&&(i=!0),r==-1?{from:r,to:n}=s:(r=Math.min(s.from,r),n=Math.max(s.to,n)))}return{from:r,to:n,typeOver:i}}readChange(){let{from:e,to:r,typeOver:n}=this.processRecords(),i=this.selectionChanged&&W7(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let a=new Vln(this.view,e,r,n);return this.view.docView.domChanged={newSel:a.newSel?a.newSel.main:null},a}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let r=this.readChange();if(!r)return this.view.requestMeasure(),!1;let n=this.view.state,i=NAt(this.view,r);return this.view.state==n&&(r.domChanged||r.newSel&&!PX(this.view.state.selection,r.newSel.main))&&this.view.update([]),i}readMutation(e){let r=this.view.docView.tile.nearest(e.target);if(!r||r.isWidget())return null;if(r.markDirty(e.type=="attributes"),e.type=="childList"){let n=cTt(r,e.previousSibling||e.target.previousSibling,-1),i=cTt(r,e.nextSibling||e.target.nextSibling,1);return{from:n?r.posAfter(n):r.posAtStart,to:i?r.posBefore(i):r.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Wy)!=e.state.facet(Wy)&&(e.view.contentDOM.editContext=e.state.facet(Wy)?this.editContext.editContext:null))}destroy(){var e,r,n;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(r=this.gapIntersection)===null||r===void 0||r.disconnect(),(n=this.resizeScroll)===null||n===void 0||n.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function cTt(t,e,r){for(;e;){let n=Qs.get(e);if(n&&n.parent==t)return n;let i=e.parentNode;e=i!=t.dom?i:r>0?e.nextSibling:e.previousSibling}return null}function uTt(t,e){let r=e.startContainer,n=e.startOffset,i=e.endContainer,a=e.endOffset,s=t.docView.domAtPos(t.state.selection.main.anchor,1);return q7(s.node,s.offset,i,a)&&([r,n,i,a]=[i,a,r,n]),{anchorNode:r,anchorOffset:n,focusNode:i,focusOffset:a}}function Ccn(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return uTt(t,i)}let r=null;function n(i){i.preventDefault(),i.stopImmediatePropagation(),r=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",n,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",n,!0),r?uTt(t,r):null}class Ocn{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let r=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let i=e.state.selection.main,{anchor:a,head:s}=i,o=this.toEditorPos(n.updateRangeStart),l=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:o,drifted:!1});let u=l-o>n.text.length;o==this.from&&athis.to&&(l=a);let h=BAt(e.state.sliceDoc(o,l),n.text,(u?i.from:i.to)-o,u?"end":null);if(!h){let f=bt.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));PX(f,i)||e.dispatch({selection:f,userEvent:"select"});return}let d={from:h.from+o,to:h.toA+o,insert:vi.of(n.text.slice(h.from,h.toB).split(` -`))};if((br.mac||br.android)&&d.from==s-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(d={from:o,to:l,insert:vi.of([n.text.replace("."," ")])}),this.pendingContextChange=d,!e.state.readOnly){let f=this.to-this.from+(d.to-d.from+d.insert.length);qxe(e,d,bt.single(this.toEditorPos(n.selectionStart,f),this.toEditorPos(n.selectionEnd,f)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),d.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(r.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(r.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let i=[],a=null;for(let s=this.toEditorPos(n.rangeStart),o=this.toEditorPos(n.rangeEnd);s{let i=[];for(let a of n.getTextFormats()){let s=a.underlineStyle,o=a.underlineThickness;if(!/none/i.test(s)&&!/none/i.test(o)){let l=this.toEditorPos(a.rangeStart),u=this.toEditorPos(a.rangeEnd);if(l{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:n}=this.composing;this.composing=null,n&&this.reset(e.state)}};for(let n in this.handlers)r.addEventListener(n,this.handlers[n]);this.measureReq={read:n=>{let i=H7(n.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let r=0,n=!1,i=this.pendingContextChange;return e.changes.iterChanges((a,s,o,l,u)=>{if(n)return;let h=u.length-(s-a);if(i&&s>=i.to)if(i.from==a&&i.to==s&&i.insert.eq(u)){i=this.pendingContextChange=null,r+=h,this.to+=h;return}else i=null,this.revertPending(e.state);if(a+=r,s+=r,s<=this.from)this.from+=h,this.to+=h;else if(athis.to||this.to-this.from+u.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(a),this.toContextPos(s),u.toString()),this.to+=h}r+=h}),i&&!n&&this.revertPending(e.state),!n}update(e){let r=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||r)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:r}=e.selection.main;this.from=Math.max(0,r-1e4),this.to=Math.min(e.doc.length,r+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let r=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(r.from),this.toContextPos(r.from+r.insert.length),e.doc.sliceString(r.from,r.to))}setSelection(e){let{main:r}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,r.anchor))),i=this.toContextPos(r.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(n,i)}rangeIsValid(e){let{head:r}=e.selection.main;return!(this.from>0&&r-this.from<500||this.to1e4*3)}toEditorPos(e,r=this.to-this.from){e=Math.min(e,r);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let r=this.composing;return r&&r.drifted?r.contextBase+(e-r.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class er{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var r;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(i=>i.forEach(a=>n(a,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||eln(e.parent)||document,this.viewState=new nTt(this,e.state||Kn.create(e)),e.scrollTo&&e.scrollTo.is(EX)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(f4).map(i=>new Bxe(i));for(let i of this.plugins)i.update(this);this.observer=new Scn(this),this.inputState=new Wln(this),this.inputState.ensureHandlers(this.plugins),this.docView=new RAt(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((r=document.fonts)===null||r===void 0)&&r.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let r=e.length==1&&e[0]instanceof Do?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(r,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let r=!1,n=!1,i,a=this.state;for(let f of e){if(f.startState!=a)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");a=f.state}if(this.destroyed){this.viewState.state=a;return}let s=this.hasFocus,o=0,l=null;e.some(f=>f.annotation(jAt))?(this.inputState.notifiedFocused=s,o=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,l=XAt(a,s),l||(o=1));let u=this.observer.delayedAndroidKey,h=null;if(u?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(a.doc)||!this.state.selection.eq(a.selection))&&(h=null)):this.observer.clear(),a.facet(Kn.phrases)!=this.state.facet(Kn.phrases))return this.setState(a);i=RX.create(this,a,e),i.flags|=o;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(d&&(d=d.map(f.changes)),f.scrollIntoView){let{main:p}=f.state.selection,{x:g,y:m}=this.state.facet(er.cursorScrollMargin);d=new d4(p.empty?p:bt.cursor(p.head,p.head>p.anchor?-1:1),"nearest","nearest",m,g)}for(let p of f.effects)p.is(EX)&&(d=p.value.clip(this.state))}this.viewState.update(i,d),this.bidiCache=HX.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),r=this.docView.update(i),this.state.facet(Z7)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(r,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(GX)!=i.state.facet(GX)&&(this.viewState.mustMeasureContent=!0),(r||n||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),r&&this.docViewUpdate(),!i.empty)for(let f of this.state.facet(Ixe))try{f(i)}catch(p){Nh(this.state,p,"update listener")}(l||h)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),h&&!NAt(this,h)&&u.force&&h4(this.contentDOM,u.key,u.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let r=this.hasFocus;try{for(let n of this.plugins)n.destroy(this);this.viewState=new nTt(this,e),this.plugins=e.facet(f4).map(n=>new Bxe(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new RAt(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}r&&this.focus(),this.requestMeasure()}updatePlugins(e){let r=e.startState.facet(f4),n=e.state.facet(f4);if(r!=n){let i=[];for(let a of n){let s=r.indexOf(a);if(s<0)i.push(new Bxe(a));else{let o=this.plugins[s];o.mustUpdate=e,i.push(o)}}for(let a of this.plugins)a.mustUpdate!=e&&a.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let r=null,n=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:a,scrollAnchorHeight:s}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let o=0;;o++){if(s<0)if(iAt(n||this.win))a=-1,s=this.viewState.heightMap.height;else{let p=this.viewState.scrollAnchorAt(i);a=p.from,s=p.top}this.updateState=1;let l=this.viewState.measure();if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(o>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];l&4||([this.measureRequests,u]=[u,this.measureRequests]);let h=u.map(p=>{try{return p.read(this)}catch(g){return Nh(this.state,g),hTt}}),d=RX.create(this,this.state,[]),f=!1;d.flags|=l,r?r.flags|=l:r=d,this.updateState=2,d.empty||(this.updatePlugins(d),this.inputState.update(d),this.updateAttrs(),f=this.docView.update(d),f&&this.docViewUpdate());for(let p=0;p1||g<-1)&&!(br.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i=i+g,n?n.scrollTop+=g:this.win.scrollBy(0,g),s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(r&&!r.empty)for(let o of this.state.facet(Ixe))o(r)}get themeClasses(){return e2e+" "+(this.state.facet(Jxe)?oTt:sTt)+" "+this.state.facet(GX)}updateAttrs(){let e=dTt(this,AAt,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),r={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Wy)?"true":"false",class:"cm-content",style:`${br.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(r["aria-readonly"]="true"),dTt(this,$xe,r);let n=this.observer.ignore(()=>{let i=Kwt(this.contentDOM,this.contentAttrs,r),a=Kwt(this.dom,this.editorAttrs,e);return i||a});return this.editorAttrs=e,this.contentAttrs=r,n}showAnnouncements(e){let r=!0;for(let n of e)for(let i of n.effects)if(i.is(er.announce)){r&&(this.announceDOM.textContent=""),r=!1;let a=this.announceDOM.appendChild(document.createElement("div"));a.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Z7);let e=this.state.facet(er.cspNonce);Gy.mount(this.root,this.styleModules.concat(Acn).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let r=0;rn.plugin==e)||null),r&&r.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,r,n){return Wxe(this,e,LAt(this,e,r,n))}moveByGroup(e,r){return Wxe(this,e,LAt(this,e,r,n=>Nln(this,e.head,n)))}visualLineSide(e,r){let n=this.bidiSpans(e),i=this.textDirectionAt(e.from),a=n[r?n.length-1:0];return bt.cursor(a.side(r,i)+e.from,a.forward(!r,i)?1:-1)}moveToLineBoundary(e,r,n=!0){return Pln(this,e,r,n)}moveVertically(e,r,n){return Wxe(this,e,Bln(this,e,r,n))}domAtPos(e,r=1){return this.docView.domAtPos(e,r)}posAtDOM(e,r=0){return this.docView.posFromDOM(e,r)}posAtCoords(e,r=!0){this.readMeasured();let n=Yxe(this,e,r);return n&&n.pos}posAndSideAtCoords(e,r=!0){return this.readMeasured(),Yxe(this,e,r)}coordsAtPos(e,r=1){this.readMeasured();let n=this.state.doc.lineAt(e),i=this.bidiSpans(n),a=i[d0.find(i,e-n.from,-1,r)];return this.docView.coordsAt(e,r,a.dir==Ta.RTL)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(yAt)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>kcn)return uAt(e.length);let r=this.textDirectionAt(e.from),n;for(let a of this.bidiCache)if(a.from==e.from&&a.dir==r&&(a.fresh||cAt(a.isolates,n=CAt(this,e))))return a.order;n||(n=CAt(this,e));let i=lln(e.text,r,n);return this.bidiCache.push(new HX(e.from,e.to,r,n,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||br.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{rAt(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,r={}){var n,i,a,s;return EX.of(new d4(typeof e=="number"?bt.cursor(e):e,(n=r.y)!==null&&n!==void 0?n:"nearest",(i=r.x)!==null&&i!==void 0?i:"nearest",(a=r.yMargin)!==null&&a!==void 0?a:5,(s=r.xMargin)!==null&&s!==void 0?s:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:r}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return EX.of(new d4(bt.cursor(n.from),"start","start",n.top-e,r,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return ws.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return ws.define(()=>({}),{eventObservers:e})}static theme(e,r){let n=Gy.newName(),i=[GX.of(n),Z7.of(t2e(`.${n}`,e))];return r&&r.dark&&i.push(Jxe.of(!0)),i}static baseTheme(e){return Fd.lowest(Z7.of(t2e("."+e2e,e,lTt)))}static findFromDOM(e){var r;let n=e.querySelector(".cm-content"),i=n&&Qs.get(n)||Qs.get(e);return((r=i==null?void 0:i.root)===null||r===void 0?void 0:r.view)||null}}er.styleModule=Z7,er.inputHandler=mAt,er.clipboardInputFilter=Pxe,er.clipboardOutputFilter=Nxe,er.scrollHandler=xAt,er.focusChangeEffect=vAt,er.perLineTextDirection=yAt,er.exceptionSink=gAt,er.updateListener=Ixe,er.editable=Wy,er.mouseSelectionStyle=pAt,er.dragMovesSelection=fAt,er.clickAddsSelectionRange=dAt,er.decorations=_X,er.blockWrappers=TAt,er.outerDecorations=Fxe,er.atomicRanges=K7,er.bidiIsolatedRanges=SAt,er.cursorScrollMargin=vr.define({combine:t=>{let e=5,r=5;for(let n of t)typeof n=="number"?e=r=n:{x:e,y:r}=n;return{x:e,y:r}}}),er.scrollMargins=OAt,er.darkTheme=Jxe,er.cspNonce=vr.define({combine:t=>t.length?t[0]:""}),er.contentAttributes=$xe,er.editorAttributes=AAt,er.lineWrapping=er.contentAttributes.of({class:"cm-lineWrapping"}),er.announce=nn.define();const kcn=4096,hTt={};class HX{constructor(e,r,n,i,a,s){this.from=e,this.to=r,this.dir=n,this.isolates=i,this.fresh=a,this.order=s}static update(e,r){if(r.empty&&!e.some(a=>a.fresh))return e;let n=[],i=e.length?e[e.length-1].dir:Ta.LTR;for(let a=Math.max(0,e.length-10);a=0;i--){let a=n[i],s=typeof a=="function"?a(t):a;s&&kxe(s,r)}return r}const Ecn=br.mac?"mac":br.windows?"win":br.linux?"linux":"key";function _cn(t,e){const r=t.split(/-(?!$)/);let n=r[r.length-1];n=="Space"&&(n=" ");let i,a,s,o;for(let l=0;ln.concat(i),[]))),r}function Dcn(t,e,r){return gTt(pTt(t.state),e,t,r)}let s2=null;const Lcn=4e3;function Mcn(t,e=Ecn){let r=Object.create(null),n=Object.create(null),i=(s,o)=>{let l=n[s];if(l==null)n[s]=o;else if(l!=o)throw new Error("Key binding "+s+" is used both as a regular binding and as a multi-stroke prefix")},a=(s,o,l,u,h)=>{var d,f;let p=r[s]||(r[s]=Object.create(null)),g=o.split(/ (?!$)/).map(y=>_cn(y,e));for(let y=1;y{let w=s2={view:x,prefix:b,scope:s};return setTimeout(()=>{s2==w&&(s2=null)},Lcn),!0}]})}let m=g.join(" ");i(m,!1);let v=p[m]||(p[m]={preventDefault:!1,stopPropagation:!1,run:((f=(d=p._any)===null||d===void 0?void 0:d.run)===null||f===void 0?void 0:f.slice())||[]});l&&v.run.push(l),u&&(v.preventDefault=!0),h&&(v.stopPropagation=!0)};for(let s of t){let o=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let u of o){let h=r[u]||(r[u]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:d}=s;for(let f in h)h[f].run.push(p=>d(p,n2e))}let l=s[e]||s.key;if(l)for(let u of o)a(u,l,s.run,s.preventDefault,s.stopPropagation),s.shift&&a(u,"Shift-"+l,s.shift,s.preventDefault,s.stopPropagation)}return r}let n2e=null;function gTt(t,e,r,n){n2e=e;let i=Yon(e),a=Ph(i,0),s=o0(a)==i.length&&i!=" ",o="",l=!1,u=!1,h=!1;s2&&s2.view==r&&s2.scope==n&&(o=s2.prefix+" ",zAt.indexOf(e.keyCode)<0&&(u=!0,s2=null));let d=new Set,f=v=>{if(v){for(let y of v.run)if(!d.has(y)&&(d.add(y),y(r)))return v.stopPropagation&&(h=!0),!0;v.preventDefault&&(v.stopPropagation&&(h=!0),u=!0)}return!1},p=t[n],g,m;return p&&(f(p[o+WX(i,e,!s)])?l=!0:s&&(e.altKey||e.metaKey||e.ctrlKey)&&!(br.windows&&e.ctrlKey&&e.altKey)&&!(br.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(g=i2[e.keyCode])&&g!=i?(f(p[o+WX(g,e,!0)])||e.shiftKey&&(m=U7[e.keyCode])!=i&&m!=g&&f(p[o+WX(m,e,!1)]))&&(l=!0):s&&e.shiftKey&&f(p[o+WX(i,e,!0)])&&(l=!0),!l&&f(p._any)&&(l=!0)),u&&(l=!0),l&&h&&e.stopPropagation(),n2e=null,l}class VS{constructor(e,r,n,i,a){this.className=e,this.left=r,this.top=n,this.width=i,this.height=a}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,r){return r.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,r,n){if(n.empty){let i=e.coordsAtPos(n.head,n.assoc||1);if(!i)return[];let a=mTt(e);return[new VS(r,i.left-a.left,i.top-a.top,null,i.bottom-i.top)]}else return Icn(e,r,n)}}function mTt(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==Ta.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function vTt(t,e,r,n){let i=t.coordsAtPos(e,r*2);if(!i)return n;let a=t.dom.getBoundingClientRect(),s=(i.top+i.bottom)/2,o=t.posAtCoords({x:a.left+1,y:s}),l=t.posAtCoords({x:a.right-1,y:s});return o==null||l==null?n:{from:Math.max(n.from,Math.min(o,l)),to:Math.min(n.to,Math.max(o,l))}}function Icn(t,e,r){if(r.to<=t.viewport.from||r.from>=t.viewport.to)return[];let n=Math.max(r.from,t.viewport.from),i=Math.min(r.to,t.viewport.to),a=t.textDirection==Ta.LTR,s=t.contentDOM,o=s.getBoundingClientRect(),l=mTt(t),u=s.querySelector(".cm-line"),h=u&&window.getComputedStyle(u),d=o.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),f=o.right-(h?parseInt(h.paddingRight):0),p=Hxe(t,n,1),g=Hxe(t,i,-1),m=p.type==dc.Text?p:null,v=g.type==dc.Text?g:null;if(m&&(t.lineWrapping||p.widgetLineBreaks)&&(m=vTt(t,n,1,m)),v&&(t.lineWrapping||g.widgetLineBreaks)&&(v=vTt(t,i,-1,v)),m&&v&&m.from==v.from&&m.to==v.to)return b(x(r.from,r.to,m));{let A=m?x(r.from,null,m):w(p,!1),T=v?x(null,r.to,v):w(g,!0),S=[];return(m||p).to<(v||g).from-(m&&v?1:0)||p.widgetLineBreaks>1&&A.bottom+t.defaultLineHeight/2I&&R.from=M)break;B>D&&_(Math.max(F,D),A==null&&F<=I,Math.min(B,M),T==null&&B>=L,N.dir)}if(D=P.to+1,D>=M)break}return E.length==0&&_(I,A==null,L,T==null,t.textDirection),{top:O,bottom:k,horizontal:E}}function w(A,T){let S=o.top+(T?A.top:A.bottom);return{top:S,bottom:S,horizontal:[]}}}function Pcn(t,e){return t.constructor==e.constructor&&t.eq(e)}class Ncn{constructor(e,r){this.view=e,this.layer=r,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),r.above&&this.dom.classList.add("cm-layer-above"),r.class&&this.dom.classList.add(r.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),r.mount&&r.mount(this.dom,e)}update(e){e.startState.facet(YX)!=e.state.facet(YX)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let r=0,n=e.facet(YX);for(;r!Pcn(r,this.drawn[n]))){let r=this.dom.firstChild,n=0;for(let i of e)i.update&&r&&i.constructor&&this.drawn[n].constructor&&i.update(r,this.drawn[n])?(r=r.nextSibling,n++):this.dom.insertBefore(i.draw(),r);for(;r;){let i=r.nextSibling;r.remove(),r=i}this.drawn=e,br.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const YX=vr.define();function yTt(t){return[ws.define(e=>new Ncn(e,t)),YX.of(t)]}const b4=vr.define({combine(t){return u0(t,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,r)=>Math.min(e,r),drawRangeCursor:(e,r)=>e||r})}});function Bcn(t={}){return[b4.of(t),$cn,Fcn,zcn,bAt.of(!0)]}function bTt(t){return t.startState.facet(b4)!=t.state.facet(b4)}const $cn=yTt({above:!0,markers(t){let{state:e}=t,r=e.facet(b4),n=[];for(let i of e.selection.ranges){let a=i==e.selection.main;if(i.empty||r.drawRangeCursor&&!(a&&br.ios&&r.iosSelectionHandles)){let s=a?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",o=i.empty?i:bt.cursor(i.head,i.assoc);for(let l of VS.forRange(t,s,o))n.push(l)}}return n},update(t,e){t.transactions.some(n=>n.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let r=bTt(t);return r&&xTt(t.state,e),t.docChanged||t.selectionSet||r},mount(t,e){xTt(e.state,t)},class:"cm-cursorLayer"});function xTt(t,e){e.style.animationDuration=t.facet(b4).cursorBlinkRate+"ms"}const Fcn=yTt({above:!1,markers(t){let e=[],{main:r,ranges:n}=t.state.selection;for(let i of n)if(!i.empty)for(let a of VS.forRange(t,"cm-selectionBackground",i))e.push(a);if(br.ios&&!r.empty&&t.state.facet(b4).iosSelectionHandles){for(let i of VS.forRange(t,"cm-selectionHandle cm-selectionHandle-start",bt.cursor(r.from,1)))e.push(i);for(let i of VS.forRange(t,"cm-selectionHandle cm-selectionHandle-end",bt.cursor(r.to,1)))e.push(i)}return e},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||bTt(t)},class:"cm-selectionLayer"}),zcn=Fd.highest(er.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),wTt=nn.define({map(t,e){return t==null?null:e.mapPos(t)}}),t$=Vs.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((r,n)=>n.is(wTt)?n.value:r,t)}}),Ucn=ws.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let r=t.state.field(t$);r==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(t$)!=r||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(t$),r=e!=null&&t.coordsAtPos(e);if(!r)return null;let n=t.scrollDOM.getBoundingClientRect();return{left:r.left-n.left+t.scrollDOM.scrollLeft*t.scaleX,top:r.top-n.top+t.scrollDOM.scrollTop*t.scaleY,height:r.bottom-r.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:r}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/r+"px",this.cursor.style.height=t.height/r+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(t$)!=t&&this.view.dispatch({effects:wTt.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Vcn(){return[t$,Ucn]}function ATt(t,e,r,n,i){e.lastIndex=0;for(let a=t.iterRange(r,n),s=r,o;!a.next().done;s+=a.value.length)if(!a.lineBreak)for(;o=e.exec(a.value);)i(s+o.index,o)}function Qcn(t,e){let r=t.visibleRanges;if(r.length==1&&r[0].from==t.viewport.from&&r[0].to==t.viewport.to)return r;let n=[];for(let{from:i,to:a}of r)i=Math.max(t.state.doc.lineAt(i).from,i-e),a=Math.min(t.state.doc.lineAt(a).to,a+e),n.length&&n[n.length-1].to>=i?n[n.length-1].to=a:n.push({from:i,to:a});return n}class Gcn{constructor(e){const{regexp:r,decoration:n,decorate:i,boundary:a,maxLength:s=1e3}=e;if(!r.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=r,i)this.addMatch=(o,l,u,h)=>i(h,u,u+o[0].length,o,l);else if(typeof n=="function")this.addMatch=(o,l,u,h)=>{let d=n(o,l,u);d&&h(u,u+o[0].length,d)};else if(n)this.addMatch=(o,l,u,h)=>h(u,u+o[0].length,n);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=a,this.maxLength=s}createDeco(e){let r=new Lu,n=r.add.bind(r);for(let{from:i,to:a}of Qcn(e,this.maxLength))ATt(e.state.doc,this.regexp,i,a,(s,o)=>this.addMatch(o,e,s,n));return r.finish()}updateDeco(e,r){let n=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((a,s,o,l)=>{l>=e.view.viewport.from&&o<=e.view.viewport.to&&(n=Math.min(o,n),i=Math.max(l,i))}),e.viewportMoved||i-n>1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,r.map(e.changes),n,i):r}updateRange(e,r,n,i){for(let a of e.visibleRanges){let s=Math.max(a.from,n),o=Math.min(a.to,i);if(o>=s){let l=e.state.doc.lineAt(s),u=l.tol.from;s--)if(this.boundary.test(l.text[s-1-l.from])){h=s;break}for(;of.push(y.range(m,v));if(l==u)for(this.regexp.lastIndex=h-l.from;(p=this.regexp.exec(l.text))&&p.indexthis.addMatch(v,e,m,g));r=r.update({filterFrom:h,filterTo:d,filter:(m,v)=>md,add:f})}}return r}}const i2e=/x/.unicode!=null?"gu":"g",Hcn=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,i2e),Wcn={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let a2e=null;function Ycn(){var t;if(a2e==null&&typeof document<"u"&&document.body){let e=document.body.style;a2e=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return a2e||!1}const qX=vr.define({combine(t){let e=u0(t,{render:null,specialChars:Hcn,addSpecialChars:null});return(e.replaceTabs=!Ycn())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,i2e)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,i2e)),e}});function qcn(t={}){return[qX.of(t),jcn()]}let TTt=null;function jcn(){return TTt||(TTt=ws.fromClass(class{constructor(t){this.view=t,this.decorations=Ar.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(qX)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new Gcn({regexp:t.specialChars,decoration:(e,r,n)=>{let{doc:i}=r.state,a=Ph(e[0],0);if(a==9){let s=i.lineAt(n),o=r.state.tabSize,l=hg(s.text,o,n-s.from);return Ar.replace({widget:new Jcn((o-l%o)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[a]||(this.decorationCache[a]=Ar.replace({widget:new Zcn(t,a)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(qX);t.startState.facet(qX)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const Xcn="•";function Kcn(t){return t>=32?Xcn:t==10?"␤":String.fromCharCode(9216+t)}class Zcn extends Iu{constructor(e,r){super(),this.options=e,this.code=r}eq(e){return e.code==this.code}toDOM(e){let r=Kcn(this.code),n=e.state.phrase("Control character")+" "+(Wcn[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,n,r);if(i)return i;let a=document.createElement("span");return a.textContent=r,a.title=n,a.setAttribute("aria-label",n),a.className="cm-specialChar",a}ignoreEvent(){return!1}}class Jcn extends Iu{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function eun(){return run}const tun=Ar.line({class:"cm-activeLine"}),run=ws.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,r=[];for(let n of t.state.selection.ranges){let i=t.lineBlockAt(n.head);i.from>e&&(r.push(tun.range(i.from)),e=i.from)}return Ar.set(r)}},{decorations:t=>t.decorations});class nun extends Iu{constructor(e){super(),this.content=e}toDOM(e){let r=document.createElement("span");return r.className="cm-placeholder",r.style.pointerEvents="none",r.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),r.setAttribute("aria-hidden","true"),r}coordsAt(e){let r=e.firstChild?Y7(e.firstChild):[];if(!r.length)return null;let n=window.getComputedStyle(e.parentNode),i=j7(r[0],n.direction!="rtl"),a=parseInt(n.lineHeight);return i.bottom-i.top>a*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+a}:i}ignoreEvent(){return!1}}function iun(t){let e=ws.fromClass(class{constructor(r){this.view=r,this.placeholder=t?Ar.set([Ar.widget({widget:new nun(t),side:1}).range(0)]):Ar.none}get decorations(){return this.view.state.doc.length?Ar.none:this.placeholder}},{decorations:r=>r.decorations});return typeof t=="string"?[e,er.contentAttributes.of({"aria-placeholder":t})]:e}const s2e=2e3;function aun(t,e,r){let n=Math.min(e.line,r.line),i=Math.max(e.line,r.line),a=[];if(e.off>s2e||r.off>s2e||e.col<0||r.col<0){let s=Math.min(e.off,r.off),o=Math.max(e.off,r.off);for(let l=n;l<=i;l++){let u=t.doc.line(l);u.length<=o&&a.push(bt.range(u.from+s,u.to+o))}}else{let s=Math.min(e.col,r.col),o=Math.max(e.col,r.col);for(let l=n;l<=i;l++){let u=t.doc.line(l),h=yxe(u.text,s,t.tabSize,!0);if(h<0)a.push(bt.cursor(u.to));else{let d=yxe(u.text,o,t.tabSize);a.push(bt.range(u.from+h,u.from+d))}}}return a}function sun(t,e){let r=t.coordsAtPos(t.viewport.from);return r?Math.round(Math.abs((r.left-e)/t.defaultCharacterWidth)):-1}function STt(t,e){let r=t.posAtCoords({x:e.clientX,y:e.clientY},!1),n=t.state.doc.lineAt(r),i=r-n.from,a=i>s2e?-1:i==n.length?sun(t,e.clientX):hg(n.text,t.state.tabSize,r-n.from);return{line:n.number,col:a,off:i}}function oun(t,e){let r=STt(t,e),n=t.state.selection;return r?{update(i){if(i.docChanged){let a=i.changes.mapPos(i.startState.doc.line(r.line).from),s=i.state.doc.lineAt(a);r={line:s.number,col:r.col,off:Math.min(r.off,s.length)},n=n.map(i.changes)}},get(i,a,s){let o=STt(t,i);if(!o)return n;let l=aun(t.state,r,o);return l.length?s?bt.create(l.concat(n.ranges)):bt.create(l):n}}:null}function lun(t){let e=r=>r.altKey&&r.button==0;return er.mouseSelectionStyle.of((r,n)=>e(n)?oun(r,n):null)}const cun={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},uun={style:"cursor: crosshair"};function hun(t={}){let[e,r]=cun[t.key||"Alt"],n=ws.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||r(i))},keyup(i){(i.keyCode==e||!r(i))&&this.set(!1)},mousemove(i){this.set(r(i))}}});return[n,er.contentAttributes.of(i=>{var a;return!((a=i.plugin(n))===null||a===void 0)&&a.isDown?uun:null})]}const jX="-10000px";class CTt{constructor(e,r,n,i){this.facet=r,this.createTooltipView=n,this.removeTooltipView=i,this.input=e.state.facet(r),this.tooltips=this.input.filter(s=>s);let a=null;this.tooltipViews=this.tooltips.map(s=>a=n(s,a))}update(e,r){var n;let i=e.state.facet(this.facet),a=i.filter(l=>l);if(i===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let s=[],o=r?[]:null;for(let l=0;lr[u]=l),r.length=o.length),this.input=i,this.tooltips=a,this.tooltipViews=s,!0}}function dun(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const o2e=vr.define({combine:t=>{var e,r,n;return{position:br.ios?"absolute":((e=t.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((r=t.find(i=>i.parent))===null||r===void 0?void 0:r.parent)||null,tooltipSpace:((n=t.find(i=>i.tooltipSpace))===null||n===void 0?void 0:n.tooltipSpace)||dun}}}),OTt=new WeakMap,l2e=ws.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(o2e);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new CTt(t,c2e,(r,n)=>this.createTooltip(r,n),r=>{this.resizeObserver&&this.resizeObserver.unobserve(r.dom),r.dom.remove()}),this.above=this.manager.tooltips.map(r=>!!r.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(r=>{Date.now()>this.lastTransaction-50&&r.length>0&&r[r.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let r=e||t.geometryChanged,n=t.state.facet(o2e);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;r=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);r=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);r&&this.maybeMeasure()}createTooltip(t,e){let r=t.create(this.view),n=e?e.dom:null;if(r.dom.classList.add("cm-tooltip"),t.arrow&&!r.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",r.dom.appendChild(i)}return r.dom.style.position=this.position,r.dom.style.top=jX,r.dom.style.left="0px",this.container.insertBefore(r.dom,n),r.mount&&r.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(r.dom),r}destroy(){var t,e,r;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),(t=n.destroy)===null||t===void 0||t.call(n);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(r=this.intersectionObserver)===null||r===void 0||r.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,r=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:a}=this.manager.tooltipViews[0];if(br.safari){let s=a.getBoundingClientRect();r=Math.abs(s.top+1e4)>1||Math.abs(s.left)>1}else r=!!a.offsetParent&&a.offsetParent!=this.container.ownerDocument.body}if(r||this.position=="absolute")if(this.parent){let a=this.parent.getBoundingClientRect();a.width&&a.height&&(t=a.width/this.parent.offsetWidth,e=a.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let n=this.view.scrollDOM.getBoundingClientRect(),i=zxe(this.view);return{visible:{left:n.left+i.left,top:n.top+i.top,right:n.right-i.right,bottom:n.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((a,s)=>{let o=this.manager.tooltipViews[s];return o.getCoords?o.getCoords(a.pos):this.view.coordsAtPos(a.pos)}),size:this.manager.tooltipViews.map(({dom:a})=>a.getBoundingClientRect()),space:this.view.state.facet(o2e).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:r}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let o of this.manager.tooltipViews)o.dom.style.position="absolute"}let{visible:r,space:n,scaleX:i,scaleY:a}=t,s=[];for(let o=0;o=Math.min(r.bottom,n.bottom)||d.rightMath.min(r.right,n.right)+.1)){h.style.top=jX;continue}let p=l.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,g=p?7:0,m=f.right-f.left,v=(e=OTt.get(u))!==null&&e!==void 0?e:f.bottom-f.top,y=u.offset||pun,b=this.view.textDirection==Ta.LTR,x=f.width>n.right-n.left?b?n.left:n.right-f.width:b?Math.max(n.left,Math.min(d.left-(p?14:0)+y.x,n.right-m)):Math.min(Math.max(n.left,d.left-m+(p?14:0)-y.x),n.right-m),w=this.above[o];!l.strictSide&&(w?d.top-v-g-y.yn.bottom)&&w==n.bottom-d.bottom>d.top-n.top&&(w=this.above[o]=!w);let A=(w?d.top-n.top:n.bottom-d.bottom)-g;if(Ax&&O.topT&&(T=w?O.top-v-2-g:O.bottom+g+2);if(this.position=="absolute"?(h.style.top=(T-t.parent.top)/a+"px",kTt(h,(x-t.parent.left)/i)):(h.style.top=T/a+"px",kTt(h,x/i)),p){let O=d.left+(b?y.x:-y.x)-(x+14-7);p.style.left=O/i+"px"}u.overlap!==!0&&s.push({left:x,top:T,right:S,bottom:T+v}),h.classList.toggle("cm-tooltip-above",w),h.classList.toggle("cm-tooltip-below",!w),u.positioned&&u.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=jX}},{eventObservers:{scroll(){this.maybeMeasure()}}});function kTt(t,e){let r=parseInt(t.style.left,10);(isNaN(r)||Math.abs(e-r)>1)&&(t.style.left=e+"px")}const fun=er.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),pun={x:0,y:0},c2e=vr.define({enables:[l2e,fun]}),XX=vr.define({combine:t=>t.reduce((e,r)=>e.concat(r),[])});class KX{static create(e){return new KX(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new CTt(e,XX,(r,n)=>this.createHostedView(r,n),r=>r.dom.remove())}createHostedView(e,r){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,r?r.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let r of this.manager.tooltipViews)r.mount&&r.mount(e);this.mounted=!0}positioned(e){for(let r of this.manager.tooltipViews)r.positioned&&r.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let r of this.manager.tooltipViews)(e=r.destroy)===null||e===void 0||e.call(r)}passProp(e){let r;for(let n of this.manager.tooltipViews){let i=n[e];if(i!==void 0){if(r===void 0)r=i;else if(r!==i)return}}return r}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const gun=c2e.compute([XX],t=>{let e=t.facet(XX);return e.length===0?null:{pos:Math.min(...e.map(r=>r.pos)),end:Math.max(...e.map(r=>{var n;return(n=r.end)!==null&&n!==void 0?n:r.pos})),create:KX.create,above:e[0].above,arrow:e.some(r=>r.arrow)}}),ETt=vr.define();class mun{constructor(e,r,n,i,a,s){this.view=e,this.source=r,this.field=n,this.locked=i,this.setHover=a,this.hoverTime=s,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;es.bottom||r.xs.right+e.defaultCharacterWidth)return;let o=e.bidiSpans(e.state.doc.lineAt(i)).find(u=>u.from<=i&&u.to>=i),l=o&&o.dir==Ta.RTL?-1:1;a=r.x{if(o&&!(Array.isArray(o)&&!o.length)){let l=Array.isArray(o)?o:[o];i&&this.locked.set(l,i),e.dispatch({effects:this.setHover.of(l)})}};if(a&&"then"in a){let o=this.pending={pos:r};a.then(l=>{this.pending==o&&(this.pending=null,s(l))},l=>Nh(e.state,l,"hover tooltip"))}else s(a)}get tooltip(){let e=this.view.plugin(l2e),r=e?e.manager.tooltips.findIndex(n=>n.create==KX.create):-1;return r>-1?e.manager.tooltipViews[r]:null}mousemove(e){var r,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:a}=this;if(i.length&&!this.locked.has(i)&&a&&!vun(a.dom,e)||this.pending){let{pos:s}=i[0]||this.pending,o=(n=(r=i[0])===null||r===void 0?void 0:r.end)!==null&&n!==void 0?n:s;(s==o?this.view.posAtCoords(this.lastMove)!=s:!yun(this.view,s,o,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:r}=this;if(r.length&&!this.locked.has(r)){let{tooltip:n}=this;n&&n.dom.contains(e.relatedTarget)?this.watchTooltipLeave(n.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let r=n=>{e.removeEventListener("mouseleave",r);let{active:i}=this;i.length&&!this.locked.has(i)&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",r)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const ZX=4;function vun(t,e){let{left:r,right:n,top:i,bottom:a}=t.getBoundingClientRect(),s;if(s=t.querySelector(".cm-tooltip-arrow")){let o=s.getBoundingClientRect();i=Math.min(o.top,i),a=Math.max(o.bottom,a)}return e.clientX>=r-ZX&&e.clientX<=n+ZX&&e.clientY>=i-ZX&&e.clientY<=a+ZX}function yun(t,e,r,n,i,a){let s=t.scrollDOM.getBoundingClientRect(),o=t.documentTop+t.documentPadding.top+t.contentHeight;if(s.left>n||s.righti||Math.min(s.bottom,o)=e&&l<=r}function bun(t,e={}){let r=nn.define(),n=new WeakMap,i=Vs.define({create(){return[]},update(s,o){let l=n.get(s);if(s.length&&(e.hideOnChange&&(o.docChanged||o.selection)?s=[]:l&&l(o)?s=[]:e.hideOn&&(s=s.filter(u=>!e.hideOn(o,u)))),o.docChanged&&s.length){let u=[];for(let h of s){let d=o.changes.mapPos(h.pos,-1,uc.TrackDel);if(d!=null){let f=Object.assign(Object.create(null),h);f.pos=d,f.end!=null&&(f.end=o.changes.mapPos(f.end)),u.push(f)}}s=u}for(let u of o.effects)u.is(r)&&(s=u.value,l=void 0),(u.is(wun)&&!u.value||u.value==i)&&(s=[]);return s.length&&l&&n.set(s,l),s},provide:s=>XX.from(s)});const a=ws.define(s=>new mun(s,t,i,n,r,e.hoverTime||300));return{active:i,extension:[i,a,ETt.of(a),gun]}}function xun(t,e,r,n={}){var i;let a=t.state.facet(ETt).map(s=>t.plugin(s)).filter(s=>!!s);if(n.tooltip&&n.tooltip.active){let s=a.find(o=>o.field==n.tooltip.active);s&&(a=[s])}for(let s of a)s.activateHover(t,e,r,(i=n.until)!==null&&i!==void 0?i:()=>!1)}function _Tt(t,e){let r=t.plugin(l2e);if(!r)return null;let n=r.manager.tooltips.indexOf(e);return n<0?null:r.manager.tooltipViews[n]}const wun=nn.define(),RTt=vr.define({combine(t){let e,r;for(let n of t)e=e||n.topContainer,r=r||n.bottomContainer;return{topContainer:e,bottomContainer:r}}});function u2e(t,e){let r=t.plugin(DTt),n=r?r.specs.indexOf(e):-1;return n>-1?r.panels[n]:null}const DTt=ws.fromClass(class{constructor(t){this.input=t.state.facet(r$),this.specs=this.input.filter(r=>r),this.panels=this.specs.map(r=>r(t));let e=t.state.facet(RTt);this.top=new JX(t,!0,e.topContainer),this.bottom=new JX(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(r=>r.top)),this.bottom.sync(this.panels.filter(r=>!r.top));for(let r of this.panels)r.dom.classList.add("cm-panel"),r.mount&&r.mount()}update(t){let e=t.state.facet(RTt);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new JX(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new JX(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let r=t.state.facet(r$);if(r!=this.input){let n=r.filter(l=>l),i=[],a=[],s=[],o=[];for(let l of n){let u=this.specs.indexOf(l),h;u<0?(h=l(t.view),o.push(h)):(h=this.panels[u],h.update&&h.update(t)),i.push(h),(h.top?a:s).push(h)}this.specs=n,this.panels=i,this.top.sync(a),this.bottom.sync(s);for(let l of o)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let n of this.panels)n.update&&n.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>er.scrollMargins.of(e=>{let r=e.plugin(t);return r&&{top:r.top.scrollMargin(),bottom:r.bottom.scrollMargin()}})});class JX{constructor(e,r,n){this.view=e,this.top=r,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let r of this.panels)r.destroy&&e.indexOf(r)<0&&r.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let r=this.container||this.view.dom;r.insertBefore(this.dom,this.top?r.firstChild:null)}let e=this.dom.firstChild;for(let r of this.panels)if(r.dom.parentNode==this.dom){for(;e!=r.dom;)e=LTt(e);e=e.nextSibling}else this.dom.insertBefore(r.dom,e);for(;e;)e=LTt(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function LTt(t){let e=t.nextSibling;return t.remove(),e}const r$=vr.define({enables:DTt});function Aun(t,e){let r,n=new Promise(s=>r=s),i=s=>Tun(s,e,r);t.state.field(h2e,!1)?t.dispatch({effects:MTt.of(i)}):t.dispatch({effects:nn.appendConfig.of(h2e.init(()=>[i]))});let a=ITt.of(i);return{close:a,result:n.then(s=>((t.win.queueMicrotask||(l=>t.win.setTimeout(l,10)))(()=>{t.state.field(h2e).indexOf(i)>-1&&t.dispatch({effects:a})}),s))}}const h2e=Vs.define({create(){return[]},update(t,e){for(let r of e.effects)r.is(MTt)?t=[r.value].concat(t):r.is(ITt)&&(t=t.filter(n=>n!=r.value));return t},provide:t=>r$.computeN([t],e=>e.field(t))}),MTt=nn.define(),ITt=nn.define();function Tun(t,e,r){let n=e.content?e.content(t,()=>s(null)):null;if(!n){if(n=fa("form"),e.input){let o=fa("input",e.input);/^(text|password|number|email|tel|url)$/.test(o.type)&&o.classList.add("cm-textfield"),o.name||(o.name="input"),n.appendChild(fa("label",(e.label||"")+": ",o))}else n.appendChild(document.createTextNode(e.label||""));n.appendChild(document.createTextNode(" ")),n.appendChild(fa("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let i=n.nodeName=="FORM"?[n]:n.querySelectorAll("form");for(let o=0;o{u.keyCode==27?(u.preventDefault(),s(null)):u.keyCode==13&&(u.preventDefault(),s(l))}),l.addEventListener("submit",u=>{u.preventDefault(),s(l)})}let a=fa("div",n,fa("button",{onclick:()=>s(null),"aria-label":t.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(a.className=e.class),a.classList.add("cm-dialog");function s(o){a.contains(a.ownerDocument.activeElement)&&t.focus(),r(o)}return{dom:a,top:e.top,mount:()=>{if(e.focus){let o;typeof e.focus=="string"?o=n.querySelector(e.focus):o=n.querySelector("input")||n.querySelector("button"),o&&"select"in o?o.select():o&&"focus"in o&&o.focus()}}}}class ip extends n2{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}ip.prototype.elementClass="",ip.prototype.toDOM=void 0,ip.prototype.mapMode=uc.TrackBefore,ip.prototype.startSide=ip.prototype.endSide=-1,ip.prototype.point=!0;const eK=vr.define(),Sun=vr.define(),Cun={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Zn.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},n$=vr.define();function d2e(t){return[NTt(),n$.of({...Cun,...t})]}const PTt=vr.define({combine:t=>t.some(e=>e)});function NTt(t){return[Oun]}const Oun=ws.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(n$).map(e=>new $Tt(t,e)),this.fixed=!t.state.facet(PTt);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,r=t.view.viewport,n=Math.min(e.to,r.to)-Math.max(e.from,r.from);this.syncGutters(n<(r.to-r.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(PTt)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let r=Zn.iter(this.view.state.facet(eK),this.view.viewport.from),n=[],i=this.gutters.map(a=>new kun(a,this.view.viewport,-this.view.documentPadding.top));for(let a of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(a.type)){let s=!0;for(let o of a.type)if(o.type==dc.Text&&s){f2e(r,n,o.from);for(let l of i)l.line(this.view,o,n);s=!1}else if(o.widget)for(let l of i)l.widget(this.view,o)}else if(a.type==dc.Text){f2e(r,n,a.from);for(let s of i)s.line(this.view,a,n)}else if(a.widget)for(let s of i)s.widget(this.view,a);for(let a of i)a.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(n$),r=t.state.facet(n$),n=t.docChanged||t.heightChanged||t.viewportChanged||!Zn.eq(t.startState.facet(eK),t.state.facet(eK),t.view.viewport.from,t.view.viewport.to);if(e==r)for(let i of this.gutters)i.update(t)&&(n=!0);else{n=!0;let i=[];for(let a of r){let s=e.indexOf(a);s<0?i.push(new $Tt(this.view,a)):(this.gutters[s].update(t),i.push(this.gutters[s]))}for(let a of this.gutters)a.dom.remove(),i.indexOf(a)<0&&a.destroy();for(let a of i)a.config.side=="after"?this.getDOMAfter().appendChild(a.dom):this.dom.appendChild(a.dom);this.gutters=i}return n}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>er.scrollMargins.of(e=>{let r=e.plugin(t);if(!r||r.gutters.length==0||!r.fixed)return null;let n=r.dom.offsetWidth*e.scaleX,i=r.domAfter?r.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Ta.LTR?{left:n,right:i}:{right:n,left:i}})});function BTt(t){return Array.isArray(t)?t:[t]}function f2e(t,e,r){for(;t.value&&t.from<=r;)t.from==r&&e.push(t.value),t.next()}class kun{constructor(e,r,n){this.gutter=e,this.height=n,this.i=0,this.cursor=Zn.iter(e.markers,r.from)}addElement(e,r,n){let{gutter:i}=this,a=(r.top-this.height)/e.scaleY,s=r.height/e.scaleY;if(this.i==i.elements.length){let o=new FTt(e,s,a,n);i.elements.push(o),i.dom.appendChild(o.dom)}else i.elements[this.i].update(e,s,a,n);this.height=r.bottom,this.i++}line(e,r,n){let i=[];f2e(this.cursor,i,r.from),n.length&&(i=i.concat(n));let a=this.gutter.config.lineMarker(e,r,i);a&&i.unshift(a);let s=this.gutter;i.length==0&&!s.config.renderEmptyElements||this.addElement(e,r,i)}widget(e,r){let n=this.gutter.config.widgetMarker(e,r.widget,r),i=n?[n]:null;for(let a of e.state.facet(Sun)){let s=a(e,r.widget,r);s&&(i||(i=[])).push(s)}i&&this.addElement(e,r,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let r=e.elements.pop();e.dom.removeChild(r.dom),r.destroy()}}}class $Tt{constructor(e,r){this.view=e,this.config=r,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in r.domEventHandlers)this.dom.addEventListener(n,i=>{let a=i.target,s;if(a!=this.dom&&this.dom.contains(a)){for(;a.parentNode!=this.dom;)a=a.parentNode;let l=a.getBoundingClientRect();s=(l.top+l.bottom)/2}else s=i.clientY;let o=e.lineBlockAtHeight(s-e.documentTop);r.domEventHandlers[n](e,o,i)&&i.preventDefault()});this.markers=BTt(r.markers(e)),r.initialSpacer&&(this.spacer=new FTt(e,0,0,[r.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let r=this.markers;if(this.markers=BTt(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let n=e.view.viewport;return!Zn.eq(this.markers,r,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class FTt{constructor(e,r,n,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,r,n,i)}update(e,r,n,i){this.height!=r&&(this.height=r,this.dom.style.height=r+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),Eun(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,r){let n="cm-gutterElement",i=this.dom.firstChild;for(let a=0,s=0;;){let o=s,l=aa(o,l,u)||s(o,l,u):s}return n}})}});class p2e extends ip{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function g2e(t,e){return t.state.facet(x4).formatNumber(e,t.state)}const Dun=n$.compute([x4],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(_un)},lineMarker(e,r,n){return n.some(i=>i.toDOM)?null:new p2e(g2e(e,e.state.doc.lineAt(r.from).number))},widgetMarker:(e,r,n)=>{for(let i of e.state.facet(Run)){let a=i(e,r,n);if(a)return a}return null},lineMarkerChange:e=>e.startState.facet(x4)!=e.state.facet(x4),initialSpacer(e){return new p2e(g2e(e,UTt(e.state.doc.lines)))},updateSpacer(e,r){let n=g2e(r.view,UTt(r.view.state.doc.lines));return n==e.number?e:new p2e(n)},domEventHandlers:t.facet(x4).domEventHandlers,side:"before"}));function zTt(t={}){return[x4.of(t),NTt(),Dun]}function UTt(t){let e=9;for(;e{let e=[],r=-1;for(let n of t.selection.ranges){let i=t.doc.lineAt(n.head).from;i>r&&(r=i,e.push(Lun.range(i)))}return Zn.of(e)});function Iun(){return Mun}let Pun=0,p0=class ELe{constructor(e,r,n,i){this.name=e,this.set=r,this.base=n,this.modified=i,this.id=Pun++}toString(){let{name:e}=this;for(let r of this.modified)r.name&&(e=`${r.name}(${e})`);return e}static define(e,r){let n=typeof e=="string"?e:"?";if(e instanceof ELe&&(r=e),r!=null&&r.base)throw new Error("Can not derive from a modified tag");let i=new ELe(n,[],null,[]);if(i.set.push(i),r)for(let a of r.set)i.set.push(a);return i}static defineModifier(e){let r=new tK(e);return n=>n.modified.indexOf(r)>-1?n:tK.get(n.base||n,n.modified.concat(r).sort((i,a)=>i.id-a.id))}},Nun=0;class tK{constructor(e){this.name=e,this.instances=[],this.id=Nun++}static get(e,r){if(!r.length)return e;let n=r[0].instances.find(o=>o.base==e&&Bun(r,o.modified));if(n)return n;let i=[],a=new p0(e.name,i,e,r);for(let o of r)o.instances.push(a);let s=$un(r);for(let o of e.set)if(!o.modified.length)for(let l of s)i.push(tK.get(o,l));return a}}function Bun(t,e){return t.length==e.length&&t.every((r,n)=>r==e[n])}function $un(t){let e=[[]];for(let r=0;rn.length-r.length)}function qy(t){let e=Object.create(null);for(let r in t){let n=t[r];Array.isArray(n)||(n=[n]);for(let i of r.split(" "))if(i){let a=[],s=2,o=i;for(let d=0;;){if(o=="..."&&d>0&&d+3==i.length){s=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!f)throw new RangeError("Invalid path: "+i);if(a.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),d+=f[0].length,d==i.length)break;let p=i[d++];if(d==i.length&&p=="!"){s=0;break}if(p!="/")throw new RangeError("Invalid path: "+i);o=i.slice(d)}let l=a.length-1,u=a[l];if(!u)throw new RangeError("Invalid path: "+i);let h=new i$(n,s,l>0?a.slice(0,l):null);e[u]=h.sort(e[u])}}return VTt.add(e)}const VTt=new En({combine(t,e){let r,n,i;for(;t||e;){if(!t||e&&t.depth>=e.depth?(i=e,e=e.next):(i=t,t=t.next),r&&r.mode==i.mode&&!i.context&&!r.context)continue;let a=new i$(i.tags,i.mode,i.context);r?r.next=a:n=a,r=a}return n}});let i$=class{constructor(e,r,n,i){this.tags=e,this.mode=r,this.context=n,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let s=i;for(let o of a)for(let l of o.set){let u=r[l.id];if(u){s=s?s+" "+u:u;break}}return s},scope:n}}function Fun(t,e){let r=null;for(let n of t){let i=n.style(e);i&&(r=r?r+" "+i:i)}return r}function GTt(t,e,r,n=0,i=t.length){let a=new zun(n,Array.isArray(e)?e:[e],r);a.highlightRange(t.cursor(),n,i,"",a.highlighters),a.flush(i)}class zun{constructor(e,r,n){this.at=e,this.highlighters=r,this.span=n,this.class=""}startSpan(e,r){r!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=r)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,r,n,i,a){let{type:s,from:o,to:l}=e;if(o>=n||l<=r)return;s.isTop&&(a=this.highlighters.filter(p=>!p.scope||p.scope(s)));let u=i,h=Uun(e)||i$.empty,d=Fun(a,h.tags);if(d&&(u&&(u+=" "),u+=d,h.mode==1&&(i+=(i?" ":"")+d)),this.startSpan(Math.max(r,o),u),h.opaque)return;let f=e.tree&&e.tree.prop(En.mounted);if(f&&f.overlay){let p=e.node.enter(f.overlay[0].from+o,1),g=this.highlighters.filter(v=>!v.scope||v.scope(f.tree.type)),m=e.firstChild();for(let v=0,y=o;;v++){let b=v=x||!e.nextSibling())););if(!b||x>n)break;y=b.to+o,y>r&&(this.highlightRange(p.cursor(),Math.max(r,b.from+o),Math.min(n,y),"",g),this.startSpan(Math.min(n,y),u))}m&&e.parent()}else if(e.firstChild()){f&&(i="");do if(!(e.to<=r)){if(e.from>=n)break;this.highlightRange(e,r,n,i,a),this.startSpan(Math.min(n,e.to),u)}while(e.nextSibling());e.parent()}}}function Uun(t){let e=t.type.prop(VTt);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const hr=p0.define,rK=hr(),o2=hr(),HTt=hr(o2),WTt=hr(o2),l2=hr(),nK=hr(l2),m2e=hr(l2),g0=hr(),QS=hr(g0),m0=hr(),v0=hr(),v2e=hr(),a$=hr(v2e),iK=hr(),Ee={comment:rK,lineComment:hr(rK),blockComment:hr(rK),docComment:hr(rK),name:o2,variableName:hr(o2),typeName:HTt,tagName:hr(HTt),propertyName:WTt,attributeName:hr(WTt),className:hr(o2),labelName:hr(o2),namespace:hr(o2),macroName:hr(o2),literal:l2,string:nK,docString:hr(nK),character:hr(nK),attributeValue:hr(nK),number:m2e,integer:hr(m2e),float:hr(m2e),bool:hr(l2),regexp:hr(l2),escape:hr(l2),color:hr(l2),url:hr(l2),keyword:m0,self:hr(m0),null:hr(m0),atom:hr(m0),unit:hr(m0),modifier:hr(m0),operatorKeyword:hr(m0),controlKeyword:hr(m0),definitionKeyword:hr(m0),moduleKeyword:hr(m0),operator:v0,derefOperator:hr(v0),arithmeticOperator:hr(v0),logicOperator:hr(v0),bitwiseOperator:hr(v0),compareOperator:hr(v0),updateOperator:hr(v0),definitionOperator:hr(v0),typeOperator:hr(v0),controlOperator:hr(v0),punctuation:v2e,separator:hr(v2e),bracket:a$,angleBracket:hr(a$),squareBracket:hr(a$),paren:hr(a$),brace:hr(a$),content:g0,heading:QS,heading1:hr(QS),heading2:hr(QS),heading3:hr(QS),heading4:hr(QS),heading5:hr(QS),heading6:hr(QS),contentSeparator:hr(g0),list:hr(g0),quote:hr(g0),emphasis:hr(g0),strong:hr(g0),link:hr(g0),monospace:hr(g0),strikethrough:hr(g0),inserted:hr(),deleted:hr(),changed:hr(),invalid:hr(),meta:iK,documentMeta:hr(iK),annotation:hr(iK),processingInstruction:hr(iK),definition:p0.defineModifier("definition"),constant:p0.defineModifier("constant"),function:p0.defineModifier("function"),standard:p0.defineModifier("standard"),local:p0.defineModifier("local"),special:p0.defineModifier("special")};for(let t in Ee){let e=Ee[t];e instanceof p0&&(e.name=t)}QTt([{tag:Ee.link,class:"tok-link"},{tag:Ee.heading,class:"tok-heading"},{tag:Ee.emphasis,class:"tok-emphasis"},{tag:Ee.strong,class:"tok-strong"},{tag:Ee.keyword,class:"tok-keyword"},{tag:Ee.atom,class:"tok-atom"},{tag:Ee.bool,class:"tok-bool"},{tag:Ee.url,class:"tok-url"},{tag:Ee.labelName,class:"tok-labelName"},{tag:Ee.inserted,class:"tok-inserted"},{tag:Ee.deleted,class:"tok-deleted"},{tag:Ee.literal,class:"tok-literal"},{tag:Ee.string,class:"tok-string"},{tag:Ee.number,class:"tok-number"},{tag:[Ee.regexp,Ee.escape,Ee.special(Ee.string)],class:"tok-string2"},{tag:Ee.variableName,class:"tok-variableName"},{tag:Ee.local(Ee.variableName),class:"tok-variableName tok-local"},{tag:Ee.definition(Ee.variableName),class:"tok-variableName tok-definition"},{tag:Ee.special(Ee.variableName),class:"tok-variableName2"},{tag:Ee.definition(Ee.propertyName),class:"tok-propertyName tok-definition"},{tag:Ee.typeName,class:"tok-typeName"},{tag:Ee.namespace,class:"tok-namespace"},{tag:Ee.className,class:"tok-className"},{tag:Ee.macroName,class:"tok-macroName"},{tag:Ee.propertyName,class:"tok-propertyName"},{tag:Ee.operator,class:"tok-operator"},{tag:Ee.comment,class:"tok-comment"},{tag:Ee.meta,class:"tok-meta"},{tag:Ee.invalid,class:"tok-invalid"},{tag:Ee.punctuation,class:"tok-punctuation"}]);var y2e;const c2=new En;function aK(t){return vr.define({combine:t?e=>e.concat(t):void 0})}const b2e=new En;class Ud{constructor(e,r,n=[],i=""){this.data=e,this.name=i,Kn.prototype.hasOwnProperty("tree")||Object.defineProperty(Kn.prototype,"tree",{get(){return pa(this)}}),this.parser=r,this.extension=[Xy.of(this),Kn.languageData.of((a,s,o)=>{let l=YTt(a,s,o),u=l.type.prop(c2);if(!u)return[];let h=a.facet(u),d=l.type.prop(b2e);if(d){let f=l.resolve(s-l.from,o);for(let p of d)if(p.test(f,a)){let g=a.facet(p.facet);return p.type=="replace"?g:g.concat(h)}}return h})].concat(n)}isActiveAt(e,r,n=-1){return YTt(e,r,n).type.prop(c2)==this.data}findRegions(e){let r=e.facet(Xy);if((r==null?void 0:r.data)==this.data)return[{from:0,to:e.doc.length}];if(!r||!r.allowsNesting)return[];let n=[],i=(a,s)=>{if(a.prop(c2)==this.data){n.push({from:s,to:s+a.length});return}let o=a.prop(En.mounted);if(o){if(o.tree.prop(c2)==this.data){if(o.overlay)for(let l of o.overlay)n.push({from:l.from+s,to:l.to+s});else n.push({from:s,to:s+a.length});return}else if(o.overlay){let l=n.length;if(i(o.tree,o.overlay[0].from+s),n.length>l)return}}for(let l=0;ln.isTop?r:void 0)]}),e.name)}configure(e,r){return new jy(this.data,this.parser.configure(e),r||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function pa(t){let e=t.field(Ud.state,!1);return e?e.tree:si.empty}class Vun{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,r){let n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,r):this.string.slice(e-n,r-n)}}let s$=null;class GS{constructor(e,r,n=[],i,a,s,o,l){this.parser=e,this.state=r,this.fragments=n,this.tree=i,this.treeLen=a,this.viewport=s,this.skipped=o,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,r,n){return new GS(e,r,[],si.empty,0,n,[],null)}startParse(){return this.parser.startParse(new Vun(this.state.doc),this.fragments)}work(e,r){return r!=null&&r>=this.state.doc.length&&(r=void 0),this.tree!=si.empty&&this.isDone(r??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),r!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>r)&&r=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(r=this.parse.advance()););}),this.treeLen=e,this.tree=r,this.fragments=this.withoutTempSkipped(Qy.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let r=s$;s$=this;try{return e()}finally{s$=r}}withoutTempSkipped(e){for(let r;r=this.tempSkipped.pop();)e=qTt(e,r.from,r.to);return e}changes(e,r){let{fragments:n,tree:i,treeLen:a,viewport:s,skipped:o}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((u,h,d,f)=>l.push({fromA:u,toA:h,fromB:d,toB:f})),n=Qy.applyChanges(n,l),i=si.empty,a=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){o=[];for(let u of this.skipped){let h=e.mapPos(u.from,1),d=e.mapPos(u.to,-1);he.from&&(this.fragments=qTt(this.fragments,i,a),this.skipped.splice(n--,1))}return this.skipped.length>=r?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,r){this.skipped.push({from:e,to:r})}static getSkippingParser(e){return new class extends mX{createParse(r,n,i){let a=i[0].from,s=i[i.length-1].to;return{parsedPos:a,advance(){let l=s$;if(l){for(let u of i)l.tempSkipped.push(u);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=s,new si(Ro.none,[],[],s-a)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let r=this.fragments;return this.treeLen>=e&&r.length&&r[0].from==0&&r[0].to>=e}static get(){return s$}}function qTt(t,e,r){return Qy.applyChanges(t,[{fromA:e,toA:r,fromB:e,toB:r}])}class w4{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let r=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),r.viewport.to);return r.work(20,n)||r.takeTree(),new w4(r)}static init(e){let r=Math.min(3e3,e.doc.length),n=GS.create(e.facet(Xy).parser,e,{from:0,to:r});return n.work(20,r)||n.takeTree(),new w4(n)}}Ud.state=Vs.define({create:w4.init,update(t,e){for(let r of e.effects)if(r.is(Ud.setState))return r.value;return e.startState.facet(Xy)!=e.state.facet(Xy)?w4.init(e.state):t.apply(e)}});let jTt=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(jTt=t=>{let e=-1,r=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(r):cancelIdleCallback(e)});const x2e=typeof navigator<"u"&&(!((y2e=navigator.scheduling)===null||y2e===void 0)&&y2e.isInputPending)?()=>navigator.scheduling.isInputPending():null,Qun=ws.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let r=this.view.state.field(Ud.state).context;(r.updateViewport(e.view.viewport)||this.view.viewport.to>r.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(r)}scheduleWork(){if(this.working)return;let{state:e}=this.view,r=e.field(Ud.state);(r.tree!=r.context.tree||!r.context.isDone(e.doc.length))&&(this.working=jTt(this.work))}work(e){this.working=null;let r=Date.now();if(this.chunkEndi+1e3,l=a.context.work(()=>x2e&&x2e()||Date.now()>s,i+(o?0:1e5));this.chunkBudget-=Date.now()-r,(l||this.chunkBudget<=0)&&(a.context.takeTree(),this.view.dispatch({effects:Ud.setState.of(new w4(a.context))})),this.chunkBudget>0&&!(l&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(a.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(r=>Nh(this.view.state,r)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Xy=vr.define({combine(t){return t.length?t[0]:null},enables:t=>[Ud.state,Qun,er.contentAttributes.compute([t],e=>{let r=e.facet(t);return r&&r.name?{"data-language":r.name}:{}})]});class u2{constructor(e,r=[]){this.language=e,this.support=r,this.extension=[e,r]}}class sK{constructor(e,r,n,i,a,s=void 0){this.name=e,this.alias=r,this.extensions=n,this.filename=i,this.loadFunc=a,this.support=s,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:r,support:n}=e;if(!r){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");r=()=>Promise.resolve(n)}return new sK(e.name,(e.alias||[]).concat(e.name).map(i=>i.toLowerCase()),e.extensions||[],e.filename,r,n)}static matchFilename(e,r){for(let i of e)if(i.filename&&i.filename.test(r))return i;let n=/\.([^.]+)$/.exec(r);if(n){for(let i of e)if(i.extensions.indexOf(n[1])>-1)return i}return null}static matchLanguageName(e,r,n=!0){r=r.toLowerCase();for(let i of e)if(i.alias.some(a=>a==r))return i;if(n)for(let i of e)for(let a of i.alias){let s=r.indexOf(a);if(s>-1&&(a.length>2||!/\w/.test(r[s-1])&&!/\w/.test(r[s+a.length])))return i}return null}}const Gun=vr.define(),A4=vr.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(r=>r!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function HS(t){let e=t.facet(A4);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function o$(t,e){let r="",n=t.tabSize,i=t.facet(A4)[0];if(i==" "){for(;e>=n;)r+=" ",e-=n;i=" "}for(let a=0;a=e?Hun(t,r,e):null}class oK{constructor(e,r={}){this.state=e,this.options=r,this.unit=HS(e)}lineAt(e,r=1){let n=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:a}=this.options;return i!=null&&i>=n.from&&i<=n.to?a&&i==e?{text:"",from:e}:(r<0?i-1&&(a+=s-this.countColumn(n,n.search(/\S|$/))),a}countColumn(e,r=e.length){return hg(e,this.state.tabSize,r)}lineIndent(e,r=1){let{text:n,from:i}=this.lineAt(e,r),a=this.options.overrideIndentation;if(a){let s=a(i);if(s>-1)return s}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Ky=new En;function Hun(t,e,r){let n=e.resolveStack(r),i=e.resolveInner(r,-1).resolve(r,0).enterUnfinishedNodesBefore(r);if(i!=n.node){let a=[];for(let s=i;s&&!(s.fromn.node.to||s.from==n.node.from&&s.type==n.node.type);s=s.parent)a.push(s);for(let s=a.length-1;s>=0;s--)n={node:a[s],next:n}}return XTt(n,t,r)}function XTt(t,e,r){for(let n=t;n;n=n.next){let i=Yun(n.node);if(i)return i(A2e.create(e,r,n))}return 0}function Wun(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function Yun(t){let e=t.type.prop(Ky);if(e)return e;let r=t.firstChild,n;if(r&&(n=r.type.prop(En.closedBy))){let i=t.lastChild,a=i&&n.indexOf(i.name)>-1;return s=>KTt(s,!0,1,void 0,a&&!Wun(s)?i.from:void 0)}return t.parent==null?qun:null}function qun(){return 0}class A2e extends oK{constructor(e,r,n){super(e.state,e.options),this.base=e,this.pos=r,this.context=n}get node(){return this.context.node}static create(e,r,n){return new A2e(e,r,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let r=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(r.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(jun(n,e))break;r=this.state.doc.lineAt(n.from)}return this.lineIndent(r.from)}continue(){return XTt(this.context.next,this.base,this.pos)}}function jun(t,e){for(let r=e;r;r=r.parent)if(t==r)return!0;return!1}function Xun(t){let e=t.node,r=e.childAfter(e.from),n=e.lastChild;if(!r)return null;let i=t.options.simulateBreak,a=t.state.doc.lineAt(r.from),s=i==null||i<=a.from?a.to:Math.min(a.to,i);for(let o=r.to;;){let l=e.childAfter(o);if(!l||l==n)return null;if(!l.type.isSkipped){if(l.from>=s)return null;let u=/^ */.exec(a.text.slice(r.to-a.from))[0].length;return{from:r.from,to:r.to+u}}o=l.to}}function T4({closing:t,align:e=!0,units:r=1}){return n=>KTt(n,e,r,t)}function KTt(t,e,r,n,i){let a=t.textAfter,s=a.match(/^\s*/)[0].length,o=n&&a.slice(s,s+n.length)==n||i==t.pos+s,l=e?Xun(t):null;return l?o?t.column(l.from):t.column(l.to):t.baseIndent+(o?0:t.unit*r)}const Kun=t=>t.baseIndent;function S4({except:t,units:e=1}={}){return r=>{let n=t&&t.test(r.textAfter);return r.baseIndent+(n?0:e*r.unit)}}const Zun=200;function Jun(){return Kn.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let r=t.newDoc,{head:n}=t.newSelection.main,i=r.lineAt(n);if(n>i.from+Zun)return t;let a=r.sliceString(i.from,n);if(!e.some(u=>u.test(a)))return t;let{state:s}=t,o=-1,l=[];for(let{head:u}of s.selection.ranges){let h=s.doc.lineAt(u);if(h.from==o)continue;o=h.from;let d=w2e(s,h.from);if(d==null)continue;let f=/^\s*/.exec(h.text)[0],p=o$(s,d);f!=p&&l.push({from:h.from,to:h.from+f.length,insert:p})}return l.length?[t,{changes:l,sequential:!0}]:t})}const ZTt=vr.define(),Zy=new En;function l$(t){let e=t.firstChild,r=t.lastChild;return e&&e.tor)continue;if(a&&o.from=e&&u.to>r&&(a=u)}}return a}function thn(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function lK(t,e,r){for(let n of t.facet(ZTt)){let i=n(t,e,r);if(i)return i}return ehn(t,e,r)}function JTt(t,e){let r=e.mapPos(t.from,1),n=e.mapPos(t.to,-1);return r>=n?void 0:{from:r,to:n}}const cK=nn.define({map:JTt}),c$=nn.define({map:JTt});function eSt(t){let e=[];for(let{head:r}of t.state.selection.ranges)e.some(n=>n.from<=r&&n.to>=r)||e.push(t.lineBlockAt(r));return e}const WS=Vs.define({create(){return Ar.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,i)=>t=tSt(t,n,i)),t=t.map(e.changes);let r=[];for(let n of e.effects)n.is(cK)&&!rhn(t,n.value.from,n.value.to)?r.push(n.value):n.is(c$)&&(t=t.update({filter:(i,a)=>n.value.from!=i||n.value.to!=a,filterFrom:n.value.from,filterTo:n.value.to}));if(r.length){let{preparePlaceholder:n}=e.state.facet(iSt),i=r.map(a=>(n?Ar.replace({widget:new ohn(n(e.state,a))}):oSt).range(a.from,a.to));t=t.update({add:i})}return e.selection&&(t=tSt(t,e.selection.main.head)),t},provide:t=>er.decorations.from(t),toJSON(t,e){let r=[];return t.between(0,e.doc.length,(n,i)=>{r.push(n,i)}),r},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let r=0;r{ie&&(n=!0)}),n?t.update({filterFrom:e,filterTo:r,filter:(i,a)=>i>=r||a<=e}):t}function uK(t,e,r){var n;let i=null;return(n=t.field(WS,!1))===null||n===void 0||n.between(e,r,(a,s)=>{(!i||i.from>a)&&(i={from:a,to:s})}),i}function rhn(t,e,r){let n=!1;return t.between(e,e,(i,a)=>{i==e&&a==r&&(n=!0)}),n}function rSt(t,e){return t.field(WS,!1)?e:e.concat(nn.appendConfig.of(aSt()))}const nhn=t=>{for(let e of eSt(t)){let r=lK(t.state,e.from,e.to);if(r)return t.dispatch({effects:rSt(t.state,[cK.of(r),nSt(t,r)])}),!0}return!1},ihn=t=>{if(!t.state.field(WS,!1))return!1;let e=[];for(let r of eSt(t)){let n=uK(t.state,r.from,r.to);n&&e.push(c$.of(n),nSt(t,n,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function nSt(t,e,r=!0){let n=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return er.announce.of(`${t.state.phrase(r?"Folded lines":"Unfolded lines")} ${n} ${t.state.phrase("to")} ${i}.`)}const ahn=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:nhn},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:ihn},{key:"Ctrl-Alt-[",run:t=>{let{state:e}=t,r=[];for(let n=0;n{let e=t.state.field(WS,!1);if(!e||!e.size)return!1;let r=[];return e.between(0,t.state.doc.length,(n,i)=>{r.push(c$.of({from:n,to:i}))}),t.dispatch({effects:r}),!0}}],shn={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},iSt=vr.define({combine(t){return u0(t,shn)}});function aSt(t){return[WS,uhn]}function sSt(t,e){let{state:r}=t,n=r.facet(iSt),i=s=>{let o=t.lineBlockAt(t.posAtDOM(s.target)),l=uK(t.state,o.from,o.to);l&&t.dispatch({effects:c$.of(l)}),s.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(t,i,e);let a=document.createElement("span");return a.textContent=n.placeholderText,a.setAttribute("aria-label",r.phrase("folded code")),a.title=r.phrase("unfold"),a.className="cm-foldPlaceholder",a.onclick=i,a}const oSt=Ar.replace({widget:new class extends Iu{toDOM(t){return sSt(t,null)}}});class ohn extends Iu{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return sSt(e,this.value)}}const lhn={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class T2e extends ip{constructor(e,r){super(),this.config=e,this.open=r}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let r=document.createElement("span");return r.textContent=this.open?this.config.openText:this.config.closedText,r.title=e.state.phrase(this.open?"Fold line":"Unfold line"),r}}function chn(t={}){let e={...lhn,...t},r=new T2e(e,!0),n=new T2e(e,!1),i=ws.fromClass(class{constructor(s){this.from=s.viewport.from,this.markers=this.buildMarkers(s)}update(s){(s.docChanged||s.viewportChanged||s.startState.facet(Xy)!=s.state.facet(Xy)||s.startState.field(WS,!1)!=s.state.field(WS,!1)||pa(s.startState)!=pa(s.state)||e.foldingChanged(s))&&(this.markers=this.buildMarkers(s.view))}buildMarkers(s){let o=new Lu;for(let l of s.viewportLineBlocks){let u=uK(s.state,l.from,l.to)?n:lK(s.state,l.from,l.to)?r:null;u&&o.add(l.from,l.from,u)}return o.finish()}}),{domEventHandlers:a}=e;return[i,d2e({class:"cm-foldGutter",markers(s){var o;return((o=s.plugin(i))===null||o===void 0?void 0:o.markers)||Zn.empty},initialSpacer(){return new T2e(e,!1)},domEventHandlers:{...a,click:(s,o,l)=>{if(a.click&&a.click(s,o,l))return!0;let u=uK(s.state,o.from,o.to);if(u)return s.dispatch({effects:c$.of(u)}),!0;let h=lK(s.state,o.from,o.to);return h?(s.dispatch({effects:cK.of(h)}),!0):!1}}}),aSt()]}const uhn=er.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class u${constructor(e,r){this.specs=e;let n;function i(o){let l=Gy.newName();return(n||(n=Object.create(null)))["."+l]=o,l}const a=typeof r.all=="string"?r.all:r.all?i(r.all):void 0,s=r.scope;this.scope=s instanceof Ud?o=>o.prop(c2)==s.data:s?o=>o==s:void 0,this.style=QTt(e.map(o=>({tag:o.tag,class:o.class||i(Object.assign({},o,{tag:null}))})),{all:a}).style,this.module=n?new Gy(n):null,this.themeType=r.themeType}static define(e,r){return new u$(e,r||{})}}const S2e=vr.define(),lSt=vr.define({combine(t){return t.length?[t[0]]:null}});function hK(t){let e=t.facet(S2e);return e.length?e:t.facet(lSt)}function cSt(t,e){let r=[fhn],n;return t instanceof u$&&(t.module&&r.push(er.styleModule.of(t.module)),n=t.themeType),e!=null&&e.fallback?r.push(lSt.of(t)):n?r.push(S2e.computeN([er.darkTheme],i=>i.facet(er.darkTheme)==(n=="dark")?[t]:[])):r.push(S2e.of(t)),r}function hhn(t,e,r){let n=hK(t),i=null;if(n){for(let a of n)if(!a.scope||r){let s=a.style(e);s&&(i=i?i+" "+s:s)}}return i}class dhn{constructor(e){this.markCache=Object.create(null),this.tree=pa(e.state),this.decorations=this.buildDeco(e,hK(e.state)),this.decoratedTo=e.viewport.to}update(e){let r=pa(e.state),n=hK(e.state),i=n!=hK(e.startState),{viewport:a}=e.view,s=e.changes.mapPos(this.decoratedTo,1);r.length=a.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=s):(r!=this.tree||e.viewportChanged||i)&&(this.tree=r,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=a.to)}buildDeco(e,r){if(!r||!this.tree.length)return Ar.none;let n=new Lu;for(let{from:i,to:a}of e.visibleRanges)GTt(this.tree,r,(s,o,l)=>{n.add(s,o,this.markCache[l]||(this.markCache[l]=Ar.mark({class:l})))},i,a);return n.finish()}}const fhn=Fd.high(ws.fromClass(dhn,{decorations:t=>t.decorations})),phn=u$.define([{tag:Ee.meta,color:"#404740"},{tag:Ee.link,textDecoration:"underline"},{tag:Ee.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Ee.emphasis,fontStyle:"italic"},{tag:Ee.strong,fontWeight:"bold"},{tag:Ee.strikethrough,textDecoration:"line-through"},{tag:Ee.keyword,color:"#708"},{tag:[Ee.atom,Ee.bool,Ee.url,Ee.contentSeparator,Ee.labelName],color:"#219"},{tag:[Ee.literal,Ee.inserted],color:"#164"},{tag:[Ee.string,Ee.deleted],color:"#a11"},{tag:[Ee.regexp,Ee.escape,Ee.special(Ee.string)],color:"#e40"},{tag:Ee.definition(Ee.variableName),color:"#00f"},{tag:Ee.local(Ee.variableName),color:"#30a"},{tag:[Ee.typeName,Ee.namespace],color:"#085"},{tag:Ee.className,color:"#167"},{tag:[Ee.special(Ee.variableName),Ee.macroName],color:"#256"},{tag:Ee.definition(Ee.propertyName),color:"#00c"},{tag:Ee.comment,color:"#940"},{tag:Ee.invalid,color:"#f00"}]),ghn=er.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),uSt=1e4,hSt="()[]{}",dSt=vr.define({combine(t){return u0(t,{afterCursor:!0,brackets:hSt,maxScanDistance:uSt,renderMatch:yhn})}}),mhn=Ar.mark({class:"cm-matchingBracket"}),vhn=Ar.mark({class:"cm-nonmatchingBracket"});function yhn(t){let e=[],r=t.matched?mhn:vhn;return e.push(r.range(t.start.from,t.start.to)),t.end&&e.push(r.range(t.end.from,t.end.to)),e}function fSt(t){let e=[],r=t.facet(dSt);for(let n of t.selection.ranges){if(!n.empty)continue;let i=y0(t,n.head,-1,r)||n.head>0&&y0(t,n.head-1,1,r)||r.afterCursor&&(y0(t,n.head,1,r)||n.headt.decorations}),ghn];function xhn(t={}){return[dSt.of(t),bhn]}const pSt=new En;function C2e(t,e,r){let n=t.prop(e<0?En.openedBy:En.closedBy);if(n)return n;if(t.name.length==1){let i=r.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[r[i+e]]}return null}function O2e(t){let e=t.type.prop(pSt);return e?e(t.node):t}function y0(t,e,r,n={}){let i=n.maxScanDistance||uSt,a=n.brackets||hSt,s=pa(t),o=s.resolveInner(e,r);for(let l=o;l;l=l.parent){let u=C2e(l.type,r,a);if(u&&l.from0?e>=h.from&&eh.from&&e<=h.to))return whn(t,e,r,l,h,u,a)}}return Ahn(t,e,r,s,o.type,i,a)}function whn(t,e,r,n,i,a,s){let o=n.parent,l={from:i.from,to:i.to},u=0,h=o==null?void 0:o.cursor();if(h&&(r<0?h.childBefore(n.from):h.childAfter(n.to)))do if(r<0?h.to<=n.from:h.from>=n.to){if(u==0&&a.indexOf(h.type.name)>-1&&h.from0)return null;let u={from:r<0?e-1:e,to:r>0?e+1:e},h=t.doc.iterRange(e,r>0?t.doc.length:0),d=0;for(let f=0;!h.next().done&&f<=a;){let p=h.value;r<0&&(f+=p.length);let g=e+f*r;for(let m=r>0?0:p.length-1,v=r>0?p.length:-1;m!=v;m+=r){let y=s.indexOf(p[m]);if(!(y<0||n.resolveInner(g+m,1).type!=i))if(y%2==0==r>0)d++;else{if(d==1)return{start:u,end:{from:g+m,to:g+m+1},matched:y>>1==l>>1};d--}}r>0&&(f+=p.length)}return h.done?{start:u,matched:!1}:null}function gSt(t,e,r,n=0,i=0){e==null&&(e=t.search(/[^\s\u00a0]/),e==-1&&(e=t.length));let a=i;for(let s=n;s=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.posr}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let r=this.string.indexOf(e,this.pos);if(r>-1)return this.pos=r,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosn?s.toLowerCase():s,a=this.string.substr(this.pos,e.length);return i(a)==i(e)?(r!==!1&&(this.pos+=e.length),!0):null}else{let i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&r!==!1&&(this.pos+=i[0].length),i)}}current(){return this.string.slice(this.start,this.pos)}}function Thn(t){return{name:t.name||"",token:t.token,blankLine:t.blankLine||(()=>{}),startState:t.startState||(()=>!0),copyState:t.copyState||Shn,indent:t.indent||(()=>null),languageData:t.languageData||{},tokenTable:t.tokenTable||_2e,mergeTokens:t.mergeTokens!==!1}}function Shn(t){if(typeof t!="object")return t;let e={};for(let r in t){let n=t[r];e[r]=n instanceof Array?n.slice():n}return e}const vSt=new WeakMap;class k2e extends Ud{constructor(e){let r=aK(e.languageData),n=Thn(e),i,a=new class extends mX{createParse(s,o,l){return new Ohn(i,s,o,l)}};super(r,a,[],e.name),this.topNode=_hn(r,this),i=this,this.streamParser=n,this.stateAfter=new En({perNode:!0}),this.tokenTable=e.tokenTable?new TSt(n.tokenTable):Ehn}static define(e){return new k2e(e)}getIndent(e){let r,{overrideIndentation:n}=e.options;n&&(r=vSt.get(e.state),r!=null&&r1e4)return null;for(;a=n&&r+e.length<=i&&e.prop(t.stateAfter);if(a)return{state:t.streamParser.copyState(a),pos:r+e.length};for(let s=e.children.length-1;s>=0;s--){let o=e.children[s],l=r+e.positions[s],u=o instanceof si&&l=e.length)return e;!i&&r==0&&e.type==t.topNode&&(i=!0);for(let a=e.children.length-1;a>=0;a--){let s=e.positions[a],o=e.children[a],l;if(sr&&E2e(t,a.tree,0-a.offset,r,o),u;if(l&&l.pos<=n&&(u=ySt(t,a.tree,r+a.offset,l.pos+a.offset,!1)))return{state:l.state,tree:u}}return{state:t.streamParser.startState(i?HS(i):4),tree:si.empty}}let Ohn=class{constructor(e,r,n,i){this.lang=e,this.input=r,this.fragments=n,this.ranges=i,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=i[i.length-1].to;let a=GS.get(),s=i[0].from,{state:o,tree:l}=Chn(e,n,s,this.to,a==null?void 0:a.state);this.state=o,this.parsedPos=this.chunkStart=s+l.length;for(let u=0;uu.from<=a.viewport.from&&u.to>=a.viewport.from)&&(this.state=this.lang.streamParser.startState(HS(a.state)),a.skipUntilInView(this.parsedPos,a.viewport.from),this.parsedPos=a.viewport.from),this.moveRangeIndex()}advance(){let e=GS.get(),r=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),n=Math.min(r,this.chunkStart+512);for(e&&(n=Math.min(n,e.viewport.to));this.parsedPos=r?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,r),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let r=this.input.chunk(e);if(this.input.lineChunks)r==` +`;this.styleTag.textContent=s;let o=r.head||r;this.styleTag.parentNode!=o&&o.insertBefore(this.styleTag,o.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}for(var i2={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},U7={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Hon=typeof navigator<"u"&&/Mac/.test(navigator.platform),Won=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),hc=0;hc<10;hc++)i2[48+hc]=i2[96+hc]=String(hc);for(var hc=1;hc<=24;hc++)i2[hc+111]="F"+hc;for(var hc=65;hc<=90;hc++)i2[hc]=String.fromCharCode(hc+32),U7[hc]=String.fromCharCode(hc);for(var wxe in i2)U7.hasOwnProperty(wxe)||(U7[wxe]=i2[wxe]);function Yon(t){var e=Hon&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Won&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",r=!e&&t.key||(t.shiftKey?U7:i2)[t.keyCode]||t.key||"Unidentified";return r=="Esc"&&(r="Escape"),r=="Del"&&(r="Delete"),r=="Left"&&(r="ArrowLeft"),r=="Up"&&(r="ArrowUp"),r=="Right"&&(r="ArrowRight"),r=="Down"&&(r="ArrowDown"),r}function fa(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,r=arguments[1];if(r&&typeof r=="object"&&r.nodeType==null&&!Array.isArray(r)){for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)){var i=r[n];typeof i=="string"?t.setAttribute(n,i):i!=null&&(t[n]=i)}e++}for(;e2);var br={mac:Xwt||/Mac/.test(Mu.platform),windows:/Win/.test(Mu.platform),linux:/Linux|X11/.test(Mu.platform),ie:CX,ie_version:Ywt?Axe.documentMode||6:Txe?+Txe[1]:Sxe?+Sxe[1]:0,gecko:qwt,gecko_version:qwt?+(/Firefox\/(\d+)/.exec(Mu.userAgent)||[0,0])[1]:0,chrome:!!Cxe,chrome_version:Cxe?+Cxe[1]:0,ios:Xwt,android:/Android\b/.test(Mu.userAgent),webkit:jwt,webkit_version:jwt?+(/\bAppleWebKit\/(\d+)/.exec(Mu.userAgent)||[0,0])[1]:0,safari:Oxe,safari_version:Oxe?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Mu.userAgent)||[0,0])[1]:0,tabSize:Axe.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function kxe(t,e){for(let r in t)r=="class"&&e.class?e.class+=" "+t.class:r=="style"&&e.style?e.style+=";"+t.style:e[r]=t[r];return e}const OX=Object.create(null);function Exe(t,e,r){if(t==e)return!0;t||(t=OX),e||(e=OX);let n=Object.keys(t),i=Object.keys(e);if(n.length-0!=i.length-0)return!1;for(let a of n)if(a!=r&&(i.indexOf(a)==-1||t[a]!==e[a]))return!1;return!0}function qon(t,e){for(let r=t.attributes.length-1;r>=0;r--){let n=t.attributes[r].name;e[n]==null&&t.removeAttribute(n)}for(let r in e){let n=e[r];r=="style"?t.style.cssText=n:t.getAttribute(r)!=n&&t.setAttribute(r,n)}}function Kwt(t,e,r){let n=!1;if(e)for(let i in e)r&&i in r||(n=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(r)for(let i in r)e&&e[i]==r[i]||(n=!0,i=="style"?t.style.cssText=r[i]:t.setAttribute(i,r[i]));return n}function jon(t){let e=Object.create(null);for(let r=0;r0?3e8:-4e8:r>0?1e8:-1e8,new BT(e,r,r,n,e.widget||null,!1)}static replace(e){let r=!!e.block,n,i;if(e.isBlockGap)n=-5e8,i=4e8;else{let{start:a,end:s}=Zwt(e,r);n=(a?r?-3e8:-1:5e8)-1,i=(s?r?2e8:1:-6e8)+1}return new BT(e,n,i,r,e.widget||null,!0)}static line(e){return new Q7(e)}static set(e,r=!1){return Zn.of(e,r)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Ar.none=Zn.empty;class V7 extends Ar{constructor(e){let{start:r,end:n}=Zwt(e);super(r?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?kxe(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||OX}eq(e){return this==e||e instanceof V7&&this.tagName==e.tagName&&Exe(this.attrs,e.attrs)}range(e,r=e){if(e>=r)throw new RangeError("Mark decorations may not be empty");return super.range(e,r)}}V7.prototype.point=!1;class Q7 extends Ar{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Q7&&this.spec.class==e.spec.class&&Exe(this.spec.attributes,e.spec.attributes)}range(e,r=e){if(r!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,r)}}Q7.prototype.mapMode=uc.TrackBefore,Q7.prototype.point=!0;class BT extends Ar{constructor(e,r,n,i,a,s){super(r,n,a,e),this.block=i,this.isReplace=s,this.mapMode=i?r<=0?uc.TrackBefore:uc.TrackAfter:uc.TrackDel}get type(){return this.startSide!=this.endSide?dc.WidgetRange:this.startSide<=0?dc.WidgetBefore:dc.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof BT&&Xon(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,r=e){if(this.isReplace&&(e>r||e==r&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&r!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,r)}}BT.prototype.point=!0;function Zwt(t,e=!1){let{inclusiveStart:r,inclusiveEnd:n}=t;return r==null&&(r=t.inclusive),n==null&&(n=t.inclusive),{start:r??e,end:n??e}}function Xon(t,e){return t==e||!!(t&&e&&t.compare(e))}function u4(t,e,r,n=0){let i=r.length-1;i>=0&&r[i]+n>=t?r[i]=Math.max(r[i],e):r.push(t,e)}class G7 extends n2{constructor(e,r,n){super(),this.tagName=e,this.attributes=r,this.rank=n}eq(e){return e==this||e instanceof G7&&this.tagName==e.tagName&&Exe(this.attributes,e.attributes)}static create(e){return new G7(e.tagName,e.attributes||OX,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,r=!1){return Zn.of(e,r)}}G7.prototype.startSide=G7.prototype.endSide=-1;function H7(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function _xe(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function W7(t,e){if(!e.anchorNode)return!1;try{return _xe(t,e.anchorNode)}catch{return!1}}function Y7(t){return t.nodeType==3?X7(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function q7(t,e,r,n){return r?Jwt(t,e,r,n,-1)||Jwt(t,e,r,n,1):!1}function a2(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function kX(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function Jwt(t,e,r,n,i){for(;;){if(t==r&&e==n)return!0;if(e==(i<0?0:Hy(t))){if(t.nodeName=="DIV")return!1;let a=t.parentNode;if(!a||a.nodeType!=1)return!1;e=a2(t)+(i<0?0:1),t=a}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?Hy(t):0}else return!1}}function Hy(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function j7(t,e){let{left:r,right:n}=t;if(r==n)return t;let i=e?r:n;return{left:i,right:i,top:t.top,bottom:t.bottom}}function Kon(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function eAt(t,e){let r=e.width/t.offsetWidth,n=e.height/t.offsetHeight;return(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.width-t.offsetWidth)<1)&&(r=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-t.offsetHeight)<1)&&(n=1),{scaleX:r,scaleY:n}}function Zon(t,e,r,n,i,a,s,o){let l=t.ownerDocument,u=l.defaultView||window;for(let h=t,d=!1;h&&!d;)if(h.nodeType==1){let f,p=h==l.body,g=1,m=1;if(p)f=Kon(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(d=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let b=h.getBoundingClientRect();({scaleX:g,scaleY:m}=eAt(h,b)),f={left:b.left,right:b.left+h.clientWidth*g,top:b.top,bottom:b.top+h.clientHeight*m}}let v=0,y=0;if(i=="nearest")e.top0&&e.bottom>f.bottom+y&&(y=e.bottom-f.bottom+s)):e.bottom>f.bottom-s&&(y=e.bottom-f.bottom+s,r<0&&e.top-y0&&e.right>f.right+v&&(v=e.right-f.right+a)):e.right>f.right-a&&(v=e.right-f.right+a,r<0&&e.leftf.bottom||e.leftf.right)&&(e={left:Math.max(e.left,f.left),right:Math.min(e.right,f.right),top:Math.max(e.top,f.top),bottom:Math.min(e.bottom,f.bottom)}),h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function tAt(t,e=!0){let r=t.ownerDocument,n=null,i=null;for(let a=t.parentNode;a&&!(a==r.body||(!e||n)&&i);)if(a.nodeType==1)!i&&a.scrollHeight>a.clientHeight&&(i=a),e&&!n&&a.scrollWidth>a.clientWidth&&(n=a),a=a.assignedSlot||a.parentNode;else if(a.nodeType==11)a=a.host;else break;return{x:n,y:i}}class Jon{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:r,focusNode:n}=e;this.set(r,Math.min(e.anchorOffset,r?Hy(r):0),n,Math.min(e.focusOffset,n?Hy(n):0))}set(e,r,n,i){this.anchorNode=e,this.anchorOffset=r,this.focusNode=n,this.focusOffset=i}}let $T=null;br.safari&&br.safari_version>=26&&($T=!1);function rAt(t){if(t.setActive)return t.setActive();if($T)return t.focus($T);let e=[];for(let r=t;r&&(e.push(r,r.scrollTop,r.scrollLeft),r!=r.ownerDocument);r=r.parentNode);if(t.focus($T==null?{get preventScroll(){return $T={preventScroll:!0},!0}}:void 0),!$T){$T=!1;for(let r=0;rMath.max(0,t.document.documentElement.scrollHeight-t.innerHeight-4):t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function aAt(t,e){for(let r=t,n=e;;){if(r.nodeType==3&&n>0)return{node:r,offset:n};if(r.nodeType==1&&n>0){if(r.contentEditable=="false")return null;r=r.childNodes[n-1],n=Hy(r)}else if(r.parentNode&&!kX(r))n=a2(r),r=r.parentNode;else return null}}function sAt(t,e){for(let r=t,n=e;;){if(r.nodeType==3&&n=r){if(o.level==n)return s;(a<0||(i!=0?i<0?o.fromr:e[a].level>o.level))&&(a=s)}}if(a<0)throw new RangeError("Index out of range");return a}}function cAt(t,e){if(t.length!=e.length)return!1;for(let r=0;r=0;m-=3)if(h0[m+1]==-p){let v=h0[m+2],y=v&2?i:v&4?v&1?a:i:0;y&&(Ta[d]=Ta[h0[m]]=y),o=m;break}}else{if(h0.length==189)break;h0[o++]=d,h0[o++]=f,h0[o++]=l}else if((g=Ta[d])==2||g==1){let m=g==i;l=m?0:1;for(let v=o-3;v>=0;v-=3){let y=h0[v+2];if(y&2)break;if(m)h0[v+2]|=2;else{if(y&4)break;h0[v+2]|=4}}}}}function oln(t,e,r,n){for(let i=0,a=n;i<=r.length;i++){let s=i?r[i-1].to:t,o=il;)g==v&&(g=r[--m].from,v=m?r[m-1].to:t),Ta[--g]=p;l=h}else a=u,l++}}}function Lxe(t,e,r,n,i,a,s){let o=n%2?2:1;if(n%2==i%2)for(let l=e,u=0;ll&&s.push(new d0(l,m.from,p));let v=m.direction==FT!=!(p%2);Mxe(t,v?n+1:n,i,m.inner,m.from,m.to,s),l=m.to}g=m.to}else{if(g==r||(h?Ta[g]!=o:Ta[g]==o))break;g++}f?Lxe(t,l,g,n+1,i,f,s):le;){let h=!0,d=!1;if(!u||l>a[u-1].to){let m=Ta[l-1];m!=o&&(h=!1,d=m==16)}let f=!h&&o==1?[]:null,p=h?n:n+1,g=l;e:for(;;)if(u&&g==a[u-1].to){if(d)break e;let m=a[--u];if(!h)for(let v=m.from,y=u;;){if(v==e)break e;if(y&&a[y-1].to==v)v=a[--y].from;else{if(Ta[v-1]==o)break e;break}}if(f)f.push(m);else{m.toTa.length;)Ta[Ta.length]=256;let n=[],i=e==FT?0:1;return Mxe(t,i,i,r,0,t.length,n),n}function uAt(t){return[new d0(0,t,0)]}let hAt="";function cln(t,e,r,n,i){var a;let s=n.head-t.from,o=d0.find(e,s,(a=n.bidiLevel)!==null&&a!==void 0?a:-1,n.assoc),l=e[o],u=l.side(i,r);if(s==u){let f=o+=i?1:-1;if(f<0||f>=e.length)return null;l=e[o=f],s=l.side(!i,r),u=l.side(i,r)}let h=Dl(t.text,s,l.forward(i,r));(hl.to)&&(h=u),hAt=t.text.slice(Math.min(s,h),Math.max(s,h));let d=o==(i?e.length-1:0)?null:e[o+(i?1:-1)];return d&&h==u&&d.level+(i?0:1)t.some(e=>e)}),bAt=vr.define({combine:t=>t.some(e=>e)}),xAt=vr.define();class d4{constructor(e,r,n,i,a,s=!1){this.range=e,this.y=r,this.x=n,this.yMargin=i,this.xMargin=a,this.isSnapshot=s}map(e){return e.empty?this:new d4(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new d4(bt.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const EX=nn.define({map:(t,e)=>t.map(e)}),wAt=nn.define();function Nh(t,e,r){let n=t.facet(gAt);n.length?n[0](e):window.onerror&&window.onerror(String(e),r,void 0,void 0,e)||(r?console.error(r+":",e):console.error(e))}const Wy=vr.define({combine:t=>t.length?t[0]:!0});let hln=0;const f4=vr.define({combine(t){return t.filter((e,r)=>{for(let n=0;n{let l=[];return s&&l.push(_X.of(u=>{let h=u.plugin(o);return h?s(h):Ar.none})),a&&l.push(a(o)),l})}static fromClass(e,r){return ws.define((n,i)=>new e(n,i),r)}}class Bxe{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let r=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(r)}catch(n){if(Nh(r.state,n,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(r){Nh(e.state,r,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var r;if(!((r=this.value)===null||r===void 0)&&r.destroy)try{this.value.destroy()}catch(n){Nh(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const AAt=vr.define(),$xe=vr.define(),_X=vr.define(),SAt=vr.define(),Fxe=vr.define(),K7=vr.define(),TAt=vr.define();function CAt(t,e){let r=t.state.facet(TAt);if(!r.length)return r;let n=r.map(a=>a instanceof Function?a(t):a),i=[];return Zn.spans(n,e.from,e.to,{point(){},span(a,s,o,l){let u=a-e.from,h=s-e.from,d=i;for(let f=o.length-1;f>=0;f--,l--){let p=o[f].spec.bidiIsolate,g;if(p==null&&(p=uln(e.text,u,h)),l>0&&d.length&&(g=d[d.length-1]).to==u&&g.direction==p)g.to=h,d=g.inner;else{let m={from:u,to:h,direction:p,inner:[]};d.push(m),d=m.inner}}}}),i}const OAt=vr.define();function zxe(t){let e=0,r=0,n=0,i=0;for(let a of t.state.facet(OAt)){let s=a(t);s&&(s.left!=null&&(e=Math.max(e,s.left)),s.right!=null&&(r=Math.max(r,s.right)),s.top!=null&&(n=Math.max(n,s.top)),s.bottom!=null&&(i=Math.max(i,s.bottom)))}return{left:e,right:r,top:n,bottom:i}}const Z7=vr.define();class np{constructor(e,r,n,i){this.fromA=e,this.toA=r,this.fromB=n,this.toB=i}join(e){return new np(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let r=e.length,n=this;for(;r>0;r--){let i=e[r-1];if(!(i.fromA>n.toA)){if(i.toAi.push(new np(a,s,o,l))),this.changedRanges=i}static create(e,r,n){return new RX(e,r,n)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const dln=[];class Qs{constructor(e,r,n=0){this.dom=e,this.length=r,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return dln}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let r=this.domAttrs;r&&qon(this.dom,r)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,r=this.posAtStart){let n=r;for(let i of this.children){if(i==e)return n;n+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,r,n){return null}domPosFor(e,r){let n=a2(this.dom),i=this.length?e>0:r>0;return new dg(this.parent.dom,n+(i?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof LX)return e;return null}static get(e){return e.cmTile}}class DX extends Qs{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let r=this.dom,n=null,i,a=(e==null?void 0:e.node)==r?e:null,s=0;for(let o of this.children){if(o.sync(e),s+=o.length+o.breakAfter,i=n?n.nextSibling:r.firstChild,a&&i!=o.dom&&(a.written=!0),o.dom.parentNode==r)for(;i&&i!=o.dom;)i=kAt(i);else r.insertBefore(o.dom,i);n=o.dom}for(i=n?n.nextSibling:r.firstChild,a&&i&&(a.written=!0);i;)i=kAt(i);this.length=s}}function kAt(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class LX extends DX{constructor(e,r){super(r),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let r=Qs.get(e);if(r&&this.owns(r))return r;e=e.parentNode}}blockTiles(e){for(let r=[],n=this,i=0,a=0;;)if(i==n.children.length){if(!r.length)return;n=n.parent,n.breakAfter&&a++,i=r.pop()}else{let s=n.children[i++];if(s instanceof Yy)r.push(i),n=s,i=0;else{let o=a+s.length,l=e(s,a);if(l!==void 0)return l;a=o+s.breakAfter}}}resolveBlock(e,r){let n,i=-1,a,s=-1;if(this.blockTiles((o,l)=>{let u=l+o.length;if(e>=l&&e<=u){if(o.isWidget()&&r>=-1&&r<=1){if(o.flags&32)return!0;o.flags&16&&(n=void 0)}(le||e==l&&(r>1?o.length:o.covers(-1)))&&(!a||!o.isWidget()&&a.isWidget())&&(a=o,s=e-l)}}),!n&&!a)throw new Error("No tile at position "+e);return n&&r<0||!a?{tile:n,offset:i}:{tile:a,offset:s}}}class Yy extends DX{constructor(e,r){super(e),this.wrapper=r}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,r){let n=new Yy(r||document.createElement(e.tagName),e);return r||(n.flags|=4),n}}class p4 extends DX{constructor(e,r){super(e),this.attrs=r}isLine(){return!0}static start(e,r,n){let i=new p4(r||document.createElement("div"),e);return(!r||!n)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,r,n){let i=null,a=-1,s=null,o=-1;function l(h,d){for(let f=0,p=0;f=d&&(g.isComposite()?l(g,d-p):(!s||s.isHidden&&(r>0&&!(s.flags&32)||n&&pln(s,g)))&&(m>d||g.flags&32)?(s=g,o=d-p):(pi&&(e=i);let a=e,s=e,o=0;e==0&&r<0||e==i&&r>=0?br.chrome||br.gecko||(e?(a--,o=1):s=0)?0:l.length-1];return br.safari&&!o&&u.width==0&&(u=Array.prototype.find.call(l,h=>h.width)||u),n==null?u:j7(u,(o?o>0:r<0)==n)}static of(e,r){let n=new zT(r||document.createTextNode(e),e);return r||(n.flags|=2),n}}class UT extends Qs{constructor(e,r,n,i){super(e,r,i),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,r){return this.coordsInWidget(e,r,!1)}coordsInWidget(e,r,n){let i=this.widget.coordsAt(this.dom,e,r);if(i)return i;if(n)return j7(this.dom.getBoundingClientRect(),this.length?e==0:r<=0);{let a=this.dom.getClientRects(),s=null;if(!a.length)return null;let o=this.flags&16?!0:this.flags&32?!1:e>0;for(let l=o?a.length-1:0;s=a[l],!(e>0?l==0:l==a.length-1||s.top0==n)}}class gln{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,r,n){let{tile:i,index:a,beforeBreak:s,parents:o}=this;for(;e||r>0;)if(i.isComposite())if(s){if(!e)break;n&&n.break(),e--,s=!1}else if(a==i.children.length){if(!e&&!o.length)break;n&&n.leave(i),s=!!i.breakAfter,{tile:i,index:a}=o.pop(),a++}else{let l=i.children[a],u=l.breakAfter;(r>0?l.length<=e:l.length=0;o--){let l=r.marks[o],u=i.lastChild;if(u instanceof Bh&&u.mark.eq(l.mark))u.dom!=l.dom&&u.setDOM(Uxe(l.dom)),i=u;else{if(this.cache.reused.get(l)){let d=Qs.get(l.dom);d&&d.setDOM(Uxe(l.dom))}let h=Bh.of(l.mark,l.dom);i.append(h),i=h}this.cache.reused.set(l,2)}let a=Qs.get(e.text);a&&this.cache.reused.set(a,2);let s=new zT(e.text,e.text.nodeValue);s.flags|=8,this.pos=e.range.toB,i.append(s)}addInlineWidget(e,r,n){let i=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);i||this.flushBuffer();let a=this.ensureMarks(r,n);!i&&!(e.flags&16)&&a.append(this.getBuffer(1)),a.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,r,n){this.flushBuffer(),this.ensureMarks(r,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let r=this.afterWidget||this.lastBlock;r.length+=e,this.pos+=e}addLineStart(e,r){var n;e||(e=_At);let i=p4.start(e,r||((n=this.cache.find(p4))===null||n===void 0?void 0:n.dom),!!r);this.getBlockPos().append(this.lastBlock=this.curLine=i)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,r){var n;let i=this.curLine;for(let a=e.length-1;a>=0;a--){let s=e[a],o;if(r>0&&(o=i.lastChild)&&o instanceof Bh&&o.mark.eq(s))i=o,r--;else{let l=Bh.of(s,(n=this.cache.find(Bh,u=>u.mark.eq(s)))===null||n===void 0?void 0:n.dom);i.append(l),i=l,r=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!EAt(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(br.ios&&EAt(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Vxe,0,32)||new UT(Vxe.toDOM(),0,Vxe,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to=this.pos){let r=e.rank*102+e.value.rank,n=new mln(e.from,e.to,e.value,r),i=this.wrappers.length;for(;i>0&&(this.wrappers[i-1].rank-n.rank||this.wrappers[i-1].to-n.to)<0;)i--;this.wrappers.splice(i,0,n)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let r=this.root;for(let n of this.wrappers){let i=r.lastChild;if(n.froms.wrapper.eq(n.wrapper)))===null||e===void 0?void 0:e.dom);r.append(a),r=a}}return r}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let r=2|(e<0?16:32),n=this.cache.find(MX,void 0,1);return n&&(n.flags=r),n||new MX(r)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class yln{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:i,lineBreak:a,done:s}=this.cursor.next(this.skipCount);if(this.skipCount=0,s)throw new Error("Ran out of text content when drawing inline views");this.text=i;let o=this.textOff=Math.min(e,i.length);return a?null:i.slice(0,o)}let r=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,r);return this.textOff=r,n}}const IX=[UT,p4,zT,Bh,MX,Yy,LX];for(let t=0;t[]),this.index=IX.map(()=>0),this.reused=new Map}add(e){let r=e.constructor.bucket,n=this.buckets[r];n.length<6?n.push(e):n[this.index[r]=(this.index[r]+1)%6]=e}find(e,r,n=2){let i=e.bucket,a=this.buckets[i],s=this.index[i];for(let o=0;o{if(this.cache.add(s),s.isComposite())return!1},enter:s=>this.cache.add(s),leave:()=>{},break:()=>{}}}run(e,r){let n=r&&this.getCompositionContext(r.text);for(let i=0,a=0,s=0;;){let o=si){let u=l-i;this.preserve(u,!s,!o),i=l,a+=u}if(!o)break;r&&o.fromA<=r.range.fromA&&o.toA>=r.range.toA?(this.forward(o.fromA,r.range.fromA,r.range.fromA{if(s.isWidget())if(this.openWidget)this.builder.continueWidget(l-o);else{let u=l>0||o{s.isLine()?this.builder.addLineStart(s.attrs,this.cache.maybeReuse(s)):(this.cache.add(s),s instanceof Bh&&i.unshift(s.mark)),this.openWidget=!1},leave:s=>{s.isLine()?i.length&&(i.length=a=0):s instanceof Bh&&(i.shift(),a=Math.min(a,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,r){let n=null,i=this.builder,a=-1,s=Zn.spans(this.decorations,e,r,{point:(o,l,u,h,d,f)=>{if(u instanceof BT){if(this.disallowBlockEffectsFor[f]){if(u.block)throw new RangeError("Block decorations may not be specified via plugins");if(l>this.view.state.doc.lineAt(o).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(a=h.length,d>h.length)i.continueWidget(l-o);else{let p=u.widget||(u.block?g4.block:g4.inline),g=wln(u),m=this.cache.findWidget(p,l-o,g)||UT.of(p,this.view,l-o,g);u.block?(u.startSide>0&&i.addLineStartIfNotCovered(n),i.addBlockWidget(m)):(i.ensureLine(n),i.addInlineWidget(m,h,d))}n=null}else n=Aln(n,u);l>o&&this.text.skip(l-o)},span:(o,l,u,h)=>{for(let d=o;d-1&&(this.openWidget=s>a),this.openWidget||i.addLineStartIfNotCovered(n),this.openMarks=s}forward(e,r,n=1){r-e<=10?this.old.advance(r-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(r-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let r=[],n=null;for(let i=e.parentNode;;i=i.parentNode){let a=Qs.get(i);if(i==this.view.contentDOM)break;a instanceof Bh?r.push(a):a!=null&&a.isLine()?n=a:a instanceof Yy||(i.nodeName=="DIV"&&!n&&i!=this.view.contentDOM?n=new p4(i,_At):n||r.push(Bh.of(new V7({tagName:i.nodeName.toLowerCase(),attributes:jon(i)}),i)))}return{line:n,marks:r}}}function EAt(t,e){let r=n=>{for(let i of n.children)if((e?i.isText():i.length)||r(i))return!0;return!1};return r(t)}function wln(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}const _At={class:"cm-line"};function Aln(t,e){let r=e.spec.attributes,n=e.spec.class;return!r&&!n||(t||(t={class:"cm-line"}),r&&kxe(r,t),n&&(t.class+=" "+n)),t}function Sln(t){let e=[];for(let r=t.parents.length;r>1;r--){let n=r==t.parents.length?t.tile:t.parents[r].tile;n instanceof Bh&&e.push(n.mark)}return e}function Uxe(t){let e=Qs.get(t);return e&&e.setDOM(t.cloneNode()),t}class g4 extends Iu{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}g4.inline=new g4("span"),g4.block=new g4("div");const Vxe=new class extends Iu{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class RAt{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Ar.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new LX(e,e.contentDOM),this.updateInner([new np(0,0,0,e.state.doc.length)],null)}update(e){var r;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:h,toA:d})=>dthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((r=this.domChanged)===null||r===void 0)&&r.newSel?i=this.domChanged.newSel.head:!Lln(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let a=i>-1?Cln(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:h,to:d}=this.hasComposition;n=new np(h,d,e.changes.mapPos(h,-1),e.changes.mapPos(d,1)).addToSet(n.slice())}this.hasComposition=a?{from:a.range.fromB,to:a.range.toB}:null,(br.ie||br.chrome)&&!a&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,o=this.blockWrappers;this.updateDeco();let l=Eln(s,this.decorations,e.changes);l.length&&(n=np.extendWithRanges(n,l));let u=Rln(o,this.blockWrappers,e.changes);return u.length&&(n=np.extendWithRanges(n,u)),a&&!n.some(h=>h.fromA<=a.range.fromA&&h.toA>=a.range.toA)&&(n=a.range.addToSet(n.slice())),this.tile.flags&2&&n.length==0?!1:(this.updateInner(n,a),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,r){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(r||e.length){let s=this.tile,o=new xln(this.view,s,this.blockWrappers,this.decorations,this.dynamicDecorationMap);r&&Qs.get(r.text)&&o.cache.reused.set(Qs.get(r.text),2),this.tile=o.run(e,r),Qxe(s,o.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let a=br.chrome||br.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(a),a&&(a.written||n.selectionRange.focusNode!=a.node||!this.tile.dom.contains(a.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];if(this.view.viewport.from||this.view.viewport.to-1)&&W7(n,this.view.observer.selectionRange)&&!(i&&n.contains(i));if(!(a||r||s))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,u,h;if(l.empty?h=u=this.inlineDOMNearPos(l.anchor,l.assoc||1):(h=this.inlineDOMNearPos(l.head,l.head==l.from?1:-1),u=this.inlineDOMNearPos(l.anchor,l.anchor==l.from?1:-1)),br.gecko&&l.empty&&!this.hasComposition&&Tln(u)){let f=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(f,u.node.childNodes[u.offset]||null)),u=h=new dg(f,0),o=!0}let d=this.view.observer.selectionRange;(o||!d.focusNode||(!q7(u.node,u.offset,d.anchorNode,d.anchorOffset)||!q7(h.node,h.offset,d.focusNode,d.focusOffset))&&!this.suppressWidgetCursorChange(d,l))&&(this.view.observer.ignore(()=>{br.android&&br.chrome&&n.contains(d.focusNode)&&Dln(d.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let f=H7(this.view.root);if(f)if(l.empty){if(br.gecko){let p=Oln(u.node,u.offset);if(p&&p!=3){let g=(p==1?aAt:sAt)(u.node,u.offset);g&&(u=new dg(g.node,g.offset))}}f.collapse(u.node,u.offset),l.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=l.bidiLevel)}else if(f.extend){f.collapse(u.node,u.offset);try{f.extend(h.node,h.offset)}catch{}}else{let p=document.createRange();l.anchor>l.head&&([u,h]=[h,u]),p.setEnd(h.node,h.offset),p.setStart(u.node,u.offset),f.removeAllRanges(),f.addRange(p)}s&&this.view.root.activeElement==n&&(n.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(u,h)),this.impreciseAnchor=u.precise?null:new dg(d.anchorNode,d.anchorOffset),this.impreciseHead=h.precise?null:new dg(d.focusNode,d.focusOffset)}suppressWidgetCursorChange(e,r){return this.hasComposition&&r.empty&&q7(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==r.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,r=e.state.selection.main,n=H7(e.root),{anchorNode:i,anchorOffset:a}=e.observer.selectionRange;if(!n||!r.empty||!r.assoc||!n.modify)return;let s=this.lineAt(r.head,r.assoc);if(!s)return;let o=s.posAtStart;if(r.head==o||r.head==o+s.length)return;let l=this.coordsAt(r.head,-1),u=this.coordsAt(r.head,1);if(!l||!u||l.bottom>u.top)return;let h=this.domAtPos(r.head+r.assoc,r.assoc);n.collapse(h.node,h.offset),n.modify("move",r.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let d=e.observer.selectionRange;e.docView.posFromDOM(d.anchorNode,d.anchorOffset)!=r.from&&n.collapse(i,a)}posFromDOM(e,r){let n=this.tile.nearest(e);if(!n)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let i=n.posAtStart;if(n.isComposite()){let a;if(e==n.dom)a=n.dom.childNodes[r];else{let s=Hy(e)==0?0:r==0?-1:1;for(;;){let o=e.parentNode;if(o==n.dom)break;s==0&&o.firstChild!=o.lastChild&&(e==o.firstChild?s=-1:s=1),e=o}s<0?a=e:a=e.nextSibling}if(a==n.dom.firstChild)return i;for(;a&&!Qs.get(a);)a=a.nextSibling;if(!a)return i+n.length;for(let s=0,o=i;;s++){let l=n.children[s];if(l.dom==a)return o;o+=l.length+l.breakAfter}}else return n.isText()?e==n.dom?i+r:i+(r?n.length:0):i}domAtPos(e,r){let{tile:n,offset:i}=this.tile.resolveBlock(e,r);return n.isWidget()?n.domPosFor(i,r):n.domIn(i,r)}inlineDOMNearPos(e,r){let n,i=-1,a=!1,s,o=-1,l=!1;return this.tile.blockTiles((u,h)=>{if(u.isWidget()){if(u.flags&32&&h>=e)return!0;u.flags&16&&(a=!0)}else{let d=h+u.length;if(h<=e&&(n=u,i=e-h,a=d=e&&!s&&(s=u,o=e-h,l=h>e),h>e&&s)return!0}}),!n&&!s?this.domAtPos(e,r):(a&&s?n=null:l&&n&&(s=null),n&&r<0||!s?n.domIn(i,r):s.domIn(o,r))}coordsAt(e,r,n){let{tile:i,offset:a}=this.tile.resolveBlock(e,r);return i.isWidget()?i.widget instanceof Gxe?null:i.coordsInWidget(a,r,!0):i.coordsIn(a,r,n)}lineAt(e,r){let{tile:n}=this.tile.resolveBlock(e,r);return n.isLine()?n:null}coordsForChar(e){let{tile:r,offset:n}=this.tile.resolveBlock(e,1);if(!r.isLine())return null;function i(a,s){if(a.isComposite())for(let o of a.children){if(o.length>=s){let l=i(o,s);if(l)return l}if(s-=o.length,s<0)break}else if(a.isText()&&sMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,l=this.view.textDirection==Sa.LTR,u=0,h=(d,f,p)=>{for(let g=0;gi);g++){let m=d.children[g],v=f+m.length,y=m.dom.getBoundingClientRect(),{height:b}=y;if(p&&!g&&(u+=y.top-p.top),m instanceof Yy)v>n&&h(m,f,y);else if(f>=n&&(u>0&&r.push(-u),r.push(b+u),u=0,s)){let x=m.dom.lastChild,w=x?Y7(x):[];if(w.length){let A=w[w.length-1],S=l?A.right-y.left:y.right-A.left;S>o&&(o=S,this.minWidth=a,this.minWidthFrom=f,this.minWidthTo=v)}}p&&g==d.children.length-1&&(u+=p.bottom-y.bottom),f=v+m.breakAfter}};return h(this.tile,0,null),r}textDirectionAt(e){let{tile:r}=this.tile.resolveBlock(e,1);return getComputedStyle(r.dom).direction=="rtl"?Sa.RTL:Sa.LTR}measureTextSize(){let e=this.tile.blockTiles(s=>{if(s.isLine()&&s.children.length&&s.length<=20){let o=0,l;for(let u of s.children){if(!u.isText()||/[^ -~]/.test(u.text))return;let h=Y7(u.dom);if(h.length!=1)return;o+=h[0].width,l=h[0].height}if(o)return{lineHeight:s.dom.getBoundingClientRect().height,charWidth:o/s.length,textHeight:l}}});if(e)return e;let r=document.createElement("div"),n,i,a;return r.className="cm-line",r.style.width="99999px",r.style.position="absolute",r.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(r);let s=Y7(r.firstChild)[0];n=r.getBoundingClientRect().height,i=s&&s.width?s.width/27:7,a=s&&s.height?s.height:n,r.remove()}),{lineHeight:n,charWidth:i,textHeight:a}}computeBlockGapDeco(){let e=[],r=this.view.viewState;for(let n=0,i=0;;i++){let a=i==r.viewports.length?null:r.viewports[i],s=a?a.from-1:this.view.state.doc.length;if(s>n){let o=(r.lineBlockAt(s).bottom-r.lineBlockAt(n).top)/this.view.scaleY;e.push(Ar.replace({widget:new Gxe(o),block:!0,inclusive:!0,isBlockGap:!0}).range(n,s))}if(!a)break;n=a.to+1}return Ar.set(e)}updateDeco(){let e=1,r=this.view.state.facet(_X).map(a=>(this.dynamicDecorationMap[e++]=typeof a=="function")?a(this.view):a),n=!1,i=this.view.state.facet(Fxe).map((a,s)=>{let o=typeof a=="function";return o&&(n=!0),o?a(this.view):a});for(i.length&&(this.dynamicDecorationMap[e++]=n,r.push(Zn.join(i))),this.decorations=[this.editContextFormatting,...r,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];etypeof a=="function"?a(this.view):a)}scrollIntoView(e){if(e.isSnapshot){let u=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=u.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let u of this.view.state.facet(xAt))try{if(u(this.view,e.range,e))return!0}catch(h){Nh(this.view.state,h,"scroll handler")}let{range:r}=e,n=this.coordsAt(r.head,r.assoc||(r.head>r.anchor?-1:1)),i;if(!n)return;!r.empty&&(i=this.coordsAt(r.anchor,r.anchor>r.head?-1:1))&&(n={left:Math.min(n.left,i.left),top:Math.min(n.top,i.top),right:Math.max(n.right,i.right),bottom:Math.max(n.bottom,i.bottom)});let a=zxe(this.view),s={left:n.left-a.left,top:n.top-a.top,right:n.right+a.right,bottom:n.bottom+a.bottom},{offsetWidth:o,offsetHeight:l}=this.view.scrollDOM;if(Zon(this.view.scrollDOM,s,r.head1&&(n.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||n.bottomn.isWidget()||n.children.some(r);return r(this.tile.resolveBlock(e,1).tile)}destroy(){Qxe(this.tile)}}function Qxe(t,e){let r=e==null?void 0:e.get(t);if(r!=1){r==null&&t.destroy();for(let n of t.children)Qxe(n,e)}}function Tln(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function DAt(t,e){let r=t.observer.selectionRange;if(!r.focusNode)return null;let n=aAt(r.focusNode,r.focusOffset),i=sAt(r.focusNode,r.focusOffset),a=n||i;if(i&&n&&i.node!=n.node){let o=Qs.get(i.node);if(!o||o.isText()&&o.text!=i.node.nodeValue)a=i;else if(t.docView.lastCompositionAfterCursor){let l=Qs.get(n.node);!l||l.isText()&&l.text!=n.node.nodeValue||(a=i)}}if(t.docView.lastCompositionAfterCursor=a!=n,!a)return null;let s=e-a.offset;return{from:s,to:s+a.node.nodeValue.length,node:a.node}}function Cln(t,e,r){let n=DAt(t,r);if(!n)return null;let{node:i,from:a,to:s}=n,o=i.nodeValue;if(/[\n\r]/.test(o)||t.state.doc.sliceString(n.from,n.to)!=o)return null;let l=e.invertedDesc;return{range:new np(l.mapPos(a),l.mapPos(s),a,s),text:i}}function Oln(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e{ne.from&&(r=!0)}),r}class Gxe extends Iu{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function Mln(t,e,r=1){let n=t.charCategorizer(e),i=t.doc.lineAt(e),a=e-i.from;if(i.length==0)return bt.cursor(e);a==0?r=1:a==i.length&&(r=-1);let s=a,o=a;r<0?s=Dl(i.text,a,!1):o=Dl(i.text,a);let l=n(i.text.slice(s,o));for(;s>0;){let u=Dl(i.text,s,!1);if(n(i.text.slice(u,s))!=l)break;s=u}for(;ot.defaultLineHeight*1.5){let o=t.viewState.heightOracle.textHeight,l=Math.floor((i-r.top-(t.defaultLineHeight-o)*.5)/o);a+=l*t.viewState.heightOracle.lineLength}let s=t.state.sliceDoc(r.from,r.to);return r.from+yxe(s,a,t.state.tabSize)}function Hxe(t,e,r){let n=t.lineBlockAt(e);if(Array.isArray(n.type)){let i;for(let a of n.type){if(a.from>e)break;if(!(a.toe)return a;(!i||a.type==dc.Text&&(i.type!=a.type||(r<0?a.frome)))&&(i=a)}}return i||n}return n}function Pln(t,e,r,n){let i=Hxe(t,e.head,e.assoc||-1),a=!n||i.type!=dc.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(a){let s=t.dom.getBoundingClientRect(),o=t.textDirectionAt(i.from),l=t.posAtCoords({x:r==(o==Sa.LTR)?s.right-1:s.left+1,y:(a.top+a.bottom)/2});if(l!=null)return bt.cursor(l,r?-1:1)}return bt.cursor(r?i.to:i.from,r?-1:1)}function LAt(t,e,r,n){let i=t.state.doc.lineAt(e.head),a=t.bidiSpans(i),s=t.textDirectionAt(i.from);for(let o=e,l=null;;){let u=cln(i,a,s,o,r),h=hAt;if(!u){if(i.number==(r?t.state.doc.lines:1))return o;h=` +`,i=t.state.doc.line(i.number+(r?1:-1)),a=t.bidiSpans(i),u=t.visualLineSide(i,!r)}if(l){if(!l(h))return o}else{if(!n)return u;l=n(h)}o=u}}function Nln(t,e,r){let n=t.state.charCategorizer(e),i=n(r);return a=>{let s=n(a);return i==ps.Space&&(i=s),i==s}}function Bln(t,e,r,n){let i=e.head,a=r?1:-1;if(i==(r?t.state.doc.length:0))return bt.cursor(i,e.assoc);let s=e.goalColumn,o,l=t.contentDOM.getBoundingClientRect(),u=t.coordsAtPos(i,e.assoc||((e.empty?r:e.head==e.from)?1:-1)),h=t.documentTop;if(u)s==null&&(s=u.left-l.left),o=a<0?u.top:u.bottom;else{let g=t.viewState.lineBlockAt(i);s==null&&(s=Math.min(l.right-l.left,t.defaultCharacterWidth*(i-g.from))),o=(a<0?g.top:g.bottom)+h}let d=l.left+s,f=t.viewState.heightOracle.textHeight>>1,p=n??f;for(let g=0;;g+=f){let m=o+(p+g)*a,v=Yxe(t,{x:d,y:m},!1,a);if(r?m>l.bottom:mo:b{if(e>a&&ei(t)),r.from,e.head>r.from?-1:1);return n==r.from?r:bt.cursor(n,nt.viewState.docHeight)return new f0(t.state.doc.length,-1);if(u=t.elementAtHeight(l),n==null)break;if(u.type==dc.Text){if(n<0?u.tot.viewport.to)break;let f=t.docView.coordsAt(n<0?u.from:u.to,n>0?-1:1);if(f&&(n<0?f.top<=l+a:f.bottom>=l+a))break}let d=t.viewState.heightOracle.textHeight/2;l=n>0?u.bottom+d:u.top-d}if(t.viewport.from>=u.to||t.viewport.to<=u.from){if(r)return null;if(u.type==dc.Text){let d=Iln(t,i,u,s,o);return new f0(d,d==u.from?1:-1)}}if(u.type!=dc.Text)return l<(u.top+u.bottom)/2?new f0(u.from,1):new f0(u.to,-1);let h=t.docView.lineAt(u.from,2);return(!h||h.length!=u.length)&&(h=t.docView.lineAt(u.from,-2)),new $ln(t,s,o,t.textDirectionAt(u.from)).scanTile(h,u.from)}class $ln{constructor(e,r,n,i){this.view=e,this.x=r,this.y=n,this.baseDir=i,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to1||n.length&&(n[0].level!=this.baseDir||n[0].to+i.from>1;t:if(s.has(m)){let y=i+Math.floor(Math.random()*g);for(let b=0;b1)){if(b.bottomthis.y)(!u||u.top>b.top)&&(u=b),x=-1;else{let w=b.left>this.x?this.x-b.left:b.right(g+g+m)/3)return this.y=l.bottom-1,this.scan(e,r,!0);if(u&&u.top<(g+m+m)/3)return this.y=u.top+1,this.scan(e,r,!0)}let p=(o?this.dirAt(e[h],1):this.baseDir)==Sa.LTR;return{i:h,after:this.x>(f.left+f.right)/2==p}}scanText(e,r){let n=[];for(let a=0;a{let s=n[a]-r,o=n[a+1]-r;return X7(e.dom,s,o).getClientRects()});return i.after?new f0(n[i.i+1],-1):new f0(n[i.i],1)}scanTile(e,r){if(!e.length)return new f0(r,1);if(e.children.length==1){let o=e.children[0];if(o.isText())return this.scanText(o,r);if(o.isComposite())return this.scanTile(o,r)}let n=[r];for(let o=0,l=r;o{let l=e.children[o];return l.flags&48?null:(l.dom.nodeType==1?l.dom:X7(l.dom,0,l.length)).getClientRects()}),a=e.children[i.i],s=n[i.i];return a.isText()?this.scanText(a,s):a.isComposite()?this.scanTile(a,s):i.after?new f0(n[i.i+1],-1):new f0(s,1)}}const m4="￿";class Fln{constructor(e,r){this.points=e,this.view=r,this.text="",this.lineSeparator=r.state.facet(Kn.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=m4}readRange(e,r){if(!e)return this;let n=e.parentNode;for(let i=e;;){this.findPointBefore(n,i);let a=this.text.length;this.readNode(i);let s=Qs.get(i),o=i.nextSibling;if(o==r){s!=null&&s.breakAfter&&!o&&n!=this.view.contentDOM&&this.lineBreak();break}let l=Qs.get(o);(s&&l?s.breakAfter:(s?s.breakAfter:kX(i))||kX(o)&&(i.nodeName!="BR"||s!=null&&s.isWidget())&&this.text.length>a)&&!Uln(o,r)&&this.lineBreak(),i=o}return this.findPointBefore(n,r),this}readTextNode(e){let r=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,r.length));for(let n=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let a=-1,s=1,o;if(this.lineSeparator?(a=r.indexOf(this.lineSeparator,n),s=this.lineSeparator.length):(o=i.exec(r))&&(a=o.index,s=o[0].length),this.append(r.slice(n,a<0?r.length:a)),a<0)break;if(this.lineBreak(),s>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=s-1);n=a+s}}readNode(e){let r=Qs.get(e),n=r&&r.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let i=n.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,r){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==r&&(n.pos=this.text.length)}findPointInside(e,r){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(zln(e,n.node,n.offset)?r:0))}}function zln(t,e,r){for(;;){if(!e||r-1;let{impreciseHead:a,impreciseAnchor:s}=e.docView,o=e.state.selection;if(e.state.readOnly&&r>-1)this.newSel=null;else if(r>-1&&(this.bounds=PAt(e.docView.tile,r,n,0))){let l=a||s?[]:Gln(e),u=new Fln(l,e);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=Hln(l,this.bounds.from)}else{let l=e.observer.selectionRange,u=a&&a.node==l.focusNode&&a.offset==l.focusOffset||!_xe(e.contentDOM,l.focusNode)?o.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),h=s&&s.node==l.anchorNode&&s.offset==l.anchorOffset||!_xe(e.contentDOM,l.anchorNode)?o.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),d=e.viewport;if((br.ios||br.chrome)&&u!=h&&Math.min(u,h)<=o.main.from&&Math.max(u,h)>=o.main.to&&(d.from>0||d.to-1&&o.ranges.length>1)this.newSel=o.replaceRange(bt.range(h,u));else if(e.lineWrapping&&h==u&&!(o.main.empty&&o.main.head==u)&&e.inputState.lastTouchTime>Date.now()-100){let f=e.coordsAtPos(u,-1),p=0;f&&(p=e.inputState.lastTouchY<=f.bottom?-1:1),this.newSel=bt.create([bt.cursor(u,p)])}else this.newSel=bt.single(h,u)}}}function PAt(t,e,r,n){if(t.isComposite()){let i=-1,a=-1,s=-1,o=-1;for(let l=0,u=n,h=n;lr)return PAt(d,e,r,u);if(f>=e&&i==-1&&(i=l,a=u),u>r&&d.dom.parentNode==t.dom){s=l,o=h;break}h=f,u=f+d.breakAfter}return{from:a,to:o<0?n+t.length:o,startDOM:(i?t.children[i-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:s=0?t.children[s].dom:null}}else return t.isText()?{from:n,to:n+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function NAt(t,e){let r,{newSel:n}=e,{state:i}=t,a=i.selection.main,s=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,u=a.from,h=null;(s===8||br.android&&e.text.length=o&&a.to<=l&&(e.typeOver||d!=e.text)&&d.slice(0,a.from-o)==e.text.slice(0,a.from-o)&&d.slice(a.to-o)==e.text.slice(f=e.text.length-(d.length-(a.to-o)))?r={from:a.from,to:a.to,insert:vi.of(e.text.slice(a.from-o,f).split(m4))}:(p=BAt(d,e.text,u-o,h))&&(br.chrome&&s==13&&p.toB==p.from+2&&e.text.slice(p.from,p.toB)==m4+m4&&p.toB--,r={from:o+p.from,to:o+p.toA,insert:vi.of(e.text.slice(p.from,p.toB).split(m4))})}else n&&(!t.hasFocus&&i.facet(Wy)||PX(n,a))&&(n=null);if(!r&&!n)return!1;if((br.mac||br.android)&&r&&r.from==r.to&&r.from==a.head-1&&/^\. ?$/.test(r.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(n&&r.insert.length==2&&(n=bt.single(n.main.anchor-1,n.main.head-1)),r={from:r.from,to:r.to,insert:vi.of([r.insert.toString().replace("."," ")])}):i.doc.lineAt(a.from).toDate.now()-50?r={from:a.from,to:a.to,insert:i.toText(t.inputState.insertingText)}:br.chrome&&r&&r.from==r.to&&r.from==a.head&&r.insert.toString()==` + `&&t.lineWrapping&&(n&&(n=bt.single(n.main.anchor-1,n.main.head-1)),r={from:a.from,to:a.to,insert:vi.of([" "])}),r)return qxe(t,r,n,s);if(n&&!PX(n,a)){let o=!1,l="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(o=!0),l=t.inputState.lastSelectionOrigin,l=="select.pointer"&&(n=MAt(i.facet(K7).map(u=>u(t)),n))),t.dispatch({selection:n,scrollIntoView:o,userEvent:l}),!0}else return!1}function qxe(t,e,r,n=-1){if(br.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(br.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&h4(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||n==8&&e.insert.lengthi.head)&&h4(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&h4(t.contentDOM,"Delete",46)))return!0;let a=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let s,o=()=>s||(s=Qln(t,e,r));return t.state.facet(mAt).some(l=>l(t,e.from,e.to,a,o))||t.dispatch(o()),!0}function Qln(t,e,r){let n,i=t.state,a=i.selection.main,s=-1;if(e.from==e.to&&e.froma.to){let l=e.fromd(t)),u,l);e.from==h&&(s=h)}if(s>-1)n={changes:e,selection:bt.cursor(e.from+e.insert.length,-1)};else if(e.from>=a.from&&e.to<=a.to&&e.to-e.from>=(a.to-a.from)/3&&(!r||r.main.empty&&r.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let l=a.frome.to?i.sliceDoc(e.to,a.to):"";n=i.replaceSelection(t.state.toText(l+e.insert.sliceString(0,void 0,t.state.lineBreak)+u))}else{let l=i.changes(e),u=r&&r.main.to<=l.newLength?r.main:void 0;if(i.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=a.to+10&&e.to>=a.to-10){let h=t.state.sliceDoc(e.from,e.to),d,f=r&&DAt(t,r.main.head);if(f){let g=e.insert.length-(e.to-e.from);d={from:f.from,to:f.to-g}}else d=t.state.doc.lineAt(a.head);let p=a.to-e.to;n=i.changeByRange(g=>{if(g.from==a.from&&g.to==a.to)return{changes:l,range:u||g.map(l)};let m=g.to-p,v=m-h.length;if(t.state.sliceDoc(v,m)!=h||m>=d.from&&v<=d.to)return{range:g};let y=i.changes({from:v,to:m,insert:e.insert}),b=g.to-a.to;return{changes:y,range:u?bt.range(Math.max(0,u.anchor+b),Math.max(0,u.head+b)):g.map(y)}})}else n={changes:l,selection:u&&i.selection.replaceRange(u)}}let o="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,o+=".compose",t.inputState.compositionFirstChange&&(o+=".start",t.inputState.compositionFirstChange=!1)),i.update(n,{userEvent:o,scrollIntoView:!0})}function BAt(t,e,r,n){let i=Math.min(t.length,e.length),a=0;for(;a0&&o>0&&t.charCodeAt(s-1)==e.charCodeAt(o-1);)s--,o--;if(n=="end"){let l=Math.max(0,a-Math.min(s,o));r-=s+l-a}if(s=s?a-r:0;a-=l,o=a+(o-s),s=a}else if(o=o?a-r:0;a-=l,s=a+(s-o),o=a}return{from:a,toA:s,toB:o}}function Gln(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:r,anchorOffset:n,focusNode:i,focusOffset:a}=t.observer.selectionRange;return r&&(e.push(new IAt(r,n)),(i!=r||a!=n)&&e.push(new IAt(i,a))),e}function Hln(t,e){if(t.length==0)return null;let r=t[0].pos,n=t.length==2?t[1].pos:r;return r>-1&&n>-1?bt.single(r+e,n+e):null}function PX(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class Wln{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,br.safari&&e.contentDOM.addEventListener("input",()=>null),br.gecko&&lcn(e.contentDOM.ownerDocument)}handleEvent(e){!tcn(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,r){let n=this.handlers[e];if(n){for(let i of n.observers)i(this.view,r);for(let i of n.handlers){if(r.defaultPrevented)break;if(i(this.view,r)){r.preventDefault();break}}}}ensureHandlers(e){let r=qln(e),n=this.handlers,i=this.view.contentDOM;for(let a in r)if(a!="scroll"){let s=!r[a].handlers.length,o=n[a];o&&s!=!o.handlers.length&&(i.removeEventListener(a,this.handleEvent),o=null),o||i.addEventListener(a,this.handleEvent,{passive:s})}for(let a in n)a!="scroll"&&!r[a]&&i.removeEventListener(a,this.handleEvent);this.handlers=r}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&zAt.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),br.android&&br.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(br.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(FAt.some(r=>r.keyCode==e.keyCode)&&!e.ctrlKey||jln.indexOf(e.key)>-1&&e.ctrlKey)){let r={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};return r.shiftKey&&br.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&Yln(this.view.win)&&(r.shiftKey=!1),this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:r},setTimeout(()=>this.flushIOSKey(),250),!0}return e.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let r=this.pendingIOSKey;return!r||r.key=="Enter"&&e&&e.from0?!0:br.safari&&!br.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function Yln(t){return t.visualViewport?t.visualViewport.height*t.visualViewport.scale/t.document.documentElement.clientHeight<.85:!1}function $At(t,e){return(r,n)=>{try{return e.call(t,n,r)}catch(i){Nh(r.state,i)}}}function qln(t){let e=Object.create(null);function r(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of t){let i=n.spec,a=i&&i.plugin.domEventHandlers,s=i&&i.plugin.domEventObservers;if(a)for(let o in a){let l=a[o];l&&r(o).handlers.push($At(n.value,l))}if(s)for(let o in s){let l=s[o];l&&r(o).observers.push($At(n.value,l))}}for(let n in fg)r(n).handlers.push(fg[n]);for(let n in Pu)r(n).observers.push(Pu[n]);return e}const FAt=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],jln="dthko",zAt=[16,17,18,20,91,92,224,225],NX=6;function BX(t){return Math.max(0,t)*.7+8}function Xln(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class Kln{constructor(e,r,n,i){this.view=e,this.startEvent=r,this.style=n,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=r,this.scrollParents=tAt(e.contentDOM),this.atoms=e.state.facet(K7).map(s=>s(e));let a=e.contentDOM.ownerDocument;a.addEventListener("mousemove",this.move=this.move.bind(this)),a.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=r.shiftKey,this.multiple=e.state.facet(Kn.allowMultipleSelections)&&Zln(e,r),this.dragging=ecn(e,r)&&YAt(r)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Xln(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let r=0,n=0,i=0,a=0,s=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:s}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:a,bottom:o}=this.scrollParents.y.getBoundingClientRect());let l=zxe(this.view);e.clientX-l.left<=i+NX?r=-BX(i-e.clientX):e.clientX+l.right>=s-NX&&(r=BX(e.clientX-s)),e.clientY-l.top<=a+NX?n=-BX(a-e.clientY):e.clientY+l.bottom>=o-NX&&(n=BX(e.clientY-o)),this.setScrollSpeed(r,n)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,r){this.scrollSpeed={x:e,y:r},e||r?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:r}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),r&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=r,r=0),(e||r)&&this.view.win.scrollBy(e,r),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:r}=this,n=MAt(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(r.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(r=>r.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Zln(t,e){let r=t.state.facet(dAt);return r.length?r[0](e):br.mac?e.metaKey:e.ctrlKey}function Jln(t,e){let r=t.state.facet(fAt);return r.length?r[0](e):br.mac?!e.altKey:!e.ctrlKey}function ecn(t,e){let{main:r}=t.state.selection;if(r.empty)return!1;let n=H7(t.root);if(!n||n.rangeCount==0)return!0;let i=n.getRangeAt(0).getClientRects();for(let a=0;a=e.clientX&&s.top<=e.clientY&&s.bottom>=e.clientY)return!0}return!1}function tcn(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let r=e.target,n;r!=t.contentDOM;r=r.parentNode)if(!r||r.nodeType==11||(n=Qs.get(r))&&n.isWidget()&&!n.isHidden&&n.widget.ignoreEvent(e))return!1;return!0}const fg=Object.create(null),Pu=Object.create(null),UAt=br.ie&&br.ie_version<15||br.ios&&br.webkit_version<604;function rcn(t){let e=t.dom.parentNode;if(!e)return;let r=e.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout(()=>{t.focus(),r.remove(),VAt(t,r.value)},50)}function $X(t,e,r){for(let n of t.facet(e))r=n(r,t);return r}function VAt(t,e){e=$X(t.state,Pxe,e);let{state:r}=t,n,i=1,a=r.toText(e),s=a.lines==r.selection.ranges.length;if(jxe!=null&&r.selection.ranges.every(l=>l.empty)&&jxe==a.toString()){let l=-1;n=r.changeByRange(u=>{let h=r.doc.lineAt(u.from);if(h.from==l)return{range:u};l=h.from;let d=r.toText((s?a.line(i++).text:e)+r.lineBreak);return{changes:{from:h.from,insert:d},range:bt.cursor(u.from+d.length)}})}else s?n=r.changeByRange(l=>{let u=a.line(i++);return{changes:{from:l.from,to:l.to,insert:u.text},range:bt.cursor(l.from+u.length)}}):n=r.replaceSelection(a);t.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}Pu.scroll=t=>{let e=t.inputState;e.lastScrollTop=t.scrollDOM.scrollTop,e.lastScrollLeft=t.scrollDOM.scrollLeft,br.ios&&!e.touchActive&&(e.lastIOSMomentumScroll=Date.now())},Pu.wheel=Pu.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()},fg.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1),Pu.touchstart=(t,e)=>{let r=t.inputState,n=e.targetTouches[0];r.touchActive=!0,r.lastTouchTime=Date.now(),n&&(r.lastTouchX=n.clientX,r.lastTouchY=n.clientY),r.setSelectionOrigin("select.pointer")},Pu.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")},Pu.touchend=(t,e)=>{t.inputState.touchActive=!1},fg.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let r=null;for(let n of t.state.facet(pAt))if(r=n(t,e),r)break;if(!r&&e.button==0&&(r=icn(t,e)),r){let n=!t.hasFocus;t.inputState.startMouseSelection(new Kln(t,e,r,n)),n&&t.observer.ignore(()=>{rAt(t.contentDOM);let a=t.root.activeElement;a&&!a.contains(t.contentDOM)&&a.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function QAt(t,e,r,n){if(n==1)return bt.cursor(e,r);if(n==2)return Mln(t.state,e,r);{let i=t.docView.lineAt(e,r),a=t.state.doc.lineAt(i?i.posAtEnd:e),s=i?i.posAtStart:a.from,o=i?i.posAtEnd:a.to;return oDate.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(HAt+1)%3:1}function icn(t,e){let r=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),n=YAt(e),i=t.state.selection;return{update(a){a.docChanged&&(r.pos=a.changes.mapPos(r.pos),i=i.map(a.changes))},get(a,s,o){let l=t.posAndSideAtCoords({x:a.clientX,y:a.clientY},!1),u,h=QAt(t,l.pos,l.assoc,n);if(r.pos!=l.pos&&!s){let d=QAt(t,r.pos,r.assoc,n),f=Math.min(d.from,h.from),p=Math.max(d.to,h.to);h=f1&&(u=acn(i,l.pos))?u:o?i.addRange(h):bt.create([h])}}}function acn(t,e){for(let r=0;r=e)return bt.create(t.ranges.slice(0,r).concat(t.ranges.slice(r+1)),t.mainIndex==r?0:t.mainIndex-(t.mainIndex>r?1:0))}return null}fg.dragstart=(t,e)=>{let{selection:{main:r}}=t.state;if(e.target.draggable){let i=t.docView.tile.nearest(e.target);if(i&&i.isWidget()){let a=i.posAtStart,s=a+i.length;(a>=r.to||s<=r.from)&&(r=bt.undirectionalRange(a,s))}}let{inputState:n}=t;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=r,e.dataTransfer&&(e.dataTransfer.setData("Text",$X(t.state,Nxe,t.state.sliceDoc(r.from,r.to))),e.dataTransfer.effectAllowed="copyMove"),!1},fg.dragend=t=>(t.inputState.draggedContent=null,!1);function qAt(t,e,r,n){if(r=$X(t.state,Pxe,r),!r)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:a}=t.inputState,s=n&&a&&Jln(t,e)?{from:a.from,to:a.to}:null,o={from:i,insert:r},l=t.state.changes(s?[s,o]:o);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:s?"move.drop":"input.drop"}),t.inputState.draggedContent=null}fg.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let r=e.dataTransfer.files;if(r&&r.length){let n=Array(r.length),i=0,a=()=>{++i==r.length&&qAt(t,e,n.filter(s=>s!=null).join(t.state.lineBreak),!1)};for(let s=0;s{/[\x00-\x08\x0e-\x1f]{2}/.test(o.result)||(n[s]=o.result),a()},o.readAsText(r[s])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return qAt(t,e,n,!0),!0}return!1},fg.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let r=UAt?null:e.clipboardData;return r?(VAt(t,r.getData("text/plain")||r.getData("text/uri-list")),!0):(rcn(t),!1)};function scn(t,e){let r=t.dom.parentNode;if(!r)return;let n=r.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),t.focus()},50)}function ocn(t){let e=[],r=[],n=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),r.push(i));if(!e.length){let i=-1;for(let{from:a}of t.selection.ranges){let s=t.doc.lineAt(a);s.number>i&&(e.push(s.text),r.push({from:s.from,to:Math.min(t.doc.length,s.to+1)})),i=s.number}n=!0}return{text:$X(t,Nxe,e.join(t.lineBreak)),ranges:r,linewise:n}}let jxe=null;fg.copy=fg.cut=(t,e)=>{if(!W7(t.contentDOM,t.observer.selectionRange))return!1;let{text:r,ranges:n,linewise:i}=ocn(t.state);if(!r&&!i)return!1;jxe=i?r:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let a=UAt?null:e.clipboardData;return a?(a.clearData(),a.setData("text/plain",r),!0):(scn(t,r),!1)};const jAt=c0.define();function XAt(t,e){let r=[];for(let n of t.facet(vAt)){let i=n(t,e);i&&r.push(i)}return r.length?t.update({effects:r,annotations:jAt.of(!0)}):null}function KAt(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let r=XAt(t.state,e);r?t.dispatch(r):t.update([])}},10)}Pu.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),KAt(t)},Pu.blur=t=>{t.observer.clearSelectionRange(),KAt(t)},Pu.compositionstart=Pu.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))},Pu.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,br.chrome&&br.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))},Pu.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()},fg.beforeinput=(t,e)=>{var r,n;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let a=(r=e.dataTransfer)===null||r===void 0?void 0:r.getData("text/plain"),s=e.getTargetRanges();if(a&&s.length){let o=s[0],l=t.posAtDOM(o.startContainer,o.startOffset),u=t.posAtDOM(o.endContainer,o.endOffset);return qxe(t,{from:l,to:u,insert:t.state.toText(a)},null),!0}}let i;if(br.chrome&&br.android&&(i=FAt.find(a=>a.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let a=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>a+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return br.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),br.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>Pu.compositionend(t,e),20),!1};const ZAt=new Set;function lcn(t){ZAt.has(t)||(ZAt.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const JAt=["pre-wrap","normal","pre-line","break-spaces"];let v4=!1;function eSt(){v4=!1}class ccn{constructor(e){this.lineWrapping=e,this.doc=vi.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,r){let n=this.doc.lineAt(r).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((r-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return JAt.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let r=!1;for(let n=0;n-1,l=Math.abs(r-this.lineHeight)>.3||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=r,this.charWidth=n,this.textHeight=i,this.lineLength=a,l){this.heightSamples={};for(let u=0;u0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>FX&&(v4=!0),this.height=e)}replace(e,r,n){return Nu.of(n)}decomposeLeft(e,r){r.push(this)}decomposeRight(e,r){r.push(this)}applyChanges(e,r,n,i){let a=this,s=n.doc;for(let o=i.length-1;o>=0;o--){let{fromA:l,toA:u,fromB:h,toB:d}=i[o],f=a.lineAt(l,Ma.ByPosNoHeight,n.setDoc(r),0,0),p=f.to>=u?f:a.lineAt(u,Ma.ByPosNoHeight,n,0,0);for(d+=p.to-u,u=p.to;o>0&&f.from<=i[o-1].toA;)l=i[o-1].fromA,h=i[o-1].fromB,o--,la*2){let o=e[r-1];o.break?e.splice(--r,1,o.left,null,o.right):e.splice(--r,1,o.left,o.right),n+=1+o.break,i-=o.size}else if(a>i*2){let o=e[n];o.break?e.splice(n,1,o.left,null,o.right):e.splice(n,1,o.left,o.right),n+=2+o.break,a-=o.size}else break;else if(i=a&&s(this.lineAt(0,Ma.ByPos,n,i,a))}setMeasuredHeight(e){let r=e.heights[e.index++];r<0?(this.spaceAbove=-r,r=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(r)}updateHeight(e,r=0,n=!1,i){return i&&i.from<=r&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class zd extends tSt{constructor(e,r,n){super(e,r,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,r){return new pg(r,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,r,n){let i=n[0];return n.length==1&&(i instanceof zd||i instanceof fc&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof fc?i=new zd(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):Nu.of(n)}updateHeight(e,r=0,n=!1,i){return i&&i.from<=r&&i.more?this.setMeasuredHeight(i):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class fc extends Nu{constructor(e){super(e,0)}heightMetrics(e,r){let n=e.doc.lineAt(r).number,i=e.doc.lineAt(r+this.length).number,a=i-n+1,s,o=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*a);s=l/a,this.length>a+1&&(o=(this.height-l)/(this.length-a-1))}else s=this.height/a;return{firstLine:n,lastLine:i,perLine:s,perChar:o}}blockAt(e,r,n,i){let{firstLine:a,lastLine:s,perLine:o,perChar:l}=this.heightMetrics(r,i);if(r.lineWrapping){let u=i+(e0){let a=n[n.length-1];a instanceof fc?n[n.length-1]=new fc(a.length+i):n.push(null,new fc(i-1))}if(e>0){let a=n[0];a instanceof fc?n[0]=new fc(e+a.length):n.unshift(new fc(e-1),null)}return Nu.of(n)}decomposeLeft(e,r){r.push(new fc(e-1),null)}decomposeRight(e,r){r.push(null,new fc(this.length-e-1))}updateHeight(e,r=0,n=!1,i){let a=r+this.length;if(i&&i.from<=r+this.length&&i.more){let s=[],o=Math.max(r,i.from),l=-1;for(i.from>r&&s.push(new fc(i.from-r-1).updateHeight(e,r));o<=a&&i.more;){let h=e.doc.lineAt(o).length;s.length&&s.push(null);let d=i.heights[i.index++],f=0;d<0&&(f=-d,d=i.heights[i.index++]),l==-1?l=d:Math.abs(d-l)>=FX&&(l=-2);let p=new zd(h,d,f);p.outdated=!1,s.push(p),o+=h+1}o<=a&&s.push(null,new fc(a-o).updateHeight(e,o));let u=Nu.of(s);return(l<0||Math.abs(u.height-this.height)>=FX||Math.abs(l-this.heightMetrics(e,r).perLine)>=FX)&&(v4=!0),zX(this,u)}else(n||this.outdated)&&(this.setHeight(e.heightForGap(r,r+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class dcn extends Nu{constructor(e,r,n){super(e.length+r+n.length,e.height+n.height,r|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,r,n,i){let a=n+this.left.height;return eo))return u;let h=r==Ma.ByPosNoHeight?Ma.ByPosNoHeight:Ma.ByPos;return l?u.join(this.right.lineAt(o,h,n,s,o)):this.left.lineAt(o,h,n,i,a).join(u)}forEachLine(e,r,n,i,a,s){let o=i+this.left.height,l=a+this.left.length+this.break;if(this.break)e=l&&this.right.forEachLine(e,r,n,o,l,s);else{let u=this.lineAt(l,Ma.ByPos,n,i,a);e=e&&u.from<=r&&s(u),r>u.to&&this.right.forEachLine(u.to+1,r,n,o,l,s)}}replace(e,r,n){let i=this.left.length+this.break;if(rthis.left.length)return this.balanced(this.left,this.right.replace(e-i,r-i,n));let a=[];e>0&&this.decomposeLeft(e,a);let s=a.length;for(let o of n)a.push(o);if(e>0&&rSt(a,s-1),r=n&&r.push(null)),e>n&&this.right.decomposeLeft(e-n,r)}decomposeRight(e,r){let n=this.left.length,i=n+this.break;if(e>=i)return this.right.decomposeRight(e-i,r);e2*r.size||r.size>2*e.size?Nu.of(this.break?[e,null,r]:[e,r]):(this.left=zX(this.left,e),this.right=zX(this.right,r),this.setHeight(e.height+r.height),this.outdated=e.outdated||r.outdated,this.size=e.size+r.size,this.length=e.length+this.break+r.length,this)}updateHeight(e,r=0,n=!1,i){let{left:a,right:s}=this,o=r+a.length+this.break,l=null;return i&&i.from<=r+a.length&&i.more?l=a=a.updateHeight(e,r,n,i):a.updateHeight(e,r,n),i&&i.from<=o+s.length&&i.more?l=s=s.updateHeight(e,o,n,i):s.updateHeight(e,o,n),l?this.balanced(a,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function rSt(t,e){let r,n;t[e]==null&&(r=t[e-1])instanceof fc&&(n=t[e+1])instanceof fc&&t.splice(e-1,3,new fc(r.length+1+n.length))}const fcn=5;class Xxe{constructor(e,r){this.pos=e,this.oracle=r,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,r){if(this.lineStart>-1){let n=Math.min(r,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof zd?i.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new zd(n-this.pos,-1,0)),this.writtenTo=n,r>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=r}point(e,r,n){if(e=fcn)&&this.addLineDeco(i,a,s)}else r>e&&this.span(e,r);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:r}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=r,this.writtenToe&&this.nodes.push(new zd(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,r){let n=new fc(r-e);return this.oracle.doc.lineAt(e).to==r&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof zd)return e;let r=new zd(0,-1,0);return this.nodes.push(r),r}addBlock(e){this.enterLine();let r=e.deco;r&&r.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,r&&r.endSide>0&&(this.covering=e)}addLineDeco(e,r,n){let i=this.ensureLine();i.length+=n,i.collapsed+=n,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=r,this.writtenTo=this.pos=this.pos+n}finish(e){let r=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(r instanceof zd)&&!this.isCovered?this.nodes.push(new zd(0,-1,0)):(this.writtenToh.clientHeight||h.scrollWidth>h.clientWidth)&&d.overflow!="visible"){let f=h.getBoundingClientRect();a=Math.max(a,f.left),s=Math.min(s,f.right),o=Math.max(o,f.top),l=Math.min(u==t.parentNode?i.innerHeight:l,f.bottom)}u=d.position=="absolute"||d.position=="fixed"?h.offsetParent:h.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:a-r.left,right:Math.max(a,s)-r.left,top:o-(r.top+e),bottom:Math.max(o,l)-(r.top+e)}}function vcn(t){let e=t.getBoundingClientRect(),r=t.ownerDocument.defaultView||window;return e.left0&&e.top0}function ycn(t,e){let r=t.getBoundingClientRect();return{left:0,right:r.right-r.left,top:e,bottom:r.bottom-(r.top+e)}}class Kxe{constructor(e,r,n,i){this.from=e,this.to=r,this.size=n,this.displaySize=i}static same(e,r){if(e.length!=r.length)return!1;for(let n=0;ntypeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new ccn(n),this.stateDeco=aSt(r),this.heightMap=Nu.empty().applyChanges(this.stateDeco,vi.empty,this.heightOracle.setDoc(r.doc),[new np(0,0,0,r.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ar.set(this.lineGaps.map(i=>i.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:r}=this.state.selection;for(let n=0;n<=1;n++){let i=n?r.head:r.anchor;if(!e.some(({from:a,to:s})=>i>=a&&i<=s)){let{from:a,to:s}=this.lineBlockAt(i);e.push(new UX(a,s))}}return this.viewports=e.sort((n,i)=>n.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?iSt:new Zxe(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(e$(e,this.scaler))})}update(e,r=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=aSt(this.state);let i=e.changedRanges,a=np.extendWithRanges(i,pcn(n,this.stateDeco,e?e.changes:co.empty(this.state.doc.length))),s=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);eSt(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),a),(this.heightMap.height!=s||v4)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=s);let l=a.length?this.mapViewport(this.viewport,e.changes):this.viewport;(r&&(r.range.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,r));let u=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(u||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),r&&(this.scrollTarget=r),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(bAt)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,r=e.contentDOM,n=window.getComputedStyle(r),i=this.heightOracle,a=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?Sa.RTL:Sa.LTR;let s=this.heightOracle.mustRefreshForWrapping(a)||this.mustMeasureContent==="refresh",o=r.getBoundingClientRect(),l=s||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let u=0,h=0;if(o.width&&o.height){let{scaleX:A,scaleY:S}=eAt(r,o);(A>.005&&Math.abs(this.scaleX-A)>.005||S>.005&&Math.abs(this.scaleY-S)>.005)&&(this.scaleX=A,this.scaleY=S,u|=16,s=l=!0)}let d=(parseInt(n.paddingTop)||0)*this.scaleY,f=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=d||this.paddingBottom!=f)&&(this.paddingTop=d,this.paddingBottom=f,u|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,u|=16);let p=tAt(this.view.contentDOM,!1).y;p!=this.scrollParent&&(this.scrollParent=p,this.scrollAnchorHeight=-1,this.scrollOffset=0);let g=this.getScrollOffset();this.scrollOffset!=g&&(this.scrollAnchorHeight=-1,this.scrollOffset=g),this.scrolledToBottom=iAt(this.scrollParent||e.win);let m=(this.printing?ycn:mcn)(r,this.paddingTop),v=m.top-this.pixelViewport.top,y=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let b=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(b!=this.inView&&(this.inView=b,b&&(l=!0)),!this.inView&&!this.scrollTarget&&!vcn(e.dom))return 0;let x=o.width;if((this.contentDOMWidth!=x||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,u|=16),l){let A=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(A)&&(s=!0),s||i.lineWrapping&&Math.abs(x-this.contentDOMWidth)>i.charWidth){let{lineHeight:S,charWidth:T,textHeight:O}=e.docView.measureTextSize();s=S>0&&i.refresh(a,S,T,O,Math.max(5,x/T),A),s&&(e.docView.minWidth=0,u|=16)}v>0&&y>0?h=Math.max(v,y):v<0&&y<0&&(h=Math.min(v,y)),eSt();for(let S of this.viewports){let T=S.from==this.viewport.from?A:e.docView.measureVisibleLineHeights(S);this.heightMap=(s?Nu.empty().applyChanges(this.stateDeco,vi.empty,this.heightOracle,[new np(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,s,new ucn(S.from,T))}v4&&(u|=2)}let w=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return w&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),u|=this.updateForViewport()),(u&2||w)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,e)),u|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),u}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,r){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,a=this.heightOracle,{visibleTop:s,visibleBottom:o}=this,l=new UX(i.lineAt(s-n*1e3,Ma.ByHeight,a,0,0).from,i.lineAt(o+(1-n)*1e3,Ma.ByHeight,a,0,0).to);if(r){let{head:u}=r.range;if(ul.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),d=i.lineAt(u,Ma.ByPos,a,0,0),f;r.y=="center"?f=(d.top+d.bottom)/2-h/2:r.y=="start"||r.y=="nearest"&&u=o+Math.max(10,Math.min(n,250)))&&i>s-2*1e3&&a>1,s=i<<1;if(this.defaultTextDirection!=Sa.LTR&&!n)return[];let o=[],l=(h,d,f,p)=>{if(d-hh&&yy.from>=f.from&&y.to<=f.to&&Math.abs(y.from-h)y.fromb));if(!v){if(dx.from<=d&&x.to>=d)){let x=r.moveToLineBoundary(bt.cursor(d),!1,!0).head;x>h&&(d=x)}let y=this.gapSize(f,h,d,p),b=n||y<2e6?y:2e6;v=new Kxe(h,d,y,b)}o.push(v)},u=h=>{if(h.length2e6)for(let S of e)S.from>=h.from&&S.fromh.from&&l(h.from,p,h,d),gr.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let r=this.stateDeco;this.lineGaps.length&&(r=r.concat(this.lineGapDeco));let n=[];Zn.spans(r,this.viewport.from,this.viewport.to,{span(a,s){n.push({from:a,to:s})},point(){}},20);let i=0;if(n.length!=this.visibleRanges.length)i=12;else for(let a=0;a=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(r=>r.from<=e&&r.to>=e)||e$(this.heightMap.lineAt(e,Ma.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(r=>r.top<=e&&r.bottom>=e)||e$(this.heightMap.lineAt(this.scaler.fromDOM(e),Ma.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let r=this.lineBlockAtHeight(e+8);return r.from>=this.viewport.from||this.viewportLines[0].top-e>200?r:this.viewportLines[0]}elementAtHeight(e){return e$(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class UX{constructor(e,r){this.from=e,this.to=r}}function xcn(t,e,r){let n=[],i=t,a=0;return Zn.spans(r,t,e,{span(){},point(s,o){s>i&&(n.push({from:i,to:s}),a+=s-i),i=o}},20),i=1)return e[e.length-1].to;let n=Math.floor(t*r);for(let i=0;;i++){let{from:a,to:s}=e[i],o=s-a;if(n<=o)return a+n;n-=o}}function QX(t,e){let r=0;for(let{from:n,to:i}of t.ranges){if(e<=i){r+=e-n;break}r+=i-n}return r/t.total}function wcn(t,e){for(let r of t)if(e(r))return r}const iSt={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function aSt(t){let e=t.facet(_X).filter(n=>typeof n!="function"),r=t.facet(Fxe).filter(n=>typeof n!="function");return r.length&&e.push(Zn.join(r)),e}class Zxe{constructor(e,r,n){let i=0,a=0,s=0;this.viewports=n.map(({from:o,to:l})=>{let u=r.lineAt(o,Ma.ByPos,e,0,0).top,h=r.lineAt(l,Ma.ByPos,e,0,0).bottom;return i+=h-u,{from:o,to:l,top:u,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(r.height-i);for(let o of this.viewports)o.domTop=s+(o.top-a)*this.scale,s=o.domBottom=o.domTop+(o.bottom-o.top),a=o.bottom}toDOM(e){for(let r=0,n=0,i=0;;r++){let a=rr.from==e.viewports[n].from&&r.to==e.viewports[n].to):!1}}function e$(t,e){if(e.scale==1)return t;let r=e.toDOM(t.top),n=e.toDOM(t.bottom);return new pg(t.from,t.length,r,n-r,Array.isArray(t._content)?t._content.map(i=>e$(i,e)):t._content)}const GX=vr.define({combine:t=>t.join(" ")}),Jxe=vr.define({combine:t=>t.indexOf(!0)>-1}),e2e=Gy.newName(),sSt=Gy.newName(),oSt=Gy.newName(),lSt={"&light":"."+sSt,"&dark":"."+oSt};function t2e(t,e,r){return new Gy(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,i=>{if(i=="&")return t;if(!r||!r[i])throw new RangeError(`Unsupported selector: ${i}`);return r[i]}):t+" "+n}})}const Acn=t2e("."+e2e,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},lSt),Scn={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},r2e=br.ie&&br.ie_version<=11;class Tcn{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Jon,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(r=>{for(let n of r)this.queue.push(n);(br.ie&&br.ie_version<=11||br.ios&&e.composing)&&r.some(n=>n.type=="childList"&&n.removedNodes.length||n.type=="characterData"&&n.oldValue.length>n.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&br.android&&e.constructor.EDIT_CONTEXT!==!1&&!(br.chrome&&br.chrome_version<126)&&(this.editContext=new Ocn(e),e.state.facet(Wy)&&(e.contentDOM.editContext=this.editContext.editContext)),r2e&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var r;((r=this.view.docView)===null||r===void 0?void 0:r.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),r.length>0&&r[r.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(r=>{r.length>0&&r[r.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((r,n)=>r!=e[n]))){this.gapIntersection.disconnect();for(let r of e)this.gapIntersection.observe(r);this.gaps=e}}onSelectionChange(e){let r=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,i=this.selectionRange;if(n.state.facet(Wy)?n.root.activeElement!=this.dom:!W7(this.dom,i))return;let a=i.anchorNode&&n.docView.tile.nearest(i.anchorNode);if(a&&a.isWidget()&&a.widget.ignoreEvent(e)){r||(this.selectionChanged=!1);return}(br.ie&&br.ie_version<=11||br.android&&br.chrome)&&!n.state.selection.main.empty&&i.focusNode&&q7(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,r=H7(e.root);if(!r)return!1;let n=br.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&Ccn(this.view,r)||r;if(!n||this.selectionRange.eq(n))return!1;let i=W7(this.dom,n);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let a=this.delayedAndroidKey;a&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=a.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&a.force&&h4(this.dom,a.key,a.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:r,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let r=-1,n=-1,i=!1;for(let a of e){let s=this.readMutation(a);s&&(s.typeOver&&(i=!0),r==-1?{from:r,to:n}=s:(r=Math.min(s.from,r),n=Math.max(s.to,n)))}return{from:r,to:n,typeOver:i}}readChange(){let{from:e,to:r,typeOver:n}=this.processRecords(),i=this.selectionChanged&&W7(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let a=new Vln(this.view,e,r,n);return this.view.docView.domChanged={newSel:a.newSel?a.newSel.main:null},a}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let r=this.readChange();if(!r)return this.view.requestMeasure(),!1;let n=this.view.state,i=NAt(this.view,r);return this.view.state==n&&(r.domChanged||r.newSel&&!PX(this.view.state.selection,r.newSel.main))&&this.view.update([]),i}readMutation(e){let r=this.view.docView.tile.nearest(e.target);if(!r||r.isWidget())return null;if(r.markDirty(e.type=="attributes"),e.type=="childList"){let n=cSt(r,e.previousSibling||e.target.previousSibling,-1),i=cSt(r,e.nextSibling||e.target.nextSibling,1);return{from:n?r.posAfter(n):r.posAtStart,to:i?r.posBefore(i):r.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Wy)!=e.state.facet(Wy)&&(e.view.contentDOM.editContext=e.state.facet(Wy)?this.editContext.editContext:null))}destroy(){var e,r,n;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(r=this.gapIntersection)===null||r===void 0||r.disconnect(),(n=this.resizeScroll)===null||n===void 0||n.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function cSt(t,e,r){for(;e;){let n=Qs.get(e);if(n&&n.parent==t)return n;let i=e.parentNode;e=i!=t.dom?i:r>0?e.nextSibling:e.previousSibling}return null}function uSt(t,e){let r=e.startContainer,n=e.startOffset,i=e.endContainer,a=e.endOffset,s=t.docView.domAtPos(t.state.selection.main.anchor,1);return q7(s.node,s.offset,i,a)&&([r,n,i,a]=[i,a,r,n]),{anchorNode:r,anchorOffset:n,focusNode:i,focusOffset:a}}function Ccn(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return uSt(t,i)}let r=null;function n(i){i.preventDefault(),i.stopImmediatePropagation(),r=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",n,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",n,!0),r?uSt(t,r):null}class Ocn{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let r=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let i=e.state.selection.main,{anchor:a,head:s}=i,o=this.toEditorPos(n.updateRangeStart),l=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:o,drifted:!1});let u=l-o>n.text.length;o==this.from&&athis.to&&(l=a);let h=BAt(e.state.sliceDoc(o,l),n.text,(u?i.from:i.to)-o,u?"end":null);if(!h){let f=bt.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));PX(f,i)||e.dispatch({selection:f,userEvent:"select"});return}let d={from:h.from+o,to:h.toA+o,insert:vi.of(n.text.slice(h.from,h.toB).split(` +`))};if((br.mac||br.android)&&d.from==s-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(d={from:o,to:l,insert:vi.of([n.text.replace("."," ")])}),this.pendingContextChange=d,!e.state.readOnly){let f=this.to-this.from+(d.to-d.from+d.insert.length);qxe(e,d,bt.single(this.toEditorPos(n.selectionStart,f),this.toEditorPos(n.selectionEnd,f)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),d.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(r.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(r.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let i=[],a=null;for(let s=this.toEditorPos(n.rangeStart),o=this.toEditorPos(n.rangeEnd);s{let i=[];for(let a of n.getTextFormats()){let s=a.underlineStyle,o=a.underlineThickness;if(!/none/i.test(s)&&!/none/i.test(o)){let l=this.toEditorPos(a.rangeStart),u=this.toEditorPos(a.rangeEnd);if(l{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:n}=this.composing;this.composing=null,n&&this.reset(e.state)}};for(let n in this.handlers)r.addEventListener(n,this.handlers[n]);this.measureReq={read:n=>{let i=H7(n.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let r=0,n=!1,i=this.pendingContextChange;return e.changes.iterChanges((a,s,o,l,u)=>{if(n)return;let h=u.length-(s-a);if(i&&s>=i.to)if(i.from==a&&i.to==s&&i.insert.eq(u)){i=this.pendingContextChange=null,r+=h,this.to+=h;return}else i=null,this.revertPending(e.state);if(a+=r,s+=r,s<=this.from)this.from+=h,this.to+=h;else if(athis.to||this.to-this.from+u.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(a),this.toContextPos(s),u.toString()),this.to+=h}r+=h}),i&&!n&&this.revertPending(e.state),!n}update(e){let r=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||r)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:r}=e.selection.main;this.from=Math.max(0,r-1e4),this.to=Math.min(e.doc.length,r+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let r=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(r.from),this.toContextPos(r.from+r.insert.length),e.doc.sliceString(r.from,r.to))}setSelection(e){let{main:r}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,r.anchor))),i=this.toContextPos(r.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(n,i)}rangeIsValid(e){let{head:r}=e.selection.main;return!(this.from>0&&r-this.from<500||this.to1e4*3)}toEditorPos(e,r=this.to-this.from){e=Math.min(e,r);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let r=this.composing;return r&&r.drifted?r.contextBase+(e-r.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class er{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var r;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(i=>i.forEach(a=>n(a,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||eln(e.parent)||document,this.viewState=new nSt(this,e.state||Kn.create(e)),e.scrollTo&&e.scrollTo.is(EX)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(f4).map(i=>new Bxe(i));for(let i of this.plugins)i.update(this);this.observer=new Tcn(this),this.inputState=new Wln(this),this.inputState.ensureHandlers(this.plugins),this.docView=new RAt(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((r=document.fonts)===null||r===void 0)&&r.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let r=e.length==1&&e[0]instanceof Do?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(r,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let r=!1,n=!1,i,a=this.state;for(let f of e){if(f.startState!=a)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");a=f.state}if(this.destroyed){this.viewState.state=a;return}let s=this.hasFocus,o=0,l=null;e.some(f=>f.annotation(jAt))?(this.inputState.notifiedFocused=s,o=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,l=XAt(a,s),l||(o=1));let u=this.observer.delayedAndroidKey,h=null;if(u?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(a.doc)||!this.state.selection.eq(a.selection))&&(h=null)):this.observer.clear(),a.facet(Kn.phrases)!=this.state.facet(Kn.phrases))return this.setState(a);i=RX.create(this,a,e),i.flags|=o;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(d&&(d=d.map(f.changes)),f.scrollIntoView){let{main:p}=f.state.selection,{x:g,y:m}=this.state.facet(er.cursorScrollMargin);d=new d4(p.empty?p:bt.cursor(p.head,p.head>p.anchor?-1:1),"nearest","nearest",m,g)}for(let p of f.effects)p.is(EX)&&(d=p.value.clip(this.state))}this.viewState.update(i,d),this.bidiCache=HX.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),r=this.docView.update(i),this.state.facet(Z7)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(r,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(GX)!=i.state.facet(GX)&&(this.viewState.mustMeasureContent=!0),(r||n||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),r&&this.docViewUpdate(),!i.empty)for(let f of this.state.facet(Ixe))try{f(i)}catch(p){Nh(this.state,p,"update listener")}(l||h)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),h&&!NAt(this,h)&&u.force&&h4(this.contentDOM,u.key,u.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let r=this.hasFocus;try{for(let n of this.plugins)n.destroy(this);this.viewState=new nSt(this,e),this.plugins=e.facet(f4).map(n=>new Bxe(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new RAt(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}r&&this.focus(),this.requestMeasure()}updatePlugins(e){let r=e.startState.facet(f4),n=e.state.facet(f4);if(r!=n){let i=[];for(let a of n){let s=r.indexOf(a);if(s<0)i.push(new Bxe(a));else{let o=this.plugins[s];o.mustUpdate=e,i.push(o)}}for(let a of this.plugins)a.mustUpdate!=e&&a.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let r=null,n=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:a,scrollAnchorHeight:s}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let o=0;;o++){if(s<0)if(iAt(n||this.win))a=-1,s=this.viewState.heightMap.height;else{let p=this.viewState.scrollAnchorAt(i);a=p.from,s=p.top}this.updateState=1;let l=this.viewState.measure();if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(o>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];l&4||([this.measureRequests,u]=[u,this.measureRequests]);let h=u.map(p=>{try{return p.read(this)}catch(g){return Nh(this.state,g),hSt}}),d=RX.create(this,this.state,[]),f=!1;d.flags|=l,r?r.flags|=l:r=d,this.updateState=2,d.empty||(this.updatePlugins(d),this.inputState.update(d),this.updateAttrs(),f=this.docView.update(d),f&&this.docViewUpdate());for(let p=0;p1||g<-1)&&!(br.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i=i+g,n?n.scrollTop+=g:this.win.scrollBy(0,g),s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(r&&!r.empty)for(let o of this.state.facet(Ixe))o(r)}get themeClasses(){return e2e+" "+(this.state.facet(Jxe)?oSt:sSt)+" "+this.state.facet(GX)}updateAttrs(){let e=dSt(this,AAt,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),r={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Wy)?"true":"false",class:"cm-content",style:`${br.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(r["aria-readonly"]="true"),dSt(this,$xe,r);let n=this.observer.ignore(()=>{let i=Kwt(this.contentDOM,this.contentAttrs,r),a=Kwt(this.dom,this.editorAttrs,e);return i||a});return this.editorAttrs=e,this.contentAttrs=r,n}showAnnouncements(e){let r=!0;for(let n of e)for(let i of n.effects)if(i.is(er.announce)){r&&(this.announceDOM.textContent=""),r=!1;let a=this.announceDOM.appendChild(document.createElement("div"));a.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Z7);let e=this.state.facet(er.cspNonce);Gy.mount(this.root,this.styleModules.concat(Acn).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let r=0;rn.plugin==e)||null),r&&r.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,r,n){return Wxe(this,e,LAt(this,e,r,n))}moveByGroup(e,r){return Wxe(this,e,LAt(this,e,r,n=>Nln(this,e.head,n)))}visualLineSide(e,r){let n=this.bidiSpans(e),i=this.textDirectionAt(e.from),a=n[r?n.length-1:0];return bt.cursor(a.side(r,i)+e.from,a.forward(!r,i)?1:-1)}moveToLineBoundary(e,r,n=!0){return Pln(this,e,r,n)}moveVertically(e,r,n){return Wxe(this,e,Bln(this,e,r,n))}domAtPos(e,r=1){return this.docView.domAtPos(e,r)}posAtDOM(e,r=0){return this.docView.posFromDOM(e,r)}posAtCoords(e,r=!0){this.readMeasured();let n=Yxe(this,e,r);return n&&n.pos}posAndSideAtCoords(e,r=!0){return this.readMeasured(),Yxe(this,e,r)}coordsAtPos(e,r=1){this.readMeasured();let n=this.state.doc.lineAt(e),i=this.bidiSpans(n),a=i[d0.find(i,e-n.from,-1,r)];return this.docView.coordsAt(e,r,a.dir==Sa.RTL)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(yAt)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>kcn)return uAt(e.length);let r=this.textDirectionAt(e.from),n;for(let a of this.bidiCache)if(a.from==e.from&&a.dir==r&&(a.fresh||cAt(a.isolates,n=CAt(this,e))))return a.order;n||(n=CAt(this,e));let i=lln(e.text,r,n);return this.bidiCache.push(new HX(e.from,e.to,r,n,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||br.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{rAt(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,r={}){var n,i,a,s;return EX.of(new d4(typeof e=="number"?bt.cursor(e):e,(n=r.y)!==null&&n!==void 0?n:"nearest",(i=r.x)!==null&&i!==void 0?i:"nearest",(a=r.yMargin)!==null&&a!==void 0?a:5,(s=r.xMargin)!==null&&s!==void 0?s:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:r}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return EX.of(new d4(bt.cursor(n.from),"start","start",n.top-e,r,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return ws.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return ws.define(()=>({}),{eventObservers:e})}static theme(e,r){let n=Gy.newName(),i=[GX.of(n),Z7.of(t2e(`.${n}`,e))];return r&&r.dark&&i.push(Jxe.of(!0)),i}static baseTheme(e){return Fd.lowest(Z7.of(t2e("."+e2e,e,lSt)))}static findFromDOM(e){var r;let n=e.querySelector(".cm-content"),i=n&&Qs.get(n)||Qs.get(e);return((r=i==null?void 0:i.root)===null||r===void 0?void 0:r.view)||null}}er.styleModule=Z7,er.inputHandler=mAt,er.clipboardInputFilter=Pxe,er.clipboardOutputFilter=Nxe,er.scrollHandler=xAt,er.focusChangeEffect=vAt,er.perLineTextDirection=yAt,er.exceptionSink=gAt,er.updateListener=Ixe,er.editable=Wy,er.mouseSelectionStyle=pAt,er.dragMovesSelection=fAt,er.clickAddsSelectionRange=dAt,er.decorations=_X,er.blockWrappers=SAt,er.outerDecorations=Fxe,er.atomicRanges=K7,er.bidiIsolatedRanges=TAt,er.cursorScrollMargin=vr.define({combine:t=>{let e=5,r=5;for(let n of t)typeof n=="number"?e=r=n:{x:e,y:r}=n;return{x:e,y:r}}}),er.scrollMargins=OAt,er.darkTheme=Jxe,er.cspNonce=vr.define({combine:t=>t.length?t[0]:""}),er.contentAttributes=$xe,er.editorAttributes=AAt,er.lineWrapping=er.contentAttributes.of({class:"cm-lineWrapping"}),er.announce=nn.define();const kcn=4096,hSt={};class HX{constructor(e,r,n,i,a,s){this.from=e,this.to=r,this.dir=n,this.isolates=i,this.fresh=a,this.order=s}static update(e,r){if(r.empty&&!e.some(a=>a.fresh))return e;let n=[],i=e.length?e[e.length-1].dir:Sa.LTR;for(let a=Math.max(0,e.length-10);a=0;i--){let a=n[i],s=typeof a=="function"?a(t):a;s&&kxe(s,r)}return r}const Ecn=br.mac?"mac":br.windows?"win":br.linux?"linux":"key";function _cn(t,e){const r=t.split(/-(?!$)/);let n=r[r.length-1];n=="Space"&&(n=" ");let i,a,s,o;for(let l=0;ln.concat(i),[]))),r}function Dcn(t,e,r){return gSt(pSt(t.state),e,t,r)}let s2=null;const Lcn=4e3;function Mcn(t,e=Ecn){let r=Object.create(null),n=Object.create(null),i=(s,o)=>{let l=n[s];if(l==null)n[s]=o;else if(l!=o)throw new Error("Key binding "+s+" is used both as a regular binding and as a multi-stroke prefix")},a=(s,o,l,u,h)=>{var d,f;let p=r[s]||(r[s]=Object.create(null)),g=o.split(/ (?!$)/).map(y=>_cn(y,e));for(let y=1;y{let w=s2={view:x,prefix:b,scope:s};return setTimeout(()=>{s2==w&&(s2=null)},Lcn),!0}]})}let m=g.join(" ");i(m,!1);let v=p[m]||(p[m]={preventDefault:!1,stopPropagation:!1,run:((f=(d=p._any)===null||d===void 0?void 0:d.run)===null||f===void 0?void 0:f.slice())||[]});l&&v.run.push(l),u&&(v.preventDefault=!0),h&&(v.stopPropagation=!0)};for(let s of t){let o=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let u of o){let h=r[u]||(r[u]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:d}=s;for(let f in h)h[f].run.push(p=>d(p,n2e))}let l=s[e]||s.key;if(l)for(let u of o)a(u,l,s.run,s.preventDefault,s.stopPropagation),s.shift&&a(u,"Shift-"+l,s.shift,s.preventDefault,s.stopPropagation)}return r}let n2e=null;function gSt(t,e,r,n){n2e=e;let i=Yon(e),a=Ph(i,0),s=o0(a)==i.length&&i!=" ",o="",l=!1,u=!1,h=!1;s2&&s2.view==r&&s2.scope==n&&(o=s2.prefix+" ",zAt.indexOf(e.keyCode)<0&&(u=!0,s2=null));let d=new Set,f=v=>{if(v){for(let y of v.run)if(!d.has(y)&&(d.add(y),y(r)))return v.stopPropagation&&(h=!0),!0;v.preventDefault&&(v.stopPropagation&&(h=!0),u=!0)}return!1},p=t[n],g,m;return p&&(f(p[o+WX(i,e,!s)])?l=!0:s&&(e.altKey||e.metaKey||e.ctrlKey)&&!(br.windows&&e.ctrlKey&&e.altKey)&&!(br.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(g=i2[e.keyCode])&&g!=i?(f(p[o+WX(g,e,!0)])||e.shiftKey&&(m=U7[e.keyCode])!=i&&m!=g&&f(p[o+WX(m,e,!1)]))&&(l=!0):s&&e.shiftKey&&f(p[o+WX(i,e,!0)])&&(l=!0),!l&&f(p._any)&&(l=!0)),u&&(l=!0),l&&h&&e.stopPropagation(),n2e=null,l}class VT{constructor(e,r,n,i,a){this.className=e,this.left=r,this.top=n,this.width=i,this.height=a}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,r){return r.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,r,n){if(n.empty){let i=e.coordsAtPos(n.head,n.assoc||1);if(!i)return[];let a=mSt(e);return[new VT(r,i.left-a.left,i.top-a.top,null,i.bottom-i.top)]}else return Icn(e,r,n)}}function mSt(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==Sa.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function vSt(t,e,r,n){let i=t.coordsAtPos(e,r*2);if(!i)return n;let a=t.dom.getBoundingClientRect(),s=(i.top+i.bottom)/2,o=t.posAtCoords({x:a.left+1,y:s}),l=t.posAtCoords({x:a.right-1,y:s});return o==null||l==null?n:{from:Math.max(n.from,Math.min(o,l)),to:Math.min(n.to,Math.max(o,l))}}function Icn(t,e,r){if(r.to<=t.viewport.from||r.from>=t.viewport.to)return[];let n=Math.max(r.from,t.viewport.from),i=Math.min(r.to,t.viewport.to),a=t.textDirection==Sa.LTR,s=t.contentDOM,o=s.getBoundingClientRect(),l=mSt(t),u=s.querySelector(".cm-line"),h=u&&window.getComputedStyle(u),d=o.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),f=o.right-(h?parseInt(h.paddingRight):0),p=Hxe(t,n,1),g=Hxe(t,i,-1),m=p.type==dc.Text?p:null,v=g.type==dc.Text?g:null;if(m&&(t.lineWrapping||p.widgetLineBreaks)&&(m=vSt(t,n,1,m)),v&&(t.lineWrapping||g.widgetLineBreaks)&&(v=vSt(t,i,-1,v)),m&&v&&m.from==v.from&&m.to==v.to)return b(x(r.from,r.to,m));{let A=m?x(r.from,null,m):w(p,!1),S=v?x(null,r.to,v):w(g,!0),T=[];return(m||p).to<(v||g).from-(m&&v?1:0)||p.widgetLineBreaks>1&&A.bottom+t.defaultLineHeight/2I&&R.from=M)break;B>D&&_(Math.max(F,D),A==null&&F<=I,Math.min(B,M),S==null&&B>=L,N.dir)}if(D=P.to+1,D>=M)break}return E.length==0&&_(I,A==null,L,S==null,t.textDirection),{top:O,bottom:k,horizontal:E}}function w(A,S){let T=o.top+(S?A.top:A.bottom);return{top:T,bottom:T,horizontal:[]}}}function Pcn(t,e){return t.constructor==e.constructor&&t.eq(e)}class Ncn{constructor(e,r){this.view=e,this.layer=r,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),r.above&&this.dom.classList.add("cm-layer-above"),r.class&&this.dom.classList.add(r.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),r.mount&&r.mount(this.dom,e)}update(e){e.startState.facet(YX)!=e.state.facet(YX)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let r=0,n=e.facet(YX);for(;r!Pcn(r,this.drawn[n]))){let r=this.dom.firstChild,n=0;for(let i of e)i.update&&r&&i.constructor&&this.drawn[n].constructor&&i.update(r,this.drawn[n])?(r=r.nextSibling,n++):this.dom.insertBefore(i.draw(),r);for(;r;){let i=r.nextSibling;r.remove(),r=i}this.drawn=e,br.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const YX=vr.define();function ySt(t){return[ws.define(e=>new Ncn(e,t)),YX.of(t)]}const b4=vr.define({combine(t){return u0(t,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,r)=>Math.min(e,r),drawRangeCursor:(e,r)=>e||r})}});function Bcn(t={}){return[b4.of(t),$cn,Fcn,zcn,bAt.of(!0)]}function bSt(t){return t.startState.facet(b4)!=t.state.facet(b4)}const $cn=ySt({above:!0,markers(t){let{state:e}=t,r=e.facet(b4),n=[];for(let i of e.selection.ranges){let a=i==e.selection.main;if(i.empty||r.drawRangeCursor&&!(a&&br.ios&&r.iosSelectionHandles)){let s=a?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",o=i.empty?i:bt.cursor(i.head,i.assoc);for(let l of VT.forRange(t,s,o))n.push(l)}}return n},update(t,e){t.transactions.some(n=>n.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let r=bSt(t);return r&&xSt(t.state,e),t.docChanged||t.selectionSet||r},mount(t,e){xSt(e.state,t)},class:"cm-cursorLayer"});function xSt(t,e){e.style.animationDuration=t.facet(b4).cursorBlinkRate+"ms"}const Fcn=ySt({above:!1,markers(t){let e=[],{main:r,ranges:n}=t.state.selection;for(let i of n)if(!i.empty)for(let a of VT.forRange(t,"cm-selectionBackground",i))e.push(a);if(br.ios&&!r.empty&&t.state.facet(b4).iosSelectionHandles){for(let i of VT.forRange(t,"cm-selectionHandle cm-selectionHandle-start",bt.cursor(r.from,1)))e.push(i);for(let i of VT.forRange(t,"cm-selectionHandle cm-selectionHandle-end",bt.cursor(r.to,1)))e.push(i)}return e},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||bSt(t)},class:"cm-selectionLayer"}),zcn=Fd.highest(er.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),wSt=nn.define({map(t,e){return t==null?null:e.mapPos(t)}}),t$=Vs.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((r,n)=>n.is(wSt)?n.value:r,t)}}),Ucn=ws.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let r=t.state.field(t$);r==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(t$)!=r||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(t$),r=e!=null&&t.coordsAtPos(e);if(!r)return null;let n=t.scrollDOM.getBoundingClientRect();return{left:r.left-n.left+t.scrollDOM.scrollLeft*t.scaleX,top:r.top-n.top+t.scrollDOM.scrollTop*t.scaleY,height:r.bottom-r.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:r}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/r+"px",this.cursor.style.height=t.height/r+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(t$)!=t&&this.view.dispatch({effects:wSt.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Vcn(){return[t$,Ucn]}function ASt(t,e,r,n,i){e.lastIndex=0;for(let a=t.iterRange(r,n),s=r,o;!a.next().done;s+=a.value.length)if(!a.lineBreak)for(;o=e.exec(a.value);)i(s+o.index,o)}function Qcn(t,e){let r=t.visibleRanges;if(r.length==1&&r[0].from==t.viewport.from&&r[0].to==t.viewport.to)return r;let n=[];for(let{from:i,to:a}of r)i=Math.max(t.state.doc.lineAt(i).from,i-e),a=Math.min(t.state.doc.lineAt(a).to,a+e),n.length&&n[n.length-1].to>=i?n[n.length-1].to=a:n.push({from:i,to:a});return n}class Gcn{constructor(e){const{regexp:r,decoration:n,decorate:i,boundary:a,maxLength:s=1e3}=e;if(!r.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=r,i)this.addMatch=(o,l,u,h)=>i(h,u,u+o[0].length,o,l);else if(typeof n=="function")this.addMatch=(o,l,u,h)=>{let d=n(o,l,u);d&&h(u,u+o[0].length,d)};else if(n)this.addMatch=(o,l,u,h)=>h(u,u+o[0].length,n);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=a,this.maxLength=s}createDeco(e){let r=new Lu,n=r.add.bind(r);for(let{from:i,to:a}of Qcn(e,this.maxLength))ASt(e.state.doc,this.regexp,i,a,(s,o)=>this.addMatch(o,e,s,n));return r.finish()}updateDeco(e,r){let n=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((a,s,o,l)=>{l>=e.view.viewport.from&&o<=e.view.viewport.to&&(n=Math.min(o,n),i=Math.max(l,i))}),e.viewportMoved||i-n>1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,r.map(e.changes),n,i):r}updateRange(e,r,n,i){for(let a of e.visibleRanges){let s=Math.max(a.from,n),o=Math.min(a.to,i);if(o>=s){let l=e.state.doc.lineAt(s),u=l.tol.from;s--)if(this.boundary.test(l.text[s-1-l.from])){h=s;break}for(;of.push(y.range(m,v));if(l==u)for(this.regexp.lastIndex=h-l.from;(p=this.regexp.exec(l.text))&&p.indexthis.addMatch(v,e,m,g));r=r.update({filterFrom:h,filterTo:d,filter:(m,v)=>md,add:f})}}return r}}const i2e=/x/.unicode!=null?"gu":"g",Hcn=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,i2e),Wcn={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let a2e=null;function Ycn(){var t;if(a2e==null&&typeof document<"u"&&document.body){let e=document.body.style;a2e=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return a2e||!1}const qX=vr.define({combine(t){let e=u0(t,{render:null,specialChars:Hcn,addSpecialChars:null});return(e.replaceTabs=!Ycn())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,i2e)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,i2e)),e}});function qcn(t={}){return[qX.of(t),jcn()]}let SSt=null;function jcn(){return SSt||(SSt=ws.fromClass(class{constructor(t){this.view=t,this.decorations=Ar.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(qX)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new Gcn({regexp:t.specialChars,decoration:(e,r,n)=>{let{doc:i}=r.state,a=Ph(e[0],0);if(a==9){let s=i.lineAt(n),o=r.state.tabSize,l=hg(s.text,o,n-s.from);return Ar.replace({widget:new Jcn((o-l%o)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[a]||(this.decorationCache[a]=Ar.replace({widget:new Zcn(t,a)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(qX);t.startState.facet(qX)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const Xcn="•";function Kcn(t){return t>=32?Xcn:t==10?"␤":String.fromCharCode(9216+t)}class Zcn extends Iu{constructor(e,r){super(),this.options=e,this.code=r}eq(e){return e.code==this.code}toDOM(e){let r=Kcn(this.code),n=e.state.phrase("Control character")+" "+(Wcn[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,n,r);if(i)return i;let a=document.createElement("span");return a.textContent=r,a.title=n,a.setAttribute("aria-label",n),a.className="cm-specialChar",a}ignoreEvent(){return!1}}class Jcn extends Iu{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function eun(){return run}const tun=Ar.line({class:"cm-activeLine"}),run=ws.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,r=[];for(let n of t.state.selection.ranges){let i=t.lineBlockAt(n.head);i.from>e&&(r.push(tun.range(i.from)),e=i.from)}return Ar.set(r)}},{decorations:t=>t.decorations});class nun extends Iu{constructor(e){super(),this.content=e}toDOM(e){let r=document.createElement("span");return r.className="cm-placeholder",r.style.pointerEvents="none",r.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),r.setAttribute("aria-hidden","true"),r}coordsAt(e){let r=e.firstChild?Y7(e.firstChild):[];if(!r.length)return null;let n=window.getComputedStyle(e.parentNode),i=j7(r[0],n.direction!="rtl"),a=parseInt(n.lineHeight);return i.bottom-i.top>a*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+a}:i}ignoreEvent(){return!1}}function iun(t){let e=ws.fromClass(class{constructor(r){this.view=r,this.placeholder=t?Ar.set([Ar.widget({widget:new nun(t),side:1}).range(0)]):Ar.none}get decorations(){return this.view.state.doc.length?Ar.none:this.placeholder}},{decorations:r=>r.decorations});return typeof t=="string"?[e,er.contentAttributes.of({"aria-placeholder":t})]:e}const s2e=2e3;function aun(t,e,r){let n=Math.min(e.line,r.line),i=Math.max(e.line,r.line),a=[];if(e.off>s2e||r.off>s2e||e.col<0||r.col<0){let s=Math.min(e.off,r.off),o=Math.max(e.off,r.off);for(let l=n;l<=i;l++){let u=t.doc.line(l);u.length<=o&&a.push(bt.range(u.from+s,u.to+o))}}else{let s=Math.min(e.col,r.col),o=Math.max(e.col,r.col);for(let l=n;l<=i;l++){let u=t.doc.line(l),h=yxe(u.text,s,t.tabSize,!0);if(h<0)a.push(bt.cursor(u.to));else{let d=yxe(u.text,o,t.tabSize);a.push(bt.range(u.from+h,u.from+d))}}}return a}function sun(t,e){let r=t.coordsAtPos(t.viewport.from);return r?Math.round(Math.abs((r.left-e)/t.defaultCharacterWidth)):-1}function TSt(t,e){let r=t.posAtCoords({x:e.clientX,y:e.clientY},!1),n=t.state.doc.lineAt(r),i=r-n.from,a=i>s2e?-1:i==n.length?sun(t,e.clientX):hg(n.text,t.state.tabSize,r-n.from);return{line:n.number,col:a,off:i}}function oun(t,e){let r=TSt(t,e),n=t.state.selection;return r?{update(i){if(i.docChanged){let a=i.changes.mapPos(i.startState.doc.line(r.line).from),s=i.state.doc.lineAt(a);r={line:s.number,col:r.col,off:Math.min(r.off,s.length)},n=n.map(i.changes)}},get(i,a,s){let o=TSt(t,i);if(!o)return n;let l=aun(t.state,r,o);return l.length?s?bt.create(l.concat(n.ranges)):bt.create(l):n}}:null}function lun(t){let e=r=>r.altKey&&r.button==0;return er.mouseSelectionStyle.of((r,n)=>e(n)?oun(r,n):null)}const cun={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},uun={style:"cursor: crosshair"};function hun(t={}){let[e,r]=cun[t.key||"Alt"],n=ws.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||r(i))},keyup(i){(i.keyCode==e||!r(i))&&this.set(!1)},mousemove(i){this.set(r(i))}}});return[n,er.contentAttributes.of(i=>{var a;return!((a=i.plugin(n))===null||a===void 0)&&a.isDown?uun:null})]}const jX="-10000px";class CSt{constructor(e,r,n,i){this.facet=r,this.createTooltipView=n,this.removeTooltipView=i,this.input=e.state.facet(r),this.tooltips=this.input.filter(s=>s);let a=null;this.tooltipViews=this.tooltips.map(s=>a=n(s,a))}update(e,r){var n;let i=e.state.facet(this.facet),a=i.filter(l=>l);if(i===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let s=[],o=r?[]:null;for(let l=0;lr[u]=l),r.length=o.length),this.input=i,this.tooltips=a,this.tooltipViews=s,!0}}function dun(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const o2e=vr.define({combine:t=>{var e,r,n;return{position:br.ios?"absolute":((e=t.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((r=t.find(i=>i.parent))===null||r===void 0?void 0:r.parent)||null,tooltipSpace:((n=t.find(i=>i.tooltipSpace))===null||n===void 0?void 0:n.tooltipSpace)||dun}}}),OSt=new WeakMap,l2e=ws.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(o2e);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new CSt(t,c2e,(r,n)=>this.createTooltip(r,n),r=>{this.resizeObserver&&this.resizeObserver.unobserve(r.dom),r.dom.remove()}),this.above=this.manager.tooltips.map(r=>!!r.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(r=>{Date.now()>this.lastTransaction-50&&r.length>0&&r[r.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let r=e||t.geometryChanged,n=t.state.facet(o2e);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;r=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);r=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);r&&this.maybeMeasure()}createTooltip(t,e){let r=t.create(this.view),n=e?e.dom:null;if(r.dom.classList.add("cm-tooltip"),t.arrow&&!r.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",r.dom.appendChild(i)}return r.dom.style.position=this.position,r.dom.style.top=jX,r.dom.style.left="0px",this.container.insertBefore(r.dom,n),r.mount&&r.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(r.dom),r}destroy(){var t,e,r;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),(t=n.destroy)===null||t===void 0||t.call(n);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(r=this.intersectionObserver)===null||r===void 0||r.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,r=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:a}=this.manager.tooltipViews[0];if(br.safari){let s=a.getBoundingClientRect();r=Math.abs(s.top+1e4)>1||Math.abs(s.left)>1}else r=!!a.offsetParent&&a.offsetParent!=this.container.ownerDocument.body}if(r||this.position=="absolute")if(this.parent){let a=this.parent.getBoundingClientRect();a.width&&a.height&&(t=a.width/this.parent.offsetWidth,e=a.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let n=this.view.scrollDOM.getBoundingClientRect(),i=zxe(this.view);return{visible:{left:n.left+i.left,top:n.top+i.top,right:n.right-i.right,bottom:n.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((a,s)=>{let o=this.manager.tooltipViews[s];return o.getCoords?o.getCoords(a.pos):this.view.coordsAtPos(a.pos)}),size:this.manager.tooltipViews.map(({dom:a})=>a.getBoundingClientRect()),space:this.view.state.facet(o2e).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:r}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let o of this.manager.tooltipViews)o.dom.style.position="absolute"}let{visible:r,space:n,scaleX:i,scaleY:a}=t,s=[];for(let o=0;o=Math.min(r.bottom,n.bottom)||d.rightMath.min(r.right,n.right)+.1)){h.style.top=jX;continue}let p=l.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,g=p?7:0,m=f.right-f.left,v=(e=OSt.get(u))!==null&&e!==void 0?e:f.bottom-f.top,y=u.offset||pun,b=this.view.textDirection==Sa.LTR,x=f.width>n.right-n.left?b?n.left:n.right-f.width:b?Math.max(n.left,Math.min(d.left-(p?14:0)+y.x,n.right-m)):Math.min(Math.max(n.left,d.left-m+(p?14:0)-y.x),n.right-m),w=this.above[o];!l.strictSide&&(w?d.top-v-g-y.yn.bottom)&&w==n.bottom-d.bottom>d.top-n.top&&(w=this.above[o]=!w);let A=(w?d.top-n.top:n.bottom-d.bottom)-g;if(Ax&&O.topS&&(S=w?O.top-v-2-g:O.bottom+g+2);if(this.position=="absolute"?(h.style.top=(S-t.parent.top)/a+"px",kSt(h,(x-t.parent.left)/i)):(h.style.top=S/a+"px",kSt(h,x/i)),p){let O=d.left+(b?y.x:-y.x)-(x+14-7);p.style.left=O/i+"px"}u.overlap!==!0&&s.push({left:x,top:S,right:T,bottom:S+v}),h.classList.toggle("cm-tooltip-above",w),h.classList.toggle("cm-tooltip-below",!w),u.positioned&&u.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=jX}},{eventObservers:{scroll(){this.maybeMeasure()}}});function kSt(t,e){let r=parseInt(t.style.left,10);(isNaN(r)||Math.abs(e-r)>1)&&(t.style.left=e+"px")}const fun=er.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),pun={x:0,y:0},c2e=vr.define({enables:[l2e,fun]}),XX=vr.define({combine:t=>t.reduce((e,r)=>e.concat(r),[])});class KX{static create(e){return new KX(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new CSt(e,XX,(r,n)=>this.createHostedView(r,n),r=>r.dom.remove())}createHostedView(e,r){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,r?r.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let r of this.manager.tooltipViews)r.mount&&r.mount(e);this.mounted=!0}positioned(e){for(let r of this.manager.tooltipViews)r.positioned&&r.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let r of this.manager.tooltipViews)(e=r.destroy)===null||e===void 0||e.call(r)}passProp(e){let r;for(let n of this.manager.tooltipViews){let i=n[e];if(i!==void 0){if(r===void 0)r=i;else if(r!==i)return}}return r}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const gun=c2e.compute([XX],t=>{let e=t.facet(XX);return e.length===0?null:{pos:Math.min(...e.map(r=>r.pos)),end:Math.max(...e.map(r=>{var n;return(n=r.end)!==null&&n!==void 0?n:r.pos})),create:KX.create,above:e[0].above,arrow:e.some(r=>r.arrow)}}),ESt=vr.define();class mun{constructor(e,r,n,i,a,s){this.view=e,this.source=r,this.field=n,this.locked=i,this.setHover=a,this.hoverTime=s,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;es.bottom||r.xs.right+e.defaultCharacterWidth)return;let o=e.bidiSpans(e.state.doc.lineAt(i)).find(u=>u.from<=i&&u.to>=i),l=o&&o.dir==Sa.RTL?-1:1;a=r.x{if(o&&!(Array.isArray(o)&&!o.length)){let l=Array.isArray(o)?o:[o];i&&this.locked.set(l,i),e.dispatch({effects:this.setHover.of(l)})}};if(a&&"then"in a){let o=this.pending={pos:r};a.then(l=>{this.pending==o&&(this.pending=null,s(l))},l=>Nh(e.state,l,"hover tooltip"))}else s(a)}get tooltip(){let e=this.view.plugin(l2e),r=e?e.manager.tooltips.findIndex(n=>n.create==KX.create):-1;return r>-1?e.manager.tooltipViews[r]:null}mousemove(e){var r,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:a}=this;if(i.length&&!this.locked.has(i)&&a&&!vun(a.dom,e)||this.pending){let{pos:s}=i[0]||this.pending,o=(n=(r=i[0])===null||r===void 0?void 0:r.end)!==null&&n!==void 0?n:s;(s==o?this.view.posAtCoords(this.lastMove)!=s:!yun(this.view,s,o,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:r}=this;if(r.length&&!this.locked.has(r)){let{tooltip:n}=this;n&&n.dom.contains(e.relatedTarget)?this.watchTooltipLeave(n.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let r=n=>{e.removeEventListener("mouseleave",r);let{active:i}=this;i.length&&!this.locked.has(i)&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",r)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const ZX=4;function vun(t,e){let{left:r,right:n,top:i,bottom:a}=t.getBoundingClientRect(),s;if(s=t.querySelector(".cm-tooltip-arrow")){let o=s.getBoundingClientRect();i=Math.min(o.top,i),a=Math.max(o.bottom,a)}return e.clientX>=r-ZX&&e.clientX<=n+ZX&&e.clientY>=i-ZX&&e.clientY<=a+ZX}function yun(t,e,r,n,i,a){let s=t.scrollDOM.getBoundingClientRect(),o=t.documentTop+t.documentPadding.top+t.contentHeight;if(s.left>n||s.righti||Math.min(s.bottom,o)=e&&l<=r}function bun(t,e={}){let r=nn.define(),n=new WeakMap,i=Vs.define({create(){return[]},update(s,o){let l=n.get(s);if(s.length&&(e.hideOnChange&&(o.docChanged||o.selection)?s=[]:l&&l(o)?s=[]:e.hideOn&&(s=s.filter(u=>!e.hideOn(o,u)))),o.docChanged&&s.length){let u=[];for(let h of s){let d=o.changes.mapPos(h.pos,-1,uc.TrackDel);if(d!=null){let f=Object.assign(Object.create(null),h);f.pos=d,f.end!=null&&(f.end=o.changes.mapPos(f.end)),u.push(f)}}s=u}for(let u of o.effects)u.is(r)&&(s=u.value,l=void 0),(u.is(wun)&&!u.value||u.value==i)&&(s=[]);return s.length&&l&&n.set(s,l),s},provide:s=>XX.from(s)});const a=ws.define(s=>new mun(s,t,i,n,r,e.hoverTime||300));return{active:i,extension:[i,a,ESt.of(a),gun]}}function xun(t,e,r,n={}){var i;let a=t.state.facet(ESt).map(s=>t.plugin(s)).filter(s=>!!s);if(n.tooltip&&n.tooltip.active){let s=a.find(o=>o.field==n.tooltip.active);s&&(a=[s])}for(let s of a)s.activateHover(t,e,r,(i=n.until)!==null&&i!==void 0?i:()=>!1)}function _St(t,e){let r=t.plugin(l2e);if(!r)return null;let n=r.manager.tooltips.indexOf(e);return n<0?null:r.manager.tooltipViews[n]}const wun=nn.define(),RSt=vr.define({combine(t){let e,r;for(let n of t)e=e||n.topContainer,r=r||n.bottomContainer;return{topContainer:e,bottomContainer:r}}});function u2e(t,e){let r=t.plugin(DSt),n=r?r.specs.indexOf(e):-1;return n>-1?r.panels[n]:null}const DSt=ws.fromClass(class{constructor(t){this.input=t.state.facet(r$),this.specs=this.input.filter(r=>r),this.panels=this.specs.map(r=>r(t));let e=t.state.facet(RSt);this.top=new JX(t,!0,e.topContainer),this.bottom=new JX(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(r=>r.top)),this.bottom.sync(this.panels.filter(r=>!r.top));for(let r of this.panels)r.dom.classList.add("cm-panel"),r.mount&&r.mount()}update(t){let e=t.state.facet(RSt);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new JX(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new JX(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let r=t.state.facet(r$);if(r!=this.input){let n=r.filter(l=>l),i=[],a=[],s=[],o=[];for(let l of n){let u=this.specs.indexOf(l),h;u<0?(h=l(t.view),o.push(h)):(h=this.panels[u],h.update&&h.update(t)),i.push(h),(h.top?a:s).push(h)}this.specs=n,this.panels=i,this.top.sync(a),this.bottom.sync(s);for(let l of o)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let n of this.panels)n.update&&n.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>er.scrollMargins.of(e=>{let r=e.plugin(t);return r&&{top:r.top.scrollMargin(),bottom:r.bottom.scrollMargin()}})});class JX{constructor(e,r,n){this.view=e,this.top=r,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let r of this.panels)r.destroy&&e.indexOf(r)<0&&r.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let r=this.container||this.view.dom;r.insertBefore(this.dom,this.top?r.firstChild:null)}let e=this.dom.firstChild;for(let r of this.panels)if(r.dom.parentNode==this.dom){for(;e!=r.dom;)e=LSt(e);e=e.nextSibling}else this.dom.insertBefore(r.dom,e);for(;e;)e=LSt(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function LSt(t){let e=t.nextSibling;return t.remove(),e}const r$=vr.define({enables:DSt});function Aun(t,e){let r,n=new Promise(s=>r=s),i=s=>Sun(s,e,r);t.state.field(h2e,!1)?t.dispatch({effects:MSt.of(i)}):t.dispatch({effects:nn.appendConfig.of(h2e.init(()=>[i]))});let a=ISt.of(i);return{close:a,result:n.then(s=>((t.win.queueMicrotask||(l=>t.win.setTimeout(l,10)))(()=>{t.state.field(h2e).indexOf(i)>-1&&t.dispatch({effects:a})}),s))}}const h2e=Vs.define({create(){return[]},update(t,e){for(let r of e.effects)r.is(MSt)?t=[r.value].concat(t):r.is(ISt)&&(t=t.filter(n=>n!=r.value));return t},provide:t=>r$.computeN([t],e=>e.field(t))}),MSt=nn.define(),ISt=nn.define();function Sun(t,e,r){let n=e.content?e.content(t,()=>s(null)):null;if(!n){if(n=fa("form"),e.input){let o=fa("input",e.input);/^(text|password|number|email|tel|url)$/.test(o.type)&&o.classList.add("cm-textfield"),o.name||(o.name="input"),n.appendChild(fa("label",(e.label||"")+": ",o))}else n.appendChild(document.createTextNode(e.label||""));n.appendChild(document.createTextNode(" ")),n.appendChild(fa("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let i=n.nodeName=="FORM"?[n]:n.querySelectorAll("form");for(let o=0;o{u.keyCode==27?(u.preventDefault(),s(null)):u.keyCode==13&&(u.preventDefault(),s(l))}),l.addEventListener("submit",u=>{u.preventDefault(),s(l)})}let a=fa("div",n,fa("button",{onclick:()=>s(null),"aria-label":t.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(a.className=e.class),a.classList.add("cm-dialog");function s(o){a.contains(a.ownerDocument.activeElement)&&t.focus(),r(o)}return{dom:a,top:e.top,mount:()=>{if(e.focus){let o;typeof e.focus=="string"?o=n.querySelector(e.focus):o=n.querySelector("input")||n.querySelector("button"),o&&"select"in o?o.select():o&&"focus"in o&&o.focus()}}}}class ip extends n2{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}ip.prototype.elementClass="",ip.prototype.toDOM=void 0,ip.prototype.mapMode=uc.TrackBefore,ip.prototype.startSide=ip.prototype.endSide=-1,ip.prototype.point=!0;const eK=vr.define(),Tun=vr.define(),Cun={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Zn.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},n$=vr.define();function d2e(t){return[NSt(),n$.of({...Cun,...t})]}const PSt=vr.define({combine:t=>t.some(e=>e)});function NSt(t){return[Oun]}const Oun=ws.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(n$).map(e=>new $St(t,e)),this.fixed=!t.state.facet(PSt);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,r=t.view.viewport,n=Math.min(e.to,r.to)-Math.max(e.from,r.from);this.syncGutters(n<(r.to-r.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(PSt)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let r=Zn.iter(this.view.state.facet(eK),this.view.viewport.from),n=[],i=this.gutters.map(a=>new kun(a,this.view.viewport,-this.view.documentPadding.top));for(let a of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(a.type)){let s=!0;for(let o of a.type)if(o.type==dc.Text&&s){f2e(r,n,o.from);for(let l of i)l.line(this.view,o,n);s=!1}else if(o.widget)for(let l of i)l.widget(this.view,o)}else if(a.type==dc.Text){f2e(r,n,a.from);for(let s of i)s.line(this.view,a,n)}else if(a.widget)for(let s of i)s.widget(this.view,a);for(let a of i)a.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(n$),r=t.state.facet(n$),n=t.docChanged||t.heightChanged||t.viewportChanged||!Zn.eq(t.startState.facet(eK),t.state.facet(eK),t.view.viewport.from,t.view.viewport.to);if(e==r)for(let i of this.gutters)i.update(t)&&(n=!0);else{n=!0;let i=[];for(let a of r){let s=e.indexOf(a);s<0?i.push(new $St(this.view,a)):(this.gutters[s].update(t),i.push(this.gutters[s]))}for(let a of this.gutters)a.dom.remove(),i.indexOf(a)<0&&a.destroy();for(let a of i)a.config.side=="after"?this.getDOMAfter().appendChild(a.dom):this.dom.appendChild(a.dom);this.gutters=i}return n}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>er.scrollMargins.of(e=>{let r=e.plugin(t);if(!r||r.gutters.length==0||!r.fixed)return null;let n=r.dom.offsetWidth*e.scaleX,i=r.domAfter?r.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Sa.LTR?{left:n,right:i}:{right:n,left:i}})});function BSt(t){return Array.isArray(t)?t:[t]}function f2e(t,e,r){for(;t.value&&t.from<=r;)t.from==r&&e.push(t.value),t.next()}class kun{constructor(e,r,n){this.gutter=e,this.height=n,this.i=0,this.cursor=Zn.iter(e.markers,r.from)}addElement(e,r,n){let{gutter:i}=this,a=(r.top-this.height)/e.scaleY,s=r.height/e.scaleY;if(this.i==i.elements.length){let o=new FSt(e,s,a,n);i.elements.push(o),i.dom.appendChild(o.dom)}else i.elements[this.i].update(e,s,a,n);this.height=r.bottom,this.i++}line(e,r,n){let i=[];f2e(this.cursor,i,r.from),n.length&&(i=i.concat(n));let a=this.gutter.config.lineMarker(e,r,i);a&&i.unshift(a);let s=this.gutter;i.length==0&&!s.config.renderEmptyElements||this.addElement(e,r,i)}widget(e,r){let n=this.gutter.config.widgetMarker(e,r.widget,r),i=n?[n]:null;for(let a of e.state.facet(Tun)){let s=a(e,r.widget,r);s&&(i||(i=[])).push(s)}i&&this.addElement(e,r,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let r=e.elements.pop();e.dom.removeChild(r.dom),r.destroy()}}}class $St{constructor(e,r){this.view=e,this.config=r,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in r.domEventHandlers)this.dom.addEventListener(n,i=>{let a=i.target,s;if(a!=this.dom&&this.dom.contains(a)){for(;a.parentNode!=this.dom;)a=a.parentNode;let l=a.getBoundingClientRect();s=(l.top+l.bottom)/2}else s=i.clientY;let o=e.lineBlockAtHeight(s-e.documentTop);r.domEventHandlers[n](e,o,i)&&i.preventDefault()});this.markers=BSt(r.markers(e)),r.initialSpacer&&(this.spacer=new FSt(e,0,0,[r.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let r=this.markers;if(this.markers=BSt(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let n=e.view.viewport;return!Zn.eq(this.markers,r,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class FSt{constructor(e,r,n,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,r,n,i)}update(e,r,n,i){this.height!=r&&(this.height=r,this.dom.style.height=r+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),Eun(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,r){let n="cm-gutterElement",i=this.dom.firstChild;for(let a=0,s=0;;){let o=s,l=aa(o,l,u)||s(o,l,u):s}return n}})}});class p2e extends ip{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function g2e(t,e){return t.state.facet(x4).formatNumber(e,t.state)}const Dun=n$.compute([x4],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(_un)},lineMarker(e,r,n){return n.some(i=>i.toDOM)?null:new p2e(g2e(e,e.state.doc.lineAt(r.from).number))},widgetMarker:(e,r,n)=>{for(let i of e.state.facet(Run)){let a=i(e,r,n);if(a)return a}return null},lineMarkerChange:e=>e.startState.facet(x4)!=e.state.facet(x4),initialSpacer(e){return new p2e(g2e(e,USt(e.state.doc.lines)))},updateSpacer(e,r){let n=g2e(r.view,USt(r.view.state.doc.lines));return n==e.number?e:new p2e(n)},domEventHandlers:t.facet(x4).domEventHandlers,side:"before"}));function zSt(t={}){return[x4.of(t),NSt(),Dun]}function USt(t){let e=9;for(;e{let e=[],r=-1;for(let n of t.selection.ranges){let i=t.doc.lineAt(n.head).from;i>r&&(r=i,e.push(Lun.range(i)))}return Zn.of(e)});function Iun(){return Mun}let Pun=0,p0=class ELe{constructor(e,r,n,i){this.name=e,this.set=r,this.base=n,this.modified=i,this.id=Pun++}toString(){let{name:e}=this;for(let r of this.modified)r.name&&(e=`${r.name}(${e})`);return e}static define(e,r){let n=typeof e=="string"?e:"?";if(e instanceof ELe&&(r=e),r!=null&&r.base)throw new Error("Can not derive from a modified tag");let i=new ELe(n,[],null,[]);if(i.set.push(i),r)for(let a of r.set)i.set.push(a);return i}static defineModifier(e){let r=new tK(e);return n=>n.modified.indexOf(r)>-1?n:tK.get(n.base||n,n.modified.concat(r).sort((i,a)=>i.id-a.id))}},Nun=0;class tK{constructor(e){this.name=e,this.instances=[],this.id=Nun++}static get(e,r){if(!r.length)return e;let n=r[0].instances.find(o=>o.base==e&&Bun(r,o.modified));if(n)return n;let i=[],a=new p0(e.name,i,e,r);for(let o of r)o.instances.push(a);let s=$un(r);for(let o of e.set)if(!o.modified.length)for(let l of s)i.push(tK.get(o,l));return a}}function Bun(t,e){return t.length==e.length&&t.every((r,n)=>r==e[n])}function $un(t){let e=[[]];for(let r=0;rn.length-r.length)}function qy(t){let e=Object.create(null);for(let r in t){let n=t[r];Array.isArray(n)||(n=[n]);for(let i of r.split(" "))if(i){let a=[],s=2,o=i;for(let d=0;;){if(o=="..."&&d>0&&d+3==i.length){s=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!f)throw new RangeError("Invalid path: "+i);if(a.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),d+=f[0].length,d==i.length)break;let p=i[d++];if(d==i.length&&p=="!"){s=0;break}if(p!="/")throw new RangeError("Invalid path: "+i);o=i.slice(d)}let l=a.length-1,u=a[l];if(!u)throw new RangeError("Invalid path: "+i);let h=new i$(n,s,l>0?a.slice(0,l):null);e[u]=h.sort(e[u])}}return VSt.add(e)}const VSt=new En({combine(t,e){let r,n,i;for(;t||e;){if(!t||e&&t.depth>=e.depth?(i=e,e=e.next):(i=t,t=t.next),r&&r.mode==i.mode&&!i.context&&!r.context)continue;let a=new i$(i.tags,i.mode,i.context);r?r.next=a:n=a,r=a}return n}});let i$=class{constructor(e,r,n,i){this.tags=e,this.mode=r,this.context=n,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let s=i;for(let o of a)for(let l of o.set){let u=r[l.id];if(u){s=s?s+" "+u:u;break}}return s},scope:n}}function Fun(t,e){let r=null;for(let n of t){let i=n.style(e);i&&(r=r?r+" "+i:i)}return r}function GSt(t,e,r,n=0,i=t.length){let a=new zun(n,Array.isArray(e)?e:[e],r);a.highlightRange(t.cursor(),n,i,"",a.highlighters),a.flush(i)}class zun{constructor(e,r,n){this.at=e,this.highlighters=r,this.span=n,this.class=""}startSpan(e,r){r!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=r)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,r,n,i,a){let{type:s,from:o,to:l}=e;if(o>=n||l<=r)return;s.isTop&&(a=this.highlighters.filter(p=>!p.scope||p.scope(s)));let u=i,h=Uun(e)||i$.empty,d=Fun(a,h.tags);if(d&&(u&&(u+=" "),u+=d,h.mode==1&&(i+=(i?" ":"")+d)),this.startSpan(Math.max(r,o),u),h.opaque)return;let f=e.tree&&e.tree.prop(En.mounted);if(f&&f.overlay){let p=e.node.enter(f.overlay[0].from+o,1),g=this.highlighters.filter(v=>!v.scope||v.scope(f.tree.type)),m=e.firstChild();for(let v=0,y=o;;v++){let b=v=x||!e.nextSibling())););if(!b||x>n)break;y=b.to+o,y>r&&(this.highlightRange(p.cursor(),Math.max(r,b.from+o),Math.min(n,y),"",g),this.startSpan(Math.min(n,y),u))}m&&e.parent()}else if(e.firstChild()){f&&(i="");do if(!(e.to<=r)){if(e.from>=n)break;this.highlightRange(e,r,n,i,a),this.startSpan(Math.min(n,e.to),u)}while(e.nextSibling());e.parent()}}}function Uun(t){let e=t.type.prop(VSt);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const hr=p0.define,rK=hr(),o2=hr(),HSt=hr(o2),WSt=hr(o2),l2=hr(),nK=hr(l2),m2e=hr(l2),g0=hr(),QT=hr(g0),m0=hr(),v0=hr(),v2e=hr(),a$=hr(v2e),iK=hr(),Ee={comment:rK,lineComment:hr(rK),blockComment:hr(rK),docComment:hr(rK),name:o2,variableName:hr(o2),typeName:HSt,tagName:hr(HSt),propertyName:WSt,attributeName:hr(WSt),className:hr(o2),labelName:hr(o2),namespace:hr(o2),macroName:hr(o2),literal:l2,string:nK,docString:hr(nK),character:hr(nK),attributeValue:hr(nK),number:m2e,integer:hr(m2e),float:hr(m2e),bool:hr(l2),regexp:hr(l2),escape:hr(l2),color:hr(l2),url:hr(l2),keyword:m0,self:hr(m0),null:hr(m0),atom:hr(m0),unit:hr(m0),modifier:hr(m0),operatorKeyword:hr(m0),controlKeyword:hr(m0),definitionKeyword:hr(m0),moduleKeyword:hr(m0),operator:v0,derefOperator:hr(v0),arithmeticOperator:hr(v0),logicOperator:hr(v0),bitwiseOperator:hr(v0),compareOperator:hr(v0),updateOperator:hr(v0),definitionOperator:hr(v0),typeOperator:hr(v0),controlOperator:hr(v0),punctuation:v2e,separator:hr(v2e),bracket:a$,angleBracket:hr(a$),squareBracket:hr(a$),paren:hr(a$),brace:hr(a$),content:g0,heading:QT,heading1:hr(QT),heading2:hr(QT),heading3:hr(QT),heading4:hr(QT),heading5:hr(QT),heading6:hr(QT),contentSeparator:hr(g0),list:hr(g0),quote:hr(g0),emphasis:hr(g0),strong:hr(g0),link:hr(g0),monospace:hr(g0),strikethrough:hr(g0),inserted:hr(),deleted:hr(),changed:hr(),invalid:hr(),meta:iK,documentMeta:hr(iK),annotation:hr(iK),processingInstruction:hr(iK),definition:p0.defineModifier("definition"),constant:p0.defineModifier("constant"),function:p0.defineModifier("function"),standard:p0.defineModifier("standard"),local:p0.defineModifier("local"),special:p0.defineModifier("special")};for(let t in Ee){let e=Ee[t];e instanceof p0&&(e.name=t)}QSt([{tag:Ee.link,class:"tok-link"},{tag:Ee.heading,class:"tok-heading"},{tag:Ee.emphasis,class:"tok-emphasis"},{tag:Ee.strong,class:"tok-strong"},{tag:Ee.keyword,class:"tok-keyword"},{tag:Ee.atom,class:"tok-atom"},{tag:Ee.bool,class:"tok-bool"},{tag:Ee.url,class:"tok-url"},{tag:Ee.labelName,class:"tok-labelName"},{tag:Ee.inserted,class:"tok-inserted"},{tag:Ee.deleted,class:"tok-deleted"},{tag:Ee.literal,class:"tok-literal"},{tag:Ee.string,class:"tok-string"},{tag:Ee.number,class:"tok-number"},{tag:[Ee.regexp,Ee.escape,Ee.special(Ee.string)],class:"tok-string2"},{tag:Ee.variableName,class:"tok-variableName"},{tag:Ee.local(Ee.variableName),class:"tok-variableName tok-local"},{tag:Ee.definition(Ee.variableName),class:"tok-variableName tok-definition"},{tag:Ee.special(Ee.variableName),class:"tok-variableName2"},{tag:Ee.definition(Ee.propertyName),class:"tok-propertyName tok-definition"},{tag:Ee.typeName,class:"tok-typeName"},{tag:Ee.namespace,class:"tok-namespace"},{tag:Ee.className,class:"tok-className"},{tag:Ee.macroName,class:"tok-macroName"},{tag:Ee.propertyName,class:"tok-propertyName"},{tag:Ee.operator,class:"tok-operator"},{tag:Ee.comment,class:"tok-comment"},{tag:Ee.meta,class:"tok-meta"},{tag:Ee.invalid,class:"tok-invalid"},{tag:Ee.punctuation,class:"tok-punctuation"}]);var y2e;const c2=new En;function aK(t){return vr.define({combine:t?e=>e.concat(t):void 0})}const b2e=new En;class Ud{constructor(e,r,n=[],i=""){this.data=e,this.name=i,Kn.prototype.hasOwnProperty("tree")||Object.defineProperty(Kn.prototype,"tree",{get(){return pa(this)}}),this.parser=r,this.extension=[Xy.of(this),Kn.languageData.of((a,s,o)=>{let l=YSt(a,s,o),u=l.type.prop(c2);if(!u)return[];let h=a.facet(u),d=l.type.prop(b2e);if(d){let f=l.resolve(s-l.from,o);for(let p of d)if(p.test(f,a)){let g=a.facet(p.facet);return p.type=="replace"?g:g.concat(h)}}return h})].concat(n)}isActiveAt(e,r,n=-1){return YSt(e,r,n).type.prop(c2)==this.data}findRegions(e){let r=e.facet(Xy);if((r==null?void 0:r.data)==this.data)return[{from:0,to:e.doc.length}];if(!r||!r.allowsNesting)return[];let n=[],i=(a,s)=>{if(a.prop(c2)==this.data){n.push({from:s,to:s+a.length});return}let o=a.prop(En.mounted);if(o){if(o.tree.prop(c2)==this.data){if(o.overlay)for(let l of o.overlay)n.push({from:l.from+s,to:l.to+s});else n.push({from:s,to:s+a.length});return}else if(o.overlay){let l=n.length;if(i(o.tree,o.overlay[0].from+s),n.length>l)return}}for(let l=0;ln.isTop?r:void 0)]}),e.name)}configure(e,r){return new jy(this.data,this.parser.configure(e),r||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function pa(t){let e=t.field(Ud.state,!1);return e?e.tree:si.empty}class Vun{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,r){let n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,r):this.string.slice(e-n,r-n)}}let s$=null;class GT{constructor(e,r,n=[],i,a,s,o,l){this.parser=e,this.state=r,this.fragments=n,this.tree=i,this.treeLen=a,this.viewport=s,this.skipped=o,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,r,n){return new GT(e,r,[],si.empty,0,n,[],null)}startParse(){return this.parser.startParse(new Vun(this.state.doc),this.fragments)}work(e,r){return r!=null&&r>=this.state.doc.length&&(r=void 0),this.tree!=si.empty&&this.isDone(r??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),r!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>r)&&r=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(r=this.parse.advance()););}),this.treeLen=e,this.tree=r,this.fragments=this.withoutTempSkipped(Qy.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let r=s$;s$=this;try{return e()}finally{s$=r}}withoutTempSkipped(e){for(let r;r=this.tempSkipped.pop();)e=qSt(e,r.from,r.to);return e}changes(e,r){let{fragments:n,tree:i,treeLen:a,viewport:s,skipped:o}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((u,h,d,f)=>l.push({fromA:u,toA:h,fromB:d,toB:f})),n=Qy.applyChanges(n,l),i=si.empty,a=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){o=[];for(let u of this.skipped){let h=e.mapPos(u.from,1),d=e.mapPos(u.to,-1);he.from&&(this.fragments=qSt(this.fragments,i,a),this.skipped.splice(n--,1))}return this.skipped.length>=r?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,r){this.skipped.push({from:e,to:r})}static getSkippingParser(e){return new class extends mX{createParse(r,n,i){let a=i[0].from,s=i[i.length-1].to;return{parsedPos:a,advance(){let l=s$;if(l){for(let u of i)l.tempSkipped.push(u);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=s,new si(Ro.none,[],[],s-a)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let r=this.fragments;return this.treeLen>=e&&r.length&&r[0].from==0&&r[0].to>=e}static get(){return s$}}function qSt(t,e,r){return Qy.applyChanges(t,[{fromA:e,toA:r,fromB:e,toB:r}])}class w4{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let r=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),r.viewport.to);return r.work(20,n)||r.takeTree(),new w4(r)}static init(e){let r=Math.min(3e3,e.doc.length),n=GT.create(e.facet(Xy).parser,e,{from:0,to:r});return n.work(20,r)||n.takeTree(),new w4(n)}}Ud.state=Vs.define({create:w4.init,update(t,e){for(let r of e.effects)if(r.is(Ud.setState))return r.value;return e.startState.facet(Xy)!=e.state.facet(Xy)?w4.init(e.state):t.apply(e)}});let jSt=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(jSt=t=>{let e=-1,r=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(r):cancelIdleCallback(e)});const x2e=typeof navigator<"u"&&(!((y2e=navigator.scheduling)===null||y2e===void 0)&&y2e.isInputPending)?()=>navigator.scheduling.isInputPending():null,Qun=ws.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let r=this.view.state.field(Ud.state).context;(r.updateViewport(e.view.viewport)||this.view.viewport.to>r.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(r)}scheduleWork(){if(this.working)return;let{state:e}=this.view,r=e.field(Ud.state);(r.tree!=r.context.tree||!r.context.isDone(e.doc.length))&&(this.working=jSt(this.work))}work(e){this.working=null;let r=Date.now();if(this.chunkEndi+1e3,l=a.context.work(()=>x2e&&x2e()||Date.now()>s,i+(o?0:1e5));this.chunkBudget-=Date.now()-r,(l||this.chunkBudget<=0)&&(a.context.takeTree(),this.view.dispatch({effects:Ud.setState.of(new w4(a.context))})),this.chunkBudget>0&&!(l&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(a.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(r=>Nh(this.view.state,r)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Xy=vr.define({combine(t){return t.length?t[0]:null},enables:t=>[Ud.state,Qun,er.contentAttributes.compute([t],e=>{let r=e.facet(t);return r&&r.name?{"data-language":r.name}:{}})]});class u2{constructor(e,r=[]){this.language=e,this.support=r,this.extension=[e,r]}}class sK{constructor(e,r,n,i,a,s=void 0){this.name=e,this.alias=r,this.extensions=n,this.filename=i,this.loadFunc=a,this.support=s,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:r,support:n}=e;if(!r){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");r=()=>Promise.resolve(n)}return new sK(e.name,(e.alias||[]).concat(e.name).map(i=>i.toLowerCase()),e.extensions||[],e.filename,r,n)}static matchFilename(e,r){for(let i of e)if(i.filename&&i.filename.test(r))return i;let n=/\.([^.]+)$/.exec(r);if(n){for(let i of e)if(i.extensions.indexOf(n[1])>-1)return i}return null}static matchLanguageName(e,r,n=!0){r=r.toLowerCase();for(let i of e)if(i.alias.some(a=>a==r))return i;if(n)for(let i of e)for(let a of i.alias){let s=r.indexOf(a);if(s>-1&&(a.length>2||!/\w/.test(r[s-1])&&!/\w/.test(r[s+a.length])))return i}return null}}const Gun=vr.define(),A4=vr.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(r=>r!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function HT(t){let e=t.facet(A4);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function o$(t,e){let r="",n=t.tabSize,i=t.facet(A4)[0];if(i==" "){for(;e>=n;)r+=" ",e-=n;i=" "}for(let a=0;a=e?Hun(t,r,e):null}class oK{constructor(e,r={}){this.state=e,this.options=r,this.unit=HT(e)}lineAt(e,r=1){let n=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:a}=this.options;return i!=null&&i>=n.from&&i<=n.to?a&&i==e?{text:"",from:e}:(r<0?i-1&&(a+=s-this.countColumn(n,n.search(/\S|$/))),a}countColumn(e,r=e.length){return hg(e,this.state.tabSize,r)}lineIndent(e,r=1){let{text:n,from:i}=this.lineAt(e,r),a=this.options.overrideIndentation;if(a){let s=a(i);if(s>-1)return s}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Ky=new En;function Hun(t,e,r){let n=e.resolveStack(r),i=e.resolveInner(r,-1).resolve(r,0).enterUnfinishedNodesBefore(r);if(i!=n.node){let a=[];for(let s=i;s&&!(s.fromn.node.to||s.from==n.node.from&&s.type==n.node.type);s=s.parent)a.push(s);for(let s=a.length-1;s>=0;s--)n={node:a[s],next:n}}return XSt(n,t,r)}function XSt(t,e,r){for(let n=t;n;n=n.next){let i=Yun(n.node);if(i)return i(A2e.create(e,r,n))}return 0}function Wun(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function Yun(t){let e=t.type.prop(Ky);if(e)return e;let r=t.firstChild,n;if(r&&(n=r.type.prop(En.closedBy))){let i=t.lastChild,a=i&&n.indexOf(i.name)>-1;return s=>KSt(s,!0,1,void 0,a&&!Wun(s)?i.from:void 0)}return t.parent==null?qun:null}function qun(){return 0}class A2e extends oK{constructor(e,r,n){super(e.state,e.options),this.base=e,this.pos=r,this.context=n}get node(){return this.context.node}static create(e,r,n){return new A2e(e,r,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let r=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(r.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(jun(n,e))break;r=this.state.doc.lineAt(n.from)}return this.lineIndent(r.from)}continue(){return XSt(this.context.next,this.base,this.pos)}}function jun(t,e){for(let r=e;r;r=r.parent)if(t==r)return!0;return!1}function Xun(t){let e=t.node,r=e.childAfter(e.from),n=e.lastChild;if(!r)return null;let i=t.options.simulateBreak,a=t.state.doc.lineAt(r.from),s=i==null||i<=a.from?a.to:Math.min(a.to,i);for(let o=r.to;;){let l=e.childAfter(o);if(!l||l==n)return null;if(!l.type.isSkipped){if(l.from>=s)return null;let u=/^ */.exec(a.text.slice(r.to-a.from))[0].length;return{from:r.from,to:r.to+u}}o=l.to}}function S4({closing:t,align:e=!0,units:r=1}){return n=>KSt(n,e,r,t)}function KSt(t,e,r,n,i){let a=t.textAfter,s=a.match(/^\s*/)[0].length,o=n&&a.slice(s,s+n.length)==n||i==t.pos+s,l=e?Xun(t):null;return l?o?t.column(l.from):t.column(l.to):t.baseIndent+(o?0:t.unit*r)}const Kun=t=>t.baseIndent;function T4({except:t,units:e=1}={}){return r=>{let n=t&&t.test(r.textAfter);return r.baseIndent+(n?0:e*r.unit)}}const Zun=200;function Jun(){return Kn.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let r=t.newDoc,{head:n}=t.newSelection.main,i=r.lineAt(n);if(n>i.from+Zun)return t;let a=r.sliceString(i.from,n);if(!e.some(u=>u.test(a)))return t;let{state:s}=t,o=-1,l=[];for(let{head:u}of s.selection.ranges){let h=s.doc.lineAt(u);if(h.from==o)continue;o=h.from;let d=w2e(s,h.from);if(d==null)continue;let f=/^\s*/.exec(h.text)[0],p=o$(s,d);f!=p&&l.push({from:h.from,to:h.from+f.length,insert:p})}return l.length?[t,{changes:l,sequential:!0}]:t})}const ZSt=vr.define(),Zy=new En;function l$(t){let e=t.firstChild,r=t.lastChild;return e&&e.tor)continue;if(a&&o.from=e&&u.to>r&&(a=u)}}return a}function thn(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function lK(t,e,r){for(let n of t.facet(ZSt)){let i=n(t,e,r);if(i)return i}return ehn(t,e,r)}function JSt(t,e){let r=e.mapPos(t.from,1),n=e.mapPos(t.to,-1);return r>=n?void 0:{from:r,to:n}}const cK=nn.define({map:JSt}),c$=nn.define({map:JSt});function eTt(t){let e=[];for(let{head:r}of t.state.selection.ranges)e.some(n=>n.from<=r&&n.to>=r)||e.push(t.lineBlockAt(r));return e}const WT=Vs.define({create(){return Ar.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,i)=>t=tTt(t,n,i)),t=t.map(e.changes);let r=[];for(let n of e.effects)n.is(cK)&&!rhn(t,n.value.from,n.value.to)?r.push(n.value):n.is(c$)&&(t=t.update({filter:(i,a)=>n.value.from!=i||n.value.to!=a,filterFrom:n.value.from,filterTo:n.value.to}));if(r.length){let{preparePlaceholder:n}=e.state.facet(iTt),i=r.map(a=>(n?Ar.replace({widget:new ohn(n(e.state,a))}):oTt).range(a.from,a.to));t=t.update({add:i})}return e.selection&&(t=tTt(t,e.selection.main.head)),t},provide:t=>er.decorations.from(t),toJSON(t,e){let r=[];return t.between(0,e.doc.length,(n,i)=>{r.push(n,i)}),r},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let r=0;r{ie&&(n=!0)}),n?t.update({filterFrom:e,filterTo:r,filter:(i,a)=>i>=r||a<=e}):t}function uK(t,e,r){var n;let i=null;return(n=t.field(WT,!1))===null||n===void 0||n.between(e,r,(a,s)=>{(!i||i.from>a)&&(i={from:a,to:s})}),i}function rhn(t,e,r){let n=!1;return t.between(e,e,(i,a)=>{i==e&&a==r&&(n=!0)}),n}function rTt(t,e){return t.field(WT,!1)?e:e.concat(nn.appendConfig.of(aTt()))}const nhn=t=>{for(let e of eTt(t)){let r=lK(t.state,e.from,e.to);if(r)return t.dispatch({effects:rTt(t.state,[cK.of(r),nTt(t,r)])}),!0}return!1},ihn=t=>{if(!t.state.field(WT,!1))return!1;let e=[];for(let r of eTt(t)){let n=uK(t.state,r.from,r.to);n&&e.push(c$.of(n),nTt(t,n,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function nTt(t,e,r=!0){let n=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return er.announce.of(`${t.state.phrase(r?"Folded lines":"Unfolded lines")} ${n} ${t.state.phrase("to")} ${i}.`)}const ahn=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:nhn},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:ihn},{key:"Ctrl-Alt-[",run:t=>{let{state:e}=t,r=[];for(let n=0;n{let e=t.state.field(WT,!1);if(!e||!e.size)return!1;let r=[];return e.between(0,t.state.doc.length,(n,i)=>{r.push(c$.of({from:n,to:i}))}),t.dispatch({effects:r}),!0}}],shn={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},iTt=vr.define({combine(t){return u0(t,shn)}});function aTt(t){return[WT,uhn]}function sTt(t,e){let{state:r}=t,n=r.facet(iTt),i=s=>{let o=t.lineBlockAt(t.posAtDOM(s.target)),l=uK(t.state,o.from,o.to);l&&t.dispatch({effects:c$.of(l)}),s.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(t,i,e);let a=document.createElement("span");return a.textContent=n.placeholderText,a.setAttribute("aria-label",r.phrase("folded code")),a.title=r.phrase("unfold"),a.className="cm-foldPlaceholder",a.onclick=i,a}const oTt=Ar.replace({widget:new class extends Iu{toDOM(t){return sTt(t,null)}}});class ohn extends Iu{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return sTt(e,this.value)}}const lhn={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class S2e extends ip{constructor(e,r){super(),this.config=e,this.open=r}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let r=document.createElement("span");return r.textContent=this.open?this.config.openText:this.config.closedText,r.title=e.state.phrase(this.open?"Fold line":"Unfold line"),r}}function chn(t={}){let e={...lhn,...t},r=new S2e(e,!0),n=new S2e(e,!1),i=ws.fromClass(class{constructor(s){this.from=s.viewport.from,this.markers=this.buildMarkers(s)}update(s){(s.docChanged||s.viewportChanged||s.startState.facet(Xy)!=s.state.facet(Xy)||s.startState.field(WT,!1)!=s.state.field(WT,!1)||pa(s.startState)!=pa(s.state)||e.foldingChanged(s))&&(this.markers=this.buildMarkers(s.view))}buildMarkers(s){let o=new Lu;for(let l of s.viewportLineBlocks){let u=uK(s.state,l.from,l.to)?n:lK(s.state,l.from,l.to)?r:null;u&&o.add(l.from,l.from,u)}return o.finish()}}),{domEventHandlers:a}=e;return[i,d2e({class:"cm-foldGutter",markers(s){var o;return((o=s.plugin(i))===null||o===void 0?void 0:o.markers)||Zn.empty},initialSpacer(){return new S2e(e,!1)},domEventHandlers:{...a,click:(s,o,l)=>{if(a.click&&a.click(s,o,l))return!0;let u=uK(s.state,o.from,o.to);if(u)return s.dispatch({effects:c$.of(u)}),!0;let h=lK(s.state,o.from,o.to);return h?(s.dispatch({effects:cK.of(h)}),!0):!1}}}),aTt()]}const uhn=er.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class u${constructor(e,r){this.specs=e;let n;function i(o){let l=Gy.newName();return(n||(n=Object.create(null)))["."+l]=o,l}const a=typeof r.all=="string"?r.all:r.all?i(r.all):void 0,s=r.scope;this.scope=s instanceof Ud?o=>o.prop(c2)==s.data:s?o=>o==s:void 0,this.style=QSt(e.map(o=>({tag:o.tag,class:o.class||i(Object.assign({},o,{tag:null}))})),{all:a}).style,this.module=n?new Gy(n):null,this.themeType=r.themeType}static define(e,r){return new u$(e,r||{})}}const T2e=vr.define(),lTt=vr.define({combine(t){return t.length?[t[0]]:null}});function hK(t){let e=t.facet(T2e);return e.length?e:t.facet(lTt)}function cTt(t,e){let r=[fhn],n;return t instanceof u$&&(t.module&&r.push(er.styleModule.of(t.module)),n=t.themeType),e!=null&&e.fallback?r.push(lTt.of(t)):n?r.push(T2e.computeN([er.darkTheme],i=>i.facet(er.darkTheme)==(n=="dark")?[t]:[])):r.push(T2e.of(t)),r}function hhn(t,e,r){let n=hK(t),i=null;if(n){for(let a of n)if(!a.scope||r){let s=a.style(e);s&&(i=i?i+" "+s:s)}}return i}class dhn{constructor(e){this.markCache=Object.create(null),this.tree=pa(e.state),this.decorations=this.buildDeco(e,hK(e.state)),this.decoratedTo=e.viewport.to}update(e){let r=pa(e.state),n=hK(e.state),i=n!=hK(e.startState),{viewport:a}=e.view,s=e.changes.mapPos(this.decoratedTo,1);r.length=a.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=s):(r!=this.tree||e.viewportChanged||i)&&(this.tree=r,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=a.to)}buildDeco(e,r){if(!r||!this.tree.length)return Ar.none;let n=new Lu;for(let{from:i,to:a}of e.visibleRanges)GSt(this.tree,r,(s,o,l)=>{n.add(s,o,this.markCache[l]||(this.markCache[l]=Ar.mark({class:l})))},i,a);return n.finish()}}const fhn=Fd.high(ws.fromClass(dhn,{decorations:t=>t.decorations})),phn=u$.define([{tag:Ee.meta,color:"#404740"},{tag:Ee.link,textDecoration:"underline"},{tag:Ee.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Ee.emphasis,fontStyle:"italic"},{tag:Ee.strong,fontWeight:"bold"},{tag:Ee.strikethrough,textDecoration:"line-through"},{tag:Ee.keyword,color:"#708"},{tag:[Ee.atom,Ee.bool,Ee.url,Ee.contentSeparator,Ee.labelName],color:"#219"},{tag:[Ee.literal,Ee.inserted],color:"#164"},{tag:[Ee.string,Ee.deleted],color:"#a11"},{tag:[Ee.regexp,Ee.escape,Ee.special(Ee.string)],color:"#e40"},{tag:Ee.definition(Ee.variableName),color:"#00f"},{tag:Ee.local(Ee.variableName),color:"#30a"},{tag:[Ee.typeName,Ee.namespace],color:"#085"},{tag:Ee.className,color:"#167"},{tag:[Ee.special(Ee.variableName),Ee.macroName],color:"#256"},{tag:Ee.definition(Ee.propertyName),color:"#00c"},{tag:Ee.comment,color:"#940"},{tag:Ee.invalid,color:"#f00"}]),ghn=er.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),uTt=1e4,hTt="()[]{}",dTt=vr.define({combine(t){return u0(t,{afterCursor:!0,brackets:hTt,maxScanDistance:uTt,renderMatch:yhn})}}),mhn=Ar.mark({class:"cm-matchingBracket"}),vhn=Ar.mark({class:"cm-nonmatchingBracket"});function yhn(t){let e=[],r=t.matched?mhn:vhn;return e.push(r.range(t.start.from,t.start.to)),t.end&&e.push(r.range(t.end.from,t.end.to)),e}function fTt(t){let e=[],r=t.facet(dTt);for(let n of t.selection.ranges){if(!n.empty)continue;let i=y0(t,n.head,-1,r)||n.head>0&&y0(t,n.head-1,1,r)||r.afterCursor&&(y0(t,n.head,1,r)||n.headt.decorations}),ghn];function xhn(t={}){return[dTt.of(t),bhn]}const pTt=new En;function C2e(t,e,r){let n=t.prop(e<0?En.openedBy:En.closedBy);if(n)return n;if(t.name.length==1){let i=r.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[r[i+e]]}return null}function O2e(t){let e=t.type.prop(pTt);return e?e(t.node):t}function y0(t,e,r,n={}){let i=n.maxScanDistance||uTt,a=n.brackets||hTt,s=pa(t),o=s.resolveInner(e,r);for(let l=o;l;l=l.parent){let u=C2e(l.type,r,a);if(u&&l.from0?e>=h.from&&eh.from&&e<=h.to))return whn(t,e,r,l,h,u,a)}}return Ahn(t,e,r,s,o.type,i,a)}function whn(t,e,r,n,i,a,s){let o=n.parent,l={from:i.from,to:i.to},u=0,h=o==null?void 0:o.cursor();if(h&&(r<0?h.childBefore(n.from):h.childAfter(n.to)))do if(r<0?h.to<=n.from:h.from>=n.to){if(u==0&&a.indexOf(h.type.name)>-1&&h.from0)return null;let u={from:r<0?e-1:e,to:r>0?e+1:e},h=t.doc.iterRange(e,r>0?t.doc.length:0),d=0;for(let f=0;!h.next().done&&f<=a;){let p=h.value;r<0&&(f+=p.length);let g=e+f*r;for(let m=r>0?0:p.length-1,v=r>0?p.length:-1;m!=v;m+=r){let y=s.indexOf(p[m]);if(!(y<0||n.resolveInner(g+m,1).type!=i))if(y%2==0==r>0)d++;else{if(d==1)return{start:u,end:{from:g+m,to:g+m+1},matched:y>>1==l>>1};d--}}r>0&&(f+=p.length)}return h.done?{start:u,matched:!1}:null}function gTt(t,e,r,n=0,i=0){e==null&&(e=t.search(/[^\s\u00a0]/),e==-1&&(e=t.length));let a=i;for(let s=n;s=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.posr}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let r=this.string.indexOf(e,this.pos);if(r>-1)return this.pos=r,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosn?s.toLowerCase():s,a=this.string.substr(this.pos,e.length);return i(a)==i(e)?(r!==!1&&(this.pos+=e.length),!0):null}else{let i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&r!==!1&&(this.pos+=i[0].length),i)}}current(){return this.string.slice(this.start,this.pos)}}function Shn(t){return{name:t.name||"",token:t.token,blankLine:t.blankLine||(()=>{}),startState:t.startState||(()=>!0),copyState:t.copyState||Thn,indent:t.indent||(()=>null),languageData:t.languageData||{},tokenTable:t.tokenTable||_2e,mergeTokens:t.mergeTokens!==!1}}function Thn(t){if(typeof t!="object")return t;let e={};for(let r in t){let n=t[r];e[r]=n instanceof Array?n.slice():n}return e}const vTt=new WeakMap;class k2e extends Ud{constructor(e){let r=aK(e.languageData),n=Shn(e),i,a=new class extends mX{createParse(s,o,l){return new Ohn(i,s,o,l)}};super(r,a,[],e.name),this.topNode=_hn(r,this),i=this,this.streamParser=n,this.stateAfter=new En({perNode:!0}),this.tokenTable=e.tokenTable?new STt(n.tokenTable):Ehn}static define(e){return new k2e(e)}getIndent(e){let r,{overrideIndentation:n}=e.options;n&&(r=vTt.get(e.state),r!=null&&r1e4)return null;for(;a=n&&r+e.length<=i&&e.prop(t.stateAfter);if(a)return{state:t.streamParser.copyState(a),pos:r+e.length};for(let s=e.children.length-1;s>=0;s--){let o=e.children[s],l=r+e.positions[s],u=o instanceof si&&l=e.length)return e;!i&&r==0&&e.type==t.topNode&&(i=!0);for(let a=e.children.length-1;a>=0;a--){let s=e.positions[a],o=e.children[a],l;if(sr&&E2e(t,a.tree,0-a.offset,r,o),u;if(l&&l.pos<=n&&(u=yTt(t,a.tree,r+a.offset,l.pos+a.offset,!1)))return{state:l.state,tree:u}}return{state:t.streamParser.startState(i?HT(i):4),tree:si.empty}}let Ohn=class{constructor(e,r,n,i){this.lang=e,this.input=r,this.fragments=n,this.ranges=i,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=i[i.length-1].to;let a=GT.get(),s=i[0].from,{state:o,tree:l}=Chn(e,n,s,this.to,a==null?void 0:a.state);this.state=o,this.parsedPos=this.chunkStart=s+l.length;for(let u=0;uu.from<=a.viewport.from&&u.to>=a.viewport.from)&&(this.state=this.lang.streamParser.startState(HT(a.state)),a.skipUntilInView(this.parsedPos,a.viewport.from),this.parsedPos=a.viewport.from),this.moveRangeIndex()}advance(){let e=GT.get(),r=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),n=Math.min(r,this.chunkStart+512);for(e&&(n=Math.min(n,e.viewport.to));this.parsedPos=r?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,r),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let r=this.input.chunk(e);if(this.input.lineChunks)r==` `&&(r="");else{let n=r.indexOf(` -`);n>-1&&(r=r.slice(0,n))}return e+r.length<=this.to?r:r.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,r=this.lineAfter(e),n=e+r.length;for(let i=this.rangeIndex;;){let a=this.ranges[i].to;if(a>=n||(r=r.slice(0,a-(n-r.length)),i++,i==this.ranges.length))break;let s=this.ranges[i].from,o=this.lineAfter(s);r+=o,n=s+o.length}return{line:r,end:n}}skipGapsTo(e,r,n){for(;;){let i=this.ranges[this.rangeIndex].to,a=e+r;if(n>0?i>a:i>=a)break;let s=this.ranges[++this.rangeIndex].from;r+=s-i}return r}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){i=this.skipGapsTo(r,i,1),r+=i;let o=this.chunk.length;i=this.skipGapsTo(n,i,-1),n+=i,a+=this.chunk.length-o}let s=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&a==4&&s>=0&&this.chunk[s]==e&&this.chunk[s+2]==r?this.chunk[s+2]=n:this.chunk.push(e,r,n,a),i}parseLine(e){let{line:r,end:n}=this.nextLine(),i=0,{streamParser:a}=this.lang,s=new mSt(r,e?e.state.tabSize:4,e?HS(e.state):2);if(s.eol())a.blankLine(this.state,s.indentUnit);else for(;!s.eol();){let o=bSt(a.token,s,this.state);if(o&&(i=this.emitToken(this.lang.tokenTable.resolve(o),this.parsedPos+s.start,this.parsedPos+s.pos,i)),s.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPose.start)return i}throw new Error("Stream parser failed to advance stream.")}const _2e=Object.create(null),h$=[Ro.none],khn=new s4(h$),xSt=[],wSt=Object.create(null),ASt=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])ASt[t]=SSt(_2e,e);class TSt{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),ASt)}resolve(e){return e?this.table[e]||(this.table[e]=SSt(this.extra,e)):0}}const Ehn=new TSt(_2e);function R2e(t,e){xSt.indexOf(t)>-1||(xSt.push(t),console.warn(e))}function SSt(t,e){let r=[];for(let o of e.split(" ")){let l=[];for(let u of o.split(".")){let h=t[u]||Ee[u];h?typeof h=="function"?l.length?l=l.map(h):R2e(u,`Modifier ${u} used at start of tag`):l.length?R2e(u,`Tag ${u} used as modifier`):l=Array.isArray(h)?h:[h]:R2e(u,`Unknown highlighting tag ${u}`)}for(let u of l)r.push(u)}if(!r.length)return 0;let n=e.replace(/ /g,"_"),i=n+" "+r.map(o=>o.id),a=wSt[i];if(a)return a.id;let s=wSt[i]=Ro.define({id:h$.length,name:n,props:[qy({[n]:r})]});return h$.push(s),s.id}function _hn(t,e){let r=Ro.define({id:h$.length,name:"Document",props:[c2.add(()=>t),Ky.add(()=>n=>e.getIndent(n))],top:!0});return h$.push(r),r}Ta.RTL,Ta.LTR;let Rhn=class _Le{constructor(e,r,n,i,a,s,o,l,u,h=0,d){this.p=e,this.stack=r,this.state=n,this.reducePos=i,this.pos=a,this.score=s,this.buffer=o,this.bufferBase=l,this.curContext=u,this.lookAhead=h,this.parent=d}toString(){return`[${this.stack.filter((e,r)=>r%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,r,n=0){let i=e.parser.context;return new _Le(e,[],r,n,n,0,[],0,i?new CSt(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,r){this.stack.push(this.state,r,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var r;let n=e>>19,i=e&65535,{parser:a}=this.p,s=this.reducePos=2e3&&!(!((r=this.p.parser.nodeSet.types[i])===null||r===void 0)&&r.isAnonymous)&&(u==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(i,u)}storeNode(e,r,n,i=4,a=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[s-4]==0&&this.buffer[s-1]>-1){if(r==n)return;if(this.buffer[s-2]>=r){this.buffer[s-2]=n;return}}}if(!a||this.pos==n)this.buffer.push(e,r,n,i);else{let s=this.buffer.length;if(s>0&&(this.buffer[s-4]!=0||this.buffer[s-1]<0)){let o=!1;for(let l=s;l>0&&this.buffer[l-2]>n;l-=4)if(this.buffer[l-1]>=0){o=!0;break}if(o)for(;s>0&&this.buffer[s-2]>n;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,i>4&&(i-=4)}this.buffer[s]=e,this.buffer[s+1]=r,this.buffer[s+2]=n,this.buffer[s+3]=i}}shift(e,r,n,i){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=i,this.shiftContext(r,n),r<=this.p.parser.maxNode&&this.buffer.push(r,n,i,4);else{let a=e,{parser:s}=this.p;this.pos=i;let o=s.stateFlag(a,1);!o&&(i>n||r<=s.maxNode)&&(this.reducePos=i),this.pushState(a,o?n:Math.min(n,this.reducePos)),this.shiftContext(r,n),r<=s.maxNode&&this.buffer.push(r,n,i,4)}}apply(e,r,n,i){e&65536?this.reduce(e):this.shift(e,r,n,i)}useNode(e,r){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(r,i),this.buffer.push(n,i,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,r=e.buffer.length;for(r&&e.buffer[r-4]==0&&(r-=4);r>0&&e.buffer[r-2]>e.reducePos;)r-=4;let n=e.buffer.slice(r),i=e.bufferBase+r;for(;e&&i==e.bufferBase;)e=e.parent;return new _Le(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,r){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,r,4),this.storeNode(0,this.pos,r,n?8:4),this.pos=this.reducePos=r,this.score-=190}canShift(e){for(let r=new Dhn(this);;){let n=this.p.parser.stateSlot(r.state,4)||this.p.parser.hasAction(r.state,e);if(n==0)return!1;if(!(n&65536))return!0;r.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let r=this.p.parser.nextStates(this.state);if(r.length>8||this.stack.length>=120){let i=[];for(let a=0,s;al&1&&o==s)||i.push(r[a],s)}r=i}let n=[];for(let i=0;i>19,i=r&65535,a=this.stack.length-n*3;if(a<0||e.getGoto(this.stack[a],i,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;r=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(r),!0}findForcedReduction(){let{parser:e}=this.p,r=[],n=(i,a)=>{if(!r.includes(i))return r.push(i),e.allActions(i,s=>{if(!(s&393216))if(s&65536){let o=(s>>19)-a;if(o>1){let l=s&65535,u=this.stack.length-o*3;if(u>=0&&e.getGoto(this.stack[u],l,!1)>=0)return o<<19|65536|l}}else{let o=n(s,a+1);if(o!=null)return o}})};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 r=0;r0&&this.emitLookAhead()}};class CSt{constructor(e,r){this.tracker=e,this.context=r,this.hash=e.strict?e.hash(r):0}}class Dhn{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let r=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 i=this.start.p.parser.getGoto(this.stack[this.base-3],r,!0);this.state=i}}class dK{constructor(e,r,n){this.stack=e,this.pos=r,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,r=e.bufferBase+e.buffer.length){return new dK(e,r,r-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 dK(this.stack,this.pos,this.index)}}function d$(t,e=Uint16Array){if(typeof t!="string")return t;let r=null;for(let n=0,i=0;n=92&&s--,s>=34&&s--;let l=s-32;if(l>=46&&(l-=46,o=!0),a+=l,o)break;a*=46}r?r[i++]=a:r=new e(a)}return r}class fK{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const OSt=new fK;class Lhn{constructor(e,r){this.input=e,this.ranges=r,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=OSt,this.rangeIndex=0,this.pos=this.chunkPos=r[0].from,this.range=r[0],this.end=r[r.length-1].to,this.readNext()}resolveOffset(e,r){let n=this.range,i=this.rangeIndex,a=this.pos+e;for(;an.to:a>=n.to;){if(i==this.ranges.length-1)return null;let s=this.ranges[++i];a+=s.from-n.to,n=s}return a}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,r.from);return this.end}peek(e){let r=this.chunkOff+e,n,i;if(r>=0&&r=this.chunk2Pos&&no.to&&(this.chunk2=this.chunk2.slice(0,o.to-n)),i=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),i}acceptToken(e,r=0){let n=r?this.resolveOffset(r,-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,r){if(r?(this.token=r,r.start=e,r.lookAhead=e+1,r.value=r.extended=-1):this.token=OSt,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&&r<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,r-this.chunkPos);if(e>=this.chunk2Pos&&r<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,r-this.chunk2Pos);if(e>=this.range.from&&r<=this.range.to)return this.input.read(e,r);let n="";for(let i of this.ranges){if(i.from>=r)break;i.to>e&&(n+=this.input.read(Math.max(i.from,e),Math.min(i.to,r)))}return n}}class C4{constructor(e,r){this.data=e,this.id=r}token(e,r){let{parser:n}=r.p;kSt(this.data,e,r,this.id,n.data,n.tokenPrecTable)}}C4.prototype.contextual=C4.prototype.fallback=C4.prototype.extend=!1;class pK{constructor(e,r,n){this.precTable=r,this.elseToken=n,this.data=typeof e=="string"?d$(e):e}token(e,r){let n=e.pos,i=0;for(;;){let a=e.next<0,s=e.resolveOffset(1,1);if(kSt(this.data,e,r,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(a||i++,s==null)break;e.reset(s,e.token)}i&&(e.reset(n,e.token),e.acceptToken(this.elseToken,i))}}pK.prototype.contextual=C4.prototype.fallback=C4.prototype.extend=!1;class uo{constructor(e,r={}){this.token=e,this.contextual=!!r.contextual,this.fallback=!!r.fallback,this.extend=!!r.extend}}function kSt(t,e,r,n,i,a){let s=0,o=1<0){let g=t[p];if(l.allows(g)&&(e.token.value==-1||e.token.value==g||Mhn(g,e.token.value,i,a))){e.acceptToken(g);break}}let h=e.next,d=0,f=t[s+2];if(e.next<0&&f>d&&t[u+f*3-3]==65535){s=t[u+f*3-1];continue e}for(;d>1,g=u+p+(p<<1),m=t[g],v=t[g+1]||65536;if(h=v)d=p+1;else{s=t[g+2],e.advance();continue e}}break}}function ESt(t,e,r){for(let n=e,i;(i=t[n])!=65535;n++)if(i==r)return n-e;return-1}function Mhn(t,e,r,n){let i=ESt(r,n,e);return i<0||ESt(r,n,t)e)&&!n.type.isError)return r<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(t.length,Math.max(n.from+1,e+25));if(r<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return r<0?0:t.length}}let Ihn=class{constructor(e,r){this.fragments=e,this.nodeSet=r,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?_St(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?_St(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=s,null;if(a instanceof si){if(s==e){if(s=Math.max(this.safeFrom,e)&&(this.trees.push(a),this.start.push(s),this.index.push(0))}else this.index[r]++,this.nextStart=s+a.length}}};class Phn{constructor(e,r){this.stream=r,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new fK)}getActions(e){let r=0,n=null,{parser:i}=e.p,{tokenizers:a}=i,s=i.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,l=0;for(let u=0;ud.end+25&&(l=Math.max(d.lookAhead,l)),d.value!=0)){let f=r;if(d.extended>-1&&(r=this.addActions(e,d.extended,d.end,r)),r=this.addActions(e,d.value,d.end,r),!h.extend&&(n=d,r>f))break}}for(;this.actions.length>r;)this.actions.pop();return l&&e.setLookAhead(l),!n&&e.pos==this.stream.end&&(n=new fK,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,r=this.addActions(e,n.value,n.end,r)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let r=new fK,{pos:n,p:i}=e;return r.start=n,r.end=Math.min(n+1,i.stream.end),r.value=n==i.stream.end?i.parser.eofTerm:0,r}updateCachedToken(e,r,n){let i=this.stream.clipPos(n.pos);if(r.token(this.stream.reset(i,e),n),e.value>-1){let{parser:a}=n.p;for(let s=0;s=0&&n.p.parser.dialect.allows(o>>1)){o&1?e.extended=o>>1:e.value=o>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,r,n,i){for(let a=0;ae.bufferLength*4?new Ihn(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,r=this.minStackPos,n=this.stacks=[],i,a;if(this.bigReductionCount>300&&e.length==1){let[s]=e;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;sr)n.push(o);else{if(this.advanceStack(o,n,e))continue;{i||(i=[],a=[]),i.push(o);let l=this.tokens.getMainToken(o);a.push(l.value,l.end)}}break}}if(!n.length){let s=i&&$hn(i);if(s)return Vd&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw Vd&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+r);this.recovering||(this.recovering=5)}if(this.recovering&&i){let s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,a,n);if(s)return Vd&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(n.length>s)for(n.sort((o,l)=>l.score-o.score);n.length>s;)n.pop();n.some(o=>o.reducePos>r)&&this.recovering--}else if(n.length>1){e:for(let s=0;s500&&u.buffer.length>500)if((o.score-u.score||o.buffer.length-u.buffer.length)>0)n.splice(l--,1);else{n.splice(s--,1);continue e}}}n.length>12&&(n.sort((s,o)=>o.score-s.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let s=1;s ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let u=e.curContext&&e.curContext.tracker.strict,h=u?e.curContext.hash:0;for(let d=this.fragments.nodeAt(i);d;){let f=this.parser.nodeSet.types[d.type.id]==d.type?a.getGoto(e.state,d.type.id):-1;if(f>-1&&d.length&&(!u||(d.prop(En.contextHash)||0)==h))return e.useNode(d,f),Vd&&console.log(s+this.stackID(e)+` (via reuse of ${a.getName(d.type.id)})`),!0;if(!(d instanceof si)||d.children.length==0||d.positions[0]>0)break;let p=d.children[0];if(p instanceof si&&d.positions[0]==0)d=p;else break}}let o=a.stateSlot(e.state,4);if(o>0)return e.reduce(o),Vd&&console.log(s+this.stackID(e)+` (via always-reduce ${a.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let u=0;ui?r.push(g):n.push(g)}return!1}advanceFully(e,r){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return RSt(e,r),!0}}runRecovery(e,r,n){let i=null,a=!1;for(let s=0;s ":"";if(o.deadEnd&&(a||(a=!0,o.restart(),Vd&&console.log(h+this.stackID(o)+" (restarted)"),this.advanceFully(o,n))))continue;let d=o.split(),f=h;for(let p=0;p<10&&d.forceReduce()&&(Vd&&console.log(f+this.stackID(d)+" (via force-reduce)"),!this.advanceFully(d,n));p++)Vd&&(f=this.stackID(d)+" -> ");for(let p of o.recoverByInsert(l))Vd&&console.log(h+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,n);this.stream.end>o.pos?(u==o.pos&&(u++,l=0),o.recoverByDelete(l,u),Vd&&console.log(h+this.stackID(o)+` (via recover-delete ${this.parser.getName(l)})`),RSt(o,n)):(!i||i.scoret;class gK{constructor(e){this.start=e.start,this.shift=e.shift||L2e,this.reduce=e.reduce||L2e,this.reuse=e.reuse||L2e,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Jy extends mX{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let r=e.nodeNames.split(" ");this.minRepeatTerm=r.length;for(let o=0;oe.topRules[o][1]),i=[];for(let o=0;o=0)a(h,l,o[u++]);else{let d=o[u+-h];for(let f=-h;f>0;f--)a(o[u++],l,d);u++}}}this.nodeSet=new s4(r.map((o,l)=>Ro.define({name:l>=this.minRepeatTerm?void 0:o,id:l,props:i[l],top:n.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=nwt;let s=d$(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;otypeof o=="number"?new C4(s,o):o),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,r,n){let i=new Nhn(this,e,r,n);for(let a of this.wrappers)i=a(i,e,r,n);return i}getGoto(e,r,n=!1){let i=this.goto;if(r>=i[0])return-1;for(let a=i[r+1];;){let s=i[a++],o=s&1,l=i[a++];if(o&&n)return l;for(let u=a+(s>>1);a0}validAction(e,r){return!!this.allActions(e,n=>n==r?!0:null)}allActions(e,r){let n=this.stateSlot(e,4),i=n?r(n):void 0;for(let a=this.stateSlot(e,1);i==null;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=e1(this.data,a+2);else break;i=r(e1(this.data,a+1))}return i}nextStates(e){let r=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=e1(this.data,n+2);else break;if(!(this.data[n+2]&1)){let i=this.data[n+1];r.some((a,s)=>s&1&&a==i)||r.push(this.data[n],i)}}return r}configure(e){let r=Object.assign(Object.create(Jy.prototype),this);if(e.props&&(r.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}`);r.top=n}return e.tokenizers&&(r.tokenizers=this.tokenizers.map(n=>{let i=e.tokenizers.find(a=>a.from==n);return i?i.to:n})),e.specializers&&(r.specializers=this.specializers.slice(),r.specializerSpecs=this.specializerSpecs.map((n,i)=>{let a=e.specializers.find(o=>o.from==n.external);if(!a)return n;let s=Object.assign(Object.assign({},n),{external:a.to});return r.specializers[i]=DSt(s),s})),e.contextTracker&&(r.context=e.contextTracker),e.dialect&&(r.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(r.strict=e.strict),e.wrap&&(r.wrappers=r.wrappers.concat(e.wrap)),e.bufferLength!=null&&(r.bufferLength=e.bufferLength),r}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 r=this.dynamicPrecedences;return r==null?0:r[e]||0}parseDialect(e){let r=Object.keys(this.dialects),n=r.map(()=>!1);if(e)for(let a of e.split(" ")){let s=r.indexOf(a);s>=0&&(n[s]=!0)}let i=null;for(let a=0;an)&&r.p.parser.stateFlag(r.state,2)&&(!e||e.scoret.external(r,n)<<1|e}return t.get}const Fhn=316,zhn=317,LSt=1,Uhn=2,Vhn=3,Qhn=4,Ghn=318,Hhn=320,Whn=321,Yhn=5,qhn=6,jhn=0,M2e=[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],MSt=125,Xhn=59,I2e=47,Khn=42,Zhn=43,Jhn=45,edn=60,tdn=44,rdn=63,ndn=46,idn=91,adn=new gK({start:!1,shift(t,e){return e==Yhn||e==qhn||e==Hhn?t:e==Whn},strict:!1}),sdn=new uo((t,e)=>{let{next:r}=t;(r==MSt||r==-1||e.context)&&t.acceptToken(Ghn)},{contextual:!0,fallback:!0}),odn=new uo((t,e)=>{let{next:r}=t,n;M2e.indexOf(r)>-1||r==I2e&&((n=t.peek(1))==I2e||n==Khn)||r!=MSt&&r!=Xhn&&r!=-1&&!e.context&&t.acceptToken(Fhn)},{contextual:!0}),ldn=new uo((t,e)=>{t.next==idn&&!e.context&&t.acceptToken(zhn)},{contextual:!0}),cdn=new uo((t,e)=>{let{next:r}=t;if(r==Zhn||r==Jhn){if(t.advance(),r==t.next){t.advance();let n=!e.context&&e.canShift(LSt);t.acceptToken(n?LSt:Uhn)}}else r==rdn&&t.peek(1)==ndn&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(Vhn))},{contextual:!0});function P2e(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}const udn=new uo((t,e)=>{if(t.next!=edn||!e.dialectEnabled(jhn)||(t.advance(),t.next==I2e))return;let r=0;for(;M2e.indexOf(t.next)>-1;)t.advance(),r++;if(P2e(t.next,!0)){for(t.advance(),r++;P2e(t.next,!1);)t.advance(),r++;for(;M2e.indexOf(t.next)>-1;)t.advance(),r++;if(t.next==tdn)return;for(let n=0;;n++){if(n==7){if(!P2e(t.next,!0))return;break}if(t.next!="extends".charCodeAt(n))break;t.advance(),r++}}t.acceptToken(Qhn,-r)}),hdn=qy({"get set async static":Ee.modifier,"for while do if else switch try catch finally return throw break continue default case defer":Ee.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":Ee.operatorKeyword,"let var const using function class extends":Ee.definitionKeyword,"import export from":Ee.moduleKeyword,"with debugger new":Ee.keyword,TemplateString:Ee.special(Ee.string),super:Ee.atom,BooleanLiteral:Ee.bool,this:Ee.self,null:Ee.null,Star:Ee.modifier,VariableName:Ee.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":Ee.function(Ee.variableName),VariableDefinition:Ee.definition(Ee.variableName),Label:Ee.labelName,PropertyName:Ee.propertyName,PrivatePropertyName:Ee.special(Ee.propertyName),"CallExpression/MemberExpression/PropertyName":Ee.function(Ee.propertyName),"FunctionDeclaration/VariableDefinition":Ee.function(Ee.definition(Ee.variableName)),"ClassDeclaration/VariableDefinition":Ee.definition(Ee.className),"NewExpression/VariableName":Ee.className,PropertyDefinition:Ee.definition(Ee.propertyName),PrivatePropertyDefinition:Ee.definition(Ee.special(Ee.propertyName)),UpdateOp:Ee.updateOperator,"LineComment Hashbang":Ee.lineComment,BlockComment:Ee.blockComment,Number:Ee.number,String:Ee.string,Escape:Ee.escape,ArithOp:Ee.arithmeticOperator,LogicOp:Ee.logicOperator,BitOp:Ee.bitwiseOperator,CompareOp:Ee.compareOperator,RegExp:Ee.regexp,Equals:Ee.definitionOperator,Arrow:Ee.function(Ee.punctuation),": Spread":Ee.punctuation,"( )":Ee.paren,"[ ]":Ee.squareBracket,"{ }":Ee.brace,"InterpolationStart InterpolationEnd":Ee.special(Ee.brace),".":Ee.derefOperator,", ;":Ee.separator,"@":Ee.meta,TypeName:Ee.typeName,TypeDefinition:Ee.definition(Ee.typeName),"type enum interface implements namespace module declare":Ee.definitionKeyword,"abstract global Privacy readonly override":Ee.modifier,"is keyof unique infer asserts":Ee.operatorKeyword,JSXAttributeValue:Ee.attributeValue,JSXText:Ee.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":Ee.angleBracket,"JSXIdentifier JSXNameSpacedName":Ee.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":Ee.attributeName,"JSXBuiltin/JSXIdentifier":Ee.standard(Ee.tagName)}),ddn={__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},fdn={__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},pdn={__proto__:null,"<":193},gdn=Jy.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:adn,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:[hdn],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:[odn,ldn,cdn,udn,2,3,4,5,6,7,8,9,10,11,12,13,14,sdn,new pK("$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 pK("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:t=>ddn[t]||-1},{term:343,get:t=>fdn[t]||-1},{term:95,get:t=>pdn[t]||-1}],tokenPrec:15201});class N2e{constructor(e,r,n,i){this.state=e,this.pos=r,this.explicit=n,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let r=pa(this.state).resolveInner(this.pos,-1);for(;r&&e.indexOf(r.name)<0;)r=r.parent;return r?{from:r.from,to:this.pos,text:this.state.sliceDoc(r.from,this.pos),type:r.type}:null}matchBefore(e){let r=this.state.doc.lineAt(this.pos),n=Math.max(r.from,this.pos-250),i=r.text.slice(n-r.from,this.pos-r.from),a=i.search(BSt(e,!1));return a<0?null:{from:n+a,to:this.pos,text:i.slice(a)}}get aborted(){return this.abortListeners==null}addEventListener(e,r,n){e=="abort"&&this.abortListeners&&(this.abortListeners.push(r),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function ISt(t){let e=Object.keys(t).join(""),r=/\w/.test(e);return r&&(e=e.replace(/\w/g,"")),`[${r?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function mdn(t){let e=Object.create(null),r=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let a=1;atypeof i=="string"?{label:i}:i),[r,n]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:mdn(e);return i=>{let a=i.matchBefore(n);return a||i.explicit?{from:a?a.from:i.pos,options:e,validFor:r}:null}}function PSt(t,e){return r=>{for(let n=pa(r.state).resolveInner(r.pos,-1);n;n=n.parent){if(t.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return e(r)}}let NSt=class{constructor(e,r,n,i){this.completion=e,this.source=r,this.match=n,this.score=i}};function YS(t){return t.selection.main.from}function BSt(t,e){var r;let{source:n}=t,i=e&&n[0]!="^",a=n[n.length-1]!="$";return!i&&!a?t:new RegExp(`${i?"^":""}(?:${n})${a?"$":""}`,(r=t.flags)!==null&&r!==void 0?r:t.ignoreCase?"i":"")}const $2e=c0.define();function vdn(t,e,r,n){let{main:i}=t.selection,a=r-i.from,s=n-i.from;return{...t.changeByRange(o=>{if(o!=i&&r!=n&&t.sliceDoc(o.from+a,o.from+s)!=t.sliceDoc(r,n))return{range:o};let l=t.toText(e);return{changes:{from:o.from+a,to:n==i.from?o.to:o.from+s,insert:l},range:bt.cursor(o.from+a+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const $St=new WeakMap;function ydn(t){if(!Array.isArray(t))return t;let e=$St.get(t);return e||$St.set(t,e=B2e(t)),e}const mK=nn.define(),f$=nn.define();class bdn{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let r=0;r=48&&A<=57||A>=97&&A<=122?2:A>=65&&A<=90?1:0:(T=rxe(A))!=T.toLowerCase()?1:T!=T.toUpperCase()?2:0;(!b||S==1&&v||w==0&&S!=0)&&(r[d]==A||n[d]==A&&(f=!0)?s[d++]=b:s.length&&(y=!1)),w=S,b+=o0(A)}return d==l&&s[0]==0&&y?this.result(-100+(f?-200:0),s,e):p==l&&g==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):p==l?this.ret(-900-e.length,[g,m]):d==l?this.result(-100+(f?-200:0)+-700+(y?0:-1100),s,e):r.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,r,n){let i=[],a=0;for(let s of r){let o=s+(this.astral?o0(Ph(n,s)):1);a&&i[a-1]==s?i[a-1]=o:(i[a++]=s,i[a++]=o)}return this.ret(e-n.length,i)}}class xdn{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:wdn,filterStrict:!1,compareCompletions:(e,r)=>(e.sortText||e.label).localeCompare(r.sortText||r.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,r)=>e&&r,closeOnBlur:(e,r)=>e&&r,icons:(e,r)=>e&&r,tooltipClass:(e,r)=>n=>FSt(e(n),r(n)),optionClass:(e,r)=>n=>FSt(e(n),r(n)),addToOptions:(e,r)=>e.concat(r),filterStrict:(e,r)=>e||r})}});function FSt(t,e){return t?e?t+" "+e:t:e}function wdn(t,e,r,n,i,a){let s=t.textDirection==Ta.RTL,o=s,l=!1,u="top",h,d,f=e.left-i.left,p=i.right-e.right,g=n.right-n.left,m=n.bottom-n.top;if(o&&f=m||b>e.top?h=r.bottom-e.top:(u="bottom",h=e.bottom-r.top)}let v=(e.bottom-e.top)/a.offsetHeight,y=(e.right-e.left)/a.offsetWidth;return{style:`${u}: ${h/v}px; max-width: ${d/y}px`,class:"cm-completionInfo-"+(l?s?"left-narrow":"right-narrow":o?"left":"right")}}const F2e=nn.define();function Adn(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(r){let n=document.createElement("div");return n.classList.add("cm-completionIcon"),r.type&&n.classList.add(...r.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),n.setAttribute("aria-hidden","true"),n},position:20}),e.push({render(r,n,i,a){let s=document.createElement("span");s.className="cm-completionLabel";let o=r.displayLabel||r.label,l=0;for(let u=0;ul&&s.appendChild(document.createTextNode(o.slice(l,h)));let f=s.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(o.slice(h,d))),f.className="cm-completionMatchedText",l=d}return lr.position-n.position).map(r=>r.render)}function z2e(t,e,r){if(t<=r)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let i=Math.floor(e/r);return{from:i*r,to:(i+1)*r}}let n=Math.ceil((t-e)/r);return{from:t-n*r,to:t-(n-1)*r}}class Tdn{constructor(e,r,n){this.view=e,this.stateField=r,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let i=e.state.field(r),{options:a,selected:s}=i.open,o=e.state.facet(Ll);this.optionContent=Adn(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=z2e(a.length,s,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{let{options:u}=e.state.field(r).open;for(let h=l.target,d;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(d=/-(\d+)$/.exec(h.id))&&+d[1]this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;h!=null&&(e.dispatch({effects:F2e.of(h)}),l.preventDefault())}}),this.dom.addEventListener("focusout",l=>{let u=e.state.field(this.stateField,!1);u&&u.tooltip&&e.state.facet(Ll).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:f$.of(null)})}),this.showOptions(a,i.id)}mount(){this.updateSel()}showOptions(e,r){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,r,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var r;let n=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=i){let{options:a,selected:s,disabled:o}=n.open;(!i.open||i.open.options!=a)&&(this.range=z2e(a.length,s,e.state.facet(Ll).maxRenderedOptions),this.showOptions(a,n.id)),this.updateSel(),o!=((r=i.open)===null||r===void 0?void 0:r.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!o)}}updateTooltipClass(e){let r=this.tooltipClass(e);if(r!=this.currentClass){for(let n of this.currentClass.split(" "))n&&this.dom.classList.remove(n);for(let n of r.split(" "))n&&this.dom.classList.add(n);this.currentClass=r}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),r=e.open;(r.selected>-1&&r.selected=this.range.to)&&(this.range=z2e(r.options.length,r.selected,this.view.state.facet(Ll).maxRenderedOptions),this.showOptions(r.options,e.id));let n=this.updateSelectedOption(r.selected);if(n){this.destroyInfo();let{completion:i}=r.options[r.selected],{info:a}=i;if(!a)return;let s=typeof a=="string"?document.createTextNode(a):a(i);if(!s)return;"then"in s?s.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,i)}).catch(o=>Nh(this.view.state,o,"completion info")):(this.addInfoPane(s,i),n.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,r){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",n.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:a}=e;n.appendChild(i),this.infoDestroy=a||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let r=null;for(let n=this.list.firstChild,i=this.range.from;n;n=n.nextSibling,i++)n.nodeName!="LI"||!n.id?i--:i==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),r=n):n.hasAttribute("aria-selected")&&(n.removeAttribute("aria-selected"),n.removeAttribute("aria-describedby"));return r&&Cdn(this.list,r),r}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let r=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),a=this.space;if(!a){let s=this.dom.ownerDocument.documentElement;a={left:0,top:0,right:s.clientWidth,bottom:s.clientHeight}}return i.top>Math.min(a.bottom,r.bottom)-10||i.bottom{s.target==i&&s.preventDefault()});let a=null;for(let s=n.from;sn.from||n.from==0))if(a=f,typeof u!="string"&&u.header)i.appendChild(u.header(u));else{let p=i.appendChild(document.createElement("completion-section"));p.textContent=f}}const h=i.appendChild(document.createElement("li"));h.id=r+"-"+s,h.setAttribute("role","option");let d=this.optionClass(o);d&&(h.className=d);for(let f of this.optionContent){let p=f(o,this.view.state,this.view,l);p&&h.appendChild(p)}}return n.from&&i.classList.add("cm-completionListIncompleteTop"),n.tonew Tdn(r,t,e)}function Cdn(t,e){let r=t.getBoundingClientRect(),n=e.getBoundingClientRect(),i=r.height/t.offsetHeight;n.topr.bottom&&(t.scrollTop+=(n.bottom-r.bottom)/i)}function zSt(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function Odn(t,e){let r=[],n=null,i=null,a=h=>{r.push(h);let{section:d}=h.completion;if(d){n||(n=[]);let f=typeof d=="string"?d:d.name;n.some(p=>p.name==f)||n.push(typeof d=="string"?{name:f}:d)}},s=e.facet(Ll);for(let h of t)if(h.hasResult()){let d=h.result.getMatch;if(h.result.filter===!1)for(let f of h.result.options)a(new NSt(f,h.source,d?d(f):[],1e9-r.length));else{let f=e.sliceDoc(h.from,h.to),p,g=s.filterStrict?new xdn(f):new bdn(f);for(let m of h.result.options)if(p=g.match(m.label)){let v=m.displayLabel?d?d(m,p.matched):[]:p.matched,y=p.score+(m.boost||0);if(a(new NSt(m,h.source,v,y)),typeof m.section=="object"&&m.section.rank==="dynamic"){let{name:b}=m.section;i||(i=Object.create(null)),i[b]=Math.max(y,i[b]||-1e9)}}}}if(n){let h=Object.create(null),d=0,f=(p,g)=>(p.rank==="dynamic"&&g.rank==="dynamic"?i[g.name]-i[p.name]:0)||(typeof p.rank=="number"?p.rank:1e9)-(typeof g.rank=="number"?g.rank:1e9)||(p.namef.score-d.score||u(d.completion,f.completion))){let d=h.completion;!l||l.label!=d.label||l.detail!=d.detail||l.type!=null&&d.type!=null&&l.type!=d.type||l.apply!=d.apply||l.boost!=d.boost?o.push(h):zSt(h.completion)>zSt(l)&&(o[o.length-1]=h),l=h.completion}return o}class O4{constructor(e,r,n,i,a,s){this.options=e,this.attrs=r,this.tooltip=n,this.timestamp=i,this.selected=a,this.disabled=s}setSelected(e,r){return e==this.selected||e>=this.options.length?this:new O4(this.options,USt(r,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,r,n,i,a,s){if(i&&!s&&e.some(u=>u.isPending))return i.setDisabled();let o=Odn(e,r);if(!o.length)return i&&e.some(u=>u.isPending)?i.setDisabled():null;let l=r.facet(Ll).selectOnOpen?0:-1;if(i&&i.selected!=l&&i.selected!=-1){let u=i.options[i.selected].completion;for(let h=0;hh.hasResult()?Math.min(u,h.from):u,1e8),create:Ldn,above:a.aboveCursor},i?i.timestamp:Date.now(),l,!1)}map(e){return new O4(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new O4(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class vK{constructor(e,r,n){this.active=e,this.id=r,this.open=n}static start(){return new vK(Rdn,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:r}=e,n=r.facet(Ll),a=(n.override||r.languageDataAt("autocomplete",YS(r)).map(ydn)).map(l=>(this.active.find(h=>h.source==l)||new ap(l,this.active.some(h=>h.state!=0)?1:0)).update(e,n));a.length==this.active.length&&a.every((l,u)=>l==this.active[u])&&(a=this.active);let s=this.open,o=e.effects.some(l=>l.is(U2e));s&&e.docChanged&&(s=s.map(e.changes)),e.selection||a.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!kdn(a,this.active)||o?s=O4.build(a,r,this.id,s,n,o):s&&s.disabled&&!a.some(l=>l.isPending)&&(s=null),!s&&a.every(l=>!l.isPending)&&a.some(l=>l.hasResult())&&(a=a.map(l=>l.hasResult()?new ap(l.source,0):l));for(let l of e.effects)l.is(F2e)&&(s=s&&s.setSelected(l.value,this.id));return a==this.active&&s==this.open?this:new vK(a,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Edn:_dn}}function kdn(t,e){if(t==e)return!0;for(let r=0,n=0;;){for(;r-1&&(r["aria-activedescendant"]=t+"-"+e),r}const Rdn=[];function VSt(t,e){if(t.isUserEvent("input.complete")){let n=t.annotation($2e);if(n&&e.activateOnCompletion(n))return 12}let r=t.isUserEvent("input.type");return r&&e.activateOnTyping?5:r?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class ap{constructor(e,r,n=!1){this.source=e,this.state=r,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(e,r){let n=VSt(e,r),i=this;(n&8||n&16&&this.touches(e))&&(i=new ap(i.source,0)),n&4&&i.state==0&&(i=new ap(this.source,1)),i=i.updateFor(e,n);for(let a of e.effects)if(a.is(mK))i=new ap(i.source,1,a.value);else if(a.is(f$))i=new ap(i.source,0);else if(a.is(U2e))for(let s of a.value)s.source==i.source&&(i=s);return i}updateFor(e,r){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(YS(e.state))}}class k4 extends ap{constructor(e,r,n,i,a,s){super(e,3,r),this.limit=n,this.result=i,this.from=a,this.to=s}hasResult(){return!0}updateFor(e,r){var n;if(!(r&3))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let a=e.changes.mapPos(this.from),s=e.changes.mapPos(this.to,1),o=YS(e.state);if(o>s||!i||r&2&&(YS(e.startState)==this.from||or.map(e))}}),$h=Vs.define({create(){return vK.start()},update(t,e){return t.update(e)},provide:t=>[c2e.from(t,e=>e.tooltip),er.contentAttributes.from(t,e=>e.attrs)]});function V2e(t,e){const r=e.completion.apply||e.completion.label;let n=t.state.field($h).active.find(i=>i.source==e.source);return n instanceof k4?(typeof r=="string"?t.dispatch({...vdn(t.state,r,n.from,n.to),annotations:$2e.of(e.completion)}):r(t,e.completion,n.from,n.to),!0):!1}const Ldn=Sdn($h,V2e);function yK(t,e="option"){return r=>{let n=r.state.field($h,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp-1?n.open.selected+i*(t?1:-1):t?0:s-1;return o<0?o=e=="page"?0:s-1:o>=s&&(o=e=="page"?s-1:0),r.dispatch({effects:F2e.of(o)}),!0}}const Mdn=t=>{let e=t.state.field($h,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.state.field($h,!1)?(t.dispatch({effects:mK.of(!0)}),!0):!1,Idn=t=>{let e=t.state.field($h,!1);return!e||!e.active.some(r=>r.state!=0)?!1:(t.dispatch({effects:f$.of(null)}),!0)};class Pdn{constructor(e,r){this.active=e,this.context=r,this.time=Date.now(),this.updates=[],this.done=void 0}}const Ndn=50,Bdn=1e3,$dn=ws.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field($h).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field($h),r=t.state.facet(Ll);if(!t.selectionSet&&!t.docChanged&&t.startState.field($h)==e)return;let n=t.transactions.some(a=>{let s=VSt(a,r);return s&8||(a.selection||a.docChanged)&&!(s&3)});for(let a=0;aNdn&&Date.now()-s.time>Bdn){for(let o of s.context.abortListeners)try{o()}catch(l){Nh(this.view.state,l)}s.context.abortListeners=null,this.running.splice(a--,1)}else s.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(a=>a.effects.some(s=>s.is(mK)))&&(this.pendingStart=!0);let i=this.pendingStart?50:r.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(a=>a.isPending&&!this.running.some(s=>s.active.source==a.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let a of t.transactions)a.isUserEvent("input.type")?this.composing=2:this.composing==2&&a.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field($h);for(let r of e.active)r.isPending&&!this.running.some(n=>n.active.source==r.source)&&this.startQuery(r);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ll).updateSyncTime))}startQuery(t){let{state:e}=this.view,r=YS(e),n=new N2e(e,r,t.explicit,this.view),i=new Pdn(t,n);this.running.push(i),Promise.resolve(t.source(n)).then(a=>{i.context.aborted||(i.done=a||null,this.scheduleAccept())},a=>{this.view.dispatch({effects:f$.of(null)}),Nh(this.view.state,a)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ll).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],r=this.view.state.facet(Ll),n=this.view.state.field($h);for(let i=0;io.source==a.active.source);if(s&&s.isPending)if(a.done==null){let o=new ap(a.active.source,0);for(let l of a.updates)o=o.update(l,r);o.isPending||e.push(o)}else this.startQuery(s)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:U2e.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field($h,!1);if(e&&e.tooltip&&this.view.state.facet(Ll).closeOnBlur){let r=e.open&&_Tt(this.view,e.open.tooltip);(!r||!r.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:f$.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:mK.of(!1)}),20),this.composing=0}}}),Fdn=typeof navigator=="object"&&/Win/.test(navigator.platform),zdn=Fd.highest(er.domEventHandlers({keydown(t,e){let r=e.state.field($h,!1);if(!r||!r.open||r.open.disabled||r.open.selected<0||t.key.length>1||t.ctrlKey&&!(Fdn&&t.altKey)||t.metaKey)return!1;let n=r.open.options[r.open.selected],i=r.active.find(s=>s.source==n.source),a=n.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(t.key)>-1&&V2e(e,n),!1}})),QSt=er.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class Udn{constructor(e,r,n,i){this.field=e,this.line=r,this.from=n,this.to=i}}class G2e{constructor(e,r,n){this.field=e,this.from=r,this.to=n}map(e){let r=e.mapPos(this.from,-1,uc.TrackDel),n=e.mapPos(this.to,1,uc.TrackDel);return r==null||n==null?null:new G2e(this.field,r,n)}}class H2e{constructor(e,r){this.lines=e,this.fieldPositions=r}instantiate(e,r){let n=[],i=[r],a=e.doc.lineAt(r),s=/^\s*/.exec(a.text)[0];for(let l of this.lines){if(n.length){let u=s,h=/^\t*/.exec(l)[0].length;for(let d=0;dnew G2e(l.field,i[l.line]+l.from,i[l.line]+l.to));return{text:n,ranges:o}}static parse(e){let r=[],n=[],i=[],a;for(let s of e.split(/\r\n?|\n/)){for(;a=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(s);){let o=a[1]?+a[1]:null,l=a[2]||a[3]||"",u=-1;o===0&&(o=1e9);let h=l.replace(/\\[{}]/g,d=>d[1]);for(let d=0;d=u&&f.field++}for(let d of i)if(d.line==n.length&&d.from>a.index){let f=a[2]?3+(a[1]||"").length:2;d.from-=f,d.to-=f}i.push(new Udn(u,n.length,a.index,a.index+h.length)),s=s.slice(0,a.index)+l+s.slice(a.index+a[0].length)}s=s.replace(/\\([{}])/g,(o,l,u)=>{for(let h of i)h.line==n.length&&h.from>u&&(h.from--,h.to--);return l}),n.push(s)}return new H2e(n,i)}}let Vdn=Ar.widget({widget:new class extends Iu{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),Qdn=Ar.mark({class:"cm-snippetField"});class E4{constructor(e,r){this.ranges=e,this.active=r,this.deco=Ar.set(e.map(n=>(n.from==n.to?Vdn:Qdn).range(n.from,n.to)),!0)}map(e){let r=[];for(let n of this.ranges){let i=n.map(e);if(!i)return null;r.push(i)}return new E4(r,this.active)}selectionInsideField(e){return e.ranges.every(r=>this.ranges.some(n=>n.field==this.active&&n.from<=r.from&&n.to>=r.to))}}const p$=nn.define({map(t,e){return t&&t.map(e)}}),Gdn=nn.define(),g$=Vs.define({create(){return null},update(t,e){for(let r of e.effects){if(r.is(p$))return r.value;if(r.is(Gdn)&&t)return new E4(t.ranges,r.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>er.decorations.from(t,e=>e?e.deco:Ar.none)});function W2e(t,e){return bt.create(t.filter(r=>r.field==e).map(r=>bt.range(r.from,r.to)))}function Hdn(t){let e=H2e.parse(t);return(r,n,i,a)=>{let{text:s,ranges:o}=e.instantiate(r.state,i),{main:l}=r.state.selection,u={changes:{from:i,to:a==l.from?l.to:a,insert:vi.of(s)},scrollIntoView:!0,annotations:n?[$2e.of(n),Do.userEvent.of("input.complete")]:void 0};if(o.length&&(u.selection=W2e(o,0)),o.some(h=>h.field>0)){let h=new E4(o,0),d=u.effects=[p$.of(h)];r.state.field(g$,!1)===void 0&&d.push(nn.appendConfig.of([g$,Ydn,qdn,QSt]))}r.dispatch(r.state.update(u))}}function GSt(t){return({state:e,dispatch:r})=>{let n=e.field(g$,!1);if(!n||t<0&&n.active==0)return!1;let i=n.active+t,a=t>0&&!n.ranges.some(s=>s.field==i+t);return r(e.update({selection:W2e(n.ranges,i),effects:p$.of(a?null:new E4(n.ranges,i)),scrollIntoView:!0})),!0}}const Wdn=[{key:"Tab",run:GSt(1),shift:GSt(-1)},{key:"Escape",run:({state:t,dispatch:e})=>t.field(g$,!1)?(e(t.update({effects:p$.of(null)})),!0):!1}],HSt=vr.define({combine(t){return t.length?t[0]:Wdn}}),Ydn=Fd.highest(y4.compute([HSt],t=>t.facet(HSt)));function As(t,e){return{...e,apply:Hdn(t)}}const qdn=er.domEventHandlers({mousedown(t,e){let r=e.state.field(g$,!1),n;if(!r||(n=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=r.ranges.find(a=>a.from<=n&&a.to>=n);return!i||i.field==r.active?!1:(e.dispatch({selection:W2e(r.ranges,i.field),effects:p$.of(r.ranges.some(a=>a.field>i.field)?new E4(r.ranges,i.field):null),scrollIntoView:!0}),!0)}}),m$={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},qS=nn.define({map(t,e){let r=e.mapPos(t,-1,uc.TrackAfter);return r??void 0}}),Y2e=new class extends n2{};Y2e.startSide=1,Y2e.endSide=-1;const WSt=Vs.define({create(){return Zn.empty},update(t,e){if(t=t.map(e.changes),e.selection){let r=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:n=>n>=r.from&&n<=r.to})}for(let r of e.effects)r.is(qS)&&(t=t.update({add:[Y2e.range(r.value,r.value+1)]}));return t}});function jdn(){return[Kdn,WSt]}const q2e="()[]{}<>«»»«[]{}";function YSt(t){for(let e=0;e{if((Xdn?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(n.length>2||n.length==2&&o0(Ph(n,0))==1||e!=i.from||r!=i.to)return!1;let a=Jdn(t.state,n);return a?(t.dispatch(a),!0):!1}),Zdn=[{key:"Backspace",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=qSt(t,t.selection.main.head).brackets||m$.brackets,i=null,a=t.changeByRange(s=>{if(s.empty){let o=efn(t.doc,s.head);for(let l of n)if(l==o&&bK(t.doc,s.head)==YSt(Ph(l,0)))return{changes:{from:s.head-l.length,to:s.head+l.length},range:bt.cursor(s.head-l.length)}}return{range:i=s}});return i||e(t.update(a,{scrollIntoView:!0,userEvent:"delete.backward"})),!i}}];function Jdn(t,e){let r=qSt(t,t.selection.main.head),n=r.brackets||m$.brackets;for(let i of n){let a=YSt(Ph(i,0));if(e==i)return a==i?nfn(t,i,n.indexOf(i+i+i)>-1,r):tfn(t,i,a,r.before||m$.before);if(e==a&&jSt(t,t.selection.main.from))return rfn(t,i,a)}return null}function jSt(t,e){let r=!1;return t.field(WSt).between(0,t.doc.length,n=>{n==e&&(r=!0)}),r}function bK(t,e){let r=t.sliceString(e,e+2);return r.slice(0,o0(Ph(r,0)))}function efn(t,e){let r=t.sliceString(e-2,e);return o0(Ph(r,0))==r.length?r:r.slice(1)}function tfn(t,e,r,n){let i=null,a=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:r,from:s.to}],effects:qS.of(s.to+e.length),range:bt.range(s.anchor+e.length,s.head+e.length)};let o=bK(t.doc,s.head);return!o||/\s/.test(o)||n.indexOf(o)>-1?{changes:{insert:e+r,from:s.head},effects:qS.of(s.head+e.length),range:bt.cursor(s.head+e.length)}:{range:i=s}});return i?null:t.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function rfn(t,e,r){let n=null,i=t.changeByRange(a=>a.empty&&bK(t.doc,a.head)==r?{changes:{from:a.head,to:a.head+r.length,insert:r},range:bt.cursor(a.head+r.length)}:n={range:a});return n?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function nfn(t,e,r,n){let i=n.stringPrefixes||m$.stringPrefixes,a=null,s=t.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:e,from:o.to}],effects:qS.of(o.to+e.length),range:bt.range(o.anchor+e.length,o.head+e.length)};let l=o.head,u=bK(t.doc,l),h;if(u==e){if(XSt(t,l))return{changes:{insert:e+e,from:l},effects:qS.of(l+e.length),range:bt.cursor(l+e.length)};if(jSt(t,l)){let f=r&&t.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+f.length,insert:f},range:bt.cursor(l+f.length)}}}else{if(r&&t.sliceDoc(l-2*e.length,l)==e+e&&(h=KSt(t,l-2*e.length,i))>-1&&XSt(t,h))return{changes:{insert:e+e+e+e,from:l},effects:qS.of(l+e.length),range:bt.cursor(l+e.length)};if(t.charCategorizer(l)(u)!=ps.Word&&KSt(t,l,i)>-1&&!ifn(t,l,e,i))return{changes:{insert:e+e,from:l},effects:qS.of(l+e.length),range:bt.cursor(l+e.length)}}return{range:a=o}});return a?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function XSt(t,e){let r=pa(t).resolveInner(e+1);return r.parent&&r.from==e}function ifn(t,e,r,n){let i=pa(t).resolveInner(e,-1),a=n.reduce((s,o)=>Math.max(s,o.length),0);for(let s=0;s<5;s++){let o=t.sliceDoc(i.from,Math.min(i.to,i.from+r.length+a)),l=o.indexOf(r);if(!l||l>-1&&n.indexOf(o.slice(0,l))>-1){let h=i.firstChild;for(;h&&h.from==i.from&&h.to-h.from>r.length+l;){if(t.sliceDoc(h.to-r.length,h.to)==r)return!1;h=h.firstChild}return!0}let u=i.to==e&&i.parent;if(!u)break;i=u}return!1}function KSt(t,e,r){let n=t.charCategorizer(e);if(n(t.sliceDoc(e-1,e))!=ps.Word)return e;for(let i of r){let a=e-i.length;if(t.sliceDoc(a,e)==i&&n(t.sliceDoc(a-1,a))!=ps.Word)return a}return-1}function afn(t={}){return[zdn,$h,Ll.of(t),$dn,sfn,QSt]}const ZSt=[{key:"Ctrl-Space",run:Q2e},{mac:"Alt-`",run:Q2e},{mac:"Alt-i",run:Q2e},{key:"Escape",run:Idn},{key:"ArrowDown",run:yK(!0)},{key:"ArrowUp",run:yK(!1)},{key:"PageDown",run:yK(!0,"page")},{key:"PageUp",run:yK(!1,"page")},{key:"Enter",run:Mdn}],sfn=Fd.highest(y4.computeN([Ll],t=>t.facet(Ll).defaultKeymap?[ZSt]:[])),JSt=[As("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),As("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),As("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),As("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),As("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),As(`try { +`);n>-1&&(r=r.slice(0,n))}return e+r.length<=this.to?r:r.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,r=this.lineAfter(e),n=e+r.length;for(let i=this.rangeIndex;;){let a=this.ranges[i].to;if(a>=n||(r=r.slice(0,a-(n-r.length)),i++,i==this.ranges.length))break;let s=this.ranges[i].from,o=this.lineAfter(s);r+=o,n=s+o.length}return{line:r,end:n}}skipGapsTo(e,r,n){for(;;){let i=this.ranges[this.rangeIndex].to,a=e+r;if(n>0?i>a:i>=a)break;let s=this.ranges[++this.rangeIndex].from;r+=s-i}return r}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){i=this.skipGapsTo(r,i,1),r+=i;let o=this.chunk.length;i=this.skipGapsTo(n,i,-1),n+=i,a+=this.chunk.length-o}let s=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&a==4&&s>=0&&this.chunk[s]==e&&this.chunk[s+2]==r?this.chunk[s+2]=n:this.chunk.push(e,r,n,a),i}parseLine(e){let{line:r,end:n}=this.nextLine(),i=0,{streamParser:a}=this.lang,s=new mTt(r,e?e.state.tabSize:4,e?HT(e.state):2);if(s.eol())a.blankLine(this.state,s.indentUnit);else for(;!s.eol();){let o=bTt(a.token,s,this.state);if(o&&(i=this.emitToken(this.lang.tokenTable.resolve(o),this.parsedPos+s.start,this.parsedPos+s.pos,i)),s.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPose.start)return i}throw new Error("Stream parser failed to advance stream.")}const _2e=Object.create(null),h$=[Ro.none],khn=new s4(h$),xTt=[],wTt=Object.create(null),ATt=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])ATt[t]=TTt(_2e,e);class STt{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),ATt)}resolve(e){return e?this.table[e]||(this.table[e]=TTt(this.extra,e)):0}}const Ehn=new STt(_2e);function R2e(t,e){xTt.indexOf(t)>-1||(xTt.push(t),console.warn(e))}function TTt(t,e){let r=[];for(let o of e.split(" ")){let l=[];for(let u of o.split(".")){let h=t[u]||Ee[u];h?typeof h=="function"?l.length?l=l.map(h):R2e(u,`Modifier ${u} used at start of tag`):l.length?R2e(u,`Tag ${u} used as modifier`):l=Array.isArray(h)?h:[h]:R2e(u,`Unknown highlighting tag ${u}`)}for(let u of l)r.push(u)}if(!r.length)return 0;let n=e.replace(/ /g,"_"),i=n+" "+r.map(o=>o.id),a=wTt[i];if(a)return a.id;let s=wTt[i]=Ro.define({id:h$.length,name:n,props:[qy({[n]:r})]});return h$.push(s),s.id}function _hn(t,e){let r=Ro.define({id:h$.length,name:"Document",props:[c2.add(()=>t),Ky.add(()=>n=>e.getIndent(n))],top:!0});return h$.push(r),r}Sa.RTL,Sa.LTR;let Rhn=class _Le{constructor(e,r,n,i,a,s,o,l,u,h=0,d){this.p=e,this.stack=r,this.state=n,this.reducePos=i,this.pos=a,this.score=s,this.buffer=o,this.bufferBase=l,this.curContext=u,this.lookAhead=h,this.parent=d}toString(){return`[${this.stack.filter((e,r)=>r%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,r,n=0){let i=e.parser.context;return new _Le(e,[],r,n,n,0,[],0,i?new CTt(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,r){this.stack.push(this.state,r,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var r;let n=e>>19,i=e&65535,{parser:a}=this.p,s=this.reducePos=2e3&&!(!((r=this.p.parser.nodeSet.types[i])===null||r===void 0)&&r.isAnonymous)&&(u==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(i,u)}storeNode(e,r,n,i=4,a=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[s-4]==0&&this.buffer[s-1]>-1){if(r==n)return;if(this.buffer[s-2]>=r){this.buffer[s-2]=n;return}}}if(!a||this.pos==n)this.buffer.push(e,r,n,i);else{let s=this.buffer.length;if(s>0&&(this.buffer[s-4]!=0||this.buffer[s-1]<0)){let o=!1;for(let l=s;l>0&&this.buffer[l-2]>n;l-=4)if(this.buffer[l-1]>=0){o=!0;break}if(o)for(;s>0&&this.buffer[s-2]>n;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,i>4&&(i-=4)}this.buffer[s]=e,this.buffer[s+1]=r,this.buffer[s+2]=n,this.buffer[s+3]=i}}shift(e,r,n,i){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=i,this.shiftContext(r,n),r<=this.p.parser.maxNode&&this.buffer.push(r,n,i,4);else{let a=e,{parser:s}=this.p;this.pos=i;let o=s.stateFlag(a,1);!o&&(i>n||r<=s.maxNode)&&(this.reducePos=i),this.pushState(a,o?n:Math.min(n,this.reducePos)),this.shiftContext(r,n),r<=s.maxNode&&this.buffer.push(r,n,i,4)}}apply(e,r,n,i){e&65536?this.reduce(e):this.shift(e,r,n,i)}useNode(e,r){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(r,i),this.buffer.push(n,i,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,r=e.buffer.length;for(r&&e.buffer[r-4]==0&&(r-=4);r>0&&e.buffer[r-2]>e.reducePos;)r-=4;let n=e.buffer.slice(r),i=e.bufferBase+r;for(;e&&i==e.bufferBase;)e=e.parent;return new _Le(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,r){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,r,4),this.storeNode(0,this.pos,r,n?8:4),this.pos=this.reducePos=r,this.score-=190}canShift(e){for(let r=new Dhn(this);;){let n=this.p.parser.stateSlot(r.state,4)||this.p.parser.hasAction(r.state,e);if(n==0)return!1;if(!(n&65536))return!0;r.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let r=this.p.parser.nextStates(this.state);if(r.length>8||this.stack.length>=120){let i=[];for(let a=0,s;al&1&&o==s)||i.push(r[a],s)}r=i}let n=[];for(let i=0;i>19,i=r&65535,a=this.stack.length-n*3;if(a<0||e.getGoto(this.stack[a],i,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;r=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(r),!0}findForcedReduction(){let{parser:e}=this.p,r=[],n=(i,a)=>{if(!r.includes(i))return r.push(i),e.allActions(i,s=>{if(!(s&393216))if(s&65536){let o=(s>>19)-a;if(o>1){let l=s&65535,u=this.stack.length-o*3;if(u>=0&&e.getGoto(this.stack[u],l,!1)>=0)return o<<19|65536|l}}else{let o=n(s,a+1);if(o!=null)return o}})};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 r=0;r0&&this.emitLookAhead()}};class CTt{constructor(e,r){this.tracker=e,this.context=r,this.hash=e.strict?e.hash(r):0}}class Dhn{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let r=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 i=this.start.p.parser.getGoto(this.stack[this.base-3],r,!0);this.state=i}}class dK{constructor(e,r,n){this.stack=e,this.pos=r,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,r=e.bufferBase+e.buffer.length){return new dK(e,r,r-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 dK(this.stack,this.pos,this.index)}}function d$(t,e=Uint16Array){if(typeof t!="string")return t;let r=null;for(let n=0,i=0;n=92&&s--,s>=34&&s--;let l=s-32;if(l>=46&&(l-=46,o=!0),a+=l,o)break;a*=46}r?r[i++]=a:r=new e(a)}return r}class fK{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const OTt=new fK;class Lhn{constructor(e,r){this.input=e,this.ranges=r,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=OTt,this.rangeIndex=0,this.pos=this.chunkPos=r[0].from,this.range=r[0],this.end=r[r.length-1].to,this.readNext()}resolveOffset(e,r){let n=this.range,i=this.rangeIndex,a=this.pos+e;for(;an.to:a>=n.to;){if(i==this.ranges.length-1)return null;let s=this.ranges[++i];a+=s.from-n.to,n=s}return a}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,r.from);return this.end}peek(e){let r=this.chunkOff+e,n,i;if(r>=0&&r=this.chunk2Pos&&no.to&&(this.chunk2=this.chunk2.slice(0,o.to-n)),i=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),i}acceptToken(e,r=0){let n=r?this.resolveOffset(r,-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,r){if(r?(this.token=r,r.start=e,r.lookAhead=e+1,r.value=r.extended=-1):this.token=OTt,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&&r<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,r-this.chunkPos);if(e>=this.chunk2Pos&&r<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,r-this.chunk2Pos);if(e>=this.range.from&&r<=this.range.to)return this.input.read(e,r);let n="";for(let i of this.ranges){if(i.from>=r)break;i.to>e&&(n+=this.input.read(Math.max(i.from,e),Math.min(i.to,r)))}return n}}class C4{constructor(e,r){this.data=e,this.id=r}token(e,r){let{parser:n}=r.p;kTt(this.data,e,r,this.id,n.data,n.tokenPrecTable)}}C4.prototype.contextual=C4.prototype.fallback=C4.prototype.extend=!1;class pK{constructor(e,r,n){this.precTable=r,this.elseToken=n,this.data=typeof e=="string"?d$(e):e}token(e,r){let n=e.pos,i=0;for(;;){let a=e.next<0,s=e.resolveOffset(1,1);if(kTt(this.data,e,r,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(a||i++,s==null)break;e.reset(s,e.token)}i&&(e.reset(n,e.token),e.acceptToken(this.elseToken,i))}}pK.prototype.contextual=C4.prototype.fallback=C4.prototype.extend=!1;class uo{constructor(e,r={}){this.token=e,this.contextual=!!r.contextual,this.fallback=!!r.fallback,this.extend=!!r.extend}}function kTt(t,e,r,n,i,a){let s=0,o=1<0){let g=t[p];if(l.allows(g)&&(e.token.value==-1||e.token.value==g||Mhn(g,e.token.value,i,a))){e.acceptToken(g);break}}let h=e.next,d=0,f=t[s+2];if(e.next<0&&f>d&&t[u+f*3-3]==65535){s=t[u+f*3-1];continue e}for(;d>1,g=u+p+(p<<1),m=t[g],v=t[g+1]||65536;if(h=v)d=p+1;else{s=t[g+2],e.advance();continue e}}break}}function ETt(t,e,r){for(let n=e,i;(i=t[n])!=65535;n++)if(i==r)return n-e;return-1}function Mhn(t,e,r,n){let i=ETt(r,n,e);return i<0||ETt(r,n,t)e)&&!n.type.isError)return r<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(t.length,Math.max(n.from+1,e+25));if(r<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return r<0?0:t.length}}let Ihn=class{constructor(e,r){this.fragments=e,this.nodeSet=r,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?_Tt(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?_Tt(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=s,null;if(a instanceof si){if(s==e){if(s=Math.max(this.safeFrom,e)&&(this.trees.push(a),this.start.push(s),this.index.push(0))}else this.index[r]++,this.nextStart=s+a.length}}};class Phn{constructor(e,r){this.stream=r,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new fK)}getActions(e){let r=0,n=null,{parser:i}=e.p,{tokenizers:a}=i,s=i.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,l=0;for(let u=0;ud.end+25&&(l=Math.max(d.lookAhead,l)),d.value!=0)){let f=r;if(d.extended>-1&&(r=this.addActions(e,d.extended,d.end,r)),r=this.addActions(e,d.value,d.end,r),!h.extend&&(n=d,r>f))break}}for(;this.actions.length>r;)this.actions.pop();return l&&e.setLookAhead(l),!n&&e.pos==this.stream.end&&(n=new fK,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,r=this.addActions(e,n.value,n.end,r)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let r=new fK,{pos:n,p:i}=e;return r.start=n,r.end=Math.min(n+1,i.stream.end),r.value=n==i.stream.end?i.parser.eofTerm:0,r}updateCachedToken(e,r,n){let i=this.stream.clipPos(n.pos);if(r.token(this.stream.reset(i,e),n),e.value>-1){let{parser:a}=n.p;for(let s=0;s=0&&n.p.parser.dialect.allows(o>>1)){o&1?e.extended=o>>1:e.value=o>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,r,n,i){for(let a=0;ae.bufferLength*4?new Ihn(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,r=this.minStackPos,n=this.stacks=[],i,a;if(this.bigReductionCount>300&&e.length==1){let[s]=e;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;sr)n.push(o);else{if(this.advanceStack(o,n,e))continue;{i||(i=[],a=[]),i.push(o);let l=this.tokens.getMainToken(o);a.push(l.value,l.end)}}break}}if(!n.length){let s=i&&$hn(i);if(s)return Vd&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw Vd&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+r);this.recovering||(this.recovering=5)}if(this.recovering&&i){let s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,a,n);if(s)return Vd&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(n.length>s)for(n.sort((o,l)=>l.score-o.score);n.length>s;)n.pop();n.some(o=>o.reducePos>r)&&this.recovering--}else if(n.length>1){e:for(let s=0;s500&&u.buffer.length>500)if((o.score-u.score||o.buffer.length-u.buffer.length)>0)n.splice(l--,1);else{n.splice(s--,1);continue e}}}n.length>12&&(n.sort((s,o)=>o.score-s.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let s=1;s ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let u=e.curContext&&e.curContext.tracker.strict,h=u?e.curContext.hash:0;for(let d=this.fragments.nodeAt(i);d;){let f=this.parser.nodeSet.types[d.type.id]==d.type?a.getGoto(e.state,d.type.id):-1;if(f>-1&&d.length&&(!u||(d.prop(En.contextHash)||0)==h))return e.useNode(d,f),Vd&&console.log(s+this.stackID(e)+` (via reuse of ${a.getName(d.type.id)})`),!0;if(!(d instanceof si)||d.children.length==0||d.positions[0]>0)break;let p=d.children[0];if(p instanceof si&&d.positions[0]==0)d=p;else break}}let o=a.stateSlot(e.state,4);if(o>0)return e.reduce(o),Vd&&console.log(s+this.stackID(e)+` (via always-reduce ${a.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let u=0;ui?r.push(g):n.push(g)}return!1}advanceFully(e,r){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return RTt(e,r),!0}}runRecovery(e,r,n){let i=null,a=!1;for(let s=0;s ":"";if(o.deadEnd&&(a||(a=!0,o.restart(),Vd&&console.log(h+this.stackID(o)+" (restarted)"),this.advanceFully(o,n))))continue;let d=o.split(),f=h;for(let p=0;p<10&&d.forceReduce()&&(Vd&&console.log(f+this.stackID(d)+" (via force-reduce)"),!this.advanceFully(d,n));p++)Vd&&(f=this.stackID(d)+" -> ");for(let p of o.recoverByInsert(l))Vd&&console.log(h+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,n);this.stream.end>o.pos?(u==o.pos&&(u++,l=0),o.recoverByDelete(l,u),Vd&&console.log(h+this.stackID(o)+` (via recover-delete ${this.parser.getName(l)})`),RTt(o,n)):(!i||i.scoret;class gK{constructor(e){this.start=e.start,this.shift=e.shift||L2e,this.reduce=e.reduce||L2e,this.reuse=e.reuse||L2e,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Jy extends mX{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let r=e.nodeNames.split(" ");this.minRepeatTerm=r.length;for(let o=0;oe.topRules[o][1]),i=[];for(let o=0;o=0)a(h,l,o[u++]);else{let d=o[u+-h];for(let f=-h;f>0;f--)a(o[u++],l,d);u++}}}this.nodeSet=new s4(r.map((o,l)=>Ro.define({name:l>=this.minRepeatTerm?void 0:o,id:l,props:i[l],top:n.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=nwt;let s=d$(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;otypeof o=="number"?new C4(s,o):o),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,r,n){let i=new Nhn(this,e,r,n);for(let a of this.wrappers)i=a(i,e,r,n);return i}getGoto(e,r,n=!1){let i=this.goto;if(r>=i[0])return-1;for(let a=i[r+1];;){let s=i[a++],o=s&1,l=i[a++];if(o&&n)return l;for(let u=a+(s>>1);a0}validAction(e,r){return!!this.allActions(e,n=>n==r?!0:null)}allActions(e,r){let n=this.stateSlot(e,4),i=n?r(n):void 0;for(let a=this.stateSlot(e,1);i==null;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=e1(this.data,a+2);else break;i=r(e1(this.data,a+1))}return i}nextStates(e){let r=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=e1(this.data,n+2);else break;if(!(this.data[n+2]&1)){let i=this.data[n+1];r.some((a,s)=>s&1&&a==i)||r.push(this.data[n],i)}}return r}configure(e){let r=Object.assign(Object.create(Jy.prototype),this);if(e.props&&(r.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}`);r.top=n}return e.tokenizers&&(r.tokenizers=this.tokenizers.map(n=>{let i=e.tokenizers.find(a=>a.from==n);return i?i.to:n})),e.specializers&&(r.specializers=this.specializers.slice(),r.specializerSpecs=this.specializerSpecs.map((n,i)=>{let a=e.specializers.find(o=>o.from==n.external);if(!a)return n;let s=Object.assign(Object.assign({},n),{external:a.to});return r.specializers[i]=DTt(s),s})),e.contextTracker&&(r.context=e.contextTracker),e.dialect&&(r.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(r.strict=e.strict),e.wrap&&(r.wrappers=r.wrappers.concat(e.wrap)),e.bufferLength!=null&&(r.bufferLength=e.bufferLength),r}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 r=this.dynamicPrecedences;return r==null?0:r[e]||0}parseDialect(e){let r=Object.keys(this.dialects),n=r.map(()=>!1);if(e)for(let a of e.split(" ")){let s=r.indexOf(a);s>=0&&(n[s]=!0)}let i=null;for(let a=0;an)&&r.p.parser.stateFlag(r.state,2)&&(!e||e.scoret.external(r,n)<<1|e}return t.get}const Fhn=316,zhn=317,LTt=1,Uhn=2,Vhn=3,Qhn=4,Ghn=318,Hhn=320,Whn=321,Yhn=5,qhn=6,jhn=0,M2e=[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],MTt=125,Xhn=59,I2e=47,Khn=42,Zhn=43,Jhn=45,edn=60,tdn=44,rdn=63,ndn=46,idn=91,adn=new gK({start:!1,shift(t,e){return e==Yhn||e==qhn||e==Hhn?t:e==Whn},strict:!1}),sdn=new uo((t,e)=>{let{next:r}=t;(r==MTt||r==-1||e.context)&&t.acceptToken(Ghn)},{contextual:!0,fallback:!0}),odn=new uo((t,e)=>{let{next:r}=t,n;M2e.indexOf(r)>-1||r==I2e&&((n=t.peek(1))==I2e||n==Khn)||r!=MTt&&r!=Xhn&&r!=-1&&!e.context&&t.acceptToken(Fhn)},{contextual:!0}),ldn=new uo((t,e)=>{t.next==idn&&!e.context&&t.acceptToken(zhn)},{contextual:!0}),cdn=new uo((t,e)=>{let{next:r}=t;if(r==Zhn||r==Jhn){if(t.advance(),r==t.next){t.advance();let n=!e.context&&e.canShift(LTt);t.acceptToken(n?LTt:Uhn)}}else r==rdn&&t.peek(1)==ndn&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(Vhn))},{contextual:!0});function P2e(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}const udn=new uo((t,e)=>{if(t.next!=edn||!e.dialectEnabled(jhn)||(t.advance(),t.next==I2e))return;let r=0;for(;M2e.indexOf(t.next)>-1;)t.advance(),r++;if(P2e(t.next,!0)){for(t.advance(),r++;P2e(t.next,!1);)t.advance(),r++;for(;M2e.indexOf(t.next)>-1;)t.advance(),r++;if(t.next==tdn)return;for(let n=0;;n++){if(n==7){if(!P2e(t.next,!0))return;break}if(t.next!="extends".charCodeAt(n))break;t.advance(),r++}}t.acceptToken(Qhn,-r)}),hdn=qy({"get set async static":Ee.modifier,"for while do if else switch try catch finally return throw break continue default case defer":Ee.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":Ee.operatorKeyword,"let var const using function class extends":Ee.definitionKeyword,"import export from":Ee.moduleKeyword,"with debugger new":Ee.keyword,TemplateString:Ee.special(Ee.string),super:Ee.atom,BooleanLiteral:Ee.bool,this:Ee.self,null:Ee.null,Star:Ee.modifier,VariableName:Ee.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":Ee.function(Ee.variableName),VariableDefinition:Ee.definition(Ee.variableName),Label:Ee.labelName,PropertyName:Ee.propertyName,PrivatePropertyName:Ee.special(Ee.propertyName),"CallExpression/MemberExpression/PropertyName":Ee.function(Ee.propertyName),"FunctionDeclaration/VariableDefinition":Ee.function(Ee.definition(Ee.variableName)),"ClassDeclaration/VariableDefinition":Ee.definition(Ee.className),"NewExpression/VariableName":Ee.className,PropertyDefinition:Ee.definition(Ee.propertyName),PrivatePropertyDefinition:Ee.definition(Ee.special(Ee.propertyName)),UpdateOp:Ee.updateOperator,"LineComment Hashbang":Ee.lineComment,BlockComment:Ee.blockComment,Number:Ee.number,String:Ee.string,Escape:Ee.escape,ArithOp:Ee.arithmeticOperator,LogicOp:Ee.logicOperator,BitOp:Ee.bitwiseOperator,CompareOp:Ee.compareOperator,RegExp:Ee.regexp,Equals:Ee.definitionOperator,Arrow:Ee.function(Ee.punctuation),": Spread":Ee.punctuation,"( )":Ee.paren,"[ ]":Ee.squareBracket,"{ }":Ee.brace,"InterpolationStart InterpolationEnd":Ee.special(Ee.brace),".":Ee.derefOperator,", ;":Ee.separator,"@":Ee.meta,TypeName:Ee.typeName,TypeDefinition:Ee.definition(Ee.typeName),"type enum interface implements namespace module declare":Ee.definitionKeyword,"abstract global Privacy readonly override":Ee.modifier,"is keyof unique infer asserts":Ee.operatorKeyword,JSXAttributeValue:Ee.attributeValue,JSXText:Ee.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":Ee.angleBracket,"JSXIdentifier JSXNameSpacedName":Ee.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":Ee.attributeName,"JSXBuiltin/JSXIdentifier":Ee.standard(Ee.tagName)}),ddn={__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},fdn={__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},pdn={__proto__:null,"<":193},gdn=Jy.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:adn,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:[hdn],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:[odn,ldn,cdn,udn,2,3,4,5,6,7,8,9,10,11,12,13,14,sdn,new pK("$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 pK("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:t=>ddn[t]||-1},{term:343,get:t=>fdn[t]||-1},{term:95,get:t=>pdn[t]||-1}],tokenPrec:15201});class N2e{constructor(e,r,n,i){this.state=e,this.pos=r,this.explicit=n,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let r=pa(this.state).resolveInner(this.pos,-1);for(;r&&e.indexOf(r.name)<0;)r=r.parent;return r?{from:r.from,to:this.pos,text:this.state.sliceDoc(r.from,this.pos),type:r.type}:null}matchBefore(e){let r=this.state.doc.lineAt(this.pos),n=Math.max(r.from,this.pos-250),i=r.text.slice(n-r.from,this.pos-r.from),a=i.search(BTt(e,!1));return a<0?null:{from:n+a,to:this.pos,text:i.slice(a)}}get aborted(){return this.abortListeners==null}addEventListener(e,r,n){e=="abort"&&this.abortListeners&&(this.abortListeners.push(r),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function ITt(t){let e=Object.keys(t).join(""),r=/\w/.test(e);return r&&(e=e.replace(/\w/g,"")),`[${r?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function mdn(t){let e=Object.create(null),r=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let a=1;atypeof i=="string"?{label:i}:i),[r,n]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:mdn(e);return i=>{let a=i.matchBefore(n);return a||i.explicit?{from:a?a.from:i.pos,options:e,validFor:r}:null}}function PTt(t,e){return r=>{for(let n=pa(r.state).resolveInner(r.pos,-1);n;n=n.parent){if(t.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return e(r)}}let NTt=class{constructor(e,r,n,i){this.completion=e,this.source=r,this.match=n,this.score=i}};function YT(t){return t.selection.main.from}function BTt(t,e){var r;let{source:n}=t,i=e&&n[0]!="^",a=n[n.length-1]!="$";return!i&&!a?t:new RegExp(`${i?"^":""}(?:${n})${a?"$":""}`,(r=t.flags)!==null&&r!==void 0?r:t.ignoreCase?"i":"")}const $2e=c0.define();function vdn(t,e,r,n){let{main:i}=t.selection,a=r-i.from,s=n-i.from;return{...t.changeByRange(o=>{if(o!=i&&r!=n&&t.sliceDoc(o.from+a,o.from+s)!=t.sliceDoc(r,n))return{range:o};let l=t.toText(e);return{changes:{from:o.from+a,to:n==i.from?o.to:o.from+s,insert:l},range:bt.cursor(o.from+a+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const $Tt=new WeakMap;function ydn(t){if(!Array.isArray(t))return t;let e=$Tt.get(t);return e||$Tt.set(t,e=B2e(t)),e}const mK=nn.define(),f$=nn.define();class bdn{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let r=0;r=48&&A<=57||A>=97&&A<=122?2:A>=65&&A<=90?1:0:(S=rxe(A))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(!b||T==1&&v||w==0&&T!=0)&&(r[d]==A||n[d]==A&&(f=!0)?s[d++]=b:s.length&&(y=!1)),w=T,b+=o0(A)}return d==l&&s[0]==0&&y?this.result(-100+(f?-200:0),s,e):p==l&&g==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):p==l?this.ret(-900-e.length,[g,m]):d==l?this.result(-100+(f?-200:0)+-700+(y?0:-1100),s,e):r.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,r,n){let i=[],a=0;for(let s of r){let o=s+(this.astral?o0(Ph(n,s)):1);a&&i[a-1]==s?i[a-1]=o:(i[a++]=s,i[a++]=o)}return this.ret(e-n.length,i)}}class xdn{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:wdn,filterStrict:!1,compareCompletions:(e,r)=>(e.sortText||e.label).localeCompare(r.sortText||r.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,r)=>e&&r,closeOnBlur:(e,r)=>e&&r,icons:(e,r)=>e&&r,tooltipClass:(e,r)=>n=>FTt(e(n),r(n)),optionClass:(e,r)=>n=>FTt(e(n),r(n)),addToOptions:(e,r)=>e.concat(r),filterStrict:(e,r)=>e||r})}});function FTt(t,e){return t?e?t+" "+e:t:e}function wdn(t,e,r,n,i,a){let s=t.textDirection==Sa.RTL,o=s,l=!1,u="top",h,d,f=e.left-i.left,p=i.right-e.right,g=n.right-n.left,m=n.bottom-n.top;if(o&&f=m||b>e.top?h=r.bottom-e.top:(u="bottom",h=e.bottom-r.top)}let v=(e.bottom-e.top)/a.offsetHeight,y=(e.right-e.left)/a.offsetWidth;return{style:`${u}: ${h/v}px; max-width: ${d/y}px`,class:"cm-completionInfo-"+(l?s?"left-narrow":"right-narrow":o?"left":"right")}}const F2e=nn.define();function Adn(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(r){let n=document.createElement("div");return n.classList.add("cm-completionIcon"),r.type&&n.classList.add(...r.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),n.setAttribute("aria-hidden","true"),n},position:20}),e.push({render(r,n,i,a){let s=document.createElement("span");s.className="cm-completionLabel";let o=r.displayLabel||r.label,l=0;for(let u=0;ul&&s.appendChild(document.createTextNode(o.slice(l,h)));let f=s.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(o.slice(h,d))),f.className="cm-completionMatchedText",l=d}return lr.position-n.position).map(r=>r.render)}function z2e(t,e,r){if(t<=r)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let i=Math.floor(e/r);return{from:i*r,to:(i+1)*r}}let n=Math.ceil((t-e)/r);return{from:t-n*r,to:t-(n-1)*r}}class Sdn{constructor(e,r,n){this.view=e,this.stateField=r,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let i=e.state.field(r),{options:a,selected:s}=i.open,o=e.state.facet(Ll);this.optionContent=Adn(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=z2e(a.length,s,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{let{options:u}=e.state.field(r).open;for(let h=l.target,d;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(d=/-(\d+)$/.exec(h.id))&&+d[1]this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;h!=null&&(e.dispatch({effects:F2e.of(h)}),l.preventDefault())}}),this.dom.addEventListener("focusout",l=>{let u=e.state.field(this.stateField,!1);u&&u.tooltip&&e.state.facet(Ll).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:f$.of(null)})}),this.showOptions(a,i.id)}mount(){this.updateSel()}showOptions(e,r){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,r,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var r;let n=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=i){let{options:a,selected:s,disabled:o}=n.open;(!i.open||i.open.options!=a)&&(this.range=z2e(a.length,s,e.state.facet(Ll).maxRenderedOptions),this.showOptions(a,n.id)),this.updateSel(),o!=((r=i.open)===null||r===void 0?void 0:r.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!o)}}updateTooltipClass(e){let r=this.tooltipClass(e);if(r!=this.currentClass){for(let n of this.currentClass.split(" "))n&&this.dom.classList.remove(n);for(let n of r.split(" "))n&&this.dom.classList.add(n);this.currentClass=r}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),r=e.open;(r.selected>-1&&r.selected=this.range.to)&&(this.range=z2e(r.options.length,r.selected,this.view.state.facet(Ll).maxRenderedOptions),this.showOptions(r.options,e.id));let n=this.updateSelectedOption(r.selected);if(n){this.destroyInfo();let{completion:i}=r.options[r.selected],{info:a}=i;if(!a)return;let s=typeof a=="string"?document.createTextNode(a):a(i);if(!s)return;"then"in s?s.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,i)}).catch(o=>Nh(this.view.state,o,"completion info")):(this.addInfoPane(s,i),n.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,r){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",n.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:a}=e;n.appendChild(i),this.infoDestroy=a||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let r=null;for(let n=this.list.firstChild,i=this.range.from;n;n=n.nextSibling,i++)n.nodeName!="LI"||!n.id?i--:i==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),r=n):n.hasAttribute("aria-selected")&&(n.removeAttribute("aria-selected"),n.removeAttribute("aria-describedby"));return r&&Cdn(this.list,r),r}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let r=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),a=this.space;if(!a){let s=this.dom.ownerDocument.documentElement;a={left:0,top:0,right:s.clientWidth,bottom:s.clientHeight}}return i.top>Math.min(a.bottom,r.bottom)-10||i.bottom{s.target==i&&s.preventDefault()});let a=null;for(let s=n.from;sn.from||n.from==0))if(a=f,typeof u!="string"&&u.header)i.appendChild(u.header(u));else{let p=i.appendChild(document.createElement("completion-section"));p.textContent=f}}const h=i.appendChild(document.createElement("li"));h.id=r+"-"+s,h.setAttribute("role","option");let d=this.optionClass(o);d&&(h.className=d);for(let f of this.optionContent){let p=f(o,this.view.state,this.view,l);p&&h.appendChild(p)}}return n.from&&i.classList.add("cm-completionListIncompleteTop"),n.tonew Sdn(r,t,e)}function Cdn(t,e){let r=t.getBoundingClientRect(),n=e.getBoundingClientRect(),i=r.height/t.offsetHeight;n.topr.bottom&&(t.scrollTop+=(n.bottom-r.bottom)/i)}function zTt(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function Odn(t,e){let r=[],n=null,i=null,a=h=>{r.push(h);let{section:d}=h.completion;if(d){n||(n=[]);let f=typeof d=="string"?d:d.name;n.some(p=>p.name==f)||n.push(typeof d=="string"?{name:f}:d)}},s=e.facet(Ll);for(let h of t)if(h.hasResult()){let d=h.result.getMatch;if(h.result.filter===!1)for(let f of h.result.options)a(new NTt(f,h.source,d?d(f):[],1e9-r.length));else{let f=e.sliceDoc(h.from,h.to),p,g=s.filterStrict?new xdn(f):new bdn(f);for(let m of h.result.options)if(p=g.match(m.label)){let v=m.displayLabel?d?d(m,p.matched):[]:p.matched,y=p.score+(m.boost||0);if(a(new NTt(m,h.source,v,y)),typeof m.section=="object"&&m.section.rank==="dynamic"){let{name:b}=m.section;i||(i=Object.create(null)),i[b]=Math.max(y,i[b]||-1e9)}}}}if(n){let h=Object.create(null),d=0,f=(p,g)=>(p.rank==="dynamic"&&g.rank==="dynamic"?i[g.name]-i[p.name]:0)||(typeof p.rank=="number"?p.rank:1e9)-(typeof g.rank=="number"?g.rank:1e9)||(p.namef.score-d.score||u(d.completion,f.completion))){let d=h.completion;!l||l.label!=d.label||l.detail!=d.detail||l.type!=null&&d.type!=null&&l.type!=d.type||l.apply!=d.apply||l.boost!=d.boost?o.push(h):zTt(h.completion)>zTt(l)&&(o[o.length-1]=h),l=h.completion}return o}class O4{constructor(e,r,n,i,a,s){this.options=e,this.attrs=r,this.tooltip=n,this.timestamp=i,this.selected=a,this.disabled=s}setSelected(e,r){return e==this.selected||e>=this.options.length?this:new O4(this.options,UTt(r,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,r,n,i,a,s){if(i&&!s&&e.some(u=>u.isPending))return i.setDisabled();let o=Odn(e,r);if(!o.length)return i&&e.some(u=>u.isPending)?i.setDisabled():null;let l=r.facet(Ll).selectOnOpen?0:-1;if(i&&i.selected!=l&&i.selected!=-1){let u=i.options[i.selected].completion;for(let h=0;hh.hasResult()?Math.min(u,h.from):u,1e8),create:Ldn,above:a.aboveCursor},i?i.timestamp:Date.now(),l,!1)}map(e){return new O4(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new O4(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class vK{constructor(e,r,n){this.active=e,this.id=r,this.open=n}static start(){return new vK(Rdn,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:r}=e,n=r.facet(Ll),a=(n.override||r.languageDataAt("autocomplete",YT(r)).map(ydn)).map(l=>(this.active.find(h=>h.source==l)||new ap(l,this.active.some(h=>h.state!=0)?1:0)).update(e,n));a.length==this.active.length&&a.every((l,u)=>l==this.active[u])&&(a=this.active);let s=this.open,o=e.effects.some(l=>l.is(U2e));s&&e.docChanged&&(s=s.map(e.changes)),e.selection||a.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!kdn(a,this.active)||o?s=O4.build(a,r,this.id,s,n,o):s&&s.disabled&&!a.some(l=>l.isPending)&&(s=null),!s&&a.every(l=>!l.isPending)&&a.some(l=>l.hasResult())&&(a=a.map(l=>l.hasResult()?new ap(l.source,0):l));for(let l of e.effects)l.is(F2e)&&(s=s&&s.setSelected(l.value,this.id));return a==this.active&&s==this.open?this:new vK(a,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Edn:_dn}}function kdn(t,e){if(t==e)return!0;for(let r=0,n=0;;){for(;r-1&&(r["aria-activedescendant"]=t+"-"+e),r}const Rdn=[];function VTt(t,e){if(t.isUserEvent("input.complete")){let n=t.annotation($2e);if(n&&e.activateOnCompletion(n))return 12}let r=t.isUserEvent("input.type");return r&&e.activateOnTyping?5:r?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class ap{constructor(e,r,n=!1){this.source=e,this.state=r,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(e,r){let n=VTt(e,r),i=this;(n&8||n&16&&this.touches(e))&&(i=new ap(i.source,0)),n&4&&i.state==0&&(i=new ap(this.source,1)),i=i.updateFor(e,n);for(let a of e.effects)if(a.is(mK))i=new ap(i.source,1,a.value);else if(a.is(f$))i=new ap(i.source,0);else if(a.is(U2e))for(let s of a.value)s.source==i.source&&(i=s);return i}updateFor(e,r){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(YT(e.state))}}class k4 extends ap{constructor(e,r,n,i,a,s){super(e,3,r),this.limit=n,this.result=i,this.from=a,this.to=s}hasResult(){return!0}updateFor(e,r){var n;if(!(r&3))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let a=e.changes.mapPos(this.from),s=e.changes.mapPos(this.to,1),o=YT(e.state);if(o>s||!i||r&2&&(YT(e.startState)==this.from||or.map(e))}}),$h=Vs.define({create(){return vK.start()},update(t,e){return t.update(e)},provide:t=>[c2e.from(t,e=>e.tooltip),er.contentAttributes.from(t,e=>e.attrs)]});function V2e(t,e){const r=e.completion.apply||e.completion.label;let n=t.state.field($h).active.find(i=>i.source==e.source);return n instanceof k4?(typeof r=="string"?t.dispatch({...vdn(t.state,r,n.from,n.to),annotations:$2e.of(e.completion)}):r(t,e.completion,n.from,n.to),!0):!1}const Ldn=Tdn($h,V2e);function yK(t,e="option"){return r=>{let n=r.state.field($h,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp-1?n.open.selected+i*(t?1:-1):t?0:s-1;return o<0?o=e=="page"?0:s-1:o>=s&&(o=e=="page"?s-1:0),r.dispatch({effects:F2e.of(o)}),!0}}const Mdn=t=>{let e=t.state.field($h,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.state.field($h,!1)?(t.dispatch({effects:mK.of(!0)}),!0):!1,Idn=t=>{let e=t.state.field($h,!1);return!e||!e.active.some(r=>r.state!=0)?!1:(t.dispatch({effects:f$.of(null)}),!0)};class Pdn{constructor(e,r){this.active=e,this.context=r,this.time=Date.now(),this.updates=[],this.done=void 0}}const Ndn=50,Bdn=1e3,$dn=ws.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field($h).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field($h),r=t.state.facet(Ll);if(!t.selectionSet&&!t.docChanged&&t.startState.field($h)==e)return;let n=t.transactions.some(a=>{let s=VTt(a,r);return s&8||(a.selection||a.docChanged)&&!(s&3)});for(let a=0;aNdn&&Date.now()-s.time>Bdn){for(let o of s.context.abortListeners)try{o()}catch(l){Nh(this.view.state,l)}s.context.abortListeners=null,this.running.splice(a--,1)}else s.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(a=>a.effects.some(s=>s.is(mK)))&&(this.pendingStart=!0);let i=this.pendingStart?50:r.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(a=>a.isPending&&!this.running.some(s=>s.active.source==a.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let a of t.transactions)a.isUserEvent("input.type")?this.composing=2:this.composing==2&&a.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field($h);for(let r of e.active)r.isPending&&!this.running.some(n=>n.active.source==r.source)&&this.startQuery(r);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ll).updateSyncTime))}startQuery(t){let{state:e}=this.view,r=YT(e),n=new N2e(e,r,t.explicit,this.view),i=new Pdn(t,n);this.running.push(i),Promise.resolve(t.source(n)).then(a=>{i.context.aborted||(i.done=a||null,this.scheduleAccept())},a=>{this.view.dispatch({effects:f$.of(null)}),Nh(this.view.state,a)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ll).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],r=this.view.state.facet(Ll),n=this.view.state.field($h);for(let i=0;io.source==a.active.source);if(s&&s.isPending)if(a.done==null){let o=new ap(a.active.source,0);for(let l of a.updates)o=o.update(l,r);o.isPending||e.push(o)}else this.startQuery(s)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:U2e.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field($h,!1);if(e&&e.tooltip&&this.view.state.facet(Ll).closeOnBlur){let r=e.open&&_St(this.view,e.open.tooltip);(!r||!r.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:f$.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:mK.of(!1)}),20),this.composing=0}}}),Fdn=typeof navigator=="object"&&/Win/.test(navigator.platform),zdn=Fd.highest(er.domEventHandlers({keydown(t,e){let r=e.state.field($h,!1);if(!r||!r.open||r.open.disabled||r.open.selected<0||t.key.length>1||t.ctrlKey&&!(Fdn&&t.altKey)||t.metaKey)return!1;let n=r.open.options[r.open.selected],i=r.active.find(s=>s.source==n.source),a=n.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(t.key)>-1&&V2e(e,n),!1}})),QTt=er.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class Udn{constructor(e,r,n,i){this.field=e,this.line=r,this.from=n,this.to=i}}class G2e{constructor(e,r,n){this.field=e,this.from=r,this.to=n}map(e){let r=e.mapPos(this.from,-1,uc.TrackDel),n=e.mapPos(this.to,1,uc.TrackDel);return r==null||n==null?null:new G2e(this.field,r,n)}}class H2e{constructor(e,r){this.lines=e,this.fieldPositions=r}instantiate(e,r){let n=[],i=[r],a=e.doc.lineAt(r),s=/^\s*/.exec(a.text)[0];for(let l of this.lines){if(n.length){let u=s,h=/^\t*/.exec(l)[0].length;for(let d=0;dnew G2e(l.field,i[l.line]+l.from,i[l.line]+l.to));return{text:n,ranges:o}}static parse(e){let r=[],n=[],i=[],a;for(let s of e.split(/\r\n?|\n/)){for(;a=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(s);){let o=a[1]?+a[1]:null,l=a[2]||a[3]||"",u=-1;o===0&&(o=1e9);let h=l.replace(/\\[{}]/g,d=>d[1]);for(let d=0;d=u&&f.field++}for(let d of i)if(d.line==n.length&&d.from>a.index){let f=a[2]?3+(a[1]||"").length:2;d.from-=f,d.to-=f}i.push(new Udn(u,n.length,a.index,a.index+h.length)),s=s.slice(0,a.index)+l+s.slice(a.index+a[0].length)}s=s.replace(/\\([{}])/g,(o,l,u)=>{for(let h of i)h.line==n.length&&h.from>u&&(h.from--,h.to--);return l}),n.push(s)}return new H2e(n,i)}}let Vdn=Ar.widget({widget:new class extends Iu{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),Qdn=Ar.mark({class:"cm-snippetField"});class E4{constructor(e,r){this.ranges=e,this.active=r,this.deco=Ar.set(e.map(n=>(n.from==n.to?Vdn:Qdn).range(n.from,n.to)),!0)}map(e){let r=[];for(let n of this.ranges){let i=n.map(e);if(!i)return null;r.push(i)}return new E4(r,this.active)}selectionInsideField(e){return e.ranges.every(r=>this.ranges.some(n=>n.field==this.active&&n.from<=r.from&&n.to>=r.to))}}const p$=nn.define({map(t,e){return t&&t.map(e)}}),Gdn=nn.define(),g$=Vs.define({create(){return null},update(t,e){for(let r of e.effects){if(r.is(p$))return r.value;if(r.is(Gdn)&&t)return new E4(t.ranges,r.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>er.decorations.from(t,e=>e?e.deco:Ar.none)});function W2e(t,e){return bt.create(t.filter(r=>r.field==e).map(r=>bt.range(r.from,r.to)))}function Hdn(t){let e=H2e.parse(t);return(r,n,i,a)=>{let{text:s,ranges:o}=e.instantiate(r.state,i),{main:l}=r.state.selection,u={changes:{from:i,to:a==l.from?l.to:a,insert:vi.of(s)},scrollIntoView:!0,annotations:n?[$2e.of(n),Do.userEvent.of("input.complete")]:void 0};if(o.length&&(u.selection=W2e(o,0)),o.some(h=>h.field>0)){let h=new E4(o,0),d=u.effects=[p$.of(h)];r.state.field(g$,!1)===void 0&&d.push(nn.appendConfig.of([g$,Ydn,qdn,QTt]))}r.dispatch(r.state.update(u))}}function GTt(t){return({state:e,dispatch:r})=>{let n=e.field(g$,!1);if(!n||t<0&&n.active==0)return!1;let i=n.active+t,a=t>0&&!n.ranges.some(s=>s.field==i+t);return r(e.update({selection:W2e(n.ranges,i),effects:p$.of(a?null:new E4(n.ranges,i)),scrollIntoView:!0})),!0}}const Wdn=[{key:"Tab",run:GTt(1),shift:GTt(-1)},{key:"Escape",run:({state:t,dispatch:e})=>t.field(g$,!1)?(e(t.update({effects:p$.of(null)})),!0):!1}],HTt=vr.define({combine(t){return t.length?t[0]:Wdn}}),Ydn=Fd.highest(y4.compute([HTt],t=>t.facet(HTt)));function As(t,e){return{...e,apply:Hdn(t)}}const qdn=er.domEventHandlers({mousedown(t,e){let r=e.state.field(g$,!1),n;if(!r||(n=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=r.ranges.find(a=>a.from<=n&&a.to>=n);return!i||i.field==r.active?!1:(e.dispatch({selection:W2e(r.ranges,i.field),effects:p$.of(r.ranges.some(a=>a.field>i.field)?new E4(r.ranges,i.field):null),scrollIntoView:!0}),!0)}}),m$={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},qT=nn.define({map(t,e){let r=e.mapPos(t,-1,uc.TrackAfter);return r??void 0}}),Y2e=new class extends n2{};Y2e.startSide=1,Y2e.endSide=-1;const WTt=Vs.define({create(){return Zn.empty},update(t,e){if(t=t.map(e.changes),e.selection){let r=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:n=>n>=r.from&&n<=r.to})}for(let r of e.effects)r.is(qT)&&(t=t.update({add:[Y2e.range(r.value,r.value+1)]}));return t}});function jdn(){return[Kdn,WTt]}const q2e="()[]{}<>«»»«[]{}";function YTt(t){for(let e=0;e{if((Xdn?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(n.length>2||n.length==2&&o0(Ph(n,0))==1||e!=i.from||r!=i.to)return!1;let a=Jdn(t.state,n);return a?(t.dispatch(a),!0):!1}),Zdn=[{key:"Backspace",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=qTt(t,t.selection.main.head).brackets||m$.brackets,i=null,a=t.changeByRange(s=>{if(s.empty){let o=efn(t.doc,s.head);for(let l of n)if(l==o&&bK(t.doc,s.head)==YTt(Ph(l,0)))return{changes:{from:s.head-l.length,to:s.head+l.length},range:bt.cursor(s.head-l.length)}}return{range:i=s}});return i||e(t.update(a,{scrollIntoView:!0,userEvent:"delete.backward"})),!i}}];function Jdn(t,e){let r=qTt(t,t.selection.main.head),n=r.brackets||m$.brackets;for(let i of n){let a=YTt(Ph(i,0));if(e==i)return a==i?nfn(t,i,n.indexOf(i+i+i)>-1,r):tfn(t,i,a,r.before||m$.before);if(e==a&&jTt(t,t.selection.main.from))return rfn(t,i,a)}return null}function jTt(t,e){let r=!1;return t.field(WTt).between(0,t.doc.length,n=>{n==e&&(r=!0)}),r}function bK(t,e){let r=t.sliceString(e,e+2);return r.slice(0,o0(Ph(r,0)))}function efn(t,e){let r=t.sliceString(e-2,e);return o0(Ph(r,0))==r.length?r:r.slice(1)}function tfn(t,e,r,n){let i=null,a=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:r,from:s.to}],effects:qT.of(s.to+e.length),range:bt.range(s.anchor+e.length,s.head+e.length)};let o=bK(t.doc,s.head);return!o||/\s/.test(o)||n.indexOf(o)>-1?{changes:{insert:e+r,from:s.head},effects:qT.of(s.head+e.length),range:bt.cursor(s.head+e.length)}:{range:i=s}});return i?null:t.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function rfn(t,e,r){let n=null,i=t.changeByRange(a=>a.empty&&bK(t.doc,a.head)==r?{changes:{from:a.head,to:a.head+r.length,insert:r},range:bt.cursor(a.head+r.length)}:n={range:a});return n?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function nfn(t,e,r,n){let i=n.stringPrefixes||m$.stringPrefixes,a=null,s=t.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:e,from:o.to}],effects:qT.of(o.to+e.length),range:bt.range(o.anchor+e.length,o.head+e.length)};let l=o.head,u=bK(t.doc,l),h;if(u==e){if(XTt(t,l))return{changes:{insert:e+e,from:l},effects:qT.of(l+e.length),range:bt.cursor(l+e.length)};if(jTt(t,l)){let f=r&&t.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+f.length,insert:f},range:bt.cursor(l+f.length)}}}else{if(r&&t.sliceDoc(l-2*e.length,l)==e+e&&(h=KTt(t,l-2*e.length,i))>-1&&XTt(t,h))return{changes:{insert:e+e+e+e,from:l},effects:qT.of(l+e.length),range:bt.cursor(l+e.length)};if(t.charCategorizer(l)(u)!=ps.Word&&KTt(t,l,i)>-1&&!ifn(t,l,e,i))return{changes:{insert:e+e,from:l},effects:qT.of(l+e.length),range:bt.cursor(l+e.length)}}return{range:a=o}});return a?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function XTt(t,e){let r=pa(t).resolveInner(e+1);return r.parent&&r.from==e}function ifn(t,e,r,n){let i=pa(t).resolveInner(e,-1),a=n.reduce((s,o)=>Math.max(s,o.length),0);for(let s=0;s<5;s++){let o=t.sliceDoc(i.from,Math.min(i.to,i.from+r.length+a)),l=o.indexOf(r);if(!l||l>-1&&n.indexOf(o.slice(0,l))>-1){let h=i.firstChild;for(;h&&h.from==i.from&&h.to-h.from>r.length+l;){if(t.sliceDoc(h.to-r.length,h.to)==r)return!1;h=h.firstChild}return!0}let u=i.to==e&&i.parent;if(!u)break;i=u}return!1}function KTt(t,e,r){let n=t.charCategorizer(e);if(n(t.sliceDoc(e-1,e))!=ps.Word)return e;for(let i of r){let a=e-i.length;if(t.sliceDoc(a,e)==i&&n(t.sliceDoc(a-1,a))!=ps.Word)return a}return-1}function afn(t={}){return[zdn,$h,Ll.of(t),$dn,sfn,QTt]}const ZTt=[{key:"Ctrl-Space",run:Q2e},{mac:"Alt-`",run:Q2e},{mac:"Alt-i",run:Q2e},{key:"Escape",run:Idn},{key:"ArrowDown",run:yK(!0)},{key:"ArrowUp",run:yK(!1)},{key:"PageDown",run:yK(!0,"page")},{key:"PageUp",run:yK(!1,"page")},{key:"Enter",run:Mdn}],sfn=Fd.highest(y4.computeN([Ll],t=>t.facet(Ll).defaultKeymap?[ZTt]:[])),JTt=[As("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),As("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),As("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),As("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),As("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),As(`try { \${} } catch (\${error}) { \${} @@ -703,17 +703,17 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="

An error constructor(\${params}) { \${} } -}`,{label:"class",detail:"definition",type:"keyword"}),As('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),As('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],ofn=JSt.concat([As("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),As("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),As("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),eCt=new Zbe,tCt=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function v$(t){return(e,r)=>{let n=e.node.getChild("VariableDefinition");return n&&r(n,t),!0}}const lfn=["FunctionDeclaration"],cfn={FunctionDeclaration:v$("function"),ClassDeclaration:v$("class"),ClassExpression:()=>!0,EnumDeclaration:v$("constant"),TypeAliasDeclaration:v$("type"),NamespaceDeclaration:v$("namespace"),VariableDefinition(t,e){t.matchContext(lfn)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function rCt(t,e){let r=eCt.get(e);if(r)return r;let n=[],i=!0;function a(s,o){let l=t.sliceString(s.from,s.to);n.push({label:l,type:o})}return e.cursor(Wi.IncludeAnonymous).iterate(s=>{if(i)i=!1;else if(s.name){let o=cfn[s.name];if(o&&o(s,a)||tCt.has(s.name))return!1}else if(s.to-s.from>8192){for(let o of rCt(t,s.node))n.push(o);return!1}}),eCt.set(e,n),n}const nCt=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,iCt=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function ufn(t){let e=pa(t.state).resolveInner(t.pos,-1);if(iCt.indexOf(e.name)>-1)return null;let r=e.name=="VariableName"||e.to-e.from<20&&nCt.test(t.state.sliceDoc(e.from,e.to));if(!r&&!t.explicit)return null;let n=[];for(let i=e;i;i=i.parent)tCt.has(i.name)&&(n=n.concat(rCt(t.state.doc,i)));return{options:n,from:r?e.from:t.pos,validFor:nCt}}const b0=jy.define({name:"javascript",parser:gdn.configure({props:[Ky.add({IfStatement:S4({except:/^\s*({|else\b)/}),TryStatement:S4({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Kun,SwitchBody:t=>{let e=t.textAfter,r=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return t.baseIndent+(r?0:n?1:2)*t.unit},Block:T4({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":S4({except:/^\s*{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),Zy.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":l$,BlockComment(t){return{from:t.from+2,to:t.to-2}},JSXElement(t){let e=t.firstChild;if(!e||e.name=="JSXSelfClosingTag")return null;let r=t.lastChild;return{from:e.to,to:r.type.isError?t.to:r.from}},"JSXSelfClosingTag JSXOpenTag"(t){var e;let r=(e=t.firstChild)===null||e===void 0?void 0:e.nextSibling,n=t.lastChild;return!r||r.type.isError?null:{from:r.to,to:n.type.isError?t.to:n.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),aCt={test:t=>/^JSX/.test(t.name),facet:aK({commentTokens:{block:{open:"{/*",close:"*/}"}}})},sCt=b0.configure({dialect:"ts"},"typescript"),oCt=b0.configure({dialect:"jsx",props:[b2e.add(t=>t.isTop?[aCt]:void 0)]}),lCt=b0.configure({dialect:"jsx ts",props:[b2e.add(t=>t.isTop?[aCt]:void 0)]},"typescript");let cCt=t=>({label:t,type:"keyword"});const uCt="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(cCt),hfn=uCt.concat(["declare","implements","private","protected","public"].map(cCt));function j2e(t={}){let e=t.jsx?t.typescript?lCt:oCt:t.typescript?sCt:b0,r=t.typescript?ofn.concat(hfn):JSt.concat(uCt);return new u2(e,[b0.data.of({autocomplete:PSt(iCt,B2e(r))}),b0.data.of({autocomplete:ufn}),t.jsx?pfn:[]])}function dfn(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}function hCt(t,e,r=t.length){for(let n=e==null?void 0:e.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return t.sliceString(n.from,Math.min(n.to,r));return""}const ffn=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),pfn=er.inputHandler.of((t,e,r,n,i)=>{if((ffn?t.composing:t.compositionStarted)||t.state.readOnly||e!=r||n!=">"&&n!="/"||!b0.isActiveAt(t.state,e,-1))return!1;let a=i(),{state:s}=a,o=s.changeByRange(l=>{var u;let{head:h}=l,d=pa(s).resolveInner(h-1,-1),f;if(d.name=="JSXStartTag"&&(d=d.parent),!(s.doc.sliceString(h-1,h)!=n||d.name=="JSXAttributeValue"&&d.to>h)){if(n==">"&&d.name=="JSXFragmentTag")return{range:l,changes:{from:h,insert:""}};if(n=="/"&&d.name=="JSXStartCloseTag"){let p=d.parent,g=p.parent;if(g&&p.from==h-2&&((f=hCt(s.doc,g.firstChild,h))||((u=g.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let m=`${f}>`;return{range:bt.cursor(h+m.length,-1),changes:{from:h,insert:m}}}}else if(n==">"){let p=dfn(d);if(p&&p.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(s.doc.sliceString(h,h+2))&&(f=hCt(s.doc,p,h)))return{range:l,changes:{from:h,insert:``}}}}return{range:l}});return o.changes.empty?!1:(t.dispatch([a,s.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),gfn=qy({String:Ee.string,Number:Ee.number,"True False":Ee.bool,PropertyName:Ee.propertyName,Null:Ee.null,", :":Ee.separator,"[ ]":Ee.squareBracket,"{ }":Ee.brace}),mfn=Jy.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[gfn],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),vfn=jy.define({name:"json",parser:mfn.configure({props:[Ky.add({Object:S4({except:/^\s*\}/}),Array:S4({except:/^\s*\]/})}),Zy.add({"Object Array":l$})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function yfn(){return new u2(vfn)}class xK{static create(e,r,n,i,a){let s=i+(i<<8)+e+(r<<4)|0;return new xK(e,r,n,s,a,[],[])}constructor(e,r,n,i,a,s,o){this.type=e,this.value=r,this.from=n,this.hash=i,this.end=a,this.children=s,this.positions=o,this.hashProp=[[En.contextHash,i]]}addChild(e,r){e.prop(En.contextHash)!=this.hash&&(e=new si(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(r)}toTree(e,r=this.end){let n=this.children.length-1;return n>=0&&(r=Math.max(r,this.positions[n]+this.children[n].length+this.from)),new si(e.types[this.type],this.children,this.positions,r-this.from).balance({makeTree:(i,a,s)=>new si(Ro.none,i,a,s,this.hashProp)})}}var nr;(function(t){t[t.Document=1]="Document",t[t.CodeBlock=2]="CodeBlock",t[t.FencedCode=3]="FencedCode",t[t.Blockquote=4]="Blockquote",t[t.HorizontalRule=5]="HorizontalRule",t[t.BulletList=6]="BulletList",t[t.OrderedList=7]="OrderedList",t[t.ListItem=8]="ListItem",t[t.ATXHeading1=9]="ATXHeading1",t[t.ATXHeading2=10]="ATXHeading2",t[t.ATXHeading3=11]="ATXHeading3",t[t.ATXHeading4=12]="ATXHeading4",t[t.ATXHeading5=13]="ATXHeading5",t[t.ATXHeading6=14]="ATXHeading6",t[t.SetextHeading1=15]="SetextHeading1",t[t.SetextHeading2=16]="SetextHeading2",t[t.HTMLBlock=17]="HTMLBlock",t[t.LinkReference=18]="LinkReference",t[t.Paragraph=19]="Paragraph",t[t.CommentBlock=20]="CommentBlock",t[t.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",t[t.Escape=22]="Escape",t[t.Entity=23]="Entity",t[t.HardBreak=24]="HardBreak",t[t.Emphasis=25]="Emphasis",t[t.StrongEmphasis=26]="StrongEmphasis",t[t.Link=27]="Link",t[t.Image=28]="Image",t[t.InlineCode=29]="InlineCode",t[t.HTMLTag=30]="HTMLTag",t[t.Comment=31]="Comment",t[t.ProcessingInstruction=32]="ProcessingInstruction",t[t.Autolink=33]="Autolink",t[t.HeaderMark=34]="HeaderMark",t[t.QuoteMark=35]="QuoteMark",t[t.ListMark=36]="ListMark",t[t.LinkMark=37]="LinkMark",t[t.EmphasisMark=38]="EmphasisMark",t[t.CodeMark=39]="CodeMark",t[t.CodeText=40]="CodeText",t[t.CodeInfo=41]="CodeInfo",t[t.LinkTitle=42]="LinkTitle",t[t.LinkLabel=43]="LinkLabel",t[t.URL=44]="URL"})(nr||(nr={}));class bfn{constructor(e,r){this.start=e,this.content=r,this.marks=[],this.parsers=[]}}class xfn{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return y$(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,r=0,n=0){for(let i=r;i=e.stack[r.depth+1].value+r.baseIndent)return!0;if(r.indent>=r.baseIndent+4)return!1;let n=(t.type==nr.OrderedList?Z2e:K2e)(r,e,!1);return n>0&&(t.type!=nr.BulletList||X2e(r,e,!1)<0)&&r.text.charCodeAt(r.pos+n-1)==t.value}const fCt={[nr.Blockquote](t,e,r){return r.next!=62?!1:(r.markers.push(Ei(nr.QuoteMark,e.lineStart+r.pos,e.lineStart+r.pos+1)),r.moveBase(r.pos+(sp(r.text.charCodeAt(r.pos+1))?2:1)),t.end=e.lineStart+r.text.length,!0)},[nr.ListItem](t,e,r){return r.indent-1?!1:(r.moveBaseColumn(r.baseIndent+t.value),!0)},[nr.OrderedList]:dCt,[nr.BulletList]:dCt,[nr.Document](){return!0}};function sp(t){return t==32||t==9||t==10||t==13}function y$(t,e=0){for(;er&&sp(t.charCodeAt(e-1));)e--;return e}function gCt(t){if(t.next!=96&&t.next!=126)return-1;let e=t.pos+1;for(;e-1&&t.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(SCt.SetextHeading)>-1||n<3?-1:1}function vCt(t,e){for(let r=t.stack.length-1;r>=0;r--)if(t.stack[r].type==e)return!0;return!1}function K2e(t,e,r){return(t.next==45||t.next==43||t.next==42)&&(t.pos==t.text.length-1||sp(t.text.charCodeAt(t.pos+1)))&&(!r||vCt(e,nr.BulletList)||t.skipSpace(t.pos+2)=48&&i<=57;){n++;if(n==t.text.length)return-1;i=t.text.charCodeAt(n)}return n==t.pos||n>t.pos+9||i!=46&&i!=41||nt.pos+1||t.next!=49)?-1:n+1-t.pos}function yCt(t){if(t.next!=35)return-1;let e=t.pos+1;for(;e6?-1:r}function bCt(t){if(t.next!=45&&t.next!=61||t.indent>=t.baseIndent+4)return-1;let e=t.pos+1;for(;e/,wCt=/\?>/,ewe=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/,wCt=/\?>/,ewe=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec(n);if(a)return t.append(Ei(nr.Comment,r,r+1+a[0].length));let s=/^\?[^]*?\?>/.exec(n);if(s)return t.append(Ei(nr.ProcessingInstruction,r,r+1+s[0].length));let o=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(n);return o?t.append(Ei(nr.HTMLTag,r,r+1+o[0].length)):-1},Emphasis(t,e,r){if(e!=95&&e!=42)return-1;let n=r+1;for(;t.char(n)==e;)n++;let i=t.slice(r-1,r),a=t.slice(n,n+1),s=w$.test(i),o=w$.test(a),l=/\s|^$/.test(i),u=/\s|^$/.test(a),h=!u&&(!o||l||s),d=!l&&(!s||u||o),f=h&&(e==42||!d||s),p=d&&(e==42||!h||o);return t.append(new Qd(e==95?_Ct:RCt,r,n,(f?1:0)|(p?2:0)))},HardBreak(t,e,r){if(e==92&&t.char(r+1)==10)return t.append(Ei(nr.HardBreak,r,r+2));if(e==32){let n=r+1;for(;t.char(n)==32;)n++;if(t.char(n)==10&&n>=r+2)return t.append(Ei(nr.HardBreak,r,n+1))}return-1},Link(t,e,r){return e==91?t.append(new Qd(jS,r,r+1,1)):-1},Image(t,e,r){return e==33&&t.char(r+1)==91?t.append(new Qd(SK,r,r+2,1)):-1},LinkEnd(t,e,r){if(e!=93)return-1;for(let n=t.parts.length-1;n>=0;n--){let i=t.parts[n];if(i instanceof Qd&&(i.type==jS||i.type==SK)){if(!i.side||t.skipSpace(i.to)==r&&!/[(\[]/.test(t.slice(r+1,r+2)))return t.parts[n]=null,-1;let a=t.takeContent(n),s=t.parts[n]=Ofn(t,a,i.type==jS?nr.Link:nr.Image,i.from,r+1);if(i.type==jS)for(let o=0;oe?Ei(nr.URL,e+r,a+r):a==t.length?null:!1}}function MCt(t,e,r){let n=t.charCodeAt(e);if(n!=39&&n!=34&&n!=40)return!1;let i=n==40?41:n;for(let a=e+1,s=!1;a=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,r){return this.text.slice(e-this.offset,r-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,r,n,i,a){return this.append(new Qd(e,r,n,(i?1:0)|(a?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let r=this.parts[e];if(r instanceof Qd&&(r.type==jS||r.type==SK))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let n=e;n=e;l--){let m=this.parts[l];if(m instanceof Qd&&m.side&1&&m.type==i.type&&!(a&&(i.side&1||m.side&2)&&(m.to-m.from+s)%3==0&&((m.to-m.from)%3||s%3))){o=m;break}}if(!o)continue;let u=i.type.resolve,h=[],d=o.from,f=i.to;if(a){let m=Math.min(2,o.to-o.from,s);d=o.to-m,f=i.from+m,u=m==1?"Emphasis":"StrongEmphasis"}o.type.mark&&h.push(this.elt(o.type.mark,d,o.to));for(let m=l+1;m=0;r--){let n=this.parts[r];if(n instanceof Qd&&n.type==e&&n.side&1)return r}return null}takeContent(e){let r=this.resolveMarkers(e);return this.parts.length=e,r}getDelimiterAt(e){let r=this.parts[e];return r instanceof Qd?r:null}skipSpace(e){return y$(this.text,e-this.offset)+this.offset}elt(e,r,n,i){return typeof e=="string"?Ei(this.parser.getNodeType(e),r,n,i):new ECt(e,r)}}iwe.linkStart=jS,iwe.imageStart=SK;function awe(t,e){if(!e.length)return t;if(!t.length)return e;let r=t.slice(),n=0;for(let i of e){for(;n(e?e-1:0))return!1;if(this.fragmentEnd<0){let a=this.fragment.to;for(;a>0&&this.input.read(a-1,a)!=` -`;)a--;this.fragmentEnd=a?a-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let i=e+this.fragment.offset;for(;n.to<=i;)if(!n.parent())return!1;for(;;){if(n.from>=i)return this.fragment.from<=r;if(!n.childAfter(i))return!1}}matches(e){let r=this.cursor.tree;return r&&r.prop(En.contextHash)==e}takeNodes(e){let r=this.cursor,n=this.fragment.offset,i=this.fragmentEnd-(this.fragment.openEnd?1:0),a=e.absoluteLineStart,s=a,o=e.block.children.length,l=s,u=o;for(;;){if(r.to-n>i){if(r.type.isAnonymous&&r.firstChild())continue;break}let h=PCt(r.from-n,e.ranges);if(r.to-n<=e.ranges[e.rangeI].to)e.addNode(r.tree,h);else{let d=new si(e.parser.nodeSet.types[nr.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(d,r.tree),e.addNode(d,h)}if(r.type.is("Block")&&(kfn.indexOf(r.type.id)<0?(s=r.to-n,o=e.block.children.length):(s=l,o=u),l=r.to-n,u=e.block.children.length),!r.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return s-a}}function PCt(t,e){let r=t;for(let n=1;nwK[t]),Object.keys(wK).map(t=>SCt[t]),Object.keys(wK),Tfn,fCt,Object.keys(nwe).map(t=>nwe[t]),Object.keys(nwe),[]);function Dfn(t,e,r){let n=[];for(let i=t.firstChild,a=e;;i=i.nextSibling){let s=i?i.from:r;if(s>a&&n.push({from:a,to:s}),!i)break;a=i.to}return n}function Lfn(t){let{codeParser:e,htmlParser:r}=t;return{wrap:uwt((i,a)=>{let s=i.type.id;if(e&&(s==nr.CodeBlock||s==nr.FencedCode)){let o="";if(s==nr.FencedCode){let u=i.node.getChild(nr.CodeInfo);u&&(o=a.read(u.from,u.to))}let l=e(o);if(l)return{parser:l,overlay:u=>u.type.id==nr.CodeText,bracketed:s==nr.FencedCode}}else if(r&&(s==nr.HTMLBlock||s==nr.HTMLTag||s==nr.CommentBlock))return{parser:r,overlay:Dfn(i.node,i.from,i.to)};return null})}}const Mfn={resolve:"Strikethrough",mark:"StrikethroughMark"},Ifn={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":Ee.strikethrough}},{name:"StrikethroughMark",style:Ee.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,e,r){if(e!=126||t.char(r+1)!=126||t.char(r+2)==126)return-1;let n=t.slice(r-1,r),i=t.slice(r+2,r+3),a=/\s|^$/.test(n),s=/\s|^$/.test(i),o=w$.test(n),l=w$.test(i);return t.addDelimiter(Mfn,r,r+2,!s&&(!l||a||o),!a&&(!o||s||l))},after:"Emphasis"}]};function A$(t,e,r=0,n,i=0){let a=0,s=!0,o=-1,l=-1,u=!1,h=()=>{n.push(t.elt("TableCell",i+o,i+l,t.parser.parseInline(e.slice(o,l),i+o)))};for(let d=r;d-1)&&a++,s=!1,n&&(o>-1&&h(),n.push(t.elt("TableDelimiter",d+i,d+i+1))),o=l=-1):(u||f!=32&&f!=9)&&(o<0&&(o=d),l=d+1),u=!u&&f==92}return o>-1&&(a++,n&&h()),a}function NCt(t,e){for(let r=e;r\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class $Ct{constructor(){this.rows=null}nextLine(e,r,n){if(this.rows==null){this.rows=!1;let i;if((r.next==45||r.next==58||r.next==124)&&BCt.test(i=r.text.slice(r.pos))){let a=[];A$(e,n.content,0,a,n.start)==A$(e,i,0)&&(this.rows=[e.elt("TableHeader",n.start,n.start+n.content.length,a),e.elt("TableDelimiter",e.lineStart+r.pos,e.lineStart+r.text.length)])}}else if(this.rows){let i=[];A$(e,r.text,r.pos,i,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+r.pos,e.lineStart+r.text.length,i))}return!1}finish(e,r){return this.rows?(e.addLeafElement(r,e.elt("Table",r.start,r.start+r.content.length,this.rows)),!0):!1}}const Pfn={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":Ee.heading}},"TableRow",{name:"TableCell",style:Ee.content},{name:"TableDelimiter",style:Ee.processingInstruction}],parseBlock:[{name:"Table",leaf(t,e){return NCt(e.content,0)?new $Ct:null},endLeaf(t,e,r){if(r.parsers.some(i=>i instanceof $Ct)||!NCt(e.text,e.basePos))return!1;let n=t.peekLine();return BCt.test(n)&&A$(t,e.text,e.basePos)==A$(t,n,e.basePos)},before:"SetextHeading"}]};class Nfn{nextLine(){return!1}finish(e,r){return e.addLeafElement(r,e.elt("Task",r.start,r.start+r.content.length,[e.elt("TaskMarker",r.start,r.start+3),...e.parser.parseInline(r.content.slice(3),r.start+3)])),!0}}const Bfn={defineNodes:[{name:"Task",block:!0,style:Ee.list},{name:"TaskMarker",style:Ee.atom}],parseBlock:[{name:"TaskList",leaf(t,e){return/^\[[ xX]\][ \t]/.test(e.content)&&t.parentType().name=="ListItem"?new Nfn:null},after:"SetextHeading"}]},FCt=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,zCt=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,$fn=/[\w-]+\.[\w-]+($|[/:])/,UCt=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,VCt=/\/[a-zA-Z\d@.]+/gy;function QCt(t,e,r,n){let i=0;for(let a=e;a-1)return-1;let n=e+r[0].length;for(;;){let i=t[n-1],a;if(/[?!.,:*_~]/.test(i)||i==")"&&QCt(t,e,n,")")>QCt(t,e,n,"("))n--;else if(i==";"&&(a=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(e,n))))n=e+a.index;else break}return n}function GCt(t,e){UCt.lastIndex=e;let r=UCt.exec(t);if(!r)return-1;let n=r[0][r[0].length-1];return n=="_"||n=="-"?-1:e+r[0].length-(n=="."?1:0)}const zfn=[Pfn,Bfn,Ifn,{parseInline:[{name:"Autolink",parse(t,e,r){let n=r-t.offset;if(n&&/\w/.test(t.text[n-1]))return-1;FCt.lastIndex=n;let i=FCt.exec(t.text),a=-1;if(!i)return-1;if(i[1]||i[2]){if(a=Ffn(t.text,n+i[0].length),a>-1&&t.hasOpenLink){let s=/([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(n,a));a=n+s[0].length}}else i[3]?a=GCt(t.text,n):(a=GCt(t.text,n+i[0].length),a>-1&&i[0]=="xmpp:"&&(VCt.lastIndex=a,i=VCt.exec(t.text),i&&(a=i.index+i[0].length)));return a<0?-1:(t.addElement(t.elt("URL",r,a+t.offset)),a+t.offset)}}]}];function HCt(t,e,r){return(n,i,a)=>{if(i!=t||n.char(a+1)==t)return-1;let s=[n.elt(r,a,a+1)];for(let o=a+1;o=65&&t<=90||t==95||t>=97&&t<=122||t>=161}let rOt=null,nOt=null,iOt=0;function cwe(t,e){let r=t.pos+e;if(iOt==r&&nOt==t)return rOt;let n=t.peek(e),i="";for(;fpn(n);)i+=String.fromCharCode(n),n=t.peek(++e);return nOt=t,iOt=r,rOt=i?i.toLowerCase():n==ppn||n==gpn?void 0:null}const aOt=60,CK=62,uwe=47,ppn=63,gpn=33,mpn=45;function sOt(t,e){this.name=t,this.parent=e}const vpn=[swe,XCt,YCt,qCt,jCt],ypn=new gK({start:null,shift(t,e,r,n){return vpn.indexOf(e)>-1?new sOt(cwe(n,1)||"",t):t},reduce(t,e){return e==ZCt&&t?t.parent:t},reuse(t,e,r,n){let i=e.type.id;return i==swe||i==opn?new sOt(cwe(n,1)||"",t):t},strict:!1}),bpn=new uo((t,e)=>{if(t.next!=aOt){t.next<0&&e.context&&t.acceptToken(owe);return}t.advance();let r=t.next==uwe;r&&t.advance();let n=cwe(t,0);if(n===void 0)return;if(!n)return t.acceptToken(r?tpn:epn);let i=e.context?e.context.name:null;if(r){if(n==i)return t.acceptToken(Kfn);if(i&&dpn[i])return t.acceptToken(owe,-2);if(e.dialectEnabled(cpn))return t.acceptToken(Zfn);for(let a=e.context;a;a=a.parent)if(a.name==n)return;t.acceptToken(Jfn)}else{if(n=="script")return t.acceptToken(YCt);if(n=="style")return t.acceptToken(qCt);if(n=="textarea")return t.acceptToken(jCt);if(hpn.hasOwnProperty(n))return t.acceptToken(XCt);i&&tOt[i]&&tOt[i][n]?t.acceptToken(owe,-1):t.acceptToken(swe)}},{contextual:!0}),xpn=new uo(t=>{for(let e=0,r=0;;r++){if(t.next<0){r&&t.acceptToken(KCt);break}if(t.next==mpn)e++;else if(t.next==CK&&e>=2){r>=3&&t.acceptToken(KCt,-2);break}else e=0;t.advance()}});function wpn(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}const Apn=new uo((t,e)=>{if(t.next==uwe&&t.peek(1)==CK){let r=e.dialectEnabled(upn)||wpn(e.context);t.acceptToken(r?Xfn:WCt,2)}else t.next==CK&&t.acceptToken(WCt,1)});function hwe(t,e,r){let n=2+t.length;return new uo(i=>{for(let a=0,s=0,o=0;;o++){if(i.next<0){o&&i.acceptToken(e);break}if(a==0&&i.next==aOt||a==1&&i.next==uwe||a>=2&&as?i.acceptToken(e,-s):i.acceptToken(r,-(s-2));break}else if((i.next==10||i.next==13)&&o){i.acceptToken(e,1);break}else a=s=0;i.advance()}})}const Tpn=hwe("script",Gfn,Hfn),Spn=hwe("style",Wfn,Yfn),Cpn=hwe("textarea",qfn,jfn),Opn=qy({"Text RawText IncompleteTag IncompleteCloseTag":Ee.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":Ee.angleBracket,TagName:Ee.tagName,"MismatchedCloseTag/TagName":[Ee.tagName,Ee.invalid],AttributeName:Ee.attributeName,"AttributeValue UnquotedAttributeValue":Ee.attributeValue,Is:Ee.definitionOperator,"EntityReference CharacterReference":Ee.character,Comment:Ee.blockComment,ProcessingInst:Ee.processingInstruction,DoctypeDecl:Ee.documentMeta}),kpn=Jy.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:ypn,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[Opn],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let u=o.type.id;if(u==ipn)return dwe(o,l,r);if(u==apn)return dwe(o,l,n);if(u==spn)return dwe(o,l,i);if(u==ZCt&&a.length){let h=o.node,d=h.firstChild,f=d&&lOt(d,l),p;if(f){for(let g of a)if(g.tag==f&&(!g.attrs||g.attrs(p||(p=oOt(d,l))))){let m=h.lastChild,v=m.type.id==lpn?m.from:h.to;if(v>d.to)return{parser:g.parser,overlay:[{from:d.to,to:v}]}}}}if(s&&u==JCt){let h=o.node,d;if(d=h.firstChild){let f=s[l.read(d.from,d.to)];if(f)for(let p of f){if(p.tagName&&p.tagName!=lOt(h.parent,l))continue;let g=h.lastChild;if(g.type.id==lwe){let m=g.from+1,v=g.lastChild,y=g.to-(v&&v.isError?0:1);if(y>m)return{parser:p.parser,overlay:[{from:m,to:y}],bracketed:!0}}else if(g.type.id==eOt)return{parser:p.parser,overlay:[{from:g.from,to:g.to}]}}}}return null})}const Epn=145,uOt=1,_pn=146,Rpn=147,hOt=2,Dpn=148,Lpn=3,Mpn=4,dOt=[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],Ipn=58,Ppn=40,fOt=95,Npn=91,OK=45,Bpn=46,$pn=35,Fpn=37,zpn=38,Upn=92,Vpn=10,Qpn=42;function T$(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function fwe(t){return t>=48&&t<=57}function pOt(t){return fwe(t)||t>=97&&t<=102||t>=65&&t<=70}const gOt=(t,e,r)=>(n,i)=>{for(let a=!1,s=0,o=0;;o++){let{next:l}=n;if(T$(l)||l==OK||l==fOt||a&&fwe(l))!a&&(l!=OK||o>0)&&(a=!0),s===o&&l==OK&&s++,n.advance();else if(l==Upn&&n.peek(1)!=Vpn){if(n.advance(),pOt(n.next)){do n.advance();while(pOt(n.next));n.next==32&&n.advance()}else n.next>-1&&n.advance();a=!0}else{a&&n.acceptToken(s==2&&i.canShift(hOt)?e:l==Ppn?r:t);break}}},Gpn=new uo(gOt(_pn,hOt,Rpn),{contextual:!0}),Hpn=new uo(gOt(Dpn,Lpn,Mpn),{contextual:!0}),Wpn=new uo(t=>{if(dOt.includes(t.peek(-1))){let{next:e}=t;(T$(e)||e==fOt||e==$pn||e==Bpn||e==Qpn||e==Npn||e==Ipn&&T$(t.peek(1))||e==OK||e==zpn)&&t.acceptToken(Epn)}}),Ypn=new uo(t=>{if(!dOt.includes(t.peek(-1))){let{next:e}=t;if(e==Fpn&&(t.advance(),t.acceptToken(uOt)),T$(e)){do t.advance();while(T$(t.next)||fwe(t.next));t.acceptToken(uOt)}}}),qpn=qy({"AtKeyword import charset namespace keyframes media supports font-feature-values":Ee.definitionKeyword,"from to selector scope MatchFlag":Ee.keyword,NamespaceName:Ee.namespace,KeyframeName:Ee.labelName,KeyframeRangeName:Ee.operatorKeyword,TagName:Ee.tagName,ClassName:Ee.className,PseudoClassName:Ee.constant(Ee.className),IdName:Ee.labelName,"FeatureName PropertyName":Ee.propertyName,AttributeName:Ee.attributeName,NumberLiteral:Ee.number,KeywordQuery:Ee.keyword,UnaryQueryOp:Ee.operatorKeyword,"CallTag ValueName FontName":Ee.atom,VariableName:Ee.variableName,Callee:Ee.operatorKeyword,Unit:Ee.unit,"UniversalSelector NestingSelector":Ee.definitionOperator,"MatchOp CompareOp":Ee.compareOperator,"ChildOp SiblingOp, LogicOp":Ee.logicOperator,BinOp:Ee.arithmeticOperator,Important:Ee.modifier,Comment:Ee.blockComment,ColorLiteral:Ee.color,"ParenthesizedContent StringLiteral":Ee.string,":":Ee.punctuation,"PseudoOp #":Ee.derefOperator,"; , |":Ee.separator,"( )":Ee.paren,"[ ]":Ee.squareBracket,"{ }":Ee.brace}),jpn={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:152,"url-prefix":152,domain:152,regexp:152},Xpn={__proto__:null,or:104,and:104,not:112,only:112,layer:206},Kpn={__proto__:null,selector:118,style:124,layer:202},Zpn={__proto__:null,"@import":198,"@media":210,"@charset":214,"@namespace":218,"@keyframes":224,"@supports":236,"@scope":240,"@font-feature-values":246},Jpn={__proto__:null,to:243},egn=Jy.deserialize({version:14,states:"MlQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FnO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#EOO'dQdO'#EQO'oQdO'#EXO'oQdO'#E[OOQP'#Fn'#FnO)RQhO'#E}OOQS'#Fm'#FmOOQS'#FQ'#FQQYQdOOO)YQdO'#EbO*iQhO'#EhO)YQdO'#EjO*pQdO'#ElO*{QdO'#EoO)}QhO'#EuO+TQdO'#EwO+`QdO'#EzO+eQaO'#CfO+lQ`O'#E_O+qQ`O'#F{O+|QdO'#F{QOQ`OOP,WO&jO'#CaPOOO)CA])CA]OOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,cQdO,59YO'_QdO,5:jO'dQdO,5:lO'oQdO,5:sO'oQdO,5:uO'oQdO,5:vO'oQdO'#FXO,nQ`O,58}O,vQdO'#E^OOQS,58},58}OOQP'#Cq'#CqOOQO'#D|'#D|OOQP,59Y,59YO,}Q`O,59YO-SQ`O,59YOOQP'#EP'#EPOOQP,5:j,5:jO-XQpO'#ERO-dQdO'#ESO-iQ`O'#ESO-nQpO,5:lO.XQaO,5:sO.oQaO,5:vOOQW'#D^'#D^O/nQhO'#DgO0RQhO,5;iO)}QhO'#DeO0`Q`O'#DnO0eQhO'#DxOOQW'#Ft'#FtOOQS,5;i,5;iO0jQ`O'#DhO0oQ`O'#DkOOQS-E9O-E9OOOQ['#Cv'#CvO0tQdO'#CwO1[QdO'#C}O1rQdO'#DQO2YQ!pO'#DSO4fQ!jO,5:|OOQO'#DX'#DXO-SQ`O'#DWO4vQ!nO'#FqO6|Q`O'#DYO7RQ`O'#DyOOQ['#Fq'#FqO7WQhO'#GOO7fQ`O,5;SO7kQ!bO,5;UOOQS'#En'#EnO7sQ`O,5;WO7xQdO,5;WOOQO'#Eq'#EqO8QQ`O,5;ZO8VQhO,5;aO'oQdO'#DjOOQS,5;c,5;cO0jQ`O,5;cO8_QdO,5;cOOQS'#F`'#F`O8gQdO'#E|O7fQ`O,5;fO8oQdO,5:yO9PQdO'#FZO9^Q`O,5lQhO'#DoOOQW,5:Y,5:YOOQW,5:d,5:dOOQW,5:S,5:SO>vQhO,5:VO?bQ!fO'#FrOOQS'#Fr'#FrOOQS'#FS'#FSO@rQdO,59cOOQ[,59c,59cOAYQdO,59iOOQ[,59i,59iOApQdO,59lOOQ[,59l,59lOOQ[,59n,59nO)YQdO,59pOBWQhO'#EdOOQW'#Ed'#EdOBuQ`O1G0hO4oQhO1G0hOOQ[,59r,59rO)}QhO'#D[OOQ[,59t,59tOBzQ#tO,5:eOCVQhO'#F]OCdQ`O,5vQhO'#DmOI_QhO'#DqOIgQhO'#DsOIlQhO'#FwOOQO'#Fw'#FwOItQ!bO'#DwOOQO'#Fy'#FyOOQO'#Fv'#FvOIyQ`O1G/qOOQS-E9Q-E9QOOQ[1G.}1G.}OOQ[1G/T1G/TOOQ[1G/W1G/WOOQ[1G/[1G/[OJOQdO,5;OOOQS7+&S7+&SOJTQ`O7+&SOJYQhO'#D]OJbQ`O,59vO)}QhO,59vOOQ[1G0P1G0POJjQ`O1G0POJoQhO,5;wOOQO-E9Z-E9ZOOQS7+&^7+&^OJ}QbO'#DSOOQO'#Et'#EtOK]Q`O'#EsOOQO'#Es'#EsOKhQ`O'#F^OKpQdO,5;^OOQS,5;^,5;^OOQ[1G/p1G/pOOQS7+&i7+&iO7fQ`O7+&iOK{Q!fO'#FYO)YQdO'#FYOMSQdO7+&POOQO7+&P7+&POOQO,5:{,5:{OOQO1G1a1G1aOMgQ!bO<vQhO'#DrOOQO,5:],5:]O! hQhO,5:_OGUQhO,5:cOOQW7+%]7+%]OOQO'#Ef'#EfO! pQ`O1G0jOOQS<xAN>xO!#zQ`OAN>xO!$PQaO,5;rOOQO-E9U-E9UO!$ZQdO,5;qOOQO-E9T-E9TOOQW<vQhO'#DuOOQO1G/y1G/yO!%vQ!bO1G/}OJOQdO'#F[O!&OQ`O7+&UOOQW7+&U7+&UO!&WQ!bO1G/cOOQ[7+$|7+$|O!&cQhO7+$|P!&jQ`O'#FTOOQO,5;y,5;yOOQO-E9]-E9]OOQS1G1d1G1dOOQPG24dG24dO!&oQ`OAN>ZO)YQdO1G1[O!&tQ`O7+'jOOQO1G/x1G/xO!&|Q`O,5:aO!$eQhO7+%iOOQO,5;v,5;vOOQO-E9Y-E9YOOQW<Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!o`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$[~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$[~!o`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%jj)jS$qYOy%jz;'S%j;'S;=`%{<%lO%j~)yWOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d<%lO)v~*hOw~~*kRO;'S)v;'S;=`*t;=`O)v~*wXOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d;=`<%l)v<%lO)v~+gP;=`<%l)vj+oYmYOy%jz!Q%j!Q![,_![!c%j!c!i,_!i#T%j#T#Z,_#Z;'S%j;'S;=`%{<%lO%jj,dY!o`Oy%jz!Q%j!Q![-S![!c%j!c!i-S!i#T%j#T#Z-S#Z;'S%j;'S;=`%{<%lO%jj-XY!o`Oy%jz!Q%j!Q![-w![!c%j!c!i-w!i#T%j#T#Z-w#Z;'S%j;'S;=`%{<%lO%jj.OYuY!o`Oy%jz!Q%j!Q![.n![!c%j!c!i.n!i#T%j#T#Z.n#Z;'S%j;'S;=`%{<%lO%jj.uYuY!o`Oy%jz!Q%j!Q![/e![!c%j!c!i/e!i#T%j#T#Z/e#Z;'S%j;'S;=`%{<%lO%jj/jY!o`Oy%jz!Q%j!Q![0Y![!c%j!c!i0Y!i#T%j#T#Z0Y#Z;'S%j;'S;=`%{<%lO%jj0aYuY!o`Oy%jz!Q%j!Q![1P![!c%j!c!i1P!i#T%j#T#Z1P#Z;'S%j;'S;=`%{<%lO%jj1UY!o`Oy%jz!Q%j!Q![1t![!c%j!c!i1t!i#T%j#T#Z1t#Z;'S%j;'S;=`%{<%lO%jj1{SuY!o`Oy%jz;'S%j;'S;=`%{<%lO%jd2[UOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jd2uS!yS!o`Oy%jz;'S%j;'S;=`%{<%lO%jb3WS^QOy%jz;'S%j;'S;=`%{<%lO%j~3gWOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{<%lO3d~4SRO;'S3d;'S;=`4];=`O3d~4`XOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{;=`<%l3d<%lO3d~5OP;=`<%l3dj5WShYOy%jz;'S%j;'S;=`%{<%lO%j~5iOg~n5pUWQyWOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jj6ZWyW#PQOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj6xU!o`Oy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%jj7cY!o`$gYOy%jz!Q%j!Q![7[![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj8WY!o`Oy%jz{%j{|8v|}%j}!O8v!O!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj8{U!o`Oy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj9fU!o`$gYOy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj:P[!o`$gYOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj:zS!dYOy%jz;'S%j;'S;=`%{<%lO%jj;]WyWOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj;zU`YOy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%j~VUcYOy%jz![%j![!]>i!];'S%j;'S;=`%{<%lO%jj>pSdY!o`Oy%jz;'S%j;'S;=`%{<%lO%jj?RSnYOy%jz;'S%j;'S;=`%{<%lO%jh?dU!WWOy%jz!_%j!_!`?v!`;'S%j;'S;=`%{<%lO%jh?}S!WW!o`Oy%jz;'S%j;'S;=`%{<%lO%jl@bS!WW!ySOy%jz;'S%j;'S;=`%{<%lO%jj@uV!|Q!WWOy%jz!_%j!_!`?v!`!aA[!a;'S%j;'S;=`%{<%lO%jbAcS!|Q!o`Oy%jz;'S%j;'S;=`%{<%lO%jjArYOy%jz}%j}!OBb!O!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjBgW!o`Oy%jz!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjCW[lY!o`Oy%jz}%j}!OCP!O!Q%j!Q![CP![!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jhDRS!zWOy%jz;'S%j;'S;=`%{<%lO%jjDdSpYOy%jz;'S%j;'S;=`%{<%lO%jnDuSo^Oy%jz;'S%j;'S;=`%{<%lO%jjEWU!zWOy%jz#a%j#a#bEj#b;'S%j;'S;=`%{<%lO%jbEoU!o`Oy%jz#d%j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!o`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!o`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!o`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!o`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!o`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!o`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$pQ!o`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$cUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU#PQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[Wpn,Ypn,Gpn,Hpn,1,2,3,4,new pK("m~RRYZ[z{a~~g~aO$_~~dP!P!Qg~lO$`~~",28,152)],topRules:{StyleSheet:[0,6],Styles:[1,126]},dynamicPrecedences:{94:1},specialized:[{term:147,get:t=>jpn[t]||-1},{term:148,get:t=>Xpn[t]||-1},{term:4,get:t=>Kpn[t]||-1},{term:28,get:t=>Zpn[t]||-1},{term:146,get:t=>Jpn[t]||-1}],tokenPrec:2405});let pwe=null;function gwe(){if(!pwe&&typeof document=="object"&&document.body){let{style:t}=document.body,e=[],r=new Set;for(let n in t)n!="cssText"&&n!="cssFloat"&&typeof t[n]=="string"&&(/[A-Z]/.test(n)&&(n=n.replace(/[A-Z]/g,i=>"-"+i.toLowerCase())),r.has(n)||(e.push(n),r.add(n)));pwe=e.sort().map(n=>({type:"property",label:n,apply:n+": "}))}return pwe||[]}const mOt=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(t=>({type:"class",label:t})),vOt=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),tgn=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),rgn=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(t=>({type:"keyword",label:t})),t1=/^(\w[\w-]*|-\w[\w-]*|)$/,ngn=/^-(-[\w-]*)?$/;function ign(t,e){var r;if((t.name=="("||t.type.isError)&&(t=t.parent||t),t.name!="ArgList")return!1;let n=(r=t.parent)===null||r===void 0?void 0:r.firstChild;return(n==null?void 0:n.name)!="Callee"?!1:e.sliceString(n.from,n.to)=="var"}const yOt=new Zbe,agn=["Declaration"];function sgn(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function bOt(t,e,r){if(e.to-e.from>4096){let n=yOt.get(e);if(n)return n;let i=[],a=new Set,s=e.cursor(Wi.IncludeAnonymous);if(s.firstChild())do for(let o of bOt(t,s.node,r))a.has(o.label)||(a.add(o.label),i.push(o));while(s.nextSibling());return yOt.set(e,i),i}else{let n=[],i=new Set;return e.cursor().iterate(a=>{var s;if(r(a)&&a.matchContext(agn)&&((s=a.node.nextSibling)===null||s===void 0?void 0:s.name)==":"){let o=t.sliceString(a.from,a.to);i.has(o)||(i.add(o),n.push({label:o,type:"variable"}))}}),n}}const ogn=(t=>e=>{let{state:r,pos:n}=e,i=pa(r).resolveInner(n,-1),a=i.type.isError&&i.from==i.to-1&&r.doc.sliceString(i.from,i.to)=="-";if(i.name=="PropertyName"||(a||i.name=="TagName")&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:gwe(),validFor:t1};if(i.name=="ValueName")return{from:i.from,options:vOt,validFor:t1};if(i.name=="PseudoClassName")return{from:i.from,options:mOt,validFor:t1};if(t(i)||(e.explicit||a)&&ign(i,r.doc))return{from:t(i)||a?i.from:n,options:bOt(r.doc,sgn(i),t),validFor:ngn};if(i.name=="TagName"){for(let{parent:l}=i;l;l=l.parent)if(l.name=="Block")return{from:i.from,options:gwe(),validFor:t1};return{from:i.from,options:tgn,validFor:t1}}if(i.name=="AtKeyword")return{from:i.from,options:rgn,validFor:t1};if(!e.explicit)return null;let s=i.resolve(n),o=s.childBefore(n);return o&&o.name==":"&&s.name=="PseudoClassSelector"?{from:n,options:mOt,validFor:t1}:o&&o.name==":"&&s.name=="Declaration"||s.name=="ArgList"?{from:n,options:vOt,validFor:t1}:s.name=="Block"||s.name=="Styles"?{from:n,options:gwe(),validFor:t1}:null})(t=>t.name=="VariableName"),kK=jy.define({name:"css",parser:egn.configure({props:[Ky.add({Declaration:S4()}),Zy.add({"Block KeyframeList":l$})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function lgn(){return new u2(kK,kK.data.of({autocomplete:ogn}))}const S$=["_blank","_self","_top","_parent"],mwe=["ascii","utf-8","utf-16","latin1","latin1"],vwe=["get","post","put","delete"],ywe=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Gd=["true","false"],Fr={},cgn={a:{attrs:{href:null,ping:null,type:null,media:null,target:S$,hreflang:null}},abbr:Fr,address:Fr,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Fr,aside:Fr,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Fr,base:{attrs:{href:null,target:S$}},bdi:Fr,bdo:Fr,blockquote:{attrs:{cite:null}},body:Fr,br:Fr,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:ywe,formmethod:vwe,formnovalidate:["novalidate"],formtarget:S$,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Fr,center:Fr,cite:Fr,code:Fr,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Fr,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Fr,div:Fr,dl:Fr,dt:Fr,em:Fr,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Fr,figure:Fr,footer:Fr,form:{attrs:{action:null,name:null,"accept-charset":mwe,autocomplete:["on","off"],enctype:ywe,method:vwe,novalidate:["novalidate"],target:S$}},h1:Fr,h2:Fr,h3:Fr,h4:Fr,h5:Fr,h6:Fr,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Fr,hgroup:Fr,hr:Fr,html:{attrs:{manifest:null}},i:Fr,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:ywe,formmethod:vwe,formnovalidate:["novalidate"],formtarget:S$,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Fr,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Fr,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Fr,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:mwe,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Fr,noscript:Fr,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Fr,param:{attrs:{name:null,value:null}},pre:Fr,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Fr,rt:Fr,ruby:Fr,samp:Fr,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:mwe}},section:Fr,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Fr,source:{attrs:{src:null,type:null,media:null}},span:Fr,strong:Fr,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Fr,summary:Fr,sup:Fr,table:Fr,tbody:Fr,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Fr,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Fr,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Fr,time:{attrs:{datetime:null}},title:Fr,tr:Fr,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Fr,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Fr},xOt={accesskey:null,class:null,contenteditable:Gd,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Gd,autocorrect:Gd,autocapitalize:Gd,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Gd,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Gd,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Gd,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Gd,"aria-hidden":Gd,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Gd,"aria-multiselectable":Gd,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Gd,"aria-relevant":null,"aria-required":Gd,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},wOt="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(t=>"on"+t);for(let t of wOt)xOt[t]=null;class C${constructor(e,r){this.tags={...cgn,...e},this.globalAttrs={...xOt,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}C$.default=new C$;function R4(t,e,r=t.length){if(!e)return"";let n=e.firstChild,i=n&&n.getChild("TagName");return i?t.sliceString(i.from,Math.min(i.to,r)):""}function D4(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}function AOt(t,e,r){let n=r.tags[R4(t,D4(e))];return(n==null?void 0:n.children)||r.allTags}function bwe(t,e){let r=[];for(let n=D4(e);n&&!n.type.isTop;n=D4(n.parent)){let i=R4(t,n);if(i&&n.lastChild.name=="CloseTag")break;i&&r.indexOf(i)<0&&(e.name=="EndTag"||e.from>=n.firstChild.to)&&r.push(i)}return r}const TOt=/^[:\-\.\w\u00b7-\uffff]*$/;function SOt(t,e,r,n,i){let a=/\s*>/.test(t.sliceDoc(i,i+5))?"":">",s=D4(r,r.name=="StartTag"||r.name=="TagName");return{from:n,to:i,options:AOt(t.doc,s,e).map(o=>({label:o,type:"type"})).concat(bwe(t.doc,r).map((o,l)=>({label:"/"+o,apply:"/"+o+a,type:"type",boost:99-l}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function COt(t,e,r,n){let i=/\s*>/.test(t.sliceDoc(n,n+5))?"":">";return{from:r,to:n,options:bwe(t.doc,e).map((a,s)=>({label:a,apply:a+i,type:"type",boost:99-s})),validFor:TOt}}function ugn(t,e,r,n){let i=[],a=0;for(let s of AOt(t.doc,r,e))i.push({label:"<"+s,type:"type"});for(let s of bwe(t.doc,r))i.push({label:"",type:"type",boost:99-a++});return{from:n,to:n,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function hgn(t,e,r,n,i){let a=D4(r),s=a?e.tags[R4(t.doc,a)]:null,o=s&&s.attrs?Object.keys(s.attrs):[],l=s&&s.globalAttrs===!1?o:o.length?o.concat(e.globalAttrNames):e.globalAttrNames;return{from:n,to:i,options:l.map(u=>({label:u,type:"property"})),validFor:TOt}}function dgn(t,e,r,n,i){var a;let s=(a=r.parent)===null||a===void 0?void 0:a.getChild("AttributeName"),o=[],l;if(s){let u=t.sliceDoc(s.from,s.to),h=e.globalAttrs[u];if(!h){let d=D4(r),f=d?e.tags[R4(t.doc,d)]:null;h=(f==null?void 0:f.attrs)&&f.attrs[u]}if(h){let d=t.sliceDoc(n,i).toLowerCase(),f='"',p='"';/^['"]/.test(d)?(l=d[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",p=t.sliceDoc(i,i+1)==d[0]?"":d[0],d=d.slice(1),n++):l=/^[^\s<>='"]*$/;for(let g of h)o.push({label:g,apply:f+g+p,type:"constant"})}}return{from:n,to:i,options:o,validFor:l}}function OOt(t,e){let{state:r,pos:n}=e,i=pa(r).resolveInner(n,-1),a=i.resolve(n);for(let s=n,o;a==i&&(o=i.childBefore(s));){let l=o.lastChild;if(!l||!l.type.isError||l.fromOOt(n,i)}const ggn=b0.parser.configure({top:"SingleExpression"}),kOt=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:sCt.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:oCt.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:lCt.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:ggn},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:b0.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:kK.parser}],EOt=[{name:"style",parser:kK.parser.configure({top:"Styles"})}].concat(wOt.map(t=>({name:t,parser:b0.parser}))),_Ot=jy.define({name:"html",parser:kpn.configure({props:[Ky.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit},Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].lengtht.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),EK=_Ot.configure({wrap:cOt(kOt,EOt)});function mgn(t={}){let e="",r;t.matchClosingTags===!1&&(e="noMatch"),t.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(r=cOt((t.nestedLanguages||[]).concat(kOt),(t.nestedAttributes||[]).concat(EOt)));let n=r?_Ot.configure({wrap:r,dialect:e}):e?EK.configure({dialect:e}):EK;return new u2(n,[EK.data.of({autocomplete:pgn(t)}),t.autoCloseTags!==!1?vgn:[],j2e().support,lgn().support])}const ROt=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),vgn=er.inputHandler.of((t,e,r,n,i)=>{if(t.composing||t.state.readOnly||e!=r||n!=">"&&n!="/"||!EK.isActiveAt(t.state,e,-1))return!1;let a=i(),{state:s}=a,o=s.changeByRange(l=>{var u,h,d;let f=s.doc.sliceString(l.from-1,l.to)==n,{head:p}=l,g=pa(s).resolveInner(p,-1),m;if(f&&n==">"&&g.name=="EndTag"){let v=g.parent;if(((h=(u=v.parent)===null||u===void 0?void 0:u.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(m=R4(s.doc,v.parent,p))&&!ROt.has(m)){let y=p+(s.doc.sliceString(p,p+1)===">"?1:0),b=``;return{range:l,changes:{from:p,to:y,insert:b}}}}else if(f&&n=="/"&&g.name=="IncompleteCloseTag"){let v=g.parent;if(g.from==p-2&&((d=v.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(m=R4(s.doc,v,p))&&!ROt.has(m)){let y=p+(s.doc.sliceString(p,p+1)===">"?1:0),b=`${m}>`;return{range:bt.cursor(p+b.length,-1),changes:{from:p,to:y,insert:b}}}}return{range:l}});return o.changes.empty?!1:(t.dispatch([a,s.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),DOt=aK({commentTokens:{block:{open:""}}}),LOt=new En,MOt=Rfn.configure({props:[Zy.add(t=>!t.is("Block")||t.is("Document")||xwe(t)!=null||ygn(t)?void 0:(e,r)=>({from:r.doc.lineAt(e.from).to,to:e.to})),LOt.add(xwe),Ky.add({Document:()=>null}),c2.add({Document:DOt})]});function xwe(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function ygn(t){return t.name=="OrderedList"||t.name=="BulletList"}function bgn(t,e){let r=t;for(;;){let n=r.nextSibling,i;if(!n||(i=xwe(n.type))!=null&&i<=e)break;r=n}return r.to}const xgn=ZTt.of((t,e,r)=>{for(let n=pa(t).resolveInner(r,-1);n&&!(n.fromr)return{from:r,to:a}}return null});function wwe(t){return new Ud(DOt,t,[],"markdown")}const wgn=wwe(MOt),_K=wwe(MOt.configure([zfn,Vfn,Ufn,Qfn,{props:[Zy.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]));function Agn(t,e){return r=>{if(r&&t){let n=null;if(r=/\S*/.exec(r)[0],typeof t=="function"?n=t(r):n=sK.matchLanguageName(t,r,!0),n instanceof sK)return n.support?n.support.language.parser:GS.getSkippingParser(n.load());if(n)return n.parser}return e?e.parser:null}}let Awe=class{constructor(e,r,n,i,a,s,o){this.node=e,this.from=r,this.to=n,this.spaceBefore=i,this.spaceAfter=a,this.type=s,this.item=o}blank(e,r=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;n.length0;i--)n+=" ";return n+(r?this.spaceAfter:"")}}marker(e,r){let n=this.node.name=="OrderedList"?String(+POt(this.item,e)[2]+r):"";return this.spaceBefore+n+this.type+this.spaceAfter}};function IOt(t,e){let r=[],n=[];for(let i=t;i;i=i.parent){if(i.name=="FencedCode")return n;(i.name=="ListItem"||i.name=="Blockquote")&&r.push(i)}for(let i=r.length-1;i>=0;i--){let a=r[i],s,o=e.lineAt(a.from),l=a.from-o.from;if(a.name=="Blockquote"&&(s=/^ *>( ?)/.exec(o.text.slice(l))))n.push(new Awe(a,l,l+s[0].length,"",s[1],">",null));else if(a.name=="ListItem"&&a.parent.name=="OrderedList"&&(s=/^( *)\d+([.)])( *)/.exec(o.text.slice(l)))){let u=s[3],h=s[0].length;u.length>=4&&(u=u.slice(0,u.length-4),h-=4),n.push(new Awe(a.parent,l,l+h,s[1],u,s[2],a))}else if(a.name=="ListItem"&&a.parent.name=="BulletList"&&(s=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(l)))){let u=s[4],h=s[0].length;u.length>4&&(u=u.slice(0,u.length-4),h-=4);let d=s[2];s[3]&&(d+=s[3].replace(/[xX]/," ")),n.push(new Awe(a.parent,l,l+h,s[1],u,d,a))}}return n}function POt(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function Twe(t,e,r,n=0){for(let i=-1,a=t;;){if(a.name=="ListItem"){let o=POt(a,e),l=+o[2];if(i>=0){if(l!=i+1)return;r.push({from:a.from+o[1].length,to:a.from+o[0].length,insert:String(i+2+n)})}i=l}let s=a.nextSibling;if(!s)break;a=s}}function Swe(t,e){let r=/^[ \t]*/.exec(t)[0].length;if(!r||e.facet(A4)!=" ")return t;let n=hg(t,4,r),i="";for(let a=n;a>0;)a>=4?(i+=" ",a-=4):(i+=" ",a--);return i+t.slice(r)}const Tgn=((t={})=>({state:e,dispatch:r})=>{let n=pa(e),{doc:i}=e,a=null,s=e.changeByRange(o=>{if(!o.empty||!_K.isActiveAt(e,o.from,-1)&&!_K.isActiveAt(e,o.from,1))return a={range:o};let l=o.from,u=i.lineAt(l),h=IOt(n.resolveInner(l,-1),i);for(;h.length&&h[h.length-1].from>l-u.from;)h.pop();if(!h.length)return a={range:o};let d=h[h.length-1];if(d.to-d.spaceAfter.length>l-u.from)return a={range:o};let f=l>=d.to-d.spaceAfter.length&&!/\S/.test(u.text.slice(d.to));if(d.item&&f){let y=d.node.firstChild,b=d.node.getChild("ListItem","ListItem");if(y.to>=l||b&&b.to0&&!/[^\s>]/.test(i.lineAt(u.from-1).text)||t.nonTightLists===!1){let x=h.length>1?h[h.length-2]:null,w,A="";x&&x.item?(w=u.from+x.from,A=x.marker(i,1)):w=u.from+(x?x.to:0);let T=[{from:w,to:l,insert:A}];return d.node.name=="OrderedList"&&Twe(d.item,i,T,-2),x&&x.node.name=="OrderedList"&&Twe(x.item,i,T),{range:bt.cursor(w+A.length),changes:T}}else{let x=BOt(h,e,u);return{range:bt.cursor(l+x.length+1),changes:{from:u.from,insert:x+e.lineBreak}}}}if(d.node.name=="Blockquote"&&f&&u.from){let y=i.lineAt(u.from-1),b=/>\s*$/.exec(y.text);if(b&&b.index==d.from){let x=e.changes([{from:y.from+b.index,to:y.to},{from:u.from+d.from,to:u.to}]);return{range:o.map(x),changes:x}}}let p=[];d.node.name=="OrderedList"&&Twe(d.item,i,p);let g=d.item&&d.item.from]*/.exec(u.text)[0].length>=d.to)for(let y=0,b=h.length-1;y<=b;y++)m+=y==b&&!g?h[y].marker(i,1):h[y].blank(yu.from&&/\s/.test(u.text.charAt(v-u.from-1));)v--;return m=Swe(m,e),Sgn(d.node,e.doc)&&(m=BOt(h,e,u)+e.lineBreak+m),p.push({from:v,to:l,insert:e.lineBreak+m}),{range:bt.cursor(v+m.length+1),changes:p}});return a?!1:(r(e.update(s,{scrollIntoView:!0,userEvent:"input"})),!0)})();function NOt(t){return t.name=="QuoteMark"||t.name=="ListMark"}function Sgn(t,e){if(t.name!="OrderedList"&&t.name!="BulletList")return!1;let r=t.firstChild,n=t.getChild("ListItem","ListItem");if(!n)return!1;let i=e.lineAt(r.to),a=e.lineAt(n.from),s=/^[\s>]*$/.test(i.text);return i.number+(s?0:1){let r=pa(t),n=null,i=t.changeByRange(a=>{let s=a.from,{doc:o}=t;if(a.empty&&_K.isActiveAt(t,a.from)){let l=o.lineAt(s),u=IOt(Cgn(r,s),o);if(u.length){let h=u[u.length-1],d=h.to-h.spaceAfter.length+(h.spaceAfter?1:0);if(s-l.from>d&&!/\S/.test(l.text.slice(d,s-l.from)))return{range:bt.cursor(l.from+d),changes:{from:l.from+d,to:s}};if(s-l.from==d&&(h.item&&l.from<=h.item.from||/^[\s>]*$/.test(l.text.slice(0,h.to)))){let f=l.from+h.from;if(h.item&&h.node.from{var r;let{main:n}=e.state.selection;if(n.empty)return!1;let i=(r=t.clipboardData)===null||r===void 0?void 0:r.getData("text/plain");if(!i||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(i)||(/^www\./.test(i)&&(i="https://"+i),!_K.isActiveAt(e.state,n.from,1)))return!1;let a=pa(e.state),s=!1;return a.iterate({from:n.from,to:n.to,enter:o=>{(o.from>n.from||Rgn.test(o.name))&&(s=!0)},leave:o=>{o.to=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}const Dmn=new uo((t,e)=>{let r;if(t.next<0)t.acceptToken(Pgn);else if(e.context.flags&DK)_we(t.next)&&t.acceptToken(Ign,1);else if(((r=t.peek(-1))<0||_we(r))&&e.canShift(UOt)){let n=0;for(;t.next==Owe||t.next==RK;)t.advance(),n++;(t.next==XS||t.next==O$||t.next==kwe)&&t.acceptToken(UOt,-n)}else _we(t.next)&&t.acceptToken(Mgn,1)},{contextual:!0}),Lmn=new uo((t,e)=>{let r=e.context;if(r.flags)return;let n=t.peek(-1);if(n==XS||n==O$){let i=0,a=0;for(;;){if(t.next==Owe)i++;else if(t.next==RK)i+=8-i%8;else break;t.advance(),a++}i!=r.indent&&t.next!=XS&&t.next!=O$&&t.next!=kwe&&(i[t,e|jOt])),Pmn=new gK({start:Mmn,reduce(t,e,r,n){return t.flags&DK&&Rmn.has(e)||(e==Zgn||e==GOt)&&t.flags&jOt?t.parent:t},shift(t,e,r,n){return e==FOt?new LK(t,Imn(n.read(n.pos,r.pos)),0):e==zOt?t.parent:e==$gn||e==Vgn||e==Hgn||e==VOt?new LK(t,0,DK):XOt.has(e)?new LK(t,0,XOt.get(e)|t.flags&DK):t},hash(t){return t.hash}}),Nmn=new uo(t=>{for(let e=0;e<5;e++){if(t.next!="print".charCodeAt(e))return;t.advance()}if(!/\w/.test(String.fromCharCode(t.next)))for(let e=0;;e++){let r=t.peek(e);if(!(r==Owe||r==RK)){r!=Tmn&&r!=Smn&&r!=XS&&r!=O$&&r!=kwe&&t.acceptToken(Lgn);return}}}),Bmn=new uo((t,e)=>{let{flags:r}=e.context,n=r&r1?YOt:WOt,i=(r&n1)>0,a=!(r&i1),s=(r&a1)>0,o=t.pos;for(;!(t.next<0);)if(s&&t.next==Ewe)if(t.peek(1)==Ewe)t.advance(2);else{if(t.pos==o){t.acceptToken(VOt,1);return}break}else if(a&&t.next==qOt){if(t.pos==o){t.advance();let l=t.next;l>=0&&(t.advance(),$mn(t,l)),t.acceptToken(Bgn);return}break}else if(t.next==qOt&&!a&&t.peek(1)>-1)t.advance(2);else if(t.next==n&&(!i||t.peek(1)==n&&t.peek(2)==n)){if(t.pos==o){t.acceptToken(QOt,i?3:1);return}break}else if(t.next==XS){if(i)t.advance();else if(t.pos==o){t.acceptToken(QOt);return}break}else t.advance();t.pos>o&&t.acceptToken(Ngn)});function $mn(t,e){if(e==Cmn)for(let r=0;r<2&&t.next>=48&&t.next<=55;r++)t.advance();else if(e==Omn)for(let r=0;r<2&&Rwe(t.next);r++)t.advance();else if(e==Emn)for(let r=0;r<4&&Rwe(t.next);r++)t.advance();else if(e==_mn)for(let r=0;r<8&&Rwe(t.next);r++)t.advance();else if(e==kmn&&t.next==Ewe){for(t.advance();t.next>=0&&t.next!=HOt&&t.next!=WOt&&t.next!=YOt&&t.next!=XS;)t.advance();t.next==HOt&&t.advance()}}const Fmn=qy({'async "*" "**" FormatConversion FormatSpec':Ee.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":Ee.controlKeyword,"in not and or is del":Ee.operatorKeyword,"from def class global nonlocal lambda":Ee.definitionKeyword,import:Ee.moduleKeyword,"with as print":Ee.keyword,Boolean:Ee.bool,None:Ee.null,VariableName:Ee.variableName,"CallExpression/VariableName":Ee.function(Ee.variableName),"FunctionDefinition/VariableName":Ee.function(Ee.definition(Ee.variableName)),"ClassDefinition/VariableName":Ee.definition(Ee.className),PropertyName:Ee.propertyName,"CallExpression/MemberExpression/PropertyName":Ee.function(Ee.propertyName),Comment:Ee.lineComment,Number:Ee.number,String:Ee.string,FormatString:Ee.special(Ee.string),Escape:Ee.escape,UpdateOp:Ee.updateOperator,"ArithOp!":Ee.arithmeticOperator,BitOp:Ee.bitwiseOperator,CompareOp:Ee.compareOperator,AssignOp:Ee.definitionOperator,Ellipsis:Ee.punctuation,At:Ee.meta,"( )":Ee.paren,"[ ]":Ee.squareBracket,"{ }":Ee.brace,".":Ee.derefOperator,", ;":Ee.separator}),zmn={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},Umn=Jy.deserialize({version:14,states:"##jQ`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5TQdO'#DoOOQS,5:Y,5:YO5hQdO'#HdOOQS,5:],5:]O5uQ!fO,5:]O5zQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8jQdO,59bO8oQdO,59bO8vQdO,59jO8}QdO'#HTO:TQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:lQdO,59aO'vQdO,59aO:zQdO,59aOOQS,59y,59yO;PQdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;_QdO,5:QO;dQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;uQdO,5:UO;zQdO,5:WOOOW'#Fy'#FyOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/[QtO1G.|O!/cQtO1G.|O1lQdO1G.|O!0OQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!0VQdO1G/eO!0gQdO1G/eO!0oQdO1G/fO'vQdO'#H[O!0tQdO'#H[O!0yQtO1G.{O!1ZQdO,59iO!2aQdO,5=zO!2qQdO,5=zO!2yQdO1G/mO!3OQtO1G/mOOQS1G/l1G/lO!3`QdO,5=uO!4VQdO,5=uO0rQdO1G/qO!4tQdO1G/sO!4yQtO1G/sO!5ZQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5kQdO'#HxO0rQdO'#HxO!5|QdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6[Q#xO1G2zO!6{QtO1G2zO'vQdO,5kOOQS1G1`1G1`O!8RQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!8WQdO'#FrO!8cQdO,59oO!8kQdO1G/XO!8uQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9fQdO'#GtOOQS,5jO!;ZQdO,5>jO1XQdO,5>jO!;lQdO,5>iOOQS-E:R-E:RO!;qQdO1G0lO!;|QdO1G0lO!lO!lO!hO!=VQdO,5>hO!=hQdO'#EpO0rQdO1G0tO!=sQdO1G0tO!=xQgO1G0zO!AvQgO1G0}O!EqQdO,5>oO!E{QdO,5>oO!FTQtO,5>oO0rQdO1G1PO!F_QdO1G1PO4iQdO1G1UO!!vQdO1G1WOOQV,5;a,5;aO!FdQfO,5;aO!FiQgO1G1QO!JjQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JzQdO,5>pO!KXQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KaQdO'#FSO!KrQ!fO1G1WO!KzQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!LPQdO1G1]O!LXQdO'#F^OOQV1G1b1G1bO!#ZQtO1G1bPOOO1G2v1G2vP!L^OSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LfQdO,5=|O!LyQdO,5=|OOQS1G/u1G/uO!MRQdO,5>PO!McQdO,5>PO!MkQdO,5>PO!NOQdO,5>PO!N`QdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8kQdO7+$pO#!RQdO1G.|O#!YQdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!aQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!qQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!vQdO7+%PO##OQdO7+%QO##TQdO1G3fOOQS7+%X7+%XO##eQdO1G3fO##mQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##rQdO1G3aOOQS-E9q-E9qO#$iQdO7+%]OOQS7+%_7+%_O#$wQdO1G3aO#%fQdO7+%_O#%kQdO1G3gO#%{QdO1G3gO#&TQdO7+%]O#&YQdO,5>dO#&sQdO,5>dO#&sQdO,5>dOOQS'#Dx'#DxO#'UO&jO'#DzO#'aO`O'#HyOOOW1G3}1G3}O#'fQdO1G3}O#'nQdO1G3}O#'yQ#xO7+(fO#(jQtO1G2UP#)TQdO'#GOOOQS,5nQdO,5sQdO1G4OOOQS-E9y-E9yO#?^QdO1G4OO<[QdO'#H{OOOO'#D{'#D{OOOO'#F|'#F|O#?oO&jO,5:fOOOW,5>e,5>eOOOW7+)i7+)iO#?zQdO7+)iO#@SQdO1G2zO#@mQdO1G2zP'vQdO'#FuO0rQdO<mO#BQQdO,5>mOOQS1G0v1G0vOOQS<rO#KgQdO,5>rO#KrQdO,5>rO#K}QdO,5>qO#L`QdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ oQdO<cAN>cO0rQdO1G1|O$!PQtO1G1|P$!ZQdO'#FvOOQS1G2R1G2RP$!hQdO'#F{O$!uQdO7+)jO$#`QdO,5>gOOOO-E9z-E9zOOOW<tO$4{QdO,5>tO1XQdO,5vO$)nQdO,5>vOOQS1G1p1G1pOOQS,5<[,5<[OOQU7+'P7+'PO$+zQdO1G/iO$)nQdO,5wO$8zQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)nQdO'#GdO$9SQdO1G4bO$9^QdO1G4bO$9fQdO1G4bOOQS7+%T7+%TO$9tQdO1G1tO$:SQtO'#FaO$:ZQdO,5<}OOQS,5<},5<}O$:iQdO1G4cOOQS-E:a-E:aO$)nQdO,5<|O$:pQdO,5<|O$:uQdO7+)|OOQS-E:`-E:`O$;PQdO7+)|O$)nQdO,5S~O%cOS%^OSSOS%]PQ~OPdOVaOfoOhYOopOs!POvqO!PrO!Q{O!T!SO!U!RO!XZO!][O!h`O!r`O!s`O!t`O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#l!QO#o!TO#s!UO#u!VO#z!WO#}hO$P!XO%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~O%]!YO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%j![O%k!]O%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aO~Ok%xXl%xXm%xXn%xXo%xXp%xXs%xXz%xX{%xX!x%xX#g%xX%[%xX%_%xX%z%xXg%xX!T%xX!U%xX%{%xX!W%xX![%xX!Q%xX#[%xXt%xX!m%xX~P%SOfoOhYO!XZO!][O!h`O!r`O!s`O!t`O%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~Oz%wX{%wX#g%wX%[%wX%_%wX%z%wX~Ok!pOl!qOm!oOn!oOo!rOp!sOs!tO!x%wX~P)pOV!zOg!|Oo0cOv0qO!PrO~P'vOV#OOo0cOv0qO!W#PO~P'vOV#SOa#TOo0cOv0qO![#UO~P'vOQ#XO%`#XO%a#ZO~OQ#^OR#[O%`#^O%a#`O~OV%iX_%iXa%iXh%iXk%iXl%iXm%iXn%iXo%iXp%iXs%iXz%iX!X%iX!f%iX%j%iX%k%iX%l%iX%m%iX%n%iX%o%iX%p%iX%q%iX%r%iX%s%iXg%iX!T%iX!U%iX~O&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O{%iX!x%iX#g%iX%[%iX%_%iX%z%iX%{%iX!W%iX![%iX!Q%iX#[%iXt%iX!m%iX~P,eOz#dO{%hX!x%hX#g%hX%[%hX%_%hX%z%hX~Oo0cOv0qO~P'vO#g#gO%[#iO%_#iO~O%uWO~O!T#nO#u!VO#z!WO#}hO~OopO~P'vOV#sOa#tO%uWO{wP~OV#xOo0cOv0qO!Q#yO~P'vO{#{O!x$QO%z#|O#g!yX%[!yX%_!yX~OV#xOo0cOv0qO#g#SX%[#SX%_#SX~P'vOo0cOv0qO#g#WX%[#WX%_#WX~P'vOh$WO%uWO~O!f$YO!r$YO%uWO~OV$eO~P'vO!U$gO#s$hO#u$iO~O{$jO~OV$qO~P'vOS$sO%[$rO%_$rO%c$tO~OV$}Oa$}Og%POo0cOv0qO~P'vOo0cOv0qO{%SO~P'vO&Y%UO~Oa!bOh!iO!X!kO!f!mOVba_bakbalbambanbaobapbasbazba{ba!xba#gba%[ba%_ba%jba%kba%lba%mba%nba%oba%pba%qba%rba%sba%zbagba!Tba!Uba%{ba!Wba![ba!Qba#[batba!mba~On%ZO~Oo%ZO~P'vOo0cO~P'vOk0eOl0fOm0dOn0dOo0mOp0nOs0rOg%wX!T%wX!U%wX%{%wX!W%wX![%wX!Q%wX#[%wX!m%wX~P)pO%{%]Og%vXz%vX!T%vX!U%vX!W%vX{%vX~Og%_Oz%`O!T%dO!U%cO~Og%_O~Oz%gO!T%dO!U%cO!W&SX~O!W%kO~Oz%lO{%nO!T%dO!U%cO![%}X~O![%rO~O![%sO~OQ#XO%`#XO%a%uO~OV%wOo0cOv0qO!PrO~P'vOQ#^OR#[O%`#^O%a%zO~OV!qa_!qaa!qah!qak!qal!qam!qan!qao!qap!qas!qaz!qa{!qa!X!qa!f!qa!x!qa#g!qa%[!qa%_!qa%j!qa%k!qa%l!qa%m!qa%n!qa%o!qa%p!qa%q!qa%r!qa%s!qa%z!qag!qa!T!qa!U!qa%{!qa!W!qa![!qa!Q!qa#[!qat!qa!m!qa~P#yOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P%SOV&OOopOvqO{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P'vOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#g$zX%[$zX%_$zX~P'vO#g#gO%[&TO%_&TO~O!f&UOh&sX%[&sXz&sX#[&sX#g&sX%_&sX#Z&sXg&sX~Oh!iO%[&WO~Okealeameaneaoeapeaseazea{ea!xea#gea%[ea%_ea%zeagea!Tea!Uea%{ea!Wea![ea!Qea#[eatea!mea~P%SOsqazqa{qa#gqa%[qa%_qa%zqa~Ok!pOl!qOm!oOn!oOo!rOp!sO!xqa~PEcO%z&YOz%yX{%yX~O%uWOz%yX{%yX~Oz&]O{wX~O{&_O~Oz%lO#g%}X%[%}X%_%}Xg%}X{%}X![%}X!m%}X%z%}X~OV0lOo0cOv0qO!PrO~P'vO%z#|O#gUa%[Ua%_Ua~Oz&hO#g&PX%[&PX%_&PXn&PX~P%SOz&kO!Q&jO#g#Wa%[#Wa%_#Wa~Oz&lO#[&nO#g&rX%[&rX%_&rXg&rX~O!f$YO!r$YO#Z&qO%uWO~O#Z&qO~Oz&sO#g&tX%[&tX%_&tX~Oz&uO#g&pX%[&pX%_&pX{&pX~O!X&wO%z&xO~Oz&|On&wX~P%SOn'PO~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO%['UO~P'vOt'YO#p'WO#q'XOP#naV#naf#nah#nao#nas#nav#na!P#na!Q#na!T#na!U#na!X#na!]#na!h#na!r#na!s#na!t#na!{#na!}#na#P#na#R#na#T#na#X#na#Z#na#^#na#_#na#a#na#c#na#l#na#o#na#s#na#u#na#z#na#}#na$P#na%X#na%o#na%p#na%t#na%u#na&Z#na&[#na&]#na&^#na&_#na&`#na&a#na&b#na&c#na&d#na&e#na&f#na&g#na&h#na&i#na&j#na%Z#na%_#na~Oz'ZO#[']O{&xX~Oh'_O!X&wO~Oh!iO{$jO!X&wO~O{'eO~P%SO%['hO%_'hO~OS'iO%['hO%_'hO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%k!]O~P!#uO%kWi~P!#uOV!aO_!aOa!bOh!iO!X!kO!f!mO%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%m!_O%n!_O~P!&pO%mWi%nWi~P!&pOa!bOh!iO!X!kO!f!mOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%mWi%nWi%oWi%pWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~OV!aO_!aO%q!aO%r!aO%s!aO~P!)nOVWi_Wi%qWi%rWi%sWi~P!)nO!T%dO!U%cOg&VXz&VX~O%z'kO%{'kO~P,eOz'mOg&UX~Og'oO~Oz'pO{'rO!W&XX~Oo0cOv0qOz'pO{'sO!W&XX~P'vO!W'uO~Om!oOn!oOo!rOp!sOkjisjizji{ji!xji#gji%[ji%_ji%zji~Ol!qO~P!.aOlji~P!.aOk0eOl0fOm0dOn0dOo0mOp0nO~Ot'wO~P!/jOV'|Og'}Oo0cOv0qO~P'vOg'}Oz(OO~Og(QO~O!U(SO~Og(TOz(OO!T%dO!U%cO~P%SOk0eOl0fOm0dOn0dOo0mOp0nOgqa!Tqa!Uqa%{qa!Wqa![qa!Qqa#[qatqa!mqa~PEcOV'|Oo0cOv0qO!W&Sa~P'vOz(WO!W&Sa~O!W(XO~Oz(WO!T%dO!U%cO!W&Sa~P%SOV(]Oo0cOv0qO![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~P'vOz(^O![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~O![(aO~Oz(^O!T%dO!U%cO![%}a~P%SOz(dO!T%dO!U%cO![&Ta~P%SOz(gO{&lX![&lX!m&lX%z&lX~O{(kO![(mO!m(nO%z(jO~OV&OOopOvqO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~P'vOz(pO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~O!f&UOh&sa%[&saz&sa#[&sa#g&sa%_&sa#Z&sag&sa~O%[(uO~OV#sOa#tO%uWO~Oz&]O{wa~OopOvqO~P'vOz(^O#g%}a%[%}a%_%}ag%}a{%}a![%}a!m%}a%z%}a~P%SOz(zO#g%hX%[%hX%_%hX%z%hX~O%z#|O#gUi%[Ui%_Ui~O#g&Pa%[&Pa%_&Pan&Pa~P'vOz(}O#g&Pa%[&Pa%_&Pan&Pa~O%uWO#g&ra%[&ra%_&rag&ra~Oz)SO#g&ra%[&ra%_&rag&ra~Og)VO~OV)WOh$WO%uWO~O#Z)XO~O%uWO#g&ta%[&ta%_&ta~Oz)ZO#g&ta%[&ta%_&ta~Oo0cOv0qO#g&pa%[&pa%_&pa{&pa~P'vOz)^O#g&pa%[&pa%_&pa{&pa~OV)`Oa)`O%uWO~O%z)eO~Ot)hO#j)gOP#hiV#hif#hih#hio#his#hiv#hi!P#hi!Q#hi!T#hi!U#hi!X#hi!]#hi!h#hi!r#hi!s#hi!t#hi!{#hi!}#hi#P#hi#R#hi#T#hi#X#hi#Z#hi#^#hi#_#hi#a#hi#c#hi#l#hi#o#hi#s#hi#u#hi#z#hi#}#hi$P#hi%X#hi%o#hi%p#hi%t#hi%u#hi&Z#hi&[#hi&]#hi&^#hi&_#hi&`#hi&a#hi&b#hi&c#hi&d#hi&e#hi&f#hi&g#hi&h#hi&i#hi&j#hi%Z#hi%_#hi~Ot)iOP#kiV#kif#kih#kio#kis#kiv#ki!P#ki!Q#ki!T#ki!U#ki!X#ki!]#ki!h#ki!r#ki!s#ki!t#ki!{#ki!}#ki#P#ki#R#ki#T#ki#X#ki#Z#ki#^#ki#_#ki#a#ki#c#ki#l#ki#o#ki#s#ki#u#ki#z#ki#}#ki$P#ki%X#ki%o#ki%p#ki%t#ki%u#ki&Z#ki&[#ki&]#ki&^#ki&_#ki&`#ki&a#ki&b#ki&c#ki&d#ki&e#ki&f#ki&g#ki&h#ki&i#ki&j#ki%Z#ki%_#ki~OV)kOn&wa~P'vOz)lOn&wa~Oz)lOn&wa~P%SOn)pO~O%Y)tO~Ot)wO#p'WO#q)vOP#niV#nif#nih#nio#nis#niv#ni!P#ni!Q#ni!T#ni!U#ni!X#ni!]#ni!h#ni!r#ni!s#ni!t#ni!{#ni!}#ni#P#ni#R#ni#T#ni#X#ni#Z#ni#^#ni#_#ni#a#ni#c#ni#l#ni#o#ni#s#ni#u#ni#z#ni#}#ni$P#ni%X#ni%o#ni%p#ni%t#ni%u#ni&Z#ni&[#ni&]#ni&^#ni&_#ni&`#ni&a#ni&b#ni&c#ni&d#ni&e#ni&f#ni&g#ni&h#ni&i#ni&j#ni%Z#ni%_#ni~OV)zOo0cOv0qO{$jO~P'vOo0cOv0qO{&xa~P'vOz*OO{&xa~OV*SOa*TOg*WO%q*UO%uWO~O{$jO&{*YO~Oh'_O~Oh!iO{$jO~O%[*_O~O%[*aO%_*aO~OV$}Oa$}Oo0cOv0qOg&Ua~P'vOz*dOg&Ua~Oo0cOv0qO{*gO!W&Xa~P'vOz*hO!W&Xa~Oo0cOv0qOz*hO{*kO!W&Xa~P'vOo0cOv0qOz*hO!W&Xa~P'vOz*hO{*kO!W&Xa~Om0dOn0dOo0mOp0nOgjikjisjizji!Tji!Uji%{ji!Wji{ji![ji#gji%[ji%_ji!Qji#[jitji!mji%zji~Ol0fO~P!NkOlji~P!NkOV'|Og*pOo0cOv0qO~P'vOn*rO~Og*pOz*tO~Og*uO~OV'|Oo0cOv0qO!W&Si~P'vOz*vO!W&Si~O!W*wO~OV(]Oo0cOv0qO![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~P'vOz*zO!T%dO!U%cO![&Ti~Oz*}O![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~O![+OO~Oa+QOo0cOv0qO![&Ti~P'vOz*zO![&Ti~O![+SO~OV+UOo0cOv0qO{&la![&la!m&la%z&la~P'vOz+VO{&la![&la!m&la%z&la~O!]+YO&n+[O![!nX~O![+^O~O{(kO![+_O~O{(kO![+_O!m+`O~OV&OOopOvqO{%hq!x%hq#g%hq%[%hq%_%hq%z%hq~P'vOz$ri{$ri!x$ri#g$ri%[$ri%_$ri%z$ri~P%SOV&OOopOvqO~P'vOV&OOo0cOv0qO#g%ha%[%ha%_%ha%z%ha~P'vOz+aO#g%ha%[%ha%_%ha%z%ha~Oz$ia#g$ia%[$ia%_$ian$ia~P%SO#g&Pi%[&Pi%_&Pin&Pi~P'vOz+dO#g#Wq%[#Wq%_#Wq~O#[+eOz$va#g$va%[$va%_$vag$va~O%uWO#g&ri%[&ri%_&rig&ri~Oz+gO#g&ri%[&ri%_&rig&ri~OV+iOh$WO%uWO~O%uWO#g&ti%[&ti%_&ti~Oo0cOv0qO#g&pi%[&pi%_&pi{&pi~P'vO{#{Oz#eX!W#eX~Oz+mO!W&uX~O!W+oO~Ot+rO#j)gOP#hqV#hqf#hqh#hqo#hqs#hqv#hq!P#hq!Q#hq!T#hq!U#hq!X#hq!]#hq!h#hq!r#hq!s#hq!t#hq!{#hq!}#hq#P#hq#R#hq#T#hq#X#hq#Z#hq#^#hq#_#hq#a#hq#c#hq#l#hq#o#hq#s#hq#u#hq#z#hq#}#hq$P#hq%X#hq%o#hq%p#hq%t#hq%u#hq&Z#hq&[#hq&]#hq&^#hq&_#hq&`#hq&a#hq&b#hq&c#hq&d#hq&e#hq&f#hq&g#hq&h#hq&i#hq&j#hq%Z#hq%_#hq~On$|az$|a~P%SOV)kOn&wi~P'vOz+yOn&wi~Oz,TO{$jO#[,TO~O#q,VOP#nqV#nqf#nqh#nqo#nqs#nqv#nq!P#nq!Q#nq!T#nq!U#nq!X#nq!]#nq!h#nq!r#nq!s#nq!t#nq!{#nq!}#nq#P#nq#R#nq#T#nq#X#nq#Z#nq#^#nq#_#nq#a#nq#c#nq#l#nq#o#nq#s#nq#u#nq#z#nq#}#nq$P#nq%X#nq%o#nq%p#nq%t#nq%u#nq&Z#nq&[#nq&]#nq&^#nq&_#nq&`#nq&a#nq&b#nq&c#nq&d#nq&e#nq&f#nq&g#nq&h#nq&i#nq&j#nq%Z#nq%_#nq~O#[,WOz%Oa{%Oa~Oo0cOv0qO{&xi~P'vOz,YO{&xi~O{#{O%z,[Og&zXz&zX~O%uWOg&zXz&zX~Oz,`Og&yX~Og,bO~O%Y,eO~O!T%dO!U%cOg&Viz&Vi~OV$}Oa$}Oo0cOv0qOg&Ui~P'vO{,hOz$la!W$la~Oo0cOv0qO{,iOz$la!W$la~P'vOo0cOv0qO{*gO!W&Xi~P'vOz,lO!W&Xi~Oo0cOv0qOz,lO!W&Xi~P'vOz,lO{,oO!W&Xi~Og$hiz$hi!W$hi~P%SOV'|Oo0cOv0qO~P'vOn,qO~OV'|Og,rOo0cOv0qO~P'vOV'|Oo0cOv0qO!W&Sq~P'vOz$gi![$gi#g$gi%[$gi%_$gig$gi{$gi!m$gi%z$gi~P%SOV(]Oo0cOv0qO~P'vOa+QOo0cOv0qO![&Tq~P'vOz,sO![&Tq~O![,tO~OV(]Oo0cOv0qO![%}q#g%}q%[%}q%_%}qg%}q{%}q!m%}q%z%}q~P'vO{,uO~OV+UOo0cOv0qO{&li![&li!m&li%z&li~P'vOz,zO{&li![&li!m&li%z&li~O!]+YO&n+[O![!na~O{(kO![,}O~OV&OOo0cOv0qO#g%hi%[%hi%_%hi%z%hi~P'vOz-OO#g%hi%[%hi%_%hi%z%hi~O%uWO#g&rq%[&rq%_&rqg&rq~Oz-RO#g&rq%[&rq%_&rqg&rq~OV)`Oa)`O%uWO!W&ua~Oz-TO!W&ua~On$|iz$|i~P%SOV)kO~P'vOV)kOn&wq~P'vOt-XOP#myV#myf#myh#myo#mys#myv#my!P#my!Q#my!T#my!U#my!X#my!]#my!h#my!r#my!s#my!t#my!{#my!}#my#P#my#R#my#T#my#X#my#Z#my#^#my#_#my#a#my#c#my#l#my#o#my#s#my#u#my#z#my#}#my$P#my%X#my%o#my%p#my%t#my%u#my&Z#my&[#my&]#my&^#my&_#my&`#my&a#my&b#my&c#my&d#my&e#my&f#my&g#my&h#my&i#my&j#my%Z#my%_#my~O%Z-]O%_-]O~P`O#q-^OP#nyV#nyf#nyh#nyo#nys#nyv#ny!P#ny!Q#ny!T#ny!U#ny!X#ny!]#ny!h#ny!r#ny!s#ny!t#ny!{#ny!}#ny#P#ny#R#ny#T#ny#X#ny#Z#ny#^#ny#_#ny#a#ny#c#ny#l#ny#o#ny#s#ny#u#ny#z#ny#}#ny$P#ny%X#ny%o#ny%p#ny%t#ny%u#ny&Z#ny&[#ny&]#ny&^#ny&_#ny&`#ny&a#ny&b#ny&c#ny&d#ny&e#ny&f#ny&g#ny&h#ny&i#ny&j#ny%Z#ny%_#ny~Oz-aO{$jO#[-aO~Oo0cOv0qO{&xq~P'vOz-dO{&xq~O%z,[Og&zaz&za~O{#{Og&zaz&za~OV*SOa*TO%q*UO%uWOg&ya~Oz-hOg&ya~O$S-lO~OV$}Oa$}Oo0cOv0qO~P'vOo0cOv0qO{-mOz$li!W$li~P'vOo0cOv0qOz$li!W$li~P'vO{-mOz$li!W$li~Oo0cOv0qO{*gO~P'vOo0cOv0qO{*gO!W&Xq~P'vOz-pO!W&Xq~Oo0cOv0qOz-pO!W&Xq~P'vOs-sO!T%dO!U%cOg&Oq!W&Oq![&Oqz&Oq~P!/jOa+QOo0cOv0qO![&Ty~P'vOz$ji![$ji~P%SOa+QOo0cOv0qO~P'vOV+UOo0cOv0qO~P'vOV+UOo0cOv0qO{&lq![&lq!m&lq%z&lq~P'vO{(kO![-xO!m-yO%z-wO~OV&OOo0cOv0qO#g%hq%[%hq%_%hq%z%hq~P'vO%uWO#g&ry%[&ry%_&ryg&ry~OV)`Oa)`O%uWO!W&ui~Ot-}OP#m!RV#m!Rf#m!Rh#m!Ro#m!Rs#m!Rv#m!R!P#m!R!Q#m!R!T#m!R!U#m!R!X#m!R!]#m!R!h#m!R!r#m!R!s#m!R!t#m!R!{#m!R!}#m!R#P#m!R#R#m!R#T#m!R#X#m!R#Z#m!R#^#m!R#_#m!R#a#m!R#c#m!R#l#m!R#o#m!R#s#m!R#u#m!R#z#m!R#}#m!R$P#m!R%X#m!R%o#m!R%p#m!R%t#m!R%u#m!R&Z#m!R&[#m!R&]#m!R&^#m!R&_#m!R&`#m!R&a#m!R&b#m!R&c#m!R&d#m!R&e#m!R&f#m!R&g#m!R&h#m!R&i#m!R&j#m!R%Z#m!R%_#m!R~Oo0cOv0qO{&xy~P'vOV*SOa*TO%q*UO%uWOg&yi~O$S-lO%Z.VO%_.VO~OV.aOh._O!X.^O!].`O!h.YO!s.[O!t.[O%p.XO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O~Oo0cOv0qOz$lq!W$lq~P'vO{.fOz$lq!W$lq~Oo0cOv0qO{*gO!W&Xy~P'vOz.gO!W&Xy~Oo0cOv.kO~P'vOs-sO!T%dO!U%cOg&Oy!W&Oy![&Oyz&Oy~P!/jO{(kO![.nO~O{(kO![.nO!m.oO~OV*SOa*TO%q*UO%uWO~Oh.tO!f.rOz$TX#[$TX%j$TXg$TX~Os$TX{$TX!W$TX![$TX~P$-bO%o.vO%p.vOs$UXz$UX{$UX#[$UX%j$UX!W$UXg$UX![$UX~O!h.xO~Oz.|O#[/OO%j.yOs&|X{&|X!W&|Xg&|X~Oa/RO~P$)zOh.tOs&}Xz&}X{&}X#[&}X%j&}X!W&}Xg&}X![&}X~Os/VO{$jO~Oo0cOv0qOz$ly!W$ly~P'vOo0cOv0qO{*gO!W&X!R~P'vOz/ZO!W&X!R~Og&RXs&RX!T&RX!U&RX!W&RX![&RXz&RX~P!/jOs-sO!T%dO!U%cOg&Qa!W&Qa![&Qaz&Qa~O{(kO![/^O~O!f.rOh$[as$[az$[a{$[a#[$[a%j$[a!W$[ag$[a![$[a~O!h/eO~O%o.vO%p.vOs$Uaz$Ua{$Ua#[$Ua%j$Ua!W$Uag$Ua![$Ua~O%j.yOs$Yaz$Ya{$Ya#[$Ya!W$Yag$Ya![$Ya~Os&|a{&|a!W&|ag&|a~P$)nOz/jOs&|a{&|a!W&|ag&|a~O!W/mO~Og/mO~O{/oO~O![/pO~Oo0cOv0qO{*gO!W&X!Z~P'vO{/sO~O%z/tO~P$-bOz/uO#[/OO%j.yOg'PX~Oz/uOg'PX~Og/wO~O!h/xO~O#[/OOs%Saz%Sa{%Sa%j%Sa!W%Sag%Sa![%Sa~O#[/OO%j.yOs%Waz%Wa{%Wa!W%Wag%Wa~Os&|i{&|i!W&|ig&|i~P$)nOz/zO#[/OO%j.yO!['Oa~Og'Pa~P$)nOz0SOg'Pa~Oa0UO!['Oi~P$)zOz0WO!['Oi~Oz0WO#[/OO%j.yO!['Oi~O#[/OO%j.yOg$biz$bi~O%z0ZO~P$-bO#[/OO%j.yOg%Vaz%Va~Og'Pi~P$)nO{0^O~Oa0UO!['Oq~P$)zOz0`O!['Oq~O#[/OO%j.yOz%Ui![%Ui~Oa0UO~P$)zOa0UO!['Oy~P$)zO#[/OO%j.yOg$ciz$ci~O#[/OO%j.yOz%Uq![%Uq~Oz+aO#g%ha%[%ha%_%ha%z%ha~P%SOV&OOo0cOv0qO~P'vOn0hO~Oo0hO~P'vO{0iO~Ot0jO~P!/jO&]&Z&j&h&i&g&f&d&e&c&b&`&a&_&^&[%u~",goto:"!=j'QPPPPPP'RP'Z*s+[+t,_,y-fP.SP'Z.r.r'ZPPP'Z2[PPPPPP2[5PPP5PP7b7k=sPP=v>h>kPP'Z'ZPP>zPP'Z'ZPP'Z'Z'Z'Z'Z?O?w'ZP?zP@QDXGuGyPG|HWH['ZPPPH_Hk'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHqH}IVPI^IdPI^PI^I^PPPI^PKrPK{LVL]KrPI^LfPI^PLmLsPLwM]MzNeLwLwNkNxLwLwLwLw! ^! d! g! l! o! y!!P!!]!!o!!u!#P!#V!#s!#y!$P!$Z!$a!$g!$y!%T!%Z!%a!%k!%q!%w!%}!&T!&Z!&e!&k!&u!&{!'U!'[!'k!'s!'}!(UPPPPPPPPPPP!([!(_!(e!(n!(x!)TPPPPPPPPPPPP!-u!/Z!3^!6oPP!6w!7W!7a!8Y!8P!8c!8i!8l!8o!8r!8z!9jPPPPPPPPPPPPPPPPP!9m!9q!9wP!:]!:a!:m!:v!;S!;j!;m!;p!;v!;|!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[Nmn,Lmn,Dmn,Bmn,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:t=>zmn[t]||-1}],tokenPrec:7668}),KOt=new Zbe,ZOt=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function MK(t){return(e,r,n)=>{if(n)return!1;let i=e.node.getChild("VariableName");return i&&r(i,t),!0}}const Vmn={FunctionDefinition:MK("function"),ClassDefinition:MK("class"),ForStatement(t,e,r){if(r){for(let n=t.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")e(n,"variable");else if(n.name=="in")break}},ImportStatement(t,e){var r,n;let{node:i}=t,a=((r=i.firstChild)===null||r===void 0?void 0:r.name)=="from";for(let s=i.getChild("import");s;s=s.nextSibling)s.name=="VariableName"&&((n=s.nextSibling)===null||n===void 0?void 0:n.name)!="as"&&e(s,a?"variable":"namespace")},AssignStatement(t,e){for(let r=t.node.firstChild;r;r=r.nextSibling)if(r.name=="VariableName")e(r,"variable");else if(r.name==":"||r.name=="AssignOp")break},ParamList(t,e){for(let r=null,n=t.node.firstChild;n;n=n.nextSibling)n.name=="VariableName"&&(!r||!/\*|AssignOp/.test(r.name))&&e(n,"variable"),r=n},CapturePattern:MK("variable"),AsPattern:MK("variable"),__proto__:null};function JOt(t,e){let r=KOt.get(e);if(r)return r;let n=[],i=!0;function a(s,o){let l=t.sliceString(s.from,s.to);n.push({label:l,type:o})}return e.cursor(Wi.IncludeAnonymous).iterate(s=>{if(s.name){let o=Vmn[s.name];if(o&&o(s,a,i)||!i&&ZOt.has(s.name))return!1;i=!1}else if(s.to-s.from>8192){for(let o of JOt(t,s.node))n.push(o);return!1}}),KOt.set(e,n),n}const ekt=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,tkt=["String","FormatString","Comment","PropertyName"];function Qmn(t){let e=pa(t.state).resolveInner(t.pos,-1);if(tkt.indexOf(e.name)>-1)return null;let r=e.name=="VariableName"||e.to-e.from<20&&ekt.test(t.state.sliceDoc(e.from,e.to));if(!r&&!t.explicit)return null;let n=[];for(let i=e;i;i=i.parent)ZOt.has(i.name)&&(n=n.concat(JOt(t.state.doc,i)));return{options:n,from:r?e.from:t.pos,validFor:ekt}}const Gmn=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(t=>({label:t,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(t=>({label:t,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(t=>({label:t,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(t=>({label:t,type:"function"}))),Hmn=[As("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),As("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),As("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),As("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),As(`if \${}: - -`,{label:"if",detail:"block",type:"keyword"}),As("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),As("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),As("import ${module}",{label:"import",detail:"statement",type:"keyword"}),As("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],Wmn=PSt(tkt,B2e(Gmn.concat(Hmn)));function Dwe(t){let{node:e,pos:r}=t,n=t.lineIndent(r,-1),i=null;for(;;){let a=e.childBefore(r);if(a)if(a.name=="Comment")r=a.from;else if(a.name=="Body"||a.name=="MatchBody")t.baseIndentFor(a)+t.unit<=n&&(i=a),e=a;else if(a.name=="MatchClause")e=a;else if(a.type.is("Statement"))e=a;else break;else break}return i}function Lwe(t,e){let r=t.baseIndentFor(e),n=t.lineAt(t.pos,-1),i=n.from+n.text.length;return/^\s*($|#)/.test(n.text)&&t.node.tor?null:r+t.unit}const Mwe=jy.define({name:"python",parser:Umn.configure({props:[Ky.add({Body:t=>{var e;let r=/^\s*(#|$)/.test(t.textAfter)&&Dwe(t)||t.node;return(e=Lwe(t,r))!==null&&e!==void 0?e:t.continue()},MatchBody:t=>{var e;let r=Dwe(t);return(e=Lwe(t,r||t.node))!==null&&e!==void 0?e:t.continue()},IfStatement:t=>/^\s*(else:|elif )/.test(t.textAfter)?t.baseIndent:t.continue(),"ForStatement WhileStatement":t=>/^\s*else:/.test(t.textAfter)?t.baseIndent:t.continue(),TryStatement:t=>/^\s*(except[ :]|finally:|else:)/.test(t.textAfter)?t.baseIndent:t.continue(),MatchStatement:t=>/^\s*case /.test(t.textAfter)?t.baseIndent+t.unit:t.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":T4({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":T4({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":T4({closing:"]"}),MemberExpression:t=>t.baseIndent+t.unit,"String FormatString":()=>null,Script:t=>{var e;let r=Dwe(t);return(e=r&&Lwe(t,r))!==null&&e!==void 0?e:t.continue()}}),Zy.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":l$,Body:(t,e)=>({from:t.from+1,to:t.to-(t.to==e.doc.length?0:1)}),"String FormatString":(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function Ymn(){return new u2(Mwe,[Mwe.data.of({autocomplete:Qmn}),Mwe.data.of({autocomplete:Wmn})])}const L4=63,rkt=64,qmn=1,jmn=2,nkt=3,Xmn=4,ikt=5,Kmn=6,Zmn=7,akt=65,Jmn=66,e0n=8,t0n=9,r0n=10,n0n=11,i0n=12,skt=13,a0n=19,s0n=20,o0n=29,l0n=33,c0n=34,u0n=47,h0n=0,Iwe=1,Pwe=2,k$=3,Nwe=4;class KS{constructor(e,r,n){this.parent=e,this.depth=r,this.type=n,this.hash=(e?e.hash+e.hash<<8:0)+r+(r<<4)+n}}KS.top=new KS(null,-1,h0n);function E$(t,e){for(let r=0,n=e-t.pos-1;;n--,r++){let i=t.peek(n);if(s1(i)||i==-1)return r}}function Bwe(t){return t==32||t==9}function s1(t){return t==10||t==13}function okt(t){return Bwe(t)||s1(t)}function ZS(t){return t<0||okt(t)}const d0n=new gK({start:KS.top,reduce(t,e){return t.type==k$&&(e==s0n||e==c0n)?t.parent:t},shift(t,e,r,n){if(e==nkt)return new KS(t,E$(n,n.pos),Iwe);if(e==akt||e==ikt)return new KS(t,E$(n,n.pos),Pwe);if(e==L4)return t.parent;if(e==a0n||e==l0n)return new KS(t,0,k$);if(e==skt&&t.type==Nwe)return t.parent;if(e==u0n){let i=/[1-9]/.exec(n.read(n.pos,r.pos));if(i)return new KS(t,t.depth+ +i[0],Nwe)}return t},hash(t){return t.hash}});function M4(t,e,r=0){return t.peek(r)==e&&t.peek(r+1)==e&&t.peek(r+2)==e&&ZS(t.peek(r+3))}const f0n=new uo((t,e)=>{if(t.next==-1&&e.canShift(rkt))return t.acceptToken(rkt);let r=t.peek(-1);if((s1(r)||r<0)&&e.context.type!=k$){if(M4(t,45))if(e.canShift(L4))t.acceptToken(L4);else return t.acceptToken(qmn,3);if(M4(t,46))if(e.canShift(L4))t.acceptToken(L4);else return t.acceptToken(jmn,3);let n=0;for(;t.next==32;)n++,t.advance();(n{if(e.context.type==k$){t.next==63&&(t.advance(),ZS(t.next)&&t.acceptToken(Zmn));return}if(t.next==45)t.advance(),ZS(t.next)&&t.acceptToken(e.context.type==Iwe&&e.context.depth==E$(t,t.pos-1)?Xmn:nkt);else if(t.next==63)t.advance(),ZS(t.next)&&t.acceptToken(e.context.type==Pwe&&e.context.depth==E$(t,t.pos-1)?Kmn:ikt);else{let r=t.pos;for(;;)if(Bwe(t.next)){if(t.pos==r)return;t.advance()}else if(t.next==33)ukt(t);else if(t.next==38)$we(t);else if(t.next==42){$we(t);break}else if(t.next==39||t.next==34){if(Fwe(t,!0))break;return}else if(t.next==91||t.next==123){if(!m0n(t))return;break}else{hkt(t,!0,!1,0);break}for(;Bwe(t.next);)t.advance();if(t.next==58){if(t.pos==r&&e.canShift(o0n))return;let n=t.peek(1);ZS(n)&&t.acceptTokenTo(e.context.type==Pwe&&e.context.depth==E$(t,r)?Jmn:akt,r)}}},{contextual:!0});function g0n(t){return t>32&&t<127&&t!=34&&t!=37&&t!=44&&t!=60&&t!=62&&t!=92&&t!=94&&t!=96&&t!=123&&t!=124&&t!=125}function lkt(t){return t>=48&&t<=57||t>=97&&t<=102||t>=65&&t<=70}function ckt(t,e){return t.next==37?(t.advance(),lkt(t.next)&&t.advance(),lkt(t.next)&&t.advance(),!0):g0n(t.next)||e&&t.next==44?(t.advance(),!0):!1}function ukt(t){if(t.advance(),t.next==60){for(t.advance();;)if(!ckt(t,!0)){t.next==62&&t.advance();break}}else for(;ckt(t,!1););}function $we(t){for(t.advance();!ZS(t.next)&&IK(t.next)!="f";)t.advance()}function Fwe(t,e){let r=t.next,n=!1,i=t.pos;for(t.advance();;){let a=t.next;if(a<0)break;if(t.advance(),a==r)if(a==39)if(t.next==39)t.advance();else break;else break;else if(a==92&&r==34)t.next>=0&&t.advance();else if(s1(a)){if(e)return!1;n=!0}else if(e&&t.pos>=i+1024)return!1}return!n}function m0n(t){for(let e=[],r=t.pos+1024;;)if(t.next==91||t.next==123)e.push(t.next),t.advance();else if(t.next==39||t.next==34){if(!Fwe(t,!0))return!1}else if(t.next==93||t.next==125){if(e[e.length-1]!=t.next-2)return!1;if(e.pop(),t.advance(),!e.length)return!0}else{if(t.next<0||t.pos>r||s1(t.next))return!1;t.advance()}}const v0n="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function IK(t){return t<33?"u":t>125?"s":v0n[t-33]}function zwe(t,e){let r=IK(t);return r!="u"&&!(e&&r=="f")}function hkt(t,e,r,n){if(IK(t.next)=="s"||(t.next==63||t.next==58||t.next==45)&&zwe(t.peek(1),r))t.advance();else return!1;let i=t.pos;for(;;){let a=t.next,s=0,o=n+1;for(;okt(a);){if(s1(a)){if(e)return!1;o=0}else o++;a=t.peek(++s)}if(!(a>=0&&(a==58?zwe(t.peek(s+1),r):a==35?t.peek(s-1)!=32:zwe(a,r)))||!r&&o<=n||o==0&&!r&&(M4(t,45,s)||M4(t,46,s)))break;if(e&&IK(a)=="f")return!1;for(let u=s;u>=0;u--)t.advance();if(e&&t.pos>i+1024)return!1}return!0}const y0n=new uo((t,e)=>{if(t.next==33)ukt(t),t.acceptToken(i0n);else if(t.next==38||t.next==42){let r=t.next==38?r0n:n0n;$we(t),t.acceptToken(r)}else t.next==39||t.next==34?(Fwe(t,!1),t.acceptToken(t0n)):hkt(t,!1,e.context.type==k$,e.context.depth)&&t.acceptToken(e0n)}),b0n=new uo((t,e)=>{let r=e.context.type==Nwe?e.context.depth:-1,n=t.pos;e:for(;;){let i=0,a=t.next;for(;a==32;)a=t.peek(++i);if(!i&&(M4(t,45,i)||M4(t,46,i))||!s1(a)&&(r<0&&(r=Math.max(e.context.depth+1,i)),iYAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:d0n,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[x0n],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[f0n,p0n,y0n,b0n,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),A0n=jy.define({name:"yaml",parser:w0n.configure({props:[Ky.add({Stream:t=>{for(let e=t.node.resolve(t.pos,-1);e&&e.to>=t.pos;e=e.parent){if(e.name=="BlockLiteralContent"&&e.fromt.pos)return null}}return null},FlowMapping:T4({closing:"}"}),FlowSequence:T4({closing:"]"})}),Zy.add({"FlowMapping FlowSequence":l$,"Item Pair BlockLiteral":(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function T0n(){return new u2(A0n)}function S0n(t){dkt(t,"start");var e={},r=t.languageData||{},n=!1;for(var i in t)if(i!=r&&t.hasOwnProperty(i))for(var a=e[i]=[],s=t[i],o=0;o2&&s.token&&typeof s.token!="string"){r.pending=[];for(var u=2;u-1)return null;var i=r.indent.length-1,a=t[r.state];e:for(;;){for(var s=0;s{let{state:e}=t,r=e.doc.lineAt(e.selection.main.from),n=Qwe(t.state,r.from);return n.line?z0n(t):n.block?V0n(t):!1};function Vwe(t,e){return({state:r,dispatch:n})=>{if(r.readOnly)return!1;let i=t(e,r);return i?(n(r.update(i)),!0):!1}}const z0n=Vwe(H0n,0),U0n=Vwe(vkt,0),V0n=Vwe((t,e)=>vkt(t,e,G0n(e)),0);function Qwe(t,e){let r=t.languageDataAt("commentTokens",e,1);return r.length?r[0]:{}}const _$=50;function Q0n(t,{open:e,close:r},n,i){let a=t.sliceDoc(n-_$,n),s=t.sliceDoc(i,i+_$),o=/\s*$/.exec(a)[0].length,l=/^\s*/.exec(s)[0].length,u=a.length-o;if(a.slice(u-e.length,u)==e&&s.slice(l,l+r.length)==r)return{open:{pos:n-o,margin:o&&1},close:{pos:i+l,margin:l&&1}};let h,d;i-n<=2*_$?h=d=t.sliceDoc(n,i):(h=t.sliceDoc(n,n+_$),d=t.sliceDoc(i-_$,i));let f=/^\s*/.exec(h)[0].length,p=/\s*$/.exec(d)[0].length,g=d.length-p-r.length;return h.slice(f,f+e.length)==e&&d.slice(g,g+r.length)==r?{open:{pos:n+f+e.length,margin:/\s/.test(h.charAt(f+e.length))?1:0},close:{pos:i-p-r.length,margin:/\s/.test(d.charAt(g-1))?1:0}}:null}function G0n(t){let e=[];for(let r of t.selection.ranges){let n=t.doc.lineAt(r.from),i=r.to<=n.to?n:t.doc.lineAt(r.to);i.from>n.from&&i.from==r.to&&(i=r.to==n.to+1?n:t.doc.lineAt(r.to-1));let a=e.length-1;a>=0&&e[a].to>n.from?e[a].to=i.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:i.to})}return e}function vkt(t,e,r=e.selection.ranges){let n=r.map(a=>Qwe(e,a.from).block);if(!n.every(a=>a))return null;let i=r.map((a,s)=>Q0n(e,n[s],a.from,a.to));if(t!=2&&!i.every(a=>a))return{changes:e.changes(r.map((a,s)=>i[s]?[]:[{from:a.from,insert:n[s].open+" "},{from:a.to,insert:" "+n[s].close}]))};if(t!=1&&i.some(a=>a)){let a=[];for(let s=0,o;si&&(a==s||s>d.from)){i=d.from;let f=/^\s*/.exec(d.text)[0].length,p=f==d.length,g=d.text.slice(f,f+u.length)==u?f:-1;fa.comment<0&&(!a.empty||a.single))){let a=[];for(let{line:o,token:l,indent:u,empty:h,single:d}of n)(d||!h)&&a.push({from:o.from+u,insert:l+" "});let s=e.changes(a);return{changes:s,selection:e.selection.map(s,1)}}else if(t!=1&&n.some(a=>a.comment>=0)){let a=[];for(let{line:s,comment:o,token:l}of n)if(o>=0){let u=s.from+o,h=u+l.length;s.text[h-s.from]==" "&&h++,a.push({from:u,to:h})}return{changes:a}}return null}const Gwe=c0.define(),W0n=c0.define(),Y0n=vr.define(),ykt=vr.define({combine(t){return u0(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,r)=>r},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,r)=>(n,i)=>e(n,i)||r(n,i)})}}),bkt=Vs.define({create(){return x0.empty},update(t,e){let r=e.state.facet(ykt),n=e.annotation(Gwe);if(n){let l=Fh.fromTransaction(e,n.selection),u=n.side,h=u==0?t.undone:t.done;return l?h=NK(h,h.length,r.minDepth,l):h=Akt(h,e.startState.selection),new x0(u==0?n.rest:h,u==0?h:n.rest)}let i=e.annotation(W0n);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(Do.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let a=Fh.fromTransaction(e),s=e.annotation(Do.time),o=e.annotation(Do.userEvent);return a?t=t.addChanges(a,s,o,r,e):e.selection&&(t=t.addSelection(e.startState.selection,s,o,r.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new x0(t.done.map(Fh.fromJSON),t.undone.map(Fh.fromJSON))}});function q0n(t={}){return[bkt,ykt.of(t),er.domEventHandlers({beforeinput(e,r){let n=e.inputType=="historyUndo"?xkt:e.inputType=="historyRedo"?Hwe:null;return n?(e.preventDefault(),n(r)):!1}})]}function PK(t,e){return function({state:r,dispatch:n}){if(!e&&r.readOnly)return!1;let i=r.field(bkt,!1);if(!i)return!1;let a=i.pop(t,r,e);return a?(n(a),!0):!1}}const xkt=PK(0,!1),Hwe=PK(1,!1),j0n=PK(0,!0),X0n=PK(1,!0);class Fh{constructor(e,r,n,i,a){this.changes=e,this.effects=r,this.mapped=n,this.startSelection=i,this.selectionsAfter=a}setSelAfter(e){return new Fh(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,r,n;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(r=this.mapped)===null||r===void 0?void 0:r.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new Fh(e.changes&&co.fromJSON(e.changes),[],e.mapped&&l0.fromJSON(e.mapped),e.startSelection&&bt.fromJSON(e.startSelection),e.selectionsAfter.map(bt.fromJSON))}static fromTransaction(e,r){let n=op;for(let i of e.startState.facet(Y0n)){let a=i(e);a.length&&(n=n.concat(a))}return!n.length&&e.changes.empty?null:new Fh(e.changes.invert(e.startState.doc),n,void 0,r||e.startState.selection,op)}static selection(e){return new Fh(void 0,op,void 0,void 0,e)}}function NK(t,e,r,n){let i=e+1>r+20?e-r-1:0,a=t.slice(i,e);return a.push(n),a}function K0n(t,e){let r=[],n=!1;return t.iterChangedRanges((i,a)=>r.push(i,a)),e.iterChangedRanges((i,a,s,o)=>{for(let l=0;l=u&&s<=h&&(n=!0)}}),n}function Z0n(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((r,n)=>r.empty!=e.ranges[n].empty).length===0}function wkt(t,e){return t.length?e.length?t.concat(e):t:e}const op=[],J0n=200;function Akt(t,e){if(t.length){let r=t[t.length-1],n=r.selectionsAfter.slice(Math.max(0,r.selectionsAfter.length-J0n));return n.length&&n[n.length-1].eq(e)?t:(n.push(e),NK(t,t.length-1,1e9,r.setSelAfter(n)))}else return[Fh.selection([e])]}function evn(t){let e=t[t.length-1],r=t.slice();return r[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),r}function Wwe(t,e){if(!t.length)return t;let r=t.length,n=op;for(;r;){let i=tvn(t[r-1],e,n);if(i.changes&&!i.changes.empty||i.effects.length){let a=t.slice(0,r);return a[r-1]=i,a}else e=i.mapped,r--,n=i.selectionsAfter}return n.length?[Fh.selection(n)]:op}function tvn(t,e,r){let n=wkt(t.selectionsAfter.length?t.selectionsAfter.map(o=>o.map(e)):op,r);if(!t.changes)return Fh.selection(n);let i=t.changes.map(e),a=e.mapDesc(t.changes,!0),s=t.mapped?t.mapped.composeDesc(a):a;return new Fh(i,nn.mapEffects(t.effects,e),s,t.startSelection.map(a),n)}const rvn=/^(input\.type|delete)($|\.)/;class x0{constructor(e,r,n=0,i=void 0){this.done=e,this.undone=r,this.prevTime=n,this.prevUserEvent=i}isolate(){return this.prevTime?new x0(this.done,this.undone):this}addChanges(e,r,n,i,a){let s=this.done,o=s[s.length-1];return o&&o.changes&&!o.changes.empty&&e.changes&&(!n||rvn.test(n))&&(!o.selectionsAfter.length&&r-this.prevTime0&&r-this.prevTimer.empty?t.moveByChar(r,e):BK(r,e))}function eu(t){return t.textDirectionAt(t.state.selection.main.head)==Ta.LTR}const Skt=t=>Tkt(t,!eu(t)),Ckt=t=>Tkt(t,eu(t));function Okt(t,e){return mg(t,r=>r.empty?t.moveByGroup(r,e):BK(r,e))}const ivn=t=>Okt(t,!eu(t)),avn=t=>Okt(t,eu(t));function svn(t,e,r){if(e.type.prop(r))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function $K(t,e,r){let n=pa(t).resolveInner(e.head),i=r?En.closedBy:En.openedBy;for(let l=e.head;;){let u=r?n.childAfter(l):n.childBefore(l);if(!u)break;svn(t,u,i)?n=u:l=r?u.to:u.from}let a=n.type.prop(i),s,o;return a&&(s=r?y0(t,n.from,1):y0(t,n.to,-1))&&s.matched?o=r?s.end.to:s.end.from:o=r?n.to:n.from,bt.cursor(o,r?-1:1)}const ovn=t=>mg(t,e=>$K(t.state,e,!eu(t))),lvn=t=>mg(t,e=>$K(t.state,e,eu(t)));function kkt(t,e){return mg(t,r=>{if(!r.empty)return BK(r,e);let n=t.moveVertically(r,e);return n.head!=r.head?n:t.moveToLineBoundary(r,e)})}const Ekt=t=>kkt(t,!1),_kt=t=>kkt(t,!0);function Rkt(t){let e=t.scrollDOM.clientHeights.empty?t.moveVertically(s,e,r.height):BK(s,e));if(i.eq(n.selection))return!1;let a;if(r.selfScroll){let s=t.coordsAtPos(n.selection.main.head),o=t.scrollDOM.getBoundingClientRect(),l=o.top+r.marginTop,u=o.bottom-r.marginBottom;s&&s.top>l&&s.bottomDkt(t,!1),Ywe=t=>Dkt(t,!0);function d2(t,e,r){let n=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,r);if(i.head==e.head&&i.head!=(r?n.to:n.from)&&(i=t.moveToLineBoundary(e,r,!1)),!r&&i.head==n.from&&n.length){let a=/^\s*/.exec(t.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;a&&e.head!=n.from+a&&(i=bt.cursor(n.from+a))}return i}const cvn=t=>mg(t,e=>d2(t,e,!0)),uvn=t=>mg(t,e=>d2(t,e,!1)),hvn=t=>mg(t,e=>d2(t,e,!eu(t))),dvn=t=>mg(t,e=>d2(t,e,eu(t))),fvn=t=>mg(t,e=>bt.cursor(t.lineBlockAt(e.head).from,1)),pvn=t=>mg(t,e=>bt.cursor(t.lineBlockAt(e.head).to,-1));function gvn(t,e,r){let n=!1,i=I4(t.selection,a=>{let s=y0(t,a.head,-1)||y0(t,a.head,1)||a.head>0&&y0(t,a.head-1,1)||a.headgvn(t,e);function lp(t,e,r){let n=I4(t.state.selection,i=>{i.undirectional&&i.head>=i.anchor!=e&&(i=bt.range(i.head,i.anchor));let a=r(i);return bt.range(i.anchor,a.head,a.goalColumn,a.bidiLevel||void 0,a.assoc)});return n.eq(t.state.selection)?!1:(t.dispatch(gg(t.state,n)),!0)}function Mkt(t,e){return lp(t,e,r=>t.moveByChar(r,e))}const Ikt=t=>Mkt(t,!eu(t)),Pkt=t=>Mkt(t,eu(t));function Nkt(t,e){return lp(t,e,r=>t.moveByGroup(r,e))}const vvn=t=>Nkt(t,!eu(t)),yvn=t=>Nkt(t,eu(t)),bvn=t=>{let e=!eu(t);return lp(t,e,r=>$K(t.state,r,e))},xvn=t=>{let e=eu(t);return lp(t,e,r=>$K(t.state,r,e))};function Bkt(t,e){return lp(t,e,r=>t.moveVertically(r,e))}const $kt=t=>Bkt(t,!1),Fkt=t=>Bkt(t,!0);function zkt(t,e){return lp(t,e,r=>t.moveVertically(r,e,Rkt(t).height))}const Ukt=t=>zkt(t,!1),Vkt=t=>zkt(t,!0),wvn=t=>lp(t,!0,e=>d2(t,e,!0)),Avn=t=>lp(t,!1,e=>d2(t,e,!1)),Tvn=t=>{let e=!eu(t);return lp(t,e,r=>d2(t,r,e))},Svn=t=>{let e=eu(t);return lp(t,e,r=>d2(t,r,e))},Cvn=t=>lp(t,!1,e=>bt.cursor(t.lineBlockAt(e.head).from)),Ovn=t=>lp(t,!0,e=>bt.cursor(t.lineBlockAt(e.head).to)),Qkt=({state:t,dispatch:e})=>(e(gg(t,{anchor:0})),!0),Gkt=({state:t,dispatch:e})=>(e(gg(t,{anchor:t.doc.length})),!0),Hkt=({state:t,dispatch:e})=>(e(gg(t,{anchor:t.selection.main.anchor,head:0})),!0),Wkt=({state:t,dispatch:e})=>(e(gg(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),kvn=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),Evn=({state:t,dispatch:e})=>{let r=zK(t).map(({from:n,to:i})=>bt.range(n,Math.min(i+1,t.doc.length)));return e(t.update({selection:bt.create(r),userEvent:"select"})),!0},_vn=({state:t,dispatch:e})=>{let r=I4(t.selection,n=>{let i=pa(t),a=i.resolveStack(n.from,1);if(n.empty){let s=i.resolveStack(n.from,-1);s.node.from>=a.node.from&&s.node.to<=a.node.to&&(a=s)}for(let s=a;s;s=s.next){let{node:o}=s;if((o.from=n.to||o.to>n.to&&o.from<=n.from)&&s.next)return bt.range(o.to,o.from)}return n});return r.eq(t.selection)?!1:(e(gg(t,r)),!0)};function Ykt(t,e){let{state:r}=t,n=r.selection,i=r.selection.ranges.slice();for(let a of r.selection.ranges){let s=r.doc.lineAt(a.head);if(e?s.to0)for(let o=a;;){let l=t.moveVertically(o,e);if(l.heads.to){i.some(u=>u.head==l.head)||i.push(l);break}else{if(l.head==o.head)break;o=l}}}return i.length==n.ranges.length?!1:(t.dispatch(gg(r,bt.create(i,i.length-1))),!0)}const Rvn=t=>Ykt(t,!1),Dvn=t=>Ykt(t,!0),Lvn=({state:t,dispatch:e})=>{let r=t.selection,n=null;return r.ranges.length>1?n=bt.create([r.main]):r.main.empty||(n=bt.create([bt.cursor(r.main.head)])),n?(e(gg(t,n)),!0):!1};function R$(t,e){if(t.state.readOnly)return!1;let r="delete.selection",{state:n}=t,i=n.changeByRange(a=>{let{from:s,to:o}=a;if(s==o){let l=e(a);ls&&(r="delete.forward",l=FK(t,l,!0)),s=Math.min(s,l),o=Math.max(o,l)}else s=FK(t,s,!1),o=FK(t,o,!0);return s==o?{range:a}:{changes:{from:s,to:o},range:bt.cursor(s,si(t)))n.between(e,e,(i,a)=>{ie&&(e=r?a:i)});return e}const qkt=(t,e,r)=>R$(t,n=>{let i=n.from,{state:a}=t,s=a.doc.lineAt(i),o,l;if(r&&!e&&i>s.from&&iqkt(t,!1,!0),jkt=t=>qkt(t,!0,!1),Xkt=(t,e)=>R$(t,r=>{let n=r.head,{state:i}=t,a=i.doc.lineAt(n),s=i.charCategorizer(n);for(let o=null;;){if(n==(e?a.to:a.from)){n==r.head&&a.number!=(e?i.doc.lines:1)&&(n+=e?1:-1);break}let l=Dl(a.text,n-a.from,e)+a.from,u=a.text.slice(Math.min(n,l)-a.from,Math.max(n,l)-a.from),h=s(u);if(o!=null&&h!=o)break;(u!=" "||n!=r.head)&&(o=h),n=l}return n}),Kkt=t=>Xkt(t,!1),Mvn=t=>Xkt(t,!0),Ivn=t=>R$(t,e=>{let r=t.lineBlockAt(e.head).to;return e.headR$(t,e=>{let r=t.moveToLineBoundary(e,!1).head;return e.head>r?r:Math.max(0,e.head-1)}),Nvn=t=>R$(t,e=>{let r=t.moveToLineBoundary(e,!0).head;return e.head{if(t.readOnly)return!1;let r=t.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:vi.of(["",""])},range:bt.cursor(n.from)}));return e(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0},$vn=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{if(!n.empty||n.from==0||n.from==t.doc.length)return{range:n};let i=n.from,a=t.doc.lineAt(i),s=i==a.from?i-1:Dl(a.text,i-a.from,!1)+a.from,o=i==a.to?i+1:Dl(a.text,i-a.from,!0)+a.from;return{changes:{from:s,to:o,insert:t.doc.slice(i,o).append(t.doc.slice(s,i))},range:bt.cursor(o)}});return r.changes.empty?!1:(e(t.update(r,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function zK(t){let e=[],r=-1;for(let n of t.selection.ranges){let i=t.doc.lineAt(n.from),a=t.doc.lineAt(n.to);if(!n.empty&&n.to==a.from&&(a=t.doc.lineAt(n.to-1)),r>=i.number){let s=e[e.length-1];s.to=a.to,s.ranges.push(n)}else e.push({from:i.from,to:a.to,ranges:[n]});r=a.number+1}return e}function Zkt(t,e,r){if(t.readOnly)return!1;let n=[],i=[];for(let a of zK(t)){if(r?a.to==t.doc.length:a.from==0)continue;let s=t.doc.lineAt(r?a.to+1:a.from-1),o=s.length+1;if(r){n.push({from:a.to,to:s.to},{from:a.from,insert:s.text+t.lineBreak});for(let l of a.ranges)i.push(bt.range(Math.min(t.doc.length,l.anchor+o),Math.min(t.doc.length,l.head+o)))}else{n.push({from:s.from,to:a.from},{from:a.to,insert:t.lineBreak+s.text});for(let l of a.ranges)i.push(bt.range(l.anchor-o,l.head-o))}}return n.length?(e(t.update({changes:n,scrollIntoView:!0,selection:bt.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Fvn=({state:t,dispatch:e})=>Zkt(t,e,!1),zvn=({state:t,dispatch:e})=>Zkt(t,e,!0);function Jkt(t,e,r){if(t.readOnly)return!1;let n=[];for(let a of zK(t))r?n.push({from:a.from,insert:t.doc.slice(a.from,a.to)+t.lineBreak}):n.push({from:a.to,insert:t.lineBreak+t.doc.slice(a.from,a.to)});let i=t.changes(n);return e(t.update({changes:i,selection:t.selection.map(i,r?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Uvn=({state:t,dispatch:e})=>Jkt(t,e,!1),Vvn=({state:t,dispatch:e})=>Jkt(t,e,!0),Qvn=t=>{if(t.state.readOnly)return!1;let{state:e}=t,r=e.changes(zK(e).map(({from:i,to:a})=>(i>0?i--:a{let a;if(t.lineWrapping){let s=t.lineBlockAt(i.head),o=t.coordsAtPos(i.head,i.assoc||1);o&&(a=s.bottom+t.documentTop-o.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,a)}).map(r);return t.dispatch({changes:r,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Gvn(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let r=pa(t).resolveInner(e),n=r.childBefore(e),i=r.childAfter(e),a;return n&&i&&n.to<=e&&i.from>=e&&(a=n.type.prop(En.closedBy))&&a.indexOf(i.name)>-1&&t.doc.lineAt(n.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(n.to,i.from))?{from:n.to,to:i.from}:null}const eEt=tEt(!1),Hvn=tEt(!0);function tEt(t){return({state:e,dispatch:r})=>{if(e.readOnly)return!1;let n=e.changeByRange(i=>{let{from:a,to:s}=i,o=e.doc.lineAt(a),l=!t&&a==s&&Gvn(e,a);t&&(a=s=(s<=o.to?o:e.doc.lineAt(s)).to);let u=new oK(e,{simulateBreak:a,simulateDoubleBreak:!!l}),h=w2e(u,a);for(h==null&&(h=hg(/^\s*/.exec(e.doc.lineAt(a).text)[0],e.tabSize));so.from&&a{let i=[];for(let s=n.from;s<=n.to;){let o=t.doc.lineAt(s);o.number>r&&(n.empty||n.to>o.from)&&(e(o,i,n),r=o.number),s=o.to+1}let a=t.changes(i);return{changes:i,range:bt.range(a.mapPos(n.anchor,1),a.mapPos(n.head,1))}})}const Wvn=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=Object.create(null),n=new oK(t,{overrideIndentation:a=>{let s=r[a];return s??-1}}),i=jwe(t,(a,s,o)=>{let l=w2e(n,a.from);if(l==null)return;/\S/.test(a.text)||(l=0);let u=/^\s*/.exec(a.text)[0],h=o$(t,l);(u!=h||o.fromt.readOnly?!1:(e(t.update(jwe(t,(r,n)=>{n.push({from:r.from,insert:t.facet(A4)})}),{userEvent:"input.indent"})),!0),nEt=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(jwe(t,(r,n)=>{let i=/^\s*/.exec(r.text)[0];if(!i)return;let a=hg(i,t.tabSize),s=0,o=o$(t,Math.max(0,a-HS(t)));for(;s(t.setTabFocusMode(),!0),qvn=[{key:"Ctrl-b",run:Skt,shift:Ikt,preventDefault:!0},{key:"Ctrl-f",run:Ckt,shift:Pkt},{key:"Ctrl-p",run:Ekt,shift:$kt},{key:"Ctrl-n",run:_kt,shift:Fkt},{key:"Ctrl-a",run:fvn,shift:Cvn},{key:"Ctrl-e",run:pvn,shift:Ovn},{key:"Ctrl-d",run:jkt},{key:"Ctrl-h",run:qwe},{key:"Ctrl-k",run:Ivn},{key:"Ctrl-Alt-h",run:Kkt},{key:"Ctrl-o",run:Bvn},{key:"Ctrl-t",run:$vn},{key:"Ctrl-v",run:Ywe}],jvn=[{key:"ArrowLeft",run:Skt,shift:Ikt,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:ivn,shift:vvn,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:hvn,shift:Tvn,preventDefault:!0},{key:"ArrowRight",run:Ckt,shift:Pkt,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:avn,shift:yvn,preventDefault:!0},{mac:"Cmd-ArrowRight",run:dvn,shift:Svn,preventDefault:!0},{key:"ArrowUp",run:Ekt,shift:$kt,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Qkt,shift:Hkt},{mac:"Ctrl-ArrowUp",run:Lkt,shift:Ukt},{key:"ArrowDown",run:_kt,shift:Fkt,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Gkt,shift:Wkt},{mac:"Ctrl-ArrowDown",run:Ywe,shift:Vkt},{key:"PageUp",run:Lkt,shift:Ukt},{key:"PageDown",run:Ywe,shift:Vkt},{key:"Home",run:uvn,shift:Avn,preventDefault:!0},{key:"Mod-Home",run:Qkt,shift:Hkt},{key:"End",run:cvn,shift:wvn,preventDefault:!0},{key:"Mod-End",run:Gkt,shift:Wkt},{key:"Enter",run:eEt,shift:eEt},{key:"Mod-a",run:kvn},{key:"Backspace",run:qwe,shift:qwe,preventDefault:!0},{key:"Delete",run:jkt,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Kkt,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Mvn,preventDefault:!0},{mac:"Mod-Backspace",run:Pvn,preventDefault:!0},{mac:"Mod-Delete",run:Nvn,preventDefault:!0}].concat(qvn.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),Xvn=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:ovn,shift:bvn},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:lvn,shift:xvn},{key:"Alt-ArrowUp",run:Fvn},{key:"Shift-Alt-ArrowUp",run:Uvn},{key:"Alt-ArrowDown",run:zvn},{key:"Shift-Alt-ArrowDown",run:Vvn},{key:"Mod-Alt-ArrowUp",run:Rvn},{key:"Mod-Alt-ArrowDown",run:Dvn},{key:"Escape",run:Lvn},{key:"Mod-Enter",run:Hvn},{key:"Alt-l",mac:"Ctrl-l",run:Evn},{key:"Mod-i",run:_vn,preventDefault:!0},{key:"Mod-[",run:nEt},{key:"Mod-]",run:rEt},{key:"Mod-Alt-\\",run:Wvn},{key:"Shift-Mod-k",run:Qvn},{key:"Shift-Mod-\\",run:mvn},{key:"Mod-/",run:F0n},{key:"Alt-A",run:U0n},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Yvn}].concat(jvn),Kvn={key:"Tab",run:rEt,shift:nEt},iEt=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class P4{constructor(e,r,n=0,i=e.length,a,s){this.test=s,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,i),this.bufferStart=n,this.normalize=a?o=>a(iEt(o)):iEt,this.query=this.normalize(r)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ph(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let r=rxe(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=o0(e);let i=this.normalize(r);if(i.length)for(let a=0,s=n,o=!0;;a++){let l=i.charCodeAt(a),u=this.match(l,s,o,this.bufferPos+this.bufferStart,a==i.length-1);if(u)return this.value=u,this;if(a==i.length-1)break;o&&athis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let r=this.matchPos<=this.to&&this.re.exec(this.curLine);if(r){let n=this.curLineStart+r.index,i=n+r[0].length;if(this.matchPos=UK(this.text,i+(n==i?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(nthis.value.to)&&(!this.test||this.test(n,i,r)))return this.value={from:n,to:i,precise:!0,match:r},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=n||i.to<=r){let o=new N4(r,e.sliceString(r,n));return Kwe.set(e,o),o}if(i.from==r&&i.to==n)return i;let{text:a,from:s}=i;return s>r&&(a=e.sliceString(r,s)+a,s=r),i.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,r=this.re.exec(this.flat.text);if(r&&!r[0]&&r.index==e&&(this.re.lastIndex=e+1,r=this.re.exec(this.flat.text)),r){let n=this.flat.from+r.index,i=n+r[0].length;if((this.flat.to>=this.to||r.index+r[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,i,r)))return this.value={from:n,to:i,precise:!0,match:r},this.matchPos=UK(this.text,i+(n==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=N4.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(sEt.prototype[Symbol.iterator]=oEt.prototype[Symbol.iterator]=function(){return this});function Zvn(t){try{return new RegExp(t,Xwe),!0}catch{return!1}}function UK(t,e){if(e>=t.length)return e;let r=t.lineAt(e),n;for(;e=56320&&n<57344;)e++;return e}const Jvn=t=>{let{state:e}=t,r=String(e.doc.lineAt(t.state.selection.main.head).number),{close:n,result:i}=Aun(t,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:r},focus:!0,submitLabel:e.phrase("go")});return i.then(a=>{let s=a&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(a.elements.line.value);if(!s){t.dispatch({effects:n});return}let o=e.doc.lineAt(e.selection.main.head),[,l,u,h,d]=s,f=h?+h.slice(1):0,p=u?+u:o.number;if(u&&d){let v=p/100;l&&(v=v*(l=="-"?-1:1)+o.number/e.doc.lines),p=Math.round(e.doc.lines*v)}else u&&l&&(p=p*(l=="-"?-1:1)+o.number);let g=e.doc.line(Math.max(1,Math.min(e.doc.lines,p))),m=bt.cursor(g.from+Math.max(0,Math.min(f,g.length)));t.dispatch({effects:[n,er.scrollIntoView(m.from,{y:"center"})],selection:m})}),!0},eyn={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},tyn=vr.define({combine(t){return u0(t,eyn,{highlightWordAroundCursor:(e,r)=>e||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function ryn(t){return[oyn,syn]}const nyn=Ar.mark({class:"cm-selectionMatch"}),iyn=Ar.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function lEt(t,e,r,n){return(r==0||t(e.sliceDoc(r-1,r))!=ps.Word)&&(n==e.doc.length||t(e.sliceDoc(n,n+1))!=ps.Word)}function ayn(t,e,r,n){return t(e.sliceDoc(r,r+1))==ps.Word&&t(e.sliceDoc(n-1,n))==ps.Word}const syn=ws.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(tyn),{state:r}=t,n=r.selection;if(n.ranges.length>1)return Ar.none;let i=n.main,a,s=null;if(i.empty){if(!e.highlightWordAroundCursor)return Ar.none;let l=r.wordAt(i.head);if(!l)return Ar.none;s=r.charCategorizer(i.head),a=r.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l200)return Ar.none;if(e.wholeWords){if(a=r.sliceDoc(i.from,i.to),s=r.charCategorizer(i.head),!(lEt(s,r,i.from,i.to)&&ayn(s,r,i.from,i.to)))return Ar.none}else if(a=r.sliceDoc(i.from,i.to),!a)return Ar.none}let o=[];for(let l of t.visibleRanges){let u=new P4(r.doc,a,l.from,l.to);for(;!u.next().done;){let{from:h,to:d}=u.value;if((!s||lEt(s,r,h,d))&&(i.empty&&h<=i.from&&d>=i.to?o.push(iyn.range(h,d)):(h>=i.to||d<=i.from)&&o.push(nyn.range(h,d)),o.length>e.maxMatches))return Ar.none}}return Ar.set(o)}},{decorations:t=>t.decorations}),oyn=er.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),lyn=({state:t,dispatch:e})=>{let{selection:r}=t,n=bt.create(r.ranges.map(i=>t.wordAt(i.head)||bt.cursor(i.head)),r.mainIndex);return n.eq(r)?!1:(e(t.update({selection:n})),!0)};function cyn(t,e){let{main:r,ranges:n}=t.selection,i=t.wordAt(r.head),a=i&&i.from==r.from&&i.to==r.to;for(let s=!1,o=new P4(t.doc,e,n[n.length-1].to);;)if(o.next(),o.done){if(s)return null;o=new P4(t.doc,e,0,Math.max(0,n[n.length-1].from-1)),s=!0}else{if(s&&n.some(l=>l.from==o.value.from))continue;if(a){let l=t.wordAt(o.value.from);if(!l||l.from!=o.value.from||l.to!=o.value.to)continue}return o.value}}const uyn=({state:t,dispatch:e})=>{let{ranges:r}=t.selection;if(r.some(a=>a.from===a.to))return lyn({state:t,dispatch:e});let n=t.sliceDoc(r[0].from,r[0].to);if(t.selection.ranges.some(a=>t.sliceDoc(a.from,a.to)!=n))return!1;let i=cyn(t,n);return i?(e(t.update({selection:t.selection.addRange(bt.range(i.from,i.to),!1),effects:er.scrollIntoView(i.to)})),!0):!1},B4=vr.define({combine(t){return u0(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Syn(e),scrollToMatch:e=>er.scrollIntoView(e)})}});class cEt{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||Zvn(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(r,n)=>n=="n"?` -`:n=="r"?"\r":n=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new myn(this):new fyn(this)}getCursor(e,r=0,n){let i=e.doc?e:Kn.create({doc:e});return n==null&&(n=i.doc.length),this.regexp?F4(this,i,r,n):$4(this,i,r,n)}}class uEt{constructor(e){this.spec=e}}function hyn(t,e,r){return(n,i,a,s)=>{if(r&&!r(n,i,a,s))return!1;let o=n>=s&&i<=s+a.length?a.slice(n-s,i-s):e.doc.sliceString(n,i);return t(o,e,n,i)}}function $4(t,e,r,n){let i;return t.wholeWord&&(i=dyn(e.doc,e.charCategorizer(e.selection.main.head))),t.test&&(i=hyn(t.test,e,i)),new P4(e.doc,t.unquoted,r,n,t.caseSensitive?void 0:a=>a.toLowerCase(),i)}function dyn(t,e){return(r,n,i,a)=>((a>r||a+i.length=r)return null;i.push(n.value)}return i}highlight(e,r,n,i){let a=$4(this.spec,e,Math.max(0,r-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!a.next().done;)i(a.value.from,a.value.to)}}function pyn(t,e,r){return(n,i,a)=>(!r||r(n,i,a))&&t(a[0],e,n,i)}function F4(t,e,r,n){let i;return t.wholeWord&&(i=gyn(e.charCategorizer(e.selection.main.head))),t.test&&(i=pyn(t.test,e,i)),new sEt(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:i},r,n)}function VK(t,e){return t.slice(Dl(t,e,!1),e)}function QK(t,e){return t.slice(e,Dl(t,e))}function gyn(t){return(e,r,n)=>!n[0].length||(t(VK(n.input,n.index))!=ps.Word||t(QK(n.input,n.index))!=ps.Word)&&(t(QK(n.input,n.index+n[0].length))!=ps.Word||t(VK(n.input,n.index+n[0].length))!=ps.Word)}class myn extends uEt{nextMatch(e,r,n){let i=F4(this.spec,e,n,e.doc.length).next();return i.done&&(i=F4(this.spec,e,0,r).next()),i.done?null:i.value}prevMatchInRange(e,r,n){for(let i=1;;i++){let a=Math.max(r,n-i*1e4),s=F4(this.spec,e,a,n),o=null;for(;!s.next().done;)o=s.value;if(o&&(a==r||o.from>a+10))return o;if(a==r)return null}}prevMatch(e,r,n){return this.prevMatchInRange(e,0,r)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(r,n)=>{if(n=="&")return e.match[0];if(n=="$")return"$";for(let i=n.length;i>0;i--){let a=+n.slice(0,i);if(a>0&&a=r)return null;i.push(n.value)}return i}highlight(e,r,n,i){let a=F4(this.spec,e,Math.max(0,r-250),Math.min(n+250,e.doc.length));for(;!a.next().done;)i(a.value.from,a.value.to)}}const D$=nn.define(),Zwe=nn.define(),f2=Vs.define({create(t){return new Jwe(tAe(t).create(),null)},update(t,e){for(let r of e.effects)r.is(D$)?t=new Jwe(r.value.create(),t.panel):r.is(Zwe)&&(t=new Jwe(t.query,r.value?eAe:null));return t},provide:t=>r$.from(t,e=>e.panel)});class Jwe{constructor(e,r){this.query=e,this.panel=r}}const vyn=Ar.mark({class:"cm-searchMatch"}),yyn=Ar.mark({class:"cm-searchMatch cm-searchMatch-selected"}),byn=ws.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(f2))}update(t){let e=t.state.field(f2);(e!=t.startState.field(f2)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return Ar.none;let{view:r}=this,n=new Lu;for(let i=0,a=r.visibleRanges,s=a.length;ia[i+1].from-2*250;)l=a[++i].to;t.highlight(r.state,o,l,(u,h)=>{let d=r.state.selection.ranges.some(f=>f.from==u&&f.to==h);n.add(u,h,d?yyn:vyn)})}return n.finish()}},{decorations:t=>t.decorations});function L$(t){return e=>{let r=e.state.field(f2,!1);return r&&r.query.spec.valid?t(e,r):pEt(e)}}const GK=L$((t,{query:e})=>{let{to:r}=t.state.selection.main,n=e.nextMatch(t.state,r,r);if(!n)return!1;let i=bt.single(n.from,n.to),a=t.state.facet(B4);return t.dispatch({selection:i,effects:[rAe(t,n),a.scrollToMatch(i.main,t)],userEvent:"select.search"}),fEt(t),!0}),HK=L$((t,{query:e})=>{let{state:r}=t,{from:n}=r.selection.main,i=e.prevMatch(r,n,n);if(!i)return!1;let a=bt.single(i.from,i.to),s=t.state.facet(B4);return t.dispatch({selection:a,effects:[rAe(t,i),s.scrollToMatch(a.main,t)],userEvent:"select.search"}),fEt(t),!0}),xyn=L$((t,{query:e})=>{let r=e.matchAll(t.state,1e3);return!r||!r.length?!1:(t.dispatch({selection:bt.create(r.map(n=>bt.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),wyn=({state:t,dispatch:e})=>{let r=t.selection;if(r.ranges.length>1||r.main.empty)return!1;let{from:n,to:i}=r.main,a=[],s=0;for(let o=new P4(t.doc,t.sliceDoc(n,i));!o.next().done;){if(a.length>1e3)return!1;o.value.from==n&&(s=a.length),a.push(bt.range(o.value.from,o.value.to))}return e(t.update({selection:bt.create(a,s),userEvent:"select.search.matches"})),!0},hEt=L$((t,{query:e})=>{let{state:r}=t,{from:n,to:i}=r.selection.main;if(r.readOnly)return!1;let a=e.nextMatch(r,n,n);if(!a)return!1;let s=a,o=[],l,u,h=[];s.precise?s.from==n&&s.to==i&&(u=r.toText(e.getReplacement(s)),o.push({from:s.from,to:s.to,insert:u}),s=e.nextMatch(r,s.from,s.to),h.push(er.announce.of(r.phrase("replaced match on line $",r.doc.lineAt(n).number)+"."))):s=e.nextMatch(r,s.from,s.to);let d=t.state.changes(o);return s&&(l=bt.single(s.from,s.to).map(d),h.push(rAe(t,s)),h.push(r.facet(B4).scrollToMatch(l.main,t))),t.dispatch({changes:d,selection:l,effects:h,userEvent:"input.replace"}),!0}),Ayn=L$((t,{query:e})=>{if(t.state.readOnly)return!1;let r=[];for(let i of e.matchAll(t.state,1e9)){let{from:a,to:s,precise:o}=i;o&&r.push({from:a,to:s,insert:e.getReplacement(i)})}if(!r.length)return!1;let n=t.state.phrase("replaced $ matches",r.length)+".";return t.dispatch({changes:r,effects:er.announce.of(n),userEvent:"input.replace.all"}),!0});function eAe(t){return t.state.facet(B4).createPanel(t)}function tAe(t,e){var r,n,i,a,s;let o=t.selection.main,l=o.empty||o.to>o.from+100?"":t.sliceDoc(o.from,o.to);if(e&&!l)return e;let u=t.facet(B4);return new cEt({search:((r=e==null?void 0:e.literal)!==null&&r!==void 0?r:u.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(n=e==null?void 0:e.caseSensitive)!==null&&n!==void 0?n:u.caseSensitive,literal:(i=e==null?void 0:e.literal)!==null&&i!==void 0?i:u.literal,regexp:(a=e==null?void 0:e.regexp)!==null&&a!==void 0?a:u.regexp,wholeWord:(s=e==null?void 0:e.wholeWord)!==null&&s!==void 0?s:u.wholeWord})}function dEt(t){let e=u2e(t,eAe);return e&&e.dom.querySelector("[main-field]")}function fEt(t){let e=dEt(t);e&&e==t.root.activeElement&&e.select()}const pEt=t=>{let e=t.state.field(f2,!1);if(e&&e.panel){let r=dEt(t);if(r&&r!=t.root.activeElement){let n=tAe(t.state,e.query.spec);n.valid&&t.dispatch({effects:D$.of(n)}),r.focus(),r.select()}}else t.dispatch({effects:[Zwe.of(!0),e?D$.of(tAe(t.state,e.query.spec)):nn.appendConfig.of(Oyn)]});return!0},gEt=t=>{let e=t.state.field(f2,!1);if(!e||!e.panel)return!1;let r=u2e(t,eAe);return r&&r.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:Zwe.of(!1)}),!0},Tyn=[{key:"Mod-f",run:pEt,scope:"editor search-panel"},{key:"F3",run:GK,shift:HK,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:GK,shift:HK,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:gEt,scope:"editor search-panel"},{key:"Mod-Shift-l",run:wyn},{key:"Mod-Alt-g",run:Jvn},{key:"Mod-d",run:uyn,preventDefault:!0}];class Syn{constructor(e){this.view=e;let r=this.query=e.state.field(f2).query.spec;this.commit=this.commit.bind(this),this.searchField=fa("input",{value:r.search,placeholder:Hd(e,"Find"),"aria-label":Hd(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=fa("input",{value:r.replace,placeholder:Hd(e,"Replace"),"aria-label":Hd(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=fa("input",{type:"checkbox",name:"case",form:"",checked:r.caseSensitive,onchange:this.commit}),this.reField=fa("input",{type:"checkbox",name:"re",form:"",checked:r.regexp,onchange:this.commit}),this.wordField=fa("input",{type:"checkbox",name:"word",form:"",checked:r.wholeWord,onchange:this.commit});function n(i,a,s){return fa("button",{class:"cm-button",name:i,onclick:a,type:"button"},s)}this.dom=fa("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,n("next",()=>GK(e),[Hd(e,"next")]),n("prev",()=>HK(e),[Hd(e,"previous")]),n("select",()=>xyn(e),[Hd(e,"all")]),fa("label",null,[this.caseField,Hd(e,"match case")]),fa("label",null,[this.reField,Hd(e,"regexp")]),fa("label",null,[this.wordField,Hd(e,"by word")]),...e.state.readOnly?[]:[fa("br"),this.replaceField,n("replace",()=>hEt(e),[Hd(e,"replace")]),n("replaceAll",()=>Ayn(e),[Hd(e,"replace all")])],fa("button",{name:"close",onclick:()=>gEt(e),"aria-label":Hd(e,"close"),type:"button"},["×"])])}commit(){let e=new cEt({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:D$.of(e)}))}keydown(e){Dcn(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?HK:GK)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),hEt(this.view))}update(e){for(let r of e.transactions)for(let n of r.effects)n.is(D$)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(B4).top}}function Hd(t,e){return t.state.phrase(e)}const WK=30,YK=/[\s\.,:;?!]/;function rAe(t,{from:e,to:r}){let n=t.state.doc.lineAt(e),i=t.state.doc.lineAt(r).to,a=Math.max(n.from,e-WK),s=Math.min(i,r+WK),o=t.state.sliceDoc(a,s);if(a!=n.from){for(let l=0;lo.length-WK;l--)if(!YK.test(o[l-1])&&YK.test(o[l])){o=o.slice(0,l);break}}return er.announce.of(`${t.state.phrase("current match")}. ${o} ${t.state.phrase("on line")} ${n.number}.`)}const Cyn=er.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Oyn=[f2,Fd.low(byn),Cyn];class mEt{constructor(e,r,n){this.from=e,this.to=r,this.diagnostic=n}}class JS{constructor(e,r,n){this.diagnostics=e,this.panel=r,this.selected=n}static init(e,r,n){let i=n.facet(M$).markerFilter;i&&(e=i(e,n));let a=e.slice().sort((p,g)=>p.from-g.from||p.to-g.to),s=new Lu,o=[],l=0,u=n.doc.iter(),h=0,d=n.doc.length;for(let p=0;;){let g=p==a.length?null:a[p];if(!g&&!o.length)break;let m,v;if(o.length)m=l,v=o.reduce((x,w)=>Math.min(x,w.to),g&&g.from>m?g.from:1e8);else{if(m=g.from,m>d)break;v=g.to,o.push(g),p++}for(;px.from||x.to==m))o.push(x),p++,v=Math.min(x.to,v);else{v=Math.min(x.from,v);break}}v=Math.min(v,d);let y=!1;if(o.some(x=>x.from==m&&(x.to==v||v==d))&&(y=m==v,!y&&v-m<10)){let x=m-(h+u.value.length);x>0&&(u.next(x),h=m);for(let w=m;;){if(w>=v){y=!0;break}if(!u.lineBreak&&h+u.value.length>w)break;w=h+u.value.length,h+=u.value.length,u.next()}}let b=$yn(o);if(y)s.add(m,m,Ar.widget({widget:new Iyn(b),diagnostics:o.slice()}));else{let x=o.reduce((w,A)=>A.markClass?w+" "+A.markClass:w,"");s.add(m,v,Ar.mark({class:"cm-lintRange cm-lintRange-"+b+x,diagnostics:o.slice(),inclusiveEnd:o.some(w=>w.to>v)}))}if(l=v,l==d)break;for(let x=0;x{if(!(e&&s.diagnostics.indexOf(e)<0))if(!n)n=new mEt(i,a,e||s.diagnostics[0]);else{if(s.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new mEt(n.from,a,n.diagnostic)}}),n}function kyn(t,e){let r=e.pos,n=e.end||r,i=t.state.facet(M$).hideOn(t,r,n);if(i!=null)return i;let a=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(s=>s.is(vEt))||t.changes.touchesRange(a.from,Math.max(a.to,n)))}function Eyn(t,e){return t.field(Wd,!1)?e:e.concat(nn.appendConfig.of(Fyn))}const vEt=nn.define(),nAe=nn.define(),yEt=nn.define(),Wd=Vs.define({create(){return new JS(Ar.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let r=t.diagnostics.map(e.changes),n=null,i=t.panel;if(t.selected){let a=e.changes.mapPos(t.selected.from,1);n=p2(r,t.selected.diagnostic,a)||p2(r,null,a)}!r.size&&i&&e.state.facet(M$).autoPanel&&(i=null),t=new JS(r,i,n)}for(let r of e.effects)if(r.is(vEt)){let n=e.state.facet(M$).autoPanel?r.value.length?I$.open:null:t.panel;t=JS.init(r.value,n,e.state)}else r.is(nAe)?t=new JS(t.diagnostics,r.value?I$.open:null,t.selected):r.is(yEt)&&(t=new JS(t.diagnostics,t.panel,r.value));return t},provide:t=>[r$.from(t,e=>e.panel),er.decorations.from(t,e=>e.diagnostics)]}),_yn=Ar.mark({class:"cm-lintRange cm-lintRange-active"});function Ryn(t,e,r){let{diagnostics:n}=t.state.field(Wd),i,a=-1,s=-1;n.between(e-(r<0?1:0),e+(r>0?1:0),(l,u,{spec:h})=>{if(e>=l&&e<=u&&(l==u||(e>l||r>0)&&(eAEt(t,r,!1)))}const Lyn=t=>{let e=t.state.field(Wd,!1);(!e||!e.panel)&&t.dispatch({effects:Eyn(t.state,[nAe.of(!0)])});let r=u2e(t,I$.open);return r&&r.dom.querySelector(".cm-panel-lint ul").focus(),!0},bEt=t=>{let e=t.state.field(Wd,!1);return!e||!e.panel?!1:(t.dispatch({effects:nAe.of(!1)}),!0)},Myn=[{key:"Mod-Shift-m",run:Lyn,preventDefault:!0},{key:"F8",run:t=>{let e=t.state.field(Wd,!1);if(!e)return!1;let r=t.state.selection.main,n=p2(e.diagnostics,null,r.to+1);return!n&&(n=p2(e.diagnostics,null,0),!n||n.from==r.from&&n.to==r.to)?!1:(t.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0}),xun(t,n.from,1,{tooltip:SEt,until:i=>i.docChanged||i.newSelection.main.headn.to}),!0)}}],M$=vr.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...u0(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:xEt,tooltipFilter:xEt,needsRefresh:(e,r)=>e?r?n=>e(n)||r(n):e:r,hideOn:(e,r)=>e?r?(n,i,a)=>e(n,i,a)||r(n,i,a):e:r,autoPanel:(e,r)=>e||r})}}});function xEt(t,e){return t?e?(r,n)=>e(t(r,n),n):t:e}function wEt(t){let e=[];if(t)e:for(let{name:r}of t){for(let n=0;na.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function AEt(t,e,r){var n;let i=r?wEt(e.actions):[];return fa("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},fa("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(n=e.actions)===null||n===void 0?void 0:n.map((a,s)=>{let o=!1,l=p=>{if(p.preventDefault(),o)return;o=!0;let g=p2(t.state.field(Wd).diagnostics,e);g&&a.apply(t,g.from,g.to)},{name:u}=a,h=i[s]?u.indexOf(i[s]):-1,d=h<0?u:[u.slice(0,h),fa("u",u.slice(h,h+1)),u.slice(h+1)],f=a.markClass?" "+a.markClass:"";return fa("button",{type:"button",class:"cm-diagnosticAction"+f,onclick:l,onmousedown:l,"aria-label":` Action: ${u}${h<0?"":` (access key "${i[s]})"`}.`},d)}),e.source&&fa("div",{class:"cm-diagnosticSource"},e.source))}class Iyn extends Iu{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return fa("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class TEt{constructor(e,r){this.diagnostic=r,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=AEt(e,r,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class I${constructor(e){this.view=e,this.items=[];let r=i=>{if(!(i.ctrlKey||i.altKey||i.metaKey)){if(i.keyCode==27)bEt(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:a}=this.items[this.selectedIndex],s=wEt(a.actions);for(let o=0;o{for(let a=0;abEt(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Wd).selected;if(!e)return-1;for(let r=0;r{for(let h of u.diagnostics){if(s.has(h))continue;s.add(h);let d=-1,f;for(let p=n;pn&&(this.items.splice(n,d-n),i=!0)),r&&f.diagnostic==r.diagnostic?f.dom.hasAttribute("aria-selected")||(f.dom.setAttribute("aria-selected","true"),a=f):f.dom.hasAttribute("aria-selected")&&f.dom.removeAttribute("aria-selected"),n++}});n({sel:a.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:o,panel:l})=>{let u=l.height/this.list.offsetHeight;o.topl.bottom&&(this.list.scrollTop+=(o.bottom-l.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function r(){let n=e;e=n.nextSibling,n.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)r();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)r()}moveSelection(e){if(this.selectedIndex<0)return;let r=this.view.state.field(Wd),n=p2(r.diagnostics,this.items[e].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:yEt.of(n)})}static open(e){return new I$(e)}}function Pyn(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(t)}')`}function qK(t){return Pyn(``,'width="6" height="3"')}const Nyn=er.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:qK("#f11")},".cm-lintRange-warning":{backgroundImage:qK("orange")},".cm-lintRange-info":{backgroundImage:qK("#999")},".cm-lintRange-hint":{backgroundImage:qK("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function Byn(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function $yn(t){let e="hint",r=1;for(let n of t){let i=Byn(n.severity);i>r&&(r=i,e=n.severity)}return e}const SEt=bun(Ryn,{hideOn:kyn}),Fyn=[Wd,er.decorations.compute([Wd],t=>{let{selected:e,panel:r}=t.field(Wd);return!e||!r||e.from==e.to?Ar.none:Ar.set([_yn.range(e.from,e.to)])}),SEt,Nyn];var iAe=function(e){e===void 0&&(e={});var r=e,n=r.crosshairCursor,i=n===void 0?!1:n,a=[];e.closeBracketsKeymap!==!1&&(a=a.concat(Zdn)),e.defaultKeymap!==!1&&(a=a.concat(Xvn)),e.searchKeymap!==!1&&(a=a.concat(Tyn)),e.historyKeymap!==!1&&(a=a.concat(nvn)),e.foldKeymap!==!1&&(a=a.concat(ahn)),e.completionKeymap!==!1&&(a=a.concat(ZSt)),e.lintKeymap!==!1&&(a=a.concat(Myn));var s=[];return e.lineNumbers!==!1&&s.push(zTt()),e.highlightActiveLineGutter!==!1&&s.push(Iun()),e.highlightSpecialChars!==!1&&s.push(qcn()),e.history!==!1&&s.push(q0n()),e.foldGutter!==!1&&s.push(chn()),e.drawSelection!==!1&&s.push(Bcn()),e.dropCursor!==!1&&s.push(Vcn()),e.allowMultipleSelections!==!1&&s.push(Kn.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&s.push(Jun()),e.syntaxHighlighting!==!1&&s.push(cSt(phn,{fallback:!0})),e.bracketMatching!==!1&&s.push(xhn()),e.closeBrackets!==!1&&s.push(jdn()),e.autocompletion!==!1&&s.push(afn()),e.rectangularSelection!==!1&&s.push(lun()),i!==!1&&s.push(hun()),e.highlightActiveLine!==!1&&s.push(eun()),e.highlightSelectionMatches!==!1&&s.push(ryn()),e.tabSize&&typeof e.tabSize=="number"&&s.push(A4.of(" ".repeat(e.tabSize))),s.concat([y4.of(a.flat())]).filter(Boolean)};const zyn="#e5c07b",CEt="#e06c75",Uyn="#56b6c2",Vyn="#ffffff",jK="#abb2bf",aAe="#7d8799",Qyn="#61afef",Gyn="#98c379",OEt="#d19a66",Hyn="#c678dd",Wyn="#21252b",kEt="#2c313a",EEt="#282c34",sAe="#353a42",Yyn="#3E4451",_Et="#528bff",qyn=er.theme({"&":{color:jK,backgroundColor:EEt},".cm-content":{caretColor:_Et},".cm-cursor, .cm-dropCursor":{borderLeftColor:_Et},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Yyn},".cm-panels":{backgroundColor:Wyn,color:jK},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:EEt,color:aAe,border:"none"},".cm-activeLineGutter":{backgroundColor:kEt},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:sAe},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:sAe,borderBottomColor:sAe},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:kEt,color:jK}}},{dark:!0}),jyn=u$.define([{tag:Ee.keyword,color:Hyn},{tag:[Ee.name,Ee.deleted,Ee.character,Ee.propertyName,Ee.macroName],color:CEt},{tag:[Ee.function(Ee.variableName),Ee.labelName],color:Qyn},{tag:[Ee.color,Ee.constant(Ee.name),Ee.standard(Ee.name)],color:OEt},{tag:[Ee.definition(Ee.name),Ee.separator],color:jK},{tag:[Ee.typeName,Ee.className,Ee.number,Ee.changed,Ee.annotation,Ee.modifier,Ee.self,Ee.namespace],color:zyn},{tag:[Ee.operator,Ee.operatorKeyword,Ee.url,Ee.escape,Ee.regexp,Ee.link,Ee.special(Ee.string)],color:Uyn},{tag:[Ee.meta,Ee.comment],color:aAe},{tag:Ee.strong,fontWeight:"bold"},{tag:Ee.emphasis,fontStyle:"italic"},{tag:Ee.strikethrough,textDecoration:"line-through"},{tag:Ee.link,color:aAe,textDecoration:"underline"},{tag:Ee.heading,fontWeight:"bold",color:CEt},{tag:[Ee.atom,Ee.bool,Ee.special(Ee.variableName)],color:OEt},{tag:[Ee.processingInstruction,Ee.string,Ee.inserted],color:Gyn},{tag:Ee.invalid,color:Vyn}]),REt=[qyn,cSt(jyn)];var Xyn=er.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),Kyn=function(e){e===void 0&&(e={});var r=e,n=r.indentWithTab,i=n===void 0?!0:n,a=r.editable,s=a===void 0?!0:a,o=r.readOnly,l=o===void 0?!1:o,u=r.theme,h=u===void 0?"light":u,d=r.placeholder,f=d===void 0?"":d,p=r.basicSetup,g=p===void 0?!0:p,m=[];switch(i&&m.unshift(y4.of([Kvn])),g&&(typeof g=="boolean"?m.unshift(iAe()):m.unshift(iAe(g))),f&&m.unshift(iun(f)),h){case"light":m.push(Xyn);break;case"dark":m.push(REt);break;case"none":break;default:m.push(h);break}return s===!1&&m.push(er.editable.of(!1)),l&&m.push(Kn.readOnly.of(!0)),[...m]},Zyn=t=>({line:t.state.doc.lineAt(t.state.selection.main.from),lineCount:t.state.doc.lines,lineBreak:t.state.lineBreak,length:t.state.doc.length,readOnly:t.state.readOnly,tabSize:t.state.tabSize,selection:t.state.selection,selectionAsSingle:t.state.selection.asSingle().main,ranges:t.state.selection.ranges,selectionCode:t.state.sliceDoc(t.state.selection.main.from,t.state.selection.main.to),selections:t.state.selection.ranges.map(e=>t.state.sliceDoc(e.from,e.to)),selectedText:t.state.selection.ranges.some(e=>!e.empty)});class Jyn{constructor(e,r){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=r,this.timeoutMS=r,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(r=>{try{r()}catch(n){console.error("TimeoutLatch callback error:",n)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class DEt{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var oAe=null,e1n=()=>typeof window>"u"?new DEt:(oAe||(oAe=new DEt),oAe),t1n=er.theme({"& .cm-scroller":{height:"100% !important"}}),LEt=null,lAe=null;function r1n(t,e,r,n,i,a){if(!t&&!e&&!r&&!n&&!i&&!a)return null;var s=JSON.stringify({height:t,minHeight:e,maxHeight:r,width:n,minWidth:i,maxWidth:a});return s===LEt||(LEt=s,lAe=er.theme({"&":{height:t,minHeight:e,maxHeight:r,width:n,minWidth:i,maxWidth:a}})),lAe}var MEt=c0.define(),n1n=200,i1n=[];function a1n(t){var e=t.value,r=t.selection,n=t.onChange,i=t.onStatistics,a=t.onCreateEditor,s=t.onUpdate,o=t.extensions,l=o===void 0?i1n:o,u=t.autoFocus,h=t.theme,d=h===void 0?"light":h,f=t.height,p=f===void 0?null:f,g=t.minHeight,m=g===void 0?null:g,v=t.maxHeight,y=v===void 0?null:v,b=t.width,x=b===void 0?null:b,w=t.minWidth,A=w===void 0?null:w,T=t.maxWidth,S=T===void 0?null:T,O=t.placeholder,k=O===void 0?"":O,E=t.editable,_=E===void 0?!0:E,I=t.readOnly,L=I===void 0?!1:I,R=t.indentWithTab,D=R===void 0?!0:R,M=t.basicSetup,P=M===void 0?!0:M,N=t.root,F=t.initialState,B=se.useState(),V=B[0],z=B[1],U=se.useState(),Q=U[0],G=U[1],X=se.useState(),Y=X[0],le=X[1],q=se.useState(()=>({current:null}))[0],Z=se.useState(()=>({current:null}))[0],ee=r1n(p,m,y,x,A,S),re=er.updateListener.of(Ce=>{if(Ce.docChanged&&typeof n=="function"&&!Ce.transactions.some(he=>he.annotation(MEt))){q.current?q.current.reset():(q.current=new Jyn(()=>{if(Z.current){var he=Z.current;Z.current=null,he()}q.current=null},n1n),e1n().add(q.current));var Oe=Ce.state.doc,$e=Oe.toString();n($e,Ce)}i&&i(Zyn(Ce))}),ve=Kyn({theme:d,editable:_,readOnly:L,placeholder:k,indentWithTab:D,basicSetup:P}),ae=[re,...ee?[ee]:[],t1n,...ve];return s&&typeof s=="function"&&ae.push(er.updateListener.of(s)),ae=ae.concat(l),se.useLayoutEffect(()=>{if(V&&!Y){var Ce={doc:e,selection:r,extensions:ae},Oe=F?Kn.fromJSON(F.json,Ce,F.fields):Kn.create(Ce);if(le(Oe),!Q){var $e=new er({state:Oe,parent:V,root:N});G($e),a&&a($e,Oe)}}return()=>{Q&&(le(void 0),G(void 0))}},[V,Y]),se.useEffect(()=>{t.container&&z(t.container)},[t.container]),se.useEffect(()=>()=>{Q&&(Q.destroy(),G(void 0)),q.current&&(q.current.cancel(),q.current=null)},[Q]),se.useEffect(()=>{u&&Q&&Q.focus()},[u,Q]),se.useEffect(()=>{Q&&Q.dispatch({effects:nn.reconfigure.of(ae)})},[d,l,p,m,y,x,A,S,k,_,L,D,P,n,s]),se.useEffect(()=>{if(e!==void 0){var Ce=Q?Q.state.doc.toString():"";if(Q&&e!==Ce){var Oe=q.current&&!q.current.isDone,$e=()=>{Q&&e!==Q.state.doc.toString()&&Q.dispatch({changes:{from:0,to:Q.state.doc.toString().length,insert:e||""},annotations:[MEt.of(!0)]})};Oe?Z.current=$e:$e()}}},[e,Q]),{state:Y,setState:le,view:Q,setView:G,container:V,setContainer:z}}var s1n=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],cAe=se.forwardRef((t,e)=>{var r=t.className,n=t.value,i=n===void 0?"":n,a=t.selection,s=t.extensions,o=s===void 0?[]:s,l=t.onChange,u=t.onStatistics,h=t.onCreateEditor,d=t.onUpdate,f=t.autoFocus,p=t.theme,g=p===void 0?"light":p,m=t.height,v=t.minHeight,y=t.maxHeight,b=t.width,x=t.minWidth,w=t.maxWidth,A=t.basicSetup,T=t.placeholder,S=t.indentWithTab,O=t.editable,k=t.readOnly,E=t.root,_=t.initialState,I=$0n(t,s1n),L=se.useRef(null),R=a1n({root:E,value:i,autoFocus:f,theme:g,height:m,minHeight:v,maxHeight:y,width:b,minWidth:x,maxWidth:w,basicSetup:A,placeholder:T,indentWithTab:S,editable:O,readOnly:k,selection:a,onChange:l,onStatistics:u,onCreateEditor:h,onUpdate:d,extensions:o,initialState:_}),D=R.state,M=R.view,P=R.container,N=R.setContainer;se.useImperativeHandle(e,()=>({editor:L.current,state:D,view:M}),[L,P,D,M]);var F=se.useCallback(V=>{L.current=V,N(V)},[N]);if(typeof i!="string")throw new Error("value must be typeof string but got "+typeof i);var B=typeof g=="string"?"cm-theme-"+g:"cm-theme";return W.jsx("div",Uwe({ref:F,className:""+B+(r?" "+r:"")},I))});cAe.displayName="CodeMirror";function XK(t){const e=t.toLowerCase(),r=e.split("/").pop()??e,n=r.includes(".")?r.split(".").pop():"";return r==="dockerfile"||r.startsWith("dockerfile.")||r.endsWith(".dockerfile")?[k2e.define(B0n)]:n==="py"||n==="pyi"?[Ymn()]:["ts","tsx","mts","cts"].includes(n??"")?[j2e({typescript:!0,jsx:n==="tsx"})]:["js","jsx","mjs","cjs"].includes(n??"")?[j2e({jsx:n==="jsx"})]:n==="json"||n==="jsonc"?[yfn()]:n==="yaml"||n==="yml"?[T0n()]:["md","markdown"].includes(n??"")?[kgn()]:[]}function o1n({value:t,path:e,onChange:r,readOnly:n=!1,theme:i="light",lineNumberStart:a=1,height:s="100%",minHeight:o,maxHeight:l}){const u=se.useMemo(()=>[...XK(e),...a===1?[]:[zTt({formatNumber:h=>String(h+a-1)})]],[a,e]);return W.jsx(cAe,{value:t,height:s,minHeight:o,maxHeight:l,theme:i,extensions:u,editable:!n,onChange:r,basicSetup:{lineNumbers:a===1,foldGutter:!0,highlightActiveLine:!0,highlightActiveLineGutter:!0,autocompletion:!1}})}const l1n=Object.freeze(Object.defineProperty({__proto__:null,default:o1n,languageFor:XK},Symbol.toStringTag,{value:"Module"}));class Lo{constructor(e,r,n,i){this.fromA=e,this.toA=r,this.fromB=n,this.toB=i}offset(e,r=e){return new Lo(this.fromA+e,this.toA+e,this.fromB+r,this.toB+r)}}function eC(t,e,r,n,i,a){if(t==n)return[];let s=fAe(t,e,r,n,i,a),o=pAe(t,e+s,r,n,i+s,a);e+=s,r-=o,i+=s,a-=o;let l=r-e,u=a-i;if(!l||!u)return[new Lo(e,r,i,a)];if(l>u){let d=t.slice(e,r).indexOf(n.slice(i,a));if(d>-1)return[new Lo(e,e+d,i,i),new Lo(e+d+u,r,a,a)]}else if(u>l){let d=n.slice(i,a).indexOf(t.slice(e,r));if(d>-1)return[new Lo(e,e,i,i+d),new Lo(r,r,i+d+l,a)]}if(l==1||u==1)return[new Lo(e,r,i,a)];let h=NEt(t,e,r,n,i,a);if(h){let[d,f,p]=h;return eC(t,e,d,n,i,f).concat(eC(t,d+p,r,n,f+p,a))}return c1n(t,e,r,n,i,a)}let P$=1e9,N$=0,uAe=!1;function c1n(t,e,r,n,i,a){let s=r-e,o=a-i;if(P$<1e9&&Math.min(s,o)>P$*16||N$>0&&Date.now()>N$)return Math.min(s,o)>P$*64?[new Lo(e,r,i,a)]:BEt(t,e,r,n,i,a);let l=Math.ceil((s+o)/2);hAe.reset(l),dAe.reset(l);let u=(p,g)=>t.charCodeAt(e+p)==n.charCodeAt(i+g),h=(p,g)=>t.charCodeAt(r-p-1)==n.charCodeAt(a-g-1),d=(s-o)%2!=0?dAe:null,f=d?null:hAe;for(let p=0;pP$||N$>0&&!(p&63)&&Date.now()>N$)return BEt(t,e,r,n,i,a);let g=hAe.advance(p,s,o,l,d,!1,u)||dAe.advance(p,s,o,l,f,!0,h);if(g)return u1n(t,e,r,e+g[0],n,i,a,i+g[1])}return[new Lo(e,r,i,a)]}class IEt{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let r=0;rr)this.end+=2;else if(d>n)this.start+=2;else if(a){let f=i+(r-n)-l;if(f>=0&&f=r-h)return[p,i+p-f]}else{let p=r-a.vec[f];if(h>=p)return[h,d]}}}return null}}const hAe=new IEt,dAe=new IEt;function u1n(t,e,r,n,i,a,s,o){let l=!1;return!z4(t,n)&&++n==r&&(l=!0),!z4(i,o)&&++o==s&&(l=!0),l?[new Lo(e,r,a,s)]:eC(t,e,n,i,a,o).concat(eC(t,n,r,i,o,s))}function PEt(t,e){let r=1,n=Math.min(t,e);for(;rr||h>a||t.slice(o,u)!=n.slice(l,h)){if(s==1)return o-e-(z4(t,o)?0:1);s=s>>1}else{if(u==r||h==a)return u-e;o=u,l=h}}}function pAe(t,e,r,n,i,a){if(e==r||i==a||t.charCodeAt(r-1)!=n.charCodeAt(a-1))return 0;let s=PEt(r-e,a-i);for(let o=r,l=a;;){let u=o-s,h=l-s;if(u>1}else{if(u==e||h==i)return r-u;o=u,l=h}}}function gAe(t,e,r,n,i,a,s,o){let l=n.slice(i,a),u=null;for(;;){if(u||s=r)break;let f=t.slice(h,d),p=-1;for(;(p=l.indexOf(f,p+1))!=-1;){let g=fAe(t,d,r,n,i+p+f.length,a),m=pAe(t,e,h,n,i,i+p),v=f.length+g+m;(!u||u[2]>1}}function NEt(t,e,r,n,i,a){let s=r-e,o=a-i;if(si.fromA-e&&n.toB>i.fromB-e&&(t[r-1]=new Lo(n.fromA,i.toA,n.fromB,i.toB),t.splice(r--,1))}}function h1n(t,e,r){for(;;){$Et(r,1);let n=!1;for(let i=0;i3||o>3){let l=i==t.length-1?e.length:t[i+1].fromA,u=a.fromA-n,h=l-a.toA,d=GEt(e,a.fromA,u),f=QEt(e,a.toA,h),p=a.fromA-d,g=f-a.toA;if((!s||!o)&&p&&g){let m=Math.max(s,o),[v,y,b]=s?[e,a.fromA,a.toA]:[r,a.fromB,a.toB];m>p&&e.slice(d,a.fromA)==v.slice(b-p,b)?(a=t[i]=new Lo(d,d+s,a.fromB-p,a.toB-p),d=a.fromA,f=QEt(e,a.toA,l-a.toA)):m>g&&e.slice(a.toA,f)==v.slice(y,y+g)&&(a=t[i]=new Lo(f-s,f,a.fromB+g,a.toB+g),f=a.toA,d=GEt(e,a.fromA,a.fromA-n)),p=a.fromA-d,g=f-a.toA}if(p||g)a=t[i]=new Lo(a.fromA-p,a.toA+g,a.fromB-p,a.toB+g);else if(s){if(!o){let m=WEt(e,a.fromA,a.toA),v,y=m<0?-1:HEt(e,a.toA,a.fromA);m>-1&&(v=m-a.fromA)<=h&&e.slice(a.fromA,m)==e.slice(a.toA,a.toA+v)?a=t[i]=a.offset(v):y>-1&&(v=a.toA-y)<=u&&e.slice(a.fromA-v,a.fromA)==e.slice(y,a.toA)&&(a=t[i]=a.offset(-v))}}else{let m=WEt(r,a.fromB,a.toB),v,y=m<0?-1:HEt(r,a.toB,a.fromB);m>-1&&(v=m-a.fromB)<=h&&r.slice(a.fromB,m)==r.slice(a.toB,a.toB+v)?a=t[i]=a.offset(v):y>-1&&(v=a.toB-y)<=u&&r.slice(a.fromB-v,a.fromB)==r.slice(y,a.toB)&&(a=t[i]=a.offset(-v))}}n=a.toA}return $Et(t,3),t}let tC;try{tC=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function FEt(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function zEt(t,e){if(e==t.length)return 0;let r=t.charCodeAt(e);return r<192?FEt(r)?1:0:tC?!YEt(r)||e==t.length-1?tC.test(String.fromCharCode(r))?1:0:tC.test(t.slice(e,e+2))?2:0:0}function UEt(t,e){if(!e)return 0;let r=t.charCodeAt(e-1);return r<192?FEt(r)?1:0:tC?!qEt(r)||e==1?tC.test(String.fromCharCode(r))?1:0:tC.test(t.slice(e-2,e))?2:0:0}const VEt=8;function QEt(t,e,r){if(e==t.length||!UEt(t,e))return e;for(let n=e,i=e+r,a=0;ai)return n;n+=s}return e}function GEt(t,e,r){if(!e||!zEt(t,e))return e;for(let n=e,i=e-r,a=0;at>=55296&&t<=56319,qEt=t=>t>=56320&&t<=57343;function z4(t,e){return!e||e==t.length||!YEt(t.charCodeAt(e-1))||!qEt(t.charCodeAt(e))}function f1n(t,e,r){var n;let i=r==null?void 0:r.override;return i?i(t,e):(P$=((n=r==null?void 0:r.scanLimit)!==null&&n!==void 0?n:1e9)>>1,N$=r!=null&&r.timeout?Date.now()+r.timeout:0,uAe=!1,h1n(t,e,eC(t,0,t.length,e,0,e.length)))}function jEt(){return!uAe}function XEt(t,e,r){return d1n(f1n(t,e,r),t,e)}const zh=vr.define({combine:t=>t[0]}),mAe=nn.define(),KEt=vr.define(),Bu=Vs.define({create(t){return null},update(t,e){for(let r of e.effects)r.is(mAe)&&(t=r.value);for(let r of e.state.facet(KEt))t=r(t,e);return t}});class o1{constructor(e,r,n,i,a,s=!0){this.changes=e,this.fromA=r,this.toA=n,this.fromB=i,this.toB=a,this.precise=s}offset(e,r){return e||r?new o1(this.changes,this.fromA+e,this.toA+e,this.fromB+r,this.toB+r,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,r,n){let i=XEt(e.toString(),r.toString(),n);return e_t(i,e,r,0,0,jEt())}static updateA(e,r,n,i,a){return n_t(r_t(e,i,!0,n.length),e,r,n,a)}static updateB(e,r,n,i,a){return n_t(r_t(e,i,!1,r.length),e,r,n,a)}}function ZEt(t,e,r,n){let i=r.lineAt(t),a=n.lineAt(e);return i.to==t&&a.to==e&&td+1&&v>f+1)break;p.push(g.offset(-u+n,-h+i)),[d,f]=JEt(g.toA+n,g.toB+i,e,r),o++}s.push(new o1(p,u,Math.max(u,d),h,Math.max(h,f),a))}return s}const KK=1e3;function t_t(t,e,r,n){let i=0,a=t.length;for(;;){if(i==a){let h=0,d=0;i&&({toA:h,toB:d}=t[i-1]);let f=e-(r?h:d);return[h+f,d+f]}let s=i+a>>1,o=t[s],[l,u]=r?[o.fromA,o.toA]:[o.fromB,o.toB];if(l>e)a=s;else if(u<=e)i=s+1;else return n?[o.fromA,o.fromB]:[o.toA,o.toB]}}function r_t(t,e,r,n){let i=[];return e.iterChangedRanges((a,s,o,l)=>{let u=0,h=r?e.length:n,d=0,f=r?n:e.length;a>KK&&([u,d]=t_t(t,a-KK,r,!0)),s=u?i[i.length-1]={fromA:g.fromA,fromB:g.fromB,toA:h,toB:f,diffA:g.diffA+m,diffB:g.diffB+v}:i.push({fromA:u,toA:h,fromB:d,toB:f,diffA:m,diffB:v})}),i}function n_t(t,e,r,n,i){if(!t.length)return e;let a=[];for(let s=0,o=0,l=0,u=0;;s++){let h=s==t.length?null:t[s],d=h?h.fromA+o:r.length,f=h?h.fromB+l:n.length;for(;ud||v.toB+l>f))break;a.push(v.offset(o,l)),u++}if(!h)break;let p=h.toA+o+h.diffA,g=h.toB+l+h.diffB,m=XEt(r.sliceString(d,p),n.sliceString(f,g),i);for(let v of e_t(m,r,n,d,f,jEt()))a.push(v);for(o+=h.diffA,l+=h.diffB;up&&v.fromB+l>g)break;u++}}return a}const i_t={scanLimit:500},ZK=ws.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=l_t(t))}update(t){(t.docChanged||t.viewportChanged||p1n(t.startState,t.state)||g1n(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=l_t(t.view))}},{decorations:t=>t.deco}),JK=Fd.low(d2e({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(ZK))===null||e===void 0?void 0:e.gutter)||Zn.empty}}));function p1n(t,e){return t.field(Bu,!1)!=e.field(Bu,!1)}function g1n(t,e){return t.facet(zh)!=e.facet(zh)}const a_t=Ar.line({class:"cm-changedLine"}),s_t=Ar.mark({class:"cm-changedText"}),m1n=Ar.mark({tagName:"ins",class:"cm-insertedLine"}),v1n=Ar.mark({tagName:"del",class:"cm-deletedLine"}),o_t=new class extends ip{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function y1n(t,e,r,n,i,a){let s=r?t.fromA:t.fromB,o=r?t.toA:t.toB,l=0;if(s!=o){i.add(s,s,a_t),i.add(s,o,r?v1n:m1n),a&&a.add(s,s,o_t);for(let u=e.iterRange(s,o-1),h=s;!u.next().done;){if(u.lineBreak){h++,i.add(h,h,a_t),a&&a.add(h,h,o_t);continue}let d=h+u.value.length;if(n)for(;l=h)break;(s?d.toA:d.toB)>u&&(!a||!a(t.state,d,o,l))&&y1n(d,t.state.doc,s,n,o,l)}return{deco:o.finish(),gutter:l&&l.finish()}}class eZ extends Iu{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const tZ=nn.define({map:(t,e)=>t.map(e)}),B$=Vs.define({create:()=>Ar.none,update:(t,e)=>{for(let r of e.effects)if(r.is(tZ))return r.value;return t.map(e.changes)},provide:t=>er.decorations.from(t)}),rZ=.01;function c_t(t,e){if(t.size!=e.size)return!1;let r=t.iter(),n=e.iter();for(;r.value;){if(r.from!=n.from||Math.abs(r.value.spec.widget.height-n.value.spec.widget.height)>1)return!1;r.next(),n.next()}return!0}function b1n(t,e,r){let n=new Lu,i=new Lu,a=t.state.field(B$).iter(),s=e.state.field(B$).iter(),o=0,l=0,u=0,h=0,d=t.viewport,f=e.viewport;for(let v=0;;v++){let y=vrZ&&(h+=T,i.add(l,l,Ar.widget({widget:new eZ(T),block:!0,side:-1})))}if(b>o+1e3&&od.from&&lf.from){let w=Math.min(d.from-o,f.from-l);o+=w,l+=w,v--}else if(y)o=y.toA,l=y.toB;else break;for(;a.value&&a.fromrZ&&i.add(e.state.doc.length,e.state.doc.length,Ar.widget({widget:new eZ(p),block:!0,side:1}));let g=n.finish(),m=i.finish();c_t(g,t.state.field(B$))||t.dispatch({effects:tZ.of(g)}),c_t(m,e.state.field(B$))||e.dispatch({effects:tZ.of(m)})}const vAe=nn.define({map:(t,e)=>e.mapPos(t)});class x1n extends Iu{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let r=document.createElement("div");return r.className="cm-collapsedLines",r.textContent=e.state.phrase("$ unchanged lines",this.lines),r.addEventListener("click",n=>{let i=e.posAtDOM(n.target);e.dispatch({effects:vAe.of(i)});let{side:a,sibling:s}=e.state.facet(zh);s&&s().dispatch({effects:vAe.of(w1n(i,e.state.field(Bu),a=="a"))})}),r}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function w1n(t,e,r){let n=0,i=0;for(let a=0;;a++){let s=a=t)return i+(t-n);[n,i]=r?[s.toA,s.toB]:[s.toB,s.toA]}}const A1n=Vs.define({create(t){return Ar.none},update(t,e){t=t.map(e.changes);for(let r of e.effects)r.is(vAe)&&(t=t.update({filter:n=>n!=r.value}));if(t.size&&e.state.field(Bu)!=e.startState.field(Bu,!1)){let r=e.state.facet(zh).side=="a",n=[];for(let i of e.state.field(Bu))t.between(r?i.fromA:i.fromB,r?i.toA:i.toB,a=>{n.push(a)});n.length&&(t=t.update({filter:i=>n.indexOf(i)<0}))}return t},provide:t=>er.decorations.from(t)});function yAe({margin:t=3,minSize:e=4}){return A1n.init(r=>T1n(r,t,e))}function T1n(t,e,r){let n=new Lu,i=t.facet(zh).side=="a",a=t.field(Bu),s=1;for(let o=0;;o++){let l=o=r&&n.add(t.doc.line(u).from,t.doc.line(h).to,Ar.replace({widget:new x1n(d),block:!0})),!l)break;s=t.doc.lineAt(Math.min(t.doc.length,i?l.toA:l.toB)).number}return n.finish()}const S1n=er.styleModule.of(new Gy({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),u_t=er.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),h_t=new l4,nZ=new l4;class C1n{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||i_t;let r=[Fd.low(ZK),u_t,S1n,B$,er.updateListener.of(d=>{this.measuring<0&&(d.heightChanged||d.viewportChanged)&&!d.transactions.some(f=>f.effects.some(p=>p.is(tZ)))&&this.measure()})],n=[zh.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&n.push(JK);let i=Kn.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],er.editorAttributes.of({class:"cm-merge-a"}),nZ.of(n),r]}),a=[zh.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&a.push(JK);let s=Kn.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],er.editorAttributes.of({class:"cm-merge-b"}),nZ.of(a),r]});this.chunks=o1.build(i.doc,s.doc,this.diffConf);let o=[Bu.init(()=>this.chunks),h_t.of(e.collapseUnchanged?yAe(e.collapseUnchanged):[])];i=i.update({effects:nn.appendConfig.of(o)}).state,s=s.update({effects:nn.appendConfig.of(o)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let l=e.orientation||"a-b",u=document.createElement("div");u.className="cm-mergeViewEditor";let h=document.createElement("div");h.className="cm-mergeViewEditor",this.editorDOM.appendChild(l=="a-b"?u:h),this.editorDOM.appendChild(l=="a-b"?h:u),this.a=new er({state:i,parent:u,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.a)}),this.b=new er({state:s,parent:h,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,r){if(e.some(n=>n.docChanged)){let n=e[e.length-1],i=e.reduce((s,o)=>s.compose(o.changes),co.empty(e[0].startState.doc.length));this.chunks=r==this.a?o1.updateA(this.chunks,n.newDoc,this.b.state.doc,i,this.diffConf):o1.updateB(this.chunks,this.a.state.doc,n.newDoc,i,this.diffConf),r.update([...e,n.state.update({effects:mAe.of(this.chunks)})]);let a=r==this.a?this.b:this.a;a.update([a.state.update({effects:mAe.of(this.chunks)})]),this.scheduleMeasure()}else r.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let a=e.orientation!="b-a";if(a!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let s=this.a.dom.parentNode,o=this.b.dom.parentNode;s.remove(),o.remove(),this.editorDOM.insertBefore(a?s:o,this.editorDOM.firstChild),this.editorDOM.appendChild(a?o:s),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let a=!!this.revertDOM,s=this.revertToA,o=this.renderRevert;"revertControls"in e&&(a=!!e.revertControls,s=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(o=e.renderRevertControl),this.setupRevertControls(a,s,o)}let r="highlightChanges"in e,n="gutter"in e,i="collapseUnchanged"in e;if(r||n||i){let a=[],s=[];if(r||n){let o=this.a.state.facet(zh),l=n?e.gutter!==!1:o.markGutter,u=r?e.highlightChanges!==!1:o.highlightChanges;a.push(nZ.reconfigure([zh.of({side:"a",sibling:()=>this.b,highlightChanges:u,markGutter:l}),l?JK:[]])),s.push(nZ.reconfigure([zh.of({side:"b",sibling:()=>this.a,highlightChanges:u,markGutter:l}),l?JK:[]]))}if(i){let o=h_t.reconfigure(e.collapseUnchanged?yAe(e.collapseUnchanged):[]);a.push(o),s.push(o)}this.a.dispatch({effects:a}),this.b.dispatch({effects:s})}this.scheduleMeasure()}setupRevertControls(e,r,n){this.revertToA=r,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=n,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",i=>this.revertClicked(i)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){b1n(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,r=e.firstChild,n=this.a.viewport,i=this.b.viewport;for(let a=0;an.to||s.fromB>i.to)break;if(s.fromA-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function d_t(t){let e=t.nextSibling;return t.remove(),e}const O1n=new class extends ip{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},k1n=Fd.low(d2e({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(ZK))===null||e===void 0?void 0:e.gutter)||Zn.empty},widgetMarker:(t,e)=>e instanceof p_t?O1n:null}));function E1n(t){var e;let r=typeof t.original=="string"?vi.of(t.original.split(/\r?\n/)):t.original,n=t.diffConfig||i_t;return[Fd.low(ZK),L1n,u_t,er.editorAttributes.of({class:"cm-merge-b"}),KEt.of((i,a)=>{let s=a.effects.find(o=>o.is(bAe));return s&&(i=o1.updateA(i,s.value.doc,a.startState.doc,s.value.changes,n)),a.docChanged&&(i=o1.updateB(i,a.state.field(U4),a.newDoc,a.changes,n)),i}),zh.of({highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1,syntaxHighlightDeletions:t.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:(e=t.mergeControls)!==null&&e!==void 0?e:!0,overrideChunk:N1n,side:"b"}),U4.init(()=>r),t.gutter!==!1?k1n:[],t.collapseUnchanged?yAe(t.collapseUnchanged):[],Bu.init(i=>o1.build(r,i.doc,n))]}const bAe=nn.define(),U4=Vs.define({create:()=>vi.empty,update(t,e){for(let r of e.effects)r.is(bAe)&&(t=r.value.doc);return t}}),f_t=new WeakMap;class p_t extends Iu{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||(this.dom=this.buildDOM(e))}}function _1n(t,e,r){let n=f_t.get(e.changes);if(n)return n;let i=s=>{let{highlightChanges:o,syntaxHighlightDeletions:l,syntaxHighlightDeletionsMaxLength:u,mergeControls:h}=t.facet(zh),d=document.createElement("div");if(d.className="cm-deletedChunk",h){let w=d.appendChild(document.createElement("div"));w.className="cm-chunkButtons";let A=S=>{S.preventDefault(),R1n(s,s.posAtDOM(d))},T=S=>{S.preventDefault(),D1n(s,s.posAtDOM(d))};if(typeof h=="function")w.appendChild(h("accept",A)),w.appendChild(h("reject",T));else{let S=w.appendChild(document.createElement("button"));S.name="accept",S.textContent=t.phrase("Accept"),S.onmousedown=A;let O=w.appendChild(document.createElement("button"));O.name="reject",O.textContent=t.phrase("Reject"),O.onmousedown=T}}if(r||e.fromA>=e.toA)return d;let f=s.state.field(U4).sliceString(e.fromA,e.endA),p=l&&t.facet(Xy),g=b(),m=e.changes,v=0,y=!1;function b(){let w=d.appendChild(document.createElement("div"));return w.className="cm-deletedLine",w.appendChild(document.createElement("del"))}function x(w,A,T){for(let S=w;S-1&&_S){let I=document.createTextNode(f.slice(S,O));if(k){let L=g.appendChild(document.createElement("span"));L.className=k,L.appendChild(I)}else g.appendChild(I);S=O}E&&(y=!y)}}if(p&&e.toA-e.fromA<=u){let w=p.parser.parse(f),A=0;GTt(w,{style:T=>hhn(t,T)},(T,S,O)=>{T>A&&x(A,T,""),x(T,S,O),A=S}),x(A,f.length,"")}else x(0,f.length,"");return g.firstChild||g.appendChild(document.createElement("br")),d},a=Ar.widget({block:!0,side:-1,widget:new p_t(i)});return f_t.set(e.changes,a),a}function R1n(t,e){let{state:r}=t,n=e??r.selection.main.head,i=t.state.field(Bu).find(l=>l.fromB<=n&&l.endB>=n);if(!i)return!1;let a=t.state.sliceDoc(i.fromB,Math.max(i.fromB,i.toB-1)),s=t.state.field(U4);i.fromB!=i.toB&&i.toA<=s.length&&(a+=t.state.lineBreak);let o=co.of({from:i.fromA,to:Math.min(s.length,i.toA),insert:a},s.length);return t.dispatch({effects:bAe.of({doc:o.apply(s),changes:o}),userEvent:"accept"}),!0}function D1n(t,e){let{state:r}=t,n=e??r.selection.main.head,i=r.field(Bu).find(o=>o.fromB<=n&&o.endB>=n);if(!i)return!1;let s=r.field(U4).sliceString(i.fromA,Math.max(i.fromA,i.toA-1));return i.fromA!=i.toA&&i.toB<=r.doc.length&&(s+=r.lineBreak),t.dispatch({changes:{from:i.fromB,to:Math.min(r.doc.length,i.toB),insert:s},userEvent:"revert"}),!0}function g_t(t){let e=new Lu;for(let r of t.field(Bu)){let n=t.facet(zh).overrideChunk&&v_t(t,r);e.add(r.fromB,r.fromB,_1n(t,r,!!n))}return e.finish()}const L1n=Vs.define({create:t=>g_t(t),update(t,e){return e.state.field(Bu,!1)!=e.startState.field(Bu,!1)?g_t(e.state):t},provide:t=>er.decorations.from(t)}),m_t=new WeakMap;function v_t(t,e){let r=m_t.get(e);if(r!==void 0)return r;r=null;let n=t.field(U4),i=t.doc,a=n.lineAt(e.endA).number-n.lineAt(e.fromA).number+1,s=i.lineAt(e.endB).number-i.lineAt(e.fromB).number+1;e:if(a==s&&a<10){let o=[],l=0,u=e.fromA,h=e.fromB;for(let d of e.changes){if(d.fromA=e.endB)break;s=t.doc.lineAt(s.to+1)}return!0}const y_t="(max-width: 760px)";function B1n(){const[t,e]=se.useState(()=>typeof window<"u"&&window.matchMedia(y_t).matches);return se.useEffect(()=>{const r=window.matchMedia(y_t),n=()=>e(r.matches);return n(),r.addEventListener("change",n),()=>r.removeEventListener("change",n)},[]),t}function b_t(t,e){return[iAe({lineNumbers:!0,foldGutter:!0,highlightActiveLine:!1,highlightActiveLineGutter:!1,autocompletion:!1}),...XK(t),Kn.readOnly.of(!0),...e==="dark"?[REt]:[]]}function $1n({before:t,after:e,path:r,theme:n}){const i=se.useRef(null);return se.useEffect(()=>{if(!i.current)return;const a=new C1n({a:{doc:t,extensions:b_t(r,n)},b:{doc:e,extensions:b_t(r,n)},parent:i.current,highlightChanges:!0,gutter:!0,collapseUnchanged:{margin:3,minSize:6},diffConfig:{scanLimit:2e3,timeout:1e3}});return()=>a.destroy()},[e,t,r,n]),W.jsx("div",{ref:i,className:"code-browser-merge"})}function F1n(t){return B1n()?W.jsx(cAe,{value:t.after,height:"100%",theme:t.theme,editable:!1,extensions:[...XK(t.path),...E1n({original:t.before,highlightChanges:!0,gutter:!0,mergeControls:!1,collapseUnchanged:{margin:3,minSize:6},diffConfig:{scanLimit:2e3,timeout:1e3}})],basicSetup:{lineNumbers:!0,foldGutter:!0,highlightActiveLine:!1,highlightActiveLineGutter:!1,autocompletion:!1}}):W.jsx($1n,{...t})}const z1n=Object.freeze(Object.defineProperty({__proto__:null,default:F1n},Symbol.toStringTag,{value:"Module"}));class Zt extends Error{constructor(e,r){var n="KaTeX parse error: "+e,i,a,s=r&&r.loc;if(s&&s.start<=s.end){var o=s.lexer.input;i=s.start,a=s.end,i===o.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var l=o.slice(i,a).replace(/[^]/g,"$&̲"),u;i>15?u="…"+o.slice(i-15,i):u=o.slice(0,i);var h;a+15t.replace(U1n,"-$1").toLowerCase(),Q1n={"&":"&",">":">","<":"<",'"':""","'":"'"},G1n=/[&><"']/g,tu=t=>String(t).replace(G1n,e=>Q1n[e]),iZ=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?iZ(t.body[0]):t:t.type==="font"?iZ(t.body):t,H1n=new Set(["mathord","textord","atom"]),l1=t=>H1n.has(iZ(t).type),W1n=t=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},aZ={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:t=>Math.max(0,t),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:t=>Math.max(0,t),cli:"-e, --max-expand ",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function Y1n(t){if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function q1n(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return Y1n(e)}function j1n(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:q1n(n)}class xAe{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var r of Object.keys(aZ)){var n=aZ[r];n&&j1n(this,r,e,n)}}reportNonstrict(e,r,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,r,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new Zt("LaTeX-incompatible input and strict mode is set to 'error': "+(r+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]"))}}useStrictBehavior(e,r,n){var i=this.strict;if(typeof i=="function")try{i=i(e,r,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]")),!1)}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var r=W1n(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class g2{constructor(e,r,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=r,this.cramped=n}sup(){return w0[X1n[this.id]]}sub(){return w0[K1n[this.id]]}fracNum(){return w0[Z1n[this.id]]}fracDen(){return w0[J1n[this.id]]}cramp(){return w0[ebn[this.id]]}text(){return w0[tbn[this.id]]}isTight(){return this.size>=2}}var wAe=0,sZ=1,V4=2,c1=3,$$=4,cp=5,Q4=6,$u=7,w0=[new g2(wAe,0,!1),new g2(sZ,0,!0),new g2(V4,1,!1),new g2(c1,1,!0),new g2($$,2,!1),new g2(cp,2,!0),new g2(Q4,3,!1),new g2($u,3,!0)],X1n=[$$,cp,$$,cp,Q4,$u,Q4,$u],K1n=[cp,cp,cp,cp,$u,$u,$u,$u],Z1n=[V4,c1,$$,cp,Q4,$u,Q4,$u],J1n=[c1,c1,cp,cp,$u,$u,$u,$u],ebn=[sZ,sZ,c1,c1,cp,cp,$u,$u],tbn=[wAe,sZ,V4,c1,V4,c1,V4,c1],In={DISPLAY:w0[wAe],TEXT:w0[V4],SCRIPT:w0[$$],SCRIPTSCRIPT:w0[Q4]},AAe=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function rbn(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var oZ=[];AAe.forEach(t=>t.blocks.forEach(e=>oZ.push(...e)));function x_t(t){for(var e=0;e=oZ[e]&&t<=oZ[e+1])return!0;return!1}var el=t=>t+" "+t,G4=80,nbn=function(e,r){return"M95,"+(622+e+r)+` +`);n=i<0?r:r.slice(0,i)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,r,n=0){this.block=xK.create(e,n,this.lineStart+r,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,r,n=0){this.startContext(this.parser.getNodeType(e),r,n)}addNode(e,r,n){typeof e=="number"&&(e=new si(this.parser.nodeSet.types[e],_4,_4,(n??this.prevLineEnd())-r)),this.block.addChild(e,r-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,r){this.addNode(this.buffer.writeElements(awe(r.children,e.marks),-r.from).finish(r.type,r.to-r.from),r.from)}finishContext(){let e=this.stack.pop(),r=this.stack[this.stack.length-1];r.addChild(e.toTree(this.parser.nodeSet),e.from-r.from),this.block=r}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?CCt(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let n of e.parsers)if(n.finish(this,e))return;let r=awe(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(r,-e.start).finish(nr.Paragraph,e.content.length),e.start)}elt(e,r,n,i){return typeof e=="string"?Ei(this.parser.getNodeType(e),r,n,i):new ECt(e,r)}get buffer(){return new kCt(this.parser.nodeSet)}}function CCt(t,e,r,n,i){let a=t[e].to,s=[],o=[],l=r.from+n;function u(h,d){for(;d?h>=a:h>a;){let f=t[e+1].from-a;n+=f,h+=f,e++,a=t[e].to}}for(let h=r.firstChild;h;h=h.nextSibling){u(h.from+n,!0);let d=h.from+n,f,p=i.get(h.tree);p?f=p:h.to+n>a?(f=CCt(t,e,h,n,i),u(h.to+n,!1)):f=h.toTree(),s.push(f),o.push(d-l)}return u(r.to+n,!1),new si(r.type,s,o,r.to+n-l,r.tree?r.tree.propValues:void 0)}class AK extends mX{constructor(e,r,n,i,a,s,o,l,u){super(),this.nodeSet=e,this.blockParsers=r,this.leafBlockParsers=n,this.blockNames=i,this.endLeafBlock=a,this.skipContextMarkup=s,this.inlineParsers=o,this.inlineNames=l,this.wrappers=u,this.nodeTypes=Object.create(null);for(let h of e.types)this.nodeTypes[h.name]=h.id}createParse(e,r,n){let i=new Cfn(this,e,r,n);for(let a of this.wrappers)i=a(i,e,r,n);return i}configure(e){let r=rwe(e);if(!r)return this;let{nodeSet:n,skipContextMarkup:i}=this,a=this.blockParsers.slice(),s=this.leafBlockParsers.slice(),o=this.blockNames.slice(),l=this.inlineParsers.slice(),u=this.inlineNames.slice(),h=this.endLeafBlock.slice(),d=this.wrappers;if(b$(r.defineNodes)){i=Object.assign({},i);let f=n.types.slice(),p;for(let g of r.defineNodes){let{name:m,block:v,composite:y,style:b}=typeof g=="string"?{name:g}:g;if(f.some(A=>A.name==m))continue;y&&(i[f.length]=(A,S,T)=>y(S,T,A.value));let x=f.length,w=y?["Block","BlockContext"]:v?x>=nr.ATXHeading1&&x<=nr.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;f.push(Ro.define({id:x,name:m,props:w&&[[En.group,w]]})),b&&(p||(p={}),Array.isArray(b)||b instanceof p0?p[m]=b:Object.assign(p,b))}n=new s4(f),p&&(n=n.extend(qy(p)))}if(b$(r.props)&&(n=n.extend(...r.props)),b$(r.remove))for(let f of r.remove){let p=this.blockNames.indexOf(f),g=this.inlineNames.indexOf(f);p>-1&&(a[p]=s[p]=void 0),g>-1&&(l[g]=void 0)}if(b$(r.parseBlock))for(let f of r.parseBlock){let p=o.indexOf(f.name);if(p>-1)a[p]=f.parse,s[p]=f.leaf;else{let g=f.before?SK(o,f.before):f.after?SK(o,f.after)+1:o.length-1;a.splice(g,0,f.parse),s.splice(g,0,f.leaf),o.splice(g,0,f.name)}f.endLeaf&&h.push(f.endLeaf)}if(b$(r.parseInline))for(let f of r.parseInline){let p=u.indexOf(f.name);if(p>-1)l[p]=f.parse;else{let g=f.before?SK(u,f.before):f.after?SK(u,f.after)+1:u.length-1;l.splice(g,0,f.parse),u.splice(g,0,f.name)}}return r.wrap&&(d=d.concat(r.wrap)),new AK(n,a,s,o,h,i,l,u,d)}getNodeType(e){let r=this.nodeTypes[e];if(r==null)throw new RangeError(`Unknown node type '${e}'`);return r}parseInline(e,r){let n=new iwe(this,e,r);e:for(let i=r;i=0){i=o;continue e}}i++}return n.resolveMarkers(0)}}function b$(t){return t!=null&&t.length>0}function rwe(t){if(!Array.isArray(t))return t;if(t.length==0)return null;let e=rwe(t[0]);if(t.length==1)return e;let r=rwe(t.slice(1));if(!r||!e)return e||r;let n=(s,o)=>(s||_4).concat(o||_4),i=e.wrap,a=r.wrap;return{props:n(e.props,r.props),defineNodes:n(e.defineNodes,r.defineNodes),parseBlock:n(e.parseBlock,r.parseBlock),parseInline:n(e.parseInline,r.parseInline),remove:n(e.remove,r.remove),wrap:i?a?(s,o,l,u)=>i(a(s,o,l,u),o,l,u):i:a}}function SK(t,e){let r=t.indexOf(e);if(r<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return r}let OCt=[Ro.none];for(let t=1,e;e=nr[t];t++)OCt[t]=Ro.define({id:t,name:e,props:t>=nr.Escape?[]:[[En.group,t in fCt?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const _4=[];let kCt=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,r,n,i=0){return this.content.push(e,r,n,4+i*4),this}writeElements(e,r=0){for(let n of e)n.writeTo(this,r);return this}finish(e,r){return si.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:r})}},x$=class{constructor(e,r,n,i=_4){this.type=e,this.from=r,this.to=n,this.children=i}writeTo(e,r){let n=e.content.length;e.writeElements(this.children,r),e.content.push(this.type,this.from+r,this.to+r,e.content.length+4-n)}toTree(e){return new kCt(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class ECt{constructor(e,r){this.tree=e,this.from=r}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return _4}writeTo(e,r){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+r,this.to+r,-1)}toTree(){return this.tree}}function Ei(t,e,r,n){return new x$(t,e,r,n)}const _Ct={resolve:"Emphasis",mark:"EmphasisMark"},RCt={resolve:"Emphasis",mark:"EmphasisMark"},jT={},TK={};class Qd{constructor(e,r,n,i){this.type=e,this.from=r,this.to=n,this.side=i}}const DCt="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let w$=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{w$=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const nwe={Escape(t,e,r){if(e!=92||r==t.end-1)return-1;let n=t.char(r+1);for(let i=0;i]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(n);if(i)return t.append(Ei(nr.Autolink,r,r+1+i[0].length,[Ei(nr.LinkMark,r,r+1),Ei(nr.URL,r+1,r+i[0].length),Ei(nr.LinkMark,r+i[0].length,r+1+i[0].length)]));let a=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(n);if(a)return t.append(Ei(nr.Comment,r,r+1+a[0].length));let s=/^\?[^]*?\?>/.exec(n);if(s)return t.append(Ei(nr.ProcessingInstruction,r,r+1+s[0].length));let o=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(n);return o?t.append(Ei(nr.HTMLTag,r,r+1+o[0].length)):-1},Emphasis(t,e,r){if(e!=95&&e!=42)return-1;let n=r+1;for(;t.char(n)==e;)n++;let i=t.slice(r-1,r),a=t.slice(n,n+1),s=w$.test(i),o=w$.test(a),l=/\s|^$/.test(i),u=/\s|^$/.test(a),h=!u&&(!o||l||s),d=!l&&(!s||u||o),f=h&&(e==42||!d||s),p=d&&(e==42||!h||o);return t.append(new Qd(e==95?_Ct:RCt,r,n,(f?1:0)|(p?2:0)))},HardBreak(t,e,r){if(e==92&&t.char(r+1)==10)return t.append(Ei(nr.HardBreak,r,r+2));if(e==32){let n=r+1;for(;t.char(n)==32;)n++;if(t.char(n)==10&&n>=r+2)return t.append(Ei(nr.HardBreak,r,n+1))}return-1},Link(t,e,r){return e==91?t.append(new Qd(jT,r,r+1,1)):-1},Image(t,e,r){return e==33&&t.char(r+1)==91?t.append(new Qd(TK,r,r+2,1)):-1},LinkEnd(t,e,r){if(e!=93)return-1;for(let n=t.parts.length-1;n>=0;n--){let i=t.parts[n];if(i instanceof Qd&&(i.type==jT||i.type==TK)){if(!i.side||t.skipSpace(i.to)==r&&!/[(\[]/.test(t.slice(r+1,r+2)))return t.parts[n]=null,-1;let a=t.takeContent(n),s=t.parts[n]=Ofn(t,a,i.type==jT?nr.Link:nr.Image,i.from,r+1);if(i.type==jT)for(let o=0;oe?Ei(nr.URL,e+r,a+r):a==t.length?null:!1}}function MCt(t,e,r){let n=t.charCodeAt(e);if(n!=39&&n!=34&&n!=40)return!1;let i=n==40?41:n;for(let a=e+1,s=!1;a=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,r){return this.text.slice(e-this.offset,r-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,r,n,i,a){return this.append(new Qd(e,r,n,(i?1:0)|(a?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let r=this.parts[e];if(r instanceof Qd&&(r.type==jT||r.type==TK))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let n=e;n=e;l--){let m=this.parts[l];if(m instanceof Qd&&m.side&1&&m.type==i.type&&!(a&&(i.side&1||m.side&2)&&(m.to-m.from+s)%3==0&&((m.to-m.from)%3||s%3))){o=m;break}}if(!o)continue;let u=i.type.resolve,h=[],d=o.from,f=i.to;if(a){let m=Math.min(2,o.to-o.from,s);d=o.to-m,f=i.from+m,u=m==1?"Emphasis":"StrongEmphasis"}o.type.mark&&h.push(this.elt(o.type.mark,d,o.to));for(let m=l+1;m=0;r--){let n=this.parts[r];if(n instanceof Qd&&n.type==e&&n.side&1)return r}return null}takeContent(e){let r=this.resolveMarkers(e);return this.parts.length=e,r}getDelimiterAt(e){let r=this.parts[e];return r instanceof Qd?r:null}skipSpace(e){return y$(this.text,e-this.offset)+this.offset}elt(e,r,n,i){return typeof e=="string"?Ei(this.parser.getNodeType(e),r,n,i):new ECt(e,r)}}iwe.linkStart=jT,iwe.imageStart=TK;function awe(t,e){if(!e.length)return t;if(!t.length)return e;let r=t.slice(),n=0;for(let i of e){for(;n(e?e-1:0))return!1;if(this.fragmentEnd<0){let a=this.fragment.to;for(;a>0&&this.input.read(a-1,a)!=` +`;)a--;this.fragmentEnd=a?a-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let i=e+this.fragment.offset;for(;n.to<=i;)if(!n.parent())return!1;for(;;){if(n.from>=i)return this.fragment.from<=r;if(!n.childAfter(i))return!1}}matches(e){let r=this.cursor.tree;return r&&r.prop(En.contextHash)==e}takeNodes(e){let r=this.cursor,n=this.fragment.offset,i=this.fragmentEnd-(this.fragment.openEnd?1:0),a=e.absoluteLineStart,s=a,o=e.block.children.length,l=s,u=o;for(;;){if(r.to-n>i){if(r.type.isAnonymous&&r.firstChild())continue;break}let h=PCt(r.from-n,e.ranges);if(r.to-n<=e.ranges[e.rangeI].to)e.addNode(r.tree,h);else{let d=new si(e.parser.nodeSet.types[nr.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(d,r.tree),e.addNode(d,h)}if(r.type.is("Block")&&(kfn.indexOf(r.type.id)<0?(s=r.to-n,o=e.block.children.length):(s=l,o=u),l=r.to-n,u=e.block.children.length),!r.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return s-a}}function PCt(t,e){let r=t;for(let n=1;nwK[t]),Object.keys(wK).map(t=>TCt[t]),Object.keys(wK),Sfn,fCt,Object.keys(nwe).map(t=>nwe[t]),Object.keys(nwe),[]);function Dfn(t,e,r){let n=[];for(let i=t.firstChild,a=e;;i=i.nextSibling){let s=i?i.from:r;if(s>a&&n.push({from:a,to:s}),!i)break;a=i.to}return n}function Lfn(t){let{codeParser:e,htmlParser:r}=t;return{wrap:uwt((i,a)=>{let s=i.type.id;if(e&&(s==nr.CodeBlock||s==nr.FencedCode)){let o="";if(s==nr.FencedCode){let u=i.node.getChild(nr.CodeInfo);u&&(o=a.read(u.from,u.to))}let l=e(o);if(l)return{parser:l,overlay:u=>u.type.id==nr.CodeText,bracketed:s==nr.FencedCode}}else if(r&&(s==nr.HTMLBlock||s==nr.HTMLTag||s==nr.CommentBlock))return{parser:r,overlay:Dfn(i.node,i.from,i.to)};return null})}}const Mfn={resolve:"Strikethrough",mark:"StrikethroughMark"},Ifn={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":Ee.strikethrough}},{name:"StrikethroughMark",style:Ee.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,e,r){if(e!=126||t.char(r+1)!=126||t.char(r+2)==126)return-1;let n=t.slice(r-1,r),i=t.slice(r+2,r+3),a=/\s|^$/.test(n),s=/\s|^$/.test(i),o=w$.test(n),l=w$.test(i);return t.addDelimiter(Mfn,r,r+2,!s&&(!l||a||o),!a&&(!o||s||l))},after:"Emphasis"}]};function A$(t,e,r=0,n,i=0){let a=0,s=!0,o=-1,l=-1,u=!1,h=()=>{n.push(t.elt("TableCell",i+o,i+l,t.parser.parseInline(e.slice(o,l),i+o)))};for(let d=r;d-1)&&a++,s=!1,n&&(o>-1&&h(),n.push(t.elt("TableDelimiter",d+i,d+i+1))),o=l=-1):(u||f!=32&&f!=9)&&(o<0&&(o=d),l=d+1),u=!u&&f==92}return o>-1&&(a++,n&&h()),a}function NCt(t,e){for(let r=e;r\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class $Ct{constructor(){this.rows=null}nextLine(e,r,n){if(this.rows==null){this.rows=!1;let i;if((r.next==45||r.next==58||r.next==124)&&BCt.test(i=r.text.slice(r.pos))){let a=[];A$(e,n.content,0,a,n.start)==A$(e,i,0)&&(this.rows=[e.elt("TableHeader",n.start,n.start+n.content.length,a),e.elt("TableDelimiter",e.lineStart+r.pos,e.lineStart+r.text.length)])}}else if(this.rows){let i=[];A$(e,r.text,r.pos,i,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+r.pos,e.lineStart+r.text.length,i))}return!1}finish(e,r){return this.rows?(e.addLeafElement(r,e.elt("Table",r.start,r.start+r.content.length,this.rows)),!0):!1}}const Pfn={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":Ee.heading}},"TableRow",{name:"TableCell",style:Ee.content},{name:"TableDelimiter",style:Ee.processingInstruction}],parseBlock:[{name:"Table",leaf(t,e){return NCt(e.content,0)?new $Ct:null},endLeaf(t,e,r){if(r.parsers.some(i=>i instanceof $Ct)||!NCt(e.text,e.basePos))return!1;let n=t.peekLine();return BCt.test(n)&&A$(t,e.text,e.basePos)==A$(t,n,e.basePos)},before:"SetextHeading"}]};class Nfn{nextLine(){return!1}finish(e,r){return e.addLeafElement(r,e.elt("Task",r.start,r.start+r.content.length,[e.elt("TaskMarker",r.start,r.start+3),...e.parser.parseInline(r.content.slice(3),r.start+3)])),!0}}const Bfn={defineNodes:[{name:"Task",block:!0,style:Ee.list},{name:"TaskMarker",style:Ee.atom}],parseBlock:[{name:"TaskList",leaf(t,e){return/^\[[ xX]\][ \t]/.test(e.content)&&t.parentType().name=="ListItem"?new Nfn:null},after:"SetextHeading"}]},FCt=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,zCt=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,$fn=/[\w-]+\.[\w-]+($|[/:])/,UCt=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,VCt=/\/[a-zA-Z\d@.]+/gy;function QCt(t,e,r,n){let i=0;for(let a=e;a-1)return-1;let n=e+r[0].length;for(;;){let i=t[n-1],a;if(/[?!.,:*_~]/.test(i)||i==")"&&QCt(t,e,n,")")>QCt(t,e,n,"("))n--;else if(i==";"&&(a=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(e,n))))n=e+a.index;else break}return n}function GCt(t,e){UCt.lastIndex=e;let r=UCt.exec(t);if(!r)return-1;let n=r[0][r[0].length-1];return n=="_"||n=="-"?-1:e+r[0].length-(n=="."?1:0)}const zfn=[Pfn,Bfn,Ifn,{parseInline:[{name:"Autolink",parse(t,e,r){let n=r-t.offset;if(n&&/\w/.test(t.text[n-1]))return-1;FCt.lastIndex=n;let i=FCt.exec(t.text),a=-1;if(!i)return-1;if(i[1]||i[2]){if(a=Ffn(t.text,n+i[0].length),a>-1&&t.hasOpenLink){let s=/([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(n,a));a=n+s[0].length}}else i[3]?a=GCt(t.text,n):(a=GCt(t.text,n+i[0].length),a>-1&&i[0]=="xmpp:"&&(VCt.lastIndex=a,i=VCt.exec(t.text),i&&(a=i.index+i[0].length)));return a<0?-1:(t.addElement(t.elt("URL",r,a+t.offset)),a+t.offset)}}]}];function HCt(t,e,r){return(n,i,a)=>{if(i!=t||n.char(a+1)==t)return-1;let s=[n.elt(r,a,a+1)];for(let o=a+1;o=65&&t<=90||t==95||t>=97&&t<=122||t>=161}let rOt=null,nOt=null,iOt=0;function cwe(t,e){let r=t.pos+e;if(iOt==r&&nOt==t)return rOt;let n=t.peek(e),i="";for(;fpn(n);)i+=String.fromCharCode(n),n=t.peek(++e);return nOt=t,iOt=r,rOt=i?i.toLowerCase():n==ppn||n==gpn?void 0:null}const aOt=60,CK=62,uwe=47,ppn=63,gpn=33,mpn=45;function sOt(t,e){this.name=t,this.parent=e}const vpn=[swe,XCt,YCt,qCt,jCt],ypn=new gK({start:null,shift(t,e,r,n){return vpn.indexOf(e)>-1?new sOt(cwe(n,1)||"",t):t},reduce(t,e){return e==ZCt&&t?t.parent:t},reuse(t,e,r,n){let i=e.type.id;return i==swe||i==opn?new sOt(cwe(n,1)||"",t):t},strict:!1}),bpn=new uo((t,e)=>{if(t.next!=aOt){t.next<0&&e.context&&t.acceptToken(owe);return}t.advance();let r=t.next==uwe;r&&t.advance();let n=cwe(t,0);if(n===void 0)return;if(!n)return t.acceptToken(r?tpn:epn);let i=e.context?e.context.name:null;if(r){if(n==i)return t.acceptToken(Kfn);if(i&&dpn[i])return t.acceptToken(owe,-2);if(e.dialectEnabled(cpn))return t.acceptToken(Zfn);for(let a=e.context;a;a=a.parent)if(a.name==n)return;t.acceptToken(Jfn)}else{if(n=="script")return t.acceptToken(YCt);if(n=="style")return t.acceptToken(qCt);if(n=="textarea")return t.acceptToken(jCt);if(hpn.hasOwnProperty(n))return t.acceptToken(XCt);i&&tOt[i]&&tOt[i][n]?t.acceptToken(owe,-1):t.acceptToken(swe)}},{contextual:!0}),xpn=new uo(t=>{for(let e=0,r=0;;r++){if(t.next<0){r&&t.acceptToken(KCt);break}if(t.next==mpn)e++;else if(t.next==CK&&e>=2){r>=3&&t.acceptToken(KCt,-2);break}else e=0;t.advance()}});function wpn(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}const Apn=new uo((t,e)=>{if(t.next==uwe&&t.peek(1)==CK){let r=e.dialectEnabled(upn)||wpn(e.context);t.acceptToken(r?Xfn:WCt,2)}else t.next==CK&&t.acceptToken(WCt,1)});function hwe(t,e,r){let n=2+t.length;return new uo(i=>{for(let a=0,s=0,o=0;;o++){if(i.next<0){o&&i.acceptToken(e);break}if(a==0&&i.next==aOt||a==1&&i.next==uwe||a>=2&&as?i.acceptToken(e,-s):i.acceptToken(r,-(s-2));break}else if((i.next==10||i.next==13)&&o){i.acceptToken(e,1);break}else a=s=0;i.advance()}})}const Spn=hwe("script",Gfn,Hfn),Tpn=hwe("style",Wfn,Yfn),Cpn=hwe("textarea",qfn,jfn),Opn=qy({"Text RawText IncompleteTag IncompleteCloseTag":Ee.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":Ee.angleBracket,TagName:Ee.tagName,"MismatchedCloseTag/TagName":[Ee.tagName,Ee.invalid],AttributeName:Ee.attributeName,"AttributeValue UnquotedAttributeValue":Ee.attributeValue,Is:Ee.definitionOperator,"EntityReference CharacterReference":Ee.character,Comment:Ee.blockComment,ProcessingInst:Ee.processingInstruction,DoctypeDecl:Ee.documentMeta}),kpn=Jy.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:ypn,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[Opn],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let u=o.type.id;if(u==ipn)return dwe(o,l,r);if(u==apn)return dwe(o,l,n);if(u==spn)return dwe(o,l,i);if(u==ZCt&&a.length){let h=o.node,d=h.firstChild,f=d&&lOt(d,l),p;if(f){for(let g of a)if(g.tag==f&&(!g.attrs||g.attrs(p||(p=oOt(d,l))))){let m=h.lastChild,v=m.type.id==lpn?m.from:h.to;if(v>d.to)return{parser:g.parser,overlay:[{from:d.to,to:v}]}}}}if(s&&u==JCt){let h=o.node,d;if(d=h.firstChild){let f=s[l.read(d.from,d.to)];if(f)for(let p of f){if(p.tagName&&p.tagName!=lOt(h.parent,l))continue;let g=h.lastChild;if(g.type.id==lwe){let m=g.from+1,v=g.lastChild,y=g.to-(v&&v.isError?0:1);if(y>m)return{parser:p.parser,overlay:[{from:m,to:y}],bracketed:!0}}else if(g.type.id==eOt)return{parser:p.parser,overlay:[{from:g.from,to:g.to}]}}}}return null})}const Epn=145,uOt=1,_pn=146,Rpn=147,hOt=2,Dpn=148,Lpn=3,Mpn=4,dOt=[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],Ipn=58,Ppn=40,fOt=95,Npn=91,OK=45,Bpn=46,$pn=35,Fpn=37,zpn=38,Upn=92,Vpn=10,Qpn=42;function S$(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function fwe(t){return t>=48&&t<=57}function pOt(t){return fwe(t)||t>=97&&t<=102||t>=65&&t<=70}const gOt=(t,e,r)=>(n,i)=>{for(let a=!1,s=0,o=0;;o++){let{next:l}=n;if(S$(l)||l==OK||l==fOt||a&&fwe(l))!a&&(l!=OK||o>0)&&(a=!0),s===o&&l==OK&&s++,n.advance();else if(l==Upn&&n.peek(1)!=Vpn){if(n.advance(),pOt(n.next)){do n.advance();while(pOt(n.next));n.next==32&&n.advance()}else n.next>-1&&n.advance();a=!0}else{a&&n.acceptToken(s==2&&i.canShift(hOt)?e:l==Ppn?r:t);break}}},Gpn=new uo(gOt(_pn,hOt,Rpn),{contextual:!0}),Hpn=new uo(gOt(Dpn,Lpn,Mpn),{contextual:!0}),Wpn=new uo(t=>{if(dOt.includes(t.peek(-1))){let{next:e}=t;(S$(e)||e==fOt||e==$pn||e==Bpn||e==Qpn||e==Npn||e==Ipn&&S$(t.peek(1))||e==OK||e==zpn)&&t.acceptToken(Epn)}}),Ypn=new uo(t=>{if(!dOt.includes(t.peek(-1))){let{next:e}=t;if(e==Fpn&&(t.advance(),t.acceptToken(uOt)),S$(e)){do t.advance();while(S$(t.next)||fwe(t.next));t.acceptToken(uOt)}}}),qpn=qy({"AtKeyword import charset namespace keyframes media supports font-feature-values":Ee.definitionKeyword,"from to selector scope MatchFlag":Ee.keyword,NamespaceName:Ee.namespace,KeyframeName:Ee.labelName,KeyframeRangeName:Ee.operatorKeyword,TagName:Ee.tagName,ClassName:Ee.className,PseudoClassName:Ee.constant(Ee.className),IdName:Ee.labelName,"FeatureName PropertyName":Ee.propertyName,AttributeName:Ee.attributeName,NumberLiteral:Ee.number,KeywordQuery:Ee.keyword,UnaryQueryOp:Ee.operatorKeyword,"CallTag ValueName FontName":Ee.atom,VariableName:Ee.variableName,Callee:Ee.operatorKeyword,Unit:Ee.unit,"UniversalSelector NestingSelector":Ee.definitionOperator,"MatchOp CompareOp":Ee.compareOperator,"ChildOp SiblingOp, LogicOp":Ee.logicOperator,BinOp:Ee.arithmeticOperator,Important:Ee.modifier,Comment:Ee.blockComment,ColorLiteral:Ee.color,"ParenthesizedContent StringLiteral":Ee.string,":":Ee.punctuation,"PseudoOp #":Ee.derefOperator,"; , |":Ee.separator,"( )":Ee.paren,"[ ]":Ee.squareBracket,"{ }":Ee.brace}),jpn={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:152,"url-prefix":152,domain:152,regexp:152},Xpn={__proto__:null,or:104,and:104,not:112,only:112,layer:206},Kpn={__proto__:null,selector:118,style:124,layer:202},Zpn={__proto__:null,"@import":198,"@media":210,"@charset":214,"@namespace":218,"@keyframes":224,"@supports":236,"@scope":240,"@font-feature-values":246},Jpn={__proto__:null,to:243},egn=Jy.deserialize({version:14,states:"MlQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FnO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#EOO'dQdO'#EQO'oQdO'#EXO'oQdO'#E[OOQP'#Fn'#FnO)RQhO'#E}OOQS'#Fm'#FmOOQS'#FQ'#FQQYQdOOO)YQdO'#EbO*iQhO'#EhO)YQdO'#EjO*pQdO'#ElO*{QdO'#EoO)}QhO'#EuO+TQdO'#EwO+`QdO'#EzO+eQaO'#CfO+lQ`O'#E_O+qQ`O'#F{O+|QdO'#F{QOQ`OOP,WO&jO'#CaPOOO)CA])CA]OOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,cQdO,59YO'_QdO,5:jO'dQdO,5:lO'oQdO,5:sO'oQdO,5:uO'oQdO,5:vO'oQdO'#FXO,nQ`O,58}O,vQdO'#E^OOQS,58},58}OOQP'#Cq'#CqOOQO'#D|'#D|OOQP,59Y,59YO,}Q`O,59YO-SQ`O,59YOOQP'#EP'#EPOOQP,5:j,5:jO-XQpO'#ERO-dQdO'#ESO-iQ`O'#ESO-nQpO,5:lO.XQaO,5:sO.oQaO,5:vOOQW'#D^'#D^O/nQhO'#DgO0RQhO,5;iO)}QhO'#DeO0`Q`O'#DnO0eQhO'#DxOOQW'#Ft'#FtOOQS,5;i,5;iO0jQ`O'#DhO0oQ`O'#DkOOQS-E9O-E9OOOQ['#Cv'#CvO0tQdO'#CwO1[QdO'#C}O1rQdO'#DQO2YQ!pO'#DSO4fQ!jO,5:|OOQO'#DX'#DXO-SQ`O'#DWO4vQ!nO'#FqO6|Q`O'#DYO7RQ`O'#DyOOQ['#Fq'#FqO7WQhO'#GOO7fQ`O,5;SO7kQ!bO,5;UOOQS'#En'#EnO7sQ`O,5;WO7xQdO,5;WOOQO'#Eq'#EqO8QQ`O,5;ZO8VQhO,5;aO'oQdO'#DjOOQS,5;c,5;cO0jQ`O,5;cO8_QdO,5;cOOQS'#F`'#F`O8gQdO'#E|O7fQ`O,5;fO8oQdO,5:yO9PQdO'#FZO9^Q`O,5lQhO'#DoOOQW,5:Y,5:YOOQW,5:d,5:dOOQW,5:S,5:SO>vQhO,5:VO?bQ!fO'#FrOOQS'#Fr'#FrOOQS'#FS'#FSO@rQdO,59cOOQ[,59c,59cOAYQdO,59iOOQ[,59i,59iOApQdO,59lOOQ[,59l,59lOOQ[,59n,59nO)YQdO,59pOBWQhO'#EdOOQW'#Ed'#EdOBuQ`O1G0hO4oQhO1G0hOOQ[,59r,59rO)}QhO'#D[OOQ[,59t,59tOBzQ#tO,5:eOCVQhO'#F]OCdQ`O,5vQhO'#DmOI_QhO'#DqOIgQhO'#DsOIlQhO'#FwOOQO'#Fw'#FwOItQ!bO'#DwOOQO'#Fy'#FyOOQO'#Fv'#FvOIyQ`O1G/qOOQS-E9Q-E9QOOQ[1G.}1G.}OOQ[1G/T1G/TOOQ[1G/W1G/WOOQ[1G/[1G/[OJOQdO,5;OOOQS7+&S7+&SOJTQ`O7+&SOJYQhO'#D]OJbQ`O,59vO)}QhO,59vOOQ[1G0P1G0POJjQ`O1G0POJoQhO,5;wOOQO-E9Z-E9ZOOQS7+&^7+&^OJ}QbO'#DSOOQO'#Et'#EtOK]Q`O'#EsOOQO'#Es'#EsOKhQ`O'#F^OKpQdO,5;^OOQS,5;^,5;^OOQ[1G/p1G/pOOQS7+&i7+&iO7fQ`O7+&iOK{Q!fO'#FYO)YQdO'#FYOMSQdO7+&POOQO7+&P7+&POOQO,5:{,5:{OOQO1G1a1G1aOMgQ!bO<vQhO'#DrOOQO,5:],5:]O! hQhO,5:_OGUQhO,5:cOOQW7+%]7+%]OOQO'#Ef'#EfO! pQ`O1G0jOOQS<xAN>xO!#zQ`OAN>xO!$PQaO,5;rOOQO-E9U-E9UO!$ZQdO,5;qOOQO-E9T-E9TOOQW<vQhO'#DuOOQO1G/y1G/yO!%vQ!bO1G/}OJOQdO'#F[O!&OQ`O7+&UOOQW7+&U7+&UO!&WQ!bO1G/cOOQ[7+$|7+$|O!&cQhO7+$|P!&jQ`O'#FTOOQO,5;y,5;yOOQO-E9]-E9]OOQS1G1d1G1dOOQPG24dG24dO!&oQ`OAN>ZO)YQdO1G1[O!&tQ`O7+'jOOQO1G/x1G/xO!&|Q`O,5:aO!$eQhO7+%iOOQO,5;v,5;vOOQO-E9Y-E9YOOQW<Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!o`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$[~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$[~!o`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%jj)jS$qYOy%jz;'S%j;'S;=`%{<%lO%j~)yWOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d<%lO)v~*hOw~~*kRO;'S)v;'S;=`*t;=`O)v~*wXOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d;=`<%l)v<%lO)v~+gP;=`<%l)vj+oYmYOy%jz!Q%j!Q![,_![!c%j!c!i,_!i#T%j#T#Z,_#Z;'S%j;'S;=`%{<%lO%jj,dY!o`Oy%jz!Q%j!Q![-S![!c%j!c!i-S!i#T%j#T#Z-S#Z;'S%j;'S;=`%{<%lO%jj-XY!o`Oy%jz!Q%j!Q![-w![!c%j!c!i-w!i#T%j#T#Z-w#Z;'S%j;'S;=`%{<%lO%jj.OYuY!o`Oy%jz!Q%j!Q![.n![!c%j!c!i.n!i#T%j#T#Z.n#Z;'S%j;'S;=`%{<%lO%jj.uYuY!o`Oy%jz!Q%j!Q![/e![!c%j!c!i/e!i#T%j#T#Z/e#Z;'S%j;'S;=`%{<%lO%jj/jY!o`Oy%jz!Q%j!Q![0Y![!c%j!c!i0Y!i#T%j#T#Z0Y#Z;'S%j;'S;=`%{<%lO%jj0aYuY!o`Oy%jz!Q%j!Q![1P![!c%j!c!i1P!i#T%j#T#Z1P#Z;'S%j;'S;=`%{<%lO%jj1UY!o`Oy%jz!Q%j!Q![1t![!c%j!c!i1t!i#T%j#T#Z1t#Z;'S%j;'S;=`%{<%lO%jj1{SuY!o`Oy%jz;'S%j;'S;=`%{<%lO%jd2[UOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jd2uS!yS!o`Oy%jz;'S%j;'S;=`%{<%lO%jb3WS^QOy%jz;'S%j;'S;=`%{<%lO%j~3gWOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{<%lO3d~4SRO;'S3d;'S;=`4];=`O3d~4`XOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{;=`<%l3d<%lO3d~5OP;=`<%l3dj5WShYOy%jz;'S%j;'S;=`%{<%lO%j~5iOg~n5pUWQyWOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jj6ZWyW#PQOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj6xU!o`Oy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%jj7cY!o`$gYOy%jz!Q%j!Q![7[![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj8WY!o`Oy%jz{%j{|8v|}%j}!O8v!O!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj8{U!o`Oy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj9fU!o`$gYOy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj:P[!o`$gYOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj:zS!dYOy%jz;'S%j;'S;=`%{<%lO%jj;]WyWOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj;zU`YOy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%j~VUcYOy%jz![%j![!]>i!];'S%j;'S;=`%{<%lO%jj>pSdY!o`Oy%jz;'S%j;'S;=`%{<%lO%jj?RSnYOy%jz;'S%j;'S;=`%{<%lO%jh?dU!WWOy%jz!_%j!_!`?v!`;'S%j;'S;=`%{<%lO%jh?}S!WW!o`Oy%jz;'S%j;'S;=`%{<%lO%jl@bS!WW!ySOy%jz;'S%j;'S;=`%{<%lO%jj@uV!|Q!WWOy%jz!_%j!_!`?v!`!aA[!a;'S%j;'S;=`%{<%lO%jbAcS!|Q!o`Oy%jz;'S%j;'S;=`%{<%lO%jjArYOy%jz}%j}!OBb!O!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjBgW!o`Oy%jz!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjCW[lY!o`Oy%jz}%j}!OCP!O!Q%j!Q![CP![!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jhDRS!zWOy%jz;'S%j;'S;=`%{<%lO%jjDdSpYOy%jz;'S%j;'S;=`%{<%lO%jnDuSo^Oy%jz;'S%j;'S;=`%{<%lO%jjEWU!zWOy%jz#a%j#a#bEj#b;'S%j;'S;=`%{<%lO%jbEoU!o`Oy%jz#d%j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!o`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!o`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!o`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!o`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!o`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!o`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$pQ!o`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$cUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU#PQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[Wpn,Ypn,Gpn,Hpn,1,2,3,4,new pK("m~RRYZ[z{a~~g~aO$_~~dP!P!Qg~lO$`~~",28,152)],topRules:{StyleSheet:[0,6],Styles:[1,126]},dynamicPrecedences:{94:1},specialized:[{term:147,get:t=>jpn[t]||-1},{term:148,get:t=>Xpn[t]||-1},{term:4,get:t=>Kpn[t]||-1},{term:28,get:t=>Zpn[t]||-1},{term:146,get:t=>Jpn[t]||-1}],tokenPrec:2405});let pwe=null;function gwe(){if(!pwe&&typeof document=="object"&&document.body){let{style:t}=document.body,e=[],r=new Set;for(let n in t)n!="cssText"&&n!="cssFloat"&&typeof t[n]=="string"&&(/[A-Z]/.test(n)&&(n=n.replace(/[A-Z]/g,i=>"-"+i.toLowerCase())),r.has(n)||(e.push(n),r.add(n)));pwe=e.sort().map(n=>({type:"property",label:n,apply:n+": "}))}return pwe||[]}const mOt=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(t=>({type:"class",label:t})),vOt=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),tgn=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),rgn=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(t=>({type:"keyword",label:t})),t1=/^(\w[\w-]*|-\w[\w-]*|)$/,ngn=/^-(-[\w-]*)?$/;function ign(t,e){var r;if((t.name=="("||t.type.isError)&&(t=t.parent||t),t.name!="ArgList")return!1;let n=(r=t.parent)===null||r===void 0?void 0:r.firstChild;return(n==null?void 0:n.name)!="Callee"?!1:e.sliceString(n.from,n.to)=="var"}const yOt=new Zbe,agn=["Declaration"];function sgn(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function bOt(t,e,r){if(e.to-e.from>4096){let n=yOt.get(e);if(n)return n;let i=[],a=new Set,s=e.cursor(Wi.IncludeAnonymous);if(s.firstChild())do for(let o of bOt(t,s.node,r))a.has(o.label)||(a.add(o.label),i.push(o));while(s.nextSibling());return yOt.set(e,i),i}else{let n=[],i=new Set;return e.cursor().iterate(a=>{var s;if(r(a)&&a.matchContext(agn)&&((s=a.node.nextSibling)===null||s===void 0?void 0:s.name)==":"){let o=t.sliceString(a.from,a.to);i.has(o)||(i.add(o),n.push({label:o,type:"variable"}))}}),n}}const ogn=(t=>e=>{let{state:r,pos:n}=e,i=pa(r).resolveInner(n,-1),a=i.type.isError&&i.from==i.to-1&&r.doc.sliceString(i.from,i.to)=="-";if(i.name=="PropertyName"||(a||i.name=="TagName")&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:gwe(),validFor:t1};if(i.name=="ValueName")return{from:i.from,options:vOt,validFor:t1};if(i.name=="PseudoClassName")return{from:i.from,options:mOt,validFor:t1};if(t(i)||(e.explicit||a)&&ign(i,r.doc))return{from:t(i)||a?i.from:n,options:bOt(r.doc,sgn(i),t),validFor:ngn};if(i.name=="TagName"){for(let{parent:l}=i;l;l=l.parent)if(l.name=="Block")return{from:i.from,options:gwe(),validFor:t1};return{from:i.from,options:tgn,validFor:t1}}if(i.name=="AtKeyword")return{from:i.from,options:rgn,validFor:t1};if(!e.explicit)return null;let s=i.resolve(n),o=s.childBefore(n);return o&&o.name==":"&&s.name=="PseudoClassSelector"?{from:n,options:mOt,validFor:t1}:o&&o.name==":"&&s.name=="Declaration"||s.name=="ArgList"?{from:n,options:vOt,validFor:t1}:s.name=="Block"||s.name=="Styles"?{from:n,options:gwe(),validFor:t1}:null})(t=>t.name=="VariableName"),kK=jy.define({name:"css",parser:egn.configure({props:[Ky.add({Declaration:T4()}),Zy.add({"Block KeyframeList":l$})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function lgn(){return new u2(kK,kK.data.of({autocomplete:ogn}))}const T$=["_blank","_self","_top","_parent"],mwe=["ascii","utf-8","utf-16","latin1","latin1"],vwe=["get","post","put","delete"],ywe=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Gd=["true","false"],Fr={},cgn={a:{attrs:{href:null,ping:null,type:null,media:null,target:T$,hreflang:null}},abbr:Fr,address:Fr,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Fr,aside:Fr,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Fr,base:{attrs:{href:null,target:T$}},bdi:Fr,bdo:Fr,blockquote:{attrs:{cite:null}},body:Fr,br:Fr,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:ywe,formmethod:vwe,formnovalidate:["novalidate"],formtarget:T$,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Fr,center:Fr,cite:Fr,code:Fr,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Fr,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Fr,div:Fr,dl:Fr,dt:Fr,em:Fr,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Fr,figure:Fr,footer:Fr,form:{attrs:{action:null,name:null,"accept-charset":mwe,autocomplete:["on","off"],enctype:ywe,method:vwe,novalidate:["novalidate"],target:T$}},h1:Fr,h2:Fr,h3:Fr,h4:Fr,h5:Fr,h6:Fr,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Fr,hgroup:Fr,hr:Fr,html:{attrs:{manifest:null}},i:Fr,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:ywe,formmethod:vwe,formnovalidate:["novalidate"],formtarget:T$,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Fr,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Fr,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Fr,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:mwe,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Fr,noscript:Fr,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Fr,param:{attrs:{name:null,value:null}},pre:Fr,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Fr,rt:Fr,ruby:Fr,samp:Fr,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:mwe}},section:Fr,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Fr,source:{attrs:{src:null,type:null,media:null}},span:Fr,strong:Fr,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Fr,summary:Fr,sup:Fr,table:Fr,tbody:Fr,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Fr,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Fr,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Fr,time:{attrs:{datetime:null}},title:Fr,tr:Fr,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Fr,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Fr},xOt={accesskey:null,class:null,contenteditable:Gd,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Gd,autocorrect:Gd,autocapitalize:Gd,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Gd,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Gd,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Gd,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Gd,"aria-hidden":Gd,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Gd,"aria-multiselectable":Gd,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Gd,"aria-relevant":null,"aria-required":Gd,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},wOt="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(t=>"on"+t);for(let t of wOt)xOt[t]=null;class C${constructor(e,r){this.tags={...cgn,...e},this.globalAttrs={...xOt,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}C$.default=new C$;function R4(t,e,r=t.length){if(!e)return"";let n=e.firstChild,i=n&&n.getChild("TagName");return i?t.sliceString(i.from,Math.min(i.to,r)):""}function D4(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}function AOt(t,e,r){let n=r.tags[R4(t,D4(e))];return(n==null?void 0:n.children)||r.allTags}function bwe(t,e){let r=[];for(let n=D4(e);n&&!n.type.isTop;n=D4(n.parent)){let i=R4(t,n);if(i&&n.lastChild.name=="CloseTag")break;i&&r.indexOf(i)<0&&(e.name=="EndTag"||e.from>=n.firstChild.to)&&r.push(i)}return r}const SOt=/^[:\-\.\w\u00b7-\uffff]*$/;function TOt(t,e,r,n,i){let a=/\s*>/.test(t.sliceDoc(i,i+5))?"":">",s=D4(r,r.name=="StartTag"||r.name=="TagName");return{from:n,to:i,options:AOt(t.doc,s,e).map(o=>({label:o,type:"type"})).concat(bwe(t.doc,r).map((o,l)=>({label:"/"+o,apply:"/"+o+a,type:"type",boost:99-l}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function COt(t,e,r,n){let i=/\s*>/.test(t.sliceDoc(n,n+5))?"":">";return{from:r,to:n,options:bwe(t.doc,e).map((a,s)=>({label:a,apply:a+i,type:"type",boost:99-s})),validFor:SOt}}function ugn(t,e,r,n){let i=[],a=0;for(let s of AOt(t.doc,r,e))i.push({label:"<"+s,type:"type"});for(let s of bwe(t.doc,r))i.push({label:"",type:"type",boost:99-a++});return{from:n,to:n,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function hgn(t,e,r,n,i){let a=D4(r),s=a?e.tags[R4(t.doc,a)]:null,o=s&&s.attrs?Object.keys(s.attrs):[],l=s&&s.globalAttrs===!1?o:o.length?o.concat(e.globalAttrNames):e.globalAttrNames;return{from:n,to:i,options:l.map(u=>({label:u,type:"property"})),validFor:SOt}}function dgn(t,e,r,n,i){var a;let s=(a=r.parent)===null||a===void 0?void 0:a.getChild("AttributeName"),o=[],l;if(s){let u=t.sliceDoc(s.from,s.to),h=e.globalAttrs[u];if(!h){let d=D4(r),f=d?e.tags[R4(t.doc,d)]:null;h=(f==null?void 0:f.attrs)&&f.attrs[u]}if(h){let d=t.sliceDoc(n,i).toLowerCase(),f='"',p='"';/^['"]/.test(d)?(l=d[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",p=t.sliceDoc(i,i+1)==d[0]?"":d[0],d=d.slice(1),n++):l=/^[^\s<>='"]*$/;for(let g of h)o.push({label:g,apply:f+g+p,type:"constant"})}}return{from:n,to:i,options:o,validFor:l}}function OOt(t,e){let{state:r,pos:n}=e,i=pa(r).resolveInner(n,-1),a=i.resolve(n);for(let s=n,o;a==i&&(o=i.childBefore(s));){let l=o.lastChild;if(!l||!l.type.isError||l.fromOOt(n,i)}const ggn=b0.parser.configure({top:"SingleExpression"}),kOt=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:sCt.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:oCt.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:lCt.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:ggn},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:b0.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:kK.parser}],EOt=[{name:"style",parser:kK.parser.configure({top:"Styles"})}].concat(wOt.map(t=>({name:t,parser:b0.parser}))),_Ot=jy.define({name:"html",parser:kpn.configure({props:[Ky.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit},Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].lengtht.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),EK=_Ot.configure({wrap:cOt(kOt,EOt)});function mgn(t={}){let e="",r;t.matchClosingTags===!1&&(e="noMatch"),t.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(r=cOt((t.nestedLanguages||[]).concat(kOt),(t.nestedAttributes||[]).concat(EOt)));let n=r?_Ot.configure({wrap:r,dialect:e}):e?EK.configure({dialect:e}):EK;return new u2(n,[EK.data.of({autocomplete:pgn(t)}),t.autoCloseTags!==!1?vgn:[],j2e().support,lgn().support])}const ROt=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),vgn=er.inputHandler.of((t,e,r,n,i)=>{if(t.composing||t.state.readOnly||e!=r||n!=">"&&n!="/"||!EK.isActiveAt(t.state,e,-1))return!1;let a=i(),{state:s}=a,o=s.changeByRange(l=>{var u,h,d;let f=s.doc.sliceString(l.from-1,l.to)==n,{head:p}=l,g=pa(s).resolveInner(p,-1),m;if(f&&n==">"&&g.name=="EndTag"){let v=g.parent;if(((h=(u=v.parent)===null||u===void 0?void 0:u.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(m=R4(s.doc,v.parent,p))&&!ROt.has(m)){let y=p+(s.doc.sliceString(p,p+1)===">"?1:0),b=``;return{range:l,changes:{from:p,to:y,insert:b}}}}else if(f&&n=="/"&&g.name=="IncompleteCloseTag"){let v=g.parent;if(g.from==p-2&&((d=v.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(m=R4(s.doc,v,p))&&!ROt.has(m)){let y=p+(s.doc.sliceString(p,p+1)===">"?1:0),b=`${m}>`;return{range:bt.cursor(p+b.length,-1),changes:{from:p,to:y,insert:b}}}}return{range:l}});return o.changes.empty?!1:(t.dispatch([a,s.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),DOt=aK({commentTokens:{block:{open:""}}}),LOt=new En,MOt=Rfn.configure({props:[Zy.add(t=>!t.is("Block")||t.is("Document")||xwe(t)!=null||ygn(t)?void 0:(e,r)=>({from:r.doc.lineAt(e.from).to,to:e.to})),LOt.add(xwe),Ky.add({Document:()=>null}),c2.add({Document:DOt})]});function xwe(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function ygn(t){return t.name=="OrderedList"||t.name=="BulletList"}function bgn(t,e){let r=t;for(;;){let n=r.nextSibling,i;if(!n||(i=xwe(n.type))!=null&&i<=e)break;r=n}return r.to}const xgn=ZSt.of((t,e,r)=>{for(let n=pa(t).resolveInner(r,-1);n&&!(n.fromr)return{from:r,to:a}}return null});function wwe(t){return new Ud(DOt,t,[],"markdown")}const wgn=wwe(MOt),_K=wwe(MOt.configure([zfn,Vfn,Ufn,Qfn,{props:[Zy.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]));function Agn(t,e){return r=>{if(r&&t){let n=null;if(r=/\S*/.exec(r)[0],typeof t=="function"?n=t(r):n=sK.matchLanguageName(t,r,!0),n instanceof sK)return n.support?n.support.language.parser:GT.getSkippingParser(n.load());if(n)return n.parser}return e?e.parser:null}}let Awe=class{constructor(e,r,n,i,a,s,o){this.node=e,this.from=r,this.to=n,this.spaceBefore=i,this.spaceAfter=a,this.type=s,this.item=o}blank(e,r=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;n.length0;i--)n+=" ";return n+(r?this.spaceAfter:"")}}marker(e,r){let n=this.node.name=="OrderedList"?String(+POt(this.item,e)[2]+r):"";return this.spaceBefore+n+this.type+this.spaceAfter}};function IOt(t,e){let r=[],n=[];for(let i=t;i;i=i.parent){if(i.name=="FencedCode")return n;(i.name=="ListItem"||i.name=="Blockquote")&&r.push(i)}for(let i=r.length-1;i>=0;i--){let a=r[i],s,o=e.lineAt(a.from),l=a.from-o.from;if(a.name=="Blockquote"&&(s=/^ *>( ?)/.exec(o.text.slice(l))))n.push(new Awe(a,l,l+s[0].length,"",s[1],">",null));else if(a.name=="ListItem"&&a.parent.name=="OrderedList"&&(s=/^( *)\d+([.)])( *)/.exec(o.text.slice(l)))){let u=s[3],h=s[0].length;u.length>=4&&(u=u.slice(0,u.length-4),h-=4),n.push(new Awe(a.parent,l,l+h,s[1],u,s[2],a))}else if(a.name=="ListItem"&&a.parent.name=="BulletList"&&(s=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(l)))){let u=s[4],h=s[0].length;u.length>4&&(u=u.slice(0,u.length-4),h-=4);let d=s[2];s[3]&&(d+=s[3].replace(/[xX]/," ")),n.push(new Awe(a.parent,l,l+h,s[1],u,d,a))}}return n}function POt(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function Swe(t,e,r,n=0){for(let i=-1,a=t;;){if(a.name=="ListItem"){let o=POt(a,e),l=+o[2];if(i>=0){if(l!=i+1)return;r.push({from:a.from+o[1].length,to:a.from+o[0].length,insert:String(i+2+n)})}i=l}let s=a.nextSibling;if(!s)break;a=s}}function Twe(t,e){let r=/^[ \t]*/.exec(t)[0].length;if(!r||e.facet(A4)!=" ")return t;let n=hg(t,4,r),i="";for(let a=n;a>0;)a>=4?(i+=" ",a-=4):(i+=" ",a--);return i+t.slice(r)}const Sgn=((t={})=>({state:e,dispatch:r})=>{let n=pa(e),{doc:i}=e,a=null,s=e.changeByRange(o=>{if(!o.empty||!_K.isActiveAt(e,o.from,-1)&&!_K.isActiveAt(e,o.from,1))return a={range:o};let l=o.from,u=i.lineAt(l),h=IOt(n.resolveInner(l,-1),i);for(;h.length&&h[h.length-1].from>l-u.from;)h.pop();if(!h.length)return a={range:o};let d=h[h.length-1];if(d.to-d.spaceAfter.length>l-u.from)return a={range:o};let f=l>=d.to-d.spaceAfter.length&&!/\S/.test(u.text.slice(d.to));if(d.item&&f){let y=d.node.firstChild,b=d.node.getChild("ListItem","ListItem");if(y.to>=l||b&&b.to0&&!/[^\s>]/.test(i.lineAt(u.from-1).text)||t.nonTightLists===!1){let x=h.length>1?h[h.length-2]:null,w,A="";x&&x.item?(w=u.from+x.from,A=x.marker(i,1)):w=u.from+(x?x.to:0);let S=[{from:w,to:l,insert:A}];return d.node.name=="OrderedList"&&Swe(d.item,i,S,-2),x&&x.node.name=="OrderedList"&&Swe(x.item,i,S),{range:bt.cursor(w+A.length),changes:S}}else{let x=BOt(h,e,u);return{range:bt.cursor(l+x.length+1),changes:{from:u.from,insert:x+e.lineBreak}}}}if(d.node.name=="Blockquote"&&f&&u.from){let y=i.lineAt(u.from-1),b=/>\s*$/.exec(y.text);if(b&&b.index==d.from){let x=e.changes([{from:y.from+b.index,to:y.to},{from:u.from+d.from,to:u.to}]);return{range:o.map(x),changes:x}}}let p=[];d.node.name=="OrderedList"&&Swe(d.item,i,p);let g=d.item&&d.item.from]*/.exec(u.text)[0].length>=d.to)for(let y=0,b=h.length-1;y<=b;y++)m+=y==b&&!g?h[y].marker(i,1):h[y].blank(yu.from&&/\s/.test(u.text.charAt(v-u.from-1));)v--;return m=Twe(m,e),Tgn(d.node,e.doc)&&(m=BOt(h,e,u)+e.lineBreak+m),p.push({from:v,to:l,insert:e.lineBreak+m}),{range:bt.cursor(v+m.length+1),changes:p}});return a?!1:(r(e.update(s,{scrollIntoView:!0,userEvent:"input"})),!0)})();function NOt(t){return t.name=="QuoteMark"||t.name=="ListMark"}function Tgn(t,e){if(t.name!="OrderedList"&&t.name!="BulletList")return!1;let r=t.firstChild,n=t.getChild("ListItem","ListItem");if(!n)return!1;let i=e.lineAt(r.to),a=e.lineAt(n.from),s=/^[\s>]*$/.test(i.text);return i.number+(s?0:1){let r=pa(t),n=null,i=t.changeByRange(a=>{let s=a.from,{doc:o}=t;if(a.empty&&_K.isActiveAt(t,a.from)){let l=o.lineAt(s),u=IOt(Cgn(r,s),o);if(u.length){let h=u[u.length-1],d=h.to-h.spaceAfter.length+(h.spaceAfter?1:0);if(s-l.from>d&&!/\S/.test(l.text.slice(d,s-l.from)))return{range:bt.cursor(l.from+d),changes:{from:l.from+d,to:s}};if(s-l.from==d&&(h.item&&l.from<=h.item.from||/^[\s>]*$/.test(l.text.slice(0,h.to)))){let f=l.from+h.from;if(h.item&&h.node.from{var r;let{main:n}=e.state.selection;if(n.empty)return!1;let i=(r=t.clipboardData)===null||r===void 0?void 0:r.getData("text/plain");if(!i||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(i)||(/^www\./.test(i)&&(i="https://"+i),!_K.isActiveAt(e.state,n.from,1)))return!1;let a=pa(e.state),s=!1;return a.iterate({from:n.from,to:n.to,enter:o=>{(o.from>n.from||Rgn.test(o.name))&&(s=!0)},leave:o=>{o.to=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}const Dmn=new uo((t,e)=>{let r;if(t.next<0)t.acceptToken(Pgn);else if(e.context.flags&DK)_we(t.next)&&t.acceptToken(Ign,1);else if(((r=t.peek(-1))<0||_we(r))&&e.canShift(UOt)){let n=0;for(;t.next==Owe||t.next==RK;)t.advance(),n++;(t.next==XT||t.next==O$||t.next==kwe)&&t.acceptToken(UOt,-n)}else _we(t.next)&&t.acceptToken(Mgn,1)},{contextual:!0}),Lmn=new uo((t,e)=>{let r=e.context;if(r.flags)return;let n=t.peek(-1);if(n==XT||n==O$){let i=0,a=0;for(;;){if(t.next==Owe)i++;else if(t.next==RK)i+=8-i%8;else break;t.advance(),a++}i!=r.indent&&t.next!=XT&&t.next!=O$&&t.next!=kwe&&(i[t,e|jOt])),Pmn=new gK({start:Mmn,reduce(t,e,r,n){return t.flags&DK&&Rmn.has(e)||(e==Zgn||e==GOt)&&t.flags&jOt?t.parent:t},shift(t,e,r,n){return e==FOt?new LK(t,Imn(n.read(n.pos,r.pos)),0):e==zOt?t.parent:e==$gn||e==Vgn||e==Hgn||e==VOt?new LK(t,0,DK):XOt.has(e)?new LK(t,0,XOt.get(e)|t.flags&DK):t},hash(t){return t.hash}}),Nmn=new uo(t=>{for(let e=0;e<5;e++){if(t.next!="print".charCodeAt(e))return;t.advance()}if(!/\w/.test(String.fromCharCode(t.next)))for(let e=0;;e++){let r=t.peek(e);if(!(r==Owe||r==RK)){r!=Smn&&r!=Tmn&&r!=XT&&r!=O$&&r!=kwe&&t.acceptToken(Lgn);return}}}),Bmn=new uo((t,e)=>{let{flags:r}=e.context,n=r&r1?YOt:WOt,i=(r&n1)>0,a=!(r&i1),s=(r&a1)>0,o=t.pos;for(;!(t.next<0);)if(s&&t.next==Ewe)if(t.peek(1)==Ewe)t.advance(2);else{if(t.pos==o){t.acceptToken(VOt,1);return}break}else if(a&&t.next==qOt){if(t.pos==o){t.advance();let l=t.next;l>=0&&(t.advance(),$mn(t,l)),t.acceptToken(Bgn);return}break}else if(t.next==qOt&&!a&&t.peek(1)>-1)t.advance(2);else if(t.next==n&&(!i||t.peek(1)==n&&t.peek(2)==n)){if(t.pos==o){t.acceptToken(QOt,i?3:1);return}break}else if(t.next==XT){if(i)t.advance();else if(t.pos==o){t.acceptToken(QOt);return}break}else t.advance();t.pos>o&&t.acceptToken(Ngn)});function $mn(t,e){if(e==Cmn)for(let r=0;r<2&&t.next>=48&&t.next<=55;r++)t.advance();else if(e==Omn)for(let r=0;r<2&&Rwe(t.next);r++)t.advance();else if(e==Emn)for(let r=0;r<4&&Rwe(t.next);r++)t.advance();else if(e==_mn)for(let r=0;r<8&&Rwe(t.next);r++)t.advance();else if(e==kmn&&t.next==Ewe){for(t.advance();t.next>=0&&t.next!=HOt&&t.next!=WOt&&t.next!=YOt&&t.next!=XT;)t.advance();t.next==HOt&&t.advance()}}const Fmn=qy({'async "*" "**" FormatConversion FormatSpec':Ee.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":Ee.controlKeyword,"in not and or is del":Ee.operatorKeyword,"from def class global nonlocal lambda":Ee.definitionKeyword,import:Ee.moduleKeyword,"with as print":Ee.keyword,Boolean:Ee.bool,None:Ee.null,VariableName:Ee.variableName,"CallExpression/VariableName":Ee.function(Ee.variableName),"FunctionDefinition/VariableName":Ee.function(Ee.definition(Ee.variableName)),"ClassDefinition/VariableName":Ee.definition(Ee.className),PropertyName:Ee.propertyName,"CallExpression/MemberExpression/PropertyName":Ee.function(Ee.propertyName),Comment:Ee.lineComment,Number:Ee.number,String:Ee.string,FormatString:Ee.special(Ee.string),Escape:Ee.escape,UpdateOp:Ee.updateOperator,"ArithOp!":Ee.arithmeticOperator,BitOp:Ee.bitwiseOperator,CompareOp:Ee.compareOperator,AssignOp:Ee.definitionOperator,Ellipsis:Ee.punctuation,At:Ee.meta,"( )":Ee.paren,"[ ]":Ee.squareBracket,"{ }":Ee.brace,".":Ee.derefOperator,", ;":Ee.separator}),zmn={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},Umn=Jy.deserialize({version:14,states:"##jQ`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5TQdO'#DoOOQS,5:Y,5:YO5hQdO'#HdOOQS,5:],5:]O5uQ!fO,5:]O5zQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8jQdO,59bO8oQdO,59bO8vQdO,59jO8}QdO'#HTO:TQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:lQdO,59aO'vQdO,59aO:zQdO,59aOOQS,59y,59yO;PQdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;_QdO,5:QO;dQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;uQdO,5:UO;zQdO,5:WOOOW'#Fy'#FyOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/[QtO1G.|O!/cQtO1G.|O1lQdO1G.|O!0OQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!0VQdO1G/eO!0gQdO1G/eO!0oQdO1G/fO'vQdO'#H[O!0tQdO'#H[O!0yQtO1G.{O!1ZQdO,59iO!2aQdO,5=zO!2qQdO,5=zO!2yQdO1G/mO!3OQtO1G/mOOQS1G/l1G/lO!3`QdO,5=uO!4VQdO,5=uO0rQdO1G/qO!4tQdO1G/sO!4yQtO1G/sO!5ZQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5kQdO'#HxO0rQdO'#HxO!5|QdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6[Q#xO1G2zO!6{QtO1G2zO'vQdO,5kOOQS1G1`1G1`O!8RQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!8WQdO'#FrO!8cQdO,59oO!8kQdO1G/XO!8uQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9fQdO'#GtOOQS,5jO!;ZQdO,5>jO1XQdO,5>jO!;lQdO,5>iOOQS-E:R-E:RO!;qQdO1G0lO!;|QdO1G0lO!lO!lO!hO!=VQdO,5>hO!=hQdO'#EpO0rQdO1G0tO!=sQdO1G0tO!=xQgO1G0zO!AvQgO1G0}O!EqQdO,5>oO!E{QdO,5>oO!FTQtO,5>oO0rQdO1G1PO!F_QdO1G1PO4iQdO1G1UO!!vQdO1G1WOOQV,5;a,5;aO!FdQfO,5;aO!FiQgO1G1QO!JjQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JzQdO,5>pO!KXQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KaQdO'#FSO!KrQ!fO1G1WO!KzQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!LPQdO1G1]O!LXQdO'#F^OOQV1G1b1G1bO!#ZQtO1G1bPOOO1G2v1G2vP!L^OSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LfQdO,5=|O!LyQdO,5=|OOQS1G/u1G/uO!MRQdO,5>PO!McQdO,5>PO!MkQdO,5>PO!NOQdO,5>PO!N`QdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8kQdO7+$pO#!RQdO1G.|O#!YQdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!aQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!qQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!vQdO7+%PO##OQdO7+%QO##TQdO1G3fOOQS7+%X7+%XO##eQdO1G3fO##mQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##rQdO1G3aOOQS-E9q-E9qO#$iQdO7+%]OOQS7+%_7+%_O#$wQdO1G3aO#%fQdO7+%_O#%kQdO1G3gO#%{QdO1G3gO#&TQdO7+%]O#&YQdO,5>dO#&sQdO,5>dO#&sQdO,5>dOOQS'#Dx'#DxO#'UO&jO'#DzO#'aO`O'#HyOOOW1G3}1G3}O#'fQdO1G3}O#'nQdO1G3}O#'yQ#xO7+(fO#(jQtO1G2UP#)TQdO'#GOOOQS,5nQdO,5sQdO1G4OOOQS-E9y-E9yO#?^QdO1G4OO<[QdO'#H{OOOO'#D{'#D{OOOO'#F|'#F|O#?oO&jO,5:fOOOW,5>e,5>eOOOW7+)i7+)iO#?zQdO7+)iO#@SQdO1G2zO#@mQdO1G2zP'vQdO'#FuO0rQdO<mO#BQQdO,5>mOOQS1G0v1G0vOOQS<rO#KgQdO,5>rO#KrQdO,5>rO#K}QdO,5>qO#L`QdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ oQdO<cAN>cO0rQdO1G1|O$!PQtO1G1|P$!ZQdO'#FvOOQS1G2R1G2RP$!hQdO'#F{O$!uQdO7+)jO$#`QdO,5>gOOOO-E9z-E9zOOOW<tO$4{QdO,5>tO1XQdO,5vO$)nQdO,5>vOOQS1G1p1G1pOOQS,5<[,5<[OOQU7+'P7+'PO$+zQdO1G/iO$)nQdO,5wO$8zQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)nQdO'#GdO$9SQdO1G4bO$9^QdO1G4bO$9fQdO1G4bOOQS7+%T7+%TO$9tQdO1G1tO$:SQtO'#FaO$:ZQdO,5<}OOQS,5<},5<}O$:iQdO1G4cOOQS-E:a-E:aO$)nQdO,5<|O$:pQdO,5<|O$:uQdO7+)|OOQS-E:`-E:`O$;PQdO7+)|O$)nQdO,5S~O%cOS%^OSSOS%]PQ~OPdOVaOfoOhYOopOs!POvqO!PrO!Q{O!T!SO!U!RO!XZO!][O!h`O!r`O!s`O!t`O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#l!QO#o!TO#s!UO#u!VO#z!WO#}hO$P!XO%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~O%]!YO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%j![O%k!]O%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aO~Ok%xXl%xXm%xXn%xXo%xXp%xXs%xXz%xX{%xX!x%xX#g%xX%[%xX%_%xX%z%xXg%xX!T%xX!U%xX%{%xX!W%xX![%xX!Q%xX#[%xXt%xX!m%xX~P%SOfoOhYO!XZO!][O!h`O!r`O!s`O!t`O%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~Oz%wX{%wX#g%wX%[%wX%_%wX%z%wX~Ok!pOl!qOm!oOn!oOo!rOp!sOs!tO!x%wX~P)pOV!zOg!|Oo0cOv0qO!PrO~P'vOV#OOo0cOv0qO!W#PO~P'vOV#SOa#TOo0cOv0qO![#UO~P'vOQ#XO%`#XO%a#ZO~OQ#^OR#[O%`#^O%a#`O~OV%iX_%iXa%iXh%iXk%iXl%iXm%iXn%iXo%iXp%iXs%iXz%iX!X%iX!f%iX%j%iX%k%iX%l%iX%m%iX%n%iX%o%iX%p%iX%q%iX%r%iX%s%iXg%iX!T%iX!U%iX~O&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O{%iX!x%iX#g%iX%[%iX%_%iX%z%iX%{%iX!W%iX![%iX!Q%iX#[%iXt%iX!m%iX~P,eOz#dO{%hX!x%hX#g%hX%[%hX%_%hX%z%hX~Oo0cOv0qO~P'vO#g#gO%[#iO%_#iO~O%uWO~O!T#nO#u!VO#z!WO#}hO~OopO~P'vOV#sOa#tO%uWO{wP~OV#xOo0cOv0qO!Q#yO~P'vO{#{O!x$QO%z#|O#g!yX%[!yX%_!yX~OV#xOo0cOv0qO#g#SX%[#SX%_#SX~P'vOo0cOv0qO#g#WX%[#WX%_#WX~P'vOh$WO%uWO~O!f$YO!r$YO%uWO~OV$eO~P'vO!U$gO#s$hO#u$iO~O{$jO~OV$qO~P'vOS$sO%[$rO%_$rO%c$tO~OV$}Oa$}Og%POo0cOv0qO~P'vOo0cOv0qO{%SO~P'vO&Y%UO~Oa!bOh!iO!X!kO!f!mOVba_bakbalbambanbaobapbasbazba{ba!xba#gba%[ba%_ba%jba%kba%lba%mba%nba%oba%pba%qba%rba%sba%zbagba!Tba!Uba%{ba!Wba![ba!Qba#[batba!mba~On%ZO~Oo%ZO~P'vOo0cO~P'vOk0eOl0fOm0dOn0dOo0mOp0nOs0rOg%wX!T%wX!U%wX%{%wX!W%wX![%wX!Q%wX#[%wX!m%wX~P)pO%{%]Og%vXz%vX!T%vX!U%vX!W%vX{%vX~Og%_Oz%`O!T%dO!U%cO~Og%_O~Oz%gO!T%dO!U%cO!W&SX~O!W%kO~Oz%lO{%nO!T%dO!U%cO![%}X~O![%rO~O![%sO~OQ#XO%`#XO%a%uO~OV%wOo0cOv0qO!PrO~P'vOQ#^OR#[O%`#^O%a%zO~OV!qa_!qaa!qah!qak!qal!qam!qan!qao!qap!qas!qaz!qa{!qa!X!qa!f!qa!x!qa#g!qa%[!qa%_!qa%j!qa%k!qa%l!qa%m!qa%n!qa%o!qa%p!qa%q!qa%r!qa%s!qa%z!qag!qa!T!qa!U!qa%{!qa!W!qa![!qa!Q!qa#[!qat!qa!m!qa~P#yOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P%SOV&OOopOvqO{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P'vOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#g$zX%[$zX%_$zX~P'vO#g#gO%[&TO%_&TO~O!f&UOh&sX%[&sXz&sX#[&sX#g&sX%_&sX#Z&sXg&sX~Oh!iO%[&WO~Okealeameaneaoeapeaseazea{ea!xea#gea%[ea%_ea%zeagea!Tea!Uea%{ea!Wea![ea!Qea#[eatea!mea~P%SOsqazqa{qa#gqa%[qa%_qa%zqa~Ok!pOl!qOm!oOn!oOo!rOp!sO!xqa~PEcO%z&YOz%yX{%yX~O%uWOz%yX{%yX~Oz&]O{wX~O{&_O~Oz%lO#g%}X%[%}X%_%}Xg%}X{%}X![%}X!m%}X%z%}X~OV0lOo0cOv0qO!PrO~P'vO%z#|O#gUa%[Ua%_Ua~Oz&hO#g&PX%[&PX%_&PXn&PX~P%SOz&kO!Q&jO#g#Wa%[#Wa%_#Wa~Oz&lO#[&nO#g&rX%[&rX%_&rXg&rX~O!f$YO!r$YO#Z&qO%uWO~O#Z&qO~Oz&sO#g&tX%[&tX%_&tX~Oz&uO#g&pX%[&pX%_&pX{&pX~O!X&wO%z&xO~Oz&|On&wX~P%SOn'PO~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO%['UO~P'vOt'YO#p'WO#q'XOP#naV#naf#nah#nao#nas#nav#na!P#na!Q#na!T#na!U#na!X#na!]#na!h#na!r#na!s#na!t#na!{#na!}#na#P#na#R#na#T#na#X#na#Z#na#^#na#_#na#a#na#c#na#l#na#o#na#s#na#u#na#z#na#}#na$P#na%X#na%o#na%p#na%t#na%u#na&Z#na&[#na&]#na&^#na&_#na&`#na&a#na&b#na&c#na&d#na&e#na&f#na&g#na&h#na&i#na&j#na%Z#na%_#na~Oz'ZO#[']O{&xX~Oh'_O!X&wO~Oh!iO{$jO!X&wO~O{'eO~P%SO%['hO%_'hO~OS'iO%['hO%_'hO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%k!]O~P!#uO%kWi~P!#uOV!aO_!aOa!bOh!iO!X!kO!f!mO%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%m!_O%n!_O~P!&pO%mWi%nWi~P!&pOa!bOh!iO!X!kO!f!mOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%mWi%nWi%oWi%pWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~OV!aO_!aO%q!aO%r!aO%s!aO~P!)nOVWi_Wi%qWi%rWi%sWi~P!)nO!T%dO!U%cOg&VXz&VX~O%z'kO%{'kO~P,eOz'mOg&UX~Og'oO~Oz'pO{'rO!W&XX~Oo0cOv0qOz'pO{'sO!W&XX~P'vO!W'uO~Om!oOn!oOo!rOp!sOkjisjizji{ji!xji#gji%[ji%_ji%zji~Ol!qO~P!.aOlji~P!.aOk0eOl0fOm0dOn0dOo0mOp0nO~Ot'wO~P!/jOV'|Og'}Oo0cOv0qO~P'vOg'}Oz(OO~Og(QO~O!U(SO~Og(TOz(OO!T%dO!U%cO~P%SOk0eOl0fOm0dOn0dOo0mOp0nOgqa!Tqa!Uqa%{qa!Wqa![qa!Qqa#[qatqa!mqa~PEcOV'|Oo0cOv0qO!W&Sa~P'vOz(WO!W&Sa~O!W(XO~Oz(WO!T%dO!U%cO!W&Sa~P%SOV(]Oo0cOv0qO![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~P'vOz(^O![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~O![(aO~Oz(^O!T%dO!U%cO![%}a~P%SOz(dO!T%dO!U%cO![&Ta~P%SOz(gO{&lX![&lX!m&lX%z&lX~O{(kO![(mO!m(nO%z(jO~OV&OOopOvqO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~P'vOz(pO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~O!f&UOh&sa%[&saz&sa#[&sa#g&sa%_&sa#Z&sag&sa~O%[(uO~OV#sOa#tO%uWO~Oz&]O{wa~OopOvqO~P'vOz(^O#g%}a%[%}a%_%}ag%}a{%}a![%}a!m%}a%z%}a~P%SOz(zO#g%hX%[%hX%_%hX%z%hX~O%z#|O#gUi%[Ui%_Ui~O#g&Pa%[&Pa%_&Pan&Pa~P'vOz(}O#g&Pa%[&Pa%_&Pan&Pa~O%uWO#g&ra%[&ra%_&rag&ra~Oz)SO#g&ra%[&ra%_&rag&ra~Og)VO~OV)WOh$WO%uWO~O#Z)XO~O%uWO#g&ta%[&ta%_&ta~Oz)ZO#g&ta%[&ta%_&ta~Oo0cOv0qO#g&pa%[&pa%_&pa{&pa~P'vOz)^O#g&pa%[&pa%_&pa{&pa~OV)`Oa)`O%uWO~O%z)eO~Ot)hO#j)gOP#hiV#hif#hih#hio#his#hiv#hi!P#hi!Q#hi!T#hi!U#hi!X#hi!]#hi!h#hi!r#hi!s#hi!t#hi!{#hi!}#hi#P#hi#R#hi#T#hi#X#hi#Z#hi#^#hi#_#hi#a#hi#c#hi#l#hi#o#hi#s#hi#u#hi#z#hi#}#hi$P#hi%X#hi%o#hi%p#hi%t#hi%u#hi&Z#hi&[#hi&]#hi&^#hi&_#hi&`#hi&a#hi&b#hi&c#hi&d#hi&e#hi&f#hi&g#hi&h#hi&i#hi&j#hi%Z#hi%_#hi~Ot)iOP#kiV#kif#kih#kio#kis#kiv#ki!P#ki!Q#ki!T#ki!U#ki!X#ki!]#ki!h#ki!r#ki!s#ki!t#ki!{#ki!}#ki#P#ki#R#ki#T#ki#X#ki#Z#ki#^#ki#_#ki#a#ki#c#ki#l#ki#o#ki#s#ki#u#ki#z#ki#}#ki$P#ki%X#ki%o#ki%p#ki%t#ki%u#ki&Z#ki&[#ki&]#ki&^#ki&_#ki&`#ki&a#ki&b#ki&c#ki&d#ki&e#ki&f#ki&g#ki&h#ki&i#ki&j#ki%Z#ki%_#ki~OV)kOn&wa~P'vOz)lOn&wa~Oz)lOn&wa~P%SOn)pO~O%Y)tO~Ot)wO#p'WO#q)vOP#niV#nif#nih#nio#nis#niv#ni!P#ni!Q#ni!T#ni!U#ni!X#ni!]#ni!h#ni!r#ni!s#ni!t#ni!{#ni!}#ni#P#ni#R#ni#T#ni#X#ni#Z#ni#^#ni#_#ni#a#ni#c#ni#l#ni#o#ni#s#ni#u#ni#z#ni#}#ni$P#ni%X#ni%o#ni%p#ni%t#ni%u#ni&Z#ni&[#ni&]#ni&^#ni&_#ni&`#ni&a#ni&b#ni&c#ni&d#ni&e#ni&f#ni&g#ni&h#ni&i#ni&j#ni%Z#ni%_#ni~OV)zOo0cOv0qO{$jO~P'vOo0cOv0qO{&xa~P'vOz*OO{&xa~OV*SOa*TOg*WO%q*UO%uWO~O{$jO&{*YO~Oh'_O~Oh!iO{$jO~O%[*_O~O%[*aO%_*aO~OV$}Oa$}Oo0cOv0qOg&Ua~P'vOz*dOg&Ua~Oo0cOv0qO{*gO!W&Xa~P'vOz*hO!W&Xa~Oo0cOv0qOz*hO{*kO!W&Xa~P'vOo0cOv0qOz*hO!W&Xa~P'vOz*hO{*kO!W&Xa~Om0dOn0dOo0mOp0nOgjikjisjizji!Tji!Uji%{ji!Wji{ji![ji#gji%[ji%_ji!Qji#[jitji!mji%zji~Ol0fO~P!NkOlji~P!NkOV'|Og*pOo0cOv0qO~P'vOn*rO~Og*pOz*tO~Og*uO~OV'|Oo0cOv0qO!W&Si~P'vOz*vO!W&Si~O!W*wO~OV(]Oo0cOv0qO![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~P'vOz*zO!T%dO!U%cO![&Ti~Oz*}O![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~O![+OO~Oa+QOo0cOv0qO![&Ti~P'vOz*zO![&Ti~O![+SO~OV+UOo0cOv0qO{&la![&la!m&la%z&la~P'vOz+VO{&la![&la!m&la%z&la~O!]+YO&n+[O![!nX~O![+^O~O{(kO![+_O~O{(kO![+_O!m+`O~OV&OOopOvqO{%hq!x%hq#g%hq%[%hq%_%hq%z%hq~P'vOz$ri{$ri!x$ri#g$ri%[$ri%_$ri%z$ri~P%SOV&OOopOvqO~P'vOV&OOo0cOv0qO#g%ha%[%ha%_%ha%z%ha~P'vOz+aO#g%ha%[%ha%_%ha%z%ha~Oz$ia#g$ia%[$ia%_$ian$ia~P%SO#g&Pi%[&Pi%_&Pin&Pi~P'vOz+dO#g#Wq%[#Wq%_#Wq~O#[+eOz$va#g$va%[$va%_$vag$va~O%uWO#g&ri%[&ri%_&rig&ri~Oz+gO#g&ri%[&ri%_&rig&ri~OV+iOh$WO%uWO~O%uWO#g&ti%[&ti%_&ti~Oo0cOv0qO#g&pi%[&pi%_&pi{&pi~P'vO{#{Oz#eX!W#eX~Oz+mO!W&uX~O!W+oO~Ot+rO#j)gOP#hqV#hqf#hqh#hqo#hqs#hqv#hq!P#hq!Q#hq!T#hq!U#hq!X#hq!]#hq!h#hq!r#hq!s#hq!t#hq!{#hq!}#hq#P#hq#R#hq#T#hq#X#hq#Z#hq#^#hq#_#hq#a#hq#c#hq#l#hq#o#hq#s#hq#u#hq#z#hq#}#hq$P#hq%X#hq%o#hq%p#hq%t#hq%u#hq&Z#hq&[#hq&]#hq&^#hq&_#hq&`#hq&a#hq&b#hq&c#hq&d#hq&e#hq&f#hq&g#hq&h#hq&i#hq&j#hq%Z#hq%_#hq~On$|az$|a~P%SOV)kOn&wi~P'vOz+yOn&wi~Oz,TO{$jO#[,TO~O#q,VOP#nqV#nqf#nqh#nqo#nqs#nqv#nq!P#nq!Q#nq!T#nq!U#nq!X#nq!]#nq!h#nq!r#nq!s#nq!t#nq!{#nq!}#nq#P#nq#R#nq#T#nq#X#nq#Z#nq#^#nq#_#nq#a#nq#c#nq#l#nq#o#nq#s#nq#u#nq#z#nq#}#nq$P#nq%X#nq%o#nq%p#nq%t#nq%u#nq&Z#nq&[#nq&]#nq&^#nq&_#nq&`#nq&a#nq&b#nq&c#nq&d#nq&e#nq&f#nq&g#nq&h#nq&i#nq&j#nq%Z#nq%_#nq~O#[,WOz%Oa{%Oa~Oo0cOv0qO{&xi~P'vOz,YO{&xi~O{#{O%z,[Og&zXz&zX~O%uWOg&zXz&zX~Oz,`Og&yX~Og,bO~O%Y,eO~O!T%dO!U%cOg&Viz&Vi~OV$}Oa$}Oo0cOv0qOg&Ui~P'vO{,hOz$la!W$la~Oo0cOv0qO{,iOz$la!W$la~P'vOo0cOv0qO{*gO!W&Xi~P'vOz,lO!W&Xi~Oo0cOv0qOz,lO!W&Xi~P'vOz,lO{,oO!W&Xi~Og$hiz$hi!W$hi~P%SOV'|Oo0cOv0qO~P'vOn,qO~OV'|Og,rOo0cOv0qO~P'vOV'|Oo0cOv0qO!W&Sq~P'vOz$gi![$gi#g$gi%[$gi%_$gig$gi{$gi!m$gi%z$gi~P%SOV(]Oo0cOv0qO~P'vOa+QOo0cOv0qO![&Tq~P'vOz,sO![&Tq~O![,tO~OV(]Oo0cOv0qO![%}q#g%}q%[%}q%_%}qg%}q{%}q!m%}q%z%}q~P'vO{,uO~OV+UOo0cOv0qO{&li![&li!m&li%z&li~P'vOz,zO{&li![&li!m&li%z&li~O!]+YO&n+[O![!na~O{(kO![,}O~OV&OOo0cOv0qO#g%hi%[%hi%_%hi%z%hi~P'vOz-OO#g%hi%[%hi%_%hi%z%hi~O%uWO#g&rq%[&rq%_&rqg&rq~Oz-RO#g&rq%[&rq%_&rqg&rq~OV)`Oa)`O%uWO!W&ua~Oz-TO!W&ua~On$|iz$|i~P%SOV)kO~P'vOV)kOn&wq~P'vOt-XOP#myV#myf#myh#myo#mys#myv#my!P#my!Q#my!T#my!U#my!X#my!]#my!h#my!r#my!s#my!t#my!{#my!}#my#P#my#R#my#T#my#X#my#Z#my#^#my#_#my#a#my#c#my#l#my#o#my#s#my#u#my#z#my#}#my$P#my%X#my%o#my%p#my%t#my%u#my&Z#my&[#my&]#my&^#my&_#my&`#my&a#my&b#my&c#my&d#my&e#my&f#my&g#my&h#my&i#my&j#my%Z#my%_#my~O%Z-]O%_-]O~P`O#q-^OP#nyV#nyf#nyh#nyo#nys#nyv#ny!P#ny!Q#ny!T#ny!U#ny!X#ny!]#ny!h#ny!r#ny!s#ny!t#ny!{#ny!}#ny#P#ny#R#ny#T#ny#X#ny#Z#ny#^#ny#_#ny#a#ny#c#ny#l#ny#o#ny#s#ny#u#ny#z#ny#}#ny$P#ny%X#ny%o#ny%p#ny%t#ny%u#ny&Z#ny&[#ny&]#ny&^#ny&_#ny&`#ny&a#ny&b#ny&c#ny&d#ny&e#ny&f#ny&g#ny&h#ny&i#ny&j#ny%Z#ny%_#ny~Oz-aO{$jO#[-aO~Oo0cOv0qO{&xq~P'vOz-dO{&xq~O%z,[Og&zaz&za~O{#{Og&zaz&za~OV*SOa*TO%q*UO%uWOg&ya~Oz-hOg&ya~O$S-lO~OV$}Oa$}Oo0cOv0qO~P'vOo0cOv0qO{-mOz$li!W$li~P'vOo0cOv0qOz$li!W$li~P'vO{-mOz$li!W$li~Oo0cOv0qO{*gO~P'vOo0cOv0qO{*gO!W&Xq~P'vOz-pO!W&Xq~Oo0cOv0qOz-pO!W&Xq~P'vOs-sO!T%dO!U%cOg&Oq!W&Oq![&Oqz&Oq~P!/jOa+QOo0cOv0qO![&Ty~P'vOz$ji![$ji~P%SOa+QOo0cOv0qO~P'vOV+UOo0cOv0qO~P'vOV+UOo0cOv0qO{&lq![&lq!m&lq%z&lq~P'vO{(kO![-xO!m-yO%z-wO~OV&OOo0cOv0qO#g%hq%[%hq%_%hq%z%hq~P'vO%uWO#g&ry%[&ry%_&ryg&ry~OV)`Oa)`O%uWO!W&ui~Ot-}OP#m!RV#m!Rf#m!Rh#m!Ro#m!Rs#m!Rv#m!R!P#m!R!Q#m!R!T#m!R!U#m!R!X#m!R!]#m!R!h#m!R!r#m!R!s#m!R!t#m!R!{#m!R!}#m!R#P#m!R#R#m!R#T#m!R#X#m!R#Z#m!R#^#m!R#_#m!R#a#m!R#c#m!R#l#m!R#o#m!R#s#m!R#u#m!R#z#m!R#}#m!R$P#m!R%X#m!R%o#m!R%p#m!R%t#m!R%u#m!R&Z#m!R&[#m!R&]#m!R&^#m!R&_#m!R&`#m!R&a#m!R&b#m!R&c#m!R&d#m!R&e#m!R&f#m!R&g#m!R&h#m!R&i#m!R&j#m!R%Z#m!R%_#m!R~Oo0cOv0qO{&xy~P'vOV*SOa*TO%q*UO%uWOg&yi~O$S-lO%Z.VO%_.VO~OV.aOh._O!X.^O!].`O!h.YO!s.[O!t.[O%p.XO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O~Oo0cOv0qOz$lq!W$lq~P'vO{.fOz$lq!W$lq~Oo0cOv0qO{*gO!W&Xy~P'vOz.gO!W&Xy~Oo0cOv.kO~P'vOs-sO!T%dO!U%cOg&Oy!W&Oy![&Oyz&Oy~P!/jO{(kO![.nO~O{(kO![.nO!m.oO~OV*SOa*TO%q*UO%uWO~Oh.tO!f.rOz$TX#[$TX%j$TXg$TX~Os$TX{$TX!W$TX![$TX~P$-bO%o.vO%p.vOs$UXz$UX{$UX#[$UX%j$UX!W$UXg$UX![$UX~O!h.xO~Oz.|O#[/OO%j.yOs&|X{&|X!W&|Xg&|X~Oa/RO~P$)zOh.tOs&}Xz&}X{&}X#[&}X%j&}X!W&}Xg&}X![&}X~Os/VO{$jO~Oo0cOv0qOz$ly!W$ly~P'vOo0cOv0qO{*gO!W&X!R~P'vOz/ZO!W&X!R~Og&RXs&RX!T&RX!U&RX!W&RX![&RXz&RX~P!/jOs-sO!T%dO!U%cOg&Qa!W&Qa![&Qaz&Qa~O{(kO![/^O~O!f.rOh$[as$[az$[a{$[a#[$[a%j$[a!W$[ag$[a![$[a~O!h/eO~O%o.vO%p.vOs$Uaz$Ua{$Ua#[$Ua%j$Ua!W$Uag$Ua![$Ua~O%j.yOs$Yaz$Ya{$Ya#[$Ya!W$Yag$Ya![$Ya~Os&|a{&|a!W&|ag&|a~P$)nOz/jOs&|a{&|a!W&|ag&|a~O!W/mO~Og/mO~O{/oO~O![/pO~Oo0cOv0qO{*gO!W&X!Z~P'vO{/sO~O%z/tO~P$-bOz/uO#[/OO%j.yOg'PX~Oz/uOg'PX~Og/wO~O!h/xO~O#[/OOs%Saz%Sa{%Sa%j%Sa!W%Sag%Sa![%Sa~O#[/OO%j.yOs%Waz%Wa{%Wa!W%Wag%Wa~Os&|i{&|i!W&|ig&|i~P$)nOz/zO#[/OO%j.yO!['Oa~Og'Pa~P$)nOz0SOg'Pa~Oa0UO!['Oi~P$)zOz0WO!['Oi~Oz0WO#[/OO%j.yO!['Oi~O#[/OO%j.yOg$biz$bi~O%z0ZO~P$-bO#[/OO%j.yOg%Vaz%Va~Og'Pi~P$)nO{0^O~Oa0UO!['Oq~P$)zOz0`O!['Oq~O#[/OO%j.yOz%Ui![%Ui~Oa0UO~P$)zOa0UO!['Oy~P$)zO#[/OO%j.yOg$ciz$ci~O#[/OO%j.yOz%Uq![%Uq~Oz+aO#g%ha%[%ha%_%ha%z%ha~P%SOV&OOo0cOv0qO~P'vOn0hO~Oo0hO~P'vO{0iO~Ot0jO~P!/jO&]&Z&j&h&i&g&f&d&e&c&b&`&a&_&^&[%u~",goto:"!=j'QPPPPPP'RP'Z*s+[+t,_,y-fP.SP'Z.r.r'ZPPP'Z2[PPPPPP2[5PPP5PP7b7k=sPP=v>h>kPP'Z'ZPP>zPP'Z'ZPP'Z'Z'Z'Z'Z?O?w'ZP?zP@QDXGuGyPG|HWH['ZPPPH_Hk'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHqH}IVPI^IdPI^PI^I^PPPI^PKrPK{LVL]KrPI^LfPI^PLmLsPLwM]MzNeLwLwNkNxLwLwLwLw! ^! d! g! l! o! y!!P!!]!!o!!u!#P!#V!#s!#y!$P!$Z!$a!$g!$y!%T!%Z!%a!%k!%q!%w!%}!&T!&Z!&e!&k!&u!&{!'U!'[!'k!'s!'}!(UPPPPPPPPPPP!([!(_!(e!(n!(x!)TPPPPPPPPPPPP!-u!/Z!3^!6oPP!6w!7W!7a!8Y!8P!8c!8i!8l!8o!8r!8z!9jPPPPPPPPPPPPPPPPP!9m!9q!9wP!:]!:a!:m!:v!;S!;j!;m!;p!;v!;|!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[Nmn,Lmn,Dmn,Bmn,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:t=>zmn[t]||-1}],tokenPrec:7668}),KOt=new Zbe,ZOt=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function MK(t){return(e,r,n)=>{if(n)return!1;let i=e.node.getChild("VariableName");return i&&r(i,t),!0}}const Vmn={FunctionDefinition:MK("function"),ClassDefinition:MK("class"),ForStatement(t,e,r){if(r){for(let n=t.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")e(n,"variable");else if(n.name=="in")break}},ImportStatement(t,e){var r,n;let{node:i}=t,a=((r=i.firstChild)===null||r===void 0?void 0:r.name)=="from";for(let s=i.getChild("import");s;s=s.nextSibling)s.name=="VariableName"&&((n=s.nextSibling)===null||n===void 0?void 0:n.name)!="as"&&e(s,a?"variable":"namespace")},AssignStatement(t,e){for(let r=t.node.firstChild;r;r=r.nextSibling)if(r.name=="VariableName")e(r,"variable");else if(r.name==":"||r.name=="AssignOp")break},ParamList(t,e){for(let r=null,n=t.node.firstChild;n;n=n.nextSibling)n.name=="VariableName"&&(!r||!/\*|AssignOp/.test(r.name))&&e(n,"variable"),r=n},CapturePattern:MK("variable"),AsPattern:MK("variable"),__proto__:null};function JOt(t,e){let r=KOt.get(e);if(r)return r;let n=[],i=!0;function a(s,o){let l=t.sliceString(s.from,s.to);n.push({label:l,type:o})}return e.cursor(Wi.IncludeAnonymous).iterate(s=>{if(s.name){let o=Vmn[s.name];if(o&&o(s,a,i)||!i&&ZOt.has(s.name))return!1;i=!1}else if(s.to-s.from>8192){for(let o of JOt(t,s.node))n.push(o);return!1}}),KOt.set(e,n),n}const ekt=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,tkt=["String","FormatString","Comment","PropertyName"];function Qmn(t){let e=pa(t.state).resolveInner(t.pos,-1);if(tkt.indexOf(e.name)>-1)return null;let r=e.name=="VariableName"||e.to-e.from<20&&ekt.test(t.state.sliceDoc(e.from,e.to));if(!r&&!t.explicit)return null;let n=[];for(let i=e;i;i=i.parent)ZOt.has(i.name)&&(n=n.concat(JOt(t.state.doc,i)));return{options:n,from:r?e.from:t.pos,validFor:ekt}}const Gmn=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(t=>({label:t,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(t=>({label:t,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(t=>({label:t,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(t=>({label:t,type:"function"}))),Hmn=[As("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),As("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),As("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),As("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),As(`if \${}: + +`,{label:"if",detail:"block",type:"keyword"}),As("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),As("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),As("import ${module}",{label:"import",detail:"statement",type:"keyword"}),As("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],Wmn=PTt(tkt,B2e(Gmn.concat(Hmn)));function Dwe(t){let{node:e,pos:r}=t,n=t.lineIndent(r,-1),i=null;for(;;){let a=e.childBefore(r);if(a)if(a.name=="Comment")r=a.from;else if(a.name=="Body"||a.name=="MatchBody")t.baseIndentFor(a)+t.unit<=n&&(i=a),e=a;else if(a.name=="MatchClause")e=a;else if(a.type.is("Statement"))e=a;else break;else break}return i}function Lwe(t,e){let r=t.baseIndentFor(e),n=t.lineAt(t.pos,-1),i=n.from+n.text.length;return/^\s*($|#)/.test(n.text)&&t.node.tor?null:r+t.unit}const Mwe=jy.define({name:"python",parser:Umn.configure({props:[Ky.add({Body:t=>{var e;let r=/^\s*(#|$)/.test(t.textAfter)&&Dwe(t)||t.node;return(e=Lwe(t,r))!==null&&e!==void 0?e:t.continue()},MatchBody:t=>{var e;let r=Dwe(t);return(e=Lwe(t,r||t.node))!==null&&e!==void 0?e:t.continue()},IfStatement:t=>/^\s*(else:|elif )/.test(t.textAfter)?t.baseIndent:t.continue(),"ForStatement WhileStatement":t=>/^\s*else:/.test(t.textAfter)?t.baseIndent:t.continue(),TryStatement:t=>/^\s*(except[ :]|finally:|else:)/.test(t.textAfter)?t.baseIndent:t.continue(),MatchStatement:t=>/^\s*case /.test(t.textAfter)?t.baseIndent+t.unit:t.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":S4({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":S4({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":S4({closing:"]"}),MemberExpression:t=>t.baseIndent+t.unit,"String FormatString":()=>null,Script:t=>{var e;let r=Dwe(t);return(e=r&&Lwe(t,r))!==null&&e!==void 0?e:t.continue()}}),Zy.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":l$,Body:(t,e)=>({from:t.from+1,to:t.to-(t.to==e.doc.length?0:1)}),"String FormatString":(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function Ymn(){return new u2(Mwe,[Mwe.data.of({autocomplete:Qmn}),Mwe.data.of({autocomplete:Wmn})])}const L4=63,rkt=64,qmn=1,jmn=2,nkt=3,Xmn=4,ikt=5,Kmn=6,Zmn=7,akt=65,Jmn=66,e0n=8,t0n=9,r0n=10,n0n=11,i0n=12,skt=13,a0n=19,s0n=20,o0n=29,l0n=33,c0n=34,u0n=47,h0n=0,Iwe=1,Pwe=2,k$=3,Nwe=4;class KT{constructor(e,r,n){this.parent=e,this.depth=r,this.type=n,this.hash=(e?e.hash+e.hash<<8:0)+r+(r<<4)+n}}KT.top=new KT(null,-1,h0n);function E$(t,e){for(let r=0,n=e-t.pos-1;;n--,r++){let i=t.peek(n);if(s1(i)||i==-1)return r}}function Bwe(t){return t==32||t==9}function s1(t){return t==10||t==13}function okt(t){return Bwe(t)||s1(t)}function ZT(t){return t<0||okt(t)}const d0n=new gK({start:KT.top,reduce(t,e){return t.type==k$&&(e==s0n||e==c0n)?t.parent:t},shift(t,e,r,n){if(e==nkt)return new KT(t,E$(n,n.pos),Iwe);if(e==akt||e==ikt)return new KT(t,E$(n,n.pos),Pwe);if(e==L4)return t.parent;if(e==a0n||e==l0n)return new KT(t,0,k$);if(e==skt&&t.type==Nwe)return t.parent;if(e==u0n){let i=/[1-9]/.exec(n.read(n.pos,r.pos));if(i)return new KT(t,t.depth+ +i[0],Nwe)}return t},hash(t){return t.hash}});function M4(t,e,r=0){return t.peek(r)==e&&t.peek(r+1)==e&&t.peek(r+2)==e&&ZT(t.peek(r+3))}const f0n=new uo((t,e)=>{if(t.next==-1&&e.canShift(rkt))return t.acceptToken(rkt);let r=t.peek(-1);if((s1(r)||r<0)&&e.context.type!=k$){if(M4(t,45))if(e.canShift(L4))t.acceptToken(L4);else return t.acceptToken(qmn,3);if(M4(t,46))if(e.canShift(L4))t.acceptToken(L4);else return t.acceptToken(jmn,3);let n=0;for(;t.next==32;)n++,t.advance();(n{if(e.context.type==k$){t.next==63&&(t.advance(),ZT(t.next)&&t.acceptToken(Zmn));return}if(t.next==45)t.advance(),ZT(t.next)&&t.acceptToken(e.context.type==Iwe&&e.context.depth==E$(t,t.pos-1)?Xmn:nkt);else if(t.next==63)t.advance(),ZT(t.next)&&t.acceptToken(e.context.type==Pwe&&e.context.depth==E$(t,t.pos-1)?Kmn:ikt);else{let r=t.pos;for(;;)if(Bwe(t.next)){if(t.pos==r)return;t.advance()}else if(t.next==33)ukt(t);else if(t.next==38)$we(t);else if(t.next==42){$we(t);break}else if(t.next==39||t.next==34){if(Fwe(t,!0))break;return}else if(t.next==91||t.next==123){if(!m0n(t))return;break}else{hkt(t,!0,!1,0);break}for(;Bwe(t.next);)t.advance();if(t.next==58){if(t.pos==r&&e.canShift(o0n))return;let n=t.peek(1);ZT(n)&&t.acceptTokenTo(e.context.type==Pwe&&e.context.depth==E$(t,r)?Jmn:akt,r)}}},{contextual:!0});function g0n(t){return t>32&&t<127&&t!=34&&t!=37&&t!=44&&t!=60&&t!=62&&t!=92&&t!=94&&t!=96&&t!=123&&t!=124&&t!=125}function lkt(t){return t>=48&&t<=57||t>=97&&t<=102||t>=65&&t<=70}function ckt(t,e){return t.next==37?(t.advance(),lkt(t.next)&&t.advance(),lkt(t.next)&&t.advance(),!0):g0n(t.next)||e&&t.next==44?(t.advance(),!0):!1}function ukt(t){if(t.advance(),t.next==60){for(t.advance();;)if(!ckt(t,!0)){t.next==62&&t.advance();break}}else for(;ckt(t,!1););}function $we(t){for(t.advance();!ZT(t.next)&&IK(t.next)!="f";)t.advance()}function Fwe(t,e){let r=t.next,n=!1,i=t.pos;for(t.advance();;){let a=t.next;if(a<0)break;if(t.advance(),a==r)if(a==39)if(t.next==39)t.advance();else break;else break;else if(a==92&&r==34)t.next>=0&&t.advance();else if(s1(a)){if(e)return!1;n=!0}else if(e&&t.pos>=i+1024)return!1}return!n}function m0n(t){for(let e=[],r=t.pos+1024;;)if(t.next==91||t.next==123)e.push(t.next),t.advance();else if(t.next==39||t.next==34){if(!Fwe(t,!0))return!1}else if(t.next==93||t.next==125){if(e[e.length-1]!=t.next-2)return!1;if(e.pop(),t.advance(),!e.length)return!0}else{if(t.next<0||t.pos>r||s1(t.next))return!1;t.advance()}}const v0n="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function IK(t){return t<33?"u":t>125?"s":v0n[t-33]}function zwe(t,e){let r=IK(t);return r!="u"&&!(e&&r=="f")}function hkt(t,e,r,n){if(IK(t.next)=="s"||(t.next==63||t.next==58||t.next==45)&&zwe(t.peek(1),r))t.advance();else return!1;let i=t.pos;for(;;){let a=t.next,s=0,o=n+1;for(;okt(a);){if(s1(a)){if(e)return!1;o=0}else o++;a=t.peek(++s)}if(!(a>=0&&(a==58?zwe(t.peek(s+1),r):a==35?t.peek(s-1)!=32:zwe(a,r)))||!r&&o<=n||o==0&&!r&&(M4(t,45,s)||M4(t,46,s)))break;if(e&&IK(a)=="f")return!1;for(let u=s;u>=0;u--)t.advance();if(e&&t.pos>i+1024)return!1}return!0}const y0n=new uo((t,e)=>{if(t.next==33)ukt(t),t.acceptToken(i0n);else if(t.next==38||t.next==42){let r=t.next==38?r0n:n0n;$we(t),t.acceptToken(r)}else t.next==39||t.next==34?(Fwe(t,!1),t.acceptToken(t0n)):hkt(t,!1,e.context.type==k$,e.context.depth)&&t.acceptToken(e0n)}),b0n=new uo((t,e)=>{let r=e.context.type==Nwe?e.context.depth:-1,n=t.pos;e:for(;;){let i=0,a=t.next;for(;a==32;)a=t.peek(++i);if(!i&&(M4(t,45,i)||M4(t,46,i))||!s1(a)&&(r<0&&(r=Math.max(e.context.depth+1,i)),iYAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:d0n,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[x0n],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[f0n,p0n,y0n,b0n,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),A0n=jy.define({name:"yaml",parser:w0n.configure({props:[Ky.add({Stream:t=>{for(let e=t.node.resolve(t.pos,-1);e&&e.to>=t.pos;e=e.parent){if(e.name=="BlockLiteralContent"&&e.fromt.pos)return null}}return null},FlowMapping:S4({closing:"}"}),FlowSequence:S4({closing:"]"})}),Zy.add({"FlowMapping FlowSequence":l$,"Item Pair BlockLiteral":(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function S0n(){return new u2(A0n)}function T0n(t){dkt(t,"start");var e={},r=t.languageData||{},n=!1;for(var i in t)if(i!=r&&t.hasOwnProperty(i))for(var a=e[i]=[],s=t[i],o=0;o2&&s.token&&typeof s.token!="string"){r.pending=[];for(var u=2;u-1)return null;var i=r.indent.length-1,a=t[r.state];e:for(;;){for(var s=0;s{let{state:e}=t,r=e.doc.lineAt(e.selection.main.from),n=Qwe(t.state,r.from);return n.line?z0n(t):n.block?V0n(t):!1};function Vwe(t,e){return({state:r,dispatch:n})=>{if(r.readOnly)return!1;let i=t(e,r);return i?(n(r.update(i)),!0):!1}}const z0n=Vwe(H0n,0),U0n=Vwe(vkt,0),V0n=Vwe((t,e)=>vkt(t,e,G0n(e)),0);function Qwe(t,e){let r=t.languageDataAt("commentTokens",e,1);return r.length?r[0]:{}}const _$=50;function Q0n(t,{open:e,close:r},n,i){let a=t.sliceDoc(n-_$,n),s=t.sliceDoc(i,i+_$),o=/\s*$/.exec(a)[0].length,l=/^\s*/.exec(s)[0].length,u=a.length-o;if(a.slice(u-e.length,u)==e&&s.slice(l,l+r.length)==r)return{open:{pos:n-o,margin:o&&1},close:{pos:i+l,margin:l&&1}};let h,d;i-n<=2*_$?h=d=t.sliceDoc(n,i):(h=t.sliceDoc(n,n+_$),d=t.sliceDoc(i-_$,i));let f=/^\s*/.exec(h)[0].length,p=/\s*$/.exec(d)[0].length,g=d.length-p-r.length;return h.slice(f,f+e.length)==e&&d.slice(g,g+r.length)==r?{open:{pos:n+f+e.length,margin:/\s/.test(h.charAt(f+e.length))?1:0},close:{pos:i-p-r.length,margin:/\s/.test(d.charAt(g-1))?1:0}}:null}function G0n(t){let e=[];for(let r of t.selection.ranges){let n=t.doc.lineAt(r.from),i=r.to<=n.to?n:t.doc.lineAt(r.to);i.from>n.from&&i.from==r.to&&(i=r.to==n.to+1?n:t.doc.lineAt(r.to-1));let a=e.length-1;a>=0&&e[a].to>n.from?e[a].to=i.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:i.to})}return e}function vkt(t,e,r=e.selection.ranges){let n=r.map(a=>Qwe(e,a.from).block);if(!n.every(a=>a))return null;let i=r.map((a,s)=>Q0n(e,n[s],a.from,a.to));if(t!=2&&!i.every(a=>a))return{changes:e.changes(r.map((a,s)=>i[s]?[]:[{from:a.from,insert:n[s].open+" "},{from:a.to,insert:" "+n[s].close}]))};if(t!=1&&i.some(a=>a)){let a=[];for(let s=0,o;si&&(a==s||s>d.from)){i=d.from;let f=/^\s*/.exec(d.text)[0].length,p=f==d.length,g=d.text.slice(f,f+u.length)==u?f:-1;fa.comment<0&&(!a.empty||a.single))){let a=[];for(let{line:o,token:l,indent:u,empty:h,single:d}of n)(d||!h)&&a.push({from:o.from+u,insert:l+" "});let s=e.changes(a);return{changes:s,selection:e.selection.map(s,1)}}else if(t!=1&&n.some(a=>a.comment>=0)){let a=[];for(let{line:s,comment:o,token:l}of n)if(o>=0){let u=s.from+o,h=u+l.length;s.text[h-s.from]==" "&&h++,a.push({from:u,to:h})}return{changes:a}}return null}const Gwe=c0.define(),W0n=c0.define(),Y0n=vr.define(),ykt=vr.define({combine(t){return u0(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,r)=>r},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,r)=>(n,i)=>e(n,i)||r(n,i)})}}),bkt=Vs.define({create(){return x0.empty},update(t,e){let r=e.state.facet(ykt),n=e.annotation(Gwe);if(n){let l=Fh.fromTransaction(e,n.selection),u=n.side,h=u==0?t.undone:t.done;return l?h=NK(h,h.length,r.minDepth,l):h=Akt(h,e.startState.selection),new x0(u==0?n.rest:h,u==0?h:n.rest)}let i=e.annotation(W0n);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(Do.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let a=Fh.fromTransaction(e),s=e.annotation(Do.time),o=e.annotation(Do.userEvent);return a?t=t.addChanges(a,s,o,r,e):e.selection&&(t=t.addSelection(e.startState.selection,s,o,r.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new x0(t.done.map(Fh.fromJSON),t.undone.map(Fh.fromJSON))}});function q0n(t={}){return[bkt,ykt.of(t),er.domEventHandlers({beforeinput(e,r){let n=e.inputType=="historyUndo"?xkt:e.inputType=="historyRedo"?Hwe:null;return n?(e.preventDefault(),n(r)):!1}})]}function PK(t,e){return function({state:r,dispatch:n}){if(!e&&r.readOnly)return!1;let i=r.field(bkt,!1);if(!i)return!1;let a=i.pop(t,r,e);return a?(n(a),!0):!1}}const xkt=PK(0,!1),Hwe=PK(1,!1),j0n=PK(0,!0),X0n=PK(1,!0);class Fh{constructor(e,r,n,i,a){this.changes=e,this.effects=r,this.mapped=n,this.startSelection=i,this.selectionsAfter=a}setSelAfter(e){return new Fh(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,r,n;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(r=this.mapped)===null||r===void 0?void 0:r.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new Fh(e.changes&&co.fromJSON(e.changes),[],e.mapped&&l0.fromJSON(e.mapped),e.startSelection&&bt.fromJSON(e.startSelection),e.selectionsAfter.map(bt.fromJSON))}static fromTransaction(e,r){let n=op;for(let i of e.startState.facet(Y0n)){let a=i(e);a.length&&(n=n.concat(a))}return!n.length&&e.changes.empty?null:new Fh(e.changes.invert(e.startState.doc),n,void 0,r||e.startState.selection,op)}static selection(e){return new Fh(void 0,op,void 0,void 0,e)}}function NK(t,e,r,n){let i=e+1>r+20?e-r-1:0,a=t.slice(i,e);return a.push(n),a}function K0n(t,e){let r=[],n=!1;return t.iterChangedRanges((i,a)=>r.push(i,a)),e.iterChangedRanges((i,a,s,o)=>{for(let l=0;l=u&&s<=h&&(n=!0)}}),n}function Z0n(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((r,n)=>r.empty!=e.ranges[n].empty).length===0}function wkt(t,e){return t.length?e.length?t.concat(e):t:e}const op=[],J0n=200;function Akt(t,e){if(t.length){let r=t[t.length-1],n=r.selectionsAfter.slice(Math.max(0,r.selectionsAfter.length-J0n));return n.length&&n[n.length-1].eq(e)?t:(n.push(e),NK(t,t.length-1,1e9,r.setSelAfter(n)))}else return[Fh.selection([e])]}function evn(t){let e=t[t.length-1],r=t.slice();return r[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),r}function Wwe(t,e){if(!t.length)return t;let r=t.length,n=op;for(;r;){let i=tvn(t[r-1],e,n);if(i.changes&&!i.changes.empty||i.effects.length){let a=t.slice(0,r);return a[r-1]=i,a}else e=i.mapped,r--,n=i.selectionsAfter}return n.length?[Fh.selection(n)]:op}function tvn(t,e,r){let n=wkt(t.selectionsAfter.length?t.selectionsAfter.map(o=>o.map(e)):op,r);if(!t.changes)return Fh.selection(n);let i=t.changes.map(e),a=e.mapDesc(t.changes,!0),s=t.mapped?t.mapped.composeDesc(a):a;return new Fh(i,nn.mapEffects(t.effects,e),s,t.startSelection.map(a),n)}const rvn=/^(input\.type|delete)($|\.)/;class x0{constructor(e,r,n=0,i=void 0){this.done=e,this.undone=r,this.prevTime=n,this.prevUserEvent=i}isolate(){return this.prevTime?new x0(this.done,this.undone):this}addChanges(e,r,n,i,a){let s=this.done,o=s[s.length-1];return o&&o.changes&&!o.changes.empty&&e.changes&&(!n||rvn.test(n))&&(!o.selectionsAfter.length&&r-this.prevTime0&&r-this.prevTimer.empty?t.moveByChar(r,e):BK(r,e))}function eu(t){return t.textDirectionAt(t.state.selection.main.head)==Sa.LTR}const Tkt=t=>Skt(t,!eu(t)),Ckt=t=>Skt(t,eu(t));function Okt(t,e){return mg(t,r=>r.empty?t.moveByGroup(r,e):BK(r,e))}const ivn=t=>Okt(t,!eu(t)),avn=t=>Okt(t,eu(t));function svn(t,e,r){if(e.type.prop(r))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function $K(t,e,r){let n=pa(t).resolveInner(e.head),i=r?En.closedBy:En.openedBy;for(let l=e.head;;){let u=r?n.childAfter(l):n.childBefore(l);if(!u)break;svn(t,u,i)?n=u:l=r?u.to:u.from}let a=n.type.prop(i),s,o;return a&&(s=r?y0(t,n.from,1):y0(t,n.to,-1))&&s.matched?o=r?s.end.to:s.end.from:o=r?n.to:n.from,bt.cursor(o,r?-1:1)}const ovn=t=>mg(t,e=>$K(t.state,e,!eu(t))),lvn=t=>mg(t,e=>$K(t.state,e,eu(t)));function kkt(t,e){return mg(t,r=>{if(!r.empty)return BK(r,e);let n=t.moveVertically(r,e);return n.head!=r.head?n:t.moveToLineBoundary(r,e)})}const Ekt=t=>kkt(t,!1),_kt=t=>kkt(t,!0);function Rkt(t){let e=t.scrollDOM.clientHeights.empty?t.moveVertically(s,e,r.height):BK(s,e));if(i.eq(n.selection))return!1;let a;if(r.selfScroll){let s=t.coordsAtPos(n.selection.main.head),o=t.scrollDOM.getBoundingClientRect(),l=o.top+r.marginTop,u=o.bottom-r.marginBottom;s&&s.top>l&&s.bottomDkt(t,!1),Ywe=t=>Dkt(t,!0);function d2(t,e,r){let n=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,r);if(i.head==e.head&&i.head!=(r?n.to:n.from)&&(i=t.moveToLineBoundary(e,r,!1)),!r&&i.head==n.from&&n.length){let a=/^\s*/.exec(t.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;a&&e.head!=n.from+a&&(i=bt.cursor(n.from+a))}return i}const cvn=t=>mg(t,e=>d2(t,e,!0)),uvn=t=>mg(t,e=>d2(t,e,!1)),hvn=t=>mg(t,e=>d2(t,e,!eu(t))),dvn=t=>mg(t,e=>d2(t,e,eu(t))),fvn=t=>mg(t,e=>bt.cursor(t.lineBlockAt(e.head).from,1)),pvn=t=>mg(t,e=>bt.cursor(t.lineBlockAt(e.head).to,-1));function gvn(t,e,r){let n=!1,i=I4(t.selection,a=>{let s=y0(t,a.head,-1)||y0(t,a.head,1)||a.head>0&&y0(t,a.head-1,1)||a.headgvn(t,e);function lp(t,e,r){let n=I4(t.state.selection,i=>{i.undirectional&&i.head>=i.anchor!=e&&(i=bt.range(i.head,i.anchor));let a=r(i);return bt.range(i.anchor,a.head,a.goalColumn,a.bidiLevel||void 0,a.assoc)});return n.eq(t.state.selection)?!1:(t.dispatch(gg(t.state,n)),!0)}function Mkt(t,e){return lp(t,e,r=>t.moveByChar(r,e))}const Ikt=t=>Mkt(t,!eu(t)),Pkt=t=>Mkt(t,eu(t));function Nkt(t,e){return lp(t,e,r=>t.moveByGroup(r,e))}const vvn=t=>Nkt(t,!eu(t)),yvn=t=>Nkt(t,eu(t)),bvn=t=>{let e=!eu(t);return lp(t,e,r=>$K(t.state,r,e))},xvn=t=>{let e=eu(t);return lp(t,e,r=>$K(t.state,r,e))};function Bkt(t,e){return lp(t,e,r=>t.moveVertically(r,e))}const $kt=t=>Bkt(t,!1),Fkt=t=>Bkt(t,!0);function zkt(t,e){return lp(t,e,r=>t.moveVertically(r,e,Rkt(t).height))}const Ukt=t=>zkt(t,!1),Vkt=t=>zkt(t,!0),wvn=t=>lp(t,!0,e=>d2(t,e,!0)),Avn=t=>lp(t,!1,e=>d2(t,e,!1)),Svn=t=>{let e=!eu(t);return lp(t,e,r=>d2(t,r,e))},Tvn=t=>{let e=eu(t);return lp(t,e,r=>d2(t,r,e))},Cvn=t=>lp(t,!1,e=>bt.cursor(t.lineBlockAt(e.head).from)),Ovn=t=>lp(t,!0,e=>bt.cursor(t.lineBlockAt(e.head).to)),Qkt=({state:t,dispatch:e})=>(e(gg(t,{anchor:0})),!0),Gkt=({state:t,dispatch:e})=>(e(gg(t,{anchor:t.doc.length})),!0),Hkt=({state:t,dispatch:e})=>(e(gg(t,{anchor:t.selection.main.anchor,head:0})),!0),Wkt=({state:t,dispatch:e})=>(e(gg(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),kvn=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),Evn=({state:t,dispatch:e})=>{let r=zK(t).map(({from:n,to:i})=>bt.range(n,Math.min(i+1,t.doc.length)));return e(t.update({selection:bt.create(r),userEvent:"select"})),!0},_vn=({state:t,dispatch:e})=>{let r=I4(t.selection,n=>{let i=pa(t),a=i.resolveStack(n.from,1);if(n.empty){let s=i.resolveStack(n.from,-1);s.node.from>=a.node.from&&s.node.to<=a.node.to&&(a=s)}for(let s=a;s;s=s.next){let{node:o}=s;if((o.from=n.to||o.to>n.to&&o.from<=n.from)&&s.next)return bt.range(o.to,o.from)}return n});return r.eq(t.selection)?!1:(e(gg(t,r)),!0)};function Ykt(t,e){let{state:r}=t,n=r.selection,i=r.selection.ranges.slice();for(let a of r.selection.ranges){let s=r.doc.lineAt(a.head);if(e?s.to0)for(let o=a;;){let l=t.moveVertically(o,e);if(l.heads.to){i.some(u=>u.head==l.head)||i.push(l);break}else{if(l.head==o.head)break;o=l}}}return i.length==n.ranges.length?!1:(t.dispatch(gg(r,bt.create(i,i.length-1))),!0)}const Rvn=t=>Ykt(t,!1),Dvn=t=>Ykt(t,!0),Lvn=({state:t,dispatch:e})=>{let r=t.selection,n=null;return r.ranges.length>1?n=bt.create([r.main]):r.main.empty||(n=bt.create([bt.cursor(r.main.head)])),n?(e(gg(t,n)),!0):!1};function R$(t,e){if(t.state.readOnly)return!1;let r="delete.selection",{state:n}=t,i=n.changeByRange(a=>{let{from:s,to:o}=a;if(s==o){let l=e(a);ls&&(r="delete.forward",l=FK(t,l,!0)),s=Math.min(s,l),o=Math.max(o,l)}else s=FK(t,s,!1),o=FK(t,o,!0);return s==o?{range:a}:{changes:{from:s,to:o},range:bt.cursor(s,si(t)))n.between(e,e,(i,a)=>{ie&&(e=r?a:i)});return e}const qkt=(t,e,r)=>R$(t,n=>{let i=n.from,{state:a}=t,s=a.doc.lineAt(i),o,l;if(r&&!e&&i>s.from&&iqkt(t,!1,!0),jkt=t=>qkt(t,!0,!1),Xkt=(t,e)=>R$(t,r=>{let n=r.head,{state:i}=t,a=i.doc.lineAt(n),s=i.charCategorizer(n);for(let o=null;;){if(n==(e?a.to:a.from)){n==r.head&&a.number!=(e?i.doc.lines:1)&&(n+=e?1:-1);break}let l=Dl(a.text,n-a.from,e)+a.from,u=a.text.slice(Math.min(n,l)-a.from,Math.max(n,l)-a.from),h=s(u);if(o!=null&&h!=o)break;(u!=" "||n!=r.head)&&(o=h),n=l}return n}),Kkt=t=>Xkt(t,!1),Mvn=t=>Xkt(t,!0),Ivn=t=>R$(t,e=>{let r=t.lineBlockAt(e.head).to;return e.headR$(t,e=>{let r=t.moveToLineBoundary(e,!1).head;return e.head>r?r:Math.max(0,e.head-1)}),Nvn=t=>R$(t,e=>{let r=t.moveToLineBoundary(e,!0).head;return e.head{if(t.readOnly)return!1;let r=t.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:vi.of(["",""])},range:bt.cursor(n.from)}));return e(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0},$vn=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{if(!n.empty||n.from==0||n.from==t.doc.length)return{range:n};let i=n.from,a=t.doc.lineAt(i),s=i==a.from?i-1:Dl(a.text,i-a.from,!1)+a.from,o=i==a.to?i+1:Dl(a.text,i-a.from,!0)+a.from;return{changes:{from:s,to:o,insert:t.doc.slice(i,o).append(t.doc.slice(s,i))},range:bt.cursor(o)}});return r.changes.empty?!1:(e(t.update(r,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function zK(t){let e=[],r=-1;for(let n of t.selection.ranges){let i=t.doc.lineAt(n.from),a=t.doc.lineAt(n.to);if(!n.empty&&n.to==a.from&&(a=t.doc.lineAt(n.to-1)),r>=i.number){let s=e[e.length-1];s.to=a.to,s.ranges.push(n)}else e.push({from:i.from,to:a.to,ranges:[n]});r=a.number+1}return e}function Zkt(t,e,r){if(t.readOnly)return!1;let n=[],i=[];for(let a of zK(t)){if(r?a.to==t.doc.length:a.from==0)continue;let s=t.doc.lineAt(r?a.to+1:a.from-1),o=s.length+1;if(r){n.push({from:a.to,to:s.to},{from:a.from,insert:s.text+t.lineBreak});for(let l of a.ranges)i.push(bt.range(Math.min(t.doc.length,l.anchor+o),Math.min(t.doc.length,l.head+o)))}else{n.push({from:s.from,to:a.from},{from:a.to,insert:t.lineBreak+s.text});for(let l of a.ranges)i.push(bt.range(l.anchor-o,l.head-o))}}return n.length?(e(t.update({changes:n,scrollIntoView:!0,selection:bt.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Fvn=({state:t,dispatch:e})=>Zkt(t,e,!1),zvn=({state:t,dispatch:e})=>Zkt(t,e,!0);function Jkt(t,e,r){if(t.readOnly)return!1;let n=[];for(let a of zK(t))r?n.push({from:a.from,insert:t.doc.slice(a.from,a.to)+t.lineBreak}):n.push({from:a.to,insert:t.lineBreak+t.doc.slice(a.from,a.to)});let i=t.changes(n);return e(t.update({changes:i,selection:t.selection.map(i,r?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Uvn=({state:t,dispatch:e})=>Jkt(t,e,!1),Vvn=({state:t,dispatch:e})=>Jkt(t,e,!0),Qvn=t=>{if(t.state.readOnly)return!1;let{state:e}=t,r=e.changes(zK(e).map(({from:i,to:a})=>(i>0?i--:a{let a;if(t.lineWrapping){let s=t.lineBlockAt(i.head),o=t.coordsAtPos(i.head,i.assoc||1);o&&(a=s.bottom+t.documentTop-o.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,a)}).map(r);return t.dispatch({changes:r,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Gvn(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let r=pa(t).resolveInner(e),n=r.childBefore(e),i=r.childAfter(e),a;return n&&i&&n.to<=e&&i.from>=e&&(a=n.type.prop(En.closedBy))&&a.indexOf(i.name)>-1&&t.doc.lineAt(n.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(n.to,i.from))?{from:n.to,to:i.from}:null}const eEt=tEt(!1),Hvn=tEt(!0);function tEt(t){return({state:e,dispatch:r})=>{if(e.readOnly)return!1;let n=e.changeByRange(i=>{let{from:a,to:s}=i,o=e.doc.lineAt(a),l=!t&&a==s&&Gvn(e,a);t&&(a=s=(s<=o.to?o:e.doc.lineAt(s)).to);let u=new oK(e,{simulateBreak:a,simulateDoubleBreak:!!l}),h=w2e(u,a);for(h==null&&(h=hg(/^\s*/.exec(e.doc.lineAt(a).text)[0],e.tabSize));so.from&&a{let i=[];for(let s=n.from;s<=n.to;){let o=t.doc.lineAt(s);o.number>r&&(n.empty||n.to>o.from)&&(e(o,i,n),r=o.number),s=o.to+1}let a=t.changes(i);return{changes:i,range:bt.range(a.mapPos(n.anchor,1),a.mapPos(n.head,1))}})}const Wvn=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=Object.create(null),n=new oK(t,{overrideIndentation:a=>{let s=r[a];return s??-1}}),i=jwe(t,(a,s,o)=>{let l=w2e(n,a.from);if(l==null)return;/\S/.test(a.text)||(l=0);let u=/^\s*/.exec(a.text)[0],h=o$(t,l);(u!=h||o.fromt.readOnly?!1:(e(t.update(jwe(t,(r,n)=>{n.push({from:r.from,insert:t.facet(A4)})}),{userEvent:"input.indent"})),!0),nEt=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(jwe(t,(r,n)=>{let i=/^\s*/.exec(r.text)[0];if(!i)return;let a=hg(i,t.tabSize),s=0,o=o$(t,Math.max(0,a-HT(t)));for(;s(t.setTabFocusMode(),!0),qvn=[{key:"Ctrl-b",run:Tkt,shift:Ikt,preventDefault:!0},{key:"Ctrl-f",run:Ckt,shift:Pkt},{key:"Ctrl-p",run:Ekt,shift:$kt},{key:"Ctrl-n",run:_kt,shift:Fkt},{key:"Ctrl-a",run:fvn,shift:Cvn},{key:"Ctrl-e",run:pvn,shift:Ovn},{key:"Ctrl-d",run:jkt},{key:"Ctrl-h",run:qwe},{key:"Ctrl-k",run:Ivn},{key:"Ctrl-Alt-h",run:Kkt},{key:"Ctrl-o",run:Bvn},{key:"Ctrl-t",run:$vn},{key:"Ctrl-v",run:Ywe}],jvn=[{key:"ArrowLeft",run:Tkt,shift:Ikt,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:ivn,shift:vvn,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:hvn,shift:Svn,preventDefault:!0},{key:"ArrowRight",run:Ckt,shift:Pkt,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:avn,shift:yvn,preventDefault:!0},{mac:"Cmd-ArrowRight",run:dvn,shift:Tvn,preventDefault:!0},{key:"ArrowUp",run:Ekt,shift:$kt,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Qkt,shift:Hkt},{mac:"Ctrl-ArrowUp",run:Lkt,shift:Ukt},{key:"ArrowDown",run:_kt,shift:Fkt,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Gkt,shift:Wkt},{mac:"Ctrl-ArrowDown",run:Ywe,shift:Vkt},{key:"PageUp",run:Lkt,shift:Ukt},{key:"PageDown",run:Ywe,shift:Vkt},{key:"Home",run:uvn,shift:Avn,preventDefault:!0},{key:"Mod-Home",run:Qkt,shift:Hkt},{key:"End",run:cvn,shift:wvn,preventDefault:!0},{key:"Mod-End",run:Gkt,shift:Wkt},{key:"Enter",run:eEt,shift:eEt},{key:"Mod-a",run:kvn},{key:"Backspace",run:qwe,shift:qwe,preventDefault:!0},{key:"Delete",run:jkt,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Kkt,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Mvn,preventDefault:!0},{mac:"Mod-Backspace",run:Pvn,preventDefault:!0},{mac:"Mod-Delete",run:Nvn,preventDefault:!0}].concat(qvn.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),Xvn=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:ovn,shift:bvn},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:lvn,shift:xvn},{key:"Alt-ArrowUp",run:Fvn},{key:"Shift-Alt-ArrowUp",run:Uvn},{key:"Alt-ArrowDown",run:zvn},{key:"Shift-Alt-ArrowDown",run:Vvn},{key:"Mod-Alt-ArrowUp",run:Rvn},{key:"Mod-Alt-ArrowDown",run:Dvn},{key:"Escape",run:Lvn},{key:"Mod-Enter",run:Hvn},{key:"Alt-l",mac:"Ctrl-l",run:Evn},{key:"Mod-i",run:_vn,preventDefault:!0},{key:"Mod-[",run:nEt},{key:"Mod-]",run:rEt},{key:"Mod-Alt-\\",run:Wvn},{key:"Shift-Mod-k",run:Qvn},{key:"Shift-Mod-\\",run:mvn},{key:"Mod-/",run:F0n},{key:"Alt-A",run:U0n},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Yvn}].concat(jvn),Kvn={key:"Tab",run:rEt,shift:nEt},iEt=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class P4{constructor(e,r,n=0,i=e.length,a,s){this.test=s,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,i),this.bufferStart=n,this.normalize=a?o=>a(iEt(o)):iEt,this.query=this.normalize(r)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ph(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let r=rxe(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=o0(e);let i=this.normalize(r);if(i.length)for(let a=0,s=n,o=!0;;a++){let l=i.charCodeAt(a),u=this.match(l,s,o,this.bufferPos+this.bufferStart,a==i.length-1);if(u)return this.value=u,this;if(a==i.length-1)break;o&&athis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let r=this.matchPos<=this.to&&this.re.exec(this.curLine);if(r){let n=this.curLineStart+r.index,i=n+r[0].length;if(this.matchPos=UK(this.text,i+(n==i?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(nthis.value.to)&&(!this.test||this.test(n,i,r)))return this.value={from:n,to:i,precise:!0,match:r},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=n||i.to<=r){let o=new N4(r,e.sliceString(r,n));return Kwe.set(e,o),o}if(i.from==r&&i.to==n)return i;let{text:a,from:s}=i;return s>r&&(a=e.sliceString(r,s)+a,s=r),i.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,r=this.re.exec(this.flat.text);if(r&&!r[0]&&r.index==e&&(this.re.lastIndex=e+1,r=this.re.exec(this.flat.text)),r){let n=this.flat.from+r.index,i=n+r[0].length;if((this.flat.to>=this.to||r.index+r[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,i,r)))return this.value={from:n,to:i,precise:!0,match:r},this.matchPos=UK(this.text,i+(n==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=N4.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(sEt.prototype[Symbol.iterator]=oEt.prototype[Symbol.iterator]=function(){return this});function Zvn(t){try{return new RegExp(t,Xwe),!0}catch{return!1}}function UK(t,e){if(e>=t.length)return e;let r=t.lineAt(e),n;for(;e=56320&&n<57344;)e++;return e}const Jvn=t=>{let{state:e}=t,r=String(e.doc.lineAt(t.state.selection.main.head).number),{close:n,result:i}=Aun(t,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:r},focus:!0,submitLabel:e.phrase("go")});return i.then(a=>{let s=a&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(a.elements.line.value);if(!s){t.dispatch({effects:n});return}let o=e.doc.lineAt(e.selection.main.head),[,l,u,h,d]=s,f=h?+h.slice(1):0,p=u?+u:o.number;if(u&&d){let v=p/100;l&&(v=v*(l=="-"?-1:1)+o.number/e.doc.lines),p=Math.round(e.doc.lines*v)}else u&&l&&(p=p*(l=="-"?-1:1)+o.number);let g=e.doc.line(Math.max(1,Math.min(e.doc.lines,p))),m=bt.cursor(g.from+Math.max(0,Math.min(f,g.length)));t.dispatch({effects:[n,er.scrollIntoView(m.from,{y:"center"})],selection:m})}),!0},eyn={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},tyn=vr.define({combine(t){return u0(t,eyn,{highlightWordAroundCursor:(e,r)=>e||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function ryn(t){return[oyn,syn]}const nyn=Ar.mark({class:"cm-selectionMatch"}),iyn=Ar.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function lEt(t,e,r,n){return(r==0||t(e.sliceDoc(r-1,r))!=ps.Word)&&(n==e.doc.length||t(e.sliceDoc(n,n+1))!=ps.Word)}function ayn(t,e,r,n){return t(e.sliceDoc(r,r+1))==ps.Word&&t(e.sliceDoc(n-1,n))==ps.Word}const syn=ws.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(tyn),{state:r}=t,n=r.selection;if(n.ranges.length>1)return Ar.none;let i=n.main,a,s=null;if(i.empty){if(!e.highlightWordAroundCursor)return Ar.none;let l=r.wordAt(i.head);if(!l)return Ar.none;s=r.charCategorizer(i.head),a=r.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l200)return Ar.none;if(e.wholeWords){if(a=r.sliceDoc(i.from,i.to),s=r.charCategorizer(i.head),!(lEt(s,r,i.from,i.to)&&ayn(s,r,i.from,i.to)))return Ar.none}else if(a=r.sliceDoc(i.from,i.to),!a)return Ar.none}let o=[];for(let l of t.visibleRanges){let u=new P4(r.doc,a,l.from,l.to);for(;!u.next().done;){let{from:h,to:d}=u.value;if((!s||lEt(s,r,h,d))&&(i.empty&&h<=i.from&&d>=i.to?o.push(iyn.range(h,d)):(h>=i.to||d<=i.from)&&o.push(nyn.range(h,d)),o.length>e.maxMatches))return Ar.none}}return Ar.set(o)}},{decorations:t=>t.decorations}),oyn=er.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),lyn=({state:t,dispatch:e})=>{let{selection:r}=t,n=bt.create(r.ranges.map(i=>t.wordAt(i.head)||bt.cursor(i.head)),r.mainIndex);return n.eq(r)?!1:(e(t.update({selection:n})),!0)};function cyn(t,e){let{main:r,ranges:n}=t.selection,i=t.wordAt(r.head),a=i&&i.from==r.from&&i.to==r.to;for(let s=!1,o=new P4(t.doc,e,n[n.length-1].to);;)if(o.next(),o.done){if(s)return null;o=new P4(t.doc,e,0,Math.max(0,n[n.length-1].from-1)),s=!0}else{if(s&&n.some(l=>l.from==o.value.from))continue;if(a){let l=t.wordAt(o.value.from);if(!l||l.from!=o.value.from||l.to!=o.value.to)continue}return o.value}}const uyn=({state:t,dispatch:e})=>{let{ranges:r}=t.selection;if(r.some(a=>a.from===a.to))return lyn({state:t,dispatch:e});let n=t.sliceDoc(r[0].from,r[0].to);if(t.selection.ranges.some(a=>t.sliceDoc(a.from,a.to)!=n))return!1;let i=cyn(t,n);return i?(e(t.update({selection:t.selection.addRange(bt.range(i.from,i.to),!1),effects:er.scrollIntoView(i.to)})),!0):!1},B4=vr.define({combine(t){return u0(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Tyn(e),scrollToMatch:e=>er.scrollIntoView(e)})}});class cEt{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||Zvn(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(r,n)=>n=="n"?` +`:n=="r"?"\r":n=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new myn(this):new fyn(this)}getCursor(e,r=0,n){let i=e.doc?e:Kn.create({doc:e});return n==null&&(n=i.doc.length),this.regexp?F4(this,i,r,n):$4(this,i,r,n)}}class uEt{constructor(e){this.spec=e}}function hyn(t,e,r){return(n,i,a,s)=>{if(r&&!r(n,i,a,s))return!1;let o=n>=s&&i<=s+a.length?a.slice(n-s,i-s):e.doc.sliceString(n,i);return t(o,e,n,i)}}function $4(t,e,r,n){let i;return t.wholeWord&&(i=dyn(e.doc,e.charCategorizer(e.selection.main.head))),t.test&&(i=hyn(t.test,e,i)),new P4(e.doc,t.unquoted,r,n,t.caseSensitive?void 0:a=>a.toLowerCase(),i)}function dyn(t,e){return(r,n,i,a)=>((a>r||a+i.length=r)return null;i.push(n.value)}return i}highlight(e,r,n,i){let a=$4(this.spec,e,Math.max(0,r-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!a.next().done;)i(a.value.from,a.value.to)}}function pyn(t,e,r){return(n,i,a)=>(!r||r(n,i,a))&&t(a[0],e,n,i)}function F4(t,e,r,n){let i;return t.wholeWord&&(i=gyn(e.charCategorizer(e.selection.main.head))),t.test&&(i=pyn(t.test,e,i)),new sEt(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:i},r,n)}function VK(t,e){return t.slice(Dl(t,e,!1),e)}function QK(t,e){return t.slice(e,Dl(t,e))}function gyn(t){return(e,r,n)=>!n[0].length||(t(VK(n.input,n.index))!=ps.Word||t(QK(n.input,n.index))!=ps.Word)&&(t(QK(n.input,n.index+n[0].length))!=ps.Word||t(VK(n.input,n.index+n[0].length))!=ps.Word)}class myn extends uEt{nextMatch(e,r,n){let i=F4(this.spec,e,n,e.doc.length).next();return i.done&&(i=F4(this.spec,e,0,r).next()),i.done?null:i.value}prevMatchInRange(e,r,n){for(let i=1;;i++){let a=Math.max(r,n-i*1e4),s=F4(this.spec,e,a,n),o=null;for(;!s.next().done;)o=s.value;if(o&&(a==r||o.from>a+10))return o;if(a==r)return null}}prevMatch(e,r,n){return this.prevMatchInRange(e,0,r)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(r,n)=>{if(n=="&")return e.match[0];if(n=="$")return"$";for(let i=n.length;i>0;i--){let a=+n.slice(0,i);if(a>0&&a=r)return null;i.push(n.value)}return i}highlight(e,r,n,i){let a=F4(this.spec,e,Math.max(0,r-250),Math.min(n+250,e.doc.length));for(;!a.next().done;)i(a.value.from,a.value.to)}}const D$=nn.define(),Zwe=nn.define(),f2=Vs.define({create(t){return new Jwe(tAe(t).create(),null)},update(t,e){for(let r of e.effects)r.is(D$)?t=new Jwe(r.value.create(),t.panel):r.is(Zwe)&&(t=new Jwe(t.query,r.value?eAe:null));return t},provide:t=>r$.from(t,e=>e.panel)});class Jwe{constructor(e,r){this.query=e,this.panel=r}}const vyn=Ar.mark({class:"cm-searchMatch"}),yyn=Ar.mark({class:"cm-searchMatch cm-searchMatch-selected"}),byn=ws.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(f2))}update(t){let e=t.state.field(f2);(e!=t.startState.field(f2)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return Ar.none;let{view:r}=this,n=new Lu;for(let i=0,a=r.visibleRanges,s=a.length;ia[i+1].from-2*250;)l=a[++i].to;t.highlight(r.state,o,l,(u,h)=>{let d=r.state.selection.ranges.some(f=>f.from==u&&f.to==h);n.add(u,h,d?yyn:vyn)})}return n.finish()}},{decorations:t=>t.decorations});function L$(t){return e=>{let r=e.state.field(f2,!1);return r&&r.query.spec.valid?t(e,r):pEt(e)}}const GK=L$((t,{query:e})=>{let{to:r}=t.state.selection.main,n=e.nextMatch(t.state,r,r);if(!n)return!1;let i=bt.single(n.from,n.to),a=t.state.facet(B4);return t.dispatch({selection:i,effects:[rAe(t,n),a.scrollToMatch(i.main,t)],userEvent:"select.search"}),fEt(t),!0}),HK=L$((t,{query:e})=>{let{state:r}=t,{from:n}=r.selection.main,i=e.prevMatch(r,n,n);if(!i)return!1;let a=bt.single(i.from,i.to),s=t.state.facet(B4);return t.dispatch({selection:a,effects:[rAe(t,i),s.scrollToMatch(a.main,t)],userEvent:"select.search"}),fEt(t),!0}),xyn=L$((t,{query:e})=>{let r=e.matchAll(t.state,1e3);return!r||!r.length?!1:(t.dispatch({selection:bt.create(r.map(n=>bt.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),wyn=({state:t,dispatch:e})=>{let r=t.selection;if(r.ranges.length>1||r.main.empty)return!1;let{from:n,to:i}=r.main,a=[],s=0;for(let o=new P4(t.doc,t.sliceDoc(n,i));!o.next().done;){if(a.length>1e3)return!1;o.value.from==n&&(s=a.length),a.push(bt.range(o.value.from,o.value.to))}return e(t.update({selection:bt.create(a,s),userEvent:"select.search.matches"})),!0},hEt=L$((t,{query:e})=>{let{state:r}=t,{from:n,to:i}=r.selection.main;if(r.readOnly)return!1;let a=e.nextMatch(r,n,n);if(!a)return!1;let s=a,o=[],l,u,h=[];s.precise?s.from==n&&s.to==i&&(u=r.toText(e.getReplacement(s)),o.push({from:s.from,to:s.to,insert:u}),s=e.nextMatch(r,s.from,s.to),h.push(er.announce.of(r.phrase("replaced match on line $",r.doc.lineAt(n).number)+"."))):s=e.nextMatch(r,s.from,s.to);let d=t.state.changes(o);return s&&(l=bt.single(s.from,s.to).map(d),h.push(rAe(t,s)),h.push(r.facet(B4).scrollToMatch(l.main,t))),t.dispatch({changes:d,selection:l,effects:h,userEvent:"input.replace"}),!0}),Ayn=L$((t,{query:e})=>{if(t.state.readOnly)return!1;let r=[];for(let i of e.matchAll(t.state,1e9)){let{from:a,to:s,precise:o}=i;o&&r.push({from:a,to:s,insert:e.getReplacement(i)})}if(!r.length)return!1;let n=t.state.phrase("replaced $ matches",r.length)+".";return t.dispatch({changes:r,effects:er.announce.of(n),userEvent:"input.replace.all"}),!0});function eAe(t){return t.state.facet(B4).createPanel(t)}function tAe(t,e){var r,n,i,a,s;let o=t.selection.main,l=o.empty||o.to>o.from+100?"":t.sliceDoc(o.from,o.to);if(e&&!l)return e;let u=t.facet(B4);return new cEt({search:((r=e==null?void 0:e.literal)!==null&&r!==void 0?r:u.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(n=e==null?void 0:e.caseSensitive)!==null&&n!==void 0?n:u.caseSensitive,literal:(i=e==null?void 0:e.literal)!==null&&i!==void 0?i:u.literal,regexp:(a=e==null?void 0:e.regexp)!==null&&a!==void 0?a:u.regexp,wholeWord:(s=e==null?void 0:e.wholeWord)!==null&&s!==void 0?s:u.wholeWord})}function dEt(t){let e=u2e(t,eAe);return e&&e.dom.querySelector("[main-field]")}function fEt(t){let e=dEt(t);e&&e==t.root.activeElement&&e.select()}const pEt=t=>{let e=t.state.field(f2,!1);if(e&&e.panel){let r=dEt(t);if(r&&r!=t.root.activeElement){let n=tAe(t.state,e.query.spec);n.valid&&t.dispatch({effects:D$.of(n)}),r.focus(),r.select()}}else t.dispatch({effects:[Zwe.of(!0),e?D$.of(tAe(t.state,e.query.spec)):nn.appendConfig.of(Oyn)]});return!0},gEt=t=>{let e=t.state.field(f2,!1);if(!e||!e.panel)return!1;let r=u2e(t,eAe);return r&&r.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:Zwe.of(!1)}),!0},Syn=[{key:"Mod-f",run:pEt,scope:"editor search-panel"},{key:"F3",run:GK,shift:HK,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:GK,shift:HK,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:gEt,scope:"editor search-panel"},{key:"Mod-Shift-l",run:wyn},{key:"Mod-Alt-g",run:Jvn},{key:"Mod-d",run:uyn,preventDefault:!0}];class Tyn{constructor(e){this.view=e;let r=this.query=e.state.field(f2).query.spec;this.commit=this.commit.bind(this),this.searchField=fa("input",{value:r.search,placeholder:Hd(e,"Find"),"aria-label":Hd(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=fa("input",{value:r.replace,placeholder:Hd(e,"Replace"),"aria-label":Hd(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=fa("input",{type:"checkbox",name:"case",form:"",checked:r.caseSensitive,onchange:this.commit}),this.reField=fa("input",{type:"checkbox",name:"re",form:"",checked:r.regexp,onchange:this.commit}),this.wordField=fa("input",{type:"checkbox",name:"word",form:"",checked:r.wholeWord,onchange:this.commit});function n(i,a,s){return fa("button",{class:"cm-button",name:i,onclick:a,type:"button"},s)}this.dom=fa("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,n("next",()=>GK(e),[Hd(e,"next")]),n("prev",()=>HK(e),[Hd(e,"previous")]),n("select",()=>xyn(e),[Hd(e,"all")]),fa("label",null,[this.caseField,Hd(e,"match case")]),fa("label",null,[this.reField,Hd(e,"regexp")]),fa("label",null,[this.wordField,Hd(e,"by word")]),...e.state.readOnly?[]:[fa("br"),this.replaceField,n("replace",()=>hEt(e),[Hd(e,"replace")]),n("replaceAll",()=>Ayn(e),[Hd(e,"replace all")])],fa("button",{name:"close",onclick:()=>gEt(e),"aria-label":Hd(e,"close"),type:"button"},["×"])])}commit(){let e=new cEt({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:D$.of(e)}))}keydown(e){Dcn(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?HK:GK)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),hEt(this.view))}update(e){for(let r of e.transactions)for(let n of r.effects)n.is(D$)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(B4).top}}function Hd(t,e){return t.state.phrase(e)}const WK=30,YK=/[\s\.,:;?!]/;function rAe(t,{from:e,to:r}){let n=t.state.doc.lineAt(e),i=t.state.doc.lineAt(r).to,a=Math.max(n.from,e-WK),s=Math.min(i,r+WK),o=t.state.sliceDoc(a,s);if(a!=n.from){for(let l=0;lo.length-WK;l--)if(!YK.test(o[l-1])&&YK.test(o[l])){o=o.slice(0,l);break}}return er.announce.of(`${t.state.phrase("current match")}. ${o} ${t.state.phrase("on line")} ${n.number}.`)}const Cyn=er.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Oyn=[f2,Fd.low(byn),Cyn];class mEt{constructor(e,r,n){this.from=e,this.to=r,this.diagnostic=n}}class JT{constructor(e,r,n){this.diagnostics=e,this.panel=r,this.selected=n}static init(e,r,n){let i=n.facet(M$).markerFilter;i&&(e=i(e,n));let a=e.slice().sort((p,g)=>p.from-g.from||p.to-g.to),s=new Lu,o=[],l=0,u=n.doc.iter(),h=0,d=n.doc.length;for(let p=0;;){let g=p==a.length?null:a[p];if(!g&&!o.length)break;let m,v;if(o.length)m=l,v=o.reduce((x,w)=>Math.min(x,w.to),g&&g.from>m?g.from:1e8);else{if(m=g.from,m>d)break;v=g.to,o.push(g),p++}for(;px.from||x.to==m))o.push(x),p++,v=Math.min(x.to,v);else{v=Math.min(x.from,v);break}}v=Math.min(v,d);let y=!1;if(o.some(x=>x.from==m&&(x.to==v||v==d))&&(y=m==v,!y&&v-m<10)){let x=m-(h+u.value.length);x>0&&(u.next(x),h=m);for(let w=m;;){if(w>=v){y=!0;break}if(!u.lineBreak&&h+u.value.length>w)break;w=h+u.value.length,h+=u.value.length,u.next()}}let b=$yn(o);if(y)s.add(m,m,Ar.widget({widget:new Iyn(b),diagnostics:o.slice()}));else{let x=o.reduce((w,A)=>A.markClass?w+" "+A.markClass:w,"");s.add(m,v,Ar.mark({class:"cm-lintRange cm-lintRange-"+b+x,diagnostics:o.slice(),inclusiveEnd:o.some(w=>w.to>v)}))}if(l=v,l==d)break;for(let x=0;x{if(!(e&&s.diagnostics.indexOf(e)<0))if(!n)n=new mEt(i,a,e||s.diagnostics[0]);else{if(s.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new mEt(n.from,a,n.diagnostic)}}),n}function kyn(t,e){let r=e.pos,n=e.end||r,i=t.state.facet(M$).hideOn(t,r,n);if(i!=null)return i;let a=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(s=>s.is(vEt))||t.changes.touchesRange(a.from,Math.max(a.to,n)))}function Eyn(t,e){return t.field(Wd,!1)?e:e.concat(nn.appendConfig.of(Fyn))}const vEt=nn.define(),nAe=nn.define(),yEt=nn.define(),Wd=Vs.define({create(){return new JT(Ar.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let r=t.diagnostics.map(e.changes),n=null,i=t.panel;if(t.selected){let a=e.changes.mapPos(t.selected.from,1);n=p2(r,t.selected.diagnostic,a)||p2(r,null,a)}!r.size&&i&&e.state.facet(M$).autoPanel&&(i=null),t=new JT(r,i,n)}for(let r of e.effects)if(r.is(vEt)){let n=e.state.facet(M$).autoPanel?r.value.length?I$.open:null:t.panel;t=JT.init(r.value,n,e.state)}else r.is(nAe)?t=new JT(t.diagnostics,r.value?I$.open:null,t.selected):r.is(yEt)&&(t=new JT(t.diagnostics,t.panel,r.value));return t},provide:t=>[r$.from(t,e=>e.panel),er.decorations.from(t,e=>e.diagnostics)]}),_yn=Ar.mark({class:"cm-lintRange cm-lintRange-active"});function Ryn(t,e,r){let{diagnostics:n}=t.state.field(Wd),i,a=-1,s=-1;n.between(e-(r<0?1:0),e+(r>0?1:0),(l,u,{spec:h})=>{if(e>=l&&e<=u&&(l==u||(e>l||r>0)&&(eAEt(t,r,!1)))}const Lyn=t=>{let e=t.state.field(Wd,!1);(!e||!e.panel)&&t.dispatch({effects:Eyn(t.state,[nAe.of(!0)])});let r=u2e(t,I$.open);return r&&r.dom.querySelector(".cm-panel-lint ul").focus(),!0},bEt=t=>{let e=t.state.field(Wd,!1);return!e||!e.panel?!1:(t.dispatch({effects:nAe.of(!1)}),!0)},Myn=[{key:"Mod-Shift-m",run:Lyn,preventDefault:!0},{key:"F8",run:t=>{let e=t.state.field(Wd,!1);if(!e)return!1;let r=t.state.selection.main,n=p2(e.diagnostics,null,r.to+1);return!n&&(n=p2(e.diagnostics,null,0),!n||n.from==r.from&&n.to==r.to)?!1:(t.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0}),xun(t,n.from,1,{tooltip:TEt,until:i=>i.docChanged||i.newSelection.main.headn.to}),!0)}}],M$=vr.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...u0(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:xEt,tooltipFilter:xEt,needsRefresh:(e,r)=>e?r?n=>e(n)||r(n):e:r,hideOn:(e,r)=>e?r?(n,i,a)=>e(n,i,a)||r(n,i,a):e:r,autoPanel:(e,r)=>e||r})}}});function xEt(t,e){return t?e?(r,n)=>e(t(r,n),n):t:e}function wEt(t){let e=[];if(t)e:for(let{name:r}of t){for(let n=0;na.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function AEt(t,e,r){var n;let i=r?wEt(e.actions):[];return fa("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},fa("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(n=e.actions)===null||n===void 0?void 0:n.map((a,s)=>{let o=!1,l=p=>{if(p.preventDefault(),o)return;o=!0;let g=p2(t.state.field(Wd).diagnostics,e);g&&a.apply(t,g.from,g.to)},{name:u}=a,h=i[s]?u.indexOf(i[s]):-1,d=h<0?u:[u.slice(0,h),fa("u",u.slice(h,h+1)),u.slice(h+1)],f=a.markClass?" "+a.markClass:"";return fa("button",{type:"button",class:"cm-diagnosticAction"+f,onclick:l,onmousedown:l,"aria-label":` Action: ${u}${h<0?"":` (access key "${i[s]})"`}.`},d)}),e.source&&fa("div",{class:"cm-diagnosticSource"},e.source))}class Iyn extends Iu{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return fa("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class SEt{constructor(e,r){this.diagnostic=r,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=AEt(e,r,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class I${constructor(e){this.view=e,this.items=[];let r=i=>{if(!(i.ctrlKey||i.altKey||i.metaKey)){if(i.keyCode==27)bEt(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:a}=this.items[this.selectedIndex],s=wEt(a.actions);for(let o=0;o{for(let a=0;abEt(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Wd).selected;if(!e)return-1;for(let r=0;r{for(let h of u.diagnostics){if(s.has(h))continue;s.add(h);let d=-1,f;for(let p=n;pn&&(this.items.splice(n,d-n),i=!0)),r&&f.diagnostic==r.diagnostic?f.dom.hasAttribute("aria-selected")||(f.dom.setAttribute("aria-selected","true"),a=f):f.dom.hasAttribute("aria-selected")&&f.dom.removeAttribute("aria-selected"),n++}});n({sel:a.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:o,panel:l})=>{let u=l.height/this.list.offsetHeight;o.topl.bottom&&(this.list.scrollTop+=(o.bottom-l.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function r(){let n=e;e=n.nextSibling,n.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)r();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)r()}moveSelection(e){if(this.selectedIndex<0)return;let r=this.view.state.field(Wd),n=p2(r.diagnostics,this.items[e].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:yEt.of(n)})}static open(e){return new I$(e)}}function Pyn(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(t)}')`}function qK(t){return Pyn(``,'width="6" height="3"')}const Nyn=er.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:qK("#f11")},".cm-lintRange-warning":{backgroundImage:qK("orange")},".cm-lintRange-info":{backgroundImage:qK("#999")},".cm-lintRange-hint":{backgroundImage:qK("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function Byn(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function $yn(t){let e="hint",r=1;for(let n of t){let i=Byn(n.severity);i>r&&(r=i,e=n.severity)}return e}const TEt=bun(Ryn,{hideOn:kyn}),Fyn=[Wd,er.decorations.compute([Wd],t=>{let{selected:e,panel:r}=t.field(Wd);return!e||!r||e.from==e.to?Ar.none:Ar.set([_yn.range(e.from,e.to)])}),TEt,Nyn];var iAe=function(e){e===void 0&&(e={});var r=e,n=r.crosshairCursor,i=n===void 0?!1:n,a=[];e.closeBracketsKeymap!==!1&&(a=a.concat(Zdn)),e.defaultKeymap!==!1&&(a=a.concat(Xvn)),e.searchKeymap!==!1&&(a=a.concat(Syn)),e.historyKeymap!==!1&&(a=a.concat(nvn)),e.foldKeymap!==!1&&(a=a.concat(ahn)),e.completionKeymap!==!1&&(a=a.concat(ZTt)),e.lintKeymap!==!1&&(a=a.concat(Myn));var s=[];return e.lineNumbers!==!1&&s.push(zSt()),e.highlightActiveLineGutter!==!1&&s.push(Iun()),e.highlightSpecialChars!==!1&&s.push(qcn()),e.history!==!1&&s.push(q0n()),e.foldGutter!==!1&&s.push(chn()),e.drawSelection!==!1&&s.push(Bcn()),e.dropCursor!==!1&&s.push(Vcn()),e.allowMultipleSelections!==!1&&s.push(Kn.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&s.push(Jun()),e.syntaxHighlighting!==!1&&s.push(cTt(phn,{fallback:!0})),e.bracketMatching!==!1&&s.push(xhn()),e.closeBrackets!==!1&&s.push(jdn()),e.autocompletion!==!1&&s.push(afn()),e.rectangularSelection!==!1&&s.push(lun()),i!==!1&&s.push(hun()),e.highlightActiveLine!==!1&&s.push(eun()),e.highlightSelectionMatches!==!1&&s.push(ryn()),e.tabSize&&typeof e.tabSize=="number"&&s.push(A4.of(" ".repeat(e.tabSize))),s.concat([y4.of(a.flat())]).filter(Boolean)};const zyn="#e5c07b",CEt="#e06c75",Uyn="#56b6c2",Vyn="#ffffff",jK="#abb2bf",aAe="#7d8799",Qyn="#61afef",Gyn="#98c379",OEt="#d19a66",Hyn="#c678dd",Wyn="#21252b",kEt="#2c313a",EEt="#282c34",sAe="#353a42",Yyn="#3E4451",_Et="#528bff",qyn=er.theme({"&":{color:jK,backgroundColor:EEt},".cm-content":{caretColor:_Et},".cm-cursor, .cm-dropCursor":{borderLeftColor:_Et},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Yyn},".cm-panels":{backgroundColor:Wyn,color:jK},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:EEt,color:aAe,border:"none"},".cm-activeLineGutter":{backgroundColor:kEt},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:sAe},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:sAe,borderBottomColor:sAe},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:kEt,color:jK}}},{dark:!0}),jyn=u$.define([{tag:Ee.keyword,color:Hyn},{tag:[Ee.name,Ee.deleted,Ee.character,Ee.propertyName,Ee.macroName],color:CEt},{tag:[Ee.function(Ee.variableName),Ee.labelName],color:Qyn},{tag:[Ee.color,Ee.constant(Ee.name),Ee.standard(Ee.name)],color:OEt},{tag:[Ee.definition(Ee.name),Ee.separator],color:jK},{tag:[Ee.typeName,Ee.className,Ee.number,Ee.changed,Ee.annotation,Ee.modifier,Ee.self,Ee.namespace],color:zyn},{tag:[Ee.operator,Ee.operatorKeyword,Ee.url,Ee.escape,Ee.regexp,Ee.link,Ee.special(Ee.string)],color:Uyn},{tag:[Ee.meta,Ee.comment],color:aAe},{tag:Ee.strong,fontWeight:"bold"},{tag:Ee.emphasis,fontStyle:"italic"},{tag:Ee.strikethrough,textDecoration:"line-through"},{tag:Ee.link,color:aAe,textDecoration:"underline"},{tag:Ee.heading,fontWeight:"bold",color:CEt},{tag:[Ee.atom,Ee.bool,Ee.special(Ee.variableName)],color:OEt},{tag:[Ee.processingInstruction,Ee.string,Ee.inserted],color:Gyn},{tag:Ee.invalid,color:Vyn}]),REt=[qyn,cTt(jyn)];var Xyn=er.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),Kyn=function(e){e===void 0&&(e={});var r=e,n=r.indentWithTab,i=n===void 0?!0:n,a=r.editable,s=a===void 0?!0:a,o=r.readOnly,l=o===void 0?!1:o,u=r.theme,h=u===void 0?"light":u,d=r.placeholder,f=d===void 0?"":d,p=r.basicSetup,g=p===void 0?!0:p,m=[];switch(i&&m.unshift(y4.of([Kvn])),g&&(typeof g=="boolean"?m.unshift(iAe()):m.unshift(iAe(g))),f&&m.unshift(iun(f)),h){case"light":m.push(Xyn);break;case"dark":m.push(REt);break;case"none":break;default:m.push(h);break}return s===!1&&m.push(er.editable.of(!1)),l&&m.push(Kn.readOnly.of(!0)),[...m]},Zyn=t=>({line:t.state.doc.lineAt(t.state.selection.main.from),lineCount:t.state.doc.lines,lineBreak:t.state.lineBreak,length:t.state.doc.length,readOnly:t.state.readOnly,tabSize:t.state.tabSize,selection:t.state.selection,selectionAsSingle:t.state.selection.asSingle().main,ranges:t.state.selection.ranges,selectionCode:t.state.sliceDoc(t.state.selection.main.from,t.state.selection.main.to),selections:t.state.selection.ranges.map(e=>t.state.sliceDoc(e.from,e.to)),selectedText:t.state.selection.ranges.some(e=>!e.empty)});class Jyn{constructor(e,r){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=r,this.timeoutMS=r,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(r=>{try{r()}catch(n){console.error("TimeoutLatch callback error:",n)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class DEt{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var oAe=null,e1n=()=>typeof window>"u"?new DEt:(oAe||(oAe=new DEt),oAe),t1n=er.theme({"& .cm-scroller":{height:"100% !important"}}),LEt=null,lAe=null;function r1n(t,e,r,n,i,a){if(!t&&!e&&!r&&!n&&!i&&!a)return null;var s=JSON.stringify({height:t,minHeight:e,maxHeight:r,width:n,minWidth:i,maxWidth:a});return s===LEt||(LEt=s,lAe=er.theme({"&":{height:t,minHeight:e,maxHeight:r,width:n,minWidth:i,maxWidth:a}})),lAe}var MEt=c0.define(),n1n=200,i1n=[];function a1n(t){var e=t.value,r=t.selection,n=t.onChange,i=t.onStatistics,a=t.onCreateEditor,s=t.onUpdate,o=t.extensions,l=o===void 0?i1n:o,u=t.autoFocus,h=t.theme,d=h===void 0?"light":h,f=t.height,p=f===void 0?null:f,g=t.minHeight,m=g===void 0?null:g,v=t.maxHeight,y=v===void 0?null:v,b=t.width,x=b===void 0?null:b,w=t.minWidth,A=w===void 0?null:w,S=t.maxWidth,T=S===void 0?null:S,O=t.placeholder,k=O===void 0?"":O,E=t.editable,_=E===void 0?!0:E,I=t.readOnly,L=I===void 0?!1:I,R=t.indentWithTab,D=R===void 0?!0:R,M=t.basicSetup,P=M===void 0?!0:M,N=t.root,F=t.initialState,B=se.useState(),V=B[0],z=B[1],U=se.useState(),Q=U[0],G=U[1],X=se.useState(),Y=X[0],le=X[1],q=se.useState(()=>({current:null}))[0],Z=se.useState(()=>({current:null}))[0],ee=r1n(p,m,y,x,A,T),re=er.updateListener.of(Ce=>{if(Ce.docChanged&&typeof n=="function"&&!Ce.transactions.some(he=>he.annotation(MEt))){q.current?q.current.reset():(q.current=new Jyn(()=>{if(Z.current){var he=Z.current;Z.current=null,he()}q.current=null},n1n),e1n().add(q.current));var Oe=Ce.state.doc,$e=Oe.toString();n($e,Ce)}i&&i(Zyn(Ce))}),ve=Kyn({theme:d,editable:_,readOnly:L,placeholder:k,indentWithTab:D,basicSetup:P}),ae=[re,...ee?[ee]:[],t1n,...ve];return s&&typeof s=="function"&&ae.push(er.updateListener.of(s)),ae=ae.concat(l),se.useLayoutEffect(()=>{if(V&&!Y){var Ce={doc:e,selection:r,extensions:ae},Oe=F?Kn.fromJSON(F.json,Ce,F.fields):Kn.create(Ce);if(le(Oe),!Q){var $e=new er({state:Oe,parent:V,root:N});G($e),a&&a($e,Oe)}}return()=>{Q&&(le(void 0),G(void 0))}},[V,Y]),se.useEffect(()=>{t.container&&z(t.container)},[t.container]),se.useEffect(()=>()=>{Q&&(Q.destroy(),G(void 0)),q.current&&(q.current.cancel(),q.current=null)},[Q]),se.useEffect(()=>{u&&Q&&Q.focus()},[u,Q]),se.useEffect(()=>{Q&&Q.dispatch({effects:nn.reconfigure.of(ae)})},[d,l,p,m,y,x,A,T,k,_,L,D,P,n,s]),se.useEffect(()=>{if(e!==void 0){var Ce=Q?Q.state.doc.toString():"";if(Q&&e!==Ce){var Oe=q.current&&!q.current.isDone,$e=()=>{Q&&e!==Q.state.doc.toString()&&Q.dispatch({changes:{from:0,to:Q.state.doc.toString().length,insert:e||""},annotations:[MEt.of(!0)]})};Oe?Z.current=$e:$e()}}},[e,Q]),{state:Y,setState:le,view:Q,setView:G,container:V,setContainer:z}}var s1n=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],cAe=se.forwardRef((t,e)=>{var r=t.className,n=t.value,i=n===void 0?"":n,a=t.selection,s=t.extensions,o=s===void 0?[]:s,l=t.onChange,u=t.onStatistics,h=t.onCreateEditor,d=t.onUpdate,f=t.autoFocus,p=t.theme,g=p===void 0?"light":p,m=t.height,v=t.minHeight,y=t.maxHeight,b=t.width,x=t.minWidth,w=t.maxWidth,A=t.basicSetup,S=t.placeholder,T=t.indentWithTab,O=t.editable,k=t.readOnly,E=t.root,_=t.initialState,I=$0n(t,s1n),L=se.useRef(null),R=a1n({root:E,value:i,autoFocus:f,theme:g,height:m,minHeight:v,maxHeight:y,width:b,minWidth:x,maxWidth:w,basicSetup:A,placeholder:S,indentWithTab:T,editable:O,readOnly:k,selection:a,onChange:l,onStatistics:u,onCreateEditor:h,onUpdate:d,extensions:o,initialState:_}),D=R.state,M=R.view,P=R.container,N=R.setContainer;se.useImperativeHandle(e,()=>({editor:L.current,state:D,view:M}),[L,P,D,M]);var F=se.useCallback(V=>{L.current=V,N(V)},[N]);if(typeof i!="string")throw new Error("value must be typeof string but got "+typeof i);var B=typeof g=="string"?"cm-theme-"+g:"cm-theme";return W.jsx("div",Uwe({ref:F,className:""+B+(r?" "+r:"")},I))});cAe.displayName="CodeMirror";function XK(t){const e=t.toLowerCase(),r=e.split("/").pop()??e,n=r.includes(".")?r.split(".").pop():"";return r==="dockerfile"||r.startsWith("dockerfile.")||r.endsWith(".dockerfile")?[k2e.define(B0n)]:n==="py"||n==="pyi"?[Ymn()]:["ts","tsx","mts","cts"].includes(n??"")?[j2e({typescript:!0,jsx:n==="tsx"})]:["js","jsx","mjs","cjs"].includes(n??"")?[j2e({jsx:n==="jsx"})]:n==="json"||n==="jsonc"?[yfn()]:n==="yaml"||n==="yml"?[S0n()]:["md","markdown"].includes(n??"")?[kgn()]:[]}function o1n({value:t,path:e,onChange:r,readOnly:n=!1,theme:i="light",lineNumberStart:a=1,height:s="100%",minHeight:o,maxHeight:l}){const u=se.useMemo(()=>[...XK(e),...a===1?[]:[zSt({formatNumber:h=>String(h+a-1)})]],[a,e]);return W.jsx(cAe,{value:t,height:s,minHeight:o,maxHeight:l,theme:i,extensions:u,editable:!n,onChange:r,basicSetup:{lineNumbers:a===1,foldGutter:!0,highlightActiveLine:!0,highlightActiveLineGutter:!0,autocompletion:!1}})}const l1n=Object.freeze(Object.defineProperty({__proto__:null,default:o1n,languageFor:XK},Symbol.toStringTag,{value:"Module"}));class Lo{constructor(e,r,n,i){this.fromA=e,this.toA=r,this.fromB=n,this.toB=i}offset(e,r=e){return new Lo(this.fromA+e,this.toA+e,this.fromB+r,this.toB+r)}}function eC(t,e,r,n,i,a){if(t==n)return[];let s=fAe(t,e,r,n,i,a),o=pAe(t,e+s,r,n,i+s,a);e+=s,r-=o,i+=s,a-=o;let l=r-e,u=a-i;if(!l||!u)return[new Lo(e,r,i,a)];if(l>u){let d=t.slice(e,r).indexOf(n.slice(i,a));if(d>-1)return[new Lo(e,e+d,i,i),new Lo(e+d+u,r,a,a)]}else if(u>l){let d=n.slice(i,a).indexOf(t.slice(e,r));if(d>-1)return[new Lo(e,e,i,i+d),new Lo(r,r,i+d+l,a)]}if(l==1||u==1)return[new Lo(e,r,i,a)];let h=NEt(t,e,r,n,i,a);if(h){let[d,f,p]=h;return eC(t,e,d,n,i,f).concat(eC(t,d+p,r,n,f+p,a))}return c1n(t,e,r,n,i,a)}let P$=1e9,N$=0,uAe=!1;function c1n(t,e,r,n,i,a){let s=r-e,o=a-i;if(P$<1e9&&Math.min(s,o)>P$*16||N$>0&&Date.now()>N$)return Math.min(s,o)>P$*64?[new Lo(e,r,i,a)]:BEt(t,e,r,n,i,a);let l=Math.ceil((s+o)/2);hAe.reset(l),dAe.reset(l);let u=(p,g)=>t.charCodeAt(e+p)==n.charCodeAt(i+g),h=(p,g)=>t.charCodeAt(r-p-1)==n.charCodeAt(a-g-1),d=(s-o)%2!=0?dAe:null,f=d?null:hAe;for(let p=0;pP$||N$>0&&!(p&63)&&Date.now()>N$)return BEt(t,e,r,n,i,a);let g=hAe.advance(p,s,o,l,d,!1,u)||dAe.advance(p,s,o,l,f,!0,h);if(g)return u1n(t,e,r,e+g[0],n,i,a,i+g[1])}return[new Lo(e,r,i,a)]}class IEt{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let r=0;rr)this.end+=2;else if(d>n)this.start+=2;else if(a){let f=i+(r-n)-l;if(f>=0&&f=r-h)return[p,i+p-f]}else{let p=r-a.vec[f];if(h>=p)return[h,d]}}}return null}}const hAe=new IEt,dAe=new IEt;function u1n(t,e,r,n,i,a,s,o){let l=!1;return!z4(t,n)&&++n==r&&(l=!0),!z4(i,o)&&++o==s&&(l=!0),l?[new Lo(e,r,a,s)]:eC(t,e,n,i,a,o).concat(eC(t,n,r,i,o,s))}function PEt(t,e){let r=1,n=Math.min(t,e);for(;rr||h>a||t.slice(o,u)!=n.slice(l,h)){if(s==1)return o-e-(z4(t,o)?0:1);s=s>>1}else{if(u==r||h==a)return u-e;o=u,l=h}}}function pAe(t,e,r,n,i,a){if(e==r||i==a||t.charCodeAt(r-1)!=n.charCodeAt(a-1))return 0;let s=PEt(r-e,a-i);for(let o=r,l=a;;){let u=o-s,h=l-s;if(u>1}else{if(u==e||h==i)return r-u;o=u,l=h}}}function gAe(t,e,r,n,i,a,s,o){let l=n.slice(i,a),u=null;for(;;){if(u||s=r)break;let f=t.slice(h,d),p=-1;for(;(p=l.indexOf(f,p+1))!=-1;){let g=fAe(t,d,r,n,i+p+f.length,a),m=pAe(t,e,h,n,i,i+p),v=f.length+g+m;(!u||u[2]>1}}function NEt(t,e,r,n,i,a){let s=r-e,o=a-i;if(si.fromA-e&&n.toB>i.fromB-e&&(t[r-1]=new Lo(n.fromA,i.toA,n.fromB,i.toB),t.splice(r--,1))}}function h1n(t,e,r){for(;;){$Et(r,1);let n=!1;for(let i=0;i3||o>3){let l=i==t.length-1?e.length:t[i+1].fromA,u=a.fromA-n,h=l-a.toA,d=GEt(e,a.fromA,u),f=QEt(e,a.toA,h),p=a.fromA-d,g=f-a.toA;if((!s||!o)&&p&&g){let m=Math.max(s,o),[v,y,b]=s?[e,a.fromA,a.toA]:[r,a.fromB,a.toB];m>p&&e.slice(d,a.fromA)==v.slice(b-p,b)?(a=t[i]=new Lo(d,d+s,a.fromB-p,a.toB-p),d=a.fromA,f=QEt(e,a.toA,l-a.toA)):m>g&&e.slice(a.toA,f)==v.slice(y,y+g)&&(a=t[i]=new Lo(f-s,f,a.fromB+g,a.toB+g),f=a.toA,d=GEt(e,a.fromA,a.fromA-n)),p=a.fromA-d,g=f-a.toA}if(p||g)a=t[i]=new Lo(a.fromA-p,a.toA+g,a.fromB-p,a.toB+g);else if(s){if(!o){let m=WEt(e,a.fromA,a.toA),v,y=m<0?-1:HEt(e,a.toA,a.fromA);m>-1&&(v=m-a.fromA)<=h&&e.slice(a.fromA,m)==e.slice(a.toA,a.toA+v)?a=t[i]=a.offset(v):y>-1&&(v=a.toA-y)<=u&&e.slice(a.fromA-v,a.fromA)==e.slice(y,a.toA)&&(a=t[i]=a.offset(-v))}}else{let m=WEt(r,a.fromB,a.toB),v,y=m<0?-1:HEt(r,a.toB,a.fromB);m>-1&&(v=m-a.fromB)<=h&&r.slice(a.fromB,m)==r.slice(a.toB,a.toB+v)?a=t[i]=a.offset(v):y>-1&&(v=a.toB-y)<=u&&r.slice(a.fromB-v,a.fromB)==r.slice(y,a.toB)&&(a=t[i]=a.offset(-v))}}n=a.toA}return $Et(t,3),t}let tC;try{tC=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function FEt(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function zEt(t,e){if(e==t.length)return 0;let r=t.charCodeAt(e);return r<192?FEt(r)?1:0:tC?!YEt(r)||e==t.length-1?tC.test(String.fromCharCode(r))?1:0:tC.test(t.slice(e,e+2))?2:0:0}function UEt(t,e){if(!e)return 0;let r=t.charCodeAt(e-1);return r<192?FEt(r)?1:0:tC?!qEt(r)||e==1?tC.test(String.fromCharCode(r))?1:0:tC.test(t.slice(e-2,e))?2:0:0}const VEt=8;function QEt(t,e,r){if(e==t.length||!UEt(t,e))return e;for(let n=e,i=e+r,a=0;ai)return n;n+=s}return e}function GEt(t,e,r){if(!e||!zEt(t,e))return e;for(let n=e,i=e-r,a=0;at>=55296&&t<=56319,qEt=t=>t>=56320&&t<=57343;function z4(t,e){return!e||e==t.length||!YEt(t.charCodeAt(e-1))||!qEt(t.charCodeAt(e))}function f1n(t,e,r){var n;let i=r==null?void 0:r.override;return i?i(t,e):(P$=((n=r==null?void 0:r.scanLimit)!==null&&n!==void 0?n:1e9)>>1,N$=r!=null&&r.timeout?Date.now()+r.timeout:0,uAe=!1,h1n(t,e,eC(t,0,t.length,e,0,e.length)))}function jEt(){return!uAe}function XEt(t,e,r){return d1n(f1n(t,e,r),t,e)}const zh=vr.define({combine:t=>t[0]}),mAe=nn.define(),KEt=vr.define(),Bu=Vs.define({create(t){return null},update(t,e){for(let r of e.effects)r.is(mAe)&&(t=r.value);for(let r of e.state.facet(KEt))t=r(t,e);return t}});class o1{constructor(e,r,n,i,a,s=!0){this.changes=e,this.fromA=r,this.toA=n,this.fromB=i,this.toB=a,this.precise=s}offset(e,r){return e||r?new o1(this.changes,this.fromA+e,this.toA+e,this.fromB+r,this.toB+r,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,r,n){let i=XEt(e.toString(),r.toString(),n);return e_t(i,e,r,0,0,jEt())}static updateA(e,r,n,i,a){return n_t(r_t(e,i,!0,n.length),e,r,n,a)}static updateB(e,r,n,i,a){return n_t(r_t(e,i,!1,r.length),e,r,n,a)}}function ZEt(t,e,r,n){let i=r.lineAt(t),a=n.lineAt(e);return i.to==t&&a.to==e&&td+1&&v>f+1)break;p.push(g.offset(-u+n,-h+i)),[d,f]=JEt(g.toA+n,g.toB+i,e,r),o++}s.push(new o1(p,u,Math.max(u,d),h,Math.max(h,f),a))}return s}const KK=1e3;function t_t(t,e,r,n){let i=0,a=t.length;for(;;){if(i==a){let h=0,d=0;i&&({toA:h,toB:d}=t[i-1]);let f=e-(r?h:d);return[h+f,d+f]}let s=i+a>>1,o=t[s],[l,u]=r?[o.fromA,o.toA]:[o.fromB,o.toB];if(l>e)a=s;else if(u<=e)i=s+1;else return n?[o.fromA,o.fromB]:[o.toA,o.toB]}}function r_t(t,e,r,n){let i=[];return e.iterChangedRanges((a,s,o,l)=>{let u=0,h=r?e.length:n,d=0,f=r?n:e.length;a>KK&&([u,d]=t_t(t,a-KK,r,!0)),s=u?i[i.length-1]={fromA:g.fromA,fromB:g.fromB,toA:h,toB:f,diffA:g.diffA+m,diffB:g.diffB+v}:i.push({fromA:u,toA:h,fromB:d,toB:f,diffA:m,diffB:v})}),i}function n_t(t,e,r,n,i){if(!t.length)return e;let a=[];for(let s=0,o=0,l=0,u=0;;s++){let h=s==t.length?null:t[s],d=h?h.fromA+o:r.length,f=h?h.fromB+l:n.length;for(;ud||v.toB+l>f))break;a.push(v.offset(o,l)),u++}if(!h)break;let p=h.toA+o+h.diffA,g=h.toB+l+h.diffB,m=XEt(r.sliceString(d,p),n.sliceString(f,g),i);for(let v of e_t(m,r,n,d,f,jEt()))a.push(v);for(o+=h.diffA,l+=h.diffB;up&&v.fromB+l>g)break;u++}}return a}const i_t={scanLimit:500},ZK=ws.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=l_t(t))}update(t){(t.docChanged||t.viewportChanged||p1n(t.startState,t.state)||g1n(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=l_t(t.view))}},{decorations:t=>t.deco}),JK=Fd.low(d2e({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(ZK))===null||e===void 0?void 0:e.gutter)||Zn.empty}}));function p1n(t,e){return t.field(Bu,!1)!=e.field(Bu,!1)}function g1n(t,e){return t.facet(zh)!=e.facet(zh)}const a_t=Ar.line({class:"cm-changedLine"}),s_t=Ar.mark({class:"cm-changedText"}),m1n=Ar.mark({tagName:"ins",class:"cm-insertedLine"}),v1n=Ar.mark({tagName:"del",class:"cm-deletedLine"}),o_t=new class extends ip{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function y1n(t,e,r,n,i,a){let s=r?t.fromA:t.fromB,o=r?t.toA:t.toB,l=0;if(s!=o){i.add(s,s,a_t),i.add(s,o,r?v1n:m1n),a&&a.add(s,s,o_t);for(let u=e.iterRange(s,o-1),h=s;!u.next().done;){if(u.lineBreak){h++,i.add(h,h,a_t),a&&a.add(h,h,o_t);continue}let d=h+u.value.length;if(n)for(;l=h)break;(s?d.toA:d.toB)>u&&(!a||!a(t.state,d,o,l))&&y1n(d,t.state.doc,s,n,o,l)}return{deco:o.finish(),gutter:l&&l.finish()}}class eZ extends Iu{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const tZ=nn.define({map:(t,e)=>t.map(e)}),B$=Vs.define({create:()=>Ar.none,update:(t,e)=>{for(let r of e.effects)if(r.is(tZ))return r.value;return t.map(e.changes)},provide:t=>er.decorations.from(t)}),rZ=.01;function c_t(t,e){if(t.size!=e.size)return!1;let r=t.iter(),n=e.iter();for(;r.value;){if(r.from!=n.from||Math.abs(r.value.spec.widget.height-n.value.spec.widget.height)>1)return!1;r.next(),n.next()}return!0}function b1n(t,e,r){let n=new Lu,i=new Lu,a=t.state.field(B$).iter(),s=e.state.field(B$).iter(),o=0,l=0,u=0,h=0,d=t.viewport,f=e.viewport;for(let v=0;;v++){let y=vrZ&&(h+=S,i.add(l,l,Ar.widget({widget:new eZ(S),block:!0,side:-1})))}if(b>o+1e3&&od.from&&lf.from){let w=Math.min(d.from-o,f.from-l);o+=w,l+=w,v--}else if(y)o=y.toA,l=y.toB;else break;for(;a.value&&a.fromrZ&&i.add(e.state.doc.length,e.state.doc.length,Ar.widget({widget:new eZ(p),block:!0,side:1}));let g=n.finish(),m=i.finish();c_t(g,t.state.field(B$))||t.dispatch({effects:tZ.of(g)}),c_t(m,e.state.field(B$))||e.dispatch({effects:tZ.of(m)})}const vAe=nn.define({map:(t,e)=>e.mapPos(t)});class x1n extends Iu{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let r=document.createElement("div");return r.className="cm-collapsedLines",r.textContent=e.state.phrase("$ unchanged lines",this.lines),r.addEventListener("click",n=>{let i=e.posAtDOM(n.target);e.dispatch({effects:vAe.of(i)});let{side:a,sibling:s}=e.state.facet(zh);s&&s().dispatch({effects:vAe.of(w1n(i,e.state.field(Bu),a=="a"))})}),r}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function w1n(t,e,r){let n=0,i=0;for(let a=0;;a++){let s=a=t)return i+(t-n);[n,i]=r?[s.toA,s.toB]:[s.toB,s.toA]}}const A1n=Vs.define({create(t){return Ar.none},update(t,e){t=t.map(e.changes);for(let r of e.effects)r.is(vAe)&&(t=t.update({filter:n=>n!=r.value}));if(t.size&&e.state.field(Bu)!=e.startState.field(Bu,!1)){let r=e.state.facet(zh).side=="a",n=[];for(let i of e.state.field(Bu))t.between(r?i.fromA:i.fromB,r?i.toA:i.toB,a=>{n.push(a)});n.length&&(t=t.update({filter:i=>n.indexOf(i)<0}))}return t},provide:t=>er.decorations.from(t)});function yAe({margin:t=3,minSize:e=4}){return A1n.init(r=>S1n(r,t,e))}function S1n(t,e,r){let n=new Lu,i=t.facet(zh).side=="a",a=t.field(Bu),s=1;for(let o=0;;o++){let l=o=r&&n.add(t.doc.line(u).from,t.doc.line(h).to,Ar.replace({widget:new x1n(d),block:!0})),!l)break;s=t.doc.lineAt(Math.min(t.doc.length,i?l.toA:l.toB)).number}return n.finish()}const T1n=er.styleModule.of(new Gy({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),u_t=er.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),h_t=new l4,nZ=new l4;class C1n{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||i_t;let r=[Fd.low(ZK),u_t,T1n,B$,er.updateListener.of(d=>{this.measuring<0&&(d.heightChanged||d.viewportChanged)&&!d.transactions.some(f=>f.effects.some(p=>p.is(tZ)))&&this.measure()})],n=[zh.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&n.push(JK);let i=Kn.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],er.editorAttributes.of({class:"cm-merge-a"}),nZ.of(n),r]}),a=[zh.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&a.push(JK);let s=Kn.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],er.editorAttributes.of({class:"cm-merge-b"}),nZ.of(a),r]});this.chunks=o1.build(i.doc,s.doc,this.diffConf);let o=[Bu.init(()=>this.chunks),h_t.of(e.collapseUnchanged?yAe(e.collapseUnchanged):[])];i=i.update({effects:nn.appendConfig.of(o)}).state,s=s.update({effects:nn.appendConfig.of(o)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let l=e.orientation||"a-b",u=document.createElement("div");u.className="cm-mergeViewEditor";let h=document.createElement("div");h.className="cm-mergeViewEditor",this.editorDOM.appendChild(l=="a-b"?u:h),this.editorDOM.appendChild(l=="a-b"?h:u),this.a=new er({state:i,parent:u,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.a)}),this.b=new er({state:s,parent:h,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,r){if(e.some(n=>n.docChanged)){let n=e[e.length-1],i=e.reduce((s,o)=>s.compose(o.changes),co.empty(e[0].startState.doc.length));this.chunks=r==this.a?o1.updateA(this.chunks,n.newDoc,this.b.state.doc,i,this.diffConf):o1.updateB(this.chunks,this.a.state.doc,n.newDoc,i,this.diffConf),r.update([...e,n.state.update({effects:mAe.of(this.chunks)})]);let a=r==this.a?this.b:this.a;a.update([a.state.update({effects:mAe.of(this.chunks)})]),this.scheduleMeasure()}else r.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let a=e.orientation!="b-a";if(a!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let s=this.a.dom.parentNode,o=this.b.dom.parentNode;s.remove(),o.remove(),this.editorDOM.insertBefore(a?s:o,this.editorDOM.firstChild),this.editorDOM.appendChild(a?o:s),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let a=!!this.revertDOM,s=this.revertToA,o=this.renderRevert;"revertControls"in e&&(a=!!e.revertControls,s=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(o=e.renderRevertControl),this.setupRevertControls(a,s,o)}let r="highlightChanges"in e,n="gutter"in e,i="collapseUnchanged"in e;if(r||n||i){let a=[],s=[];if(r||n){let o=this.a.state.facet(zh),l=n?e.gutter!==!1:o.markGutter,u=r?e.highlightChanges!==!1:o.highlightChanges;a.push(nZ.reconfigure([zh.of({side:"a",sibling:()=>this.b,highlightChanges:u,markGutter:l}),l?JK:[]])),s.push(nZ.reconfigure([zh.of({side:"b",sibling:()=>this.a,highlightChanges:u,markGutter:l}),l?JK:[]]))}if(i){let o=h_t.reconfigure(e.collapseUnchanged?yAe(e.collapseUnchanged):[]);a.push(o),s.push(o)}this.a.dispatch({effects:a}),this.b.dispatch({effects:s})}this.scheduleMeasure()}setupRevertControls(e,r,n){this.revertToA=r,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=n,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",i=>this.revertClicked(i)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){b1n(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,r=e.firstChild,n=this.a.viewport,i=this.b.viewport;for(let a=0;an.to||s.fromB>i.to)break;if(s.fromA-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function d_t(t){let e=t.nextSibling;return t.remove(),e}const O1n=new class extends ip{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},k1n=Fd.low(d2e({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(ZK))===null||e===void 0?void 0:e.gutter)||Zn.empty},widgetMarker:(t,e)=>e instanceof p_t?O1n:null}));function E1n(t){var e;let r=typeof t.original=="string"?vi.of(t.original.split(/\r?\n/)):t.original,n=t.diffConfig||i_t;return[Fd.low(ZK),L1n,u_t,er.editorAttributes.of({class:"cm-merge-b"}),KEt.of((i,a)=>{let s=a.effects.find(o=>o.is(bAe));return s&&(i=o1.updateA(i,s.value.doc,a.startState.doc,s.value.changes,n)),a.docChanged&&(i=o1.updateB(i,a.state.field(U4),a.newDoc,a.changes,n)),i}),zh.of({highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1,syntaxHighlightDeletions:t.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:(e=t.mergeControls)!==null&&e!==void 0?e:!0,overrideChunk:N1n,side:"b"}),U4.init(()=>r),t.gutter!==!1?k1n:[],t.collapseUnchanged?yAe(t.collapseUnchanged):[],Bu.init(i=>o1.build(r,i.doc,n))]}const bAe=nn.define(),U4=Vs.define({create:()=>vi.empty,update(t,e){for(let r of e.effects)r.is(bAe)&&(t=r.value.doc);return t}}),f_t=new WeakMap;class p_t extends Iu{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||(this.dom=this.buildDOM(e))}}function _1n(t,e,r){let n=f_t.get(e.changes);if(n)return n;let i=s=>{let{highlightChanges:o,syntaxHighlightDeletions:l,syntaxHighlightDeletionsMaxLength:u,mergeControls:h}=t.facet(zh),d=document.createElement("div");if(d.className="cm-deletedChunk",h){let w=d.appendChild(document.createElement("div"));w.className="cm-chunkButtons";let A=T=>{T.preventDefault(),R1n(s,s.posAtDOM(d))},S=T=>{T.preventDefault(),D1n(s,s.posAtDOM(d))};if(typeof h=="function")w.appendChild(h("accept",A)),w.appendChild(h("reject",S));else{let T=w.appendChild(document.createElement("button"));T.name="accept",T.textContent=t.phrase("Accept"),T.onmousedown=A;let O=w.appendChild(document.createElement("button"));O.name="reject",O.textContent=t.phrase("Reject"),O.onmousedown=S}}if(r||e.fromA>=e.toA)return d;let f=s.state.field(U4).sliceString(e.fromA,e.endA),p=l&&t.facet(Xy),g=b(),m=e.changes,v=0,y=!1;function b(){let w=d.appendChild(document.createElement("div"));return w.className="cm-deletedLine",w.appendChild(document.createElement("del"))}function x(w,A,S){for(let T=w;T-1&&_T){let I=document.createTextNode(f.slice(T,O));if(k){let L=g.appendChild(document.createElement("span"));L.className=k,L.appendChild(I)}else g.appendChild(I);T=O}E&&(y=!y)}}if(p&&e.toA-e.fromA<=u){let w=p.parser.parse(f),A=0;GSt(w,{style:S=>hhn(t,S)},(S,T,O)=>{S>A&&x(A,S,""),x(S,T,O),A=T}),x(A,f.length,"")}else x(0,f.length,"");return g.firstChild||g.appendChild(document.createElement("br")),d},a=Ar.widget({block:!0,side:-1,widget:new p_t(i)});return f_t.set(e.changes,a),a}function R1n(t,e){let{state:r}=t,n=e??r.selection.main.head,i=t.state.field(Bu).find(l=>l.fromB<=n&&l.endB>=n);if(!i)return!1;let a=t.state.sliceDoc(i.fromB,Math.max(i.fromB,i.toB-1)),s=t.state.field(U4);i.fromB!=i.toB&&i.toA<=s.length&&(a+=t.state.lineBreak);let o=co.of({from:i.fromA,to:Math.min(s.length,i.toA),insert:a},s.length);return t.dispatch({effects:bAe.of({doc:o.apply(s),changes:o}),userEvent:"accept"}),!0}function D1n(t,e){let{state:r}=t,n=e??r.selection.main.head,i=r.field(Bu).find(o=>o.fromB<=n&&o.endB>=n);if(!i)return!1;let s=r.field(U4).sliceString(i.fromA,Math.max(i.fromA,i.toA-1));return i.fromA!=i.toA&&i.toB<=r.doc.length&&(s+=r.lineBreak),t.dispatch({changes:{from:i.fromB,to:Math.min(r.doc.length,i.toB),insert:s},userEvent:"revert"}),!0}function g_t(t){let e=new Lu;for(let r of t.field(Bu)){let n=t.facet(zh).overrideChunk&&v_t(t,r);e.add(r.fromB,r.fromB,_1n(t,r,!!n))}return e.finish()}const L1n=Vs.define({create:t=>g_t(t),update(t,e){return e.state.field(Bu,!1)!=e.startState.field(Bu,!1)?g_t(e.state):t},provide:t=>er.decorations.from(t)}),m_t=new WeakMap;function v_t(t,e){let r=m_t.get(e);if(r!==void 0)return r;r=null;let n=t.field(U4),i=t.doc,a=n.lineAt(e.endA).number-n.lineAt(e.fromA).number+1,s=i.lineAt(e.endB).number-i.lineAt(e.fromB).number+1;e:if(a==s&&a<10){let o=[],l=0,u=e.fromA,h=e.fromB;for(let d of e.changes){if(d.fromA=e.endB)break;s=t.doc.lineAt(s.to+1)}return!0}const y_t="(max-width: 760px)";function B1n(){const[t,e]=se.useState(()=>typeof window<"u"&&window.matchMedia(y_t).matches);return se.useEffect(()=>{const r=window.matchMedia(y_t),n=()=>e(r.matches);return n(),r.addEventListener("change",n),()=>r.removeEventListener("change",n)},[]),t}function b_t(t,e){return[iAe({lineNumbers:!0,foldGutter:!0,highlightActiveLine:!1,highlightActiveLineGutter:!1,autocompletion:!1}),...XK(t),Kn.readOnly.of(!0),...e==="dark"?[REt]:[]]}function $1n({before:t,after:e,path:r,theme:n}){const i=se.useRef(null);return se.useEffect(()=>{if(!i.current)return;const a=new C1n({a:{doc:t,extensions:b_t(r,n)},b:{doc:e,extensions:b_t(r,n)},parent:i.current,highlightChanges:!0,gutter:!0,collapseUnchanged:{margin:3,minSize:6},diffConfig:{scanLimit:2e3,timeout:1e3}});return()=>a.destroy()},[e,t,r,n]),W.jsx("div",{ref:i,className:"code-browser-merge"})}function F1n(t){return B1n()?W.jsx(cAe,{value:t.after,height:"100%",theme:t.theme,editable:!1,extensions:[...XK(t.path),...E1n({original:t.before,highlightChanges:!0,gutter:!0,mergeControls:!1,collapseUnchanged:{margin:3,minSize:6},diffConfig:{scanLimit:2e3,timeout:1e3}})],basicSetup:{lineNumbers:!0,foldGutter:!0,highlightActiveLine:!1,highlightActiveLineGutter:!1,autocompletion:!1}}):W.jsx($1n,{...t})}const z1n=Object.freeze(Object.defineProperty({__proto__:null,default:F1n},Symbol.toStringTag,{value:"Module"}));class Zt extends Error{constructor(e,r){var n="KaTeX parse error: "+e,i,a,s=r&&r.loc;if(s&&s.start<=s.end){var o=s.lexer.input;i=s.start,a=s.end,i===o.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var l=o.slice(i,a).replace(/[^]/g,"$&̲"),u;i>15?u="…"+o.slice(i-15,i):u=o.slice(0,i);var h;a+15t.replace(U1n,"-$1").toLowerCase(),Q1n={"&":"&",">":">","<":"<",'"':""","'":"'"},G1n=/[&><"']/g,tu=t=>String(t).replace(G1n,e=>Q1n[e]),iZ=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?iZ(t.body[0]):t:t.type==="font"?iZ(t.body):t,H1n=new Set(["mathord","textord","atom"]),l1=t=>H1n.has(iZ(t).type),W1n=t=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},aZ={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:t=>Math.max(0,t),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:t=>Math.max(0,t),cli:"-e, --max-expand ",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function Y1n(t){if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function q1n(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return Y1n(e)}function j1n(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:q1n(n)}class xAe{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var r of Object.keys(aZ)){var n=aZ[r];n&&j1n(this,r,e,n)}}reportNonstrict(e,r,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,r,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new Zt("LaTeX-incompatible input and strict mode is set to 'error': "+(r+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]"))}}useStrictBehavior(e,r,n){var i=this.strict;if(typeof i=="function")try{i=i(e,r,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]")),!1)}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var r=W1n(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class g2{constructor(e,r,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=r,this.cramped=n}sup(){return w0[X1n[this.id]]}sub(){return w0[K1n[this.id]]}fracNum(){return w0[Z1n[this.id]]}fracDen(){return w0[J1n[this.id]]}cramp(){return w0[ebn[this.id]]}text(){return w0[tbn[this.id]]}isTight(){return this.size>=2}}var wAe=0,sZ=1,V4=2,c1=3,$$=4,cp=5,Q4=6,$u=7,w0=[new g2(wAe,0,!1),new g2(sZ,0,!0),new g2(V4,1,!1),new g2(c1,1,!0),new g2($$,2,!1),new g2(cp,2,!0),new g2(Q4,3,!1),new g2($u,3,!0)],X1n=[$$,cp,$$,cp,Q4,$u,Q4,$u],K1n=[cp,cp,cp,cp,$u,$u,$u,$u],Z1n=[V4,c1,$$,cp,Q4,$u,Q4,$u],J1n=[c1,c1,cp,cp,$u,$u,$u,$u],ebn=[sZ,sZ,c1,c1,cp,cp,$u,$u],tbn=[wAe,sZ,V4,c1,V4,c1,V4,c1],In={DISPLAY:w0[wAe],TEXT:w0[V4],SCRIPT:w0[$$],SCRIPTSCRIPT:w0[Q4]},AAe=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function rbn(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var oZ=[];AAe.forEach(t=>t.blocks.forEach(e=>oZ.push(...e)));function x_t(t){for(var e=0;e=oZ[e]&&t<=oZ[e+1])return!0;return!1}var el=t=>t+" "+t,G4=80,nbn=function(e,r){return"M95,"+(622+e+r)+` c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 @@ -963,32 +963,32 @@ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6 c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, --470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function fbn(t){return"toText"in t}class H4{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),r=0;r{if(fbn(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var TAe={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},pbn={ex:!0,em:!0,mu:!0},A_t=function(e){return typeof e!="string"&&(e=e.unit),e in TAe||e in pbn||e==="ex"},Ts=function(e,r){var n;if(e.unit in TAe)n=TAe[e.unit]/r.fontMetrics().ptPerEm/r.sizeMultiplier;else if(e.unit==="mu")n=r.fontMetrics().cssEmPerMu;else{var i;if(r.style.isTight()?i=r.havingStyle(r.style.text()):i=r,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new Zt("Invalid unit: '"+e.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(e.number*n,r.maxSize)},ir=function(e){return+e.toFixed(4)+"em"},m2=function(e){return e.filter(r=>r).join(" ")},SAe=function(e){var r="";for(var n of Object.keys(e)){var i=e[n];i!==void 0&&(r+=V1n(n)+":"+i+";")}return r},T_t=function(e,r,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},r){r.style.isTight()&&this.classes.push("mtight");var i=r.getColor();i&&(this.style.color=i)}},S_t=function(e){var r=document.createElement(e);r.className=m2(this.classes),Object.assign(r.style,this.style);for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i/=\x00-\x1f]/,C_t=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+tu(m2(this.classes))+'"');var n=SAe(this.style);n&&(r+=' style="'+tu(n)+'"');for(var i of Object.keys(this.attributes)){if(gbn.test(i))throw new Zt("Invalid attribute name '"+i+"'");r+=" "+i+'="'+tu(this.attributes[i])+'"'}r+=">";for(var a=0;a",r};class W4{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,T_t.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return S_t.call(this,"span")}toMarkup(){return C_t.call(this,"span")}}let lZ=class{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,T_t.call(this,r,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return S_t.call(this,"a")}toMarkup(){return C_t.call(this,"a")}};class mbn{constructor(e,r,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=r,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");return e.src=this.src,e.alt=this.alt,e.className="mord",Object.assign(e.style,this.style),e}toMarkup(){var e=''+tu(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=ir(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=m2(this.classes)),Object.keys(this.style).length>0&&(r=r||document.createElement("span"),Object.assign(r.style,this.style)),r?(r.appendChild(e),r):e}toMarkup(){var e=!1,r="0&&(n+="margin-right:"+ir(this.italic)+";"),n+=SAe(this.style),n&&(e=!0,r+=' style="'+tu(n)+'"');var i=tu(this.text);return e?(r+=">",r+=i,r+="",r):i}}class u1{constructor(e,r){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=r||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"svg");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i':''}}class CAe{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"line");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);return r}toMarkup(){var e=" but got "+String(t)+".")}var xbn=t=>t instanceof W4||t instanceof lZ||t instanceof H4,A0={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},cZ={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},O_t={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function k_t(t,e){A0[t]=e}function OAe(t,e,r){if(!A0[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=A0[e][n];if(!i&&t[0]in O_t&&(n=O_t[t[0]].charCodeAt(0),i=A0[e][n]),!i&&r==="text"&&x_t(n)&&(i=A0[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var kAe={};function wbn(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!kAe[e]){var r=kAe[e]={cssEmPerMu:cZ.quad[e]/18};for(var n in cZ)cZ.hasOwnProperty(n)&&(r[n]=cZ[n][e])}return kAe[e]}var gs={math:{},text:{}};function J(t,e,r,n,i,a){gs[t][i]={font:e,group:r,replace:n},a&&n&&(gs[t][n]=gs[t][i])}var ue="math",$t="text",we="main",We="ams",ms="accent-token",kr="bin",Fu="close",Y4="inner",an="mathord",Mo="op-token",qd="open",F$="punct",je="rel",h1="spacing",Je="textord";J(ue,we,je,"≡","\\equiv",!0),J(ue,we,je,"≺","\\prec",!0),J(ue,we,je,"≻","\\succ",!0),J(ue,we,je,"∼","\\sim",!0),J(ue,we,je,"⊥","\\perp"),J(ue,we,je,"⪯","\\preceq",!0),J(ue,we,je,"⪰","\\succeq",!0),J(ue,we,je,"≃","\\simeq",!0),J(ue,we,je,"∣","\\mid",!0),J(ue,we,je,"≪","\\ll",!0),J(ue,we,je,"≫","\\gg",!0),J(ue,we,je,"≍","\\asymp",!0),J(ue,we,je,"∥","\\parallel"),J(ue,we,je,"⋈","\\bowtie",!0),J(ue,we,je,"⌣","\\smile",!0),J(ue,we,je,"⊑","\\sqsubseteq",!0),J(ue,we,je,"⊒","\\sqsupseteq",!0),J(ue,we,je,"≐","\\doteq",!0),J(ue,we,je,"⌢","\\frown",!0),J(ue,we,je,"∋","\\ni",!0),J(ue,we,je,"∝","\\propto",!0),J(ue,we,je,"⊢","\\vdash",!0),J(ue,we,je,"⊣","\\dashv",!0),J(ue,we,je,"∋","\\owns"),J(ue,we,F$,".","\\ldotp"),J(ue,we,F$,"⋅","\\cdotp"),J(ue,we,F$,"⋅","·"),J($t,we,Je,"⋅","·"),J(ue,we,Je,"#","\\#"),J($t,we,Je,"#","\\#"),J(ue,we,Je,"&","\\&"),J($t,we,Je,"&","\\&"),J(ue,we,Je,"ℵ","\\aleph",!0),J(ue,we,Je,"∀","\\forall",!0),J(ue,we,Je,"ℏ","\\hbar",!0),J(ue,we,Je,"∃","\\exists",!0),J(ue,we,Je,"∇","\\nabla",!0),J(ue,we,Je,"♭","\\flat",!0),J(ue,we,Je,"ℓ","\\ell",!0),J(ue,we,Je,"♮","\\natural",!0),J(ue,we,Je,"♣","\\clubsuit",!0),J(ue,we,Je,"℘","\\wp",!0),J(ue,we,Je,"♯","\\sharp",!0),J(ue,we,Je,"♢","\\diamondsuit",!0),J(ue,we,Je,"ℜ","\\Re",!0),J(ue,we,Je,"♡","\\heartsuit",!0),J(ue,we,Je,"ℑ","\\Im",!0),J(ue,we,Je,"♠","\\spadesuit",!0),J(ue,we,Je,"§","\\S",!0),J($t,we,Je,"§","\\S"),J(ue,we,Je,"¶","\\P",!0),J($t,we,Je,"¶","\\P"),J(ue,we,Je,"†","\\dag"),J($t,we,Je,"†","\\dag"),J($t,we,Je,"†","\\textdagger"),J(ue,we,Je,"‡","\\ddag"),J($t,we,Je,"‡","\\ddag"),J($t,we,Je,"‡","\\textdaggerdbl"),J(ue,we,Fu,"⎱","\\rmoustache",!0),J(ue,we,qd,"⎰","\\lmoustache",!0),J(ue,we,Fu,"⟯","\\rgroup",!0),J(ue,we,qd,"⟮","\\lgroup",!0),J(ue,we,kr,"∓","\\mp",!0),J(ue,we,kr,"⊖","\\ominus",!0),J(ue,we,kr,"⊎","\\uplus",!0),J(ue,we,kr,"⊓","\\sqcap",!0),J(ue,we,kr,"∗","\\ast"),J(ue,we,kr,"⊔","\\sqcup",!0),J(ue,we,kr,"◯","\\bigcirc",!0),J(ue,we,kr,"∙","\\bullet",!0),J(ue,we,kr,"‡","\\ddagger"),J(ue,we,kr,"≀","\\wr",!0),J(ue,we,kr,"⨿","\\amalg"),J(ue,we,kr,"&","\\And"),J(ue,we,je,"⟵","\\longleftarrow",!0),J(ue,we,je,"⇐","\\Leftarrow",!0),J(ue,we,je,"⟸","\\Longleftarrow",!0),J(ue,we,je,"⟶","\\longrightarrow",!0),J(ue,we,je,"⇒","\\Rightarrow",!0),J(ue,we,je,"⟹","\\Longrightarrow",!0),J(ue,we,je,"↔","\\leftrightarrow",!0),J(ue,we,je,"⟷","\\longleftrightarrow",!0),J(ue,we,je,"⇔","\\Leftrightarrow",!0),J(ue,we,je,"⟺","\\Longleftrightarrow",!0),J(ue,we,je,"↦","\\mapsto",!0),J(ue,we,je,"⟼","\\longmapsto",!0),J(ue,we,je,"↗","\\nearrow",!0),J(ue,we,je,"↩","\\hookleftarrow",!0),J(ue,we,je,"↪","\\hookrightarrow",!0),J(ue,we,je,"↘","\\searrow",!0),J(ue,we,je,"↼","\\leftharpoonup",!0),J(ue,we,je,"⇀","\\rightharpoonup",!0),J(ue,we,je,"↙","\\swarrow",!0),J(ue,we,je,"↽","\\leftharpoondown",!0),J(ue,we,je,"⇁","\\rightharpoondown",!0),J(ue,we,je,"↖","\\nwarrow",!0),J(ue,we,je,"⇌","\\rightleftharpoons",!0),J(ue,We,je,"≮","\\nless",!0),J(ue,We,je,"","\\@nleqslant"),J(ue,We,je,"","\\@nleqq"),J(ue,We,je,"⪇","\\lneq",!0),J(ue,We,je,"≨","\\lneqq",!0),J(ue,We,je,"","\\@lvertneqq"),J(ue,We,je,"⋦","\\lnsim",!0),J(ue,We,je,"⪉","\\lnapprox",!0),J(ue,We,je,"⊀","\\nprec",!0),J(ue,We,je,"⋠","\\npreceq",!0),J(ue,We,je,"⋨","\\precnsim",!0),J(ue,We,je,"⪹","\\precnapprox",!0),J(ue,We,je,"≁","\\nsim",!0),J(ue,We,je,"","\\@nshortmid"),J(ue,We,je,"∤","\\nmid",!0),J(ue,We,je,"⊬","\\nvdash",!0),J(ue,We,je,"⊭","\\nvDash",!0),J(ue,We,je,"⋪","\\ntriangleleft"),J(ue,We,je,"⋬","\\ntrianglelefteq",!0),J(ue,We,je,"⊊","\\subsetneq",!0),J(ue,We,je,"","\\@varsubsetneq"),J(ue,We,je,"⫋","\\subsetneqq",!0),J(ue,We,je,"","\\@varsubsetneqq"),J(ue,We,je,"≯","\\ngtr",!0),J(ue,We,je,"","\\@ngeqslant"),J(ue,We,je,"","\\@ngeqq"),J(ue,We,je,"⪈","\\gneq",!0),J(ue,We,je,"≩","\\gneqq",!0),J(ue,We,je,"","\\@gvertneqq"),J(ue,We,je,"⋧","\\gnsim",!0),J(ue,We,je,"⪊","\\gnapprox",!0),J(ue,We,je,"⊁","\\nsucc",!0),J(ue,We,je,"⋡","\\nsucceq",!0),J(ue,We,je,"⋩","\\succnsim",!0),J(ue,We,je,"⪺","\\succnapprox",!0),J(ue,We,je,"≆","\\ncong",!0),J(ue,We,je,"","\\@nshortparallel"),J(ue,We,je,"∦","\\nparallel",!0),J(ue,We,je,"⊯","\\nVDash",!0),J(ue,We,je,"⋫","\\ntriangleright"),J(ue,We,je,"⋭","\\ntrianglerighteq",!0),J(ue,We,je,"","\\@nsupseteqq"),J(ue,We,je,"⊋","\\supsetneq",!0),J(ue,We,je,"","\\@varsupsetneq"),J(ue,We,je,"⫌","\\supsetneqq",!0),J(ue,We,je,"","\\@varsupsetneqq"),J(ue,We,je,"⊮","\\nVdash",!0),J(ue,We,je,"⪵","\\precneqq",!0),J(ue,We,je,"⪶","\\succneqq",!0),J(ue,We,je,"","\\@nsubseteqq"),J(ue,We,kr,"⊴","\\unlhd"),J(ue,We,kr,"⊵","\\unrhd"),J(ue,We,je,"↚","\\nleftarrow",!0),J(ue,We,je,"↛","\\nrightarrow",!0),J(ue,We,je,"⇍","\\nLeftarrow",!0),J(ue,We,je,"⇏","\\nRightarrow",!0),J(ue,We,je,"↮","\\nleftrightarrow",!0),J(ue,We,je,"⇎","\\nLeftrightarrow",!0),J(ue,We,je,"△","\\vartriangle"),J(ue,We,Je,"ℏ","\\hslash"),J(ue,We,Je,"▽","\\triangledown"),J(ue,We,Je,"◊","\\lozenge"),J(ue,We,Je,"Ⓢ","\\circledS"),J(ue,We,Je,"®","\\circledR"),J($t,We,Je,"®","\\circledR"),J(ue,We,Je,"∡","\\measuredangle",!0),J(ue,We,Je,"∄","\\nexists"),J(ue,We,Je,"℧","\\mho"),J(ue,We,Je,"Ⅎ","\\Finv",!0),J(ue,We,Je,"⅁","\\Game",!0),J(ue,We,Je,"‵","\\backprime"),J(ue,We,Je,"▲","\\blacktriangle"),J(ue,We,Je,"▼","\\blacktriangledown"),J(ue,We,Je,"■","\\blacksquare"),J(ue,We,Je,"⧫","\\blacklozenge"),J(ue,We,Je,"★","\\bigstar"),J(ue,We,Je,"∢","\\sphericalangle",!0),J(ue,We,Je,"∁","\\complement",!0),J(ue,We,Je,"ð","\\eth",!0),J($t,we,Je,"ð","ð"),J(ue,We,Je,"╱","\\diagup"),J(ue,We,Je,"╲","\\diagdown"),J(ue,We,Je,"□","\\square"),J(ue,We,Je,"□","\\Box"),J(ue,We,Je,"◊","\\Diamond"),J(ue,We,Je,"¥","\\yen",!0),J($t,We,Je,"¥","\\yen",!0),J(ue,We,Je,"✓","\\checkmark",!0),J($t,We,Je,"✓","\\checkmark"),J(ue,We,Je,"ℶ","\\beth",!0),J(ue,We,Je,"ℸ","\\daleth",!0),J(ue,We,Je,"ℷ","\\gimel",!0),J(ue,We,Je,"ϝ","\\digamma",!0),J(ue,We,Je,"ϰ","\\varkappa"),J(ue,We,qd,"┌","\\@ulcorner",!0),J(ue,We,Fu,"┐","\\@urcorner",!0),J(ue,We,qd,"└","\\@llcorner",!0),J(ue,We,Fu,"┘","\\@lrcorner",!0),J(ue,We,je,"≦","\\leqq",!0),J(ue,We,je,"⩽","\\leqslant",!0),J(ue,We,je,"⪕","\\eqslantless",!0),J(ue,We,je,"≲","\\lesssim",!0),J(ue,We,je,"⪅","\\lessapprox",!0),J(ue,We,je,"≊","\\approxeq",!0),J(ue,We,kr,"⋖","\\lessdot"),J(ue,We,je,"⋘","\\lll",!0),J(ue,We,je,"≶","\\lessgtr",!0),J(ue,We,je,"⋚","\\lesseqgtr",!0),J(ue,We,je,"⪋","\\lesseqqgtr",!0),J(ue,We,je,"≑","\\doteqdot"),J(ue,We,je,"≓","\\risingdotseq",!0),J(ue,We,je,"≒","\\fallingdotseq",!0),J(ue,We,je,"∽","\\backsim",!0),J(ue,We,je,"⋍","\\backsimeq",!0),J(ue,We,je,"⫅","\\subseteqq",!0),J(ue,We,je,"⋐","\\Subset",!0),J(ue,We,je,"⊏","\\sqsubset",!0),J(ue,We,je,"≼","\\preccurlyeq",!0),J(ue,We,je,"⋞","\\curlyeqprec",!0),J(ue,We,je,"≾","\\precsim",!0),J(ue,We,je,"⪷","\\precapprox",!0),J(ue,We,je,"⊲","\\vartriangleleft"),J(ue,We,je,"⊴","\\trianglelefteq"),J(ue,We,je,"⊨","\\vDash",!0),J(ue,We,je,"⊪","\\Vvdash",!0),J(ue,We,je,"⌣","\\smallsmile"),J(ue,We,je,"⌢","\\smallfrown"),J(ue,We,je,"≏","\\bumpeq",!0),J(ue,We,je,"≎","\\Bumpeq",!0),J(ue,We,je,"≧","\\geqq",!0),J(ue,We,je,"⩾","\\geqslant",!0),J(ue,We,je,"⪖","\\eqslantgtr",!0),J(ue,We,je,"≳","\\gtrsim",!0),J(ue,We,je,"⪆","\\gtrapprox",!0),J(ue,We,kr,"⋗","\\gtrdot"),J(ue,We,je,"⋙","\\ggg",!0),J(ue,We,je,"≷","\\gtrless",!0),J(ue,We,je,"⋛","\\gtreqless",!0),J(ue,We,je,"⪌","\\gtreqqless",!0),J(ue,We,je,"≖","\\eqcirc",!0),J(ue,We,je,"≗","\\circeq",!0),J(ue,We,je,"≜","\\triangleq",!0),J(ue,We,je,"∼","\\thicksim"),J(ue,We,je,"≈","\\thickapprox"),J(ue,We,je,"⫆","\\supseteqq",!0),J(ue,We,je,"⋑","\\Supset",!0),J(ue,We,je,"⊐","\\sqsupset",!0),J(ue,We,je,"≽","\\succcurlyeq",!0),J(ue,We,je,"⋟","\\curlyeqsucc",!0),J(ue,We,je,"≿","\\succsim",!0),J(ue,We,je,"⪸","\\succapprox",!0),J(ue,We,je,"⊳","\\vartriangleright"),J(ue,We,je,"⊵","\\trianglerighteq"),J(ue,We,je,"⊩","\\Vdash",!0),J(ue,We,je,"∣","\\shortmid"),J(ue,We,je,"∥","\\shortparallel"),J(ue,We,je,"≬","\\between",!0),J(ue,We,je,"⋔","\\pitchfork",!0),J(ue,We,je,"∝","\\varpropto"),J(ue,We,je,"◀","\\blacktriangleleft"),J(ue,We,je,"∴","\\therefore",!0),J(ue,We,je,"∍","\\backepsilon"),J(ue,We,je,"▶","\\blacktriangleright"),J(ue,We,je,"∵","\\because",!0),J(ue,We,je,"⋘","\\llless"),J(ue,We,je,"⋙","\\gggtr"),J(ue,We,kr,"⊲","\\lhd"),J(ue,We,kr,"⊳","\\rhd"),J(ue,We,je,"≂","\\eqsim",!0),J(ue,we,je,"⋈","\\Join"),J(ue,We,je,"≑","\\Doteq",!0),J(ue,We,kr,"∔","\\dotplus",!0),J(ue,We,kr,"∖","\\smallsetminus"),J(ue,We,kr,"⋒","\\Cap",!0),J(ue,We,kr,"⋓","\\Cup",!0),J(ue,We,kr,"⩞","\\doublebarwedge",!0),J(ue,We,kr,"⊟","\\boxminus",!0),J(ue,We,kr,"⊞","\\boxplus",!0),J(ue,We,kr,"⋇","\\divideontimes",!0),J(ue,We,kr,"⋉","\\ltimes",!0),J(ue,We,kr,"⋊","\\rtimes",!0),J(ue,We,kr,"⋋","\\leftthreetimes",!0),J(ue,We,kr,"⋌","\\rightthreetimes",!0),J(ue,We,kr,"⋏","\\curlywedge",!0),J(ue,We,kr,"⋎","\\curlyvee",!0),J(ue,We,kr,"⊝","\\circleddash",!0),J(ue,We,kr,"⊛","\\circledast",!0),J(ue,We,kr,"⋅","\\centerdot"),J(ue,We,kr,"⊺","\\intercal",!0),J(ue,We,kr,"⋒","\\doublecap"),J(ue,We,kr,"⋓","\\doublecup"),J(ue,We,kr,"⊠","\\boxtimes",!0),J(ue,We,je,"⇢","\\dashrightarrow",!0),J(ue,We,je,"⇠","\\dashleftarrow",!0),J(ue,We,je,"⇇","\\leftleftarrows",!0),J(ue,We,je,"⇆","\\leftrightarrows",!0),J(ue,We,je,"⇚","\\Lleftarrow",!0),J(ue,We,je,"↞","\\twoheadleftarrow",!0),J(ue,We,je,"↢","\\leftarrowtail",!0),J(ue,We,je,"↫","\\looparrowleft",!0),J(ue,We,je,"⇋","\\leftrightharpoons",!0),J(ue,We,je,"↶","\\curvearrowleft",!0),J(ue,We,je,"↺","\\circlearrowleft",!0),J(ue,We,je,"↰","\\Lsh",!0),J(ue,We,je,"⇈","\\upuparrows",!0),J(ue,We,je,"↿","\\upharpoonleft",!0),J(ue,We,je,"⇃","\\downharpoonleft",!0),J(ue,we,je,"⊶","\\origof",!0),J(ue,we,je,"⊷","\\imageof",!0),J(ue,We,je,"⊸","\\multimap",!0),J(ue,We,je,"↭","\\leftrightsquigarrow",!0),J(ue,We,je,"⇉","\\rightrightarrows",!0),J(ue,We,je,"⇄","\\rightleftarrows",!0),J(ue,We,je,"↠","\\twoheadrightarrow",!0),J(ue,We,je,"↣","\\rightarrowtail",!0),J(ue,We,je,"↬","\\looparrowright",!0),J(ue,We,je,"↷","\\curvearrowright",!0),J(ue,We,je,"↻","\\circlearrowright",!0),J(ue,We,je,"↱","\\Rsh",!0),J(ue,We,je,"⇊","\\downdownarrows",!0),J(ue,We,je,"↾","\\upharpoonright",!0),J(ue,We,je,"⇂","\\downharpoonright",!0),J(ue,We,je,"⇝","\\rightsquigarrow",!0),J(ue,We,je,"⇝","\\leadsto"),J(ue,We,je,"⇛","\\Rrightarrow",!0),J(ue,We,je,"↾","\\restriction"),J(ue,we,Je,"‘","`"),J(ue,we,Je,"$","\\$"),J($t,we,Je,"$","\\$"),J($t,we,Je,"$","\\textdollar"),J(ue,we,Je,"%","\\%"),J($t,we,Je,"%","\\%"),J(ue,we,Je,"_","\\_"),J($t,we,Je,"_","\\_"),J($t,we,Je,"_","\\textunderscore"),J(ue,we,Je,"∠","\\angle",!0),J(ue,we,Je,"∞","\\infty",!0),J(ue,we,Je,"′","\\prime"),J(ue,we,Je,"△","\\triangle"),J(ue,we,Je,"Γ","\\Gamma",!0),J(ue,we,Je,"Δ","\\Delta",!0),J(ue,we,Je,"Θ","\\Theta",!0),J(ue,we,Je,"Λ","\\Lambda",!0),J(ue,we,Je,"Ξ","\\Xi",!0),J(ue,we,Je,"Π","\\Pi",!0),J(ue,we,Je,"Σ","\\Sigma",!0),J(ue,we,Je,"Υ","\\Upsilon",!0),J(ue,we,Je,"Φ","\\Phi",!0),J(ue,we,Je,"Ψ","\\Psi",!0),J(ue,we,Je,"Ω","\\Omega",!0),J(ue,we,Je,"A","Α"),J(ue,we,Je,"B","Β"),J(ue,we,Je,"E","Ε"),J(ue,we,Je,"Z","Ζ"),J(ue,we,Je,"H","Η"),J(ue,we,Je,"I","Ι"),J(ue,we,Je,"K","Κ"),J(ue,we,Je,"M","Μ"),J(ue,we,Je,"N","Ν"),J(ue,we,Je,"O","Ο"),J(ue,we,Je,"P","Ρ"),J(ue,we,Je,"T","Τ"),J(ue,we,Je,"X","Χ"),J(ue,we,Je,"¬","\\neg",!0),J(ue,we,Je,"¬","\\lnot"),J(ue,we,Je,"⊤","\\top"),J(ue,we,Je,"⊥","\\bot"),J(ue,we,Je,"∅","\\emptyset"),J(ue,We,Je,"∅","\\varnothing"),J(ue,we,an,"α","\\alpha",!0),J(ue,we,an,"β","\\beta",!0),J(ue,we,an,"γ","\\gamma",!0),J(ue,we,an,"δ","\\delta",!0),J(ue,we,an,"ϵ","\\epsilon",!0),J(ue,we,an,"ζ","\\zeta",!0),J(ue,we,an,"η","\\eta",!0),J(ue,we,an,"θ","\\theta",!0),J(ue,we,an,"ι","\\iota",!0),J(ue,we,an,"κ","\\kappa",!0),J(ue,we,an,"λ","\\lambda",!0),J(ue,we,an,"μ","\\mu",!0),J(ue,we,an,"ν","\\nu",!0),J(ue,we,an,"ξ","\\xi",!0),J(ue,we,an,"ο","\\omicron",!0),J(ue,we,an,"π","\\pi",!0),J(ue,we,an,"ρ","\\rho",!0),J(ue,we,an,"σ","\\sigma",!0),J(ue,we,an,"τ","\\tau",!0),J(ue,we,an,"υ","\\upsilon",!0),J(ue,we,an,"ϕ","\\phi",!0),J(ue,we,an,"χ","\\chi",!0),J(ue,we,an,"ψ","\\psi",!0),J(ue,we,an,"ω","\\omega",!0),J(ue,we,an,"ε","\\varepsilon",!0),J(ue,we,an,"ϑ","\\vartheta",!0),J(ue,we,an,"ϖ","\\varpi",!0),J(ue,we,an,"ϱ","\\varrho",!0),J(ue,we,an,"ς","\\varsigma",!0),J(ue,we,an,"φ","\\varphi",!0),J(ue,we,kr,"∗","*",!0),J(ue,we,kr,"+","+"),J(ue,we,kr,"−","-",!0),J(ue,we,kr,"⋅","\\cdot",!0),J(ue,we,kr,"∘","\\circ",!0),J(ue,we,kr,"÷","\\div",!0),J(ue,we,kr,"±","\\pm",!0),J(ue,we,kr,"×","\\times",!0),J(ue,we,kr,"∩","\\cap",!0),J(ue,we,kr,"∪","\\cup",!0),J(ue,we,kr,"∖","\\setminus",!0),J(ue,we,kr,"∧","\\land"),J(ue,we,kr,"∨","\\lor"),J(ue,we,kr,"∧","\\wedge",!0),J(ue,we,kr,"∨","\\vee",!0),J(ue,we,Je,"√","\\surd"),J(ue,we,qd,"⟨","\\langle",!0),J(ue,we,qd,"∣","\\lvert"),J(ue,we,qd,"∥","\\lVert"),J(ue,we,Fu,"?","?"),J(ue,we,Fu,"!","!"),J(ue,we,Fu,"⟩","\\rangle",!0),J(ue,we,Fu,"∣","\\rvert"),J(ue,we,Fu,"∥","\\rVert"),J(ue,we,je,"=","="),J(ue,we,je,":",":"),J(ue,we,je,"≈","\\approx",!0),J(ue,we,je,"≅","\\cong",!0),J(ue,we,je,"≥","\\ge"),J(ue,we,je,"≥","\\geq",!0),J(ue,we,je,"←","\\gets"),J(ue,we,je,">","\\gt",!0),J(ue,we,je,"∈","\\in",!0),J(ue,we,je,"","\\@not"),J(ue,we,je,"⊂","\\subset",!0),J(ue,we,je,"⊃","\\supset",!0),J(ue,we,je,"⊆","\\subseteq",!0),J(ue,we,je,"⊇","\\supseteq",!0),J(ue,We,je,"⊈","\\nsubseteq",!0),J(ue,We,je,"⊉","\\nsupseteq",!0),J(ue,we,je,"⊨","\\models"),J(ue,we,je,"←","\\leftarrow",!0),J(ue,we,je,"≤","\\le"),J(ue,we,je,"≤","\\leq",!0),J(ue,we,je,"<","\\lt",!0),J(ue,we,je,"→","\\rightarrow",!0),J(ue,we,je,"→","\\to"),J(ue,We,je,"≱","\\ngeq",!0),J(ue,We,je,"≰","\\nleq",!0),J(ue,we,h1," ","\\ "),J(ue,we,h1," ","\\space"),J(ue,we,h1," ","\\nobreakspace"),J($t,we,h1," ","\\ "),J($t,we,h1," "," "),J($t,we,h1," ","\\space"),J($t,we,h1," ","\\nobreakspace"),J(ue,we,h1,"","\\nobreak"),J(ue,we,h1,"","\\allowbreak"),J(ue,we,F$,",",","),J(ue,we,F$,";",";"),J(ue,We,kr,"⊼","\\barwedge",!0),J(ue,We,kr,"⊻","\\veebar",!0),J(ue,we,kr,"⊙","\\odot",!0),J(ue,we,kr,"⊕","\\oplus",!0),J(ue,we,kr,"⊗","\\otimes",!0),J(ue,we,Je,"∂","\\partial",!0),J(ue,we,kr,"⊘","\\oslash",!0),J(ue,We,kr,"⊚","\\circledcirc",!0),J(ue,We,kr,"⊡","\\boxdot",!0),J(ue,we,kr,"△","\\bigtriangleup"),J(ue,we,kr,"▽","\\bigtriangledown"),J(ue,we,kr,"†","\\dagger"),J(ue,we,kr,"⋄","\\diamond"),J(ue,we,kr,"⋆","\\star"),J(ue,we,kr,"◃","\\triangleleft"),J(ue,we,kr,"▹","\\triangleright"),J(ue,we,qd,"{","\\{"),J($t,we,Je,"{","\\{"),J($t,we,Je,"{","\\textbraceleft"),J(ue,we,Fu,"}","\\}"),J($t,we,Je,"}","\\}"),J($t,we,Je,"}","\\textbraceright"),J(ue,we,qd,"{","\\lbrace"),J(ue,we,Fu,"}","\\rbrace"),J(ue,we,qd,"[","\\lbrack",!0),J($t,we,Je,"[","\\lbrack",!0),J(ue,we,Fu,"]","\\rbrack",!0),J($t,we,Je,"]","\\rbrack",!0),J(ue,we,qd,"(","\\lparen",!0),J(ue,we,Fu,")","\\rparen",!0),J($t,we,Je,"<","\\textless",!0),J($t,we,Je,">","\\textgreater",!0),J(ue,we,qd,"⌊","\\lfloor",!0),J(ue,we,Fu,"⌋","\\rfloor",!0),J(ue,we,qd,"⌈","\\lceil",!0),J(ue,we,Fu,"⌉","\\rceil",!0),J(ue,we,Je,"\\","\\backslash"),J(ue,we,Je,"∣","|"),J(ue,we,Je,"∣","\\vert"),J($t,we,Je,"|","\\textbar",!0),J(ue,we,Je,"∥","\\|"),J(ue,we,Je,"∥","\\Vert"),J($t,we,Je,"∥","\\textbardbl"),J($t,we,Je,"~","\\textasciitilde"),J($t,we,Je,"\\","\\textbackslash"),J($t,we,Je,"^","\\textasciicircum"),J(ue,we,je,"↑","\\uparrow",!0),J(ue,we,je,"⇑","\\Uparrow",!0),J(ue,we,je,"↓","\\downarrow",!0),J(ue,we,je,"⇓","\\Downarrow",!0),J(ue,we,je,"↕","\\updownarrow",!0),J(ue,we,je,"⇕","\\Updownarrow",!0),J(ue,we,Mo,"∐","\\coprod"),J(ue,we,Mo,"⋁","\\bigvee"),J(ue,we,Mo,"⋀","\\bigwedge"),J(ue,we,Mo,"⨄","\\biguplus"),J(ue,we,Mo,"⋂","\\bigcap"),J(ue,we,Mo,"⋃","\\bigcup"),J(ue,we,Mo,"∫","\\int"),J(ue,we,Mo,"∫","\\intop"),J(ue,we,Mo,"∬","\\iint"),J(ue,we,Mo,"∭","\\iiint"),J(ue,we,Mo,"∏","\\prod"),J(ue,we,Mo,"∑","\\sum"),J(ue,we,Mo,"⨂","\\bigotimes"),J(ue,we,Mo,"⨁","\\bigoplus"),J(ue,we,Mo,"⨀","\\bigodot"),J(ue,we,Mo,"∮","\\oint"),J(ue,we,Mo,"∯","\\oiint"),J(ue,we,Mo,"∰","\\oiiint"),J(ue,we,Mo,"⨆","\\bigsqcup"),J(ue,we,Mo,"∫","\\smallint"),J($t,we,Y4,"…","\\textellipsis"),J(ue,we,Y4,"…","\\mathellipsis"),J($t,we,Y4,"…","\\ldots",!0),J(ue,we,Y4,"…","\\ldots",!0),J(ue,we,Y4,"⋯","\\@cdots",!0),J(ue,we,Y4,"⋱","\\ddots",!0),J(ue,we,Je,"⋮","\\varvdots"),J($t,we,Je,"⋮","\\varvdots"),J(ue,we,ms,"ˊ","\\acute"),J(ue,we,ms,"ˋ","\\grave"),J(ue,we,ms,"¨","\\ddot"),J(ue,we,ms,"~","\\tilde"),J(ue,we,ms,"ˉ","\\bar"),J(ue,we,ms,"˘","\\breve"),J(ue,we,ms,"ˇ","\\check"),J(ue,we,ms,"^","\\hat"),J(ue,we,ms,"⃗","\\vec"),J(ue,we,ms,"˙","\\dot"),J(ue,we,ms,"˚","\\mathring"),J(ue,we,an,"","\\@imath"),J(ue,we,an,"","\\@jmath"),J(ue,we,Je,"ı","ı"),J(ue,we,Je,"ȷ","ȷ"),J($t,we,Je,"ı","\\i",!0),J($t,we,Je,"ȷ","\\j",!0),J($t,we,Je,"ß","\\ss",!0),J($t,we,Je,"æ","\\ae",!0),J($t,we,Je,"œ","\\oe",!0),J($t,we,Je,"ø","\\o",!0),J($t,we,Je,"Æ","\\AE",!0),J($t,we,Je,"Œ","\\OE",!0),J($t,we,Je,"Ø","\\O",!0),J($t,we,ms,"ˊ","\\'"),J($t,we,ms,"ˋ","\\`"),J($t,we,ms,"ˆ","\\^"),J($t,we,ms,"˜","\\~"),J($t,we,ms,"ˉ","\\="),J($t,we,ms,"˘","\\u"),J($t,we,ms,"˙","\\."),J($t,we,ms,"¸","\\c"),J($t,we,ms,"˚","\\r"),J($t,we,ms,"ˇ","\\v"),J($t,we,ms,"¨",'\\"'),J($t,we,ms,"˝","\\H"),J($t,we,ms,"◯","\\textcircled");var E_t={"--":!0,"---":!0,"``":!0,"''":!0};J($t,we,Je,"–","--",!0),J($t,we,Je,"–","\\textendash"),J($t,we,Je,"—","---",!0),J($t,we,Je,"—","\\textemdash"),J($t,we,Je,"‘","`",!0),J($t,we,Je,"‘","\\textquoteleft"),J($t,we,Je,"’","'",!0),J($t,we,Je,"’","\\textquoteright"),J($t,we,Je,"“","``",!0),J($t,we,Je,"“","\\textquotedblleft"),J($t,we,Je,"”","''",!0),J($t,we,Je,"”","\\textquotedblright"),J(ue,we,Je,"°","\\degree",!0),J($t,we,Je,"°","\\degree"),J($t,we,Je,"°","\\textdegree",!0),J(ue,we,Je,"£","\\pounds"),J(ue,we,Je,"£","\\mathsterling",!0),J($t,we,Je,"£","\\pounds"),J($t,we,Je,"£","\\textsterling",!0),J(ue,We,Je,"✠","\\maltese"),J($t,We,Je,"✠","\\maltese");for(var __t='0123456789/@."',EAe=0;EAe<__t.length;EAe++){var R_t=__t.charAt(EAe);J(ue,we,Je,R_t,R_t)}for(var D_t='0123456789!@*()-=+";:?/.,',_Ae=0;_Ae{var e=t.charCodeAt(0),r=t.charCodeAt(1),n=(e-55296)*1024+(r-56320)+65536;if(119808<=n&&n<120484){var i=Math.floor((n-119808)/26);return F_t[i]}else if(120782<=n&&n<=120831){var a=Math.floor((n-120782)/10);return Tbn[a]}else{if(n===120485||n===120486)return F_t[0];if(120486{if(m2(t.classes)!==m2(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize||t.italic!==0&&t.hasClass("mathnormal"))return!1;if(t.classes.length===1){var r=t.classes[0];if(r==="mbin"||r==="mord")return!1}for(var n of Object.keys(t.style))if(t.style[n]!==e.style[n])return!1;for(var i of Object.keys(e.style))if(t.style[i]!==e.style[i])return!1;return!0},z_t=t=>{for(var e=0;er&&(r=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}e.height=r,e.depth=n,e.maxFontSize=i},Wt=function(e,r,n,i){var a=new W4(e,r,n,i);return $Ae(a),a},b2=(t,e,r,n)=>new W4(t,e,r,n),q4=function(e,r,n){var i=Wt([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=ir(i.height),i.maxFontSize=1,i},kbn=function(e,r,n,i){var a=new lZ(e,r,n,i);return $Ae(a),a},d1=function(e){var r=new H4(e);return $Ae(r),r},j4=function(e,r){return e instanceof H4?Wt([],[e],r):e},Ebn=function(e){if(e.positionType==="individualShift"){for(var r=e.children,n=[r[0]],i=-r[0].shift-r[0].elem.depth,a=i,s=1;s{var r=Wt(["mspace"],[],e),n=Ts(t,e);return r.style.marginRight=ir(n),r},gZ=(t,e,r)=>{var n,i;switch(t){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=t}return e==="textbf"&&r==="textit"?i="BoldItalic":e==="textbf"?i="Bold":r==="textit"?i="Italic":i="Regular",n+"-"+i},FAe={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},V_t={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Q_t=function(e,r){var[n,i,a]=V_t[e],s=new v2(n),o=new u1([s],{width:ir(i),height:ir(a),style:"width:"+ir(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=b2(["overlay"],[o],r);return l.height=a,l.style.height=ir(a),l.style.width=ir(i),l},Ss={number:3,unit:"mu"},iC={number:4,unit:"mu"},f1={number:5,unit:"mu"},_bn={mord:{mop:Ss,mbin:iC,mrel:f1,minner:Ss},mop:{mord:Ss,mop:Ss,mrel:f1,minner:Ss},mbin:{mord:iC,mop:iC,mopen:iC,minner:iC},mrel:{mord:f1,mop:f1,mopen:f1,minner:f1},mopen:{},mclose:{mop:Ss,mbin:iC,mrel:f1,minner:Ss},mpunct:{mord:Ss,mop:Ss,mrel:f1,mopen:Ss,mclose:Ss,mpunct:Ss,minner:Ss},minner:{mord:Ss,mop:Ss,mbin:iC,mrel:f1,mopen:Ss,mpunct:Ss,minner:Ss}},Rbn={mord:{mop:Ss},mop:{mord:Ss,mop:Ss},mbin:{},mrel:{},mopen:{},mclose:{mop:Ss},mpunct:{},minner:{mop:Ss}},G_t={},mZ={},vZ={};function xr(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},l=0;l{var v=m.classes[0],y=g.classes[0];v==="mbin"&&Lbn.has(y)?m.classes[0]="mord":y==="mbin"&&Dbn.has(v)&&(g.classes[0]="mord")},{node:d},f,p),zAe(a,(g,m)=>{var v,y,b=VAe(m),x=VAe(g),w=b&&x?g.hasClass("mtight")?(v=Rbn[b])==null?void 0:v[x]:(y=_bn[b])==null?void 0:y[x]:null;if(w)return U_t(w,u)},{node:d},f,p),a},zAe=function(e,r,n,i,a){i&&e.push(i);for(var s=0;sf=>{e.splice(d+1,0,f),s++})(s)}i&&e.pop()},H_t=function(e){return e instanceof H4||e instanceof lZ||e instanceof W4&&e.hasClass("enclosing")?e:null},UAe=function(e,r){var n=H_t(e);if(n){var i=n.children;if(i.length){if(r==="right")return UAe(i[i.length-1],"right");if(r==="left")return UAe(i[0],"left")}}return e},VAe=function(e,r){if(!e)return null;r&&(e=UAe(e,r));var n=e.classes[0];return Ibn[n]||null},z$=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Wt(r.concat(n))},qi=function(e,r,n){if(!e)return Wt();if(mZ[e.type]){var i=mZ[e.type](e,r);if(n&&r.size!==n.size){i=Wt(r.sizingClasses(n),[i],r);var a=r.sizeMultiplier/n.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new Zt("Got group of unknown type: '"+e.type+"'")};function bZ(t,e){var r=Wt(["base"],t,e),n=Wt(["strut"]);return n.style.height=ir(r.height+r.depth),r.depth&&(n.style.verticalAlign=ir(-r.depth)),r.children.unshift(n),r}function QAe(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=tl(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var a=[],s=[],o=0;o0&&(a.push(bZ(s,e)),s=[]),a.push(n[o]));s.length>0&&a.push(bZ(s,e));var u;r?(u=bZ(tl(r,e,!0),e),u.classes=["tag"],a.push(u)):i&&a.push(i);var h=Wt(["katex-html"],a);if(h.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=ir(h.height+h.depth),h.depth&&(d.style.verticalAlign=ir(-h.depth))}return h}function W_t(t){return new H4(t)}class tr{constructor(e,r,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=r||[],this.classes=n||[]}setAttribute(e,r){this.attributes[e]=r}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&e.setAttribute(r,this.attributes[r]);this.classes.length>0&&(e.className=m2(this.classes));for(var n=0;n0&&(e+=' class ="'+tu(m2(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}}class Po{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return tu(this.toText())}toText(){return this.text}}class Y_t{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",ir(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var Pbn=new Set(["\\imath","\\jmath"]),Nbn=new Set(["mrow","mtable"]),up=function(e,r,n){return gs[r][e]&&gs[r][e].replace&&e.charCodeAt(0)!==55349&&!(E_t.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=gs[r][e].replace),new Po(e)},GAe=function(e){return e.length===1?e[0]:new tr("mrow",e)},Bbn={mathit:"italic",boldsymbol:t=>t.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},HAe=(t,e)=>{if(t.mode==="text"){if(e.fontFamily==="texttt")return"monospace";if(e.fontFamily==="textsf")return e.fontShape==="textit"&&e.fontWeight==="textbf"?"sans-serif-bold-italic":e.fontShape==="textit"?"sans-serif-italic":e.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(e.fontShape==="textit"&&e.fontWeight==="textbf")return"bold-italic";if(e.fontShape==="textit")return"italic";if(e.fontWeight==="textbf")return"bold"}var r=e.font;if(!r||r==="mathnormal")return null;var n=t.mode,i=Bbn[r];if(i)return typeof i=="function"?i(t):i;var a=t.text;if(Pbn.has(a))return null;if(gs[n][a]){var s=gs[n][a].replace;s&&(a=s)}var o=FAe[r].fontName;return OAe(a,o,n)?FAe[r].variant:null};function WAe(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof Po&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var r=t.children[0];return r instanceof Po&&r.text===","}else return!1}var jd=function(e,r,n){if(e.length===1){var i=Ca(e[0],r);return n&&i instanceof tr&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],s,o=0;o=1&&(s.type==="mn"||WAe(s))){var u=l.children[0];u instanceof tr&&u.type==="mn"&&(u.children=[...s.children,...u.children],a.pop())}else if(s.type==="mi"&&s.children.length===1){var h=s.children[0];if(h instanceof Po&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof Po&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),a.pop())}}}a.push(l),s=l}return a},x2=function(e,r,n){return GAe(jd(e,r,n))},Ca=function(e,r){if(!e)return new tr("mrow");if(vZ[e.type])return vZ[e.type](e,r);throw new Zt("Got group of unknown type: '"+e.type+"'")};function q_t(t,e,r,n,i){var a=jd(t,r),s;a.length===1&&a[0]instanceof tr&&Nbn.has(a[0].type)?s=a[0]:s=new tr("mrow",a);var o=new tr("annotation",[new Po(e)]);o.setAttribute("encoding","application/x-tex");var l=new tr("semantics",[s,o]),u=new tr("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var h=i?"katex":"katex-mathml";return Wt([h],[u])}var $bn=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],j_t=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],X_t=function(e,r){return r.size<2?e:$bn[e-1][r.size-1]};class p1{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||p1.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=j_t[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var r={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(r,e),new p1(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:X_t(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:j_t[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=X_t(p1.BASESIZE,e);return this.size===r&&this.textSize===p1.BASESIZE&&this.style===e?this:this.extend({style:e,size:r})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==p1.BASESIZE?["sizing","reset-size"+this.size,"size"+p1.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=wbn(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}p1.BASESIZE=6;var K_t=function(e){return new p1({style:e.displayMode?In.DISPLAY:In.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},Z_t=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=Wt(n,[e])}return e},Fbn=function(e,r,n){var i=K_t(n),a;if(n.output==="mathml")return q_t(e,r,i,n.displayMode,!0);if(n.output==="html"){var s=QAe(e,i);a=Wt(["katex"],[s])}else{var o=q_t(e,r,i,n.displayMode,!1),l=QAe(e,i);a=Wt(["katex"],[o,l])}return Z_t(a,n)},zbn=function(e,r,n){var i=K_t(n),a=QAe(e,i),s=Wt(["katex"],[a]);return Z_t(s,n)},Ubn={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},xZ=function(e){var r=new tr("mo",[new Po(Ubn[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},Vbn={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Qbn=new Set(["widehat","widecheck","widetilde","utilde"]),wZ=function(e,r){function n(){var o=4e5,l=e.label.slice(1);if(Qbn.has(l)&&"base"in e){var u=e.base.type==="ordgroup"?e.base.body.length:1,h,d,f;if(u>5)l==="widehat"||l==="widecheck"?(h=420,o=2364,f=.42,d=l+"4"):(h=312,o=2340,f=.34,d="tilde4");else{var p=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][p],h=[0,239,300,360,420][p],f=[0,.24,.3,.3,.36,.42][p],d=l+p):(o=[0,600,1033,2339,2340][p],h=[0,260,286,306,312][p],f=[0,.26,.286,.3,.306,.34][p],d="tilde"+p)}var g=new v2(d),m=new u1([g],{width:"100%",height:ir(f),viewBox:"0 0 "+o+" "+h,preserveAspectRatio:"none"});return{span:b2([],[m],r),minWidth:0,height:f}}else{var v=[],y=Vbn[l];if(!y)throw new Error('No SVG data for "'+l+'".');var[b,x,w]=y,A=w/1e3,T=b.length,S,O;if(T===1){if(y.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');S=["hide-tail"],O=[y[3]]}else if(T===2)S=["halfarrow-left","halfarrow-right"],O=["xMinYMin","xMaxYMin"];else if(T===3)S=["brace-left","brace-center","brace-right"],O=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+T+" children.");for(var k=0;k0&&(i.style.minWidth=ir(a)),i},Gbn=function(e,r,n,i,a){var s,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(s=Wt(["stretchy",r],[],a),r==="fbox"){var l=a.color&&a.getColor();l&&(s.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(r)&&u.push(new CAe({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new CAe({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new u1(u,{width:"100%",height:ir(o)});s=b2([],[h],a)}return s.height=o,s.style.height=ir(o),s},Hbn={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Wbn={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function Ybn(t){return t in Hbn}function Wn(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function AZ(t){var e=TZ(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function TZ(t){return t&&(t.type==="atom"||Wbn.hasOwnProperty(t.type))?t:null}var J_t=t=>{if(t instanceof Yd)return t;if(xbn(t)&&t.children.length===1)return J_t(t.children[0])},YAe=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=Wn(t.base,"accent"),r=n.base,t.base=r,i=bbn(qi(t,e)),t.base=n):(n=Wn(t,"accent"),r=n.base);var a=qi(r,e.havingCrampedStyle()),s=n.isShifty&&l1(r),o=0;if(s){var l,u;o=(l=(u=J_t(a))==null?void 0:u.skew)!=null?l:0}var h=n.label==="\\c",d=h?a.height+a.depth:Math.min(a.height,e.fontMetrics().xHeight),f;if(n.isStretchy)f=wZ(n,e),f=Yi({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+ir(2*o)+")",marginLeft:ir(2*o)}:void 0}]});else{var p,g;n.label==="\\vec"?(p=Q_t("vec",e),g=V_t.vec[1]):(p=pZ({mode:n.mode,text:n.label},e,"textord"),p=ybn(p),p.italic=0,g=p.width,h&&(d+=p.depth)),f=Wt(["accent-body"],[p]);var m=n.label==="\\textcircled";m&&(f.classes.push("accent-full"),d=a.height);var v=o;m||(v-=g/2),f.style.left=ir(v),n.label==="\\textcircled"&&(f.style.top=".2em"),f=Yi({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:f}]})}var y=Wt(["mord","accent"],[f],e);return i?(i.children[0]=y,i.height=Math.max(y.height,i.height),i.classes[0]="mord",i):y},e5t=(t,e)=>{var r=t.isStretchy?xZ(t.label):new tr("mo",[up(t.label,t.mode)]),n=new tr("mover",[Ca(t.base,e),r]);return n.setAttribute("accent","true"),n},qbn=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));xr({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var r=yZ(e[0]),n=!qbn.test(t.funcName),i=!n||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:n,isShifty:i,base:r}},htmlBuilder:YAe,mathmlBuilder:e5t}),xr({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var r=e[0],n=t.parser.mode;return n==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:t.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:YAe,mathmlBuilder:e5t}),xr({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}},htmlBuilder:(t,e)=>{var r=qi(t.base,e),n=wZ(t,e),i=t.label==="\\utilde"?.12:0,a=Yi({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]});return Wt(["mord","accentunder"],[a],e)},mathmlBuilder:(t,e)=>{var r=xZ(t.label),n=new tr("munder",[Ca(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var SZ=t=>{var e=new tr("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};xr({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n,funcName:i}=t;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:r[0]}},htmlBuilder(t,e){var r=e.style,n=e.havingStyle(r.sup()),i=j4(qi(t.body,n,e),e),a=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var s;t.below&&(n=e.havingStyle(r.sub()),s=j4(qi(t.below,n,e),e),s.classes.push(a+"-arrow-pad"));var o=wZ(t,e),l=-e.fontMetrics().axisHeight+.5*o.height,u=-e.fontMetrics().axisHeight-.5*o.height-.111;(i.depth>.25||t.label==="\\xleftequilibrium")&&(u-=i.depth);var h;if(s){var d=-e.fontMetrics().axisHeight+s.height+.5*o.height+.111;h=Yi({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:s,shift:d}]})}else h=Yi({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return Wt(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=xZ(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=SZ(Ca(t.body,e));if(t.below){var a=SZ(Ca(t.below,e));n=new tr("munderover",[r,a,i])}else n=new tr("mover",[r,i])}else if(t.below){var s=SZ(Ca(t.below,e));n=new tr("munder",[r,s])}else n=SZ(),n=new tr("mover",[r,n]);return n}});function t5t(t,e){var r=tl(t.body,e,!0);return Wt([t.mclass],r,e)}function r5t(t,e){var r,n=jd(t.body,e);return t.mclass==="minner"?r=new tr("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new tr("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new tr("mo",n),t.mclass==="mbin"?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):t.mclass==="mpunct"?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(r.attributes.lspace="0em",r.attributes.rspace="0em"):t.mclass==="minner"&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}xr({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:Io(i),isCharacterBox:l1(i)}},htmlBuilder:t5t,mathmlBuilder:r5t});var CZ=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};xr({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:CZ(e[0]),body:Io(e[1]),isCharacterBox:l1(e[1])}}}),xr({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:r,funcName:n}=t,i=e[1],a=e[0],s;n!=="\\stackrel"?s=CZ(i):s="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Io(i)},l={type:"supsub",mode:a.mode,base:o,sup:n==="\\underset"?null:a,sub:n==="\\underset"?a:null};return{type:"mclass",mode:r.mode,mclass:s,body:[l],isCharacterBox:l1(l)}},htmlBuilder:t5t,mathmlBuilder:r5t}),xr({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:CZ(e[0]),body:Io(e[0])}},htmlBuilder(t,e){var r=tl(t.body,e,!0),n=Wt([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=jd(t.body,e),n=new tr("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var jbn={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},n5t=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),i5t=t=>t.type==="textord"&&t.text==="@",Xbn=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function Kbn(t,e,r){var n=jbn[t];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=r.callFunction("\\\\cdleft",[e[0]],[]),a={type:"atom",text:n,mode:"math",family:"rel"},s=r.callFunction("\\Big",[a],[]),o=r.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,s,o]};return r.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function Zbn(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var r=t.fetch().text;if(r==="&"||r==="\\\\")t.consume();else if(r==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new Zt("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var n=[],i=[n],a=0;aAV".includes(u))for(var d=0;d<2;d++){for(var f=!0,p=l+1;pAV=|." after @',s[l]);var g=Kbn(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display",resetFont:!0};n.push(m),o=n5t()}a%2===0?n.push(o):n.shift(),n=[],i.push(n)}t.gullet.endGroup(),t.gullet.endGroup();var v=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:v,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}xr({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:e[0]}},htmlBuilder(t,e){var r=e.havingStyle(e.style.sup()),n=j4(qi(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=ir(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new tr("mrow",[Ca(t.label,e)]);return r=new tr("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new tr("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}}),xr({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:r}=t;return{type:"cdlabelparent",mode:r.mode,fragment:e[0]}},htmlBuilder(t,e){var r=j4(qi(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new tr("mrow",[Ca(t.fragment,e)])}}),xr({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=Wn(e[0],"ordgroup"),i=n.body,a="",s=0;s=1114111)throw new Zt("\\@char with invalid code point "+a);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:r.mode,text:u}}});var a5t=(t,e)=>{var r=tl(t.body,e.withColor(t.color),!1);return d1(r)},s5t=(t,e)=>{var r=jd(t.body,e.withColor(t.color)),n=new tr("mstyle",r);return n.setAttribute("mathcolor",t.color),n};xr({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=Wn(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:Io(i)}},htmlBuilder:a5t,mathmlBuilder:s5t}),xr({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=Wn(e[0],"color-token").color;r.gullet.macros.set("\\current@color",i);var a=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:i,body:a}},htmlBuilder:a5t,mathmlBuilder:s5t}),xr({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,r){var{parser:n}=t,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,a=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:a,size:i&&Wn(i,"size").value}},htmlBuilder(t,e){var r=Wt(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=ir(Ts(t.size,e)))),r},mathmlBuilder(t,e){var r=new tr("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",ir(Ts(t.size,e)))),r}});var qAe={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},o5t=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Zt("Expected a control sequence",t);return e},Jbn=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},l5t=(t,e,r,n)=>{var i=t.gullet.macros.get(r.text);i==null&&(r.noexpand=!0,i={tokens:[r],numArgs:0,unexpandable:!t.gullet.isExpandable(r.text)}),t.gullet.macros.set(e,i,n)};xr({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:r}=t;e.consumeSpaces();var n=e.fetch();if(qAe[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=qAe[n.text]),Wn(e.parseFunction(),"internal");throw new Zt("Invalid token after macro prefix",n)}}),xr({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new Zt("Expected a control sequence",n);for(var a=0,s,o=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){s=e.gullet.future(),o[a].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new Zt('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==a+1)throw new Zt('Argument number "'+n.text+'" out of order');a++,o.push([])}else{if(n.text==="EOF")throw new Zt("Expected a macro definition");o[a].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return s&&l.unshift(s),(r==="\\edef"||r==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:a,delimiters:o},r===qAe[r]),{type:"internal",mode:e.mode}}}),xr({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=o5t(e.gullet.popToken());e.gullet.consumeSpaces();var i=Jbn(e);return l5t(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}}),xr({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=o5t(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return l5t(e,n,a,r==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var U$=function(e,r,n){var i=gs.math[e]&&gs.math[e].replace,a=OAe(i||e,r,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return a},jAe=function(e,r,n,i){var a=n.havingBaseStyle(r),s=Wt(i.concat(a.sizingClasses(n)),[e],n),o=a.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=a.sizeMultiplier,s},c5t=function(e,r,n){var i=r.havingBaseStyle(n),a=(1-r.sizeMultiplier/i.sizeMultiplier)*r.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=ir(a),e.height-=a,e.depth+=a},exn=function(e,r,n,i,a,s){var o=Uu(e,"Main-Regular",a,i),l=jAe(o,r,i,s);return c5t(l,i,r),l},txn=function(e,r,n,i){return Uu(e,"Size"+r+"-Regular",n,i)},u5t=function(e,r,n,i,a,s){var o=txn(e,r,a,i),l=jAe(Wt(["delimsizing","size"+r],[o],i),In.TEXT,i,s);return n&&c5t(l,i,In.TEXT),l},XAe=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Wt(["delimsizinginner",i],[Wt([],[Uu(e,r,n)])]);return{type:"elem",elem:a}},KAe=function(e,r,n){var i=A0["Size4-Regular"][e.charCodeAt(0)]?A0["Size4-Regular"][e.charCodeAt(0)][4]:A0["Size1-Regular"][e.charCodeAt(0)][4],a=new v2("inner",hbn(e,Math.round(1e3*r))),s=new u1([a],{width:ir(i),height:ir(r),style:"width:"+ir(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),o=b2([],[s],n);return o.height=r,o.style.height=ir(r),o.style.width=ir(i),{type:"elem",elem:o}},ZAe=.008,OZ={type:"kern",size:-1*ZAe},rxn=new Set(["|","\\lvert","\\rvert","\\vert"]),nxn=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),h5t=function(e,r,n,i,a,s){var o,l,u,h,d="",f=0;o=u=h=e,l=null;var p="Size1-Regular";e==="\\uparrow"?u=h="⏐":e==="\\Uparrow"?u=h="‖":e==="\\downarrow"?o=u="⏐":e==="\\Downarrow"?o=u="‖":e==="\\updownarrow"?(o="\\uparrow",u="⏐",h="\\downarrow"):e==="\\Updownarrow"?(o="\\Uparrow",u="‖",h="\\Downarrow"):rxn.has(e)?(u="∣",d="vert",f=333):nxn.has(e)?(u="∥",d="doublevert",f=556):e==="["||e==="\\lbrack"?(o="⎡",u="⎢",h="⎣",p="Size4-Regular",d="lbrack",f=667):e==="]"||e==="\\rbrack"?(o="⎤",u="⎥",h="⎦",p="Size4-Regular",d="rbrack",f=667):e==="\\lfloor"||e==="⌊"?(u=o="⎢",h="⎣",p="Size4-Regular",d="lfloor",f=667):e==="\\lceil"||e==="⌈"?(o="⎡",u=h="⎢",p="Size4-Regular",d="lceil",f=667):e==="\\rfloor"||e==="⌋"?(u=o="⎥",h="⎦",p="Size4-Regular",d="rfloor",f=667):e==="\\rceil"||e==="⌉"?(o="⎤",u=h="⎥",p="Size4-Regular",d="rceil",f=667):e==="("||e==="\\lparen"?(o="⎛",u="⎜",h="⎝",p="Size4-Regular",d="lparen",f=875):e===")"||e==="\\rparen"?(o="⎞",u="⎟",h="⎠",p="Size4-Regular",d="rparen",f=875):e==="\\{"||e==="\\lbrace"?(o="⎧",l="⎨",h="⎩",u="⎪",p="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(o="⎫",l="⎬",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(o="⎧",h="⎩",u="⎪",p="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(o="⎫",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(o="⎧",h="⎭",u="⎪",p="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(o="⎫",h="⎩",u="⎪",p="Size4-Regular");var g=U$(o,p,a),m=g.height+g.depth,v=U$(u,p,a),y=v.height+v.depth,b=U$(h,p,a),x=b.height+b.depth,w=0,A=1;if(l!==null){var T=U$(l,p,a);w=T.height+T.depth,A=2}var S=m+x+w,O=Math.max(0,Math.ceil((r-S)/(A*y))),k=S+O*A*y,E=i.fontMetrics().axisHeight;n&&(E*=i.sizeMultiplier);var _=k/2-E,I=[];if(d.length>0){var L=k-m-x,R=Math.round(k*1e3),D=dbn(d,Math.round(L*1e3)),M=new v2(d,D),P=ir(f/1e3),N=ir(R/1e3),F=new u1([M],{width:P,height:N,viewBox:"0 0 "+f+" "+R}),B=b2([],[F],i);B.height=R/1e3,B.style.width=P,B.style.height=N,I.push({type:"elem",elem:B})}else{if(I.push(XAe(h,p,a)),I.push(OZ),l===null){var V=k-m-x+2*ZAe;I.push(KAe(u,V,i))}else{var z=(k-m-x-w)/2+2*ZAe;I.push(KAe(u,z,i)),I.push(OZ),I.push(XAe(l,p,a)),I.push(OZ),I.push(KAe(u,z,i))}I.push(OZ),I.push(XAe(o,p,a))}var U=i.havingBaseStyle(In.TEXT),Q=Yi({positionType:"bottom",positionData:_,children:I});return jAe(Wt(["delimsizing","mult"],[Q],U),In.TEXT,i,s)},JAe=80,eTe=.08,tTe=function(e,r,n,i,a){var s=ubn(e,i,n),o=new v2(e,s),l=new u1([o],{width:"400em",height:ir(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return b2(["hide-tail"],[l],a)},ixn=function(e,r){var n=r.havingBaseSizing(),i=m5t("\\surd",e*n.sizeMultiplier,g5t,n),a=n.sizeMultiplier,s=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),o,l,u,h,d;return i.type==="small"?(h=1e3+1e3*s+JAe,e<1?a=1:e<1.4&&(a=.7),l=(1+s+eTe)/a,u=(1+s)/a,o=tTe("sqrtMain",l,h,s,r),o.style.minWidth="0.853em",d=.833/a):i.type==="large"?(h=(1e3+JAe)*V$[i.size],u=(V$[i.size]+s)/a,l=(V$[i.size]+s+eTe)/a,o=tTe("sqrtSize"+i.size,l,h,s,r),o.style.minWidth="1.02em",d=1/a):(l=e+s+eTe,u=e+s,h=Math.floor(1e3*e+s)+JAe,o=tTe("sqrtTall",l,h,s,r),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=ir(l),{span:o,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+s)*a}},d5t=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),axn=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),f5t=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),V$=[0,1.2,1.8,2.4,3],p5t=function(e,r,n,i,a){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),d5t.has(e)||f5t.has(e))return u5t(e,r,!1,n,i,a);if(axn.has(e))return h5t(e,V$[r],!1,n,i,a);throw new Zt("Illegal delimiter: '"+e+"'")},sxn=[{type:"small",style:In.SCRIPTSCRIPT},{type:"small",style:In.SCRIPT},{type:"small",style:In.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],oxn=[{type:"small",style:In.SCRIPTSCRIPT},{type:"small",style:In.SCRIPT},{type:"small",style:In.TEXT},{type:"stack"}],g5t=[{type:"small",style:In.SCRIPTSCRIPT},{type:"small",style:In.SCRIPT},{type:"small",style:In.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],lxn=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";var r=e.type;throw new Error("Add support for delim type '"+r+"' here.")},m5t=function(e,r,n,i){for(var a=Math.min(2,3-i.style.size),s=a;sr)return o}return n[n.length-1]},rTe=function(e,r,n,i,a,s){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;f5t.has(e)?o=sxn:d5t.has(e)?o=g5t:o=oxn;var l=m5t(e,r,o,i);return l.type==="small"?exn(e,l.style,n,i,a,s):l.type==="large"?u5t(e,l.size,n,i,a,s):h5t(e,r,n,i,a,s)},nTe=function(e,r,n,i,a,s){var o=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,u=5/i.fontMetrics().ptPerEm,h=Math.max(r-o,n+o),d=Math.max(h/500*l,2*h-u);return rTe(e,d,!0,i,a,s)},v5t={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},cxn=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function y5t(t){return"isMiddle"in t}function kZ(t,e){var r=TZ(t);if(r&&cxn.has(r.text))return r;throw r?new Zt("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new Zt("Invalid delimiter type '"+t.type+"'",t)}xr({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(t,e)=>{var r=kZ(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:v5t[t.funcName].size,mclass:v5t[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?Wt([t.mclass]):p5t(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(up(t.delim,t.mode));var r=new tr("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=ir(V$[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function b5t(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}xr({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=t.parser.gullet.macros.get("\\current@color");if(r&&typeof r!="string")throw new Zt("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:kZ(e[0],t).text,color:r}}}),xr({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=kZ(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=Wn(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}},htmlBuilder:(t,e)=>{b5t(t);for(var r=tl(t.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,s=0;s{b5t(t);var r=jd(t.body,e);if(t.left!=="."){var n=new tr("mo",[up(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new tr("mo",[up(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return GAe(r)}}),xr({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=kZ(e[0],t);if(!t.parser.leftrightDepth)throw new Zt("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},htmlBuilder:(t,e)=>{var r;return t.delim==="."?r=z$(e,[]):(r=p5t(t.delim,1,e,t.mode,[]),r.isMiddle={delim:t.delim,options:e}),r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?up("|","text"):up(t.delim,t.mode),n=new tr("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var EZ=(t,e)=>{var r=j4(qi(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,a,s,o=l1(t.body);if(n==="sout")a=Wt(["stretchy","sout"]),a.height=e.fontMetrics().defaultRuleThickness/i,s=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=Ts({number:.6,unit:"pt"},e),u=Ts({number:.35,unit:"ex"},e),h=e.havingBaseSizing();i=i/h.sizeMultiplier;var d=r.height+r.depth+l+u;r.style.paddingLeft=ir(d/2+l);var f=Math.floor(1e3*d*i),p=lbn(f),g=new u1([new v2("phase",p)],{width:"400em",height:ir(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});a=b2(["hide-tail"],[g],e),a.style.height=ir(d),s=r.depth+l+u}else{/cancel/.test(n)?o||r.classes.push("cancel-pad"):n==="angl"?r.classes.push("anglpad"):r.classes.push("boxpad");var m,v,y=0;/box/.test(n)?(y=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),m=e.fontMetrics().fboxsep+(n==="colorbox"?0:y),v=m):n==="angl"?(y=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),m=4*y,v=Math.max(0,.25-r.depth)):(m=o?.2:0,v=m),a=Gbn(r,n,m,v,e),/fbox|boxed|fcolorbox/.test(n)?(a.style.borderStyle="solid",a.style.borderWidth=ir(y)):n==="angl"&&y!==.049&&(a.style.borderTopWidth=ir(y),a.style.borderRightWidth=ir(y)),s=r.depth+v,t.backgroundColor&&(a.style.backgroundColor=t.backgroundColor,t.borderColor&&(a.style.borderColor=t.borderColor))}var b;if(t.backgroundColor)b=Yi({positionType:"individualShift",children:[{type:"elem",elem:a,shift:s},{type:"elem",elem:r,shift:0}]});else{var x=/cancel|phase/.test(n)?["svg-align"]:[];b=Yi({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:a,shift:s,wrapperClasses:x}]})}return/cancel/.test(n)&&(b.height=r.height,b.depth=r.depth),/cancel/.test(n)&&!o?Wt(["mord","cancel-lap"],[b],e):Wt(["mord"],[b],e)},_Z=(t,e)=>{var r,n=new tr(t.label.includes("colorbox")?"mpadded":"menclose",[Ca(t.body,e)]);switch(t.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),t.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+ir(i)+" solid "+t.borderColor)}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n};xr({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=Wn(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:EZ,mathmlBuilder:_Z}),xr({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=Wn(e[0],"color-token").color,s=Wn(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,borderColor:a,body:o}},htmlBuilder:EZ,mathmlBuilder:_Z}),xr({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\fbox",body:e[0]}}}),xr({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:EZ,mathmlBuilder:_Z}),xr({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t;r.mode==="math"&&r.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:EZ,mathmlBuilder:_Z}),xr({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\angl",body:e[0]}}});var x5t={};function T0(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l{var e=t.parser.settings;if(!e.displayMode)throw new Zt("{"+t.envName+"} can be used only in display mode.")},uxn=new Set(["gather","gather*"]);function iTe(t){if(!t.includes("ed"))return!t.includes("*")}function w2(t,e,r){var{hskipBeforeAndAfter:n,addJot:i,cols:a,arraystretch:s,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:h,maxNumCols:d,leqno:f}=e;if(t.gullet.beginGroup(),u||t.gullet.macros.set("\\cr","\\\\\\relax"),!s){var p=t.gullet.expandMacroAsText("\\arraystretch");if(p==null)s=1;else if(s=parseFloat(p),!s||s<0)throw new Zt("Invalid \\arraystretch: "+p)}t.gullet.beginGroup();var g=[],m=[g],v=[],y=[],b=l!=null?[]:void 0;function x(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function w(){b&&(t.gullet.macros.get("\\df@tag")?(b.push(t.subparse([new Xd("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):b.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(x(),y.push(A5t(t));;){var A=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup();var T={type:"ordgroup",mode:t.mode,body:A};r&&(T={type:"styling",mode:t.mode,style:r,resetFont:!0,body:[T]}),g.push(T);var S=t.fetch().text;if(S==="&"){if(d&&g.length===d){if(u||o)throw new Zt("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(S==="\\end"){w(),g.length===1&&T.type==="styling"&&T.body.length===1&&T.body[0].type==="ordgroup"&&T.body[0].body.length===0&&(m.length>1||!h)&&m.pop(),y.length0&&(x+=.25),u.push({pos:x,isDashed:be[ne]})}for(w(s[0]),n=0;n0&&(_+=b,S<_&&(S=_),_=0)),e.addJot&&nbe))for(n=0;n=o)){var q=void 0;if(i>0||e.hskipBeforeAndAfter){var Z,ee;q=(Z=(ee=U)==null?void 0:ee.pregap)!=null?Z:f,q!==0&&(D=Wt(["arraycolsep"],[]),D.style.width=ir(q),R.push(D))}var re=[];for(n=0;n0){for(var ge=q4("hline",r,h),Qe=q4("hdashline",r,h),Se=[{type:"elem",elem:Te,shift:0}];u.length>0;){var De=u.pop(),qe=De.pos-I;De.isDashed?Se.push({type:"elem",elem:Qe,shift:qe}):Se.push({type:"elem",elem:ge,shift:qe})}Te=Yi({positionType:"individualShift",children:Se})}if(P.length===0)return Wt(["mord"],[Te],r);var K=Yi({positionType:"individualShift",children:P}),ce=Wt(["tag"],[K],r);return d1([Te,ce])},hxn={c:"center ",l:"left ",r:"right "},C0=function(e,r){for(var n=[],i=new tr("mtd",[],["mtr-glue"]),a=new tr("mtd",[],["mml-eqn-num"]),s=0;s0){var g=e.cols,m="",v=!1,y=0,b=g.length;g[0].type==="separator"&&(f+="top ",y=1),g[g.length-1].type==="separator"&&(f+="bottom ",b-=1);for(var x=y;x0?"left ":"",f+=k[k.length-1].length>0?"right ":"";for(var E=1;E0&&p&&(v=1),n[g]={type:"align",align:m,pregap:v,postgap:0}}return s.colSeparationType=p?"align":"alignat",s};T0({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=TZ(e[0]),n=r?[e[0]]:Wn(e[0],"ordgroup").body,i=n.map(function(s){var o=AZ(s),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Zt("Unknown column alignment: "+l,s)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return w2(t.parser,a,aTe(t.envName))},htmlBuilder:S0,mathmlBuilder:C0}),T0({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],r="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if(t.envName.charAt(t.envName.length-1)==="*"){var i=t.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,!"lcr".includes(r))throw new Zt("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var a=w2(t.parser,n,aTe(t.envName)),s=Math.max(0,...a.body.map(o=>o.length));return a.cols=new Array(s).fill({type:"align",align:r}),e?{type:"leftright",mode:t.mode,body:[a],left:e[0],right:e[1],rightColor:void 0}:a},htmlBuilder:S0,mathmlBuilder:C0}),T0({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=w2(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:S0,mathmlBuilder:C0}),T0({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=TZ(e[0]),n=r?[e[0]]:Wn(e[0],"ordgroup").body,i=n.map(function(o){var l=AZ(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Zt("Unknown column alignment: "+u,o)});if(i.length>1)throw new Zt("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},s=w2(t.parser,a,"script");if(s.body.length>0&&s.body[0].length>1)throw new Zt("{subarray} can contain only one column");return s},htmlBuilder:S0,mathmlBuilder:C0}),T0({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},r=w2(t.parser,e,aTe(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:S0,mathmlBuilder:C0}),T0({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:T5t,htmlBuilder:S0,mathmlBuilder:C0}),T0({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){uxn.has(t.envName)&&RZ(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:iTe(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return w2(t.parser,e,"display")},htmlBuilder:S0,mathmlBuilder:C0}),T0({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:T5t,htmlBuilder:S0,mathmlBuilder:C0}),T0({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){RZ(t);var e={autoTag:iTe(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return w2(t.parser,e,"display")},htmlBuilder:S0,mathmlBuilder:C0}),T0({type:"array",names:["CD"],props:{numArgs:0},handler(t){return RZ(t),Zbn(t.parser)},htmlBuilder:S0,mathmlBuilder:C0}),ke("\\nonumber","\\gdef\\@eqnsw{0}"),ke("\\notag","\\nonumber"),xr({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new Zt(t.funcName+" valid only within array environment")}});var S5t=x5t;xr({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];if(i.type!=="ordgroup")throw new Zt("Invalid environment name",i);for(var a="",s=0;s{var r=t.font,n=e.withFont(r);return qi(t.body,n)},O5t=(t,e)=>{var r=t.font,n=e.withFont(r);return Ca(t.body,n)},k5t={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};xr({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=yZ(e[0]),a=n;return a in k5t&&(a=k5t[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}},htmlBuilder:C5t,mathmlBuilder:O5t}),xr({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"mclass",mode:r.mode,mclass:CZ(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:l1(n)}}}),xr({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n,breakOnTokenText:i}=t,{mode:a}=r,s=r.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:s}}},htmlBuilder:C5t,mathmlBuilder:O5t});var dxn=(t,e)=>{var r=e.style,n=r.fracNum(),i=r.fracDen(),a;a=e.havingStyle(n);var s=qi(t.numer,a,e);if(t.continued){var o=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;s.height=s.height0?g=3*f:g=7*f,m=e.fontMetrics().denom1):(d>0?(p=e.fontMetrics().num2,g=f):(p=e.fontMetrics().num3,g=3*f),m=e.fontMetrics().denom2);var v;if(h){var b=e.fontMetrics().axisHeight;p-s.depth-(b+.5*d){var r=new tr("mfrac",[Ca(t.numer,e),Ca(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=Ts(t.barSize,e);r.setAttribute("linethickness",ir(n))}if(t.leftDelim!=null||t.rightDelim!=null){var i=[];if(t.leftDelim!=null){var a=new tr("mo",[new Po(t.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(r),t.rightDelim!=null){var s=new tr("mo",[new Po(t.rightDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}return GAe(i)}return r},E5t=(t,e)=>{if(!e)return t;var r={type:"styling",mode:t.mode,style:e,body:[t]};return r};xr({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=e[1],s,o=null,l=null;switch(n){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":s=!0;break;case"\\\\atopfrac":s=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s=!1,o="(",l=")";break;case"\\\\bracefrac":s=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":s=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=n==="\\cfrac",h=null;return u||n.startsWith("\\d")?h="display":n.startsWith("\\t")&&(h="text"),E5t({type:"genfrac",mode:r.mode,numer:i,denom:a,continued:u,hasBarLine:s,leftDelim:o,rightDelim:l,barSize:null},h)},htmlBuilder:dxn,mathmlBuilder:fxn}),xr({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:r,token:n}=t,i;switch(r){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var _5t=["display","text","script","scriptscript"],R5t=function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r};xr({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:r}=t,n=e[4],i=e[5],a=yZ(e[0]),s=a.type==="atom"&&a.family==="open"?R5t(a.text):null,o=yZ(e[1]),l=o.type==="atom"&&o.family==="close"?R5t(o.text):null,u=Wn(e[2],"size"),h,d=null;u.isBlank?h=!0:(d=u.value,h=d.number>0);var f=null,p=e[3];if(p.type==="ordgroup"){if(p.body.length>0){var g=Wn(p.body[0],"textord");f=_5t[Number(g.text)]}}else p=Wn(p,"textord"),f=_5t[Number(p.text)];return E5t({type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:s,rightDelim:l},f)}}),xr({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:r,funcName:n,token:i}=t;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:Wn(e[0],"size").value,token:i}}}),xr({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=Wn(e[1],"infix").size;if(!a)throw new Error("\\\\abovefrac expected size, but got "+String(a));var s=e[2],o=a.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:s,continued:!1,hasBarLine:o,barSize:a,leftDelim:null,rightDelim:null}}});var D5t=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?qi(t.sup,e.havingStyle(r.sup()),e):qi(t.sub,e.havingStyle(r.sub()),e),i=Wn(t.base,"horizBrace")):i=Wn(t,"horizBrace");var a=qi(i.base,e.havingBaseStyle(In.DISPLAY)),s=wZ(i,e),o;if(i.isOver?o=Yi({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s,wrapperClasses:["svg-align"]}]}):o=Yi({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:a}]}),n){var l=Wt(["minner",i.isOver?"mover":"munder"],[o],e);i.isOver?o=Yi({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):o=Yi({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Wt(["minner",i.isOver?"mover":"munder"],[o],e)},pxn=(t,e)=>{var r=xZ(t.label);return new tr(t.isOver?"mover":"munder",[Ca(t.base,e),r])};xr({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"horizBrace",mode:r.mode,label:n,isOver:n.includes("\\over"),base:e[0]}},htmlBuilder:D5t,mathmlBuilder:pxn}),xr({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[1],i=Wn(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:Io(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=tl(t.body,e,!1);return kbn(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=x2(t.body,e);return r instanceof tr||(r=new tr("mrow",[r])),r.setAttribute("href",t.href),r}}),xr({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=Wn(e[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],a=0;a{var{parser:r,funcName:n,token:i}=t,a=Wn(e[0],"raw").string,s=e[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(n){case"\\htmlClass":l.class=a,o={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,o={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,o={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var u=a.split(","),h=0;h{var r=tl(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=Wt(n,r,e);for(var a in t.attributes)a!=="class"&&t.attributes.hasOwnProperty(a)&&i.setAttribute(a,t.attributes[a]);return i},mathmlBuilder:(t,e)=>x2(t.body,e)}),xr({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"htmlmathml",mode:r.mode,html:Io(e[0]),mathml:Io(e[1])}},htmlBuilder:(t,e)=>{var r=tl(t.html,e,!1);return d1(r)},mathmlBuilder:(t,e)=>x2(t.mathml,e)});var sTe=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!r)throw new Zt("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!A_t(n))throw new Zt("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};xr({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,r)=>{var{parser:n}=t,i={number:0,unit:"em"},a={number:.9,unit:"em"},s={number:0,unit:"em"},o="";if(r[0])for(var l=Wn(r[0],"raw").string,u=l.split(","),h=0;h{var r=Ts(t.height,e),n=0;t.totalheight.number>0&&(n=Ts(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=Ts(t.width,e));var a={height:ir(r+n)};i>0&&(a.width=ir(i)),n>0&&(a.verticalAlign=ir(-n));var s=new mbn(t.src,t.alt,a);return s.height=r,s.depth=n,s},mathmlBuilder:(t,e)=>{var r=new tr("mglyph",[]);r.setAttribute("alt",t.alt);var n=Ts(t.height,e),i=0;if(t.totalheight.number>0&&(i=Ts(t.totalheight,e)-n,r.setAttribute("valign",ir(-i))),r.setAttribute("height",ir(n+i)),t.width.number>0){var a=Ts(t.width,e);r.setAttribute("width",ir(a))}return r.setAttribute("src",t.src),r}}),xr({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=Wn(e[0],"size");if(r.settings.strict){var a=n[1]==="m",s=i.value.unit==="mu";a?(s||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),r.mode!=="math"&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):s&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:i.value}},htmlBuilder(t,e){return U_t(t.dimension,e)},mathmlBuilder(t,e){var r=Ts(t.dimension,e);return new Y_t(r)}}),xr({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:i}},htmlBuilder:(t,e)=>{var r;t.alignment==="clap"?(r=Wt([],[qi(t.body,e)]),r=Wt(["inner"],[r],e)):r=Wt(["inner"],[qi(t.body,e)]);var n=Wt(["fix"],[]),i=Wt([t.alignment],[r,n],e),a=Wt(["strut"]);return a.style.height=ir(i.height+i.depth),i.depth&&(a.style.verticalAlign=ir(-i.depth)),i.children.unshift(a),i=Wt(["thinbox"],[i],e),Wt(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new tr("mpadded",[Ca(t.body,e)]);if(t.alignment!=="rlap"){var n=t.alignment==="llap"?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r}}),xr({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:r,parser:n}=t,i=n.mode;n.switchMode("math");var a=r==="\\("?"\\)":"$",s=n.parseExpression(!1,a);return n.expect(a),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",resetFont:!0,body:s}}}),xr({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new Zt("Mismatched "+t.funcName)}});var L5t=(t,e)=>{switch(e.style.size){case In.DISPLAY.size:return t.display;case In.TEXT.size:return t.text;case In.SCRIPT.size:return t.script;case In.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};xr({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:Io(e[0]),text:Io(e[1]),script:Io(e[2]),scriptscript:Io(e[3])}},htmlBuilder:(t,e)=>{var r=L5t(t,e),n=tl(r,e,!1);return d1(n)},mathmlBuilder:(t,e)=>{var r=L5t(t,e);return x2(r,e)}});var M5t=(t,e,r,n,i,a,s)=>{t=Wt([],[t]);var o=r&&l1(r),l,u;if(e){var h=qi(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=qi(r,n.havingStyle(i.sub()),n);l={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}var f;if(u&&l){var p=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+t.depth+s;f=Yi({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:ir(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:ir(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else if(l){var g=t.height-s;f=Yi({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:ir(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t}]})}else if(u){var m=t.depth+s;f=Yi({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:ir(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else return t;var v=[f];if(l&&a!==0&&!o){var y=Wt(["mspace"],[],n);y.style.marginRight=ir(a),v.unshift(y)}return Wt(["mop","op-limits"],v,n)},I5t=new Set(["\\smallint"]),X4=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=Wn(t.base,"op"),i=!0):a=Wn(t,"op");var s=e.style,o=!1;s.size===In.DISPLAY.size&&a.symbol&&!I5t.has(a.name)&&(o=!0);var l,u;if(a.symbol){var h=o?"Size2-Regular":"Size1-Regular",d="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(d=a.name.slice(1),a.name=d==="oiint"?"\\iint":"\\iiint"),l=Uu(a.name,h,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var f=Q_t(d+"Size"+(o?"2":"1"),e);l=Yi({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:o?.08:0}]}),a.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(a.body){var p=tl(a.body,e,!0);p.length===1&&p[0]instanceof Yd?(l=p[0],l.classes[0]="mop"):l=Wt(["mop"],p,e)}else{for(var g=[],m=1;m{var r;if(t.symbol)r=new tr("mo",[up(t.name,t.mode)]),I5t.has(t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new tr("mo",jd(t.body,e));else{r=new tr("mi",[new Po(t.name.slice(1))]);var n=new tr("mo",[up("⁡","text")]);t.parentIsSupSub?r=new tr("mrow",[r,n]):r=W_t([r,n])}return r},gxn={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};xr({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=n;return i.length===1&&(i=gxn[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:X4,mathmlBuilder:Q$}),xr({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Io(n)}},htmlBuilder:X4,mathmlBuilder:Q$});var mxn={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};xr({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:X4,mathmlBuilder:Q$}),xr({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:X4,mathmlBuilder:Q$}),xr({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(t){var{parser:e,funcName:r}=t,n=r;return n.length===1&&(n=mxn[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:X4,mathmlBuilder:Q$});var P5t=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=Wn(t.base,"operatorname"),i=!0):a=Wn(t,"operatorname");var s;if(a.body.length>0){for(var o=a.body.map(d=>{var f="text"in d?d.text:void 0;return typeof f=="string"?{type:"textord",mode:d.mode,text:f}:d}),l=tl(o,e.withFont("mathrm"),!0),u=0;u{for(var r=jd(t.body,e.withFont("mathrm")),n=!0,i=0;ih.toText()).join("");r=[new Po(o)]}var l=new tr("mi",r);l.setAttribute("mathvariant","normal");var u=new tr("mo",[up("⁡","text")]);return t.parentIsSupSub?new tr("mrow",[l,u]):W_t([l,u])};xr({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"operatorname",mode:r.mode,body:Io(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:P5t,mathmlBuilder:vxn}),ke("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),aC({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?d1(tl(t.body,e,!1)):Wt(["mord"],tl(t.body,e,!0),e)},mathmlBuilder(t,e){return x2(t.body,e,!0)}}),xr({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:r}=t,n=e[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(t,e){var r=qi(t.body,e.havingCrampedStyle()),n=q4("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Yi({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]});return Wt(["mord","overline"],[a],e)},mathmlBuilder(t,e){var r=new tr("mo",[new Po("‾")]);r.setAttribute("stretchy","true");var n=new tr("mover",[Ca(t.body,e),r]);return n.setAttribute("accent","true"),n}}),xr({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"phantom",mode:r.mode,body:Io(n)}},htmlBuilder:(t,e)=>{var r=tl(t.body,e.withPhantom(),!1);return d1(r)},mathmlBuilder:(t,e)=>{var r=jd(t.body,e);return new tr("mphantom",r)}}),ke("\\hphantom","\\smash{\\phantom{#1}}"),xr({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"vphantom",mode:r.mode,body:n}},htmlBuilder:(t,e)=>{var r=Wt(["inner"],[qi(t.body,e.withPhantom())]),n=Wt(["fix"],[]);return Wt(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=jd(Io(t.body),e),n=new tr("mphantom",r),i=new tr("mpadded",[n]);return i.setAttribute("width","0px"),i}}),xr({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=Wn(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=qi(t.body,e),n=Ts(t.dy,e);return Yi({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new tr("mpadded",[Ca(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}}),xr({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}}),xr({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,r){var{parser:n}=t,i=r[0],a=Wn(e[0],"size"),s=Wn(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&Wn(i,"size").value,width:a.value,height:s.value}},htmlBuilder(t,e){var r=Wt(["mord","rule"],[],e),n=Ts(t.width,e),i=Ts(t.height,e),a=t.shift?Ts(t.shift,e):0;return r.style.borderRightWidth=ir(n),r.style.borderTopWidth=ir(i),r.style.bottom=ir(a),r.width=n,r.height=i+a,r.depth=-a,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=Ts(t.width,e),n=Ts(t.height,e),i=t.shift?Ts(t.shift,e):0,a=e.color&&e.getColor()||"black",s=new tr("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",ir(r)),s.setAttribute("height",ir(n));var o=new tr("mpadded",[s]);return i>=0?o.setAttribute("height",ir(i)):(o.setAttribute("height",ir(i)),o.setAttribute("depth",ir(-i))),o.setAttribute("voffset",ir(i)),o}});function N5t(t,e,r){for(var n=tl(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,a=0;a{var r=e.havingSize(t.size);return N5t(t.body,r,e)};xr({type:"sizing",names:B5t,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:B5t.indexOf(n)+1,body:a}},htmlBuilder:yxn,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=jd(t.body,r),i=new tr("mstyle",n);return i.setAttribute("mathsize",ir(r.sizeMultiplier)),i}}),xr({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,r)=>{var{parser:n}=t,i=!1,a=!1,s=r[0]&&Wn(r[0],"ordgroup");if(s)for(var o,l=0;l{var r=Wt([],[qi(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return r;if(t.smashHeight&&(r.height=0),t.smashDepth&&(r.depth=0),t.smashHeight&&t.smashDepth)return Wt(["mord","smash"],[r],e);if(r.children)for(var n=0;n{var r=new tr("mpadded",[Ca(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}}),xr({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n}=t,i=r[0],a=e[0];return{type:"sqrt",mode:n.mode,body:a,index:i}},htmlBuilder(t,e){var r=qi(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=j4(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,a=i;e.style.idr.height+r.depth+s&&(s=(s+d-r.height-r.depth)/2);var f=l.height-r.height-s-u;r.style.paddingLeft=ir(h);var p=Yi({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+f)},{type:"elem",elem:l},{type:"kern",size:u}]});if(t.index){var g=e.havingStyle(In.SCRIPTSCRIPT),m=qi(t.index,g,e),v=.6*(p.height-p.depth),y=Yi({positionType:"shift",positionData:-v,children:[{type:"elem",elem:m}]}),b=Wt(["root"],[y]);return Wt(["mord","sqrt"],[b,p],e)}else return Wt(["mord","sqrt"],[p],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new tr("mroot",[Ca(r,e),Ca(n,e)]):new tr("msqrt",[Ca(r,e)])}});var oTe={display:In.DISPLAY,text:In.TEXT,script:In.SCRIPT,scriptscript:In.SCRIPTSCRIPT};function bxn(t){return t in oTe}xr({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!0,r),s=n.slice(1,n.length-5);if(!bxn(s))throw new Error("Unknown style: "+s);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(t,e){var r=oTe[t.style],n=e.havingStyle(r);return t.resetFont&&(n=n.withFont("")),N5t(t.body,n,e)},mathmlBuilder(t,e){var r=oTe[t.style],n=e.havingStyle(r);t.resetFont&&(n=n.withFont(""));var i=jd(t.body,n),a=new tr("mstyle",i),s={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=s[t.style];return a.setAttribute("scriptlevel",o[0]),a.setAttribute("displaystyle",o[1]),a}});var xxn=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===In.DISPLAY.size||n.alwaysHandleSupSub);return i?X4:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===In.DISPLAY.size||n.limits);return a?P5t:null}else{if(n.type==="accent")return l1(n.base)?YAe:null;if(n.type==="horizBrace"){var s=!e.sub;return s===n.isOver?D5t:null}else return null}else return null};aC({type:"supsub",htmlBuilder(t,e){var r=xxn(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:a}=t,s=qi(n,e),o,l,u=e.fontMetrics(),h=0,d=0,f=n&&l1(n);if(i){var p=e.havingStyle(e.style.sup());o=qi(i,p,e),f||(h=s.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(a){var g=e.havingStyle(e.style.sub());l=qi(a,g,e),f||(d=s.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var m;e.style===In.DISPLAY?m=u.sup1:e.style.cramped?m=u.sup3:m=u.sup2;var v=e.sizeMultiplier,y=ir(.5/u.ptPerEm/v),b=null;if(l){var x=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");if(s instanceof Yd||x){var w;b=ir(-((w=s.italic)!=null?w:0))}}var A;if(o&&l){h=Math.max(h,m,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var T=u.defaultRuleThickness,S=4*T;if(h-o.depth-(l.height-d)0&&(h+=O,d-=O)}var k=[{type:"elem",elem:l,shift:d,marginRight:y,marginLeft:b},{type:"elem",elem:o,shift:-h,marginRight:y}];A=Yi({positionType:"individualShift",children:k})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var E=[{type:"elem",elem:l,marginLeft:b,marginRight:y}];A=Yi({positionType:"shift",positionData:d,children:E})}else if(o)h=Math.max(h,m,o.depth+.25*u.xHeight),A=Yi({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:y}]});else throw new Error("supsub must have either sup or sub.");var _=VAe(s,"right")||"mord";return Wt([_],[s,Wt(["msupsub"],[A])],e)},mathmlBuilder(t,e){var r=!1,n,i;t.base&&t.base.type==="horizBrace"&&(i=!!t.sup,i===t.base.isOver&&(r=!0,n=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var a=[Ca(t.base,e)];t.sub&&a.push(Ca(t.sub,e)),t.sup&&a.push(Ca(t.sup,e));var s;if(r)s=n?"mover":"munder";else if(t.sub)if(t.sup){var u=t.base;u&&u.type==="op"&&u.limits&&e.style===In.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===In.DISPLAY||u.limits)?s="munderover":s="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===In.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===In.DISPLAY)?s="munder":s="msub"}else{var o=t.base;o&&o.type==="op"&&o.limits&&(e.style===In.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===In.DISPLAY)?s="mover":s="msup"}return new tr(s,a)}}),aC({type:"atom",htmlBuilder(t,e){return BAe(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new tr("mo",[up(t.text,t.mode)]);if(t.family==="bin"){var n=HAe(t,e);n==="bold-italic"&&r.setAttribute("mathvariant",n)}else t.family==="punct"?r.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&r.setAttribute("stretchy","false");return r}});var $5t={mi:"italic",mn:"normal",mtext:"normal"};aC({type:"mathord",htmlBuilder(t,e){return pZ(t,e,"mathord")},mathmlBuilder(t,e){var r=new tr("mi",[up(t.text,t.mode,e)]),n=HAe(t,e)||"italic";return n!==$5t[r.type]&&r.setAttribute("mathvariant",n),r}}),aC({type:"textord",htmlBuilder(t,e){return pZ(t,e,"textord")},mathmlBuilder(t,e){var r=up(t.text,t.mode,e),n=HAe(t,e)||"normal",i;return t.mode==="text"?i=new tr("mtext",[r]):/[0-9]/.test(t.text)?i=new tr("mn",[r]):t.text==="\\prime"?i=new tr("mo",[r]):i=new tr("mi",[r]),n!==$5t[i.type]&&i.setAttribute("mathvariant",n),i}});var lTe={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},cTe={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};aC({type:"spacing",htmlBuilder(t,e){if(cTe.hasOwnProperty(t.text)){var r=cTe[t.text].className||"";if(t.mode==="text"){var n=pZ(t,e,"textord");return n.classes.push(r),n}else return Wt(["mspace",r],[BAe(t.text,t.mode,e)],e)}else{if(lTe.hasOwnProperty(t.text))return Wt(["mspace",lTe[t.text]],[],e);throw new Zt('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(cTe.hasOwnProperty(t.text))r=new tr("mtext",[new Po(" ")]);else{if(lTe.hasOwnProperty(t.text))return new tr("mspace");throw new Zt('Unknown type of space "'+t.text+'"')}return r}});var F5t=()=>{var t=new tr("mtd",[]);return t.setAttribute("width","50%"),t};aC({type:"tag",mathmlBuilder(t,e){var r=new tr("mtable",[new tr("mtr",[F5t(),new tr("mtd",[x2(t.body,e)]),F5t(),new tr("mtd",[x2(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var z5t={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},U5t={"\\textbf":"textbf","\\textmd":"textmd"},wxn={"\\textit":"textit","\\textup":"textup"},V5t=(t,e)=>{var r=t.font;if(r){if(z5t[r])return e.withTextFontFamily(z5t[r]);if(U5t[r])return e.withTextFontWeight(U5t[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(wxn[r])};xr({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"text",mode:r.mode,body:Io(i),font:n}},htmlBuilder(t,e){var r=V5t(t,e),n=tl(t.body,r,!0);return Wt(["mord","text"],n,r)},mathmlBuilder(t,e){var r=V5t(t,e);return x2(t.body,r)}}),xr({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"underline",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=qi(t.body,e),n=q4("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Yi({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]});return Wt(["mord","underline"],[a],e)},mathmlBuilder(t,e){var r=new tr("mo",[new Po("‾")]);r.setAttribute("stretchy","true");var n=new tr("munder",[Ca(t.body,e),r]);return n.setAttribute("accentunder","true"),n}}),xr({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"vcenter",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=qi(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return Yi({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new tr("mpadded",[Ca(t.body,e)],["vcenter"]);return new tr("mrow",[r])}}),xr({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new Zt("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=Q5t(t),n=[],i=e.havingStyle(e.style.text()),a=0;at.body.replace(/ /g,t.star?"␣":" "),A2=G_t,G5t=`[ \r - ]`,Axn="\\\\[a-zA-Z@]+",Txn="\\\\[^\uD800-\uDFFF]",Sxn="("+Axn+")"+G5t+"*",Cxn=`\\\\( +-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function fbn(t){return"toText"in t}class H4{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),r=0;r{if(fbn(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var SAe={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},pbn={ex:!0,em:!0,mu:!0},A_t=function(e){return typeof e!="string"&&(e=e.unit),e in SAe||e in pbn||e==="ex"},Ss=function(e,r){var n;if(e.unit in SAe)n=SAe[e.unit]/r.fontMetrics().ptPerEm/r.sizeMultiplier;else if(e.unit==="mu")n=r.fontMetrics().cssEmPerMu;else{var i;if(r.style.isTight()?i=r.havingStyle(r.style.text()):i=r,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new Zt("Invalid unit: '"+e.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(e.number*n,r.maxSize)},ir=function(e){return+e.toFixed(4)+"em"},m2=function(e){return e.filter(r=>r).join(" ")},TAe=function(e){var r="";for(var n of Object.keys(e)){var i=e[n];i!==void 0&&(r+=V1n(n)+":"+i+";")}return r},S_t=function(e,r,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},r){r.style.isTight()&&this.classes.push("mtight");var i=r.getColor();i&&(this.style.color=i)}},T_t=function(e){var r=document.createElement(e);r.className=m2(this.classes),Object.assign(r.style,this.style);for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i/=\x00-\x1f]/,C_t=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+tu(m2(this.classes))+'"');var n=TAe(this.style);n&&(r+=' style="'+tu(n)+'"');for(var i of Object.keys(this.attributes)){if(gbn.test(i))throw new Zt("Invalid attribute name '"+i+"'");r+=" "+i+'="'+tu(this.attributes[i])+'"'}r+=">";for(var a=0;a",r};class W4{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,S_t.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return T_t.call(this,"span")}toMarkup(){return C_t.call(this,"span")}}let lZ=class{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,S_t.call(this,r,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return T_t.call(this,"a")}toMarkup(){return C_t.call(this,"a")}};class mbn{constructor(e,r,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=r,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");return e.src=this.src,e.alt=this.alt,e.className="mord",Object.assign(e.style,this.style),e}toMarkup(){var e=''+tu(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=ir(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=m2(this.classes)),Object.keys(this.style).length>0&&(r=r||document.createElement("span"),Object.assign(r.style,this.style)),r?(r.appendChild(e),r):e}toMarkup(){var e=!1,r="0&&(n+="margin-right:"+ir(this.italic)+";"),n+=TAe(this.style),n&&(e=!0,r+=' style="'+tu(n)+'"');var i=tu(this.text);return e?(r+=">",r+=i,r+="",r):i}}class u1{constructor(e,r){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=r||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"svg");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i':''}}class CAe{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"line");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);return r}toMarkup(){var e=" but got "+String(t)+".")}var xbn=t=>t instanceof W4||t instanceof lZ||t instanceof H4,A0={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},cZ={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},O_t={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function k_t(t,e){A0[t]=e}function OAe(t,e,r){if(!A0[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=A0[e][n];if(!i&&t[0]in O_t&&(n=O_t[t[0]].charCodeAt(0),i=A0[e][n]),!i&&r==="text"&&x_t(n)&&(i=A0[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var kAe={};function wbn(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!kAe[e]){var r=kAe[e]={cssEmPerMu:cZ.quad[e]/18};for(var n in cZ)cZ.hasOwnProperty(n)&&(r[n]=cZ[n][e])}return kAe[e]}var gs={math:{},text:{}};function J(t,e,r,n,i,a){gs[t][i]={font:e,group:r,replace:n},a&&n&&(gs[t][n]=gs[t][i])}var ue="math",$t="text",we="main",We="ams",ms="accent-token",kr="bin",Fu="close",Y4="inner",an="mathord",Mo="op-token",qd="open",F$="punct",je="rel",h1="spacing",Je="textord";J(ue,we,je,"≡","\\equiv",!0),J(ue,we,je,"≺","\\prec",!0),J(ue,we,je,"≻","\\succ",!0),J(ue,we,je,"∼","\\sim",!0),J(ue,we,je,"⊥","\\perp"),J(ue,we,je,"⪯","\\preceq",!0),J(ue,we,je,"⪰","\\succeq",!0),J(ue,we,je,"≃","\\simeq",!0),J(ue,we,je,"∣","\\mid",!0),J(ue,we,je,"≪","\\ll",!0),J(ue,we,je,"≫","\\gg",!0),J(ue,we,je,"≍","\\asymp",!0),J(ue,we,je,"∥","\\parallel"),J(ue,we,je,"⋈","\\bowtie",!0),J(ue,we,je,"⌣","\\smile",!0),J(ue,we,je,"⊑","\\sqsubseteq",!0),J(ue,we,je,"⊒","\\sqsupseteq",!0),J(ue,we,je,"≐","\\doteq",!0),J(ue,we,je,"⌢","\\frown",!0),J(ue,we,je,"∋","\\ni",!0),J(ue,we,je,"∝","\\propto",!0),J(ue,we,je,"⊢","\\vdash",!0),J(ue,we,je,"⊣","\\dashv",!0),J(ue,we,je,"∋","\\owns"),J(ue,we,F$,".","\\ldotp"),J(ue,we,F$,"⋅","\\cdotp"),J(ue,we,F$,"⋅","·"),J($t,we,Je,"⋅","·"),J(ue,we,Je,"#","\\#"),J($t,we,Je,"#","\\#"),J(ue,we,Je,"&","\\&"),J($t,we,Je,"&","\\&"),J(ue,we,Je,"ℵ","\\aleph",!0),J(ue,we,Je,"∀","\\forall",!0),J(ue,we,Je,"ℏ","\\hbar",!0),J(ue,we,Je,"∃","\\exists",!0),J(ue,we,Je,"∇","\\nabla",!0),J(ue,we,Je,"♭","\\flat",!0),J(ue,we,Je,"ℓ","\\ell",!0),J(ue,we,Je,"♮","\\natural",!0),J(ue,we,Je,"♣","\\clubsuit",!0),J(ue,we,Je,"℘","\\wp",!0),J(ue,we,Je,"♯","\\sharp",!0),J(ue,we,Je,"♢","\\diamondsuit",!0),J(ue,we,Je,"ℜ","\\Re",!0),J(ue,we,Je,"♡","\\heartsuit",!0),J(ue,we,Je,"ℑ","\\Im",!0),J(ue,we,Je,"♠","\\spadesuit",!0),J(ue,we,Je,"§","\\S",!0),J($t,we,Je,"§","\\S"),J(ue,we,Je,"¶","\\P",!0),J($t,we,Je,"¶","\\P"),J(ue,we,Je,"†","\\dag"),J($t,we,Je,"†","\\dag"),J($t,we,Je,"†","\\textdagger"),J(ue,we,Je,"‡","\\ddag"),J($t,we,Je,"‡","\\ddag"),J($t,we,Je,"‡","\\textdaggerdbl"),J(ue,we,Fu,"⎱","\\rmoustache",!0),J(ue,we,qd,"⎰","\\lmoustache",!0),J(ue,we,Fu,"⟯","\\rgroup",!0),J(ue,we,qd,"⟮","\\lgroup",!0),J(ue,we,kr,"∓","\\mp",!0),J(ue,we,kr,"⊖","\\ominus",!0),J(ue,we,kr,"⊎","\\uplus",!0),J(ue,we,kr,"⊓","\\sqcap",!0),J(ue,we,kr,"∗","\\ast"),J(ue,we,kr,"⊔","\\sqcup",!0),J(ue,we,kr,"◯","\\bigcirc",!0),J(ue,we,kr,"∙","\\bullet",!0),J(ue,we,kr,"‡","\\ddagger"),J(ue,we,kr,"≀","\\wr",!0),J(ue,we,kr,"⨿","\\amalg"),J(ue,we,kr,"&","\\And"),J(ue,we,je,"⟵","\\longleftarrow",!0),J(ue,we,je,"⇐","\\Leftarrow",!0),J(ue,we,je,"⟸","\\Longleftarrow",!0),J(ue,we,je,"⟶","\\longrightarrow",!0),J(ue,we,je,"⇒","\\Rightarrow",!0),J(ue,we,je,"⟹","\\Longrightarrow",!0),J(ue,we,je,"↔","\\leftrightarrow",!0),J(ue,we,je,"⟷","\\longleftrightarrow",!0),J(ue,we,je,"⇔","\\Leftrightarrow",!0),J(ue,we,je,"⟺","\\Longleftrightarrow",!0),J(ue,we,je,"↦","\\mapsto",!0),J(ue,we,je,"⟼","\\longmapsto",!0),J(ue,we,je,"↗","\\nearrow",!0),J(ue,we,je,"↩","\\hookleftarrow",!0),J(ue,we,je,"↪","\\hookrightarrow",!0),J(ue,we,je,"↘","\\searrow",!0),J(ue,we,je,"↼","\\leftharpoonup",!0),J(ue,we,je,"⇀","\\rightharpoonup",!0),J(ue,we,je,"↙","\\swarrow",!0),J(ue,we,je,"↽","\\leftharpoondown",!0),J(ue,we,je,"⇁","\\rightharpoondown",!0),J(ue,we,je,"↖","\\nwarrow",!0),J(ue,we,je,"⇌","\\rightleftharpoons",!0),J(ue,We,je,"≮","\\nless",!0),J(ue,We,je,"","\\@nleqslant"),J(ue,We,je,"","\\@nleqq"),J(ue,We,je,"⪇","\\lneq",!0),J(ue,We,je,"≨","\\lneqq",!0),J(ue,We,je,"","\\@lvertneqq"),J(ue,We,je,"⋦","\\lnsim",!0),J(ue,We,je,"⪉","\\lnapprox",!0),J(ue,We,je,"⊀","\\nprec",!0),J(ue,We,je,"⋠","\\npreceq",!0),J(ue,We,je,"⋨","\\precnsim",!0),J(ue,We,je,"⪹","\\precnapprox",!0),J(ue,We,je,"≁","\\nsim",!0),J(ue,We,je,"","\\@nshortmid"),J(ue,We,je,"∤","\\nmid",!0),J(ue,We,je,"⊬","\\nvdash",!0),J(ue,We,je,"⊭","\\nvDash",!0),J(ue,We,je,"⋪","\\ntriangleleft"),J(ue,We,je,"⋬","\\ntrianglelefteq",!0),J(ue,We,je,"⊊","\\subsetneq",!0),J(ue,We,je,"","\\@varsubsetneq"),J(ue,We,je,"⫋","\\subsetneqq",!0),J(ue,We,je,"","\\@varsubsetneqq"),J(ue,We,je,"≯","\\ngtr",!0),J(ue,We,je,"","\\@ngeqslant"),J(ue,We,je,"","\\@ngeqq"),J(ue,We,je,"⪈","\\gneq",!0),J(ue,We,je,"≩","\\gneqq",!0),J(ue,We,je,"","\\@gvertneqq"),J(ue,We,je,"⋧","\\gnsim",!0),J(ue,We,je,"⪊","\\gnapprox",!0),J(ue,We,je,"⊁","\\nsucc",!0),J(ue,We,je,"⋡","\\nsucceq",!0),J(ue,We,je,"⋩","\\succnsim",!0),J(ue,We,je,"⪺","\\succnapprox",!0),J(ue,We,je,"≆","\\ncong",!0),J(ue,We,je,"","\\@nshortparallel"),J(ue,We,je,"∦","\\nparallel",!0),J(ue,We,je,"⊯","\\nVDash",!0),J(ue,We,je,"⋫","\\ntriangleright"),J(ue,We,je,"⋭","\\ntrianglerighteq",!0),J(ue,We,je,"","\\@nsupseteqq"),J(ue,We,je,"⊋","\\supsetneq",!0),J(ue,We,je,"","\\@varsupsetneq"),J(ue,We,je,"⫌","\\supsetneqq",!0),J(ue,We,je,"","\\@varsupsetneqq"),J(ue,We,je,"⊮","\\nVdash",!0),J(ue,We,je,"⪵","\\precneqq",!0),J(ue,We,je,"⪶","\\succneqq",!0),J(ue,We,je,"","\\@nsubseteqq"),J(ue,We,kr,"⊴","\\unlhd"),J(ue,We,kr,"⊵","\\unrhd"),J(ue,We,je,"↚","\\nleftarrow",!0),J(ue,We,je,"↛","\\nrightarrow",!0),J(ue,We,je,"⇍","\\nLeftarrow",!0),J(ue,We,je,"⇏","\\nRightarrow",!0),J(ue,We,je,"↮","\\nleftrightarrow",!0),J(ue,We,je,"⇎","\\nLeftrightarrow",!0),J(ue,We,je,"△","\\vartriangle"),J(ue,We,Je,"ℏ","\\hslash"),J(ue,We,Je,"▽","\\triangledown"),J(ue,We,Je,"◊","\\lozenge"),J(ue,We,Je,"Ⓢ","\\circledS"),J(ue,We,Je,"®","\\circledR"),J($t,We,Je,"®","\\circledR"),J(ue,We,Je,"∡","\\measuredangle",!0),J(ue,We,Je,"∄","\\nexists"),J(ue,We,Je,"℧","\\mho"),J(ue,We,Je,"Ⅎ","\\Finv",!0),J(ue,We,Je,"⅁","\\Game",!0),J(ue,We,Je,"‵","\\backprime"),J(ue,We,Je,"▲","\\blacktriangle"),J(ue,We,Je,"▼","\\blacktriangledown"),J(ue,We,Je,"■","\\blacksquare"),J(ue,We,Je,"⧫","\\blacklozenge"),J(ue,We,Je,"★","\\bigstar"),J(ue,We,Je,"∢","\\sphericalangle",!0),J(ue,We,Je,"∁","\\complement",!0),J(ue,We,Je,"ð","\\eth",!0),J($t,we,Je,"ð","ð"),J(ue,We,Je,"╱","\\diagup"),J(ue,We,Je,"╲","\\diagdown"),J(ue,We,Je,"□","\\square"),J(ue,We,Je,"□","\\Box"),J(ue,We,Je,"◊","\\Diamond"),J(ue,We,Je,"¥","\\yen",!0),J($t,We,Je,"¥","\\yen",!0),J(ue,We,Je,"✓","\\checkmark",!0),J($t,We,Je,"✓","\\checkmark"),J(ue,We,Je,"ℶ","\\beth",!0),J(ue,We,Je,"ℸ","\\daleth",!0),J(ue,We,Je,"ℷ","\\gimel",!0),J(ue,We,Je,"ϝ","\\digamma",!0),J(ue,We,Je,"ϰ","\\varkappa"),J(ue,We,qd,"┌","\\@ulcorner",!0),J(ue,We,Fu,"┐","\\@urcorner",!0),J(ue,We,qd,"└","\\@llcorner",!0),J(ue,We,Fu,"┘","\\@lrcorner",!0),J(ue,We,je,"≦","\\leqq",!0),J(ue,We,je,"⩽","\\leqslant",!0),J(ue,We,je,"⪕","\\eqslantless",!0),J(ue,We,je,"≲","\\lesssim",!0),J(ue,We,je,"⪅","\\lessapprox",!0),J(ue,We,je,"≊","\\approxeq",!0),J(ue,We,kr,"⋖","\\lessdot"),J(ue,We,je,"⋘","\\lll",!0),J(ue,We,je,"≶","\\lessgtr",!0),J(ue,We,je,"⋚","\\lesseqgtr",!0),J(ue,We,je,"⪋","\\lesseqqgtr",!0),J(ue,We,je,"≑","\\doteqdot"),J(ue,We,je,"≓","\\risingdotseq",!0),J(ue,We,je,"≒","\\fallingdotseq",!0),J(ue,We,je,"∽","\\backsim",!0),J(ue,We,je,"⋍","\\backsimeq",!0),J(ue,We,je,"⫅","\\subseteqq",!0),J(ue,We,je,"⋐","\\Subset",!0),J(ue,We,je,"⊏","\\sqsubset",!0),J(ue,We,je,"≼","\\preccurlyeq",!0),J(ue,We,je,"⋞","\\curlyeqprec",!0),J(ue,We,je,"≾","\\precsim",!0),J(ue,We,je,"⪷","\\precapprox",!0),J(ue,We,je,"⊲","\\vartriangleleft"),J(ue,We,je,"⊴","\\trianglelefteq"),J(ue,We,je,"⊨","\\vDash",!0),J(ue,We,je,"⊪","\\Vvdash",!0),J(ue,We,je,"⌣","\\smallsmile"),J(ue,We,je,"⌢","\\smallfrown"),J(ue,We,je,"≏","\\bumpeq",!0),J(ue,We,je,"≎","\\Bumpeq",!0),J(ue,We,je,"≧","\\geqq",!0),J(ue,We,je,"⩾","\\geqslant",!0),J(ue,We,je,"⪖","\\eqslantgtr",!0),J(ue,We,je,"≳","\\gtrsim",!0),J(ue,We,je,"⪆","\\gtrapprox",!0),J(ue,We,kr,"⋗","\\gtrdot"),J(ue,We,je,"⋙","\\ggg",!0),J(ue,We,je,"≷","\\gtrless",!0),J(ue,We,je,"⋛","\\gtreqless",!0),J(ue,We,je,"⪌","\\gtreqqless",!0),J(ue,We,je,"≖","\\eqcirc",!0),J(ue,We,je,"≗","\\circeq",!0),J(ue,We,je,"≜","\\triangleq",!0),J(ue,We,je,"∼","\\thicksim"),J(ue,We,je,"≈","\\thickapprox"),J(ue,We,je,"⫆","\\supseteqq",!0),J(ue,We,je,"⋑","\\Supset",!0),J(ue,We,je,"⊐","\\sqsupset",!0),J(ue,We,je,"≽","\\succcurlyeq",!0),J(ue,We,je,"⋟","\\curlyeqsucc",!0),J(ue,We,je,"≿","\\succsim",!0),J(ue,We,je,"⪸","\\succapprox",!0),J(ue,We,je,"⊳","\\vartriangleright"),J(ue,We,je,"⊵","\\trianglerighteq"),J(ue,We,je,"⊩","\\Vdash",!0),J(ue,We,je,"∣","\\shortmid"),J(ue,We,je,"∥","\\shortparallel"),J(ue,We,je,"≬","\\between",!0),J(ue,We,je,"⋔","\\pitchfork",!0),J(ue,We,je,"∝","\\varpropto"),J(ue,We,je,"◀","\\blacktriangleleft"),J(ue,We,je,"∴","\\therefore",!0),J(ue,We,je,"∍","\\backepsilon"),J(ue,We,je,"▶","\\blacktriangleright"),J(ue,We,je,"∵","\\because",!0),J(ue,We,je,"⋘","\\llless"),J(ue,We,je,"⋙","\\gggtr"),J(ue,We,kr,"⊲","\\lhd"),J(ue,We,kr,"⊳","\\rhd"),J(ue,We,je,"≂","\\eqsim",!0),J(ue,we,je,"⋈","\\Join"),J(ue,We,je,"≑","\\Doteq",!0),J(ue,We,kr,"∔","\\dotplus",!0),J(ue,We,kr,"∖","\\smallsetminus"),J(ue,We,kr,"⋒","\\Cap",!0),J(ue,We,kr,"⋓","\\Cup",!0),J(ue,We,kr,"⩞","\\doublebarwedge",!0),J(ue,We,kr,"⊟","\\boxminus",!0),J(ue,We,kr,"⊞","\\boxplus",!0),J(ue,We,kr,"⋇","\\divideontimes",!0),J(ue,We,kr,"⋉","\\ltimes",!0),J(ue,We,kr,"⋊","\\rtimes",!0),J(ue,We,kr,"⋋","\\leftthreetimes",!0),J(ue,We,kr,"⋌","\\rightthreetimes",!0),J(ue,We,kr,"⋏","\\curlywedge",!0),J(ue,We,kr,"⋎","\\curlyvee",!0),J(ue,We,kr,"⊝","\\circleddash",!0),J(ue,We,kr,"⊛","\\circledast",!0),J(ue,We,kr,"⋅","\\centerdot"),J(ue,We,kr,"⊺","\\intercal",!0),J(ue,We,kr,"⋒","\\doublecap"),J(ue,We,kr,"⋓","\\doublecup"),J(ue,We,kr,"⊠","\\boxtimes",!0),J(ue,We,je,"⇢","\\dashrightarrow",!0),J(ue,We,je,"⇠","\\dashleftarrow",!0),J(ue,We,je,"⇇","\\leftleftarrows",!0),J(ue,We,je,"⇆","\\leftrightarrows",!0),J(ue,We,je,"⇚","\\Lleftarrow",!0),J(ue,We,je,"↞","\\twoheadleftarrow",!0),J(ue,We,je,"↢","\\leftarrowtail",!0),J(ue,We,je,"↫","\\looparrowleft",!0),J(ue,We,je,"⇋","\\leftrightharpoons",!0),J(ue,We,je,"↶","\\curvearrowleft",!0),J(ue,We,je,"↺","\\circlearrowleft",!0),J(ue,We,je,"↰","\\Lsh",!0),J(ue,We,je,"⇈","\\upuparrows",!0),J(ue,We,je,"↿","\\upharpoonleft",!0),J(ue,We,je,"⇃","\\downharpoonleft",!0),J(ue,we,je,"⊶","\\origof",!0),J(ue,we,je,"⊷","\\imageof",!0),J(ue,We,je,"⊸","\\multimap",!0),J(ue,We,je,"↭","\\leftrightsquigarrow",!0),J(ue,We,je,"⇉","\\rightrightarrows",!0),J(ue,We,je,"⇄","\\rightleftarrows",!0),J(ue,We,je,"↠","\\twoheadrightarrow",!0),J(ue,We,je,"↣","\\rightarrowtail",!0),J(ue,We,je,"↬","\\looparrowright",!0),J(ue,We,je,"↷","\\curvearrowright",!0),J(ue,We,je,"↻","\\circlearrowright",!0),J(ue,We,je,"↱","\\Rsh",!0),J(ue,We,je,"⇊","\\downdownarrows",!0),J(ue,We,je,"↾","\\upharpoonright",!0),J(ue,We,je,"⇂","\\downharpoonright",!0),J(ue,We,je,"⇝","\\rightsquigarrow",!0),J(ue,We,je,"⇝","\\leadsto"),J(ue,We,je,"⇛","\\Rrightarrow",!0),J(ue,We,je,"↾","\\restriction"),J(ue,we,Je,"‘","`"),J(ue,we,Je,"$","\\$"),J($t,we,Je,"$","\\$"),J($t,we,Je,"$","\\textdollar"),J(ue,we,Je,"%","\\%"),J($t,we,Je,"%","\\%"),J(ue,we,Je,"_","\\_"),J($t,we,Je,"_","\\_"),J($t,we,Je,"_","\\textunderscore"),J(ue,we,Je,"∠","\\angle",!0),J(ue,we,Je,"∞","\\infty",!0),J(ue,we,Je,"′","\\prime"),J(ue,we,Je,"△","\\triangle"),J(ue,we,Je,"Γ","\\Gamma",!0),J(ue,we,Je,"Δ","\\Delta",!0),J(ue,we,Je,"Θ","\\Theta",!0),J(ue,we,Je,"Λ","\\Lambda",!0),J(ue,we,Je,"Ξ","\\Xi",!0),J(ue,we,Je,"Π","\\Pi",!0),J(ue,we,Je,"Σ","\\Sigma",!0),J(ue,we,Je,"Υ","\\Upsilon",!0),J(ue,we,Je,"Φ","\\Phi",!0),J(ue,we,Je,"Ψ","\\Psi",!0),J(ue,we,Je,"Ω","\\Omega",!0),J(ue,we,Je,"A","Α"),J(ue,we,Je,"B","Β"),J(ue,we,Je,"E","Ε"),J(ue,we,Je,"Z","Ζ"),J(ue,we,Je,"H","Η"),J(ue,we,Je,"I","Ι"),J(ue,we,Je,"K","Κ"),J(ue,we,Je,"M","Μ"),J(ue,we,Je,"N","Ν"),J(ue,we,Je,"O","Ο"),J(ue,we,Je,"P","Ρ"),J(ue,we,Je,"T","Τ"),J(ue,we,Je,"X","Χ"),J(ue,we,Je,"¬","\\neg",!0),J(ue,we,Je,"¬","\\lnot"),J(ue,we,Je,"⊤","\\top"),J(ue,we,Je,"⊥","\\bot"),J(ue,we,Je,"∅","\\emptyset"),J(ue,We,Je,"∅","\\varnothing"),J(ue,we,an,"α","\\alpha",!0),J(ue,we,an,"β","\\beta",!0),J(ue,we,an,"γ","\\gamma",!0),J(ue,we,an,"δ","\\delta",!0),J(ue,we,an,"ϵ","\\epsilon",!0),J(ue,we,an,"ζ","\\zeta",!0),J(ue,we,an,"η","\\eta",!0),J(ue,we,an,"θ","\\theta",!0),J(ue,we,an,"ι","\\iota",!0),J(ue,we,an,"κ","\\kappa",!0),J(ue,we,an,"λ","\\lambda",!0),J(ue,we,an,"μ","\\mu",!0),J(ue,we,an,"ν","\\nu",!0),J(ue,we,an,"ξ","\\xi",!0),J(ue,we,an,"ο","\\omicron",!0),J(ue,we,an,"π","\\pi",!0),J(ue,we,an,"ρ","\\rho",!0),J(ue,we,an,"σ","\\sigma",!0),J(ue,we,an,"τ","\\tau",!0),J(ue,we,an,"υ","\\upsilon",!0),J(ue,we,an,"ϕ","\\phi",!0),J(ue,we,an,"χ","\\chi",!0),J(ue,we,an,"ψ","\\psi",!0),J(ue,we,an,"ω","\\omega",!0),J(ue,we,an,"ε","\\varepsilon",!0),J(ue,we,an,"ϑ","\\vartheta",!0),J(ue,we,an,"ϖ","\\varpi",!0),J(ue,we,an,"ϱ","\\varrho",!0),J(ue,we,an,"ς","\\varsigma",!0),J(ue,we,an,"φ","\\varphi",!0),J(ue,we,kr,"∗","*",!0),J(ue,we,kr,"+","+"),J(ue,we,kr,"−","-",!0),J(ue,we,kr,"⋅","\\cdot",!0),J(ue,we,kr,"∘","\\circ",!0),J(ue,we,kr,"÷","\\div",!0),J(ue,we,kr,"±","\\pm",!0),J(ue,we,kr,"×","\\times",!0),J(ue,we,kr,"∩","\\cap",!0),J(ue,we,kr,"∪","\\cup",!0),J(ue,we,kr,"∖","\\setminus",!0),J(ue,we,kr,"∧","\\land"),J(ue,we,kr,"∨","\\lor"),J(ue,we,kr,"∧","\\wedge",!0),J(ue,we,kr,"∨","\\vee",!0),J(ue,we,Je,"√","\\surd"),J(ue,we,qd,"⟨","\\langle",!0),J(ue,we,qd,"∣","\\lvert"),J(ue,we,qd,"∥","\\lVert"),J(ue,we,Fu,"?","?"),J(ue,we,Fu,"!","!"),J(ue,we,Fu,"⟩","\\rangle",!0),J(ue,we,Fu,"∣","\\rvert"),J(ue,we,Fu,"∥","\\rVert"),J(ue,we,je,"=","="),J(ue,we,je,":",":"),J(ue,we,je,"≈","\\approx",!0),J(ue,we,je,"≅","\\cong",!0),J(ue,we,je,"≥","\\ge"),J(ue,we,je,"≥","\\geq",!0),J(ue,we,je,"←","\\gets"),J(ue,we,je,">","\\gt",!0),J(ue,we,je,"∈","\\in",!0),J(ue,we,je,"","\\@not"),J(ue,we,je,"⊂","\\subset",!0),J(ue,we,je,"⊃","\\supset",!0),J(ue,we,je,"⊆","\\subseteq",!0),J(ue,we,je,"⊇","\\supseteq",!0),J(ue,We,je,"⊈","\\nsubseteq",!0),J(ue,We,je,"⊉","\\nsupseteq",!0),J(ue,we,je,"⊨","\\models"),J(ue,we,je,"←","\\leftarrow",!0),J(ue,we,je,"≤","\\le"),J(ue,we,je,"≤","\\leq",!0),J(ue,we,je,"<","\\lt",!0),J(ue,we,je,"→","\\rightarrow",!0),J(ue,we,je,"→","\\to"),J(ue,We,je,"≱","\\ngeq",!0),J(ue,We,je,"≰","\\nleq",!0),J(ue,we,h1," ","\\ "),J(ue,we,h1," ","\\space"),J(ue,we,h1," ","\\nobreakspace"),J($t,we,h1," ","\\ "),J($t,we,h1," "," "),J($t,we,h1," ","\\space"),J($t,we,h1," ","\\nobreakspace"),J(ue,we,h1,"","\\nobreak"),J(ue,we,h1,"","\\allowbreak"),J(ue,we,F$,",",","),J(ue,we,F$,";",";"),J(ue,We,kr,"⊼","\\barwedge",!0),J(ue,We,kr,"⊻","\\veebar",!0),J(ue,we,kr,"⊙","\\odot",!0),J(ue,we,kr,"⊕","\\oplus",!0),J(ue,we,kr,"⊗","\\otimes",!0),J(ue,we,Je,"∂","\\partial",!0),J(ue,we,kr,"⊘","\\oslash",!0),J(ue,We,kr,"⊚","\\circledcirc",!0),J(ue,We,kr,"⊡","\\boxdot",!0),J(ue,we,kr,"△","\\bigtriangleup"),J(ue,we,kr,"▽","\\bigtriangledown"),J(ue,we,kr,"†","\\dagger"),J(ue,we,kr,"⋄","\\diamond"),J(ue,we,kr,"⋆","\\star"),J(ue,we,kr,"◃","\\triangleleft"),J(ue,we,kr,"▹","\\triangleright"),J(ue,we,qd,"{","\\{"),J($t,we,Je,"{","\\{"),J($t,we,Je,"{","\\textbraceleft"),J(ue,we,Fu,"}","\\}"),J($t,we,Je,"}","\\}"),J($t,we,Je,"}","\\textbraceright"),J(ue,we,qd,"{","\\lbrace"),J(ue,we,Fu,"}","\\rbrace"),J(ue,we,qd,"[","\\lbrack",!0),J($t,we,Je,"[","\\lbrack",!0),J(ue,we,Fu,"]","\\rbrack",!0),J($t,we,Je,"]","\\rbrack",!0),J(ue,we,qd,"(","\\lparen",!0),J(ue,we,Fu,")","\\rparen",!0),J($t,we,Je,"<","\\textless",!0),J($t,we,Je,">","\\textgreater",!0),J(ue,we,qd,"⌊","\\lfloor",!0),J(ue,we,Fu,"⌋","\\rfloor",!0),J(ue,we,qd,"⌈","\\lceil",!0),J(ue,we,Fu,"⌉","\\rceil",!0),J(ue,we,Je,"\\","\\backslash"),J(ue,we,Je,"∣","|"),J(ue,we,Je,"∣","\\vert"),J($t,we,Je,"|","\\textbar",!0),J(ue,we,Je,"∥","\\|"),J(ue,we,Je,"∥","\\Vert"),J($t,we,Je,"∥","\\textbardbl"),J($t,we,Je,"~","\\textasciitilde"),J($t,we,Je,"\\","\\textbackslash"),J($t,we,Je,"^","\\textasciicircum"),J(ue,we,je,"↑","\\uparrow",!0),J(ue,we,je,"⇑","\\Uparrow",!0),J(ue,we,je,"↓","\\downarrow",!0),J(ue,we,je,"⇓","\\Downarrow",!0),J(ue,we,je,"↕","\\updownarrow",!0),J(ue,we,je,"⇕","\\Updownarrow",!0),J(ue,we,Mo,"∐","\\coprod"),J(ue,we,Mo,"⋁","\\bigvee"),J(ue,we,Mo,"⋀","\\bigwedge"),J(ue,we,Mo,"⨄","\\biguplus"),J(ue,we,Mo,"⋂","\\bigcap"),J(ue,we,Mo,"⋃","\\bigcup"),J(ue,we,Mo,"∫","\\int"),J(ue,we,Mo,"∫","\\intop"),J(ue,we,Mo,"∬","\\iint"),J(ue,we,Mo,"∭","\\iiint"),J(ue,we,Mo,"∏","\\prod"),J(ue,we,Mo,"∑","\\sum"),J(ue,we,Mo,"⨂","\\bigotimes"),J(ue,we,Mo,"⨁","\\bigoplus"),J(ue,we,Mo,"⨀","\\bigodot"),J(ue,we,Mo,"∮","\\oint"),J(ue,we,Mo,"∯","\\oiint"),J(ue,we,Mo,"∰","\\oiiint"),J(ue,we,Mo,"⨆","\\bigsqcup"),J(ue,we,Mo,"∫","\\smallint"),J($t,we,Y4,"…","\\textellipsis"),J(ue,we,Y4,"…","\\mathellipsis"),J($t,we,Y4,"…","\\ldots",!0),J(ue,we,Y4,"…","\\ldots",!0),J(ue,we,Y4,"⋯","\\@cdots",!0),J(ue,we,Y4,"⋱","\\ddots",!0),J(ue,we,Je,"⋮","\\varvdots"),J($t,we,Je,"⋮","\\varvdots"),J(ue,we,ms,"ˊ","\\acute"),J(ue,we,ms,"ˋ","\\grave"),J(ue,we,ms,"¨","\\ddot"),J(ue,we,ms,"~","\\tilde"),J(ue,we,ms,"ˉ","\\bar"),J(ue,we,ms,"˘","\\breve"),J(ue,we,ms,"ˇ","\\check"),J(ue,we,ms,"^","\\hat"),J(ue,we,ms,"⃗","\\vec"),J(ue,we,ms,"˙","\\dot"),J(ue,we,ms,"˚","\\mathring"),J(ue,we,an,"","\\@imath"),J(ue,we,an,"","\\@jmath"),J(ue,we,Je,"ı","ı"),J(ue,we,Je,"ȷ","ȷ"),J($t,we,Je,"ı","\\i",!0),J($t,we,Je,"ȷ","\\j",!0),J($t,we,Je,"ß","\\ss",!0),J($t,we,Je,"æ","\\ae",!0),J($t,we,Je,"œ","\\oe",!0),J($t,we,Je,"ø","\\o",!0),J($t,we,Je,"Æ","\\AE",!0),J($t,we,Je,"Œ","\\OE",!0),J($t,we,Je,"Ø","\\O",!0),J($t,we,ms,"ˊ","\\'"),J($t,we,ms,"ˋ","\\`"),J($t,we,ms,"ˆ","\\^"),J($t,we,ms,"˜","\\~"),J($t,we,ms,"ˉ","\\="),J($t,we,ms,"˘","\\u"),J($t,we,ms,"˙","\\."),J($t,we,ms,"¸","\\c"),J($t,we,ms,"˚","\\r"),J($t,we,ms,"ˇ","\\v"),J($t,we,ms,"¨",'\\"'),J($t,we,ms,"˝","\\H"),J($t,we,ms,"◯","\\textcircled");var E_t={"--":!0,"---":!0,"``":!0,"''":!0};J($t,we,Je,"–","--",!0),J($t,we,Je,"–","\\textendash"),J($t,we,Je,"—","---",!0),J($t,we,Je,"—","\\textemdash"),J($t,we,Je,"‘","`",!0),J($t,we,Je,"‘","\\textquoteleft"),J($t,we,Je,"’","'",!0),J($t,we,Je,"’","\\textquoteright"),J($t,we,Je,"“","``",!0),J($t,we,Je,"“","\\textquotedblleft"),J($t,we,Je,"”","''",!0),J($t,we,Je,"”","\\textquotedblright"),J(ue,we,Je,"°","\\degree",!0),J($t,we,Je,"°","\\degree"),J($t,we,Je,"°","\\textdegree",!0),J(ue,we,Je,"£","\\pounds"),J(ue,we,Je,"£","\\mathsterling",!0),J($t,we,Je,"£","\\pounds"),J($t,we,Je,"£","\\textsterling",!0),J(ue,We,Je,"✠","\\maltese"),J($t,We,Je,"✠","\\maltese");for(var __t='0123456789/@."',EAe=0;EAe<__t.length;EAe++){var R_t=__t.charAt(EAe);J(ue,we,Je,R_t,R_t)}for(var D_t='0123456789!@*()-=+";:?/.,',_Ae=0;_Ae{var e=t.charCodeAt(0),r=t.charCodeAt(1),n=(e-55296)*1024+(r-56320)+65536;if(119808<=n&&n<120484){var i=Math.floor((n-119808)/26);return F_t[i]}else if(120782<=n&&n<=120831){var a=Math.floor((n-120782)/10);return Sbn[a]}else{if(n===120485||n===120486)return F_t[0];if(120486{if(m2(t.classes)!==m2(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize||t.italic!==0&&t.hasClass("mathnormal"))return!1;if(t.classes.length===1){var r=t.classes[0];if(r==="mbin"||r==="mord")return!1}for(var n of Object.keys(t.style))if(t.style[n]!==e.style[n])return!1;for(var i of Object.keys(e.style))if(t.style[i]!==e.style[i])return!1;return!0},z_t=t=>{for(var e=0;er&&(r=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}e.height=r,e.depth=n,e.maxFontSize=i},Wt=function(e,r,n,i){var a=new W4(e,r,n,i);return $Ae(a),a},b2=(t,e,r,n)=>new W4(t,e,r,n),q4=function(e,r,n){var i=Wt([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=ir(i.height),i.maxFontSize=1,i},kbn=function(e,r,n,i){var a=new lZ(e,r,n,i);return $Ae(a),a},d1=function(e){var r=new H4(e);return $Ae(r),r},j4=function(e,r){return e instanceof H4?Wt([],[e],r):e},Ebn=function(e){if(e.positionType==="individualShift"){for(var r=e.children,n=[r[0]],i=-r[0].shift-r[0].elem.depth,a=i,s=1;s{var r=Wt(["mspace"],[],e),n=Ss(t,e);return r.style.marginRight=ir(n),r},gZ=(t,e,r)=>{var n,i;switch(t){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=t}return e==="textbf"&&r==="textit"?i="BoldItalic":e==="textbf"?i="Bold":r==="textit"?i="Italic":i="Regular",n+"-"+i},FAe={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},V_t={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Q_t=function(e,r){var[n,i,a]=V_t[e],s=new v2(n),o=new u1([s],{width:ir(i),height:ir(a),style:"width:"+ir(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=b2(["overlay"],[o],r);return l.height=a,l.style.height=ir(a),l.style.width=ir(i),l},Ts={number:3,unit:"mu"},iC={number:4,unit:"mu"},f1={number:5,unit:"mu"},_bn={mord:{mop:Ts,mbin:iC,mrel:f1,minner:Ts},mop:{mord:Ts,mop:Ts,mrel:f1,minner:Ts},mbin:{mord:iC,mop:iC,mopen:iC,minner:iC},mrel:{mord:f1,mop:f1,mopen:f1,minner:f1},mopen:{},mclose:{mop:Ts,mbin:iC,mrel:f1,minner:Ts},mpunct:{mord:Ts,mop:Ts,mrel:f1,mopen:Ts,mclose:Ts,mpunct:Ts,minner:Ts},minner:{mord:Ts,mop:Ts,mbin:iC,mrel:f1,mopen:Ts,mpunct:Ts,minner:Ts}},Rbn={mord:{mop:Ts},mop:{mord:Ts,mop:Ts},mbin:{},mrel:{},mopen:{},mclose:{mop:Ts},mpunct:{},minner:{mop:Ts}},G_t={},mZ={},vZ={};function xr(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},l=0;l{var v=m.classes[0],y=g.classes[0];v==="mbin"&&Lbn.has(y)?m.classes[0]="mord":y==="mbin"&&Dbn.has(v)&&(g.classes[0]="mord")},{node:d},f,p),zAe(a,(g,m)=>{var v,y,b=VAe(m),x=VAe(g),w=b&&x?g.hasClass("mtight")?(v=Rbn[b])==null?void 0:v[x]:(y=_bn[b])==null?void 0:y[x]:null;if(w)return U_t(w,u)},{node:d},f,p),a},zAe=function(e,r,n,i,a){i&&e.push(i);for(var s=0;sf=>{e.splice(d+1,0,f),s++})(s)}i&&e.pop()},H_t=function(e){return e instanceof H4||e instanceof lZ||e instanceof W4&&e.hasClass("enclosing")?e:null},UAe=function(e,r){var n=H_t(e);if(n){var i=n.children;if(i.length){if(r==="right")return UAe(i[i.length-1],"right");if(r==="left")return UAe(i[0],"left")}}return e},VAe=function(e,r){if(!e)return null;r&&(e=UAe(e,r));var n=e.classes[0];return Ibn[n]||null},z$=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Wt(r.concat(n))},qi=function(e,r,n){if(!e)return Wt();if(mZ[e.type]){var i=mZ[e.type](e,r);if(n&&r.size!==n.size){i=Wt(r.sizingClasses(n),[i],r);var a=r.sizeMultiplier/n.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new Zt("Got group of unknown type: '"+e.type+"'")};function bZ(t,e){var r=Wt(["base"],t,e),n=Wt(["strut"]);return n.style.height=ir(r.height+r.depth),r.depth&&(n.style.verticalAlign=ir(-r.depth)),r.children.unshift(n),r}function QAe(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=tl(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var a=[],s=[],o=0;o0&&(a.push(bZ(s,e)),s=[]),a.push(n[o]));s.length>0&&a.push(bZ(s,e));var u;r?(u=bZ(tl(r,e,!0),e),u.classes=["tag"],a.push(u)):i&&a.push(i);var h=Wt(["katex-html"],a);if(h.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=ir(h.height+h.depth),h.depth&&(d.style.verticalAlign=ir(-h.depth))}return h}function W_t(t){return new H4(t)}class tr{constructor(e,r,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=r||[],this.classes=n||[]}setAttribute(e,r){this.attributes[e]=r}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&e.setAttribute(r,this.attributes[r]);this.classes.length>0&&(e.className=m2(this.classes));for(var n=0;n0&&(e+=' class ="'+tu(m2(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}}class Po{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return tu(this.toText())}toText(){return this.text}}class Y_t{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",ir(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var Pbn=new Set(["\\imath","\\jmath"]),Nbn=new Set(["mrow","mtable"]),up=function(e,r,n){return gs[r][e]&&gs[r][e].replace&&e.charCodeAt(0)!==55349&&!(E_t.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=gs[r][e].replace),new Po(e)},GAe=function(e){return e.length===1?e[0]:new tr("mrow",e)},Bbn={mathit:"italic",boldsymbol:t=>t.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},HAe=(t,e)=>{if(t.mode==="text"){if(e.fontFamily==="texttt")return"monospace";if(e.fontFamily==="textsf")return e.fontShape==="textit"&&e.fontWeight==="textbf"?"sans-serif-bold-italic":e.fontShape==="textit"?"sans-serif-italic":e.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(e.fontShape==="textit"&&e.fontWeight==="textbf")return"bold-italic";if(e.fontShape==="textit")return"italic";if(e.fontWeight==="textbf")return"bold"}var r=e.font;if(!r||r==="mathnormal")return null;var n=t.mode,i=Bbn[r];if(i)return typeof i=="function"?i(t):i;var a=t.text;if(Pbn.has(a))return null;if(gs[n][a]){var s=gs[n][a].replace;s&&(a=s)}var o=FAe[r].fontName;return OAe(a,o,n)?FAe[r].variant:null};function WAe(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof Po&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var r=t.children[0];return r instanceof Po&&r.text===","}else return!1}var jd=function(e,r,n){if(e.length===1){var i=Ca(e[0],r);return n&&i instanceof tr&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],s,o=0;o=1&&(s.type==="mn"||WAe(s))){var u=l.children[0];u instanceof tr&&u.type==="mn"&&(u.children=[...s.children,...u.children],a.pop())}else if(s.type==="mi"&&s.children.length===1){var h=s.children[0];if(h instanceof Po&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof Po&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),a.pop())}}}a.push(l),s=l}return a},x2=function(e,r,n){return GAe(jd(e,r,n))},Ca=function(e,r){if(!e)return new tr("mrow");if(vZ[e.type])return vZ[e.type](e,r);throw new Zt("Got group of unknown type: '"+e.type+"'")};function q_t(t,e,r,n,i){var a=jd(t,r),s;a.length===1&&a[0]instanceof tr&&Nbn.has(a[0].type)?s=a[0]:s=new tr("mrow",a);var o=new tr("annotation",[new Po(e)]);o.setAttribute("encoding","application/x-tex");var l=new tr("semantics",[s,o]),u=new tr("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var h=i?"katex":"katex-mathml";return Wt([h],[u])}var $bn=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],j_t=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],X_t=function(e,r){return r.size<2?e:$bn[e-1][r.size-1]};class p1{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||p1.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=j_t[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var r={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(r,e),new p1(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:X_t(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:j_t[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=X_t(p1.BASESIZE,e);return this.size===r&&this.textSize===p1.BASESIZE&&this.style===e?this:this.extend({style:e,size:r})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==p1.BASESIZE?["sizing","reset-size"+this.size,"size"+p1.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=wbn(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}p1.BASESIZE=6;var K_t=function(e){return new p1({style:e.displayMode?In.DISPLAY:In.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},Z_t=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=Wt(n,[e])}return e},Fbn=function(e,r,n){var i=K_t(n),a;if(n.output==="mathml")return q_t(e,r,i,n.displayMode,!0);if(n.output==="html"){var s=QAe(e,i);a=Wt(["katex"],[s])}else{var o=q_t(e,r,i,n.displayMode,!1),l=QAe(e,i);a=Wt(["katex"],[o,l])}return Z_t(a,n)},zbn=function(e,r,n){var i=K_t(n),a=QAe(e,i),s=Wt(["katex"],[a]);return Z_t(s,n)},Ubn={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},xZ=function(e){var r=new tr("mo",[new Po(Ubn[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},Vbn={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Qbn=new Set(["widehat","widecheck","widetilde","utilde"]),wZ=function(e,r){function n(){var o=4e5,l=e.label.slice(1);if(Qbn.has(l)&&"base"in e){var u=e.base.type==="ordgroup"?e.base.body.length:1,h,d,f;if(u>5)l==="widehat"||l==="widecheck"?(h=420,o=2364,f=.42,d=l+"4"):(h=312,o=2340,f=.34,d="tilde4");else{var p=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][p],h=[0,239,300,360,420][p],f=[0,.24,.3,.3,.36,.42][p],d=l+p):(o=[0,600,1033,2339,2340][p],h=[0,260,286,306,312][p],f=[0,.26,.286,.3,.306,.34][p],d="tilde"+p)}var g=new v2(d),m=new u1([g],{width:"100%",height:ir(f),viewBox:"0 0 "+o+" "+h,preserveAspectRatio:"none"});return{span:b2([],[m],r),minWidth:0,height:f}}else{var v=[],y=Vbn[l];if(!y)throw new Error('No SVG data for "'+l+'".');var[b,x,w]=y,A=w/1e3,S=b.length,T,O;if(S===1){if(y.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');T=["hide-tail"],O=[y[3]]}else if(S===2)T=["halfarrow-left","halfarrow-right"],O=["xMinYMin","xMaxYMin"];else if(S===3)T=["brace-left","brace-center","brace-right"],O=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+S+" children.");for(var k=0;k0&&(i.style.minWidth=ir(a)),i},Gbn=function(e,r,n,i,a){var s,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(s=Wt(["stretchy",r],[],a),r==="fbox"){var l=a.color&&a.getColor();l&&(s.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(r)&&u.push(new CAe({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new CAe({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new u1(u,{width:"100%",height:ir(o)});s=b2([],[h],a)}return s.height=o,s.style.height=ir(o),s},Hbn={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Wbn={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function Ybn(t){return t in Hbn}function Wn(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function AZ(t){var e=SZ(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function SZ(t){return t&&(t.type==="atom"||Wbn.hasOwnProperty(t.type))?t:null}var J_t=t=>{if(t instanceof Yd)return t;if(xbn(t)&&t.children.length===1)return J_t(t.children[0])},YAe=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=Wn(t.base,"accent"),r=n.base,t.base=r,i=bbn(qi(t,e)),t.base=n):(n=Wn(t,"accent"),r=n.base);var a=qi(r,e.havingCrampedStyle()),s=n.isShifty&&l1(r),o=0;if(s){var l,u;o=(l=(u=J_t(a))==null?void 0:u.skew)!=null?l:0}var h=n.label==="\\c",d=h?a.height+a.depth:Math.min(a.height,e.fontMetrics().xHeight),f;if(n.isStretchy)f=wZ(n,e),f=Yi({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+ir(2*o)+")",marginLeft:ir(2*o)}:void 0}]});else{var p,g;n.label==="\\vec"?(p=Q_t("vec",e),g=V_t.vec[1]):(p=pZ({mode:n.mode,text:n.label},e,"textord"),p=ybn(p),p.italic=0,g=p.width,h&&(d+=p.depth)),f=Wt(["accent-body"],[p]);var m=n.label==="\\textcircled";m&&(f.classes.push("accent-full"),d=a.height);var v=o;m||(v-=g/2),f.style.left=ir(v),n.label==="\\textcircled"&&(f.style.top=".2em"),f=Yi({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:f}]})}var y=Wt(["mord","accent"],[f],e);return i?(i.children[0]=y,i.height=Math.max(y.height,i.height),i.classes[0]="mord",i):y},e5t=(t,e)=>{var r=t.isStretchy?xZ(t.label):new tr("mo",[up(t.label,t.mode)]),n=new tr("mover",[Ca(t.base,e),r]);return n.setAttribute("accent","true"),n},qbn=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));xr({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var r=yZ(e[0]),n=!qbn.test(t.funcName),i=!n||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:n,isShifty:i,base:r}},htmlBuilder:YAe,mathmlBuilder:e5t}),xr({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var r=e[0],n=t.parser.mode;return n==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:t.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:YAe,mathmlBuilder:e5t}),xr({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}},htmlBuilder:(t,e)=>{var r=qi(t.base,e),n=wZ(t,e),i=t.label==="\\utilde"?.12:0,a=Yi({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]});return Wt(["mord","accentunder"],[a],e)},mathmlBuilder:(t,e)=>{var r=xZ(t.label),n=new tr("munder",[Ca(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var TZ=t=>{var e=new tr("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};xr({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n,funcName:i}=t;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:r[0]}},htmlBuilder(t,e){var r=e.style,n=e.havingStyle(r.sup()),i=j4(qi(t.body,n,e),e),a=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var s;t.below&&(n=e.havingStyle(r.sub()),s=j4(qi(t.below,n,e),e),s.classes.push(a+"-arrow-pad"));var o=wZ(t,e),l=-e.fontMetrics().axisHeight+.5*o.height,u=-e.fontMetrics().axisHeight-.5*o.height-.111;(i.depth>.25||t.label==="\\xleftequilibrium")&&(u-=i.depth);var h;if(s){var d=-e.fontMetrics().axisHeight+s.height+.5*o.height+.111;h=Yi({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:s,shift:d}]})}else h=Yi({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return Wt(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=xZ(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=TZ(Ca(t.body,e));if(t.below){var a=TZ(Ca(t.below,e));n=new tr("munderover",[r,a,i])}else n=new tr("mover",[r,i])}else if(t.below){var s=TZ(Ca(t.below,e));n=new tr("munder",[r,s])}else n=TZ(),n=new tr("mover",[r,n]);return n}});function t5t(t,e){var r=tl(t.body,e,!0);return Wt([t.mclass],r,e)}function r5t(t,e){var r,n=jd(t.body,e);return t.mclass==="minner"?r=new tr("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new tr("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new tr("mo",n),t.mclass==="mbin"?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):t.mclass==="mpunct"?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(r.attributes.lspace="0em",r.attributes.rspace="0em"):t.mclass==="minner"&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}xr({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:Io(i),isCharacterBox:l1(i)}},htmlBuilder:t5t,mathmlBuilder:r5t});var CZ=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};xr({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:CZ(e[0]),body:Io(e[1]),isCharacterBox:l1(e[1])}}}),xr({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:r,funcName:n}=t,i=e[1],a=e[0],s;n!=="\\stackrel"?s=CZ(i):s="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Io(i)},l={type:"supsub",mode:a.mode,base:o,sup:n==="\\underset"?null:a,sub:n==="\\underset"?a:null};return{type:"mclass",mode:r.mode,mclass:s,body:[l],isCharacterBox:l1(l)}},htmlBuilder:t5t,mathmlBuilder:r5t}),xr({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:CZ(e[0]),body:Io(e[0])}},htmlBuilder(t,e){var r=tl(t.body,e,!0),n=Wt([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=jd(t.body,e),n=new tr("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var jbn={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},n5t=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),i5t=t=>t.type==="textord"&&t.text==="@",Xbn=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function Kbn(t,e,r){var n=jbn[t];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=r.callFunction("\\\\cdleft",[e[0]],[]),a={type:"atom",text:n,mode:"math",family:"rel"},s=r.callFunction("\\Big",[a],[]),o=r.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,s,o]};return r.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function Zbn(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var r=t.fetch().text;if(r==="&"||r==="\\\\")t.consume();else if(r==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new Zt("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var n=[],i=[n],a=0;aAV".includes(u))for(var d=0;d<2;d++){for(var f=!0,p=l+1;pAV=|." after @',s[l]);var g=Kbn(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display",resetFont:!0};n.push(m),o=n5t()}a%2===0?n.push(o):n.shift(),n=[],i.push(n)}t.gullet.endGroup(),t.gullet.endGroup();var v=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:v,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}xr({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:e[0]}},htmlBuilder(t,e){var r=e.havingStyle(e.style.sup()),n=j4(qi(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=ir(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new tr("mrow",[Ca(t.label,e)]);return r=new tr("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new tr("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}}),xr({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:r}=t;return{type:"cdlabelparent",mode:r.mode,fragment:e[0]}},htmlBuilder(t,e){var r=j4(qi(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new tr("mrow",[Ca(t.fragment,e)])}}),xr({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=Wn(e[0],"ordgroup"),i=n.body,a="",s=0;s=1114111)throw new Zt("\\@char with invalid code point "+a);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:r.mode,text:u}}});var a5t=(t,e)=>{var r=tl(t.body,e.withColor(t.color),!1);return d1(r)},s5t=(t,e)=>{var r=jd(t.body,e.withColor(t.color)),n=new tr("mstyle",r);return n.setAttribute("mathcolor",t.color),n};xr({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=Wn(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:Io(i)}},htmlBuilder:a5t,mathmlBuilder:s5t}),xr({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=Wn(e[0],"color-token").color;r.gullet.macros.set("\\current@color",i);var a=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:i,body:a}},htmlBuilder:a5t,mathmlBuilder:s5t}),xr({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,r){var{parser:n}=t,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,a=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:a,size:i&&Wn(i,"size").value}},htmlBuilder(t,e){var r=Wt(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=ir(Ss(t.size,e)))),r},mathmlBuilder(t,e){var r=new tr("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",ir(Ss(t.size,e)))),r}});var qAe={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},o5t=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Zt("Expected a control sequence",t);return e},Jbn=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},l5t=(t,e,r,n)=>{var i=t.gullet.macros.get(r.text);i==null&&(r.noexpand=!0,i={tokens:[r],numArgs:0,unexpandable:!t.gullet.isExpandable(r.text)}),t.gullet.macros.set(e,i,n)};xr({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:r}=t;e.consumeSpaces();var n=e.fetch();if(qAe[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=qAe[n.text]),Wn(e.parseFunction(),"internal");throw new Zt("Invalid token after macro prefix",n)}}),xr({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new Zt("Expected a control sequence",n);for(var a=0,s,o=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){s=e.gullet.future(),o[a].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new Zt('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==a+1)throw new Zt('Argument number "'+n.text+'" out of order');a++,o.push([])}else{if(n.text==="EOF")throw new Zt("Expected a macro definition");o[a].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return s&&l.unshift(s),(r==="\\edef"||r==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:a,delimiters:o},r===qAe[r]),{type:"internal",mode:e.mode}}}),xr({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=o5t(e.gullet.popToken());e.gullet.consumeSpaces();var i=Jbn(e);return l5t(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}}),xr({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=o5t(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return l5t(e,n,a,r==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var U$=function(e,r,n){var i=gs.math[e]&&gs.math[e].replace,a=OAe(i||e,r,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return a},jAe=function(e,r,n,i){var a=n.havingBaseStyle(r),s=Wt(i.concat(a.sizingClasses(n)),[e],n),o=a.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=a.sizeMultiplier,s},c5t=function(e,r,n){var i=r.havingBaseStyle(n),a=(1-r.sizeMultiplier/i.sizeMultiplier)*r.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=ir(a),e.height-=a,e.depth+=a},exn=function(e,r,n,i,a,s){var o=Uu(e,"Main-Regular",a,i),l=jAe(o,r,i,s);return c5t(l,i,r),l},txn=function(e,r,n,i){return Uu(e,"Size"+r+"-Regular",n,i)},u5t=function(e,r,n,i,a,s){var o=txn(e,r,a,i),l=jAe(Wt(["delimsizing","size"+r],[o],i),In.TEXT,i,s);return n&&c5t(l,i,In.TEXT),l},XAe=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Wt(["delimsizinginner",i],[Wt([],[Uu(e,r,n)])]);return{type:"elem",elem:a}},KAe=function(e,r,n){var i=A0["Size4-Regular"][e.charCodeAt(0)]?A0["Size4-Regular"][e.charCodeAt(0)][4]:A0["Size1-Regular"][e.charCodeAt(0)][4],a=new v2("inner",hbn(e,Math.round(1e3*r))),s=new u1([a],{width:ir(i),height:ir(r),style:"width:"+ir(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),o=b2([],[s],n);return o.height=r,o.style.height=ir(r),o.style.width=ir(i),{type:"elem",elem:o}},ZAe=.008,OZ={type:"kern",size:-1*ZAe},rxn=new Set(["|","\\lvert","\\rvert","\\vert"]),nxn=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),h5t=function(e,r,n,i,a,s){var o,l,u,h,d="",f=0;o=u=h=e,l=null;var p="Size1-Regular";e==="\\uparrow"?u=h="⏐":e==="\\Uparrow"?u=h="‖":e==="\\downarrow"?o=u="⏐":e==="\\Downarrow"?o=u="‖":e==="\\updownarrow"?(o="\\uparrow",u="⏐",h="\\downarrow"):e==="\\Updownarrow"?(o="\\Uparrow",u="‖",h="\\Downarrow"):rxn.has(e)?(u="∣",d="vert",f=333):nxn.has(e)?(u="∥",d="doublevert",f=556):e==="["||e==="\\lbrack"?(o="⎡",u="⎢",h="⎣",p="Size4-Regular",d="lbrack",f=667):e==="]"||e==="\\rbrack"?(o="⎤",u="⎥",h="⎦",p="Size4-Regular",d="rbrack",f=667):e==="\\lfloor"||e==="⌊"?(u=o="⎢",h="⎣",p="Size4-Regular",d="lfloor",f=667):e==="\\lceil"||e==="⌈"?(o="⎡",u=h="⎢",p="Size4-Regular",d="lceil",f=667):e==="\\rfloor"||e==="⌋"?(u=o="⎥",h="⎦",p="Size4-Regular",d="rfloor",f=667):e==="\\rceil"||e==="⌉"?(o="⎤",u=h="⎥",p="Size4-Regular",d="rceil",f=667):e==="("||e==="\\lparen"?(o="⎛",u="⎜",h="⎝",p="Size4-Regular",d="lparen",f=875):e===")"||e==="\\rparen"?(o="⎞",u="⎟",h="⎠",p="Size4-Regular",d="rparen",f=875):e==="\\{"||e==="\\lbrace"?(o="⎧",l="⎨",h="⎩",u="⎪",p="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(o="⎫",l="⎬",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(o="⎧",h="⎩",u="⎪",p="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(o="⎫",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(o="⎧",h="⎭",u="⎪",p="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(o="⎫",h="⎩",u="⎪",p="Size4-Regular");var g=U$(o,p,a),m=g.height+g.depth,v=U$(u,p,a),y=v.height+v.depth,b=U$(h,p,a),x=b.height+b.depth,w=0,A=1;if(l!==null){var S=U$(l,p,a);w=S.height+S.depth,A=2}var T=m+x+w,O=Math.max(0,Math.ceil((r-T)/(A*y))),k=T+O*A*y,E=i.fontMetrics().axisHeight;n&&(E*=i.sizeMultiplier);var _=k/2-E,I=[];if(d.length>0){var L=k-m-x,R=Math.round(k*1e3),D=dbn(d,Math.round(L*1e3)),M=new v2(d,D),P=ir(f/1e3),N=ir(R/1e3),F=new u1([M],{width:P,height:N,viewBox:"0 0 "+f+" "+R}),B=b2([],[F],i);B.height=R/1e3,B.style.width=P,B.style.height=N,I.push({type:"elem",elem:B})}else{if(I.push(XAe(h,p,a)),I.push(OZ),l===null){var V=k-m-x+2*ZAe;I.push(KAe(u,V,i))}else{var z=(k-m-x-w)/2+2*ZAe;I.push(KAe(u,z,i)),I.push(OZ),I.push(XAe(l,p,a)),I.push(OZ),I.push(KAe(u,z,i))}I.push(OZ),I.push(XAe(o,p,a))}var U=i.havingBaseStyle(In.TEXT),Q=Yi({positionType:"bottom",positionData:_,children:I});return jAe(Wt(["delimsizing","mult"],[Q],U),In.TEXT,i,s)},JAe=80,eSe=.08,tSe=function(e,r,n,i,a){var s=ubn(e,i,n),o=new v2(e,s),l=new u1([o],{width:"400em",height:ir(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return b2(["hide-tail"],[l],a)},ixn=function(e,r){var n=r.havingBaseSizing(),i=m5t("\\surd",e*n.sizeMultiplier,g5t,n),a=n.sizeMultiplier,s=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),o,l,u,h,d;return i.type==="small"?(h=1e3+1e3*s+JAe,e<1?a=1:e<1.4&&(a=.7),l=(1+s+eSe)/a,u=(1+s)/a,o=tSe("sqrtMain",l,h,s,r),o.style.minWidth="0.853em",d=.833/a):i.type==="large"?(h=(1e3+JAe)*V$[i.size],u=(V$[i.size]+s)/a,l=(V$[i.size]+s+eSe)/a,o=tSe("sqrtSize"+i.size,l,h,s,r),o.style.minWidth="1.02em",d=1/a):(l=e+s+eSe,u=e+s,h=Math.floor(1e3*e+s)+JAe,o=tSe("sqrtTall",l,h,s,r),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=ir(l),{span:o,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+s)*a}},d5t=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),axn=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),f5t=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),V$=[0,1.2,1.8,2.4,3],p5t=function(e,r,n,i,a){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),d5t.has(e)||f5t.has(e))return u5t(e,r,!1,n,i,a);if(axn.has(e))return h5t(e,V$[r],!1,n,i,a);throw new Zt("Illegal delimiter: '"+e+"'")},sxn=[{type:"small",style:In.SCRIPTSCRIPT},{type:"small",style:In.SCRIPT},{type:"small",style:In.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],oxn=[{type:"small",style:In.SCRIPTSCRIPT},{type:"small",style:In.SCRIPT},{type:"small",style:In.TEXT},{type:"stack"}],g5t=[{type:"small",style:In.SCRIPTSCRIPT},{type:"small",style:In.SCRIPT},{type:"small",style:In.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],lxn=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";var r=e.type;throw new Error("Add support for delim type '"+r+"' here.")},m5t=function(e,r,n,i){for(var a=Math.min(2,3-i.style.size),s=a;sr)return o}return n[n.length-1]},rSe=function(e,r,n,i,a,s){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;f5t.has(e)?o=sxn:d5t.has(e)?o=g5t:o=oxn;var l=m5t(e,r,o,i);return l.type==="small"?exn(e,l.style,n,i,a,s):l.type==="large"?u5t(e,l.size,n,i,a,s):h5t(e,r,n,i,a,s)},nSe=function(e,r,n,i,a,s){var o=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,u=5/i.fontMetrics().ptPerEm,h=Math.max(r-o,n+o),d=Math.max(h/500*l,2*h-u);return rSe(e,d,!0,i,a,s)},v5t={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},cxn=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function y5t(t){return"isMiddle"in t}function kZ(t,e){var r=SZ(t);if(r&&cxn.has(r.text))return r;throw r?new Zt("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new Zt("Invalid delimiter type '"+t.type+"'",t)}xr({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(t,e)=>{var r=kZ(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:v5t[t.funcName].size,mclass:v5t[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?Wt([t.mclass]):p5t(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(up(t.delim,t.mode));var r=new tr("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=ir(V$[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function b5t(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}xr({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=t.parser.gullet.macros.get("\\current@color");if(r&&typeof r!="string")throw new Zt("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:kZ(e[0],t).text,color:r}}}),xr({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=kZ(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=Wn(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}},htmlBuilder:(t,e)=>{b5t(t);for(var r=tl(t.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,s=0;s{b5t(t);var r=jd(t.body,e);if(t.left!=="."){var n=new tr("mo",[up(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new tr("mo",[up(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return GAe(r)}}),xr({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=kZ(e[0],t);if(!t.parser.leftrightDepth)throw new Zt("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},htmlBuilder:(t,e)=>{var r;return t.delim==="."?r=z$(e,[]):(r=p5t(t.delim,1,e,t.mode,[]),r.isMiddle={delim:t.delim,options:e}),r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?up("|","text"):up(t.delim,t.mode),n=new tr("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var EZ=(t,e)=>{var r=j4(qi(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,a,s,o=l1(t.body);if(n==="sout")a=Wt(["stretchy","sout"]),a.height=e.fontMetrics().defaultRuleThickness/i,s=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=Ss({number:.6,unit:"pt"},e),u=Ss({number:.35,unit:"ex"},e),h=e.havingBaseSizing();i=i/h.sizeMultiplier;var d=r.height+r.depth+l+u;r.style.paddingLeft=ir(d/2+l);var f=Math.floor(1e3*d*i),p=lbn(f),g=new u1([new v2("phase",p)],{width:"400em",height:ir(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});a=b2(["hide-tail"],[g],e),a.style.height=ir(d),s=r.depth+l+u}else{/cancel/.test(n)?o||r.classes.push("cancel-pad"):n==="angl"?r.classes.push("anglpad"):r.classes.push("boxpad");var m,v,y=0;/box/.test(n)?(y=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),m=e.fontMetrics().fboxsep+(n==="colorbox"?0:y),v=m):n==="angl"?(y=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),m=4*y,v=Math.max(0,.25-r.depth)):(m=o?.2:0,v=m),a=Gbn(r,n,m,v,e),/fbox|boxed|fcolorbox/.test(n)?(a.style.borderStyle="solid",a.style.borderWidth=ir(y)):n==="angl"&&y!==.049&&(a.style.borderTopWidth=ir(y),a.style.borderRightWidth=ir(y)),s=r.depth+v,t.backgroundColor&&(a.style.backgroundColor=t.backgroundColor,t.borderColor&&(a.style.borderColor=t.borderColor))}var b;if(t.backgroundColor)b=Yi({positionType:"individualShift",children:[{type:"elem",elem:a,shift:s},{type:"elem",elem:r,shift:0}]});else{var x=/cancel|phase/.test(n)?["svg-align"]:[];b=Yi({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:a,shift:s,wrapperClasses:x}]})}return/cancel/.test(n)&&(b.height=r.height,b.depth=r.depth),/cancel/.test(n)&&!o?Wt(["mord","cancel-lap"],[b],e):Wt(["mord"],[b],e)},_Z=(t,e)=>{var r,n=new tr(t.label.includes("colorbox")?"mpadded":"menclose",[Ca(t.body,e)]);switch(t.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),t.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+ir(i)+" solid "+t.borderColor)}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n};xr({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=Wn(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:EZ,mathmlBuilder:_Z}),xr({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=Wn(e[0],"color-token").color,s=Wn(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,borderColor:a,body:o}},htmlBuilder:EZ,mathmlBuilder:_Z}),xr({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\fbox",body:e[0]}}}),xr({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:EZ,mathmlBuilder:_Z}),xr({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t;r.mode==="math"&&r.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:EZ,mathmlBuilder:_Z}),xr({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\angl",body:e[0]}}});var x5t={};function S0(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l{var e=t.parser.settings;if(!e.displayMode)throw new Zt("{"+t.envName+"} can be used only in display mode.")},uxn=new Set(["gather","gather*"]);function iSe(t){if(!t.includes("ed"))return!t.includes("*")}function w2(t,e,r){var{hskipBeforeAndAfter:n,addJot:i,cols:a,arraystretch:s,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:h,maxNumCols:d,leqno:f}=e;if(t.gullet.beginGroup(),u||t.gullet.macros.set("\\cr","\\\\\\relax"),!s){var p=t.gullet.expandMacroAsText("\\arraystretch");if(p==null)s=1;else if(s=parseFloat(p),!s||s<0)throw new Zt("Invalid \\arraystretch: "+p)}t.gullet.beginGroup();var g=[],m=[g],v=[],y=[],b=l!=null?[]:void 0;function x(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function w(){b&&(t.gullet.macros.get("\\df@tag")?(b.push(t.subparse([new Xd("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):b.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(x(),y.push(A5t(t));;){var A=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup();var S={type:"ordgroup",mode:t.mode,body:A};r&&(S={type:"styling",mode:t.mode,style:r,resetFont:!0,body:[S]}),g.push(S);var T=t.fetch().text;if(T==="&"){if(d&&g.length===d){if(u||o)throw new Zt("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(T==="\\end"){w(),g.length===1&&S.type==="styling"&&S.body.length===1&&S.body[0].type==="ordgroup"&&S.body[0].body.length===0&&(m.length>1||!h)&&m.pop(),y.length0&&(x+=.25),u.push({pos:x,isDashed:be[ne]})}for(w(s[0]),n=0;n0&&(_+=b,T<_&&(T=_),_=0)),e.addJot&&nbe))for(n=0;n=o)){var q=void 0;if(i>0||e.hskipBeforeAndAfter){var Z,ee;q=(Z=(ee=U)==null?void 0:ee.pregap)!=null?Z:f,q!==0&&(D=Wt(["arraycolsep"],[]),D.style.width=ir(q),R.push(D))}var re=[];for(n=0;n0){for(var ge=q4("hline",r,h),Qe=q4("hdashline",r,h),Te=[{type:"elem",elem:Se,shift:0}];u.length>0;){var De=u.pop(),qe=De.pos-I;De.isDashed?Te.push({type:"elem",elem:Qe,shift:qe}):Te.push({type:"elem",elem:ge,shift:qe})}Se=Yi({positionType:"individualShift",children:Te})}if(P.length===0)return Wt(["mord"],[Se],r);var K=Yi({positionType:"individualShift",children:P}),ce=Wt(["tag"],[K],r);return d1([Se,ce])},hxn={c:"center ",l:"left ",r:"right "},C0=function(e,r){for(var n=[],i=new tr("mtd",[],["mtr-glue"]),a=new tr("mtd",[],["mml-eqn-num"]),s=0;s0){var g=e.cols,m="",v=!1,y=0,b=g.length;g[0].type==="separator"&&(f+="top ",y=1),g[g.length-1].type==="separator"&&(f+="bottom ",b-=1);for(var x=y;x0?"left ":"",f+=k[k.length-1].length>0?"right ":"";for(var E=1;E0&&p&&(v=1),n[g]={type:"align",align:m,pregap:v,postgap:0}}return s.colSeparationType=p?"align":"alignat",s};S0({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=SZ(e[0]),n=r?[e[0]]:Wn(e[0],"ordgroup").body,i=n.map(function(s){var o=AZ(s),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Zt("Unknown column alignment: "+l,s)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return w2(t.parser,a,aSe(t.envName))},htmlBuilder:T0,mathmlBuilder:C0}),S0({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],r="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if(t.envName.charAt(t.envName.length-1)==="*"){var i=t.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,!"lcr".includes(r))throw new Zt("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var a=w2(t.parser,n,aSe(t.envName)),s=Math.max(0,...a.body.map(o=>o.length));return a.cols=new Array(s).fill({type:"align",align:r}),e?{type:"leftright",mode:t.mode,body:[a],left:e[0],right:e[1],rightColor:void 0}:a},htmlBuilder:T0,mathmlBuilder:C0}),S0({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=w2(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:T0,mathmlBuilder:C0}),S0({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=SZ(e[0]),n=r?[e[0]]:Wn(e[0],"ordgroup").body,i=n.map(function(o){var l=AZ(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Zt("Unknown column alignment: "+u,o)});if(i.length>1)throw new Zt("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},s=w2(t.parser,a,"script");if(s.body.length>0&&s.body[0].length>1)throw new Zt("{subarray} can contain only one column");return s},htmlBuilder:T0,mathmlBuilder:C0}),S0({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},r=w2(t.parser,e,aSe(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:T0,mathmlBuilder:C0}),S0({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:S5t,htmlBuilder:T0,mathmlBuilder:C0}),S0({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){uxn.has(t.envName)&&RZ(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:iSe(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return w2(t.parser,e,"display")},htmlBuilder:T0,mathmlBuilder:C0}),S0({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:S5t,htmlBuilder:T0,mathmlBuilder:C0}),S0({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){RZ(t);var e={autoTag:iSe(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return w2(t.parser,e,"display")},htmlBuilder:T0,mathmlBuilder:C0}),S0({type:"array",names:["CD"],props:{numArgs:0},handler(t){return RZ(t),Zbn(t.parser)},htmlBuilder:T0,mathmlBuilder:C0}),ke("\\nonumber","\\gdef\\@eqnsw{0}"),ke("\\notag","\\nonumber"),xr({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new Zt(t.funcName+" valid only within array environment")}});var T5t=x5t;xr({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];if(i.type!=="ordgroup")throw new Zt("Invalid environment name",i);for(var a="",s=0;s{var r=t.font,n=e.withFont(r);return qi(t.body,n)},O5t=(t,e)=>{var r=t.font,n=e.withFont(r);return Ca(t.body,n)},k5t={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};xr({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=yZ(e[0]),a=n;return a in k5t&&(a=k5t[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}},htmlBuilder:C5t,mathmlBuilder:O5t}),xr({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"mclass",mode:r.mode,mclass:CZ(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:l1(n)}}}),xr({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n,breakOnTokenText:i}=t,{mode:a}=r,s=r.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:s}}},htmlBuilder:C5t,mathmlBuilder:O5t});var dxn=(t,e)=>{var r=e.style,n=r.fracNum(),i=r.fracDen(),a;a=e.havingStyle(n);var s=qi(t.numer,a,e);if(t.continued){var o=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;s.height=s.height0?g=3*f:g=7*f,m=e.fontMetrics().denom1):(d>0?(p=e.fontMetrics().num2,g=f):(p=e.fontMetrics().num3,g=3*f),m=e.fontMetrics().denom2);var v;if(h){var b=e.fontMetrics().axisHeight;p-s.depth-(b+.5*d){var r=new tr("mfrac",[Ca(t.numer,e),Ca(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=Ss(t.barSize,e);r.setAttribute("linethickness",ir(n))}if(t.leftDelim!=null||t.rightDelim!=null){var i=[];if(t.leftDelim!=null){var a=new tr("mo",[new Po(t.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(r),t.rightDelim!=null){var s=new tr("mo",[new Po(t.rightDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}return GAe(i)}return r},E5t=(t,e)=>{if(!e)return t;var r={type:"styling",mode:t.mode,style:e,body:[t]};return r};xr({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=e[1],s,o=null,l=null;switch(n){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":s=!0;break;case"\\\\atopfrac":s=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s=!1,o="(",l=")";break;case"\\\\bracefrac":s=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":s=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=n==="\\cfrac",h=null;return u||n.startsWith("\\d")?h="display":n.startsWith("\\t")&&(h="text"),E5t({type:"genfrac",mode:r.mode,numer:i,denom:a,continued:u,hasBarLine:s,leftDelim:o,rightDelim:l,barSize:null},h)},htmlBuilder:dxn,mathmlBuilder:fxn}),xr({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:r,token:n}=t,i;switch(r){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var _5t=["display","text","script","scriptscript"],R5t=function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r};xr({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:r}=t,n=e[4],i=e[5],a=yZ(e[0]),s=a.type==="atom"&&a.family==="open"?R5t(a.text):null,o=yZ(e[1]),l=o.type==="atom"&&o.family==="close"?R5t(o.text):null,u=Wn(e[2],"size"),h,d=null;u.isBlank?h=!0:(d=u.value,h=d.number>0);var f=null,p=e[3];if(p.type==="ordgroup"){if(p.body.length>0){var g=Wn(p.body[0],"textord");f=_5t[Number(g.text)]}}else p=Wn(p,"textord"),f=_5t[Number(p.text)];return E5t({type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:s,rightDelim:l},f)}}),xr({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:r,funcName:n,token:i}=t;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:Wn(e[0],"size").value,token:i}}}),xr({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=Wn(e[1],"infix").size;if(!a)throw new Error("\\\\abovefrac expected size, but got "+String(a));var s=e[2],o=a.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:s,continued:!1,hasBarLine:o,barSize:a,leftDelim:null,rightDelim:null}}});var D5t=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?qi(t.sup,e.havingStyle(r.sup()),e):qi(t.sub,e.havingStyle(r.sub()),e),i=Wn(t.base,"horizBrace")):i=Wn(t,"horizBrace");var a=qi(i.base,e.havingBaseStyle(In.DISPLAY)),s=wZ(i,e),o;if(i.isOver?o=Yi({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s,wrapperClasses:["svg-align"]}]}):o=Yi({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:a}]}),n){var l=Wt(["minner",i.isOver?"mover":"munder"],[o],e);i.isOver?o=Yi({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):o=Yi({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Wt(["minner",i.isOver?"mover":"munder"],[o],e)},pxn=(t,e)=>{var r=xZ(t.label);return new tr(t.isOver?"mover":"munder",[Ca(t.base,e),r])};xr({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"horizBrace",mode:r.mode,label:n,isOver:n.includes("\\over"),base:e[0]}},htmlBuilder:D5t,mathmlBuilder:pxn}),xr({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[1],i=Wn(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:Io(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=tl(t.body,e,!1);return kbn(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=x2(t.body,e);return r instanceof tr||(r=new tr("mrow",[r])),r.setAttribute("href",t.href),r}}),xr({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=Wn(e[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],a=0;a{var{parser:r,funcName:n,token:i}=t,a=Wn(e[0],"raw").string,s=e[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(n){case"\\htmlClass":l.class=a,o={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,o={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,o={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var u=a.split(","),h=0;h{var r=tl(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=Wt(n,r,e);for(var a in t.attributes)a!=="class"&&t.attributes.hasOwnProperty(a)&&i.setAttribute(a,t.attributes[a]);return i},mathmlBuilder:(t,e)=>x2(t.body,e)}),xr({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"htmlmathml",mode:r.mode,html:Io(e[0]),mathml:Io(e[1])}},htmlBuilder:(t,e)=>{var r=tl(t.html,e,!1);return d1(r)},mathmlBuilder:(t,e)=>x2(t.mathml,e)});var sSe=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!r)throw new Zt("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!A_t(n))throw new Zt("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};xr({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,r)=>{var{parser:n}=t,i={number:0,unit:"em"},a={number:.9,unit:"em"},s={number:0,unit:"em"},o="";if(r[0])for(var l=Wn(r[0],"raw").string,u=l.split(","),h=0;h{var r=Ss(t.height,e),n=0;t.totalheight.number>0&&(n=Ss(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=Ss(t.width,e));var a={height:ir(r+n)};i>0&&(a.width=ir(i)),n>0&&(a.verticalAlign=ir(-n));var s=new mbn(t.src,t.alt,a);return s.height=r,s.depth=n,s},mathmlBuilder:(t,e)=>{var r=new tr("mglyph",[]);r.setAttribute("alt",t.alt);var n=Ss(t.height,e),i=0;if(t.totalheight.number>0&&(i=Ss(t.totalheight,e)-n,r.setAttribute("valign",ir(-i))),r.setAttribute("height",ir(n+i)),t.width.number>0){var a=Ss(t.width,e);r.setAttribute("width",ir(a))}return r.setAttribute("src",t.src),r}}),xr({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=Wn(e[0],"size");if(r.settings.strict){var a=n[1]==="m",s=i.value.unit==="mu";a?(s||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),r.mode!=="math"&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):s&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:i.value}},htmlBuilder(t,e){return U_t(t.dimension,e)},mathmlBuilder(t,e){var r=Ss(t.dimension,e);return new Y_t(r)}}),xr({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:i}},htmlBuilder:(t,e)=>{var r;t.alignment==="clap"?(r=Wt([],[qi(t.body,e)]),r=Wt(["inner"],[r],e)):r=Wt(["inner"],[qi(t.body,e)]);var n=Wt(["fix"],[]),i=Wt([t.alignment],[r,n],e),a=Wt(["strut"]);return a.style.height=ir(i.height+i.depth),i.depth&&(a.style.verticalAlign=ir(-i.depth)),i.children.unshift(a),i=Wt(["thinbox"],[i],e),Wt(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new tr("mpadded",[Ca(t.body,e)]);if(t.alignment!=="rlap"){var n=t.alignment==="llap"?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r}}),xr({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:r,parser:n}=t,i=n.mode;n.switchMode("math");var a=r==="\\("?"\\)":"$",s=n.parseExpression(!1,a);return n.expect(a),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",resetFont:!0,body:s}}}),xr({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new Zt("Mismatched "+t.funcName)}});var L5t=(t,e)=>{switch(e.style.size){case In.DISPLAY.size:return t.display;case In.TEXT.size:return t.text;case In.SCRIPT.size:return t.script;case In.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};xr({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:Io(e[0]),text:Io(e[1]),script:Io(e[2]),scriptscript:Io(e[3])}},htmlBuilder:(t,e)=>{var r=L5t(t,e),n=tl(r,e,!1);return d1(n)},mathmlBuilder:(t,e)=>{var r=L5t(t,e);return x2(r,e)}});var M5t=(t,e,r,n,i,a,s)=>{t=Wt([],[t]);var o=r&&l1(r),l,u;if(e){var h=qi(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=qi(r,n.havingStyle(i.sub()),n);l={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}var f;if(u&&l){var p=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+t.depth+s;f=Yi({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:ir(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:ir(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else if(l){var g=t.height-s;f=Yi({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:ir(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t}]})}else if(u){var m=t.depth+s;f=Yi({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:ir(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else return t;var v=[f];if(l&&a!==0&&!o){var y=Wt(["mspace"],[],n);y.style.marginRight=ir(a),v.unshift(y)}return Wt(["mop","op-limits"],v,n)},I5t=new Set(["\\smallint"]),X4=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=Wn(t.base,"op"),i=!0):a=Wn(t,"op");var s=e.style,o=!1;s.size===In.DISPLAY.size&&a.symbol&&!I5t.has(a.name)&&(o=!0);var l,u;if(a.symbol){var h=o?"Size2-Regular":"Size1-Regular",d="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(d=a.name.slice(1),a.name=d==="oiint"?"\\iint":"\\iiint"),l=Uu(a.name,h,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var f=Q_t(d+"Size"+(o?"2":"1"),e);l=Yi({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:o?.08:0}]}),a.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(a.body){var p=tl(a.body,e,!0);p.length===1&&p[0]instanceof Yd?(l=p[0],l.classes[0]="mop"):l=Wt(["mop"],p,e)}else{for(var g=[],m=1;m{var r;if(t.symbol)r=new tr("mo",[up(t.name,t.mode)]),I5t.has(t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new tr("mo",jd(t.body,e));else{r=new tr("mi",[new Po(t.name.slice(1))]);var n=new tr("mo",[up("⁡","text")]);t.parentIsSupSub?r=new tr("mrow",[r,n]):r=W_t([r,n])}return r},gxn={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};xr({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=n;return i.length===1&&(i=gxn[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:X4,mathmlBuilder:Q$}),xr({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Io(n)}},htmlBuilder:X4,mathmlBuilder:Q$});var mxn={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};xr({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:X4,mathmlBuilder:Q$}),xr({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:X4,mathmlBuilder:Q$}),xr({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(t){var{parser:e,funcName:r}=t,n=r;return n.length===1&&(n=mxn[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:X4,mathmlBuilder:Q$});var P5t=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=Wn(t.base,"operatorname"),i=!0):a=Wn(t,"operatorname");var s;if(a.body.length>0){for(var o=a.body.map(d=>{var f="text"in d?d.text:void 0;return typeof f=="string"?{type:"textord",mode:d.mode,text:f}:d}),l=tl(o,e.withFont("mathrm"),!0),u=0;u{for(var r=jd(t.body,e.withFont("mathrm")),n=!0,i=0;ih.toText()).join("");r=[new Po(o)]}var l=new tr("mi",r);l.setAttribute("mathvariant","normal");var u=new tr("mo",[up("⁡","text")]);return t.parentIsSupSub?new tr("mrow",[l,u]):W_t([l,u])};xr({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"operatorname",mode:r.mode,body:Io(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:P5t,mathmlBuilder:vxn}),ke("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),aC({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?d1(tl(t.body,e,!1)):Wt(["mord"],tl(t.body,e,!0),e)},mathmlBuilder(t,e){return x2(t.body,e,!0)}}),xr({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:r}=t,n=e[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(t,e){var r=qi(t.body,e.havingCrampedStyle()),n=q4("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Yi({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]});return Wt(["mord","overline"],[a],e)},mathmlBuilder(t,e){var r=new tr("mo",[new Po("‾")]);r.setAttribute("stretchy","true");var n=new tr("mover",[Ca(t.body,e),r]);return n.setAttribute("accent","true"),n}}),xr({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"phantom",mode:r.mode,body:Io(n)}},htmlBuilder:(t,e)=>{var r=tl(t.body,e.withPhantom(),!1);return d1(r)},mathmlBuilder:(t,e)=>{var r=jd(t.body,e);return new tr("mphantom",r)}}),ke("\\hphantom","\\smash{\\phantom{#1}}"),xr({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"vphantom",mode:r.mode,body:n}},htmlBuilder:(t,e)=>{var r=Wt(["inner"],[qi(t.body,e.withPhantom())]),n=Wt(["fix"],[]);return Wt(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=jd(Io(t.body),e),n=new tr("mphantom",r),i=new tr("mpadded",[n]);return i.setAttribute("width","0px"),i}}),xr({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=Wn(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=qi(t.body,e),n=Ss(t.dy,e);return Yi({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new tr("mpadded",[Ca(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}}),xr({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}}),xr({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,r){var{parser:n}=t,i=r[0],a=Wn(e[0],"size"),s=Wn(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&Wn(i,"size").value,width:a.value,height:s.value}},htmlBuilder(t,e){var r=Wt(["mord","rule"],[],e),n=Ss(t.width,e),i=Ss(t.height,e),a=t.shift?Ss(t.shift,e):0;return r.style.borderRightWidth=ir(n),r.style.borderTopWidth=ir(i),r.style.bottom=ir(a),r.width=n,r.height=i+a,r.depth=-a,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=Ss(t.width,e),n=Ss(t.height,e),i=t.shift?Ss(t.shift,e):0,a=e.color&&e.getColor()||"black",s=new tr("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",ir(r)),s.setAttribute("height",ir(n));var o=new tr("mpadded",[s]);return i>=0?o.setAttribute("height",ir(i)):(o.setAttribute("height",ir(i)),o.setAttribute("depth",ir(-i))),o.setAttribute("voffset",ir(i)),o}});function N5t(t,e,r){for(var n=tl(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,a=0;a{var r=e.havingSize(t.size);return N5t(t.body,r,e)};xr({type:"sizing",names:B5t,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:B5t.indexOf(n)+1,body:a}},htmlBuilder:yxn,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=jd(t.body,r),i=new tr("mstyle",n);return i.setAttribute("mathsize",ir(r.sizeMultiplier)),i}}),xr({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,r)=>{var{parser:n}=t,i=!1,a=!1,s=r[0]&&Wn(r[0],"ordgroup");if(s)for(var o,l=0;l{var r=Wt([],[qi(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return r;if(t.smashHeight&&(r.height=0),t.smashDepth&&(r.depth=0),t.smashHeight&&t.smashDepth)return Wt(["mord","smash"],[r],e);if(r.children)for(var n=0;n{var r=new tr("mpadded",[Ca(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}}),xr({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n}=t,i=r[0],a=e[0];return{type:"sqrt",mode:n.mode,body:a,index:i}},htmlBuilder(t,e){var r=qi(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=j4(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,a=i;e.style.idr.height+r.depth+s&&(s=(s+d-r.height-r.depth)/2);var f=l.height-r.height-s-u;r.style.paddingLeft=ir(h);var p=Yi({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+f)},{type:"elem",elem:l},{type:"kern",size:u}]});if(t.index){var g=e.havingStyle(In.SCRIPTSCRIPT),m=qi(t.index,g,e),v=.6*(p.height-p.depth),y=Yi({positionType:"shift",positionData:-v,children:[{type:"elem",elem:m}]}),b=Wt(["root"],[y]);return Wt(["mord","sqrt"],[b,p],e)}else return Wt(["mord","sqrt"],[p],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new tr("mroot",[Ca(r,e),Ca(n,e)]):new tr("msqrt",[Ca(r,e)])}});var oSe={display:In.DISPLAY,text:In.TEXT,script:In.SCRIPT,scriptscript:In.SCRIPTSCRIPT};function bxn(t){return t in oSe}xr({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!0,r),s=n.slice(1,n.length-5);if(!bxn(s))throw new Error("Unknown style: "+s);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(t,e){var r=oSe[t.style],n=e.havingStyle(r);return t.resetFont&&(n=n.withFont("")),N5t(t.body,n,e)},mathmlBuilder(t,e){var r=oSe[t.style],n=e.havingStyle(r);t.resetFont&&(n=n.withFont(""));var i=jd(t.body,n),a=new tr("mstyle",i),s={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=s[t.style];return a.setAttribute("scriptlevel",o[0]),a.setAttribute("displaystyle",o[1]),a}});var xxn=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===In.DISPLAY.size||n.alwaysHandleSupSub);return i?X4:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===In.DISPLAY.size||n.limits);return a?P5t:null}else{if(n.type==="accent")return l1(n.base)?YAe:null;if(n.type==="horizBrace"){var s=!e.sub;return s===n.isOver?D5t:null}else return null}else return null};aC({type:"supsub",htmlBuilder(t,e){var r=xxn(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:a}=t,s=qi(n,e),o,l,u=e.fontMetrics(),h=0,d=0,f=n&&l1(n);if(i){var p=e.havingStyle(e.style.sup());o=qi(i,p,e),f||(h=s.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(a){var g=e.havingStyle(e.style.sub());l=qi(a,g,e),f||(d=s.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var m;e.style===In.DISPLAY?m=u.sup1:e.style.cramped?m=u.sup3:m=u.sup2;var v=e.sizeMultiplier,y=ir(.5/u.ptPerEm/v),b=null;if(l){var x=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");if(s instanceof Yd||x){var w;b=ir(-((w=s.italic)!=null?w:0))}}var A;if(o&&l){h=Math.max(h,m,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var S=u.defaultRuleThickness,T=4*S;if(h-o.depth-(l.height-d)0&&(h+=O,d-=O)}var k=[{type:"elem",elem:l,shift:d,marginRight:y,marginLeft:b},{type:"elem",elem:o,shift:-h,marginRight:y}];A=Yi({positionType:"individualShift",children:k})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var E=[{type:"elem",elem:l,marginLeft:b,marginRight:y}];A=Yi({positionType:"shift",positionData:d,children:E})}else if(o)h=Math.max(h,m,o.depth+.25*u.xHeight),A=Yi({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:y}]});else throw new Error("supsub must have either sup or sub.");var _=VAe(s,"right")||"mord";return Wt([_],[s,Wt(["msupsub"],[A])],e)},mathmlBuilder(t,e){var r=!1,n,i;t.base&&t.base.type==="horizBrace"&&(i=!!t.sup,i===t.base.isOver&&(r=!0,n=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var a=[Ca(t.base,e)];t.sub&&a.push(Ca(t.sub,e)),t.sup&&a.push(Ca(t.sup,e));var s;if(r)s=n?"mover":"munder";else if(t.sub)if(t.sup){var u=t.base;u&&u.type==="op"&&u.limits&&e.style===In.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===In.DISPLAY||u.limits)?s="munderover":s="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===In.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===In.DISPLAY)?s="munder":s="msub"}else{var o=t.base;o&&o.type==="op"&&o.limits&&(e.style===In.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===In.DISPLAY)?s="mover":s="msup"}return new tr(s,a)}}),aC({type:"atom",htmlBuilder(t,e){return BAe(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new tr("mo",[up(t.text,t.mode)]);if(t.family==="bin"){var n=HAe(t,e);n==="bold-italic"&&r.setAttribute("mathvariant",n)}else t.family==="punct"?r.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&r.setAttribute("stretchy","false");return r}});var $5t={mi:"italic",mn:"normal",mtext:"normal"};aC({type:"mathord",htmlBuilder(t,e){return pZ(t,e,"mathord")},mathmlBuilder(t,e){var r=new tr("mi",[up(t.text,t.mode,e)]),n=HAe(t,e)||"italic";return n!==$5t[r.type]&&r.setAttribute("mathvariant",n),r}}),aC({type:"textord",htmlBuilder(t,e){return pZ(t,e,"textord")},mathmlBuilder(t,e){var r=up(t.text,t.mode,e),n=HAe(t,e)||"normal",i;return t.mode==="text"?i=new tr("mtext",[r]):/[0-9]/.test(t.text)?i=new tr("mn",[r]):t.text==="\\prime"?i=new tr("mo",[r]):i=new tr("mi",[r]),n!==$5t[i.type]&&i.setAttribute("mathvariant",n),i}});var lSe={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},cSe={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};aC({type:"spacing",htmlBuilder(t,e){if(cSe.hasOwnProperty(t.text)){var r=cSe[t.text].className||"";if(t.mode==="text"){var n=pZ(t,e,"textord");return n.classes.push(r),n}else return Wt(["mspace",r],[BAe(t.text,t.mode,e)],e)}else{if(lSe.hasOwnProperty(t.text))return Wt(["mspace",lSe[t.text]],[],e);throw new Zt('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(cSe.hasOwnProperty(t.text))r=new tr("mtext",[new Po(" ")]);else{if(lSe.hasOwnProperty(t.text))return new tr("mspace");throw new Zt('Unknown type of space "'+t.text+'"')}return r}});var F5t=()=>{var t=new tr("mtd",[]);return t.setAttribute("width","50%"),t};aC({type:"tag",mathmlBuilder(t,e){var r=new tr("mtable",[new tr("mtr",[F5t(),new tr("mtd",[x2(t.body,e)]),F5t(),new tr("mtd",[x2(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var z5t={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},U5t={"\\textbf":"textbf","\\textmd":"textmd"},wxn={"\\textit":"textit","\\textup":"textup"},V5t=(t,e)=>{var r=t.font;if(r){if(z5t[r])return e.withTextFontFamily(z5t[r]);if(U5t[r])return e.withTextFontWeight(U5t[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(wxn[r])};xr({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"text",mode:r.mode,body:Io(i),font:n}},htmlBuilder(t,e){var r=V5t(t,e),n=tl(t.body,r,!0);return Wt(["mord","text"],n,r)},mathmlBuilder(t,e){var r=V5t(t,e);return x2(t.body,r)}}),xr({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"underline",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=qi(t.body,e),n=q4("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Yi({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]});return Wt(["mord","underline"],[a],e)},mathmlBuilder(t,e){var r=new tr("mo",[new Po("‾")]);r.setAttribute("stretchy","true");var n=new tr("munder",[Ca(t.body,e),r]);return n.setAttribute("accentunder","true"),n}}),xr({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"vcenter",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=qi(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return Yi({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new tr("mpadded",[Ca(t.body,e)],["vcenter"]);return new tr("mrow",[r])}}),xr({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new Zt("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=Q5t(t),n=[],i=e.havingStyle(e.style.text()),a=0;at.body.replace(/ /g,t.star?"␣":" "),A2=G_t,G5t=`[ \r + ]`,Axn="\\\\[a-zA-Z@]+",Sxn="\\\\[^\uD800-\uDFFF]",Txn="("+Axn+")"+G5t+"*",Cxn=`\\\\( |[ \r ]+ -?)[ \r ]*`,uTe="[̀-ͯ]",Oxn=new RegExp(uTe+"+$"),kxn="("+G5t+"+)|"+(Cxn+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(uTe+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(uTe+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+Sxn)+("|"+Txn+")");let H5t=class{constructor(e,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=r,this.tokenRegex=new RegExp(kxn,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,r){this.catcodes[e]=r}lex(){var e=this.input,r=this.tokenRegex.lastIndex;if(r===e.length)return new Xd("EOF",new Uh(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new Zt("Unexpected character: '"+e[r]+"'",new Xd(e[r],new Uh(this,r,r+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=e.indexOf(` -`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new Xd(i,new Uh(this,r,this.tokenRegex.lastIndex))}};class Exn{constructor(e,r){e===void 0&&(e={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Zt("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var r in e)e.hasOwnProperty(r)&&(e[r]==null?delete this.current[r]:this.current[r]=e[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,r,n){if(n===void 0&&(n=!1),n){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][e]=r)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(e)&&(a[e]=this.current[e])}r==null?delete this.current[e]:this.current[e]=r}}var _xn=w5t;ke("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}}),ke("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}}),ke("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}}),ke("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}}),ke("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var r=t.future();return e[0].length===1&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}}),ke("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),ke("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var W5t={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};ke("\\char",function(t){var e=t.popToken(),r,n=0;if(e.text==="'")r=8,e=t.popToken();else if(e.text==='"')r=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new Zt("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=W5t[e.text],n==null||n>=r)throw new Zt("Invalid base-"+r+" digit "+e.text);for(var i;(i=W5t[t.future().text])!=null&&i{var i=t.consumeArg().tokens;if(i.length!==1)throw new Zt("\\newcommand's first argument must be a macro name");var a=i[0].text,s=t.isDefined(a);if(s&&!e)throw new Zt("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!s&&!r)throw new Zt("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var o=0;if(i=t.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",u=t.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Zt("Invalid number of arguments: "+l);o=parseInt(l),i=t.consumeArg().tokens}return s&&n||t.macros.set(a,{tokens:i,numArgs:o}),""};ke("\\newcommand",t=>hTe(t,!1,!0,!1)),ke("\\renewcommand",t=>hTe(t,!0,!1,!1)),ke("\\providecommand",t=>hTe(t,!0,!0,!0)),ke("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""}),ke("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""}),ke("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),A2[r],gs.math[r],gs.text[r]),""}),ke("\\bgroup","{"),ke("\\egroup","}"),ke("~","\\nobreakspace"),ke("\\lq","`"),ke("\\rq","'"),ke("\\aa","\\r a"),ke("\\AA","\\r A"),ke("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),ke("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),ke("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),ke("ℬ","\\mathscr{B}"),ke("ℰ","\\mathscr{E}"),ke("ℱ","\\mathscr{F}"),ke("ℋ","\\mathscr{H}"),ke("ℐ","\\mathscr{I}"),ke("ℒ","\\mathscr{L}"),ke("ℳ","\\mathscr{M}"),ke("ℛ","\\mathscr{R}"),ke("ℭ","\\mathfrak{C}"),ke("ℌ","\\mathfrak{H}"),ke("ℨ","\\mathfrak{Z}"),ke("\\Bbbk","\\Bbb{k}"),ke("\\llap","\\mathllap{\\textrm{#1}}"),ke("\\rlap","\\mathrlap{\\textrm{#1}}"),ke("\\clap","\\mathclap{\\textrm{#1}}"),ke("\\mathstrut","\\vphantom{(}"),ke("\\underbar","\\underline{\\text{#1}}"),ke("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}'),ke("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),ke("\\ne","\\neq"),ke("≠","\\neq"),ke("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),ke("∉","\\notin"),ke("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),ke("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),ke("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),ke("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),ke("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),ke("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),ke("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),ke("⟂","\\perp"),ke("‼","\\mathclose{!\\mkern-0.8mu!}"),ke("∌","\\notni"),ke("⌜","\\ulcorner"),ke("⌝","\\urcorner"),ke("⌞","\\llcorner"),ke("⌟","\\lrcorner"),ke("©","\\copyright"),ke("®","\\textregistered"),ke("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),ke("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),ke("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),ke("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),ke("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),ke("⋮","\\vdots"),ke("\\varGamma","\\mathit{\\Gamma}"),ke("\\varDelta","\\mathit{\\Delta}"),ke("\\varTheta","\\mathit{\\Theta}"),ke("\\varLambda","\\mathit{\\Lambda}"),ke("\\varXi","\\mathit{\\Xi}"),ke("\\varPi","\\mathit{\\Pi}"),ke("\\varSigma","\\mathit{\\Sigma}"),ke("\\varUpsilon","\\mathit{\\Upsilon}"),ke("\\varPhi","\\mathit{\\Phi}"),ke("\\varPsi","\\mathit{\\Psi}"),ke("\\varOmega","\\mathit{\\Omega}"),ke("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),ke("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),ke("\\boxed","\\fbox{$\\displaystyle{#1}$}"),ke("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),ke("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),ke("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),ke("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),ke("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var Y5t={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},Rxn=new Set(["bin","rel"]);ke("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in Y5t?e=Y5t[r]:(r.slice(0,4)==="\\not"||r in gs.math&&Rxn.has(gs.math[r].group))&&(e="\\dotsb"),e});var dTe={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};ke("\\dotso",function(t){var e=t.future().text;return e in dTe?"\\ldots\\,":"\\ldots"}),ke("\\dotsc",function(t){var e=t.future().text;return e in dTe&&e!==","?"\\ldots\\,":"\\ldots"}),ke("\\cdots",function(t){var e=t.future().text;return e in dTe?"\\@cdots\\,":"\\@cdots"}),ke("\\dotsb","\\cdots"),ke("\\dotsm","\\cdots"),ke("\\dotsi","\\!\\cdots"),ke("\\dotsx","\\ldots\\,"),ke("\\DOTSI","\\relax"),ke("\\DOTSB","\\relax"),ke("\\DOTSX","\\relax"),ke("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),ke("\\,","\\tmspace+{3mu}{.1667em}"),ke("\\thinspace","\\,"),ke("\\>","\\mskip{4mu}"),ke("\\:","\\tmspace+{4mu}{.2222em}"),ke("\\medspace","\\:"),ke("\\;","\\tmspace+{5mu}{.2777em}"),ke("\\thickspace","\\;"),ke("\\!","\\tmspace-{3mu}{.1667em}"),ke("\\negthinspace","\\!"),ke("\\negmedspace","\\tmspace-{4mu}{.2222em}"),ke("\\negthickspace","\\tmspace-{5mu}{.277em}"),ke("\\enspace","\\kern.5em "),ke("\\enskip","\\hskip.5em\\relax"),ke("\\quad","\\hskip1em\\relax"),ke("\\qquad","\\hskip2em\\relax"),ke("\\tag","\\@ifstar\\tag@literal\\tag@paren"),ke("\\tag@paren","\\tag@literal{({#1})}"),ke("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new Zt("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),ke("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),ke("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),ke("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),ke("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),ke("\\newline","\\\\\\relax"),ke("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var q5t=ir(A0["Main-Regular"][84][1]-.7*A0["Main-Regular"][65][1]);ke("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+q5t+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),ke("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+q5t+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),ke("\\hspace","\\@ifstar\\@hspacer\\@hspace"),ke("\\@hspace","\\hskip #1\\relax"),ke("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),ke("\\ordinarycolon",":"),ke("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),ke("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),ke("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),ke("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),ke("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),ke("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),ke("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),ke("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),ke("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),ke("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),ke("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),ke("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),ke("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),ke("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),ke("∷","\\dblcolon"),ke("∹","\\eqcolon"),ke("≔","\\coloneqq"),ke("≕","\\eqqcolon"),ke("⩴","\\Coloneqq"),ke("\\ratio","\\vcentcolon"),ke("\\coloncolon","\\dblcolon"),ke("\\colonequals","\\coloneqq"),ke("\\coloncolonequals","\\Coloneqq"),ke("\\equalscolon","\\eqqcolon"),ke("\\equalscoloncolon","\\Eqqcolon"),ke("\\colonminus","\\coloneq"),ke("\\coloncolonminus","\\Coloneq"),ke("\\minuscolon","\\eqcolon"),ke("\\minuscoloncolon","\\Eqcolon"),ke("\\coloncolonapprox","\\Colonapprox"),ke("\\coloncolonsim","\\Colonsim"),ke("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),ke("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),ke("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),ke("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),ke("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),ke("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),ke("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),ke("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),ke("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),ke("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),ke("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),ke("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),ke("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),ke("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),ke("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),ke("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),ke("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),ke("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),ke("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),ke("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),ke("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),ke("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),ke("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),ke("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),ke("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),ke("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),ke("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),ke("\\imath","\\html@mathml{\\@imath}{ı}"),ke("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),ke("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),ke("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),ke("⟦","\\llbracket"),ke("⟧","\\rrbracket"),ke("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),ke("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),ke("⦃","\\lBrace"),ke("⦄","\\rBrace"),ke("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),ke("⦵","\\minuso"),ke("\\darr","\\downarrow"),ke("\\dArr","\\Downarrow"),ke("\\Darr","\\Downarrow"),ke("\\lang","\\langle"),ke("\\rang","\\rangle"),ke("\\uarr","\\uparrow"),ke("\\uArr","\\Uparrow"),ke("\\Uarr","\\Uparrow"),ke("\\N","\\mathbb{N}"),ke("\\R","\\mathbb{R}"),ke("\\Z","\\mathbb{Z}"),ke("\\alef","\\aleph"),ke("\\alefsym","\\aleph"),ke("\\Alpha","\\mathrm{A}"),ke("\\Beta","\\mathrm{B}"),ke("\\bull","\\bullet"),ke("\\Chi","\\mathrm{X}"),ke("\\clubs","\\clubsuit"),ke("\\cnums","\\mathbb{C}"),ke("\\Complex","\\mathbb{C}"),ke("\\Dagger","\\ddagger"),ke("\\diamonds","\\diamondsuit"),ke("\\empty","\\emptyset"),ke("\\Epsilon","\\mathrm{E}"),ke("\\Eta","\\mathrm{H}"),ke("\\exist","\\exists"),ke("\\harr","\\leftrightarrow"),ke("\\hArr","\\Leftrightarrow"),ke("\\Harr","\\Leftrightarrow"),ke("\\hearts","\\heartsuit"),ke("\\image","\\Im"),ke("\\infin","\\infty"),ke("\\Iota","\\mathrm{I}"),ke("\\isin","\\in"),ke("\\Kappa","\\mathrm{K}"),ke("\\larr","\\leftarrow"),ke("\\lArr","\\Leftarrow"),ke("\\Larr","\\Leftarrow"),ke("\\lrarr","\\leftrightarrow"),ke("\\lrArr","\\Leftrightarrow"),ke("\\Lrarr","\\Leftrightarrow"),ke("\\Mu","\\mathrm{M}"),ke("\\natnums","\\mathbb{N}"),ke("\\Nu","\\mathrm{N}"),ke("\\Omicron","\\mathrm{O}"),ke("\\plusmn","\\pm"),ke("\\rarr","\\rightarrow"),ke("\\rArr","\\Rightarrow"),ke("\\Rarr","\\Rightarrow"),ke("\\real","\\Re"),ke("\\reals","\\mathbb{R}"),ke("\\Reals","\\mathbb{R}"),ke("\\Rho","\\mathrm{P}"),ke("\\sdot","\\cdot"),ke("\\sect","\\S"),ke("\\spades","\\spadesuit"),ke("\\sub","\\subset"),ke("\\sube","\\subseteq"),ke("\\supe","\\supseteq"),ke("\\Tau","\\mathrm{T}"),ke("\\thetasym","\\vartheta"),ke("\\weierp","\\wp"),ke("\\Zeta","\\mathrm{Z}"),ke("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),ke("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),ke("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),ke("\\bra","\\mathinner{\\langle{#1}|}"),ke("\\ket","\\mathinner{|{#1}\\rangle}"),ke("\\braket","\\mathinner{\\langle{#1}\\rangle}"),ke("\\Bra","\\left\\langle#1\\right|"),ke("\\Ket","\\left|#1\\right\\rangle");var j5t=t=>e=>{var r=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.consumeArg().tokens,s=e.macros.get("|"),o=e.macros.get("\\|");e.macros.beginGroup();var l=d=>f=>{t&&(f.macros.set("|",s),i.length&&f.macros.set("\\|",o));var p=d;if(!d&&i.length){var g=f.future();g.text==="|"&&(f.popToken(),p=!0)}return{tokens:p?i:n,numArgs:0}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var u=e.consumeArg().tokens,h=e.expandTokens([...a,...u,...r]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};ke("\\bra@ket",j5t(!1)),ke("\\bra@set",j5t(!0)),ke("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),ke("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),ke("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),ke("\\angln","{\\angl n}"),ke("\\blue","\\textcolor{##6495ed}{#1}"),ke("\\orange","\\textcolor{##ffa500}{#1}"),ke("\\pink","\\textcolor{##ff00af}{#1}"),ke("\\red","\\textcolor{##df0030}{#1}"),ke("\\green","\\textcolor{##28ae7b}{#1}"),ke("\\gray","\\textcolor{gray}{#1}"),ke("\\purple","\\textcolor{##9d38bd}{#1}"),ke("\\blueA","\\textcolor{##ccfaff}{#1}"),ke("\\blueB","\\textcolor{##80f6ff}{#1}"),ke("\\blueC","\\textcolor{##63d9ea}{#1}"),ke("\\blueD","\\textcolor{##11accd}{#1}"),ke("\\blueE","\\textcolor{##0c7f99}{#1}"),ke("\\tealA","\\textcolor{##94fff5}{#1}"),ke("\\tealB","\\textcolor{##26edd5}{#1}"),ke("\\tealC","\\textcolor{##01d1c1}{#1}"),ke("\\tealD","\\textcolor{##01a995}{#1}"),ke("\\tealE","\\textcolor{##208170}{#1}"),ke("\\greenA","\\textcolor{##b6ffb0}{#1}"),ke("\\greenB","\\textcolor{##8af281}{#1}"),ke("\\greenC","\\textcolor{##74cf70}{#1}"),ke("\\greenD","\\textcolor{##1fab54}{#1}"),ke("\\greenE","\\textcolor{##0d923f}{#1}"),ke("\\goldA","\\textcolor{##ffd0a9}{#1}"),ke("\\goldB","\\textcolor{##ffbb71}{#1}"),ke("\\goldC","\\textcolor{##ff9c39}{#1}"),ke("\\goldD","\\textcolor{##e07d10}{#1}"),ke("\\goldE","\\textcolor{##a75a05}{#1}"),ke("\\redA","\\textcolor{##fca9a9}{#1}"),ke("\\redB","\\textcolor{##ff8482}{#1}"),ke("\\redC","\\textcolor{##f9685d}{#1}"),ke("\\redD","\\textcolor{##e84d39}{#1}"),ke("\\redE","\\textcolor{##bc2612}{#1}"),ke("\\maroonA","\\textcolor{##ffbde0}{#1}"),ke("\\maroonB","\\textcolor{##ff92c6}{#1}"),ke("\\maroonC","\\textcolor{##ed5fa6}{#1}"),ke("\\maroonD","\\textcolor{##ca337c}{#1}"),ke("\\maroonE","\\textcolor{##9e034e}{#1}"),ke("\\purpleA","\\textcolor{##ddd7ff}{#1}"),ke("\\purpleB","\\textcolor{##c6b9fc}{#1}"),ke("\\purpleC","\\textcolor{##aa87ff}{#1}"),ke("\\purpleD","\\textcolor{##7854ab}{#1}"),ke("\\purpleE","\\textcolor{##543b78}{#1}"),ke("\\mintA","\\textcolor{##f5f9e8}{#1}"),ke("\\mintB","\\textcolor{##edf2df}{#1}"),ke("\\mintC","\\textcolor{##e0e5cc}{#1}"),ke("\\grayA","\\textcolor{##f6f7f7}{#1}"),ke("\\grayB","\\textcolor{##f0f1f2}{#1}"),ke("\\grayC","\\textcolor{##e3e5e6}{#1}"),ke("\\grayD","\\textcolor{##d6d8da}{#1}"),ke("\\grayE","\\textcolor{##babec2}{#1}"),ke("\\grayF","\\textcolor{##888d93}{#1}"),ke("\\grayG","\\textcolor{##626569}{#1}"),ke("\\grayH","\\textcolor{##3b3e40}{#1}"),ke("\\grayI","\\textcolor{##21242c}{#1}"),ke("\\kaBlue","\\textcolor{##314453}{#1}"),ke("\\kaGreen","\\textcolor{##71B307}{#1}");var X5t={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Dxn{constructor(e,r,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=r,this.expansionCount=0,this.feed(e),this.macros=new Exn(_xn,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new H5t(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var r,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;r=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:r,end:n}=this.consumeArg());return this.pushToken(new Xd("EOF",n.loc)),this.pushTokens(i),new Xd("",Uh.range(r,n))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var r=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),a,s=0,o=0;do{if(a=this.popToken(),r.push(a),a.text==="{")++s;else if(a.text==="}"){if(--s,s===-1)throw new Zt("Extra }",a)}else if(a.text==="EOF")throw new Zt("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",a);if(e&&n)if((s===0||s===1&&e[o]==="{")&&a.text===e[o]){if(++o,o===e.length){r.splice(-o,o);break}}else o=0}while(s!==0||n);return i.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:i,end:a}}consumeArgs(e,r){if(r){if(r.length!==e+1)throw new Zt("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;ithis.settings.maxExpand)throw new Zt("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var r=this.popToken(),n=r.text,i=r.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new Zt("Undefined control sequence: "+n);return this.pushToken(r),!1}this.countExpansion(1);var a=i.tokens,s=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var o=a.length-1;o>=0;--o){var l=a[o];if(l.text==="#"){if(o===0)throw new Zt("Incomplete placeholder at end of macro body",l);if(l=a[--o],l.text==="#")a.splice(o+1,1);else if(/^[1-9]$/.test(l.text))a.splice(o,2,...s[+l.text-1]);else throw new Zt("Not a valid argument number",l)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Xd(e)]):void 0}expandTokens(e){var r=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),r.push(i)}return this.countExpansion(r.length),r}expandMacroAsText(e){var r=this.expandMacro(e);return r&&r.map(n=>n.text).join("")}_getExpansion(e){var r=this.macros.get(e);if(r==null)return r;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof r=="function"?r(this):r;if(typeof i=="string"){var a=0;if(i.includes("#"))for(var s=i.replace(/##/g,"");s.includes("#"+(a+1));)++a;for(var o=new H5t(i,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var h={tokens:l,numArgs:a};return h}return i}isDefined(e){return this.macros.has(e)||A2.hasOwnProperty(e)||gs.math.hasOwnProperty(e)||gs.text.hasOwnProperty(e)||X5t.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:A2.hasOwnProperty(e)&&!A2[e].primitive}}var K5t=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,DZ=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),fTe={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},Z5t={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let J5t=class UZt{constructor(e,r){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Dxn(e,r,this.mode),this.settings=r,this.leftrightDepth=0,this.nextToken=null}expect(e,r){if(r===void 0&&(r=!0),this.fetch().text!==e)throw new Zt("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());r&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var r=this.nextToken;this.consume(),this.gullet.pushToken(new Xd("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=r,n}parseExpression(e,r){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(UZt.endOfExpression.has(i.text)||r&&i.text===r||e&&A2[i.text]&&A2[i.text].infix)break;var a=this.parseAtom(r);if(a){if(a.type==="internal")continue}else break;n.push(a)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var r=-1,n,i=0;i=128)this.settings.strict&&(x_t(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),e)),s={type:"textord",mode:"text",loc:Uh.range(e),text:r};else return null;if(this.consume(),a)for(var h=0;h0){if(++e>=x2n)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Z4(t){return function(){return t}}var IZ=function(){try{var t=uC(Object,"defineProperty");return t({},"",{}),t}catch{}}(),S2n=IZ?function(t,e){return IZ(t,"toString",{configurable:!0,enumerable:!1,value:Z4(e),writable:!0})}:lC,v4t=T2n(S2n);function y4t(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}var _2n=9007199254740991,R2n=/^(?:0|[1-9]\d*)$/;function PZ(t,e){var r=typeof t;return e=e??_2n,!!e&&(r=="number"||r!="symbol"&&R2n.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=M2n}function T2(t){return t!=null&&yTe(t.length)&&!H$(t)}function Y$(t,e,r){if(!Kd(r))return!1;var n=typeof e;return(n=="number"?T2(r)&&PZ(e,r.length):n=="string"&&e in r)?J4(r[e],t):!1}function I2n(t){return $Z(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&Y$(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}function Qwn(t,e){var r=this.__data__,n=VZ(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function g1(t){var e=-1,r=t==null?0:t.length;for(this.clear();++eo))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&qTn?new J$:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&Y$(e[0],e[1],i)&&(n=1);++r-1?i[a?e[s]:s]:void 0}}var BSn=Math.max;function $Sn(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:e2n(r);return i<0&&(i=BSn(n+i,0)),b4t(t,S2(e),i)}var $Te=NSn($Sn);function y3t(t,e){var r=-1,n=T2(t)?Array(t.length):[];return qZ(t,function(i,a,s){n[++r]=e(i,a,s)}),n}function Bo(t,e){var r=No(t)?K4:y3t;return r(t,S2(e))}function FSn(t,e){return t==null?t:MTe(t,BTe(e),hC)}function zSn(t,e){return t&&ITe(t,BTe(e))}function USn(t,e){return t>e}var VSn=Object.prototype,QSn=VSn.hasOwnProperty;function GSn(t,e){return t!=null&&QSn.call(t,e)}function b3t(t,e){return t!=null&&f3t(t,e,GSn)}function HSn(t,e){return K4(e,function(r){return t[r]})}function y1(t){return t==null?[]:HSn(t,Zd(t))}var WSn="[object Map]",YSn="[object Set]",qSn=Object.prototype,jSn=qSn.hasOwnProperty;function x3t(t){if(t==null)return!0;if(T2(t)&&(No(t)||typeof t=="string"||typeof t.splice=="function"||t3(t)||UZ(t)||e3(t)))return!t.length;var e=dp(t);if(e==WSn||e==YSn)return!t.size;if(FZ(t))return!D4t(t).length;for(var r in t)if(jSn.call(t,r))return!1;return!0}function ho(t){return t===void 0}function w3t(t,e){return te||a&&s&&l&&!o&&!u||n&&s&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&t=o)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return t.index-e.index}function tCn(t,e,r){e.length?e=K4(e,function(a){return No(a)?function(s){return HZ(s,a.length===1?a[0]:a)}:a}):e=[lC];var n=-1;e=K4(e,zZ(S2));var i=y3t(t,function(a,s,o){var l=K4(e,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return ZSn(i,function(a,s){return eCn(a,s,r)})}function rCn(t,e){return KSn(t,e,function(r,n){return p3t(t,n)})}var KZ=iAn(function(t,e){return t==null?{}:rCn(t,e)}),nCn=Math.ceil,iCn=Math.max;function aCn(t,e,r,n){for(var i=-1,a=iCn(nCn((e-t)/(r||1)),0),s=Array(a);a--;)s[++i]=t,t+=r;return s}function sCn(t){return function(e,r,n){return n&&typeof n!="number"&&Y$(e,r,n)&&(r=n=void 0),e=MZ(e),r===void 0?(r=e,e=0):r=MZ(r),n=n===void 0?e1&&Y$(t,e[0],e[1])?e=[]:r>2&&Y$(e[0],e[1],e[2])&&(e=[e[0]]),tCn(t,TTe(e),[])}),lCn=1/0,cCn=i3&&1/RTe(new i3([,-0]))[1]==lCn?function(t){return new i3(t)}:b2n,uCn=200;function hCn(t,e,r){var n=-1,i=E2n,a=t.length,s=!0,o=[],l=o;if(a>=uCn){var u=cCn(t);if(u)return RTe(u);s=!1,i=a3t,l=new J$}else l=o;e:for(;++n1?i.setNode(a,r):i.setNode(a)}),this}setNode(e,r){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=pC,this._children[e]={},this._children[pC][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 Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var r=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],_t(this.children(e),n=>{this.setParent(n)}),delete this._children[e]),_t(Zd(this._in[e]),r),delete this._in[e],delete this._preds[e],_t(Zd(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(ho(r))r=pC;else{r+="";for(var n=r;!ho(n);n=this.parent(n))if(n===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var r=this._parent[e];if(r!==pC)return r}}children(e){if(ho(e)&&(e=pC),this._isCompound){var r=this._children[e];if(r)return Zd(r)}else{if(e===pC)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return Zd(r)}successors(e){var r=this._sucs[e];if(r)return Zd(r)}neighbors(e){var r=this.predecessors(e);if(r)return dCn(r,this.successors(e))}isLeaf(e){var r;return this.isDirected()?r=this.successors(e):r=this.neighbors(e),r.length===0}filterNodes(e){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;_t(this._nodes,function(s,o){e(o)&&r.setNode(o,s)}),_t(this._edgeObjs,function(s){r.hasNode(s.v)&&r.hasNode(s.w)&&r.setEdge(s,n.edge(s))});var i={};function a(s){var o=n.parent(s);return o===void 0||r.hasNode(o)?(i[s]=o,o):o in i?i[o]:a(o)}return this._isCompound&&_t(r.nodes(),function(s){r.setParent(s,a(s))}),r}setDefaultEdgeLabel(e){return H$(e)||(e=Z4(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return y1(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return t9(e,function(a,s){return i.length>1?n.setEdge(a,s,r):n.setEdge(a,s),s}),this}setEdge(){var e,r,n,i,a=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(e=s.v,r=s.w,n=s.name,arguments.length===2&&(i=arguments[1],a=!0)):(e=s,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),e=""+e,r=""+r,ho(n)||(n=""+n);var o=n9(this._isDirected,e,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return a&&(this._edgeLabels[o]=i),this;if(!ho(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[o]=a?i:this._defaultEdgeLabelFn(e,r,n);var l=vCn(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[o]=l,T3t(this._preds[r],e),T3t(this._sucs[e],r),this._in[r][o]=l,this._out[e][o]=l,this._edgeCount++,this}edge(e,r,n){var i=arguments.length===1?QTe(this._isDirected,arguments[0]):n9(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?QTe(this._isDirected,arguments[0]):n9(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?QTe(this._isDirected,arguments[0]):n9(this._isDirected,e,r,n),a=this._edgeObjs[i];return a&&(e=a.v,r=a.w,delete this._edgeLabels[i],delete this._edgeObjs[i],S3t(this._preds[r],e),S3t(this._sucs[e],r),delete this._in[r][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,r){var n=this._in[e];if(n){var i=y1(n);return r?v1(i,function(a){return a.v===r}):i}}outEdges(e,r){var n=this._out[e];if(n){var i=y1(n);return r?v1(i,function(a){return a.w===r}):i}}nodeEdges(e,r){var n=this.inEdges(e,r);if(n)return n.concat(this.outEdges(e,r))}}ru.prototype._nodeCount=0,ru.prototype._edgeCount=0;function T3t(t,e){t[e]?t[e]++:t[e]=1}function S3t(t,e){--t[e]||delete t[e]}function n9(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}return i+A3t+a+A3t+(ho(n)?mCn:n)}function vCn(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}var o={v:i,w:a};return n&&(o.name=n),o}function QTe(t,e){return n9(t,e.v,e.w,e.name)}function b1(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:yCn(t),edges:bCn(t)};return ho(t.graph())||(e.value=FTn(t.graph())),e}function yCn(t){return Bo(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return ho(r)||(i.value=r),ho(n)||(i.parent=n),i})}function bCn(t){return Bo(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return ho(e.name)||(n.name=e.name),ho(r)||(n.value=r),n})}var Dn=new Map,C2=new Map,C3t=new Map,O3t=C(()=>{C2.clear(),C3t.clear(),Dn.clear()},"clear"),gC=C((t,e)=>{const r=C2.get(e)||[];return me.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),xCn=C((t,e)=>{const r=C2.get(e)||[];return me.info("Descendants of ",e," is ",r),me.info("Edge is ",t),t.v===e||t.w===e?!1:r?r.includes(t.v)||gC(t.v,e)||gC(t.w,e)||r.includes(t.w):(me.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),GTe=C((t,e,r,n)=>{me.warn("Copying children of ",t,"root",n,"data",e.node(t),n);const i=e.children(t)||[];t!==n&&i.push(t),me.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach(a=>{if(e.children(a).length>0)GTe(a,e,r,n);else{const s=e.node(a);me.info("cp ",a," to ",n," with parent ",t),r.setNode(a,s),n!==e.parent(a)&&(me.warn("Setting parent",a,e.parent(a)),r.setParent(a,e.parent(a))),t!==n&&a!==t?(me.debug("Setting parent",a,t),r.setParent(a,t)):(me.info("In copy ",t,"root",n,"data",e.node(t),n),me.debug("Not Setting parent for node=",a,"cluster!==rootId",t!==n,"node!==clusterId",a!==t));const o=e.edges(a);me.debug("Copying Edges",o),o.forEach(l=>{me.info("Edge",l);const u=e.edge(l.v,l.w,l.name);me.info("Edge data",u,n);try{if(xCn(l,n)){const h=C2.get(n)||[],d=h.includes(l.v)||gC(l.v,n)||l.v===n,f=h.includes(l.w)||gC(l.w,n)||l.w===n;if(d&&f)me.info("Copying as ",l.v,l.w,u,l.name),r.setEdge(l.v,l.w,u,l.name),me.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]));else{const p=d?n:l.v,g=f?n:l.w;me.info("Rebinding cross-boundary edge as ",p,g,u,l.name),e.setEdge(p,g,u,l.name)}}else me.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",n," clusterId:",t)}catch(h){me.error(h)}})}me.debug("Removing node",a),e.removeNode(a)})},"copy"),k3t=C((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)C3t.set(i,t),n=[...n,...k3t(i,e)];return n},"extractDescendants"),wCn=C((t,e,r)=>{const n=t.edges().filter(l=>l.v===e||l.w===e),i=t.edges().filter(l=>l.v===r||l.w===r),a=n.map(l=>({v:l.v===e?r:l.v,w:l.w===e?e:l.w})),s=i.map(l=>({v:l.v,w:l.w}));return a.filter(l=>s.some(u=>l.v===u.v&&l.w===u.w))},"findCommonEdges"),s3=C((t,e,r)=>{const n=e.children(t);if(me.trace("Searching children of id ",t,n),n.length<1)return t;let i;for(const a of n){const s=s3(a,e,r),o=wCn(e,r,s);if(s)if(o.length>0)i=s;else return s}return i},"findNonClusterChild"),E3t=C(t=>!Dn.has(t)||!Dn.get(t).externalConnections?t:Dn.has(t)?Dn.get(t).id:t,"getAnchorId"),ACn=C((t,e)=>{var r;if(!t||e>10){me.debug("Opting out, no graph ");return}else me.debug("Opting in, graph ");t.nodes().forEach(function(n){t.children(n).length>0&&(me.warn("Cluster identified",n," Replacement id in edges: ",s3(n,t,n)),C2.set(n,k3t(n,t)),Dn.set(n,{id:s3(n,t,n),clusterData:t.node(n)}))}),t.nodes().forEach(function(n){const i=t.children(n),a=t.edges();i.length>0?(me.debug("Cluster identified",n,C2),a.forEach(s=>{const o=gC(s.v,n),l=gC(s.w,n);o^l&&(me.warn("Edge: ",s," leaves cluster ",n),me.warn("Descendants of XXX ",n,": ",C2.get(n)),Dn.get(n).externalConnections=!0)})):me.debug("Not a cluster ",n,C2)});for(let n of Dn.keys()){const i=Dn.get(n).id,a=t.parent(i);a!==n&&Dn.has(a)&&!Dn.get(a).externalConnections&&(Dn.get(n).id=a);const s=t.edges().some(o=>o.v===n);if(i&&((r=Dn.get(n))!=null&&r.externalConnections)&&s&&D3t(t,i,n)){const o=SCn(t,n,t.parent(i));o&&(Dn.get(n).id=o)}}t.edges().forEach(function(n){const i=t.edge(n);me.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),me.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(t.edge(n)));let a=n.v,s=n.w;if(me.warn("Fix XXX",Dn,"ids:",n.v,n.w,"Translating: ",Dn.get(n.v)," --- ",Dn.get(n.w)),Dn.get(n.v)||Dn.get(n.w)){if(me.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),a=E3t(n.v),s=E3t(n.w),t.removeEdge(n.v,n.w,n.name),a!==n.v){const o=t.parent(a);Dn.get(o).externalConnections=!0,i.fromCluster=n.v}if(s!==n.w){const o=t.parent(s);Dn.get(o).externalConnections=!0,i.toCluster=n.w}me.warn("Fix Replacing with XXX",a,s,n.name),t.setEdge(a,s,i,n.name)}}),me.warn("Adjusted Graph",b1(t)),_3t(t,0),me.trace(Dn)},"adjustClustersAndEdges"),_3t=C((t,e)=>{var i,a,s,o;if(me.warn("extractor - ",e,b1(t),t.children("D")),e>10){me.error("Bailing out");return}let r=t.nodes(),n=!1;for(const l of r){const u=t.children(l);n=n||u.length>0}if(!n){me.debug("Done, no node has children",t.nodes());return}me.debug("Nodes = ",r,e);for(const l of r)if(me.debug("Extracting node",l,Dn,Dn.has(l)&&!Dn.get(l).externalConnections,!t.parent(l),t.node(l),t.children("D")," Depth ",e),!Dn.has(l))me.debug("Not a cluster",l,e);else if((a=(i=Dn.get(l))==null?void 0:i.clusterData)!=null&&a.explicitDir&&t.children(l)&&t.children(l).length>0){me.warn("Cluster with explicit dir, creating subgraph for children",l,e);const u=Dn.get(l).clusterData.dir,h=new ru({multigraph:!0,compound:!0}).setGraph({rankdir:u,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});GTe(l,t,h,l);const d=t.node(l)||{};t.setNode(l,{...d,clusterNode:!0,id:l,clusterData:Dn.get(l).clusterData,label:Dn.get(l).label,graph:h}),me.warn("Subgraph for cluster with explicit dir created:",l,b1(h))}else if(!Dn.get(l).externalConnections&&t.children(l)&&t.children(l).length>0){me.warn("Cluster without external connections, without a parent and with children",l,e);let h=t.graph().rankdir==="TB"?"LR":"TB";(o=(s=Dn.get(l))==null?void 0:s.clusterData)!=null&&o.dir&&(h=Dn.get(l).clusterData.dir,me.warn("Fixing dir",Dn.get(l).clusterData.dir,h));const d=new ru({multigraph:!0,compound:!0}).setGraph({rankdir:h,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});GTe(l,t,d,l);const f=t.node(l)||{};t.setNode(l,{...f,clusterNode:!0,id:l,clusterData:Dn.get(l).clusterData,label:Dn.get(l).label,graph:d}),me.debug("Old graph after copy",b1(t))}else me.warn("Cluster ** ",l," **not meeting the criteria !externalConnections:",!Dn.get(l).externalConnections," no parent: ",!t.parent(l)," children ",t.children(l)&&t.children(l).length>0,t.children("D"),e),me.debug(Dn);r=t.nodes(),me.warn("New list of nodes",r);for(const l of r){const u=t.node(l);me.warn(" Now next level",l,u),u!=null&&u.clusterNode&&_3t(u.graph,e+1)}},"extractor"),R3t=C((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),a=R3t(t,i);r=[...r,...a]}),r},"sorter"),TCn=C(t=>R3t(t,t.children()),"sortNodesByHierarchy"),D3t=C((t,e,r)=>{let n=t.parent(e);for(;n&&n!==r;){const i=Dn.get(n);if(i&&!i.externalConnections)return!0;n=t.parent(n)}return!1},"isNodeInExtractableCluster"),SCn=C((t,e,r)=>{const n=t.children(e)??[];for(const i of n){if(i===r||gC(i,r))continue;const a=s3(i,t,e);if(a&&!D3t(t,a,e))return a}return null},"findSafeAnchorNode");class CCn{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return L3t(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&L3t(e),e._next=r._next,r._next._prev=e,r._next=e,e._prev=r}toString(){for(var e=[],r=this._sentinel,n=r._prev;n!==r;)e.push(JSON.stringify(n,OCn)),n=n._prev;return"["+e.join(", ")+"]"}}function L3t(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function OCn(t,e){if(t!=="_next"&&t!=="_prev")return e}var kCn=Z4(1);function ECn(t,e){if(t.nodeCount()<=1)return[];var r=RCn(t,e||kCn),n=_Cn(r.graph,r.buckets,r.zeroIdx);return n3(Bo(n,function(i){return t.outEdges(i.v,i.w)}))}function _Cn(t,e,r){for(var n=[],i=e[e.length-1],a=e[0],s;t.nodeCount();){for(;s=a.dequeue();)HTe(t,e,r,s);for(;s=i.dequeue();)HTe(t,e,r,s);if(t.nodeCount()){for(var o=e.length-2;o>0;--o)if(s=e[o].dequeue(),s){n=n.concat(HTe(t,e,r,s,!0));break}}}return n}function HTe(t,e,r,n,i){var a=i?[]:void 0;return _t(t.inEdges(n.v),function(s){var o=t.edge(s),l=t.node(s.v);i&&a.push({v:s.v,w:s.w}),l.out-=o,WTe(e,r,l)}),_t(t.outEdges(n.v),function(s){var o=t.edge(s),l=s.w,u=t.node(l);u.in-=o,WTe(e,r,u)}),t.removeNode(n.v),a}function RCn(t,e){var r=new ru,n=0,i=0;_t(t.nodes(),function(o){r.setNode(o,{v:o,in:0,out:0})}),_t(t.edges(),function(o){var l=r.edge(o.v,o.w)||0,u=e(o),h=l+u;r.setEdge(o.v,o.w,h),i=Math.max(i,r.node(o.v).out+=u),n=Math.max(n,r.node(o.w).in+=u)});var a=a3(i+n+3).map(function(){return new CCn}),s=n+1;return _t(r.nodes(),function(o){WTe(a,s,r.node(o))}),{graph:r,buckets:a,zeroIdx:s}}function WTe(t,e,r){r.out?r.in?t[r.out-r.in+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}function DCn(t){var e=t.graph().acyclicer==="greedy"?ECn(t,r(t)):LCn(t);_t(e,function(n){var i=t.edge(n);t.removeEdge(n),i.forwardName=n.name,i.reversed=!0,t.setEdge(n.w,n.v,i,VTe("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function LCn(t){var e=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,_t(t.outEdges(a),function(s){Object.prototype.hasOwnProperty.call(r,s.w)?e.push(s):i(s.w)}),delete r[a])}return _t(t.nodes(),i),e}function MCn(t){_t(t.edges(),function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}function o3(t,e,r,n){var i;do i=VTe(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function ICn(t){var e=new ru().setGraph(t.graph());return _t(t.nodes(),function(r){e.setNode(r,t.node(r))}),_t(t.edges(),function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},i=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),e}function M3t(t){var e=new ru({multigraph:t.isMultigraph()}).setGraph(t.graph());return _t(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),_t(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function I3t(t,e){var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=o*i/a,u=o):(i<0&&(s=-s),l=s,u=s*a/i),{x:r+l,y:n+u}}function ZZ(t){var e=Bo(a3(N3t(t)+1),function(){return[]});return _t(t.nodes(),function(r){var n=t.node(r),i=n.rank;ho(i)||(e[i][n.order]=r)}),e}function PCn(t){var e=e9(Bo(t.nodes(),function(r){return t.node(r).rank}));_t(t.nodes(),function(r){var n=t.node(r);b3t(n,"rank")&&(n.rank-=e)})}function NCn(t){var e=e9(Bo(t.nodes(),function(a){return t.node(a).rank})),r=[];_t(t.nodes(),function(a){var s=t.node(a).rank-e;r[s]||(r[s]=[]),r[s].push(a)});var n=0,i=t.graph().nodeRankFactor;_t(r,function(a,s){ho(a)&&s%i!==0?--n:n&&_t(a,function(o){t.node(o).rank+=n})})}function P3t(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),o3(t,"border",i,e)}function N3t(t){return fC(Bo(t.nodes(),function(e){var r=t.node(e).rank;if(!ho(r))return r}))}function BCn(t,e){var r={lhs:[],rhs:[]};return _t(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function $Cn(t,e){return e()}function FCn(t){function e(r){var n=t.children(r),i=t.node(r);if(n.length&&_t(n,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,s=i.maxRank+1;as.lim&&(o=s,l=!0);var u=v1(e.edges(),function(h){return l===q3t(t,t.node(h.v),o)&&l!==q3t(t,t.node(h.w),o)});return UTe(u,function(h){return i9(e,h)})}function Y3t(t,e,r,n){var i=r.v,a=r.w;t.removeEdge(i,a),t.setEdge(n.v,n.w,{}),KTe(t),XTe(t,e),eOn(t,e)}function eOn(t,e){var r=$Te(t.nodes(),function(i){return!e.node(i).parent}),n=ZCn(t,r);n=n.slice(1),_t(n,function(i){var a=t.node(i).parent,s=e.edge(i,a),o=!1;s||(s=e.edge(a,i),o=!0),e.node(i).rank=e.node(a).rank+(o?s.minlen:-s.minlen)})}function tOn(t,e,r){return t.hasEdge(e,r)}function q3t(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function rOn(t){switch(t.graph().ranker){case"network-simplex":j3t(t);break;case"tight-tree":iOn(t);break;case"longest-path":nOn(t);break;default:j3t(t)}}var nOn=jTe;function iOn(t){jTe(t),z3t(t)}function j3t(t){mC(t)}function aOn(t){var e=o3(t,"root",{},"_root"),r=sOn(t),n=fC(y1(r))-1,i=2*n+1;t.graph().nestingRoot=e,_t(t.edges(),function(s){t.edge(s).minlen*=i});var a=oOn(t)+1;_t(t.children(),function(s){X3t(t,e,i,a,n,r,s)}),t.graph().nodeRankFactor=i}function X3t(t,e,r,n,i,a,s){var o=t.children(s);if(!o.length){s!==e&&t.setEdge(e,s,{weight:0,minlen:r});return}var l=P3t(t,"_bt"),u=P3t(t,"_bb"),h=t.node(s);t.setParent(l,s),h.borderTop=l,t.setParent(u,s),h.borderBottom=u,_t(o,function(d){X3t(t,e,r,n,i,a,d);var f=t.node(d),p=f.borderTop?f.borderTop:d,g=f.borderBottom?f.borderBottom:d,m=f.borderTop?n:2*n,v=p!==g?1:i-a[s]+1;t.setEdge(l,p,{weight:m,minlen:v,nestingEdge:!0}),t.setEdge(g,u,{weight:m,minlen:v,nestingEdge:!0})}),t.parent(s)||t.setEdge(e,l,{weight:0,minlen:i+a[s]})}function sOn(t){var e={};function r(n,i){var a=t.children(n);a&&a.length&&_t(a,function(s){r(s,i+1)}),e[n]=i}return _t(t.children(),function(n){r(n,1)}),e}function oOn(t){return t9(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function lOn(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,_t(t.edges(),function(r){var n=t.edge(r);n.nestingEdge&&t.removeEdge(r)})}function cOn(t,e,r){var n={},i;_t(r,function(a){for(var s=t.parent(a),o,l;s;){if(o=t.parent(s),o?(l=n[o],n[o]=s):(l=i,i=s),l&&l!==s){e.setEdge(l,s);return}s=o}})}function uOn(t,e,r){var n=hOn(t),i=new ru({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return t.node(a)});return _t(t.nodes(),function(a){var s=t.node(a),o=t.parent(a);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(i.setNode(a),i.setParent(a,o||n),_t(t[r](a),function(l){var u=l.v===a?l.w:l.v,h=i.edge(u,a),d=ho(h)?0:h.weight;i.setEdge(u,a,{weight:t.edge(l).weight+d})}),Object.prototype.hasOwnProperty.call(s,"minRank")&&i.setNode(a,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))}),i}function hOn(t){for(var e;t.hasNode(e=VTe("_root")););return e}function dOn(t,e){for(var r=0,n=1;n0;)h%2&&(d+=o[h+1]),h=h-1>>1,o[h]+=u.weight;l+=u.weight*d})),l}function pOn(t){var e={},r=v1(t.nodes(),function(o){return!t.children(o).length}),n=fC(Bo(r,function(o){return t.node(o).rank})),i=Bo(a3(n+1),function(){return[]});function a(o){if(!b3t(e,o)){e[o]=!0;var l=t.node(o);i[l.rank].push(o),_t(t.successors(o),a)}}var s=r9(r,function(o){return t.node(o).rank});return _t(s,a),i}function gOn(t,e){return Bo(e,function(r){var n=t.inEdges(r);if(n.length){var i=t9(n,function(a,s){var o=t.edge(s),l=t.node(s.v);return{sum:a.sum+o.weight*l.order,weight:a.weight+o.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function mOn(t,e){var r={};_t(t,function(i,a){var s=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};ho(i.barycenter)||(s.barycenter=i.barycenter,s.weight=i.weight)}),_t(e.edges(),function(i){var a=r[i.v],s=r[i.w];!ho(a)&&!ho(s)&&(s.indegree++,a.out.push(r[i.w]))});var n=v1(r,function(i){return!i.indegree});return vOn(n)}function vOn(t){var e=[];function r(a){return function(s){s.merged||(ho(s.barycenter)||ho(a.barycenter)||s.barycenter>=a.barycenter)&&yOn(a,s)}}function n(a){return function(s){s.in.push(a),--s.indegree===0&&t.push(s)}}for(;t.length;){var i=t.pop();e.push(i),_t(i.in.reverse(),r(i)),_t(i.out,n(i))}return Bo(v1(e,function(a){return!a.merged}),function(a){return KZ(a,["vs","i","barycenter","weight"])})}function yOn(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}function bOn(t,e){var r=BCn(t,function(h){return Object.prototype.hasOwnProperty.call(h,"barycenter")}),n=r.lhs,i=r9(r.rhs,function(h){return-h.i}),a=[],s=0,o=0,l=0;n.sort(xOn(!!e)),l=K3t(a,i,l),_t(n,function(h){l+=h.vs.length,a.push(h.vs),s+=h.barycenter*h.weight,o+=h.weight,l=K3t(a,i,l)});var u={vs:n3(a)};return o&&(u.barycenter=s/o,u.weight=o),u}function K3t(t,e,r){for(var n;e.length&&(n=jZ(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function xOn(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}function Z3t(t,e,r,n){var i=t.children(e),a=t.node(e),s=a?a.borderLeft:void 0,o=a?a.borderRight:void 0,l={};s&&(i=v1(i,function(g){return g!==s&&g!==o}));var u=gOn(t,i);_t(u,function(g){if(t.children(g.v).length){var m=Z3t(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&AOn(g,m)}});var h=mOn(u,r);wOn(h,l);var d=bOn(h,n);if(s&&(d.vs=n3([s,d.vs,o]),t.predecessors(s).length)){var f=t.node(t.predecessors(s)[0]),p=t.node(t.predecessors(o)[0]);Object.prototype.hasOwnProperty.call(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function wOn(t,e){_t(t,function(r){r.vs=n3(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function AOn(t,e){ho(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}function TOn(t){var e=N3t(t),r=J3t(t,a3(1,e+1),"inEdges"),n=J3t(t,a3(e-1,-1,-1),"outEdges"),i=pOn(t);eRt(t,i);for(var a=Number.POSITIVE_INFINITY,s,o=0,l=0;l<4;++o,++l){SOn(o%2?r:n,o%4>=2),i=ZZ(t);var u=dOn(t,i);us||o>e[l].lim));for(u=l,l=n;(l=t.parent(l))!==u;)a.push(l);return{path:i.concat(a.reverse()),lca:u}}function kOn(t){var e={},r=0;function n(i){var a=r;_t(t.children(i),n),e[i]={low:a,lim:r++}}return _t(t.children(),n),e}function EOn(t,e){var r={};function n(i,a){var s=0,o=0,l=i.length,u=jZ(a);return _t(a,function(h,d){var f=ROn(t,h),p=f?t.node(f).order:l;(f||h===u)&&(_t(a.slice(o,d+1),function(g){_t(t.predecessors(g),function(m){var v=t.node(m),y=v.order;(yu)&&tRt(r,f,h)})})}function i(a,s){var o=-1,l,u=0;return _t(s,function(h,d){if(t.node(h).dummy==="border"){var f=t.predecessors(h);f.length&&(l=t.node(f[0]).order,n(s,u,d,o,l),u=d,o=l)}n(s,u,s.length,l,a.length)}),s}return t9(e,i),r}function ROn(t,e){if(t.node(e).dummy)return $Te(t.predecessors(e),function(r){return t.node(r).dummy})}function tRt(t,e,r){if(e>r){var n=e;e=r,r=n}Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=t[e];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function DOn(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function LOn(t,e,r,n){var i={},a={},s={};return _t(e,function(o){_t(o,function(l,u){i[l]=l,a[l]=l,s[l]=u})}),_t(e,function(o){var l=-1;_t(o,function(u){var h=n(u);if(h.length){h=r9(h,function(m){return s[m]});for(var d=(h.length-1)/2,f=Math.floor(d),p=Math.ceil(d);f<=p;++f){var g=h[f];a[u]===u&&l{var n=r(" buildLayoutGraph",()=>JOn(t));r(" runLayout",()=>QOn(n,r)),r(" updateInputGraph",()=>GOn(t,n))})}function QOn(t,e){e(" makeSpaceForEdgeLabels",()=>ekn(t)),e(" removeSelfEdges",()=>ckn(t)),e(" acyclic",()=>DCn(t)),e(" nestingGraph.run",()=>aOn(t)),e(" rank",()=>rOn(M3t(t))),e(" injectEdgeLabelProxies",()=>tkn(t)),e(" removeEmptyRanks",()=>NCn(t)),e(" nestingGraph.cleanup",()=>lOn(t)),e(" normalizeRanks",()=>PCn(t)),e(" assignRankMinMax",()=>rkn(t)),e(" removeEdgeLabelProxies",()=>nkn(t)),e(" normalize.run",()=>GCn(t)),e(" parentDummyChains",()=>COn(t)),e(" addBorderSegments",()=>FCn(t)),e(" order",()=>TOn(t)),e(" insertSelfEdges",()=>ukn(t)),e(" adjustCoordinateSystem",()=>zCn(t)),e(" position",()=>UOn(t)),e(" positionSelfEdges",()=>hkn(t)),e(" removeBorderNodes",()=>lkn(t)),e(" normalize.undo",()=>WCn(t)),e(" fixupEdgeLabelCoords",()=>skn(t)),e(" undoCoordinateSystem",()=>UCn(t)),e(" translateGraph",()=>ikn(t)),e(" assignNodeIntersects",()=>akn(t)),e(" reversePoints",()=>okn(t)),e(" acyclic.undo",()=>MCn(t))}function GOn(t,e){_t(t.nodes(),function(r){var n=t.node(r),i=e.node(r);n&&(n.x=i.x,n.y=i.y,e.children(r).length&&(n.width=i.width,n.height=i.height))}),_t(t.edges(),function(r){var n=t.edge(r),i=e.edge(r);n.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(n.x=i.x,n.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}var HOn=["nodesep","edgesep","ranksep","marginx","marginy"],WOn={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},YOn=["acyclicer","ranker","rankdir","align"],qOn=["width","height"],jOn={width:0,height:0},XOn=["minlen","weight","width","height","labeloffset"],KOn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},ZOn=["labelpos"];function JOn(t){var e=new ru({multigraph:!0,compound:!0}),r=JTe(t.graph());return e.setGraph(zTe({},WOn,ZTe(r,HOn),KZ(r,YOn))),_t(t.nodes(),function(n){var i=JTe(t.node(n));e.setNode(n,LSn(ZTe(i,qOn),jOn)),e.setParent(n,t.parent(n))}),_t(t.edges(),function(n){var i=JTe(t.edge(n));e.setEdge(n,zTe({},KOn,ZTe(i,XOn),KZ(i,ZOn)))}),e}function ekn(t){var e=t.graph();e.ranksep/=2,_t(t.edges(),function(r){var n=t.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function tkn(t){_t(t.edges(),function(e){var r=t.edge(e);if(r.width&&r.height){var n=t.node(e.v),i=t.node(e.w),a={rank:(i.rank-n.rank)/2+n.rank,e};o3(t,"edge-proxy",a,"_ep")}})}function rkn(t){var e=0;_t(t.nodes(),function(r){var n=t.node(r);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,e=fC(e,n.maxRank))}),t.graph().maxRank=e}function nkn(t){_t(t.nodes(),function(e){var r=t.node(e);r.dummy==="edge-proxy"&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function ikn(t){var e=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=t.graph(),s=a.marginx||0,o=a.marginy||0;function l(u){var h=u.x,d=u.y,f=u.width,p=u.height;e=Math.min(e,h-f/2),r=Math.max(r,h+f/2),n=Math.min(n,d-p/2),i=Math.max(i,d+p/2)}_t(t.nodes(),function(u){l(t.node(u))}),_t(t.edges(),function(u){var h=t.edge(u);Object.prototype.hasOwnProperty.call(h,"x")&&l(h)}),e-=s,n-=o,_t(t.nodes(),function(u){var h=t.node(u);h.x-=e,h.y-=n}),_t(t.edges(),function(u){var h=t.edge(u);_t(h.points,function(d){d.x-=e,d.y-=n}),Object.prototype.hasOwnProperty.call(h,"x")&&(h.x-=e),Object.prototype.hasOwnProperty.call(h,"y")&&(h.y-=n)}),a.width=r-e+s,a.height=i-n+o}function akn(t){_t(t.edges(),function(e){var r=t.edge(e),n=t.node(e.v),i=t.node(e.w),a,s;r.points?(a=r.points[0],s=r.points[r.points.length-1]):(r.points=[],a=i,s=n),r.points.unshift(I3t(n,a)),r.points.push(I3t(i,s))})}function skn(t){_t(t.edges(),function(e){var r=t.edge(e);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function okn(t){_t(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function lkn(t){_t(t.nodes(),function(e){if(t.children(e).length){var r=t.node(e),n=t.node(r.borderTop),i=t.node(r.borderBottom),a=t.node(jZ(r.borderLeft)),s=t.node(jZ(r.borderRight));r.width=Math.abs(s.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),_t(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function ckn(t){_t(t.edges(),function(e){if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function ukn(t){var e=ZZ(t);_t(e,function(r){var n=0;_t(r,function(i,a){var s=t.node(i);s.order=a+n,_t(s.selfEdges,function(o){o3(t,"selfedge",{width:o.label.width,height:o.label.height,rank:s.rank,order:a+ ++n,e:o.e,label:o.label},"_se")}),delete s.selfEdges})})}function hkn(t){_t(t.nodes(),function(e){var r=t.node(e);if(r.dummy==="selfedge"){var n=t.node(r.e.v),i=n.x+n.width/2,a=n.y,s=r.x-i,o=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*s/3,y:a-o},{x:i+5*s/6,y:a-o},{x:i+s,y:a},{x:i+5*s/6,y:a+o},{x:i+2*s/3,y:a+o}],r.label.x=r.x,r.label.y=r.y}})}function ZTe(t,e){return XZ(KZ(t,e),Number)}function JTe(t){var e={};return _t(t,function(r,n){e[n.toLowerCase()]=r}),e}var nRt=C((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),iRt=C((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),dkn=C(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram","shouldMergeSelfLoopSegments"),fkn=C((t,e,r,n,i)=>{const a=[],s=new Set;if(r.forEach(({start:h,end:d})=>{h!==n&&s.add(h),d!==n&&s.add(d)}),s.forEach(h=>{const d=t.node(h);typeof(d==null?void 0:d.x)=="number"&&typeof(d==null?void 0:d.y)=="number"&&a.push(d)}),a.length===0&&r.forEach(({edge:h})=>{(h.points??[]).forEach(d=>{typeof(d==null?void 0:d.x)=="number"&&typeof(d==null?void 0:d.y)=="number"&&a.push(d)})}),a.length===0)return iRt(i);const o=a.reduce((h,d)=>({x:h.x+d.x/a.length,y:h.y+d.y/a.length}),{x:0,y:0}),l=o.x-e.x,u=o.y-e.y;return Math.abs(l)>Math.abs(u)?l>0?"right":"left":Math.abs(u)>0?u>0?"bottom":"top":iRt(i)},"getSelfLoopSide"),pkn=C((t,e="top",r=0,n=0)=>{const i=t.x,a=t.y-r,s=t.width/2,o=t.height/2,l=Math.max(36,Math.min(100,t.width*.8)),u=nRt(Math.max(n,t.width*.35),36,l),h=nRt(Math.min(t.width,t.height)*.45,24,48);switch(e){case"bottom":{const d=a+o;return[{x:i-u/2,y:d},{x:i-u/2,y:d+h},{x:i+u/2,y:d+h},{x:i+u/2,y:d}]}case"right":{const d=i+s;return[{x:d,y:a-u/2},{x:d+h,y:a-u/2},{x:d+h,y:a+u/2},{x:d,y:a+u/2}]}case"left":{const d=i-s;return[{x:d,y:a-u/2},{x:d-h,y:a-u/2},{x:d-h,y:a+u/2},{x:d,y:a+u/2}]}case"top":default:{const d=a-o;return[{x:i-u/2,y:d},{x:i-u/2,y:d-h},{x:i+u/2,y:d-h},{x:i+u/2,y:d}]}}},"getSelfLoopPoints"),gkn=C((t,e,r="top",n=0,i={})=>{const s=t.x,o=t.y-n,l=i.width??0,u=i.height??0;switch(r){case"bottom":return{x:s,y:Math.max(...e.map(h=>h.y))+u/2+4};case"right":return{x:Math.max(...e.map(h=>h.x))+l/2+4,y:o};case"left":return{x:Math.min(...e.map(h=>h.x))-l/2-4,y:o};case"top":default:return{x:s,y:Math.min(...e.map(h=>h.y))-u/2-4}}},"getSelfLoopLabelPosition"),aRt=C((t,e=0,{mergeSelfLoops:r=!0}={})=>{var s;const n=new Map,i=[],a=(s=t.graph())==null?void 0:s.rankdir;return t.edges().forEach(o=>{const l=t.edge(o);if(r&&l.selfLoop){const u=l.selfLoop.id;n.has(u)||n.set(u,[]),n.get(u).push({edge:l,start:o.v,end:o.w})}else i.push({edge:l,start:o.v,end:o.w})}),n.forEach(o=>{if(o.length!==3){o.forEach(b=>i.push(b));return}o.sort((b,x)=>b.edge.selfLoop.order-x.edge.selfLoop.order);const[l,u,h]=o,d=l.edge.originalEdge??u.edge.originalEdge??h.edge.originalEdge??u.edge,f=t.node(d.start);if(!f){o.forEach(b=>i.push(b));return}const p={width:u.edge.width,height:u.edge.height},g=fkn(t,f,o,d.start,a),m=pkn(f,g,e,p.width??0),v=gkn(f,m,g,e,p),y={...u.edge,...d,id:d.id,points:m,start:d.start,end:d.end,x:v.x,y:v.y,width:p.width,height:p.height,labelStyle:u.edge.labelStyle,fromCluster:l.edge.fromCluster??u.edge.fromCluster??h.edge.fromCluster,toCluster:l.edge.toCluster??u.edge.toCluster??h.edge.toCluster};delete y.selfLoop,delete y.originalEdge,i.push({edge:y,start:y.start,end:y.end})}),i},"getEdgesToRender"),sRt=C(async(t,e,r,n,i,a)=>{me.warn("Graph in recursive render:XAX",b1(e),i);const s=e.graph().rankdir;me.trace("Dir in recursive render - dir:",s);const o=t.insert("g").attr("class","root");e.nodes()?me.info("Recursive render XXX",e.nodes()):me.info("No nodes found for",e),e.edges().length>0&&me.info("Recursive edges",e.edge(e.edges()[0]));const l=o.insert("g").attr("class","clusters"),u=o.insert("g").attr("class","edgePaths"),h=o.insert("g").attr("class","edgeLabels"),d=o.insert("g").attr("class","nodes"),f=dkn(r);await Promise.all(e.nodes().map(async function(b){const x=e.node(b);if(i!==void 0){const w=JSON.parse(JSON.stringify(i.clusterData));me.trace(`Setting data for parent cluster XXX +?)[ \r ]*`,uSe="[̀-ͯ]",Oxn=new RegExp(uSe+"+$"),kxn="("+G5t+"+)|"+(Cxn+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(uSe+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(uSe+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+Txn)+("|"+Sxn+")");let H5t=class{constructor(e,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=r,this.tokenRegex=new RegExp(kxn,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,r){this.catcodes[e]=r}lex(){var e=this.input,r=this.tokenRegex.lastIndex;if(r===e.length)return new Xd("EOF",new Uh(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new Zt("Unexpected character: '"+e[r]+"'",new Xd(e[r],new Uh(this,r,r+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=e.indexOf(` +`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new Xd(i,new Uh(this,r,this.tokenRegex.lastIndex))}};class Exn{constructor(e,r){e===void 0&&(e={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Zt("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var r in e)e.hasOwnProperty(r)&&(e[r]==null?delete this.current[r]:this.current[r]=e[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,r,n){if(n===void 0&&(n=!1),n){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][e]=r)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(e)&&(a[e]=this.current[e])}r==null?delete this.current[e]:this.current[e]=r}}var _xn=w5t;ke("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}}),ke("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}}),ke("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}}),ke("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}}),ke("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var r=t.future();return e[0].length===1&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}}),ke("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),ke("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var W5t={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};ke("\\char",function(t){var e=t.popToken(),r,n=0;if(e.text==="'")r=8,e=t.popToken();else if(e.text==='"')r=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new Zt("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=W5t[e.text],n==null||n>=r)throw new Zt("Invalid base-"+r+" digit "+e.text);for(var i;(i=W5t[t.future().text])!=null&&i{var i=t.consumeArg().tokens;if(i.length!==1)throw new Zt("\\newcommand's first argument must be a macro name");var a=i[0].text,s=t.isDefined(a);if(s&&!e)throw new Zt("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!s&&!r)throw new Zt("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var o=0;if(i=t.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",u=t.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Zt("Invalid number of arguments: "+l);o=parseInt(l),i=t.consumeArg().tokens}return s&&n||t.macros.set(a,{tokens:i,numArgs:o}),""};ke("\\newcommand",t=>hSe(t,!1,!0,!1)),ke("\\renewcommand",t=>hSe(t,!0,!1,!1)),ke("\\providecommand",t=>hSe(t,!0,!0,!0)),ke("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""}),ke("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""}),ke("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),A2[r],gs.math[r],gs.text[r]),""}),ke("\\bgroup","{"),ke("\\egroup","}"),ke("~","\\nobreakspace"),ke("\\lq","`"),ke("\\rq","'"),ke("\\aa","\\r a"),ke("\\AA","\\r A"),ke("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),ke("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),ke("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),ke("ℬ","\\mathscr{B}"),ke("ℰ","\\mathscr{E}"),ke("ℱ","\\mathscr{F}"),ke("ℋ","\\mathscr{H}"),ke("ℐ","\\mathscr{I}"),ke("ℒ","\\mathscr{L}"),ke("ℳ","\\mathscr{M}"),ke("ℛ","\\mathscr{R}"),ke("ℭ","\\mathfrak{C}"),ke("ℌ","\\mathfrak{H}"),ke("ℨ","\\mathfrak{Z}"),ke("\\Bbbk","\\Bbb{k}"),ke("\\llap","\\mathllap{\\textrm{#1}}"),ke("\\rlap","\\mathrlap{\\textrm{#1}}"),ke("\\clap","\\mathclap{\\textrm{#1}}"),ke("\\mathstrut","\\vphantom{(}"),ke("\\underbar","\\underline{\\text{#1}}"),ke("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}'),ke("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),ke("\\ne","\\neq"),ke("≠","\\neq"),ke("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),ke("∉","\\notin"),ke("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),ke("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),ke("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),ke("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),ke("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),ke("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),ke("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),ke("⟂","\\perp"),ke("‼","\\mathclose{!\\mkern-0.8mu!}"),ke("∌","\\notni"),ke("⌜","\\ulcorner"),ke("⌝","\\urcorner"),ke("⌞","\\llcorner"),ke("⌟","\\lrcorner"),ke("©","\\copyright"),ke("®","\\textregistered"),ke("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),ke("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),ke("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),ke("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),ke("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),ke("⋮","\\vdots"),ke("\\varGamma","\\mathit{\\Gamma}"),ke("\\varDelta","\\mathit{\\Delta}"),ke("\\varTheta","\\mathit{\\Theta}"),ke("\\varLambda","\\mathit{\\Lambda}"),ke("\\varXi","\\mathit{\\Xi}"),ke("\\varPi","\\mathit{\\Pi}"),ke("\\varSigma","\\mathit{\\Sigma}"),ke("\\varUpsilon","\\mathit{\\Upsilon}"),ke("\\varPhi","\\mathit{\\Phi}"),ke("\\varPsi","\\mathit{\\Psi}"),ke("\\varOmega","\\mathit{\\Omega}"),ke("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),ke("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),ke("\\boxed","\\fbox{$\\displaystyle{#1}$}"),ke("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),ke("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),ke("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),ke("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),ke("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var Y5t={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},Rxn=new Set(["bin","rel"]);ke("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in Y5t?e=Y5t[r]:(r.slice(0,4)==="\\not"||r in gs.math&&Rxn.has(gs.math[r].group))&&(e="\\dotsb"),e});var dSe={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};ke("\\dotso",function(t){var e=t.future().text;return e in dSe?"\\ldots\\,":"\\ldots"}),ke("\\dotsc",function(t){var e=t.future().text;return e in dSe&&e!==","?"\\ldots\\,":"\\ldots"}),ke("\\cdots",function(t){var e=t.future().text;return e in dSe?"\\@cdots\\,":"\\@cdots"}),ke("\\dotsb","\\cdots"),ke("\\dotsm","\\cdots"),ke("\\dotsi","\\!\\cdots"),ke("\\dotsx","\\ldots\\,"),ke("\\DOTSI","\\relax"),ke("\\DOTSB","\\relax"),ke("\\DOTSX","\\relax"),ke("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),ke("\\,","\\tmspace+{3mu}{.1667em}"),ke("\\thinspace","\\,"),ke("\\>","\\mskip{4mu}"),ke("\\:","\\tmspace+{4mu}{.2222em}"),ke("\\medspace","\\:"),ke("\\;","\\tmspace+{5mu}{.2777em}"),ke("\\thickspace","\\;"),ke("\\!","\\tmspace-{3mu}{.1667em}"),ke("\\negthinspace","\\!"),ke("\\negmedspace","\\tmspace-{4mu}{.2222em}"),ke("\\negthickspace","\\tmspace-{5mu}{.277em}"),ke("\\enspace","\\kern.5em "),ke("\\enskip","\\hskip.5em\\relax"),ke("\\quad","\\hskip1em\\relax"),ke("\\qquad","\\hskip2em\\relax"),ke("\\tag","\\@ifstar\\tag@literal\\tag@paren"),ke("\\tag@paren","\\tag@literal{({#1})}"),ke("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new Zt("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),ke("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),ke("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),ke("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),ke("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),ke("\\newline","\\\\\\relax"),ke("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var q5t=ir(A0["Main-Regular"][84][1]-.7*A0["Main-Regular"][65][1]);ke("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+q5t+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),ke("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+q5t+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),ke("\\hspace","\\@ifstar\\@hspacer\\@hspace"),ke("\\@hspace","\\hskip #1\\relax"),ke("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),ke("\\ordinarycolon",":"),ke("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),ke("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),ke("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),ke("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),ke("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),ke("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),ke("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),ke("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),ke("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),ke("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),ke("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),ke("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),ke("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),ke("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),ke("∷","\\dblcolon"),ke("∹","\\eqcolon"),ke("≔","\\coloneqq"),ke("≕","\\eqqcolon"),ke("⩴","\\Coloneqq"),ke("\\ratio","\\vcentcolon"),ke("\\coloncolon","\\dblcolon"),ke("\\colonequals","\\coloneqq"),ke("\\coloncolonequals","\\Coloneqq"),ke("\\equalscolon","\\eqqcolon"),ke("\\equalscoloncolon","\\Eqqcolon"),ke("\\colonminus","\\coloneq"),ke("\\coloncolonminus","\\Coloneq"),ke("\\minuscolon","\\eqcolon"),ke("\\minuscoloncolon","\\Eqcolon"),ke("\\coloncolonapprox","\\Colonapprox"),ke("\\coloncolonsim","\\Colonsim"),ke("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),ke("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),ke("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),ke("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),ke("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),ke("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),ke("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),ke("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),ke("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),ke("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),ke("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),ke("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),ke("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),ke("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),ke("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),ke("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),ke("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),ke("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),ke("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),ke("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),ke("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),ke("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),ke("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),ke("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),ke("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),ke("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),ke("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),ke("\\imath","\\html@mathml{\\@imath}{ı}"),ke("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),ke("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),ke("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),ke("⟦","\\llbracket"),ke("⟧","\\rrbracket"),ke("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),ke("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),ke("⦃","\\lBrace"),ke("⦄","\\rBrace"),ke("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),ke("⦵","\\minuso"),ke("\\darr","\\downarrow"),ke("\\dArr","\\Downarrow"),ke("\\Darr","\\Downarrow"),ke("\\lang","\\langle"),ke("\\rang","\\rangle"),ke("\\uarr","\\uparrow"),ke("\\uArr","\\Uparrow"),ke("\\Uarr","\\Uparrow"),ke("\\N","\\mathbb{N}"),ke("\\R","\\mathbb{R}"),ke("\\Z","\\mathbb{Z}"),ke("\\alef","\\aleph"),ke("\\alefsym","\\aleph"),ke("\\Alpha","\\mathrm{A}"),ke("\\Beta","\\mathrm{B}"),ke("\\bull","\\bullet"),ke("\\Chi","\\mathrm{X}"),ke("\\clubs","\\clubsuit"),ke("\\cnums","\\mathbb{C}"),ke("\\Complex","\\mathbb{C}"),ke("\\Dagger","\\ddagger"),ke("\\diamonds","\\diamondsuit"),ke("\\empty","\\emptyset"),ke("\\Epsilon","\\mathrm{E}"),ke("\\Eta","\\mathrm{H}"),ke("\\exist","\\exists"),ke("\\harr","\\leftrightarrow"),ke("\\hArr","\\Leftrightarrow"),ke("\\Harr","\\Leftrightarrow"),ke("\\hearts","\\heartsuit"),ke("\\image","\\Im"),ke("\\infin","\\infty"),ke("\\Iota","\\mathrm{I}"),ke("\\isin","\\in"),ke("\\Kappa","\\mathrm{K}"),ke("\\larr","\\leftarrow"),ke("\\lArr","\\Leftarrow"),ke("\\Larr","\\Leftarrow"),ke("\\lrarr","\\leftrightarrow"),ke("\\lrArr","\\Leftrightarrow"),ke("\\Lrarr","\\Leftrightarrow"),ke("\\Mu","\\mathrm{M}"),ke("\\natnums","\\mathbb{N}"),ke("\\Nu","\\mathrm{N}"),ke("\\Omicron","\\mathrm{O}"),ke("\\plusmn","\\pm"),ke("\\rarr","\\rightarrow"),ke("\\rArr","\\Rightarrow"),ke("\\Rarr","\\Rightarrow"),ke("\\real","\\Re"),ke("\\reals","\\mathbb{R}"),ke("\\Reals","\\mathbb{R}"),ke("\\Rho","\\mathrm{P}"),ke("\\sdot","\\cdot"),ke("\\sect","\\S"),ke("\\spades","\\spadesuit"),ke("\\sub","\\subset"),ke("\\sube","\\subseteq"),ke("\\supe","\\supseteq"),ke("\\Tau","\\mathrm{T}"),ke("\\thetasym","\\vartheta"),ke("\\weierp","\\wp"),ke("\\Zeta","\\mathrm{Z}"),ke("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),ke("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),ke("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),ke("\\bra","\\mathinner{\\langle{#1}|}"),ke("\\ket","\\mathinner{|{#1}\\rangle}"),ke("\\braket","\\mathinner{\\langle{#1}\\rangle}"),ke("\\Bra","\\left\\langle#1\\right|"),ke("\\Ket","\\left|#1\\right\\rangle");var j5t=t=>e=>{var r=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.consumeArg().tokens,s=e.macros.get("|"),o=e.macros.get("\\|");e.macros.beginGroup();var l=d=>f=>{t&&(f.macros.set("|",s),i.length&&f.macros.set("\\|",o));var p=d;if(!d&&i.length){var g=f.future();g.text==="|"&&(f.popToken(),p=!0)}return{tokens:p?i:n,numArgs:0}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var u=e.consumeArg().tokens,h=e.expandTokens([...a,...u,...r]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};ke("\\bra@ket",j5t(!1)),ke("\\bra@set",j5t(!0)),ke("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),ke("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),ke("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),ke("\\angln","{\\angl n}"),ke("\\blue","\\textcolor{##6495ed}{#1}"),ke("\\orange","\\textcolor{##ffa500}{#1}"),ke("\\pink","\\textcolor{##ff00af}{#1}"),ke("\\red","\\textcolor{##df0030}{#1}"),ke("\\green","\\textcolor{##28ae7b}{#1}"),ke("\\gray","\\textcolor{gray}{#1}"),ke("\\purple","\\textcolor{##9d38bd}{#1}"),ke("\\blueA","\\textcolor{##ccfaff}{#1}"),ke("\\blueB","\\textcolor{##80f6ff}{#1}"),ke("\\blueC","\\textcolor{##63d9ea}{#1}"),ke("\\blueD","\\textcolor{##11accd}{#1}"),ke("\\blueE","\\textcolor{##0c7f99}{#1}"),ke("\\tealA","\\textcolor{##94fff5}{#1}"),ke("\\tealB","\\textcolor{##26edd5}{#1}"),ke("\\tealC","\\textcolor{##01d1c1}{#1}"),ke("\\tealD","\\textcolor{##01a995}{#1}"),ke("\\tealE","\\textcolor{##208170}{#1}"),ke("\\greenA","\\textcolor{##b6ffb0}{#1}"),ke("\\greenB","\\textcolor{##8af281}{#1}"),ke("\\greenC","\\textcolor{##74cf70}{#1}"),ke("\\greenD","\\textcolor{##1fab54}{#1}"),ke("\\greenE","\\textcolor{##0d923f}{#1}"),ke("\\goldA","\\textcolor{##ffd0a9}{#1}"),ke("\\goldB","\\textcolor{##ffbb71}{#1}"),ke("\\goldC","\\textcolor{##ff9c39}{#1}"),ke("\\goldD","\\textcolor{##e07d10}{#1}"),ke("\\goldE","\\textcolor{##a75a05}{#1}"),ke("\\redA","\\textcolor{##fca9a9}{#1}"),ke("\\redB","\\textcolor{##ff8482}{#1}"),ke("\\redC","\\textcolor{##f9685d}{#1}"),ke("\\redD","\\textcolor{##e84d39}{#1}"),ke("\\redE","\\textcolor{##bc2612}{#1}"),ke("\\maroonA","\\textcolor{##ffbde0}{#1}"),ke("\\maroonB","\\textcolor{##ff92c6}{#1}"),ke("\\maroonC","\\textcolor{##ed5fa6}{#1}"),ke("\\maroonD","\\textcolor{##ca337c}{#1}"),ke("\\maroonE","\\textcolor{##9e034e}{#1}"),ke("\\purpleA","\\textcolor{##ddd7ff}{#1}"),ke("\\purpleB","\\textcolor{##c6b9fc}{#1}"),ke("\\purpleC","\\textcolor{##aa87ff}{#1}"),ke("\\purpleD","\\textcolor{##7854ab}{#1}"),ke("\\purpleE","\\textcolor{##543b78}{#1}"),ke("\\mintA","\\textcolor{##f5f9e8}{#1}"),ke("\\mintB","\\textcolor{##edf2df}{#1}"),ke("\\mintC","\\textcolor{##e0e5cc}{#1}"),ke("\\grayA","\\textcolor{##f6f7f7}{#1}"),ke("\\grayB","\\textcolor{##f0f1f2}{#1}"),ke("\\grayC","\\textcolor{##e3e5e6}{#1}"),ke("\\grayD","\\textcolor{##d6d8da}{#1}"),ke("\\grayE","\\textcolor{##babec2}{#1}"),ke("\\grayF","\\textcolor{##888d93}{#1}"),ke("\\grayG","\\textcolor{##626569}{#1}"),ke("\\grayH","\\textcolor{##3b3e40}{#1}"),ke("\\grayI","\\textcolor{##21242c}{#1}"),ke("\\kaBlue","\\textcolor{##314453}{#1}"),ke("\\kaGreen","\\textcolor{##71B307}{#1}");var X5t={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Dxn{constructor(e,r,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=r,this.expansionCount=0,this.feed(e),this.macros=new Exn(_xn,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new H5t(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var r,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;r=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:r,end:n}=this.consumeArg());return this.pushToken(new Xd("EOF",n.loc)),this.pushTokens(i),new Xd("",Uh.range(r,n))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var r=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),a,s=0,o=0;do{if(a=this.popToken(),r.push(a),a.text==="{")++s;else if(a.text==="}"){if(--s,s===-1)throw new Zt("Extra }",a)}else if(a.text==="EOF")throw new Zt("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",a);if(e&&n)if((s===0||s===1&&e[o]==="{")&&a.text===e[o]){if(++o,o===e.length){r.splice(-o,o);break}}else o=0}while(s!==0||n);return i.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:i,end:a}}consumeArgs(e,r){if(r){if(r.length!==e+1)throw new Zt("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;ithis.settings.maxExpand)throw new Zt("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var r=this.popToken(),n=r.text,i=r.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new Zt("Undefined control sequence: "+n);return this.pushToken(r),!1}this.countExpansion(1);var a=i.tokens,s=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var o=a.length-1;o>=0;--o){var l=a[o];if(l.text==="#"){if(o===0)throw new Zt("Incomplete placeholder at end of macro body",l);if(l=a[--o],l.text==="#")a.splice(o+1,1);else if(/^[1-9]$/.test(l.text))a.splice(o,2,...s[+l.text-1]);else throw new Zt("Not a valid argument number",l)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Xd(e)]):void 0}expandTokens(e){var r=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),r.push(i)}return this.countExpansion(r.length),r}expandMacroAsText(e){var r=this.expandMacro(e);return r&&r.map(n=>n.text).join("")}_getExpansion(e){var r=this.macros.get(e);if(r==null)return r;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof r=="function"?r(this):r;if(typeof i=="string"){var a=0;if(i.includes("#"))for(var s=i.replace(/##/g,"");s.includes("#"+(a+1));)++a;for(var o=new H5t(i,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var h={tokens:l,numArgs:a};return h}return i}isDefined(e){return this.macros.has(e)||A2.hasOwnProperty(e)||gs.math.hasOwnProperty(e)||gs.text.hasOwnProperty(e)||X5t.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:A2.hasOwnProperty(e)&&!A2[e].primitive}}var K5t=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,DZ=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),fSe={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},Z5t={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let J5t=class UZt{constructor(e,r){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Dxn(e,r,this.mode),this.settings=r,this.leftrightDepth=0,this.nextToken=null}expect(e,r){if(r===void 0&&(r=!0),this.fetch().text!==e)throw new Zt("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());r&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var r=this.nextToken;this.consume(),this.gullet.pushToken(new Xd("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=r,n}parseExpression(e,r){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(UZt.endOfExpression.has(i.text)||r&&i.text===r||e&&A2[i.text]&&A2[i.text].infix)break;var a=this.parseAtom(r);if(a){if(a.type==="internal")continue}else break;n.push(a)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var r=-1,n,i=0;i=128)this.settings.strict&&(x_t(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),e)),s={type:"textord",mode:"text",loc:Uh.range(e),text:r};else return null;if(this.consume(),a)for(var h=0;h0){if(++e>=x2n)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Z4(t){return function(){return t}}var IZ=function(){try{var t=uC(Object,"defineProperty");return t({},"",{}),t}catch{}}(),T2n=IZ?function(t,e){return IZ(t,"toString",{configurable:!0,enumerable:!1,value:Z4(e),writable:!0})}:lC,v4t=S2n(T2n);function y4t(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}var _2n=9007199254740991,R2n=/^(?:0|[1-9]\d*)$/;function PZ(t,e){var r=typeof t;return e=e??_2n,!!e&&(r=="number"||r!="symbol"&&R2n.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=M2n}function S2(t){return t!=null&&ySe(t.length)&&!H$(t)}function Y$(t,e,r){if(!Kd(r))return!1;var n=typeof e;return(n=="number"?S2(r)&&PZ(e,r.length):n=="string"&&e in r)?J4(r[e],t):!1}function I2n(t){return $Z(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&Y$(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}function Qwn(t,e){var r=this.__data__,n=VZ(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function g1(t){var e=-1,r=t==null?0:t.length;for(this.clear();++eo))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&qSn?new J$:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&Y$(e[0],e[1],i)&&(n=1);++r-1?i[a?e[s]:s]:void 0}}var BTn=Math.max;function $Tn(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:e2n(r);return i<0&&(i=BTn(n+i,0)),b4t(t,T2(e),i)}var $Se=NTn($Tn);function y3t(t,e){var r=-1,n=S2(t)?Array(t.length):[];return qZ(t,function(i,a,s){n[++r]=e(i,a,s)}),n}function Bo(t,e){var r=No(t)?K4:y3t;return r(t,T2(e))}function FTn(t,e){return t==null?t:MSe(t,BSe(e),hC)}function zTn(t,e){return t&&ISe(t,BSe(e))}function UTn(t,e){return t>e}var VTn=Object.prototype,QTn=VTn.hasOwnProperty;function GTn(t,e){return t!=null&&QTn.call(t,e)}function b3t(t,e){return t!=null&&f3t(t,e,GTn)}function HTn(t,e){return K4(e,function(r){return t[r]})}function y1(t){return t==null?[]:HTn(t,Zd(t))}var WTn="[object Map]",YTn="[object Set]",qTn=Object.prototype,jTn=qTn.hasOwnProperty;function x3t(t){if(t==null)return!0;if(S2(t)&&(No(t)||typeof t=="string"||typeof t.splice=="function"||t3(t)||UZ(t)||e3(t)))return!t.length;var e=dp(t);if(e==WTn||e==YTn)return!t.size;if(FZ(t))return!D4t(t).length;for(var r in t)if(jTn.call(t,r))return!1;return!0}function ho(t){return t===void 0}function w3t(t,e){return te||a&&s&&l&&!o&&!u||n&&s&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&t=o)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return t.index-e.index}function tCn(t,e,r){e.length?e=K4(e,function(a){return No(a)?function(s){return HZ(s,a.length===1?a[0]:a)}:a}):e=[lC];var n=-1;e=K4(e,zZ(T2));var i=y3t(t,function(a,s,o){var l=K4(e,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return ZTn(i,function(a,s){return eCn(a,s,r)})}function rCn(t,e){return KTn(t,e,function(r,n){return p3t(t,n)})}var KZ=iAn(function(t,e){return t==null?{}:rCn(t,e)}),nCn=Math.ceil,iCn=Math.max;function aCn(t,e,r,n){for(var i=-1,a=iCn(nCn((e-t)/(r||1)),0),s=Array(a);a--;)s[++i]=t,t+=r;return s}function sCn(t){return function(e,r,n){return n&&typeof n!="number"&&Y$(e,r,n)&&(r=n=void 0),e=MZ(e),r===void 0?(r=e,e=0):r=MZ(r),n=n===void 0?e1&&Y$(t,e[0],e[1])?e=[]:r>2&&Y$(e[0],e[1],e[2])&&(e=[e[0]]),tCn(t,SSe(e),[])}),lCn=1/0,cCn=i3&&1/RSe(new i3([,-0]))[1]==lCn?function(t){return new i3(t)}:b2n,uCn=200;function hCn(t,e,r){var n=-1,i=E2n,a=t.length,s=!0,o=[],l=o;if(a>=uCn){var u=cCn(t);if(u)return RSe(u);s=!1,i=a3t,l=new J$}else l=o;e:for(;++n1?i.setNode(a,r):i.setNode(a)}),this}setNode(e,r){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=pC,this._children[e]={},this._children[pC][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 Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var r=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],_t(this.children(e),n=>{this.setParent(n)}),delete this._children[e]),_t(Zd(this._in[e]),r),delete this._in[e],delete this._preds[e],_t(Zd(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(ho(r))r=pC;else{r+="";for(var n=r;!ho(n);n=this.parent(n))if(n===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var r=this._parent[e];if(r!==pC)return r}}children(e){if(ho(e)&&(e=pC),this._isCompound){var r=this._children[e];if(r)return Zd(r)}else{if(e===pC)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return Zd(r)}successors(e){var r=this._sucs[e];if(r)return Zd(r)}neighbors(e){var r=this.predecessors(e);if(r)return dCn(r,this.successors(e))}isLeaf(e){var r;return this.isDirected()?r=this.successors(e):r=this.neighbors(e),r.length===0}filterNodes(e){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;_t(this._nodes,function(s,o){e(o)&&r.setNode(o,s)}),_t(this._edgeObjs,function(s){r.hasNode(s.v)&&r.hasNode(s.w)&&r.setEdge(s,n.edge(s))});var i={};function a(s){var o=n.parent(s);return o===void 0||r.hasNode(o)?(i[s]=o,o):o in i?i[o]:a(o)}return this._isCompound&&_t(r.nodes(),function(s){r.setParent(s,a(s))}),r}setDefaultEdgeLabel(e){return H$(e)||(e=Z4(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return y1(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return t9(e,function(a,s){return i.length>1?n.setEdge(a,s,r):n.setEdge(a,s),s}),this}setEdge(){var e,r,n,i,a=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(e=s.v,r=s.w,n=s.name,arguments.length===2&&(i=arguments[1],a=!0)):(e=s,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),e=""+e,r=""+r,ho(n)||(n=""+n);var o=n9(this._isDirected,e,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return a&&(this._edgeLabels[o]=i),this;if(!ho(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[o]=a?i:this._defaultEdgeLabelFn(e,r,n);var l=vCn(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[o]=l,S3t(this._preds[r],e),S3t(this._sucs[e],r),this._in[r][o]=l,this._out[e][o]=l,this._edgeCount++,this}edge(e,r,n){var i=arguments.length===1?QSe(this._isDirected,arguments[0]):n9(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?QSe(this._isDirected,arguments[0]):n9(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?QSe(this._isDirected,arguments[0]):n9(this._isDirected,e,r,n),a=this._edgeObjs[i];return a&&(e=a.v,r=a.w,delete this._edgeLabels[i],delete this._edgeObjs[i],T3t(this._preds[r],e),T3t(this._sucs[e],r),delete this._in[r][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,r){var n=this._in[e];if(n){var i=y1(n);return r?v1(i,function(a){return a.v===r}):i}}outEdges(e,r){var n=this._out[e];if(n){var i=y1(n);return r?v1(i,function(a){return a.w===r}):i}}nodeEdges(e,r){var n=this.inEdges(e,r);if(n)return n.concat(this.outEdges(e,r))}}ru.prototype._nodeCount=0,ru.prototype._edgeCount=0;function S3t(t,e){t[e]?t[e]++:t[e]=1}function T3t(t,e){--t[e]||delete t[e]}function n9(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}return i+A3t+a+A3t+(ho(n)?mCn:n)}function vCn(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}var o={v:i,w:a};return n&&(o.name=n),o}function QSe(t,e){return n9(t,e.v,e.w,e.name)}function b1(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:yCn(t),edges:bCn(t)};return ho(t.graph())||(e.value=FSn(t.graph())),e}function yCn(t){return Bo(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return ho(r)||(i.value=r),ho(n)||(i.parent=n),i})}function bCn(t){return Bo(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return ho(e.name)||(n.name=e.name),ho(r)||(n.value=r),n})}var Dn=new Map,C2=new Map,C3t=new Map,O3t=C(()=>{C2.clear(),C3t.clear(),Dn.clear()},"clear"),gC=C((t,e)=>{const r=C2.get(e)||[];return me.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),xCn=C((t,e)=>{const r=C2.get(e)||[];return me.info("Descendants of ",e," is ",r),me.info("Edge is ",t),t.v===e||t.w===e?!1:r?r.includes(t.v)||gC(t.v,e)||gC(t.w,e)||r.includes(t.w):(me.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),GSe=C((t,e,r,n)=>{me.warn("Copying children of ",t,"root",n,"data",e.node(t),n);const i=e.children(t)||[];t!==n&&i.push(t),me.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach(a=>{if(e.children(a).length>0)GSe(a,e,r,n);else{const s=e.node(a);me.info("cp ",a," to ",n," with parent ",t),r.setNode(a,s),n!==e.parent(a)&&(me.warn("Setting parent",a,e.parent(a)),r.setParent(a,e.parent(a))),t!==n&&a!==t?(me.debug("Setting parent",a,t),r.setParent(a,t)):(me.info("In copy ",t,"root",n,"data",e.node(t),n),me.debug("Not Setting parent for node=",a,"cluster!==rootId",t!==n,"node!==clusterId",a!==t));const o=e.edges(a);me.debug("Copying Edges",o),o.forEach(l=>{me.info("Edge",l);const u=e.edge(l.v,l.w,l.name);me.info("Edge data",u,n);try{if(xCn(l,n)){const h=C2.get(n)||[],d=h.includes(l.v)||gC(l.v,n)||l.v===n,f=h.includes(l.w)||gC(l.w,n)||l.w===n;if(d&&f)me.info("Copying as ",l.v,l.w,u,l.name),r.setEdge(l.v,l.w,u,l.name),me.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]));else{const p=d?n:l.v,g=f?n:l.w;me.info("Rebinding cross-boundary edge as ",p,g,u,l.name),e.setEdge(p,g,u,l.name)}}else me.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",n," clusterId:",t)}catch(h){me.error(h)}})}me.debug("Removing node",a),e.removeNode(a)})},"copy"),k3t=C((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)C3t.set(i,t),n=[...n,...k3t(i,e)];return n},"extractDescendants"),wCn=C((t,e,r)=>{const n=t.edges().filter(l=>l.v===e||l.w===e),i=t.edges().filter(l=>l.v===r||l.w===r),a=n.map(l=>({v:l.v===e?r:l.v,w:l.w===e?e:l.w})),s=i.map(l=>({v:l.v,w:l.w}));return a.filter(l=>s.some(u=>l.v===u.v&&l.w===u.w))},"findCommonEdges"),s3=C((t,e,r)=>{const n=e.children(t);if(me.trace("Searching children of id ",t,n),n.length<1)return t;let i;for(const a of n){const s=s3(a,e,r),o=wCn(e,r,s);if(s)if(o.length>0)i=s;else return s}return i},"findNonClusterChild"),E3t=C(t=>!Dn.has(t)||!Dn.get(t).externalConnections?t:Dn.has(t)?Dn.get(t).id:t,"getAnchorId"),ACn=C((t,e)=>{var r;if(!t||e>10){me.debug("Opting out, no graph ");return}else me.debug("Opting in, graph ");t.nodes().forEach(function(n){t.children(n).length>0&&(me.warn("Cluster identified",n," Replacement id in edges: ",s3(n,t,n)),C2.set(n,k3t(n,t)),Dn.set(n,{id:s3(n,t,n),clusterData:t.node(n)}))}),t.nodes().forEach(function(n){const i=t.children(n),a=t.edges();i.length>0?(me.debug("Cluster identified",n,C2),a.forEach(s=>{const o=gC(s.v,n),l=gC(s.w,n);o^l&&(me.warn("Edge: ",s," leaves cluster ",n),me.warn("Descendants of XXX ",n,": ",C2.get(n)),Dn.get(n).externalConnections=!0)})):me.debug("Not a cluster ",n,C2)});for(let n of Dn.keys()){const i=Dn.get(n).id,a=t.parent(i);a!==n&&Dn.has(a)&&!Dn.get(a).externalConnections&&(Dn.get(n).id=a);const s=t.edges().some(o=>o.v===n);if(i&&((r=Dn.get(n))!=null&&r.externalConnections)&&s&&D3t(t,i,n)){const o=TCn(t,n,t.parent(i));o&&(Dn.get(n).id=o)}}t.edges().forEach(function(n){const i=t.edge(n);me.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),me.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(t.edge(n)));let a=n.v,s=n.w;if(me.warn("Fix XXX",Dn,"ids:",n.v,n.w,"Translating: ",Dn.get(n.v)," --- ",Dn.get(n.w)),Dn.get(n.v)||Dn.get(n.w)){if(me.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),a=E3t(n.v),s=E3t(n.w),t.removeEdge(n.v,n.w,n.name),a!==n.v){const o=t.parent(a);Dn.get(o).externalConnections=!0,i.fromCluster=n.v}if(s!==n.w){const o=t.parent(s);Dn.get(o).externalConnections=!0,i.toCluster=n.w}me.warn("Fix Replacing with XXX",a,s,n.name),t.setEdge(a,s,i,n.name)}}),me.warn("Adjusted Graph",b1(t)),_3t(t,0),me.trace(Dn)},"adjustClustersAndEdges"),_3t=C((t,e)=>{var i,a,s,o;if(me.warn("extractor - ",e,b1(t),t.children("D")),e>10){me.error("Bailing out");return}let r=t.nodes(),n=!1;for(const l of r){const u=t.children(l);n=n||u.length>0}if(!n){me.debug("Done, no node has children",t.nodes());return}me.debug("Nodes = ",r,e);for(const l of r)if(me.debug("Extracting node",l,Dn,Dn.has(l)&&!Dn.get(l).externalConnections,!t.parent(l),t.node(l),t.children("D")," Depth ",e),!Dn.has(l))me.debug("Not a cluster",l,e);else if((a=(i=Dn.get(l))==null?void 0:i.clusterData)!=null&&a.explicitDir&&t.children(l)&&t.children(l).length>0){me.warn("Cluster with explicit dir, creating subgraph for children",l,e);const u=Dn.get(l).clusterData.dir,h=new ru({multigraph:!0,compound:!0}).setGraph({rankdir:u,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});GSe(l,t,h,l);const d=t.node(l)||{};t.setNode(l,{...d,clusterNode:!0,id:l,clusterData:Dn.get(l).clusterData,label:Dn.get(l).label,graph:h}),me.warn("Subgraph for cluster with explicit dir created:",l,b1(h))}else if(!Dn.get(l).externalConnections&&t.children(l)&&t.children(l).length>0){me.warn("Cluster without external connections, without a parent and with children",l,e);let h=t.graph().rankdir==="TB"?"LR":"TB";(o=(s=Dn.get(l))==null?void 0:s.clusterData)!=null&&o.dir&&(h=Dn.get(l).clusterData.dir,me.warn("Fixing dir",Dn.get(l).clusterData.dir,h));const d=new ru({multigraph:!0,compound:!0}).setGraph({rankdir:h,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});GSe(l,t,d,l);const f=t.node(l)||{};t.setNode(l,{...f,clusterNode:!0,id:l,clusterData:Dn.get(l).clusterData,label:Dn.get(l).label,graph:d}),me.debug("Old graph after copy",b1(t))}else me.warn("Cluster ** ",l," **not meeting the criteria !externalConnections:",!Dn.get(l).externalConnections," no parent: ",!t.parent(l)," children ",t.children(l)&&t.children(l).length>0,t.children("D"),e),me.debug(Dn);r=t.nodes(),me.warn("New list of nodes",r);for(const l of r){const u=t.node(l);me.warn(" Now next level",l,u),u!=null&&u.clusterNode&&_3t(u.graph,e+1)}},"extractor"),R3t=C((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),a=R3t(t,i);r=[...r,...a]}),r},"sorter"),SCn=C(t=>R3t(t,t.children()),"sortNodesByHierarchy"),D3t=C((t,e,r)=>{let n=t.parent(e);for(;n&&n!==r;){const i=Dn.get(n);if(i&&!i.externalConnections)return!0;n=t.parent(n)}return!1},"isNodeInExtractableCluster"),TCn=C((t,e,r)=>{const n=t.children(e)??[];for(const i of n){if(i===r||gC(i,r))continue;const a=s3(i,t,e);if(a&&!D3t(t,a,e))return a}return null},"findSafeAnchorNode");class CCn{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return L3t(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&L3t(e),e._next=r._next,r._next._prev=e,r._next=e,e._prev=r}toString(){for(var e=[],r=this._sentinel,n=r._prev;n!==r;)e.push(JSON.stringify(n,OCn)),n=n._prev;return"["+e.join(", ")+"]"}}function L3t(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function OCn(t,e){if(t!=="_next"&&t!=="_prev")return e}var kCn=Z4(1);function ECn(t,e){if(t.nodeCount()<=1)return[];var r=RCn(t,e||kCn),n=_Cn(r.graph,r.buckets,r.zeroIdx);return n3(Bo(n,function(i){return t.outEdges(i.v,i.w)}))}function _Cn(t,e,r){for(var n=[],i=e[e.length-1],a=e[0],s;t.nodeCount();){for(;s=a.dequeue();)HSe(t,e,r,s);for(;s=i.dequeue();)HSe(t,e,r,s);if(t.nodeCount()){for(var o=e.length-2;o>0;--o)if(s=e[o].dequeue(),s){n=n.concat(HSe(t,e,r,s,!0));break}}}return n}function HSe(t,e,r,n,i){var a=i?[]:void 0;return _t(t.inEdges(n.v),function(s){var o=t.edge(s),l=t.node(s.v);i&&a.push({v:s.v,w:s.w}),l.out-=o,WSe(e,r,l)}),_t(t.outEdges(n.v),function(s){var o=t.edge(s),l=s.w,u=t.node(l);u.in-=o,WSe(e,r,u)}),t.removeNode(n.v),a}function RCn(t,e){var r=new ru,n=0,i=0;_t(t.nodes(),function(o){r.setNode(o,{v:o,in:0,out:0})}),_t(t.edges(),function(o){var l=r.edge(o.v,o.w)||0,u=e(o),h=l+u;r.setEdge(o.v,o.w,h),i=Math.max(i,r.node(o.v).out+=u),n=Math.max(n,r.node(o.w).in+=u)});var a=a3(i+n+3).map(function(){return new CCn}),s=n+1;return _t(r.nodes(),function(o){WSe(a,s,r.node(o))}),{graph:r,buckets:a,zeroIdx:s}}function WSe(t,e,r){r.out?r.in?t[r.out-r.in+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}function DCn(t){var e=t.graph().acyclicer==="greedy"?ECn(t,r(t)):LCn(t);_t(e,function(n){var i=t.edge(n);t.removeEdge(n),i.forwardName=n.name,i.reversed=!0,t.setEdge(n.w,n.v,i,VSe("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function LCn(t){var e=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,_t(t.outEdges(a),function(s){Object.prototype.hasOwnProperty.call(r,s.w)?e.push(s):i(s.w)}),delete r[a])}return _t(t.nodes(),i),e}function MCn(t){_t(t.edges(),function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}function o3(t,e,r,n){var i;do i=VSe(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function ICn(t){var e=new ru().setGraph(t.graph());return _t(t.nodes(),function(r){e.setNode(r,t.node(r))}),_t(t.edges(),function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},i=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),e}function M3t(t){var e=new ru({multigraph:t.isMultigraph()}).setGraph(t.graph());return _t(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),_t(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function I3t(t,e){var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=o*i/a,u=o):(i<0&&(s=-s),l=s,u=s*a/i),{x:r+l,y:n+u}}function ZZ(t){var e=Bo(a3(N3t(t)+1),function(){return[]});return _t(t.nodes(),function(r){var n=t.node(r),i=n.rank;ho(i)||(e[i][n.order]=r)}),e}function PCn(t){var e=e9(Bo(t.nodes(),function(r){return t.node(r).rank}));_t(t.nodes(),function(r){var n=t.node(r);b3t(n,"rank")&&(n.rank-=e)})}function NCn(t){var e=e9(Bo(t.nodes(),function(a){return t.node(a).rank})),r=[];_t(t.nodes(),function(a){var s=t.node(a).rank-e;r[s]||(r[s]=[]),r[s].push(a)});var n=0,i=t.graph().nodeRankFactor;_t(r,function(a,s){ho(a)&&s%i!==0?--n:n&&_t(a,function(o){t.node(o).rank+=n})})}function P3t(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),o3(t,"border",i,e)}function N3t(t){return fC(Bo(t.nodes(),function(e){var r=t.node(e).rank;if(!ho(r))return r}))}function BCn(t,e){var r={lhs:[],rhs:[]};return _t(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function $Cn(t,e){return e()}function FCn(t){function e(r){var n=t.children(r),i=t.node(r);if(n.length&&_t(n,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,s=i.maxRank+1;as.lim&&(o=s,l=!0);var u=v1(e.edges(),function(h){return l===q3t(t,t.node(h.v),o)&&l!==q3t(t,t.node(h.w),o)});return USe(u,function(h){return i9(e,h)})}function Y3t(t,e,r,n){var i=r.v,a=r.w;t.removeEdge(i,a),t.setEdge(n.v,n.w,{}),KSe(t),XSe(t,e),eOn(t,e)}function eOn(t,e){var r=$Se(t.nodes(),function(i){return!e.node(i).parent}),n=ZCn(t,r);n=n.slice(1),_t(n,function(i){var a=t.node(i).parent,s=e.edge(i,a),o=!1;s||(s=e.edge(a,i),o=!0),e.node(i).rank=e.node(a).rank+(o?s.minlen:-s.minlen)})}function tOn(t,e,r){return t.hasEdge(e,r)}function q3t(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function rOn(t){switch(t.graph().ranker){case"network-simplex":j3t(t);break;case"tight-tree":iOn(t);break;case"longest-path":nOn(t);break;default:j3t(t)}}var nOn=jSe;function iOn(t){jSe(t),z3t(t)}function j3t(t){mC(t)}function aOn(t){var e=o3(t,"root",{},"_root"),r=sOn(t),n=fC(y1(r))-1,i=2*n+1;t.graph().nestingRoot=e,_t(t.edges(),function(s){t.edge(s).minlen*=i});var a=oOn(t)+1;_t(t.children(),function(s){X3t(t,e,i,a,n,r,s)}),t.graph().nodeRankFactor=i}function X3t(t,e,r,n,i,a,s){var o=t.children(s);if(!o.length){s!==e&&t.setEdge(e,s,{weight:0,minlen:r});return}var l=P3t(t,"_bt"),u=P3t(t,"_bb"),h=t.node(s);t.setParent(l,s),h.borderTop=l,t.setParent(u,s),h.borderBottom=u,_t(o,function(d){X3t(t,e,r,n,i,a,d);var f=t.node(d),p=f.borderTop?f.borderTop:d,g=f.borderBottom?f.borderBottom:d,m=f.borderTop?n:2*n,v=p!==g?1:i-a[s]+1;t.setEdge(l,p,{weight:m,minlen:v,nestingEdge:!0}),t.setEdge(g,u,{weight:m,minlen:v,nestingEdge:!0})}),t.parent(s)||t.setEdge(e,l,{weight:0,minlen:i+a[s]})}function sOn(t){var e={};function r(n,i){var a=t.children(n);a&&a.length&&_t(a,function(s){r(s,i+1)}),e[n]=i}return _t(t.children(),function(n){r(n,1)}),e}function oOn(t){return t9(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function lOn(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,_t(t.edges(),function(r){var n=t.edge(r);n.nestingEdge&&t.removeEdge(r)})}function cOn(t,e,r){var n={},i;_t(r,function(a){for(var s=t.parent(a),o,l;s;){if(o=t.parent(s),o?(l=n[o],n[o]=s):(l=i,i=s),l&&l!==s){e.setEdge(l,s);return}s=o}})}function uOn(t,e,r){var n=hOn(t),i=new ru({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return t.node(a)});return _t(t.nodes(),function(a){var s=t.node(a),o=t.parent(a);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(i.setNode(a),i.setParent(a,o||n),_t(t[r](a),function(l){var u=l.v===a?l.w:l.v,h=i.edge(u,a),d=ho(h)?0:h.weight;i.setEdge(u,a,{weight:t.edge(l).weight+d})}),Object.prototype.hasOwnProperty.call(s,"minRank")&&i.setNode(a,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))}),i}function hOn(t){for(var e;t.hasNode(e=VSe("_root")););return e}function dOn(t,e){for(var r=0,n=1;n0;)h%2&&(d+=o[h+1]),h=h-1>>1,o[h]+=u.weight;l+=u.weight*d})),l}function pOn(t){var e={},r=v1(t.nodes(),function(o){return!t.children(o).length}),n=fC(Bo(r,function(o){return t.node(o).rank})),i=Bo(a3(n+1),function(){return[]});function a(o){if(!b3t(e,o)){e[o]=!0;var l=t.node(o);i[l.rank].push(o),_t(t.successors(o),a)}}var s=r9(r,function(o){return t.node(o).rank});return _t(s,a),i}function gOn(t,e){return Bo(e,function(r){var n=t.inEdges(r);if(n.length){var i=t9(n,function(a,s){var o=t.edge(s),l=t.node(s.v);return{sum:a.sum+o.weight*l.order,weight:a.weight+o.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function mOn(t,e){var r={};_t(t,function(i,a){var s=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};ho(i.barycenter)||(s.barycenter=i.barycenter,s.weight=i.weight)}),_t(e.edges(),function(i){var a=r[i.v],s=r[i.w];!ho(a)&&!ho(s)&&(s.indegree++,a.out.push(r[i.w]))});var n=v1(r,function(i){return!i.indegree});return vOn(n)}function vOn(t){var e=[];function r(a){return function(s){s.merged||(ho(s.barycenter)||ho(a.barycenter)||s.barycenter>=a.barycenter)&&yOn(a,s)}}function n(a){return function(s){s.in.push(a),--s.indegree===0&&t.push(s)}}for(;t.length;){var i=t.pop();e.push(i),_t(i.in.reverse(),r(i)),_t(i.out,n(i))}return Bo(v1(e,function(a){return!a.merged}),function(a){return KZ(a,["vs","i","barycenter","weight"])})}function yOn(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}function bOn(t,e){var r=BCn(t,function(h){return Object.prototype.hasOwnProperty.call(h,"barycenter")}),n=r.lhs,i=r9(r.rhs,function(h){return-h.i}),a=[],s=0,o=0,l=0;n.sort(xOn(!!e)),l=K3t(a,i,l),_t(n,function(h){l+=h.vs.length,a.push(h.vs),s+=h.barycenter*h.weight,o+=h.weight,l=K3t(a,i,l)});var u={vs:n3(a)};return o&&(u.barycenter=s/o,u.weight=o),u}function K3t(t,e,r){for(var n;e.length&&(n=jZ(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function xOn(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}function Z3t(t,e,r,n){var i=t.children(e),a=t.node(e),s=a?a.borderLeft:void 0,o=a?a.borderRight:void 0,l={};s&&(i=v1(i,function(g){return g!==s&&g!==o}));var u=gOn(t,i);_t(u,function(g){if(t.children(g.v).length){var m=Z3t(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&AOn(g,m)}});var h=mOn(u,r);wOn(h,l);var d=bOn(h,n);if(s&&(d.vs=n3([s,d.vs,o]),t.predecessors(s).length)){var f=t.node(t.predecessors(s)[0]),p=t.node(t.predecessors(o)[0]);Object.prototype.hasOwnProperty.call(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function wOn(t,e){_t(t,function(r){r.vs=n3(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function AOn(t,e){ho(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}function SOn(t){var e=N3t(t),r=J3t(t,a3(1,e+1),"inEdges"),n=J3t(t,a3(e-1,-1,-1),"outEdges"),i=pOn(t);eRt(t,i);for(var a=Number.POSITIVE_INFINITY,s,o=0,l=0;l<4;++o,++l){TOn(o%2?r:n,o%4>=2),i=ZZ(t);var u=dOn(t,i);us||o>e[l].lim));for(u=l,l=n;(l=t.parent(l))!==u;)a.push(l);return{path:i.concat(a.reverse()),lca:u}}function kOn(t){var e={},r=0;function n(i){var a=r;_t(t.children(i),n),e[i]={low:a,lim:r++}}return _t(t.children(),n),e}function EOn(t,e){var r={};function n(i,a){var s=0,o=0,l=i.length,u=jZ(a);return _t(a,function(h,d){var f=ROn(t,h),p=f?t.node(f).order:l;(f||h===u)&&(_t(a.slice(o,d+1),function(g){_t(t.predecessors(g),function(m){var v=t.node(m),y=v.order;(yu)&&tRt(r,f,h)})})}function i(a,s){var o=-1,l,u=0;return _t(s,function(h,d){if(t.node(h).dummy==="border"){var f=t.predecessors(h);f.length&&(l=t.node(f[0]).order,n(s,u,d,o,l),u=d,o=l)}n(s,u,s.length,l,a.length)}),s}return t9(e,i),r}function ROn(t,e){if(t.node(e).dummy)return $Se(t.predecessors(e),function(r){return t.node(r).dummy})}function tRt(t,e,r){if(e>r){var n=e;e=r,r=n}Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=t[e];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function DOn(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function LOn(t,e,r,n){var i={},a={},s={};return _t(e,function(o){_t(o,function(l,u){i[l]=l,a[l]=l,s[l]=u})}),_t(e,function(o){var l=-1;_t(o,function(u){var h=n(u);if(h.length){h=r9(h,function(m){return s[m]});for(var d=(h.length-1)/2,f=Math.floor(d),p=Math.ceil(d);f<=p;++f){var g=h[f];a[u]===u&&l{var n=r(" buildLayoutGraph",()=>JOn(t));r(" runLayout",()=>QOn(n,r)),r(" updateInputGraph",()=>GOn(t,n))})}function QOn(t,e){e(" makeSpaceForEdgeLabels",()=>ekn(t)),e(" removeSelfEdges",()=>ckn(t)),e(" acyclic",()=>DCn(t)),e(" nestingGraph.run",()=>aOn(t)),e(" rank",()=>rOn(M3t(t))),e(" injectEdgeLabelProxies",()=>tkn(t)),e(" removeEmptyRanks",()=>NCn(t)),e(" nestingGraph.cleanup",()=>lOn(t)),e(" normalizeRanks",()=>PCn(t)),e(" assignRankMinMax",()=>rkn(t)),e(" removeEdgeLabelProxies",()=>nkn(t)),e(" normalize.run",()=>GCn(t)),e(" parentDummyChains",()=>COn(t)),e(" addBorderSegments",()=>FCn(t)),e(" order",()=>SOn(t)),e(" insertSelfEdges",()=>ukn(t)),e(" adjustCoordinateSystem",()=>zCn(t)),e(" position",()=>UOn(t)),e(" positionSelfEdges",()=>hkn(t)),e(" removeBorderNodes",()=>lkn(t)),e(" normalize.undo",()=>WCn(t)),e(" fixupEdgeLabelCoords",()=>skn(t)),e(" undoCoordinateSystem",()=>UCn(t)),e(" translateGraph",()=>ikn(t)),e(" assignNodeIntersects",()=>akn(t)),e(" reversePoints",()=>okn(t)),e(" acyclic.undo",()=>MCn(t))}function GOn(t,e){_t(t.nodes(),function(r){var n=t.node(r),i=e.node(r);n&&(n.x=i.x,n.y=i.y,e.children(r).length&&(n.width=i.width,n.height=i.height))}),_t(t.edges(),function(r){var n=t.edge(r),i=e.edge(r);n.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(n.x=i.x,n.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}var HOn=["nodesep","edgesep","ranksep","marginx","marginy"],WOn={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},YOn=["acyclicer","ranker","rankdir","align"],qOn=["width","height"],jOn={width:0,height:0},XOn=["minlen","weight","width","height","labeloffset"],KOn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},ZOn=["labelpos"];function JOn(t){var e=new ru({multigraph:!0,compound:!0}),r=JSe(t.graph());return e.setGraph(zSe({},WOn,ZSe(r,HOn),KZ(r,YOn))),_t(t.nodes(),function(n){var i=JSe(t.node(n));e.setNode(n,LTn(ZSe(i,qOn),jOn)),e.setParent(n,t.parent(n))}),_t(t.edges(),function(n){var i=JSe(t.edge(n));e.setEdge(n,zSe({},KOn,ZSe(i,XOn),KZ(i,ZOn)))}),e}function ekn(t){var e=t.graph();e.ranksep/=2,_t(t.edges(),function(r){var n=t.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function tkn(t){_t(t.edges(),function(e){var r=t.edge(e);if(r.width&&r.height){var n=t.node(e.v),i=t.node(e.w),a={rank:(i.rank-n.rank)/2+n.rank,e};o3(t,"edge-proxy",a,"_ep")}})}function rkn(t){var e=0;_t(t.nodes(),function(r){var n=t.node(r);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,e=fC(e,n.maxRank))}),t.graph().maxRank=e}function nkn(t){_t(t.nodes(),function(e){var r=t.node(e);r.dummy==="edge-proxy"&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function ikn(t){var e=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=t.graph(),s=a.marginx||0,o=a.marginy||0;function l(u){var h=u.x,d=u.y,f=u.width,p=u.height;e=Math.min(e,h-f/2),r=Math.max(r,h+f/2),n=Math.min(n,d-p/2),i=Math.max(i,d+p/2)}_t(t.nodes(),function(u){l(t.node(u))}),_t(t.edges(),function(u){var h=t.edge(u);Object.prototype.hasOwnProperty.call(h,"x")&&l(h)}),e-=s,n-=o,_t(t.nodes(),function(u){var h=t.node(u);h.x-=e,h.y-=n}),_t(t.edges(),function(u){var h=t.edge(u);_t(h.points,function(d){d.x-=e,d.y-=n}),Object.prototype.hasOwnProperty.call(h,"x")&&(h.x-=e),Object.prototype.hasOwnProperty.call(h,"y")&&(h.y-=n)}),a.width=r-e+s,a.height=i-n+o}function akn(t){_t(t.edges(),function(e){var r=t.edge(e),n=t.node(e.v),i=t.node(e.w),a,s;r.points?(a=r.points[0],s=r.points[r.points.length-1]):(r.points=[],a=i,s=n),r.points.unshift(I3t(n,a)),r.points.push(I3t(i,s))})}function skn(t){_t(t.edges(),function(e){var r=t.edge(e);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function okn(t){_t(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function lkn(t){_t(t.nodes(),function(e){if(t.children(e).length){var r=t.node(e),n=t.node(r.borderTop),i=t.node(r.borderBottom),a=t.node(jZ(r.borderLeft)),s=t.node(jZ(r.borderRight));r.width=Math.abs(s.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),_t(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function ckn(t){_t(t.edges(),function(e){if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function ukn(t){var e=ZZ(t);_t(e,function(r){var n=0;_t(r,function(i,a){var s=t.node(i);s.order=a+n,_t(s.selfEdges,function(o){o3(t,"selfedge",{width:o.label.width,height:o.label.height,rank:s.rank,order:a+ ++n,e:o.e,label:o.label},"_se")}),delete s.selfEdges})})}function hkn(t){_t(t.nodes(),function(e){var r=t.node(e);if(r.dummy==="selfedge"){var n=t.node(r.e.v),i=n.x+n.width/2,a=n.y,s=r.x-i,o=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*s/3,y:a-o},{x:i+5*s/6,y:a-o},{x:i+s,y:a},{x:i+5*s/6,y:a+o},{x:i+2*s/3,y:a+o}],r.label.x=r.x,r.label.y=r.y}})}function ZSe(t,e){return XZ(KZ(t,e),Number)}function JSe(t){var e={};return _t(t,function(r,n){e[n.toLowerCase()]=r}),e}var nRt=C((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),iRt=C((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),dkn=C(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram","shouldMergeSelfLoopSegments"),fkn=C((t,e,r,n,i)=>{const a=[],s=new Set;if(r.forEach(({start:h,end:d})=>{h!==n&&s.add(h),d!==n&&s.add(d)}),s.forEach(h=>{const d=t.node(h);typeof(d==null?void 0:d.x)=="number"&&typeof(d==null?void 0:d.y)=="number"&&a.push(d)}),a.length===0&&r.forEach(({edge:h})=>{(h.points??[]).forEach(d=>{typeof(d==null?void 0:d.x)=="number"&&typeof(d==null?void 0:d.y)=="number"&&a.push(d)})}),a.length===0)return iRt(i);const o=a.reduce((h,d)=>({x:h.x+d.x/a.length,y:h.y+d.y/a.length}),{x:0,y:0}),l=o.x-e.x,u=o.y-e.y;return Math.abs(l)>Math.abs(u)?l>0?"right":"left":Math.abs(u)>0?u>0?"bottom":"top":iRt(i)},"getSelfLoopSide"),pkn=C((t,e="top",r=0,n=0)=>{const i=t.x,a=t.y-r,s=t.width/2,o=t.height/2,l=Math.max(36,Math.min(100,t.width*.8)),u=nRt(Math.max(n,t.width*.35),36,l),h=nRt(Math.min(t.width,t.height)*.45,24,48);switch(e){case"bottom":{const d=a+o;return[{x:i-u/2,y:d},{x:i-u/2,y:d+h},{x:i+u/2,y:d+h},{x:i+u/2,y:d}]}case"right":{const d=i+s;return[{x:d,y:a-u/2},{x:d+h,y:a-u/2},{x:d+h,y:a+u/2},{x:d,y:a+u/2}]}case"left":{const d=i-s;return[{x:d,y:a-u/2},{x:d-h,y:a-u/2},{x:d-h,y:a+u/2},{x:d,y:a+u/2}]}case"top":default:{const d=a-o;return[{x:i-u/2,y:d},{x:i-u/2,y:d-h},{x:i+u/2,y:d-h},{x:i+u/2,y:d}]}}},"getSelfLoopPoints"),gkn=C((t,e,r="top",n=0,i={})=>{const s=t.x,o=t.y-n,l=i.width??0,u=i.height??0;switch(r){case"bottom":return{x:s,y:Math.max(...e.map(h=>h.y))+u/2+4};case"right":return{x:Math.max(...e.map(h=>h.x))+l/2+4,y:o};case"left":return{x:Math.min(...e.map(h=>h.x))-l/2-4,y:o};case"top":default:return{x:s,y:Math.min(...e.map(h=>h.y))-u/2-4}}},"getSelfLoopLabelPosition"),aRt=C((t,e=0,{mergeSelfLoops:r=!0}={})=>{var s;const n=new Map,i=[],a=(s=t.graph())==null?void 0:s.rankdir;return t.edges().forEach(o=>{const l=t.edge(o);if(r&&l.selfLoop){const u=l.selfLoop.id;n.has(u)||n.set(u,[]),n.get(u).push({edge:l,start:o.v,end:o.w})}else i.push({edge:l,start:o.v,end:o.w})}),n.forEach(o=>{if(o.length!==3){o.forEach(b=>i.push(b));return}o.sort((b,x)=>b.edge.selfLoop.order-x.edge.selfLoop.order);const[l,u,h]=o,d=l.edge.originalEdge??u.edge.originalEdge??h.edge.originalEdge??u.edge,f=t.node(d.start);if(!f){o.forEach(b=>i.push(b));return}const p={width:u.edge.width,height:u.edge.height},g=fkn(t,f,o,d.start,a),m=pkn(f,g,e,p.width??0),v=gkn(f,m,g,e,p),y={...u.edge,...d,id:d.id,points:m,start:d.start,end:d.end,x:v.x,y:v.y,width:p.width,height:p.height,labelStyle:u.edge.labelStyle,fromCluster:l.edge.fromCluster??u.edge.fromCluster??h.edge.fromCluster,toCluster:l.edge.toCluster??u.edge.toCluster??h.edge.toCluster};delete y.selfLoop,delete y.originalEdge,i.push({edge:y,start:y.start,end:y.end})}),i},"getEdgesToRender"),sRt=C(async(t,e,r,n,i,a)=>{me.warn("Graph in recursive render:XAX",b1(e),i);const s=e.graph().rankdir;me.trace("Dir in recursive render - dir:",s);const o=t.insert("g").attr("class","root");e.nodes()?me.info("Recursive render XXX",e.nodes()):me.info("No nodes found for",e),e.edges().length>0&&me.info("Recursive edges",e.edge(e.edges()[0]));const l=o.insert("g").attr("class","clusters"),u=o.insert("g").attr("class","edgePaths"),h=o.insert("g").attr("class","edgeLabels"),d=o.insert("g").attr("class","nodes"),f=dkn(r);await Promise.all(e.nodes().map(async function(b){const x=e.node(b);if(i!==void 0){const w=JSON.parse(JSON.stringify(i.clusterData));me.trace(`Setting data for parent cluster XXX Node.id = `,b,` data=`,w.height,` -Parent cluster`,i.height),e.setNode(i.id,w),e.parent(b)||(me.trace("Setting parent",b,i.id),e.setParent(b,i.id,w))}if(me.info("(Insert) Node XXX"+b+": "+JSON.stringify(e.node(b))),x!=null&&x.clusterNode){me.info("Cluster identified XBX",b,x.width,e.node(b));const{ranksep:w,nodesep:A}=e.graph();x.graph.setGraph({...x.graph.graph(),ranksep:w+25,nodesep:A});const T=await sRt(d,x.graph,r,n,e.node(b),a),S=T.elem;Pr(x,S),x.diff=T.diff||0,me.info("New compound node after recursive render XAX",b,"width",x.width,"height",x.height),Grn(S,x)}else e.children(b).length>0?(me.trace("Cluster - the non recursive path XBX",b,x.id,x,x.width,"Graph:",e),me.trace(s3(x.id,e)),Dn.set(x.id,{id:s3(x.id,e),node:x})):(me.trace("Node - the non recursive path XAX",b,d,e.node(b),s),await S7(d,e.node(b),{config:a,dir:s}))})),await C(async()=>{const b=e.edges().map(async function(x){const w=e.edge(x.v,x.w,x.name);if(me.info("Edge "+x.v+" -> "+x.w+": "+JSON.stringify(x)),me.info("Edge "+x.v+" -> "+x.w+": ",x," ",JSON.stringify(e.edge(x))),me.info("Fix",Dn,"ids:",x.v,x.w,"Translating: ",Dn.get(x.v),Dn.get(x.w)),f&&w.selfLoop){if(w.selfLoop.order!==1)return;const A=w.id;w.id=w.selfLoop.id,await aX(h,w),w.id=A;return}await aX(h,w)});await Promise.all(b)},"processEdges")(),me.info("Graph before layout:",JSON.stringify(b1(e))),me.info("############################################# XXX"),me.info("### Layout ### XXX"),me.info("############################################# XXX"),rRt(e),me.info("Graph after layout:",JSON.stringify(b1(e)));let g=0,{subGraphTitleTotalMargin:m}=q5(a);await Promise.all(TCn(e).map(async function(b){var w;const x=e.node(b);if(me.info("Position XBX => "+b+": ("+x.x,","+x.y,") width: ",x.width," height: ",x.height),x!=null&&x.clusterNode)x.y+=m,me.info("A tainted cluster node XBX1",b,x.id,x.width,x.height,x.x,x.y,e.parent(b)),Dn.get(x.id).node=x,iX(x);else if(e.children(b).length>0){me.info("A pure cluster node XBX1",b,x.id,x.x,x.y,x.width,x.height,e.parent(b)),x.height+=m,e.node(x.parentId);const A=(x==null?void 0:x.padding)/2||0,T=((w=x==null?void 0:x.labelBBox)==null?void 0:w.height)||0,S=T-A||0;me.debug("OffsetY",S,"labelHeight",T,"halfPadding",A),await tX(l,x),Dn.get(x.id).node=x}else{const A=e.node(x.parentId);x.y+=m/2,me.info("A regular node XBX1 - using the padding",x.id,"parent",x.parentId,x.width,x.height,x.x,x.y,"offsetY",x.offsetY,"parent",A,A==null?void 0:A.offsetY,x),iX(x)}}));const v=m/2;return aRt(e,v,{mergeSelfLoops:f}).forEach(function({edge:b,start:x,end:w}){me.info("Edge "+x+" -> "+w+": "+JSON.stringify(b),b),b.points.forEach(O=>O.y+=v);const A=e.node(x),T=e.node(w),S=Mbe(u,b,Dn,r,A,T,n);zxt(b,S)}),e.nodes().forEach(function(b){const x=e.node(b);me.info(b,x.type,x.diff),x.isGroup&&(g=x.diff)}),me.warn("Returning from recursive render XAX",o,g),{elem:o,diff:g}},"recursiveRender"),mkn=C(async(t,e)=>{var a,s,o,l,u,h;const r=new ru({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:((a=t.config)==null?void 0:a.nodeSpacing)||((o=(s=t.config)==null?void 0:s.flowchart)==null?void 0:o.nodeSpacing)||t.nodeSpacing,ranksep:((l=t.config)==null?void 0:l.rankSpacing)||((h=(u=t.config)==null?void 0:u.flowchart)==null?void 0:h.rankSpacing)||t.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),n=e.select("g");Pbe(n,t.markers,t.type,t.diagramId),Pxt(),Fxt(),nbt(),O3t(),t.nodes.forEach(d=>{r.setNode(d.id,{...d}),d.parentId&&r.setParent(d.id,d.parentId)}),me.debug("Edges:",t.edges),t.edges.forEach(d=>{if(d.start===d.end){const f=d.start,p=f+"---"+f+"---1",g=f+"---"+f+"---2",m=r.node(f);r.setNode(p,{domId:p,id:p,parentId:m.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),r.setParent(p,m.parentId),r.setNode(g,{domId:g,id:g,parentId:m.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),r.setParent(g,m.parentId);const v=structuredClone(d),y=structuredClone(d),b=structuredClone(d),x=structuredClone(d);y.originalEdge=v,y.selfLoop={id:v.id,order:0},b.originalEdge=v,b.selfLoop={id:v.id,order:1},x.originalEdge=v,x.selfLoop={id:v.id,order:2},y.label="",y.arrowTypeEnd="none",y.endLabelLeft="",y.endLabelRight="",y.startLabelLeft="",y.id=f+"-cyclic-special-1",b.startLabelRight="",b.startLabelLeft="",b.endLabelLeft="",b.endLabelRight="",b.arrowTypeStart="none",b.arrowTypeEnd="none",b.id=f+"-cyclic-special-mid",x.label="",x.startLabelRight="",x.startLabelLeft="",x.arrowTypeStart="none",m.isGroup&&(y.fromCluster=f,x.toCluster=f),x.id=f+"-cyclic-special-2",x.arrowTypeStart="none",r.setEdge(f,p,y,f+"-cyclic-special-0"),r.setEdge(p,g,b,f+"-cyclic-special-1"),r.setEdge(g,f,x,f+"-cyclic-special-2")}else r.setEdge(d.start,d.end,{...d},d.id)}),me.warn("Graph at first:",JSON.stringify(b1(r))),ACn(r),me.warn("Graph after XAX:",JSON.stringify(b1(r)));const i=He();await sRt(n,r,t.type,t.diagramId,void 0,i)},"render");const vkn=Object.freeze(Object.defineProperty({__proto__:null,getEdgesToRender:aRt,render:mkn},Symbol.toStringTag,{value:"Module"}));async function oRt(t,e){const r=new ru({multigraph:!0,compound:!0}),n=[...e.edges],i=He(),a=t.insert("g").attr("class","root"),s=a.insert("g").attr("class","clusters"),o=a.insert("g").attr("class","edges edgePath"),l=a.insert("g").attr("class","edgeLabels"),u=a.insert("g").attr("class","nodes"),h=new Map,d=t.node()!=null;await Promise.all(e.nodes.map(async f=>{var p;if(f.isGroup)r.setNode(f.id,{...f});else{if(d){const g=await S7(u,f,{config:i,dir:f.dir}),m=((p=g.node())==null?void 0:p.getBBox())??{width:0,height:0};h.set(f.id,g),f.width=m.width,f.height=m.height}r.setNode(f.id,{...f})}}));for(const f of n)r.setEdge(f.start,f.end,{...f},f.id),e.edges.some(g=>g.id===f.id)||e.edges.push(f);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:f}=await Promise.resolve().then(()=>tri);f(t,e)}return{graph:r,groups:{clusters:s,edgePaths:o,edgeLabels:l,nodes:u,rootGroups:a},nodeElements:h}}C(oRt,"createGraphWithElements");var lRt=5,JZ=1e-5,eJ=1e-6;function tJ(t){const e=[];for(let r=0;r=1-eJ||f<=eJ||f>=1-eJ?null:{point:{x:t.x+d*i,y:t.y+d*a},tA:d,tB:f}}C(cRt,"segmentIntersection");function eSe(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}C(eSe,"isHorizontalSeg");function uRt(t){const e=[];for(let r=0;r=Math.abs(r)?e>=0?1:0:r>=0?1:0}C(hRt,"getArcSweepFlag");var ykn=.001;function dRt(t,e){if(t.length<2)return t.map(a=>({...a}));const r=t.map(a=>({...a})),n=e.arrowTypeStart&&Rl[e.arrowTypeStart];if(n){const a=t[0],s=t[1],o=Math.atan2(s.y-a.y,s.x-a.x);r[0].x=a.x+n*Math.cos(o),r[0].y=a.y+n*Math.sin(o)}const i=e.arrowTypeEnd&&Rl[e.arrowTypeEnd];if(i){const a=t.length,s=t[a-2],o=t[a-1],l=Math.atan2(o.y-s.y,o.x-s.x);r[a-1].x=o.x-i*Math.cos(l),r[a-1].y=o.y-i*Math.sin(l)}return r}C(dRt,"applyMarkerOffsets");function fRt(t,e,r,n,i){const a=t.point.x,s=t.point.y,o={x:a-e*t.r,y:s-r*t.r},l={x:a+e*t.r,y:s+r*t.r},u=[`L${l3(o)}`];return i==="arc"?u.push(`A${yg(t.r)},${yg(t.r)} 0 0 ${n} ${l3(l)}`):u.push(`M${l3(l)}`),u}C(fRt,"emitJump");function tSe(t,e,r,n){const i=e.x-t.x,a=e.y-t.y,s=r.x-e.x,o=r.y-e.y,l=Math.hypot(i,a),u=Math.hypot(s,o);if(l0){const x=tSe(i[u-1],i[u],i[u+1]??i[u],lRt);x&&(m=x.cutLen)}let v=d,y=null;a&&ux.t-w.t);for(const x of b)x.r=Math.min(x.r,x.d-m,v-x.d);for(let x=0;xw){const A=w/2;b[x].r=Math.min(b[x].r,A),b[x+1].r=Math.min(b[x+1].r,A)}}for(const x of b)x.r=2?n:null}catch{return null}}C(vRt,"decodeDataPoints");function yRt(t,e,r){if(!r.enabled)return;const n=t.node();if(!n)return;const i=new Map;for(const u of e)i.set(u.id,u);const a=[],s=new Map;for(const u of e){const h=typeof CSS<"u"&&CSS.escape?CSS.escape(u.id):u.id,d=n.querySelector(`path[data-id="${h}"]`);if(!d)continue;s.set(u.id,d);const p=vRt(d.getAttribute("data-points"))??u.points;a.push({...u,points:p})}const o=uRt(a);if(o.length===0)return;const l=new Map;for(const u of o){const h=l.get(u.jumpEdgeId)??[];h.push(u),l.set(u.jumpEdgeId,h)}for(const u of a){const h=l.get(u.id);if(!h||h.length===0)continue;const d=i.get(u.id),f=d==null?void 0:d.curve;if(f!==void 0&&!mRt(f))continue;const p=s.get(u.id);if(!p)continue;if(f===void 0){const x=p.getAttribute("d")??"";if(!gRt(x))continue}const g=p.getAttribute("style")??"",m=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(g),v=m?Number.parseFloat(m[1]):null,y=m?Number.parseFloat(m[2]):null,b=pRt(u,h,r);if(p.setAttribute("d",b),v!==null&&y!==null&&typeof p.getTotalLength=="function"){const x=p.getTotalLength(),w=Math.max(0,x-v-y),A=`0 ${v} ${w} ${y}`,T=g.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${A};`).replace(/;\s*;+/g,";");p.setAttribute("style",T)}}}C(yRt,"applyLineJumpsToSvg");async function bRt(t,e){var i,a;for(const s of t.nodes)s.isGroup?await tX(e.clusters,s):iX(s);const r=new Map;for(const s of t.nodes)s!=null&&s.id&&r.set(s.id,s);for(const s of t.edges){const o=s.start?r.get(s.start)??{}:{},l=s.end?r.get(s.end)??{}:{},u=Mbe(e.edgePaths,{...s},{},t.type,o,l,t.diagramId);s.label&&await aX(e.rootGroups,s),s.label&&xRt(s,u)}const n=(a=(i=t.config)==null?void 0:i.swimlane)==null?void 0:a.lineHops;if(n!==!1){const s=n==="gap"?"gap":"arc",o=t.edges.filter(l=>Array.isArray(l.points)&&l.points.length>=2).map(l=>({id:l.id,points:l.points,curve:l.curve,arrowTypeStart:l.arrowTypeStart,arrowTypeEnd:l.arrowTypeEnd}));yRt(e.edgePaths,o,{enabled:!0,jumpRadius:6,jumpStyle:s})}}C(bRt,"adjustLayout");function xRt(t,e){const r=(e==null?void 0:e.updatedPath)??(e==null?void 0:e.originalPath),n=Dr(),{subGraphTitleTotalMargin:i}=q5({flowchart:n.flowchart??{}});if(t.label){const a=O7.get(t.id);let s=t.x,o=t.y;if(r){const l=ln.calcLabelPosition(r);me.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t!=null&&t.startLabelLeft){const a=oo.get(t.id).startLeft;let s=t==null?void 0:t.x,o=t==null?void 0:t.y;if(r){const l=ln.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=oo.get(t.id).startRight;let s=t.x,o=t.y;if(r){const l=ln.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=oo.get(t.id).endLeft;let s=t.x,o=t.y;if(r){const l=ln.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=oo.get(t.id).endRight;let s=t.x,o=t.y;if(r){const l=ln.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}}C(xRt,"positionEdgeLabel");var rSe="__swimlane_default__",bkn=21,wRt=20;function nSe(t){return Math.max(t.padding??wRt,wRt)}C(nSe,"topLaneHorizontalPadding");function ARt(t){const{x:e,y:r,width:n,height:i}=t,a=t.swimlaneContentTop;if(typeof e!="number"||typeof r!="number"||typeof n!="number"||typeof i!="number"||typeof a!="number"||!Number.isFinite(e)||!Number.isFinite(r)||!Number.isFinite(n)||!Number.isFinite(i)||!Number.isFinite(a)||n<=0||i<=0){delete t.groupTitleRect;return}const s=r-i/2,o=Math.min(a,r+i/2),l=Math.min(bkn,Math.max(0,o-s)),u=s+l;if(u<=s){delete t.groupTitleRect;return}t.groupTitleRect={left:e-n/2,right:e+n/2,top:s,bottom:u}}C(ARt,"assignTopLaneTitleRect");function TRt(t){const e=t.direction,r=t.nodes??(t.nodes=[]);for(const a of t.nodes??[])a.isGroup&&!a.parentId&&(a.shape="swimlane",e&&(a.direction=e));const n=r.filter(a=>!a.isGroup&&!a.parentId);if(n.length===0)return;let i=r.find(a=>a.id===rSe);i?i.isGroup&&(i.shape="swimlane",e&&(i.direction=e)):(i={id:rSe,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},r.push(i));for(const a of n)a.parentId=rSe}C(TRt,"prepareLayoutForSwimlanes");function SRt(t){const e=new Map;for(const l of t.nodes??[])e.set(l.id,l);const r=[];for(const l of t.edges??[]){const u=typeof l.start=="string"?l.start:void 0,h=typeof l.end=="string"?l.end:void 0;!u||!h||l.labelNodeId||r.push({id:l.id,src:u,dst:h,ref:l})}const n=t.nodes??[],i=n.filter(l=>l.isGroup),a=n.filter(l=>!l.isGroup);return{nodes:[...[...i].reverse(),...a].map(l=>l.id),edges:r,layout:t,nodeById:e}}C(SRt,"toGraphView");function CRt(t,e,r,n){const{layout:i}=t,a=t.nodeById,s=(n==null?void 0:n.layerGap)??100,o=(n==null?void 0:n.nodeGap)??40;let l=0;for(const f of e.layers){let p=0;for(const g of f){const m=a.get(g);if(!m){p++;continue}m.layer=l,m.order=p;const v=r.x[g]??p*o,y=r.y[g]??l*s;m.x=v,m.y=y,p++}l++}const u=i.nodes??[],h=new Map,d=[];for(const f of u){if(!(f!=null&&f.isGroup))continue;f.parentId||d.push(f);const p=u.filter(b=>b.parentId===f.id);let g=1/0,m=-1/0,v=1/0,y=-1/0;for(const b of p){const x=b.x??r.x[b.id],w=b.y??r.y[b.id],A=b.width??0,T=b.height??0;x!=null&&w!=null&&(g=Math.min(g,x-A/2),m=Math.max(m,x+A/2),v=Math.min(v,w-T/2),y=Math.max(y,w+T/2))}if(g===1/0||v===1/0)f.x=f.x??0,f.y=f.y??0,f.width=f.width??0,f.height=f.height??0;else{const b=f.padding??20,x=f.parentId?b:2*nSe(f),w=b,A=Math.max(0,m-g)+x,T=Math.max(0,y-v)+w,S=(g+m)/2,O=(v+y)/2;f.x=S,f.y=O,f.width=A,f.height=T,h.set(f.id,{minX:g,maxX:m,minY:v,maxY:y})}}if(d.length>0&&h.size>0){let f=1/0,p=-1/0,g=0;for(const m of d){const v=m.padding??20;v>g&&(g=v);const y=h.get(m.id);y&&(f=Math.min(f,y.minY),p=Math.max(p,y.maxY))}if(f!==1/0&&p!==-1/0){const m=Math.max(0,p-f),y=Math.max(g,36),b=m+2*y,x=(f+p)/2;for(const k of d)k.y=x,k.height=b,k.swimlaneContentTop=f;const w=[...d].sort((k,E)=>{const _=k.x??0,I=E.x??0;return _-I}),A=[],T=[],S=[];for(const k of w){const E=h.get(k.id);if(!E)continue;const _=Math.max(0,E.maxX-E.minX)+2*nSe(k),I=(E.minX+E.maxX)/2;A.push(k.id),T.push(I),S.push(_)}const O=A.length;if(O>0){const k=new Map;if(O===1)k.set(A[0],S[0]);else{const E=[];for(let D=0;D0&&i>0?{cx:e,cy:r,rect:u3(e,r,n,i)}:void 0}C(iSe,"measuredNodeRect");function aSe(t){if(t.isGroup)return;const e=iSe(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}C(aSe,"nodeBoundsInfoFor");function fp(t,e,r=Ml){return Math.abs(t.x-e.x)r}C(Hs,"isHorizontalSegment");function Ws(t,e,r=Ml){return yi(t,e,r)&&Math.abs(t.y-e.y)>r}C(Ws,"isVerticalSegment");function Vu(t,e,r,n){return Math.max(0,Math.min(Math.max(t,e),Math.max(r,n))-Math.max(Math.min(t,e),Math.min(r,n)))}C(Vu,"overlapLength");function E0(t,e,r=Ml){return t.horizontal&&e.horizontal&&Ci(t.a,e.a,r)?Vu(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&yi(t.a,e.a,r)?Vu(t.a.y,t.b.y,e.a.y,e.b.y):0}C(E0,"sameAxisSegmentOverlapLength");function c3(t,e=Ml){const r=[];for(let n=0;n0?r[r.length-1]:void 0;(!i||!fp(i,n,e))&&r.push({x:n.x,y:n.y})}return r}C(Li,"dedupeConsecutivePoints");function sSe(t,e=Ml){if(!t||t.length!==4)return;const[r,n,i,a]=t;return Hs(r,n,e)&&Ws(n,i,e)&&Hs(i,a,e)?{kind:"HVH",p0:r,p1:n,p2:i,p3:a}:Ws(r,n,e)&&Hs(n,i,e)&&Ws(i,a,e)?{kind:"VHV",p0:r,p1:n,p2:i,p3:a}:void 0}C(sSe,"classifyThreeSegmentRoute");function rJ(t,e,r,n=0){const i=Math.min(t.x,e.x),a=Math.max(t.x,e.x),s=Math.min(t.y,e.y),o=Math.max(t.y,e.y);return a>r.left-n&&ir.top-n&&se.left+r&&t.xe.top+r&&t.y=e.right&&t.top<=e.top&&t.bottom>=e.bottom}C(kRt,"rectContainsRect");function nJ(t,e){return t.lefte.left&&t.tope.top}C(nJ,"rectsOverlap");function lSe(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}C(lSe,"inflateRect");function u3(t,e,r,n){return{left:t-r/2,right:t+r/2,top:e-n/2,bottom:e+n/2}}C(u3,"rectFromCenterSize");function Vh(t){var e;return(e=iSe(t))==null?void 0:e.rect}C(Vh,"rectOfNodeBounds");function vC(t,e){switch(e){case"top":return{x:t.cx,y:t.rect.top};case"bottom":return{x:t.cx,y:t.rect.bottom};case"left":return{x:t.rect.left,y:t.cy};case"right":return{x:t.rect.right,y:t.cy}}}C(vC,"portForRectSide");function cSe(t,e,r,n,i,a=Ml){const s=e==="left"||e==="right",o=n==="left"||n==="right";if(s&&o){if(e==="right"&&n==="left"&&t.xr.x){if(Ci(t,r,a))return[t,r];const d=(t.x+r.x)/2;return[t,{x:d,y:t.y},{x:d,y:r.y},r]}if(e===n){if(Ci(t,r,a))return;const d=e==="left"?Math.min(t.x,r.x)-i:Math.max(t.x,r.x)+i;return[t,{x:d,y:t.y},{x:d,y:r.y},r]}return}if(!s&&!o){if(e===n){if(yi(t,r,a))return;const f=e==="top"?Math.min(t.y,r.y)-i:Math.max(t.y,r.y)+i;return[t,{x:t.x,y:f},{x:r.x,y:f},r]}if(!(e==="bottom"&&n==="top"&&t.yr.y))return;if(yi(t,r,a))return[t,r];const d=(t.y+r.y)/2;return[t,{x:t.x,y:d},{x:r.x,y:d},r]}if(s&&!o){const h=e==="right"&&r.x>t.x||e==="left"&&r.xr.y;return h&&d?[t,{x:r.x,y:t.y},r]:void 0}const l=e==="bottom"&&r.y>t.y||e==="top"&&r.yr.x;return l&&u?[t,{x:t.x,y:r.y},r]:void 0}C(cSe,"buildOrthogonalPortPath");function uSe(t,e,r,n){return e==="left"||e==="right"?[t,{x:n,y:t.y},{x:n,y:r.y},r]:[t,{x:t.x,y:n},{x:r.x,y:n},r]}C(uSe,"buildSameSideTrackPath");function iJ(t){const e=new Map,r=[];for(const n of t){if(n.isEdgeLabel)continue;const i=aSe(n);i&&(e.set(i.id,i),r.push({id:i.id,rect:i.rect}))}return{nodeInfoById:e,realNodeRects:r}}C(iJ,"collectRealNodeBounds");function O2(t){const e=[],r=[];for(const n of t){const i=aSe(n);if(!i)continue;const a={id:i.id,rect:i.rect};n.isEdgeLabel?r.push(a):e.push(a)}return{realNodeRects:e,labelNodeRects:r}}C(O2,"collectNodeRectEntries");function ERt(t,{includeEdgeLabels:e=!0}={}){const r=[];for(const n of t){if(n.isGroup||!e&&n.isEdgeLabel)continue;const i=n.x??0,a=n.y??0,s=n.width??0,o=n.height??0;r.push({nodeId:n.id,...u3(i,a,s,o)})}return r}C(ERt,"collectLayoutNodeRects");function hSe(t,e,r=Ml){const n=t.start,i=t.end;if(!n||!i)return;const a=e.get(n),s=e.get(i);if(!(!a||!s))return{srcId:n,dstId:i,srcInfo:a,dstInfo:s,collinearX:Math.abs(a.cx-s.cx)g||fy)return!1;const b=Math.abs(m-h.a.x)i:a&&o&&Ci(t,r,i)?Vu(t.x,e.x,r.x,n.x)>i:!1}C(_Rt,"sameAxisSegmentsOverlap");function aJ(t,e,r,n,{epsilon:i=Ml,skipDegenerateOther:a=!1}={}){for(const s of r){if(s===n||s.isLayoutOnly)continue;const o=s.points;if(!(!o||o.length<2))for(let l=0;lf+i&&gm+i&&dn+Ml&&t=2?e[e.length-2]:void 0,l=(s?yi(s,i):!1)?{x:i.x,y:a.y}:{x:a.x,y:i.y};e.push(l)}e.push(a)}const r=[];for(const n of e){const i=r[r.length-1];(!i||!fp(i,n))&&r.push(n)}return r}C(sJ,"orthogonalizePolyline");function _0(t){if(t.length<3)return t;let e=[...t];for(let r=0;r<32;r++){const n=DRt(e);if(e=n.points,!n.changed)break}return e}C(_0,"simplifyPolyline");var gn=.001,wkn=.5,LRt=4;function pSe(t,e,r){const n=t;if(n.isLayoutOnly||!n.points||n.points.length=0&&i=t.length)return t;const a=i-n;if(a<0||a>=t.length)return t;const s=MRt(t[i],t[a],e);return r?[s,...t.slice(i)]:[...t.slice(0,i+1),s]}C(gSe,"clipEndpoint");function IRt(t,e){for(const r of t){const n=pSe(r,e,2);if(!n)continue;let i=[...n.points];n.srcRect&&(i=gSe(i,n.srcRect,!0)),n.dstRect&&(i=gSe(i,n.dstRect,!1)),i=_0(sJ(i)),i=xSe(i,n.srcRect,n.dstRect),n.edge.points=_0(sJ(i))}}C(IRt,"clipEdgeEndpointsToNodeBoundaries");function mSe(t,e,r,n=!1){if(Ci(t,e,gn)){if(e.yr.bottom+gn)return e;if(n){if(t.xr.right+gn)return{x:r.right,y:t.y}}return{x:Math.abs(e.x-r.left)<=Math.abs(e.x-r.right)?r.left:r.right,y:t.y}}if(yi(t,e,gn)){if(e.xr.right+gn)return e;if(n){if(t.yr.bottom+gn)return{x:t.x,y:r.bottom}}const i=Math.abs(e.y-r.top)<=Math.abs(e.y-r.bottom);return{x:t.x,y:i?r.top:r.bottom}}return e}C(mSe,"snapEndpointToBoundary");function oJ(t,e,r){const n=t[e];for(let i=e+r;i>=0&&in.lo)),r=Math.min(...t.map(n=>n.hi));if(!(e>r))return{lo:e,hi:r}}C(PRt,"intersectRanges");function ySe(t,e){return e==="left"||e==="right"?lJ(t.top,t.bottom):lJ(t.left,t.right)}C(ySe,"clearanceRangeForSide");function cJ(t,e,r){const n=t.y>=r.top-gn&&t.y<=r.bottom+gn,i=t.x>=r.left-gn&&t.x<=r.right+gn;if(Ci(t,e,gn)&&n){if(Math.abs(t.x-r.left)0?PRt(a):void 0}C(NRt,"straightClearanceRange");function bSe(t,e,r,n,i){const a=NRt(t,e,r,n,i);if(!a)return;const s=i?t.y:t.x,o=Math.min(a.hi,Math.max(a.lo,s));if(!(Math.abs(o-s)({...o}));for(let o=e;o>=0&&o=r.left-gn&&Math.max(t.x,e.x)<=r.right+gn,i=Math.min(t.y,e.y)>=r.top-gn&&Math.max(t.y,e.y)<=r.bottom+gn;if(Math.abs(t.y-r.top)n.bottom+gn;case"left":return Ci(e,r,gn)&&r.xn.right+gn}}C(TSe,"leavesOutward");function SSe(t,e,r){if(t.length<3)return t;if(r){const a=ASe(t[0],t[1],e);return a&&TSe(a,t[1],t[2],e)?t.slice(1):t}const n=t.length-1,i=ASe(t[n-1],t[n],e);return i&&TSe(i,t[n-1],t[n-2],e)?t.slice(0,n):t}C(SSe,"collapseOwnBorderStub");function FRt(t,e,r){let n=t;if(e){const a=oJ(n,0,1);if(a){const s=mSe(a,n[0],e);s!==n[0]&&(n=[s,...n.slice(1)])}n=SSe(n,e,!0)}if(r){const a=n.length-1,s=oJ(n,a,-1);if(s){const o=mSe(s,n[a],r,!0);o!==n[a]&&(n=[...n.slice(0,a),o])}n=SSe(n,r,!1)}const i=xSe(n,e,r);return i!==n||n.length===2?i:(e&&(n=wSe(n,e,!0)),r&&(n=wSe(n,r,!1)),n)}C(FRt,"snapAndCollapseEndpoints");function CSe(t,e){for(const r of t){const n=pSe(r,e,2);if(!n)continue;const i=Li(n.points,gn),a=FRt(i,n.srcRect,n.dstRect);if(a.length<3){n.edge.points=a;continue}const s=[a[0],{...a[0]},...a.slice(1,-1),a[a.length-1],{...a[a.length-1]}];n.edge.points=s}}C(CSe,"prepareEdgeEndpointsForRenderer");function OSe(t){return new Map(t.map(e=>[e.id,e]))}C(OSe,"buildNodeMap");function zRt(t,e){let r=t.parentId,n=null;for(;r;){const i=e.get(r);if(!(i!=null&&i.isGroup))break;n=i.id,r=i.parentId}return n}C(zRt,"resolveTopLevelGroupId");function kSe(t,e){let r=0,n=t.parentId;for(;n;){const i=e.get(n);if(!(i!=null&&i.isGroup))break;r++,n=i.parentId}return r}C(kSe,"groupDepth");function ESe(t){let e=1/0,r=-1/0,n=1/0,i=-1/0;for(const a of t){const s=a.x,o=a.y;if(typeof s!="number"||typeof o!="number")continue;const l=a.width??0,u=a.height??0;e=Math.min(e,s-l/2),r=Math.max(r,s+l/2),n=Math.min(n,o-u/2),i=Math.max(i,o+u/2)}return e===1/0||n===1/0?null:{minX:e,maxX:r,minY:n,maxY:i}}C(ESe,"boundsForChildren");function URt(t,e){const r=t.padding??20;t.x=(e.minX+e.maxX)/2,t.y=(e.minY+e.maxY)/2,t.width=Math.max(0,e.maxX-e.minX)+r,t.height=Math.max(0,e.maxY-e.minY)+r}C(URt,"applyGroupBounds");function VRt(t){const e=OSe(t),r=t.filter(n=>n.isGroup&&n.parentId).sort((n,i)=>kSe(i,e)-kSe(n,e));for(const n of r){const i=t.filter(s=>s.parentId===n.id),a=ESe(i);a&&URt(n,a)}}C(VRt,"recomputeNestedGroupBounds");function uJ(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(l=>!l.isGroup);let a=1/0,s=-1/0;for(const l of i){const u=l[e];typeof u=="number"&&(a=Math.min(a,u),s=Math.max(s,u))}if(!Number.isFinite(a)||!Number.isFinite(s))return!1;const o=C(l=>a+s-l,"mirror");for(const l of r){const u=l[e];typeof u=="number"&&(l[e]=o(u));const h=l.groupTitleRect;h&&(l.groupTitleRect=e==="x"?{...h,left:o(h.right),right:o(h.left)}:{...h,top:o(h.bottom),bottom:o(h.top)})}for(const l of n)for(const u of l.points??[])u[e]=o(u[e]);return!0}C(uJ,"mirrorAxis");function QRt(t){return(t.nodes??[]).some(r=>!r.isGroup)?uJ(t,"y"):!0}C(QRt,"applyBtDirectionTransform");function GRt(t,e="LR"){const r=t.nodes??[],n=t.edges??[],i=r.filter(L=>!L.isGroup);let a=1/0,s=1/0;for(const L of i){const R=L.x??0,D=L.y??0;R0?Math.max(1,h/d):1;for(const L of i){const R=L.x??0,M=((L.y??0)-s)*f+o,P=R-a;L.x=M,L.y=P}for(const L of n)if(L.points)for(const R of L.points){const D=R.x,P=(R.y-s)*f+o,N=D-a;R.x=P,R.y=N}VRt(r);const p=r.filter(L=>L.isGroup&&!L.parentId);if(p.length===0)return e==="RL"&&uJ(t,"x"),!0;const g=OSe(r),m=new Map;for(const L of r){if(L.isGroup)continue;const R=zRt(L,g);if(!R)continue;const D=m.get(R)??[];D.push(L),m.set(R,D)}let v=0;for(const L of p){const R=L.padding??0;R>v&&(v=R)}const y=[];let b=1/0,x=-1/0;for(const L of p){const R=m.get(L.id)??[],D=ESe(R);D&&(b=Math.min(b,D.minX),x=Math.max(x,D.maxX),y.push({lane:L,contentTop:D.minY,contentBottom:D.maxY,centerY:(D.minY+D.maxY)/2}))}if(b===1/0||x===-1/0)return!0;const w=Math.max(0,x-b),A=Math.max(v,10),T=w+2*A,S=o+T,E=(b+x)/2-T/2-o,_=E+S/2,I=Math.max(v,o);y.sort((L,R)=>L.centerY-R.centerY);for(let L=0;Lf.cy?y.bottom:y.top,I=f.cx+b;if(I<=y.left+bg||I>=y.right-bg)continue;x={x:I,y:_},w={x:I,y:o.y},A={x:o.x,y:o.y}}else{const _=p.cx>f.cx?y.right:y.left,I=f.cy+b;if(I<=y.top+bg||I>=y.bottom-bg)continue;x={x:_,y:I},w={x:o.x,y:I},A={x:o.x,y:o.y}}const T=fp(x,w,bg),S=fp(w,A,bg);if(T&&S||!T&&fo(x,w,n,[h],1)||!S&&fo(w,A,n,[d],1))continue;const O=!T&&aJ(x,w,t,i,{epsilon:bg,skipDegenerateOther:!0}),k=!S&&aJ(w,A,t,i,{epsilon:bg,skipDegenerateOther:!0});if(!(O||k)){T?v=[w,A]:S?v=[x,w]:v=[x,w,A];break}}v&&(i.points=v)}}C(HRt,"portSwapToLShape");function WRt(t,e){const{realNodeRects:a,labelNodeRects:s}=O2(e.values());for(const o of t){if(o.isLayoutOnly)continue;const l=o.points;if(!l||l.length<4)continue;const u=Li(l,.001);if(u.length<4)continue;const h=u.length-1,d=u[h],f=u[h-1],p=u[h-2],g=d.x-f.x,m=d.y-f.y,v=Math.hypot(g,m);if(v>=10||v<.001)continue;const y=f.x-p.x,b=f.y-p.y;if(Math.hypot(y,b)<.001)continue;const w=Hs(f,d,.001),A=Ws(f,d,.001),T=Hs(p,f,.001),S=Ws(p,f,.001);if(!(w&&S||A&&T))continue;const O=o.end,k=o.start,E=O?e.get(O):void 0;if(!E)continue;const _=E.x??0,I=E.y??0,L=Vh(E);if(!L)continue;let R,D;if(S){const z=b<0;R={x:_,y:p.y},D={x:_,y:z?L.bottom:L.top}}else{const z=y>0;R={x:p.x,y:I},D={x:z?L.right:L.left,y:I}}if(fo(R,D,a,O?[O]:[],-2)||fo(R,D,s,[],-2))continue;if(k){const z=e.get(k),U=z?Vh(z):void 0;if(U&&oSe(R,U,2))continue}const M=C((z,U)=>`${z.x.toFixed(3)},${z.y.toFixed(3)}|${U.x.toFixed(3)},${U.y.toFixed(3)}`,"ownSegmentKey"),P=new Set;for(let z=0;z{for(const Q of t){if(Q===o||Q.isLayoutOnly)continue;const G=Q.points;if(!(!G||G.length<2))for(let X=0;X=0){const z=u[h-3],U=[k,O].filter(Q=>!!Q);if(fo(z,R,a,U,-2)||N(z,R))continue}const B=[...u.slice(0,h-2),R,D];o.points=B;const V=o.labelNodeId;if(V){const z=e.get(V);if(z){const U=z.width??0,Q=z.height??0;if(U>0&&Q>0){let G,X,Y=-1;for(let le=0;le=U+2||ve&&ee>=Q+2)&&ee>Y&&(Y=ee,G=(q.x+Z.x)/2,X=(q.y+Z.y)/2)}G!==void 0&&X!==void 0&&(z.x=G,z.y=X)}}}}}C(WRt,"collapseShortTerminalStub");var Lr=.001,Il=8,Yn=c3,_Se=C((t,e)=>yi(t,e,Lr)||Ci(t,e,Lr),"orthogonallyAligned");function YRt(t,e){const i=C((p,g)=>{const m=p.x??0,v=p.y??0,y=g.x-m,b=g.y-v;let x=(p.width??0)/2,w=(p.height??0)/2;return Math.abs(b)*x>Math.abs(y)*w?(b<0&&(w=-w),{x:m+(b===0?0:w*y/b),y:v+w}):(y<0&&(x=-x),{x:m+x,y:v+(y===0?0:x*b/y)})},"rectIntersect"),a=C((p,g)=>{const m=Li(p.points??[]);if(m.length<2)return;const v=g?p.start:p.end,y=v?e.get(v):void 0,b=y?Vh(y):void 0;if(!y||!v||!b)return;const x=g?m[0]:m[m.length-1],w=g?m[1]:m[m.length-2],A=i(y,x);let T=x;if(_Se(w,A)&&(T=w),yi(A,T,Lr))return{edge:p,edgeId:String(p.id??""),nodeId:v,atStart:g,orientation:"V",coord:A.x,min:Math.min(A.y,T.y),max:Math.max(A.y,T.y),boundary:A,railEnd:T,rect:b};if(Ci(A,T,Lr))return{edge:p,edgeId:String(p.id??""),nodeId:v,atStart:g,orientation:"H",coord:A.y,min:Math.min(A.x,T.x),max:Math.max(A.x,T.x),boundary:A,railEnd:T,rect:b}},"terminalLaneFor"),s=C((p,g)=>Math.max(0,Math.min(p.max,g.max)-Math.max(p.min,g.min)),"projectedOverlapLength"),o=C((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:p.orientation==="H"?(Math.abs(p.boundary.x-p.rect.left)<1||Math.abs(p.boundary.x-p.rect.right)<1)&&yi(p.boundary,g.boundary,1):(Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1)&&Ci(p.boundary,g.boundary,1),"sameTerminalFace"),l=C((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:s(p,g)>=Il&&Math.abs(p.coord-g.coord)<.5,"exactTerminalLaneConflict"),u=C((p,g)=>{if(p.nodeId!==g.nodeId||p.orientation!==g.orientation||p.orientation!=="H"||p.atStart===g.atStart)return!1;const m=s(p,g);if(m2*v?!1:o(p,g)&&Math.abs(p.coord-g.coord)<16},"nearTerminalLaneConflict"),h=C((p,g)=>{const m=Li(p.edge.points??[]);if(m.length<2)return;const v=p.orientation==="V"?{x:p.boundary.x+g,y:p.boundary.y}:{x:p.boundary.x,y:p.boundary.y+g},y=p.orientation==="V"?{x:p.railEnd.x+g,y:p.railEnd.y}:{x:p.railEnd.x,y:p.railEnd.y+g};if(!C(()=>Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1?Ci(v,p.boundary,Lr)&&v.x>=p.rect.left+1&&v.x<=p.rect.right-1:Math.abs(p.boundary.x-p.rect.left)<1||Math.abs(p.boundary.x-p.rect.right)<1?yi(v,p.boundary,Lr)&&v.y>=p.rect.top+1&&v.y<=p.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(p.atStart){const T=m.length>1&&fp(m[1],p.railEnd,Lr),S=m.slice(T?2:1),O=S[0];return O&&!_Se(O,y)?void 0:[v,y,...S]}const x=m.length>1&&fp(m[m.length-2],p.railEnd,Lr),w=m.slice(0,x?-2:-1),A=w[w.length-1];if(!(A&&!_Se(A,y)))return[...w,y,v]},"shiftedCandidate"),d=C(p=>{const g=p.edge,m=Li(g.points??[]);if(m.length!==2)return!1;const v=g.start,y=g.end,b=v?e.get(v):void 0,x=y?e.get(y):void 0;if(!b||!x)return!1;const w=b.x??0,A=b.y??0,T=x.x??0,S=x.y??0,[O,k]=m;return Ci(O,k,Lr)&&Math.abs(A-S)<1&&Math.abs(w-T)>1||yi(O,k,Lr)&&Math.abs(w-T)<1&&Math.abs(A-S)>1},"laneIsStraightCollinearConnector"),f=[-7,7,-2*7,2*7,-3*7,3*7];for(let p=0;p<8;p++){const g=t.filter(v=>!v.isLayoutOnly).flatMap(v=>[a(v,!0),a(v,!1)]).filter(v=>!!v);let m=!1;for(let v=0;v{const O=d(T),k=d(S);return O!==k?Number(O)-Number(k):+!S.atStart-+!T.atStart});for(const T of A){for(const S of f){const O=h(T,S);if(!O)continue;const k=a({...T.edge,points:O},T.atStart);if(!(!k||g.some(E=>E.edge!==T.edge&&(l(k,E)||w&&u(k,E))))){T.edge.points=O,m=!0;break}}if(m)break}}if(!m)return}}C(YRt,"separateSharedRenderedTerminalLanes");function qRt(t,e){const{realNodeRects:n,labelNodeRects:i}=O2(e.values()),a=C((o,l)=>{const u=o.start,h=o.end,d=Yn(l);if(d.length!==l.length-1)return!1;const f=[u,h].filter(p=>!!p);for(const p of d)if(fo(p.a,p.b,n,f,-2)||fo(p.a,p.b,i,[],-2))return!1;for(const p of t){if(p===o||p.isLayoutOnly)continue;const g=p.points;if(!(!g||g.length<2)){for(const m of d)for(const v of Yn(Li(g)))if(E0(m,v,.5)>=Il||x1(m.a,m.b,v.a,v.b,Lr))return!1}}return!0},"candidateIsSafe"),s=C((o,l)=>{if(l+4>=o.length)return;const u=o[l],h=o[l+1],d=o[l+2],f=o[l+3],p=o[l+4],g=Hs(u,h)&&Ws(h,d)&&Hs(d,f)&&Ws(f,p)&&yi(u,f,Lr)&&yi(u,p,Lr)&&yi(h,d,Lr)&&(h.x-u.x)*(f.x-d.x)<0,m=Ws(u,h)&&Hs(h,d)&&Ws(d,f)&&Hs(f,p)&&Ci(u,f,Lr)&&Ci(u,p,Lr)&&Ci(h,d,Lr)&&(h.y-u.y)*(f.y-d.y)<0;if(g||m)return Li([...o.slice(0,l+1),p,...o.slice(l+5)]);if(l+5>=o.length)return;const v=o[l+5],y=Ws(u,h)&&Hs(h,d)&&Ws(d,f)&&Hs(f,p)&&Ws(p,v)&&yi(u,p,Lr)&&yi(u,v,Lr)&&yi(d,f,Lr)&&(d.x-h.x)*(p.x-f.x)<0,b=Hs(u,h)&&Ws(h,d)&&Hs(d,f)&&Ws(f,p)&&Hs(p,v)&&Ci(u,p,Lr)&&Ci(u,v,Lr)&&Ci(d,f,Lr)&&(d.y-h.y)*(p.y-f.y)<0;if(!(!y&&!b))return Li([...o.slice(0,l+1),v,...o.slice(l+6)])},"withoutDogleg");for(let o=0;o<8;o++){let l=!1;for(const u of t){if(u.isLayoutOnly)continue;const h=Li(u.points??[]);for(let d=0;d<=h.length-5;d++){const f=s(h,d);if(!(!f||!a(u,f))){u.points=f,l=!0;break}}if(l)break}if(!l)return}}C(qRt,"collapseRedundantRectangularDoglegs");function RSe(t,e){const{realNodeRects:a,labelNodeRects:s}=O2(e.values()),o=t.filter(g=>!g.isLayoutOnly),l=C((g,m,v)=>Li(g===m?v??[]:g.points??[]),"pointsFor"),u=C((g,m)=>{let v=0;for(let y=0;y{const m=Yn(g);if(m.length!==3)return;const v=m[1];if(!(m[0].horizontal===v.horizontal||m[2].horizontal===v.horizontal))return{index:v.index,horizontal:v.horizontal,vertical:v.vertical,segment:v}},"middleRail"),d=C((g,m)=>{const v=[g.start,g.end].filter(y=>!!y);return a.filter(y=>{if(v.includes(y.id))return!1;const b=y.rect;return m.horizontal?Vu(m.a.x,m.b.x,b.left,b.right)>=Il&&m.a.y>=b.top-2&&m.a.y<=b.bottom+2:Vu(m.a.y,m.b.y,b.top,b.bottom)>=Il&&m.a.x>=b.left-2&&m.a.x<=b.right+2})},"blockingRectsFor"),f=C((g,m,v)=>{const y=g.map(x=>({...x}));if(m.horizontal)y[m.index].y=v,y[m.index+1].y=v;else if(m.vertical)y[m.index].x=v,y[m.index+1].x=v;else return;const b=_0(Li(y));return Yn(b).length===b.length-1?b:void 0},"candidateByMovingRail"),p=C((g,m,v)=>{const y=[g.start,g.end].filter(x=>!!x),b=Yn(m);if(b.length!==m.length-1)return!1;for(const x of b)if(fo(x.a,x.b,a,y,-2)||fo(x.a,x.b,s,[],-2))return!1;for(const x of o)if(x!==g){for(const w of b)for(const A of Yn(l(x)))if(E0(w,A,.5)>=Il)return!1}return u(g,m)<=v},"candidateIsSafe");for(let g=0;g<8;g++){const m=u();let v=!1;for(const y of o){const b=l(y),x=h(b);if(!x)continue;const w=d(y,x.segment);if(w.length===0)continue;const A=x.horizontal?[Math.min(...w.map(T=>T.rect.top))-20,Math.max(...w.map(T=>T.rect.bottom))+20]:[Math.min(...w.map(T=>T.rect.left))-20,Math.max(...w.map(T=>T.rect.right))+20];for(const T of A){const S=f(b,x.segment,T);if(!(!S||!p(y,S,m))){y.points=S,v=!0;break}}if(v)break}if(!v)return}}C(RSe,"liftObstacleHuggingSameSideRails");function DSe(t,e){const n=C(l=>{const u=l.groupTitleRect;if(!(!u||typeof u.left!="number"||typeof u.right!="number"||typeof u.top!="number"||typeof u.bottom!="number"||!Number.isFinite(u.left)||!Number.isFinite(u.right)||!Number.isFinite(u.top)||!Number.isFinite(u.bottom)||u.right<=u.left||u.bottom<=u.top))return{left:u.left,right:u.right,top:u.top,bottom:u.bottom}},"validTitleRect"),i=C(l=>{if(!l.isGroup||l.parentId)return;const u=l.direction,h=typeof u=="string"?u.toUpperCase():"";if(h==="LR"||h==="RL"||h==="BT")return;const d=n(l),f=l.y,p=l.height;if(!d||typeof f!="number"||typeof p!="number"||!Number.isFinite(f)||!Number.isFinite(p)||p<=0)return;const g=d.right-d.left,m=d.bottom-d.top;if(!(m<=0||g{if(!l.horizontal)return!1;const h=l.a.y;return h<=u.top+Lr||h>=u.bottom-Lr?!1:Vu(l.a.x,l.b.x,u.left,u.right)>=Il},"horizontalSegmentIntersectsTitle"),s=[...e.values()].map(i).filter(l=>!!l);if(s.length===0)return;let o=0;for(const l of t){if(l.isLayoutOnly)continue;const u=Li(l.points??[]);for(const h of Yn(u))for(const d of s)a(h,d.rect)&&(o=Math.max(o,d.rect.bottom-h.a.y+4))}if(!(o<=Lr))for(const l of s){const u=l.node.y,h=l.node.height;typeof u!="number"||typeof h!="number"||!Number.isFinite(u)||!Number.isFinite(h)||h<=0||(l.node.y=u-o/2,l.node.height=h+o,l.node.groupTitleRect={...l.rect,top:l.rect.top-o,bottom:l.rect.bottom-o})}}C(DSe,"liftTopLaneTitleBandsAboveRails");function LSe(t,e){const n=C(u=>{const h=u.groupTitleRect;if(!(!h||typeof h.left!="number"||typeof h.right!="number"||typeof h.top!="number"||typeof h.bottom!="number"||!Number.isFinite(h.left)||!Number.isFinite(h.right)||!Number.isFinite(h.top)||!Number.isFinite(h.bottom)||h.right<=h.left||h.bottom<=h.top))return{left:h.left,right:h.right,top:h.top,bottom:h.bottom}},"validTitleRect"),i=C(u=>{if(!u.isGroup||u.parentId||u.direction!=="LR")return;const d=n(u),f=u.x,p=u.width;if(!d||typeof f!="number"||typeof p!="number"||!Number.isFinite(f)||!Number.isFinite(p)||p<=0)return;const g=d.right-d.left,m=d.bottom-d.top;if(!(g<=0||m{if(!u.vertical)return!1;const d=u.a.x;return d<=h.left+Lr||d>=h.right-Lr?!1:Vu(u.a.y,u.b.y,h.top,h.bottom)>=Il},"verticalSegmentIntersectsTitle"),s=C((u,h)=>{if(!u.horizontal)return!1;const d=u.a.y;return d<=h.top+Lr||d>=h.bottom-Lr?!1:Vu(u.a.x,u.b.x,h.left,h.right)>=Il},"horizontalSegmentIntersectsTitle"),o=[...e.values()].map(i).filter(u=>!!u);if(o.length===0)return;let l=0;for(const u of t){if(u.isLayoutOnly)continue;const h=Li(u.points??[]);for(const d of Yn(h))for(const f of o)if(a(d,f.rect))l=Math.max(l,f.rect.right-d.a.x+4);else if(s(d,f.rect)){const p=Math.min(d.a.x,d.b.x);l=Math.max(l,f.rect.right-p+4)}}if(!(l<=Lr))for(const u of o){const h=u.node.x,d=u.node.width;typeof h!="number"||typeof d!="number"||!Number.isFinite(h)||!Number.isFinite(d)||d<=0||(u.node.x=h-l/2,u.node.width=d+l,u.node.groupTitleRect={...u.rect,left:u.rect.left-l,right:u.rect.right-l})}}C(LSe,"shiftLeftLaneTitleBandsLeftOfRails");function jRt(t,e){const{realNodeRects:n}=O2(e.values()),i=t.filter(g=>!g.isLayoutOnly),a=C((g,m=new Map)=>Li(m.get(g)??g.points??[]),"replacementPointsFor"),s=C((g=new Map)=>{let m=0;for(let v=0;vi.reduce((m,v)=>m+Jd(a(v,g)),0),"totalBends"),l=C(g=>{const m=a(g);if(m.length<4)return;const v=m[m.length-2],y=m[m.length-1];if(!(!Hs(v,y,Lr)&&!Ws(v,y,Lr)))return{tailStart:v,terminal:y}},"terminalTailFor"),u=C((g,m)=>{const v=a(g);if(v.length<3)return;const y=v[0],b=v[1];let x;if(Hs(y,b,Lr))x={x:b.x,y:m.tailStart.y};else if(Ws(y,b,Lr))x={x:m.tailStart.x,y:b.y};else return;const w=_0(Li([y,b,x,m.tailStart,m.terminal]));return Yn(w).length===w.length-1?w:void 0},"candidateWithDestinationTail"),h=C((g,m)=>{const v=[g.start,g.end].filter(y=>!!y);for(const y of Yn(m))if(fo(y.a,y.b,n,v,-2))return!0;return!1},"pathHasNodeHit"),d=C((g,m,v)=>{for(const y of i)if(y!==g){for(const b of Yn(m))for(const x of Yn(a(y,v)))if(E0(b,x,.5)>=Il)return!0}return!1},"pathHasSharedTrack"),f=C((g,m,v)=>!h(g,m)&&!d(g,m,v),"candidateIsSafe"),p=C(()=>{const g=new Map;for(const m of i){const v=m.end;if(!v||!e.has(v)||a(m).length<4)continue;const b=g.get(v)??[];b.push(m),g.set(v,b)}return g},"edgesByDestination");for(let g=0;g<4;g++){const m=s();if(m===0)return;const v=o();let y,b=m,x=v;for(const w of p().values())for(let A=0;A=m||R>b||R===b&&D>=x||(y=L,b=R,x=D)}if(!y)return;for(const[w,A]of y)w.points=A}}C(jRt,"swapDestinationTerminalTailsToReduceCrossings");function XRt(t,e){const{realNodeRects:a,labelNodeRects:s}=O2(e.values()),o=t.filter(w=>!w.isLayoutOnly),l=C((w,A=new Map)=>Li(A.get(w)??w.points??[]),"replacementPointsFor"),u=C((w=new Map)=>{let A=0;for(let T=0;To.reduce((A,T)=>A+Jd(l(T,w)),0),"totalBends"),d=C(w=>{const A=w.start,T=w.end,S=A?e.get(A):void 0,O=T?e.get(T):void 0,k=S?Vh(S):void 0,E=O?Vh(O):void 0;return k&&E?{src:k,dst:E}:void 0},"endpointRectsFor"),f=C((w,A,T)=>{if(T.index<=0||T.index+1>=A.length-1)return;const S=d(w);if(S){if(T.vertical){const O=T.a.x,k=Math.min(S.src.left,S.dst.left),E=Math.max(S.src.right,S.dst.right),_=OE+Lr?"right":void 0;return _?{edge:w,points:A,segmentIndex:T.index,axis:"vertical",side:_,coord:O,min:Math.min(T.a.y,T.b.y),max:Math.max(T.a.y,T.b.y)}:void 0}if(T.horizontal){const O=T.a.y,k=Math.min(S.src.top,S.dst.top),E=Math.max(S.src.bottom,S.dst.bottom),_=OE+Lr?"bottom":void 0;return _?{edge:w,points:A,segmentIndex:T.index,axis:"horizontal",side:_,coord:O,min:Math.min(T.a.x,T.b.x),max:Math.max(T.a.x,T.b.x)}:void 0}}},"externalRailForSegment"),p=C(()=>{const w=[];for(const A of o){const T=l(A);for(const S of Yn(T)){const O=f(A,T,S);O&&w.push(O)}}return w},"collectExternalRails"),g=C((w,A)=>w.edge!==A.edge&&w.axis===A.axis&&w.side===A.side&&Vu(w.min,w.max,A.min,A.max)>=Il,"railsInteract"),m=C(w=>{const A=[],T=new Set;for(const S of w){if(T.has(S))continue;const O=[S],k=[];for(T.add(S);O.length>0;){const E=O.pop();k.push(E);for(const _ of w)!T.has(_)&&g(E,_)&&(T.add(_),O.push(_))}k.length>1&&A.push(k)}return A},"connectedComponents"),v=C(w=>{const A=[];for(const T of w)A.some(S=>Math.abs(S-T.coord){const A=w.map(O=>O.coord),T=v(w),S=[];if(w.length<=6){const O=new Array(T.length).fill(!1),k=[],E=C(()=>{if(k.length===w.length){k.some((_,I)=>Math.abs(_-A[I])>=Lr)&&S.push([...k]);return}for(const[_,I]of T.entries())O[_]||(O[_]=!0,k.push(I),E(),k.pop(),O[_]=!1)},"visit");return E(),S}for(let O=0;O{const T=new Map;for(const[O,k]of w.entries()){const E=A[O],_=T.get(k.edge)??k.points.map(I=>({x:I.x,y:I.y}));k.axis==="vertical"?(_[k.segmentIndex].x=E,_[k.segmentIndex+1].x=E):(_[k.segmentIndex].y=E,_[k.segmentIndex+1].y=E),T.set(k.edge,_)}const S=new Map;for(const[O,k]of T){const E=_0(Li(k));if(Yn(E).length!==E.length-1)return;S.set(O,E)}return S},"replacementsForAssignment"),x=C(w=>{for(const[A,T]of w){const S=[A.start,A.end].filter(O=>!!O);for(const O of Yn(T))if(fo(O.a,O.b,a,S,-2)||fo(O.a,O.b,s,[],-2))return!1}for(let A=0;A=Il)return!1}}return!0},"candidateIsSafe");for(let w=0;w<4;w++){const A=u();if(A===0)return;let T,S=A,O=h(),k=Number.POSITIVE_INFINITY;for(const E of m(p()))for(const _ of y(E)){const I=b(E,_);if(!I||!x(I))continue;const L=u(I);if(L>=A)continue;const R=h(I),D=E.reduce((M,P,N)=>M+Math.abs(_[N]-P.coord),0);L>S||L===S&&(R>O||R===O&&D>=k)||(T=I,S=L,O=R,k=D)}if(!T)return;for(const[E,_]of T)E.points=_}}C(XRt,"reassignCrossingExternalRailChannels");function KRt(t,e){const{realNodeRects:n,labelNodeRects:i}=O2(e.values()),a=t.filter(p=>!p.isLayoutOnly),s=C((p,g,m)=>Li(p===g?m??[]:p.points??[]),"pointsFor"),o=C(p=>Yn(p).reduce((g,m)=>{const v=m.a.x-m.b.x,y=m.a.y-m.b.y;return g+Math.hypot(v,y)},0),"pathLength"),l=C((p,g)=>{let m=0;for(let v=0;v{if(p.horizontal){const m=p.a.y;return(Math.abs(m-g.top)<1||Math.abs(m-g.bottom)<1)&&Vu(p.a.x,p.b.x,g.left,g.right)>=Il}if(p.vertical){const m=p.a.x;return(Math.abs(m-g.left)<1||Math.abs(m-g.right)<1)&&Vu(p.a.y,p.b.y,g.top,g.bottom)>=Il}return!1},"segmentRunsAlongRectBorder"),h=C(p=>{const g=[p.start,p.end].filter(v=>!!v),m=[];for(const v of g){const y=e.get(v),b=y?Vh(y):void 0;b&&m.push(b)}return m},"endpointRectsFor"),d=C((p,g)=>{if(g+3>=p.length)return[];const m=p[g],v=p[g+1],y=p[g+2],b=p[g+3],x=Hs(m,v,Lr)&&Ws(v,y,Lr)&&Hs(y,b,Lr),w=Ws(m,v,Lr)&&Hs(v,y,Lr)&&Ws(y,b,Lr);if(!x&&!w)return[];if(!(x?Math.sign(v.x-m.x)!==Math.sign(b.x-y.x):Math.sign(v.y-m.y)!==Math.sign(b.y-y.y)))return[];const T=yi(m,b,Lr)||Ci(m,b,Lr)?[]:[{x:m.x,y:b.y},{x:b.x,y:m.y}],S=T.length===0?[[...p.slice(0,g+1),...p.slice(g+3)]]:T.map(k=>[...p.slice(0,g+1),k,...p.slice(g+3)]),O=new Set;return S.map(k=>_0(Li(k))).filter(k=>{if(Yn(k).length!==k.length-1||!k.some(_=>fp(_,b,Lr)))return!1;const E=k.map(_=>`${_.x.toFixed(3)},${_.y.toFixed(3)}`).join("|");return O.has(E)?!1:(O.add(E),!0)})},"shortcutCandidatesAt"),f=C((p,g,m)=>{const v=[p.start,p.end].filter(b=>!!b),y=h(p);for(const b of Yn(g))if(fo(b.a,b.b,n,v,-2)||fo(b.a,b.b,i,[],-2)||y.some(x=>u(b,x)))return!1;for(const b of a)if(b!==p){for(const x of Yn(g))for(const w of Yn(s(b)))if(E0(x,w,.5)>=Il)return!1}return l(p,g)<=m},"candidateIsSafe");for(let p=0;p<8;p++){const g=l();let m,v,y=g,b=Number.POSITIVE_INFINITY,x=Number.POSITIVE_INFINITY;for(const w of a){const A=s(w),T=Jd(A,Lr),S=o(A);for(let O=0;O<=A.length-4;O++)for(const k of d(A,O)){const E=Jd(k,Lr),_=o(k);if(!(Ey||L===y&&(E>b||E===b&&_>=x)||(m=w,v=k,y=L,b=E,x=_)}}if(!m||!v)return;m.points=v}}C(KRt,"shortcutRedundantOrthogonalJogs");function ZRt(t,e){const s=[];for(const he of e.values()){if(he.isGroup||he.isEdgeLabel)continue;const fe=he.x??0,Te=he.y??0,ge=Vh(he);ge&&s.push({id:String(he.id??""),cx:fe,cy:Te,rect:ge})}if(s.length===0)return;const o=new Map(s.map(he=>[he.id,he])),l=s.map(he=>({id:he.id,rect:he.rect})),u=["top","bottom","left","right"],h={top:Math.min(...s.map(he=>he.rect.top))-20,bottom:Math.max(...s.map(he=>he.rect.bottom))+20,left:Math.min(...s.map(he=>he.rect.left))-20,right:Math.max(...s.map(he=>he.rect.right))+20},d=t.filter(he=>!he.isLayoutOnly),f=new Map(d.map((he,fe)=>[he,fe])),p=C(he=>{const fe=he==="left"||he==="top"?-1:1,Te=[];for(let ge=0;ge<=2;ge++)Te.push(h[he]+fe*20*ge);return Te},"outwardTracksForSide"),g=C((he,fe=new Map)=>Li(fe.get(he)??he.points??[]),"replacementPointsFor"),m=C((he,fe)=>{let Te=0;for(const ge of he)for(const Qe of fe)x1(ge.a,ge.b,Qe.a,Qe.b,Lr)&&Te++;return Te},"crossingCountBetweenSegments"),v=C((he,fe)=>m(Yn(he),Yn(fe)),"crossingCountBetweenPaths"),y=C((he=new Map)=>{let fe=0;const Te=[],ge=new Set,Qe=[],Se=C(De=>{ge.has(De)||(ge.add(De),Qe.push(De))},"addEdge");for(let De=0;De0&&(fe+=ne,Te.push({first:qe,second:be,count:ne}),Se(qe),Se(be))}}return Qe.sort((De,qe)=>(f.get(De)??0)-(f.get(qe)??0)),{count:fe,pairs:Te,edgeSet:ge,edges:Qe}},"crossingSnapshot"),b=C((he,fe)=>{const Te=new Set(fe.keys());if(Te.size===0)return he.count;let ge=0;for(const Se of he.pairs)(Te.has(Se.first)||Te.has(Se.second))&&(ge+=Se.count);let Qe=0;for(let Se=0;Se{const fe=new Map;for(const Qe of he.pairs){const Se=fe.get(Qe.first)??new Set;Se.add(Qe.second),fe.set(Qe.first,Se);const De=fe.get(Qe.second)??new Set;De.add(Qe.first),fe.set(Qe.second,De)}const Te=[],ge=new Set;for(const Qe of he.edges){if(ge.has(Qe))continue;const Se=[Qe],De=[];for(ge.add(Qe);Se.length>0;){const qe=Se.pop();De.push(qe);for(const K of fe.get(qe)??[])ge.has(K)||(ge.add(K),Se.push(K))}De.sort((qe,K)=>(f.get(qe)??0)-(f.get(K)??0)),De.length>1&&Te.push(De)}return Te},"crossingComponents"),w=C(he=>[he.start,he.end].filter(fe=>!!fe),"endpointIdsFor"),A=C(he=>{const fe=[];for(const Te of x(he)){const ge=new Set(Te),Qe=new Set(Te.flatMap(De=>w(De))),Se=[...Te];for(const De of d)ge.has(De)||w(De).some(qe=>Qe.has(qe))&&Se.push(De);Se.sort((De,qe)=>(f.get(De)??0)-(f.get(qe)??0)),fe.push(Se)}return fe},"pairSearchGroups"),T=C((he,fe,Te)=>b(he,new Map([[fe,Te]])),"crossingCountWithSingleReplacement"),S=C(he=>{const fe=new Map;for(const Te of he.pairs)fe.set(Te.first,(fe.get(Te.first)??0)+Te.count),fe.set(Te.second,(fe.get(Te.second)??0)+Te.count);return fe},"currentCrossingsByEdge"),O=C(he=>he.slice(1).reduce((fe,Te,ge)=>{const Qe=he[ge];return fe+Math.abs(Te.x-Qe.x)+Math.abs(Te.y-Qe.y)},0),"pathLength"),k=C((he=new Map)=>d.reduce((fe,Te)=>fe+Jd(g(Te,he)),0),"totalBends"),E=C((he=new Map)=>d.reduce((fe,Te)=>fe+O(g(Te,he)),0),"totalLength"),_=C((he,fe,Te=new Map)=>{const ge=Yn(fe);for(const Qe of d)if(Qe!==he){for(const Se of ge)for(const De of Yn(g(Qe,Te)))if(E0(Se,De,.5)>=Il)return!0}return!1},"pathHasSegmentConflict"),I=C((he,fe)=>{const Te=[he.start,he.end].filter(ge=>!!ge);for(const ge of Yn(fe))if(fo(ge.a,ge.b,l,Te,-2))return!0;return!1},"pathHitsNode"),L=C((he,fe)=>{const Te=_0(Li(fe));Yn(Te).length===Te.length-1&&he.push(Te)},"pushOrthogonalCandidate"),R=C(he=>he==="left"||he==="right","sideIsHorizontal"),D=C((he,fe,Te)=>{switch(fe){case"left":return Math.min(he.x,Te.x)-20;case"right":return Math.max(he.x,Te.x)+20;case"top":return Math.min(he.y,Te.y)-20;case"bottom":return Math.max(he.y,Te.y)+20}},"localTrackForSameSide"),M=C((he,fe,Te,ge)=>{const Qe=Te==="left"||Te==="top"?-1:1,Se=[D(fe,Te,ge),h[Te]];for(const De of Se)for(let qe=0;qe<=2;qe++)L(he,uSe(fe,Te,ge,De+Qe*20*qe))},"addSameSideCandidates"),P=C((he,fe,Te,ge,Qe)=>{for(const Se of p(Te))for(const De of p(Qe))L(he,[fe,{x:Se,y:fe.y},{x:Se,y:De},{x:ge.x,y:De},ge])},"addHorizontalToVerticalCandidates"),N=C((he,fe,Te,ge,Qe)=>{for(const Se of p(Te))for(const De of p(Qe))L(he,[fe,{x:fe.x,y:Se},{x:De,y:Se},{x:De,y:ge.y},ge])},"addVerticalToHorizontalCandidates"),F=C((he,fe,Te,ge,Qe)=>{const Se=[...p("top"),...p("bottom")];for(const De of p(Te))for(const qe of p(Qe))for(const K of Se)L(he,[fe,{x:De,y:fe.y},{x:De,y:K},{x:qe,y:K},{x:qe,y:ge.y},ge])},"addHorizontalPairCandidates"),B=C((he,fe,Te,ge,Qe)=>{const Se=[...p("left"),...p("right")];for(const De of p(Te))for(const qe of p(Qe))for(const K of Se)L(he,[fe,{x:fe.x,y:De},{x:K,y:De},{x:K,y:qe},{x:ge.x,y:qe},ge])},"addVerticalPairCandidates"),V=C(he=>{const fe=new Set;return he.map(Te=>Li(Te)).filter(Te=>{const ge=Te.map(Qe=>`${Qe.x.toFixed(3)},${Qe.y.toFixed(3)}`).join("|");return fe.has(ge)||Te.length<2?!1:(fe.add(ge),!0)})},"dedupeCandidatePaths"),z=C((he,fe,Te,ge)=>{const Qe=[],Se=cSe(he,fe,Te,ge,20,Lr);Se&&L(Qe,Se),fe===ge&&M(Qe,he,fe,Te);const De=R(fe),qe=R(ge);return De&&!qe?P(Qe,he,fe,Te,ge):!De&&qe?N(Qe,he,fe,Te,ge):De?F(Qe,he,fe,Te,ge):B(Qe,he,fe,Te,ge),V(Qe)},"buildCandidatesForSides"),U=C((he,fe,Te,ge)=>{const Qe=[...p("left"),...p("right")],Se=[...p("top"),...p("bottom")];for(const De of u){const qe=vC(ge,De),K=De==="top"||De==="bottom"?p(De):Se;for(const ce of Qe){L(he,[fe,Te,{x:ce,y:Te.y},{x:ce,y:qe.y},qe]);for(const be of K)L(he,[fe,Te,{x:ce,y:Te.y},{x:ce,y:be},{x:qe.x,y:be},qe])}}},"addVerticalDepartureOuterTrackCandidates"),Q=C((he,fe,Te,ge)=>{const Qe=[...p("left"),...p("right")],Se=[...p("top"),...p("bottom")];for(const De of u){const qe=vC(ge,De),K=De==="left"||De==="right"?p(De):Qe;for(const ce of Se){L(he,[fe,Te,{x:Te.x,y:ce},{x:qe.x,y:ce},qe]);for(const be of K)L(he,[fe,Te,{x:Te.x,y:ce},{x:be,y:ce},{x:be,y:qe.y},qe])}}},"addHorizontalDepartureOuterTrackCandidates"),G=C(he=>{const fe=he.start,Te=he.end,ge=Te?o.get(Te):void 0;if(!fe||!ge)return[];const Qe=Li(he.points??[]);if(Qe.length<4)return[];const Se=Qe[0],De=Qe[1],qe=[];return Ws(Se,De,Lr)?U(qe,Se,De,ge):Hs(Se,De,Lr)&&Q(qe,Se,De,ge),qe},"terminalPreservingOuterTrackCandidates"),X=C(he=>{const fe=he.start,Te=he.end,ge=fe?o.get(fe):void 0,Qe=Te?o.get(Te):void 0;if(!ge||!Qe)return[];const Se=[];for(const De of u){const qe=vC(ge,De);for(const K of u)Se.push(...z(qe,De,vC(Qe,K),K))}return Se.push(...G(he)),Se},"candidatePathsFor"),Y=C(()=>new Map(d.map(he=>[he,Yn(g(he))])),"currentSegmentsByEdge"),le=C((he,fe,Te)=>{const ge=new Set;for(const Qe of d){if(Qe===he)continue;const Se=Te.get(Qe)??Yn(g(Qe));fe.some(De=>Se.some(qe=>E0(De,qe,.5)>=Il))&&ge.add(Qe)}return ge},"sharedTrackConflictsFor"),q=C((he,fe,Te,ge)=>{const Qe=new Set;return X(he).map(De=>_0(Li(De))).filter(De=>{if(I(he,De))return!1;const qe=De.map(K=>`${K.x.toFixed(3)},${K.y.toFixed(3)}`).join("|");return Qe.has(qe)||De.length<2?!1:(Qe.add(qe),!0)}).map(De=>{const qe=Yn(De);let K=0;for(const ce of d)ce!==he&&(K+=m(qe,Te.get(ce)??Yn(g(ce))));return{candidate:De,candidateSegments:qe,crossings:fe.count-(ge.get(he)??0)+K,bends:Jd(De,Lr),totalBends:Jd(De),length:O(De)}}).filter(({crossings:De})=>De<=fe.count).sort((De,qe)=>De.crossings-qe.crossings||De.bends-qe.bends||De.length-qe.length).slice(0,48).map(De=>({path:De.candidate,segments:De.candidateSegments,sharedTrackConflicts:le(he,De.candidateSegments,Te),totalBends:De.totalBends,length:De.length}))},"pairCandidatesFor"),Z=C((he,fe,Te,ge,Qe,Se)=>{let De=0;for(const K of he.pairs)(K.first===fe||K.second===fe||K.first===ge||K.second===ge)&&(De+=K.count);let qe=m(Te.segments,Qe.segments);for(const K of d){if(K===fe||K===ge)continue;const ce=Se.get(K)??Yn(g(K));qe+=m(Te.segments,ce)+m(Qe.segments,ce)}return he.count-De+qe},"pairCrossingCount"),ee=C((he,fe)=>{for(const Te of he.sharedTrackConflicts)if(Te!==fe)return!1;return!0},"conflictsOnlyWith"),re=C((he,fe)=>he.segments.some(Te=>fe.segments.some(ge=>E0(Te,ge,.5)>=Il)),"candidatesShareTrack"),ve=C((he,fe,Te,ge)=>ee(fe,Te.edge)&&ee(ge,he.edge)&&!re(fe,ge),"pairCandidatesAreCompatible"),ae=C((he,fe,Te,ge,Qe)=>{const Se=Z(he.current,fe.edge,Te,ge.edge,Qe,he.baseSegments);if(!(Se>=he.current.count))return{replacements:new Map([[fe.edge,Te.path],[ge.edge,Qe.path]]),crossings:Se,bends:he.currentBends-(he.baseBendsByEdge.get(fe.edge)??0)-(he.baseBendsByEdge.get(ge.edge)??0)+Te.totalBends+Qe.totalBends,length:he.currentLength-(he.baseLengthByEdge.get(fe.edge)??0)-(he.baseLengthByEdge.get(ge.edge)??0)+Te.length+Qe.length}},"scorePairReplacement"),Ce=C((he,fe)=>he.crossings{let Qe=ge;for(const Se of fe.candidates)for(const De of Te.candidates){if(!ve(fe,Se,Te,De))continue;const qe=ae(he,fe,Se,Te,De);qe&&Ce(qe,Qe)&&(Qe=qe)}return Qe},"bestScoreForOptionPair"),$e=C(he=>{const fe=k(),Te=E(),ge=Y(),Qe=S(he),Se=new Map(d.map(ne=>[ne,Jd(g(ne))])),De=new Map(d.map(ne=>[ne,O(g(ne))])),qe=new Map,K=A(he);for(const ne of K)for(const j of ne){if(qe.has(j))continue;const ie=q(j,he,ge,Qe);ie.length>0&&qe.set(j,{edge:j,candidates:ie})}let ce={replacements:new Map,crossings:he.count,bends:fe,length:Te};const be={current:he,currentBends:fe,currentLength:Te,baseBendsByEdge:Se,baseLengthByEdge:De,baseSegments:ge};for(const ne of K){const j=new Set(ne.filter(pe=>he.edgeSet.has(pe))),ie=ne.map(pe=>qe.get(pe)).filter(pe=>!!pe);for(let pe=0;pe0?ce.replacements:void 0},"bestPairedReplacement");for(let he=0;he<4;he++){const fe=y(),Te=fe.count;if(Te===0)return;let ge,Qe,Se=Te,De=Number.POSITIVE_INFINITY;for(const K of fe.edges){const ce=Jd(g(K),Lr);for(const be of X(K)){const ne=I(K,be),j=!ne&&_(K,be),ie=T(fe,K,be),pe=Jd(be,Lr);ne||j||!(ieSe||ie===Se&&pe>=De||(ge=K,Qe=be,Se=ie,De=pe)}}if(ge&&Qe){ge.points=Qe;continue}const qe=$e(fe);if(!qe)return;for(const[K,ce]of qe)K.points=ce}}C(ZRt,"resolveRenderedOrthogonalCrossings");var k2=.001,Skn=8;function JRt(t,e){const{nodeInfoById:r,realNodeRects:n}=iJ(e),i=["top","bottom","left","right"],a=20,s={top:Math.min(...n.map(m=>m.rect.top))-a,bottom:Math.max(...n.map(m=>m.rect.bottom))+a,left:Math.min(...n.map(m=>m.rect.left))-a,right:Math.max(...n.map(m=>m.rect.right))+a},o=C((m,v,y,b)=>{const x=[],w=cSe(m,v,y,b,a,k2);return w&&x.push(w),v===b&&x.push(uSe(m,v,y,s[v])),x},"buildOrthogonalPathCandidates"),l=C((m,v)=>{for(let y=0;y{let b=0;const x=c3(m,k2),w=v.start,A=v.end;for(const T of t){if(T===v||T.isLayoutOnly)continue;const S=T.start,O=T.end;if(!y&&w&&A&&(S===w||S===A||O===w||O===A))continue;const k=T.points;if(!(!k||k.length<2))for(const E of x)for(const _ of c3(k,k2)){if(dSe(E.a,E.b,_.a,_.b,k2,k2)){b++;continue}E0(E,_,k2)>=Skn&&b++}}return b},"pathConflictCount"),h=4,d=C((m,v)=>{const y=Math.abs(m.y-v.rect.top),b=Math.abs(m.y-v.rect.bottom),x=Math.abs(m.x-v.rect.left),w=Math.abs(m.x-v.rect.right);let A="top",T=y;return b{const b=f.get(m)??[];b.push({side:v,edgeId:y}),f.set(m,b)},"addFaceClaim");for(const m of t){if(m.isLayoutOnly)continue;const v=m.points??[];if(v.length<1)continue;const y=m.id??"",b=m.start,x=m.end;if(b){const w=r.get(b);w&&p(b,d(v[0],w),y)}if(x){const w=r.get(x);w&&p(x,d(v[v.length-1],w),y)}}const g=C((m,v,y)=>{var b;return((b=f.get(m))==null?void 0:b.some(x=>x.edgeId!==y&&x.side===v))??!1},"faceIsClaimed");for(const m of t){if(m.isLayoutOnly)continue;const v=m.points;if(!v||v.length<2)continue;const y=Jd(v,k2);if(y0){const N=u(M,m,!0);if(N>E||N===E&&P>=_)continue;E=N,_=P,k=M;continue}u(M,m)>O||P<_&&(_=P,k=M)}}}if(k){m.points=k;const I=f.get(b);I&&f.set(b,I.filter(R=>R.edgeId!==T));const L=f.get(x);L&&f.set(x,L.filter(R=>R.edgeId!==T)),p(b,d(k[0],w),T),p(x,d(k[k.length-1],A),T)}}}C(JRt,"simplifyDetouredEdges");var Qh=.001,eDt=10,dJ=7;function MSe(t,e){const r=e?0:t.length-1,n=e?1:-1,i=t[r],a=t[r+n];if(!i||!a)return;const s=a.x-i.x,o=a.y-i.y;if(!(Math.abs(s)+Math.abs(o)a&&nJ(t,tDt(a)))}C(ISe,"labelOverlapsOwnMarker");function fJ(t,e){const r=[];for(const g of t){if(g.isLayoutOnly)continue;const m=g.points;if(!(!m||m.length<2))for(let v=0;v{const v=lSe(m,a);for(const{nodeId:y,rect:b}of n)if(y!==g&&nJ(v,b))return!0;return!1},"labelOverlapsForeignNode"),u=C((g,m)=>{const v=lSe(m,a);for(const y of r)if(y.edgeId!==g&&rJ(y.p1,y.p2,v))return!0;return!1},"labelOverlapsForeignEdge"),h=C((g,m,v)=>l(g,v)||u(m,v),"labelOverlapsAnything"),d=[],f=C(g=>{for(const{id:m,rect:v}of i)if(kRt(v,g))return m},"findContainingLane"),p=C((g,m)=>d.some(v=>v.labelId!==g&&nJ(m,v.rect)),"overlapsPlacedLabel");for(const g of t){if(g.isLayoutOnly)continue;const m=g.labelNodeId;if(!m)continue;const v=e.get(m);if(!v)continue;const y=g.points;if(!y||y.length<2)continue;const b=v.width??0,x=v.height??0;if(b<=0||x<=0)continue;const w=[];for(let V=0;V=Qh&&G>=Qh||w.push({idx:V,length:Q+G,orientation:Q>=Qh?"horizontal":"vertical",midX:(z.x+U.x)/2,midY:(z.y+U.y)/2})}if(w.length===0)continue;const A=w.length>=3?w.filter(V=>V.idx>0&&V.idx0?A:w,S=b>=x?"horizontal":"vertical",O=C(V=>[...V].sort((z,U)=>{const Q=z.orientation===S,G=U.orientation===S;if(Q!==G)return Q?-1:1;const X=z.length>=(z.orientation==="horizontal"?b:x)+2,Y=U.length>=(U.orientation==="horizontal"?b:x)+2;return X!==Y?X?-1:1:U.length-z.length}),"rankSegments"),k=w[0],E=w[w.length-1],_=[.5,.25,.75,.05,.95,.15,.85,.1,.9],I=C((V,z)=>{const U=y[V.idx],Q=y[V.idx+1];return{midX:U.x+(Q.x-U.x)*z,midY:U.y+(Q.y-U.y)*z}},"anchorAtT"),L=C((V,z,U)=>Math.min(U,Math.max(z,V)),"clamp"),R=C((V,z)=>V.midX>=z.left-Qh&&V.midX<=z.right+Qh&&V.midY>=z.top-Qh&&V.midY<=z.bottom+Qh,"pointInsideRectInclusive"),D=C(V=>{const z=u3(V.midX,V.midY,b,x),U=f(z);if(U)return{laneId:U,anchor:V,rect:z};const Q=i.find(({rect:ee})=>R(V,ee));if(!Q)return;const G=Q.rect.left+b/2+s,X=Q.rect.right-b/2-s,Y=Q.rect.top+x/2+s,le=Q.rect.bottom-x/2-s;if(G>X||Y>le)return;const q={midX:L(V.midX,G,X),midY:L(V.midY,Y,le)},Z=u3(q.midX,q.midY,b,x);return R(V,Z)?{laneId:Q.id,anchor:q,rect:Z}:void 0},"placementForAnchor"),M=C((V,z,U)=>V.orientation==="horizontal"?Math.abs(z.midX-U.x):Math.abs(z.midY-U.y),"distanceAlongSegment"),P=C((V,z)=>{const Q=(V.orientation==="horizontal"?b/2:x/2)+o;if(V===k){const G=y[V.idx];if(M(V,z,G)+Qh{const z=O(V);for(const U of z)for(const Q of _){const G=I(U,Q);if(!P(U,G))continue;const X=D(G);if(X&&!ISe(X.rect,y)&&!p(m,X.rect)&&!h(m,g.id,X.rect))return{laneId:X.laneId,anchor:X.anchor}}},"tryPool"),F=C((V,z,U=!1)=>{const Q=O(V);for(const G of Q){const X={midX:G.midX,midY:G.midY};if(z&&!P(G,X))continue;const Y=D(X);if(Y&&!ISe(Y.rect,y)&&!p(m,Y.rect)&&!l(m,Y.rect)&&(U||!u(g.id,Y.rect)))return{laneId:Y.laneId,anchor:Y.anchor}}},"findLaneContainingFallback"),B=N(T)??(T.lengthU.labelId===m);z>=0?d[z]={labelId:m,rect:V}:d.push({labelId:m,rect:V})}}}C(fJ,"anchorLabelsToPolyline");var PSe=1e-6,Ckn=8,rDt=Ckn/2,Okn=3;function NSe(t,e){return t{const h=NSe(o,l);let d=0;const f=C(p=>{if(!p)return;const g=i.get(p);if(!g)return;const m=u==="x"?g.w/2:g.h/2;m>d&&(d=m)},"consider");f(s.labelNodeId);for(const p of t){if(p===s||p.isLayoutOnly)continue;const g=p.start,m=p.end;!g||!m||NSe(g,m)===h&&f(p.labelNodeId)}return d>0?d+Okn:0},"labelClearanceFor");for(const s of t){if(s.isLayoutOnly)continue;const o=s.points;if(!sSe(o,PSe))continue;const l=hSe(s,r,PSe);if(!l)continue;const{srcId:u,dstId:h,srcInfo:d,dstInfo:f,collinearX:p,collinearY:g}=l;if(p===g)continue;let m,v;if(p){const A=f.cy>d.cy;m={x:d.cx,y:A?d.rect.bottom:d.rect.top},v={x:f.cx,y:A?f.rect.top:f.rect.bottom}}else{const A=f.cx>d.cx;m={x:A?d.rect.right:d.rect.left,y:d.cy},v={x:A?f.rect.left:f.rect.right,y:f.cy}}if(fo(m,v,n,[u,h],1))continue;const b=a(s,u,h,p?"x":"y"),x=b>rDt?b:rDt,w=[0,x,-x];for(const A of w){const T={...m},S={...v};if(p){if(T.x+=A,S.x+=A,T.x<=d.rect.left||T.x>=d.rect.right||S.x<=f.rect.left||S.x>=f.rect.right)continue}else if(T.y+=A,S.y+=A,T.y<=d.rect.top||T.y>=d.rect.bottom||S.y<=f.rect.top||S.y>=f.rect.bottom)continue;if(!fo(T,S,n,[u,h],1)&&!aJ(T,S,t,s,{epsilon:PSe})){s.points=[T,S];break}}}}C(nDt,"straightenCollinearSiblingDetours");function BSe(t,e){const{realNodeRects:l,labelNodeRects:u}=O2(e.values()),h=C((A,T)=>c3(T,.001).map(S=>({...S,edge:A,interior:S.index>=1&&S.index<=T.length-3})),"segmentsFor"),d=C(()=>{const A=[];for(const T of t){if(T.isLayoutOnly)continue;const S=T.points;!S||S.length<2||A.push(...h(T,Li(S)))}return A},"allSegments"),f=C((A,T)=>A.horizontal&&T.horizontal?Vu(A.a.x,A.b.x,T.a.x,T.b.x)>=8&&Math.abs(A.a.y-T.a.y)<7:A.vertical&&T.vertical?Vu(A.a.y,A.b.y,T.a.y,T.b.y)>=8&&Math.abs(A.a.x-T.a.x)<7:!1,"hasCrowdedParallelTrack"),p=C((A,T)=>{const S=A.start,O=A.end,k=h(A,T);if(k.length!==T.length-1)return!1;const E=[S,O].filter(I=>!!I),_=A.labelNodeId?[A.labelNodeId]:[];for(const I of k)if(fo(I.a,I.b,l,E,-2)||fo(I.a,I.b,u,_,-2))return!1;for(const I of t){if(I===A||I.isLayoutOnly)continue;const L=I.points;if(!(!L||L.length<2)){for(const R of k)for(const D of h(I,Li(L)))if(f(R,D)||x1(R.a,R.b,D.a,D.b,.001))return!1}}return!0},"candidateIsSafe"),g=C((A,T)=>{const S=Li(A.edge.points??[]);if(S.length<4||A.index>=S.length-1)return;const O=S.map(k=>({...k}));if(A.horizontal)O[A.index].y+=T,O[A.index+1].y+=T;else if(A.vertical)O[A.index].x+=T,O[A.index+1].x+=T;else return;return h(A.edge,O).length===O.length-1?O:void 0},"shiftedCandidate"),m=C((A,T)=>({x:A.x??(T.left+T.right)/2,y:A.y??(T.top+T.bottom)/2}),"nodeCenter"),v=C(A=>{const T=A.edge,S=Li(T.points??[]);if(S.length!==4||A.index!==1)return;const O=T.start?e.get(T.start):void 0,k=T.end?e.get(T.end):void 0,E=O?Vh(O):void 0,_=k?Vh(k):void 0,I=S.slice(A.index+2);if(!(!O||!k||!E||!_||I.length===0))return{sourceCenter:m(O,E),targetCenter:m(k,_),sourceRect:E,tail:I}},"sourceDetourContextFor"),y=C((A,T,S,O,k,E)=>{const _=O.y>=S.y,I=_?k.bottom:k.top,L=I+(_?20:-20);if(_&&A.b.y<=L+.001||!_&&A.b.y>=L-.001)return;const R=A.a.x+T;return Li([{x:S.x,y:I},{x:S.x,y:L},{x:R,y:L},{x:R,y:A.b.y},...E],.001)},"verticalSourceDetour"),b=C((A,T,S,O,k,E)=>{const _=O.x>=S.x,I=_?k.right:k.left,L=I+(_?20:-20);if(_&&A.b.x<=L+.001||!_&&A.b.x>=L-.001)return;const R=A.a.y+T;return Li([{x:I,y:S.y},{x:L,y:S.y},{x:L,y:R},{x:A.b.x,y:R},...E],.001)},"horizontalSourceDetour"),x=C((A,T)=>{const S=v(A);if(S){if(A.vertical)return y(A,T,S.sourceCenter,S.targetCenter,S.sourceRect,S.tail);if(A.horizontal)return b(A,T,S.sourceCenter,S.targetCenter,S.sourceRect,S.tail)}},"sourceDetourCandidate"),w=[-7,7,-2*7,2*7,-3*7,3*7];for(let A=0;A<12;A++){const T=d();let S=!1;for(let O=0;OL.interior);for(const L of I){for(const R of w){const D=g(L,R);if(D&&p(L.edge,D)){L.edge.points=D,S=!0;break}const M=x(L,R);if(M&&p(L.edge,M)){L.edge.points=M,S=!0;break}}if(S)break}}if(!S)return}}C(BSe,"nudgeSharedInteriorSubpaths");function iDt(t,e,r,n){const i=e.x-t.x,a=e.y-t.y,s=n.x-r.x,o=n.y-r.y,l=i*o-a*s;if(Math.abs(l)<1e-10)return!1;const u=r.x-t.x,h=r.y-t.y,d=(u*o-h*s)/l,f=(u*a-h*i)/l,p=.01;return d>p&&d<1-p&&f>p&&f<1-p}C(iDt,"segmentsIntersect");function aDt(t){const e=t.nodes??[],r=t.edges??[],n=[];if(!r.length||!e.length)return n;const i=ERt(e),a=[];for(const o of r){if(o.isLayoutOnly)continue;const l=o.points;if(!l||l.length<2)continue;const u=o.start,h=o.end,d=o.labelNodeId,f=o.id??`${u}->${h}`;for(const p of i)if(!(p.nodeId===u||p.nodeId===h)&&!(d&&p.nodeId===d)){for(let g=0;g0){const o=n.filter(u=>u.type==="edge-node-overlap").length,l=n.filter(u=>u.type==="edge-edge-crossing").length;me.warn(`[SWIMLANE_VALIDATE] ${n.length} issue(s) detected: ${o} edge-node overlap(s), ${l} edge crossing(s)`);for(const u of n)me.warn(`[SWIMLANE_VALIDATE] ${u.type}: ${u.detail}`)}return n}C(aDt,"validateSwimlanesLayout");function sDt(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(o=>!o.isGroup);if((e==="LR"||e==="RL")&&i.length>0&&!GRt(t,e)||e==="BT"&&i.length>0&&!QRt(t))return;for(const o of n){if(o.isLayoutOnly)continue;const l=o.points;!l||l.length<2||(o.points=_0(sJ(l)))}JRt(n,r),nDt(n,r),HRt(n,r);const a=new Map;for(const o of r)a.set(String(o.id),o);fJ(n,a),IRt(n,a),WRt(n,a),BSe(n,a),YRt(n,a),qRt(n,a),RSe(n,a),jRt(n,a);const s=C(()=>{ZRt(n,a),XRt(n,a),KRt(n,a),fJ(n,a),CSe(n,a),RSe(n,a),fJ(n,a),CSe(n,a)},"finalizeRenderedEdges");s(),BSe(n,a),s(),DSe(n,a),LSe(n,a),DSe(n,a),LSe(n,a)}C(sDt,"postProcessSwimlaneLayout");function E2(t){const e=new Map(t.nodeById),r=new Set,n=[];for(const a of t.edges){if(!e.has(a.src)||!e.has(a.dst))continue;const s=`${a.id}:${a.src}->${a.dst}`;r.has(s)||(r.add(s),n.push(a))}return{nodes:[...e.keys()],edges:n,layout:t.layout,nodeById:e}}C(E2,"normalizeGraph");function $Se(t,e){return t.edges.filter(r=>r.dst===e)}C($Se,"incoming");function oDt(t){const e=new Map;for(const r of t.nodes)e.set(r,[]);for(const r of t.edges)e.get(r.src).push(r.dst);return e}C(oDt,"buildSuccessorMap");function FSe(t){const e=oDt(t);for(const r of e.values())r.sort((n,i)=>n.localeCompare(i));return e}C(FSe,"buildSortedSuccessorMap");function zSe(t){const e=new Map;for(const r of t.nodes)e.set(r,0);for(const r of t.edges)e.set(r.dst,(e.get(r.dst)??0)+1);return e}C(zSe,"buildInDegreeMap");function USe(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,r)=>e.localeCompare(r))}C(USe,"sortedZeroInDegreeNodes");function pJ(t,e=()=>!0){const r=new Map,n=new Map;for(const i of t.nodes)r.set(i,[]),n.set(i,[]);for(const i of t.edges)e(i)&&(n.get(i.src).push(i.dst),r.get(i.dst).push(i.src));return{preds:r,succs:n}}C(pJ,"buildPredecessorSuccessorMaps");function VSe(t,e,r,n){var s,o;let i=0;for(const l of t.nodes)n!=null&&n.skipGroups&&((s=t.nodeById.get(l))!=null&&s.isGroup)||(i=Math.max(i,r[l]??0));const a=Array.from({length:i+1},()=>[]);for(const l of e)n!=null&&n.skipGroups&&((o=t.nodeById.get(l))!=null&&o.isGroup)||a[Math.max(0,r[l]??0)].push(l);return a}C(VSe,"buildLayersFromRanks");function s9(t){const e=zSe(t),r=USe(e),n=[],i=FSe(t);for(;r.length;){const a=r.shift();n.push(a);for(const s of i.get(a)??[])if(e.set(s,(e.get(s)??0)-1),(e.get(s)??0)===0){let o=0;for(;o{if(i-n<=1)return 0;const a=n+i>>1;let s=r(n,a)+r(a,i),o=n,l=a,u=n;for(;o=i||od.dst===f.dst?d.id.localeCompare(f.id):d.dst.localeCompare(f.dst));const n=Object.create(null);for(const h of e.nodes)n[h]=0;const i=[],a=C(h=>{n[h]=1;for(const d of r.get(h)??[]){const f=d.dst;n[f]===0?a(f):n[f]===1&&i.push(d)}n[h]=2},"dfs"),s=[...e.nodes].sort((h,d)=>h.localeCompare(d));for(const h of s)n[h]===0&&a(h);const o=new Set(i.map(h=>`${h.id}:${h.src}->${h.dst}`)),l=e.edges.map(h=>o.has(`${h.id}:${h.src}->${h.dst}`)?{id:h.id,src:h.dst,dst:h.src,weight:h.weight,ref:h.ref}:h);return{acyclic:{nodes:[...e.nodes],edges:l,layout:e.layout,nodeById:new Map(e.nodeById)},reversed:i}}C(lDt,"removeCycles_DFS");function cDt(t){const e=new Map,r=C(n=>{if(e.has(n))return e.get(n);const i=t.nodeById.get(n);if(!i)return e.set(n,null),null;const a=i.parentId;if(!a)return e.set(n,null),null;const o=r(a)??a;return e.set(n,o),o},"resolve");for(const n of t.nodes)r(n);return e}C(cDt,"buildTopLaneMap");function w1(t){const e=cDt(t);return r=>e.get(r)??null}C(w1,"createTopLaneResolver");function gJ(t){const e=[];for(const r of t.layout.nodes??[])r.isGroup&&!r.parentId&&e.push(r.id);return[...new Set(e)].reverse()}C(gJ,"buildTopLaneOrder");function GSe(t,e){const r=gJ(t);if(!e||e.length===0)return r;const n=new Set(r),i=new Set,a=[];for(const s of e)!n.has(s)||i.has(s)||(i.add(s),a.push(s));for(const s of r)i.has(s)||a.push(s);return a}C(GSe,"resolveTopLaneOrder");var kkn={EPSILON:1e-6},mJ={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},uDt={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function hDt(t,e){const r=E2(t),n=(e==null?void 0:e.laneOf)??(()=>null),i=e==null?void 0:e.rankHint,{preds:a}=pJ(r);for(const A of a.values())A.sort((T,S)=>T.localeCompare(S));const s=s9(r)??[...r.nodes].sort((A,T)=>A.localeCompare(T)),o=new Map;for(const[A,T]of s.entries())o.set(T,A);const l=new Map,u=new Map;for(const A of r.nodes)u.set(A,[]);for(const A of s){const T=(a.get(A)??[]).filter(S=>l.has(S));if(T.length>0){const S=dDt(A,T,{laneOf:n,rankHint:i,topoIndex:o});l.set(A,S),u.get(S).push(A)}else l.has(A)||l.set(A,null)}for(const A of r.nodes)l.has(A)||l.set(A,null);const h=new Set;for(const A of r.nodes)(l.get(A)??null)===null&&h.add(A);const d=[...h].sort((A,T)=>{const S=o.get(A)??0,O=o.get(T)??0;return S===O?A.localeCompare(T):S-O}),f=fDt(r),p=new Map;for(const[A,T]of f.entries())p.set(A,[...T].sort((S,O)=>S.localeCompare(O)));const g=pDt(p),m=gDt(p),v=new Map;for(const A of r.nodes)v.set(A,[]);for(const A of m)for(const T of A.nodes){const S=v.get(T);S?S.push(A.id):v.set(T,[A.id])}const y=[],b=[],x=new Set,w=C(A=>{if(!x.has(A)){x.add(A),y.push(A);for(const T of u.get(A)??[])w(T);b.push(A)}},"walk");for(const A of d)w(A);for(const A of s)w(A);return{parent:l,children:u,roots:d,componentOf:g,blocks:m,nodeBlocks:v,adjacency:p,preorder:y,postorder:b,topologicalOrder:s}}C(hDt,"buildDrivingTree");function dDt(t,e,r){const n=r.laneOf(t);return[...e].sort((a,s)=>{var m,v;const o=r.laneOf(a),l=r.laneOf(s),u=o!=null&&o===n,h=l!=null&&l===n;if(u!==h)return u?-1:1;const d=(m=r.rankHint)==null?void 0:m[a],f=(v=r.rankHint)==null?void 0:v[s];if(d!=null&&f!=null&&d!==f)return f-d;const p=r.topoIndex.get(a)??0,g=r.topoIndex.get(s)??0;return p!==g?p-g:a.localeCompare(s)})[0]}C(dDt,"chooseParent");function fDt(t){const e=new Map;for(const r of t.nodes)e.set(r,new Set);for(const r of t.edges)e.get(r.src).add(r.dst),e.get(r.dst).add(r.src);return e}C(fDt,"buildAdjacency");function pDt(t){const e=new Map;let r=0;for(const n of t.keys()){if(e.has(n))continue;const i=[n];for(;i.length>0;){const a=i.pop();if(!e.has(a)){e.set(a,r);for(const s of t.get(a)??[])e.has(s)||i.push(s)}}r++}return e}C(pDt,"assignComponents");function gDt(t){const e=new Map,r=new Map,n=[],i=[];let a=0;const s=C((o,l)=>{e.set(o,++a),r.set(o,a);for(const u of t.get(o)??[])u!==l&&(e.has(u)?(e.get(u)??0)<(e.get(o)??0)&&(n.push([o,u]),r.set(o,Math.min(r.get(o)??a,e.get(u)??a))):(n.push([o,u]),s(u,o),r.set(o,Math.min(r.get(o)??a,r.get(u)??a)),(r.get(u)??0)>=(e.get(o)??0)&&i.push(mDt(o,u,n,i.length))))},"visit");for(const o of t.keys())e.has(o)||s(o,null);return i}C(gDt,"computeBlocks");function mDt(t,e,r,n){const i=[],a=new Set;for(;r.length>0;){const s=r.pop();if(i.push(s),a.add(s[0]),a.add(s[1]),s[0]===t&&s[1]===e||s[0]===e&&s[1]===t)break}return{id:n,edges:i,nodes:[...a]}}C(mDt,"popBlock");function vDt(t,e,r){const n=[...t.nodes],i=new Map;for(const[b,x]of n.entries())i.set(x,b);const a=n.length,s=new Array(a).fill(-1),o=new Array(a).fill(0),l=[],u=new Set;for(const b of n){const x=r.parent.get(b)??null,w=i.get(b);w!=null&&x==null&&(s[w]=-1,o[w]=0,u.has(b)||(u.add(b),l.push(b)))}for(;l.length>0;){const b=l.shift(),x=i.get(b);if(x==null)continue;const w=r.children.get(b)??[];for(const A of w){if(u.has(A))continue;const T=i.get(A);T!=null&&(s[T]=x,o[T]=o[x]+1,u.add(A),l.push(A))}}for(const b of n){if(u.has(b))continue;const x=i.get(b);x!=null&&(s[x]=-1,o[x]=0,u.add(b))}const h=Math.max(1,Math.ceil(Math.log2(Math.max(1,a)))+1),d=Array.from({length:h},()=>new Array(a).fill(-1));for(let b=0;b{if(b===-1||x===-1)return-1;o[b]>A&1&&(b=d[A][b],b===-1))return-1;if(b===x)return b;for(let A=h-1;A>=0;A--){const T=d[A][b],S=d[A][x];T===-1||S===-1||T!==S&&(b=T,x=S)}return d[0][b]},"lcaIndex"),p=Array.from({length:a},()=>new Map);for(const b of t.edges){let x=b.src,w=b.dst,A=e[x],T=e[w];if(A==null||T==null||(A>T&&([x,w]=[w,x],[A,T]=[T,A]),A==null||T==null||A===T))continue;const S=i.get(x),O=i.get(w);if(S==null||O==null)continue;const k=f(S,O);if(k===-1)continue;const E=p[k];for(let _=A;_{if(x.size!==0)for(const[w,A]of x)b.set(w,(b.get(w)??0)+A)},"mergeInto"),v=new Set,y=C(b=>{const x=i.get(b);v.add(b);const w=x==null?void 0:p[x],A=w?new Map(w):new Map,T=r.children.get(b)??[];for(const S of T){const O=y(S),k=e[b];if(k!=null){let E=g.get(b);E||(E=new Map,g.set(b,E));let _=O.get(k)??0;const I=e[S];I!=null&&I>k&&(_+=1),E.set(S,_)}m(A,O)}return A},"dfs");for(const b of r.roots)v.has(b)||y(b);for(const b of n)v.has(b)||y(b);return g}C(vDt,"computeSubtreeCrossCounts");function yDt(t,e,r){const n=new Map,i=C(a=>{let s=r[a]??0;const o=[...e.get(a)??[]];o.sort(HSe(r));for(const l of o){i(l);const u=n.get(l);u!=null&&(s=Math.min(s,u))}n.set(a,s)},"annotate");for(const a of t)i(a);return n}C(yDt,"annotateMinimumLayers");function HSe(t){return(e,r)=>{const n=t[e]??0,i=t[r]??0;return n===i?e.localeCompare(r):n-i}}C(HSe,"compareByRankThenId");function bDt(t,e,r,n){let i=0;for(const l of e){const u=r[l]??0;u>i&&(i=u)}const a=Array.from({length:i+1},()=>[]),s=new Set,o=C(l=>{if(s.has(l))return;s.add(l);const u=r[l]??0;a[u]||(a[u]=[]),a[u].push(l);for(const h of n(l))o(h)},"emit");for(const l of t)o(l);for(const l of e)if(!s.has(l)){const u=r[l]??0;a[u]||(a[u]=[]),a[u].push(l),s.add(l)}return a}C(bDt,"emitNodesInTreeOrder");function xDt(t){const e=[];for(const r of t){const n=new Set,i=[];for(const a of r)n.has(a)||(n.add(a),i.push(a));e.push(i)}return e}C(xDt,"deduplicateLayers");function wDt(t,e,r,n){return i=>{const a=t.get(i)??[];if(a.length===0)return[];const s=e[i]??0,o=[],l=[],u=r.get(i);for(const h of a){const d=n.get(h)??s;d>s?o.push({child:h,min:d}):l.push(h)}return o.sort((h,d)=>h.min===d.min?h.child.localeCompare(d.child):h.min-d.min),l.sort((h,d)=>{const f=(u==null?void 0:u.get(h))??0,p=(u==null?void 0:u.get(d))??0;if(f!==p)return f-p;const g=n.get(h)??s,m=n.get(d)??s;return g!==m?g-m:h.localeCompare(d)}),[...o.map(h=>h.child),...l]}}C(wDt,"createChildOrderer");function vJ(t,e,r){const n=hDt(t,{rankHint:e,laneOf:r}),{children:i,roots:a}=n;for(const d of t.nodes)i.has(d)||i.set(d,[]);const s=vDt(t,e,n),o=[...a].sort(HSe(e)),l=yDt(o,i,e),u=wDt(i,e,s,l);let h=bDt(o,t.nodes,e,u);return h=xDt(h),h}C(vJ,"buildMultitreeLayerOrder");function ADt(t,e,r){const n=new Set(t),i=new Set(e),a=h3(e),s=[];for(const o of r)n.has(o.src)&&i.has(o.dst)&&s.push(a.get(o.dst));return QSe(s)}C(ADt,"countCrossingsBetweenAdjacent");function WSe(t,e,r){const n=[];for(const a of e){const s=r[a.src],o=r[a.dst];if(s==null||o==null||s===o)continue;let l=a.src,u=a.dst,h=s,d=o;s>o&&(l=a.dst,u=a.src,h=o,d=s);for(let f=h;f(r[f]??0)-(r[d]??0));for(const d of h){const f=r[d]??0;if(f===0)continue;let p=0;for(const y of n.get(d)??[])p=Math.max(p,(r[y]??0)+1);if(p>=f)continue;const g=f;r[d]=p;const m=vJ(t,r,i),v=WSe(m,t.edges,r);v(e[i]??0)-(e[a]??0)||i.localeCompare(a));for(const i of n){const a=r(i);if(!a)continue;const s=t.edges.filter(m=>m.src===i);if(s.length===0)continue;let o=!1,l=0;for(const m of s){const v=r(m.dst);v==null||v===a?o=!0:l++}if(l===0||o)continue;let u=0,h=!1;for(const m of t.edges){if(m.dst!==i)continue;const v=r(m.src);v&&(v===a?h=!0:u++)}if(u>0||!h)continue;const d=e[i]??0,f=d+l;let p=0;for(const m of t.edges)m.dst===i&&(p=Math.max(p,(e[m.src]??0)+1));const g=Math.max(d,p,f);g!==d&&(e[i]=g)}}C(SDt,"adjustCrossLaneSources");function CDt(t,e){const r=E2(t),n=s9(r)??[...r.nodes].sort(),i=(e==null?void 0:e.compactSingleInput)??!1,a=w1(r);let s=Object.create(null);for(const l of n){const u=$Se(r,l),h=e!=null&&e.ignoreCrossLaneEdges?u.filter(d=>{const f=a(d.src),p=a(l);return!f||!p?!0:f===p}):u;if(h.length===0)s[l]=0;else if(i&&h.length===1){const d=h[0].src,f=a(d),p=a(l);f!==p?s[l]=s[d]??0:s[l]=(s[d]??0)+1}else{let d=-1/0;for(const f of h)d=Math.max(d,(s[f.src]??0)+1);s[l]=d===-1/0?0:d}}return((e==null?void 0:e.optimizeRanksByCrossings)??!1)&&(s=TDt(r,s)),e!=null&&e.ignoreCrossLaneEdges&&SDt(r,s),{layers:vJ(r,s,a),rankOf:s,dummy:new Set}}C(CDt,"assignLayers_LongestPath");function ODt(t,e){const r=E2(t),i={...CDt(r,{compactSingleInput:e==null?void 0:e.compactSingleInput,ignoreCrossLaneEdges:e==null?void 0:e.ignoreCrossLaneEdges,optimizeRanksByCrossings:e==null?void 0:e.optimizeRanksByCrossings}).rankOf},a=w1(r),{preds:s,succs:o}=pJ(r,g=>{if(e!=null&&e.ignoreCrossLaneEdges){const m=a(g.src),v=a(g.dst);if(m&&v&&m!==v)return!1}return!0}),l=s9(r)??[...r.nodes],u=[...l].reverse(),h=C((g,m)=>{let v=0;for(const x of s.get(g)??[])v=Math.max(v,(i[x]??0)+1);let y=Number.POSITIVE_INFINITY;const b=o.get(g)??[];return b.length>0&&(y=Math.min(...b.map(x=>(i[x]??0)-1))),Number.isFinite(y)||(y=Math.max(v,m)),Math.min(Math.max(m,v),y)},"clampFeasible"),d=mJ.GRAVITY_ITERATIONS,f=C(g=>{let m=!1;for(const v of g){const y=s.get(v)??[],b=o.get(v)??[];if(y.length===0&&b.length===0)continue;const x=y.length>0?y.reduce((S,O)=>S+(i[O]??0)+1,0)/y.length:i[v]??0,w=b.length>0?b.reduce((S,O)=>S+(i[O]??0)-1,0)/b.length:i[v]??0,A=Math.round((x+w)/2),T=h(v,A);T!==i[v]&&(i[v]=T,m=!0)}return m},"relaxOrder");for(let g=0;g0){const v=Math.min(...m.map(y=>(i[y]??0)-1));(i[g]??0)>v&&(i[g]=v)}}return{layers:VSe(r,l,i),rankOf:i,dummy:new Set}}C(ODt,"assignLayers_Gravity");function kDt(t){const e=zSe(t),r=FSe(t);let n=USe(e);const i=[];for(;n.length>0;){const a=[];for(const s of n){i.push(s);for(const o of r.get(s)??[])e.set(o,(e.get(o)??0)-1),(e.get(o)??0)===0&&a.push(o)}n=a.sort((s,o)=>s.localeCompare(o))}return i.length===t.nodes.length?i:null}C(kDt,"topoSortByGenerationIfAcyclic");function EDt(t,e){const r=E2(t),n=(e==null?void 0:e.direction)==="LR"?kDt(r)??[...r.nodes].sort():s9(r)??[...r.nodes].sort(),i=w1(r),a=C(h=>i(h)??h,"laneOf"),s=Object.create(null),o=new Map,l=C((h,d)=>(e==null?void 0:e.ignoreCrossLaneEdges)??!0?a(h)===a(d)?1:0:1,"edgeWeight");for(const h of n){const d=r.nodeById.get(h);if(d!=null&&d.isGroup)continue;const f=$Se(r,h);let p=0;if(f.length>0)for(const y of f){const b=y.src,x=s[b]??0;p=Math.max(p,x+l(b,h))}const g=a(h),m=o.get(g)??0,v=Math.max(p,m);s[h]=v,o.set(g,v+1)}return{layers:VSe(r,n,s,{skipGroups:!0}),rankOf:s,dummy:new Set}}C(EDt,"assignLayers_LaneAwareCompact");function _Dt(t,e){const r=E2(e),{rankOf:n}=t,i=t.layers.map(p=>[...p]),a=new Set(t.dummy?[...t.dummy]:[]);let s=0;const o=new Map(r.nodeById),l=C(p=>{const g=`placeholder-${s++}`,m={id:g,isGroup:!1,isDummy:!0,width:0,height:0};for(o.set(g,m),a.add(g);i.length<=p;)i.push([]);return i[p].push(g),n[g]=p,g},"addDummyAt"),u=[...r.edges].sort((p,g)=>p.id===g.id?p.src===g.src?p.dst.localeCompare(g.dst):p.src.localeCompare(g.src):p.id.localeCompare(g.id)),h=[];for(const p of u){const g=n[p.src]??0,m=n[p.dst]??0;if(m-g<=1){h.push(p);continue}let v=p.src;for(let b=g+1,x=0;b!r.nodes.includes(p))],edges:h,layout:r.layout,nodeById:o};return{layering:{layers:i,rankOf:n,dummy:a},graphWithDummies:f}}C(_Dt,"makeProperLayering");function YSe(t){const e=t.length;if(e===0)return Number.POSITIVE_INFINITY;const r=[...t].sort((n,i)=>n-i);return e%2===1?r[(e-1)/2]:.5*(r[e/2-1]+r[e/2])}C(YSe,"median");function qSe(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((r,n)=>r+n,0)/t.length}C(qSe,"barycenter");function RDt(t,e,r,n){const i=new Map;for(const a of t)i.set(a,[]);for(const a of r)n==="down"?e.has(a.src)&&i.has(a.dst)&&i.get(a.dst).push(e.get(a.src)):e.has(a.dst)&&i.has(a.src)&&i.get(a.src).push(e.get(a.dst));return i}C(RDt,"neighborPositionsFor");function DDt(t,e,r){const n=r.get(t)??0,i=r.get(e)??0;return n!==i?n-i:t.localeCompare(e)}C(DDt,"currentOrderTieBreak");function jSe(t,e,r){const n=new Set(t),i=new Set(e),a=h3(t),s=h3(e),o=[];for(const u of r)n.has(u.src)&&i.has(u.dst)&&o.push({u:a.get(u.src),v:s.get(u.dst)});o.sort((u,h)=>u.u===h.u?u.v-h.v:u.u-h.u);const l=o.map(u=>u.v);return QSe(l)}C(jSe,"countCrossingsBetweenAdjacent");function yJ(t,e,r){return[...t].sort((n,i)=>{const a=YSe(e.get(n)??[]),s=YSe(e.get(i)??[]);return a===s?DDt(n,i,r):isFinite(a)?isFinite(s)?a-s:-1:1})}C(yJ,"sortByHeuristic");function XSe(t,e,r,n,i,a){const s=h3(t),o=h3(e),l=RDt(e,s,r,n);if(!i||!a||a.length===0)return yJ(e,l,o);const u=new Map;for(const f of e){const p=i(f),g=u.get(p)??[];g.push(f),u.set(p,g)}const h=[];for(const f of a){const p=u.get(f);if(!p||p.length===0)continue;const g=yJ(p,l,o);h.push(...g)}const d=u.get(null);if(d&&d.length>0){const f=yJ(d,l,o);for(const p of f){const g=qSe(l.get(p)??[]);let m=h.length;if(isFinite(g))for(const[v,y]of h.entries()){const b=qSe(l.get(y)??[]);if(gs.has(m.src)&&o.has(m.dst)),h=l?r.filter(m=>o.has(m.src)&&l.has(m.dst)):void 0,d=C(m=>{let v=jSe(t,m,u);return h&&n&&(v+=jSe(m,n,h)),v},"crossingScore"),f=i?new Map:null;if(i&&f)for(const m of e)f.set(m,i(m));let p=!0,g=d(a);for(;p;){p=!1;for(let m=0;m+1[...o]),i=e.edges,a=w1(e),s=GSe(e,r==null?void 0:r.laneOrder);for(let o=0;o<3;o++){for(let l=1;l=0;l--)n[l]=XSe(n[l+1],n[l],i,"up",a,s),n[l]=KSe(n[l+1],n[l],i,n[l-1],a)}return{layers:n}}C(LDt,"orderLayers");function MDt(t,e,r){const n=(r==null?void 0:r.layerGap)??uDt.DEFAULT_LAYER_GAP,i=(r==null?void 0:r.nodeGap)??uDt.DEFAULT_NODE_GAP,a=(r==null?void 0:r.laneGap)??i*2,s=(r==null?void 0:r.direction)??"TB",o=s==="LR"||s==="RL",l=t.layers,u=Object.create(null),h=Object.create(null),d=C(E=>e.nodeById.get(E),"getNode"),f=C(E=>{var _;return((_=d(E))==null?void 0:_.width)??0},"getWidth"),p=C(E=>{var _;return((_=d(E))==null?void 0:_.height)??0},"getHeight"),g=w1(e),m=GSe(e,r==null?void 0:r.laneOrder),v=l.map(E=>E.reduce((_,I)=>Math.max(_,p(I)),0)),y=[];if(o)for(let E=0;E+1Math.max(N,f(F)),0),I=l[E+1].reduce((N,F)=>Math.max(N,f(F)),0),L=v[E],R=v[E+1],D=L/2+R/2,M=(_+I)/2,P=Math.max(0,M-D-n);y.push(P)}const b=new Set;for(const E of l)for(const _ of E)b.add(g(_));const x=b.has(null),w=m.filter(E=>b.has(E)),A=[...x?[null]:[],...w],T=Object.create(null);for(const E of w)T[E]=0;x&&(T.null=0);for(const E of l){const _=Object.create(null),I=[];for(const L of E){const R=g(L);R===null?I.push(L):(_[R]||(_[R]=[])).push(L)}for(const[L,R]of Object.entries(_)){const D=R.reduce((M,P)=>M+f(P),0)+i*Math.max(0,R.length-1);T[L]=Math.max(T[L]??0,D)}if(x&&I.length){const L=I.reduce((R,D)=>R+f(D),0)+i*Math.max(0,I.length-1);T.null=Math.max(T.null??0,L)}}const S=new Map;{const E=A.map(L=>(L===null?T.null:T[L])??0);let I=-(E.reduce((L,R)=>L+R,0)+a*Math.max(0,A.length-1))/2;for(let L=0;Lf(V)),F=N.reduce((V,z)=>V+z,0)+i*(M.length-1);let B=P-F/2;for(const[V,z]of M.entries()){const U=N[V];u[z]=B+U/2,h[z]=O+I/2,B+=U+i}}}const R=y[E]??0;O+=I+n+R}const k=new Map;for(const E of e.edges){const _=E.ref.id;k.has(_)||k.set(_,[]),k.get(_).push(E)}for(const[,E]of k){if(E.length===0)continue;const _=E[0].ref,I=_.start,L=_.end;if(I==null||L==null)continue;const R=Math.round(((u[I]??0)+(u[L]??0))/2),D=new Set;for(const M of E)D.add(M.src),D.add(M.dst);for(const M of D){if(M===I||M===L)continue;const P=e.nodeById.get(M);P!=null&&P.isDummy&&(u[M]=R)}}return{x:u,y:h}}C(MDt,"assignCoordinates");var IDt=8;function PDt(t){let e=2166136261;for(let r=0;r>>0}C(PDt,"hashString");function NDt(t){let e=t>>>0;return()=>{e+=1831565813;let r=e;return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),((r^r>>>14)>>>0)/4294967296}}C(NDt,"mulberry32");function BDt(t,e){const r=[...t],n=NDt(e);for(let i=r.length-1;i>0;i--){const a=Math.floor(n()*(i+1));[r[i],r[a]]=[r[a],r[i]]}return r}C(BDt,"deterministicShuffle");function $Dt(t,e){let r=0;for(const[n,i]of t.entries())r+=Math.abs(n-(e.get(i)??n));return r}C($Dt,"sourceDistance");function ZSe(t,e){const r=new Map;for(const[i,a]of t.entries())r.set(a,i);let n=0;for(const{a:i,b:a,weight:s}of e){const o=r.get(i),l=r.get(a);o==null||l==null||(n+=s*Math.abs(o-l))}return n}C(ZSe,"laneArrangementCost");function FDt(t){const e=gJ(t);if(e.length<2)return[];const r=new Map(e.map((a,s)=>[a,s])),n=w1(t),i=new Map;for(const a of t.layout.edges??[]){if(a.isLayoutOnly)continue;const s=typeof a.start=="string"?a.start:void 0,o=typeof a.end=="string"?a.end:void 0;if(!s||!o||!t.nodeById.has(s)||!t.nodeById.has(o))continue;const l=n(s),u=n(o);if(!l||!u||l===u)continue;const h=r.get(l),d=r.get(u);if(h==null||d==null)continue;const[f,p]=h<=d?[l,u]:[u,l],g=`${f}\0${p}`,m=i.get(g);m?m.weight++:i.set(g,{a:f,b:p,weight:1})}return[...i.values()]}C(FDt,"buildWeightedLaneEdges");function JSe(t,e,r){const n=[...t];let i=ZSe(n,e),a=!0,s=0;const o=Math.max(1,n.length);for(;a&&si.a===a.a?i.b.localeCompare(a.b):i.a.localeCompare(a.a)).map(({a:i,b:a,weight:s})=>`${i}:${a}:${s}`).join("|");return PDt(`${t.join("|")}#${n}#${r}`)}C(UDt,"seedForRestart");function VDt(t,e={}){const r=gJ(t);if(r.length<2)return r;const n=FDt(t);if(n.length===0)return r;const i=new Map(r.map((o,l)=>[o,l]));let a=JSe(r,n,i);const s=Math.max(0,e.restarts??IDt);for(let o=0;oJn&&l*3>=o?s>0?"bottom":"top":o>Jn?a>0?"right":"left":r}C(tCe,"chooseOrthogonalSide");function rCe(t,e){return Math.abs(t.to-e.from)K.isGroup&&!K.parentId);for(const K of u){const ce={id:K.id},be=C(ne=>{s.set(ne.id,ce),r.filter(j=>j.parentId===ne.id).forEach(be)},"assignLane");be(K)}const h=r.filter(K=>!K.isGroup&&!K.isEdgeLabel).map(K=>{const ce=K.width??10,be=K.height??10,ne=K.x??0,j=K.y??0,ie=Ekn;return{nodeId:K.id,minX:ne-ce/2-ie,maxX:ne+ce/2+ie,minY:j-be/2-ie,maxY:j+be/2+ie,visualXHalfExtent:l?be/2+ie:ce/2+ie}}),d=C((K,ce,be,ne)=>{let j=o.find(ie=>ie.orientation===K&&Math.abs(ie.coord-ce)<1);return j||(j={id:`pipe-${K}-${ce.toFixed(0)}`,orientation:K,coord:ce,spanMin:be,spanMax:ne,tracks:[]},o.push(j)),j.spanMin=Math.min(j.spanMin,be),j.spanMax=Math.max(j.spanMax,ne),j},"getOrAddPipe"),f=C((K,ce)=>{const be=K.width??10,ne=K.height??10,j=K.x??0,ie=K.y??0;switch(ce){case"top":return{x:j,y:ie-ne/2};case"bottom":return{x:j,y:ie+ne/2};case"left":return{x:j-be/2,y:ie};case"right":return{x:j+be/2,y:ie}}},"portForSide"),p=C((K,ce,be)=>f(K,tCe(K,ce,be?"bottom":"top")),"getOrthogonalPort"),g=[],m=[],v=new Set,y=1e3,b=C((K,ce,be)=>{if(g.length===0)return 0;const ne=Math.abs(ce.y-be.y)ye||oe.from-Jn<=pe&&oe.to+Jn>=pe&&(ie+=y)}else if(j){const pe=ce.x,te=Math.min(ce.y,be.y)-Jn,ye=Math.max(ce.y,be.y)+Jn;if(ye<=te)return 0;for(const oe of g)oe.edgeIndex===K||oe.orientation!=="horizontal"||oe.pipe.coordye||oe.from-Jn<=pe&&oe.to+Jn>=pe&&(ie+=y)}return ie},"crossingPenalty"),x=i.map((K,ce)=>{if(!K.start||!K.end)return{idx:ce,crossLane:0,dx:0,dy:0};const be=a.get(K.start),ne=a.get(K.end),j=s.get(K.start),ie=s.get(K.end),pe=j&&ie&&j.id!==ie.id?1:0,te=be&&ne?Math.abs((ne.x??0)-(be.x??0)):0,ye=be&&ne?Math.abs((ne.y??0)-(be.y??0)):0;return{idx:ce,crossLane:pe,dx:te,dy:ye}}).sort((K,ce)=>{if(K.crossLane!==ce.crossLane)return ce.crossLane-K.crossLane;const be=K.dx+K.dy,ne=ce.dx+ce.dy;return Math.abs(be-ne)>1?be-ne:K.idx-ce.idx}).map(K=>K.idx),w=C((K,ce,be,ne)=>{const j=Math.min(K.x,ce.x),ie=Math.max(K.x,ce.x),pe=Math.min(K.y,ce.y),te=Math.max(K.y,ce.y);return!!h.find(oe=>be&&oe.nodeId===be||ne&&oe.nodeId===ne?!1:Math.abs(K.x-ce.x)>Jn?oe.minYK.y&&oe.maxX>j&&oe.minXK.x&&oe.maxY>pe&&oe.minYtCe(K,ce,"bottom"),"determineSide"),O=new Map;for(const[K,ce]of i.entries()){if(!ce.start||!ce.end||ce.start===ce.end||ce.points&&ce.points.length>0)continue;const be=a.get(ce.start),ne=a.get(ce.end);if(!be||!ne)continue;const j=(ne.x??0)-(be.x??0),ie=(ne.y??0)-(be.y??0);O.set(K,{edgeIdx:K,srcId:ce.start,dstId:ce.end,srcSide:S(be,{x:ne.x??0,y:ne.y??0}),dstSide:S(ne,{x:be.x??0,y:be.y??0}),absDx:Math.abs(j),absDy:Math.abs(ie),dxSign:Math.sign(j),dySign:Math.sign(ie)})}const k=C(K=>K.srcSide==="top"||K.srcSide==="bottom"?K.absDx===0?1/0:K.absDy/K.absDx:K.absDy===0?1/0:K.absDx/K.absDy,"preferenceStrength"),E=C(K=>K.srcSide==="top"||K.srcSide==="bottom"?K.dxSign>=0?"right":"left":K.dySign>=0?"bottom":"top","secondarySide"),_=new Map;for(const K of O.values()){const ce=`${K.srcId}:${K.srcSide}`;_.has(ce)||_.set(ce,[]),_.get(ce).push(K)}const I=new Map,L=C((K,ce)=>`${K}:${ce}`,"loadKey");for(const K of O.values())I.set(L(K.srcId,K.srcSide),(I.get(L(K.srcId,K.srcSide))??0)+1),I.set(L(K.dstId,K.dstSide),(I.get(L(K.dstId,K.dstSide))??0)+1);for(const K of _.values())if(!(K.length<2)){K.sort((ce,be)=>{const ne=k(ce),j=k(be);return Math.abs(ne-j)>1e-9?j-ne:ce.edgeIdx-be.edgeIdx});for(let ce=1;ce=j||(I.set(L(be.srcId,be.srcSide),j-1),I.set(L(be.srcId,ne),ie+1),be.srcSide=ne)}}const R=C(K=>{const ce=K==null?void 0:K.shape;return ce==="question"||ce==="diamond"},"isDiamondNode"),D=new Map;for(const K of O.values())D.has(K.dstId)||D.set(K.dstId,new Set),D.get(K.dstId).add(K.dstSide);for(const K of O.values()){if(!R(a.get(K.srcId)))continue;const ce=D.get(K.srcId);if(!(ce!=null&&ce.has(K.srcSide)))continue;const be=E(K);if(ce.has(be)||(I.get(L(K.srcId,be))??0)>0)continue;const ne=I.get(L(K.srcId,K.srcSide))??0;I.set(L(K.srcId,K.srcSide),Math.max(0,ne-1)),I.set(L(K.srcId,be),1),K.srcSide=be}for(const K of O.values()){const{edgeIdx:ce,srcId:be,dstId:ne,srcSide:j,dstSide:ie}=K,pe=a.get(be),te=a.get(ne),ye=`${be}:${j}:src`,oe=j==="top"||j==="bottom"?te.x??0:te.y??0;A.has(ye)||A.set(ye,[]),A.get(ye).push({edgeIdx:ce,oppositeCoord:oe});const _e=`${ne}:${ie}:dst`,Le=ie==="top"||ie==="bottom"?pe.x??0:pe.y??0;A.has(_e)||A.set(_e,[]),A.get(_e).push({edgeIdx:ce,oppositeCoord:Le})}const M=new Map,P=8;for(const[K,ce]of A){if(ce.length<2)continue;ce.sort((Ze,Ge)=>Ze.oppositeCoord-Ge.oppositeCoord);const be=K.split(":"),ne=be.slice(0,-2).join(":"),j=be[be.length-2],ie=be[be.length-1],pe=a.get(ne);if(!pe)continue;const ye=j==="left"||j==="right"?pe.height??10:pe.width??10,oe=pe.shape,Le=oe==="question"||oe==="diamond"?ye*.3:ye,Pe=Math.min(20,Math.max(P,Le/(ce.length+1))),Ne=-(Pe*(ce.length-1))/2;for(const[Ze,Ge]of ce.entries()){const lt=Ne+Ze*Pe,Fe=`${Ge.edgeIdx}:${ie}`;M.set(Fe,lt)}}const N=C(K=>{var ce;return!!((ce=i[K])!=null&&ce.labelNodeId)},"edgeHasLabelNode"),F=C((K,ce)=>K?(A.get(`${K}:${ce}:src`)??[]).some(({edgeIdx:be})=>N(be))||(A.get(`${K}:${ce}:dst`)??[]).some(({edgeIdx:be})=>N(be)):!1,"faceHasLabelNode"),B=C((K,ce,be)=>ce==="top"||ce==="bottom"?{x:K.x+be,y:K.y}:{x:K.x,y:K.y+be},"applyPortOffset"),V=C((K,ce,be)=>{const ne=O.get(K),j={x:be.x??0,y:be.y??0},ie={x:ce.x??0,y:ce.y??0},pe=(ne==null?void 0:ne.srcSide)??S(ce,j),te=(ne==null?void 0:ne.dstSide)??S(be,ie);let ye=ne?f(ce,ne.srcSide):p(ce,j,!0),oe=ne?f(be,ne.dstSide):p(be,ie,!1);const _e=M.get(`${K}:src`),Le=M.get(`${K}:dst`);return _e!==void 0&&(ye=B(ye,pe,_e)),Le!==void 0&&(oe=B(oe,te,Le)),{pSrcPort:ye,pDstPort:oe,srcSide:pe,dstSide:te}},"portsForEdge");for(const K of x){const ce=i[K];if(m[K]=[],!ce.start||!ce.end||ce.points&&ce.points.length>0||ce.start===ce.end)continue;const be=a.get(ce.start),ne=a.get(ce.end);if(!be||!ne)continue;const{pSrcPort:j,pDstPort:ie,srcSide:pe,dstSide:te}=V(K,be,ne),ye={...j},oe={...ie},_e=pe==="top"||pe==="bottom",Le=te==="top"||te==="bottom";if(_e){const pt=j.y>(be.y??0);ye.y=pt?j.y+pp:j.y-pp}else{const pt=j.x>(be.x??0);ye.x=pt?j.x+pp:j.x-pp}if(Le){const pt=ie.y>(ne.y??0);oe.y=pt?ie.y+pp:ie.y-pp}else{const pt=ie.x>(ne.x??0);oe.x=pt?ie.x+pp:ie.x-pp}const Ye=C((pt,Tt)=>{for(const sr of h)if(!Tt.includes(sr.nodeId)&&pt.x>sr.minX&&pt.xsr.minY&&pt.y{if(Ln){const Vt=pt.y>(Tt.y??0);return{x:(sr.x??0)>=pt.x?Kr.maxX+yC:Kr.minX-yC,y:Vt?Kr.maxY+d3:Kr.minY-d3,leavesPositiveSide:Vt}}const Et=pt.x>(Tt.x??0),St=(sr.y??0)>=pt.y;return{x:Et?Kr.maxX+yC:Kr.minX-yC,y:St?Kr.maxY+d3:Kr.minY-d3,leavesPositiveSide:Et}},"obstacleDetour");let Xe=[];const Ne=[ce.start,ce.end],Ze=Ye(ye,Ne);if(Ze.inside&&Ze.obstacle){const pt=Ze.obstacle;if(_e){const Tt=Pe(j,be,ne,pt,!0);ye.x=Tt.x,ye.y=Tt.y;const sr=Tt.leavesPositiveSide?Math.min(pt.minY-2,j.y+pp):Math.max(pt.maxY+2,j.y-pp);Xe=[{x:j.x,y:sr},{x:Tt.x,y:sr},{x:Tt.x,y:Tt.y}]}else{const Tt=Pe(j,be,ne,pt,!1),sr=Tt.leavesPositiveSide?Math.min(pt.minX-2,j.x+pp):Math.max(pt.maxX+2,j.x-pp);ye.x=Tt.x,ye.y=Tt.y,Xe=[{x:sr,y:j.y},{x:sr,y:Tt.y},{x:Tt.x,y:Tt.y}]}}let Ge=[];const lt=Ye(oe,Ne);if(lt.inside&<.obstacle){const pt=lt.obstacle;if(Le){const Tt=Pe(ie,ne,be,pt,!0);oe.x=Tt.x,oe.y=Tt.y,Ge=[{x:Tt.x,y:Tt.y},{x:ie.x,y:Tt.y}]}else{const Tt=Pe(ie,ne,be,pt,!1);oe.x=Tt.x,oe.y=Tt.y,Ge=[{x:Tt.x,y:Tt.y},{x:Tt.x,y:ie.y}]}}if(Xe.length===0&&Ge.length===0){const pt=yC,Tt=Math.abs(ye.x-oe.x)1||Et>1,Vt=T.get(ce.start??"")??0,mt=T.get(ce.end??"")??0,Sr=Ln>1&&F(ce.start,pe)||Et>1&&F(ce.end,te),Ie=Ln<=1||Vt<=2,Xi=Et<=1||mt<=2;if((Tt||sr)&&!Kr&&(!St||St&&!Sr&&Ie&&Xi)&&!w(j,ie,ce.start,ce.end)){ce.points=[{...j},{...ye},{...oe},{...ie}],v.add(K);const li=sr?"horizontal":"vertical",Es=sr?j.y:j.x,Vn=sr?Math.min(j.x,ie.x):Math.min(j.y,ie.y),oa=sr?Math.max(j.x,ie.x):Math.max(j.y,ie.y),ci={id:`fast-path-${li}-${Es.toFixed(0)}-${K}`,orientation:li,coord:Es,spanMin:Vn,spanMax:oa,tracks:[]};g.push({edgeIndex:K,segmentIndex:0,orientation:li,pipe:ci,trackIndex:0,from:Vn,to:oa});continue}}const Fe=d("vertical",ye.x,ye.y,ye.y);ye.x=Fe.coord;const wt=d("vertical",oe.x,oe.y,oe.y);oe.x=wt.coord;let Me=Math.min(ye.x,oe.x)-50,Rt=Math.max(ye.x,oe.x)+50,Lt=Math.min(ye.y,oe.y)-50,ut=Math.max(ye.y,oe.y)+50;for(const pt of h){const Tt=Math.min(ye.x,oe.x),sr=Math.max(ye.x,oe.x),Kr=Math.min(ye.y,oe.y),Ln=Math.max(ye.y,oe.y);pt.minXTt&&pt.minYKr&&(Me=Math.min(Me,pt.minX-bJ),Rt=Math.max(Rt,pt.maxX+bJ),Lt=Math.min(Lt,pt.minY-bJ),ut=Math.max(ut,pt.maxY+bJ))}for(const pt of h){if(pt.maxXRt||pt.maxYut)continue;const Tt=yC;d("horizontal",pt.minY-Tt,Me,Rt),d("horizontal",pt.maxY+Tt,Me,Rt);const sr=d3;d("vertical",pt.minX-sr,Lt,ut),d("vertical",pt.maxX+sr,Lt,ut)}d("horizontal",ye.y,Me,Rt),d("horizontal",oe.y,Me,Rt);const Xt=o.filter(pt=>pt.orientation==="horizontal"&&pt.coord>=Lt&&pt.coord<=ut),Ft=o.filter(pt=>pt.orientation==="vertical"&&pt.coord>=Me&&pt.coord<=Rt),gt=C((pt,Tt)=>`${pt.toFixed(1)},${Tt.toFixed(1)}`,"getKey"),Ae=gt(ye.x,ye.y),zt=gt(oe.x,oe.y),kt=new Map,At=new Map,Mt=new Map,jr=new Set,Re=[];kt.set(Ae,0),Mt.set(Ae,"n"),Re.push({key:Ae,f:Math.hypot(oe.x-ye.x,oe.y-ye.y),pt:ye}),jr.add(Ae);let at=[];const xt=C((pt,Tt)=>w(pt,Tt,ce.start,ce.end),"checkSegmentBlocked"),Ct={x:oe.x,y:ye.y},gr=xt(ye,Ct),Xr=xt(Ct,oe),$r=gr||Xr,un={x:ye.x,y:oe.y},zr=xt(ye,un),On=xt(un,oe);if($r?zr||On||(Math.abs(ye.x-oe.x)0;){Re.sort((mt,Sr)=>mt.f-Sr.f);const pt=Re.shift();if(jr.delete(pt.key),pt.key===zt){let mt=zt,Sr=oe;for(at=[Sr];At.has(mt);){const Ie=At.get(mt);at.unshift(Ie),Sr=Ie,mt=gt(Ie.x,Ie.y)}break}const Tt=pt.pt.x,sr=pt.pt.y,Kr=Ft.sort((mt,Sr)=>mt.coord-Sr.coord),Ln=Kr.findIndex(mt=>Math.abs(mt.coord-Tt)<1),Et=Xt.sort((mt,Sr)=>mt.coord-Sr.coord),St=Et.findIndex(mt=>Math.abs(mt.coord-sr)<1),Vt=[];Ln>0&&Vt.push({x:Kr[Ln-1].coord,y:sr}),Ln>=0&&Ln0&&Vt.push({x:Tt,y:Et[St-1].coord}),St>=0&&StVo.nodeId===ce.start||Vo.nodeId===ce.end?!1:Sr!==Ie?Vo.minYsr&&Vo.maxX>Sr&&Vo.minXTt&&Vo.maxY>Xi&&Vo.minY10&&lv<-5||lu<-10&&lv>5)&&(oa=Math.abs(lv)*100),(ci>10&&zg<-5||ci<-10&&zg>5)&&(oa+=Math.abs(zg)*50);let ek=0;const tk=Mt.get(pt.key)??"n",rk=Math.abs(zg)>Jn?"h":"v";tk!=="n"&&tk!==rk&&(ek=50);const ul=Es+Vn+oa+ek,nd=(kt.get(pt.key)??1/0)+ul,Ec=Math.abs(oe.x-mt.x)+Math.abs(oe.y-mt.y);if(nd<(kt.get(li)??1/0))if(At.set(li,pt.pt),kt.set(li,nd),Mt.set(li,rk),!jr.has(li))Re.push({key:li,f:nd+Ec,pt:mt}),jr.add(li);else{const Vo=Re.findIndex(ff=>ff.key===li);Vo!==-1&&(Re[Vo].f=nd+Ec)}}}if(at.length===0&&(at=[ye,{x:ye.x,y:oe.y},oe]),at.length>4){const pt=at[0],Tt=at[at.length-1];let sr=Math.min(pt.x,Tt.x),Kr=Math.max(pt.x,Tt.x),Ln=Math.min(pt.y,Tt.y),Et=Math.max(pt.y,Tt.y);for(const Xi of at)sr=Math.min(sr,Xi.x),Kr=Math.max(Kr,Xi.x),Ln=Math.min(Ln,Xi.y),Et=Math.max(Et,Xi.y);const St=Kr>Math.max(pt.x,Tt.x),Vt=srVn.minXUe&&Vn.minYMn);if(Es.length>0){let Vn=Math.max(pt.x,Tt.x);for(const oa of Es){const ci=(oa.minX+oa.maxX)/2;if(oa.visualXHalfExtent===void 0||isNaN(oa.visualXHalfExtent))continue;const lu=ci+oa.visualXHalfExtent+Xi;Vn=Math.max(Vn,lu)}isNaN(Vn)||(Kr=Vn)}}if(Vt){const Ue=h.filter(Mn=>Mn.minXMath.min(pt.y,Tt.y));if(Ue.length>0){let Mn=Math.min(pt.x,Tt.x);for(const li of Ue){const Vn=(li.minX+li.maxX)/2-li.visualXHalfExtent-Xi;Mn=Math.min(Mn,Vn)}sr=Mn}}}const mt=C(Xi=>{const Ue=Tt.y>pt.y,Mn=h.filter(Vn=>{const oa=Math.min(pt.x,Tt.x)Vn.minX,ci=Math.min(pt.y,Tt.y)Vn.minY;return oa&&ci});let li=Mn;if(l&&Mn.length>0){const Vn=Mn.filter(oa=>oa.minXXi);Vn.length>0&&(li=Vn)}if(li.length===0)return Tt.y;const Es=yC;if(Ue){const oa=Math.max(...li.map(ci=>ci.maxY))+Es;if(oaci.minY))-Es;if(oa>Tt.y+Jn)return oa}return Tt.y},"findBestReturnY"),Sr=C(Xi=>{const Ue=mt(Xi),Mn={x:Xi,y:pt.y},li={x:Xi,y:Ue},Es={x:Tt.x,y:Ue},Vn=xt(pt,Mn),oa=xt(Mn,li),ci=xt(li,Es),lu=Ue!==Tt.y?xt(Es,Tt):!1;return!Vn&&!oa&&!ci&&!lu?Math.abs(Ue-Tt.y)=3){const pt=hn[hn.length-1],Tt=hn[hn.length-2],sr=hn[hn.length-3],Kr=Math.abs(sr.y-Tt.y)Math.abs(pt.x-sr.x)&&hn.splice(-2,1)}else if(Ln){const Et=Math.sign(Tt.y-sr.y),St=Math.sign(pt.y-sr.y);Et!==0&&Et===St&&Math.abs(Tt.y-sr.y)>Math.abs(pt.y-sr.y)&&hn.splice(-2,1)}}const ti=[hn[0]];for(let pt=1;ptTt.x,Et=Kr.x>sr.x;if(Ln!==Et){ti.push(sr);continue}continue}if(Math.abs(Tt.x-sr.x)Tt.y,Et=Kr.y>sr.y;if(Ln!==Et){ti.push(sr);continue}continue}ti.push(sr)}ti.push(hn[hn.length-1]);for(let pt=0;ptK.from{const j=!ne.segments.some(pe=>(pe.edgeIndex!==ce.edgeIndex||pe.segmentIndex!==ce.segmentIndex)&&z(pe,K)),ie=!be.segments.some(pe=>(pe.edgeIndex!==K.edgeIndex||pe.segmentIndex!==K.segmentIndex)&&z(pe,ce));return j&&ie?(K.trackIndex=ne.index,ce.trackIndex=be.index,be.segments=[...be.segments.filter(pe=>pe.edgeIndex!==K.edgeIndex||pe.segmentIndex!==K.segmentIndex),{edgeIndex:ce.edgeIndex,segmentIndex:ce.segmentIndex,from:ce.from,to:ce.to}],ne.segments=[...ne.segments.filter(pe=>pe.edgeIndex!==ce.edgeIndex||pe.segmentIndex!==ce.segmentIndex),{edgeIndex:K.edgeIndex,segmentIndex:K.segmentIndex,from:K.from,to:K.to}],!0):!1},"trySwapSegmentsAcrossTracks"),Q=C(K=>{const ce=K.tracks.length;return K.tracks[ce]={index:ce,coord:K.coord,segments:[]},ce},"createNewTrack"),G=C((K,ce)=>{const be=K.pipe.tracks[K.trackIndex];be.segments=be.segments.filter(j=>j.edgeIndex!==K.edgeIndex||j.segmentIndex!==K.segmentIndex),K.trackIndex=ce,K.pipe.tracks[ce].segments.push({edgeIndex:K.edgeIndex,segmentIndex:K.segmentIndex,from:K.from,to:K.to})},"moveSegmentToTrack"),X=C((K,ce)=>{const be=m[K.edgeIndex];for(const ne of be){const j=g[ne];j.pipe===K.pipe&&G(j,ce)}},"moveSegmentChainToTrack"),Y=C(K=>{const ce=m[K.edgeIndex],be=ce.indexOf(g.indexOf(K)),ne=[];return be>0&&ne.push(g[ce[be-1]]),be{if(K.orientation===ce.orientation)return!1;const be=K.orientation==="horizontal"?K:ce,ne=K.orientation==="horizontal"?ce:K;return ne.pipe.coord>be.from&&ne.pipe.coordne.from&&be.pipe.coord{for(const be of K.tracks)if(!be.segments.some(j=>(j.edgeIndex!==ce.edgeIndex||j.segmentIndex!==ce.segmentIndex)&&z(j,ce)))return be.index;return-1},"findAvailableTrack"),Z=C((K,ce)=>{if(K.trackIndex===ce.trackIndex)return z(K,ce);const be=Y(K),ne=Y(ce);return be.some(j=>ne.some(ie=>le(j,ie)))},"segmentsConflict"),ee=C((K,ce,be)=>{if(U(K,ce,K.pipe.tracks[K.trackIndex],ce.pipe.tracks[ce.trackIndex]))return;const ne=q(K.pipe,ce);be(ce,ne!==-1?ne:Q(K.pipe))},"resolveTrackConflict"),re=C(K=>{let ce=0;for(let be=0;be{if(ve.has(K))return ve.get(K);const ce=m[K];if(ce.length===0){const te={dest:0,deviation:0,base:0,delta:0};return ve.set(K,te),te}const ne=g[ce[0]].pipe.coord;let j=ne;for(let te=1;teMath.abs(_e-ne)?oe:_e;break}}const ie=Math.abs(j-ne),pe={dest:j,deviation:ie,base:ne,delta:j-ne};return ve.set(K,pe),pe},"getDestInfo"),Ce=C(()=>{let K=0;const ce=new Map;for(const[ne,j]of i.entries())m[ne].length!==0&&j.start&&(ce.has(j.start)||ce.set(j.start,[]),ce.get(j.start).push(ne));const be=C(ne=>{const j=i[ne];if(!j.start||!j.end)return 0;const ie=a.get(j.start),pe=a.get(j.end);if(!ie||!pe)return 0;const te=(pe.x??0)-(ie.x??0),ye=(pe.y??0)-(ie.y??0);return Math.abs(te)+Math.abs(ye)},"getEdgeDistance");for(const ne of ce.values()){ne.sort((ie,pe)=>{const te=ae(ie),ye=ae(pe);if(Math.abs(te.deviation-ye.deviation)>1)return te.deviation-ye.deviation;if(Math.abs(te.dest-ye.dest)>1)return te.dest-ye.dest;const oe=be(ie),_e=be(pe);if(Math.abs(oe-_e)>1)return _e-oe;const Le=m[ie].length,Ye=m[pe].length;if(Le!==Ye)return Le-Ye;if(Le===1){const Pe=m[ie][0],Xe=m[pe][0];if(g[Pe]&&g[Xe]){const Ne=g[Pe],Ze=g[Xe],Ge=Math.abs(Ne.to-Ne.from),lt=Math.abs(Ze.to-Ze.from);if(Math.abs(Ge-lt)>1)return Ge-lt}}return 0});const j=ne.map(ie=>g[m[ie][0]]);K+=re(j)}return K},"fixSourceHandleCrossings"),Oe=C(()=>{let K=0;const ce=new Map;for(const[be,ne]of i.entries())m[be].length!==0&&ne.end&&(ce.has(ne.end)||ce.set(ne.end,[]),ce.get(ne.end).push(be));for(const be of ce.values()){be.sort((j,ie)=>{const pe=C(oe=>{const _e=m[oe];if(_e.length<2)return 0;const Le=g[_e[_e.length-2]];return Math.abs(Le.to-Le.from)},"getDist"),te=pe(j),ye=pe(ie);return Math.abs(te-ye)>.1?te-ye:j-ie});const ne=be.map(j=>g[m[j][m[j].length-1]]);K+=re(ne)}return K},"fixTargetHandleCrossings"),$e=C(()=>{let K=0;for(const ce of o){const be=[];for(const ne of ce.tracks)for(const j of ne.segments){const ie=m[j.edgeIndex].find(pe=>g[pe].segmentIndex===j.segmentIndex);ie!==void 0&&be.push(g[ie])}be.sort((ne,j)=>ne.edgeIndex-j.edgeIndex||ne.segmentIndex-j.segmentIndex);for(let ne=0;ne{ne.segments.forEach(j=>{ce.push({edgeIndex:j.edgeIndex,segmentIndex:j.segmentIndex,trackIndex:ne.index,from:j.from,to:j.to})})}),ce.sort((ne,j)=>ne.from-j.from);const be=[];if(ce.length>0){let ne=[ce[0]],j=ce[0].to;for(let ie=1;iej.add(Pe.trackIndex));const ie=new Map;ne.forEach(Pe=>{const Xe=ae(Pe.edgeIndex);ie.set(Pe.trackIndex,(ie.get(Pe.trackIndex)??0)+Xe.delta)});const pe=[...j].filter(Pe=>(ie.get(Pe)??0)<-1),te=[...j].filter(Pe=>(ie.get(Pe)??0)>1),ye=[...j].filter(Pe=>Math.abs(ie.get(Pe)??0)<=1);pe.sort((Pe,Xe)=>(ie.get(Xe)??0)-(ie.get(Pe)??0)),te.sort((Pe,Xe)=>(ie.get(Pe)??0)-(ie.get(Xe)??0));const oe=C((Pe,Xe)=>{ne.filter(Ne=>Ne.trackIndex===Pe).forEach(Ne=>{const Ze=v.has(Ne.edgeIndex)?K.coord:Xe;Te.set(`${Ne.edgeIndex}-${Ne.segmentIndex}`,Ze)})},"assignCoord");let _e=0;for(const Pe of pe)_e++,oe(Pe,K.coord-_e*eCe);if(ye.length===0&&j.size>0){const Pe=[...j].sort((Ze,Ge)=>Math.abs(ie.get(Ze)??0)-Math.abs(ie.get(Ge)??0))[0],Xe=pe.indexOf(Pe);Xe!==-1&&pe.splice(Xe,1);const Ne=te.indexOf(Pe);Ne!==-1&&te.splice(Ne,1),ye.push(Pe)}let Le=0;for(const Pe of ye){if(Le===0)oe(Pe,K.coord);else{const Xe=Le%2===1?1:-1,Ne=Math.ceil(Le/2);oe(Pe,K.coord+Xe*Ne*eCe*.5)}Le++}let Ye=0;for(const Pe of te)Ye++,oe(Pe,K.coord+Ye*eCe)}}for(const[K,ce]of i.entries()){const be=m[K]??[];if(be.length===0)continue;const ne=[],j=a.get(ce.start),ie=a.get(ce.end),{pSrcPort:pe,pDstPort:te}=V(K,j,ie),ye=be.map(Le=>{const Ye=g[Le],Pe=Te.get(`${Ye.edgeIndex}-${Ye.segmentIndex}`)??Ye.pipe.coord;return{orient:Ye.orientation,coord:Pe,from:Ye.from,to:Ye.to}});ne.push(pe);for(let Le=0;LeJn&&ne.push(bC(Ye,Xe)),Ge&&Ze.orient===Ye.orient)if(Math.abs(Ye.coord-Ze.coord)>Jn){const lt=Ye.orient==="vertical"?(Xe+Ze.from)/2:rCe(Ye,Ze);ne.push(bC(Ye,lt),bC(Ze,lt))}else(Le===0||Le===ye.length-2)&&ne.push(bC(Ye,rCe(Ye,Ze)));else if(Ge)ne.push(bC(Ye,Ze.coord));else{const lt=Math.abs(Ye.from-Xe)Jn||Math.abs(oe.y-te.y)>Jn)&&ne.push(te);const _e=[];ne.length>0&&_e.push(ne[0]);for(let Le=1;LeJn||Math.abs(Ye.y-Pe.y)>Jn)&&_e.push(Ye)}ce.points=_e}for(const K of i){const ce=K.__originalEdge;ce&&K.points&&(ce.points=K.points)}t.edges=(t.edges??[]).filter(K=>!K.isLayoutOnly);const ge=C((K,ce)=>{const be=ce.x??0,ne=ce.y??0,j=ce.width??0,ie=ce.height??0;if(j<=0||ie<=0)return K;const pe=be-j/2,te=be+j/2,ye=ne-ie/2,oe=ne+ie/2;if(K.xte||K.yoe)return K;const _e=K.x-pe,Le=te-K.x,Ye=K.y-ye,Pe=oe-K.y,Xe=Math.min(_e,Le,Ye,Pe);return Xe===_e?{x:pe,y:K.y}:Xe===Le?{x:te,y:K.y}:Xe===Ye?{x:K.x,y:ye}:{x:K.x,y:oe}},"nodeBoundaryClamp");for(const K of t.edges){const ce=K.points;if(!ce||ce.length<2)continue;const be=K.start,ne=K.end,j=be?a.get(be):void 0,ie=ne?a.get(ne):void 0;j&&(ce[0]=ge(ce[0],j)),ie&&(ce[ce.length-1]=ge(ce[ce.length-1],ie))}return t}C(GDt,"routeEdgesOrthogonal");function HDt(t){return t.direction??"TB"}C(HDt,"getSwimlaneDirection");function WDt(t){var h,d,f,p,g;const e=SRt(t),r=((h=t.config.flowchart)==null?void 0:h.nodeSpacing)??40,n=((d=t.config.flowchart)==null?void 0:d.rankSpacing)??100,i=((f=t.config.swimlane)==null?void 0:f.ignoreCrossLaneEdges)??!0,a=((p=t.config.swimlane)==null?void 0:p.optimizeRanksByCrossings)??!0,s=((g=t.config.swimlane)==null?void 0:g.automaticLaneOrdering)??!1,o=HDt(t),{ordered:l,coordinates:u}=QDt(e,{nodeGap:r,layerGap:n,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:a,automaticLaneOrdering:s,direction:o});CRt(e,l,u,{nodeGap:r,layerGap:n});for(const m of t.edges??[])delete m.points;GDt(t,o);for(const m of t.edges??[])(!m.curve||m.curve==="basis")&&(m.curve="rounded");return sDt(t,o),aDt(t),o}C(WDt,"runSwimlaneLayoutCore");async function YDt(t,e){const r=e.select("g");Pbe(r,t.markers,t.type,t.diagramId),Pxt(),Fxt(),nbt(),O3t(),TRt(t);const n=ORt(t);t.nodes=n.nodes,t.edges=n.edges;const{groups:i}=await oRt(r,t);WDt(t),await bRt(t,i)}C(YDt,"render");const _kn=Object.freeze(Object.defineProperty({__proto__:null,render:YDt},Symbol.toStringTag,{value:"Module"}));function nCe(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +Parent cluster`,i.height),e.setNode(i.id,w),e.parent(b)||(me.trace("Setting parent",b,i.id),e.setParent(b,i.id,w))}if(me.info("(Insert) Node XXX"+b+": "+JSON.stringify(e.node(b))),x!=null&&x.clusterNode){me.info("Cluster identified XBX",b,x.width,e.node(b));const{ranksep:w,nodesep:A}=e.graph();x.graph.setGraph({...x.graph.graph(),ranksep:w+25,nodesep:A});const S=await sRt(d,x.graph,r,n,e.node(b),a),T=S.elem;Pr(x,T),x.diff=S.diff||0,me.info("New compound node after recursive render XAX",b,"width",x.width,"height",x.height),Grn(T,x)}else e.children(b).length>0?(me.trace("Cluster - the non recursive path XBX",b,x.id,x,x.width,"Graph:",e),me.trace(s3(x.id,e)),Dn.set(x.id,{id:s3(x.id,e),node:x})):(me.trace("Node - the non recursive path XAX",b,d,e.node(b),s),await T7(d,e.node(b),{config:a,dir:s}))})),await C(async()=>{const b=e.edges().map(async function(x){const w=e.edge(x.v,x.w,x.name);if(me.info("Edge "+x.v+" -> "+x.w+": "+JSON.stringify(x)),me.info("Edge "+x.v+" -> "+x.w+": ",x," ",JSON.stringify(e.edge(x))),me.info("Fix",Dn,"ids:",x.v,x.w,"Translating: ",Dn.get(x.v),Dn.get(x.w)),f&&w.selfLoop){if(w.selfLoop.order!==1)return;const A=w.id;w.id=w.selfLoop.id,await aX(h,w),w.id=A;return}await aX(h,w)});await Promise.all(b)},"processEdges")(),me.info("Graph before layout:",JSON.stringify(b1(e))),me.info("############################################# XXX"),me.info("### Layout ### XXX"),me.info("############################################# XXX"),rRt(e),me.info("Graph after layout:",JSON.stringify(b1(e)));let g=0,{subGraphTitleTotalMargin:m}=q5(a);await Promise.all(SCn(e).map(async function(b){var w;const x=e.node(b);if(me.info("Position XBX => "+b+": ("+x.x,","+x.y,") width: ",x.width," height: ",x.height),x!=null&&x.clusterNode)x.y+=m,me.info("A tainted cluster node XBX1",b,x.id,x.width,x.height,x.x,x.y,e.parent(b)),Dn.get(x.id).node=x,iX(x);else if(e.children(b).length>0){me.info("A pure cluster node XBX1",b,x.id,x.x,x.y,x.width,x.height,e.parent(b)),x.height+=m,e.node(x.parentId);const A=(x==null?void 0:x.padding)/2||0,S=((w=x==null?void 0:x.labelBBox)==null?void 0:w.height)||0,T=S-A||0;me.debug("OffsetY",T,"labelHeight",S,"halfPadding",A),await tX(l,x),Dn.get(x.id).node=x}else{const A=e.node(x.parentId);x.y+=m/2,me.info("A regular node XBX1 - using the padding",x.id,"parent",x.parentId,x.width,x.height,x.x,x.y,"offsetY",x.offsetY,"parent",A,A==null?void 0:A.offsetY,x),iX(x)}}));const v=m/2;return aRt(e,v,{mergeSelfLoops:f}).forEach(function({edge:b,start:x,end:w}){me.info("Edge "+x+" -> "+w+": "+JSON.stringify(b),b),b.points.forEach(O=>O.y+=v);const A=e.node(x),S=e.node(w),T=Mbe(u,b,Dn,r,A,S,n);zxt(b,T)}),e.nodes().forEach(function(b){const x=e.node(b);me.info(b,x.type,x.diff),x.isGroup&&(g=x.diff)}),me.warn("Returning from recursive render XAX",o,g),{elem:o,diff:g}},"recursiveRender"),mkn=C(async(t,e)=>{var a,s,o,l,u,h;const r=new ru({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:((a=t.config)==null?void 0:a.nodeSpacing)||((o=(s=t.config)==null?void 0:s.flowchart)==null?void 0:o.nodeSpacing)||t.nodeSpacing,ranksep:((l=t.config)==null?void 0:l.rankSpacing)||((h=(u=t.config)==null?void 0:u.flowchart)==null?void 0:h.rankSpacing)||t.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),n=e.select("g");Pbe(n,t.markers,t.type,t.diagramId),Pxt(),Fxt(),nbt(),O3t(),t.nodes.forEach(d=>{r.setNode(d.id,{...d}),d.parentId&&r.setParent(d.id,d.parentId)}),me.debug("Edges:",t.edges),t.edges.forEach(d=>{if(d.start===d.end){const f=d.start,p=f+"---"+f+"---1",g=f+"---"+f+"---2",m=r.node(f);r.setNode(p,{domId:p,id:p,parentId:m.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),r.setParent(p,m.parentId),r.setNode(g,{domId:g,id:g,parentId:m.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),r.setParent(g,m.parentId);const v=structuredClone(d),y=structuredClone(d),b=structuredClone(d),x=structuredClone(d);y.originalEdge=v,y.selfLoop={id:v.id,order:0},b.originalEdge=v,b.selfLoop={id:v.id,order:1},x.originalEdge=v,x.selfLoop={id:v.id,order:2},y.label="",y.arrowTypeEnd="none",y.endLabelLeft="",y.endLabelRight="",y.startLabelLeft="",y.id=f+"-cyclic-special-1",b.startLabelRight="",b.startLabelLeft="",b.endLabelLeft="",b.endLabelRight="",b.arrowTypeStart="none",b.arrowTypeEnd="none",b.id=f+"-cyclic-special-mid",x.label="",x.startLabelRight="",x.startLabelLeft="",x.arrowTypeStart="none",m.isGroup&&(y.fromCluster=f,x.toCluster=f),x.id=f+"-cyclic-special-2",x.arrowTypeStart="none",r.setEdge(f,p,y,f+"-cyclic-special-0"),r.setEdge(p,g,b,f+"-cyclic-special-1"),r.setEdge(g,f,x,f+"-cyclic-special-2")}else r.setEdge(d.start,d.end,{...d},d.id)}),me.warn("Graph at first:",JSON.stringify(b1(r))),ACn(r),me.warn("Graph after XAX:",JSON.stringify(b1(r)));const i=He();await sRt(n,r,t.type,t.diagramId,void 0,i)},"render");const vkn=Object.freeze(Object.defineProperty({__proto__:null,getEdgesToRender:aRt,render:mkn},Symbol.toStringTag,{value:"Module"}));async function oRt(t,e){const r=new ru({multigraph:!0,compound:!0}),n=[...e.edges],i=He(),a=t.insert("g").attr("class","root"),s=a.insert("g").attr("class","clusters"),o=a.insert("g").attr("class","edges edgePath"),l=a.insert("g").attr("class","edgeLabels"),u=a.insert("g").attr("class","nodes"),h=new Map,d=t.node()!=null;await Promise.all(e.nodes.map(async f=>{var p;if(f.isGroup)r.setNode(f.id,{...f});else{if(d){const g=await T7(u,f,{config:i,dir:f.dir}),m=((p=g.node())==null?void 0:p.getBBox())??{width:0,height:0};h.set(f.id,g),f.width=m.width,f.height=m.height}r.setNode(f.id,{...f})}}));for(const f of n)r.setEdge(f.start,f.end,{...f},f.id),e.edges.some(g=>g.id===f.id)||e.edges.push(f);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:f}=await Promise.resolve().then(()=>tri);f(t,e)}return{graph:r,groups:{clusters:s,edgePaths:o,edgeLabels:l,nodes:u,rootGroups:a},nodeElements:h}}C(oRt,"createGraphWithElements");var lRt=5,JZ=1e-5,eJ=1e-6;function tJ(t){const e=[];for(let r=0;r=1-eJ||f<=eJ||f>=1-eJ?null:{point:{x:t.x+d*i,y:t.y+d*a},tA:d,tB:f}}C(cRt,"segmentIntersection");function eTe(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}C(eTe,"isHorizontalSeg");function uRt(t){const e=[];for(let r=0;r=Math.abs(r)?e>=0?1:0:r>=0?1:0}C(hRt,"getArcSweepFlag");var ykn=.001;function dRt(t,e){if(t.length<2)return t.map(a=>({...a}));const r=t.map(a=>({...a})),n=e.arrowTypeStart&&Rl[e.arrowTypeStart];if(n){const a=t[0],s=t[1],o=Math.atan2(s.y-a.y,s.x-a.x);r[0].x=a.x+n*Math.cos(o),r[0].y=a.y+n*Math.sin(o)}const i=e.arrowTypeEnd&&Rl[e.arrowTypeEnd];if(i){const a=t.length,s=t[a-2],o=t[a-1],l=Math.atan2(o.y-s.y,o.x-s.x);r[a-1].x=o.x-i*Math.cos(l),r[a-1].y=o.y-i*Math.sin(l)}return r}C(dRt,"applyMarkerOffsets");function fRt(t,e,r,n,i){const a=t.point.x,s=t.point.y,o={x:a-e*t.r,y:s-r*t.r},l={x:a+e*t.r,y:s+r*t.r},u=[`L${l3(o)}`];return i==="arc"?u.push(`A${yg(t.r)},${yg(t.r)} 0 0 ${n} ${l3(l)}`):u.push(`M${l3(l)}`),u}C(fRt,"emitJump");function tTe(t,e,r,n){const i=e.x-t.x,a=e.y-t.y,s=r.x-e.x,o=r.y-e.y,l=Math.hypot(i,a),u=Math.hypot(s,o);if(l0){const x=tTe(i[u-1],i[u],i[u+1]??i[u],lRt);x&&(m=x.cutLen)}let v=d,y=null;a&&ux.t-w.t);for(const x of b)x.r=Math.min(x.r,x.d-m,v-x.d);for(let x=0;xw){const A=w/2;b[x].r=Math.min(b[x].r,A),b[x+1].r=Math.min(b[x+1].r,A)}}for(const x of b)x.r=2?n:null}catch{return null}}C(vRt,"decodeDataPoints");function yRt(t,e,r){if(!r.enabled)return;const n=t.node();if(!n)return;const i=new Map;for(const u of e)i.set(u.id,u);const a=[],s=new Map;for(const u of e){const h=typeof CSS<"u"&&CSS.escape?CSS.escape(u.id):u.id,d=n.querySelector(`path[data-id="${h}"]`);if(!d)continue;s.set(u.id,d);const p=vRt(d.getAttribute("data-points"))??u.points;a.push({...u,points:p})}const o=uRt(a);if(o.length===0)return;const l=new Map;for(const u of o){const h=l.get(u.jumpEdgeId)??[];h.push(u),l.set(u.jumpEdgeId,h)}for(const u of a){const h=l.get(u.id);if(!h||h.length===0)continue;const d=i.get(u.id),f=d==null?void 0:d.curve;if(f!==void 0&&!mRt(f))continue;const p=s.get(u.id);if(!p)continue;if(f===void 0){const x=p.getAttribute("d")??"";if(!gRt(x))continue}const g=p.getAttribute("style")??"",m=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(g),v=m?Number.parseFloat(m[1]):null,y=m?Number.parseFloat(m[2]):null,b=pRt(u,h,r);if(p.setAttribute("d",b),v!==null&&y!==null&&typeof p.getTotalLength=="function"){const x=p.getTotalLength(),w=Math.max(0,x-v-y),A=`0 ${v} ${w} ${y}`,S=g.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${A};`).replace(/;\s*;+/g,";");p.setAttribute("style",S)}}}C(yRt,"applyLineJumpsToSvg");async function bRt(t,e){var i,a;for(const s of t.nodes)s.isGroup?await tX(e.clusters,s):iX(s);const r=new Map;for(const s of t.nodes)s!=null&&s.id&&r.set(s.id,s);for(const s of t.edges){const o=s.start?r.get(s.start)??{}:{},l=s.end?r.get(s.end)??{}:{},u=Mbe(e.edgePaths,{...s},{},t.type,o,l,t.diagramId);s.label&&await aX(e.rootGroups,s),s.label&&xRt(s,u)}const n=(a=(i=t.config)==null?void 0:i.swimlane)==null?void 0:a.lineHops;if(n!==!1){const s=n==="gap"?"gap":"arc",o=t.edges.filter(l=>Array.isArray(l.points)&&l.points.length>=2).map(l=>({id:l.id,points:l.points,curve:l.curve,arrowTypeStart:l.arrowTypeStart,arrowTypeEnd:l.arrowTypeEnd}));yRt(e.edgePaths,o,{enabled:!0,jumpRadius:6,jumpStyle:s})}}C(bRt,"adjustLayout");function xRt(t,e){const r=(e==null?void 0:e.updatedPath)??(e==null?void 0:e.originalPath),n=Dr(),{subGraphTitleTotalMargin:i}=q5({flowchart:n.flowchart??{}});if(t.label){const a=O7.get(t.id);let s=t.x,o=t.y;if(r){const l=ln.calcLabelPosition(r);me.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t!=null&&t.startLabelLeft){const a=oo.get(t.id).startLeft;let s=t==null?void 0:t.x,o=t==null?void 0:t.y;if(r){const l=ln.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=oo.get(t.id).startRight;let s=t.x,o=t.y;if(r){const l=ln.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=oo.get(t.id).endLeft;let s=t.x,o=t.y;if(r){const l=ln.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=oo.get(t.id).endRight;let s=t.x,o=t.y;if(r){const l=ln.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}}C(xRt,"positionEdgeLabel");var rTe="__swimlane_default__",bkn=21,wRt=20;function nTe(t){return Math.max(t.padding??wRt,wRt)}C(nTe,"topLaneHorizontalPadding");function ARt(t){const{x:e,y:r,width:n,height:i}=t,a=t.swimlaneContentTop;if(typeof e!="number"||typeof r!="number"||typeof n!="number"||typeof i!="number"||typeof a!="number"||!Number.isFinite(e)||!Number.isFinite(r)||!Number.isFinite(n)||!Number.isFinite(i)||!Number.isFinite(a)||n<=0||i<=0){delete t.groupTitleRect;return}const s=r-i/2,o=Math.min(a,r+i/2),l=Math.min(bkn,Math.max(0,o-s)),u=s+l;if(u<=s){delete t.groupTitleRect;return}t.groupTitleRect={left:e-n/2,right:e+n/2,top:s,bottom:u}}C(ARt,"assignTopLaneTitleRect");function SRt(t){const e=t.direction,r=t.nodes??(t.nodes=[]);for(const a of t.nodes??[])a.isGroup&&!a.parentId&&(a.shape="swimlane",e&&(a.direction=e));const n=r.filter(a=>!a.isGroup&&!a.parentId);if(n.length===0)return;let i=r.find(a=>a.id===rTe);i?i.isGroup&&(i.shape="swimlane",e&&(i.direction=e)):(i={id:rTe,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},r.push(i));for(const a of n)a.parentId=rTe}C(SRt,"prepareLayoutForSwimlanes");function TRt(t){const e=new Map;for(const l of t.nodes??[])e.set(l.id,l);const r=[];for(const l of t.edges??[]){const u=typeof l.start=="string"?l.start:void 0,h=typeof l.end=="string"?l.end:void 0;!u||!h||l.labelNodeId||r.push({id:l.id,src:u,dst:h,ref:l})}const n=t.nodes??[],i=n.filter(l=>l.isGroup),a=n.filter(l=>!l.isGroup);return{nodes:[...[...i].reverse(),...a].map(l=>l.id),edges:r,layout:t,nodeById:e}}C(TRt,"toGraphView");function CRt(t,e,r,n){const{layout:i}=t,a=t.nodeById,s=(n==null?void 0:n.layerGap)??100,o=(n==null?void 0:n.nodeGap)??40;let l=0;for(const f of e.layers){let p=0;for(const g of f){const m=a.get(g);if(!m){p++;continue}m.layer=l,m.order=p;const v=r.x[g]??p*o,y=r.y[g]??l*s;m.x=v,m.y=y,p++}l++}const u=i.nodes??[],h=new Map,d=[];for(const f of u){if(!(f!=null&&f.isGroup))continue;f.parentId||d.push(f);const p=u.filter(b=>b.parentId===f.id);let g=1/0,m=-1/0,v=1/0,y=-1/0;for(const b of p){const x=b.x??r.x[b.id],w=b.y??r.y[b.id],A=b.width??0,S=b.height??0;x!=null&&w!=null&&(g=Math.min(g,x-A/2),m=Math.max(m,x+A/2),v=Math.min(v,w-S/2),y=Math.max(y,w+S/2))}if(g===1/0||v===1/0)f.x=f.x??0,f.y=f.y??0,f.width=f.width??0,f.height=f.height??0;else{const b=f.padding??20,x=f.parentId?b:2*nTe(f),w=b,A=Math.max(0,m-g)+x,S=Math.max(0,y-v)+w,T=(g+m)/2,O=(v+y)/2;f.x=T,f.y=O,f.width=A,f.height=S,h.set(f.id,{minX:g,maxX:m,minY:v,maxY:y})}}if(d.length>0&&h.size>0){let f=1/0,p=-1/0,g=0;for(const m of d){const v=m.padding??20;v>g&&(g=v);const y=h.get(m.id);y&&(f=Math.min(f,y.minY),p=Math.max(p,y.maxY))}if(f!==1/0&&p!==-1/0){const m=Math.max(0,p-f),y=Math.max(g,36),b=m+2*y,x=(f+p)/2;for(const k of d)k.y=x,k.height=b,k.swimlaneContentTop=f;const w=[...d].sort((k,E)=>{const _=k.x??0,I=E.x??0;return _-I}),A=[],S=[],T=[];for(const k of w){const E=h.get(k.id);if(!E)continue;const _=Math.max(0,E.maxX-E.minX)+2*nTe(k),I=(E.minX+E.maxX)/2;A.push(k.id),S.push(I),T.push(_)}const O=A.length;if(O>0){const k=new Map;if(O===1)k.set(A[0],T[0]);else{const E=[];for(let D=0;D0&&i>0?{cx:e,cy:r,rect:u3(e,r,n,i)}:void 0}C(iTe,"measuredNodeRect");function aTe(t){if(t.isGroup)return;const e=iTe(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}C(aTe,"nodeBoundsInfoFor");function fp(t,e,r=Ml){return Math.abs(t.x-e.x)r}C(Hs,"isHorizontalSegment");function Ws(t,e,r=Ml){return yi(t,e,r)&&Math.abs(t.y-e.y)>r}C(Ws,"isVerticalSegment");function Vu(t,e,r,n){return Math.max(0,Math.min(Math.max(t,e),Math.max(r,n))-Math.max(Math.min(t,e),Math.min(r,n)))}C(Vu,"overlapLength");function E0(t,e,r=Ml){return t.horizontal&&e.horizontal&&Ci(t.a,e.a,r)?Vu(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&yi(t.a,e.a,r)?Vu(t.a.y,t.b.y,e.a.y,e.b.y):0}C(E0,"sameAxisSegmentOverlapLength");function c3(t,e=Ml){const r=[];for(let n=0;n0?r[r.length-1]:void 0;(!i||!fp(i,n,e))&&r.push({x:n.x,y:n.y})}return r}C(Li,"dedupeConsecutivePoints");function sTe(t,e=Ml){if(!t||t.length!==4)return;const[r,n,i,a]=t;return Hs(r,n,e)&&Ws(n,i,e)&&Hs(i,a,e)?{kind:"HVH",p0:r,p1:n,p2:i,p3:a}:Ws(r,n,e)&&Hs(n,i,e)&&Ws(i,a,e)?{kind:"VHV",p0:r,p1:n,p2:i,p3:a}:void 0}C(sTe,"classifyThreeSegmentRoute");function rJ(t,e,r,n=0){const i=Math.min(t.x,e.x),a=Math.max(t.x,e.x),s=Math.min(t.y,e.y),o=Math.max(t.y,e.y);return a>r.left-n&&ir.top-n&&se.left+r&&t.xe.top+r&&t.y=e.right&&t.top<=e.top&&t.bottom>=e.bottom}C(kRt,"rectContainsRect");function nJ(t,e){return t.lefte.left&&t.tope.top}C(nJ,"rectsOverlap");function lTe(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}C(lTe,"inflateRect");function u3(t,e,r,n){return{left:t-r/2,right:t+r/2,top:e-n/2,bottom:e+n/2}}C(u3,"rectFromCenterSize");function Vh(t){var e;return(e=iTe(t))==null?void 0:e.rect}C(Vh,"rectOfNodeBounds");function vC(t,e){switch(e){case"top":return{x:t.cx,y:t.rect.top};case"bottom":return{x:t.cx,y:t.rect.bottom};case"left":return{x:t.rect.left,y:t.cy};case"right":return{x:t.rect.right,y:t.cy}}}C(vC,"portForRectSide");function cTe(t,e,r,n,i,a=Ml){const s=e==="left"||e==="right",o=n==="left"||n==="right";if(s&&o){if(e==="right"&&n==="left"&&t.xr.x){if(Ci(t,r,a))return[t,r];const d=(t.x+r.x)/2;return[t,{x:d,y:t.y},{x:d,y:r.y},r]}if(e===n){if(Ci(t,r,a))return;const d=e==="left"?Math.min(t.x,r.x)-i:Math.max(t.x,r.x)+i;return[t,{x:d,y:t.y},{x:d,y:r.y},r]}return}if(!s&&!o){if(e===n){if(yi(t,r,a))return;const f=e==="top"?Math.min(t.y,r.y)-i:Math.max(t.y,r.y)+i;return[t,{x:t.x,y:f},{x:r.x,y:f},r]}if(!(e==="bottom"&&n==="top"&&t.yr.y))return;if(yi(t,r,a))return[t,r];const d=(t.y+r.y)/2;return[t,{x:t.x,y:d},{x:r.x,y:d},r]}if(s&&!o){const h=e==="right"&&r.x>t.x||e==="left"&&r.xr.y;return h&&d?[t,{x:r.x,y:t.y},r]:void 0}const l=e==="bottom"&&r.y>t.y||e==="top"&&r.yr.x;return l&&u?[t,{x:t.x,y:r.y},r]:void 0}C(cTe,"buildOrthogonalPortPath");function uTe(t,e,r,n){return e==="left"||e==="right"?[t,{x:n,y:t.y},{x:n,y:r.y},r]:[t,{x:t.x,y:n},{x:r.x,y:n},r]}C(uTe,"buildSameSideTrackPath");function iJ(t){const e=new Map,r=[];for(const n of t){if(n.isEdgeLabel)continue;const i=aTe(n);i&&(e.set(i.id,i),r.push({id:i.id,rect:i.rect}))}return{nodeInfoById:e,realNodeRects:r}}C(iJ,"collectRealNodeBounds");function O2(t){const e=[],r=[];for(const n of t){const i=aTe(n);if(!i)continue;const a={id:i.id,rect:i.rect};n.isEdgeLabel?r.push(a):e.push(a)}return{realNodeRects:e,labelNodeRects:r}}C(O2,"collectNodeRectEntries");function ERt(t,{includeEdgeLabels:e=!0}={}){const r=[];for(const n of t){if(n.isGroup||!e&&n.isEdgeLabel)continue;const i=n.x??0,a=n.y??0,s=n.width??0,o=n.height??0;r.push({nodeId:n.id,...u3(i,a,s,o)})}return r}C(ERt,"collectLayoutNodeRects");function hTe(t,e,r=Ml){const n=t.start,i=t.end;if(!n||!i)return;const a=e.get(n),s=e.get(i);if(!(!a||!s))return{srcId:n,dstId:i,srcInfo:a,dstInfo:s,collinearX:Math.abs(a.cx-s.cx)g||fy)return!1;const b=Math.abs(m-h.a.x)i:a&&o&&Ci(t,r,i)?Vu(t.x,e.x,r.x,n.x)>i:!1}C(_Rt,"sameAxisSegmentsOverlap");function aJ(t,e,r,n,{epsilon:i=Ml,skipDegenerateOther:a=!1}={}){for(const s of r){if(s===n||s.isLayoutOnly)continue;const o=s.points;if(!(!o||o.length<2))for(let l=0;lf+i&&gm+i&&dn+Ml&&t=2?e[e.length-2]:void 0,l=(s?yi(s,i):!1)?{x:i.x,y:a.y}:{x:a.x,y:i.y};e.push(l)}e.push(a)}const r=[];for(const n of e){const i=r[r.length-1];(!i||!fp(i,n))&&r.push(n)}return r}C(sJ,"orthogonalizePolyline");function _0(t){if(t.length<3)return t;let e=[...t];for(let r=0;r<32;r++){const n=DRt(e);if(e=n.points,!n.changed)break}return e}C(_0,"simplifyPolyline");var gn=.001,wkn=.5,LRt=4;function pTe(t,e,r){const n=t;if(n.isLayoutOnly||!n.points||n.points.length=0&&i=t.length)return t;const a=i-n;if(a<0||a>=t.length)return t;const s=MRt(t[i],t[a],e);return r?[s,...t.slice(i)]:[...t.slice(0,i+1),s]}C(gTe,"clipEndpoint");function IRt(t,e){for(const r of t){const n=pTe(r,e,2);if(!n)continue;let i=[...n.points];n.srcRect&&(i=gTe(i,n.srcRect,!0)),n.dstRect&&(i=gTe(i,n.dstRect,!1)),i=_0(sJ(i)),i=xTe(i,n.srcRect,n.dstRect),n.edge.points=_0(sJ(i))}}C(IRt,"clipEdgeEndpointsToNodeBoundaries");function mTe(t,e,r,n=!1){if(Ci(t,e,gn)){if(e.yr.bottom+gn)return e;if(n){if(t.xr.right+gn)return{x:r.right,y:t.y}}return{x:Math.abs(e.x-r.left)<=Math.abs(e.x-r.right)?r.left:r.right,y:t.y}}if(yi(t,e,gn)){if(e.xr.right+gn)return e;if(n){if(t.yr.bottom+gn)return{x:t.x,y:r.bottom}}const i=Math.abs(e.y-r.top)<=Math.abs(e.y-r.bottom);return{x:t.x,y:i?r.top:r.bottom}}return e}C(mTe,"snapEndpointToBoundary");function oJ(t,e,r){const n=t[e];for(let i=e+r;i>=0&&in.lo)),r=Math.min(...t.map(n=>n.hi));if(!(e>r))return{lo:e,hi:r}}C(PRt,"intersectRanges");function yTe(t,e){return e==="left"||e==="right"?lJ(t.top,t.bottom):lJ(t.left,t.right)}C(yTe,"clearanceRangeForSide");function cJ(t,e,r){const n=t.y>=r.top-gn&&t.y<=r.bottom+gn,i=t.x>=r.left-gn&&t.x<=r.right+gn;if(Ci(t,e,gn)&&n){if(Math.abs(t.x-r.left)0?PRt(a):void 0}C(NRt,"straightClearanceRange");function bTe(t,e,r,n,i){const a=NRt(t,e,r,n,i);if(!a)return;const s=i?t.y:t.x,o=Math.min(a.hi,Math.max(a.lo,s));if(!(Math.abs(o-s)({...o}));for(let o=e;o>=0&&o=r.left-gn&&Math.max(t.x,e.x)<=r.right+gn,i=Math.min(t.y,e.y)>=r.top-gn&&Math.max(t.y,e.y)<=r.bottom+gn;if(Math.abs(t.y-r.top)n.bottom+gn;case"left":return Ci(e,r,gn)&&r.xn.right+gn}}C(STe,"leavesOutward");function TTe(t,e,r){if(t.length<3)return t;if(r){const a=ATe(t[0],t[1],e);return a&&STe(a,t[1],t[2],e)?t.slice(1):t}const n=t.length-1,i=ATe(t[n-1],t[n],e);return i&&STe(i,t[n-1],t[n-2],e)?t.slice(0,n):t}C(TTe,"collapseOwnBorderStub");function FRt(t,e,r){let n=t;if(e){const a=oJ(n,0,1);if(a){const s=mTe(a,n[0],e);s!==n[0]&&(n=[s,...n.slice(1)])}n=TTe(n,e,!0)}if(r){const a=n.length-1,s=oJ(n,a,-1);if(s){const o=mTe(s,n[a],r,!0);o!==n[a]&&(n=[...n.slice(0,a),o])}n=TTe(n,r,!1)}const i=xTe(n,e,r);return i!==n||n.length===2?i:(e&&(n=wTe(n,e,!0)),r&&(n=wTe(n,r,!1)),n)}C(FRt,"snapAndCollapseEndpoints");function CTe(t,e){for(const r of t){const n=pTe(r,e,2);if(!n)continue;const i=Li(n.points,gn),a=FRt(i,n.srcRect,n.dstRect);if(a.length<3){n.edge.points=a;continue}const s=[a[0],{...a[0]},...a.slice(1,-1),a[a.length-1],{...a[a.length-1]}];n.edge.points=s}}C(CTe,"prepareEdgeEndpointsForRenderer");function OTe(t){return new Map(t.map(e=>[e.id,e]))}C(OTe,"buildNodeMap");function zRt(t,e){let r=t.parentId,n=null;for(;r;){const i=e.get(r);if(!(i!=null&&i.isGroup))break;n=i.id,r=i.parentId}return n}C(zRt,"resolveTopLevelGroupId");function kTe(t,e){let r=0,n=t.parentId;for(;n;){const i=e.get(n);if(!(i!=null&&i.isGroup))break;r++,n=i.parentId}return r}C(kTe,"groupDepth");function ETe(t){let e=1/0,r=-1/0,n=1/0,i=-1/0;for(const a of t){const s=a.x,o=a.y;if(typeof s!="number"||typeof o!="number")continue;const l=a.width??0,u=a.height??0;e=Math.min(e,s-l/2),r=Math.max(r,s+l/2),n=Math.min(n,o-u/2),i=Math.max(i,o+u/2)}return e===1/0||n===1/0?null:{minX:e,maxX:r,minY:n,maxY:i}}C(ETe,"boundsForChildren");function URt(t,e){const r=t.padding??20;t.x=(e.minX+e.maxX)/2,t.y=(e.minY+e.maxY)/2,t.width=Math.max(0,e.maxX-e.minX)+r,t.height=Math.max(0,e.maxY-e.minY)+r}C(URt,"applyGroupBounds");function VRt(t){const e=OTe(t),r=t.filter(n=>n.isGroup&&n.parentId).sort((n,i)=>kTe(i,e)-kTe(n,e));for(const n of r){const i=t.filter(s=>s.parentId===n.id),a=ETe(i);a&&URt(n,a)}}C(VRt,"recomputeNestedGroupBounds");function uJ(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(l=>!l.isGroup);let a=1/0,s=-1/0;for(const l of i){const u=l[e];typeof u=="number"&&(a=Math.min(a,u),s=Math.max(s,u))}if(!Number.isFinite(a)||!Number.isFinite(s))return!1;const o=C(l=>a+s-l,"mirror");for(const l of r){const u=l[e];typeof u=="number"&&(l[e]=o(u));const h=l.groupTitleRect;h&&(l.groupTitleRect=e==="x"?{...h,left:o(h.right),right:o(h.left)}:{...h,top:o(h.bottom),bottom:o(h.top)})}for(const l of n)for(const u of l.points??[])u[e]=o(u[e]);return!0}C(uJ,"mirrorAxis");function QRt(t){return(t.nodes??[]).some(r=>!r.isGroup)?uJ(t,"y"):!0}C(QRt,"applyBtDirectionTransform");function GRt(t,e="LR"){const r=t.nodes??[],n=t.edges??[],i=r.filter(L=>!L.isGroup);let a=1/0,s=1/0;for(const L of i){const R=L.x??0,D=L.y??0;R0?Math.max(1,h/d):1;for(const L of i){const R=L.x??0,M=((L.y??0)-s)*f+o,P=R-a;L.x=M,L.y=P}for(const L of n)if(L.points)for(const R of L.points){const D=R.x,P=(R.y-s)*f+o,N=D-a;R.x=P,R.y=N}VRt(r);const p=r.filter(L=>L.isGroup&&!L.parentId);if(p.length===0)return e==="RL"&&uJ(t,"x"),!0;const g=OTe(r),m=new Map;for(const L of r){if(L.isGroup)continue;const R=zRt(L,g);if(!R)continue;const D=m.get(R)??[];D.push(L),m.set(R,D)}let v=0;for(const L of p){const R=L.padding??0;R>v&&(v=R)}const y=[];let b=1/0,x=-1/0;for(const L of p){const R=m.get(L.id)??[],D=ETe(R);D&&(b=Math.min(b,D.minX),x=Math.max(x,D.maxX),y.push({lane:L,contentTop:D.minY,contentBottom:D.maxY,centerY:(D.minY+D.maxY)/2}))}if(b===1/0||x===-1/0)return!0;const w=Math.max(0,x-b),A=Math.max(v,10),S=w+2*A,T=o+S,E=(b+x)/2-S/2-o,_=E+T/2,I=Math.max(v,o);y.sort((L,R)=>L.centerY-R.centerY);for(let L=0;Lf.cy?y.bottom:y.top,I=f.cx+b;if(I<=y.left+bg||I>=y.right-bg)continue;x={x:I,y:_},w={x:I,y:o.y},A={x:o.x,y:o.y}}else{const _=p.cx>f.cx?y.right:y.left,I=f.cy+b;if(I<=y.top+bg||I>=y.bottom-bg)continue;x={x:_,y:I},w={x:o.x,y:I},A={x:o.x,y:o.y}}const S=fp(x,w,bg),T=fp(w,A,bg);if(S&&T||!S&&fo(x,w,n,[h],1)||!T&&fo(w,A,n,[d],1))continue;const O=!S&&aJ(x,w,t,i,{epsilon:bg,skipDegenerateOther:!0}),k=!T&&aJ(w,A,t,i,{epsilon:bg,skipDegenerateOther:!0});if(!(O||k)){S?v=[w,A]:T?v=[x,w]:v=[x,w,A];break}}v&&(i.points=v)}}C(HRt,"portSwapToLShape");function WRt(t,e){const{realNodeRects:a,labelNodeRects:s}=O2(e.values());for(const o of t){if(o.isLayoutOnly)continue;const l=o.points;if(!l||l.length<4)continue;const u=Li(l,.001);if(u.length<4)continue;const h=u.length-1,d=u[h],f=u[h-1],p=u[h-2],g=d.x-f.x,m=d.y-f.y,v=Math.hypot(g,m);if(v>=10||v<.001)continue;const y=f.x-p.x,b=f.y-p.y;if(Math.hypot(y,b)<.001)continue;const w=Hs(f,d,.001),A=Ws(f,d,.001),S=Hs(p,f,.001),T=Ws(p,f,.001);if(!(w&&T||A&&S))continue;const O=o.end,k=o.start,E=O?e.get(O):void 0;if(!E)continue;const _=E.x??0,I=E.y??0,L=Vh(E);if(!L)continue;let R,D;if(T){const z=b<0;R={x:_,y:p.y},D={x:_,y:z?L.bottom:L.top}}else{const z=y>0;R={x:p.x,y:I},D={x:z?L.right:L.left,y:I}}if(fo(R,D,a,O?[O]:[],-2)||fo(R,D,s,[],-2))continue;if(k){const z=e.get(k),U=z?Vh(z):void 0;if(U&&oTe(R,U,2))continue}const M=C((z,U)=>`${z.x.toFixed(3)},${z.y.toFixed(3)}|${U.x.toFixed(3)},${U.y.toFixed(3)}`,"ownSegmentKey"),P=new Set;for(let z=0;z{for(const Q of t){if(Q===o||Q.isLayoutOnly)continue;const G=Q.points;if(!(!G||G.length<2))for(let X=0;X=0){const z=u[h-3],U=[k,O].filter(Q=>!!Q);if(fo(z,R,a,U,-2)||N(z,R))continue}const B=[...u.slice(0,h-2),R,D];o.points=B;const V=o.labelNodeId;if(V){const z=e.get(V);if(z){const U=z.width??0,Q=z.height??0;if(U>0&&Q>0){let G,X,Y=-1;for(let le=0;le=U+2||ve&&ee>=Q+2)&&ee>Y&&(Y=ee,G=(q.x+Z.x)/2,X=(q.y+Z.y)/2)}G!==void 0&&X!==void 0&&(z.x=G,z.y=X)}}}}}C(WRt,"collapseShortTerminalStub");var Lr=.001,Il=8,Yn=c3,_Te=C((t,e)=>yi(t,e,Lr)||Ci(t,e,Lr),"orthogonallyAligned");function YRt(t,e){const i=C((p,g)=>{const m=p.x??0,v=p.y??0,y=g.x-m,b=g.y-v;let x=(p.width??0)/2,w=(p.height??0)/2;return Math.abs(b)*x>Math.abs(y)*w?(b<0&&(w=-w),{x:m+(b===0?0:w*y/b),y:v+w}):(y<0&&(x=-x),{x:m+x,y:v+(y===0?0:x*b/y)})},"rectIntersect"),a=C((p,g)=>{const m=Li(p.points??[]);if(m.length<2)return;const v=g?p.start:p.end,y=v?e.get(v):void 0,b=y?Vh(y):void 0;if(!y||!v||!b)return;const x=g?m[0]:m[m.length-1],w=g?m[1]:m[m.length-2],A=i(y,x);let S=x;if(_Te(w,A)&&(S=w),yi(A,S,Lr))return{edge:p,edgeId:String(p.id??""),nodeId:v,atStart:g,orientation:"V",coord:A.x,min:Math.min(A.y,S.y),max:Math.max(A.y,S.y),boundary:A,railEnd:S,rect:b};if(Ci(A,S,Lr))return{edge:p,edgeId:String(p.id??""),nodeId:v,atStart:g,orientation:"H",coord:A.y,min:Math.min(A.x,S.x),max:Math.max(A.x,S.x),boundary:A,railEnd:S,rect:b}},"terminalLaneFor"),s=C((p,g)=>Math.max(0,Math.min(p.max,g.max)-Math.max(p.min,g.min)),"projectedOverlapLength"),o=C((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:p.orientation==="H"?(Math.abs(p.boundary.x-p.rect.left)<1||Math.abs(p.boundary.x-p.rect.right)<1)&&yi(p.boundary,g.boundary,1):(Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1)&&Ci(p.boundary,g.boundary,1),"sameTerminalFace"),l=C((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:s(p,g)>=Il&&Math.abs(p.coord-g.coord)<.5,"exactTerminalLaneConflict"),u=C((p,g)=>{if(p.nodeId!==g.nodeId||p.orientation!==g.orientation||p.orientation!=="H"||p.atStart===g.atStart)return!1;const m=s(p,g);if(m2*v?!1:o(p,g)&&Math.abs(p.coord-g.coord)<16},"nearTerminalLaneConflict"),h=C((p,g)=>{const m=Li(p.edge.points??[]);if(m.length<2)return;const v=p.orientation==="V"?{x:p.boundary.x+g,y:p.boundary.y}:{x:p.boundary.x,y:p.boundary.y+g},y=p.orientation==="V"?{x:p.railEnd.x+g,y:p.railEnd.y}:{x:p.railEnd.x,y:p.railEnd.y+g};if(!C(()=>Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1?Ci(v,p.boundary,Lr)&&v.x>=p.rect.left+1&&v.x<=p.rect.right-1:Math.abs(p.boundary.x-p.rect.left)<1||Math.abs(p.boundary.x-p.rect.right)<1?yi(v,p.boundary,Lr)&&v.y>=p.rect.top+1&&v.y<=p.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(p.atStart){const S=m.length>1&&fp(m[1],p.railEnd,Lr),T=m.slice(S?2:1),O=T[0];return O&&!_Te(O,y)?void 0:[v,y,...T]}const x=m.length>1&&fp(m[m.length-2],p.railEnd,Lr),w=m.slice(0,x?-2:-1),A=w[w.length-1];if(!(A&&!_Te(A,y)))return[...w,y,v]},"shiftedCandidate"),d=C(p=>{const g=p.edge,m=Li(g.points??[]);if(m.length!==2)return!1;const v=g.start,y=g.end,b=v?e.get(v):void 0,x=y?e.get(y):void 0;if(!b||!x)return!1;const w=b.x??0,A=b.y??0,S=x.x??0,T=x.y??0,[O,k]=m;return Ci(O,k,Lr)&&Math.abs(A-T)<1&&Math.abs(w-S)>1||yi(O,k,Lr)&&Math.abs(w-S)<1&&Math.abs(A-T)>1},"laneIsStraightCollinearConnector"),f=[-7,7,-2*7,2*7,-3*7,3*7];for(let p=0;p<8;p++){const g=t.filter(v=>!v.isLayoutOnly).flatMap(v=>[a(v,!0),a(v,!1)]).filter(v=>!!v);let m=!1;for(let v=0;v{const O=d(S),k=d(T);return O!==k?Number(O)-Number(k):+!T.atStart-+!S.atStart});for(const S of A){for(const T of f){const O=h(S,T);if(!O)continue;const k=a({...S.edge,points:O},S.atStart);if(!(!k||g.some(E=>E.edge!==S.edge&&(l(k,E)||w&&u(k,E))))){S.edge.points=O,m=!0;break}}if(m)break}}if(!m)return}}C(YRt,"separateSharedRenderedTerminalLanes");function qRt(t,e){const{realNodeRects:n,labelNodeRects:i}=O2(e.values()),a=C((o,l)=>{const u=o.start,h=o.end,d=Yn(l);if(d.length!==l.length-1)return!1;const f=[u,h].filter(p=>!!p);for(const p of d)if(fo(p.a,p.b,n,f,-2)||fo(p.a,p.b,i,[],-2))return!1;for(const p of t){if(p===o||p.isLayoutOnly)continue;const g=p.points;if(!(!g||g.length<2)){for(const m of d)for(const v of Yn(Li(g)))if(E0(m,v,.5)>=Il||x1(m.a,m.b,v.a,v.b,Lr))return!1}}return!0},"candidateIsSafe"),s=C((o,l)=>{if(l+4>=o.length)return;const u=o[l],h=o[l+1],d=o[l+2],f=o[l+3],p=o[l+4],g=Hs(u,h)&&Ws(h,d)&&Hs(d,f)&&Ws(f,p)&&yi(u,f,Lr)&&yi(u,p,Lr)&&yi(h,d,Lr)&&(h.x-u.x)*(f.x-d.x)<0,m=Ws(u,h)&&Hs(h,d)&&Ws(d,f)&&Hs(f,p)&&Ci(u,f,Lr)&&Ci(u,p,Lr)&&Ci(h,d,Lr)&&(h.y-u.y)*(f.y-d.y)<0;if(g||m)return Li([...o.slice(0,l+1),p,...o.slice(l+5)]);if(l+5>=o.length)return;const v=o[l+5],y=Ws(u,h)&&Hs(h,d)&&Ws(d,f)&&Hs(f,p)&&Ws(p,v)&&yi(u,p,Lr)&&yi(u,v,Lr)&&yi(d,f,Lr)&&(d.x-h.x)*(p.x-f.x)<0,b=Hs(u,h)&&Ws(h,d)&&Hs(d,f)&&Ws(f,p)&&Hs(p,v)&&Ci(u,p,Lr)&&Ci(u,v,Lr)&&Ci(d,f,Lr)&&(d.y-h.y)*(p.y-f.y)<0;if(!(!y&&!b))return Li([...o.slice(0,l+1),v,...o.slice(l+6)])},"withoutDogleg");for(let o=0;o<8;o++){let l=!1;for(const u of t){if(u.isLayoutOnly)continue;const h=Li(u.points??[]);for(let d=0;d<=h.length-5;d++){const f=s(h,d);if(!(!f||!a(u,f))){u.points=f,l=!0;break}}if(l)break}if(!l)return}}C(qRt,"collapseRedundantRectangularDoglegs");function RTe(t,e){const{realNodeRects:a,labelNodeRects:s}=O2(e.values()),o=t.filter(g=>!g.isLayoutOnly),l=C((g,m,v)=>Li(g===m?v??[]:g.points??[]),"pointsFor"),u=C((g,m)=>{let v=0;for(let y=0;y{const m=Yn(g);if(m.length!==3)return;const v=m[1];if(!(m[0].horizontal===v.horizontal||m[2].horizontal===v.horizontal))return{index:v.index,horizontal:v.horizontal,vertical:v.vertical,segment:v}},"middleRail"),d=C((g,m)=>{const v=[g.start,g.end].filter(y=>!!y);return a.filter(y=>{if(v.includes(y.id))return!1;const b=y.rect;return m.horizontal?Vu(m.a.x,m.b.x,b.left,b.right)>=Il&&m.a.y>=b.top-2&&m.a.y<=b.bottom+2:Vu(m.a.y,m.b.y,b.top,b.bottom)>=Il&&m.a.x>=b.left-2&&m.a.x<=b.right+2})},"blockingRectsFor"),f=C((g,m,v)=>{const y=g.map(x=>({...x}));if(m.horizontal)y[m.index].y=v,y[m.index+1].y=v;else if(m.vertical)y[m.index].x=v,y[m.index+1].x=v;else return;const b=_0(Li(y));return Yn(b).length===b.length-1?b:void 0},"candidateByMovingRail"),p=C((g,m,v)=>{const y=[g.start,g.end].filter(x=>!!x),b=Yn(m);if(b.length!==m.length-1)return!1;for(const x of b)if(fo(x.a,x.b,a,y,-2)||fo(x.a,x.b,s,[],-2))return!1;for(const x of o)if(x!==g){for(const w of b)for(const A of Yn(l(x)))if(E0(w,A,.5)>=Il)return!1}return u(g,m)<=v},"candidateIsSafe");for(let g=0;g<8;g++){const m=u();let v=!1;for(const y of o){const b=l(y),x=h(b);if(!x)continue;const w=d(y,x.segment);if(w.length===0)continue;const A=x.horizontal?[Math.min(...w.map(S=>S.rect.top))-20,Math.max(...w.map(S=>S.rect.bottom))+20]:[Math.min(...w.map(S=>S.rect.left))-20,Math.max(...w.map(S=>S.rect.right))+20];for(const S of A){const T=f(b,x.segment,S);if(!(!T||!p(y,T,m))){y.points=T,v=!0;break}}if(v)break}if(!v)return}}C(RTe,"liftObstacleHuggingSameSideRails");function DTe(t,e){const n=C(l=>{const u=l.groupTitleRect;if(!(!u||typeof u.left!="number"||typeof u.right!="number"||typeof u.top!="number"||typeof u.bottom!="number"||!Number.isFinite(u.left)||!Number.isFinite(u.right)||!Number.isFinite(u.top)||!Number.isFinite(u.bottom)||u.right<=u.left||u.bottom<=u.top))return{left:u.left,right:u.right,top:u.top,bottom:u.bottom}},"validTitleRect"),i=C(l=>{if(!l.isGroup||l.parentId)return;const u=l.direction,h=typeof u=="string"?u.toUpperCase():"";if(h==="LR"||h==="RL"||h==="BT")return;const d=n(l),f=l.y,p=l.height;if(!d||typeof f!="number"||typeof p!="number"||!Number.isFinite(f)||!Number.isFinite(p)||p<=0)return;const g=d.right-d.left,m=d.bottom-d.top;if(!(m<=0||g{if(!l.horizontal)return!1;const h=l.a.y;return h<=u.top+Lr||h>=u.bottom-Lr?!1:Vu(l.a.x,l.b.x,u.left,u.right)>=Il},"horizontalSegmentIntersectsTitle"),s=[...e.values()].map(i).filter(l=>!!l);if(s.length===0)return;let o=0;for(const l of t){if(l.isLayoutOnly)continue;const u=Li(l.points??[]);for(const h of Yn(u))for(const d of s)a(h,d.rect)&&(o=Math.max(o,d.rect.bottom-h.a.y+4))}if(!(o<=Lr))for(const l of s){const u=l.node.y,h=l.node.height;typeof u!="number"||typeof h!="number"||!Number.isFinite(u)||!Number.isFinite(h)||h<=0||(l.node.y=u-o/2,l.node.height=h+o,l.node.groupTitleRect={...l.rect,top:l.rect.top-o,bottom:l.rect.bottom-o})}}C(DTe,"liftTopLaneTitleBandsAboveRails");function LTe(t,e){const n=C(u=>{const h=u.groupTitleRect;if(!(!h||typeof h.left!="number"||typeof h.right!="number"||typeof h.top!="number"||typeof h.bottom!="number"||!Number.isFinite(h.left)||!Number.isFinite(h.right)||!Number.isFinite(h.top)||!Number.isFinite(h.bottom)||h.right<=h.left||h.bottom<=h.top))return{left:h.left,right:h.right,top:h.top,bottom:h.bottom}},"validTitleRect"),i=C(u=>{if(!u.isGroup||u.parentId||u.direction!=="LR")return;const d=n(u),f=u.x,p=u.width;if(!d||typeof f!="number"||typeof p!="number"||!Number.isFinite(f)||!Number.isFinite(p)||p<=0)return;const g=d.right-d.left,m=d.bottom-d.top;if(!(g<=0||m{if(!u.vertical)return!1;const d=u.a.x;return d<=h.left+Lr||d>=h.right-Lr?!1:Vu(u.a.y,u.b.y,h.top,h.bottom)>=Il},"verticalSegmentIntersectsTitle"),s=C((u,h)=>{if(!u.horizontal)return!1;const d=u.a.y;return d<=h.top+Lr||d>=h.bottom-Lr?!1:Vu(u.a.x,u.b.x,h.left,h.right)>=Il},"horizontalSegmentIntersectsTitle"),o=[...e.values()].map(i).filter(u=>!!u);if(o.length===0)return;let l=0;for(const u of t){if(u.isLayoutOnly)continue;const h=Li(u.points??[]);for(const d of Yn(h))for(const f of o)if(a(d,f.rect))l=Math.max(l,f.rect.right-d.a.x+4);else if(s(d,f.rect)){const p=Math.min(d.a.x,d.b.x);l=Math.max(l,f.rect.right-p+4)}}if(!(l<=Lr))for(const u of o){const h=u.node.x,d=u.node.width;typeof h!="number"||typeof d!="number"||!Number.isFinite(h)||!Number.isFinite(d)||d<=0||(u.node.x=h-l/2,u.node.width=d+l,u.node.groupTitleRect={...u.rect,left:u.rect.left-l,right:u.rect.right-l})}}C(LTe,"shiftLeftLaneTitleBandsLeftOfRails");function jRt(t,e){const{realNodeRects:n}=O2(e.values()),i=t.filter(g=>!g.isLayoutOnly),a=C((g,m=new Map)=>Li(m.get(g)??g.points??[]),"replacementPointsFor"),s=C((g=new Map)=>{let m=0;for(let v=0;vi.reduce((m,v)=>m+Jd(a(v,g)),0),"totalBends"),l=C(g=>{const m=a(g);if(m.length<4)return;const v=m[m.length-2],y=m[m.length-1];if(!(!Hs(v,y,Lr)&&!Ws(v,y,Lr)))return{tailStart:v,terminal:y}},"terminalTailFor"),u=C((g,m)=>{const v=a(g);if(v.length<3)return;const y=v[0],b=v[1];let x;if(Hs(y,b,Lr))x={x:b.x,y:m.tailStart.y};else if(Ws(y,b,Lr))x={x:m.tailStart.x,y:b.y};else return;const w=_0(Li([y,b,x,m.tailStart,m.terminal]));return Yn(w).length===w.length-1?w:void 0},"candidateWithDestinationTail"),h=C((g,m)=>{const v=[g.start,g.end].filter(y=>!!y);for(const y of Yn(m))if(fo(y.a,y.b,n,v,-2))return!0;return!1},"pathHasNodeHit"),d=C((g,m,v)=>{for(const y of i)if(y!==g){for(const b of Yn(m))for(const x of Yn(a(y,v)))if(E0(b,x,.5)>=Il)return!0}return!1},"pathHasSharedTrack"),f=C((g,m,v)=>!h(g,m)&&!d(g,m,v),"candidateIsSafe"),p=C(()=>{const g=new Map;for(const m of i){const v=m.end;if(!v||!e.has(v)||a(m).length<4)continue;const b=g.get(v)??[];b.push(m),g.set(v,b)}return g},"edgesByDestination");for(let g=0;g<4;g++){const m=s();if(m===0)return;const v=o();let y,b=m,x=v;for(const w of p().values())for(let A=0;A=m||R>b||R===b&&D>=x||(y=L,b=R,x=D)}if(!y)return;for(const[w,A]of y)w.points=A}}C(jRt,"swapDestinationTerminalTailsToReduceCrossings");function XRt(t,e){const{realNodeRects:a,labelNodeRects:s}=O2(e.values()),o=t.filter(w=>!w.isLayoutOnly),l=C((w,A=new Map)=>Li(A.get(w)??w.points??[]),"replacementPointsFor"),u=C((w=new Map)=>{let A=0;for(let S=0;So.reduce((A,S)=>A+Jd(l(S,w)),0),"totalBends"),d=C(w=>{const A=w.start,S=w.end,T=A?e.get(A):void 0,O=S?e.get(S):void 0,k=T?Vh(T):void 0,E=O?Vh(O):void 0;return k&&E?{src:k,dst:E}:void 0},"endpointRectsFor"),f=C((w,A,S)=>{if(S.index<=0||S.index+1>=A.length-1)return;const T=d(w);if(T){if(S.vertical){const O=S.a.x,k=Math.min(T.src.left,T.dst.left),E=Math.max(T.src.right,T.dst.right),_=OE+Lr?"right":void 0;return _?{edge:w,points:A,segmentIndex:S.index,axis:"vertical",side:_,coord:O,min:Math.min(S.a.y,S.b.y),max:Math.max(S.a.y,S.b.y)}:void 0}if(S.horizontal){const O=S.a.y,k=Math.min(T.src.top,T.dst.top),E=Math.max(T.src.bottom,T.dst.bottom),_=OE+Lr?"bottom":void 0;return _?{edge:w,points:A,segmentIndex:S.index,axis:"horizontal",side:_,coord:O,min:Math.min(S.a.x,S.b.x),max:Math.max(S.a.x,S.b.x)}:void 0}}},"externalRailForSegment"),p=C(()=>{const w=[];for(const A of o){const S=l(A);for(const T of Yn(S)){const O=f(A,S,T);O&&w.push(O)}}return w},"collectExternalRails"),g=C((w,A)=>w.edge!==A.edge&&w.axis===A.axis&&w.side===A.side&&Vu(w.min,w.max,A.min,A.max)>=Il,"railsInteract"),m=C(w=>{const A=[],S=new Set;for(const T of w){if(S.has(T))continue;const O=[T],k=[];for(S.add(T);O.length>0;){const E=O.pop();k.push(E);for(const _ of w)!S.has(_)&&g(E,_)&&(S.add(_),O.push(_))}k.length>1&&A.push(k)}return A},"connectedComponents"),v=C(w=>{const A=[];for(const S of w)A.some(T=>Math.abs(T-S.coord){const A=w.map(O=>O.coord),S=v(w),T=[];if(w.length<=6){const O=new Array(S.length).fill(!1),k=[],E=C(()=>{if(k.length===w.length){k.some((_,I)=>Math.abs(_-A[I])>=Lr)&&T.push([...k]);return}for(const[_,I]of S.entries())O[_]||(O[_]=!0,k.push(I),E(),k.pop(),O[_]=!1)},"visit");return E(),T}for(let O=0;O{const S=new Map;for(const[O,k]of w.entries()){const E=A[O],_=S.get(k.edge)??k.points.map(I=>({x:I.x,y:I.y}));k.axis==="vertical"?(_[k.segmentIndex].x=E,_[k.segmentIndex+1].x=E):(_[k.segmentIndex].y=E,_[k.segmentIndex+1].y=E),S.set(k.edge,_)}const T=new Map;for(const[O,k]of S){const E=_0(Li(k));if(Yn(E).length!==E.length-1)return;T.set(O,E)}return T},"replacementsForAssignment"),x=C(w=>{for(const[A,S]of w){const T=[A.start,A.end].filter(O=>!!O);for(const O of Yn(S))if(fo(O.a,O.b,a,T,-2)||fo(O.a,O.b,s,[],-2))return!1}for(let A=0;A=Il)return!1}}return!0},"candidateIsSafe");for(let w=0;w<4;w++){const A=u();if(A===0)return;let S,T=A,O=h(),k=Number.POSITIVE_INFINITY;for(const E of m(p()))for(const _ of y(E)){const I=b(E,_);if(!I||!x(I))continue;const L=u(I);if(L>=A)continue;const R=h(I),D=E.reduce((M,P,N)=>M+Math.abs(_[N]-P.coord),0);L>T||L===T&&(R>O||R===O&&D>=k)||(S=I,T=L,O=R,k=D)}if(!S)return;for(const[E,_]of S)E.points=_}}C(XRt,"reassignCrossingExternalRailChannels");function KRt(t,e){const{realNodeRects:n,labelNodeRects:i}=O2(e.values()),a=t.filter(p=>!p.isLayoutOnly),s=C((p,g,m)=>Li(p===g?m??[]:p.points??[]),"pointsFor"),o=C(p=>Yn(p).reduce((g,m)=>{const v=m.a.x-m.b.x,y=m.a.y-m.b.y;return g+Math.hypot(v,y)},0),"pathLength"),l=C((p,g)=>{let m=0;for(let v=0;v{if(p.horizontal){const m=p.a.y;return(Math.abs(m-g.top)<1||Math.abs(m-g.bottom)<1)&&Vu(p.a.x,p.b.x,g.left,g.right)>=Il}if(p.vertical){const m=p.a.x;return(Math.abs(m-g.left)<1||Math.abs(m-g.right)<1)&&Vu(p.a.y,p.b.y,g.top,g.bottom)>=Il}return!1},"segmentRunsAlongRectBorder"),h=C(p=>{const g=[p.start,p.end].filter(v=>!!v),m=[];for(const v of g){const y=e.get(v),b=y?Vh(y):void 0;b&&m.push(b)}return m},"endpointRectsFor"),d=C((p,g)=>{if(g+3>=p.length)return[];const m=p[g],v=p[g+1],y=p[g+2],b=p[g+3],x=Hs(m,v,Lr)&&Ws(v,y,Lr)&&Hs(y,b,Lr),w=Ws(m,v,Lr)&&Hs(v,y,Lr)&&Ws(y,b,Lr);if(!x&&!w)return[];if(!(x?Math.sign(v.x-m.x)!==Math.sign(b.x-y.x):Math.sign(v.y-m.y)!==Math.sign(b.y-y.y)))return[];const S=yi(m,b,Lr)||Ci(m,b,Lr)?[]:[{x:m.x,y:b.y},{x:b.x,y:m.y}],T=S.length===0?[[...p.slice(0,g+1),...p.slice(g+3)]]:S.map(k=>[...p.slice(0,g+1),k,...p.slice(g+3)]),O=new Set;return T.map(k=>_0(Li(k))).filter(k=>{if(Yn(k).length!==k.length-1||!k.some(_=>fp(_,b,Lr)))return!1;const E=k.map(_=>`${_.x.toFixed(3)},${_.y.toFixed(3)}`).join("|");return O.has(E)?!1:(O.add(E),!0)})},"shortcutCandidatesAt"),f=C((p,g,m)=>{const v=[p.start,p.end].filter(b=>!!b),y=h(p);for(const b of Yn(g))if(fo(b.a,b.b,n,v,-2)||fo(b.a,b.b,i,[],-2)||y.some(x=>u(b,x)))return!1;for(const b of a)if(b!==p){for(const x of Yn(g))for(const w of Yn(s(b)))if(E0(x,w,.5)>=Il)return!1}return l(p,g)<=m},"candidateIsSafe");for(let p=0;p<8;p++){const g=l();let m,v,y=g,b=Number.POSITIVE_INFINITY,x=Number.POSITIVE_INFINITY;for(const w of a){const A=s(w),S=Jd(A,Lr),T=o(A);for(let O=0;O<=A.length-4;O++)for(const k of d(A,O)){const E=Jd(k,Lr),_=o(k);if(!(Ey||L===y&&(E>b||E===b&&_>=x)||(m=w,v=k,y=L,b=E,x=_)}}if(!m||!v)return;m.points=v}}C(KRt,"shortcutRedundantOrthogonalJogs");function ZRt(t,e){const s=[];for(const he of e.values()){if(he.isGroup||he.isEdgeLabel)continue;const fe=he.x??0,Se=he.y??0,ge=Vh(he);ge&&s.push({id:String(he.id??""),cx:fe,cy:Se,rect:ge})}if(s.length===0)return;const o=new Map(s.map(he=>[he.id,he])),l=s.map(he=>({id:he.id,rect:he.rect})),u=["top","bottom","left","right"],h={top:Math.min(...s.map(he=>he.rect.top))-20,bottom:Math.max(...s.map(he=>he.rect.bottom))+20,left:Math.min(...s.map(he=>he.rect.left))-20,right:Math.max(...s.map(he=>he.rect.right))+20},d=t.filter(he=>!he.isLayoutOnly),f=new Map(d.map((he,fe)=>[he,fe])),p=C(he=>{const fe=he==="left"||he==="top"?-1:1,Se=[];for(let ge=0;ge<=2;ge++)Se.push(h[he]+fe*20*ge);return Se},"outwardTracksForSide"),g=C((he,fe=new Map)=>Li(fe.get(he)??he.points??[]),"replacementPointsFor"),m=C((he,fe)=>{let Se=0;for(const ge of he)for(const Qe of fe)x1(ge.a,ge.b,Qe.a,Qe.b,Lr)&&Se++;return Se},"crossingCountBetweenSegments"),v=C((he,fe)=>m(Yn(he),Yn(fe)),"crossingCountBetweenPaths"),y=C((he=new Map)=>{let fe=0;const Se=[],ge=new Set,Qe=[],Te=C(De=>{ge.has(De)||(ge.add(De),Qe.push(De))},"addEdge");for(let De=0;De0&&(fe+=ne,Se.push({first:qe,second:be,count:ne}),Te(qe),Te(be))}}return Qe.sort((De,qe)=>(f.get(De)??0)-(f.get(qe)??0)),{count:fe,pairs:Se,edgeSet:ge,edges:Qe}},"crossingSnapshot"),b=C((he,fe)=>{const Se=new Set(fe.keys());if(Se.size===0)return he.count;let ge=0;for(const Te of he.pairs)(Se.has(Te.first)||Se.has(Te.second))&&(ge+=Te.count);let Qe=0;for(let Te=0;Te{const fe=new Map;for(const Qe of he.pairs){const Te=fe.get(Qe.first)??new Set;Te.add(Qe.second),fe.set(Qe.first,Te);const De=fe.get(Qe.second)??new Set;De.add(Qe.first),fe.set(Qe.second,De)}const Se=[],ge=new Set;for(const Qe of he.edges){if(ge.has(Qe))continue;const Te=[Qe],De=[];for(ge.add(Qe);Te.length>0;){const qe=Te.pop();De.push(qe);for(const K of fe.get(qe)??[])ge.has(K)||(ge.add(K),Te.push(K))}De.sort((qe,K)=>(f.get(qe)??0)-(f.get(K)??0)),De.length>1&&Se.push(De)}return Se},"crossingComponents"),w=C(he=>[he.start,he.end].filter(fe=>!!fe),"endpointIdsFor"),A=C(he=>{const fe=[];for(const Se of x(he)){const ge=new Set(Se),Qe=new Set(Se.flatMap(De=>w(De))),Te=[...Se];for(const De of d)ge.has(De)||w(De).some(qe=>Qe.has(qe))&&Te.push(De);Te.sort((De,qe)=>(f.get(De)??0)-(f.get(qe)??0)),fe.push(Te)}return fe},"pairSearchGroups"),S=C((he,fe,Se)=>b(he,new Map([[fe,Se]])),"crossingCountWithSingleReplacement"),T=C(he=>{const fe=new Map;for(const Se of he.pairs)fe.set(Se.first,(fe.get(Se.first)??0)+Se.count),fe.set(Se.second,(fe.get(Se.second)??0)+Se.count);return fe},"currentCrossingsByEdge"),O=C(he=>he.slice(1).reduce((fe,Se,ge)=>{const Qe=he[ge];return fe+Math.abs(Se.x-Qe.x)+Math.abs(Se.y-Qe.y)},0),"pathLength"),k=C((he=new Map)=>d.reduce((fe,Se)=>fe+Jd(g(Se,he)),0),"totalBends"),E=C((he=new Map)=>d.reduce((fe,Se)=>fe+O(g(Se,he)),0),"totalLength"),_=C((he,fe,Se=new Map)=>{const ge=Yn(fe);for(const Qe of d)if(Qe!==he){for(const Te of ge)for(const De of Yn(g(Qe,Se)))if(E0(Te,De,.5)>=Il)return!0}return!1},"pathHasSegmentConflict"),I=C((he,fe)=>{const Se=[he.start,he.end].filter(ge=>!!ge);for(const ge of Yn(fe))if(fo(ge.a,ge.b,l,Se,-2))return!0;return!1},"pathHitsNode"),L=C((he,fe)=>{const Se=_0(Li(fe));Yn(Se).length===Se.length-1&&he.push(Se)},"pushOrthogonalCandidate"),R=C(he=>he==="left"||he==="right","sideIsHorizontal"),D=C((he,fe,Se)=>{switch(fe){case"left":return Math.min(he.x,Se.x)-20;case"right":return Math.max(he.x,Se.x)+20;case"top":return Math.min(he.y,Se.y)-20;case"bottom":return Math.max(he.y,Se.y)+20}},"localTrackForSameSide"),M=C((he,fe,Se,ge)=>{const Qe=Se==="left"||Se==="top"?-1:1,Te=[D(fe,Se,ge),h[Se]];for(const De of Te)for(let qe=0;qe<=2;qe++)L(he,uTe(fe,Se,ge,De+Qe*20*qe))},"addSameSideCandidates"),P=C((he,fe,Se,ge,Qe)=>{for(const Te of p(Se))for(const De of p(Qe))L(he,[fe,{x:Te,y:fe.y},{x:Te,y:De},{x:ge.x,y:De},ge])},"addHorizontalToVerticalCandidates"),N=C((he,fe,Se,ge,Qe)=>{for(const Te of p(Se))for(const De of p(Qe))L(he,[fe,{x:fe.x,y:Te},{x:De,y:Te},{x:De,y:ge.y},ge])},"addVerticalToHorizontalCandidates"),F=C((he,fe,Se,ge,Qe)=>{const Te=[...p("top"),...p("bottom")];for(const De of p(Se))for(const qe of p(Qe))for(const K of Te)L(he,[fe,{x:De,y:fe.y},{x:De,y:K},{x:qe,y:K},{x:qe,y:ge.y},ge])},"addHorizontalPairCandidates"),B=C((he,fe,Se,ge,Qe)=>{const Te=[...p("left"),...p("right")];for(const De of p(Se))for(const qe of p(Qe))for(const K of Te)L(he,[fe,{x:fe.x,y:De},{x:K,y:De},{x:K,y:qe},{x:ge.x,y:qe},ge])},"addVerticalPairCandidates"),V=C(he=>{const fe=new Set;return he.map(Se=>Li(Se)).filter(Se=>{const ge=Se.map(Qe=>`${Qe.x.toFixed(3)},${Qe.y.toFixed(3)}`).join("|");return fe.has(ge)||Se.length<2?!1:(fe.add(ge),!0)})},"dedupeCandidatePaths"),z=C((he,fe,Se,ge)=>{const Qe=[],Te=cTe(he,fe,Se,ge,20,Lr);Te&&L(Qe,Te),fe===ge&&M(Qe,he,fe,Se);const De=R(fe),qe=R(ge);return De&&!qe?P(Qe,he,fe,Se,ge):!De&&qe?N(Qe,he,fe,Se,ge):De?F(Qe,he,fe,Se,ge):B(Qe,he,fe,Se,ge),V(Qe)},"buildCandidatesForSides"),U=C((he,fe,Se,ge)=>{const Qe=[...p("left"),...p("right")],Te=[...p("top"),...p("bottom")];for(const De of u){const qe=vC(ge,De),K=De==="top"||De==="bottom"?p(De):Te;for(const ce of Qe){L(he,[fe,Se,{x:ce,y:Se.y},{x:ce,y:qe.y},qe]);for(const be of K)L(he,[fe,Se,{x:ce,y:Se.y},{x:ce,y:be},{x:qe.x,y:be},qe])}}},"addVerticalDepartureOuterTrackCandidates"),Q=C((he,fe,Se,ge)=>{const Qe=[...p("left"),...p("right")],Te=[...p("top"),...p("bottom")];for(const De of u){const qe=vC(ge,De),K=De==="left"||De==="right"?p(De):Qe;for(const ce of Te){L(he,[fe,Se,{x:Se.x,y:ce},{x:qe.x,y:ce},qe]);for(const be of K)L(he,[fe,Se,{x:Se.x,y:ce},{x:be,y:ce},{x:be,y:qe.y},qe])}}},"addHorizontalDepartureOuterTrackCandidates"),G=C(he=>{const fe=he.start,Se=he.end,ge=Se?o.get(Se):void 0;if(!fe||!ge)return[];const Qe=Li(he.points??[]);if(Qe.length<4)return[];const Te=Qe[0],De=Qe[1],qe=[];return Ws(Te,De,Lr)?U(qe,Te,De,ge):Hs(Te,De,Lr)&&Q(qe,Te,De,ge),qe},"terminalPreservingOuterTrackCandidates"),X=C(he=>{const fe=he.start,Se=he.end,ge=fe?o.get(fe):void 0,Qe=Se?o.get(Se):void 0;if(!ge||!Qe)return[];const Te=[];for(const De of u){const qe=vC(ge,De);for(const K of u)Te.push(...z(qe,De,vC(Qe,K),K))}return Te.push(...G(he)),Te},"candidatePathsFor"),Y=C(()=>new Map(d.map(he=>[he,Yn(g(he))])),"currentSegmentsByEdge"),le=C((he,fe,Se)=>{const ge=new Set;for(const Qe of d){if(Qe===he)continue;const Te=Se.get(Qe)??Yn(g(Qe));fe.some(De=>Te.some(qe=>E0(De,qe,.5)>=Il))&&ge.add(Qe)}return ge},"sharedTrackConflictsFor"),q=C((he,fe,Se,ge)=>{const Qe=new Set;return X(he).map(De=>_0(Li(De))).filter(De=>{if(I(he,De))return!1;const qe=De.map(K=>`${K.x.toFixed(3)},${K.y.toFixed(3)}`).join("|");return Qe.has(qe)||De.length<2?!1:(Qe.add(qe),!0)}).map(De=>{const qe=Yn(De);let K=0;for(const ce of d)ce!==he&&(K+=m(qe,Se.get(ce)??Yn(g(ce))));return{candidate:De,candidateSegments:qe,crossings:fe.count-(ge.get(he)??0)+K,bends:Jd(De,Lr),totalBends:Jd(De),length:O(De)}}).filter(({crossings:De})=>De<=fe.count).sort((De,qe)=>De.crossings-qe.crossings||De.bends-qe.bends||De.length-qe.length).slice(0,48).map(De=>({path:De.candidate,segments:De.candidateSegments,sharedTrackConflicts:le(he,De.candidateSegments,Se),totalBends:De.totalBends,length:De.length}))},"pairCandidatesFor"),Z=C((he,fe,Se,ge,Qe,Te)=>{let De=0;for(const K of he.pairs)(K.first===fe||K.second===fe||K.first===ge||K.second===ge)&&(De+=K.count);let qe=m(Se.segments,Qe.segments);for(const K of d){if(K===fe||K===ge)continue;const ce=Te.get(K)??Yn(g(K));qe+=m(Se.segments,ce)+m(Qe.segments,ce)}return he.count-De+qe},"pairCrossingCount"),ee=C((he,fe)=>{for(const Se of he.sharedTrackConflicts)if(Se!==fe)return!1;return!0},"conflictsOnlyWith"),re=C((he,fe)=>he.segments.some(Se=>fe.segments.some(ge=>E0(Se,ge,.5)>=Il)),"candidatesShareTrack"),ve=C((he,fe,Se,ge)=>ee(fe,Se.edge)&&ee(ge,he.edge)&&!re(fe,ge),"pairCandidatesAreCompatible"),ae=C((he,fe,Se,ge,Qe)=>{const Te=Z(he.current,fe.edge,Se,ge.edge,Qe,he.baseSegments);if(!(Te>=he.current.count))return{replacements:new Map([[fe.edge,Se.path],[ge.edge,Qe.path]]),crossings:Te,bends:he.currentBends-(he.baseBendsByEdge.get(fe.edge)??0)-(he.baseBendsByEdge.get(ge.edge)??0)+Se.totalBends+Qe.totalBends,length:he.currentLength-(he.baseLengthByEdge.get(fe.edge)??0)-(he.baseLengthByEdge.get(ge.edge)??0)+Se.length+Qe.length}},"scorePairReplacement"),Ce=C((he,fe)=>he.crossings{let Qe=ge;for(const Te of fe.candidates)for(const De of Se.candidates){if(!ve(fe,Te,Se,De))continue;const qe=ae(he,fe,Te,Se,De);qe&&Ce(qe,Qe)&&(Qe=qe)}return Qe},"bestScoreForOptionPair"),$e=C(he=>{const fe=k(),Se=E(),ge=Y(),Qe=T(he),Te=new Map(d.map(ne=>[ne,Jd(g(ne))])),De=new Map(d.map(ne=>[ne,O(g(ne))])),qe=new Map,K=A(he);for(const ne of K)for(const j of ne){if(qe.has(j))continue;const ie=q(j,he,ge,Qe);ie.length>0&&qe.set(j,{edge:j,candidates:ie})}let ce={replacements:new Map,crossings:he.count,bends:fe,length:Se};const be={current:he,currentBends:fe,currentLength:Se,baseBendsByEdge:Te,baseLengthByEdge:De,baseSegments:ge};for(const ne of K){const j=new Set(ne.filter(pe=>he.edgeSet.has(pe))),ie=ne.map(pe=>qe.get(pe)).filter(pe=>!!pe);for(let pe=0;pe0?ce.replacements:void 0},"bestPairedReplacement");for(let he=0;he<4;he++){const fe=y(),Se=fe.count;if(Se===0)return;let ge,Qe,Te=Se,De=Number.POSITIVE_INFINITY;for(const K of fe.edges){const ce=Jd(g(K),Lr);for(const be of X(K)){const ne=I(K,be),j=!ne&&_(K,be),ie=S(fe,K,be),pe=Jd(be,Lr);ne||j||!(ieTe||ie===Te&&pe>=De||(ge=K,Qe=be,Te=ie,De=pe)}}if(ge&&Qe){ge.points=Qe;continue}const qe=$e(fe);if(!qe)return;for(const[K,ce]of qe)K.points=ce}}C(ZRt,"resolveRenderedOrthogonalCrossings");var k2=.001,Tkn=8;function JRt(t,e){const{nodeInfoById:r,realNodeRects:n}=iJ(e),i=["top","bottom","left","right"],a=20,s={top:Math.min(...n.map(m=>m.rect.top))-a,bottom:Math.max(...n.map(m=>m.rect.bottom))+a,left:Math.min(...n.map(m=>m.rect.left))-a,right:Math.max(...n.map(m=>m.rect.right))+a},o=C((m,v,y,b)=>{const x=[],w=cTe(m,v,y,b,a,k2);return w&&x.push(w),v===b&&x.push(uTe(m,v,y,s[v])),x},"buildOrthogonalPathCandidates"),l=C((m,v)=>{for(let y=0;y{let b=0;const x=c3(m,k2),w=v.start,A=v.end;for(const S of t){if(S===v||S.isLayoutOnly)continue;const T=S.start,O=S.end;if(!y&&w&&A&&(T===w||T===A||O===w||O===A))continue;const k=S.points;if(!(!k||k.length<2))for(const E of x)for(const _ of c3(k,k2)){if(dTe(E.a,E.b,_.a,_.b,k2,k2)){b++;continue}E0(E,_,k2)>=Tkn&&b++}}return b},"pathConflictCount"),h=4,d=C((m,v)=>{const y=Math.abs(m.y-v.rect.top),b=Math.abs(m.y-v.rect.bottom),x=Math.abs(m.x-v.rect.left),w=Math.abs(m.x-v.rect.right);let A="top",S=y;return b{const b=f.get(m)??[];b.push({side:v,edgeId:y}),f.set(m,b)},"addFaceClaim");for(const m of t){if(m.isLayoutOnly)continue;const v=m.points??[];if(v.length<1)continue;const y=m.id??"",b=m.start,x=m.end;if(b){const w=r.get(b);w&&p(b,d(v[0],w),y)}if(x){const w=r.get(x);w&&p(x,d(v[v.length-1],w),y)}}const g=C((m,v,y)=>{var b;return((b=f.get(m))==null?void 0:b.some(x=>x.edgeId!==y&&x.side===v))??!1},"faceIsClaimed");for(const m of t){if(m.isLayoutOnly)continue;const v=m.points;if(!v||v.length<2)continue;const y=Jd(v,k2);if(y0){const N=u(M,m,!0);if(N>E||N===E&&P>=_)continue;E=N,_=P,k=M;continue}u(M,m)>O||P<_&&(_=P,k=M)}}}if(k){m.points=k;const I=f.get(b);I&&f.set(b,I.filter(R=>R.edgeId!==S));const L=f.get(x);L&&f.set(x,L.filter(R=>R.edgeId!==S)),p(b,d(k[0],w),S),p(x,d(k[k.length-1],A),S)}}}C(JRt,"simplifyDetouredEdges");var Qh=.001,eDt=10,dJ=7;function MTe(t,e){const r=e?0:t.length-1,n=e?1:-1,i=t[r],a=t[r+n];if(!i||!a)return;const s=a.x-i.x,o=a.y-i.y;if(!(Math.abs(s)+Math.abs(o)a&&nJ(t,tDt(a)))}C(ITe,"labelOverlapsOwnMarker");function fJ(t,e){const r=[];for(const g of t){if(g.isLayoutOnly)continue;const m=g.points;if(!(!m||m.length<2))for(let v=0;v{const v=lTe(m,a);for(const{nodeId:y,rect:b}of n)if(y!==g&&nJ(v,b))return!0;return!1},"labelOverlapsForeignNode"),u=C((g,m)=>{const v=lTe(m,a);for(const y of r)if(y.edgeId!==g&&rJ(y.p1,y.p2,v))return!0;return!1},"labelOverlapsForeignEdge"),h=C((g,m,v)=>l(g,v)||u(m,v),"labelOverlapsAnything"),d=[],f=C(g=>{for(const{id:m,rect:v}of i)if(kRt(v,g))return m},"findContainingLane"),p=C((g,m)=>d.some(v=>v.labelId!==g&&nJ(m,v.rect)),"overlapsPlacedLabel");for(const g of t){if(g.isLayoutOnly)continue;const m=g.labelNodeId;if(!m)continue;const v=e.get(m);if(!v)continue;const y=g.points;if(!y||y.length<2)continue;const b=v.width??0,x=v.height??0;if(b<=0||x<=0)continue;const w=[];for(let V=0;V=Qh&&G>=Qh||w.push({idx:V,length:Q+G,orientation:Q>=Qh?"horizontal":"vertical",midX:(z.x+U.x)/2,midY:(z.y+U.y)/2})}if(w.length===0)continue;const A=w.length>=3?w.filter(V=>V.idx>0&&V.idx0?A:w,T=b>=x?"horizontal":"vertical",O=C(V=>[...V].sort((z,U)=>{const Q=z.orientation===T,G=U.orientation===T;if(Q!==G)return Q?-1:1;const X=z.length>=(z.orientation==="horizontal"?b:x)+2,Y=U.length>=(U.orientation==="horizontal"?b:x)+2;return X!==Y?X?-1:1:U.length-z.length}),"rankSegments"),k=w[0],E=w[w.length-1],_=[.5,.25,.75,.05,.95,.15,.85,.1,.9],I=C((V,z)=>{const U=y[V.idx],Q=y[V.idx+1];return{midX:U.x+(Q.x-U.x)*z,midY:U.y+(Q.y-U.y)*z}},"anchorAtT"),L=C((V,z,U)=>Math.min(U,Math.max(z,V)),"clamp"),R=C((V,z)=>V.midX>=z.left-Qh&&V.midX<=z.right+Qh&&V.midY>=z.top-Qh&&V.midY<=z.bottom+Qh,"pointInsideRectInclusive"),D=C(V=>{const z=u3(V.midX,V.midY,b,x),U=f(z);if(U)return{laneId:U,anchor:V,rect:z};const Q=i.find(({rect:ee})=>R(V,ee));if(!Q)return;const G=Q.rect.left+b/2+s,X=Q.rect.right-b/2-s,Y=Q.rect.top+x/2+s,le=Q.rect.bottom-x/2-s;if(G>X||Y>le)return;const q={midX:L(V.midX,G,X),midY:L(V.midY,Y,le)},Z=u3(q.midX,q.midY,b,x);return R(V,Z)?{laneId:Q.id,anchor:q,rect:Z}:void 0},"placementForAnchor"),M=C((V,z,U)=>V.orientation==="horizontal"?Math.abs(z.midX-U.x):Math.abs(z.midY-U.y),"distanceAlongSegment"),P=C((V,z)=>{const Q=(V.orientation==="horizontal"?b/2:x/2)+o;if(V===k){const G=y[V.idx];if(M(V,z,G)+Qh{const z=O(V);for(const U of z)for(const Q of _){const G=I(U,Q);if(!P(U,G))continue;const X=D(G);if(X&&!ITe(X.rect,y)&&!p(m,X.rect)&&!h(m,g.id,X.rect))return{laneId:X.laneId,anchor:X.anchor}}},"tryPool"),F=C((V,z,U=!1)=>{const Q=O(V);for(const G of Q){const X={midX:G.midX,midY:G.midY};if(z&&!P(G,X))continue;const Y=D(X);if(Y&&!ITe(Y.rect,y)&&!p(m,Y.rect)&&!l(m,Y.rect)&&(U||!u(g.id,Y.rect)))return{laneId:Y.laneId,anchor:Y.anchor}}},"findLaneContainingFallback"),B=N(S)??(S.lengthU.labelId===m);z>=0?d[z]={labelId:m,rect:V}:d.push({labelId:m,rect:V})}}}C(fJ,"anchorLabelsToPolyline");var PTe=1e-6,Ckn=8,rDt=Ckn/2,Okn=3;function NTe(t,e){return t{const h=NTe(o,l);let d=0;const f=C(p=>{if(!p)return;const g=i.get(p);if(!g)return;const m=u==="x"?g.w/2:g.h/2;m>d&&(d=m)},"consider");f(s.labelNodeId);for(const p of t){if(p===s||p.isLayoutOnly)continue;const g=p.start,m=p.end;!g||!m||NTe(g,m)===h&&f(p.labelNodeId)}return d>0?d+Okn:0},"labelClearanceFor");for(const s of t){if(s.isLayoutOnly)continue;const o=s.points;if(!sTe(o,PTe))continue;const l=hTe(s,r,PTe);if(!l)continue;const{srcId:u,dstId:h,srcInfo:d,dstInfo:f,collinearX:p,collinearY:g}=l;if(p===g)continue;let m,v;if(p){const A=f.cy>d.cy;m={x:d.cx,y:A?d.rect.bottom:d.rect.top},v={x:f.cx,y:A?f.rect.top:f.rect.bottom}}else{const A=f.cx>d.cx;m={x:A?d.rect.right:d.rect.left,y:d.cy},v={x:A?f.rect.left:f.rect.right,y:f.cy}}if(fo(m,v,n,[u,h],1))continue;const b=a(s,u,h,p?"x":"y"),x=b>rDt?b:rDt,w=[0,x,-x];for(const A of w){const S={...m},T={...v};if(p){if(S.x+=A,T.x+=A,S.x<=d.rect.left||S.x>=d.rect.right||T.x<=f.rect.left||T.x>=f.rect.right)continue}else if(S.y+=A,T.y+=A,S.y<=d.rect.top||S.y>=d.rect.bottom||T.y<=f.rect.top||T.y>=f.rect.bottom)continue;if(!fo(S,T,n,[u,h],1)&&!aJ(S,T,t,s,{epsilon:PTe})){s.points=[S,T];break}}}}C(nDt,"straightenCollinearSiblingDetours");function BTe(t,e){const{realNodeRects:l,labelNodeRects:u}=O2(e.values()),h=C((A,S)=>c3(S,.001).map(T=>({...T,edge:A,interior:T.index>=1&&T.index<=S.length-3})),"segmentsFor"),d=C(()=>{const A=[];for(const S of t){if(S.isLayoutOnly)continue;const T=S.points;!T||T.length<2||A.push(...h(S,Li(T)))}return A},"allSegments"),f=C((A,S)=>A.horizontal&&S.horizontal?Vu(A.a.x,A.b.x,S.a.x,S.b.x)>=8&&Math.abs(A.a.y-S.a.y)<7:A.vertical&&S.vertical?Vu(A.a.y,A.b.y,S.a.y,S.b.y)>=8&&Math.abs(A.a.x-S.a.x)<7:!1,"hasCrowdedParallelTrack"),p=C((A,S)=>{const T=A.start,O=A.end,k=h(A,S);if(k.length!==S.length-1)return!1;const E=[T,O].filter(I=>!!I),_=A.labelNodeId?[A.labelNodeId]:[];for(const I of k)if(fo(I.a,I.b,l,E,-2)||fo(I.a,I.b,u,_,-2))return!1;for(const I of t){if(I===A||I.isLayoutOnly)continue;const L=I.points;if(!(!L||L.length<2)){for(const R of k)for(const D of h(I,Li(L)))if(f(R,D)||x1(R.a,R.b,D.a,D.b,.001))return!1}}return!0},"candidateIsSafe"),g=C((A,S)=>{const T=Li(A.edge.points??[]);if(T.length<4||A.index>=T.length-1)return;const O=T.map(k=>({...k}));if(A.horizontal)O[A.index].y+=S,O[A.index+1].y+=S;else if(A.vertical)O[A.index].x+=S,O[A.index+1].x+=S;else return;return h(A.edge,O).length===O.length-1?O:void 0},"shiftedCandidate"),m=C((A,S)=>({x:A.x??(S.left+S.right)/2,y:A.y??(S.top+S.bottom)/2}),"nodeCenter"),v=C(A=>{const S=A.edge,T=Li(S.points??[]);if(T.length!==4||A.index!==1)return;const O=S.start?e.get(S.start):void 0,k=S.end?e.get(S.end):void 0,E=O?Vh(O):void 0,_=k?Vh(k):void 0,I=T.slice(A.index+2);if(!(!O||!k||!E||!_||I.length===0))return{sourceCenter:m(O,E),targetCenter:m(k,_),sourceRect:E,tail:I}},"sourceDetourContextFor"),y=C((A,S,T,O,k,E)=>{const _=O.y>=T.y,I=_?k.bottom:k.top,L=I+(_?20:-20);if(_&&A.b.y<=L+.001||!_&&A.b.y>=L-.001)return;const R=A.a.x+S;return Li([{x:T.x,y:I},{x:T.x,y:L},{x:R,y:L},{x:R,y:A.b.y},...E],.001)},"verticalSourceDetour"),b=C((A,S,T,O,k,E)=>{const _=O.x>=T.x,I=_?k.right:k.left,L=I+(_?20:-20);if(_&&A.b.x<=L+.001||!_&&A.b.x>=L-.001)return;const R=A.a.y+S;return Li([{x:I,y:T.y},{x:L,y:T.y},{x:L,y:R},{x:A.b.x,y:R},...E],.001)},"horizontalSourceDetour"),x=C((A,S)=>{const T=v(A);if(T){if(A.vertical)return y(A,S,T.sourceCenter,T.targetCenter,T.sourceRect,T.tail);if(A.horizontal)return b(A,S,T.sourceCenter,T.targetCenter,T.sourceRect,T.tail)}},"sourceDetourCandidate"),w=[-7,7,-2*7,2*7,-3*7,3*7];for(let A=0;A<12;A++){const S=d();let T=!1;for(let O=0;OL.interior);for(const L of I){for(const R of w){const D=g(L,R);if(D&&p(L.edge,D)){L.edge.points=D,T=!0;break}const M=x(L,R);if(M&&p(L.edge,M)){L.edge.points=M,T=!0;break}}if(T)break}}if(!T)return}}C(BTe,"nudgeSharedInteriorSubpaths");function iDt(t,e,r,n){const i=e.x-t.x,a=e.y-t.y,s=n.x-r.x,o=n.y-r.y,l=i*o-a*s;if(Math.abs(l)<1e-10)return!1;const u=r.x-t.x,h=r.y-t.y,d=(u*o-h*s)/l,f=(u*a-h*i)/l,p=.01;return d>p&&d<1-p&&f>p&&f<1-p}C(iDt,"segmentsIntersect");function aDt(t){const e=t.nodes??[],r=t.edges??[],n=[];if(!r.length||!e.length)return n;const i=ERt(e),a=[];for(const o of r){if(o.isLayoutOnly)continue;const l=o.points;if(!l||l.length<2)continue;const u=o.start,h=o.end,d=o.labelNodeId,f=o.id??`${u}->${h}`;for(const p of i)if(!(p.nodeId===u||p.nodeId===h)&&!(d&&p.nodeId===d)){for(let g=0;g0){const o=n.filter(u=>u.type==="edge-node-overlap").length,l=n.filter(u=>u.type==="edge-edge-crossing").length;me.warn(`[SWIMLANE_VALIDATE] ${n.length} issue(s) detected: ${o} edge-node overlap(s), ${l} edge crossing(s)`);for(const u of n)me.warn(`[SWIMLANE_VALIDATE] ${u.type}: ${u.detail}`)}return n}C(aDt,"validateSwimlanesLayout");function sDt(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(o=>!o.isGroup);if((e==="LR"||e==="RL")&&i.length>0&&!GRt(t,e)||e==="BT"&&i.length>0&&!QRt(t))return;for(const o of n){if(o.isLayoutOnly)continue;const l=o.points;!l||l.length<2||(o.points=_0(sJ(l)))}JRt(n,r),nDt(n,r),HRt(n,r);const a=new Map;for(const o of r)a.set(String(o.id),o);fJ(n,a),IRt(n,a),WRt(n,a),BTe(n,a),YRt(n,a),qRt(n,a),RTe(n,a),jRt(n,a);const s=C(()=>{ZRt(n,a),XRt(n,a),KRt(n,a),fJ(n,a),CTe(n,a),RTe(n,a),fJ(n,a),CTe(n,a)},"finalizeRenderedEdges");s(),BTe(n,a),s(),DTe(n,a),LTe(n,a),DTe(n,a),LTe(n,a)}C(sDt,"postProcessSwimlaneLayout");function E2(t){const e=new Map(t.nodeById),r=new Set,n=[];for(const a of t.edges){if(!e.has(a.src)||!e.has(a.dst))continue;const s=`${a.id}:${a.src}->${a.dst}`;r.has(s)||(r.add(s),n.push(a))}return{nodes:[...e.keys()],edges:n,layout:t.layout,nodeById:e}}C(E2,"normalizeGraph");function $Te(t,e){return t.edges.filter(r=>r.dst===e)}C($Te,"incoming");function oDt(t){const e=new Map;for(const r of t.nodes)e.set(r,[]);for(const r of t.edges)e.get(r.src).push(r.dst);return e}C(oDt,"buildSuccessorMap");function FTe(t){const e=oDt(t);for(const r of e.values())r.sort((n,i)=>n.localeCompare(i));return e}C(FTe,"buildSortedSuccessorMap");function zTe(t){const e=new Map;for(const r of t.nodes)e.set(r,0);for(const r of t.edges)e.set(r.dst,(e.get(r.dst)??0)+1);return e}C(zTe,"buildInDegreeMap");function UTe(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,r)=>e.localeCompare(r))}C(UTe,"sortedZeroInDegreeNodes");function pJ(t,e=()=>!0){const r=new Map,n=new Map;for(const i of t.nodes)r.set(i,[]),n.set(i,[]);for(const i of t.edges)e(i)&&(n.get(i.src).push(i.dst),r.get(i.dst).push(i.src));return{preds:r,succs:n}}C(pJ,"buildPredecessorSuccessorMaps");function VTe(t,e,r,n){var s,o;let i=0;for(const l of t.nodes)n!=null&&n.skipGroups&&((s=t.nodeById.get(l))!=null&&s.isGroup)||(i=Math.max(i,r[l]??0));const a=Array.from({length:i+1},()=>[]);for(const l of e)n!=null&&n.skipGroups&&((o=t.nodeById.get(l))!=null&&o.isGroup)||a[Math.max(0,r[l]??0)].push(l);return a}C(VTe,"buildLayersFromRanks");function s9(t){const e=zTe(t),r=UTe(e),n=[],i=FTe(t);for(;r.length;){const a=r.shift();n.push(a);for(const s of i.get(a)??[])if(e.set(s,(e.get(s)??0)-1),(e.get(s)??0)===0){let o=0;for(;o{if(i-n<=1)return 0;const a=n+i>>1;let s=r(n,a)+r(a,i),o=n,l=a,u=n;for(;o=i||od.dst===f.dst?d.id.localeCompare(f.id):d.dst.localeCompare(f.dst));const n=Object.create(null);for(const h of e.nodes)n[h]=0;const i=[],a=C(h=>{n[h]=1;for(const d of r.get(h)??[]){const f=d.dst;n[f]===0?a(f):n[f]===1&&i.push(d)}n[h]=2},"dfs"),s=[...e.nodes].sort((h,d)=>h.localeCompare(d));for(const h of s)n[h]===0&&a(h);const o=new Set(i.map(h=>`${h.id}:${h.src}->${h.dst}`)),l=e.edges.map(h=>o.has(`${h.id}:${h.src}->${h.dst}`)?{id:h.id,src:h.dst,dst:h.src,weight:h.weight,ref:h.ref}:h);return{acyclic:{nodes:[...e.nodes],edges:l,layout:e.layout,nodeById:new Map(e.nodeById)},reversed:i}}C(lDt,"removeCycles_DFS");function cDt(t){const e=new Map,r=C(n=>{if(e.has(n))return e.get(n);const i=t.nodeById.get(n);if(!i)return e.set(n,null),null;const a=i.parentId;if(!a)return e.set(n,null),null;const o=r(a)??a;return e.set(n,o),o},"resolve");for(const n of t.nodes)r(n);return e}C(cDt,"buildTopLaneMap");function w1(t){const e=cDt(t);return r=>e.get(r)??null}C(w1,"createTopLaneResolver");function gJ(t){const e=[];for(const r of t.layout.nodes??[])r.isGroup&&!r.parentId&&e.push(r.id);return[...new Set(e)].reverse()}C(gJ,"buildTopLaneOrder");function GTe(t,e){const r=gJ(t);if(!e||e.length===0)return r;const n=new Set(r),i=new Set,a=[];for(const s of e)!n.has(s)||i.has(s)||(i.add(s),a.push(s));for(const s of r)i.has(s)||a.push(s);return a}C(GTe,"resolveTopLaneOrder");var kkn={EPSILON:1e-6},mJ={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},uDt={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function hDt(t,e){const r=E2(t),n=(e==null?void 0:e.laneOf)??(()=>null),i=e==null?void 0:e.rankHint,{preds:a}=pJ(r);for(const A of a.values())A.sort((S,T)=>S.localeCompare(T));const s=s9(r)??[...r.nodes].sort((A,S)=>A.localeCompare(S)),o=new Map;for(const[A,S]of s.entries())o.set(S,A);const l=new Map,u=new Map;for(const A of r.nodes)u.set(A,[]);for(const A of s){const S=(a.get(A)??[]).filter(T=>l.has(T));if(S.length>0){const T=dDt(A,S,{laneOf:n,rankHint:i,topoIndex:o});l.set(A,T),u.get(T).push(A)}else l.has(A)||l.set(A,null)}for(const A of r.nodes)l.has(A)||l.set(A,null);const h=new Set;for(const A of r.nodes)(l.get(A)??null)===null&&h.add(A);const d=[...h].sort((A,S)=>{const T=o.get(A)??0,O=o.get(S)??0;return T===O?A.localeCompare(S):T-O}),f=fDt(r),p=new Map;for(const[A,S]of f.entries())p.set(A,[...S].sort((T,O)=>T.localeCompare(O)));const g=pDt(p),m=gDt(p),v=new Map;for(const A of r.nodes)v.set(A,[]);for(const A of m)for(const S of A.nodes){const T=v.get(S);T?T.push(A.id):v.set(S,[A.id])}const y=[],b=[],x=new Set,w=C(A=>{if(!x.has(A)){x.add(A),y.push(A);for(const S of u.get(A)??[])w(S);b.push(A)}},"walk");for(const A of d)w(A);for(const A of s)w(A);return{parent:l,children:u,roots:d,componentOf:g,blocks:m,nodeBlocks:v,adjacency:p,preorder:y,postorder:b,topologicalOrder:s}}C(hDt,"buildDrivingTree");function dDt(t,e,r){const n=r.laneOf(t);return[...e].sort((a,s)=>{var m,v;const o=r.laneOf(a),l=r.laneOf(s),u=o!=null&&o===n,h=l!=null&&l===n;if(u!==h)return u?-1:1;const d=(m=r.rankHint)==null?void 0:m[a],f=(v=r.rankHint)==null?void 0:v[s];if(d!=null&&f!=null&&d!==f)return f-d;const p=r.topoIndex.get(a)??0,g=r.topoIndex.get(s)??0;return p!==g?p-g:a.localeCompare(s)})[0]}C(dDt,"chooseParent");function fDt(t){const e=new Map;for(const r of t.nodes)e.set(r,new Set);for(const r of t.edges)e.get(r.src).add(r.dst),e.get(r.dst).add(r.src);return e}C(fDt,"buildAdjacency");function pDt(t){const e=new Map;let r=0;for(const n of t.keys()){if(e.has(n))continue;const i=[n];for(;i.length>0;){const a=i.pop();if(!e.has(a)){e.set(a,r);for(const s of t.get(a)??[])e.has(s)||i.push(s)}}r++}return e}C(pDt,"assignComponents");function gDt(t){const e=new Map,r=new Map,n=[],i=[];let a=0;const s=C((o,l)=>{e.set(o,++a),r.set(o,a);for(const u of t.get(o)??[])u!==l&&(e.has(u)?(e.get(u)??0)<(e.get(o)??0)&&(n.push([o,u]),r.set(o,Math.min(r.get(o)??a,e.get(u)??a))):(n.push([o,u]),s(u,o),r.set(o,Math.min(r.get(o)??a,r.get(u)??a)),(r.get(u)??0)>=(e.get(o)??0)&&i.push(mDt(o,u,n,i.length))))},"visit");for(const o of t.keys())e.has(o)||s(o,null);return i}C(gDt,"computeBlocks");function mDt(t,e,r,n){const i=[],a=new Set;for(;r.length>0;){const s=r.pop();if(i.push(s),a.add(s[0]),a.add(s[1]),s[0]===t&&s[1]===e||s[0]===e&&s[1]===t)break}return{id:n,edges:i,nodes:[...a]}}C(mDt,"popBlock");function vDt(t,e,r){const n=[...t.nodes],i=new Map;for(const[b,x]of n.entries())i.set(x,b);const a=n.length,s=new Array(a).fill(-1),o=new Array(a).fill(0),l=[],u=new Set;for(const b of n){const x=r.parent.get(b)??null,w=i.get(b);w!=null&&x==null&&(s[w]=-1,o[w]=0,u.has(b)||(u.add(b),l.push(b)))}for(;l.length>0;){const b=l.shift(),x=i.get(b);if(x==null)continue;const w=r.children.get(b)??[];for(const A of w){if(u.has(A))continue;const S=i.get(A);S!=null&&(s[S]=x,o[S]=o[x]+1,u.add(A),l.push(A))}}for(const b of n){if(u.has(b))continue;const x=i.get(b);x!=null&&(s[x]=-1,o[x]=0,u.add(b))}const h=Math.max(1,Math.ceil(Math.log2(Math.max(1,a)))+1),d=Array.from({length:h},()=>new Array(a).fill(-1));for(let b=0;b{if(b===-1||x===-1)return-1;o[b]>A&1&&(b=d[A][b],b===-1))return-1;if(b===x)return b;for(let A=h-1;A>=0;A--){const S=d[A][b],T=d[A][x];S===-1||T===-1||S!==T&&(b=S,x=T)}return d[0][b]},"lcaIndex"),p=Array.from({length:a},()=>new Map);for(const b of t.edges){let x=b.src,w=b.dst,A=e[x],S=e[w];if(A==null||S==null||(A>S&&([x,w]=[w,x],[A,S]=[S,A]),A==null||S==null||A===S))continue;const T=i.get(x),O=i.get(w);if(T==null||O==null)continue;const k=f(T,O);if(k===-1)continue;const E=p[k];for(let _=A;_{if(x.size!==0)for(const[w,A]of x)b.set(w,(b.get(w)??0)+A)},"mergeInto"),v=new Set,y=C(b=>{const x=i.get(b);v.add(b);const w=x==null?void 0:p[x],A=w?new Map(w):new Map,S=r.children.get(b)??[];for(const T of S){const O=y(T),k=e[b];if(k!=null){let E=g.get(b);E||(E=new Map,g.set(b,E));let _=O.get(k)??0;const I=e[T];I!=null&&I>k&&(_+=1),E.set(T,_)}m(A,O)}return A},"dfs");for(const b of r.roots)v.has(b)||y(b);for(const b of n)v.has(b)||y(b);return g}C(vDt,"computeSubtreeCrossCounts");function yDt(t,e,r){const n=new Map,i=C(a=>{let s=r[a]??0;const o=[...e.get(a)??[]];o.sort(HTe(r));for(const l of o){i(l);const u=n.get(l);u!=null&&(s=Math.min(s,u))}n.set(a,s)},"annotate");for(const a of t)i(a);return n}C(yDt,"annotateMinimumLayers");function HTe(t){return(e,r)=>{const n=t[e]??0,i=t[r]??0;return n===i?e.localeCompare(r):n-i}}C(HTe,"compareByRankThenId");function bDt(t,e,r,n){let i=0;for(const l of e){const u=r[l]??0;u>i&&(i=u)}const a=Array.from({length:i+1},()=>[]),s=new Set,o=C(l=>{if(s.has(l))return;s.add(l);const u=r[l]??0;a[u]||(a[u]=[]),a[u].push(l);for(const h of n(l))o(h)},"emit");for(const l of t)o(l);for(const l of e)if(!s.has(l)){const u=r[l]??0;a[u]||(a[u]=[]),a[u].push(l),s.add(l)}return a}C(bDt,"emitNodesInTreeOrder");function xDt(t){const e=[];for(const r of t){const n=new Set,i=[];for(const a of r)n.has(a)||(n.add(a),i.push(a));e.push(i)}return e}C(xDt,"deduplicateLayers");function wDt(t,e,r,n){return i=>{const a=t.get(i)??[];if(a.length===0)return[];const s=e[i]??0,o=[],l=[],u=r.get(i);for(const h of a){const d=n.get(h)??s;d>s?o.push({child:h,min:d}):l.push(h)}return o.sort((h,d)=>h.min===d.min?h.child.localeCompare(d.child):h.min-d.min),l.sort((h,d)=>{const f=(u==null?void 0:u.get(h))??0,p=(u==null?void 0:u.get(d))??0;if(f!==p)return f-p;const g=n.get(h)??s,m=n.get(d)??s;return g!==m?g-m:h.localeCompare(d)}),[...o.map(h=>h.child),...l]}}C(wDt,"createChildOrderer");function vJ(t,e,r){const n=hDt(t,{rankHint:e,laneOf:r}),{children:i,roots:a}=n;for(const d of t.nodes)i.has(d)||i.set(d,[]);const s=vDt(t,e,n),o=[...a].sort(HTe(e)),l=yDt(o,i,e),u=wDt(i,e,s,l);let h=bDt(o,t.nodes,e,u);return h=xDt(h),h}C(vJ,"buildMultitreeLayerOrder");function ADt(t,e,r){const n=new Set(t),i=new Set(e),a=h3(e),s=[];for(const o of r)n.has(o.src)&&i.has(o.dst)&&s.push(a.get(o.dst));return QTe(s)}C(ADt,"countCrossingsBetweenAdjacent");function WTe(t,e,r){const n=[];for(const a of e){const s=r[a.src],o=r[a.dst];if(s==null||o==null||s===o)continue;let l=a.src,u=a.dst,h=s,d=o;s>o&&(l=a.dst,u=a.src,h=o,d=s);for(let f=h;f(r[f]??0)-(r[d]??0));for(const d of h){const f=r[d]??0;if(f===0)continue;let p=0;for(const y of n.get(d)??[])p=Math.max(p,(r[y]??0)+1);if(p>=f)continue;const g=f;r[d]=p;const m=vJ(t,r,i),v=WTe(m,t.edges,r);v(e[i]??0)-(e[a]??0)||i.localeCompare(a));for(const i of n){const a=r(i);if(!a)continue;const s=t.edges.filter(m=>m.src===i);if(s.length===0)continue;let o=!1,l=0;for(const m of s){const v=r(m.dst);v==null||v===a?o=!0:l++}if(l===0||o)continue;let u=0,h=!1;for(const m of t.edges){if(m.dst!==i)continue;const v=r(m.src);v&&(v===a?h=!0:u++)}if(u>0||!h)continue;const d=e[i]??0,f=d+l;let p=0;for(const m of t.edges)m.dst===i&&(p=Math.max(p,(e[m.src]??0)+1));const g=Math.max(d,p,f);g!==d&&(e[i]=g)}}C(TDt,"adjustCrossLaneSources");function CDt(t,e){const r=E2(t),n=s9(r)??[...r.nodes].sort(),i=(e==null?void 0:e.compactSingleInput)??!1,a=w1(r);let s=Object.create(null);for(const l of n){const u=$Te(r,l),h=e!=null&&e.ignoreCrossLaneEdges?u.filter(d=>{const f=a(d.src),p=a(l);return!f||!p?!0:f===p}):u;if(h.length===0)s[l]=0;else if(i&&h.length===1){const d=h[0].src,f=a(d),p=a(l);f!==p?s[l]=s[d]??0:s[l]=(s[d]??0)+1}else{let d=-1/0;for(const f of h)d=Math.max(d,(s[f.src]??0)+1);s[l]=d===-1/0?0:d}}return((e==null?void 0:e.optimizeRanksByCrossings)??!1)&&(s=SDt(r,s)),e!=null&&e.ignoreCrossLaneEdges&&TDt(r,s),{layers:vJ(r,s,a),rankOf:s,dummy:new Set}}C(CDt,"assignLayers_LongestPath");function ODt(t,e){const r=E2(t),i={...CDt(r,{compactSingleInput:e==null?void 0:e.compactSingleInput,ignoreCrossLaneEdges:e==null?void 0:e.ignoreCrossLaneEdges,optimizeRanksByCrossings:e==null?void 0:e.optimizeRanksByCrossings}).rankOf},a=w1(r),{preds:s,succs:o}=pJ(r,g=>{if(e!=null&&e.ignoreCrossLaneEdges){const m=a(g.src),v=a(g.dst);if(m&&v&&m!==v)return!1}return!0}),l=s9(r)??[...r.nodes],u=[...l].reverse(),h=C((g,m)=>{let v=0;for(const x of s.get(g)??[])v=Math.max(v,(i[x]??0)+1);let y=Number.POSITIVE_INFINITY;const b=o.get(g)??[];return b.length>0&&(y=Math.min(...b.map(x=>(i[x]??0)-1))),Number.isFinite(y)||(y=Math.max(v,m)),Math.min(Math.max(m,v),y)},"clampFeasible"),d=mJ.GRAVITY_ITERATIONS,f=C(g=>{let m=!1;for(const v of g){const y=s.get(v)??[],b=o.get(v)??[];if(y.length===0&&b.length===0)continue;const x=y.length>0?y.reduce((T,O)=>T+(i[O]??0)+1,0)/y.length:i[v]??0,w=b.length>0?b.reduce((T,O)=>T+(i[O]??0)-1,0)/b.length:i[v]??0,A=Math.round((x+w)/2),S=h(v,A);S!==i[v]&&(i[v]=S,m=!0)}return m},"relaxOrder");for(let g=0;g0){const v=Math.min(...m.map(y=>(i[y]??0)-1));(i[g]??0)>v&&(i[g]=v)}}return{layers:VTe(r,l,i),rankOf:i,dummy:new Set}}C(ODt,"assignLayers_Gravity");function kDt(t){const e=zTe(t),r=FTe(t);let n=UTe(e);const i=[];for(;n.length>0;){const a=[];for(const s of n){i.push(s);for(const o of r.get(s)??[])e.set(o,(e.get(o)??0)-1),(e.get(o)??0)===0&&a.push(o)}n=a.sort((s,o)=>s.localeCompare(o))}return i.length===t.nodes.length?i:null}C(kDt,"topoSortByGenerationIfAcyclic");function EDt(t,e){const r=E2(t),n=(e==null?void 0:e.direction)==="LR"?kDt(r)??[...r.nodes].sort():s9(r)??[...r.nodes].sort(),i=w1(r),a=C(h=>i(h)??h,"laneOf"),s=Object.create(null),o=new Map,l=C((h,d)=>(e==null?void 0:e.ignoreCrossLaneEdges)??!0?a(h)===a(d)?1:0:1,"edgeWeight");for(const h of n){const d=r.nodeById.get(h);if(d!=null&&d.isGroup)continue;const f=$Te(r,h);let p=0;if(f.length>0)for(const y of f){const b=y.src,x=s[b]??0;p=Math.max(p,x+l(b,h))}const g=a(h),m=o.get(g)??0,v=Math.max(p,m);s[h]=v,o.set(g,v+1)}return{layers:VTe(r,n,s,{skipGroups:!0}),rankOf:s,dummy:new Set}}C(EDt,"assignLayers_LaneAwareCompact");function _Dt(t,e){const r=E2(e),{rankOf:n}=t,i=t.layers.map(p=>[...p]),a=new Set(t.dummy?[...t.dummy]:[]);let s=0;const o=new Map(r.nodeById),l=C(p=>{const g=`placeholder-${s++}`,m={id:g,isGroup:!1,isDummy:!0,width:0,height:0};for(o.set(g,m),a.add(g);i.length<=p;)i.push([]);return i[p].push(g),n[g]=p,g},"addDummyAt"),u=[...r.edges].sort((p,g)=>p.id===g.id?p.src===g.src?p.dst.localeCompare(g.dst):p.src.localeCompare(g.src):p.id.localeCompare(g.id)),h=[];for(const p of u){const g=n[p.src]??0,m=n[p.dst]??0;if(m-g<=1){h.push(p);continue}let v=p.src;for(let b=g+1,x=0;b!r.nodes.includes(p))],edges:h,layout:r.layout,nodeById:o};return{layering:{layers:i,rankOf:n,dummy:a},graphWithDummies:f}}C(_Dt,"makeProperLayering");function YTe(t){const e=t.length;if(e===0)return Number.POSITIVE_INFINITY;const r=[...t].sort((n,i)=>n-i);return e%2===1?r[(e-1)/2]:.5*(r[e/2-1]+r[e/2])}C(YTe,"median");function qTe(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((r,n)=>r+n,0)/t.length}C(qTe,"barycenter");function RDt(t,e,r,n){const i=new Map;for(const a of t)i.set(a,[]);for(const a of r)n==="down"?e.has(a.src)&&i.has(a.dst)&&i.get(a.dst).push(e.get(a.src)):e.has(a.dst)&&i.has(a.src)&&i.get(a.src).push(e.get(a.dst));return i}C(RDt,"neighborPositionsFor");function DDt(t,e,r){const n=r.get(t)??0,i=r.get(e)??0;return n!==i?n-i:t.localeCompare(e)}C(DDt,"currentOrderTieBreak");function jTe(t,e,r){const n=new Set(t),i=new Set(e),a=h3(t),s=h3(e),o=[];for(const u of r)n.has(u.src)&&i.has(u.dst)&&o.push({u:a.get(u.src),v:s.get(u.dst)});o.sort((u,h)=>u.u===h.u?u.v-h.v:u.u-h.u);const l=o.map(u=>u.v);return QTe(l)}C(jTe,"countCrossingsBetweenAdjacent");function yJ(t,e,r){return[...t].sort((n,i)=>{const a=YTe(e.get(n)??[]),s=YTe(e.get(i)??[]);return a===s?DDt(n,i,r):isFinite(a)?isFinite(s)?a-s:-1:1})}C(yJ,"sortByHeuristic");function XTe(t,e,r,n,i,a){const s=h3(t),o=h3(e),l=RDt(e,s,r,n);if(!i||!a||a.length===0)return yJ(e,l,o);const u=new Map;for(const f of e){const p=i(f),g=u.get(p)??[];g.push(f),u.set(p,g)}const h=[];for(const f of a){const p=u.get(f);if(!p||p.length===0)continue;const g=yJ(p,l,o);h.push(...g)}const d=u.get(null);if(d&&d.length>0){const f=yJ(d,l,o);for(const p of f){const g=qTe(l.get(p)??[]);let m=h.length;if(isFinite(g))for(const[v,y]of h.entries()){const b=qTe(l.get(y)??[]);if(gs.has(m.src)&&o.has(m.dst)),h=l?r.filter(m=>o.has(m.src)&&l.has(m.dst)):void 0,d=C(m=>{let v=jTe(t,m,u);return h&&n&&(v+=jTe(m,n,h)),v},"crossingScore"),f=i?new Map:null;if(i&&f)for(const m of e)f.set(m,i(m));let p=!0,g=d(a);for(;p;){p=!1;for(let m=0;m+1[...o]),i=e.edges,a=w1(e),s=GTe(e,r==null?void 0:r.laneOrder);for(let o=0;o<3;o++){for(let l=1;l=0;l--)n[l]=XTe(n[l+1],n[l],i,"up",a,s),n[l]=KTe(n[l+1],n[l],i,n[l-1],a)}return{layers:n}}C(LDt,"orderLayers");function MDt(t,e,r){const n=(r==null?void 0:r.layerGap)??uDt.DEFAULT_LAYER_GAP,i=(r==null?void 0:r.nodeGap)??uDt.DEFAULT_NODE_GAP,a=(r==null?void 0:r.laneGap)??i*2,s=(r==null?void 0:r.direction)??"TB",o=s==="LR"||s==="RL",l=t.layers,u=Object.create(null),h=Object.create(null),d=C(E=>e.nodeById.get(E),"getNode"),f=C(E=>{var _;return((_=d(E))==null?void 0:_.width)??0},"getWidth"),p=C(E=>{var _;return((_=d(E))==null?void 0:_.height)??0},"getHeight"),g=w1(e),m=GTe(e,r==null?void 0:r.laneOrder),v=l.map(E=>E.reduce((_,I)=>Math.max(_,p(I)),0)),y=[];if(o)for(let E=0;E+1Math.max(N,f(F)),0),I=l[E+1].reduce((N,F)=>Math.max(N,f(F)),0),L=v[E],R=v[E+1],D=L/2+R/2,M=(_+I)/2,P=Math.max(0,M-D-n);y.push(P)}const b=new Set;for(const E of l)for(const _ of E)b.add(g(_));const x=b.has(null),w=m.filter(E=>b.has(E)),A=[...x?[null]:[],...w],S=Object.create(null);for(const E of w)S[E]=0;x&&(S.null=0);for(const E of l){const _=Object.create(null),I=[];for(const L of E){const R=g(L);R===null?I.push(L):(_[R]||(_[R]=[])).push(L)}for(const[L,R]of Object.entries(_)){const D=R.reduce((M,P)=>M+f(P),0)+i*Math.max(0,R.length-1);S[L]=Math.max(S[L]??0,D)}if(x&&I.length){const L=I.reduce((R,D)=>R+f(D),0)+i*Math.max(0,I.length-1);S.null=Math.max(S.null??0,L)}}const T=new Map;{const E=A.map(L=>(L===null?S.null:S[L])??0);let I=-(E.reduce((L,R)=>L+R,0)+a*Math.max(0,A.length-1))/2;for(let L=0;Lf(V)),F=N.reduce((V,z)=>V+z,0)+i*(M.length-1);let B=P-F/2;for(const[V,z]of M.entries()){const U=N[V];u[z]=B+U/2,h[z]=O+I/2,B+=U+i}}}const R=y[E]??0;O+=I+n+R}const k=new Map;for(const E of e.edges){const _=E.ref.id;k.has(_)||k.set(_,[]),k.get(_).push(E)}for(const[,E]of k){if(E.length===0)continue;const _=E[0].ref,I=_.start,L=_.end;if(I==null||L==null)continue;const R=Math.round(((u[I]??0)+(u[L]??0))/2),D=new Set;for(const M of E)D.add(M.src),D.add(M.dst);for(const M of D){if(M===I||M===L)continue;const P=e.nodeById.get(M);P!=null&&P.isDummy&&(u[M]=R)}}return{x:u,y:h}}C(MDt,"assignCoordinates");var IDt=8;function PDt(t){let e=2166136261;for(let r=0;r>>0}C(PDt,"hashString");function NDt(t){let e=t>>>0;return()=>{e+=1831565813;let r=e;return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),((r^r>>>14)>>>0)/4294967296}}C(NDt,"mulberry32");function BDt(t,e){const r=[...t],n=NDt(e);for(let i=r.length-1;i>0;i--){const a=Math.floor(n()*(i+1));[r[i],r[a]]=[r[a],r[i]]}return r}C(BDt,"deterministicShuffle");function $Dt(t,e){let r=0;for(const[n,i]of t.entries())r+=Math.abs(n-(e.get(i)??n));return r}C($Dt,"sourceDistance");function ZTe(t,e){const r=new Map;for(const[i,a]of t.entries())r.set(a,i);let n=0;for(const{a:i,b:a,weight:s}of e){const o=r.get(i),l=r.get(a);o==null||l==null||(n+=s*Math.abs(o-l))}return n}C(ZTe,"laneArrangementCost");function FDt(t){const e=gJ(t);if(e.length<2)return[];const r=new Map(e.map((a,s)=>[a,s])),n=w1(t),i=new Map;for(const a of t.layout.edges??[]){if(a.isLayoutOnly)continue;const s=typeof a.start=="string"?a.start:void 0,o=typeof a.end=="string"?a.end:void 0;if(!s||!o||!t.nodeById.has(s)||!t.nodeById.has(o))continue;const l=n(s),u=n(o);if(!l||!u||l===u)continue;const h=r.get(l),d=r.get(u);if(h==null||d==null)continue;const[f,p]=h<=d?[l,u]:[u,l],g=`${f}\0${p}`,m=i.get(g);m?m.weight++:i.set(g,{a:f,b:p,weight:1})}return[...i.values()]}C(FDt,"buildWeightedLaneEdges");function JTe(t,e,r){const n=[...t];let i=ZTe(n,e),a=!0,s=0;const o=Math.max(1,n.length);for(;a&&si.a===a.a?i.b.localeCompare(a.b):i.a.localeCompare(a.a)).map(({a:i,b:a,weight:s})=>`${i}:${a}:${s}`).join("|");return PDt(`${t.join("|")}#${n}#${r}`)}C(UDt,"seedForRestart");function VDt(t,e={}){const r=gJ(t);if(r.length<2)return r;const n=FDt(t);if(n.length===0)return r;const i=new Map(r.map((o,l)=>[o,l]));let a=JTe(r,n,i);const s=Math.max(0,e.restarts??IDt);for(let o=0;oJn&&l*3>=o?s>0?"bottom":"top":o>Jn?a>0?"right":"left":r}C(tCe,"chooseOrthogonalSide");function rCe(t,e){return Math.abs(t.to-e.from)K.isGroup&&!K.parentId);for(const K of u){const ce={id:K.id},be=C(ne=>{s.set(ne.id,ce),r.filter(j=>j.parentId===ne.id).forEach(be)},"assignLane");be(K)}const h=r.filter(K=>!K.isGroup&&!K.isEdgeLabel).map(K=>{const ce=K.width??10,be=K.height??10,ne=K.x??0,j=K.y??0,ie=Ekn;return{nodeId:K.id,minX:ne-ce/2-ie,maxX:ne+ce/2+ie,minY:j-be/2-ie,maxY:j+be/2+ie,visualXHalfExtent:l?be/2+ie:ce/2+ie}}),d=C((K,ce,be,ne)=>{let j=o.find(ie=>ie.orientation===K&&Math.abs(ie.coord-ce)<1);return j||(j={id:`pipe-${K}-${ce.toFixed(0)}`,orientation:K,coord:ce,spanMin:be,spanMax:ne,tracks:[]},o.push(j)),j.spanMin=Math.min(j.spanMin,be),j.spanMax=Math.max(j.spanMax,ne),j},"getOrAddPipe"),f=C((K,ce)=>{const be=K.width??10,ne=K.height??10,j=K.x??0,ie=K.y??0;switch(ce){case"top":return{x:j,y:ie-ne/2};case"bottom":return{x:j,y:ie+ne/2};case"left":return{x:j-be/2,y:ie};case"right":return{x:j+be/2,y:ie}}},"portForSide"),p=C((K,ce,be)=>f(K,tCe(K,ce,be?"bottom":"top")),"getOrthogonalPort"),g=[],m=[],v=new Set,y=1e3,b=C((K,ce,be)=>{if(g.length===0)return 0;const ne=Math.abs(ce.y-be.y)ye||oe.from-Jn<=pe&&oe.to+Jn>=pe&&(ie+=y)}else if(j){const pe=ce.x,te=Math.min(ce.y,be.y)-Jn,ye=Math.max(ce.y,be.y)+Jn;if(ye<=te)return 0;for(const oe of g)oe.edgeIndex===K||oe.orientation!=="horizontal"||oe.pipe.coordye||oe.from-Jn<=pe&&oe.to+Jn>=pe&&(ie+=y)}return ie},"crossingPenalty"),x=i.map((K,ce)=>{if(!K.start||!K.end)return{idx:ce,crossLane:0,dx:0,dy:0};const be=a.get(K.start),ne=a.get(K.end),j=s.get(K.start),ie=s.get(K.end),pe=j&&ie&&j.id!==ie.id?1:0,te=be&&ne?Math.abs((ne.x??0)-(be.x??0)):0,ye=be&&ne?Math.abs((ne.y??0)-(be.y??0)):0;return{idx:ce,crossLane:pe,dx:te,dy:ye}}).sort((K,ce)=>{if(K.crossLane!==ce.crossLane)return ce.crossLane-K.crossLane;const be=K.dx+K.dy,ne=ce.dx+ce.dy;return Math.abs(be-ne)>1?be-ne:K.idx-ce.idx}).map(K=>K.idx),w=C((K,ce,be,ne)=>{const j=Math.min(K.x,ce.x),ie=Math.max(K.x,ce.x),pe=Math.min(K.y,ce.y),te=Math.max(K.y,ce.y);return!!h.find(oe=>be&&oe.nodeId===be||ne&&oe.nodeId===ne?!1:Math.abs(K.x-ce.x)>Jn?oe.minYK.y&&oe.maxX>j&&oe.minXK.x&&oe.maxY>pe&&oe.minYtCe(K,ce,"bottom"),"determineSide"),O=new Map;for(const[K,ce]of i.entries()){if(!ce.start||!ce.end||ce.start===ce.end||ce.points&&ce.points.length>0)continue;const be=a.get(ce.start),ne=a.get(ce.end);if(!be||!ne)continue;const j=(ne.x??0)-(be.x??0),ie=(ne.y??0)-(be.y??0);O.set(K,{edgeIdx:K,srcId:ce.start,dstId:ce.end,srcSide:T(be,{x:ne.x??0,y:ne.y??0}),dstSide:T(ne,{x:be.x??0,y:be.y??0}),absDx:Math.abs(j),absDy:Math.abs(ie),dxSign:Math.sign(j),dySign:Math.sign(ie)})}const k=C(K=>K.srcSide==="top"||K.srcSide==="bottom"?K.absDx===0?1/0:K.absDy/K.absDx:K.absDy===0?1/0:K.absDx/K.absDy,"preferenceStrength"),E=C(K=>K.srcSide==="top"||K.srcSide==="bottom"?K.dxSign>=0?"right":"left":K.dySign>=0?"bottom":"top","secondarySide"),_=new Map;for(const K of O.values()){const ce=`${K.srcId}:${K.srcSide}`;_.has(ce)||_.set(ce,[]),_.get(ce).push(K)}const I=new Map,L=C((K,ce)=>`${K}:${ce}`,"loadKey");for(const K of O.values())I.set(L(K.srcId,K.srcSide),(I.get(L(K.srcId,K.srcSide))??0)+1),I.set(L(K.dstId,K.dstSide),(I.get(L(K.dstId,K.dstSide))??0)+1);for(const K of _.values())if(!(K.length<2)){K.sort((ce,be)=>{const ne=k(ce),j=k(be);return Math.abs(ne-j)>1e-9?j-ne:ce.edgeIdx-be.edgeIdx});for(let ce=1;ce=j||(I.set(L(be.srcId,be.srcSide),j-1),I.set(L(be.srcId,ne),ie+1),be.srcSide=ne)}}const R=C(K=>{const ce=K==null?void 0:K.shape;return ce==="question"||ce==="diamond"},"isDiamondNode"),D=new Map;for(const K of O.values())D.has(K.dstId)||D.set(K.dstId,new Set),D.get(K.dstId).add(K.dstSide);for(const K of O.values()){if(!R(a.get(K.srcId)))continue;const ce=D.get(K.srcId);if(!(ce!=null&&ce.has(K.srcSide)))continue;const be=E(K);if(ce.has(be)||(I.get(L(K.srcId,be))??0)>0)continue;const ne=I.get(L(K.srcId,K.srcSide))??0;I.set(L(K.srcId,K.srcSide),Math.max(0,ne-1)),I.set(L(K.srcId,be),1),K.srcSide=be}for(const K of O.values()){const{edgeIdx:ce,srcId:be,dstId:ne,srcSide:j,dstSide:ie}=K,pe=a.get(be),te=a.get(ne),ye=`${be}:${j}:src`,oe=j==="top"||j==="bottom"?te.x??0:te.y??0;A.has(ye)||A.set(ye,[]),A.get(ye).push({edgeIdx:ce,oppositeCoord:oe});const _e=`${ne}:${ie}:dst`,Le=ie==="top"||ie==="bottom"?pe.x??0:pe.y??0;A.has(_e)||A.set(_e,[]),A.get(_e).push({edgeIdx:ce,oppositeCoord:Le})}const M=new Map,P=8;for(const[K,ce]of A){if(ce.length<2)continue;ce.sort((Ze,Ge)=>Ze.oppositeCoord-Ge.oppositeCoord);const be=K.split(":"),ne=be.slice(0,-2).join(":"),j=be[be.length-2],ie=be[be.length-1],pe=a.get(ne);if(!pe)continue;const ye=j==="left"||j==="right"?pe.height??10:pe.width??10,oe=pe.shape,Le=oe==="question"||oe==="diamond"?ye*.3:ye,Pe=Math.min(20,Math.max(P,Le/(ce.length+1))),Ne=-(Pe*(ce.length-1))/2;for(const[Ze,Ge]of ce.entries()){const lt=Ne+Ze*Pe,Fe=`${Ge.edgeIdx}:${ie}`;M.set(Fe,lt)}}const N=C(K=>{var ce;return!!((ce=i[K])!=null&&ce.labelNodeId)},"edgeHasLabelNode"),F=C((K,ce)=>K?(A.get(`${K}:${ce}:src`)??[]).some(({edgeIdx:be})=>N(be))||(A.get(`${K}:${ce}:dst`)??[]).some(({edgeIdx:be})=>N(be)):!1,"faceHasLabelNode"),B=C((K,ce,be)=>ce==="top"||ce==="bottom"?{x:K.x+be,y:K.y}:{x:K.x,y:K.y+be},"applyPortOffset"),V=C((K,ce,be)=>{const ne=O.get(K),j={x:be.x??0,y:be.y??0},ie={x:ce.x??0,y:ce.y??0},pe=(ne==null?void 0:ne.srcSide)??T(ce,j),te=(ne==null?void 0:ne.dstSide)??T(be,ie);let ye=ne?f(ce,ne.srcSide):p(ce,j,!0),oe=ne?f(be,ne.dstSide):p(be,ie,!1);const _e=M.get(`${K}:src`),Le=M.get(`${K}:dst`);return _e!==void 0&&(ye=B(ye,pe,_e)),Le!==void 0&&(oe=B(oe,te,Le)),{pSrcPort:ye,pDstPort:oe,srcSide:pe,dstSide:te}},"portsForEdge");for(const K of x){const ce=i[K];if(m[K]=[],!ce.start||!ce.end||ce.points&&ce.points.length>0||ce.start===ce.end)continue;const be=a.get(ce.start),ne=a.get(ce.end);if(!be||!ne)continue;const{pSrcPort:j,pDstPort:ie,srcSide:pe,dstSide:te}=V(K,be,ne),ye={...j},oe={...ie},_e=pe==="top"||pe==="bottom",Le=te==="top"||te==="bottom";if(_e){const pt=j.y>(be.y??0);ye.y=pt?j.y+pp:j.y-pp}else{const pt=j.x>(be.x??0);ye.x=pt?j.x+pp:j.x-pp}if(Le){const pt=ie.y>(ne.y??0);oe.y=pt?ie.y+pp:ie.y-pp}else{const pt=ie.x>(ne.x??0);oe.x=pt?ie.x+pp:ie.x-pp}const Ye=C((pt,St)=>{for(const sr of h)if(!St.includes(sr.nodeId)&&pt.x>sr.minX&&pt.xsr.minY&&pt.y{if(Ln){const Vt=pt.y>(St.y??0);return{x:(sr.x??0)>=pt.x?Kr.maxX+yC:Kr.minX-yC,y:Vt?Kr.maxY+d3:Kr.minY-d3,leavesPositiveSide:Vt}}const Et=pt.x>(St.x??0),Tt=(sr.y??0)>=pt.y;return{x:Et?Kr.maxX+yC:Kr.minX-yC,y:Tt?Kr.maxY+d3:Kr.minY-d3,leavesPositiveSide:Et}},"obstacleDetour");let Xe=[];const Ne=[ce.start,ce.end],Ze=Ye(ye,Ne);if(Ze.inside&&Ze.obstacle){const pt=Ze.obstacle;if(_e){const St=Pe(j,be,ne,pt,!0);ye.x=St.x,ye.y=St.y;const sr=St.leavesPositiveSide?Math.min(pt.minY-2,j.y+pp):Math.max(pt.maxY+2,j.y-pp);Xe=[{x:j.x,y:sr},{x:St.x,y:sr},{x:St.x,y:St.y}]}else{const St=Pe(j,be,ne,pt,!1),sr=St.leavesPositiveSide?Math.min(pt.minX-2,j.x+pp):Math.max(pt.maxX+2,j.x-pp);ye.x=St.x,ye.y=St.y,Xe=[{x:sr,y:j.y},{x:sr,y:St.y},{x:St.x,y:St.y}]}}let Ge=[];const lt=Ye(oe,Ne);if(lt.inside&<.obstacle){const pt=lt.obstacle;if(Le){const St=Pe(ie,ne,be,pt,!0);oe.x=St.x,oe.y=St.y,Ge=[{x:St.x,y:St.y},{x:ie.x,y:St.y}]}else{const St=Pe(ie,ne,be,pt,!1);oe.x=St.x,oe.y=St.y,Ge=[{x:St.x,y:St.y},{x:St.x,y:ie.y}]}}if(Xe.length===0&&Ge.length===0){const pt=yC,St=Math.abs(ye.x-oe.x)1||Et>1,Vt=S.get(ce.start??"")??0,mt=S.get(ce.end??"")??0,Tr=Ln>1&&F(ce.start,pe)||Et>1&&F(ce.end,te),Ie=Ln<=1||Vt<=2,Xi=Et<=1||mt<=2;if((St||sr)&&!Kr&&(!Tt||Tt&&!Tr&&Ie&&Xi)&&!w(j,ie,ce.start,ce.end)){ce.points=[{...j},{...ye},{...oe},{...ie}],v.add(K);const li=sr?"horizontal":"vertical",Es=sr?j.y:j.x,Vn=sr?Math.min(j.x,ie.x):Math.min(j.y,ie.y),oa=sr?Math.max(j.x,ie.x):Math.max(j.y,ie.y),ci={id:`fast-path-${li}-${Es.toFixed(0)}-${K}`,orientation:li,coord:Es,spanMin:Vn,spanMax:oa,tracks:[]};g.push({edgeIndex:K,segmentIndex:0,orientation:li,pipe:ci,trackIndex:0,from:Vn,to:oa});continue}}const Fe=d("vertical",ye.x,ye.y,ye.y);ye.x=Fe.coord;const wt=d("vertical",oe.x,oe.y,oe.y);oe.x=wt.coord;let Me=Math.min(ye.x,oe.x)-50,Rt=Math.max(ye.x,oe.x)+50,Lt=Math.min(ye.y,oe.y)-50,ut=Math.max(ye.y,oe.y)+50;for(const pt of h){const St=Math.min(ye.x,oe.x),sr=Math.max(ye.x,oe.x),Kr=Math.min(ye.y,oe.y),Ln=Math.max(ye.y,oe.y);pt.minXSt&&pt.minYKr&&(Me=Math.min(Me,pt.minX-bJ),Rt=Math.max(Rt,pt.maxX+bJ),Lt=Math.min(Lt,pt.minY-bJ),ut=Math.max(ut,pt.maxY+bJ))}for(const pt of h){if(pt.maxXRt||pt.maxYut)continue;const St=yC;d("horizontal",pt.minY-St,Me,Rt),d("horizontal",pt.maxY+St,Me,Rt);const sr=d3;d("vertical",pt.minX-sr,Lt,ut),d("vertical",pt.maxX+sr,Lt,ut)}d("horizontal",ye.y,Me,Rt),d("horizontal",oe.y,Me,Rt);const Xt=o.filter(pt=>pt.orientation==="horizontal"&&pt.coord>=Lt&&pt.coord<=ut),Ft=o.filter(pt=>pt.orientation==="vertical"&&pt.coord>=Me&&pt.coord<=Rt),gt=C((pt,St)=>`${pt.toFixed(1)},${St.toFixed(1)}`,"getKey"),Ae=gt(ye.x,ye.y),zt=gt(oe.x,oe.y),kt=new Map,At=new Map,Mt=new Map,jr=new Set,Re=[];kt.set(Ae,0),Mt.set(Ae,"n"),Re.push({key:Ae,f:Math.hypot(oe.x-ye.x,oe.y-ye.y),pt:ye}),jr.add(Ae);let at=[];const xt=C((pt,St)=>w(pt,St,ce.start,ce.end),"checkSegmentBlocked"),Ct={x:oe.x,y:ye.y},gr=xt(ye,Ct),Xr=xt(Ct,oe),$r=gr||Xr,un={x:ye.x,y:oe.y},zr=xt(ye,un),On=xt(un,oe);if($r?zr||On||(Math.abs(ye.x-oe.x)0;){Re.sort((mt,Tr)=>mt.f-Tr.f);const pt=Re.shift();if(jr.delete(pt.key),pt.key===zt){let mt=zt,Tr=oe;for(at=[Tr];At.has(mt);){const Ie=At.get(mt);at.unshift(Ie),Tr=Ie,mt=gt(Ie.x,Ie.y)}break}const St=pt.pt.x,sr=pt.pt.y,Kr=Ft.sort((mt,Tr)=>mt.coord-Tr.coord),Ln=Kr.findIndex(mt=>Math.abs(mt.coord-St)<1),Et=Xt.sort((mt,Tr)=>mt.coord-Tr.coord),Tt=Et.findIndex(mt=>Math.abs(mt.coord-sr)<1),Vt=[];Ln>0&&Vt.push({x:Kr[Ln-1].coord,y:sr}),Ln>=0&&Ln0&&Vt.push({x:St,y:Et[Tt-1].coord}),Tt>=0&&TtVo.nodeId===ce.start||Vo.nodeId===ce.end?!1:Tr!==Ie?Vo.minYsr&&Vo.maxX>Tr&&Vo.minXSt&&Vo.maxY>Xi&&Vo.minY10&&lv<-5||lu<-10&&lv>5)&&(oa=Math.abs(lv)*100),(ci>10&&zg<-5||ci<-10&&zg>5)&&(oa+=Math.abs(zg)*50);let ek=0;const tk=Mt.get(pt.key)??"n",rk=Math.abs(zg)>Jn?"h":"v";tk!=="n"&&tk!==rk&&(ek=50);const ul=Es+Vn+oa+ek,nd=(kt.get(pt.key)??1/0)+ul,Ec=Math.abs(oe.x-mt.x)+Math.abs(oe.y-mt.y);if(nd<(kt.get(li)??1/0))if(At.set(li,pt.pt),kt.set(li,nd),Mt.set(li,rk),!jr.has(li))Re.push({key:li,f:nd+Ec,pt:mt}),jr.add(li);else{const Vo=Re.findIndex(ff=>ff.key===li);Vo!==-1&&(Re[Vo].f=nd+Ec)}}}if(at.length===0&&(at=[ye,{x:ye.x,y:oe.y},oe]),at.length>4){const pt=at[0],St=at[at.length-1];let sr=Math.min(pt.x,St.x),Kr=Math.max(pt.x,St.x),Ln=Math.min(pt.y,St.y),Et=Math.max(pt.y,St.y);for(const Xi of at)sr=Math.min(sr,Xi.x),Kr=Math.max(Kr,Xi.x),Ln=Math.min(Ln,Xi.y),Et=Math.max(Et,Xi.y);const Tt=Kr>Math.max(pt.x,St.x),Vt=srVn.minXUe&&Vn.minYMn);if(Es.length>0){let Vn=Math.max(pt.x,St.x);for(const oa of Es){const ci=(oa.minX+oa.maxX)/2;if(oa.visualXHalfExtent===void 0||isNaN(oa.visualXHalfExtent))continue;const lu=ci+oa.visualXHalfExtent+Xi;Vn=Math.max(Vn,lu)}isNaN(Vn)||(Kr=Vn)}}if(Vt){const Ue=h.filter(Mn=>Mn.minXMath.min(pt.y,St.y));if(Ue.length>0){let Mn=Math.min(pt.x,St.x);for(const li of Ue){const Vn=(li.minX+li.maxX)/2-li.visualXHalfExtent-Xi;Mn=Math.min(Mn,Vn)}sr=Mn}}}const mt=C(Xi=>{const Ue=St.y>pt.y,Mn=h.filter(Vn=>{const oa=Math.min(pt.x,St.x)Vn.minX,ci=Math.min(pt.y,St.y)Vn.minY;return oa&&ci});let li=Mn;if(l&&Mn.length>0){const Vn=Mn.filter(oa=>oa.minXXi);Vn.length>0&&(li=Vn)}if(li.length===0)return St.y;const Es=yC;if(Ue){const oa=Math.max(...li.map(ci=>ci.maxY))+Es;if(oaci.minY))-Es;if(oa>St.y+Jn)return oa}return St.y},"findBestReturnY"),Tr=C(Xi=>{const Ue=mt(Xi),Mn={x:Xi,y:pt.y},li={x:Xi,y:Ue},Es={x:St.x,y:Ue},Vn=xt(pt,Mn),oa=xt(Mn,li),ci=xt(li,Es),lu=Ue!==St.y?xt(Es,St):!1;return!Vn&&!oa&&!ci&&!lu?Math.abs(Ue-St.y)=3){const pt=hn[hn.length-1],St=hn[hn.length-2],sr=hn[hn.length-3],Kr=Math.abs(sr.y-St.y)Math.abs(pt.x-sr.x)&&hn.splice(-2,1)}else if(Ln){const Et=Math.sign(St.y-sr.y),Tt=Math.sign(pt.y-sr.y);Et!==0&&Et===Tt&&Math.abs(St.y-sr.y)>Math.abs(pt.y-sr.y)&&hn.splice(-2,1)}}const ti=[hn[0]];for(let pt=1;ptSt.x,Et=Kr.x>sr.x;if(Ln!==Et){ti.push(sr);continue}continue}if(Math.abs(St.x-sr.x)St.y,Et=Kr.y>sr.y;if(Ln!==Et){ti.push(sr);continue}continue}ti.push(sr)}ti.push(hn[hn.length-1]);for(let pt=0;ptK.from{const j=!ne.segments.some(pe=>(pe.edgeIndex!==ce.edgeIndex||pe.segmentIndex!==ce.segmentIndex)&&z(pe,K)),ie=!be.segments.some(pe=>(pe.edgeIndex!==K.edgeIndex||pe.segmentIndex!==K.segmentIndex)&&z(pe,ce));return j&&ie?(K.trackIndex=ne.index,ce.trackIndex=be.index,be.segments=[...be.segments.filter(pe=>pe.edgeIndex!==K.edgeIndex||pe.segmentIndex!==K.segmentIndex),{edgeIndex:ce.edgeIndex,segmentIndex:ce.segmentIndex,from:ce.from,to:ce.to}],ne.segments=[...ne.segments.filter(pe=>pe.edgeIndex!==ce.edgeIndex||pe.segmentIndex!==ce.segmentIndex),{edgeIndex:K.edgeIndex,segmentIndex:K.segmentIndex,from:K.from,to:K.to}],!0):!1},"trySwapSegmentsAcrossTracks"),Q=C(K=>{const ce=K.tracks.length;return K.tracks[ce]={index:ce,coord:K.coord,segments:[]},ce},"createNewTrack"),G=C((K,ce)=>{const be=K.pipe.tracks[K.trackIndex];be.segments=be.segments.filter(j=>j.edgeIndex!==K.edgeIndex||j.segmentIndex!==K.segmentIndex),K.trackIndex=ce,K.pipe.tracks[ce].segments.push({edgeIndex:K.edgeIndex,segmentIndex:K.segmentIndex,from:K.from,to:K.to})},"moveSegmentToTrack"),X=C((K,ce)=>{const be=m[K.edgeIndex];for(const ne of be){const j=g[ne];j.pipe===K.pipe&&G(j,ce)}},"moveSegmentChainToTrack"),Y=C(K=>{const ce=m[K.edgeIndex],be=ce.indexOf(g.indexOf(K)),ne=[];return be>0&&ne.push(g[ce[be-1]]),be{if(K.orientation===ce.orientation)return!1;const be=K.orientation==="horizontal"?K:ce,ne=K.orientation==="horizontal"?ce:K;return ne.pipe.coord>be.from&&ne.pipe.coordne.from&&be.pipe.coord{for(const be of K.tracks)if(!be.segments.some(j=>(j.edgeIndex!==ce.edgeIndex||j.segmentIndex!==ce.segmentIndex)&&z(j,ce)))return be.index;return-1},"findAvailableTrack"),Z=C((K,ce)=>{if(K.trackIndex===ce.trackIndex)return z(K,ce);const be=Y(K),ne=Y(ce);return be.some(j=>ne.some(ie=>le(j,ie)))},"segmentsConflict"),ee=C((K,ce,be)=>{if(U(K,ce,K.pipe.tracks[K.trackIndex],ce.pipe.tracks[ce.trackIndex]))return;const ne=q(K.pipe,ce);be(ce,ne!==-1?ne:Q(K.pipe))},"resolveTrackConflict"),re=C(K=>{let ce=0;for(let be=0;be{if(ve.has(K))return ve.get(K);const ce=m[K];if(ce.length===0){const te={dest:0,deviation:0,base:0,delta:0};return ve.set(K,te),te}const ne=g[ce[0]].pipe.coord;let j=ne;for(let te=1;teMath.abs(_e-ne)?oe:_e;break}}const ie=Math.abs(j-ne),pe={dest:j,deviation:ie,base:ne,delta:j-ne};return ve.set(K,pe),pe},"getDestInfo"),Ce=C(()=>{let K=0;const ce=new Map;for(const[ne,j]of i.entries())m[ne].length!==0&&j.start&&(ce.has(j.start)||ce.set(j.start,[]),ce.get(j.start).push(ne));const be=C(ne=>{const j=i[ne];if(!j.start||!j.end)return 0;const ie=a.get(j.start),pe=a.get(j.end);if(!ie||!pe)return 0;const te=(pe.x??0)-(ie.x??0),ye=(pe.y??0)-(ie.y??0);return Math.abs(te)+Math.abs(ye)},"getEdgeDistance");for(const ne of ce.values()){ne.sort((ie,pe)=>{const te=ae(ie),ye=ae(pe);if(Math.abs(te.deviation-ye.deviation)>1)return te.deviation-ye.deviation;if(Math.abs(te.dest-ye.dest)>1)return te.dest-ye.dest;const oe=be(ie),_e=be(pe);if(Math.abs(oe-_e)>1)return _e-oe;const Le=m[ie].length,Ye=m[pe].length;if(Le!==Ye)return Le-Ye;if(Le===1){const Pe=m[ie][0],Xe=m[pe][0];if(g[Pe]&&g[Xe]){const Ne=g[Pe],Ze=g[Xe],Ge=Math.abs(Ne.to-Ne.from),lt=Math.abs(Ze.to-Ze.from);if(Math.abs(Ge-lt)>1)return Ge-lt}}return 0});const j=ne.map(ie=>g[m[ie][0]]);K+=re(j)}return K},"fixSourceHandleCrossings"),Oe=C(()=>{let K=0;const ce=new Map;for(const[be,ne]of i.entries())m[be].length!==0&&ne.end&&(ce.has(ne.end)||ce.set(ne.end,[]),ce.get(ne.end).push(be));for(const be of ce.values()){be.sort((j,ie)=>{const pe=C(oe=>{const _e=m[oe];if(_e.length<2)return 0;const Le=g[_e[_e.length-2]];return Math.abs(Le.to-Le.from)},"getDist"),te=pe(j),ye=pe(ie);return Math.abs(te-ye)>.1?te-ye:j-ie});const ne=be.map(j=>g[m[j][m[j].length-1]]);K+=re(ne)}return K},"fixTargetHandleCrossings"),$e=C(()=>{let K=0;for(const ce of o){const be=[];for(const ne of ce.tracks)for(const j of ne.segments){const ie=m[j.edgeIndex].find(pe=>g[pe].segmentIndex===j.segmentIndex);ie!==void 0&&be.push(g[ie])}be.sort((ne,j)=>ne.edgeIndex-j.edgeIndex||ne.segmentIndex-j.segmentIndex);for(let ne=0;ne{ne.segments.forEach(j=>{ce.push({edgeIndex:j.edgeIndex,segmentIndex:j.segmentIndex,trackIndex:ne.index,from:j.from,to:j.to})})}),ce.sort((ne,j)=>ne.from-j.from);const be=[];if(ce.length>0){let ne=[ce[0]],j=ce[0].to;for(let ie=1;iej.add(Pe.trackIndex));const ie=new Map;ne.forEach(Pe=>{const Xe=ae(Pe.edgeIndex);ie.set(Pe.trackIndex,(ie.get(Pe.trackIndex)??0)+Xe.delta)});const pe=[...j].filter(Pe=>(ie.get(Pe)??0)<-1),te=[...j].filter(Pe=>(ie.get(Pe)??0)>1),ye=[...j].filter(Pe=>Math.abs(ie.get(Pe)??0)<=1);pe.sort((Pe,Xe)=>(ie.get(Xe)??0)-(ie.get(Pe)??0)),te.sort((Pe,Xe)=>(ie.get(Pe)??0)-(ie.get(Xe)??0));const oe=C((Pe,Xe)=>{ne.filter(Ne=>Ne.trackIndex===Pe).forEach(Ne=>{const Ze=v.has(Ne.edgeIndex)?K.coord:Xe;Se.set(`${Ne.edgeIndex}-${Ne.segmentIndex}`,Ze)})},"assignCoord");let _e=0;for(const Pe of pe)_e++,oe(Pe,K.coord-_e*eCe);if(ye.length===0&&j.size>0){const Pe=[...j].sort((Ze,Ge)=>Math.abs(ie.get(Ze)??0)-Math.abs(ie.get(Ge)??0))[0],Xe=pe.indexOf(Pe);Xe!==-1&&pe.splice(Xe,1);const Ne=te.indexOf(Pe);Ne!==-1&&te.splice(Ne,1),ye.push(Pe)}let Le=0;for(const Pe of ye){if(Le===0)oe(Pe,K.coord);else{const Xe=Le%2===1?1:-1,Ne=Math.ceil(Le/2);oe(Pe,K.coord+Xe*Ne*eCe*.5)}Le++}let Ye=0;for(const Pe of te)Ye++,oe(Pe,K.coord+Ye*eCe)}}for(const[K,ce]of i.entries()){const be=m[K]??[];if(be.length===0)continue;const ne=[],j=a.get(ce.start),ie=a.get(ce.end),{pSrcPort:pe,pDstPort:te}=V(K,j,ie),ye=be.map(Le=>{const Ye=g[Le],Pe=Se.get(`${Ye.edgeIndex}-${Ye.segmentIndex}`)??Ye.pipe.coord;return{orient:Ye.orientation,coord:Pe,from:Ye.from,to:Ye.to}});ne.push(pe);for(let Le=0;LeJn&&ne.push(bC(Ye,Xe)),Ge&&Ze.orient===Ye.orient)if(Math.abs(Ye.coord-Ze.coord)>Jn){const lt=Ye.orient==="vertical"?(Xe+Ze.from)/2:rCe(Ye,Ze);ne.push(bC(Ye,lt),bC(Ze,lt))}else(Le===0||Le===ye.length-2)&&ne.push(bC(Ye,rCe(Ye,Ze)));else if(Ge)ne.push(bC(Ye,Ze.coord));else{const lt=Math.abs(Ye.from-Xe)Jn||Math.abs(oe.y-te.y)>Jn)&&ne.push(te);const _e=[];ne.length>0&&_e.push(ne[0]);for(let Le=1;LeJn||Math.abs(Ye.y-Pe.y)>Jn)&&_e.push(Ye)}ce.points=_e}for(const K of i){const ce=K.__originalEdge;ce&&K.points&&(ce.points=K.points)}t.edges=(t.edges??[]).filter(K=>!K.isLayoutOnly);const ge=C((K,ce)=>{const be=ce.x??0,ne=ce.y??0,j=ce.width??0,ie=ce.height??0;if(j<=0||ie<=0)return K;const pe=be-j/2,te=be+j/2,ye=ne-ie/2,oe=ne+ie/2;if(K.xte||K.yoe)return K;const _e=K.x-pe,Le=te-K.x,Ye=K.y-ye,Pe=oe-K.y,Xe=Math.min(_e,Le,Ye,Pe);return Xe===_e?{x:pe,y:K.y}:Xe===Le?{x:te,y:K.y}:Xe===Ye?{x:K.x,y:ye}:{x:K.x,y:oe}},"nodeBoundaryClamp");for(const K of t.edges){const ce=K.points;if(!ce||ce.length<2)continue;const be=K.start,ne=K.end,j=be?a.get(be):void 0,ie=ne?a.get(ne):void 0;j&&(ce[0]=ge(ce[0],j)),ie&&(ce[ce.length-1]=ge(ce[ce.length-1],ie))}return t}C(GDt,"routeEdgesOrthogonal");function HDt(t){return t.direction??"TB"}C(HDt,"getSwimlaneDirection");function WDt(t){var h,d,f,p,g;const e=TRt(t),r=((h=t.config.flowchart)==null?void 0:h.nodeSpacing)??40,n=((d=t.config.flowchart)==null?void 0:d.rankSpacing)??100,i=((f=t.config.swimlane)==null?void 0:f.ignoreCrossLaneEdges)??!0,a=((p=t.config.swimlane)==null?void 0:p.optimizeRanksByCrossings)??!0,s=((g=t.config.swimlane)==null?void 0:g.automaticLaneOrdering)??!1,o=HDt(t),{ordered:l,coordinates:u}=QDt(e,{nodeGap:r,layerGap:n,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:a,automaticLaneOrdering:s,direction:o});CRt(e,l,u,{nodeGap:r,layerGap:n});for(const m of t.edges??[])delete m.points;GDt(t,o);for(const m of t.edges??[])(!m.curve||m.curve==="basis")&&(m.curve="rounded");return sDt(t,o),aDt(t),o}C(WDt,"runSwimlaneLayoutCore");async function YDt(t,e){const r=e.select("g");Pbe(r,t.markers,t.type,t.diagramId),Pxt(),Fxt(),nbt(),O3t(),SRt(t);const n=ORt(t);t.nodes=n.nodes,t.edges=n.edges;const{groups:i}=await oRt(r,t);WDt(t),await bRt(t,i)}C(YDt,"render");const _kn=Object.freeze(Object.defineProperty({__proto__:null,render:YDt},Symbol.toStringTag,{value:"Module"}));function nCe(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return s=l.done,l},e:function(l){o=!0,a=l},f:function(){try{s||r.return==null||r.return()}finally{if(o)throw a}}}}function qDt(t,e,r){return(e=jDt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Mkn(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Ikn(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,s,o=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(h){u=!0,i=h}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function Pkn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nkn(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $o(t,e){return Rkn(t)||Ikn(t,e)||iCe(t,e)||Pkn()}function xJ(t){return Dkn(t)||Mkn(t)||iCe(t)||Nkn()}function Bkn(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function jDt(t){var e=Bkn(t,"string");return typeof e=="symbol"?e:e+""}function rl(t){"@babel/helpers - typeof";return rl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rl(t)}function iCe(t,e){if(t){if(typeof t=="string")return nCe(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?nCe(t,e):void 0}}var nl=typeof window>"u"?null:window,XDt=nl?nl.navigator:null;nl&&nl.document;var $kn=rl(""),KDt=rl({}),Fkn=rl(function(){}),zkn=typeof HTMLElement>"u"?"undefined":rl(HTMLElement),o9=function(e){return e&&e.instanceString&&Cs(e.instanceString)?e.instanceString():null},Wr=function(e){return e!=null&&rl(e)==$kn},Cs=function(e){return e!=null&&rl(e)===Fkn},Oa=function(e){return!ef(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Mi=function(e){return e!=null&&rl(e)===KDt&&!Oa(e)&&e.constructor===Object},Ukn=function(e){return e!=null&&rl(e)===KDt},or=function(e){return e!=null&&rl(e)===rl(1)&&!isNaN(e)},ZDt=function(e){return or(e)&&Math.floor(e)===e},wJ=function(e){if(zkn!=="undefined")return e!=null&&e instanceof HTMLElement},ef=function(e){return l9(e)||JDt(e)},l9=function(e){return o9(e)==="collection"&&e._private.single},JDt=function(e){return o9(e)==="collection"&&!e._private.single},aCe=function(e){return o9(e)==="core"},eLt=function(e){return o9(e)==="stylesheet"},Vkn=function(e){return o9(e)==="event"},D2=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},Qkn=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},Gkn=function(e){return Mi(e)&&or(e.x1)&&or(e.x2)&&or(e.y1)&&or(e.y2)},Hkn=function(e){return Ukn(e)&&Cs(e.then)},Wkn=function(){return XDt&&XDt.userAgent.match(/msie|trident|edge/i)},f3=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var a=[],s=0;sr?1:0},Jkn=function(e,r){return-1*nLt(e,r)},sn=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r1&&(v-=1),v<1/6?g+(m-g)*6*v:v<1/2?m:v<2/3?g+(m-g)*(2/3-v)*6:g}var d=new RegExp("^"+jkn+"$").exec(e);if(d){if(n=parseInt(d[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,i=parseFloat(d[2]),i<0||i>100||(i=i/100,a=parseFloat(d[3]),a<0||a>100)||(a=a/100,s=d[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(i===0)o=l=u=Math.round(a*255);else{var f=a<.5?a*(1+i):a+i-a*i,p=2*a-f;o=Math.round(255*h(p,f,n+1/3)),l=Math.round(255*h(p,f,n)),u=Math.round(255*h(p,f,n-1/3))}r=[o,l,u,s]}return r},rEn=function(e){var r,n=new RegExp("^"+Ykn+"$").exec(e);if(n){r=[];for(var i=[],a=1;a<=3;a++){var s=n[a];if(s[s.length-1]==="%"&&(i[a]=!0),s=parseFloat(s),i[a]&&(s=s/100*255),s<0||s>255)return;r.push(Math.floor(s))}var o=i[1]||i[2]||i[3],l=i[1]&&i[2]&&i[3];if(o&&!l)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},nEn=function(e){return iEn[e.toLowerCase()]},iLt=function(e){return(Oa(e)?e:null)||nEn(e)||eEn(e)||rEn(e)||tEn(e)},iEn={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},aLt=function(e){for(var r=e.map,n=e.keys,i=n.length,a=0;a=l||R<0||b&&D>=f}function O(){var L=e();if(S(L))return k(L);g=setTimeout(O,T(L))}function k(L){return g=void 0,x&&h?w(L):(h=d=void 0,p)}function E(){g!==void 0&&clearTimeout(g),v=0,h=m=d=g=void 0}function _(){return g===void 0?p:k(e())}function I(){var L=e(),R=S(L);if(h=arguments,d=this,m=L,R){if(g===void 0)return A(m);if(b)return clearTimeout(g),g=setTimeout(O,l),w(m)}return g===void 0&&(g=setTimeout(O,l)),p}return I.cancel=E,I.flush=_,I}return wCe=s,wCe}var pEn=fEn(),d9=c9(pEn),ACe=nl?nl.performance:null,ALt=ACe&&ACe.now?function(){return ACe.now()}:function(){return Date.now()},gEn=function(){if(nl){if(nl.requestAnimationFrame)return function(t){nl.requestAnimationFrame(t)};if(nl.mozRequestAnimationFrame)return function(t){nl.mozRequestAnimationFrame(t)};if(nl.webkitRequestAnimationFrame)return function(t){nl.webkitRequestAnimationFrame(t)};if(nl.msRequestAnimationFrame)return function(t){nl.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(ALt())},1e3/60)}}(),CJ=function(e){return gEn(e)},A1=ALt,xC=9261,TLt=65599,p3=5381,SLt=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xC,n=r,i;i=e.next(),!i.done;)n=n*TLt+i.value|0;return n},f9=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xC;return r*TLt+e|0},p9=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p3;return(r<<5)+r+e|0},mEn=function(e,r){return e*2097152+r},M2=function(e){return e[0]*2097152+e[1]},OJ=function(e,r){return[f9(e[0],r[0]),p9(e[1],r[1])]},CLt=function(e,r){var n={value:0,done:!1},i=0,a=e.length,s={next:function(){return i=0;i--)e[i]===r&&e.splice(i,1)},CCe=function(e){e.splice(0,e.length)},OEn=function(e,r){for(var n=0;n"u"?"undefined":rl(Set))!==EEn?Set:_En,EJ=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!aCe(e)){vs("An element must have a core reference and parameters set");return}var i=r.group;if(i==null&&(r.data&&r.data.source!=null&&r.data.target!=null?i="edges":i="nodes"),i!=="nodes"&&i!=="edges"){vs("An element must be of type `nodes` or `edges`; you specified `"+i+"`");return}this.length=1,this[0]=this;var a=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:i,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?i==="edges":!!r.pannable,active:!1,classes:new g3,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(a.position.x==null&&(a.position.x=0),a.position.y==null&&(a.position.y=0),r.renderedPosition){var s=r.renderedPosition,o=e.pan(),l=e.zoom();a.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];Oa(r.classes)?u=r.classes:Wr(r.classes)&&(u=r.classes.split(/\s+/));for(var h=0,d=u.length;hb?1:0},h=function(y,b,x,w,A){var T;if(x==null&&(x=0),A==null&&(A=n),x<0)throw new Error("lo must be non-negative");for(w==null&&(w=y.length);xE;0<=E?k++:k--)O.push(k);return O}).apply(this).reverse(),S=[],w=0,A=T.length;w_;0<=_?++O:--O)I.push(s(y,x));return I},m=function(y,b,x,w){var A,T,S;for(w==null&&(w=n),A=y[x];x>b;){if(S=x-1>>1,T=y[S],w(A,T)<0){y[x]=T,x=S;continue}break}return y[x]=A},v=function(y,b,x){var w,A,T,S,O;for(x==null&&(x=n),A=y.length,O=b,T=y[b],w=2*b+1;w0;){var T=b.pop(),S=v(T),O=T.id();if(f[O]=S,S!==1/0)for(var k=T.neighborhood().intersect(g),E=0;E0)for(N.unshift(P);d[B];){var V=d[B];N.unshift(V.edge),N.unshift(V.node),F=V.node,B=F.id()}return o.spawn(N)}}}},NEn={kruskal:function(e){e=e||function(x){return 1};for(var r=this.byGroup(),n=r.nodes,i=r.edges,a=n.length,s=new Array(a),o=n,l=function(w){for(var A=0;A0;){if(A(),S++,w===h){for(var O=[],k=a,E=h,_=y[E];O.unshift(k),_!=null&&O.unshift(_),k=v[E],k!=null;)E=k.id(),_=y[E];return{found:!0,distance:d[w],path:this.spawn(O),steps:S}}p[w]=!0;for(var I=x._private.edges,L=0;L_&&(g[E]=_,b[E]=k,x[E]=A),!a){var I=k*h+O;!a&&g[I]>_&&(g[I]=_,b[I]=O,x[I]=A)}}}for(var L=0;L1&&arguments[1]!==void 0?arguments[1]:s,Te=x(he),ge=[],Qe=Te;;){if(Qe==null)return r.spawn();var Se=b(Qe),De=Se.edge,qe=Se.pred;if(ge.unshift(Qe[0]),Qe.same(fe)&&ge.length>0)break;De!=null&&ge.unshift(De),Qe=qe}return l.spawn(ge)},T=0;T=0;h--){var d=u[h],f=d[1],p=d[2];(r[f]===o&&r[p]===l||r[f]===l&&r[p]===o)&&u.splice(h,1)}for(var g=0;gi;){var a=Math.floor(Math.random()*r.length);r=GEn(a,e,r),n--}return r},HEn={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,i=r.edges;i.unmergeBy(function(N){return N.isLoop()});var a=n.length,s=i.length,o=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),l=Math.floor(a/QEn);if(a<2){vs("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],h=0;h1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=1/0,a=r;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=-1/0,a=r;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=0,a=0,s=r;s1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;i?e=e.slice(r,n):(n0&&e.splice(0,r));for(var o=0,l=e.length-1;l>=0;l--){var u=e[l];s?isFinite(u)||(e[l]=-1/0,o++):e.splice(l,1)}a&&e.sort(function(f,p){return f-p});var h=e.length,d=Math.floor(h/2);return h%2!==0?e[d+1+o]:(e[d-1+o]+e[d+o])/2},BLt=function(e,r){return r===0?e:BLt(r,e%r)},KEn=function(e){for(var r=e[0],n=0;n0&&(r=BLt(r,e[n]));else return 0;return r},ZEn=function(e){return Math.PI*e/180},DJ=function(e,r){return Math.atan2(r,e)-Math.PI/2},_Ce=Math.log2||function(t){return Math.log(t)/Math.log(2)},RCe=function(e){return e>0?1:e<0?-1:0},AC=function(e,r){return Math.sqrt(TC(e,r))},TC=function(e,r){var n=r.x-e.x,i=r.y-e.y;return n*n+i*i},JEn=function(e){for(var r=e.length,n=0,i=0;i=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},t_n=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},r_n=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},n_n=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},$Lt=function(e,r,n){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},LJ=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},MJ=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,i,a,s;if(r.length===1)n=i=a=s=r[0];else if(r.length===2)n=a=r[0],s=i=r[1];else if(r.length===4){var o=$o(r,4);n=o[0],i=o[1],a=o[2],s=o[3]}return e.x1-=s,e.x2+=i,e.y1-=n,e.y2+=a,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},FLt=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},DCe=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2r.y2||r.y1>e.y2)},P2=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},zLt=function(e,r){return P2(e,r.x,r.y)},ULt=function(e,r){return P2(e,r.x1,r.y1)&&P2(e,r.x2,r.y2)},i_n=(ECe=Math.hypot)!==null&&ECe!==void 0?ECe:function(t,e){return Math.sqrt(t*t+e*e)};function a_n(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(O,k){return{x:O.x+k.x,y:O.y+k.y}},n=function(O,k){return{x:O.x-k.x,y:O.y-k.y}},i=function(O,k){return{x:O.x*k,y:O.y*k}},a=function(O,k){return O.x*k.y-O.y*k.x},s=function(O){var k=i_n(O.x,O.y);return k===0?{x:0,y:0}:{x:O.x/k,y:O.y/k}},o=function(O){for(var k=0,E=0;E7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?B2(a,s):l,h=a/2,d=s/2;u=Math.min(u,h,d);var f=u!==h,p=u!==d,g;if(f){var m=n-h+u-o,v=i-d-o,y=n+h-u+o,b=v;if(g=N2(e,r,n,i,m,v,y,b,!1),g.length>0)return g}if(p){var x=n+h+o,w=i-d+u-o,A=x,T=i+d-u+o;if(g=N2(e,r,n,i,x,w,A,T,!1),g.length>0)return g}if(f){var S=n-h+u-o,O=i+d+o,k=n+h-u+o,E=O;if(g=N2(e,r,n,i,S,O,k,E,!1),g.length>0)return g}if(p){var _=n-h-o,I=i-d+u-o,L=_,R=i+d-u+o;if(g=N2(e,r,n,i,_,I,L,R,!1),g.length>0)return g}var D;{var M=n-h+u,P=i-d+u;if(D=y9(e,r,n,i,M,P,u+o),D.length>0&&D[0]<=M&&D[1]<=P)return[D[0],D[1]]}{var N=n+h-u,F=i-d+u;if(D=y9(e,r,n,i,N,F,u+o),D.length>0&&D[0]>=N&&D[1]<=F)return[D[0],D[1]]}{var B=n+h-u,V=i+d-u;if(D=y9(e,r,n,i,B,V,u+o),D.length>0&&D[0]>=B&&D[1]>=V)return[D[0],D[1]]}{var z=n-h+u,U=i+d-u;if(D=y9(e,r,n,i,z,U,u+o),D.length>0&&D[0]<=z&&D[1]>=U)return[D[0],D[1]]}return[]},o_n=function(e,r,n,i,a,s,o){var l=o,u=Math.min(n,a),h=Math.max(n,a),d=Math.min(i,s),f=Math.max(i,s);return u-l<=e&&e<=h+l&&d-l<=r&&r<=f+l},l_n=function(e,r,n,i,a,s,o,l,u){var h={x1:Math.min(n,o,a)-u,x2:Math.max(n,o,a)+u,y1:Math.min(i,l,s)-u,y2:Math.max(i,l,s)+u};return!(eh.x2||rh.y2)},c_n=function(e,r,n,i){n-=i;var a=r*r-4*e*n;if(a<0)return[];var s=Math.sqrt(a),o=2*e,l=(-r+s)/o,u=(-r-s)/o;return[l,u]},u_n=function(e,r,n,i,a){var s=1e-5;e===0&&(e=s),r/=e,n/=e,i/=e;var o,l,u,h,d,f,p,g;if(l=(3*n-r*r)/9,u=-(27*i)+r*(9*n-2*(r*r)),u/=54,o=l*l*l+u*u,a[1]=0,p=r/3,o>0){d=u+Math.sqrt(o),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),f=u-Math.sqrt(o),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),a[0]=-p+d+f,p+=(d+f)/2,a[4]=a[2]=-p,p=Math.sqrt(3)*(-f+d)/2,a[3]=p,a[5]=-p;return}if(a[5]=a[3]=0,o===0){g=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),a[0]=-p+2*g,a[4]=a[2]=-(g+p);return}l=-l,h=l*l*l,h=Math.acos(u/Math.sqrt(h)),g=2*Math.sqrt(l),a[0]=-p+g*Math.cos(h/3),a[2]=-p+g*Math.cos((h+2*Math.PI)/3),a[4]=-p+g*Math.cos((h+4*Math.PI)/3)},h_n=function(e,r,n,i,a,s,o,l){var u=1*n*n-4*n*a+2*n*o+4*a*a-4*a*o+o*o+i*i-4*i*s+2*i*l+4*s*s-4*s*l+l*l,h=1*9*n*a-3*n*n-3*n*o-6*a*a+3*a*o+9*i*s-3*i*i-3*i*l-6*s*s+3*s*l,d=1*3*n*n-6*n*a+n*o-n*e+2*a*a+2*a*e-o*e+3*i*i-6*i*s+i*l-i*r+2*s*s+2*s*r-l*r,f=1*n*a-n*n+n*e-a*e+i*s-i*i+i*r-s*r,p=[];u_n(u,h,d,f,p);for(var g=1e-7,m=[],v=0;v<6;v+=2)Math.abs(p[v+1])=0&&p[v]<=1&&m.push(p[v]);m.push(1),m.push(0);for(var y=-1,b,x,w,A=0;A=0?wu?(e-a)*(e-a)+(r-s)*(r-s):h-f},Hh=function(e,r,n){for(var i,a,s,o,l,u=0,h=0;h=e&&e>=s||i<=e&&e<=s)l=(e-i)/(s-i)*(o-a)+a,l>r&&u++;else continue;return u%2!==0},S1=function(e,r,n,i,a,s,o,l,u){var h=new Array(n.length),d;l[0]!=null?(d=Math.atan(l[1]/l[0]),l[0]<0?d=d+Math.PI/2:d=-d-Math.PI/2):d=l;for(var f=Math.cos(-d),p=Math.sin(-d),g=0;g0){var v=PJ(h,-u);m=IJ(v)}else m=h;return Hh(e,r,m)},f_n=function(e,r,n,i,a,s,o,l){for(var u=new Array(n.length*2),h=0;h=0&&v<=1&&b.push(v),y>=0&&y<=1&&b.push(y),b.length===0)return[];var x=b[0]*l[0]+e,w=b[0]*l[1]+r;if(b.length>1){if(b[0]==b[1])return[x,w];var A=b[1]*l[0]+e,T=b[1]*l[1]+r;return[x,w,A,T]}else return[x,w]},LCe=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},N2=function(e,r,n,i,a,s,o,l,u){var h=e-a,d=n-e,f=o-a,p=r-s,g=i-r,m=l-s,v=f*p-m*h,y=d*p-g*h,b=m*d-f*g;if(b!==0){var x=v/b,w=y/b,A=.001,T=0-A,S=1+A;return T<=x&&x<=S&&T<=w&&w<=S?[e+x*d,r+x*g]:u?[e+x*d,r+x*g]:[]}else return v===0||y===0?LCe(e,n,o)===o?[o,l]:LCe(e,n,a)===a?[a,s]:LCe(a,o,n)===n?[n,i]:[]:[]},g_n=function(e,r,n,i,a){var s=[],o=i/2,l=a/2,u=r,h=n;s.push({x:u+o*e[0],y:h+l*e[1]});for(var d=1;d0){var m=PJ(d,-l);p=IJ(m)}else p=d}else p=n;for(var v,y,b,x,w=0;w2){for(var g=[h[0],h[1]],m=Math.pow(g[0]-e,2)+Math.pow(g[1]-r,2),v=1;vh&&(h=w)},get:function(x){return u[x]}},f=0;f0?D=R.edgesTo(L)[0]:D=L.edgesTo(R)[0];var M=i(D);L=L.id(),S[L]>S[_]+M&&(S[L]=S[_]+M,O.nodes.indexOf(L)<0?O.push(L):O.updateItem(L),T[L]=0,A[L]=[]),S[L]==S[_]+M&&(T[L]=T[L]+T[_],A[L].push(_))}else for(var P=0;P0;){for(var V=w.pop(),z=0;z0&&o.push(n[l]);o.length!==0&&a.push(i.collection(o))}return a},R_n=function(e,r){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:M_n,o=i,l,u,h=0;h=2?x9(e,r,n,0,KLt,I_n):x9(e,r,n,0,XLt)},squaredEuclidean:function(e,r,n){return x9(e,r,n,0,KLt)},manhattan:function(e,r,n){return x9(e,r,n,0,XLt)},max:function(e,r,n){return x9(e,r,n,-1/0,P_n)}};x3["squared-euclidean"]=x3.squaredEuclidean,x3.squaredeuclidean=x3.squaredEuclidean;function BJ(t,e,r,n,i,a){var s;return Cs(t)?s=t:s=x3[t]||x3.euclidean,e===0&&Cs(t)?s(i,a):s(e,r,n,i,a)}var N_n=pc({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),$Ce=function(e){return N_n(e)},$J=function(e,r,n,i,a){var s=a!=="kMedoids",o=s?function(d){return n[d]}:function(d){return i[d](n)},l=function(f){return i[f](r)},u=n,h=r;return BJ(e,i.length,o,l,u,h)},FCe=function(e,r,n){for(var i=n.length,a=new Array(i),s=new Array(i),o=new Array(r),l=null,u=0;un)return!1}return!0},F_n=function(e,r,n){for(var i=0;io&&(o=r[u][h],l=h);a[l].push(e[u])}for(var d=0;d=a.threshold||a.mode==="dendrogram"&&e.length===1)return!1;var g=r[s],m=r[i[s]],v;a.mode==="dendrogram"?v={left:g,right:m,key:g.key}:v={value:g.value.concat(m.value),key:g.key},e[g.index]=v,e.splice(m.index,1),r[g.key]=v;for(var y=0;yn[m.key][b.key]&&(l=n[m.key][b.key])):a.linkage==="max"?(l=n[g.key][b.key],n[g.key][b.key]0&&i.push(a);return i},aMt=function(e,r,n){for(var i=[],a=0;ao&&(s=u,o=r[a*e+u])}s>0&&i.push(s)}for(var h=0;hu&&(l=h,u=d)}n[a]=s[l]}return i=aMt(e,r,n),i},sMt=function(e){for(var r=this.cy(),n=this.nodes(),i=K_n(e),a={},s=0;s=_?(I=_,_=R,L=D):R>I&&(I=R);for(var M=0;M0?1:0;S[k%i.minIterations*o+z]=U,V+=U}if(V>0&&(k>=i.minIterations-1||k==i.maxIterations-1)){for(var Q=0,G=0;G1||T>1)&&(o=!0),d[x]=[],b.outgoers().forEach(function(O){O.isEdge()&&d[x].push(O.id())})}else f[x]=[void 0,b.target().id()]}):s.forEach(function(b){var x=b.id();if(b.isNode()){var w=b.degree(!0);w%2&&(l?u?o=!0:u=x:l=x),d[x]=[],b.connectedEdges().forEach(function(A){return d[x].push(A.id())})}else f[x]=[b.source().id(),b.target().id()]});var p={found:!1,trail:void 0};if(o)return p;if(u&&l)if(a){if(h&&u!=h)return p;h=u}else{if(h&&u!=h&&l!=h)return p;h||(h=u)}else h||(h=s[0].id());var g=function(x){for(var w=x,A=[x],T,S,O;d[w].length;)T=d[w].shift(),S=f[T][0],O=f[T][1],w!=O?(d[O]=d[O].filter(function(k){return k!=T}),w=O):!a&&w!=S&&(d[S]=d[S].filter(function(k){return k!=T}),w=S),A.unshift(T),A.unshift(w);return A},m=[],v=[];for(v=g(h);v.length!=1;)d[v[0]].length==0?(m.unshift(s.getElementById(v.shift())),m.unshift(s.getElementById(v.shift()))):v=g(v.shift()).concat(v);m.unshift(s.getElementById(v.shift()));for(var y in d)if(d[y].length)return p;return p.found=!0,p.trail=this.spawn(m,!0),p}},FJ=function(){var e=this,r={},n=0,i=0,a=[],s=[],o={},l=function(f,p){for(var g=s.length-1,m=[],v=e.spawn();s[g].x!=f||s[g].y!=p;)m.push(s.pop().edge),g--;m.push(s.pop().edge),m.forEach(function(y){var b=y.connectedNodes().intersection(e);v.merge(y),b.forEach(function(x){var w=x.id(),A=x.connectedEdges().intersection(e);v.merge(x),r[w].cutVertex?v.merge(A.filter(function(T){return T.isLoop()})):v.merge(A)})}),a.push(v)},u=function(f,p,g){f===g&&(i+=1),r[p]={id:n,low:n++,cutVertex:!1};var m=e.getElementById(p).connectedEdges().intersection(e);if(m.size()===0)a.push(e.spawn(e.getElementById(p)));else{var v,y,b,x;m.forEach(function(w){v=w.source().id(),y=w.target().id(),b=v===p?y:v,b!==g&&(x=w.id(),o[x]||(o[x]=!0,s.push({x:p,y:b,edge:w})),b in r?r[p].low=Math.min(r[p].low,r[b].id):(u(f,b,p),r[p].low=Math.min(r[p].low,r[b].low),r[p].id<=r[b].low&&(r[p].cutVertex=!0,l(p,b))))})}};e.forEach(function(d){if(d.isNode()){var f=d.id();f in r||(i=0,u(f,f),r[f].cutVertex=i>1)}});var h=Object.keys(r).filter(function(d){return r[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(h),components:a}},a5n={hopcroftTarjanBiconnected:FJ,htbc:FJ,htb:FJ,hopcroftTarjanBiconnectedComponents:FJ},zJ=function(){var e=this,r={},n=0,i=[],a=[],s=e.spawn(e),o=function(u){a.push(u),r[u]={index:n,low:n++,explored:!1};var h=e.getElementById(u).connectedEdges().intersection(e);if(h.forEach(function(m){var v=m.target().id();v!==u&&(v in r||o(v),r[v].explored||(r[u].low=Math.min(r[u].low,r[v].low)))}),r[u].index===r[u].low){for(var d=e.spawn();;){var f=a.pop();if(d.merge(e.getElementById(f)),r[f].low=r[u].index,r[f].explored=!0,f===u)break}var p=d.edgesWith(d),g=d.merge(p);i.push(g),s=s.difference(g)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in r||o(u)}}),{cut:s,components:i}},s5n={tarjanStronglyConnected:zJ,tsc:zJ,tscc:zJ,tarjanStronglyConnectedComponents:zJ},oMt={};[g9,PEn,NEn,$En,zEn,VEn,HEn,b_n,y3,b3,BCe,L_n,H_n,j_n,r5n,i5n,a5n,s5n].forEach(function(t){sn(oMt,t)});/*! +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $o(t,e){return Rkn(t)||Ikn(t,e)||iCe(t,e)||Pkn()}function xJ(t){return Dkn(t)||Mkn(t)||iCe(t)||Nkn()}function Bkn(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function jDt(t){var e=Bkn(t,"string");return typeof e=="symbol"?e:e+""}function rl(t){"@babel/helpers - typeof";return rl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rl(t)}function iCe(t,e){if(t){if(typeof t=="string")return nCe(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?nCe(t,e):void 0}}var nl=typeof window>"u"?null:window,XDt=nl?nl.navigator:null;nl&&nl.document;var $kn=rl(""),KDt=rl({}),Fkn=rl(function(){}),zkn=typeof HTMLElement>"u"?"undefined":rl(HTMLElement),o9=function(e){return e&&e.instanceString&&Cs(e.instanceString)?e.instanceString():null},Wr=function(e){return e!=null&&rl(e)==$kn},Cs=function(e){return e!=null&&rl(e)===Fkn},Oa=function(e){return!ef(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Mi=function(e){return e!=null&&rl(e)===KDt&&!Oa(e)&&e.constructor===Object},Ukn=function(e){return e!=null&&rl(e)===KDt},or=function(e){return e!=null&&rl(e)===rl(1)&&!isNaN(e)},ZDt=function(e){return or(e)&&Math.floor(e)===e},wJ=function(e){if(zkn!=="undefined")return e!=null&&e instanceof HTMLElement},ef=function(e){return l9(e)||JDt(e)},l9=function(e){return o9(e)==="collection"&&e._private.single},JDt=function(e){return o9(e)==="collection"&&!e._private.single},aCe=function(e){return o9(e)==="core"},eLt=function(e){return o9(e)==="stylesheet"},Vkn=function(e){return o9(e)==="event"},D2=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},Qkn=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},Gkn=function(e){return Mi(e)&&or(e.x1)&&or(e.x2)&&or(e.y1)&&or(e.y2)},Hkn=function(e){return Ukn(e)&&Cs(e.then)},Wkn=function(){return XDt&&XDt.userAgent.match(/msie|trident|edge/i)},f3=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var a=[],s=0;sr?1:0},Jkn=function(e,r){return-1*nLt(e,r)},sn=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r1&&(v-=1),v<1/6?g+(m-g)*6*v:v<1/2?m:v<2/3?g+(m-g)*(2/3-v)*6:g}var d=new RegExp("^"+jkn+"$").exec(e);if(d){if(n=parseInt(d[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,i=parseFloat(d[2]),i<0||i>100||(i=i/100,a=parseFloat(d[3]),a<0||a>100)||(a=a/100,s=d[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(i===0)o=l=u=Math.round(a*255);else{var f=a<.5?a*(1+i):a+i-a*i,p=2*a-f;o=Math.round(255*h(p,f,n+1/3)),l=Math.round(255*h(p,f,n)),u=Math.round(255*h(p,f,n-1/3))}r=[o,l,u,s]}return r},rEn=function(e){var r,n=new RegExp("^"+Ykn+"$").exec(e);if(n){r=[];for(var i=[],a=1;a<=3;a++){var s=n[a];if(s[s.length-1]==="%"&&(i[a]=!0),s=parseFloat(s),i[a]&&(s=s/100*255),s<0||s>255)return;r.push(Math.floor(s))}var o=i[1]||i[2]||i[3],l=i[1]&&i[2]&&i[3];if(o&&!l)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},nEn=function(e){return iEn[e.toLowerCase()]},iLt=function(e){return(Oa(e)?e:null)||nEn(e)||eEn(e)||rEn(e)||tEn(e)},iEn={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},aLt=function(e){for(var r=e.map,n=e.keys,i=n.length,a=0;a=l||R<0||b&&D>=f}function O(){var L=e();if(T(L))return k(L);g=setTimeout(O,S(L))}function k(L){return g=void 0,x&&h?w(L):(h=d=void 0,p)}function E(){g!==void 0&&clearTimeout(g),v=0,h=m=d=g=void 0}function _(){return g===void 0?p:k(e())}function I(){var L=e(),R=T(L);if(h=arguments,d=this,m=L,R){if(g===void 0)return A(m);if(b)return clearTimeout(g),g=setTimeout(O,l),w(m)}return g===void 0&&(g=setTimeout(O,l)),p}return I.cancel=E,I.flush=_,I}return wCe=s,wCe}var pEn=fEn(),d9=c9(pEn),ACe=nl?nl.performance:null,ALt=ACe&&ACe.now?function(){return ACe.now()}:function(){return Date.now()},gEn=function(){if(nl){if(nl.requestAnimationFrame)return function(t){nl.requestAnimationFrame(t)};if(nl.mozRequestAnimationFrame)return function(t){nl.mozRequestAnimationFrame(t)};if(nl.webkitRequestAnimationFrame)return function(t){nl.webkitRequestAnimationFrame(t)};if(nl.msRequestAnimationFrame)return function(t){nl.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(ALt())},1e3/60)}}(),CJ=function(e){return gEn(e)},A1=ALt,xC=9261,SLt=65599,p3=5381,TLt=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xC,n=r,i;i=e.next(),!i.done;)n=n*SLt+i.value|0;return n},f9=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xC;return r*SLt+e|0},p9=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p3;return(r<<5)+r+e|0},mEn=function(e,r){return e*2097152+r},M2=function(e){return e[0]*2097152+e[1]},OJ=function(e,r){return[f9(e[0],r[0]),p9(e[1],r[1])]},CLt=function(e,r){var n={value:0,done:!1},i=0,a=e.length,s={next:function(){return i=0;i--)e[i]===r&&e.splice(i,1)},CCe=function(e){e.splice(0,e.length)},OEn=function(e,r){for(var n=0;n"u"?"undefined":rl(Set))!==EEn?Set:_En,EJ=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!aCe(e)){vs("An element must have a core reference and parameters set");return}var i=r.group;if(i==null&&(r.data&&r.data.source!=null&&r.data.target!=null?i="edges":i="nodes"),i!=="nodes"&&i!=="edges"){vs("An element must be of type `nodes` or `edges`; you specified `"+i+"`");return}this.length=1,this[0]=this;var a=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:i,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?i==="edges":!!r.pannable,active:!1,classes:new g3,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(a.position.x==null&&(a.position.x=0),a.position.y==null&&(a.position.y=0),r.renderedPosition){var s=r.renderedPosition,o=e.pan(),l=e.zoom();a.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];Oa(r.classes)?u=r.classes:Wr(r.classes)&&(u=r.classes.split(/\s+/));for(var h=0,d=u.length;hb?1:0},h=function(y,b,x,w,A){var S;if(x==null&&(x=0),A==null&&(A=n),x<0)throw new Error("lo must be non-negative");for(w==null&&(w=y.length);xE;0<=E?k++:k--)O.push(k);return O}).apply(this).reverse(),T=[],w=0,A=S.length;w_;0<=_?++O:--O)I.push(s(y,x));return I},m=function(y,b,x,w){var A,S,T;for(w==null&&(w=n),A=y[x];x>b;){if(T=x-1>>1,S=y[T],w(A,S)<0){y[x]=S,x=T;continue}break}return y[x]=A},v=function(y,b,x){var w,A,S,T,O;for(x==null&&(x=n),A=y.length,O=b,S=y[b],w=2*b+1;w0;){var S=b.pop(),T=v(S),O=S.id();if(f[O]=T,T!==1/0)for(var k=S.neighborhood().intersect(g),E=0;E0)for(N.unshift(P);d[B];){var V=d[B];N.unshift(V.edge),N.unshift(V.node),F=V.node,B=F.id()}return o.spawn(N)}}}},NEn={kruskal:function(e){e=e||function(x){return 1};for(var r=this.byGroup(),n=r.nodes,i=r.edges,a=n.length,s=new Array(a),o=n,l=function(w){for(var A=0;A0;){if(A(),T++,w===h){for(var O=[],k=a,E=h,_=y[E];O.unshift(k),_!=null&&O.unshift(_),k=v[E],k!=null;)E=k.id(),_=y[E];return{found:!0,distance:d[w],path:this.spawn(O),steps:T}}p[w]=!0;for(var I=x._private.edges,L=0;L_&&(g[E]=_,b[E]=k,x[E]=A),!a){var I=k*h+O;!a&&g[I]>_&&(g[I]=_,b[I]=O,x[I]=A)}}}for(var L=0;L1&&arguments[1]!==void 0?arguments[1]:s,Se=x(he),ge=[],Qe=Se;;){if(Qe==null)return r.spawn();var Te=b(Qe),De=Te.edge,qe=Te.pred;if(ge.unshift(Qe[0]),Qe.same(fe)&&ge.length>0)break;De!=null&&ge.unshift(De),Qe=qe}return l.spawn(ge)},S=0;S=0;h--){var d=u[h],f=d[1],p=d[2];(r[f]===o&&r[p]===l||r[f]===l&&r[p]===o)&&u.splice(h,1)}for(var g=0;gi;){var a=Math.floor(Math.random()*r.length);r=GEn(a,e,r),n--}return r},HEn={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,i=r.edges;i.unmergeBy(function(N){return N.isLoop()});var a=n.length,s=i.length,o=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),l=Math.floor(a/QEn);if(a<2){vs("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],h=0;h1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=1/0,a=r;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=-1/0,a=r;a1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=0,a=0,s=r;s1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;i?e=e.slice(r,n):(n0&&e.splice(0,r));for(var o=0,l=e.length-1;l>=0;l--){var u=e[l];s?isFinite(u)||(e[l]=-1/0,o++):e.splice(l,1)}a&&e.sort(function(f,p){return f-p});var h=e.length,d=Math.floor(h/2);return h%2!==0?e[d+1+o]:(e[d-1+o]+e[d+o])/2},BLt=function(e,r){return r===0?e:BLt(r,e%r)},KEn=function(e){for(var r=e[0],n=0;n0&&(r=BLt(r,e[n]));else return 0;return r},ZEn=function(e){return Math.PI*e/180},DJ=function(e,r){return Math.atan2(r,e)-Math.PI/2},_Ce=Math.log2||function(t){return Math.log(t)/Math.log(2)},RCe=function(e){return e>0?1:e<0?-1:0},AC=function(e,r){return Math.sqrt(SC(e,r))},SC=function(e,r){var n=r.x-e.x,i=r.y-e.y;return n*n+i*i},JEn=function(e){for(var r=e.length,n=0,i=0;i=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},t_n=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},r_n=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},n_n=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},$Lt=function(e,r,n){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},LJ=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},MJ=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,i,a,s;if(r.length===1)n=i=a=s=r[0];else if(r.length===2)n=a=r[0],s=i=r[1];else if(r.length===4){var o=$o(r,4);n=o[0],i=o[1],a=o[2],s=o[3]}return e.x1-=s,e.x2+=i,e.y1-=n,e.y2+=a,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},FLt=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},DCe=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2r.y2||r.y1>e.y2)},P2=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},zLt=function(e,r){return P2(e,r.x,r.y)},ULt=function(e,r){return P2(e,r.x1,r.y1)&&P2(e,r.x2,r.y2)},i_n=(ECe=Math.hypot)!==null&&ECe!==void 0?ECe:function(t,e){return Math.sqrt(t*t+e*e)};function a_n(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(O,k){return{x:O.x+k.x,y:O.y+k.y}},n=function(O,k){return{x:O.x-k.x,y:O.y-k.y}},i=function(O,k){return{x:O.x*k,y:O.y*k}},a=function(O,k){return O.x*k.y-O.y*k.x},s=function(O){var k=i_n(O.x,O.y);return k===0?{x:0,y:0}:{x:O.x/k,y:O.y/k}},o=function(O){for(var k=0,E=0;E7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?B2(a,s):l,h=a/2,d=s/2;u=Math.min(u,h,d);var f=u!==h,p=u!==d,g;if(f){var m=n-h+u-o,v=i-d-o,y=n+h-u+o,b=v;if(g=N2(e,r,n,i,m,v,y,b,!1),g.length>0)return g}if(p){var x=n+h+o,w=i-d+u-o,A=x,S=i+d-u+o;if(g=N2(e,r,n,i,x,w,A,S,!1),g.length>0)return g}if(f){var T=n-h+u-o,O=i+d+o,k=n+h-u+o,E=O;if(g=N2(e,r,n,i,T,O,k,E,!1),g.length>0)return g}if(p){var _=n-h-o,I=i-d+u-o,L=_,R=i+d-u+o;if(g=N2(e,r,n,i,_,I,L,R,!1),g.length>0)return g}var D;{var M=n-h+u,P=i-d+u;if(D=y9(e,r,n,i,M,P,u+o),D.length>0&&D[0]<=M&&D[1]<=P)return[D[0],D[1]]}{var N=n+h-u,F=i-d+u;if(D=y9(e,r,n,i,N,F,u+o),D.length>0&&D[0]>=N&&D[1]<=F)return[D[0],D[1]]}{var B=n+h-u,V=i+d-u;if(D=y9(e,r,n,i,B,V,u+o),D.length>0&&D[0]>=B&&D[1]>=V)return[D[0],D[1]]}{var z=n-h+u,U=i+d-u;if(D=y9(e,r,n,i,z,U,u+o),D.length>0&&D[0]<=z&&D[1]>=U)return[D[0],D[1]]}return[]},o_n=function(e,r,n,i,a,s,o){var l=o,u=Math.min(n,a),h=Math.max(n,a),d=Math.min(i,s),f=Math.max(i,s);return u-l<=e&&e<=h+l&&d-l<=r&&r<=f+l},l_n=function(e,r,n,i,a,s,o,l,u){var h={x1:Math.min(n,o,a)-u,x2:Math.max(n,o,a)+u,y1:Math.min(i,l,s)-u,y2:Math.max(i,l,s)+u};return!(eh.x2||rh.y2)},c_n=function(e,r,n,i){n-=i;var a=r*r-4*e*n;if(a<0)return[];var s=Math.sqrt(a),o=2*e,l=(-r+s)/o,u=(-r-s)/o;return[l,u]},u_n=function(e,r,n,i,a){var s=1e-5;e===0&&(e=s),r/=e,n/=e,i/=e;var o,l,u,h,d,f,p,g;if(l=(3*n-r*r)/9,u=-(27*i)+r*(9*n-2*(r*r)),u/=54,o=l*l*l+u*u,a[1]=0,p=r/3,o>0){d=u+Math.sqrt(o),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),f=u-Math.sqrt(o),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),a[0]=-p+d+f,p+=(d+f)/2,a[4]=a[2]=-p,p=Math.sqrt(3)*(-f+d)/2,a[3]=p,a[5]=-p;return}if(a[5]=a[3]=0,o===0){g=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),a[0]=-p+2*g,a[4]=a[2]=-(g+p);return}l=-l,h=l*l*l,h=Math.acos(u/Math.sqrt(h)),g=2*Math.sqrt(l),a[0]=-p+g*Math.cos(h/3),a[2]=-p+g*Math.cos((h+2*Math.PI)/3),a[4]=-p+g*Math.cos((h+4*Math.PI)/3)},h_n=function(e,r,n,i,a,s,o,l){var u=1*n*n-4*n*a+2*n*o+4*a*a-4*a*o+o*o+i*i-4*i*s+2*i*l+4*s*s-4*s*l+l*l,h=1*9*n*a-3*n*n-3*n*o-6*a*a+3*a*o+9*i*s-3*i*i-3*i*l-6*s*s+3*s*l,d=1*3*n*n-6*n*a+n*o-n*e+2*a*a+2*a*e-o*e+3*i*i-6*i*s+i*l-i*r+2*s*s+2*s*r-l*r,f=1*n*a-n*n+n*e-a*e+i*s-i*i+i*r-s*r,p=[];u_n(u,h,d,f,p);for(var g=1e-7,m=[],v=0;v<6;v+=2)Math.abs(p[v+1])=0&&p[v]<=1&&m.push(p[v]);m.push(1),m.push(0);for(var y=-1,b,x,w,A=0;A=0?wu?(e-a)*(e-a)+(r-s)*(r-s):h-f},Hh=function(e,r,n){for(var i,a,s,o,l,u=0,h=0;h=e&&e>=s||i<=e&&e<=s)l=(e-i)/(s-i)*(o-a)+a,l>r&&u++;else continue;return u%2!==0},T1=function(e,r,n,i,a,s,o,l,u){var h=new Array(n.length),d;l[0]!=null?(d=Math.atan(l[1]/l[0]),l[0]<0?d=d+Math.PI/2:d=-d-Math.PI/2):d=l;for(var f=Math.cos(-d),p=Math.sin(-d),g=0;g0){var v=PJ(h,-u);m=IJ(v)}else m=h;return Hh(e,r,m)},f_n=function(e,r,n,i,a,s,o,l){for(var u=new Array(n.length*2),h=0;h=0&&v<=1&&b.push(v),y>=0&&y<=1&&b.push(y),b.length===0)return[];var x=b[0]*l[0]+e,w=b[0]*l[1]+r;if(b.length>1){if(b[0]==b[1])return[x,w];var A=b[1]*l[0]+e,S=b[1]*l[1]+r;return[x,w,A,S]}else return[x,w]},LCe=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},N2=function(e,r,n,i,a,s,o,l,u){var h=e-a,d=n-e,f=o-a,p=r-s,g=i-r,m=l-s,v=f*p-m*h,y=d*p-g*h,b=m*d-f*g;if(b!==0){var x=v/b,w=y/b,A=.001,S=0-A,T=1+A;return S<=x&&x<=T&&S<=w&&w<=T?[e+x*d,r+x*g]:u?[e+x*d,r+x*g]:[]}else return v===0||y===0?LCe(e,n,o)===o?[o,l]:LCe(e,n,a)===a?[a,s]:LCe(a,o,n)===n?[n,i]:[]:[]},g_n=function(e,r,n,i,a){var s=[],o=i/2,l=a/2,u=r,h=n;s.push({x:u+o*e[0],y:h+l*e[1]});for(var d=1;d0){var m=PJ(d,-l);p=IJ(m)}else p=d}else p=n;for(var v,y,b,x,w=0;w2){for(var g=[h[0],h[1]],m=Math.pow(g[0]-e,2)+Math.pow(g[1]-r,2),v=1;vh&&(h=w)},get:function(x){return u[x]}},f=0;f0?D=R.edgesTo(L)[0]:D=L.edgesTo(R)[0];var M=i(D);L=L.id(),T[L]>T[_]+M&&(T[L]=T[_]+M,O.nodes.indexOf(L)<0?O.push(L):O.updateItem(L),S[L]=0,A[L]=[]),T[L]==T[_]+M&&(S[L]=S[L]+S[_],A[L].push(_))}else for(var P=0;P0;){for(var V=w.pop(),z=0;z0&&o.push(n[l]);o.length!==0&&a.push(i.collection(o))}return a},R_n=function(e,r){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:M_n,o=i,l,u,h=0;h=2?x9(e,r,n,0,KLt,I_n):x9(e,r,n,0,XLt)},squaredEuclidean:function(e,r,n){return x9(e,r,n,0,KLt)},manhattan:function(e,r,n){return x9(e,r,n,0,XLt)},max:function(e,r,n){return x9(e,r,n,-1/0,P_n)}};x3["squared-euclidean"]=x3.squaredEuclidean,x3.squaredeuclidean=x3.squaredEuclidean;function BJ(t,e,r,n,i,a){var s;return Cs(t)?s=t:s=x3[t]||x3.euclidean,e===0&&Cs(t)?s(i,a):s(e,r,n,i,a)}var N_n=pc({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),$Ce=function(e){return N_n(e)},$J=function(e,r,n,i,a){var s=a!=="kMedoids",o=s?function(d){return n[d]}:function(d){return i[d](n)},l=function(f){return i[f](r)},u=n,h=r;return BJ(e,i.length,o,l,u,h)},FCe=function(e,r,n){for(var i=n.length,a=new Array(i),s=new Array(i),o=new Array(r),l=null,u=0;un)return!1}return!0},F_n=function(e,r,n){for(var i=0;io&&(o=r[u][h],l=h);a[l].push(e[u])}for(var d=0;d=a.threshold||a.mode==="dendrogram"&&e.length===1)return!1;var g=r[s],m=r[i[s]],v;a.mode==="dendrogram"?v={left:g,right:m,key:g.key}:v={value:g.value.concat(m.value),key:g.key},e[g.index]=v,e.splice(m.index,1),r[g.key]=v;for(var y=0;yn[m.key][b.key]&&(l=n[m.key][b.key])):a.linkage==="max"?(l=n[g.key][b.key],n[g.key][b.key]0&&i.push(a);return i},aMt=function(e,r,n){for(var i=[],a=0;ao&&(s=u,o=r[a*e+u])}s>0&&i.push(s)}for(var h=0;hu&&(l=h,u=d)}n[a]=s[l]}return i=aMt(e,r,n),i},sMt=function(e){for(var r=this.cy(),n=this.nodes(),i=K_n(e),a={},s=0;s=_?(I=_,_=R,L=D):R>I&&(I=R);for(var M=0;M0?1:0;T[k%i.minIterations*o+z]=U,V+=U}if(V>0&&(k>=i.minIterations-1||k==i.maxIterations-1)){for(var Q=0,G=0;G1||S>1)&&(o=!0),d[x]=[],b.outgoers().forEach(function(O){O.isEdge()&&d[x].push(O.id())})}else f[x]=[void 0,b.target().id()]}):s.forEach(function(b){var x=b.id();if(b.isNode()){var w=b.degree(!0);w%2&&(l?u?o=!0:u=x:l=x),d[x]=[],b.connectedEdges().forEach(function(A){return d[x].push(A.id())})}else f[x]=[b.source().id(),b.target().id()]});var p={found:!1,trail:void 0};if(o)return p;if(u&&l)if(a){if(h&&u!=h)return p;h=u}else{if(h&&u!=h&&l!=h)return p;h||(h=u)}else h||(h=s[0].id());var g=function(x){for(var w=x,A=[x],S,T,O;d[w].length;)S=d[w].shift(),T=f[S][0],O=f[S][1],w!=O?(d[O]=d[O].filter(function(k){return k!=S}),w=O):!a&&w!=T&&(d[T]=d[T].filter(function(k){return k!=S}),w=T),A.unshift(S),A.unshift(w);return A},m=[],v=[];for(v=g(h);v.length!=1;)d[v[0]].length==0?(m.unshift(s.getElementById(v.shift())),m.unshift(s.getElementById(v.shift()))):v=g(v.shift()).concat(v);m.unshift(s.getElementById(v.shift()));for(var y in d)if(d[y].length)return p;return p.found=!0,p.trail=this.spawn(m,!0),p}},FJ=function(){var e=this,r={},n=0,i=0,a=[],s=[],o={},l=function(f,p){for(var g=s.length-1,m=[],v=e.spawn();s[g].x!=f||s[g].y!=p;)m.push(s.pop().edge),g--;m.push(s.pop().edge),m.forEach(function(y){var b=y.connectedNodes().intersection(e);v.merge(y),b.forEach(function(x){var w=x.id(),A=x.connectedEdges().intersection(e);v.merge(x),r[w].cutVertex?v.merge(A.filter(function(S){return S.isLoop()})):v.merge(A)})}),a.push(v)},u=function(f,p,g){f===g&&(i+=1),r[p]={id:n,low:n++,cutVertex:!1};var m=e.getElementById(p).connectedEdges().intersection(e);if(m.size()===0)a.push(e.spawn(e.getElementById(p)));else{var v,y,b,x;m.forEach(function(w){v=w.source().id(),y=w.target().id(),b=v===p?y:v,b!==g&&(x=w.id(),o[x]||(o[x]=!0,s.push({x:p,y:b,edge:w})),b in r?r[p].low=Math.min(r[p].low,r[b].id):(u(f,b,p),r[p].low=Math.min(r[p].low,r[b].low),r[p].id<=r[b].low&&(r[p].cutVertex=!0,l(p,b))))})}};e.forEach(function(d){if(d.isNode()){var f=d.id();f in r||(i=0,u(f,f),r[f].cutVertex=i>1)}});var h=Object.keys(r).filter(function(d){return r[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(h),components:a}},a5n={hopcroftTarjanBiconnected:FJ,htbc:FJ,htb:FJ,hopcroftTarjanBiconnectedComponents:FJ},zJ=function(){var e=this,r={},n=0,i=[],a=[],s=e.spawn(e),o=function(u){a.push(u),r[u]={index:n,low:n++,explored:!1};var h=e.getElementById(u).connectedEdges().intersection(e);if(h.forEach(function(m){var v=m.target().id();v!==u&&(v in r||o(v),r[v].explored||(r[u].low=Math.min(r[u].low,r[v].low)))}),r[u].index===r[u].low){for(var d=e.spawn();;){var f=a.pop();if(d.merge(e.getElementById(f)),r[f].low=r[u].index,r[f].explored=!0,f===u)break}var p=d.edgesWith(d),g=d.merge(p);i.push(g),s=s.difference(g)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in r||o(u)}}),{cut:s,components:i}},s5n={tarjanStronglyConnected:zJ,tsc:zJ,tscc:zJ,tarjanStronglyConnectedComponents:zJ},oMt={};[g9,PEn,NEn,$En,zEn,VEn,HEn,b_n,y3,b3,BCe,L_n,H_n,j_n,r5n,i5n,a5n,s5n].forEach(function(t){sn(oMt,t)});/*! Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) Licensed under The MIT License (http://opensource.org/licenses/MIT) -*/var lMt=0,cMt=1,uMt=2,xg=function(e){if(!(this instanceof xg))return new xg(e);this.id="Thenable/1.0.7",this.state=lMt,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};xg.prototype={fulfill:function(e){return hMt(this,cMt,"fulfillValue",e)},reject:function(e){return hMt(this,uMt,"rejectReason",e)},then:function(e,r){var n=this,i=new xg;return n.onFulfilled.push(pMt(e,i,"fulfill")),n.onRejected.push(pMt(r,i,"reject")),dMt(n),i.proxy}};var hMt=function(e,r,n,i){return e.state===lMt&&(e.state=r,e[n]=i,dMt(e)),e},dMt=function(e){e.state===cMt?fMt(e,"onFulfilled",e.fulfillValue):e.state===uMt&&fMt(e,"onRejected",e.rejectReason)},fMt=function(e,r,n){if(e[r].length!==0){var i=e[r];e[r]=[];var a=function(){for(var o=0;o0}},clearQueue:function(){return function(){var r=this,n=r.length!==void 0,i=n?r:[r],a=this._private.cy||this;if(!a.styleEnabled())return this;for(var s=0;s-1}return hOe=e,hOe}var dOe,FMt;function C5n(){if(FMt)return dOe;FMt=1;var t=QJ();function e(r,n){var i=this.__data__,a=t(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return dOe=e,dOe}var fOe,zMt;function O5n(){if(zMt)return fOe;zMt=1;var t=w5n(),e=A5n(),r=T5n(),n=S5n(),i=C5n();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o-1&&n%1==0&&n0&&this.spawn(i).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){Oa(e)||(e=e.match(/\S+/g)||[]);for(var n=this,i=r===void 0,a=[],s=0,o=n.length;s0&&this.spawn(a).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var n=this;if(r==null)r=250;else if(r===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},r),n}};HJ.className=HJ.classNames=HJ.classes;var Ii={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:il,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Ii.variable="(?:[\\w-.]|(?:\\\\"+Ii.metaChar+"))+",Ii.className="(?:[\\w-]|(?:\\\\"+Ii.metaChar+"))+",Ii.value=Ii.string+"|"+Ii.number,Ii.id=Ii.variable,function(){var t,e,r;for(t=Ii.comparatorOp.split("|"),r=0;r=0)&&e!=="="&&(Ii.comparatorOp+="|\\!"+e)}();var ga=function(){return{checks:[]}},Rr={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},VOe=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return Jkn(t.selector,e.selector)}),n4n=function(){for(var t={},e,r=0;r0&&h.edgeCount>0)return ea("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return ea("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&ea("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},c4n=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(h){return h??""},r=function(h){return Wr(h)?'"'+h+'"':e(h)},n=function(h){return" "+h+" "},i=function(h,d){var f=h.type,p=h.value;switch(f){case Rr.GROUP:{var g=e(p);return g.substring(0,g.length-1)}case Rr.DATA_COMPARE:{var m=h.field,v=h.operator;return"["+m+n(e(v))+r(p)+"]"}case Rr.DATA_BOOL:{var y=h.operator,b=h.field;return"["+e(y)+b+"]"}case Rr.DATA_EXIST:{var x=h.field;return"["+x+"]"}case Rr.META_COMPARE:{var w=h.operator,A=h.field;return"[["+A+n(e(w))+r(p)+"]]"}case Rr.STATE:return p;case Rr.ID:return"#"+p;case Rr.CLASS:return"."+p;case Rr.PARENT:case Rr.CHILD:return a(h.parent,d)+n(">")+a(h.child,d);case Rr.ANCESTOR:case Rr.DESCENDANT:return a(h.ancestor,d)+" "+a(h.descendant,d);case Rr.COMPOUND_SPLIT:{var T=a(h.left,d),S=a(h.subject,d),O=a(h.right,d);return T+(T.length>0?" ":"")+S+O}case Rr.TRUE:return""}},a=function(h,d){return h.checks.reduce(function(f,p,g){return f+(d===h&&g===0?"$":"")+i(p,d)},"")},s="",o=0;o1&&o=0&&(r=r.replace("!",""),d=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),h=!0),(a||o||h)&&(l=!a&&!s?"":""+e,u=""+n),h&&(e=l=l.toLowerCase(),n=u=u.toLowerCase()),r){case"*=":i=l.indexOf(u)>=0;break;case"$=":i=l.indexOf(u,l.length-u.length)>=0;break;case"^=":i=l.indexOf(u)===0;break;case"=":i=e===n;break;case">":f=!0,i=e>n;break;case">=":f=!0,i=e>=n;break;case"<":f=!0,i=e0;){var h=i.shift();e(h),a.add(h.id()),o&&n(i,a,h)}return t}function bIt(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i1&&arguments[1]!==void 0?arguments[1]:!0;return HOe(this,t,e,bIt)};function xIt(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}S3.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return HOe(this,t,e,xIt)};function v4n(t,e,r){xIt(t,e,r),bIt(t,e,r)}S3.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return HOe(this,t,e,v4n)},S3.ancestors=S3.parents;var w9,wIt;w9=wIt={data:ta.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:ta.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:ta.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:ta.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:ta.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:ta.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},w9.attr=w9.data,w9.removeAttr=w9.removeData;var y4n=wIt,WJ={};function WOe(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var n=0,i=r[0],a=i._private.edges,s=0;se}),minIndegree:C3("indegree",function(t,e){return te}),minOutdegree:C3("outdegree",function(t,e){return te})}),sn(WJ,{totalDegree:function(e){for(var r=0,n=this.nodes(),i=0;i0,f=d;d&&(h=h[0]);var p=f?h.position():{x:0,y:0};r!==void 0?u.position(e,r+p[e]):a!==void 0&&u.position({x:a.x+p.x,y:a.y+p.y})}else{var g=n.position(),m=o?n.parent():null,v=m&&m.length>0,y=v;v&&(m=m[0]);var b=y?m.position():{x:0,y:0};return a={x:g.x-b.x,y:g.y-b.y},e===void 0?a:a[e]}else if(!s)return;return this}},wg.modelPosition=wg.point=wg.position,wg.modelPositions=wg.points=wg.positions,wg.renderedPoint=wg.renderedPosition,wg.relativePoint=wg.relativePosition;var b4n=AIt,O3=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},k3=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},x4n=function(e){switch(e){case"left":return"right";case"right":return"left";case"left-inside":return"left";case"right-inside":return"right";default:return"center"}},E3,V2;E3=V2={},V2.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),i=r.pan(),a=e.x1*n+i.x,s=e.x2*n+i.x,o=e.y1*n+i.y,l=e.y2*n+i.y;return{x1:a,x2:s,y1:o,y2:l,w:s-a,h:l-o}},V2.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var n=r._private;n.compoundBoundsClean=!1,n.bbCache=null,t||r.emitAndNotify("bounds")}}),this)},V2.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(s){if(!s.isParent())return;var o=s._private,l=s.children(),u=s.pstyle("compound-sizing-wrt-labels").value==="include",h={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},d=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),f=o.position;(d.w===0||d.h===0)&&(d={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},d.x1=f.x-d.w/2,d.x2=f.x+d.w/2,d.y1=f.y-d.h/2,d.y2=f.y+d.h/2);function p(k,E,_){var I=0,L=0,R=E+_;return k>0&&R>0&&(I=E/R*k,L=_/R*k),{biasDiff:I,biasComplementDiff:L}}function g(k,E,_,I){if(_.units==="%")switch(I){case"width":return k>0?_.pfValue*k:0;case"height":return E>0?_.pfValue*E:0;case"average":return k>0&&E>0?_.pfValue*(k+E)/2:0;case"min":return k>0&&E>0?k>E?_.pfValue*E:_.pfValue*k:0;case"max":return k>0&&E>0?k>E?_.pfValue*k:_.pfValue*E:0;default:return 0}else return _.units==="px"?_.pfValue:0}var m=h.width.left.value;h.width.left.units==="px"&&h.width.val>0&&(m=m*100/h.width.val);var v=h.width.right.value;h.width.right.units==="px"&&h.width.val>0&&(v=v*100/h.width.val);var y=h.height.top.value;h.height.top.units==="px"&&h.height.val>0&&(y=y*100/h.height.val);var b=h.height.bottom.value;h.height.bottom.units==="px"&&h.height.val>0&&(b=b*100/h.height.val);var x=p(h.width.val-d.w,m,v),w=x.biasDiff,A=x.biasComplementDiff,T=p(h.height.val-d.h,y,b),S=T.biasDiff,O=T.biasComplementDiff;o.autoPadding=g(d.w,d.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(d.w,h.width.val),f.x=(-w+d.x1+d.x2+A)/2,o.autoHeight=Math.max(d.h,h.height.val),f.y=(-S+d.y1+d.y2+O)/2}for(var n=0;ne.x2?i:e.x2,e.y1=ne.y2?a:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},Q2=function(e,r){return r==null?e:Ag(e,r.x1,r.y1,r.x2,r.y2)},A9=function(e,r,n){return Qu(e,r,n)},YJ=function(e,r,n){if(!r.cy().headless()){var i=r._private,a=i.rstyle,s=a.arrowWidth/2,o=r.pstyle(n+"-arrow-shape").value,l,u;if(o!=="none"){n==="source"?(l=a.srcX,u=a.srcY):n==="target"?(l=a.tgtX,u=a.tgtY):(l=a.midX,u=a.midY);var h=i.arrowBounds=i.arrowBounds||{},d=h[n]=h[n]||{};d.x1=l-s,d.y1=u-s,d.x2=l+s,d.y2=u+s,d.w=d.x2-d.x1,d.h=d.y2-d.y1,LJ(d,1),Ag(e,d.x1,d.y1,d.x2,d.y2)}}},YOe=function(e,r,n){if(!r.cy().headless()){var i;n?i=n+"-":i="";var a=r._private,s=a.rstyle,o=r.pstyle(i+"label").strValue;if(o){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),h=A9(s,"labelWidth",n),d=A9(s,"labelHeight",n),f=A9(s,"labelX",n),p=A9(s,"labelY",n),g=r.pstyle(i+"text-margin-x").pfValue,m=r.pstyle(i+"text-margin-y").pfValue,v=r.isEdge(),y=r.pstyle(i+"text-rotation"),b=r.pstyle("text-outline-width").pfValue,x=r.pstyle("text-border-width").pfValue,w=x/2,A=r.pstyle("text-background-padding").pfValue,T=2,S=d,O=h,k=O/2,E=S/2,_,I,L,R;if(v)_=f-k,I=f+k,L=p-E,R=p+E;else{switch(O3(l.value)){case"left":_=f-O,I=f;break;case"center":_=f-k,I=f+k;break;case"right":_=f,I=f+O;break}switch(k3(u.value)){case"top":L=p-S,R=p;break;case"center":L=p-E,R=p+E;break;case"bottom":L=p,R=p+S;break}}var D=g-Math.max(b,w)-A-T,M=g+Math.max(b,w)+A+T,P=m-Math.max(b,w)-A-T,N=m+Math.max(b,w)+A+T;_+=D,I+=M,L+=P,R+=N;var F=n||"main",B=a.labelBounds,V=B[F]=B[F]||{};V.x1=_,V.y1=L,V.x2=I,V.y2=R,V.w=I-_,V.h=R-L,V.leftPad=D,V.rightPad=M,V.topPad=P,V.botPad=N;var z=v&&y.strValue==="autorotate",U=y.pfValue!=null&&y.pfValue!==0;if(z||U){var Q=z?A9(a.rstyle,"labelAngle",n):y.pfValue,G=Math.cos(Q),X=Math.sin(Q),Y=(_+I)/2,le=(L+R)/2;if(!v){switch(O3(l.value)){case"left":Y=I;break;case"right":Y=_;break}switch(k3(u.value)){case"top":le=R;break;case"bottom":le=L;break}}var q=function($e,he){return $e=$e-Y,he=he-le,{x:$e*G-he*X+Y,y:$e*X+he*G+le}},Z=q(_,L),ee=q(_,R),re=q(I,L),ve=q(I,R);_=Math.min(Z.x,ee.x,re.x,ve.x),I=Math.max(Z.x,ee.x,re.x,ve.x),L=Math.min(Z.y,ee.y,re.y,ve.y),R=Math.max(Z.y,ee.y,re.y,ve.y)}var ae=F+"Rot",Ce=B[ae]=B[ae]||{};Ce.x1=_,Ce.y1=L,Ce.x2=I,Ce.y2=R,Ce.w=I-_,Ce.h=R-L,Ag(e,_,L,I,R),Ag(a.labelBounds.all,_,L,I,R)}return e}},CIt=function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,i=r.pstyle("outline-width").value,a=r.pstyle("outline-offset").value,s=i+a;OIt(e,r,n,s,"outside",s/2)}},OIt=function(e,r,n,i,a,s){if(!(n===0||i<=0||a==="inside")){var o=r.cy(),l=o.renderer(),u=l.nodeShapes[l.getNodeShape(r)];if(u){var h=r.position(),d=h.x,f=h.y,p=r.width(),g=r.height();if(u.hasMiterBounds){a==="center"&&(i/=2);var m=u.miterBounds(d,f,p,g,i);Q2(e,m)}else s!=null&&s>0&&MJ(e,[s,s,s,s])}}},w4n=function(e,r){if(!r.cy().headless()){var n=r.pstyle("border-opacity").value,i=r.pstyle("border-width").pfValue,a=r.pstyle("border-position").value;OIt(e,r,n,i,a)}},A4n=function(e,r){var n=e._private.cy,i=n.styleEnabled(),a=n.headless(),s=Gu(),o=e._private,l=e.isNode(),u=e.isEdge(),h,d,f,p,g,m,v=o.rstyle,y=l&&i?e.pstyle("bounds-expansion").pfValue:[0],b=function(Oe){return Oe.pstyle("display").value!=="none"},x=!i||b(e)&&(!u||b(e.source())&&b(e.target()));if(x){var w=0,A=0;i&&r.includeOverlays&&(w=e.pstyle("overlay-opacity").value,w!==0&&(A=e.pstyle("overlay-padding").value));var T=0,S=0;i&&r.includeUnderlays&&(T=e.pstyle("underlay-opacity").value,T!==0&&(S=e.pstyle("underlay-padding").value));var O=Math.max(A,S),k=0,E=0;if(i&&(k=e.pstyle("width").pfValue,E=k/2),l&&r.includeNodes){var _=e.position();g=_.x,m=_.y;var I=e.outerWidth(),L=I/2,R=e.outerHeight(),D=R/2;h=g-L,d=g+L,f=m-D,p=m+D,Ag(s,h,f,d,p),i&&CIt(s,e),i&&r.includeOutlines&&!a&&CIt(s,e),i&&w4n(s,e)}else if(u&&r.includeEdges)if(i&&!a){var M=e.pstyle("curve-style").strValue;if(h=Math.min(v.srcX,v.midX,v.tgtX),d=Math.max(v.srcX,v.midX,v.tgtX),f=Math.min(v.srcY,v.midY,v.tgtY),p=Math.max(v.srcY,v.midY,v.tgtY),h-=E,d+=E,f-=E,p+=E,Ag(s,h,f,d,p),M==="haystack"){var P=v.haystackPts;if(P&&P.length===2){if(h=P[0].x,f=P[0].y,d=P[1].x,p=P[1].y,h>d){var N=h;h=d,d=N}if(f>p){var F=f;f=p,p=F}Ag(s,h-E,f-E,d+E,p+E)}}else if(M==="bezier"||M==="unbundled-bezier"||L2(M,"segments")||L2(M,"taxi")){var B;switch(M){case"bezier":case"unbundled-bezier":B=v.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":B=v.linePts;break}if(B!=null)for(var V=0;Vd){var Y=h;h=d,d=Y}if(f>p){var le=f;f=p,p=le}h-=E,d+=E,f-=E,p+=E,Ag(s,h,f,d,p)}if(i&&r.includeEdges&&u&&(YJ(s,e,"mid-source"),YJ(s,e,"mid-target"),YJ(s,e,"source"),YJ(s,e,"target")),i){var q=e.pstyle("ghost").value==="yes";if(q){var Z=e.pstyle("ghost-offset-x").pfValue,ee=e.pstyle("ghost-offset-y").pfValue;Ag(s,s.x1+Z,s.y1+ee,s.x2+Z,s.y2+ee)}}var re=o.bodyBounds=o.bodyBounds||{};FLt(re,s),MJ(re,y),LJ(re,1),i&&(h=s.x1,d=s.x2,f=s.y1,p=s.y2,Ag(s,h-O,f-O,d+O,p+O));var ve=o.overlayBounds=o.overlayBounds||{};FLt(ve,s),MJ(ve,y),LJ(ve,1);var ae=o.labelBounds=o.labelBounds||{};ae.all!=null?r_n(ae.all):ae.all=Gu(),i&&r.includeLabels&&(r.includeMainLabels&&YOe(s,e,null),u&&(r.includeSourceLabels&&YOe(s,e,"source"),r.includeTargetLabels&&YOe(s,e,"target")))}return s.x1=mp(s.x1),s.y1=mp(s.y1),s.x2=mp(s.x2),s.y2=mp(s.y2),s.w=mp(s.x2-s.x1),s.h=mp(s.y2-s.y1),s.w>0&&s.h>0&&x&&(MJ(s,y),LJ(s,1)),s},kIt=function(e){var r=0,n=function(s){return(s?1:0)<0}},clearQueue:function(){return function(){var r=this,n=r.length!==void 0,i=n?r:[r],a=this._private.cy||this;if(!a.styleEnabled())return this;for(var s=0;s-1}return hOe=e,hOe}var dOe,FMt;function C5n(){if(FMt)return dOe;FMt=1;var t=QJ();function e(r,n){var i=this.__data__,a=t(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return dOe=e,dOe}var fOe,zMt;function O5n(){if(zMt)return fOe;zMt=1;var t=w5n(),e=A5n(),r=S5n(),n=T5n(),i=C5n();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o-1&&n%1==0&&n0&&this.spawn(i).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){Oa(e)||(e=e.match(/\S+/g)||[]);for(var n=this,i=r===void 0,a=[],s=0,o=n.length;s0&&this.spawn(a).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var n=this;if(r==null)r=250;else if(r===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},r),n}};HJ.className=HJ.classNames=HJ.classes;var Ii={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:il,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Ii.variable="(?:[\\w-.]|(?:\\\\"+Ii.metaChar+"))+",Ii.className="(?:[\\w-]|(?:\\\\"+Ii.metaChar+"))+",Ii.value=Ii.string+"|"+Ii.number,Ii.id=Ii.variable,function(){var t,e,r;for(t=Ii.comparatorOp.split("|"),r=0;r=0)&&e!=="="&&(Ii.comparatorOp+="|\\!"+e)}();var ga=function(){return{checks:[]}},Rr={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},VOe=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return Jkn(t.selector,e.selector)}),n4n=function(){for(var t={},e,r=0;r0&&h.edgeCount>0)return ea("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return ea("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&ea("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},c4n=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(h){return h??""},r=function(h){return Wr(h)?'"'+h+'"':e(h)},n=function(h){return" "+h+" "},i=function(h,d){var f=h.type,p=h.value;switch(f){case Rr.GROUP:{var g=e(p);return g.substring(0,g.length-1)}case Rr.DATA_COMPARE:{var m=h.field,v=h.operator;return"["+m+n(e(v))+r(p)+"]"}case Rr.DATA_BOOL:{var y=h.operator,b=h.field;return"["+e(y)+b+"]"}case Rr.DATA_EXIST:{var x=h.field;return"["+x+"]"}case Rr.META_COMPARE:{var w=h.operator,A=h.field;return"[["+A+n(e(w))+r(p)+"]]"}case Rr.STATE:return p;case Rr.ID:return"#"+p;case Rr.CLASS:return"."+p;case Rr.PARENT:case Rr.CHILD:return a(h.parent,d)+n(">")+a(h.child,d);case Rr.ANCESTOR:case Rr.DESCENDANT:return a(h.ancestor,d)+" "+a(h.descendant,d);case Rr.COMPOUND_SPLIT:{var S=a(h.left,d),T=a(h.subject,d),O=a(h.right,d);return S+(S.length>0?" ":"")+T+O}case Rr.TRUE:return""}},a=function(h,d){return h.checks.reduce(function(f,p,g){return f+(d===h&&g===0?"$":"")+i(p,d)},"")},s="",o=0;o1&&o=0&&(r=r.replace("!",""),d=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),h=!0),(a||o||h)&&(l=!a&&!s?"":""+e,u=""+n),h&&(e=l=l.toLowerCase(),n=u=u.toLowerCase()),r){case"*=":i=l.indexOf(u)>=0;break;case"$=":i=l.indexOf(u,l.length-u.length)>=0;break;case"^=":i=l.indexOf(u)===0;break;case"=":i=e===n;break;case">":f=!0,i=e>n;break;case">=":f=!0,i=e>=n;break;case"<":f=!0,i=e0;){var h=i.shift();e(h),a.add(h.id()),o&&n(i,a,h)}return t}function bIt(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i1&&arguments[1]!==void 0?arguments[1]:!0;return HOe(this,t,e,bIt)};function xIt(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}T3.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return HOe(this,t,e,xIt)};function v4n(t,e,r){xIt(t,e,r),bIt(t,e,r)}T3.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return HOe(this,t,e,v4n)},T3.ancestors=T3.parents;var w9,wIt;w9=wIt={data:ta.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:ta.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:ta.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:ta.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:ta.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:ta.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},w9.attr=w9.data,w9.removeAttr=w9.removeData;var y4n=wIt,WJ={};function WOe(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var n=0,i=r[0],a=i._private.edges,s=0;se}),minIndegree:C3("indegree",function(t,e){return te}),minOutdegree:C3("outdegree",function(t,e){return te})}),sn(WJ,{totalDegree:function(e){for(var r=0,n=this.nodes(),i=0;i0,f=d;d&&(h=h[0]);var p=f?h.position():{x:0,y:0};r!==void 0?u.position(e,r+p[e]):a!==void 0&&u.position({x:a.x+p.x,y:a.y+p.y})}else{var g=n.position(),m=o?n.parent():null,v=m&&m.length>0,y=v;v&&(m=m[0]);var b=y?m.position():{x:0,y:0};return a={x:g.x-b.x,y:g.y-b.y},e===void 0?a:a[e]}else if(!s)return;return this}},wg.modelPosition=wg.point=wg.position,wg.modelPositions=wg.points=wg.positions,wg.renderedPoint=wg.renderedPosition,wg.relativePoint=wg.relativePosition;var b4n=AIt,O3=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},k3=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},x4n=function(e){switch(e){case"left":return"right";case"right":return"left";case"left-inside":return"left";case"right-inside":return"right";default:return"center"}},E3,V2;E3=V2={},V2.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),i=r.pan(),a=e.x1*n+i.x,s=e.x2*n+i.x,o=e.y1*n+i.y,l=e.y2*n+i.y;return{x1:a,x2:s,y1:o,y2:l,w:s-a,h:l-o}},V2.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var n=r._private;n.compoundBoundsClean=!1,n.bbCache=null,t||r.emitAndNotify("bounds")}}),this)},V2.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(s){if(!s.isParent())return;var o=s._private,l=s.children(),u=s.pstyle("compound-sizing-wrt-labels").value==="include",h={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},d=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),f=o.position;(d.w===0||d.h===0)&&(d={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},d.x1=f.x-d.w/2,d.x2=f.x+d.w/2,d.y1=f.y-d.h/2,d.y2=f.y+d.h/2);function p(k,E,_){var I=0,L=0,R=E+_;return k>0&&R>0&&(I=E/R*k,L=_/R*k),{biasDiff:I,biasComplementDiff:L}}function g(k,E,_,I){if(_.units==="%")switch(I){case"width":return k>0?_.pfValue*k:0;case"height":return E>0?_.pfValue*E:0;case"average":return k>0&&E>0?_.pfValue*(k+E)/2:0;case"min":return k>0&&E>0?k>E?_.pfValue*E:_.pfValue*k:0;case"max":return k>0&&E>0?k>E?_.pfValue*k:_.pfValue*E:0;default:return 0}else return _.units==="px"?_.pfValue:0}var m=h.width.left.value;h.width.left.units==="px"&&h.width.val>0&&(m=m*100/h.width.val);var v=h.width.right.value;h.width.right.units==="px"&&h.width.val>0&&(v=v*100/h.width.val);var y=h.height.top.value;h.height.top.units==="px"&&h.height.val>0&&(y=y*100/h.height.val);var b=h.height.bottom.value;h.height.bottom.units==="px"&&h.height.val>0&&(b=b*100/h.height.val);var x=p(h.width.val-d.w,m,v),w=x.biasDiff,A=x.biasComplementDiff,S=p(h.height.val-d.h,y,b),T=S.biasDiff,O=S.biasComplementDiff;o.autoPadding=g(d.w,d.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(d.w,h.width.val),f.x=(-w+d.x1+d.x2+A)/2,o.autoHeight=Math.max(d.h,h.height.val),f.y=(-T+d.y1+d.y2+O)/2}for(var n=0;ne.x2?i:e.x2,e.y1=ne.y2?a:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},Q2=function(e,r){return r==null?e:Ag(e,r.x1,r.y1,r.x2,r.y2)},A9=function(e,r,n){return Qu(e,r,n)},YJ=function(e,r,n){if(!r.cy().headless()){var i=r._private,a=i.rstyle,s=a.arrowWidth/2,o=r.pstyle(n+"-arrow-shape").value,l,u;if(o!=="none"){n==="source"?(l=a.srcX,u=a.srcY):n==="target"?(l=a.tgtX,u=a.tgtY):(l=a.midX,u=a.midY);var h=i.arrowBounds=i.arrowBounds||{},d=h[n]=h[n]||{};d.x1=l-s,d.y1=u-s,d.x2=l+s,d.y2=u+s,d.w=d.x2-d.x1,d.h=d.y2-d.y1,LJ(d,1),Ag(e,d.x1,d.y1,d.x2,d.y2)}}},YOe=function(e,r,n){if(!r.cy().headless()){var i;n?i=n+"-":i="";var a=r._private,s=a.rstyle,o=r.pstyle(i+"label").strValue;if(o){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),h=A9(s,"labelWidth",n),d=A9(s,"labelHeight",n),f=A9(s,"labelX",n),p=A9(s,"labelY",n),g=r.pstyle(i+"text-margin-x").pfValue,m=r.pstyle(i+"text-margin-y").pfValue,v=r.isEdge(),y=r.pstyle(i+"text-rotation"),b=r.pstyle("text-outline-width").pfValue,x=r.pstyle("text-border-width").pfValue,w=x/2,A=r.pstyle("text-background-padding").pfValue,S=2,T=d,O=h,k=O/2,E=T/2,_,I,L,R;if(v)_=f-k,I=f+k,L=p-E,R=p+E;else{switch(O3(l.value)){case"left":_=f-O,I=f;break;case"center":_=f-k,I=f+k;break;case"right":_=f,I=f+O;break}switch(k3(u.value)){case"top":L=p-T,R=p;break;case"center":L=p-E,R=p+E;break;case"bottom":L=p,R=p+T;break}}var D=g-Math.max(b,w)-A-S,M=g+Math.max(b,w)+A+S,P=m-Math.max(b,w)-A-S,N=m+Math.max(b,w)+A+S;_+=D,I+=M,L+=P,R+=N;var F=n||"main",B=a.labelBounds,V=B[F]=B[F]||{};V.x1=_,V.y1=L,V.x2=I,V.y2=R,V.w=I-_,V.h=R-L,V.leftPad=D,V.rightPad=M,V.topPad=P,V.botPad=N;var z=v&&y.strValue==="autorotate",U=y.pfValue!=null&&y.pfValue!==0;if(z||U){var Q=z?A9(a.rstyle,"labelAngle",n):y.pfValue,G=Math.cos(Q),X=Math.sin(Q),Y=(_+I)/2,le=(L+R)/2;if(!v){switch(O3(l.value)){case"left":Y=I;break;case"right":Y=_;break}switch(k3(u.value)){case"top":le=R;break;case"bottom":le=L;break}}var q=function($e,he){return $e=$e-Y,he=he-le,{x:$e*G-he*X+Y,y:$e*X+he*G+le}},Z=q(_,L),ee=q(_,R),re=q(I,L),ve=q(I,R);_=Math.min(Z.x,ee.x,re.x,ve.x),I=Math.max(Z.x,ee.x,re.x,ve.x),L=Math.min(Z.y,ee.y,re.y,ve.y),R=Math.max(Z.y,ee.y,re.y,ve.y)}var ae=F+"Rot",Ce=B[ae]=B[ae]||{};Ce.x1=_,Ce.y1=L,Ce.x2=I,Ce.y2=R,Ce.w=I-_,Ce.h=R-L,Ag(e,_,L,I,R),Ag(a.labelBounds.all,_,L,I,R)}return e}},CIt=function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,i=r.pstyle("outline-width").value,a=r.pstyle("outline-offset").value,s=i+a;OIt(e,r,n,s,"outside",s/2)}},OIt=function(e,r,n,i,a,s){if(!(n===0||i<=0||a==="inside")){var o=r.cy(),l=o.renderer(),u=l.nodeShapes[l.getNodeShape(r)];if(u){var h=r.position(),d=h.x,f=h.y,p=r.width(),g=r.height();if(u.hasMiterBounds){a==="center"&&(i/=2);var m=u.miterBounds(d,f,p,g,i);Q2(e,m)}else s!=null&&s>0&&MJ(e,[s,s,s,s])}}},w4n=function(e,r){if(!r.cy().headless()){var n=r.pstyle("border-opacity").value,i=r.pstyle("border-width").pfValue,a=r.pstyle("border-position").value;OIt(e,r,n,i,a)}},A4n=function(e,r){var n=e._private.cy,i=n.styleEnabled(),a=n.headless(),s=Gu(),o=e._private,l=e.isNode(),u=e.isEdge(),h,d,f,p,g,m,v=o.rstyle,y=l&&i?e.pstyle("bounds-expansion").pfValue:[0],b=function(Oe){return Oe.pstyle("display").value!=="none"},x=!i||b(e)&&(!u||b(e.source())&&b(e.target()));if(x){var w=0,A=0;i&&r.includeOverlays&&(w=e.pstyle("overlay-opacity").value,w!==0&&(A=e.pstyle("overlay-padding").value));var S=0,T=0;i&&r.includeUnderlays&&(S=e.pstyle("underlay-opacity").value,S!==0&&(T=e.pstyle("underlay-padding").value));var O=Math.max(A,T),k=0,E=0;if(i&&(k=e.pstyle("width").pfValue,E=k/2),l&&r.includeNodes){var _=e.position();g=_.x,m=_.y;var I=e.outerWidth(),L=I/2,R=e.outerHeight(),D=R/2;h=g-L,d=g+L,f=m-D,p=m+D,Ag(s,h,f,d,p),i&&CIt(s,e),i&&r.includeOutlines&&!a&&CIt(s,e),i&&w4n(s,e)}else if(u&&r.includeEdges)if(i&&!a){var M=e.pstyle("curve-style").strValue;if(h=Math.min(v.srcX,v.midX,v.tgtX),d=Math.max(v.srcX,v.midX,v.tgtX),f=Math.min(v.srcY,v.midY,v.tgtY),p=Math.max(v.srcY,v.midY,v.tgtY),h-=E,d+=E,f-=E,p+=E,Ag(s,h,f,d,p),M==="haystack"){var P=v.haystackPts;if(P&&P.length===2){if(h=P[0].x,f=P[0].y,d=P[1].x,p=P[1].y,h>d){var N=h;h=d,d=N}if(f>p){var F=f;f=p,p=F}Ag(s,h-E,f-E,d+E,p+E)}}else if(M==="bezier"||M==="unbundled-bezier"||L2(M,"segments")||L2(M,"taxi")){var B;switch(M){case"bezier":case"unbundled-bezier":B=v.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":B=v.linePts;break}if(B!=null)for(var V=0;Vd){var Y=h;h=d,d=Y}if(f>p){var le=f;f=p,p=le}h-=E,d+=E,f-=E,p+=E,Ag(s,h,f,d,p)}if(i&&r.includeEdges&&u&&(YJ(s,e,"mid-source"),YJ(s,e,"mid-target"),YJ(s,e,"source"),YJ(s,e,"target")),i){var q=e.pstyle("ghost").value==="yes";if(q){var Z=e.pstyle("ghost-offset-x").pfValue,ee=e.pstyle("ghost-offset-y").pfValue;Ag(s,s.x1+Z,s.y1+ee,s.x2+Z,s.y2+ee)}}var re=o.bodyBounds=o.bodyBounds||{};FLt(re,s),MJ(re,y),LJ(re,1),i&&(h=s.x1,d=s.x2,f=s.y1,p=s.y2,Ag(s,h-O,f-O,d+O,p+O));var ve=o.overlayBounds=o.overlayBounds||{};FLt(ve,s),MJ(ve,y),LJ(ve,1);var ae=o.labelBounds=o.labelBounds||{};ae.all!=null?r_n(ae.all):ae.all=Gu(),i&&r.includeLabels&&(r.includeMainLabels&&YOe(s,e,null),u&&(r.includeSourceLabels&&YOe(s,e,"source"),r.includeTargetLabels&&YOe(s,e,"target")))}return s.x1=mp(s.x1),s.y1=mp(s.y1),s.x2=mp(s.x2),s.y2=mp(s.y2),s.w=mp(s.x2-s.x1),s.h=mp(s.y2-s.y1),s.w>0&&s.h>0&&x&&(MJ(s,y),LJ(s,1)),s},kIt=function(e){var r=0,n=function(s){return(s?1:0)<0&&arguments[0]!==void 0?arguments[0]:B4n,e=arguments.length>1?arguments[1]:void 0,r=0;r=0;o--)s(o);return this},G2.removeAllListeners=function(){return this.removeListener("*")},G2.emit=G2.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,Oa(e)||(e=[e]),$4n(this,function(a,s){r!=null&&(n=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],i=n.length);for(var o=function(){var h=n[l];if(h.type===s.type&&(!h.namespace||h.namespace===s.namespace||h.namespace===N4n)&&a.eventMatches(a.context,h,s)){var d=[s];e!=null&&OEn(d,e),a.beforeEmit(a.context,h,s),h.conf&&h.conf.one&&(a.listeners=a.listeners.filter(function(g){return g!==h}));var f=a.callbackContext(a.context,h,s),p=h.callback.apply(f,d);a.afterEmit(a.context,h,s),p===!1&&(s.stopPropagation(),s.preventDefault())}},l=0;l1&&!s){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,a.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,n=e._private.data.id,i=r.map,a=i.get(n);if(!a)return this;var s=a.index;return this.unmergeAt(s),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&Wr(e)){var n=e;e=r.mutableElements().filter(n)}for(var i=0;i=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},map:function(e,r){for(var n=[],i=this,a=0;an&&(n=l,i=o)}return{value:n,ele:i}},min:function(e,r){for(var n=1/0,i,a=this,s=0;s=0&&a"u"?"undefined":rl(Symbol))!=e&&rl(Symbol.iterator)!=e;r&&(KJ[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},a=0,s=this.length;return qDt({next:function(){return a1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],i=n.cy();if(i.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,i.style().apply(n));var a=n._private.style[e];return a??(r?i.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var n=r.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},style:function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var i=!1,a=n.style();if(Mi(e)){var s=e;a.applyBypass(this,s,i),this.emitAndNotify("style")}else if(Wr(e))if(r===void 0){var o=this[0];return o?a.getStylePropertyValue(o,e):void 0}else a.applyBypass(this,e,r,i),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?a.getRawStyle(l):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,i=r.style(),a=this;if(e===void 0)for(var s=0;s0&&e.push(h[0]),e.push(o[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),nu.neighbourhood=nu.neighborhood,nu.closedNeighbourhood=nu.closedNeighborhood,nu.openNeighbourhood=nu.openNeighborhood,sn(nu,{source:gp(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:gp(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:qIt({attr:"source"}),targets:qIt({attr:"target"})});function qIt(t){return function(r){for(var n=[],i=0;i0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),nu.componentsOf=nu.components;var mc=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){vs("A collection must have a reference to the core");return}var a=new T1,s=!1;if(!r)r=[];else if(r.length>0&&Mi(r[0])&&!l9(r[0])){s=!0;for(var o=[],l=new g3,u=0,h=r.length;u0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=r.cy(),i=n._private,a=[],s=[],o,l=0,u=r.length;l0){for(var F=o.length===r.length?r:new mc(n,o),B=0;B0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=[],i={},a=r._private.cy;function s(R){for(var D=R._private.edges,M=0;M0&&(t?_.emitAndNotify("remove"):e&&_.emit("remove"));for(var I=0;I0?I=R:_=R;while(Math.abs(L)>s&&++D=a?b(E,D):M===0?D:w(E,_,_+u)}var T=!1;function S(){T=!0,(t!==e||r!==n)&&x()}var O=function(_){return T||S(),t===e&&r===n?_:_===0?0:_===1?1:v(A(_),e,n)};O.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var k="generateBezier("+[t,e,r,n]+")";return O.toString=function(){return k},O}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var j4n=function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,i,a){var s={x:n.x+a.dx*i,v:n.v+a.dv*i,tension:n.tension,friction:n.friction};return{dx:s.v,dv:t(s)}}function r(n,i){var a={dx:n.v,dv:t(n)},s=e(n,i*.5,a),o=e(n,i*.5,s),l=e(n,i,o),u=1/6*(a.dx+2*(s.dx+o.dx)+l.dx),h=1/6*(a.dv+2*(s.dv+o.dv)+l.dv);return n.x=n.x+u*i,n.v=n.v+h*i,n}return function n(i,a,s){var o={x:-1,v:0,tension:null,friction:null},l=[0],u=0,h=1/1e4,d=16/1e3,f,p,g;for(i=parseFloat(i)||500,a=parseFloat(a)||20,s=s||null,o.tension=i,o.friction=a,f=s!==null,f?(u=n(i,a),p=u/s*d):p=d;g=r(g||o,p),l.push(1+g.x),u+=16,Math.abs(g.x)>h&&Math.abs(g.v)>h;);return f?function(m){return l[m*(l.length-1)|0]}:u}}(),Na=function(e,r,n,i){var a=q4n(e,r,n,i);return function(s,o,l){return s+(o-s)*a(l)}},tee={linear:function(e,r,n){return e+(r-e)*n},ease:Na(.25,.1,.25,1),"ease-in":Na(.42,0,1,1),"ease-out":Na(0,0,.58,1),"ease-in-out":Na(.42,0,.58,1),"ease-in-sine":Na(.47,0,.745,.715),"ease-out-sine":Na(.39,.575,.565,1),"ease-in-out-sine":Na(.445,.05,.55,.95),"ease-in-quad":Na(.55,.085,.68,.53),"ease-out-quad":Na(.25,.46,.45,.94),"ease-in-out-quad":Na(.455,.03,.515,.955),"ease-in-cubic":Na(.55,.055,.675,.19),"ease-out-cubic":Na(.215,.61,.355,1),"ease-in-out-cubic":Na(.645,.045,.355,1),"ease-in-quart":Na(.895,.03,.685,.22),"ease-out-quart":Na(.165,.84,.44,1),"ease-in-out-quart":Na(.77,0,.175,1),"ease-in-quint":Na(.755,.05,.855,.06),"ease-out-quint":Na(.23,1,.32,1),"ease-in-out-quint":Na(.86,0,.07,1),"ease-in-expo":Na(.95,.05,.795,.035),"ease-out-expo":Na(.19,1,.22,1),"ease-in-out-expo":Na(1,0,0,1),"ease-in-circ":Na(.6,.04,.98,.335),"ease-out-circ":Na(.075,.82,.165,1),"ease-in-out-circ":Na(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return tee.linear;var i=j4n(e,r,n);return function(a,s,o){return a+(s-a)*i(o)}},"cubic-bezier":Na};function KIt(t,e,r,n,i){if(n===1||e===r)return r;var a=i(e,r,n);return t==null||((t.roundValue||t.color)&&(a=Math.round(a)),t.min!==void 0&&(a=Math.max(a,t.min)),t.max!==void 0&&(a=Math.min(a,t.max))),a}function ZIt(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function D3(t,e,r,n,i){var a=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var s=ZIt(t,i),o=ZIt(e,i);if(or(s)&&or(o))return KIt(a,s,o,r,n);if(Oa(s)&&Oa(o)){for(var l=[],u=0;u0?(p==="spring"&&g.push(s.duration),s.easingImpl=tee[p].apply(null,g)):s.easingImpl=tee[p]}var m=s.easingImpl,v;if(s.duration===0?v=1:v=(r-l)/s.duration,s.applying&&(v=s.progress),v<0?v=0:v>1&&(v=1),s.delay==null){var y=s.startPosition,b=s.position;if(b&&i&&!t.locked()){var x={};k9(y.x,b.x)&&(x.x=D3(y.x,b.x,v,m)),k9(y.y,b.y)&&(x.y=D3(y.y,b.y,v,m)),t.position(x)}var w=s.startPan,A=s.pan,T=a.pan,S=A!=null&&n;S&&(k9(w.x,A.x)&&(T.x=D3(w.x,A.x,v,m)),k9(w.y,A.y)&&(T.y=D3(w.y,A.y,v,m)),t.emit("pan"));var O=s.startZoom,k=s.zoom,E=k!=null&&n;E&&(k9(O,k)&&(a.zoom=v9(a.minZoom,D3(O,k,v,m),a.maxZoom)),t.emit("zoom")),(S||E)&&t.emit("viewport");var _=s.style;if(_&&_.length>0&&i){for(var I=0;I<_.length;I++){var L=_[I],R=L.name,D=L,M=s.startStyle[R],P=h.properties[M.name],N=D3(M,D,v,m,P);h.overrideBypass(t,R,N)}t.emit("style")}}return s.progress=v,v}function k9(t,e){return t==null||e==null?!1:or(t)&&or(e)?!0:!!(t&&e)}function K4n(t,e,r,n){var i=e._private;i.started=!0,i.startTime=r-i.progress*i.duration}function JIt(t,e){var r=e._private.aniEles,n=[];function i(h,d){var f=h._private,p=f.animation.current,g=f.animation.queue,m=!1;if(p.length===0){var v=g.shift();v&&p.push(v)}for(var y=function(T){for(var S=T.length-1;S>=0;S--){var O=T[S];O()}T.splice(0,T.length)},b=p.length-1;b>=0;b--){var x=p[b],w=x._private;if(w.stopped){p.splice(b,1),w.hooked=!1,w.playing=!1,w.started=!1,y(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||K4n(h,x,t),X4n(h,x,t,d),w.applying&&(w.applying=!1),y(w.frames),w.step!=null&&w.step(t),x.completed()&&(p.splice(b,1),w.hooked=!1,w.playing=!1,w.started=!1,y(w.completes)),m=!0)}return!d&&p.length===0&&g.length===0&&n.push(h),m}for(var a=!1,s=0;s0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var Z4n={animate:ta.animate(),animation:ta.animation(),animated:ta.animated(),clearQueue:ta.clearQueue(),delay:ta.delay(),delayAnimation:ta.delayAnimation(),stop:ta.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&CJ(function(a){JIt(a,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(a,s){JIt(s,e)},n.beforeRenderPriorities.animations):r()}},J4n={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var i=r.qualifier;return i!=null?e!==n.target&&l9(n.target)&&i.matches(n.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e}},ree=function(e){return Wr(e)?new F2(e):e},ePt={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new jJ(J4n,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,ree(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,ree(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,ree(r),n),this},once:function(e,r,n){return this.emitter().one(e,ree(r),n),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};ta.eventAliasesOn(ePt);var XOe={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};XOe.jpeg=XOe.jpg;var nee={layout:function(e){var r=this;if(e==null){vs("Layout options must be specified to make a layout");return}if(e.name==null){vs("A `name` must be specified to make a layout");return}var n=e.name,i=r.extension("layout",n);if(i==null){vs("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var a;Wr(e.eles)?a=r.$(e.eles):a=e.eles!=null?e.eles:r.$();var s=new i(sn({},e,{cy:r,eles:a}));return s}};nee.createLayout=nee.makeLayout=nee.layout;var e3n={notify:function(e,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var i=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();r!=null&&i.merge(r);return}if(n.notificationsEnabled){var a=this.renderer();this.destroyed()||!a||a.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var i=e.batchNotifications[n];i.empty()?r.notify(n):r.notify(n,i)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),i=0;i0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var i=n._private;i.rscratch={},i.rstyle={},i.animation.current=[],i.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};KOe.invalidateDimensions=KOe.resize;var iee={collection:function(e,r){return Wr(e)?this.$(e):ef(e)?e.collection():Oa(e)?(r||(r={}),new mc(this,e,r.unique,r.removed)):new mc(this)},nodes:function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};iee.elements=iee.filter=iee.$;var Nl={},E9="t",r3n="f";Nl.apply=function(t){for(var e=this,r=e._private,n=r.cy,i=n.collection(),a=0;a0;if(f||d&&p){var g=void 0;f&&p||f?g=u.properties:p&&(g=u.mappedProperties);for(var m=0;m1&&(w=1),o.color){var T=n.valueMin[0],S=n.valueMax[0],O=n.valueMin[1],k=n.valueMax[1],E=n.valueMin[2],_=n.valueMax[2],I=n.valueMin[3]==null?1:n.valueMin[3],L=n.valueMax[3]==null?1:n.valueMax[3],R=[Math.round(T+(S-T)*w),Math.round(O+(k-O)*w),Math.round(E+(_-E)*w),Math.round(I+(L-I)*w)];a={bypass:n.bypass,name:n.name,value:R,strValue:"rgb("+R[0]+", "+R[1]+", "+R[2]+")"}}else if(o.number){var D=n.valueMin+(n.valueMax-n.valueMin)*w;a=this.parse(n.name,D,n.bypass,f)}else return!1;if(!a)return m(),!1;a.mapping=n,n=a;break}case s.data:{for(var M=n.field.split("."),P=d.data,N=0;N0&&a>0){for(var o={},l=!1,u=0;u0?t.delayAnimation(s).play().promise().then(x):x()}).then(function(){return t.animation({style:o,duration:a,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1)},Nl.checkTrigger=function(t,e,r,n,i,a){var s=this.properties[e],o=i(s);t.removed()||o!=null&&o(r,n,t)&&a(s)},Nl.checkZOrderTrigger=function(t,e,r,n){var i=this;this.checkTrigger(t,e,r,n,function(a){return a.triggersZOrder},function(){i._private.cy.notify("zorder",t)})},Nl.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})},Nl.checkConnectedEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfConnectedEdges},function(i){t.connectedEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})},Nl.checkParallelEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfParallelEdges},function(i){t.parallelEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})},Nl.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n),this.checkConnectedEdgesBoundsTrigger(t,e,r,n),this.checkParallelEdgesBoundsTrigger(t,e,r,n)};var _9={};_9.applyBypass=function(t,e,r,n){var i=this,a=[],s=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var o=0;oi.length?n=n.substr(i.length):n=""}function l(){a.length>s.length?a=a.substr(s.length):a=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var h=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){ea("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}i=h[0];var d=h[1];if(d!=="core"){var f=new F2(d);if(f.invalid){ea("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),o();continue}}var p=h[2],g=!1;a=p;for(var m=[];;){var v=a.match(/^\s*$/);if(v)break;var y=a.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!y){ea("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+p),g=!0;break}s=y[0];var b=y[1],x=y[2],w=e.properties[b];if(!w){ea("Skipping property: Invalid property name in: "+s),l();continue}var A=r.parse(b,x);if(!A){ea("Skipping property: Invalid property definition in: "+s),l();continue}m.push({name:b,val:x}),l()}if(g){o();break}r.selector(d);for(var T=0;T=7&&e[0]==="d"&&(h=new RegExp(o.data.regex).exec(e))){if(r)return!1;var f=o.data;return{name:t,value:h,strValue:""+e,mapped:f,field:h[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(d=new RegExp(o.mapData.regex).exec(e))){if(r||u.multiple)return!1;var p=o.mapData;if(!(u.color||u.number))return!1;var g=this.parse(t,d[4]);if(!g||g.mapped)return!1;var m=this.parse(t,d[5]);if(!m||m.mapped)return!1;if(g.pfValue===m.pfValue||g.strValue===m.strValue)return ea("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+g.strValue+"`"),this.parse(t,g.strValue);if(u.color){var v=g.value,y=m.value,b=v[0]===y[0]&&v[1]===y[1]&&v[2]===y[2]&&(v[3]===y[3]||(v[3]==null||v[3]===1)&&(y[3]==null||y[3]===1));if(b)return!1}return{name:t,value:d,strValue:""+e,mapped:p,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:g.value,valueMax:m.value,bypass:r}}}if(u.multiple&&n!=="multiple"){var x;if(l?x=e.split(/\s+/):Oa(e)?x=e:x=[e],u.evenMultiple&&x.length%2!==0)return null;for(var w=[],A=[],T=[],S="",O=!1,k=0;k0?" ":"")+E.strValue}return u.validate&&!u.validate(w,A)?null:u.singleEnum&&O?w.length===1&&Wr(w[0])?{name:t,value:w[0],strValue:w[0],bypass:r}:null:{name:t,value:w,pfValue:T,strValue:S,bypass:r,units:A}}var _=function(){for(var q=0;qu.max||u.strictMax&&e===u.max))return null;var M={name:t,value:e,strValue:""+e+(I||""),units:I,bypass:r};return u.unitless||I!=="px"&&I!=="em"?M.pfValue=e:M.pfValue=I==="px"||!I?e:this.getEmSizeInPixels()*e,(I==="ms"||I==="s")&&(M.pfValue=I==="ms"?e:1e3*e),(I==="deg"||I==="rad")&&(M.pfValue=I==="rad"?e:ZEn(e)),I==="%"&&(M.pfValue=e/100),M}else if(u.propList){var P=[],N=""+e;if(N!=="none"){for(var F=N.split(/\s*,\s*|\s+/),B=0;B0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((s-2*r)/n.w,(o-2*r)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l=n.minZoom&&(n.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,n=r.pan,i=r.zoom,a,s,o=!1;if(r.zoomingEnabled||(o=!0),or(e)?s=e:Mi(e)&&(s=e.level,e.position!=null?a=RJ(e.position,i,n):e.renderedPosition!=null&&(a=e.renderedPosition),a!=null&&!r.panningEnabled&&(o=!0)),s=s>r.maxZoom?r.maxZoom:s,s=sr.maxZoom||!r.zoomingEnabled?s=!0:(r.zoom=l,a.push("zoom"))}if(i&&(!s||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;or(u.x)&&(r.pan.x=u.x,o=!1),or(u.y)&&(r.pan.y=u.y,o=!1),o||a.push("pan")}return a.length>0&&(a.push("viewport"),this.emit(a.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(Wr(e)){var n=e;e=this.mutableElements().filter(n)}else ef(e)||(e=this.mutableElements());if(e.length!==0){var i=e.boundingBox(),a=this.width(),s=this.height();r=r===void 0?this._private.zoom:r;var o={x:(a-r*(i.x1+i.x2))/2,y:(s-r*(i.y1+i.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?function(){var i=n.window().getComputedStyle(r),a=function(o){return parseFloat(i.getPropertyValue(o))};return{width:r.clientWidth-a("padding-left")-a("padding-right"),height:r.clientHeight-a("padding-top")-a("padding-bottom")}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,r=this._private.zoom,n=this.renderedExtent(),i={x1:(n.x1-e.x)/r,x2:(n.x2-e.x)/r,y1:(n.y1-e.y)/r,y2:(n.y2-e.y)/r};return i.w=i.x2-i.x1,i.h=i.y2-i.y1,i},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};OC.centre=OC.center,OC.autolockNodes=OC.autolock,OC.autoungrabifyNodes=OC.autoungrabify;var R9={data:ta.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:ta.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:ta.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:ta.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};R9.attr=R9.data,R9.removeAttr=R9.removeData;var D9=function(e){var r=this;e=sn({},e);var n=e.container;n&&!wJ(n)&&wJ(n[0])&&(n=n[0]);var i=n?n._cyreg:null;i=i||{},i&&i.cy&&(i.cy.destroy(),i={});var a=i.readies=i.readies||[];n&&(n._cyreg=i),i.cy=r;var s=nl!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=sn({name:s?"grid":"null"},o.layout),o.renderer=sn({name:s?"canvas":"null"},o.renderer);var l=function(g,m,v){return m!==void 0?m:v!==void 0?v:g},u=this._private={container:n,ready:!1,options:o,elements:new mc(this),listeners:[],aniEles:new mc(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:or(o.zoom)?o.zoom:1,pan:{x:Mi(o.pan)&&or(o.pan.x)?o.pan.x:0,y:Mi(o.pan)&&or(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var h=function(g,m){var v=g.some(Hkn);if(v)return A3.all(g).then(m);m(g)};u.styleEnabled&&r.setStyle([]);var d=sn({},o,o.renderer);r.initRenderer(d);var f=function(g,m,v){r.notifications(!1);var y=r.mutableElements();y.length>0&&y.remove(),g!=null&&(Mi(g)||Oa(g))&&r.add(g),r.one("layoutready",function(x){r.notifications(!0),r.emit(x),r.one("load",m),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",v),r.emit("done")});var b=sn({},r._private.options.layout);b.eles=r.elements(),r.layout(b).run()};h([o.style,o.elements],function(p){var g=p[0],m=p[1];u.styleEnabled&&r.style().append(g),f(m,function(){r.startAnimationLoop(),u.ready=!0,Cs(o.ready)&&r.on("ready",o.ready);for(var v=0;v0,o=!!t.boundingBox,l=Gu(o?t.boundingBox:structuredClone(e.extent())),u;if(ef(t.roots))u=t.roots;else if(Oa(t.roots)){for(var h=[],d=0;d0;){var R=L(),D=k(R,_);if(D)R.outgoers().filter(function(fe){return fe.isNode()&&r.has(fe)}).forEach(I);else if(D===null){ea("Detected double maximal shift for node `"+R.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var M=0;if(t.avoidOverlap)for(var P=0;P0&&y[0].length<=3?De/2:0),K=2*Math.PI/y[Qe].length*Se;return Qe===0&&y[0].length===1&&(qe=1),{x:re.x+qe*Math.cos(K),y:re.y+qe*Math.sin(K)}}else{var ce=y[Qe].length,be=Math.max(ce===1?0:o?(l.w-t.padding*2-ve.w)/((t.grid?Ce:ce)-1):(l.w-t.padding*2-ve.w)/((t.grid?Ce:ce)+1),M),ne={x:re.x+(Se+1-(ce+1)/2)*be,y:re.y+(Qe+1-(G+1)/2)*ae};return ne}},$e={downward:0,leftward:90,upward:180,rightward:-90};Object.keys($e).indexOf(t.direction)===-1&&vs("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys($e).join(", ")));var he=function(Te){return xEn(Oe(Te),l,$e[t.direction])};return r.nodes().layoutPositions(this,t,he),this};var o3n={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function nPt(t){this.options=sn({},o3n,t)}nPt.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));for(var s=Gu(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/a.length:e.sweep,u=l/Math.max(1,a.length-1),h,d=0,f=0;f1&&e.avoidOverlap){d*=1.75;var y=Math.cos(u)-Math.cos(0),b=Math.sin(u)-Math.sin(0),x=Math.sqrt(d*d/(y*y+b*b));h=Math.max(x,h)}var w=function(T,S){var O=e.startAngle+S*u*(i?1:-1),k=h*Math.cos(O),E=h*Math.sin(O),_={x:o.x+k,y:o.y+E};return _};return n.nodes().layoutPositions(this,e,w),this};var l3n={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function iPt(t){this.options=sn({},l3n,t)}iPt.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=t.cy,i=e.eles,a=i.nodes().not(":parent"),s=Gu(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=[],u=0,h=0;h0){var A=Math.abs(b[0].value-w.value);A>=v&&(b=[],y.push(b))}b.push(w)}var T=u+e.minNodeSpacing;if(!e.avoidOverlap){var S=y.length>0&&y[0].length>1,O=Math.min(s.w,s.h)/2-T,k=O/(y.length+S?1:0);T=Math.min(T,k)}for(var E=0,_=0;_1&&e.avoidOverlap){var D=Math.cos(R)-Math.cos(0),M=Math.sin(R)-Math.sin(0),P=Math.sqrt(T*T/(D*D+M*M));E=Math.max(P,E)}I.r=E,E+=T}if(e.equidistant){for(var N=0,F=0,B=0;B=t.numIter||(g3n(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature=t.animationThreshold&&a(),CJ(h)}};h()}else{for(;u;)u=s(l),l++;cPt(n,t),o()}return this},lee.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},lee.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var u3n=function(e,r,n){for(var i=n.eles.edges(),a=n.eles.nodes(),s=Gu(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:a.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:i.size(),temperature:n.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},l=n.eles.components(),u={},h=0;h0){o.graphSet.push(O);for(var h=0;hi.count?0:i.graph},aPt=function(e,r,n,i){var a=i.graphSet[n];if(-10)var d=i.nodeOverlap*h,f=Math.sqrt(o*o+l*l),p=d*o/f,g=d*l/f;else var m=cee(e,o,l),v=cee(r,-1*o,-1*l),y=v.x-m.x,b=v.y-m.y,x=y*y+b*b,f=Math.sqrt(x),d=(e.nodeRepulsion+r.nodeRepulsion)/x,p=d*y/f,g=d*b/f;e.isLocked||(e.offsetX-=p,e.offsetY-=g),r.isLocked||(r.offsetX+=p,r.offsetY+=g)}},y3n=function(e,r,n,i){if(n>0)var a=e.maxX-r.minX;else var a=r.maxX-e.minX;if(i>0)var s=e.maxY-r.minY;else var s=r.maxY-e.minY;return a>=0&&s>=0?Math.sqrt(a*a+s*s):0},cee=function(e,r,n){var i=e.positionX,a=e.positionY,s=e.height||1,o=e.width||1,l=n/r,u=s/o,h={};return r===0&&0n?(h.x=i,h.y=a+s/2,h):0r&&-1*u<=l&&l<=u?(h.x=i-o/2,h.y=a-o*n/2/r,h):0=u)?(h.x=i+s*r/2/n,h.y=a+s/2,h):(0>n&&(l<=-1*u||l>=u)&&(h.x=i-s*r/2/n,h.y=a-s/2),h)},b3n=function(e,r){for(var n=0;nn){var v=r.gravity*p/m,y=r.gravity*g/m;f.offsetX+=v,f.offsetY+=y}}}}},w3n=function(e,r){var n=[],i=0,a=-1;for(n.push.apply(n,e.graphSet[0]),a+=e.graphSet[0].length;i<=a;){var s=n[i++],o=e.idToIndex[s],l=e.layoutNodes[o],u=l.children;if(0n)var a={x:n*e/i,y:n*r/i};else var a={x:e,y:r};return a},lPt=function(e,r){var n=e.parentId;if(n!=null){var i=r.layoutNodes[r.idToIndex[n]],a=!1;if((i.maxX==null||e.maxX+i.padRight>i.maxX)&&(i.maxX=e.maxX+i.padRight,a=!0),(i.minX==null||e.minX-i.padLefti.maxY)&&(i.maxY=e.maxY+i.padBottom,a=!0),(i.minY==null||e.minY-i.padTopy&&(g+=v+r.componentSpacing,p=0,m=0,v=0)}}},S3n={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function uPt(t){this.options=sn({},S3n,t)}uPt.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));var a=Gu(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(a.h===0||a.w===0)n.nodes().layoutPositions(this,e,function(U){return{x:a.x1,y:a.y1}});else{var s=i.size(),o=Math.sqrt(s*a.h/a.w),l=Math.round(o),u=Math.round(a.w/a.h*o),h=function(Q){if(Q==null)return Math.min(l,u);var G=Math.min(l,u);G==l?l=Q:u=Q},d=function(Q){if(Q==null)return Math.max(l,u);var G=Math.max(l,u);G==l?l=Q:u=Q},f=e.rows,p=e.cols!=null?e.cols:e.columns;if(f!=null&&p!=null)l=f,u=p;else if(f!=null&&p==null)l=f,u=Math.ceil(s/l);else if(f==null&&p!=null)u=p,l=Math.ceil(s/u);else if(u*l>s){var g=h(),m=d();(g-1)*m>=s?h(g-1):(m-1)*g>=s&&d(m-1)}else for(;u*l=s?d(y+1):h(v+1)}var b=a.w/u,x=a.h/l;if(e.condense&&(b=0,x=0),e.avoidOverlap)for(var w=0;w=u&&(D=0,R++)},P={},N=0;N(D=d_n(t,e,M[P],M[P+1],M[P+2],M[P+3])))return v(S,D),!0}else if(k.edgeType==="bezier"||k.edgeType==="multibezier"||k.edgeType==="self"||k.edgeType==="compound"){for(var M=k.allpts,P=0;P+5(D=h_n(t,e,M[P],M[P+1],M[P+2],M[P+3],M[P+4],M[P+5])))return v(S,D),!0}for(var N=N||O.source,F=F||O.target,B=i.getArrowWidth(E,_),V=[{name:"source",x:k.arrowStartX,y:k.arrowStartY,angle:k.srcArrowAngle},{name:"target",x:k.arrowEndX,y:k.arrowEndY,angle:k.tgtArrowAngle},{name:"mid-source",x:k.midX,y:k.midY,angle:k.midsrcArrowAngle},{name:"mid-target",x:k.midX,y:k.midY,angle:k.midtgtArrowAngle}],P=0;P0&&(y(N),y(F))}function x(S,O,k){return Qu(S,O,k)}function w(S,O){var k=S._private,E=f,_;O?_=O+"-":_="",S.boundingBox();var I=k.labelBounds[O||"main"],L=S.pstyle(_+"label").value,R=S.pstyle("text-events").strValue==="yes";if(!(!R||!L)){var D=x(k.rscratch,"labelX",O),M=x(k.rscratch,"labelY",O),P=x(k.rscratch,"labelAngle",O),N=S.pstyle(_+"text-margin-x").pfValue,F=S.pstyle(_+"text-margin-y").pfValue,B=I.x1-E-N,V=I.x2+E-N,z=I.y1-E-F,U=I.y2+E-F;if(P){var Q=Math.cos(P),G=Math.sin(P),X=function(ve,ae){return ve=ve-D,ae=ae-M,{x:ve*Q-ae*G+D,y:ve*G+ae*Q+M}},Y=X(B,z),le=X(B,U),q=X(V,z),Z=X(V,U),ee=[Y.x+N,Y.y+F,q.x+N,q.y+F,Z.x+N,Z.y+F,le.x+N,le.y+F];if(Hh(t,e,ee))return v(S),!0}else if(P2(I,t,e))return v(S),!0}}for(var A=s.length-1;A>=0;A--){var T=s[A];T.isNode()?y(T)||w(T):b(T)||w(T)||w(T,"source")||w(T,"target")}return o},kC.getAllInBox=function(t,e,r,n){var i=this.getCachedZSortedEles().interactive,a=this.cy.zoom(),s=2/a,o=[],l=Math.min(t,r),u=Math.max(t,r),h=Math.min(e,n),d=Math.max(e,n);t=l,r=u,e=h,n=d;var f=Gu({x1:t,y1:e,x2:r,y2:n}),p=[{x:f.x1,y:f.y1},{x:f.x2,y:f.y1},{x:f.x2,y:f.y2},{x:f.x1,y:f.y2}],g=[[p[0],p[1]],[p[1],p[2]],[p[2],p[3]],[p[3],p[0]]];function m(ve,ae,Ce){return Qu(ve,ae,Ce)}function v(ve,ae){var Ce=ve._private,Oe=s,$e="";ve.boundingBox();var he=Ce.labelBounds.main;if(!he)return null;var fe=m(Ce.rscratch,"labelX",ae),Te=m(Ce.rscratch,"labelY",ae),ge=m(Ce.rscratch,"labelAngle",ae),Qe=ve.pstyle($e+"text-margin-x").pfValue,Se=ve.pstyle($e+"text-margin-y").pfValue,De=he.x1-Oe-Qe,qe=he.x2+Oe-Qe,K=he.y1-Oe-Se,ce=he.y2+Oe-Se;if(ge){var be=Math.cos(ge),ne=Math.sin(ge),j=function(pe,te){return pe=pe-fe,te=te-Te,{x:pe*be-te*ne+fe,y:pe*ne+te*be+Te}};return[j(De,K),j(qe,K),j(qe,ce),j(De,ce)]}else return[{x:De,y:K},{x:qe,y:K},{x:qe,y:ce},{x:De,y:ce}]}function y(ve,ae,Ce,Oe){function $e(he,fe,Te){return(Te.y-he.y)*(fe.x-he.x)>(fe.y-he.y)*(Te.x-he.x)}return $e(ve,Ce,Oe)!==$e(ae,Ce,Oe)&&$e(ve,ae,Ce)!==$e(ve,ae,Oe)}for(var b=0;b0?-(Math.PI-e.ang):Math.PI+e.ang},R3n=function(e,r,n,i,a){if(e!==xPt?wPt(r,e,M0):_3n(vp,M0),wPt(r,n,vp),mPt=M0.nx*vp.ny-M0.ny*vp.nx,vPt=M0.nx*vp.nx-M0.ny*-vp.ny,C1=Math.asin(Math.max(-1,Math.min(1,mPt))),Math.abs(C1)<1e-6){nke=r.x,ike=r.y,RC=M3=0;return}EC=1,hee=!1,vPt<0?C1<0?C1=Math.PI+C1:(C1=Math.PI-C1,EC=-1,hee=!0):C1>0&&(EC=-1,hee=!0),r.radius!==void 0?M3=r.radius:M3=i,_C=C1/2,dee=Math.min(M0.len/2,vp.len/2),a?(I0=Math.abs(Math.cos(_C)*M3/Math.sin(_C)),I0>dee?(I0=dee,RC=Math.abs(I0*Math.sin(_C)/Math.cos(_C))):RC=M3):(I0=Math.min(dee,M3),RC=Math.abs(I0*Math.sin(_C)/Math.cos(_C))),ake=r.x+vp.nx*I0,ske=r.y+vp.ny*I0,nke=ake-vp.ny*RC*EC,ike=ske+vp.nx*RC*EC,yPt=r.x+M0.nx*I0,bPt=r.y+M0.ny*I0,xPt=r};function APt(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function oke(t,e,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(R3n(t,e,r,n,i),{cx:nke,cy:ike,radius:RC,startX:yPt,startY:bPt,stopX:ake,stopY:ske,startAngle:M0.ang+Math.PI/2*EC,endAngle:vp.ang-Math.PI/2*EC,counterClockwise:hee})}var L9=.01,D3n=Math.sqrt(2*L9),au={};au.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,i=e.vectorNormInverse,a,s=t.pstyle("source-endpoint"),o=t.pstyle("target-endpoint"),l=s.units!=null&&o.units!=null,u=function(A,T,S,O){var k=O-T,E=S-A,_=Math.sqrt(E*E+k*k);return{x:-k/_,y:E/_}},h=t.pstyle("edge-distances").value;switch(h){case"node-position":a=r;break;case"intersection":a=n;break;case"endpoints":{if(l){var d=this.manualEndptToPx(t.source()[0],s),f=$o(d,2),p=f[0],g=f[1],m=this.manualEndptToPx(t.target()[0],o),v=$o(m,2),y=v[0],b=v[1],x={x1:p,y1:g,x2:y,y2:b};i=u(p,g,y,b),a=x}else ea("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),a=n;break}}return{midptPts:a,vectorNormInverse:i}},au.findHaystackPoints=function(t){for(var e=0;e0?Math.max(te-ye,0):Math.min(te+ye,0)},L=I(E,O),R=I(_,k),D=!1;b===u?y=Math.abs(L)>Math.abs(R)?i:n:b===l||b===o?(y=n,D=!0):(b===a||b===s)&&(y=i,D=!0);var M=y===n,P=M?R:L,N=M?_:E,F=RCe(N),B=!1;!(D&&(w||T))&&(b===o&&N<0||b===l&&N>0||b===a&&N>0||b===s&&N<0)&&(F*=-1,P=F*Math.abs(P),B=!0);var V;if(w){var z=A<0?1+A:A;V=z*P}else{var U=A<0?P:0;V=U+A*F}var Q=function(te){return Math.abs(te)=Math.abs(P)},G=Q(V),X=Q(Math.abs(P)-Math.abs(V)),Y=G||X;if(Y&&!B)if(M){var le=Math.abs(N)<=f/2,q=Math.abs(E)<=p/2;if(le){var Z=(h.x1+h.x2)/2,ee=h.y1,re=h.y2;r.segpts=[Z,ee,Z,re]}else if(q){var ve=(h.y1+h.y2)/2,ae=h.x1,Ce=h.x2;r.segpts=[ae,ve,Ce,ve]}else r.segpts=[h.x1,h.y2]}else{var Oe=Math.abs(N)<=d/2,$e=Math.abs(_)<=g/2;if(Oe){var he=(h.y1+h.y2)/2,fe=h.x1,Te=h.x2;r.segpts=[fe,he,Te,he]}else if($e){var ge=(h.x1+h.x2)/2,Qe=h.y1,Se=h.y2;r.segpts=[ge,Qe,ge,Se]}else r.segpts=[h.x2,h.y1]}else if(M){var De=h.y1+V+(v?f/2*F:0),qe=h.x1,K=h.x2;r.segpts=[qe,De,K,De]}else{var ce=h.x1+V+(v?d/2*F:0),be=h.y1,ne=h.y2;r.segpts=[ce,be,ce,ne]}if(r.isRound){var j=t.pstyle("taxi-radius").value,ie=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(j),r.isArcRadius=new Array(r.segpts.length/2).fill(ie)}},au.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,i=e.tgtPos,a=e.srcW,s=e.srcH,o=e.tgtW,l=e.tgtH,u=e.srcShape,h=e.tgtShape,d=e.srcCornerRadius,f=e.tgtCornerRadius,p=e.srcRs,g=e.tgtRs,m=!or(r.startX)||!or(r.startY),v=!or(r.arrowStartX)||!or(r.arrowStartY),y=!or(r.endX)||!or(r.endY),b=!or(r.arrowEndX)||!or(r.arrowEndY),x=3,w=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,A=x*w,T=AC({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),S=TN.poolIndex()){var F=P;P=N,N=F}var B=L.srcPos=P.position(),V=L.tgtPos=N.position(),z=L.srcW=P.outerWidth(),U=L.srcH=P.outerHeight(),Q=L.tgtW=N.outerWidth(),G=L.tgtH=N.outerHeight(),X=L.srcShape=r.nodeShapes[e.getNodeShape(P)],Y=L.tgtShape=r.nodeShapes[e.getNodeShape(N)],le=L.srcCornerRadius=P.pstyle("corner-radius").value==="auto"?"auto":P.pstyle("corner-radius").pfValue,q=L.tgtCornerRadius=N.pstyle("corner-radius").value==="auto"?"auto":N.pstyle("corner-radius").pfValue,Z=L.tgtRs=N._private.rscratch,ee=L.srcRs=P._private.rscratch;L.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var re=0;re=D3n||(K=Math.sqrt(Math.max(qe*qe,L9)+Math.max(De*De,L9)));var ce=L.vector={x:qe,y:De},be=L.vectorNorm={x:ce.x/K,y:ce.y/K},ne={x:-be.y,y:be.x};L.nodesOverlap=!or(K)||Y.checkPoint(he[0],he[1],0,Q,G,V.x,V.y,q,Z)||X.checkPoint(Te[0],Te[1],0,z,U,B.x,B.y,le,ee),L.vectorNormInverse=ne,R={nodesOverlap:L.nodesOverlap,dirCounts:L.dirCounts,calculatedIntersection:!0,hasBezier:L.hasBezier,hasUnbundled:L.hasUnbundled,eles:L.eles,srcPos:V,srcRs:Z,tgtPos:B,tgtRs:ee,srcW:Q,srcH:G,tgtW:z,tgtH:U,srcIntn:ge,tgtIntn:fe,srcShape:Y,tgtShape:X,posPts:{x1:Se.x2,y1:Se.y2,x2:Se.x1,y2:Se.y1},intersectionPts:{x1:Qe.x2,y1:Qe.y2,x2:Qe.x1,y2:Qe.y1},vector:{x:-ce.x,y:-ce.y},vectorNorm:{x:-be.x,y:-be.y},vectorNormInverse:{x:-ne.x,y:-ne.y}}}var j=$e?R:L;ae.nodesOverlap=j.nodesOverlap,ae.srcIntn=j.srcIntn,ae.tgtIntn=j.tgtIntn,ae.isRound=Ce.startsWith("round"),i&&(P.isParent()||P.isChild()||N.isParent()||N.isChild())&&(P.parents().anySame(N)||N.parents().anySame(P)||P.same(N)&&P.isParent())?e.findCompoundLoopPoints(ve,j,re,Oe):P===N?e.findLoopPoints(ve,j,re,Oe):Ce.endsWith("segments")?e.findSegmentsPoints(ve,j):Ce.endsWith("taxi")?e.findTaxiPoints(ve,j):Ce==="straight"||!Oe&&L.eles.length%2===1&&re===Math.floor(L.eles.length/2)?e.findStraightEdgePoints(ve):e.findBezierPoints(ve,j,re,Oe,$e),e.findEndpoints(ve),e.tryToCorrectInvalidPoints(ve,j),e.checkForInvalidEdgeWarning(ve),e.storeAllpts(ve),e.storeEdgeProjections(ve),e.calculateArrowAngles(ve),e.recalculateEdgeLabelProjections(ve),e.calculateLabelAngles(ve)}},S=0;S0){var he=u,fe=TC(he,m3(s)),Te=TC(he,m3($e)),ge=fe;if(Te2){var Qe=TC(he,{x:$e[2],y:$e[3]});Qe0){var oe=h,_e=TC(oe,m3(s)),Le=TC(oe,m3(ye)),Ye=_e;if(Le<_e&&(s=[ye[0],ye[1]],Ye=Le),ye.length>2){var Pe=TC(oe,{x:ye[2],y:ye[3]});Pe=g||S){v={cp:w,segment:T};break}}if(v)break}var O=v.cp,k=v.segment,E=(g-y)/k.length,_=k.t1-k.t0,I=p?k.t0+_*E:k.t1-_*E;I=v9(0,I,1),e=v3(O.p0,O.p1,O.p2,I),f=M3n(O.p0,O.p1,O.p2,I);break}case"straight":case"segments":case"haystack":{for(var L=0,R,D,M,P,N=n.allpts.length,F=0;F+3=g));F+=2);var B=g-D,V=B/R;V=v9(0,V,1),e=e_n(M,P,V),f=CPt(M,P);break}}s("labelX",d,e.x),s("labelY",d,e.y),s("labelAutoAngle",d,f)}};u("source"),u("target"),this.applyLabelDimensions(t)}},P0.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))},P0.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),i=wC(n,t._private.labelDimsKey);if(Qu(r.rscratch,"prefixedLabelDimsKey",e)!==i){D0(r.rscratch,"prefixedLabelDimsKey",e,i);var a=this.calculateLabelDimensions(t,n),s=t.pstyle("line-height").pfValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("text-wrap").strValue,u=Qu(r.rscratch,"labelWrapCachedLines",e)||[],h=l!=="wrap"?1:Math.max(u.length,1),d=o*s,f=a.width,p=a.height+(h-1)*(s-1)*o;D0(r.rstyle,"labelWidth",e,f),D0(r.rscratch,"labelWidth",e,f),D0(r.rstyle,"labelHeight",e,p),D0(r.rscratch,"labelHeight",e,p),D0(r.rscratch,"labelLineHeight",e,d),D0(r.rscratch,"labelActualDescent",e,a.labelActualDescent)}},P0.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",i=t.pstyle(n+"label").strValue,a=t.pstyle("text-transform").value,s=function(U,Q){return Q?(D0(r.rscratch,U,e,Q),Q):Qu(r.rscratch,U,e)};if(!i)return"";a=="none"||(a=="uppercase"?i=i.toUpperCase():a=="lowercase"&&(i=i.toLowerCase()));var o=t.pstyle("text-wrap").value;if(o==="wrap"){var l=s("labelKey");if(l!=null&&s("labelWrapKey")===l)return s("labelWrapCachedText");for(var u="​",h=i.split(` -`),d=t.pstyle("text-max-width").pfValue,f=t.pstyle("text-overflow-wrap").value,p=f==="anywhere",g=[],m=/[\s\u200b]+|$/g,v=0;vd){var A=y.matchAll(m),T="",S=0,O=Gh(A),k;try{for(O.s();!(k=O.n()).done;){var E=k.value,_=E[0],I=y.substring(S,E.index);S=E.index+_.length;var L=T.length===0?I:T+I+_,R=this.calculateLabelDimensions(t,L),D=R.width;D<=d?T+=I+_:(T&&g.push(T),T=I+_)}}catch(z){O.e(z)}finally{O.f()}T.match(/^[\s\u200b]+$/)||g.push(T)}else g.push(y)}s("labelWrapCachedLines",g),i=s("labelWrapCachedText",g.join(` + */var IIt=function(e,r){this.recycle(e,r)};function O9(){return!1}function qJ(){return!0}IIt.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=O9,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?qJ:O9):e!=null&&e.type?r=e:this.type=e,r!=null&&(this.originalEvent=r.originalEvent,this.type=r.type!=null?r.type:this.type,this.cy=r.cy,this.target=r.target,this.position=r.position,this.renderedPosition=r.renderedPosition,this.namespace=r.namespace,this.layout=r.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,i=this.cy.zoom(),a=this.cy.pan();this.renderedPosition={x:n.x*i+a.x,y:n.y*i+a.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=qJ;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=qJ;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=qJ,this.stopPropagation()},isDefaultPrevented:O9,isPropagationStopped:O9,isImmediatePropagationStopped:O9};var PIt=/^([^.]+)(\.(?:[^.]+))?$/,N4n=".*",NIt={qualifierCompare:function(e,r){return e===r},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},BIt=Object.keys(NIt),B4n={};function jJ(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:B4n,e=arguments.length>1?arguments[1]:void 0,r=0;r=0;o--)s(o);return this},G2.removeAllListeners=function(){return this.removeListener("*")},G2.emit=G2.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,Oa(e)||(e=[e]),$4n(this,function(a,s){r!=null&&(n=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],i=n.length);for(var o=function(){var h=n[l];if(h.type===s.type&&(!h.namespace||h.namespace===s.namespace||h.namespace===N4n)&&a.eventMatches(a.context,h,s)){var d=[s];e!=null&&OEn(d,e),a.beforeEmit(a.context,h,s),h.conf&&h.conf.one&&(a.listeners=a.listeners.filter(function(g){return g!==h}));var f=a.callbackContext(a.context,h,s),p=h.callback.apply(f,d);a.afterEmit(a.context,h,s),p===!1&&(s.stopPropagation(),s.preventDefault())}},l=0;l1&&!s){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,a.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,n=e._private.data.id,i=r.map,a=i.get(n);if(!a)return this;var s=a.index;return this.unmergeAt(s),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&Wr(e)){var n=e;e=r.mutableElements().filter(n)}for(var i=0;i=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},map:function(e,r){for(var n=[],i=this,a=0;an&&(n=l,i=o)}return{value:n,ele:i}},min:function(e,r){for(var n=1/0,i,a=this,s=0;s=0&&a"u"?"undefined":rl(Symbol))!=e&&rl(Symbol.iterator)!=e;r&&(KJ[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},a=0,s=this.length;return qDt({next:function(){return a1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],i=n.cy();if(i.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,i.style().apply(n));var a=n._private.style[e];return a??(r?i.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var n=r.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},style:function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var i=!1,a=n.style();if(Mi(e)){var s=e;a.applyBypass(this,s,i),this.emitAndNotify("style")}else if(Wr(e))if(r===void 0){var o=this[0];return o?a.getStylePropertyValue(o,e):void 0}else a.applyBypass(this,e,r,i),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?a.getRawStyle(l):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,i=r.style(),a=this;if(e===void 0)for(var s=0;s0&&e.push(h[0]),e.push(o[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),nu.neighbourhood=nu.neighborhood,nu.closedNeighbourhood=nu.closedNeighborhood,nu.openNeighbourhood=nu.openNeighborhood,sn(nu,{source:gp(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:gp(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:qIt({attr:"source"}),targets:qIt({attr:"target"})});function qIt(t){return function(r){for(var n=[],i=0;i0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),nu.componentsOf=nu.components;var mc=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){vs("A collection must have a reference to the core");return}var a=new S1,s=!1;if(!r)r=[];else if(r.length>0&&Mi(r[0])&&!l9(r[0])){s=!0;for(var o=[],l=new g3,u=0,h=r.length;u0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=r.cy(),i=n._private,a=[],s=[],o,l=0,u=r.length;l0){for(var F=o.length===r.length?r:new mc(n,o),B=0;B0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=[],i={},a=r._private.cy;function s(R){for(var D=R._private.edges,M=0;M0&&(t?_.emitAndNotify("remove"):e&&_.emit("remove"));for(var I=0;I0?I=R:_=R;while(Math.abs(L)>s&&++D=a?b(E,D):M===0?D:w(E,_,_+u)}var S=!1;function T(){S=!0,(t!==e||r!==n)&&x()}var O=function(_){return S||T(),t===e&&r===n?_:_===0?0:_===1?1:v(A(_),e,n)};O.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var k="generateBezier("+[t,e,r,n]+")";return O.toString=function(){return k},O}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var j4n=function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,i,a){var s={x:n.x+a.dx*i,v:n.v+a.dv*i,tension:n.tension,friction:n.friction};return{dx:s.v,dv:t(s)}}function r(n,i){var a={dx:n.v,dv:t(n)},s=e(n,i*.5,a),o=e(n,i*.5,s),l=e(n,i,o),u=1/6*(a.dx+2*(s.dx+o.dx)+l.dx),h=1/6*(a.dv+2*(s.dv+o.dv)+l.dv);return n.x=n.x+u*i,n.v=n.v+h*i,n}return function n(i,a,s){var o={x:-1,v:0,tension:null,friction:null},l=[0],u=0,h=1/1e4,d=16/1e3,f,p,g;for(i=parseFloat(i)||500,a=parseFloat(a)||20,s=s||null,o.tension=i,o.friction=a,f=s!==null,f?(u=n(i,a),p=u/s*d):p=d;g=r(g||o,p),l.push(1+g.x),u+=16,Math.abs(g.x)>h&&Math.abs(g.v)>h;);return f?function(m){return l[m*(l.length-1)|0]}:u}}(),Na=function(e,r,n,i){var a=q4n(e,r,n,i);return function(s,o,l){return s+(o-s)*a(l)}},tee={linear:function(e,r,n){return e+(r-e)*n},ease:Na(.25,.1,.25,1),"ease-in":Na(.42,0,1,1),"ease-out":Na(0,0,.58,1),"ease-in-out":Na(.42,0,.58,1),"ease-in-sine":Na(.47,0,.745,.715),"ease-out-sine":Na(.39,.575,.565,1),"ease-in-out-sine":Na(.445,.05,.55,.95),"ease-in-quad":Na(.55,.085,.68,.53),"ease-out-quad":Na(.25,.46,.45,.94),"ease-in-out-quad":Na(.455,.03,.515,.955),"ease-in-cubic":Na(.55,.055,.675,.19),"ease-out-cubic":Na(.215,.61,.355,1),"ease-in-out-cubic":Na(.645,.045,.355,1),"ease-in-quart":Na(.895,.03,.685,.22),"ease-out-quart":Na(.165,.84,.44,1),"ease-in-out-quart":Na(.77,0,.175,1),"ease-in-quint":Na(.755,.05,.855,.06),"ease-out-quint":Na(.23,1,.32,1),"ease-in-out-quint":Na(.86,0,.07,1),"ease-in-expo":Na(.95,.05,.795,.035),"ease-out-expo":Na(.19,1,.22,1),"ease-in-out-expo":Na(1,0,0,1),"ease-in-circ":Na(.6,.04,.98,.335),"ease-out-circ":Na(.075,.82,.165,1),"ease-in-out-circ":Na(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return tee.linear;var i=j4n(e,r,n);return function(a,s,o){return a+(s-a)*i(o)}},"cubic-bezier":Na};function KIt(t,e,r,n,i){if(n===1||e===r)return r;var a=i(e,r,n);return t==null||((t.roundValue||t.color)&&(a=Math.round(a)),t.min!==void 0&&(a=Math.max(a,t.min)),t.max!==void 0&&(a=Math.min(a,t.max))),a}function ZIt(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function D3(t,e,r,n,i){var a=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var s=ZIt(t,i),o=ZIt(e,i);if(or(s)&&or(o))return KIt(a,s,o,r,n);if(Oa(s)&&Oa(o)){for(var l=[],u=0;u0?(p==="spring"&&g.push(s.duration),s.easingImpl=tee[p].apply(null,g)):s.easingImpl=tee[p]}var m=s.easingImpl,v;if(s.duration===0?v=1:v=(r-l)/s.duration,s.applying&&(v=s.progress),v<0?v=0:v>1&&(v=1),s.delay==null){var y=s.startPosition,b=s.position;if(b&&i&&!t.locked()){var x={};k9(y.x,b.x)&&(x.x=D3(y.x,b.x,v,m)),k9(y.y,b.y)&&(x.y=D3(y.y,b.y,v,m)),t.position(x)}var w=s.startPan,A=s.pan,S=a.pan,T=A!=null&&n;T&&(k9(w.x,A.x)&&(S.x=D3(w.x,A.x,v,m)),k9(w.y,A.y)&&(S.y=D3(w.y,A.y,v,m)),t.emit("pan"));var O=s.startZoom,k=s.zoom,E=k!=null&&n;E&&(k9(O,k)&&(a.zoom=v9(a.minZoom,D3(O,k,v,m),a.maxZoom)),t.emit("zoom")),(T||E)&&t.emit("viewport");var _=s.style;if(_&&_.length>0&&i){for(var I=0;I<_.length;I++){var L=_[I],R=L.name,D=L,M=s.startStyle[R],P=h.properties[M.name],N=D3(M,D,v,m,P);h.overrideBypass(t,R,N)}t.emit("style")}}return s.progress=v,v}function k9(t,e){return t==null||e==null?!1:or(t)&&or(e)?!0:!!(t&&e)}function K4n(t,e,r,n){var i=e._private;i.started=!0,i.startTime=r-i.progress*i.duration}function JIt(t,e){var r=e._private.aniEles,n=[];function i(h,d){var f=h._private,p=f.animation.current,g=f.animation.queue,m=!1;if(p.length===0){var v=g.shift();v&&p.push(v)}for(var y=function(S){for(var T=S.length-1;T>=0;T--){var O=S[T];O()}S.splice(0,S.length)},b=p.length-1;b>=0;b--){var x=p[b],w=x._private;if(w.stopped){p.splice(b,1),w.hooked=!1,w.playing=!1,w.started=!1,y(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||K4n(h,x,t),X4n(h,x,t,d),w.applying&&(w.applying=!1),y(w.frames),w.step!=null&&w.step(t),x.completed()&&(p.splice(b,1),w.hooked=!1,w.playing=!1,w.started=!1,y(w.completes)),m=!0)}return!d&&p.length===0&&g.length===0&&n.push(h),m}for(var a=!1,s=0;s0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var Z4n={animate:ta.animate(),animation:ta.animation(),animated:ta.animated(),clearQueue:ta.clearQueue(),delay:ta.delay(),delayAnimation:ta.delayAnimation(),stop:ta.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&CJ(function(a){JIt(a,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(a,s){JIt(s,e)},n.beforeRenderPriorities.animations):r()}},J4n={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var i=r.qualifier;return i!=null?e!==n.target&&l9(n.target)&&i.matches(n.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e}},ree=function(e){return Wr(e)?new F2(e):e},ePt={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new jJ(J4n,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,ree(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,ree(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,ree(r),n),this},once:function(e,r,n){return this.emitter().one(e,ree(r),n),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};ta.eventAliasesOn(ePt);var XOe={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};XOe.jpeg=XOe.jpg;var nee={layout:function(e){var r=this;if(e==null){vs("Layout options must be specified to make a layout");return}if(e.name==null){vs("A `name` must be specified to make a layout");return}var n=e.name,i=r.extension("layout",n);if(i==null){vs("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var a;Wr(e.eles)?a=r.$(e.eles):a=e.eles!=null?e.eles:r.$();var s=new i(sn({},e,{cy:r,eles:a}));return s}};nee.createLayout=nee.makeLayout=nee.layout;var e3n={notify:function(e,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var i=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();r!=null&&i.merge(r);return}if(n.notificationsEnabled){var a=this.renderer();this.destroyed()||!a||a.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var i=e.batchNotifications[n];i.empty()?r.notify(n):r.notify(n,i)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),i=0;i0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var i=n._private;i.rscratch={},i.rstyle={},i.animation.current=[],i.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};KOe.invalidateDimensions=KOe.resize;var iee={collection:function(e,r){return Wr(e)?this.$(e):ef(e)?e.collection():Oa(e)?(r||(r={}),new mc(this,e,r.unique,r.removed)):new mc(this)},nodes:function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};iee.elements=iee.filter=iee.$;var Nl={},E9="t",r3n="f";Nl.apply=function(t){for(var e=this,r=e._private,n=r.cy,i=n.collection(),a=0;a0;if(f||d&&p){var g=void 0;f&&p||f?g=u.properties:p&&(g=u.mappedProperties);for(var m=0;m1&&(w=1),o.color){var S=n.valueMin[0],T=n.valueMax[0],O=n.valueMin[1],k=n.valueMax[1],E=n.valueMin[2],_=n.valueMax[2],I=n.valueMin[3]==null?1:n.valueMin[3],L=n.valueMax[3]==null?1:n.valueMax[3],R=[Math.round(S+(T-S)*w),Math.round(O+(k-O)*w),Math.round(E+(_-E)*w),Math.round(I+(L-I)*w)];a={bypass:n.bypass,name:n.name,value:R,strValue:"rgb("+R[0]+", "+R[1]+", "+R[2]+")"}}else if(o.number){var D=n.valueMin+(n.valueMax-n.valueMin)*w;a=this.parse(n.name,D,n.bypass,f)}else return!1;if(!a)return m(),!1;a.mapping=n,n=a;break}case s.data:{for(var M=n.field.split("."),P=d.data,N=0;N0&&a>0){for(var o={},l=!1,u=0;u0?t.delayAnimation(s).play().promise().then(x):x()}).then(function(){return t.animation({style:o,duration:a,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1)},Nl.checkTrigger=function(t,e,r,n,i,a){var s=this.properties[e],o=i(s);t.removed()||o!=null&&o(r,n,t)&&a(s)},Nl.checkZOrderTrigger=function(t,e,r,n){var i=this;this.checkTrigger(t,e,r,n,function(a){return a.triggersZOrder},function(){i._private.cy.notify("zorder",t)})},Nl.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})},Nl.checkConnectedEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfConnectedEdges},function(i){t.connectedEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})},Nl.checkParallelEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfParallelEdges},function(i){t.parallelEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})},Nl.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n),this.checkConnectedEdgesBoundsTrigger(t,e,r,n),this.checkParallelEdgesBoundsTrigger(t,e,r,n)};var _9={};_9.applyBypass=function(t,e,r,n){var i=this,a=[],s=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var o=0;oi.length?n=n.substr(i.length):n=""}function l(){a.length>s.length?a=a.substr(s.length):a=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var h=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){ea("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}i=h[0];var d=h[1];if(d!=="core"){var f=new F2(d);if(f.invalid){ea("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),o();continue}}var p=h[2],g=!1;a=p;for(var m=[];;){var v=a.match(/^\s*$/);if(v)break;var y=a.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!y){ea("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+p),g=!0;break}s=y[0];var b=y[1],x=y[2],w=e.properties[b];if(!w){ea("Skipping property: Invalid property name in: "+s),l();continue}var A=r.parse(b,x);if(!A){ea("Skipping property: Invalid property definition in: "+s),l();continue}m.push({name:b,val:x}),l()}if(g){o();break}r.selector(d);for(var S=0;S=7&&e[0]==="d"&&(h=new RegExp(o.data.regex).exec(e))){if(r)return!1;var f=o.data;return{name:t,value:h,strValue:""+e,mapped:f,field:h[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(d=new RegExp(o.mapData.regex).exec(e))){if(r||u.multiple)return!1;var p=o.mapData;if(!(u.color||u.number))return!1;var g=this.parse(t,d[4]);if(!g||g.mapped)return!1;var m=this.parse(t,d[5]);if(!m||m.mapped)return!1;if(g.pfValue===m.pfValue||g.strValue===m.strValue)return ea("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+g.strValue+"`"),this.parse(t,g.strValue);if(u.color){var v=g.value,y=m.value,b=v[0]===y[0]&&v[1]===y[1]&&v[2]===y[2]&&(v[3]===y[3]||(v[3]==null||v[3]===1)&&(y[3]==null||y[3]===1));if(b)return!1}return{name:t,value:d,strValue:""+e,mapped:p,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:g.value,valueMax:m.value,bypass:r}}}if(u.multiple&&n!=="multiple"){var x;if(l?x=e.split(/\s+/):Oa(e)?x=e:x=[e],u.evenMultiple&&x.length%2!==0)return null;for(var w=[],A=[],S=[],T="",O=!1,k=0;k0?" ":"")+E.strValue}return u.validate&&!u.validate(w,A)?null:u.singleEnum&&O?w.length===1&&Wr(w[0])?{name:t,value:w[0],strValue:w[0],bypass:r}:null:{name:t,value:w,pfValue:S,strValue:T,bypass:r,units:A}}var _=function(){for(var q=0;qu.max||u.strictMax&&e===u.max))return null;var M={name:t,value:e,strValue:""+e+(I||""),units:I,bypass:r};return u.unitless||I!=="px"&&I!=="em"?M.pfValue=e:M.pfValue=I==="px"||!I?e:this.getEmSizeInPixels()*e,(I==="ms"||I==="s")&&(M.pfValue=I==="ms"?e:1e3*e),(I==="deg"||I==="rad")&&(M.pfValue=I==="rad"?e:ZEn(e)),I==="%"&&(M.pfValue=e/100),M}else if(u.propList){var P=[],N=""+e;if(N!=="none"){for(var F=N.split(/\s*,\s*|\s+/),B=0;B0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((s-2*r)/n.w,(o-2*r)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l=n.minZoom&&(n.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,n=r.pan,i=r.zoom,a,s,o=!1;if(r.zoomingEnabled||(o=!0),or(e)?s=e:Mi(e)&&(s=e.level,e.position!=null?a=RJ(e.position,i,n):e.renderedPosition!=null&&(a=e.renderedPosition),a!=null&&!r.panningEnabled&&(o=!0)),s=s>r.maxZoom?r.maxZoom:s,s=sr.maxZoom||!r.zoomingEnabled?s=!0:(r.zoom=l,a.push("zoom"))}if(i&&(!s||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;or(u.x)&&(r.pan.x=u.x,o=!1),or(u.y)&&(r.pan.y=u.y,o=!1),o||a.push("pan")}return a.length>0&&(a.push("viewport"),this.emit(a.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(Wr(e)){var n=e;e=this.mutableElements().filter(n)}else ef(e)||(e=this.mutableElements());if(e.length!==0){var i=e.boundingBox(),a=this.width(),s=this.height();r=r===void 0?this._private.zoom:r;var o={x:(a-r*(i.x1+i.x2))/2,y:(s-r*(i.y1+i.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?function(){var i=n.window().getComputedStyle(r),a=function(o){return parseFloat(i.getPropertyValue(o))};return{width:r.clientWidth-a("padding-left")-a("padding-right"),height:r.clientHeight-a("padding-top")-a("padding-bottom")}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,r=this._private.zoom,n=this.renderedExtent(),i={x1:(n.x1-e.x)/r,x2:(n.x2-e.x)/r,y1:(n.y1-e.y)/r,y2:(n.y2-e.y)/r};return i.w=i.x2-i.x1,i.h=i.y2-i.y1,i},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};OC.centre=OC.center,OC.autolockNodes=OC.autolock,OC.autoungrabifyNodes=OC.autoungrabify;var R9={data:ta.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:ta.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:ta.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:ta.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};R9.attr=R9.data,R9.removeAttr=R9.removeData;var D9=function(e){var r=this;e=sn({},e);var n=e.container;n&&!wJ(n)&&wJ(n[0])&&(n=n[0]);var i=n?n._cyreg:null;i=i||{},i&&i.cy&&(i.cy.destroy(),i={});var a=i.readies=i.readies||[];n&&(n._cyreg=i),i.cy=r;var s=nl!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=sn({name:s?"grid":"null"},o.layout),o.renderer=sn({name:s?"canvas":"null"},o.renderer);var l=function(g,m,v){return m!==void 0?m:v!==void 0?v:g},u=this._private={container:n,ready:!1,options:o,elements:new mc(this),listeners:[],aniEles:new mc(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:or(o.zoom)?o.zoom:1,pan:{x:Mi(o.pan)&&or(o.pan.x)?o.pan.x:0,y:Mi(o.pan)&&or(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var h=function(g,m){var v=g.some(Hkn);if(v)return A3.all(g).then(m);m(g)};u.styleEnabled&&r.setStyle([]);var d=sn({},o,o.renderer);r.initRenderer(d);var f=function(g,m,v){r.notifications(!1);var y=r.mutableElements();y.length>0&&y.remove(),g!=null&&(Mi(g)||Oa(g))&&r.add(g),r.one("layoutready",function(x){r.notifications(!0),r.emit(x),r.one("load",m),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",v),r.emit("done")});var b=sn({},r._private.options.layout);b.eles=r.elements(),r.layout(b).run()};h([o.style,o.elements],function(p){var g=p[0],m=p[1];u.styleEnabled&&r.style().append(g),f(m,function(){r.startAnimationLoop(),u.ready=!0,Cs(o.ready)&&r.on("ready",o.ready);for(var v=0;v0,o=!!t.boundingBox,l=Gu(o?t.boundingBox:structuredClone(e.extent())),u;if(ef(t.roots))u=t.roots;else if(Oa(t.roots)){for(var h=[],d=0;d0;){var R=L(),D=k(R,_);if(D)R.outgoers().filter(function(fe){return fe.isNode()&&r.has(fe)}).forEach(I);else if(D===null){ea("Detected double maximal shift for node `"+R.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var M=0;if(t.avoidOverlap)for(var P=0;P0&&y[0].length<=3?De/2:0),K=2*Math.PI/y[Qe].length*Te;return Qe===0&&y[0].length===1&&(qe=1),{x:re.x+qe*Math.cos(K),y:re.y+qe*Math.sin(K)}}else{var ce=y[Qe].length,be=Math.max(ce===1?0:o?(l.w-t.padding*2-ve.w)/((t.grid?Ce:ce)-1):(l.w-t.padding*2-ve.w)/((t.grid?Ce:ce)+1),M),ne={x:re.x+(Te+1-(ce+1)/2)*be,y:re.y+(Qe+1-(G+1)/2)*ae};return ne}},$e={downward:0,leftward:90,upward:180,rightward:-90};Object.keys($e).indexOf(t.direction)===-1&&vs("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys($e).join(", ")));var he=function(Se){return xEn(Oe(Se),l,$e[t.direction])};return r.nodes().layoutPositions(this,t,he),this};var o3n={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function nPt(t){this.options=sn({},o3n,t)}nPt.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));for(var s=Gu(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/a.length:e.sweep,u=l/Math.max(1,a.length-1),h,d=0,f=0;f1&&e.avoidOverlap){d*=1.75;var y=Math.cos(u)-Math.cos(0),b=Math.sin(u)-Math.sin(0),x=Math.sqrt(d*d/(y*y+b*b));h=Math.max(x,h)}var w=function(S,T){var O=e.startAngle+T*u*(i?1:-1),k=h*Math.cos(O),E=h*Math.sin(O),_={x:o.x+k,y:o.y+E};return _};return n.nodes().layoutPositions(this,e,w),this};var l3n={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function iPt(t){this.options=sn({},l3n,t)}iPt.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=t.cy,i=e.eles,a=i.nodes().not(":parent"),s=Gu(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=[],u=0,h=0;h0){var A=Math.abs(b[0].value-w.value);A>=v&&(b=[],y.push(b))}b.push(w)}var S=u+e.minNodeSpacing;if(!e.avoidOverlap){var T=y.length>0&&y[0].length>1,O=Math.min(s.w,s.h)/2-S,k=O/(y.length+T?1:0);S=Math.min(S,k)}for(var E=0,_=0;_1&&e.avoidOverlap){var D=Math.cos(R)-Math.cos(0),M=Math.sin(R)-Math.sin(0),P=Math.sqrt(S*S/(D*D+M*M));E=Math.max(P,E)}I.r=E,E+=S}if(e.equidistant){for(var N=0,F=0,B=0;B=t.numIter||(g3n(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature=t.animationThreshold&&a(),CJ(h)}};h()}else{for(;u;)u=s(l),l++;cPt(n,t),o()}return this},lee.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},lee.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var u3n=function(e,r,n){for(var i=n.eles.edges(),a=n.eles.nodes(),s=Gu(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:a.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:i.size(),temperature:n.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},l=n.eles.components(),u={},h=0;h0){o.graphSet.push(O);for(var h=0;hi.count?0:i.graph},aPt=function(e,r,n,i){var a=i.graphSet[n];if(-10)var d=i.nodeOverlap*h,f=Math.sqrt(o*o+l*l),p=d*o/f,g=d*l/f;else var m=cee(e,o,l),v=cee(r,-1*o,-1*l),y=v.x-m.x,b=v.y-m.y,x=y*y+b*b,f=Math.sqrt(x),d=(e.nodeRepulsion+r.nodeRepulsion)/x,p=d*y/f,g=d*b/f;e.isLocked||(e.offsetX-=p,e.offsetY-=g),r.isLocked||(r.offsetX+=p,r.offsetY+=g)}},y3n=function(e,r,n,i){if(n>0)var a=e.maxX-r.minX;else var a=r.maxX-e.minX;if(i>0)var s=e.maxY-r.minY;else var s=r.maxY-e.minY;return a>=0&&s>=0?Math.sqrt(a*a+s*s):0},cee=function(e,r,n){var i=e.positionX,a=e.positionY,s=e.height||1,o=e.width||1,l=n/r,u=s/o,h={};return r===0&&0n?(h.x=i,h.y=a+s/2,h):0r&&-1*u<=l&&l<=u?(h.x=i-o/2,h.y=a-o*n/2/r,h):0=u)?(h.x=i+s*r/2/n,h.y=a+s/2,h):(0>n&&(l<=-1*u||l>=u)&&(h.x=i-s*r/2/n,h.y=a-s/2),h)},b3n=function(e,r){for(var n=0;nn){var v=r.gravity*p/m,y=r.gravity*g/m;f.offsetX+=v,f.offsetY+=y}}}}},w3n=function(e,r){var n=[],i=0,a=-1;for(n.push.apply(n,e.graphSet[0]),a+=e.graphSet[0].length;i<=a;){var s=n[i++],o=e.idToIndex[s],l=e.layoutNodes[o],u=l.children;if(0n)var a={x:n*e/i,y:n*r/i};else var a={x:e,y:r};return a},lPt=function(e,r){var n=e.parentId;if(n!=null){var i=r.layoutNodes[r.idToIndex[n]],a=!1;if((i.maxX==null||e.maxX+i.padRight>i.maxX)&&(i.maxX=e.maxX+i.padRight,a=!0),(i.minX==null||e.minX-i.padLefti.maxY)&&(i.maxY=e.maxY+i.padBottom,a=!0),(i.minY==null||e.minY-i.padTopy&&(g+=v+r.componentSpacing,p=0,m=0,v=0)}}},T3n={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function uPt(t){this.options=sn({},T3n,t)}uPt.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));var a=Gu(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(a.h===0||a.w===0)n.nodes().layoutPositions(this,e,function(U){return{x:a.x1,y:a.y1}});else{var s=i.size(),o=Math.sqrt(s*a.h/a.w),l=Math.round(o),u=Math.round(a.w/a.h*o),h=function(Q){if(Q==null)return Math.min(l,u);var G=Math.min(l,u);G==l?l=Q:u=Q},d=function(Q){if(Q==null)return Math.max(l,u);var G=Math.max(l,u);G==l?l=Q:u=Q},f=e.rows,p=e.cols!=null?e.cols:e.columns;if(f!=null&&p!=null)l=f,u=p;else if(f!=null&&p==null)l=f,u=Math.ceil(s/l);else if(f==null&&p!=null)u=p,l=Math.ceil(s/u);else if(u*l>s){var g=h(),m=d();(g-1)*m>=s?h(g-1):(m-1)*g>=s&&d(m-1)}else for(;u*l=s?d(y+1):h(v+1)}var b=a.w/u,x=a.h/l;if(e.condense&&(b=0,x=0),e.avoidOverlap)for(var w=0;w=u&&(D=0,R++)},P={},N=0;N(D=d_n(t,e,M[P],M[P+1],M[P+2],M[P+3])))return v(T,D),!0}else if(k.edgeType==="bezier"||k.edgeType==="multibezier"||k.edgeType==="self"||k.edgeType==="compound"){for(var M=k.allpts,P=0;P+5(D=h_n(t,e,M[P],M[P+1],M[P+2],M[P+3],M[P+4],M[P+5])))return v(T,D),!0}for(var N=N||O.source,F=F||O.target,B=i.getArrowWidth(E,_),V=[{name:"source",x:k.arrowStartX,y:k.arrowStartY,angle:k.srcArrowAngle},{name:"target",x:k.arrowEndX,y:k.arrowEndY,angle:k.tgtArrowAngle},{name:"mid-source",x:k.midX,y:k.midY,angle:k.midsrcArrowAngle},{name:"mid-target",x:k.midX,y:k.midY,angle:k.midtgtArrowAngle}],P=0;P0&&(y(N),y(F))}function x(T,O,k){return Qu(T,O,k)}function w(T,O){var k=T._private,E=f,_;O?_=O+"-":_="",T.boundingBox();var I=k.labelBounds[O||"main"],L=T.pstyle(_+"label").value,R=T.pstyle("text-events").strValue==="yes";if(!(!R||!L)){var D=x(k.rscratch,"labelX",O),M=x(k.rscratch,"labelY",O),P=x(k.rscratch,"labelAngle",O),N=T.pstyle(_+"text-margin-x").pfValue,F=T.pstyle(_+"text-margin-y").pfValue,B=I.x1-E-N,V=I.x2+E-N,z=I.y1-E-F,U=I.y2+E-F;if(P){var Q=Math.cos(P),G=Math.sin(P),X=function(ve,ae){return ve=ve-D,ae=ae-M,{x:ve*Q-ae*G+D,y:ve*G+ae*Q+M}},Y=X(B,z),le=X(B,U),q=X(V,z),Z=X(V,U),ee=[Y.x+N,Y.y+F,q.x+N,q.y+F,Z.x+N,Z.y+F,le.x+N,le.y+F];if(Hh(t,e,ee))return v(T),!0}else if(P2(I,t,e))return v(T),!0}}for(var A=s.length-1;A>=0;A--){var S=s[A];S.isNode()?y(S)||w(S):b(S)||w(S)||w(S,"source")||w(S,"target")}return o},kC.getAllInBox=function(t,e,r,n){var i=this.getCachedZSortedEles().interactive,a=this.cy.zoom(),s=2/a,o=[],l=Math.min(t,r),u=Math.max(t,r),h=Math.min(e,n),d=Math.max(e,n);t=l,r=u,e=h,n=d;var f=Gu({x1:t,y1:e,x2:r,y2:n}),p=[{x:f.x1,y:f.y1},{x:f.x2,y:f.y1},{x:f.x2,y:f.y2},{x:f.x1,y:f.y2}],g=[[p[0],p[1]],[p[1],p[2]],[p[2],p[3]],[p[3],p[0]]];function m(ve,ae,Ce){return Qu(ve,ae,Ce)}function v(ve,ae){var Ce=ve._private,Oe=s,$e="";ve.boundingBox();var he=Ce.labelBounds.main;if(!he)return null;var fe=m(Ce.rscratch,"labelX",ae),Se=m(Ce.rscratch,"labelY",ae),ge=m(Ce.rscratch,"labelAngle",ae),Qe=ve.pstyle($e+"text-margin-x").pfValue,Te=ve.pstyle($e+"text-margin-y").pfValue,De=he.x1-Oe-Qe,qe=he.x2+Oe-Qe,K=he.y1-Oe-Te,ce=he.y2+Oe-Te;if(ge){var be=Math.cos(ge),ne=Math.sin(ge),j=function(pe,te){return pe=pe-fe,te=te-Se,{x:pe*be-te*ne+fe,y:pe*ne+te*be+Se}};return[j(De,K),j(qe,K),j(qe,ce),j(De,ce)]}else return[{x:De,y:K},{x:qe,y:K},{x:qe,y:ce},{x:De,y:ce}]}function y(ve,ae,Ce,Oe){function $e(he,fe,Se){return(Se.y-he.y)*(fe.x-he.x)>(fe.y-he.y)*(Se.x-he.x)}return $e(ve,Ce,Oe)!==$e(ae,Ce,Oe)&&$e(ve,ae,Ce)!==$e(ve,ae,Oe)}for(var b=0;b0?-(Math.PI-e.ang):Math.PI+e.ang},R3n=function(e,r,n,i,a){if(e!==xPt?wPt(r,e,M0):_3n(vp,M0),wPt(r,n,vp),mPt=M0.nx*vp.ny-M0.ny*vp.nx,vPt=M0.nx*vp.nx-M0.ny*-vp.ny,C1=Math.asin(Math.max(-1,Math.min(1,mPt))),Math.abs(C1)<1e-6){nke=r.x,ike=r.y,RC=M3=0;return}EC=1,hee=!1,vPt<0?C1<0?C1=Math.PI+C1:(C1=Math.PI-C1,EC=-1,hee=!0):C1>0&&(EC=-1,hee=!0),r.radius!==void 0?M3=r.radius:M3=i,_C=C1/2,dee=Math.min(M0.len/2,vp.len/2),a?(I0=Math.abs(Math.cos(_C)*M3/Math.sin(_C)),I0>dee?(I0=dee,RC=Math.abs(I0*Math.sin(_C)/Math.cos(_C))):RC=M3):(I0=Math.min(dee,M3),RC=Math.abs(I0*Math.sin(_C)/Math.cos(_C))),ake=r.x+vp.nx*I0,ske=r.y+vp.ny*I0,nke=ake-vp.ny*RC*EC,ike=ske+vp.nx*RC*EC,yPt=r.x+M0.nx*I0,bPt=r.y+M0.ny*I0,xPt=r};function APt(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function oke(t,e,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(R3n(t,e,r,n,i),{cx:nke,cy:ike,radius:RC,startX:yPt,startY:bPt,stopX:ake,stopY:ske,startAngle:M0.ang+Math.PI/2*EC,endAngle:vp.ang-Math.PI/2*EC,counterClockwise:hee})}var L9=.01,D3n=Math.sqrt(2*L9),au={};au.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,i=e.vectorNormInverse,a,s=t.pstyle("source-endpoint"),o=t.pstyle("target-endpoint"),l=s.units!=null&&o.units!=null,u=function(A,S,T,O){var k=O-S,E=T-A,_=Math.sqrt(E*E+k*k);return{x:-k/_,y:E/_}},h=t.pstyle("edge-distances").value;switch(h){case"node-position":a=r;break;case"intersection":a=n;break;case"endpoints":{if(l){var d=this.manualEndptToPx(t.source()[0],s),f=$o(d,2),p=f[0],g=f[1],m=this.manualEndptToPx(t.target()[0],o),v=$o(m,2),y=v[0],b=v[1],x={x1:p,y1:g,x2:y,y2:b};i=u(p,g,y,b),a=x}else ea("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),a=n;break}}return{midptPts:a,vectorNormInverse:i}},au.findHaystackPoints=function(t){for(var e=0;e0?Math.max(te-ye,0):Math.min(te+ye,0)},L=I(E,O),R=I(_,k),D=!1;b===u?y=Math.abs(L)>Math.abs(R)?i:n:b===l||b===o?(y=n,D=!0):(b===a||b===s)&&(y=i,D=!0);var M=y===n,P=M?R:L,N=M?_:E,F=RCe(N),B=!1;!(D&&(w||S))&&(b===o&&N<0||b===l&&N>0||b===a&&N>0||b===s&&N<0)&&(F*=-1,P=F*Math.abs(P),B=!0);var V;if(w){var z=A<0?1+A:A;V=z*P}else{var U=A<0?P:0;V=U+A*F}var Q=function(te){return Math.abs(te)=Math.abs(P)},G=Q(V),X=Q(Math.abs(P)-Math.abs(V)),Y=G||X;if(Y&&!B)if(M){var le=Math.abs(N)<=f/2,q=Math.abs(E)<=p/2;if(le){var Z=(h.x1+h.x2)/2,ee=h.y1,re=h.y2;r.segpts=[Z,ee,Z,re]}else if(q){var ve=(h.y1+h.y2)/2,ae=h.x1,Ce=h.x2;r.segpts=[ae,ve,Ce,ve]}else r.segpts=[h.x1,h.y2]}else{var Oe=Math.abs(N)<=d/2,$e=Math.abs(_)<=g/2;if(Oe){var he=(h.y1+h.y2)/2,fe=h.x1,Se=h.x2;r.segpts=[fe,he,Se,he]}else if($e){var ge=(h.x1+h.x2)/2,Qe=h.y1,Te=h.y2;r.segpts=[ge,Qe,ge,Te]}else r.segpts=[h.x2,h.y1]}else if(M){var De=h.y1+V+(v?f/2*F:0),qe=h.x1,K=h.x2;r.segpts=[qe,De,K,De]}else{var ce=h.x1+V+(v?d/2*F:0),be=h.y1,ne=h.y2;r.segpts=[ce,be,ce,ne]}if(r.isRound){var j=t.pstyle("taxi-radius").value,ie=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(j),r.isArcRadius=new Array(r.segpts.length/2).fill(ie)}},au.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,i=e.tgtPos,a=e.srcW,s=e.srcH,o=e.tgtW,l=e.tgtH,u=e.srcShape,h=e.tgtShape,d=e.srcCornerRadius,f=e.tgtCornerRadius,p=e.srcRs,g=e.tgtRs,m=!or(r.startX)||!or(r.startY),v=!or(r.arrowStartX)||!or(r.arrowStartY),y=!or(r.endX)||!or(r.endY),b=!or(r.arrowEndX)||!or(r.arrowEndY),x=3,w=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,A=x*w,S=AC({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),T=SN.poolIndex()){var F=P;P=N,N=F}var B=L.srcPos=P.position(),V=L.tgtPos=N.position(),z=L.srcW=P.outerWidth(),U=L.srcH=P.outerHeight(),Q=L.tgtW=N.outerWidth(),G=L.tgtH=N.outerHeight(),X=L.srcShape=r.nodeShapes[e.getNodeShape(P)],Y=L.tgtShape=r.nodeShapes[e.getNodeShape(N)],le=L.srcCornerRadius=P.pstyle("corner-radius").value==="auto"?"auto":P.pstyle("corner-radius").pfValue,q=L.tgtCornerRadius=N.pstyle("corner-radius").value==="auto"?"auto":N.pstyle("corner-radius").pfValue,Z=L.tgtRs=N._private.rscratch,ee=L.srcRs=P._private.rscratch;L.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var re=0;re=D3n||(K=Math.sqrt(Math.max(qe*qe,L9)+Math.max(De*De,L9)));var ce=L.vector={x:qe,y:De},be=L.vectorNorm={x:ce.x/K,y:ce.y/K},ne={x:-be.y,y:be.x};L.nodesOverlap=!or(K)||Y.checkPoint(he[0],he[1],0,Q,G,V.x,V.y,q,Z)||X.checkPoint(Se[0],Se[1],0,z,U,B.x,B.y,le,ee),L.vectorNormInverse=ne,R={nodesOverlap:L.nodesOverlap,dirCounts:L.dirCounts,calculatedIntersection:!0,hasBezier:L.hasBezier,hasUnbundled:L.hasUnbundled,eles:L.eles,srcPos:V,srcRs:Z,tgtPos:B,tgtRs:ee,srcW:Q,srcH:G,tgtW:z,tgtH:U,srcIntn:ge,tgtIntn:fe,srcShape:Y,tgtShape:X,posPts:{x1:Te.x2,y1:Te.y2,x2:Te.x1,y2:Te.y1},intersectionPts:{x1:Qe.x2,y1:Qe.y2,x2:Qe.x1,y2:Qe.y1},vector:{x:-ce.x,y:-ce.y},vectorNorm:{x:-be.x,y:-be.y},vectorNormInverse:{x:-ne.x,y:-ne.y}}}var j=$e?R:L;ae.nodesOverlap=j.nodesOverlap,ae.srcIntn=j.srcIntn,ae.tgtIntn=j.tgtIntn,ae.isRound=Ce.startsWith("round"),i&&(P.isParent()||P.isChild()||N.isParent()||N.isChild())&&(P.parents().anySame(N)||N.parents().anySame(P)||P.same(N)&&P.isParent())?e.findCompoundLoopPoints(ve,j,re,Oe):P===N?e.findLoopPoints(ve,j,re,Oe):Ce.endsWith("segments")?e.findSegmentsPoints(ve,j):Ce.endsWith("taxi")?e.findTaxiPoints(ve,j):Ce==="straight"||!Oe&&L.eles.length%2===1&&re===Math.floor(L.eles.length/2)?e.findStraightEdgePoints(ve):e.findBezierPoints(ve,j,re,Oe,$e),e.findEndpoints(ve),e.tryToCorrectInvalidPoints(ve,j),e.checkForInvalidEdgeWarning(ve),e.storeAllpts(ve),e.storeEdgeProjections(ve),e.calculateArrowAngles(ve),e.recalculateEdgeLabelProjections(ve),e.calculateLabelAngles(ve)}},T=0;T0){var he=u,fe=SC(he,m3(s)),Se=SC(he,m3($e)),ge=fe;if(Se2){var Qe=SC(he,{x:$e[2],y:$e[3]});Qe0){var oe=h,_e=SC(oe,m3(s)),Le=SC(oe,m3(ye)),Ye=_e;if(Le<_e&&(s=[ye[0],ye[1]],Ye=Le),ye.length>2){var Pe=SC(oe,{x:ye[2],y:ye[3]});Pe=g||T){v={cp:w,segment:S};break}}if(v)break}var O=v.cp,k=v.segment,E=(g-y)/k.length,_=k.t1-k.t0,I=p?k.t0+_*E:k.t1-_*E;I=v9(0,I,1),e=v3(O.p0,O.p1,O.p2,I),f=M3n(O.p0,O.p1,O.p2,I);break}case"straight":case"segments":case"haystack":{for(var L=0,R,D,M,P,N=n.allpts.length,F=0;F+3=g));F+=2);var B=g-D,V=B/R;V=v9(0,V,1),e=e_n(M,P,V),f=CPt(M,P);break}}s("labelX",d,e.x),s("labelY",d,e.y),s("labelAutoAngle",d,f)}};u("source"),u("target"),this.applyLabelDimensions(t)}},P0.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))},P0.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),i=wC(n,t._private.labelDimsKey);if(Qu(r.rscratch,"prefixedLabelDimsKey",e)!==i){D0(r.rscratch,"prefixedLabelDimsKey",e,i);var a=this.calculateLabelDimensions(t,n),s=t.pstyle("line-height").pfValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("text-wrap").strValue,u=Qu(r.rscratch,"labelWrapCachedLines",e)||[],h=l!=="wrap"?1:Math.max(u.length,1),d=o*s,f=a.width,p=a.height+(h-1)*(s-1)*o;D0(r.rstyle,"labelWidth",e,f),D0(r.rscratch,"labelWidth",e,f),D0(r.rstyle,"labelHeight",e,p),D0(r.rscratch,"labelHeight",e,p),D0(r.rscratch,"labelLineHeight",e,d),D0(r.rscratch,"labelActualDescent",e,a.labelActualDescent)}},P0.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",i=t.pstyle(n+"label").strValue,a=t.pstyle("text-transform").value,s=function(U,Q){return Q?(D0(r.rscratch,U,e,Q),Q):Qu(r.rscratch,U,e)};if(!i)return"";a=="none"||(a=="uppercase"?i=i.toUpperCase():a=="lowercase"&&(i=i.toLowerCase()));var o=t.pstyle("text-wrap").value;if(o==="wrap"){var l=s("labelKey");if(l!=null&&s("labelWrapKey")===l)return s("labelWrapCachedText");for(var u="​",h=i.split(` +`),d=t.pstyle("text-max-width").pfValue,f=t.pstyle("text-overflow-wrap").value,p=f==="anywhere",g=[],m=/[\s\u200b]+|$/g,v=0;vd){var A=y.matchAll(m),S="",T=0,O=Gh(A),k;try{for(O.s();!(k=O.n()).done;){var E=k.value,_=E[0],I=y.substring(T,E.index);T=E.index+_.length;var L=S.length===0?I:S+I+_,R=this.calculateLabelDimensions(t,L),D=R.width;D<=d?S+=I+_:(S&&g.push(S),S=I+_)}}catch(z){O.e(z)}finally{O.f()}S.match(/^[\s\u200b]+$/)||g.push(S)}else g.push(y)}s("labelWrapCachedLines",g),i=s("labelWrapCachedText",g.join(` `)),s("labelWrapKey",l)}else if(o==="ellipsis"){var M=t.pstyle("text-max-width").pfValue,P="",N="…",F=!1;if(this.calculateLabelDimensions(t,i).widthM)break;P+=i[B],B===i.length-1&&(F=!0)}return F||(P+=N),P}return i},P0.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;return e==="auto"?t.isNode()?x4n(r):"center":e},P0.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),i=n.document,a=0,s=t.pstyle("font-style").strValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("font-family").strValue,u=t.pstyle("font-weight").strValue,h=t.pstyle("text-metrics").strValue||"font",d=this.labelCalcCanvas,f=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=i.createElement("canvas"),f=this.labelCalcCanvasContext=d.getContext("2d");var p=d.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}f.font="".concat(s," ").concat(u," ").concat(o,"px ").concat(l);for(var g=0,m=0,v=e.split(` -`),y=v.length,b=0,x=0,w=0;w1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l=t.desktopTapThreshold2}var Xt=a(j);Fe&&(t.hoverData.tapholdCancelled=!0);var Ft=function(){var Ct=t.hoverData.dragDelta=t.hoverData.dragDelta||[];Ct.length===0?(Ct.push(Ge[0]),Ct.push(Ge[1])):(Ct[0]+=Ge[0],Ct[1]+=Ge[1])};pe=!0,i(Xe,["mousemove","vmousemove","tapdrag"],j,{x:_e[0],y:_e[1]});var gt=function(Ct){return{originalEvent:j,type:Ct,position:{x:_e[0],y:_e[1]}}},Ae=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||te.emit(gt("boxstart")),Pe[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(Fe){var zt=gt("cxtdrag");Ze?Ze.emit(zt):te.emit(zt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||Xe!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(gt("cxtdragout")),t.hoverData.cxtOver=Xe,Xe&&Xe.emit(gt("cxtdragover")))}}else if(t.hoverData.dragging){if(pe=!0,te.panningEnabled()&&te.userPanningEnabled()){var kt;if(t.hoverData.justStartedPan){var At=t.hoverData.mdownPos;kt={x:(_e[0]-At[0])*ye,y:(_e[1]-At[1])*ye},t.hoverData.justStartedPan=!1}else kt={x:Ge[0]*ye,y:Ge[1]*ye};te.panBy(kt),te.emit(gt("dragpan")),t.hoverData.dragged=!0}_e=t.projectIntoViewport(j.clientX,j.clientY)}else if(Pe[4]==1&&(Ze==null||Ze.pannable())){if(Fe){if(!t.hoverData.dragging&&te.boxSelectionEnabled()&&(Xt||!te.panningEnabled()||!te.userPanningEnabled()))Ae();else if(!t.hoverData.selecting&&te.panningEnabled()&&te.userPanningEnabled()){var Mt=s(Ze,t.hoverData.downs);Mt&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,Pe[4]=0,t.data.bgActivePosistion=m3(Le),t.redrawHint("select",!0),t.redraw())}Ze&&Ze.pannable()&&Ze.active()&&Ze.unactivate()}}else{if(Ze&&Ze.pannable()&&Ze.active()&&Ze.unactivate(),(!Ze||!Ze.grabbed())&&Xe!=Ne&&(Ne&&i(Ne,["mouseout","tapdragout"],j,{x:_e[0],y:_e[1]}),Xe&&i(Xe,["mouseover","tapdragover"],j,{x:_e[0],y:_e[1]}),t.hoverData.last=Xe),Ze)if(Fe){if(te.boxSelectionEnabled()&&Xt)Ze&&Ze.grabbed()&&(m(lt),Ze.emit(gt("freeon")),lt.emit(gt("free")),t.dragData.didDrag&&(Ze.emit(gt("dragfreeon")),lt.emit(gt("dragfree")))),Ae();else if(Ze&&Ze.grabbed()&&t.nodeIsDraggable(Ze)){var jr=!t.dragData.didDrag;jr&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(lt,{inDragLayer:!0});var Re={x:0,y:0};if(or(Ge[0])&&or(Ge[1])&&(Re.x+=Ge[0],Re.y+=Ge[1],jr)){var at=t.hoverData.dragDelta;at&&or(at[0])&&or(at[1])&&(Re.x+=at[0],Re.y+=at[1])}t.hoverData.draggingEles=!0,lt.silentShift(Re).emit(gt("position")).emit(gt("drag")),t.redrawHint("drag",!0),t.redraw()}}else Ft();pe=!0}if(Pe[2]=_e[0],Pe[3]=_e[1],pe)return j.stopPropagation&&j.stopPropagation(),j.preventDefault&&j.preventDefault(),!1}},!1);var E,_,I;t.registerBinding(e,"mouseup",function(j){if(!(t.hoverData.which===1&&j.which!==1&&t.hoverData.capture)){var ie=t.hoverData.capture;if(ie){t.hoverData.capture=!1;var pe=t.cy,te=t.projectIntoViewport(j.clientX,j.clientY),ye=t.selection,oe=t.findNearestElement(te[0],te[1],!0,!1),_e=t.dragData.possibleDragElements,Le=t.hoverData.down,Ye=a(j);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,Le&&Le.unactivate();var Pe=function(wt){return{originalEvent:j,type:wt,position:{x:te[0],y:te[1]}}};if(t.hoverData.which===3){var Xe=Pe("cxttapend");if(Le?Le.emit(Xe):pe.emit(Xe),!t.hoverData.cxtDragged){var Ne=Pe("cxttap");Le?Le.emit(Ne):pe.emit(Ne)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(i(oe,["mouseup","tapend","vmouseup"],j,{x:te[0],y:te[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(i(Le,["click","tap","vclick"],j,{x:te[0],y:te[1]}),_=!1,j.timeStamp-I<=pe.multiClickDebounceTime()?(E&&clearTimeout(E),_=!0,I=null,i(Le,["dblclick","dbltap","vdblclick"],j,{x:te[0],y:te[1]})):(E=setTimeout(function(){_||i(Le,["oneclick","onetap","voneclick"],j,{x:te[0],y:te[1]})},pe.multiClickDebounceTime()),I=j.timeStamp)),Le==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(j)&&(pe.$(r).unselect(["tapunselect"]),_e.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=_e=pe.collection()),oe==Le&&!t.dragData.didDrag&&!t.hoverData.selecting&&oe!=null&&oe._private.selectable&&(t.hoverData.dragging||(pe.selectionType()==="additive"||Ye?oe.selected()?oe.unselect(["tapunselect"]):oe.select(["tapselect"]):Ye||(pe.$(r).unmerge(oe).unselect(["tapunselect"]),oe.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Ze=pe.collection(t.getAllInBox(ye[0],ye[1],ye[2],ye[3]));t.redrawHint("select",!0),Ze.length>0&&t.redrawHint("eles",!0),pe.emit(Pe("boxend"));var Ge=function(wt){return wt.selectable()&&!wt.selected()};pe.selectionType()==="additive"||Ye||pe.$(r).unmerge(Ze).unselect(),Ze.emit(Pe("box")).stdFilter(Ge).select().emit(Pe("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!ye[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var lt=Le&&Le.grabbed();m(_e),lt&&(Le.emit(Pe("freeon")),_e.emit(Pe("free")),t.dragData.didDrag&&(Le.emit(Pe("dragfreeon")),_e.emit(Pe("dragfree"))))}}ye[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var L=[],R=4,D,M=1e5,P=function(j){for(var ie=Math.abs(j[0]),pe=1;pe=R){D=!1;var te=L;if(te[0]>=5){var ye;P(te)?ye=te[0]:ye=KEn(te),ye>1&&(D=!0,M=ye)}}else L.push(Math.abs(pe)),ie=!0;else D&&(M=Math.min(Math.abs(pe),M));if(!t.scrollingPage){var oe=t.cy,_e=oe.zoom(),Le=oe.pan(),Ye=t.projectIntoViewport(j.clientX,j.clientY),Pe=[Ye[0]*_e+Le.x,Ye[1]*_e+Le.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||S()){j.preventDefault();return}if(oe.panningEnabled()&&oe.userPanningEnabled()&&oe.zoomingEnabled()&&oe.userZoomingEnabled()){j.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var Xe;ie&&Math.abs(pe)>5&&(pe=RCe(pe)*5),Xe=pe/-250,D&&(Xe/=M,Xe*=3),Xe=Xe*t.wheelSensitivity;var Ne=j.deltaMode===1;Ne&&(Xe*=33);var Ze=oe.zoom()*Math.pow(10,Xe);j.type==="gesturechange"&&(Ze=t.gestureStartZoom*j.scale),oe.zoom({level:Ze,renderedPosition:{x:Pe[0],y:Pe[1]}}),oe.emit({type:j.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:j,position:{x:Ye[0],y:Ye[1]}})}}}};t.registerBinding(t.container,"wheel",N,!0),t.registerBinding(e,"scroll",function(j){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(j){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||j.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(ne){t.hasTouchStarted||N(ne)},!0),t.registerBinding(t.container,"mouseout",function(j){var ie=t.projectIntoViewport(j.clientX,j.clientY);t.cy.emit({originalEvent:j,type:"mouseout",position:{x:ie[0],y:ie[1]}})},!1),t.registerBinding(t.container,"mouseover",function(j){var ie=t.projectIntoViewport(j.clientX,j.clientY);t.cy.emit({originalEvent:j,type:"mouseover",position:{x:ie[0],y:ie[1]}})},!1);var F,B,V,z,U,Q,G,X,Y,le,q,Z,ee,re=function(j,ie,pe,te){return Math.sqrt((pe-j)*(pe-j)+(te-ie)*(te-ie))},ve=function(j,ie,pe,te){return(pe-j)*(pe-j)+(te-ie)*(te-ie)},ae;t.registerBinding(t.container,"touchstart",ae=function(j){if(t.hasTouchStarted=!0,!!O(j)){y(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var ie=t.cy,pe=t.touchData.now,te=t.touchData.earlier;if(j.touches[0]){var ye=t.projectIntoViewport(j.touches[0].clientX,j.touches[0].clientY);pe[0]=ye[0],pe[1]=ye[1]}if(j.touches[1]){var ye=t.projectIntoViewport(j.touches[1].clientX,j.touches[1].clientY);pe[2]=ye[0],pe[3]=ye[1]}if(j.touches[2]){var ye=t.projectIntoViewport(j.touches[2].clientX,j.touches[2].clientY);pe[4]=ye[0],pe[5]=ye[1]}var oe=function(Xt){return{originalEvent:j,type:Xt,position:{x:pe[0],y:pe[1]}}};if(j.touches[1]){t.touchData.singleTouchMoved=!0,m(t.dragData.touchDragEles);var _e=t.findContainerClientCoords();Y=_e[0],le=_e[1],q=_e[2],Z=_e[3],F=j.touches[0].clientX-Y,B=j.touches[0].clientY-le,V=j.touches[1].clientX-Y,z=j.touches[1].clientY-le,ee=0<=F&&F<=q&&0<=V&&V<=q&&0<=B&&B<=Z&&0<=z&&z<=Z;var Le=ie.pan(),Ye=ie.zoom();U=re(F,B,V,z),Q=ve(F,B,V,z),G=[(F+V)/2,(B+z)/2],X=[(G[0]-Le.x)/Ye,(G[1]-Le.y)/Ye];var Pe=200,Xe=Pe*Pe;if(Q=1){for(var Me=t.touchData.startPosition=[null,null,null,null,null,null],Rt=0;Rt=t.touchTapThreshold2}if(ie&&t.touchData.cxt){j.preventDefault();var Rt=j.touches[0].clientX-Y,Lt=j.touches[0].clientY-le,ut=j.touches[1].clientX-Y,Xt=j.touches[1].clientY-le,Ft=ve(Rt,Lt,ut,Xt),gt=Ft/Q,Ae=150,zt=Ae*Ae,kt=1.5,At=kt*kt;if(gt>=At||Ft>=zt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Mt=Ye("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(Mt),t.touchData.start=null):te.emit(Mt)}}if(ie&&t.touchData.cxt){var Mt=Ye("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Mt):te.emit(Mt),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var jr=t.findNearestElement(ye[0],ye[1],!0,!0);(!t.touchData.cxtOver||jr!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(Ye("cxtdragout")),t.touchData.cxtOver=jr,jr&&jr.emit(Ye("cxtdragover")))}else if(ie&&j.touches[2]&&te.boxSelectionEnabled())j.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||te.emit(Ye("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,pe[4]=1,!pe||pe.length===0||pe[0]===void 0?(pe[0]=(ye[0]+ye[2]+ye[4])/3,pe[1]=(ye[1]+ye[3]+ye[5])/3,pe[2]=(ye[0]+ye[2]+ye[4])/3+1,pe[3]=(ye[1]+ye[3]+ye[5])/3+1):(pe[2]=(ye[0]+ye[2]+ye[4])/3,pe[3]=(ye[1]+ye[3]+ye[5])/3),t.redrawHint("select",!0),t.redraw();else if(ie&&j.touches[1]&&!t.touchData.didSelect&&te.zoomingEnabled()&&te.panningEnabled()&&te.userZoomingEnabled()&&te.userPanningEnabled()){j.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Re=t.dragData.touchDragEles;if(Re){t.redrawHint("drag",!0);for(var at=0;at0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var Oe;t.registerBinding(e,"touchcancel",Oe=function(j){var ie=t.touchData.start;t.touchData.capture=!1,ie&&ie.unactivate()});var $e,he,fe,Te;if(t.registerBinding(e,"touchend",$e=function(j){var ie=t.touchData.start,pe=t.touchData.capture;if(pe)j.touches.length===0&&(t.touchData.capture=!1),j.preventDefault();else return;var te=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var ye=t.cy,oe=ye.zoom(),_e=t.touchData.now,Le=t.touchData.earlier;if(j.touches[0]){var Ye=t.projectIntoViewport(j.touches[0].clientX,j.touches[0].clientY);_e[0]=Ye[0],_e[1]=Ye[1]}if(j.touches[1]){var Ye=t.projectIntoViewport(j.touches[1].clientX,j.touches[1].clientY);_e[2]=Ye[0],_e[3]=Ye[1]}if(j.touches[2]){var Ye=t.projectIntoViewport(j.touches[2].clientX,j.touches[2].clientY);_e[4]=Ye[0],_e[5]=Ye[1]}var Pe=function(zt){return{originalEvent:j,type:zt,position:{x:_e[0],y:_e[1]}}};ie&&ie.unactivate();var Xe;if(t.touchData.cxt){if(Xe=Pe("cxttapend"),ie?ie.emit(Xe):ye.emit(Xe),!t.touchData.cxtDragged){var Ne=Pe("cxttap");ie?ie.emit(Ne):ye.emit(Ne)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!j.touches[2]&&ye.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var Ze=ye.collection(t.getAllInBox(te[0],te[1],te[2],te[3]));te[0]=void 0,te[1]=void 0,te[2]=void 0,te[3]=void 0,te[4]=0,t.redrawHint("select",!0),ye.emit(Pe("boxend"));var Ge=function(zt){return zt.selectable()&&!zt.selected()};Ze.emit(Pe("box")).stdFilter(Ge).select().emit(Pe("boxselect")),Ze.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(ie!=null&&ie.unactivate(),j.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!j.touches[1]){if(!j.touches[0]){if(!j.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var lt=t.dragData.touchDragEles;if(ie!=null){var Fe=ie._private.grabbed;m(lt),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Fe&&(ie.emit(Pe("freeon")),lt.emit(Pe("free")),t.dragData.didDrag&&(ie.emit(Pe("dragfreeon")),lt.emit(Pe("dragfree")))),i(ie,["touchend","tapend","vmouseup","tapdragout"],j,{x:_e[0],y:_e[1]}),ie.unactivate(),t.touchData.start=null}else{var wt=t.findNearestElement(_e[0],_e[1],!0,!0);i(wt,["touchend","tapend","vmouseup","tapdragout"],j,{x:_e[0],y:_e[1]})}var Me=t.touchData.startPosition[0]-_e[0],Rt=Me*Me,Lt=t.touchData.startPosition[1]-_e[1],ut=Lt*Lt,Xt=Rt+ut,Ft=Xt*oe*oe;t.touchData.singleTouchMoved||(ie||ye.$(":selected").unselect(["tapunselect"]),i(ie,["tap","vclick"],j,{x:_e[0],y:_e[1]}),he=!1,j.timeStamp-Te<=ye.multiClickDebounceTime()?(fe&&clearTimeout(fe),he=!0,Te=null,i(ie,["dbltap","vdblclick"],j,{x:_e[0],y:_e[1]})):(fe=setTimeout(function(){he||i(ie,["onetap","voneclick"],j,{x:_e[0],y:_e[1]})},ye.multiClickDebounceTime()),Te=j.timeStamp)),ie!=null&&!t.dragData.didDrag&&ie._private.selectable&&Ft"u"){var ge=[],Qe=function(j){return{clientX:j.clientX,clientY:j.clientY,force:1,identifier:j.pointerId,pageX:j.pageX,pageY:j.pageY,radiusX:j.width/2,radiusY:j.height/2,screenX:j.screenX,screenY:j.screenY,target:j.target}},Se=function(j){return{event:j,touch:Qe(j)}},De=function(j){ge.push(Se(j))},qe=function(j){for(var ie=0;ie0)return z[0]}return null},g=Object.keys(f),m=0;m0?p:VLt(a,s,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,a,s,o,l){l=l==="auto"?B2(i,a):l;var u=2*l;if(S1(e,r,this.points,s,o,i,a-u,[0,-1],n)||S1(e,r,this.points,s,o,i-u,a,[0,-1],n))return!0;var h=i/2+2*n,d=a/2+2*n,f=[s-h,o-d,s-h,o,s+h,o,s+h,o-d];return!!(Hh(e,r,f)||SC(e,r,u,u,s+i/2-l,o+a/2-l,n)||SC(e,r,u,u,s-i/2+l,o+a/2-l,n))}}},O1.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Hu(3,0)),this.generateRoundPolygon("round-triangle",Hu(3,0)),this.generatePolygon("rectangle",Hu(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",Hu(5,0)),this.generateRoundPolygon("round-pentagon",Hu(5,0)),this.generatePolygon("hexagon",Hu(6,0)),this.generateRoundPolygon("round-hexagon",Hu(6,0)),this.generatePolygon("heptagon",Hu(7,0)),this.generateRoundPolygon("round-heptagon",Hu(7,0)),this.generatePolygon("octagon",Hu(8,0)),this.generateRoundPolygon("round-octagon",Hu(8,0));var n=new Array(20);{var i=MCe(5,0),a=MCe(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o=e.deqFastCost*w)break}else if(u){if(b>=e.deqCost*p||b>=e.deqAvgCost*f)break}else if(x>=e.deqNoDrawCost*cke)break;var A=e.deq(n,v,m);if(A.length>0)for(var T=0;T0&&(e.onDeqd(n,g),!u&&e.shouldRedraw(n,g,v,m)&&a())},o=e.priority||SCe;i.beforeRender(s,o(n))}}}},B3n=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:kJ;_2(this,t),this.idsByKey=new T1,this.keyForId=new T1,this.cachesByLvl=new T1,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return R2(t,[{key:"getIdsFor",value:function(r){r==null&&vs("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(r);return i||(i=new g3,n.set(r,i)),i}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);this.deleteIdForKey(i,n),this.addIdForKey(a,n),this.keyForId.set(n,a)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteIdForKey(i,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);return i!==a}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,i=this.lvls,a=n.get(r);return a||(a=new T1,n.set(r,a),i.push(r)),a}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var i=this.getKey(r),a=this.getCache(i,n);return a!=null&&this.updateKeyMappingFor(r),a}},{key:"getForCachedKey",value:function(r,n){var i=this.keyForId.get(r.id()),a=this.getCache(i,n);return a}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var i=this.getKey(r);return this.hasCache(i,n)}},{key:"setCache",value:function(r,n,i){i.key=r,this.getCachesAt(n).set(r,i)}},{key:"set",value:function(r,n,i){var a=this.getKey(r);this.setCache(a,n,i),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var i=this.getKey(r);this.deleteCache(i,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(i){return n.deleteCache(r,i)})}},{key:"invalidate",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteKeyMappingFor(r);var a=this.doesEleInvalidateKey(r);return a&&this.invalidateKey(i),a||this.getNumberOfIdsForKey(i)===0}}])}(),PPt=25,gee=50,mee=-4,uke=3,NPt=7.99,$3n=8,F3n=1024,z3n=1024,U3n=1024,V3n=.2,Q3n=.8,G3n=10,H3n=.15,W3n=.1,Y3n=.9,q3n=.9,j3n=100,X3n=1,N3={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},K3n=pc({getKey:null,doesEleInvalidateKey:kJ,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:ELt,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),P9=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var i=K3n(r);sn(n,i),n.lookup=new B3n(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},al=P9.prototype;al.reasons=N3,al.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},al.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n},al.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new m9(function(r,n){return n.reqs-r.reqs});return e},al.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e},al.getElement=function(t,e,r,n,i){var a=this,s=this.renderer,o=s.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!a.allowEdgeTxrCaching&&t.isEdge()||!a.allowParentTxrCaching&&t.isParent())return null;if(n==null&&(n=Math.ceil(_Ce(o*r))),n=NPt||n>uke)return null;var u=Math.pow(2,n),h=e.h*u,d=e.w*u,f=s.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,f))return null;var p=l.get(t,n);if(p&&p.invalidated&&(p.invalidated=!1,p.texture.invalidatedWidth-=p.width),p)return p;var g;if(h<=PPt?g=PPt:h<=gee?g=gee:g=Math.ceil(h/gee)*gee,h>U3n||d>z3n)return null;var m=a.getTextureQueue(g),v=m[m.length-2],y=function(){return a.recycleTexture(g,d)||a.addTexture(g,d)};v||(v=m[m.length-1]),v||(v=y()),v.width-v.usedWidthn;_--)k=a.getElement(t,e,r,_,N3.downscale);E()}else return a.queueElement(t,T.level-1),T;else{var I;if(!x&&!w&&!A)for(var L=n-1;L>=mee;L--){var R=l.get(t,L);if(R){I=R;break}}if(b(I))return a.queueElement(t,n),I;v.context.translate(v.usedWidth,0),v.context.scale(u,u),this.drawElement(v.context,t,e,f,!1),v.context.scale(1/u,1/u),v.context.translate(-v.usedWidth,0)}return p={x:v.usedWidth,texture:v,level:n,scale:u,width:d,height:h,scaledLabelShown:f},v.usedWidth+=Math.ceil(d+$3n),v.eleCaches.push(p),l.set(t,n,p),a.checkTextureFullness(v),p},al.invalidateElements=function(t){for(var e=0;e=V3n*t.width&&this.retireTexture(t)},al.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>Q3n&&t.fullnessChecks>=G3n?I2(r,t):t.fullnessChecks++},al.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),i=this.lookup;I2(n,t),t.retired=!0;for(var a=t.eleCaches,s=0;s=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,CCe(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),I2(i,s),n.push(s),s}},al.queueElement=function(t,e){var r=this,n=r.getElementQueue(),i=r.getElementKeyToQueue(),a=this.getKey(t),s=i[a];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,n.updateItem(s);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:a};n.push(o),i[a]=o}},al.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=[],a=e.lookup,s=0;s0;s++){var o=r.pop(),l=o.key,u=o.eles[0],h=a.hasCache(u,o.level);if(n[l]=null,h)continue;i.push(o);var d=e.getBoundingBox(u);e.getElement(u,d,t,o.level,N3.dequeue)}return i},al.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=this.getKey(t),a=n[i];a!=null&&(a.eles.length===1?(a.reqs=TCe,r.updateItem(a),r.pop(),n[i]=null):a.eles.unmerge(t))},al.onDequeue=function(t){this.onDequeues.push(t)},al.offDequeue=function(t){I2(this.onDequeues,t)},al.setupDequeueing=IPt.setupDequeueing({deqRedrawThreshold:j3n,deqCost:H3n,deqAvgCost:W3n,deqNoDrawCost:Y3n,deqFastCost:q3n,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n=J3n||r>vee)return null}n.validateLayersElesOrdering(r,t);var l=n.layersByLevel,u=Math.pow(2,r),h=l[r]=l[r]||[],d,f=n.levelIsComplete(r,t),p,g=function(){var E=function(D){if(n.validateLayersElesOrdering(D,t),n.levelIsComplete(D,t))return p=l[D],!0},_=function(D){if(!p)for(var M=r+D;N9<=M&&M<=vee&&!E(M);M+=D);};_(1),_(-1);for(var I=h.length-1;I>=0;I--){var L=h[I];L.invalid&&I2(h,L)}};if(!f)g();else return h;var m=function(){if(!d){d=Gu();for(var E=0;E$Pt||L>$Pt)return null;var R=I*L;if(R>oRn)return null;var D=n.makeLayer(d,r);if(_!=null){var M=h.indexOf(_)+1;h.splice(M,0,D)}else(E.insert===void 0||E.insert)&&h.unshift(D);return D};if(n.skipping&&!o)return null;for(var y=null,b=t.length/Z3n,x=!o,w=0;w=b||!ULt(y.bb,A.boundingBox()))&&(y=v({insert:!0,after:y}),!y))return null;p||x?n.queueLayer(y,A):n.drawEleInLayer(y,A,r,e),y.eles.push(A),S[r]=y}return p||(x?null:h)},vc.getEleLevelForLayerLevel=function(t,e){return t},vc.drawEleInLayer=function(t,e,r,n){var i=this,a=this.renderer,s=t.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(r=i.getEleLevelForLayerLevel(r,n),a.setImgSmoothing(s,!1),a.drawCachedElement(s,e,null,null,r,lRn),a.setImgSmoothing(s,!0))},vc.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var i=0,a=0;a0||s.invalid)return!1;i+=s.eles.length}return i===e.length},vc.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n0){e=!0;break}}return e},vc.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=A1(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,i,a){e.invalidateLayer(n)}))},vc.invalidateLayer=function(t){if(this.lastInvalidationTime=A1(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];I2(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var i=0;i3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(a&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var l;r&&(l=r,t.translate(-l.x1,-l.y1));var u=a?e.pstyle("opacity").value:1,h=a?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,f=e.pstyle("line-style").value,p=e.pstyle("width").pfValue,g=e.pstyle("line-cap").value,m=e.pstyle("line-outline-width").value,v=e.pstyle("line-outline-color").value,y=u*h,b=u*h,x=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;d==="straight-triangle"?(s.eleStrokeStyle(t,e,D),s.drawEdgeTrianglePath(e,t,o.allpts)):(t.lineWidth=p,t.lineCap=g,s.eleStrokeStyle(t,e,D),s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},w=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;if(t.lineWidth=p+m,t.lineCap=g,m>0)s.colorStrokeStyle(t,v[0],v[1],v[2],D);else{t.lineCap="butt";return}d==="straight-triangle"?s.drawEdgeTrianglePath(e,t,o.allpts):(s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},A=function(){i&&s.drawEdgeOverlay(t,e)},T=function(){i&&s.drawEdgeUnderlay(t,e)},S=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;s.drawArrowheads(t,e,D)},O=function(){s.drawElementText(t,e,null,n)};t.lineJoin="round";var k=e.pstyle("ghost").value==="yes";if(k){var E=e.pstyle("ghost-offset-x").pfValue,_=e.pstyle("ghost-offset-y").pfValue,I=e.pstyle("ghost-opacity").value,L=y*I;t.translate(E,_),x(L),S(L),t.translate(-E,-_)}else w();T(),x(),S(),A(),O(),r&&t.translate(l.x1,l.y1)}};var GPt=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var i=n.pstyle("".concat(e,"-opacity")).value;if(i!==0){var a=this,s=a.usePaths(),o=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,u=2*l,h=n.pstyle("".concat(e,"-color")).value;r.lineWidth=u,o.edgeType==="self"&&!s?r.lineCap="butt":r.lineCap="round",a.colorStrokeStyle(r,h[0],h[1],h[2],i),a.drawEdgePath(n,r,o.allpts,"solid")}}}};k1.drawEdgeOverlay=GPt("overlay"),k1.drawEdgeUnderlay=GPt("underlay"),k1.drawEdgePath=function(t,e,r,n){var i=t._private.rscratch,a=e,s,o=!1,l=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,h=t.pstyle("line-dash-offset").pfValue;if(l){var d=r.join("$"),f=i.pathCacheKey&&i.pathCacheKey===d;f?(s=e=i.pathCache,o=!0):(s=e=new Path2D,i.pathCacheKey=d,i.pathCache=s)}if(a.setLineDash)switch(n){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=h;break;case"solid":a.setLineDash([]);break}if(!o&&!i.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var p=2;p+35&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(n==null){if(a&&!s.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e),u=e.pstyle("text-metrics").strValue==="glyph";t.textAlign=l,t.textBaseline=u?"alphabetic":"bottom"}else{var h=e.element()._private.rscratch.badLine,d=e.pstyle("label"),f=e.pstyle("source-label"),p=e.pstyle("target-label");if(h||(!d||!d.value)&&(!f||!f.value)&&(!p||!p.value))return;t.textAlign="center",t.textBaseline="bottom"}var g=!r,m;r&&(m=r,t.translate(-m.x1,-m.y1)),i==null?(s.drawText(t,e,null,g,a),e.isEdge()&&(s.drawText(t,e,"source",g,a),s.drawText(t,e,"target",g,a))):s.drawText(t,e,i,g,a),r&&t.translate(m.x1,m.y1)},DC.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue+"px",a=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=n+" "+s+" "+i+" "+a,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],o),this.colorStrokeStyle(t,h[0],h[1],h[2],l)};function bRn(t,e,r,n,i){var a=Math.min(n,i),s=a/2,o=e+n/2,l=r+i/2;t.beginPath(),t.arc(o,l,s,0,Math.PI*2),t.closePath()}function HPt(t,e,r,n,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(a,n/2,i/2);t.beginPath(),t.moveTo(e+s,r),t.lineTo(e+n-s,r),t.quadraticCurveTo(e+n,r,e+n,r+s),t.lineTo(e+n,r+i-s),t.quadraticCurveTo(e+n,r+i,e+n-s,r+i),t.lineTo(e+s,r+i),t.quadraticCurveTo(e,r+i,e,r+i-s),t.lineTo(e,r+s),t.quadraticCurveTo(e,r,e+s,r),t.closePath()}DC.getTextAngle=function(t,e){var r,n=t._private,i=n.rscratch,a=e?e+"-":"",s=t.pstyle(a+"text-rotation");if(s.strValue==="autorotate"){var o=Qu(i,"labelAngle",e);r=t.isEdge()?o:0}else s.strValue==="none"?r=0:r=s.pfValue;return r},DC.drawText=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=e._private,s=a.rscratch,o=i?e.effectiveOpacity():1;if(!(i&&(o===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=Qu(s,"labelX",r),u=Qu(s,"labelY",r),h,d,f=this.getLabelText(e,r);if(f!=null&&f!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(t,e,i);var p=r?r+"-":"",g=Qu(s,"labelWidth",r),m=Qu(s,"labelHeight",r),v=Qu(s,"labelActualDescent",r),y=e.pstyle(p+"text-margin-x").pfValue,b=e.pstyle(p+"text-margin-y").pfValue,x=e.isEdge(),w=e.pstyle("text-halign").value,A=e.pstyle("text-valign").value;x&&(w="center",A="center"),l+=y,u+=b;var T;n?T=this.getTextAngle(e,r):T=0,T!==0&&(h=l,d=u,t.translate(h,d),t.rotate(T),l=0,u=0);var S=O3(w),O=k3(A);switch(O){case"top":break;case"center":u+=m/2;break;case"bottom":u+=m;break}var k=e.pstyle("text-background-opacity").value,E=e.pstyle("text-border-opacity").value,_=e.pstyle("text-border-width").pfValue,I=e.pstyle("text-background-padding").pfValue,L=e.pstyle("text-background-shape").strValue,R=L==="round-rectangle"||L==="roundrectangle",D=L==="circle",M=2;if(k>0||_>0&&E>0){var P=t.fillStyle,N=t.strokeStyle,F=t.lineWidth,B=e.pstyle("text-background-color").value,V=e.pstyle("text-border-color").value,z=e.pstyle("text-border-style").value,U=k>0,Q=_>0&&E>0,G=l-I;switch(S){case"left":G-=g;break;case"center":G-=g/2;break}var X=u-m-I,Y=g+2*I,le=m+2*I;if(U&&(t.fillStyle="rgba(".concat(B[0],",").concat(B[1],",").concat(B[2],",").concat(k*o,")")),Q&&(t.strokeStyle="rgba(".concat(V[0],",").concat(V[1],",").concat(V[2],",").concat(E*o,")"),t.lineWidth=_,t.setLineDash))switch(z){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=_/4,t.setLineDash([]);break;case"solid":default:t.setLineDash([]);break}if(R?(t.beginPath(),HPt(t,G,X,Y,le,M)):D?(t.beginPath(),bRn(t,G,X,Y,le)):(t.beginPath(),t.rect(G,X,Y,le)),U&&t.fill(),Q&&t.stroke(),Q&&z==="double"){var q=_/2;t.beginPath(),R?HPt(t,G+q,X+q,Y-2*q,le-2*q,M):t.rect(G+q,X+q,Y-2*q,le-2*q),t.stroke()}t.fillStyle=P,t.strokeStyle=N,t.lineWidth=F,t.setLineDash&&t.setLineDash([])}var Z=2*e.pstyle("text-outline-width").pfValue;if(Z>0&&(t.lineWidth=Z),u-=v,e.pstyle("text-wrap").value==="wrap"){var ee=Qu(s,"labelWrapCachedLines",r),re=Qu(s,"labelLineHeight",r),ve=g/2,ae=this.getLabelJustification(e);switch(ae==="auto"||(S==="left"?ae==="left"?l+=-g:ae==="center"&&(l+=-ve):S==="center"?ae==="left"?l+=-ve:ae==="right"&&(l+=ve):S==="right"&&(ae==="center"?l+=ve:ae==="right"&&(l+=g))),O){case"top":u-=(ee.length-1)*re;break;case"center":case"bottom":u-=(ee.length-1)*re;break}for(var Ce=0;Ce0&&t.strokeText(ee[Ce],l,u),t.fillText(ee[Ce],l,u),u+=re}else Z>0&&t.strokeText(f,l,u),t.fillText(f,l,u);T!==0&&(t.rotate(-T),t.translate(-h,-d))}}};var W2={};W2.drawNode=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,l,u=e._private,h=u.rscratch,d=e.position();if(!(!or(d.x)||!or(d.y))&&!(a&&!e.visible())){var f=a?e.effectiveOpacity():1,p=s.usePaths(),g,m=!1,v=e.padding();o=e.width()+2*v,l=e.height()+2*v;var y;r&&(y=r,t.translate(-y.x1,-y.y1));for(var b=e.pstyle("background-image"),x=b.value,w=new Array(x.length),A=new Array(x.length),T=0,S=0;S0&&arguments[0]!==void 0?arguments[0]:L;s.eleFillStyle(t,e,ie)},q=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:V;s.colorStrokeStyle(t,R[0],R[1],R[2],ie)},Z=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G;s.colorStrokeStyle(t,U[0],U[1],U[2],ie)},ee=function(ie,pe,te,ye){var oe=s.nodePathCache=s.nodePathCache||[],_e=OLt(te==="polygon"?te+","+ye.join(","):te,""+pe,""+ie,""+Y),Le=oe[_e],Ye,Pe=!1;return Le!=null?(Ye=Le,Pe=!0,h.pathCache=Ye):(Ye=new Path2D,oe[_e]=h.pathCache=Ye),{path:Ye,cacheHit:Pe}},re=e.pstyle("shape").strValue,ve=e.pstyle("shape-polygon-points").pfValue;if(p){t.translate(d.x,d.y);var ae=ee(o,l,re,ve);g=ae.path,m=ae.cacheHit}var Ce=function(){if(!m){var ie=d;p&&(ie={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(g||t,ie.x,ie.y,o,l,Y,h)}p?t.fill(g):t.fill()},Oe=function(){for(var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,te=u.backgrounding,ye=0,oe=0;oe0&&arguments[0]!==void 0?arguments[0]:!1,pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasPie(e)&&(s.drawPie(t,e,pe),ie&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,Y,h)))},he=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasStripe(e)&&(t.save(),p?t.clip(h.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,Y,h),t.clip()),s.drawStripe(t,e,pe),t.restore(),ie&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,Y,h)))},fe=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,pe=(_>0?_:-_)*ie,te=_>0?0:255;_!==0&&(s.colorFillStyle(t,te,te,te,pe),p?t.fill(g):t.fill())},Te=function(){if(I>0){if(t.lineWidth=I,t.lineCap=P,t.lineJoin=M,t.setLineDash)switch(D){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(F),t.lineDashOffset=B;break;case"solid":case"double":t.setLineDash([]);break}if(N!=="center"){if(t.save(),t.lineWidth*=2,N==="inside")p?t.clip(g):t.clip();else{var ie=new Path2D;ie.rect(-o/2-I,-l/2-I,o+2*I,l+2*I),ie.addPath(g),t.clip(ie,"evenodd")}p?t.stroke(g):t.stroke(),t.restore()}else p?t.stroke(g):t.stroke();if(D==="double"){t.lineWidth=I/3;var pe=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(g):t.stroke(),t.globalCompositeOperation=pe}t.setLineDash&&t.setLineDash([])}},ge=function(){if(z>0){if(t.lineWidth=z,t.lineCap="butt",t.setLineDash)switch(Q){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var ie=d;p&&(ie={x:0,y:0});var pe=s.getNodeShape(e),te=I;N==="inside"&&(te=0),N==="outside"&&(te*=2);var ye=(o+te+(z+X))/o,oe=(l+te+(z+X))/l,_e=o*ye,Le=l*oe,Ye=s.nodeShapes[pe].points,Pe;if(p){var Xe=ee(_e,Le,pe,Ye);Pe=Xe.path}if(pe==="ellipse")s.drawEllipsePath(Pe||t,ie.x,ie.y,_e,Le);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(pe)){var Ne=0,Ze=0,Ge=0;pe==="round-diamond"?Ne=(te+X+z)*1.4:pe==="round-heptagon"?(Ne=(te+X+z)*1.075,Ge=-(te/2+X+z)/35):pe==="round-hexagon"?Ne=(te+X+z)*1.12:pe==="round-pentagon"?(Ne=(te+X+z)*1.13,Ge=-(te/2+X+z)/15):pe==="round-tag"?(Ne=(te+X+z)*1.12,Ze=(te/2+z+X)*.07):pe==="round-triangle"&&(Ne=(te+X+z)*(Math.PI/2),Ge=-(te+X/2+z)/Math.PI),Ne!==0&&(ye=(o+Ne)/o,_e=o*ye,["round-hexagon","round-tag"].includes(pe)||(oe=(l+Ne)/l,Le=l*oe)),Y=Y==="auto"?GLt(_e,Le):Y;for(var lt=_e/2,Fe=Le/2,wt=Y+(te+z+X)/2,Me=new Array(Ye.length/2),Rt=new Array(Ye.length/2),Lt=0;Lt0){if(i=i||n.position(),a==null||s==null){var p=n.padding();a=n.width()+2*p,s=n.height()+2*p}o.colorFillStyle(r,h[0],h[1],h[2],u),o.nodeShapes[d].draw(r,i.x,i.y,a+l*2,s+l*2,f),r.fill()}}}};W2.drawNodeOverlay=WPt("overlay"),W2.drawNodeUnderlay=WPt("underlay"),W2.hasPie=function(t){return t=t[0],t._private.hasPie},W2.hasStripe=function(t){return t=t[0],t._private.hasStripe},W2.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,l=n.x,u=n.y,h=e.width(),d=e.height(),f=Math.min(h,d)/2,p,g=0,m=this.usePaths();if(m&&(l=0,u=0),a.units==="%"?f=f*a.pfValue:a.pfValue!==void 0&&(f=a.pfValue/2),s.units==="%"?p=f*s.pfValue:s.pfValue!==void 0&&(p=s.pfValue/2),!(p>=f))for(var v=1;v<=i.pieBackgroundN;v++){var y=e.pstyle("pie-"+v+"-background-size").value,b=e.pstyle("pie-"+v+"-background-color").value,x=e.pstyle("pie-"+v+"-background-opacity").value*r,w=y/100;w+g>1&&(w=1-g);var A=1.5*Math.PI+2*Math.PI*g;A+=o;var T=2*Math.PI*w,S=A+T;y===0||g>=1||g+w>1||(p===0?(t.beginPath(),t.moveTo(l,u),t.arc(l,u,f,A,S),t.closePath()):(t.beginPath(),t.arc(l,u,f,A,S),t.arc(l,u,p,S,A,!0),t.closePath()),this.colorFillStyle(t,b[0],b[1],b[2],x),t.fill(),g+=w)}},W2.drawStripe=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=n.x,s=n.y,o=e.width(),l=e.height(),u=0,h=this.usePaths();t.save();var d=e.pstyle("stripe-direction").value,f=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var p=o,g=l;f.units==="%"?(p=p*f.pfValue,g=g*f.pfValue):f.pfValue!==void 0&&(p=f.pfValue,g=f.pfValue),h&&(a=0,s=0),s-=p/2,a-=g/2;for(var m=1;m<=i.stripeBackgroundN;m++){var v=e.pstyle("stripe-"+m+"-background-size").value,y=e.pstyle("stripe-"+m+"-background-color").value,b=e.pstyle("stripe-"+m+"-background-opacity").value*r,x=v/100;x+u>1&&(x=1-u),!(v===0||u>=1||u+x>1)&&(t.beginPath(),t.rect(a,s+g*u,p,g*x),t.closePath(),this.colorFillStyle(t,y[0],y[1],y[2],b),t.fill(),u+=x)}t.restore()};var Wu={},xRn=100;Wu.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r},Wu.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,i=0;ie.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(h[e.NODE]=!0,h[e.SELECT_BOX]=!0);var b=r.style(),x=r.zoom(),w=s!==void 0?s:x,A=r.pan(),T={x:A.x,y:A.y},S={zoom:x,pan:{x:A.x,y:A.y}},O=e.prevViewport,k=O===void 0||S.zoom!==O.zoom||S.pan.x!==O.pan.x||S.pan.y!==O.pan.y;!k&&!(m&&!g)&&(e.motionBlurPxRatio=1),o&&(T=o),w*=l,T.x*=l,T.y*=l;var E=e.getCachedZSortedEles();function _(q,Z,ee,re,ve){var ae=q.globalCompositeOperation;q.globalCompositeOperation="destination-out",e.colorFillStyle(q,255,255,255,e.motionBlurTransparency),q.fillRect(Z,ee,re,ve),q.globalCompositeOperation=ae}function I(q,Z){var ee,re,ve,ae;!e.clearingMotionBlur&&(q===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||q===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(ee={x:A.x*p,y:A.y*p},re=x*p,ve=e.canvasWidth*p,ae=e.canvasHeight*p):(ee=T,re=w,ve=e.canvasWidth,ae=e.canvasHeight),q.setTransform(1,0,0,1,0,0),Z==="motionBlur"?_(q,0,0,ve,ae):!n&&(Z===void 0||Z)&&q.clearRect(0,0,ve,ae),i||(q.translate(ee.x,ee.y),q.scale(re,re)),o&&q.translate(o.x,o.y),s&&q.scale(s,s)}if(d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var L=e.data.bufferContexts[e.TEXTURE_BUFFER];L.setTransform(1,0,0,1,0,0),L.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:L,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var S=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};S.mpan={x:(0-S.pan.x)/S.zoom,y:(0-S.pan.y)/S.zoom}}h[e.DRAG]=!1,h[e.NODE]=!1;var R=u.contexts[e.NODE],D=e.textureCache.texture,S=e.textureCache.viewport;R.setTransform(1,0,0,1,0,0),f?_(R,0,0,S.width,S.height):R.clearRect(0,0,S.width,S.height);var M=b.core("outside-texture-bg-color").value,P=b.core("outside-texture-bg-opacity").value;e.colorFillStyle(R,M[0],M[1],M[2],P),R.fillRect(0,0,S.width,S.height);var x=r.zoom();I(R,!1),R.clearRect(S.mpan.x,S.mpan.y,S.width/S.zoom/l,S.height/S.zoom/l),R.drawImage(D,S.mpan.x,S.mpan.y,S.width/S.zoom/l,S.height/S.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var N=r.extent(),F=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),B=e.hideEdgesOnViewport&&F,V=[];if(V[e.NODE]=!h[e.NODE]&&f&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,V[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),V[e.DRAG]=!h[e.DRAG]&&f&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,V[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||i||a||V[e.NODE]){var z=f&&!V[e.NODE]&&p!==1,R=n||(z?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),U=f&&!z?"motionBlur":void 0;I(R,U),B?e.drawCachedNodes(R,E.nondrag,l,N):e.drawLayeredElements(R,E.nondrag,l,N),e.debug&&e.drawDebugPoints(R,E.nondrag),!i&&!f&&(h[e.NODE]=!1)}if(!a&&(h[e.DRAG]||i||V[e.DRAG])){var z=f&&!V[e.DRAG]&&p!==1,R=n||(z?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);I(R,f&&!z?"motionBlur":void 0),B?e.drawCachedNodes(R,E.drag,l,N):e.drawCachedElements(R,E.drag,l,N),e.debug&&e.drawDebugPoints(R,E.drag),!i&&!f&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,I),f&&p!==1){var Q=u.contexts[e.NODE],G=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],X=u.contexts[e.DRAG],Y=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],le=function(Z,ee,re){Z.setTransform(1,0,0,1,0,0),re||!y?Z.clearRect(0,0,e.canvasWidth,e.canvasHeight):_(Z,0,0,e.canvasWidth,e.canvasHeight);var ve=p;Z.drawImage(ee,0,0,e.canvasWidth*ve,e.canvasHeight*ve,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||V[e.NODE])&&(le(Q,G,V[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||V[e.DRAG])&&(le(X,Y,V[e.DRAG]),h[e.DRAG]=!1)}e.prevViewport=S,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),f&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,h[e.NODE]=!0,h[e.DRAG]=!0,e.redraw()},xRn)),n||r.emit("render")};var B9;Wu.drawSelectionRectangle=function(t,e){var r=this,n=r.cy,i=r.data,a=n.style(),s=t.drawOnlyNodeLayer,o=t.drawAllLayers,l=i.canvasNeedsRedraw,u=t.forcedContext;if(r.showFps||!s&&l[r.SELECT_BOX]&&!o){var h=u||i.contexts[r.SELECT_BOX];if(e(h),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var d=r.cy.zoom(),f=a.core("selection-box-border-width").value/d;h.lineWidth=f,h.fillStyle="rgba("+a.core("selection-box-color").value[0]+","+a.core("selection-box-color").value[1]+","+a.core("selection-box-color").value[2]+","+a.core("selection-box-opacity").value+")",h.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),f>0&&(h.strokeStyle="rgba("+a.core("selection-box-border-color").value[0]+","+a.core("selection-box-border-color").value[1]+","+a.core("selection-box-border-color").value[2]+","+a.core("selection-box-opacity").value+")",h.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(i.bgActivePosistion&&!r.hoverData.selecting){var d=r.cy.zoom(),p=i.bgActivePosistion;h.fillStyle="rgba("+a.core("active-bg-color").value[0]+","+a.core("active-bg-color").value[1]+","+a.core("active-bg-color").value[2]+","+a.core("active-bg-opacity").value+")",h.beginPath(),h.arc(p.x,p.y,a.core("active-bg-size").pfValue/d,0,2*Math.PI),h.fill()}var g=r.lastRedrawTime;if(r.showFps&&g){g=Math.round(g);var m=Math.round(1e3/g),v="1 frame = "+g+" ms = "+m+" fps";if(h.setTransform(1,0,0,1,0,0),h.fillStyle="rgba(255, 0, 0, 0.75)",h.strokeStyle="rgba(255, 0, 0, 0.75)",h.font="30px Arial",!B9){var y=h.measureText(v);B9=y.actualBoundingBoxAscent}h.fillText(v,0,B9);var b=60;h.strokeRect(0,B9+10,250,20),h.fillRect(0,B9+10,250*Math.min(m/b,1),20)}o||(l[r.SELECT_BOX]=!1)}};function YPt(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(n));return n}function wRn(t,e,r){var n=YPt(t,t.VERTEX_SHADER,e),i=YPt(t,t.FRAGMENT_SHADER,r),a=t.createProgram();if(t.attachShader(a,n),t.attachShader(a,i),t.linkProgram(a),!t.getProgramParameter(a,t.LINK_STATUS))throw new Error("Could not initialize shaders");return a}function ARn(t,e,r){r===void 0&&(r=e);var n=t.makeOffscreenCanvas(e,r),i=n.context=n.getContext("2d");return n.clear=function(){return i.clearRect(0,0,n.width,n.height)},n.clear(),n}function fke(t){var e=t.pixelRatio,r=t.cy.zoom(),n=t.cy.pan();return{zoom:r*e,pan:{x:n.x*e,y:n.y*e}}}function TRn(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function SRn(t,e,r,n,i){var a=n*r+e.x,s=i*r+e.y;return s=Math.round(t.canvasHeight-s),[a,s]}function CRn(t,e){return e.picking?!0:t.pstyle("background-fill").value!=="solid"||t.pstyle("background-image").strValue!=="none"?!1:t.pstyle("border-width").value===0||t.pstyle("border-opacity").value===0?!0:t.pstyle("border-style").value==="solid"}function ORn(t,e){if(t.length!==e.length)return!1;for(var r=0;r>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}function kRn(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function ERn(t,e){var r=t.createTexture();return r.buffer=function(n){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}function qPt(t,e){switch(e){case"float":return[1,t.FLOAT,4];case"vec2":return[2,t.FLOAT,4];case"vec3":return[3,t.FLOAT,4];case"vec4":return[4,t.FLOAT,4];case"int":return[1,t.INT,4];case"ivec2":return[2,t.INT,4]}}function jPt(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function _Rn(t,e,r,n,i,a){switch(e){case t.FLOAT:return new Float32Array(r.buffer,a*n,i);case t.INT:return new Int32Array(r.buffer,a*n,i)}}function RRn(t,e,r,n){var i=qPt(t,e),a=$o(i,2),s=a[0],o=a[1],l=jPt(t,o,n),u=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,l,t.STATIC_DRAW),o===t.FLOAT?t.vertexAttribPointer(r,s,o,!1,0,0):o===t.INT&&t.vertexAttribIPointer(r,s,o,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),u}function B0(t,e,r,n){var i=qPt(t,r),a=$o(i,3),s=a[0],o=a[1],l=a[2],u=jPt(t,o,e*s),h=s*l,d=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,d),t.bufferData(t.ARRAY_BUFFER,e*h,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),o===t.FLOAT?t.vertexAttribPointer(n,s,o,!1,h,0):o===t.INT&&t.vertexAttribIPointer(n,s,o,h,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var f=new Array(e),p=0;ps&&(o=s/n,l=n*o,u=i*o),{scale:o,texW:l,texH:u}}},{key:"draw",value:function(r,n,i){var a=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,l=this.texHeight,u=this.getScale(n),h=u.scale,d=u.texW,f=u.texH,p=function(x,w){if(i&&w){var A=w.context,T=x.x,S=x.row,O=T,k=l*S;A.save(),A.translate(O,k),A.scale(h,h),i(A,n),A.restore()}},g=[null,null],m=function(){p(a.freePointer,a.canvas),g[0]={x:a.freePointer.x,y:a.freePointer.row*l,w:d,h:f},g[1]={x:a.freePointer.x+d,y:a.freePointer.row*l,w:0,h:f},a.freePointer.x+=d,a.freePointer.x==s&&(a.freePointer.x=0,a.freePointer.row++)},v=function(){var x=a.scratch,w=a.canvas;x.clear(),p({x:0,row:0},x);var A=s-a.freePointer.x,T=d-A,S=l;{var O=a.freePointer.x,k=a.freePointer.row*l,E=A;w.context.drawImage(x,0,0,E,S,O,k,E,S),g[0]={x:O,y:k,w:E,h:f}}{var _=A,I=(a.freePointer.row+1)*l,L=T;w&&w.context.drawImage(x,_,0,L,S,0,I,L,S),g[1]={x:0,y:I,w:L,h:f}}a.freePointer.x=T,a.freePointer.row++},y=function(){a.freePointer.x=0,a.freePointer.row++};if(this.freePointer.x+d<=s)m();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===s?(y(),m()):this.enableWrapping?v():(y(),m())}return this.keyToLocation.set(r,g),this.needsBuffer=!0,g}},{key:"getOffsets",value:function(r){return this.keyToLocation.get(r)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(r){if(this.locked)return!1;var n=this.texSize,i=this.texRows,a=this.getScale(r),s=a.texW;return this.freePointer.x+s>n?this.freePointer.row1&&arguments[1]!==void 0?arguments[1]:{},a=i.forceRedraw,s=a===void 0?!1:a,o=i.filterEle,l=o===void 0?function(){return!0}:o,u=i.filterType,h=u===void 0?function(){return!0}:u,d=!1,f=!1,p=Gh(r),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(l(m)){var v=Gh(this.renderTypes.values()),y;try{var b=function(){var w=y.value,A=w.type;if(h(A)){var T=n.collections.get(w.collection),S=w.getKey(m),O=Array.isArray(S)?S:[S];if(s)O.forEach(function(I){return T.markKeyForGC(I)}),f=!0;else{var k=w.getID?w.getID(m):m.id(),E=n._key(A,k),_=n.typeAndIdToKey.get(E);_!==void 0&&!ORn(O,_)&&(d=!0,n.typeAndIdToKey.delete(E),_.forEach(function(I){return T.markKeyForGC(I)}))}}};for(v.s();!(y=v.n()).done;)b()}catch(x){v.e(x)}finally{v.f()}}}}catch(x){p.e(x)}finally{p.f()}return f&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var r=Gh(this.collections.values()),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;i.gc()}}catch(a){r.e(a)}finally{r.f()}}},{key:"getOrCreateAtlas",value:function(r,n,i,a){var s=this.renderTypes.get(n),o=this.collections.get(s.collection),l=!1,u=o.draw(a,i,function(f){s.drawClipped?(f.save(),f.beginPath(),f.rect(0,0,i.w,i.h),f.clip(),s.drawElement(f,r,i,!0,!0),f.restore()):s.drawElement(f,r,i,!0,!0),l=!0});if(l){var h=s.getID?s.getID(r):r.id(),d=this._key(n,h);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(a):this.typeAndIdToKey.set(d,[a])}return u}},{key:"getAtlasInfo",value:function(r,n){var i=this,a=this.renderTypes.get(n),s=a.getKey(r),o=Array.isArray(s)?s:[s];return o.map(function(l){var u=a.getBoundingBox(r,l),h=i.getOrCreateAtlas(r,n,u,l),d=h.getOffsets(l),f=$o(d,2),p=f[0],g=f[1];return{atlas:h,tex:p,tex1:p,tex2:g,bb:u}})}},{key:"getDebugInfo",value:function(){var r=[],n=Gh(this.collections),i;try{for(n.s();!(i=n.n()).done;){var a=$o(i.value,2),s=a[0],o=a[1],l=o.getCounts(),u=l.keyCount,h=l.atlasCount;r.push({type:s,keyCount:u,atlasCount:h})}}catch(d){n.e(d)}finally{n.f()}return r}}])}(),FRn=function(){function t(e){_2(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return R2(t,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(r,n){return n})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(r){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(r):!0}},{key:"getAtlasIndexForBatch",value:function(r){var n=this.batchAtlases.indexOf(r);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(r),n=this.batchAtlases.length-1}return n}}])}(),zRn=` +`),y=v.length,b=0,x=0,w=0;w1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l=t.desktopTapThreshold2}var Xt=a(j);Fe&&(t.hoverData.tapholdCancelled=!0);var Ft=function(){var Ct=t.hoverData.dragDelta=t.hoverData.dragDelta||[];Ct.length===0?(Ct.push(Ge[0]),Ct.push(Ge[1])):(Ct[0]+=Ge[0],Ct[1]+=Ge[1])};pe=!0,i(Xe,["mousemove","vmousemove","tapdrag"],j,{x:_e[0],y:_e[1]});var gt=function(Ct){return{originalEvent:j,type:Ct,position:{x:_e[0],y:_e[1]}}},Ae=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||te.emit(gt("boxstart")),Pe[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(Fe){var zt=gt("cxtdrag");Ze?Ze.emit(zt):te.emit(zt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||Xe!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(gt("cxtdragout")),t.hoverData.cxtOver=Xe,Xe&&Xe.emit(gt("cxtdragover")))}}else if(t.hoverData.dragging){if(pe=!0,te.panningEnabled()&&te.userPanningEnabled()){var kt;if(t.hoverData.justStartedPan){var At=t.hoverData.mdownPos;kt={x:(_e[0]-At[0])*ye,y:(_e[1]-At[1])*ye},t.hoverData.justStartedPan=!1}else kt={x:Ge[0]*ye,y:Ge[1]*ye};te.panBy(kt),te.emit(gt("dragpan")),t.hoverData.dragged=!0}_e=t.projectIntoViewport(j.clientX,j.clientY)}else if(Pe[4]==1&&(Ze==null||Ze.pannable())){if(Fe){if(!t.hoverData.dragging&&te.boxSelectionEnabled()&&(Xt||!te.panningEnabled()||!te.userPanningEnabled()))Ae();else if(!t.hoverData.selecting&&te.panningEnabled()&&te.userPanningEnabled()){var Mt=s(Ze,t.hoverData.downs);Mt&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,Pe[4]=0,t.data.bgActivePosistion=m3(Le),t.redrawHint("select",!0),t.redraw())}Ze&&Ze.pannable()&&Ze.active()&&Ze.unactivate()}}else{if(Ze&&Ze.pannable()&&Ze.active()&&Ze.unactivate(),(!Ze||!Ze.grabbed())&&Xe!=Ne&&(Ne&&i(Ne,["mouseout","tapdragout"],j,{x:_e[0],y:_e[1]}),Xe&&i(Xe,["mouseover","tapdragover"],j,{x:_e[0],y:_e[1]}),t.hoverData.last=Xe),Ze)if(Fe){if(te.boxSelectionEnabled()&&Xt)Ze&&Ze.grabbed()&&(m(lt),Ze.emit(gt("freeon")),lt.emit(gt("free")),t.dragData.didDrag&&(Ze.emit(gt("dragfreeon")),lt.emit(gt("dragfree")))),Ae();else if(Ze&&Ze.grabbed()&&t.nodeIsDraggable(Ze)){var jr=!t.dragData.didDrag;jr&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(lt,{inDragLayer:!0});var Re={x:0,y:0};if(or(Ge[0])&&or(Ge[1])&&(Re.x+=Ge[0],Re.y+=Ge[1],jr)){var at=t.hoverData.dragDelta;at&&or(at[0])&&or(at[1])&&(Re.x+=at[0],Re.y+=at[1])}t.hoverData.draggingEles=!0,lt.silentShift(Re).emit(gt("position")).emit(gt("drag")),t.redrawHint("drag",!0),t.redraw()}}else Ft();pe=!0}if(Pe[2]=_e[0],Pe[3]=_e[1],pe)return j.stopPropagation&&j.stopPropagation(),j.preventDefault&&j.preventDefault(),!1}},!1);var E,_,I;t.registerBinding(e,"mouseup",function(j){if(!(t.hoverData.which===1&&j.which!==1&&t.hoverData.capture)){var ie=t.hoverData.capture;if(ie){t.hoverData.capture=!1;var pe=t.cy,te=t.projectIntoViewport(j.clientX,j.clientY),ye=t.selection,oe=t.findNearestElement(te[0],te[1],!0,!1),_e=t.dragData.possibleDragElements,Le=t.hoverData.down,Ye=a(j);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,Le&&Le.unactivate();var Pe=function(wt){return{originalEvent:j,type:wt,position:{x:te[0],y:te[1]}}};if(t.hoverData.which===3){var Xe=Pe("cxttapend");if(Le?Le.emit(Xe):pe.emit(Xe),!t.hoverData.cxtDragged){var Ne=Pe("cxttap");Le?Le.emit(Ne):pe.emit(Ne)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(i(oe,["mouseup","tapend","vmouseup"],j,{x:te[0],y:te[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(i(Le,["click","tap","vclick"],j,{x:te[0],y:te[1]}),_=!1,j.timeStamp-I<=pe.multiClickDebounceTime()?(E&&clearTimeout(E),_=!0,I=null,i(Le,["dblclick","dbltap","vdblclick"],j,{x:te[0],y:te[1]})):(E=setTimeout(function(){_||i(Le,["oneclick","onetap","voneclick"],j,{x:te[0],y:te[1]})},pe.multiClickDebounceTime()),I=j.timeStamp)),Le==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(j)&&(pe.$(r).unselect(["tapunselect"]),_e.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=_e=pe.collection()),oe==Le&&!t.dragData.didDrag&&!t.hoverData.selecting&&oe!=null&&oe._private.selectable&&(t.hoverData.dragging||(pe.selectionType()==="additive"||Ye?oe.selected()?oe.unselect(["tapunselect"]):oe.select(["tapselect"]):Ye||(pe.$(r).unmerge(oe).unselect(["tapunselect"]),oe.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Ze=pe.collection(t.getAllInBox(ye[0],ye[1],ye[2],ye[3]));t.redrawHint("select",!0),Ze.length>0&&t.redrawHint("eles",!0),pe.emit(Pe("boxend"));var Ge=function(wt){return wt.selectable()&&!wt.selected()};pe.selectionType()==="additive"||Ye||pe.$(r).unmerge(Ze).unselect(),Ze.emit(Pe("box")).stdFilter(Ge).select().emit(Pe("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!ye[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var lt=Le&&Le.grabbed();m(_e),lt&&(Le.emit(Pe("freeon")),_e.emit(Pe("free")),t.dragData.didDrag&&(Le.emit(Pe("dragfreeon")),_e.emit(Pe("dragfree"))))}}ye[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var L=[],R=4,D,M=1e5,P=function(j){for(var ie=Math.abs(j[0]),pe=1;pe=R){D=!1;var te=L;if(te[0]>=5){var ye;P(te)?ye=te[0]:ye=KEn(te),ye>1&&(D=!0,M=ye)}}else L.push(Math.abs(pe)),ie=!0;else D&&(M=Math.min(Math.abs(pe),M));if(!t.scrollingPage){var oe=t.cy,_e=oe.zoom(),Le=oe.pan(),Ye=t.projectIntoViewport(j.clientX,j.clientY),Pe=[Ye[0]*_e+Le.x,Ye[1]*_e+Le.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||T()){j.preventDefault();return}if(oe.panningEnabled()&&oe.userPanningEnabled()&&oe.zoomingEnabled()&&oe.userZoomingEnabled()){j.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var Xe;ie&&Math.abs(pe)>5&&(pe=RCe(pe)*5),Xe=pe/-250,D&&(Xe/=M,Xe*=3),Xe=Xe*t.wheelSensitivity;var Ne=j.deltaMode===1;Ne&&(Xe*=33);var Ze=oe.zoom()*Math.pow(10,Xe);j.type==="gesturechange"&&(Ze=t.gestureStartZoom*j.scale),oe.zoom({level:Ze,renderedPosition:{x:Pe[0],y:Pe[1]}}),oe.emit({type:j.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:j,position:{x:Ye[0],y:Ye[1]}})}}}};t.registerBinding(t.container,"wheel",N,!0),t.registerBinding(e,"scroll",function(j){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(j){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||j.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(ne){t.hasTouchStarted||N(ne)},!0),t.registerBinding(t.container,"mouseout",function(j){var ie=t.projectIntoViewport(j.clientX,j.clientY);t.cy.emit({originalEvent:j,type:"mouseout",position:{x:ie[0],y:ie[1]}})},!1),t.registerBinding(t.container,"mouseover",function(j){var ie=t.projectIntoViewport(j.clientX,j.clientY);t.cy.emit({originalEvent:j,type:"mouseover",position:{x:ie[0],y:ie[1]}})},!1);var F,B,V,z,U,Q,G,X,Y,le,q,Z,ee,re=function(j,ie,pe,te){return Math.sqrt((pe-j)*(pe-j)+(te-ie)*(te-ie))},ve=function(j,ie,pe,te){return(pe-j)*(pe-j)+(te-ie)*(te-ie)},ae;t.registerBinding(t.container,"touchstart",ae=function(j){if(t.hasTouchStarted=!0,!!O(j)){y(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var ie=t.cy,pe=t.touchData.now,te=t.touchData.earlier;if(j.touches[0]){var ye=t.projectIntoViewport(j.touches[0].clientX,j.touches[0].clientY);pe[0]=ye[0],pe[1]=ye[1]}if(j.touches[1]){var ye=t.projectIntoViewport(j.touches[1].clientX,j.touches[1].clientY);pe[2]=ye[0],pe[3]=ye[1]}if(j.touches[2]){var ye=t.projectIntoViewport(j.touches[2].clientX,j.touches[2].clientY);pe[4]=ye[0],pe[5]=ye[1]}var oe=function(Xt){return{originalEvent:j,type:Xt,position:{x:pe[0],y:pe[1]}}};if(j.touches[1]){t.touchData.singleTouchMoved=!0,m(t.dragData.touchDragEles);var _e=t.findContainerClientCoords();Y=_e[0],le=_e[1],q=_e[2],Z=_e[3],F=j.touches[0].clientX-Y,B=j.touches[0].clientY-le,V=j.touches[1].clientX-Y,z=j.touches[1].clientY-le,ee=0<=F&&F<=q&&0<=V&&V<=q&&0<=B&&B<=Z&&0<=z&&z<=Z;var Le=ie.pan(),Ye=ie.zoom();U=re(F,B,V,z),Q=ve(F,B,V,z),G=[(F+V)/2,(B+z)/2],X=[(G[0]-Le.x)/Ye,(G[1]-Le.y)/Ye];var Pe=200,Xe=Pe*Pe;if(Q=1){for(var Me=t.touchData.startPosition=[null,null,null,null,null,null],Rt=0;Rt=t.touchTapThreshold2}if(ie&&t.touchData.cxt){j.preventDefault();var Rt=j.touches[0].clientX-Y,Lt=j.touches[0].clientY-le,ut=j.touches[1].clientX-Y,Xt=j.touches[1].clientY-le,Ft=ve(Rt,Lt,ut,Xt),gt=Ft/Q,Ae=150,zt=Ae*Ae,kt=1.5,At=kt*kt;if(gt>=At||Ft>=zt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Mt=Ye("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(Mt),t.touchData.start=null):te.emit(Mt)}}if(ie&&t.touchData.cxt){var Mt=Ye("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Mt):te.emit(Mt),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var jr=t.findNearestElement(ye[0],ye[1],!0,!0);(!t.touchData.cxtOver||jr!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(Ye("cxtdragout")),t.touchData.cxtOver=jr,jr&&jr.emit(Ye("cxtdragover")))}else if(ie&&j.touches[2]&&te.boxSelectionEnabled())j.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||te.emit(Ye("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,pe[4]=1,!pe||pe.length===0||pe[0]===void 0?(pe[0]=(ye[0]+ye[2]+ye[4])/3,pe[1]=(ye[1]+ye[3]+ye[5])/3,pe[2]=(ye[0]+ye[2]+ye[4])/3+1,pe[3]=(ye[1]+ye[3]+ye[5])/3+1):(pe[2]=(ye[0]+ye[2]+ye[4])/3,pe[3]=(ye[1]+ye[3]+ye[5])/3),t.redrawHint("select",!0),t.redraw();else if(ie&&j.touches[1]&&!t.touchData.didSelect&&te.zoomingEnabled()&&te.panningEnabled()&&te.userZoomingEnabled()&&te.userPanningEnabled()){j.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Re=t.dragData.touchDragEles;if(Re){t.redrawHint("drag",!0);for(var at=0;at0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var Oe;t.registerBinding(e,"touchcancel",Oe=function(j){var ie=t.touchData.start;t.touchData.capture=!1,ie&&ie.unactivate()});var $e,he,fe,Se;if(t.registerBinding(e,"touchend",$e=function(j){var ie=t.touchData.start,pe=t.touchData.capture;if(pe)j.touches.length===0&&(t.touchData.capture=!1),j.preventDefault();else return;var te=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var ye=t.cy,oe=ye.zoom(),_e=t.touchData.now,Le=t.touchData.earlier;if(j.touches[0]){var Ye=t.projectIntoViewport(j.touches[0].clientX,j.touches[0].clientY);_e[0]=Ye[0],_e[1]=Ye[1]}if(j.touches[1]){var Ye=t.projectIntoViewport(j.touches[1].clientX,j.touches[1].clientY);_e[2]=Ye[0],_e[3]=Ye[1]}if(j.touches[2]){var Ye=t.projectIntoViewport(j.touches[2].clientX,j.touches[2].clientY);_e[4]=Ye[0],_e[5]=Ye[1]}var Pe=function(zt){return{originalEvent:j,type:zt,position:{x:_e[0],y:_e[1]}}};ie&&ie.unactivate();var Xe;if(t.touchData.cxt){if(Xe=Pe("cxttapend"),ie?ie.emit(Xe):ye.emit(Xe),!t.touchData.cxtDragged){var Ne=Pe("cxttap");ie?ie.emit(Ne):ye.emit(Ne)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!j.touches[2]&&ye.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var Ze=ye.collection(t.getAllInBox(te[0],te[1],te[2],te[3]));te[0]=void 0,te[1]=void 0,te[2]=void 0,te[3]=void 0,te[4]=0,t.redrawHint("select",!0),ye.emit(Pe("boxend"));var Ge=function(zt){return zt.selectable()&&!zt.selected()};Ze.emit(Pe("box")).stdFilter(Ge).select().emit(Pe("boxselect")),Ze.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(ie!=null&&ie.unactivate(),j.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!j.touches[1]){if(!j.touches[0]){if(!j.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var lt=t.dragData.touchDragEles;if(ie!=null){var Fe=ie._private.grabbed;m(lt),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Fe&&(ie.emit(Pe("freeon")),lt.emit(Pe("free")),t.dragData.didDrag&&(ie.emit(Pe("dragfreeon")),lt.emit(Pe("dragfree")))),i(ie,["touchend","tapend","vmouseup","tapdragout"],j,{x:_e[0],y:_e[1]}),ie.unactivate(),t.touchData.start=null}else{var wt=t.findNearestElement(_e[0],_e[1],!0,!0);i(wt,["touchend","tapend","vmouseup","tapdragout"],j,{x:_e[0],y:_e[1]})}var Me=t.touchData.startPosition[0]-_e[0],Rt=Me*Me,Lt=t.touchData.startPosition[1]-_e[1],ut=Lt*Lt,Xt=Rt+ut,Ft=Xt*oe*oe;t.touchData.singleTouchMoved||(ie||ye.$(":selected").unselect(["tapunselect"]),i(ie,["tap","vclick"],j,{x:_e[0],y:_e[1]}),he=!1,j.timeStamp-Se<=ye.multiClickDebounceTime()?(fe&&clearTimeout(fe),he=!0,Se=null,i(ie,["dbltap","vdblclick"],j,{x:_e[0],y:_e[1]})):(fe=setTimeout(function(){he||i(ie,["onetap","voneclick"],j,{x:_e[0],y:_e[1]})},ye.multiClickDebounceTime()),Se=j.timeStamp)),ie!=null&&!t.dragData.didDrag&&ie._private.selectable&&Ft"u"){var ge=[],Qe=function(j){return{clientX:j.clientX,clientY:j.clientY,force:1,identifier:j.pointerId,pageX:j.pageX,pageY:j.pageY,radiusX:j.width/2,radiusY:j.height/2,screenX:j.screenX,screenY:j.screenY,target:j.target}},Te=function(j){return{event:j,touch:Qe(j)}},De=function(j){ge.push(Te(j))},qe=function(j){for(var ie=0;ie0)return z[0]}return null},g=Object.keys(f),m=0;m0?p:VLt(a,s,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,a,s,o,l){l=l==="auto"?B2(i,a):l;var u=2*l;if(T1(e,r,this.points,s,o,i,a-u,[0,-1],n)||T1(e,r,this.points,s,o,i-u,a,[0,-1],n))return!0;var h=i/2+2*n,d=a/2+2*n,f=[s-h,o-d,s-h,o,s+h,o,s+h,o-d];return!!(Hh(e,r,f)||TC(e,r,u,u,s+i/2-l,o+a/2-l,n)||TC(e,r,u,u,s-i/2+l,o+a/2-l,n))}}},O1.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Hu(3,0)),this.generateRoundPolygon("round-triangle",Hu(3,0)),this.generatePolygon("rectangle",Hu(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",Hu(5,0)),this.generateRoundPolygon("round-pentagon",Hu(5,0)),this.generatePolygon("hexagon",Hu(6,0)),this.generateRoundPolygon("round-hexagon",Hu(6,0)),this.generatePolygon("heptagon",Hu(7,0)),this.generateRoundPolygon("round-heptagon",Hu(7,0)),this.generatePolygon("octagon",Hu(8,0)),this.generateRoundPolygon("round-octagon",Hu(8,0));var n=new Array(20);{var i=MCe(5,0),a=MCe(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o=e.deqFastCost*w)break}else if(u){if(b>=e.deqCost*p||b>=e.deqAvgCost*f)break}else if(x>=e.deqNoDrawCost*cke)break;var A=e.deq(n,v,m);if(A.length>0)for(var S=0;S0&&(e.onDeqd(n,g),!u&&e.shouldRedraw(n,g,v,m)&&a())},o=e.priority||TCe;i.beforeRender(s,o(n))}}}},B3n=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:kJ;_2(this,t),this.idsByKey=new S1,this.keyForId=new S1,this.cachesByLvl=new S1,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return R2(t,[{key:"getIdsFor",value:function(r){r==null&&vs("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(r);return i||(i=new g3,n.set(r,i)),i}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);this.deleteIdForKey(i,n),this.addIdForKey(a,n),this.keyForId.set(n,a)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteIdForKey(i,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);return i!==a}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,i=this.lvls,a=n.get(r);return a||(a=new S1,n.set(r,a),i.push(r)),a}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var i=this.getKey(r),a=this.getCache(i,n);return a!=null&&this.updateKeyMappingFor(r),a}},{key:"getForCachedKey",value:function(r,n){var i=this.keyForId.get(r.id()),a=this.getCache(i,n);return a}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var i=this.getKey(r);return this.hasCache(i,n)}},{key:"setCache",value:function(r,n,i){i.key=r,this.getCachesAt(n).set(r,i)}},{key:"set",value:function(r,n,i){var a=this.getKey(r);this.setCache(a,n,i),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var i=this.getKey(r);this.deleteCache(i,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(i){return n.deleteCache(r,i)})}},{key:"invalidate",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteKeyMappingFor(r);var a=this.doesEleInvalidateKey(r);return a&&this.invalidateKey(i),a||this.getNumberOfIdsForKey(i)===0}}])}(),PPt=25,gee=50,mee=-4,uke=3,NPt=7.99,$3n=8,F3n=1024,z3n=1024,U3n=1024,V3n=.2,Q3n=.8,G3n=10,H3n=.15,W3n=.1,Y3n=.9,q3n=.9,j3n=100,X3n=1,N3={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},K3n=pc({getKey:null,doesEleInvalidateKey:kJ,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:ELt,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),P9=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var i=K3n(r);sn(n,i),n.lookup=new B3n(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},al=P9.prototype;al.reasons=N3,al.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},al.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n},al.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new m9(function(r,n){return n.reqs-r.reqs});return e},al.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e},al.getElement=function(t,e,r,n,i){var a=this,s=this.renderer,o=s.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!a.allowEdgeTxrCaching&&t.isEdge()||!a.allowParentTxrCaching&&t.isParent())return null;if(n==null&&(n=Math.ceil(_Ce(o*r))),n=NPt||n>uke)return null;var u=Math.pow(2,n),h=e.h*u,d=e.w*u,f=s.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,f))return null;var p=l.get(t,n);if(p&&p.invalidated&&(p.invalidated=!1,p.texture.invalidatedWidth-=p.width),p)return p;var g;if(h<=PPt?g=PPt:h<=gee?g=gee:g=Math.ceil(h/gee)*gee,h>U3n||d>z3n)return null;var m=a.getTextureQueue(g),v=m[m.length-2],y=function(){return a.recycleTexture(g,d)||a.addTexture(g,d)};v||(v=m[m.length-1]),v||(v=y()),v.width-v.usedWidthn;_--)k=a.getElement(t,e,r,_,N3.downscale);E()}else return a.queueElement(t,S.level-1),S;else{var I;if(!x&&!w&&!A)for(var L=n-1;L>=mee;L--){var R=l.get(t,L);if(R){I=R;break}}if(b(I))return a.queueElement(t,n),I;v.context.translate(v.usedWidth,0),v.context.scale(u,u),this.drawElement(v.context,t,e,f,!1),v.context.scale(1/u,1/u),v.context.translate(-v.usedWidth,0)}return p={x:v.usedWidth,texture:v,level:n,scale:u,width:d,height:h,scaledLabelShown:f},v.usedWidth+=Math.ceil(d+$3n),v.eleCaches.push(p),l.set(t,n,p),a.checkTextureFullness(v),p},al.invalidateElements=function(t){for(var e=0;e=V3n*t.width&&this.retireTexture(t)},al.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>Q3n&&t.fullnessChecks>=G3n?I2(r,t):t.fullnessChecks++},al.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),i=this.lookup;I2(n,t),t.retired=!0;for(var a=t.eleCaches,s=0;s=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,CCe(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),I2(i,s),n.push(s),s}},al.queueElement=function(t,e){var r=this,n=r.getElementQueue(),i=r.getElementKeyToQueue(),a=this.getKey(t),s=i[a];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,n.updateItem(s);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:a};n.push(o),i[a]=o}},al.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=[],a=e.lookup,s=0;s0;s++){var o=r.pop(),l=o.key,u=o.eles[0],h=a.hasCache(u,o.level);if(n[l]=null,h)continue;i.push(o);var d=e.getBoundingBox(u);e.getElement(u,d,t,o.level,N3.dequeue)}return i},al.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=this.getKey(t),a=n[i];a!=null&&(a.eles.length===1?(a.reqs=SCe,r.updateItem(a),r.pop(),n[i]=null):a.eles.unmerge(t))},al.onDequeue=function(t){this.onDequeues.push(t)},al.offDequeue=function(t){I2(this.onDequeues,t)},al.setupDequeueing=IPt.setupDequeueing({deqRedrawThreshold:j3n,deqCost:H3n,deqAvgCost:W3n,deqNoDrawCost:Y3n,deqFastCost:q3n,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n=J3n||r>vee)return null}n.validateLayersElesOrdering(r,t);var l=n.layersByLevel,u=Math.pow(2,r),h=l[r]=l[r]||[],d,f=n.levelIsComplete(r,t),p,g=function(){var E=function(D){if(n.validateLayersElesOrdering(D,t),n.levelIsComplete(D,t))return p=l[D],!0},_=function(D){if(!p)for(var M=r+D;N9<=M&&M<=vee&&!E(M);M+=D);};_(1),_(-1);for(var I=h.length-1;I>=0;I--){var L=h[I];L.invalid&&I2(h,L)}};if(!f)g();else return h;var m=function(){if(!d){d=Gu();for(var E=0;E$Pt||L>$Pt)return null;var R=I*L;if(R>oRn)return null;var D=n.makeLayer(d,r);if(_!=null){var M=h.indexOf(_)+1;h.splice(M,0,D)}else(E.insert===void 0||E.insert)&&h.unshift(D);return D};if(n.skipping&&!o)return null;for(var y=null,b=t.length/Z3n,x=!o,w=0;w=b||!ULt(y.bb,A.boundingBox()))&&(y=v({insert:!0,after:y}),!y))return null;p||x?n.queueLayer(y,A):n.drawEleInLayer(y,A,r,e),y.eles.push(A),T[r]=y}return p||(x?null:h)},vc.getEleLevelForLayerLevel=function(t,e){return t},vc.drawEleInLayer=function(t,e,r,n){var i=this,a=this.renderer,s=t.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(r=i.getEleLevelForLayerLevel(r,n),a.setImgSmoothing(s,!1),a.drawCachedElement(s,e,null,null,r,lRn),a.setImgSmoothing(s,!0))},vc.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var i=0,a=0;a0||s.invalid)return!1;i+=s.eles.length}return i===e.length},vc.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n0){e=!0;break}}return e},vc.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=A1(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,i,a){e.invalidateLayer(n)}))},vc.invalidateLayer=function(t){if(this.lastInvalidationTime=A1(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];I2(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var i=0;i3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(a&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var l;r&&(l=r,t.translate(-l.x1,-l.y1));var u=a?e.pstyle("opacity").value:1,h=a?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,f=e.pstyle("line-style").value,p=e.pstyle("width").pfValue,g=e.pstyle("line-cap").value,m=e.pstyle("line-outline-width").value,v=e.pstyle("line-outline-color").value,y=u*h,b=u*h,x=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;d==="straight-triangle"?(s.eleStrokeStyle(t,e,D),s.drawEdgeTrianglePath(e,t,o.allpts)):(t.lineWidth=p,t.lineCap=g,s.eleStrokeStyle(t,e,D),s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},w=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;if(t.lineWidth=p+m,t.lineCap=g,m>0)s.colorStrokeStyle(t,v[0],v[1],v[2],D);else{t.lineCap="butt";return}d==="straight-triangle"?s.drawEdgeTrianglePath(e,t,o.allpts):(s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},A=function(){i&&s.drawEdgeOverlay(t,e)},S=function(){i&&s.drawEdgeUnderlay(t,e)},T=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;s.drawArrowheads(t,e,D)},O=function(){s.drawElementText(t,e,null,n)};t.lineJoin="round";var k=e.pstyle("ghost").value==="yes";if(k){var E=e.pstyle("ghost-offset-x").pfValue,_=e.pstyle("ghost-offset-y").pfValue,I=e.pstyle("ghost-opacity").value,L=y*I;t.translate(E,_),x(L),T(L),t.translate(-E,-_)}else w();S(),x(),T(),A(),O(),r&&t.translate(l.x1,l.y1)}};var GPt=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var i=n.pstyle("".concat(e,"-opacity")).value;if(i!==0){var a=this,s=a.usePaths(),o=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,u=2*l,h=n.pstyle("".concat(e,"-color")).value;r.lineWidth=u,o.edgeType==="self"&&!s?r.lineCap="butt":r.lineCap="round",a.colorStrokeStyle(r,h[0],h[1],h[2],i),a.drawEdgePath(n,r,o.allpts,"solid")}}}};k1.drawEdgeOverlay=GPt("overlay"),k1.drawEdgeUnderlay=GPt("underlay"),k1.drawEdgePath=function(t,e,r,n){var i=t._private.rscratch,a=e,s,o=!1,l=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,h=t.pstyle("line-dash-offset").pfValue;if(l){var d=r.join("$"),f=i.pathCacheKey&&i.pathCacheKey===d;f?(s=e=i.pathCache,o=!0):(s=e=new Path2D,i.pathCacheKey=d,i.pathCache=s)}if(a.setLineDash)switch(n){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=h;break;case"solid":a.setLineDash([]);break}if(!o&&!i.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var p=2;p+35&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(n==null){if(a&&!s.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e),u=e.pstyle("text-metrics").strValue==="glyph";t.textAlign=l,t.textBaseline=u?"alphabetic":"bottom"}else{var h=e.element()._private.rscratch.badLine,d=e.pstyle("label"),f=e.pstyle("source-label"),p=e.pstyle("target-label");if(h||(!d||!d.value)&&(!f||!f.value)&&(!p||!p.value))return;t.textAlign="center",t.textBaseline="bottom"}var g=!r,m;r&&(m=r,t.translate(-m.x1,-m.y1)),i==null?(s.drawText(t,e,null,g,a),e.isEdge()&&(s.drawText(t,e,"source",g,a),s.drawText(t,e,"target",g,a))):s.drawText(t,e,i,g,a),r&&t.translate(m.x1,m.y1)},DC.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue+"px",a=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=n+" "+s+" "+i+" "+a,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],o),this.colorStrokeStyle(t,h[0],h[1],h[2],l)};function bRn(t,e,r,n,i){var a=Math.min(n,i),s=a/2,o=e+n/2,l=r+i/2;t.beginPath(),t.arc(o,l,s,0,Math.PI*2),t.closePath()}function HPt(t,e,r,n,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(a,n/2,i/2);t.beginPath(),t.moveTo(e+s,r),t.lineTo(e+n-s,r),t.quadraticCurveTo(e+n,r,e+n,r+s),t.lineTo(e+n,r+i-s),t.quadraticCurveTo(e+n,r+i,e+n-s,r+i),t.lineTo(e+s,r+i),t.quadraticCurveTo(e,r+i,e,r+i-s),t.lineTo(e,r+s),t.quadraticCurveTo(e,r,e+s,r),t.closePath()}DC.getTextAngle=function(t,e){var r,n=t._private,i=n.rscratch,a=e?e+"-":"",s=t.pstyle(a+"text-rotation");if(s.strValue==="autorotate"){var o=Qu(i,"labelAngle",e);r=t.isEdge()?o:0}else s.strValue==="none"?r=0:r=s.pfValue;return r},DC.drawText=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=e._private,s=a.rscratch,o=i?e.effectiveOpacity():1;if(!(i&&(o===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=Qu(s,"labelX",r),u=Qu(s,"labelY",r),h,d,f=this.getLabelText(e,r);if(f!=null&&f!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(t,e,i);var p=r?r+"-":"",g=Qu(s,"labelWidth",r),m=Qu(s,"labelHeight",r),v=Qu(s,"labelActualDescent",r),y=e.pstyle(p+"text-margin-x").pfValue,b=e.pstyle(p+"text-margin-y").pfValue,x=e.isEdge(),w=e.pstyle("text-halign").value,A=e.pstyle("text-valign").value;x&&(w="center",A="center"),l+=y,u+=b;var S;n?S=this.getTextAngle(e,r):S=0,S!==0&&(h=l,d=u,t.translate(h,d),t.rotate(S),l=0,u=0);var T=O3(w),O=k3(A);switch(O){case"top":break;case"center":u+=m/2;break;case"bottom":u+=m;break}var k=e.pstyle("text-background-opacity").value,E=e.pstyle("text-border-opacity").value,_=e.pstyle("text-border-width").pfValue,I=e.pstyle("text-background-padding").pfValue,L=e.pstyle("text-background-shape").strValue,R=L==="round-rectangle"||L==="roundrectangle",D=L==="circle",M=2;if(k>0||_>0&&E>0){var P=t.fillStyle,N=t.strokeStyle,F=t.lineWidth,B=e.pstyle("text-background-color").value,V=e.pstyle("text-border-color").value,z=e.pstyle("text-border-style").value,U=k>0,Q=_>0&&E>0,G=l-I;switch(T){case"left":G-=g;break;case"center":G-=g/2;break}var X=u-m-I,Y=g+2*I,le=m+2*I;if(U&&(t.fillStyle="rgba(".concat(B[0],",").concat(B[1],",").concat(B[2],",").concat(k*o,")")),Q&&(t.strokeStyle="rgba(".concat(V[0],",").concat(V[1],",").concat(V[2],",").concat(E*o,")"),t.lineWidth=_,t.setLineDash))switch(z){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=_/4,t.setLineDash([]);break;case"solid":default:t.setLineDash([]);break}if(R?(t.beginPath(),HPt(t,G,X,Y,le,M)):D?(t.beginPath(),bRn(t,G,X,Y,le)):(t.beginPath(),t.rect(G,X,Y,le)),U&&t.fill(),Q&&t.stroke(),Q&&z==="double"){var q=_/2;t.beginPath(),R?HPt(t,G+q,X+q,Y-2*q,le-2*q,M):t.rect(G+q,X+q,Y-2*q,le-2*q),t.stroke()}t.fillStyle=P,t.strokeStyle=N,t.lineWidth=F,t.setLineDash&&t.setLineDash([])}var Z=2*e.pstyle("text-outline-width").pfValue;if(Z>0&&(t.lineWidth=Z),u-=v,e.pstyle("text-wrap").value==="wrap"){var ee=Qu(s,"labelWrapCachedLines",r),re=Qu(s,"labelLineHeight",r),ve=g/2,ae=this.getLabelJustification(e);switch(ae==="auto"||(T==="left"?ae==="left"?l+=-g:ae==="center"&&(l+=-ve):T==="center"?ae==="left"?l+=-ve:ae==="right"&&(l+=ve):T==="right"&&(ae==="center"?l+=ve:ae==="right"&&(l+=g))),O){case"top":u-=(ee.length-1)*re;break;case"center":case"bottom":u-=(ee.length-1)*re;break}for(var Ce=0;Ce0&&t.strokeText(ee[Ce],l,u),t.fillText(ee[Ce],l,u),u+=re}else Z>0&&t.strokeText(f,l,u),t.fillText(f,l,u);S!==0&&(t.rotate(-S),t.translate(-h,-d))}}};var W2={};W2.drawNode=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,l,u=e._private,h=u.rscratch,d=e.position();if(!(!or(d.x)||!or(d.y))&&!(a&&!e.visible())){var f=a?e.effectiveOpacity():1,p=s.usePaths(),g,m=!1,v=e.padding();o=e.width()+2*v,l=e.height()+2*v;var y;r&&(y=r,t.translate(-y.x1,-y.y1));for(var b=e.pstyle("background-image"),x=b.value,w=new Array(x.length),A=new Array(x.length),S=0,T=0;T0&&arguments[0]!==void 0?arguments[0]:L;s.eleFillStyle(t,e,ie)},q=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:V;s.colorStrokeStyle(t,R[0],R[1],R[2],ie)},Z=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G;s.colorStrokeStyle(t,U[0],U[1],U[2],ie)},ee=function(ie,pe,te,ye){var oe=s.nodePathCache=s.nodePathCache||[],_e=OLt(te==="polygon"?te+","+ye.join(","):te,""+pe,""+ie,""+Y),Le=oe[_e],Ye,Pe=!1;return Le!=null?(Ye=Le,Pe=!0,h.pathCache=Ye):(Ye=new Path2D,oe[_e]=h.pathCache=Ye),{path:Ye,cacheHit:Pe}},re=e.pstyle("shape").strValue,ve=e.pstyle("shape-polygon-points").pfValue;if(p){t.translate(d.x,d.y);var ae=ee(o,l,re,ve);g=ae.path,m=ae.cacheHit}var Ce=function(){if(!m){var ie=d;p&&(ie={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(g||t,ie.x,ie.y,o,l,Y,h)}p?t.fill(g):t.fill()},Oe=function(){for(var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,te=u.backgrounding,ye=0,oe=0;oe0&&arguments[0]!==void 0?arguments[0]:!1,pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasPie(e)&&(s.drawPie(t,e,pe),ie&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,Y,h)))},he=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasStripe(e)&&(t.save(),p?t.clip(h.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,Y,h),t.clip()),s.drawStripe(t,e,pe),t.restore(),ie&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,Y,h)))},fe=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,pe=(_>0?_:-_)*ie,te=_>0?0:255;_!==0&&(s.colorFillStyle(t,te,te,te,pe),p?t.fill(g):t.fill())},Se=function(){if(I>0){if(t.lineWidth=I,t.lineCap=P,t.lineJoin=M,t.setLineDash)switch(D){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(F),t.lineDashOffset=B;break;case"solid":case"double":t.setLineDash([]);break}if(N!=="center"){if(t.save(),t.lineWidth*=2,N==="inside")p?t.clip(g):t.clip();else{var ie=new Path2D;ie.rect(-o/2-I,-l/2-I,o+2*I,l+2*I),ie.addPath(g),t.clip(ie,"evenodd")}p?t.stroke(g):t.stroke(),t.restore()}else p?t.stroke(g):t.stroke();if(D==="double"){t.lineWidth=I/3;var pe=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(g):t.stroke(),t.globalCompositeOperation=pe}t.setLineDash&&t.setLineDash([])}},ge=function(){if(z>0){if(t.lineWidth=z,t.lineCap="butt",t.setLineDash)switch(Q){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var ie=d;p&&(ie={x:0,y:0});var pe=s.getNodeShape(e),te=I;N==="inside"&&(te=0),N==="outside"&&(te*=2);var ye=(o+te+(z+X))/o,oe=(l+te+(z+X))/l,_e=o*ye,Le=l*oe,Ye=s.nodeShapes[pe].points,Pe;if(p){var Xe=ee(_e,Le,pe,Ye);Pe=Xe.path}if(pe==="ellipse")s.drawEllipsePath(Pe||t,ie.x,ie.y,_e,Le);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(pe)){var Ne=0,Ze=0,Ge=0;pe==="round-diamond"?Ne=(te+X+z)*1.4:pe==="round-heptagon"?(Ne=(te+X+z)*1.075,Ge=-(te/2+X+z)/35):pe==="round-hexagon"?Ne=(te+X+z)*1.12:pe==="round-pentagon"?(Ne=(te+X+z)*1.13,Ge=-(te/2+X+z)/15):pe==="round-tag"?(Ne=(te+X+z)*1.12,Ze=(te/2+z+X)*.07):pe==="round-triangle"&&(Ne=(te+X+z)*(Math.PI/2),Ge=-(te+X/2+z)/Math.PI),Ne!==0&&(ye=(o+Ne)/o,_e=o*ye,["round-hexagon","round-tag"].includes(pe)||(oe=(l+Ne)/l,Le=l*oe)),Y=Y==="auto"?GLt(_e,Le):Y;for(var lt=_e/2,Fe=Le/2,wt=Y+(te+z+X)/2,Me=new Array(Ye.length/2),Rt=new Array(Ye.length/2),Lt=0;Lt0){if(i=i||n.position(),a==null||s==null){var p=n.padding();a=n.width()+2*p,s=n.height()+2*p}o.colorFillStyle(r,h[0],h[1],h[2],u),o.nodeShapes[d].draw(r,i.x,i.y,a+l*2,s+l*2,f),r.fill()}}}};W2.drawNodeOverlay=WPt("overlay"),W2.drawNodeUnderlay=WPt("underlay"),W2.hasPie=function(t){return t=t[0],t._private.hasPie},W2.hasStripe=function(t){return t=t[0],t._private.hasStripe},W2.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,l=n.x,u=n.y,h=e.width(),d=e.height(),f=Math.min(h,d)/2,p,g=0,m=this.usePaths();if(m&&(l=0,u=0),a.units==="%"?f=f*a.pfValue:a.pfValue!==void 0&&(f=a.pfValue/2),s.units==="%"?p=f*s.pfValue:s.pfValue!==void 0&&(p=s.pfValue/2),!(p>=f))for(var v=1;v<=i.pieBackgroundN;v++){var y=e.pstyle("pie-"+v+"-background-size").value,b=e.pstyle("pie-"+v+"-background-color").value,x=e.pstyle("pie-"+v+"-background-opacity").value*r,w=y/100;w+g>1&&(w=1-g);var A=1.5*Math.PI+2*Math.PI*g;A+=o;var S=2*Math.PI*w,T=A+S;y===0||g>=1||g+w>1||(p===0?(t.beginPath(),t.moveTo(l,u),t.arc(l,u,f,A,T),t.closePath()):(t.beginPath(),t.arc(l,u,f,A,T),t.arc(l,u,p,T,A,!0),t.closePath()),this.colorFillStyle(t,b[0],b[1],b[2],x),t.fill(),g+=w)}},W2.drawStripe=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=n.x,s=n.y,o=e.width(),l=e.height(),u=0,h=this.usePaths();t.save();var d=e.pstyle("stripe-direction").value,f=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var p=o,g=l;f.units==="%"?(p=p*f.pfValue,g=g*f.pfValue):f.pfValue!==void 0&&(p=f.pfValue,g=f.pfValue),h&&(a=0,s=0),s-=p/2,a-=g/2;for(var m=1;m<=i.stripeBackgroundN;m++){var v=e.pstyle("stripe-"+m+"-background-size").value,y=e.pstyle("stripe-"+m+"-background-color").value,b=e.pstyle("stripe-"+m+"-background-opacity").value*r,x=v/100;x+u>1&&(x=1-u),!(v===0||u>=1||u+x>1)&&(t.beginPath(),t.rect(a,s+g*u,p,g*x),t.closePath(),this.colorFillStyle(t,y[0],y[1],y[2],b),t.fill(),u+=x)}t.restore()};var Wu={},xRn=100;Wu.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r},Wu.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,i=0;ie.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(h[e.NODE]=!0,h[e.SELECT_BOX]=!0);var b=r.style(),x=r.zoom(),w=s!==void 0?s:x,A=r.pan(),S={x:A.x,y:A.y},T={zoom:x,pan:{x:A.x,y:A.y}},O=e.prevViewport,k=O===void 0||T.zoom!==O.zoom||T.pan.x!==O.pan.x||T.pan.y!==O.pan.y;!k&&!(m&&!g)&&(e.motionBlurPxRatio=1),o&&(S=o),w*=l,S.x*=l,S.y*=l;var E=e.getCachedZSortedEles();function _(q,Z,ee,re,ve){var ae=q.globalCompositeOperation;q.globalCompositeOperation="destination-out",e.colorFillStyle(q,255,255,255,e.motionBlurTransparency),q.fillRect(Z,ee,re,ve),q.globalCompositeOperation=ae}function I(q,Z){var ee,re,ve,ae;!e.clearingMotionBlur&&(q===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||q===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(ee={x:A.x*p,y:A.y*p},re=x*p,ve=e.canvasWidth*p,ae=e.canvasHeight*p):(ee=S,re=w,ve=e.canvasWidth,ae=e.canvasHeight),q.setTransform(1,0,0,1,0,0),Z==="motionBlur"?_(q,0,0,ve,ae):!n&&(Z===void 0||Z)&&q.clearRect(0,0,ve,ae),i||(q.translate(ee.x,ee.y),q.scale(re,re)),o&&q.translate(o.x,o.y),s&&q.scale(s,s)}if(d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var L=e.data.bufferContexts[e.TEXTURE_BUFFER];L.setTransform(1,0,0,1,0,0),L.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:L,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var T=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};T.mpan={x:(0-T.pan.x)/T.zoom,y:(0-T.pan.y)/T.zoom}}h[e.DRAG]=!1,h[e.NODE]=!1;var R=u.contexts[e.NODE],D=e.textureCache.texture,T=e.textureCache.viewport;R.setTransform(1,0,0,1,0,0),f?_(R,0,0,T.width,T.height):R.clearRect(0,0,T.width,T.height);var M=b.core("outside-texture-bg-color").value,P=b.core("outside-texture-bg-opacity").value;e.colorFillStyle(R,M[0],M[1],M[2],P),R.fillRect(0,0,T.width,T.height);var x=r.zoom();I(R,!1),R.clearRect(T.mpan.x,T.mpan.y,T.width/T.zoom/l,T.height/T.zoom/l),R.drawImage(D,T.mpan.x,T.mpan.y,T.width/T.zoom/l,T.height/T.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var N=r.extent(),F=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),B=e.hideEdgesOnViewport&&F,V=[];if(V[e.NODE]=!h[e.NODE]&&f&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,V[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),V[e.DRAG]=!h[e.DRAG]&&f&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,V[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||i||a||V[e.NODE]){var z=f&&!V[e.NODE]&&p!==1,R=n||(z?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),U=f&&!z?"motionBlur":void 0;I(R,U),B?e.drawCachedNodes(R,E.nondrag,l,N):e.drawLayeredElements(R,E.nondrag,l,N),e.debug&&e.drawDebugPoints(R,E.nondrag),!i&&!f&&(h[e.NODE]=!1)}if(!a&&(h[e.DRAG]||i||V[e.DRAG])){var z=f&&!V[e.DRAG]&&p!==1,R=n||(z?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);I(R,f&&!z?"motionBlur":void 0),B?e.drawCachedNodes(R,E.drag,l,N):e.drawCachedElements(R,E.drag,l,N),e.debug&&e.drawDebugPoints(R,E.drag),!i&&!f&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,I),f&&p!==1){var Q=u.contexts[e.NODE],G=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],X=u.contexts[e.DRAG],Y=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],le=function(Z,ee,re){Z.setTransform(1,0,0,1,0,0),re||!y?Z.clearRect(0,0,e.canvasWidth,e.canvasHeight):_(Z,0,0,e.canvasWidth,e.canvasHeight);var ve=p;Z.drawImage(ee,0,0,e.canvasWidth*ve,e.canvasHeight*ve,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||V[e.NODE])&&(le(Q,G,V[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||V[e.DRAG])&&(le(X,Y,V[e.DRAG]),h[e.DRAG]=!1)}e.prevViewport=T,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),f&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,h[e.NODE]=!0,h[e.DRAG]=!0,e.redraw()},xRn)),n||r.emit("render")};var B9;Wu.drawSelectionRectangle=function(t,e){var r=this,n=r.cy,i=r.data,a=n.style(),s=t.drawOnlyNodeLayer,o=t.drawAllLayers,l=i.canvasNeedsRedraw,u=t.forcedContext;if(r.showFps||!s&&l[r.SELECT_BOX]&&!o){var h=u||i.contexts[r.SELECT_BOX];if(e(h),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var d=r.cy.zoom(),f=a.core("selection-box-border-width").value/d;h.lineWidth=f,h.fillStyle="rgba("+a.core("selection-box-color").value[0]+","+a.core("selection-box-color").value[1]+","+a.core("selection-box-color").value[2]+","+a.core("selection-box-opacity").value+")",h.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),f>0&&(h.strokeStyle="rgba("+a.core("selection-box-border-color").value[0]+","+a.core("selection-box-border-color").value[1]+","+a.core("selection-box-border-color").value[2]+","+a.core("selection-box-opacity").value+")",h.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(i.bgActivePosistion&&!r.hoverData.selecting){var d=r.cy.zoom(),p=i.bgActivePosistion;h.fillStyle="rgba("+a.core("active-bg-color").value[0]+","+a.core("active-bg-color").value[1]+","+a.core("active-bg-color").value[2]+","+a.core("active-bg-opacity").value+")",h.beginPath(),h.arc(p.x,p.y,a.core("active-bg-size").pfValue/d,0,2*Math.PI),h.fill()}var g=r.lastRedrawTime;if(r.showFps&&g){g=Math.round(g);var m=Math.round(1e3/g),v="1 frame = "+g+" ms = "+m+" fps";if(h.setTransform(1,0,0,1,0,0),h.fillStyle="rgba(255, 0, 0, 0.75)",h.strokeStyle="rgba(255, 0, 0, 0.75)",h.font="30px Arial",!B9){var y=h.measureText(v);B9=y.actualBoundingBoxAscent}h.fillText(v,0,B9);var b=60;h.strokeRect(0,B9+10,250,20),h.fillRect(0,B9+10,250*Math.min(m/b,1),20)}o||(l[r.SELECT_BOX]=!1)}};function YPt(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(n));return n}function wRn(t,e,r){var n=YPt(t,t.VERTEX_SHADER,e),i=YPt(t,t.FRAGMENT_SHADER,r),a=t.createProgram();if(t.attachShader(a,n),t.attachShader(a,i),t.linkProgram(a),!t.getProgramParameter(a,t.LINK_STATUS))throw new Error("Could not initialize shaders");return a}function ARn(t,e,r){r===void 0&&(r=e);var n=t.makeOffscreenCanvas(e,r),i=n.context=n.getContext("2d");return n.clear=function(){return i.clearRect(0,0,n.width,n.height)},n.clear(),n}function fke(t){var e=t.pixelRatio,r=t.cy.zoom(),n=t.cy.pan();return{zoom:r*e,pan:{x:n.x*e,y:n.y*e}}}function SRn(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function TRn(t,e,r,n,i){var a=n*r+e.x,s=i*r+e.y;return s=Math.round(t.canvasHeight-s),[a,s]}function CRn(t,e){return e.picking?!0:t.pstyle("background-fill").value!=="solid"||t.pstyle("background-image").strValue!=="none"?!1:t.pstyle("border-width").value===0||t.pstyle("border-opacity").value===0?!0:t.pstyle("border-style").value==="solid"}function ORn(t,e){if(t.length!==e.length)return!1;for(var r=0;r>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}function kRn(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function ERn(t,e){var r=t.createTexture();return r.buffer=function(n){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}function qPt(t,e){switch(e){case"float":return[1,t.FLOAT,4];case"vec2":return[2,t.FLOAT,4];case"vec3":return[3,t.FLOAT,4];case"vec4":return[4,t.FLOAT,4];case"int":return[1,t.INT,4];case"ivec2":return[2,t.INT,4]}}function jPt(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function _Rn(t,e,r,n,i,a){switch(e){case t.FLOAT:return new Float32Array(r.buffer,a*n,i);case t.INT:return new Int32Array(r.buffer,a*n,i)}}function RRn(t,e,r,n){var i=qPt(t,e),a=$o(i,2),s=a[0],o=a[1],l=jPt(t,o,n),u=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,l,t.STATIC_DRAW),o===t.FLOAT?t.vertexAttribPointer(r,s,o,!1,0,0):o===t.INT&&t.vertexAttribIPointer(r,s,o,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),u}function B0(t,e,r,n){var i=qPt(t,r),a=$o(i,3),s=a[0],o=a[1],l=a[2],u=jPt(t,o,e*s),h=s*l,d=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,d),t.bufferData(t.ARRAY_BUFFER,e*h,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),o===t.FLOAT?t.vertexAttribPointer(n,s,o,!1,h,0):o===t.INT&&t.vertexAttribIPointer(n,s,o,h,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var f=new Array(e),p=0;ps&&(o=s/n,l=n*o,u=i*o),{scale:o,texW:l,texH:u}}},{key:"draw",value:function(r,n,i){var a=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,l=this.texHeight,u=this.getScale(n),h=u.scale,d=u.texW,f=u.texH,p=function(x,w){if(i&&w){var A=w.context,S=x.x,T=x.row,O=S,k=l*T;A.save(),A.translate(O,k),A.scale(h,h),i(A,n),A.restore()}},g=[null,null],m=function(){p(a.freePointer,a.canvas),g[0]={x:a.freePointer.x,y:a.freePointer.row*l,w:d,h:f},g[1]={x:a.freePointer.x+d,y:a.freePointer.row*l,w:0,h:f},a.freePointer.x+=d,a.freePointer.x==s&&(a.freePointer.x=0,a.freePointer.row++)},v=function(){var x=a.scratch,w=a.canvas;x.clear(),p({x:0,row:0},x);var A=s-a.freePointer.x,S=d-A,T=l;{var O=a.freePointer.x,k=a.freePointer.row*l,E=A;w.context.drawImage(x,0,0,E,T,O,k,E,T),g[0]={x:O,y:k,w:E,h:f}}{var _=A,I=(a.freePointer.row+1)*l,L=S;w&&w.context.drawImage(x,_,0,L,T,0,I,L,T),g[1]={x:0,y:I,w:L,h:f}}a.freePointer.x=S,a.freePointer.row++},y=function(){a.freePointer.x=0,a.freePointer.row++};if(this.freePointer.x+d<=s)m();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===s?(y(),m()):this.enableWrapping?v():(y(),m())}return this.keyToLocation.set(r,g),this.needsBuffer=!0,g}},{key:"getOffsets",value:function(r){return this.keyToLocation.get(r)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(r){if(this.locked)return!1;var n=this.texSize,i=this.texRows,a=this.getScale(r),s=a.texW;return this.freePointer.x+s>n?this.freePointer.row1&&arguments[1]!==void 0?arguments[1]:{},a=i.forceRedraw,s=a===void 0?!1:a,o=i.filterEle,l=o===void 0?function(){return!0}:o,u=i.filterType,h=u===void 0?function(){return!0}:u,d=!1,f=!1,p=Gh(r),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(l(m)){var v=Gh(this.renderTypes.values()),y;try{var b=function(){var w=y.value,A=w.type;if(h(A)){var S=n.collections.get(w.collection),T=w.getKey(m),O=Array.isArray(T)?T:[T];if(s)O.forEach(function(I){return S.markKeyForGC(I)}),f=!0;else{var k=w.getID?w.getID(m):m.id(),E=n._key(A,k),_=n.typeAndIdToKey.get(E);_!==void 0&&!ORn(O,_)&&(d=!0,n.typeAndIdToKey.delete(E),_.forEach(function(I){return S.markKeyForGC(I)}))}}};for(v.s();!(y=v.n()).done;)b()}catch(x){v.e(x)}finally{v.f()}}}}catch(x){p.e(x)}finally{p.f()}return f&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var r=Gh(this.collections.values()),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;i.gc()}}catch(a){r.e(a)}finally{r.f()}}},{key:"getOrCreateAtlas",value:function(r,n,i,a){var s=this.renderTypes.get(n),o=this.collections.get(s.collection),l=!1,u=o.draw(a,i,function(f){s.drawClipped?(f.save(),f.beginPath(),f.rect(0,0,i.w,i.h),f.clip(),s.drawElement(f,r,i,!0,!0),f.restore()):s.drawElement(f,r,i,!0,!0),l=!0});if(l){var h=s.getID?s.getID(r):r.id(),d=this._key(n,h);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(a):this.typeAndIdToKey.set(d,[a])}return u}},{key:"getAtlasInfo",value:function(r,n){var i=this,a=this.renderTypes.get(n),s=a.getKey(r),o=Array.isArray(s)?s:[s];return o.map(function(l){var u=a.getBoundingBox(r,l),h=i.getOrCreateAtlas(r,n,u,l),d=h.getOffsets(l),f=$o(d,2),p=f[0],g=f[1];return{atlas:h,tex:p,tex1:p,tex2:g,bb:u}})}},{key:"getDebugInfo",value:function(){var r=[],n=Gh(this.collections),i;try{for(n.s();!(i=n.n()).done;){var a=$o(i.value,2),s=a[0],o=a[1],l=o.getCounts(),u=l.keyCount,h=l.atlasCount;r.push({type:s,keyCount:u,atlasCount:h})}}catch(d){n.e(d)}finally{n.f()}return r}}])}(),FRn=function(){function t(e){_2(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return R2(t,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(r,n){return n})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(r){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(r):!0}},{key:"getAtlasIndexForBatch",value:function(r){var n=this.batchAtlases.indexOf(r);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(r),n=this.batchAtlases.length-1}return n}}])}(),zRn=` float circleSD(vec2 p, float r) { return distance(vec2(0), p) - r; // signed distance } @@ -1017,10 +1017,10 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) vec2 v = ab*vec2(-cs.y,cs.x); w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v)); } - + // compute final point and distance float d = length(p-ab*vec2(cos(w),sin(w))); - + // return signed distance return (dot(p/ab,p/ab)>1.0) ? d : -d; } @@ -1029,16 +1029,16 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) uniform mat3 uPanZoomMatrix; uniform int uAtlasSize; - + // instanced in vec2 aPosition; // a vertex from the unit square - + in mat3 aTransform; // used to transform verticies, eg into a bounding box in int aVertType; // the type of thing we are rendering // the z-index that is output when using picking mode in vec4 aIndex; - + // For textures in int aAtlasId; // which shader unit/atlas to use in vec4 aTex; // x/y/w/h of texture in atlas @@ -1058,7 +1058,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) out vec4 vColor; out vec2 vPosition; // flat values are not interpolated - flat out int vAtlasId; + flat out int vAtlasId; flat out int vVertType; flat out vec2 vTopRight; flat out vec2 vBotLeft; @@ -1066,7 +1066,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) flat out vec4 vBorderColor; flat out vec2 vBorderWidth; flat out vec4 vIndex; - + void main(void) { int vid = gl_VertexID; vec2 position = aPosition; // TODO make this a vec3, simplifies some code below @@ -1089,7 +1089,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); } - else if(aVertType == `).concat($3," || aVertType == ").concat(z9,` + else if(aVertType == `).concat($3," || aVertType == ").concat(z9,` || aVertType == `).concat(xee," || aVertType == ").concat(F9,`) { // simple shapes // the bounding box is needed by the fragment shader @@ -1119,7 +1119,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0); vColor = aColor; - } + } else if(aVertType == `).concat(e6t,`) { vec2 pointA = aPointAPointB.xy; vec2 pointB = aPointAPointB.zw; @@ -1168,7 +1168,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) } vColor = aColor; - } + } else if(aVertType == `).concat(vke,` && vid < 3) { // massage the first triangle into an edge arrow if(vid == 0) @@ -1220,16 +1220,16 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) `).concat(QRn,` vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha - return vec4( + return vec4( top.rgb + (bot.rgb * (1.0 - top.a)), - top.a + (bot.a * (1.0 - top.a)) + top.a + (bot.a * (1.0 - top.a)) ); } vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance // scale to the zoom level so that borders don't look blurry when zoomed in // note 1.5 is an aribitrary value chosen because it looks good - return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d))); + return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d))); } void main(void) { @@ -1237,7 +1237,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) // look up the texel from the texture unit `).concat(a.map(function(u){return"if(vAtlasId == ".concat(u,") outColor = texture(uTexture").concat(u,", vTexCoord);")}).join(` else `),` - } + } else if(vVertType == `).concat(vke,`) { // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out'; outColor = blend(vColor, uBGColor); @@ -1246,7 +1246,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) else if(vVertType == `).concat($3,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done } - else if(vVertType == `).concat($3," || vVertType == ").concat(z9,` + else if(vVertType == `).concat($3," || vVertType == ").concat(z9,` || vVertType == `).concat(xee," || vVertType == ").concat(F9,`) { // use SDF float outerBorder = vBorderWidth[0]; @@ -1281,7 +1281,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor; vec4 innerBorderColor = blend(vBorderColor, vColor); outColor = distInterp(innerBorderColor, outerColor, d); - } + } else { vec4 outerColor; if(innerBorder == 0.0 && outerBorder == 0.0) { @@ -1302,12 +1302,12 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) `).concat(r.picking?`if(outColor.a == 0.0) discard; else outColor = vIndex;`:"",` } - `),o=wRn(n,i,s);o.aPosition=n.getAttribLocation(o,"aPosition"),o.aIndex=n.getAttribLocation(o,"aIndex"),o.aVertType=n.getAttribLocation(o,"aVertType"),o.aTransform=n.getAttribLocation(o,"aTransform"),o.aAtlasId=n.getAttribLocation(o,"aAtlasId"),o.aTex=n.getAttribLocation(o,"aTex"),o.aPointAPointB=n.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=n.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=n.getAttribLocation(o,"aLineWidth"),o.aColor=n.getAttribLocation(o,"aColor"),o.aCornerRadius=n.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=n.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=n.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=n.getUniformLocation(o,"uAtlasSize"),o.uBGColor=n.getUniformLocation(o,"uBGColor"),o.uZoom=n.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var l=0;l1&&arguments[1]!==void 0?arguments[1]:$9.SCREEN;this.panZoomMatrix=r,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(r,n){return r.visible()?n&&n.isVisible?n.isVisible(r):!0:!1}},{key:"drawTexture",value:function(r,n,i){var a=this.atlasManager,s=this.batchManager,o=a.getRenderTypeOpts(i);if(this._isVisible(r,o)&&!(r.isEdge()&&!this._isValidEdge(r))){if(this.renderTarget.picking&&o.getTexPickingMode){var l=o.getTexPickingMode(r);if(l===bee.IGNORE)return;if(l==bee.USE_BB){this.drawPickingRectangle(r,n,i);return}}var u=a.getAtlasInfo(r,i),h=Gh(u),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,p=f.atlas,g=f.tex1,m=f.tex2;s.canAddToCurrentBatch(p)||this.endBatch();for(var v=s.getAtlasIndexForBatch(p),y=0,b=[[g,!0],[m,!1]];y=this.maxInstances&&this.endBatch()}}}}catch(_){h.e(_)}finally{h.f()}}}},{key:"setTransformMatrix",value:function(r,n,i,a){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(i.shapeProps&&i.shapeProps.padding&&(o=r.pstyle(i.shapeProps.padding).pfValue),a){var l=a.bb,u=a.tex1,h=a.tex2,d=u.w/(u.w+h.w);s||(d=1-d);var f=this._getAdjustedBB(l,o,s,d);this._applyTransformMatrix(n,f,i,r)}else{var p=i.getBoundingBox(r),g=this._getAdjustedBB(p,o,!0,1);this._applyTransformMatrix(n,g,i,r)}}},{key:"_applyTransformMatrix",value:function(r,n,i,a){var s,o;KPt(r);var l=i.getRotation?i.getRotation(a):0;if(l!==0){var u=i.getRotationPoint(a),h=u.x,d=u.y;yee(r,r,[h,d]),ZPt(r,r,l);var f=i.getRotationOffset(a);s=f.x+(n.xOffset||0),o=f.y+(n.yOffset||0)}else s=n.x1,o=n.y1;yee(r,r,[s,o]),gke(r,r,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(r,n,i,a){var s=r.x1,o=r.y1,l=r.w,u=r.h,h=r.yOffset;n&&(s-=n,o-=n,l+=2*n,u+=2*n);var d=0,f=l*a;return i&&a<1?l=f:!i&&a<1&&(d=l-f,s+=d,l=f),{x1:s,y1:o,w:l,h:u,xOffset:d,yOffset:h}}},{key:"drawPickingRectangle",value:function(r,n,i){var a=this.atlasManager.getRenderTypeOpts(i),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=$3;var o=this.indexBuffer.getView(s);B3(n,o);var l=this.colorBuffer.getView(s);LC([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(r,u,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(r,n,i){var a=this.simpleShapeOptions.get(i);if(this._isVisible(r,a)){var s=a.shapeProps,o=this._getVertTypeForShape(r,s.shape);if(o===void 0||a.isSimple&&!a.isSimple(r,this.renderTarget)){this.drawTexture(r,n,i);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=o,o===xee||o===F9){var u=a.getBoundingBox(r),h=this._getCornerRadius(r,s.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=h,d[1]=h,d[2]=h,d[3]=h,o===F9&&(d[0]=0,d[2]=0)}var f=this.indexBuffer.getView(l);B3(n,f);var p=this.renderTarget.picking?1:i==="node-body"?r.effectiveOpacity():1,g=this.renderTarget.picking?1:r.pstyle(s.opacity).value*p,m=r.pstyle(s.color).value,v=this.colorBuffer.getView(l);LC(m,g,v);var y=this.lineWidthBuffer.getView(l);if(y[0]=0,y[1]=0,s.border){var b=r.pstyle("border-width").value;if(b>0){var x=r.pstyle("border-color").value,w=p*r.pstyle("border-opacity").value,A=this.borderColorBuffer.getView(l);LC(x,w,A);var T=r.pstyle("border-position").value;if(T==="inside")y[0]=0,y[1]=-b;else if(T==="outside")y[0]=b,y[1]=0;else{var S=b/2;y[0]=S,y[1]=-S}}}var O=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(r,O,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(r,n){var i=r.pstyle(n).value;switch(i){case"rectangle":return $3;case"ellipse":return z9;case"roundrectangle":case"round-rectangle":return xee;case"bottom-round-rectangle":return F9;default:return}}},{key:"_getCornerRadius",value:function(r,n,i){var a=i.w,s=i.h;if(r.pstyle(n).value==="auto")return B2(a,s);var o=r.pstyle(n).pfValue,l=a/2,u=s/2;return Math.min(o,u,l)}},{key:"drawEdgeArrow",value:function(r,n,i){if(r.visible()){var a=r._private.rscratch,s,o,l;if(i==="source"?(s=a.arrowStartX,o=a.arrowStartY,l=a.srcArrowAngle):(s=a.arrowEndX,o=a.arrowEndY,l=a.tgtArrowAngle),!(isNaN(s)||s==null||isNaN(o)||o==null||isNaN(l)||l==null)){var u=r.pstyle(i+"-arrow-shape").value;if(u!=="none"){var h=r.pstyle(i+"-arrow-color").value,d=r.pstyle("opacity").value,f=r.pstyle("line-opacity").value,p=d*f,g=r.pstyle("width").pfValue,m=r.pstyle("arrow-scale").value,v=this.r.getArrowWidth(g,m),y=this.instanceCount,b=this.transformBuffer.getMatrixView(y);KPt(b),yee(b,b,[s,o]),gke(b,b,[v,v]),ZPt(b,b,l),this.vertTypeBuffer.getView(y)[0]=vke;var x=this.indexBuffer.getView(y);B3(n,x);var w=this.colorBuffer.getView(y);LC(h,p,w),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(r,n){if(r.visible()){var i=this._getEdgePoints(r);if(i){var a=r.pstyle("opacity").value,s=r.pstyle("line-opacity").value,o=r.pstyle("width").pfValue,l=r.pstyle("line-color").value,u=a*s;if(i.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),i.length==4){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=JPt;var d=this.indexBuffer.getView(h);B3(n,d);var f=this.colorBuffer.getView(h);LC(l,u,f);var p=this.lineWidthBuffer.getView(h);p[0]=o;var g=this.pointAPointBBuffer.getView(h);g[0]=i[0],g[1]=i[1],g[2]=i[2],g[3]=i[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var m=0;m=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(r){var n=r._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(r){var n=r._private.rscratch;if(this._isValidEdge(r)){var i=n.allpts;if(i.length==4)return i;var a=this._getNumSegments(r);return this._getCurveSegmentPoints(i,a)}}},{key:"_getNumSegments",value:function(r){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(r,n){if(r.length==4)return r;for(var i=Array((n+1)*2),a=0;a<=n;a++)if(a==0)i[0]=r[0],i[1]=r[1];else if(a==n)i[a*2]=r[r.length-2],i[a*2+1]=r[r.length-1];else{var s=a/n;this._setCurvePoint(r,s,i,a*2)}return i}},{key:"_setCurvePoint",value:function(r,n,i,a){if(r.length<=2)i[a]=r[0],i[a+1]=r[1];else{for(var s=Array(r.length-2),o=0;o0}},o=function(d){var f=d.pstyle("text-events").strValue==="yes";return f?bee.USE_BB:bee.IGNORE},l=function(d){var f=d.position(),p=f.x,g=f.y,m=d.outerWidth(),v=d.outerHeight();return{w:m,h:v,x1:p-m/2,y1:g-v/2}};r.drawing.addAtlasCollection("node",{texRows:t.webglTexRowsNodes}),r.drawing.addAtlasCollection("label",{texRows:t.webglTexRows}),r.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),r.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:CRn,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),r.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),r.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:yke(e.getLabelKey,null),getBoundingBox:bke(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:i(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:a("label")}),r.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:yke(e.getSourceLabelKey,"source"),getBoundingBox:bke(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:i("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:a("source-label")}),r.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:yke(e.getTargetLabelKey,"target"),getBoundingBox:bke(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:a("target-label")});var u=d9(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(h,d){var f=!1;d&&d.length>0&&(f|=r.drawing.invalidate(d)),f&&u()}),WRn(r)};function HRn(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return iLt(r)}function r6t(t,e){var r=t._private.rscratch;return Qu(r,"labelWrapCachedLines",e)||[]}var yke=function(e,r){return function(n){var i=e(n),a=r6t(n,r);return a.length>1?a.map(function(s,o){return"".concat(i,"_").concat(o)}):i}},bke=function(e,r){return function(n,i){var a=e(n);if(typeof i=="string"){var s=i.indexOf("_");if(s>0){var o=Number(i.substring(s+1)),l=r6t(n,r),u=a.h/l.length,h=u*o,d=a.y1+h;return{x1:a.x1,w:a.w,y1:d,h:u,yOffset:h}}}return a}};function WRn(t){{var e=t.render;t.render=function(a){a=a||{};var s=t.cy;t.webgl&&(s.zoom()>NPt?(YRn(t),e.call(t,a)):(qRn(t),i6t(t,a,$9.SCREEN)))}}{var r=t.matchCanvasSize;t.matchCanvasSize=function(a){r.call(t,a),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0}}t.findNearestElements=function(a,s,o,l){return eDn(t,a,s)};{var n=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){n.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var i=t.notify;t.notify=function(a,s){i.call(t,a,s),a==="viewport"||a==="bounds"?t.pickingFrameBuffer.needsDraw=!0:a==="background"&&t.drawing.invalidate(s,{type:"node-body"})}}}function YRn(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function qRn(t){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,t.canvasWidth,t.canvasHeight),n.restore()};e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function jRn(t){var e=t.canvasWidth,r=t.canvasHeight,n=fke(t),i=n.pan,a=n.zoom,s=pke();yee(s,s,[i.x,i.y]),gke(s,s,[a,a]);var o=pke();IRn(o,e,r);var l=pke();return MRn(l,o,s),l}function n6t(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=fke(t),a=i.pan,s=i.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,n),e.translate(a.x,a.y),e.scale(s,s)}function XRn(t,e){t.drawSelectionRectangle(e,function(r){return n6t(t,r)})}function KRn(t){var e=t.data.contexts[t.NODE];e.save(),n6t(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function ZRn(t){var e=function(i,a,s){for(var o=i.atlasManager.getAtlasCollection(a),l=t.data.contexts[t.NODE],u=o.atlases,h=0;h=0&&w.add(S)}return w}function eDn(t,e,r){var n=JRn(t,e,r),i=t.getCachedZSortedEles(),a,s,o=Gh(n),l;try{for(o.s();!(l=o.n()).done;){var u=l.value,h=i[u];if(!a&&h.isNode()&&(a=h),!s&&h.isEdge()&&(s=h),a&&s)break}}catch(d){o.e(d)}finally{o.f()}return[a,s].filter(Boolean)}function xke(t,e,r){var n=t.drawing;e+=1,r.isNode()?(n.drawNode(r,e,"node-underlay"),n.drawNode(r,e,"node-body"),n.drawTexture(r,e,"label"),n.drawNode(r,e,"node-overlay")):(n.drawEdgeLine(r,e),n.drawEdgeArrow(r,e,"source"),n.drawEdgeArrow(r,e,"target"),n.drawTexture(r,e,"label"),n.drawTexture(r,e,"edge-source-label"),n.drawTexture(r,e,"edge-target-label"))}function i6t(t,e,r){var n;t.webglDebug&&(n=performance.now());var i=t.drawing,a=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&XRn(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var s=t.data.contexts[t.WEBGL];r.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var o=jRn(t),l=t.getCachedZSortedEles();if(a=l.length,i.startFrame(o,r),r.screen){for(var u=0;u0&&s>0){p.clearRect(0,0,a,s),p.globalCompositeOperation="source-over";var g=this.getCachedZSortedEles();if(t.full)p.translate(-n.x1*u,-n.y1*u),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(n.x1*u,n.y1*u);else{var m=e.pan(),v={x:m.x*u,y:m.y*u};u*=e.zoom(),p.translate(v.x,v.y),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(-v.x,-v.y)}t.bg&&(p.globalCompositeOperation="destination-over",p.fillStyle=t.bg,p.rect(0,0,a,s),p.fill())}return f};function tDn(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a"u"?"undefined":rl(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var n=this.cy.window(),i=n.document;r=i.createElement("canvas"),r.width=t,r.height=e}return r},[UPt,N0,k1,dke,DC,W2,Wu,t6t,Y2,U9,u6t].forEach(function(t){sn(ei,t)});var iDn=[{name:"null",impl:fPt},{name:"base",impl:MPt},{name:"canvas",impl:rDn}],aDn=[{type:"layout",extensions:E3n},{type:"renderer",extensions:iDn}],d6t={},f6t={};function p6t(t,e,r){var n=r,i=function(O){ea("Can not register `"+e+"` for `"+t+"` since `"+O+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(D9.prototype[e])return i(e);D9.prototype[e]=r}else if(t==="collection"){if(mc.prototype[e])return i(e);mc.prototype[e]=r}else if(t==="layout"){for(var a=function(O){this.options=O,r.call(this,O),Mi(this._private)||(this._private={}),this._private.cy=O.cy,this._private.listeners=[],this.createEmitter()},s=a.prototype=Object.create(r.prototype),o=[],l=0;lg&&(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)),this.labelHeight>m&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-m)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-m),this.setHeight(this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var v=new h(g,m),y=p.inverseTransformPoint(v);this.setLocation(y.x,y.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d},function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a},function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(6),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(v,y,b){a.call(this,b),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=v,y!=null&&y instanceof l?this.graphManager=y:y!=null&&y instanceof Layout&&(this.graphManager=y.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(v,y,b){if(y==null&&b==null){var x=v;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(x)>-1)throw"Node already in graph!";return x.owner=this,this.getNodes().push(x),x}else{var w=v;if(!(this.getNodes().indexOf(y)>-1&&this.getNodes().indexOf(b)>-1))throw"Source or target not in graph!";if(!(y.owner==b.owner&&y.owner==this))throw"Both owners must be this graph!";return y.owner!=b.owner?null:(w.source=y,w.target=b,w.isInterGraph=!1,this.getEdges().push(w),y.edges.push(w),b!=y&&b.edges.push(w),w)}},g.prototype.remove=function(v){var y=v;if(v instanceof u){if(y==null)throw"Node is null!";if(!(y.owner!=null&&y.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var b=y.edges.slice(),x,w=b.length,A=0;A-1&&O>-1))throw"Source and/or target doesn't know this edge!";x.source.edges.splice(S,1),x.target!=x.source&&x.target.edges.splice(O,1);var T=x.source.owner.getEdges().indexOf(x);if(T==-1)throw"Not in owner's edge list!";x.source.owner.getEdges().splice(T,1)}},g.prototype.updateLeftTop=function(){for(var v=s.MAX_VALUE,y=s.MAX_VALUE,b,x,w,A=this.getNodes(),T=A.length,S=0;Sb&&(v=b),y>x&&(y=x)}return v==s.MAX_VALUE?null:(A[0].getParent().paddingLeft!=null?w=A[0].getParent().paddingLeft:w=this.margin,this.left=y-w,this.top=v-w,new f(this.left,this.top))},g.prototype.updateBounds=function(v){for(var y=s.MAX_VALUE,b=-s.MAX_VALUE,x=s.MAX_VALUE,w=-s.MAX_VALUE,A,T,S,O,k,E=this.nodes,_=E.length,I=0;I<_;I++){var L=E[I];v&&L.child!=null&&L.updateBounds(),A=L.getLeft(),T=L.getRight(),S=L.getTop(),O=L.getBottom(),y>A&&(y=A),bS&&(x=S),wA&&(y=A),bS&&(x=S),w=this.nodes.length){var _=0;b.forEach(function(I){I.owner==v&&_++}),_==this.nodes.length&&(this.isConnected=!0)}},r.exports=g},function(r,n,i){var a,s=i(1);function o(l){a=i(5),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]p)return u[0]=h,u[1]=m,u[2]=f,u[3]=E,!1;if(df)return u[0]=g,u[1]=d,u[2]=O,u[3]=p,!1;if(hf?(u[0]=y,u[1]=b,R=!0):(u[0]=v,u[1]=m,R=!0):M===N&&(h>f?(u[0]=g,u[1]=m,R=!0):(u[0]=x,u[1]=b,R=!0)),-P===N?f>h?(u[2]=k,u[3]=E,D=!0):(u[2]=O,u[3]=S,D=!0):P===N&&(f>h?(u[2]=T,u[3]=S,D=!0):(u[2]=_,u[3]=E,D=!0)),R&&D)return!1;if(h>f?d>p?(F=this.getCardinalDirection(M,N,4),B=this.getCardinalDirection(P,N,2)):(F=this.getCardinalDirection(-M,N,3),B=this.getCardinalDirection(-P,N,1)):d>p?(F=this.getCardinalDirection(-M,N,1),B=this.getCardinalDirection(-P,N,3)):(F=this.getCardinalDirection(M,N,2),B=this.getCardinalDirection(P,N,4)),!R)switch(F){case 1:z=m,V=h+-A/N,u[0]=V,u[1]=z;break;case 2:V=x,z=d+w*N,u[0]=V,u[1]=z;break;case 3:z=b,V=h+A/N,u[0]=V,u[1]=z;break;case 4:V=y,z=d+-w*N,u[0]=V,u[1]=z;break}if(!D)switch(B){case 1:Q=S,U=f+-L/N,u[2]=U,u[3]=Q;break;case 2:U=_,Q=p+I*N,u[2]=U,u[3]=Q;break;case 3:Q=E,U=f+L/N,u[2]=U,u[3]=Q;break;case 4:U=k,Q=p+-I*N,u[2]=U,u[3]=Q;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,v=u.y,y=h.x,b=h.y,x=void 0,w=void 0,A=void 0,T=void 0,S=void 0,O=void 0,k=void 0,E=void 0,_=void 0;return A=g-f,S=d-p,k=p*f-d*g,T=b-v,O=m-y,E=y*v-m*b,_=A*O-T*S,_===0?null:(x=(S*E-O*k)/_,w=(T*k-A*E)/_,new a(x,w))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a},function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a},function(r,n,i){var a=function(){function d(f,p){for(var g=0;g"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s},function(r,n,i){function a(m){if(Array.isArray(m)){for(var v=0,y=Array(m.length);v0&&v;){for(A.push(S[0]);A.length>0&&v;){var O=A[0];A.splice(0,1),w.add(O);for(var k=O.getEdges(),x=0;x-1&&S.splice(L,1)}w=new Set,T=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var v=[],y=m.source,b=this.graphManager.calcLowestCommonAncestor(m.source,m.target),x=0;x0){for(var b=this.edgeToDummyNodes.get(y),x=0;x=0&&v.splice(E,1);var _=T.getNeighborsList();_.forEach(function(R){if(y.indexOf(R)<0){var D=b.get(R),M=D-1;M==1&&O.push(R),b.set(R,M)}})}y=y.concat(O),(v.length==1||v.length==2)&&(x=!0,w=v[0])}return w},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g},function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a},function(r,n,i){var a=i(4);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s},function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,v,y,b,x=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),w=new Set,m=0;mA||w>A)&&(p.gravitationForceX=-this.gravityConstant*y,p.gravitationForceY=-this.gravityConstant*b)):(A=g.getEstimatedSize()*this.compoundGravityRangeFactor,(x>A||w>A)&&(p.gravitationForceX=-this.gravityConstant*y*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*b*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement=x.length||A>=x[0].length)){for(var T=0;Td}}]),u}();r.exports=l},function(r,n,i){var a=function(){function l(u,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;uh.coolingFactor*h.maxNodeDisplacement&&(this.displacementX=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementX)),Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementY=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),h.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},l.prototype.propogateDisplacementToChildren=function(h,d){for(var f=this.getChild().getNodes(),p,g=0;g0)this.positionNodesRadially(S);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var O=new Set(this.getAllNodes()),k=this.nodesWithGravity.filter(function(E){return O.has(E)});this.graphManager.setAllNodesToApplyGravitation(k),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},A.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%f.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var S=new Set(this.getAllNodes()),O=this.nodesWithGravity.filter(function(_){return S.has(_)});this.graphManager.setAllNodesToApplyGravitation(O),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var k=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(k,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},A.prototype.getPositionsData=function(){for(var S=this.graphManager.getAllNodes(),O={},k=0;k1){var R;for(R=0;RE&&(E=Math.floor(L.y)),I=Math.floor(L.x+d.DEFAULT_COMPONENT_SEPERATION)}this.transform(new m(p.WORLD_CENTER_X-L.x/2,p.WORLD_CENTER_Y-L.y/2))},A.radialLayout=function(S,O,k){var E=Math.max(this.maxDiagonalInTree(S),d.DEFAULT_RADIAL_SEPARATION);A.branchRadialLayout(O,null,0,359,0,E);var _=x.calculateBounds(S),I=new w;I.setDeviceOrgX(_.getMinX()),I.setDeviceOrgY(_.getMinY()),I.setWorldOrgX(k.x),I.setWorldOrgY(k.y);for(var L=0;L1;){var Q=U[0];U.splice(0,1);var G=N.indexOf(Q);G>=0&&N.splice(G,1),V--,F--}O!=null?z=(N.indexOf(U[0])+1)%V:z=0;for(var X=Math.abs(E-k)/F,Y=z;B!=F;Y=++Y%V){var le=N[Y].getOtherEnd(S);if(le!=O){var q=(k+B*X)%360,Z=(q+X)%360;A.branchRadialLayout(le,S,q,Z,_+I,I),B++}}},A.maxDiagonalInTree=function(S){for(var O=y.MIN_VALUE,k=0;kO&&(O=_)}return O},A.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},A.prototype.groupZeroDegreeMembers=function(){var S=this,O={};this.memberGroups={},this.idToDummyNode={};for(var k=[],E=this.graphManager.getAllNodes(),_=0;_"u"&&(O[R]=[]),O[R]=O[R].concat(I)}Object.keys(O).forEach(function(D){if(O[D].length>1){var M="DummyCompound_"+D;S.memberGroups[M]=O[D];var P=O[D][0].getParent(),N=new u(S.graphManager);N.id=M,N.paddingLeft=P.paddingLeft||0,N.paddingRight=P.paddingRight||0,N.paddingBottom=P.paddingBottom||0,N.paddingTop=P.paddingTop||0,S.idToDummyNode[M]=N;var F=S.getGraphManager().add(S.newGraph(),N),B=P.getChild();B.add(N);for(var V=0;V=0;S--){var O=this.compoundOrder[S],k=O.id,E=O.paddingLeft,_=O.paddingTop;this.adjustLocations(this.tiledMemberPack[k],O.rect.x,O.rect.y,E,_)}},A.prototype.repopulateZeroDegreeMembers=function(){var S=this,O=this.tiledZeroDegreePack;Object.keys(O).forEach(function(k){var E=S.idToDummyNode[k],_=E.paddingLeft,I=E.paddingTop;S.adjustLocations(O[k],E.rect.x,E.rect.y,_,I)})},A.prototype.getToBeTiled=function(S){var O=S.id;if(this.toBeTiled[O]!=null)return this.toBeTiled[O];var k=S.getChild();if(k==null)return this.toBeTiled[O]=!1,!1;for(var E=k.getNodes(),_=0;_0)return this.toBeTiled[O]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[O]=!1,!1}return this.toBeTiled[O]=!0,!0},A.prototype.getNodeDegree=function(S){S.id;for(var O=S.getEdges(),k=0,E=0;ED&&(D=P.rect.height)}k+=D+S.verticalPadding}},A.prototype.tileCompoundMembers=function(S,O){var k=this;this.tiledMemberPack=[],Object.keys(S).forEach(function(E){var _=O[E];k.tiledMemberPack[E]=k.tileNodes(S[E],_.paddingLeft+_.paddingRight),_.rect.width=k.tiledMemberPack[E].width,_.rect.height=k.tiledMemberPack[E].height})},A.prototype.tileNodes=function(S,O){var k=d.TILING_PADDING_VERTICAL,E=d.TILING_PADDING_HORIZONTAL,_={rows:[],rowWidth:[],rowHeight:[],width:0,height:O,verticalPadding:k,horizontalPadding:E};S.sort(function(R,D){return R.rect.width*R.rect.height>D.rect.width*D.rect.height?-1:R.rect.width*R.rect.height0&&(L+=S.horizontalPadding),S.rowWidth[k]=L,S.width0&&(R+=S.verticalPadding);var D=0;R>S.rowHeight[k]&&(D=S.rowHeight[k],S.rowHeight[k]=R,D=S.rowHeight[k]-D),S.height+=D,S.rows[k].push(O)},A.prototype.getShortestRowIndex=function(S){for(var O=-1,k=Number.MAX_VALUE,E=0;Ek&&(O=E,k=S.rowWidth[E]);return O},A.prototype.canAddHorizontal=function(S,O,k){var E=this.getShortestRowIndex(S);if(E<0)return!0;var _=S.rowWidth[E];if(_+S.horizontalPadding+O<=S.width)return!0;var I=0;S.rowHeight[E]0&&(I=k+S.verticalPadding-S.rowHeight[E]);var L;S.width-_>=O+S.horizontalPadding?L=(S.height+I)/(_+O+S.horizontalPadding):L=(S.height+I)/S.width,I=k+S.verticalPadding;var R;return S.widthI&&O!=k){E.splice(-1,1),S.rows[k].push(_),S.rowWidth[O]=S.rowWidth[O]-I,S.rowWidth[k]=S.rowWidth[k]+I,S.width=S.rowWidth[instance.getLongestRowIndex(S)];for(var L=Number.MIN_VALUE,R=0;RL&&(L=E[R].height);O>0&&(L+=S.verticalPadding);var D=S.rowHeight[O]+S.rowHeight[k];S.rowHeight[O]=L,S.rowHeight[k]<_.height+S.verticalPadding&&(S.rowHeight[k]=_.height+S.verticalPadding);var M=S.rowHeight[O]+S.rowHeight[k];S.height+=M-D,this.shiftToLastRow(S)}},A.prototype.tilingPreLayout=function(){d.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},A.prototype.tilingPostLayout=function(){d.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},A.prototype.reduceTrees=function(){for(var S=[],O=!0,k;O;){var E=this.graphManager.getAllNodes(),_=[];O=!1;for(var I=0;I0)for(var B=_;B<=I;B++)F[0]+=this.grid[B][L-1].length+this.grid[B][L].length-1;if(I0)for(var B=L;B<=R;B++)F[3]+=this.grid[_-1][B].length+this.grid[_][B].length-1;for(var V=y.MAX_VALUE,z,U,Q=0;Q0){var R;R=w.getGraphManager().add(w.newGraph(),k),this.processChildrenList(R,O,w)}}},m.prototype.stop=function(){return this.stopped=!0,this};var y=function(x){x("layout","cose-bilkent",m)};typeof cytoscape<"u"&&y(cytoscape),n.exports=y}])})})(m6t);var hDn=m6t.exports;const dDn=uh(hDn);$0.use(dDn);function b6t(t,e){t.forEach(r=>{const n={id:r.id,labelText:r.label,height:r.height,width:r.width,padding:r.padding??0};Object.keys(r).forEach(i=>{["id","label","height","width","padding","x","y"].includes(i)||(n[i]=r[i])}),e.add({group:"nodes",data:n,position:{x:r.x??0,y:r.y??0}})})}C(b6t,"addNodes");function x6t(t,e){t.forEach(r=>{const n={id:r.id,source:r.start,target:r.end};Object.keys(r).forEach(i=>{["id","start","end"].includes(i)||(n[i]=r[i])}),e.add({group:"edges",data:n})})}C(x6t,"addEdges");function w6t(t){return new Promise(e=>{const r=Ot("body").append("div").attr("id","cy").attr("style","display:none"),n=$0({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),b6t(t.nodes,n),x6t(t.edges,n),n.nodes().forEach(function(a){a.layoutDimensions=()=>{const s=a.data();return{w:s.width,h:s.height}}});const i={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};n.layout(i).run(),n.ready(a=>{me.info("Cytoscape ready",a),e(n)})})}C(w6t,"createCytoscapeInstance");function A6t(t){return t.nodes().map(e=>{const r=e.data(),n=e.position(),i={id:r.id,x:n.x,y:n.y};return Object.keys(r).forEach(a=>{a!=="id"&&(i[a]=r[a])}),i})}C(A6t,"extractPositionedNodes");function T6t(t){return t.edges().map(e=>{const r=e.data(),n=e._private.rscratch,i={id:r.id,source:r.source,target:r.target,startX:n.startX,startY:n.startY,midX:n.midX,midY:n.midY,endX:n.endX,endY:n.endY};return Object.keys(r).forEach(a=>{["id","source","target"].includes(a)||(i[a]=r[a])}),i})}C(T6t,"extractPositionedEdges");async function S6t(t,e){me.debug("Starting cose-bilkent layout algorithm");try{C6t(t);const r=await w6t(t),n=A6t(r),i=T6t(r);return me.debug(`Layout completed: ${n.length} nodes, ${i.length} edges`),{nodes:n,edges:i}}catch(r){throw me.error("Error in cose-bilkent layout algorithm:",r),r}}C(S6t,"executeCoseBilkentLayout");function C6t(t){if(!t)throw new Error("Layout data is required");if(!t.config)throw new Error("Configuration is required in layout data");if(!t.rootNode)throw new Error("Root node is required");if(!t.nodes||!Array.isArray(t.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(t.edges))throw new Error("Edges array is required in layout data");return!0}C(C6t,"validateLayoutData");var fDn=C(async(t,e,{insertCluster:r,insertEdge:n,insertEdgeLabel:i,insertMarkers:a,insertNode:s,log:o,positionEdgeLabel:l},{algorithm:u})=>{const h={},d={},f=e.select("g");a(f,t.markers,t.type,t.diagramId);const p=f.insert("g").attr("class","subgraphs"),g=f.insert("g").attr("class","edgePaths"),m=f.insert("g").attr("class","edgeLabels"),v=f.insert("g").attr("class","nodes");o.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(t.nodes.map(async x=>{if(x.isGroup){const w={...x};d[x.id]=w,h[x.id]=w,await r(p,x)}else{const w={...x};h[x.id]=w;const A=await s(v,x,{config:t.config,dir:t.direction||"TB"}),T=A.node().getBBox();w.width=T.width,w.height=T.height,w.domId=A,o.debug(`Node ${x.id} dimensions: ${T.width}x${T.height}`)}})),o.debug("Running cose-bilkent layout algorithm");const y={...t,nodes:t.nodes.map(x=>{const w=h[x.id];return{...x,width:w.width,height:w.height}})},b=await S6t(y,t.config);o.debug("Positioning nodes based on layout results"),b.nodes.forEach(x=>{const w=h[x.id];w!=null&&w.domId&&(w.domId.attr("transform",`translate(${x.x}, ${x.y})`),w.x=x.x,w.y=x.y,o.debug(`Positioned node ${w.id} at center (${x.x}, ${x.y})`))}),b.edges.forEach(x=>{const w=t.edges.find(A=>A.id===x.id);w&&(w.points=[{x:x.startX,y:x.startY},{x:x.midX,y:x.midY},{x:x.endX,y:x.endY}])}),o.debug("Inserting and positioning edges"),await Promise.all(t.edges.map(async x=>{await i(m,x);const w=h[x.start??""],A=h[x.end??""];if(w&&A){const T=b.edges.find(S=>S.id===x.id);if(T){o.debug("APA01 positionedEdge",T);const S={...x},O=n(g,S,d,t.type,w,A,t.diagramId);l(S,O)}else{const S={...x,points:[{x:w.x||0,y:w.y||0},{x:A.x||0,y:A.y||0}]},O=n(g,S,d,t.type,w,A,t.diagramId);l(S,O)}}})),o.debug("Cose-bilkent rendering completed")},"render"),pDn=fDn;const gDn=Object.freeze(Object.defineProperty({__proto__:null,render:pDn},Symbol.toStringTag,{value:"Module"}));var Aee=C((t,e)=>{const r=t.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),e.name&&r.attr("name",e.name),e.rx&&r.attr("rx",e.rx),e.ry&&r.attr("ry",e.ry),e.attrs!==void 0)for(const n in e.attrs)r.attr(n,e.attrs[n]);return e.class&&r.attr("class",e.class),r},"drawRect"),O6t=C((t,e)=>{const r={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};Aee(t,r).lower()},"drawBackgroundRect"),mDn=C((t,e)=>{const r=e.text.replace(k5," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),Oke=C((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const a=_S(n);i.attr("xlink:href",a)},"drawImage"),kke=C((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const a=_S(n);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),tf=C(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),Eke=C(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),_ke=C(()=>{let t=Ot(".mermaidTooltip");return t.empty()&&(t=Ot("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),t},"createTooltip"),Tee=function(){var t=C(function(Se,De,qe,K){for(qe=qe||{},K=Se.length;K--;qe[Se[K]]=De);return qe},"o"),e=[1,24],r=[1,25],n=[1,26],i=[1,27],a=[1,28],s=[1,63],o=[1,64],l=[1,65],u=[1,66],h=[1,67],d=[1,68],f=[1,69],p=[1,29],g=[1,30],m=[1,31],v=[1,32],y=[1,33],b=[1,34],x=[1,35],w=[1,36],A=[1,37],T=[1,38],S=[1,39],O=[1,40],k=[1,41],E=[1,42],_=[1,43],I=[1,44],L=[1,45],R=[1,46],D=[1,47],M=[1,48],P=[1,50],N=[1,51],F=[1,52],B=[1,53],V=[1,54],z=[1,55],U=[1,56],Q=[1,57],G=[1,58],X=[1,59],Y=[1,60],le=[14,42],q=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Z=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],ee=[1,82],re=[1,83],ve=[1,84],ae=[1,85],Ce=[12,14,42],Oe=[12,14,33,42],$e=[12,14,33,42,76,77,79,80],he=[12,33],fe=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Te={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:C(function(De,qe,K,ce,be,ne,j){var ie=ne.length-1;switch(be){case 3:ce.setDirection("TB");break;case 4:ce.setDirection("BT");break;case 5:ce.setDirection("RL");break;case 6:ce.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:ce.setC4Type(ne[ie-3]);break;case 19:ce.setTitle(ne[ie].substring(6)),this.$=ne[ie].substring(6);break;case 20:ce.setAccDescription(ne[ie].substring(15)),this.$=ne[ie].substring(15);break;case 21:this.$=ne[ie].trim(),ce.setTitle(this.$);break;case 22:case 23:this.$=ne[ie].trim(),ce.setAccDescription(this.$);break;case 28:ne[ie].splice(2,0,"ENTERPRISE"),ce.addPersonOrSystemBoundary(...ne[ie]),this.$=ne[ie];break;case 29:ne[ie].splice(2,0,"SYSTEM"),ce.addPersonOrSystemBoundary(...ne[ie]),this.$=ne[ie];break;case 30:ce.addPersonOrSystemBoundary(...ne[ie]),this.$=ne[ie];break;case 31:ne[ie].splice(2,0,"CONTAINER"),ce.addContainerBoundary(...ne[ie]),this.$=ne[ie];break;case 32:ce.addDeploymentNode("node",...ne[ie]),this.$=ne[ie];break;case 33:ce.addDeploymentNode("nodeL",...ne[ie]),this.$=ne[ie];break;case 34:ce.addDeploymentNode("nodeR",...ne[ie]),this.$=ne[ie];break;case 35:ce.popBoundaryParseStack();break;case 39:ce.addPersonOrSystem("person",...ne[ie]),this.$=ne[ie];break;case 40:ce.addPersonOrSystem("external_person",...ne[ie]),this.$=ne[ie];break;case 41:ce.addPersonOrSystem("system",...ne[ie]),this.$=ne[ie];break;case 42:ce.addPersonOrSystem("system_db",...ne[ie]),this.$=ne[ie];break;case 43:ce.addPersonOrSystem("system_queue",...ne[ie]),this.$=ne[ie];break;case 44:ce.addPersonOrSystem("external_system",...ne[ie]),this.$=ne[ie];break;case 45:ce.addPersonOrSystem("external_system_db",...ne[ie]),this.$=ne[ie];break;case 46:ce.addPersonOrSystem("external_system_queue",...ne[ie]),this.$=ne[ie];break;case 47:ce.addContainer("container",...ne[ie]),this.$=ne[ie];break;case 48:ce.addContainer("container_db",...ne[ie]),this.$=ne[ie];break;case 49:ce.addContainer("container_queue",...ne[ie]),this.$=ne[ie];break;case 50:ce.addContainer("external_container",...ne[ie]),this.$=ne[ie];break;case 51:ce.addContainer("external_container_db",...ne[ie]),this.$=ne[ie];break;case 52:ce.addContainer("external_container_queue",...ne[ie]),this.$=ne[ie];break;case 53:ce.addComponent("component",...ne[ie]),this.$=ne[ie];break;case 54:ce.addComponent("component_db",...ne[ie]),this.$=ne[ie];break;case 55:ce.addComponent("component_queue",...ne[ie]),this.$=ne[ie];break;case 56:ce.addComponent("external_component",...ne[ie]),this.$=ne[ie];break;case 57:ce.addComponent("external_component_db",...ne[ie]),this.$=ne[ie];break;case 58:ce.addComponent("external_component_queue",...ne[ie]),this.$=ne[ie];break;case 60:ce.addRel("rel",...ne[ie]),this.$=ne[ie];break;case 61:ce.addRel("birel",...ne[ie]),this.$=ne[ie];break;case 62:ce.addRel("rel_u",...ne[ie]),this.$=ne[ie];break;case 63:ce.addRel("rel_d",...ne[ie]),this.$=ne[ie];break;case 64:ce.addRel("rel_l",...ne[ie]),this.$=ne[ie];break;case 65:ce.addRel("rel_r",...ne[ie]),this.$=ne[ie];break;case 66:ce.addRel("rel_b",...ne[ie]),this.$=ne[ie];break;case 67:ne[ie].splice(0,1),ce.addRel("rel",...ne[ie]),this.$=ne[ie];break;case 68:ce.updateElStyle("update_el_style",...ne[ie]),this.$=ne[ie];break;case 69:ce.updateRelStyle("update_rel_style",...ne[ie]),this.$=ne[ie];break;case 70:ce.updateLayoutConfig("update_layout_config",...ne[ie]),this.$=ne[ie];break;case 71:this.$=[ne[ie]];break;case 72:ne[ie].unshift(ne[ie-1]),this.$=ne[ie];break;case 73:case 75:this.$=ne[ie].trim();break;case 74:let pe={};pe[ne[ie-1].trim()]=ne[ie].trim(),this.$=pe;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:v,48:y,49:b,50:x,51:w,52:A,53:T,54:S,55:O,56:k,57:E,58:_,59:I,60:L,61:R,62:D,63:M,64:P,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:X,74:Y},{13:70,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:v,48:y,49:b,50:x,51:w,52:A,53:T,54:S,55:O,56:k,57:E,58:_,59:I,60:L,61:R,62:D,63:M,64:P,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:X,74:Y},{13:71,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:v,48:y,49:b,50:x,51:w,52:A,53:T,54:S,55:O,56:k,57:E,58:_,59:I,60:L,61:R,62:D,63:M,64:P,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:X,74:Y},{13:72,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:v,48:y,49:b,50:x,51:w,52:A,53:T,54:S,55:O,56:k,57:E,58:_,59:I,60:L,61:R,62:D,63:M,64:P,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:X,74:Y},{13:73,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:v,48:y,49:b,50:x,51:w,52:A,53:T,54:S,55:O,56:k,57:E,58:_,59:I,60:L,61:R,62:D,63:M,64:P,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:X,74:Y},{14:[1,74]},t(le,[2,13],{43:23,29:49,30:61,32:62,20:75,34:s,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:v,48:y,49:b,50:x,51:w,52:A,53:T,54:S,55:O,56:k,57:E,58:_,59:I,60:L,61:R,62:D,63:M,64:P,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:X,74:Y}),t(le,[2,14]),t(q,[2,16],{12:[1,76]}),t(le,[2,36],{12:[1,77]}),t(Z,[2,19]),t(Z,[2,20]),{25:[1,78]},{27:[1,79]},t(Z,[2,23]),{35:80,75:81,76:ee,77:re,79:ve,80:ae},{35:86,75:81,76:ee,77:re,79:ve,80:ae},{35:87,75:81,76:ee,77:re,79:ve,80:ae},{35:88,75:81,76:ee,77:re,79:ve,80:ae},{35:89,75:81,76:ee,77:re,79:ve,80:ae},{35:90,75:81,76:ee,77:re,79:ve,80:ae},{35:91,75:81,76:ee,77:re,79:ve,80:ae},{35:92,75:81,76:ee,77:re,79:ve,80:ae},{35:93,75:81,76:ee,77:re,79:ve,80:ae},{35:94,75:81,76:ee,77:re,79:ve,80:ae},{35:95,75:81,76:ee,77:re,79:ve,80:ae},{35:96,75:81,76:ee,77:re,79:ve,80:ae},{35:97,75:81,76:ee,77:re,79:ve,80:ae},{35:98,75:81,76:ee,77:re,79:ve,80:ae},{35:99,75:81,76:ee,77:re,79:ve,80:ae},{35:100,75:81,76:ee,77:re,79:ve,80:ae},{35:101,75:81,76:ee,77:re,79:ve,80:ae},{35:102,75:81,76:ee,77:re,79:ve,80:ae},{35:103,75:81,76:ee,77:re,79:ve,80:ae},{35:104,75:81,76:ee,77:re,79:ve,80:ae},t(Ce,[2,59]),{35:105,75:81,76:ee,77:re,79:ve,80:ae},{35:106,75:81,76:ee,77:re,79:ve,80:ae},{35:107,75:81,76:ee,77:re,79:ve,80:ae},{35:108,75:81,76:ee,77:re,79:ve,80:ae},{35:109,75:81,76:ee,77:re,79:ve,80:ae},{35:110,75:81,76:ee,77:re,79:ve,80:ae},{35:111,75:81,76:ee,77:re,79:ve,80:ae},{35:112,75:81,76:ee,77:re,79:ve,80:ae},{35:113,75:81,76:ee,77:re,79:ve,80:ae},{35:114,75:81,76:ee,77:re,79:ve,80:ae},{35:115,75:81,76:ee,77:re,79:ve,80:ae},{20:116,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:v,48:y,49:b,50:x,51:w,52:A,53:T,54:S,55:O,56:k,57:E,58:_,59:I,60:L,61:R,62:D,63:M,64:P,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:X,74:Y},{12:[1,118],33:[1,117]},{35:119,75:81,76:ee,77:re,79:ve,80:ae},{35:120,75:81,76:ee,77:re,79:ve,80:ae},{35:121,75:81,76:ee,77:re,79:ve,80:ae},{35:122,75:81,76:ee,77:re,79:ve,80:ae},{35:123,75:81,76:ee,77:re,79:ve,80:ae},{35:124,75:81,76:ee,77:re,79:ve,80:ae},{35:125,75:81,76:ee,77:re,79:ve,80:ae},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(le,[2,15]),t(q,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:a}),t(le,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:r,24:n,26:i,28:a,34:s,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:v,48:y,49:b,50:x,51:w,52:A,53:T,54:S,55:O,56:k,57:E,58:_,59:I,60:L,61:R,62:D,63:M,64:P,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:X,74:Y}),t(Z,[2,21]),t(Z,[2,22]),t(Ce,[2,39]),t(Oe,[2,71],{75:81,35:132,76:ee,77:re,79:ve,80:ae}),t($e,[2,73]),{78:[1,133]},t($e,[2,75]),t($e,[2,76]),t(Ce,[2,40]),t(Ce,[2,41]),t(Ce,[2,42]),t(Ce,[2,43]),t(Ce,[2,44]),t(Ce,[2,45]),t(Ce,[2,46]),t(Ce,[2,47]),t(Ce,[2,48]),t(Ce,[2,49]),t(Ce,[2,50]),t(Ce,[2,51]),t(Ce,[2,52]),t(Ce,[2,53]),t(Ce,[2,54]),t(Ce,[2,55]),t(Ce,[2,56]),t(Ce,[2,57]),t(Ce,[2,58]),t(Ce,[2,60]),t(Ce,[2,61]),t(Ce,[2,62]),t(Ce,[2,63]),t(Ce,[2,64]),t(Ce,[2,65]),t(Ce,[2,66]),t(Ce,[2,67]),t(Ce,[2,68]),t(Ce,[2,69]),t(Ce,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(he,[2,28]),t(he,[2,29]),t(he,[2,30]),t(he,[2,31]),t(he,[2,32]),t(he,[2,33]),t(he,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(q,[2,18]),t(le,[2,38]),t(Oe,[2,72]),t($e,[2,74]),t(Ce,[2,24]),t(Ce,[2,35]),t(fe,[2,25]),t(fe,[2,26],{12:[1,138]}),t(fe,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:C(function(De,qe){if(qe.recoverable)this.trace(De);else{var K=new Error(De);throw K.hash=qe,K}},"parseError"),parse:C(function(De){var qe=this,K=[0],ce=[],be=[null],ne=[],j=this.table,ie="",pe=0,te=0,ye=2,oe=1,_e=ne.slice.call(arguments,1),Le=Object.create(this.lexer),Ye={yy:{}};for(var Pe in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Pe)&&(Ye.yy[Pe]=this.yy[Pe]);Le.setInput(De,Ye.yy),Ye.yy.lexer=Le,Ye.yy.parser=this,typeof Le.yylloc>"u"&&(Le.yylloc={});var Xe=Le.yylloc;ne.push(Xe);var Ne=Le.options&&Le.options.ranges;typeof Ye.yy.parseError=="function"?this.parseError=Ye.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ze(Ae){K.length=K.length-2*Ae,be.length=be.length-Ae,ne.length=ne.length-Ae}C(Ze,"popStack");function Ge(){var Ae;return Ae=ce.pop()||Le.lex()||oe,typeof Ae!="number"&&(Ae instanceof Array&&(ce=Ae,Ae=ce.pop()),Ae=qe.symbols_[Ae]||Ae),Ae}C(Ge,"lex");for(var lt,Fe,wt,Me,Rt={},Lt,ut,Xt,Ft;;){if(Fe=K[K.length-1],this.defaultActions[Fe]?wt=this.defaultActions[Fe]:((lt===null||typeof lt>"u")&&(lt=Ge()),wt=j[Fe]&&j[Fe][lt]),typeof wt>"u"||!wt.length||!wt[0]){var gt="";Ft=[];for(Lt in j[Fe])this.terminals_[Lt]&&Lt>ye&&Ft.push("'"+this.terminals_[Lt]+"'");Le.showPosition?gt="Parse error on line "+(pe+1)+`: + `),o=wRn(n,i,s);o.aPosition=n.getAttribLocation(o,"aPosition"),o.aIndex=n.getAttribLocation(o,"aIndex"),o.aVertType=n.getAttribLocation(o,"aVertType"),o.aTransform=n.getAttribLocation(o,"aTransform"),o.aAtlasId=n.getAttribLocation(o,"aAtlasId"),o.aTex=n.getAttribLocation(o,"aTex"),o.aPointAPointB=n.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=n.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=n.getAttribLocation(o,"aLineWidth"),o.aColor=n.getAttribLocation(o,"aColor"),o.aCornerRadius=n.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=n.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=n.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=n.getUniformLocation(o,"uAtlasSize"),o.uBGColor=n.getUniformLocation(o,"uBGColor"),o.uZoom=n.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var l=0;l1&&arguments[1]!==void 0?arguments[1]:$9.SCREEN;this.panZoomMatrix=r,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(r,n){return r.visible()?n&&n.isVisible?n.isVisible(r):!0:!1}},{key:"drawTexture",value:function(r,n,i){var a=this.atlasManager,s=this.batchManager,o=a.getRenderTypeOpts(i);if(this._isVisible(r,o)&&!(r.isEdge()&&!this._isValidEdge(r))){if(this.renderTarget.picking&&o.getTexPickingMode){var l=o.getTexPickingMode(r);if(l===bee.IGNORE)return;if(l==bee.USE_BB){this.drawPickingRectangle(r,n,i);return}}var u=a.getAtlasInfo(r,i),h=Gh(u),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,p=f.atlas,g=f.tex1,m=f.tex2;s.canAddToCurrentBatch(p)||this.endBatch();for(var v=s.getAtlasIndexForBatch(p),y=0,b=[[g,!0],[m,!1]];y=this.maxInstances&&this.endBatch()}}}}catch(_){h.e(_)}finally{h.f()}}}},{key:"setTransformMatrix",value:function(r,n,i,a){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(i.shapeProps&&i.shapeProps.padding&&(o=r.pstyle(i.shapeProps.padding).pfValue),a){var l=a.bb,u=a.tex1,h=a.tex2,d=u.w/(u.w+h.w);s||(d=1-d);var f=this._getAdjustedBB(l,o,s,d);this._applyTransformMatrix(n,f,i,r)}else{var p=i.getBoundingBox(r),g=this._getAdjustedBB(p,o,!0,1);this._applyTransformMatrix(n,g,i,r)}}},{key:"_applyTransformMatrix",value:function(r,n,i,a){var s,o;KPt(r);var l=i.getRotation?i.getRotation(a):0;if(l!==0){var u=i.getRotationPoint(a),h=u.x,d=u.y;yee(r,r,[h,d]),ZPt(r,r,l);var f=i.getRotationOffset(a);s=f.x+(n.xOffset||0),o=f.y+(n.yOffset||0)}else s=n.x1,o=n.y1;yee(r,r,[s,o]),gke(r,r,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(r,n,i,a){var s=r.x1,o=r.y1,l=r.w,u=r.h,h=r.yOffset;n&&(s-=n,o-=n,l+=2*n,u+=2*n);var d=0,f=l*a;return i&&a<1?l=f:!i&&a<1&&(d=l-f,s+=d,l=f),{x1:s,y1:o,w:l,h:u,xOffset:d,yOffset:h}}},{key:"drawPickingRectangle",value:function(r,n,i){var a=this.atlasManager.getRenderTypeOpts(i),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=$3;var o=this.indexBuffer.getView(s);B3(n,o);var l=this.colorBuffer.getView(s);LC([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(r,u,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(r,n,i){var a=this.simpleShapeOptions.get(i);if(this._isVisible(r,a)){var s=a.shapeProps,o=this._getVertTypeForShape(r,s.shape);if(o===void 0||a.isSimple&&!a.isSimple(r,this.renderTarget)){this.drawTexture(r,n,i);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=o,o===xee||o===F9){var u=a.getBoundingBox(r),h=this._getCornerRadius(r,s.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=h,d[1]=h,d[2]=h,d[3]=h,o===F9&&(d[0]=0,d[2]=0)}var f=this.indexBuffer.getView(l);B3(n,f);var p=this.renderTarget.picking?1:i==="node-body"?r.effectiveOpacity():1,g=this.renderTarget.picking?1:r.pstyle(s.opacity).value*p,m=r.pstyle(s.color).value,v=this.colorBuffer.getView(l);LC(m,g,v);var y=this.lineWidthBuffer.getView(l);if(y[0]=0,y[1]=0,s.border){var b=r.pstyle("border-width").value;if(b>0){var x=r.pstyle("border-color").value,w=p*r.pstyle("border-opacity").value,A=this.borderColorBuffer.getView(l);LC(x,w,A);var S=r.pstyle("border-position").value;if(S==="inside")y[0]=0,y[1]=-b;else if(S==="outside")y[0]=b,y[1]=0;else{var T=b/2;y[0]=T,y[1]=-T}}}var O=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(r,O,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(r,n){var i=r.pstyle(n).value;switch(i){case"rectangle":return $3;case"ellipse":return z9;case"roundrectangle":case"round-rectangle":return xee;case"bottom-round-rectangle":return F9;default:return}}},{key:"_getCornerRadius",value:function(r,n,i){var a=i.w,s=i.h;if(r.pstyle(n).value==="auto")return B2(a,s);var o=r.pstyle(n).pfValue,l=a/2,u=s/2;return Math.min(o,u,l)}},{key:"drawEdgeArrow",value:function(r,n,i){if(r.visible()){var a=r._private.rscratch,s,o,l;if(i==="source"?(s=a.arrowStartX,o=a.arrowStartY,l=a.srcArrowAngle):(s=a.arrowEndX,o=a.arrowEndY,l=a.tgtArrowAngle),!(isNaN(s)||s==null||isNaN(o)||o==null||isNaN(l)||l==null)){var u=r.pstyle(i+"-arrow-shape").value;if(u!=="none"){var h=r.pstyle(i+"-arrow-color").value,d=r.pstyle("opacity").value,f=r.pstyle("line-opacity").value,p=d*f,g=r.pstyle("width").pfValue,m=r.pstyle("arrow-scale").value,v=this.r.getArrowWidth(g,m),y=this.instanceCount,b=this.transformBuffer.getMatrixView(y);KPt(b),yee(b,b,[s,o]),gke(b,b,[v,v]),ZPt(b,b,l),this.vertTypeBuffer.getView(y)[0]=vke;var x=this.indexBuffer.getView(y);B3(n,x);var w=this.colorBuffer.getView(y);LC(h,p,w),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(r,n){if(r.visible()){var i=this._getEdgePoints(r);if(i){var a=r.pstyle("opacity").value,s=r.pstyle("line-opacity").value,o=r.pstyle("width").pfValue,l=r.pstyle("line-color").value,u=a*s;if(i.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),i.length==4){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=JPt;var d=this.indexBuffer.getView(h);B3(n,d);var f=this.colorBuffer.getView(h);LC(l,u,f);var p=this.lineWidthBuffer.getView(h);p[0]=o;var g=this.pointAPointBBuffer.getView(h);g[0]=i[0],g[1]=i[1],g[2]=i[2],g[3]=i[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var m=0;m=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(r){var n=r._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(r){var n=r._private.rscratch;if(this._isValidEdge(r)){var i=n.allpts;if(i.length==4)return i;var a=this._getNumSegments(r);return this._getCurveSegmentPoints(i,a)}}},{key:"_getNumSegments",value:function(r){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(r,n){if(r.length==4)return r;for(var i=Array((n+1)*2),a=0;a<=n;a++)if(a==0)i[0]=r[0],i[1]=r[1];else if(a==n)i[a*2]=r[r.length-2],i[a*2+1]=r[r.length-1];else{var s=a/n;this._setCurvePoint(r,s,i,a*2)}return i}},{key:"_setCurvePoint",value:function(r,n,i,a){if(r.length<=2)i[a]=r[0],i[a+1]=r[1];else{for(var s=Array(r.length-2),o=0;o0}},o=function(d){var f=d.pstyle("text-events").strValue==="yes";return f?bee.USE_BB:bee.IGNORE},l=function(d){var f=d.position(),p=f.x,g=f.y,m=d.outerWidth(),v=d.outerHeight();return{w:m,h:v,x1:p-m/2,y1:g-v/2}};r.drawing.addAtlasCollection("node",{texRows:t.webglTexRowsNodes}),r.drawing.addAtlasCollection("label",{texRows:t.webglTexRows}),r.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),r.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:CRn,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),r.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),r.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:yke(e.getLabelKey,null),getBoundingBox:bke(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:i(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:a("label")}),r.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:yke(e.getSourceLabelKey,"source"),getBoundingBox:bke(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:i("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:a("source-label")}),r.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:yke(e.getTargetLabelKey,"target"),getBoundingBox:bke(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:a("target-label")});var u=d9(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(h,d){var f=!1;d&&d.length>0&&(f|=r.drawing.invalidate(d)),f&&u()}),WRn(r)};function HRn(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return iLt(r)}function r6t(t,e){var r=t._private.rscratch;return Qu(r,"labelWrapCachedLines",e)||[]}var yke=function(e,r){return function(n){var i=e(n),a=r6t(n,r);return a.length>1?a.map(function(s,o){return"".concat(i,"_").concat(o)}):i}},bke=function(e,r){return function(n,i){var a=e(n);if(typeof i=="string"){var s=i.indexOf("_");if(s>0){var o=Number(i.substring(s+1)),l=r6t(n,r),u=a.h/l.length,h=u*o,d=a.y1+h;return{x1:a.x1,w:a.w,y1:d,h:u,yOffset:h}}}return a}};function WRn(t){{var e=t.render;t.render=function(a){a=a||{};var s=t.cy;t.webgl&&(s.zoom()>NPt?(YRn(t),e.call(t,a)):(qRn(t),i6t(t,a,$9.SCREEN)))}}{var r=t.matchCanvasSize;t.matchCanvasSize=function(a){r.call(t,a),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0}}t.findNearestElements=function(a,s,o,l){return eDn(t,a,s)};{var n=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){n.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var i=t.notify;t.notify=function(a,s){i.call(t,a,s),a==="viewport"||a==="bounds"?t.pickingFrameBuffer.needsDraw=!0:a==="background"&&t.drawing.invalidate(s,{type:"node-body"})}}}function YRn(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function qRn(t){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,t.canvasWidth,t.canvasHeight),n.restore()};e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function jRn(t){var e=t.canvasWidth,r=t.canvasHeight,n=fke(t),i=n.pan,a=n.zoom,s=pke();yee(s,s,[i.x,i.y]),gke(s,s,[a,a]);var o=pke();IRn(o,e,r);var l=pke();return MRn(l,o,s),l}function n6t(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=fke(t),a=i.pan,s=i.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,n),e.translate(a.x,a.y),e.scale(s,s)}function XRn(t,e){t.drawSelectionRectangle(e,function(r){return n6t(t,r)})}function KRn(t){var e=t.data.contexts[t.NODE];e.save(),n6t(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function ZRn(t){var e=function(i,a,s){for(var o=i.atlasManager.getAtlasCollection(a),l=t.data.contexts[t.NODE],u=o.atlases,h=0;h=0&&w.add(T)}return w}function eDn(t,e,r){var n=JRn(t,e,r),i=t.getCachedZSortedEles(),a,s,o=Gh(n),l;try{for(o.s();!(l=o.n()).done;){var u=l.value,h=i[u];if(!a&&h.isNode()&&(a=h),!s&&h.isEdge()&&(s=h),a&&s)break}}catch(d){o.e(d)}finally{o.f()}return[a,s].filter(Boolean)}function xke(t,e,r){var n=t.drawing;e+=1,r.isNode()?(n.drawNode(r,e,"node-underlay"),n.drawNode(r,e,"node-body"),n.drawTexture(r,e,"label"),n.drawNode(r,e,"node-overlay")):(n.drawEdgeLine(r,e),n.drawEdgeArrow(r,e,"source"),n.drawEdgeArrow(r,e,"target"),n.drawTexture(r,e,"label"),n.drawTexture(r,e,"edge-source-label"),n.drawTexture(r,e,"edge-target-label"))}function i6t(t,e,r){var n;t.webglDebug&&(n=performance.now());var i=t.drawing,a=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&XRn(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var s=t.data.contexts[t.WEBGL];r.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var o=jRn(t),l=t.getCachedZSortedEles();if(a=l.length,i.startFrame(o,r),r.screen){for(var u=0;u0&&s>0){p.clearRect(0,0,a,s),p.globalCompositeOperation="source-over";var g=this.getCachedZSortedEles();if(t.full)p.translate(-n.x1*u,-n.y1*u),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(n.x1*u,n.y1*u);else{var m=e.pan(),v={x:m.x*u,y:m.y*u};u*=e.zoom(),p.translate(v.x,v.y),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(-v.x,-v.y)}t.bg&&(p.globalCompositeOperation="destination-over",p.fillStyle=t.bg,p.rect(0,0,a,s),p.fill())}return f};function tDn(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a"u"?"undefined":rl(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var n=this.cy.window(),i=n.document;r=i.createElement("canvas"),r.width=t,r.height=e}return r},[UPt,N0,k1,dke,DC,W2,Wu,t6t,Y2,U9,u6t].forEach(function(t){sn(ei,t)});var iDn=[{name:"null",impl:fPt},{name:"base",impl:MPt},{name:"canvas",impl:rDn}],aDn=[{type:"layout",extensions:E3n},{type:"renderer",extensions:iDn}],d6t={},f6t={};function p6t(t,e,r){var n=r,i=function(O){ea("Can not register `"+e+"` for `"+t+"` since `"+O+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(D9.prototype[e])return i(e);D9.prototype[e]=r}else if(t==="collection"){if(mc.prototype[e])return i(e);mc.prototype[e]=r}else if(t==="layout"){for(var a=function(O){this.options=O,r.call(this,O),Mi(this._private)||(this._private={}),this._private.cy=O.cy,this._private.listeners=[],this.createEmitter()},s=a.prototype=Object.create(r.prototype),o=[],l=0;lg&&(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)),this.labelHeight>m&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-m)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-m),this.setHeight(this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var v=new h(g,m),y=p.inverseTransformPoint(v);this.setLocation(y.x,y.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d},function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a},function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(6),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(v,y,b){a.call(this,b),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=v,y!=null&&y instanceof l?this.graphManager=y:y!=null&&y instanceof Layout&&(this.graphManager=y.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(v,y,b){if(y==null&&b==null){var x=v;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(x)>-1)throw"Node already in graph!";return x.owner=this,this.getNodes().push(x),x}else{var w=v;if(!(this.getNodes().indexOf(y)>-1&&this.getNodes().indexOf(b)>-1))throw"Source or target not in graph!";if(!(y.owner==b.owner&&y.owner==this))throw"Both owners must be this graph!";return y.owner!=b.owner?null:(w.source=y,w.target=b,w.isInterGraph=!1,this.getEdges().push(w),y.edges.push(w),b!=y&&b.edges.push(w),w)}},g.prototype.remove=function(v){var y=v;if(v instanceof u){if(y==null)throw"Node is null!";if(!(y.owner!=null&&y.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var b=y.edges.slice(),x,w=b.length,A=0;A-1&&O>-1))throw"Source and/or target doesn't know this edge!";x.source.edges.splice(T,1),x.target!=x.source&&x.target.edges.splice(O,1);var S=x.source.owner.getEdges().indexOf(x);if(S==-1)throw"Not in owner's edge list!";x.source.owner.getEdges().splice(S,1)}},g.prototype.updateLeftTop=function(){for(var v=s.MAX_VALUE,y=s.MAX_VALUE,b,x,w,A=this.getNodes(),S=A.length,T=0;Tb&&(v=b),y>x&&(y=x)}return v==s.MAX_VALUE?null:(A[0].getParent().paddingLeft!=null?w=A[0].getParent().paddingLeft:w=this.margin,this.left=y-w,this.top=v-w,new f(this.left,this.top))},g.prototype.updateBounds=function(v){for(var y=s.MAX_VALUE,b=-s.MAX_VALUE,x=s.MAX_VALUE,w=-s.MAX_VALUE,A,S,T,O,k,E=this.nodes,_=E.length,I=0;I<_;I++){var L=E[I];v&&L.child!=null&&L.updateBounds(),A=L.getLeft(),S=L.getRight(),T=L.getTop(),O=L.getBottom(),y>A&&(y=A),bT&&(x=T),wA&&(y=A),bT&&(x=T),w=this.nodes.length){var _=0;b.forEach(function(I){I.owner==v&&_++}),_==this.nodes.length&&(this.isConnected=!0)}},r.exports=g},function(r,n,i){var a,s=i(1);function o(l){a=i(5),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]p)return u[0]=h,u[1]=m,u[2]=f,u[3]=E,!1;if(df)return u[0]=g,u[1]=d,u[2]=O,u[3]=p,!1;if(hf?(u[0]=y,u[1]=b,R=!0):(u[0]=v,u[1]=m,R=!0):M===N&&(h>f?(u[0]=g,u[1]=m,R=!0):(u[0]=x,u[1]=b,R=!0)),-P===N?f>h?(u[2]=k,u[3]=E,D=!0):(u[2]=O,u[3]=T,D=!0):P===N&&(f>h?(u[2]=S,u[3]=T,D=!0):(u[2]=_,u[3]=E,D=!0)),R&&D)return!1;if(h>f?d>p?(F=this.getCardinalDirection(M,N,4),B=this.getCardinalDirection(P,N,2)):(F=this.getCardinalDirection(-M,N,3),B=this.getCardinalDirection(-P,N,1)):d>p?(F=this.getCardinalDirection(-M,N,1),B=this.getCardinalDirection(-P,N,3)):(F=this.getCardinalDirection(M,N,2),B=this.getCardinalDirection(P,N,4)),!R)switch(F){case 1:z=m,V=h+-A/N,u[0]=V,u[1]=z;break;case 2:V=x,z=d+w*N,u[0]=V,u[1]=z;break;case 3:z=b,V=h+A/N,u[0]=V,u[1]=z;break;case 4:V=y,z=d+-w*N,u[0]=V,u[1]=z;break}if(!D)switch(B){case 1:Q=T,U=f+-L/N,u[2]=U,u[3]=Q;break;case 2:U=_,Q=p+I*N,u[2]=U,u[3]=Q;break;case 3:Q=E,U=f+L/N,u[2]=U,u[3]=Q;break;case 4:U=k,Q=p+-I*N,u[2]=U,u[3]=Q;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,v=u.y,y=h.x,b=h.y,x=void 0,w=void 0,A=void 0,S=void 0,T=void 0,O=void 0,k=void 0,E=void 0,_=void 0;return A=g-f,T=d-p,k=p*f-d*g,S=b-v,O=m-y,E=y*v-m*b,_=A*O-S*T,_===0?null:(x=(T*E-O*k)/_,w=(S*k-A*E)/_,new a(x,w))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a},function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a},function(r,n,i){var a=function(){function d(f,p){for(var g=0;g"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s},function(r,n,i){function a(m){if(Array.isArray(m)){for(var v=0,y=Array(m.length);v0&&v;){for(A.push(T[0]);A.length>0&&v;){var O=A[0];A.splice(0,1),w.add(O);for(var k=O.getEdges(),x=0;x-1&&T.splice(L,1)}w=new Set,S=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var v=[],y=m.source,b=this.graphManager.calcLowestCommonAncestor(m.source,m.target),x=0;x0){for(var b=this.edgeToDummyNodes.get(y),x=0;x=0&&v.splice(E,1);var _=S.getNeighborsList();_.forEach(function(R){if(y.indexOf(R)<0){var D=b.get(R),M=D-1;M==1&&O.push(R),b.set(R,M)}})}y=y.concat(O),(v.length==1||v.length==2)&&(x=!0,w=v[0])}return w},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g},function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a},function(r,n,i){var a=i(4);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s},function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,v,y,b,x=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),w=new Set,m=0;mA||w>A)&&(p.gravitationForceX=-this.gravityConstant*y,p.gravitationForceY=-this.gravityConstant*b)):(A=g.getEstimatedSize()*this.compoundGravityRangeFactor,(x>A||w>A)&&(p.gravitationForceX=-this.gravityConstant*y*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*b*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement=x.length||A>=x[0].length)){for(var S=0;Sd}}]),u}();r.exports=l},function(r,n,i){var a=function(){function l(u,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;uh.coolingFactor*h.maxNodeDisplacement&&(this.displacementX=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementX)),Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementY=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),h.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},l.prototype.propogateDisplacementToChildren=function(h,d){for(var f=this.getChild().getNodes(),p,g=0;g0)this.positionNodesRadially(T);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var O=new Set(this.getAllNodes()),k=this.nodesWithGravity.filter(function(E){return O.has(E)});this.graphManager.setAllNodesToApplyGravitation(k),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},A.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%f.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var T=new Set(this.getAllNodes()),O=this.nodesWithGravity.filter(function(_){return T.has(_)});this.graphManager.setAllNodesToApplyGravitation(O),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var k=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(k,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},A.prototype.getPositionsData=function(){for(var T=this.graphManager.getAllNodes(),O={},k=0;k1){var R;for(R=0;RE&&(E=Math.floor(L.y)),I=Math.floor(L.x+d.DEFAULT_COMPONENT_SEPERATION)}this.transform(new m(p.WORLD_CENTER_X-L.x/2,p.WORLD_CENTER_Y-L.y/2))},A.radialLayout=function(T,O,k){var E=Math.max(this.maxDiagonalInTree(T),d.DEFAULT_RADIAL_SEPARATION);A.branchRadialLayout(O,null,0,359,0,E);var _=x.calculateBounds(T),I=new w;I.setDeviceOrgX(_.getMinX()),I.setDeviceOrgY(_.getMinY()),I.setWorldOrgX(k.x),I.setWorldOrgY(k.y);for(var L=0;L1;){var Q=U[0];U.splice(0,1);var G=N.indexOf(Q);G>=0&&N.splice(G,1),V--,F--}O!=null?z=(N.indexOf(U[0])+1)%V:z=0;for(var X=Math.abs(E-k)/F,Y=z;B!=F;Y=++Y%V){var le=N[Y].getOtherEnd(T);if(le!=O){var q=(k+B*X)%360,Z=(q+X)%360;A.branchRadialLayout(le,T,q,Z,_+I,I),B++}}},A.maxDiagonalInTree=function(T){for(var O=y.MIN_VALUE,k=0;kO&&(O=_)}return O},A.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},A.prototype.groupZeroDegreeMembers=function(){var T=this,O={};this.memberGroups={},this.idToDummyNode={};for(var k=[],E=this.graphManager.getAllNodes(),_=0;_"u"&&(O[R]=[]),O[R]=O[R].concat(I)}Object.keys(O).forEach(function(D){if(O[D].length>1){var M="DummyCompound_"+D;T.memberGroups[M]=O[D];var P=O[D][0].getParent(),N=new u(T.graphManager);N.id=M,N.paddingLeft=P.paddingLeft||0,N.paddingRight=P.paddingRight||0,N.paddingBottom=P.paddingBottom||0,N.paddingTop=P.paddingTop||0,T.idToDummyNode[M]=N;var F=T.getGraphManager().add(T.newGraph(),N),B=P.getChild();B.add(N);for(var V=0;V=0;T--){var O=this.compoundOrder[T],k=O.id,E=O.paddingLeft,_=O.paddingTop;this.adjustLocations(this.tiledMemberPack[k],O.rect.x,O.rect.y,E,_)}},A.prototype.repopulateZeroDegreeMembers=function(){var T=this,O=this.tiledZeroDegreePack;Object.keys(O).forEach(function(k){var E=T.idToDummyNode[k],_=E.paddingLeft,I=E.paddingTop;T.adjustLocations(O[k],E.rect.x,E.rect.y,_,I)})},A.prototype.getToBeTiled=function(T){var O=T.id;if(this.toBeTiled[O]!=null)return this.toBeTiled[O];var k=T.getChild();if(k==null)return this.toBeTiled[O]=!1,!1;for(var E=k.getNodes(),_=0;_0)return this.toBeTiled[O]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[O]=!1,!1}return this.toBeTiled[O]=!0,!0},A.prototype.getNodeDegree=function(T){T.id;for(var O=T.getEdges(),k=0,E=0;ED&&(D=P.rect.height)}k+=D+T.verticalPadding}},A.prototype.tileCompoundMembers=function(T,O){var k=this;this.tiledMemberPack=[],Object.keys(T).forEach(function(E){var _=O[E];k.tiledMemberPack[E]=k.tileNodes(T[E],_.paddingLeft+_.paddingRight),_.rect.width=k.tiledMemberPack[E].width,_.rect.height=k.tiledMemberPack[E].height})},A.prototype.tileNodes=function(T,O){var k=d.TILING_PADDING_VERTICAL,E=d.TILING_PADDING_HORIZONTAL,_={rows:[],rowWidth:[],rowHeight:[],width:0,height:O,verticalPadding:k,horizontalPadding:E};T.sort(function(R,D){return R.rect.width*R.rect.height>D.rect.width*D.rect.height?-1:R.rect.width*R.rect.height0&&(L+=T.horizontalPadding),T.rowWidth[k]=L,T.width0&&(R+=T.verticalPadding);var D=0;R>T.rowHeight[k]&&(D=T.rowHeight[k],T.rowHeight[k]=R,D=T.rowHeight[k]-D),T.height+=D,T.rows[k].push(O)},A.prototype.getShortestRowIndex=function(T){for(var O=-1,k=Number.MAX_VALUE,E=0;Ek&&(O=E,k=T.rowWidth[E]);return O},A.prototype.canAddHorizontal=function(T,O,k){var E=this.getShortestRowIndex(T);if(E<0)return!0;var _=T.rowWidth[E];if(_+T.horizontalPadding+O<=T.width)return!0;var I=0;T.rowHeight[E]0&&(I=k+T.verticalPadding-T.rowHeight[E]);var L;T.width-_>=O+T.horizontalPadding?L=(T.height+I)/(_+O+T.horizontalPadding):L=(T.height+I)/T.width,I=k+T.verticalPadding;var R;return T.widthI&&O!=k){E.splice(-1,1),T.rows[k].push(_),T.rowWidth[O]=T.rowWidth[O]-I,T.rowWidth[k]=T.rowWidth[k]+I,T.width=T.rowWidth[instance.getLongestRowIndex(T)];for(var L=Number.MIN_VALUE,R=0;RL&&(L=E[R].height);O>0&&(L+=T.verticalPadding);var D=T.rowHeight[O]+T.rowHeight[k];T.rowHeight[O]=L,T.rowHeight[k]<_.height+T.verticalPadding&&(T.rowHeight[k]=_.height+T.verticalPadding);var M=T.rowHeight[O]+T.rowHeight[k];T.height+=M-D,this.shiftToLastRow(T)}},A.prototype.tilingPreLayout=function(){d.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},A.prototype.tilingPostLayout=function(){d.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},A.prototype.reduceTrees=function(){for(var T=[],O=!0,k;O;){var E=this.graphManager.getAllNodes(),_=[];O=!1;for(var I=0;I0)for(var B=_;B<=I;B++)F[0]+=this.grid[B][L-1].length+this.grid[B][L].length-1;if(I0)for(var B=L;B<=R;B++)F[3]+=this.grid[_-1][B].length+this.grid[_][B].length-1;for(var V=y.MAX_VALUE,z,U,Q=0;Q0){var R;R=w.getGraphManager().add(w.newGraph(),k),this.processChildrenList(R,O,w)}}},m.prototype.stop=function(){return this.stopped=!0,this};var y=function(x){x("layout","cose-bilkent",m)};typeof cytoscape<"u"&&y(cytoscape),n.exports=y}])})})(m6t);var hDn=m6t.exports;const dDn=uh(hDn);$0.use(dDn);function b6t(t,e){t.forEach(r=>{const n={id:r.id,labelText:r.label,height:r.height,width:r.width,padding:r.padding??0};Object.keys(r).forEach(i=>{["id","label","height","width","padding","x","y"].includes(i)||(n[i]=r[i])}),e.add({group:"nodes",data:n,position:{x:r.x??0,y:r.y??0}})})}C(b6t,"addNodes");function x6t(t,e){t.forEach(r=>{const n={id:r.id,source:r.start,target:r.end};Object.keys(r).forEach(i=>{["id","start","end"].includes(i)||(n[i]=r[i])}),e.add({group:"edges",data:n})})}C(x6t,"addEdges");function w6t(t){return new Promise(e=>{const r=Ot("body").append("div").attr("id","cy").attr("style","display:none"),n=$0({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),b6t(t.nodes,n),x6t(t.edges,n),n.nodes().forEach(function(a){a.layoutDimensions=()=>{const s=a.data();return{w:s.width,h:s.height}}});const i={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};n.layout(i).run(),n.ready(a=>{me.info("Cytoscape ready",a),e(n)})})}C(w6t,"createCytoscapeInstance");function A6t(t){return t.nodes().map(e=>{const r=e.data(),n=e.position(),i={id:r.id,x:n.x,y:n.y};return Object.keys(r).forEach(a=>{a!=="id"&&(i[a]=r[a])}),i})}C(A6t,"extractPositionedNodes");function S6t(t){return t.edges().map(e=>{const r=e.data(),n=e._private.rscratch,i={id:r.id,source:r.source,target:r.target,startX:n.startX,startY:n.startY,midX:n.midX,midY:n.midY,endX:n.endX,endY:n.endY};return Object.keys(r).forEach(a=>{["id","source","target"].includes(a)||(i[a]=r[a])}),i})}C(S6t,"extractPositionedEdges");async function T6t(t,e){me.debug("Starting cose-bilkent layout algorithm");try{C6t(t);const r=await w6t(t),n=A6t(r),i=S6t(r);return me.debug(`Layout completed: ${n.length} nodes, ${i.length} edges`),{nodes:n,edges:i}}catch(r){throw me.error("Error in cose-bilkent layout algorithm:",r),r}}C(T6t,"executeCoseBilkentLayout");function C6t(t){if(!t)throw new Error("Layout data is required");if(!t.config)throw new Error("Configuration is required in layout data");if(!t.rootNode)throw new Error("Root node is required");if(!t.nodes||!Array.isArray(t.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(t.edges))throw new Error("Edges array is required in layout data");return!0}C(C6t,"validateLayoutData");var fDn=C(async(t,e,{insertCluster:r,insertEdge:n,insertEdgeLabel:i,insertMarkers:a,insertNode:s,log:o,positionEdgeLabel:l},{algorithm:u})=>{const h={},d={},f=e.select("g");a(f,t.markers,t.type,t.diagramId);const p=f.insert("g").attr("class","subgraphs"),g=f.insert("g").attr("class","edgePaths"),m=f.insert("g").attr("class","edgeLabels"),v=f.insert("g").attr("class","nodes");o.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(t.nodes.map(async x=>{if(x.isGroup){const w={...x};d[x.id]=w,h[x.id]=w,await r(p,x)}else{const w={...x};h[x.id]=w;const A=await s(v,x,{config:t.config,dir:t.direction||"TB"}),S=A.node().getBBox();w.width=S.width,w.height=S.height,w.domId=A,o.debug(`Node ${x.id} dimensions: ${S.width}x${S.height}`)}})),o.debug("Running cose-bilkent layout algorithm");const y={...t,nodes:t.nodes.map(x=>{const w=h[x.id];return{...x,width:w.width,height:w.height}})},b=await T6t(y,t.config);o.debug("Positioning nodes based on layout results"),b.nodes.forEach(x=>{const w=h[x.id];w!=null&&w.domId&&(w.domId.attr("transform",`translate(${x.x}, ${x.y})`),w.x=x.x,w.y=x.y,o.debug(`Positioned node ${w.id} at center (${x.x}, ${x.y})`))}),b.edges.forEach(x=>{const w=t.edges.find(A=>A.id===x.id);w&&(w.points=[{x:x.startX,y:x.startY},{x:x.midX,y:x.midY},{x:x.endX,y:x.endY}])}),o.debug("Inserting and positioning edges"),await Promise.all(t.edges.map(async x=>{await i(m,x);const w=h[x.start??""],A=h[x.end??""];if(w&&A){const S=b.edges.find(T=>T.id===x.id);if(S){o.debug("APA01 positionedEdge",S);const T={...x},O=n(g,T,d,t.type,w,A,t.diagramId);l(T,O)}else{const T={...x,points:[{x:w.x||0,y:w.y||0},{x:A.x||0,y:A.y||0}]},O=n(g,T,d,t.type,w,A,t.diagramId);l(T,O)}}})),o.debug("Cose-bilkent rendering completed")},"render"),pDn=fDn;const gDn=Object.freeze(Object.defineProperty({__proto__:null,render:pDn},Symbol.toStringTag,{value:"Module"}));var Aee=C((t,e)=>{const r=t.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),e.name&&r.attr("name",e.name),e.rx&&r.attr("rx",e.rx),e.ry&&r.attr("ry",e.ry),e.attrs!==void 0)for(const n in e.attrs)r.attr(n,e.attrs[n]);return e.class&&r.attr("class",e.class),r},"drawRect"),O6t=C((t,e)=>{const r={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};Aee(t,r).lower()},"drawBackgroundRect"),mDn=C((t,e)=>{const r=e.text.replace(k5," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),Oke=C((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const a=_T(n);i.attr("xlink:href",a)},"drawImage"),kke=C((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const a=_T(n);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),tf=C(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),Eke=C(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),_ke=C(()=>{let t=Ot(".mermaidTooltip");return t.empty()&&(t=Ot("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),t},"createTooltip"),See=function(){var t=C(function(Te,De,qe,K){for(qe=qe||{},K=Te.length;K--;qe[Te[K]]=De);return qe},"o"),e=[1,24],r=[1,25],n=[1,26],i=[1,27],a=[1,28],s=[1,63],o=[1,64],l=[1,65],u=[1,66],h=[1,67],d=[1,68],f=[1,69],p=[1,29],g=[1,30],m=[1,31],v=[1,32],y=[1,33],b=[1,34],x=[1,35],w=[1,36],A=[1,37],S=[1,38],T=[1,39],O=[1,40],k=[1,41],E=[1,42],_=[1,43],I=[1,44],L=[1,45],R=[1,46],D=[1,47],M=[1,48],P=[1,50],N=[1,51],F=[1,52],B=[1,53],V=[1,54],z=[1,55],U=[1,56],Q=[1,57],G=[1,58],X=[1,59],Y=[1,60],le=[14,42],q=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Z=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],ee=[1,82],re=[1,83],ve=[1,84],ae=[1,85],Ce=[12,14,42],Oe=[12,14,33,42],$e=[12,14,33,42,76,77,79,80],he=[12,33],fe=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Se={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:C(function(De,qe,K,ce,be,ne,j){var ie=ne.length-1;switch(be){case 3:ce.setDirection("TB");break;case 4:ce.setDirection("BT");break;case 5:ce.setDirection("RL");break;case 6:ce.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:ce.setC4Type(ne[ie-3]);break;case 19:ce.setTitle(ne[ie].substring(6)),this.$=ne[ie].substring(6);break;case 20:ce.setAccDescription(ne[ie].substring(15)),this.$=ne[ie].substring(15);break;case 21:this.$=ne[ie].trim(),ce.setTitle(this.$);break;case 22:case 23:this.$=ne[ie].trim(),ce.setAccDescription(this.$);break;case 28:ne[ie].splice(2,0,"ENTERPRISE"),ce.addPersonOrSystemBoundary(...ne[ie]),this.$=ne[ie];break;case 29:ne[ie].splice(2,0,"SYSTEM"),ce.addPersonOrSystemBoundary(...ne[ie]),this.$=ne[ie];break;case 30:ce.addPersonOrSystemBoundary(...ne[ie]),this.$=ne[ie];break;case 31:ne[ie].splice(2,0,"CONTAINER"),ce.addContainerBoundary(...ne[ie]),this.$=ne[ie];break;case 32:ce.addDeploymentNode("node",...ne[ie]),this.$=ne[ie];break;case 33:ce.addDeploymentNode("nodeL",...ne[ie]),this.$=ne[ie];break;case 34:ce.addDeploymentNode("nodeR",...ne[ie]),this.$=ne[ie];break;case 35:ce.popBoundaryParseStack();break;case 39:ce.addPersonOrSystem("person",...ne[ie]),this.$=ne[ie];break;case 40:ce.addPersonOrSystem("external_person",...ne[ie]),this.$=ne[ie];break;case 41:ce.addPersonOrSystem("system",...ne[ie]),this.$=ne[ie];break;case 42:ce.addPersonOrSystem("system_db",...ne[ie]),this.$=ne[ie];break;case 43:ce.addPersonOrSystem("system_queue",...ne[ie]),this.$=ne[ie];break;case 44:ce.addPersonOrSystem("external_system",...ne[ie]),this.$=ne[ie];break;case 45:ce.addPersonOrSystem("external_system_db",...ne[ie]),this.$=ne[ie];break;case 46:ce.addPersonOrSystem("external_system_queue",...ne[ie]),this.$=ne[ie];break;case 47:ce.addContainer("container",...ne[ie]),this.$=ne[ie];break;case 48:ce.addContainer("container_db",...ne[ie]),this.$=ne[ie];break;case 49:ce.addContainer("container_queue",...ne[ie]),this.$=ne[ie];break;case 50:ce.addContainer("external_container",...ne[ie]),this.$=ne[ie];break;case 51:ce.addContainer("external_container_db",...ne[ie]),this.$=ne[ie];break;case 52:ce.addContainer("external_container_queue",...ne[ie]),this.$=ne[ie];break;case 53:ce.addComponent("component",...ne[ie]),this.$=ne[ie];break;case 54:ce.addComponent("component_db",...ne[ie]),this.$=ne[ie];break;case 55:ce.addComponent("component_queue",...ne[ie]),this.$=ne[ie];break;case 56:ce.addComponent("external_component",...ne[ie]),this.$=ne[ie];break;case 57:ce.addComponent("external_component_db",...ne[ie]),this.$=ne[ie];break;case 58:ce.addComponent("external_component_queue",...ne[ie]),this.$=ne[ie];break;case 60:ce.addRel("rel",...ne[ie]),this.$=ne[ie];break;case 61:ce.addRel("birel",...ne[ie]),this.$=ne[ie];break;case 62:ce.addRel("rel_u",...ne[ie]),this.$=ne[ie];break;case 63:ce.addRel("rel_d",...ne[ie]),this.$=ne[ie];break;case 64:ce.addRel("rel_l",...ne[ie]),this.$=ne[ie];break;case 65:ce.addRel("rel_r",...ne[ie]),this.$=ne[ie];break;case 66:ce.addRel("rel_b",...ne[ie]),this.$=ne[ie];break;case 67:ne[ie].splice(0,1),ce.addRel("rel",...ne[ie]),this.$=ne[ie];break;case 68:ce.updateElStyle("update_el_style",...ne[ie]),this.$=ne[ie];break;case 69:ce.updateRelStyle("update_rel_style",...ne[ie]),this.$=ne[ie];break;case 70:ce.updateLayoutConfig("update_layout_config",...ne[ie]),this.$=ne[ie];break;case 71:this.$=[ne[ie]];break;case 72:ne[ie].unshift(ne[ie-1]),this.$=ne[ie];break;case 73:case 75:this.$=ne[ie].trim();break;case 74:let pe={};pe[ne[ie-1].trim()]=ne[ie].trim(),this.$=pe;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:v,48:y,49:b,50:x,51:w,52:A,53:S,54:T,55:O,56:k,57:E,58:_,59:I,60:L,61:R,62:D,63:M,64:P,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:X,74:Y},{13:70,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:v,48:y,49:b,50:x,51:w,52:A,53:S,54:T,55:O,56:k,57:E,58:_,59:I,60:L,61:R,62:D,63:M,64:P,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:X,74:Y},{13:71,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:v,48:y,49:b,50:x,51:w,52:A,53:S,54:T,55:O,56:k,57:E,58:_,59:I,60:L,61:R,62:D,63:M,64:P,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:X,74:Y},{13:72,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:v,48:y,49:b,50:x,51:w,52:A,53:S,54:T,55:O,56:k,57:E,58:_,59:I,60:L,61:R,62:D,63:M,64:P,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:X,74:Y},{13:73,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:v,48:y,49:b,50:x,51:w,52:A,53:S,54:T,55:O,56:k,57:E,58:_,59:I,60:L,61:R,62:D,63:M,64:P,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:X,74:Y},{14:[1,74]},t(le,[2,13],{43:23,29:49,30:61,32:62,20:75,34:s,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:v,48:y,49:b,50:x,51:w,52:A,53:S,54:T,55:O,56:k,57:E,58:_,59:I,60:L,61:R,62:D,63:M,64:P,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:X,74:Y}),t(le,[2,14]),t(q,[2,16],{12:[1,76]}),t(le,[2,36],{12:[1,77]}),t(Z,[2,19]),t(Z,[2,20]),{25:[1,78]},{27:[1,79]},t(Z,[2,23]),{35:80,75:81,76:ee,77:re,79:ve,80:ae},{35:86,75:81,76:ee,77:re,79:ve,80:ae},{35:87,75:81,76:ee,77:re,79:ve,80:ae},{35:88,75:81,76:ee,77:re,79:ve,80:ae},{35:89,75:81,76:ee,77:re,79:ve,80:ae},{35:90,75:81,76:ee,77:re,79:ve,80:ae},{35:91,75:81,76:ee,77:re,79:ve,80:ae},{35:92,75:81,76:ee,77:re,79:ve,80:ae},{35:93,75:81,76:ee,77:re,79:ve,80:ae},{35:94,75:81,76:ee,77:re,79:ve,80:ae},{35:95,75:81,76:ee,77:re,79:ve,80:ae},{35:96,75:81,76:ee,77:re,79:ve,80:ae},{35:97,75:81,76:ee,77:re,79:ve,80:ae},{35:98,75:81,76:ee,77:re,79:ve,80:ae},{35:99,75:81,76:ee,77:re,79:ve,80:ae},{35:100,75:81,76:ee,77:re,79:ve,80:ae},{35:101,75:81,76:ee,77:re,79:ve,80:ae},{35:102,75:81,76:ee,77:re,79:ve,80:ae},{35:103,75:81,76:ee,77:re,79:ve,80:ae},{35:104,75:81,76:ee,77:re,79:ve,80:ae},t(Ce,[2,59]),{35:105,75:81,76:ee,77:re,79:ve,80:ae},{35:106,75:81,76:ee,77:re,79:ve,80:ae},{35:107,75:81,76:ee,77:re,79:ve,80:ae},{35:108,75:81,76:ee,77:re,79:ve,80:ae},{35:109,75:81,76:ee,77:re,79:ve,80:ae},{35:110,75:81,76:ee,77:re,79:ve,80:ae},{35:111,75:81,76:ee,77:re,79:ve,80:ae},{35:112,75:81,76:ee,77:re,79:ve,80:ae},{35:113,75:81,76:ee,77:re,79:ve,80:ae},{35:114,75:81,76:ee,77:re,79:ve,80:ae},{35:115,75:81,76:ee,77:re,79:ve,80:ae},{20:116,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:v,48:y,49:b,50:x,51:w,52:A,53:S,54:T,55:O,56:k,57:E,58:_,59:I,60:L,61:R,62:D,63:M,64:P,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:X,74:Y},{12:[1,118],33:[1,117]},{35:119,75:81,76:ee,77:re,79:ve,80:ae},{35:120,75:81,76:ee,77:re,79:ve,80:ae},{35:121,75:81,76:ee,77:re,79:ve,80:ae},{35:122,75:81,76:ee,77:re,79:ve,80:ae},{35:123,75:81,76:ee,77:re,79:ve,80:ae},{35:124,75:81,76:ee,77:re,79:ve,80:ae},{35:125,75:81,76:ee,77:re,79:ve,80:ae},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(le,[2,15]),t(q,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:a}),t(le,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:r,24:n,26:i,28:a,34:s,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:v,48:y,49:b,50:x,51:w,52:A,53:S,54:T,55:O,56:k,57:E,58:_,59:I,60:L,61:R,62:D,63:M,64:P,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:X,74:Y}),t(Z,[2,21]),t(Z,[2,22]),t(Ce,[2,39]),t(Oe,[2,71],{75:81,35:132,76:ee,77:re,79:ve,80:ae}),t($e,[2,73]),{78:[1,133]},t($e,[2,75]),t($e,[2,76]),t(Ce,[2,40]),t(Ce,[2,41]),t(Ce,[2,42]),t(Ce,[2,43]),t(Ce,[2,44]),t(Ce,[2,45]),t(Ce,[2,46]),t(Ce,[2,47]),t(Ce,[2,48]),t(Ce,[2,49]),t(Ce,[2,50]),t(Ce,[2,51]),t(Ce,[2,52]),t(Ce,[2,53]),t(Ce,[2,54]),t(Ce,[2,55]),t(Ce,[2,56]),t(Ce,[2,57]),t(Ce,[2,58]),t(Ce,[2,60]),t(Ce,[2,61]),t(Ce,[2,62]),t(Ce,[2,63]),t(Ce,[2,64]),t(Ce,[2,65]),t(Ce,[2,66]),t(Ce,[2,67]),t(Ce,[2,68]),t(Ce,[2,69]),t(Ce,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(he,[2,28]),t(he,[2,29]),t(he,[2,30]),t(he,[2,31]),t(he,[2,32]),t(he,[2,33]),t(he,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(q,[2,18]),t(le,[2,38]),t(Oe,[2,72]),t($e,[2,74]),t(Ce,[2,24]),t(Ce,[2,35]),t(fe,[2,25]),t(fe,[2,26],{12:[1,138]}),t(fe,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:C(function(De,qe){if(qe.recoverable)this.trace(De);else{var K=new Error(De);throw K.hash=qe,K}},"parseError"),parse:C(function(De){var qe=this,K=[0],ce=[],be=[null],ne=[],j=this.table,ie="",pe=0,te=0,ye=2,oe=1,_e=ne.slice.call(arguments,1),Le=Object.create(this.lexer),Ye={yy:{}};for(var Pe in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Pe)&&(Ye.yy[Pe]=this.yy[Pe]);Le.setInput(De,Ye.yy),Ye.yy.lexer=Le,Ye.yy.parser=this,typeof Le.yylloc>"u"&&(Le.yylloc={});var Xe=Le.yylloc;ne.push(Xe);var Ne=Le.options&&Le.options.ranges;typeof Ye.yy.parseError=="function"?this.parseError=Ye.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ze(Ae){K.length=K.length-2*Ae,be.length=be.length-Ae,ne.length=ne.length-Ae}C(Ze,"popStack");function Ge(){var Ae;return Ae=ce.pop()||Le.lex()||oe,typeof Ae!="number"&&(Ae instanceof Array&&(ce=Ae,Ae=ce.pop()),Ae=qe.symbols_[Ae]||Ae),Ae}C(Ge,"lex");for(var lt,Fe,wt,Me,Rt={},Lt,ut,Xt,Ft;;){if(Fe=K[K.length-1],this.defaultActions[Fe]?wt=this.defaultActions[Fe]:((lt===null||typeof lt>"u")&&(lt=Ge()),wt=j[Fe]&&j[Fe][lt]),typeof wt>"u"||!wt.length||!wt[0]){var gt="";Ft=[];for(Lt in j[Fe])this.terminals_[Lt]&&Lt>ye&&Ft.push("'"+this.terminals_[Lt]+"'");Le.showPosition?gt="Parse error on line "+(pe+1)+`: `+Le.showPosition()+` -Expecting `+Ft.join(", ")+", got '"+(this.terminals_[lt]||lt)+"'":gt="Parse error on line "+(pe+1)+": Unexpected "+(lt==oe?"end of input":"'"+(this.terminals_[lt]||lt)+"'"),this.parseError(gt,{text:Le.match,token:this.terminals_[lt]||lt,line:Le.yylineno,loc:Xe,expected:Ft})}if(wt[0]instanceof Array&&wt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Fe+", token: "+lt);switch(wt[0]){case 1:K.push(lt),be.push(Le.yytext),ne.push(Le.yylloc),K.push(wt[1]),lt=null,te=Le.yyleng,ie=Le.yytext,pe=Le.yylineno,Xe=Le.yylloc;break;case 2:if(ut=this.productions_[wt[1]][1],Rt.$=be[be.length-ut],Rt._$={first_line:ne[ne.length-(ut||1)].first_line,last_line:ne[ne.length-1].last_line,first_column:ne[ne.length-(ut||1)].first_column,last_column:ne[ne.length-1].last_column},Ne&&(Rt._$.range=[ne[ne.length-(ut||1)].range[0],ne[ne.length-1].range[1]]),Me=this.performAction.apply(Rt,[ie,te,pe,Ye.yy,wt[1],be,ne].concat(_e)),typeof Me<"u")return Me;ut&&(K=K.slice(0,-1*ut*2),be=be.slice(0,-1*ut),ne=ne.slice(0,-1*ut)),K.push(this.productions_[wt[1]][0]),be.push(Rt.$),ne.push(Rt._$),Xt=j[K[K.length-2]][K[K.length-1]],K.push(Xt);break;case 3:return!0}}return!0},"parse")},ge=function(){var Se={EOF:1,parseError:C(function(qe,K){if(this.yy.parser)this.yy.parser.parseError(qe,K);else throw new Error(qe)},"parseError"),setInput:C(function(De,qe){return this.yy=qe||this.yy||{},this._input=De,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var De=this._input[0];this.yytext+=De,this.yyleng++,this.offset++,this.match+=De,this.matched+=De;var qe=De.match(/(?:\r\n?|\n).*/g);return qe?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),De},"input"),unput:C(function(De){var qe=De.length,K=De.split(/(?:\r\n?|\n)/g);this._input=De+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-qe),this.offset-=qe;var ce=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),K.length-1&&(this.yylineno-=K.length-1);var be=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:K?(K.length===ce.length?this.yylloc.first_column:0)+ce[ce.length-K.length].length-K[0].length:this.yylloc.first_column-qe},this.options.ranges&&(this.yylloc.range=[be[0],be[0]+this.yyleng-qe]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +Expecting `+Ft.join(", ")+", got '"+(this.terminals_[lt]||lt)+"'":gt="Parse error on line "+(pe+1)+": Unexpected "+(lt==oe?"end of input":"'"+(this.terminals_[lt]||lt)+"'"),this.parseError(gt,{text:Le.match,token:this.terminals_[lt]||lt,line:Le.yylineno,loc:Xe,expected:Ft})}if(wt[0]instanceof Array&&wt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Fe+", token: "+lt);switch(wt[0]){case 1:K.push(lt),be.push(Le.yytext),ne.push(Le.yylloc),K.push(wt[1]),lt=null,te=Le.yyleng,ie=Le.yytext,pe=Le.yylineno,Xe=Le.yylloc;break;case 2:if(ut=this.productions_[wt[1]][1],Rt.$=be[be.length-ut],Rt._$={first_line:ne[ne.length-(ut||1)].first_line,last_line:ne[ne.length-1].last_line,first_column:ne[ne.length-(ut||1)].first_column,last_column:ne[ne.length-1].last_column},Ne&&(Rt._$.range=[ne[ne.length-(ut||1)].range[0],ne[ne.length-1].range[1]]),Me=this.performAction.apply(Rt,[ie,te,pe,Ye.yy,wt[1],be,ne].concat(_e)),typeof Me<"u")return Me;ut&&(K=K.slice(0,-1*ut*2),be=be.slice(0,-1*ut),ne=ne.slice(0,-1*ut)),K.push(this.productions_[wt[1]][0]),be.push(Rt.$),ne.push(Rt._$),Xt=j[K[K.length-2]][K[K.length-1]],K.push(Xt);break;case 3:return!0}}return!0},"parse")},ge=function(){var Te={EOF:1,parseError:C(function(qe,K){if(this.yy.parser)this.yy.parser.parseError(qe,K);else throw new Error(qe)},"parseError"),setInput:C(function(De,qe){return this.yy=qe||this.yy||{},this._input=De,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var De=this._input[0];this.yytext+=De,this.yyleng++,this.offset++,this.match+=De,this.matched+=De;var qe=De.match(/(?:\r\n?|\n).*/g);return qe?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),De},"input"),unput:C(function(De){var qe=De.length,K=De.split(/(?:\r\n?|\n)/g);this._input=De+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-qe),this.offset-=qe;var ce=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),K.length-1&&(this.yylineno-=K.length-1);var be=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:K?(K.length===ce.length?this.yylloc.first_column:0)+ce[ce.length-K.length].length-K[0].length:this.yylloc.first_column-qe},this.options.ranges&&(this.yylloc.range=[be[0],be[0]+this.yyleng-qe]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:C(function(De){this.unput(this.match.slice(De))},"less"),pastInput:C(function(){var De=this.matched.substr(0,this.matched.length-this.match.length);return(De.length>20?"...":"")+De.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:C(function(){var De=this.match;return De.length<20&&(De+=this._input.substr(0,20-De.length)),(De.substr(0,20)+(De.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:C(function(){var De=this.pastInput(),qe=new Array(De.length+1).join("-");return De+this.upcomingInput()+` `+qe+"^"},"showPosition"),test_match:C(function(De,qe){var K,ce,be;if(this.options.backtrack_lexer&&(be={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(be.yylloc.range=this.yylloc.range.slice(0))),ce=De[0].match(/(?:\r\n?|\n).*/g),ce&&(this.yylineno+=ce.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:ce?ce[ce.length-1].length-ce[ce.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+De[0].length},this.yytext+=De[0],this.match+=De[0],this.matches=De,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(De[0].length),this.matched+=De[0],K=this.performAction.call(this,this.yy,this,qe,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),K)return K;if(this._backtrack){for(var ne in be)this[ne]=be[ne];return!1}return!1},"test_match"),next:C(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var De,qe,K,ce;this._more||(this.yytext="",this.match="");for(var be=this._currentRules(),ne=0;neqe[0].length)){if(qe=K,ce=ne,this.options.backtrack_lexer){if(De=this.test_match(K,be[ne]),De!==!1)return De;if(this._backtrack){qe=!1;continue}else return!1}else if(!this.options.flex)break}return qe?(De=this.test_match(qe,be[ce]),De!==!1?De:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var qe=this.next();return qe||this.lex()},"lex"),begin:C(function(qe){this.conditionStack.push(qe)},"begin"),popState:C(function(){var qe=this.conditionStack.length-1;return qe>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(qe){return qe=this.conditionStack.length-1-Math.abs(qe||0),qe>=0?this.conditionStack[qe]:"INITIAL"},"topState"),pushState:C(function(qe){this.begin(qe)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:C(function(qe,K,ce,be){switch(ce){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[65,66,67,68],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return Se}();Te.lexer=ge;function Qe(){this.yy={}}return C(Qe,"Parser"),Qe.prototype=Te,Te.Parser=Qe,new Qe}();Tee.parser=Tee;var vDn=Tee,Tg=[],q2=[""],Yu="global",Sg="",F0=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],V9=[],Rke="",Dke=!1,See=4,Cee=2,k6t,yDn=C(function(){return k6t},"getC4Type"),bDn=C(function(t){k6t=ai(t,He())},"setC4Type"),xDn=C(function(t,e,r,n,i,a,s,o,l){if(t==null||e===void 0||e===null||r===void 0||r===null||n===void 0||n===null)return;let u={};const h=V9.find(d=>d.from===e&&d.to===r);if(h?u=h:V9.push(u),u.type=t,u.from=e,u.to=r,u.label={text:n},i==null)u.techn={text:""};else if(typeof i=="object"){let[d,f]=Object.entries(i)[0];u[d]={text:f}}else u.techn={text:i};if(a==null)u.descr={text:""};else if(typeof a=="object"){let[d,f]=Object.entries(a)[0];u[d]={text:f}}else u.descr={text:a};if(typeof s=="object"){let[d,f]=Object.entries(s)[0];u[d]=f}else u.sprite=s;if(typeof o=="object"){let[d,f]=Object.entries(o)[0];u[d]=f}else u.tags=o;if(typeof l=="object"){let[d,f]=Object.entries(l)[0];u[d]=f}else u.link=l;u.wrap=j2()},"addRel"),wDn=C(function(t,e,r,n,i,a,s){if(e===null||r===null)return;let o={};const l=Tg.find(u=>u.alias===e);if(l&&e===l.alias?o=l:(o.alias=e,Tg.push(o)),r==null?o.label={text:""}:o.label={text:r},n==null)o.descr={text:""};else if(typeof n=="object"){let[u,h]=Object.entries(n)[0];o[u]={text:h}}else o.descr={text:n};if(typeof i=="object"){let[u,h]=Object.entries(i)[0];o[u]=h}else o.sprite=i;if(typeof a=="object"){let[u,h]=Object.entries(a)[0];o[u]=h}else o.tags=a;if(typeof s=="object"){let[u,h]=Object.entries(s)[0];o[u]=h}else o.link=s;o.typeC4Shape={text:t},o.parentBoundary=Yu,o.wrap=j2()},"addPersonOrSystem"),ADn=C(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=Tg.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,Tg.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.sprite=a;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=j2(),l.typeC4Shape={text:t},l.parentBoundary=Yu},"addContainer"),TDn=C(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=Tg.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,Tg.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.sprite=a;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=j2(),l.typeC4Shape={text:t},l.parentBoundary=Yu},"addComponent"),SDn=C(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=F0.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,F0.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"system"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];a[o]={text:l}}else a.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];a[o]=l}else a.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];a[o]=l}else a.link=i;a.parentBoundary=Yu,a.wrap=j2(),Sg=Yu,Yu=t,q2.push(Sg)},"addPersonOrSystemBoundary"),CDn=C(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=F0.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,F0.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"container"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];a[o]={text:l}}else a.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];a[o]=l}else a.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];a[o]=l}else a.link=i;a.parentBoundary=Yu,a.wrap=j2(),Sg=Yu,Yu=t,q2.push(Sg)},"addContainerBoundary"),ODn=C(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=F0.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,F0.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.type={text:"node"};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.type={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.nodeType=t,l.parentBoundary=Yu,l.wrap=j2(),Sg=Yu,Yu=e,q2.push(Sg)},"addDeploymentNode"),kDn=C(function(){Yu=Sg,q2.pop(),Sg=q2.pop(),q2.push(Sg)},"popBoundaryParseStack"),EDn=C(function(t,e,r,n,i,a,s,o,l,u,h){let d=Tg.find(f=>f.alias===e);if(!(d===void 0&&(d=F0.find(f=>f.alias===e),d===void 0))){if(r!=null)if(typeof r=="object"){let[f,p]=Object.entries(r)[0];d[f]=p}else d.bgColor=r;if(n!=null)if(typeof n=="object"){let[f,p]=Object.entries(n)[0];d[f]=p}else d.fontColor=n;if(i!=null)if(typeof i=="object"){let[f,p]=Object.entries(i)[0];d[f]=p}else d.borderColor=i;if(a!=null)if(typeof a=="object"){let[f,p]=Object.entries(a)[0];d[f]=p}else d.shadowing=a;if(s!=null)if(typeof s=="object"){let[f,p]=Object.entries(s)[0];d[f]=p}else d.shape=s;if(o!=null)if(typeof o=="object"){let[f,p]=Object.entries(o)[0];d[f]=p}else d.sprite=o;if(l!=null)if(typeof l=="object"){let[f,p]=Object.entries(l)[0];d[f]=p}else d.techn=l;if(u!=null)if(typeof u=="object"){let[f,p]=Object.entries(u)[0];d[f]=p}else d.legendText=u;if(h!=null)if(typeof h=="object"){let[f,p]=Object.entries(h)[0];d[f]=p}else d.legendSprite=h}},"updateElStyle"),_Dn=C(function(t,e,r,n,i,a,s){const o=V9.find(l=>l.from===e&&l.to===r);if(o!==void 0){if(n!=null)if(typeof n=="object"){let[l,u]=Object.entries(n)[0];o[l]=u}else o.textColor=n;if(i!=null)if(typeof i=="object"){let[l,u]=Object.entries(i)[0];o[l]=u}else o.lineColor=i;if(a!=null)if(typeof a=="object"){let[l,u]=Object.entries(a)[0];o[l]=parseInt(u)}else o.offsetX=parseInt(a);if(s!=null)if(typeof s=="object"){let[l,u]=Object.entries(s)[0];o[l]=parseInt(u)}else o.offsetY=parseInt(s)}},"updateRelStyle"),RDn=C(function(t,e,r){let n=See,i=Cee;if(typeof e=="object"){const a=Object.values(e)[0];n=parseInt(a)}else n=parseInt(e);if(typeof r=="object"){const a=Object.values(r)[0];i=parseInt(a)}else i=parseInt(r);n>=1&&(See=n),i>=1&&(Cee=i)},"updateLayoutConfig"),DDn=C(function(){return See},"getC4ShapeInRow"),LDn=C(function(){return Cee},"getC4BoundaryInRow"),MDn=C(function(){return Yu},"getCurrentBoundaryParse"),IDn=C(function(){return Sg},"getParentBoundaryParse"),E6t=C(function(t){return t==null?Tg:Tg.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),PDn=C(function(t){return Tg.find(e=>e.alias===t)},"getC4Shape"),NDn=C(function(t){return Object.keys(E6t(t))},"getC4ShapeKeys"),_6t=C(function(t){return t==null?F0:F0.filter(e=>e.parentBoundary===t)},"getBoundaries"),BDn=_6t,$Dn=C(function(){return V9},"getRels"),FDn=C(function(){return Rke},"getTitle"),zDn=C(function(t){Dke=t},"setWrap"),j2=C(function(){return Dke},"autoWrap"),UDn=C(function(){Tg=[],F0=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Sg="",Yu="global",q2=[""],V9=[],q2=[""],Rke="",Dke=!1,See=4,Cee=2},"clear"),VDn={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},QDn={FILLED:0,OPEN:1},GDn={LEFTOF:0,RIGHTOF:1,OVER:2},HDn=C(function(t){Rke=ai(t,He())},"setTitle"),Lke={addPersonOrSystem:wDn,addPersonOrSystemBoundary:SDn,addContainer:ADn,addContainerBoundary:CDn,addComponent:TDn,addDeploymentNode:ODn,popBoundaryParseStack:kDn,addRel:xDn,updateElStyle:EDn,updateRelStyle:_Dn,updateLayoutConfig:RDn,autoWrap:j2,setWrap:zDn,getC4ShapeArray:E6t,getC4Shape:PDn,getC4ShapeKeys:NDn,getBoundaries:_6t,getBoundarys:BDn,getCurrentBoundaryParse:MDn,getParentBoundaryParse:IDn,getRels:$Dn,getTitle:FDn,getC4Type:yDn,getC4ShapeInRow:DDn,getC4BoundaryInRow:LDn,setAccTitle:Da,getAccTitle:Ja,getAccDescription:ts,setAccDescription:es,getConfig:C(()=>He().c4,"getConfig"),clear:UDn,LINETYPE:VDn,ARROWTYPE:QDn,PLACEMENT:GDn,setTitle:HDn,setC4Type:bDn},Mke=C(function(t,e){return Aee(t,e)},"drawRect"),R6t=C(function(t,e,r,n,i,a){const s=t.append("image");s.attr("width",e),s.attr("height",r),s.attr("x",n),s.attr("y",i);let o=a.startsWith("data:image/png;base64")?a:_S(a);s.attr("xlink:href",o)},"drawImage"),WDn=C((t,e,r,n)=>{const i=t.append("g");let a=0;for(let s of e){let o=s.textColor?s.textColor:"#444444",l=s.lineColor?s.lineColor:"#444444",u=s.offsetX?parseInt(s.offsetX):0,h=s.offsetY?parseInt(s.offsetY):0,d="";if(a===0){let p=i.append("line");p.attr("x1",s.startPoint.x),p.attr("y1",s.startPoint.y),p.attr("x2",s.endPoint.x),p.attr("y2",s.endPoint.y),p.attr("stroke-width","1"),p.attr("stroke",l),p.style("fill","none"),s.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)"),a=-1}else{let p=i.append("path");p.attr("fill","none").attr("stroke-width","1").attr("stroke",l).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",s.startPoint.x).replaceAll("starty",s.startPoint.y).replaceAll("controlx",s.startPoint.x+(s.endPoint.x-s.startPoint.x)/2-(s.endPoint.x-s.startPoint.x)/4).replaceAll("controly",s.startPoint.y+(s.endPoint.y-s.startPoint.y)/2).replaceAll("stopx",s.endPoint.x).replaceAll("stopy",s.endPoint.y)),s.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)")}let f=r.messageFont();E1(r)(s.label.text,i,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+u,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+h,s.label.width,s.label.height,{fill:o},f),s.techn&&s.techn.text!==""&&(f=r.messageFont(),E1(r)("["+s.techn.text+"]",i,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+u,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+r.messageFontSize+5+h,Math.max(s.label.width,s.techn.width),s.techn.height,{fill:o,"font-style":"italic"},f))}},"drawRels"),YDn=C(function(t,e,r){const n=t.append("g");let i=e.bgColor?e.bgColor:"none",a=e.borderColor?e.borderColor:"#444444",s=e.fontColor?e.fontColor:"black",o={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(o={"stroke-width":1});let l={x:e.x,y:e.y,fill:i,stroke:a,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:o};Mke(n,l);let u=r.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=s,E1(r)(e.label.text,n,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},u),e.type&&e.type.text!==""&&(u=r.boundaryFont(),u.fontColor=s,E1(r)(e.type.text,n,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},u)),e.descr&&e.descr.text!==""&&(u=r.boundaryFont(),u.fontSize=u.fontSize-2,u.fontColor=s,E1(r)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},u))},"drawBoundary"),qDn=C(function(t,e,r){var d;let n=e.bgColor?e.bgColor:r[e.typeC4Shape.text+"_bg_color"],i=e.borderColor?e.borderColor:r[e.typeC4Shape.text+"_border_color"],a=e.fontColor?e.fontColor:"#FFFFFF",s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(e.typeC4Shape.text){case"person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const o=t.append("g");o.attr("class","person-man");const l=tf();switch(e.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":l.x=e.x,l.y=e.y,l.fill=n,l.width=e.width,l.height=e.height,l.stroke=i,l.rx=2.5,l.ry=2.5,l.attrs={"stroke-width":.5},Mke(o,l);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2).replaceAll("height",e.height)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("width",e.width).replaceAll("half",e.height/2)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",e.x+e.width).replaceAll("starty",e.y).replaceAll("half",e.height/2));break}let u=rLn(r,e.typeC4Shape.text);switch(o.append("text").attr("fill",a).attr("font-family",u.fontFamily).attr("font-size",u.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",e.typeC4Shape.width).attr("x",e.x+e.width/2-e.typeC4Shape.width/2).attr("y",e.y+e.typeC4Shape.Y).text("<<"+e.typeC4Shape.text+">>"),e.typeC4Shape.text){case"person":case"external_person":R6t(o,48,48,e.x+e.width/2-24,e.y+e.image.Y,s);break}let h=r[e.typeC4Shape.text+"Font"]();return h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=a,E1(r)(e.label.text,o,e.x,e.y+e.label.Y,e.width,e.height,{fill:a},h),h=r[e.typeC4Shape.text+"Font"](),h.fontColor=a,e.techn&&((d=e.techn)==null?void 0:d.text)!==""?E1(r)(e.techn.text,o,e.x,e.y+e.techn.Y,e.width,e.height,{fill:a,"font-style":"italic"},h):e.type&&e.type.text!==""&&E1(r)(e.type.text,o,e.x,e.y+e.type.Y,e.width,e.height,{fill:a,"font-style":"italic"},h),e.descr&&e.descr.text!==""&&(h=r.personFont(),h.fontColor=a,E1(r)(e.descr.text,o,e.x,e.y+e.descr.Y,e.width,e.height,{fill:a},h)),e.height},"drawC4Shape"),jDn=C(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),XDn=C(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),KDn=C(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),ZDn=C(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),JDn=C(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),eLn=C(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),tLn=C(function(t,e){const n=t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);n.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),n.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),rLn=C((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"getC4ShapeFont"),E1=function(){function t(i,a,s,o,l,u,h){const d=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("text-anchor","middle").text(i);n(d,h)}C(t,"byText");function e(i,a,s,o,l,u,h,d){const{fontSize:f,fontFamily:p,fontWeight:g}=d,m=i.split(jt.lineBreakRegex);for(let v=0;v=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>D6t)&&(r=this.nextData.startx+e.margin+Br.nextLinePaddingX,i=this.nextData.stopy+e.margin*2,this.nextData.stopx=n=r+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=a=i+e.height,this.nextData.cnt=1),e.x=r,e.y=i,this.updateVal(this.data,"startx",r,Math.min),this.updateVal(this.data,"starty",i,Math.min),this.updateVal(this.data,"stopx",n,Math.max),this.updateVal(this.data,"stopy",a,Math.max),this.updateVal(this.nextData,"startx",r,Math.min),this.updateVal(this.nextData,"starty",i,Math.min),this.updateVal(this.nextData,"stopx",n,Math.max),this.updateVal(this.nextData,"stopy",a,Math.max)}init(e){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},Pke(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},C(CD,"Bounds"),CD),Pke=C(function(t){Eo(Br,t),t.fontFamily&&(Br.personFontFamily=Br.systemFontFamily=Br.messageFontFamily=t.fontFamily),t.fontSize&&(Br.personFontSize=Br.systemFontSize=Br.messageFontSize=t.fontSize),t.fontWeight&&(Br.personFontWeight=Br.systemFontWeight=Br.messageFontWeight=t.fontWeight)},"setConf"),Q9=C((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),Eee=C(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),nLn=C(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");function yp(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=f7(e[t].text,i,n),e[t].textLines=e[t].text.split(jt.lineBreakRegex).length,e[t].width=i,e[t].height=Lj(e[t].text,n);else{let a=e[t].text.split(jt.lineBreakRegex);e[t].textLines=a.length;let s=0;e[t].height=0,e[t].width=0;for(const o of a)e[t].width=Math.max(Ru(o,n),e[t].width),s=Lj(o,n),e[t].height=e[t].height+s}}C(yp,"calcC4ShapeTextWH");var M6t=C(function(t,e,r){e.x=r.data.startx,e.y=r.data.starty,e.width=r.data.stopx-r.data.startx,e.height=r.data.stopy-r.data.starty,e.label.y=Br.c4ShapeMargin-35;let n=e.wrap&&Br.wrap,i=Eee(Br);i.fontSize=i.fontSize+2,i.fontWeight="bold";let a=Ru(e.label.text,i);yp("label",e,n,i,a),z0.drawBoundary(t,e,Br)},"drawBoundary"),I6t=C(function(t,e,r,n){let i=0;for(const a of n){i=0;const s=r[a];let o=Q9(Br,s.typeC4Shape.text);switch(o.fontSize=o.fontSize-2,s.typeC4Shape.width=Ru("«"+s.typeC4Shape.text+"»",o),s.typeC4Shape.height=o.fontSize+2,s.typeC4Shape.Y=Br.c4ShapePadding,i=s.typeC4Shape.Y+s.typeC4Shape.height-4,s.image={width:0,height:0,Y:0},s.typeC4Shape.text){case"person":case"external_person":s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height;break}s.sprite&&(s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height);let l=s.wrap&&Br.wrap,u=Br.width-Br.c4ShapePadding*2,h=Q9(Br,s.typeC4Shape.text);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",yp("label",s,l,h,u),s.label.Y=i+8,i=s.label.Y+s.label.height,s.type&&s.type.text!==""){s.type.text="["+s.type.text+"]";let p=Q9(Br,s.typeC4Shape.text);yp("type",s,l,p,u),s.type.Y=i+5,i=s.type.Y+s.type.height}else if(s.techn&&s.techn.text!==""){s.techn.text="["+s.techn.text+"]";let p=Q9(Br,s.techn.text);yp("techn",s,l,p,u),s.techn.Y=i+5,i=s.techn.Y+s.techn.height}let d=i,f=s.label.width;if(s.descr&&s.descr.text!==""){let p=Q9(Br,s.typeC4Shape.text);yp("descr",s,l,p,u),s.descr.Y=i+20,i=s.descr.Y+s.descr.height,f=Math.max(s.label.width,s.descr.width),d=i-s.descr.textLines*5}f=f+Br.c4ShapePadding,s.width=Math.max(s.width||Br.width,f,Br.width),s.height=Math.max(s.height||Br.height,d,Br.height),s.margin=s.margin||Br.c4ShapeMargin,t.insert(s),z0.drawC4Shape(e,s,Br)}t.bumpLastMargin(Br.c4ShapeMargin)},"drawC4ShapeArray"),bp=(OD=class{constructor(e,r){this.x=e,this.y=r}},C(OD,"Point"),OD),P6t=C(function(t,e){let r=t.x,n=t.y,i=e.x,a=e.y,s=r+t.width/2,o=n+t.height/2,l=Math.abs(r-i),u=Math.abs(n-a),h=u/l,d=t.height/t.width,f=null;return n==a&&ri?f=new bp(r,o):r==i&&na&&(f=new bp(s,n)),r>i&&n=h?f=new bp(r,o+h*t.width/2):f=new bp(s-l/u*t.height/2,n+t.height):r=h?f=new bp(r+t.width,o+h*t.width/2):f=new bp(s+l/u*t.height/2,n+t.height):ra?d>=h?f=new bp(r+t.width,o-h*t.width/2):f=new bp(s+t.height/2*l/u,n):r>i&&n>a&&(d>=h?f=new bp(r,o-t.width/2*h):f=new bp(s-t.height/2*l/u,n)),f},"getIntersectPoint"),iLn=C(function(t,e){let r={x:0,y:0};r.x=e.x+e.width/2,r.y=e.y+e.height/2;let n=P6t(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=P6t(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),aLn=C(function(t,e,r,n,i){let a=0;for(let s of e){a=a+1;let o=s.wrap&&Br.wrap,l=nLn(Br);n.db.getC4Type()==="C4Dynamic"&&(s.label.text=a+": "+s.label.text);let h=Ru(s.label.text,l);yp("label",s,o,l,h),s.techn&&s.techn.text!==""&&(h=Ru(s.techn.text,l),yp("techn",s,o,l,h)),s.descr&&s.descr.text!==""&&(h=Ru(s.descr.text,l),yp("descr",s,o,l,h));let d=r(s.from),f=r(s.to),p=iLn(d,f);s.startPoint=p.startPoint,s.endPoint=p.endPoint}z0.drawRels(t,e,Br,i)},"drawRels");function Nke(t,e,r,n,i){let a=new L6t(i);a.data.widthLimit=r.data.widthLimit/Math.min(Ike,n.length);for(let[s,o]of n.entries()){let l=0;o.image={width:0,height:0,Y:0},o.sprite&&(o.image.width=48,o.image.height=48,o.image.Y=l,l=o.image.Y+o.image.height);let u=o.wrap&&Br.wrap,h=Eee(Br);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",yp("label",o,u,h,a.data.widthLimit),o.label.Y=l+8,l=o.label.Y+o.label.height,o.type&&o.type.text!==""){o.type.text="["+o.type.text+"]";let g=Eee(Br);yp("type",o,u,g,a.data.widthLimit),o.type.Y=l+5,l=o.type.Y+o.type.height}if(o.descr&&o.descr.text!==""){let g=Eee(Br);g.fontSize=g.fontSize-2,yp("descr",o,u,g,a.data.widthLimit),o.descr.Y=l+20,l=o.descr.Y+o.descr.height}if(s==0||s%Ike===0){let g=r.data.startx+Br.diagramMarginX,m=r.data.stopy+Br.diagramMarginY+l;a.setData(g,g,m,m)}else{let g=a.data.stopx!==a.data.startx?a.data.stopx+Br.diagramMarginX:a.data.startx,m=a.data.starty;a.setData(g,g,m,m)}a.name=o.alias;let d=i.db.getC4ShapeArray(o.alias),f=i.db.getC4ShapeKeys(o.alias);f.length>0&&I6t(a,t,d,f),e=o.alias;let p=i.db.getBoundaries(e);p.length>0&&Nke(t,e,a,p,i),o.alias!=="global"&&M6t(t,o,a),r.data.stopy=Math.max(a.data.stopy+Br.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(a.data.stopx+Br.c4ShapeMargin,r.data.stopx),Oee=Math.max(Oee,r.data.stopx),kee=Math.max(kee,r.data.stopy)}}C(Nke,"drawInsideBoundary");var sLn=C(function(t,e,r,n){Br=He().c4;const i=He().securityLevel;let a;i==="sandbox"&&(a=Ot("#i"+e));const s=Ot(i==="sandbox"?a.nodes()[0].contentDocument.body:"body");let o=n.db;n.db.setWrap(Br.wrap),D6t=o.getC4ShapeInRow(),Ike=o.getC4BoundaryInRow(),me.debug(`C:${JSON.stringify(Br,null,2)}`);const l=i==="sandbox"?s.select(`[id="${e}"]`):Ot(`[id="${e}"]`);z0.insertComputerIcon(l,e),z0.insertDatabaseIcon(l,e),z0.insertClockIcon(l,e);let u=new L6t(n);u.setData(Br.diagramMarginX,Br.diagramMarginX,Br.diagramMarginY,Br.diagramMarginY),u.data.widthLimit=screen.availWidth,Oee=Br.diagramMarginX,kee=Br.diagramMarginY;const h=n.db.getTitle();let d=n.db.getBoundaries("");Nke(l,"",u,d,n),z0.insertArrowHead(l,e),z0.insertArrowEnd(l,e),z0.insertArrowCrossHead(l,e),z0.insertArrowFilledHead(l,e),aLn(l,n.db.getRels(),n.db.getC4Shape,n,e),u.data.stopx=Oee,u.data.stopy=kee;const f=u.data;let g=f.stopy-f.starty+2*Br.diagramMarginY;const v=f.stopx-f.startx+2*Br.diagramMarginX;h&&l.append("text").text(h).attr("x",(f.stopx-f.startx)/2-4*Br.diagramMarginX).attr("y",f.starty+Br.diagramMarginY),zs(l,g,v,Br.useMaxWidth);const y=h?60:0;l.attr("viewBox",f.startx-Br.diagramMarginX+" -"+(Br.diagramMarginY+y)+" "+v+" "+(g+y)),me.debug("models:",f)},"draw"),N6t={drawPersonOrSystemArray:I6t,drawBoundary:M6t,setConf:Pke,draw:sLn},oLn=C(t=>`.person { +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var qe=this.next();return qe||this.lex()},"lex"),begin:C(function(qe){this.conditionStack.push(qe)},"begin"),popState:C(function(){var qe=this.conditionStack.length-1;return qe>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(qe){return qe=this.conditionStack.length-1-Math.abs(qe||0),qe>=0?this.conditionStack[qe]:"INITIAL"},"topState"),pushState:C(function(qe){this.begin(qe)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:C(function(qe,K,ce,be){switch(ce){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[65,66,67,68],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return Te}();Se.lexer=ge;function Qe(){this.yy={}}return C(Qe,"Parser"),Qe.prototype=Se,Se.Parser=Qe,new Qe}();See.parser=See;var vDn=See,Sg=[],q2=[""],Yu="global",Tg="",F0=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],V9=[],Rke="",Dke=!1,Tee=4,Cee=2,k6t,yDn=C(function(){return k6t},"getC4Type"),bDn=C(function(t){k6t=ai(t,He())},"setC4Type"),xDn=C(function(t,e,r,n,i,a,s,o,l){if(t==null||e===void 0||e===null||r===void 0||r===null||n===void 0||n===null)return;let u={};const h=V9.find(d=>d.from===e&&d.to===r);if(h?u=h:V9.push(u),u.type=t,u.from=e,u.to=r,u.label={text:n},i==null)u.techn={text:""};else if(typeof i=="object"){let[d,f]=Object.entries(i)[0];u[d]={text:f}}else u.techn={text:i};if(a==null)u.descr={text:""};else if(typeof a=="object"){let[d,f]=Object.entries(a)[0];u[d]={text:f}}else u.descr={text:a};if(typeof s=="object"){let[d,f]=Object.entries(s)[0];u[d]=f}else u.sprite=s;if(typeof o=="object"){let[d,f]=Object.entries(o)[0];u[d]=f}else u.tags=o;if(typeof l=="object"){let[d,f]=Object.entries(l)[0];u[d]=f}else u.link=l;u.wrap=j2()},"addRel"),wDn=C(function(t,e,r,n,i,a,s){if(e===null||r===null)return;let o={};const l=Sg.find(u=>u.alias===e);if(l&&e===l.alias?o=l:(o.alias=e,Sg.push(o)),r==null?o.label={text:""}:o.label={text:r},n==null)o.descr={text:""};else if(typeof n=="object"){let[u,h]=Object.entries(n)[0];o[u]={text:h}}else o.descr={text:n};if(typeof i=="object"){let[u,h]=Object.entries(i)[0];o[u]=h}else o.sprite=i;if(typeof a=="object"){let[u,h]=Object.entries(a)[0];o[u]=h}else o.tags=a;if(typeof s=="object"){let[u,h]=Object.entries(s)[0];o[u]=h}else o.link=s;o.typeC4Shape={text:t},o.parentBoundary=Yu,o.wrap=j2()},"addPersonOrSystem"),ADn=C(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=Sg.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,Sg.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.sprite=a;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=j2(),l.typeC4Shape={text:t},l.parentBoundary=Yu},"addContainer"),SDn=C(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=Sg.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,Sg.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.sprite=a;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=j2(),l.typeC4Shape={text:t},l.parentBoundary=Yu},"addComponent"),TDn=C(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=F0.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,F0.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"system"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];a[o]={text:l}}else a.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];a[o]=l}else a.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];a[o]=l}else a.link=i;a.parentBoundary=Yu,a.wrap=j2(),Tg=Yu,Yu=t,q2.push(Tg)},"addPersonOrSystemBoundary"),CDn=C(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=F0.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,F0.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"container"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];a[o]={text:l}}else a.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];a[o]=l}else a.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];a[o]=l}else a.link=i;a.parentBoundary=Yu,a.wrap=j2(),Tg=Yu,Yu=t,q2.push(Tg)},"addContainerBoundary"),ODn=C(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=F0.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,F0.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.type={text:"node"};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.type={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.nodeType=t,l.parentBoundary=Yu,l.wrap=j2(),Tg=Yu,Yu=e,q2.push(Tg)},"addDeploymentNode"),kDn=C(function(){Yu=Tg,q2.pop(),Tg=q2.pop(),q2.push(Tg)},"popBoundaryParseStack"),EDn=C(function(t,e,r,n,i,a,s,o,l,u,h){let d=Sg.find(f=>f.alias===e);if(!(d===void 0&&(d=F0.find(f=>f.alias===e),d===void 0))){if(r!=null)if(typeof r=="object"){let[f,p]=Object.entries(r)[0];d[f]=p}else d.bgColor=r;if(n!=null)if(typeof n=="object"){let[f,p]=Object.entries(n)[0];d[f]=p}else d.fontColor=n;if(i!=null)if(typeof i=="object"){let[f,p]=Object.entries(i)[0];d[f]=p}else d.borderColor=i;if(a!=null)if(typeof a=="object"){let[f,p]=Object.entries(a)[0];d[f]=p}else d.shadowing=a;if(s!=null)if(typeof s=="object"){let[f,p]=Object.entries(s)[0];d[f]=p}else d.shape=s;if(o!=null)if(typeof o=="object"){let[f,p]=Object.entries(o)[0];d[f]=p}else d.sprite=o;if(l!=null)if(typeof l=="object"){let[f,p]=Object.entries(l)[0];d[f]=p}else d.techn=l;if(u!=null)if(typeof u=="object"){let[f,p]=Object.entries(u)[0];d[f]=p}else d.legendText=u;if(h!=null)if(typeof h=="object"){let[f,p]=Object.entries(h)[0];d[f]=p}else d.legendSprite=h}},"updateElStyle"),_Dn=C(function(t,e,r,n,i,a,s){const o=V9.find(l=>l.from===e&&l.to===r);if(o!==void 0){if(n!=null)if(typeof n=="object"){let[l,u]=Object.entries(n)[0];o[l]=u}else o.textColor=n;if(i!=null)if(typeof i=="object"){let[l,u]=Object.entries(i)[0];o[l]=u}else o.lineColor=i;if(a!=null)if(typeof a=="object"){let[l,u]=Object.entries(a)[0];o[l]=parseInt(u)}else o.offsetX=parseInt(a);if(s!=null)if(typeof s=="object"){let[l,u]=Object.entries(s)[0];o[l]=parseInt(u)}else o.offsetY=parseInt(s)}},"updateRelStyle"),RDn=C(function(t,e,r){let n=Tee,i=Cee;if(typeof e=="object"){const a=Object.values(e)[0];n=parseInt(a)}else n=parseInt(e);if(typeof r=="object"){const a=Object.values(r)[0];i=parseInt(a)}else i=parseInt(r);n>=1&&(Tee=n),i>=1&&(Cee=i)},"updateLayoutConfig"),DDn=C(function(){return Tee},"getC4ShapeInRow"),LDn=C(function(){return Cee},"getC4BoundaryInRow"),MDn=C(function(){return Yu},"getCurrentBoundaryParse"),IDn=C(function(){return Tg},"getParentBoundaryParse"),E6t=C(function(t){return t==null?Sg:Sg.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),PDn=C(function(t){return Sg.find(e=>e.alias===t)},"getC4Shape"),NDn=C(function(t){return Object.keys(E6t(t))},"getC4ShapeKeys"),_6t=C(function(t){return t==null?F0:F0.filter(e=>e.parentBoundary===t)},"getBoundaries"),BDn=_6t,$Dn=C(function(){return V9},"getRels"),FDn=C(function(){return Rke},"getTitle"),zDn=C(function(t){Dke=t},"setWrap"),j2=C(function(){return Dke},"autoWrap"),UDn=C(function(){Sg=[],F0=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Tg="",Yu="global",q2=[""],V9=[],q2=[""],Rke="",Dke=!1,Tee=4,Cee=2},"clear"),VDn={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},QDn={FILLED:0,OPEN:1},GDn={LEFTOF:0,RIGHTOF:1,OVER:2},HDn=C(function(t){Rke=ai(t,He())},"setTitle"),Lke={addPersonOrSystem:wDn,addPersonOrSystemBoundary:TDn,addContainer:ADn,addContainerBoundary:CDn,addComponent:SDn,addDeploymentNode:ODn,popBoundaryParseStack:kDn,addRel:xDn,updateElStyle:EDn,updateRelStyle:_Dn,updateLayoutConfig:RDn,autoWrap:j2,setWrap:zDn,getC4ShapeArray:E6t,getC4Shape:PDn,getC4ShapeKeys:NDn,getBoundaries:_6t,getBoundarys:BDn,getCurrentBoundaryParse:MDn,getParentBoundaryParse:IDn,getRels:$Dn,getTitle:FDn,getC4Type:yDn,getC4ShapeInRow:DDn,getC4BoundaryInRow:LDn,setAccTitle:Da,getAccTitle:Ja,getAccDescription:ts,setAccDescription:es,getConfig:C(()=>He().c4,"getConfig"),clear:UDn,LINETYPE:VDn,ARROWTYPE:QDn,PLACEMENT:GDn,setTitle:HDn,setC4Type:bDn},Mke=C(function(t,e){return Aee(t,e)},"drawRect"),R6t=C(function(t,e,r,n,i,a){const s=t.append("image");s.attr("width",e),s.attr("height",r),s.attr("x",n),s.attr("y",i);let o=a.startsWith("data:image/png;base64")?a:_T(a);s.attr("xlink:href",o)},"drawImage"),WDn=C((t,e,r,n)=>{const i=t.append("g");let a=0;for(let s of e){let o=s.textColor?s.textColor:"#444444",l=s.lineColor?s.lineColor:"#444444",u=s.offsetX?parseInt(s.offsetX):0,h=s.offsetY?parseInt(s.offsetY):0,d="";if(a===0){let p=i.append("line");p.attr("x1",s.startPoint.x),p.attr("y1",s.startPoint.y),p.attr("x2",s.endPoint.x),p.attr("y2",s.endPoint.y),p.attr("stroke-width","1"),p.attr("stroke",l),p.style("fill","none"),s.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)"),a=-1}else{let p=i.append("path");p.attr("fill","none").attr("stroke-width","1").attr("stroke",l).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",s.startPoint.x).replaceAll("starty",s.startPoint.y).replaceAll("controlx",s.startPoint.x+(s.endPoint.x-s.startPoint.x)/2-(s.endPoint.x-s.startPoint.x)/4).replaceAll("controly",s.startPoint.y+(s.endPoint.y-s.startPoint.y)/2).replaceAll("stopx",s.endPoint.x).replaceAll("stopy",s.endPoint.y)),s.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)")}let f=r.messageFont();E1(r)(s.label.text,i,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+u,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+h,s.label.width,s.label.height,{fill:o},f),s.techn&&s.techn.text!==""&&(f=r.messageFont(),E1(r)("["+s.techn.text+"]",i,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+u,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+r.messageFontSize+5+h,Math.max(s.label.width,s.techn.width),s.techn.height,{fill:o,"font-style":"italic"},f))}},"drawRels"),YDn=C(function(t,e,r){const n=t.append("g");let i=e.bgColor?e.bgColor:"none",a=e.borderColor?e.borderColor:"#444444",s=e.fontColor?e.fontColor:"black",o={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(o={"stroke-width":1});let l={x:e.x,y:e.y,fill:i,stroke:a,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:o};Mke(n,l);let u=r.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=s,E1(r)(e.label.text,n,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},u),e.type&&e.type.text!==""&&(u=r.boundaryFont(),u.fontColor=s,E1(r)(e.type.text,n,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},u)),e.descr&&e.descr.text!==""&&(u=r.boundaryFont(),u.fontSize=u.fontSize-2,u.fontColor=s,E1(r)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},u))},"drawBoundary"),qDn=C(function(t,e,r){var d;let n=e.bgColor?e.bgColor:r[e.typeC4Shape.text+"_bg_color"],i=e.borderColor?e.borderColor:r[e.typeC4Shape.text+"_border_color"],a=e.fontColor?e.fontColor:"#FFFFFF",s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(e.typeC4Shape.text){case"person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const o=t.append("g");o.attr("class","person-man");const l=tf();switch(e.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":l.x=e.x,l.y=e.y,l.fill=n,l.width=e.width,l.height=e.height,l.stroke=i,l.rx=2.5,l.ry=2.5,l.attrs={"stroke-width":.5},Mke(o,l);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2).replaceAll("height",e.height)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("width",e.width).replaceAll("half",e.height/2)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",e.x+e.width).replaceAll("starty",e.y).replaceAll("half",e.height/2));break}let u=rLn(r,e.typeC4Shape.text);switch(o.append("text").attr("fill",a).attr("font-family",u.fontFamily).attr("font-size",u.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",e.typeC4Shape.width).attr("x",e.x+e.width/2-e.typeC4Shape.width/2).attr("y",e.y+e.typeC4Shape.Y).text("<<"+e.typeC4Shape.text+">>"),e.typeC4Shape.text){case"person":case"external_person":R6t(o,48,48,e.x+e.width/2-24,e.y+e.image.Y,s);break}let h=r[e.typeC4Shape.text+"Font"]();return h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=a,E1(r)(e.label.text,o,e.x,e.y+e.label.Y,e.width,e.height,{fill:a},h),h=r[e.typeC4Shape.text+"Font"](),h.fontColor=a,e.techn&&((d=e.techn)==null?void 0:d.text)!==""?E1(r)(e.techn.text,o,e.x,e.y+e.techn.Y,e.width,e.height,{fill:a,"font-style":"italic"},h):e.type&&e.type.text!==""&&E1(r)(e.type.text,o,e.x,e.y+e.type.Y,e.width,e.height,{fill:a,"font-style":"italic"},h),e.descr&&e.descr.text!==""&&(h=r.personFont(),h.fontColor=a,E1(r)(e.descr.text,o,e.x,e.y+e.descr.Y,e.width,e.height,{fill:a},h)),e.height},"drawC4Shape"),jDn=C(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),XDn=C(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),KDn=C(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),ZDn=C(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),JDn=C(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),eLn=C(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),tLn=C(function(t,e){const n=t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);n.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),n.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),rLn=C((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"getC4ShapeFont"),E1=function(){function t(i,a,s,o,l,u,h){const d=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("text-anchor","middle").text(i);n(d,h)}C(t,"byText");function e(i,a,s,o,l,u,h,d){const{fontSize:f,fontFamily:p,fontWeight:g}=d,m=i.split(jt.lineBreakRegex);for(let v=0;v=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>D6t)&&(r=this.nextData.startx+e.margin+Br.nextLinePaddingX,i=this.nextData.stopy+e.margin*2,this.nextData.stopx=n=r+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=a=i+e.height,this.nextData.cnt=1),e.x=r,e.y=i,this.updateVal(this.data,"startx",r,Math.min),this.updateVal(this.data,"starty",i,Math.min),this.updateVal(this.data,"stopx",n,Math.max),this.updateVal(this.data,"stopy",a,Math.max),this.updateVal(this.nextData,"startx",r,Math.min),this.updateVal(this.nextData,"starty",i,Math.min),this.updateVal(this.nextData,"stopx",n,Math.max),this.updateVal(this.nextData,"stopy",a,Math.max)}init(e){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},Pke(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},C(CD,"Bounds"),CD),Pke=C(function(t){Eo(Br,t),t.fontFamily&&(Br.personFontFamily=Br.systemFontFamily=Br.messageFontFamily=t.fontFamily),t.fontSize&&(Br.personFontSize=Br.systemFontSize=Br.messageFontSize=t.fontSize),t.fontWeight&&(Br.personFontWeight=Br.systemFontWeight=Br.messageFontWeight=t.fontWeight)},"setConf"),Q9=C((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),Eee=C(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),nLn=C(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");function yp(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=f7(e[t].text,i,n),e[t].textLines=e[t].text.split(jt.lineBreakRegex).length,e[t].width=i,e[t].height=Lj(e[t].text,n);else{let a=e[t].text.split(jt.lineBreakRegex);e[t].textLines=a.length;let s=0;e[t].height=0,e[t].width=0;for(const o of a)e[t].width=Math.max(Ru(o,n),e[t].width),s=Lj(o,n),e[t].height=e[t].height+s}}C(yp,"calcC4ShapeTextWH");var M6t=C(function(t,e,r){e.x=r.data.startx,e.y=r.data.starty,e.width=r.data.stopx-r.data.startx,e.height=r.data.stopy-r.data.starty,e.label.y=Br.c4ShapeMargin-35;let n=e.wrap&&Br.wrap,i=Eee(Br);i.fontSize=i.fontSize+2,i.fontWeight="bold";let a=Ru(e.label.text,i);yp("label",e,n,i,a),z0.drawBoundary(t,e,Br)},"drawBoundary"),I6t=C(function(t,e,r,n){let i=0;for(const a of n){i=0;const s=r[a];let o=Q9(Br,s.typeC4Shape.text);switch(o.fontSize=o.fontSize-2,s.typeC4Shape.width=Ru("«"+s.typeC4Shape.text+"»",o),s.typeC4Shape.height=o.fontSize+2,s.typeC4Shape.Y=Br.c4ShapePadding,i=s.typeC4Shape.Y+s.typeC4Shape.height-4,s.image={width:0,height:0,Y:0},s.typeC4Shape.text){case"person":case"external_person":s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height;break}s.sprite&&(s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height);let l=s.wrap&&Br.wrap,u=Br.width-Br.c4ShapePadding*2,h=Q9(Br,s.typeC4Shape.text);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",yp("label",s,l,h,u),s.label.Y=i+8,i=s.label.Y+s.label.height,s.type&&s.type.text!==""){s.type.text="["+s.type.text+"]";let p=Q9(Br,s.typeC4Shape.text);yp("type",s,l,p,u),s.type.Y=i+5,i=s.type.Y+s.type.height}else if(s.techn&&s.techn.text!==""){s.techn.text="["+s.techn.text+"]";let p=Q9(Br,s.techn.text);yp("techn",s,l,p,u),s.techn.Y=i+5,i=s.techn.Y+s.techn.height}let d=i,f=s.label.width;if(s.descr&&s.descr.text!==""){let p=Q9(Br,s.typeC4Shape.text);yp("descr",s,l,p,u),s.descr.Y=i+20,i=s.descr.Y+s.descr.height,f=Math.max(s.label.width,s.descr.width),d=i-s.descr.textLines*5}f=f+Br.c4ShapePadding,s.width=Math.max(s.width||Br.width,f,Br.width),s.height=Math.max(s.height||Br.height,d,Br.height),s.margin=s.margin||Br.c4ShapeMargin,t.insert(s),z0.drawC4Shape(e,s,Br)}t.bumpLastMargin(Br.c4ShapeMargin)},"drawC4ShapeArray"),bp=(OD=class{constructor(e,r){this.x=e,this.y=r}},C(OD,"Point"),OD),P6t=C(function(t,e){let r=t.x,n=t.y,i=e.x,a=e.y,s=r+t.width/2,o=n+t.height/2,l=Math.abs(r-i),u=Math.abs(n-a),h=u/l,d=t.height/t.width,f=null;return n==a&&ri?f=new bp(r,o):r==i&&na&&(f=new bp(s,n)),r>i&&n=h?f=new bp(r,o+h*t.width/2):f=new bp(s-l/u*t.height/2,n+t.height):r=h?f=new bp(r+t.width,o+h*t.width/2):f=new bp(s+l/u*t.height/2,n+t.height):ra?d>=h?f=new bp(r+t.width,o-h*t.width/2):f=new bp(s+t.height/2*l/u,n):r>i&&n>a&&(d>=h?f=new bp(r,o-t.width/2*h):f=new bp(s-t.height/2*l/u,n)),f},"getIntersectPoint"),iLn=C(function(t,e){let r={x:0,y:0};r.x=e.x+e.width/2,r.y=e.y+e.height/2;let n=P6t(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=P6t(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),aLn=C(function(t,e,r,n,i){let a=0;for(let s of e){a=a+1;let o=s.wrap&&Br.wrap,l=nLn(Br);n.db.getC4Type()==="C4Dynamic"&&(s.label.text=a+": "+s.label.text);let h=Ru(s.label.text,l);yp("label",s,o,l,h),s.techn&&s.techn.text!==""&&(h=Ru(s.techn.text,l),yp("techn",s,o,l,h)),s.descr&&s.descr.text!==""&&(h=Ru(s.descr.text,l),yp("descr",s,o,l,h));let d=r(s.from),f=r(s.to),p=iLn(d,f);s.startPoint=p.startPoint,s.endPoint=p.endPoint}z0.drawRels(t,e,Br,i)},"drawRels");function Nke(t,e,r,n,i){let a=new L6t(i);a.data.widthLimit=r.data.widthLimit/Math.min(Ike,n.length);for(let[s,o]of n.entries()){let l=0;o.image={width:0,height:0,Y:0},o.sprite&&(o.image.width=48,o.image.height=48,o.image.Y=l,l=o.image.Y+o.image.height);let u=o.wrap&&Br.wrap,h=Eee(Br);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",yp("label",o,u,h,a.data.widthLimit),o.label.Y=l+8,l=o.label.Y+o.label.height,o.type&&o.type.text!==""){o.type.text="["+o.type.text+"]";let g=Eee(Br);yp("type",o,u,g,a.data.widthLimit),o.type.Y=l+5,l=o.type.Y+o.type.height}if(o.descr&&o.descr.text!==""){let g=Eee(Br);g.fontSize=g.fontSize-2,yp("descr",o,u,g,a.data.widthLimit),o.descr.Y=l+20,l=o.descr.Y+o.descr.height}if(s==0||s%Ike===0){let g=r.data.startx+Br.diagramMarginX,m=r.data.stopy+Br.diagramMarginY+l;a.setData(g,g,m,m)}else{let g=a.data.stopx!==a.data.startx?a.data.stopx+Br.diagramMarginX:a.data.startx,m=a.data.starty;a.setData(g,g,m,m)}a.name=o.alias;let d=i.db.getC4ShapeArray(o.alias),f=i.db.getC4ShapeKeys(o.alias);f.length>0&&I6t(a,t,d,f),e=o.alias;let p=i.db.getBoundaries(e);p.length>0&&Nke(t,e,a,p,i),o.alias!=="global"&&M6t(t,o,a),r.data.stopy=Math.max(a.data.stopy+Br.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(a.data.stopx+Br.c4ShapeMargin,r.data.stopx),Oee=Math.max(Oee,r.data.stopx),kee=Math.max(kee,r.data.stopy)}}C(Nke,"drawInsideBoundary");var sLn=C(function(t,e,r,n){Br=He().c4;const i=He().securityLevel;let a;i==="sandbox"&&(a=Ot("#i"+e));const s=Ot(i==="sandbox"?a.nodes()[0].contentDocument.body:"body");let o=n.db;n.db.setWrap(Br.wrap),D6t=o.getC4ShapeInRow(),Ike=o.getC4BoundaryInRow(),me.debug(`C:${JSON.stringify(Br,null,2)}`);const l=i==="sandbox"?s.select(`[id="${e}"]`):Ot(`[id="${e}"]`);z0.insertComputerIcon(l,e),z0.insertDatabaseIcon(l,e),z0.insertClockIcon(l,e);let u=new L6t(n);u.setData(Br.diagramMarginX,Br.diagramMarginX,Br.diagramMarginY,Br.diagramMarginY),u.data.widthLimit=screen.availWidth,Oee=Br.diagramMarginX,kee=Br.diagramMarginY;const h=n.db.getTitle();let d=n.db.getBoundaries("");Nke(l,"",u,d,n),z0.insertArrowHead(l,e),z0.insertArrowEnd(l,e),z0.insertArrowCrossHead(l,e),z0.insertArrowFilledHead(l,e),aLn(l,n.db.getRels(),n.db.getC4Shape,n,e),u.data.stopx=Oee,u.data.stopy=kee;const f=u.data;let g=f.stopy-f.starty+2*Br.diagramMarginY;const v=f.stopx-f.startx+2*Br.diagramMarginX;h&&l.append("text").text(h).attr("x",(f.stopx-f.startx)/2-4*Br.diagramMarginX).attr("y",f.starty+Br.diagramMarginY),zs(l,g,v,Br.useMaxWidth);const y=h?60:0;l.attr("viewBox",f.startx-Br.diagramMarginX+" -"+(Br.diagramMarginY+y)+" "+v+" "+(g+y)),me.debug("models:",f)},"draw"),N6t={drawPersonOrSystemArray:I6t,drawBoundary:M6t,setConf:Pke,draw:sLn},oLn=C(t=>`.person { stroke: ${t.personBorder}; fill: ${t.personBkg}; } @@ -1319,7 +1319,7 @@ Expecting `+Ft.join(", ")+", got '"+(this.terminals_[lt]||lt)+"'":gt="Parse erro overflow: visible; vertical-align: -0.125em; } - + .node .label-icon path { fill: currentColor; stroke: revert; @@ -1333,12 +1333,12 @@ Expecting `+Ft.join(", ")+", got '"+(this.terminals_[lt]||lt)+"'":gt="Parse erro Initialize mermaid with maxEdges set to a higher number to allow more edges. You cannot set this config via configuration inside the diagram as it is a secure config. -You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,r,n){const i=this.isLinkData(n)?n.id.replace("@",""):void 0;me.info("addLink",e,r,i);for(const a of e)for(const s of r){const o=a===e[e.length-1],l=s===r[0];o&&l?this.addSingleLink(a,s,n,i):this.addSingleLink(a,s,n,void 0)}}updateLinkInterpolate(e,r){e.forEach(n=>{n==="default"?this.edges.defaultInterpolate=r:this.edges[n].interpolate=r})}updateLink(e,r){e.forEach(n=>{var i,a,s,o,l,u;if(typeof n=="number"&&n>=this.edges.length)throw new Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);n==="default"?this.edges.defaultStyle=r:(this.edges[n].style=r,(((a=(i=this.edges[n])==null?void 0:i.style)==null?void 0:a.length)??0)>0&&!((o=(s=this.edges[n])==null?void 0:s.style)!=null&&o.some(h=>h==null?void 0:h.startsWith("fill")))&&((u=(l=this.edges[n])==null?void 0:l.style)==null||u.push("fill:none")))})}addClass(e,r){const n=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(i=>{let a=this.classes.get(i);a===void 0&&(a={id:i,styles:[],textStyles:[]},this.classes.set(i,a)),n!=null&&n.forEach(s=>{if(/color/.exec(s)){const o=s.replace("fill","bgFill");a.textStyles.push(o)}a.styles.push(s)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,r){for(const n of e.split(",")){const i=this.vertices.get(n);i&&i.classes.push(r);const a=this.edges.find(o=>o.id===n);a&&a.classes.push(r);const s=this.subGraphLookup.get(n);s&&s.classes.push(r)}}setTooltip(e,r){if(r!==void 0){r=this.sanitizeText(r);for(const n of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,r)}}setClickFun(e,r,n){if(He().securityLevel!=="loose"||r===void 0)return;let i=[];if(typeof n=="string"){i=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let s=0;s{const s=this.lookUpDomId(e),o=document.querySelector(`[id="${s}"]`);o!==null&&o.addEventListener("click",()=>{ln.runFunc(r,...i)},!1)}))}setLink(e,r,n){e.split(",").forEach(i=>{const a=this.vertices.get(i);a!==void 0&&(a.link=ln.formatUrl(r,this.config),a.linkTarget=n)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFun(i,r,n)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirection(){var e;return(e=this.direction)==null?void 0:e.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){const r=_ke();Ot(e).select("svg").selectAll("g.node").on("mouseover",a=>{var u;const s=Ot(a.currentTarget),o=s.attr("title");if(o===null)return;const l=(u=a.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(s.attr("title")).style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(Oy.sanitize(o)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),Ot(a.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=He(),Aa()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,n){let i=e.text.trim(),a=n.text;e===n&&/\s/.exec(n.text)&&(i=void 0);const o=C(g=>{const m={boolean:{},number:{},string:{}},v=[];let y;return{nodeList:g.filter(function(x){const w=typeof x;return x.stmt&&x.stmt==="dir"?(y=x.value,!1):x.trim()===""?!1:w in m?m[w].hasOwnProperty(x)?!1:m[w][x]=!0:v.includes(x)?!1:v.push(x)}),dir:y}},"uniq")(r.flat()),l=o.nodeList,u=o.dir,h=u!==void 0,d=He().flowchart??{},f=u??(d.inheritDir?this.getDirection()??He().direction??void 0:void 0);if(this.version==="gen-1")for(let g=0;g2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===e)return{result:!0,count:0};let i=0,a=1;for(;i=0){const o=this.indexNodes2(e,s);if(o.result)return{result:!0,count:a+o.count};a=a+o.count}i=i+1}return{result:!1,count:a}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let r=e.trim(),n="arrow_open";switch(r[0]){case"<":n="arrow_point",r=r.slice(1);break;case"x":n="arrow_cross",r=r.slice(1);break;case"o":n="arrow_circle",r=r.slice(1);break}let i="normal";return r.includes("=")&&(i="thick"),r.includes(".")&&(i="dotted"),{type:n,stroke:i}}countChar(e,r){const n=r.length;let i=0;for(let a=0;a":i="arrow_point",r.startsWith("<")&&(i="double_"+i,n=n.slice(1));break;case"o":i="arrow_circle",r.startsWith("o")&&(i="double_"+i,n=n.slice(1));break}let a="normal",s=n.length-1;n.startsWith("=")&&(a="thick"),n.startsWith("~")&&(a="invisible");const o=this.countChar(".",n);return o&&(a="dotted",s=o),{type:i,stroke:a,length:s}}destructLink(e,r){const n=this.destructEndLink(e);let i;if(r){if(i=this.destructStartLink(r),i.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};if(i.type==="arrow_open")i.type=n.type;else{if(i.type!==n.type)return{type:"INVALID",stroke:"INVALID"};i.type="double_"+i.type}return i.type==="double_arrow"&&(i.type="double_arrow_point"),i.length=n.length,i}return n}exists(e,r){for(const n of e)if(n.nodes.includes(r))return!0;return!1}makeUniq(e,r){const n=[];return e.nodes.forEach((i,a)=>{this.exists(r,i)||n.push(e.nodes[a])}),{nodes:n}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,r){return e.find(n=>n.id===r)}destructEdgeType(e){let r="none",n="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":n=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=e.replace("double_",""),n=r;break}return{arrowTypeStart:r,arrowTypeEnd:n}}addNodeFromVertex(e,r,n,i,a,s){var h;const o=n.get(e.id),l=i.get(e.id)??!1,u=this.findNode(r,e.id);if(u)u.cssStyles=e.styles,u.cssCompiledStyles=this.getCompiledStyles(e.classes),u.cssClasses=e.classes.join(" ");else{const d={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:o,padding:((h=a.flowchart)==null?void 0:h.padding)||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:s,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};l?r.push({...d,isGroup:!0,shape:"rect"}):r.push({...d,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}getData(){const e=He(),r=[],n=[],i=this.getSubGraphs(),a=new Map,s=new Map;for(let u=i.length-1;u>=0;u--){const h=i[u];h.nodes.length>0&&s.set(h.id,!0);for(const d of h.nodes)a.set(d,h.id)}for(let u=i.length-1;u>=0;u--){const h=i[u];r.push({id:h.id,label:h.title,labelStyle:"",labelType:h.labelType,parentId:a.get(h.id),padding:8,cssCompiledStyles:this.getCompiledStyles(h.classes),cssClasses:h.classes.join(" "),shape:"rect",dir:h.dir==="TD"?"TB":h.dir,explicitDir:h.hasExplicitDir,isGroup:!0,look:e.look})}this.getVertices().forEach(u=>{this.addNodeFromVertex(u,r,a,s,e,e.look||"classic")});const l=this.getEdges();return l.forEach((u,h)=>{var m;const{arrowTypeStart:d,arrowTypeEnd:f}=this.destructEdgeType(u.type),p=[...l.defaultStyle??[]];u.style&&p.push(...u.style);const g={id:Y5(u.start,u.end,{counter:h,prefix:"L"},u.id),isUserDefinedId:u.isUserDefinedId,start:u.start,end:u.end,type:u.type??"normal",label:u.text,labelType:u.labelType,labelpos:"c",thickness:u.stroke,minlen:u.length,classes:(u==null?void 0:u.stroke)==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":d,arrowTypeEnd:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":f,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(u.classes),labelStyle:p,style:p,pattern:u.stroke,look:e.look,animate:u.animate,animation:u.animation,curve:u.interpolate||this.edges.defaultInterpolate||((m=e.flowchart)==null?void 0:m.curve)};n.push(g)}),{nodes:r,edges:n,other:{},config:e}}defaultConfig(){return Egt.flowchart}},C(kD,"FlowDB"),kD),gLn=C(function(t,e){return e.db.getClasses()},"getClasses"),mLn=C(async function(t,e,r,n,i){var f;me.info("REF0:"),me.info("Drawing state diagram (v2)",e);const{securityLevel:a,flowchart:s,layout:o}=He();n.db.setDiagramId(e),me.debug("Before getData: ");const l=n.db.getData();me.debug("Data: ",l);const u=z3(e,a),h=n.db.getDirection();l.type=n.type,l.layoutAlgorithm=R7(o),l.layoutAlgorithm==="dagre"&&o==="elk"&&me.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),l.direction=h,l.nodeSpacing=(s==null?void 0:s.nodeSpacing)||50,l.rankSpacing=(s==null?void 0:s.rankSpacing)||50,l.markers=["point","circle","cross"],l.diagramId=e,me.debug("REF1:",l),await e4(l,u,i);const d=((f=l.config.flowchart)==null?void 0:f.diagramPadding)??8;ln.insertTitle(u,"flowchartTitleText",(s==null?void 0:s.titleTopMargin)||0,n.db.getDiagramTitle()),IC(u,d,"flowchart",(s==null?void 0:s.useMaxWidth)||!1)},"draw"),vLn={getClasses:gLn,draw:mLn},Bke=function(){var t=C(function(Ln,Et,St,Vt){for(St=St||{},Vt=Ln.length;Vt--;St[Ln[Vt]]=Et);return St},"o"),e=[1,4],r=[1,3],n=[1,5],i=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],a=[2,2],s=[1,13],o=[1,14],l=[1,15],u=[1,16],h=[1,23],d=[1,25],f=[1,26],p=[1,27],g=[1,50],m=[1,49],v=[1,29],y=[1,30],b=[1,31],x=[1,32],w=[1,33],A=[1,45],T=[1,47],S=[1,43],O=[1,48],k=[1,44],E=[1,51],_=[1,46],I=[1,52],L=[1,53],R=[1,34],D=[1,35],M=[1,36],P=[1,37],N=[1,38],F=[1,58],B=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],V=[1,62],z=[1,61],U=[1,63],Q=[8,9,11,75,77,78],G=[1,79],X=[1,92],Y=[1,97],le=[1,96],q=[1,93],Z=[1,89],ee=[1,95],re=[1,91],ve=[1,98],ae=[1,94],Ce=[1,99],Oe=[1,90],$e=[8,9,10,11,40,75,77,78],he=[8,9,10,11,40,46,75,77,78],fe=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],Te=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],ge=[44,60,89,102,105,106,109,111,114,115,116],Qe=[1,122],Se=[1,123],De=[1,125],qe=[1,124],K=[44,60,62,74,89,102,105,106,109,111,114,115,116],ce=[1,134],be=[1,148],ne=[1,149],j=[1,150],ie=[1,151],pe=[1,136],te=[1,138],ye=[1,142],oe=[1,143],_e=[1,144],Le=[1,145],Ye=[1,146],Pe=[1,147],Xe=[1,152],Ne=[1,153],Ze=[1,132],Ge=[1,133],lt=[1,140],Fe=[1,135],wt=[1,139],Me=[1,137],Rt=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],Lt=[1,155],ut=[1,157],Xt=[8,9,11],Ft=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],gt=[1,177],Ae=[1,173],zt=[1,174],kt=[1,178],At=[1,175],Mt=[1,176],jr=[77,116,119],Re=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],at=[10,106],xt=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],Ct=[1,248],gr=[1,246],Xr=[1,250],$r=[1,244],un=[1,245],zr=[1,247],On=[1,249],Nr=[1,251],hn=[1,269],ti=[8,9,11,106],pt=[8,9,10,11,60,84,105,106,109,110,111,112],Tt={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:C(function(Et,St,Vt,mt,Sr,Ie,Xi){var Ue=Ie.length-1;switch(Sr){case 2:this.$=[];break;case 3:(!Array.isArray(Ie[Ue])||Ie[Ue].length>0)&&Ie[Ue-1].push(Ie[Ue]),this.$=Ie[Ue-1];break;case 4:case 183:this.$=Ie[Ue];break;case 11:mt.setDirection("TB"),this.$="TB";break;case 12:mt.setDirection(Ie[Ue-1]),this.$=Ie[Ue-1];break;case 27:this.$=Ie[Ue-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=mt.addSubGraph(Ie[Ue-6],Ie[Ue-1],Ie[Ue-4]);break;case 34:this.$=mt.addSubGraph(Ie[Ue-3],Ie[Ue-1],Ie[Ue-3]);break;case 35:this.$=mt.addSubGraph(void 0,Ie[Ue-1],void 0);break;case 37:this.$=Ie[Ue].trim(),mt.setAccTitle(this.$);break;case 38:case 39:this.$=Ie[Ue].trim(),mt.setAccDescription(this.$);break;case 43:this.$=Ie[Ue-1]+Ie[Ue];break;case 44:this.$=Ie[Ue];break;case 45:mt.addVertex(Ie[Ue-1][Ie[Ue-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ie[Ue]),mt.addLink(Ie[Ue-3].stmt,Ie[Ue-1],Ie[Ue-2]),this.$={stmt:Ie[Ue-1],nodes:Ie[Ue-1].concat(Ie[Ue-3].nodes)};break;case 46:mt.addLink(Ie[Ue-2].stmt,Ie[Ue],Ie[Ue-1]),this.$={stmt:Ie[Ue],nodes:Ie[Ue].concat(Ie[Ue-2].nodes)};break;case 47:mt.addLink(Ie[Ue-3].stmt,Ie[Ue-1],Ie[Ue-2]),this.$={stmt:Ie[Ue-1],nodes:Ie[Ue-1].concat(Ie[Ue-3].nodes)};break;case 48:this.$={stmt:Ie[Ue-1],nodes:Ie[Ue-1]};break;case 49:mt.addVertex(Ie[Ue-1][Ie[Ue-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ie[Ue]),this.$={stmt:Ie[Ue-1],nodes:Ie[Ue-1],shapeData:Ie[Ue]};break;case 50:this.$={stmt:Ie[Ue],nodes:Ie[Ue]};break;case 51:this.$=[Ie[Ue]];break;case 52:mt.addVertex(Ie[Ue-5][Ie[Ue-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ie[Ue-4]),this.$=Ie[Ue-5].concat(Ie[Ue]);break;case 53:this.$=Ie[Ue-4].concat(Ie[Ue]);break;case 54:this.$=Ie[Ue];break;case 55:this.$=Ie[Ue-2],mt.setClass(Ie[Ue-2],Ie[Ue]);break;case 56:this.$=Ie[Ue-3],mt.addVertex(Ie[Ue-3],Ie[Ue-1],"square");break;case 57:this.$=Ie[Ue-3],mt.addVertex(Ie[Ue-3],Ie[Ue-1],"doublecircle");break;case 58:this.$=Ie[Ue-5],mt.addVertex(Ie[Ue-5],Ie[Ue-2],"circle");break;case 59:this.$=Ie[Ue-3],mt.addVertex(Ie[Ue-3],Ie[Ue-1],"ellipse");break;case 60:this.$=Ie[Ue-3],mt.addVertex(Ie[Ue-3],Ie[Ue-1],"stadium");break;case 61:this.$=Ie[Ue-3],mt.addVertex(Ie[Ue-3],Ie[Ue-1],"subroutine");break;case 62:this.$=Ie[Ue-7],mt.addVertex(Ie[Ue-7],Ie[Ue-1],"rect",void 0,void 0,void 0,Object.fromEntries([[Ie[Ue-5],Ie[Ue-3]]]));break;case 63:this.$=Ie[Ue-3],mt.addVertex(Ie[Ue-3],Ie[Ue-1],"cylinder");break;case 64:this.$=Ie[Ue-3],mt.addVertex(Ie[Ue-3],Ie[Ue-1],"round");break;case 65:this.$=Ie[Ue-3],mt.addVertex(Ie[Ue-3],Ie[Ue-1],"diamond");break;case 66:this.$=Ie[Ue-5],mt.addVertex(Ie[Ue-5],Ie[Ue-2],"hexagon");break;case 67:this.$=Ie[Ue-3],mt.addVertex(Ie[Ue-3],Ie[Ue-1],"odd");break;case 68:this.$=Ie[Ue-3],mt.addVertex(Ie[Ue-3],Ie[Ue-1],"trapezoid");break;case 69:this.$=Ie[Ue-3],mt.addVertex(Ie[Ue-3],Ie[Ue-1],"inv_trapezoid");break;case 70:this.$=Ie[Ue-3],mt.addVertex(Ie[Ue-3],Ie[Ue-1],"lean_right");break;case 71:this.$=Ie[Ue-3],mt.addVertex(Ie[Ue-3],Ie[Ue-1],"lean_left");break;case 72:this.$=Ie[Ue],mt.addVertex(Ie[Ue]);break;case 73:Ie[Ue-1].text=Ie[Ue],this.$=Ie[Ue-1];break;case 74:case 75:Ie[Ue-2].text=Ie[Ue-1],this.$=Ie[Ue-2];break;case 76:this.$=Ie[Ue];break;case 77:var Mn=mt.destructLink(Ie[Ue],Ie[Ue-2]);this.$={type:Mn.type,stroke:Mn.stroke,length:Mn.length,text:Ie[Ue-1]};break;case 78:var Mn=mt.destructLink(Ie[Ue],Ie[Ue-2]);this.$={type:Mn.type,stroke:Mn.stroke,length:Mn.length,text:Ie[Ue-1],id:Ie[Ue-3]};break;case 79:this.$={text:Ie[Ue],type:"text"};break;case 80:this.$={text:Ie[Ue-1].text+""+Ie[Ue],type:Ie[Ue-1].type};break;case 81:this.$={text:Ie[Ue],type:"string"};break;case 82:this.$={text:Ie[Ue],type:"markdown"};break;case 83:var Mn=mt.destructLink(Ie[Ue]);this.$={type:Mn.type,stroke:Mn.stroke,length:Mn.length};break;case 84:var Mn=mt.destructLink(Ie[Ue]);this.$={type:Mn.type,stroke:Mn.stroke,length:Mn.length,id:Ie[Ue-1]};break;case 85:this.$=Ie[Ue-1];break;case 86:this.$={text:Ie[Ue],type:"text"};break;case 87:this.$={text:Ie[Ue-1].text+""+Ie[Ue],type:Ie[Ue-1].type};break;case 88:this.$={text:Ie[Ue],type:"string"};break;case 89:case 104:this.$={text:Ie[Ue],type:"markdown"};break;case 101:this.$={text:Ie[Ue],type:"text"};break;case 102:this.$={text:Ie[Ue-1].text+""+Ie[Ue],type:Ie[Ue-1].type};break;case 103:this.$={text:Ie[Ue],type:"text"};break;case 105:this.$=Ie[Ue-4],mt.addClass(Ie[Ue-2],Ie[Ue]);break;case 106:this.$=Ie[Ue-4],mt.setClass(Ie[Ue-2],Ie[Ue]);break;case 107:case 115:this.$=Ie[Ue-1],mt.setClickEvent(Ie[Ue-1],Ie[Ue]);break;case 108:case 116:this.$=Ie[Ue-3],mt.setClickEvent(Ie[Ue-3],Ie[Ue-2]),mt.setTooltip(Ie[Ue-3],Ie[Ue]);break;case 109:this.$=Ie[Ue-2],mt.setClickEvent(Ie[Ue-2],Ie[Ue-1],Ie[Ue]);break;case 110:this.$=Ie[Ue-4],mt.setClickEvent(Ie[Ue-4],Ie[Ue-3],Ie[Ue-2]),mt.setTooltip(Ie[Ue-4],Ie[Ue]);break;case 111:this.$=Ie[Ue-2],mt.setLink(Ie[Ue-2],Ie[Ue]);break;case 112:this.$=Ie[Ue-4],mt.setLink(Ie[Ue-4],Ie[Ue-2]),mt.setTooltip(Ie[Ue-4],Ie[Ue]);break;case 113:this.$=Ie[Ue-4],mt.setLink(Ie[Ue-4],Ie[Ue-2],Ie[Ue]);break;case 114:this.$=Ie[Ue-6],mt.setLink(Ie[Ue-6],Ie[Ue-4],Ie[Ue]),mt.setTooltip(Ie[Ue-6],Ie[Ue-2]);break;case 117:this.$=Ie[Ue-1],mt.setLink(Ie[Ue-1],Ie[Ue]);break;case 118:this.$=Ie[Ue-3],mt.setLink(Ie[Ue-3],Ie[Ue-2]),mt.setTooltip(Ie[Ue-3],Ie[Ue]);break;case 119:this.$=Ie[Ue-3],mt.setLink(Ie[Ue-3],Ie[Ue-2],Ie[Ue]);break;case 120:this.$=Ie[Ue-5],mt.setLink(Ie[Ue-5],Ie[Ue-4],Ie[Ue]),mt.setTooltip(Ie[Ue-5],Ie[Ue-2]);break;case 121:this.$=Ie[Ue-4],mt.addVertex(Ie[Ue-2],void 0,void 0,Ie[Ue]);break;case 122:this.$=Ie[Ue-4],mt.updateLink([Ie[Ue-2]],Ie[Ue]);break;case 123:this.$=Ie[Ue-4],mt.updateLink(Ie[Ue-2],Ie[Ue]);break;case 124:this.$=Ie[Ue-8],mt.updateLinkInterpolate([Ie[Ue-6]],Ie[Ue-2]),mt.updateLink([Ie[Ue-6]],Ie[Ue]);break;case 125:this.$=Ie[Ue-8],mt.updateLinkInterpolate(Ie[Ue-6],Ie[Ue-2]),mt.updateLink(Ie[Ue-6],Ie[Ue]);break;case 126:this.$=Ie[Ue-6],mt.updateLinkInterpolate([Ie[Ue-4]],Ie[Ue]);break;case 127:this.$=Ie[Ue-6],mt.updateLinkInterpolate(Ie[Ue-4],Ie[Ue]);break;case 128:case 130:this.$=[Ie[Ue]];break;case 129:case 131:Ie[Ue-2].push(Ie[Ue]),this.$=Ie[Ue-2];break;case 133:this.$=Ie[Ue-1]+Ie[Ue];break;case 181:this.$=Ie[Ue];break;case 182:this.$=Ie[Ue-1]+""+Ie[Ue];break;case 184:this.$=Ie[Ue-1]+""+Ie[Ue];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:e,10:r,12:n},{1:[3]},t(i,a,{5:6}),{4:7,9:e,10:r,12:n},{4:8,9:e,10:r,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:v,85:y,86:b,87:x,88:w,89:A,102:T,105:S,106:O,109:k,111:E,113:42,114:_,115:I,116:L,121:R,122:D,123:M,124:P,125:N},t(i,[2,9]),t(i,[2,10]),t(i,[2,11]),{8:[1,55],9:[1,56],10:F,15:54,18:57},t(B,[2,3]),t(B,[2,4]),t(B,[2,5]),t(B,[2,6]),t(B,[2,7]),t(B,[2,8]),{8:V,9:z,11:U,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:V,9:z,11:U,21:68},{8:V,9:z,11:U,21:69},{8:V,9:z,11:U,21:70},{8:V,9:z,11:U,21:71},{8:V,9:z,11:U,21:72},{8:V,9:z,10:[1,73],11:U,21:74},t(B,[2,36]),{35:[1,75]},{37:[1,76]},t(B,[2,39]),t(Q,[2,50],{18:77,39:78,10:F,40:G}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:X,44:Y,60:le,80:[1,87],89:q,95:[1,84],97:[1,85],101:86,105:Z,106:ee,109:re,111:ve,114:ae,115:Ce,116:Oe,120:88},t(B,[2,185]),t(B,[2,186]),t(B,[2,187]),t(B,[2,188]),t(B,[2,189]),t($e,[2,51]),t($e,[2,54],{46:[1,100]}),t(he,[2,72],{113:113,29:[1,101],44:g,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:m,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:A,102:T,105:S,106:O,109:k,111:E,114:_,115:I,116:L}),t(fe,[2,181]),t(fe,[2,142]),t(fe,[2,143]),t(fe,[2,144]),t(fe,[2,145]),t(fe,[2,146]),t(fe,[2,147]),t(fe,[2,148]),t(fe,[2,149]),t(fe,[2,150]),t(fe,[2,151]),t(fe,[2,152]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,114]},t(Te,[2,26],{18:115,10:F}),t(B,[2,27]),{42:116,43:39,44:g,45:40,47:41,60:m,89:A,102:T,105:S,106:O,109:k,111:E,113:42,114:_,115:I,116:L},t(B,[2,40]),t(B,[2,41]),t(B,[2,42]),t(ge,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:Qe,81:Se,116:De,119:qe},{75:[1,126],77:[1,127]},t(K,[2,83]),t(B,[2,28]),t(B,[2,29]),t(B,[2,30]),t(B,[2,31]),t(B,[2,32]),{10:ce,12:be,14:ne,27:j,28:128,32:ie,44:pe,60:te,75:ye,80:[1,130],81:[1,131],83:141,84:oe,85:_e,86:Le,87:Ye,88:Pe,89:Xe,90:Ne,91:129,105:Ze,109:Ge,111:lt,114:Fe,115:wt,116:Me},t(Rt,a,{5:154}),t(B,[2,37]),t(B,[2,38]),t(Q,[2,48],{44:Lt}),t(Q,[2,49],{18:156,10:F,40:ut}),t($e,[2,44]),{44:g,47:158,60:m,89:A,102:T,105:S,106:O,109:k,111:E,113:42,114:_,115:I,116:L},{102:[1,159],103:160,105:[1,161]},{44:g,47:162,60:m,89:A,102:T,105:S,106:O,109:k,111:E,113:42,114:_,115:I,116:L},{44:g,47:163,60:m,89:A,102:T,105:S,106:O,109:k,111:E,113:42,114:_,115:I,116:L},t(Xt,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},t(Xt,[2,115],{120:168,10:[1,167],14:X,44:Y,60:le,89:q,105:Z,106:ee,109:re,111:ve,114:ae,115:Ce,116:Oe}),t(Xt,[2,117],{10:[1,169]}),t(Ft,[2,183]),t(Ft,[2,170]),t(Ft,[2,171]),t(Ft,[2,172]),t(Ft,[2,173]),t(Ft,[2,174]),t(Ft,[2,175]),t(Ft,[2,176]),t(Ft,[2,177]),t(Ft,[2,178]),t(Ft,[2,179]),t(Ft,[2,180]),{44:g,47:170,60:m,89:A,102:T,105:S,106:O,109:k,111:E,113:42,114:_,115:I,116:L},{30:171,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},{30:179,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},{30:181,50:[1,180],67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},{30:182,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},{30:183,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},{30:184,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},{109:[1,185]},{30:186,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},{30:187,65:[1,188],67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},{30:189,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},{30:190,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},{30:191,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},t(fe,[2,182]),t(i,[2,20]),t(Te,[2,25]),t(Q,[2,46],{39:192,18:193,10:F,40:G}),t(ge,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},{77:[1,197],79:198,116:De,119:qe},t(jr,[2,79]),t(jr,[2,81]),t(jr,[2,82]),t(jr,[2,168]),t(jr,[2,169]),{76:199,79:121,80:Qe,81:Se,116:De,119:qe},t(K,[2,84]),{8:V,9:z,10:ce,11:U,12:be,14:ne,21:201,27:j,29:[1,200],32:ie,44:pe,60:te,75:ye,83:141,84:oe,85:_e,86:Le,87:Ye,88:Pe,89:Xe,90:Ne,91:202,105:Ze,109:Ge,111:lt,114:Fe,115:wt,116:Me},t(Re,[2,101]),t(Re,[2,103]),t(Re,[2,104]),t(Re,[2,157]),t(Re,[2,158]),t(Re,[2,159]),t(Re,[2,160]),t(Re,[2,161]),t(Re,[2,162]),t(Re,[2,163]),t(Re,[2,164]),t(Re,[2,165]),t(Re,[2,166]),t(Re,[2,167]),t(Re,[2,90]),t(Re,[2,91]),t(Re,[2,92]),t(Re,[2,93]),t(Re,[2,94]),t(Re,[2,95]),t(Re,[2,96]),t(Re,[2,97]),t(Re,[2,98]),t(Re,[2,99]),t(Re,[2,100]),{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,203],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:v,85:y,86:b,87:x,88:w,89:A,102:T,105:S,106:O,109:k,111:E,113:42,114:_,115:I,116:L,121:R,122:D,123:M,124:P,125:N},{10:F,18:204},{44:[1,205]},t($e,[2,43]),{10:[1,206],44:g,60:m,89:A,102:T,105:S,106:O,109:k,111:E,113:113,114:_,115:I,116:L},{10:[1,207]},{10:[1,208],106:[1,209]},t(at,[2,128]),{10:[1,210],44:g,60:m,89:A,102:T,105:S,106:O,109:k,111:E,113:113,114:_,115:I,116:L},{10:[1,211],44:g,60:m,89:A,102:T,105:S,106:O,109:k,111:E,113:113,114:_,115:I,116:L},{80:[1,212]},t(Xt,[2,109],{10:[1,213]}),t(Xt,[2,111],{10:[1,214]}),{80:[1,215]},t(Ft,[2,184]),{80:[1,216],98:[1,217]},t($e,[2,55],{113:113,44:g,60:m,89:A,102:T,105:S,106:O,109:k,111:E,114:_,115:I,116:L}),{31:[1,218],67:gt,82:219,116:kt,117:At,118:Mt},t(xt,[2,86]),t(xt,[2,88]),t(xt,[2,89]),t(xt,[2,153]),t(xt,[2,154]),t(xt,[2,155]),t(xt,[2,156]),{49:[1,220],67:gt,82:219,116:kt,117:At,118:Mt},{30:221,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},{51:[1,222],67:gt,82:219,116:kt,117:At,118:Mt},{53:[1,223],67:gt,82:219,116:kt,117:At,118:Mt},{55:[1,224],67:gt,82:219,116:kt,117:At,118:Mt},{57:[1,225],67:gt,82:219,116:kt,117:At,118:Mt},{60:[1,226]},{64:[1,227],67:gt,82:219,116:kt,117:At,118:Mt},{66:[1,228],67:gt,82:219,116:kt,117:At,118:Mt},{30:229,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},{31:[1,230],67:gt,82:219,116:kt,117:At,118:Mt},{67:gt,69:[1,231],71:[1,232],82:219,116:kt,117:At,118:Mt},{67:gt,69:[1,234],71:[1,233],82:219,116:kt,117:At,118:Mt},t(Q,[2,45],{18:156,10:F,40:ut}),t(Q,[2,47],{44:Lt}),t(ge,[2,75]),t(ge,[2,74]),{62:[1,235],67:gt,82:219,116:kt,117:At,118:Mt},t(ge,[2,77]),t(jr,[2,80]),{77:[1,236],79:198,116:De,119:qe},{30:237,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},t(Rt,a,{5:238}),t(Re,[2,102]),t(B,[2,35]),{43:239,44:g,45:40,47:41,60:m,89:A,102:T,105:S,106:O,109:k,111:E,113:42,114:_,115:I,116:L},{10:F,18:240},{10:Ct,60:gr,84:Xr,92:241,105:$r,107:242,108:243,109:un,110:zr,111:On,112:Nr},{10:Ct,60:gr,84:Xr,92:252,104:[1,253],105:$r,107:242,108:243,109:un,110:zr,111:On,112:Nr},{10:Ct,60:gr,84:Xr,92:254,104:[1,255],105:$r,107:242,108:243,109:un,110:zr,111:On,112:Nr},{105:[1,256]},{10:Ct,60:gr,84:Xr,92:257,105:$r,107:242,108:243,109:un,110:zr,111:On,112:Nr},{44:g,47:258,60:m,89:A,102:T,105:S,106:O,109:k,111:E,113:42,114:_,115:I,116:L},t(Xt,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},t(Xt,[2,116]),t(Xt,[2,118],{10:[1,262]}),t(Xt,[2,119]),t(he,[2,56]),t(xt,[2,87]),t(he,[2,57]),{51:[1,263],67:gt,82:219,116:kt,117:At,118:Mt},t(he,[2,64]),t(he,[2,59]),t(he,[2,60]),t(he,[2,61]),{109:[1,264]},t(he,[2,63]),t(he,[2,65]),{66:[1,265],67:gt,82:219,116:kt,117:At,118:Mt},t(he,[2,67]),t(he,[2,68]),t(he,[2,70]),t(he,[2,69]),t(he,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(ge,[2,78]),{31:[1,266],67:gt,82:219,116:kt,117:At,118:Mt},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,267],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:v,85:y,86:b,87:x,88:w,89:A,102:T,105:S,106:O,109:k,111:E,113:42,114:_,115:I,116:L,121:R,122:D,123:M,124:P,125:N},t($e,[2,53]),{43:268,44:g,45:40,47:41,60:m,89:A,102:T,105:S,106:O,109:k,111:E,113:42,114:_,115:I,116:L},t(Xt,[2,121],{106:hn}),t(ti,[2,130],{108:270,10:Ct,60:gr,84:Xr,105:$r,109:un,110:zr,111:On,112:Nr}),t(pt,[2,132]),t(pt,[2,134]),t(pt,[2,135]),t(pt,[2,136]),t(pt,[2,137]),t(pt,[2,138]),t(pt,[2,139]),t(pt,[2,140]),t(pt,[2,141]),t(Xt,[2,122],{106:hn}),{10:[1,271]},t(Xt,[2,123],{106:hn}),{10:[1,272]},t(at,[2,129]),t(Xt,[2,105],{106:hn}),t(Xt,[2,106],{113:113,44:g,60:m,89:A,102:T,105:S,106:O,109:k,111:E,114:_,115:I,116:L}),t(Xt,[2,110]),t(Xt,[2,112],{10:[1,273]}),t(Xt,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:V,9:z,11:U,21:278},t(B,[2,34]),t($e,[2,52]),{10:Ct,60:gr,84:Xr,105:$r,107:279,108:243,109:un,110:zr,111:On,112:Nr},t(pt,[2,133]),{14:X,44:Y,60:le,89:q,101:280,105:Z,106:ee,109:re,111:ve,114:ae,115:Ce,116:Oe,120:88},{14:X,44:Y,60:le,89:q,101:281,105:Z,106:ee,109:re,111:ve,114:ae,115:Ce,116:Oe,120:88},{98:[1,282]},t(Xt,[2,120]),t(he,[2,58]),{30:283,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},t(he,[2,66]),t(Rt,a,{5:284}),t(ti,[2,131],{108:270,10:Ct,60:gr,84:Xr,105:$r,109:un,110:zr,111:On,112:Nr}),t(Xt,[2,126],{120:168,10:[1,285],14:X,44:Y,60:le,89:q,105:Z,106:ee,109:re,111:ve,114:ae,115:Ce,116:Oe}),t(Xt,[2,127],{120:168,10:[1,286],14:X,44:Y,60:le,89:q,105:Z,106:ee,109:re,111:ve,114:ae,115:Ce,116:Oe}),t(Xt,[2,114]),{31:[1,287],67:gt,82:219,116:kt,117:At,118:Mt},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,288],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:v,85:y,86:b,87:x,88:w,89:A,102:T,105:S,106:O,109:k,111:E,113:42,114:_,115:I,116:L,121:R,122:D,123:M,124:P,125:N},{10:Ct,60:gr,84:Xr,92:289,105:$r,107:242,108:243,109:un,110:zr,111:On,112:Nr},{10:Ct,60:gr,84:Xr,92:290,105:$r,107:242,108:243,109:un,110:zr,111:On,112:Nr},t(he,[2,62]),t(B,[2,33]),t(Xt,[2,124],{106:hn}),t(Xt,[2,125],{106:hn})],defaultActions:{},parseError:C(function(Et,St){if(St.recoverable)this.trace(Et);else{var Vt=new Error(Et);throw Vt.hash=St,Vt}},"parseError"),parse:C(function(Et){var St=this,Vt=[0],mt=[],Sr=[null],Ie=[],Xi=this.table,Ue="",Mn=0,li=0,Es=2,Vn=1,oa=Ie.slice.call(arguments,1),ci=Object.create(this.lexer),lu={yy:{}};for(var zg in this.yy)Object.prototype.hasOwnProperty.call(this.yy,zg)&&(lu.yy[zg]=this.yy[zg]);ci.setInput(Et,lu.yy),lu.yy.lexer=ci,lu.yy.parser=this,typeof ci.yylloc>"u"&&(ci.yylloc={});var lv=ci.yylloc;Ie.push(lv);var ek=ci.options&&ci.options.ranges;typeof lu.yy.parseError=="function"?this.parseError=lu.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function tk(ar){Vt.length=Vt.length-2*ar,Sr.length=Sr.length-ar,Ie.length=Ie.length-ar}C(tk,"popStack");function rk(){var ar;return ar=mt.pop()||ci.lex()||Vn,typeof ar!="number"&&(ar instanceof Array&&(mt=ar,ar=mt.pop()),ar=St.symbols_[ar]||ar),ar}C(rk,"lex");for(var ul,nd,Ec,Vo,ff={},Tw,Gt,ze,it;;){if(nd=Vt[Vt.length-1],this.defaultActions[nd]?Ec=this.defaultActions[nd]:((ul===null||typeof ul>"u")&&(ul=rk()),Ec=Xi[nd]&&Xi[nd][ul]),typeof Ec>"u"||!Ec.length||!Ec[0]){var Pt="";it=[];for(Tw in Xi[nd])this.terminals_[Tw]&&Tw>Es&&it.push("'"+this.terminals_[Tw]+"'");ci.showPosition?Pt="Parse error on line "+(Mn+1)+`: +You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,r,n){const i=this.isLinkData(n)?n.id.replace("@",""):void 0;me.info("addLink",e,r,i);for(const a of e)for(const s of r){const o=a===e[e.length-1],l=s===r[0];o&&l?this.addSingleLink(a,s,n,i):this.addSingleLink(a,s,n,void 0)}}updateLinkInterpolate(e,r){e.forEach(n=>{n==="default"?this.edges.defaultInterpolate=r:this.edges[n].interpolate=r})}updateLink(e,r){e.forEach(n=>{var i,a,s,o,l,u;if(typeof n=="number"&&n>=this.edges.length)throw new Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);n==="default"?this.edges.defaultStyle=r:(this.edges[n].style=r,(((a=(i=this.edges[n])==null?void 0:i.style)==null?void 0:a.length)??0)>0&&!((o=(s=this.edges[n])==null?void 0:s.style)!=null&&o.some(h=>h==null?void 0:h.startsWith("fill")))&&((u=(l=this.edges[n])==null?void 0:l.style)==null||u.push("fill:none")))})}addClass(e,r){const n=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(i=>{let a=this.classes.get(i);a===void 0&&(a={id:i,styles:[],textStyles:[]},this.classes.set(i,a)),n!=null&&n.forEach(s=>{if(/color/.exec(s)){const o=s.replace("fill","bgFill");a.textStyles.push(o)}a.styles.push(s)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,r){for(const n of e.split(",")){const i=this.vertices.get(n);i&&i.classes.push(r);const a=this.edges.find(o=>o.id===n);a&&a.classes.push(r);const s=this.subGraphLookup.get(n);s&&s.classes.push(r)}}setTooltip(e,r){if(r!==void 0){r=this.sanitizeText(r);for(const n of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,r)}}setClickFun(e,r,n){if(He().securityLevel!=="loose"||r===void 0)return;let i=[];if(typeof n=="string"){i=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let s=0;s{const s=this.lookUpDomId(e),o=document.querySelector(`[id="${s}"]`);o!==null&&o.addEventListener("click",()=>{ln.runFunc(r,...i)},!1)}))}setLink(e,r,n){e.split(",").forEach(i=>{const a=this.vertices.get(i);a!==void 0&&(a.link=ln.formatUrl(r,this.config),a.linkTarget=n)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFun(i,r,n)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirection(){var e;return(e=this.direction)==null?void 0:e.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){const r=_ke();Ot(e).select("svg").selectAll("g.node").on("mouseover",a=>{var u;const s=Ot(a.currentTarget),o=s.attr("title");if(o===null)return;const l=(u=a.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(s.attr("title")).style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(Oy.sanitize(o)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),Ot(a.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=He(),Aa()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,n){let i=e.text.trim(),a=n.text;e===n&&/\s/.exec(n.text)&&(i=void 0);const o=C(g=>{const m={boolean:{},number:{},string:{}},v=[];let y;return{nodeList:g.filter(function(x){const w=typeof x;return x.stmt&&x.stmt==="dir"?(y=x.value,!1):x.trim()===""?!1:w in m?m[w].hasOwnProperty(x)?!1:m[w][x]=!0:v.includes(x)?!1:v.push(x)}),dir:y}},"uniq")(r.flat()),l=o.nodeList,u=o.dir,h=u!==void 0,d=He().flowchart??{},f=u??(d.inheritDir?this.getDirection()??He().direction??void 0:void 0);if(this.version==="gen-1")for(let g=0;g2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===e)return{result:!0,count:0};let i=0,a=1;for(;i=0){const o=this.indexNodes2(e,s);if(o.result)return{result:!0,count:a+o.count};a=a+o.count}i=i+1}return{result:!1,count:a}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let r=e.trim(),n="arrow_open";switch(r[0]){case"<":n="arrow_point",r=r.slice(1);break;case"x":n="arrow_cross",r=r.slice(1);break;case"o":n="arrow_circle",r=r.slice(1);break}let i="normal";return r.includes("=")&&(i="thick"),r.includes(".")&&(i="dotted"),{type:n,stroke:i}}countChar(e,r){const n=r.length;let i=0;for(let a=0;a":i="arrow_point",r.startsWith("<")&&(i="double_"+i,n=n.slice(1));break;case"o":i="arrow_circle",r.startsWith("o")&&(i="double_"+i,n=n.slice(1));break}let a="normal",s=n.length-1;n.startsWith("=")&&(a="thick"),n.startsWith("~")&&(a="invisible");const o=this.countChar(".",n);return o&&(a="dotted",s=o),{type:i,stroke:a,length:s}}destructLink(e,r){const n=this.destructEndLink(e);let i;if(r){if(i=this.destructStartLink(r),i.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};if(i.type==="arrow_open")i.type=n.type;else{if(i.type!==n.type)return{type:"INVALID",stroke:"INVALID"};i.type="double_"+i.type}return i.type==="double_arrow"&&(i.type="double_arrow_point"),i.length=n.length,i}return n}exists(e,r){for(const n of e)if(n.nodes.includes(r))return!0;return!1}makeUniq(e,r){const n=[];return e.nodes.forEach((i,a)=>{this.exists(r,i)||n.push(e.nodes[a])}),{nodes:n}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,r){return e.find(n=>n.id===r)}destructEdgeType(e){let r="none",n="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":n=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=e.replace("double_",""),n=r;break}return{arrowTypeStart:r,arrowTypeEnd:n}}addNodeFromVertex(e,r,n,i,a,s){var h;const o=n.get(e.id),l=i.get(e.id)??!1,u=this.findNode(r,e.id);if(u)u.cssStyles=e.styles,u.cssCompiledStyles=this.getCompiledStyles(e.classes),u.cssClasses=e.classes.join(" ");else{const d={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:o,padding:((h=a.flowchart)==null?void 0:h.padding)||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:s,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};l?r.push({...d,isGroup:!0,shape:"rect"}):r.push({...d,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}getData(){const e=He(),r=[],n=[],i=this.getSubGraphs(),a=new Map,s=new Map;for(let u=i.length-1;u>=0;u--){const h=i[u];h.nodes.length>0&&s.set(h.id,!0);for(const d of h.nodes)a.set(d,h.id)}for(let u=i.length-1;u>=0;u--){const h=i[u];r.push({id:h.id,label:h.title,labelStyle:"",labelType:h.labelType,parentId:a.get(h.id),padding:8,cssCompiledStyles:this.getCompiledStyles(h.classes),cssClasses:h.classes.join(" "),shape:"rect",dir:h.dir==="TD"?"TB":h.dir,explicitDir:h.hasExplicitDir,isGroup:!0,look:e.look})}this.getVertices().forEach(u=>{this.addNodeFromVertex(u,r,a,s,e,e.look||"classic")});const l=this.getEdges();return l.forEach((u,h)=>{var m;const{arrowTypeStart:d,arrowTypeEnd:f}=this.destructEdgeType(u.type),p=[...l.defaultStyle??[]];u.style&&p.push(...u.style);const g={id:Y5(u.start,u.end,{counter:h,prefix:"L"},u.id),isUserDefinedId:u.isUserDefinedId,start:u.start,end:u.end,type:u.type??"normal",label:u.text,labelType:u.labelType,labelpos:"c",thickness:u.stroke,minlen:u.length,classes:(u==null?void 0:u.stroke)==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":d,arrowTypeEnd:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":f,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(u.classes),labelStyle:p,style:p,pattern:u.stroke,look:e.look,animate:u.animate,animation:u.animation,curve:u.interpolate||this.edges.defaultInterpolate||((m=e.flowchart)==null?void 0:m.curve)};n.push(g)}),{nodes:r,edges:n,other:{},config:e}}defaultConfig(){return Egt.flowchart}},C(kD,"FlowDB"),kD),gLn=C(function(t,e){return e.db.getClasses()},"getClasses"),mLn=C(async function(t,e,r,n,i){var f;me.info("REF0:"),me.info("Drawing state diagram (v2)",e);const{securityLevel:a,flowchart:s,layout:o}=He();n.db.setDiagramId(e),me.debug("Before getData: ");const l=n.db.getData();me.debug("Data: ",l);const u=z3(e,a),h=n.db.getDirection();l.type=n.type,l.layoutAlgorithm=R7(o),l.layoutAlgorithm==="dagre"&&o==="elk"&&me.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),l.direction=h,l.nodeSpacing=(s==null?void 0:s.nodeSpacing)||50,l.rankSpacing=(s==null?void 0:s.rankSpacing)||50,l.markers=["point","circle","cross"],l.diagramId=e,me.debug("REF1:",l),await e4(l,u,i);const d=((f=l.config.flowchart)==null?void 0:f.diagramPadding)??8;ln.insertTitle(u,"flowchartTitleText",(s==null?void 0:s.titleTopMargin)||0,n.db.getDiagramTitle()),IC(u,d,"flowchart",(s==null?void 0:s.useMaxWidth)||!1)},"draw"),vLn={getClasses:gLn,draw:mLn},Bke=function(){var t=C(function(Ln,Et,Tt,Vt){for(Tt=Tt||{},Vt=Ln.length;Vt--;Tt[Ln[Vt]]=Et);return Tt},"o"),e=[1,4],r=[1,3],n=[1,5],i=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],a=[2,2],s=[1,13],o=[1,14],l=[1,15],u=[1,16],h=[1,23],d=[1,25],f=[1,26],p=[1,27],g=[1,50],m=[1,49],v=[1,29],y=[1,30],b=[1,31],x=[1,32],w=[1,33],A=[1,45],S=[1,47],T=[1,43],O=[1,48],k=[1,44],E=[1,51],_=[1,46],I=[1,52],L=[1,53],R=[1,34],D=[1,35],M=[1,36],P=[1,37],N=[1,38],F=[1,58],B=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],V=[1,62],z=[1,61],U=[1,63],Q=[8,9,11,75,77,78],G=[1,79],X=[1,92],Y=[1,97],le=[1,96],q=[1,93],Z=[1,89],ee=[1,95],re=[1,91],ve=[1,98],ae=[1,94],Ce=[1,99],Oe=[1,90],$e=[8,9,10,11,40,75,77,78],he=[8,9,10,11,40,46,75,77,78],fe=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],Se=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],ge=[44,60,89,102,105,106,109,111,114,115,116],Qe=[1,122],Te=[1,123],De=[1,125],qe=[1,124],K=[44,60,62,74,89,102,105,106,109,111,114,115,116],ce=[1,134],be=[1,148],ne=[1,149],j=[1,150],ie=[1,151],pe=[1,136],te=[1,138],ye=[1,142],oe=[1,143],_e=[1,144],Le=[1,145],Ye=[1,146],Pe=[1,147],Xe=[1,152],Ne=[1,153],Ze=[1,132],Ge=[1,133],lt=[1,140],Fe=[1,135],wt=[1,139],Me=[1,137],Rt=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],Lt=[1,155],ut=[1,157],Xt=[8,9,11],Ft=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],gt=[1,177],Ae=[1,173],zt=[1,174],kt=[1,178],At=[1,175],Mt=[1,176],jr=[77,116,119],Re=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],at=[10,106],xt=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],Ct=[1,248],gr=[1,246],Xr=[1,250],$r=[1,244],un=[1,245],zr=[1,247],On=[1,249],Nr=[1,251],hn=[1,269],ti=[8,9,11,106],pt=[8,9,10,11,60,84,105,106,109,110,111,112],St={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:C(function(Et,Tt,Vt,mt,Tr,Ie,Xi){var Ue=Ie.length-1;switch(Tr){case 2:this.$=[];break;case 3:(!Array.isArray(Ie[Ue])||Ie[Ue].length>0)&&Ie[Ue-1].push(Ie[Ue]),this.$=Ie[Ue-1];break;case 4:case 183:this.$=Ie[Ue];break;case 11:mt.setDirection("TB"),this.$="TB";break;case 12:mt.setDirection(Ie[Ue-1]),this.$=Ie[Ue-1];break;case 27:this.$=Ie[Ue-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=mt.addSubGraph(Ie[Ue-6],Ie[Ue-1],Ie[Ue-4]);break;case 34:this.$=mt.addSubGraph(Ie[Ue-3],Ie[Ue-1],Ie[Ue-3]);break;case 35:this.$=mt.addSubGraph(void 0,Ie[Ue-1],void 0);break;case 37:this.$=Ie[Ue].trim(),mt.setAccTitle(this.$);break;case 38:case 39:this.$=Ie[Ue].trim(),mt.setAccDescription(this.$);break;case 43:this.$=Ie[Ue-1]+Ie[Ue];break;case 44:this.$=Ie[Ue];break;case 45:mt.addVertex(Ie[Ue-1][Ie[Ue-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ie[Ue]),mt.addLink(Ie[Ue-3].stmt,Ie[Ue-1],Ie[Ue-2]),this.$={stmt:Ie[Ue-1],nodes:Ie[Ue-1].concat(Ie[Ue-3].nodes)};break;case 46:mt.addLink(Ie[Ue-2].stmt,Ie[Ue],Ie[Ue-1]),this.$={stmt:Ie[Ue],nodes:Ie[Ue].concat(Ie[Ue-2].nodes)};break;case 47:mt.addLink(Ie[Ue-3].stmt,Ie[Ue-1],Ie[Ue-2]),this.$={stmt:Ie[Ue-1],nodes:Ie[Ue-1].concat(Ie[Ue-3].nodes)};break;case 48:this.$={stmt:Ie[Ue-1],nodes:Ie[Ue-1]};break;case 49:mt.addVertex(Ie[Ue-1][Ie[Ue-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ie[Ue]),this.$={stmt:Ie[Ue-1],nodes:Ie[Ue-1],shapeData:Ie[Ue]};break;case 50:this.$={stmt:Ie[Ue],nodes:Ie[Ue]};break;case 51:this.$=[Ie[Ue]];break;case 52:mt.addVertex(Ie[Ue-5][Ie[Ue-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ie[Ue-4]),this.$=Ie[Ue-5].concat(Ie[Ue]);break;case 53:this.$=Ie[Ue-4].concat(Ie[Ue]);break;case 54:this.$=Ie[Ue];break;case 55:this.$=Ie[Ue-2],mt.setClass(Ie[Ue-2],Ie[Ue]);break;case 56:this.$=Ie[Ue-3],mt.addVertex(Ie[Ue-3],Ie[Ue-1],"square");break;case 57:this.$=Ie[Ue-3],mt.addVertex(Ie[Ue-3],Ie[Ue-1],"doublecircle");break;case 58:this.$=Ie[Ue-5],mt.addVertex(Ie[Ue-5],Ie[Ue-2],"circle");break;case 59:this.$=Ie[Ue-3],mt.addVertex(Ie[Ue-3],Ie[Ue-1],"ellipse");break;case 60:this.$=Ie[Ue-3],mt.addVertex(Ie[Ue-3],Ie[Ue-1],"stadium");break;case 61:this.$=Ie[Ue-3],mt.addVertex(Ie[Ue-3],Ie[Ue-1],"subroutine");break;case 62:this.$=Ie[Ue-7],mt.addVertex(Ie[Ue-7],Ie[Ue-1],"rect",void 0,void 0,void 0,Object.fromEntries([[Ie[Ue-5],Ie[Ue-3]]]));break;case 63:this.$=Ie[Ue-3],mt.addVertex(Ie[Ue-3],Ie[Ue-1],"cylinder");break;case 64:this.$=Ie[Ue-3],mt.addVertex(Ie[Ue-3],Ie[Ue-1],"round");break;case 65:this.$=Ie[Ue-3],mt.addVertex(Ie[Ue-3],Ie[Ue-1],"diamond");break;case 66:this.$=Ie[Ue-5],mt.addVertex(Ie[Ue-5],Ie[Ue-2],"hexagon");break;case 67:this.$=Ie[Ue-3],mt.addVertex(Ie[Ue-3],Ie[Ue-1],"odd");break;case 68:this.$=Ie[Ue-3],mt.addVertex(Ie[Ue-3],Ie[Ue-1],"trapezoid");break;case 69:this.$=Ie[Ue-3],mt.addVertex(Ie[Ue-3],Ie[Ue-1],"inv_trapezoid");break;case 70:this.$=Ie[Ue-3],mt.addVertex(Ie[Ue-3],Ie[Ue-1],"lean_right");break;case 71:this.$=Ie[Ue-3],mt.addVertex(Ie[Ue-3],Ie[Ue-1],"lean_left");break;case 72:this.$=Ie[Ue],mt.addVertex(Ie[Ue]);break;case 73:Ie[Ue-1].text=Ie[Ue],this.$=Ie[Ue-1];break;case 74:case 75:Ie[Ue-2].text=Ie[Ue-1],this.$=Ie[Ue-2];break;case 76:this.$=Ie[Ue];break;case 77:var Mn=mt.destructLink(Ie[Ue],Ie[Ue-2]);this.$={type:Mn.type,stroke:Mn.stroke,length:Mn.length,text:Ie[Ue-1]};break;case 78:var Mn=mt.destructLink(Ie[Ue],Ie[Ue-2]);this.$={type:Mn.type,stroke:Mn.stroke,length:Mn.length,text:Ie[Ue-1],id:Ie[Ue-3]};break;case 79:this.$={text:Ie[Ue],type:"text"};break;case 80:this.$={text:Ie[Ue-1].text+""+Ie[Ue],type:Ie[Ue-1].type};break;case 81:this.$={text:Ie[Ue],type:"string"};break;case 82:this.$={text:Ie[Ue],type:"markdown"};break;case 83:var Mn=mt.destructLink(Ie[Ue]);this.$={type:Mn.type,stroke:Mn.stroke,length:Mn.length};break;case 84:var Mn=mt.destructLink(Ie[Ue]);this.$={type:Mn.type,stroke:Mn.stroke,length:Mn.length,id:Ie[Ue-1]};break;case 85:this.$=Ie[Ue-1];break;case 86:this.$={text:Ie[Ue],type:"text"};break;case 87:this.$={text:Ie[Ue-1].text+""+Ie[Ue],type:Ie[Ue-1].type};break;case 88:this.$={text:Ie[Ue],type:"string"};break;case 89:case 104:this.$={text:Ie[Ue],type:"markdown"};break;case 101:this.$={text:Ie[Ue],type:"text"};break;case 102:this.$={text:Ie[Ue-1].text+""+Ie[Ue],type:Ie[Ue-1].type};break;case 103:this.$={text:Ie[Ue],type:"text"};break;case 105:this.$=Ie[Ue-4],mt.addClass(Ie[Ue-2],Ie[Ue]);break;case 106:this.$=Ie[Ue-4],mt.setClass(Ie[Ue-2],Ie[Ue]);break;case 107:case 115:this.$=Ie[Ue-1],mt.setClickEvent(Ie[Ue-1],Ie[Ue]);break;case 108:case 116:this.$=Ie[Ue-3],mt.setClickEvent(Ie[Ue-3],Ie[Ue-2]),mt.setTooltip(Ie[Ue-3],Ie[Ue]);break;case 109:this.$=Ie[Ue-2],mt.setClickEvent(Ie[Ue-2],Ie[Ue-1],Ie[Ue]);break;case 110:this.$=Ie[Ue-4],mt.setClickEvent(Ie[Ue-4],Ie[Ue-3],Ie[Ue-2]),mt.setTooltip(Ie[Ue-4],Ie[Ue]);break;case 111:this.$=Ie[Ue-2],mt.setLink(Ie[Ue-2],Ie[Ue]);break;case 112:this.$=Ie[Ue-4],mt.setLink(Ie[Ue-4],Ie[Ue-2]),mt.setTooltip(Ie[Ue-4],Ie[Ue]);break;case 113:this.$=Ie[Ue-4],mt.setLink(Ie[Ue-4],Ie[Ue-2],Ie[Ue]);break;case 114:this.$=Ie[Ue-6],mt.setLink(Ie[Ue-6],Ie[Ue-4],Ie[Ue]),mt.setTooltip(Ie[Ue-6],Ie[Ue-2]);break;case 117:this.$=Ie[Ue-1],mt.setLink(Ie[Ue-1],Ie[Ue]);break;case 118:this.$=Ie[Ue-3],mt.setLink(Ie[Ue-3],Ie[Ue-2]),mt.setTooltip(Ie[Ue-3],Ie[Ue]);break;case 119:this.$=Ie[Ue-3],mt.setLink(Ie[Ue-3],Ie[Ue-2],Ie[Ue]);break;case 120:this.$=Ie[Ue-5],mt.setLink(Ie[Ue-5],Ie[Ue-4],Ie[Ue]),mt.setTooltip(Ie[Ue-5],Ie[Ue-2]);break;case 121:this.$=Ie[Ue-4],mt.addVertex(Ie[Ue-2],void 0,void 0,Ie[Ue]);break;case 122:this.$=Ie[Ue-4],mt.updateLink([Ie[Ue-2]],Ie[Ue]);break;case 123:this.$=Ie[Ue-4],mt.updateLink(Ie[Ue-2],Ie[Ue]);break;case 124:this.$=Ie[Ue-8],mt.updateLinkInterpolate([Ie[Ue-6]],Ie[Ue-2]),mt.updateLink([Ie[Ue-6]],Ie[Ue]);break;case 125:this.$=Ie[Ue-8],mt.updateLinkInterpolate(Ie[Ue-6],Ie[Ue-2]),mt.updateLink(Ie[Ue-6],Ie[Ue]);break;case 126:this.$=Ie[Ue-6],mt.updateLinkInterpolate([Ie[Ue-4]],Ie[Ue]);break;case 127:this.$=Ie[Ue-6],mt.updateLinkInterpolate(Ie[Ue-4],Ie[Ue]);break;case 128:case 130:this.$=[Ie[Ue]];break;case 129:case 131:Ie[Ue-2].push(Ie[Ue]),this.$=Ie[Ue-2];break;case 133:this.$=Ie[Ue-1]+Ie[Ue];break;case 181:this.$=Ie[Ue];break;case 182:this.$=Ie[Ue-1]+""+Ie[Ue];break;case 184:this.$=Ie[Ue-1]+""+Ie[Ue];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:e,10:r,12:n},{1:[3]},t(i,a,{5:6}),{4:7,9:e,10:r,12:n},{4:8,9:e,10:r,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:v,85:y,86:b,87:x,88:w,89:A,102:S,105:T,106:O,109:k,111:E,113:42,114:_,115:I,116:L,121:R,122:D,123:M,124:P,125:N},t(i,[2,9]),t(i,[2,10]),t(i,[2,11]),{8:[1,55],9:[1,56],10:F,15:54,18:57},t(B,[2,3]),t(B,[2,4]),t(B,[2,5]),t(B,[2,6]),t(B,[2,7]),t(B,[2,8]),{8:V,9:z,11:U,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:V,9:z,11:U,21:68},{8:V,9:z,11:U,21:69},{8:V,9:z,11:U,21:70},{8:V,9:z,11:U,21:71},{8:V,9:z,11:U,21:72},{8:V,9:z,10:[1,73],11:U,21:74},t(B,[2,36]),{35:[1,75]},{37:[1,76]},t(B,[2,39]),t(Q,[2,50],{18:77,39:78,10:F,40:G}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:X,44:Y,60:le,80:[1,87],89:q,95:[1,84],97:[1,85],101:86,105:Z,106:ee,109:re,111:ve,114:ae,115:Ce,116:Oe,120:88},t(B,[2,185]),t(B,[2,186]),t(B,[2,187]),t(B,[2,188]),t(B,[2,189]),t($e,[2,51]),t($e,[2,54],{46:[1,100]}),t(he,[2,72],{113:113,29:[1,101],44:g,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:m,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:A,102:S,105:T,106:O,109:k,111:E,114:_,115:I,116:L}),t(fe,[2,181]),t(fe,[2,142]),t(fe,[2,143]),t(fe,[2,144]),t(fe,[2,145]),t(fe,[2,146]),t(fe,[2,147]),t(fe,[2,148]),t(fe,[2,149]),t(fe,[2,150]),t(fe,[2,151]),t(fe,[2,152]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,114]},t(Se,[2,26],{18:115,10:F}),t(B,[2,27]),{42:116,43:39,44:g,45:40,47:41,60:m,89:A,102:S,105:T,106:O,109:k,111:E,113:42,114:_,115:I,116:L},t(B,[2,40]),t(B,[2,41]),t(B,[2,42]),t(ge,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:Qe,81:Te,116:De,119:qe},{75:[1,126],77:[1,127]},t(K,[2,83]),t(B,[2,28]),t(B,[2,29]),t(B,[2,30]),t(B,[2,31]),t(B,[2,32]),{10:ce,12:be,14:ne,27:j,28:128,32:ie,44:pe,60:te,75:ye,80:[1,130],81:[1,131],83:141,84:oe,85:_e,86:Le,87:Ye,88:Pe,89:Xe,90:Ne,91:129,105:Ze,109:Ge,111:lt,114:Fe,115:wt,116:Me},t(Rt,a,{5:154}),t(B,[2,37]),t(B,[2,38]),t(Q,[2,48],{44:Lt}),t(Q,[2,49],{18:156,10:F,40:ut}),t($e,[2,44]),{44:g,47:158,60:m,89:A,102:S,105:T,106:O,109:k,111:E,113:42,114:_,115:I,116:L},{102:[1,159],103:160,105:[1,161]},{44:g,47:162,60:m,89:A,102:S,105:T,106:O,109:k,111:E,113:42,114:_,115:I,116:L},{44:g,47:163,60:m,89:A,102:S,105:T,106:O,109:k,111:E,113:42,114:_,115:I,116:L},t(Xt,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},t(Xt,[2,115],{120:168,10:[1,167],14:X,44:Y,60:le,89:q,105:Z,106:ee,109:re,111:ve,114:ae,115:Ce,116:Oe}),t(Xt,[2,117],{10:[1,169]}),t(Ft,[2,183]),t(Ft,[2,170]),t(Ft,[2,171]),t(Ft,[2,172]),t(Ft,[2,173]),t(Ft,[2,174]),t(Ft,[2,175]),t(Ft,[2,176]),t(Ft,[2,177]),t(Ft,[2,178]),t(Ft,[2,179]),t(Ft,[2,180]),{44:g,47:170,60:m,89:A,102:S,105:T,106:O,109:k,111:E,113:42,114:_,115:I,116:L},{30:171,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},{30:179,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},{30:181,50:[1,180],67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},{30:182,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},{30:183,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},{30:184,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},{109:[1,185]},{30:186,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},{30:187,65:[1,188],67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},{30:189,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},{30:190,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},{30:191,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},t(fe,[2,182]),t(i,[2,20]),t(Se,[2,25]),t(Q,[2,46],{39:192,18:193,10:F,40:G}),t(ge,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},{77:[1,197],79:198,116:De,119:qe},t(jr,[2,79]),t(jr,[2,81]),t(jr,[2,82]),t(jr,[2,168]),t(jr,[2,169]),{76:199,79:121,80:Qe,81:Te,116:De,119:qe},t(K,[2,84]),{8:V,9:z,10:ce,11:U,12:be,14:ne,21:201,27:j,29:[1,200],32:ie,44:pe,60:te,75:ye,83:141,84:oe,85:_e,86:Le,87:Ye,88:Pe,89:Xe,90:Ne,91:202,105:Ze,109:Ge,111:lt,114:Fe,115:wt,116:Me},t(Re,[2,101]),t(Re,[2,103]),t(Re,[2,104]),t(Re,[2,157]),t(Re,[2,158]),t(Re,[2,159]),t(Re,[2,160]),t(Re,[2,161]),t(Re,[2,162]),t(Re,[2,163]),t(Re,[2,164]),t(Re,[2,165]),t(Re,[2,166]),t(Re,[2,167]),t(Re,[2,90]),t(Re,[2,91]),t(Re,[2,92]),t(Re,[2,93]),t(Re,[2,94]),t(Re,[2,95]),t(Re,[2,96]),t(Re,[2,97]),t(Re,[2,98]),t(Re,[2,99]),t(Re,[2,100]),{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,203],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:v,85:y,86:b,87:x,88:w,89:A,102:S,105:T,106:O,109:k,111:E,113:42,114:_,115:I,116:L,121:R,122:D,123:M,124:P,125:N},{10:F,18:204},{44:[1,205]},t($e,[2,43]),{10:[1,206],44:g,60:m,89:A,102:S,105:T,106:O,109:k,111:E,113:113,114:_,115:I,116:L},{10:[1,207]},{10:[1,208],106:[1,209]},t(at,[2,128]),{10:[1,210],44:g,60:m,89:A,102:S,105:T,106:O,109:k,111:E,113:113,114:_,115:I,116:L},{10:[1,211],44:g,60:m,89:A,102:S,105:T,106:O,109:k,111:E,113:113,114:_,115:I,116:L},{80:[1,212]},t(Xt,[2,109],{10:[1,213]}),t(Xt,[2,111],{10:[1,214]}),{80:[1,215]},t(Ft,[2,184]),{80:[1,216],98:[1,217]},t($e,[2,55],{113:113,44:g,60:m,89:A,102:S,105:T,106:O,109:k,111:E,114:_,115:I,116:L}),{31:[1,218],67:gt,82:219,116:kt,117:At,118:Mt},t(xt,[2,86]),t(xt,[2,88]),t(xt,[2,89]),t(xt,[2,153]),t(xt,[2,154]),t(xt,[2,155]),t(xt,[2,156]),{49:[1,220],67:gt,82:219,116:kt,117:At,118:Mt},{30:221,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},{51:[1,222],67:gt,82:219,116:kt,117:At,118:Mt},{53:[1,223],67:gt,82:219,116:kt,117:At,118:Mt},{55:[1,224],67:gt,82:219,116:kt,117:At,118:Mt},{57:[1,225],67:gt,82:219,116:kt,117:At,118:Mt},{60:[1,226]},{64:[1,227],67:gt,82:219,116:kt,117:At,118:Mt},{66:[1,228],67:gt,82:219,116:kt,117:At,118:Mt},{30:229,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},{31:[1,230],67:gt,82:219,116:kt,117:At,118:Mt},{67:gt,69:[1,231],71:[1,232],82:219,116:kt,117:At,118:Mt},{67:gt,69:[1,234],71:[1,233],82:219,116:kt,117:At,118:Mt},t(Q,[2,45],{18:156,10:F,40:ut}),t(Q,[2,47],{44:Lt}),t(ge,[2,75]),t(ge,[2,74]),{62:[1,235],67:gt,82:219,116:kt,117:At,118:Mt},t(ge,[2,77]),t(jr,[2,80]),{77:[1,236],79:198,116:De,119:qe},{30:237,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},t(Rt,a,{5:238}),t(Re,[2,102]),t(B,[2,35]),{43:239,44:g,45:40,47:41,60:m,89:A,102:S,105:T,106:O,109:k,111:E,113:42,114:_,115:I,116:L},{10:F,18:240},{10:Ct,60:gr,84:Xr,92:241,105:$r,107:242,108:243,109:un,110:zr,111:On,112:Nr},{10:Ct,60:gr,84:Xr,92:252,104:[1,253],105:$r,107:242,108:243,109:un,110:zr,111:On,112:Nr},{10:Ct,60:gr,84:Xr,92:254,104:[1,255],105:$r,107:242,108:243,109:un,110:zr,111:On,112:Nr},{105:[1,256]},{10:Ct,60:gr,84:Xr,92:257,105:$r,107:242,108:243,109:un,110:zr,111:On,112:Nr},{44:g,47:258,60:m,89:A,102:S,105:T,106:O,109:k,111:E,113:42,114:_,115:I,116:L},t(Xt,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},t(Xt,[2,116]),t(Xt,[2,118],{10:[1,262]}),t(Xt,[2,119]),t(he,[2,56]),t(xt,[2,87]),t(he,[2,57]),{51:[1,263],67:gt,82:219,116:kt,117:At,118:Mt},t(he,[2,64]),t(he,[2,59]),t(he,[2,60]),t(he,[2,61]),{109:[1,264]},t(he,[2,63]),t(he,[2,65]),{66:[1,265],67:gt,82:219,116:kt,117:At,118:Mt},t(he,[2,67]),t(he,[2,68]),t(he,[2,70]),t(he,[2,69]),t(he,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(ge,[2,78]),{31:[1,266],67:gt,82:219,116:kt,117:At,118:Mt},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,267],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:v,85:y,86:b,87:x,88:w,89:A,102:S,105:T,106:O,109:k,111:E,113:42,114:_,115:I,116:L,121:R,122:D,123:M,124:P,125:N},t($e,[2,53]),{43:268,44:g,45:40,47:41,60:m,89:A,102:S,105:T,106:O,109:k,111:E,113:42,114:_,115:I,116:L},t(Xt,[2,121],{106:hn}),t(ti,[2,130],{108:270,10:Ct,60:gr,84:Xr,105:$r,109:un,110:zr,111:On,112:Nr}),t(pt,[2,132]),t(pt,[2,134]),t(pt,[2,135]),t(pt,[2,136]),t(pt,[2,137]),t(pt,[2,138]),t(pt,[2,139]),t(pt,[2,140]),t(pt,[2,141]),t(Xt,[2,122],{106:hn}),{10:[1,271]},t(Xt,[2,123],{106:hn}),{10:[1,272]},t(at,[2,129]),t(Xt,[2,105],{106:hn}),t(Xt,[2,106],{113:113,44:g,60:m,89:A,102:S,105:T,106:O,109:k,111:E,114:_,115:I,116:L}),t(Xt,[2,110]),t(Xt,[2,112],{10:[1,273]}),t(Xt,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:V,9:z,11:U,21:278},t(B,[2,34]),t($e,[2,52]),{10:Ct,60:gr,84:Xr,105:$r,107:279,108:243,109:un,110:zr,111:On,112:Nr},t(pt,[2,133]),{14:X,44:Y,60:le,89:q,101:280,105:Z,106:ee,109:re,111:ve,114:ae,115:Ce,116:Oe,120:88},{14:X,44:Y,60:le,89:q,101:281,105:Z,106:ee,109:re,111:ve,114:ae,115:Ce,116:Oe,120:88},{98:[1,282]},t(Xt,[2,120]),t(he,[2,58]),{30:283,67:gt,80:Ae,81:zt,82:172,116:kt,117:At,118:Mt},t(he,[2,66]),t(Rt,a,{5:284}),t(ti,[2,131],{108:270,10:Ct,60:gr,84:Xr,105:$r,109:un,110:zr,111:On,112:Nr}),t(Xt,[2,126],{120:168,10:[1,285],14:X,44:Y,60:le,89:q,105:Z,106:ee,109:re,111:ve,114:ae,115:Ce,116:Oe}),t(Xt,[2,127],{120:168,10:[1,286],14:X,44:Y,60:le,89:q,105:Z,106:ee,109:re,111:ve,114:ae,115:Ce,116:Oe}),t(Xt,[2,114]),{31:[1,287],67:gt,82:219,116:kt,117:At,118:Mt},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,288],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:v,85:y,86:b,87:x,88:w,89:A,102:S,105:T,106:O,109:k,111:E,113:42,114:_,115:I,116:L,121:R,122:D,123:M,124:P,125:N},{10:Ct,60:gr,84:Xr,92:289,105:$r,107:242,108:243,109:un,110:zr,111:On,112:Nr},{10:Ct,60:gr,84:Xr,92:290,105:$r,107:242,108:243,109:un,110:zr,111:On,112:Nr},t(he,[2,62]),t(B,[2,33]),t(Xt,[2,124],{106:hn}),t(Xt,[2,125],{106:hn})],defaultActions:{},parseError:C(function(Et,Tt){if(Tt.recoverable)this.trace(Et);else{var Vt=new Error(Et);throw Vt.hash=Tt,Vt}},"parseError"),parse:C(function(Et){var Tt=this,Vt=[0],mt=[],Tr=[null],Ie=[],Xi=this.table,Ue="",Mn=0,li=0,Es=2,Vn=1,oa=Ie.slice.call(arguments,1),ci=Object.create(this.lexer),lu={yy:{}};for(var zg in this.yy)Object.prototype.hasOwnProperty.call(this.yy,zg)&&(lu.yy[zg]=this.yy[zg]);ci.setInput(Et,lu.yy),lu.yy.lexer=ci,lu.yy.parser=this,typeof ci.yylloc>"u"&&(ci.yylloc={});var lv=ci.yylloc;Ie.push(lv);var ek=ci.options&&ci.options.ranges;typeof lu.yy.parseError=="function"?this.parseError=lu.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function tk(ar){Vt.length=Vt.length-2*ar,Tr.length=Tr.length-ar,Ie.length=Ie.length-ar}C(tk,"popStack");function rk(){var ar;return ar=mt.pop()||ci.lex()||Vn,typeof ar!="number"&&(ar instanceof Array&&(mt=ar,ar=mt.pop()),ar=Tt.symbols_[ar]||ar),ar}C(rk,"lex");for(var ul,nd,Ec,Vo,ff={},Sw,Gt,ze,it;;){if(nd=Vt[Vt.length-1],this.defaultActions[nd]?Ec=this.defaultActions[nd]:((ul===null||typeof ul>"u")&&(ul=rk()),Ec=Xi[nd]&&Xi[nd][ul]),typeof Ec>"u"||!Ec.length||!Ec[0]){var Pt="";it=[];for(Sw in Xi[nd])this.terminals_[Sw]&&Sw>Es&&it.push("'"+this.terminals_[Sw]+"'");ci.showPosition?Pt="Parse error on line "+(Mn+1)+`: `+ci.showPosition()+` -Expecting `+it.join(", ")+", got '"+(this.terminals_[ul]||ul)+"'":Pt="Parse error on line "+(Mn+1)+": Unexpected "+(ul==Vn?"end of input":"'"+(this.terminals_[ul]||ul)+"'"),this.parseError(Pt,{text:ci.match,token:this.terminals_[ul]||ul,line:ci.yylineno,loc:lv,expected:it})}if(Ec[0]instanceof Array&&Ec.length>1)throw new Error("Parse Error: multiple actions possible at state: "+nd+", token: "+ul);switch(Ec[0]){case 1:Vt.push(ul),Sr.push(ci.yytext),Ie.push(ci.yylloc),Vt.push(Ec[1]),ul=null,li=ci.yyleng,Ue=ci.yytext,Mn=ci.yylineno,lv=ci.yylloc;break;case 2:if(Gt=this.productions_[Ec[1]][1],ff.$=Sr[Sr.length-Gt],ff._$={first_line:Ie[Ie.length-(Gt||1)].first_line,last_line:Ie[Ie.length-1].last_line,first_column:Ie[Ie.length-(Gt||1)].first_column,last_column:Ie[Ie.length-1].last_column},ek&&(ff._$.range=[Ie[Ie.length-(Gt||1)].range[0],Ie[Ie.length-1].range[1]]),Vo=this.performAction.apply(ff,[Ue,li,Mn,lu.yy,Ec[1],Sr,Ie].concat(oa)),typeof Vo<"u")return Vo;Gt&&(Vt=Vt.slice(0,-1*Gt*2),Sr=Sr.slice(0,-1*Gt),Ie=Ie.slice(0,-1*Gt)),Vt.push(this.productions_[Ec[1]][0]),Sr.push(ff.$),Ie.push(ff._$),ze=Xi[Vt[Vt.length-2]][Vt[Vt.length-1]],Vt.push(ze);break;case 3:return!0}}return!0},"parse")},sr=function(){var Ln={EOF:1,parseError:C(function(St,Vt){if(this.yy.parser)this.yy.parser.parseError(St,Vt);else throw new Error(St)},"parseError"),setInput:C(function(Et,St){return this.yy=St||this.yy||{},this._input=Et,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var Et=this._input[0];this.yytext+=Et,this.yyleng++,this.offset++,this.match+=Et,this.matched+=Et;var St=Et.match(/(?:\r\n?|\n).*/g);return St?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Et},"input"),unput:C(function(Et){var St=Et.length,Vt=Et.split(/(?:\r\n?|\n)/g);this._input=Et+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-St),this.offset-=St;var mt=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Vt.length-1&&(this.yylineno-=Vt.length-1);var Sr=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Vt?(Vt.length===mt.length?this.yylloc.first_column:0)+mt[mt.length-Vt.length].length-Vt[0].length:this.yylloc.first_column-St},this.options.ranges&&(this.yylloc.range=[Sr[0],Sr[0]+this.yyleng-St]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:C(function(Et){this.unput(this.match.slice(Et))},"less"),pastInput:C(function(){var Et=this.matched.substr(0,this.matched.length-this.match.length);return(Et.length>20?"...":"")+Et.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:C(function(){var Et=this.match;return Et.length<20&&(Et+=this._input.substr(0,20-Et.length)),(Et.substr(0,20)+(Et.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:C(function(){var Et=this.pastInput(),St=new Array(Et.length+1).join("-");return Et+this.upcomingInput()+` -`+St+"^"},"showPosition"),test_match:C(function(Et,St){var Vt,mt,Sr;if(this.options.backtrack_lexer&&(Sr={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Sr.yylloc.range=this.yylloc.range.slice(0))),mt=Et[0].match(/(?:\r\n?|\n).*/g),mt&&(this.yylineno+=mt.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:mt?mt[mt.length-1].length-mt[mt.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Et[0].length},this.yytext+=Et[0],this.match+=Et[0],this.matches=Et,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Et[0].length),this.matched+=Et[0],Vt=this.performAction.call(this,this.yy,this,St,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Vt)return Vt;if(this._backtrack){for(var Ie in Sr)this[Ie]=Sr[Ie];return!1}return!1},"test_match"),next:C(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Et,St,Vt,mt;this._more||(this.yytext="",this.match="");for(var Sr=this._currentRules(),Ie=0;IeSt[0].length)){if(St=Vt,mt=Ie,this.options.backtrack_lexer){if(Et=this.test_match(Vt,Sr[Ie]),Et!==!1)return Et;if(this._backtrack){St=!1;continue}else return!1}else if(!this.options.flex)break}return St?(Et=this.test_match(St,Sr[mt]),Et!==!1?Et:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var St=this.next();return St||this.lex()},"lex"),begin:C(function(St){this.conditionStack.push(St)},"begin"),popState:C(function(){var St=this.conditionStack.length-1;return St>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(St){return St=this.conditionStack.length-1-Math.abs(St||0),St>=0?this.conditionStack[St]:"INITIAL"},"topState"),pushState:C(function(St){this.begin(St)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:C(function(St,Vt,mt,Sr){switch(mt){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),Vt.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const Ie=/\n\s*/g;return Vt.yytext=Vt.yytext.replace(Ie,"
"),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return St.lex.firstGraph()&&this.begin("dir"),12;case 36:return St.lex.firstGraph()&&this.begin("dir"),12;case 37:return St.lex.firstGraph()&&this.begin("dir"),12;case 38:return St.lex.firstGraph()&&this.begin("dir"),12;case 39:return 27;case 40:return 32;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return 98;case 45:return this.popState(),13;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return this.popState(),14;case 56:return 121;case 57:return 122;case 58:return 123;case 59:return 124;case 60:return 125;case 61:return 78;case 62:return 105;case 63:return 111;case 64:return 46;case 65:return 60;case 66:return 44;case 67:return 8;case 68:return 106;case 69:return 115;case 70:return this.popState(),77;case 71:return this.pushState("edgeText"),75;case 72:return 119;case 73:return this.popState(),77;case 74:return this.pushState("thickEdgeText"),75;case 75:return 119;case 76:return this.popState(),77;case 77:return this.pushState("dottedEdgeText"),75;case 78:return 119;case 79:return 77;case 80:return this.popState(),53;case 81:return"TEXT";case 82:return this.pushState("ellipseText"),52;case 83:return this.popState(),55;case 84:return this.pushState("text"),54;case 85:return this.popState(),57;case 86:return this.pushState("text"),56;case 87:return 58;case 88:return this.pushState("text"),67;case 89:return this.popState(),64;case 90:return this.pushState("text"),63;case 91:return this.popState(),49;case 92:return this.pushState("text"),48;case 93:return this.popState(),69;case 94:return this.popState(),71;case 95:return 117;case 96:return this.pushState("trapText"),68;case 97:return this.pushState("trapText"),70;case 98:return 118;case 99:return 67;case 100:return 90;case 101:return"SEP";case 102:return 89;case 103:return 115;case 104:return 111;case 105:return 44;case 106:return 109;case 107:return 114;case 108:return 116;case 109:return this.popState(),62;case 110:return this.pushState("text"),62;case 111:return this.popState(),51;case 112:return this.pushState("text"),50;case 113:return this.popState(),31;case 114:return this.pushState("text"),29;case 115:return this.popState(),66;case 116:return this.pushState("text"),65;case 117:return"TEXT";case 118:return"QUOTE";case 119:return 9;case 120:return 10;case 121:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:swimlane-beta\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeData:{rules:[8,11,12,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackargs:{rules:[17,18,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackname:{rules:[14,15,16,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},href:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},click:{rules:[21,24,33,34,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dottedEdgeText:{rules:[21,24,76,78,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},thickEdgeText:{rules:[21,24,73,75,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},edgeText:{rules:[21,24,70,72,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},trapText:{rules:[21,24,79,82,84,86,90,92,93,94,95,96,97,110,112,114,116],inclusive:!1},ellipseText:{rules:[21,24,79,80,81,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},text:{rules:[21,24,79,82,83,84,85,86,89,90,91,92,96,97,109,110,111,112,113,114,115,116,117],inclusive:!1},vertex:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dir:{rules:[21,24,45,46,47,48,49,50,51,52,53,54,55,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr:{rules:[3,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_title:{rules:[1,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},md_string:{rules:[19,20,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},string:{rules:[21,22,23,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,44,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,73,74,76,77,79,82,84,86,87,88,90,92,96,97,98,99,100,101,102,103,104,105,106,107,108,110,112,114,116,118,119,120,121],inclusive:!0}}};return Ln}();Tt.lexer=sr;function Kr(){this.yy={}}return C(Kr,"Parser"),Kr.prototype=Tt,Tt.Parser=Kr,new Kr}();Bke.parser=Bke;var B6t=Bke,$6t=Object.assign({},B6t);$6t.parse=t=>{const e=t.replace(/}\s*\n/g,`} +Expecting `+it.join(", ")+", got '"+(this.terminals_[ul]||ul)+"'":Pt="Parse error on line "+(Mn+1)+": Unexpected "+(ul==Vn?"end of input":"'"+(this.terminals_[ul]||ul)+"'"),this.parseError(Pt,{text:ci.match,token:this.terminals_[ul]||ul,line:ci.yylineno,loc:lv,expected:it})}if(Ec[0]instanceof Array&&Ec.length>1)throw new Error("Parse Error: multiple actions possible at state: "+nd+", token: "+ul);switch(Ec[0]){case 1:Vt.push(ul),Tr.push(ci.yytext),Ie.push(ci.yylloc),Vt.push(Ec[1]),ul=null,li=ci.yyleng,Ue=ci.yytext,Mn=ci.yylineno,lv=ci.yylloc;break;case 2:if(Gt=this.productions_[Ec[1]][1],ff.$=Tr[Tr.length-Gt],ff._$={first_line:Ie[Ie.length-(Gt||1)].first_line,last_line:Ie[Ie.length-1].last_line,first_column:Ie[Ie.length-(Gt||1)].first_column,last_column:Ie[Ie.length-1].last_column},ek&&(ff._$.range=[Ie[Ie.length-(Gt||1)].range[0],Ie[Ie.length-1].range[1]]),Vo=this.performAction.apply(ff,[Ue,li,Mn,lu.yy,Ec[1],Tr,Ie].concat(oa)),typeof Vo<"u")return Vo;Gt&&(Vt=Vt.slice(0,-1*Gt*2),Tr=Tr.slice(0,-1*Gt),Ie=Ie.slice(0,-1*Gt)),Vt.push(this.productions_[Ec[1]][0]),Tr.push(ff.$),Ie.push(ff._$),ze=Xi[Vt[Vt.length-2]][Vt[Vt.length-1]],Vt.push(ze);break;case 3:return!0}}return!0},"parse")},sr=function(){var Ln={EOF:1,parseError:C(function(Tt,Vt){if(this.yy.parser)this.yy.parser.parseError(Tt,Vt);else throw new Error(Tt)},"parseError"),setInput:C(function(Et,Tt){return this.yy=Tt||this.yy||{},this._input=Et,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var Et=this._input[0];this.yytext+=Et,this.yyleng++,this.offset++,this.match+=Et,this.matched+=Et;var Tt=Et.match(/(?:\r\n?|\n).*/g);return Tt?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Et},"input"),unput:C(function(Et){var Tt=Et.length,Vt=Et.split(/(?:\r\n?|\n)/g);this._input=Et+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Tt),this.offset-=Tt;var mt=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Vt.length-1&&(this.yylineno-=Vt.length-1);var Tr=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Vt?(Vt.length===mt.length?this.yylloc.first_column:0)+mt[mt.length-Vt.length].length-Vt[0].length:this.yylloc.first_column-Tt},this.options.ranges&&(this.yylloc.range=[Tr[0],Tr[0]+this.yyleng-Tt]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:C(function(Et){this.unput(this.match.slice(Et))},"less"),pastInput:C(function(){var Et=this.matched.substr(0,this.matched.length-this.match.length);return(Et.length>20?"...":"")+Et.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:C(function(){var Et=this.match;return Et.length<20&&(Et+=this._input.substr(0,20-Et.length)),(Et.substr(0,20)+(Et.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:C(function(){var Et=this.pastInput(),Tt=new Array(Et.length+1).join("-");return Et+this.upcomingInput()+` +`+Tt+"^"},"showPosition"),test_match:C(function(Et,Tt){var Vt,mt,Tr;if(this.options.backtrack_lexer&&(Tr={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Tr.yylloc.range=this.yylloc.range.slice(0))),mt=Et[0].match(/(?:\r\n?|\n).*/g),mt&&(this.yylineno+=mt.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:mt?mt[mt.length-1].length-mt[mt.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Et[0].length},this.yytext+=Et[0],this.match+=Et[0],this.matches=Et,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Et[0].length),this.matched+=Et[0],Vt=this.performAction.call(this,this.yy,this,Tt,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Vt)return Vt;if(this._backtrack){for(var Ie in Tr)this[Ie]=Tr[Ie];return!1}return!1},"test_match"),next:C(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Et,Tt,Vt,mt;this._more||(this.yytext="",this.match="");for(var Tr=this._currentRules(),Ie=0;IeTt[0].length)){if(Tt=Vt,mt=Ie,this.options.backtrack_lexer){if(Et=this.test_match(Vt,Tr[Ie]),Et!==!1)return Et;if(this._backtrack){Tt=!1;continue}else return!1}else if(!this.options.flex)break}return Tt?(Et=this.test_match(Tt,Tr[mt]),Et!==!1?Et:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var Tt=this.next();return Tt||this.lex()},"lex"),begin:C(function(Tt){this.conditionStack.push(Tt)},"begin"),popState:C(function(){var Tt=this.conditionStack.length-1;return Tt>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(Tt){return Tt=this.conditionStack.length-1-Math.abs(Tt||0),Tt>=0?this.conditionStack[Tt]:"INITIAL"},"topState"),pushState:C(function(Tt){this.begin(Tt)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:C(function(Tt,Vt,mt,Tr){switch(mt){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),Vt.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const Ie=/\n\s*/g;return Vt.yytext=Vt.yytext.replace(Ie,"
"),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return Tt.lex.firstGraph()&&this.begin("dir"),12;case 36:return Tt.lex.firstGraph()&&this.begin("dir"),12;case 37:return Tt.lex.firstGraph()&&this.begin("dir"),12;case 38:return Tt.lex.firstGraph()&&this.begin("dir"),12;case 39:return 27;case 40:return 32;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return 98;case 45:return this.popState(),13;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return this.popState(),14;case 56:return 121;case 57:return 122;case 58:return 123;case 59:return 124;case 60:return 125;case 61:return 78;case 62:return 105;case 63:return 111;case 64:return 46;case 65:return 60;case 66:return 44;case 67:return 8;case 68:return 106;case 69:return 115;case 70:return this.popState(),77;case 71:return this.pushState("edgeText"),75;case 72:return 119;case 73:return this.popState(),77;case 74:return this.pushState("thickEdgeText"),75;case 75:return 119;case 76:return this.popState(),77;case 77:return this.pushState("dottedEdgeText"),75;case 78:return 119;case 79:return 77;case 80:return this.popState(),53;case 81:return"TEXT";case 82:return this.pushState("ellipseText"),52;case 83:return this.popState(),55;case 84:return this.pushState("text"),54;case 85:return this.popState(),57;case 86:return this.pushState("text"),56;case 87:return 58;case 88:return this.pushState("text"),67;case 89:return this.popState(),64;case 90:return this.pushState("text"),63;case 91:return this.popState(),49;case 92:return this.pushState("text"),48;case 93:return this.popState(),69;case 94:return this.popState(),71;case 95:return 117;case 96:return this.pushState("trapText"),68;case 97:return this.pushState("trapText"),70;case 98:return 118;case 99:return 67;case 100:return 90;case 101:return"SEP";case 102:return 89;case 103:return 115;case 104:return 111;case 105:return 44;case 106:return 109;case 107:return 114;case 108:return 116;case 109:return this.popState(),62;case 110:return this.pushState("text"),62;case 111:return this.popState(),51;case 112:return this.pushState("text"),50;case 113:return this.popState(),31;case 114:return this.pushState("text"),29;case 115:return this.popState(),66;case 116:return this.pushState("text"),65;case 117:return"TEXT";case 118:return"QUOTE";case 119:return 9;case 120:return 10;case 121:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:swimlane-beta\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeData:{rules:[8,11,12,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackargs:{rules:[17,18,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackname:{rules:[14,15,16,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},href:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},click:{rules:[21,24,33,34,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dottedEdgeText:{rules:[21,24,76,78,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},thickEdgeText:{rules:[21,24,73,75,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},edgeText:{rules:[21,24,70,72,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},trapText:{rules:[21,24,79,82,84,86,90,92,93,94,95,96,97,110,112,114,116],inclusive:!1},ellipseText:{rules:[21,24,79,80,81,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},text:{rules:[21,24,79,82,83,84,85,86,89,90,91,92,96,97,109,110,111,112,113,114,115,116,117],inclusive:!1},vertex:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dir:{rules:[21,24,45,46,47,48,49,50,51,52,53,54,55,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr:{rules:[3,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_title:{rules:[1,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},md_string:{rules:[19,20,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},string:{rules:[21,22,23,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,44,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,73,74,76,77,79,82,84,86,87,88,90,92,96,97,98,99,100,101,102,103,104,105,106,107,108,110,112,114,116,118,119,120,121],inclusive:!0}}};return Ln}();St.lexer=sr;function Kr(){this.yy={}}return C(Kr,"Parser"),Kr.prototype=St,St.Parser=Kr,new Kr}();Bke.parser=Bke;var B6t=Bke,$6t=Object.assign({},B6t);$6t.parse=t=>{const e=t.replace(/}\s*\n/g,`} `);return B6t.parse(e)};var yLn=$6t,bLn=C((t,e)=>{const r=Zve,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return tg(n,i,a,e)},"fade"),xLn=C(t=>`.label { font-family: ${t.fontFamily}; color: ${t.nodeTextColor||t.textColor}; @@ -1487,12 +1487,12 @@ Expecting `+it.join(", ")+", got '"+(this.terminals_[ul]||ul)+"'":Pt="Parse erro [data-look="neo"].cluster rect { filter: none; } -`,"getStyles"),TLn=ALn,SLn=$ke({defaultLayout:"swimlane",styles:TLn});const CLn=Object.freeze(Object.defineProperty({__proto__:null,diagram:SLn},Symbol.toStringTag,{value:"Module"}));var zke=function(){var t=C(function(Ce,Oe,$e,he){for($e=$e||{},he=Ce.length;he--;$e[Ce[he]]=Oe);return $e},"o"),e=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],r=[1,10],n=[1,11],i=[1,12],a=[1,13],s=[1,23],o=[1,24],l=[1,25],u=[1,26],h=[1,27],d=[1,19],f=[1,28],p=[1,29],g=[1,20],m=[1,18],v=[1,21],y=[1,22],b=[1,36],x=[1,37],w=[1,38],A=[1,39],T=[1,40],S=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],O=[1,45],k=[1,46],E=[1,55],_=[40,48,50,51,52,71,72],I=[1,66],L=[1,64],R=[1,61],D=[1,65],M=[1,67],P=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],N=[66,67,68,69,70],F=[1,85],B=[1,84],V=[1,82],z=[1,83],U=[6,10,42,47],Q=[6,10,13,41,42,47,48,49],G=[1,93],X=[1,92],Y=[1,91],le=[19,58],q=[1,102],Z=[1,101],ee=[19,58,61,63],re={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:C(function(Oe,$e,he,fe,Te,ge,Qe){var Se=ge.length-1;switch(Te){case 1:break;case 2:this.$=[];break;case 3:ge[Se-1].push(ge[Se]),this.$=ge[Se-1];break;case 4:case 5:this.$=ge[Se];break;case 6:case 7:this.$=[];break;case 8:fe.addEntity(ge[Se-4]),fe.addEntity(ge[Se-2]),fe.addRelationship(ge[Se-4],ge[Se],ge[Se-2],ge[Se-3]);break;case 9:fe.addEntity(ge[Se-8]),fe.addEntity(ge[Se-4]),fe.addRelationship(ge[Se-8],ge[Se],ge[Se-4],ge[Se-5]),fe.setClass([ge[Se-8]],ge[Se-6]),fe.setClass([ge[Se-4]],ge[Se-2]);break;case 10:fe.addEntity(ge[Se-6]),fe.addEntity(ge[Se-2]),fe.addRelationship(ge[Se-6],ge[Se],ge[Se-2],ge[Se-3]),fe.setClass([ge[Se-6]],ge[Se-4]);break;case 11:fe.addEntity(ge[Se-6]),fe.addEntity(ge[Se-4]),fe.addRelationship(ge[Se-6],ge[Se],ge[Se-4],ge[Se-5]),fe.setClass([ge[Se-4]],ge[Se-2]);break;case 12:fe.addEntity(ge[Se-3]),fe.addAttributes(ge[Se-3],ge[Se-1]);break;case 13:fe.addEntity(ge[Se-5]),fe.addAttributes(ge[Se-5],ge[Se-1]),fe.setClass([ge[Se-5]],ge[Se-3]);break;case 14:fe.addEntity(ge[Se-2]);break;case 15:fe.addEntity(ge[Se-4]),fe.setClass([ge[Se-4]],ge[Se-2]);break;case 16:fe.addEntity(ge[Se]);break;case 17:fe.addEntity(ge[Se-2]),fe.setClass([ge[Se-2]],ge[Se]);break;case 18:fe.addEntity(ge[Se-6],ge[Se-4]),fe.addAttributes(ge[Se-6],ge[Se-1]);break;case 19:fe.addEntity(ge[Se-8],ge[Se-6]),fe.addAttributes(ge[Se-8],ge[Se-1]),fe.setClass([ge[Se-8]],ge[Se-3]);break;case 20:fe.addEntity(ge[Se-5],ge[Se-3]);break;case 21:fe.addEntity(ge[Se-7],ge[Se-5]),fe.setClass([ge[Se-7]],ge[Se-2]);break;case 22:fe.addEntity(ge[Se-3],ge[Se-1]);break;case 23:fe.addEntity(ge[Se-5],ge[Se-3]),fe.setClass([ge[Se-5]],ge[Se]);break;case 24:case 25:this.$=ge[Se].trim(),fe.setAccTitle(this.$);break;case 26:case 27:this.$=ge[Se].trim(),fe.setAccDescription(this.$);break;case 32:fe.setDirection("TB");break;case 33:fe.setDirection("BT");break;case 34:fe.setDirection("RL");break;case 35:fe.setDirection("LR");break;case 36:this.$=ge[Se-3],fe.addClass(ge[Se-2],ge[Se-1]);break;case 37:case 38:case 59:case 68:this.$=[ge[Se]];break;case 39:case 40:this.$=ge[Se-2].concat([ge[Se]]);break;case 41:this.$=ge[Se-2],fe.setClass(ge[Se-1],ge[Se]);break;case 42:this.$=ge[Se-3],fe.addCssStyles(ge[Se-2],ge[Se-1]);break;case 43:this.$=[ge[Se]];break;case 44:ge[Se-2].push(ge[Se]),this.$=ge[Se-2];break;case 46:this.$=ge[Se-1]+ge[Se];break;case 54:case 80:case 81:this.$=ge[Se].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=ge[Se];break;case 60:ge[Se].push(ge[Se-1]),this.$=ge[Se];break;case 61:this.$={type:ge[Se-1],name:ge[Se]};break;case 62:this.$={type:ge[Se-2],name:ge[Se-1],keys:ge[Se]};break;case 63:this.$={type:ge[Se-2],name:ge[Se-1],comment:ge[Se]};break;case 64:this.$={type:ge[Se-3],name:ge[Se-2],keys:ge[Se-1],comment:ge[Se]};break;case 65:case 67:case 70:this.$=ge[Se];break;case 66:this.$=ge[Se-1]+ge[Se];break;case 69:ge[Se-2].push(ge[Se]),this.$=ge[Se-2];break;case 71:this.$=ge[Se].replace(/"/g,"");break;case 72:this.$={cardA:ge[Se],relType:ge[Se-1],cardB:ge[Se-2]};break;case 73:this.$=fe.Cardinality.ZERO_OR_ONE;break;case 74:this.$=fe.Cardinality.ZERO_OR_MORE;break;case 75:this.$=fe.Cardinality.ONE_OR_MORE;break;case 76:this.$=fe.Cardinality.ONLY_ONE;break;case 77:this.$=fe.Cardinality.MD_PARENT;break;case 78:this.$=fe.Identification.NON_IDENTIFYING;break;case 79:this.$=fe.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:o,35:l,36:u,37:h,40:d,43:f,44:p,48:g,50:m,51:v,52:y},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:30,11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:o,35:l,36:u,37:h,40:d,43:f,44:p,48:g,50:m,51:v,52:y},t(e,[2,5]),t(e,[2,6]),t(e,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:b,67:x,68:w,69:A,70:T}),{23:[1,41]},{25:[1,42]},{27:[1,43]},t(e,[2,27]),t(e,[2,28]),t(e,[2,29]),t(e,[2,30]),t(e,[2,31]),t(S,[2,54]),t(S,[2,55]),t(S,[2,56]),t(S,[2,57]),t(S,[2,58]),t(e,[2,32]),t(e,[2,33]),t(e,[2,34]),t(e,[2,35]),{16:44,40:O,41:k},{16:47,40:O,41:k},{16:48,40:O,41:k},t(e,[2,4]),{11:49,40:d,48:g,50:m,51:v,52:y},{16:50,40:O,41:k},{18:51,19:[1,52],53:53,54:54,58:E},{11:56,40:d,48:g,50:m,51:v,52:y},{65:57,71:[1,58],72:[1,59]},t(_,[2,73]),t(_,[2,74]),t(_,[2,75]),t(_,[2,76]),t(_,[2,77]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),{13:I,38:60,41:L,42:R,45:62,46:63,48:D,49:M},t(P,[2,37]),t(P,[2,38]),{16:68,40:O,41:k,42:R},{13:I,38:69,41:L,42:R,45:62,46:63,48:D,49:M},{13:[1,70],15:[1,71]},t(e,[2,17],{64:35,12:72,17:[1,73],42:R,66:b,67:x,68:w,69:A,70:T}),{19:[1,74]},t(e,[2,14]),{18:75,19:[2,59],53:53,54:54,58:E},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:b,67:x,68:w,69:A,70:T},t(N,[2,78]),t(N,[2,79]),{6:F,10:B,39:81,42:V,47:z},{40:[1,86],41:[1,87]},t(U,[2,43],{46:88,13:I,41:L,48:D,49:M}),t(Q,[2,45]),t(Q,[2,50]),t(Q,[2,51]),t(Q,[2,52]),t(Q,[2,53]),t(e,[2,41],{42:R}),{6:F,10:B,39:89,42:V,47:z},{14:90,40:G,50:X,73:Y},{16:94,40:O,41:k},{11:95,40:d,48:g,50:m,51:v,52:y},{18:96,19:[1,97],53:53,54:54,58:E},t(e,[2,12]),{19:[2,60]},t(le,[2,61],{56:98,57:99,60:100,62:q,63:Z}),t([19,58,62,63],[2,67]),{58:[2,66]},t(e,[2,22],{15:[1,104],17:[1,103]}),t([40,48,50,51,52],[2,72]),t(e,[2,36]),{13:I,41:L,45:105,46:63,48:D,49:M},t(e,[2,47]),t(e,[2,48]),t(e,[2,49]),t(P,[2,39]),t(P,[2,40]),t(Q,[2,46]),t(e,[2,42]),t(e,[2,8]),t(e,[2,80]),t(e,[2,81]),t(e,[2,82]),{13:[1,106],42:R},{13:[1,108],15:[1,107]},{19:[1,109]},t(e,[2,15]),t(le,[2,62],{57:110,61:[1,111],63:Z}),t(le,[2,63]),t(ee,[2,68]),t(le,[2,71]),t(ee,[2,70]),{18:112,19:[1,113],53:53,54:54,58:E},{16:114,40:O,41:k},t(U,[2,44],{46:88,13:I,41:L,48:D,49:M}),{14:115,40:G,50:X,73:Y},{16:116,40:O,41:k},{14:117,40:G,50:X,73:Y},t(e,[2,13]),t(le,[2,64]),{60:118,62:q},{19:[1,119]},t(e,[2,20]),t(e,[2,23],{17:[1,120],42:R}),t(e,[2,11]),{13:[1,121],42:R},t(e,[2,10]),t(ee,[2,69]),t(e,[2,18]),{18:122,19:[1,123],53:53,54:54,58:E},{14:124,40:G,50:X,73:Y},{19:[1,125]},t(e,[2,21]),t(e,[2,9]),t(e,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:C(function(Oe,$e){if($e.recoverable)this.trace(Oe);else{var he=new Error(Oe);throw he.hash=$e,he}},"parseError"),parse:C(function(Oe){var $e=this,he=[0],fe=[],Te=[null],ge=[],Qe=this.table,Se="",De=0,qe=0,K=2,ce=1,be=ge.slice.call(arguments,1),ne=Object.create(this.lexer),j={yy:{}};for(var ie in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ie)&&(j.yy[ie]=this.yy[ie]);ne.setInput(Oe,j.yy),j.yy.lexer=ne,j.yy.parser=this,typeof ne.yylloc>"u"&&(ne.yylloc={});var pe=ne.yylloc;ge.push(pe);var te=ne.options&&ne.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ye(wt){he.length=he.length-2*wt,Te.length=Te.length-wt,ge.length=ge.length-wt}C(ye,"popStack");function oe(){var wt;return wt=fe.pop()||ne.lex()||ce,typeof wt!="number"&&(wt instanceof Array&&(fe=wt,wt=fe.pop()),wt=$e.symbols_[wt]||wt),wt}C(oe,"lex");for(var _e,Le,Ye,Pe,Xe={},Ne,Ze,Ge,lt;;){if(Le=he[he.length-1],this.defaultActions[Le]?Ye=this.defaultActions[Le]:((_e===null||typeof _e>"u")&&(_e=oe()),Ye=Qe[Le]&&Qe[Le][_e]),typeof Ye>"u"||!Ye.length||!Ye[0]){var Fe="";lt=[];for(Ne in Qe[Le])this.terminals_[Ne]&&Ne>K&<.push("'"+this.terminals_[Ne]+"'");ne.showPosition?Fe="Parse error on line "+(De+1)+`: +`,"getStyles"),SLn=ALn,TLn=$ke({defaultLayout:"swimlane",styles:SLn});const CLn=Object.freeze(Object.defineProperty({__proto__:null,diagram:TLn},Symbol.toStringTag,{value:"Module"}));var zke=function(){var t=C(function(Ce,Oe,$e,he){for($e=$e||{},he=Ce.length;he--;$e[Ce[he]]=Oe);return $e},"o"),e=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],r=[1,10],n=[1,11],i=[1,12],a=[1,13],s=[1,23],o=[1,24],l=[1,25],u=[1,26],h=[1,27],d=[1,19],f=[1,28],p=[1,29],g=[1,20],m=[1,18],v=[1,21],y=[1,22],b=[1,36],x=[1,37],w=[1,38],A=[1,39],S=[1,40],T=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],O=[1,45],k=[1,46],E=[1,55],_=[40,48,50,51,52,71,72],I=[1,66],L=[1,64],R=[1,61],D=[1,65],M=[1,67],P=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],N=[66,67,68,69,70],F=[1,85],B=[1,84],V=[1,82],z=[1,83],U=[6,10,42,47],Q=[6,10,13,41,42,47,48,49],G=[1,93],X=[1,92],Y=[1,91],le=[19,58],q=[1,102],Z=[1,101],ee=[19,58,61,63],re={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:C(function(Oe,$e,he,fe,Se,ge,Qe){var Te=ge.length-1;switch(Se){case 1:break;case 2:this.$=[];break;case 3:ge[Te-1].push(ge[Te]),this.$=ge[Te-1];break;case 4:case 5:this.$=ge[Te];break;case 6:case 7:this.$=[];break;case 8:fe.addEntity(ge[Te-4]),fe.addEntity(ge[Te-2]),fe.addRelationship(ge[Te-4],ge[Te],ge[Te-2],ge[Te-3]);break;case 9:fe.addEntity(ge[Te-8]),fe.addEntity(ge[Te-4]),fe.addRelationship(ge[Te-8],ge[Te],ge[Te-4],ge[Te-5]),fe.setClass([ge[Te-8]],ge[Te-6]),fe.setClass([ge[Te-4]],ge[Te-2]);break;case 10:fe.addEntity(ge[Te-6]),fe.addEntity(ge[Te-2]),fe.addRelationship(ge[Te-6],ge[Te],ge[Te-2],ge[Te-3]),fe.setClass([ge[Te-6]],ge[Te-4]);break;case 11:fe.addEntity(ge[Te-6]),fe.addEntity(ge[Te-4]),fe.addRelationship(ge[Te-6],ge[Te],ge[Te-4],ge[Te-5]),fe.setClass([ge[Te-4]],ge[Te-2]);break;case 12:fe.addEntity(ge[Te-3]),fe.addAttributes(ge[Te-3],ge[Te-1]);break;case 13:fe.addEntity(ge[Te-5]),fe.addAttributes(ge[Te-5],ge[Te-1]),fe.setClass([ge[Te-5]],ge[Te-3]);break;case 14:fe.addEntity(ge[Te-2]);break;case 15:fe.addEntity(ge[Te-4]),fe.setClass([ge[Te-4]],ge[Te-2]);break;case 16:fe.addEntity(ge[Te]);break;case 17:fe.addEntity(ge[Te-2]),fe.setClass([ge[Te-2]],ge[Te]);break;case 18:fe.addEntity(ge[Te-6],ge[Te-4]),fe.addAttributes(ge[Te-6],ge[Te-1]);break;case 19:fe.addEntity(ge[Te-8],ge[Te-6]),fe.addAttributes(ge[Te-8],ge[Te-1]),fe.setClass([ge[Te-8]],ge[Te-3]);break;case 20:fe.addEntity(ge[Te-5],ge[Te-3]);break;case 21:fe.addEntity(ge[Te-7],ge[Te-5]),fe.setClass([ge[Te-7]],ge[Te-2]);break;case 22:fe.addEntity(ge[Te-3],ge[Te-1]);break;case 23:fe.addEntity(ge[Te-5],ge[Te-3]),fe.setClass([ge[Te-5]],ge[Te]);break;case 24:case 25:this.$=ge[Te].trim(),fe.setAccTitle(this.$);break;case 26:case 27:this.$=ge[Te].trim(),fe.setAccDescription(this.$);break;case 32:fe.setDirection("TB");break;case 33:fe.setDirection("BT");break;case 34:fe.setDirection("RL");break;case 35:fe.setDirection("LR");break;case 36:this.$=ge[Te-3],fe.addClass(ge[Te-2],ge[Te-1]);break;case 37:case 38:case 59:case 68:this.$=[ge[Te]];break;case 39:case 40:this.$=ge[Te-2].concat([ge[Te]]);break;case 41:this.$=ge[Te-2],fe.setClass(ge[Te-1],ge[Te]);break;case 42:this.$=ge[Te-3],fe.addCssStyles(ge[Te-2],ge[Te-1]);break;case 43:this.$=[ge[Te]];break;case 44:ge[Te-2].push(ge[Te]),this.$=ge[Te-2];break;case 46:this.$=ge[Te-1]+ge[Te];break;case 54:case 80:case 81:this.$=ge[Te].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=ge[Te];break;case 60:ge[Te].push(ge[Te-1]),this.$=ge[Te];break;case 61:this.$={type:ge[Te-1],name:ge[Te]};break;case 62:this.$={type:ge[Te-2],name:ge[Te-1],keys:ge[Te]};break;case 63:this.$={type:ge[Te-2],name:ge[Te-1],comment:ge[Te]};break;case 64:this.$={type:ge[Te-3],name:ge[Te-2],keys:ge[Te-1],comment:ge[Te]};break;case 65:case 67:case 70:this.$=ge[Te];break;case 66:this.$=ge[Te-1]+ge[Te];break;case 69:ge[Te-2].push(ge[Te]),this.$=ge[Te-2];break;case 71:this.$=ge[Te].replace(/"/g,"");break;case 72:this.$={cardA:ge[Te],relType:ge[Te-1],cardB:ge[Te-2]};break;case 73:this.$=fe.Cardinality.ZERO_OR_ONE;break;case 74:this.$=fe.Cardinality.ZERO_OR_MORE;break;case 75:this.$=fe.Cardinality.ONE_OR_MORE;break;case 76:this.$=fe.Cardinality.ONLY_ONE;break;case 77:this.$=fe.Cardinality.MD_PARENT;break;case 78:this.$=fe.Identification.NON_IDENTIFYING;break;case 79:this.$=fe.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:o,35:l,36:u,37:h,40:d,43:f,44:p,48:g,50:m,51:v,52:y},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:30,11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:o,35:l,36:u,37:h,40:d,43:f,44:p,48:g,50:m,51:v,52:y},t(e,[2,5]),t(e,[2,6]),t(e,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:b,67:x,68:w,69:A,70:S}),{23:[1,41]},{25:[1,42]},{27:[1,43]},t(e,[2,27]),t(e,[2,28]),t(e,[2,29]),t(e,[2,30]),t(e,[2,31]),t(T,[2,54]),t(T,[2,55]),t(T,[2,56]),t(T,[2,57]),t(T,[2,58]),t(e,[2,32]),t(e,[2,33]),t(e,[2,34]),t(e,[2,35]),{16:44,40:O,41:k},{16:47,40:O,41:k},{16:48,40:O,41:k},t(e,[2,4]),{11:49,40:d,48:g,50:m,51:v,52:y},{16:50,40:O,41:k},{18:51,19:[1,52],53:53,54:54,58:E},{11:56,40:d,48:g,50:m,51:v,52:y},{65:57,71:[1,58],72:[1,59]},t(_,[2,73]),t(_,[2,74]),t(_,[2,75]),t(_,[2,76]),t(_,[2,77]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),{13:I,38:60,41:L,42:R,45:62,46:63,48:D,49:M},t(P,[2,37]),t(P,[2,38]),{16:68,40:O,41:k,42:R},{13:I,38:69,41:L,42:R,45:62,46:63,48:D,49:M},{13:[1,70],15:[1,71]},t(e,[2,17],{64:35,12:72,17:[1,73],42:R,66:b,67:x,68:w,69:A,70:S}),{19:[1,74]},t(e,[2,14]),{18:75,19:[2,59],53:53,54:54,58:E},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:b,67:x,68:w,69:A,70:S},t(N,[2,78]),t(N,[2,79]),{6:F,10:B,39:81,42:V,47:z},{40:[1,86],41:[1,87]},t(U,[2,43],{46:88,13:I,41:L,48:D,49:M}),t(Q,[2,45]),t(Q,[2,50]),t(Q,[2,51]),t(Q,[2,52]),t(Q,[2,53]),t(e,[2,41],{42:R}),{6:F,10:B,39:89,42:V,47:z},{14:90,40:G,50:X,73:Y},{16:94,40:O,41:k},{11:95,40:d,48:g,50:m,51:v,52:y},{18:96,19:[1,97],53:53,54:54,58:E},t(e,[2,12]),{19:[2,60]},t(le,[2,61],{56:98,57:99,60:100,62:q,63:Z}),t([19,58,62,63],[2,67]),{58:[2,66]},t(e,[2,22],{15:[1,104],17:[1,103]}),t([40,48,50,51,52],[2,72]),t(e,[2,36]),{13:I,41:L,45:105,46:63,48:D,49:M},t(e,[2,47]),t(e,[2,48]),t(e,[2,49]),t(P,[2,39]),t(P,[2,40]),t(Q,[2,46]),t(e,[2,42]),t(e,[2,8]),t(e,[2,80]),t(e,[2,81]),t(e,[2,82]),{13:[1,106],42:R},{13:[1,108],15:[1,107]},{19:[1,109]},t(e,[2,15]),t(le,[2,62],{57:110,61:[1,111],63:Z}),t(le,[2,63]),t(ee,[2,68]),t(le,[2,71]),t(ee,[2,70]),{18:112,19:[1,113],53:53,54:54,58:E},{16:114,40:O,41:k},t(U,[2,44],{46:88,13:I,41:L,48:D,49:M}),{14:115,40:G,50:X,73:Y},{16:116,40:O,41:k},{14:117,40:G,50:X,73:Y},t(e,[2,13]),t(le,[2,64]),{60:118,62:q},{19:[1,119]},t(e,[2,20]),t(e,[2,23],{17:[1,120],42:R}),t(e,[2,11]),{13:[1,121],42:R},t(e,[2,10]),t(ee,[2,69]),t(e,[2,18]),{18:122,19:[1,123],53:53,54:54,58:E},{14:124,40:G,50:X,73:Y},{19:[1,125]},t(e,[2,21]),t(e,[2,9]),t(e,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:C(function(Oe,$e){if($e.recoverable)this.trace(Oe);else{var he=new Error(Oe);throw he.hash=$e,he}},"parseError"),parse:C(function(Oe){var $e=this,he=[0],fe=[],Se=[null],ge=[],Qe=this.table,Te="",De=0,qe=0,K=2,ce=1,be=ge.slice.call(arguments,1),ne=Object.create(this.lexer),j={yy:{}};for(var ie in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ie)&&(j.yy[ie]=this.yy[ie]);ne.setInput(Oe,j.yy),j.yy.lexer=ne,j.yy.parser=this,typeof ne.yylloc>"u"&&(ne.yylloc={});var pe=ne.yylloc;ge.push(pe);var te=ne.options&&ne.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ye(wt){he.length=he.length-2*wt,Se.length=Se.length-wt,ge.length=ge.length-wt}C(ye,"popStack");function oe(){var wt;return wt=fe.pop()||ne.lex()||ce,typeof wt!="number"&&(wt instanceof Array&&(fe=wt,wt=fe.pop()),wt=$e.symbols_[wt]||wt),wt}C(oe,"lex");for(var _e,Le,Ye,Pe,Xe={},Ne,Ze,Ge,lt;;){if(Le=he[he.length-1],this.defaultActions[Le]?Ye=this.defaultActions[Le]:((_e===null||typeof _e>"u")&&(_e=oe()),Ye=Qe[Le]&&Qe[Le][_e]),typeof Ye>"u"||!Ye.length||!Ye[0]){var Fe="";lt=[];for(Ne in Qe[Le])this.terminals_[Ne]&&Ne>K&<.push("'"+this.terminals_[Ne]+"'");ne.showPosition?Fe="Parse error on line "+(De+1)+`: `+ne.showPosition()+` -Expecting `+lt.join(", ")+", got '"+(this.terminals_[_e]||_e)+"'":Fe="Parse error on line "+(De+1)+": Unexpected "+(_e==ce?"end of input":"'"+(this.terminals_[_e]||_e)+"'"),this.parseError(Fe,{text:ne.match,token:this.terminals_[_e]||_e,line:ne.yylineno,loc:pe,expected:lt})}if(Ye[0]instanceof Array&&Ye.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Le+", token: "+_e);switch(Ye[0]){case 1:he.push(_e),Te.push(ne.yytext),ge.push(ne.yylloc),he.push(Ye[1]),_e=null,qe=ne.yyleng,Se=ne.yytext,De=ne.yylineno,pe=ne.yylloc;break;case 2:if(Ze=this.productions_[Ye[1]][1],Xe.$=Te[Te.length-Ze],Xe._$={first_line:ge[ge.length-(Ze||1)].first_line,last_line:ge[ge.length-1].last_line,first_column:ge[ge.length-(Ze||1)].first_column,last_column:ge[ge.length-1].last_column},te&&(Xe._$.range=[ge[ge.length-(Ze||1)].range[0],ge[ge.length-1].range[1]]),Pe=this.performAction.apply(Xe,[Se,qe,De,j.yy,Ye[1],Te,ge].concat(be)),typeof Pe<"u")return Pe;Ze&&(he=he.slice(0,-1*Ze*2),Te=Te.slice(0,-1*Ze),ge=ge.slice(0,-1*Ze)),he.push(this.productions_[Ye[1]][0]),Te.push(Xe.$),ge.push(Xe._$),Ge=Qe[he[he.length-2]][he[he.length-1]],he.push(Ge);break;case 3:return!0}}return!0},"parse")},ve=function(){var Ce={EOF:1,parseError:C(function($e,he){if(this.yy.parser)this.yy.parser.parseError($e,he);else throw new Error($e)},"parseError"),setInput:C(function(Oe,$e){return this.yy=$e||this.yy||{},this._input=Oe,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var Oe=this._input[0];this.yytext+=Oe,this.yyleng++,this.offset++,this.match+=Oe,this.matched+=Oe;var $e=Oe.match(/(?:\r\n?|\n).*/g);return $e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Oe},"input"),unput:C(function(Oe){var $e=Oe.length,he=Oe.split(/(?:\r\n?|\n)/g);this._input=Oe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-$e),this.offset-=$e;var fe=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),he.length-1&&(this.yylineno-=he.length-1);var Te=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:he?(he.length===fe.length?this.yylloc.first_column:0)+fe[fe.length-he.length].length-he[0].length:this.yylloc.first_column-$e},this.options.ranges&&(this.yylloc.range=[Te[0],Te[0]+this.yyleng-$e]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +Expecting `+lt.join(", ")+", got '"+(this.terminals_[_e]||_e)+"'":Fe="Parse error on line "+(De+1)+": Unexpected "+(_e==ce?"end of input":"'"+(this.terminals_[_e]||_e)+"'"),this.parseError(Fe,{text:ne.match,token:this.terminals_[_e]||_e,line:ne.yylineno,loc:pe,expected:lt})}if(Ye[0]instanceof Array&&Ye.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Le+", token: "+_e);switch(Ye[0]){case 1:he.push(_e),Se.push(ne.yytext),ge.push(ne.yylloc),he.push(Ye[1]),_e=null,qe=ne.yyleng,Te=ne.yytext,De=ne.yylineno,pe=ne.yylloc;break;case 2:if(Ze=this.productions_[Ye[1]][1],Xe.$=Se[Se.length-Ze],Xe._$={first_line:ge[ge.length-(Ze||1)].first_line,last_line:ge[ge.length-1].last_line,first_column:ge[ge.length-(Ze||1)].first_column,last_column:ge[ge.length-1].last_column},te&&(Xe._$.range=[ge[ge.length-(Ze||1)].range[0],ge[ge.length-1].range[1]]),Pe=this.performAction.apply(Xe,[Te,qe,De,j.yy,Ye[1],Se,ge].concat(be)),typeof Pe<"u")return Pe;Ze&&(he=he.slice(0,-1*Ze*2),Se=Se.slice(0,-1*Ze),ge=ge.slice(0,-1*Ze)),he.push(this.productions_[Ye[1]][0]),Se.push(Xe.$),ge.push(Xe._$),Ge=Qe[he[he.length-2]][he[he.length-1]],he.push(Ge);break;case 3:return!0}}return!0},"parse")},ve=function(){var Ce={EOF:1,parseError:C(function($e,he){if(this.yy.parser)this.yy.parser.parseError($e,he);else throw new Error($e)},"parseError"),setInput:C(function(Oe,$e){return this.yy=$e||this.yy||{},this._input=Oe,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var Oe=this._input[0];this.yytext+=Oe,this.yyleng++,this.offset++,this.match+=Oe,this.matched+=Oe;var $e=Oe.match(/(?:\r\n?|\n).*/g);return $e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Oe},"input"),unput:C(function(Oe){var $e=Oe.length,he=Oe.split(/(?:\r\n?|\n)/g);this._input=Oe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-$e),this.offset-=$e;var fe=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),he.length-1&&(this.yylineno-=he.length-1);var Se=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:he?(he.length===fe.length?this.yylloc.first_column:0)+fe[fe.length-he.length].length-he[0].length:this.yylloc.first_column-$e},this.options.ranges&&(this.yylloc.range=[Se[0],Se[0]+this.yyleng-$e]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:C(function(Oe){this.unput(this.match.slice(Oe))},"less"),pastInput:C(function(){var Oe=this.matched.substr(0,this.matched.length-this.match.length);return(Oe.length>20?"...":"")+Oe.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:C(function(){var Oe=this.match;return Oe.length<20&&(Oe+=this._input.substr(0,20-Oe.length)),(Oe.substr(0,20)+(Oe.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:C(function(){var Oe=this.pastInput(),$e=new Array(Oe.length+1).join("-");return Oe+this.upcomingInput()+` -`+$e+"^"},"showPosition"),test_match:C(function(Oe,$e){var he,fe,Te;if(this.options.backtrack_lexer&&(Te={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Te.yylloc.range=this.yylloc.range.slice(0))),fe=Oe[0].match(/(?:\r\n?|\n).*/g),fe&&(this.yylineno+=fe.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:fe?fe[fe.length-1].length-fe[fe.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Oe[0].length},this.yytext+=Oe[0],this.match+=Oe[0],this.matches=Oe,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Oe[0].length),this.matched+=Oe[0],he=this.performAction.call(this,this.yy,this,$e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),he)return he;if(this._backtrack){for(var ge in Te)this[ge]=Te[ge];return!1}return!1},"test_match"),next:C(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Oe,$e,he,fe;this._more||(this.yytext="",this.match="");for(var Te=this._currentRules(),ge=0;ge$e[0].length)){if($e=he,fe=ge,this.options.backtrack_lexer){if(Oe=this.test_match(he,Te[ge]),Oe!==!1)return Oe;if(this._backtrack){$e=!1;continue}else return!1}else if(!this.options.flex)break}return $e?(Oe=this.test_match($e,Te[fe]),Oe!==!1?Oe:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var $e=this.next();return $e||this.lex()},"lex"),begin:C(function($e){this.conditionStack.push($e)},"begin"),popState:C(function(){var $e=this.conditionStack.length-1;return $e>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function($e){return $e=this.conditionStack.length-1-Math.abs($e||0),$e>=0?this.conditionStack[$e]:"INITIAL"},"topState"),pushState:C(function($e){this.begin($e)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:C(function($e,he,fe,Te){switch(fe){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 73;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 62;case 25:return 58;case 26:return 58;case 27:this.begin("block_bq");break;case 28:return 58;case 29:this.popState();break;case 30:return 63;case 31:break;case 32:return this.popState(),19;case 33:return he.yytext[0];case 34:return 20;case 35:return 21;case 36:return this.begin("style"),44;case 37:return this.popState(),10;case 38:break;case 39:return 13;case 40:return 42;case 41:return 49;case 42:return this.begin("style"),37;case 43:return 43;case 44:return 66;case 45:return 68;case 46:return 68;case 47:return 68;case 48:return 66;case 49:return 66;case 50:return 67;case 51:return 67;case 52:return 67;case 53:return 67;case 54:return 67;case 55:return 68;case 56:return 67;case 57:return 68;case 58:return 69;case 59:return 69;case 60:return 51;case 61:return 69;case 62:return 69;case 63:return 69;case 64:return 52;case 65:return 48;case 66:return 69;case 67:return 66;case 68:return 67;case 69:return 68;case 70:return 70;case 71:return 71;case 72:return 72;case 73:return 72;case 74:return 71;case 75:return 71;case 76:return 71;case 77:return 41;case 78:return 47;case 79:return 40;case 80:return he.yytext[0];case 81:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[37,38,39,40,41,77,78],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[28,29],inclusive:!1},block:{rules:[23,24,25,26,27,30,31,32,33],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,34,35,36,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,79,80,81],inclusive:!0}}};return Ce}();re.lexer=ve;function ae(){this.yy={}}return C(ae,"Parser"),ae.prototype=re,re.Parser=ae,new ae}();zke.parser=zke;var OLn=zke,kLn=(ED=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Da,this.getAccTitle=Ja,this.setAccDescription=es,this.getAccDescription=ts,this.setDiagramTitle=rs,this.getDiagramTitle=La,this.getConfig=C(()=>He().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}addEntity(e,r=""){var n;return this.entities.has(e)?!((n=this.entities.get(e))!=null&&n.alias)&&r&&(this.entities.get(e).alias=r,me.info(`Add alias '${r}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:r,shape:"erBox",look:He().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),me.info("Added new entity :",e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,r){const n=this.addEntity(e);let i;for(i=r.length-1;i>=0;i--)r[i].keys||(r[i].keys=[]),r[i].comment||(r[i].comment=""),n.attributes.push(r[i]),me.debug("Added attribute ",r[i].name)}addRelationship(e,r,n,i){const a=this.entities.get(e),s=this.entities.get(n);if(!a||!s)return;const o={entityA:a.id,roleA:r,entityB:s.id,relSpec:i};this.relationships.push(o),me.debug("Added new relationship :",o)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}addCssStyles(e,r){for(const n of e){const i=this.entities.get(n);if(!r||!i)return;for(const a of r)i.cssStyles.push(a)}}addClass(e,r){e.forEach(n=>{let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r&&r.forEach(function(a){if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)})})}setClass(e,r){for(const n of e){const i=this.entities.get(n);if(i)for(const a of r)i.cssClasses+=" "+a}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],Aa()}getData(){const e=[],r=[],n=He();let i=0;for(const s of this.entities.keys()){const o=this.entities.get(s);o&&(o.cssCompiledStyles=this.getCompiledStyles(o.cssClasses.split(" ")),o.colorIndex=i++,e.push(o))}let a=0;for(const s of this.relationships){const o={id:Y5(s.entityA,s.entityB,{prefix:"id",counter:a++}),type:"normal",curve:"basis",start:s.entityA,end:s.entityB,label:s.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:s.relSpec.cardB.toLowerCase(),arrowTypeEnd:s.relSpec.cardA.toLowerCase(),pattern:s.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:n.look,labelType:"markdown"};r.push(o)}return{nodes:e,edges:r,other:{},config:n,direction:"TB"}}},C(ED,"ErDB"),ED),z6t={};wq(z6t,{draw:()=>ELn});var ELn=C(async function(t,e,r,n){me.info("REF0:"),me.info("Drawing er diagram (unified)",e);const{securityLevel:i,er:a,layout:s}=He(),o=n.db.getData(),l=z3(e,i);o.type=n.type,o.layoutAlgorithm=R7(s),o.config.flowchart.nodeSpacing=(a==null?void 0:a.nodeSpacing)||140,o.config.flowchart.rankSpacing=(a==null?void 0:a.rankSpacing)||80,o.direction=n.db.getDirection();const{config:u}=o,{look:h}=u;h==="neo"?o.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:o.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],o.diagramId=e,await e4(o,l),o.layoutAlgorithm==="elk"&&l.select(".edges").lower();const d=l.selectAll('[id*="-background"]');Array.from(d).length>0&&d.each(function(){const p=Ot(this),m=p.attr("id").replace("-background",""),v=l.select(`#${CSS.escape(m)}`);if(!v.empty()){const y=v.attr("transform");p.attr("transform",y)}});const f=8;ln.insertTitle(l,"erDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),IC(l,f,"erDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),U6t=C((t,e)=>{const r=Zve,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return tg(n,i,a,e)},"fade"),_ee=new Set(["redux-color","redux-dark-color"]),_Ln=C(t=>{const{theme:e,look:r,bkgColorArray:n,borderColorArray:i}=t;if(!_ee.has(e))return"";const a=(n==null?void 0:n.length)>0;let s="";for(let o=0;o$e[0].length)){if($e=he,fe=ge,this.options.backtrack_lexer){if(Oe=this.test_match(he,Se[ge]),Oe!==!1)return Oe;if(this._backtrack){$e=!1;continue}else return!1}else if(!this.options.flex)break}return $e?(Oe=this.test_match($e,Se[fe]),Oe!==!1?Oe:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var $e=this.next();return $e||this.lex()},"lex"),begin:C(function($e){this.conditionStack.push($e)},"begin"),popState:C(function(){var $e=this.conditionStack.length-1;return $e>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function($e){return $e=this.conditionStack.length-1-Math.abs($e||0),$e>=0?this.conditionStack[$e]:"INITIAL"},"topState"),pushState:C(function($e){this.begin($e)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:C(function($e,he,fe,Se){switch(fe){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 73;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 62;case 25:return 58;case 26:return 58;case 27:this.begin("block_bq");break;case 28:return 58;case 29:this.popState();break;case 30:return 63;case 31:break;case 32:return this.popState(),19;case 33:return he.yytext[0];case 34:return 20;case 35:return 21;case 36:return this.begin("style"),44;case 37:return this.popState(),10;case 38:break;case 39:return 13;case 40:return 42;case 41:return 49;case 42:return this.begin("style"),37;case 43:return 43;case 44:return 66;case 45:return 68;case 46:return 68;case 47:return 68;case 48:return 66;case 49:return 66;case 50:return 67;case 51:return 67;case 52:return 67;case 53:return 67;case 54:return 67;case 55:return 68;case 56:return 67;case 57:return 68;case 58:return 69;case 59:return 69;case 60:return 51;case 61:return 69;case 62:return 69;case 63:return 69;case 64:return 52;case 65:return 48;case 66:return 69;case 67:return 66;case 68:return 67;case 69:return 68;case 70:return 70;case 71:return 71;case 72:return 72;case 73:return 72;case 74:return 71;case 75:return 71;case 76:return 71;case 77:return 41;case 78:return 47;case 79:return 40;case 80:return he.yytext[0];case 81:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[37,38,39,40,41,77,78],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[28,29],inclusive:!1},block:{rules:[23,24,25,26,27,30,31,32,33],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,34,35,36,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,79,80,81],inclusive:!0}}};return Ce}();re.lexer=ve;function ae(){this.yy={}}return C(ae,"Parser"),ae.prototype=re,re.Parser=ae,new ae}();zke.parser=zke;var OLn=zke,kLn=(ED=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Da,this.getAccTitle=Ja,this.setAccDescription=es,this.getAccDescription=ts,this.setDiagramTitle=rs,this.getDiagramTitle=La,this.getConfig=C(()=>He().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}addEntity(e,r=""){var n;return this.entities.has(e)?!((n=this.entities.get(e))!=null&&n.alias)&&r&&(this.entities.get(e).alias=r,me.info(`Add alias '${r}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:r,shape:"erBox",look:He().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),me.info("Added new entity :",e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,r){const n=this.addEntity(e);let i;for(i=r.length-1;i>=0;i--)r[i].keys||(r[i].keys=[]),r[i].comment||(r[i].comment=""),n.attributes.push(r[i]),me.debug("Added attribute ",r[i].name)}addRelationship(e,r,n,i){const a=this.entities.get(e),s=this.entities.get(n);if(!a||!s)return;const o={entityA:a.id,roleA:r,entityB:s.id,relSpec:i};this.relationships.push(o),me.debug("Added new relationship :",o)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}addCssStyles(e,r){for(const n of e){const i=this.entities.get(n);if(!r||!i)return;for(const a of r)i.cssStyles.push(a)}}addClass(e,r){e.forEach(n=>{let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r&&r.forEach(function(a){if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)})})}setClass(e,r){for(const n of e){const i=this.entities.get(n);if(i)for(const a of r)i.cssClasses+=" "+a}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],Aa()}getData(){const e=[],r=[],n=He();let i=0;for(const s of this.entities.keys()){const o=this.entities.get(s);o&&(o.cssCompiledStyles=this.getCompiledStyles(o.cssClasses.split(" ")),o.colorIndex=i++,e.push(o))}let a=0;for(const s of this.relationships){const o={id:Y5(s.entityA,s.entityB,{prefix:"id",counter:a++}),type:"normal",curve:"basis",start:s.entityA,end:s.entityB,label:s.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:s.relSpec.cardB.toLowerCase(),arrowTypeEnd:s.relSpec.cardA.toLowerCase(),pattern:s.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:n.look,labelType:"markdown"};r.push(o)}return{nodes:e,edges:r,other:{},config:n,direction:"TB"}}},C(ED,"ErDB"),ED),z6t={};wq(z6t,{draw:()=>ELn});var ELn=C(async function(t,e,r,n){me.info("REF0:"),me.info("Drawing er diagram (unified)",e);const{securityLevel:i,er:a,layout:s}=He(),o=n.db.getData(),l=z3(e,i);o.type=n.type,o.layoutAlgorithm=R7(s),o.config.flowchart.nodeSpacing=(a==null?void 0:a.nodeSpacing)||140,o.config.flowchart.rankSpacing=(a==null?void 0:a.rankSpacing)||80,o.direction=n.db.getDirection();const{config:u}=o,{look:h}=u;h==="neo"?o.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:o.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],o.diagramId=e,await e4(o,l),o.layoutAlgorithm==="elk"&&l.select(".edges").lower();const d=l.selectAll('[id*="-background"]');Array.from(d).length>0&&d.each(function(){const p=Ot(this),m=p.attr("id").replace("-background",""),v=l.select(`#${CSS.escape(m)}`);if(!v.empty()){const y=v.attr("transform");p.attr("transform",y)}});const f=8;ln.insertTitle(l,"erDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),IC(l,f,"erDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),U6t=C((t,e)=>{const r=Zve,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return tg(n,i,a,e)},"fade"),_ee=new Set(["redux-color","redux-dark-color"]),_Ln=C(t=>{const{theme:e,look:r,bkgColorArray:n,borderColorArray:i}=t;if(!_ee.has(e))return"";const a=(n==null?void 0:n.length)>0;let s="";for(let o=0;oH9(t,"name",{value:e,configurable:!0}),$Ln=(t,e)=>function(){return t&&(e=(0,t[Vke(t)[0]])(t=0)),e},Nn=(t,e)=>function(){return e||(0,t[Vke(t)[0]])((e={exports:{}}).exports,e),e.exports},X2=(t,e)=>{for(var r in e)H9(t,r,{get:e[r],enumerable:!0})},Qke=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Vke(e))!BLn.call(t,i)&&i!==r&&H9(t,i,{get:()=>e[i],enumerable:!(n=PLn(e,i))||n.enumerable});return t},Ree=(t,e,r)=>(Qke(t,e,"default"),r),Gke=(t,e,r)=>(r=t!=null?ILn(NLn(t)):{},Qke(H9(r,"default",{value:t,enumerable:!0}),t)),Hke=t=>Qke(H9({},"__esModule",{value:!0}),t),Dee={};X2(Dee,{AnnotatedTextEdit:()=>_1,ChangeAnnotation:()=>NC,ChangeAnnotationIdentifier:()=>yc,CodeAction:()=>OEe,CodeActionContext:()=>CEe,CodeActionKind:()=>SEe,CodeActionTriggerKind:()=>J9,CodeDescription:()=>tEe,CodeLens:()=>kEe,Color:()=>Mee,ColorInformation:()=>jke,ColorPresentation:()=>Xke,Command:()=>PC,CompletionItem:()=>dEe,CompletionItemKind:()=>sEe,CompletionItemLabelDetails:()=>hEe,CompletionItemTag:()=>lEe,CompletionList:()=>fEe,CreateFile:()=>U3,DeleteFile:()=>Q3,Diagnostic:()=>q9,DiagnosticRelatedInformation:()=>Iee,DiagnosticSeverity:()=>Jke,DiagnosticTag:()=>eEe,DocumentHighlight:()=>yEe,DocumentHighlightKind:()=>vEe,DocumentLink:()=>_Ee,DocumentSymbol:()=>TEe,DocumentUri:()=>Wke,EOL:()=>Q6t,FoldingRange:()=>Zke,FoldingRangeKind:()=>Kke,FormattingOptions:()=>EEe,Hover:()=>pEe,InlayHint:()=>$Ee,InlayHintKind:()=>Bee,InlayHintLabelPart:()=>$ee,InlineCompletionContext:()=>GEe,InlineCompletionItem:()=>zEe,InlineCompletionList:()=>UEe,InlineCompletionTriggerKind:()=>VEe,InlineValueContext:()=>BEe,InlineValueEvaluatableExpression:()=>NEe,InlineValueText:()=>IEe,InlineValueVariableLookup:()=>PEe,InsertReplaceEdit:()=>cEe,InsertTextFormat:()=>oEe,InsertTextMode:()=>uEe,Location:()=>Y9,LocationLink:()=>qke,MarkedString:()=>Z9,MarkupContent:()=>G3,MarkupKind:()=>Nee,OptionalVersionedTextDocumentIdentifier:()=>K9,ParameterInformation:()=>gEe,Position:()=>ji,Range:()=>Oi,RenameFile:()=>V3,SelectedCompletionInfo:()=>QEe,SelectionRange:()=>REe,SemanticTokenModifiers:()=>LEe,SemanticTokenTypes:()=>DEe,SemanticTokens:()=>MEe,SignatureInformation:()=>mEe,StringValue:()=>FEe,SymbolInformation:()=>wEe,SymbolKind:()=>bEe,SymbolTag:()=>xEe,TextDocument:()=>WEe,TextDocumentEdit:()=>j9,TextDocumentIdentifier:()=>nEe,TextDocumentItem:()=>aEe,TextEdit:()=>U0,URI:()=>Lee,VersionedTextDocumentIdentifier:()=>iEe,WorkspaceChange:()=>V6t,WorkspaceEdit:()=>Pee,WorkspaceFolder:()=>HEe,WorkspaceSymbol:()=>AEe,integer:()=>Yke,uinteger:()=>W9});var Wke,Lee,Yke,W9,ji,Oi,Y9,qke,Mee,jke,Xke,Kke,Zke,Iee,Jke,eEe,tEe,q9,PC,U0,NC,yc,_1,j9,U3,V3,Q3,Pee,X9,rEe,V6t,nEe,iEe,K9,aEe,Nee,G3,sEe,oEe,lEe,cEe,uEe,hEe,dEe,fEe,Z9,pEe,gEe,mEe,vEe,yEe,bEe,xEe,wEe,AEe,TEe,SEe,J9,CEe,OEe,kEe,EEe,_Ee,REe,DEe,LEe,MEe,IEe,PEe,NEe,BEe,Bee,$ee,$Ee,FEe,zEe,UEe,VEe,QEe,GEe,HEe,Q6t,WEe,G6t,ct,eF=$Ln({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){var t,e,r,n;(function(i){function a(s){return typeof s=="string"}$(a,"is"),i.is=a})(Wke||(Wke={})),function(i){function a(s){return typeof s=="string"}$(a,"is"),i.is=a}(Lee||(Lee={})),function(i){i.MIN_VALUE=-2147483648,i.MAX_VALUE=2147483647;function a(s){return typeof s=="number"&&i.MIN_VALUE<=s&&s<=i.MAX_VALUE}$(a,"is"),i.is=a}(Yke||(Yke={})),function(i){i.MIN_VALUE=0,i.MAX_VALUE=2147483647;function a(s){return typeof s=="number"&&i.MIN_VALUE<=s&&s<=i.MAX_VALUE}$(a,"is"),i.is=a}(W9||(W9={})),function(i){function a(o,l){return o===Number.MAX_VALUE&&(o=W9.MAX_VALUE),l===Number.MAX_VALUE&&(l=W9.MAX_VALUE),{line:o,character:l}}$(a,"create"),i.create=a;function s(o){let l=o;return ct.objectLiteral(l)&&ct.uinteger(l.line)&&ct.uinteger(l.character)}$(s,"is"),i.is=s}(ji||(ji={})),function(i){function a(o,l,u,h){if(ct.uinteger(o)&&ct.uinteger(l)&&ct.uinteger(u)&&ct.uinteger(h))return{start:ji.create(o,l),end:ji.create(u,h)};if(ji.is(o)&&ji.is(l))return{start:o,end:l};throw new Error(`Range#create called with invalid arguments[${o}, ${l}, ${u}, ${h}]`)}$(a,"create"),i.create=a;function s(o){let l=o;return ct.objectLiteral(l)&&ji.is(l.start)&&ji.is(l.end)}$(s,"is"),i.is=s}(Oi||(Oi={})),function(i){function a(o,l){return{uri:o,range:l}}$(a,"create"),i.create=a;function s(o){let l=o;return ct.objectLiteral(l)&&Oi.is(l.range)&&(ct.string(l.uri)||ct.undefined(l.uri))}$(s,"is"),i.is=s}(Y9||(Y9={})),function(i){function a(o,l,u,h){return{targetUri:o,targetRange:l,targetSelectionRange:u,originSelectionRange:h}}$(a,"create"),i.create=a;function s(o){let l=o;return ct.objectLiteral(l)&&Oi.is(l.targetRange)&&ct.string(l.targetUri)&&Oi.is(l.targetSelectionRange)&&(Oi.is(l.originSelectionRange)||ct.undefined(l.originSelectionRange))}$(s,"is"),i.is=s}(qke||(qke={})),function(i){function a(o,l,u,h){return{red:o,green:l,blue:u,alpha:h}}$(a,"create"),i.create=a;function s(o){const l=o;return ct.objectLiteral(l)&&ct.numberRange(l.red,0,1)&&ct.numberRange(l.green,0,1)&&ct.numberRange(l.blue,0,1)&&ct.numberRange(l.alpha,0,1)}$(s,"is"),i.is=s}(Mee||(Mee={})),function(i){function a(o,l){return{range:o,color:l}}$(a,"create"),i.create=a;function s(o){const l=o;return ct.objectLiteral(l)&&Oi.is(l.range)&&Mee.is(l.color)}$(s,"is"),i.is=s}(jke||(jke={})),function(i){function a(o,l,u){return{label:o,textEdit:l,additionalTextEdits:u}}$(a,"create"),i.create=a;function s(o){const l=o;return ct.objectLiteral(l)&&ct.string(l.label)&&(ct.undefined(l.textEdit)||U0.is(l))&&(ct.undefined(l.additionalTextEdits)||ct.typedArray(l.additionalTextEdits,U0.is))}$(s,"is"),i.is=s}(Xke||(Xke={})),function(i){i.Comment="comment",i.Imports="imports",i.Region="region"}(Kke||(Kke={})),function(i){function a(o,l,u,h,d,f){const p={startLine:o,endLine:l};return ct.defined(u)&&(p.startCharacter=u),ct.defined(h)&&(p.endCharacter=h),ct.defined(d)&&(p.kind=d),ct.defined(f)&&(p.collapsedText=f),p}$(a,"create"),i.create=a;function s(o){const l=o;return ct.objectLiteral(l)&&ct.uinteger(l.startLine)&&ct.uinteger(l.startLine)&&(ct.undefined(l.startCharacter)||ct.uinteger(l.startCharacter))&&(ct.undefined(l.endCharacter)||ct.uinteger(l.endCharacter))&&(ct.undefined(l.kind)||ct.string(l.kind))}$(s,"is"),i.is=s}(Zke||(Zke={})),function(i){function a(o,l){return{location:o,message:l}}$(a,"create"),i.create=a;function s(o){let l=o;return ct.defined(l)&&Y9.is(l.location)&&ct.string(l.message)}$(s,"is"),i.is=s}(Iee||(Iee={})),function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4}(Jke||(Jke={})),function(i){i.Unnecessary=1,i.Deprecated=2}(eEe||(eEe={})),function(i){function a(s){const o=s;return ct.objectLiteral(o)&&ct.string(o.href)}$(a,"is"),i.is=a}(tEe||(tEe={})),function(i){function a(o,l,u,h,d,f){let p={range:o,message:l};return ct.defined(u)&&(p.severity=u),ct.defined(h)&&(p.code=h),ct.defined(d)&&(p.source=d),ct.defined(f)&&(p.relatedInformation=f),p}$(a,"create"),i.create=a;function s(o){var l;let u=o;return ct.defined(u)&&Oi.is(u.range)&&ct.string(u.message)&&(ct.number(u.severity)||ct.undefined(u.severity))&&(ct.integer(u.code)||ct.string(u.code)||ct.undefined(u.code))&&(ct.undefined(u.codeDescription)||ct.string((l=u.codeDescription)===null||l===void 0?void 0:l.href))&&(ct.string(u.source)||ct.undefined(u.source))&&(ct.undefined(u.relatedInformation)||ct.typedArray(u.relatedInformation,Iee.is))}$(s,"is"),i.is=s}(q9||(q9={})),function(i){function a(o,l,...u){let h={title:o,command:l};return ct.defined(u)&&u.length>0&&(h.arguments=u),h}$(a,"create"),i.create=a;function s(o){let l=o;return ct.defined(l)&&ct.string(l.title)&&ct.string(l.command)}$(s,"is"),i.is=s}(PC||(PC={})),function(i){function a(u,h){return{range:u,newText:h}}$(a,"replace"),i.replace=a;function s(u,h){return{range:{start:u,end:u},newText:h}}$(s,"insert"),i.insert=s;function o(u){return{range:u,newText:""}}$(o,"del"),i.del=o;function l(u){const h=u;return ct.objectLiteral(h)&&ct.string(h.newText)&&Oi.is(h.range)}$(l,"is"),i.is=l}(U0||(U0={})),function(i){function a(o,l,u){const h={label:o};return l!==void 0&&(h.needsConfirmation=l),u!==void 0&&(h.description=u),h}$(a,"create"),i.create=a;function s(o){const l=o;return ct.objectLiteral(l)&&ct.string(l.label)&&(ct.boolean(l.needsConfirmation)||l.needsConfirmation===void 0)&&(ct.string(l.description)||l.description===void 0)}$(s,"is"),i.is=s}(NC||(NC={})),function(i){function a(s){const o=s;return ct.string(o)}$(a,"is"),i.is=a}(yc||(yc={})),function(i){function a(u,h,d){return{range:u,newText:h,annotationId:d}}$(a,"replace"),i.replace=a;function s(u,h,d){return{range:{start:u,end:u},newText:h,annotationId:d}}$(s,"insert"),i.insert=s;function o(u,h){return{range:u,newText:"",annotationId:h}}$(o,"del"),i.del=o;function l(u){const h=u;return U0.is(h)&&(NC.is(h.annotationId)||yc.is(h.annotationId))}$(l,"is"),i.is=l}(_1||(_1={})),function(i){function a(o,l){return{textDocument:o,edits:l}}$(a,"create"),i.create=a;function s(o){let l=o;return ct.defined(l)&&K9.is(l.textDocument)&&Array.isArray(l.edits)}$(s,"is"),i.is=s}(j9||(j9={})),function(i){function a(o,l,u){let h={kind:"create",uri:o};return l!==void 0&&(l.overwrite!==void 0||l.ignoreIfExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}$(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="create"&&ct.string(l.uri)&&(l.options===void 0||(l.options.overwrite===void 0||ct.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||ct.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||yc.is(l.annotationId))}$(s,"is"),i.is=s}(U3||(U3={})),function(i){function a(o,l,u,h){let d={kind:"rename",oldUri:o,newUri:l};return u!==void 0&&(u.overwrite!==void 0||u.ignoreIfExists!==void 0)&&(d.options=u),h!==void 0&&(d.annotationId=h),d}$(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="rename"&&ct.string(l.oldUri)&&ct.string(l.newUri)&&(l.options===void 0||(l.options.overwrite===void 0||ct.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||ct.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||yc.is(l.annotationId))}$(s,"is"),i.is=s}(V3||(V3={})),function(i){function a(o,l,u){let h={kind:"delete",uri:o};return l!==void 0&&(l.recursive!==void 0||l.ignoreIfNotExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}$(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="delete"&&ct.string(l.uri)&&(l.options===void 0||(l.options.recursive===void 0||ct.boolean(l.options.recursive))&&(l.options.ignoreIfNotExists===void 0||ct.boolean(l.options.ignoreIfNotExists)))&&(l.annotationId===void 0||yc.is(l.annotationId))}$(s,"is"),i.is=s}(Q3||(Q3={})),function(i){function a(s){let o=s;return o&&(o.changes!==void 0||o.documentChanges!==void 0)&&(o.documentChanges===void 0||o.documentChanges.every(l=>ct.string(l.kind)?U3.is(l)||V3.is(l)||Q3.is(l):j9.is(l)))}$(a,"is"),i.is=a}(Pee||(Pee={})),X9=(t=class{constructor(a,s){this.edits=a,this.changeAnnotations=s}insert(a,s,o){let l,u;if(o===void 0?l=U0.insert(a,s):yc.is(o)?(u=o,l=_1.insert(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=_1.insert(a,s,u)),this.edits.push(l),u!==void 0)return u}replace(a,s,o){let l,u;if(o===void 0?l=U0.replace(a,s):yc.is(o)?(u=o,l=_1.replace(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=_1.replace(a,s,u)),this.edits.push(l),u!==void 0)return u}delete(a,s){let o,l;if(s===void 0?o=U0.del(a):yc.is(s)?(l=s,o=_1.del(a,s)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(s),o=_1.del(a,l)),this.edits.push(o),l!==void 0)return l}add(a){this.edits.push(a)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(a){if(a===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},$(t,"TextEditChangeImpl"),t),rEe=(e=class{constructor(a){this._annotations=a===void 0?Object.create(null):a,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(a,s){let o;if(yc.is(a)?o=a:(o=this.nextId(),s=a),this._annotations[o]!==void 0)throw new Error(`Id ${o} is already in use.`);if(s===void 0)throw new Error(`No annotation provided for id ${o}`);return this._annotations[o]=s,this._size++,o}nextId(){return this._counter++,this._counter.toString()}},$(e,"ChangeAnnotations"),e),V6t=(r=class{constructor(a){this._textEditChanges=Object.create(null),a!==void 0?(this._workspaceEdit=a,a.documentChanges?(this._changeAnnotations=new rEe(a.changeAnnotations),a.changeAnnotations=this._changeAnnotations.all(),a.documentChanges.forEach(s=>{if(j9.is(s)){const o=new X9(s.edits,this._changeAnnotations);this._textEditChanges[s.textDocument.uri]=o}})):a.changes&&Object.keys(a.changes).forEach(s=>{const o=new X9(a.changes[s]);this._textEditChanges[s]=o})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(a){if(K9.is(a)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const s={uri:a.uri,version:a.version};let o=this._textEditChanges[s.uri];if(!o){const l=[],u={textDocument:s,edits:l};this._workspaceEdit.documentChanges.push(u),o=new X9(l,this._changeAnnotations),this._textEditChanges[s.uri]=o}return o}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let s=this._textEditChanges[a];if(!s){let o=[];this._workspaceEdit.changes[a]=o,s=new X9(o),this._textEditChanges[a]=s}return s}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new rEe,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(a,s,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;NC.is(s)||yc.is(s)?l=s:o=s;let u,h;if(l===void 0?u=U3.create(a,o):(h=yc.is(l)?l:this._changeAnnotations.manage(l),u=U3.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}renameFile(a,s,o,l){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let u;NC.is(o)||yc.is(o)?u=o:l=o;let h,d;if(u===void 0?h=V3.create(a,s,l):(d=yc.is(u)?u:this._changeAnnotations.manage(u),h=V3.create(a,s,l,d)),this._workspaceEdit.documentChanges.push(h),d!==void 0)return d}deleteFile(a,s,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;NC.is(s)||yc.is(s)?l=s:o=s;let u,h;if(l===void 0?u=Q3.create(a,o):(h=yc.is(l)?l:this._changeAnnotations.manage(l),u=Q3.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}},$(r,"WorkspaceChange"),r),function(i){function a(o){return{uri:o}}$(a,"create"),i.create=a;function s(o){let l=o;return ct.defined(l)&&ct.string(l.uri)}$(s,"is"),i.is=s}(nEe||(nEe={})),function(i){function a(o,l){return{uri:o,version:l}}$(a,"create"),i.create=a;function s(o){let l=o;return ct.defined(l)&&ct.string(l.uri)&&ct.integer(l.version)}$(s,"is"),i.is=s}(iEe||(iEe={})),function(i){function a(o,l){return{uri:o,version:l}}$(a,"create"),i.create=a;function s(o){let l=o;return ct.defined(l)&&ct.string(l.uri)&&(l.version===null||ct.integer(l.version))}$(s,"is"),i.is=s}(K9||(K9={})),function(i){function a(o,l,u,h){return{uri:o,languageId:l,version:u,text:h}}$(a,"create"),i.create=a;function s(o){let l=o;return ct.defined(l)&&ct.string(l.uri)&&ct.string(l.languageId)&&ct.integer(l.version)&&ct.string(l.text)}$(s,"is"),i.is=s}(aEe||(aEe={})),function(i){i.PlainText="plaintext",i.Markdown="markdown";function a(s){const o=s;return o===i.PlainText||o===i.Markdown}$(a,"is"),i.is=a}(Nee||(Nee={})),function(i){function a(s){const o=s;return ct.objectLiteral(s)&&Nee.is(o.kind)&&ct.string(o.value)}$(a,"is"),i.is=a}(G3||(G3={})),function(i){i.Text=1,i.Method=2,i.Function=3,i.Constructor=4,i.Field=5,i.Variable=6,i.Class=7,i.Interface=8,i.Module=9,i.Property=10,i.Unit=11,i.Value=12,i.Enum=13,i.Keyword=14,i.Snippet=15,i.Color=16,i.File=17,i.Reference=18,i.Folder=19,i.EnumMember=20,i.Constant=21,i.Struct=22,i.Event=23,i.Operator=24,i.TypeParameter=25}(sEe||(sEe={})),function(i){i.PlainText=1,i.Snippet=2}(oEe||(oEe={})),function(i){i.Deprecated=1}(lEe||(lEe={})),function(i){function a(o,l,u){return{newText:o,insert:l,replace:u}}$(a,"create"),i.create=a;function s(o){const l=o;return l&&ct.string(l.newText)&&Oi.is(l.insert)&&Oi.is(l.replace)}$(s,"is"),i.is=s}(cEe||(cEe={})),function(i){i.asIs=1,i.adjustIndentation=2}(uEe||(uEe={})),function(i){function a(s){const o=s;return o&&(ct.string(o.detail)||o.detail===void 0)&&(ct.string(o.description)||o.description===void 0)}$(a,"is"),i.is=a}(hEe||(hEe={})),function(i){function a(s){return{label:s}}$(a,"create"),i.create=a}(dEe||(dEe={})),function(i){function a(s,o){return{items:s||[],isIncomplete:!!o}}$(a,"create"),i.create=a}(fEe||(fEe={})),function(i){function a(o){return o.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}$(a,"fromPlainText"),i.fromPlainText=a;function s(o){const l=o;return ct.string(l)||ct.objectLiteral(l)&&ct.string(l.language)&&ct.string(l.value)}$(s,"is"),i.is=s}(Z9||(Z9={})),function(i){function a(s){let o=s;return!!o&&ct.objectLiteral(o)&&(G3.is(o.contents)||Z9.is(o.contents)||ct.typedArray(o.contents,Z9.is))&&(s.range===void 0||Oi.is(s.range))}$(a,"is"),i.is=a}(pEe||(pEe={})),function(i){function a(s,o){return o?{label:s,documentation:o}:{label:s}}$(a,"create"),i.create=a}(gEe||(gEe={})),function(i){function a(s,o,...l){let u={label:s};return ct.defined(o)&&(u.documentation=o),ct.defined(l)?u.parameters=l:u.parameters=[],u}$(a,"create"),i.create=a}(mEe||(mEe={})),function(i){i.Text=1,i.Read=2,i.Write=3}(vEe||(vEe={})),function(i){function a(s,o){let l={range:s};return ct.number(o)&&(l.kind=o),l}$(a,"create"),i.create=a}(yEe||(yEe={})),function(i){i.File=1,i.Module=2,i.Namespace=3,i.Package=4,i.Class=5,i.Method=6,i.Property=7,i.Field=8,i.Constructor=9,i.Enum=10,i.Interface=11,i.Function=12,i.Variable=13,i.Constant=14,i.String=15,i.Number=16,i.Boolean=17,i.Array=18,i.Object=19,i.Key=20,i.Null=21,i.EnumMember=22,i.Struct=23,i.Event=24,i.Operator=25,i.TypeParameter=26}(bEe||(bEe={})),function(i){i.Deprecated=1}(xEe||(xEe={})),function(i){function a(s,o,l,u,h){let d={name:s,kind:o,location:{uri:u,range:l}};return h&&(d.containerName=h),d}$(a,"create"),i.create=a}(wEe||(wEe={})),function(i){function a(s,o,l,u){return u!==void 0?{name:s,kind:o,location:{uri:l,range:u}}:{name:s,kind:o,location:{uri:l}}}$(a,"create"),i.create=a}(AEe||(AEe={})),function(i){function a(o,l,u,h,d,f){let p={name:o,detail:l,kind:u,range:h,selectionRange:d};return f!==void 0&&(p.children=f),p}$(a,"create"),i.create=a;function s(o){let l=o;return l&&ct.string(l.name)&&ct.number(l.kind)&&Oi.is(l.range)&&Oi.is(l.selectionRange)&&(l.detail===void 0||ct.string(l.detail))&&(l.deprecated===void 0||ct.boolean(l.deprecated))&&(l.children===void 0||Array.isArray(l.children))&&(l.tags===void 0||Array.isArray(l.tags))}$(s,"is"),i.is=s}(TEe||(TEe={})),function(i){i.Empty="",i.QuickFix="quickfix",i.Refactor="refactor",i.RefactorExtract="refactor.extract",i.RefactorInline="refactor.inline",i.RefactorRewrite="refactor.rewrite",i.Source="source",i.SourceOrganizeImports="source.organizeImports",i.SourceFixAll="source.fixAll"}(SEe||(SEe={})),function(i){i.Invoked=1,i.Automatic=2}(J9||(J9={})),function(i){function a(o,l,u){let h={diagnostics:o};return l!=null&&(h.only=l),u!=null&&(h.triggerKind=u),h}$(a,"create"),i.create=a;function s(o){let l=o;return ct.defined(l)&&ct.typedArray(l.diagnostics,q9.is)&&(l.only===void 0||ct.typedArray(l.only,ct.string))&&(l.triggerKind===void 0||l.triggerKind===J9.Invoked||l.triggerKind===J9.Automatic)}$(s,"is"),i.is=s}(CEe||(CEe={})),function(i){function a(o,l,u){let h={title:o},d=!0;return typeof l=="string"?(d=!1,h.kind=l):PC.is(l)?h.command=l:h.edit=l,d&&u!==void 0&&(h.kind=u),h}$(a,"create"),i.create=a;function s(o){let l=o;return l&&ct.string(l.title)&&(l.diagnostics===void 0||ct.typedArray(l.diagnostics,q9.is))&&(l.kind===void 0||ct.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||PC.is(l.command))&&(l.isPreferred===void 0||ct.boolean(l.isPreferred))&&(l.edit===void 0||Pee.is(l.edit))}$(s,"is"),i.is=s}(OEe||(OEe={})),function(i){function a(o,l){let u={range:o};return ct.defined(l)&&(u.data=l),u}$(a,"create"),i.create=a;function s(o){let l=o;return ct.defined(l)&&Oi.is(l.range)&&(ct.undefined(l.command)||PC.is(l.command))}$(s,"is"),i.is=s}(kEe||(kEe={})),function(i){function a(o,l){return{tabSize:o,insertSpaces:l}}$(a,"create"),i.create=a;function s(o){let l=o;return ct.defined(l)&&ct.uinteger(l.tabSize)&&ct.boolean(l.insertSpaces)}$(s,"is"),i.is=s}(EEe||(EEe={})),function(i){function a(o,l,u){return{range:o,target:l,data:u}}$(a,"create"),i.create=a;function s(o){let l=o;return ct.defined(l)&&Oi.is(l.range)&&(ct.undefined(l.target)||ct.string(l.target))}$(s,"is"),i.is=s}(_Ee||(_Ee={})),function(i){function a(o,l){return{range:o,parent:l}}$(a,"create"),i.create=a;function s(o){let l=o;return ct.objectLiteral(l)&&Oi.is(l.range)&&(l.parent===void 0||i.is(l.parent))}$(s,"is"),i.is=s}(REe||(REe={})),function(i){i.namespace="namespace",i.type="type",i.class="class",i.enum="enum",i.interface="interface",i.struct="struct",i.typeParameter="typeParameter",i.parameter="parameter",i.variable="variable",i.property="property",i.enumMember="enumMember",i.event="event",i.function="function",i.method="method",i.macro="macro",i.keyword="keyword",i.modifier="modifier",i.comment="comment",i.string="string",i.number="number",i.regexp="regexp",i.operator="operator",i.decorator="decorator"}(DEe||(DEe={})),function(i){i.declaration="declaration",i.definition="definition",i.readonly="readonly",i.static="static",i.deprecated="deprecated",i.abstract="abstract",i.async="async",i.modification="modification",i.documentation="documentation",i.defaultLibrary="defaultLibrary"}(LEe||(LEe={})),function(i){function a(s){const o=s;return ct.objectLiteral(o)&&(o.resultId===void 0||typeof o.resultId=="string")&&Array.isArray(o.data)&&(o.data.length===0||typeof o.data[0]=="number")}$(a,"is"),i.is=a}(MEe||(MEe={})),function(i){function a(o,l){return{range:o,text:l}}$(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&Oi.is(l.range)&&ct.string(l.text)}$(s,"is"),i.is=s}(IEe||(IEe={})),function(i){function a(o,l,u){return{range:o,variableName:l,caseSensitiveLookup:u}}$(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&Oi.is(l.range)&&ct.boolean(l.caseSensitiveLookup)&&(ct.string(l.variableName)||l.variableName===void 0)}$(s,"is"),i.is=s}(PEe||(PEe={})),function(i){function a(o,l){return{range:o,expression:l}}$(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&Oi.is(l.range)&&(ct.string(l.expression)||l.expression===void 0)}$(s,"is"),i.is=s}(NEe||(NEe={})),function(i){function a(o,l){return{frameId:o,stoppedLocation:l}}$(a,"create"),i.create=a;function s(o){const l=o;return ct.defined(l)&&Oi.is(o.stoppedLocation)}$(s,"is"),i.is=s}(BEe||(BEe={})),function(i){i.Type=1,i.Parameter=2;function a(s){return s===1||s===2}$(a,"is"),i.is=a}(Bee||(Bee={})),function(i){function a(o){return{value:o}}$(a,"create"),i.create=a;function s(o){const l=o;return ct.objectLiteral(l)&&(l.tooltip===void 0||ct.string(l.tooltip)||G3.is(l.tooltip))&&(l.location===void 0||Y9.is(l.location))&&(l.command===void 0||PC.is(l.command))}$(s,"is"),i.is=s}($ee||($ee={})),function(i){function a(o,l,u){const h={position:o,label:l};return u!==void 0&&(h.kind=u),h}$(a,"create"),i.create=a;function s(o){const l=o;return ct.objectLiteral(l)&&ji.is(l.position)&&(ct.string(l.label)||ct.typedArray(l.label,$ee.is))&&(l.kind===void 0||Bee.is(l.kind))&&l.textEdits===void 0||ct.typedArray(l.textEdits,U0.is)&&(l.tooltip===void 0||ct.string(l.tooltip)||G3.is(l.tooltip))&&(l.paddingLeft===void 0||ct.boolean(l.paddingLeft))&&(l.paddingRight===void 0||ct.boolean(l.paddingRight))}$(s,"is"),i.is=s}($Ee||($Ee={})),function(i){function a(s){return{kind:"snippet",value:s}}$(a,"createSnippet"),i.createSnippet=a}(FEe||(FEe={})),function(i){function a(s,o,l,u){return{insertText:s,filterText:o,range:l,command:u}}$(a,"create"),i.create=a}(zEe||(zEe={})),function(i){function a(s){return{items:s}}$(a,"create"),i.create=a}(UEe||(UEe={})),function(i){i.Invoked=0,i.Automatic=1}(VEe||(VEe={})),function(i){function a(s,o){return{range:s,text:o}}$(a,"create"),i.create=a}(QEe||(QEe={})),function(i){function a(s,o){return{triggerKind:s,selectedCompletionInfo:o}}$(a,"create"),i.create=a}(GEe||(GEe={})),function(i){function a(s){const o=s;return ct.objectLiteral(o)&&Lee.is(o.uri)&&ct.string(o.name)}$(a,"is"),i.is=a}(HEe||(HEe={})),Q6t=[` +`},"getStyles"),DLn=RLn,LLn={parser:OLn,get db(){return new kLn},renderer:z6t,styles:DLn};const MLn=Object.freeze(Object.defineProperty({__proto__:null,diagram:LLn},Symbol.toStringTag,{value:"Module"}));var Uke=(_D=class{constructor(e){this.init=e,this.records=this.init()}reset(){this.records=this.init()}},C(_D,"ImperativeState"),_D);function qu(t,e){var r,n,i;t.accDescr&&((r=e.setAccDescription)==null||r.call(e,t.accDescr)),t.accTitle&&((n=e.setAccTitle)==null||n.call(e,t.accTitle)),t.title&&((i=e.setDiagramTitle)==null||i.call(e,t.title))}C(qu,"populateCommonDb");var ILn=Object.create,H9=Object.defineProperty,PLn=Object.getOwnPropertyDescriptor,Vke=Object.getOwnPropertyNames,NLn=Object.getPrototypeOf,BLn=Object.prototype.hasOwnProperty,$=(t,e)=>H9(t,"name",{value:e,configurable:!0}),$Ln=(t,e)=>function(){return t&&(e=(0,t[Vke(t)[0]])(t=0)),e},Nn=(t,e)=>function(){return e||(0,t[Vke(t)[0]])((e={exports:{}}).exports,e),e.exports},X2=(t,e)=>{for(var r in e)H9(t,r,{get:e[r],enumerable:!0})},Qke=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Vke(e))!BLn.call(t,i)&&i!==r&&H9(t,i,{get:()=>e[i],enumerable:!(n=PLn(e,i))||n.enumerable});return t},Ree=(t,e,r)=>(Qke(t,e,"default"),r),Gke=(t,e,r)=>(r=t!=null?ILn(NLn(t)):{},Qke(H9(r,"default",{value:t,enumerable:!0}),t)),Hke=t=>Qke(H9({},"__esModule",{value:!0}),t),Dee={};X2(Dee,{AnnotatedTextEdit:()=>_1,ChangeAnnotation:()=>NC,ChangeAnnotationIdentifier:()=>yc,CodeAction:()=>OEe,CodeActionContext:()=>CEe,CodeActionKind:()=>TEe,CodeActionTriggerKind:()=>J9,CodeDescription:()=>tEe,CodeLens:()=>kEe,Color:()=>Mee,ColorInformation:()=>jke,ColorPresentation:()=>Xke,Command:()=>PC,CompletionItem:()=>dEe,CompletionItemKind:()=>sEe,CompletionItemLabelDetails:()=>hEe,CompletionItemTag:()=>lEe,CompletionList:()=>fEe,CreateFile:()=>U3,DeleteFile:()=>Q3,Diagnostic:()=>q9,DiagnosticRelatedInformation:()=>Iee,DiagnosticSeverity:()=>Jke,DiagnosticTag:()=>eEe,DocumentHighlight:()=>yEe,DocumentHighlightKind:()=>vEe,DocumentLink:()=>_Ee,DocumentSymbol:()=>SEe,DocumentUri:()=>Wke,EOL:()=>Q6t,FoldingRange:()=>Zke,FoldingRangeKind:()=>Kke,FormattingOptions:()=>EEe,Hover:()=>pEe,InlayHint:()=>$Ee,InlayHintKind:()=>Bee,InlayHintLabelPart:()=>$ee,InlineCompletionContext:()=>GEe,InlineCompletionItem:()=>zEe,InlineCompletionList:()=>UEe,InlineCompletionTriggerKind:()=>VEe,InlineValueContext:()=>BEe,InlineValueEvaluatableExpression:()=>NEe,InlineValueText:()=>IEe,InlineValueVariableLookup:()=>PEe,InsertReplaceEdit:()=>cEe,InsertTextFormat:()=>oEe,InsertTextMode:()=>uEe,Location:()=>Y9,LocationLink:()=>qke,MarkedString:()=>Z9,MarkupContent:()=>G3,MarkupKind:()=>Nee,OptionalVersionedTextDocumentIdentifier:()=>K9,ParameterInformation:()=>gEe,Position:()=>ji,Range:()=>Oi,RenameFile:()=>V3,SelectedCompletionInfo:()=>QEe,SelectionRange:()=>REe,SemanticTokenModifiers:()=>LEe,SemanticTokenTypes:()=>DEe,SemanticTokens:()=>MEe,SignatureInformation:()=>mEe,StringValue:()=>FEe,SymbolInformation:()=>wEe,SymbolKind:()=>bEe,SymbolTag:()=>xEe,TextDocument:()=>WEe,TextDocumentEdit:()=>j9,TextDocumentIdentifier:()=>nEe,TextDocumentItem:()=>aEe,TextEdit:()=>U0,URI:()=>Lee,VersionedTextDocumentIdentifier:()=>iEe,WorkspaceChange:()=>V6t,WorkspaceEdit:()=>Pee,WorkspaceFolder:()=>HEe,WorkspaceSymbol:()=>AEe,integer:()=>Yke,uinteger:()=>W9});var Wke,Lee,Yke,W9,ji,Oi,Y9,qke,Mee,jke,Xke,Kke,Zke,Iee,Jke,eEe,tEe,q9,PC,U0,NC,yc,_1,j9,U3,V3,Q3,Pee,X9,rEe,V6t,nEe,iEe,K9,aEe,Nee,G3,sEe,oEe,lEe,cEe,uEe,hEe,dEe,fEe,Z9,pEe,gEe,mEe,vEe,yEe,bEe,xEe,wEe,AEe,SEe,TEe,J9,CEe,OEe,kEe,EEe,_Ee,REe,DEe,LEe,MEe,IEe,PEe,NEe,BEe,Bee,$ee,$Ee,FEe,zEe,UEe,VEe,QEe,GEe,HEe,Q6t,WEe,G6t,ct,eF=$Ln({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){var t,e,r,n;(function(i){function a(s){return typeof s=="string"}$(a,"is"),i.is=a})(Wke||(Wke={})),function(i){function a(s){return typeof s=="string"}$(a,"is"),i.is=a}(Lee||(Lee={})),function(i){i.MIN_VALUE=-2147483648,i.MAX_VALUE=2147483647;function a(s){return typeof s=="number"&&i.MIN_VALUE<=s&&s<=i.MAX_VALUE}$(a,"is"),i.is=a}(Yke||(Yke={})),function(i){i.MIN_VALUE=0,i.MAX_VALUE=2147483647;function a(s){return typeof s=="number"&&i.MIN_VALUE<=s&&s<=i.MAX_VALUE}$(a,"is"),i.is=a}(W9||(W9={})),function(i){function a(o,l){return o===Number.MAX_VALUE&&(o=W9.MAX_VALUE),l===Number.MAX_VALUE&&(l=W9.MAX_VALUE),{line:o,character:l}}$(a,"create"),i.create=a;function s(o){let l=o;return ct.objectLiteral(l)&&ct.uinteger(l.line)&&ct.uinteger(l.character)}$(s,"is"),i.is=s}(ji||(ji={})),function(i){function a(o,l,u,h){if(ct.uinteger(o)&&ct.uinteger(l)&&ct.uinteger(u)&&ct.uinteger(h))return{start:ji.create(o,l),end:ji.create(u,h)};if(ji.is(o)&&ji.is(l))return{start:o,end:l};throw new Error(`Range#create called with invalid arguments[${o}, ${l}, ${u}, ${h}]`)}$(a,"create"),i.create=a;function s(o){let l=o;return ct.objectLiteral(l)&&ji.is(l.start)&&ji.is(l.end)}$(s,"is"),i.is=s}(Oi||(Oi={})),function(i){function a(o,l){return{uri:o,range:l}}$(a,"create"),i.create=a;function s(o){let l=o;return ct.objectLiteral(l)&&Oi.is(l.range)&&(ct.string(l.uri)||ct.undefined(l.uri))}$(s,"is"),i.is=s}(Y9||(Y9={})),function(i){function a(o,l,u,h){return{targetUri:o,targetRange:l,targetSelectionRange:u,originSelectionRange:h}}$(a,"create"),i.create=a;function s(o){let l=o;return ct.objectLiteral(l)&&Oi.is(l.targetRange)&&ct.string(l.targetUri)&&Oi.is(l.targetSelectionRange)&&(Oi.is(l.originSelectionRange)||ct.undefined(l.originSelectionRange))}$(s,"is"),i.is=s}(qke||(qke={})),function(i){function a(o,l,u,h){return{red:o,green:l,blue:u,alpha:h}}$(a,"create"),i.create=a;function s(o){const l=o;return ct.objectLiteral(l)&&ct.numberRange(l.red,0,1)&&ct.numberRange(l.green,0,1)&&ct.numberRange(l.blue,0,1)&&ct.numberRange(l.alpha,0,1)}$(s,"is"),i.is=s}(Mee||(Mee={})),function(i){function a(o,l){return{range:o,color:l}}$(a,"create"),i.create=a;function s(o){const l=o;return ct.objectLiteral(l)&&Oi.is(l.range)&&Mee.is(l.color)}$(s,"is"),i.is=s}(jke||(jke={})),function(i){function a(o,l,u){return{label:o,textEdit:l,additionalTextEdits:u}}$(a,"create"),i.create=a;function s(o){const l=o;return ct.objectLiteral(l)&&ct.string(l.label)&&(ct.undefined(l.textEdit)||U0.is(l))&&(ct.undefined(l.additionalTextEdits)||ct.typedArray(l.additionalTextEdits,U0.is))}$(s,"is"),i.is=s}(Xke||(Xke={})),function(i){i.Comment="comment",i.Imports="imports",i.Region="region"}(Kke||(Kke={})),function(i){function a(o,l,u,h,d,f){const p={startLine:o,endLine:l};return ct.defined(u)&&(p.startCharacter=u),ct.defined(h)&&(p.endCharacter=h),ct.defined(d)&&(p.kind=d),ct.defined(f)&&(p.collapsedText=f),p}$(a,"create"),i.create=a;function s(o){const l=o;return ct.objectLiteral(l)&&ct.uinteger(l.startLine)&&ct.uinteger(l.startLine)&&(ct.undefined(l.startCharacter)||ct.uinteger(l.startCharacter))&&(ct.undefined(l.endCharacter)||ct.uinteger(l.endCharacter))&&(ct.undefined(l.kind)||ct.string(l.kind))}$(s,"is"),i.is=s}(Zke||(Zke={})),function(i){function a(o,l){return{location:o,message:l}}$(a,"create"),i.create=a;function s(o){let l=o;return ct.defined(l)&&Y9.is(l.location)&&ct.string(l.message)}$(s,"is"),i.is=s}(Iee||(Iee={})),function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4}(Jke||(Jke={})),function(i){i.Unnecessary=1,i.Deprecated=2}(eEe||(eEe={})),function(i){function a(s){const o=s;return ct.objectLiteral(o)&&ct.string(o.href)}$(a,"is"),i.is=a}(tEe||(tEe={})),function(i){function a(o,l,u,h,d,f){let p={range:o,message:l};return ct.defined(u)&&(p.severity=u),ct.defined(h)&&(p.code=h),ct.defined(d)&&(p.source=d),ct.defined(f)&&(p.relatedInformation=f),p}$(a,"create"),i.create=a;function s(o){var l;let u=o;return ct.defined(u)&&Oi.is(u.range)&&ct.string(u.message)&&(ct.number(u.severity)||ct.undefined(u.severity))&&(ct.integer(u.code)||ct.string(u.code)||ct.undefined(u.code))&&(ct.undefined(u.codeDescription)||ct.string((l=u.codeDescription)===null||l===void 0?void 0:l.href))&&(ct.string(u.source)||ct.undefined(u.source))&&(ct.undefined(u.relatedInformation)||ct.typedArray(u.relatedInformation,Iee.is))}$(s,"is"),i.is=s}(q9||(q9={})),function(i){function a(o,l,...u){let h={title:o,command:l};return ct.defined(u)&&u.length>0&&(h.arguments=u),h}$(a,"create"),i.create=a;function s(o){let l=o;return ct.defined(l)&&ct.string(l.title)&&ct.string(l.command)}$(s,"is"),i.is=s}(PC||(PC={})),function(i){function a(u,h){return{range:u,newText:h}}$(a,"replace"),i.replace=a;function s(u,h){return{range:{start:u,end:u},newText:h}}$(s,"insert"),i.insert=s;function o(u){return{range:u,newText:""}}$(o,"del"),i.del=o;function l(u){const h=u;return ct.objectLiteral(h)&&ct.string(h.newText)&&Oi.is(h.range)}$(l,"is"),i.is=l}(U0||(U0={})),function(i){function a(o,l,u){const h={label:o};return l!==void 0&&(h.needsConfirmation=l),u!==void 0&&(h.description=u),h}$(a,"create"),i.create=a;function s(o){const l=o;return ct.objectLiteral(l)&&ct.string(l.label)&&(ct.boolean(l.needsConfirmation)||l.needsConfirmation===void 0)&&(ct.string(l.description)||l.description===void 0)}$(s,"is"),i.is=s}(NC||(NC={})),function(i){function a(s){const o=s;return ct.string(o)}$(a,"is"),i.is=a}(yc||(yc={})),function(i){function a(u,h,d){return{range:u,newText:h,annotationId:d}}$(a,"replace"),i.replace=a;function s(u,h,d){return{range:{start:u,end:u},newText:h,annotationId:d}}$(s,"insert"),i.insert=s;function o(u,h){return{range:u,newText:"",annotationId:h}}$(o,"del"),i.del=o;function l(u){const h=u;return U0.is(h)&&(NC.is(h.annotationId)||yc.is(h.annotationId))}$(l,"is"),i.is=l}(_1||(_1={})),function(i){function a(o,l){return{textDocument:o,edits:l}}$(a,"create"),i.create=a;function s(o){let l=o;return ct.defined(l)&&K9.is(l.textDocument)&&Array.isArray(l.edits)}$(s,"is"),i.is=s}(j9||(j9={})),function(i){function a(o,l,u){let h={kind:"create",uri:o};return l!==void 0&&(l.overwrite!==void 0||l.ignoreIfExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}$(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="create"&&ct.string(l.uri)&&(l.options===void 0||(l.options.overwrite===void 0||ct.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||ct.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||yc.is(l.annotationId))}$(s,"is"),i.is=s}(U3||(U3={})),function(i){function a(o,l,u,h){let d={kind:"rename",oldUri:o,newUri:l};return u!==void 0&&(u.overwrite!==void 0||u.ignoreIfExists!==void 0)&&(d.options=u),h!==void 0&&(d.annotationId=h),d}$(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="rename"&&ct.string(l.oldUri)&&ct.string(l.newUri)&&(l.options===void 0||(l.options.overwrite===void 0||ct.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||ct.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||yc.is(l.annotationId))}$(s,"is"),i.is=s}(V3||(V3={})),function(i){function a(o,l,u){let h={kind:"delete",uri:o};return l!==void 0&&(l.recursive!==void 0||l.ignoreIfNotExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}$(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="delete"&&ct.string(l.uri)&&(l.options===void 0||(l.options.recursive===void 0||ct.boolean(l.options.recursive))&&(l.options.ignoreIfNotExists===void 0||ct.boolean(l.options.ignoreIfNotExists)))&&(l.annotationId===void 0||yc.is(l.annotationId))}$(s,"is"),i.is=s}(Q3||(Q3={})),function(i){function a(s){let o=s;return o&&(o.changes!==void 0||o.documentChanges!==void 0)&&(o.documentChanges===void 0||o.documentChanges.every(l=>ct.string(l.kind)?U3.is(l)||V3.is(l)||Q3.is(l):j9.is(l)))}$(a,"is"),i.is=a}(Pee||(Pee={})),X9=(t=class{constructor(a,s){this.edits=a,this.changeAnnotations=s}insert(a,s,o){let l,u;if(o===void 0?l=U0.insert(a,s):yc.is(o)?(u=o,l=_1.insert(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=_1.insert(a,s,u)),this.edits.push(l),u!==void 0)return u}replace(a,s,o){let l,u;if(o===void 0?l=U0.replace(a,s):yc.is(o)?(u=o,l=_1.replace(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=_1.replace(a,s,u)),this.edits.push(l),u!==void 0)return u}delete(a,s){let o,l;if(s===void 0?o=U0.del(a):yc.is(s)?(l=s,o=_1.del(a,s)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(s),o=_1.del(a,l)),this.edits.push(o),l!==void 0)return l}add(a){this.edits.push(a)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(a){if(a===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},$(t,"TextEditChangeImpl"),t),rEe=(e=class{constructor(a){this._annotations=a===void 0?Object.create(null):a,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(a,s){let o;if(yc.is(a)?o=a:(o=this.nextId(),s=a),this._annotations[o]!==void 0)throw new Error(`Id ${o} is already in use.`);if(s===void 0)throw new Error(`No annotation provided for id ${o}`);return this._annotations[o]=s,this._size++,o}nextId(){return this._counter++,this._counter.toString()}},$(e,"ChangeAnnotations"),e),V6t=(r=class{constructor(a){this._textEditChanges=Object.create(null),a!==void 0?(this._workspaceEdit=a,a.documentChanges?(this._changeAnnotations=new rEe(a.changeAnnotations),a.changeAnnotations=this._changeAnnotations.all(),a.documentChanges.forEach(s=>{if(j9.is(s)){const o=new X9(s.edits,this._changeAnnotations);this._textEditChanges[s.textDocument.uri]=o}})):a.changes&&Object.keys(a.changes).forEach(s=>{const o=new X9(a.changes[s]);this._textEditChanges[s]=o})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(a){if(K9.is(a)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const s={uri:a.uri,version:a.version};let o=this._textEditChanges[s.uri];if(!o){const l=[],u={textDocument:s,edits:l};this._workspaceEdit.documentChanges.push(u),o=new X9(l,this._changeAnnotations),this._textEditChanges[s.uri]=o}return o}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let s=this._textEditChanges[a];if(!s){let o=[];this._workspaceEdit.changes[a]=o,s=new X9(o),this._textEditChanges[a]=s}return s}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new rEe,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(a,s,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;NC.is(s)||yc.is(s)?l=s:o=s;let u,h;if(l===void 0?u=U3.create(a,o):(h=yc.is(l)?l:this._changeAnnotations.manage(l),u=U3.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}renameFile(a,s,o,l){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let u;NC.is(o)||yc.is(o)?u=o:l=o;let h,d;if(u===void 0?h=V3.create(a,s,l):(d=yc.is(u)?u:this._changeAnnotations.manage(u),h=V3.create(a,s,l,d)),this._workspaceEdit.documentChanges.push(h),d!==void 0)return d}deleteFile(a,s,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;NC.is(s)||yc.is(s)?l=s:o=s;let u,h;if(l===void 0?u=Q3.create(a,o):(h=yc.is(l)?l:this._changeAnnotations.manage(l),u=Q3.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}},$(r,"WorkspaceChange"),r),function(i){function a(o){return{uri:o}}$(a,"create"),i.create=a;function s(o){let l=o;return ct.defined(l)&&ct.string(l.uri)}$(s,"is"),i.is=s}(nEe||(nEe={})),function(i){function a(o,l){return{uri:o,version:l}}$(a,"create"),i.create=a;function s(o){let l=o;return ct.defined(l)&&ct.string(l.uri)&&ct.integer(l.version)}$(s,"is"),i.is=s}(iEe||(iEe={})),function(i){function a(o,l){return{uri:o,version:l}}$(a,"create"),i.create=a;function s(o){let l=o;return ct.defined(l)&&ct.string(l.uri)&&(l.version===null||ct.integer(l.version))}$(s,"is"),i.is=s}(K9||(K9={})),function(i){function a(o,l,u,h){return{uri:o,languageId:l,version:u,text:h}}$(a,"create"),i.create=a;function s(o){let l=o;return ct.defined(l)&&ct.string(l.uri)&&ct.string(l.languageId)&&ct.integer(l.version)&&ct.string(l.text)}$(s,"is"),i.is=s}(aEe||(aEe={})),function(i){i.PlainText="plaintext",i.Markdown="markdown";function a(s){const o=s;return o===i.PlainText||o===i.Markdown}$(a,"is"),i.is=a}(Nee||(Nee={})),function(i){function a(s){const o=s;return ct.objectLiteral(s)&&Nee.is(o.kind)&&ct.string(o.value)}$(a,"is"),i.is=a}(G3||(G3={})),function(i){i.Text=1,i.Method=2,i.Function=3,i.Constructor=4,i.Field=5,i.Variable=6,i.Class=7,i.Interface=8,i.Module=9,i.Property=10,i.Unit=11,i.Value=12,i.Enum=13,i.Keyword=14,i.Snippet=15,i.Color=16,i.File=17,i.Reference=18,i.Folder=19,i.EnumMember=20,i.Constant=21,i.Struct=22,i.Event=23,i.Operator=24,i.TypeParameter=25}(sEe||(sEe={})),function(i){i.PlainText=1,i.Snippet=2}(oEe||(oEe={})),function(i){i.Deprecated=1}(lEe||(lEe={})),function(i){function a(o,l,u){return{newText:o,insert:l,replace:u}}$(a,"create"),i.create=a;function s(o){const l=o;return l&&ct.string(l.newText)&&Oi.is(l.insert)&&Oi.is(l.replace)}$(s,"is"),i.is=s}(cEe||(cEe={})),function(i){i.asIs=1,i.adjustIndentation=2}(uEe||(uEe={})),function(i){function a(s){const o=s;return o&&(ct.string(o.detail)||o.detail===void 0)&&(ct.string(o.description)||o.description===void 0)}$(a,"is"),i.is=a}(hEe||(hEe={})),function(i){function a(s){return{label:s}}$(a,"create"),i.create=a}(dEe||(dEe={})),function(i){function a(s,o){return{items:s||[],isIncomplete:!!o}}$(a,"create"),i.create=a}(fEe||(fEe={})),function(i){function a(o){return o.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}$(a,"fromPlainText"),i.fromPlainText=a;function s(o){const l=o;return ct.string(l)||ct.objectLiteral(l)&&ct.string(l.language)&&ct.string(l.value)}$(s,"is"),i.is=s}(Z9||(Z9={})),function(i){function a(s){let o=s;return!!o&&ct.objectLiteral(o)&&(G3.is(o.contents)||Z9.is(o.contents)||ct.typedArray(o.contents,Z9.is))&&(s.range===void 0||Oi.is(s.range))}$(a,"is"),i.is=a}(pEe||(pEe={})),function(i){function a(s,o){return o?{label:s,documentation:o}:{label:s}}$(a,"create"),i.create=a}(gEe||(gEe={})),function(i){function a(s,o,...l){let u={label:s};return ct.defined(o)&&(u.documentation=o),ct.defined(l)?u.parameters=l:u.parameters=[],u}$(a,"create"),i.create=a}(mEe||(mEe={})),function(i){i.Text=1,i.Read=2,i.Write=3}(vEe||(vEe={})),function(i){function a(s,o){let l={range:s};return ct.number(o)&&(l.kind=o),l}$(a,"create"),i.create=a}(yEe||(yEe={})),function(i){i.File=1,i.Module=2,i.Namespace=3,i.Package=4,i.Class=5,i.Method=6,i.Property=7,i.Field=8,i.Constructor=9,i.Enum=10,i.Interface=11,i.Function=12,i.Variable=13,i.Constant=14,i.String=15,i.Number=16,i.Boolean=17,i.Array=18,i.Object=19,i.Key=20,i.Null=21,i.EnumMember=22,i.Struct=23,i.Event=24,i.Operator=25,i.TypeParameter=26}(bEe||(bEe={})),function(i){i.Deprecated=1}(xEe||(xEe={})),function(i){function a(s,o,l,u,h){let d={name:s,kind:o,location:{uri:u,range:l}};return h&&(d.containerName=h),d}$(a,"create"),i.create=a}(wEe||(wEe={})),function(i){function a(s,o,l,u){return u!==void 0?{name:s,kind:o,location:{uri:l,range:u}}:{name:s,kind:o,location:{uri:l}}}$(a,"create"),i.create=a}(AEe||(AEe={})),function(i){function a(o,l,u,h,d,f){let p={name:o,detail:l,kind:u,range:h,selectionRange:d};return f!==void 0&&(p.children=f),p}$(a,"create"),i.create=a;function s(o){let l=o;return l&&ct.string(l.name)&&ct.number(l.kind)&&Oi.is(l.range)&&Oi.is(l.selectionRange)&&(l.detail===void 0||ct.string(l.detail))&&(l.deprecated===void 0||ct.boolean(l.deprecated))&&(l.children===void 0||Array.isArray(l.children))&&(l.tags===void 0||Array.isArray(l.tags))}$(s,"is"),i.is=s}(SEe||(SEe={})),function(i){i.Empty="",i.QuickFix="quickfix",i.Refactor="refactor",i.RefactorExtract="refactor.extract",i.RefactorInline="refactor.inline",i.RefactorRewrite="refactor.rewrite",i.Source="source",i.SourceOrganizeImports="source.organizeImports",i.SourceFixAll="source.fixAll"}(TEe||(TEe={})),function(i){i.Invoked=1,i.Automatic=2}(J9||(J9={})),function(i){function a(o,l,u){let h={diagnostics:o};return l!=null&&(h.only=l),u!=null&&(h.triggerKind=u),h}$(a,"create"),i.create=a;function s(o){let l=o;return ct.defined(l)&&ct.typedArray(l.diagnostics,q9.is)&&(l.only===void 0||ct.typedArray(l.only,ct.string))&&(l.triggerKind===void 0||l.triggerKind===J9.Invoked||l.triggerKind===J9.Automatic)}$(s,"is"),i.is=s}(CEe||(CEe={})),function(i){function a(o,l,u){let h={title:o},d=!0;return typeof l=="string"?(d=!1,h.kind=l):PC.is(l)?h.command=l:h.edit=l,d&&u!==void 0&&(h.kind=u),h}$(a,"create"),i.create=a;function s(o){let l=o;return l&&ct.string(l.title)&&(l.diagnostics===void 0||ct.typedArray(l.diagnostics,q9.is))&&(l.kind===void 0||ct.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||PC.is(l.command))&&(l.isPreferred===void 0||ct.boolean(l.isPreferred))&&(l.edit===void 0||Pee.is(l.edit))}$(s,"is"),i.is=s}(OEe||(OEe={})),function(i){function a(o,l){let u={range:o};return ct.defined(l)&&(u.data=l),u}$(a,"create"),i.create=a;function s(o){let l=o;return ct.defined(l)&&Oi.is(l.range)&&(ct.undefined(l.command)||PC.is(l.command))}$(s,"is"),i.is=s}(kEe||(kEe={})),function(i){function a(o,l){return{tabSize:o,insertSpaces:l}}$(a,"create"),i.create=a;function s(o){let l=o;return ct.defined(l)&&ct.uinteger(l.tabSize)&&ct.boolean(l.insertSpaces)}$(s,"is"),i.is=s}(EEe||(EEe={})),function(i){function a(o,l,u){return{range:o,target:l,data:u}}$(a,"create"),i.create=a;function s(o){let l=o;return ct.defined(l)&&Oi.is(l.range)&&(ct.undefined(l.target)||ct.string(l.target))}$(s,"is"),i.is=s}(_Ee||(_Ee={})),function(i){function a(o,l){return{range:o,parent:l}}$(a,"create"),i.create=a;function s(o){let l=o;return ct.objectLiteral(l)&&Oi.is(l.range)&&(l.parent===void 0||i.is(l.parent))}$(s,"is"),i.is=s}(REe||(REe={})),function(i){i.namespace="namespace",i.type="type",i.class="class",i.enum="enum",i.interface="interface",i.struct="struct",i.typeParameter="typeParameter",i.parameter="parameter",i.variable="variable",i.property="property",i.enumMember="enumMember",i.event="event",i.function="function",i.method="method",i.macro="macro",i.keyword="keyword",i.modifier="modifier",i.comment="comment",i.string="string",i.number="number",i.regexp="regexp",i.operator="operator",i.decorator="decorator"}(DEe||(DEe={})),function(i){i.declaration="declaration",i.definition="definition",i.readonly="readonly",i.static="static",i.deprecated="deprecated",i.abstract="abstract",i.async="async",i.modification="modification",i.documentation="documentation",i.defaultLibrary="defaultLibrary"}(LEe||(LEe={})),function(i){function a(s){const o=s;return ct.objectLiteral(o)&&(o.resultId===void 0||typeof o.resultId=="string")&&Array.isArray(o.data)&&(o.data.length===0||typeof o.data[0]=="number")}$(a,"is"),i.is=a}(MEe||(MEe={})),function(i){function a(o,l){return{range:o,text:l}}$(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&Oi.is(l.range)&&ct.string(l.text)}$(s,"is"),i.is=s}(IEe||(IEe={})),function(i){function a(o,l,u){return{range:o,variableName:l,caseSensitiveLookup:u}}$(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&Oi.is(l.range)&&ct.boolean(l.caseSensitiveLookup)&&(ct.string(l.variableName)||l.variableName===void 0)}$(s,"is"),i.is=s}(PEe||(PEe={})),function(i){function a(o,l){return{range:o,expression:l}}$(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&Oi.is(l.range)&&(ct.string(l.expression)||l.expression===void 0)}$(s,"is"),i.is=s}(NEe||(NEe={})),function(i){function a(o,l){return{frameId:o,stoppedLocation:l}}$(a,"create"),i.create=a;function s(o){const l=o;return ct.defined(l)&&Oi.is(o.stoppedLocation)}$(s,"is"),i.is=s}(BEe||(BEe={})),function(i){i.Type=1,i.Parameter=2;function a(s){return s===1||s===2}$(a,"is"),i.is=a}(Bee||(Bee={})),function(i){function a(o){return{value:o}}$(a,"create"),i.create=a;function s(o){const l=o;return ct.objectLiteral(l)&&(l.tooltip===void 0||ct.string(l.tooltip)||G3.is(l.tooltip))&&(l.location===void 0||Y9.is(l.location))&&(l.command===void 0||PC.is(l.command))}$(s,"is"),i.is=s}($ee||($ee={})),function(i){function a(o,l,u){const h={position:o,label:l};return u!==void 0&&(h.kind=u),h}$(a,"create"),i.create=a;function s(o){const l=o;return ct.objectLiteral(l)&&ji.is(l.position)&&(ct.string(l.label)||ct.typedArray(l.label,$ee.is))&&(l.kind===void 0||Bee.is(l.kind))&&l.textEdits===void 0||ct.typedArray(l.textEdits,U0.is)&&(l.tooltip===void 0||ct.string(l.tooltip)||G3.is(l.tooltip))&&(l.paddingLeft===void 0||ct.boolean(l.paddingLeft))&&(l.paddingRight===void 0||ct.boolean(l.paddingRight))}$(s,"is"),i.is=s}($Ee||($Ee={})),function(i){function a(s){return{kind:"snippet",value:s}}$(a,"createSnippet"),i.createSnippet=a}(FEe||(FEe={})),function(i){function a(s,o,l,u){return{insertText:s,filterText:o,range:l,command:u}}$(a,"create"),i.create=a}(zEe||(zEe={})),function(i){function a(s){return{items:s}}$(a,"create"),i.create=a}(UEe||(UEe={})),function(i){i.Invoked=0,i.Automatic=1}(VEe||(VEe={})),function(i){function a(s,o){return{range:s,text:o}}$(a,"create"),i.create=a}(QEe||(QEe={})),function(i){function a(s,o){return{triggerKind:s,selectedCompletionInfo:o}}$(a,"create"),i.create=a}(GEe||(GEe={})),function(i){function a(s){const o=s;return ct.objectLiteral(o)&&Lee.is(o.uri)&&ct.string(o.name)}$(a,"is"),i.is=a}(HEe||(HEe={})),Q6t=[` `,`\r `,"\r"],function(i){function a(u,h,d,f){return new G6t(u,h,d,f)}$(a,"create"),i.create=a;function s(u){let h=u;return!!(ct.defined(h)&&ct.string(h.uri)&&(ct.undefined(h.languageId)||ct.string(h.languageId))&&ct.uinteger(h.lineCount)&&ct.func(h.getText)&&ct.func(h.positionAt)&&ct.func(h.offsetAt))}$(s,"is"),i.is=s;function o(u,h){let d=u.getText(),f=l(h,(g,m)=>{let v=g.range.start.line-m.range.start.line;return v===0?g.range.start.character-m.range.start.character:v}),p=d.length;for(let g=f.length-1;g>=0;g--){let m=f[g],v=u.offsetAt(m.range.start),y=u.offsetAt(m.range.end);if(y<=p)d=d.substring(0,v)+m.newText+d.substring(y,d.length);else throw new Error("Overlapping edit");p=v}return d}$(o,"applyEdits"),i.applyEdits=o;function l(u,h){if(u.length<=1)return u;const d=u.length/2|0,f=u.slice(0,d),p=u.slice(d);l(f,h),l(p,h);let g=0,m=0,v=0;for(;g0&&a.push(s.length),this._lineOffsets=a}return this._lineOffsets}positionAt(a){a=Math.max(Math.min(a,this._content.length),0);let s=this.getLineOffsets(),o=0,l=s.length;if(l===0)return ji.create(0,a);for(;oa?l=h:o=h+1}let u=o-1;return ji.create(u,a-s[u])}offsetAt(a){let s=this.getLineOffsets();if(a.line>=s.length)return this._content.length;if(a.line<0)return 0;let o=s[a.line],l=a.line+1"u"}$(o,"undefined"),i.undefined=o;function l(y){return y===!0||y===!1}$(l,"boolean"),i.boolean=l;function u(y){return a.call(y)==="[object String]"}$(u,"string"),i.string=u;function h(y){return a.call(y)==="[object Number]"}$(h,"number"),i.number=h;function d(y,b,x){return a.call(y)==="[object Number]"&&b<=y&&y<=x}$(d,"numberRange"),i.numberRange=d;function f(y){return a.call(y)==="[object Number]"&&-2147483648<=y&&y<=2147483647}$(f,"integer"),i.integer=f;function p(y){return a.call(y)==="[object Number]"&&0<=y&&y<=2147483647}$(p,"uinteger"),i.uinteger=p;function g(y){return a.call(y)==="[object Function]"}$(g,"func"),i.func=g;function m(y){return y!==null&&typeof y=="object"}$(m,"objectLiteral"),i.objectLiteral=m;function v(y,b){return Array.isArray(y)&&y.every(b)}$(v,"typedArray"),i.typedArray=v}(ct||(ct={}))}}),BC=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e;function r(){if(e===void 0)throw new Error("No runtime abstraction layer installed");return e}$(r,"RAL"),function(n){function i(a){if(a===void 0)throw new Error("No runtime abstraction layer provided");e=a}$(i,"install"),n.install=i}(r||(r={})),t.default=r}}),tF=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(l){return l===!0||l===!1}$(e,"boolean"),t.boolean=e;function r(l){return typeof l=="string"||l instanceof String}$(r,"string"),t.string=r;function n(l){return typeof l=="number"||l instanceof Number}$(n,"number"),t.number=n;function i(l){return l instanceof Error}$(i,"error"),t.error=i;function a(l){return typeof l=="function"}$(a,"func"),t.func=a;function s(l){return Array.isArray(l)}$(s,"array"),t.array=s;function o(l){return s(l)&&l.every(u=>r(u))}$(o,"stringArray"),t.stringArray=o}}),H3=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(t){var a,s;Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;var e=BC(),r;(function(o){const l={dispose(){}};o.None=function(){return l}})(r||(t.Event=r={}));var n=(a=class{add(l,u=null,h){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(l),this._contexts.push(u),Array.isArray(h)&&h.push({dispose:$(()=>this.remove(l,u),"dispose")})}remove(l,u=null){if(!this._callbacks)return;let h=!1;for(let d=0,f=this._callbacks.length;d{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(l,u);const d={dispose:$(()=>{this._callbacks&&(this._callbacks.remove(l,u),d.dispose=s._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(h)&&h.push(d),d}),this._event}fire(l){this._callbacks&&this._callbacks.invoke.call(this._callbacks,l)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}},$(s,"Emitter"),s);t.Emitter=i,i._noop=function(){}}}),Fee=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(t){var l,u;Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;var e=BC(),r=tF(),n=H3(),i;(function(h){h.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),h.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function d(f){const p=f;return p&&(p===h.None||p===h.Cancelled||r.boolean(p.isCancellationRequested)&&!!p.onCancellationRequested)}$(d,"is"),h.is=d})(i||(t.CancellationToken=i={}));var a=Object.freeze(function(h,d){const f=(0,e.default)().timer.setTimeout(h.bind(d),0);return{dispose(){f.dispose()}}}),s=(l=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?a:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},$(l,"MutableToken"),l),o=(u=class{get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=i.None}},$(u,"CancellationTokenSource"),u);t.CancellationTokenSource=o}}),H6t=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(t){var L,R,D,M,P,N,F,B,V,z,U,Q,G,X,Y,le,q,Z,ee,re,ve,ae,Ce,Oe,$e;Object.defineProperty(t,"__esModule",{value:!0}),t.Message=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType=t.RequestType0=t.AbstractMessageSignature=t.ParameterStructures=t.ResponseError=t.ErrorCodes=void 0;var e=tF(),r;(function(he){he.ParseError=-32700,he.InvalidRequest=-32600,he.MethodNotFound=-32601,he.InvalidParams=-32602,he.InternalError=-32603,he.jsonrpcReservedErrorRangeStart=-32099,he.serverErrorStart=-32099,he.MessageWriteError=-32099,he.MessageReadError=-32098,he.PendingResponseRejected=-32097,he.ConnectionInactive=-32096,he.ServerNotInitialized=-32002,he.UnknownErrorCode=-32001,he.jsonrpcReservedErrorRangeEnd=-32e3,he.serverErrorEnd=-32e3})(r||(t.ErrorCodes=r={}));var n=(L=class extends Error{constructor(fe,Te,ge){super(Te),this.code=e.number(fe)?fe:r.UnknownErrorCode,this.data=ge,Object.setPrototypeOf(this,L.prototype)}toJson(){const fe={code:this.code,message:this.message};return this.data!==void 0&&(fe.data=this.data),fe}},$(L,"ResponseError"),L);t.ResponseError=n;var i=(R=class{constructor(fe){this.kind=fe}static is(fe){return fe===R.auto||fe===R.byName||fe===R.byPosition}toString(){return this.kind}},$(R,"ParameterStructures"),R);t.ParameterStructures=i,i.auto=new i("auto"),i.byPosition=new i("byPosition"),i.byName=new i("byName");var a=(D=class{constructor(fe,Te){this.method=fe,this.numberOfParams=Te}get parameterStructures(){return i.auto}},$(D,"AbstractMessageSignature"),D);t.AbstractMessageSignature=a;var s=(M=class extends a{constructor(fe){super(fe,0)}},$(M,"RequestType0"),M);t.RequestType0=s;var o=(P=class extends a{constructor(fe,Te=i.auto){super(fe,1),this._parameterStructures=Te}get parameterStructures(){return this._parameterStructures}},$(P,"RequestType"),P);t.RequestType=o;var l=(N=class extends a{constructor(fe,Te=i.auto){super(fe,1),this._parameterStructures=Te}get parameterStructures(){return this._parameterStructures}},$(N,"RequestType1"),N);t.RequestType1=l;var u=(F=class extends a{constructor(fe){super(fe,2)}},$(F,"RequestType2"),F);t.RequestType2=u;var h=(B=class extends a{constructor(fe){super(fe,3)}},$(B,"RequestType3"),B);t.RequestType3=h;var d=(V=class extends a{constructor(fe){super(fe,4)}},$(V,"RequestType4"),V);t.RequestType4=d;var f=(z=class extends a{constructor(fe){super(fe,5)}},$(z,"RequestType5"),z);t.RequestType5=f;var p=(U=class extends a{constructor(fe){super(fe,6)}},$(U,"RequestType6"),U);t.RequestType6=p;var g=(Q=class extends a{constructor(fe){super(fe,7)}},$(Q,"RequestType7"),Q);t.RequestType7=g;var m=(G=class extends a{constructor(fe){super(fe,8)}},$(G,"RequestType8"),G);t.RequestType8=m;var v=(X=class extends a{constructor(fe){super(fe,9)}},$(X,"RequestType9"),X);t.RequestType9=v;var y=(Y=class extends a{constructor(fe,Te=i.auto){super(fe,1),this._parameterStructures=Te}get parameterStructures(){return this._parameterStructures}},$(Y,"NotificationType"),Y);t.NotificationType=y;var b=(le=class extends a{constructor(fe){super(fe,0)}},$(le,"NotificationType0"),le);t.NotificationType0=b;var x=(q=class extends a{constructor(fe,Te=i.auto){super(fe,1),this._parameterStructures=Te}get parameterStructures(){return this._parameterStructures}},$(q,"NotificationType1"),q);t.NotificationType1=x;var w=(Z=class extends a{constructor(fe){super(fe,2)}},$(Z,"NotificationType2"),Z);t.NotificationType2=w;var A=(ee=class extends a{constructor(fe){super(fe,3)}},$(ee,"NotificationType3"),ee);t.NotificationType3=A;var T=(re=class extends a{constructor(fe){super(fe,4)}},$(re,"NotificationType4"),re);t.NotificationType4=T;var S=(ve=class extends a{constructor(fe){super(fe,5)}},$(ve,"NotificationType5"),ve);t.NotificationType5=S;var O=(ae=class extends a{constructor(fe){super(fe,6)}},$(ae,"NotificationType6"),ae);t.NotificationType6=O;var k=(Ce=class extends a{constructor(fe){super(fe,7)}},$(Ce,"NotificationType7"),Ce);t.NotificationType7=k;var E=(Oe=class extends a{constructor(fe){super(fe,8)}},$(Oe,"NotificationType8"),Oe);t.NotificationType8=E;var _=($e=class extends a{constructor(fe){super(fe,9)}},$($e,"NotificationType9"),$e);t.NotificationType9=_;var I;(function(he){function fe(Qe){const Se=Qe;return Se&&e.string(Se.method)&&(e.string(Se.id)||e.number(Se.id))}$(fe,"isRequest"),he.isRequest=fe;function Te(Qe){const Se=Qe;return Se&&e.string(Se.method)&&Qe.id===void 0}$(Te,"isNotification"),he.isNotification=Te;function ge(Qe){const Se=Qe;return Se&&(Se.result!==void 0||!!Se.error)&&(e.string(Se.id)||e.number(Se.id)||Se.id===null)}$(ge,"isResponse"),he.isResponse=ge})(I||(t.Message=I={}))}}),W6t=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(t){var a,s;var e;Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.LinkedMap=t.Touch=void 0;var r;(function(o){o.None=0,o.First=1,o.AsOld=o.First,o.Last=2,o.AsNew=o.Last})(r||(t.Touch=r={}));var n=(a=class{constructor(){this[e]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var l;return(l=this._head)==null?void 0:l.value}get last(){var l;return(l=this._tail)==null?void 0:l.value}has(l){return this._map.has(l)}get(l,u=r.None){const h=this._map.get(l);if(h)return u!==r.None&&this.touch(h,u),h.value}set(l,u,h=r.None){let d=this._map.get(l);if(d)d.value=u,h!==r.None&&this.touch(d,h);else{switch(d={key:l,value:u,next:void 0,previous:void 0},h){case r.None:this.addItemLast(d);break;case r.First:this.addItemFirst(d);break;case r.Last:this.addItemLast(d);break;default:this.addItemLast(d);break}this._map.set(l,d),this._size++}return this}delete(l){return!!this.remove(l)}remove(l){const u=this._map.get(l);if(u)return this._map.delete(l),this.removeItem(u),this._size--,u.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const l=this._head;return this._map.delete(l.key),this.removeItem(l),this._size--,l.value}forEach(l,u){const h=this._state;let d=this._head;for(;d;){if(u?l.bind(u)(d.value,d.key,this):l(d.value,d.key,this),this._state!==h)throw new Error("LinkedMap got modified during iteration.");d=d.next}}keys(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:$(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.key,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}values(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:$(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.value,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}entries(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:$(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:[u.key,u.value],done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}[(e=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(l){if(l>=this.size)return;if(l===0){this.clear();return}let u=this._head,h=this.size;for(;u&&h>l;)this._map.delete(u.key),u=u.next,h--;this._head=u,this._size=h,u&&(u.previous=void 0),this._state++}addItemFirst(l){if(!this._head&&!this._tail)this._tail=l;else if(this._head)l.next=this._head,this._head.previous=l;else throw new Error("Invalid list");this._head=l,this._state++}addItemLast(l){if(!this._head&&!this._tail)this._head=l;else if(this._tail)l.previous=this._tail,this._tail.next=l;else throw new Error("Invalid list");this._tail=l,this._state++}removeItem(l){if(l===this._head&&l===this._tail)this._head=void 0,this._tail=void 0;else if(l===this._head){if(!l.next)throw new Error("Invalid list");l.next.previous=void 0,this._head=l.next}else if(l===this._tail){if(!l.previous)throw new Error("Invalid list");l.previous.next=void 0,this._tail=l.previous}else{const u=l.next,h=l.previous;if(!u||!h)throw new Error("Invalid list");u.previous=h,h.next=u}l.next=void 0,l.previous=void 0,this._state++}touch(l,u){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(u!==r.First&&u!==r.Last)){if(u===r.First){if(l===this._head)return;const h=l.next,d=l.previous;l===this._tail?(d.next=void 0,this._tail=d):(h.previous=d,d.next=h),l.previous=void 0,l.next=this._head,this._head.previous=l,this._head=l,this._state++}else if(u===r.Last){if(l===this._tail)return;const h=l.next,d=l.previous;l===this._head?(h.previous=void 0,this._head=h):(h.previous=d,d.next=h),l.next=void 0,l.previous=this._tail,this._tail.next=l,this._tail=l,this._state++}}}toJSON(){const l=[];return this.forEach((u,h)=>{l.push([h,u])}),l}fromJSON(l){this.clear();for(const[u,h]of l)this.set(u,h)}},$(a,"LinkedMap"),a);t.LinkedMap=n;var i=(s=class extends n{constructor(l,u=1){super(),this._limit=l,this._ratio=Math.min(Math.max(0,u),1)}get limit(){return this._limit}set limit(l){this._limit=l,this.checkTrim()}get ratio(){return this._ratio}set ratio(l){this._ratio=Math.min(Math.max(0,l),1),this.checkTrim()}get(l,u=r.AsNew){return super.get(l,u)}peek(l){return super.get(l,r.None)}set(l,u){return super.set(l,u,r.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}},$(s,"LRUCache"),s);t.LRUCache=i}}),FLn=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/disposable.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Disposable=void 0;var e;(function(r){function n(i){return{dispose:i}}$(n,"create"),r.create=n})(e||(t.Disposable=e={}))}}),zLn=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(t){var o,l,u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=void 0;var e=Fee(),r;(function(d){d.Continue=0,d.Cancelled=1})(r||(r={}));var n=(o=class{constructor(){this.buffers=new Map}enableCancellation(f){if(f.id===null)return;const p=new SharedArrayBuffer(4),g=new Int32Array(p,0,1);g[0]=r.Continue,this.buffers.set(f.id,p),f.$cancellationData=p}async sendCancellation(f,p){const g=this.buffers.get(p);if(g===void 0)return;const m=new Int32Array(g,0,1);Atomics.store(m,0,r.Cancelled)}cleanup(f){this.buffers.delete(f)}dispose(){this.buffers.clear()}},$(o,"SharedArraySenderStrategy"),o);t.SharedArraySenderStrategy=n;var i=(l=class{constructor(f){this.data=new Int32Array(f,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===r.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},$(l,"SharedArrayBufferCancellationToken"),l),a=(u=class{constructor(f){this.token=new i(f)}cancel(){}dispose(){}},$(u,"SharedArrayBufferCancellationTokenSource"),u),s=(h=class{constructor(){this.kind="request"}createCancellationTokenSource(f){const p=f.$cancellationData;return p===void 0?new e.CancellationTokenSource:new a(p)}},$(h,"SharedArrayReceiverStrategy"),h);t.SharedArrayReceiverStrategy=s}}),Y6t=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/semaphore.js"(t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Semaphore=void 0;var e=BC(),r=(n=class{constructor(a=1){if(a<=0)throw new Error("Capacity must be greater than 0");this._capacity=a,this._active=0,this._waiting=[]}lock(a){return new Promise((s,o)=>{this._waiting.push({thunk:a,resolve:s,reject:o}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,e.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const a=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const s=a.thunk();s instanceof Promise?s.then(o=>{this._active--,a.resolve(o),this.runNext()},o=>{this._active--,a.reject(o),this.runNext()}):(this._active--,a.resolve(s),this.runNext())}catch(s){this._active--,a.reject(s),this.runNext()}}},$(n,"Semaphore"),n);t.Semaphore=r}}),ULn=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js"(t){var u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=void 0;var e=BC(),r=tF(),n=H3(),i=Y6t(),a;(function(d){function f(p){let g=p;return g&&r.func(g.listen)&&r.func(g.dispose)&&r.func(g.onError)&&r.func(g.onClose)&&r.func(g.onPartialMessage)}$(f,"is"),d.is=f})(a||(t.MessageReader=a={}));var s=(u=class{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(f){this.errorEmitter.fire(this.asError(f))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(f){this.partialMessageEmitter.fire(f)}asError(f){return f instanceof Error?f:new Error(`Reader received error. Reason: ${r.string(f.message)?f.message:"unknown"}`)}},$(u,"AbstractMessageReader"),u);t.AbstractMessageReader=s;var o;(function(d){function f(p){let g,m;const v=new Map;let y;const b=new Map;if(p===void 0||typeof p=="string")g=p??"utf-8";else{if(g=p.charset??"utf-8",p.contentDecoder!==void 0&&(m=p.contentDecoder,v.set(m.name,m)),p.contentDecoders!==void 0)for(const x of p.contentDecoders)v.set(x.name,x);if(p.contentTypeDecoder!==void 0&&(y=p.contentTypeDecoder,b.set(y.name,y)),p.contentTypeDecoders!==void 0)for(const x of p.contentTypeDecoders)b.set(x.name,x)}return y===void 0&&(y=(0,e.default)().applicationJson.decoder,b.set(y.name,y)),{charset:g,contentDecoder:m,contentDecoders:v,contentTypeDecoder:y,contentTypeDecoders:b}}$(f,"fromOptions"),d.fromOptions=f})(o||(o={}));var l=(h=class extends s{constructor(f,p){super(),this.readable=f,this.options=o.fromOptions(p),this.buffer=(0,e.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new i.Semaphore(1)}set partialMessageTimeout(f){this._partialMessageTimeout=f}get partialMessageTimeout(){return this._partialMessageTimeout}listen(f){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=f;const p=this.readable.onData(g=>{this.onData(g)});return this.readable.onError(g=>this.fireError(g)),this.readable.onClose(()=>this.fireClose()),p}onData(f){try{for(this.buffer.append(f);;){if(this.nextMessageLength===-1){const g=this.buffer.tryReadHeaders(!0);if(!g)return;const m=g.get("content-length");if(!m){this.fireError(new Error(`Header must provide a Content-Length property. +`&&l++}o&&s.length>0&&a.push(s.length),this._lineOffsets=a}return this._lineOffsets}positionAt(a){a=Math.max(Math.min(a,this._content.length),0);let s=this.getLineOffsets(),o=0,l=s.length;if(l===0)return ji.create(0,a);for(;oa?l=h:o=h+1}let u=o-1;return ji.create(u,a-s[u])}offsetAt(a){let s=this.getLineOffsets();if(a.line>=s.length)return this._content.length;if(a.line<0)return 0;let o=s[a.line],l=a.line+1"u"}$(o,"undefined"),i.undefined=o;function l(y){return y===!0||y===!1}$(l,"boolean"),i.boolean=l;function u(y){return a.call(y)==="[object String]"}$(u,"string"),i.string=u;function h(y){return a.call(y)==="[object Number]"}$(h,"number"),i.number=h;function d(y,b,x){return a.call(y)==="[object Number]"&&b<=y&&y<=x}$(d,"numberRange"),i.numberRange=d;function f(y){return a.call(y)==="[object Number]"&&-2147483648<=y&&y<=2147483647}$(f,"integer"),i.integer=f;function p(y){return a.call(y)==="[object Number]"&&0<=y&&y<=2147483647}$(p,"uinteger"),i.uinteger=p;function g(y){return a.call(y)==="[object Function]"}$(g,"func"),i.func=g;function m(y){return y!==null&&typeof y=="object"}$(m,"objectLiteral"),i.objectLiteral=m;function v(y,b){return Array.isArray(y)&&y.every(b)}$(v,"typedArray"),i.typedArray=v}(ct||(ct={}))}}),BC=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e;function r(){if(e===void 0)throw new Error("No runtime abstraction layer installed");return e}$(r,"RAL"),function(n){function i(a){if(a===void 0)throw new Error("No runtime abstraction layer provided");e=a}$(i,"install"),n.install=i}(r||(r={})),t.default=r}}),tF=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(l){return l===!0||l===!1}$(e,"boolean"),t.boolean=e;function r(l){return typeof l=="string"||l instanceof String}$(r,"string"),t.string=r;function n(l){return typeof l=="number"||l instanceof Number}$(n,"number"),t.number=n;function i(l){return l instanceof Error}$(i,"error"),t.error=i;function a(l){return typeof l=="function"}$(a,"func"),t.func=a;function s(l){return Array.isArray(l)}$(s,"array"),t.array=s;function o(l){return s(l)&&l.every(u=>r(u))}$(o,"stringArray"),t.stringArray=o}}),H3=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(t){var a,s;Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;var e=BC(),r;(function(o){const l={dispose(){}};o.None=function(){return l}})(r||(t.Event=r={}));var n=(a=class{add(l,u=null,h){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(l),this._contexts.push(u),Array.isArray(h)&&h.push({dispose:$(()=>this.remove(l,u),"dispose")})}remove(l,u=null){if(!this._callbacks)return;let h=!1;for(let d=0,f=this._callbacks.length;d{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(l,u);const d={dispose:$(()=>{this._callbacks&&(this._callbacks.remove(l,u),d.dispose=s._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(h)&&h.push(d),d}),this._event}fire(l){this._callbacks&&this._callbacks.invoke.call(this._callbacks,l)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}},$(s,"Emitter"),s);t.Emitter=i,i._noop=function(){}}}),Fee=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(t){var l,u;Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;var e=BC(),r=tF(),n=H3(),i;(function(h){h.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),h.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function d(f){const p=f;return p&&(p===h.None||p===h.Cancelled||r.boolean(p.isCancellationRequested)&&!!p.onCancellationRequested)}$(d,"is"),h.is=d})(i||(t.CancellationToken=i={}));var a=Object.freeze(function(h,d){const f=(0,e.default)().timer.setTimeout(h.bind(d),0);return{dispose(){f.dispose()}}}),s=(l=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?a:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},$(l,"MutableToken"),l),o=(u=class{get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=i.None}},$(u,"CancellationTokenSource"),u);t.CancellationTokenSource=o}}),H6t=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(t){var L,R,D,M,P,N,F,B,V,z,U,Q,G,X,Y,le,q,Z,ee,re,ve,ae,Ce,Oe,$e;Object.defineProperty(t,"__esModule",{value:!0}),t.Message=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType=t.RequestType0=t.AbstractMessageSignature=t.ParameterStructures=t.ResponseError=t.ErrorCodes=void 0;var e=tF(),r;(function(he){he.ParseError=-32700,he.InvalidRequest=-32600,he.MethodNotFound=-32601,he.InvalidParams=-32602,he.InternalError=-32603,he.jsonrpcReservedErrorRangeStart=-32099,he.serverErrorStart=-32099,he.MessageWriteError=-32099,he.MessageReadError=-32098,he.PendingResponseRejected=-32097,he.ConnectionInactive=-32096,he.ServerNotInitialized=-32002,he.UnknownErrorCode=-32001,he.jsonrpcReservedErrorRangeEnd=-32e3,he.serverErrorEnd=-32e3})(r||(t.ErrorCodes=r={}));var n=(L=class extends Error{constructor(fe,Se,ge){super(Se),this.code=e.number(fe)?fe:r.UnknownErrorCode,this.data=ge,Object.setPrototypeOf(this,L.prototype)}toJson(){const fe={code:this.code,message:this.message};return this.data!==void 0&&(fe.data=this.data),fe}},$(L,"ResponseError"),L);t.ResponseError=n;var i=(R=class{constructor(fe){this.kind=fe}static is(fe){return fe===R.auto||fe===R.byName||fe===R.byPosition}toString(){return this.kind}},$(R,"ParameterStructures"),R);t.ParameterStructures=i,i.auto=new i("auto"),i.byPosition=new i("byPosition"),i.byName=new i("byName");var a=(D=class{constructor(fe,Se){this.method=fe,this.numberOfParams=Se}get parameterStructures(){return i.auto}},$(D,"AbstractMessageSignature"),D);t.AbstractMessageSignature=a;var s=(M=class extends a{constructor(fe){super(fe,0)}},$(M,"RequestType0"),M);t.RequestType0=s;var o=(P=class extends a{constructor(fe,Se=i.auto){super(fe,1),this._parameterStructures=Se}get parameterStructures(){return this._parameterStructures}},$(P,"RequestType"),P);t.RequestType=o;var l=(N=class extends a{constructor(fe,Se=i.auto){super(fe,1),this._parameterStructures=Se}get parameterStructures(){return this._parameterStructures}},$(N,"RequestType1"),N);t.RequestType1=l;var u=(F=class extends a{constructor(fe){super(fe,2)}},$(F,"RequestType2"),F);t.RequestType2=u;var h=(B=class extends a{constructor(fe){super(fe,3)}},$(B,"RequestType3"),B);t.RequestType3=h;var d=(V=class extends a{constructor(fe){super(fe,4)}},$(V,"RequestType4"),V);t.RequestType4=d;var f=(z=class extends a{constructor(fe){super(fe,5)}},$(z,"RequestType5"),z);t.RequestType5=f;var p=(U=class extends a{constructor(fe){super(fe,6)}},$(U,"RequestType6"),U);t.RequestType6=p;var g=(Q=class extends a{constructor(fe){super(fe,7)}},$(Q,"RequestType7"),Q);t.RequestType7=g;var m=(G=class extends a{constructor(fe){super(fe,8)}},$(G,"RequestType8"),G);t.RequestType8=m;var v=(X=class extends a{constructor(fe){super(fe,9)}},$(X,"RequestType9"),X);t.RequestType9=v;var y=(Y=class extends a{constructor(fe,Se=i.auto){super(fe,1),this._parameterStructures=Se}get parameterStructures(){return this._parameterStructures}},$(Y,"NotificationType"),Y);t.NotificationType=y;var b=(le=class extends a{constructor(fe){super(fe,0)}},$(le,"NotificationType0"),le);t.NotificationType0=b;var x=(q=class extends a{constructor(fe,Se=i.auto){super(fe,1),this._parameterStructures=Se}get parameterStructures(){return this._parameterStructures}},$(q,"NotificationType1"),q);t.NotificationType1=x;var w=(Z=class extends a{constructor(fe){super(fe,2)}},$(Z,"NotificationType2"),Z);t.NotificationType2=w;var A=(ee=class extends a{constructor(fe){super(fe,3)}},$(ee,"NotificationType3"),ee);t.NotificationType3=A;var S=(re=class extends a{constructor(fe){super(fe,4)}},$(re,"NotificationType4"),re);t.NotificationType4=S;var T=(ve=class extends a{constructor(fe){super(fe,5)}},$(ve,"NotificationType5"),ve);t.NotificationType5=T;var O=(ae=class extends a{constructor(fe){super(fe,6)}},$(ae,"NotificationType6"),ae);t.NotificationType6=O;var k=(Ce=class extends a{constructor(fe){super(fe,7)}},$(Ce,"NotificationType7"),Ce);t.NotificationType7=k;var E=(Oe=class extends a{constructor(fe){super(fe,8)}},$(Oe,"NotificationType8"),Oe);t.NotificationType8=E;var _=($e=class extends a{constructor(fe){super(fe,9)}},$($e,"NotificationType9"),$e);t.NotificationType9=_;var I;(function(he){function fe(Qe){const Te=Qe;return Te&&e.string(Te.method)&&(e.string(Te.id)||e.number(Te.id))}$(fe,"isRequest"),he.isRequest=fe;function Se(Qe){const Te=Qe;return Te&&e.string(Te.method)&&Qe.id===void 0}$(Se,"isNotification"),he.isNotification=Se;function ge(Qe){const Te=Qe;return Te&&(Te.result!==void 0||!!Te.error)&&(e.string(Te.id)||e.number(Te.id)||Te.id===null)}$(ge,"isResponse"),he.isResponse=ge})(I||(t.Message=I={}))}}),W6t=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(t){var a,s;var e;Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.LinkedMap=t.Touch=void 0;var r;(function(o){o.None=0,o.First=1,o.AsOld=o.First,o.Last=2,o.AsNew=o.Last})(r||(t.Touch=r={}));var n=(a=class{constructor(){this[e]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var l;return(l=this._head)==null?void 0:l.value}get last(){var l;return(l=this._tail)==null?void 0:l.value}has(l){return this._map.has(l)}get(l,u=r.None){const h=this._map.get(l);if(h)return u!==r.None&&this.touch(h,u),h.value}set(l,u,h=r.None){let d=this._map.get(l);if(d)d.value=u,h!==r.None&&this.touch(d,h);else{switch(d={key:l,value:u,next:void 0,previous:void 0},h){case r.None:this.addItemLast(d);break;case r.First:this.addItemFirst(d);break;case r.Last:this.addItemLast(d);break;default:this.addItemLast(d);break}this._map.set(l,d),this._size++}return this}delete(l){return!!this.remove(l)}remove(l){const u=this._map.get(l);if(u)return this._map.delete(l),this.removeItem(u),this._size--,u.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const l=this._head;return this._map.delete(l.key),this.removeItem(l),this._size--,l.value}forEach(l,u){const h=this._state;let d=this._head;for(;d;){if(u?l.bind(u)(d.value,d.key,this):l(d.value,d.key,this),this._state!==h)throw new Error("LinkedMap got modified during iteration.");d=d.next}}keys(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:$(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.key,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}values(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:$(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.value,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}entries(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:$(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:[u.key,u.value],done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}[(e=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(l){if(l>=this.size)return;if(l===0){this.clear();return}let u=this._head,h=this.size;for(;u&&h>l;)this._map.delete(u.key),u=u.next,h--;this._head=u,this._size=h,u&&(u.previous=void 0),this._state++}addItemFirst(l){if(!this._head&&!this._tail)this._tail=l;else if(this._head)l.next=this._head,this._head.previous=l;else throw new Error("Invalid list");this._head=l,this._state++}addItemLast(l){if(!this._head&&!this._tail)this._head=l;else if(this._tail)l.previous=this._tail,this._tail.next=l;else throw new Error("Invalid list");this._tail=l,this._state++}removeItem(l){if(l===this._head&&l===this._tail)this._head=void 0,this._tail=void 0;else if(l===this._head){if(!l.next)throw new Error("Invalid list");l.next.previous=void 0,this._head=l.next}else if(l===this._tail){if(!l.previous)throw new Error("Invalid list");l.previous.next=void 0,this._tail=l.previous}else{const u=l.next,h=l.previous;if(!u||!h)throw new Error("Invalid list");u.previous=h,h.next=u}l.next=void 0,l.previous=void 0,this._state++}touch(l,u){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(u!==r.First&&u!==r.Last)){if(u===r.First){if(l===this._head)return;const h=l.next,d=l.previous;l===this._tail?(d.next=void 0,this._tail=d):(h.previous=d,d.next=h),l.previous=void 0,l.next=this._head,this._head.previous=l,this._head=l,this._state++}else if(u===r.Last){if(l===this._tail)return;const h=l.next,d=l.previous;l===this._head?(h.previous=void 0,this._head=h):(h.previous=d,d.next=h),l.next=void 0,l.previous=this._tail,this._tail.next=l,this._tail=l,this._state++}}}toJSON(){const l=[];return this.forEach((u,h)=>{l.push([h,u])}),l}fromJSON(l){this.clear();for(const[u,h]of l)this.set(u,h)}},$(a,"LinkedMap"),a);t.LinkedMap=n;var i=(s=class extends n{constructor(l,u=1){super(),this._limit=l,this._ratio=Math.min(Math.max(0,u),1)}get limit(){return this._limit}set limit(l){this._limit=l,this.checkTrim()}get ratio(){return this._ratio}set ratio(l){this._ratio=Math.min(Math.max(0,l),1),this.checkTrim()}get(l,u=r.AsNew){return super.get(l,u)}peek(l){return super.get(l,r.None)}set(l,u){return super.set(l,u,r.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}},$(s,"LRUCache"),s);t.LRUCache=i}}),FLn=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/disposable.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Disposable=void 0;var e;(function(r){function n(i){return{dispose:i}}$(n,"create"),r.create=n})(e||(t.Disposable=e={}))}}),zLn=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(t){var o,l,u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=void 0;var e=Fee(),r;(function(d){d.Continue=0,d.Cancelled=1})(r||(r={}));var n=(o=class{constructor(){this.buffers=new Map}enableCancellation(f){if(f.id===null)return;const p=new SharedArrayBuffer(4),g=new Int32Array(p,0,1);g[0]=r.Continue,this.buffers.set(f.id,p),f.$cancellationData=p}async sendCancellation(f,p){const g=this.buffers.get(p);if(g===void 0)return;const m=new Int32Array(g,0,1);Atomics.store(m,0,r.Cancelled)}cleanup(f){this.buffers.delete(f)}dispose(){this.buffers.clear()}},$(o,"SharedArraySenderStrategy"),o);t.SharedArraySenderStrategy=n;var i=(l=class{constructor(f){this.data=new Int32Array(f,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===r.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},$(l,"SharedArrayBufferCancellationToken"),l),a=(u=class{constructor(f){this.token=new i(f)}cancel(){}dispose(){}},$(u,"SharedArrayBufferCancellationTokenSource"),u),s=(h=class{constructor(){this.kind="request"}createCancellationTokenSource(f){const p=f.$cancellationData;return p===void 0?new e.CancellationTokenSource:new a(p)}},$(h,"SharedArrayReceiverStrategy"),h);t.SharedArrayReceiverStrategy=s}}),Y6t=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/semaphore.js"(t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Semaphore=void 0;var e=BC(),r=(n=class{constructor(a=1){if(a<=0)throw new Error("Capacity must be greater than 0");this._capacity=a,this._active=0,this._waiting=[]}lock(a){return new Promise((s,o)=>{this._waiting.push({thunk:a,resolve:s,reject:o}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,e.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const a=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const s=a.thunk();s instanceof Promise?s.then(o=>{this._active--,a.resolve(o),this.runNext()},o=>{this._active--,a.reject(o),this.runNext()}):(this._active--,a.resolve(s),this.runNext())}catch(s){this._active--,a.reject(s),this.runNext()}}},$(n,"Semaphore"),n);t.Semaphore=r}}),ULn=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js"(t){var u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=void 0;var e=BC(),r=tF(),n=H3(),i=Y6t(),a;(function(d){function f(p){let g=p;return g&&r.func(g.listen)&&r.func(g.dispose)&&r.func(g.onError)&&r.func(g.onClose)&&r.func(g.onPartialMessage)}$(f,"is"),d.is=f})(a||(t.MessageReader=a={}));var s=(u=class{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(f){this.errorEmitter.fire(this.asError(f))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(f){this.partialMessageEmitter.fire(f)}asError(f){return f instanceof Error?f:new Error(`Reader received error. Reason: ${r.string(f.message)?f.message:"unknown"}`)}},$(u,"AbstractMessageReader"),u);t.AbstractMessageReader=s;var o;(function(d){function f(p){let g,m;const v=new Map;let y;const b=new Map;if(p===void 0||typeof p=="string")g=p??"utf-8";else{if(g=p.charset??"utf-8",p.contentDecoder!==void 0&&(m=p.contentDecoder,v.set(m.name,m)),p.contentDecoders!==void 0)for(const x of p.contentDecoders)v.set(x.name,x);if(p.contentTypeDecoder!==void 0&&(y=p.contentTypeDecoder,b.set(y.name,y)),p.contentTypeDecoders!==void 0)for(const x of p.contentTypeDecoders)b.set(x.name,x)}return y===void 0&&(y=(0,e.default)().applicationJson.decoder,b.set(y.name,y)),{charset:g,contentDecoder:m,contentDecoders:v,contentTypeDecoder:y,contentTypeDecoders:b}}$(f,"fromOptions"),d.fromOptions=f})(o||(o={}));var l=(h=class extends s{constructor(f,p){super(),this.readable=f,this.options=o.fromOptions(p),this.buffer=(0,e.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new i.Semaphore(1)}set partialMessageTimeout(f){this._partialMessageTimeout=f}get partialMessageTimeout(){return this._partialMessageTimeout}listen(f){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=f;const p=this.readable.onData(g=>{this.onData(g)});return this.readable.onError(g=>this.fireError(g)),this.readable.onClose(()=>this.fireClose()),p}onData(f){try{for(this.buffer.append(f);;){if(this.nextMessageLength===-1){const g=this.buffer.tryReadHeaders(!0);if(!g)return;const m=g.get("content-length");if(!m){this.fireError(new Error(`Header must provide a Content-Length property. ${JSON.stringify(Object.fromEntries(g))}`));return}const v=parseInt(m);if(isNaN(v)){this.fireError(new Error(`Content-Length value must be a number. Got ${m}`));return}this.nextMessageLength=v}const p=this.buffer.tryReadBody(this.nextMessageLength);if(p===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const g=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(p):p,m=await this.options.contentTypeDecoder.decode(g,this.options);this.callback(m)}).catch(g=>{this.fireError(g)})}}catch(p){this.fireError(p)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,e.default)().timer.setTimeout((f,p)=>{this.partialMessageTimer=void 0,f===this.messageToken&&(this.firePartialMessage({messageToken:f,waitingTime:p}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}},$(h,"ReadableStreamMessageReader"),h);t.ReadableStreamMessageReader=l}}),VLn=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(t){var d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=void 0;var e=BC(),r=tF(),n=Y6t(),i=H3(),a="Content-Length: ",s=`\r `,o;(function(p){function g(m){let v=m;return v&&r.func(v.dispose)&&r.func(v.onClose)&&r.func(v.onError)&&r.func(v.write)}$(g,"is"),p.is=g})(o||(t.MessageWriter=o={}));var l=(d=class{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(g,m,v){this.errorEmitter.fire([this.asError(g),m,v])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(g){return g instanceof Error?g:new Error(`Writer received error. Reason: ${r.string(g.message)?g.message:"unknown"}`)}},$(d,"AbstractMessageWriter"),d);t.AbstractMessageWriter=l;var u;(function(p){function g(m){return m===void 0||typeof m=="string"?{charset:m??"utf-8",contentTypeEncoder:(0,e.default)().applicationJson.encoder}:{charset:m.charset??"utf-8",contentEncoder:m.contentEncoder,contentTypeEncoder:m.contentTypeEncoder??(0,e.default)().applicationJson.encoder}}$(g,"fromOptions"),p.fromOptions=g})(u||(u={}));var h=(f=class extends l{constructor(g,m){super(),this.writable=g,this.options=u.fromOptions(m),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(v=>this.fireError(v)),this.writable.onClose(()=>this.fireClose())}async write(g){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(g,this.options).then(v=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(v):v).then(v=>{const y=[];return y.push(a,v.byteLength.toString(),s),y.push(s),this.doWrite(g,y,v)},v=>{throw this.fireError(v),v}))}async doWrite(g,m,v){try{return await this.writable.write(m.join(""),"ascii"),this.writable.write(v)}catch(y){return this.handleError(y,g),Promise.reject(y)}}handleError(g,m){this.errorCount++,this.fireError(g,m,this.errorCount)}end(){this.writable.end()}},$(f,"WriteableStreamMessageWriter"),f);t.WriteableStreamMessageWriter=h}}),QLn=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(t){var a;Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractMessageBuffer=void 0;var e=13,r=10,n=`\r `,i=(a=class{constructor(o="utf-8"){this._encoding=o,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(o){const l=typeof o=="string"?this.fromString(o,this._encoding):o;this._chunks.push(l),this._totalLength+=l.byteLength}tryReadHeaders(o=!1){if(this._chunks.length===0)return;let l=0,u=0,h=0,d=0;e:for(;uthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===o){const d=this._chunks[0];return this._chunks.shift(),this._totalLength-=o,this.asNative(d)}if(this._chunks[0].byteLength>o){const d=this._chunks[0],f=this.asNative(d,o);return this._chunks[0]=d.slice(o),this._totalLength-=o,f}const l=this.allocNative(o);let u=0,h=0;for(;o>0;){const d=this._chunks[h];if(d.byteLength>o){const f=d.slice(0,o);l.set(f,u),u+=o,this._chunks[h]=d.slice(o),this._totalLength-=o,o-=o}else l.set(d,u),u+=d.byteLength,this._chunks.shift(),this._totalLength-=d.byteLength,o-=d.byteLength}return l}},$(a,"AbstractMessageBuffer"),a);t.AbstractMessageBuffer=i}}),GLn=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(t){var L,R;Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;var e=BC(),r=tF(),n=H6t(),i=W6t(),a=H3(),s=Fee(),o;(function(D){D.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(D){function M(P){return typeof P=="string"||typeof P=="number"}$(M,"is"),D.is=M})(l||(t.ProgressToken=l={}));var u;(function(D){D.type=new n.NotificationType("$/progress")})(u||(u={}));var h=(L=class{constructor(){}},$(L,"ProgressType"),L);t.ProgressType=h;var d;(function(D){function M(P){return r.func(P)}$(M,"is"),D.is=M})(d||(d={})),t.NullLogger=Object.freeze({error:$(()=>{},"error"),warn:$(()=>{},"warn"),info:$(()=>{},"info"),log:$(()=>{},"log")});var f;(function(D){D[D.Off=0]="Off",D[D.Messages=1]="Messages",D[D.Compact=2]="Compact",D[D.Verbose=3]="Verbose"})(f||(t.Trace=f={}));var p;(function(D){D.Off="off",D.Messages="messages",D.Compact="compact",D.Verbose="verbose"})(p||(t.TraceValues=p={})),function(D){function M(N){if(!r.string(N))return D.Off;switch(N=N.toLowerCase(),N){case"off":return D.Off;case"messages":return D.Messages;case"compact":return D.Compact;case"verbose":return D.Verbose;default:return D.Off}}$(M,"fromString"),D.fromString=M;function P(N){switch(N){case D.Off:return"off";case D.Messages:return"messages";case D.Compact:return"compact";case D.Verbose:return"verbose";default:return"off"}}$(P,"toString"),D.toString=P}(f||(t.Trace=f={}));var g;(function(D){D.Text="text",D.JSON="json"})(g||(t.TraceFormat=g={})),function(D){function M(P){return r.string(P)?(P=P.toLowerCase(),P==="json"?D.JSON:D.Text):D.Text}$(M,"fromString"),D.fromString=M}(g||(t.TraceFormat=g={}));var m;(function(D){D.type=new n.NotificationType("$/setTrace")})(m||(t.SetTraceNotification=m={}));var v;(function(D){D.type=new n.NotificationType("$/logTrace")})(v||(t.LogTraceNotification=v={}));var y;(function(D){D[D.Closed=1]="Closed",D[D.Disposed=2]="Disposed",D[D.AlreadyListening=3]="AlreadyListening"})(y||(t.ConnectionErrors=y={}));var b=(R=class extends Error{constructor(M,P){super(P),this.code=M,Object.setPrototypeOf(this,R.prototype)}},$(R,"ConnectionError"),R);t.ConnectionError=b;var x;(function(D){function M(P){const N=P;return N&&r.func(N.cancelUndispatched)}$(M,"is"),D.is=M})(x||(t.ConnectionStrategy=x={}));var w;(function(D){function M(P){const N=P;return N&&(N.kind===void 0||N.kind==="id")&&r.func(N.createCancellationTokenSource)&&(N.dispose===void 0||r.func(N.dispose))}$(M,"is"),D.is=M})(w||(t.IdCancellationReceiverStrategy=w={}));var A;(function(D){function M(P){const N=P;return N&&N.kind==="request"&&r.func(N.createCancellationTokenSource)&&(N.dispose===void 0||r.func(N.dispose))}$(M,"is"),D.is=M})(A||(t.RequestCancellationReceiverStrategy=A={}));var T;(function(D){D.Message=Object.freeze({createCancellationTokenSource(P){return new s.CancellationTokenSource}});function M(P){return w.is(P)||A.is(P)}$(M,"is"),D.is=M})(T||(t.CancellationReceiverStrategy=T={}));var S;(function(D){D.Message=Object.freeze({sendCancellation(P,N){return P.sendNotification(o.type,{id:N})},cleanup(P){}});function M(P){const N=P;return N&&r.func(N.sendCancellation)&&r.func(N.cleanup)}$(M,"is"),D.is=M})(S||(t.CancellationSenderStrategy=S={}));var O;(function(D){D.Message=Object.freeze({receiver:T.Message,sender:S.Message});function M(P){const N=P;return N&&T.is(N.receiver)&&S.is(N.sender)}$(M,"is"),D.is=M})(O||(t.CancellationStrategy=O={}));var k;(function(D){function M(P){const N=P;return N&&r.func(N.handleMessage)}$(M,"is"),D.is=M})(k||(t.MessageStrategy=k={}));var E;(function(D){function M(P){const N=P;return N&&(O.is(N.cancellationStrategy)||x.is(N.connectionStrategy)||k.is(N.messageStrategy))}$(M,"is"),D.is=M})(E||(t.ConnectionOptions=E={}));var _;(function(D){D[D.New=1]="New",D[D.Listening=2]="Listening",D[D.Closed=3]="Closed",D[D.Disposed=4]="Disposed"})(_||(_={}));function I(D,M,P,N){const F=P!==void 0?P:t.NullLogger;let B=0,V=0,z=0;const U="2.0";let Q;const G=new Map;let X;const Y=new Map,le=new Map;let q,Z=new i.LinkedMap,ee=new Map,re=new Set,ve=new Map,ae=f.Off,Ce=g.Text,Oe,$e=_.New;const he=new a.Emitter,fe=new a.Emitter,Te=new a.Emitter,ge=new a.Emitter,Qe=new a.Emitter,Se=N&&N.cancellationStrategy?N.cancellationStrategy:O.Message;function De(Re){if(Re===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Re.toString()}$(De,"createRequestQueueKey");function qe(Re){return Re===null?"res-unknown-"+(++z).toString():"res-"+Re.toString()}$(qe,"createResponseQueueKey");function K(){return"not-"+(++V).toString()}$(K,"createNotificationQueueKey");function ce(Re,at){n.Message.isRequest(at)?Re.set(De(at.id),at):n.Message.isResponse(at)?Re.set(qe(at.id),at):Re.set(K(),at)}$(ce,"addMessageToQueue");function be(Re){}$(be,"cancelUndispatched");function ne(){return $e===_.Listening}$(ne,"isListening");function j(){return $e===_.Closed}$(j,"isClosed");function ie(){return $e===_.Disposed}$(ie,"isDisposed");function pe(){($e===_.New||$e===_.Listening)&&($e=_.Closed,fe.fire(void 0))}$(pe,"closeHandler");function te(Re){he.fire([Re,void 0,void 0])}$(te,"readErrorHandler");function ye(Re){he.fire(Re)}$(ye,"writeErrorHandler"),D.onClose(pe),D.onError(te),M.onClose(pe),M.onError(ye);function oe(){q||Z.size===0||(q=(0,e.default)().timer.setImmediate(()=>{q=void 0,Le()}))}$(oe,"triggerMessageQueue");function _e(Re){n.Message.isRequest(Re)?Pe(Re):n.Message.isNotification(Re)?Ne(Re):n.Message.isResponse(Re)?Xe(Re):Ze(Re)}$(_e,"handleMessage");function Le(){if(Z.size===0)return;const Re=Z.shift();try{const at=N==null?void 0:N.messageStrategy;k.is(at)?at.handleMessage(Re,_e):_e(Re)}finally{oe()}}$(Le,"processMessageQueue");const Ye=$(Re=>{try{if(n.Message.isNotification(Re)&&Re.method===o.type.method){const at=Re.params.id,xt=De(at),Ct=Z.get(xt);if(n.Message.isRequest(Ct)){const Xr=N==null?void 0:N.connectionStrategy,$r=Xr&&Xr.cancelUndispatched?Xr.cancelUndispatched(Ct,be):void 0;if($r&&($r.error!==void 0||$r.result!==void 0)){Z.delete(xt),ve.delete(at),$r.id=Ct.id,wt($r,Re.method,Date.now()),M.write($r).catch(()=>F.error("Sending response for canceled message failed."));return}}const gr=ve.get(at);if(gr!==void 0){gr.cancel(),Rt(Re);return}else re.add(at)}ce(Z,Re)}finally{oe()}},"callback");function Pe(Re){if(ie())return;function at(zr,On,Nr){const hn={jsonrpc:U,id:Re.id};zr instanceof n.ResponseError?hn.error=zr.toJson():hn.result=zr===void 0?null:zr,wt(hn,On,Nr),M.write(hn).catch(()=>F.error("Sending response failed."))}$(at,"reply");function xt(zr,On,Nr){const hn={jsonrpc:U,id:Re.id,error:zr.toJson()};wt(hn,On,Nr),M.write(hn).catch(()=>F.error("Sending response failed."))}$(xt,"replyError");function Ct(zr,On,Nr){zr===void 0&&(zr=null);const hn={jsonrpc:U,id:Re.id,result:zr};wt(hn,On,Nr),M.write(hn).catch(()=>F.error("Sending response failed."))}$(Ct,"replySuccess"),Me(Re);const gr=G.get(Re.method);let Xr,$r;gr&&(Xr=gr.type,$r=gr.handler);const un=Date.now();if($r||Q){const zr=Re.id??String(Date.now()),On=w.is(Se.receiver)?Se.receiver.createCancellationTokenSource(zr):Se.receiver.createCancellationTokenSource(Re);Re.id!==null&&re.has(Re.id)&&On.cancel(),Re.id!==null&&ve.set(zr,On);try{let Nr;if($r)if(Re.params===void 0){if(Xr!==void 0&&Xr.numberOfParams!==0){xt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Re.method} defines ${Xr.numberOfParams} params but received none.`),Re.method,un);return}Nr=$r(On.token)}else if(Array.isArray(Re.params)){if(Xr!==void 0&&Xr.parameterStructures===n.ParameterStructures.byName){xt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Re.method} defines parameters by name but received parameters by position`),Re.method,un);return}Nr=$r(...Re.params,On.token)}else{if(Xr!==void 0&&Xr.parameterStructures===n.ParameterStructures.byPosition){xt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Re.method} defines parameters by position but received parameters by name`),Re.method,un);return}Nr=$r(Re.params,On.token)}else Q&&(Nr=Q(Re.method,Re.params,On.token));const hn=Nr;Nr?hn.then?hn.then(ti=>{ve.delete(zr),at(ti,Re.method,un)},ti=>{ve.delete(zr),ti instanceof n.ResponseError?xt(ti,Re.method,un):ti&&r.string(ti.message)?xt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Re.method} failed with message: ${ti.message}`),Re.method,un):xt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Re.method} failed unexpectedly without providing any details.`),Re.method,un)}):(ve.delete(zr),at(Nr,Re.method,un)):(ve.delete(zr),Ct(Nr,Re.method,un))}catch(Nr){ve.delete(zr),Nr instanceof n.ResponseError?at(Nr,Re.method,un):Nr&&r.string(Nr.message)?xt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Re.method} failed with message: ${Nr.message}`),Re.method,un):xt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Re.method} failed unexpectedly without providing any details.`),Re.method,un)}}else xt(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${Re.method}`),Re.method,un)}$(Pe,"handleRequest");function Xe(Re){if(!ie())if(Re.id===null)Re.error?F.error(`Received response message without id: Error is: -${JSON.stringify(Re.error,void 0,4)}`):F.error("Received response message without id. No further error information provided.");else{const at=Re.id,xt=ee.get(at);if(Lt(Re,xt),xt!==void 0){ee.delete(at);try{if(Re.error){const Ct=Re.error;xt.reject(new n.ResponseError(Ct.code,Ct.message,Ct.data))}else if(Re.result!==void 0)xt.resolve(Re.result);else throw new Error("Should never happen.")}catch(Ct){Ct.message?F.error(`Response handler '${xt.method}' failed with message: ${Ct.message}`):F.error(`Response handler '${xt.method}' failed unexpectedly.`)}}}}$(Xe,"handleResponse");function Ne(Re){if(ie())return;let at,xt;if(Re.method===o.type.method){const Ct=Re.params.id;re.delete(Ct),Rt(Re);return}else{const Ct=Y.get(Re.method);Ct&&(xt=Ct.handler,at=Ct.type)}if(xt||X)try{if(Rt(Re),xt)if(Re.params===void 0)at!==void 0&&at.numberOfParams!==0&&at.parameterStructures!==n.ParameterStructures.byName&&F.error(`Notification ${Re.method} defines ${at.numberOfParams} params but received none.`),xt();else if(Array.isArray(Re.params)){const Ct=Re.params;Re.method===u.type.method&&Ct.length===2&&l.is(Ct[0])?xt({token:Ct[0],value:Ct[1]}):(at!==void 0&&(at.parameterStructures===n.ParameterStructures.byName&&F.error(`Notification ${Re.method} defines parameters by name but received parameters by position`),at.numberOfParams!==Re.params.length&&F.error(`Notification ${Re.method} defines ${at.numberOfParams} params but received ${Ct.length} arguments`)),xt(...Ct))}else at!==void 0&&at.parameterStructures===n.ParameterStructures.byPosition&&F.error(`Notification ${Re.method} defines parameters by position but received parameters by name`),xt(Re.params);else X&&X(Re.method,Re.params)}catch(Ct){Ct.message?F.error(`Notification handler '${Re.method}' failed with message: ${Ct.message}`):F.error(`Notification handler '${Re.method}' failed unexpectedly.`)}else Te.fire(Re)}$(Ne,"handleNotification");function Ze(Re){if(!Re){F.error("Received empty message.");return}F.error(`Received message which is neither a response nor a notification message: +${v}`);const b=v.substr(0,y),x=v.substr(y+1).trim();p.set(o?b.toLowerCase():b,x)}return p}tryReadBody(o){if(!(this._totalLengththis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===o){const d=this._chunks[0];return this._chunks.shift(),this._totalLength-=o,this.asNative(d)}if(this._chunks[0].byteLength>o){const d=this._chunks[0],f=this.asNative(d,o);return this._chunks[0]=d.slice(o),this._totalLength-=o,f}const l=this.allocNative(o);let u=0,h=0;for(;o>0;){const d=this._chunks[h];if(d.byteLength>o){const f=d.slice(0,o);l.set(f,u),u+=o,this._chunks[h]=d.slice(o),this._totalLength-=o,o-=o}else l.set(d,u),u+=d.byteLength,this._chunks.shift(),this._totalLength-=d.byteLength,o-=d.byteLength}return l}},$(a,"AbstractMessageBuffer"),a);t.AbstractMessageBuffer=i}}),GLn=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(t){var L,R;Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;var e=BC(),r=tF(),n=H6t(),i=W6t(),a=H3(),s=Fee(),o;(function(D){D.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(D){function M(P){return typeof P=="string"||typeof P=="number"}$(M,"is"),D.is=M})(l||(t.ProgressToken=l={}));var u;(function(D){D.type=new n.NotificationType("$/progress")})(u||(u={}));var h=(L=class{constructor(){}},$(L,"ProgressType"),L);t.ProgressType=h;var d;(function(D){function M(P){return r.func(P)}$(M,"is"),D.is=M})(d||(d={})),t.NullLogger=Object.freeze({error:$(()=>{},"error"),warn:$(()=>{},"warn"),info:$(()=>{},"info"),log:$(()=>{},"log")});var f;(function(D){D[D.Off=0]="Off",D[D.Messages=1]="Messages",D[D.Compact=2]="Compact",D[D.Verbose=3]="Verbose"})(f||(t.Trace=f={}));var p;(function(D){D.Off="off",D.Messages="messages",D.Compact="compact",D.Verbose="verbose"})(p||(t.TraceValues=p={})),function(D){function M(N){if(!r.string(N))return D.Off;switch(N=N.toLowerCase(),N){case"off":return D.Off;case"messages":return D.Messages;case"compact":return D.Compact;case"verbose":return D.Verbose;default:return D.Off}}$(M,"fromString"),D.fromString=M;function P(N){switch(N){case D.Off:return"off";case D.Messages:return"messages";case D.Compact:return"compact";case D.Verbose:return"verbose";default:return"off"}}$(P,"toString"),D.toString=P}(f||(t.Trace=f={}));var g;(function(D){D.Text="text",D.JSON="json"})(g||(t.TraceFormat=g={})),function(D){function M(P){return r.string(P)?(P=P.toLowerCase(),P==="json"?D.JSON:D.Text):D.Text}$(M,"fromString"),D.fromString=M}(g||(t.TraceFormat=g={}));var m;(function(D){D.type=new n.NotificationType("$/setTrace")})(m||(t.SetTraceNotification=m={}));var v;(function(D){D.type=new n.NotificationType("$/logTrace")})(v||(t.LogTraceNotification=v={}));var y;(function(D){D[D.Closed=1]="Closed",D[D.Disposed=2]="Disposed",D[D.AlreadyListening=3]="AlreadyListening"})(y||(t.ConnectionErrors=y={}));var b=(R=class extends Error{constructor(M,P){super(P),this.code=M,Object.setPrototypeOf(this,R.prototype)}},$(R,"ConnectionError"),R);t.ConnectionError=b;var x;(function(D){function M(P){const N=P;return N&&r.func(N.cancelUndispatched)}$(M,"is"),D.is=M})(x||(t.ConnectionStrategy=x={}));var w;(function(D){function M(P){const N=P;return N&&(N.kind===void 0||N.kind==="id")&&r.func(N.createCancellationTokenSource)&&(N.dispose===void 0||r.func(N.dispose))}$(M,"is"),D.is=M})(w||(t.IdCancellationReceiverStrategy=w={}));var A;(function(D){function M(P){const N=P;return N&&N.kind==="request"&&r.func(N.createCancellationTokenSource)&&(N.dispose===void 0||r.func(N.dispose))}$(M,"is"),D.is=M})(A||(t.RequestCancellationReceiverStrategy=A={}));var S;(function(D){D.Message=Object.freeze({createCancellationTokenSource(P){return new s.CancellationTokenSource}});function M(P){return w.is(P)||A.is(P)}$(M,"is"),D.is=M})(S||(t.CancellationReceiverStrategy=S={}));var T;(function(D){D.Message=Object.freeze({sendCancellation(P,N){return P.sendNotification(o.type,{id:N})},cleanup(P){}});function M(P){const N=P;return N&&r.func(N.sendCancellation)&&r.func(N.cleanup)}$(M,"is"),D.is=M})(T||(t.CancellationSenderStrategy=T={}));var O;(function(D){D.Message=Object.freeze({receiver:S.Message,sender:T.Message});function M(P){const N=P;return N&&S.is(N.receiver)&&T.is(N.sender)}$(M,"is"),D.is=M})(O||(t.CancellationStrategy=O={}));var k;(function(D){function M(P){const N=P;return N&&r.func(N.handleMessage)}$(M,"is"),D.is=M})(k||(t.MessageStrategy=k={}));var E;(function(D){function M(P){const N=P;return N&&(O.is(N.cancellationStrategy)||x.is(N.connectionStrategy)||k.is(N.messageStrategy))}$(M,"is"),D.is=M})(E||(t.ConnectionOptions=E={}));var _;(function(D){D[D.New=1]="New",D[D.Listening=2]="Listening",D[D.Closed=3]="Closed",D[D.Disposed=4]="Disposed"})(_||(_={}));function I(D,M,P,N){const F=P!==void 0?P:t.NullLogger;let B=0,V=0,z=0;const U="2.0";let Q;const G=new Map;let X;const Y=new Map,le=new Map;let q,Z=new i.LinkedMap,ee=new Map,re=new Set,ve=new Map,ae=f.Off,Ce=g.Text,Oe,$e=_.New;const he=new a.Emitter,fe=new a.Emitter,Se=new a.Emitter,ge=new a.Emitter,Qe=new a.Emitter,Te=N&&N.cancellationStrategy?N.cancellationStrategy:O.Message;function De(Re){if(Re===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Re.toString()}$(De,"createRequestQueueKey");function qe(Re){return Re===null?"res-unknown-"+(++z).toString():"res-"+Re.toString()}$(qe,"createResponseQueueKey");function K(){return"not-"+(++V).toString()}$(K,"createNotificationQueueKey");function ce(Re,at){n.Message.isRequest(at)?Re.set(De(at.id),at):n.Message.isResponse(at)?Re.set(qe(at.id),at):Re.set(K(),at)}$(ce,"addMessageToQueue");function be(Re){}$(be,"cancelUndispatched");function ne(){return $e===_.Listening}$(ne,"isListening");function j(){return $e===_.Closed}$(j,"isClosed");function ie(){return $e===_.Disposed}$(ie,"isDisposed");function pe(){($e===_.New||$e===_.Listening)&&($e=_.Closed,fe.fire(void 0))}$(pe,"closeHandler");function te(Re){he.fire([Re,void 0,void 0])}$(te,"readErrorHandler");function ye(Re){he.fire(Re)}$(ye,"writeErrorHandler"),D.onClose(pe),D.onError(te),M.onClose(pe),M.onError(ye);function oe(){q||Z.size===0||(q=(0,e.default)().timer.setImmediate(()=>{q=void 0,Le()}))}$(oe,"triggerMessageQueue");function _e(Re){n.Message.isRequest(Re)?Pe(Re):n.Message.isNotification(Re)?Ne(Re):n.Message.isResponse(Re)?Xe(Re):Ze(Re)}$(_e,"handleMessage");function Le(){if(Z.size===0)return;const Re=Z.shift();try{const at=N==null?void 0:N.messageStrategy;k.is(at)?at.handleMessage(Re,_e):_e(Re)}finally{oe()}}$(Le,"processMessageQueue");const Ye=$(Re=>{try{if(n.Message.isNotification(Re)&&Re.method===o.type.method){const at=Re.params.id,xt=De(at),Ct=Z.get(xt);if(n.Message.isRequest(Ct)){const Xr=N==null?void 0:N.connectionStrategy,$r=Xr&&Xr.cancelUndispatched?Xr.cancelUndispatched(Ct,be):void 0;if($r&&($r.error!==void 0||$r.result!==void 0)){Z.delete(xt),ve.delete(at),$r.id=Ct.id,wt($r,Re.method,Date.now()),M.write($r).catch(()=>F.error("Sending response for canceled message failed."));return}}const gr=ve.get(at);if(gr!==void 0){gr.cancel(),Rt(Re);return}else re.add(at)}ce(Z,Re)}finally{oe()}},"callback");function Pe(Re){if(ie())return;function at(zr,On,Nr){const hn={jsonrpc:U,id:Re.id};zr instanceof n.ResponseError?hn.error=zr.toJson():hn.result=zr===void 0?null:zr,wt(hn,On,Nr),M.write(hn).catch(()=>F.error("Sending response failed."))}$(at,"reply");function xt(zr,On,Nr){const hn={jsonrpc:U,id:Re.id,error:zr.toJson()};wt(hn,On,Nr),M.write(hn).catch(()=>F.error("Sending response failed."))}$(xt,"replyError");function Ct(zr,On,Nr){zr===void 0&&(zr=null);const hn={jsonrpc:U,id:Re.id,result:zr};wt(hn,On,Nr),M.write(hn).catch(()=>F.error("Sending response failed."))}$(Ct,"replySuccess"),Me(Re);const gr=G.get(Re.method);let Xr,$r;gr&&(Xr=gr.type,$r=gr.handler);const un=Date.now();if($r||Q){const zr=Re.id??String(Date.now()),On=w.is(Te.receiver)?Te.receiver.createCancellationTokenSource(zr):Te.receiver.createCancellationTokenSource(Re);Re.id!==null&&re.has(Re.id)&&On.cancel(),Re.id!==null&&ve.set(zr,On);try{let Nr;if($r)if(Re.params===void 0){if(Xr!==void 0&&Xr.numberOfParams!==0){xt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Re.method} defines ${Xr.numberOfParams} params but received none.`),Re.method,un);return}Nr=$r(On.token)}else if(Array.isArray(Re.params)){if(Xr!==void 0&&Xr.parameterStructures===n.ParameterStructures.byName){xt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Re.method} defines parameters by name but received parameters by position`),Re.method,un);return}Nr=$r(...Re.params,On.token)}else{if(Xr!==void 0&&Xr.parameterStructures===n.ParameterStructures.byPosition){xt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Re.method} defines parameters by position but received parameters by name`),Re.method,un);return}Nr=$r(Re.params,On.token)}else Q&&(Nr=Q(Re.method,Re.params,On.token));const hn=Nr;Nr?hn.then?hn.then(ti=>{ve.delete(zr),at(ti,Re.method,un)},ti=>{ve.delete(zr),ti instanceof n.ResponseError?xt(ti,Re.method,un):ti&&r.string(ti.message)?xt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Re.method} failed with message: ${ti.message}`),Re.method,un):xt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Re.method} failed unexpectedly without providing any details.`),Re.method,un)}):(ve.delete(zr),at(Nr,Re.method,un)):(ve.delete(zr),Ct(Nr,Re.method,un))}catch(Nr){ve.delete(zr),Nr instanceof n.ResponseError?at(Nr,Re.method,un):Nr&&r.string(Nr.message)?xt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Re.method} failed with message: ${Nr.message}`),Re.method,un):xt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Re.method} failed unexpectedly without providing any details.`),Re.method,un)}}else xt(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${Re.method}`),Re.method,un)}$(Pe,"handleRequest");function Xe(Re){if(!ie())if(Re.id===null)Re.error?F.error(`Received response message without id: Error is: +${JSON.stringify(Re.error,void 0,4)}`):F.error("Received response message without id. No further error information provided.");else{const at=Re.id,xt=ee.get(at);if(Lt(Re,xt),xt!==void 0){ee.delete(at);try{if(Re.error){const Ct=Re.error;xt.reject(new n.ResponseError(Ct.code,Ct.message,Ct.data))}else if(Re.result!==void 0)xt.resolve(Re.result);else throw new Error("Should never happen.")}catch(Ct){Ct.message?F.error(`Response handler '${xt.method}' failed with message: ${Ct.message}`):F.error(`Response handler '${xt.method}' failed unexpectedly.`)}}}}$(Xe,"handleResponse");function Ne(Re){if(ie())return;let at,xt;if(Re.method===o.type.method){const Ct=Re.params.id;re.delete(Ct),Rt(Re);return}else{const Ct=Y.get(Re.method);Ct&&(xt=Ct.handler,at=Ct.type)}if(xt||X)try{if(Rt(Re),xt)if(Re.params===void 0)at!==void 0&&at.numberOfParams!==0&&at.parameterStructures!==n.ParameterStructures.byName&&F.error(`Notification ${Re.method} defines ${at.numberOfParams} params but received none.`),xt();else if(Array.isArray(Re.params)){const Ct=Re.params;Re.method===u.type.method&&Ct.length===2&&l.is(Ct[0])?xt({token:Ct[0],value:Ct[1]}):(at!==void 0&&(at.parameterStructures===n.ParameterStructures.byName&&F.error(`Notification ${Re.method} defines parameters by name but received parameters by position`),at.numberOfParams!==Re.params.length&&F.error(`Notification ${Re.method} defines ${at.numberOfParams} params but received ${Ct.length} arguments`)),xt(...Ct))}else at!==void 0&&at.parameterStructures===n.ParameterStructures.byPosition&&F.error(`Notification ${Re.method} defines parameters by position but received parameters by name`),xt(Re.params);else X&&X(Re.method,Re.params)}catch(Ct){Ct.message?F.error(`Notification handler '${Re.method}' failed with message: ${Ct.message}`):F.error(`Notification handler '${Re.method}' failed unexpectedly.`)}else Se.fire(Re)}$(Ne,"handleNotification");function Ze(Re){if(!Re){F.error("Received empty message.");return}F.error(`Received message which is neither a response nor a notification message: ${JSON.stringify(Re,null,4)}`);const at=Re;if(r.string(at.id)||r.number(at.id)){const xt=at.id,Ct=ee.get(xt);Ct&&Ct.reject(new Error("The received response has neither a result nor an error property."))}}$(Ze,"handleInvalidMessage");function Ge(Re){if(Re!=null)switch(ae){case f.Verbose:return JSON.stringify(Re,null,4);case f.Compact:return JSON.stringify(Re);default:return}}$(Ge,"stringifyTrace");function lt(Re){if(!(ae===f.Off||!Oe))if(Ce===g.Text){let at;(ae===f.Verbose||ae===f.Compact)&&Re.params&&(at=`Params: ${Ge(Re.params)} `),Oe.log(`Sending request '${Re.method} - (${Re.id})'.`,at)}else ut("send-request",Re)}$(lt,"traceSendingRequest");function Fe(Re){if(!(ae===f.Off||!Oe))if(Ce===g.Text){let at;(ae===f.Verbose||ae===f.Compact)&&(Re.params?at=`Params: ${Ge(Re.params)} @@ -1605,19 +1605,19 @@ ${JSON.stringify(Re,null,4)}`);const at=Re;if(r.string(at.id)||r.number(at.id)){ `:Re.error===void 0&&(xt=`No result returned. -`)),at){const Ct=Re.error?` Request failed: ${Re.error.message} (${Re.error.code}).`:"";Oe.log(`Received response '${at.method} - (${Re.id})' in ${Date.now()-at.timerStart}ms.${Ct}`,xt)}else Oe.log(`Received response ${Re.id} without active response promise.`,xt)}else ut("receive-response",Re)}$(Lt,"traceReceivedResponse");function ut(Re,at){if(!Oe||ae===f.Off)return;const xt={isLSPMessage:!0,type:Re,message:at,timestamp:Date.now()};Oe.log(xt)}$(ut,"logLSPMessage");function Xt(){if(j())throw new b(y.Closed,"Connection is closed.");if(ie())throw new b(y.Disposed,"Connection is disposed.")}$(Xt,"throwIfClosedOrDisposed");function Ft(){if(ne())throw new b(y.AlreadyListening,"Connection is already listening")}$(Ft,"throwIfListening");function gt(){if(!ne())throw new Error("Call listen() first.")}$(gt,"throwIfNotListening");function Ae(Re){return Re===void 0?null:Re}$(Ae,"undefinedToNull");function zt(Re){if(Re!==null)return Re}$(zt,"nullToUndefined");function kt(Re){return Re!=null&&!Array.isArray(Re)&&typeof Re=="object"}$(kt,"isNamedParam");function At(Re,at){switch(Re){case n.ParameterStructures.auto:return kt(at)?zt(at):[Ae(at)];case n.ParameterStructures.byName:if(!kt(at))throw new Error("Received parameters by name but param is not an object literal.");return zt(at);case n.ParameterStructures.byPosition:return[Ae(at)];default:throw new Error(`Unknown parameter structure ${Re.toString()}`)}}$(At,"computeSingleParam");function Mt(Re,at){let xt;const Ct=Re.numberOfParams;switch(Ct){case 0:xt=void 0;break;case 1:xt=At(Re.parameterStructures,at[0]);break;default:xt=[];for(let gr=0;gr{Xt();let xt,Ct;if(r.string(Re)){xt=Re;const Xr=at[0];let $r=0,un=n.ParameterStructures.auto;n.ParameterStructures.is(Xr)&&($r=1,un=Xr);let zr=at.length;const On=zr-$r;switch(On){case 0:Ct=void 0;break;case 1:Ct=At(un,at[$r]);break;default:if(un===n.ParameterStructures.byName)throw new Error(`Received ${On} parameters for 'by Name' notification parameter structure.`);Ct=at.slice($r,zr).map(Nr=>Ae(Nr));break}}else{const Xr=at;xt=Re.method,Ct=Mt(Re,Xr)}const gr={jsonrpc:U,method:xt,params:Ct};return Fe(gr),M.write(gr).catch(Xr=>{throw F.error("Sending notification failed."),Xr})},"sendNotification"),onNotification:$((Re,at)=>{Xt();let xt;return r.func(Re)?X=Re:at&&(r.string(Re)?(xt=Re,Y.set(Re,{type:void 0,handler:at})):(xt=Re.method,Y.set(Re.method,{type:Re,handler:at}))),{dispose:$(()=>{xt!==void 0?Y.delete(xt):X=void 0},"dispose")}},"onNotification"),onProgress:$((Re,at,xt)=>{if(le.has(at))throw new Error(`Progress handler for token ${at} already registered`);return le.set(at,xt),{dispose:$(()=>{le.delete(at)},"dispose")}},"onProgress"),sendProgress:$((Re,at,xt)=>jr.sendNotification(u.type,{token:at,value:xt}),"sendProgress"),onUnhandledProgress:ge.event,sendRequest:$((Re,...at)=>{Xt(),gt();let xt,Ct,gr;if(r.string(Re)){xt=Re;const zr=at[0],On=at[at.length-1];let Nr=0,hn=n.ParameterStructures.auto;n.ParameterStructures.is(zr)&&(Nr=1,hn=zr);let ti=at.length;s.CancellationToken.is(On)&&(ti=ti-1,gr=On);const pt=ti-Nr;switch(pt){case 0:Ct=void 0;break;case 1:Ct=At(hn,at[Nr]);break;default:if(hn===n.ParameterStructures.byName)throw new Error(`Received ${pt} parameters for 'by Name' request parameter structure.`);Ct=at.slice(Nr,ti).map(Tt=>Ae(Tt));break}}else{const zr=at;xt=Re.method,Ct=Mt(Re,zr);const On=Re.numberOfParams;gr=s.CancellationToken.is(zr[On])?zr[On]:void 0}const Xr=B++;let $r;gr&&($r=gr.onCancellationRequested(()=>{const zr=Se.sender.sendCancellation(jr,Xr);return zr===void 0?(F.log(`Received no promise from cancellation strategy when cancelling id ${Xr}`),Promise.resolve()):zr.catch(()=>{F.log(`Sending cancellation messages for id ${Xr} failed`)})}));const un={jsonrpc:U,id:Xr,method:xt,params:Ct};return lt(un),typeof Se.sender.enableCancellation=="function"&&Se.sender.enableCancellation(un),new Promise(async(zr,On)=>{const Nr=$(pt=>{zr(pt),Se.sender.cleanup(Xr),$r==null||$r.dispose()},"resolveWithCleanup"),hn=$(pt=>{On(pt),Se.sender.cleanup(Xr),$r==null||$r.dispose()},"rejectWithCleanup"),ti={method:xt,timerStart:Date.now(),resolve:Nr,reject:hn};try{await M.write(un),ee.set(Xr,ti)}catch(pt){throw F.error("Sending request failed."),ti.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,pt.message?pt.message:"Unknown reason")),pt}})},"sendRequest"),onRequest:$((Re,at)=>{Xt();let xt=null;return d.is(Re)?(xt=void 0,Q=Re):r.string(Re)?(xt=null,at!==void 0&&(xt=Re,G.set(Re,{handler:at,type:void 0}))):at!==void 0&&(xt=Re.method,G.set(Re.method,{type:Re,handler:at})),{dispose:$(()=>{xt!==null&&(xt!==void 0?G.delete(xt):Q=void 0)},"dispose")}},"onRequest"),hasPendingResponse:$(()=>ee.size>0,"hasPendingResponse"),trace:$(async(Re,at,xt)=>{let Ct=!1,gr=g.Text;xt!==void 0&&(r.boolean(xt)?Ct=xt:(Ct=xt.sendNotification||!1,gr=xt.traceFormat||g.Text)),ae=Re,Ce=gr,ae===f.Off?Oe=void 0:Oe=at,Ct&&!j()&&!ie()&&await jr.sendNotification(m.type,{value:f.toString(Re)})},"trace"),onError:he.event,onClose:fe.event,onUnhandledNotification:Te.event,onDispose:Qe.event,end:$(()=>{M.end()},"end"),dispose:$(()=>{if(ie())return;$e=_.Disposed,Qe.fire(void 0);const Re=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const at of ee.values())at.reject(Re);ee=new Map,ve=new Map,re=new Set,Z=new i.LinkedMap,r.func(M.dispose)&&M.dispose(),r.func(D.dispose)&&D.dispose()},"dispose"),listen:$(()=>{Xt(),Ft(),$e=_.Listening,D.listen(Ye)},"listen"),inspect:$(()=>{(0,e.default)().console.log("inspect")},"inspect")};return jr.onNotification(v.type,Re=>{if(ae===f.Off||!Oe)return;const at=ae===f.Verbose||ae===f.Compact;Oe.log(Re.message,at?Re.verbose:void 0)}),jr.onNotification(u.type,Re=>{const at=le.get(Re.token);at?at(Re.value):ge.fire(Re)}),jr}$(I,"createMessageConnection"),t.createMessageConnection=I}}),YEe=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/api.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;var e=H6t();Object.defineProperty(t,"Message",{enumerable:!0,get:$(function(){return e.Message},"get")}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:$(function(){return e.RequestType},"get")}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:$(function(){return e.RequestType0},"get")}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:$(function(){return e.RequestType1},"get")}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:$(function(){return e.RequestType2},"get")}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:$(function(){return e.RequestType3},"get")}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:$(function(){return e.RequestType4},"get")}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:$(function(){return e.RequestType5},"get")}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:$(function(){return e.RequestType6},"get")}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:$(function(){return e.RequestType7},"get")}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:$(function(){return e.RequestType8},"get")}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:$(function(){return e.RequestType9},"get")}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:$(function(){return e.ResponseError},"get")}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:$(function(){return e.ErrorCodes},"get")}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:$(function(){return e.NotificationType},"get")}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:$(function(){return e.NotificationType0},"get")}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:$(function(){return e.NotificationType1},"get")}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:$(function(){return e.NotificationType2},"get")}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:$(function(){return e.NotificationType3},"get")}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:$(function(){return e.NotificationType4},"get")}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:$(function(){return e.NotificationType5},"get")}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:$(function(){return e.NotificationType6},"get")}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:$(function(){return e.NotificationType7},"get")}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:$(function(){return e.NotificationType8},"get")}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:$(function(){return e.NotificationType9},"get")}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:$(function(){return e.ParameterStructures},"get")});var r=W6t();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:$(function(){return r.LinkedMap},"get")}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:$(function(){return r.LRUCache},"get")}),Object.defineProperty(t,"Touch",{enumerable:!0,get:$(function(){return r.Touch},"get")});var n=FLn();Object.defineProperty(t,"Disposable",{enumerable:!0,get:$(function(){return n.Disposable},"get")});var i=H3();Object.defineProperty(t,"Event",{enumerable:!0,get:$(function(){return i.Event},"get")}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:$(function(){return i.Emitter},"get")});var a=Fee();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:$(function(){return a.CancellationTokenSource},"get")}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:$(function(){return a.CancellationToken},"get")});var s=zLn();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:$(function(){return s.SharedArraySenderStrategy},"get")}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:$(function(){return s.SharedArrayReceiverStrategy},"get")});var o=ULn();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:$(function(){return o.MessageReader},"get")}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:$(function(){return o.AbstractMessageReader},"get")}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:$(function(){return o.ReadableStreamMessageReader},"get")});var l=VLn();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:$(function(){return l.MessageWriter},"get")}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:$(function(){return l.AbstractMessageWriter},"get")}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:$(function(){return l.WriteableStreamMessageWriter},"get")});var u=QLn();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:$(function(){return u.AbstractMessageBuffer},"get")});var h=GLn();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:$(function(){return h.ConnectionStrategy},"get")}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:$(function(){return h.ConnectionOptions},"get")}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:$(function(){return h.NullLogger},"get")}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:$(function(){return h.createMessageConnection},"get")}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:$(function(){return h.ProgressToken},"get")}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:$(function(){return h.ProgressType},"get")}),Object.defineProperty(t,"Trace",{enumerable:!0,get:$(function(){return h.Trace},"get")}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:$(function(){return h.TraceValues},"get")}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:$(function(){return h.TraceFormat},"get")}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:$(function(){return h.SetTraceNotification},"get")}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:$(function(){return h.LogTraceNotification},"get")}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:$(function(){return h.ConnectionErrors},"get")}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:$(function(){return h.ConnectionError},"get")}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:$(function(){return h.CancellationReceiverStrategy},"get")}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:$(function(){return h.CancellationSenderStrategy},"get")}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:$(function(){return h.CancellationStrategy},"get")}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:$(function(){return h.MessageStrategy},"get")});var d=BC();t.RAL=d.default}}),HLn=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/ril.js"(t){var l,u,h;Object.defineProperty(t,"__esModule",{value:!0});var e=YEe(),r=(l=class extends e.AbstractMessageBuffer{constructor(f="utf-8"){super(f),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return l.emptyBuffer}fromString(f,p){return new TextEncoder().encode(f)}toString(f,p){return p==="ascii"?this.asciiDecoder.decode(f):new TextDecoder(p).decode(f)}asNative(f,p){return p===void 0?f:f.slice(0,p)}allocNative(f){return new Uint8Array(f)}},$(l,"MessageBuffer"),l);r.emptyBuffer=new Uint8Array(0);var n=(u=class{constructor(f){this.socket=f,this._onData=new e.Emitter,this._messageListener=p=>{p.data.arrayBuffer().then(m=>{this._onData.fire(new Uint8Array(m))},()=>{(0,e.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}onData(f){return this._onData.event(f)}},$(u,"ReadableStreamWrapper"),u),i=(h=class{constructor(f){this.socket=f}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}write(f,p){if(typeof f=="string"){if(p!==void 0&&p!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${p}`);this.socket.send(f)}else this.socket.send(f);return Promise.resolve()}end(){this.socket.close()}},$(h,"WritableStreamWrapper"),h),a=new TextEncoder,s=Object.freeze({messageBuffer:Object.freeze({create:$(d=>new r(d),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:$((d,f)=>{if(f.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${f.charset}`);return Promise.resolve(a.encode(JSON.stringify(d,void 0,0)))},"encode")}),decoder:Object.freeze({name:"application/json",decode:$((d,f)=>{if(!(d instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(f.charset).decode(d)))},"decode")})}),stream:Object.freeze({asReadableStream:$(d=>new n(d),"asReadableStream"),asWritableStream:$(d=>new i(d),"asWritableStream")}),console,timer:Object.freeze({setTimeout(d,f,...p){const g=setTimeout(d,f,...p);return{dispose:$(()=>clearTimeout(g),"dispose")}},setImmediate(d,...f){const p=setTimeout(d,0,...f);return{dispose:$(()=>clearTimeout(p),"dispose")}},setInterval(d,f,...p){const g=setInterval(d,f,...p);return{dispose:$(()=>clearInterval(g),"dispose")}}})});function o(){return s}$(o,"RIL"),function(d){function f(){e.RAL.install(s)}$(f,"install"),d.install=f}(o||(o={})),t.default=o}}),W3=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/main.js"(t){var l,u;var e=t&&t.__createBinding||(Object.create?function(h,d,f,p){p===void 0&&(p=f);var g=Object.getOwnPropertyDescriptor(d,f);(!g||("get"in g?!d.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:$(function(){return d[f]},"get")}),Object.defineProperty(h,p,g)}:function(h,d,f,p){p===void 0&&(p=f),h[p]=d[f]}),r=t&&t.__exportStar||function(h,d){for(var f in h)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&e(d,h,f)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0;var n=HLn();n.default.install();var i=YEe();r(YEe(),t);var a=(l=class extends i.AbstractMessageReader{constructor(d){super(),this._onData=new i.Emitter,this._messageListener=f=>{this._onData.fire(f.data)},d.addEventListener("error",f=>this.fireError(f)),d.onmessage=this._messageListener}listen(d){return this._onData.event(d)}},$(l,"BrowserMessageReader"),l);t.BrowserMessageReader=a;var s=(u=class extends i.AbstractMessageWriter{constructor(d){super(),this.port=d,this.errorCount=0,d.addEventListener("error",f=>this.fireError(f))}write(d){try{return this.port.postMessage(d),Promise.resolve()}catch(f){return this.handleError(f,d),Promise.reject(f)}}handleError(d,f){this.errorCount++,this.fireError(d,f,this.errorCount)}end(){}},$(u,"BrowserMessageWriter"),u);t.BrowserMessageWriter=s;function o(h,d,f,p){return f===void 0&&(f=i.NullLogger),i.ConnectionStrategy.is(p)&&(p={connectionStrategy:p}),(0,i.createMessageConnection)(h,d,f,p)}$(o,"createMessageConnection"),t.createMessageConnection=o}}),q6t=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(t,e){e.exports=W3()}}),Os=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js"(t){var l,u,h,d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolNotificationType=t.ProtocolNotificationType0=t.ProtocolRequestType=t.ProtocolRequestType0=t.RegistrationType=t.MessageDirection=void 0;var e=W3(),r;(function(p){p.clientToServer="clientToServer",p.serverToClient="serverToClient",p.both="both"})(r||(t.MessageDirection=r={}));var n=(l=class{constructor(g){this.method=g}},$(l,"RegistrationType"),l);t.RegistrationType=n;var i=(u=class extends e.RequestType0{constructor(g){super(g)}},$(u,"ProtocolRequestType0"),u);t.ProtocolRequestType0=i;var a=(h=class extends e.RequestType{constructor(g){super(g,e.ParameterStructures.byName)}},$(h,"ProtocolRequestType"),h);t.ProtocolRequestType=a;var s=(d=class extends e.NotificationType0{constructor(g){super(g)}},$(d,"ProtocolNotificationType0"),d);t.ProtocolNotificationType0=s;var o=(f=class extends e.NotificationType{constructor(g){super(g,e.ParameterStructures.byName)}},$(f,"ProtocolNotificationType"),f);t.ProtocolNotificationType=o}}),qEe=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.objectLiteral=t.typedArray=t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(h){return h===!0||h===!1}$(e,"boolean"),t.boolean=e;function r(h){return typeof h=="string"||h instanceof String}$(r,"string"),t.string=r;function n(h){return typeof h=="number"||h instanceof Number}$(n,"number"),t.number=n;function i(h){return h instanceof Error}$(i,"error"),t.error=i;function a(h){return typeof h=="function"}$(a,"func"),t.func=a;function s(h){return Array.isArray(h)}$(s,"array"),t.array=s;function o(h){return s(h)&&h.every(d=>r(d))}$(o,"stringArray"),t.stringArray=o;function l(h,d){return Array.isArray(h)&&h.every(d)}$(l,"typedArray"),t.typedArray=l;function u(h){return h!==null&&typeof h=="object"}$(u,"objectLiteral"),t.objectLiteral=u}}),WLn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImplementationRequest=void 0;var e=Os(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ImplementationRequest=r={}))}}),YLn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeDefinitionRequest=void 0;var e=Os(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.TypeDefinitionRequest=r={}))}}),qLn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=void 0;var e=Os(),r;(function(i){i.method="workspace/workspaceFolders",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(r||(t.WorkspaceFoldersRequest=r={}));var n;(function(i){i.method="workspace/didChangeWorkspaceFolders",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolNotificationType(i.method)})(n||(t.DidChangeWorkspaceFoldersNotification=n={}))}}),jLn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationRequest=void 0;var e=Os(),r;(function(n){n.method="workspace/configuration",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ConfigurationRequest=r={}))}}),XLn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorPresentationRequest=t.DocumentColorRequest=void 0;var e=Os(),r;(function(i){i.method="textDocument/documentColor",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.DocumentColorRequest=r={}));var n;(function(i){i.method="textDocument/colorPresentation",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(n||(t.ColorPresentationRequest=n={}))}}),KLn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=void 0;var e=Os(),r;(function(i){i.method="textDocument/foldingRange",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.FoldingRangeRequest=r={}));var n;(function(i){i.method="workspace/foldingRange/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.FoldingRangeRefreshRequest=n={}))}}),ZLn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DeclarationRequest=void 0;var e=Os(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.DeclarationRequest=r={}))}}),JLn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRangeRequest=void 0;var e=Os(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.SelectionRangeRequest=r={}))}}),eMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=void 0;var e=W3(),r=Os(),n;(function(s){s.type=new e.ProgressType;function o(l){return l===s.type}$(o,"is"),s.is=o})(n||(t.WorkDoneProgress=n={}));var i;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=r.MessageDirection.serverToClient,s.type=new r.ProtocolRequestType(s.method)})(i||(t.WorkDoneProgressCreateRequest=i={}));var a;(function(s){s.method="window/workDoneProgress/cancel",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolNotificationType(s.method)})(a||(t.WorkDoneProgressCancelNotification=a={}))}}),tMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.CallHierarchyPrepareRequest=void 0;var e=Os(),r;(function(a){a.method="textDocument/prepareCallHierarchy",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.CallHierarchyPrepareRequest=r={}));var n;(function(a){a.method="callHierarchy/incomingCalls",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.CallHierarchyIncomingCallsRequest=n={}));var i;(function(a){a.method="callHierarchy/outgoingCalls",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.CallHierarchyOutgoingCallsRequest=i={}))}}),rMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.SemanticTokensRegistrationType=t.TokenFormat=void 0;var e=Os(),r;(function(l){l.Relative="relative"})(r||(t.TokenFormat=r={}));var n;(function(l){l.method="textDocument/semanticTokens",l.type=new e.RegistrationType(l.method)})(n||(t.SemanticTokensRegistrationType=n={}));var i;(function(l){l.method="textDocument/semanticTokens/full",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(i||(t.SemanticTokensRequest=i={}));var a;(function(l){l.method="textDocument/semanticTokens/full/delta",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(a||(t.SemanticTokensDeltaRequest=a={}));var s;(function(l){l.method="textDocument/semanticTokens/range",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(s||(t.SemanticTokensRangeRequest=s={}));var o;(function(l){l.method="workspace/semanticTokens/refresh",l.messageDirection=e.MessageDirection.serverToClient,l.type=new e.ProtocolRequestType0(l.method)})(o||(t.SemanticTokensRefreshRequest=o={}))}}),nMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ShowDocumentRequest=void 0;var e=Os(),r;(function(n){n.method="window/showDocument",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ShowDocumentRequest=r={}))}}),iMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedEditingRangeRequest=void 0;var e=Os(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.LinkedEditingRangeRequest=r={}))}}),aMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.DidRenameFilesNotification=t.WillRenameFilesRequest=t.DidCreateFilesNotification=t.WillCreateFilesRequest=t.FileOperationPatternKind=void 0;var e=Os(),r;(function(u){u.file="file",u.folder="folder"})(r||(t.FileOperationPatternKind=r={}));var n;(function(u){u.method="workspace/willCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(n||(t.WillCreateFilesRequest=n={}));var i;(function(u){u.method="workspace/didCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(i||(t.DidCreateFilesNotification=i={}));var a;(function(u){u.method="workspace/willRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(a||(t.WillRenameFilesRequest=a={}));var s;(function(u){u.method="workspace/didRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(s||(t.DidRenameFilesNotification=s={}));var o;(function(u){u.method="workspace/didDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(o||(t.DidDeleteFilesNotification=o={}));var l;(function(u){u.method="workspace/willDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(l||(t.WillDeleteFilesRequest=l={}))}}),sMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=void 0;var e=Os(),r;(function(a){a.document="document",a.project="project",a.group="group",a.scheme="scheme",a.global="global"})(r||(t.UniquenessLevel=r={}));var n;(function(a){a.$import="import",a.$export="export",a.local="local"})(n||(t.MonikerKind=n={}));var i;(function(a){a.method="textDocument/moniker",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.MonikerRequest=i={}))}}),oMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchySubtypesRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchyPrepareRequest=void 0;var e=Os(),r;(function(a){a.method="textDocument/prepareTypeHierarchy",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.TypeHierarchyPrepareRequest=r={}));var n;(function(a){a.method="typeHierarchy/supertypes",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.TypeHierarchySupertypesRequest=n={}));var i;(function(a){a.method="typeHierarchy/subtypes",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.TypeHierarchySubtypesRequest=i={}))}}),lMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlineValueRefreshRequest=t.InlineValueRequest=void 0;var e=Os(),r;(function(i){i.method="textDocument/inlineValue",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.InlineValueRequest=r={}));var n;(function(i){i.method="workspace/inlineValue/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.InlineValueRefreshRequest=n={}))}}),cMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=void 0;var e=Os(),r;(function(a){a.method="textDocument/inlayHint",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.InlayHintRequest=r={}));var n;(function(a){a.method="inlayHint/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.InlayHintResolveRequest=n={}));var i;(function(a){a.method="workspace/inlayHint/refresh",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType0(a.method)})(i||(t.InlayHintRefreshRequest=i={}))}}),uMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=void 0;var e=W3(),r=qEe(),n=Os(),i;(function(u){function h(d){const f=d;return f&&r.boolean(f.retriggerRequest)}$(h,"is"),u.is=h})(i||(t.DiagnosticServerCancellationData=i={}));var a;(function(u){u.Full="full",u.Unchanged="unchanged"})(a||(t.DocumentDiagnosticReportKind=a={}));var s;(function(u){u.method="textDocument/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(s||(t.DocumentDiagnosticRequest=s={}));var o;(function(u){u.method="workspace/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(o||(t.WorkspaceDiagnosticRequest=o={}));var l;(function(u){u.method="workspace/diagnostic/refresh",u.messageDirection=n.MessageDirection.serverToClient,u.type=new n.ProtocolRequestType0(u.method)})(l||(t.DiagnosticRefreshRequest=l={}))}}),hMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=void 0;var e=(eF(),Hke(Dee)),r=qEe(),n=Os(),i;(function(g){g.Markup=1,g.Code=2;function m(v){return v===1||v===2}$(m,"is"),g.is=m})(i||(t.NotebookCellKind=i={}));var a;(function(g){function m(b,x){const w={executionOrder:b};return(x===!0||x===!1)&&(w.success=x),w}$(m,"create"),g.create=m;function v(b){const x=b;return r.objectLiteral(x)&&e.uinteger.is(x.executionOrder)&&(x.success===void 0||r.boolean(x.success))}$(v,"is"),g.is=v;function y(b,x){return b===x?!0:b==null||x===null||x===void 0?!1:b.executionOrder===x.executionOrder&&b.success===x.success}$(y,"equals"),g.equals=y})(a||(t.ExecutionSummary=a={}));var s;(function(g){function m(x,w){return{kind:x,document:w}}$(m,"create"),g.create=m;function v(x){const w=x;return r.objectLiteral(w)&&i.is(w.kind)&&e.DocumentUri.is(w.document)&&(w.metadata===void 0||r.objectLiteral(w.metadata))}$(v,"is"),g.is=v;function y(x,w){const A=new Set;return x.document!==w.document&&A.add("document"),x.kind!==w.kind&&A.add("kind"),x.executionSummary!==w.executionSummary&&A.add("executionSummary"),(x.metadata!==void 0||w.metadata!==void 0)&&!b(x.metadata,w.metadata)&&A.add("metadata"),(x.executionSummary!==void 0||w.executionSummary!==void 0)&&!a.equals(x.executionSummary,w.executionSummary)&&A.add("executionSummary"),A}$(y,"diff"),g.diff=y;function b(x,w){if(x===w)return!0;if(x==null||w===null||w===void 0||typeof x!=typeof w||typeof x!="object")return!1;const A=Array.isArray(x),T=Array.isArray(w);if(A!==T)return!1;if(A&&T){if(x.length!==w.length)return!1;for(let S=0;S0}$(zt,"hasId"),Ae.hasId=zt})(N||(t.StaticRegistrationOptions=N={}));var F;(function(Ae){function zt(kt){const At=kt;return At&&(At.documentSelector===null||I.is(At.documentSelector))}$(zt,"is"),Ae.is=zt})(F||(t.TextDocumentRegistrationOptions=F={}));var B;(function(Ae){function zt(At){const Mt=At;return n.objectLiteral(Mt)&&(Mt.workDoneProgress===void 0||n.boolean(Mt.workDoneProgress))}$(zt,"is"),Ae.is=zt;function kt(At){const Mt=At;return Mt&&n.boolean(Mt.workDoneProgress)}$(kt,"hasWorkDoneProgress"),Ae.hasWorkDoneProgress=kt})(B||(t.WorkDoneProgressOptions=B={}));var V;(function(Ae){Ae.method="initialize",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(V||(t.InitializeRequest=V={}));var z;(function(Ae){Ae.unknownProtocolVersion=1})(z||(t.InitializeErrorCodes=z={}));var U;(function(Ae){Ae.method="initialized",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolNotificationType(Ae.method)})(U||(t.InitializedNotification=U={}));var Q;(function(Ae){Ae.method="shutdown",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType0(Ae.method)})(Q||(t.ShutdownRequest=Q={}));var G;(function(Ae){Ae.method="exit",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolNotificationType0(Ae.method)})(G||(t.ExitNotification=G={}));var X;(function(Ae){Ae.method="workspace/didChangeConfiguration",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolNotificationType(Ae.method)})(X||(t.DidChangeConfigurationNotification=X={}));var Y;(function(Ae){Ae.Error=1,Ae.Warning=2,Ae.Info=3,Ae.Log=4,Ae.Debug=5})(Y||(t.MessageType=Y={}));var le;(function(Ae){Ae.method="window/showMessage",Ae.messageDirection=e.MessageDirection.serverToClient,Ae.type=new e.ProtocolNotificationType(Ae.method)})(le||(t.ShowMessageNotification=le={}));var q;(function(Ae){Ae.method="window/showMessageRequest",Ae.messageDirection=e.MessageDirection.serverToClient,Ae.type=new e.ProtocolRequestType(Ae.method)})(q||(t.ShowMessageRequest=q={}));var Z;(function(Ae){Ae.method="window/logMessage",Ae.messageDirection=e.MessageDirection.serverToClient,Ae.type=new e.ProtocolNotificationType(Ae.method)})(Z||(t.LogMessageNotification=Z={}));var ee;(function(Ae){Ae.method="telemetry/event",Ae.messageDirection=e.MessageDirection.serverToClient,Ae.type=new e.ProtocolNotificationType(Ae.method)})(ee||(t.TelemetryEventNotification=ee={}));var re;(function(Ae){Ae.None=0,Ae.Full=1,Ae.Incremental=2})(re||(t.TextDocumentSyncKind=re={}));var ve;(function(Ae){Ae.method="textDocument/didOpen",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolNotificationType(Ae.method)})(ve||(t.DidOpenTextDocumentNotification=ve={}));var ae;(function(Ae){function zt(At){let Mt=At;return Mt!=null&&typeof Mt.text=="string"&&Mt.range!==void 0&&(Mt.rangeLength===void 0||typeof Mt.rangeLength=="number")}$(zt,"isIncremental"),Ae.isIncremental=zt;function kt(At){let Mt=At;return Mt!=null&&typeof Mt.text=="string"&&Mt.range===void 0&&Mt.rangeLength===void 0}$(kt,"isFull"),Ae.isFull=kt})(ae||(t.TextDocumentContentChangeEvent=ae={}));var Ce;(function(Ae){Ae.method="textDocument/didChange",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolNotificationType(Ae.method)})(Ce||(t.DidChangeTextDocumentNotification=Ce={}));var Oe;(function(Ae){Ae.method="textDocument/didClose",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolNotificationType(Ae.method)})(Oe||(t.DidCloseTextDocumentNotification=Oe={}));var $e;(function(Ae){Ae.method="textDocument/didSave",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolNotificationType(Ae.method)})($e||(t.DidSaveTextDocumentNotification=$e={}));var he;(function(Ae){Ae.Manual=1,Ae.AfterDelay=2,Ae.FocusOut=3})(he||(t.TextDocumentSaveReason=he={}));var fe;(function(Ae){Ae.method="textDocument/willSave",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolNotificationType(Ae.method)})(fe||(t.WillSaveTextDocumentNotification=fe={}));var Te;(function(Ae){Ae.method="textDocument/willSaveWaitUntil",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(Te||(t.WillSaveTextDocumentWaitUntilRequest=Te={}));var ge;(function(Ae){Ae.method="workspace/didChangeWatchedFiles",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolNotificationType(Ae.method)})(ge||(t.DidChangeWatchedFilesNotification=ge={}));var Qe;(function(Ae){Ae.Created=1,Ae.Changed=2,Ae.Deleted=3})(Qe||(t.FileChangeType=Qe={}));var Se;(function(Ae){function zt(kt){const At=kt;return n.objectLiteral(At)&&(r.URI.is(At.baseUri)||r.WorkspaceFolder.is(At.baseUri))&&n.string(At.pattern)}$(zt,"is"),Ae.is=zt})(Se||(t.RelativePattern=Se={}));var De;(function(Ae){Ae.Create=1,Ae.Change=2,Ae.Delete=4})(De||(t.WatchKind=De={}));var qe;(function(Ae){Ae.method="textDocument/publishDiagnostics",Ae.messageDirection=e.MessageDirection.serverToClient,Ae.type=new e.ProtocolNotificationType(Ae.method)})(qe||(t.PublishDiagnosticsNotification=qe={}));var K;(function(Ae){Ae.Invoked=1,Ae.TriggerCharacter=2,Ae.TriggerForIncompleteCompletions=3})(K||(t.CompletionTriggerKind=K={}));var ce;(function(Ae){Ae.method="textDocument/completion",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(ce||(t.CompletionRequest=ce={}));var be;(function(Ae){Ae.method="completionItem/resolve",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(be||(t.CompletionResolveRequest=be={}));var ne;(function(Ae){Ae.method="textDocument/hover",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(ne||(t.HoverRequest=ne={}));var j;(function(Ae){Ae.Invoked=1,Ae.TriggerCharacter=2,Ae.ContentChange=3})(j||(t.SignatureHelpTriggerKind=j={}));var ie;(function(Ae){Ae.method="textDocument/signatureHelp",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(ie||(t.SignatureHelpRequest=ie={}));var pe;(function(Ae){Ae.method="textDocument/definition",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(pe||(t.DefinitionRequest=pe={}));var te;(function(Ae){Ae.method="textDocument/references",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(te||(t.ReferencesRequest=te={}));var ye;(function(Ae){Ae.method="textDocument/documentHighlight",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(ye||(t.DocumentHighlightRequest=ye={}));var oe;(function(Ae){Ae.method="textDocument/documentSymbol",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(oe||(t.DocumentSymbolRequest=oe={}));var _e;(function(Ae){Ae.method="textDocument/codeAction",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(_e||(t.CodeActionRequest=_e={}));var Le;(function(Ae){Ae.method="codeAction/resolve",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(Le||(t.CodeActionResolveRequest=Le={}));var Ye;(function(Ae){Ae.method="workspace/symbol",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(Ye||(t.WorkspaceSymbolRequest=Ye={}));var Pe;(function(Ae){Ae.method="workspaceSymbol/resolve",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(Pe||(t.WorkspaceSymbolResolveRequest=Pe={}));var Xe;(function(Ae){Ae.method="textDocument/codeLens",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(Xe||(t.CodeLensRequest=Xe={}));var Ne;(function(Ae){Ae.method="codeLens/resolve",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(Ne||(t.CodeLensResolveRequest=Ne={}));var Ze;(function(Ae){Ae.method="workspace/codeLens/refresh",Ae.messageDirection=e.MessageDirection.serverToClient,Ae.type=new e.ProtocolRequestType0(Ae.method)})(Ze||(t.CodeLensRefreshRequest=Ze={}));var Ge;(function(Ae){Ae.method="textDocument/documentLink",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(Ge||(t.DocumentLinkRequest=Ge={}));var lt;(function(Ae){Ae.method="documentLink/resolve",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(lt||(t.DocumentLinkResolveRequest=lt={}));var Fe;(function(Ae){Ae.method="textDocument/formatting",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(Fe||(t.DocumentFormattingRequest=Fe={}));var wt;(function(Ae){Ae.method="textDocument/rangeFormatting",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(wt||(t.DocumentRangeFormattingRequest=wt={}));var Me;(function(Ae){Ae.method="textDocument/rangesFormatting",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(Me||(t.DocumentRangesFormattingRequest=Me={}));var Rt;(function(Ae){Ae.method="textDocument/onTypeFormatting",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(Rt||(t.DocumentOnTypeFormattingRequest=Rt={}));var Lt;(function(Ae){Ae.Identifier=1})(Lt||(t.PrepareSupportDefaultBehavior=Lt={}));var ut;(function(Ae){Ae.method="textDocument/rename",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(ut||(t.RenameRequest=ut={}));var Xt;(function(Ae){Ae.method="textDocument/prepareRename",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(Xt||(t.PrepareRenameRequest=Xt={}));var Ft;(function(Ae){Ae.method="workspace/executeCommand",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(Ft||(t.ExecuteCommandRequest=Ft={}));var gt;(function(Ae){Ae.method="workspace/applyEdit",Ae.messageDirection=e.MessageDirection.serverToClient,Ae.type=new e.ProtocolRequestType("workspace/applyEdit")})(gt||(t.ApplyWorkspaceEditRequest=gt={}))}}),pMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/connection.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var e=W3();function r(n,i,a,s){return e.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,e.createMessageConnection)(n,i,a,s)}$(r,"createProtocolConnection"),t.createProtocolConnection=r}}),gMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/api.js"(t){var e=t&&t.__createBinding||(Object.create?function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:$(function(){return s[o]},"get")}),Object.defineProperty(a,l,u)}:function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]}),r=t&&t.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,r(W3(),t),r((eF(),Hke(Dee)),t),r(Os(),t),r(fMn(),t);var n=pMn();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:$(function(){return n.createProtocolConnection},"get")});var i;(function(a){a.lspReservedErrorRangeStart=-32899,a.RequestFailed=-32803,a.ServerCancelled=-32802,a.ContentModified=-32801,a.RequestCancelled=-32800,a.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))}}),mMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/browser/main.js"(t){var e=t&&t.__createBinding||(Object.create?function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:$(function(){return s[o]},"get")}),Object.defineProperty(a,l,u)}:function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]}),r=t&&t.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var n=q6t();r(q6t(),t),r(gMn(),t);function i(a,s,o,l){return(0,n.createMessageConnection)(a,s,o,l)}$(i,"createProtocolConnection"),t.createProtocolConnection=i}}),j6t={};X2(j6t,{AbstractAstReflection:()=>KEe,AbstractCstNode:()=>P4e,AbstractLangiumParser:()=>B4e,AbstractParserErrorMessageProvider:()=>rGt,AbstractThreadedAsyncParser:()=>zzn,AstUtils:()=>ZEe,BiMap:()=>Ure,Cancellation:()=>Fa,CompositeCstNodeImpl:()=>_re,ContextCache:()=>Qre,CstNodeBuilder:()=>ZQt,CstUtils:()=>jEe,DEFAULT_TOKENIZE_OPTIONS:()=>i3e,DONE_RESULT:()=>Xu,DatatypeSymbol:()=>Rre,DefaultAstNodeDescriptionProvider:()=>MGt,DefaultAstNodeLocator:()=>PGt,DefaultAsyncParser:()=>tHt,DefaultCommentProvider:()=>eHt,DefaultConfigurationProvider:()=>NGt,DefaultDocumentBuilder:()=>BGt,DefaultDocumentValidator:()=>LGt,DefaultHydrator:()=>nHt,DefaultIndexManager:()=>$Gt,DefaultJsonSerializer:()=>EGt,DefaultLangiumDocumentFactory:()=>bGt,DefaultLangiumDocuments:()=>xGt,DefaultLangiumProfiler:()=>Hzn,DefaultLexer:()=>a3e,DefaultLexerErrorMessageProvider:()=>zGt,DefaultLinker:()=>wGt,DefaultNameProvider:()=>AGt,DefaultReferenceDescriptionProvider:()=>IGt,DefaultReferences:()=>TGt,DefaultScopeComputation:()=>SGt,DefaultScopeProvider:()=>kGt,DefaultServiceRegistry:()=>_Gt,DefaultTokenBuilder:()=>Pre,DefaultValueConverter:()=>G4e,DefaultWorkspaceLock:()=>rHt,DefaultWorkspaceManager:()=>FGt,Deferred:()=>H1,Disposable:()=>EO,DisposableCache:()=>Vre,DocumentCache:()=>OGt,DocumentState:()=>oi,DocumentValidator:()=>Cp,EMPTY_SCOPE:()=>Nzn,EMPTY_STREAM:()=>Y3,EmptyFileSystem:()=>Ac,EmptyFileSystemProvider:()=>oHt,ErrorWithLocation:()=>hte,GrammarAST:()=>Z6t,GrammarUtils:()=>__e,IndentationAwareLexer:()=>Vzn,IndentationAwareTokenBuilder:()=>sHt,JSDocDocumentationProvider:()=>JGt,LangiumCompletionParser:()=>nGt,LangiumParser:()=>tGt,LangiumParserErrorMessageProvider:()=>$4e,LeafCstNodeImpl:()=>Ere,LexingMode:()=>_O,MapScope:()=>Pzn,Module:()=>g3e,MultiMap:()=>W1,MultiMapScope:()=>CGt,OperationCancelled:()=>J0,ParserWorker:()=>Uzn,ProfilingTask:()=>cHt,Reduction:()=>nF,RefResolving:()=>OO,RegExpUtils:()=>D_e,RootCstNodeImpl:()=>N4e,SimpleCache:()=>Z4e,StreamImpl:()=>Q0,StreamScope:()=>K4e,TextDocument:()=>Fre,TreeStreamImpl:()=>q3,URI:()=>cf,UriTrie:()=>j4e,UriUtils:()=>nh,VALIDATE_EACH_NODE:()=>DGt,ValidationCategory:()=>Gre,ValidationRegistry:()=>RGt,ValueConverter:()=>Z0,WorkspaceCache:()=>J4e,assertCondition:()=>R_e,assertUnreachable:()=>nw,createCompletionParser:()=>U4e,createDefaultCoreModule:()=>zl,createDefaultSharedCoreModule:()=>Ul,createGrammarConfig:()=>X_e,createLangiumParser:()=>V4e,createParser:()=>Lre,delayNextTick:()=>Nre,diagnosticData:()=>kO,eagerLoad:()=>m3e,getDiagnosticRange:()=>r3e,indentationBuilderDefaultOptions:()=>b3e,inject:()=>_i,interruptAndCheck:()=>Fl,isAstNode:()=>zo,isAstNodeDescription:()=>XEe,isAstNodeWithComment:()=>e3e,isCompositeCstNode:()=>R1,isIMultiModeLexerDefinition:()=>qre,isJSDoc:()=>o3e,isLeafCstNode:()=>FC,isLinkingError:()=>$C,isMultiReference:()=>V0,isNamed:()=>X4e,isOperationCancelled:()=>CO,isReference:()=>ju,isRootCstNode:()=>zee,isTokenTypeArray:()=>Yre,isTokenTypeDictionary:()=>jre,loadGrammarFromJson:()=>Vl,parseJSDoc:()=>s3e,prepareLangiumParser:()=>Q4e,setInterruptionPeriod:()=>H4e,startCancelableOperation:()=>$re,stream:()=>sa,toDiagnosticData:()=>n3e,toDiagnosticSeverity:()=>az});var jEe={};X2(jEe,{DefaultNameRegexp:()=>T_e,RangeComparison:()=>H0,compareRange:()=>w_e,findCommentNode:()=>S_e,findDeclarationNodeAtOffset:()=>vNt,findLeafNodeAtOffset:()=>ute,findLeafNodeBeforeOffset:()=>C_e,flattenCst:()=>mNt,getDatatypeNode:()=>gNt,getInteriorNodes:()=>xNt,getNextNode:()=>yNt,getPreviousNode:()=>k_e,getStartlineNode:()=>bNt,inRange:()=>A_e,isChildNode:()=>x_e,isCommentNode:()=>cte,streamCst:()=>sR,toDocumentSegment:()=>oR,tokenToRange:()=>pF});function zo(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}$(zo,"isAstNode");function ju(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}$(ju,"isReference");function V0(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}$(V0,"isMultiReference");function XEe(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}$(XEe,"isAstNodeDescription");function $C(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}$($C,"isLinkingError");var KEe=(RD=class{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){var i;const r=this.types[e.container.$type];if(!r)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const n=(i=r.properties[e.property])==null?void 0:i.referenceType;if(!n)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return n}getTypeMetaData(e){const r=this.types[e];return r||{name:e,properties:{},superTypes:[]}}isInstance(e,r){return zo(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const i=n[r];if(i!==void 0)return i;{const a=this.types[e],s=a?a.superTypes.some(o=>this.isSubtype(o,r)):!1;return n[r]=s,s}}getAllSubTypes(e){const r=this.allSubtypes[e];if(r)return r;{const n=this.getAllTypes(),i=[];for(const a of n)this.isSubtype(a,e)&&i.push(a);return this.allSubtypes[e]=i,i}}},$(RD,"AbstractAstReflection"),RD);function R1(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}$(R1,"isCompositeCstNode");function FC(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}$(FC,"isLeafCstNode");function zee(t){return R1(t)&&typeof t.fullText=="string"}$(zee,"isRootCstNode");var Q0=(rd=class{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){const e={state:this.startFn(),next:$(()=>this.nextFn(e.state),"next"),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){const e=[],r=this.iterator();let n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){const n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){return new rd(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return Xu})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=X6t(i.value)),a=!0;while(!i.done);return n}indexOf(e,r=0){const n=this.iterator();let i=0,a=n.next();for(;!a.done;){if(i>=r&&a.value===e)return i;a=n.next(),i++}return-1}every(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new rd(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?Xu:{done:!1,value:e(i)}})}filter(e){return new rd(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return Xu})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){const n=this.iterator();let i=r,a=n.next();for(;!a.done;)i===void 0?i=a.value:i=e(i,a.value),a=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){const i=e.next();if(i.done)return n;const a=this.recursiveReduce(e,r,n);return a===void 0?i.value:r(a,i.value)}find(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new rd(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:n,value:i}=this.nextFn(r.this);if(!n){const a=e(i);if(rF(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return Xu})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new rd(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:i,value:a}=r.nextFn(n.this);if(!i)if(rF(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return Xu})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new rd(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?Xu:this.nextFn(r.state)))}distinct(e){return new rd(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){const i=e?e(n.value):n.value;if(!r.set.has(i))return r.set.add(i),n}while(!n.done);return Xu})}exclude(e,r){const n=new Set;for(const i of e){const a=r?r(i):i;n.add(a)}return this.filter(i=>{const a=r?r(i):i;return!n.has(a)})}},$(rd,"StreamImpl"),rd);function X6t(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}$(X6t,"toString");function rF(t){return!!t&&typeof t[Symbol.iterator]=="function"}$(rF,"isIterable");var Y3=new Q0(()=>{},()=>Xu),Xu=Object.freeze({done:!0,value:void 0});function sa(...t){if(t.length===1){const e=t[0];if(e instanceof Q0)return e;if(rF(e))return new Q0(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new Q0(()=>({index:0}),r=>r.index1?new Q0(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex({iterators:n!=null&&n.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const s=i.iterators[i.iterators.length-1].next();if(s.done)i.iterators.pop();else return i.iterators.push(r(s.value)[Symbol.iterator]()),s}return Xu})}iterator(){const e={state:this.startFn(),next:$(()=>this.nextFn(e.state),"next"),prune:$(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},$(DD,"TreeStreamImpl"),DD),nF;(function(t){function e(a){return a.reduce((s,o)=>s+o,0)}$(e,"sum"),t.sum=e;function r(a){return a.reduce((s,o)=>s*o,0)}$(r,"product"),t.product=r;function n(a){return a.reduce((s,o)=>Math.min(s,o))}$(n,"min"),t.min=n;function i(a){return a.reduce((s,o)=>Math.max(s,o))}$(i,"max"),t.max=i})(nF||(nF={}));var ZEe={};X2(ZEe,{assignMandatoryProperties:()=>JEe,copyAstNode:()=>Qee,findRootNode:()=>X3,getContainerOfType:()=>zC,getDocument:()=>Cg,getReferenceNodes:()=>Uee,hasContainerOfType:()=>K6t,linkContentToContainer:()=>j3,streamAllContents:()=>D1,streamAst:()=>Og,streamContents:()=>iF,streamReferences:()=>K3});function j3(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{zo(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&j3(i,e))}):zo(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&j3(n,e)))}$(j3,"linkContentToContainer");function zC(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}$(zC,"getContainerOfType");function K6t(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}$(K6t,"hasContainerOfType");function Cg(t){const r=X3(t).$document;if(!r)throw new Error("AST node has no document.");return r}$(Cg,"getDocument");function X3(t){for(;t.$container;)t=t.$container;return t}$(X3,"findRootNode");function Uee(t){return ju(t)?t.ref?[t.ref]:[]:V0(t)?t.items.map(e=>e.ref):[]}$(Uee,"getReferenceNodes");function iF(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new Q0(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndexiF(r,e))}$(D1,"streamAllContents");function Og(t,e){if(t){if(e!=null&&e.range&&!Vee(t,e.range))return new q3(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new q3(t,r=>iF(r,e),{includeRoot:!0})}$(Og,"streamAst");function Vee(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?A_e(r,e):!1}$(Vee,"isAstNodeInRange");function K3(t){return new Q0(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndexWh,AbstractParserRule:()=>aF,AbstractRule:()=>Z3,AbstractType:()=>rf,Action:()=>K2,Alternatives:()=>sF,ArrayLiteral:()=>Wee,ArrayType:()=>Yee,Assignment:()=>J2,BooleanLiteral:()=>qee,CharacterRange:()=>ew,Condition:()=>tw,Conjunction:()=>oF,CrossReference:()=>rw,Disjunction:()=>lF,EndOfFile:()=>jee,Grammar:()=>M1,GrammarImport:()=>Xee,Group:()=>QC,InferredType:()=>Kee,InfixRule:()=>G0,InfixRuleOperatorList:()=>uF,InfixRuleOperators:()=>Zee,Interface:()=>eR,Keyword:()=>tR,LangiumGrammarAstReflection:()=>b_e,LangiumGrammarTerminals:()=>vMn,NamedArgument:()=>rR,NegatedToken:()=>HC,Negation:()=>Jee,NumberLiteral:()=>ete,Parameter:()=>nR,ParameterReference:()=>tte,ParserRule:()=>kg,ReferenceType:()=>hF,RegexToken:()=>WC,ReturnType:()=>rte,RuleCall:()=>YC,SimpleType:()=>iR,StringLiteral:()=>ite,TerminalAlternatives:()=>qC,TerminalElement:()=>Yh,TerminalGroup:()=>jC,TerminalRule:()=>N1,TerminalRuleCall:()=>XC,Type:()=>dF,TypeAttribute:()=>KC,TypeDefinition:()=>ZC,UnionType:()=>ote,UnorderedGroup:()=>fF,UntilToken:()=>JC,ValueLiteral:()=>eO,Wildcard:()=>aR,isAbstractElement:()=>Gee,isAbstractParserRule:()=>UC,isAbstractRule:()=>J6t,isAbstractType:()=>eNt,isAction:()=>Z2,isAlternatives:()=>Hee,isArrayLiteral:()=>tNt,isArrayType:()=>t_e,isAssignment:()=>L1,isBooleanLiteral:()=>r_e,isCharacterRange:()=>n_e,isCondition:()=>rNt,isConjunction:()=>i_e,isCrossReference:()=>VC,isDisjunction:()=>a_e,isEndOfFile:()=>s_e,isGrammar:()=>nNt,isGrammarImport:()=>iNt,isGroup:()=>GC,isInferredType:()=>cF,isInfixRule:()=>J3,isInfixRuleOperatorList:()=>aNt,isInfixRuleOperators:()=>sNt,isInterface:()=>o_e,isKeyword:()=>I1,isNamedArgument:()=>oNt,isNegatedToken:()=>l_e,isNegation:()=>c_e,isNumberLiteral:()=>lNt,isParameter:()=>cNt,isParameterReference:()=>u_e,isParserRule:()=>Ku,isReferenceType:()=>h_e,isRegexToken:()=>d_e,isReturnType:()=>f_e,isRuleCall:()=>P1,isSimpleType:()=>nte,isStringLiteral:()=>uNt,isTerminalAlternatives:()=>p_e,isTerminalElement:()=>hNt,isTerminalGroup:()=>g_e,isTerminalRule:()=>xp,isTerminalRuleCall:()=>ate,isType:()=>ste,isTypeAttribute:()=>dNt,isTypeDefinition:()=>fNt,isUnionType:()=>m_e,isUnorderedGroup:()=>lte,isUntilToken:()=>v_e,isValueLiteral:()=>pNt,isWildcard:()=>y_e,reflection:()=>on});var vMn={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},Wh={$type:"AbstractElement",cardinality:"cardinality"};function Gee(t){return on.isInstance(t,Wh.$type)}$(Gee,"isAbstractElement");var aF={$type:"AbstractParserRule"};function UC(t){return on.isInstance(t,aF.$type)}$(UC,"isAbstractParserRule");var Z3={$type:"AbstractRule"};function J6t(t){return on.isInstance(t,Z3.$type)}$(J6t,"isAbstractRule");var rf={$type:"AbstractType"};function eNt(t){return on.isInstance(t,rf.$type)}$(eNt,"isAbstractType");var K2={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Z2(t){return on.isInstance(t,K2.$type)}$(Z2,"isAction");var sF={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Hee(t){return on.isInstance(t,sF.$type)}$(Hee,"isAlternatives");var Wee={$type:"ArrayLiteral",elements:"elements"};function tNt(t){return on.isInstance(t,Wee.$type)}$(tNt,"isArrayLiteral");var Yee={$type:"ArrayType",elementType:"elementType"};function t_e(t){return on.isInstance(t,Yee.$type)}$(t_e,"isArrayType");var J2={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function L1(t){return on.isInstance(t,J2.$type)}$(L1,"isAssignment");var qee={$type:"BooleanLiteral",true:"true"};function r_e(t){return on.isInstance(t,qee.$type)}$(r_e,"isBooleanLiteral");var ew={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function n_e(t){return on.isInstance(t,ew.$type)}$(n_e,"isCharacterRange");var tw={$type:"Condition"};function rNt(t){return on.isInstance(t,tw.$type)}$(rNt,"isCondition");var oF={$type:"Conjunction",left:"left",right:"right"};function i_e(t){return on.isInstance(t,oF.$type)}$(i_e,"isConjunction");var rw={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function VC(t){return on.isInstance(t,rw.$type)}$(VC,"isCrossReference");var lF={$type:"Disjunction",left:"left",right:"right"};function a_e(t){return on.isInstance(t,lF.$type)}$(a_e,"isDisjunction");var jee={$type:"EndOfFile",cardinality:"cardinality"};function s_e(t){return on.isInstance(t,jee.$type)}$(s_e,"isEndOfFile");var M1={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function nNt(t){return on.isInstance(t,M1.$type)}$(nNt,"isGrammar");var Xee={$type:"GrammarImport",path:"path"};function iNt(t){return on.isInstance(t,Xee.$type)}$(iNt,"isGrammarImport");var QC={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function GC(t){return on.isInstance(t,QC.$type)}$(GC,"isGroup");var Kee={$type:"InferredType",name:"name"};function cF(t){return on.isInstance(t,Kee.$type)}$(cF,"isInferredType");var G0={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function J3(t){return on.isInstance(t,G0.$type)}$(J3,"isInfixRule");var uF={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function aNt(t){return on.isInstance(t,uF.$type)}$(aNt,"isInfixRuleOperatorList");var Zee={$type:"InfixRuleOperators",precedences:"precedences"};function sNt(t){return on.isInstance(t,Zee.$type)}$(sNt,"isInfixRuleOperators");var eR={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function o_e(t){return on.isInstance(t,eR.$type)}$(o_e,"isInterface");var tR={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function I1(t){return on.isInstance(t,tR.$type)}$(I1,"isKeyword");var rR={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function oNt(t){return on.isInstance(t,rR.$type)}$(oNt,"isNamedArgument");var HC={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function l_e(t){return on.isInstance(t,HC.$type)}$(l_e,"isNegatedToken");var Jee={$type:"Negation",value:"value"};function c_e(t){return on.isInstance(t,Jee.$type)}$(c_e,"isNegation");var ete={$type:"NumberLiteral",value:"value"};function lNt(t){return on.isInstance(t,ete.$type)}$(lNt,"isNumberLiteral");var nR={$type:"Parameter",name:"name"};function cNt(t){return on.isInstance(t,nR.$type)}$(cNt,"isParameter");var tte={$type:"ParameterReference",parameter:"parameter"};function u_e(t){return on.isInstance(t,tte.$type)}$(u_e,"isParameterReference");var kg={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function Ku(t){return on.isInstance(t,kg.$type)}$(Ku,"isParserRule");var hF={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function h_e(t){return on.isInstance(t,hF.$type)}$(h_e,"isReferenceType");var WC={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function d_e(t){return on.isInstance(t,WC.$type)}$(d_e,"isRegexToken");var rte={$type:"ReturnType",name:"name"};function f_e(t){return on.isInstance(t,rte.$type)}$(f_e,"isReturnType");var YC={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function P1(t){return on.isInstance(t,YC.$type)}$(P1,"isRuleCall");var iR={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function nte(t){return on.isInstance(t,iR.$type)}$(nte,"isSimpleType");var ite={$type:"StringLiteral",value:"value"};function uNt(t){return on.isInstance(t,ite.$type)}$(uNt,"isStringLiteral");var qC={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function p_e(t){return on.isInstance(t,qC.$type)}$(p_e,"isTerminalAlternatives");var Yh={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function hNt(t){return on.isInstance(t,Yh.$type)}$(hNt,"isTerminalElement");var jC={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function g_e(t){return on.isInstance(t,jC.$type)}$(g_e,"isTerminalGroup");var N1={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function xp(t){return on.isInstance(t,N1.$type)}$(xp,"isTerminalRule");var XC={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function ate(t){return on.isInstance(t,XC.$type)}$(ate,"isTerminalRuleCall");var dF={$type:"Type",name:"name",type:"type"};function ste(t){return on.isInstance(t,dF.$type)}$(ste,"isType");var KC={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function dNt(t){return on.isInstance(t,KC.$type)}$(dNt,"isTypeAttribute");var ZC={$type:"TypeDefinition"};function fNt(t){return on.isInstance(t,ZC.$type)}$(fNt,"isTypeDefinition");var ote={$type:"UnionType",types:"types"};function m_e(t){return on.isInstance(t,ote.$type)}$(m_e,"isUnionType");var fF={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function lte(t){return on.isInstance(t,fF.$type)}$(lte,"isUnorderedGroup");var JC={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function v_e(t){return on.isInstance(t,JC.$type)}$(v_e,"isUntilToken");var eO={$type:"ValueLiteral"};function pNt(t){return on.isInstance(t,eO.$type)}$(pNt,"isValueLiteral");var aR={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function y_e(t){return on.isInstance(t,aR.$type)}$(y_e,"isWildcard");var b_e=(LD=class extends KEe{constructor(){super(...arguments),this.types={AbstractElement:{name:Wh.$type,properties:{cardinality:{name:Wh.cardinality}},superTypes:[]},AbstractParserRule:{name:aF.$type,properties:{},superTypes:[Z3.$type,rf.$type]},AbstractRule:{name:Z3.$type,properties:{},superTypes:[]},AbstractType:{name:rf.$type,properties:{},superTypes:[]},Action:{name:K2.$type,properties:{cardinality:{name:K2.cardinality},feature:{name:K2.feature},inferredType:{name:K2.inferredType},operator:{name:K2.operator},type:{name:K2.type,referenceType:rf.$type}},superTypes:[Wh.$type]},Alternatives:{name:sF.$type,properties:{cardinality:{name:sF.cardinality},elements:{name:sF.elements,defaultValue:[]}},superTypes:[Wh.$type]},ArrayLiteral:{name:Wee.$type,properties:{elements:{name:Wee.elements,defaultValue:[]}},superTypes:[eO.$type]},ArrayType:{name:Yee.$type,properties:{elementType:{name:Yee.elementType}},superTypes:[ZC.$type]},Assignment:{name:J2.$type,properties:{cardinality:{name:J2.cardinality},feature:{name:J2.feature},operator:{name:J2.operator},predicate:{name:J2.predicate},terminal:{name:J2.terminal}},superTypes:[Wh.$type]},BooleanLiteral:{name:qee.$type,properties:{true:{name:qee.true,defaultValue:!1}},superTypes:[tw.$type,eO.$type]},CharacterRange:{name:ew.$type,properties:{cardinality:{name:ew.cardinality},left:{name:ew.left},lookahead:{name:ew.lookahead},parenthesized:{name:ew.parenthesized,defaultValue:!1},right:{name:ew.right}},superTypes:[Yh.$type]},Condition:{name:tw.$type,properties:{},superTypes:[]},Conjunction:{name:oF.$type,properties:{left:{name:oF.left},right:{name:oF.right}},superTypes:[tw.$type]},CrossReference:{name:rw.$type,properties:{cardinality:{name:rw.cardinality},deprecatedSyntax:{name:rw.deprecatedSyntax,defaultValue:!1},isMulti:{name:rw.isMulti,defaultValue:!1},terminal:{name:rw.terminal},type:{name:rw.type,referenceType:rf.$type}},superTypes:[Wh.$type]},Disjunction:{name:lF.$type,properties:{left:{name:lF.left},right:{name:lF.right}},superTypes:[tw.$type]},EndOfFile:{name:jee.$type,properties:{cardinality:{name:jee.cardinality}},superTypes:[Wh.$type]},Grammar:{name:M1.$type,properties:{imports:{name:M1.imports,defaultValue:[]},interfaces:{name:M1.interfaces,defaultValue:[]},isDeclared:{name:M1.isDeclared,defaultValue:!1},name:{name:M1.name},rules:{name:M1.rules,defaultValue:[]},types:{name:M1.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:Xee.$type,properties:{path:{name:Xee.path}},superTypes:[]},Group:{name:QC.$type,properties:{cardinality:{name:QC.cardinality},elements:{name:QC.elements,defaultValue:[]},guardCondition:{name:QC.guardCondition},predicate:{name:QC.predicate}},superTypes:[Wh.$type]},InferredType:{name:Kee.$type,properties:{name:{name:Kee.name}},superTypes:[rf.$type]},InfixRule:{name:G0.$type,properties:{call:{name:G0.call},dataType:{name:G0.dataType},inferredType:{name:G0.inferredType},name:{name:G0.name},operators:{name:G0.operators},parameters:{name:G0.parameters,defaultValue:[]},returnType:{name:G0.returnType,referenceType:rf.$type}},superTypes:[aF.$type]},InfixRuleOperatorList:{name:uF.$type,properties:{associativity:{name:uF.associativity},operators:{name:uF.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:Zee.$type,properties:{precedences:{name:Zee.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:eR.$type,properties:{attributes:{name:eR.attributes,defaultValue:[]},name:{name:eR.name},superTypes:{name:eR.superTypes,defaultValue:[],referenceType:rf.$type}},superTypes:[rf.$type]},Keyword:{name:tR.$type,properties:{cardinality:{name:tR.cardinality},predicate:{name:tR.predicate},value:{name:tR.value}},superTypes:[Wh.$type]},NamedArgument:{name:rR.$type,properties:{calledByName:{name:rR.calledByName,defaultValue:!1},parameter:{name:rR.parameter,referenceType:nR.$type},value:{name:rR.value}},superTypes:[]},NegatedToken:{name:HC.$type,properties:{cardinality:{name:HC.cardinality},lookahead:{name:HC.lookahead},parenthesized:{name:HC.parenthesized,defaultValue:!1},terminal:{name:HC.terminal}},superTypes:[Yh.$type]},Negation:{name:Jee.$type,properties:{value:{name:Jee.value}},superTypes:[tw.$type]},NumberLiteral:{name:ete.$type,properties:{value:{name:ete.value}},superTypes:[eO.$type]},Parameter:{name:nR.$type,properties:{name:{name:nR.name}},superTypes:[]},ParameterReference:{name:tte.$type,properties:{parameter:{name:tte.parameter,referenceType:nR.$type}},superTypes:[tw.$type]},ParserRule:{name:kg.$type,properties:{dataType:{name:kg.dataType},definition:{name:kg.definition},entry:{name:kg.entry,defaultValue:!1},fragment:{name:kg.fragment,defaultValue:!1},inferredType:{name:kg.inferredType},name:{name:kg.name},parameters:{name:kg.parameters,defaultValue:[]},returnType:{name:kg.returnType,referenceType:rf.$type}},superTypes:[aF.$type]},ReferenceType:{name:hF.$type,properties:{isMulti:{name:hF.isMulti,defaultValue:!1},referenceType:{name:hF.referenceType}},superTypes:[ZC.$type]},RegexToken:{name:WC.$type,properties:{cardinality:{name:WC.cardinality},lookahead:{name:WC.lookahead},parenthesized:{name:WC.parenthesized,defaultValue:!1},regex:{name:WC.regex}},superTypes:[Yh.$type]},ReturnType:{name:rte.$type,properties:{name:{name:rte.name}},superTypes:[]},RuleCall:{name:YC.$type,properties:{arguments:{name:YC.arguments,defaultValue:[]},cardinality:{name:YC.cardinality},predicate:{name:YC.predicate},rule:{name:YC.rule,referenceType:Z3.$type}},superTypes:[Wh.$type]},SimpleType:{name:iR.$type,properties:{primitiveType:{name:iR.primitiveType},stringType:{name:iR.stringType},typeRef:{name:iR.typeRef,referenceType:rf.$type}},superTypes:[ZC.$type]},StringLiteral:{name:ite.$type,properties:{value:{name:ite.value}},superTypes:[eO.$type]},TerminalAlternatives:{name:qC.$type,properties:{cardinality:{name:qC.cardinality},elements:{name:qC.elements,defaultValue:[]},lookahead:{name:qC.lookahead},parenthesized:{name:qC.parenthesized,defaultValue:!1}},superTypes:[Yh.$type]},TerminalElement:{name:Yh.$type,properties:{cardinality:{name:Yh.cardinality},lookahead:{name:Yh.lookahead},parenthesized:{name:Yh.parenthesized,defaultValue:!1}},superTypes:[Wh.$type]},TerminalGroup:{name:jC.$type,properties:{cardinality:{name:jC.cardinality},elements:{name:jC.elements,defaultValue:[]},lookahead:{name:jC.lookahead},parenthesized:{name:jC.parenthesized,defaultValue:!1}},superTypes:[Yh.$type]},TerminalRule:{name:N1.$type,properties:{definition:{name:N1.definition},fragment:{name:N1.fragment,defaultValue:!1},hidden:{name:N1.hidden,defaultValue:!1},name:{name:N1.name},type:{name:N1.type}},superTypes:[Z3.$type]},TerminalRuleCall:{name:XC.$type,properties:{cardinality:{name:XC.cardinality},lookahead:{name:XC.lookahead},parenthesized:{name:XC.parenthesized,defaultValue:!1},rule:{name:XC.rule,referenceType:N1.$type}},superTypes:[Yh.$type]},Type:{name:dF.$type,properties:{name:{name:dF.name},type:{name:dF.type}},superTypes:[rf.$type]},TypeAttribute:{name:KC.$type,properties:{defaultValue:{name:KC.defaultValue},isOptional:{name:KC.isOptional,defaultValue:!1},name:{name:KC.name},type:{name:KC.type}},superTypes:[]},TypeDefinition:{name:ZC.$type,properties:{},superTypes:[]},UnionType:{name:ote.$type,properties:{types:{name:ote.types,defaultValue:[]}},superTypes:[ZC.$type]},UnorderedGroup:{name:fF.$type,properties:{cardinality:{name:fF.cardinality},elements:{name:fF.elements,defaultValue:[]}},superTypes:[Wh.$type]},UntilToken:{name:JC.$type,properties:{cardinality:{name:JC.cardinality},lookahead:{name:JC.lookahead},parenthesized:{name:JC.parenthesized,defaultValue:!1},terminal:{name:JC.terminal}},superTypes:[Yh.$type]},ValueLiteral:{name:eO.$type,properties:{},superTypes:[]},Wildcard:{name:aR.$type,properties:{cardinality:{name:aR.cardinality},lookahead:{name:aR.lookahead},parenthesized:{name:aR.parenthesized,defaultValue:!1}},superTypes:[Yh.$type]}}}},$(LD,"LangiumGrammarAstReflection"),LD),on=new b_e;function gNt(t){let e=t,r=!1;for(;e;){const n=zC(e.grammarSource,Ku);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}$(gNt,"getDatatypeNode");function sR(t){return new q3(t,e=>R1(e)?e.content:[],{includeRoot:!0})}$(sR,"streamCst");function mNt(t){return sR(t).filter(FC)}$(mNt,"flattenCst");function x_e(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}$(x_e,"isChildNode");function pF(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}$(pF,"tokenToRange");function oR(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}$(oR,"toDocumentSegment");var H0;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})(H0||(H0={}));function w_e(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return H0.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.lineH0.After}$(A_e,"inRange");var T_e=/^[\w\p{L}]$/u;function vNt(t,e,r=T_e){if(t){if(e>0){const n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return ute(t,e)}}$(vNt,"findDeclarationNodeAtOffset");function S_e(t,e){if(t){const r=k_e(t,!0);if(r&&cte(r,e))return r;if(zee(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(cte(a,e))return a}}}}$(S_e,"findCommentNode");function cte(t,e){return FC(t)&&e.includes(t.tokenType.name)}$(cte,"isCommentNode");function ute(t,e){if(FC(t))return t;if(R1(t)){const r=O_e(t,e,!1);if(r)return ute(r,e)}}$(ute,"findLeafNodeAtOffset");function C_e(t,e){if(FC(t))return t;if(R1(t)){const r=O_e(t,e,!0);if(r)return C_e(r,e)}}$(C_e,"findLeafNodeBeforeOffset");function O_e(t,e,r){let n=0,i=t.content.length-1,a;for(;n<=i;){const s=Math.floor((n+i)/2),o=t.content[s];if(o.offset<=e&&o.end>e)return o;o.end<=e?(a=r?o:void 0,n=s+1):i=s-1}return a}$(O_e,"binarySearch");function k_e(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);for(;n>0;){n--;const i=r.content[n];if(e||!i.hidden)return i}t=r}}$(k_e,"getPreviousNode");function yNt(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const i=r.content.length-1;for(;nQ_e,findNameAssignment:()=>Ate,findNodeForKeyword:()=>V_e,findNodeForProperty:()=>bte,findNodesForKeyword:()=>RNt,findNodesForKeywordInternal:()=>wte,findNodesForProperty:()=>U_e,getActionAtElement:()=>H_e,getActionType:()=>Y_e,getAllReachableRules:()=>yte,getAllRulesUsedForCrossReferences:()=>_Nt,getCrossReferenceTerminal:()=>F_e,getEntryRule:()=>N_e,getExplicitRuleType:()=>mF,getHiddenRules:()=>B_e,getRuleType:()=>q_e,getRuleTypeName:()=>PNt,getTypeName:()=>nO,isArrayCardinality:()=>LNt,isArrayOperator:()=>MNt,isCommentTerminal:()=>z_e,isDataType:()=>INt,isDataTypeRule:()=>gF,isOptionalCardinality:()=>DNt,terminalRegex:()=>vF});var hte=(MD=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}},$(MD,"ErrorWithLocation"),MD);function nw(t,e="Error: Got unexpected value."){throw new Error(e)}$(nw,"assertUnreachable");function R_e(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}$(R_e,"assertCondition");var D_e={};X2(D_e,{NEWLINE_REGEXP:()=>CNt,escapeRegExp:()=>cR,getTerminalParts:()=>kNt,isMultilineComment:()=>M_e,isWhitespace:()=>vte,partialMatches:()=>I_e,partialRegExp:()=>P_e,whitespaceCharacters:()=>ENt});function wn(t){return t.charCodeAt(0)}$(wn,"cc");function dte(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}$(dte,"insertToSet");function lR(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}$(lR,"addFlag");function tO(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}$(tO,"ASSERT_EXISTS");function ANt(){throw Error("Internal Error - Should never get here!")}$(ANt,"ASSERT_NEVER_REACH_HERE");function L_e(t){return t.type==="Character"}$(L_e,"isCharacter");var fte=[];for(let t=wn("0");t<=wn("9");t++)fte.push(t);var pte=[wn("_")].concat(fte);for(let t=wn("a");t<=wn("z");t++)pte.push(t);for(let t=wn("A");t<=wn("Z");t++)pte.push(t);var TNt=[wn(" "),wn("\f"),wn(` -`),wn("\r"),wn(" "),wn("\v"),wn(" "),wn(" "),wn(" "),wn(" "),wn(" "),wn(" "),wn(" "),wn(" "),wn(" "),wn(" "),wn(" "),wn(" "),wn(" "),wn(" "),wn("\u2028"),wn("\u2029"),wn(" "),wn(" "),wn(" "),wn("\uFEFF")],yMn=/[0-9a-fA-F]/,gte=/[0-9]/,bMn=/[1-9]/,SNt=(ID=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const r=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":lR(n,"global");break;case"i":lR(n,"ignoreCase");break;case"m":lR(n,"multiLine");break;case"u":lR(n,"unicode");break;case"y":lR(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){const e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){const e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":r="Lookbehind";break;case"!":r="NegativeLookbehind"}break}}tO(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return ANt()}quantifier(e=!1){let r;const n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),r={atLeast:i,atMost:a}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;tO(r);break}if(!(e===!0&&r===void 0)&&tO(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e;const r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),tO(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[wn(` -`),wn("\r"),wn("\u2028"),wn("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=fte;break;case"D":e=fte,r=!0;break;case"s":e=TNt;break;case"S":e=TNt,r=!0;break;case"w":e=pte;break;case"W":e=pte,r=!0;break}if(tO(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=wn("\f");break;case"n":e=wn(` +`)),at){const Ct=Re.error?` Request failed: ${Re.error.message} (${Re.error.code}).`:"";Oe.log(`Received response '${at.method} - (${Re.id})' in ${Date.now()-at.timerStart}ms.${Ct}`,xt)}else Oe.log(`Received response ${Re.id} without active response promise.`,xt)}else ut("receive-response",Re)}$(Lt,"traceReceivedResponse");function ut(Re,at){if(!Oe||ae===f.Off)return;const xt={isLSPMessage:!0,type:Re,message:at,timestamp:Date.now()};Oe.log(xt)}$(ut,"logLSPMessage");function Xt(){if(j())throw new b(y.Closed,"Connection is closed.");if(ie())throw new b(y.Disposed,"Connection is disposed.")}$(Xt,"throwIfClosedOrDisposed");function Ft(){if(ne())throw new b(y.AlreadyListening,"Connection is already listening")}$(Ft,"throwIfListening");function gt(){if(!ne())throw new Error("Call listen() first.")}$(gt,"throwIfNotListening");function Ae(Re){return Re===void 0?null:Re}$(Ae,"undefinedToNull");function zt(Re){if(Re!==null)return Re}$(zt,"nullToUndefined");function kt(Re){return Re!=null&&!Array.isArray(Re)&&typeof Re=="object"}$(kt,"isNamedParam");function At(Re,at){switch(Re){case n.ParameterStructures.auto:return kt(at)?zt(at):[Ae(at)];case n.ParameterStructures.byName:if(!kt(at))throw new Error("Received parameters by name but param is not an object literal.");return zt(at);case n.ParameterStructures.byPosition:return[Ae(at)];default:throw new Error(`Unknown parameter structure ${Re.toString()}`)}}$(At,"computeSingleParam");function Mt(Re,at){let xt;const Ct=Re.numberOfParams;switch(Ct){case 0:xt=void 0;break;case 1:xt=At(Re.parameterStructures,at[0]);break;default:xt=[];for(let gr=0;gr{Xt();let xt,Ct;if(r.string(Re)){xt=Re;const Xr=at[0];let $r=0,un=n.ParameterStructures.auto;n.ParameterStructures.is(Xr)&&($r=1,un=Xr);let zr=at.length;const On=zr-$r;switch(On){case 0:Ct=void 0;break;case 1:Ct=At(un,at[$r]);break;default:if(un===n.ParameterStructures.byName)throw new Error(`Received ${On} parameters for 'by Name' notification parameter structure.`);Ct=at.slice($r,zr).map(Nr=>Ae(Nr));break}}else{const Xr=at;xt=Re.method,Ct=Mt(Re,Xr)}const gr={jsonrpc:U,method:xt,params:Ct};return Fe(gr),M.write(gr).catch(Xr=>{throw F.error("Sending notification failed."),Xr})},"sendNotification"),onNotification:$((Re,at)=>{Xt();let xt;return r.func(Re)?X=Re:at&&(r.string(Re)?(xt=Re,Y.set(Re,{type:void 0,handler:at})):(xt=Re.method,Y.set(Re.method,{type:Re,handler:at}))),{dispose:$(()=>{xt!==void 0?Y.delete(xt):X=void 0},"dispose")}},"onNotification"),onProgress:$((Re,at,xt)=>{if(le.has(at))throw new Error(`Progress handler for token ${at} already registered`);return le.set(at,xt),{dispose:$(()=>{le.delete(at)},"dispose")}},"onProgress"),sendProgress:$((Re,at,xt)=>jr.sendNotification(u.type,{token:at,value:xt}),"sendProgress"),onUnhandledProgress:ge.event,sendRequest:$((Re,...at)=>{Xt(),gt();let xt,Ct,gr;if(r.string(Re)){xt=Re;const zr=at[0],On=at[at.length-1];let Nr=0,hn=n.ParameterStructures.auto;n.ParameterStructures.is(zr)&&(Nr=1,hn=zr);let ti=at.length;s.CancellationToken.is(On)&&(ti=ti-1,gr=On);const pt=ti-Nr;switch(pt){case 0:Ct=void 0;break;case 1:Ct=At(hn,at[Nr]);break;default:if(hn===n.ParameterStructures.byName)throw new Error(`Received ${pt} parameters for 'by Name' request parameter structure.`);Ct=at.slice(Nr,ti).map(St=>Ae(St));break}}else{const zr=at;xt=Re.method,Ct=Mt(Re,zr);const On=Re.numberOfParams;gr=s.CancellationToken.is(zr[On])?zr[On]:void 0}const Xr=B++;let $r;gr&&($r=gr.onCancellationRequested(()=>{const zr=Te.sender.sendCancellation(jr,Xr);return zr===void 0?(F.log(`Received no promise from cancellation strategy when cancelling id ${Xr}`),Promise.resolve()):zr.catch(()=>{F.log(`Sending cancellation messages for id ${Xr} failed`)})}));const un={jsonrpc:U,id:Xr,method:xt,params:Ct};return lt(un),typeof Te.sender.enableCancellation=="function"&&Te.sender.enableCancellation(un),new Promise(async(zr,On)=>{const Nr=$(pt=>{zr(pt),Te.sender.cleanup(Xr),$r==null||$r.dispose()},"resolveWithCleanup"),hn=$(pt=>{On(pt),Te.sender.cleanup(Xr),$r==null||$r.dispose()},"rejectWithCleanup"),ti={method:xt,timerStart:Date.now(),resolve:Nr,reject:hn};try{await M.write(un),ee.set(Xr,ti)}catch(pt){throw F.error("Sending request failed."),ti.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,pt.message?pt.message:"Unknown reason")),pt}})},"sendRequest"),onRequest:$((Re,at)=>{Xt();let xt=null;return d.is(Re)?(xt=void 0,Q=Re):r.string(Re)?(xt=null,at!==void 0&&(xt=Re,G.set(Re,{handler:at,type:void 0}))):at!==void 0&&(xt=Re.method,G.set(Re.method,{type:Re,handler:at})),{dispose:$(()=>{xt!==null&&(xt!==void 0?G.delete(xt):Q=void 0)},"dispose")}},"onRequest"),hasPendingResponse:$(()=>ee.size>0,"hasPendingResponse"),trace:$(async(Re,at,xt)=>{let Ct=!1,gr=g.Text;xt!==void 0&&(r.boolean(xt)?Ct=xt:(Ct=xt.sendNotification||!1,gr=xt.traceFormat||g.Text)),ae=Re,Ce=gr,ae===f.Off?Oe=void 0:Oe=at,Ct&&!j()&&!ie()&&await jr.sendNotification(m.type,{value:f.toString(Re)})},"trace"),onError:he.event,onClose:fe.event,onUnhandledNotification:Se.event,onDispose:Qe.event,end:$(()=>{M.end()},"end"),dispose:$(()=>{if(ie())return;$e=_.Disposed,Qe.fire(void 0);const Re=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const at of ee.values())at.reject(Re);ee=new Map,ve=new Map,re=new Set,Z=new i.LinkedMap,r.func(M.dispose)&&M.dispose(),r.func(D.dispose)&&D.dispose()},"dispose"),listen:$(()=>{Xt(),Ft(),$e=_.Listening,D.listen(Ye)},"listen"),inspect:$(()=>{(0,e.default)().console.log("inspect")},"inspect")};return jr.onNotification(v.type,Re=>{if(ae===f.Off||!Oe)return;const at=ae===f.Verbose||ae===f.Compact;Oe.log(Re.message,at?Re.verbose:void 0)}),jr.onNotification(u.type,Re=>{const at=le.get(Re.token);at?at(Re.value):ge.fire(Re)}),jr}$(I,"createMessageConnection"),t.createMessageConnection=I}}),YEe=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/api.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;var e=H6t();Object.defineProperty(t,"Message",{enumerable:!0,get:$(function(){return e.Message},"get")}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:$(function(){return e.RequestType},"get")}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:$(function(){return e.RequestType0},"get")}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:$(function(){return e.RequestType1},"get")}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:$(function(){return e.RequestType2},"get")}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:$(function(){return e.RequestType3},"get")}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:$(function(){return e.RequestType4},"get")}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:$(function(){return e.RequestType5},"get")}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:$(function(){return e.RequestType6},"get")}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:$(function(){return e.RequestType7},"get")}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:$(function(){return e.RequestType8},"get")}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:$(function(){return e.RequestType9},"get")}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:$(function(){return e.ResponseError},"get")}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:$(function(){return e.ErrorCodes},"get")}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:$(function(){return e.NotificationType},"get")}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:$(function(){return e.NotificationType0},"get")}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:$(function(){return e.NotificationType1},"get")}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:$(function(){return e.NotificationType2},"get")}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:$(function(){return e.NotificationType3},"get")}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:$(function(){return e.NotificationType4},"get")}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:$(function(){return e.NotificationType5},"get")}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:$(function(){return e.NotificationType6},"get")}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:$(function(){return e.NotificationType7},"get")}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:$(function(){return e.NotificationType8},"get")}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:$(function(){return e.NotificationType9},"get")}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:$(function(){return e.ParameterStructures},"get")});var r=W6t();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:$(function(){return r.LinkedMap},"get")}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:$(function(){return r.LRUCache},"get")}),Object.defineProperty(t,"Touch",{enumerable:!0,get:$(function(){return r.Touch},"get")});var n=FLn();Object.defineProperty(t,"Disposable",{enumerable:!0,get:$(function(){return n.Disposable},"get")});var i=H3();Object.defineProperty(t,"Event",{enumerable:!0,get:$(function(){return i.Event},"get")}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:$(function(){return i.Emitter},"get")});var a=Fee();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:$(function(){return a.CancellationTokenSource},"get")}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:$(function(){return a.CancellationToken},"get")});var s=zLn();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:$(function(){return s.SharedArraySenderStrategy},"get")}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:$(function(){return s.SharedArrayReceiverStrategy},"get")});var o=ULn();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:$(function(){return o.MessageReader},"get")}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:$(function(){return o.AbstractMessageReader},"get")}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:$(function(){return o.ReadableStreamMessageReader},"get")});var l=VLn();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:$(function(){return l.MessageWriter},"get")}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:$(function(){return l.AbstractMessageWriter},"get")}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:$(function(){return l.WriteableStreamMessageWriter},"get")});var u=QLn();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:$(function(){return u.AbstractMessageBuffer},"get")});var h=GLn();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:$(function(){return h.ConnectionStrategy},"get")}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:$(function(){return h.ConnectionOptions},"get")}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:$(function(){return h.NullLogger},"get")}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:$(function(){return h.createMessageConnection},"get")}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:$(function(){return h.ProgressToken},"get")}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:$(function(){return h.ProgressType},"get")}),Object.defineProperty(t,"Trace",{enumerable:!0,get:$(function(){return h.Trace},"get")}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:$(function(){return h.TraceValues},"get")}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:$(function(){return h.TraceFormat},"get")}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:$(function(){return h.SetTraceNotification},"get")}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:$(function(){return h.LogTraceNotification},"get")}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:$(function(){return h.ConnectionErrors},"get")}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:$(function(){return h.ConnectionError},"get")}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:$(function(){return h.CancellationReceiverStrategy},"get")}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:$(function(){return h.CancellationSenderStrategy},"get")}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:$(function(){return h.CancellationStrategy},"get")}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:$(function(){return h.MessageStrategy},"get")});var d=BC();t.RAL=d.default}}),HLn=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/ril.js"(t){var l,u,h;Object.defineProperty(t,"__esModule",{value:!0});var e=YEe(),r=(l=class extends e.AbstractMessageBuffer{constructor(f="utf-8"){super(f),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return l.emptyBuffer}fromString(f,p){return new TextEncoder().encode(f)}toString(f,p){return p==="ascii"?this.asciiDecoder.decode(f):new TextDecoder(p).decode(f)}asNative(f,p){return p===void 0?f:f.slice(0,p)}allocNative(f){return new Uint8Array(f)}},$(l,"MessageBuffer"),l);r.emptyBuffer=new Uint8Array(0);var n=(u=class{constructor(f){this.socket=f,this._onData=new e.Emitter,this._messageListener=p=>{p.data.arrayBuffer().then(m=>{this._onData.fire(new Uint8Array(m))},()=>{(0,e.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}onData(f){return this._onData.event(f)}},$(u,"ReadableStreamWrapper"),u),i=(h=class{constructor(f){this.socket=f}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}write(f,p){if(typeof f=="string"){if(p!==void 0&&p!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${p}`);this.socket.send(f)}else this.socket.send(f);return Promise.resolve()}end(){this.socket.close()}},$(h,"WritableStreamWrapper"),h),a=new TextEncoder,s=Object.freeze({messageBuffer:Object.freeze({create:$(d=>new r(d),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:$((d,f)=>{if(f.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${f.charset}`);return Promise.resolve(a.encode(JSON.stringify(d,void 0,0)))},"encode")}),decoder:Object.freeze({name:"application/json",decode:$((d,f)=>{if(!(d instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(f.charset).decode(d)))},"decode")})}),stream:Object.freeze({asReadableStream:$(d=>new n(d),"asReadableStream"),asWritableStream:$(d=>new i(d),"asWritableStream")}),console,timer:Object.freeze({setTimeout(d,f,...p){const g=setTimeout(d,f,...p);return{dispose:$(()=>clearTimeout(g),"dispose")}},setImmediate(d,...f){const p=setTimeout(d,0,...f);return{dispose:$(()=>clearTimeout(p),"dispose")}},setInterval(d,f,...p){const g=setInterval(d,f,...p);return{dispose:$(()=>clearInterval(g),"dispose")}}})});function o(){return s}$(o,"RIL"),function(d){function f(){e.RAL.install(s)}$(f,"install"),d.install=f}(o||(o={})),t.default=o}}),W3=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/main.js"(t){var l,u;var e=t&&t.__createBinding||(Object.create?function(h,d,f,p){p===void 0&&(p=f);var g=Object.getOwnPropertyDescriptor(d,f);(!g||("get"in g?!d.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:$(function(){return d[f]},"get")}),Object.defineProperty(h,p,g)}:function(h,d,f,p){p===void 0&&(p=f),h[p]=d[f]}),r=t&&t.__exportStar||function(h,d){for(var f in h)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&e(d,h,f)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0;var n=HLn();n.default.install();var i=YEe();r(YEe(),t);var a=(l=class extends i.AbstractMessageReader{constructor(d){super(),this._onData=new i.Emitter,this._messageListener=f=>{this._onData.fire(f.data)},d.addEventListener("error",f=>this.fireError(f)),d.onmessage=this._messageListener}listen(d){return this._onData.event(d)}},$(l,"BrowserMessageReader"),l);t.BrowserMessageReader=a;var s=(u=class extends i.AbstractMessageWriter{constructor(d){super(),this.port=d,this.errorCount=0,d.addEventListener("error",f=>this.fireError(f))}write(d){try{return this.port.postMessage(d),Promise.resolve()}catch(f){return this.handleError(f,d),Promise.reject(f)}}handleError(d,f){this.errorCount++,this.fireError(d,f,this.errorCount)}end(){}},$(u,"BrowserMessageWriter"),u);t.BrowserMessageWriter=s;function o(h,d,f,p){return f===void 0&&(f=i.NullLogger),i.ConnectionStrategy.is(p)&&(p={connectionStrategy:p}),(0,i.createMessageConnection)(h,d,f,p)}$(o,"createMessageConnection"),t.createMessageConnection=o}}),q6t=Nn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(t,e){e.exports=W3()}}),Os=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js"(t){var l,u,h,d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolNotificationType=t.ProtocolNotificationType0=t.ProtocolRequestType=t.ProtocolRequestType0=t.RegistrationType=t.MessageDirection=void 0;var e=W3(),r;(function(p){p.clientToServer="clientToServer",p.serverToClient="serverToClient",p.both="both"})(r||(t.MessageDirection=r={}));var n=(l=class{constructor(g){this.method=g}},$(l,"RegistrationType"),l);t.RegistrationType=n;var i=(u=class extends e.RequestType0{constructor(g){super(g)}},$(u,"ProtocolRequestType0"),u);t.ProtocolRequestType0=i;var a=(h=class extends e.RequestType{constructor(g){super(g,e.ParameterStructures.byName)}},$(h,"ProtocolRequestType"),h);t.ProtocolRequestType=a;var s=(d=class extends e.NotificationType0{constructor(g){super(g)}},$(d,"ProtocolNotificationType0"),d);t.ProtocolNotificationType0=s;var o=(f=class extends e.NotificationType{constructor(g){super(g,e.ParameterStructures.byName)}},$(f,"ProtocolNotificationType"),f);t.ProtocolNotificationType=o}}),qEe=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.objectLiteral=t.typedArray=t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(h){return h===!0||h===!1}$(e,"boolean"),t.boolean=e;function r(h){return typeof h=="string"||h instanceof String}$(r,"string"),t.string=r;function n(h){return typeof h=="number"||h instanceof Number}$(n,"number"),t.number=n;function i(h){return h instanceof Error}$(i,"error"),t.error=i;function a(h){return typeof h=="function"}$(a,"func"),t.func=a;function s(h){return Array.isArray(h)}$(s,"array"),t.array=s;function o(h){return s(h)&&h.every(d=>r(d))}$(o,"stringArray"),t.stringArray=o;function l(h,d){return Array.isArray(h)&&h.every(d)}$(l,"typedArray"),t.typedArray=l;function u(h){return h!==null&&typeof h=="object"}$(u,"objectLiteral"),t.objectLiteral=u}}),WLn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImplementationRequest=void 0;var e=Os(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ImplementationRequest=r={}))}}),YLn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeDefinitionRequest=void 0;var e=Os(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.TypeDefinitionRequest=r={}))}}),qLn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=void 0;var e=Os(),r;(function(i){i.method="workspace/workspaceFolders",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(r||(t.WorkspaceFoldersRequest=r={}));var n;(function(i){i.method="workspace/didChangeWorkspaceFolders",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolNotificationType(i.method)})(n||(t.DidChangeWorkspaceFoldersNotification=n={}))}}),jLn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationRequest=void 0;var e=Os(),r;(function(n){n.method="workspace/configuration",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ConfigurationRequest=r={}))}}),XLn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorPresentationRequest=t.DocumentColorRequest=void 0;var e=Os(),r;(function(i){i.method="textDocument/documentColor",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.DocumentColorRequest=r={}));var n;(function(i){i.method="textDocument/colorPresentation",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(n||(t.ColorPresentationRequest=n={}))}}),KLn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=void 0;var e=Os(),r;(function(i){i.method="textDocument/foldingRange",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.FoldingRangeRequest=r={}));var n;(function(i){i.method="workspace/foldingRange/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.FoldingRangeRefreshRequest=n={}))}}),ZLn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DeclarationRequest=void 0;var e=Os(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.DeclarationRequest=r={}))}}),JLn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRangeRequest=void 0;var e=Os(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.SelectionRangeRequest=r={}))}}),eMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=void 0;var e=W3(),r=Os(),n;(function(s){s.type=new e.ProgressType;function o(l){return l===s.type}$(o,"is"),s.is=o})(n||(t.WorkDoneProgress=n={}));var i;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=r.MessageDirection.serverToClient,s.type=new r.ProtocolRequestType(s.method)})(i||(t.WorkDoneProgressCreateRequest=i={}));var a;(function(s){s.method="window/workDoneProgress/cancel",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolNotificationType(s.method)})(a||(t.WorkDoneProgressCancelNotification=a={}))}}),tMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.CallHierarchyPrepareRequest=void 0;var e=Os(),r;(function(a){a.method="textDocument/prepareCallHierarchy",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.CallHierarchyPrepareRequest=r={}));var n;(function(a){a.method="callHierarchy/incomingCalls",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.CallHierarchyIncomingCallsRequest=n={}));var i;(function(a){a.method="callHierarchy/outgoingCalls",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.CallHierarchyOutgoingCallsRequest=i={}))}}),rMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.SemanticTokensRegistrationType=t.TokenFormat=void 0;var e=Os(),r;(function(l){l.Relative="relative"})(r||(t.TokenFormat=r={}));var n;(function(l){l.method="textDocument/semanticTokens",l.type=new e.RegistrationType(l.method)})(n||(t.SemanticTokensRegistrationType=n={}));var i;(function(l){l.method="textDocument/semanticTokens/full",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(i||(t.SemanticTokensRequest=i={}));var a;(function(l){l.method="textDocument/semanticTokens/full/delta",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(a||(t.SemanticTokensDeltaRequest=a={}));var s;(function(l){l.method="textDocument/semanticTokens/range",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(s||(t.SemanticTokensRangeRequest=s={}));var o;(function(l){l.method="workspace/semanticTokens/refresh",l.messageDirection=e.MessageDirection.serverToClient,l.type=new e.ProtocolRequestType0(l.method)})(o||(t.SemanticTokensRefreshRequest=o={}))}}),nMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ShowDocumentRequest=void 0;var e=Os(),r;(function(n){n.method="window/showDocument",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ShowDocumentRequest=r={}))}}),iMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedEditingRangeRequest=void 0;var e=Os(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.LinkedEditingRangeRequest=r={}))}}),aMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.DidRenameFilesNotification=t.WillRenameFilesRequest=t.DidCreateFilesNotification=t.WillCreateFilesRequest=t.FileOperationPatternKind=void 0;var e=Os(),r;(function(u){u.file="file",u.folder="folder"})(r||(t.FileOperationPatternKind=r={}));var n;(function(u){u.method="workspace/willCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(n||(t.WillCreateFilesRequest=n={}));var i;(function(u){u.method="workspace/didCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(i||(t.DidCreateFilesNotification=i={}));var a;(function(u){u.method="workspace/willRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(a||(t.WillRenameFilesRequest=a={}));var s;(function(u){u.method="workspace/didRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(s||(t.DidRenameFilesNotification=s={}));var o;(function(u){u.method="workspace/didDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(o||(t.DidDeleteFilesNotification=o={}));var l;(function(u){u.method="workspace/willDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(l||(t.WillDeleteFilesRequest=l={}))}}),sMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=void 0;var e=Os(),r;(function(a){a.document="document",a.project="project",a.group="group",a.scheme="scheme",a.global="global"})(r||(t.UniquenessLevel=r={}));var n;(function(a){a.$import="import",a.$export="export",a.local="local"})(n||(t.MonikerKind=n={}));var i;(function(a){a.method="textDocument/moniker",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.MonikerRequest=i={}))}}),oMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchySubtypesRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchyPrepareRequest=void 0;var e=Os(),r;(function(a){a.method="textDocument/prepareTypeHierarchy",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.TypeHierarchyPrepareRequest=r={}));var n;(function(a){a.method="typeHierarchy/supertypes",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.TypeHierarchySupertypesRequest=n={}));var i;(function(a){a.method="typeHierarchy/subtypes",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.TypeHierarchySubtypesRequest=i={}))}}),lMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlineValueRefreshRequest=t.InlineValueRequest=void 0;var e=Os(),r;(function(i){i.method="textDocument/inlineValue",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.InlineValueRequest=r={}));var n;(function(i){i.method="workspace/inlineValue/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.InlineValueRefreshRequest=n={}))}}),cMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=void 0;var e=Os(),r;(function(a){a.method="textDocument/inlayHint",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.InlayHintRequest=r={}));var n;(function(a){a.method="inlayHint/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.InlayHintResolveRequest=n={}));var i;(function(a){a.method="workspace/inlayHint/refresh",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType0(a.method)})(i||(t.InlayHintRefreshRequest=i={}))}}),uMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=void 0;var e=W3(),r=qEe(),n=Os(),i;(function(u){function h(d){const f=d;return f&&r.boolean(f.retriggerRequest)}$(h,"is"),u.is=h})(i||(t.DiagnosticServerCancellationData=i={}));var a;(function(u){u.Full="full",u.Unchanged="unchanged"})(a||(t.DocumentDiagnosticReportKind=a={}));var s;(function(u){u.method="textDocument/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(s||(t.DocumentDiagnosticRequest=s={}));var o;(function(u){u.method="workspace/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(o||(t.WorkspaceDiagnosticRequest=o={}));var l;(function(u){u.method="workspace/diagnostic/refresh",u.messageDirection=n.MessageDirection.serverToClient,u.type=new n.ProtocolRequestType0(u.method)})(l||(t.DiagnosticRefreshRequest=l={}))}}),hMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=void 0;var e=(eF(),Hke(Dee)),r=qEe(),n=Os(),i;(function(g){g.Markup=1,g.Code=2;function m(v){return v===1||v===2}$(m,"is"),g.is=m})(i||(t.NotebookCellKind=i={}));var a;(function(g){function m(b,x){const w={executionOrder:b};return(x===!0||x===!1)&&(w.success=x),w}$(m,"create"),g.create=m;function v(b){const x=b;return r.objectLiteral(x)&&e.uinteger.is(x.executionOrder)&&(x.success===void 0||r.boolean(x.success))}$(v,"is"),g.is=v;function y(b,x){return b===x?!0:b==null||x===null||x===void 0?!1:b.executionOrder===x.executionOrder&&b.success===x.success}$(y,"equals"),g.equals=y})(a||(t.ExecutionSummary=a={}));var s;(function(g){function m(x,w){return{kind:x,document:w}}$(m,"create"),g.create=m;function v(x){const w=x;return r.objectLiteral(w)&&i.is(w.kind)&&e.DocumentUri.is(w.document)&&(w.metadata===void 0||r.objectLiteral(w.metadata))}$(v,"is"),g.is=v;function y(x,w){const A=new Set;return x.document!==w.document&&A.add("document"),x.kind!==w.kind&&A.add("kind"),x.executionSummary!==w.executionSummary&&A.add("executionSummary"),(x.metadata!==void 0||w.metadata!==void 0)&&!b(x.metadata,w.metadata)&&A.add("metadata"),(x.executionSummary!==void 0||w.executionSummary!==void 0)&&!a.equals(x.executionSummary,w.executionSummary)&&A.add("executionSummary"),A}$(y,"diff"),g.diff=y;function b(x,w){if(x===w)return!0;if(x==null||w===null||w===void 0||typeof x!=typeof w||typeof x!="object")return!1;const A=Array.isArray(x),S=Array.isArray(w);if(A!==S)return!1;if(A&&S){if(x.length!==w.length)return!1;for(let T=0;T0}$(zt,"hasId"),Ae.hasId=zt})(N||(t.StaticRegistrationOptions=N={}));var F;(function(Ae){function zt(kt){const At=kt;return At&&(At.documentSelector===null||I.is(At.documentSelector))}$(zt,"is"),Ae.is=zt})(F||(t.TextDocumentRegistrationOptions=F={}));var B;(function(Ae){function zt(At){const Mt=At;return n.objectLiteral(Mt)&&(Mt.workDoneProgress===void 0||n.boolean(Mt.workDoneProgress))}$(zt,"is"),Ae.is=zt;function kt(At){const Mt=At;return Mt&&n.boolean(Mt.workDoneProgress)}$(kt,"hasWorkDoneProgress"),Ae.hasWorkDoneProgress=kt})(B||(t.WorkDoneProgressOptions=B={}));var V;(function(Ae){Ae.method="initialize",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(V||(t.InitializeRequest=V={}));var z;(function(Ae){Ae.unknownProtocolVersion=1})(z||(t.InitializeErrorCodes=z={}));var U;(function(Ae){Ae.method="initialized",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolNotificationType(Ae.method)})(U||(t.InitializedNotification=U={}));var Q;(function(Ae){Ae.method="shutdown",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType0(Ae.method)})(Q||(t.ShutdownRequest=Q={}));var G;(function(Ae){Ae.method="exit",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolNotificationType0(Ae.method)})(G||(t.ExitNotification=G={}));var X;(function(Ae){Ae.method="workspace/didChangeConfiguration",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolNotificationType(Ae.method)})(X||(t.DidChangeConfigurationNotification=X={}));var Y;(function(Ae){Ae.Error=1,Ae.Warning=2,Ae.Info=3,Ae.Log=4,Ae.Debug=5})(Y||(t.MessageType=Y={}));var le;(function(Ae){Ae.method="window/showMessage",Ae.messageDirection=e.MessageDirection.serverToClient,Ae.type=new e.ProtocolNotificationType(Ae.method)})(le||(t.ShowMessageNotification=le={}));var q;(function(Ae){Ae.method="window/showMessageRequest",Ae.messageDirection=e.MessageDirection.serverToClient,Ae.type=new e.ProtocolRequestType(Ae.method)})(q||(t.ShowMessageRequest=q={}));var Z;(function(Ae){Ae.method="window/logMessage",Ae.messageDirection=e.MessageDirection.serverToClient,Ae.type=new e.ProtocolNotificationType(Ae.method)})(Z||(t.LogMessageNotification=Z={}));var ee;(function(Ae){Ae.method="telemetry/event",Ae.messageDirection=e.MessageDirection.serverToClient,Ae.type=new e.ProtocolNotificationType(Ae.method)})(ee||(t.TelemetryEventNotification=ee={}));var re;(function(Ae){Ae.None=0,Ae.Full=1,Ae.Incremental=2})(re||(t.TextDocumentSyncKind=re={}));var ve;(function(Ae){Ae.method="textDocument/didOpen",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolNotificationType(Ae.method)})(ve||(t.DidOpenTextDocumentNotification=ve={}));var ae;(function(Ae){function zt(At){let Mt=At;return Mt!=null&&typeof Mt.text=="string"&&Mt.range!==void 0&&(Mt.rangeLength===void 0||typeof Mt.rangeLength=="number")}$(zt,"isIncremental"),Ae.isIncremental=zt;function kt(At){let Mt=At;return Mt!=null&&typeof Mt.text=="string"&&Mt.range===void 0&&Mt.rangeLength===void 0}$(kt,"isFull"),Ae.isFull=kt})(ae||(t.TextDocumentContentChangeEvent=ae={}));var Ce;(function(Ae){Ae.method="textDocument/didChange",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolNotificationType(Ae.method)})(Ce||(t.DidChangeTextDocumentNotification=Ce={}));var Oe;(function(Ae){Ae.method="textDocument/didClose",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolNotificationType(Ae.method)})(Oe||(t.DidCloseTextDocumentNotification=Oe={}));var $e;(function(Ae){Ae.method="textDocument/didSave",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolNotificationType(Ae.method)})($e||(t.DidSaveTextDocumentNotification=$e={}));var he;(function(Ae){Ae.Manual=1,Ae.AfterDelay=2,Ae.FocusOut=3})(he||(t.TextDocumentSaveReason=he={}));var fe;(function(Ae){Ae.method="textDocument/willSave",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolNotificationType(Ae.method)})(fe||(t.WillSaveTextDocumentNotification=fe={}));var Se;(function(Ae){Ae.method="textDocument/willSaveWaitUntil",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(Se||(t.WillSaveTextDocumentWaitUntilRequest=Se={}));var ge;(function(Ae){Ae.method="workspace/didChangeWatchedFiles",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolNotificationType(Ae.method)})(ge||(t.DidChangeWatchedFilesNotification=ge={}));var Qe;(function(Ae){Ae.Created=1,Ae.Changed=2,Ae.Deleted=3})(Qe||(t.FileChangeType=Qe={}));var Te;(function(Ae){function zt(kt){const At=kt;return n.objectLiteral(At)&&(r.URI.is(At.baseUri)||r.WorkspaceFolder.is(At.baseUri))&&n.string(At.pattern)}$(zt,"is"),Ae.is=zt})(Te||(t.RelativePattern=Te={}));var De;(function(Ae){Ae.Create=1,Ae.Change=2,Ae.Delete=4})(De||(t.WatchKind=De={}));var qe;(function(Ae){Ae.method="textDocument/publishDiagnostics",Ae.messageDirection=e.MessageDirection.serverToClient,Ae.type=new e.ProtocolNotificationType(Ae.method)})(qe||(t.PublishDiagnosticsNotification=qe={}));var K;(function(Ae){Ae.Invoked=1,Ae.TriggerCharacter=2,Ae.TriggerForIncompleteCompletions=3})(K||(t.CompletionTriggerKind=K={}));var ce;(function(Ae){Ae.method="textDocument/completion",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(ce||(t.CompletionRequest=ce={}));var be;(function(Ae){Ae.method="completionItem/resolve",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(be||(t.CompletionResolveRequest=be={}));var ne;(function(Ae){Ae.method="textDocument/hover",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(ne||(t.HoverRequest=ne={}));var j;(function(Ae){Ae.Invoked=1,Ae.TriggerCharacter=2,Ae.ContentChange=3})(j||(t.SignatureHelpTriggerKind=j={}));var ie;(function(Ae){Ae.method="textDocument/signatureHelp",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(ie||(t.SignatureHelpRequest=ie={}));var pe;(function(Ae){Ae.method="textDocument/definition",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(pe||(t.DefinitionRequest=pe={}));var te;(function(Ae){Ae.method="textDocument/references",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(te||(t.ReferencesRequest=te={}));var ye;(function(Ae){Ae.method="textDocument/documentHighlight",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(ye||(t.DocumentHighlightRequest=ye={}));var oe;(function(Ae){Ae.method="textDocument/documentSymbol",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(oe||(t.DocumentSymbolRequest=oe={}));var _e;(function(Ae){Ae.method="textDocument/codeAction",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(_e||(t.CodeActionRequest=_e={}));var Le;(function(Ae){Ae.method="codeAction/resolve",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(Le||(t.CodeActionResolveRequest=Le={}));var Ye;(function(Ae){Ae.method="workspace/symbol",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(Ye||(t.WorkspaceSymbolRequest=Ye={}));var Pe;(function(Ae){Ae.method="workspaceSymbol/resolve",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(Pe||(t.WorkspaceSymbolResolveRequest=Pe={}));var Xe;(function(Ae){Ae.method="textDocument/codeLens",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(Xe||(t.CodeLensRequest=Xe={}));var Ne;(function(Ae){Ae.method="codeLens/resolve",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(Ne||(t.CodeLensResolveRequest=Ne={}));var Ze;(function(Ae){Ae.method="workspace/codeLens/refresh",Ae.messageDirection=e.MessageDirection.serverToClient,Ae.type=new e.ProtocolRequestType0(Ae.method)})(Ze||(t.CodeLensRefreshRequest=Ze={}));var Ge;(function(Ae){Ae.method="textDocument/documentLink",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(Ge||(t.DocumentLinkRequest=Ge={}));var lt;(function(Ae){Ae.method="documentLink/resolve",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(lt||(t.DocumentLinkResolveRequest=lt={}));var Fe;(function(Ae){Ae.method="textDocument/formatting",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(Fe||(t.DocumentFormattingRequest=Fe={}));var wt;(function(Ae){Ae.method="textDocument/rangeFormatting",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(wt||(t.DocumentRangeFormattingRequest=wt={}));var Me;(function(Ae){Ae.method="textDocument/rangesFormatting",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(Me||(t.DocumentRangesFormattingRequest=Me={}));var Rt;(function(Ae){Ae.method="textDocument/onTypeFormatting",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(Rt||(t.DocumentOnTypeFormattingRequest=Rt={}));var Lt;(function(Ae){Ae.Identifier=1})(Lt||(t.PrepareSupportDefaultBehavior=Lt={}));var ut;(function(Ae){Ae.method="textDocument/rename",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(ut||(t.RenameRequest=ut={}));var Xt;(function(Ae){Ae.method="textDocument/prepareRename",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(Xt||(t.PrepareRenameRequest=Xt={}));var Ft;(function(Ae){Ae.method="workspace/executeCommand",Ae.messageDirection=e.MessageDirection.clientToServer,Ae.type=new e.ProtocolRequestType(Ae.method)})(Ft||(t.ExecuteCommandRequest=Ft={}));var gt;(function(Ae){Ae.method="workspace/applyEdit",Ae.messageDirection=e.MessageDirection.serverToClient,Ae.type=new e.ProtocolRequestType("workspace/applyEdit")})(gt||(t.ApplyWorkspaceEditRequest=gt={}))}}),pMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/connection.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var e=W3();function r(n,i,a,s){return e.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,e.createMessageConnection)(n,i,a,s)}$(r,"createProtocolConnection"),t.createProtocolConnection=r}}),gMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/api.js"(t){var e=t&&t.__createBinding||(Object.create?function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:$(function(){return s[o]},"get")}),Object.defineProperty(a,l,u)}:function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]}),r=t&&t.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,r(W3(),t),r((eF(),Hke(Dee)),t),r(Os(),t),r(fMn(),t);var n=pMn();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:$(function(){return n.createProtocolConnection},"get")});var i;(function(a){a.lspReservedErrorRangeStart=-32899,a.RequestFailed=-32803,a.ServerCancelled=-32802,a.ContentModified=-32801,a.RequestCancelled=-32800,a.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))}}),mMn=Nn({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/browser/main.js"(t){var e=t&&t.__createBinding||(Object.create?function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:$(function(){return s[o]},"get")}),Object.defineProperty(a,l,u)}:function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]}),r=t&&t.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var n=q6t();r(q6t(),t),r(gMn(),t);function i(a,s,o,l){return(0,n.createMessageConnection)(a,s,o,l)}$(i,"createProtocolConnection"),t.createProtocolConnection=i}}),j6t={};X2(j6t,{AbstractAstReflection:()=>KEe,AbstractCstNode:()=>P4e,AbstractLangiumParser:()=>B4e,AbstractParserErrorMessageProvider:()=>rGt,AbstractThreadedAsyncParser:()=>zzn,AstUtils:()=>ZEe,BiMap:()=>Ure,Cancellation:()=>Fa,CompositeCstNodeImpl:()=>_re,ContextCache:()=>Qre,CstNodeBuilder:()=>ZQt,CstUtils:()=>jEe,DEFAULT_TOKENIZE_OPTIONS:()=>i3e,DONE_RESULT:()=>Xu,DatatypeSymbol:()=>Rre,DefaultAstNodeDescriptionProvider:()=>MGt,DefaultAstNodeLocator:()=>PGt,DefaultAsyncParser:()=>tHt,DefaultCommentProvider:()=>eHt,DefaultConfigurationProvider:()=>NGt,DefaultDocumentBuilder:()=>BGt,DefaultDocumentValidator:()=>LGt,DefaultHydrator:()=>nHt,DefaultIndexManager:()=>$Gt,DefaultJsonSerializer:()=>EGt,DefaultLangiumDocumentFactory:()=>bGt,DefaultLangiumDocuments:()=>xGt,DefaultLangiumProfiler:()=>Hzn,DefaultLexer:()=>a3e,DefaultLexerErrorMessageProvider:()=>zGt,DefaultLinker:()=>wGt,DefaultNameProvider:()=>AGt,DefaultReferenceDescriptionProvider:()=>IGt,DefaultReferences:()=>SGt,DefaultScopeComputation:()=>TGt,DefaultScopeProvider:()=>kGt,DefaultServiceRegistry:()=>_Gt,DefaultTokenBuilder:()=>Pre,DefaultValueConverter:()=>G4e,DefaultWorkspaceLock:()=>rHt,DefaultWorkspaceManager:()=>FGt,Deferred:()=>H1,Disposable:()=>EO,DisposableCache:()=>Vre,DocumentCache:()=>OGt,DocumentState:()=>oi,DocumentValidator:()=>Cp,EMPTY_SCOPE:()=>Nzn,EMPTY_STREAM:()=>Y3,EmptyFileSystem:()=>Ac,EmptyFileSystemProvider:()=>oHt,ErrorWithLocation:()=>hte,GrammarAST:()=>Z6t,GrammarUtils:()=>__e,IndentationAwareLexer:()=>Vzn,IndentationAwareTokenBuilder:()=>sHt,JSDocDocumentationProvider:()=>JGt,LangiumCompletionParser:()=>nGt,LangiumParser:()=>tGt,LangiumParserErrorMessageProvider:()=>$4e,LeafCstNodeImpl:()=>Ere,LexingMode:()=>_O,MapScope:()=>Pzn,Module:()=>g3e,MultiMap:()=>W1,MultiMapScope:()=>CGt,OperationCancelled:()=>J0,ParserWorker:()=>Uzn,ProfilingTask:()=>cHt,Reduction:()=>nF,RefResolving:()=>OO,RegExpUtils:()=>D_e,RootCstNodeImpl:()=>N4e,SimpleCache:()=>Z4e,StreamImpl:()=>Q0,StreamScope:()=>K4e,TextDocument:()=>Fre,TreeStreamImpl:()=>q3,URI:()=>cf,UriTrie:()=>j4e,UriUtils:()=>nh,VALIDATE_EACH_NODE:()=>DGt,ValidationCategory:()=>Gre,ValidationRegistry:()=>RGt,ValueConverter:()=>Z0,WorkspaceCache:()=>J4e,assertCondition:()=>R_e,assertUnreachable:()=>nw,createCompletionParser:()=>U4e,createDefaultCoreModule:()=>zl,createDefaultSharedCoreModule:()=>Ul,createGrammarConfig:()=>X_e,createLangiumParser:()=>V4e,createParser:()=>Lre,delayNextTick:()=>Nre,diagnosticData:()=>kO,eagerLoad:()=>m3e,getDiagnosticRange:()=>r3e,indentationBuilderDefaultOptions:()=>b3e,inject:()=>_i,interruptAndCheck:()=>Fl,isAstNode:()=>zo,isAstNodeDescription:()=>XEe,isAstNodeWithComment:()=>e3e,isCompositeCstNode:()=>R1,isIMultiModeLexerDefinition:()=>qre,isJSDoc:()=>o3e,isLeafCstNode:()=>FC,isLinkingError:()=>$C,isMultiReference:()=>V0,isNamed:()=>X4e,isOperationCancelled:()=>CO,isReference:()=>ju,isRootCstNode:()=>zee,isTokenTypeArray:()=>Yre,isTokenTypeDictionary:()=>jre,loadGrammarFromJson:()=>Vl,parseJSDoc:()=>s3e,prepareLangiumParser:()=>Q4e,setInterruptionPeriod:()=>H4e,startCancelableOperation:()=>$re,stream:()=>sa,toDiagnosticData:()=>n3e,toDiagnosticSeverity:()=>az});var jEe={};X2(jEe,{DefaultNameRegexp:()=>S_e,RangeComparison:()=>H0,compareRange:()=>w_e,findCommentNode:()=>T_e,findDeclarationNodeAtOffset:()=>vNt,findLeafNodeAtOffset:()=>ute,findLeafNodeBeforeOffset:()=>C_e,flattenCst:()=>mNt,getDatatypeNode:()=>gNt,getInteriorNodes:()=>xNt,getNextNode:()=>yNt,getPreviousNode:()=>k_e,getStartlineNode:()=>bNt,inRange:()=>A_e,isChildNode:()=>x_e,isCommentNode:()=>cte,streamCst:()=>sR,toDocumentSegment:()=>oR,tokenToRange:()=>pF});function zo(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}$(zo,"isAstNode");function ju(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}$(ju,"isReference");function V0(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}$(V0,"isMultiReference");function XEe(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}$(XEe,"isAstNodeDescription");function $C(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}$($C,"isLinkingError");var KEe=(RD=class{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){var i;const r=this.types[e.container.$type];if(!r)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const n=(i=r.properties[e.property])==null?void 0:i.referenceType;if(!n)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return n}getTypeMetaData(e){const r=this.types[e];return r||{name:e,properties:{},superTypes:[]}}isInstance(e,r){return zo(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const i=n[r];if(i!==void 0)return i;{const a=this.types[e],s=a?a.superTypes.some(o=>this.isSubtype(o,r)):!1;return n[r]=s,s}}getAllSubTypes(e){const r=this.allSubtypes[e];if(r)return r;{const n=this.getAllTypes(),i=[];for(const a of n)this.isSubtype(a,e)&&i.push(a);return this.allSubtypes[e]=i,i}}},$(RD,"AbstractAstReflection"),RD);function R1(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}$(R1,"isCompositeCstNode");function FC(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}$(FC,"isLeafCstNode");function zee(t){return R1(t)&&typeof t.fullText=="string"}$(zee,"isRootCstNode");var Q0=(rd=class{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){const e={state:this.startFn(),next:$(()=>this.nextFn(e.state),"next"),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){const e=[],r=this.iterator();let n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){const n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){return new rd(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return Xu})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=X6t(i.value)),a=!0;while(!i.done);return n}indexOf(e,r=0){const n=this.iterator();let i=0,a=n.next();for(;!a.done;){if(i>=r&&a.value===e)return i;a=n.next(),i++}return-1}every(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new rd(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?Xu:{done:!1,value:e(i)}})}filter(e){return new rd(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return Xu})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){const n=this.iterator();let i=r,a=n.next();for(;!a.done;)i===void 0?i=a.value:i=e(i,a.value),a=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){const i=e.next();if(i.done)return n;const a=this.recursiveReduce(e,r,n);return a===void 0?i.value:r(a,i.value)}find(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new rd(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:n,value:i}=this.nextFn(r.this);if(!n){const a=e(i);if(rF(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return Xu})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new rd(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:i,value:a}=r.nextFn(n.this);if(!i)if(rF(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return Xu})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new rd(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?Xu:this.nextFn(r.state)))}distinct(e){return new rd(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){const i=e?e(n.value):n.value;if(!r.set.has(i))return r.set.add(i),n}while(!n.done);return Xu})}exclude(e,r){const n=new Set;for(const i of e){const a=r?r(i):i;n.add(a)}return this.filter(i=>{const a=r?r(i):i;return!n.has(a)})}},$(rd,"StreamImpl"),rd);function X6t(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}$(X6t,"toString");function rF(t){return!!t&&typeof t[Symbol.iterator]=="function"}$(rF,"isIterable");var Y3=new Q0(()=>{},()=>Xu),Xu=Object.freeze({done:!0,value:void 0});function sa(...t){if(t.length===1){const e=t[0];if(e instanceof Q0)return e;if(rF(e))return new Q0(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new Q0(()=>({index:0}),r=>r.index1?new Q0(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex({iterators:n!=null&&n.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const s=i.iterators[i.iterators.length-1].next();if(s.done)i.iterators.pop();else return i.iterators.push(r(s.value)[Symbol.iterator]()),s}return Xu})}iterator(){const e={state:this.startFn(),next:$(()=>this.nextFn(e.state),"next"),prune:$(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},$(DD,"TreeStreamImpl"),DD),nF;(function(t){function e(a){return a.reduce((s,o)=>s+o,0)}$(e,"sum"),t.sum=e;function r(a){return a.reduce((s,o)=>s*o,0)}$(r,"product"),t.product=r;function n(a){return a.reduce((s,o)=>Math.min(s,o))}$(n,"min"),t.min=n;function i(a){return a.reduce((s,o)=>Math.max(s,o))}$(i,"max"),t.max=i})(nF||(nF={}));var ZEe={};X2(ZEe,{assignMandatoryProperties:()=>JEe,copyAstNode:()=>Qee,findRootNode:()=>X3,getContainerOfType:()=>zC,getDocument:()=>Cg,getReferenceNodes:()=>Uee,hasContainerOfType:()=>K6t,linkContentToContainer:()=>j3,streamAllContents:()=>D1,streamAst:()=>Og,streamContents:()=>iF,streamReferences:()=>K3});function j3(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{zo(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&j3(i,e))}):zo(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&j3(n,e)))}$(j3,"linkContentToContainer");function zC(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}$(zC,"getContainerOfType");function K6t(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}$(K6t,"hasContainerOfType");function Cg(t){const r=X3(t).$document;if(!r)throw new Error("AST node has no document.");return r}$(Cg,"getDocument");function X3(t){for(;t.$container;)t=t.$container;return t}$(X3,"findRootNode");function Uee(t){return ju(t)?t.ref?[t.ref]:[]:V0(t)?t.items.map(e=>e.ref):[]}$(Uee,"getReferenceNodes");function iF(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new Q0(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndexiF(r,e))}$(D1,"streamAllContents");function Og(t,e){if(t){if(e!=null&&e.range&&!Vee(t,e.range))return new q3(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new q3(t,r=>iF(r,e),{includeRoot:!0})}$(Og,"streamAst");function Vee(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?A_e(r,e):!1}$(Vee,"isAstNodeInRange");function K3(t){return new Q0(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndexWh,AbstractParserRule:()=>aF,AbstractRule:()=>Z3,AbstractType:()=>rf,Action:()=>K2,Alternatives:()=>sF,ArrayLiteral:()=>Wee,ArrayType:()=>Yee,Assignment:()=>J2,BooleanLiteral:()=>qee,CharacterRange:()=>ew,Condition:()=>tw,Conjunction:()=>oF,CrossReference:()=>rw,Disjunction:()=>lF,EndOfFile:()=>jee,Grammar:()=>M1,GrammarImport:()=>Xee,Group:()=>QC,InferredType:()=>Kee,InfixRule:()=>G0,InfixRuleOperatorList:()=>uF,InfixRuleOperators:()=>Zee,Interface:()=>eR,Keyword:()=>tR,LangiumGrammarAstReflection:()=>b_e,LangiumGrammarTerminals:()=>vMn,NamedArgument:()=>rR,NegatedToken:()=>HC,Negation:()=>Jee,NumberLiteral:()=>ete,Parameter:()=>nR,ParameterReference:()=>tte,ParserRule:()=>kg,ReferenceType:()=>hF,RegexToken:()=>WC,ReturnType:()=>rte,RuleCall:()=>YC,SimpleType:()=>iR,StringLiteral:()=>ite,TerminalAlternatives:()=>qC,TerminalElement:()=>Yh,TerminalGroup:()=>jC,TerminalRule:()=>N1,TerminalRuleCall:()=>XC,Type:()=>dF,TypeAttribute:()=>KC,TypeDefinition:()=>ZC,UnionType:()=>ote,UnorderedGroup:()=>fF,UntilToken:()=>JC,ValueLiteral:()=>eO,Wildcard:()=>aR,isAbstractElement:()=>Gee,isAbstractParserRule:()=>UC,isAbstractRule:()=>J6t,isAbstractType:()=>eNt,isAction:()=>Z2,isAlternatives:()=>Hee,isArrayLiteral:()=>tNt,isArrayType:()=>t_e,isAssignment:()=>L1,isBooleanLiteral:()=>r_e,isCharacterRange:()=>n_e,isCondition:()=>rNt,isConjunction:()=>i_e,isCrossReference:()=>VC,isDisjunction:()=>a_e,isEndOfFile:()=>s_e,isGrammar:()=>nNt,isGrammarImport:()=>iNt,isGroup:()=>GC,isInferredType:()=>cF,isInfixRule:()=>J3,isInfixRuleOperatorList:()=>aNt,isInfixRuleOperators:()=>sNt,isInterface:()=>o_e,isKeyword:()=>I1,isNamedArgument:()=>oNt,isNegatedToken:()=>l_e,isNegation:()=>c_e,isNumberLiteral:()=>lNt,isParameter:()=>cNt,isParameterReference:()=>u_e,isParserRule:()=>Ku,isReferenceType:()=>h_e,isRegexToken:()=>d_e,isReturnType:()=>f_e,isRuleCall:()=>P1,isSimpleType:()=>nte,isStringLiteral:()=>uNt,isTerminalAlternatives:()=>p_e,isTerminalElement:()=>hNt,isTerminalGroup:()=>g_e,isTerminalRule:()=>xp,isTerminalRuleCall:()=>ate,isType:()=>ste,isTypeAttribute:()=>dNt,isTypeDefinition:()=>fNt,isUnionType:()=>m_e,isUnorderedGroup:()=>lte,isUntilToken:()=>v_e,isValueLiteral:()=>pNt,isWildcard:()=>y_e,reflection:()=>on});var vMn={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},Wh={$type:"AbstractElement",cardinality:"cardinality"};function Gee(t){return on.isInstance(t,Wh.$type)}$(Gee,"isAbstractElement");var aF={$type:"AbstractParserRule"};function UC(t){return on.isInstance(t,aF.$type)}$(UC,"isAbstractParserRule");var Z3={$type:"AbstractRule"};function J6t(t){return on.isInstance(t,Z3.$type)}$(J6t,"isAbstractRule");var rf={$type:"AbstractType"};function eNt(t){return on.isInstance(t,rf.$type)}$(eNt,"isAbstractType");var K2={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Z2(t){return on.isInstance(t,K2.$type)}$(Z2,"isAction");var sF={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Hee(t){return on.isInstance(t,sF.$type)}$(Hee,"isAlternatives");var Wee={$type:"ArrayLiteral",elements:"elements"};function tNt(t){return on.isInstance(t,Wee.$type)}$(tNt,"isArrayLiteral");var Yee={$type:"ArrayType",elementType:"elementType"};function t_e(t){return on.isInstance(t,Yee.$type)}$(t_e,"isArrayType");var J2={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function L1(t){return on.isInstance(t,J2.$type)}$(L1,"isAssignment");var qee={$type:"BooleanLiteral",true:"true"};function r_e(t){return on.isInstance(t,qee.$type)}$(r_e,"isBooleanLiteral");var ew={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function n_e(t){return on.isInstance(t,ew.$type)}$(n_e,"isCharacterRange");var tw={$type:"Condition"};function rNt(t){return on.isInstance(t,tw.$type)}$(rNt,"isCondition");var oF={$type:"Conjunction",left:"left",right:"right"};function i_e(t){return on.isInstance(t,oF.$type)}$(i_e,"isConjunction");var rw={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function VC(t){return on.isInstance(t,rw.$type)}$(VC,"isCrossReference");var lF={$type:"Disjunction",left:"left",right:"right"};function a_e(t){return on.isInstance(t,lF.$type)}$(a_e,"isDisjunction");var jee={$type:"EndOfFile",cardinality:"cardinality"};function s_e(t){return on.isInstance(t,jee.$type)}$(s_e,"isEndOfFile");var M1={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function nNt(t){return on.isInstance(t,M1.$type)}$(nNt,"isGrammar");var Xee={$type:"GrammarImport",path:"path"};function iNt(t){return on.isInstance(t,Xee.$type)}$(iNt,"isGrammarImport");var QC={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function GC(t){return on.isInstance(t,QC.$type)}$(GC,"isGroup");var Kee={$type:"InferredType",name:"name"};function cF(t){return on.isInstance(t,Kee.$type)}$(cF,"isInferredType");var G0={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function J3(t){return on.isInstance(t,G0.$type)}$(J3,"isInfixRule");var uF={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function aNt(t){return on.isInstance(t,uF.$type)}$(aNt,"isInfixRuleOperatorList");var Zee={$type:"InfixRuleOperators",precedences:"precedences"};function sNt(t){return on.isInstance(t,Zee.$type)}$(sNt,"isInfixRuleOperators");var eR={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function o_e(t){return on.isInstance(t,eR.$type)}$(o_e,"isInterface");var tR={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function I1(t){return on.isInstance(t,tR.$type)}$(I1,"isKeyword");var rR={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function oNt(t){return on.isInstance(t,rR.$type)}$(oNt,"isNamedArgument");var HC={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function l_e(t){return on.isInstance(t,HC.$type)}$(l_e,"isNegatedToken");var Jee={$type:"Negation",value:"value"};function c_e(t){return on.isInstance(t,Jee.$type)}$(c_e,"isNegation");var ete={$type:"NumberLiteral",value:"value"};function lNt(t){return on.isInstance(t,ete.$type)}$(lNt,"isNumberLiteral");var nR={$type:"Parameter",name:"name"};function cNt(t){return on.isInstance(t,nR.$type)}$(cNt,"isParameter");var tte={$type:"ParameterReference",parameter:"parameter"};function u_e(t){return on.isInstance(t,tte.$type)}$(u_e,"isParameterReference");var kg={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function Ku(t){return on.isInstance(t,kg.$type)}$(Ku,"isParserRule");var hF={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function h_e(t){return on.isInstance(t,hF.$type)}$(h_e,"isReferenceType");var WC={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function d_e(t){return on.isInstance(t,WC.$type)}$(d_e,"isRegexToken");var rte={$type:"ReturnType",name:"name"};function f_e(t){return on.isInstance(t,rte.$type)}$(f_e,"isReturnType");var YC={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function P1(t){return on.isInstance(t,YC.$type)}$(P1,"isRuleCall");var iR={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function nte(t){return on.isInstance(t,iR.$type)}$(nte,"isSimpleType");var ite={$type:"StringLiteral",value:"value"};function uNt(t){return on.isInstance(t,ite.$type)}$(uNt,"isStringLiteral");var qC={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function p_e(t){return on.isInstance(t,qC.$type)}$(p_e,"isTerminalAlternatives");var Yh={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function hNt(t){return on.isInstance(t,Yh.$type)}$(hNt,"isTerminalElement");var jC={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function g_e(t){return on.isInstance(t,jC.$type)}$(g_e,"isTerminalGroup");var N1={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function xp(t){return on.isInstance(t,N1.$type)}$(xp,"isTerminalRule");var XC={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function ate(t){return on.isInstance(t,XC.$type)}$(ate,"isTerminalRuleCall");var dF={$type:"Type",name:"name",type:"type"};function ste(t){return on.isInstance(t,dF.$type)}$(ste,"isType");var KC={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function dNt(t){return on.isInstance(t,KC.$type)}$(dNt,"isTypeAttribute");var ZC={$type:"TypeDefinition"};function fNt(t){return on.isInstance(t,ZC.$type)}$(fNt,"isTypeDefinition");var ote={$type:"UnionType",types:"types"};function m_e(t){return on.isInstance(t,ote.$type)}$(m_e,"isUnionType");var fF={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function lte(t){return on.isInstance(t,fF.$type)}$(lte,"isUnorderedGroup");var JC={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function v_e(t){return on.isInstance(t,JC.$type)}$(v_e,"isUntilToken");var eO={$type:"ValueLiteral"};function pNt(t){return on.isInstance(t,eO.$type)}$(pNt,"isValueLiteral");var aR={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function y_e(t){return on.isInstance(t,aR.$type)}$(y_e,"isWildcard");var b_e=(LD=class extends KEe{constructor(){super(...arguments),this.types={AbstractElement:{name:Wh.$type,properties:{cardinality:{name:Wh.cardinality}},superTypes:[]},AbstractParserRule:{name:aF.$type,properties:{},superTypes:[Z3.$type,rf.$type]},AbstractRule:{name:Z3.$type,properties:{},superTypes:[]},AbstractType:{name:rf.$type,properties:{},superTypes:[]},Action:{name:K2.$type,properties:{cardinality:{name:K2.cardinality},feature:{name:K2.feature},inferredType:{name:K2.inferredType},operator:{name:K2.operator},type:{name:K2.type,referenceType:rf.$type}},superTypes:[Wh.$type]},Alternatives:{name:sF.$type,properties:{cardinality:{name:sF.cardinality},elements:{name:sF.elements,defaultValue:[]}},superTypes:[Wh.$type]},ArrayLiteral:{name:Wee.$type,properties:{elements:{name:Wee.elements,defaultValue:[]}},superTypes:[eO.$type]},ArrayType:{name:Yee.$type,properties:{elementType:{name:Yee.elementType}},superTypes:[ZC.$type]},Assignment:{name:J2.$type,properties:{cardinality:{name:J2.cardinality},feature:{name:J2.feature},operator:{name:J2.operator},predicate:{name:J2.predicate},terminal:{name:J2.terminal}},superTypes:[Wh.$type]},BooleanLiteral:{name:qee.$type,properties:{true:{name:qee.true,defaultValue:!1}},superTypes:[tw.$type,eO.$type]},CharacterRange:{name:ew.$type,properties:{cardinality:{name:ew.cardinality},left:{name:ew.left},lookahead:{name:ew.lookahead},parenthesized:{name:ew.parenthesized,defaultValue:!1},right:{name:ew.right}},superTypes:[Yh.$type]},Condition:{name:tw.$type,properties:{},superTypes:[]},Conjunction:{name:oF.$type,properties:{left:{name:oF.left},right:{name:oF.right}},superTypes:[tw.$type]},CrossReference:{name:rw.$type,properties:{cardinality:{name:rw.cardinality},deprecatedSyntax:{name:rw.deprecatedSyntax,defaultValue:!1},isMulti:{name:rw.isMulti,defaultValue:!1},terminal:{name:rw.terminal},type:{name:rw.type,referenceType:rf.$type}},superTypes:[Wh.$type]},Disjunction:{name:lF.$type,properties:{left:{name:lF.left},right:{name:lF.right}},superTypes:[tw.$type]},EndOfFile:{name:jee.$type,properties:{cardinality:{name:jee.cardinality}},superTypes:[Wh.$type]},Grammar:{name:M1.$type,properties:{imports:{name:M1.imports,defaultValue:[]},interfaces:{name:M1.interfaces,defaultValue:[]},isDeclared:{name:M1.isDeclared,defaultValue:!1},name:{name:M1.name},rules:{name:M1.rules,defaultValue:[]},types:{name:M1.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:Xee.$type,properties:{path:{name:Xee.path}},superTypes:[]},Group:{name:QC.$type,properties:{cardinality:{name:QC.cardinality},elements:{name:QC.elements,defaultValue:[]},guardCondition:{name:QC.guardCondition},predicate:{name:QC.predicate}},superTypes:[Wh.$type]},InferredType:{name:Kee.$type,properties:{name:{name:Kee.name}},superTypes:[rf.$type]},InfixRule:{name:G0.$type,properties:{call:{name:G0.call},dataType:{name:G0.dataType},inferredType:{name:G0.inferredType},name:{name:G0.name},operators:{name:G0.operators},parameters:{name:G0.parameters,defaultValue:[]},returnType:{name:G0.returnType,referenceType:rf.$type}},superTypes:[aF.$type]},InfixRuleOperatorList:{name:uF.$type,properties:{associativity:{name:uF.associativity},operators:{name:uF.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:Zee.$type,properties:{precedences:{name:Zee.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:eR.$type,properties:{attributes:{name:eR.attributes,defaultValue:[]},name:{name:eR.name},superTypes:{name:eR.superTypes,defaultValue:[],referenceType:rf.$type}},superTypes:[rf.$type]},Keyword:{name:tR.$type,properties:{cardinality:{name:tR.cardinality},predicate:{name:tR.predicate},value:{name:tR.value}},superTypes:[Wh.$type]},NamedArgument:{name:rR.$type,properties:{calledByName:{name:rR.calledByName,defaultValue:!1},parameter:{name:rR.parameter,referenceType:nR.$type},value:{name:rR.value}},superTypes:[]},NegatedToken:{name:HC.$type,properties:{cardinality:{name:HC.cardinality},lookahead:{name:HC.lookahead},parenthesized:{name:HC.parenthesized,defaultValue:!1},terminal:{name:HC.terminal}},superTypes:[Yh.$type]},Negation:{name:Jee.$type,properties:{value:{name:Jee.value}},superTypes:[tw.$type]},NumberLiteral:{name:ete.$type,properties:{value:{name:ete.value}},superTypes:[eO.$type]},Parameter:{name:nR.$type,properties:{name:{name:nR.name}},superTypes:[]},ParameterReference:{name:tte.$type,properties:{parameter:{name:tte.parameter,referenceType:nR.$type}},superTypes:[tw.$type]},ParserRule:{name:kg.$type,properties:{dataType:{name:kg.dataType},definition:{name:kg.definition},entry:{name:kg.entry,defaultValue:!1},fragment:{name:kg.fragment,defaultValue:!1},inferredType:{name:kg.inferredType},name:{name:kg.name},parameters:{name:kg.parameters,defaultValue:[]},returnType:{name:kg.returnType,referenceType:rf.$type}},superTypes:[aF.$type]},ReferenceType:{name:hF.$type,properties:{isMulti:{name:hF.isMulti,defaultValue:!1},referenceType:{name:hF.referenceType}},superTypes:[ZC.$type]},RegexToken:{name:WC.$type,properties:{cardinality:{name:WC.cardinality},lookahead:{name:WC.lookahead},parenthesized:{name:WC.parenthesized,defaultValue:!1},regex:{name:WC.regex}},superTypes:[Yh.$type]},ReturnType:{name:rte.$type,properties:{name:{name:rte.name}},superTypes:[]},RuleCall:{name:YC.$type,properties:{arguments:{name:YC.arguments,defaultValue:[]},cardinality:{name:YC.cardinality},predicate:{name:YC.predicate},rule:{name:YC.rule,referenceType:Z3.$type}},superTypes:[Wh.$type]},SimpleType:{name:iR.$type,properties:{primitiveType:{name:iR.primitiveType},stringType:{name:iR.stringType},typeRef:{name:iR.typeRef,referenceType:rf.$type}},superTypes:[ZC.$type]},StringLiteral:{name:ite.$type,properties:{value:{name:ite.value}},superTypes:[eO.$type]},TerminalAlternatives:{name:qC.$type,properties:{cardinality:{name:qC.cardinality},elements:{name:qC.elements,defaultValue:[]},lookahead:{name:qC.lookahead},parenthesized:{name:qC.parenthesized,defaultValue:!1}},superTypes:[Yh.$type]},TerminalElement:{name:Yh.$type,properties:{cardinality:{name:Yh.cardinality},lookahead:{name:Yh.lookahead},parenthesized:{name:Yh.parenthesized,defaultValue:!1}},superTypes:[Wh.$type]},TerminalGroup:{name:jC.$type,properties:{cardinality:{name:jC.cardinality},elements:{name:jC.elements,defaultValue:[]},lookahead:{name:jC.lookahead},parenthesized:{name:jC.parenthesized,defaultValue:!1}},superTypes:[Yh.$type]},TerminalRule:{name:N1.$type,properties:{definition:{name:N1.definition},fragment:{name:N1.fragment,defaultValue:!1},hidden:{name:N1.hidden,defaultValue:!1},name:{name:N1.name},type:{name:N1.type}},superTypes:[Z3.$type]},TerminalRuleCall:{name:XC.$type,properties:{cardinality:{name:XC.cardinality},lookahead:{name:XC.lookahead},parenthesized:{name:XC.parenthesized,defaultValue:!1},rule:{name:XC.rule,referenceType:N1.$type}},superTypes:[Yh.$type]},Type:{name:dF.$type,properties:{name:{name:dF.name},type:{name:dF.type}},superTypes:[rf.$type]},TypeAttribute:{name:KC.$type,properties:{defaultValue:{name:KC.defaultValue},isOptional:{name:KC.isOptional,defaultValue:!1},name:{name:KC.name},type:{name:KC.type}},superTypes:[]},TypeDefinition:{name:ZC.$type,properties:{},superTypes:[]},UnionType:{name:ote.$type,properties:{types:{name:ote.types,defaultValue:[]}},superTypes:[ZC.$type]},UnorderedGroup:{name:fF.$type,properties:{cardinality:{name:fF.cardinality},elements:{name:fF.elements,defaultValue:[]}},superTypes:[Wh.$type]},UntilToken:{name:JC.$type,properties:{cardinality:{name:JC.cardinality},lookahead:{name:JC.lookahead},parenthesized:{name:JC.parenthesized,defaultValue:!1},terminal:{name:JC.terminal}},superTypes:[Yh.$type]},ValueLiteral:{name:eO.$type,properties:{},superTypes:[]},Wildcard:{name:aR.$type,properties:{cardinality:{name:aR.cardinality},lookahead:{name:aR.lookahead},parenthesized:{name:aR.parenthesized,defaultValue:!1}},superTypes:[Yh.$type]}}}},$(LD,"LangiumGrammarAstReflection"),LD),on=new b_e;function gNt(t){let e=t,r=!1;for(;e;){const n=zC(e.grammarSource,Ku);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}$(gNt,"getDatatypeNode");function sR(t){return new q3(t,e=>R1(e)?e.content:[],{includeRoot:!0})}$(sR,"streamCst");function mNt(t){return sR(t).filter(FC)}$(mNt,"flattenCst");function x_e(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}$(x_e,"isChildNode");function pF(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}$(pF,"tokenToRange");function oR(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}$(oR,"toDocumentSegment");var H0;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})(H0||(H0={}));function w_e(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return H0.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.lineH0.After}$(A_e,"inRange");var S_e=/^[\w\p{L}]$/u;function vNt(t,e,r=S_e){if(t){if(e>0){const n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return ute(t,e)}}$(vNt,"findDeclarationNodeAtOffset");function T_e(t,e){if(t){const r=k_e(t,!0);if(r&&cte(r,e))return r;if(zee(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(cte(a,e))return a}}}}$(T_e,"findCommentNode");function cte(t,e){return FC(t)&&e.includes(t.tokenType.name)}$(cte,"isCommentNode");function ute(t,e){if(FC(t))return t;if(R1(t)){const r=O_e(t,e,!1);if(r)return ute(r,e)}}$(ute,"findLeafNodeAtOffset");function C_e(t,e){if(FC(t))return t;if(R1(t)){const r=O_e(t,e,!0);if(r)return C_e(r,e)}}$(C_e,"findLeafNodeBeforeOffset");function O_e(t,e,r){let n=0,i=t.content.length-1,a;for(;n<=i;){const s=Math.floor((n+i)/2),o=t.content[s];if(o.offset<=e&&o.end>e)return o;o.end<=e?(a=r?o:void 0,n=s+1):i=s-1}return a}$(O_e,"binarySearch");function k_e(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);for(;n>0;){n--;const i=r.content[n];if(e||!i.hidden)return i}t=r}}$(k_e,"getPreviousNode");function yNt(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const i=r.content.length-1;for(;nQ_e,findNameAssignment:()=>Ate,findNodeForKeyword:()=>V_e,findNodeForProperty:()=>bte,findNodesForKeyword:()=>RNt,findNodesForKeywordInternal:()=>wte,findNodesForProperty:()=>U_e,getActionAtElement:()=>H_e,getActionType:()=>Y_e,getAllReachableRules:()=>yte,getAllRulesUsedForCrossReferences:()=>_Nt,getCrossReferenceTerminal:()=>F_e,getEntryRule:()=>N_e,getExplicitRuleType:()=>mF,getHiddenRules:()=>B_e,getRuleType:()=>q_e,getRuleTypeName:()=>PNt,getTypeName:()=>nO,isArrayCardinality:()=>LNt,isArrayOperator:()=>MNt,isCommentTerminal:()=>z_e,isDataType:()=>INt,isDataTypeRule:()=>gF,isOptionalCardinality:()=>DNt,terminalRegex:()=>vF});var hte=(MD=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}},$(MD,"ErrorWithLocation"),MD);function nw(t,e="Error: Got unexpected value."){throw new Error(e)}$(nw,"assertUnreachable");function R_e(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}$(R_e,"assertCondition");var D_e={};X2(D_e,{NEWLINE_REGEXP:()=>CNt,escapeRegExp:()=>cR,getTerminalParts:()=>kNt,isMultilineComment:()=>M_e,isWhitespace:()=>vte,partialMatches:()=>I_e,partialRegExp:()=>P_e,whitespaceCharacters:()=>ENt});function wn(t){return t.charCodeAt(0)}$(wn,"cc");function dte(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}$(dte,"insertToSet");function lR(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}$(lR,"addFlag");function tO(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}$(tO,"ASSERT_EXISTS");function ANt(){throw Error("Internal Error - Should never get here!")}$(ANt,"ASSERT_NEVER_REACH_HERE");function L_e(t){return t.type==="Character"}$(L_e,"isCharacter");var fte=[];for(let t=wn("0");t<=wn("9");t++)fte.push(t);var pte=[wn("_")].concat(fte);for(let t=wn("a");t<=wn("z");t++)pte.push(t);for(let t=wn("A");t<=wn("Z");t++)pte.push(t);var SNt=[wn(" "),wn("\f"),wn(` +`),wn("\r"),wn(" "),wn("\v"),wn(" "),wn(" "),wn(" "),wn(" "),wn(" "),wn(" "),wn(" "),wn(" "),wn(" "),wn(" "),wn(" "),wn(" "),wn(" "),wn(" "),wn("\u2028"),wn("\u2029"),wn(" "),wn(" "),wn(" "),wn("\uFEFF")],yMn=/[0-9a-fA-F]/,gte=/[0-9]/,bMn=/[1-9]/,TNt=(ID=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const r=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":lR(n,"global");break;case"i":lR(n,"ignoreCase");break;case"m":lR(n,"multiLine");break;case"u":lR(n,"unicode");break;case"y":lR(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){const e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){const e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":r="Lookbehind";break;case"!":r="NegativeLookbehind"}break}}tO(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return ANt()}quantifier(e=!1){let r;const n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),r={atLeast:i,atMost:a}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;tO(r);break}if(!(e===!0&&r===void 0)&&tO(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e;const r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),tO(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[wn(` +`),wn("\r"),wn("\u2028"),wn("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=fte;break;case"D":e=fte,r=!0;break;case"s":e=SNt;break;case"S":e=SNt,r=!0;break;case"w":e=pte;break;case"W":e=pte,r=!0;break}if(tO(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=wn("\f");break;case"n":e=wn(` `);break;case"r":e=wn("\r");break;case"t":e=wn(" ");break;case"v":e=wn("\v");break}if(tO(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:wn("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:wn(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case` `:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:wn(e)}}}characterClass(){const e=[];let r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){const n=this.classAtom();if(n.type,L_e(n)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,L_e(i)){if(i.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}},$(ID,"RegExpParser"),ID),mte=(PD=class{visitChildren(e){for(const r in e){const n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},$(PD,"BaseRegExpVisitor"),PD),CNt=/\r?\n/gm,ONt=new SNt,xMn=(ND=class extends mte{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const r=String.fromCharCode(e.value);if(!this.multiline&&r===` +`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let i=0;i=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}},$(ID,"RegExpParser"),ID),mte=(PD=class{visitChildren(e){for(const r in e){const n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},$(PD,"BaseRegExpVisitor"),PD),CNt=/\r?\n/gm,ONt=new TNt,xMn=(ND=class extends mte{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const r=String.fromCharCode(e.value);if(!this.multiline&&r===` `&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=cR(r);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitSet(e){if(!this.multiline){const r=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(r);this.multiline=!!` `.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},$(ND,"TerminalRegExpVisitor"),ND),rO=new xMn;function kNt(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;const e=ONt.pattern(t),r=[];for(const n of e.value.value)rO.reset(t),rO.visit(n),r.push({start:rO.startRegexp,end:rO.endRegex});return r}catch{return[]}}$(kNt,"getTerminalParts");function M_e(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),rO.reset(t),rO.visit(ONt.pattern(t)),rO.multiline}catch{return!1}}$(M_e,"isMultilineComment");var ENt=`\f -\r \v              \u2028\u2029   \uFEFF`.split("");function vte(t){const e=typeof t=="string"?new RegExp(t):t;return ENt.some(r=>e.test(r))}$(vte,"isWhitespace");function cR(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$(cR,"escapeRegExp");function I_e(t,e){const r=P_e(t),n=e.match(r);return!!n&&n[0].length>0}$(I_e,"partialMatches");function P_e(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function i(){let a="",s;function o(u){a+=r.substr(n,u),n+=u}$(o,"appendRaw");function l(u){a+="(?:"+r.substr(n,u)+"|$)",n+=u}for($(l,"appendOptional");n",n)-n+1);break;default:l(2);break}break;case"[":s=/\[(?:\\.|.)*?\]/g,s.lastIndex=n,s=s.exec(r)||[],l(s[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":s=/\{\d+,?\d*\}/g,s.lastIndex=n,s=s.exec(r),s?o(s[0].length):l(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":a+="(?:",n+=3,a+=i()+"|$)";break;case"=":a+="(?=",n+=3,a+=i()+")";break;case"!":s=n,n+=3,i(),a+=r.substr(s,n-s);break;case"<":switch(r[n+3]){case"=":case"!":s=n,n+=4,i(),a+=r.substr(s,n-s);break;default:o(r.indexOf(">",n)-n+1),a+=i()+"|$)";break}break}else o(1),a+=i()+"|$)";break;case")":return++n,a;default:l(1);break}return a}return $(i,"process"),new RegExp(i(),t.flags)}$(P_e,"partialRegExp");function N_e(t){return t.rules.find(e=>Ku(e)&&e.entry)}$(N_e,"getEntryRule");function B_e(t){return t.rules.filter(e=>xp(e)&&e.hidden)}$(B_e,"getHiddenRules");function yte(t,e){const r=new Set,n=N_e(t);if(!n)return new Set(t.rules);const i=[n].concat(B_e(t));for(const s of i)$_e(s,r,e);const a=new Set;for(const s of t.rules)(r.has(s.name)||xp(s)&&s.hidden)&&a.add(s);return a}$(yte,"getAllReachableRules");function $_e(t,e,r){e.add(t.name),D1(t).forEach(n=>{if(P1(n)||r&&ate(n)){const i=n.rule.ref;i&&!e.has(i.name)&&$_e(i,e,r)}})}$($_e,"ruleDfs");function _Nt(t){const e=new Set;return D1(t).forEach(r=>{VC(r)&&(Ku(r.type.ref)&&e.add(r.type.ref),cF(r.type.ref)&&Ku(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}$(_Nt,"getAllRulesUsedForCrossReferences");function F_e(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=Ate(t.type.ref);return e==null?void 0:e.terminal}}$(F_e,"getCrossReferenceTerminal");function z_e(t){return t.hidden&&!vte(vF(t))}$(z_e,"isCommentTerminal");function U_e(t,e){return!t||!e?[]:xte(t,e,t.astNode,!0)}$(U_e,"findNodesForProperty");function bte(t,e,r){if(!t||!e)return;const n=xte(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}$(bte,"findNodeForProperty");function xte(t,e,r,n){if(!n){const i=zC(t.grammarSource,L1);if(i&&i.feature===e)return[t]}return R1(t)&&t.astNode===r?t.content.flatMap(i=>xte(i,e,r,!1)):[]}$(xte,"findNodesForPropertyInternal");function RNt(t,e){return t?wte(t,e,t==null?void 0:t.astNode):[]}$(RNt,"findNodesForKeyword");function V_e(t,e,r){if(!t)return;const n=wte(t,e,t==null?void 0:t.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}$(V_e,"findNodeForKeyword");function wte(t,e,r){if(t.astNode!==r)return[];if(I1(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=sR(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const s=i.value;s.astNode===r?I1(s.grammarSource)&&s.grammarSource.value===e&&a.push(s):n.prune()}while(!i.done);return a}$(wte,"findNodesForKeywordInternal");function Q_e(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=zC(t.grammarSource,L1);if(n)return n;t=t.container}}$(Q_e,"findAssignment");function Ate(t){let e=t;return cF(e)&&(Z2(e.$container)?e=e.$container.$container:UC(e.$container)?e=e.$container:nw(e.$container)),G_e(t,e,new Map)}$(Ate,"findNameAssignment");function G_e(t,e,r){var i;function n(a,s){let o;return zC(a,L1)||(o=G_e(s,s,r)),r.set(t,o),o}if($(n,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(const a of D1(e)){if(L1(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(P1(a)&&Ku(a.rule.ref))return n(a,a.rule.ref);if(nte(a)&&((i=a.typeRef)!=null&&i.ref))return n(a,a.typeRef.ref)}}$(G_e,"findNameAssignmentInternal");function H_e(t){const e=t.$container;if(GC(e)){const r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){const a=r[i];if(Z2(a))return a;{const s=D1(r[i]).find(Z2);if(s)return s}}}if(Gee(e))return H_e(e)}$(H_e,"getActionAtElement");function DNt(t,e){return t==="?"||t==="*"||GC(e)&&!!e.guardCondition}$(DNt,"isOptionalCardinality");function LNt(t){return t==="*"||t==="+"}$(LNt,"isArrayCardinality");function MNt(t){return t==="+="}$(MNt,"isArrayOperator");function gF(t){return W_e(t,new Set)}$(gF,"isDataTypeRule");function W_e(t,e){if(e.has(t))return!0;e.add(t);for(const r of D1(t))if(P1(r)){if(!r.rule.ref||Ku(r.rule.ref)&&!W_e(r.rule.ref,e)||J3(r.rule.ref))return!1}else{if(L1(r))return!1;if(Z2(r))return!1}return!!t.definition}$(W_e,"isDataTypeRuleInternal");function INt(t){return Tte(t.type,new Set)}$(INt,"isDataType");function Tte(t,e){if(e.has(t))return!0;if(e.add(t),t_e(t))return!1;if(h_e(t))return!1;if(m_e(t))return t.types.every(r=>Tte(r,e));if(nte(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){const r=t.typeRef.ref;return ste(r)?Tte(r.type,e):!1}else return!1}else return!1}$(Tte,"isDataTypeInternal");function mF(t){if(!xp(t)){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e)return e.name}}}$(mF,"getExplicitRuleType");function nO(t){if(UC(t))return Ku(t)&&gF(t)?t.name:mF(t)??t.name;if(o_e(t)||ste(t)||f_e(t))return t.name;if(Z2(t)){const e=Y_e(t);if(e)return e}else if(cF(t))return t.name;throw new Error("Cannot get name of Unknown Type")}$(nO,"getTypeName");function Y_e(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return nO(t.type.ref)}$(Y_e,"getActionType");function PNt(t){var e;return xp(t)?((e=t.type)==null?void 0:e.name)??"string":Ku(t)&&gF(t)?t.name:mF(t)??t.name}$(PNt,"getRuleTypeName");function q_e(t){var e;return xp(t)?((e=t.type)==null?void 0:e.name)??"string":mF(t)??t.name}$(q_e,"getRuleType");function vF(t){const e={s:!1,i:!1,u:!1},r=iO(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}$(vF,"terminalRegex");var j_e=/[\s\S]/.source;function iO(t,e){var r;if(p_e(t))return NNt(t);if(g_e(t))return BNt(t);if(n_e(t))return zNt(t);if(ate(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return W0(iO(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(l_e(t))return FNt(t);if(v_e(t))return $Nt(t);if(d_e(t)){const n=t.regex.lastIndexOf("/"),i=t.regex.substring(1,n),a=t.regex.substring(n+1);return e&&(e.i=a.includes("i"),e.s=a.includes("s"),e.u=a.includes("u")),W0(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(y_e(t))return W0(j_e,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t==null?void 0:t.$type}, ${(r=t==null?void 0:t.$cstNode)==null?void 0:r.text}`)}}}$(iO,"abstractElementToRegex");function NNt(t){return W0(t.elements.map(e=>iO(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}$(NNt,"terminalAlternativesToRegex");function BNt(t){return W0(t.elements.map(e=>iO(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}$(BNt,"terminalGroupToRegex");function $Nt(t){return W0(`${j_e}*?${iO(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}$($Nt,"untilTokenToRegex");function FNt(t){return W0(`(?!${iO(t.terminal)})${j_e}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}$(FNt,"negateTokenToRegex");function zNt(t){return t.right?W0(`[${Ste(t.left)}-${Ste(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):W0(Ste(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}$(zNt,"characterRangeToRegex");function Ste(t){return cR(t.value)}$(Ste,"keywordToRegex");function W0(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}$(W0,"withCardinality");function X_e(t){const e=[],r=t.Grammar;for(const n of r.rules)xp(n)&&z_e(n)&&M_e(vF(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:T_e}}$(X_e,"createGrammarConfig");var wMn=typeof global=="object"&&global&&global.Object===Object&&global,UNt=wMn,AMn=typeof self=="object"&&self&&self.Object===Object&&self,TMn=UNt||AMn||Function("return this")(),Y0=TMn,SMn=Y0.Symbol,wp=SMn,VNt=Object.prototype,CMn=VNt.hasOwnProperty,OMn=VNt.toString,yF=wp?wp.toStringTag:void 0;function QNt(t){var e=CMn.call(t,yF),r=t[yF];try{t[yF]=void 0;var n=!0}catch{}var i=OMn.call(t);return n&&(e?t[yF]=r:delete t[yF]),i}$(QNt,"getRawTag");var kMn=QNt,EMn=Object.prototype,_Mn=EMn.toString;function GNt(t){return _Mn.call(t)}$(GNt,"objectToString");var RMn=GNt,DMn="[object Null]",LMn="[object Undefined]",HNt=wp?wp.toStringTag:void 0;function WNt(t){return t==null?t===void 0?LMn:DMn:HNt&&HNt in Object(t)?kMn(t):RMn(t)}$(WNt,"baseGetTag");var iw=WNt;function YNt(t){return t!=null&&typeof t=="object"}$(YNt,"isObjectLike");var Eg=YNt,MMn="[object Symbol]";function qNt(t){return typeof t=="symbol"||Eg(t)&&iw(t)==MMn}$(qNt,"isSymbol");var Cte=qNt;function jNt(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r0){if(++e>=gIn)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}$(y8t,"shortOut");var yIn=y8t;function b8t(t){return function(){return t}}$(b8t,"constant");var bIn=b8t,xIn=function(){try{var t=sO(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Ote=xIn,wIn=Ote?function(t,e){return Ote(t,"toString",{configurable:!0,enumerable:!1,value:bIn(e),writable:!0})}:wF,AIn=wIn,TIn=yIn(AIn),SIn=TIn;function x8t(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}$(k8t,"arrayIncludes");var E8t=k8t,kIn=9007199254740991,EIn=/^(?:0|[1-9]\d*)$/;function _8t(t,e){var r=typeof t;return e=e??kIn,!!e&&(r=="number"||r!="symbol"&&EIn.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=LIn}$(B8t,"isLength");var n5e=B8t;function $8t(t){return t!=null&&n5e(t.length)&&!B1(t)}$($8t,"isArrayLike");var q0=$8t;function F8t(t,e,r){if(!Ap(r))return!1;var n=typeof e;return(n=="number"?q0(r)&&kte(e,r.length):n=="string"&&e in r)?AF(r[e],t):!1}$(F8t,"isIterateeCall");var _te=F8t;function z8t(t){return r5e(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&_te(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}$(wBt,"listCacheHas");var XPn=wBt;function ABt(t,e){var r=this.__data__,n=Lte(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}$(ABt,"listCacheSet");var KPn=ABt;function lO(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e0&&r(o)?e>1?c5e(o,e-1,r,n,i):l5e(i,o):n||(i[i.length]=o)}return i}$(c5e,"baseFlatten");var u5e=c5e;function FBt(t){var e=t==null?0:t.length;return e?u5e(t,1):[]}$(FBt,"flatten");var _g=FBt,m6n=nBt(Object.getPrototypeOf,Object),zBt=m6n;function UBt(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(i);++no))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&s8n?new v5e:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&_te(e[0],e[1],i)&&(n=1);++r=J8n&&(a=y5e,s=!1,e=new v5e(e));e:for(;++i-1?i[a?e[s]:s]:void 0}}$(z$t,"createFind");var aBn=z$t,sBn=Math.max;function U$t(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:xF(r);return i<0&&(i=sBn(n+i,0)),T8t(t,j0(e),i)}$(U$t,"findIndex");var oBn=U$t,lBn=aBn(oBn),dR=lBn;function V$t(t){return t&&t.length?t[0]:void 0}$(V$t,"head");var Dg=V$t;function Q$t(t,e){var r=-1,n=q0(t)?Array(t.length):[];return dO(t,function(i,a,s){n[++r]=e(i,a,s)}),n}$(Q$t,"baseMap");var cBn=Q$t;function G$t(t,e){var r=Pi(t)?bF:cBn;return r(t,j0(e))}$(G$t,"map");var Hr=G$t;function H$t(t,e){return u5e(Hr(t,e),1)}$(H$t,"flatMap");var Sp=H$t,uBn=Object.prototype,hBn=uBn.hasOwnProperty,dBn=X8n(function(t,e,r){hBn.call(t,r)?t[r].push(e):t5e(t,r,[e])}),fBn=dBn,pBn=Object.prototype,gBn=pBn.hasOwnProperty;function W$t(t,e){return t!=null&&gBn.call(t,e)}$(W$t,"baseHas");var mBn=W$t;function Y$t(t,e){return t!=null&&u$t(t,e,mBn)}$(Y$t,"has");var cn=Y$t,vBn="[object String]";function q$t(t){return typeof t=="string"||!Pi(t)&&Eg(t)&&iw(t)==vBn}$(q$t,"isString");var qh=q$t;function j$t(t,e){return bF(e,function(r){return t[r]})}$(j$t,"baseValues");var yBn=j$t;function X$t(t){return t==null?[]:yBn(t,nf(t))}$(X$t,"values");var sl=X$t,bBn=Math.max;function K$t(t,e,r,n){t=q0(t)?t:sl(t),r=r&&!n?xF(r):0;var i=t.length;return r<0&&(r=bBn(i+r,0)),qh(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&e5e(t,e,r)>-1}$(K$t,"includes");var Zu=K$t,xBn=Math.max;function Z$t(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:xF(r);return i<0&&(i=xBn(n+i,0)),e5e(t,e,i)}$(Z$t,"indexOf");var J$t=Z$t,wBn="[object Map]",ABn="[object Set]",TBn=Object.prototype,SBn=TBn.hasOwnProperty;function e9t(t){if(t==null)return!0;if(q0(t)&&(Pi(t)||typeof t=="string"||typeof t.splice=="function"||CF(t)||a5e(t)||Rte(t)))return!t.length;var e=hR(t);if(e==wBn||e==ABn)return!t.size;if(SF(t))return!aBt(t).length;for(var r in t)if(SBn.call(t,r))return!1;return!0}$(e9t,"isEmpty");var $a=e9t,CBn="[object RegExp]";function t9t(t){return Eg(t)&&iw(t)==CBn}$(t9t,"baseIsRegExp");var OBn=t9t,r9t=aw&&aw.isRegExp,kBn=r9t?OF(r9t):OBn,$1=kBn;function n9t(t){return t===void 0}$(n9t,"isUndefined");var F1=n9t,EBn="Expected a function";function i9t(t){if(typeof t!="function")throw new TypeError(EBn);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}$(i9t,"negate");var _Bn=i9t;function a9t(t,e,r,n){if(!Ap(t))return t;e=Bte(e,t);for(var i=-1,a=e.length,s=a-1,o=t;o!=null&&++i=BBn){var u=e?null:NBn(t);if(u)return b5e(u);s=!1,i=y5e,l=new v5e}else l=e?[]:o;e:for(;++n{r.accept(e)})}},$(BD,"AbstractProduction"),BD),Ju=($D=class extends X0{constructor(e){super([]),this.idx=1,af(this,Lg(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},$($D,"NonTerminal"),$D),fR=(FD=class extends X0{constructor(e){super(e.definition),this.orgText="",af(this,Lg(e,r=>r!==void 0))}},$(FD,"Rule"),FD),jh=(zD=class extends X0{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,af(this,Lg(e,r=>r!==void 0))}},$(zD,"Alternative"),zD),wc=(UD=class extends X0{constructor(e){super(e.definition),this.idx=1,af(this,Lg(e,r=>r!==void 0))}},$(UD,"Option"),UD),of=(VD=class extends X0{constructor(e){super(e.definition),this.idx=1,af(this,Lg(e,r=>r!==void 0))}},$(VD,"RepetitionMandatory"),VD),lf=(QD=class extends X0{constructor(e){super(e.definition),this.idx=1,af(this,Lg(e,r=>r!==void 0))}},$(QD,"RepetitionMandatoryWithSeparator"),QD),qs=(GD=class extends X0{constructor(e){super(e.definition),this.idx=1,af(this,Lg(e,r=>r!==void 0))}},$(GD,"Repetition"),GD),Xh=(HD=class extends X0{constructor(e){super(e.definition),this.idx=1,af(this,Lg(e,r=>r!==void 0))}},$(HD,"RepetitionWithSeparator"),HD),Kh=(WD=class extends X0{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,af(this,Lg(e,r=>r!==void 0))}},$(WD,"Alternation"),WD),os=(YD=class{constructor(e){this.idx=1,af(this,Lg(e,r=>r!==void 0))}accept(e){e.visit(this)}},$(YD,"Terminal"),YD);function y9t(t){return Hr(t,NF)}$(y9t,"serializeGrammar");function NF(t){function e(r){return Hr(r,NF)}if($(e,"convertDefinition"),t instanceof Ju){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return qh(t.label)&&(r.label=t.label),r}else{if(t instanceof jh)return{type:"Alternative",definition:e(t.definition)};if(t instanceof wc)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof of)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof lf)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:NF(new os({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Xh)return{type:"RepetitionWithSeparator",idx:t.idx,separator:NF(new os({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof qs)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof Kh)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof os){const r={type:"Terminal",name:t.terminalType.name,label:m9t(t.terminalType),idx:t.idx};qh(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=$1(n)?n.source:n),r}else{if(t instanceof fR)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}$(NF,"serializeProduction");var pR=(qD=class{visit(e){const r=e;switch(r.constructor){case Ju:return this.visitNonTerminal(r);case jh:return this.visitAlternative(r);case wc:return this.visitOption(r);case of:return this.visitRepetitionMandatory(r);case lf:return this.visitRepetitionMandatoryWithSeparator(r);case Xh:return this.visitRepetitionWithSeparator(r);case qs:return this.visitRepetition(r);case Kh:return this.visitAlternation(r);case os:return this.visitTerminal(r);case fR:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}},$(qD,"GAstVisitor"),qD);function b9t(t){return t instanceof jh||t instanceof wc||t instanceof qs||t instanceof of||t instanceof lf||t instanceof Xh||t instanceof os||t instanceof fR}$(b9t,"isSequenceProd");function BF(t,e=[]){return t instanceof wc||t instanceof qs||t instanceof Xh?!0:t instanceof Kh?f9t(t.definition,n=>BF(n,e)):t instanceof Ju&&Zu(e,t)?!1:t instanceof X0?(t instanceof Ju&&e.push(t),Rg(t.definition,n=>BF(n,e))):!1}$(BF,"isOptionalProd");function x9t(t){return t instanceof Kh}$(x9t,"isBranchingProd");function Mg(t){if(t instanceof Ju)return"SUBRULE";if(t instanceof wc)return"OPTION";if(t instanceof Kh)return"OR";if(t instanceof of)return"AT_LEAST_ONE";if(t instanceof lf)return"AT_LEAST_ONE_SEP";if(t instanceof Xh)return"MANY_SEP";if(t instanceof qs)return"MANY";if(t instanceof os)return"CONSUME";throw Error("non exhaustive match")}$(Mg,"getProductionDslName");var Qte=(jD=class{walk(e,r=[]){An(e.definition,(n,i)=>{const a=xc(e.definition,i+1);if(n instanceof Ju)this.walkProdRef(n,a,r);else if(n instanceof os)this.walkTerminal(n,a,r);else if(n instanceof jh)this.walkFlat(n,a,r);else if(n instanceof wc)this.walkOption(n,a,r);else if(n instanceof of)this.walkAtLeastOne(n,a,r);else if(n instanceof lf)this.walkAtLeastOneSep(n,a,r);else if(n instanceof Xh)this.walkManySep(n,a,r);else if(n instanceof qs)this.walkMany(n,a,r);else if(n instanceof Kh)this.walkOr(n,a,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){const i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){const i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){const i=[new wc({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=k5e(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new wc({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=k5e(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);An(e.definition,a=>{const s=new jh({definition:[a]});this.walk(s,i)})}},$(jD,"RestWalker"),jD);function k5e(t,e,r){return[new wc({definition:[new os({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}$(k5e,"restForRepetitionWithSeparator");function gR(t){if(t instanceof Ju)return gR(t.referencedRule);if(t instanceof os)return T9t(t);if(b9t(t))return w9t(t);if(x9t(t))return A9t(t);throw Error("non exhaustive match")}$(gR,"first");function w9t(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,s=!0;for(;i&&s;)a=r[n],s=BF(a),e=e.concat(gR(a)),n=n+1,i=r.length>n;return T5e(e)}$(w9t,"firstForSequence");function A9t(t){const e=Hr(t.definition,r=>gR(r));return T5e(_g(e))}$(A9t,"firstForBranching");function T9t(t){return[t.terminalType]}$(T9t,"firstForTerminal");var S9t="_~IN~_",FBn=(XD=class extends Qte{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){const i=O9t(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),s=new jh({definition:a}),o=gR(s);this.follows[i]=o}},$(XD,"ResyncFollowsWalker"),XD);function C9t(t){const e={};return An(t,r=>{const n=new FBn(r).startWalking();af(e,n)}),e}$(C9t,"computeAllProdsFollows");function O9t(t,e){return t.name+e+S9t}$(O9t,"buildBetweenProdsFollowPrefix");var Gte={},zBn=new SNt;function $F(t){const e=t.toString();if(Gte.hasOwnProperty(e))return Gte[e];{const r=zBn.pattern(e);return Gte[e]=r,r}}$($F,"getRegExpAst");function k9t(){Gte={}}$(k9t,"clearRegExpParserCache");var E9t="Complement Sets are not supported for first char optimization",Hte=`Unable to use "first char" lexer optimizations: -`;function _9t(t,e=!1){try{const r=$F(t);return Wte(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===E9t)e&&S5e(`${Hte} Unable to optimize: < ${t.toString()} > +\r \v              \u2028\u2029   \uFEFF`.split("");function vte(t){const e=typeof t=="string"?new RegExp(t):t;return ENt.some(r=>e.test(r))}$(vte,"isWhitespace");function cR(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$(cR,"escapeRegExp");function I_e(t,e){const r=P_e(t),n=e.match(r);return!!n&&n[0].length>0}$(I_e,"partialMatches");function P_e(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function i(){let a="",s;function o(u){a+=r.substr(n,u),n+=u}$(o,"appendRaw");function l(u){a+="(?:"+r.substr(n,u)+"|$)",n+=u}for($(l,"appendOptional");n",n)-n+1);break;default:l(2);break}break;case"[":s=/\[(?:\\.|.)*?\]/g,s.lastIndex=n,s=s.exec(r)||[],l(s[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":s=/\{\d+,?\d*\}/g,s.lastIndex=n,s=s.exec(r),s?o(s[0].length):l(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":a+="(?:",n+=3,a+=i()+"|$)";break;case"=":a+="(?=",n+=3,a+=i()+")";break;case"!":s=n,n+=3,i(),a+=r.substr(s,n-s);break;case"<":switch(r[n+3]){case"=":case"!":s=n,n+=4,i(),a+=r.substr(s,n-s);break;default:o(r.indexOf(">",n)-n+1),a+=i()+"|$)";break}break}else o(1),a+=i()+"|$)";break;case")":return++n,a;default:l(1);break}return a}return $(i,"process"),new RegExp(i(),t.flags)}$(P_e,"partialRegExp");function N_e(t){return t.rules.find(e=>Ku(e)&&e.entry)}$(N_e,"getEntryRule");function B_e(t){return t.rules.filter(e=>xp(e)&&e.hidden)}$(B_e,"getHiddenRules");function yte(t,e){const r=new Set,n=N_e(t);if(!n)return new Set(t.rules);const i=[n].concat(B_e(t));for(const s of i)$_e(s,r,e);const a=new Set;for(const s of t.rules)(r.has(s.name)||xp(s)&&s.hidden)&&a.add(s);return a}$(yte,"getAllReachableRules");function $_e(t,e,r){e.add(t.name),D1(t).forEach(n=>{if(P1(n)||r&&ate(n)){const i=n.rule.ref;i&&!e.has(i.name)&&$_e(i,e,r)}})}$($_e,"ruleDfs");function _Nt(t){const e=new Set;return D1(t).forEach(r=>{VC(r)&&(Ku(r.type.ref)&&e.add(r.type.ref),cF(r.type.ref)&&Ku(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}$(_Nt,"getAllRulesUsedForCrossReferences");function F_e(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=Ate(t.type.ref);return e==null?void 0:e.terminal}}$(F_e,"getCrossReferenceTerminal");function z_e(t){return t.hidden&&!vte(vF(t))}$(z_e,"isCommentTerminal");function U_e(t,e){return!t||!e?[]:xte(t,e,t.astNode,!0)}$(U_e,"findNodesForProperty");function bte(t,e,r){if(!t||!e)return;const n=xte(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}$(bte,"findNodeForProperty");function xte(t,e,r,n){if(!n){const i=zC(t.grammarSource,L1);if(i&&i.feature===e)return[t]}return R1(t)&&t.astNode===r?t.content.flatMap(i=>xte(i,e,r,!1)):[]}$(xte,"findNodesForPropertyInternal");function RNt(t,e){return t?wte(t,e,t==null?void 0:t.astNode):[]}$(RNt,"findNodesForKeyword");function V_e(t,e,r){if(!t)return;const n=wte(t,e,t==null?void 0:t.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}$(V_e,"findNodeForKeyword");function wte(t,e,r){if(t.astNode!==r)return[];if(I1(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=sR(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const s=i.value;s.astNode===r?I1(s.grammarSource)&&s.grammarSource.value===e&&a.push(s):n.prune()}while(!i.done);return a}$(wte,"findNodesForKeywordInternal");function Q_e(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=zC(t.grammarSource,L1);if(n)return n;t=t.container}}$(Q_e,"findAssignment");function Ate(t){let e=t;return cF(e)&&(Z2(e.$container)?e=e.$container.$container:UC(e.$container)?e=e.$container:nw(e.$container)),G_e(t,e,new Map)}$(Ate,"findNameAssignment");function G_e(t,e,r){var i;function n(a,s){let o;return zC(a,L1)||(o=G_e(s,s,r)),r.set(t,o),o}if($(n,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(const a of D1(e)){if(L1(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(P1(a)&&Ku(a.rule.ref))return n(a,a.rule.ref);if(nte(a)&&((i=a.typeRef)!=null&&i.ref))return n(a,a.typeRef.ref)}}$(G_e,"findNameAssignmentInternal");function H_e(t){const e=t.$container;if(GC(e)){const r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){const a=r[i];if(Z2(a))return a;{const s=D1(r[i]).find(Z2);if(s)return s}}}if(Gee(e))return H_e(e)}$(H_e,"getActionAtElement");function DNt(t,e){return t==="?"||t==="*"||GC(e)&&!!e.guardCondition}$(DNt,"isOptionalCardinality");function LNt(t){return t==="*"||t==="+"}$(LNt,"isArrayCardinality");function MNt(t){return t==="+="}$(MNt,"isArrayOperator");function gF(t){return W_e(t,new Set)}$(gF,"isDataTypeRule");function W_e(t,e){if(e.has(t))return!0;e.add(t);for(const r of D1(t))if(P1(r)){if(!r.rule.ref||Ku(r.rule.ref)&&!W_e(r.rule.ref,e)||J3(r.rule.ref))return!1}else{if(L1(r))return!1;if(Z2(r))return!1}return!!t.definition}$(W_e,"isDataTypeRuleInternal");function INt(t){return Ste(t.type,new Set)}$(INt,"isDataType");function Ste(t,e){if(e.has(t))return!0;if(e.add(t),t_e(t))return!1;if(h_e(t))return!1;if(m_e(t))return t.types.every(r=>Ste(r,e));if(nte(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){const r=t.typeRef.ref;return ste(r)?Ste(r.type,e):!1}else return!1}else return!1}$(Ste,"isDataTypeInternal");function mF(t){if(!xp(t)){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e)return e.name}}}$(mF,"getExplicitRuleType");function nO(t){if(UC(t))return Ku(t)&&gF(t)?t.name:mF(t)??t.name;if(o_e(t)||ste(t)||f_e(t))return t.name;if(Z2(t)){const e=Y_e(t);if(e)return e}else if(cF(t))return t.name;throw new Error("Cannot get name of Unknown Type")}$(nO,"getTypeName");function Y_e(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return nO(t.type.ref)}$(Y_e,"getActionType");function PNt(t){var e;return xp(t)?((e=t.type)==null?void 0:e.name)??"string":Ku(t)&&gF(t)?t.name:mF(t)??t.name}$(PNt,"getRuleTypeName");function q_e(t){var e;return xp(t)?((e=t.type)==null?void 0:e.name)??"string":mF(t)??t.name}$(q_e,"getRuleType");function vF(t){const e={s:!1,i:!1,u:!1},r=iO(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}$(vF,"terminalRegex");var j_e=/[\s\S]/.source;function iO(t,e){var r;if(p_e(t))return NNt(t);if(g_e(t))return BNt(t);if(n_e(t))return zNt(t);if(ate(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return W0(iO(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(l_e(t))return FNt(t);if(v_e(t))return $Nt(t);if(d_e(t)){const n=t.regex.lastIndexOf("/"),i=t.regex.substring(1,n),a=t.regex.substring(n+1);return e&&(e.i=a.includes("i"),e.s=a.includes("s"),e.u=a.includes("u")),W0(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(y_e(t))return W0(j_e,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t==null?void 0:t.$type}, ${(r=t==null?void 0:t.$cstNode)==null?void 0:r.text}`)}}}$(iO,"abstractElementToRegex");function NNt(t){return W0(t.elements.map(e=>iO(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}$(NNt,"terminalAlternativesToRegex");function BNt(t){return W0(t.elements.map(e=>iO(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}$(BNt,"terminalGroupToRegex");function $Nt(t){return W0(`${j_e}*?${iO(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}$($Nt,"untilTokenToRegex");function FNt(t){return W0(`(?!${iO(t.terminal)})${j_e}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}$(FNt,"negateTokenToRegex");function zNt(t){return t.right?W0(`[${Tte(t.left)}-${Tte(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):W0(Tte(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}$(zNt,"characterRangeToRegex");function Tte(t){return cR(t.value)}$(Tte,"keywordToRegex");function W0(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}$(W0,"withCardinality");function X_e(t){const e=[],r=t.Grammar;for(const n of r.rules)xp(n)&&z_e(n)&&M_e(vF(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:S_e}}$(X_e,"createGrammarConfig");var wMn=typeof global=="object"&&global&&global.Object===Object&&global,UNt=wMn,AMn=typeof self=="object"&&self&&self.Object===Object&&self,SMn=UNt||AMn||Function("return this")(),Y0=SMn,TMn=Y0.Symbol,wp=TMn,VNt=Object.prototype,CMn=VNt.hasOwnProperty,OMn=VNt.toString,yF=wp?wp.toStringTag:void 0;function QNt(t){var e=CMn.call(t,yF),r=t[yF];try{t[yF]=void 0;var n=!0}catch{}var i=OMn.call(t);return n&&(e?t[yF]=r:delete t[yF]),i}$(QNt,"getRawTag");var kMn=QNt,EMn=Object.prototype,_Mn=EMn.toString;function GNt(t){return _Mn.call(t)}$(GNt,"objectToString");var RMn=GNt,DMn="[object Null]",LMn="[object Undefined]",HNt=wp?wp.toStringTag:void 0;function WNt(t){return t==null?t===void 0?LMn:DMn:HNt&&HNt in Object(t)?kMn(t):RMn(t)}$(WNt,"baseGetTag");var iw=WNt;function YNt(t){return t!=null&&typeof t=="object"}$(YNt,"isObjectLike");var Eg=YNt,MMn="[object Symbol]";function qNt(t){return typeof t=="symbol"||Eg(t)&&iw(t)==MMn}$(qNt,"isSymbol");var Cte=qNt;function jNt(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r0){if(++e>=gIn)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}$(y8t,"shortOut");var yIn=y8t;function b8t(t){return function(){return t}}$(b8t,"constant");var bIn=b8t,xIn=function(){try{var t=sO(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Ote=xIn,wIn=Ote?function(t,e){return Ote(t,"toString",{configurable:!0,enumerable:!1,value:bIn(e),writable:!0})}:wF,AIn=wIn,SIn=yIn(AIn),TIn=SIn;function x8t(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}$(k8t,"arrayIncludes");var E8t=k8t,kIn=9007199254740991,EIn=/^(?:0|[1-9]\d*)$/;function _8t(t,e){var r=typeof t;return e=e??kIn,!!e&&(r=="number"||r!="symbol"&&EIn.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=LIn}$(B8t,"isLength");var n5e=B8t;function $8t(t){return t!=null&&n5e(t.length)&&!B1(t)}$($8t,"isArrayLike");var q0=$8t;function F8t(t,e,r){if(!Ap(r))return!1;var n=typeof e;return(n=="number"?q0(r)&&kte(e,r.length):n=="string"&&e in r)?AF(r[e],t):!1}$(F8t,"isIterateeCall");var _te=F8t;function z8t(t){return r5e(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&_te(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}$(wBt,"listCacheHas");var XPn=wBt;function ABt(t,e){var r=this.__data__,n=Lte(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}$(ABt,"listCacheSet");var KPn=ABt;function lO(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e0&&r(o)?e>1?c5e(o,e-1,r,n,i):l5e(i,o):n||(i[i.length]=o)}return i}$(c5e,"baseFlatten");var u5e=c5e;function FBt(t){var e=t==null?0:t.length;return e?u5e(t,1):[]}$(FBt,"flatten");var _g=FBt,m6n=nBt(Object.getPrototypeOf,Object),zBt=m6n;function UBt(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(i);++no))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&s8n?new v5e:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&_te(e[0],e[1],i)&&(n=1);++r=J8n&&(a=y5e,s=!1,e=new v5e(e));e:for(;++i-1?i[a?e[s]:s]:void 0}}$(z$t,"createFind");var aBn=z$t,sBn=Math.max;function U$t(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:xF(r);return i<0&&(i=sBn(n+i,0)),S8t(t,j0(e),i)}$(U$t,"findIndex");var oBn=U$t,lBn=aBn(oBn),dR=lBn;function V$t(t){return t&&t.length?t[0]:void 0}$(V$t,"head");var Dg=V$t;function Q$t(t,e){var r=-1,n=q0(t)?Array(t.length):[];return dO(t,function(i,a,s){n[++r]=e(i,a,s)}),n}$(Q$t,"baseMap");var cBn=Q$t;function G$t(t,e){var r=Pi(t)?bF:cBn;return r(t,j0(e))}$(G$t,"map");var Hr=G$t;function H$t(t,e){return u5e(Hr(t,e),1)}$(H$t,"flatMap");var Tp=H$t,uBn=Object.prototype,hBn=uBn.hasOwnProperty,dBn=X8n(function(t,e,r){hBn.call(t,r)?t[r].push(e):t5e(t,r,[e])}),fBn=dBn,pBn=Object.prototype,gBn=pBn.hasOwnProperty;function W$t(t,e){return t!=null&&gBn.call(t,e)}$(W$t,"baseHas");var mBn=W$t;function Y$t(t,e){return t!=null&&u$t(t,e,mBn)}$(Y$t,"has");var cn=Y$t,vBn="[object String]";function q$t(t){return typeof t=="string"||!Pi(t)&&Eg(t)&&iw(t)==vBn}$(q$t,"isString");var qh=q$t;function j$t(t,e){return bF(e,function(r){return t[r]})}$(j$t,"baseValues");var yBn=j$t;function X$t(t){return t==null?[]:yBn(t,nf(t))}$(X$t,"values");var sl=X$t,bBn=Math.max;function K$t(t,e,r,n){t=q0(t)?t:sl(t),r=r&&!n?xF(r):0;var i=t.length;return r<0&&(r=bBn(i+r,0)),qh(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&e5e(t,e,r)>-1}$(K$t,"includes");var Zu=K$t,xBn=Math.max;function Z$t(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:xF(r);return i<0&&(i=xBn(n+i,0)),e5e(t,e,i)}$(Z$t,"indexOf");var J$t=Z$t,wBn="[object Map]",ABn="[object Set]",SBn=Object.prototype,TBn=SBn.hasOwnProperty;function e9t(t){if(t==null)return!0;if(q0(t)&&(Pi(t)||typeof t=="string"||typeof t.splice=="function"||CF(t)||a5e(t)||Rte(t)))return!t.length;var e=hR(t);if(e==wBn||e==ABn)return!t.size;if(TF(t))return!aBt(t).length;for(var r in t)if(TBn.call(t,r))return!1;return!0}$(e9t,"isEmpty");var $a=e9t,CBn="[object RegExp]";function t9t(t){return Eg(t)&&iw(t)==CBn}$(t9t,"baseIsRegExp");var OBn=t9t,r9t=aw&&aw.isRegExp,kBn=r9t?OF(r9t):OBn,$1=kBn;function n9t(t){return t===void 0}$(n9t,"isUndefined");var F1=n9t,EBn="Expected a function";function i9t(t){if(typeof t!="function")throw new TypeError(EBn);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}$(i9t,"negate");var _Bn=i9t;function a9t(t,e,r,n){if(!Ap(t))return t;e=Bte(e,t);for(var i=-1,a=e.length,s=a-1,o=t;o!=null&&++i=BBn){var u=e?null:NBn(t);if(u)return b5e(u);s=!1,i=y5e,l=new v5e}else l=e?[]:o;e:for(;++n{r.accept(e)})}},$(BD,"AbstractProduction"),BD),Ju=($D=class extends X0{constructor(e){super([]),this.idx=1,af(this,Lg(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},$($D,"NonTerminal"),$D),fR=(FD=class extends X0{constructor(e){super(e.definition),this.orgText="",af(this,Lg(e,r=>r!==void 0))}},$(FD,"Rule"),FD),jh=(zD=class extends X0{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,af(this,Lg(e,r=>r!==void 0))}},$(zD,"Alternative"),zD),wc=(UD=class extends X0{constructor(e){super(e.definition),this.idx=1,af(this,Lg(e,r=>r!==void 0))}},$(UD,"Option"),UD),of=(VD=class extends X0{constructor(e){super(e.definition),this.idx=1,af(this,Lg(e,r=>r!==void 0))}},$(VD,"RepetitionMandatory"),VD),lf=(QD=class extends X0{constructor(e){super(e.definition),this.idx=1,af(this,Lg(e,r=>r!==void 0))}},$(QD,"RepetitionMandatoryWithSeparator"),QD),qs=(GD=class extends X0{constructor(e){super(e.definition),this.idx=1,af(this,Lg(e,r=>r!==void 0))}},$(GD,"Repetition"),GD),Xh=(HD=class extends X0{constructor(e){super(e.definition),this.idx=1,af(this,Lg(e,r=>r!==void 0))}},$(HD,"RepetitionWithSeparator"),HD),Kh=(WD=class extends X0{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,af(this,Lg(e,r=>r!==void 0))}},$(WD,"Alternation"),WD),os=(YD=class{constructor(e){this.idx=1,af(this,Lg(e,r=>r!==void 0))}accept(e){e.visit(this)}},$(YD,"Terminal"),YD);function y9t(t){return Hr(t,NF)}$(y9t,"serializeGrammar");function NF(t){function e(r){return Hr(r,NF)}if($(e,"convertDefinition"),t instanceof Ju){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return qh(t.label)&&(r.label=t.label),r}else{if(t instanceof jh)return{type:"Alternative",definition:e(t.definition)};if(t instanceof wc)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof of)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof lf)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:NF(new os({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Xh)return{type:"RepetitionWithSeparator",idx:t.idx,separator:NF(new os({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof qs)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof Kh)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof os){const r={type:"Terminal",name:t.terminalType.name,label:m9t(t.terminalType),idx:t.idx};qh(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=$1(n)?n.source:n),r}else{if(t instanceof fR)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}$(NF,"serializeProduction");var pR=(qD=class{visit(e){const r=e;switch(r.constructor){case Ju:return this.visitNonTerminal(r);case jh:return this.visitAlternative(r);case wc:return this.visitOption(r);case of:return this.visitRepetitionMandatory(r);case lf:return this.visitRepetitionMandatoryWithSeparator(r);case Xh:return this.visitRepetitionWithSeparator(r);case qs:return this.visitRepetition(r);case Kh:return this.visitAlternation(r);case os:return this.visitTerminal(r);case fR:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}},$(qD,"GAstVisitor"),qD);function b9t(t){return t instanceof jh||t instanceof wc||t instanceof qs||t instanceof of||t instanceof lf||t instanceof Xh||t instanceof os||t instanceof fR}$(b9t,"isSequenceProd");function BF(t,e=[]){return t instanceof wc||t instanceof qs||t instanceof Xh?!0:t instanceof Kh?f9t(t.definition,n=>BF(n,e)):t instanceof Ju&&Zu(e,t)?!1:t instanceof X0?(t instanceof Ju&&e.push(t),Rg(t.definition,n=>BF(n,e))):!1}$(BF,"isOptionalProd");function x9t(t){return t instanceof Kh}$(x9t,"isBranchingProd");function Mg(t){if(t instanceof Ju)return"SUBRULE";if(t instanceof wc)return"OPTION";if(t instanceof Kh)return"OR";if(t instanceof of)return"AT_LEAST_ONE";if(t instanceof lf)return"AT_LEAST_ONE_SEP";if(t instanceof Xh)return"MANY_SEP";if(t instanceof qs)return"MANY";if(t instanceof os)return"CONSUME";throw Error("non exhaustive match")}$(Mg,"getProductionDslName");var Qte=(jD=class{walk(e,r=[]){An(e.definition,(n,i)=>{const a=xc(e.definition,i+1);if(n instanceof Ju)this.walkProdRef(n,a,r);else if(n instanceof os)this.walkTerminal(n,a,r);else if(n instanceof jh)this.walkFlat(n,a,r);else if(n instanceof wc)this.walkOption(n,a,r);else if(n instanceof of)this.walkAtLeastOne(n,a,r);else if(n instanceof lf)this.walkAtLeastOneSep(n,a,r);else if(n instanceof Xh)this.walkManySep(n,a,r);else if(n instanceof qs)this.walkMany(n,a,r);else if(n instanceof Kh)this.walkOr(n,a,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){const i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){const i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){const i=[new wc({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=k5e(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new wc({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=k5e(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);An(e.definition,a=>{const s=new jh({definition:[a]});this.walk(s,i)})}},$(jD,"RestWalker"),jD);function k5e(t,e,r){return[new wc({definition:[new os({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}$(k5e,"restForRepetitionWithSeparator");function gR(t){if(t instanceof Ju)return gR(t.referencedRule);if(t instanceof os)return S9t(t);if(b9t(t))return w9t(t);if(x9t(t))return A9t(t);throw Error("non exhaustive match")}$(gR,"first");function w9t(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,s=!0;for(;i&&s;)a=r[n],s=BF(a),e=e.concat(gR(a)),n=n+1,i=r.length>n;return S5e(e)}$(w9t,"firstForSequence");function A9t(t){const e=Hr(t.definition,r=>gR(r));return S5e(_g(e))}$(A9t,"firstForBranching");function S9t(t){return[t.terminalType]}$(S9t,"firstForTerminal");var T9t="_~IN~_",FBn=(XD=class extends Qte{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){const i=O9t(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),s=new jh({definition:a}),o=gR(s);this.follows[i]=o}},$(XD,"ResyncFollowsWalker"),XD);function C9t(t){const e={};return An(t,r=>{const n=new FBn(r).startWalking();af(e,n)}),e}$(C9t,"computeAllProdsFollows");function O9t(t,e){return t.name+e+T9t}$(O9t,"buildBetweenProdsFollowPrefix");var Gte={},zBn=new TNt;function $F(t){const e=t.toString();if(Gte.hasOwnProperty(e))return Gte[e];{const r=zBn.pattern(e);return Gte[e]=r,r}}$($F,"getRegExpAst");function k9t(){Gte={}}$(k9t,"clearRegExpParserCache");var E9t="Complement Sets are not supported for first char optimization",Hte=`Unable to use "first char" lexer optimizations: +`;function _9t(t,e=!1){try{const r=$F(t);return Wte(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===E9t)e&&T5e(`${Hte} Unable to optimize: < ${t.toString()} > Complement Sets cannot be automatically optimized. This will disable the lexer's first char optimizations. See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";e&&(n=` @@ -1626,16 +1626,16 @@ ${JSON.stringify(Re,null,4)}`);const at=Re;if(r.string(at.id)||r.number(at.id)){ Failed parsing: < ${t.toString()} > Using the @chevrotain/regexp-to-ast library Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}$(_9t,"getOptimizedStartCodesIndices");function Wte(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i{if(typeof l=="number")FF(l,e,r);else{const u=l;if(r===!0)for(let h=u.from;h<=u.to;h++)FF(h,e,r);else{for(let h=u.from;h<=u.to&&h=UF){const h=u.from>=UF?u.from:UF,d=u.to,f=z1(h),p=z1(d);for(let g=f;g<=p;g++)e[g]=g}}}});break;case"Group":Wte(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}const o=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&Yte(s)===!1||s.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return sl(e)}$(Wte,"firstCharOptimizedIndices");function FF(t,e,r){const n=z1(t);e[n]=n,r===!0&&R9t(t,e)}$(FF,"addOptimizedIdxToResult");function R9t(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=z1(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const a=z1(i.charCodeAt(0));e[a]=a}}}$(R9t,"handleIgnoreCase");function E5e(t,e){return dR(t.value,r=>{if(typeof r=="number")return Zu(e,r);{const n=r;return dR(e,i=>n.from<=i&&i<=n.to)!==void 0}})}$(E5e,"findCode");function Yte(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Pi(t.value)?Rg(t.value,Yte):Yte(t.value):!1}$(Yte,"isWholeOptional");var UBn=(KD=class extends mte{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){Zu(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?E5e(e,this.targetCharCodes)===void 0&&(this.found=!0):E5e(e,this.targetCharCodes)!==void 0&&(this.found=!0)}},$(KD,"CharCodeFinder"),KD);function qte(t,e){if(e instanceof RegExp){const r=$F(e),n=new UBn(t);return n.visit(r),n.found}else return dR(e,r=>Zu(t,r.charCodeAt(0)))!==void 0}$(qte,"canMatchCharCode");var pO="PATTERN",zF="defaultMode",jte="modes";function D9t(t,e){e=A5e(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` -`],tracer:$((b,x)=>x(),"tracer")});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{Z9t()});let n;r("Reject Lexer.NA",()=>{n=Ute(t,b=>b[pO]===eh.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=Hr(n,b=>{const x=b[pO];if($1(x)){const w=x.source;return w.length===1&&w!=="^"&&w!=="$"&&w!=="."&&!x.ignoreCase?w:w.length===2&&w[0]==="\\"&&!Zu(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],w[1])?w[1]:_5e(x)}else{if(B1(x))return i=!0,{exec:x};if(typeof x=="object")return i=!0,x;if(typeof x=="string"){if(x.length===1)return x;{const w=x.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),A=new RegExp(w);return _5e(A)}}else throw Error("non exhaustive match")}})});let s,o,l,u,h;r("misc mapping",()=>{s=Hr(n,b=>b.tokenTypeIdx),o=Hr(n,b=>{const x=b.GROUP;if(x!==eh.SKIPPED){if(qh(x))return x;if(F1(x))return!1;throw Error("non exhaustive match")}}),l=Hr(n,b=>{const x=b.LONGER_ALT;if(x)return Pi(x)?Hr(x,A=>J$t(n,A)):[J$t(n,x)]}),u=Hr(n,b=>b.PUSH_MODE),h=Hr(n,b=>cn(b,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const b=L5e(e.lineTerminatorCharacters);d=Hr(n,x=>!1),e.positionTracking!=="onlyOffset"&&(d=Hr(n,x=>cn(x,"LINE_BREAKS")?!!x.LINE_BREAKS:D5e(x,b)===!1&&qte(b,x.PATTERN)))});let f,p,g,m;r("Misc Mapping #2",()=>{f=Hr(n,R5e),p=Hr(a,X9t),g=sf(n,(b,x)=>{const w=x.GROUP;return qh(w)&&w!==eh.SKIPPED&&(b[w]=[]),b},{}),m=Hr(a,(b,x)=>({pattern:a[x],longerAlt:l[x],canLineTerminator:d[x],isCustom:f[x],short:p[x],group:o[x],push:u[x],pop:h[x],tokenTypeIdx:s[x],tokenType:n[x]}))});let v=!0,y=[];return e.safeMode||r("First Char Optimization",()=>{y=sf(n,(b,x,w)=>{if(typeof x.PATTERN=="string"){const A=x.PATTERN.charCodeAt(0),T=z1(A);Xte(b,T,m[w])}else if(Pi(x.START_CHARS_HINT)){let A;An(x.START_CHARS_HINT,T=>{const S=typeof T=="string"?T.charCodeAt(0):T,O=z1(S);A!==O&&(A=O,Xte(b,O,m[w]))})}else if($1(x.PATTERN))if(x.PATTERN.unicode)v=!1,e.ensureOptimizations&&Vte(`${Hte} Unable to analyze < ${x.PATTERN.toString()} > pattern. +`],tracer:$((b,x)=>x(),"tracer")});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{Z9t()});let n;r("Reject Lexer.NA",()=>{n=Ute(t,b=>b[pO]===eh.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=Hr(n,b=>{const x=b[pO];if($1(x)){const w=x.source;return w.length===1&&w!=="^"&&w!=="$"&&w!=="."&&!x.ignoreCase?w:w.length===2&&w[0]==="\\"&&!Zu(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],w[1])?w[1]:_5e(x)}else{if(B1(x))return i=!0,{exec:x};if(typeof x=="object")return i=!0,x;if(typeof x=="string"){if(x.length===1)return x;{const w=x.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),A=new RegExp(w);return _5e(A)}}else throw Error("non exhaustive match")}})});let s,o,l,u,h;r("misc mapping",()=>{s=Hr(n,b=>b.tokenTypeIdx),o=Hr(n,b=>{const x=b.GROUP;if(x!==eh.SKIPPED){if(qh(x))return x;if(F1(x))return!1;throw Error("non exhaustive match")}}),l=Hr(n,b=>{const x=b.LONGER_ALT;if(x)return Pi(x)?Hr(x,A=>J$t(n,A)):[J$t(n,x)]}),u=Hr(n,b=>b.PUSH_MODE),h=Hr(n,b=>cn(b,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const b=L5e(e.lineTerminatorCharacters);d=Hr(n,x=>!1),e.positionTracking!=="onlyOffset"&&(d=Hr(n,x=>cn(x,"LINE_BREAKS")?!!x.LINE_BREAKS:D5e(x,b)===!1&&qte(b,x.PATTERN)))});let f,p,g,m;r("Misc Mapping #2",()=>{f=Hr(n,R5e),p=Hr(a,X9t),g=sf(n,(b,x)=>{const w=x.GROUP;return qh(w)&&w!==eh.SKIPPED&&(b[w]=[]),b},{}),m=Hr(a,(b,x)=>({pattern:a[x],longerAlt:l[x],canLineTerminator:d[x],isCustom:f[x],short:p[x],group:o[x],push:u[x],pop:h[x],tokenTypeIdx:s[x],tokenType:n[x]}))});let v=!0,y=[];return e.safeMode||r("First Char Optimization",()=>{y=sf(n,(b,x,w)=>{if(typeof x.PATTERN=="string"){const A=x.PATTERN.charCodeAt(0),S=z1(A);Xte(b,S,m[w])}else if(Pi(x.START_CHARS_HINT)){let A;An(x.START_CHARS_HINT,S=>{const T=typeof S=="string"?S.charCodeAt(0):S,O=z1(T);A!==O&&(A=O,Xte(b,O,m[w]))})}else if($1(x.PATTERN))if(x.PATTERN.unicode)v=!1,e.ensureOptimizations&&Vte(`${Hte} Unable to analyze < ${x.PATTERN.toString()} > pattern. The regexp unicode flag is not currently supported by the regexp-to-ast library. This will disable the lexer's first char optimizations. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const A=_9t(x.PATTERN,e.ensureOptimizations);$a(A)&&(v=!1),An(A,T=>{Xte(b,T,m[w])})}else e.ensureOptimizations&&Vte(`${Hte} TokenType: <${x.name}> is using a custom token pattern without providing parameter. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const A=_9t(x.PATTERN,e.ensureOptimizations);$a(A)&&(v=!1),An(A,S=>{Xte(b,S,m[w])})}else e.ensureOptimizations&&Vte(`${Hte} TokenType: <${x.name}> is using a custom token pattern without providing parameter. This will disable the lexer's first char optimizations. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),v=!1;return b},[])}),{emptyGroups:g,patternIdxToConfig:m,charCodeToPatternIdxToConfig:y,hasCustom:i,canBeOptimized:v}}$(D9t,"analyzeTokenTypes");function L9t(t,e){let r=[];const n=I9t(t);r=r.concat(n.errors);const i=P9t(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(M9t(a)),r=r.concat(U9t(a)),r=r.concat(V9t(a,e)),r=r.concat(Q9t(a)),r}$(L9t,"validatePatterns");function M9t(t){let e=[];const r=Tp(t,n=>$1(n[pO]));return e=e.concat(N9t(r)),e=e.concat($9t(r)),e=e.concat(F9t(r)),e=e.concat(z9t(r)),e=e.concat(B9t(r)),e}$(M9t,"validateRegExpPattern");function I9t(t){const e=Tp(t,i=>!cn(i,pO)),r=Hr(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:js.MISSING_PATTERN,tokenTypes:[i]})),n=zte(t,e);return{errors:r,valid:n}}$(I9t,"findMissingPatterns");function P9t(t){const e=Tp(t,i=>{const a=i[pO];return!$1(a)&&!B1(a)&&!cn(a,"exec")&&!qh(a)}),r=Hr(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:js.INVALID_PATTERN,tokenTypes:[i]})),n=zte(t,e);return{errors:r,valid:n}}$(P9t,"findInvalidPatterns");var VBn=/[^\\][$]/;function N9t(t){const i=class i extends mte{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}};$(i,"EndAnchorFinder");let e=i;const r=Tp(t,a=>{const s=a.PATTERN;try{const o=$F(s),l=new e;return l.visit(o),l.found}catch{return VBn.test(s.source)}});return Hr(r,a=>({message:`Unexpected RegExp Anchor Error: + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),v=!1;return b},[])}),{emptyGroups:g,patternIdxToConfig:m,charCodeToPatternIdxToConfig:y,hasCustom:i,canBeOptimized:v}}$(D9t,"analyzeTokenTypes");function L9t(t,e){let r=[];const n=I9t(t);r=r.concat(n.errors);const i=P9t(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(M9t(a)),r=r.concat(U9t(a)),r=r.concat(V9t(a,e)),r=r.concat(Q9t(a)),r}$(L9t,"validatePatterns");function M9t(t){let e=[];const r=Sp(t,n=>$1(n[pO]));return e=e.concat(N9t(r)),e=e.concat($9t(r)),e=e.concat(F9t(r)),e=e.concat(z9t(r)),e=e.concat(B9t(r)),e}$(M9t,"validateRegExpPattern");function I9t(t){const e=Sp(t,i=>!cn(i,pO)),r=Hr(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:js.MISSING_PATTERN,tokenTypes:[i]})),n=zte(t,e);return{errors:r,valid:n}}$(I9t,"findMissingPatterns");function P9t(t){const e=Sp(t,i=>{const a=i[pO];return!$1(a)&&!B1(a)&&!cn(a,"exec")&&!qh(a)}),r=Hr(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:js.INVALID_PATTERN,tokenTypes:[i]})),n=zte(t,e);return{errors:r,valid:n}}$(P9t,"findInvalidPatterns");var VBn=/[^\\][$]/;function N9t(t){const i=class i extends mte{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}};$(i,"EndAnchorFinder");let e=i;const r=Sp(t,a=>{const s=a.PATTERN;try{const o=$F(s),l=new e;return l.visit(o),l.found}catch{return VBn.test(s.source)}});return Hr(r,a=>({message:`Unexpected RegExp Anchor Error: Token Type: ->`+a.name+`<- static 'PATTERN' cannot contain end of input anchor '$' - See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:js.EOI_ANCHOR_FOUND,tokenTypes:[a]}))}$(N9t,"findEndOfInputAnchor");function B9t(t){const e=Tp(t,n=>n.PATTERN.test(""));return Hr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:js.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}$(B9t,"findEmptyMatchRegExps");var QBn=/[^\\[][\^]|^\^/;function $9t(t){const i=class i extends mte{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}};$(i,"StartAnchorFinder");let e=i;const r=Tp(t,a=>{const s=a.PATTERN;try{const o=$F(s),l=new e;return l.visit(o),l.found}catch{return QBn.test(s.source)}});return Hr(r,a=>({message:`Unexpected RegExp Anchor Error: + See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:js.EOI_ANCHOR_FOUND,tokenTypes:[a]}))}$(N9t,"findEndOfInputAnchor");function B9t(t){const e=Sp(t,n=>n.PATTERN.test(""));return Hr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:js.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}$(B9t,"findEmptyMatchRegExps");var QBn=/[^\\[][\^]|^\^/;function $9t(t){const i=class i extends mte{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}};$(i,"StartAnchorFinder");let e=i;const r=Sp(t,a=>{const s=a.PATTERN;try{const o=$F(s),l=new e;return l.visit(o),l.found}catch{return QBn.test(s.source)}});return Hr(r,a=>({message:`Unexpected RegExp Anchor Error: Token Type: ->`+a.name+`<- static 'PATTERN' cannot contain start of input anchor '^' - See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:js.SOI_ANCHOR_FOUND,tokenTypes:[a]}))}$($9t,"findStartOfInputAnchor");function F9t(t){const e=Tp(t,n=>{const i=n[pO];return i instanceof RegExp&&(i.multiline||i.global)});return Hr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:js.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}$(F9t,"findUnsupportedFlags");function z9t(t){const e=[];let r=Hr(t,a=>sf(t,(s,o)=>(a.PATTERN.source===o.PATTERN.source&&!Zu(e,o)&&o.PATTERN!==eh.NA&&(e.push(o),s.push(o)),s),[]));r=MF(r);const n=Tp(r,a=>a.length>1);return Hr(n,a=>{const s=Hr(a,l=>l.name);return{message:`The same RegExp pattern ->${Dg(a).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:js.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})}$(z9t,"findDuplicatePatterns");function U9t(t){const e=Tp(t,n=>{if(!cn(n,"GROUP"))return!1;const i=n.GROUP;return i!==eh.SKIPPED&&i!==eh.NA&&!qh(i)});return Hr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:js.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}$(U9t,"findInvalidGroupType");function V9t(t,e){const r=Tp(t,i=>i.PUSH_MODE!==void 0&&!Zu(e,i.PUSH_MODE));return Hr(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:js.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}$(V9t,"findModesThatDoNotExist");function Q9t(t){const e=[],r=sf(t,(n,i,a)=>{const s=i.PATTERN;return s===eh.NA||(qh(s)?n.push({str:s,idx:a,tokenType:i}):$1(s)&&H9t(s)&&n.push({str:s.source,idx:a,tokenType:i})),n},[]);return An(t,(n,i)=>{An(r,({str:a,idx:s,tokenType:o})=>{if(i${o.name}<- can never be matched. + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:js.SOI_ANCHOR_FOUND,tokenTypes:[a]}))}$($9t,"findStartOfInputAnchor");function F9t(t){const e=Sp(t,n=>{const i=n[pO];return i instanceof RegExp&&(i.multiline||i.global)});return Hr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:js.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}$(F9t,"findUnsupportedFlags");function z9t(t){const e=[];let r=Hr(t,a=>sf(t,(s,o)=>(a.PATTERN.source===o.PATTERN.source&&!Zu(e,o)&&o.PATTERN!==eh.NA&&(e.push(o),s.push(o)),s),[]));r=MF(r);const n=Sp(r,a=>a.length>1);return Hr(n,a=>{const s=Hr(a,l=>l.name);return{message:`The same RegExp pattern ->${Dg(a).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:js.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})}$(z9t,"findDuplicatePatterns");function U9t(t){const e=Sp(t,n=>{if(!cn(n,"GROUP"))return!1;const i=n.GROUP;return i!==eh.SKIPPED&&i!==eh.NA&&!qh(i)});return Hr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:js.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}$(U9t,"findInvalidGroupType");function V9t(t,e){const r=Sp(t,i=>i.PUSH_MODE!==void 0&&!Zu(e,i.PUSH_MODE));return Hr(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:js.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}$(V9t,"findModesThatDoNotExist");function Q9t(t){const e=[],r=sf(t,(n,i,a)=>{const s=i.PATTERN;return s===eh.NA||(qh(s)?n.push({str:s,idx:a,tokenType:i}):$1(s)&&H9t(s)&&n.push({str:s.source,idx:a,tokenType:i})),n},[]);return An(t,(n,i)=>{An(r,({str:a,idx:s,tokenType:o})=>{if(i${o.name}<- can never be matched. Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition. See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:js.UNREACHABLE_PATTERN,tokenTypes:[n,o]})}})}),e}$(Q9t,"findUnreachablePatterns");function G9t(t,e){if($1(e)){if(W9t(e))return!1;const r=e.exec(t);return r!==null&&r.index===0}else{if(B1(e))return e(t,0,[],{});if(cn(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}$(G9t,"tryToMatchStrToPattern");function H9t(t){return dR([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}$(H9t,"noMetaChar");function W9t(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition `,type:js.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),cn(t,jte)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+jte+`> property in its definition @@ -1645,7 +1645,7 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e. `,type:js.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}$(Y9t,"performRuntimeChecks");function q9t(t,e,r){const n=[];let i=!1;const a=MF(_g(sl(t.modes))),s=Ute(a,l=>l[pO]===eh.NA),o=L5e(r);return e&&An(s,l=>{const u=D5e(l,o);if(u!==!1){const d={message:K9t(l,u),type:u.issue,tokenType:l};n.push(d)}else cn(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):qte(o,l.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found. This Lexer has been defined to track line and column information, But none of the Token Types can be identified as matching a line terminator. - See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS for details.`,type:js.NO_LINE_BREAKS_FLAGS}),n}$(q9t,"performWarningRuntimeChecks");function j9t(t){const e={},r=nf(t);return An(r,n=>{const i=t[n];if(Pi(i))e[n]=[];else throw Error("non exhaustive match")}),e}$(j9t,"cloneEmptyGroups");function R5e(t){const e=t.PATTERN;if($1(e))return!1;if(B1(e))return!0;if(cn(e,"exec"))return!0;if(qh(e))return!1;throw Error("non exhaustive match")}$(R5e,"isCustomPattern");function X9t(t){return qh(t)&&t.length===1?t.charCodeAt(0):!1}$(X9t,"isShortPattern");var GBn={test:$(function(t){const e=t.length;for(let r=this.lastIndex;r Token Type Root cause: ${e.errMsg}. @@ -1656,11 +1656,11 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e. a boolean 2nd argument is no longer supported`);this.config=af({},QF,r);const n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,a=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===QF.lineTerminatorsPattern)this.config.lineTerminatorsPattern=GBn;else if(this.config.lineTerminatorCharacters===QF.lineTerminatorCharacters)throw Error(`Error: Missing property on the Lexer config. For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Pi(e)?i={modes:{defaultMode:bc(e)},defaultMode:zF}:(a=!1,i=bc(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Y9t(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(q9t(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},An(i.modes,(o,l)=>{i.modes[l]=Ute(o,u=>F1(u))});const s=nf(i.modes);if(An(i.modes,(o,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(L9t(o,s))}),$a(this.lexerDefinitionErrors)){vR(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=D9t(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=u.charCodeToPatternIdxToConfig,this.emptyGroups=af({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!$a(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=Hr(this.lexerDefinitionErrors,u=>u.message).join(`----------------------- `);throw new Error(`Errors detected in definition of Lexer: -`+l)}An(this.lexerDefinitionWarning,o=>{S5e(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(a&&(this.handleModes=$l),this.trackStartLines===!1&&(this.computeNewColumn=wF),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=$l),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=sf(this.canModeBeOptimized,(l,u,h)=>(u===!1&&l.push(h),l),[]);if(r.ensureOptimizations&&!$a(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized. +`+l)}An(this.lexerDefinitionWarning,o=>{T5e(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(a&&(this.handleModes=$l),this.trackStartLines===!1&&(this.computeNewColumn=wF),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=$l),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=sf(this.canModeBeOptimized,(l,u,h)=>(u===!1&&l.push(h),l),[]);if(r.ensureOptimizations&&!$a(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized. Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode. Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{k9t()}),this.TRACE_INIT("toFastProperties",()=>{O5e(this)})})}tokenize(e,r=this.defaultMode){if(!$a(this.lexerDefinitionErrors)){const i=Hr(this.lexerDefinitionErrors,a=>a.message).join(`----------------------- `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer: -`+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,a,s,o,l,u,h,d,f,p,g,m,v,y;const b=e,x=b.length;let w=0,A=0;const T=this.hasCustom?0:Math.floor(e.length/10),S=new Array(T),O=[];let k=this.trackStartLines?1:void 0,E=this.trackStartLines?1:void 0;const _=j9t(this.emptyGroups),I=this.trackStartLines,L=this.config.lineTerminatorsPattern;let R=0,D=[],M=[];const P=[],N=[];Object.freeze(N);let F=!1;const B=$(Q=>{if(P.length===1&&Q.tokenType.PUSH_MODE===void 0){const G=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Q);O.push({offset:Q.startOffset,line:Q.startLine,column:Q.startColumn,length:Q.image.length,message:G})}else{P.pop();const G=fO(P);D=this.patternIdxToConfig[G],M=this.charCodeToPatternIdxToConfig[G],R=D.length;const X=this.canModeBeOptimized[G]&&this.config.safeMode===!1;M&&X?F=!0:F=!1}},"pop_mode");function V(Q){P.push(Q),M=this.charCodeToPatternIdxToConfig[Q],D=this.patternIdxToConfig[Q],R=D.length,R=D.length;const G=this.canModeBeOptimized[Q]&&this.config.safeMode===!1;M&&G?F=!0:F=!1}$(V,"push_mode"),V.call(this,r);let z;const U=this.config.recoveryEnabled;for(;wl.length){l=s,d=s.length,u=h,z=Z;break}}}break}}if(d!==-1){if(f=z.group,f!==void 0&&(l=l!==null?l:e.substring(w,w+d),p=z.tokenTypeIdx,g=this.createTokenInstance(l,w,p,z.tokenType,k,E,d),this.handlePayload(g,u),f===!1?A=this.addToken(S,A,g):_[f].push(g)),I===!0&&z.canLineTerminator===!0){let Y=0,le,q;L.lastIndex=0;do l=l!==null?l:e.substring(w,w+d),le=L.test(l),le===!0&&(q=L.lastIndex-1,Y++);while(le===!0);Y!==0?(k=k+Y,E=d-q,this.updateTokenEndLineColumnLocation(g,f,q,Y,k,E,d)):E=this.computeNewColumn(E,d)}else E=this.computeNewColumn(E,d);w=w+d,this.handleModes(z,B,V,g)}else{const Y=w,le=k,q=E;let Z=U===!1;for(;Z===!1&&w{if(P.length===1&&Q.tokenType.PUSH_MODE===void 0){const G=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Q);O.push({offset:Q.startOffset,line:Q.startLine,column:Q.startColumn,length:Q.image.length,message:G})}else{P.pop();const G=fO(P);D=this.patternIdxToConfig[G],M=this.charCodeToPatternIdxToConfig[G],R=D.length;const X=this.canModeBeOptimized[G]&&this.config.safeMode===!1;M&&X?F=!0:F=!1}},"pop_mode");function V(Q){P.push(Q),M=this.charCodeToPatternIdxToConfig[Q],D=this.patternIdxToConfig[Q],R=D.length,R=D.length;const G=this.canModeBeOptimized[Q]&&this.config.safeMode===!1;M&&G?F=!0:F=!1}$(V,"push_mode"),V.call(this,r);let z;const U=this.config.recoveryEnabled;for(;wl.length){l=s,d=s.length,u=h,z=Z;break}}}break}}if(d!==-1){if(f=z.group,f!==void 0&&(l=l!==null?l:e.substring(w,w+d),p=z.tokenTypeIdx,g=this.createTokenInstance(l,w,p,z.tokenType,k,E,d),this.handlePayload(g,u),f===!1?A=this.addToken(T,A,g):_[f].push(g)),I===!0&&z.canLineTerminator===!0){let Y=0,le,q;L.lastIndex=0;do l=l!==null?l:e.substring(w,w+d),le=L.test(l),le===!0&&(q=L.lastIndex-1,Y++);while(le===!0);Y!==0?(k=k+Y,E=d-q,this.updateTokenEndLineColumnLocation(g,f,q,Y,k,E,d)):E=this.computeNewColumn(E,d)}else E=this.computeNewColumn(E,d);w=w+d,this.handleModes(z,B,V,g)}else{const Y=w,le=k,q=E;let Z=U===!1;for(;Z===!1&&w ${gO(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){const a="Expecting: ",o=` but found: '`+Dg(e).image+"'";if(n)return a+n+o;{const l=sf(t,(f,p)=>f.concat(p),[]),u=Hr(l,f=>`[${Hr(f,p=>gO(p)).join(", ")}]`),d=`one of these possible Token sequences: ${Hr(u,(f,p)=>` ${p+1}. ${f}`).join(` @@ -1668,8 +1668,8 @@ ${Hr(u,(f,p)=>` ${p+1}. ${f}`).join(` but found: '`+Dg(e).image+"'";if(r)return i+r+s;{const l=`expecting at least one iteration which starts with one of these possible Token sequences:: <${Hr(t,u=>`[${Hr(u,h=>gO(h)).join(",")}]`).join(" ,")}>`;return i+l+s}}};Object.freeze(bR);var WBn={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- inside top level rule: ->`+t.name+"<-"}},mO={buildDuplicateFoundError(t,e){function r(h){return h instanceof os?h.terminalType.name:h instanceof Ju?h.nonTerminalName:""}$(r,"getExtraProductionArgument");const n=t.name,i=Dg(e),a=i.idx,s=Mg(i),o=r(i),l=a>0;let u=`->${s}${l?a:""}<- ${o?`with argument: ->${o}<-`:""} - appears more than once (${e.length} times) in the top level rule: ->${n}<-. - For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES + appears more than once (${e.length} times) in the top level rule: ->${n}<-. + For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES `;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,` `),u},buildNamespaceConflictError(t){return`Namespace conflict found in grammar. The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>. @@ -1690,20 +1690,20 @@ Only the last alternative may be an empty alternative.`},buildTooManyAlternative inside <${t.topLevelRule.name}> Rule. has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,r=Hr(t.leftRecursionPath,a=>a.name),n=`${e} --> ${r.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar. rule: <${e}> can be invoked from itself (directly or indirectly) -without consuming any Tokens. The grammar path that causes this is: +without consuming any Tokens. The grammar path that causes this is: ${n} To fix this refactor your grammar to remove the left recursion. -see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof fR?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function vFt(t,e){const r=new YBn(t,e);return r.resolveRefs(),r.errors}$(vFt,"resolveGrammar");var YBn=(JD=class extends pR{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){An(sl(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{const n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:th.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},$(JD,"GastRefResolverVisitor"),JD),qBn=(eL=class extends Qte{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=bc(this.path.ruleStack).reverse(),this.occurrenceStack=bc(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){$a(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},$(eL,"AbstractNextPossibleTokensWalker"),eL),jBn=(tL=class extends qBn{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=r.concat(n),a=new jh({definition:i});this.possibleTokTypes=gR(a),this.found=!0}}},$(tL,"NextAfterTokenWalker"),tL),Zte=(rL=class extends Qte{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},$(rL,"AbstractNextTerminalAfterProductionWalker"),rL),XBn=(nL=class extends Zte{walkMany(e,r,n){if(e.idx===this.occurrence){const i=Dg(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof os&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},$(nL,"NextTerminalAfterManyWalker"),nL),yFt=(iL=class extends Zte{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=Dg(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof os&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},$(iL,"NextTerminalAfterManySepWalker"),iL),KBn=(aL=class extends Zte{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=Dg(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof os&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},$(aL,"NextTerminalAfterAtLeastOneWalker"),aL),bFt=(sL=class extends Zte{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=Dg(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof os&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}},$(sL,"NextTerminalAfterAtLeastOneSepWalker"),sL);function Jte(t,e,r=[]){r=bc(r);let n=[],i=0;function a(o){return o.concat(xc(t,i+1))}$(a,"remainingPathWith");function s(o){const l=Jte(a(o),e,r);return n.concat(l)}for($(s,"getAlternativesForProd");r.length{$a(l.definition)===!1&&(n=s(l.definition))}),n;if(o instanceof os)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:xc(t,i)}),n}$(Jte,"possiblePathsFrom");function F5e(t,e,r,n){const i="EXIT_NONE_TERMINAL",a=[i],s="EXIT_ALTERNATIVE";let o=!1;const l=e.length,u=l-n-1,h=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!$a(d);){const f=d.pop();if(f===s){o&&fO(d).idx<=u&&d.pop();continue}const p=f.def,g=f.idx,m=f.ruleStack,v=f.occurrenceStack;if($a(p))continue;const y=p[0];if(y===i){const b={idx:g,def:xc(p),ruleStack:PF(m),occurrenceStack:PF(v)};d.push(b)}else if(y instanceof os)if(g=0;b--){const x=y.definition[b],w={idx:g,def:x.definition.concat(xc(p)),ruleStack:m,occurrenceStack:v};d.push(w),d.push(s)}else if(y instanceof jh)d.push({idx:g,def:y.definition.concat(xc(p)),ruleStack:m,occurrenceStack:v});else if(y instanceof fR)d.push(xFt(y,g,m,v));else throw Error("non exhaustive match")}return h}$(F5e,"nextPossibleTokensAfter");function xFt(t,e,r,n){const i=bc(r);i.push(t.name);const a=bc(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}$(xFt,"expandTopLevelRule");var ks;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(ks||(ks={}));function ere(t){if(t instanceof wc||t==="Option")return ks.OPTION;if(t instanceof qs||t==="Repetition")return ks.REPETITION;if(t instanceof of||t==="RepetitionMandatory")return ks.REPETITION_MANDATORY;if(t instanceof lf||t==="RepetitionMandatoryWithSeparator")return ks.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof Xh||t==="RepetitionWithSeparator")return ks.REPETITION_WITH_SEPARATOR;if(t instanceof Kh||t==="Alternation")return ks.ALTERNATION;throw Error("non exhaustive match")}$(ere,"getProdType");function z5e(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=ere(n);return a===ks.ALTERNATION?HF(e,r,i):WF(e,r,a,i)}$(z5e,"getLookaheadPaths");function wFt(t,e,r,n,i,a){const s=HF(t,e,r),o=Q5e(s)?VF:mR;return a(s,n,o,i)}$(wFt,"buildLookaheadFuncForOr");function AFt(t,e,r,n,i,a){const s=WF(t,e,i,r),o=Q5e(s)?VF:mR;return a(s[0],o,n)}$(AFt,"buildLookaheadFuncForOptionalProd");function TFt(t,e,r,n){const i=t.length,a=Rg(t,s=>Rg(s,o=>o.length===1));if(e)return function(s){const o=Hr(s,l=>l.GATE);for(let l=0;l_g(l)),o=sf(s,(l,u,h)=>(An(u,d=>{cn(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=h),An(d.categoryMatches,f=>{cn(l,f)||(l[f]=h)})}),l),{});return function(){const l=this.LA(1);return o[l.tokenTypeIdx]}}else return function(){for(let s=0;sa.length===1),i=t.length;if(n&&!r){const a=_g(t);if(a.length===1&&$a(a[0].categoryMatches)){const o=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const s=sf(a,(o,l,u)=>(o[l.tokenTypeIdx]=!0,An(l.categoryMatches,h=>{o[h]=!0}),o),[]);return function(){const o=this.LA(1);return s[o.tokenTypeIdx]===!0}}}else return function(){e:for(let a=0;aJte([s],1)),n=U5e(r.length),i=Hr(r,s=>{const o={};return An(s,l=>{const u=tre(l.partialPath);An(u,h=>{o[h]=!0})}),o});let a=r;for(let s=1;s<=e;s++){const o=a;a=U5e(o.length);for(let l=0;l{const y=tre(v.partialPath);An(y,b=>{i[l][b]=!0})})}}}}return n}$(V5e,"lookAheadSequenceFromAlternatives");function HF(t,e,r,n){const i=new CFt(t,ks.ALTERNATION,n);return e.accept(i),V5e(i.result,r)}$(HF,"getLookaheadPathsForOr");function WF(t,e,r,n){const i=new CFt(t,r);e.accept(i);const a=i.result,o=new ZBn(e,t,r).startWalking(),l=new jh({definition:a}),u=new jh({definition:o});return V5e([l,u],n)}$(WF,"getLookaheadPathsForOptionalProd");function rre(t,e){e:for(let r=0;r{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}$(kFt,"isStrictPrefixOfPath");function Q5e(t){return Rg(t,e=>Rg(e,r=>Rg(r,n=>$a(n.categoryMatches))))}$(Q5e,"areTokenCategoriesNotUsed");function EFt(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return Hr(e,r=>Object.assign({type:th.CUSTOM_LOOKAHEAD_VALIDATION},r))}$(EFt,"validateLookahead");function _Ft(t,e,r,n){const i=Sp(t,l=>RFt(l,r)),a=zFt(t,e,r),s=Sp(t,l=>NFt(l,r)),o=Sp(t,l=>LFt(l,t,n,r));return i.concat(a,s,o)}$(_Ft,"validateGrammar");function RFt(t,e){const r=new JBn;t.accept(r);const n=r.allProductions,i=fBn(n,DFt),a=Lg(i,o=>o.length>1);return Hr(sl(a),o=>{const l=Dg(o),u=e.buildDuplicateFoundError(t,o),h=Mg(l),d={message:u,type:th.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:h,occurrence:l.idx},f=G5e(l);return f&&(d.parameter=f),d})}$(RFt,"validateDuplicateProductions");function DFt(t){return`${Mg(t)}_#_${t.idx}_#_${G5e(t)}`}$(DFt,"identifyProductionForDuplicates");function G5e(t){return t instanceof os?t.terminalType.name:t instanceof Ju?t.nonTerminalName:""}$(G5e,"getExtraProductionArgument");var JBn=(cL=class extends pR{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}},$(cL,"OccurrenceValidationCollector"),cL);function LFt(t,e,r,n){const i=[];if(sf(e,(s,o)=>o.name===t.name?s+1:s,0)>1){const s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:th.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}$(LFt,"validateRuleDoesNotAlreadyExist");function MFt(t,e,r){const n=[];let i;return Zu(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:th.INVALID_RULE_OVERRIDE,ruleName:t})),n}$(MFt,"validateRuleIsOverridden");function H5e(t,e,r,n=[]){const i=[],a=YF(e.definition);if($a(a))return[];{const s=t.name;Zu(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:th.LEFT_RECURSION,ruleName:s});const l=zte(a,n.concat([t])),u=Sp(l,h=>{const d=bc(n);return d.push(h),H5e(t,h,r,d)});return i.concat(u)}}$(H5e,"validateNoLeftRecursion");function YF(t){let e=[];if($a(t))return e;const r=Dg(t);if(r instanceof Ju)e.push(r.referencedRule);else if(r instanceof jh||r instanceof wc||r instanceof of||r instanceof lf||r instanceof Xh||r instanceof qs)e=e.concat(YF(r.definition));else if(r instanceof Kh)e=_g(Hr(r.definition,a=>YF(a.definition)));else if(!(r instanceof os))throw Error("non exhaustive match");const n=BF(r),i=t.length>1;if(n&&i){const a=xc(t);return e.concat(YF(a))}else return e}$(YF,"getFirstNoneTerminal");var W5e=(uL=class extends pR{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}},$(uL,"OrCollector"),uL);function IFt(t,e){const r=new W5e;t.accept(r);const n=r.alternations;return Sp(n,a=>{const s=PF(a.definition);return Sp(s,(o,l)=>{const u=F5e([o],[],mR,1);return $a(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:l}),type:th.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:l+1}]:[]})})}$(IFt,"validateEmptyOrAlternative");function PFt(t,e,r){const n=new W5e;t.accept(n);let i=n.alternations;return i=Ute(i,s=>s.ignoreAmbiguities===!0),Sp(i,s=>{const o=s.idx,l=s.maxLookahead||e,u=HF(o,t,l,s),h=$Ft(u,s,t,r),d=FFt(u,s,t,r);return h.concat(d)})}$(PFt,"validateAmbiguousAlternationAlternatives");var e7n=(hL=class extends pR{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}},$(hL,"RepetitionCollector"),hL);function NFt(t,e){const r=new W5e;t.accept(r);const n=r.alternations;return Sp(n,a=>a.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:th.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}]:[])}$(NFt,"validateTooManyAlts");function BFt(t,e,r){const n=[];return An(t,i=>{const a=new e7n;i.accept(a);const s=a.allProductions;An(s,o=>{const l=ere(o),u=o.maxLookahead||e,h=o.idx,f=WF(h,i,l,u)[0];if($a(_g(f))){const p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:p,type:th.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}$(BFt,"validateSomeNonEmptyLookaheadPath");function $Ft(t,e,r,n){const i=[],a=sf(t,(o,l,u)=>(e.definition[u].ignoreAmbiguities===!0||An(l,h=>{const d=[u];An(t,(f,p)=>{u!==p&&rre(f,h)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!rre(i,h)&&(i.push(h),o.push({alts:d,path:h}))}),o),[]);return Hr(a,o=>{const l=Hr(o.alts,h=>h+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:th.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}$($Ft,"checkAlternativesAmbiguities");function FFt(t,e,r,n){const i=sf(t,(s,o,l)=>{const u=Hr(o,h=>({idx:l,path:h}));return s.concat(u)},[]);return MF(Sp(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];const l=s.idx,u=s.path,h=Tp(i,f=>e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx{const p=[f.idx+1,l+1],g=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:p,prefixPath:f.path}),type:th.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:p}})}))}$(FFt,"checkPrefixAlternativesAmbiguities");function zFt(t,e,r){const n=[],i=Hr(e,a=>a.name);return An(t,a=>{const s=a.name;if(Zu(i,s)){const o=r.buildNamespaceConflictError(a);n.push({message:o,type:th.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}$(zFt,"checkTerminalAndNoneTerminalsNameSpace");function UFt(t){const e=A5e(t,{errMsgProvider:WBn}),r={};return An(t.rules,n=>{r[n.name]=n}),vFt(r,e.errMsgProvider)}$(UFt,"resolveGrammar");function VFt(t){return t=A5e(t,{errMsgProvider:mO}),_Ft(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}$(VFt,"validateGrammar");var QFt="MismatchedTokenException",GFt="NoViableAltException",HFt="EarlyExitException",WFt="NotAllInputParsedException",YFt=[QFt,GFt,HFt,WFt];Object.freeze(YFt);function qF(t){return Zu(YFt,t.name)}$(qF,"isRecognitionException");var nre=(dL=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},$(dL,"RecognitionException"),dL),qFt=(fL=class extends nre{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=QFt}},$(fL,"MismatchedTokenException"),fL),t7n=(pL=class extends nre{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=GFt}},$(pL,"NoViableAltException"),pL),r7n=(gL=class extends nre{constructor(e,r){super(e,r),this.name=WFt}},$(gL,"NotAllInputParsedException"),gL),n7n=(mL=class extends nre{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=HFt}},$(mL,"EarlyExitException"),mL),Y5e={},jFt="InRuleRecoveryException",i7n=(vL=class extends Error{constructor(e){super(e),this.name=jFt}},$(vL,"InRuleRecoveryException"),vL),a7n=(yL=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=cn(e,"recoveryEnabled")?e.recoveryEnabled:U1.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=XFt)}getTokenToInsert(e){const r=GF(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){const a=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let l=!1;const u=this.LA(1);let h=this.LA(1);const d=$(()=>{const f=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:f,ruleName:this.getCurrRuleFullName()}),g=new qFt(p,u,this.LA(0));g.resyncedTokens=PF(o),this.SAVE_ERROR(g)},"generateErrorMessage");for(;!l;)if(this.tokenMatcher(h,i)){d();return}else if(n.call(this)){d(),e.apply(this,r);return}else this.tokenMatcher(h,a)?l=!0:(h=this.SKIP_TOKEN(),this.addToResyncTokens(h,o));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){const n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new i7n("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||$a(r))return!1;const n=this.LA(1);return dR(r,a=>this.tokenMatcher(n,a))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return Zu(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=dR(e,a=>$5e(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Y5e;const e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return Hr(e,(n,i)=>i===0?Y5e:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=Hr(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return _g(e)}getFollowSetFromFollowKey(e){if(e===Y5e)return[sw];const r=e.ruleName+e.idxInCallingRule+S9t+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,sw)||r.push(e),r}reSyncTo(e){const r=[];let n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return PF(r)}attemptInRepetitionRecovery(e,r,n,i,a,s,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=bc(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return Hr(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},$(yL,"Recoverable"),yL);function XFt(t,e,r,n,i,a,s){const o=this.getKeyForAutomaticLookahead(n,i);let l=this.firstAfterRepMap[o];if(l===void 0){const f=this.getCurrRuleFullName(),p=this.getGAstProductions()[f];l=new a(p,i).startWalking(),this.firstAfterRepMap[o]=l}let u=l.token,h=l.occurrence;const d=l.isEndOfRule;this.RULE_STACK.length===1&&d&&u===void 0&&(u=sw,h=1),!(u===void 0||h===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,h,s)&&this.tryInRepetitionRecovery(t,e,r,u)}$(XFt,"attemptInRepetitionRecovery");var s7n=4,ow=8,KFt=1<H5e(r,r,mO))}validateEmptyOrAlternatives(e){return Sp(e,r=>IFt(r,mO))}validateAmbiguousAlternationAlternatives(e,r){return Sp(e,n=>PFt(n,r,mO))}validateSomeNonEmptyLookaheadPath(e,r){return BFt(e,r,mO)}buildLookaheadForAlternation(e){return wFt(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,TFt)}buildLookaheadForOptional(e){return AFt(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,ere(e.prodType),SFt)}},$(bL,"LLkLookaheadStrategy"),bL),o7n=(xL=class{initLooksAhead(e){this.dynamicTokensEnabled=cn(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:U1.dynamicTokensEnabled,this.maxLookahead=cn(e,"maxLookahead")?e.maxLookahead:U1.maxLookahead,this.lookaheadStrategy=cn(e,"lookaheadStrategy")?e.lookaheadStrategy:new K5e({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){An(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=JFt(r);An(n,u=>{const h=u.idx===0?"":u.idx;this.TRACE_INIT(`${Mg(u)}${h}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=are(this.fullRuleNameToShort[r.name],KFt,u.idx);this.setLaFuncCache(f,d)})}),An(i,u=>{this.computeLookaheadFunc(r,u.idx,q5e,"Repetition",u.maxLookahead,Mg(u))}),An(a,u=>{this.computeLookaheadFunc(r,u.idx,ZFt,"Option",u.maxLookahead,Mg(u))}),An(s,u=>{this.computeLookaheadFunc(r,u.idx,j5e,"RepetitionMandatory",u.maxLookahead,Mg(u))}),An(o,u=>{this.computeLookaheadFunc(r,u.idx,ire,"RepetitionMandatoryWithSeparator",u.maxLookahead,Mg(u))}),An(l,u=>{this.computeLookaheadFunc(r,u.idx,X5e,"RepetitionWithSeparator",u.maxLookahead,Mg(u))})})})}computeLookaheadFunc(e,r,n,i,a,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=are(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return are(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},$(xL,"LooksAhead"),xL),l7n=(wL=class extends pR{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},$(wL,"DslMethodsCollectorVisitor"),wL),sre=new l7n;function JFt(t){sre.reset(),t.accept(sre);const e=sre.dslMethods;return sre.reset(),e}$(JFt,"collectMethods");function Z5e(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffsets.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: +see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof fR?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function vFt(t,e){const r=new YBn(t,e);return r.resolveRefs(),r.errors}$(vFt,"resolveGrammar");var YBn=(JD=class extends pR{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){An(sl(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{const n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:th.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},$(JD,"GastRefResolverVisitor"),JD),qBn=(eL=class extends Qte{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=bc(this.path.ruleStack).reverse(),this.occurrenceStack=bc(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){$a(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},$(eL,"AbstractNextPossibleTokensWalker"),eL),jBn=(tL=class extends qBn{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=r.concat(n),a=new jh({definition:i});this.possibleTokTypes=gR(a),this.found=!0}}},$(tL,"NextAfterTokenWalker"),tL),Zte=(rL=class extends Qte{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},$(rL,"AbstractNextTerminalAfterProductionWalker"),rL),XBn=(nL=class extends Zte{walkMany(e,r,n){if(e.idx===this.occurrence){const i=Dg(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof os&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},$(nL,"NextTerminalAfterManyWalker"),nL),yFt=(iL=class extends Zte{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=Dg(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof os&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},$(iL,"NextTerminalAfterManySepWalker"),iL),KBn=(aL=class extends Zte{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=Dg(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof os&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},$(aL,"NextTerminalAfterAtLeastOneWalker"),aL),bFt=(sL=class extends Zte{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=Dg(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof os&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}},$(sL,"NextTerminalAfterAtLeastOneSepWalker"),sL);function Jte(t,e,r=[]){r=bc(r);let n=[],i=0;function a(o){return o.concat(xc(t,i+1))}$(a,"remainingPathWith");function s(o){const l=Jte(a(o),e,r);return n.concat(l)}for($(s,"getAlternativesForProd");r.length{$a(l.definition)===!1&&(n=s(l.definition))}),n;if(o instanceof os)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:xc(t,i)}),n}$(Jte,"possiblePathsFrom");function F5e(t,e,r,n){const i="EXIT_NONE_TERMINAL",a=[i],s="EXIT_ALTERNATIVE";let o=!1;const l=e.length,u=l-n-1,h=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!$a(d);){const f=d.pop();if(f===s){o&&fO(d).idx<=u&&d.pop();continue}const p=f.def,g=f.idx,m=f.ruleStack,v=f.occurrenceStack;if($a(p))continue;const y=p[0];if(y===i){const b={idx:g,def:xc(p),ruleStack:PF(m),occurrenceStack:PF(v)};d.push(b)}else if(y instanceof os)if(g=0;b--){const x=y.definition[b],w={idx:g,def:x.definition.concat(xc(p)),ruleStack:m,occurrenceStack:v};d.push(w),d.push(s)}else if(y instanceof jh)d.push({idx:g,def:y.definition.concat(xc(p)),ruleStack:m,occurrenceStack:v});else if(y instanceof fR)d.push(xFt(y,g,m,v));else throw Error("non exhaustive match")}return h}$(F5e,"nextPossibleTokensAfter");function xFt(t,e,r,n){const i=bc(r);i.push(t.name);const a=bc(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}$(xFt,"expandTopLevelRule");var ks;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(ks||(ks={}));function ere(t){if(t instanceof wc||t==="Option")return ks.OPTION;if(t instanceof qs||t==="Repetition")return ks.REPETITION;if(t instanceof of||t==="RepetitionMandatory")return ks.REPETITION_MANDATORY;if(t instanceof lf||t==="RepetitionMandatoryWithSeparator")return ks.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof Xh||t==="RepetitionWithSeparator")return ks.REPETITION_WITH_SEPARATOR;if(t instanceof Kh||t==="Alternation")return ks.ALTERNATION;throw Error("non exhaustive match")}$(ere,"getProdType");function z5e(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=ere(n);return a===ks.ALTERNATION?HF(e,r,i):WF(e,r,a,i)}$(z5e,"getLookaheadPaths");function wFt(t,e,r,n,i,a){const s=HF(t,e,r),o=Q5e(s)?VF:mR;return a(s,n,o,i)}$(wFt,"buildLookaheadFuncForOr");function AFt(t,e,r,n,i,a){const s=WF(t,e,i,r),o=Q5e(s)?VF:mR;return a(s[0],o,n)}$(AFt,"buildLookaheadFuncForOptionalProd");function SFt(t,e,r,n){const i=t.length,a=Rg(t,s=>Rg(s,o=>o.length===1));if(e)return function(s){const o=Hr(s,l=>l.GATE);for(let l=0;l_g(l)),o=sf(s,(l,u,h)=>(An(u,d=>{cn(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=h),An(d.categoryMatches,f=>{cn(l,f)||(l[f]=h)})}),l),{});return function(){const l=this.LA(1);return o[l.tokenTypeIdx]}}else return function(){for(let s=0;sa.length===1),i=t.length;if(n&&!r){const a=_g(t);if(a.length===1&&$a(a[0].categoryMatches)){const o=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const s=sf(a,(o,l,u)=>(o[l.tokenTypeIdx]=!0,An(l.categoryMatches,h=>{o[h]=!0}),o),[]);return function(){const o=this.LA(1);return s[o.tokenTypeIdx]===!0}}}else return function(){e:for(let a=0;aJte([s],1)),n=U5e(r.length),i=Hr(r,s=>{const o={};return An(s,l=>{const u=tre(l.partialPath);An(u,h=>{o[h]=!0})}),o});let a=r;for(let s=1;s<=e;s++){const o=a;a=U5e(o.length);for(let l=0;l{const y=tre(v.partialPath);An(y,b=>{i[l][b]=!0})})}}}}return n}$(V5e,"lookAheadSequenceFromAlternatives");function HF(t,e,r,n){const i=new CFt(t,ks.ALTERNATION,n);return e.accept(i),V5e(i.result,r)}$(HF,"getLookaheadPathsForOr");function WF(t,e,r,n){const i=new CFt(t,r);e.accept(i);const a=i.result,o=new ZBn(e,t,r).startWalking(),l=new jh({definition:a}),u=new jh({definition:o});return V5e([l,u],n)}$(WF,"getLookaheadPathsForOptionalProd");function rre(t,e){e:for(let r=0;r{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}$(kFt,"isStrictPrefixOfPath");function Q5e(t){return Rg(t,e=>Rg(e,r=>Rg(r,n=>$a(n.categoryMatches))))}$(Q5e,"areTokenCategoriesNotUsed");function EFt(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return Hr(e,r=>Object.assign({type:th.CUSTOM_LOOKAHEAD_VALIDATION},r))}$(EFt,"validateLookahead");function _Ft(t,e,r,n){const i=Tp(t,l=>RFt(l,r)),a=zFt(t,e,r),s=Tp(t,l=>NFt(l,r)),o=Tp(t,l=>LFt(l,t,n,r));return i.concat(a,s,o)}$(_Ft,"validateGrammar");function RFt(t,e){const r=new JBn;t.accept(r);const n=r.allProductions,i=fBn(n,DFt),a=Lg(i,o=>o.length>1);return Hr(sl(a),o=>{const l=Dg(o),u=e.buildDuplicateFoundError(t,o),h=Mg(l),d={message:u,type:th.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:h,occurrence:l.idx},f=G5e(l);return f&&(d.parameter=f),d})}$(RFt,"validateDuplicateProductions");function DFt(t){return`${Mg(t)}_#_${t.idx}_#_${G5e(t)}`}$(DFt,"identifyProductionForDuplicates");function G5e(t){return t instanceof os?t.terminalType.name:t instanceof Ju?t.nonTerminalName:""}$(G5e,"getExtraProductionArgument");var JBn=(cL=class extends pR{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}},$(cL,"OccurrenceValidationCollector"),cL);function LFt(t,e,r,n){const i=[];if(sf(e,(s,o)=>o.name===t.name?s+1:s,0)>1){const s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:th.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}$(LFt,"validateRuleDoesNotAlreadyExist");function MFt(t,e,r){const n=[];let i;return Zu(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:th.INVALID_RULE_OVERRIDE,ruleName:t})),n}$(MFt,"validateRuleIsOverridden");function H5e(t,e,r,n=[]){const i=[],a=YF(e.definition);if($a(a))return[];{const s=t.name;Zu(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:th.LEFT_RECURSION,ruleName:s});const l=zte(a,n.concat([t])),u=Tp(l,h=>{const d=bc(n);return d.push(h),H5e(t,h,r,d)});return i.concat(u)}}$(H5e,"validateNoLeftRecursion");function YF(t){let e=[];if($a(t))return e;const r=Dg(t);if(r instanceof Ju)e.push(r.referencedRule);else if(r instanceof jh||r instanceof wc||r instanceof of||r instanceof lf||r instanceof Xh||r instanceof qs)e=e.concat(YF(r.definition));else if(r instanceof Kh)e=_g(Hr(r.definition,a=>YF(a.definition)));else if(!(r instanceof os))throw Error("non exhaustive match");const n=BF(r),i=t.length>1;if(n&&i){const a=xc(t);return e.concat(YF(a))}else return e}$(YF,"getFirstNoneTerminal");var W5e=(uL=class extends pR{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}},$(uL,"OrCollector"),uL);function IFt(t,e){const r=new W5e;t.accept(r);const n=r.alternations;return Tp(n,a=>{const s=PF(a.definition);return Tp(s,(o,l)=>{const u=F5e([o],[],mR,1);return $a(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:l}),type:th.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:l+1}]:[]})})}$(IFt,"validateEmptyOrAlternative");function PFt(t,e,r){const n=new W5e;t.accept(n);let i=n.alternations;return i=Ute(i,s=>s.ignoreAmbiguities===!0),Tp(i,s=>{const o=s.idx,l=s.maxLookahead||e,u=HF(o,t,l,s),h=$Ft(u,s,t,r),d=FFt(u,s,t,r);return h.concat(d)})}$(PFt,"validateAmbiguousAlternationAlternatives");var e7n=(hL=class extends pR{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}},$(hL,"RepetitionCollector"),hL);function NFt(t,e){const r=new W5e;t.accept(r);const n=r.alternations;return Tp(n,a=>a.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:th.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}]:[])}$(NFt,"validateTooManyAlts");function BFt(t,e,r){const n=[];return An(t,i=>{const a=new e7n;i.accept(a);const s=a.allProductions;An(s,o=>{const l=ere(o),u=o.maxLookahead||e,h=o.idx,f=WF(h,i,l,u)[0];if($a(_g(f))){const p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:p,type:th.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}$(BFt,"validateSomeNonEmptyLookaheadPath");function $Ft(t,e,r,n){const i=[],a=sf(t,(o,l,u)=>(e.definition[u].ignoreAmbiguities===!0||An(l,h=>{const d=[u];An(t,(f,p)=>{u!==p&&rre(f,h)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!rre(i,h)&&(i.push(h),o.push({alts:d,path:h}))}),o),[]);return Hr(a,o=>{const l=Hr(o.alts,h=>h+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:th.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}$($Ft,"checkAlternativesAmbiguities");function FFt(t,e,r,n){const i=sf(t,(s,o,l)=>{const u=Hr(o,h=>({idx:l,path:h}));return s.concat(u)},[]);return MF(Tp(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];const l=s.idx,u=s.path,h=Sp(i,f=>e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx{const p=[f.idx+1,l+1],g=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:p,prefixPath:f.path}),type:th.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:p}})}))}$(FFt,"checkPrefixAlternativesAmbiguities");function zFt(t,e,r){const n=[],i=Hr(e,a=>a.name);return An(t,a=>{const s=a.name;if(Zu(i,s)){const o=r.buildNamespaceConflictError(a);n.push({message:o,type:th.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}$(zFt,"checkTerminalAndNoneTerminalsNameSpace");function UFt(t){const e=A5e(t,{errMsgProvider:WBn}),r={};return An(t.rules,n=>{r[n.name]=n}),vFt(r,e.errMsgProvider)}$(UFt,"resolveGrammar");function VFt(t){return t=A5e(t,{errMsgProvider:mO}),_Ft(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}$(VFt,"validateGrammar");var QFt="MismatchedTokenException",GFt="NoViableAltException",HFt="EarlyExitException",WFt="NotAllInputParsedException",YFt=[QFt,GFt,HFt,WFt];Object.freeze(YFt);function qF(t){return Zu(YFt,t.name)}$(qF,"isRecognitionException");var nre=(dL=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},$(dL,"RecognitionException"),dL),qFt=(fL=class extends nre{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=QFt}},$(fL,"MismatchedTokenException"),fL),t7n=(pL=class extends nre{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=GFt}},$(pL,"NoViableAltException"),pL),r7n=(gL=class extends nre{constructor(e,r){super(e,r),this.name=WFt}},$(gL,"NotAllInputParsedException"),gL),n7n=(mL=class extends nre{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=HFt}},$(mL,"EarlyExitException"),mL),Y5e={},jFt="InRuleRecoveryException",i7n=(vL=class extends Error{constructor(e){super(e),this.name=jFt}},$(vL,"InRuleRecoveryException"),vL),a7n=(yL=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=cn(e,"recoveryEnabled")?e.recoveryEnabled:U1.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=XFt)}getTokenToInsert(e){const r=GF(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){const a=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let l=!1;const u=this.LA(1);let h=this.LA(1);const d=$(()=>{const f=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:f,ruleName:this.getCurrRuleFullName()}),g=new qFt(p,u,this.LA(0));g.resyncedTokens=PF(o),this.SAVE_ERROR(g)},"generateErrorMessage");for(;!l;)if(this.tokenMatcher(h,i)){d();return}else if(n.call(this)){d(),e.apply(this,r);return}else this.tokenMatcher(h,a)?l=!0:(h=this.SKIP_TOKEN(),this.addToResyncTokens(h,o));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){const n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new i7n("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||$a(r))return!1;const n=this.LA(1);return dR(r,a=>this.tokenMatcher(n,a))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return Zu(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=dR(e,a=>$5e(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Y5e;const e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return Hr(e,(n,i)=>i===0?Y5e:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=Hr(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return _g(e)}getFollowSetFromFollowKey(e){if(e===Y5e)return[sw];const r=e.ruleName+e.idxInCallingRule+T9t+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,sw)||r.push(e),r}reSyncTo(e){const r=[];let n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return PF(r)}attemptInRepetitionRecovery(e,r,n,i,a,s,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=bc(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return Hr(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},$(yL,"Recoverable"),yL);function XFt(t,e,r,n,i,a,s){const o=this.getKeyForAutomaticLookahead(n,i);let l=this.firstAfterRepMap[o];if(l===void 0){const f=this.getCurrRuleFullName(),p=this.getGAstProductions()[f];l=new a(p,i).startWalking(),this.firstAfterRepMap[o]=l}let u=l.token,h=l.occurrence;const d=l.isEndOfRule;this.RULE_STACK.length===1&&d&&u===void 0&&(u=sw,h=1),!(u===void 0||h===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,h,s)&&this.tryInRepetitionRecovery(t,e,r,u)}$(XFt,"attemptInRepetitionRecovery");var s7n=4,ow=8,KFt=1<H5e(r,r,mO))}validateEmptyOrAlternatives(e){return Tp(e,r=>IFt(r,mO))}validateAmbiguousAlternationAlternatives(e,r){return Tp(e,n=>PFt(n,r,mO))}validateSomeNonEmptyLookaheadPath(e,r){return BFt(e,r,mO)}buildLookaheadForAlternation(e){return wFt(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,SFt)}buildLookaheadForOptional(e){return AFt(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,ere(e.prodType),TFt)}},$(bL,"LLkLookaheadStrategy"),bL),o7n=(xL=class{initLooksAhead(e){this.dynamicTokensEnabled=cn(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:U1.dynamicTokensEnabled,this.maxLookahead=cn(e,"maxLookahead")?e.maxLookahead:U1.maxLookahead,this.lookaheadStrategy=cn(e,"lookaheadStrategy")?e.lookaheadStrategy:new K5e({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){An(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=JFt(r);An(n,u=>{const h=u.idx===0?"":u.idx;this.TRACE_INIT(`${Mg(u)}${h}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=are(this.fullRuleNameToShort[r.name],KFt,u.idx);this.setLaFuncCache(f,d)})}),An(i,u=>{this.computeLookaheadFunc(r,u.idx,q5e,"Repetition",u.maxLookahead,Mg(u))}),An(a,u=>{this.computeLookaheadFunc(r,u.idx,ZFt,"Option",u.maxLookahead,Mg(u))}),An(s,u=>{this.computeLookaheadFunc(r,u.idx,j5e,"RepetitionMandatory",u.maxLookahead,Mg(u))}),An(o,u=>{this.computeLookaheadFunc(r,u.idx,ire,"RepetitionMandatoryWithSeparator",u.maxLookahead,Mg(u))}),An(l,u=>{this.computeLookaheadFunc(r,u.idx,X5e,"RepetitionWithSeparator",u.maxLookahead,Mg(u))})})})}computeLookaheadFunc(e,r,n,i,a,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=are(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return are(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},$(xL,"LooksAhead"),xL),l7n=(wL=class extends pR{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},$(wL,"DslMethodsCollectorVisitor"),wL),sre=new l7n;function JFt(t){sre.reset(),t.accept(sre);const e=sre.dslMethods;return sre.reset(),e}$(JFt,"collectMethods");function Z5e(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffsets.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: ${a.join(` `).replace(/\n/g,` - `)}`)}},"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}$(nzt,"createBaseSemanticVisitorConstructor");function izt(t,e,r){const n=$(function(){},"derivedConstructor");e4e(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return An(e,a=>{i[a]=rzt}),n.prototype=i,n.prototype.constructor=n,n}$(izt,"createBaseVisitorConstructorWithDefaults");var t4e;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(t4e||(t4e={}));function azt(t,e){return szt(t,e)}$(azt,"validateVisitor");function szt(t,e){const r=Tp(e,i=>B1(t[i])===!1),n=Hr(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:t4e.MISSING_METHOD,methodName:i}));return MF(n)}$(szt,"validateMissingCstMethods");var u7n=(AL=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=cn(e,"nodeLocationTracking")?e.nodeLocationTracking:U1.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=$l,this.cstFinallyStateUpdate=$l,this.cstPostTerminal=$l,this.cstPostNonTerminal=$l,this.cstPostRule=$l;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=J5e,this.setNodeLocationFromNode=J5e,this.cstPostRule=$l,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=$l,this.setNodeLocationFromNode=$l,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Z5e,this.setNodeLocationFromNode=Z5e,this.cstPostRule=$l,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=$l,this.setNodeLocationFromNode=$l,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=$l,this.setNodeLocationFromNode=$l,this.cstPostRule=$l,this.setInitialNodeLocation=$l;else throw Error(`Invalid config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];ezt(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];tzt(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(F1(this.baseCstVisitorConstructor)){const e=nzt(this.className,nf(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(F1(this.baseCstVisitorWithDefaultsConstructor)){const e=izt(this.className,nf(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},$(AL,"TreeBuilder"),AL),h7n=(TL=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):lre}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?lre:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},$(TL,"LexerAdapter"),TL),d7n=(SL=class{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=cre){if(Zu(this.definedRulesNames,e)){const s={message:mO.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:th.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);const i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=cre){const i=MFt(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const a=this.defineRule(e,r,n);return this[e]=a,a}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(qF(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return y9t(sl(this.gastProductionsCache))}},$(SL,"RecognizerApi"),SL),f7n=(CL=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=VF,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},cn(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. + `)}`)}},"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}$(nzt,"createBaseSemanticVisitorConstructor");function izt(t,e,r){const n=$(function(){},"derivedConstructor");e4e(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return An(e,a=>{i[a]=rzt}),n.prototype=i,n.prototype.constructor=n,n}$(izt,"createBaseVisitorConstructorWithDefaults");var t4e;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(t4e||(t4e={}));function azt(t,e){return szt(t,e)}$(azt,"validateVisitor");function szt(t,e){const r=Sp(e,i=>B1(t[i])===!1),n=Hr(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:t4e.MISSING_METHOD,methodName:i}));return MF(n)}$(szt,"validateMissingCstMethods");var u7n=(AL=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=cn(e,"nodeLocationTracking")?e.nodeLocationTracking:U1.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=$l,this.cstFinallyStateUpdate=$l,this.cstPostTerminal=$l,this.cstPostNonTerminal=$l,this.cstPostRule=$l;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=J5e,this.setNodeLocationFromNode=J5e,this.cstPostRule=$l,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=$l,this.setNodeLocationFromNode=$l,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Z5e,this.setNodeLocationFromNode=Z5e,this.cstPostRule=$l,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=$l,this.setNodeLocationFromNode=$l,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=$l,this.setNodeLocationFromNode=$l,this.cstPostRule=$l,this.setInitialNodeLocation=$l;else throw Error(`Invalid config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];ezt(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];tzt(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(F1(this.baseCstVisitorConstructor)){const e=nzt(this.className,nf(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(F1(this.baseCstVisitorWithDefaultsConstructor)){const e=izt(this.className,nf(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},$(AL,"TreeBuilder"),AL),h7n=(SL=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):lre}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?lre:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},$(SL,"LexerAdapter"),SL),d7n=(TL=class{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=cre){if(Zu(this.definedRulesNames,e)){const s={message:mO.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:th.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);const i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=cre){const i=MFt(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const a=this.defineRule(e,r,n);return this[e]=a,a}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(qF(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return y9t(sl(this.gastProductionsCache))}},$(TL,"RecognizerApi"),TL),f7n=(CL=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=VF,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},cn(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0 For Further details.`);if(Pi(e)){if($a(e))throw Error(`A Token Vocabulary cannot be empty. Note that the first argument for the parser constructor is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument. See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0 - For Further details.`)}if(Pi(e))this.tokensMap=sf(e,(a,s)=>(a[s.name]=s,a),{});else if(cn(e,"modes")&&Rg(_g(sl(e.modes)),oFt)){const a=_g(sl(e.modes)),s=T5e(a);this.tokensMap=sf(s,(o,l)=>(o[l.name]=l,o),{})}else if(Ap(e))this.tokensMap=bc(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=sw;const n=cn(e,"modes")?_g(sl(e.modes)):sl(e),i=Rg(n,a=>$a(a.categoryMatches));this.tokenMatcher=i?VF:mR,vR(sl(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called' + For Further details.`)}if(Pi(e))this.tokensMap=sf(e,(a,s)=>(a[s.name]=s,a),{});else if(cn(e,"modes")&&Rg(_g(sl(e.modes)),oFt)){const a=_g(sl(e.modes)),s=S5e(a);this.tokensMap=sf(s,(o,l)=>(o[l.name]=l,o),{})}else if(Ap(e))this.tokensMap=bc(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=sw;const n=cn(e,"modes")?_g(sl(e.modes)):sl(e),i=Rg(n,a=>$a(a.categoryMatches));this.tokenMatcher=i?VF:mR,vR(sl(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called' Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=cn(n,"resyncEnabled")?n.resyncEnabled:cre.resyncEnabled,a=cn(n,"recoveryValueFunc")?n.recoveryValueFunc:cre.recoveryValueFunc,s=this.ruleShortNameIdx<s.call(this)&&o.call(this),"lookAheadFunc")}}else a=e;if(i.call(this)===!0)return a.call(this)}atLeastOneInternal(e,r){const n=this.getKeyForAutomaticLookahead(j5e,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const s=r.GATE;if(s!==void 0){const o=i;i=$(()=>s.call(this)&&o.call(this),"lookAheadFunc")}}else a=r;if(i.call(this)===!0){let s=this.doSingleRepetition(a);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a)}else throw this.raiseEarlyExitException(e,ks.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,j5e,e,KBn)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(ire,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=$(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,bFt],o,ire,e,bFt)}else throw this.raiseEarlyExitException(e,ks.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(q5e,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const o=r.GATE;if(o!==void 0){const l=i;i=$(()=>o.call(this)&&l.call(this),"lookaheadFunction")}}else a=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,q5e,e,XBn,s)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(X5e,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=$(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,yFt],o,X5e,e,yFt)}}repetitionSepSecondInternal(e,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,a],n,ire,e,a)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(KFt,r),i=Pi(e)?e:e.DEF,s=this.getLaFuncFromCache(n).call(this,i);if(s!==void 0)return i[s].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new r7n(r,e))}}subruleInternal(e,r,n){let i;try{const a=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,a),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(a){throw this.subruleInternalError(a,n,e.ruleName)}}subruleInternalError(e,r,n){throw qF(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{const a=this.LA(1);this.tokenMatcher(a,e)===!0?(this.consumeToken(),i=a):this.consumeInternalError(e,a,n)}catch(a){i=this.consumeInternalRecovery(e,r,a)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i;const a=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:a,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new qFt(i,r,a))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(a){throw a.name===jFt?n:a}}else throw n}saveRecogState(){const e=this.errors,r=bc(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),sw)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},$(CL,"RecognizerEngine"),CL),p7n=(OL=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=cn(e,"errorMessageProvider")?e.errorMessageProvider:U1.errorMessageProvider}SAVE_ERROR(e){if(qF(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:bc(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return bc(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],o=WF(e,a,r,this.maxLookahead)[0],l=[];for(let h=1;h<=this.maxLookahead;h++)l.push(this.LA(h));const u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:l,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new n7n(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=HF(e,i,this.maxLookahead),s=[];for(let u=1;u<=this.maxLookahead;u++)s.push(this.LA(u));const o=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:s,previous:o,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new t7n(l,this.LA(1),o))}},$(OL,"ErrorHandler"),OL),g7n=(kL=class{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if(F1(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return F5e([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=Dg(e.ruleStack),i=this.getGAstProductions()[r];return new jBn(i,e).startWalking()}},$(kL,"ContentAssist"),kL),ore={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(ore);var ozt=!0,lzt=Math.pow(2,ow)-1,czt=yR({name:"RECORDING_PHASE_TOKEN",pattern:eh.NA});vR([czt]);var uzt=GF(czt,`This IToken indicates the Parser is in Recording Phase See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(uzt);var m7n={name:`This CSTNode indicates the Parser is in Recording Phase See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},v7n=(EL=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let r=0;r<10;r++){const n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return lre}topLevelRuleRecord(e,r){try{const n=new fR({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+` @@ -1717,11 +1717,11 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis `)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),cn(r,"ignoredIssues"))throw new Error(`The IParserConfig property has been deprecated. Please use the flag on the relevant DSL method instead. See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES - For further details.`);this.skipValidations=cn(r,"skipValidations")?r.skipValidations:U1.skipValidations}},$(KO,"Parser"),KO);i4e.DEFER_DEFINITION_ERRORS_HANDLING=!1,dzt(i4e,[a7n,o7n,u7n,h7n,f7n,d7n,p7n,g7n,v7n,y7n]);var b7n=(RL=class extends i4e{constructor(e,r=U1){const n=bc(r);n.outputCst=!1,super(e,n)}},$(RL,"EmbeddedActionsParser"),RL);function fzt(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r-1}$(wzt,"listCacheHas");var C7n=wzt;function Azt(t,e){var r=this.__data__,n=ure(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}$(Azt,"listCacheSet");var O7n=Azt;function vO(t){var e=-1,r=t==null?0:t.length;for(this.clear();++eo))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&L$n?new iUt:void 0;for(a.set(t,e),a.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=f9n}$(MUt,"isLength");var c4e=MUt,p9n="[object Arguments]",g9n="[object Array]",m9n="[object Boolean]",v9n="[object Date]",y9n="[object Error]",b9n="[object Function]",x9n="[object Map]",w9n="[object Number]",A9n="[object Object]",T9n="[object RegExp]",S9n="[object Set]",C9n="[object String]",O9n="[object WeakMap]",k9n="[object ArrayBuffer]",E9n="[object DataView]",_9n="[object Float32Array]",R9n="[object Float64Array]",D9n="[object Int8Array]",L9n="[object Int16Array]",M9n="[object Int32Array]",I9n="[object Uint8Array]",P9n="[object Uint8ClampedArray]",N9n="[object Uint16Array]",B9n="[object Uint32Array]",ls={};ls[_9n]=ls[R9n]=ls[D9n]=ls[L9n]=ls[M9n]=ls[I9n]=ls[P9n]=ls[N9n]=ls[B9n]=!0,ls[p9n]=ls[g9n]=ls[k9n]=ls[m9n]=ls[E9n]=ls[v9n]=ls[y9n]=ls[b9n]=ls[x9n]=ls[w9n]=ls[A9n]=ls[T9n]=ls[S9n]=ls[C9n]=ls[O9n]=!1;function IUt(t){return TR(t)&&c4e(t.length)&&!!ls[wR(t)]}$(IUt,"baseIsTypedArray");var $9n=IUt;function PUt(t){return function(e){return t(e)}}$(PUt,"baseUnary");var F9n=PUt,NUt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ez=NUt&&typeof module=="object"&&module&&!module.nodeType&&module,z9n=ez&&ez.exports===NUt,u4e=z9n&&kzt.process,U9n=function(){try{var t=ez&&ez.require&&ez.require("util").types;return t||u4e&&u4e.binding&&u4e.binding("util")}catch{}}(),BUt=U9n,$Ut=BUt&&BUt.isTypedArray,V9n=$Ut?F9n($Ut):$9n,h4e=V9n,Q9n=Object.prototype,G9n=Q9n.hasOwnProperty;function FUt(t,e){var r=rh(t),n=!r&&gre(t),i=!r&&!n&&mre(t),a=!r&&!n&&!i&&h4e(t),s=r||n||i||a,o=s?r9n(t.length,String):[],l=o.length;for(var u in t)(e||G9n.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||LUt(u,l)))&&o.push(u);return o}$(FUt,"arrayLikeKeys");var H9n=FUt,W9n=Object.prototype;function zUt(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||W9n;return t===r}$(zUt,"isPrototype");var UUt=zUt;function VUt(t,e){return function(r){return t(e(r))}}$(VUt,"overArg");var Y9n=VUt,q9n=Y9n(Object.keys,Object),j9n=q9n,X9n=Object.prototype,K9n=X9n.hasOwnProperty;function QUt(t){if(!UUt(t))return j9n(t);var e=[];for(var r in Object(t))K9n.call(t,r)&&r!="constructor"&&e.push(r);return e}$(QUt,"baseKeys");var GUt=QUt;function HUt(t){return t!=null&&c4e(t.length)&&!Pzt(t)}$(HUt,"isArrayLike");var vre=HUt;function WUt(t){return vre(t)?H9n(t):GUt(t)}$(WUt,"keys");var d4e=WUt;function YUt(t){return X$n(t,d4e,t9n)}$(YUt,"getAllKeys");var qUt=YUt,Z9n=1,J9n=Object.prototype,eFn=J9n.hasOwnProperty;function jUt(t,e,r,n,i,a){var s=r&Z9n,o=qUt(t),l=o.length,u=qUt(e),h=u.length;if(l!=h&&!s)return!1;for(var d=l;d--;){var f=o[d];if(!(s?f in e:eFn.call(e,f)))return!1}var p=a.get(t),g=a.get(e);if(p&&g)return p==e&&g==t;var m=!0;a.set(t,e),a.set(e,t);for(var v=s;++dS4e(t,e,s));return SO(t,e,n,r,...i)}$(KVt,"alternation");function ZVt(t,e,r){const n=ol(t,e,r,{type:lw});G1(t,n);const i=SO(t,e,n,r,cw(t,e,r));return JVt(t,e,r,i)}$(ZVt,"option");function cw(t,e,r){const n=KFn(Q1(r.definition,i=>S4e(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:tQt(t,n)}$(cw,"block");function C4e(t,e,r,n,i){const a=n.left,s=n.right,o=ol(t,e,r,{type:rzn});G1(t,o);const l=ol(t,e,r,{type:QVt});return a.loopback=o,l.loopback=o,t.decisionMap[TO(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,po(s,o),i===void 0?(po(o,a),po(o,l)):(po(o,l),po(o,i.left),po(i.right,a)),{left:a,right:l}}$(C4e,"plus");function O4e(t,e,r,n,i){const a=n.left,s=n.right,o=ol(t,e,r,{type:tzn});G1(t,o);const l=ol(t,e,r,{type:QVt}),u=ol(t,e,r,{type:ezn});return o.loopback=u,l.loopback=u,po(o,a),po(o,l),po(s,u),i!==void 0?(po(u,l),po(u,i.left),po(i.right,a)):po(u,o),t.decisionMap[TO(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}$(O4e,"star");function JVt(t,e,r,n){const i=n.left,a=n.right;return po(i,a),t.decisionMap[TO(e,"Option",r.idx)]=i,n}$(JVt,"optional");function G1(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}$(G1,"defineDecisionState");function SO(t,e,r,n,...i){const a=ol(t,e,n,{type:JFn,start:r});r.end=a;for(const o of i)o!==void 0?(po(r,o.left),po(o.right,a)):po(r,a);const s={left:r,right:a};return t.decisionMap[TO(e,eQt(n),n.idx)]=r,s}$(SO,"makeAlts");function eQt(t){if(t instanceof Kh)return"Alternation";if(t instanceof wc)return"Option";if(t instanceof qs)return"Repetition";if(t instanceof Xh)return"RepetitionWithSeparator";if(t instanceof of)return"RepetitionMandatory";if(t instanceof lf)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}$(eQt,"getProdType");function tQt(t,e){const r=e.length;for(let a=0;ae.alt)}get key(){let e="";for(const r in this.map)e+=r+":";return e}},$(PL,"ATNConfigSet"),PL);function E4e(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}$(E4e,"getATNConfigKey");function aQt(t,e,r){for(var n=-1,i=t.length;++n0&&r(o)?e>1?_4e(o,e-1,r,n,i):mUt(i,o):n||(i[i.length]=o)}return i}$(_4e,"baseFlatten");var uQt=_4e;function hQt(t,e){return uQt(Q1(t,e),1)}$(hQt,"flatMap");var ozn=hQt;function dQt(t,e,r,n){for(var i=t.length,a=r+(n?1:-1);n?a--:++a-1}$(mQt,"arrayIncludes");var dzn=mQt;function vQt(t,e,r){for(var n=-1,i=t==null?0:t.length;++n=yzn){var u=e?null:vzn(t);if(u)return o4e(u);s=!1,i=oUt,l=new iUt}else l=e?[]:o;e:for(;++n{const i=n.toString();let a=r[i];return a!==void 0||(a={atnStartState:t,decision:e,states:{}},r[i]=a),a}}$(RQt,"createDFACache");var DQt=(NL=class{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="";const r=this.predicates.length;for(let n=0;nconsole.log(n)}initialize(e){this.atn=HVt(e.rules),this.dfas=MQt(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=TO(n,"Alternation",r),h=this.atn.decisionMap[l].decision,d=Q1(z5e({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),f=>Q1(f,p=>p[0]));if(D4e(d,!1)&&!a){const f=_Qt(d,(p,g,m)=>(R4e(g,v=>{v&&(p[v.tokenTypeIdx]=m,R4e(v.categoryMatches,y=>{p[y]=m}))}),p),{});return i?function(p){var g;const m=this.LA(1),v=f[m.tokenTypeIdx];if(p!==void 0&&v!==void 0){const y=(g=p[v])===null||g===void 0?void 0:g.GATE;if(y!==void 0&&y.call(this)===!1)return}return v}:function(){const p=this.LA(1);return f[p.tokenTypeIdx]}}else return i?function(f){const p=new DQt,g=f===void 0?0:f.length;for(let v=0;vQ1(f,p=>p[0]));if(D4e(d)&&d[0][0]&&!a){const f=d[0],p=wzn(f);if(p.length===1&&Ezn(p[0].categoryMatches)){const m=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===m}}else{const g=_Qt(p,(m,v)=>(v!==void 0&&(m[v.tokenTypeIdx]=!0,R4e(v.categoryMatches,y=>{m[y]=!0})),m),{});return function(){const m=this.LA(1);return g[m.tokenTypeIdx]===!0}}}return function(){const f=kre.call(this,s,h,LQt,o);return typeof f=="object"?!1:f===0}}},$(BL,"LLStarLookaheadStrategy"),BL);function D4e(t,e=!0){const r=new Set;for(const n of t){const i=new Set;for(const a of n){if(a===void 0){if(e)break;return!1}const s=[a.tokenTypeIdx].concat(a.categoryMatches);for(const o of s)if(r.has(o)){if(!i.has(o))return!1}else r.add(o),i.add(o)}}return!0}$(D4e,"isLL1Sequence");function MQt(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;ngO(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${$Qt(t.production)}${r}> inside <${t.topLevelRule.name}> Rule, + For further details.`);this.skipValidations=cn(r,"skipValidations")?r.skipValidations:U1.skipValidations}},$(KO,"Parser"),KO);i4e.DEFER_DEFINITION_ERRORS_HANDLING=!1,dzt(i4e,[a7n,o7n,u7n,h7n,f7n,d7n,p7n,g7n,v7n,y7n]);var b7n=(RL=class extends i4e{constructor(e,r=U1){const n=bc(r);n.outputCst=!1,super(e,n)}},$(RL,"EmbeddedActionsParser"),RL);function fzt(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r-1}$(wzt,"listCacheHas");var C7n=wzt;function Azt(t,e){var r=this.__data__,n=ure(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}$(Azt,"listCacheSet");var O7n=Azt;function vO(t){var e=-1,r=t==null?0:t.length;for(this.clear();++eo))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&L$n?new iUt:void 0;for(a.set(t,e),a.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=f9n}$(MUt,"isLength");var c4e=MUt,p9n="[object Arguments]",g9n="[object Array]",m9n="[object Boolean]",v9n="[object Date]",y9n="[object Error]",b9n="[object Function]",x9n="[object Map]",w9n="[object Number]",A9n="[object Object]",S9n="[object RegExp]",T9n="[object Set]",C9n="[object String]",O9n="[object WeakMap]",k9n="[object ArrayBuffer]",E9n="[object DataView]",_9n="[object Float32Array]",R9n="[object Float64Array]",D9n="[object Int8Array]",L9n="[object Int16Array]",M9n="[object Int32Array]",I9n="[object Uint8Array]",P9n="[object Uint8ClampedArray]",N9n="[object Uint16Array]",B9n="[object Uint32Array]",ls={};ls[_9n]=ls[R9n]=ls[D9n]=ls[L9n]=ls[M9n]=ls[I9n]=ls[P9n]=ls[N9n]=ls[B9n]=!0,ls[p9n]=ls[g9n]=ls[k9n]=ls[m9n]=ls[E9n]=ls[v9n]=ls[y9n]=ls[b9n]=ls[x9n]=ls[w9n]=ls[A9n]=ls[S9n]=ls[T9n]=ls[C9n]=ls[O9n]=!1;function IUt(t){return SR(t)&&c4e(t.length)&&!!ls[wR(t)]}$(IUt,"baseIsTypedArray");var $9n=IUt;function PUt(t){return function(e){return t(e)}}$(PUt,"baseUnary");var F9n=PUt,NUt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ez=NUt&&typeof module=="object"&&module&&!module.nodeType&&module,z9n=ez&&ez.exports===NUt,u4e=z9n&&kzt.process,U9n=function(){try{var t=ez&&ez.require&&ez.require("util").types;return t||u4e&&u4e.binding&&u4e.binding("util")}catch{}}(),BUt=U9n,$Ut=BUt&&BUt.isTypedArray,V9n=$Ut?F9n($Ut):$9n,h4e=V9n,Q9n=Object.prototype,G9n=Q9n.hasOwnProperty;function FUt(t,e){var r=rh(t),n=!r&&gre(t),i=!r&&!n&&mre(t),a=!r&&!n&&!i&&h4e(t),s=r||n||i||a,o=s?r9n(t.length,String):[],l=o.length;for(var u in t)(e||G9n.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||LUt(u,l)))&&o.push(u);return o}$(FUt,"arrayLikeKeys");var H9n=FUt,W9n=Object.prototype;function zUt(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||W9n;return t===r}$(zUt,"isPrototype");var UUt=zUt;function VUt(t,e){return function(r){return t(e(r))}}$(VUt,"overArg");var Y9n=VUt,q9n=Y9n(Object.keys,Object),j9n=q9n,X9n=Object.prototype,K9n=X9n.hasOwnProperty;function QUt(t){if(!UUt(t))return j9n(t);var e=[];for(var r in Object(t))K9n.call(t,r)&&r!="constructor"&&e.push(r);return e}$(QUt,"baseKeys");var GUt=QUt;function HUt(t){return t!=null&&c4e(t.length)&&!Pzt(t)}$(HUt,"isArrayLike");var vre=HUt;function WUt(t){return vre(t)?H9n(t):GUt(t)}$(WUt,"keys");var d4e=WUt;function YUt(t){return X$n(t,d4e,t9n)}$(YUt,"getAllKeys");var qUt=YUt,Z9n=1,J9n=Object.prototype,eFn=J9n.hasOwnProperty;function jUt(t,e,r,n,i,a){var s=r&Z9n,o=qUt(t),l=o.length,u=qUt(e),h=u.length;if(l!=h&&!s)return!1;for(var d=l;d--;){var f=o[d];if(!(s?f in e:eFn.call(e,f)))return!1}var p=a.get(t),g=a.get(e);if(p&&g)return p==e&&g==t;var m=!0;a.set(t,e),a.set(e,t);for(var v=s;++dT4e(t,e,s));return TO(t,e,n,r,...i)}$(KVt,"alternation");function ZVt(t,e,r){const n=ol(t,e,r,{type:lw});G1(t,n);const i=TO(t,e,n,r,cw(t,e,r));return JVt(t,e,r,i)}$(ZVt,"option");function cw(t,e,r){const n=KFn(Q1(r.definition,i=>T4e(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:tQt(t,n)}$(cw,"block");function C4e(t,e,r,n,i){const a=n.left,s=n.right,o=ol(t,e,r,{type:rzn});G1(t,o);const l=ol(t,e,r,{type:QVt});return a.loopback=o,l.loopback=o,t.decisionMap[SO(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,po(s,o),i===void 0?(po(o,a),po(o,l)):(po(o,l),po(o,i.left),po(i.right,a)),{left:a,right:l}}$(C4e,"plus");function O4e(t,e,r,n,i){const a=n.left,s=n.right,o=ol(t,e,r,{type:tzn});G1(t,o);const l=ol(t,e,r,{type:QVt}),u=ol(t,e,r,{type:ezn});return o.loopback=u,l.loopback=u,po(o,a),po(o,l),po(s,u),i!==void 0?(po(u,l),po(u,i.left),po(i.right,a)):po(u,o),t.decisionMap[SO(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}$(O4e,"star");function JVt(t,e,r,n){const i=n.left,a=n.right;return po(i,a),t.decisionMap[SO(e,"Option",r.idx)]=i,n}$(JVt,"optional");function G1(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}$(G1,"defineDecisionState");function TO(t,e,r,n,...i){const a=ol(t,e,n,{type:JFn,start:r});r.end=a;for(const o of i)o!==void 0?(po(r,o.left),po(o.right,a)):po(r,a);const s={left:r,right:a};return t.decisionMap[SO(e,eQt(n),n.idx)]=r,s}$(TO,"makeAlts");function eQt(t){if(t instanceof Kh)return"Alternation";if(t instanceof wc)return"Option";if(t instanceof qs)return"Repetition";if(t instanceof Xh)return"RepetitionWithSeparator";if(t instanceof of)return"RepetitionMandatory";if(t instanceof lf)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}$(eQt,"getProdType");function tQt(t,e){const r=e.length;for(let a=0;ae.alt)}get key(){let e="";for(const r in this.map)e+=r+":";return e}},$(PL,"ATNConfigSet"),PL);function E4e(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}$(E4e,"getATNConfigKey");function aQt(t,e,r){for(var n=-1,i=t.length;++n0&&r(o)?e>1?_4e(o,e-1,r,n,i):mUt(i,o):n||(i[i.length]=o)}return i}$(_4e,"baseFlatten");var uQt=_4e;function hQt(t,e){return uQt(Q1(t,e),1)}$(hQt,"flatMap");var ozn=hQt;function dQt(t,e,r,n){for(var i=t.length,a=r+(n?1:-1);n?a--:++a-1}$(mQt,"arrayIncludes");var dzn=mQt;function vQt(t,e,r){for(var n=-1,i=t==null?0:t.length;++n=yzn){var u=e?null:vzn(t);if(u)return o4e(u);s=!1,i=oUt,l=new iUt}else l=e?[]:o;e:for(;++n{const i=n.toString();let a=r[i];return a!==void 0||(a={atnStartState:t,decision:e,states:{}},r[i]=a),a}}$(RQt,"createDFACache");var DQt=(NL=class{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="";const r=this.predicates.length;for(let n=0;nconsole.log(n)}initialize(e){this.atn=HVt(e.rules),this.dfas=MQt(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=SO(n,"Alternation",r),h=this.atn.decisionMap[l].decision,d=Q1(z5e({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),f=>Q1(f,p=>p[0]));if(D4e(d,!1)&&!a){const f=_Qt(d,(p,g,m)=>(R4e(g,v=>{v&&(p[v.tokenTypeIdx]=m,R4e(v.categoryMatches,y=>{p[y]=m}))}),p),{});return i?function(p){var g;const m=this.LA(1),v=f[m.tokenTypeIdx];if(p!==void 0&&v!==void 0){const y=(g=p[v])===null||g===void 0?void 0:g.GATE;if(y!==void 0&&y.call(this)===!1)return}return v}:function(){const p=this.LA(1);return f[p.tokenTypeIdx]}}else return i?function(f){const p=new DQt,g=f===void 0?0:f.length;for(let v=0;vQ1(f,p=>p[0]));if(D4e(d)&&d[0][0]&&!a){const f=d[0],p=wzn(f);if(p.length===1&&Ezn(p[0].categoryMatches)){const m=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===m}}else{const g=_Qt(p,(m,v)=>(v!==void 0&&(m[v.tokenTypeIdx]=!0,R4e(v.categoryMatches,y=>{m[y]=!0})),m),{});return function(){const m=this.LA(1);return g[m.tokenTypeIdx]===!0}}}return function(){const f=kre.call(this,s,h,LQt,o);return typeof f=="object"?!1:f===0}}},$(BL,"LLStarLookaheadStrategy"),BL);function D4e(t,e=!0){const r=new Set;for(const n of t){const i=new Set;for(const a of n){if(a===void 0){if(e)break;return!1}const s=[a.tokenTypeIdx].concat(a.categoryMatches);for(const o of s)if(r.has(o)){if(!i.has(o))return!1}else r.add(o),i.add(o)}}return!0}$(D4e,"isLL1Sequence");function MQt(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;ngO(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${$Qt(t.production)}${r}> inside <${t.topLevelRule.name}> Rule, <${e}> may appears as a prefix path in all these alternatives. `;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES -For Further details.`,n}$(BQt,"buildAmbiguityError");function $Qt(t){if(t instanceof Ju)return"SUBRULE";if(t instanceof wc)return"OPTION";if(t instanceof Kh)return"OR";if(t instanceof of)return"AT_LEAST_ONE";if(t instanceof lf)return"AT_LEAST_ONE_SEP";if(t instanceof Xh)return"MANY_SEP";if(t instanceof qs)return"MANY";if(t instanceof os)return"CONSUME";throw Error("non exhaustive match")}$($Qt,"getProductionDslName");function FQt(t,e,r){const n=ozn(e.configs.elements,a=>a.state.transitions),i=xzn(n.filter(a=>a instanceof A4e).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}$(FQt,"buildAdaptivePredictError");function zQt(t,e){return t.edges[e.tokenTypeIdx]}$(zQt,"getExistingTargetState");function UQt(t,e,r){const n=new k4e,i=[];for(const s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===tz){i.push(s);continue}const o=s.state.transitions.length;for(let l=0;l0&&!WQt(a))for(const s of i)a.add(s);return a}$(UQt,"computeReachSet");function VQt(t,e){if(t instanceof A4e&&$5e(e,t.tokenType))return t.target}$(VQt,"getReachableTarget");function QQt(t,e){let r;for(const n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}$(QQt,"getUniqueAlt");function L4e(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}$(L4e,"newDFAState");function M4e(t,e,r,n){return n=I4e(t,n),e.edges[r.tokenTypeIdx]=n,n}$(M4e,"addDFAEdge");function I4e(t,e){if(e===Ore)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}$(I4e,"addDFAState");function GQt(t){const e=new k4e,r=t.transitions.length;for(let n=0;n0){const i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};rz(s,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);const n=r.transitions.length;for(let i=0;i1)return!0;return!1}$(XQt,"hasConflictingAltSet");function KQt(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}$(KQt,"hasStateAssociatedWithOneAlt"),eF();var ZQt=($L=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new N4e(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new _re;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new Ere(e.startOffset,e.image.length,pF(e),e.tokenType,!r);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){const r=e.container;if(r){const n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}addHiddenNodes(e){const r=[];for(const a of e){const s=new Ere(a.startOffset,a.image.length,pF(a),a.tokenType,!0);s.root=this.rootNode,r.push(s)}let n=this.current,i=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){const a=n.container.content.indexOf(n);if(a>0){n.container.content.splice(a,0,...r),i=!0;break}n=n.container}i||this.rootNode.content.unshift(...r)}construct(e){const r=this.current;typeof e.$type=="string"&&!e.$infixName&&(this.current.astNode=e),e.$cstNode=r;const n=this.nodeStack.pop();(n==null?void 0:n.content.length)===0&&this.removeNode(n)}},$($L,"CstNodeBuilder"),$L),P4e=(FL=class{get hidden(){return!1}get astNode(){var r,n;const e=typeof((r=this._astNode)==null?void 0:r.$type)=="string"?this._astNode:(n=this.container)==null?void 0:n.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},$(FL,"AbstractCstNode"),FL),Ere=(zL=class extends P4e{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,r,n,i,a=!1){super(),this._hidden=a,this._offset=e,this._tokenType=i,this._length=r,this._range=n}},$(zL,"LeafCstNodeImpl"),zL),_re=(UL=class extends P4e{constructor(){super(...arguments),this.content=new Lzn(this)}get offset(){var e;return((e=this.firstNonHiddenNode)==null?void 0:e.offset)??0}get length(){return this.end-this.offset}get end(){var e;return((e=this.lastNonHiddenNode)==null?void 0:e.end)??0}get range(){const e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){const{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line=0;e--){const r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}},$(UL,"CompositeCstNodeImpl"),UL),Lzn=(ZO=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,ZO.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(const r of e)r.container=this.parent}},$(ZO,"CstNodeContainer"),ZO),N4e=(VL=class extends _re{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},$(VL,"RootCstNodeImpl"),VL),Rre=Symbol("Datatype");function Dre(t){return t.$type===Rre}$(Dre,"isDataTypeNode");var JQt="​",eGt=$(t=>t.endsWith(JQt)?t:t+JQt,"withRuleSuffix"),B4e=(QL=class{constructor(e){var i;this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const r=this.lexer.definition,n=e.LanguageMetaData.mode==="production";(i=e.shared.profilers.LangiumProfiler)!=null&&i.isActive("parsing")?this.wrapper=new Izn(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new iGt(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},$(QL,"AbstractLangiumParser"),QL),tGt=(GL=class extends B4e{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new ZQt,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,r){const n=this.computeRuleType(e);let i;J3(e)&&(i=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(eGt(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,a),Ku(e)&&e.entry&&(this.mainRule=a),a}registerPrecedenceMap(e){const r=e.name,n=new Map;for(let i=0;i0&&(r=this.construct()),r===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return r}startImplementation(e,r,n){return i=>{const a=!this.isRecording()&&e!==void 0;if(a){const s={$type:e};this.stack.push(s),e===Rre?s.value="":r!==void 0&&(s.$infixName=r)}return n(i),a?this.construct():void 0}}extractHiddenTokens(e){const r=this.lexerResult.hidden;if(!r.length)return[];const n=e.startOffset;for(let i=0;in)return r.splice(0,i);return r.splice(0,r.length)}consume(e,r,n){const i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){const a=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(a);const s=this.nodeBuilder.buildLeafNode(i,n),{assignment:o,crossRef:l}=this.getAssignment(n),u=this.current;if(o){const h=I1(n)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,h,s,l)}else if(Dre(u)){let h=i.image;I1(n)||(h=this.converter.convert(h,s).toString()),u.value+=h}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,a){let s;!this.isRecording()&&!n&&(s=this.nodeBuilder.buildCompositeNode(i));let o;try{o=this.wrapper.wrapSubrule(e,r,a)}finally{this.isRecording()||(o===void 0&&!n&&(o=this.construct()),o!==void 0&&s&&s.length>0&&this.performSubruleAssignment(o,i,s))}}performSubruleAssignment(e,r,n){const{assignment:i,crossRef:a}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,a);else if(!i){const s=this.current;if(Dre(s))s.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(l)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(r.feature&&r.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode),this.nodeBuilder.buildCompositeNode(r).content.push(n.$cstNode);const a={$type:e};this.stack.push(a),this.assign(r.operator,r.feature,n,n.$cstNode)}else n.$type=e}}construct(){if(this.isRecording())return;const e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):Dre(e)?this.converter.convert(e.value,e.$cstNode):(JEe(this.astReflection,e),e)}constructInfix(e,r){const n=e.parts;if(!Array.isArray(n)||n.length===0)return;const i=e.operators;if(!Array.isArray(i)||n.length<2)return n[0];let a=0,s=-1;for(let m=0;ms?(s=y.precedence,a=m):y.precedence===s&&(y.rightAssoc||(a=m))}const o=i.slice(0,a),l=i.slice(a+1),u=n.slice(0,a+1),h=n.slice(a+1),d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:o},f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:h,operators:l},p=this.constructInfix(d,r),g=this.constructInfix(f,r);return{$type:e.$type,$cstNode:e.$cstNode,left:p,operator:i[a],right:g}}getAssignment(e){if(!this.assignmentMap.has(e)){const r=zC(e,L1);this.assignmentMap.set(e,{assignment:r,crossRef:r&&VC(r.terminal)?r.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,r,n,i,a){const s=this.current;let o;switch(a==="single"&&typeof n=="string"?o=this.linker.buildReference(s,r,i,n):a==="multi"&&typeof n=="string"?o=this.linker.buildMultiReference(s,r,i,n):o=n,e){case"=":{s[r]=o;break}case"?=":{s[r]=!0;break}case"+=":Array.isArray(s[r])||(s[r]=[]),s[r].push(o)}}assignWithoutOverride(e,r){for(const[i,a]of Object.entries(r)){const s=e[i];s===void 0?e[i]=a:Array.isArray(s)&&Array.isArray(a)&&(a.push(...s),e[i]=a)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},$(GL,"LangiumParser"),GL),rGt=(HL=class{buildMismatchTokenMessage(e){return bR.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return bR.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return bR.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return bR.buildEarlyExitMessage(e)}},$(HL,"AbstractParserErrorMessageProvider"),HL),$4e=(WL=class extends rGt{buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},$(WL,"LangiumParserErrorMessageProvider"),WL),nGt=(YL=class extends B4e{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const r=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){const n=this.wrapper.DEFINE_RULE(eGt(e.name),this.startImplementation(r).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{const n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i,a){this.before(i),this.wrapper.wrapSubrule(e,r,a),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}},$(YL,"LangiumCompletionParser"),YL),Mzn={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new $4e},iGt=(qL=class extends b7n{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...Mzn,lookaheadStrategy:n?new K5e({maxLookahead:r.maxLookahead}):new Dzn({logging:r.skipValidations?()=>{}:void 0}),...r})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r,n){return this.RULE(e,r,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r,void 0)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}rule(e){return e.call(this,{})}},$(qL,"ChevrotainWrapper"),qL),Izn=(jL=class extends iGt{constructor(e,r,n){super(e,r),this.task=n}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,r,n){this.task.startSubTask(this.ruleName(r));try{return super.subrule(e,r,n)}finally{this.task.stopSubTask(this.ruleName(r))}}},$(jL,"ProfilerWrapper"),jL);function Lre(t,e,r){return aGt({parser:e,tokens:r,ruleNames:new Map},t),e}$(Lre,"createParser");function aGt(t,e){const r=yte(e,!1),n=sa(e.rules).filter(Ku).filter(a=>r.has(a));for(const a of n){const s={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(a,uw(s,a.definition))}const i=sa(e.rules).filter(J3).filter(a=>r.has(a));for(const a of i)t.parser.rule(a,sGt(t,a))}$(aGt,"buildRules");function sGt(t,e){const r=e.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+e.call.rule.$refText);if(xp(r))throw new Error("Cannot use terminal rule in infix expression");const n=e.operators.precedences.flatMap(p=>p.operators),i={$type:"Group",elements:[]},a={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},s={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(a,s);const l={$container:s,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},u={...a,$container:s};s.elements.push(l,u);const d=n.map(p=>t.tokens[p.value]).map((p,g)=>({ALT:$(()=>t.parser.consume(g,p,l),"ALT")}));let f;return p=>{f??(f=Mre(t,r)),t.parser.subrule(0,f,!1,a,p),t.parser.many(0,{DEF:$(()=>{t.parser.alternatives(0,d),t.parser.subrule(1,f,!1,u,p)},"DEF")})}}$(sGt,"buildInfixRule");function uw(t,e,r=!1){let n;if(I1(e))n=fGt(t,e);else if(Z2(e))n=oGt(t,e);else if(L1(e))n=uw(t,e.terminal);else if(VC(e))n=F4e(t,e);else if(P1(e))n=lGt(t,e);else if(Hee(e))n=uGt(t,e);else if(lte(e))n=hGt(t,e);else if(GC(e))n=dGt(t,e);else if(s_e(e)){const i=t.consume++;n=$(()=>t.parser.consume(i,sw,e),"method")}else throw new hte(e.$cstNode,`Unexpected element type: ${e.$type}`);return z4e(t,r?void 0:nz(e),n,e.cardinality)}$(uw,"buildElement");function oGt(t,e){const r=nO(e);return()=>t.parser.action(r,e)}$(oGt,"buildAction");function lGt(t,e){const r=e.rule.ref;if(UC(r)){const n=t.subrule++,i=Ku(r)&&r.fragment,a=e.arguments.length>0?cGt(r,e.arguments):()=>({});let s;return o=>{s??(s=Mre(t,r)),t.parser.subrule(n,s,i,e,a(o))}}else if(xp(r)){const n=t.consume++,i=Ire(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)nw();else throw new hte(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}$(lGt,"buildRuleCall");function cGt(t,e){if(e.some(n=>n.calledByName)){const n=e.map(i=>{var a,s;return{parameterName:(s=(a=i.parameter)==null?void 0:a.ref)==null?void 0:s.name,predicate:Ig(i.value)}});return i=>{const a={};for(const{parameterName:s,predicate:o}of n)s&&(a[s]=o(i));return a}}else{const n=e.map(i=>Ig(i.value));return i=>{const a={};for(let s=0;se(n)||r(n)}else if(i_e(t)){const e=Ig(t.left),r=Ig(t.right);return n=>e(n)&&r(n)}else if(c_e(t)){const e=Ig(t.value);return r=>!e(r)}else if(u_e(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(r_e(t)){const e=!!t.true;return()=>e}nw()}$(Ig,"buildPredicate");function uGt(t,e){if(e.elements.length===1)return uw(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:uw(t,i,!0)},s=nz(i);s&&(a.GATE=Ig(s)),r.push(a)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(a=>{const s={ALT:$(()=>a.ALT(i),"ALT")},o=a.GATE;return o&&(s.GATE=()=>o(i)),s}))}}$(uGt,"buildAlternatives");function hGt(t,e){if(e.elements.length===1)return uw(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:uw(t,o,!0)},u=nz(o);u&&(l.GATE=Ig(u)),r.push(l)}const n=t.or++,i=$((o,l)=>{const u=l.getRuleStack().join("-");return`uGroup_${o}_${u}`},"idFunc"),a=$(o=>t.parser.alternatives(n,r.map((l,u)=>{const h={ALT:$(()=>!0,"ALT")},d=t.parser;h.ALT=()=>{if(l.ALT(o),!d.isRecording()){const p=i(n,d);d.unorderedGroups.get(p)||d.unorderedGroups.set(p,[]);const g=d.unorderedGroups.get(p);typeof(g==null?void 0:g[u])>"u"&&(g[u]=!0)}};const f=l.GATE;return f?h.GATE=()=>f(o):h.GATE=()=>{const p=d.unorderedGroups.get(i(n,d));return!(p!=null&&p[u])},h})),"alternatives"),s=z4e(t,nz(e),a,"*");return o=>{s(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}$(hGt,"buildUnorderedGroup");function dGt(t,e){const r=e.elements.map(n=>uw(t,n));return n=>r.forEach(i=>i(n))}$(dGt,"buildGroup");function nz(t){if(GC(t))return t.guardCondition}$(nz,"getGuardCondition");function F4e(t,e,r=e.terminal){if(r)if(P1(r)&&Ku(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let a;return s=>{a??(a=Mre(t,n)),t.parser.subrule(i,a,!1,e,s)}}else if(P1(r)&&xp(r.rule.ref)){const n=t.consume++,i=Ire(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(I1(r)){const n=t.consume++,i=Ire(t,r.value);return()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const n=Ate(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+nO(e.type.ref));return F4e(t,e,i)}}$(F4e,"buildCrossReference");function fGt(t,e){const r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}$(fGt,"buildKeyword");function z4e(t,e,r,n){const i=e&&Ig(e);if(!n)if(i){const a=t.or++;return s=>t.parser.alternatives(a,[{ALT:$(()=>r(s),"ALT"),GATE:$(()=>i(s),"GATE")},{ALT:n4e(),GATE:$(()=>!i(s),"GATE")}])}else return r;if(n==="*"){const a=t.many++;return s=>t.parser.many(a,{DEF:$(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else if(n==="+"){const a=t.many++;if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:$(()=>t.parser.atLeastOne(a,{DEF:$(()=>r(o),"DEF")}),"ALT"),GATE:$(()=>i(o),"GATE")},{ALT:n4e(),GATE:$(()=>!i(o),"GATE")}])}else return s=>t.parser.atLeastOne(a,{DEF:$(()=>r(s),"DEF")})}else if(n==="?"){const a=t.optional++;return s=>t.parser.optional(a,{DEF:$(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else nw()}$(z4e,"wrap");function Mre(t,e){const r=pGt(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}$(Mre,"getRule");function pGt(t,e){if(UC(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!Ku(n);)(GC(n)||Hee(n)||lte(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}$(pGt,"getRuleName");function Ire(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}$(Ire,"getToken");function U4e(t){const e=t.Grammar,r=t.parser.Lexer,n=new nGt(t);return Lre(e,n,r.definition),n.finalize(),n}$(U4e,"createCompletionParser");function V4e(t){const e=Q4e(t);return e.finalize(),e}$(V4e,"createLangiumParser");function Q4e(t){const e=t.Grammar,r=t.parser.Lexer,n=new tGt(t);return Lre(e,n,r.definition)}$(Q4e,"prepareLangiumParser");var Pre=(XL=class{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=sa(yte(e,!1)),i=this.buildTerminalTokens(n),a=this.buildKeywordTokens(n,i,r);return a.push(...i),a}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(xp).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=vF(e),n=this.requiresCustomPattern(r)?this.regexPatternFunction(r):r,i={name:e.name,PATTERN:n};return typeof n=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=vte(r)?eh.SKIPPED:"hidden"),i}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){const r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(UC).flatMap(i=>D1(i).filter(I1)).distinct(i=>i.value).toArray().sort((i,a)=>a.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!(n!=null&&n.caseInsensitive)))}buildKeywordToken(e,r,n){const i=this.buildKeywordPattern(e,n),a={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(a.LINE_BREAKS=!0),a}buildKeywordPattern(e,r){return r?new RegExp(cR(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{const a=i==null?void 0:i.PATTERN;return a!=null&&a.source&&I_e("^"+a.source+"$",e.value)&&n.push(i),n},[])}},$(XL,"DefaultTokenBuilder"),XL),G4e=(KL=class{convert(e,r){let n=r.grammarSource;if(VC(n)&&(n=F_e(n)),P1(n)){const i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){var i;switch(e.name.toUpperCase()){case"INT":return Z0.convertInt(r);case"STRING":return Z0.convertString(r);case"ID":return Z0.convertID(r)}switch((i=q_e(e))==null?void 0:i.toLowerCase()){case"number":return Z0.convertNumber(r);case"boolean":return Z0.convertBoolean(r);case"bigint":return Z0.convertBigint(r);case"date":return Z0.convertDate(r);default:return r}}},$(KL,"DefaultValueConverter"),KL),Z0;(function(t){function e(u){let h="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}$(Nre,"delayNextTick");var Bre=0,gGt=10;function $re(){return Bre=performance.now(),new Fa.CancellationTokenSource}$($re,"startCancelableOperation");function H4e(t){gGt=t}$(H4e,"setInterruptionPeriod");var J0=Symbol("OperationCancelled");function CO(t){return t===J0}$(CO,"isOperationCancelled");async function Fl(t){if(t===Fa.CancellationToken.None)return;const e=performance.now();if(e-Bre>=gGt&&(Bre=e,await Nre(),Bre=performance.now()),t.isCancellationRequested)throw J0}$(Fl,"interruptAndCheck");var H1=(ZL=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},$(ZL,"Deferred"),ZL),mGt=(ww=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(const n of e)if(ww.isIncremental(n)){const i=q4e(n.range),a=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,a)+n.text+this._content.substring(s,this._content.length);const o=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let u=this._lineOffsets;const h=W4e(n.text,!1,a);if(l-o===h.length)for(let f=0,p=h.length;fe?i=s:n=s+1}const a=n-1;return e=this.ensureBeforeEOL(e,r[a]),{line:a,character:e-r[a]}}offsetAt(e){const r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;const n=r[e.line];if(e.character<=0)return n;const i=e.line+1r&&Y4e(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},$(ww,"FullTextDocument"),ww),Fre;(function(t){function e(i,a,s,o){return new mGt(i,a,s,o)}$(e,"create"),t.create=e;function r(i,a,s){if(i instanceof mGt)return i.update(a,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}$(r,"update"),t.update=r;function n(i,a){const s=i.getText(),o=zre(a.map(vGt),(h,d)=>{const f=h.range.start.line-d.range.start.line;return f===0?h.range.start.character-d.range.start.character:f});let l=0;const u=[];for(const h of o){const d=i.offsetAt(h.range.start);if(dl&&u.push(s.substring(l,d)),h.newText.length&&u.push(h.newText),l=i.offsetAt(h.range.end)}return u.push(s.substr(l)),u.join("")}$(n,"applyEdits"),t.applyEdits=n})(Fre||(Fre={}));function zre(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);zre(n,e),zre(i,e);let a=0,s=0,o=0;for(;ar.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}$(q4e,"getWellformedRange");function vGt(t){const e=q4e(t.range);return e!==t.range?{newText:t.newText,range:e}:t}$(vGt,"getWellformedEdit");var yGt;(()=>{var t={975:L=>{function R(P){if(typeof P!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(P))}$(R,"e");function D(P,N){for(var F,B="",V=0,z=-1,U=0,Q=0;Q<=P.length;++Q){if(Q2){var G=B.lastIndexOf("/");if(G!==B.length-1){G===-1?(B="",V=0):V=(B=B.slice(0,G)).length-1-B.lastIndexOf("/"),z=Q,U=0;continue}}else if(B.length===2||B.length===1){B="",V=0,z=Q,U=0;continue}}N&&(B.length>0?B+="/..":B="..",V=2)}else B.length>0?B+="/"+P.slice(z+1,Q):B=P.slice(z+1,Q),V=Q-z-1;z=Q,U=0}else F===46&&U!==-1?++U:U=-1}return B}$(D,"r");var M={resolve:$(function(){for(var P,N="",F=!1,B=arguments.length-1;B>=-1&&!F;B--){var V;B>=0?V=arguments[B]:(P===void 0&&(P=process.cwd()),V=P),R(V),V.length!==0&&(N=V+"/"+N,F=V.charCodeAt(0)===47)}return N=D(N,!F),F?N.length>0?"/"+N:"/":N.length>0?N:"."},"resolve"),normalize:$(function(P){if(R(P),P.length===0)return".";var N=P.charCodeAt(0)===47,F=P.charCodeAt(P.length-1)===47;return(P=D(P,!N)).length!==0||N||(P="."),P.length>0&&F&&(P+="/"),N?"/"+P:P},"normalize"),isAbsolute:$(function(P){return R(P),P.length>0&&P.charCodeAt(0)===47},"isAbsolute"),join:$(function(){if(arguments.length===0)return".";for(var P,N=0;N0&&(P===void 0?P=F:P+="/"+F)}return P===void 0?".":M.normalize(P)},"join"),relative:$(function(P,N){if(R(P),R(N),P===N||(P=M.resolve(P))===(N=M.resolve(N)))return"";for(var F=1;FQ){if(N.charCodeAt(z+X)===47)return N.slice(z+X+1);if(X===0)return N.slice(z+X)}else V>Q&&(P.charCodeAt(F+X)===47?G=X:X===0&&(G=0));break}var Y=P.charCodeAt(F+X);if(Y!==N.charCodeAt(z+X))break;Y===47&&(G=X)}var le="";for(X=F+G+1;X<=B;++X)X!==B&&P.charCodeAt(X)!==47||(le.length===0?le+="..":le+="/..");return le.length>0?le+N.slice(z+G):(z+=G,N.charCodeAt(z)===47&&++z,N.slice(z))},"relative"),_makeLong:$(function(P){return P},"_makeLong"),dirname:$(function(P){if(R(P),P.length===0)return".";for(var N=P.charCodeAt(0),F=N===47,B=-1,V=!0,z=P.length-1;z>=1;--z)if((N=P.charCodeAt(z))===47){if(!V){B=z;break}}else V=!1;return B===-1?F?"/":".":F&&B===1?"//":P.slice(0,B)},"dirname"),basename:$(function(P,N){if(N!==void 0&&typeof N!="string")throw new TypeError('"ext" argument must be a string');R(P);var F,B=0,V=-1,z=!0;if(N!==void 0&&N.length>0&&N.length<=P.length){if(N.length===P.length&&N===P)return"";var U=N.length-1,Q=-1;for(F=P.length-1;F>=0;--F){var G=P.charCodeAt(F);if(G===47){if(!z){B=F+1;break}}else Q===-1&&(z=!1,Q=F+1),U>=0&&(G===N.charCodeAt(U)?--U==-1&&(V=F):(U=-1,V=Q))}return B===V?V=Q:V===-1&&(V=P.length),P.slice(B,V)}for(F=P.length-1;F>=0;--F)if(P.charCodeAt(F)===47){if(!z){B=F+1;break}}else V===-1&&(z=!1,V=F+1);return V===-1?"":P.slice(B,V)},"basename"),extname:$(function(P){R(P);for(var N=-1,F=0,B=-1,V=!0,z=0,U=P.length-1;U>=0;--U){var Q=P.charCodeAt(U);if(Q!==47)B===-1&&(V=!1,B=U+1),Q===46?N===-1?N=U:z!==1&&(z=1):N!==-1&&(z=-1);else if(!V){F=U+1;break}}return N===-1||B===-1||z===0||z===1&&N===B-1&&N===F+1?"":P.slice(N,B)},"extname"),format:$(function(P){if(P===null||typeof P!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof P);return function(N,F){var B=F.dir||F.root,V=F.base||(F.name||"")+(F.ext||"");return B?B===F.root?B+V:B+"/"+V:V}(0,P)},"format"),parse:$(function(P){R(P);var N={root:"",dir:"",base:"",ext:"",name:""};if(P.length===0)return N;var F,B=P.charCodeAt(0),V=B===47;V?(N.root="/",F=1):F=0;for(var z=-1,U=0,Q=-1,G=!0,X=P.length-1,Y=0;X>=F;--X)if((B=P.charCodeAt(X))!==47)Q===-1&&(G=!1,Q=X+1),B===46?z===-1?z=X:Y!==1&&(Y=1):z!==-1&&(Y=-1);else if(!G){U=X+1;break}return z===-1||Q===-1||Y===0||Y===1&&z===Q-1&&z===U+1?Q!==-1&&(N.base=N.name=U===0&&V?P.slice(1,Q):P.slice(U,Q)):(U===0&&V?(N.name=P.slice(1,z),N.base=P.slice(1,Q)):(N.name=P.slice(U,z),N.base=P.slice(U,Q)),N.ext=P.slice(z,Q)),U>0?N.dir=P.slice(0,U-1):V&&(N.dir="/"),N},"parse"),sep:"/",delimiter:":",win32:null,posix:null};M.posix=M,L.exports=M}},e={};function r(L){var R=e[L];if(R!==void 0)return R.exports;var D=e[L]={exports:{}};return t[L](D,D.exports,r),D.exports}$(r,"r"),r.d=(L,R)=>{for(var D in R)r.o(R,D)&&!r.o(L,D)&&Object.defineProperty(L,D,{enumerable:!0,get:R[D]})},r.o=(L,R)=>Object.prototype.hasOwnProperty.call(L,R),r.r=L=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(L,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(L,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:$(()=>f,"URI"),Utils:$(()=>E,"Utils")}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const a=/^\w[\w\d+.-]*$/,s=/^\//,o=/^\/\//;function l(L,R){if(!L.scheme&&R)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${L.authority}", path: "${L.path}", query: "${L.query}", fragment: "${L.fragment}"}`);if(L.scheme&&!a.test(L.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(L.path){if(L.authority){if(!s.test(L.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test(L.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}$(l,"a");const u="",h="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,_=class _{constructor(R,D,M,P,N,F=!1){Bn(this,"scheme");Bn(this,"authority");Bn(this,"path");Bn(this,"query");Bn(this,"fragment");typeof R=="object"?(this.scheme=R.scheme||u,this.authority=R.authority||u,this.path=R.path||u,this.query=R.query||u,this.fragment=R.fragment||u):(this.scheme=function(B,V){return B||V?B:"file"}(R,F),this.authority=D||u,this.path=function(B,V){switch(B){case"https":case"http":case"file":V?V[0]!==h&&(V=h+V):V=h}return V}(this.scheme,M||u),this.query=P||u,this.fragment=N||u,l(this,F))}static isUri(R){return R instanceof _||!!R&&typeof R.authority=="string"&&typeof R.fragment=="string"&&typeof R.path=="string"&&typeof R.query=="string"&&typeof R.scheme=="string"&&typeof R.fsPath=="string"&&typeof R.with=="function"&&typeof R.toString=="function"}get fsPath(){return b(this,!1)}with(R){if(!R)return this;let{scheme:D,authority:M,path:P,query:N,fragment:F}=R;return D===void 0?D=this.scheme:D===null&&(D=u),M===void 0?M=this.authority:M===null&&(M=u),P===void 0?P=this.path:P===null&&(P=u),N===void 0?N=this.query:N===null&&(N=u),F===void 0?F=this.fragment:F===null&&(F=u),D===this.scheme&&M===this.authority&&P===this.path&&N===this.query&&F===this.fragment?this:new g(D,M,P,N,F)}static parse(R,D=!1){const M=d.exec(R);return M?new g(M[2]||u,T(M[4]||u),T(M[5]||u),T(M[7]||u),T(M[9]||u),D):new g(u,u,u,u,u)}static file(R){let D=u;if(i&&(R=R.replace(/\\/g,h)),R[0]===h&&R[1]===h){const M=R.indexOf(h,2);M===-1?(D=R.substring(2),R=h):(D=R.substring(2,M),R=R.substring(M)||h)}return new g("file",D,R,u,u)}static from(R){const D=new g(R.scheme,R.authority,R.path,R.query,R.fragment);return l(D,!0),D}toString(R=!1){return x(this,R)}toJSON(){return this}static revive(R){if(R){if(R instanceof _)return R;{const D=new g(R);return D._formatted=R.external,D._fsPath=R._sep===p?R.fsPath:null,D}}return R}};$(_,"l");let f=_;const p=i?1:void 0,I=class I extends f{constructor(){super(...arguments);Bn(this,"_formatted",null);Bn(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=b(this,!1)),this._fsPath}toString(D=!1){return D?x(this,!0):(this._formatted||(this._formatted=x(this,!1)),this._formatted)}toJSON(){const D={$mid:1};return this._fsPath&&(D.fsPath=this._fsPath,D._sep=p),this._formatted&&(D.external=this._formatted),this.path&&(D.path=this.path),this.scheme&&(D.scheme=this.scheme),this.authority&&(D.authority=this.authority),this.query&&(D.query=this.query),this.fragment&&(D.fragment=this.fragment),D}};$(I,"d");let g=I;const m={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function v(L,R,D){let M,P=-1;for(let N=0;N=97&&F<=122||F>=65&&F<=90||F>=48&&F<=57||F===45||F===46||F===95||F===126||R&&F===47||D&&F===91||D&&F===93||D&&F===58)P!==-1&&(M+=encodeURIComponent(L.substring(P,N)),P=-1),M!==void 0&&(M+=L.charAt(N));else{M===void 0&&(M=L.substr(0,N));const B=m[F];B!==void 0?(P!==-1&&(M+=encodeURIComponent(L.substring(P,N)),P=-1),M+=B):P===-1&&(P=N)}}return P!==-1&&(M+=encodeURIComponent(L.substring(P))),M!==void 0?M:L}$(v,"m");function y(L){let R;for(let D=0;D1&&L.scheme==="file"?`//${L.authority}${L.path}`:L.path.charCodeAt(0)===47&&(L.path.charCodeAt(1)>=65&&L.path.charCodeAt(1)<=90||L.path.charCodeAt(1)>=97&&L.path.charCodeAt(1)<=122)&&L.path.charCodeAt(2)===58?R?L.path.substr(1):L.path[1].toLowerCase()+L.path.substr(2):L.path,i&&(D=D.replace(/\//g,"\\")),D}$(b,"v");function x(L,R){const D=R?y:v;let M="",{scheme:P,authority:N,path:F,query:B,fragment:V}=L;if(P&&(M+=P,M+=":"),(N||P==="file")&&(M+=h,M+=h),N){let z=N.indexOf("@");if(z!==-1){const U=N.substr(0,z);N=N.substr(z+1),z=U.lastIndexOf(":"),z===-1?M+=D(U,!1,!1):(M+=D(U.substr(0,z),!1,!1),M+=":",M+=D(U.substr(z+1),!1,!0)),M+="@"}N=N.toLowerCase(),z=N.lastIndexOf(":"),z===-1?M+=D(N,!1,!0):(M+=D(N.substr(0,z),!1,!0),M+=N.substr(z))}if(F){if(F.length>=3&&F.charCodeAt(0)===47&&F.charCodeAt(2)===58){const z=F.charCodeAt(1);z>=65&&z<=90&&(F=`/${String.fromCharCode(z+32)}:${F.substr(3)}`)}else if(F.length>=2&&F.charCodeAt(1)===58){const z=F.charCodeAt(0);z>=65&&z<=90&&(F=`${String.fromCharCode(z+32)}:${F.substr(2)}`)}M+=D(F,!0,!1)}return B&&(M+="?",M+=D(B,!1,!1)),V&&(M+="#",M+=R?V:v(V,!1,!1)),M}$(x,"b");function w(L){try{return decodeURIComponent(L)}catch{return L.length>3?L.substr(0,3)+w(L.substr(3)):L}}$(w,"C");const A=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function T(L){return L.match(A)?L.replace(A,R=>w(R)):L}$(T,"w");var S=r(975);const O=S.posix||S,k="/";var E;(function(L){L.joinPath=function(R,...D){return R.with({path:O.join(R.path,...D)})},L.resolvePath=function(R,...D){let M=R.path,P=!1;M[0]!==k&&(M=k+M,P=!0);let N=O.resolve(M,...D);return P&&N[0]===k&&!R.authority&&(N=N.substring(1)),R.with({path:N})},L.dirname=function(R){if(R.path.length===0||R.path===k)return R;let D=O.dirname(R.path);return D.length===1&&D.charCodeAt(0)===46&&(D=""),R.with({path:D})},L.basename=function(R){return O.basename(R.path)},L.extname=function(R){return O.extname(R.path)}})(E||(E={})),yGt=n})();var{URI:cf,Utils:iz}=yGt,nh;(function(t){t.basename=iz.basename,t.dirname=iz.dirname,t.extname=iz.extname,t.joinPath=iz.joinPath,t.resolvePath=iz.resolvePath;const e=typeof process=="object"&&(process==null?void 0:process.platform)==="win32";function r(s,o){return(s==null?void 0:s.toString())===(o==null?void 0:o.toString())}$(r,"equals"),t.equals=r;function n(s,o){const l=typeof s=="string"?cf.parse(s).path:s.path,u=typeof o=="string"?cf.parse(o).path:o.path,h=l.split("/").filter(m=>m.length>0),d=u.split("/").filter(m=>m.length>0);if(e){const m=/^[A-Z]:$/;if(h[0]&&m.test(h[0])&&(h[0]=h[0].toLowerCase()),d[0]&&m.test(d[0])&&(d[0]=d[0].toLowerCase()),h[0]!==d[0])return u.substring(1)}let f=0;for(;f({name:i.name,uri:nh.joinPath(cf.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(nh.normalize(e),!1);return r?this.collectValues(r):[]}getNode(e,r){const n=e.split("/");e.charAt(e.length-1)==="/"&&n.pop();let i=this.root;for(const a of n){let s=i.children.get(a);if(!s)if(r)s={name:a,children:new Map,parent:i},i.children.set(a,s);else return;i=s}return i}collectValues(e){const r=[];e.element&&r.push(e.element);for(const n of e.children.values())r.push(...this.collectValues(n));return r}},$(JL,"UriTrie"),JL),oi;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(oi||(oi={}));var bGt=(eM=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=Fa.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??cf.parse(e.uri),Fa.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return Fa.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r,n){if(typeof r=="string"){const i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if("$model"in r){const i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){const i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{const i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let a;if(n)a={parseResult:e,uri:r,state:oi.Parsed,references:[],textDocument:n};else{const s=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:oi.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,r){var s,o;const n=(s=e.parseResult.value.$cstNode)==null?void 0:s.root.fullText,i=(o=this.textDocuments)==null?void 0:o.get(e.uri.toString()),a=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{const l=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:l})}return n!==a&&(e.parseResult=await this.parseAsync(e.uri,a,r),e.parseResult.value.$document=e),e.state=oi.Parsed,e}parse(e,r,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r,n)}parseAsync(e,r,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(r,n)}createTextDocumentGetter(e,r){const n=this.serviceRegistry;let i;return()=>i??(i=Fre.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},$(eM,"DefaultLangiumDocumentFactory"),eM),xGt=(tM=class{constructor(e){this.documentTrie=new j4e,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return sa(this.documentTrie.all())}addDocument(e){const r=e.uri.toString();if(this.documentTrie.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentTrie.insert(r,e)}getDocument(e){const r=e.toString();return this.documentTrie.find(r)}getDocuments(e){const r=e.toString();return this.documentTrie.findAll(r)}async getOrCreateDocument(e,r){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,r),this.addDocument(n),n)}createDocument(e,r,n){if(n)return this.langiumDocumentFactory.fromString(r,e,n).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&this.documentBuilder().resetToState(n,oi.Changed),n}deleteDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=oi.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){const r=e.toString(),n=this.documentTrie.findAll(r);for(const i of n)i.state=oi.Changed;return this.documentTrie.delete(r),n}},$(tM,"DefaultLangiumDocuments"),tM),OO=Symbol("RefResolving"),wGt=(rM=class{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,r=Fa.CancellationToken.None){var n;if((n=this.profiler)!=null&&n.isActive("linking")){const i=this.profiler.createTask("linking",this.languageId);i.start();try{for(const a of Og(e.parseResult.value))await Fl(r),K3(a).forEach(s=>{const o=`${a.$type}:${s.property}`;i.startSubTask(o);try{this.doLink(s,e)}finally{i.stopSubTask(o)}})}finally{i.stop()}}else for(const i of Og(e.parseResult.value))await Fl(r),K3(i).forEach(a=>this.doLink(a,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=OO;try{const i=this.getCandidate(e);if($C(i))n._ref=i;else{n._nodeDescription=i;const a=this.loadAstNode(i);n._ref=a??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${n.$refText}':`,i);const a=i.message??String(i);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${a}`}}r.references.push(n)}else if("_items"in n&&n._items===void 0){n._items=OO;try{const i=this.getCandidates(e),a=[];if($C(i))n._linkingError=i;else for(const s of i){const o=this.loadAstNode(s);o&&a.push({ref:o,$nodeDescription:s})}n._items=a}catch(i){n._linkingError={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${i}`},n._items=[]}r.references.push(n)}}unlink(e){for(const r of e.references)"_ref"in r?(r._ref=void 0,delete r._nodeDescription):"_items"in r&&(r._items=void 0,delete r._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){const n=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(i=>`${i.documentUri}#${i.path}`).toArray();return n.length>0?n:this.createLinkingError(e)}buildReference(e,r,n,i){const a=this,s={$refNode:n,$refText:i,_ref:void 0,get ref(){if(zo(this._ref))return this._ref;if(XEe(this._nodeDescription)){const o=a.loadAstNode(this._nodeDescription);this._ref=o??a.createLinkingError({reference:s,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=OO;const o=X3(e).$document,l=a.getLinkedNode({reference:s,container:e,property:r});if(l.error&&o&&o.state0))return this._linkingError=a.createLinkingError({reference:s,container:e,property:r})}};return s}throwCyclicReferenceError(e,r,n){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${n}')`)}getLinkedNode(e){try{const r=this.getCandidate(e);if($C(r))return{error:r};const n=this.loadAstNode(r);return n?{node:n,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);const n=r.message??String(r);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${n}`}}}}loadAstNode(e){if(e.node)return e.node;const r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){const n=X3(e.container).$document;n&&n.stateVC(r)&&r.isMulti)}findDeclarations(e){if(e){const r=Q_e(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(ju(i)||V0(i))return Uee(i);if(Array.isArray(i)){for(const a of i)if((ju(a)||V0(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return Uee(a)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||x_e(e,i)))return this.getSelfNodes(n)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),n=this.getNodeFromReferenceDescription(r.head());if(n){for(const i of K3(n))if(V0(i.reference)&&i.reference.items.some(a=>a.ref===e))return i.reference.items.map(a=>a.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const r=this.documents.getDocument(e.sourceUri);if(r)return this.nodeLocator.getAstNode(r.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const r=this.findDeclarations(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i)??i.$cstNode;a&&n.push(a)}return n}findReferences(e,r){const n=[];r.includeDeclaration&&n.push(...this.getSelfReferences(e));let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(a=>nh.equals(a.sourceUri,r.documentUri))),n.push(...i),sa(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i);if(a){const s=Cg(i),o=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:s.uri,sourcePath:o,targetUri:s.uri,targetPath:o,segment:oR(a),local:!0})}}return n}},$(iM,"DefaultReferences"),iM),W1=(aM=class{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return nF.sum(sa(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{const n=this.map.get(e);if(n){const i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){const r=this.map.get(e);return r?sa(r):Y3}has(e,r){if(r===void 0)return this.map.has(e);{const n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return sa(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return sa(this.map.keys())}values(){return sa(this.map.values()).flat()}entriesGroupedByKey(){return sa(this.map.entries())}},$(aM,"MultiMap"),aM),Ure=(sM=class{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[r,n]of e)this.set(r,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,r){return this.map.set(e,r),this.inverse.set(r,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}},$(sM,"BiMap"),sM),SGt=(oM=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=Fa.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=iF,i=Fa.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,r);for(const s of n(e))await Fl(i),this.addExportedSymbol(s,a,r);return a}addExportedSymbol(e,r,n){const i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async collectLocalSymbols(e,r=Fa.CancellationToken.None){const n=e.parseResult.value,i=new W1;for(const a of D1(n))await Fl(r),this.addLocalSymbol(a,e,i);return i}addLocalSymbol(e,r,n){const i=e.$container;if(i){const a=this.nameProvider.getName(e);a&&n.add(i,this.descriptions.createDescription(e,a,r))}}},$(oM,"DefaultScopeComputation"),oM),K4e=(lM=class{constructor(e,r,n){this.elements=e,this.outerScope=r,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.find(i=>i.name.toLowerCase()===r):this.elements.find(i=>i.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.filter(i=>i.name.toLowerCase()===r):this.elements.filter(i=>i.name===e);return(this.concatOuterScope||n.isEmpty())&&this.outerScope?n.concat(this.outerScope.getElements(e)):n}},$(lM,"StreamScope"),lM),Pzn=(cM=class{constructor(e,r,n){this.elements=new Map,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.set(a,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r),i=n?[n]:[];return(this.concatOuterScope||i.length>0)&&this.outerScope?sa(i).concat(this.outerScope.getElements(e)):sa(i)}getAllElements(){let e=sa(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},$(cM,"MapScope"),cM),CGt=(uM=class{constructor(e,r,n){this.elements=new W1,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(a,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r)[0];if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);return(this.concatOuterScope||n.length===0)&&this.outerScope?sa(n).concat(this.outerScope.getElements(e)):sa(n)}getAllElements(){let e=sa(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},$(uM,"MultiMapScope"),uM),Nzn={getElement(){},getElements(){return Y3},getAllElements(){return Y3}},Vre=(hM=class{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},$(hM,"DisposableCache"),hM),Z4e=(dM=class extends Vre{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){const n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},$(dM,"SimpleCache"),dM),Qre=(fM=class extends Vre{constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){const a=n();return i.set(r,a),a}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){const r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){const r=this.converter(e);let n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}},$(fM,"ContextCache"),fM),OGt=(pM=class extends Qre{constructor(e,r){super(n=>n.toString()),r?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(r,n=>{this.clear(n.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{for(const a of i)this.clear(a)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{const a=n.concat(i);for(const s of a)this.clear(s)}))}},$(pM,"DocumentCache"),pM),J4e=(gM=class extends Z4e{constructor(e,r){super(),r?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(r,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}},$(gM,"WorkspaceCache"),gM),kGt=(mM=class{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new J4e(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=Cg(e.container).localSymbols;if(i){let s=e.container;do i.has(s)&&r.push(i.getStream(s).filter(o=>this.reflection.isSubtype(o.type,n))),s=s.$container;while(s)}let a=this.getGlobalScope(n,e);for(let s=r.length-1;s>=0;s--)a=this.createScope(r[s],a);return a}createScope(e,r,n){return new K4e(sa(e),r,n)}createScopeForNodes(e,r,n){const i=sa(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new K4e(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new CGt(this.indexManager.allElements(e)))}},$(mM,"DefaultScopeProvider"),mM);function e3e(t){return typeof t.$comment=="string"}$(e3e,"isAstNodeWithComment");function t3e(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}$(t3e,"isIntermediateReference");var EGt=(vM=class{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r){const n=r??{},i=r==null?void 0:r.replacer,a=$((o,l)=>this.replacer(o,l,n),"defaultReplacer"),s=i?(o,l)=>i(o,l,a):a;try{return this.currentDocument=Cg(e),JSON.stringify(e,s,r==null?void 0:r.space)}finally{this.currentDocument=void 0}}deserialize(e,r){const n=r??{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:a,comments:s,uriConverter:o}){var l,u,h;if(!this.ignoreProperties.has(e))if(ju(r)){const d=r.ref,f=n?r.$refText:void 0;if(d){const p=Cg(d);let g="";this.currentDocument&&this.currentDocument!==p&&(o?g=o(p.uri,d):g=p.uri.toString());const m=this.astNodeLocator.getAstNodePath(d);return{$ref:`${g}#${m}`,$refText:f}}else return{$error:((l=r.error)==null?void 0:l.message)??"Could not resolve reference",$refText:f}}else if(V0(r)){const d=n?r.$refText:void 0,f=[];for(const p of r.items){const g=p.ref,m=Cg(p.ref);let v="";this.currentDocument&&this.currentDocument!==m&&(o?v=o(m.uri,g):v=m.uri.toString());const y=this.astNodeLocator.getAstNodePath(g);f.push(`${v}#${y}`)}return{$refs:f,$refText:d}}else if(zo(r)){let d;if(a&&(d=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&(d!=null&&d.$textRegion)&&(d.$textRegion.documentURI=(u=this.currentDocument)==null?void 0:u.uri.toString())),i&&!e&&(d??(d={...r}),d.$sourceText=(h=r.$cstNode)==null?void 0:h.text),s){d??(d={...r});const f=this.commentProvider.getComment(r);f&&(d.$comment=f.replace(/\r/g,""))}return d??r}else return r}addAstNodeRegionWithAssignmentsTo(e){const r=$(n=>({offset:n.offset,end:n.end,length:n.length,range:n.range}),"createDocumentSegment");if(e.$cstNode){const n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(a=>!a.startsWith("$")).forEach(a=>{const s=U_e(e.$cstNode,a).map(r);s.length!==0&&(i[a]=s)}),e}}linkNode(e,r,n,i,a,s){for(const[l,u]of Object.entries(e))if(Array.isArray(u))for(let h=0;h{await this.handleException(()=>e.call(r,n,i,a),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(a){if(CO(a))throw a;console.error(`${r}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const s=a instanceof Error?a.message:String(a);n("error",`${r}: ${s}`,{node:i})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=sa(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}registerBeforeDocument(e,r=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",r))}registerAfterDocument(e,r=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",r))}wrapPreparationException(e,r,n){return async(i,a,s,o)=>{await this.handleException(()=>e.call(n,i,a,s,o),r,a,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}},$(bM,"ValidationRegistry"),bM),DGt=Object.freeze({validateNode:!0,validateChildren:!0}),LGt=(xM=class{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,r={},n=Fa.CancellationToken.None){const i=e.parseResult,a=[];if(await Fl(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,a,r),r.stopAfterLexingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===Cp.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===Cp.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===Cp.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if(CO(s))throw s;console.error("An error occurred during validation:",s)}return await Fl(n),a}processLexingErrors(e,r,n){var a;const i=[...e.lexerErrors,...((a=e.lexerReport)==null?void 0:a.diagnostics)??[]];for(const s of i){const o=s.severity??"error",l={severity:az(o),range:{start:{line:s.line-1,character:s.column-1},end:{line:s.line-1,character:s.column+s.length-1}},message:s.message,data:n3e(o),source:this.getSource()};r.push(l)}}processParsingErrors(e,r,n){for(const i of e.parserErrors){let a;if(isNaN(i.token.startOffset)){if("previousToken"in i){const s=i.previousToken;if(isNaN(s.startOffset)){const o={line:0,character:0};a={start:o,end:o}}else{const o={line:s.endLine-1,character:s.endColumn};a={start:o,end:o}}}}else a=pF(i.token);if(a){const s={severity:az("error"),range:a,message:i.message,data:kO(Cp.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){var i;for(const a of e.references){const s=a.error;if(s){const o={node:s.info.container,range:(i=a.$refNode)==null?void 0:i.range,property:s.info.property,index:s.info.index,data:{code:Cp.LinkingError,containerType:s.info.container.$type,property:s.info.property,refText:s.info.reference.$refText}};r.push(this.toDiagnostic("error",s.message,o))}}}async validateAst(e,r,n=Fa.CancellationToken.None){const i=[],a=$((s,o,l)=>{i.push(this.toDiagnostic(s,o,l))},"acceptor");return await this.validateAstBefore(e,r,a,n),await this.validateAstNodes(e,r,a,n),await this.validateAstAfter(e,r,a,n),i}async validateAstBefore(e,r,n,i=Fa.CancellationToken.None){const a=this.validationRegistry.checksBefore;for(const s of a)await Fl(i),await s(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=Fa.CancellationToken.None){var a;if((a=this.profiler)!=null&&a.isActive("validating")){const s=this.profiler.createTask("validating",this.languageId);s.start();try{const o=Og(e).iterator();for(const l of o){s.startSubTask(l.$type);const u=this.validateSingleNodeOptions(l,r);if(u.validateNode)try{const h=this.validationRegistry.getChecks(l.$type,r.categories);for(const d of h)await d(l,n,i)}finally{s.stopSubTask(l.$type)}u.validateChildren||o.prune()}}finally{s.stop()}}else{const s=Og(e).iterator();for(const o of s){await Fl(i);const l=this.validateSingleNodeOptions(o,r);if(l.validateNode){const u=this.validationRegistry.getChecks(o.$type,r.categories);for(const h of u)await h(o,n,i)}l.validateChildren||s.prune()}}}validateSingleNodeOptions(e,r){return DGt}async validateAstAfter(e,r,n,i=Fa.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const s of a)await Fl(i),await s(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:r3e(n),severity:az(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}},$(xM,"DefaultDocumentValidator"),xM);function r3e(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=bte(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=V_e(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}$(r3e,"getDiagnosticRange");function az(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}$(az,"toDiagnosticSeverity");function n3e(t){switch(t){case"error":return kO(Cp.LexingError);case"warning":return kO(Cp.LexingWarning);case"info":return kO(Cp.LexingInfo);case"hint":return kO(Cp.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}$(n3e,"toDiagnosticData");var Cp;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(Cp||(Cp={}));var MGt=(wM=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??Cg(e);r??(r=this.nameProvider.getName(e));const a=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${a} has no name.`);let s;const o=$(()=>s??(s=oR(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return o()},selectionSegment:oR(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}},$(wM,"DefaultAstNodeDescriptionProvider"),wM),IGt=(AM=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=Fa.CancellationToken.None){const n=[],i=e.parseResult.value;for(const a of Og(i))await Fl(r),K3(a).forEach(s=>{s.reference.error||n.push(...this.createInfoDescriptions(s))});return n}createInfoDescriptions(e){const r=e.reference;if(r.error||!r.$refNode)return[];let n=[];ju(r)&&r.$nodeDescription?n=[r.$nodeDescription]:V0(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=Cg(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),s=[],o=oR(r.$refNode);for(const l of n)s.push({sourceUri:i,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:o,local:nh.equals(l.documentUri,i)});return s}},$(AM,"DefaultReferenceDescriptionProvider"),AM),PGt=(TM=class{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,a)=>{if(!i||a.length===0)return i;const s=a.indexOf(this.indexSeparator);if(s>0){const o=a.substring(0,s),l=parseInt(a.substring(s+1)),u=i[o];return u==null?void 0:u[l]}return i[a]},e)}},$(TM,"DefaultAstNodeLocator"),TM),Hre={};Ree(Hre,Gke(H3()));var NGt=(SM=class{constructor(e){this._ready=new H1,this.onConfigurationSectionUpdateEmitter=new Hre.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var r;this.workspaceConfig=((r=e.capabilities.workspace)==null?void 0:r.configuration)??!1}async initialized(e){if(this.workspaceConfig){if(e.register){const r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,a)=>{this.updateSectionConfiguration(i.section,n[a])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([r,n])=>{this.updateSectionConfiguration(r,n),this.onConfigurationSectionUpdateEmitter.fire({section:r,configuration:n})})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){await this.ready;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}},$(SM,"DefaultConfigurationProvider"),SM),Wre=Gke(mMn()),EO;(function(t){function e(r){return{dispose:$(async()=>await r(),"dispose")}}$(e,"create"),t.create=e})(EO||(EO={}));var BGt=(CM=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new W1,this.documentPhaseListeners=new W1,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=oi.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=Fa.CancellationToken.None){var i;for(const a of e){const s=a.uri.toString();if(a.state===oi.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(a,oi.IndexedReferences);else if(typeof r.validation=="object"){const o=this.findMissingValidationCategories(a,r);o.length>0&&(this.buildState.set(s,{completed:!1,options:{validation:{categories:o}},result:(i=this.buildState.get(s))==null?void 0:i.result}),a.state=oi.IndexedReferences)}}else this.buildState.delete(s)}this.currentState=oi.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=Fa.CancellationToken.None){this.currentState=oi.Changed;const i=[];for(const l of r){const u=this.langiumDocuments.deleteDocuments(l);for(const h of u)i.push(h.uri),this.cleanUpDeleted(h)}const a=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of a){let u=this.langiumDocuments.getDocument(l);u===void 0&&(u=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),u.state=oi.Changed,this.langiumDocuments.addDocument(u)),this.resetToState(u,oi.Changed)}const s=sa(a).concat(i).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!s.has(l.uri.toString())&&this.shouldRelink(l,s)).forEach(l=>this.resetToState(l,oi.ComputedScopes)),await this.emitUpdate(a,i),await Fl(n);const o=this.sortDocuments(this.langiumDocuments.all.filter(l=>{var u;return l.state=1}findMissingValidationCategories(e,r){var o,l;const n=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),a=(o=n==null?void 0:n.result)!=null&&o.validationChecks?new Set((l=n==null?void 0:n.result)==null?void 0:l.validationChecks):n!=null&&n.completed?i:new Set,s=r===void 0||r.validation===!0?i:typeof r.validation=="object"?r.validation.categories??i:[];return sa(s).filter(u=>!a.has(u)).toArray()}async findChangedUris(e){var n;if(this.langiumDocuments.getDocument(e)??((n=this.textDocuments)==null?void 0:n.get(e)))return[e];try{const i=await this.fileSystemProvider.stat(e);if(i.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(i))return[e]}catch{}return[]}async emitUpdate(e,r){await Promise.all(this.updateListeners.map(n=>n(e,r)))}sortDocuments(e){let r=0,n=e.length-1;for(;r=0&&!this.hasTextDocument(e[n]);)n--;rn.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),EO.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case oi.Changed:case oi.Parsed:this.indexManager.removeContent(e.uri);case oi.IndexedContent:e.localSymbols=void 0;case oi.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case oi.Linked:this.indexManager.removeReferences(e.uri);case oi.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case oi.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=oi.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,oi.Parsed,n,s=>this.langiumDocumentFactory.update(s,n)),await this.runCancelable(e,oi.IndexedContent,n,s=>this.indexManager.updateContent(s,n)),await this.runCancelable(e,oi.ComputedScopes,n,async s=>{const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.localSymbols=await o.collectLocalSymbols(s,n)});const i=e.filter(s=>this.shouldLink(s));await this.runCancelable(i,oi.Linked,n,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,n)),await this.runCancelable(i,oi.IndexedReferences,n,s=>this.indexManager.updateReferences(s,n));const a=e.filter(s=>this.shouldValidate(s)?!0:(this.markAsCompleted(s),!1));await this.runCancelable(a,oi.Validated,n,async s=>{await this.validate(s,n),this.markAsCompleted(s)})}markAsCompleted(e){const r=this.buildState.get(e.uri.toString());r&&(r.completed=!0)}prepareBuild(e,r){for(const n of e){const i=n.uri.toString(),a=this.buildState.get(i);(!a||a.completed)&&this.buildState.set(i,{completed:!1,options:r,result:a==null?void 0:a.result})}}async runCancelable(e,r,n,i){for(const s of e)s.states.state===r);await this.notifyBuildPhase(a,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),EO.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),EO.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=Fa.CancellationToken.None),i?this.awaitDocumentState(e,i,n):this.awaitBuilderState(e,n)}awaitDocumentState(e,r,n){const i=this.langiumDocuments.getDocument(r);if(i){if(i.state>=e)return Promise.resolve(r);if(n.isCancellationRequested)return Promise.reject(J0);if(this.currentState>=e&&e>i.state)return Promise.reject(new Wre.ResponseError(Wre.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${oi[i.state]}, requiring ${oi[e]}, but workspace state is already ${oi[this.currentState]}. Returning undefined.`))}else return Promise.reject(new Wre.ResponseError(Wre.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,u=>{nh.equals(u.uri,r)&&(o.dispose(),l.dispose(),a(u.uri))}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(J0)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(J0):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{a.dispose(),s.dispose(),i(J0)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const s of a)try{await Fl(n),await s(e,n)}catch(o){if(!CO(o))throw o}}async notifyBuildPhase(e,r,n){if(e.length===0)return;const a=this.buildPhaseListeners.get(r).slice();for(const s of a)await Fl(n),await s(e,n)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){const n=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,i=this.getBuildOptions(e),a=typeof i.validation=="object"?{...i.validation}:{};a.categories=this.findMissingValidationCategories(e,i);const s=await n.validateDocument(e,a,r);e.diagnostics?e.diagnostics.push(...s):e.diagnostics=s;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=sa(o.result.validationChecks).concat(a.categories).distinct().toArray():o.result.validationChecks=[...a.categories])}getBuildOptions(e){var r;return((r=this.buildState.get(e.uri.toString()))==null?void 0:r.options)??{}}},$(CM,"DefaultDocumentBuilder"),CM),$Gt=(OM=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new Qre,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=Cg(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{nh.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),sa(i)}allElements(e,r){let n=sa(this.symbolIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){return r?this.symbolByTypeIndex.get(e,r,()=>(this.symbolIndex.get(e)??[]).filter(a=>this.astReflection.isSubtype(a.type,r))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r)}removeReferences(e){const r=e.toString();this.referenceIndex.delete(r)}async updateContent(e,r=Fa.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,r),a=e.uri.toString();this.symbolIndex.set(a,i),this.symbolByTypeIndex.clear(a)}async updateReferences(e,r=Fa.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){const n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}},$(OM,"DefaultIndexManager"),OM),FGt=(kM=class{constructor(e){this.initialBuildOptions={},this._ready=new H1,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(r=>this.initializeWorkspace(this.folders??[],r))}async initializeWorkspace(e,r=Fa.CancellationToken.None){const n=await this.performStartup(e);await Fl(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=[],n=$(s=>{r.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)},"collector");await this.loadAdditionalDocuments(e,n);const i=[];await Promise.all(e.map(s=>this.getRootFolder(s)).map(async s=>this.traverseFolder(s,i)));const a=sa(i).distinct(s=>s.toString()).filter(s=>!this.langiumDocuments.hasDocument(s));return await this.loadWorkspaceDocuments(a,n),this._ready.resolve(),r}async loadWorkspaceDocuments(e,r){await Promise.all(e.map(async n=>{const i=await this.langiumDocuments.getOrCreateDocument(n);r(i)}))}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return cf.parse(e.uri)}async traverseFolder(e,r){try{const n=await this.fileSystemProvider.readDirectory(e);await Promise.all(n.map(async i=>{this.shouldIncludeEntry(i)&&(i.isDirectory?await this.traverseFolder(i.uri,r):i.isFile&&r.push(i.uri))}))}catch(n){console.error("Failure to read directory content of "+e.toString(!0),n)}}async searchFolder(e){const r=[];return await this.traverseFolder(e,r),r}shouldIncludeEntry(e){const r=nh.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},$(kM,"DefaultWorkspaceManager"),kM),zGt=(EM=class{buildUnexpectedCharactersMessage(e,r,n,i,a){return N5e.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return N5e.buildUnableToPopLexerModeMessage(e)}},$(EM,"DefaultLexerErrorMessageProvider"),EM),i3e={mode:"full"},a3e=(_M=class{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);const n=jre(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new eh(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=i3e){var i,a;const n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:n.groups.hidden??[],report:(a=(i=this.tokenBuilder).flushLexingReport)==null?void 0:a.call(i,e)}}toTokenTypeDictionary(e){if(jre(e))return e;const r=qre(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}},$(_M,"DefaultLexer"),_M);function Yre(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}$(Yre,"isTokenTypeArray");function qre(t){return t&&"modes"in t&&"defaultMode"in t}$(qre,"isIMultiModeLexerDefinition");function jre(t){return!Yre(t)&&!qre(t)}$(jre,"isTokenTypeDictionary"),eF();function s3e(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=ji.create(0,0));const a=l3e(t),s=Kre(n),o=VGt({lines:a,position:i,options:s});return HGt({index:0,tokens:o,position:i})}$(s3e,"parseJSDoc");function o3e(t,e){const r=Kre(e),n=l3e(t);if(n.length===0)return!1;const i=n[0],a=n[n.length-1],s=r.start,o=r.end;return!!(s!=null&&s.exec(i))&&!!(o!=null&&o.exec(a))}$(o3e,"isJSDoc");function l3e(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(CNt)}$(l3e,"getLines");var UGt=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,Bzn=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function VGt(t){var i,a,s;const e=[];let r=t.position.line,n=t.position.character;for(let o=0;o=h.length){if(e.length>0){const p=ji.create(r,n);e.push({type:"break",content:"",range:Oi.create(p,p)})}}else{UGt.lastIndex=d;const p=UGt.exec(h);if(p){const g=p[0],m=p[1],v=ji.create(r,n+d),y=ji.create(r,n+d+g.length);e.push({type:"tag",content:m,range:Oi.create(v,y)}),d+=g.length,d=Xre(h,d)}if(d0&&e[e.length-1].type==="break"?e.slice(0,-1):e}$(VGt,"tokenize");function QGt(t,e,r,n){const i=[];if(t.length===0){const a=ji.create(r,n),s=ji.create(r,n+e.length);i.push({type:"text",content:e,range:Oi.create(a,s)})}else{let a=0;for(const o of t){const l=o.index,u=e.substring(a,l);u.length>0&&i.push({type:"text",content:e.substring(a,l),range:Oi.create(ji.create(r,a+n),ji.create(r,l+n))});let h=u.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:Oi.create(ji.create(r,a+h+n),ji.create(r,a+h+d.length+n))}),h+=d.length,o.length===4){h+=o[2].length;const f=o[3];i.push({type:"text",content:f,range:Oi.create(ji.create(r,a+h+n),ji.create(r,a+h+f.length+n))})}else i.push({type:"text",content:"",range:Oi.create(ji.create(r,a+h+n),ji.create(r,a+h+n))});a=l+o[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:Oi.create(ji.create(r,a+n),ji.create(r,a+n+s.length))})}return i}$(QGt,"buildInlineTokens");var $zn=/\S/,Fzn=/\s*$/;function Xre(t,e){const r=t.substring(e).match($zn);return r?e+r.index:t.length}$(Xre,"skipWhitespace");function GGt(t){const e=t.match(Fzn);if(e&&typeof e.index=="number")return e.index}$(GGt,"lastCharacter");function HGt(t){var a,s;const e=ji.create(t.position.line,t.position.character);if(t.tokens.length===0)return new jGt([],Oi.create(e,e));const r=[];for(;t.indexr.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const r of this.elements)if(e.length===0)e=r.toString();else{const n=r.toString();e+=p3e(e)+n}return e.trim()}toMarkdown(e){let r="";for(const n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{const i=n.toMarkdown(e);r+=p3e(r)+i}return r.trim()}},$(RM,"JSDocCommentImpl"),RM),d3e=(DM=class{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`;const r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e} +For Further details.`,n}$(BQt,"buildAmbiguityError");function $Qt(t){if(t instanceof Ju)return"SUBRULE";if(t instanceof wc)return"OPTION";if(t instanceof Kh)return"OR";if(t instanceof of)return"AT_LEAST_ONE";if(t instanceof lf)return"AT_LEAST_ONE_SEP";if(t instanceof Xh)return"MANY_SEP";if(t instanceof qs)return"MANY";if(t instanceof os)return"CONSUME";throw Error("non exhaustive match")}$($Qt,"getProductionDslName");function FQt(t,e,r){const n=ozn(e.configs.elements,a=>a.state.transitions),i=xzn(n.filter(a=>a instanceof A4e).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}$(FQt,"buildAdaptivePredictError");function zQt(t,e){return t.edges[e.tokenTypeIdx]}$(zQt,"getExistingTargetState");function UQt(t,e,r){const n=new k4e,i=[];for(const s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===tz){i.push(s);continue}const o=s.state.transitions.length;for(let l=0;l0&&!WQt(a))for(const s of i)a.add(s);return a}$(UQt,"computeReachSet");function VQt(t,e){if(t instanceof A4e&&$5e(e,t.tokenType))return t.target}$(VQt,"getReachableTarget");function QQt(t,e){let r;for(const n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}$(QQt,"getUniqueAlt");function L4e(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}$(L4e,"newDFAState");function M4e(t,e,r,n){return n=I4e(t,n),e.edges[r.tokenTypeIdx]=n,n}$(M4e,"addDFAEdge");function I4e(t,e){if(e===Ore)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}$(I4e,"addDFAState");function GQt(t){const e=new k4e,r=t.transitions.length;for(let n=0;n0){const i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};rz(s,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);const n=r.transitions.length;for(let i=0;i1)return!0;return!1}$(XQt,"hasConflictingAltSet");function KQt(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}$(KQt,"hasStateAssociatedWithOneAlt"),eF();var ZQt=($L=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new N4e(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new _re;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new Ere(e.startOffset,e.image.length,pF(e),e.tokenType,!r);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){const r=e.container;if(r){const n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}addHiddenNodes(e){const r=[];for(const a of e){const s=new Ere(a.startOffset,a.image.length,pF(a),a.tokenType,!0);s.root=this.rootNode,r.push(s)}let n=this.current,i=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){const a=n.container.content.indexOf(n);if(a>0){n.container.content.splice(a,0,...r),i=!0;break}n=n.container}i||this.rootNode.content.unshift(...r)}construct(e){const r=this.current;typeof e.$type=="string"&&!e.$infixName&&(this.current.astNode=e),e.$cstNode=r;const n=this.nodeStack.pop();(n==null?void 0:n.content.length)===0&&this.removeNode(n)}},$($L,"CstNodeBuilder"),$L),P4e=(FL=class{get hidden(){return!1}get astNode(){var r,n;const e=typeof((r=this._astNode)==null?void 0:r.$type)=="string"?this._astNode:(n=this.container)==null?void 0:n.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},$(FL,"AbstractCstNode"),FL),Ere=(zL=class extends P4e{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,r,n,i,a=!1){super(),this._hidden=a,this._offset=e,this._tokenType=i,this._length=r,this._range=n}},$(zL,"LeafCstNodeImpl"),zL),_re=(UL=class extends P4e{constructor(){super(...arguments),this.content=new Lzn(this)}get offset(){var e;return((e=this.firstNonHiddenNode)==null?void 0:e.offset)??0}get length(){return this.end-this.offset}get end(){var e;return((e=this.lastNonHiddenNode)==null?void 0:e.end)??0}get range(){const e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){const{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line=0;e--){const r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}},$(UL,"CompositeCstNodeImpl"),UL),Lzn=(ZO=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,ZO.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(const r of e)r.container=this.parent}},$(ZO,"CstNodeContainer"),ZO),N4e=(VL=class extends _re{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},$(VL,"RootCstNodeImpl"),VL),Rre=Symbol("Datatype");function Dre(t){return t.$type===Rre}$(Dre,"isDataTypeNode");var JQt="​",eGt=$(t=>t.endsWith(JQt)?t:t+JQt,"withRuleSuffix"),B4e=(QL=class{constructor(e){var i;this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const r=this.lexer.definition,n=e.LanguageMetaData.mode==="production";(i=e.shared.profilers.LangiumProfiler)!=null&&i.isActive("parsing")?this.wrapper=new Izn(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new iGt(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},$(QL,"AbstractLangiumParser"),QL),tGt=(GL=class extends B4e{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new ZQt,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,r){const n=this.computeRuleType(e);let i;J3(e)&&(i=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(eGt(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,a),Ku(e)&&e.entry&&(this.mainRule=a),a}registerPrecedenceMap(e){const r=e.name,n=new Map;for(let i=0;i0&&(r=this.construct()),r===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return r}startImplementation(e,r,n){return i=>{const a=!this.isRecording()&&e!==void 0;if(a){const s={$type:e};this.stack.push(s),e===Rre?s.value="":r!==void 0&&(s.$infixName=r)}return n(i),a?this.construct():void 0}}extractHiddenTokens(e){const r=this.lexerResult.hidden;if(!r.length)return[];const n=e.startOffset;for(let i=0;in)return r.splice(0,i);return r.splice(0,r.length)}consume(e,r,n){const i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){const a=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(a);const s=this.nodeBuilder.buildLeafNode(i,n),{assignment:o,crossRef:l}=this.getAssignment(n),u=this.current;if(o){const h=I1(n)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,h,s,l)}else if(Dre(u)){let h=i.image;I1(n)||(h=this.converter.convert(h,s).toString()),u.value+=h}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,a){let s;!this.isRecording()&&!n&&(s=this.nodeBuilder.buildCompositeNode(i));let o;try{o=this.wrapper.wrapSubrule(e,r,a)}finally{this.isRecording()||(o===void 0&&!n&&(o=this.construct()),o!==void 0&&s&&s.length>0&&this.performSubruleAssignment(o,i,s))}}performSubruleAssignment(e,r,n){const{assignment:i,crossRef:a}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,a);else if(!i){const s=this.current;if(Dre(s))s.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(l)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(r.feature&&r.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode),this.nodeBuilder.buildCompositeNode(r).content.push(n.$cstNode);const a={$type:e};this.stack.push(a),this.assign(r.operator,r.feature,n,n.$cstNode)}else n.$type=e}}construct(){if(this.isRecording())return;const e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):Dre(e)?this.converter.convert(e.value,e.$cstNode):(JEe(this.astReflection,e),e)}constructInfix(e,r){const n=e.parts;if(!Array.isArray(n)||n.length===0)return;const i=e.operators;if(!Array.isArray(i)||n.length<2)return n[0];let a=0,s=-1;for(let m=0;ms?(s=y.precedence,a=m):y.precedence===s&&(y.rightAssoc||(a=m))}const o=i.slice(0,a),l=i.slice(a+1),u=n.slice(0,a+1),h=n.slice(a+1),d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:o},f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:h,operators:l},p=this.constructInfix(d,r),g=this.constructInfix(f,r);return{$type:e.$type,$cstNode:e.$cstNode,left:p,operator:i[a],right:g}}getAssignment(e){if(!this.assignmentMap.has(e)){const r=zC(e,L1);this.assignmentMap.set(e,{assignment:r,crossRef:r&&VC(r.terminal)?r.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,r,n,i,a){const s=this.current;let o;switch(a==="single"&&typeof n=="string"?o=this.linker.buildReference(s,r,i,n):a==="multi"&&typeof n=="string"?o=this.linker.buildMultiReference(s,r,i,n):o=n,e){case"=":{s[r]=o;break}case"?=":{s[r]=!0;break}case"+=":Array.isArray(s[r])||(s[r]=[]),s[r].push(o)}}assignWithoutOverride(e,r){for(const[i,a]of Object.entries(r)){const s=e[i];s===void 0?e[i]=a:Array.isArray(s)&&Array.isArray(a)&&(a.push(...s),e[i]=a)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},$(GL,"LangiumParser"),GL),rGt=(HL=class{buildMismatchTokenMessage(e){return bR.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return bR.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return bR.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return bR.buildEarlyExitMessage(e)}},$(HL,"AbstractParserErrorMessageProvider"),HL),$4e=(WL=class extends rGt{buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},$(WL,"LangiumParserErrorMessageProvider"),WL),nGt=(YL=class extends B4e{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const r=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){const n=this.wrapper.DEFINE_RULE(eGt(e.name),this.startImplementation(r).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{const n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i,a){this.before(i),this.wrapper.wrapSubrule(e,r,a),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}},$(YL,"LangiumCompletionParser"),YL),Mzn={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new $4e},iGt=(qL=class extends b7n{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...Mzn,lookaheadStrategy:n?new K5e({maxLookahead:r.maxLookahead}):new Dzn({logging:r.skipValidations?()=>{}:void 0}),...r})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r,n){return this.RULE(e,r,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r,void 0)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}rule(e){return e.call(this,{})}},$(qL,"ChevrotainWrapper"),qL),Izn=(jL=class extends iGt{constructor(e,r,n){super(e,r),this.task=n}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,r,n){this.task.startSubTask(this.ruleName(r));try{return super.subrule(e,r,n)}finally{this.task.stopSubTask(this.ruleName(r))}}},$(jL,"ProfilerWrapper"),jL);function Lre(t,e,r){return aGt({parser:e,tokens:r,ruleNames:new Map},t),e}$(Lre,"createParser");function aGt(t,e){const r=yte(e,!1),n=sa(e.rules).filter(Ku).filter(a=>r.has(a));for(const a of n){const s={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(a,uw(s,a.definition))}const i=sa(e.rules).filter(J3).filter(a=>r.has(a));for(const a of i)t.parser.rule(a,sGt(t,a))}$(aGt,"buildRules");function sGt(t,e){const r=e.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+e.call.rule.$refText);if(xp(r))throw new Error("Cannot use terminal rule in infix expression");const n=e.operators.precedences.flatMap(p=>p.operators),i={$type:"Group",elements:[]},a={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},s={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(a,s);const l={$container:s,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},u={...a,$container:s};s.elements.push(l,u);const d=n.map(p=>t.tokens[p.value]).map((p,g)=>({ALT:$(()=>t.parser.consume(g,p,l),"ALT")}));let f;return p=>{f??(f=Mre(t,r)),t.parser.subrule(0,f,!1,a,p),t.parser.many(0,{DEF:$(()=>{t.parser.alternatives(0,d),t.parser.subrule(1,f,!1,u,p)},"DEF")})}}$(sGt,"buildInfixRule");function uw(t,e,r=!1){let n;if(I1(e))n=fGt(t,e);else if(Z2(e))n=oGt(t,e);else if(L1(e))n=uw(t,e.terminal);else if(VC(e))n=F4e(t,e);else if(P1(e))n=lGt(t,e);else if(Hee(e))n=uGt(t,e);else if(lte(e))n=hGt(t,e);else if(GC(e))n=dGt(t,e);else if(s_e(e)){const i=t.consume++;n=$(()=>t.parser.consume(i,sw,e),"method")}else throw new hte(e.$cstNode,`Unexpected element type: ${e.$type}`);return z4e(t,r?void 0:nz(e),n,e.cardinality)}$(uw,"buildElement");function oGt(t,e){const r=nO(e);return()=>t.parser.action(r,e)}$(oGt,"buildAction");function lGt(t,e){const r=e.rule.ref;if(UC(r)){const n=t.subrule++,i=Ku(r)&&r.fragment,a=e.arguments.length>0?cGt(r,e.arguments):()=>({});let s;return o=>{s??(s=Mre(t,r)),t.parser.subrule(n,s,i,e,a(o))}}else if(xp(r)){const n=t.consume++,i=Ire(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)nw();else throw new hte(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}$(lGt,"buildRuleCall");function cGt(t,e){if(e.some(n=>n.calledByName)){const n=e.map(i=>{var a,s;return{parameterName:(s=(a=i.parameter)==null?void 0:a.ref)==null?void 0:s.name,predicate:Ig(i.value)}});return i=>{const a={};for(const{parameterName:s,predicate:o}of n)s&&(a[s]=o(i));return a}}else{const n=e.map(i=>Ig(i.value));return i=>{const a={};for(let s=0;se(n)||r(n)}else if(i_e(t)){const e=Ig(t.left),r=Ig(t.right);return n=>e(n)&&r(n)}else if(c_e(t)){const e=Ig(t.value);return r=>!e(r)}else if(u_e(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(r_e(t)){const e=!!t.true;return()=>e}nw()}$(Ig,"buildPredicate");function uGt(t,e){if(e.elements.length===1)return uw(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:uw(t,i,!0)},s=nz(i);s&&(a.GATE=Ig(s)),r.push(a)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(a=>{const s={ALT:$(()=>a.ALT(i),"ALT")},o=a.GATE;return o&&(s.GATE=()=>o(i)),s}))}}$(uGt,"buildAlternatives");function hGt(t,e){if(e.elements.length===1)return uw(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:uw(t,o,!0)},u=nz(o);u&&(l.GATE=Ig(u)),r.push(l)}const n=t.or++,i=$((o,l)=>{const u=l.getRuleStack().join("-");return`uGroup_${o}_${u}`},"idFunc"),a=$(o=>t.parser.alternatives(n,r.map((l,u)=>{const h={ALT:$(()=>!0,"ALT")},d=t.parser;h.ALT=()=>{if(l.ALT(o),!d.isRecording()){const p=i(n,d);d.unorderedGroups.get(p)||d.unorderedGroups.set(p,[]);const g=d.unorderedGroups.get(p);typeof(g==null?void 0:g[u])>"u"&&(g[u]=!0)}};const f=l.GATE;return f?h.GATE=()=>f(o):h.GATE=()=>{const p=d.unorderedGroups.get(i(n,d));return!(p!=null&&p[u])},h})),"alternatives"),s=z4e(t,nz(e),a,"*");return o=>{s(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}$(hGt,"buildUnorderedGroup");function dGt(t,e){const r=e.elements.map(n=>uw(t,n));return n=>r.forEach(i=>i(n))}$(dGt,"buildGroup");function nz(t){if(GC(t))return t.guardCondition}$(nz,"getGuardCondition");function F4e(t,e,r=e.terminal){if(r)if(P1(r)&&Ku(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let a;return s=>{a??(a=Mre(t,n)),t.parser.subrule(i,a,!1,e,s)}}else if(P1(r)&&xp(r.rule.ref)){const n=t.consume++,i=Ire(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(I1(r)){const n=t.consume++,i=Ire(t,r.value);return()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const n=Ate(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+nO(e.type.ref));return F4e(t,e,i)}}$(F4e,"buildCrossReference");function fGt(t,e){const r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}$(fGt,"buildKeyword");function z4e(t,e,r,n){const i=e&&Ig(e);if(!n)if(i){const a=t.or++;return s=>t.parser.alternatives(a,[{ALT:$(()=>r(s),"ALT"),GATE:$(()=>i(s),"GATE")},{ALT:n4e(),GATE:$(()=>!i(s),"GATE")}])}else return r;if(n==="*"){const a=t.many++;return s=>t.parser.many(a,{DEF:$(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else if(n==="+"){const a=t.many++;if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:$(()=>t.parser.atLeastOne(a,{DEF:$(()=>r(o),"DEF")}),"ALT"),GATE:$(()=>i(o),"GATE")},{ALT:n4e(),GATE:$(()=>!i(o),"GATE")}])}else return s=>t.parser.atLeastOne(a,{DEF:$(()=>r(s),"DEF")})}else if(n==="?"){const a=t.optional++;return s=>t.parser.optional(a,{DEF:$(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else nw()}$(z4e,"wrap");function Mre(t,e){const r=pGt(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}$(Mre,"getRule");function pGt(t,e){if(UC(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!Ku(n);)(GC(n)||Hee(n)||lte(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}$(pGt,"getRuleName");function Ire(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}$(Ire,"getToken");function U4e(t){const e=t.Grammar,r=t.parser.Lexer,n=new nGt(t);return Lre(e,n,r.definition),n.finalize(),n}$(U4e,"createCompletionParser");function V4e(t){const e=Q4e(t);return e.finalize(),e}$(V4e,"createLangiumParser");function Q4e(t){const e=t.Grammar,r=t.parser.Lexer,n=new tGt(t);return Lre(e,n,r.definition)}$(Q4e,"prepareLangiumParser");var Pre=(XL=class{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=sa(yte(e,!1)),i=this.buildTerminalTokens(n),a=this.buildKeywordTokens(n,i,r);return a.push(...i),a}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(xp).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=vF(e),n=this.requiresCustomPattern(r)?this.regexPatternFunction(r):r,i={name:e.name,PATTERN:n};return typeof n=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=vte(r)?eh.SKIPPED:"hidden"),i}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){const r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(UC).flatMap(i=>D1(i).filter(I1)).distinct(i=>i.value).toArray().sort((i,a)=>a.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!(n!=null&&n.caseInsensitive)))}buildKeywordToken(e,r,n){const i=this.buildKeywordPattern(e,n),a={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(a.LINE_BREAKS=!0),a}buildKeywordPattern(e,r){return r?new RegExp(cR(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{const a=i==null?void 0:i.PATTERN;return a!=null&&a.source&&I_e("^"+a.source+"$",e.value)&&n.push(i),n},[])}},$(XL,"DefaultTokenBuilder"),XL),G4e=(KL=class{convert(e,r){let n=r.grammarSource;if(VC(n)&&(n=F_e(n)),P1(n)){const i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){var i;switch(e.name.toUpperCase()){case"INT":return Z0.convertInt(r);case"STRING":return Z0.convertString(r);case"ID":return Z0.convertID(r)}switch((i=q_e(e))==null?void 0:i.toLowerCase()){case"number":return Z0.convertNumber(r);case"boolean":return Z0.convertBoolean(r);case"bigint":return Z0.convertBigint(r);case"date":return Z0.convertDate(r);default:return r}}},$(KL,"DefaultValueConverter"),KL),Z0;(function(t){function e(u){let h="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}$(Nre,"delayNextTick");var Bre=0,gGt=10;function $re(){return Bre=performance.now(),new Fa.CancellationTokenSource}$($re,"startCancelableOperation");function H4e(t){gGt=t}$(H4e,"setInterruptionPeriod");var J0=Symbol("OperationCancelled");function CO(t){return t===J0}$(CO,"isOperationCancelled");async function Fl(t){if(t===Fa.CancellationToken.None)return;const e=performance.now();if(e-Bre>=gGt&&(Bre=e,await Nre(),Bre=performance.now()),t.isCancellationRequested)throw J0}$(Fl,"interruptAndCheck");var H1=(ZL=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},$(ZL,"Deferred"),ZL),mGt=(ww=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(const n of e)if(ww.isIncremental(n)){const i=q4e(n.range),a=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,a)+n.text+this._content.substring(s,this._content.length);const o=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let u=this._lineOffsets;const h=W4e(n.text,!1,a);if(l-o===h.length)for(let f=0,p=h.length;fe?i=s:n=s+1}const a=n-1;return e=this.ensureBeforeEOL(e,r[a]),{line:a,character:e-r[a]}}offsetAt(e){const r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;const n=r[e.line];if(e.character<=0)return n;const i=e.line+1r&&Y4e(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},$(ww,"FullTextDocument"),ww),Fre;(function(t){function e(i,a,s,o){return new mGt(i,a,s,o)}$(e,"create"),t.create=e;function r(i,a,s){if(i instanceof mGt)return i.update(a,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}$(r,"update"),t.update=r;function n(i,a){const s=i.getText(),o=zre(a.map(vGt),(h,d)=>{const f=h.range.start.line-d.range.start.line;return f===0?h.range.start.character-d.range.start.character:f});let l=0;const u=[];for(const h of o){const d=i.offsetAt(h.range.start);if(dl&&u.push(s.substring(l,d)),h.newText.length&&u.push(h.newText),l=i.offsetAt(h.range.end)}return u.push(s.substr(l)),u.join("")}$(n,"applyEdits"),t.applyEdits=n})(Fre||(Fre={}));function zre(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);zre(n,e),zre(i,e);let a=0,s=0,o=0;for(;ar.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}$(q4e,"getWellformedRange");function vGt(t){const e=q4e(t.range);return e!==t.range?{newText:t.newText,range:e}:t}$(vGt,"getWellformedEdit");var yGt;(()=>{var t={975:L=>{function R(P){if(typeof P!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(P))}$(R,"e");function D(P,N){for(var F,B="",V=0,z=-1,U=0,Q=0;Q<=P.length;++Q){if(Q2){var G=B.lastIndexOf("/");if(G!==B.length-1){G===-1?(B="",V=0):V=(B=B.slice(0,G)).length-1-B.lastIndexOf("/"),z=Q,U=0;continue}}else if(B.length===2||B.length===1){B="",V=0,z=Q,U=0;continue}}N&&(B.length>0?B+="/..":B="..",V=2)}else B.length>0?B+="/"+P.slice(z+1,Q):B=P.slice(z+1,Q),V=Q-z-1;z=Q,U=0}else F===46&&U!==-1?++U:U=-1}return B}$(D,"r");var M={resolve:$(function(){for(var P,N="",F=!1,B=arguments.length-1;B>=-1&&!F;B--){var V;B>=0?V=arguments[B]:(P===void 0&&(P=process.cwd()),V=P),R(V),V.length!==0&&(N=V+"/"+N,F=V.charCodeAt(0)===47)}return N=D(N,!F),F?N.length>0?"/"+N:"/":N.length>0?N:"."},"resolve"),normalize:$(function(P){if(R(P),P.length===0)return".";var N=P.charCodeAt(0)===47,F=P.charCodeAt(P.length-1)===47;return(P=D(P,!N)).length!==0||N||(P="."),P.length>0&&F&&(P+="/"),N?"/"+P:P},"normalize"),isAbsolute:$(function(P){return R(P),P.length>0&&P.charCodeAt(0)===47},"isAbsolute"),join:$(function(){if(arguments.length===0)return".";for(var P,N=0;N0&&(P===void 0?P=F:P+="/"+F)}return P===void 0?".":M.normalize(P)},"join"),relative:$(function(P,N){if(R(P),R(N),P===N||(P=M.resolve(P))===(N=M.resolve(N)))return"";for(var F=1;FQ){if(N.charCodeAt(z+X)===47)return N.slice(z+X+1);if(X===0)return N.slice(z+X)}else V>Q&&(P.charCodeAt(F+X)===47?G=X:X===0&&(G=0));break}var Y=P.charCodeAt(F+X);if(Y!==N.charCodeAt(z+X))break;Y===47&&(G=X)}var le="";for(X=F+G+1;X<=B;++X)X!==B&&P.charCodeAt(X)!==47||(le.length===0?le+="..":le+="/..");return le.length>0?le+N.slice(z+G):(z+=G,N.charCodeAt(z)===47&&++z,N.slice(z))},"relative"),_makeLong:$(function(P){return P},"_makeLong"),dirname:$(function(P){if(R(P),P.length===0)return".";for(var N=P.charCodeAt(0),F=N===47,B=-1,V=!0,z=P.length-1;z>=1;--z)if((N=P.charCodeAt(z))===47){if(!V){B=z;break}}else V=!1;return B===-1?F?"/":".":F&&B===1?"//":P.slice(0,B)},"dirname"),basename:$(function(P,N){if(N!==void 0&&typeof N!="string")throw new TypeError('"ext" argument must be a string');R(P);var F,B=0,V=-1,z=!0;if(N!==void 0&&N.length>0&&N.length<=P.length){if(N.length===P.length&&N===P)return"";var U=N.length-1,Q=-1;for(F=P.length-1;F>=0;--F){var G=P.charCodeAt(F);if(G===47){if(!z){B=F+1;break}}else Q===-1&&(z=!1,Q=F+1),U>=0&&(G===N.charCodeAt(U)?--U==-1&&(V=F):(U=-1,V=Q))}return B===V?V=Q:V===-1&&(V=P.length),P.slice(B,V)}for(F=P.length-1;F>=0;--F)if(P.charCodeAt(F)===47){if(!z){B=F+1;break}}else V===-1&&(z=!1,V=F+1);return V===-1?"":P.slice(B,V)},"basename"),extname:$(function(P){R(P);for(var N=-1,F=0,B=-1,V=!0,z=0,U=P.length-1;U>=0;--U){var Q=P.charCodeAt(U);if(Q!==47)B===-1&&(V=!1,B=U+1),Q===46?N===-1?N=U:z!==1&&(z=1):N!==-1&&(z=-1);else if(!V){F=U+1;break}}return N===-1||B===-1||z===0||z===1&&N===B-1&&N===F+1?"":P.slice(N,B)},"extname"),format:$(function(P){if(P===null||typeof P!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof P);return function(N,F){var B=F.dir||F.root,V=F.base||(F.name||"")+(F.ext||"");return B?B===F.root?B+V:B+"/"+V:V}(0,P)},"format"),parse:$(function(P){R(P);var N={root:"",dir:"",base:"",ext:"",name:""};if(P.length===0)return N;var F,B=P.charCodeAt(0),V=B===47;V?(N.root="/",F=1):F=0;for(var z=-1,U=0,Q=-1,G=!0,X=P.length-1,Y=0;X>=F;--X)if((B=P.charCodeAt(X))!==47)Q===-1&&(G=!1,Q=X+1),B===46?z===-1?z=X:Y!==1&&(Y=1):z!==-1&&(Y=-1);else if(!G){U=X+1;break}return z===-1||Q===-1||Y===0||Y===1&&z===Q-1&&z===U+1?Q!==-1&&(N.base=N.name=U===0&&V?P.slice(1,Q):P.slice(U,Q)):(U===0&&V?(N.name=P.slice(1,z),N.base=P.slice(1,Q)):(N.name=P.slice(U,z),N.base=P.slice(U,Q)),N.ext=P.slice(z,Q)),U>0?N.dir=P.slice(0,U-1):V&&(N.dir="/"),N},"parse"),sep:"/",delimiter:":",win32:null,posix:null};M.posix=M,L.exports=M}},e={};function r(L){var R=e[L];if(R!==void 0)return R.exports;var D=e[L]={exports:{}};return t[L](D,D.exports,r),D.exports}$(r,"r"),r.d=(L,R)=>{for(var D in R)r.o(R,D)&&!r.o(L,D)&&Object.defineProperty(L,D,{enumerable:!0,get:R[D]})},r.o=(L,R)=>Object.prototype.hasOwnProperty.call(L,R),r.r=L=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(L,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(L,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:$(()=>f,"URI"),Utils:$(()=>E,"Utils")}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const a=/^\w[\w\d+.-]*$/,s=/^\//,o=/^\/\//;function l(L,R){if(!L.scheme&&R)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${L.authority}", path: "${L.path}", query: "${L.query}", fragment: "${L.fragment}"}`);if(L.scheme&&!a.test(L.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(L.path){if(L.authority){if(!s.test(L.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test(L.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}$(l,"a");const u="",h="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,_=class _{constructor(R,D,M,P,N,F=!1){Bn(this,"scheme");Bn(this,"authority");Bn(this,"path");Bn(this,"query");Bn(this,"fragment");typeof R=="object"?(this.scheme=R.scheme||u,this.authority=R.authority||u,this.path=R.path||u,this.query=R.query||u,this.fragment=R.fragment||u):(this.scheme=function(B,V){return B||V?B:"file"}(R,F),this.authority=D||u,this.path=function(B,V){switch(B){case"https":case"http":case"file":V?V[0]!==h&&(V=h+V):V=h}return V}(this.scheme,M||u),this.query=P||u,this.fragment=N||u,l(this,F))}static isUri(R){return R instanceof _||!!R&&typeof R.authority=="string"&&typeof R.fragment=="string"&&typeof R.path=="string"&&typeof R.query=="string"&&typeof R.scheme=="string"&&typeof R.fsPath=="string"&&typeof R.with=="function"&&typeof R.toString=="function"}get fsPath(){return b(this,!1)}with(R){if(!R)return this;let{scheme:D,authority:M,path:P,query:N,fragment:F}=R;return D===void 0?D=this.scheme:D===null&&(D=u),M===void 0?M=this.authority:M===null&&(M=u),P===void 0?P=this.path:P===null&&(P=u),N===void 0?N=this.query:N===null&&(N=u),F===void 0?F=this.fragment:F===null&&(F=u),D===this.scheme&&M===this.authority&&P===this.path&&N===this.query&&F===this.fragment?this:new g(D,M,P,N,F)}static parse(R,D=!1){const M=d.exec(R);return M?new g(M[2]||u,S(M[4]||u),S(M[5]||u),S(M[7]||u),S(M[9]||u),D):new g(u,u,u,u,u)}static file(R){let D=u;if(i&&(R=R.replace(/\\/g,h)),R[0]===h&&R[1]===h){const M=R.indexOf(h,2);M===-1?(D=R.substring(2),R=h):(D=R.substring(2,M),R=R.substring(M)||h)}return new g("file",D,R,u,u)}static from(R){const D=new g(R.scheme,R.authority,R.path,R.query,R.fragment);return l(D,!0),D}toString(R=!1){return x(this,R)}toJSON(){return this}static revive(R){if(R){if(R instanceof _)return R;{const D=new g(R);return D._formatted=R.external,D._fsPath=R._sep===p?R.fsPath:null,D}}return R}};$(_,"l");let f=_;const p=i?1:void 0,I=class I extends f{constructor(){super(...arguments);Bn(this,"_formatted",null);Bn(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=b(this,!1)),this._fsPath}toString(D=!1){return D?x(this,!0):(this._formatted||(this._formatted=x(this,!1)),this._formatted)}toJSON(){const D={$mid:1};return this._fsPath&&(D.fsPath=this._fsPath,D._sep=p),this._formatted&&(D.external=this._formatted),this.path&&(D.path=this.path),this.scheme&&(D.scheme=this.scheme),this.authority&&(D.authority=this.authority),this.query&&(D.query=this.query),this.fragment&&(D.fragment=this.fragment),D}};$(I,"d");let g=I;const m={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function v(L,R,D){let M,P=-1;for(let N=0;N=97&&F<=122||F>=65&&F<=90||F>=48&&F<=57||F===45||F===46||F===95||F===126||R&&F===47||D&&F===91||D&&F===93||D&&F===58)P!==-1&&(M+=encodeURIComponent(L.substring(P,N)),P=-1),M!==void 0&&(M+=L.charAt(N));else{M===void 0&&(M=L.substr(0,N));const B=m[F];B!==void 0?(P!==-1&&(M+=encodeURIComponent(L.substring(P,N)),P=-1),M+=B):P===-1&&(P=N)}}return P!==-1&&(M+=encodeURIComponent(L.substring(P))),M!==void 0?M:L}$(v,"m");function y(L){let R;for(let D=0;D1&&L.scheme==="file"?`//${L.authority}${L.path}`:L.path.charCodeAt(0)===47&&(L.path.charCodeAt(1)>=65&&L.path.charCodeAt(1)<=90||L.path.charCodeAt(1)>=97&&L.path.charCodeAt(1)<=122)&&L.path.charCodeAt(2)===58?R?L.path.substr(1):L.path[1].toLowerCase()+L.path.substr(2):L.path,i&&(D=D.replace(/\//g,"\\")),D}$(b,"v");function x(L,R){const D=R?y:v;let M="",{scheme:P,authority:N,path:F,query:B,fragment:V}=L;if(P&&(M+=P,M+=":"),(N||P==="file")&&(M+=h,M+=h),N){let z=N.indexOf("@");if(z!==-1){const U=N.substr(0,z);N=N.substr(z+1),z=U.lastIndexOf(":"),z===-1?M+=D(U,!1,!1):(M+=D(U.substr(0,z),!1,!1),M+=":",M+=D(U.substr(z+1),!1,!0)),M+="@"}N=N.toLowerCase(),z=N.lastIndexOf(":"),z===-1?M+=D(N,!1,!0):(M+=D(N.substr(0,z),!1,!0),M+=N.substr(z))}if(F){if(F.length>=3&&F.charCodeAt(0)===47&&F.charCodeAt(2)===58){const z=F.charCodeAt(1);z>=65&&z<=90&&(F=`/${String.fromCharCode(z+32)}:${F.substr(3)}`)}else if(F.length>=2&&F.charCodeAt(1)===58){const z=F.charCodeAt(0);z>=65&&z<=90&&(F=`${String.fromCharCode(z+32)}:${F.substr(2)}`)}M+=D(F,!0,!1)}return B&&(M+="?",M+=D(B,!1,!1)),V&&(M+="#",M+=R?V:v(V,!1,!1)),M}$(x,"b");function w(L){try{return decodeURIComponent(L)}catch{return L.length>3?L.substr(0,3)+w(L.substr(3)):L}}$(w,"C");const A=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function S(L){return L.match(A)?L.replace(A,R=>w(R)):L}$(S,"w");var T=r(975);const O=T.posix||T,k="/";var E;(function(L){L.joinPath=function(R,...D){return R.with({path:O.join(R.path,...D)})},L.resolvePath=function(R,...D){let M=R.path,P=!1;M[0]!==k&&(M=k+M,P=!0);let N=O.resolve(M,...D);return P&&N[0]===k&&!R.authority&&(N=N.substring(1)),R.with({path:N})},L.dirname=function(R){if(R.path.length===0||R.path===k)return R;let D=O.dirname(R.path);return D.length===1&&D.charCodeAt(0)===46&&(D=""),R.with({path:D})},L.basename=function(R){return O.basename(R.path)},L.extname=function(R){return O.extname(R.path)}})(E||(E={})),yGt=n})();var{URI:cf,Utils:iz}=yGt,nh;(function(t){t.basename=iz.basename,t.dirname=iz.dirname,t.extname=iz.extname,t.joinPath=iz.joinPath,t.resolvePath=iz.resolvePath;const e=typeof process=="object"&&(process==null?void 0:process.platform)==="win32";function r(s,o){return(s==null?void 0:s.toString())===(o==null?void 0:o.toString())}$(r,"equals"),t.equals=r;function n(s,o){const l=typeof s=="string"?cf.parse(s).path:s.path,u=typeof o=="string"?cf.parse(o).path:o.path,h=l.split("/").filter(m=>m.length>0),d=u.split("/").filter(m=>m.length>0);if(e){const m=/^[A-Z]:$/;if(h[0]&&m.test(h[0])&&(h[0]=h[0].toLowerCase()),d[0]&&m.test(d[0])&&(d[0]=d[0].toLowerCase()),h[0]!==d[0])return u.substring(1)}let f=0;for(;f({name:i.name,uri:nh.joinPath(cf.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(nh.normalize(e),!1);return r?this.collectValues(r):[]}getNode(e,r){const n=e.split("/");e.charAt(e.length-1)==="/"&&n.pop();let i=this.root;for(const a of n){let s=i.children.get(a);if(!s)if(r)s={name:a,children:new Map,parent:i},i.children.set(a,s);else return;i=s}return i}collectValues(e){const r=[];e.element&&r.push(e.element);for(const n of e.children.values())r.push(...this.collectValues(n));return r}},$(JL,"UriTrie"),JL),oi;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(oi||(oi={}));var bGt=(eM=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=Fa.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??cf.parse(e.uri),Fa.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return Fa.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r,n){if(typeof r=="string"){const i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if("$model"in r){const i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){const i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{const i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let a;if(n)a={parseResult:e,uri:r,state:oi.Parsed,references:[],textDocument:n};else{const s=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:oi.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,r){var s,o;const n=(s=e.parseResult.value.$cstNode)==null?void 0:s.root.fullText,i=(o=this.textDocuments)==null?void 0:o.get(e.uri.toString()),a=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{const l=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:l})}return n!==a&&(e.parseResult=await this.parseAsync(e.uri,a,r),e.parseResult.value.$document=e),e.state=oi.Parsed,e}parse(e,r,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r,n)}parseAsync(e,r,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(r,n)}createTextDocumentGetter(e,r){const n=this.serviceRegistry;let i;return()=>i??(i=Fre.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},$(eM,"DefaultLangiumDocumentFactory"),eM),xGt=(tM=class{constructor(e){this.documentTrie=new j4e,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return sa(this.documentTrie.all())}addDocument(e){const r=e.uri.toString();if(this.documentTrie.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentTrie.insert(r,e)}getDocument(e){const r=e.toString();return this.documentTrie.find(r)}getDocuments(e){const r=e.toString();return this.documentTrie.findAll(r)}async getOrCreateDocument(e,r){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,r),this.addDocument(n),n)}createDocument(e,r,n){if(n)return this.langiumDocumentFactory.fromString(r,e,n).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&this.documentBuilder().resetToState(n,oi.Changed),n}deleteDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=oi.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){const r=e.toString(),n=this.documentTrie.findAll(r);for(const i of n)i.state=oi.Changed;return this.documentTrie.delete(r),n}},$(tM,"DefaultLangiumDocuments"),tM),OO=Symbol("RefResolving"),wGt=(rM=class{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,r=Fa.CancellationToken.None){var n;if((n=this.profiler)!=null&&n.isActive("linking")){const i=this.profiler.createTask("linking",this.languageId);i.start();try{for(const a of Og(e.parseResult.value))await Fl(r),K3(a).forEach(s=>{const o=`${a.$type}:${s.property}`;i.startSubTask(o);try{this.doLink(s,e)}finally{i.stopSubTask(o)}})}finally{i.stop()}}else for(const i of Og(e.parseResult.value))await Fl(r),K3(i).forEach(a=>this.doLink(a,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=OO;try{const i=this.getCandidate(e);if($C(i))n._ref=i;else{n._nodeDescription=i;const a=this.loadAstNode(i);n._ref=a??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${n.$refText}':`,i);const a=i.message??String(i);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${a}`}}r.references.push(n)}else if("_items"in n&&n._items===void 0){n._items=OO;try{const i=this.getCandidates(e),a=[];if($C(i))n._linkingError=i;else for(const s of i){const o=this.loadAstNode(s);o&&a.push({ref:o,$nodeDescription:s})}n._items=a}catch(i){n._linkingError={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${i}`},n._items=[]}r.references.push(n)}}unlink(e){for(const r of e.references)"_ref"in r?(r._ref=void 0,delete r._nodeDescription):"_items"in r&&(r._items=void 0,delete r._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){const n=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(i=>`${i.documentUri}#${i.path}`).toArray();return n.length>0?n:this.createLinkingError(e)}buildReference(e,r,n,i){const a=this,s={$refNode:n,$refText:i,_ref:void 0,get ref(){if(zo(this._ref))return this._ref;if(XEe(this._nodeDescription)){const o=a.loadAstNode(this._nodeDescription);this._ref=o??a.createLinkingError({reference:s,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=OO;const o=X3(e).$document,l=a.getLinkedNode({reference:s,container:e,property:r});if(l.error&&o&&o.state0))return this._linkingError=a.createLinkingError({reference:s,container:e,property:r})}};return s}throwCyclicReferenceError(e,r,n){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${n}')`)}getLinkedNode(e){try{const r=this.getCandidate(e);if($C(r))return{error:r};const n=this.loadAstNode(r);return n?{node:n,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);const n=r.message??String(r);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${n}`}}}}loadAstNode(e){if(e.node)return e.node;const r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){const n=X3(e.container).$document;n&&n.stateVC(r)&&r.isMulti)}findDeclarations(e){if(e){const r=Q_e(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(ju(i)||V0(i))return Uee(i);if(Array.isArray(i)){for(const a of i)if((ju(a)||V0(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return Uee(a)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||x_e(e,i)))return this.getSelfNodes(n)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),n=this.getNodeFromReferenceDescription(r.head());if(n){for(const i of K3(n))if(V0(i.reference)&&i.reference.items.some(a=>a.ref===e))return i.reference.items.map(a=>a.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const r=this.documents.getDocument(e.sourceUri);if(r)return this.nodeLocator.getAstNode(r.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const r=this.findDeclarations(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i)??i.$cstNode;a&&n.push(a)}return n}findReferences(e,r){const n=[];r.includeDeclaration&&n.push(...this.getSelfReferences(e));let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(a=>nh.equals(a.sourceUri,r.documentUri))),n.push(...i),sa(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i);if(a){const s=Cg(i),o=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:s.uri,sourcePath:o,targetUri:s.uri,targetPath:o,segment:oR(a),local:!0})}}return n}},$(iM,"DefaultReferences"),iM),W1=(aM=class{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return nF.sum(sa(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{const n=this.map.get(e);if(n){const i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){const r=this.map.get(e);return r?sa(r):Y3}has(e,r){if(r===void 0)return this.map.has(e);{const n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return sa(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return sa(this.map.keys())}values(){return sa(this.map.values()).flat()}entriesGroupedByKey(){return sa(this.map.entries())}},$(aM,"MultiMap"),aM),Ure=(sM=class{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[r,n]of e)this.set(r,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,r){return this.map.set(e,r),this.inverse.set(r,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}},$(sM,"BiMap"),sM),TGt=(oM=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=Fa.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=iF,i=Fa.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,r);for(const s of n(e))await Fl(i),this.addExportedSymbol(s,a,r);return a}addExportedSymbol(e,r,n){const i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async collectLocalSymbols(e,r=Fa.CancellationToken.None){const n=e.parseResult.value,i=new W1;for(const a of D1(n))await Fl(r),this.addLocalSymbol(a,e,i);return i}addLocalSymbol(e,r,n){const i=e.$container;if(i){const a=this.nameProvider.getName(e);a&&n.add(i,this.descriptions.createDescription(e,a,r))}}},$(oM,"DefaultScopeComputation"),oM),K4e=(lM=class{constructor(e,r,n){this.elements=e,this.outerScope=r,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.find(i=>i.name.toLowerCase()===r):this.elements.find(i=>i.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.filter(i=>i.name.toLowerCase()===r):this.elements.filter(i=>i.name===e);return(this.concatOuterScope||n.isEmpty())&&this.outerScope?n.concat(this.outerScope.getElements(e)):n}},$(lM,"StreamScope"),lM),Pzn=(cM=class{constructor(e,r,n){this.elements=new Map,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.set(a,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r),i=n?[n]:[];return(this.concatOuterScope||i.length>0)&&this.outerScope?sa(i).concat(this.outerScope.getElements(e)):sa(i)}getAllElements(){let e=sa(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},$(cM,"MapScope"),cM),CGt=(uM=class{constructor(e,r,n){this.elements=new W1,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(a,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r)[0];if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);return(this.concatOuterScope||n.length===0)&&this.outerScope?sa(n).concat(this.outerScope.getElements(e)):sa(n)}getAllElements(){let e=sa(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},$(uM,"MultiMapScope"),uM),Nzn={getElement(){},getElements(){return Y3},getAllElements(){return Y3}},Vre=(hM=class{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},$(hM,"DisposableCache"),hM),Z4e=(dM=class extends Vre{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){const n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},$(dM,"SimpleCache"),dM),Qre=(fM=class extends Vre{constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){const a=n();return i.set(r,a),a}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){const r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){const r=this.converter(e);let n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}},$(fM,"ContextCache"),fM),OGt=(pM=class extends Qre{constructor(e,r){super(n=>n.toString()),r?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(r,n=>{this.clear(n.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{for(const a of i)this.clear(a)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{const a=n.concat(i);for(const s of a)this.clear(s)}))}},$(pM,"DocumentCache"),pM),J4e=(gM=class extends Z4e{constructor(e,r){super(),r?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(r,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}},$(gM,"WorkspaceCache"),gM),kGt=(mM=class{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new J4e(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=Cg(e.container).localSymbols;if(i){let s=e.container;do i.has(s)&&r.push(i.getStream(s).filter(o=>this.reflection.isSubtype(o.type,n))),s=s.$container;while(s)}let a=this.getGlobalScope(n,e);for(let s=r.length-1;s>=0;s--)a=this.createScope(r[s],a);return a}createScope(e,r,n){return new K4e(sa(e),r,n)}createScopeForNodes(e,r,n){const i=sa(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new K4e(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new CGt(this.indexManager.allElements(e)))}},$(mM,"DefaultScopeProvider"),mM);function e3e(t){return typeof t.$comment=="string"}$(e3e,"isAstNodeWithComment");function t3e(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}$(t3e,"isIntermediateReference");var EGt=(vM=class{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r){const n=r??{},i=r==null?void 0:r.replacer,a=$((o,l)=>this.replacer(o,l,n),"defaultReplacer"),s=i?(o,l)=>i(o,l,a):a;try{return this.currentDocument=Cg(e),JSON.stringify(e,s,r==null?void 0:r.space)}finally{this.currentDocument=void 0}}deserialize(e,r){const n=r??{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:a,comments:s,uriConverter:o}){var l,u,h;if(!this.ignoreProperties.has(e))if(ju(r)){const d=r.ref,f=n?r.$refText:void 0;if(d){const p=Cg(d);let g="";this.currentDocument&&this.currentDocument!==p&&(o?g=o(p.uri,d):g=p.uri.toString());const m=this.astNodeLocator.getAstNodePath(d);return{$ref:`${g}#${m}`,$refText:f}}else return{$error:((l=r.error)==null?void 0:l.message)??"Could not resolve reference",$refText:f}}else if(V0(r)){const d=n?r.$refText:void 0,f=[];for(const p of r.items){const g=p.ref,m=Cg(p.ref);let v="";this.currentDocument&&this.currentDocument!==m&&(o?v=o(m.uri,g):v=m.uri.toString());const y=this.astNodeLocator.getAstNodePath(g);f.push(`${v}#${y}`)}return{$refs:f,$refText:d}}else if(zo(r)){let d;if(a&&(d=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&(d!=null&&d.$textRegion)&&(d.$textRegion.documentURI=(u=this.currentDocument)==null?void 0:u.uri.toString())),i&&!e&&(d??(d={...r}),d.$sourceText=(h=r.$cstNode)==null?void 0:h.text),s){d??(d={...r});const f=this.commentProvider.getComment(r);f&&(d.$comment=f.replace(/\r/g,""))}return d??r}else return r}addAstNodeRegionWithAssignmentsTo(e){const r=$(n=>({offset:n.offset,end:n.end,length:n.length,range:n.range}),"createDocumentSegment");if(e.$cstNode){const n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(a=>!a.startsWith("$")).forEach(a=>{const s=U_e(e.$cstNode,a).map(r);s.length!==0&&(i[a]=s)}),e}}linkNode(e,r,n,i,a,s){for(const[l,u]of Object.entries(e))if(Array.isArray(u))for(let h=0;h{await this.handleException(()=>e.call(r,n,i,a),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(a){if(CO(a))throw a;console.error(`${r}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const s=a instanceof Error?a.message:String(a);n("error",`${r}: ${s}`,{node:i})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=sa(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}registerBeforeDocument(e,r=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",r))}registerAfterDocument(e,r=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",r))}wrapPreparationException(e,r,n){return async(i,a,s,o)=>{await this.handleException(()=>e.call(n,i,a,s,o),r,a,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}},$(bM,"ValidationRegistry"),bM),DGt=Object.freeze({validateNode:!0,validateChildren:!0}),LGt=(xM=class{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,r={},n=Fa.CancellationToken.None){const i=e.parseResult,a=[];if(await Fl(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,a,r),r.stopAfterLexingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===Cp.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===Cp.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===Cp.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if(CO(s))throw s;console.error("An error occurred during validation:",s)}return await Fl(n),a}processLexingErrors(e,r,n){var a;const i=[...e.lexerErrors,...((a=e.lexerReport)==null?void 0:a.diagnostics)??[]];for(const s of i){const o=s.severity??"error",l={severity:az(o),range:{start:{line:s.line-1,character:s.column-1},end:{line:s.line-1,character:s.column+s.length-1}},message:s.message,data:n3e(o),source:this.getSource()};r.push(l)}}processParsingErrors(e,r,n){for(const i of e.parserErrors){let a;if(isNaN(i.token.startOffset)){if("previousToken"in i){const s=i.previousToken;if(isNaN(s.startOffset)){const o={line:0,character:0};a={start:o,end:o}}else{const o={line:s.endLine-1,character:s.endColumn};a={start:o,end:o}}}}else a=pF(i.token);if(a){const s={severity:az("error"),range:a,message:i.message,data:kO(Cp.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){var i;for(const a of e.references){const s=a.error;if(s){const o={node:s.info.container,range:(i=a.$refNode)==null?void 0:i.range,property:s.info.property,index:s.info.index,data:{code:Cp.LinkingError,containerType:s.info.container.$type,property:s.info.property,refText:s.info.reference.$refText}};r.push(this.toDiagnostic("error",s.message,o))}}}async validateAst(e,r,n=Fa.CancellationToken.None){const i=[],a=$((s,o,l)=>{i.push(this.toDiagnostic(s,o,l))},"acceptor");return await this.validateAstBefore(e,r,a,n),await this.validateAstNodes(e,r,a,n),await this.validateAstAfter(e,r,a,n),i}async validateAstBefore(e,r,n,i=Fa.CancellationToken.None){const a=this.validationRegistry.checksBefore;for(const s of a)await Fl(i),await s(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=Fa.CancellationToken.None){var a;if((a=this.profiler)!=null&&a.isActive("validating")){const s=this.profiler.createTask("validating",this.languageId);s.start();try{const o=Og(e).iterator();for(const l of o){s.startSubTask(l.$type);const u=this.validateSingleNodeOptions(l,r);if(u.validateNode)try{const h=this.validationRegistry.getChecks(l.$type,r.categories);for(const d of h)await d(l,n,i)}finally{s.stopSubTask(l.$type)}u.validateChildren||o.prune()}}finally{s.stop()}}else{const s=Og(e).iterator();for(const o of s){await Fl(i);const l=this.validateSingleNodeOptions(o,r);if(l.validateNode){const u=this.validationRegistry.getChecks(o.$type,r.categories);for(const h of u)await h(o,n,i)}l.validateChildren||s.prune()}}}validateSingleNodeOptions(e,r){return DGt}async validateAstAfter(e,r,n,i=Fa.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const s of a)await Fl(i),await s(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:r3e(n),severity:az(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}},$(xM,"DefaultDocumentValidator"),xM);function r3e(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=bte(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=V_e(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}$(r3e,"getDiagnosticRange");function az(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}$(az,"toDiagnosticSeverity");function n3e(t){switch(t){case"error":return kO(Cp.LexingError);case"warning":return kO(Cp.LexingWarning);case"info":return kO(Cp.LexingInfo);case"hint":return kO(Cp.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}$(n3e,"toDiagnosticData");var Cp;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(Cp||(Cp={}));var MGt=(wM=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??Cg(e);r??(r=this.nameProvider.getName(e));const a=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${a} has no name.`);let s;const o=$(()=>s??(s=oR(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return o()},selectionSegment:oR(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}},$(wM,"DefaultAstNodeDescriptionProvider"),wM),IGt=(AM=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=Fa.CancellationToken.None){const n=[],i=e.parseResult.value;for(const a of Og(i))await Fl(r),K3(a).forEach(s=>{s.reference.error||n.push(...this.createInfoDescriptions(s))});return n}createInfoDescriptions(e){const r=e.reference;if(r.error||!r.$refNode)return[];let n=[];ju(r)&&r.$nodeDescription?n=[r.$nodeDescription]:V0(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=Cg(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),s=[],o=oR(r.$refNode);for(const l of n)s.push({sourceUri:i,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:o,local:nh.equals(l.documentUri,i)});return s}},$(AM,"DefaultReferenceDescriptionProvider"),AM),PGt=(SM=class{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,a)=>{if(!i||a.length===0)return i;const s=a.indexOf(this.indexSeparator);if(s>0){const o=a.substring(0,s),l=parseInt(a.substring(s+1)),u=i[o];return u==null?void 0:u[l]}return i[a]},e)}},$(SM,"DefaultAstNodeLocator"),SM),Hre={};Ree(Hre,Gke(H3()));var NGt=(TM=class{constructor(e){this._ready=new H1,this.onConfigurationSectionUpdateEmitter=new Hre.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var r;this.workspaceConfig=((r=e.capabilities.workspace)==null?void 0:r.configuration)??!1}async initialized(e){if(this.workspaceConfig){if(e.register){const r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,a)=>{this.updateSectionConfiguration(i.section,n[a])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([r,n])=>{this.updateSectionConfiguration(r,n),this.onConfigurationSectionUpdateEmitter.fire({section:r,configuration:n})})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){await this.ready;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}},$(TM,"DefaultConfigurationProvider"),TM),Wre=Gke(mMn()),EO;(function(t){function e(r){return{dispose:$(async()=>await r(),"dispose")}}$(e,"create"),t.create=e})(EO||(EO={}));var BGt=(CM=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new W1,this.documentPhaseListeners=new W1,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=oi.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=Fa.CancellationToken.None){var i;for(const a of e){const s=a.uri.toString();if(a.state===oi.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(a,oi.IndexedReferences);else if(typeof r.validation=="object"){const o=this.findMissingValidationCategories(a,r);o.length>0&&(this.buildState.set(s,{completed:!1,options:{validation:{categories:o}},result:(i=this.buildState.get(s))==null?void 0:i.result}),a.state=oi.IndexedReferences)}}else this.buildState.delete(s)}this.currentState=oi.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=Fa.CancellationToken.None){this.currentState=oi.Changed;const i=[];for(const l of r){const u=this.langiumDocuments.deleteDocuments(l);for(const h of u)i.push(h.uri),this.cleanUpDeleted(h)}const a=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of a){let u=this.langiumDocuments.getDocument(l);u===void 0&&(u=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),u.state=oi.Changed,this.langiumDocuments.addDocument(u)),this.resetToState(u,oi.Changed)}const s=sa(a).concat(i).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!s.has(l.uri.toString())&&this.shouldRelink(l,s)).forEach(l=>this.resetToState(l,oi.ComputedScopes)),await this.emitUpdate(a,i),await Fl(n);const o=this.sortDocuments(this.langiumDocuments.all.filter(l=>{var u;return l.state=1}findMissingValidationCategories(e,r){var o,l;const n=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),a=(o=n==null?void 0:n.result)!=null&&o.validationChecks?new Set((l=n==null?void 0:n.result)==null?void 0:l.validationChecks):n!=null&&n.completed?i:new Set,s=r===void 0||r.validation===!0?i:typeof r.validation=="object"?r.validation.categories??i:[];return sa(s).filter(u=>!a.has(u)).toArray()}async findChangedUris(e){var n;if(this.langiumDocuments.getDocument(e)??((n=this.textDocuments)==null?void 0:n.get(e)))return[e];try{const i=await this.fileSystemProvider.stat(e);if(i.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(i))return[e]}catch{}return[]}async emitUpdate(e,r){await Promise.all(this.updateListeners.map(n=>n(e,r)))}sortDocuments(e){let r=0,n=e.length-1;for(;r=0&&!this.hasTextDocument(e[n]);)n--;rn.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),EO.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case oi.Changed:case oi.Parsed:this.indexManager.removeContent(e.uri);case oi.IndexedContent:e.localSymbols=void 0;case oi.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case oi.Linked:this.indexManager.removeReferences(e.uri);case oi.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case oi.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=oi.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,oi.Parsed,n,s=>this.langiumDocumentFactory.update(s,n)),await this.runCancelable(e,oi.IndexedContent,n,s=>this.indexManager.updateContent(s,n)),await this.runCancelable(e,oi.ComputedScopes,n,async s=>{const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.localSymbols=await o.collectLocalSymbols(s,n)});const i=e.filter(s=>this.shouldLink(s));await this.runCancelable(i,oi.Linked,n,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,n)),await this.runCancelable(i,oi.IndexedReferences,n,s=>this.indexManager.updateReferences(s,n));const a=e.filter(s=>this.shouldValidate(s)?!0:(this.markAsCompleted(s),!1));await this.runCancelable(a,oi.Validated,n,async s=>{await this.validate(s,n),this.markAsCompleted(s)})}markAsCompleted(e){const r=this.buildState.get(e.uri.toString());r&&(r.completed=!0)}prepareBuild(e,r){for(const n of e){const i=n.uri.toString(),a=this.buildState.get(i);(!a||a.completed)&&this.buildState.set(i,{completed:!1,options:r,result:a==null?void 0:a.result})}}async runCancelable(e,r,n,i){for(const s of e)s.states.state===r);await this.notifyBuildPhase(a,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),EO.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),EO.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=Fa.CancellationToken.None),i?this.awaitDocumentState(e,i,n):this.awaitBuilderState(e,n)}awaitDocumentState(e,r,n){const i=this.langiumDocuments.getDocument(r);if(i){if(i.state>=e)return Promise.resolve(r);if(n.isCancellationRequested)return Promise.reject(J0);if(this.currentState>=e&&e>i.state)return Promise.reject(new Wre.ResponseError(Wre.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${oi[i.state]}, requiring ${oi[e]}, but workspace state is already ${oi[this.currentState]}. Returning undefined.`))}else return Promise.reject(new Wre.ResponseError(Wre.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,u=>{nh.equals(u.uri,r)&&(o.dispose(),l.dispose(),a(u.uri))}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(J0)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(J0):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{a.dispose(),s.dispose(),i(J0)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const s of a)try{await Fl(n),await s(e,n)}catch(o){if(!CO(o))throw o}}async notifyBuildPhase(e,r,n){if(e.length===0)return;const a=this.buildPhaseListeners.get(r).slice();for(const s of a)await Fl(n),await s(e,n)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){const n=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,i=this.getBuildOptions(e),a=typeof i.validation=="object"?{...i.validation}:{};a.categories=this.findMissingValidationCategories(e,i);const s=await n.validateDocument(e,a,r);e.diagnostics?e.diagnostics.push(...s):e.diagnostics=s;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=sa(o.result.validationChecks).concat(a.categories).distinct().toArray():o.result.validationChecks=[...a.categories])}getBuildOptions(e){var r;return((r=this.buildState.get(e.uri.toString()))==null?void 0:r.options)??{}}},$(CM,"DefaultDocumentBuilder"),CM),$Gt=(OM=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new Qre,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=Cg(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{nh.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),sa(i)}allElements(e,r){let n=sa(this.symbolIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){return r?this.symbolByTypeIndex.get(e,r,()=>(this.symbolIndex.get(e)??[]).filter(a=>this.astReflection.isSubtype(a.type,r))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r)}removeReferences(e){const r=e.toString();this.referenceIndex.delete(r)}async updateContent(e,r=Fa.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,r),a=e.uri.toString();this.symbolIndex.set(a,i),this.symbolByTypeIndex.clear(a)}async updateReferences(e,r=Fa.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){const n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}},$(OM,"DefaultIndexManager"),OM),FGt=(kM=class{constructor(e){this.initialBuildOptions={},this._ready=new H1,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(r=>this.initializeWorkspace(this.folders??[],r))}async initializeWorkspace(e,r=Fa.CancellationToken.None){const n=await this.performStartup(e);await Fl(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=[],n=$(s=>{r.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)},"collector");await this.loadAdditionalDocuments(e,n);const i=[];await Promise.all(e.map(s=>this.getRootFolder(s)).map(async s=>this.traverseFolder(s,i)));const a=sa(i).distinct(s=>s.toString()).filter(s=>!this.langiumDocuments.hasDocument(s));return await this.loadWorkspaceDocuments(a,n),this._ready.resolve(),r}async loadWorkspaceDocuments(e,r){await Promise.all(e.map(async n=>{const i=await this.langiumDocuments.getOrCreateDocument(n);r(i)}))}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return cf.parse(e.uri)}async traverseFolder(e,r){try{const n=await this.fileSystemProvider.readDirectory(e);await Promise.all(n.map(async i=>{this.shouldIncludeEntry(i)&&(i.isDirectory?await this.traverseFolder(i.uri,r):i.isFile&&r.push(i.uri))}))}catch(n){console.error("Failure to read directory content of "+e.toString(!0),n)}}async searchFolder(e){const r=[];return await this.traverseFolder(e,r),r}shouldIncludeEntry(e){const r=nh.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},$(kM,"DefaultWorkspaceManager"),kM),zGt=(EM=class{buildUnexpectedCharactersMessage(e,r,n,i,a){return N5e.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return N5e.buildUnableToPopLexerModeMessage(e)}},$(EM,"DefaultLexerErrorMessageProvider"),EM),i3e={mode:"full"},a3e=(_M=class{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);const n=jre(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new eh(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=i3e){var i,a;const n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:n.groups.hidden??[],report:(a=(i=this.tokenBuilder).flushLexingReport)==null?void 0:a.call(i,e)}}toTokenTypeDictionary(e){if(jre(e))return e;const r=qre(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}},$(_M,"DefaultLexer"),_M);function Yre(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}$(Yre,"isTokenTypeArray");function qre(t){return t&&"modes"in t&&"defaultMode"in t}$(qre,"isIMultiModeLexerDefinition");function jre(t){return!Yre(t)&&!qre(t)}$(jre,"isTokenTypeDictionary"),eF();function s3e(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=ji.create(0,0));const a=l3e(t),s=Kre(n),o=VGt({lines:a,position:i,options:s});return HGt({index:0,tokens:o,position:i})}$(s3e,"parseJSDoc");function o3e(t,e){const r=Kre(e),n=l3e(t);if(n.length===0)return!1;const i=n[0],a=n[n.length-1],s=r.start,o=r.end;return!!(s!=null&&s.exec(i))&&!!(o!=null&&o.exec(a))}$(o3e,"isJSDoc");function l3e(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(CNt)}$(l3e,"getLines");var UGt=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,Bzn=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function VGt(t){var i,a,s;const e=[];let r=t.position.line,n=t.position.character;for(let o=0;o=h.length){if(e.length>0){const p=ji.create(r,n);e.push({type:"break",content:"",range:Oi.create(p,p)})}}else{UGt.lastIndex=d;const p=UGt.exec(h);if(p){const g=p[0],m=p[1],v=ji.create(r,n+d),y=ji.create(r,n+d+g.length);e.push({type:"tag",content:m,range:Oi.create(v,y)}),d+=g.length,d=Xre(h,d)}if(d0&&e[e.length-1].type==="break"?e.slice(0,-1):e}$(VGt,"tokenize");function QGt(t,e,r,n){const i=[];if(t.length===0){const a=ji.create(r,n),s=ji.create(r,n+e.length);i.push({type:"text",content:e,range:Oi.create(a,s)})}else{let a=0;for(const o of t){const l=o.index,u=e.substring(a,l);u.length>0&&i.push({type:"text",content:e.substring(a,l),range:Oi.create(ji.create(r,a+n),ji.create(r,l+n))});let h=u.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:Oi.create(ji.create(r,a+h+n),ji.create(r,a+h+d.length+n))}),h+=d.length,o.length===4){h+=o[2].length;const f=o[3];i.push({type:"text",content:f,range:Oi.create(ji.create(r,a+h+n),ji.create(r,a+h+f.length+n))})}else i.push({type:"text",content:"",range:Oi.create(ji.create(r,a+h+n),ji.create(r,a+h+n))});a=l+o[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:Oi.create(ji.create(r,a+n),ji.create(r,a+n+s.length))})}return i}$(QGt,"buildInlineTokens");var $zn=/\S/,Fzn=/\s*$/;function Xre(t,e){const r=t.substring(e).match($zn);return r?e+r.index:t.length}$(Xre,"skipWhitespace");function GGt(t){const e=t.match(Fzn);if(e&&typeof e.index=="number")return e.index}$(GGt,"lastCharacter");function HGt(t){var a,s;const e=ji.create(t.position.line,t.position.character);if(t.tokens.length===0)return new jGt([],Oi.create(e,e));const r=[];for(;t.indexr.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const r of this.elements)if(e.length===0)e=r.toString();else{const n=r.toString();e+=p3e(e)+n}return e.trim()}toMarkdown(e){let r="";for(const n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{const i=n.toMarkdown(e);r+=p3e(r)+i}return r.trim()}},$(RM,"JSDocCommentImpl"),RM),d3e=(DM=class{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`;const r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e} ${r}`),this.inline?`{${e}}`:e}toMarkdown(e){var r;return((r=e==null?void 0:e.renderTag)==null?void 0:r.call(e,this))??this.toMarkdownDefault(e)}toMarkdownDefault(e){const r=this.content.toMarkdown(e);if(this.inline){const a=XGt(this.name,r,e??{});if(typeof a=="string")return a}let n="";(e==null?void 0:e.tag)==="italic"||(e==null?void 0:e.tag)===void 0?n="*":(e==null?void 0:e.tag)==="bold"?n="**":(e==null?void 0:e.tag)==="bold-italic"&&(n="***");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} — ${r}`:this.content.inlines.length>1&&(i=`${i} ${r}`),this.inline?`{${i}}`:i}},$(DM,"JSDocTagImpl"),DM);function XGt(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let a=e;if(i>0){const o=Xre(e,i);a=e.substring(o),e=e.substring(0,i)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(a=`\`${a}\``),((n=r.renderLink)==null?void 0:n.call(r,e,a))??KGt(e,a)}}$(XGt,"renderInlineTag");function KGt(t,e){try{return cf.parse(t,!0),`[${e}](${t})`}catch{return t}}$(KGt,"renderLinkDefault");var f3e=(LM=class{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;rn.range.start.line&&(e+=` `)}return e}toMarkdown(e){let r="";for(let n=0;ni.range.start.line&&(r+=` @@ -1729,8 +1729,8 @@ ${r}`),this.inline?`{${i}}`:i}},$(DM,"JSDocTagImpl"),DM);function XGt(t,e,r){var `)?` `:` -`}$(p3e,"fillNewlines");var JGt=(IM=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&o3e(r))return s3e(r).toMarkdown({renderLink:$((i,a)=>this.documentationLinkRenderer(e,i,a),"renderLink"),renderTag:$(i=>this.documentationTagRenderer(e,i),"renderTag")})}documentationLinkRenderer(e,r,n){const i=this.findNameInLocalSymbols(e,r)??this.findNameInGlobalScope(e,r);if(i&&i.nameSegment){const a=i.nameSegment.range.start.line+1,s=i.nameSegment.range.start.character+1,o=i.documentUri.with({fragment:`L${a},${s}`});return`[${n}](${o.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){const i=Cg(e).localSymbols;if(!i)return;let a=e;do{const o=i.getStream(a).find(l=>l.name===r);if(o)return o;a=a.$container}while(a)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}},$(IM,"JSDocDocumentationProvider"),IM),eHt=(PM=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return e3e(e)?e.$comment:(r=S_e(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}},$(PM,"DefaultCommentProvider"),PM),tHt=(NM=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},$(NM,"DefaultAsyncParser"),NM),zzn=(BM=class{constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length{if(this.queue.length>0){const r=this.queue.shift();r&&(e.lock(),r.resolve(e))}}),this.workerPool.push(e)}}async parse(e,r){const n=await this.acquireParserWorker(r),i=new H1;let a;const s=r.onCancellationRequested(()=>{a=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(o=>{const l=this.hydrator.hydrate(o);i.resolve(l)}).catch(o=>{i.reject(o)}).finally(()=>{s.dispose(),clearTimeout(a)}),i.promise}terminateWorker(e){e.terminate();const r=this.workerPool.indexOf(e);r>=0&&this.workerPool.splice(r,1)}async acquireParserWorker(e){this.initializeWorkers();for(const n of this.workerPool)if(n.ready)return n.lock(),n;const r=new H1;return e.onCancellationRequested(()=>{const n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(J0)}),this.queue.push(r),r.promise}},$(BM,"AbstractThreadedAsyncParser"),BM),Uzn=($M=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new Hre.Emitter,this.deferred=new H1,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=i,r(a=>{const s=a;this.deferred.resolve(s),this.unlock()}),n(a=>{this.deferred.reject(a),this.unlock()})}terminate(){this.deferred.reject(J0),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new H1,this.sendMessage(e),this.deferred.promise}},$($M,"ParserWorker"),$M),rHt=(FM=class{constructor(){this.previousTokenSource=new Fa.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=$re();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=Fa.CancellationToken.None){const i=new H1,a={action:r,deferred:i,cancellationToken:n};return e.push(a),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:r,deferred:n,cancellationToken:i})=>{try{const a=await Promise.resolve().then(()=>r(i));n.resolve(a)}catch(a){CO(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},$(FM,"DefaultWorkspaceLock"),FM),nHt=(zM=class{constructor(e){this.grammarElementIdMap=new Ure,this.tokenTypeIdMap=new Ure,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(r=>({...r,message:r.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const r=new Map,n=new Map;for(const i of Og(e))r.set(i,{});if(e.$cstNode)for(const i of sR(e.$cstNode))n.set(i,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,r));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)zo(o)?s.push(this.dehydrateAstNode(o,r)):ju(o)?s.push(this.dehydrateReference(o,r)):s.push(o)}else zo(a)?n[i]=this.dehydrateAstNode(a,r):ju(a)?n[i]=this.dehydrateReference(a,r):a!==void 0&&(n[i]=a);return n}dehydrateReference(e,r){const n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){const n=r.cstNodes.get(e);return zee(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),R1(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):FC(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){const r=e.value,n=this.createHydrationContext(r);return"$cstNode"in r&&this.hydrateCstNode(r.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(r,n)}}createHydrationContext(e){const r=new Map,n=new Map;for(const a of Og(e))r.set(a,{});let i;if(e.$cstNode)for(const a of sR(e.$cstNode)){let s;"fullText"in a?(s=new N4e(a.fullText),i=s):"content"in a?s=new _re:"tokenType"in a&&(s=this.hydrateCstLeafNode(a)),s&&(n.set(a,s),s.root=i)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=r.cstNodes.get(e.$cstNode));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)zo(o)?s.push(this.setParent(this.hydrateAstNode(o,r),n)):ju(o)?s.push(this.hydrateReference(o,n,i,r)):s.push(o)}else zo(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):ju(a)?n[i]=this.hydrateReference(a,n,i,r):a!==void 0&&(n[i]=a);return n}setParent(e,r){return e.$container=r,e}hydrateReference(e,r,n,i){return this.linker.buildReference(r,n,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,r,n=0){const i=r.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=r.astNodes.get(e.astNode),R1(i))for(const a of e.content){const s=this.hydrateCstNode(a,r,n++);i.content.push(s)}return i}hydrateCstLeafNode(e){const r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,a=e.startLine,s=e.startColumn,o=e.endLine,l=e.endColumn,u=e.hidden;return new Ere(n,i,{start:{line:a,character:s},end:{line:o,character:l}},r,u)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const r of Og(this.grammar))Gee(r)&&this.grammarElementIdMap.set(r,e++)}},$(zM,"DefaultHydrator"),zM);function zl(t){return{documentation:{CommentProvider:$(e=>new eHt(e),"CommentProvider"),DocumentationProvider:$(e=>new JGt(e),"DocumentationProvider")},parser:{AsyncParser:$(e=>new tHt(e),"AsyncParser"),GrammarConfig:$(e=>X_e(e),"GrammarConfig"),LangiumParser:$(e=>V4e(e),"LangiumParser"),CompletionParser:$(e=>U4e(e),"CompletionParser"),ValueConverter:$(()=>new G4e,"ValueConverter"),TokenBuilder:$(()=>new Pre,"TokenBuilder"),Lexer:$(e=>new a3e(e),"Lexer"),ParserErrorMessageProvider:$(()=>new $4e,"ParserErrorMessageProvider"),LexerErrorMessageProvider:$(()=>new zGt,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:$(()=>new PGt,"AstNodeLocator"),AstNodeDescriptionProvider:$(e=>new MGt(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:$(e=>new IGt(e),"ReferenceDescriptionProvider")},references:{Linker:$(e=>new wGt(e),"Linker"),NameProvider:$(()=>new AGt,"NameProvider"),ScopeProvider:$(e=>new kGt(e),"ScopeProvider"),ScopeComputation:$(e=>new SGt(e),"ScopeComputation"),References:$(e=>new TGt(e),"References")},serializer:{Hydrator:$(e=>new nHt(e),"Hydrator"),JsonSerializer:$(e=>new EGt(e),"JsonSerializer")},validation:{DocumentValidator:$(e=>new LGt(e),"DocumentValidator"),ValidationRegistry:$(e=>new RGt(e),"ValidationRegistry")},shared:$(()=>t.shared,"shared")}}$(zl,"createDefaultCoreModule");function Ul(t){return{ServiceRegistry:$(e=>new _Gt(e),"ServiceRegistry"),workspace:{LangiumDocuments:$(e=>new xGt(e),"LangiumDocuments"),LangiumDocumentFactory:$(e=>new bGt(e),"LangiumDocumentFactory"),DocumentBuilder:$(e=>new BGt(e),"DocumentBuilder"),IndexManager:$(e=>new $Gt(e),"IndexManager"),WorkspaceManager:$(e=>new FGt(e),"WorkspaceManager"),FileSystemProvider:$(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:$(()=>new rHt,"WorkspaceLock"),ConfigurationProvider:$(e=>new NGt(e),"ConfigurationProvider")},profilers:{}}}$(Ul,"createDefaultSharedCoreModule");var g3e;(function(t){t.merge=(e,r)=>CR(CR({},e),r)})(g3e||(g3e={}));function _i(t,e,r,n,i,a,s,o,l){const u=[t,e,r,n,i,a,s,o,l].reduce(CR,{});return v3e(u)}$(_i,"inject");var iHt=Symbol("isProxy");function m3e(t){if(t&&t[iHt])for(const e of Object.values(t))m3e(e);return t}$(m3e,"eagerLoad");function v3e(t,e){const r=new Proxy({},{deleteProperty:$(()=>!1,"deleteProperty"),set:$(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:$((n,i)=>i===iHt?!0:y3e(n,i,t,e||r),"get"),getOwnPropertyDescriptor:$((n,i)=>(y3e(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),"getOwnPropertyDescriptor"),has:$((n,i)=>i in t,"has"),ownKeys:$(()=>[...Object.getOwnPropertyNames(t)],"ownKeys")});return r}$(v3e,"_inject");var aHt=Symbol();function y3e(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+t[e]);if(t[e]===aHt)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in r){const i=r[e];t[e]=aHt;try{t[e]=typeof i=="function"?i(n):v3e(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}$(y3e,"_resolve");function CR(t,e){if(e){for(const[r,n]of Object.entries(e))if(n!=null)if(typeof n=="object"){const i=t[r];typeof i=="object"&&i!==null?t[r]=CR(i,n):t[r]=CR({},n)}else t[r]=n}return t}$(CR,"_merge");var b3e={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},_O;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(_O||(_O={}));var sHt=(UM=class extends Pre{constructor(e=b3e){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...b3e,...e},this.indentTokenType=yR({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=yR({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){const n=super.buildTokens(e,r);if(!Yre(n))throw new Error("Invalid tokens built by default builder");const{indentTokenName:i,dedentTokenName:a,whitespaceTokenName:s,ignoreIndentationDelimiters:o}=this.options;let l,u,h;const d=[];for(const f of n){for(const[p,g]of o)f.name===p?f.PUSH_MODE=_O.IGNORE_INDENTATION:f.name===g&&(f.POP_MODE=!0);f.name===a?l=f:f.name===i?u=f:f.name===s?h=f:d.push(f)}if(!l||!u||!h)throw new Error("Some indentation/whitespace tokens not found!");return o.length>0?{modes:{[_O.REGULAR]:[l,u,...d,h],[_O.IGNORE_INDENTATION]:[...d,h]},defaultMode:_O.REGULAR}:[l,u,h,...d]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,r){return r===0||`\r -`.includes(e[r-1])}matchWhitespace(e,r,n,i){this.whitespaceRegExp.lastIndex=r;const a=this.whitespaceRegExp.exec(e);return{currIndentLevel:(a==null?void 0:a[0].length)??0,prevIndentLevel:this.indentationStack.at(-1),match:a}}createIndentationTokenInstance(e,r,n,i){const a=this.getLineNumber(r,i);return GF(e,n,i,i+n.length,a,a,1,n.length)}getLineNumber(e,r){return e.substring(0,r).split(/\r\n|\r|\n/).length}indentMatcher(e,r,n,i){if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,r,n,i);return a<=s?null:(this.indentationStack.push(a),o)}dedentMatcher(e,r,n,i){var d,f;if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,r,n,i);if(a>=s)return null;const l=this.indentationStack.lastIndexOf(a);if(l===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${a} at offset: ${r}. Current indentation stack: ${this.indentationStack}`,offset:r,length:((d=o==null?void 0:o[0])==null?void 0:d.length)??0,line:this.getLineNumber(e,r),column:1}),null;const u=this.indentationStack.length-l-1,h=((f=e.substring(0,r).match(/[\r\n]+$/))==null?void 0:f[0].length)??1;for(let p=0;p1;)r.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],r}},$(UM,"IndentationAwareTokenBuilder"),UM),Vzn=(VM=class extends a3e{constructor(e){if(super(e),e.parser.TokenBuilder instanceof sHt)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=i3e){const n=super.tokenize(e),i=n.report;(r==null?void 0:r.mode)==="full"&&n.tokens.push(...i.remainingDedents),i.remainingDedents=[];const{indentTokenType:a,dedentTokenType:s}=this.indentationTokenBuilder,o=a.tokenTypeIdx,l=s.tokenTypeIdx,u=[],h=n.tokens.length-1;for(let d=0;d=0&&u.push(n.tokens[h]),n.tokens=u,n}},$(VM,"IndentationAwareLexer"),VM),x3e={};X2(x3e,{AstUtils:()=>ZEe,BiMap:()=>Ure,Cancellation:()=>Fa,ContextCache:()=>Qre,CstUtils:()=>jEe,DONE_RESULT:()=>Xu,Deferred:()=>H1,Disposable:()=>EO,DisposableCache:()=>Vre,DocumentCache:()=>OGt,EMPTY_STREAM:()=>Y3,ErrorWithLocation:()=>hte,GrammarUtils:()=>__e,MultiMap:()=>W1,OperationCancelled:()=>J0,Reduction:()=>nF,RegExpUtils:()=>D_e,SimpleCache:()=>Z4e,StreamImpl:()=>Q0,TreeStreamImpl:()=>q3,URI:()=>cf,UriTrie:()=>j4e,UriUtils:()=>nh,WorkspaceCache:()=>J4e,assertCondition:()=>R_e,assertUnreachable:()=>nw,delayNextTick:()=>Nre,interruptAndCheck:()=>Fl,isOperationCancelled:()=>CO,loadGrammarFromJson:()=>Vl,setInterruptionPeriod:()=>H4e,startCancelableOperation:()=>$re,stream:()=>sa}),Ree(x3e,Hre);var oHt=(QM=class{stat(e){throw new Error("No file system is available.")}statSync(e){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}},$(QM,"EmptyFileSystemProvider"),QM),Ac={fileSystemProvider:$(()=>new oHt,"fileSystemProvider")},Qzn={Grammar:$(()=>{},"Grammar"),LanguageMetaData:$(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},Gzn={AstReflection:$(()=>new b_e,"AstReflection")};function lHt(){const t=_i(Ul(Ac),Gzn),e=_i(zl({shared:t}),Qzn);return t.ServiceRegistry.register(e),e}$(lHt,"createMinimalGrammarServices");function Vl(t){const e=lHt(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,cf.parse(`memory:/${r.name??"grammar"}.langium`)),r}$(Vl,"loadGrammarFromJson"),Ree(j6t,x3e);var Hzn=(GM=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new W1}isActive(e){return this.activeCategories.has(e)}start(...e){e?e.forEach(r=>this.activeCategories.add(r)):this.activeCategories=new Set(this.allCategories)}stop(...e){e?e.forEach(r=>this.activeCategories.delete(r)):this.activeCategories.clear()}createTask(e,r){if(!this.isActive(e))throw new Error(`Category "${e}" is not active.`);return console.log(`Creating profiling task for '${e}.${r}'.`),new cHt(n=>this.records.add(e,this.dumpRecord(e,n)),r)}dumpRecord(e,r){console.info(`Task ${e}.${r.identifier} executed in ${r.duration.toFixed(2)}ms and ended at ${r.date.toISOString()}`);const n=[];for(const s of r.entries.keys()){const o=r.entries.get(s),l=o.reduce((u,h)=>u+h);n.push({name:`${r.identifier}.${s}`,count:o.length,duration:l})}const i=r.duration-n.map(s=>s.duration).reduce((s,o)=>s+o,0);n.push({name:r.identifier,count:1,duration:i}),n.sort((s,o)=>o.duration-s.duration);function a(s){return Math.round(100*s)/100}return $(a,"Round"),console.table(n.map(s=>({Element:s.name,Count:s.count,"Self %":a(100*s.duration/r.duration),"Time (ms)":a(s.duration)}))),r}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(r=>e.some(n=>n===r[0])).flatMap(r=>r[1])}},$(GM,"DefaultLangiumProfiler"),GM),cHt=(HM=class{constructor(e,r){this.stack=[],this.entries=new W1,this.addRecord=e,this.identifier=r}start(){if(this.startTime!==void 0)throw new Error(`Task "${this.identifier}" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw new Error(`Task "${this.identifier}" was not started.`);if(this.stack.length!==0)throw new Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(r=>r.id).join(", ")}.`);const e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e),this.startTime=void 0,this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){const r=this.stack.pop();if(!r)throw new Error(`Task "${this.identifier}.${e}" was not started.`);if(r.id!==e)throw new Error(`Sub-Task "${r.id}" is not already stopped.`);const n=performance.now()-r.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=n);const i=n-r.content;this.entries.add(e,i)}},$(HM,"ProfilingTask"),HM),w3e;(t=>{t.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[^\[\]\r\n]+)\]/}})(w3e||(w3e={}));var A3e;(t=>{t.Terminals={DOMAIN_NAME:/complex|complicated|clear|chaotic|confusion/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(A3e||(A3e={}));var T3e;(t=>{t.Terminals={EM_ID:/[_a-zA-Z][\w_]*/,EM_FID:/\d{1,3}/,EM_DATA_INLINE:/\{(.*)\}|"(.*)"|'(.*)'/,EM_DATA_BLOCK:/\{[\t ]*\r?\n(?:[\S\s]*?\r?\n)?\}(?:\r?\n|(?!\S))/,EM_ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EM_ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,EM_TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,EM_WS:/\s+/,EM_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EM_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EM_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EM_ML_COMMENT:/\/\*[\s\S]*?\*\//,EM_SL_COMMENT:/\/\/[^\n\r]*/}})(T3e||(T3e={}));var S3e;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(S3e||(S3e={}));var C3e;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(C3e||(C3e={}));var O3e;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(O3e||(O3e={}));var k3e;(t=>{t.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(k3e||(k3e={}));var E3e;(t=>{t.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(E3e||(E3e={}));var _3e;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ABNF_RULENAME:/[A-Za-z][A-Za-z0-9-]*/,ABNF_STRING:/"[^"]*"/,ABNF_NUMVAL:/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\.[0-9A-Fa-f]+)*/,ABNF_REPEAT:/[0-9]*\*[0-9]*/,ABNF_EXACT_REPEAT:/[0-9]+/,ABNF_WHITESPACE:/[\t \r\n]+/,ABNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,ABNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,ABNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ABNF_COMMENT:/;[^\n\r]*/}})(_3e||(_3e={}));var R3e;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EBNF_ID:/[A-Z_a-z][\w-]*/,EBNF_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,EBNF_SPECIAL_SEQUENCE:/\?(?=[^?;]*[^?\s;][^?;]*\?)[^?;]*\?/,EBNF_WHITESPACE:/[\t \r\n]+/,EBNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EBNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EBNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EBNF_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//,EBNF_ISO_COMMENT:/\(\*[\s\S]*?\*\)/}})(R3e||(R3e={}));var D3e;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,RR_ID:/[A-Z_a-z][\w-]*/,RR_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,RR_WHITESPACE:/[\t \r\n]+/,RR_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,RR_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,RR_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,RR_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//}})(D3e||(D3e={}));var L3e;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,PEG_ID:/[A-Z_a-z][\w-]*/,PEG_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,PEG_WHITESPACE:/[\t \r\n]+/,PEG_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,PEG_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,PEG_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,PEG_LINE_COMMENT:/#[^\n\r]*/}})(L3e||(L3e={}));var M3e;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(M3e||(M3e={}));var I3e;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,CLASS_ANNOTATION:/[ \t]+:::[ \t]*[A-Za-z_][\w-]*/,ICON_ANNOTATION:/[ \t]+icon\([\w-]*(?::[\w-]+)?\)/,DESC_ANNOTATION:/[ \t]+##[^\n\r]*/,INDENTATION:/[ \t]{1,}/,QUOTED_NAME:/"[^"]*"|'[^']*'/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,BARE_NAME:/(?!:::|icon\(|##)[^ \t\n\r"'](?:(?![ \t]+:::[ \t]*[A-Za-z_]|[ \t]+icon\(|[ \t]+##)[^\n\r])*/}})(I3e||(I3e={}));var P3e;(t=>{t.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/,WS:/[ \t]+/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(P3e||(P3e={})),{...w3e.Terminals,...A3e.Terminals,...T3e.Terminals,...S3e.Terminals,...C3e.Terminals,...O3e.Terminals,...k3e.Terminals,...E3e.Terminals,..._3e.Terminals,...R3e.Terminals,...D3e.Terminals,...L3e.Terminals,...I3e.Terminals,...M3e.Terminals,...P3e.Terminals};var uHt={$type:"AbnfAlternation",alternatives:"alternatives"},hHt={$type:"AbnfConcatenation",elements:"elements"},N3e={$type:"AbnfElement",primary:"primary",repeat:"repeat"},dHt={$type:"AbnfGroup",element:"element"},fHt={$type:"AbnfNumVal",value:"value"},pHt={$type:"AbnfOptionalGroup",element:"element"},OR={$type:"AbnfPrimary"},B3e={$type:"AbnfRule",definition:"definition",name:"name"},gHt={$type:"AbnfRuleName",name:"name"},mHt={$type:"AbnfStringLiteral",value:"value"},Jre={$type:"Accelerator",name:"name",x:"x",y:"y"},$3e={$type:"Alignment",direction:"direction",members:"members"},ene={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},sz={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},F3e={$type:"Annotations",x:"x",y:"y"},ev={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function Wzn(t){return go.isInstance(t,ev.$type)}$(Wzn,"isArchitecture");var tne={$type:"Axis",label:"label",name:"name"},rne={$type:"Branch",name:"name",order:"order"};function Yzn(t){return go.isInstance(t,rne.$type)}$(Yzn,"isBranch");var vHt={$type:"Checkout",branch:"branch"},nne={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},z3e={$type:"ClassDefStatement",className:"className",styleText:"styleText"},kR={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function qzn(t){return go.isInstance(t,kR.$type)}$(qzn,"isCommit");var ine={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},RO={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},ane={$type:"Curve",entries:"entries",label:"label",name:"name"},DO={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function jzn(t){return go.isInstance(t,DO.$type)}$(jzn,"isCynefin");var sne={$type:"Deaccelerator",name:"name",x:"x",y:"y"},yHt={$type:"Decorator",strategy:"strategy"},ER={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},one={$type:"DomainBlock",domain:"domain",items:"items"};function Xzn(t){return go.isInstance(t,one.$type)}$(Xzn,"isDomainBlock");var U3e={$type:"DomainItem",label:"label"};function Kzn(t){return go.isInstance(t,U3e.$type)}$(Kzn,"isDomainItem");var bHt={$type:"EbnfChoice",alternatives:"alternatives"},xHt={$type:"EbnfExceptionPostfix",except:"except"},wHt={$type:"EbnfGroup",element:"element"},AHt={$type:"EbnfNonTerminal",name:"name"},THt={$type:"EbnfOneOrMorePostfix",operator:"operator"},SHt={$type:"EbnfOptional",element:"element"},CHt={$type:"EbnfOptionalPostfix",operator:"operator"},oz={$type:"EbnfPostfix"},LO={$type:"EbnfPrimary"},OHt={$type:"EbnfRepetition",element:"element"},V3e={$type:"EbnfRule",definition:"definition",name:"name"},kHt={$type:"EbnfSequence",elements:"elements"},EHt={$type:"EbnfSpecial",text:"text"},Q3e={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},_Ht={$type:"EbnfTerminal",value:"value"},RHt={$type:"EbnfZeroOrMorePostfix",operator:"operator"},tv={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},_R={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},MO={$type:"EmFrame"},lz={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},DHt={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},G3e={$type:"EmModelEntity",name:"name"};function Zzn(t){return t==="rmo"||t==="readmodel"||t==="ui"||t==="cmd"||t==="command"||t==="evt"||t==="event"||t==="pcr"||t==="processor"}$(Zzn,"isEmModelEntityType");var lne={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},Y1={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function LHt(t){return go.isInstance(t,Y1.$type)}$(LHt,"isEmResetFrame");var hw={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},H3e={$type:"Entry",axis:"axis",value:"value"},q1={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},MHt={$type:"Evolution",stages:"stages"},cne={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},W3e={$type:"Evolve",component:"component",target:"target"},IO={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function Jzn(t){return go.isInstance(t,IO.$type)}$(Jzn,"isGitGraph");var cz={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},uz={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function eUn(t){return go.isInstance(t,uz.$type)}$(eUn,"isInfo");var hz={$type:"Item",classSelector:"classSelector",name:"name"},Y3e={$type:"Junction",id:"id",in:"in"},dz={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},une={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},PO={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},RR={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function tUn(t){return go.isInstance(t,RR.$type)}$(tUn,"isMerge");var hne={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},q3e={$type:"Option",name:"name",value:"value"},DR={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function rUn(t){return go.isInstance(t,DR.$type)}$(rUn,"isPacket");var LR={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function nUn(t){return go.isInstance(t,LR.$type)}$(nUn,"isPacketBlock");var IHt={$type:"PegAny",dot:"dot"},PHt={$type:"PegGroup",element:"element"},NHt={$type:"PegIdentifier",name:"name"},BHt={$type:"PegLiteral",value:"value"},$Ht={$type:"PegOrderedChoice",alternatives:"alternatives"},j3e={$type:"PegPrefix",operator:"operator",suffix:"suffix"},fz={$type:"PegPrimary"},X3e={$type:"PegRule",definition:"definition",name:"name"},FHt={$type:"PegSequence",elements:"elements"},K3e={$type:"PegSuffix",operator:"operator",primary:"primary"},NO={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function iUn(t){return go.isInstance(t,NO.$type)}$(iUn,"isPie");var dne={$type:"PieSection",label:"label",value:"value"};function aUn(t){return go.isInstance(t,dne.$type)}$(aUn,"isPieSection");var Z3e={$type:"Pipeline",components:"components",parent:"parent"},fne={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},BO={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},MR={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function sUn(t){return go.isInstance(t,MR.$type)}$(sUn,"isRailroad");var IR={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function oUn(t){return go.isInstance(t,IR.$type)}$(oUn,"isRailroadAbnf");var zHt={$type:"RailroadChoiceExpr",alternatives:"alternatives"},PR={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function lUn(t){return go.isInstance(t,PR.$type)}$(lUn,"isRailroadEbnf");var j1={$type:"RailroadExpression"},UHt={$type:"RailroadNonTerminalExpr",name:"name"},VHt={$type:"RailroadOneOrMoreExpr",element:"element"},QHt={$type:"RailroadOptionalExpr",element:"element"},NR={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function cUn(t){return go.isInstance(t,NR.$type)}$(cUn,"isRailroadPeg");var J3e={$type:"RailroadRule",definition:"definition",name:"name"},GHt={$type:"RailroadSequenceExpr",elements:"elements"},HHt={$type:"RailroadSpecialExpr",text:"text"},WHt={$type:"RailroadTerminalExpr",value:"value"},YHt={$type:"RailroadZeroOrMoreExpr",element:"element"},eRe={$type:"Section",classSelector:"classSelector",name:"name"},BR={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},tRe={$type:"Size",height:"height",width:"width"},$R={$type:"Statement"},pz={$type:"Transition",from:"from",label:"label",to:"to"};function uUn(t){return go.isInstance(t,pz.$type)}$(uUn,"isTransition");var FR={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function hUn(t){return go.isInstance(t,FR.$type)}$(hUn,"isTreemap");var rRe={$type:"TreemapRow",indent:"indent",item:"item"},zR={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},gz={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},Tc={$type:"Wardley",accDescr:"accDescr",accelerators:"accelerators",accTitle:"accTitle",anchors:"anchors",annotation:"annotation",annotations:"annotations",components:"components",deaccelerators:"deaccelerators",evolution:"evolution",evolves:"evolves",links:"links",notes:"notes",pipelines:"pipelines",size:"size",title:"title"};function dUn(t){return go.isInstance(t,Tc.$type)}$(dUn,"isWardley");var qHt=(WM=class extends KEe{constructor(){super(...arguments),this.types={AbnfAlternation:{name:uHt.$type,properties:{alternatives:{name:uHt.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:hHt.$type,properties:{elements:{name:hHt.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:N3e.$type,properties:{primary:{name:N3e.primary},repeat:{name:N3e.repeat}},superTypes:[]},AbnfGroup:{name:dHt.$type,properties:{element:{name:dHt.element}},superTypes:[OR.$type]},AbnfNumVal:{name:fHt.$type,properties:{value:{name:fHt.value}},superTypes:[OR.$type]},AbnfOptionalGroup:{name:pHt.$type,properties:{element:{name:pHt.element}},superTypes:[OR.$type]},AbnfPrimary:{name:OR.$type,properties:{},superTypes:[]},AbnfRule:{name:B3e.$type,properties:{definition:{name:B3e.definition},name:{name:B3e.name}},superTypes:[]},AbnfRuleName:{name:gHt.$type,properties:{name:{name:gHt.name}},superTypes:[OR.$type]},AbnfStringLiteral:{name:mHt.$type,properties:{value:{name:mHt.value}},superTypes:[OR.$type]},Accelerator:{name:Jre.$type,properties:{name:{name:Jre.name},x:{name:Jre.x},y:{name:Jre.y}},superTypes:[]},Alignment:{name:$3e.$type,properties:{direction:{name:$3e.direction},members:{name:$3e.members,defaultValue:[]}},superTypes:[]},Anchor:{name:ene.$type,properties:{evolution:{name:ene.evolution},name:{name:ene.name},visibility:{name:ene.visibility}},superTypes:[]},Annotation:{name:sz.$type,properties:{number:{name:sz.number},text:{name:sz.text},x:{name:sz.x},y:{name:sz.y}},superTypes:[]},Annotations:{name:F3e.$type,properties:{x:{name:F3e.x},y:{name:F3e.y}},superTypes:[]},Architecture:{name:ev.$type,properties:{accDescr:{name:ev.accDescr},accTitle:{name:ev.accTitle},alignments:{name:ev.alignments,defaultValue:[]},edges:{name:ev.edges,defaultValue:[]},groups:{name:ev.groups,defaultValue:[]},junctions:{name:ev.junctions,defaultValue:[]},services:{name:ev.services,defaultValue:[]},title:{name:ev.title}},superTypes:[]},Axis:{name:tne.$type,properties:{label:{name:tne.label},name:{name:tne.name}},superTypes:[]},Branch:{name:rne.$type,properties:{name:{name:rne.name},order:{name:rne.order}},superTypes:[$R.$type]},Checkout:{name:vHt.$type,properties:{branch:{name:vHt.branch}},superTypes:[$R.$type]},CherryPicking:{name:nne.$type,properties:{id:{name:nne.id},parent:{name:nne.parent},tags:{name:nne.tags,defaultValue:[]}},superTypes:[$R.$type]},ClassDefStatement:{name:z3e.$type,properties:{className:{name:z3e.className},styleText:{name:z3e.styleText}},superTypes:[]},Commit:{name:kR.$type,properties:{id:{name:kR.id},message:{name:kR.message},tags:{name:kR.tags,defaultValue:[]},type:{name:kR.type}},superTypes:[$R.$type]},Common:{name:ine.$type,properties:{accDescr:{name:ine.accDescr},accTitle:{name:ine.accTitle},title:{name:ine.title}},superTypes:[]},Component:{name:RO.$type,properties:{decorator:{name:RO.decorator},evolution:{name:RO.evolution},inertia:{name:RO.inertia,defaultValue:!1},label:{name:RO.label},name:{name:RO.name},visibility:{name:RO.visibility}},superTypes:[]},Curve:{name:ane.$type,properties:{entries:{name:ane.entries,defaultValue:[]},label:{name:ane.label},name:{name:ane.name}},superTypes:[]},Cynefin:{name:DO.$type,properties:{accDescr:{name:DO.accDescr},accTitle:{name:DO.accTitle},domains:{name:DO.domains,defaultValue:[]},title:{name:DO.title},transitions:{name:DO.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:sne.$type,properties:{name:{name:sne.name},x:{name:sne.x},y:{name:sne.y}},superTypes:[]},Decorator:{name:yHt.$type,properties:{strategy:{name:yHt.strategy}},superTypes:[]},Direction:{name:ER.$type,properties:{accDescr:{name:ER.accDescr},accTitle:{name:ER.accTitle},dir:{name:ER.dir},statements:{name:ER.statements,defaultValue:[]},title:{name:ER.title}},superTypes:[IO.$type]},DomainBlock:{name:one.$type,properties:{domain:{name:one.domain},items:{name:one.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:U3e.$type,properties:{label:{name:U3e.label}},superTypes:[]},EbnfChoice:{name:bHt.$type,properties:{alternatives:{name:bHt.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:xHt.$type,properties:{except:{name:xHt.except}},superTypes:[oz.$type]},EbnfGroup:{name:wHt.$type,properties:{element:{name:wHt.element}},superTypes:[LO.$type]},EbnfNonTerminal:{name:AHt.$type,properties:{name:{name:AHt.name}},superTypes:[LO.$type]},EbnfOneOrMorePostfix:{name:THt.$type,properties:{operator:{name:THt.operator}},superTypes:[oz.$type]},EbnfOptional:{name:SHt.$type,properties:{element:{name:SHt.element}},superTypes:[LO.$type]},EbnfOptionalPostfix:{name:CHt.$type,properties:{operator:{name:CHt.operator}},superTypes:[oz.$type]},EbnfPostfix:{name:oz.$type,properties:{},superTypes:[]},EbnfPrimary:{name:LO.$type,properties:{},superTypes:[]},EbnfRepetition:{name:OHt.$type,properties:{element:{name:OHt.element}},superTypes:[LO.$type]},EbnfRule:{name:V3e.$type,properties:{definition:{name:V3e.definition},name:{name:V3e.name}},superTypes:[]},EbnfSequence:{name:kHt.$type,properties:{elements:{name:kHt.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:EHt.$type,properties:{text:{name:EHt.text}},superTypes:[LO.$type]},EbnfTerm:{name:Q3e.$type,properties:{base:{name:Q3e.base},postfixes:{name:Q3e.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:_Ht.$type,properties:{value:{name:_Ht.value}},superTypes:[LO.$type]},EbnfZeroOrMorePostfix:{name:RHt.$type,properties:{operator:{name:RHt.operator}},superTypes:[oz.$type]},Edge:{name:tv.$type,properties:{lhsDir:{name:tv.lhsDir},lhsGroup:{name:tv.lhsGroup,defaultValue:!1},lhsId:{name:tv.lhsId},lhsInto:{name:tv.lhsInto,defaultValue:!1},rhsDir:{name:tv.rhsDir},rhsGroup:{name:tv.rhsGroup,defaultValue:!1},rhsId:{name:tv.rhsId},rhsInto:{name:tv.rhsInto,defaultValue:!1},title:{name:tv.title}},superTypes:[]},EmDataEntity:{name:_R.$type,properties:{dataBlockValue:{name:_R.dataBlockValue},dataType:{name:_R.dataType},name:{name:_R.name}},superTypes:[]},EmFrame:{name:MO.$type,properties:{},superTypes:[]},EmGwt:{name:lz.$type,properties:{givenStatements:{name:lz.givenStatements,defaultValue:[]},sourceFrame:{name:lz.sourceFrame,referenceType:MO.$type},thenStatements:{name:lz.thenStatements,defaultValue:[]},whenStatements:{name:lz.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:DHt.$type,properties:{entityIdentifier:{name:DHt.entityIdentifier,referenceType:G3e.$type}},superTypes:[]},EmModelEntity:{name:G3e.$type,properties:{name:{name:G3e.name}},superTypes:[]},EmNoteEntity:{name:lne.$type,properties:{dataBlockValue:{name:lne.dataBlockValue},dataType:{name:lne.dataType},sourceFrame:{name:lne.sourceFrame,referenceType:MO.$type}},superTypes:[]},EmResetFrame:{name:Y1.$type,properties:{dataInlineValue:{name:Y1.dataInlineValue},dataReference:{name:Y1.dataReference,referenceType:_R.$type},dataType:{name:Y1.dataType},entityIdentifier:{name:Y1.entityIdentifier},modelEntityType:{name:Y1.modelEntityType},name:{name:Y1.name},sourceFrames:{name:Y1.sourceFrames,defaultValue:[],referenceType:MO.$type}},superTypes:[MO.$type]},EmTimeFrame:{name:hw.$type,properties:{dataInlineValue:{name:hw.dataInlineValue},dataReference:{name:hw.dataReference,referenceType:_R.$type},dataType:{name:hw.dataType},entityIdentifier:{name:hw.entityIdentifier},modelEntityType:{name:hw.modelEntityType},name:{name:hw.name},sourceFrames:{name:hw.sourceFrames,defaultValue:[],referenceType:MO.$type}},superTypes:[MO.$type]},Entry:{name:H3e.$type,properties:{axis:{name:H3e.axis,referenceType:tne.$type},value:{name:H3e.value}},superTypes:[]},EventModel:{name:q1.$type,properties:{accDescr:{name:q1.accDescr},accTitle:{name:q1.accTitle},dataEntities:{name:q1.dataEntities,defaultValue:[]},frames:{name:q1.frames,defaultValue:[]},gwtEntities:{name:q1.gwtEntities,defaultValue:[]},modelEntities:{name:q1.modelEntities,defaultValue:[]},noteEntities:{name:q1.noteEntities,defaultValue:[]},title:{name:q1.title}},superTypes:[]},Evolution:{name:MHt.$type,properties:{stages:{name:MHt.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:cne.$type,properties:{boundary:{name:cne.boundary},name:{name:cne.name},secondName:{name:cne.secondName}},superTypes:[]},Evolve:{name:W3e.$type,properties:{component:{name:W3e.component},target:{name:W3e.target}},superTypes:[]},GitGraph:{name:IO.$type,properties:{accDescr:{name:IO.accDescr},accTitle:{name:IO.accTitle},statements:{name:IO.statements,defaultValue:[]},title:{name:IO.title}},superTypes:[]},Group:{name:cz.$type,properties:{icon:{name:cz.icon},id:{name:cz.id},in:{name:cz.in},title:{name:cz.title}},superTypes:[]},Info:{name:uz.$type,properties:{accDescr:{name:uz.accDescr},accTitle:{name:uz.accTitle},title:{name:uz.title}},superTypes:[]},Item:{name:hz.$type,properties:{classSelector:{name:hz.classSelector},name:{name:hz.name}},superTypes:[]},Junction:{name:Y3e.$type,properties:{id:{name:Y3e.id},in:{name:Y3e.in}},superTypes:[]},Label:{name:dz.$type,properties:{negX:{name:dz.negX,defaultValue:!1},negY:{name:dz.negY,defaultValue:!1},offsetX:{name:dz.offsetX},offsetY:{name:dz.offsetY}},superTypes:[]},Leaf:{name:une.$type,properties:{classSelector:{name:une.classSelector},name:{name:une.name},value:{name:une.value}},superTypes:[hz.$type]},Link:{name:PO.$type,properties:{arrow:{name:PO.arrow},from:{name:PO.from},fromPort:{name:PO.fromPort},linkLabel:{name:PO.linkLabel},to:{name:PO.to},toPort:{name:PO.toPort}},superTypes:[]},Merge:{name:RR.$type,properties:{branch:{name:RR.branch},id:{name:RR.id},tags:{name:RR.tags,defaultValue:[]},type:{name:RR.type}},superTypes:[$R.$type]},Note:{name:hne.$type,properties:{evolution:{name:hne.evolution},text:{name:hne.text},visibility:{name:hne.visibility}},superTypes:[]},Option:{name:q3e.$type,properties:{name:{name:q3e.name},value:{name:q3e.value,defaultValue:!1}},superTypes:[]},Packet:{name:DR.$type,properties:{accDescr:{name:DR.accDescr},accTitle:{name:DR.accTitle},blocks:{name:DR.blocks,defaultValue:[]},title:{name:DR.title}},superTypes:[]},PacketBlock:{name:LR.$type,properties:{bits:{name:LR.bits},end:{name:LR.end},label:{name:LR.label},start:{name:LR.start}},superTypes:[]},PegAny:{name:IHt.$type,properties:{dot:{name:IHt.dot}},superTypes:[fz.$type]},PegGroup:{name:PHt.$type,properties:{element:{name:PHt.element}},superTypes:[fz.$type]},PegIdentifier:{name:NHt.$type,properties:{name:{name:NHt.name}},superTypes:[fz.$type]},PegLiteral:{name:BHt.$type,properties:{value:{name:BHt.value}},superTypes:[fz.$type]},PegOrderedChoice:{name:$Ht.$type,properties:{alternatives:{name:$Ht.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:j3e.$type,properties:{operator:{name:j3e.operator},suffix:{name:j3e.suffix}},superTypes:[]},PegPrimary:{name:fz.$type,properties:{},superTypes:[]},PegRule:{name:X3e.$type,properties:{definition:{name:X3e.definition},name:{name:X3e.name}},superTypes:[]},PegSequence:{name:FHt.$type,properties:{elements:{name:FHt.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:K3e.$type,properties:{operator:{name:K3e.operator},primary:{name:K3e.primary}},superTypes:[]},Pie:{name:NO.$type,properties:{accDescr:{name:NO.accDescr},accTitle:{name:NO.accTitle},sections:{name:NO.sections,defaultValue:[]},showData:{name:NO.showData,defaultValue:!1},title:{name:NO.title}},superTypes:[]},PieSection:{name:dne.$type,properties:{label:{name:dne.label},value:{name:dne.value}},superTypes:[]},Pipeline:{name:Z3e.$type,properties:{components:{name:Z3e.components,defaultValue:[]},parent:{name:Z3e.parent}},superTypes:[]},PipelineComponent:{name:fne.$type,properties:{evolution:{name:fne.evolution},label:{name:fne.label},name:{name:fne.name}},superTypes:[]},Radar:{name:BO.$type,properties:{accDescr:{name:BO.accDescr},accTitle:{name:BO.accTitle},axes:{name:BO.axes,defaultValue:[]},curves:{name:BO.curves,defaultValue:[]},options:{name:BO.options,defaultValue:[]},title:{name:BO.title}},superTypes:[]},Railroad:{name:MR.$type,properties:{accDescr:{name:MR.accDescr},accTitle:{name:MR.accTitle},rules:{name:MR.rules,defaultValue:[]},title:{name:MR.title}},superTypes:[]},RailroadAbnf:{name:IR.$type,properties:{accDescr:{name:IR.accDescr},accTitle:{name:IR.accTitle},rules:{name:IR.rules,defaultValue:[]},title:{name:IR.title}},superTypes:[]},RailroadChoiceExpr:{name:zHt.$type,properties:{alternatives:{name:zHt.alternatives,defaultValue:[]}},superTypes:[j1.$type]},RailroadEbnf:{name:PR.$type,properties:{accDescr:{name:PR.accDescr},accTitle:{name:PR.accTitle},rules:{name:PR.rules,defaultValue:[]},title:{name:PR.title}},superTypes:[]},RailroadExpression:{name:j1.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:UHt.$type,properties:{name:{name:UHt.name}},superTypes:[j1.$type]},RailroadOneOrMoreExpr:{name:VHt.$type,properties:{element:{name:VHt.element}},superTypes:[j1.$type]},RailroadOptionalExpr:{name:QHt.$type,properties:{element:{name:QHt.element}},superTypes:[j1.$type]},RailroadPeg:{name:NR.$type,properties:{accDescr:{name:NR.accDescr},accTitle:{name:NR.accTitle},rules:{name:NR.rules,defaultValue:[]},title:{name:NR.title}},superTypes:[]},RailroadRule:{name:J3e.$type,properties:{definition:{name:J3e.definition},name:{name:J3e.name}},superTypes:[]},RailroadSequenceExpr:{name:GHt.$type,properties:{elements:{name:GHt.elements,defaultValue:[]}},superTypes:[j1.$type]},RailroadSpecialExpr:{name:HHt.$type,properties:{text:{name:HHt.text}},superTypes:[j1.$type]},RailroadTerminalExpr:{name:WHt.$type,properties:{value:{name:WHt.value}},superTypes:[j1.$type]},RailroadZeroOrMoreExpr:{name:YHt.$type,properties:{element:{name:YHt.element}},superTypes:[j1.$type]},Section:{name:eRe.$type,properties:{classSelector:{name:eRe.classSelector},name:{name:eRe.name}},superTypes:[hz.$type]},Service:{name:BR.$type,properties:{icon:{name:BR.icon},iconText:{name:BR.iconText},id:{name:BR.id},in:{name:BR.in},title:{name:BR.title}},superTypes:[]},Size:{name:tRe.$type,properties:{height:{name:tRe.height},width:{name:tRe.width}},superTypes:[]},Statement:{name:$R.$type,properties:{},superTypes:[]},Transition:{name:pz.$type,properties:{from:{name:pz.from},label:{name:pz.label},to:{name:pz.to}},superTypes:[]},TreeNode:{name:zR.$type,properties:{classAnnotation:{name:zR.classAnnotation},descAnnotation:{name:zR.descAnnotation},iconAnnotation:{name:zR.iconAnnotation},indent:{name:zR.indent},name:{name:zR.name}},superTypes:[]},TreeView:{name:gz.$type,properties:{accDescr:{name:gz.accDescr},accTitle:{name:gz.accTitle},nodes:{name:gz.nodes,defaultValue:[]},title:{name:gz.title}},superTypes:[]},Treemap:{name:FR.$type,properties:{accDescr:{name:FR.accDescr},accTitle:{name:FR.accTitle},title:{name:FR.title},TreemapRows:{name:FR.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:rRe.$type,properties:{indent:{name:rRe.indent},item:{name:rRe.item}},superTypes:[]},Wardley:{name:Tc.$type,properties:{accDescr:{name:Tc.accDescr},accelerators:{name:Tc.accelerators,defaultValue:[]},accTitle:{name:Tc.accTitle},anchors:{name:Tc.anchors,defaultValue:[]},annotation:{name:Tc.annotation,defaultValue:[]},annotations:{name:Tc.annotations,defaultValue:[]},components:{name:Tc.components,defaultValue:[]},deaccelerators:{name:Tc.deaccelerators,defaultValue:[]},evolution:{name:Tc.evolution},evolves:{name:Tc.evolves,defaultValue:[]},links:{name:Tc.links,defaultValue:[]},notes:{name:Tc.notes,defaultValue:[]},pipelines:{name:Tc.pipelines,defaultValue:[]},size:{name:Tc.size},title:{name:Tc.title}},superTypes:[]}}}},$(WM,"MermaidAstReflection"),WM),go=new qHt,jHt,fUn=$(()=>jHt??(jHt=Vl(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"alignments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Alignment","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"align"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"row"},{"$type":"Keyword","value":"column"}]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@20"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[^\\\\[\\\\]\\\\r\\\\n]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),XHt,pUn=$(()=>XHt??(XHt=Vl(`{"$type":"Grammar","isDeclared":true,"name":"CynefinGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Cynefin","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"cynefin-beta"},{"$type":"Keyword","value":"cynefin-beta:"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"domains","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"transitions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"domain","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainItem","definition":{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Transition","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":"-->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"DOMAIN_NAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complex"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complicated"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"clear"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"chaotic"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"confusion"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"CynefinGrammarGrammar"),KHt,gUn=$(()=>KHt??(KHt=Vl('{"$type":"Grammar","isDeclared":true,"name":"EventModeling","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","entry":true,"name":"EventModel","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"eventmodeling"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"frames","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"dataEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"noteEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"gwtEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntityType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rmo"},{"$type":"Keyword","value":"readmodel"},{"$type":"Keyword","value":"ui"},{"$type":"Keyword","value":"cmd"},{"$type":"Keyword","value":"command"},{"$type":"Keyword","value":"evt"},{"$type":"Keyword","value":"event"},{"$type":"Keyword","value":"pcr"},{"$type":"Keyword","value":"processor"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"json"},{"$type":"Keyword","value":"jsobj"},{"$type":"Keyword","value":"figma"},{"$type":"Keyword","value":"salt"},{"$type":"Keyword","value":"uri"},{"$type":"Keyword","value":"md"},{"$type":"Keyword","value":"html"},{"$type":"Keyword","value":"text"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataInline","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataInlineValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataBlock","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataBlockValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedName","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmTimeFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"tf"},{"$type":"Keyword","value":"timeframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmResetFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rf"},{"$type":"Keyword","value":"resetframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmFrame","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"entity"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"data"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmNoteEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"note"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwt","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"gwt"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"given"},{"$type":"Assignment","feature":"givenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Keyword","value":"when"},{"$type":"Assignment","feature":"whenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"then"},{"$type":"Assignment","feature":"thenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwtStatement","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@9"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_EID","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_FI","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"EM_ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_FID","definition":{"$type":"RegexToken","regex":"/\\\\d{1,3}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_INLINE","definition":{"$type":"RegexToken","regex":"/\\\\{(.*)\\\\}|\\"(.*)\\"|\'(.*)\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_BLOCK","definition":{"$type":"RegexToken","regex":"/\\\\{[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?\\\\}(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EM_WS","definition":{"$type":"RegexToken","regex":"/\\\\s+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"imports":[],"types":[]}')),"EventModelingGrammar"),ZHt,mUn=$(()=>ZHt??(ZHt=Vl(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar"),JHt,vUn=$(()=>JHt??(JHt=Vl(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar"),eWt,yUn=$(()=>eWt??(eWt=Vl(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar"),tWt,bUn=$(()=>tWt??(tWt=Vl(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar"),rWt,xUn=$(()=>rWt??(rWt=Vl(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar"),nWt,wUn=$(()=>nWt??(nWt=Vl('{"$type":"Grammar","isDeclared":true,"name":"RailroadAbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_RULENAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Za-z][A-Za-z0-9-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_NUMVAL","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\\\\.[0-9A-Fa-f]+)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]*\\\\*[0-9]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_EXACT_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_COMMENT","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadAbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-abnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfAlternation","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfConcatenation","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfElement","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfStringLiteral","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfNumVal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRuleName","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfOptionalGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadAbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfAlternation","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfConcatenation","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfElement","attributes":[{"$type":"TypeAttribute","name":"repeat","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"AbnfStringLiteral","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfNumVal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfRuleName","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"AbnfOptionalGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]}],"imports":[],"types":[]}')),"RailroadAbnfGrammarGrammar"),iWt,AUn=$(()=>iWt??(iWt=Vl(`{"$type":"Grammar","isDeclared":true,"name":"RailroadEbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_SPECIAL_SEQUENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\?(?=[^?;]*[^?\\\\s;][^?;]*\\\\?)[^?;]*\\\\?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_ISO_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\(\\\\*[\\\\s\\\\S]*?\\\\*\\\\)/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadEbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-ebnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"="},{"$type":"Keyword","value":"::="}]},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":",","cardinality":"?"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerm","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"base","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"postfixes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerminal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfNonTerminal","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSpecial","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptional","returnType":{"$ref":"#/interfaces@11"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRepetition","returnType":{"$ref":"#/interfaces@12"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPostfix","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptionalPostfix","returnType":{"$ref":"#/interfaces@13"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfZeroOrMorePostfix","returnType":{"$ref":"#/interfaces@14"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOneOrMorePostfix","returnType":{"$ref":"#/interfaces@15"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfExceptionPostfix","returnType":{"$ref":"#/interfaces@16"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"except","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadEbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfTerm","attributes":[{"$type":"TypeAttribute","name":"base","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false},{"$type":"TypeAttribute","name":"postfixes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfPostfix","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfNonTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfSpecial","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptional","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfRepetition","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptionalPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfZeroOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfOneOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfExceptionPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"except","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadEbnfGrammarGrammar"),aWt,TUn=$(()=>aWt??(aWt=Vl(`{"$type":"Grammar","isDeclared":true,"name":"RailroadGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"RR_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Railroad","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadExpression","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSequenceExpr","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"sequence"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadChoiceExpr","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"choice"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOptionalExpr","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"optional"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOneOrMoreExpr","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"oneOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadZeroOrMoreExpr","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"zeroOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadTerminalExpr","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"terminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadNonTerminalExpr","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"nonterminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSpecialExpr","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"special"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"Railroad","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadExpression","attributes":[],"superTypes":[]},{"$type":"Interface","name":"RailroadSequenceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadChoiceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOptionalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOneOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadZeroOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadNonTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadSpecialExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadGrammarGrammar"),sWt,SUn=$(()=>sWt??(sWt=Vl(`{"$type":"Grammar","isDeclared":true,"name":"RailroadPegGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/#[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadPeg","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-peg-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"<-"},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegOrderedChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrefix","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"&"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"!"}}],"cardinality":"?"},{"$type":"Assignment","feature":"suffix","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSuffix","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrimary","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegLiteral","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegIdentifier","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegAny","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Assignment","feature":"dot","operator":"=","terminal":{"$type":"Keyword","value":"."}},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadPeg","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegOrderedChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegPrefix","attributes":[{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"suffix","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSuffix","attributes":[{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}},"isOptional":false},{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"PegPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"PegLiteral","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegIdentifier","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegGroup","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"PegAny","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"dot","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadPegGrammarGrammar"),oWt,CUn=$(()=>oWt??(oWt=Vl(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar"),lWt,OUn=$(()=>lWt??(lWt=Vl(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"CLASS_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+:::[ \\\\t]*[A-Za-z_][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ICON_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+icon\\\\([\\\\w-]*(?::[\\\\w-]+)?\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DESC_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+##[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"QUOTED_NAME","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"BARE_NAME","definition":{"$type":"RegexToken","regex":"/(?!:::|icon\\\\(|##)[^ \\\\t\\\\n\\\\r\\"'](?:(?![ \\\\t]+:::[ \\\\t]*[A-Za-z_]|[ \\\\t]+icon\\\\(|[ \\\\t]+##)[^\\\\n\\\\r])*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"classAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"iconAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"descAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@14"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * TreeView grammar for Langium\\n *\\n * Supports both quoted labels (\\"my file\\") and bare labels (index.js).\\n * Annotations (:::class, icon(), ## description) are parsed directly into\\n * AST fields by the grammar. Value conversion for stripping quotes, extracting\\n * class names, icon names, and description text happens in valueConverter.ts.\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treeView keyword, allowing for empty lines and comments before the\\n * treeView declaration.\\n */"}`)),"TreeViewGrammarGrammar"),cWt,kUn=$(()=>cWt??(cWt=Vl(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \\\\t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"WardleyGrammarGrammar"),EUn={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},_Un={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},RUn={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},DUn={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},LUn={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},MUn={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},IUn={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},PUn={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},NUn={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},BUn={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},$Un={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},FUn={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},zUn={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},UUn={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},VUn={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},ih={AstReflection:$(()=>new qHt,"AstReflection")},QUn={Grammar:$(()=>fUn(),"Grammar"),LanguageMetaData:$(()=>EUn,"LanguageMetaData"),parser:{}},GUn={Grammar:$(()=>pUn(),"Grammar"),LanguageMetaData:$(()=>_Un,"LanguageMetaData"),parser:{}},HUn={Grammar:$(()=>gUn(),"Grammar"),LanguageMetaData:$(()=>RUn,"LanguageMetaData"),parser:{}},WUn={Grammar:$(()=>mUn(),"Grammar"),LanguageMetaData:$(()=>DUn,"LanguageMetaData"),parser:{}},YUn={Grammar:$(()=>vUn(),"Grammar"),LanguageMetaData:$(()=>LUn,"LanguageMetaData"),parser:{}},qUn={Grammar:$(()=>yUn(),"Grammar"),LanguageMetaData:$(()=>MUn,"LanguageMetaData"),parser:{}},jUn={Grammar:$(()=>bUn(),"Grammar"),LanguageMetaData:$(()=>IUn,"LanguageMetaData"),parser:{}},XUn={Grammar:$(()=>xUn(),"Grammar"),LanguageMetaData:$(()=>PUn,"LanguageMetaData"),parser:{}},KUn={Grammar:$(()=>wUn(),"Grammar"),LanguageMetaData:$(()=>NUn,"LanguageMetaData"),parser:{}},ZUn={Grammar:$(()=>AUn(),"Grammar"),LanguageMetaData:$(()=>BUn,"LanguageMetaData"),parser:{}},JUn={Grammar:$(()=>TUn(),"Grammar"),LanguageMetaData:$(()=>$Un,"LanguageMetaData"),parser:{}},eVn={Grammar:$(()=>SUn(),"Grammar"),LanguageMetaData:$(()=>FUn,"LanguageMetaData"),parser:{}},tVn={Grammar:$(()=>CUn(),"Grammar"),LanguageMetaData:$(()=>zUn,"LanguageMetaData"),parser:{}},rVn={Grammar:$(()=>OUn(),"Grammar"),LanguageMetaData:$(()=>UUn,"LanguageMetaData"),parser:{}},nVn={Grammar:$(()=>kUn(),"Grammar"),LanguageMetaData:$(()=>VUn,"LanguageMetaData"),parser:{}},iVn=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,aVn=/accTitle[\t ]*:([^\n\r]*)/,sVn=/title([\t ][^\n\r]*|)/,oVn={ACC_DESCR:iVn,ACC_TITLE:aVn,TITLE:sVn},rv=(YM=class extends G4e{runConverter(e,r,n){let i=this.runCommonConverter(e,r,n);return i===void 0&&(i=this.runCustomConverter(e,r,n)),i===void 0?super.runConverter(e,r,n):i}runCommonConverter(e,r,n){const i=oVn[e.name];if(i===void 0)return;const a=i.exec(r);if(a!==null){if(a[1]!==void 0)return a[1].trim().replace(/[\t ]{2,}/gm," ");if(a[2]!==void 0)return a[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,` +`}$(p3e,"fillNewlines");var JGt=(IM=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&o3e(r))return s3e(r).toMarkdown({renderLink:$((i,a)=>this.documentationLinkRenderer(e,i,a),"renderLink"),renderTag:$(i=>this.documentationTagRenderer(e,i),"renderTag")})}documentationLinkRenderer(e,r,n){const i=this.findNameInLocalSymbols(e,r)??this.findNameInGlobalScope(e,r);if(i&&i.nameSegment){const a=i.nameSegment.range.start.line+1,s=i.nameSegment.range.start.character+1,o=i.documentUri.with({fragment:`L${a},${s}`});return`[${n}](${o.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){const i=Cg(e).localSymbols;if(!i)return;let a=e;do{const o=i.getStream(a).find(l=>l.name===r);if(o)return o;a=a.$container}while(a)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}},$(IM,"JSDocDocumentationProvider"),IM),eHt=(PM=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return e3e(e)?e.$comment:(r=T_e(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}},$(PM,"DefaultCommentProvider"),PM),tHt=(NM=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},$(NM,"DefaultAsyncParser"),NM),zzn=(BM=class{constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length{if(this.queue.length>0){const r=this.queue.shift();r&&(e.lock(),r.resolve(e))}}),this.workerPool.push(e)}}async parse(e,r){const n=await this.acquireParserWorker(r),i=new H1;let a;const s=r.onCancellationRequested(()=>{a=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(o=>{const l=this.hydrator.hydrate(o);i.resolve(l)}).catch(o=>{i.reject(o)}).finally(()=>{s.dispose(),clearTimeout(a)}),i.promise}terminateWorker(e){e.terminate();const r=this.workerPool.indexOf(e);r>=0&&this.workerPool.splice(r,1)}async acquireParserWorker(e){this.initializeWorkers();for(const n of this.workerPool)if(n.ready)return n.lock(),n;const r=new H1;return e.onCancellationRequested(()=>{const n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(J0)}),this.queue.push(r),r.promise}},$(BM,"AbstractThreadedAsyncParser"),BM),Uzn=($M=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new Hre.Emitter,this.deferred=new H1,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=i,r(a=>{const s=a;this.deferred.resolve(s),this.unlock()}),n(a=>{this.deferred.reject(a),this.unlock()})}terminate(){this.deferred.reject(J0),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new H1,this.sendMessage(e),this.deferred.promise}},$($M,"ParserWorker"),$M),rHt=(FM=class{constructor(){this.previousTokenSource=new Fa.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=$re();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=Fa.CancellationToken.None){const i=new H1,a={action:r,deferred:i,cancellationToken:n};return e.push(a),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:r,deferred:n,cancellationToken:i})=>{try{const a=await Promise.resolve().then(()=>r(i));n.resolve(a)}catch(a){CO(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},$(FM,"DefaultWorkspaceLock"),FM),nHt=(zM=class{constructor(e){this.grammarElementIdMap=new Ure,this.tokenTypeIdMap=new Ure,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(r=>({...r,message:r.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const r=new Map,n=new Map;for(const i of Og(e))r.set(i,{});if(e.$cstNode)for(const i of sR(e.$cstNode))n.set(i,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,r));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)zo(o)?s.push(this.dehydrateAstNode(o,r)):ju(o)?s.push(this.dehydrateReference(o,r)):s.push(o)}else zo(a)?n[i]=this.dehydrateAstNode(a,r):ju(a)?n[i]=this.dehydrateReference(a,r):a!==void 0&&(n[i]=a);return n}dehydrateReference(e,r){const n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){const n=r.cstNodes.get(e);return zee(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),R1(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):FC(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){const r=e.value,n=this.createHydrationContext(r);return"$cstNode"in r&&this.hydrateCstNode(r.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(r,n)}}createHydrationContext(e){const r=new Map,n=new Map;for(const a of Og(e))r.set(a,{});let i;if(e.$cstNode)for(const a of sR(e.$cstNode)){let s;"fullText"in a?(s=new N4e(a.fullText),i=s):"content"in a?s=new _re:"tokenType"in a&&(s=this.hydrateCstLeafNode(a)),s&&(n.set(a,s),s.root=i)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=r.cstNodes.get(e.$cstNode));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)zo(o)?s.push(this.setParent(this.hydrateAstNode(o,r),n)):ju(o)?s.push(this.hydrateReference(o,n,i,r)):s.push(o)}else zo(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):ju(a)?n[i]=this.hydrateReference(a,n,i,r):a!==void 0&&(n[i]=a);return n}setParent(e,r){return e.$container=r,e}hydrateReference(e,r,n,i){return this.linker.buildReference(r,n,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,r,n=0){const i=r.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=r.astNodes.get(e.astNode),R1(i))for(const a of e.content){const s=this.hydrateCstNode(a,r,n++);i.content.push(s)}return i}hydrateCstLeafNode(e){const r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,a=e.startLine,s=e.startColumn,o=e.endLine,l=e.endColumn,u=e.hidden;return new Ere(n,i,{start:{line:a,character:s},end:{line:o,character:l}},r,u)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const r of Og(this.grammar))Gee(r)&&this.grammarElementIdMap.set(r,e++)}},$(zM,"DefaultHydrator"),zM);function zl(t){return{documentation:{CommentProvider:$(e=>new eHt(e),"CommentProvider"),DocumentationProvider:$(e=>new JGt(e),"DocumentationProvider")},parser:{AsyncParser:$(e=>new tHt(e),"AsyncParser"),GrammarConfig:$(e=>X_e(e),"GrammarConfig"),LangiumParser:$(e=>V4e(e),"LangiumParser"),CompletionParser:$(e=>U4e(e),"CompletionParser"),ValueConverter:$(()=>new G4e,"ValueConverter"),TokenBuilder:$(()=>new Pre,"TokenBuilder"),Lexer:$(e=>new a3e(e),"Lexer"),ParserErrorMessageProvider:$(()=>new $4e,"ParserErrorMessageProvider"),LexerErrorMessageProvider:$(()=>new zGt,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:$(()=>new PGt,"AstNodeLocator"),AstNodeDescriptionProvider:$(e=>new MGt(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:$(e=>new IGt(e),"ReferenceDescriptionProvider")},references:{Linker:$(e=>new wGt(e),"Linker"),NameProvider:$(()=>new AGt,"NameProvider"),ScopeProvider:$(e=>new kGt(e),"ScopeProvider"),ScopeComputation:$(e=>new TGt(e),"ScopeComputation"),References:$(e=>new SGt(e),"References")},serializer:{Hydrator:$(e=>new nHt(e),"Hydrator"),JsonSerializer:$(e=>new EGt(e),"JsonSerializer")},validation:{DocumentValidator:$(e=>new LGt(e),"DocumentValidator"),ValidationRegistry:$(e=>new RGt(e),"ValidationRegistry")},shared:$(()=>t.shared,"shared")}}$(zl,"createDefaultCoreModule");function Ul(t){return{ServiceRegistry:$(e=>new _Gt(e),"ServiceRegistry"),workspace:{LangiumDocuments:$(e=>new xGt(e),"LangiumDocuments"),LangiumDocumentFactory:$(e=>new bGt(e),"LangiumDocumentFactory"),DocumentBuilder:$(e=>new BGt(e),"DocumentBuilder"),IndexManager:$(e=>new $Gt(e),"IndexManager"),WorkspaceManager:$(e=>new FGt(e),"WorkspaceManager"),FileSystemProvider:$(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:$(()=>new rHt,"WorkspaceLock"),ConfigurationProvider:$(e=>new NGt(e),"ConfigurationProvider")},profilers:{}}}$(Ul,"createDefaultSharedCoreModule");var g3e;(function(t){t.merge=(e,r)=>CR(CR({},e),r)})(g3e||(g3e={}));function _i(t,e,r,n,i,a,s,o,l){const u=[t,e,r,n,i,a,s,o,l].reduce(CR,{});return v3e(u)}$(_i,"inject");var iHt=Symbol("isProxy");function m3e(t){if(t&&t[iHt])for(const e of Object.values(t))m3e(e);return t}$(m3e,"eagerLoad");function v3e(t,e){const r=new Proxy({},{deleteProperty:$(()=>!1,"deleteProperty"),set:$(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:$((n,i)=>i===iHt?!0:y3e(n,i,t,e||r),"get"),getOwnPropertyDescriptor:$((n,i)=>(y3e(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),"getOwnPropertyDescriptor"),has:$((n,i)=>i in t,"has"),ownKeys:$(()=>[...Object.getOwnPropertyNames(t)],"ownKeys")});return r}$(v3e,"_inject");var aHt=Symbol();function y3e(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+t[e]);if(t[e]===aHt)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in r){const i=r[e];t[e]=aHt;try{t[e]=typeof i=="function"?i(n):v3e(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}$(y3e,"_resolve");function CR(t,e){if(e){for(const[r,n]of Object.entries(e))if(n!=null)if(typeof n=="object"){const i=t[r];typeof i=="object"&&i!==null?t[r]=CR(i,n):t[r]=CR({},n)}else t[r]=n}return t}$(CR,"_merge");var b3e={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},_O;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(_O||(_O={}));var sHt=(UM=class extends Pre{constructor(e=b3e){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...b3e,...e},this.indentTokenType=yR({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=yR({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){const n=super.buildTokens(e,r);if(!Yre(n))throw new Error("Invalid tokens built by default builder");const{indentTokenName:i,dedentTokenName:a,whitespaceTokenName:s,ignoreIndentationDelimiters:o}=this.options;let l,u,h;const d=[];for(const f of n){for(const[p,g]of o)f.name===p?f.PUSH_MODE=_O.IGNORE_INDENTATION:f.name===g&&(f.POP_MODE=!0);f.name===a?l=f:f.name===i?u=f:f.name===s?h=f:d.push(f)}if(!l||!u||!h)throw new Error("Some indentation/whitespace tokens not found!");return o.length>0?{modes:{[_O.REGULAR]:[l,u,...d,h],[_O.IGNORE_INDENTATION]:[...d,h]},defaultMode:_O.REGULAR}:[l,u,h,...d]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,r){return r===0||`\r +`.includes(e[r-1])}matchWhitespace(e,r,n,i){this.whitespaceRegExp.lastIndex=r;const a=this.whitespaceRegExp.exec(e);return{currIndentLevel:(a==null?void 0:a[0].length)??0,prevIndentLevel:this.indentationStack.at(-1),match:a}}createIndentationTokenInstance(e,r,n,i){const a=this.getLineNumber(r,i);return GF(e,n,i,i+n.length,a,a,1,n.length)}getLineNumber(e,r){return e.substring(0,r).split(/\r\n|\r|\n/).length}indentMatcher(e,r,n,i){if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,r,n,i);return a<=s?null:(this.indentationStack.push(a),o)}dedentMatcher(e,r,n,i){var d,f;if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,r,n,i);if(a>=s)return null;const l=this.indentationStack.lastIndexOf(a);if(l===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${a} at offset: ${r}. Current indentation stack: ${this.indentationStack}`,offset:r,length:((d=o==null?void 0:o[0])==null?void 0:d.length)??0,line:this.getLineNumber(e,r),column:1}),null;const u=this.indentationStack.length-l-1,h=((f=e.substring(0,r).match(/[\r\n]+$/))==null?void 0:f[0].length)??1;for(let p=0;p1;)r.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],r}},$(UM,"IndentationAwareTokenBuilder"),UM),Vzn=(VM=class extends a3e{constructor(e){if(super(e),e.parser.TokenBuilder instanceof sHt)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=i3e){const n=super.tokenize(e),i=n.report;(r==null?void 0:r.mode)==="full"&&n.tokens.push(...i.remainingDedents),i.remainingDedents=[];const{indentTokenType:a,dedentTokenType:s}=this.indentationTokenBuilder,o=a.tokenTypeIdx,l=s.tokenTypeIdx,u=[],h=n.tokens.length-1;for(let d=0;d=0&&u.push(n.tokens[h]),n.tokens=u,n}},$(VM,"IndentationAwareLexer"),VM),x3e={};X2(x3e,{AstUtils:()=>ZEe,BiMap:()=>Ure,Cancellation:()=>Fa,ContextCache:()=>Qre,CstUtils:()=>jEe,DONE_RESULT:()=>Xu,Deferred:()=>H1,Disposable:()=>EO,DisposableCache:()=>Vre,DocumentCache:()=>OGt,EMPTY_STREAM:()=>Y3,ErrorWithLocation:()=>hte,GrammarUtils:()=>__e,MultiMap:()=>W1,OperationCancelled:()=>J0,Reduction:()=>nF,RegExpUtils:()=>D_e,SimpleCache:()=>Z4e,StreamImpl:()=>Q0,TreeStreamImpl:()=>q3,URI:()=>cf,UriTrie:()=>j4e,UriUtils:()=>nh,WorkspaceCache:()=>J4e,assertCondition:()=>R_e,assertUnreachable:()=>nw,delayNextTick:()=>Nre,interruptAndCheck:()=>Fl,isOperationCancelled:()=>CO,loadGrammarFromJson:()=>Vl,setInterruptionPeriod:()=>H4e,startCancelableOperation:()=>$re,stream:()=>sa}),Ree(x3e,Hre);var oHt=(QM=class{stat(e){throw new Error("No file system is available.")}statSync(e){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}},$(QM,"EmptyFileSystemProvider"),QM),Ac={fileSystemProvider:$(()=>new oHt,"fileSystemProvider")},Qzn={Grammar:$(()=>{},"Grammar"),LanguageMetaData:$(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},Gzn={AstReflection:$(()=>new b_e,"AstReflection")};function lHt(){const t=_i(Ul(Ac),Gzn),e=_i(zl({shared:t}),Qzn);return t.ServiceRegistry.register(e),e}$(lHt,"createMinimalGrammarServices");function Vl(t){const e=lHt(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,cf.parse(`memory:/${r.name??"grammar"}.langium`)),r}$(Vl,"loadGrammarFromJson"),Ree(j6t,x3e);var Hzn=(GM=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new W1}isActive(e){return this.activeCategories.has(e)}start(...e){e?e.forEach(r=>this.activeCategories.add(r)):this.activeCategories=new Set(this.allCategories)}stop(...e){e?e.forEach(r=>this.activeCategories.delete(r)):this.activeCategories.clear()}createTask(e,r){if(!this.isActive(e))throw new Error(`Category "${e}" is not active.`);return console.log(`Creating profiling task for '${e}.${r}'.`),new cHt(n=>this.records.add(e,this.dumpRecord(e,n)),r)}dumpRecord(e,r){console.info(`Task ${e}.${r.identifier} executed in ${r.duration.toFixed(2)}ms and ended at ${r.date.toISOString()}`);const n=[];for(const s of r.entries.keys()){const o=r.entries.get(s),l=o.reduce((u,h)=>u+h);n.push({name:`${r.identifier}.${s}`,count:o.length,duration:l})}const i=r.duration-n.map(s=>s.duration).reduce((s,o)=>s+o,0);n.push({name:r.identifier,count:1,duration:i}),n.sort((s,o)=>o.duration-s.duration);function a(s){return Math.round(100*s)/100}return $(a,"Round"),console.table(n.map(s=>({Element:s.name,Count:s.count,"Self %":a(100*s.duration/r.duration),"Time (ms)":a(s.duration)}))),r}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(r=>e.some(n=>n===r[0])).flatMap(r=>r[1])}},$(GM,"DefaultLangiumProfiler"),GM),cHt=(HM=class{constructor(e,r){this.stack=[],this.entries=new W1,this.addRecord=e,this.identifier=r}start(){if(this.startTime!==void 0)throw new Error(`Task "${this.identifier}" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw new Error(`Task "${this.identifier}" was not started.`);if(this.stack.length!==0)throw new Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(r=>r.id).join(", ")}.`);const e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e),this.startTime=void 0,this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){const r=this.stack.pop();if(!r)throw new Error(`Task "${this.identifier}.${e}" was not started.`);if(r.id!==e)throw new Error(`Sub-Task "${r.id}" is not already stopped.`);const n=performance.now()-r.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=n);const i=n-r.content;this.entries.add(e,i)}},$(HM,"ProfilingTask"),HM),w3e;(t=>{t.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[^\[\]\r\n]+)\]/}})(w3e||(w3e={}));var A3e;(t=>{t.Terminals={DOMAIN_NAME:/complex|complicated|clear|chaotic|confusion/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(A3e||(A3e={}));var S3e;(t=>{t.Terminals={EM_ID:/[_a-zA-Z][\w_]*/,EM_FID:/\d{1,3}/,EM_DATA_INLINE:/\{(.*)\}|"(.*)"|'(.*)'/,EM_DATA_BLOCK:/\{[\t ]*\r?\n(?:[\S\s]*?\r?\n)?\}(?:\r?\n|(?!\S))/,EM_ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EM_ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,EM_TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,EM_WS:/\s+/,EM_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EM_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EM_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EM_ML_COMMENT:/\/\*[\s\S]*?\*\//,EM_SL_COMMENT:/\/\/[^\n\r]*/}})(S3e||(S3e={}));var T3e;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(T3e||(T3e={}));var C3e;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(C3e||(C3e={}));var O3e;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(O3e||(O3e={}));var k3e;(t=>{t.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(k3e||(k3e={}));var E3e;(t=>{t.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(E3e||(E3e={}));var _3e;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ABNF_RULENAME:/[A-Za-z][A-Za-z0-9-]*/,ABNF_STRING:/"[^"]*"/,ABNF_NUMVAL:/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\.[0-9A-Fa-f]+)*/,ABNF_REPEAT:/[0-9]*\*[0-9]*/,ABNF_EXACT_REPEAT:/[0-9]+/,ABNF_WHITESPACE:/[\t \r\n]+/,ABNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,ABNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,ABNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ABNF_COMMENT:/;[^\n\r]*/}})(_3e||(_3e={}));var R3e;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EBNF_ID:/[A-Z_a-z][\w-]*/,EBNF_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,EBNF_SPECIAL_SEQUENCE:/\?(?=[^?;]*[^?\s;][^?;]*\?)[^?;]*\?/,EBNF_WHITESPACE:/[\t \r\n]+/,EBNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EBNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EBNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EBNF_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//,EBNF_ISO_COMMENT:/\(\*[\s\S]*?\*\)/}})(R3e||(R3e={}));var D3e;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,RR_ID:/[A-Z_a-z][\w-]*/,RR_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,RR_WHITESPACE:/[\t \r\n]+/,RR_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,RR_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,RR_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,RR_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//}})(D3e||(D3e={}));var L3e;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,PEG_ID:/[A-Z_a-z][\w-]*/,PEG_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,PEG_WHITESPACE:/[\t \r\n]+/,PEG_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,PEG_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,PEG_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,PEG_LINE_COMMENT:/#[^\n\r]*/}})(L3e||(L3e={}));var M3e;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(M3e||(M3e={}));var I3e;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,CLASS_ANNOTATION:/[ \t]+:::[ \t]*[A-Za-z_][\w-]*/,ICON_ANNOTATION:/[ \t]+icon\([\w-]*(?::[\w-]+)?\)/,DESC_ANNOTATION:/[ \t]+##[^\n\r]*/,INDENTATION:/[ \t]{1,}/,QUOTED_NAME:/"[^"]*"|'[^']*'/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,BARE_NAME:/(?!:::|icon\(|##)[^ \t\n\r"'](?:(?![ \t]+:::[ \t]*[A-Za-z_]|[ \t]+icon\(|[ \t]+##)[^\n\r])*/}})(I3e||(I3e={}));var P3e;(t=>{t.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/,WS:/[ \t]+/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(P3e||(P3e={})),{...w3e.Terminals,...A3e.Terminals,...S3e.Terminals,...T3e.Terminals,...C3e.Terminals,...O3e.Terminals,...k3e.Terminals,...E3e.Terminals,..._3e.Terminals,...R3e.Terminals,...D3e.Terminals,...L3e.Terminals,...I3e.Terminals,...M3e.Terminals,...P3e.Terminals};var uHt={$type:"AbnfAlternation",alternatives:"alternatives"},hHt={$type:"AbnfConcatenation",elements:"elements"},N3e={$type:"AbnfElement",primary:"primary",repeat:"repeat"},dHt={$type:"AbnfGroup",element:"element"},fHt={$type:"AbnfNumVal",value:"value"},pHt={$type:"AbnfOptionalGroup",element:"element"},OR={$type:"AbnfPrimary"},B3e={$type:"AbnfRule",definition:"definition",name:"name"},gHt={$type:"AbnfRuleName",name:"name"},mHt={$type:"AbnfStringLiteral",value:"value"},Jre={$type:"Accelerator",name:"name",x:"x",y:"y"},$3e={$type:"Alignment",direction:"direction",members:"members"},ene={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},sz={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},F3e={$type:"Annotations",x:"x",y:"y"},ev={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function Wzn(t){return go.isInstance(t,ev.$type)}$(Wzn,"isArchitecture");var tne={$type:"Axis",label:"label",name:"name"},rne={$type:"Branch",name:"name",order:"order"};function Yzn(t){return go.isInstance(t,rne.$type)}$(Yzn,"isBranch");var vHt={$type:"Checkout",branch:"branch"},nne={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},z3e={$type:"ClassDefStatement",className:"className",styleText:"styleText"},kR={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function qzn(t){return go.isInstance(t,kR.$type)}$(qzn,"isCommit");var ine={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},RO={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},ane={$type:"Curve",entries:"entries",label:"label",name:"name"},DO={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function jzn(t){return go.isInstance(t,DO.$type)}$(jzn,"isCynefin");var sne={$type:"Deaccelerator",name:"name",x:"x",y:"y"},yHt={$type:"Decorator",strategy:"strategy"},ER={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},one={$type:"DomainBlock",domain:"domain",items:"items"};function Xzn(t){return go.isInstance(t,one.$type)}$(Xzn,"isDomainBlock");var U3e={$type:"DomainItem",label:"label"};function Kzn(t){return go.isInstance(t,U3e.$type)}$(Kzn,"isDomainItem");var bHt={$type:"EbnfChoice",alternatives:"alternatives"},xHt={$type:"EbnfExceptionPostfix",except:"except"},wHt={$type:"EbnfGroup",element:"element"},AHt={$type:"EbnfNonTerminal",name:"name"},SHt={$type:"EbnfOneOrMorePostfix",operator:"operator"},THt={$type:"EbnfOptional",element:"element"},CHt={$type:"EbnfOptionalPostfix",operator:"operator"},oz={$type:"EbnfPostfix"},LO={$type:"EbnfPrimary"},OHt={$type:"EbnfRepetition",element:"element"},V3e={$type:"EbnfRule",definition:"definition",name:"name"},kHt={$type:"EbnfSequence",elements:"elements"},EHt={$type:"EbnfSpecial",text:"text"},Q3e={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},_Ht={$type:"EbnfTerminal",value:"value"},RHt={$type:"EbnfZeroOrMorePostfix",operator:"operator"},tv={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},_R={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},MO={$type:"EmFrame"},lz={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},DHt={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},G3e={$type:"EmModelEntity",name:"name"};function Zzn(t){return t==="rmo"||t==="readmodel"||t==="ui"||t==="cmd"||t==="command"||t==="evt"||t==="event"||t==="pcr"||t==="processor"}$(Zzn,"isEmModelEntityType");var lne={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},Y1={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function LHt(t){return go.isInstance(t,Y1.$type)}$(LHt,"isEmResetFrame");var hw={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},H3e={$type:"Entry",axis:"axis",value:"value"},q1={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},MHt={$type:"Evolution",stages:"stages"},cne={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},W3e={$type:"Evolve",component:"component",target:"target"},IO={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function Jzn(t){return go.isInstance(t,IO.$type)}$(Jzn,"isGitGraph");var cz={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},uz={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function eUn(t){return go.isInstance(t,uz.$type)}$(eUn,"isInfo");var hz={$type:"Item",classSelector:"classSelector",name:"name"},Y3e={$type:"Junction",id:"id",in:"in"},dz={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},une={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},PO={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},RR={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function tUn(t){return go.isInstance(t,RR.$type)}$(tUn,"isMerge");var hne={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},q3e={$type:"Option",name:"name",value:"value"},DR={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function rUn(t){return go.isInstance(t,DR.$type)}$(rUn,"isPacket");var LR={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function nUn(t){return go.isInstance(t,LR.$type)}$(nUn,"isPacketBlock");var IHt={$type:"PegAny",dot:"dot"},PHt={$type:"PegGroup",element:"element"},NHt={$type:"PegIdentifier",name:"name"},BHt={$type:"PegLiteral",value:"value"},$Ht={$type:"PegOrderedChoice",alternatives:"alternatives"},j3e={$type:"PegPrefix",operator:"operator",suffix:"suffix"},fz={$type:"PegPrimary"},X3e={$type:"PegRule",definition:"definition",name:"name"},FHt={$type:"PegSequence",elements:"elements"},K3e={$type:"PegSuffix",operator:"operator",primary:"primary"},NO={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function iUn(t){return go.isInstance(t,NO.$type)}$(iUn,"isPie");var dne={$type:"PieSection",label:"label",value:"value"};function aUn(t){return go.isInstance(t,dne.$type)}$(aUn,"isPieSection");var Z3e={$type:"Pipeline",components:"components",parent:"parent"},fne={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},BO={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},MR={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function sUn(t){return go.isInstance(t,MR.$type)}$(sUn,"isRailroad");var IR={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function oUn(t){return go.isInstance(t,IR.$type)}$(oUn,"isRailroadAbnf");var zHt={$type:"RailroadChoiceExpr",alternatives:"alternatives"},PR={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function lUn(t){return go.isInstance(t,PR.$type)}$(lUn,"isRailroadEbnf");var j1={$type:"RailroadExpression"},UHt={$type:"RailroadNonTerminalExpr",name:"name"},VHt={$type:"RailroadOneOrMoreExpr",element:"element"},QHt={$type:"RailroadOptionalExpr",element:"element"},NR={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function cUn(t){return go.isInstance(t,NR.$type)}$(cUn,"isRailroadPeg");var J3e={$type:"RailroadRule",definition:"definition",name:"name"},GHt={$type:"RailroadSequenceExpr",elements:"elements"},HHt={$type:"RailroadSpecialExpr",text:"text"},WHt={$type:"RailroadTerminalExpr",value:"value"},YHt={$type:"RailroadZeroOrMoreExpr",element:"element"},eRe={$type:"Section",classSelector:"classSelector",name:"name"},BR={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},tRe={$type:"Size",height:"height",width:"width"},$R={$type:"Statement"},pz={$type:"Transition",from:"from",label:"label",to:"to"};function uUn(t){return go.isInstance(t,pz.$type)}$(uUn,"isTransition");var FR={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function hUn(t){return go.isInstance(t,FR.$type)}$(hUn,"isTreemap");var rRe={$type:"TreemapRow",indent:"indent",item:"item"},zR={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},gz={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},Sc={$type:"Wardley",accDescr:"accDescr",accelerators:"accelerators",accTitle:"accTitle",anchors:"anchors",annotation:"annotation",annotations:"annotations",components:"components",deaccelerators:"deaccelerators",evolution:"evolution",evolves:"evolves",links:"links",notes:"notes",pipelines:"pipelines",size:"size",title:"title"};function dUn(t){return go.isInstance(t,Sc.$type)}$(dUn,"isWardley");var qHt=(WM=class extends KEe{constructor(){super(...arguments),this.types={AbnfAlternation:{name:uHt.$type,properties:{alternatives:{name:uHt.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:hHt.$type,properties:{elements:{name:hHt.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:N3e.$type,properties:{primary:{name:N3e.primary},repeat:{name:N3e.repeat}},superTypes:[]},AbnfGroup:{name:dHt.$type,properties:{element:{name:dHt.element}},superTypes:[OR.$type]},AbnfNumVal:{name:fHt.$type,properties:{value:{name:fHt.value}},superTypes:[OR.$type]},AbnfOptionalGroup:{name:pHt.$type,properties:{element:{name:pHt.element}},superTypes:[OR.$type]},AbnfPrimary:{name:OR.$type,properties:{},superTypes:[]},AbnfRule:{name:B3e.$type,properties:{definition:{name:B3e.definition},name:{name:B3e.name}},superTypes:[]},AbnfRuleName:{name:gHt.$type,properties:{name:{name:gHt.name}},superTypes:[OR.$type]},AbnfStringLiteral:{name:mHt.$type,properties:{value:{name:mHt.value}},superTypes:[OR.$type]},Accelerator:{name:Jre.$type,properties:{name:{name:Jre.name},x:{name:Jre.x},y:{name:Jre.y}},superTypes:[]},Alignment:{name:$3e.$type,properties:{direction:{name:$3e.direction},members:{name:$3e.members,defaultValue:[]}},superTypes:[]},Anchor:{name:ene.$type,properties:{evolution:{name:ene.evolution},name:{name:ene.name},visibility:{name:ene.visibility}},superTypes:[]},Annotation:{name:sz.$type,properties:{number:{name:sz.number},text:{name:sz.text},x:{name:sz.x},y:{name:sz.y}},superTypes:[]},Annotations:{name:F3e.$type,properties:{x:{name:F3e.x},y:{name:F3e.y}},superTypes:[]},Architecture:{name:ev.$type,properties:{accDescr:{name:ev.accDescr},accTitle:{name:ev.accTitle},alignments:{name:ev.alignments,defaultValue:[]},edges:{name:ev.edges,defaultValue:[]},groups:{name:ev.groups,defaultValue:[]},junctions:{name:ev.junctions,defaultValue:[]},services:{name:ev.services,defaultValue:[]},title:{name:ev.title}},superTypes:[]},Axis:{name:tne.$type,properties:{label:{name:tne.label},name:{name:tne.name}},superTypes:[]},Branch:{name:rne.$type,properties:{name:{name:rne.name},order:{name:rne.order}},superTypes:[$R.$type]},Checkout:{name:vHt.$type,properties:{branch:{name:vHt.branch}},superTypes:[$R.$type]},CherryPicking:{name:nne.$type,properties:{id:{name:nne.id},parent:{name:nne.parent},tags:{name:nne.tags,defaultValue:[]}},superTypes:[$R.$type]},ClassDefStatement:{name:z3e.$type,properties:{className:{name:z3e.className},styleText:{name:z3e.styleText}},superTypes:[]},Commit:{name:kR.$type,properties:{id:{name:kR.id},message:{name:kR.message},tags:{name:kR.tags,defaultValue:[]},type:{name:kR.type}},superTypes:[$R.$type]},Common:{name:ine.$type,properties:{accDescr:{name:ine.accDescr},accTitle:{name:ine.accTitle},title:{name:ine.title}},superTypes:[]},Component:{name:RO.$type,properties:{decorator:{name:RO.decorator},evolution:{name:RO.evolution},inertia:{name:RO.inertia,defaultValue:!1},label:{name:RO.label},name:{name:RO.name},visibility:{name:RO.visibility}},superTypes:[]},Curve:{name:ane.$type,properties:{entries:{name:ane.entries,defaultValue:[]},label:{name:ane.label},name:{name:ane.name}},superTypes:[]},Cynefin:{name:DO.$type,properties:{accDescr:{name:DO.accDescr},accTitle:{name:DO.accTitle},domains:{name:DO.domains,defaultValue:[]},title:{name:DO.title},transitions:{name:DO.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:sne.$type,properties:{name:{name:sne.name},x:{name:sne.x},y:{name:sne.y}},superTypes:[]},Decorator:{name:yHt.$type,properties:{strategy:{name:yHt.strategy}},superTypes:[]},Direction:{name:ER.$type,properties:{accDescr:{name:ER.accDescr},accTitle:{name:ER.accTitle},dir:{name:ER.dir},statements:{name:ER.statements,defaultValue:[]},title:{name:ER.title}},superTypes:[IO.$type]},DomainBlock:{name:one.$type,properties:{domain:{name:one.domain},items:{name:one.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:U3e.$type,properties:{label:{name:U3e.label}},superTypes:[]},EbnfChoice:{name:bHt.$type,properties:{alternatives:{name:bHt.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:xHt.$type,properties:{except:{name:xHt.except}},superTypes:[oz.$type]},EbnfGroup:{name:wHt.$type,properties:{element:{name:wHt.element}},superTypes:[LO.$type]},EbnfNonTerminal:{name:AHt.$type,properties:{name:{name:AHt.name}},superTypes:[LO.$type]},EbnfOneOrMorePostfix:{name:SHt.$type,properties:{operator:{name:SHt.operator}},superTypes:[oz.$type]},EbnfOptional:{name:THt.$type,properties:{element:{name:THt.element}},superTypes:[LO.$type]},EbnfOptionalPostfix:{name:CHt.$type,properties:{operator:{name:CHt.operator}},superTypes:[oz.$type]},EbnfPostfix:{name:oz.$type,properties:{},superTypes:[]},EbnfPrimary:{name:LO.$type,properties:{},superTypes:[]},EbnfRepetition:{name:OHt.$type,properties:{element:{name:OHt.element}},superTypes:[LO.$type]},EbnfRule:{name:V3e.$type,properties:{definition:{name:V3e.definition},name:{name:V3e.name}},superTypes:[]},EbnfSequence:{name:kHt.$type,properties:{elements:{name:kHt.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:EHt.$type,properties:{text:{name:EHt.text}},superTypes:[LO.$type]},EbnfTerm:{name:Q3e.$type,properties:{base:{name:Q3e.base},postfixes:{name:Q3e.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:_Ht.$type,properties:{value:{name:_Ht.value}},superTypes:[LO.$type]},EbnfZeroOrMorePostfix:{name:RHt.$type,properties:{operator:{name:RHt.operator}},superTypes:[oz.$type]},Edge:{name:tv.$type,properties:{lhsDir:{name:tv.lhsDir},lhsGroup:{name:tv.lhsGroup,defaultValue:!1},lhsId:{name:tv.lhsId},lhsInto:{name:tv.lhsInto,defaultValue:!1},rhsDir:{name:tv.rhsDir},rhsGroup:{name:tv.rhsGroup,defaultValue:!1},rhsId:{name:tv.rhsId},rhsInto:{name:tv.rhsInto,defaultValue:!1},title:{name:tv.title}},superTypes:[]},EmDataEntity:{name:_R.$type,properties:{dataBlockValue:{name:_R.dataBlockValue},dataType:{name:_R.dataType},name:{name:_R.name}},superTypes:[]},EmFrame:{name:MO.$type,properties:{},superTypes:[]},EmGwt:{name:lz.$type,properties:{givenStatements:{name:lz.givenStatements,defaultValue:[]},sourceFrame:{name:lz.sourceFrame,referenceType:MO.$type},thenStatements:{name:lz.thenStatements,defaultValue:[]},whenStatements:{name:lz.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:DHt.$type,properties:{entityIdentifier:{name:DHt.entityIdentifier,referenceType:G3e.$type}},superTypes:[]},EmModelEntity:{name:G3e.$type,properties:{name:{name:G3e.name}},superTypes:[]},EmNoteEntity:{name:lne.$type,properties:{dataBlockValue:{name:lne.dataBlockValue},dataType:{name:lne.dataType},sourceFrame:{name:lne.sourceFrame,referenceType:MO.$type}},superTypes:[]},EmResetFrame:{name:Y1.$type,properties:{dataInlineValue:{name:Y1.dataInlineValue},dataReference:{name:Y1.dataReference,referenceType:_R.$type},dataType:{name:Y1.dataType},entityIdentifier:{name:Y1.entityIdentifier},modelEntityType:{name:Y1.modelEntityType},name:{name:Y1.name},sourceFrames:{name:Y1.sourceFrames,defaultValue:[],referenceType:MO.$type}},superTypes:[MO.$type]},EmTimeFrame:{name:hw.$type,properties:{dataInlineValue:{name:hw.dataInlineValue},dataReference:{name:hw.dataReference,referenceType:_R.$type},dataType:{name:hw.dataType},entityIdentifier:{name:hw.entityIdentifier},modelEntityType:{name:hw.modelEntityType},name:{name:hw.name},sourceFrames:{name:hw.sourceFrames,defaultValue:[],referenceType:MO.$type}},superTypes:[MO.$type]},Entry:{name:H3e.$type,properties:{axis:{name:H3e.axis,referenceType:tne.$type},value:{name:H3e.value}},superTypes:[]},EventModel:{name:q1.$type,properties:{accDescr:{name:q1.accDescr},accTitle:{name:q1.accTitle},dataEntities:{name:q1.dataEntities,defaultValue:[]},frames:{name:q1.frames,defaultValue:[]},gwtEntities:{name:q1.gwtEntities,defaultValue:[]},modelEntities:{name:q1.modelEntities,defaultValue:[]},noteEntities:{name:q1.noteEntities,defaultValue:[]},title:{name:q1.title}},superTypes:[]},Evolution:{name:MHt.$type,properties:{stages:{name:MHt.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:cne.$type,properties:{boundary:{name:cne.boundary},name:{name:cne.name},secondName:{name:cne.secondName}},superTypes:[]},Evolve:{name:W3e.$type,properties:{component:{name:W3e.component},target:{name:W3e.target}},superTypes:[]},GitGraph:{name:IO.$type,properties:{accDescr:{name:IO.accDescr},accTitle:{name:IO.accTitle},statements:{name:IO.statements,defaultValue:[]},title:{name:IO.title}},superTypes:[]},Group:{name:cz.$type,properties:{icon:{name:cz.icon},id:{name:cz.id},in:{name:cz.in},title:{name:cz.title}},superTypes:[]},Info:{name:uz.$type,properties:{accDescr:{name:uz.accDescr},accTitle:{name:uz.accTitle},title:{name:uz.title}},superTypes:[]},Item:{name:hz.$type,properties:{classSelector:{name:hz.classSelector},name:{name:hz.name}},superTypes:[]},Junction:{name:Y3e.$type,properties:{id:{name:Y3e.id},in:{name:Y3e.in}},superTypes:[]},Label:{name:dz.$type,properties:{negX:{name:dz.negX,defaultValue:!1},negY:{name:dz.negY,defaultValue:!1},offsetX:{name:dz.offsetX},offsetY:{name:dz.offsetY}},superTypes:[]},Leaf:{name:une.$type,properties:{classSelector:{name:une.classSelector},name:{name:une.name},value:{name:une.value}},superTypes:[hz.$type]},Link:{name:PO.$type,properties:{arrow:{name:PO.arrow},from:{name:PO.from},fromPort:{name:PO.fromPort},linkLabel:{name:PO.linkLabel},to:{name:PO.to},toPort:{name:PO.toPort}},superTypes:[]},Merge:{name:RR.$type,properties:{branch:{name:RR.branch},id:{name:RR.id},tags:{name:RR.tags,defaultValue:[]},type:{name:RR.type}},superTypes:[$R.$type]},Note:{name:hne.$type,properties:{evolution:{name:hne.evolution},text:{name:hne.text},visibility:{name:hne.visibility}},superTypes:[]},Option:{name:q3e.$type,properties:{name:{name:q3e.name},value:{name:q3e.value,defaultValue:!1}},superTypes:[]},Packet:{name:DR.$type,properties:{accDescr:{name:DR.accDescr},accTitle:{name:DR.accTitle},blocks:{name:DR.blocks,defaultValue:[]},title:{name:DR.title}},superTypes:[]},PacketBlock:{name:LR.$type,properties:{bits:{name:LR.bits},end:{name:LR.end},label:{name:LR.label},start:{name:LR.start}},superTypes:[]},PegAny:{name:IHt.$type,properties:{dot:{name:IHt.dot}},superTypes:[fz.$type]},PegGroup:{name:PHt.$type,properties:{element:{name:PHt.element}},superTypes:[fz.$type]},PegIdentifier:{name:NHt.$type,properties:{name:{name:NHt.name}},superTypes:[fz.$type]},PegLiteral:{name:BHt.$type,properties:{value:{name:BHt.value}},superTypes:[fz.$type]},PegOrderedChoice:{name:$Ht.$type,properties:{alternatives:{name:$Ht.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:j3e.$type,properties:{operator:{name:j3e.operator},suffix:{name:j3e.suffix}},superTypes:[]},PegPrimary:{name:fz.$type,properties:{},superTypes:[]},PegRule:{name:X3e.$type,properties:{definition:{name:X3e.definition},name:{name:X3e.name}},superTypes:[]},PegSequence:{name:FHt.$type,properties:{elements:{name:FHt.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:K3e.$type,properties:{operator:{name:K3e.operator},primary:{name:K3e.primary}},superTypes:[]},Pie:{name:NO.$type,properties:{accDescr:{name:NO.accDescr},accTitle:{name:NO.accTitle},sections:{name:NO.sections,defaultValue:[]},showData:{name:NO.showData,defaultValue:!1},title:{name:NO.title}},superTypes:[]},PieSection:{name:dne.$type,properties:{label:{name:dne.label},value:{name:dne.value}},superTypes:[]},Pipeline:{name:Z3e.$type,properties:{components:{name:Z3e.components,defaultValue:[]},parent:{name:Z3e.parent}},superTypes:[]},PipelineComponent:{name:fne.$type,properties:{evolution:{name:fne.evolution},label:{name:fne.label},name:{name:fne.name}},superTypes:[]},Radar:{name:BO.$type,properties:{accDescr:{name:BO.accDescr},accTitle:{name:BO.accTitle},axes:{name:BO.axes,defaultValue:[]},curves:{name:BO.curves,defaultValue:[]},options:{name:BO.options,defaultValue:[]},title:{name:BO.title}},superTypes:[]},Railroad:{name:MR.$type,properties:{accDescr:{name:MR.accDescr},accTitle:{name:MR.accTitle},rules:{name:MR.rules,defaultValue:[]},title:{name:MR.title}},superTypes:[]},RailroadAbnf:{name:IR.$type,properties:{accDescr:{name:IR.accDescr},accTitle:{name:IR.accTitle},rules:{name:IR.rules,defaultValue:[]},title:{name:IR.title}},superTypes:[]},RailroadChoiceExpr:{name:zHt.$type,properties:{alternatives:{name:zHt.alternatives,defaultValue:[]}},superTypes:[j1.$type]},RailroadEbnf:{name:PR.$type,properties:{accDescr:{name:PR.accDescr},accTitle:{name:PR.accTitle},rules:{name:PR.rules,defaultValue:[]},title:{name:PR.title}},superTypes:[]},RailroadExpression:{name:j1.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:UHt.$type,properties:{name:{name:UHt.name}},superTypes:[j1.$type]},RailroadOneOrMoreExpr:{name:VHt.$type,properties:{element:{name:VHt.element}},superTypes:[j1.$type]},RailroadOptionalExpr:{name:QHt.$type,properties:{element:{name:QHt.element}},superTypes:[j1.$type]},RailroadPeg:{name:NR.$type,properties:{accDescr:{name:NR.accDescr},accTitle:{name:NR.accTitle},rules:{name:NR.rules,defaultValue:[]},title:{name:NR.title}},superTypes:[]},RailroadRule:{name:J3e.$type,properties:{definition:{name:J3e.definition},name:{name:J3e.name}},superTypes:[]},RailroadSequenceExpr:{name:GHt.$type,properties:{elements:{name:GHt.elements,defaultValue:[]}},superTypes:[j1.$type]},RailroadSpecialExpr:{name:HHt.$type,properties:{text:{name:HHt.text}},superTypes:[j1.$type]},RailroadTerminalExpr:{name:WHt.$type,properties:{value:{name:WHt.value}},superTypes:[j1.$type]},RailroadZeroOrMoreExpr:{name:YHt.$type,properties:{element:{name:YHt.element}},superTypes:[j1.$type]},Section:{name:eRe.$type,properties:{classSelector:{name:eRe.classSelector},name:{name:eRe.name}},superTypes:[hz.$type]},Service:{name:BR.$type,properties:{icon:{name:BR.icon},iconText:{name:BR.iconText},id:{name:BR.id},in:{name:BR.in},title:{name:BR.title}},superTypes:[]},Size:{name:tRe.$type,properties:{height:{name:tRe.height},width:{name:tRe.width}},superTypes:[]},Statement:{name:$R.$type,properties:{},superTypes:[]},Transition:{name:pz.$type,properties:{from:{name:pz.from},label:{name:pz.label},to:{name:pz.to}},superTypes:[]},TreeNode:{name:zR.$type,properties:{classAnnotation:{name:zR.classAnnotation},descAnnotation:{name:zR.descAnnotation},iconAnnotation:{name:zR.iconAnnotation},indent:{name:zR.indent},name:{name:zR.name}},superTypes:[]},TreeView:{name:gz.$type,properties:{accDescr:{name:gz.accDescr},accTitle:{name:gz.accTitle},nodes:{name:gz.nodes,defaultValue:[]},title:{name:gz.title}},superTypes:[]},Treemap:{name:FR.$type,properties:{accDescr:{name:FR.accDescr},accTitle:{name:FR.accTitle},title:{name:FR.title},TreemapRows:{name:FR.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:rRe.$type,properties:{indent:{name:rRe.indent},item:{name:rRe.item}},superTypes:[]},Wardley:{name:Sc.$type,properties:{accDescr:{name:Sc.accDescr},accelerators:{name:Sc.accelerators,defaultValue:[]},accTitle:{name:Sc.accTitle},anchors:{name:Sc.anchors,defaultValue:[]},annotation:{name:Sc.annotation,defaultValue:[]},annotations:{name:Sc.annotations,defaultValue:[]},components:{name:Sc.components,defaultValue:[]},deaccelerators:{name:Sc.deaccelerators,defaultValue:[]},evolution:{name:Sc.evolution},evolves:{name:Sc.evolves,defaultValue:[]},links:{name:Sc.links,defaultValue:[]},notes:{name:Sc.notes,defaultValue:[]},pipelines:{name:Sc.pipelines,defaultValue:[]},size:{name:Sc.size},title:{name:Sc.title}},superTypes:[]}}}},$(WM,"MermaidAstReflection"),WM),go=new qHt,jHt,fUn=$(()=>jHt??(jHt=Vl(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"alignments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Alignment","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"align"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"row"},{"$type":"Keyword","value":"column"}]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@20"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[^\\\\[\\\\]\\\\r\\\\n]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),XHt,pUn=$(()=>XHt??(XHt=Vl(`{"$type":"Grammar","isDeclared":true,"name":"CynefinGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Cynefin","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"cynefin-beta"},{"$type":"Keyword","value":"cynefin-beta:"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"domains","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"transitions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"domain","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainItem","definition":{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Transition","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":"-->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"DOMAIN_NAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complex"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complicated"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"clear"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"chaotic"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"confusion"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"CynefinGrammarGrammar"),KHt,gUn=$(()=>KHt??(KHt=Vl('{"$type":"Grammar","isDeclared":true,"name":"EventModeling","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","entry":true,"name":"EventModel","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"eventmodeling"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"frames","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"dataEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"noteEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"gwtEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntityType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rmo"},{"$type":"Keyword","value":"readmodel"},{"$type":"Keyword","value":"ui"},{"$type":"Keyword","value":"cmd"},{"$type":"Keyword","value":"command"},{"$type":"Keyword","value":"evt"},{"$type":"Keyword","value":"event"},{"$type":"Keyword","value":"pcr"},{"$type":"Keyword","value":"processor"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"json"},{"$type":"Keyword","value":"jsobj"},{"$type":"Keyword","value":"figma"},{"$type":"Keyword","value":"salt"},{"$type":"Keyword","value":"uri"},{"$type":"Keyword","value":"md"},{"$type":"Keyword","value":"html"},{"$type":"Keyword","value":"text"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataInline","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataInlineValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataBlock","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataBlockValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedName","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmTimeFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"tf"},{"$type":"Keyword","value":"timeframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmResetFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rf"},{"$type":"Keyword","value":"resetframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmFrame","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"entity"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"data"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmNoteEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"note"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwt","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"gwt"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"given"},{"$type":"Assignment","feature":"givenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Keyword","value":"when"},{"$type":"Assignment","feature":"whenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"then"},{"$type":"Assignment","feature":"thenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwtStatement","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@9"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_EID","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_FI","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"EM_ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_FID","definition":{"$type":"RegexToken","regex":"/\\\\d{1,3}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_INLINE","definition":{"$type":"RegexToken","regex":"/\\\\{(.*)\\\\}|\\"(.*)\\"|\'(.*)\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_BLOCK","definition":{"$type":"RegexToken","regex":"/\\\\{[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?\\\\}(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EM_WS","definition":{"$type":"RegexToken","regex":"/\\\\s+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"imports":[],"types":[]}')),"EventModelingGrammar"),ZHt,mUn=$(()=>ZHt??(ZHt=Vl(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar"),JHt,vUn=$(()=>JHt??(JHt=Vl(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar"),eWt,yUn=$(()=>eWt??(eWt=Vl(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar"),tWt,bUn=$(()=>tWt??(tWt=Vl(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar"),rWt,xUn=$(()=>rWt??(rWt=Vl(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar"),nWt,wUn=$(()=>nWt??(nWt=Vl('{"$type":"Grammar","isDeclared":true,"name":"RailroadAbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_RULENAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Za-z][A-Za-z0-9-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_NUMVAL","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\\\\.[0-9A-Fa-f]+)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]*\\\\*[0-9]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_EXACT_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_COMMENT","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadAbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-abnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfAlternation","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfConcatenation","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfElement","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfStringLiteral","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfNumVal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRuleName","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfOptionalGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadAbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfAlternation","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfConcatenation","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfElement","attributes":[{"$type":"TypeAttribute","name":"repeat","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"AbnfStringLiteral","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfNumVal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfRuleName","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"AbnfOptionalGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]}],"imports":[],"types":[]}')),"RailroadAbnfGrammarGrammar"),iWt,AUn=$(()=>iWt??(iWt=Vl(`{"$type":"Grammar","isDeclared":true,"name":"RailroadEbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_SPECIAL_SEQUENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\?(?=[^?;]*[^?\\\\s;][^?;]*\\\\?)[^?;]*\\\\?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_ISO_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\(\\\\*[\\\\s\\\\S]*?\\\\*\\\\)/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadEbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-ebnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"="},{"$type":"Keyword","value":"::="}]},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":",","cardinality":"?"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerm","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"base","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"postfixes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerminal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfNonTerminal","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSpecial","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptional","returnType":{"$ref":"#/interfaces@11"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRepetition","returnType":{"$ref":"#/interfaces@12"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPostfix","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptionalPostfix","returnType":{"$ref":"#/interfaces@13"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfZeroOrMorePostfix","returnType":{"$ref":"#/interfaces@14"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOneOrMorePostfix","returnType":{"$ref":"#/interfaces@15"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfExceptionPostfix","returnType":{"$ref":"#/interfaces@16"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"except","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadEbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfTerm","attributes":[{"$type":"TypeAttribute","name":"base","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false},{"$type":"TypeAttribute","name":"postfixes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfPostfix","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfNonTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfSpecial","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptional","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfRepetition","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptionalPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfZeroOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfOneOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfExceptionPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"except","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadEbnfGrammarGrammar"),aWt,SUn=$(()=>aWt??(aWt=Vl(`{"$type":"Grammar","isDeclared":true,"name":"RailroadGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"RR_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Railroad","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadExpression","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSequenceExpr","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"sequence"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadChoiceExpr","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"choice"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOptionalExpr","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"optional"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOneOrMoreExpr","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"oneOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadZeroOrMoreExpr","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"zeroOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadTerminalExpr","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"terminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadNonTerminalExpr","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"nonterminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSpecialExpr","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"special"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"Railroad","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadExpression","attributes":[],"superTypes":[]},{"$type":"Interface","name":"RailroadSequenceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadChoiceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOptionalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOneOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadZeroOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadNonTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadSpecialExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadGrammarGrammar"),sWt,TUn=$(()=>sWt??(sWt=Vl(`{"$type":"Grammar","isDeclared":true,"name":"RailroadPegGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/#[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadPeg","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-peg-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"<-"},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegOrderedChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrefix","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"&"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"!"}}],"cardinality":"?"},{"$type":"Assignment","feature":"suffix","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSuffix","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrimary","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegLiteral","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegIdentifier","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegAny","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Assignment","feature":"dot","operator":"=","terminal":{"$type":"Keyword","value":"."}},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadPeg","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegOrderedChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegPrefix","attributes":[{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"suffix","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSuffix","attributes":[{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}},"isOptional":false},{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"PegPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"PegLiteral","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegIdentifier","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegGroup","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"PegAny","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"dot","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadPegGrammarGrammar"),oWt,CUn=$(()=>oWt??(oWt=Vl(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar"),lWt,OUn=$(()=>lWt??(lWt=Vl(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"CLASS_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+:::[ \\\\t]*[A-Za-z_][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ICON_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+icon\\\\([\\\\w-]*(?::[\\\\w-]+)?\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DESC_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+##[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"QUOTED_NAME","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"BARE_NAME","definition":{"$type":"RegexToken","regex":"/(?!:::|icon\\\\(|##)[^ \\\\t\\\\n\\\\r\\"'](?:(?![ \\\\t]+:::[ \\\\t]*[A-Za-z_]|[ \\\\t]+icon\\\\(|[ \\\\t]+##)[^\\\\n\\\\r])*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"classAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"iconAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"descAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@14"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * TreeView grammar for Langium\\n *\\n * Supports both quoted labels (\\"my file\\") and bare labels (index.js).\\n * Annotations (:::class, icon(), ## description) are parsed directly into\\n * AST fields by the grammar. Value conversion for stripping quotes, extracting\\n * class names, icon names, and description text happens in valueConverter.ts.\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treeView keyword, allowing for empty lines and comments before the\\n * treeView declaration.\\n */"}`)),"TreeViewGrammarGrammar"),cWt,kUn=$(()=>cWt??(cWt=Vl(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \\\\t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"WardleyGrammarGrammar"),EUn={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},_Un={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},RUn={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},DUn={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},LUn={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},MUn={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},IUn={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},PUn={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},NUn={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},BUn={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},$Un={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},FUn={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},zUn={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},UUn={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},VUn={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},ih={AstReflection:$(()=>new qHt,"AstReflection")},QUn={Grammar:$(()=>fUn(),"Grammar"),LanguageMetaData:$(()=>EUn,"LanguageMetaData"),parser:{}},GUn={Grammar:$(()=>pUn(),"Grammar"),LanguageMetaData:$(()=>_Un,"LanguageMetaData"),parser:{}},HUn={Grammar:$(()=>gUn(),"Grammar"),LanguageMetaData:$(()=>RUn,"LanguageMetaData"),parser:{}},WUn={Grammar:$(()=>mUn(),"Grammar"),LanguageMetaData:$(()=>DUn,"LanguageMetaData"),parser:{}},YUn={Grammar:$(()=>vUn(),"Grammar"),LanguageMetaData:$(()=>LUn,"LanguageMetaData"),parser:{}},qUn={Grammar:$(()=>yUn(),"Grammar"),LanguageMetaData:$(()=>MUn,"LanguageMetaData"),parser:{}},jUn={Grammar:$(()=>bUn(),"Grammar"),LanguageMetaData:$(()=>IUn,"LanguageMetaData"),parser:{}},XUn={Grammar:$(()=>xUn(),"Grammar"),LanguageMetaData:$(()=>PUn,"LanguageMetaData"),parser:{}},KUn={Grammar:$(()=>wUn(),"Grammar"),LanguageMetaData:$(()=>NUn,"LanguageMetaData"),parser:{}},ZUn={Grammar:$(()=>AUn(),"Grammar"),LanguageMetaData:$(()=>BUn,"LanguageMetaData"),parser:{}},JUn={Grammar:$(()=>SUn(),"Grammar"),LanguageMetaData:$(()=>$Un,"LanguageMetaData"),parser:{}},eVn={Grammar:$(()=>TUn(),"Grammar"),LanguageMetaData:$(()=>FUn,"LanguageMetaData"),parser:{}},tVn={Grammar:$(()=>CUn(),"Grammar"),LanguageMetaData:$(()=>zUn,"LanguageMetaData"),parser:{}},rVn={Grammar:$(()=>OUn(),"Grammar"),LanguageMetaData:$(()=>UUn,"LanguageMetaData"),parser:{}},nVn={Grammar:$(()=>kUn(),"Grammar"),LanguageMetaData:$(()=>VUn,"LanguageMetaData"),parser:{}},iVn=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,aVn=/accTitle[\t ]*:([^\n\r]*)/,sVn=/title([\t ][^\n\r]*|)/,oVn={ACC_DESCR:iVn,ACC_TITLE:aVn,TITLE:sVn},rv=(YM=class extends G4e{runConverter(e,r,n){let i=this.runCommonConverter(e,r,n);return i===void 0&&(i=this.runCustomConverter(e,r,n)),i===void 0?super.runConverter(e,r,n):i}runCommonConverter(e,r,n){const i=oVn[e.name];if(i===void 0)return;const a=i.exec(r);if(a!==null){if(a[1]!==void 0)return a[1].trim().replace(/[\t ]{2,}/gm," ");if(a[2]!==void 0)return a[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,` `)}}},$(YM,"AbstractMermaidValueConverter"),YM),UR=(qM=class extends rv{runCustomConverter(e,r,n){}},$(qM,"CommonValueConverter"),qM),ah=(jM=class extends Pre{constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,r,n){const i=super.buildKeywordTokens(e,r,n);return i.forEach(a=>{this.keywords.has(a.name)&&a.PATTERN!==void 0&&(a.PATTERN=new RegExp(a.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),i}},$(jM,"AbstractMermaidTokenBuilder"),jM);XM=class extends ah{},$(XM,"CommonTokenBuilder");/*! Bundled license information: lodash-es/lodash.js: @@ -1746,10 +1746,10 @@ ${r}`),this.inline?`{${i}}`:i}},$(DM,"JSDocTagImpl"),DM);function XGt(t,e,r){var */var lVn=(KM=class extends ah{constructor(){super(["radar-beta"])}},$(KM,"RadarTokenBuilder"),KM),uWt={parser:{TokenBuilder:$(()=>new lVn,"TokenBuilder"),ValueConverter:$(()=>new UR,"ValueConverter")}};function hWt(t=Ac){const e=_i(Ul(t),ih),r=_i(zl({shared:e}),XUn,uWt);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}$(hWt,"createRadarServices");var cVn=(ZM=class extends ah{constructor(){super(["railroad-beta"])}},$(ZM,"RailroadTokenBuilder"),ZM),dWt=$(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew cVn,"TokenBuilder"),ValueConverter:$(()=>new uVn,"ValueConverter")}};function nRe(t=Ac){const e=_i(Ul(t),ih),r=_i(zl({shared:e}),JUn,fWt);return e.ServiceRegistry.register(r),{shared:e,Railroad:r}}$(nRe,"createRailroadServices");var hVn=(eI=class extends ah{constructor(){super(["railroad-ebnf-beta"])}},$(eI,"RailroadEbnfTokenBuilder"),eI),pWt=$(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew hVn,"TokenBuilder"),ValueConverter:$(()=>new dVn,"ValueConverter")}};function iRe(t=Ac){const e=_i(Ul(t),ih),r=_i(zl({shared:e}),ZUn,gWt);return e.ServiceRegistry.register(r),{shared:e,RailroadEbnf:r}}$(iRe,"createRailroadEbnfServices");var fVn=(rI=class extends ah{constructor(){super(["railroad-abnf-beta"])}},$(rI,"RailroadAbnfTokenBuilder"),rI),pVn=(nI=class extends rv{runConverter(e,r,n){const i=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof i=="string"){const a=i.trim();if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))return a.slice(1,-1)}return i}runCustomConverter(e,r,n){if(e.name==="ABNF_STRING")return r.slice(1,-1)}},$(nI,"RailroadAbnfValueConverter"),nI),mWt={parser:{TokenBuilder:$(()=>new fVn,"TokenBuilder"),ValueConverter:$(()=>new pVn,"ValueConverter")}};function aRe(t=Ac){const e=_i(Ul(t),ih),r=_i(zl({shared:e}),KUn,mWt);return e.ServiceRegistry.register(r),{shared:e,RailroadAbnf:r}}$(aRe,"createRailroadAbnfServices");var gVn=(iI=class extends ah{constructor(){super(["railroad-peg-beta"])}},$(iI,"RailroadPegTokenBuilder"),iI),vWt=$(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew gVn,"TokenBuilder"),ValueConverter:$(()=>new mVn,"ValueConverter")}};function sRe(t=Ac){const e=_i(Ul(t),ih),r=_i(zl({shared:e}),eVn,yWt);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}$(sRe,"createRailroadPegServices");var vVn=(sI=class extends ah{constructor(){super(["treemap"])}},$(sI,"TreemapTokenBuilder"),sI),yVn=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,bVn=(oI=class extends rv{runCustomConverter(e,r,n){if(e.name==="NUMBER2")return parseFloat(r.replace(/,/g,""));if(e.name==="SEPARATOR")return r.substring(1,r.length-1);if(e.name==="STRING2")return r.substring(1,r.length-1);if(e.name==="INDENTATION")return r.length;if(e.name==="ClassDef"){if(typeof r!="string")return r;const i=yVn.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},$(oI,"TreemapValueConverter"),oI);function bWt(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}$(bWt,"registerValidationChecks");var xVn=(lI=class{checkSingleRoot(e,r){let n;for(const i of e.TreemapRows)i.item&&(n===void 0&&i.indent===void 0?n=0:i.indent===void 0?r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}):n!==void 0&&n>=parseInt(i.indent,10)&&r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}))}},$(lI,"TreemapValidator"),lI),xWt={parser:{TokenBuilder:$(()=>new vVn,"TokenBuilder"),ValueConverter:$(()=>new bVn,"ValueConverter")},validation:{TreemapValidator:$(()=>new xVn,"TreemapValidator")}};function wWt(t=Ac){const e=_i(Ul(t),ih),r=_i(zl({shared:e}),tVn,xWt);return e.ServiceRegistry.register(r),bWt(r),{shared:e,Treemap:r}}$(wWt,"createTreemapServices");var wVn=(cI=class extends rv{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},$(cI,"WardleyValueConverter"),cI),AWt={parser:{ValueConverter:$(()=>new wVn,"ValueConverter")}};function TWt(t=Ac){const e=_i(Ul(t),ih),r=_i(zl({shared:e}),nVn,AWt);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}$(TWt,"createWardleyServices");var AVn=(uI=class extends ah{constructor(){super(["cynefin-beta"])}},$(uI,"CynefinTokenBuilder"),uI),SWt={parser:{TokenBuilder:$(()=>new AVn,"TokenBuilder"),ValueConverter:$(()=>new UR,"ValueConverter")}};function CWt(t=Ac){const e=_i(Ul(t),ih),r=_i(zl({shared:e}),GUn,SWt);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}$(CWt,"createCynefinServices");var TVn=(hI=class extends ah{constructor(){super(["gitGraph"])}},$(hI,"GitGraphTokenBuilder"),hI),OWt={parser:{TokenBuilder:$(()=>new TVn,"TokenBuilder"),ValueConverter:$(()=>new UR,"ValueConverter")}};function kWt(t=Ac){const e=_i(Ul(t),ih),r=_i(zl({shared:e}),WUn,OWt);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}$(kWt,"createGitGraphServices");var SVn=(dI=class extends ah{constructor(){super(["info","showInfo"])}},$(dI,"InfoTokenBuilder"),dI),EWt={parser:{TokenBuilder:$(()=>new SVn,"TokenBuilder"),ValueConverter:$(()=>new UR,"ValueConverter")}};function _Wt(t=Ac){const e=_i(Ul(t),ih),r=_i(zl({shared:e}),YUn,EWt);return e.ServiceRegistry.register(r),{shared:e,Info:r}}$(_Wt,"createInfoServices");var CVn=(fI=class extends ah{constructor(){super(["packet"])}},$(fI,"PacketTokenBuilder"),fI),RWt={parser:{TokenBuilder:$(()=>new CVn,"TokenBuilder"),ValueConverter:$(()=>new UR,"ValueConverter")}};function DWt(t=Ac){const e=_i(Ul(t),ih),r=_i(zl({shared:e}),qUn,RWt);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}$(DWt,"createPacketServices");var OVn=(pI=class extends ah{constructor(){super(["pie","showData"])}},$(pI,"PieTokenBuilder"),pI),kVn=(gI=class extends rv{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},$(gI,"PieValueConverter"),gI),LWt={parser:{TokenBuilder:$(()=>new OVn,"TokenBuilder"),ValueConverter:$(()=>new kVn,"ValueConverter")}};function MWt(t=Ac){const e=_i(Ul(t),ih),r=_i(zl({shared:e}),jUn,LWt);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}$(MWt,"createPieServices");var EVn=(mI=class extends rv{runCustomConverter(e,r,n){if(e.name==="INDENTATION")return(r==null?void 0:r.length)||0;if(e.name==="QUOTED_NAME")return r.substring(1,r.length-1);if(e.name==="BARE_NAME")return r.replace(/[\t ]+$/,"");if(e.name==="CLASS_ANNOTATION")return r.trim().substring(3).trim();if(e.name==="ICON_ANNOTATION"){const i=r.trim();return i.substring(5,i.length-1)}if(e.name==="DESC_ANNOTATION")return r.trim().substring(2).trim()}},$(mI,"TreeViewValueConverter"),mI),_Vn=(vI=class extends ah{constructor(){super(["treeView-beta"])}},$(vI,"TreeViewTokenBuilder"),vI),IWt={parser:{TokenBuilder:$(()=>new _Vn,"TokenBuilder"),ValueConverter:$(()=>new EVn,"ValueConverter")}};function PWt(t=Ac){const e=_i(Ul(t),ih),r=_i(zl({shared:e}),rVn,IWt);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}$(PWt,"createTreeViewServices");var RVn=(yI=class extends ah{constructor(){super(["architecture"])}},$(yI,"ArchitectureTokenBuilder"),yI),DVn=(bI=class extends rv{runCustomConverter(e,r,n){if(e.name==="ARCH_ICON")return r.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return r.replace(/["()]/g,"");if(e.name==="ARCH_TITLE"){let i=r.replace(/^\[|]$/g,"").trim();return(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1),i=i.replace(/\\"/g,'"').replace(/\\'/g,"'")),i.trim()}}},$(bI,"ArchitectureValueConverter"),bI),NWt={parser:{TokenBuilder:$(()=>new RVn,"TokenBuilder"),ValueConverter:$(()=>new DVn,"ValueConverter")}};function BWt(t=Ac){const e=_i(Ul(t),ih),r=_i(zl({shared:e}),QUn,NWt);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}$(BWt,"createArchitectureServices");var LVn=(xI=class extends ah{constructor(){super(["eventmodeling"])}},$(xI,"EventModelingTokenBuilder"),xI),$Wt=new Set(["cmd","command"]),FWt=new Set(["evt","event"]),oRe=new Set(["rmo","readmodel"]),zWt=new Set(["pcr","processor"]),UWt=new Set(["ui"]);function VWt(t){const e=t.validation.EventModelingValidator,r=t.validation.ValidationRegistry;if(r){const n={EmTimeFrame:e.checkSourceFrameTypes.bind(e),EmResetFrame:e.checkSourceFrameTypes.bind(e)};r.register(n,e)}}$(VWt,"registerValidationChecks");var MVn=(wI=class{checkSourceFrameTypes(e,r){e.sourceFrames.length!==0&&($Wt.has(e.modelEntityType)?this.validateSources(e,new Set([...UWt,...zWt]),"command","ui or processor",r):FWt.has(e.modelEntityType)?this.validateSources(e,$Wt,"event","command",r):oRe.has(e.modelEntityType)?this.validateSources(e,FWt,"read model","event",r):zWt.has(e.modelEntityType)?this.validateSources(e,oRe,"processor","read model",r):UWt.has(e.modelEntityType)&&this.validateSources(e,oRe,"ui","read model",r))}validateSources(e,r,n,i,a){for(const s of e.sourceFrames){const o=s.ref;o!==void 0&&!r.has(o.modelEntityType)&&a("error",`A ${n} can only receive input from a ${i}, not from '${o.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},$(wI,"EventModelingValidator"),wI),QWt={parser:{TokenBuilder:$(()=>new LVn,"TokenBuilder"),ValueConverter:$(()=>new UR,"ValueConverter")},validation:{EventModelingValidator:$(()=>new MVn,"EventModelingValidator")}};function GWt(t=Ac){const e=_i(Ul(t),ih),r=_i(zl({shared:e}),HUn,QWt);return e.ServiceRegistry.register(r),VWt(r),{shared:e,EventModel:r}}$(GWt,"createEventModelingServices");var Sc={},IVn={info:$(async()=>{const{createInfoServices:t}=await Promise.resolve().then(()=>rri),e=t().Info.parser.LangiumParser;Sc.info=e},"info"),packet:$(async()=>{const{createPacketServices:t}=await Promise.resolve().then(()=>nri),e=t().Packet.parser.LangiumParser;Sc.packet=e},"packet"),pie:$(async()=>{const{createPieServices:t}=await Promise.resolve().then(()=>iri),e=t().Pie.parser.LangiumParser;Sc.pie=e},"pie"),treeView:$(async()=>{const{createTreeViewServices:t}=await Promise.resolve().then(()=>ari),e=t().TreeView.parser.LangiumParser;Sc.treeView=e},"treeView"),architecture:$(async()=>{const{createArchitectureServices:t}=await Promise.resolve().then(()=>sri),e=t().Architecture.parser.LangiumParser;Sc.architecture=e},"architecture"),gitGraph:$(async()=>{const{createGitGraphServices:t}=await Promise.resolve().then(()=>ori),e=t().GitGraph.parser.LangiumParser;Sc.gitGraph=e},"gitGraph"),eventmodeling:$(async()=>{const{createEventModelingServices:t}=await Promise.resolve().then(()=>lri),e=t().EventModel.parser.LangiumParser;Sc.eventmodeling=e},"eventmodeling"),radar:$(async()=>{const{createRadarServices:t}=await Promise.resolve().then(()=>cri),e=t().Radar.parser.LangiumParser;Sc.radar=e},"radar"),railroad:$(async()=>{const{createRailroadServices:t}=await Promise.resolve().then(()=>uri),e=t().Railroad.parser.LangiumParser;Sc.railroad=e},"railroad"),railroadEbnf:$(async()=>{const{createRailroadEbnfServices:t}=await Promise.resolve().then(()=>hri),e=t().RailroadEbnf.parser.LangiumParser;Sc.railroadEbnf=e},"railroadEbnf"),railroadAbnf:$(async()=>{const{createRailroadAbnfServices:t}=await Promise.resolve().then(()=>dri),e=t().RailroadAbnf.parser.LangiumParser;Sc.railroadAbnf=e},"railroadAbnf"),railroadPeg:$(async()=>{const{createRailroadPegServices:t}=await Promise.resolve().then(()=>fri),e=t().RailroadPeg.parser.LangiumParser;Sc.railroadPeg=e},"railroadPeg"),treemap:$(async()=>{const{createTreemapServices:t}=await Promise.resolve().then(()=>pri),e=t().Treemap.parser.LangiumParser;Sc.treemap=e},"treemap"),wardley:$(async()=>{const{createWardleyServices:t}=await Promise.resolve().then(()=>gri),e=t().Wardley.parser.LangiumParser;Sc.wardley=e},"wardley"),cynefin:$(async()=>{const{createCynefinServices:t}=await Promise.resolve().then(()=>mri),e=t().Cynefin.parser.LangiumParser;Sc.cynefin=e},"cynefin")};async function Op(t,e){const r=IVn[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);Sc[t]||await r();const i=Sc[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new mz(i);return i.value}$(Op,"parse");var mz=(AI=class extends Error{constructor(e){const r=e.lexerErrors.map(i=>{const a=i.line!==void 0&&!isNaN(i.line)?i.line:"?",s=i.column!==void 0&&!isNaN(i.column)?i.column:"?";return`Lexer error on line ${a}, column ${s}: ${i.message}`}).join(` +`;break;case"r":r+="\r";break;case"t":r+=" ";break;default:r+=a}continue}r+=i}return r},"decodeEscapedString"),mVn=(aI=class extends rv{runConverter(e,r,n){const i=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof i=="string"){const a=i.trim();if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))return vWt(a)}return i}runCustomConverter(e,r,n){if(e.name==="PEG_STRING")return vWt(r)}},$(aI,"RailroadPegValueConverter"),aI),yWt={parser:{TokenBuilder:$(()=>new gVn,"TokenBuilder"),ValueConverter:$(()=>new mVn,"ValueConverter")}};function sRe(t=Ac){const e=_i(Ul(t),ih),r=_i(zl({shared:e}),eVn,yWt);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}$(sRe,"createRailroadPegServices");var vVn=(sI=class extends ah{constructor(){super(["treemap"])}},$(sI,"TreemapTokenBuilder"),sI),yVn=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,bVn=(oI=class extends rv{runCustomConverter(e,r,n){if(e.name==="NUMBER2")return parseFloat(r.replace(/,/g,""));if(e.name==="SEPARATOR")return r.substring(1,r.length-1);if(e.name==="STRING2")return r.substring(1,r.length-1);if(e.name==="INDENTATION")return r.length;if(e.name==="ClassDef"){if(typeof r!="string")return r;const i=yVn.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},$(oI,"TreemapValueConverter"),oI);function bWt(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}$(bWt,"registerValidationChecks");var xVn=(lI=class{checkSingleRoot(e,r){let n;for(const i of e.TreemapRows)i.item&&(n===void 0&&i.indent===void 0?n=0:i.indent===void 0?r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}):n!==void 0&&n>=parseInt(i.indent,10)&&r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}))}},$(lI,"TreemapValidator"),lI),xWt={parser:{TokenBuilder:$(()=>new vVn,"TokenBuilder"),ValueConverter:$(()=>new bVn,"ValueConverter")},validation:{TreemapValidator:$(()=>new xVn,"TreemapValidator")}};function wWt(t=Ac){const e=_i(Ul(t),ih),r=_i(zl({shared:e}),tVn,xWt);return e.ServiceRegistry.register(r),bWt(r),{shared:e,Treemap:r}}$(wWt,"createTreemapServices");var wVn=(cI=class extends rv{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},$(cI,"WardleyValueConverter"),cI),AWt={parser:{ValueConverter:$(()=>new wVn,"ValueConverter")}};function SWt(t=Ac){const e=_i(Ul(t),ih),r=_i(zl({shared:e}),nVn,AWt);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}$(SWt,"createWardleyServices");var AVn=(uI=class extends ah{constructor(){super(["cynefin-beta"])}},$(uI,"CynefinTokenBuilder"),uI),TWt={parser:{TokenBuilder:$(()=>new AVn,"TokenBuilder"),ValueConverter:$(()=>new UR,"ValueConverter")}};function CWt(t=Ac){const e=_i(Ul(t),ih),r=_i(zl({shared:e}),GUn,TWt);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}$(CWt,"createCynefinServices");var SVn=(hI=class extends ah{constructor(){super(["gitGraph"])}},$(hI,"GitGraphTokenBuilder"),hI),OWt={parser:{TokenBuilder:$(()=>new SVn,"TokenBuilder"),ValueConverter:$(()=>new UR,"ValueConverter")}};function kWt(t=Ac){const e=_i(Ul(t),ih),r=_i(zl({shared:e}),WUn,OWt);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}$(kWt,"createGitGraphServices");var TVn=(dI=class extends ah{constructor(){super(["info","showInfo"])}},$(dI,"InfoTokenBuilder"),dI),EWt={parser:{TokenBuilder:$(()=>new TVn,"TokenBuilder"),ValueConverter:$(()=>new UR,"ValueConverter")}};function _Wt(t=Ac){const e=_i(Ul(t),ih),r=_i(zl({shared:e}),YUn,EWt);return e.ServiceRegistry.register(r),{shared:e,Info:r}}$(_Wt,"createInfoServices");var CVn=(fI=class extends ah{constructor(){super(["packet"])}},$(fI,"PacketTokenBuilder"),fI),RWt={parser:{TokenBuilder:$(()=>new CVn,"TokenBuilder"),ValueConverter:$(()=>new UR,"ValueConverter")}};function DWt(t=Ac){const e=_i(Ul(t),ih),r=_i(zl({shared:e}),qUn,RWt);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}$(DWt,"createPacketServices");var OVn=(pI=class extends ah{constructor(){super(["pie","showData"])}},$(pI,"PieTokenBuilder"),pI),kVn=(gI=class extends rv{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},$(gI,"PieValueConverter"),gI),LWt={parser:{TokenBuilder:$(()=>new OVn,"TokenBuilder"),ValueConverter:$(()=>new kVn,"ValueConverter")}};function MWt(t=Ac){const e=_i(Ul(t),ih),r=_i(zl({shared:e}),jUn,LWt);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}$(MWt,"createPieServices");var EVn=(mI=class extends rv{runCustomConverter(e,r,n){if(e.name==="INDENTATION")return(r==null?void 0:r.length)||0;if(e.name==="QUOTED_NAME")return r.substring(1,r.length-1);if(e.name==="BARE_NAME")return r.replace(/[\t ]+$/,"");if(e.name==="CLASS_ANNOTATION")return r.trim().substring(3).trim();if(e.name==="ICON_ANNOTATION"){const i=r.trim();return i.substring(5,i.length-1)}if(e.name==="DESC_ANNOTATION")return r.trim().substring(2).trim()}},$(mI,"TreeViewValueConverter"),mI),_Vn=(vI=class extends ah{constructor(){super(["treeView-beta"])}},$(vI,"TreeViewTokenBuilder"),vI),IWt={parser:{TokenBuilder:$(()=>new _Vn,"TokenBuilder"),ValueConverter:$(()=>new EVn,"ValueConverter")}};function PWt(t=Ac){const e=_i(Ul(t),ih),r=_i(zl({shared:e}),rVn,IWt);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}$(PWt,"createTreeViewServices");var RVn=(yI=class extends ah{constructor(){super(["architecture"])}},$(yI,"ArchitectureTokenBuilder"),yI),DVn=(bI=class extends rv{runCustomConverter(e,r,n){if(e.name==="ARCH_ICON")return r.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return r.replace(/["()]/g,"");if(e.name==="ARCH_TITLE"){let i=r.replace(/^\[|]$/g,"").trim();return(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1),i=i.replace(/\\"/g,'"').replace(/\\'/g,"'")),i.trim()}}},$(bI,"ArchitectureValueConverter"),bI),NWt={parser:{TokenBuilder:$(()=>new RVn,"TokenBuilder"),ValueConverter:$(()=>new DVn,"ValueConverter")}};function BWt(t=Ac){const e=_i(Ul(t),ih),r=_i(zl({shared:e}),QUn,NWt);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}$(BWt,"createArchitectureServices");var LVn=(xI=class extends ah{constructor(){super(["eventmodeling"])}},$(xI,"EventModelingTokenBuilder"),xI),$Wt=new Set(["cmd","command"]),FWt=new Set(["evt","event"]),oRe=new Set(["rmo","readmodel"]),zWt=new Set(["pcr","processor"]),UWt=new Set(["ui"]);function VWt(t){const e=t.validation.EventModelingValidator,r=t.validation.ValidationRegistry;if(r){const n={EmTimeFrame:e.checkSourceFrameTypes.bind(e),EmResetFrame:e.checkSourceFrameTypes.bind(e)};r.register(n,e)}}$(VWt,"registerValidationChecks");var MVn=(wI=class{checkSourceFrameTypes(e,r){e.sourceFrames.length!==0&&($Wt.has(e.modelEntityType)?this.validateSources(e,new Set([...UWt,...zWt]),"command","ui or processor",r):FWt.has(e.modelEntityType)?this.validateSources(e,$Wt,"event","command",r):oRe.has(e.modelEntityType)?this.validateSources(e,FWt,"read model","event",r):zWt.has(e.modelEntityType)?this.validateSources(e,oRe,"processor","read model",r):UWt.has(e.modelEntityType)&&this.validateSources(e,oRe,"ui","read model",r))}validateSources(e,r,n,i,a){for(const s of e.sourceFrames){const o=s.ref;o!==void 0&&!r.has(o.modelEntityType)&&a("error",`A ${n} can only receive input from a ${i}, not from '${o.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},$(wI,"EventModelingValidator"),wI),QWt={parser:{TokenBuilder:$(()=>new LVn,"TokenBuilder"),ValueConverter:$(()=>new UR,"ValueConverter")},validation:{EventModelingValidator:$(()=>new MVn,"EventModelingValidator")}};function GWt(t=Ac){const e=_i(Ul(t),ih),r=_i(zl({shared:e}),HUn,QWt);return e.ServiceRegistry.register(r),VWt(r),{shared:e,EventModel:r}}$(GWt,"createEventModelingServices");var Tc={},IVn={info:$(async()=>{const{createInfoServices:t}=await Promise.resolve().then(()=>rri),e=t().Info.parser.LangiumParser;Tc.info=e},"info"),packet:$(async()=>{const{createPacketServices:t}=await Promise.resolve().then(()=>nri),e=t().Packet.parser.LangiumParser;Tc.packet=e},"packet"),pie:$(async()=>{const{createPieServices:t}=await Promise.resolve().then(()=>iri),e=t().Pie.parser.LangiumParser;Tc.pie=e},"pie"),treeView:$(async()=>{const{createTreeViewServices:t}=await Promise.resolve().then(()=>ari),e=t().TreeView.parser.LangiumParser;Tc.treeView=e},"treeView"),architecture:$(async()=>{const{createArchitectureServices:t}=await Promise.resolve().then(()=>sri),e=t().Architecture.parser.LangiumParser;Tc.architecture=e},"architecture"),gitGraph:$(async()=>{const{createGitGraphServices:t}=await Promise.resolve().then(()=>ori),e=t().GitGraph.parser.LangiumParser;Tc.gitGraph=e},"gitGraph"),eventmodeling:$(async()=>{const{createEventModelingServices:t}=await Promise.resolve().then(()=>lri),e=t().EventModel.parser.LangiumParser;Tc.eventmodeling=e},"eventmodeling"),radar:$(async()=>{const{createRadarServices:t}=await Promise.resolve().then(()=>cri),e=t().Radar.parser.LangiumParser;Tc.radar=e},"radar"),railroad:$(async()=>{const{createRailroadServices:t}=await Promise.resolve().then(()=>uri),e=t().Railroad.parser.LangiumParser;Tc.railroad=e},"railroad"),railroadEbnf:$(async()=>{const{createRailroadEbnfServices:t}=await Promise.resolve().then(()=>hri),e=t().RailroadEbnf.parser.LangiumParser;Tc.railroadEbnf=e},"railroadEbnf"),railroadAbnf:$(async()=>{const{createRailroadAbnfServices:t}=await Promise.resolve().then(()=>dri),e=t().RailroadAbnf.parser.LangiumParser;Tc.railroadAbnf=e},"railroadAbnf"),railroadPeg:$(async()=>{const{createRailroadPegServices:t}=await Promise.resolve().then(()=>fri),e=t().RailroadPeg.parser.LangiumParser;Tc.railroadPeg=e},"railroadPeg"),treemap:$(async()=>{const{createTreemapServices:t}=await Promise.resolve().then(()=>pri),e=t().Treemap.parser.LangiumParser;Tc.treemap=e},"treemap"),wardley:$(async()=>{const{createWardleyServices:t}=await Promise.resolve().then(()=>gri),e=t().Wardley.parser.LangiumParser;Tc.wardley=e},"wardley"),cynefin:$(async()=>{const{createCynefinServices:t}=await Promise.resolve().then(()=>mri),e=t().Cynefin.parser.LangiumParser;Tc.cynefin=e},"cynefin")};async function Op(t,e){const r=IVn[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);Tc[t]||await r();const i=Tc[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new mz(i);return i.value}$(Op,"parse");var mz=(AI=class extends Error{constructor(e){const r=e.lexerErrors.map(i=>{const a=i.line!==void 0&&!isNaN(i.line)?i.line:"?",s=i.column!==void 0&&!isNaN(i.column)?i.column:"?";return`Lexer error on line ${a}, column ${s}: ${i.message}`}).join(` `),n=e.parserErrors.map(i=>{const a=i.token.startLine!==void 0&&!isNaN(i.token.startLine)?i.token.startLine:"?",s=i.token.startColumn!==void 0&&!isNaN(i.token.startColumn)?i.token.startColumn:"?";return`Parse error on line ${a}, column ${s}: ${i.message}`}).join(` `);super(`Parsing failed: ${r} ${n}`),this.result=e}},$(AI,"MermaidParseError"),AI),ma={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},PVn=Xn.gitGraph,$O=C(()=>ns({...PVn,...Dr().gitGraph}),"getConfig"),cr=new Uke(()=>{const t=$O(),e=t.mainBranchName,r=t.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:r}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}});function pne(){return Jyt({length:7})}C(pne,"getID");function HWt(t,e){const r=Object.create(null);return t.reduce((n,i)=>{const a=e(i);return r[a]||(r[a]=!0,n.push(i)),n},[])}C(HWt,"uniqBy");var NVn=C(function(t){cr.records.direction=t},"setDirection"),BVn=C(function(t){me.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{cr.records.options=JSON.parse(t)}catch(e){me.error("error while parsing gitGraph options",e.message)}},"setOptions"),$Vn=C(function(){return cr.records.options},"getOptions"),FVn=C(function(t){let e=t.msg,r=t.id;const n=t.type;let i=t.tags;me.info("commit",e,r,n,i),me.debug("Entering commit:",e,r,n,i);const a=$O();r=jt.sanitizeText(r,a),e=jt.sanitizeText(e,a),i=i==null?void 0:i.map(o=>jt.sanitizeText(o,a));const s={id:r||cr.records.seq+"-"+pne(),message:e,seq:cr.records.seq++,type:n??ma.NORMAL,tags:i??[],parents:cr.records.head==null?[]:[cr.records.head.id],branch:cr.records.currBranch};cr.records.head=s,me.info("main branch",a.mainBranchName),cr.records.commits.has(s.id)&&me.warn(`Commit ID ${s.id} already exists`),cr.records.commits.set(s.id,s),cr.records.branches.set(cr.records.currBranch,s.id),me.debug("in pushCommit "+s.id)},"commit"),zVn=C(function(t){let e=t.name;const r=t.order;if(e=jt.sanitizeText(e,$O()),cr.records.branches.has(e))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${e}")`);cr.records.branches.set(e,cr.records.head!=null?cr.records.head.id:null),cr.records.branchConfig.set(e,{name:e,order:r}),WWt(e),me.debug("in createBranch")},"branch"),UVn=C(t=>{let e=t.branch,r=t.id;const n=t.type,i=t.tags,a=$O();e=jt.sanitizeText(e,a),r&&(r=jt.sanitizeText(r,a));const s=cr.records.branches.get(cr.records.currBranch),o=cr.records.branches.get(e),l=s?cr.records.commits.get(s):void 0,u=o?cr.records.commits.get(o):void 0;if(l&&u&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(cr.records.currBranch===e){const f=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(l===void 0||!l){const f=new Error(`Incorrect usage of "merge". Current branch (${cr.records.currBranch})has no commits`);throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},f}if(!cr.records.branches.has(e)){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},f}if(u===void 0||!u){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},f}if(l===u){const f=new Error('Incorrect usage of "merge". Both branches have same head');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(r&&cr.records.commits.has(r)){const f=new Error('Incorrect usage of "merge". Commit with id:'+r+" already exists, use different custom id");throw f.hash={text:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,token:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,expected:[`merge ${e} ${r}_UNIQUE ${n} ${i==null?void 0:i.join(" ")}`]},f}const h=o||"",d={id:r||`${cr.records.seq}-${pne()}`,message:`merged branch ${e} into ${cr.records.currBranch}`,seq:cr.records.seq++,parents:cr.records.head==null?[]:[cr.records.head.id,h],branch:cr.records.currBranch,type:ma.MERGE,customType:n,customId:!!r,tags:i??[]};cr.records.head=d,cr.records.commits.set(d.id,d),cr.records.branches.set(cr.records.currBranch,d.id),me.debug(cr.records.branches),me.debug("in mergeBranch")},"merge"),VVn=C(function(t){let e=t.id,r=t.targetId,n=t.tags,i=t.parent;me.debug("Entering cherryPick:",e,r,n);const a=$O();if(e=jt.sanitizeText(e,a),r=jt.sanitizeText(r,a),n=n==null?void 0:n.map(l=>jt.sanitizeText(l,a)),i=jt.sanitizeText(i,a),!e||!cr.records.commits.has(e)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},l}const s=cr.records.commits.get(e);if(s===void 0||!s)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(i&&!(Array.isArray(s.parents)&&s.parents.includes(i)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const o=s.branch;if(s.type===ma.MERGE&&!i)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!r||!cr.records.commits.has(r)){if(o===cr.records.currBranch){const d=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const l=cr.records.branches.get(cr.records.currBranch);if(l===void 0||!l){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${cr.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const u=cr.records.commits.get(l);if(u===void 0||!u){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${cr.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const h={id:cr.records.seq+"-"+pne(),message:`cherry-picked ${s==null?void 0:s.message} into ${cr.records.currBranch}`,seq:cr.records.seq++,parents:cr.records.head==null?[]:[cr.records.head.id,s.id],branch:cr.records.currBranch,type:ma.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${s.id}${s.type===ma.MERGE?`|parent:${i}`:""}`]};cr.records.head=h,cr.records.commits.set(h.id,h),cr.records.branches.set(cr.records.currBranch,h.id),me.debug(cr.records.branches),me.debug("in cherryPick")}},"cherryPick"),WWt=C(function(t){if(t=jt.sanitizeText(t,$O()),cr.records.branches.has(t)){cr.records.currBranch=t;const e=cr.records.branches.get(cr.records.currBranch);e===void 0||!e?cr.records.head=null:cr.records.head=cr.records.commits.get(e)??null}else{const e=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw e.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},e}},"checkout");function lRe(t,e,r){const n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}C(lRe,"upsert");function cRe(t){const e=t.reduce((i,a)=>i.seq>a.seq?i:a,t[0]);let r="";t.forEach(function(i){i===e?r+=" *":r+=" |"});const n=[r,e.id,e.seq];for(const i in cr.records.branches)cr.records.branches.get(i)===e.id&&n.push(i);if(me.debug(n.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){const i=cr.records.commits.get(e.parents[0]);lRe(t,e,i),e.parents[1]&&t.push(cr.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){const i=cr.records.commits.get(e.parents[0]);lRe(t,e,i)}}t=HWt(t,i=>i.id),cRe(t)}C(cRe,"prettyPrintCommitHistory");var QVn=C(function(){me.debug(cr.records.commits);const t=YWt()[0];cRe([t])},"prettyPrint"),GVn=C(function(){cr.reset(),Aa()},"clear"),HVn=C(function(){return[...cr.records.branchConfig.values()].map((e,r)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${r}`)}).sort((e,r)=>(e.order??0)-(r.order??0)).map(({name:e})=>({name:e}))},"getBranchesAsObjArray"),WVn=C(function(){return cr.records.branches},"getBranches"),YVn=C(function(){return cr.records.commits},"getCommits"),YWt=C(function(){const t=[...cr.records.commits.values()];return t.forEach(function(e){me.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},"getCommitsArray"),qVn=C(function(){return cr.records.currBranch},"getCurrentBranch"),jVn=C(function(){return cr.records.direction},"getDirection"),XVn=C(function(){return cr.records.head},"getHead"),qWt={commitType:ma,getConfig:$O,setDirection:NVn,setOptions:BVn,getOptions:$Vn,commit:FVn,branch:zVn,merge:UVn,cherryPick:VVn,checkout:WWt,prettyPrint:QVn,clear:GVn,getBranchesAsObjArray:HVn,getBranches:WVn,getCommits:YVn,getCommitsArray:YWt,getCurrentBranch:qVn,getDirection:jVn,getHead:XVn,setAccTitle:Da,getAccTitle:Ja,getAccDescription:ts,setAccDescription:es,setDiagramTitle:rs,getDiagramTitle:La},KVn=C((t,e)=>{qu(t,e),t.dir&&e.setDirection(t.dir);for(const r of t.statements)ZVn(r,e)},"populate"),ZVn=C((t,e)=>{const n={Commit:C(i=>e.commit(JVn(i)),"Commit"),Branch:C(i=>e.branch(eQn(i)),"Branch"),Merge:C(i=>e.merge(tQn(i)),"Merge"),Checkout:C(i=>e.checkout(rQn(i)),"Checkout"),CherryPicking:C(i=>e.cherryPick(nQn(i)),"CherryPicking")}[t.$type];n?n(t):me.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),JVn=C(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?ma[t.type]:ma.NORMAL,tags:t.tags??void 0}),"parseCommit"),eQn=C(t=>({name:t.name,order:t.order??0}),"parseBranch"),tQn=C(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?ma[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),rQn=C(t=>t.branch,"parseCheckout"),nQn=C(t=>{var r;return{id:t.id,targetId:"",tags:((r=t.tags)==null?void 0:r.length)===0?void 0:t.tags,parent:t.parent}},"parseCherryPicking"),iQn={parse:C(async t=>{const e=await Op("gitGraph",t);me.debug(e),KVn(e,qWt)},"parse")},dw=10,fw=40,nv=4,X1=2,FO=8,gne=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),uRe=12,hRe=new Set(["redux-color","redux-dark-color"]),aQn=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),zO=C((t,e,r=!1)=>r&&t>0?(t-1)%(e-1)+1:t%e,"calcColorIndex"),Zh=new Map,Jh=new Map,mne=30,vz=new Map,vne=[],K1=0,fi="LR",sQn=C(()=>{Zh.clear(),Jh.clear(),vz.clear(),K1=0,vne=[],fi="LR"},"clear"),jWt=C(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|/gi):t).forEach(n=>{const i=document.createElementNS("http://www.w3.org/2000/svg","tspan");i.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.setAttribute("dy","1em"),i.setAttribute("x","0"),i.setAttribute("class","row"),i.textContent=n.trim(),e.appendChild(i)}),e},"drawText"),XWt=C(t=>{let e,r,n;return fi==="BT"?(r=C((i,a)=>i<=a,"comparisonFunc"),n=1/0):(r=C((i,a)=>i>=a,"comparisonFunc"),n=0),t.forEach(i=>{var s,o;const a=fi==="TB"||fi=="BT"?(s=Jh.get(i))==null?void 0:s.y:(o=Jh.get(i))==null?void 0:o.x;a!==void 0&&r(a,n)&&(e=i,n=a)}),e},"findClosestParent"),oQn=C(t=>{let e="",r=1/0;return t.forEach(n=>{const i=Jh.get(n).y;i<=r&&(e=n,r=i)}),e||void 0},"findClosestParentBT"),lQn=C((t,e,r)=>{let n=r,i=r;const a=[];t.forEach(s=>{const o=e.get(s);if(!o)throw new Error(`Commit not found for key ${s}`);o.parents.length?(n=uQn(o),i=Math.max(n,i)):a.push(o),hQn(o,n)}),n=i,a.forEach(s=>{dQn(s,n,r)}),t.forEach(s=>{const o=e.get(s);if(o!=null&&o.parents.length){const l=oQn(o.parents);n=Jh.get(l).y-fw,n<=i&&(i=n);const u=Zh.get(o.branch).pos,h=n-dw;Jh.set(o.id,{x:u,y:h})}})},"setParallelBTPos"),cQn=C(t=>{var n;const e=XWt(t.parents.filter(i=>i!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const r=(n=Jh.get(e))==null?void 0:n.y;if(r===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return r},"findClosestParentPos"),uQn=C(t=>cQn(t)+fw,"calculateCommitPosition"),hQn=C((t,e)=>{const r=Zh.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const n=r.pos,i=e+dw;return Jh.set(t.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),dQn=C((t,e,r)=>{const n=Zh.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const i=e+r,a=n.pos;Jh.set(t.id,{x:a,y:i})},"setRootPosition"),fQn=C((t,e,r,n,i,a)=>{const{theme:s}=He(),o=gne.has(s??""),l=hRe.has(s??""),u=aQn.has(s??"");if(a===ma.HIGHLIGHT)t.append("rect").attr("x",r.x-10+(o?3:0)).attr("y",r.y-10+(o?3:0)).attr("width",o?14:20).attr("height",o?14:20).attr("class",`commit ${e.id} commit-highlight${zO(i,FO,l)} ${n}-outer`),t.append("rect").attr("x",r.x-6+(o?2:0)).attr("y",r.y-6+(o?2:0)).attr("width",o?8:12).attr("height",o?8:12).attr("class",`commit ${e.id} commit${zO(i,FO,l)} ${n}-inner`);else if(a===ma.CHERRY_PICK)t.append("circle").attr("cx",r.x).attr("cy",r.y).attr("r",o?7:10).attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x-3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x+3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x+3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x-3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`);else{const h=t.append("circle");if(h.attr("cx",r.x),h.attr("cy",r.y),h.attr("r",o?7:10),h.attr("class",`commit ${e.id} commit${zO(i,FO,l)}`),a===ma.MERGE){const d=t.append("circle");d.attr("cx",r.x),d.attr("cy",r.y),d.attr("r",o?5:6),d.attr("class",`commit ${n} ${e.id} commit${zO(i,FO,l)}`)}if(a===ma.REVERSE){const d=t.append("path"),f=o?4:5;d.attr("d",`M ${r.x-f},${r.y-f}L${r.x+f},${r.y+f}M${r.x-f},${r.y+f}L${r.x+f},${r.y-f}`).attr("class",`commit ${n} ${e.id} commit${zO(i,FO,l)}`)}}},"drawCommitBullet"),pQn=C((t,e,r,n,i)=>{var a;if(e.type!==ma.CHERRY_PICK&&(e.customId&&e.type===ma.MERGE||e.type!==ma.MERGE)&&i.showCommitLabel){const s=t.append("g"),o=s.insert("rect").attr("class","commit-label-bkg"),l=s.append("text").attr("x",n).attr("y",r.y+25).attr("class","commit-label").text(e.id),u=(a=l.node())==null?void 0:a.getBBox();if(u&&(o.attr("x",r.posWithOffset-u.width/2-X1).attr("y",r.y+13.5).attr("width",u.width+2*X1).attr("height",u.height+2*X1),fi==="TB"||fi==="BT"?(o.attr("x",r.x-(u.width+4*nv+5)).attr("y",r.y-12),l.attr("x",r.x-(u.width+4*nv)).attr("y",r.y+u.height-12)):l.attr("x",r.posWithOffset-u.width/2),i.rotateCommitLabel))if(fi==="TB"||fi==="BT")l.attr("transform","rotate(-45, "+r.x+", "+r.y+")"),o.attr("transform","rotate(-45, "+r.x+", "+r.y+")");else{const h=-7.5-(u.width+10)/25*9.5,d=10+u.width/25*8.5;s.attr("transform","translate("+h+", "+d+") rotate(-45, "+n+", "+r.y+")")}}},"drawCommitLabel"),gQn=C((t,e,r,n)=>{var i;if(e.tags.length>0){let a=0,s=0,o=0;const l=[];for(const u of e.tags.reverse()){const h=t.insert("polygon"),d=t.append("circle"),f=t.append("text").attr("y",r.y-16-a).attr("class","tag-label").text(u),p=(i=f.node())==null?void 0:i.getBBox();if(!p)throw new Error("Tag bbox not found");s=Math.max(s,p.width),o=Math.max(o,p.height),f.attr("x",r.posWithOffset-p.width/2),l.push({tag:f,hole:d,rect:h,yOffset:a}),a+=20}for(const{tag:u,hole:h,rect:d,yOffset:f}of l){const p=o/2,g=r.y-19.2-f;if(d.attr("class","tag-label-bkg").attr("points",` - ${n-s/2-nv/2},${g+X1} + ${n-s/2-nv/2},${g+X1} ${n-s/2-nv/2},${g-X1} ${r.posWithOffset-s/2-nv},${g-p-X1} ${r.posWithOffset+s/2+nv},${g-p-X1} @@ -1760,8 +1760,8 @@ ${r}`),this.inline?`{${i}}`:i}},$(DM,"JSDocTagImpl"),DM);function XGt(t,e,r){var ${r.x+dw},${m-p-2} ${r.x+dw+s+4},${m-p-2} ${r.x+dw+s+4},${m+p+2} - ${r.x+dw},${m+p+2}`).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),h.attr("cx",r.x+nv/2).attr("cy",m).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),u.attr("x",r.x+5).attr("y",m+3).attr("transform","translate(14,14) rotate(45, "+r.x+","+n+")")}}}},"drawCommitTags"),mQn=C(t=>{switch(t.customType??t.type){case ma.NORMAL:return"commit-normal";case ma.REVERSE:return"commit-reverse";case ma.HIGHLIGHT:return"commit-highlight";case ma.MERGE:return"commit-merge";case ma.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),vQn=C((t,e,r,n)=>{const i={x:0,y:0};if(t.parents.length>0){const a=XWt(t.parents);if(a){const s=n.get(a)??i;return e==="TB"?s.y+fw:e==="BT"?(n.get(t.id)??i).y-fw:s.x+fw}}else return e==="TB"?mne:e==="BT"?(n.get(t.id)??i).y-fw:0;return 0},"calculatePosition"),yQn=C((t,e,r)=>{var l,u;const n=fi==="BT"&&r?e:e+dw,i=(l=Zh.get(t.branch))==null?void 0:l.pos,a=fi==="TB"||fi==="BT"?(u=Zh.get(t.branch))==null?void 0:u.pos:n;if(a===void 0||i===void 0)throw new Error(`Position were undefined for commit ${t.id}`);const s=gne.has(He().theme??""),o=fi==="TB"||fi==="BT"?n:i+(s?uRe/2+1:-2);return{x:a,y:o,posWithOffset:n}},"getCommitPosition"),KWt=C((t,e,r,n)=>{const i=t.append("g").attr("class","commit-bullets"),a=t.append("g").attr("class","commit-labels");let s=fi==="TB"||fi==="BT"?mne:0;const o=[...e.keys()],l=n.parallelCommits??!1,u=C((d,f)=>{var m,v;const p=(m=e.get(d))==null?void 0:m.seq,g=(v=e.get(f))==null?void 0:v.seq;return p!==void 0&&g!==void 0?p-g:0},"sortKeys");let h=o.sort(u);fi==="BT"&&(l&&lQn(h,e,s),h=h.reverse()),h.forEach(d=>{var g;const f=e.get(d);if(!f)throw new Error(`Commit not found for key ${d}`);l&&(s=vQn(f,fi,s,Jh));const p=yQn(f,s,l);if(r){const m=mQn(f),v=f.customType??f.type,y=((g=Zh.get(f.branch))==null?void 0:g.index)??0;fQn(i,f,p,m,y,v),pQn(a,f,p,s,n),gQn(a,f,p,s)}fi==="TB"||fi==="BT"?Jh.set(f.id,{x:p.x,y:p.posWithOffset}):Jh.set(f.id,{x:p.posWithOffset,y:p.y}),s=fi==="BT"&&l?s+fw:s+fw+dw,s>K1&&(K1=s)})},"drawCommits"),bQn=C((t,e,r,n,i)=>{const s=(fi==="TB"||fi==="BT"?r.xu.branch===s,"isOnBranchToGetCurve"),l=C(u=>u.seq>t.seq&&u.seql(u)&&o(u))},"shouldRerouteArrow"),yz=C((t,e,r=0)=>{const n=t+Math.abs(t-e)/2;if(r>5)return n;if(vne.every(s=>Math.abs(s-n)>=10))return vne.push(n),n;const a=Math.abs(t-e);return yz(t,e-a/5,r+1)},"findLane"),xQn=C((t,e,r,n)=>{var m,v,y,b,x;const{theme:i}=He(),a=hRe.has(i??""),s=Jh.get(e.id),o=Jh.get(r.id);if(s===void 0||o===void 0)throw new Error(`Commit positions not found for commits ${e.id} and ${r.id}`);const l=bQn(e,r,s,o,n);let u="",h="",d=0,f=0,p=(m=Zh.get(r.branch))==null?void 0:m.index;r.type===ma.MERGE&&e.id!==r.parents[0]&&(p=(v=Zh.get(e.branch))==null?void 0:v.index);let g;if(l){u="A 10 10, 0, 0, 0,",h="A 10 10, 0, 0, 1,",d=10,f=10;const w=s.yo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===ma.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${s.x} ${o.y-d} ${h} ${s.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${o.x+d} ${s.y} ${u} ${o.x} ${s.y+f} L ${o.x} ${o.y}`),s.x===o.x&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`)):fi==="BT"?(s.xo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===ma.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${s.x} ${o.y+d} ${u} ${s.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${o.x+d} ${s.y} ${h} ${o.x} ${s.y-f} L ${o.x} ${o.y}`),s.x===o.x&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`)):(s.yo.y&&(r.type===ma.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${o.x-d} ${s.y} ${u} ${o.x} ${s.y-f} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${s.x} ${o.y+d} ${h} ${s.x+f} ${o.y} L ${o.x} ${o.y}`),s.y===o.y&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`));if(g===void 0)throw new Error("Line definition not found");t.append("path").attr("d",g).attr("class","arrow arrow"+zO(p,FO,a))},"drawArrow"),wQn=C((t,e)=>{const r=t.append("g").attr("class","commit-arrows");[...e.keys()].forEach(n=>{const i=e.get(n);i.parents&&i.parents.length>0&&i.parents.forEach(a=>{xQn(r,e.get(a),i,e)})})},"drawArrows"),AQn=C((t,e,r,n)=>{const{look:i,theme:a,themeVariables:s}=He(),{dropShadow:o,THEME_COLOR_LIMIT:l}=s,u=gne.has(a??""),h=hRe.has(a??""),d=t.append("g");e.forEach((f,p)=>{var _;const g=zO(p,u?l:FO,h),m=(_=Zh.get(f.name))==null?void 0:_.pos;if(m===void 0)throw new Error(`Position not found for branch ${f.name}`);const v=fi==="TB"||fi==="BT"?m:u?m+uRe/2+1:m-2,y=d.append("line");y.attr("x1",0),y.attr("y1",v),y.attr("x2",K1),y.attr("y2",v),y.attr("class","branch branch"+g),fi==="TB"?(y.attr("y1",mne),y.attr("x1",m),y.attr("y2",K1),y.attr("x2",m)):fi==="BT"&&(y.attr("y1",K1),y.attr("x1",m),y.attr("y2",mne),y.attr("x2",m)),vne.push(v);const b=f.name,x=jWt(b),w=d.insert("rect"),T=d.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+g);T.node().appendChild(x);const S=x.getBBox(),O=u?0:4,k=u?16:0,E=u?uRe:0;i==="neo"&&w.attr("data-look","neo"),w.attr("class","branchLabelBkg label"+g).attr("style",i==="neo"?`filter:${u?`url(#${n}-drop-shadow)`:o}`:"").attr("rx",O).attr("ry",O).attr("x",-S.width-4-(r.rotateCommitLabel===!0?30:0)).attr("y",-S.height/2+10).attr("width",S.width+18+k).attr("height",S.height+4+E),T.attr("transform","translate("+(-S.width-14-(r.rotateCommitLabel===!0?30:0)+k/2)+", "+(v-S.height/2-2)+")"),fi==="TB"?(w.attr("x",m-S.width/2-10).attr("y",0),T.attr("transform","translate("+(m-S.width/2-5)+", 0)"),u&&(w.attr("transform",`translate(${-k/2-3}, ${-E-10})`),T.attr("transform","translate("+(m-S.width/2-5)+", "+(-E*2+7)+")"))):fi==="BT"?(w.attr("x",m-S.width/2-10).attr("y",K1),T.attr("transform","translate("+(m-S.width/2-5)+", "+K1+")"),u&&(w.attr("transform",`translate(${-k/2-3}, ${E+10})`),T.attr("transform","translate("+(m-S.width/2-5)+", "+(K1+E*2+4)+")"))):w.attr("transform","translate(-19, "+(v-12-E/2)+")")})},"drawBranches"),TQn=C(function(t,e,r,n,i){return Zh.set(t,{pos:e,index:r}),e+=50+(i?40:0)+(fi==="TB"||fi==="BT"?n.width/2:0),e},"setBranchPosition"),SQn=C(function(t,e,r,n){sQn(),me.debug("in gitgraph renderer",t+` -`,"id:",e,r);const i=n.db;if(!i.getConfig){me.error("getConfig method is not available on db");return}const a=i.getConfig(),s=a.rotateCommitLabel??!1;vz=i.getCommits();const o=i.getBranchesAsObjArray();fi=i.getDirection();const l=Ot(`[id="${e}"]`),{look:u,theme:h,themeVariables:d}=He(),{useGradient:f,gradientStart:p,gradientStop:g,filterColor:m}=d;if(f){const y=l.append("defs").append("linearGradient").attr("id",e+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");y.append("stop").attr("offset","0%").attr("stop-color",p).attr("stop-opacity",1),y.append("stop").attr("offset","100%").attr("stop-color",g).attr("stop-opacity",1)}u==="neo"&&gne.has(h??"")&&l.append("defs").append("filter").attr("id",e+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",m);let v=0;o.forEach((y,b)=>{var O;const x=jWt(y.name),w=l.append("g"),A=w.insert("g").attr("class","branchLabel"),T=A.insert("g").attr("class","label branch-label");(O=T.node())==null||O.appendChild(x);const S=x.getBBox();v=TQn(y.name,v,b,S,s),T.remove(),A.remove(),w.remove()}),KWt(l,vz,!1,a),a.showBranches&&AQn(l,o,a,e),wQn(l,vz),KWt(l,vz,!0,a),ln.insertTitle(l,"gitTitleText",a.titleTopMargin??0,i.getDiagramTitle()),wye(void 0,l,a.diagramPadding,a.useMaxWidth)},"draw"),CQn={draw:SQn},ZWt=8,JWt=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),OQn=new Set(["redux-color","redux-dark-color"]),kQn=new Set(["neo","neo-dark"]),EQn=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),_Qn=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),RQn=C(t=>{const{svgId:e}=t;let r="";if(t.useGradient&&e)for(let n=0;n{switch(t.customType??t.type){case ma.NORMAL:return"commit-normal";case ma.REVERSE:return"commit-reverse";case ma.HIGHLIGHT:return"commit-highlight";case ma.MERGE:return"commit-merge";case ma.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),vQn=C((t,e,r,n)=>{const i={x:0,y:0};if(t.parents.length>0){const a=XWt(t.parents);if(a){const s=n.get(a)??i;return e==="TB"?s.y+fw:e==="BT"?(n.get(t.id)??i).y-fw:s.x+fw}}else return e==="TB"?mne:e==="BT"?(n.get(t.id)??i).y-fw:0;return 0},"calculatePosition"),yQn=C((t,e,r)=>{var l,u;const n=fi==="BT"&&r?e:e+dw,i=(l=Zh.get(t.branch))==null?void 0:l.pos,a=fi==="TB"||fi==="BT"?(u=Zh.get(t.branch))==null?void 0:u.pos:n;if(a===void 0||i===void 0)throw new Error(`Position were undefined for commit ${t.id}`);const s=gne.has(He().theme??""),o=fi==="TB"||fi==="BT"?n:i+(s?uRe/2+1:-2);return{x:a,y:o,posWithOffset:n}},"getCommitPosition"),KWt=C((t,e,r,n)=>{const i=t.append("g").attr("class","commit-bullets"),a=t.append("g").attr("class","commit-labels");let s=fi==="TB"||fi==="BT"?mne:0;const o=[...e.keys()],l=n.parallelCommits??!1,u=C((d,f)=>{var m,v;const p=(m=e.get(d))==null?void 0:m.seq,g=(v=e.get(f))==null?void 0:v.seq;return p!==void 0&&g!==void 0?p-g:0},"sortKeys");let h=o.sort(u);fi==="BT"&&(l&&lQn(h,e,s),h=h.reverse()),h.forEach(d=>{var g;const f=e.get(d);if(!f)throw new Error(`Commit not found for key ${d}`);l&&(s=vQn(f,fi,s,Jh));const p=yQn(f,s,l);if(r){const m=mQn(f),v=f.customType??f.type,y=((g=Zh.get(f.branch))==null?void 0:g.index)??0;fQn(i,f,p,m,y,v),pQn(a,f,p,s,n),gQn(a,f,p,s)}fi==="TB"||fi==="BT"?Jh.set(f.id,{x:p.x,y:p.posWithOffset}):Jh.set(f.id,{x:p.posWithOffset,y:p.y}),s=fi==="BT"&&l?s+fw:s+fw+dw,s>K1&&(K1=s)})},"drawCommits"),bQn=C((t,e,r,n,i)=>{const s=(fi==="TB"||fi==="BT"?r.xu.branch===s,"isOnBranchToGetCurve"),l=C(u=>u.seq>t.seq&&u.seql(u)&&o(u))},"shouldRerouteArrow"),yz=C((t,e,r=0)=>{const n=t+Math.abs(t-e)/2;if(r>5)return n;if(vne.every(s=>Math.abs(s-n)>=10))return vne.push(n),n;const a=Math.abs(t-e);return yz(t,e-a/5,r+1)},"findLane"),xQn=C((t,e,r,n)=>{var m,v,y,b,x;const{theme:i}=He(),a=hRe.has(i??""),s=Jh.get(e.id),o=Jh.get(r.id);if(s===void 0||o===void 0)throw new Error(`Commit positions not found for commits ${e.id} and ${r.id}`);const l=bQn(e,r,s,o,n);let u="",h="",d=0,f=0,p=(m=Zh.get(r.branch))==null?void 0:m.index;r.type===ma.MERGE&&e.id!==r.parents[0]&&(p=(v=Zh.get(e.branch))==null?void 0:v.index);let g;if(l){u="A 10 10, 0, 0, 0,",h="A 10 10, 0, 0, 1,",d=10,f=10;const w=s.yo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===ma.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${s.x} ${o.y-d} ${h} ${s.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${o.x+d} ${s.y} ${u} ${o.x} ${s.y+f} L ${o.x} ${o.y}`),s.x===o.x&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`)):fi==="BT"?(s.xo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===ma.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${s.x} ${o.y+d} ${u} ${s.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${o.x+d} ${s.y} ${h} ${o.x} ${s.y-f} L ${o.x} ${o.y}`),s.x===o.x&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`)):(s.yo.y&&(r.type===ma.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${o.x-d} ${s.y} ${u} ${o.x} ${s.y-f} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${s.x} ${o.y+d} ${h} ${s.x+f} ${o.y} L ${o.x} ${o.y}`),s.y===o.y&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`));if(g===void 0)throw new Error("Line definition not found");t.append("path").attr("d",g).attr("class","arrow arrow"+zO(p,FO,a))},"drawArrow"),wQn=C((t,e)=>{const r=t.append("g").attr("class","commit-arrows");[...e.keys()].forEach(n=>{const i=e.get(n);i.parents&&i.parents.length>0&&i.parents.forEach(a=>{xQn(r,e.get(a),i,e)})})},"drawArrows"),AQn=C((t,e,r,n)=>{const{look:i,theme:a,themeVariables:s}=He(),{dropShadow:o,THEME_COLOR_LIMIT:l}=s,u=gne.has(a??""),h=hRe.has(a??""),d=t.append("g");e.forEach((f,p)=>{var _;const g=zO(p,u?l:FO,h),m=(_=Zh.get(f.name))==null?void 0:_.pos;if(m===void 0)throw new Error(`Position not found for branch ${f.name}`);const v=fi==="TB"||fi==="BT"?m:u?m+uRe/2+1:m-2,y=d.append("line");y.attr("x1",0),y.attr("y1",v),y.attr("x2",K1),y.attr("y2",v),y.attr("class","branch branch"+g),fi==="TB"?(y.attr("y1",mne),y.attr("x1",m),y.attr("y2",K1),y.attr("x2",m)):fi==="BT"&&(y.attr("y1",K1),y.attr("x1",m),y.attr("y2",mne),y.attr("x2",m)),vne.push(v);const b=f.name,x=jWt(b),w=d.insert("rect"),S=d.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+g);S.node().appendChild(x);const T=x.getBBox(),O=u?0:4,k=u?16:0,E=u?uRe:0;i==="neo"&&w.attr("data-look","neo"),w.attr("class","branchLabelBkg label"+g).attr("style",i==="neo"?`filter:${u?`url(#${n}-drop-shadow)`:o}`:"").attr("rx",O).attr("ry",O).attr("x",-T.width-4-(r.rotateCommitLabel===!0?30:0)).attr("y",-T.height/2+10).attr("width",T.width+18+k).attr("height",T.height+4+E),S.attr("transform","translate("+(-T.width-14-(r.rotateCommitLabel===!0?30:0)+k/2)+", "+(v-T.height/2-2)+")"),fi==="TB"?(w.attr("x",m-T.width/2-10).attr("y",0),S.attr("transform","translate("+(m-T.width/2-5)+", 0)"),u&&(w.attr("transform",`translate(${-k/2-3}, ${-E-10})`),S.attr("transform","translate("+(m-T.width/2-5)+", "+(-E*2+7)+")"))):fi==="BT"?(w.attr("x",m-T.width/2-10).attr("y",K1),S.attr("transform","translate("+(m-T.width/2-5)+", "+K1+")"),u&&(w.attr("transform",`translate(${-k/2-3}, ${E+10})`),S.attr("transform","translate("+(m-T.width/2-5)+", "+(K1+E*2+4)+")"))):w.attr("transform","translate(-19, "+(v-12-E/2)+")")})},"drawBranches"),SQn=C(function(t,e,r,n,i){return Zh.set(t,{pos:e,index:r}),e+=50+(i?40:0)+(fi==="TB"||fi==="BT"?n.width/2:0),e},"setBranchPosition"),TQn=C(function(t,e,r,n){sQn(),me.debug("in gitgraph renderer",t+` +`,"id:",e,r);const i=n.db;if(!i.getConfig){me.error("getConfig method is not available on db");return}const a=i.getConfig(),s=a.rotateCommitLabel??!1;vz=i.getCommits();const o=i.getBranchesAsObjArray();fi=i.getDirection();const l=Ot(`[id="${e}"]`),{look:u,theme:h,themeVariables:d}=He(),{useGradient:f,gradientStart:p,gradientStop:g,filterColor:m}=d;if(f){const y=l.append("defs").append("linearGradient").attr("id",e+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");y.append("stop").attr("offset","0%").attr("stop-color",p).attr("stop-opacity",1),y.append("stop").attr("offset","100%").attr("stop-color",g).attr("stop-opacity",1)}u==="neo"&&gne.has(h??"")&&l.append("defs").append("filter").attr("id",e+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",m);let v=0;o.forEach((y,b)=>{var O;const x=jWt(y.name),w=l.append("g"),A=w.insert("g").attr("class","branchLabel"),S=A.insert("g").attr("class","label branch-label");(O=S.node())==null||O.appendChild(x);const T=x.getBBox();v=SQn(y.name,v,b,T,s),S.remove(),A.remove(),w.remove()}),KWt(l,vz,!1,a),a.showBranches&&AQn(l,o,a,e),wQn(l,vz),KWt(l,vz,!0,a),ln.insertTitle(l,"gitTitleText",a.titleTopMargin??0,i.getDiagramTitle()),wye(void 0,l,a.diagramPadding,a.useMaxWidth)},"draw"),CQn={draw:TQn},ZWt=8,JWt=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),OQn=new Set(["redux-color","redux-dark-color"]),kQn=new Set(["neo","neo-dark"]),EQn=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),_Qn=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),RQn=C(t=>{const{svgId:e}=t;let r="";if(t.useGradient&&e)for(let n=0;n{const e=Dr(),{theme:r,themeVariables:n}=e,{borderColorArray:i}=n,a=JWt.has(r);if(kQn.has(r)){let s="";for(let o=0;o4&&(p+=7),f.add(p,r));return g.diff(m,"week")+1},o.isoWeekday=function(u){return this.$utils().u(u)?this.day()||7:this.day(this.day()%7?u:u-7)};var l=o.startOf;o.startOf=function(u,h){var d=this.$utils(),f=!!d.u(h)||h;return d.p(u)==="isoweek"?f?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):l.bind(this)(u,h)}}})})(eYt);var BQn=eYt.exports;const $Qn=uh(BQn);var tYt={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(xi,function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,a=/\d\d/,s=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,l={},u=function(v){return(v=+v)+(v>68?1900:2e3)},h=function(v){return function(y){this[v]=+y}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=function(y){if(!y||y==="Z")return 0;var b=y.match(/([+-]|\d\d)/g),x=60*b[1]+(+b[2]||0);return x===0?0:b[0]==="+"?-x:x}(v)}],f=function(v){var y=l[v];return y&&(y.indexOf?y:y.s.concat(y.f))},p=function(v,y){var b,x=l.meridiem;if(x){for(var w=1;w<=24;w+=1)if(v.indexOf(x(w,0,y))>-1){b=w>12;break}}else b=v===(y?"pm":"PM");return b},g={A:[o,function(v){this.afternoon=p(v,!1)}],a:[o,function(v){this.afternoon=p(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[a,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[s,h("seconds")],ss:[s,h("seconds")],m:[s,h("minutes")],mm:[s,h("minutes")],H:[s,h("hours")],h:[s,h("hours")],HH:[s,h("hours")],hh:[s,h("hours")],D:[s,h("day")],DD:[a,h("day")],Do:[o,function(v){var y=l.ordinal,b=v.match(/\d+/);if(this.day=b[0],y)for(var x=1;x<=31;x+=1)y(x).replace(/\[|\]/g,"")===v&&(this.day=x)}],w:[s,h("week")],ww:[a,h("week")],M:[s,h("month")],MM:[a,h("month")],MMM:[o,function(v){var y=f("months"),b=(f("monthsShort")||y.map(function(x){return x.slice(0,3)})).indexOf(v)+1;if(b<1)throw new Error;this.month=b%12||b}],MMMM:[o,function(v){var y=f("months").indexOf(v)+1;if(y<1)throw new Error;this.month=y%12||y}],Y:[/[+-]?\d+/,h("year")],YY:[a,function(v){this.year=u(v)}],YYYY:[/\d{4}/,h("year")],Z:d,ZZ:d};function m(v){var y,b;y=v,b=l&&l.formats;for(var x=(v=y.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(E,_,I){var L=I&&I.toUpperCase();return _||b[I]||r[I]||b[L].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(R,D,M){return D||M.slice(1)})})).match(n),w=x.length,A=0;A-1)return new Date((N==="X"?1e3:1)*P);var V=m(N)(P),z=V.year,U=V.month,Q=V.day,G=V.hours,X=V.minutes,Y=V.seconds,le=V.milliseconds,q=V.zone,Z=V.week,ee=new Date,re=Q||(z||U?1:ee.getDate()),ve=z||ee.getFullYear(),ae=0;z&&!U||(ae=U>0?U-1:ee.getMonth());var Ce,Oe=G||0,$e=X||0,he=Y||0,fe=le||0;return q?new Date(Date.UTC(ve,ae,re,Oe,$e,he,fe+60*q.offset*1e3)):F?new Date(Date.UTC(ve,ae,re,Oe,$e,he,fe)):(Ce=new Date(ve,ae,re,Oe,$e,he,fe),Z&&(Ce=B(Ce).week(Z).toDate()),Ce)}catch{return new Date("")}}(T,k,S,b),this.init(),L&&L!==!0&&(this.$L=this.locale(L).$L),I&&T!=this.format(k)&&(this.$d=new Date("")),l={}}else if(k instanceof Array)for(var R=k.length,D=1;D<=R;D+=1){O[1]=k[D-1];var M=b.apply(this,O);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}D===R&&(this.$d=new Date(""))}else w.call(this,A)}}})})(tYt);var FQn=tYt.exports;const zQn=uh(FQn);var rYt={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(xi,function(){return function(r,n){var i=n.prototype,a=i.format;i.format=function(s){var o=this,l=this.$locale();if(!this.isValid())return a.bind(this)(s);var u=this.$utils(),h=(s||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(d){switch(d){case"Q":return Math.ceil((o.$M+1)/3);case"Do":return l.ordinal(o.$D);case"gggg":return o.weekYear();case"GGGG":return o.isoWeekYear();case"wo":return l.ordinal(o.week(),"W");case"w":case"ww":return u.s(o.week(),d==="w"?1:2,"0");case"W":case"WW":return u.s(o.isoWeek(),d==="W"?1:2,"0");case"k":case"kk":return u.s(String(o.$H===0?24:o.$H),d==="k"?1:2,"0");case"X":return Math.floor(o.$d.getTime()/1e3);case"x":return o.$d.getTime();case"z":return"["+o.offsetName()+"]";case"zzz":return"["+o.offsetName("long")+"]";default:return d}});return a.bind(this)(h)}}})})(rYt);var UQn=rYt.exports;const VQn=uh(UQn);var nYt={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(xi,function(){var r,n,i=1e3,a=6e4,s=36e5,o=864e5,l=31536e6,u=2628e6,h=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,d=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,f={years:l,months:u,days:o,hours:s,minutes:a,seconds:i,milliseconds:1,weeks:6048e5},p=function(T){return T instanceof w},g=function(T,S,O){return new w(T,O,S.$l)},m=function(T){return n.p(T)+"s"},v=function(T){return T<0},y=function(T){return v(T)?Math.ceil(T):Math.floor(T)},b=function(T){return Math.abs(T)},x=function(T,S){return T?v(T)?{negative:!0,format:""+b(T)+S}:{negative:!1,format:""+T+S}:{negative:!1,format:""}},w=function(){function T(O,k,E){var _=this;if(this.$d={},this.$l=E,O===void 0&&(this.$ms=0,this.parseFromMilliseconds()),k)return g(O*f[m(k)],this);if(typeof O=="number")return this.$ms=O,this.parseFromMilliseconds(),this;if(typeof O=="object")return Object.keys(O).forEach(function(R){_.$d[m(R)]=O[R]}),this.calMilliseconds(),this;if(typeof O=="string"){var I=O.match(h);if(I){var L=I.slice(2).map(function(R){return R!=null?Number(R):0});return this.$d.years=L[0],this.$d.months=L[1],this.$d.weeks=L[2],this.$d.days=L[3],this.$d.hours=L[4],this.$d.minutes=L[5],this.$d.seconds=L[6],this.calMilliseconds(),this}}return this}var S=T.prototype;return S.calMilliseconds=function(){var O=this;this.$ms=Object.keys(this.$d).reduce(function(k,E){return k+(O.$d[E]||0)*f[E]},0)},S.parseFromMilliseconds=function(){var O=this.$ms;this.$d.years=y(O/l),O%=l,this.$d.months=y(O/u),O%=u,this.$d.days=y(O/o),O%=o,this.$d.hours=y(O/s),O%=s,this.$d.minutes=y(O/a),O%=a,this.$d.seconds=y(O/i),O%=i,this.$d.milliseconds=O},S.toISOString=function(){var O=x(this.$d.years,"Y"),k=x(this.$d.months,"M"),E=+this.$d.days||0;this.$d.weeks&&(E+=7*this.$d.weeks);var _=x(E,"D"),I=x(this.$d.hours,"H"),L=x(this.$d.minutes,"M"),R=this.$d.seconds||0;this.$d.milliseconds&&(R+=this.$d.milliseconds/1e3,R=Math.round(1e3*R)/1e3);var D=x(R,"S"),M=O.negative||k.negative||_.negative||I.negative||L.negative||D.negative,P=I.format||L.format||D.format?"T":"",N=(M?"-":"")+"P"+O.format+k.format+_.format+P+I.format+L.format+D.format;return N==="P"||N==="-P"?"P0D":N},S.toJSON=function(){return this.toISOString()},S.format=function(O){var k=O||"YYYY-MM-DDTHH:mm:ss",E={Y:this.$d.years,YY:n.s(this.$d.years,2,"0"),YYYY:n.s(this.$d.years,4,"0"),M:this.$d.months,MM:n.s(this.$d.months,2,"0"),D:this.$d.days,DD:n.s(this.$d.days,2,"0"),H:this.$d.hours,HH:n.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:n.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:n.s(this.$d.seconds,2,"0"),SSS:n.s(this.$d.milliseconds,3,"0")};return k.replace(d,function(_,I){return I||String(E[_])})},S.as=function(O){return this.$ms/f[m(O)]},S.get=function(O){var k=this.$ms,E=m(O);return E==="milliseconds"?k%=1e3:k=E==="weeks"?y(k/f[E]):this.$d[E],k||0},S.add=function(O,k,E){var _;return _=k?O*f[m(k)]:p(O)?O.$ms:g(O,this).$ms,g(this.$ms+_*(E?-1:1),this)},S.subtract=function(O,k){return this.add(O,k,!0)},S.locale=function(O){var k=this.clone();return k.$l=O,k},S.clone=function(){return g(this.$ms,this)},S.humanize=function(O){return r().add(this.$ms,"ms").locale(this.$l).fromNow(!O)},S.valueOf=function(){return this.asMilliseconds()},S.milliseconds=function(){return this.get("milliseconds")},S.asMilliseconds=function(){return this.as("milliseconds")},S.seconds=function(){return this.get("seconds")},S.asSeconds=function(){return this.as("seconds")},S.minutes=function(){return this.get("minutes")},S.asMinutes=function(){return this.as("minutes")},S.hours=function(){return this.get("hours")},S.asHours=function(){return this.as("hours")},S.days=function(){return this.get("days")},S.asDays=function(){return this.as("days")},S.weeks=function(){return this.get("weeks")},S.asWeeks=function(){return this.as("weeks")},S.months=function(){return this.get("months")},S.asMonths=function(){return this.as("months")},S.years=function(){return this.get("years")},S.asYears=function(){return this.as("years")},T}(),A=function(T,S,O){return T.add(S.years()*O,"y").add(S.months()*O,"M").add(S.days()*O,"d").add(S.hours()*O,"h").add(S.minutes()*O,"m").add(S.seconds()*O,"s").add(S.milliseconds()*O,"ms")};return function(T,S,O){r=O,n=O().$utils(),O.duration=function(_,I){var L=O.locale();return g(_,{$l:L},I)},O.isDuration=p;var k=S.prototype.add,E=S.prototype.subtract;S.prototype.add=function(_,I){return p(_)?A(this,_,1):k.bind(this)(_,I)},S.prototype.subtract=function(_,I){return p(_)?A(this,_,-1):E.bind(this)(_,I)}}})})(nYt);var QQn=nYt.exports;const GQn=uh(QQn);var dRe=function(){var t=C(function(L,R,D,M){for(D=D||{},M=L.length;M--;D[L[M]]=R);return D},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],r=[1,26],n=[1,27],i=[1,28],a=[1,29],s=[1,30],o=[1,31],l=[1,32],u=[1,33],h=[1,34],d=[1,9],f=[1,10],p=[1,11],g=[1,12],m=[1,13],v=[1,14],y=[1,15],b=[1,16],x=[1,19],w=[1,20],A=[1,21],T=[1,22],S=[1,23],O=[1,25],k=[1,35],E={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:C(function(R,D,M,P,N,F,B){var V=F.length-1;switch(N){case 1:return F[V-1];case 2:this.$=[];break;case 3:F[V-1].push(F[V]),this.$=F[V-1];break;case 4:case 5:this.$=F[V];break;case 6:case 7:this.$=[];break;case 8:P.setWeekday("monday");break;case 9:P.setWeekday("tuesday");break;case 10:P.setWeekday("wednesday");break;case 11:P.setWeekday("thursday");break;case 12:P.setWeekday("friday");break;case 13:P.setWeekday("saturday");break;case 14:P.setWeekday("sunday");break;case 15:P.setWeekend("friday");break;case 16:P.setWeekend("saturday");break;case 17:P.setDateFormat(F[V].substr(11)),this.$=F[V].substr(11);break;case 18:P.enableInclusiveEndDates(),this.$=F[V].substr(18);break;case 19:P.TopAxis(),this.$=F[V].substr(8);break;case 20:P.setAxisFormat(F[V].substr(11)),this.$=F[V].substr(11);break;case 21:P.setTickInterval(F[V].substr(13)),this.$=F[V].substr(13);break;case 22:P.setExcludes(F[V].substr(9)),this.$=F[V].substr(9);break;case 23:P.setIncludes(F[V].substr(9)),this.$=F[V].substr(9);break;case 24:P.setTodayMarker(F[V].substr(12)),this.$=F[V].substr(12);break;case 27:P.setDiagramTitle(F[V].substr(6)),this.$=F[V].substr(6);break;case 28:this.$=F[V].trim(),P.setAccTitle(this.$);break;case 29:case 30:this.$=F[V].trim(),P.setAccDescription(this.$);break;case 31:P.addSection(F[V].substr(8)),this.$=F[V].substr(8);break;case 33:P.addTask(F[V-1],F[V]),this.$="task";break;case 34:this.$=F[V-1],P.setClickEvent(F[V-1],F[V],null);break;case 35:this.$=F[V-2],P.setClickEvent(F[V-2],F[V-1],F[V]);break;case 36:this.$=F[V-2],P.setClickEvent(F[V-2],F[V-1],null),P.setLink(F[V-2],F[V]);break;case 37:this.$=F[V-3],P.setClickEvent(F[V-3],F[V-2],F[V-1]),P.setLink(F[V-3],F[V]);break;case 38:this.$=F[V-2],P.setClickEvent(F[V-2],F[V],null),P.setLink(F[V-2],F[V-1]);break;case 39:this.$=F[V-3],P.setClickEvent(F[V-3],F[V-1],F[V]),P.setLink(F[V-3],F[V-2]);break;case 40:this.$=F[V-1],P.setLink(F[V-1],F[V]);break;case 41:case 47:this.$=F[V-1]+" "+F[V];break;case 42:case 43:case 45:this.$=F[V-2]+" "+F[V-1]+" "+F[V];break;case 44:case 46:this.$=F[V-3]+" "+F[V-2]+" "+F[V-1]+" "+F[V];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:r,13:n,14:i,15:a,16:s,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:v,28:y,29:b,30:x,31:w,33:A,35:T,36:S,37:24,38:O,40:k},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:r,13:n,14:i,15:a,16:s,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:v,28:y,29:b,30:x,31:w,33:A,35:T,36:S,37:24,38:O,40:k},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:C(function(R,D){if(D.recoverable)this.trace(R);else{var M=new Error(R);throw M.hash=D,M}},"parseError"),parse:C(function(R){var D=this,M=[0],P=[],N=[null],F=[],B=this.table,V="",z=0,U=0,Q=2,G=1,X=F.slice.call(arguments,1),Y=Object.create(this.lexer),le={yy:{}};for(var q in this.yy)Object.prototype.hasOwnProperty.call(this.yy,q)&&(le.yy[q]=this.yy[q]);Y.setInput(R,le.yy),le.yy.lexer=Y,le.yy.parser=this,typeof Y.yylloc>"u"&&(Y.yylloc={});var Z=Y.yylloc;F.push(Z);var ee=Y.options&&Y.options.ranges;typeof le.yy.parseError=="function"?this.parseError=le.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function re(De){M.length=M.length-2*De,N.length=N.length-De,F.length=F.length-De}C(re,"popStack");function ve(){var De;return De=P.pop()||Y.lex()||G,typeof De!="number"&&(De instanceof Array&&(P=De,De=P.pop()),De=D.symbols_[De]||De),De}C(ve,"lex");for(var ae,Ce,Oe,$e,he={},fe,Te,ge,Qe;;){if(Ce=M[M.length-1],this.defaultActions[Ce]?Oe=this.defaultActions[Ce]:((ae===null||typeof ae>"u")&&(ae=ve()),Oe=B[Ce]&&B[Ce][ae]),typeof Oe>"u"||!Oe.length||!Oe[0]){var Se="";Qe=[];for(fe in B[Ce])this.terminals_[fe]&&fe>Q&&Qe.push("'"+this.terminals_[fe]+"'");Y.showPosition?Se="Parse error on line "+(z+1)+`: +`},"getStyles"),IQn=MQn,PQn={parser:iQn,db:qWt,renderer:CQn,styles:IQn};const NQn=Object.freeze(Object.defineProperty({__proto__:null,diagram:PQn},Symbol.toStringTag,{value:"Module"}));var eYt={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(xi,function(){var r="day";return function(n,i,a){var s=function(u){return u.add(4-u.isoWeekday(),r)},o=i.prototype;o.isoWeekYear=function(){return s(this).year()},o.isoWeek=function(u){if(!this.$utils().u(u))return this.add(7*(u-this.isoWeek()),r);var h,d,f,p,g=s(this),m=(h=this.isoWeekYear(),d=this.$u,f=(d?a.utc:a)().year(h).startOf("year"),p=4-f.isoWeekday(),f.isoWeekday()>4&&(p+=7),f.add(p,r));return g.diff(m,"week")+1},o.isoWeekday=function(u){return this.$utils().u(u)?this.day()||7:this.day(this.day()%7?u:u-7)};var l=o.startOf;o.startOf=function(u,h){var d=this.$utils(),f=!!d.u(h)||h;return d.p(u)==="isoweek"?f?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):l.bind(this)(u,h)}}})})(eYt);var BQn=eYt.exports;const $Qn=uh(BQn);var tYt={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(xi,function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,a=/\d\d/,s=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,l={},u=function(v){return(v=+v)+(v>68?1900:2e3)},h=function(v){return function(y){this[v]=+y}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=function(y){if(!y||y==="Z")return 0;var b=y.match(/([+-]|\d\d)/g),x=60*b[1]+(+b[2]||0);return x===0?0:b[0]==="+"?-x:x}(v)}],f=function(v){var y=l[v];return y&&(y.indexOf?y:y.s.concat(y.f))},p=function(v,y){var b,x=l.meridiem;if(x){for(var w=1;w<=24;w+=1)if(v.indexOf(x(w,0,y))>-1){b=w>12;break}}else b=v===(y?"pm":"PM");return b},g={A:[o,function(v){this.afternoon=p(v,!1)}],a:[o,function(v){this.afternoon=p(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[a,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[s,h("seconds")],ss:[s,h("seconds")],m:[s,h("minutes")],mm:[s,h("minutes")],H:[s,h("hours")],h:[s,h("hours")],HH:[s,h("hours")],hh:[s,h("hours")],D:[s,h("day")],DD:[a,h("day")],Do:[o,function(v){var y=l.ordinal,b=v.match(/\d+/);if(this.day=b[0],y)for(var x=1;x<=31;x+=1)y(x).replace(/\[|\]/g,"")===v&&(this.day=x)}],w:[s,h("week")],ww:[a,h("week")],M:[s,h("month")],MM:[a,h("month")],MMM:[o,function(v){var y=f("months"),b=(f("monthsShort")||y.map(function(x){return x.slice(0,3)})).indexOf(v)+1;if(b<1)throw new Error;this.month=b%12||b}],MMMM:[o,function(v){var y=f("months").indexOf(v)+1;if(y<1)throw new Error;this.month=y%12||y}],Y:[/[+-]?\d+/,h("year")],YY:[a,function(v){this.year=u(v)}],YYYY:[/\d{4}/,h("year")],Z:d,ZZ:d};function m(v){var y,b;y=v,b=l&&l.formats;for(var x=(v=y.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(E,_,I){var L=I&&I.toUpperCase();return _||b[I]||r[I]||b[L].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(R,D,M){return D||M.slice(1)})})).match(n),w=x.length,A=0;A-1)return new Date((N==="X"?1e3:1)*P);var V=m(N)(P),z=V.year,U=V.month,Q=V.day,G=V.hours,X=V.minutes,Y=V.seconds,le=V.milliseconds,q=V.zone,Z=V.week,ee=new Date,re=Q||(z||U?1:ee.getDate()),ve=z||ee.getFullYear(),ae=0;z&&!U||(ae=U>0?U-1:ee.getMonth());var Ce,Oe=G||0,$e=X||0,he=Y||0,fe=le||0;return q?new Date(Date.UTC(ve,ae,re,Oe,$e,he,fe+60*q.offset*1e3)):F?new Date(Date.UTC(ve,ae,re,Oe,$e,he,fe)):(Ce=new Date(ve,ae,re,Oe,$e,he,fe),Z&&(Ce=B(Ce).week(Z).toDate()),Ce)}catch{return new Date("")}}(S,k,T,b),this.init(),L&&L!==!0&&(this.$L=this.locale(L).$L),I&&S!=this.format(k)&&(this.$d=new Date("")),l={}}else if(k instanceof Array)for(var R=k.length,D=1;D<=R;D+=1){O[1]=k[D-1];var M=b.apply(this,O);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}D===R&&(this.$d=new Date(""))}else w.call(this,A)}}})})(tYt);var FQn=tYt.exports;const zQn=uh(FQn);var rYt={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(xi,function(){return function(r,n){var i=n.prototype,a=i.format;i.format=function(s){var o=this,l=this.$locale();if(!this.isValid())return a.bind(this)(s);var u=this.$utils(),h=(s||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(d){switch(d){case"Q":return Math.ceil((o.$M+1)/3);case"Do":return l.ordinal(o.$D);case"gggg":return o.weekYear();case"GGGG":return o.isoWeekYear();case"wo":return l.ordinal(o.week(),"W");case"w":case"ww":return u.s(o.week(),d==="w"?1:2,"0");case"W":case"WW":return u.s(o.isoWeek(),d==="W"?1:2,"0");case"k":case"kk":return u.s(String(o.$H===0?24:o.$H),d==="k"?1:2,"0");case"X":return Math.floor(o.$d.getTime()/1e3);case"x":return o.$d.getTime();case"z":return"["+o.offsetName()+"]";case"zzz":return"["+o.offsetName("long")+"]";default:return d}});return a.bind(this)(h)}}})})(rYt);var UQn=rYt.exports;const VQn=uh(UQn);var nYt={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(xi,function(){var r,n,i=1e3,a=6e4,s=36e5,o=864e5,l=31536e6,u=2628e6,h=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,d=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,f={years:l,months:u,days:o,hours:s,minutes:a,seconds:i,milliseconds:1,weeks:6048e5},p=function(S){return S instanceof w},g=function(S,T,O){return new w(S,O,T.$l)},m=function(S){return n.p(S)+"s"},v=function(S){return S<0},y=function(S){return v(S)?Math.ceil(S):Math.floor(S)},b=function(S){return Math.abs(S)},x=function(S,T){return S?v(S)?{negative:!0,format:""+b(S)+T}:{negative:!1,format:""+S+T}:{negative:!1,format:""}},w=function(){function S(O,k,E){var _=this;if(this.$d={},this.$l=E,O===void 0&&(this.$ms=0,this.parseFromMilliseconds()),k)return g(O*f[m(k)],this);if(typeof O=="number")return this.$ms=O,this.parseFromMilliseconds(),this;if(typeof O=="object")return Object.keys(O).forEach(function(R){_.$d[m(R)]=O[R]}),this.calMilliseconds(),this;if(typeof O=="string"){var I=O.match(h);if(I){var L=I.slice(2).map(function(R){return R!=null?Number(R):0});return this.$d.years=L[0],this.$d.months=L[1],this.$d.weeks=L[2],this.$d.days=L[3],this.$d.hours=L[4],this.$d.minutes=L[5],this.$d.seconds=L[6],this.calMilliseconds(),this}}return this}var T=S.prototype;return T.calMilliseconds=function(){var O=this;this.$ms=Object.keys(this.$d).reduce(function(k,E){return k+(O.$d[E]||0)*f[E]},0)},T.parseFromMilliseconds=function(){var O=this.$ms;this.$d.years=y(O/l),O%=l,this.$d.months=y(O/u),O%=u,this.$d.days=y(O/o),O%=o,this.$d.hours=y(O/s),O%=s,this.$d.minutes=y(O/a),O%=a,this.$d.seconds=y(O/i),O%=i,this.$d.milliseconds=O},T.toISOString=function(){var O=x(this.$d.years,"Y"),k=x(this.$d.months,"M"),E=+this.$d.days||0;this.$d.weeks&&(E+=7*this.$d.weeks);var _=x(E,"D"),I=x(this.$d.hours,"H"),L=x(this.$d.minutes,"M"),R=this.$d.seconds||0;this.$d.milliseconds&&(R+=this.$d.milliseconds/1e3,R=Math.round(1e3*R)/1e3);var D=x(R,"S"),M=O.negative||k.negative||_.negative||I.negative||L.negative||D.negative,P=I.format||L.format||D.format?"T":"",N=(M?"-":"")+"P"+O.format+k.format+_.format+P+I.format+L.format+D.format;return N==="P"||N==="-P"?"P0D":N},T.toJSON=function(){return this.toISOString()},T.format=function(O){var k=O||"YYYY-MM-DDTHH:mm:ss",E={Y:this.$d.years,YY:n.s(this.$d.years,2,"0"),YYYY:n.s(this.$d.years,4,"0"),M:this.$d.months,MM:n.s(this.$d.months,2,"0"),D:this.$d.days,DD:n.s(this.$d.days,2,"0"),H:this.$d.hours,HH:n.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:n.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:n.s(this.$d.seconds,2,"0"),SSS:n.s(this.$d.milliseconds,3,"0")};return k.replace(d,function(_,I){return I||String(E[_])})},T.as=function(O){return this.$ms/f[m(O)]},T.get=function(O){var k=this.$ms,E=m(O);return E==="milliseconds"?k%=1e3:k=E==="weeks"?y(k/f[E]):this.$d[E],k||0},T.add=function(O,k,E){var _;return _=k?O*f[m(k)]:p(O)?O.$ms:g(O,this).$ms,g(this.$ms+_*(E?-1:1),this)},T.subtract=function(O,k){return this.add(O,k,!0)},T.locale=function(O){var k=this.clone();return k.$l=O,k},T.clone=function(){return g(this.$ms,this)},T.humanize=function(O){return r().add(this.$ms,"ms").locale(this.$l).fromNow(!O)},T.valueOf=function(){return this.asMilliseconds()},T.milliseconds=function(){return this.get("milliseconds")},T.asMilliseconds=function(){return this.as("milliseconds")},T.seconds=function(){return this.get("seconds")},T.asSeconds=function(){return this.as("seconds")},T.minutes=function(){return this.get("minutes")},T.asMinutes=function(){return this.as("minutes")},T.hours=function(){return this.get("hours")},T.asHours=function(){return this.as("hours")},T.days=function(){return this.get("days")},T.asDays=function(){return this.as("days")},T.weeks=function(){return this.get("weeks")},T.asWeeks=function(){return this.as("weeks")},T.months=function(){return this.get("months")},T.asMonths=function(){return this.as("months")},T.years=function(){return this.get("years")},T.asYears=function(){return this.as("years")},S}(),A=function(S,T,O){return S.add(T.years()*O,"y").add(T.months()*O,"M").add(T.days()*O,"d").add(T.hours()*O,"h").add(T.minutes()*O,"m").add(T.seconds()*O,"s").add(T.milliseconds()*O,"ms")};return function(S,T,O){r=O,n=O().$utils(),O.duration=function(_,I){var L=O.locale();return g(_,{$l:L},I)},O.isDuration=p;var k=T.prototype.add,E=T.prototype.subtract;T.prototype.add=function(_,I){return p(_)?A(this,_,1):k.bind(this)(_,I)},T.prototype.subtract=function(_,I){return p(_)?A(this,_,-1):E.bind(this)(_,I)}}})})(nYt);var QQn=nYt.exports;const GQn=uh(QQn);var dRe=function(){var t=C(function(L,R,D,M){for(D=D||{},M=L.length;M--;D[L[M]]=R);return D},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],r=[1,26],n=[1,27],i=[1,28],a=[1,29],s=[1,30],o=[1,31],l=[1,32],u=[1,33],h=[1,34],d=[1,9],f=[1,10],p=[1,11],g=[1,12],m=[1,13],v=[1,14],y=[1,15],b=[1,16],x=[1,19],w=[1,20],A=[1,21],S=[1,22],T=[1,23],O=[1,25],k=[1,35],E={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:C(function(R,D,M,P,N,F,B){var V=F.length-1;switch(N){case 1:return F[V-1];case 2:this.$=[];break;case 3:F[V-1].push(F[V]),this.$=F[V-1];break;case 4:case 5:this.$=F[V];break;case 6:case 7:this.$=[];break;case 8:P.setWeekday("monday");break;case 9:P.setWeekday("tuesday");break;case 10:P.setWeekday("wednesday");break;case 11:P.setWeekday("thursday");break;case 12:P.setWeekday("friday");break;case 13:P.setWeekday("saturday");break;case 14:P.setWeekday("sunday");break;case 15:P.setWeekend("friday");break;case 16:P.setWeekend("saturday");break;case 17:P.setDateFormat(F[V].substr(11)),this.$=F[V].substr(11);break;case 18:P.enableInclusiveEndDates(),this.$=F[V].substr(18);break;case 19:P.TopAxis(),this.$=F[V].substr(8);break;case 20:P.setAxisFormat(F[V].substr(11)),this.$=F[V].substr(11);break;case 21:P.setTickInterval(F[V].substr(13)),this.$=F[V].substr(13);break;case 22:P.setExcludes(F[V].substr(9)),this.$=F[V].substr(9);break;case 23:P.setIncludes(F[V].substr(9)),this.$=F[V].substr(9);break;case 24:P.setTodayMarker(F[V].substr(12)),this.$=F[V].substr(12);break;case 27:P.setDiagramTitle(F[V].substr(6)),this.$=F[V].substr(6);break;case 28:this.$=F[V].trim(),P.setAccTitle(this.$);break;case 29:case 30:this.$=F[V].trim(),P.setAccDescription(this.$);break;case 31:P.addSection(F[V].substr(8)),this.$=F[V].substr(8);break;case 33:P.addTask(F[V-1],F[V]),this.$="task";break;case 34:this.$=F[V-1],P.setClickEvent(F[V-1],F[V],null);break;case 35:this.$=F[V-2],P.setClickEvent(F[V-2],F[V-1],F[V]);break;case 36:this.$=F[V-2],P.setClickEvent(F[V-2],F[V-1],null),P.setLink(F[V-2],F[V]);break;case 37:this.$=F[V-3],P.setClickEvent(F[V-3],F[V-2],F[V-1]),P.setLink(F[V-3],F[V]);break;case 38:this.$=F[V-2],P.setClickEvent(F[V-2],F[V],null),P.setLink(F[V-2],F[V-1]);break;case 39:this.$=F[V-3],P.setClickEvent(F[V-3],F[V-1],F[V]),P.setLink(F[V-3],F[V-2]);break;case 40:this.$=F[V-1],P.setLink(F[V-1],F[V]);break;case 41:case 47:this.$=F[V-1]+" "+F[V];break;case 42:case 43:case 45:this.$=F[V-2]+" "+F[V-1]+" "+F[V];break;case 44:case 46:this.$=F[V-3]+" "+F[V-2]+" "+F[V-1]+" "+F[V];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:r,13:n,14:i,15:a,16:s,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:v,28:y,29:b,30:x,31:w,33:A,35:S,36:T,37:24,38:O,40:k},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:r,13:n,14:i,15:a,16:s,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:v,28:y,29:b,30:x,31:w,33:A,35:S,36:T,37:24,38:O,40:k},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:C(function(R,D){if(D.recoverable)this.trace(R);else{var M=new Error(R);throw M.hash=D,M}},"parseError"),parse:C(function(R){var D=this,M=[0],P=[],N=[null],F=[],B=this.table,V="",z=0,U=0,Q=2,G=1,X=F.slice.call(arguments,1),Y=Object.create(this.lexer),le={yy:{}};for(var q in this.yy)Object.prototype.hasOwnProperty.call(this.yy,q)&&(le.yy[q]=this.yy[q]);Y.setInput(R,le.yy),le.yy.lexer=Y,le.yy.parser=this,typeof Y.yylloc>"u"&&(Y.yylloc={});var Z=Y.yylloc;F.push(Z);var ee=Y.options&&Y.options.ranges;typeof le.yy.parseError=="function"?this.parseError=le.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function re(De){M.length=M.length-2*De,N.length=N.length-De,F.length=F.length-De}C(re,"popStack");function ve(){var De;return De=P.pop()||Y.lex()||G,typeof De!="number"&&(De instanceof Array&&(P=De,De=P.pop()),De=D.symbols_[De]||De),De}C(ve,"lex");for(var ae,Ce,Oe,$e,he={},fe,Se,ge,Qe;;){if(Ce=M[M.length-1],this.defaultActions[Ce]?Oe=this.defaultActions[Ce]:((ae===null||typeof ae>"u")&&(ae=ve()),Oe=B[Ce]&&B[Ce][ae]),typeof Oe>"u"||!Oe.length||!Oe[0]){var Te="";Qe=[];for(fe in B[Ce])this.terminals_[fe]&&fe>Q&&Qe.push("'"+this.terminals_[fe]+"'");Y.showPosition?Te="Parse error on line "+(z+1)+`: `+Y.showPosition()+` -Expecting `+Qe.join(", ")+", got '"+(this.terminals_[ae]||ae)+"'":Se="Parse error on line "+(z+1)+": Unexpected "+(ae==G?"end of input":"'"+(this.terminals_[ae]||ae)+"'"),this.parseError(Se,{text:Y.match,token:this.terminals_[ae]||ae,line:Y.yylineno,loc:Z,expected:Qe})}if(Oe[0]instanceof Array&&Oe.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ce+", token: "+ae);switch(Oe[0]){case 1:M.push(ae),N.push(Y.yytext),F.push(Y.yylloc),M.push(Oe[1]),ae=null,U=Y.yyleng,V=Y.yytext,z=Y.yylineno,Z=Y.yylloc;break;case 2:if(Te=this.productions_[Oe[1]][1],he.$=N[N.length-Te],he._$={first_line:F[F.length-(Te||1)].first_line,last_line:F[F.length-1].last_line,first_column:F[F.length-(Te||1)].first_column,last_column:F[F.length-1].last_column},ee&&(he._$.range=[F[F.length-(Te||1)].range[0],F[F.length-1].range[1]]),$e=this.performAction.apply(he,[V,U,z,le.yy,Oe[1],N,F].concat(X)),typeof $e<"u")return $e;Te&&(M=M.slice(0,-1*Te*2),N=N.slice(0,-1*Te),F=F.slice(0,-1*Te)),M.push(this.productions_[Oe[1]][0]),N.push(he.$),F.push(he._$),ge=B[M[M.length-2]][M[M.length-1]],M.push(ge);break;case 3:return!0}}return!0},"parse")},_=function(){var L={EOF:1,parseError:C(function(D,M){if(this.yy.parser)this.yy.parser.parseError(D,M);else throw new Error(D)},"parseError"),setInput:C(function(R,D){return this.yy=D||this.yy||{},this._input=R,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var R=this._input[0];this.yytext+=R,this.yyleng++,this.offset++,this.match+=R,this.matched+=R;var D=R.match(/(?:\r\n?|\n).*/g);return D?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),R},"input"),unput:C(function(R){var D=R.length,M=R.split(/(?:\r\n?|\n)/g);this._input=R+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-D),this.offset-=D;var P=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),M.length-1&&(this.yylineno-=M.length-1);var N=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:M?(M.length===P.length?this.yylloc.first_column:0)+P[P.length-M.length].length-M[0].length:this.yylloc.first_column-D},this.options.ranges&&(this.yylloc.range=[N[0],N[0]+this.yyleng-D]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +Expecting `+Qe.join(", ")+", got '"+(this.terminals_[ae]||ae)+"'":Te="Parse error on line "+(z+1)+": Unexpected "+(ae==G?"end of input":"'"+(this.terminals_[ae]||ae)+"'"),this.parseError(Te,{text:Y.match,token:this.terminals_[ae]||ae,line:Y.yylineno,loc:Z,expected:Qe})}if(Oe[0]instanceof Array&&Oe.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ce+", token: "+ae);switch(Oe[0]){case 1:M.push(ae),N.push(Y.yytext),F.push(Y.yylloc),M.push(Oe[1]),ae=null,U=Y.yyleng,V=Y.yytext,z=Y.yylineno,Z=Y.yylloc;break;case 2:if(Se=this.productions_[Oe[1]][1],he.$=N[N.length-Se],he._$={first_line:F[F.length-(Se||1)].first_line,last_line:F[F.length-1].last_line,first_column:F[F.length-(Se||1)].first_column,last_column:F[F.length-1].last_column},ee&&(he._$.range=[F[F.length-(Se||1)].range[0],F[F.length-1].range[1]]),$e=this.performAction.apply(he,[V,U,z,le.yy,Oe[1],N,F].concat(X)),typeof $e<"u")return $e;Se&&(M=M.slice(0,-1*Se*2),N=N.slice(0,-1*Se),F=F.slice(0,-1*Se)),M.push(this.productions_[Oe[1]][0]),N.push(he.$),F.push(he._$),ge=B[M[M.length-2]][M[M.length-1]],M.push(ge);break;case 3:return!0}}return!0},"parse")},_=function(){var L={EOF:1,parseError:C(function(D,M){if(this.yy.parser)this.yy.parser.parseError(D,M);else throw new Error(D)},"parseError"),setInput:C(function(R,D){return this.yy=D||this.yy||{},this._input=R,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var R=this._input[0];this.yytext+=R,this.yyleng++,this.offset++,this.match+=R,this.matched+=R;var D=R.match(/(?:\r\n?|\n).*/g);return D?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),R},"input"),unput:C(function(R){var D=R.length,M=R.split(/(?:\r\n?|\n)/g);this._input=R+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-D),this.offset-=D;var P=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),M.length-1&&(this.yylineno-=M.length-1);var N=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:M?(M.length===P.length?this.yylloc.first_column:0)+P[P.length-M.length].length-M[0].length:this.yylloc.first_column-D},this.options.ranges&&(this.yylloc.range=[N[0],N[0]+this.yyleng-D]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:C(function(R){this.unput(this.match.slice(R))},"less"),pastInput:C(function(){var R=this.matched.substr(0,this.matched.length-this.match.length);return(R.length>20?"...":"")+R.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:C(function(){var R=this.match;return R.length<20&&(R+=this._input.substr(0,20-R.length)),(R.substr(0,20)+(R.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:C(function(){var R=this.pastInput(),D=new Array(R.length+1).join("-");return R+this.upcomingInput()+` `+D+"^"},"showPosition"),test_match:C(function(R,D){var M,P,N;if(this.options.backtrack_lexer&&(N={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(N.yylloc.range=this.yylloc.range.slice(0))),P=R[0].match(/(?:\r\n?|\n).*/g),P&&(this.yylineno+=P.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:P?P[P.length-1].length-P[P.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+R[0].length},this.yytext+=R[0],this.match+=R[0],this.matches=R,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(R[0].length),this.matched+=R[0],M=this.performAction.call(this,this.yy,this,D,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),M)return M;if(this._backtrack){for(var F in N)this[F]=N[F];return!1}return!1},"test_match"),next:C(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var R,D,M,P;this._more||(this.yytext="",this.match="");for(var N=this._currentRules(),F=0;FD[0].length)){if(D=M,P=F,this.options.backtrack_lexer){if(R=this.test_match(M,N[F]),R!==!1)return R;if(this._backtrack){D=!1;continue}else return!1}else if(!this.options.flex)break}return D?(R=this.test_match(D,N[P]),R!==!1?R:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var D=this.next();return D||this.lex()},"lex"),begin:C(function(D){this.conditionStack.push(D)},"begin"),popState:C(function(){var D=this.conditionStack.length-1;return D>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(D){return D=this.conditionStack.length-1-Math.abs(D||0),D>=0?this.conditionStack[D]:"INITIAL"},"topState"),pushState:C(function(D){this.begin(D)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:C(function(D,M,P,N){switch(P){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return L}();E.lexer=_;function I(){this.yy={}}return C(I,"Parser"),I.prototype=E,E.Parser=I,new I}();dRe.parser=dRe;var HQn=dRe;Cl.extend($Qn),Cl.extend(zQn),Cl.extend(VQn);var iYt={friday:5,saturday:6},iv="",fRe="",pRe=void 0,gRe="",VR=[],QR=[],mRe=new Map,vRe=[],yne=[],GR="",yRe="",aYt=["active","done","crit","milestone","vert"],bRe=[],HR="",bz=!1,xRe=!1,wRe="sunday",bne="saturday",ARe=0,WQn=C(function(){vRe=[],yne=[],GR="",bRe=[],xne=0,SRe=void 0,wne=void 0,ll=[],iv="",fRe="",yRe="",pRe=void 0,gRe="",VR=[],QR=[],bz=!1,xRe=!1,ARe=0,mRe=new Map,HR="",Aa(),wRe="sunday",bne="saturday"},"clear"),YQn=C(function(t){HR=t},"setDiagramId"),qQn=C(function(t){fRe=t},"setAxisFormat"),jQn=C(function(){return fRe},"getAxisFormat"),XQn=C(function(t){pRe=t},"setTickInterval"),KQn=C(function(){return pRe},"getTickInterval"),ZQn=C(function(t){gRe=t},"setTodayMarker"),JQn=C(function(){return gRe},"getTodayMarker"),eGn=C(function(t){iv=t},"setDateFormat"),tGn=C(function(){bz=!0},"enableInclusiveEndDates"),rGn=C(function(){return bz},"endDatesAreInclusive"),nGn=C(function(){xRe=!0},"enableTopAxis"),iGn=C(function(){return xRe},"topAxisEnabled"),aGn=C(function(t){yRe=t},"setDisplayMode"),sGn=C(function(){return yRe},"getDisplayMode"),oGn=C(function(){return iv},"getDateFormat"),sYt=C((t,e)=>{const r=e.toLowerCase().split(/[\s,]+/).filter(n=>n!=="");return[...new Set([...t,...r])]},"mergeTokens"),lGn=C(function(t){VR=sYt(VR,t)},"setIncludes"),cGn=C(function(){return VR},"getIncludes"),uGn=C(function(t){QR=sYt(QR,t)},"setExcludes"),hGn=C(function(){return QR},"getExcludes"),dGn=C(function(){return mRe},"getLinks"),fGn=C(function(t){GR=t,vRe.push(t)},"addSection"),pGn=C(function(){return vRe},"getSections"),gGn=C(function(){let t=dYt();const e=10;let r=0;for(;!t&&ro))throw new Error("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.");t=t.add(1,"d")}return[e,s]},"fixTaskDates"),TRe=C(function(t,e,r){if(r=r.trim(),C(o=>{const l=o.trim();return l==="x"||l==="X"},"isTimestampFormat")(e)&&/^\d+$/.test(r))return new Date(Number(r));const a=/^after\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let o=null;for(const u of a.groups.ids.split(" ")){let h=UO(u);h!==void 0&&(!o||h.endTime>o.endTime)&&(o=h)}if(o)return o.endTime;const l=new Date;return l.setHours(0,0,0,0),l}let s=Cl(r,e.trim(),!0);if(s.isValid())return s.toDate();{me.debug("Invalid date:"+r),me.debug("With date format:"+e.trim());const o=new Date(r);if(o===void 0||isNaN(o.getTime())||o.getFullYear()<-1e4||o.getFullYear()>1e4)throw new Error("Invalid date:"+r);return o}},"getStartDate"),cYt=C(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),uYt=C(function(t,e,r,n=!1){r=r.trim();const a=/^until\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let h=null;for(const f of a.groups.ids.split(" ")){let p=UO(f);p!==void 0&&(!h||p.startTime{window.open(r,"_self")}),mRe.set(n,r))}),fYt(t,"clickable")},"setLink"),fYt=C(function(t,e){t.split(",").forEach(function(r){let n=UO(r);n!==void 0&&n.classes.push(e)})},"setClass"),CGn=C(function(t,e,r){if(He().securityLevel!=="loose"||e===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{ln.runFunc(e,...n)})},"setClickFun"),pYt=C(function(t,e){bRe.push(function(){const r=HR?`${HR}-${t}`:t,n=document.querySelector(`[id="${r}"]`);n!==null&&n.addEventListener("click",function(){e()})},function(){const r=HR?`${HR}-${t}`:t,n=document.querySelector(`[id="${r}-text"]`);n!==null&&n.addEventListener("click",function(){e()})})},"pushFun"),OGn=C(function(t,e,r){t.split(",").forEach(function(n){CGn(n,e,r)}),fYt(t,"clickable")},"setClickEvent"),kGn=C(function(t){bRe.forEach(function(e){e(t)})},"bindFunctions"),EGn={getConfig:C(()=>He().gantt,"getConfig"),clear:WQn,setDateFormat:eGn,getDateFormat:oGn,enableInclusiveEndDates:tGn,endDatesAreInclusive:rGn,enableTopAxis:nGn,topAxisEnabled:iGn,setAxisFormat:qQn,getAxisFormat:jQn,setTickInterval:XQn,getTickInterval:KQn,setTodayMarker:ZQn,getTodayMarker:JQn,setAccTitle:Da,getAccTitle:Ja,setDiagramTitle:rs,getDiagramTitle:La,setDiagramId:YQn,setDisplayMode:aGn,getDisplayMode:sGn,setAccDescription:es,getAccDescription:ts,addSection:fGn,getSections:pGn,getTasks:gGn,addTask:AGn,findTaskById:UO,addTaskOrg:TGn,setIncludes:lGn,getIncludes:cGn,setExcludes:uGn,getExcludes:hGn,setClickEvent:OGn,setLink:SGn,getLinks:dGn,bindFunctions:kGn,parseDuration:cYt,isInvalidDate:oYt,setWeekday:mGn,getWeekday:vGn,setWeekend:yGn};function CRe(t,e,r){let n=!0;for(;n;)n=!1,r.forEach(function(i){const a="^\\s*"+i+"\\s*$",s=new RegExp(a);t[0].match(s)&&(e[i]=!0,t.shift(1),n=!0)})}C(CRe,"getTaskTags"),Cl.extend(GQn);var _Gn=C(function(){me.debug("Something is calling, setConf, remove the call")},"setConf"),gYt={monday:jB,tuesday:Fmt,wednesday:zmt,thursday:wS,friday:Umt,saturday:Vmt,sunday:qB},RGn=C((t,e)=>{let r=[...t].map(()=>-1/0),n=[...t].sort((a,s)=>a.startTime-s.startTime||a.order-s.order),i=0;for(const a of n)for(let s=0;s=r[s]){r[s]=a.endTime,a.order=s+e,s>i&&(i=s);break}return i},"getMaxIntersections"),Z1,ORe=1e4,DGn=C(function(t,e,r,n){const i=He().gantt;n.db.setDiagramId(e);const a=He().securityLevel;let s;a==="sandbox"&&(s=Ot("#i"+e));const o=Ot(a==="sandbox"?s.nodes()[0].contentDocument.body:"body"),l=a==="sandbox"?s.nodes()[0].contentDocument:document,u=l.getElementById(e);Z1=u.parentElement.offsetWidth,Z1===void 0&&(Z1=1200),i.useWidth!==void 0&&(Z1=i.useWidth);const h=n.db.getTasks(),d=h.filter(E=>!E.vert);let f=[];for(const E of d)f.push(E.type);f=k(f);const p={};let g=2*i.topPadding;if(n.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const E={};for(const I of d)E[I.section]===void 0?E[I.section]=[I]:E[I.section].push(I);let _=0;for(const I of Object.keys(E)){const L=RGn(E[I],_)+1;_+=L,g+=L*(i.barHeight+i.barGap),p[I]=L}}else{g+=d.length*(i.barHeight+i.barGap);for(const E of f)p[E]=d.filter(_=>_.type===E).length}u.setAttribute("viewBox","0 0 "+Z1+" "+g);const m=o.select(`[id="${e}"]`),v=$Zr().domain([jWr(h,function(E){return E.startTime}),qWr(h,function(E){return E.endTime})]).rangeRound([0,Z1-i.leftPadding-i.rightPadding]);function y(E,_){const I=E.startTime,L=_.startTime;let R=0;return I>L?R=1:IU.vert===Q.vert?0:U.vert?1:-1);const P=E.filter(U=>!U.vert),F=[...new Set(P.map(U=>U.order))].map(U=>P.find(Q=>Q.order===U));m.append("g").selectAll("rect").data(F).enter().append("rect").attr("x",0).attr("y",function(U,Q){return Q=U.order,Q*_+I-2}).attr("width",function(){return M-i.rightPadding/2}).attr("height",_).attr("class",function(U){for(const[Q,G]of f.entries())if(U.type===G)return"section section"+Q%i.numberSectionStyles;return"section section0"}).enter();const B=m.append("g").selectAll("rect").data(E).enter(),V=n.db.getLinks();if(B.append("rect").attr("id",function(U){return e+"-"+U.id}).attr("rx",3).attr("ry",3).attr("x",function(U){return U.milestone?v(U.startTime)+L+.5*(v(U.endTime)-v(U.startTime))-.5*R:v(U.startTime)+L}).attr("y",function(U,Q){return Q=U.order,U.vert?i.gridLineStartPadding:Q*_+I}).attr("width",function(U){return U.milestone?R:U.vert?.08*R:v(U.renderEndTime||U.endTime)-v(U.startTime)}).attr("height",function(U){return U.vert?P.length*(i.barHeight+i.barGap)+i.barHeight*2:R}).attr("transform-origin",function(U,Q){return Q=U.order,(v(U.startTime)+L+.5*(v(U.endTime)-v(U.startTime))).toString()+"px "+(Q*_+I+.5*R).toString()+"px"}).attr("class",function(U){const Q="task";let G="";U.classes.length>0&&(G=U.classes.join(" "));let X=0;for(const[le,q]of f.entries())U.type===q&&(X=le%i.numberSectionStyles);let Y="";return U.active?U.crit?Y+=" activeCrit":Y=" active":U.done?U.crit?Y=" doneCrit":Y=" done":U.crit&&(Y+=" crit"),Y.length===0&&(Y=" task"),U.milestone&&(Y=" milestone "+Y),U.vert&&(Y=" vert "+Y),Y+=X,Y+=" "+G,Q+Y}),B.append("text").attr("id",function(U){return e+"-"+U.id+"-text"}).text(function(U){return U.task}).attr("font-size",i.fontSize).attr("x",function(U){let Q=v(U.startTime),G=v(U.renderEndTime||U.endTime);if(U.milestone&&(Q+=.5*(v(U.endTime)-v(U.startTime))-.5*R,G=Q+R),U.vert)return v(U.startTime)+L;const X=this.getBBox().width;return X>G-Q?G+X+1.5*i.leftPadding>M?Q+L-5:G+L+5:(G-Q)/2+Q+L}).attr("y",function(U,Q){return U.vert?i.gridLineStartPadding+P.length*(i.barHeight+i.barGap)+60:(Q=U.order,Q*_+i.barHeight/2+(i.fontSize/2-2)+I)}).attr("text-height",R).attr("class",function(U){const Q=v(U.startTime);let G=v(U.endTime);U.milestone&&(G=Q+R);const X=this.getBBox().width;let Y="";U.classes.length>0&&(Y=U.classes.join(" "));let le=0;for(const[Z,ee]of f.entries())U.type===ee&&(le=Z%i.numberSectionStyles);let q="";return U.active&&(U.crit?q="activeCritText"+le:q="activeText"+le),U.done?U.crit?q=q+" doneCritText"+le:q=q+" doneText"+le:U.crit&&(q=q+" critText"+le),U.milestone&&(q+=" milestoneText"),U.vert&&(q+=" vertText"),X>G-Q?G+X+1.5*i.leftPadding>M?Y+" taskTextOutsideLeft taskTextOutside"+le+" "+q:Y+" taskTextOutsideRight taskTextOutside"+le+" "+q+" width-"+X:Y+" taskText taskText"+le+" "+q+" width-"+X}),He().securityLevel==="sandbox"){let U;U=Ot("#i"+e);const Q=U.nodes()[0].contentDocument;B.filter(function(G){return V.has(G.id)}).each(function(G){var X=Q.querySelector("#"+CSS.escape(e+"-"+G.id)),Y=Q.querySelector("#"+CSS.escape(e+"-"+G.id+"-text"));const le=X.parentNode;var q=Q.createElement("a");q.setAttribute("xlink:href",V.get(G.id)),q.setAttribute("target","_top"),le.appendChild(q),q.appendChild(X),q.appendChild(Y)})}}C(x,"drawRects");function w(E,_,I,L,R,D,M,P){if(M.length===0&&P.length===0)return;let N,F;for(const{startTime:G,endTime:X}of D)(N===void 0||GF)&&(F=X);if(!N||!F)return;if(Cl(F).diff(Cl(N),"year")>5){me.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const B=n.db.getDateFormat(),V=[];let z=null,U=Cl(N);for(;U.valueOf()<=F;)n.db.isInvalidDate(U,B,M,P)?z?z.end=U:z={start:U,end:U}:z&&(V.push(z),z=null),U=U.add(1,"d");m.append("g").selectAll("rect").data(V).enter().append("rect").attr("id",G=>e+"-exclude-"+G.start.format("YYYY-MM-DD")).attr("x",G=>v(G.start.startOf("day"))+I).attr("y",i.gridLineStartPadding).attr("width",G=>v(G.end.endOf("day"))-v(G.start.startOf("day"))).attr("height",R-_-i.gridLineStartPadding).attr("transform-origin",function(G,X){return(v(G.start)+I+.5*(v(G.end)-v(G.start))).toString()+"px "+(X*E+.5*R).toString()+"px"}).attr("class","exclude-range")}C(w,"drawExcludeDays");function A(E,_,I,L){if(I<=0||E>_)return 1/0;const R=_-E,D=Cl.duration({[L??"day"]:I}).asMilliseconds();return D<=0?1/0:Math.ceil(R/D)}C(A,"getEstimatedTickCount");function T(E,_,I,L){const R=n.db.getDateFormat(),D=n.db.getAxisFormat();let M;D?M=D:R==="D"?M="%d":M=i.axisFormat??"%Y-%m-%d";let P=iYr(v).tickSize(-L+_+i.gridLineStartPadding).tickFormat(cj(M));const F=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(n.db.getTickInterval()||i.tickInterval);if(F!==null){const B=parseInt(F[1],10);if(isNaN(B)||B<=0)me.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const V=F[2],z=n.db.getWeekday()||i.weekday,U=v.domain(),Q=U[0],G=U[1],X=A(Q,G,B,V);if(X>ORe)me.warn(`The tick interval "${B}${V}" would generate ${X} ticks, which exceeds the maximum allowed (${ORe}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(V){case"millisecond":P.ticks(N5.every(B));break;case"second":P.ticks(Wx.every(B));break;case"minute":P.ticks(WB.every(B));break;case"hour":P.ticks(YB.every(B));break;case"day":P.ticks(bS.every(B));break;case"week":P.ticks(gYt[z].every(B));break;case"month":P.ticks(XB.every(B));break}}}if(m.append("g").attr("class","grid").attr("transform","translate("+E+", "+(L-50)+")").call(P).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),n.db.topAxisEnabled()||i.topAxis){let B=nYr(v).tickSize(-L+_+i.gridLineStartPadding).tickFormat(cj(M));if(F!==null){const V=parseInt(F[1],10);if(isNaN(V)||V<=0)me.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const z=F[2],U=n.db.getWeekday()||i.weekday,Q=v.domain(),G=Q[0],X=Q[1];if(A(G,X,V,z)<=ORe)switch(z){case"millisecond":B.ticks(N5.every(V));break;case"second":B.ticks(Wx.every(V));break;case"minute":B.ticks(WB.every(V));break;case"hour":B.ticks(YB.every(V));break;case"day":B.ticks(bS.every(V));break;case"week":B.ticks(gYt[U].every(V));break;case"month":B.ticks(XB.every(V));break}}}m.append("g").attr("class","grid").attr("transform","translate("+E+", "+_+")").call(B).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}C(T,"makeGrid");function S(E,_){let I=0;const L=Object.keys(p).map(R=>[R,p[R]]);m.append("g").selectAll("text").data(L).enter().append(function(R){const D=R[0].split(jt.lineBreakRegex),M=-(D.length-1)/2,P=l.createElementNS("http://www.w3.org/2000/svg","text");P.setAttribute("dy",M+"em");for(const[N,F]of D.entries()){const B=l.createElementNS("http://www.w3.org/2000/svg","tspan");B.setAttribute("alignment-baseline","central"),B.setAttribute("x","10"),N>0&&B.setAttribute("dy","1em"),B.textContent=F,P.appendChild(B)}return P}).attr("x",10).attr("y",function(R,D){if(D>0)for(let M=0;M` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var D=this.next();return D||this.lex()},"lex"),begin:C(function(D){this.conditionStack.push(D)},"begin"),popState:C(function(){var D=this.conditionStack.length-1;return D>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(D){return D=this.conditionStack.length-1-Math.abs(D||0),D>=0?this.conditionStack[D]:"INITIAL"},"topState"),pushState:C(function(D){this.begin(D)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:C(function(D,M,P,N){switch(P){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return L}();E.lexer=_;function I(){this.yy={}}return C(I,"Parser"),I.prototype=E,E.Parser=I,new I}();dRe.parser=dRe;var HQn=dRe;Cl.extend($Qn),Cl.extend(zQn),Cl.extend(VQn);var iYt={friday:5,saturday:6},iv="",fRe="",pRe=void 0,gRe="",VR=[],QR=[],mRe=new Map,vRe=[],yne=[],GR="",yRe="",aYt=["active","done","crit","milestone","vert"],bRe=[],HR="",bz=!1,xRe=!1,wRe="sunday",bne="saturday",ARe=0,WQn=C(function(){vRe=[],yne=[],GR="",bRe=[],xne=0,TRe=void 0,wne=void 0,ll=[],iv="",fRe="",yRe="",pRe=void 0,gRe="",VR=[],QR=[],bz=!1,xRe=!1,ARe=0,mRe=new Map,HR="",Aa(),wRe="sunday",bne="saturday"},"clear"),YQn=C(function(t){HR=t},"setDiagramId"),qQn=C(function(t){fRe=t},"setAxisFormat"),jQn=C(function(){return fRe},"getAxisFormat"),XQn=C(function(t){pRe=t},"setTickInterval"),KQn=C(function(){return pRe},"getTickInterval"),ZQn=C(function(t){gRe=t},"setTodayMarker"),JQn=C(function(){return gRe},"getTodayMarker"),eGn=C(function(t){iv=t},"setDateFormat"),tGn=C(function(){bz=!0},"enableInclusiveEndDates"),rGn=C(function(){return bz},"endDatesAreInclusive"),nGn=C(function(){xRe=!0},"enableTopAxis"),iGn=C(function(){return xRe},"topAxisEnabled"),aGn=C(function(t){yRe=t},"setDisplayMode"),sGn=C(function(){return yRe},"getDisplayMode"),oGn=C(function(){return iv},"getDateFormat"),sYt=C((t,e)=>{const r=e.toLowerCase().split(/[\s,]+/).filter(n=>n!=="");return[...new Set([...t,...r])]},"mergeTokens"),lGn=C(function(t){VR=sYt(VR,t)},"setIncludes"),cGn=C(function(){return VR},"getIncludes"),uGn=C(function(t){QR=sYt(QR,t)},"setExcludes"),hGn=C(function(){return QR},"getExcludes"),dGn=C(function(){return mRe},"getLinks"),fGn=C(function(t){GR=t,vRe.push(t)},"addSection"),pGn=C(function(){return vRe},"getSections"),gGn=C(function(){let t=dYt();const e=10;let r=0;for(;!t&&ro))throw new Error("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.");t=t.add(1,"d")}return[e,s]},"fixTaskDates"),SRe=C(function(t,e,r){if(r=r.trim(),C(o=>{const l=o.trim();return l==="x"||l==="X"},"isTimestampFormat")(e)&&/^\d+$/.test(r))return new Date(Number(r));const a=/^after\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let o=null;for(const u of a.groups.ids.split(" ")){let h=UO(u);h!==void 0&&(!o||h.endTime>o.endTime)&&(o=h)}if(o)return o.endTime;const l=new Date;return l.setHours(0,0,0,0),l}let s=Cl(r,e.trim(),!0);if(s.isValid())return s.toDate();{me.debug("Invalid date:"+r),me.debug("With date format:"+e.trim());const o=new Date(r);if(o===void 0||isNaN(o.getTime())||o.getFullYear()<-1e4||o.getFullYear()>1e4)throw new Error("Invalid date:"+r);return o}},"getStartDate"),cYt=C(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),uYt=C(function(t,e,r,n=!1){r=r.trim();const a=/^until\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let h=null;for(const f of a.groups.ids.split(" ")){let p=UO(f);p!==void 0&&(!h||p.startTime{window.open(r,"_self")}),mRe.set(n,r))}),fYt(t,"clickable")},"setLink"),fYt=C(function(t,e){t.split(",").forEach(function(r){let n=UO(r);n!==void 0&&n.classes.push(e)})},"setClass"),CGn=C(function(t,e,r){if(He().securityLevel!=="loose"||e===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{ln.runFunc(e,...n)})},"setClickFun"),pYt=C(function(t,e){bRe.push(function(){const r=HR?`${HR}-${t}`:t,n=document.querySelector(`[id="${r}"]`);n!==null&&n.addEventListener("click",function(){e()})},function(){const r=HR?`${HR}-${t}`:t,n=document.querySelector(`[id="${r}-text"]`);n!==null&&n.addEventListener("click",function(){e()})})},"pushFun"),OGn=C(function(t,e,r){t.split(",").forEach(function(n){CGn(n,e,r)}),fYt(t,"clickable")},"setClickEvent"),kGn=C(function(t){bRe.forEach(function(e){e(t)})},"bindFunctions"),EGn={getConfig:C(()=>He().gantt,"getConfig"),clear:WQn,setDateFormat:eGn,getDateFormat:oGn,enableInclusiveEndDates:tGn,endDatesAreInclusive:rGn,enableTopAxis:nGn,topAxisEnabled:iGn,setAxisFormat:qQn,getAxisFormat:jQn,setTickInterval:XQn,getTickInterval:KQn,setTodayMarker:ZQn,getTodayMarker:JQn,setAccTitle:Da,getAccTitle:Ja,setDiagramTitle:rs,getDiagramTitle:La,setDiagramId:YQn,setDisplayMode:aGn,getDisplayMode:sGn,setAccDescription:es,getAccDescription:ts,addSection:fGn,getSections:pGn,getTasks:gGn,addTask:AGn,findTaskById:UO,addTaskOrg:SGn,setIncludes:lGn,getIncludes:cGn,setExcludes:uGn,getExcludes:hGn,setClickEvent:OGn,setLink:TGn,getLinks:dGn,bindFunctions:kGn,parseDuration:cYt,isInvalidDate:oYt,setWeekday:mGn,getWeekday:vGn,setWeekend:yGn};function CRe(t,e,r){let n=!0;for(;n;)n=!1,r.forEach(function(i){const a="^\\s*"+i+"\\s*$",s=new RegExp(a);t[0].match(s)&&(e[i]=!0,t.shift(1),n=!0)})}C(CRe,"getTaskTags"),Cl.extend(GQn);var _Gn=C(function(){me.debug("Something is calling, setConf, remove the call")},"setConf"),gYt={monday:jB,tuesday:Fmt,wednesday:zmt,thursday:wT,friday:Umt,saturday:Vmt,sunday:qB},RGn=C((t,e)=>{let r=[...t].map(()=>-1/0),n=[...t].sort((a,s)=>a.startTime-s.startTime||a.order-s.order),i=0;for(const a of n)for(let s=0;s=r[s]){r[s]=a.endTime,a.order=s+e,s>i&&(i=s);break}return i},"getMaxIntersections"),Z1,ORe=1e4,DGn=C(function(t,e,r,n){const i=He().gantt;n.db.setDiagramId(e);const a=He().securityLevel;let s;a==="sandbox"&&(s=Ot("#i"+e));const o=Ot(a==="sandbox"?s.nodes()[0].contentDocument.body:"body"),l=a==="sandbox"?s.nodes()[0].contentDocument:document,u=l.getElementById(e);Z1=u.parentElement.offsetWidth,Z1===void 0&&(Z1=1200),i.useWidth!==void 0&&(Z1=i.useWidth);const h=n.db.getTasks(),d=h.filter(E=>!E.vert);let f=[];for(const E of d)f.push(E.type);f=k(f);const p={};let g=2*i.topPadding;if(n.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const E={};for(const I of d)E[I.section]===void 0?E[I.section]=[I]:E[I.section].push(I);let _=0;for(const I of Object.keys(E)){const L=RGn(E[I],_)+1;_+=L,g+=L*(i.barHeight+i.barGap),p[I]=L}}else{g+=d.length*(i.barHeight+i.barGap);for(const E of f)p[E]=d.filter(_=>_.type===E).length}u.setAttribute("viewBox","0 0 "+Z1+" "+g);const m=o.select(`[id="${e}"]`),v=$Zr().domain([jWr(h,function(E){return E.startTime}),qWr(h,function(E){return E.endTime})]).rangeRound([0,Z1-i.leftPadding-i.rightPadding]);function y(E,_){const I=E.startTime,L=_.startTime;let R=0;return I>L?R=1:IU.vert===Q.vert?0:U.vert?1:-1);const P=E.filter(U=>!U.vert),F=[...new Set(P.map(U=>U.order))].map(U=>P.find(Q=>Q.order===U));m.append("g").selectAll("rect").data(F).enter().append("rect").attr("x",0).attr("y",function(U,Q){return Q=U.order,Q*_+I-2}).attr("width",function(){return M-i.rightPadding/2}).attr("height",_).attr("class",function(U){for(const[Q,G]of f.entries())if(U.type===G)return"section section"+Q%i.numberSectionStyles;return"section section0"}).enter();const B=m.append("g").selectAll("rect").data(E).enter(),V=n.db.getLinks();if(B.append("rect").attr("id",function(U){return e+"-"+U.id}).attr("rx",3).attr("ry",3).attr("x",function(U){return U.milestone?v(U.startTime)+L+.5*(v(U.endTime)-v(U.startTime))-.5*R:v(U.startTime)+L}).attr("y",function(U,Q){return Q=U.order,U.vert?i.gridLineStartPadding:Q*_+I}).attr("width",function(U){return U.milestone?R:U.vert?.08*R:v(U.renderEndTime||U.endTime)-v(U.startTime)}).attr("height",function(U){return U.vert?P.length*(i.barHeight+i.barGap)+i.barHeight*2:R}).attr("transform-origin",function(U,Q){return Q=U.order,(v(U.startTime)+L+.5*(v(U.endTime)-v(U.startTime))).toString()+"px "+(Q*_+I+.5*R).toString()+"px"}).attr("class",function(U){const Q="task";let G="";U.classes.length>0&&(G=U.classes.join(" "));let X=0;for(const[le,q]of f.entries())U.type===q&&(X=le%i.numberSectionStyles);let Y="";return U.active?U.crit?Y+=" activeCrit":Y=" active":U.done?U.crit?Y=" doneCrit":Y=" done":U.crit&&(Y+=" crit"),Y.length===0&&(Y=" task"),U.milestone&&(Y=" milestone "+Y),U.vert&&(Y=" vert "+Y),Y+=X,Y+=" "+G,Q+Y}),B.append("text").attr("id",function(U){return e+"-"+U.id+"-text"}).text(function(U){return U.task}).attr("font-size",i.fontSize).attr("x",function(U){let Q=v(U.startTime),G=v(U.renderEndTime||U.endTime);if(U.milestone&&(Q+=.5*(v(U.endTime)-v(U.startTime))-.5*R,G=Q+R),U.vert)return v(U.startTime)+L;const X=this.getBBox().width;return X>G-Q?G+X+1.5*i.leftPadding>M?Q+L-5:G+L+5:(G-Q)/2+Q+L}).attr("y",function(U,Q){return U.vert?i.gridLineStartPadding+P.length*(i.barHeight+i.barGap)+60:(Q=U.order,Q*_+i.barHeight/2+(i.fontSize/2-2)+I)}).attr("text-height",R).attr("class",function(U){const Q=v(U.startTime);let G=v(U.endTime);U.milestone&&(G=Q+R);const X=this.getBBox().width;let Y="";U.classes.length>0&&(Y=U.classes.join(" "));let le=0;for(const[Z,ee]of f.entries())U.type===ee&&(le=Z%i.numberSectionStyles);let q="";return U.active&&(U.crit?q="activeCritText"+le:q="activeText"+le),U.done?U.crit?q=q+" doneCritText"+le:q=q+" doneText"+le:U.crit&&(q=q+" critText"+le),U.milestone&&(q+=" milestoneText"),U.vert&&(q+=" vertText"),X>G-Q?G+X+1.5*i.leftPadding>M?Y+" taskTextOutsideLeft taskTextOutside"+le+" "+q:Y+" taskTextOutsideRight taskTextOutside"+le+" "+q+" width-"+X:Y+" taskText taskText"+le+" "+q+" width-"+X}),He().securityLevel==="sandbox"){let U;U=Ot("#i"+e);const Q=U.nodes()[0].contentDocument;B.filter(function(G){return V.has(G.id)}).each(function(G){var X=Q.querySelector("#"+CSS.escape(e+"-"+G.id)),Y=Q.querySelector("#"+CSS.escape(e+"-"+G.id+"-text"));const le=X.parentNode;var q=Q.createElement("a");q.setAttribute("xlink:href",V.get(G.id)),q.setAttribute("target","_top"),le.appendChild(q),q.appendChild(X),q.appendChild(Y)})}}C(x,"drawRects");function w(E,_,I,L,R,D,M,P){if(M.length===0&&P.length===0)return;let N,F;for(const{startTime:G,endTime:X}of D)(N===void 0||GF)&&(F=X);if(!N||!F)return;if(Cl(F).diff(Cl(N),"year")>5){me.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const B=n.db.getDateFormat(),V=[];let z=null,U=Cl(N);for(;U.valueOf()<=F;)n.db.isInvalidDate(U,B,M,P)?z?z.end=U:z={start:U,end:U}:z&&(V.push(z),z=null),U=U.add(1,"d");m.append("g").selectAll("rect").data(V).enter().append("rect").attr("id",G=>e+"-exclude-"+G.start.format("YYYY-MM-DD")).attr("x",G=>v(G.start.startOf("day"))+I).attr("y",i.gridLineStartPadding).attr("width",G=>v(G.end.endOf("day"))-v(G.start.startOf("day"))).attr("height",R-_-i.gridLineStartPadding).attr("transform-origin",function(G,X){return(v(G.start)+I+.5*(v(G.end)-v(G.start))).toString()+"px "+(X*E+.5*R).toString()+"px"}).attr("class","exclude-range")}C(w,"drawExcludeDays");function A(E,_,I,L){if(I<=0||E>_)return 1/0;const R=_-E,D=Cl.duration({[L??"day"]:I}).asMilliseconds();return D<=0?1/0:Math.ceil(R/D)}C(A,"getEstimatedTickCount");function S(E,_,I,L){const R=n.db.getDateFormat(),D=n.db.getAxisFormat();let M;D?M=D:R==="D"?M="%d":M=i.axisFormat??"%Y-%m-%d";let P=iYr(v).tickSize(-L+_+i.gridLineStartPadding).tickFormat(cj(M));const F=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(n.db.getTickInterval()||i.tickInterval);if(F!==null){const B=parseInt(F[1],10);if(isNaN(B)||B<=0)me.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const V=F[2],z=n.db.getWeekday()||i.weekday,U=v.domain(),Q=U[0],G=U[1],X=A(Q,G,B,V);if(X>ORe)me.warn(`The tick interval "${B}${V}" would generate ${X} ticks, which exceeds the maximum allowed (${ORe}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(V){case"millisecond":P.ticks(N5.every(B));break;case"second":P.ticks(Wx.every(B));break;case"minute":P.ticks(WB.every(B));break;case"hour":P.ticks(YB.every(B));break;case"day":P.ticks(bT.every(B));break;case"week":P.ticks(gYt[z].every(B));break;case"month":P.ticks(XB.every(B));break}}}if(m.append("g").attr("class","grid").attr("transform","translate("+E+", "+(L-50)+")").call(P).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),n.db.topAxisEnabled()||i.topAxis){let B=nYr(v).tickSize(-L+_+i.gridLineStartPadding).tickFormat(cj(M));if(F!==null){const V=parseInt(F[1],10);if(isNaN(V)||V<=0)me.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const z=F[2],U=n.db.getWeekday()||i.weekday,Q=v.domain(),G=Q[0],X=Q[1];if(A(G,X,V,z)<=ORe)switch(z){case"millisecond":B.ticks(N5.every(V));break;case"second":B.ticks(Wx.every(V));break;case"minute":B.ticks(WB.every(V));break;case"hour":B.ticks(YB.every(V));break;case"day":B.ticks(bT.every(V));break;case"week":B.ticks(gYt[U].every(V));break;case"month":B.ticks(XB.every(V));break}}}m.append("g").attr("class","grid").attr("transform","translate("+E+", "+_+")").call(B).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}C(S,"makeGrid");function T(E,_){let I=0;const L=Object.keys(p).map(R=>[R,p[R]]);m.append("g").selectAll("text").data(L).enter().append(function(R){const D=R[0].split(jt.lineBreakRegex),M=-(D.length-1)/2,P=l.createElementNS("http://www.w3.org/2000/svg","text");P.setAttribute("dy",M+"em");for(const[N,F]of D.entries()){const B=l.createElementNS("http://www.w3.org/2000/svg","tspan");B.setAttribute("alignment-baseline","central"),B.setAttribute("x","10"),N>0&&B.setAttribute("dy","1em"),B.textContent=F,P.appendChild(B)}return P}).attr("x",10).attr("y",function(R,D){if(D>0)for(let M=0;M` .mermaid-main-font { font-family: ${t.fontFamily}; } @@ -2183,19 +2183,19 @@ Expecting `+Qe.join(", ")+", got '"+(this.terminals_[ae]||ae)+"'":Se="Parse erro font-size: ${t.pieLegendTextSize}; } `,"getStyles"),rHn=tHn,nHn=C(t=>{const e=[...t.values()].reduce((i,a)=>i+a,0),r=[...t.entries()].map(([i,a])=>({label:i,value:a})).filter(i=>i.value/e*100>=1);return JZr().value(i=>i.value).sort(null)(r)},"createPieArcs"),iHn=C((t,e,r,n)=>{var Y;me.debug(`rendering pie chart -`+t);const i=n.db,a=He(),s=ns(i.getConfig(),a.pie),o=40,l=18,u=4,h=450,d=h,f=qc(e),p=f.append("g");p.attr("transform","translate("+d/2+","+h/2+")");const{themeVariables:g}=a;let[m]=By(g.pieOuterStrokeWidth);m??(m=2);const v=s.legendPosition,y=s.textPosition,b=s.donutHole>0&&s.donutHole<=.9?s.donutHole:0,x=Math.min(d,h)/2-o,w=z5().innerRadius(b*x).outerRadius(x),A=z5().innerRadius(x*y).outerRadius(x*y),T=p.append("g");T.append("circle").attr("cx",0).attr("cy",0).attr("r",x+m/2).attr("class","pieOuterCircle");const S=i.getSections(),O=nHn(S),k=[g.pie1,g.pie2,g.pie3,g.pie4,g.pie5,g.pie6,g.pie7,g.pie8,g.pie9,g.pie10,g.pie11,g.pie12];let E=0;S.forEach(le=>{E+=le});const _=O.filter(le=>(le.data.value/E*100).toFixed(0)!=="0"),I=yS(k).domain([...S.keys()]);T.selectAll("mySlices").data(_).enter().append("path").attr("d",w).attr("fill",le=>I(le.data.label)).attr("class",le=>{let q="pieCircle";return s.highlightSlice==="hover"?q+=" highlightedOnHover":s.highlightSlice===le.data.label&&(q+=" highlighted"),q}),T.selectAll("mySlices").data(_).enter().append("text").text(le=>(le.data.value/E*100).toFixed(0)+"%").attr("transform",le=>"translate("+A.centroid(le)+")").style("text-anchor","middle").attr("class","slice");const L=p.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),R=[...S.entries()].map(([le,q])=>({label:le,value:q})),D=p.selectAll(".legend").data(R).enter().append("g").attr("class","legend");D.append("rect").attr("width",l).attr("height",l).style("fill",le=>I(le.label)).style("stroke",le=>I(le.label)),D.append("text").attr("x",l+u).attr("y",l-u).text(le=>i.getShowData()?`${le.label} [${le.value}]`:le.label);const M=Math.max(...D.selectAll("text").nodes().map(le=>(le==null?void 0:le.getBoundingClientRect().width)??0));let P=h,N=d+o;const F=l+u,B=R.length*F;switch(v){case"center":D.attr("transform",(le,q)=>{const Z=F*R.length/2,ee=-M/2-(l+u),re=q*F-Z;return"translate("+ee+","+re+")"});break;case"top":P+=B,D.attr("transform",(le,q)=>{const Z=x,ee=-M/2-(l+u),re=q*F-Z;return`translate(${ee}, ${re})`}),T.attr("transform",()=>`translate(0, ${B+F})`);break;case"bottom":P+=B,D.attr("transform",(le,q)=>{const Z=-x-F,ee=-M/2-(l+u),re=q*F-Z;return"translate("+ee+","+re+")"});break;case"left":N+=l+u+M,D.attr("transform",(le,q)=>{const Z=F*R.length/2,ee=-x-(l+u),re=q*F-Z;return"translate("+ee+","+re+")"}),T.attr("transform",()=>`translate(${M+l+u}, 0)`);break;case"right":default:N+=l+u+M,D.attr("transform",(le,q)=>{const Z=F*R.length/2,ee=12*l,re=q*F-Z;return"translate("+ee+","+re+")"});break}const V=((Y=L.node())==null?void 0:Y.getBoundingClientRect().width)??0,z=d/2-V/2,U=d/2+V/2,Q=Math.min(0,z),X=Math.max(N,U)-Q;f.attr("viewBox",`${Q} 0 ${X} ${P}`),zs(f,P,X,s.useMaxWidth)},"draw"),aHn={draw:iHn},sHn={parser:eHn,db:mYt,renderer:aHn,styles:rHn};const oHn=Object.freeze(Object.defineProperty({__proto__:null,diagram:sHn},Symbol.toStringTag,{value:"Module"}));var _Re=function(){var t=C(function(te,ye,oe,_e){for(oe=oe||{},_e=te.length;_e--;oe[te[_e]]=ye);return oe},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[1,7],s=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],o=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[55,56,57],u=[2,36],h=[1,37],d=[1,36],f=[1,38],p=[1,35],g=[1,43],m=[1,41],v=[1,45],y=[1,14],b=[1,23],x=[1,18],w=[1,19],A=[1,20],T=[1,21],S=[1,22],O=[1,24],k=[1,25],E=[1,26],_=[1,27],I=[1,28],L=[1,29],R=[1,32],D=[1,33],M=[1,34],P=[1,39],N=[1,40],F=[1,42],B=[1,44],V=[1,63],z=[1,62],U=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Q=[1,66],G=[1,67],X=[1,68],Y=[1,69],le=[1,70],q=[1,71],Z=[1,72],ee=[1,73],re=[1,74],ve=[1,75],ae=[1,76],Ce=[1,77],Oe=[4,5,6,7,8,9,10,11,12,13,14,15,18],$e=[1,91],he=[1,92],fe=[1,93],Te=[1,100],ge=[1,94],Qe=[1,97],Se=[1,95],De=[1,96],qe=[1,98],K=[1,99],ce=[1,103],be=[10,55,56,57],ne=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],j={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:C(function(ye,oe,_e,Le,Ye,Pe,Xe){var Ne=Pe.length-1;switch(Ye){case 23:this.$=Pe[Ne];break;case 24:this.$=Pe[Ne-1]+""+Pe[Ne];break;case 26:this.$=Pe[Ne-1]+Pe[Ne];break;case 27:this.$=[Pe[Ne].trim()];break;case 28:Pe[Ne-2].push(Pe[Ne].trim()),this.$=Pe[Ne-2];break;case 29:this.$=Pe[Ne-4],Le.addClass(Pe[Ne-2],Pe[Ne]);break;case 37:this.$=[];break;case 42:this.$=Pe[Ne].trim(),Le.setDiagramTitle(this.$);break;case 43:this.$=Pe[Ne].trim(),Le.setAccTitle(this.$);break;case 44:case 45:this.$=Pe[Ne].trim(),Le.setAccDescription(this.$);break;case 46:Le.addSection(Pe[Ne].substr(8)),this.$=Pe[Ne].substr(8);break;case 47:Le.addPoint(Pe[Ne-3],"",Pe[Ne-1],Pe[Ne],[]);break;case 48:Le.addPoint(Pe[Ne-4],Pe[Ne-3],Pe[Ne-1],Pe[Ne],[]);break;case 49:Le.addPoint(Pe[Ne-4],"",Pe[Ne-2],Pe[Ne-1],Pe[Ne]);break;case 50:Le.addPoint(Pe[Ne-5],Pe[Ne-4],Pe[Ne-2],Pe[Ne-1],Pe[Ne]);break;case 51:Le.setXAxisLeftText(Pe[Ne-2]),Le.setXAxisRightText(Pe[Ne]);break;case 52:Pe[Ne-1].text+=" ⟶ ",Le.setXAxisLeftText(Pe[Ne-1]);break;case 53:Le.setXAxisLeftText(Pe[Ne]);break;case 54:Le.setYAxisBottomText(Pe[Ne-2]),Le.setYAxisTopText(Pe[Ne]);break;case 55:Pe[Ne-1].text+=" ⟶ ",Le.setYAxisBottomText(Pe[Ne-1]);break;case 56:Le.setYAxisBottomText(Pe[Ne]);break;case 57:Le.setQuadrant1Text(Pe[Ne]);break;case 58:Le.setQuadrant2Text(Pe[Ne]);break;case 59:Le.setQuadrant3Text(Pe[Ne]);break;case 60:Le.setQuadrant4Text(Pe[Ne]);break;case 64:this.$={text:Pe[Ne],type:"text"};break;case 65:this.$={text:Pe[Ne-1].text+""+Pe[Ne],type:Pe[Ne-1].type};break;case 66:this.$={text:Pe[Ne],type:"text"};break;case 67:this.$={text:Pe[Ne],type:"markdown"};break;case 68:this.$=Pe[Ne];break;case 69:this.$=Pe[Ne-1]+""+Pe[Ne];break}},"anonymous"),table:[{18:e,26:1,27:2,28:r,55:n,56:i,57:a},{1:[3]},{18:e,26:8,27:2,28:r,55:n,56:i,57:a},{18:e,26:9,27:2,28:r,55:n,56:i,57:a},t(s,[2,33],{29:10}),t(o,[2,61]),t(o,[2,62]),t(o,[2,63]),{1:[2,30]},{1:[2,31]},t(l,u,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:h,5:d,10:f,12:p,13:g,14:m,15:v,18:y,25:b,35:x,37:w,39:A,41:T,42:S,48:O,50:k,51:E,52:_,53:I,54:L,60:R,61:D,63:M,64:P,65:N,66:F,67:B}),t(s,[2,34]),{27:46,55:n,56:i,57:a},t(l,[2,37]),t(l,u,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:h,5:d,10:f,12:p,13:g,14:m,15:v,18:y,25:b,35:x,37:w,39:A,41:T,42:S,48:O,50:k,51:E,52:_,53:I,54:L,60:R,61:D,63:M,64:P,65:N,66:F,67:B}),t(l,[2,39]),t(l,[2,40]),t(l,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(l,[2,45]),t(l,[2,46]),{18:[1,51]},{4:h,5:d,10:f,12:p,13:g,14:m,15:v,43:52,58:31,60:R,61:D,63:M,64:P,65:N,66:F,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:v,43:53,58:31,60:R,61:D,63:M,64:P,65:N,66:F,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:v,43:54,58:31,60:R,61:D,63:M,64:P,65:N,66:F,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:v,43:55,58:31,60:R,61:D,63:M,64:P,65:N,66:F,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:v,43:56,58:31,60:R,61:D,63:M,64:P,65:N,66:F,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:v,43:57,58:31,60:R,61:D,63:M,64:P,65:N,66:F,67:B},{4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:v,18:z,44:[1,58],47:[1,59],58:61,59:60,63:M,64:P,65:N,66:F,67:B},t(U,[2,64]),t(U,[2,66]),t(U,[2,67]),t(U,[2,70]),t(U,[2,71]),t(U,[2,72]),t(U,[2,73]),t(U,[2,74]),t(U,[2,75]),t(U,[2,76]),t(U,[2,77]),t(U,[2,78]),t(U,[2,79]),t(U,[2,80]),t(U,[2,81]),t(s,[2,35]),t(l,[2,38]),t(l,[2,42]),t(l,[2,43]),t(l,[2,44]),{3:65,4:Q,5:G,6:X,7:Y,8:le,9:q,10:Z,11:ee,12:re,13:ve,14:ae,15:Ce,21:64},t(l,[2,53],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:v,18:z,49:[1,78],63:M,64:P,65:N,66:F,67:B}),t(l,[2,56],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:v,18:z,49:[1,79],63:M,64:P,65:N,66:F,67:B}),t(l,[2,57],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:v,18:z,63:M,64:P,65:N,66:F,67:B}),t(l,[2,58],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:v,18:z,63:M,64:P,65:N,66:F,67:B}),t(l,[2,59],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:v,18:z,63:M,64:P,65:N,66:F,67:B}),t(l,[2,60],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:v,18:z,63:M,64:P,65:N,66:F,67:B}),{45:[1,80]},{44:[1,81]},t(U,[2,65]),t(U,[2,82]),t(U,[2,83]),t(U,[2,84]),{3:83,4:Q,5:G,6:X,7:Y,8:le,9:q,10:Z,11:ee,12:re,13:ve,14:ae,15:Ce,18:[1,82]},t(Oe,[2,23]),t(Oe,[2,1]),t(Oe,[2,2]),t(Oe,[2,3]),t(Oe,[2,4]),t(Oe,[2,5]),t(Oe,[2,6]),t(Oe,[2,7]),t(Oe,[2,8]),t(Oe,[2,9]),t(Oe,[2,10]),t(Oe,[2,11]),t(Oe,[2,12]),t(l,[2,52],{58:31,43:84,4:h,5:d,10:f,12:p,13:g,14:m,15:v,60:R,61:D,63:M,64:P,65:N,66:F,67:B}),t(l,[2,55],{58:31,43:85,4:h,5:d,10:f,12:p,13:g,14:m,15:v,60:R,61:D,63:M,64:P,65:N,66:F,67:B}),{46:[1,86]},{45:[1,87]},{4:$e,5:he,6:fe,8:Te,11:ge,13:Qe,16:90,17:Se,18:De,19:qe,20:K,22:89,23:88},t(Oe,[2,24]),t(l,[2,51],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:v,18:z,63:M,64:P,65:N,66:F,67:B}),t(l,[2,54],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:v,18:z,63:M,64:P,65:N,66:F,67:B}),t(l,[2,47],{22:89,16:90,23:101,4:$e,5:he,6:fe,8:Te,11:ge,13:Qe,17:Se,18:De,19:qe,20:K}),{46:[1,102]},t(l,[2,29],{10:ce}),t(be,[2,27],{16:104,4:$e,5:he,6:fe,8:Te,11:ge,13:Qe,17:Se,18:De,19:qe,20:K}),t(ne,[2,25]),t(ne,[2,13]),t(ne,[2,14]),t(ne,[2,15]),t(ne,[2,16]),t(ne,[2,17]),t(ne,[2,18]),t(ne,[2,19]),t(ne,[2,20]),t(ne,[2,21]),t(ne,[2,22]),t(l,[2,49],{10:ce}),t(l,[2,48],{22:89,16:90,23:105,4:$e,5:he,6:fe,8:Te,11:ge,13:Qe,17:Se,18:De,19:qe,20:K}),{4:$e,5:he,6:fe,8:Te,11:ge,13:Qe,16:90,17:Se,18:De,19:qe,20:K,22:106},t(ne,[2,26]),t(l,[2,50],{10:ce}),t(be,[2,28],{16:104,4:$e,5:he,6:fe,8:Te,11:ge,13:Qe,17:Se,18:De,19:qe,20:K})],defaultActions:{8:[2,30],9:[2,31]},parseError:C(function(ye,oe){if(oe.recoverable)this.trace(ye);else{var _e=new Error(ye);throw _e.hash=oe,_e}},"parseError"),parse:C(function(ye){var oe=this,_e=[0],Le=[],Ye=[null],Pe=[],Xe=this.table,Ne="",Ze=0,Ge=0,lt=2,Fe=1,wt=Pe.slice.call(arguments,1),Me=Object.create(this.lexer),Rt={yy:{}};for(var Lt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Lt)&&(Rt.yy[Lt]=this.yy[Lt]);Me.setInput(ye,Rt.yy),Rt.yy.lexer=Me,Rt.yy.parser=this,typeof Me.yylloc>"u"&&(Me.yylloc={});var ut=Me.yylloc;Pe.push(ut);var Xt=Me.options&&Me.options.ranges;typeof Rt.yy.parseError=="function"?this.parseError=Rt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ft(gr){_e.length=_e.length-2*gr,Ye.length=Ye.length-gr,Pe.length=Pe.length-gr}C(Ft,"popStack");function gt(){var gr;return gr=Le.pop()||Me.lex()||Fe,typeof gr!="number"&&(gr instanceof Array&&(Le=gr,gr=Le.pop()),gr=oe.symbols_[gr]||gr),gr}C(gt,"lex");for(var Ae,zt,kt,At,Mt={},jr,Re,at,xt;;){if(zt=_e[_e.length-1],this.defaultActions[zt]?kt=this.defaultActions[zt]:((Ae===null||typeof Ae>"u")&&(Ae=gt()),kt=Xe[zt]&&Xe[zt][Ae]),typeof kt>"u"||!kt.length||!kt[0]){var Ct="";xt=[];for(jr in Xe[zt])this.terminals_[jr]&&jr>lt&&xt.push("'"+this.terminals_[jr]+"'");Me.showPosition?Ct="Parse error on line "+(Ze+1)+`: +`+t);const i=n.db,a=He(),s=ns(i.getConfig(),a.pie),o=40,l=18,u=4,h=450,d=h,f=qc(e),p=f.append("g");p.attr("transform","translate("+d/2+","+h/2+")");const{themeVariables:g}=a;let[m]=By(g.pieOuterStrokeWidth);m??(m=2);const v=s.legendPosition,y=s.textPosition,b=s.donutHole>0&&s.donutHole<=.9?s.donutHole:0,x=Math.min(d,h)/2-o,w=z5().innerRadius(b*x).outerRadius(x),A=z5().innerRadius(x*y).outerRadius(x*y),S=p.append("g");S.append("circle").attr("cx",0).attr("cy",0).attr("r",x+m/2).attr("class","pieOuterCircle");const T=i.getSections(),O=nHn(T),k=[g.pie1,g.pie2,g.pie3,g.pie4,g.pie5,g.pie6,g.pie7,g.pie8,g.pie9,g.pie10,g.pie11,g.pie12];let E=0;T.forEach(le=>{E+=le});const _=O.filter(le=>(le.data.value/E*100).toFixed(0)!=="0"),I=yT(k).domain([...T.keys()]);S.selectAll("mySlices").data(_).enter().append("path").attr("d",w).attr("fill",le=>I(le.data.label)).attr("class",le=>{let q="pieCircle";return s.highlightSlice==="hover"?q+=" highlightedOnHover":s.highlightSlice===le.data.label&&(q+=" highlighted"),q}),S.selectAll("mySlices").data(_).enter().append("text").text(le=>(le.data.value/E*100).toFixed(0)+"%").attr("transform",le=>"translate("+A.centroid(le)+")").style("text-anchor","middle").attr("class","slice");const L=p.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),R=[...T.entries()].map(([le,q])=>({label:le,value:q})),D=p.selectAll(".legend").data(R).enter().append("g").attr("class","legend");D.append("rect").attr("width",l).attr("height",l).style("fill",le=>I(le.label)).style("stroke",le=>I(le.label)),D.append("text").attr("x",l+u).attr("y",l-u).text(le=>i.getShowData()?`${le.label} [${le.value}]`:le.label);const M=Math.max(...D.selectAll("text").nodes().map(le=>(le==null?void 0:le.getBoundingClientRect().width)??0));let P=h,N=d+o;const F=l+u,B=R.length*F;switch(v){case"center":D.attr("transform",(le,q)=>{const Z=F*R.length/2,ee=-M/2-(l+u),re=q*F-Z;return"translate("+ee+","+re+")"});break;case"top":P+=B,D.attr("transform",(le,q)=>{const Z=x,ee=-M/2-(l+u),re=q*F-Z;return`translate(${ee}, ${re})`}),S.attr("transform",()=>`translate(0, ${B+F})`);break;case"bottom":P+=B,D.attr("transform",(le,q)=>{const Z=-x-F,ee=-M/2-(l+u),re=q*F-Z;return"translate("+ee+","+re+")"});break;case"left":N+=l+u+M,D.attr("transform",(le,q)=>{const Z=F*R.length/2,ee=-x-(l+u),re=q*F-Z;return"translate("+ee+","+re+")"}),S.attr("transform",()=>`translate(${M+l+u}, 0)`);break;case"right":default:N+=l+u+M,D.attr("transform",(le,q)=>{const Z=F*R.length/2,ee=12*l,re=q*F-Z;return"translate("+ee+","+re+")"});break}const V=((Y=L.node())==null?void 0:Y.getBoundingClientRect().width)??0,z=d/2-V/2,U=d/2+V/2,Q=Math.min(0,z),X=Math.max(N,U)-Q;f.attr("viewBox",`${Q} 0 ${X} ${P}`),zs(f,P,X,s.useMaxWidth)},"draw"),aHn={draw:iHn},sHn={parser:eHn,db:mYt,renderer:aHn,styles:rHn};const oHn=Object.freeze(Object.defineProperty({__proto__:null,diagram:sHn},Symbol.toStringTag,{value:"Module"}));var _Re=function(){var t=C(function(te,ye,oe,_e){for(oe=oe||{},_e=te.length;_e--;oe[te[_e]]=ye);return oe},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[1,7],s=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],o=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[55,56,57],u=[2,36],h=[1,37],d=[1,36],f=[1,38],p=[1,35],g=[1,43],m=[1,41],v=[1,45],y=[1,14],b=[1,23],x=[1,18],w=[1,19],A=[1,20],S=[1,21],T=[1,22],O=[1,24],k=[1,25],E=[1,26],_=[1,27],I=[1,28],L=[1,29],R=[1,32],D=[1,33],M=[1,34],P=[1,39],N=[1,40],F=[1,42],B=[1,44],V=[1,63],z=[1,62],U=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Q=[1,66],G=[1,67],X=[1,68],Y=[1,69],le=[1,70],q=[1,71],Z=[1,72],ee=[1,73],re=[1,74],ve=[1,75],ae=[1,76],Ce=[1,77],Oe=[4,5,6,7,8,9,10,11,12,13,14,15,18],$e=[1,91],he=[1,92],fe=[1,93],Se=[1,100],ge=[1,94],Qe=[1,97],Te=[1,95],De=[1,96],qe=[1,98],K=[1,99],ce=[1,103],be=[10,55,56,57],ne=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],j={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:C(function(ye,oe,_e,Le,Ye,Pe,Xe){var Ne=Pe.length-1;switch(Ye){case 23:this.$=Pe[Ne];break;case 24:this.$=Pe[Ne-1]+""+Pe[Ne];break;case 26:this.$=Pe[Ne-1]+Pe[Ne];break;case 27:this.$=[Pe[Ne].trim()];break;case 28:Pe[Ne-2].push(Pe[Ne].trim()),this.$=Pe[Ne-2];break;case 29:this.$=Pe[Ne-4],Le.addClass(Pe[Ne-2],Pe[Ne]);break;case 37:this.$=[];break;case 42:this.$=Pe[Ne].trim(),Le.setDiagramTitle(this.$);break;case 43:this.$=Pe[Ne].trim(),Le.setAccTitle(this.$);break;case 44:case 45:this.$=Pe[Ne].trim(),Le.setAccDescription(this.$);break;case 46:Le.addSection(Pe[Ne].substr(8)),this.$=Pe[Ne].substr(8);break;case 47:Le.addPoint(Pe[Ne-3],"",Pe[Ne-1],Pe[Ne],[]);break;case 48:Le.addPoint(Pe[Ne-4],Pe[Ne-3],Pe[Ne-1],Pe[Ne],[]);break;case 49:Le.addPoint(Pe[Ne-4],"",Pe[Ne-2],Pe[Ne-1],Pe[Ne]);break;case 50:Le.addPoint(Pe[Ne-5],Pe[Ne-4],Pe[Ne-2],Pe[Ne-1],Pe[Ne]);break;case 51:Le.setXAxisLeftText(Pe[Ne-2]),Le.setXAxisRightText(Pe[Ne]);break;case 52:Pe[Ne-1].text+=" ⟶ ",Le.setXAxisLeftText(Pe[Ne-1]);break;case 53:Le.setXAxisLeftText(Pe[Ne]);break;case 54:Le.setYAxisBottomText(Pe[Ne-2]),Le.setYAxisTopText(Pe[Ne]);break;case 55:Pe[Ne-1].text+=" ⟶ ",Le.setYAxisBottomText(Pe[Ne-1]);break;case 56:Le.setYAxisBottomText(Pe[Ne]);break;case 57:Le.setQuadrant1Text(Pe[Ne]);break;case 58:Le.setQuadrant2Text(Pe[Ne]);break;case 59:Le.setQuadrant3Text(Pe[Ne]);break;case 60:Le.setQuadrant4Text(Pe[Ne]);break;case 64:this.$={text:Pe[Ne],type:"text"};break;case 65:this.$={text:Pe[Ne-1].text+""+Pe[Ne],type:Pe[Ne-1].type};break;case 66:this.$={text:Pe[Ne],type:"text"};break;case 67:this.$={text:Pe[Ne],type:"markdown"};break;case 68:this.$=Pe[Ne];break;case 69:this.$=Pe[Ne-1]+""+Pe[Ne];break}},"anonymous"),table:[{18:e,26:1,27:2,28:r,55:n,56:i,57:a},{1:[3]},{18:e,26:8,27:2,28:r,55:n,56:i,57:a},{18:e,26:9,27:2,28:r,55:n,56:i,57:a},t(s,[2,33],{29:10}),t(o,[2,61]),t(o,[2,62]),t(o,[2,63]),{1:[2,30]},{1:[2,31]},t(l,u,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:h,5:d,10:f,12:p,13:g,14:m,15:v,18:y,25:b,35:x,37:w,39:A,41:S,42:T,48:O,50:k,51:E,52:_,53:I,54:L,60:R,61:D,63:M,64:P,65:N,66:F,67:B}),t(s,[2,34]),{27:46,55:n,56:i,57:a},t(l,[2,37]),t(l,u,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:h,5:d,10:f,12:p,13:g,14:m,15:v,18:y,25:b,35:x,37:w,39:A,41:S,42:T,48:O,50:k,51:E,52:_,53:I,54:L,60:R,61:D,63:M,64:P,65:N,66:F,67:B}),t(l,[2,39]),t(l,[2,40]),t(l,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(l,[2,45]),t(l,[2,46]),{18:[1,51]},{4:h,5:d,10:f,12:p,13:g,14:m,15:v,43:52,58:31,60:R,61:D,63:M,64:P,65:N,66:F,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:v,43:53,58:31,60:R,61:D,63:M,64:P,65:N,66:F,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:v,43:54,58:31,60:R,61:D,63:M,64:P,65:N,66:F,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:v,43:55,58:31,60:R,61:D,63:M,64:P,65:N,66:F,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:v,43:56,58:31,60:R,61:D,63:M,64:P,65:N,66:F,67:B},{4:h,5:d,10:f,12:p,13:g,14:m,15:v,43:57,58:31,60:R,61:D,63:M,64:P,65:N,66:F,67:B},{4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:v,18:z,44:[1,58],47:[1,59],58:61,59:60,63:M,64:P,65:N,66:F,67:B},t(U,[2,64]),t(U,[2,66]),t(U,[2,67]),t(U,[2,70]),t(U,[2,71]),t(U,[2,72]),t(U,[2,73]),t(U,[2,74]),t(U,[2,75]),t(U,[2,76]),t(U,[2,77]),t(U,[2,78]),t(U,[2,79]),t(U,[2,80]),t(U,[2,81]),t(s,[2,35]),t(l,[2,38]),t(l,[2,42]),t(l,[2,43]),t(l,[2,44]),{3:65,4:Q,5:G,6:X,7:Y,8:le,9:q,10:Z,11:ee,12:re,13:ve,14:ae,15:Ce,21:64},t(l,[2,53],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:v,18:z,49:[1,78],63:M,64:P,65:N,66:F,67:B}),t(l,[2,56],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:v,18:z,49:[1,79],63:M,64:P,65:N,66:F,67:B}),t(l,[2,57],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:v,18:z,63:M,64:P,65:N,66:F,67:B}),t(l,[2,58],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:v,18:z,63:M,64:P,65:N,66:F,67:B}),t(l,[2,59],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:v,18:z,63:M,64:P,65:N,66:F,67:B}),t(l,[2,60],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:v,18:z,63:M,64:P,65:N,66:F,67:B}),{45:[1,80]},{44:[1,81]},t(U,[2,65]),t(U,[2,82]),t(U,[2,83]),t(U,[2,84]),{3:83,4:Q,5:G,6:X,7:Y,8:le,9:q,10:Z,11:ee,12:re,13:ve,14:ae,15:Ce,18:[1,82]},t(Oe,[2,23]),t(Oe,[2,1]),t(Oe,[2,2]),t(Oe,[2,3]),t(Oe,[2,4]),t(Oe,[2,5]),t(Oe,[2,6]),t(Oe,[2,7]),t(Oe,[2,8]),t(Oe,[2,9]),t(Oe,[2,10]),t(Oe,[2,11]),t(Oe,[2,12]),t(l,[2,52],{58:31,43:84,4:h,5:d,10:f,12:p,13:g,14:m,15:v,60:R,61:D,63:M,64:P,65:N,66:F,67:B}),t(l,[2,55],{58:31,43:85,4:h,5:d,10:f,12:p,13:g,14:m,15:v,60:R,61:D,63:M,64:P,65:N,66:F,67:B}),{46:[1,86]},{45:[1,87]},{4:$e,5:he,6:fe,8:Se,11:ge,13:Qe,16:90,17:Te,18:De,19:qe,20:K,22:89,23:88},t(Oe,[2,24]),t(l,[2,51],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:v,18:z,63:M,64:P,65:N,66:F,67:B}),t(l,[2,54],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:v,18:z,63:M,64:P,65:N,66:F,67:B}),t(l,[2,47],{22:89,16:90,23:101,4:$e,5:he,6:fe,8:Se,11:ge,13:Qe,17:Te,18:De,19:qe,20:K}),{46:[1,102]},t(l,[2,29],{10:ce}),t(be,[2,27],{16:104,4:$e,5:he,6:fe,8:Se,11:ge,13:Qe,17:Te,18:De,19:qe,20:K}),t(ne,[2,25]),t(ne,[2,13]),t(ne,[2,14]),t(ne,[2,15]),t(ne,[2,16]),t(ne,[2,17]),t(ne,[2,18]),t(ne,[2,19]),t(ne,[2,20]),t(ne,[2,21]),t(ne,[2,22]),t(l,[2,49],{10:ce}),t(l,[2,48],{22:89,16:90,23:105,4:$e,5:he,6:fe,8:Se,11:ge,13:Qe,17:Te,18:De,19:qe,20:K}),{4:$e,5:he,6:fe,8:Se,11:ge,13:Qe,16:90,17:Te,18:De,19:qe,20:K,22:106},t(ne,[2,26]),t(l,[2,50],{10:ce}),t(be,[2,28],{16:104,4:$e,5:he,6:fe,8:Se,11:ge,13:Qe,17:Te,18:De,19:qe,20:K})],defaultActions:{8:[2,30],9:[2,31]},parseError:C(function(ye,oe){if(oe.recoverable)this.trace(ye);else{var _e=new Error(ye);throw _e.hash=oe,_e}},"parseError"),parse:C(function(ye){var oe=this,_e=[0],Le=[],Ye=[null],Pe=[],Xe=this.table,Ne="",Ze=0,Ge=0,lt=2,Fe=1,wt=Pe.slice.call(arguments,1),Me=Object.create(this.lexer),Rt={yy:{}};for(var Lt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Lt)&&(Rt.yy[Lt]=this.yy[Lt]);Me.setInput(ye,Rt.yy),Rt.yy.lexer=Me,Rt.yy.parser=this,typeof Me.yylloc>"u"&&(Me.yylloc={});var ut=Me.yylloc;Pe.push(ut);var Xt=Me.options&&Me.options.ranges;typeof Rt.yy.parseError=="function"?this.parseError=Rt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ft(gr){_e.length=_e.length-2*gr,Ye.length=Ye.length-gr,Pe.length=Pe.length-gr}C(Ft,"popStack");function gt(){var gr;return gr=Le.pop()||Me.lex()||Fe,typeof gr!="number"&&(gr instanceof Array&&(Le=gr,gr=Le.pop()),gr=oe.symbols_[gr]||gr),gr}C(gt,"lex");for(var Ae,zt,kt,At,Mt={},jr,Re,at,xt;;){if(zt=_e[_e.length-1],this.defaultActions[zt]?kt=this.defaultActions[zt]:((Ae===null||typeof Ae>"u")&&(Ae=gt()),kt=Xe[zt]&&Xe[zt][Ae]),typeof kt>"u"||!kt.length||!kt[0]){var Ct="";xt=[];for(jr in Xe[zt])this.terminals_[jr]&&jr>lt&&xt.push("'"+this.terminals_[jr]+"'");Me.showPosition?Ct="Parse error on line "+(Ze+1)+`: `+Me.showPosition()+` Expecting `+xt.join(", ")+", got '"+(this.terminals_[Ae]||Ae)+"'":Ct="Parse error on line "+(Ze+1)+": Unexpected "+(Ae==Fe?"end of input":"'"+(this.terminals_[Ae]||Ae)+"'"),this.parseError(Ct,{text:Me.match,token:this.terminals_[Ae]||Ae,line:Me.yylineno,loc:ut,expected:xt})}if(kt[0]instanceof Array&&kt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+zt+", token: "+Ae);switch(kt[0]){case 1:_e.push(Ae),Ye.push(Me.yytext),Pe.push(Me.yylloc),_e.push(kt[1]),Ae=null,Ge=Me.yyleng,Ne=Me.yytext,Ze=Me.yylineno,ut=Me.yylloc;break;case 2:if(Re=this.productions_[kt[1]][1],Mt.$=Ye[Ye.length-Re],Mt._$={first_line:Pe[Pe.length-(Re||1)].first_line,last_line:Pe[Pe.length-1].last_line,first_column:Pe[Pe.length-(Re||1)].first_column,last_column:Pe[Pe.length-1].last_column},Xt&&(Mt._$.range=[Pe[Pe.length-(Re||1)].range[0],Pe[Pe.length-1].range[1]]),At=this.performAction.apply(Mt,[Ne,Ge,Ze,Rt.yy,kt[1],Ye,Pe].concat(wt)),typeof At<"u")return At;Re&&(_e=_e.slice(0,-1*Re*2),Ye=Ye.slice(0,-1*Re),Pe=Pe.slice(0,-1*Re)),_e.push(this.productions_[kt[1]][0]),Ye.push(Mt.$),Pe.push(Mt._$),at=Xe[_e[_e.length-2]][_e[_e.length-1]],_e.push(at);break;case 3:return!0}}return!0},"parse")},ie=function(){var te={EOF:1,parseError:C(function(oe,_e){if(this.yy.parser)this.yy.parser.parseError(oe,_e);else throw new Error(oe)},"parseError"),setInput:C(function(ye,oe){return this.yy=oe||this.yy||{},this._input=ye,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var ye=this._input[0];this.yytext+=ye,this.yyleng++,this.offset++,this.match+=ye,this.matched+=ye;var oe=ye.match(/(?:\r\n?|\n).*/g);return oe?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),ye},"input"),unput:C(function(ye){var oe=ye.length,_e=ye.split(/(?:\r\n?|\n)/g);this._input=ye+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-oe),this.offset-=oe;var Le=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),_e.length-1&&(this.yylineno-=_e.length-1);var Ye=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:_e?(_e.length===Le.length?this.yylloc.first_column:0)+Le[Le.length-_e.length].length-_e[0].length:this.yylloc.first_column-oe},this.options.ranges&&(this.yylloc.range=[Ye[0],Ye[0]+this.yyleng-oe]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:C(function(ye){this.unput(this.match.slice(ye))},"less"),pastInput:C(function(){var ye=this.matched.substr(0,this.matched.length-this.match.length);return(ye.length>20?"...":"")+ye.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:C(function(){var ye=this.match;return ye.length<20&&(ye+=this._input.substr(0,20-ye.length)),(ye.substr(0,20)+(ye.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:C(function(){var ye=this.pastInput(),oe=new Array(ye.length+1).join("-");return ye+this.upcomingInput()+` `+oe+"^"},"showPosition"),test_match:C(function(ye,oe){var _e,Le,Ye;if(this.options.backtrack_lexer&&(Ye={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Ye.yylloc.range=this.yylloc.range.slice(0))),Le=ye[0].match(/(?:\r\n?|\n).*/g),Le&&(this.yylineno+=Le.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Le?Le[Le.length-1].length-Le[Le.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+ye[0].length},this.yytext+=ye[0],this.match+=ye[0],this.matches=ye,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(ye[0].length),this.matched+=ye[0],_e=this.performAction.call(this,this.yy,this,oe,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),_e)return _e;if(this._backtrack){for(var Pe in Ye)this[Pe]=Ye[Pe];return!1}return!1},"test_match"),next:C(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var ye,oe,_e,Le;this._more||(this.yytext="",this.match="");for(var Ye=this._currentRules(),Pe=0;Peoe[0].length)){if(oe=_e,Le=Pe,this.options.backtrack_lexer){if(ye=this.test_match(_e,Ye[Pe]),ye!==!1)return ye;if(this._backtrack){oe=!1;continue}else return!1}else if(!this.options.flex)break}return oe?(ye=this.test_match(oe,Ye[Le]),ye!==!1?ye:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var oe=this.next();return oe||this.lex()},"lex"),begin:C(function(oe){this.conditionStack.push(oe)},"begin"),popState:C(function(){var oe=this.conditionStack.length-1;return oe>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(oe){return oe=this.conditionStack.length-1-Math.abs(oe||0),oe>=0?this.conditionStack[oe]:"INITIAL"},"topState"),pushState:C(function(oe){this.begin(oe)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:C(function(oe,_e,Le,Ye){switch(Le){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 15;case 37:return 11;case 38:return 64;case 39:return 10;case 40:return 65;case 41:return 65;case 42:return 14;case 43:return 13;case 44:return 67;case 45:return 66;case 46:return 12;case 47:return 8;case 48:return 5;case 49:return 18;case 50:return 56;case 51:return 63;case 52:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?:[^\x00-\x7F]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return te}();j.lexer=ie;function pe(){this.yy={}}return C(pe,"Parser"),pe.prototype=j,j.Parser=pe,new pe}();_Re.parser=_Re;var lHn=_Re,sh=ky(),cHn=(TI=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,v,y,b;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:((e=Xn.quadrantChart)==null?void 0:e.chartWidth)||500,chartWidth:((r=Xn.quadrantChart)==null?void 0:r.chartHeight)||500,titlePadding:((n=Xn.quadrantChart)==null?void 0:n.titlePadding)||10,titleFontSize:((i=Xn.quadrantChart)==null?void 0:i.titleFontSize)||20,quadrantPadding:((a=Xn.quadrantChart)==null?void 0:a.quadrantPadding)||5,xAxisLabelPadding:((s=Xn.quadrantChart)==null?void 0:s.xAxisLabelPadding)||5,yAxisLabelPadding:((o=Xn.quadrantChart)==null?void 0:o.yAxisLabelPadding)||5,xAxisLabelFontSize:((l=Xn.quadrantChart)==null?void 0:l.xAxisLabelFontSize)||16,yAxisLabelFontSize:((u=Xn.quadrantChart)==null?void 0:u.yAxisLabelFontSize)||16,quadrantLabelFontSize:((h=Xn.quadrantChart)==null?void 0:h.quadrantLabelFontSize)||16,quadrantTextTopPadding:((d=Xn.quadrantChart)==null?void 0:d.quadrantTextTopPadding)||5,pointTextPadding:((f=Xn.quadrantChart)==null?void 0:f.pointTextPadding)||5,pointLabelFontSize:((p=Xn.quadrantChart)==null?void 0:p.pointLabelFontSize)||12,pointRadius:((g=Xn.quadrantChart)==null?void 0:g.pointRadius)||5,xAxisPosition:((m=Xn.quadrantChart)==null?void 0:m.xAxisPosition)||"top",yAxisPosition:((v=Xn.quadrantChart)==null?void 0:v.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:((y=Xn.quadrantChart)==null?void 0:y.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:((b=Xn.quadrantChart)==null?void 0:b.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:sh.quadrant1Fill,quadrant2Fill:sh.quadrant2Fill,quadrant3Fill:sh.quadrant3Fill,quadrant4Fill:sh.quadrant4Fill,quadrant1TextFill:sh.quadrant1TextFill,quadrant2TextFill:sh.quadrant2TextFill,quadrant3TextFill:sh.quadrant3TextFill,quadrant4TextFill:sh.quadrant4TextFill,quadrantPointFill:sh.quadrantPointFill,quadrantPointTextFill:sh.quadrantPointTextFill,quadrantXAxisTextFill:sh.quadrantXAxisTextFill,quadrantYAxisTextFill:sh.quadrantYAxisTextFill,quadrantTitleFill:sh.quadrantTitleFill,quadrantInternalBorderStrokeFill:sh.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:sh.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,me.info("clear called")}setData(e){this.data={...this.data,...e}}addPoints(e){this.data.points=[...e,...this.data.points]}addClass(e,r){this.classes.set(e,r)}setConfig(e){me.trace("setConfig called with: ",e),this.config={...this.config,...e}}setThemeConfig(e){me.trace("setThemeConfig called with: ",e),this.themeConfig={...this.themeConfig,...e}}calculateSpace(e,r,n,i){const a=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,s={top:e==="top"&&r?a:0,bottom:e==="bottom"&&r?a:0},o=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,l={left:this.config.yAxisPosition==="left"&&n?o:0,right:this.config.yAxisPosition==="right"&&n?o:0},u=this.config.titleFontSize+this.config.titlePadding*2,h={top:i?u:0},d=this.config.quadrantPadding+l.left,f=this.config.quadrantPadding+s.top+h.top,p=this.config.chartWidth-this.config.quadrantPadding*2-l.left-l.right,g=this.config.chartHeight-this.config.quadrantPadding*2-s.top-s.bottom-h.top,m=p/2,v=g/2;return{xAxisSpace:s,yAxisSpace:l,titleSpace:h,quadrantSpace:{quadrantLeft:d,quadrantTop:f,quadrantWidth:p,quadrantHalfWidth:m,quadrantHeight:g,quadrantHalfHeight:v}}}getAxisLabels(e,r,n,i){const{quadrantSpace:a,titleSpace:s}=i,{quadrantHalfHeight:o,quadrantHeight:l,quadrantLeft:u,quadrantHalfWidth:h,quadrantTop:d,quadrantWidth:f}=a,p=!!this.data.xAxisRightText,g=!!this.data.yAxisTopText,m=[];return this.data.xAxisLeftText&&r&&m.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+s.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&r&&m.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+h+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+s.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&n&&m.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+l-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&n&&m.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+o-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),m}getQuadrants(e){const{quadrantSpace:r}=e,{quadrantHalfHeight:n,quadrantLeft:i,quadrantHalfWidth:a,quadrantTop:s}=r,o=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+a,y:s,width:a,height:n,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i,y:s,width:a,height:n,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i,y:s+n,width:a,height:n,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+a,y:s+n,width:a,height:n,fill:this.themeConfig.quadrant4Fill}];for(const l of o)l.text.x=l.x+l.width/2,this.data.points.length===0?(l.text.y=l.y+l.height/2,l.text.horizontalPos="middle"):(l.text.y=l.y+this.config.quadrantTextTopPadding,l.text.horizontalPos="top");return o}getQuadrantPoints(e){const{quadrantSpace:r}=e,{quadrantHeight:n,quadrantLeft:i,quadrantTop:a,quadrantWidth:s}=r,o=P5().domain([0,1]).range([i,s+i]),l=P5().domain([0,1]).range([n+a,a]);return this.data.points.map(h=>{const d=this.classes.get(h.className);return d&&(h={...d,...h}),{x:o(h.x),y:l(h.y),fill:h.color??this.themeConfig.quadrantPointFill,radius:h.radius??this.config.pointRadius,text:{text:h.text,fill:this.themeConfig.quadrantPointTextFill,x:o(h.x),y:l(h.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:h.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:h.strokeWidth??"0px"}})}getBorders(e){const r=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:n}=e,{quadrantHalfHeight:i,quadrantHeight:a,quadrantLeft:s,quadrantHalfWidth:o,quadrantTop:l,quadrantWidth:u}=n;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:l,x2:s+u+r,y2:l},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s+u,y1:l+r,x2:s+u,y2:l+a-r},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:l+a,x2:s+u+r,y2:l+a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s,y1:l+r,x2:s,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+o,y1:l+r,x2:s+o,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+r,y1:l+i,x2:s+u-r,y2:l+i}]}getTitle(e){if(e)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const e=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),r=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),n=this.config.showTitle&&!!this.data.titleText,i=this.data.points.length>0?"bottom":this.config.xAxisPosition,a=this.calculateSpace(i,e,r,n);return{points:this.getQuadrantPoints(a),quadrants:this.getQuadrants(a),axisLabels:this.getAxisLabels(i,e,r,a),borderLines:this.getBorders(a),title:this.getTitle(n)}}},C(TI,"QuadrantBuilder"),TI),Tne=(SI=class extends Error{constructor(e,r,n){super(`value for ${e} ${r} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}},C(SI,"InvalidStyleError"),SI);function RRe(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}C(RRe,"validateHexCode");function vYt(t){return!/^\d+$/.test(t)}C(vYt,"validateNumber");function yYt(t){return!/^\d+px$/.test(t)}C(yYt,"validateSizeInPixels");function av(t){return ai(t.trim(),He())}C(av,"textSanitizer");var Cc=new cHn;function bYt(t){Cc.setData({quadrant1Text:av(t.text)})}C(bYt,"setQuadrant1Text");function xYt(t){Cc.setData({quadrant2Text:av(t.text)})}C(xYt,"setQuadrant2Text");function wYt(t){Cc.setData({quadrant3Text:av(t.text)})}C(wYt,"setQuadrant3Text");function AYt(t){Cc.setData({quadrant4Text:av(t.text)})}C(AYt,"setQuadrant4Text");function TYt(t){Cc.setData({xAxisLeftText:av(t.text)})}C(TYt,"setXAxisLeftText");function SYt(t){Cc.setData({xAxisRightText:av(t.text)})}C(SYt,"setXAxisRightText");function CYt(t){Cc.setData({yAxisTopText:av(t.text)})}C(CYt,"setYAxisTopText");function OYt(t){Cc.setData({yAxisBottomText:av(t.text)})}C(OYt,"setYAxisBottomText");function Sne(t){const e={};for(const r of t){const[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(vYt(i))throw new Tne(n,i,"number");e.radius=parseInt(i)}else if(n==="color"){if(RRe(i))throw new Tne(n,i,"hex code");e.color=i}else if(n==="stroke-color"){if(RRe(i))throw new Tne(n,i,"hex code");e.strokeColor=i}else if(n==="stroke-width"){if(yYt(i))throw new Tne(n,i,"number of pixels (eg. 10px)");e.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return e}C(Sne,"parseStyles");function kYt(t,e,r,n,i){const a=Sne(i);Cc.addPoints([{x:r,y:n,text:av(t.text),className:e,...a}])}C(kYt,"addPoint");function EYt(t,e){Cc.addClass(t,Sne(e))}C(EYt,"addClass");function _Yt(t){Cc.setConfig({chartWidth:t})}C(_Yt,"setWidth");function RYt(t){Cc.setConfig({chartHeight:t})}C(RYt,"setHeight");function DYt(){const t=He(),{themeVariables:e,quadrantChart:r}=t;return r&&Cc.setConfig(r),Cc.setThemeConfig({quadrant1Fill:e.quadrant1Fill,quadrant2Fill:e.quadrant2Fill,quadrant3Fill:e.quadrant3Fill,quadrant4Fill:e.quadrant4Fill,quadrant1TextFill:e.quadrant1TextFill,quadrant2TextFill:e.quadrant2TextFill,quadrant3TextFill:e.quadrant3TextFill,quadrant4TextFill:e.quadrant4TextFill,quadrantPointFill:e.quadrantPointFill,quadrantPointTextFill:e.quadrantPointTextFill,quadrantXAxisTextFill:e.quadrantXAxisTextFill,quadrantYAxisTextFill:e.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:e.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:e.quadrantInternalBorderStrokeFill,quadrantTitleFill:e.quadrantTitleFill}),Cc.setData({titleText:La()}),Cc.build()}C(DYt,"getQuadrantData");var uHn=C(function(){Cc.clear(),Aa()},"clear"),hHn={setWidth:_Yt,setHeight:RYt,setQuadrant1Text:bYt,setQuadrant2Text:xYt,setQuadrant3Text:wYt,setQuadrant4Text:AYt,setXAxisLeftText:TYt,setXAxisRightText:SYt,setYAxisTopText:CYt,setYAxisBottomText:OYt,parseStyles:Sne,addPoint:kYt,addClass:EYt,getQuadrantData:DYt,clear:uHn,setAccTitle:Da,getAccTitle:Ja,setDiagramTitle:rs,getDiagramTitle:La,getAccDescription:ts,setAccDescription:es},dHn=C((t,e,r,n)=>{var O,k,E;function i(_){return _==="top"?"hanging":"middle"}C(i,"getDominantBaseLine");function a(_){return _==="left"?"start":"middle"}C(a,"getTextAnchor");function s(_){return`translate(${_.x}, ${_.y}) rotate(${_.rotation||0})`}C(s,"getTransformation");const o=He();me.debug(`Rendering quadrant chart -`+t);const l=o.securityLevel;let u;l==="sandbox"&&(u=Ot("#i"+e));const d=Ot(l==="sandbox"?u.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`),f=d.append("g").attr("class","main"),p=((O=o.quadrantChart)==null?void 0:O.chartWidth)??500,g=((k=o.quadrantChart)==null?void 0:k.chartHeight)??500;zs(d,g,p,((E=o.quadrantChart)==null?void 0:E.useMaxWidth)??!0),d.attr("viewBox","0 0 "+p+" "+g),n.db.setHeight(g),n.db.setWidth(p);const m=n.db.getQuadrantData(),v=f.append("g").attr("class","quadrants"),y=f.append("g").attr("class","border"),b=f.append("g").attr("class","data-points"),x=f.append("g").attr("class","labels"),w=f.append("g").attr("class","title");m.title&&w.append("text").attr("x",0).attr("y",0).attr("fill",m.title.fill).attr("font-size",m.title.fontSize).attr("dominant-baseline",i(m.title.horizontalPos)).attr("text-anchor",a(m.title.verticalPos)).attr("transform",s(m.title)).text(m.title.text),m.borderLines&&y.selectAll("line").data(m.borderLines).enter().append("line").attr("x1",_=>_.x1).attr("y1",_=>_.y1).attr("x2",_=>_.x2).attr("y2",_=>_.y2).style("stroke",_=>_.strokeFill).style("stroke-width",_=>_.strokeWidth);const A=v.selectAll("g.quadrant").data(m.quadrants).enter().append("g").attr("class","quadrant");A.append("rect").attr("x",_=>_.x).attr("y",_=>_.y).attr("width",_=>_.width).attr("height",_=>_.height).attr("fill",_=>_.fill),A.append("text").attr("x",0).attr("y",0).attr("fill",_=>_.text.fill).attr("font-size",_=>_.text.fontSize).attr("dominant-baseline",_=>i(_.text.horizontalPos)).attr("text-anchor",_=>a(_.text.verticalPos)).attr("transform",_=>s(_.text)).text(_=>_.text.text),x.selectAll("g.label").data(m.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(_=>_.text).attr("fill",_=>_.fill).attr("font-size",_=>_.fontSize).attr("dominant-baseline",_=>i(_.horizontalPos)).attr("text-anchor",_=>a(_.verticalPos)).attr("transform",_=>s(_));const S=b.selectAll("g.data-point").data(m.points).enter().append("g").attr("class","data-point");S.append("circle").attr("cx",_=>_.x).attr("cy",_=>_.y).attr("r",_=>_.radius).attr("fill",_=>_.fill).attr("stroke",_=>_.strokeColor).attr("stroke-width",_=>_.strokeWidth),S.append("text").attr("x",0).attr("y",0).text(_=>_.text.text).attr("fill",_=>_.text.fill).attr("font-size",_=>_.text.fontSize).attr("dominant-baseline",_=>i(_.text.horizontalPos)).attr("text-anchor",_=>a(_.text.verticalPos)).attr("transform",_=>s(_.text))},"draw"),fHn={draw:dHn},pHn={parser:lHn,db:hHn,renderer:fHn,styles:C(()=>"","styles")};const gHn=Object.freeze(Object.defineProperty({__proto__:null,diagram:pHn},Symbol.toStringTag,{value:"Module"}));var DRe=function(){var t=C(function(M,P,N,F){for(N=N||{},F=M.length;F--;N[M[F]]=P);return N},"o"),e=[1,10,12,14,16,18,19,21,23],r=[2,6],n=[1,3],i=[1,5],a=[1,6],s=[1,7],o=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],u=[1,26],h=[1,28],d=[1,29],f=[1,30],p=[1,31],g=[1,32],m=[1,33],v=[1,34],y=[1,35],b=[1,36],x=[1,37],w=[1,43],A=[1,42],T=[1,47],S=[1,50],O=[1,10,12,14,16,18,19,21,23,36,37,38],k=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],E=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],_=[1,65],I=[26,28],L={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:C(function(P,N,F,B,V,z,U){var Q=z.length-1;switch(V){case 5:B.setOrientation(z[Q]);break;case 9:B.setDiagramTitle(z[Q].text.trim());break;case 12:B.setLineData({text:"",type:"text"},z[Q]);break;case 13:B.setLineData(z[Q-1],z[Q]);break;case 14:B.setBarData({text:"",type:"text"},z[Q]);break;case 15:B.setBarData(z[Q-1],z[Q]);break;case 16:this.$=z[Q].trim(),B.setAccTitle(this.$);break;case 17:case 18:this.$=z[Q].trim(),B.setAccDescription(this.$);break;case 19:this.$=z[Q-1];break;case 20:case 30:this.$=[z[Q-2],...z[Q]];break;case 21:case 31:this.$=[z[Q]];break;case 22:this.$={value:Number(z[Q-1]),label:z[Q]};break;case 23:this.$={value:Number(z[Q]),label:""};break;case 24:B.setXAxisTitle(z[Q]);break;case 25:B.setXAxisTitle(z[Q-1]);break;case 26:B.setXAxisTitle({type:"text",text:""});break;case 27:B.setXAxisBand(z[Q]);break;case 28:B.setXAxisRangeData(Number(z[Q-2]),Number(z[Q]));break;case 29:this.$=z[Q-1];break;case 32:B.setYAxisTitle(z[Q]);break;case 33:B.setYAxisTitle(z[Q-1]);break;case 34:B.setYAxisTitle({type:"text",text:""});break;case 35:B.setYAxisRangeData(Number(z[Q-2]),Number(z[Q]));break;case 39:this.$={text:z[Q],type:"text"};break;case 40:this.$={text:z[Q],type:"text"};break;case 41:this.$={text:z[Q],type:"markdown"};break;case 42:this.$=z[Q];break;case 43:this.$=z[Q-1]+""+z[Q];break}},"anonymous"),table:[t(e,r,{3:1,4:2,7:4,5:n,36:i,37:a,38:s}),{1:[3]},t(e,r,{4:2,7:4,3:8,5:n,36:i,37:a,38:s}),t(e,r,{4:2,7:4,6:9,3:10,5:n,8:[1,11],36:i,37:a,38:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(o,[2,36]),t(o,[2,37]),t(o,[2,38]),{1:[2,1]},t(e,r,{4:2,7:4,3:21,5:n,36:i,37:a,38:s}),{1:[2,3]},t(o,[2,5]),t(e,[2,7],{4:22,36:i,37:a,38:s}),{11:23,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:v,49:y,50:b,51:x},{11:39,13:38,24:w,29:A,30:l,31:40,32:41,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:v,49:y,50:b,51:x},{11:45,15:44,29:T,30:l,35:46,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:v,49:y,50:b,51:x},{11:49,17:48,24:S,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:v,49:y,50:b,51:x},{11:52,17:51,24:S,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:v,49:y,50:b,51:x},{20:[1,53]},{22:[1,54]},t(O,[2,18]),{1:[2,2]},t(O,[2,8]),t(O,[2,9]),t(k,[2,39],{41:55,42:h,43:d,44:f,45:p,46:g,47:m,48:v,49:y,50:b,51:x}),t(k,[2,40]),t(k,[2,41]),t(E,[2,42]),t(E,[2,44]),t(E,[2,45]),t(E,[2,46]),t(E,[2,47]),t(E,[2,48]),t(E,[2,49]),t(E,[2,50]),t(E,[2,51]),t(E,[2,52]),t(E,[2,53]),t(O,[2,10]),t(O,[2,24],{32:41,31:56,24:w,29:A}),t(O,[2,26]),t(O,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:v,49:y,50:b,51:x},t(O,[2,11]),t(O,[2,32],{35:60,29:T}),t(O,[2,34]),{33:[1,61]},t(O,[2,12]),{17:62,24:S},{25:63,27:64,29:_},t(O,[2,14]),{17:66,24:S},t(O,[2,16]),t(O,[2,17]),t(E,[2,43]),t(O,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},t(O,[2,33]),{29:[1,70]},t(O,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},t(I,[2,23],{30:[1,73]}),t(O,[2,15]),t(O,[2,28]),t(O,[2,29]),{11:59,30:l,34:74,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:v,49:y,50:b,51:x},t(O,[2,35]),t(O,[2,19]),{25:75,27:64,29:_},t(I,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:C(function(P,N){if(N.recoverable)this.trace(P);else{var F=new Error(P);throw F.hash=N,F}},"parseError"),parse:C(function(P){var N=this,F=[0],B=[],V=[null],z=[],U=this.table,Q="",G=0,X=0,Y=2,le=1,q=z.slice.call(arguments,1),Z=Object.create(this.lexer),ee={yy:{}};for(var re in this.yy)Object.prototype.hasOwnProperty.call(this.yy,re)&&(ee.yy[re]=this.yy[re]);Z.setInput(P,ee.yy),ee.yy.lexer=Z,ee.yy.parser=this,typeof Z.yylloc>"u"&&(Z.yylloc={});var ve=Z.yylloc;z.push(ve);var ae=Z.options&&Z.options.ranges;typeof ee.yy.parseError=="function"?this.parseError=ee.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ce(ce){F.length=F.length-2*ce,V.length=V.length-ce,z.length=z.length-ce}C(Ce,"popStack");function Oe(){var ce;return ce=B.pop()||Z.lex()||le,typeof ce!="number"&&(ce instanceof Array&&(B=ce,ce=B.pop()),ce=N.symbols_[ce]||ce),ce}C(Oe,"lex");for(var $e,he,fe,Te,ge={},Qe,Se,De,qe;;){if(he=F[F.length-1],this.defaultActions[he]?fe=this.defaultActions[he]:(($e===null||typeof $e>"u")&&($e=Oe()),fe=U[he]&&U[he][$e]),typeof fe>"u"||!fe.length||!fe[0]){var K="";qe=[];for(Qe in U[he])this.terminals_[Qe]&&Qe>Y&&qe.push("'"+this.terminals_[Qe]+"'");Z.showPosition?K="Parse error on line "+(G+1)+`: +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var oe=this.next();return oe||this.lex()},"lex"),begin:C(function(oe){this.conditionStack.push(oe)},"begin"),popState:C(function(){var oe=this.conditionStack.length-1;return oe>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(oe){return oe=this.conditionStack.length-1-Math.abs(oe||0),oe>=0?this.conditionStack[oe]:"INITIAL"},"topState"),pushState:C(function(oe){this.begin(oe)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:C(function(oe,_e,Le,Ye){switch(Le){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 15;case 37:return 11;case 38:return 64;case 39:return 10;case 40:return 65;case 41:return 65;case 42:return 14;case 43:return 13;case 44:return 67;case 45:return 66;case 46:return 12;case 47:return 8;case 48:return 5;case 49:return 18;case 50:return 56;case 51:return 63;case 52:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?:[^\x00-\x7F]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return te}();j.lexer=ie;function pe(){this.yy={}}return C(pe,"Parser"),pe.prototype=j,j.Parser=pe,new pe}();_Re.parser=_Re;var lHn=_Re,sh=ky(),cHn=(SI=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,v,y,b;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:((e=Xn.quadrantChart)==null?void 0:e.chartWidth)||500,chartWidth:((r=Xn.quadrantChart)==null?void 0:r.chartHeight)||500,titlePadding:((n=Xn.quadrantChart)==null?void 0:n.titlePadding)||10,titleFontSize:((i=Xn.quadrantChart)==null?void 0:i.titleFontSize)||20,quadrantPadding:((a=Xn.quadrantChart)==null?void 0:a.quadrantPadding)||5,xAxisLabelPadding:((s=Xn.quadrantChart)==null?void 0:s.xAxisLabelPadding)||5,yAxisLabelPadding:((o=Xn.quadrantChart)==null?void 0:o.yAxisLabelPadding)||5,xAxisLabelFontSize:((l=Xn.quadrantChart)==null?void 0:l.xAxisLabelFontSize)||16,yAxisLabelFontSize:((u=Xn.quadrantChart)==null?void 0:u.yAxisLabelFontSize)||16,quadrantLabelFontSize:((h=Xn.quadrantChart)==null?void 0:h.quadrantLabelFontSize)||16,quadrantTextTopPadding:((d=Xn.quadrantChart)==null?void 0:d.quadrantTextTopPadding)||5,pointTextPadding:((f=Xn.quadrantChart)==null?void 0:f.pointTextPadding)||5,pointLabelFontSize:((p=Xn.quadrantChart)==null?void 0:p.pointLabelFontSize)||12,pointRadius:((g=Xn.quadrantChart)==null?void 0:g.pointRadius)||5,xAxisPosition:((m=Xn.quadrantChart)==null?void 0:m.xAxisPosition)||"top",yAxisPosition:((v=Xn.quadrantChart)==null?void 0:v.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:((y=Xn.quadrantChart)==null?void 0:y.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:((b=Xn.quadrantChart)==null?void 0:b.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:sh.quadrant1Fill,quadrant2Fill:sh.quadrant2Fill,quadrant3Fill:sh.quadrant3Fill,quadrant4Fill:sh.quadrant4Fill,quadrant1TextFill:sh.quadrant1TextFill,quadrant2TextFill:sh.quadrant2TextFill,quadrant3TextFill:sh.quadrant3TextFill,quadrant4TextFill:sh.quadrant4TextFill,quadrantPointFill:sh.quadrantPointFill,quadrantPointTextFill:sh.quadrantPointTextFill,quadrantXAxisTextFill:sh.quadrantXAxisTextFill,quadrantYAxisTextFill:sh.quadrantYAxisTextFill,quadrantTitleFill:sh.quadrantTitleFill,quadrantInternalBorderStrokeFill:sh.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:sh.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,me.info("clear called")}setData(e){this.data={...this.data,...e}}addPoints(e){this.data.points=[...e,...this.data.points]}addClass(e,r){this.classes.set(e,r)}setConfig(e){me.trace("setConfig called with: ",e),this.config={...this.config,...e}}setThemeConfig(e){me.trace("setThemeConfig called with: ",e),this.themeConfig={...this.themeConfig,...e}}calculateSpace(e,r,n,i){const a=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,s={top:e==="top"&&r?a:0,bottom:e==="bottom"&&r?a:0},o=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,l={left:this.config.yAxisPosition==="left"&&n?o:0,right:this.config.yAxisPosition==="right"&&n?o:0},u=this.config.titleFontSize+this.config.titlePadding*2,h={top:i?u:0},d=this.config.quadrantPadding+l.left,f=this.config.quadrantPadding+s.top+h.top,p=this.config.chartWidth-this.config.quadrantPadding*2-l.left-l.right,g=this.config.chartHeight-this.config.quadrantPadding*2-s.top-s.bottom-h.top,m=p/2,v=g/2;return{xAxisSpace:s,yAxisSpace:l,titleSpace:h,quadrantSpace:{quadrantLeft:d,quadrantTop:f,quadrantWidth:p,quadrantHalfWidth:m,quadrantHeight:g,quadrantHalfHeight:v}}}getAxisLabels(e,r,n,i){const{quadrantSpace:a,titleSpace:s}=i,{quadrantHalfHeight:o,quadrantHeight:l,quadrantLeft:u,quadrantHalfWidth:h,quadrantTop:d,quadrantWidth:f}=a,p=!!this.data.xAxisRightText,g=!!this.data.yAxisTopText,m=[];return this.data.xAxisLeftText&&r&&m.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+s.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&r&&m.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+h+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+s.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&n&&m.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+l-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&n&&m.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+o-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),m}getQuadrants(e){const{quadrantSpace:r}=e,{quadrantHalfHeight:n,quadrantLeft:i,quadrantHalfWidth:a,quadrantTop:s}=r,o=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+a,y:s,width:a,height:n,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i,y:s,width:a,height:n,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i,y:s+n,width:a,height:n,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+a,y:s+n,width:a,height:n,fill:this.themeConfig.quadrant4Fill}];for(const l of o)l.text.x=l.x+l.width/2,this.data.points.length===0?(l.text.y=l.y+l.height/2,l.text.horizontalPos="middle"):(l.text.y=l.y+this.config.quadrantTextTopPadding,l.text.horizontalPos="top");return o}getQuadrantPoints(e){const{quadrantSpace:r}=e,{quadrantHeight:n,quadrantLeft:i,quadrantTop:a,quadrantWidth:s}=r,o=P5().domain([0,1]).range([i,s+i]),l=P5().domain([0,1]).range([n+a,a]);return this.data.points.map(h=>{const d=this.classes.get(h.className);return d&&(h={...d,...h}),{x:o(h.x),y:l(h.y),fill:h.color??this.themeConfig.quadrantPointFill,radius:h.radius??this.config.pointRadius,text:{text:h.text,fill:this.themeConfig.quadrantPointTextFill,x:o(h.x),y:l(h.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:h.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:h.strokeWidth??"0px"}})}getBorders(e){const r=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:n}=e,{quadrantHalfHeight:i,quadrantHeight:a,quadrantLeft:s,quadrantHalfWidth:o,quadrantTop:l,quadrantWidth:u}=n;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:l,x2:s+u+r,y2:l},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s+u,y1:l+r,x2:s+u,y2:l+a-r},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:l+a,x2:s+u+r,y2:l+a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s,y1:l+r,x2:s,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+o,y1:l+r,x2:s+o,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+r,y1:l+i,x2:s+u-r,y2:l+i}]}getTitle(e){if(e)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const e=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),r=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),n=this.config.showTitle&&!!this.data.titleText,i=this.data.points.length>0?"bottom":this.config.xAxisPosition,a=this.calculateSpace(i,e,r,n);return{points:this.getQuadrantPoints(a),quadrants:this.getQuadrants(a),axisLabels:this.getAxisLabels(i,e,r,a),borderLines:this.getBorders(a),title:this.getTitle(n)}}},C(SI,"QuadrantBuilder"),SI),Sne=(TI=class extends Error{constructor(e,r,n){super(`value for ${e} ${r} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}},C(TI,"InvalidStyleError"),TI);function RRe(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}C(RRe,"validateHexCode");function vYt(t){return!/^\d+$/.test(t)}C(vYt,"validateNumber");function yYt(t){return!/^\d+px$/.test(t)}C(yYt,"validateSizeInPixels");function av(t){return ai(t.trim(),He())}C(av,"textSanitizer");var Cc=new cHn;function bYt(t){Cc.setData({quadrant1Text:av(t.text)})}C(bYt,"setQuadrant1Text");function xYt(t){Cc.setData({quadrant2Text:av(t.text)})}C(xYt,"setQuadrant2Text");function wYt(t){Cc.setData({quadrant3Text:av(t.text)})}C(wYt,"setQuadrant3Text");function AYt(t){Cc.setData({quadrant4Text:av(t.text)})}C(AYt,"setQuadrant4Text");function SYt(t){Cc.setData({xAxisLeftText:av(t.text)})}C(SYt,"setXAxisLeftText");function TYt(t){Cc.setData({xAxisRightText:av(t.text)})}C(TYt,"setXAxisRightText");function CYt(t){Cc.setData({yAxisTopText:av(t.text)})}C(CYt,"setYAxisTopText");function OYt(t){Cc.setData({yAxisBottomText:av(t.text)})}C(OYt,"setYAxisBottomText");function Tne(t){const e={};for(const r of t){const[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(vYt(i))throw new Sne(n,i,"number");e.radius=parseInt(i)}else if(n==="color"){if(RRe(i))throw new Sne(n,i,"hex code");e.color=i}else if(n==="stroke-color"){if(RRe(i))throw new Sne(n,i,"hex code");e.strokeColor=i}else if(n==="stroke-width"){if(yYt(i))throw new Sne(n,i,"number of pixels (eg. 10px)");e.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return e}C(Tne,"parseStyles");function kYt(t,e,r,n,i){const a=Tne(i);Cc.addPoints([{x:r,y:n,text:av(t.text),className:e,...a}])}C(kYt,"addPoint");function EYt(t,e){Cc.addClass(t,Tne(e))}C(EYt,"addClass");function _Yt(t){Cc.setConfig({chartWidth:t})}C(_Yt,"setWidth");function RYt(t){Cc.setConfig({chartHeight:t})}C(RYt,"setHeight");function DYt(){const t=He(),{themeVariables:e,quadrantChart:r}=t;return r&&Cc.setConfig(r),Cc.setThemeConfig({quadrant1Fill:e.quadrant1Fill,quadrant2Fill:e.quadrant2Fill,quadrant3Fill:e.quadrant3Fill,quadrant4Fill:e.quadrant4Fill,quadrant1TextFill:e.quadrant1TextFill,quadrant2TextFill:e.quadrant2TextFill,quadrant3TextFill:e.quadrant3TextFill,quadrant4TextFill:e.quadrant4TextFill,quadrantPointFill:e.quadrantPointFill,quadrantPointTextFill:e.quadrantPointTextFill,quadrantXAxisTextFill:e.quadrantXAxisTextFill,quadrantYAxisTextFill:e.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:e.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:e.quadrantInternalBorderStrokeFill,quadrantTitleFill:e.quadrantTitleFill}),Cc.setData({titleText:La()}),Cc.build()}C(DYt,"getQuadrantData");var uHn=C(function(){Cc.clear(),Aa()},"clear"),hHn={setWidth:_Yt,setHeight:RYt,setQuadrant1Text:bYt,setQuadrant2Text:xYt,setQuadrant3Text:wYt,setQuadrant4Text:AYt,setXAxisLeftText:SYt,setXAxisRightText:TYt,setYAxisTopText:CYt,setYAxisBottomText:OYt,parseStyles:Tne,addPoint:kYt,addClass:EYt,getQuadrantData:DYt,clear:uHn,setAccTitle:Da,getAccTitle:Ja,setDiagramTitle:rs,getDiagramTitle:La,getAccDescription:ts,setAccDescription:es},dHn=C((t,e,r,n)=>{var O,k,E;function i(_){return _==="top"?"hanging":"middle"}C(i,"getDominantBaseLine");function a(_){return _==="left"?"start":"middle"}C(a,"getTextAnchor");function s(_){return`translate(${_.x}, ${_.y}) rotate(${_.rotation||0})`}C(s,"getTransformation");const o=He();me.debug(`Rendering quadrant chart +`+t);const l=o.securityLevel;let u;l==="sandbox"&&(u=Ot("#i"+e));const d=Ot(l==="sandbox"?u.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`),f=d.append("g").attr("class","main"),p=((O=o.quadrantChart)==null?void 0:O.chartWidth)??500,g=((k=o.quadrantChart)==null?void 0:k.chartHeight)??500;zs(d,g,p,((E=o.quadrantChart)==null?void 0:E.useMaxWidth)??!0),d.attr("viewBox","0 0 "+p+" "+g),n.db.setHeight(g),n.db.setWidth(p);const m=n.db.getQuadrantData(),v=f.append("g").attr("class","quadrants"),y=f.append("g").attr("class","border"),b=f.append("g").attr("class","data-points"),x=f.append("g").attr("class","labels"),w=f.append("g").attr("class","title");m.title&&w.append("text").attr("x",0).attr("y",0).attr("fill",m.title.fill).attr("font-size",m.title.fontSize).attr("dominant-baseline",i(m.title.horizontalPos)).attr("text-anchor",a(m.title.verticalPos)).attr("transform",s(m.title)).text(m.title.text),m.borderLines&&y.selectAll("line").data(m.borderLines).enter().append("line").attr("x1",_=>_.x1).attr("y1",_=>_.y1).attr("x2",_=>_.x2).attr("y2",_=>_.y2).style("stroke",_=>_.strokeFill).style("stroke-width",_=>_.strokeWidth);const A=v.selectAll("g.quadrant").data(m.quadrants).enter().append("g").attr("class","quadrant");A.append("rect").attr("x",_=>_.x).attr("y",_=>_.y).attr("width",_=>_.width).attr("height",_=>_.height).attr("fill",_=>_.fill),A.append("text").attr("x",0).attr("y",0).attr("fill",_=>_.text.fill).attr("font-size",_=>_.text.fontSize).attr("dominant-baseline",_=>i(_.text.horizontalPos)).attr("text-anchor",_=>a(_.text.verticalPos)).attr("transform",_=>s(_.text)).text(_=>_.text.text),x.selectAll("g.label").data(m.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(_=>_.text).attr("fill",_=>_.fill).attr("font-size",_=>_.fontSize).attr("dominant-baseline",_=>i(_.horizontalPos)).attr("text-anchor",_=>a(_.verticalPos)).attr("transform",_=>s(_));const T=b.selectAll("g.data-point").data(m.points).enter().append("g").attr("class","data-point");T.append("circle").attr("cx",_=>_.x).attr("cy",_=>_.y).attr("r",_=>_.radius).attr("fill",_=>_.fill).attr("stroke",_=>_.strokeColor).attr("stroke-width",_=>_.strokeWidth),T.append("text").attr("x",0).attr("y",0).text(_=>_.text.text).attr("fill",_=>_.text.fill).attr("font-size",_=>_.text.fontSize).attr("dominant-baseline",_=>i(_.text.horizontalPos)).attr("text-anchor",_=>a(_.text.verticalPos)).attr("transform",_=>s(_.text))},"draw"),fHn={draw:dHn},pHn={parser:lHn,db:hHn,renderer:fHn,styles:C(()=>"","styles")};const gHn=Object.freeze(Object.defineProperty({__proto__:null,diagram:pHn},Symbol.toStringTag,{value:"Module"}));var DRe=function(){var t=C(function(M,P,N,F){for(N=N||{},F=M.length;F--;N[M[F]]=P);return N},"o"),e=[1,10,12,14,16,18,19,21,23],r=[2,6],n=[1,3],i=[1,5],a=[1,6],s=[1,7],o=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],u=[1,26],h=[1,28],d=[1,29],f=[1,30],p=[1,31],g=[1,32],m=[1,33],v=[1,34],y=[1,35],b=[1,36],x=[1,37],w=[1,43],A=[1,42],S=[1,47],T=[1,50],O=[1,10,12,14,16,18,19,21,23,36,37,38],k=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],E=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],_=[1,65],I=[26,28],L={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:C(function(P,N,F,B,V,z,U){var Q=z.length-1;switch(V){case 5:B.setOrientation(z[Q]);break;case 9:B.setDiagramTitle(z[Q].text.trim());break;case 12:B.setLineData({text:"",type:"text"},z[Q]);break;case 13:B.setLineData(z[Q-1],z[Q]);break;case 14:B.setBarData({text:"",type:"text"},z[Q]);break;case 15:B.setBarData(z[Q-1],z[Q]);break;case 16:this.$=z[Q].trim(),B.setAccTitle(this.$);break;case 17:case 18:this.$=z[Q].trim(),B.setAccDescription(this.$);break;case 19:this.$=z[Q-1];break;case 20:case 30:this.$=[z[Q-2],...z[Q]];break;case 21:case 31:this.$=[z[Q]];break;case 22:this.$={value:Number(z[Q-1]),label:z[Q]};break;case 23:this.$={value:Number(z[Q]),label:""};break;case 24:B.setXAxisTitle(z[Q]);break;case 25:B.setXAxisTitle(z[Q-1]);break;case 26:B.setXAxisTitle({type:"text",text:""});break;case 27:B.setXAxisBand(z[Q]);break;case 28:B.setXAxisRangeData(Number(z[Q-2]),Number(z[Q]));break;case 29:this.$=z[Q-1];break;case 32:B.setYAxisTitle(z[Q]);break;case 33:B.setYAxisTitle(z[Q-1]);break;case 34:B.setYAxisTitle({type:"text",text:""});break;case 35:B.setYAxisRangeData(Number(z[Q-2]),Number(z[Q]));break;case 39:this.$={text:z[Q],type:"text"};break;case 40:this.$={text:z[Q],type:"text"};break;case 41:this.$={text:z[Q],type:"markdown"};break;case 42:this.$=z[Q];break;case 43:this.$=z[Q-1]+""+z[Q];break}},"anonymous"),table:[t(e,r,{3:1,4:2,7:4,5:n,36:i,37:a,38:s}),{1:[3]},t(e,r,{4:2,7:4,3:8,5:n,36:i,37:a,38:s}),t(e,r,{4:2,7:4,6:9,3:10,5:n,8:[1,11],36:i,37:a,38:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(o,[2,36]),t(o,[2,37]),t(o,[2,38]),{1:[2,1]},t(e,r,{4:2,7:4,3:21,5:n,36:i,37:a,38:s}),{1:[2,3]},t(o,[2,5]),t(e,[2,7],{4:22,36:i,37:a,38:s}),{11:23,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:v,49:y,50:b,51:x},{11:39,13:38,24:w,29:A,30:l,31:40,32:41,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:v,49:y,50:b,51:x},{11:45,15:44,29:S,30:l,35:46,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:v,49:y,50:b,51:x},{11:49,17:48,24:T,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:v,49:y,50:b,51:x},{11:52,17:51,24:T,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:v,49:y,50:b,51:x},{20:[1,53]},{22:[1,54]},t(O,[2,18]),{1:[2,2]},t(O,[2,8]),t(O,[2,9]),t(k,[2,39],{41:55,42:h,43:d,44:f,45:p,46:g,47:m,48:v,49:y,50:b,51:x}),t(k,[2,40]),t(k,[2,41]),t(E,[2,42]),t(E,[2,44]),t(E,[2,45]),t(E,[2,46]),t(E,[2,47]),t(E,[2,48]),t(E,[2,49]),t(E,[2,50]),t(E,[2,51]),t(E,[2,52]),t(E,[2,53]),t(O,[2,10]),t(O,[2,24],{32:41,31:56,24:w,29:A}),t(O,[2,26]),t(O,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:v,49:y,50:b,51:x},t(O,[2,11]),t(O,[2,32],{35:60,29:S}),t(O,[2,34]),{33:[1,61]},t(O,[2,12]),{17:62,24:T},{25:63,27:64,29:_},t(O,[2,14]),{17:66,24:T},t(O,[2,16]),t(O,[2,17]),t(E,[2,43]),t(O,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},t(O,[2,33]),{29:[1,70]},t(O,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},t(I,[2,23],{30:[1,73]}),t(O,[2,15]),t(O,[2,28]),t(O,[2,29]),{11:59,30:l,34:74,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:v,49:y,50:b,51:x},t(O,[2,35]),t(O,[2,19]),{25:75,27:64,29:_},t(I,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:C(function(P,N){if(N.recoverable)this.trace(P);else{var F=new Error(P);throw F.hash=N,F}},"parseError"),parse:C(function(P){var N=this,F=[0],B=[],V=[null],z=[],U=this.table,Q="",G=0,X=0,Y=2,le=1,q=z.slice.call(arguments,1),Z=Object.create(this.lexer),ee={yy:{}};for(var re in this.yy)Object.prototype.hasOwnProperty.call(this.yy,re)&&(ee.yy[re]=this.yy[re]);Z.setInput(P,ee.yy),ee.yy.lexer=Z,ee.yy.parser=this,typeof Z.yylloc>"u"&&(Z.yylloc={});var ve=Z.yylloc;z.push(ve);var ae=Z.options&&Z.options.ranges;typeof ee.yy.parseError=="function"?this.parseError=ee.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ce(ce){F.length=F.length-2*ce,V.length=V.length-ce,z.length=z.length-ce}C(Ce,"popStack");function Oe(){var ce;return ce=B.pop()||Z.lex()||le,typeof ce!="number"&&(ce instanceof Array&&(B=ce,ce=B.pop()),ce=N.symbols_[ce]||ce),ce}C(Oe,"lex");for(var $e,he,fe,Se,ge={},Qe,Te,De,qe;;){if(he=F[F.length-1],this.defaultActions[he]?fe=this.defaultActions[he]:(($e===null||typeof $e>"u")&&($e=Oe()),fe=U[he]&&U[he][$e]),typeof fe>"u"||!fe.length||!fe[0]){var K="";qe=[];for(Qe in U[he])this.terminals_[Qe]&&Qe>Y&&qe.push("'"+this.terminals_[Qe]+"'");Z.showPosition?K="Parse error on line "+(G+1)+`: `+Z.showPosition()+` -Expecting `+qe.join(", ")+", got '"+(this.terminals_[$e]||$e)+"'":K="Parse error on line "+(G+1)+": Unexpected "+($e==le?"end of input":"'"+(this.terminals_[$e]||$e)+"'"),this.parseError(K,{text:Z.match,token:this.terminals_[$e]||$e,line:Z.yylineno,loc:ve,expected:qe})}if(fe[0]instanceof Array&&fe.length>1)throw new Error("Parse Error: multiple actions possible at state: "+he+", token: "+$e);switch(fe[0]){case 1:F.push($e),V.push(Z.yytext),z.push(Z.yylloc),F.push(fe[1]),$e=null,X=Z.yyleng,Q=Z.yytext,G=Z.yylineno,ve=Z.yylloc;break;case 2:if(Se=this.productions_[fe[1]][1],ge.$=V[V.length-Se],ge._$={first_line:z[z.length-(Se||1)].first_line,last_line:z[z.length-1].last_line,first_column:z[z.length-(Se||1)].first_column,last_column:z[z.length-1].last_column},ae&&(ge._$.range=[z[z.length-(Se||1)].range[0],z[z.length-1].range[1]]),Te=this.performAction.apply(ge,[Q,X,G,ee.yy,fe[1],V,z].concat(q)),typeof Te<"u")return Te;Se&&(F=F.slice(0,-1*Se*2),V=V.slice(0,-1*Se),z=z.slice(0,-1*Se)),F.push(this.productions_[fe[1]][0]),V.push(ge.$),z.push(ge._$),De=U[F[F.length-2]][F[F.length-1]],F.push(De);break;case 3:return!0}}return!0},"parse")},R=function(){var M={EOF:1,parseError:C(function(N,F){if(this.yy.parser)this.yy.parser.parseError(N,F);else throw new Error(N)},"parseError"),setInput:C(function(P,N){return this.yy=N||this.yy||{},this._input=P,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var P=this._input[0];this.yytext+=P,this.yyleng++,this.offset++,this.match+=P,this.matched+=P;var N=P.match(/(?:\r\n?|\n).*/g);return N?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),P},"input"),unput:C(function(P){var N=P.length,F=P.split(/(?:\r\n?|\n)/g);this._input=P+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-N),this.offset-=N;var B=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),F.length-1&&(this.yylineno-=F.length-1);var V=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:F?(F.length===B.length?this.yylloc.first_column:0)+B[B.length-F.length].length-F[0].length:this.yylloc.first_column-N},this.options.ranges&&(this.yylloc.range=[V[0],V[0]+this.yyleng-N]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +Expecting `+qe.join(", ")+", got '"+(this.terminals_[$e]||$e)+"'":K="Parse error on line "+(G+1)+": Unexpected "+($e==le?"end of input":"'"+(this.terminals_[$e]||$e)+"'"),this.parseError(K,{text:Z.match,token:this.terminals_[$e]||$e,line:Z.yylineno,loc:ve,expected:qe})}if(fe[0]instanceof Array&&fe.length>1)throw new Error("Parse Error: multiple actions possible at state: "+he+", token: "+$e);switch(fe[0]){case 1:F.push($e),V.push(Z.yytext),z.push(Z.yylloc),F.push(fe[1]),$e=null,X=Z.yyleng,Q=Z.yytext,G=Z.yylineno,ve=Z.yylloc;break;case 2:if(Te=this.productions_[fe[1]][1],ge.$=V[V.length-Te],ge._$={first_line:z[z.length-(Te||1)].first_line,last_line:z[z.length-1].last_line,first_column:z[z.length-(Te||1)].first_column,last_column:z[z.length-1].last_column},ae&&(ge._$.range=[z[z.length-(Te||1)].range[0],z[z.length-1].range[1]]),Se=this.performAction.apply(ge,[Q,X,G,ee.yy,fe[1],V,z].concat(q)),typeof Se<"u")return Se;Te&&(F=F.slice(0,-1*Te*2),V=V.slice(0,-1*Te),z=z.slice(0,-1*Te)),F.push(this.productions_[fe[1]][0]),V.push(ge.$),z.push(ge._$),De=U[F[F.length-2]][F[F.length-1]],F.push(De);break;case 3:return!0}}return!0},"parse")},R=function(){var M={EOF:1,parseError:C(function(N,F){if(this.yy.parser)this.yy.parser.parseError(N,F);else throw new Error(N)},"parseError"),setInput:C(function(P,N){return this.yy=N||this.yy||{},this._input=P,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var P=this._input[0];this.yytext+=P,this.yyleng++,this.offset++,this.match+=P,this.matched+=P;var N=P.match(/(?:\r\n?|\n).*/g);return N?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),P},"input"),unput:C(function(P){var N=P.length,F=P.split(/(?:\r\n?|\n)/g);this._input=P+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-N),this.offset-=N;var B=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),F.length-1&&(this.yylineno-=F.length-1);var V=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:F?(F.length===B.length?this.yylloc.first_column:0)+B[B.length-F.length].length-F[0].length:this.yylloc.first_column-N},this.options.ranges&&(this.yylloc.range=[V[0],V[0]+this.yyleng-N]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:C(function(P){this.unput(this.match.slice(P))},"less"),pastInput:C(function(){var P=this.matched.substr(0,this.matched.length-this.match.length);return(P.length>20?"...":"")+P.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:C(function(){var P=this.match;return P.length<20&&(P+=this._input.substr(0,20-P.length)),(P.substr(0,20)+(P.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:C(function(){var P=this.pastInput(),N=new Array(P.length+1).join("-");return P+this.upcomingInput()+` `+N+"^"},"showPosition"),test_match:C(function(P,N){var F,B,V;if(this.options.backtrack_lexer&&(V={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(V.yylloc.range=this.yylloc.range.slice(0))),B=P[0].match(/(?:\r\n?|\n).*/g),B&&(this.yylineno+=B.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:B?B[B.length-1].length-B[B.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+P[0].length},this.yytext+=P[0],this.match+=P[0],this.matches=P,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(P[0].length),this.matched+=P[0],F=this.performAction.call(this,this.yy,this,N,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),F)return F;if(this._backtrack){for(var z in V)this[z]=V[z];return!1}return!1},"test_match"),next:C(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var P,N,F,B;this._more||(this.yytext="",this.match="");for(var V=this._currentRules(),z=0;zN[0].length)){if(N=F,B=z,this.options.backtrack_lexer){if(P=this.test_match(F,V[z]),P!==!1)return P;if(this._backtrack){N=!1;continue}else return!1}else if(!this.options.flex)break}return N?(P=this.test_match(N,V[B]),P!==!1?P:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var N=this.next();return N||this.lex()},"lex"),begin:C(function(N){this.conditionStack.push(N)},"begin"),popState:C(function(){var N=this.conditionStack.length-1;return N>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(N){return N=this.conditionStack.length-1-Math.abs(N||0),N>=0?this.conditionStack[N]:"INITIAL"},"topState"),pushState:C(function(N){this.begin(N)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:C(function(N,F,B,V){switch(B){case 0:break;case 1:break;case 2:return this.popState(),36;case 3:return this.popState(),36;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 33;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 29;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return M}();L.lexer=R;function D(){this.yy={}}return C(D,"Parser"),D.prototype=L,L.Parser=D,new D}();DRe.parser=DRe;var mHn=DRe;function LRe(t){return t.type==="bar"}C(LRe,"isBarPlot");function Cne(t){return t.type==="band"}C(Cne,"isBandAxisData");function YR(t){return t.type==="linear"}C(YR,"isLinearAxisData");var LYt=(CI=class{constructor(e){this.parentGroup=e}getMaxDimension(e,r){if(!this.parentGroup)return{width:e.reduce((a,s)=>Math.max(s.length,a),0)*r,height:r};const n={width:0,height:0},i=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",r);for(const a of e){const s=$1t(i,1,a),o=s?s.width:a.length*r,l=s?s.height:r;n.width=Math.max(n.width,o),n.height=Math.max(n.height,l)}return i.remove(),n}},C(CI,"TextDimensionCalculatorWithFont"),CI),MYt=.7,IYt=.2,PYt=(OI=class{constructor(e,r,n,i){this.axisConfig=e,this.title=r,this.textDimensionCalculator=n,this.axisThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}setRange(e){this.range=e,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=e[1]-e[0]:this.boundingRect.width=e[1]-e[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){const e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(e=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){MYt*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(MYt*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let r=e.height;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=IYt*e.width;this.outerPadding=Math.min(n.width/2,i);let a=n.height;this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0&&(a=Math.max(a,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*n.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*n.height))),a+=this.axisConfig.labelPadding*2,this.labelTextHeight=n.height,a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-r}calculateSpaceIfDrawnVertical(e){let r=e.width;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=IYt*e.height;this.outerPadding=Math.min(n.height/2,i);const a=n.width+this.axisConfig.labelPadding*2;a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width-r,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){const r=this.normalizedLabelRotationInRad;return r===0?0:Math.sin(r)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${r},${this.boundingRect.y} L ${r},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(r),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const r=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${r},${this.getScaleValue(n)} L ${r-this.axisConfig.tickLength},${this.getScaleValue(n)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForBottomAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r} L ${this.getScaleValue(n)},${r+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForTopAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(n)},${r+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},C(OI,"BaseAxis"),OI),vHn=(kI=class extends PYt{constructor(e,r,n,i,a){super(e,i,a,r),this.categories=n,this.scale=Zye().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=Zye().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),me.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},C(kI,"BandAxis"),kI),yHn=(EI=class extends PYt{constructor(e,r,n,i,a){super(e,i,a,r),this.domain=n,this.scale=P5().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];this.axisPosition==="left"&&e.reverse(),this.scale=P5().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}},C(EI,"LinearAxis"),EI);function MRe(t,e,r,n){const i=new LYt(n);return Cne(t)?new vHn(e,r,t.categories,t.title,i):new yHn(e,r,[t.min,t.max],t.title,i)}C(MRe,"getAxis");var bHn=(_I=class{constructor(e,r,n,i){this.textDimensionCalculator=e,this.chartConfig=r,this.chartData=n,this.chartThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){const r=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(r.width,e.width),i=r.height+2*this.chartConfig.titlePadding;return r.width<=n&&r.height<=i&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=i,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const e=[];return this.showChartTitle&&e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),e}},C(_I,"ChartTitle"),_I);function NYt(t,e,r,n){const i=new LYt(n);return new bHn(i,t,e,r)}C(NYt,"getChartTitleComponent");var xHn=(RI=class{constructor(e,r,n,i,a){this.plotData=e,this.xAxis=r,this.yAxis=n,this.orientation=i,this.plotIndex=a}getDrawableElement(){const e=this.plotData.data.map(i=>[this.xAxis.getScaleValue(i[0]),this.yAxis.getScaleValue(i[1])]);let r;if(this.orientation==="horizontal"?r=r7().y(i=>i[0]).x(i=>i[1])(e):r=r7().x(i=>i[0]).y(i=>i[1])(e),!r)return[];const n=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:r,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){const s=[];for(const[o,[l,u]]of e.entries()){const h=this.plotData.pointLabels[o];h&&(this.orientation==="horizontal"?s.push({x:u+10,y:l,text:h,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0}):s.push({x:l,y:u-10,text:h,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0}))}s.length>0&&n.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:s})}return n}},C(RI,"LinePlot"),RI),wHn=(DI=class{constructor(e,r,n,i,a,s){this.barData=e,this.boundingRect=r,this.xAxis=n,this.yAxis=i,this.orientation=a,this.plotIndex=s}getDrawableElement(){const e=this.barData.data.map(a=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]),n=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),i=n/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:this.boundingRect.x,y:a[0]-i,height:n,width:a[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:a[0]-i,y:a[1],width:n,height:this.boundingRect.y+this.boundingRect.height-a[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},C(DI,"BarPlot"),DI),AHn=(LI=class{constructor(e,r,n){this.chartConfig=e,this.chartData=r,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(e,r){this.xAxis=e,this.yAxis=r}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const e=[];for(const[r,n]of this.chartData.plots.entries())switch(n.type){case"line":{const i=new xHn(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break;case"bar":{const i=new wHn(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break}return e}},C(LI,"BasePlot"),LI);function BYt(t,e,r){return new AHn(t,e,r)}C(BYt,"getPlotComponent");var THn=(MI=class{constructor(e,r,n,i){this.chartConfig=e,this.chartData=r,this.componentStore={title:NYt(e,r,n,i),plot:BYt(e,r,n),xAxis:MRe(r.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},i),yAxis:MRe(r.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},i)}}calculateVerticalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),s=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:a,height:s});e-=o.width,r-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),i=o.height,r-=o.height,this.componentStore.xAxis.setAxisPosition("bottom"),o=this.componentStore.xAxis.calculateSpace({width:e,height:r}),r-=o.height,this.componentStore.yAxis.setAxisPosition("left"),o=this.componentStore.yAxis.calculateSpace({width:e,height:r}),n=o.width,e-=o.width,e>0&&(a+=e,e=0),r>0&&(s+=r,r=0),this.componentStore.plot.calculateSpace({width:a,height:s}),this.componentStore.plot.setBoundingBoxXY({x:n,y:i}),this.componentStore.xAxis.setRange([n,n+a]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:i+s}),this.componentStore.yAxis.setRange([i,i+s]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(l=>LRe(l))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=0,s=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),l=this.componentStore.plot.calculateSpace({width:s,height:o});e-=l.width,r-=l.height,l=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),n=l.height,r-=l.height,this.componentStore.xAxis.setAxisPosition("left"),l=this.componentStore.xAxis.calculateSpace({width:e,height:r}),e-=l.width,i=l.width,this.componentStore.yAxis.setAxisPosition("top"),l=this.componentStore.yAxis.calculateSpace({width:e,height:r}),r-=l.height,a=n+l.height,e>0&&(s+=e,e=0),r>0&&(o+=r,r=0),this.componentStore.plot.calculateSpace({width:s,height:o}),this.componentStore.plot.setBoundingBoxXY({x:i,y:a}),this.componentStore.yAxis.setRange([i,i+s]),this.componentStore.yAxis.setBoundingBoxXY({x:i,y:n}),this.componentStore.xAxis.setRange([a,a+o]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(u=>LRe(u))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const r of Object.values(this.componentStore))e.push(...r.getDrawableElements());return e}},C(MI,"Orchestrator"),MI),SHn=(II=class{static build(e,r,n,i){return new THn(e,r,n,i).getDrawableElement()}},C(II,"XYChartBuilder"),II),xz=0,$Yt,wz=BRe(),Az=NRe(),Ni=$Re(),IRe=Az.plotColorPalette.split(",").map(t=>t.trim()),One=!1,PRe=!1;function NRe(){const t=ky(),e=Dr();return ns(t.xyChart,e.themeVariables.xyChart)}C(NRe,"getChartDefaultThemeConfig");function BRe(){const t=Dr();return ns(Xn.xyChart,t.xyChart)}C(BRe,"getChartDefaultConfig");function $Re(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}C($Re,"getChartDefaultData");function Tz(t){const e=Dr();return ai(t.trim(),e)}C(Tz,"textSanitizer");function FYt(t){$Yt=t}C(FYt,"setTmpSVGG");function zYt(t){t==="horizontal"?wz.chartOrientation="horizontal":wz.chartOrientation="vertical"}C(zYt,"setOrientation");function UYt(t){Ni.xAxis.title=Tz(t.text)}C(UYt,"setXAxisTitle");function FRe(t,e){Ni.xAxis={type:"linear",title:Ni.xAxis.title,min:t,max:e},One=!0}C(FRe,"setXAxisRangeData");function VYt(t){Ni.xAxis={type:"band",title:Ni.xAxis.title,categories:t.map(e=>Tz(e.text))},One=!0}C(VYt,"setXAxisBand");function QYt(t){Ni.yAxis.title=Tz(t.text)}C(QYt,"setYAxisTitle");function GYt(t,e){Ni.yAxis={type:"linear",title:Ni.yAxis.title,min:t,max:e},PRe=!0}C(GYt,"setYAxisRangeData");function HYt(t){const e=Math.min(...t),r=Math.max(...t),n=YR(Ni.yAxis)?Ni.yAxis.min:1/0,i=YR(Ni.yAxis)?Ni.yAxis.max:-1/0;Ni.yAxis={type:"linear",title:Ni.yAxis.title,min:Math.min(n,e),max:Math.max(i,r)}}C(HYt,"setYAxisRangeFromPlotData");function zRe(t){let e=[];if(t.length===0)return e;if(!One){const r=YR(Ni.xAxis)?Ni.xAxis.min:1/0,n=YR(Ni.xAxis)?Ni.xAxis.max:-1/0;FRe(Math.min(r,1),Math.max(n,t.length))}if(Cne(Ni.xAxis)&&t.length>Ni.xAxis.categories.length&&(t=t.slice(0,Ni.xAxis.categories.length)),PRe||HYt(t),Cne(Ni.xAxis)&&(e=Ni.xAxis.categories.map((r,n)=>[r,t[n]])),YR(Ni.xAxis)){const r=Ni.xAxis.min,n=Ni.xAxis.max;if(t.length===1)e=[[`${r}`,t[0]]];else{const i=(n-r)/(t.length-1);e=t.map((a,s)=>[`${r+s*i}`,a])}}return e}C(zRe,"transformDataWithoutCategory");function URe(t){return IRe[t===0?0:t%IRe.length]}C(URe,"getPlotColorFromPalette");function WYt(t,e){const r=e.map(s=>s.value),n=e.map(s=>s.label?Tz(s.label):""),i=zRe(r),a=n.some(s=>s!=="");Ni.plots.push({type:"line",strokeFill:URe(xz),strokeWidth:2,data:i,...a?{pointLabels:n}:{}}),xz++}C(WYt,"setLineData");function YYt(t,e){const r=e.map(i=>i.value),n=zRe(r);Ni.plots.push({type:"bar",fill:URe(xz),data:n}),xz++}C(YYt,"setBarData");function qYt(){if(Ni.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return Ni.title=La(),SHn.build(wz,Ni,Az,$Yt)}C(qYt,"getDrawableElem");function jYt(){return Az}C(jYt,"getChartThemeConfig");function XYt(){return wz}C(XYt,"getChartConfig");function KYt(){return Ni}C(KYt,"getXYChartData");var CHn=C(function(){Aa(),xz=0,wz=BRe(),Ni=$Re(),Az=NRe(),IRe=Az.plotColorPalette.split(",").map(t=>t.trim()),One=!1,PRe=!1},"clear"),OHn={getDrawableElem:qYt,clear:CHn,setAccTitle:Da,getAccTitle:Ja,setDiagramTitle:rs,getDiagramTitle:La,getAccDescription:ts,setAccDescription:es,setOrientation:zYt,setXAxisTitle:UYt,setXAxisRangeData:FRe,setXAxisBand:VYt,setYAxisTitle:QYt,setYAxisRangeData:GYt,setLineData:WYt,setBarData:YYt,setTmpSVGG:FYt,getChartThemeConfig:jYt,getChartConfig:XYt,getXYChartData:KYt},kHn=C((t,e,r,n)=>{const i=n.db,a=i.getChartThemeConfig(),s=i.getChartConfig(),o=i.getXYChartData().plots[0].data.map(y=>y[1]);function l(y){return y==="top"?"text-before-edge":"middle"}C(l,"getDominantBaseLine");function u(y){return y==="left"?"start":y==="right"?"end":"middle"}C(u,"getTextAnchor");function h(y){return`translate(${y.x}, ${y.y}) rotate(${y.rotation||0})`}C(h,"getTextTransformation"),me.debug(`Rendering xychart chart -`+t);const d=qc(e),f=d.append("g").attr("class","main"),p=f.append("rect").attr("width",s.width).attr("height",s.height).attr("class","background");zs(d,s.height,s.width,!0),d.attr("viewBox",`0 0 ${s.width} ${s.height}`),p.attr("fill",a.backgroundColor),i.setTmpSVGG(d.append("g").attr("class","mermaid-tmp-group"));const g=i.getDrawableElem(),m={};function v(y){let b=f,x="";for(const[w]of y.entries()){let A=f;w>0&&m[x]&&(A=m[x]),x+=y[w],b=m[x],b||(b=m[x]=A.append("g").attr("class",y[w]))}return b}C(v,"getGroup");for(const y of g){if(y.data.length===0)continue;const b=v(y.groupTexts);switch(y.type){case"rect":if(b.selectAll("rect").data(y.data).enter().append("rect").attr("x",x=>x.x).attr("y",x=>x.y).attr("width",x=>x.width).attr("height",x=>x.height).attr("fill",x=>x.fill).attr("stroke",x=>x.strokeFill).attr("stroke-width",x=>x.strokeWidth),s.showDataLabel){const x=s.showDataLabelOutsideBar;if(s.chartOrientation==="horizontal"){let w=function(_,I){const{data:L,label:R}=_;return I*R.length*A<=L.width-T};C(w,"fitsHorizontally");const A=.7,T=10,S=y.data.map((_,I)=>({data:_,label:o[I].toString()})).filter(_=>_.data.width>0&&_.data.height>0),O=S.map(_=>{const{data:I}=_;let L=I.height*.7;for(;!w(_,L)&&L>0;)L-=1;return L}),k=Math.floor(Math.min(...O)),E=C(_=>x?_.data.x+_.data.width+T:_.data.x+_.data.width-T,"determineLabelXPosition");b.selectAll("text").data(S).enter().append("text").attr("x",E).attr("y",_=>_.data.y+_.data.height/2).attr("text-anchor",x?"start":"end").attr("dominant-baseline","middle").attr("fill",a.dataLabelColor).attr("font-size",`${k}px`).text(_=>_.label)}else{let w=function(E,_,I){const{data:L,label:R}=E,M=_*R.length*.7,P=L.x+L.width/2,N=P-M/2,F=P+M/2,B=N>=L.x&&F<=L.x+L.width,V=L.y+I+_<=L.y+L.height;return B&&V};C(w,"fitsInBar");const A=10,T=y.data.map((E,_)=>({data:E,label:o[_].toString()})).filter(E=>E.data.width>0&&E.data.height>0),S=T.map(E=>{const{data:_,label:I}=E;let L=_.width/(I.length*.7);for(;!w(E,L,A)&&L>0;)L-=1;return L}),O=Math.floor(Math.min(...S)),k=C(E=>x?E.data.y-A:E.data.y+A,"determineLabelYPosition");b.selectAll("text").data(T).enter().append("text").attr("x",E=>E.data.x+E.data.width/2).attr("y",k).attr("text-anchor","middle").attr("dominant-baseline",x?"auto":"hanging").attr("fill",a.dataLabelColor).attr("font-size",`${O}px`).text(E=>E.label)}}break;case"text":b.selectAll("text").data(y.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",x=>x.fill).attr("font-size",x=>x.fontSize).attr("dominant-baseline",x=>l(x.verticalPos)).attr("text-anchor",x=>u(x.horizontalPos)).attr("transform",x=>h(x)).text(x=>x.text);break;case"path":b.selectAll("path").data(y.data).enter().append("path").attr("d",x=>x.path).attr("fill",x=>x.fill?x.fill:"none").attr("stroke",x=>x.strokeFill).attr("stroke-width",x=>x.strokeWidth);break}}},"draw"),EHn={draw:kHn},_Hn={parser:mHn,db:OHn,renderer:EHn};const RHn=Object.freeze(Object.defineProperty({__proto__:null,diagram:_Hn},Symbol.toStringTag,{value:"Module"}));var VRe=function(){var t=C(function(ne,j,ie,pe){for(ie=ie||{},pe=ne.length;pe--;ie[ne[pe]]=j);return ie},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],s=[1,22],o=[2,7],l=[1,26],u=[1,27],h=[1,28],d=[1,29],f=[1,33],p=[1,34],g=[1,35],m=[1,36],v=[1,37],y=[1,38],b=[1,24],x=[1,31],w=[1,32],A=[1,30],T=[1,39],S=[1,40],O=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],k=[1,61],E=[89,90],_=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],I=[27,29],L=[1,70],R=[1,71],D=[1,72],M=[1,73],P=[1,74],N=[1,75],F=[1,76],B=[1,83],V=[1,80],z=[1,84],U=[1,85],Q=[1,86],G=[1,87],X=[1,88],Y=[1,89],le=[1,90],q=[1,91],Z=[1,92],ee=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],re=[63,64],ve=[1,101],ae=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],Ce=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Oe=[1,110],$e=[1,106],he=[1,107],fe=[1,108],Te=[1,109],ge=[1,111],Qe=[1,116],Se=[1,117],De=[1,114],qe=[1,115],K={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:C(function(j,ie,pe,te,ye,oe,_e){var Le=oe.length-1;switch(ye){case 4:this.$=oe[Le].trim(),te.setAccTitle(this.$);break;case 5:case 6:this.$=oe[Le].trim(),te.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:te.setDirection("TB");break;case 18:te.setDirection("BT");break;case 19:te.setDirection("RL");break;case 20:te.setDirection("LR");break;case 21:te.addRequirement(oe[Le-3],oe[Le-4]);break;case 22:te.addRequirement(oe[Le-5],oe[Le-6]),te.setClass([oe[Le-5]],oe[Le-3]);break;case 23:te.setNewReqId(oe[Le-2]);break;case 24:te.setNewReqText(oe[Le-2]);break;case 25:te.setNewReqRisk(oe[Le-2]);break;case 26:te.setNewReqVerifyMethod(oe[Le-2]);break;case 29:this.$=te.RequirementType.REQUIREMENT;break;case 30:this.$=te.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=te.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=te.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=te.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=te.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=te.RiskLevel.LOW_RISK;break;case 36:this.$=te.RiskLevel.MED_RISK;break;case 37:this.$=te.RiskLevel.HIGH_RISK;break;case 38:this.$=te.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=te.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=te.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=te.VerifyType.VERIFY_TEST;break;case 42:te.addElement(oe[Le-3]);break;case 43:te.addElement(oe[Le-5]),te.setClass([oe[Le-5]],oe[Le-3]);break;case 44:te.setNewElementType(oe[Le-2]);break;case 45:te.setNewElementDocRef(oe[Le-2]);break;case 48:te.addRelationship(oe[Le-2],oe[Le],oe[Le-4]);break;case 49:te.addRelationship(oe[Le-2],oe[Le-4],oe[Le]);break;case 50:this.$=te.Relationships.CONTAINS;break;case 51:this.$=te.Relationships.COPIES;break;case 52:this.$=te.Relationships.DERIVES;break;case 53:this.$=te.Relationships.SATISFIES;break;case 54:this.$=te.Relationships.VERIFIES;break;case 55:this.$=te.Relationships.REFINES;break;case 56:this.$=te.Relationships.TRACES;break;case 57:this.$=oe[Le-2],te.defineClass(oe[Le-1],oe[Le]);break;case 58:te.setClass(oe[Le-1],oe[Le]);break;case 59:te.setClass([oe[Le-2]],oe[Le]);break;case 60:case 62:this.$=[oe[Le]];break;case 61:case 63:this.$=oe[Le-2].concat([oe[Le]]);break;case 64:this.$=oe[Le-2],te.setCssStyle(oe[Le-1],oe[Le]);break;case 65:this.$=[oe[Le]];break;case 66:oe[Le-2].push(oe[Le]),this.$=oe[Le-2];break;case 68:this.$=oe[Le-1]+oe[Le];break}},"anonymous"),table:[{3:1,4:2,6:e,9:r,11:n,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:e,9:r,11:n,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(a,[2,6]),{3:12,4:2,6:e,9:r,11:n,13:i},{1:[2,2]},{4:17,5:s,7:13,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:x,74:w,77:A,89:T,90:S},t(a,[2,4]),t(a,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:s,7:42,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:x,74:w,77:A,89:T,90:S},{4:17,5:s,7:43,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:x,74:w,77:A,89:T,90:S},{4:17,5:s,7:44,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:x,74:w,77:A,89:T,90:S},{4:17,5:s,7:45,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:x,74:w,77:A,89:T,90:S},{4:17,5:s,7:46,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:x,74:w,77:A,89:T,90:S},{4:17,5:s,7:47,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:x,74:w,77:A,89:T,90:S},{4:17,5:s,7:48,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:x,74:w,77:A,89:T,90:S},{4:17,5:s,7:49,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:x,74:w,77:A,89:T,90:S},{4:17,5:s,7:50,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:x,74:w,77:A,89:T,90:S},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(O,[2,17]),t(O,[2,18]),t(O,[2,19]),t(O,[2,20]),{30:60,33:62,75:k,89:T,90:S},{30:63,33:62,75:k,89:T,90:S},{30:64,33:62,75:k,89:T,90:S},t(E,[2,29]),t(E,[2,30]),t(E,[2,31]),t(E,[2,32]),t(E,[2,33]),t(E,[2,34]),t(_,[2,81]),t(_,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(I,[2,79]),t(I,[2,80]),{27:[1,67],29:[1,68]},t(I,[2,85]),t(I,[2,86]),{62:69,65:L,66:R,67:D,68:M,69:P,70:N,71:F},{62:77,65:L,66:R,67:D,68:M,69:P,70:N,71:F},{30:78,33:62,75:k,89:T,90:S},{73:79,75:B,76:V,78:81,79:82,80:z,81:U,82:Q,83:G,84:X,85:Y,86:le,87:q,88:Z},t(ee,[2,60]),t(ee,[2,62]),{73:93,75:B,76:V,78:81,79:82,80:z,81:U,82:Q,83:G,84:X,85:Y,86:le,87:q,88:Z},{30:94,33:62,75:k,76:V,89:T,90:S},{5:[1,95]},{30:96,33:62,75:k,89:T,90:S},{5:[1,97]},{30:98,33:62,75:k,89:T,90:S},{63:[1,99]},t(re,[2,50]),t(re,[2,51]),t(re,[2,52]),t(re,[2,53]),t(re,[2,54]),t(re,[2,55]),t(re,[2,56]),{64:[1,100]},t(O,[2,59],{76:V}),t(O,[2,64],{76:ve}),{33:103,75:[1,102],89:T,90:S},t(ae,[2,65],{79:104,75:B,80:z,81:U,82:Q,83:G,84:X,85:Y,86:le,87:q,88:Z}),t(Ce,[2,67]),t(Ce,[2,69]),t(Ce,[2,70]),t(Ce,[2,71]),t(Ce,[2,72]),t(Ce,[2,73]),t(Ce,[2,74]),t(Ce,[2,75]),t(Ce,[2,76]),t(Ce,[2,77]),t(Ce,[2,78]),t(O,[2,57],{76:ve}),t(O,[2,58],{76:V}),{5:Oe,28:105,31:$e,34:he,36:fe,38:Te,40:ge},{27:[1,112],76:V},{5:Qe,40:Se,56:113,57:De,59:qe},{27:[1,118],76:V},{33:119,89:T,90:S},{33:120,89:T,90:S},{75:B,78:121,79:82,80:z,81:U,82:Q,83:G,84:X,85:Y,86:le,87:q,88:Z},t(ee,[2,61]),t(ee,[2,63]),t(Ce,[2,68]),t(O,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:Oe,28:126,31:$e,34:he,36:fe,38:Te,40:ge},t(O,[2,28]),{5:[1,127]},t(O,[2,42]),{32:[1,128]},{32:[1,129]},{5:Qe,40:Se,56:130,57:De,59:qe},t(O,[2,47]),{5:[1,131]},t(O,[2,48]),t(O,[2,49]),t(ae,[2,66],{79:104,75:B,80:z,81:U,82:Q,83:G,84:X,85:Y,86:le,87:q,88:Z}),{33:132,89:T,90:S},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(O,[2,27]),{5:Oe,28:145,31:$e,34:he,36:fe,38:Te,40:ge},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(O,[2,46]),{5:Qe,40:Se,56:152,57:De,59:qe},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(O,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(O,[2,43]),{5:Oe,28:159,31:$e,34:he,36:fe,38:Te,40:ge},{5:Oe,28:160,31:$e,34:he,36:fe,38:Te,40:ge},{5:Oe,28:161,31:$e,34:he,36:fe,38:Te,40:ge},{5:Oe,28:162,31:$e,34:he,36:fe,38:Te,40:ge},{5:Qe,40:Se,56:163,57:De,59:qe},{5:Qe,40:Se,56:164,57:De,59:qe},t(O,[2,23]),t(O,[2,24]),t(O,[2,25]),t(O,[2,26]),t(O,[2,44]),t(O,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:C(function(j,ie){if(ie.recoverable)this.trace(j);else{var pe=new Error(j);throw pe.hash=ie,pe}},"parseError"),parse:C(function(j){var ie=this,pe=[0],te=[],ye=[null],oe=[],_e=this.table,Le="",Ye=0,Pe=0,Xe=2,Ne=1,Ze=oe.slice.call(arguments,1),Ge=Object.create(this.lexer),lt={yy:{}};for(var Fe in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Fe)&&(lt.yy[Fe]=this.yy[Fe]);Ge.setInput(j,lt.yy),lt.yy.lexer=Ge,lt.yy.parser=this,typeof Ge.yylloc>"u"&&(Ge.yylloc={});var wt=Ge.yylloc;oe.push(wt);var Me=Ge.options&&Ge.options.ranges;typeof lt.yy.parseError=="function"?this.parseError=lt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Rt(Re){pe.length=pe.length-2*Re,ye.length=ye.length-Re,oe.length=oe.length-Re}C(Rt,"popStack");function Lt(){var Re;return Re=te.pop()||Ge.lex()||Ne,typeof Re!="number"&&(Re instanceof Array&&(te=Re,Re=te.pop()),Re=ie.symbols_[Re]||Re),Re}C(Lt,"lex");for(var ut,Xt,Ft,gt,Ae={},zt,kt,At,Mt;;){if(Xt=pe[pe.length-1],this.defaultActions[Xt]?Ft=this.defaultActions[Xt]:((ut===null||typeof ut>"u")&&(ut=Lt()),Ft=_e[Xt]&&_e[Xt][ut]),typeof Ft>"u"||!Ft.length||!Ft[0]){var jr="";Mt=[];for(zt in _e[Xt])this.terminals_[zt]&&zt>Xe&&Mt.push("'"+this.terminals_[zt]+"'");Ge.showPosition?jr="Parse error on line "+(Ye+1)+`: +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var N=this.next();return N||this.lex()},"lex"),begin:C(function(N){this.conditionStack.push(N)},"begin"),popState:C(function(){var N=this.conditionStack.length-1;return N>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(N){return N=this.conditionStack.length-1-Math.abs(N||0),N>=0?this.conditionStack[N]:"INITIAL"},"topState"),pushState:C(function(N){this.begin(N)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:C(function(N,F,B,V){switch(B){case 0:break;case 1:break;case 2:return this.popState(),36;case 3:return this.popState(),36;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 33;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 29;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return M}();L.lexer=R;function D(){this.yy={}}return C(D,"Parser"),D.prototype=L,L.Parser=D,new D}();DRe.parser=DRe;var mHn=DRe;function LRe(t){return t.type==="bar"}C(LRe,"isBarPlot");function Cne(t){return t.type==="band"}C(Cne,"isBandAxisData");function YR(t){return t.type==="linear"}C(YR,"isLinearAxisData");var LYt=(CI=class{constructor(e){this.parentGroup=e}getMaxDimension(e,r){if(!this.parentGroup)return{width:e.reduce((a,s)=>Math.max(s.length,a),0)*r,height:r};const n={width:0,height:0},i=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",r);for(const a of e){const s=$1t(i,1,a),o=s?s.width:a.length*r,l=s?s.height:r;n.width=Math.max(n.width,o),n.height=Math.max(n.height,l)}return i.remove(),n}},C(CI,"TextDimensionCalculatorWithFont"),CI),MYt=.7,IYt=.2,PYt=(OI=class{constructor(e,r,n,i){this.axisConfig=e,this.title=r,this.textDimensionCalculator=n,this.axisThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}setRange(e){this.range=e,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=e[1]-e[0]:this.boundingRect.width=e[1]-e[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){const e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(e=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){MYt*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(MYt*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let r=e.height;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=IYt*e.width;this.outerPadding=Math.min(n.width/2,i);let a=n.height;this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0&&(a=Math.max(a,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*n.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*n.height))),a+=this.axisConfig.labelPadding*2,this.labelTextHeight=n.height,a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-r}calculateSpaceIfDrawnVertical(e){let r=e.width;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=IYt*e.height;this.outerPadding=Math.min(n.height/2,i);const a=n.width+this.axisConfig.labelPadding*2;a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width-r,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){const r=this.normalizedLabelRotationInRad;return r===0?0:Math.sin(r)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${r},${this.boundingRect.y} L ${r},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(r),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const r=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${r},${this.getScaleValue(n)} L ${r-this.axisConfig.tickLength},${this.getScaleValue(n)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForBottomAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r} L ${this.getScaleValue(n)},${r+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForTopAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(n)},${r+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},C(OI,"BaseAxis"),OI),vHn=(kI=class extends PYt{constructor(e,r,n,i,a){super(e,i,a,r),this.categories=n,this.scale=Zye().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=Zye().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),me.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},C(kI,"BandAxis"),kI),yHn=(EI=class extends PYt{constructor(e,r,n,i,a){super(e,i,a,r),this.domain=n,this.scale=P5().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];this.axisPosition==="left"&&e.reverse(),this.scale=P5().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}},C(EI,"LinearAxis"),EI);function MRe(t,e,r,n){const i=new LYt(n);return Cne(t)?new vHn(e,r,t.categories,t.title,i):new yHn(e,r,[t.min,t.max],t.title,i)}C(MRe,"getAxis");var bHn=(_I=class{constructor(e,r,n,i){this.textDimensionCalculator=e,this.chartConfig=r,this.chartData=n,this.chartThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){const r=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(r.width,e.width),i=r.height+2*this.chartConfig.titlePadding;return r.width<=n&&r.height<=i&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=i,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const e=[];return this.showChartTitle&&e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),e}},C(_I,"ChartTitle"),_I);function NYt(t,e,r,n){const i=new LYt(n);return new bHn(i,t,e,r)}C(NYt,"getChartTitleComponent");var xHn=(RI=class{constructor(e,r,n,i,a){this.plotData=e,this.xAxis=r,this.yAxis=n,this.orientation=i,this.plotIndex=a}getDrawableElement(){const e=this.plotData.data.map(i=>[this.xAxis.getScaleValue(i[0]),this.yAxis.getScaleValue(i[1])]);let r;if(this.orientation==="horizontal"?r=r7().y(i=>i[0]).x(i=>i[1])(e):r=r7().x(i=>i[0]).y(i=>i[1])(e),!r)return[];const n=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:r,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){const s=[];for(const[o,[l,u]]of e.entries()){const h=this.plotData.pointLabels[o];h&&(this.orientation==="horizontal"?s.push({x:u+10,y:l,text:h,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0}):s.push({x:l,y:u-10,text:h,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0}))}s.length>0&&n.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:s})}return n}},C(RI,"LinePlot"),RI),wHn=(DI=class{constructor(e,r,n,i,a,s){this.barData=e,this.boundingRect=r,this.xAxis=n,this.yAxis=i,this.orientation=a,this.plotIndex=s}getDrawableElement(){const e=this.barData.data.map(a=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]),n=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),i=n/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:this.boundingRect.x,y:a[0]-i,height:n,width:a[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:a[0]-i,y:a[1],width:n,height:this.boundingRect.y+this.boundingRect.height-a[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},C(DI,"BarPlot"),DI),AHn=(LI=class{constructor(e,r,n){this.chartConfig=e,this.chartData=r,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(e,r){this.xAxis=e,this.yAxis=r}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const e=[];for(const[r,n]of this.chartData.plots.entries())switch(n.type){case"line":{const i=new xHn(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break;case"bar":{const i=new wHn(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break}return e}},C(LI,"BasePlot"),LI);function BYt(t,e,r){return new AHn(t,e,r)}C(BYt,"getPlotComponent");var SHn=(MI=class{constructor(e,r,n,i){this.chartConfig=e,this.chartData=r,this.componentStore={title:NYt(e,r,n,i),plot:BYt(e,r,n),xAxis:MRe(r.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},i),yAxis:MRe(r.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},i)}}calculateVerticalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),s=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:a,height:s});e-=o.width,r-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),i=o.height,r-=o.height,this.componentStore.xAxis.setAxisPosition("bottom"),o=this.componentStore.xAxis.calculateSpace({width:e,height:r}),r-=o.height,this.componentStore.yAxis.setAxisPosition("left"),o=this.componentStore.yAxis.calculateSpace({width:e,height:r}),n=o.width,e-=o.width,e>0&&(a+=e,e=0),r>0&&(s+=r,r=0),this.componentStore.plot.calculateSpace({width:a,height:s}),this.componentStore.plot.setBoundingBoxXY({x:n,y:i}),this.componentStore.xAxis.setRange([n,n+a]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:i+s}),this.componentStore.yAxis.setRange([i,i+s]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(l=>LRe(l))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=0,s=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),l=this.componentStore.plot.calculateSpace({width:s,height:o});e-=l.width,r-=l.height,l=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),n=l.height,r-=l.height,this.componentStore.xAxis.setAxisPosition("left"),l=this.componentStore.xAxis.calculateSpace({width:e,height:r}),e-=l.width,i=l.width,this.componentStore.yAxis.setAxisPosition("top"),l=this.componentStore.yAxis.calculateSpace({width:e,height:r}),r-=l.height,a=n+l.height,e>0&&(s+=e,e=0),r>0&&(o+=r,r=0),this.componentStore.plot.calculateSpace({width:s,height:o}),this.componentStore.plot.setBoundingBoxXY({x:i,y:a}),this.componentStore.yAxis.setRange([i,i+s]),this.componentStore.yAxis.setBoundingBoxXY({x:i,y:n}),this.componentStore.xAxis.setRange([a,a+o]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(u=>LRe(u))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const r of Object.values(this.componentStore))e.push(...r.getDrawableElements());return e}},C(MI,"Orchestrator"),MI),THn=(II=class{static build(e,r,n,i){return new SHn(e,r,n,i).getDrawableElement()}},C(II,"XYChartBuilder"),II),xz=0,$Yt,wz=BRe(),Az=NRe(),Ni=$Re(),IRe=Az.plotColorPalette.split(",").map(t=>t.trim()),One=!1,PRe=!1;function NRe(){const t=ky(),e=Dr();return ns(t.xyChart,e.themeVariables.xyChart)}C(NRe,"getChartDefaultThemeConfig");function BRe(){const t=Dr();return ns(Xn.xyChart,t.xyChart)}C(BRe,"getChartDefaultConfig");function $Re(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}C($Re,"getChartDefaultData");function Sz(t){const e=Dr();return ai(t.trim(),e)}C(Sz,"textSanitizer");function FYt(t){$Yt=t}C(FYt,"setTmpSVGG");function zYt(t){t==="horizontal"?wz.chartOrientation="horizontal":wz.chartOrientation="vertical"}C(zYt,"setOrientation");function UYt(t){Ni.xAxis.title=Sz(t.text)}C(UYt,"setXAxisTitle");function FRe(t,e){Ni.xAxis={type:"linear",title:Ni.xAxis.title,min:t,max:e},One=!0}C(FRe,"setXAxisRangeData");function VYt(t){Ni.xAxis={type:"band",title:Ni.xAxis.title,categories:t.map(e=>Sz(e.text))},One=!0}C(VYt,"setXAxisBand");function QYt(t){Ni.yAxis.title=Sz(t.text)}C(QYt,"setYAxisTitle");function GYt(t,e){Ni.yAxis={type:"linear",title:Ni.yAxis.title,min:t,max:e},PRe=!0}C(GYt,"setYAxisRangeData");function HYt(t){const e=Math.min(...t),r=Math.max(...t),n=YR(Ni.yAxis)?Ni.yAxis.min:1/0,i=YR(Ni.yAxis)?Ni.yAxis.max:-1/0;Ni.yAxis={type:"linear",title:Ni.yAxis.title,min:Math.min(n,e),max:Math.max(i,r)}}C(HYt,"setYAxisRangeFromPlotData");function zRe(t){let e=[];if(t.length===0)return e;if(!One){const r=YR(Ni.xAxis)?Ni.xAxis.min:1/0,n=YR(Ni.xAxis)?Ni.xAxis.max:-1/0;FRe(Math.min(r,1),Math.max(n,t.length))}if(Cne(Ni.xAxis)&&t.length>Ni.xAxis.categories.length&&(t=t.slice(0,Ni.xAxis.categories.length)),PRe||HYt(t),Cne(Ni.xAxis)&&(e=Ni.xAxis.categories.map((r,n)=>[r,t[n]])),YR(Ni.xAxis)){const r=Ni.xAxis.min,n=Ni.xAxis.max;if(t.length===1)e=[[`${r}`,t[0]]];else{const i=(n-r)/(t.length-1);e=t.map((a,s)=>[`${r+s*i}`,a])}}return e}C(zRe,"transformDataWithoutCategory");function URe(t){return IRe[t===0?0:t%IRe.length]}C(URe,"getPlotColorFromPalette");function WYt(t,e){const r=e.map(s=>s.value),n=e.map(s=>s.label?Sz(s.label):""),i=zRe(r),a=n.some(s=>s!=="");Ni.plots.push({type:"line",strokeFill:URe(xz),strokeWidth:2,data:i,...a?{pointLabels:n}:{}}),xz++}C(WYt,"setLineData");function YYt(t,e){const r=e.map(i=>i.value),n=zRe(r);Ni.plots.push({type:"bar",fill:URe(xz),data:n}),xz++}C(YYt,"setBarData");function qYt(){if(Ni.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return Ni.title=La(),THn.build(wz,Ni,Az,$Yt)}C(qYt,"getDrawableElem");function jYt(){return Az}C(jYt,"getChartThemeConfig");function XYt(){return wz}C(XYt,"getChartConfig");function KYt(){return Ni}C(KYt,"getXYChartData");var CHn=C(function(){Aa(),xz=0,wz=BRe(),Ni=$Re(),Az=NRe(),IRe=Az.plotColorPalette.split(",").map(t=>t.trim()),One=!1,PRe=!1},"clear"),OHn={getDrawableElem:qYt,clear:CHn,setAccTitle:Da,getAccTitle:Ja,setDiagramTitle:rs,getDiagramTitle:La,getAccDescription:ts,setAccDescription:es,setOrientation:zYt,setXAxisTitle:UYt,setXAxisRangeData:FRe,setXAxisBand:VYt,setYAxisTitle:QYt,setYAxisRangeData:GYt,setLineData:WYt,setBarData:YYt,setTmpSVGG:FYt,getChartThemeConfig:jYt,getChartConfig:XYt,getXYChartData:KYt},kHn=C((t,e,r,n)=>{const i=n.db,a=i.getChartThemeConfig(),s=i.getChartConfig(),o=i.getXYChartData().plots[0].data.map(y=>y[1]);function l(y){return y==="top"?"text-before-edge":"middle"}C(l,"getDominantBaseLine");function u(y){return y==="left"?"start":y==="right"?"end":"middle"}C(u,"getTextAnchor");function h(y){return`translate(${y.x}, ${y.y}) rotate(${y.rotation||0})`}C(h,"getTextTransformation"),me.debug(`Rendering xychart chart +`+t);const d=qc(e),f=d.append("g").attr("class","main"),p=f.append("rect").attr("width",s.width).attr("height",s.height).attr("class","background");zs(d,s.height,s.width,!0),d.attr("viewBox",`0 0 ${s.width} ${s.height}`),p.attr("fill",a.backgroundColor),i.setTmpSVGG(d.append("g").attr("class","mermaid-tmp-group"));const g=i.getDrawableElem(),m={};function v(y){let b=f,x="";for(const[w]of y.entries()){let A=f;w>0&&m[x]&&(A=m[x]),x+=y[w],b=m[x],b||(b=m[x]=A.append("g").attr("class",y[w]))}return b}C(v,"getGroup");for(const y of g){if(y.data.length===0)continue;const b=v(y.groupTexts);switch(y.type){case"rect":if(b.selectAll("rect").data(y.data).enter().append("rect").attr("x",x=>x.x).attr("y",x=>x.y).attr("width",x=>x.width).attr("height",x=>x.height).attr("fill",x=>x.fill).attr("stroke",x=>x.strokeFill).attr("stroke-width",x=>x.strokeWidth),s.showDataLabel){const x=s.showDataLabelOutsideBar;if(s.chartOrientation==="horizontal"){let w=function(_,I){const{data:L,label:R}=_;return I*R.length*A<=L.width-S};C(w,"fitsHorizontally");const A=.7,S=10,T=y.data.map((_,I)=>({data:_,label:o[I].toString()})).filter(_=>_.data.width>0&&_.data.height>0),O=T.map(_=>{const{data:I}=_;let L=I.height*.7;for(;!w(_,L)&&L>0;)L-=1;return L}),k=Math.floor(Math.min(...O)),E=C(_=>x?_.data.x+_.data.width+S:_.data.x+_.data.width-S,"determineLabelXPosition");b.selectAll("text").data(T).enter().append("text").attr("x",E).attr("y",_=>_.data.y+_.data.height/2).attr("text-anchor",x?"start":"end").attr("dominant-baseline","middle").attr("fill",a.dataLabelColor).attr("font-size",`${k}px`).text(_=>_.label)}else{let w=function(E,_,I){const{data:L,label:R}=E,M=_*R.length*.7,P=L.x+L.width/2,N=P-M/2,F=P+M/2,B=N>=L.x&&F<=L.x+L.width,V=L.y+I+_<=L.y+L.height;return B&&V};C(w,"fitsInBar");const A=10,S=y.data.map((E,_)=>({data:E,label:o[_].toString()})).filter(E=>E.data.width>0&&E.data.height>0),T=S.map(E=>{const{data:_,label:I}=E;let L=_.width/(I.length*.7);for(;!w(E,L,A)&&L>0;)L-=1;return L}),O=Math.floor(Math.min(...T)),k=C(E=>x?E.data.y-A:E.data.y+A,"determineLabelYPosition");b.selectAll("text").data(S).enter().append("text").attr("x",E=>E.data.x+E.data.width/2).attr("y",k).attr("text-anchor","middle").attr("dominant-baseline",x?"auto":"hanging").attr("fill",a.dataLabelColor).attr("font-size",`${O}px`).text(E=>E.label)}}break;case"text":b.selectAll("text").data(y.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",x=>x.fill).attr("font-size",x=>x.fontSize).attr("dominant-baseline",x=>l(x.verticalPos)).attr("text-anchor",x=>u(x.horizontalPos)).attr("transform",x=>h(x)).text(x=>x.text);break;case"path":b.selectAll("path").data(y.data).enter().append("path").attr("d",x=>x.path).attr("fill",x=>x.fill?x.fill:"none").attr("stroke",x=>x.strokeFill).attr("stroke-width",x=>x.strokeWidth);break}}},"draw"),EHn={draw:kHn},_Hn={parser:mHn,db:OHn,renderer:EHn};const RHn=Object.freeze(Object.defineProperty({__proto__:null,diagram:_Hn},Symbol.toStringTag,{value:"Module"}));var VRe=function(){var t=C(function(ne,j,ie,pe){for(ie=ie||{},pe=ne.length;pe--;ie[ne[pe]]=j);return ie},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],s=[1,22],o=[2,7],l=[1,26],u=[1,27],h=[1,28],d=[1,29],f=[1,33],p=[1,34],g=[1,35],m=[1,36],v=[1,37],y=[1,38],b=[1,24],x=[1,31],w=[1,32],A=[1,30],S=[1,39],T=[1,40],O=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],k=[1,61],E=[89,90],_=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],I=[27,29],L=[1,70],R=[1,71],D=[1,72],M=[1,73],P=[1,74],N=[1,75],F=[1,76],B=[1,83],V=[1,80],z=[1,84],U=[1,85],Q=[1,86],G=[1,87],X=[1,88],Y=[1,89],le=[1,90],q=[1,91],Z=[1,92],ee=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],re=[63,64],ve=[1,101],ae=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],Ce=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Oe=[1,110],$e=[1,106],he=[1,107],fe=[1,108],Se=[1,109],ge=[1,111],Qe=[1,116],Te=[1,117],De=[1,114],qe=[1,115],K={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:C(function(j,ie,pe,te,ye,oe,_e){var Le=oe.length-1;switch(ye){case 4:this.$=oe[Le].trim(),te.setAccTitle(this.$);break;case 5:case 6:this.$=oe[Le].trim(),te.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:te.setDirection("TB");break;case 18:te.setDirection("BT");break;case 19:te.setDirection("RL");break;case 20:te.setDirection("LR");break;case 21:te.addRequirement(oe[Le-3],oe[Le-4]);break;case 22:te.addRequirement(oe[Le-5],oe[Le-6]),te.setClass([oe[Le-5]],oe[Le-3]);break;case 23:te.setNewReqId(oe[Le-2]);break;case 24:te.setNewReqText(oe[Le-2]);break;case 25:te.setNewReqRisk(oe[Le-2]);break;case 26:te.setNewReqVerifyMethod(oe[Le-2]);break;case 29:this.$=te.RequirementType.REQUIREMENT;break;case 30:this.$=te.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=te.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=te.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=te.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=te.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=te.RiskLevel.LOW_RISK;break;case 36:this.$=te.RiskLevel.MED_RISK;break;case 37:this.$=te.RiskLevel.HIGH_RISK;break;case 38:this.$=te.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=te.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=te.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=te.VerifyType.VERIFY_TEST;break;case 42:te.addElement(oe[Le-3]);break;case 43:te.addElement(oe[Le-5]),te.setClass([oe[Le-5]],oe[Le-3]);break;case 44:te.setNewElementType(oe[Le-2]);break;case 45:te.setNewElementDocRef(oe[Le-2]);break;case 48:te.addRelationship(oe[Le-2],oe[Le],oe[Le-4]);break;case 49:te.addRelationship(oe[Le-2],oe[Le-4],oe[Le]);break;case 50:this.$=te.Relationships.CONTAINS;break;case 51:this.$=te.Relationships.COPIES;break;case 52:this.$=te.Relationships.DERIVES;break;case 53:this.$=te.Relationships.SATISFIES;break;case 54:this.$=te.Relationships.VERIFIES;break;case 55:this.$=te.Relationships.REFINES;break;case 56:this.$=te.Relationships.TRACES;break;case 57:this.$=oe[Le-2],te.defineClass(oe[Le-1],oe[Le]);break;case 58:te.setClass(oe[Le-1],oe[Le]);break;case 59:te.setClass([oe[Le-2]],oe[Le]);break;case 60:case 62:this.$=[oe[Le]];break;case 61:case 63:this.$=oe[Le-2].concat([oe[Le]]);break;case 64:this.$=oe[Le-2],te.setCssStyle(oe[Le-1],oe[Le]);break;case 65:this.$=[oe[Le]];break;case 66:oe[Le-2].push(oe[Le]),this.$=oe[Le-2];break;case 68:this.$=oe[Le-1]+oe[Le];break}},"anonymous"),table:[{3:1,4:2,6:e,9:r,11:n,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:e,9:r,11:n,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(a,[2,6]),{3:12,4:2,6:e,9:r,11:n,13:i},{1:[2,2]},{4:17,5:s,7:13,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:x,74:w,77:A,89:S,90:T},t(a,[2,4]),t(a,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:s,7:42,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:x,74:w,77:A,89:S,90:T},{4:17,5:s,7:43,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:x,74:w,77:A,89:S,90:T},{4:17,5:s,7:44,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:x,74:w,77:A,89:S,90:T},{4:17,5:s,7:45,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:x,74:w,77:A,89:S,90:T},{4:17,5:s,7:46,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:x,74:w,77:A,89:S,90:T},{4:17,5:s,7:47,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:x,74:w,77:A,89:S,90:T},{4:17,5:s,7:48,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:x,74:w,77:A,89:S,90:T},{4:17,5:s,7:49,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:x,74:w,77:A,89:S,90:T},{4:17,5:s,7:50,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:v,46:y,54:b,72:x,74:w,77:A,89:S,90:T},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(O,[2,17]),t(O,[2,18]),t(O,[2,19]),t(O,[2,20]),{30:60,33:62,75:k,89:S,90:T},{30:63,33:62,75:k,89:S,90:T},{30:64,33:62,75:k,89:S,90:T},t(E,[2,29]),t(E,[2,30]),t(E,[2,31]),t(E,[2,32]),t(E,[2,33]),t(E,[2,34]),t(_,[2,81]),t(_,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(I,[2,79]),t(I,[2,80]),{27:[1,67],29:[1,68]},t(I,[2,85]),t(I,[2,86]),{62:69,65:L,66:R,67:D,68:M,69:P,70:N,71:F},{62:77,65:L,66:R,67:D,68:M,69:P,70:N,71:F},{30:78,33:62,75:k,89:S,90:T},{73:79,75:B,76:V,78:81,79:82,80:z,81:U,82:Q,83:G,84:X,85:Y,86:le,87:q,88:Z},t(ee,[2,60]),t(ee,[2,62]),{73:93,75:B,76:V,78:81,79:82,80:z,81:U,82:Q,83:G,84:X,85:Y,86:le,87:q,88:Z},{30:94,33:62,75:k,76:V,89:S,90:T},{5:[1,95]},{30:96,33:62,75:k,89:S,90:T},{5:[1,97]},{30:98,33:62,75:k,89:S,90:T},{63:[1,99]},t(re,[2,50]),t(re,[2,51]),t(re,[2,52]),t(re,[2,53]),t(re,[2,54]),t(re,[2,55]),t(re,[2,56]),{64:[1,100]},t(O,[2,59],{76:V}),t(O,[2,64],{76:ve}),{33:103,75:[1,102],89:S,90:T},t(ae,[2,65],{79:104,75:B,80:z,81:U,82:Q,83:G,84:X,85:Y,86:le,87:q,88:Z}),t(Ce,[2,67]),t(Ce,[2,69]),t(Ce,[2,70]),t(Ce,[2,71]),t(Ce,[2,72]),t(Ce,[2,73]),t(Ce,[2,74]),t(Ce,[2,75]),t(Ce,[2,76]),t(Ce,[2,77]),t(Ce,[2,78]),t(O,[2,57],{76:ve}),t(O,[2,58],{76:V}),{5:Oe,28:105,31:$e,34:he,36:fe,38:Se,40:ge},{27:[1,112],76:V},{5:Qe,40:Te,56:113,57:De,59:qe},{27:[1,118],76:V},{33:119,89:S,90:T},{33:120,89:S,90:T},{75:B,78:121,79:82,80:z,81:U,82:Q,83:G,84:X,85:Y,86:le,87:q,88:Z},t(ee,[2,61]),t(ee,[2,63]),t(Ce,[2,68]),t(O,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:Oe,28:126,31:$e,34:he,36:fe,38:Se,40:ge},t(O,[2,28]),{5:[1,127]},t(O,[2,42]),{32:[1,128]},{32:[1,129]},{5:Qe,40:Te,56:130,57:De,59:qe},t(O,[2,47]),{5:[1,131]},t(O,[2,48]),t(O,[2,49]),t(ae,[2,66],{79:104,75:B,80:z,81:U,82:Q,83:G,84:X,85:Y,86:le,87:q,88:Z}),{33:132,89:S,90:T},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(O,[2,27]),{5:Oe,28:145,31:$e,34:he,36:fe,38:Se,40:ge},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(O,[2,46]),{5:Qe,40:Te,56:152,57:De,59:qe},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(O,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(O,[2,43]),{5:Oe,28:159,31:$e,34:he,36:fe,38:Se,40:ge},{5:Oe,28:160,31:$e,34:he,36:fe,38:Se,40:ge},{5:Oe,28:161,31:$e,34:he,36:fe,38:Se,40:ge},{5:Oe,28:162,31:$e,34:he,36:fe,38:Se,40:ge},{5:Qe,40:Te,56:163,57:De,59:qe},{5:Qe,40:Te,56:164,57:De,59:qe},t(O,[2,23]),t(O,[2,24]),t(O,[2,25]),t(O,[2,26]),t(O,[2,44]),t(O,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:C(function(j,ie){if(ie.recoverable)this.trace(j);else{var pe=new Error(j);throw pe.hash=ie,pe}},"parseError"),parse:C(function(j){var ie=this,pe=[0],te=[],ye=[null],oe=[],_e=this.table,Le="",Ye=0,Pe=0,Xe=2,Ne=1,Ze=oe.slice.call(arguments,1),Ge=Object.create(this.lexer),lt={yy:{}};for(var Fe in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Fe)&&(lt.yy[Fe]=this.yy[Fe]);Ge.setInput(j,lt.yy),lt.yy.lexer=Ge,lt.yy.parser=this,typeof Ge.yylloc>"u"&&(Ge.yylloc={});var wt=Ge.yylloc;oe.push(wt);var Me=Ge.options&&Ge.options.ranges;typeof lt.yy.parseError=="function"?this.parseError=lt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Rt(Re){pe.length=pe.length-2*Re,ye.length=ye.length-Re,oe.length=oe.length-Re}C(Rt,"popStack");function Lt(){var Re;return Re=te.pop()||Ge.lex()||Ne,typeof Re!="number"&&(Re instanceof Array&&(te=Re,Re=te.pop()),Re=ie.symbols_[Re]||Re),Re}C(Lt,"lex");for(var ut,Xt,Ft,gt,Ae={},zt,kt,At,Mt;;){if(Xt=pe[pe.length-1],this.defaultActions[Xt]?Ft=this.defaultActions[Xt]:((ut===null||typeof ut>"u")&&(ut=Lt()),Ft=_e[Xt]&&_e[Xt][ut]),typeof Ft>"u"||!Ft.length||!Ft[0]){var jr="";Mt=[];for(zt in _e[Xt])this.terminals_[zt]&&zt>Xe&&Mt.push("'"+this.terminals_[zt]+"'");Ge.showPosition?jr="Parse error on line "+(Ye+1)+`: `+Ge.showPosition()+` Expecting `+Mt.join(", ")+", got '"+(this.terminals_[ut]||ut)+"'":jr="Parse error on line "+(Ye+1)+": Unexpected "+(ut==Ne?"end of input":"'"+(this.terminals_[ut]||ut)+"'"),this.parseError(jr,{text:Ge.match,token:this.terminals_[ut]||ut,line:Ge.yylineno,loc:wt,expected:Mt})}if(Ft[0]instanceof Array&&Ft.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Xt+", token: "+ut);switch(Ft[0]){case 1:pe.push(ut),ye.push(Ge.yytext),oe.push(Ge.yylloc),pe.push(Ft[1]),ut=null,Pe=Ge.yyleng,Le=Ge.yytext,Ye=Ge.yylineno,wt=Ge.yylloc;break;case 2:if(kt=this.productions_[Ft[1]][1],Ae.$=ye[ye.length-kt],Ae._$={first_line:oe[oe.length-(kt||1)].first_line,last_line:oe[oe.length-1].last_line,first_column:oe[oe.length-(kt||1)].first_column,last_column:oe[oe.length-1].last_column},Me&&(Ae._$.range=[oe[oe.length-(kt||1)].range[0],oe[oe.length-1].range[1]]),gt=this.performAction.apply(Ae,[Le,Pe,Ye,lt.yy,Ft[1],ye,oe].concat(Ze)),typeof gt<"u")return gt;kt&&(pe=pe.slice(0,-1*kt*2),ye=ye.slice(0,-1*kt),oe=oe.slice(0,-1*kt)),pe.push(this.productions_[Ft[1]][0]),ye.push(Ae.$),oe.push(Ae._$),At=_e[pe[pe.length-2]][pe[pe.length-1]],pe.push(At);break;case 3:return!0}}return!0},"parse")},ce=function(){var ne={EOF:1,parseError:C(function(ie,pe){if(this.yy.parser)this.yy.parser.parseError(ie,pe);else throw new Error(ie)},"parseError"),setInput:C(function(j,ie){return this.yy=ie||this.yy||{},this._input=j,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var j=this._input[0];this.yytext+=j,this.yyleng++,this.offset++,this.match+=j,this.matched+=j;var ie=j.match(/(?:\r\n?|\n).*/g);return ie?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),j},"input"),unput:C(function(j){var ie=j.length,pe=j.split(/(?:\r\n?|\n)/g);this._input=j+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-ie),this.offset-=ie;var te=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),pe.length-1&&(this.yylineno-=pe.length-1);var ye=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:pe?(pe.length===te.length?this.yylloc.first_column:0)+te[te.length-pe.length].length-pe[0].length:this.yylloc.first_column-ie},this.options.ranges&&(this.yylloc.range=[ye[0],ye[0]+this.yyleng-ie]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:C(function(j){this.unput(this.match.slice(j))},"less"),pastInput:C(function(){var j=this.matched.substr(0,this.matched.length-this.match.length);return(j.length>20?"...":"")+j.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:C(function(){var j=this.match;return j.length<20&&(j+=this._input.substr(0,20-j.length)),(j.substr(0,20)+(j.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:C(function(){var j=this.pastInput(),ie=new Array(j.length+1).join("-");return j+this.upcomingInput()+` @@ -2233,7 +2233,7 @@ Expecting `+Mt.join(", ")+", got '"+(this.terminals_[ut]||ut)+"'":jr="Parse erro stroke: ${t.requirementBorderColor}; stroke-width: ${t.requirementBorderSize}; } - + .reqTitle, .reqLabel{ fill: ${t.requirementTextColor}; } @@ -2278,7 +2278,7 @@ Expecting `+Mt.join(", ")+", got '"+(this.terminals_[ut]||ut)+"'":jr="Parse erro background-color: ${i??t.edgeLabelBackground}; } -`},"getStyles"),PHn=IHn,ZYt={};wq(ZYt,{draw:()=>NHn});var NHn=C(async function(t,e,r,n){me.info("REF0:"),me.info("Drawing requirement diagram (unified)",e);const{securityLevel:i,state:a,layout:s,look:o}=He(),l=n.db.getData(),u=z3(e,i);l.type=n.type,l.layoutAlgorithm=R7(s),l.nodeSpacing=(a==null?void 0:a.nodeSpacing)??50,l.rankSpacing=(a==null?void 0:a.rankSpacing)??50,l.markers=o==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],l.diagramId=e,await e4(l,u);const h=8;ln.insertTitle(u,"requirementDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),IC(u,h,"requirementDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),BHn={parser:DHn,get db(){return new LHn},renderer:ZYt,styles:PHn};const $Hn=Object.freeze(Object.defineProperty({__proto__:null,diagram:BHn},Symbol.toStringTag,{value:"Module"}));var QRe=function(){var t=C(function(Pe,Xe,Ne,Ze){for(Ne=Ne||{},Ze=Pe.length;Ze--;Ne[Pe[Ze]]=Xe);return Ne},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],o=[1,12],l=[1,14],u=[1,15],h=[1,17],d=[1,18],f=[1,19],p=[1,25],g=[1,26],m=[1,27],v=[1,28],y=[1,29],b=[1,30],x=[1,31],w=[1,32],A=[1,33],T=[1,34],S=[1,35],O=[1,36],k=[1,37],E=[1,38],_=[1,39],I=[1,40],L=[1,42],R=[1,43],D=[1,44],M=[1,45],P=[1,46],N=[1,47],F=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],B=[1,74],V=[1,80],z=[1,81],U=[1,82],Q=[1,83],G=[1,84],X=[1,85],Y=[1,86],le=[1,87],q=[1,88],Z=[1,89],ee=[1,90],re=[1,91],ve=[1,92],ae=[1,93],Ce=[1,94],Oe=[1,95],$e=[1,96],he=[1,97],fe=[1,98],Te=[1,99],ge=[1,100],Qe=[1,101],Se=[1,102],De=[1,103],qe=[1,104],K=[1,105],ce=[2,78],be=[4,5,17,51,53,54],ne=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],j=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],ie=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],pe=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],te=[5,52],ye=[70,71,72,73],oe=[1,151],_e={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:C(function(Xe,Ne,Ze,Ge,lt,Fe,wt){var Me=Fe.length-1;switch(lt){case 3:return Ge.apply(Fe[Me]),Fe[Me];case 4:case 10:this.$=[];break;case 5:case 11:Fe[Me-1].push(Fe[Me]),this.$=Fe[Me-1];break;case 6:case 7:case 12:case 13:this.$=Fe[Me];break;case 8:case 9:case 14:this.$=[];break;case 16:Fe[Me].type="createParticipant",this.$=Fe[Me];break;case 17:Fe[Me-1].unshift({type:"boxStart",boxData:Ge.parseBoxData(Fe[Me-2])}),Fe[Me-1].push({type:"boxEnd",boxText:Fe[Me-2]}),this.$=Fe[Me-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(Fe[Me-2]),sequenceIndexStep:Number(Fe[Me-1]),sequenceVisible:!0,signalType:Ge.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(Fe[Me-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:Ge.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:Ge.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:Ge.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:Ge.LINETYPE.ACTIVE_START,actor:Fe[Me-1].actor};break;case 24:this.$={type:"activeEnd",signalType:Ge.LINETYPE.ACTIVE_END,actor:Fe[Me-1].actor};break;case 30:Ge.setDiagramTitle(Fe[Me].substring(6)),this.$=Fe[Me].substring(6);break;case 31:Ge.setDiagramTitle(Fe[Me].substring(7)),this.$=Fe[Me].substring(7);break;case 32:this.$=Fe[Me].trim(),Ge.setAccTitle(this.$);break;case 33:case 34:this.$=Fe[Me].trim(),Ge.setAccDescription(this.$);break;case 35:Fe[Me-1].unshift({type:"loopStart",loopText:Ge.parseMessage(Fe[Me-2]),signalType:Ge.LINETYPE.LOOP_START}),Fe[Me-1].push({type:"loopEnd",loopText:Fe[Me-2],signalType:Ge.LINETYPE.LOOP_END}),this.$=Fe[Me-1];break;case 36:Fe[Me-1].unshift({type:"rectStart",color:Ge.parseMessage(Fe[Me-2]),signalType:Ge.LINETYPE.RECT_START}),Fe[Me-1].push({type:"rectEnd",color:Ge.parseMessage(Fe[Me-2]),signalType:Ge.LINETYPE.RECT_END}),this.$=Fe[Me-1];break;case 37:Fe[Me-1].unshift({type:"optStart",optText:Ge.parseMessage(Fe[Me-2]),signalType:Ge.LINETYPE.OPT_START}),Fe[Me-1].push({type:"optEnd",optText:Ge.parseMessage(Fe[Me-2]),signalType:Ge.LINETYPE.OPT_END}),this.$=Fe[Me-1];break;case 38:Fe[Me-1].unshift({type:"altStart",altText:Ge.parseMessage(Fe[Me-2]),signalType:Ge.LINETYPE.ALT_START}),Fe[Me-1].push({type:"altEnd",signalType:Ge.LINETYPE.ALT_END}),this.$=Fe[Me-1];break;case 39:Fe[Me-1].unshift({type:"parStart",parText:Ge.parseMessage(Fe[Me-2]),signalType:Ge.LINETYPE.PAR_START}),Fe[Me-1].push({type:"parEnd",signalType:Ge.LINETYPE.PAR_END}),this.$=Fe[Me-1];break;case 40:Fe[Me-1].unshift({type:"parStart",parText:Ge.parseMessage(Fe[Me-2]),signalType:Ge.LINETYPE.PAR_OVER_START}),Fe[Me-1].push({type:"parEnd",signalType:Ge.LINETYPE.PAR_END}),this.$=Fe[Me-1];break;case 41:Fe[Me-1].unshift({type:"criticalStart",criticalText:Ge.parseMessage(Fe[Me-2]),signalType:Ge.LINETYPE.CRITICAL_START}),Fe[Me-1].push({type:"criticalEnd",signalType:Ge.LINETYPE.CRITICAL_END}),this.$=Fe[Me-1];break;case 42:Fe[Me-1].unshift({type:"breakStart",breakText:Ge.parseMessage(Fe[Me-2]),signalType:Ge.LINETYPE.BREAK_START}),Fe[Me-1].push({type:"breakEnd",optText:Ge.parseMessage(Fe[Me-2]),signalType:Ge.LINETYPE.BREAK_END}),this.$=Fe[Me-1];break;case 44:this.$=Fe[Me-3].concat([{type:"option",optionText:Ge.parseMessage(Fe[Me-1]),signalType:Ge.LINETYPE.CRITICAL_OPTION},Fe[Me]]);break;case 46:this.$=Fe[Me-3].concat([{type:"and",parText:Ge.parseMessage(Fe[Me-1]),signalType:Ge.LINETYPE.PAR_AND},Fe[Me]]);break;case 48:this.$=Fe[Me-3].concat([{type:"else",altText:Ge.parseMessage(Fe[Me-1]),signalType:Ge.LINETYPE.ALT_ELSE},Fe[Me]]);break;case 49:Fe[Me-3].draw="participant",Fe[Me-3].type="addParticipant",Fe[Me-3].description=Ge.parseMessage(Fe[Me-1]),this.$=Fe[Me-3];break;case 50:Fe[Me-1].draw="participant",Fe[Me-1].type="addParticipant",this.$=Fe[Me-1];break;case 51:Fe[Me-3].draw="actor",Fe[Me-3].type="addParticipant",Fe[Me-3].description=Ge.parseMessage(Fe[Me-1]),this.$=Fe[Me-3];break;case 52:case 57:Fe[Me-1].draw="actor",Fe[Me-1].type="addParticipant",this.$=Fe[Me-1];break;case 53:Fe[Me-1].type="destroyParticipant",this.$=Fe[Me-1];break;case 54:Fe[Me-3].draw="participant",Fe[Me-3].type="addParticipant",Fe[Me-3].description=Ge.parseMessage(Fe[Me-1]),this.$=Fe[Me-3];break;case 55:Fe[Me-1].draw="participant",Fe[Me-1].type="addParticipant",this.$=Fe[Me-1];break;case 56:Fe[Me-3].draw="actor",Fe[Me-3].type="addParticipant",Fe[Me-3].description=Ge.parseMessage(Fe[Me-1]),this.$=Fe[Me-3];break;case 58:this.$=[Fe[Me-1],{type:"addNote",placement:Fe[Me-2],actor:Fe[Me-1].actor,text:Fe[Me]}];break;case 59:Fe[Me-2]=[].concat(Fe[Me-1],Fe[Me-1]).slice(0,2),Fe[Me-2][0]=Fe[Me-2][0].actor,Fe[Me-2][1]=Fe[Me-2][1].actor,this.$=[Fe[Me-1],{type:"addNote",placement:Ge.PLACEMENT.OVER,actor:Fe[Me-2].slice(0,2),text:Fe[Me]}];break;case 60:this.$=[Fe[Me-1],{type:"addLinks",actor:Fe[Me-1].actor,text:Fe[Me]}];break;case 61:this.$=[Fe[Me-1],{type:"addALink",actor:Fe[Me-1].actor,text:Fe[Me]}];break;case 62:this.$=[Fe[Me-1],{type:"addProperties",actor:Fe[Me-1].actor,text:Fe[Me]}];break;case 63:this.$=[Fe[Me-1],{type:"addDetails",actor:Fe[Me-1].actor,text:Fe[Me]}];break;case 66:this.$=[Fe[Me-2],Fe[Me]];break;case 67:this.$=Fe[Me];break;case 68:this.$=Ge.PLACEMENT.LEFTOF;break;case 69:this.$=Ge.PLACEMENT.RIGHTOF;break;case 70:this.$=[Fe[Me-4],Fe[Me-1],{type:"addMessage",from:Fe[Me-4].actor,to:Fe[Me-1].actor,signalType:Fe[Me-3],msg:Fe[Me],activate:!0},{type:"activeStart",signalType:Ge.LINETYPE.ACTIVE_START,actor:Fe[Me-1].actor}];break;case 71:this.$=[Fe[Me-4],Fe[Me-1],{type:"addMessage",from:Fe[Me-4].actor,to:Fe[Me-1].actor,signalType:Fe[Me-3],msg:Fe[Me]},{type:"activeEnd",signalType:Ge.LINETYPE.ACTIVE_END,actor:Fe[Me-4].actor}];break;case 72:this.$=[Fe[Me-4],Fe[Me-1],{type:"addMessage",from:Fe[Me-4].actor,to:Fe[Me-1].actor,signalType:Fe[Me-3],msg:Fe[Me],activate:!0,centralConnection:Ge.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:Ge.LINETYPE.CENTRAL_CONNECTION,actor:Fe[Me-1].actor}];break;case 73:this.$=[Fe[Me-4],Fe[Me-1],{type:"addMessage",from:Fe[Me-4].actor,to:Fe[Me-1].actor,signalType:Fe[Me-2],msg:Fe[Me],activate:!1,centralConnection:Ge.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:Ge.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Fe[Me-4].actor}];break;case 74:this.$=[Fe[Me-5],Fe[Me-1],{type:"addMessage",from:Fe[Me-5].actor,to:Fe[Me-1].actor,signalType:Fe[Me-3],msg:Fe[Me],activate:!0,centralConnection:Ge.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:Ge.LINETYPE.CENTRAL_CONNECTION,actor:Fe[Me-1].actor},{type:"centralConnectionReverse",signalType:Ge.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Fe[Me-5].actor}];break;case 75:this.$=[Fe[Me-3],Fe[Me-1],{type:"addMessage",from:Fe[Me-3].actor,to:Fe[Me-1].actor,signalType:Fe[Me-2],msg:Fe[Me]}];break;case 76:this.$={type:"addParticipant",actor:Fe[Me-1],config:Fe[Me]};break;case 77:this.$=Fe[Me-1].trim();break;case 78:this.$={type:"addParticipant",actor:Fe[Me]};break;case 79:this.$=Ge.LINETYPE.SOLID_OPEN;break;case 80:this.$=Ge.LINETYPE.DOTTED_OPEN;break;case 81:this.$=Ge.LINETYPE.SOLID;break;case 82:this.$=Ge.LINETYPE.SOLID_TOP;break;case 83:this.$=Ge.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=Ge.LINETYPE.STICK_TOP;break;case 85:this.$=Ge.LINETYPE.STICK_BOTTOM;break;case 86:this.$=Ge.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=Ge.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=Ge.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=Ge.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=Ge.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=Ge.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=Ge.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=Ge.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=Ge.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=Ge.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=Ge.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=Ge.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=Ge.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=Ge.LINETYPE.DOTTED;break;case 100:this.$=Ge.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=Ge.LINETYPE.SOLID_CROSS;break;case 102:this.$=Ge.LINETYPE.DOTTED_CROSS;break;case 103:this.$=Ge.LINETYPE.SOLID_POINT;break;case 104:this.$=Ge.LINETYPE.DOTTED_POINT;break;case 105:this.$=Ge.parseMessage(Fe[Me].trim().substring(1));break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:v,36:y,37:b,38:x,39:w,40:A,42:T,44:S,45:O,47:k,51:E,53:_,54:I,56:L,61:R,62:D,63:M,64:P,73:N},t(F,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:v,36:y,37:b,38:x,39:w,40:A,42:T,44:S,45:O,47:k,51:E,53:_,54:I,56:L,61:R,62:D,63:M,64:P,73:N},t(F,[2,7]),t(F,[2,8]),t(F,[2,9]),t(F,[2,15]),{13:49,51:E,53:_,54:I},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:N},{23:56,73:N},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},t(F,[2,30]),t(F,[2,31]),{33:[1,62]},{35:[1,63]},t(F,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:B},{23:75,55:76,73:B},{23:77,73:N},{69:78,72:[1,79],78:V,79:z,80:U,81:Q,82:G,83:X,84:Y,85:le,86:q,87:Z,88:ee,89:re,90:ve,91:ae,92:Ce,93:Oe,94:$e,95:he,96:fe,97:Te,98:ge,99:Qe,100:Se,101:De,102:qe,103:K},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:N},{23:111,73:N},{23:112,73:N},{23:113,73:N},t([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],ce),t(F,[2,6]),t(F,[2,16]),t(be,[2,10],{11:114}),t(F,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},t(F,[2,22]),{5:[1,118]},{5:[1,119]},t(F,[2,25]),t(F,[2,26]),t(F,[2,27]),t(F,[2,28]),t(F,[2,29]),t(F,[2,32]),t(F,[2,33]),t(ne,i,{7:120}),t(ne,i,{7:121}),t(ne,i,{7:122}),t(j,i,{41:123,7:124}),t(ie,i,{43:125,7:126}),t(ie,i,{7:126,43:127}),t(pe,i,{46:128,7:129}),t(ne,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(te,ce,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:N},{69:146,78:V,79:z,80:U,81:Q,82:G,83:X,84:Y,85:le,86:q,87:Z,88:ee,89:re,90:ve,91:ae,92:Ce,93:Oe,94:$e,95:he,96:fe,97:Te,98:ge,99:Qe,100:Se,101:De,102:qe,103:K},t(ye,[2,79]),t(ye,[2,80]),t(ye,[2,81]),t(ye,[2,82]),t(ye,[2,83]),t(ye,[2,84]),t(ye,[2,85]),t(ye,[2,86]),t(ye,[2,87]),t(ye,[2,88]),t(ye,[2,89]),t(ye,[2,90]),t(ye,[2,91]),t(ye,[2,92]),t(ye,[2,93]),t(ye,[2,94]),t(ye,[2,95]),t(ye,[2,96]),t(ye,[2,97]),t(ye,[2,98]),t(ye,[2,99]),t(ye,[2,100]),t(ye,[2,101]),t(ye,[2,102]),t(ye,[2,103]),t(ye,[2,104]),{23:147,73:N},{23:149,60:148,73:N},{73:[2,68]},{73:[2,69]},{58:150,104:oe},{58:152,104:oe},{58:153,104:oe},{58:154,104:oe},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:E,53:_,54:I},{5:[1,160]},t(F,[2,20]),t(F,[2,21]),t(F,[2,23]),t(F,[2,24]),{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,161],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:v,36:y,37:b,38:x,39:w,40:A,42:T,44:S,45:O,47:k,51:E,53:_,54:I,56:L,61:R,62:D,63:M,64:P,73:N},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,162],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:v,36:y,37:b,38:x,39:w,40:A,42:T,44:S,45:O,47:k,51:E,53:_,54:I,56:L,61:R,62:D,63:M,64:P,73:N},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,163],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:v,36:y,37:b,38:x,39:w,40:A,42:T,44:S,45:O,47:k,51:E,53:_,54:I,56:L,61:R,62:D,63:M,64:P,73:N},{17:[1,164]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,47],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:v,36:y,37:b,38:x,39:w,40:A,42:T,44:S,45:O,47:k,50:[1,165],51:E,53:_,54:I,56:L,61:R,62:D,63:M,64:P,73:N},{17:[1,166]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,45],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:v,36:y,37:b,38:x,39:w,40:A,42:T,44:S,45:O,47:k,49:[1,167],51:E,53:_,54:I,56:L,61:R,62:D,63:M,64:P,73:N},{17:[1,168]},{17:[1,169]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,43],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:v,36:y,37:b,38:x,39:w,40:A,42:T,44:S,45:O,47:k,48:[1,170],51:E,53:_,54:I,56:L,61:R,62:D,63:M,64:P,73:N},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,171],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:v,36:y,37:b,38:x,39:w,40:A,42:T,44:S,45:O,47:k,51:E,53:_,54:I,56:L,61:R,62:D,63:M,64:P,73:N},{16:[1,172]},t(F,[2,50]),{16:[1,173]},t(F,[2,55]),t(te,[2,76]),{76:[1,174]},{16:[1,175]},t(F,[2,52]),{16:[1,176]},t(F,[2,57]),t(F,[2,53]),{23:177,73:N},{23:178,73:N},{23:179,73:N},{58:180,104:oe},{23:181,72:[1,182],73:N},{58:183,104:oe},{58:184,104:oe},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},t(F,[2,17]),t(be,[2,11]),{13:186,51:E,53:_,54:I},t(be,[2,13]),t(be,[2,14]),t(F,[2,19]),t(F,[2,35]),t(F,[2,36]),t(F,[2,37]),t(F,[2,38]),{16:[1,187]},t(F,[2,39]),{16:[1,188]},t(F,[2,40]),t(F,[2,41]),{16:[1,189]},t(F,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:oe},{58:196,104:oe},{58:197,104:oe},{5:[2,75]},{58:198,104:oe},{23:199,73:N},{5:[2,58]},{5:[2,59]},{23:200,73:N},t(be,[2,12]),t(j,i,{7:124,41:201}),t(ie,i,{7:126,43:202}),t(pe,i,{7:129,46:203}),t(F,[2,49]),t(F,[2,54]),t(te,[2,77]),t(F,[2,51]),t(F,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:oe},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:C(function(Xe,Ne){if(Ne.recoverable)this.trace(Xe);else{var Ze=new Error(Xe);throw Ze.hash=Ne,Ze}},"parseError"),parse:C(function(Xe){var Ne=this,Ze=[0],Ge=[],lt=[null],Fe=[],wt=this.table,Me="",Rt=0,Lt=0,ut=2,Xt=1,Ft=Fe.slice.call(arguments,1),gt=Object.create(this.lexer),Ae={yy:{}};for(var zt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,zt)&&(Ae.yy[zt]=this.yy[zt]);gt.setInput(Xe,Ae.yy),Ae.yy.lexer=gt,Ae.yy.parser=this,typeof gt.yylloc>"u"&&(gt.yylloc={});var kt=gt.yylloc;Fe.push(kt);var At=gt.options&>.options.ranges;typeof Ae.yy.parseError=="function"?this.parseError=Ae.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Mt(Nr){Ze.length=Ze.length-2*Nr,lt.length=lt.length-Nr,Fe.length=Fe.length-Nr}C(Mt,"popStack");function jr(){var Nr;return Nr=Ge.pop()||gt.lex()||Xt,typeof Nr!="number"&&(Nr instanceof Array&&(Ge=Nr,Nr=Ge.pop()),Nr=Ne.symbols_[Nr]||Nr),Nr}C(jr,"lex");for(var Re,at,xt,Ct,gr={},Xr,$r,un,zr;;){if(at=Ze[Ze.length-1],this.defaultActions[at]?xt=this.defaultActions[at]:((Re===null||typeof Re>"u")&&(Re=jr()),xt=wt[at]&&wt[at][Re]),typeof xt>"u"||!xt.length||!xt[0]){var On="";zr=[];for(Xr in wt[at])this.terminals_[Xr]&&Xr>ut&&zr.push("'"+this.terminals_[Xr]+"'");gt.showPosition?On="Parse error on line "+(Rt+1)+`: +`},"getStyles"),PHn=IHn,ZYt={};wq(ZYt,{draw:()=>NHn});var NHn=C(async function(t,e,r,n){me.info("REF0:"),me.info("Drawing requirement diagram (unified)",e);const{securityLevel:i,state:a,layout:s,look:o}=He(),l=n.db.getData(),u=z3(e,i);l.type=n.type,l.layoutAlgorithm=R7(s),l.nodeSpacing=(a==null?void 0:a.nodeSpacing)??50,l.rankSpacing=(a==null?void 0:a.rankSpacing)??50,l.markers=o==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],l.diagramId=e,await e4(l,u);const h=8;ln.insertTitle(u,"requirementDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),IC(u,h,"requirementDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),BHn={parser:DHn,get db(){return new LHn},renderer:ZYt,styles:PHn};const $Hn=Object.freeze(Object.defineProperty({__proto__:null,diagram:BHn},Symbol.toStringTag,{value:"Module"}));var QRe=function(){var t=C(function(Pe,Xe,Ne,Ze){for(Ne=Ne||{},Ze=Pe.length;Ze--;Ne[Pe[Ze]]=Xe);return Ne},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],o=[1,12],l=[1,14],u=[1,15],h=[1,17],d=[1,18],f=[1,19],p=[1,25],g=[1,26],m=[1,27],v=[1,28],y=[1,29],b=[1,30],x=[1,31],w=[1,32],A=[1,33],S=[1,34],T=[1,35],O=[1,36],k=[1,37],E=[1,38],_=[1,39],I=[1,40],L=[1,42],R=[1,43],D=[1,44],M=[1,45],P=[1,46],N=[1,47],F=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],B=[1,74],V=[1,80],z=[1,81],U=[1,82],Q=[1,83],G=[1,84],X=[1,85],Y=[1,86],le=[1,87],q=[1,88],Z=[1,89],ee=[1,90],re=[1,91],ve=[1,92],ae=[1,93],Ce=[1,94],Oe=[1,95],$e=[1,96],he=[1,97],fe=[1,98],Se=[1,99],ge=[1,100],Qe=[1,101],Te=[1,102],De=[1,103],qe=[1,104],K=[1,105],ce=[2,78],be=[4,5,17,51,53,54],ne=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],j=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],ie=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],pe=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],te=[5,52],ye=[70,71,72,73],oe=[1,151],_e={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:C(function(Xe,Ne,Ze,Ge,lt,Fe,wt){var Me=Fe.length-1;switch(lt){case 3:return Ge.apply(Fe[Me]),Fe[Me];case 4:case 10:this.$=[];break;case 5:case 11:Fe[Me-1].push(Fe[Me]),this.$=Fe[Me-1];break;case 6:case 7:case 12:case 13:this.$=Fe[Me];break;case 8:case 9:case 14:this.$=[];break;case 16:Fe[Me].type="createParticipant",this.$=Fe[Me];break;case 17:Fe[Me-1].unshift({type:"boxStart",boxData:Ge.parseBoxData(Fe[Me-2])}),Fe[Me-1].push({type:"boxEnd",boxText:Fe[Me-2]}),this.$=Fe[Me-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(Fe[Me-2]),sequenceIndexStep:Number(Fe[Me-1]),sequenceVisible:!0,signalType:Ge.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(Fe[Me-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:Ge.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:Ge.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:Ge.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:Ge.LINETYPE.ACTIVE_START,actor:Fe[Me-1].actor};break;case 24:this.$={type:"activeEnd",signalType:Ge.LINETYPE.ACTIVE_END,actor:Fe[Me-1].actor};break;case 30:Ge.setDiagramTitle(Fe[Me].substring(6)),this.$=Fe[Me].substring(6);break;case 31:Ge.setDiagramTitle(Fe[Me].substring(7)),this.$=Fe[Me].substring(7);break;case 32:this.$=Fe[Me].trim(),Ge.setAccTitle(this.$);break;case 33:case 34:this.$=Fe[Me].trim(),Ge.setAccDescription(this.$);break;case 35:Fe[Me-1].unshift({type:"loopStart",loopText:Ge.parseMessage(Fe[Me-2]),signalType:Ge.LINETYPE.LOOP_START}),Fe[Me-1].push({type:"loopEnd",loopText:Fe[Me-2],signalType:Ge.LINETYPE.LOOP_END}),this.$=Fe[Me-1];break;case 36:Fe[Me-1].unshift({type:"rectStart",color:Ge.parseMessage(Fe[Me-2]),signalType:Ge.LINETYPE.RECT_START}),Fe[Me-1].push({type:"rectEnd",color:Ge.parseMessage(Fe[Me-2]),signalType:Ge.LINETYPE.RECT_END}),this.$=Fe[Me-1];break;case 37:Fe[Me-1].unshift({type:"optStart",optText:Ge.parseMessage(Fe[Me-2]),signalType:Ge.LINETYPE.OPT_START}),Fe[Me-1].push({type:"optEnd",optText:Ge.parseMessage(Fe[Me-2]),signalType:Ge.LINETYPE.OPT_END}),this.$=Fe[Me-1];break;case 38:Fe[Me-1].unshift({type:"altStart",altText:Ge.parseMessage(Fe[Me-2]),signalType:Ge.LINETYPE.ALT_START}),Fe[Me-1].push({type:"altEnd",signalType:Ge.LINETYPE.ALT_END}),this.$=Fe[Me-1];break;case 39:Fe[Me-1].unshift({type:"parStart",parText:Ge.parseMessage(Fe[Me-2]),signalType:Ge.LINETYPE.PAR_START}),Fe[Me-1].push({type:"parEnd",signalType:Ge.LINETYPE.PAR_END}),this.$=Fe[Me-1];break;case 40:Fe[Me-1].unshift({type:"parStart",parText:Ge.parseMessage(Fe[Me-2]),signalType:Ge.LINETYPE.PAR_OVER_START}),Fe[Me-1].push({type:"parEnd",signalType:Ge.LINETYPE.PAR_END}),this.$=Fe[Me-1];break;case 41:Fe[Me-1].unshift({type:"criticalStart",criticalText:Ge.parseMessage(Fe[Me-2]),signalType:Ge.LINETYPE.CRITICAL_START}),Fe[Me-1].push({type:"criticalEnd",signalType:Ge.LINETYPE.CRITICAL_END}),this.$=Fe[Me-1];break;case 42:Fe[Me-1].unshift({type:"breakStart",breakText:Ge.parseMessage(Fe[Me-2]),signalType:Ge.LINETYPE.BREAK_START}),Fe[Me-1].push({type:"breakEnd",optText:Ge.parseMessage(Fe[Me-2]),signalType:Ge.LINETYPE.BREAK_END}),this.$=Fe[Me-1];break;case 44:this.$=Fe[Me-3].concat([{type:"option",optionText:Ge.parseMessage(Fe[Me-1]),signalType:Ge.LINETYPE.CRITICAL_OPTION},Fe[Me]]);break;case 46:this.$=Fe[Me-3].concat([{type:"and",parText:Ge.parseMessage(Fe[Me-1]),signalType:Ge.LINETYPE.PAR_AND},Fe[Me]]);break;case 48:this.$=Fe[Me-3].concat([{type:"else",altText:Ge.parseMessage(Fe[Me-1]),signalType:Ge.LINETYPE.ALT_ELSE},Fe[Me]]);break;case 49:Fe[Me-3].draw="participant",Fe[Me-3].type="addParticipant",Fe[Me-3].description=Ge.parseMessage(Fe[Me-1]),this.$=Fe[Me-3];break;case 50:Fe[Me-1].draw="participant",Fe[Me-1].type="addParticipant",this.$=Fe[Me-1];break;case 51:Fe[Me-3].draw="actor",Fe[Me-3].type="addParticipant",Fe[Me-3].description=Ge.parseMessage(Fe[Me-1]),this.$=Fe[Me-3];break;case 52:case 57:Fe[Me-1].draw="actor",Fe[Me-1].type="addParticipant",this.$=Fe[Me-1];break;case 53:Fe[Me-1].type="destroyParticipant",this.$=Fe[Me-1];break;case 54:Fe[Me-3].draw="participant",Fe[Me-3].type="addParticipant",Fe[Me-3].description=Ge.parseMessage(Fe[Me-1]),this.$=Fe[Me-3];break;case 55:Fe[Me-1].draw="participant",Fe[Me-1].type="addParticipant",this.$=Fe[Me-1];break;case 56:Fe[Me-3].draw="actor",Fe[Me-3].type="addParticipant",Fe[Me-3].description=Ge.parseMessage(Fe[Me-1]),this.$=Fe[Me-3];break;case 58:this.$=[Fe[Me-1],{type:"addNote",placement:Fe[Me-2],actor:Fe[Me-1].actor,text:Fe[Me]}];break;case 59:Fe[Me-2]=[].concat(Fe[Me-1],Fe[Me-1]).slice(0,2),Fe[Me-2][0]=Fe[Me-2][0].actor,Fe[Me-2][1]=Fe[Me-2][1].actor,this.$=[Fe[Me-1],{type:"addNote",placement:Ge.PLACEMENT.OVER,actor:Fe[Me-2].slice(0,2),text:Fe[Me]}];break;case 60:this.$=[Fe[Me-1],{type:"addLinks",actor:Fe[Me-1].actor,text:Fe[Me]}];break;case 61:this.$=[Fe[Me-1],{type:"addALink",actor:Fe[Me-1].actor,text:Fe[Me]}];break;case 62:this.$=[Fe[Me-1],{type:"addProperties",actor:Fe[Me-1].actor,text:Fe[Me]}];break;case 63:this.$=[Fe[Me-1],{type:"addDetails",actor:Fe[Me-1].actor,text:Fe[Me]}];break;case 66:this.$=[Fe[Me-2],Fe[Me]];break;case 67:this.$=Fe[Me];break;case 68:this.$=Ge.PLACEMENT.LEFTOF;break;case 69:this.$=Ge.PLACEMENT.RIGHTOF;break;case 70:this.$=[Fe[Me-4],Fe[Me-1],{type:"addMessage",from:Fe[Me-4].actor,to:Fe[Me-1].actor,signalType:Fe[Me-3],msg:Fe[Me],activate:!0},{type:"activeStart",signalType:Ge.LINETYPE.ACTIVE_START,actor:Fe[Me-1].actor}];break;case 71:this.$=[Fe[Me-4],Fe[Me-1],{type:"addMessage",from:Fe[Me-4].actor,to:Fe[Me-1].actor,signalType:Fe[Me-3],msg:Fe[Me]},{type:"activeEnd",signalType:Ge.LINETYPE.ACTIVE_END,actor:Fe[Me-4].actor}];break;case 72:this.$=[Fe[Me-4],Fe[Me-1],{type:"addMessage",from:Fe[Me-4].actor,to:Fe[Me-1].actor,signalType:Fe[Me-3],msg:Fe[Me],activate:!0,centralConnection:Ge.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:Ge.LINETYPE.CENTRAL_CONNECTION,actor:Fe[Me-1].actor}];break;case 73:this.$=[Fe[Me-4],Fe[Me-1],{type:"addMessage",from:Fe[Me-4].actor,to:Fe[Me-1].actor,signalType:Fe[Me-2],msg:Fe[Me],activate:!1,centralConnection:Ge.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:Ge.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Fe[Me-4].actor}];break;case 74:this.$=[Fe[Me-5],Fe[Me-1],{type:"addMessage",from:Fe[Me-5].actor,to:Fe[Me-1].actor,signalType:Fe[Me-3],msg:Fe[Me],activate:!0,centralConnection:Ge.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:Ge.LINETYPE.CENTRAL_CONNECTION,actor:Fe[Me-1].actor},{type:"centralConnectionReverse",signalType:Ge.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Fe[Me-5].actor}];break;case 75:this.$=[Fe[Me-3],Fe[Me-1],{type:"addMessage",from:Fe[Me-3].actor,to:Fe[Me-1].actor,signalType:Fe[Me-2],msg:Fe[Me]}];break;case 76:this.$={type:"addParticipant",actor:Fe[Me-1],config:Fe[Me]};break;case 77:this.$=Fe[Me-1].trim();break;case 78:this.$={type:"addParticipant",actor:Fe[Me]};break;case 79:this.$=Ge.LINETYPE.SOLID_OPEN;break;case 80:this.$=Ge.LINETYPE.DOTTED_OPEN;break;case 81:this.$=Ge.LINETYPE.SOLID;break;case 82:this.$=Ge.LINETYPE.SOLID_TOP;break;case 83:this.$=Ge.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=Ge.LINETYPE.STICK_TOP;break;case 85:this.$=Ge.LINETYPE.STICK_BOTTOM;break;case 86:this.$=Ge.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=Ge.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=Ge.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=Ge.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=Ge.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=Ge.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=Ge.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=Ge.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=Ge.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=Ge.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=Ge.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=Ge.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=Ge.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=Ge.LINETYPE.DOTTED;break;case 100:this.$=Ge.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=Ge.LINETYPE.SOLID_CROSS;break;case 102:this.$=Ge.LINETYPE.DOTTED_CROSS;break;case 103:this.$=Ge.LINETYPE.SOLID_POINT;break;case 104:this.$=Ge.LINETYPE.DOTTED_POINT;break;case 105:this.$=Ge.parseMessage(Fe[Me].trim().substring(1));break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:v,36:y,37:b,38:x,39:w,40:A,42:S,44:T,45:O,47:k,51:E,53:_,54:I,56:L,61:R,62:D,63:M,64:P,73:N},t(F,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:v,36:y,37:b,38:x,39:w,40:A,42:S,44:T,45:O,47:k,51:E,53:_,54:I,56:L,61:R,62:D,63:M,64:P,73:N},t(F,[2,7]),t(F,[2,8]),t(F,[2,9]),t(F,[2,15]),{13:49,51:E,53:_,54:I},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:N},{23:56,73:N},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},t(F,[2,30]),t(F,[2,31]),{33:[1,62]},{35:[1,63]},t(F,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:B},{23:75,55:76,73:B},{23:77,73:N},{69:78,72:[1,79],78:V,79:z,80:U,81:Q,82:G,83:X,84:Y,85:le,86:q,87:Z,88:ee,89:re,90:ve,91:ae,92:Ce,93:Oe,94:$e,95:he,96:fe,97:Se,98:ge,99:Qe,100:Te,101:De,102:qe,103:K},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:N},{23:111,73:N},{23:112,73:N},{23:113,73:N},t([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],ce),t(F,[2,6]),t(F,[2,16]),t(be,[2,10],{11:114}),t(F,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},t(F,[2,22]),{5:[1,118]},{5:[1,119]},t(F,[2,25]),t(F,[2,26]),t(F,[2,27]),t(F,[2,28]),t(F,[2,29]),t(F,[2,32]),t(F,[2,33]),t(ne,i,{7:120}),t(ne,i,{7:121}),t(ne,i,{7:122}),t(j,i,{41:123,7:124}),t(ie,i,{43:125,7:126}),t(ie,i,{7:126,43:127}),t(pe,i,{46:128,7:129}),t(ne,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(te,ce,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:N},{69:146,78:V,79:z,80:U,81:Q,82:G,83:X,84:Y,85:le,86:q,87:Z,88:ee,89:re,90:ve,91:ae,92:Ce,93:Oe,94:$e,95:he,96:fe,97:Se,98:ge,99:Qe,100:Te,101:De,102:qe,103:K},t(ye,[2,79]),t(ye,[2,80]),t(ye,[2,81]),t(ye,[2,82]),t(ye,[2,83]),t(ye,[2,84]),t(ye,[2,85]),t(ye,[2,86]),t(ye,[2,87]),t(ye,[2,88]),t(ye,[2,89]),t(ye,[2,90]),t(ye,[2,91]),t(ye,[2,92]),t(ye,[2,93]),t(ye,[2,94]),t(ye,[2,95]),t(ye,[2,96]),t(ye,[2,97]),t(ye,[2,98]),t(ye,[2,99]),t(ye,[2,100]),t(ye,[2,101]),t(ye,[2,102]),t(ye,[2,103]),t(ye,[2,104]),{23:147,73:N},{23:149,60:148,73:N},{73:[2,68]},{73:[2,69]},{58:150,104:oe},{58:152,104:oe},{58:153,104:oe},{58:154,104:oe},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:E,53:_,54:I},{5:[1,160]},t(F,[2,20]),t(F,[2,21]),t(F,[2,23]),t(F,[2,24]),{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,161],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:v,36:y,37:b,38:x,39:w,40:A,42:S,44:T,45:O,47:k,51:E,53:_,54:I,56:L,61:R,62:D,63:M,64:P,73:N},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,162],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:v,36:y,37:b,38:x,39:w,40:A,42:S,44:T,45:O,47:k,51:E,53:_,54:I,56:L,61:R,62:D,63:M,64:P,73:N},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,163],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:v,36:y,37:b,38:x,39:w,40:A,42:S,44:T,45:O,47:k,51:E,53:_,54:I,56:L,61:R,62:D,63:M,64:P,73:N},{17:[1,164]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,47],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:v,36:y,37:b,38:x,39:w,40:A,42:S,44:T,45:O,47:k,50:[1,165],51:E,53:_,54:I,56:L,61:R,62:D,63:M,64:P,73:N},{17:[1,166]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,45],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:v,36:y,37:b,38:x,39:w,40:A,42:S,44:T,45:O,47:k,49:[1,167],51:E,53:_,54:I,56:L,61:R,62:D,63:M,64:P,73:N},{17:[1,168]},{17:[1,169]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,43],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:v,36:y,37:b,38:x,39:w,40:A,42:S,44:T,45:O,47:k,48:[1,170],51:E,53:_,54:I,56:L,61:R,62:D,63:M,64:P,73:N},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,171],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:v,36:y,37:b,38:x,39:w,40:A,42:S,44:T,45:O,47:k,51:E,53:_,54:I,56:L,61:R,62:D,63:M,64:P,73:N},{16:[1,172]},t(F,[2,50]),{16:[1,173]},t(F,[2,55]),t(te,[2,76]),{76:[1,174]},{16:[1,175]},t(F,[2,52]),{16:[1,176]},t(F,[2,57]),t(F,[2,53]),{23:177,73:N},{23:178,73:N},{23:179,73:N},{58:180,104:oe},{23:181,72:[1,182],73:N},{58:183,104:oe},{58:184,104:oe},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},t(F,[2,17]),t(be,[2,11]),{13:186,51:E,53:_,54:I},t(be,[2,13]),t(be,[2,14]),t(F,[2,19]),t(F,[2,35]),t(F,[2,36]),t(F,[2,37]),t(F,[2,38]),{16:[1,187]},t(F,[2,39]),{16:[1,188]},t(F,[2,40]),t(F,[2,41]),{16:[1,189]},t(F,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:oe},{58:196,104:oe},{58:197,104:oe},{5:[2,75]},{58:198,104:oe},{23:199,73:N},{5:[2,58]},{5:[2,59]},{23:200,73:N},t(be,[2,12]),t(j,i,{7:124,41:201}),t(ie,i,{7:126,43:202}),t(pe,i,{7:129,46:203}),t(F,[2,49]),t(F,[2,54]),t(te,[2,77]),t(F,[2,51]),t(F,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:oe},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:C(function(Xe,Ne){if(Ne.recoverable)this.trace(Xe);else{var Ze=new Error(Xe);throw Ze.hash=Ne,Ze}},"parseError"),parse:C(function(Xe){var Ne=this,Ze=[0],Ge=[],lt=[null],Fe=[],wt=this.table,Me="",Rt=0,Lt=0,ut=2,Xt=1,Ft=Fe.slice.call(arguments,1),gt=Object.create(this.lexer),Ae={yy:{}};for(var zt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,zt)&&(Ae.yy[zt]=this.yy[zt]);gt.setInput(Xe,Ae.yy),Ae.yy.lexer=gt,Ae.yy.parser=this,typeof gt.yylloc>"u"&&(gt.yylloc={});var kt=gt.yylloc;Fe.push(kt);var At=gt.options&>.options.ranges;typeof Ae.yy.parseError=="function"?this.parseError=Ae.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Mt(Nr){Ze.length=Ze.length-2*Nr,lt.length=lt.length-Nr,Fe.length=Fe.length-Nr}C(Mt,"popStack");function jr(){var Nr;return Nr=Ge.pop()||gt.lex()||Xt,typeof Nr!="number"&&(Nr instanceof Array&&(Ge=Nr,Nr=Ge.pop()),Nr=Ne.symbols_[Nr]||Nr),Nr}C(jr,"lex");for(var Re,at,xt,Ct,gr={},Xr,$r,un,zr;;){if(at=Ze[Ze.length-1],this.defaultActions[at]?xt=this.defaultActions[at]:((Re===null||typeof Re>"u")&&(Re=jr()),xt=wt[at]&&wt[at][Re]),typeof xt>"u"||!xt.length||!xt[0]){var On="";zr=[];for(Xr in wt[at])this.terminals_[Xr]&&Xr>ut&&zr.push("'"+this.terminals_[Xr]+"'");gt.showPosition?On="Parse error on line "+(Rt+1)+`: `+gt.showPosition()+` Expecting `+zr.join(", ")+", got '"+(this.terminals_[Re]||Re)+"'":On="Parse error on line "+(Rt+1)+": Unexpected "+(Re==Xt?"end of input":"'"+(this.terminals_[Re]||Re)+"'"),this.parseError(On,{text:gt.match,token:this.terminals_[Re]||Re,line:gt.yylineno,loc:kt,expected:zr})}if(xt[0]instanceof Array&&xt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+at+", token: "+Re);switch(xt[0]){case 1:Ze.push(Re),lt.push(gt.yytext),Fe.push(gt.yylloc),Ze.push(xt[1]),Re=null,Lt=gt.yyleng,Me=gt.yytext,Rt=gt.yylineno,kt=gt.yylloc;break;case 2:if($r=this.productions_[xt[1]][1],gr.$=lt[lt.length-$r],gr._$={first_line:Fe[Fe.length-($r||1)].first_line,last_line:Fe[Fe.length-1].last_line,first_column:Fe[Fe.length-($r||1)].first_column,last_column:Fe[Fe.length-1].last_column},At&&(gr._$.range=[Fe[Fe.length-($r||1)].range[0],Fe[Fe.length-1].range[1]]),Ct=this.performAction.apply(gr,[Me,Lt,Rt,Ae.yy,xt[1],lt,Fe].concat(Ft)),typeof Ct<"u")return Ct;$r&&(Ze=Ze.slice(0,-1*$r*2),lt=lt.slice(0,-1*$r),Fe=Fe.slice(0,-1*$r)),Ze.push(this.productions_[xt[1]][0]),lt.push(gr.$),Fe.push(gr._$),un=wt[Ze[Ze.length-2]][Ze[Ze.length-1]],Ze.push(un);break;case 3:return!0}}return!0},"parse")},Le=function(){var Pe={EOF:1,parseError:C(function(Ne,Ze){if(this.yy.parser)this.yy.parser.parseError(Ne,Ze);else throw new Error(Ne)},"parseError"),setInput:C(function(Xe,Ne){return this.yy=Ne||this.yy||{},this._input=Xe,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var Xe=this._input[0];this.yytext+=Xe,this.yyleng++,this.offset++,this.match+=Xe,this.matched+=Xe;var Ne=Xe.match(/(?:\r\n?|\n).*/g);return Ne?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Xe},"input"),unput:C(function(Xe){var Ne=Xe.length,Ze=Xe.split(/(?:\r\n?|\n)/g);this._input=Xe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ne),this.offset-=Ne;var Ge=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Ze.length-1&&(this.yylineno-=Ze.length-1);var lt=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Ze?(Ze.length===Ge.length?this.yylloc.first_column:0)+Ge[Ge.length-Ze.length].length-Ze[0].length:this.yylloc.first_column-Ne},this.options.ranges&&(this.yylloc.range=[lt[0],lt[0]+this.yyleng-Ne]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:C(function(Xe){this.unput(this.match.slice(Xe))},"less"),pastInput:C(function(){var Xe=this.matched.substr(0,this.matched.length-this.match.length);return(Xe.length>20?"...":"")+Xe.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:C(function(){var Xe=this.match;return Xe.length<20&&(Xe+=this._input.substr(0,20-Xe.length)),(Xe.substr(0,20)+(Xe.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:C(function(){var Xe=this.pastInput(),Ne=new Array(Xe.length+1).join("-");return Xe+this.upcomingInput()+` @@ -2426,20 +2426,20 @@ Expecting `+zr.join(", ")+", got '"+(this.terminals_[Re]||Re)+"'":On="Parse erro filter: ${e}; stroke: ${t.nodeBorder}; } -`},"getStyles"),HHn=GHn,VO=18*2,pw="actor-top",gw="actor-bottom",Ene="actor-box",QO="actor-man",J1=new Set(["redux-color","redux-dark-color"]),Sz=C(function(t,e){const r=Aee(t,e);return Dr().look==="neo"&&r.attr("data-look","neo"),r},"drawRect"),WHn=C(function(t,e,r,n,i){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0)return{height:0,width:0};const a=e.links,s=e.actorCnt,o=e.rectData;var l="none";i&&(l="block !important");const u=t.append("g");u.attr("id","actor"+s+"_popup"),u.attr("class","actorPopupMenu"),u.attr("display",l);var h="";o.class!==void 0&&(h=" "+o.class);let d=o.width>r?o.width:r;const f=u.append("rect");if(f.attr("class","actorPopupMenuPanel"+h),f.attr("x",o.x),f.attr("y",o.height),f.attr("fill",o.fill),f.attr("stroke",o.stroke),f.attr("width",d),f.attr("height",o.height),f.attr("rx",o.rx),f.attr("ry",o.ry),a!=null){var p=20;for(let v in a){var g=u.append("a"),m=_S(a[v]);g.attr("xlink:href",m),g.attr("target","_blank"),gWn(n)(v,g,o.x+10,o.height+p,d,20,{class:"actor"},n),p+=30}}return f.attr("height",p),{height:o.height+p,width:d}},"drawPopup"),_ne=C(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),Rne=C(async function(t,e,r=null){let n=t.append("foreignObject");const i=await _q(e.text,Dr()),s=n.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(n.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),e.class==="noteText"){const o=t.node().firstChild;o.setAttribute("height",s.height+2*e.textMargin);const l=o.getBBox();n.attr("x",Math.round(l.x+l.width/2-s.width/2)).attr("y",Math.round(l.y+l.height/2-s.height/2))}else if(r){let{startx:o,stopx:l,starty:u}=r;if(o>l){const h=o;o=l,l=h}n.attr("x",Math.round(o+Math.abs(o-l)/2-s.width/2)),e.class==="loopText"?n.attr("y",Math.round(u)):n.attr("y",Math.round(u-s.height))}return[n]},"drawKatex"),qR=C(function(t,e){let r=0,n=0;const i=e.text.split(jt.lineBreakRegex),[a,s]=By(e.fontSize);let o=[],l=0,u=C(()=>e.y,"yfunc");if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":u=C(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":u=C(()=>Math.round(e.y+(r+n+e.textMargin)/2),"yfunc");break;case"bottom":case"end":u=C(()=>Math.round(e.y+(r+n+2*e.textMargin)-e.textMargin),"yfunc");break}if(e.anchor!==void 0&&e.textMargin!==void 0&&e.width!==void 0)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle";break}for(let[h,d]of i.entries()){e.textMargin!==void 0&&e.textMargin===0&&a!==void 0&&(l=h*a);const f=t.append("text");f.attr("x",e.x),f.attr("y",u()),e.anchor!==void 0&&f.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),e.fontFamily!==void 0&&f.style("font-family",e.fontFamily),s!==void 0&&f.style("font-size",s),e.fontWeight!==void 0&&f.style("font-weight",e.fontWeight),e.fill!==void 0&&f.attr("fill",e.fill),e.class!==void 0&&f.attr("class",e.class),e.dy!==void 0?f.attr("dy",e.dy):l!==0&&f.attr("dy",l);const p=d||Qyt;if(e.tspan){const g=f.append("tspan");g.attr("x",e.x),e.fill!==void 0&&g.attr("fill",e.fill),g.text(p)}else f.text(p);e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0&&(n+=(f._groups||f)[0][0].getBBox().height,r=n),o.push(f)}return o},"drawText"),JYt=C(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}C(r,"genPoints");const n=t.append("polygon");return n.attr("points",r(e.x,e.y,e.width,e.height,7)),n.attr("class","labelBox"),e.y=e.y+e.height/2,qR(t,e),n},"drawLabel"),bi=-1,eqt=C((t,e,r,n)=>{t.select&&r.forEach(i=>{const a=e.get(i),s=t.select("#actor"+a.actorCnt);!n.mirrorActors&&a.stopy?s.attr("y2",a.stopy+a.height/2):n.mirrorActors&&s.attr("y2",a.stopy)})},"fixLifeLineHeights"),YHn=C(function(t,e,r,n,i){var w,A;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(bi++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",_ne(`actor${bi}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+bi).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=bi,e.links!=null&&g.attr("id","root-"+bi),l==="neo"&&g.attr("data-look","neo"));const m=tf();var v="actor";(w=e.properties)!=null&&w.class?v=e.properties.class:m.fill="#eaeaea",n?v+=` ${gw}`:v+=` ${pw}`,m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.class=v,m.rx=3,m.ry=3,m.name=e.name,l==="neo"&&(m.rx=6,m.ry=6);const y=Sz(g,m),b=i.get(e.name)??0;if(J1.has(u)&&(y.style("stroke",f[b%f.length]),y.style("fill",d[b%f.length])),l==="neo"&&y.attr("filter","url(#drop-shadow)"),e.rectData=m,(A=e.properties)!=null&&A.icon){const T=e.properties.icon.trim();T.charAt(0)==="@"?kke(g,m.x+m.width-20,m.y+10,T.substr(1)):Oke(g,m.x+m.width-20,m.y+10,T)}n||(g.attr("data-et","participant"),g.attr("data-type","participant"),g.attr("data-id",e.name)),eb(r,io(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${Ene}`},r);let x=e.height;if(y.node){const T=y.node().getBBox();e.height=T.height,x=T.height}return x},"drawActorTypeParticipant"),qHn=C(function(t,e,r,n,i){var S,O;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(bi++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",_ne(`actor${bi}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+bi).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=bi,e.links!=null&&g.attr("id","root-"+bi),l==="neo"&&g.attr("data-look","neo"));const m=tf();var v="actor";(S=e.properties)!=null&&S.class?v=e.properties.class:m.fill="#eaeaea",n?v+=` ${gw}`:v+=` ${pw}`,m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.class=v,m.name=e.name;const y=6,b={...m,x:m.x+-y,y:m.y+ +y,class:"actor"},x=Sz(g,m),w=Sz(g,b);e.rectData=m,l==="neo"&&g.attr("filter","url(#drop-shadow)");const A=i.get(e.name)??0;if(J1.has(u)&&(x.style("stroke",f[A%f.length]),x.style("fill",d[A%f.length]),w.style("stroke",f[A%f.length]),w.style("fill",d[A%f.length])),(O=e.properties)!=null&&O.icon){const k=e.properties.icon.trim();k.charAt(0)==="@"?kke(g,m.x+m.width-20,m.y+10,k.substr(1)):Oke(g,m.x+m.width-20,m.y+10,k)}eb(r,io(e.description))(e.description,g,m.x-y,m.y+y,m.width,m.height,{class:`actor ${Ene}`},r);let T=e.height;if(x.node){const k=x.node().getBBox();e.height=k.height,T=k.height}return n||(g.attr("data-et","participant"),g.attr("data-type","collections"),g.attr("data-id",e.name)),T},"drawActorTypeCollections"),jHn=C(function(t,e,r,n,i){var k,E;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();let g=p;n||(bi++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",_ne(`actor${bi}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+bi).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=bi,e.links!=null&&g.attr("id","root-"+bi),l==="neo"&&g.attr("data-look","neo"));const m=tf();let v="actor";(k=e.properties)!=null&&k.class?v=e.properties.class:m.fill="#eaeaea",n?v+=` ${gw}`:v+=` ${pw}`,g.attr("class",v),m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.name=e.name;const y=m.height/2,b=y/(2.5+m.height/50),x=g.append("g"),w=g.append("g"),A=`M ${m.x},${m.y+y} +`},"getStyles"),HHn=GHn,VO=18*2,pw="actor-top",gw="actor-bottom",Ene="actor-box",QO="actor-man",J1=new Set(["redux-color","redux-dark-color"]),Tz=C(function(t,e){const r=Aee(t,e);return Dr().look==="neo"&&r.attr("data-look","neo"),r},"drawRect"),WHn=C(function(t,e,r,n,i){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0)return{height:0,width:0};const a=e.links,s=e.actorCnt,o=e.rectData;var l="none";i&&(l="block !important");const u=t.append("g");u.attr("id","actor"+s+"_popup"),u.attr("class","actorPopupMenu"),u.attr("display",l);var h="";o.class!==void 0&&(h=" "+o.class);let d=o.width>r?o.width:r;const f=u.append("rect");if(f.attr("class","actorPopupMenuPanel"+h),f.attr("x",o.x),f.attr("y",o.height),f.attr("fill",o.fill),f.attr("stroke",o.stroke),f.attr("width",d),f.attr("height",o.height),f.attr("rx",o.rx),f.attr("ry",o.ry),a!=null){var p=20;for(let v in a){var g=u.append("a"),m=_T(a[v]);g.attr("xlink:href",m),g.attr("target","_blank"),gWn(n)(v,g,o.x+10,o.height+p,d,20,{class:"actor"},n),p+=30}}return f.attr("height",p),{height:o.height+p,width:d}},"drawPopup"),_ne=C(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),Rne=C(async function(t,e,r=null){let n=t.append("foreignObject");const i=await _q(e.text,Dr()),s=n.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(n.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),e.class==="noteText"){const o=t.node().firstChild;o.setAttribute("height",s.height+2*e.textMargin);const l=o.getBBox();n.attr("x",Math.round(l.x+l.width/2-s.width/2)).attr("y",Math.round(l.y+l.height/2-s.height/2))}else if(r){let{startx:o,stopx:l,starty:u}=r;if(o>l){const h=o;o=l,l=h}n.attr("x",Math.round(o+Math.abs(o-l)/2-s.width/2)),e.class==="loopText"?n.attr("y",Math.round(u)):n.attr("y",Math.round(u-s.height))}return[n]},"drawKatex"),qR=C(function(t,e){let r=0,n=0;const i=e.text.split(jt.lineBreakRegex),[a,s]=By(e.fontSize);let o=[],l=0,u=C(()=>e.y,"yfunc");if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":u=C(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":u=C(()=>Math.round(e.y+(r+n+e.textMargin)/2),"yfunc");break;case"bottom":case"end":u=C(()=>Math.round(e.y+(r+n+2*e.textMargin)-e.textMargin),"yfunc");break}if(e.anchor!==void 0&&e.textMargin!==void 0&&e.width!==void 0)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle";break}for(let[h,d]of i.entries()){e.textMargin!==void 0&&e.textMargin===0&&a!==void 0&&(l=h*a);const f=t.append("text");f.attr("x",e.x),f.attr("y",u()),e.anchor!==void 0&&f.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),e.fontFamily!==void 0&&f.style("font-family",e.fontFamily),s!==void 0&&f.style("font-size",s),e.fontWeight!==void 0&&f.style("font-weight",e.fontWeight),e.fill!==void 0&&f.attr("fill",e.fill),e.class!==void 0&&f.attr("class",e.class),e.dy!==void 0?f.attr("dy",e.dy):l!==0&&f.attr("dy",l);const p=d||Qyt;if(e.tspan){const g=f.append("tspan");g.attr("x",e.x),e.fill!==void 0&&g.attr("fill",e.fill),g.text(p)}else f.text(p);e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0&&(n+=(f._groups||f)[0][0].getBBox().height,r=n),o.push(f)}return o},"drawText"),JYt=C(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}C(r,"genPoints");const n=t.append("polygon");return n.attr("points",r(e.x,e.y,e.width,e.height,7)),n.attr("class","labelBox"),e.y=e.y+e.height/2,qR(t,e),n},"drawLabel"),bi=-1,eqt=C((t,e,r,n)=>{t.select&&r.forEach(i=>{const a=e.get(i),s=t.select("#actor"+a.actorCnt);!n.mirrorActors&&a.stopy?s.attr("y2",a.stopy+a.height/2):n.mirrorActors&&s.attr("y2",a.stopy)})},"fixLifeLineHeights"),YHn=C(function(t,e,r,n,i){var w,A;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(bi++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",_ne(`actor${bi}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+bi).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=bi,e.links!=null&&g.attr("id","root-"+bi),l==="neo"&&g.attr("data-look","neo"));const m=tf();var v="actor";(w=e.properties)!=null&&w.class?v=e.properties.class:m.fill="#eaeaea",n?v+=` ${gw}`:v+=` ${pw}`,m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.class=v,m.rx=3,m.ry=3,m.name=e.name,l==="neo"&&(m.rx=6,m.ry=6);const y=Tz(g,m),b=i.get(e.name)??0;if(J1.has(u)&&(y.style("stroke",f[b%f.length]),y.style("fill",d[b%f.length])),l==="neo"&&y.attr("filter","url(#drop-shadow)"),e.rectData=m,(A=e.properties)!=null&&A.icon){const S=e.properties.icon.trim();S.charAt(0)==="@"?kke(g,m.x+m.width-20,m.y+10,S.substr(1)):Oke(g,m.x+m.width-20,m.y+10,S)}n||(g.attr("data-et","participant"),g.attr("data-type","participant"),g.attr("data-id",e.name)),eb(r,io(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${Ene}`},r);let x=e.height;if(y.node){const S=y.node().getBBox();e.height=S.height,x=S.height}return x},"drawActorTypeParticipant"),qHn=C(function(t,e,r,n,i){var T,O;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(bi++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",_ne(`actor${bi}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+bi).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=bi,e.links!=null&&g.attr("id","root-"+bi),l==="neo"&&g.attr("data-look","neo"));const m=tf();var v="actor";(T=e.properties)!=null&&T.class?v=e.properties.class:m.fill="#eaeaea",n?v+=` ${gw}`:v+=` ${pw}`,m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.class=v,m.name=e.name;const y=6,b={...m,x:m.x+-y,y:m.y+ +y,class:"actor"},x=Tz(g,m),w=Tz(g,b);e.rectData=m,l==="neo"&&g.attr("filter","url(#drop-shadow)");const A=i.get(e.name)??0;if(J1.has(u)&&(x.style("stroke",f[A%f.length]),x.style("fill",d[A%f.length]),w.style("stroke",f[A%f.length]),w.style("fill",d[A%f.length])),(O=e.properties)!=null&&O.icon){const k=e.properties.icon.trim();k.charAt(0)==="@"?kke(g,m.x+m.width-20,m.y+10,k.substr(1)):Oke(g,m.x+m.width-20,m.y+10,k)}eb(r,io(e.description))(e.description,g,m.x-y,m.y+y,m.width,m.height,{class:`actor ${Ene}`},r);let S=e.height;if(x.node){const k=x.node().getBBox();e.height=k.height,S=k.height}return n||(g.attr("data-et","participant"),g.attr("data-type","collections"),g.attr("data-id",e.name)),S},"drawActorTypeCollections"),jHn=C(function(t,e,r,n,i){var k,E;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();let g=p;n||(bi++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",_ne(`actor${bi}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+bi).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=bi,e.links!=null&&g.attr("id","root-"+bi),l==="neo"&&g.attr("data-look","neo"));const m=tf();let v="actor";(k=e.properties)!=null&&k.class?v=e.properties.class:m.fill="#eaeaea",n?v+=` ${gw}`:v+=` ${pw}`,g.attr("class",v),m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.name=e.name;const y=m.height/2,b=y/(2.5+m.height/50),x=g.append("g"),w=g.append("g"),A=`M ${m.x},${m.y+y} a ${b},${y} 0 0 0 0,${m.height} h ${m.width-2*b} a ${b},${y} 0 0 0 0,-${m.height} Z `;x.append("path").attr("d",A),w.append("path").attr("d",`M ${m.x},${m.y+y} - a ${b},${y} 0 0 0 0,${m.height}`),x.attr("transform",`translate(${b}, ${-(m.height/2)})`),w.attr("transform",`translate(${m.width-b}, ${-m.height/2})`),e.rectData=m,l==="neo"&&x.attr("filter","url(#drop-shadow)");const T=i.get(e.name)??0;if(J1.has(u)&&(x.style("stroke",f[T%f.length]),x.style("fill",d[T%f.length]),w.style("stroke",f[T%f.length]),w.style("fill",d[T%f.length])),(E=e.properties)!=null&&E.icon){const _=e.properties.icon.trim(),I=m.x+m.width-20,L=m.y+10;_.charAt(0)==="@"?kke(g,I,L,_.substr(1)):Oke(g,I,L,_)}eb(r,io(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${Ene}`},r);let S=e.height;const O=x.select("path:last-child");if(O.node()){const _=O.node().getBBox();e.height=_.height,S=_.height}return n||(g.attr("data-et","participant"),g.attr("data-type","queue"),g.attr("data-id",e.name)),S},"drawActorTypeQueue"),XHn=C(function(t,e,r,n,i,a){var k;const s=n?e.stopy:e.starty,o=e.x+e.width/2,l=s+75,{look:u,theme:h,themeVariables:d}=r,{bkgColorArray:f,borderColorArray:p,actorBorder:g,actorBkg:m}=d,v=t.append("g").lower();n||(bi++,v.append("line").attr("id","actor"+bi).attr("x1",o).attr("y1",l).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=bi);const y=t.append("g");let b=QO;n?b+=` ${gw}`:b+=` ${pw}`,y.attr("class",b),y.attr("name",e.name);const x=tf();x.x=e.x,x.y=s,x.fill="#eaeaea",x.width=e.width,x.height=e.height,x.class="actor";const w=e.x+e.width/2,A=s+32,T=22;y.append("defs").append("marker").attr("id",i+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),y.append("circle").attr("cx",w).attr("cy",A).attr("r",T).attr("filter",`${u==="neo"?"url(#drop-shadow)":""}`),y.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${w}, ${A-T})`);const S=a.get(e.name)??0;J1.has(h)?(y.style("stroke",p[S%p.length]),y.style("fill",f[S%p.length])):(y.style("stroke",g),y.style("fill",m));const O=y.node().getBBox();return e.height=O.height+2*(((k=r==null?void 0:r.sequence)==null?void 0:k.labelBoxHeight)??0),eb(r,io(e.description))(e.description,y,x.x,x.y+T+(n?5:12),x.width,x.height,{class:`actor ${QO}`},r),n||(y.attr("data-et","participant"),y.attr("data-type","control"),y.attr("data-id",e.name)),e.height},"drawActorTypeControl"),KHn=C(function(t,e,r,n,i){var T;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+75,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower(),g=t.append("g");let m="actor";n?m+=` ${gw}`:m+=` ${pw}`,g.attr("class",m),g.attr("name",e.name);const v=tf();v.x=e.x,v.y=a,v.fill="#eaeaea",v.width=e.width,v.height=e.height,v.class="actor";const y=e.x+e.width/2,b=a+(n?10:25),x=22;g.append("circle").attr("cx",y).attr("cy",b).attr("r",x).attr("width",e.width).attr("height",e.height),g.append("line").attr("x1",y-x).attr("x2",y+x).attr("y1",b+x).attr("y2",b+x).attr("stroke-width",2),l==="neo"&&g.attr("filter","url(#drop-shadow)");const w=i.get(e.name)??0;J1.has(u)&&(g.style("stroke",f[w%f.length]),g.style("fill",d[w%f.length]));const A=g.node().getBBox();return e.height=A.height+(((T=r==null?void 0:r.sequence)==null?void 0:T.labelBoxHeight)??0),n||(bi++,p.append("line").attr("id","actor"+bi).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=bi),eb(r,io(e.description))(e.description,g,v.x,v.y+(n?15:30),v.width,v.height,{class:`actor ${QO}`},r),n?g.attr("transform",`translate(0, ${x})`):(g.attr("transform",`translate(0, ${x/2-5})`),g.attr("data-et","participant"),g.attr("data-type","entity"),g.attr("data-id",e.name)),e.height},"drawActorTypeEntity"),ZHn=C(function(t,e,r,n,i){var E;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height+2*r.boxTextMargin,{theme:l,themeVariables:u,look:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=u,g=t.append("g").lower();let m=g;n||(bi++,Object.keys(e.links||{}).length&&!r.forceMenus&&m.attr("onclick",_ne(`actor${bi}_popup`)).attr("cursor","pointer"),m.append("line").attr("id","actor"+bi).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),m=g.append("g"),e.actorCnt=bi,e.links!=null&&m.attr("id","root-"+bi),h==="neo"&&m.attr("data-look","neo"));const v=tf();let y="actor";(E=e.properties)!=null&&E.class?y=e.properties.class:v.fill="#eaeaea",n?y+=` ${gw}`:y+=` ${pw}`,v.x=e.x,v.y=a,v.width=e.width,v.height=e.height,v.class=y,v.name=e.name,v.x=e.x,v.y=a;const b=v.width/3,x=v.width/3,w=b/2,A=w/(2.5+b/50),T=m.append("g");T.attr("class",y);const S=` + a ${b},${y} 0 0 0 0,${m.height}`),x.attr("transform",`translate(${b}, ${-(m.height/2)})`),w.attr("transform",`translate(${m.width-b}, ${-m.height/2})`),e.rectData=m,l==="neo"&&x.attr("filter","url(#drop-shadow)");const S=i.get(e.name)??0;if(J1.has(u)&&(x.style("stroke",f[S%f.length]),x.style("fill",d[S%f.length]),w.style("stroke",f[S%f.length]),w.style("fill",d[S%f.length])),(E=e.properties)!=null&&E.icon){const _=e.properties.icon.trim(),I=m.x+m.width-20,L=m.y+10;_.charAt(0)==="@"?kke(g,I,L,_.substr(1)):Oke(g,I,L,_)}eb(r,io(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${Ene}`},r);let T=e.height;const O=x.select("path:last-child");if(O.node()){const _=O.node().getBBox();e.height=_.height,T=_.height}return n||(g.attr("data-et","participant"),g.attr("data-type","queue"),g.attr("data-id",e.name)),T},"drawActorTypeQueue"),XHn=C(function(t,e,r,n,i,a){var k;const s=n?e.stopy:e.starty,o=e.x+e.width/2,l=s+75,{look:u,theme:h,themeVariables:d}=r,{bkgColorArray:f,borderColorArray:p,actorBorder:g,actorBkg:m}=d,v=t.append("g").lower();n||(bi++,v.append("line").attr("id","actor"+bi).attr("x1",o).attr("y1",l).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=bi);const y=t.append("g");let b=QO;n?b+=` ${gw}`:b+=` ${pw}`,y.attr("class",b),y.attr("name",e.name);const x=tf();x.x=e.x,x.y=s,x.fill="#eaeaea",x.width=e.width,x.height=e.height,x.class="actor";const w=e.x+e.width/2,A=s+32,S=22;y.append("defs").append("marker").attr("id",i+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),y.append("circle").attr("cx",w).attr("cy",A).attr("r",S).attr("filter",`${u==="neo"?"url(#drop-shadow)":""}`),y.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${w}, ${A-S})`);const T=a.get(e.name)??0;J1.has(h)?(y.style("stroke",p[T%p.length]),y.style("fill",f[T%p.length])):(y.style("stroke",g),y.style("fill",m));const O=y.node().getBBox();return e.height=O.height+2*(((k=r==null?void 0:r.sequence)==null?void 0:k.labelBoxHeight)??0),eb(r,io(e.description))(e.description,y,x.x,x.y+S+(n?5:12),x.width,x.height,{class:`actor ${QO}`},r),n||(y.attr("data-et","participant"),y.attr("data-type","control"),y.attr("data-id",e.name)),e.height},"drawActorTypeControl"),KHn=C(function(t,e,r,n,i){var S;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+75,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower(),g=t.append("g");let m="actor";n?m+=` ${gw}`:m+=` ${pw}`,g.attr("class",m),g.attr("name",e.name);const v=tf();v.x=e.x,v.y=a,v.fill="#eaeaea",v.width=e.width,v.height=e.height,v.class="actor";const y=e.x+e.width/2,b=a+(n?10:25),x=22;g.append("circle").attr("cx",y).attr("cy",b).attr("r",x).attr("width",e.width).attr("height",e.height),g.append("line").attr("x1",y-x).attr("x2",y+x).attr("y1",b+x).attr("y2",b+x).attr("stroke-width",2),l==="neo"&&g.attr("filter","url(#drop-shadow)");const w=i.get(e.name)??0;J1.has(u)&&(g.style("stroke",f[w%f.length]),g.style("fill",d[w%f.length]));const A=g.node().getBBox();return e.height=A.height+(((S=r==null?void 0:r.sequence)==null?void 0:S.labelBoxHeight)??0),n||(bi++,p.append("line").attr("id","actor"+bi).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=bi),eb(r,io(e.description))(e.description,g,v.x,v.y+(n?15:30),v.width,v.height,{class:`actor ${QO}`},r),n?g.attr("transform",`translate(0, ${x})`):(g.attr("transform",`translate(0, ${x/2-5})`),g.attr("data-et","participant"),g.attr("data-type","entity"),g.attr("data-id",e.name)),e.height},"drawActorTypeEntity"),ZHn=C(function(t,e,r,n,i){var E;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height+2*r.boxTextMargin,{theme:l,themeVariables:u,look:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=u,g=t.append("g").lower();let m=g;n||(bi++,Object.keys(e.links||{}).length&&!r.forceMenus&&m.attr("onclick",_ne(`actor${bi}_popup`)).attr("cursor","pointer"),m.append("line").attr("id","actor"+bi).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),m=g.append("g"),e.actorCnt=bi,e.links!=null&&m.attr("id","root-"+bi),h==="neo"&&m.attr("data-look","neo"));const v=tf();let y="actor";(E=e.properties)!=null&&E.class?y=e.properties.class:v.fill="#eaeaea",n?y+=` ${gw}`:y+=` ${pw}`,v.x=e.x,v.y=a,v.width=e.width,v.height=e.height,v.class=y,v.name=e.name,v.x=e.x,v.y=a;const b=v.width/3,x=v.width/3,w=b/2,A=w/(2.5+b/50),S=m.append("g");S.attr("class",y);const T=` M ${v.x},${v.y+A} a ${w},${A} 0 0 0 ${b},0 a ${w},${A} 0 0 0 -${b},0 l 0,${x-2*A} a ${w},${A} 0 0 0 ${b},0 l 0,-${x-2*A} -`;T.append("path").attr("d",S),h==="neo"&&T.attr("filter","url(#drop-shadow)");const O=i.get(e.name)??0;J1.has(l)?(T.style("stroke",f[O%f.length]),T.style("fill",d[O%f.length])):T.style("stroke",p),T.attr("transform",`translate(${b}, ${A})`),e.rectData=v,eb(r,io(e.description))(e.description,m,v.x,v.y+35,v.width,v.height,{class:`actor ${Ene}`},r);const k=T.select("path:last-child");if(k.node()){const _=k.node().getBBox();e.height=_.height+(r.sequence.labelBoxHeight??0)}return n||(m.attr("data-et","participant"),m.attr("data-type","database"),m.attr("data-id",e.name)),e.height},"drawActorTypeDatabase"),JHn=C(function(t,e,r,n,i){const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+80,l=22,u=t.append("g").lower(),{look:h,theme:d,themeVariables:f}=r,{bkgColorArray:p,borderColorArray:g,actorBorder:m}=f;n||(bi++,u.append("line").attr("id","actor"+bi).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=bi);const v=t.append("g");let y=QO;n?y+=` ${gw}`:y+=` ${pw}`,v.attr("class",y),v.attr("name",e.name);const b=tf();b.x=e.x,b.y=a,b.fill="#eaeaea",b.width=e.width,b.height=e.height,b.class="actor",v.append("line").attr("id","actor-man-torso"+bi).attr("x1",e.x+e.width/2-l*2.5).attr("y1",a+12).attr("x2",e.x+e.width/2-15).attr("y2",a+12),v.append("line").attr("id","actor-man-arms"+bi).attr("x1",e.x+e.width/2-l*2.5).attr("y1",a+2).attr("x2",e.x+e.width/2-l*2.5).attr("y2",a+22),v.append("circle").attr("cx",e.x+e.width/2).attr("cy",a+12).attr("r",l),h==="neo"&&v.attr("filter","url(#drop-shadow)");const x=i.get(e.name)??0;J1.has(d)?(v.style("stroke",g[x%g.length]),v.style("fill",p[x%g.length])):v.style("stroke",m);const w=v.node().getBBox();return e.height=w.height+(r.sequence.labelBoxHeight??0),eb(r,io(e.description))(e.description,v,b.x,b.y+15,b.width,b.height,{class:`actor ${QO}`},r),v.attr("transform",`translate(0,${l/2+10})`),n||(v.attr("data-et","participant"),v.attr("data-type","boundary"),v.attr("data-id",e.name)),e.height},"drawActorTypeBoundary"),eWn=C(function(t,e,r,n,i){const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+80,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=h,g=t.append("g").lower();n||(bi++,g.append("line").attr("id","actor"+bi).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=bi);const m=t.append("g");let v=QO;n?v+=` ${gw}`:v+=` ${pw}`,m.attr("class",v),m.attr("name",e.name),n||m.attr("data-et","participant").attr("data-type","actor").attr("data-id",e.name);const y=l==="neo"?.5:1,b=l==="neo"?a+(1-y)*30:a;m.append("line").attr("id","actor-man-torso"+bi).attr("x1",s).attr("y1",b+25*y).attr("x2",s).attr("y2",b+45*y),m.append("line").attr("id","actor-man-arms"+bi).attr("x1",s-VO/2*y).attr("y1",b+33*y).attr("x2",s+VO/2*y).attr("y2",b+33*y),m.append("line").attr("x1",s-VO/2*y).attr("y1",b+60*y).attr("x2",s).attr("y2",b+45*y),m.append("line").attr("x1",s).attr("y1",b+45*y).attr("x2",s+(VO/2-2)*y).attr("y2",b+60*y);const x=m.append("circle");x.attr("cx",e.x+e.width/2),x.attr("cy",b+10*y),x.attr("r",15*y),x.attr("width",e.width*y),x.attr("height",e.height*y);const w=m.node().getBBox();e.height=w.height;const A=tf();A.x=e.x,A.y=b,A.fill="#eaeaea",A.width=e.width,A.height=e.height/y,A.class="actor",A.rx=3,A.ry=3;const T=i.get(e.name)??0;return J1.has(u)?(m.style("stroke",f[T%f.length]),m.style("fill",d[T%f.length])):m.style("stroke",p),eb(r,io(e.description))(e.description,m,A.x,b+35*y-(l==="neo"?10:0),A.width,A.height,{class:`actor ${QO}`},r),e.height},"drawActorTypeActor"),tWn=C(async function(t,e,r,n,i,a,s){const o=s??new Map([...a.db.getActors().values()].map((l,u)=>[l.name,u]));switch(e.type){case"actor":return await eWn(t,e,r,n,o);case"participant":return await YHn(t,e,r,n,o);case"boundary":return await JHn(t,e,r,n,o);case"control":return await XHn(t,e,r,n,i,o);case"entity":return await KHn(t,e,r,n,o);case"database":return await ZHn(t,e,r,n,o);case"collections":return await qHn(t,e,r,n,o);case"queue":return await jHn(t,e,r,n,o)}},"drawActor"),rWn=C(function(t,e,r){const i=t.append("g");tqt(i,e),e.name&&eb(r)(e.name,i,e.x,e.y+r.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),i.lower()},"drawBox"),nWn=C(function(t){return t.append("g")},"anchorElement"),iWn=C(function(t,e,r,n,i,a,s){const{theme:o,themeVariables:l}=n,{bkgColorArray:u,borderColorArray:h,mainBkg:d}=l,f=tf(),p=e.anchored,g=e.actor;f.x=e.startx,f.y=e.starty,f.class="activation"+i%3,f.width=e.stopx-e.startx,f.height=r-e.starty;const m=Sz(p,f),y=(s??new Map([...a.db.getActors().values()].map((b,x)=>[b.name,x]))).get(g)??0;J1.has(o)&&(m.style("stroke",h[y%h.length]),m.style("fill",u[y%h.length]??d))},"drawActivation"),aWn=C(async function(t,e,r,n,i){const{boxMargin:a,boxTextMargin:s,labelBoxHeight:o,labelBoxWidth:l,messageFontFamily:u,messageFontSize:h,messageFontWeight:d}=n,f=t.append("g").attr("data-et","control-structure").attr("data-id","i"+i.id),p=C(function(v,y,b,x){return f.append("line").attr("x1",v).attr("y1",y).attr("x2",b).attr("y2",x).attr("class","loopLine")},"drawLoopLine");p(e.startx,e.starty,e.stopx,e.starty),p(e.stopx,e.starty,e.stopx,e.stopy),p(e.startx,e.stopy,e.stopx,e.stopy),p(e.startx,e.starty,e.startx,e.stopy),e.sections!==void 0&&e.sections.forEach(function(v){p(e.startx,v.y,e.stopx,v.y).style("stroke-dasharray","3, 3")});let g=Eke();g.text=r,g.x=e.startx,g.y=e.starty,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.anchor="middle",g.valign="middle",g.tspan=!1,g.width=Math.max(l??0,50),g.height=o+(n.look==="neo"?15:0)||20,g.textMargin=s,g.class="labelText",JYt(f,g),g=rqt(),g.text=e.title,g.x=e.startx+l/2+(e.stopx-e.startx)/2,g.y=e.starty+a+s,g.anchor="middle",g.valign="middle",g.textMargin=s,g.class="loopText",g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=!0;let m=io(g.text)?await Rne(f,g,e):qR(f,g);if(e.sectionTitles!==void 0){for(const[v,y]of Object.entries(e.sectionTitles))if(y.message){g.text=y.message,g.x=e.startx+(e.stopx-e.startx)/2,g.y=e.sections[v].y+a+s,g.class="sectionTitle",g.anchor="middle",g.valign="middle",g.tspan=!1,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=e.wrap,io(g.text)?(e.starty=e.sections[v].y,await Rne(f,g,e)):qR(f,g);let b=Math.round(m.map(x=>(x._groups||x)[0][0].getBBox().height).reduce((x,w)=>x+w));e.sections[v].height+=b-(a+s)}}return e.height=Math.round(e.stopy-e.starty),f},"drawLoop"),tqt=C(function(t,e){O6t(t,e)},"drawBackgroundRect"),sWn=C(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),oWn=C(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),lWn=C(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),cWn=C(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),uWn=C(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),hWn=C(function(t,e){t.append("defs").append("marker").attr("id",e+"-sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),dWn=C(function(t,e){t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),fWn=C(function(t,e){const{theme:r}=e;t.append("defs").append("filter").attr("id","drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${r==="redux"||r==="redux-color"?"#000000":"#FFFFFF"}`)},"insertDropShadow"),rqt=C(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),pWn=C(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),eb=function(){function t(a,s,o,l,u,h,d){const f=s.append("text").attr("x",o+u/2).attr("y",l+h/2+5).style("text-anchor","middle").text(a);i(f,d)}C(t,"byText");function e(a,s,o,l,u,h,d,f){const{actorFontSize:p,actorFontFamily:g,actorFontWeight:m}=f,[v,y]=By(p),b=a.split(jt.lineBreakRegex);for(let x=0;xt.height||0))+(this.loops.length===0?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.messages.length===0?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.notes.length===0?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},"getHeight"),clear:C(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:C(function(t){this.boxes.push(t)},"addBox"),addActor:C(function(t){this.actors.push(t)},"addActor"),addLoop:C(function(t){this.loops.push(t)},"addLoop"),addMessage:C(function(t){this.messages.push(t)},"addMessage"),addNote:C(function(t){this.notes.push(t)},"addNote"),lastActor:C(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:C(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:C(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:C(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:C(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,sqt(He())},"init"),updateVal:C(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:C(function(t,e,r,n){const i=this;let a=0;function s(o){return C(function(u){a++;const h=i.sequenceItems.length-a+1;i.updateVal(u,"starty",e-h*tt.boxMargin,Math.min),i.updateVal(u,"stopy",n+h*tt.boxMargin,Math.max),i.updateVal(Bt.data,"startx",t-h*tt.boxMargin,Math.min),i.updateVal(Bt.data,"stopx",r+h*tt.boxMargin,Math.max),o!=="activation"&&(i.updateVal(u,"startx",t-h*tt.boxMargin,Math.min),i.updateVal(u,"stopx",r+h*tt.boxMargin,Math.max),i.updateVal(Bt.data,"starty",e-h*tt.boxMargin,Math.min),i.updateVal(Bt.data,"stopy",n+h*tt.boxMargin,Math.max))},"updateItemBounds")}C(s,"updateFn"),this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))},"updateBounds"),insert:C(function(t,e,r,n){const i=jt.getMin(t,r),a=jt.getMax(t,r),s=jt.getMin(e,n),o=jt.getMax(e,n);this.updateVal(Bt.data,"startx",i,Math.min),this.updateVal(Bt.data,"starty",s,Math.min),this.updateVal(Bt.data,"stopx",a,Math.max),this.updateVal(Bt.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),newActivation:C(function(t,e,r){const n=r.get(t.from),i=Dne(t.from).length||0,a=n.x+n.width/2+(i-1)*tt.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+tt.activationWidth,stopy:void 0,actor:t.from,anchored:za.anchorElement(e)})},"newActivation"),endActivation:C(function(t){const e=this.activations.map(function(r){return r.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:C(function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},"createLoop"),newLoop:C(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:C(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:C(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:C(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:Bt.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:C(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:C(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:C(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=jt.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:C(function(){return this.verticalPos},"getVerticalPos"),getBounds:C(function(){return{bounds:this.data,models:this.models}},"getBounds")},xWn=C(async function(t,e,r){Bt.bumpVerticalPos(tt.boxMargin),e.height=tt.boxMargin,e.starty=Bt.getVerticalPos();const n=tf();n.x=e.startx,n.y=e.starty,n.width=e.width||tt.width,n.class="note";const i=t.append("g");i.attr("data-et","note"),i.attr("data-id","i"+r);const a=za.drawRect(i,n),s=Eke();s.x=e.startx,s.y=e.starty,s.width=n.width,s.dy="1em",s.text=e.message,s.class="noteText",s.fontFamily=tt.noteFontFamily,s.fontSize=tt.noteFontSize,s.fontWeight=tt.noteFontWeight,s.anchor=tt.noteAlign,s.textMargin=tt.noteMargin,s.valign="center";const o=io(s.text)?await Rne(i,s):qR(i,s),l=Math.round(o.map(u=>(u._groups||u)[0][0].getBBox().height).reduce((u,h)=>u+h));a.attr("height",l+2*tt.noteMargin),e.height+=l+2*tt.noteMargin,Bt.bumpVerticalPos(l+2*tt.noteMargin),e.stopy=e.starty+l+2*tt.noteMargin,e.stopx=e.startx+n.width,Bt.insert(e.startx,e.starty,e.stopx,e.stopy),Bt.models.addNote(e)},"drawNote"),nqt=C(function(t,e,r,n,i,a,s){const o=n.db.getActors(),l=o.get(e.from),u=o.get(e.to),h=r.sequenceVisible;let d=l.x+l.width/2,f=u.x+u.width/2;const p=d<=f,g=hqt(e,n),m=t.append("g"),v=16.5,y=C((T,S)=>{const O=T?v:-v;return S?-O:O},"getCircleOffset"),b=C(T=>{m.append("circle").attr("cx",T).attr("cy",s).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:x,CENTRAL_CONNECTION_REVERSE:w,CENTRAL_CONNECTION_DUAL:A}=n.db.LINETYPE;if(h)switch(e.centralConnection){case x:g&&(f+=y(p,!0));break;case w:g||(d+=y(p,!1));break;case A:g?f+=y(p,!0):d+=y(p,!1);break}switch(e.centralConnection){case x:b(f);break;case w:b(d);break;case A:b(d),b(f);break}},"drawCentralConnection"),GO=C(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),jR=C(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),GRe=C(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function iqt(t,e){Bt.bumpVerticalPos(10);const{startx:r,stopx:n,message:i}=e,a=jt.splitBreaks(i).length,s=io(i),o=s?await IB(i,He()):ln.calculateTextDimensions(i,GO(tt));if(!s){const d=o.height/a;e.height+=d,Bt.bumpVerticalPos(d)}let l,u=o.height-10;const h=o.width;if(r===n){l=Bt.getVerticalPos()+u,tt.rightAngles||(u+=tt.boxMargin,l=Bt.getVerticalPos()+u),u+=30;const d=jt.getMax(h/2,tt.width/2);Bt.insert(r-d,Bt.getVerticalPos()-10+u,n+d,Bt.getVerticalPos()+30+u)}else u+=tt.boxMargin,l=Bt.getVerticalPos()+u,Bt.insert(r,l-10,n,l);return Bt.bumpVerticalPos(u),e.height+=u,e.stopy=e.starty+e.height,Bt.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}C(iqt,"boundMessage");var wWn=C(async function(t,e,r,n,i,a){const{startx:s,stopx:o,starty:l,message:u,type:h,sequenceIndex:d,sequenceVisible:f}=e,p=ln.calculateTextDimensions(u,GO(tt)),g=Eke();g.x=Math.min(s,o),g.y=l+10,g.width=Math.abs(o-s),g.class="messageText",g.dy="1em",g.text=u,g.fontFamily=tt.messageFontFamily,g.fontSize=tt.messageFontSize,g.fontWeight=tt.messageFontWeight,g.anchor=tt.messageAlign,g.valign="center",g.textMargin=tt.wrapPadding,g.tspan=!1,io(g.text)?await Rne(t,g,{startx:s,stopx:o,starty:r}):qR(t,g);const m=p.width;let v;if(s===o){const b=f||tt.showSequenceNumbers,x=hqt(i,n),w=EWn(i,n),A=s+(b&&(x||w)?10:0);tt.rightAngles?v=t.append("path").attr("d",`M ${A},${r} H ${s+jt.getMax(tt.width/2,m/2)} V ${r+25} H ${s}`):v=t.append("path").attr("d","M "+A+","+r+" C "+(A+60)+","+(r-10)+" "+(s+60)+","+(r+30)+" "+s+","+(r+20)),WRe(i,n)&&nqt(t,i,e,n,s,o,r)}else v=t.append("line"),v.attr("x1",s),v.attr("y1",r),v.attr("x2",o),v.attr("y2",r),WRe(i,n)&&nqt(t,i,e,n,s,o,r);h===n.db.LINETYPE.DOTTED||h===n.db.LINETYPE.DOTTED_CROSS||h===n.db.LINETYPE.DOTTED_POINT||h===n.db.LINETYPE.DOTTED_OPEN||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED||h===n.db.LINETYPE.SOLID_TOP_DOTTED||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED||h===n.db.LINETYPE.STICK_TOP_DOTTED||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(v.style("stroke-dasharray","3, 3"),v.attr("class","messageLine1")):v.attr("class","messageLine0"),v.attr("data-et","message"),v.attr("data-id","i"+e.id),v.attr("data-from",e.from),v.attr("data-to",e.to);let y="";if(tt.arrowMarkerAbsolute&&(y=Eq(!0)),v.attr("stroke-width",2),v.attr("stroke","none"),v.style("fill","none"),(h===n.db.LINETYPE.SOLID_TOP||h===n.db.LINETYPE.SOLID_TOP_DOTTED)&&v.attr("marker-end","url("+y+"#"+a+"-solidTopArrowHead)"),(h===n.db.LINETYPE.SOLID_BOTTOM||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&v.attr("marker-end","url("+y+"#"+a+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.STICK_TOP||h===n.db.LINETYPE.STICK_TOP_DOTTED)&&v.attr("marker-end","url("+y+"#"+a+"-stickTopArrowHead)"),(h===n.db.LINETYPE.STICK_BOTTOM||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED)&&v.attr("marker-end","url("+y+"#"+a+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&v.attr("marker-start","url("+y+"#"+a+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&v.attr("marker-start","url("+y+"#"+a+"-solidTopArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&v.attr("marker-start","url("+y+"#"+a+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&v.attr("marker-start","url("+y+"#"+a+"-stickTopArrowHead)"),(h===n.db.LINETYPE.SOLID||h===n.db.LINETYPE.DOTTED)&&v.attr("marker-end","url("+y+"#"+a+"-arrowhead)"),(h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(v.attr("marker-start","url("+y+"#"+a+"-arrowhead)"),v.attr("marker-end","url("+y+"#"+a+"-arrowhead)")),(h===n.db.LINETYPE.SOLID_POINT||h===n.db.LINETYPE.DOTTED_POINT)&&v.attr("marker-end","url("+y+"#"+a+"-filled-head)"),(h===n.db.LINETYPE.SOLID_CROSS||h===n.db.LINETYPE.DOTTED_CROSS)&&v.attr("marker-end","url("+y+"#"+a+"-crosshead)"),f||tt.showSequenceNumbers){const b=h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED,x=h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,w=6,A=WRe(i,n);let T=s,S=o;b?(ss?S=o-2*w:(S=o-w,T+=(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_DUAL||(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),S+=A?15:0,v.attr("x2",S),v.attr("x1",T)):v.attr("x1",s+w);let O=0;const k=s===o,E=s<=o;k?O=e.fromBounds+1:x?O=E?e.toBounds-1:e.fromBounds+1:O=E?e.fromBounds+1:e.toBounds-1;let _="12px";const I=d.toString().length;I>5?_="7px":I>3&&(_="9px"),t.append("line").attr("x1",O).attr("y1",r).attr("x2",O).attr("y2",r).attr("stroke-width",0).attr("marker-start","url("+y+"#"+a+"-sequencenumber)"),t.append("text").attr("x",O).attr("y",r+4).attr("font-family","sans-serif").attr("font-size",_).attr("text-anchor","middle").attr("class","sequenceNumber").text(d)}},"drawMessage"),AWn=C(function(t,e,r,n,i,a,s){let o=0,l=0,u,h=0;for(const d of n){const f=e.get(d),p=f.box;u&&u!=p&&(s||Bt.models.addBox(u),l+=tt.boxMargin+u.margin),p&&p!=u&&(s||(p.x=o+l,p.y=i),l+=p.margin),f.width=jt.getMax(f.width||tt.width,tt.width),f.height=jt.getMax(f.height||tt.height,tt.height),f.margin=f.margin||tt.actorMargin,h=jt.getMax(h,f.height),r.get(f.name)&&(l+=f.width/2),f.x=o+l,f.starty=Bt.getVerticalPos(),Bt.insert(f.x,i,f.x+f.width,f.height),o+=f.width+l,f.box&&(f.box.width=o+p.margin-f.box.x),l=f.margin,u=f.box,Bt.models.addActor(f)}u&&!s&&Bt.models.addBox(u),Bt.bumpVerticalPos(h)},"addActorRenderingData"),HRe=C(async function(t,e,r,n,i,a,s){if(n){let o=0;Bt.bumpVerticalPos(tt.boxMargin*2);for(const l of r){const u=e.get(l);u.stopy||(u.stopy=Bt.getVerticalPos());const h=await za.drawActor(t,u,tt,!0,i,a,s);o=jt.getMax(o,h)}Bt.bumpVerticalPos(o+tt.boxMargin)}else for(const o of r){const l=e.get(o);await za.drawActor(t,l,tt,!1,i,a,s)}},"drawActors"),aqt=C(function(t,e,r,n){let i=0,a=0;for(const s of r){const o=e.get(s),l=SWn(o),u=za.drawPopup(t,o,l,tt,tt.forceMenus,n);u.height>i&&(i=u.height),u.width+o.x>a&&(a=u.width+o.x)}return{maxHeight:i,maxWidth:a}},"drawActorsPopup"),sqt=C(function(t){Eo(tt,t),t.fontFamily&&(tt.actorFontFamily=tt.noteFontFamily=tt.messageFontFamily=t.fontFamily),t.fontSize&&(tt.actorFontSize=tt.noteFontSize=tt.messageFontSize=t.fontSize),t.fontWeight&&(tt.actorFontWeight=tt.noteFontWeight=tt.messageFontWeight=t.fontWeight)},"setConf"),Dne=C(function(t){return Bt.activations.filter(function(e){return e.actor===t})},"actorActivations"),oqt=C(function(t,e){const r=e.get(t),n=Dne(t),i=n.reduce(function(s,o){return jt.getMin(s,o.startx)},r.x+r.width/2-1),a=n.reduce(function(s,o){return jt.getMax(s,o.stopx)},r.x+r.width/2+1);return[i,a]},"activationBounds");function Pg(t,e,r,n,i){Bt.bumpVerticalPos(r);let a=n;if(e.id&&e.message&&t[e.id]){const s=t[e.id].width,o=GO(tt);e.message=ln.wrapLabel(`[${e.message}]`,s-2*tt.wrapPadding,o),e.width=s,e.wrap=!0;const l=ln.calculateTextDimensions(e.message,o),u=jt.getMax(l.height,tt.labelBoxHeight);a=n+u,me.debug(`${u} - ${e.message}`)}i(e),Bt.bumpVerticalPos(a)}C(Pg,"adjustLoopHeightForWrap");function lqt(t,e,r,n,i,a,s){function o(h,d){h.x{z.add(U.from),z.add(U.to)}),v=v.filter(U=>z.has(U))}const T=new Map(v.map((z,U)=>{var Q;return[((Q=f.get(z))==null?void 0:Q.name)??z,U]}));AWn(d,f,p,v,0,y,!1);const S=await RWn(y,f,A,n);za.insertArrowHead(d,e),za.insertArrowCrossHead(d,e),za.insertArrowFilledHead(d,e),za.insertSequenceNumber(d,e),za.insertSolidTopArrowHead(d,e),za.insertSolidBottomArrowHead(d,e),za.insertStickTopArrowHead(d,e),za.insertStickBottomArrowHead(d,e),s==="neo"&&za.insertDropShadow(d,tt);function O(z,U){const Q=Bt.endActivation(z);Q.starty+18>U&&(Q.starty=U-6,U+=12),za.drawActivation(d,Q,U,tt,Dne(z.from).length,n,T),Bt.insert(Q.startx,U-10,Q.stopx,U)}C(O,"activeEnd");let k=1,E=1;const _=[],I=[];let L=0;for(const z of y){let U,Q,G;switch(z.type){case n.db.LINETYPE.NOTE:Bt.resetVerticalPos(),Q=z.noteModel,await xWn(d,Q,z.id);break;case n.db.LINETYPE.ACTIVE_START:Bt.newActivation(z,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION:Bt.newActivation(z,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:Bt.newActivation(z,d,f);break;case n.db.LINETYPE.ACTIVE_END:O(z,Bt.getVerticalPos());break;case n.db.LINETYPE.LOOP_START:Pg(S,z,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,X=>Bt.newLoop(X));break;case n.db.LINETYPE.LOOP_END:U=Bt.endLoop(),await za.drawLoop(d,U,"loop",tt,z),Bt.bumpVerticalPos(U.stopy-Bt.getVerticalPos()),Bt.models.addLoop(U);break;case n.db.LINETYPE.RECT_START:Pg(S,z,tt.boxMargin,tt.boxMargin,X=>{let Y=X.message;Y||(Y=(o==null?void 0:o.rectBkgColor)||(o==null?void 0:o.actorBkg)||"rgba(128, 128, 128, 0.5)"),Bt.newLoop(void 0,Y)});break;case n.db.LINETYPE.RECT_END:U=Bt.endLoop(),I.push(U),Bt.models.addLoop(U),Bt.bumpVerticalPos(U.stopy-Bt.getVerticalPos());break;case n.db.LINETYPE.OPT_START:Pg(S,z,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,X=>Bt.newLoop(X));break;case n.db.LINETYPE.OPT_END:U=Bt.endLoop(),await za.drawLoop(d,U,"opt",tt,z),Bt.bumpVerticalPos(U.stopy-Bt.getVerticalPos()),Bt.models.addLoop(U);break;case n.db.LINETYPE.ALT_START:Pg(S,z,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,X=>Bt.newLoop(X));break;case n.db.LINETYPE.ALT_ELSE:Pg(S,z,tt.boxMargin+tt.boxTextMargin,tt.boxMargin,X=>Bt.addSectionToLoop(X));break;case n.db.LINETYPE.ALT_END:U=Bt.endLoop(),await za.drawLoop(d,U,"alt",tt,z),Bt.bumpVerticalPos(U.stopy-Bt.getVerticalPos()),Bt.models.addLoop(U);break;case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:Pg(S,z,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,X=>Bt.newLoop(X)),Bt.saveVerticalPos();break;case n.db.LINETYPE.PAR_AND:Pg(S,z,tt.boxMargin+tt.boxTextMargin,tt.boxMargin,X=>Bt.addSectionToLoop(X));break;case n.db.LINETYPE.PAR_END:U=Bt.endLoop(),await za.drawLoop(d,U,"par",tt,z),Bt.bumpVerticalPos(U.stopy-Bt.getVerticalPos()),Bt.models.addLoop(U);break;case n.db.LINETYPE.AUTONUMBER:k=z.message.start||k,E=z.message.step||E,z.message.visible?n.db.enableSequenceNumbers():n.db.disableSequenceNumbers();break;case n.db.LINETYPE.CRITICAL_START:Pg(S,z,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,X=>Bt.newLoop(X));break;case n.db.LINETYPE.CRITICAL_OPTION:Pg(S,z,tt.boxMargin+tt.boxTextMargin,tt.boxMargin,X=>Bt.addSectionToLoop(X));break;case n.db.LINETYPE.CRITICAL_END:U=Bt.endLoop(),await za.drawLoop(d,U,"critical",tt,z),Bt.bumpVerticalPos(U.stopy-Bt.getVerticalPos()),Bt.models.addLoop(U);break;case n.db.LINETYPE.BREAK_START:Pg(S,z,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,X=>Bt.newLoop(X));break;case n.db.LINETYPE.BREAK_END:U=Bt.endLoop(),await za.drawLoop(d,U,"break",tt,z),Bt.bumpVerticalPos(U.stopy-Bt.getVerticalPos()),Bt.models.addLoop(U);break;default:try{G=z.msgModel,G.starty=Bt.getVerticalPos(),G.sequenceIndex=k,G.sequenceVisible=n.db.showSequenceNumbers(),G.id=z.id,G.from=z.from,G.to=z.to;const X=await iqt(d,G);lqt(z,G,X,L,f,p,g),_.push({messageModel:G,lineStartY:X,msg:z}),Bt.models.addMessage(G)}catch(X){me.error("error while drawing message",X)}}[n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN,n.db.LINETYPE.SOLID,n.db.LINETYPE.SOLID_TOP,n.db.LINETYPE.SOLID_BOTTOM,n.db.LINETYPE.STICK_TOP,n.db.LINETYPE.STICK_BOTTOM,n.db.LINETYPE.SOLID_TOP_DOTTED,n.db.LINETYPE.SOLID_BOTTOM_DOTTED,n.db.LINETYPE.STICK_TOP_DOTTED,n.db.LINETYPE.STICK_BOTTOM_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.DOTTED,n.db.LINETYPE.SOLID_CROSS,n.db.LINETYPE.DOTTED_CROSS,n.db.LINETYPE.SOLID_POINT,n.db.LINETYPE.DOTTED_POINT,n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(z.type)&&(k=Math.round((k+E)*100)/100),L++}me.debug("createdActors",p),me.debug("destroyedActors",g),await HRe(d,f,v,!1,e,n,T);for(const z of _)await wWn(d,z.messageModel,z.lineStartY,n,z.msg,e);tt.mirrorActors&&await HRe(d,f,v,!0,e,n,T),I.forEach(z=>za.drawBackgroundRect(d,z)),eqt(d,f,v,tt);for(const z of Bt.models.boxes){z.height=Bt.getVerticalPos()-z.y,Bt.insert(z.x,z.y,z.x+z.width,z.height);const U=tt.boxMargin*2;z.startx=z.x-U,z.starty=z.y-U*.25,z.stopx=z.startx+z.width+2*U,z.stopy=z.starty+z.height+U*.75,z.stroke="rgb(0,0,0, 0.5)",za.drawBox(d,z,tt)}x&&Bt.bumpVerticalPos(tt.boxMargin);const R=aqt(d,f,v,h),{bounds:D}=Bt.getBounds();D.startx===void 0&&(D.startx=0),D.starty===void 0&&(D.starty=0),D.stopx===void 0&&(D.stopx=0),D.stopy===void 0&&(D.stopy=0);let M=D.stopy-D.starty;M{const s=GO(tt);let o=a.actorKeys.reduce((d,f)=>d+=t.get(f).width+(t.get(f).margin||0),0);const l=tt.boxMargin*8;o+=l,o-=2*tt.boxTextMargin,a.wrap&&(a.name=ln.wrapLabel(a.name,o-2*tt.wrapPadding,s));const u=ln.calculateTextDimensions(a.name,s);i=jt.getMax(u.height,i);const h=jt.getMax(o,u.width+2*tt.wrapPadding);if(a.margin=tt.boxTextMargin,oa.textMaxHeight=i),jt.getMax(n,tt.height)}C(uqt,"calculateActorMargins");var CWn=C(async function(t,e,r){const n=e.get(t.from),i=e.get(t.to),a=n.x,s=i.x,o=t.wrap&&t.message;let l=io(t.message)?await IB(t.message,He()):ln.calculateTextDimensions(o?ln.wrapLabel(t.message,tt.width,jR(tt)):t.message,jR(tt));const u={width:o?tt.width:jt.getMax(tt.width,l.width+2*tt.noteMargin),height:0,startx:n.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===r.db.PLACEMENT.RIGHTOF?(u.width=o?jt.getMax(tt.width,l.width):jt.getMax(n.width/2+i.width/2,l.width+2*tt.noteMargin),u.startx=a+(n.width+tt.actorMargin)/2):t.placement===r.db.PLACEMENT.LEFTOF?(u.width=o?jt.getMax(tt.width,l.width+2*tt.noteMargin):jt.getMax(n.width/2+i.width/2,l.width+2*tt.noteMargin),u.startx=a-u.width+(n.width-tt.actorMargin)/2):t.to===t.from?(l=ln.calculateTextDimensions(o?ln.wrapLabel(t.message,jt.getMax(tt.width,n.width),jR(tt)):t.message,jR(tt)),u.width=o?jt.getMax(tt.width,n.width):jt.getMax(n.width,tt.width,l.width+2*tt.noteMargin),u.startx=a+(n.width-u.width)/2):(u.width=Math.abs(a+n.width/2-(s+i.width/2))+tt.actorMargin,u.startx=a2,f=C(v=>l?-v:v,"adjustValue");t.from===t.to?h=u:(t.activate&&!d&&(h+=f(tt.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)||(h+=f(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)&&(u-=f(3)));const p=[i,a,s,o],g=Math.abs(u-h);t.wrap&&t.message&&(t.message=ln.wrapLabel(t.message,jt.getMax(g+2*tt.wrapPadding,tt.width),GO(tt)));const m=ln.calculateTextDimensions(t.message,GO(tt));return{width:jt.getMax(t.wrap?0:m.width+2*tt.wrapPadding,g+2*tt.wrapPadding,tt.width),height:0,startx:u,stopx:h,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,p),toBounds:Math.max.apply(null,p)}},"buildMessageModel"),RWn=C(async function(t,e,r,n){const i={},a=[];let s,o,l;for(const u of t){switch(u.type){case n.db.LINETYPE.LOOP_START:case n.db.LINETYPE.ALT_START:case n.db.LINETYPE.OPT_START:case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:case n.db.LINETYPE.CRITICAL_START:case n.db.LINETYPE.BREAK_START:a.push({id:u.id,msg:u.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case n.db.LINETYPE.ALT_ELSE:case n.db.LINETYPE.PAR_AND:case n.db.LINETYPE.CRITICAL_OPTION:u.message&&(s=a.pop(),i[s.id]=s,i[u.id]=s,a.push(s));break;case n.db.LINETYPE.LOOP_END:case n.db.LINETYPE.ALT_END:case n.db.LINETYPE.OPT_END:case n.db.LINETYPE.PAR_END:case n.db.LINETYPE.CRITICAL_END:case n.db.LINETYPE.BREAK_END:s=a.pop(),i[s.id]=s;break;case n.db.LINETYPE.ACTIVE_START:{const d=e.get(u.from?u.from:u.to.actor),f=Dne(u.from?u.from:u.to.actor).length,p=d.x+d.width/2+(f-1)*tt.activationWidth/2,g={startx:p,stopx:p+tt.activationWidth,actor:u.from,enabled:!0};Bt.activations.push(g)}break;case n.db.LINETYPE.ACTIVE_END:{const d=Bt.activations.map(f=>f.actor).lastIndexOf(u.from);Bt.activations.splice(d,1).splice(0,1)}break}u.placement!==void 0?(o=await CWn(u,e,n),u.noteModel=o,a.forEach(d=>{s=d,s.from=jt.getMin(s.from,o.startx),s.to=jt.getMax(s.to,o.startx+o.width),s.width=jt.getMax(s.width,Math.abs(s.from-s.to))-tt.labelBoxWidth})):(l=_Wn(u,e,n),u.msgModel=l,l.startx&&l.stopx&&a.length>0&&a.forEach(d=>{if(s=d,l.startx===l.stopx){const f=e.get(u.from),p=e.get(u.to);s.from=jt.getMin(f.x-l.width/2,f.x-f.width/2,s.from),s.to=jt.getMax(p.x+l.width/2,p.x+f.width/2,s.to),s.width=jt.getMax(s.width,Math.abs(s.to-s.from))-tt.labelBoxWidth}else s.from=jt.getMin(l.startx,s.from),s.to=jt.getMax(l.stopx,s.to),s.width=jt.getMax(s.width,l.width)-tt.labelBoxWidth}))}return Bt.activations=[],me.debug("Loop type widths:",i),i},"calculateLoopBounds"),DWn={bounds:Bt,drawActors:HRe,drawActorsPopup:aqt,setConf:sqt,draw:TWn},LWn={parser:FHn,get db(){return new QHn},renderer:DWn,styles:HHn,init:C(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,bye({sequence:{wrap:t.wrap}}))},"init")};const MWn=Object.freeze(Object.defineProperty({__proto__:null,diagram:LWn},Symbol.toStringTag,{value:"Module"}));var YRe=function(){var t=C(function(ce,be,ne,j){for(ne=ne||{},j=ce.length;j--;ne[ce[j]]=be);return ne},"o"),e=[1,18],r=[1,19],n=[1,20],i=[1,41],a=[1,26],s=[1,42],o=[1,24],l=[1,25],u=[1,32],h=[1,33],d=[1,34],f=[1,45],p=[1,35],g=[1,36],m=[1,37],v=[1,38],y=[1,27],b=[1,28],x=[1,29],w=[1,30],A=[1,31],T=[1,44],S=[1,46],O=[1,43],k=[1,47],E=[1,9],_=[1,8,9],I=[1,58],L=[1,59],R=[1,60],D=[1,61],M=[1,62],P=[1,63],N=[1,64],F=[1,8,9,41],B=[1,77],V=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],z=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],U=[13,60,86,100,102,103],Q=[13,60,73,74,86,100,102,103],G=[13,60,68,69,70,71,72,86,100,102,103],X=[1,103],Y=[1,121],le=[1,117],q=[1,113],Z=[1,119],ee=[1,114],re=[1,115],ve=[1,116],ae=[1,118],Ce=[1,120],Oe=[22,50,60,61,82,86,87,88,89,90],$e=[1,128],he=[12,39],fe=[1,8,9,39,41,44,46],Te=[1,8,9,22],ge=[1,153],Qe=[1,8,9,61],Se=[1,8,9,22,50,60,61,82,86,87,88,89,90],De={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:C(function(be,ne,j,ie,pe,te,ye){var oe=te.length-1;switch(pe){case 8:this.$=te[oe-1];break;case 9:case 10:case 13:case 15:this.$=te[oe];break;case 11:case 14:this.$=te[oe-2]+"."+te[oe];break;case 12:case 16:this.$=te[oe-1]+te[oe];break;case 17:case 18:this.$=te[oe-1]+"~"+te[oe]+"~";break;case 19:ie.addRelation(te[oe]);break;case 20:te[oe-1].title=ie.cleanupLabel(te[oe]),ie.addRelation(te[oe-1]);break;case 31:this.$=te[oe].trim(),ie.setAccTitle(this.$);break;case 32:case 33:this.$=te[oe].trim(),ie.setAccDescription(this.$);break;case 34:ie.addClassesToNamespace(te[oe-3],te[oe-1][0],te[oe-1][1]),ie.popNamespace();break;case 35:ie.addClassesToNamespace(te[oe-4],te[oe-1][0],te[oe-1][1]),ie.popNamespace();break;case 36:this.$=ie.addNamespace(te[oe]);break;case 37:this.$=ie.addNamespace(te[oe-1],te[oe]);break;case 38:this.$=[[te[oe]],[]];break;case 39:this.$=[[te[oe-1]],[]];break;case 40:te[oe][0].unshift(te[oe-2]),this.$=te[oe];break;case 41:this.$=[[],[te[oe]]];break;case 42:this.$=[[],[te[oe-1]]];break;case 43:te[oe][1].unshift(te[oe-2]),this.$=te[oe];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=te[oe];break;case 48:ie.setCssClass(te[oe-2],te[oe]);break;case 49:ie.addMembers(te[oe-3],te[oe-1]);break;case 51:ie.setCssClass(te[oe-5],te[oe-3]),ie.addMembers(te[oe-5],te[oe-1]);break;case 52:ie.addAnnotation(te[oe-3],te[oe-1]);break;case 53:ie.addAnnotation(te[oe-6],te[oe-4]),ie.addMembers(te[oe-6],te[oe-1]);break;case 54:ie.addAnnotation(te[oe-5],te[oe-3]);break;case 55:this.$=te[oe],ie.addClass(te[oe]);break;case 56:this.$=te[oe-1],ie.addClass(te[oe-1]),ie.setClassLabel(te[oe-1],te[oe]);break;case 60:ie.addAnnotation(te[oe],te[oe-2]);break;case 61:case 74:this.$=[te[oe]];break;case 62:te[oe].push(te[oe-1]),this.$=te[oe];break;case 63:break;case 64:ie.addMember(te[oe-1],ie.cleanupLabel(te[oe]));break;case 65:break;case 66:break;case 67:this.$={id1:te[oe-2],id2:te[oe],relation:te[oe-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:te[oe-3],id2:te[oe],relation:te[oe-1],relationTitle1:te[oe-2],relationTitle2:"none"};break;case 69:this.$={id1:te[oe-3],id2:te[oe],relation:te[oe-2],relationTitle1:"none",relationTitle2:te[oe-1]};break;case 70:this.$={id1:te[oe-4],id2:te[oe],relation:te[oe-2],relationTitle1:te[oe-3],relationTitle2:te[oe-1]};break;case 71:this.$=ie.addNote(te[oe],te[oe-1]);break;case 72:this.$=ie.addNote(te[oe]);break;case 73:this.$=te[oe-2],ie.defineClass(te[oe-1],te[oe]);break;case 75:this.$=te[oe-2].concat([te[oe]]);break;case 76:ie.setDirection("TB");break;case 77:ie.setDirection("BT");break;case 78:ie.setDirection("RL");break;case 79:ie.setDirection("LR");break;case 80:this.$={type1:te[oe-2],type2:te[oe],lineType:te[oe-1]};break;case 81:this.$={type1:"none",type2:te[oe],lineType:te[oe-1]};break;case 82:this.$={type1:te[oe-1],type2:"none",lineType:te[oe]};break;case 83:this.$={type1:"none",type2:"none",lineType:te[oe]};break;case 84:this.$=ie.relationType.AGGREGATION;break;case 85:this.$=ie.relationType.EXTENSION;break;case 86:this.$=ie.relationType.COMPOSITION;break;case 87:this.$=ie.relationType.DEPENDENCY;break;case 88:this.$=ie.relationType.LOLLIPOP;break;case 89:this.$=ie.lineType.LINE;break;case 90:this.$=ie.lineType.DOTTED_LINE;break;case 91:case 97:this.$=te[oe-2],ie.setClickEvent(te[oe-1],te[oe]);break;case 92:case 98:this.$=te[oe-3],ie.setClickEvent(te[oe-2],te[oe-1]),ie.setTooltip(te[oe-2],te[oe]);break;case 93:this.$=te[oe-2],ie.setLink(te[oe-1],te[oe]);break;case 94:this.$=te[oe-3],ie.setLink(te[oe-2],te[oe-1],te[oe]);break;case 95:this.$=te[oe-3],ie.setLink(te[oe-2],te[oe-1]),ie.setTooltip(te[oe-2],te[oe]);break;case 96:this.$=te[oe-4],ie.setLink(te[oe-3],te[oe-2],te[oe]),ie.setTooltip(te[oe-3],te[oe-1]);break;case 99:this.$=te[oe-3],ie.setClickEvent(te[oe-2],te[oe-1],te[oe]);break;case 100:this.$=te[oe-4],ie.setClickEvent(te[oe-3],te[oe-2],te[oe-1]),ie.setTooltip(te[oe-3],te[oe]);break;case 101:this.$=te[oe-3],ie.setLink(te[oe-2],te[oe]);break;case 102:this.$=te[oe-4],ie.setLink(te[oe-3],te[oe-1],te[oe]);break;case 103:this.$=te[oe-4],ie.setLink(te[oe-3],te[oe-1]),ie.setTooltip(te[oe-3],te[oe]);break;case 104:this.$=te[oe-5],ie.setLink(te[oe-4],te[oe-2],te[oe]),ie.setTooltip(te[oe-4],te[oe-1]);break;case 105:this.$=te[oe-2],ie.setCssStyle(te[oe-1],te[oe]);break;case 106:ie.setCssClass(te[oe-1],te[oe]);break;case 107:this.$=[te[oe]];break;case 108:te[oe-2].push(te[oe]),this.$=te[oe-2];break;case 110:this.$=te[oe-1]+te[oe];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:v,75:y,76:b,78:x,82:w,83:A,86:T,100:S,102:O,103:k},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(E,[2,5],{8:[1,48]}),{8:[1,49]},t(_,[2,19],{22:[1,50]}),t(_,[2,21]),t(_,[2,22]),t(_,[2,23]),t(_,[2,24]),t(_,[2,25]),t(_,[2,26]),t(_,[2,27]),t(_,[2,28]),t(_,[2,29]),t(_,[2,30]),{34:[1,51]},{36:[1,52]},t(_,[2,33]),t(_,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:I,69:L,70:R,71:D,72:M,73:P,74:N}),{39:[1,65]},t(F,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(_,[2,65]),t(_,[2,66]),{16:69,60:f,86:T,100:S,102:O},{16:39,17:40,19:70,60:f,86:T,100:S,102:O,103:k},{16:39,17:40,19:71,60:f,86:T,100:S,102:O,103:k},{16:39,17:40,19:72,60:f,86:T,100:S,102:O,103:k},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:f,86:T,100:S,102:O,103:k},{13:B,55:76},{58:78,60:[1,79]},t(_,[2,76]),t(_,[2,77]),t(_,[2,78]),t(_,[2,79]),t(V,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:f,86:T,100:S,102:O,103:k}),t(V,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:f,86:T,100:S,102:O,103:k},{16:39,17:40,19:87,60:f,86:T,100:S,102:O,103:k},t(z,[2,133]),t(z,[2,134]),t(z,[2,135]),t(z,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(E,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:e,35:r,37:n,42:i,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:v,75:y,76:b,78:x,82:w,83:A,86:T,100:S,102:O,103:k}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:v,75:y,76:b,78:x,82:w,83:A,86:T,100:S,102:O,103:k},t(_,[2,20]),t(_,[2,31]),t(_,[2,32]),{13:[1,91],16:39,17:40,19:90,60:f,86:T,100:S,102:O,103:k},{53:92,66:56,67:57,68:I,69:L,70:R,71:D,72:M,73:P,74:N},t(_,[2,64]),{67:93,73:P,74:N},t(U,[2,83],{66:94,68:I,69:L,70:R,71:D,72:M}),t(Q,[2,84]),t(Q,[2,85]),t(Q,[2,86]),t(Q,[2,87]),t(Q,[2,88]),t(G,[2,89]),t(G,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:i,43:23,48:s,54:u,56:h},{16:100,60:f,86:T,100:S,102:O},{41:[1,102],45:101,51:X},{16:104,60:f,86:T,100:S,102:O},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:Y,50:le,59:110,60:q,82:Z,84:111,85:112,86:ee,87:re,88:ve,89:ae,90:Ce},{60:[1,122]},{13:B,55:123},t(F,[2,72]),t(F,[2,138]),{22:Y,50:le,59:124,60:q,61:[1,125],82:Z,84:111,85:112,86:ee,87:re,88:ve,89:ae,90:Ce},t(Oe,[2,74]),{16:39,17:40,19:126,60:f,86:T,100:S,102:O,103:k},t(V,[2,16]),t(V,[2,17]),t(V,[2,18]),{11:127,12:$e,39:[2,36]},t(he,[2,9],{16:85,17:86,15:130,18:[1,129],60:f,86:T,100:S,102:O,103:k}),t(he,[2,10]),t(fe,[2,55],{11:131,12:$e}),t(E,[2,7]),{9:[1,132]},t(Te,[2,67]),{16:39,17:40,19:133,60:f,86:T,100:S,102:O,103:k},{13:[1,135],16:39,17:40,19:134,60:f,86:T,100:S,102:O,103:k},t(U,[2,82],{66:136,68:I,69:L,70:R,71:D,72:M}),t(U,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:i,43:23,48:s,54:u,56:h},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(F,[2,48],{39:[1,142]}),{41:[1,143]},t(F,[2,50]),{41:[2,61],45:144,51:X},{47:[1,145]},{16:39,17:40,19:146,60:f,86:T,100:S,102:O,103:k},t(_,[2,91],{13:[1,147]}),t(_,[2,93],{13:[1,149],77:[1,148]}),t(_,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(_,[2,105],{61:ge}),t(Qe,[2,107],{85:154,22:Y,50:le,60:q,82:Z,86:ee,87:re,88:ve,89:ae,90:Ce}),t(Se,[2,109]),t(Se,[2,111]),t(Se,[2,112]),t(Se,[2,113]),t(Se,[2,114]),t(Se,[2,115]),t(Se,[2,116]),t(Se,[2,117]),t(Se,[2,118]),t(Se,[2,119]),t(_,[2,106]),t(F,[2,71]),t(_,[2,73],{61:ge}),{60:[1,155]},t(V,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:f,86:T,100:S,102:O,103:k},t(he,[2,12]),t(fe,[2,56]),{1:[2,4]},t(Te,[2,69]),t(Te,[2,68]),{16:39,17:40,19:158,60:f,86:T,100:S,102:O,103:k},t(U,[2,80]),t(F,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:i,43:23,48:s,54:u,56:h},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:i,43:23,48:s,54:u,56:h},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:i,43:23,48:s,54:u,56:h},{45:163,51:X},t(F,[2,49]),{41:[2,62]},t(F,[2,52],{39:[1,164]}),t(_,[2,60]),t(_,[2,92]),t(_,[2,94]),t(_,[2,95],{77:[1,165]}),t(_,[2,98]),t(_,[2,99],{13:[1,166]}),t(_,[2,101],{13:[1,168],77:[1,167]}),{22:Y,50:le,60:q,82:Z,84:169,85:112,86:ee,87:re,88:ve,89:ae,90:Ce},t(Se,[2,110]),t(Oe,[2,75]),{14:[1,170]},t(he,[2,11]),t(Te,[2,70]),t(F,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:X},t(_,[2,96]),t(_,[2,100]),t(_,[2,102]),t(_,[2,103],{77:[1,174]}),t(Qe,[2,108],{85:154,22:Y,50:le,60:q,82:Z,86:ee,87:re,88:ve,89:ae,90:Ce}),t(fe,[2,8]),t(F,[2,51]),{41:[1,175]},t(F,[2,54]),t(_,[2,104]),t(F,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:C(function(be,ne){if(ne.recoverable)this.trace(be);else{var j=new Error(be);throw j.hash=ne,j}},"parseError"),parse:C(function(be){var ne=this,j=[0],ie=[],pe=[null],te=[],ye=this.table,oe="",_e=0,Le=0,Ye=2,Pe=1,Xe=te.slice.call(arguments,1),Ne=Object.create(this.lexer),Ze={yy:{}};for(var Ge in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ge)&&(Ze.yy[Ge]=this.yy[Ge]);Ne.setInput(be,Ze.yy),Ze.yy.lexer=Ne,Ze.yy.parser=this,typeof Ne.yylloc>"u"&&(Ne.yylloc={});var lt=Ne.yylloc;te.push(lt);var Fe=Ne.options&&Ne.options.ranges;typeof Ze.yy.parseError=="function"?this.parseError=Ze.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function wt(Mt){j.length=j.length-2*Mt,pe.length=pe.length-Mt,te.length=te.length-Mt}C(wt,"popStack");function Me(){var Mt;return Mt=ie.pop()||Ne.lex()||Pe,typeof Mt!="number"&&(Mt instanceof Array&&(ie=Mt,Mt=ie.pop()),Mt=ne.symbols_[Mt]||Mt),Mt}C(Me,"lex");for(var Rt,Lt,ut,Xt,Ft={},gt,Ae,zt,kt;;){if(Lt=j[j.length-1],this.defaultActions[Lt]?ut=this.defaultActions[Lt]:((Rt===null||typeof Rt>"u")&&(Rt=Me()),ut=ye[Lt]&&ye[Lt][Rt]),typeof ut>"u"||!ut.length||!ut[0]){var At="";kt=[];for(gt in ye[Lt])this.terminals_[gt]&>>Ye&&kt.push("'"+this.terminals_[gt]+"'");Ne.showPosition?At="Parse error on line "+(_e+1)+`: +`;S.append("path").attr("d",T),h==="neo"&&S.attr("filter","url(#drop-shadow)");const O=i.get(e.name)??0;J1.has(l)?(S.style("stroke",f[O%f.length]),S.style("fill",d[O%f.length])):S.style("stroke",p),S.attr("transform",`translate(${b}, ${A})`),e.rectData=v,eb(r,io(e.description))(e.description,m,v.x,v.y+35,v.width,v.height,{class:`actor ${Ene}`},r);const k=S.select("path:last-child");if(k.node()){const _=k.node().getBBox();e.height=_.height+(r.sequence.labelBoxHeight??0)}return n||(m.attr("data-et","participant"),m.attr("data-type","database"),m.attr("data-id",e.name)),e.height},"drawActorTypeDatabase"),JHn=C(function(t,e,r,n,i){const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+80,l=22,u=t.append("g").lower(),{look:h,theme:d,themeVariables:f}=r,{bkgColorArray:p,borderColorArray:g,actorBorder:m}=f;n||(bi++,u.append("line").attr("id","actor"+bi).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=bi);const v=t.append("g");let y=QO;n?y+=` ${gw}`:y+=` ${pw}`,v.attr("class",y),v.attr("name",e.name);const b=tf();b.x=e.x,b.y=a,b.fill="#eaeaea",b.width=e.width,b.height=e.height,b.class="actor",v.append("line").attr("id","actor-man-torso"+bi).attr("x1",e.x+e.width/2-l*2.5).attr("y1",a+12).attr("x2",e.x+e.width/2-15).attr("y2",a+12),v.append("line").attr("id","actor-man-arms"+bi).attr("x1",e.x+e.width/2-l*2.5).attr("y1",a+2).attr("x2",e.x+e.width/2-l*2.5).attr("y2",a+22),v.append("circle").attr("cx",e.x+e.width/2).attr("cy",a+12).attr("r",l),h==="neo"&&v.attr("filter","url(#drop-shadow)");const x=i.get(e.name)??0;J1.has(d)?(v.style("stroke",g[x%g.length]),v.style("fill",p[x%g.length])):v.style("stroke",m);const w=v.node().getBBox();return e.height=w.height+(r.sequence.labelBoxHeight??0),eb(r,io(e.description))(e.description,v,b.x,b.y+15,b.width,b.height,{class:`actor ${QO}`},r),v.attr("transform",`translate(0,${l/2+10})`),n||(v.attr("data-et","participant"),v.attr("data-type","boundary"),v.attr("data-id",e.name)),e.height},"drawActorTypeBoundary"),eWn=C(function(t,e,r,n,i){const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+80,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=h,g=t.append("g").lower();n||(bi++,g.append("line").attr("id","actor"+bi).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=bi);const m=t.append("g");let v=QO;n?v+=` ${gw}`:v+=` ${pw}`,m.attr("class",v),m.attr("name",e.name),n||m.attr("data-et","participant").attr("data-type","actor").attr("data-id",e.name);const y=l==="neo"?.5:1,b=l==="neo"?a+(1-y)*30:a;m.append("line").attr("id","actor-man-torso"+bi).attr("x1",s).attr("y1",b+25*y).attr("x2",s).attr("y2",b+45*y),m.append("line").attr("id","actor-man-arms"+bi).attr("x1",s-VO/2*y).attr("y1",b+33*y).attr("x2",s+VO/2*y).attr("y2",b+33*y),m.append("line").attr("x1",s-VO/2*y).attr("y1",b+60*y).attr("x2",s).attr("y2",b+45*y),m.append("line").attr("x1",s).attr("y1",b+45*y).attr("x2",s+(VO/2-2)*y).attr("y2",b+60*y);const x=m.append("circle");x.attr("cx",e.x+e.width/2),x.attr("cy",b+10*y),x.attr("r",15*y),x.attr("width",e.width*y),x.attr("height",e.height*y);const w=m.node().getBBox();e.height=w.height;const A=tf();A.x=e.x,A.y=b,A.fill="#eaeaea",A.width=e.width,A.height=e.height/y,A.class="actor",A.rx=3,A.ry=3;const S=i.get(e.name)??0;return J1.has(u)?(m.style("stroke",f[S%f.length]),m.style("fill",d[S%f.length])):m.style("stroke",p),eb(r,io(e.description))(e.description,m,A.x,b+35*y-(l==="neo"?10:0),A.width,A.height,{class:`actor ${QO}`},r),e.height},"drawActorTypeActor"),tWn=C(async function(t,e,r,n,i,a,s){const o=s??new Map([...a.db.getActors().values()].map((l,u)=>[l.name,u]));switch(e.type){case"actor":return await eWn(t,e,r,n,o);case"participant":return await YHn(t,e,r,n,o);case"boundary":return await JHn(t,e,r,n,o);case"control":return await XHn(t,e,r,n,i,o);case"entity":return await KHn(t,e,r,n,o);case"database":return await ZHn(t,e,r,n,o);case"collections":return await qHn(t,e,r,n,o);case"queue":return await jHn(t,e,r,n,o)}},"drawActor"),rWn=C(function(t,e,r){const i=t.append("g");tqt(i,e),e.name&&eb(r)(e.name,i,e.x,e.y+r.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),i.lower()},"drawBox"),nWn=C(function(t){return t.append("g")},"anchorElement"),iWn=C(function(t,e,r,n,i,a,s){const{theme:o,themeVariables:l}=n,{bkgColorArray:u,borderColorArray:h,mainBkg:d}=l,f=tf(),p=e.anchored,g=e.actor;f.x=e.startx,f.y=e.starty,f.class="activation"+i%3,f.width=e.stopx-e.startx,f.height=r-e.starty;const m=Tz(p,f),y=(s??new Map([...a.db.getActors().values()].map((b,x)=>[b.name,x]))).get(g)??0;J1.has(o)&&(m.style("stroke",h[y%h.length]),m.style("fill",u[y%h.length]??d))},"drawActivation"),aWn=C(async function(t,e,r,n,i){const{boxMargin:a,boxTextMargin:s,labelBoxHeight:o,labelBoxWidth:l,messageFontFamily:u,messageFontSize:h,messageFontWeight:d}=n,f=t.append("g").attr("data-et","control-structure").attr("data-id","i"+i.id),p=C(function(v,y,b,x){return f.append("line").attr("x1",v).attr("y1",y).attr("x2",b).attr("y2",x).attr("class","loopLine")},"drawLoopLine");p(e.startx,e.starty,e.stopx,e.starty),p(e.stopx,e.starty,e.stopx,e.stopy),p(e.startx,e.stopy,e.stopx,e.stopy),p(e.startx,e.starty,e.startx,e.stopy),e.sections!==void 0&&e.sections.forEach(function(v){p(e.startx,v.y,e.stopx,v.y).style("stroke-dasharray","3, 3")});let g=Eke();g.text=r,g.x=e.startx,g.y=e.starty,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.anchor="middle",g.valign="middle",g.tspan=!1,g.width=Math.max(l??0,50),g.height=o+(n.look==="neo"?15:0)||20,g.textMargin=s,g.class="labelText",JYt(f,g),g=rqt(),g.text=e.title,g.x=e.startx+l/2+(e.stopx-e.startx)/2,g.y=e.starty+a+s,g.anchor="middle",g.valign="middle",g.textMargin=s,g.class="loopText",g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=!0;let m=io(g.text)?await Rne(f,g,e):qR(f,g);if(e.sectionTitles!==void 0){for(const[v,y]of Object.entries(e.sectionTitles))if(y.message){g.text=y.message,g.x=e.startx+(e.stopx-e.startx)/2,g.y=e.sections[v].y+a+s,g.class="sectionTitle",g.anchor="middle",g.valign="middle",g.tspan=!1,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=e.wrap,io(g.text)?(e.starty=e.sections[v].y,await Rne(f,g,e)):qR(f,g);let b=Math.round(m.map(x=>(x._groups||x)[0][0].getBBox().height).reduce((x,w)=>x+w));e.sections[v].height+=b-(a+s)}}return e.height=Math.round(e.stopy-e.starty),f},"drawLoop"),tqt=C(function(t,e){O6t(t,e)},"drawBackgroundRect"),sWn=C(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),oWn=C(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),lWn=C(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),cWn=C(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),uWn=C(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),hWn=C(function(t,e){t.append("defs").append("marker").attr("id",e+"-sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),dWn=C(function(t,e){t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),fWn=C(function(t,e){const{theme:r}=e;t.append("defs").append("filter").attr("id","drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${r==="redux"||r==="redux-color"?"#000000":"#FFFFFF"}`)},"insertDropShadow"),rqt=C(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),pWn=C(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),eb=function(){function t(a,s,o,l,u,h,d){const f=s.append("text").attr("x",o+u/2).attr("y",l+h/2+5).style("text-anchor","middle").text(a);i(f,d)}C(t,"byText");function e(a,s,o,l,u,h,d,f){const{actorFontSize:p,actorFontFamily:g,actorFontWeight:m}=f,[v,y]=By(p),b=a.split(jt.lineBreakRegex);for(let x=0;xt.height||0))+(this.loops.length===0?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.messages.length===0?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.notes.length===0?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},"getHeight"),clear:C(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:C(function(t){this.boxes.push(t)},"addBox"),addActor:C(function(t){this.actors.push(t)},"addActor"),addLoop:C(function(t){this.loops.push(t)},"addLoop"),addMessage:C(function(t){this.messages.push(t)},"addMessage"),addNote:C(function(t){this.notes.push(t)},"addNote"),lastActor:C(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:C(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:C(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:C(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:C(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,sqt(He())},"init"),updateVal:C(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:C(function(t,e,r,n){const i=this;let a=0;function s(o){return C(function(u){a++;const h=i.sequenceItems.length-a+1;i.updateVal(u,"starty",e-h*tt.boxMargin,Math.min),i.updateVal(u,"stopy",n+h*tt.boxMargin,Math.max),i.updateVal(Bt.data,"startx",t-h*tt.boxMargin,Math.min),i.updateVal(Bt.data,"stopx",r+h*tt.boxMargin,Math.max),o!=="activation"&&(i.updateVal(u,"startx",t-h*tt.boxMargin,Math.min),i.updateVal(u,"stopx",r+h*tt.boxMargin,Math.max),i.updateVal(Bt.data,"starty",e-h*tt.boxMargin,Math.min),i.updateVal(Bt.data,"stopy",n+h*tt.boxMargin,Math.max))},"updateItemBounds")}C(s,"updateFn"),this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))},"updateBounds"),insert:C(function(t,e,r,n){const i=jt.getMin(t,r),a=jt.getMax(t,r),s=jt.getMin(e,n),o=jt.getMax(e,n);this.updateVal(Bt.data,"startx",i,Math.min),this.updateVal(Bt.data,"starty",s,Math.min),this.updateVal(Bt.data,"stopx",a,Math.max),this.updateVal(Bt.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),newActivation:C(function(t,e,r){const n=r.get(t.from),i=Dne(t.from).length||0,a=n.x+n.width/2+(i-1)*tt.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+tt.activationWidth,stopy:void 0,actor:t.from,anchored:za.anchorElement(e)})},"newActivation"),endActivation:C(function(t){const e=this.activations.map(function(r){return r.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:C(function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},"createLoop"),newLoop:C(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:C(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:C(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:C(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:Bt.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:C(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:C(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:C(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=jt.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:C(function(){return this.verticalPos},"getVerticalPos"),getBounds:C(function(){return{bounds:this.data,models:this.models}},"getBounds")},xWn=C(async function(t,e,r){Bt.bumpVerticalPos(tt.boxMargin),e.height=tt.boxMargin,e.starty=Bt.getVerticalPos();const n=tf();n.x=e.startx,n.y=e.starty,n.width=e.width||tt.width,n.class="note";const i=t.append("g");i.attr("data-et","note"),i.attr("data-id","i"+r);const a=za.drawRect(i,n),s=Eke();s.x=e.startx,s.y=e.starty,s.width=n.width,s.dy="1em",s.text=e.message,s.class="noteText",s.fontFamily=tt.noteFontFamily,s.fontSize=tt.noteFontSize,s.fontWeight=tt.noteFontWeight,s.anchor=tt.noteAlign,s.textMargin=tt.noteMargin,s.valign="center";const o=io(s.text)?await Rne(i,s):qR(i,s),l=Math.round(o.map(u=>(u._groups||u)[0][0].getBBox().height).reduce((u,h)=>u+h));a.attr("height",l+2*tt.noteMargin),e.height+=l+2*tt.noteMargin,Bt.bumpVerticalPos(l+2*tt.noteMargin),e.stopy=e.starty+l+2*tt.noteMargin,e.stopx=e.startx+n.width,Bt.insert(e.startx,e.starty,e.stopx,e.stopy),Bt.models.addNote(e)},"drawNote"),nqt=C(function(t,e,r,n,i,a,s){const o=n.db.getActors(),l=o.get(e.from),u=o.get(e.to),h=r.sequenceVisible;let d=l.x+l.width/2,f=u.x+u.width/2;const p=d<=f,g=hqt(e,n),m=t.append("g"),v=16.5,y=C((S,T)=>{const O=S?v:-v;return T?-O:O},"getCircleOffset"),b=C(S=>{m.append("circle").attr("cx",S).attr("cy",s).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:x,CENTRAL_CONNECTION_REVERSE:w,CENTRAL_CONNECTION_DUAL:A}=n.db.LINETYPE;if(h)switch(e.centralConnection){case x:g&&(f+=y(p,!0));break;case w:g||(d+=y(p,!1));break;case A:g?f+=y(p,!0):d+=y(p,!1);break}switch(e.centralConnection){case x:b(f);break;case w:b(d);break;case A:b(d),b(f);break}},"drawCentralConnection"),GO=C(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),jR=C(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),GRe=C(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function iqt(t,e){Bt.bumpVerticalPos(10);const{startx:r,stopx:n,message:i}=e,a=jt.splitBreaks(i).length,s=io(i),o=s?await IB(i,He()):ln.calculateTextDimensions(i,GO(tt));if(!s){const d=o.height/a;e.height+=d,Bt.bumpVerticalPos(d)}let l,u=o.height-10;const h=o.width;if(r===n){l=Bt.getVerticalPos()+u,tt.rightAngles||(u+=tt.boxMargin,l=Bt.getVerticalPos()+u),u+=30;const d=jt.getMax(h/2,tt.width/2);Bt.insert(r-d,Bt.getVerticalPos()-10+u,n+d,Bt.getVerticalPos()+30+u)}else u+=tt.boxMargin,l=Bt.getVerticalPos()+u,Bt.insert(r,l-10,n,l);return Bt.bumpVerticalPos(u),e.height+=u,e.stopy=e.starty+e.height,Bt.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}C(iqt,"boundMessage");var wWn=C(async function(t,e,r,n,i,a){const{startx:s,stopx:o,starty:l,message:u,type:h,sequenceIndex:d,sequenceVisible:f}=e,p=ln.calculateTextDimensions(u,GO(tt)),g=Eke();g.x=Math.min(s,o),g.y=l+10,g.width=Math.abs(o-s),g.class="messageText",g.dy="1em",g.text=u,g.fontFamily=tt.messageFontFamily,g.fontSize=tt.messageFontSize,g.fontWeight=tt.messageFontWeight,g.anchor=tt.messageAlign,g.valign="center",g.textMargin=tt.wrapPadding,g.tspan=!1,io(g.text)?await Rne(t,g,{startx:s,stopx:o,starty:r}):qR(t,g);const m=p.width;let v;if(s===o){const b=f||tt.showSequenceNumbers,x=hqt(i,n),w=EWn(i,n),A=s+(b&&(x||w)?10:0);tt.rightAngles?v=t.append("path").attr("d",`M ${A},${r} H ${s+jt.getMax(tt.width/2,m/2)} V ${r+25} H ${s}`):v=t.append("path").attr("d","M "+A+","+r+" C "+(A+60)+","+(r-10)+" "+(s+60)+","+(r+30)+" "+s+","+(r+20)),WRe(i,n)&&nqt(t,i,e,n,s,o,r)}else v=t.append("line"),v.attr("x1",s),v.attr("y1",r),v.attr("x2",o),v.attr("y2",r),WRe(i,n)&&nqt(t,i,e,n,s,o,r);h===n.db.LINETYPE.DOTTED||h===n.db.LINETYPE.DOTTED_CROSS||h===n.db.LINETYPE.DOTTED_POINT||h===n.db.LINETYPE.DOTTED_OPEN||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED||h===n.db.LINETYPE.SOLID_TOP_DOTTED||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED||h===n.db.LINETYPE.STICK_TOP_DOTTED||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(v.style("stroke-dasharray","3, 3"),v.attr("class","messageLine1")):v.attr("class","messageLine0"),v.attr("data-et","message"),v.attr("data-id","i"+e.id),v.attr("data-from",e.from),v.attr("data-to",e.to);let y="";if(tt.arrowMarkerAbsolute&&(y=Eq(!0)),v.attr("stroke-width",2),v.attr("stroke","none"),v.style("fill","none"),(h===n.db.LINETYPE.SOLID_TOP||h===n.db.LINETYPE.SOLID_TOP_DOTTED)&&v.attr("marker-end","url("+y+"#"+a+"-solidTopArrowHead)"),(h===n.db.LINETYPE.SOLID_BOTTOM||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&v.attr("marker-end","url("+y+"#"+a+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.STICK_TOP||h===n.db.LINETYPE.STICK_TOP_DOTTED)&&v.attr("marker-end","url("+y+"#"+a+"-stickTopArrowHead)"),(h===n.db.LINETYPE.STICK_BOTTOM||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED)&&v.attr("marker-end","url("+y+"#"+a+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&v.attr("marker-start","url("+y+"#"+a+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&v.attr("marker-start","url("+y+"#"+a+"-solidTopArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&v.attr("marker-start","url("+y+"#"+a+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&v.attr("marker-start","url("+y+"#"+a+"-stickTopArrowHead)"),(h===n.db.LINETYPE.SOLID||h===n.db.LINETYPE.DOTTED)&&v.attr("marker-end","url("+y+"#"+a+"-arrowhead)"),(h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(v.attr("marker-start","url("+y+"#"+a+"-arrowhead)"),v.attr("marker-end","url("+y+"#"+a+"-arrowhead)")),(h===n.db.LINETYPE.SOLID_POINT||h===n.db.LINETYPE.DOTTED_POINT)&&v.attr("marker-end","url("+y+"#"+a+"-filled-head)"),(h===n.db.LINETYPE.SOLID_CROSS||h===n.db.LINETYPE.DOTTED_CROSS)&&v.attr("marker-end","url("+y+"#"+a+"-crosshead)"),f||tt.showSequenceNumbers){const b=h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED,x=h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,w=6,A=WRe(i,n);let S=s,T=o;b?(ss?T=o-2*w:(T=o-w,S+=(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_DUAL||(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),T+=A?15:0,v.attr("x2",T),v.attr("x1",S)):v.attr("x1",s+w);let O=0;const k=s===o,E=s<=o;k?O=e.fromBounds+1:x?O=E?e.toBounds-1:e.fromBounds+1:O=E?e.fromBounds+1:e.toBounds-1;let _="12px";const I=d.toString().length;I>5?_="7px":I>3&&(_="9px"),t.append("line").attr("x1",O).attr("y1",r).attr("x2",O).attr("y2",r).attr("stroke-width",0).attr("marker-start","url("+y+"#"+a+"-sequencenumber)"),t.append("text").attr("x",O).attr("y",r+4).attr("font-family","sans-serif").attr("font-size",_).attr("text-anchor","middle").attr("class","sequenceNumber").text(d)}},"drawMessage"),AWn=C(function(t,e,r,n,i,a,s){let o=0,l=0,u,h=0;for(const d of n){const f=e.get(d),p=f.box;u&&u!=p&&(s||Bt.models.addBox(u),l+=tt.boxMargin+u.margin),p&&p!=u&&(s||(p.x=o+l,p.y=i),l+=p.margin),f.width=jt.getMax(f.width||tt.width,tt.width),f.height=jt.getMax(f.height||tt.height,tt.height),f.margin=f.margin||tt.actorMargin,h=jt.getMax(h,f.height),r.get(f.name)&&(l+=f.width/2),f.x=o+l,f.starty=Bt.getVerticalPos(),Bt.insert(f.x,i,f.x+f.width,f.height),o+=f.width+l,f.box&&(f.box.width=o+p.margin-f.box.x),l=f.margin,u=f.box,Bt.models.addActor(f)}u&&!s&&Bt.models.addBox(u),Bt.bumpVerticalPos(h)},"addActorRenderingData"),HRe=C(async function(t,e,r,n,i,a,s){if(n){let o=0;Bt.bumpVerticalPos(tt.boxMargin*2);for(const l of r){const u=e.get(l);u.stopy||(u.stopy=Bt.getVerticalPos());const h=await za.drawActor(t,u,tt,!0,i,a,s);o=jt.getMax(o,h)}Bt.bumpVerticalPos(o+tt.boxMargin)}else for(const o of r){const l=e.get(o);await za.drawActor(t,l,tt,!1,i,a,s)}},"drawActors"),aqt=C(function(t,e,r,n){let i=0,a=0;for(const s of r){const o=e.get(s),l=TWn(o),u=za.drawPopup(t,o,l,tt,tt.forceMenus,n);u.height>i&&(i=u.height),u.width+o.x>a&&(a=u.width+o.x)}return{maxHeight:i,maxWidth:a}},"drawActorsPopup"),sqt=C(function(t){Eo(tt,t),t.fontFamily&&(tt.actorFontFamily=tt.noteFontFamily=tt.messageFontFamily=t.fontFamily),t.fontSize&&(tt.actorFontSize=tt.noteFontSize=tt.messageFontSize=t.fontSize),t.fontWeight&&(tt.actorFontWeight=tt.noteFontWeight=tt.messageFontWeight=t.fontWeight)},"setConf"),Dne=C(function(t){return Bt.activations.filter(function(e){return e.actor===t})},"actorActivations"),oqt=C(function(t,e){const r=e.get(t),n=Dne(t),i=n.reduce(function(s,o){return jt.getMin(s,o.startx)},r.x+r.width/2-1),a=n.reduce(function(s,o){return jt.getMax(s,o.stopx)},r.x+r.width/2+1);return[i,a]},"activationBounds");function Pg(t,e,r,n,i){Bt.bumpVerticalPos(r);let a=n;if(e.id&&e.message&&t[e.id]){const s=t[e.id].width,o=GO(tt);e.message=ln.wrapLabel(`[${e.message}]`,s-2*tt.wrapPadding,o),e.width=s,e.wrap=!0;const l=ln.calculateTextDimensions(e.message,o),u=jt.getMax(l.height,tt.labelBoxHeight);a=n+u,me.debug(`${u} - ${e.message}`)}i(e),Bt.bumpVerticalPos(a)}C(Pg,"adjustLoopHeightForWrap");function lqt(t,e,r,n,i,a,s){function o(h,d){h.x{z.add(U.from),z.add(U.to)}),v=v.filter(U=>z.has(U))}const S=new Map(v.map((z,U)=>{var Q;return[((Q=f.get(z))==null?void 0:Q.name)??z,U]}));AWn(d,f,p,v,0,y,!1);const T=await RWn(y,f,A,n);za.insertArrowHead(d,e),za.insertArrowCrossHead(d,e),za.insertArrowFilledHead(d,e),za.insertSequenceNumber(d,e),za.insertSolidTopArrowHead(d,e),za.insertSolidBottomArrowHead(d,e),za.insertStickTopArrowHead(d,e),za.insertStickBottomArrowHead(d,e),s==="neo"&&za.insertDropShadow(d,tt);function O(z,U){const Q=Bt.endActivation(z);Q.starty+18>U&&(Q.starty=U-6,U+=12),za.drawActivation(d,Q,U,tt,Dne(z.from).length,n,S),Bt.insert(Q.startx,U-10,Q.stopx,U)}C(O,"activeEnd");let k=1,E=1;const _=[],I=[];let L=0;for(const z of y){let U,Q,G;switch(z.type){case n.db.LINETYPE.NOTE:Bt.resetVerticalPos(),Q=z.noteModel,await xWn(d,Q,z.id);break;case n.db.LINETYPE.ACTIVE_START:Bt.newActivation(z,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION:Bt.newActivation(z,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:Bt.newActivation(z,d,f);break;case n.db.LINETYPE.ACTIVE_END:O(z,Bt.getVerticalPos());break;case n.db.LINETYPE.LOOP_START:Pg(T,z,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,X=>Bt.newLoop(X));break;case n.db.LINETYPE.LOOP_END:U=Bt.endLoop(),await za.drawLoop(d,U,"loop",tt,z),Bt.bumpVerticalPos(U.stopy-Bt.getVerticalPos()),Bt.models.addLoop(U);break;case n.db.LINETYPE.RECT_START:Pg(T,z,tt.boxMargin,tt.boxMargin,X=>{let Y=X.message;Y||(Y=(o==null?void 0:o.rectBkgColor)||(o==null?void 0:o.actorBkg)||"rgba(128, 128, 128, 0.5)"),Bt.newLoop(void 0,Y)});break;case n.db.LINETYPE.RECT_END:U=Bt.endLoop(),I.push(U),Bt.models.addLoop(U),Bt.bumpVerticalPos(U.stopy-Bt.getVerticalPos());break;case n.db.LINETYPE.OPT_START:Pg(T,z,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,X=>Bt.newLoop(X));break;case n.db.LINETYPE.OPT_END:U=Bt.endLoop(),await za.drawLoop(d,U,"opt",tt,z),Bt.bumpVerticalPos(U.stopy-Bt.getVerticalPos()),Bt.models.addLoop(U);break;case n.db.LINETYPE.ALT_START:Pg(T,z,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,X=>Bt.newLoop(X));break;case n.db.LINETYPE.ALT_ELSE:Pg(T,z,tt.boxMargin+tt.boxTextMargin,tt.boxMargin,X=>Bt.addSectionToLoop(X));break;case n.db.LINETYPE.ALT_END:U=Bt.endLoop(),await za.drawLoop(d,U,"alt",tt,z),Bt.bumpVerticalPos(U.stopy-Bt.getVerticalPos()),Bt.models.addLoop(U);break;case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:Pg(T,z,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,X=>Bt.newLoop(X)),Bt.saveVerticalPos();break;case n.db.LINETYPE.PAR_AND:Pg(T,z,tt.boxMargin+tt.boxTextMargin,tt.boxMargin,X=>Bt.addSectionToLoop(X));break;case n.db.LINETYPE.PAR_END:U=Bt.endLoop(),await za.drawLoop(d,U,"par",tt,z),Bt.bumpVerticalPos(U.stopy-Bt.getVerticalPos()),Bt.models.addLoop(U);break;case n.db.LINETYPE.AUTONUMBER:k=z.message.start||k,E=z.message.step||E,z.message.visible?n.db.enableSequenceNumbers():n.db.disableSequenceNumbers();break;case n.db.LINETYPE.CRITICAL_START:Pg(T,z,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,X=>Bt.newLoop(X));break;case n.db.LINETYPE.CRITICAL_OPTION:Pg(T,z,tt.boxMargin+tt.boxTextMargin,tt.boxMargin,X=>Bt.addSectionToLoop(X));break;case n.db.LINETYPE.CRITICAL_END:U=Bt.endLoop(),await za.drawLoop(d,U,"critical",tt,z),Bt.bumpVerticalPos(U.stopy-Bt.getVerticalPos()),Bt.models.addLoop(U);break;case n.db.LINETYPE.BREAK_START:Pg(T,z,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,X=>Bt.newLoop(X));break;case n.db.LINETYPE.BREAK_END:U=Bt.endLoop(),await za.drawLoop(d,U,"break",tt,z),Bt.bumpVerticalPos(U.stopy-Bt.getVerticalPos()),Bt.models.addLoop(U);break;default:try{G=z.msgModel,G.starty=Bt.getVerticalPos(),G.sequenceIndex=k,G.sequenceVisible=n.db.showSequenceNumbers(),G.id=z.id,G.from=z.from,G.to=z.to;const X=await iqt(d,G);lqt(z,G,X,L,f,p,g),_.push({messageModel:G,lineStartY:X,msg:z}),Bt.models.addMessage(G)}catch(X){me.error("error while drawing message",X)}}[n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN,n.db.LINETYPE.SOLID,n.db.LINETYPE.SOLID_TOP,n.db.LINETYPE.SOLID_BOTTOM,n.db.LINETYPE.STICK_TOP,n.db.LINETYPE.STICK_BOTTOM,n.db.LINETYPE.SOLID_TOP_DOTTED,n.db.LINETYPE.SOLID_BOTTOM_DOTTED,n.db.LINETYPE.STICK_TOP_DOTTED,n.db.LINETYPE.STICK_BOTTOM_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.DOTTED,n.db.LINETYPE.SOLID_CROSS,n.db.LINETYPE.DOTTED_CROSS,n.db.LINETYPE.SOLID_POINT,n.db.LINETYPE.DOTTED_POINT,n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(z.type)&&(k=Math.round((k+E)*100)/100),L++}me.debug("createdActors",p),me.debug("destroyedActors",g),await HRe(d,f,v,!1,e,n,S);for(const z of _)await wWn(d,z.messageModel,z.lineStartY,n,z.msg,e);tt.mirrorActors&&await HRe(d,f,v,!0,e,n,S),I.forEach(z=>za.drawBackgroundRect(d,z)),eqt(d,f,v,tt);for(const z of Bt.models.boxes){z.height=Bt.getVerticalPos()-z.y,Bt.insert(z.x,z.y,z.x+z.width,z.height);const U=tt.boxMargin*2;z.startx=z.x-U,z.starty=z.y-U*.25,z.stopx=z.startx+z.width+2*U,z.stopy=z.starty+z.height+U*.75,z.stroke="rgb(0,0,0, 0.5)",za.drawBox(d,z,tt)}x&&Bt.bumpVerticalPos(tt.boxMargin);const R=aqt(d,f,v,h),{bounds:D}=Bt.getBounds();D.startx===void 0&&(D.startx=0),D.starty===void 0&&(D.starty=0),D.stopx===void 0&&(D.stopx=0),D.stopy===void 0&&(D.stopy=0);let M=D.stopy-D.starty;M{const s=GO(tt);let o=a.actorKeys.reduce((d,f)=>d+=t.get(f).width+(t.get(f).margin||0),0);const l=tt.boxMargin*8;o+=l,o-=2*tt.boxTextMargin,a.wrap&&(a.name=ln.wrapLabel(a.name,o-2*tt.wrapPadding,s));const u=ln.calculateTextDimensions(a.name,s);i=jt.getMax(u.height,i);const h=jt.getMax(o,u.width+2*tt.wrapPadding);if(a.margin=tt.boxTextMargin,oa.textMaxHeight=i),jt.getMax(n,tt.height)}C(uqt,"calculateActorMargins");var CWn=C(async function(t,e,r){const n=e.get(t.from),i=e.get(t.to),a=n.x,s=i.x,o=t.wrap&&t.message;let l=io(t.message)?await IB(t.message,He()):ln.calculateTextDimensions(o?ln.wrapLabel(t.message,tt.width,jR(tt)):t.message,jR(tt));const u={width:o?tt.width:jt.getMax(tt.width,l.width+2*tt.noteMargin),height:0,startx:n.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===r.db.PLACEMENT.RIGHTOF?(u.width=o?jt.getMax(tt.width,l.width):jt.getMax(n.width/2+i.width/2,l.width+2*tt.noteMargin),u.startx=a+(n.width+tt.actorMargin)/2):t.placement===r.db.PLACEMENT.LEFTOF?(u.width=o?jt.getMax(tt.width,l.width+2*tt.noteMargin):jt.getMax(n.width/2+i.width/2,l.width+2*tt.noteMargin),u.startx=a-u.width+(n.width-tt.actorMargin)/2):t.to===t.from?(l=ln.calculateTextDimensions(o?ln.wrapLabel(t.message,jt.getMax(tt.width,n.width),jR(tt)):t.message,jR(tt)),u.width=o?jt.getMax(tt.width,n.width):jt.getMax(n.width,tt.width,l.width+2*tt.noteMargin),u.startx=a+(n.width-u.width)/2):(u.width=Math.abs(a+n.width/2-(s+i.width/2))+tt.actorMargin,u.startx=a2,f=C(v=>l?-v:v,"adjustValue");t.from===t.to?h=u:(t.activate&&!d&&(h+=f(tt.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)||(h+=f(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)&&(u-=f(3)));const p=[i,a,s,o],g=Math.abs(u-h);t.wrap&&t.message&&(t.message=ln.wrapLabel(t.message,jt.getMax(g+2*tt.wrapPadding,tt.width),GO(tt)));const m=ln.calculateTextDimensions(t.message,GO(tt));return{width:jt.getMax(t.wrap?0:m.width+2*tt.wrapPadding,g+2*tt.wrapPadding,tt.width),height:0,startx:u,stopx:h,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,p),toBounds:Math.max.apply(null,p)}},"buildMessageModel"),RWn=C(async function(t,e,r,n){const i={},a=[];let s,o,l;for(const u of t){switch(u.type){case n.db.LINETYPE.LOOP_START:case n.db.LINETYPE.ALT_START:case n.db.LINETYPE.OPT_START:case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:case n.db.LINETYPE.CRITICAL_START:case n.db.LINETYPE.BREAK_START:a.push({id:u.id,msg:u.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case n.db.LINETYPE.ALT_ELSE:case n.db.LINETYPE.PAR_AND:case n.db.LINETYPE.CRITICAL_OPTION:u.message&&(s=a.pop(),i[s.id]=s,i[u.id]=s,a.push(s));break;case n.db.LINETYPE.LOOP_END:case n.db.LINETYPE.ALT_END:case n.db.LINETYPE.OPT_END:case n.db.LINETYPE.PAR_END:case n.db.LINETYPE.CRITICAL_END:case n.db.LINETYPE.BREAK_END:s=a.pop(),i[s.id]=s;break;case n.db.LINETYPE.ACTIVE_START:{const d=e.get(u.from?u.from:u.to.actor),f=Dne(u.from?u.from:u.to.actor).length,p=d.x+d.width/2+(f-1)*tt.activationWidth/2,g={startx:p,stopx:p+tt.activationWidth,actor:u.from,enabled:!0};Bt.activations.push(g)}break;case n.db.LINETYPE.ACTIVE_END:{const d=Bt.activations.map(f=>f.actor).lastIndexOf(u.from);Bt.activations.splice(d,1).splice(0,1)}break}u.placement!==void 0?(o=await CWn(u,e,n),u.noteModel=o,a.forEach(d=>{s=d,s.from=jt.getMin(s.from,o.startx),s.to=jt.getMax(s.to,o.startx+o.width),s.width=jt.getMax(s.width,Math.abs(s.from-s.to))-tt.labelBoxWidth})):(l=_Wn(u,e,n),u.msgModel=l,l.startx&&l.stopx&&a.length>0&&a.forEach(d=>{if(s=d,l.startx===l.stopx){const f=e.get(u.from),p=e.get(u.to);s.from=jt.getMin(f.x-l.width/2,f.x-f.width/2,s.from),s.to=jt.getMax(p.x+l.width/2,p.x+f.width/2,s.to),s.width=jt.getMax(s.width,Math.abs(s.to-s.from))-tt.labelBoxWidth}else s.from=jt.getMin(l.startx,s.from),s.to=jt.getMax(l.stopx,s.to),s.width=jt.getMax(s.width,l.width)-tt.labelBoxWidth}))}return Bt.activations=[],me.debug("Loop type widths:",i),i},"calculateLoopBounds"),DWn={bounds:Bt,drawActors:HRe,drawActorsPopup:aqt,setConf:sqt,draw:SWn},LWn={parser:FHn,get db(){return new QHn},renderer:DWn,styles:HHn,init:C(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,bye({sequence:{wrap:t.wrap}}))},"init")};const MWn=Object.freeze(Object.defineProperty({__proto__:null,diagram:LWn},Symbol.toStringTag,{value:"Module"}));var YRe=function(){var t=C(function(ce,be,ne,j){for(ne=ne||{},j=ce.length;j--;ne[ce[j]]=be);return ne},"o"),e=[1,18],r=[1,19],n=[1,20],i=[1,41],a=[1,26],s=[1,42],o=[1,24],l=[1,25],u=[1,32],h=[1,33],d=[1,34],f=[1,45],p=[1,35],g=[1,36],m=[1,37],v=[1,38],y=[1,27],b=[1,28],x=[1,29],w=[1,30],A=[1,31],S=[1,44],T=[1,46],O=[1,43],k=[1,47],E=[1,9],_=[1,8,9],I=[1,58],L=[1,59],R=[1,60],D=[1,61],M=[1,62],P=[1,63],N=[1,64],F=[1,8,9,41],B=[1,77],V=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],z=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],U=[13,60,86,100,102,103],Q=[13,60,73,74,86,100,102,103],G=[13,60,68,69,70,71,72,86,100,102,103],X=[1,103],Y=[1,121],le=[1,117],q=[1,113],Z=[1,119],ee=[1,114],re=[1,115],ve=[1,116],ae=[1,118],Ce=[1,120],Oe=[22,50,60,61,82,86,87,88,89,90],$e=[1,128],he=[12,39],fe=[1,8,9,39,41,44,46],Se=[1,8,9,22],ge=[1,153],Qe=[1,8,9,61],Te=[1,8,9,22,50,60,61,82,86,87,88,89,90],De={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:C(function(be,ne,j,ie,pe,te,ye){var oe=te.length-1;switch(pe){case 8:this.$=te[oe-1];break;case 9:case 10:case 13:case 15:this.$=te[oe];break;case 11:case 14:this.$=te[oe-2]+"."+te[oe];break;case 12:case 16:this.$=te[oe-1]+te[oe];break;case 17:case 18:this.$=te[oe-1]+"~"+te[oe]+"~";break;case 19:ie.addRelation(te[oe]);break;case 20:te[oe-1].title=ie.cleanupLabel(te[oe]),ie.addRelation(te[oe-1]);break;case 31:this.$=te[oe].trim(),ie.setAccTitle(this.$);break;case 32:case 33:this.$=te[oe].trim(),ie.setAccDescription(this.$);break;case 34:ie.addClassesToNamespace(te[oe-3],te[oe-1][0],te[oe-1][1]),ie.popNamespace();break;case 35:ie.addClassesToNamespace(te[oe-4],te[oe-1][0],te[oe-1][1]),ie.popNamespace();break;case 36:this.$=ie.addNamespace(te[oe]);break;case 37:this.$=ie.addNamespace(te[oe-1],te[oe]);break;case 38:this.$=[[te[oe]],[]];break;case 39:this.$=[[te[oe-1]],[]];break;case 40:te[oe][0].unshift(te[oe-2]),this.$=te[oe];break;case 41:this.$=[[],[te[oe]]];break;case 42:this.$=[[],[te[oe-1]]];break;case 43:te[oe][1].unshift(te[oe-2]),this.$=te[oe];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=te[oe];break;case 48:ie.setCssClass(te[oe-2],te[oe]);break;case 49:ie.addMembers(te[oe-3],te[oe-1]);break;case 51:ie.setCssClass(te[oe-5],te[oe-3]),ie.addMembers(te[oe-5],te[oe-1]);break;case 52:ie.addAnnotation(te[oe-3],te[oe-1]);break;case 53:ie.addAnnotation(te[oe-6],te[oe-4]),ie.addMembers(te[oe-6],te[oe-1]);break;case 54:ie.addAnnotation(te[oe-5],te[oe-3]);break;case 55:this.$=te[oe],ie.addClass(te[oe]);break;case 56:this.$=te[oe-1],ie.addClass(te[oe-1]),ie.setClassLabel(te[oe-1],te[oe]);break;case 60:ie.addAnnotation(te[oe],te[oe-2]);break;case 61:case 74:this.$=[te[oe]];break;case 62:te[oe].push(te[oe-1]),this.$=te[oe];break;case 63:break;case 64:ie.addMember(te[oe-1],ie.cleanupLabel(te[oe]));break;case 65:break;case 66:break;case 67:this.$={id1:te[oe-2],id2:te[oe],relation:te[oe-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:te[oe-3],id2:te[oe],relation:te[oe-1],relationTitle1:te[oe-2],relationTitle2:"none"};break;case 69:this.$={id1:te[oe-3],id2:te[oe],relation:te[oe-2],relationTitle1:"none",relationTitle2:te[oe-1]};break;case 70:this.$={id1:te[oe-4],id2:te[oe],relation:te[oe-2],relationTitle1:te[oe-3],relationTitle2:te[oe-1]};break;case 71:this.$=ie.addNote(te[oe],te[oe-1]);break;case 72:this.$=ie.addNote(te[oe]);break;case 73:this.$=te[oe-2],ie.defineClass(te[oe-1],te[oe]);break;case 75:this.$=te[oe-2].concat([te[oe]]);break;case 76:ie.setDirection("TB");break;case 77:ie.setDirection("BT");break;case 78:ie.setDirection("RL");break;case 79:ie.setDirection("LR");break;case 80:this.$={type1:te[oe-2],type2:te[oe],lineType:te[oe-1]};break;case 81:this.$={type1:"none",type2:te[oe],lineType:te[oe-1]};break;case 82:this.$={type1:te[oe-1],type2:"none",lineType:te[oe]};break;case 83:this.$={type1:"none",type2:"none",lineType:te[oe]};break;case 84:this.$=ie.relationType.AGGREGATION;break;case 85:this.$=ie.relationType.EXTENSION;break;case 86:this.$=ie.relationType.COMPOSITION;break;case 87:this.$=ie.relationType.DEPENDENCY;break;case 88:this.$=ie.relationType.LOLLIPOP;break;case 89:this.$=ie.lineType.LINE;break;case 90:this.$=ie.lineType.DOTTED_LINE;break;case 91:case 97:this.$=te[oe-2],ie.setClickEvent(te[oe-1],te[oe]);break;case 92:case 98:this.$=te[oe-3],ie.setClickEvent(te[oe-2],te[oe-1]),ie.setTooltip(te[oe-2],te[oe]);break;case 93:this.$=te[oe-2],ie.setLink(te[oe-1],te[oe]);break;case 94:this.$=te[oe-3],ie.setLink(te[oe-2],te[oe-1],te[oe]);break;case 95:this.$=te[oe-3],ie.setLink(te[oe-2],te[oe-1]),ie.setTooltip(te[oe-2],te[oe]);break;case 96:this.$=te[oe-4],ie.setLink(te[oe-3],te[oe-2],te[oe]),ie.setTooltip(te[oe-3],te[oe-1]);break;case 99:this.$=te[oe-3],ie.setClickEvent(te[oe-2],te[oe-1],te[oe]);break;case 100:this.$=te[oe-4],ie.setClickEvent(te[oe-3],te[oe-2],te[oe-1]),ie.setTooltip(te[oe-3],te[oe]);break;case 101:this.$=te[oe-3],ie.setLink(te[oe-2],te[oe]);break;case 102:this.$=te[oe-4],ie.setLink(te[oe-3],te[oe-1],te[oe]);break;case 103:this.$=te[oe-4],ie.setLink(te[oe-3],te[oe-1]),ie.setTooltip(te[oe-3],te[oe]);break;case 104:this.$=te[oe-5],ie.setLink(te[oe-4],te[oe-2],te[oe]),ie.setTooltip(te[oe-4],te[oe-1]);break;case 105:this.$=te[oe-2],ie.setCssStyle(te[oe-1],te[oe]);break;case 106:ie.setCssClass(te[oe-1],te[oe]);break;case 107:this.$=[te[oe]];break;case 108:te[oe-2].push(te[oe]),this.$=te[oe-2];break;case 110:this.$=te[oe-1]+te[oe];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:v,75:y,76:b,78:x,82:w,83:A,86:S,100:T,102:O,103:k},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(E,[2,5],{8:[1,48]}),{8:[1,49]},t(_,[2,19],{22:[1,50]}),t(_,[2,21]),t(_,[2,22]),t(_,[2,23]),t(_,[2,24]),t(_,[2,25]),t(_,[2,26]),t(_,[2,27]),t(_,[2,28]),t(_,[2,29]),t(_,[2,30]),{34:[1,51]},{36:[1,52]},t(_,[2,33]),t(_,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:I,69:L,70:R,71:D,72:M,73:P,74:N}),{39:[1,65]},t(F,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(_,[2,65]),t(_,[2,66]),{16:69,60:f,86:S,100:T,102:O},{16:39,17:40,19:70,60:f,86:S,100:T,102:O,103:k},{16:39,17:40,19:71,60:f,86:S,100:T,102:O,103:k},{16:39,17:40,19:72,60:f,86:S,100:T,102:O,103:k},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:f,86:S,100:T,102:O,103:k},{13:B,55:76},{58:78,60:[1,79]},t(_,[2,76]),t(_,[2,77]),t(_,[2,78]),t(_,[2,79]),t(V,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:f,86:S,100:T,102:O,103:k}),t(V,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:f,86:S,100:T,102:O,103:k},{16:39,17:40,19:87,60:f,86:S,100:T,102:O,103:k},t(z,[2,133]),t(z,[2,134]),t(z,[2,135]),t(z,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(E,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:e,35:r,37:n,42:i,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:v,75:y,76:b,78:x,82:w,83:A,86:S,100:T,102:O,103:k}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:v,75:y,76:b,78:x,82:w,83:A,86:S,100:T,102:O,103:k},t(_,[2,20]),t(_,[2,31]),t(_,[2,32]),{13:[1,91],16:39,17:40,19:90,60:f,86:S,100:T,102:O,103:k},{53:92,66:56,67:57,68:I,69:L,70:R,71:D,72:M,73:P,74:N},t(_,[2,64]),{67:93,73:P,74:N},t(U,[2,83],{66:94,68:I,69:L,70:R,71:D,72:M}),t(Q,[2,84]),t(Q,[2,85]),t(Q,[2,86]),t(Q,[2,87]),t(Q,[2,88]),t(G,[2,89]),t(G,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:i,43:23,48:s,54:u,56:h},{16:100,60:f,86:S,100:T,102:O},{41:[1,102],45:101,51:X},{16:104,60:f,86:S,100:T,102:O},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:Y,50:le,59:110,60:q,82:Z,84:111,85:112,86:ee,87:re,88:ve,89:ae,90:Ce},{60:[1,122]},{13:B,55:123},t(F,[2,72]),t(F,[2,138]),{22:Y,50:le,59:124,60:q,61:[1,125],82:Z,84:111,85:112,86:ee,87:re,88:ve,89:ae,90:Ce},t(Oe,[2,74]),{16:39,17:40,19:126,60:f,86:S,100:T,102:O,103:k},t(V,[2,16]),t(V,[2,17]),t(V,[2,18]),{11:127,12:$e,39:[2,36]},t(he,[2,9],{16:85,17:86,15:130,18:[1,129],60:f,86:S,100:T,102:O,103:k}),t(he,[2,10]),t(fe,[2,55],{11:131,12:$e}),t(E,[2,7]),{9:[1,132]},t(Se,[2,67]),{16:39,17:40,19:133,60:f,86:S,100:T,102:O,103:k},{13:[1,135],16:39,17:40,19:134,60:f,86:S,100:T,102:O,103:k},t(U,[2,82],{66:136,68:I,69:L,70:R,71:D,72:M}),t(U,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:i,43:23,48:s,54:u,56:h},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(F,[2,48],{39:[1,142]}),{41:[1,143]},t(F,[2,50]),{41:[2,61],45:144,51:X},{47:[1,145]},{16:39,17:40,19:146,60:f,86:S,100:T,102:O,103:k},t(_,[2,91],{13:[1,147]}),t(_,[2,93],{13:[1,149],77:[1,148]}),t(_,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(_,[2,105],{61:ge}),t(Qe,[2,107],{85:154,22:Y,50:le,60:q,82:Z,86:ee,87:re,88:ve,89:ae,90:Ce}),t(Te,[2,109]),t(Te,[2,111]),t(Te,[2,112]),t(Te,[2,113]),t(Te,[2,114]),t(Te,[2,115]),t(Te,[2,116]),t(Te,[2,117]),t(Te,[2,118]),t(Te,[2,119]),t(_,[2,106]),t(F,[2,71]),t(_,[2,73],{61:ge}),{60:[1,155]},t(V,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:f,86:S,100:T,102:O,103:k},t(he,[2,12]),t(fe,[2,56]),{1:[2,4]},t(Se,[2,69]),t(Se,[2,68]),{16:39,17:40,19:158,60:f,86:S,100:T,102:O,103:k},t(U,[2,80]),t(F,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:i,43:23,48:s,54:u,56:h},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:i,43:23,48:s,54:u,56:h},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:i,43:23,48:s,54:u,56:h},{45:163,51:X},t(F,[2,49]),{41:[2,62]},t(F,[2,52],{39:[1,164]}),t(_,[2,60]),t(_,[2,92]),t(_,[2,94]),t(_,[2,95],{77:[1,165]}),t(_,[2,98]),t(_,[2,99],{13:[1,166]}),t(_,[2,101],{13:[1,168],77:[1,167]}),{22:Y,50:le,60:q,82:Z,84:169,85:112,86:ee,87:re,88:ve,89:ae,90:Ce},t(Te,[2,110]),t(Oe,[2,75]),{14:[1,170]},t(he,[2,11]),t(Se,[2,70]),t(F,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:X},t(_,[2,96]),t(_,[2,100]),t(_,[2,102]),t(_,[2,103],{77:[1,174]}),t(Qe,[2,108],{85:154,22:Y,50:le,60:q,82:Z,86:ee,87:re,88:ve,89:ae,90:Ce}),t(fe,[2,8]),t(F,[2,51]),{41:[1,175]},t(F,[2,54]),t(_,[2,104]),t(F,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:C(function(be,ne){if(ne.recoverable)this.trace(be);else{var j=new Error(be);throw j.hash=ne,j}},"parseError"),parse:C(function(be){var ne=this,j=[0],ie=[],pe=[null],te=[],ye=this.table,oe="",_e=0,Le=0,Ye=2,Pe=1,Xe=te.slice.call(arguments,1),Ne=Object.create(this.lexer),Ze={yy:{}};for(var Ge in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ge)&&(Ze.yy[Ge]=this.yy[Ge]);Ne.setInput(be,Ze.yy),Ze.yy.lexer=Ne,Ze.yy.parser=this,typeof Ne.yylloc>"u"&&(Ne.yylloc={});var lt=Ne.yylloc;te.push(lt);var Fe=Ne.options&&Ne.options.ranges;typeof Ze.yy.parseError=="function"?this.parseError=Ze.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function wt(Mt){j.length=j.length-2*Mt,pe.length=pe.length-Mt,te.length=te.length-Mt}C(wt,"popStack");function Me(){var Mt;return Mt=ie.pop()||Ne.lex()||Pe,typeof Mt!="number"&&(Mt instanceof Array&&(ie=Mt,Mt=ie.pop()),Mt=ne.symbols_[Mt]||Mt),Mt}C(Me,"lex");for(var Rt,Lt,ut,Xt,Ft={},gt,Ae,zt,kt;;){if(Lt=j[j.length-1],this.defaultActions[Lt]?ut=this.defaultActions[Lt]:((Rt===null||typeof Rt>"u")&&(Rt=Me()),ut=ye[Lt]&&ye[Lt][Rt]),typeof ut>"u"||!ut.length||!ut[0]){var At="";kt=[];for(gt in ye[Lt])this.terminals_[gt]&>>Ye&&kt.push("'"+this.terminals_[gt]+"'");Ne.showPosition?At="Parse error on line "+(_e+1)+`: `+Ne.showPosition()+` Expecting `+kt.join(", ")+", got '"+(this.terminals_[Rt]||Rt)+"'":At="Parse error on line "+(_e+1)+": Unexpected "+(Rt==Pe?"end of input":"'"+(this.terminals_[Rt]||Rt)+"'"),this.parseError(At,{text:Ne.match,token:this.terminals_[Rt]||Rt,line:Ne.yylineno,loc:lt,expected:kt})}if(ut[0]instanceof Array&&ut.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Lt+", token: "+Rt);switch(ut[0]){case 1:j.push(Rt),pe.push(Ne.yytext),te.push(Ne.yylloc),j.push(ut[1]),Rt=null,Le=Ne.yyleng,oe=Ne.yytext,_e=Ne.yylineno,lt=Ne.yylloc;break;case 2:if(Ae=this.productions_[ut[1]][1],Ft.$=pe[pe.length-Ae],Ft._$={first_line:te[te.length-(Ae||1)].first_line,last_line:te[te.length-1].last_line,first_column:te[te.length-(Ae||1)].first_column,last_column:te[te.length-1].last_column},Fe&&(Ft._$.range=[te[te.length-(Ae||1)].range[0],te[te.length-1].range[1]]),Xt=this.performAction.apply(Ft,[oe,Le,_e,Ze.yy,ut[1],pe,te].concat(Xe)),typeof Xt<"u")return Xt;Ae&&(j=j.slice(0,-1*Ae*2),pe=pe.slice(0,-1*Ae),te=te.slice(0,-1*Ae)),j.push(this.productions_[ut[1]][0]),pe.push(Ft.$),te.push(Ft._$),zt=ye[j[j.length-2]][j[j.length-1]],j.push(zt);break;case 3:return!0}}return!0},"parse")},qe=function(){var ce={EOF:1,parseError:C(function(ne,j){if(this.yy.parser)this.yy.parser.parseError(ne,j);else throw new Error(ne)},"parseError"),setInput:C(function(be,ne){return this.yy=ne||this.yy||{},this._input=be,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var be=this._input[0];this.yytext+=be,this.yyleng++,this.offset++,this.match+=be,this.matched+=be;var ne=be.match(/(?:\r\n?|\n).*/g);return ne?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),be},"input"),unput:C(function(be){var ne=be.length,j=be.split(/(?:\r\n?|\n)/g);this._input=be+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-ne),this.offset-=ne;var ie=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),j.length-1&&(this.yylineno-=j.length-1);var pe=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:j?(j.length===ie.length?this.yylloc.first_column:0)+ie[ie.length-j.length].length-j[0].length:this.yylloc.first_column-ne},this.options.ranges&&(this.yylloc.range=[pe[0],pe[0]+this.yyleng-ne]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:C(function(be){this.unput(this.match.slice(be))},"less"),pastInput:C(function(){var be=this.matched.substr(0,this.matched.length-this.match.length);return(be.length>20?"...":"")+be.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:C(function(){var be=this.match;return be.length<20&&(be+=this._input.substr(0,20-be.length)),(be.substr(0,20)+(be.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:C(function(){var be=this.pastInput(),ne=new Array(be.length+1).join("-");return be+this.upcomingInput()+` @@ -2644,12 +2644,12 @@ g.classGroup line { text-align: center; } ${G9()} -`,"getStyles"),vqt=IWn,PWn=C((t,e="TB")=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),NWn=C(function(t,e){return e.db.getClasses()},"getClasses"),BWn=C(async function(t,e,r,n){me.info("REF0:"),me.info("Drawing class diagram (v3)",e);const{securityLevel:i,state:a,layout:s}=He();n.db.setDiagramId(e);const o=n.db.getData(),l=z3(e,i);o.type=n.type,o.layoutAlgorithm=R7(s),o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,o.markers=["aggregation","extension","composition","dependency","lollipop"],o.diagramId=e,await e4(o,l);const u=8;ln.insertTitle(l,"classDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),IC(l,u,"classDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),yqt={getClasses:NWn,draw:BWn,getDir:PWn},$Wn={parser:dqt,get db(){return new mqt},renderer:yqt,styles:vqt,init:C(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const FWn=Object.freeze(Object.defineProperty({__proto__:null,diagram:$Wn},Symbol.toStringTag,{value:"Module"}));var zWn={parser:dqt,get db(){return new mqt},renderer:yqt,styles:vqt,init:C(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const UWn=Object.freeze(Object.defineProperty({__proto__:null,diagram:zWn},Symbol.toStringTag,{value:"Module"}));var qRe=function(){var t=C(function(F,B,V,z){for(V=V||{},z=F.length;z--;V[F[z]]=B);return V},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],o=[1,16],l=[1,17],u=[1,18],h=[1,19],d=[1,33],f=[1,20],p=[1,21],g=[1,22],m=[1,23],v=[1,24],y=[1,26],b=[1,27],x=[1,28],w=[1,29],A=[1,30],T=[1,31],S=[1,32],O=[1,35],k=[1,36],E=[1,37],_=[1,38],I=[1,34],L=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],R=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],D=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],M={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:C(function(B,V,z,U,Q,G,X){var Y=G.length-1;switch(Q){case 3:return U.setRootDoc(G[Y]),G[Y];case 4:this.$=[];break;case 5:G[Y]!="nl"&&(G[Y-1].push(G[Y]),this.$=G[Y-1]);break;case 6:case 7:this.$=G[Y];break;case 8:this.$="nl";break;case 12:this.$=G[Y];break;case 13:const ee=G[Y-1];ee.description=U.trimColon(G[Y]),this.$=ee;break;case 14:this.$={stmt:"relation",state1:G[Y-2],state2:G[Y]};break;case 15:const re=U.trimColon(G[Y]);this.$={stmt:"relation",state1:G[Y-3],state2:G[Y-1],description:re};break;case 19:this.$={stmt:"state",id:G[Y-3],type:"default",description:"",doc:G[Y-1]};break;case 20:var le=G[Y],q=G[Y-2].trim();if(G[Y].match(":")){var Z=G[Y].split(":");le=Z[0],q=[q,Z[1]]}this.$={stmt:"state",id:le,type:"default",description:q};break;case 21:this.$={stmt:"state",id:G[Y-3],type:"default",description:G[Y-5],doc:G[Y-1]};break;case 22:this.$={stmt:"state",id:G[Y],type:"fork"};break;case 23:this.$={stmt:"state",id:G[Y],type:"join"};break;case 24:this.$={stmt:"state",id:G[Y],type:"choice"};break;case 25:this.$={stmt:"state",id:U.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:G[Y-1].trim(),note:{position:G[Y-2].trim(),text:G[Y].trim()}};break;case 29:this.$=G[Y].trim(),U.setAccTitle(this.$);break;case 30:case 31:this.$=G[Y].trim(),U.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:G[Y-3],url:G[Y-2],tooltip:G[Y-1]};break;case 33:this.$={stmt:"click",id:G[Y-3],url:G[Y-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:G[Y-1].trim(),classes:G[Y].trim()};break;case 36:this.$={stmt:"style",id:G[Y-1].trim(),styleClass:G[Y].trim()};break;case 37:this.$={stmt:"applyClass",id:G[Y-1].trim(),styleClass:G[Y].trim()};break;case 38:U.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:U.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:U.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:U.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:G[Y].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:G[Y-2].trim(),classes:[G[Y].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:G[Y-2].trim(),classes:[G[Y].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:v,32:25,33:y,35:b,37:x,38:w,41:A,45:T,48:S,51:O,52:k,53:E,54:_,57:I},t(L,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:v,32:25,33:y,35:b,37:x,38:w,41:A,45:T,48:S,51:O,52:k,53:E,54:_,57:I},t(L,[2,7]),t(L,[2,8]),t(L,[2,9]),t(L,[2,10]),t(L,[2,11]),t(L,[2,12],{14:[1,40],15:[1,41]}),t(L,[2,16]),{18:[1,42]},t(L,[2,18],{20:[1,43]}),{23:[1,44]},t(L,[2,22]),t(L,[2,23]),t(L,[2,24]),t(L,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(L,[2,28]),{34:[1,49]},{36:[1,50]},t(L,[2,31]),{13:51,24:d,57:I},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(R,[2,44],{58:[1,56]}),t(R,[2,45],{58:[1,57]}),t(L,[2,38]),t(L,[2,39]),t(L,[2,40]),t(L,[2,41]),t(L,[2,6]),t(L,[2,13]),{13:58,24:d,57:I},t(L,[2,17]),t(D,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(L,[2,29]),t(L,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(L,[2,14],{14:[1,71]}),{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,72],22:h,24:d,25:f,26:p,27:g,28:m,29:v,32:25,33:y,35:b,37:x,38:w,41:A,45:T,48:S,51:O,52:k,53:E,54:_,57:I},t(L,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(L,[2,34]),t(L,[2,35]),t(L,[2,36]),t(L,[2,37]),t(R,[2,46]),t(R,[2,47]),t(L,[2,15]),t(L,[2,19]),t(D,i,{7:78}),t(L,[2,26]),t(L,[2,27]),{5:[1,79]},{5:[1,80]},{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,81],22:h,24:d,25:f,26:p,27:g,28:m,29:v,32:25,33:y,35:b,37:x,38:w,41:A,45:T,48:S,51:O,52:k,53:E,54:_,57:I},t(L,[2,32]),t(L,[2,33]),t(L,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:C(function(B,V){if(V.recoverable)this.trace(B);else{var z=new Error(B);throw z.hash=V,z}},"parseError"),parse:C(function(B){var V=this,z=[0],U=[],Q=[null],G=[],X=this.table,Y="",le=0,q=0,Z=2,ee=1,re=G.slice.call(arguments,1),ve=Object.create(this.lexer),ae={yy:{}};for(var Ce in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ce)&&(ae.yy[Ce]=this.yy[Ce]);ve.setInput(B,ae.yy),ae.yy.lexer=ve,ae.yy.parser=this,typeof ve.yylloc>"u"&&(ve.yylloc={});var Oe=ve.yylloc;G.push(Oe);var $e=ve.options&&ve.options.ranges;typeof ae.yy.parseError=="function"?this.parseError=ae.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function he(j){z.length=z.length-2*j,Q.length=Q.length-j,G.length=G.length-j}C(he,"popStack");function fe(){var j;return j=U.pop()||ve.lex()||ee,typeof j!="number"&&(j instanceof Array&&(U=j,j=U.pop()),j=V.symbols_[j]||j),j}C(fe,"lex");for(var Te,ge,Qe,Se,De={},qe,K,ce,be;;){if(ge=z[z.length-1],this.defaultActions[ge]?Qe=this.defaultActions[ge]:((Te===null||typeof Te>"u")&&(Te=fe()),Qe=X[ge]&&X[ge][Te]),typeof Qe>"u"||!Qe.length||!Qe[0]){var ne="";be=[];for(qe in X[ge])this.terminals_[qe]&&qe>Z&&be.push("'"+this.terminals_[qe]+"'");ve.showPosition?ne="Parse error on line "+(le+1)+`: +`,"getStyles"),vqt=IWn,PWn=C((t,e="TB")=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),NWn=C(function(t,e){return e.db.getClasses()},"getClasses"),BWn=C(async function(t,e,r,n){me.info("REF0:"),me.info("Drawing class diagram (v3)",e);const{securityLevel:i,state:a,layout:s}=He();n.db.setDiagramId(e);const o=n.db.getData(),l=z3(e,i);o.type=n.type,o.layoutAlgorithm=R7(s),o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,o.markers=["aggregation","extension","composition","dependency","lollipop"],o.diagramId=e,await e4(o,l);const u=8;ln.insertTitle(l,"classDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),IC(l,u,"classDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),yqt={getClasses:NWn,draw:BWn,getDir:PWn},$Wn={parser:dqt,get db(){return new mqt},renderer:yqt,styles:vqt,init:C(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const FWn=Object.freeze(Object.defineProperty({__proto__:null,diagram:$Wn},Symbol.toStringTag,{value:"Module"}));var zWn={parser:dqt,get db(){return new mqt},renderer:yqt,styles:vqt,init:C(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const UWn=Object.freeze(Object.defineProperty({__proto__:null,diagram:zWn},Symbol.toStringTag,{value:"Module"}));var qRe=function(){var t=C(function(F,B,V,z){for(V=V||{},z=F.length;z--;V[F[z]]=B);return V},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],o=[1,16],l=[1,17],u=[1,18],h=[1,19],d=[1,33],f=[1,20],p=[1,21],g=[1,22],m=[1,23],v=[1,24],y=[1,26],b=[1,27],x=[1,28],w=[1,29],A=[1,30],S=[1,31],T=[1,32],O=[1,35],k=[1,36],E=[1,37],_=[1,38],I=[1,34],L=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],R=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],D=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],M={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:C(function(B,V,z,U,Q,G,X){var Y=G.length-1;switch(Q){case 3:return U.setRootDoc(G[Y]),G[Y];case 4:this.$=[];break;case 5:G[Y]!="nl"&&(G[Y-1].push(G[Y]),this.$=G[Y-1]);break;case 6:case 7:this.$=G[Y];break;case 8:this.$="nl";break;case 12:this.$=G[Y];break;case 13:const ee=G[Y-1];ee.description=U.trimColon(G[Y]),this.$=ee;break;case 14:this.$={stmt:"relation",state1:G[Y-2],state2:G[Y]};break;case 15:const re=U.trimColon(G[Y]);this.$={stmt:"relation",state1:G[Y-3],state2:G[Y-1],description:re};break;case 19:this.$={stmt:"state",id:G[Y-3],type:"default",description:"",doc:G[Y-1]};break;case 20:var le=G[Y],q=G[Y-2].trim();if(G[Y].match(":")){var Z=G[Y].split(":");le=Z[0],q=[q,Z[1]]}this.$={stmt:"state",id:le,type:"default",description:q};break;case 21:this.$={stmt:"state",id:G[Y-3],type:"default",description:G[Y-5],doc:G[Y-1]};break;case 22:this.$={stmt:"state",id:G[Y],type:"fork"};break;case 23:this.$={stmt:"state",id:G[Y],type:"join"};break;case 24:this.$={stmt:"state",id:G[Y],type:"choice"};break;case 25:this.$={stmt:"state",id:U.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:G[Y-1].trim(),note:{position:G[Y-2].trim(),text:G[Y].trim()}};break;case 29:this.$=G[Y].trim(),U.setAccTitle(this.$);break;case 30:case 31:this.$=G[Y].trim(),U.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:G[Y-3],url:G[Y-2],tooltip:G[Y-1]};break;case 33:this.$={stmt:"click",id:G[Y-3],url:G[Y-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:G[Y-1].trim(),classes:G[Y].trim()};break;case 36:this.$={stmt:"style",id:G[Y-1].trim(),styleClass:G[Y].trim()};break;case 37:this.$={stmt:"applyClass",id:G[Y-1].trim(),styleClass:G[Y].trim()};break;case 38:U.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:U.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:U.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:U.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:G[Y].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:G[Y-2].trim(),classes:[G[Y].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:G[Y-2].trim(),classes:[G[Y].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:v,32:25,33:y,35:b,37:x,38:w,41:A,45:S,48:T,51:O,52:k,53:E,54:_,57:I},t(L,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:v,32:25,33:y,35:b,37:x,38:w,41:A,45:S,48:T,51:O,52:k,53:E,54:_,57:I},t(L,[2,7]),t(L,[2,8]),t(L,[2,9]),t(L,[2,10]),t(L,[2,11]),t(L,[2,12],{14:[1,40],15:[1,41]}),t(L,[2,16]),{18:[1,42]},t(L,[2,18],{20:[1,43]}),{23:[1,44]},t(L,[2,22]),t(L,[2,23]),t(L,[2,24]),t(L,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(L,[2,28]),{34:[1,49]},{36:[1,50]},t(L,[2,31]),{13:51,24:d,57:I},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(R,[2,44],{58:[1,56]}),t(R,[2,45],{58:[1,57]}),t(L,[2,38]),t(L,[2,39]),t(L,[2,40]),t(L,[2,41]),t(L,[2,6]),t(L,[2,13]),{13:58,24:d,57:I},t(L,[2,17]),t(D,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(L,[2,29]),t(L,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(L,[2,14],{14:[1,71]}),{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,72],22:h,24:d,25:f,26:p,27:g,28:m,29:v,32:25,33:y,35:b,37:x,38:w,41:A,45:S,48:T,51:O,52:k,53:E,54:_,57:I},t(L,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(L,[2,34]),t(L,[2,35]),t(L,[2,36]),t(L,[2,37]),t(R,[2,46]),t(R,[2,47]),t(L,[2,15]),t(L,[2,19]),t(D,i,{7:78}),t(L,[2,26]),t(L,[2,27]),{5:[1,79]},{5:[1,80]},{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,81],22:h,24:d,25:f,26:p,27:g,28:m,29:v,32:25,33:y,35:b,37:x,38:w,41:A,45:S,48:T,51:O,52:k,53:E,54:_,57:I},t(L,[2,32]),t(L,[2,33]),t(L,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:C(function(B,V){if(V.recoverable)this.trace(B);else{var z=new Error(B);throw z.hash=V,z}},"parseError"),parse:C(function(B){var V=this,z=[0],U=[],Q=[null],G=[],X=this.table,Y="",le=0,q=0,Z=2,ee=1,re=G.slice.call(arguments,1),ve=Object.create(this.lexer),ae={yy:{}};for(var Ce in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ce)&&(ae.yy[Ce]=this.yy[Ce]);ve.setInput(B,ae.yy),ae.yy.lexer=ve,ae.yy.parser=this,typeof ve.yylloc>"u"&&(ve.yylloc={});var Oe=ve.yylloc;G.push(Oe);var $e=ve.options&&ve.options.ranges;typeof ae.yy.parseError=="function"?this.parseError=ae.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function he(j){z.length=z.length-2*j,Q.length=Q.length-j,G.length=G.length-j}C(he,"popStack");function fe(){var j;return j=U.pop()||ve.lex()||ee,typeof j!="number"&&(j instanceof Array&&(U=j,j=U.pop()),j=V.symbols_[j]||j),j}C(fe,"lex");for(var Se,ge,Qe,Te,De={},qe,K,ce,be;;){if(ge=z[z.length-1],this.defaultActions[ge]?Qe=this.defaultActions[ge]:((Se===null||typeof Se>"u")&&(Se=fe()),Qe=X[ge]&&X[ge][Se]),typeof Qe>"u"||!Qe.length||!Qe[0]){var ne="";be=[];for(qe in X[ge])this.terminals_[qe]&&qe>Z&&be.push("'"+this.terminals_[qe]+"'");ve.showPosition?ne="Parse error on line "+(le+1)+`: `+ve.showPosition()+` -Expecting `+be.join(", ")+", got '"+(this.terminals_[Te]||Te)+"'":ne="Parse error on line "+(le+1)+": Unexpected "+(Te==ee?"end of input":"'"+(this.terminals_[Te]||Te)+"'"),this.parseError(ne,{text:ve.match,token:this.terminals_[Te]||Te,line:ve.yylineno,loc:Oe,expected:be})}if(Qe[0]instanceof Array&&Qe.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ge+", token: "+Te);switch(Qe[0]){case 1:z.push(Te),Q.push(ve.yytext),G.push(ve.yylloc),z.push(Qe[1]),Te=null,q=ve.yyleng,Y=ve.yytext,le=ve.yylineno,Oe=ve.yylloc;break;case 2:if(K=this.productions_[Qe[1]][1],De.$=Q[Q.length-K],De._$={first_line:G[G.length-(K||1)].first_line,last_line:G[G.length-1].last_line,first_column:G[G.length-(K||1)].first_column,last_column:G[G.length-1].last_column},$e&&(De._$.range=[G[G.length-(K||1)].range[0],G[G.length-1].range[1]]),Se=this.performAction.apply(De,[Y,q,le,ae.yy,Qe[1],Q,G].concat(re)),typeof Se<"u")return Se;K&&(z=z.slice(0,-1*K*2),Q=Q.slice(0,-1*K),G=G.slice(0,-1*K)),z.push(this.productions_[Qe[1]][0]),Q.push(De.$),G.push(De._$),ce=X[z[z.length-2]][z[z.length-1]],z.push(ce);break;case 3:return!0}}return!0},"parse")},P=function(){var F={EOF:1,parseError:C(function(V,z){if(this.yy.parser)this.yy.parser.parseError(V,z);else throw new Error(V)},"parseError"),setInput:C(function(B,V){return this.yy=V||this.yy||{},this._input=B,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var B=this._input[0];this.yytext+=B,this.yyleng++,this.offset++,this.match+=B,this.matched+=B;var V=B.match(/(?:\r\n?|\n).*/g);return V?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),B},"input"),unput:C(function(B){var V=B.length,z=B.split(/(?:\r\n?|\n)/g);this._input=B+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-V),this.offset-=V;var U=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),z.length-1&&(this.yylineno-=z.length-1);var Q=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:z?(z.length===U.length?this.yylloc.first_column:0)+U[U.length-z.length].length-z[0].length:this.yylloc.first_column-V},this.options.ranges&&(this.yylloc.range=[Q[0],Q[0]+this.yyleng-V]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +Expecting `+be.join(", ")+", got '"+(this.terminals_[Se]||Se)+"'":ne="Parse error on line "+(le+1)+": Unexpected "+(Se==ee?"end of input":"'"+(this.terminals_[Se]||Se)+"'"),this.parseError(ne,{text:ve.match,token:this.terminals_[Se]||Se,line:ve.yylineno,loc:Oe,expected:be})}if(Qe[0]instanceof Array&&Qe.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ge+", token: "+Se);switch(Qe[0]){case 1:z.push(Se),Q.push(ve.yytext),G.push(ve.yylloc),z.push(Qe[1]),Se=null,q=ve.yyleng,Y=ve.yytext,le=ve.yylineno,Oe=ve.yylloc;break;case 2:if(K=this.productions_[Qe[1]][1],De.$=Q[Q.length-K],De._$={first_line:G[G.length-(K||1)].first_line,last_line:G[G.length-1].last_line,first_column:G[G.length-(K||1)].first_column,last_column:G[G.length-1].last_column},$e&&(De._$.range=[G[G.length-(K||1)].range[0],G[G.length-1].range[1]]),Te=this.performAction.apply(De,[Y,q,le,ae.yy,Qe[1],Q,G].concat(re)),typeof Te<"u")return Te;K&&(z=z.slice(0,-1*K*2),Q=Q.slice(0,-1*K),G=G.slice(0,-1*K)),z.push(this.productions_[Qe[1]][0]),Q.push(De.$),G.push(De._$),ce=X[z[z.length-2]][z[z.length-1]],z.push(ce);break;case 3:return!0}}return!0},"parse")},P=function(){var F={EOF:1,parseError:C(function(V,z){if(this.yy.parser)this.yy.parser.parseError(V,z);else throw new Error(V)},"parseError"),setInput:C(function(B,V){return this.yy=V||this.yy||{},this._input=B,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var B=this._input[0];this.yytext+=B,this.yyleng++,this.offset++,this.match+=B,this.matched+=B;var V=B.match(/(?:\r\n?|\n).*/g);return V?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),B},"input"),unput:C(function(B){var V=B.length,z=B.split(/(?:\r\n?|\n)/g);this._input=B+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-V),this.offset-=V;var U=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),z.length-1&&(this.yylineno-=z.length-1);var Q=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:z?(z.length===U.length?this.yylloc.first_column:0)+U[U.length-z.length].length-z[0].length:this.yylloc.first_column-V},this.options.ranges&&(this.yylloc.range=[Q[0],Q[0]+this.yyleng-V]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:C(function(B){this.unput(this.match.slice(B))},"less"),pastInput:C(function(){var B=this.matched.substr(0,this.matched.length-this.match.length);return(B.length>20?"...":"")+B.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:C(function(){var B=this.match;return B.length<20&&(B+=this._input.substr(0,20-B.length)),(B.substr(0,20)+(B.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:C(function(){var B=this.pastInput(),V=new Array(B.length+1).join("-");return B+this.upcomingInput()+` `+V+"^"},"showPosition"),test_match:C(function(B,V){var z,U,Q;if(this.options.backtrack_lexer&&(Q={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Q.yylloc.range=this.yylloc.range.slice(0))),U=B[0].match(/(?:\r\n?|\n).*/g),U&&(this.yylineno+=U.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:U?U[U.length-1].length-U[U.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+B[0].length},this.yytext+=B[0],this.match+=B[0],this.matches=B,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(B[0].length),this.matched+=B[0],z=this.performAction.call(this,this.yy,this,V,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),z)return z;if(this._backtrack){for(var G in Q)this[G]=Q[G];return!1}return!1},"test_match"),next:C(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var B,V,z,U;this._more||(this.yytext="",this.match="");for(var Q=this._currentRules(),G=0;GV[0].length)){if(V=z,U=G,this.options.backtrack_lexer){if(B=this.test_match(z,Q[G]),B!==!1)return B;if(this._backtrack){V=!1;continue}else return!1}else if(!this.options.flex)break}return V?(B=this.test_match(V,Q[U]),B!==!1?B:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var V=this.next();return V||this.lex()},"lex"),begin:C(function(V){this.conditionStack.push(V)},"begin"),popState:C(function(){var V=this.conditionStack.length-1;return V>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(V){return V=this.conditionStack.length-1-Math.abs(V||0),V>=0?this.conditionStack[V]:"INITIAL"},"topState"),pushState:C(function(V){this.begin(V)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:C(function(V,z,U,Q){function G(){const X=z.yytext.indexOf("%%");if(X===0)return!1;if(X>0){const Y=z.yytext.slice(0,X),le=z.yytext.slice(X);le&&V.lexer.unput(le),z.yytext=Y}return!0}switch(C(G,"processId"),U){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 33:return this.pushState("SCALE"),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),z.yytext=z.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),z.yytext=z.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:return G()?(this.popState(),"ID"):void 0;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+z.yytext.trim()+'"');case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 57:break;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 63:break;case 64:return"NOTE_TEXT";case 65:return G()?(this.popState(),"ID"):void 0;case 66:return G()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 67:return this.popState(),z.yytext=z.yytext.substr(2).trim(),31;case 68:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),31;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:return G()?24:void 0;case 74:return z.yytext=z.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}};return F}();M.lexer=P;function N(){this.yy={}}return C(N,"Parser"),N.prototype=M,M.Parser=N,new N}();qRe.parser=qRe;var bqt=qRe,VWn="TB",xqt="TB",wqt="dir",XR="state",KR="root",jRe="relation",QWn="classDef",GWn="style",HWn="applyClass",Cz="default",Aqt="divider",Tqt="fill:none",Sqt="fill: #333",Cqt="c",Oqt="markdown",kqt="normal",XRe="rect",KRe="rectWithTitle",WWn="stateStart",YWn="stateEnd",Eqt="divider",_qt="roundedWithTitle",qWn="note",jWn="noteGroup",Oz="statediagram",XWn="state",KWn=`${Oz}-${XWn}`,Rqt="transition",ZWn="note",JWn="note-edge",eYn=`${Rqt} ${JWn}`,tYn=`${Oz}-${ZWn}`,rYn="cluster",nYn=`${Oz}-${rYn}`,iYn="cluster-alt",aYn=`${Oz}-${iYn}`,Dqt="parent",Lqt="note",sYn="state",ZRe="----",oYn=`${ZRe}${Lqt}`,Mqt=`${ZRe}${Dqt}`,Iqt=C((t,e=xqt)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),lYn=C(function(t,e){return e.db.getClasses()},"getClasses"),cYn=C(async function(t,e,r,n){me.info("REF0:"),me.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:a,layout:s}=He();n.db.extract(n.db.getRootDocV2());const o=n.db.getData(),l=z3(e,i);o.type=n.type,o.layoutAlgorithm=s,o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,He().look==="neo"?o.markers=["barbNeo"]:o.markers=["barb"],o.diagramId=e,await e4(o,l);const h=8;try{(typeof n.db.getLinks=="function"?n.db.getLinks():new Map).forEach((f,p)=>{var A;const g=typeof p=="string"?p:typeof(p==null?void 0:p.id)=="string"?p.id:"",m=o.nodes.find(T=>T.id===g);if(!g){me.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(p));return}const v=(A=l.node())==null?void 0:A.querySelectorAll("g.node, g.rough-node");let y;if(v==null||v.forEach(T=>{var O;const S=(O=T.textContent)==null?void 0:O.trim();(T.id===(m==null?void 0:m.domId)||S===g)&&(y=T)}),!y){me.warn("⚠️ Could not find node matching text:",g);return}const b=y.parentNode;if(!b){me.warn("⚠️ Node has no parent, cannot wrap:",g);return}const x=document.createElementNS("http://www.w3.org/2000/svg","a"),w=f.url.replace(/^"+|"+$/g,"");if(x.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",w),x.setAttribute("target","_blank"),f.tooltip){const T=f.tooltip.replace(/^"+|"+$/g,"");x.setAttribute("title",T),y.setAttribute("title",T)}b.replaceChild(x,y),x.appendChild(y),me.info("🔗 Wrapped node in
tag for:",g,f.url)})}catch(d){me.error("❌ Error injecting clickable links:",d)}ln.insertTitle(l,"statediagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),IC(l,h,Oz,(a==null?void 0:a.useMaxWidth)??!0)},"draw"),uYn={getClasses:lYn,draw:cYn,getDir:Iqt},Mne=new Map,mw=0;function Ine(t="",e=0,r="",n=ZRe){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${sYn}-${t}${i}-${e}`}C(Ine,"stateDomId");var hYn=C((t,e,r,n,i,a,s,o)=>{me.trace("items",e),e.forEach(l=>{switch(l.stmt){case XR:Ez(t,l,r,n,i,a,s,o);break;case Cz:Ez(t,l,r,n,i,a,s,o);break;case jRe:{Ez(t,l.state1,r,n,i,a,s,o),Ez(t,l.state2,r,n,i,a,s,o);const u=s==="neo",h={id:"edge"+mw,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:u?"arrow_barb_neo":"arrow_barb",style:Tqt,labelStyle:"",label:jt.sanitizeText(l.description??"",He()),arrowheadStyle:Sqt,labelpos:Cqt,labelType:Oqt,thickness:kqt,classes:Rqt,look:s};i.push(h),mw++}break}})},"setupDoc"),Pqt=C((t,e=xqt)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function kz(t,e,r){if(!e.id||e.id===""||e.id==="")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(i=>{const a=r.get(i);a&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...a.styles])}));const n=t.find(i=>i.id===e.id);n?Object.assign(n,e):t.push(e)}C(kz,"insertOrUpdateNode");function Nqt(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}C(Nqt,"getClassesFromDbInfo");function Bqt(t){return(t==null?void 0:t.styles)??[]}C(Bqt,"getStylesFromDbInfo");var Ez=C((t,e,r,n,i,a,s,o)=>{var p,g,m;const l=e.id,u=r.get(l),h=Nqt(u),d=Bqt(u),f=He();if(me.info("dataFetcher parsedItem",e,u,d),l!=="root"){let v=XRe;e.start===!0?v=WWn:e.start===!1&&(v=YWn),e.type!==Cz&&(v=e.type),Mne.get(l)||Mne.set(l,{id:l,shape:v,description:jt.sanitizeText(l,f),cssClasses:`${h} ${KWn}`,cssStyles:d});const y=Mne.get(l);e.description&&(Array.isArray(y.description)?(y.shape=KRe,y.description.push(e.description)):(p=y.description)!=null&&p.length&&y.description.length>0?(y.shape=KRe,y.description===l?y.description=[e.description]:y.description=[y.description,e.description]):(y.shape=XRe,y.description=e.description),y.description=jt.sanitizeTextOrArray(y.description,f)),((g=y.description)==null?void 0:g.length)===1&&y.shape===KRe&&(y.type==="group"?y.shape=_qt:y.shape=XRe),!y.type&&e.doc&&(me.info("Setting cluster for XCX",l,Pqt(e)),y.type="group",y.isGroup=!0,y.dir=Pqt(e),y.explicitDir=e.doc.some(x=>x.stmt==="dir"),y.shape=e.type===Aqt?Eqt:_qt,y.cssClasses=`${y.cssClasses} ${nYn} ${a?aYn:""}`);const b={labelStyle:"",shape:y.shape,label:y.description,cssClasses:y.cssClasses,cssCompiledStyles:[],cssStyles:y.cssStyles,id:l,dir:y.dir,domId:Ine(l,mw),type:y.type,isGroup:y.type==="group",padding:8,rx:10,ry:10,look:s,labelType:"markdown"};if(b.shape===Eqt&&(b.label=""),t&&t.id!=="root"&&(me.trace("Setting node ",l," to be child of its parent ",t.id),b.parentId=t.id),b.centerLabel=!0,e.note){const x={labelStyle:"",shape:qWn,label:e.note.text,labelType:"markdown",cssClasses:tYn,cssStyles:[],cssCompiledStyles:[],id:l+oYn+"-"+mw,domId:Ine(l,mw,Lqt),type:y.type,isGroup:y.type==="group",padding:(m=f.flowchart)==null?void 0:m.padding,look:s,position:e.note.position},w=l+Mqt,A={labelStyle:"",shape:jWn,label:e.note.text,cssClasses:y.cssClasses,cssStyles:[],id:l+Mqt,domId:Ine(l,mw,Dqt),type:"group",isGroup:!0,padding:16,look:s,position:e.note.position};mw++,A.id=w,x.parentId=w,kz(n,A,o),kz(n,x,o),kz(n,b,o);let T=l,S=x.id;e.note.position==="left of"&&(T=x.id,S=l),i.push({id:T+"-"+S,start:T,end:S,arrowhead:"none",arrowTypeEnd:"",style:Tqt,labelStyle:"",classes:eYn,arrowheadStyle:Sqt,labelpos:Cqt,labelType:Oqt,thickness:kqt,look:s})}else kz(n,b,o)}e.doc&&(me.trace("Adding nodes children "),hYn(e,e.doc,r,n,i,!a,s,o))},"dataFetcher"),dYn=C(()=>{Mne.clear(),mw=0},"reset"),oh={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},$qt=C(()=>new Map,"newClassesList"),Fqt=C(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),Pne=C(t=>JSON.parse(JSON.stringify(t)),"clone"),WO=(JO=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=$qt(),this.documents={root:Fqt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=Ja,this.setAccTitle=Da,this.getAccDescription=ts,this.setAccDescription=es,this.setDiagramTitle=rs,this.getDiagramTitle=La,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}extract(e){this.clear(!0);for(const i of Array.isArray(e)?e:e.doc)switch(i.stmt){case XR:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case jRe:this.addRelation(i.state1,i.state2,i.description);break;case QWn:this.addStyleClass(i.id.trim(),i.classes);break;case GWn:this.handleStyleDef(i);break;case HWn:this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip);break}const r=this.getStates(),n=He();dYn(),Ez(void 0,this.getRootDocV2(),r,this.nodes,this.edges,!0,n.look,this.classes);for(const i of this.nodes)if(Array.isArray(i.label)){if(i.description=i.label.slice(1),i.isGroup&&i.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${i.id}]`);i.label=i.label[0]}}handleStyleDef(e){const r=e.id.trim().split(","),n=e.styleClass.split(",");for(const i of r){let a=this.getState(i);if(!a){const s=i.trim();this.addState(s),a=this.getState(s)}a&&(a.styles=n.map(s=>{var o;return(o=s.replace(/;/g,""))==null?void 0:o.trim()}))}}setRootDoc(e){me.info("Setting root doc",e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,r,n){if(r.stmt===jRe){this.docTranslator(e,r.state1,!0),this.docTranslator(e,r.state2,!1);return}if(r.stmt===XR&&(r.id===oh.START_NODE?(r.id=e.id+(n?"_start":"_end"),r.start=n):r.id=r.id.trim()),r.stmt!==KR&&r.stmt!==XR||!r.doc)return;const i=[];let a=[];for(const s of r.doc)if(s.type===Aqt){const o=Pne(s);o.doc=Pne(a),i.push(o),a=[]}else a.push(s);if(i.length>0&&a.length>0){const s={stmt:XR,id:Kyt(),type:"divider",doc:Pne(a)};i.push(Pne(s)),r.doc=i}r.doc.forEach(s=>this.docTranslator(r,s,!0))}getRootDocV2(){return this.docTranslator({id:KR,stmt:KR},{id:KR,stmt:KR,doc:this.rootDoc},!0),{id:KR,doc:this.rootDoc}}addState(e,r=Cz,n=void 0,i=void 0,a=void 0,s=void 0,o=void 0,l=void 0){const u=e==null?void 0:e.trim();if(!this.currentDocument.states.has(u))me.info("Adding state ",u,i),this.currentDocument.states.set(u,{stmt:XR,id:u,descriptions:[],type:r,doc:n,note:a,classes:[],styles:[],textStyles:[]});else{const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.doc||(h.doc=n),h.type||(h.type=r)}if(i&&(me.info("Setting state description",u,i),(Array.isArray(i)?i:[i]).forEach(d=>this.addDescription(u,d.trim()))),a){const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.note=a,h.note.text=jt.sanitizeText(h.note.text,He())}s&&(me.info("Setting state classes",u,s),(Array.isArray(s)?s:[s]).forEach(d=>this.setCssClass(u,d.trim()))),o&&(me.info("Setting state styles",u,o),(Array.isArray(o)?o:[o]).forEach(d=>this.setStyle(u,d.trim()))),l&&(me.info("Setting state styles",u,o),(Array.isArray(l)?l:[l]).forEach(d=>this.setTextStyle(u,d.trim())))}clear(e){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:Fqt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=$qt(),e||(this.links=new Map,Aa())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){me.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,r,n){this.links.set(e,{url:r,tooltip:n}),me.warn("Adding link",e,r,n)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===oh.START_NODE?(this.startEndCount++,`${oh.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",r=Cz){return e===oh.START_NODE?oh.START_TYPE:r}endIdIfNeeded(e=""){return e===oh.END_NODE?(this.startEndCount++,`${oh.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",r=Cz){return e===oh.END_NODE?oh.END_TYPE:r}addRelationObjs(e,r,n=""){const i=this.startIdIfNeeded(e.id.trim()),a=this.startTypeIfNeeded(e.id.trim(),e.type),s=this.startIdIfNeeded(r.id.trim()),o=this.startTypeIfNeeded(r.id.trim(),r.type);this.addState(i,a,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(s,o,r.doc,r.description,r.note,r.classes,r.styles,r.textStyles),this.currentDocument.relations.push({id1:i,id2:s,relationTitle:jt.sanitizeText(n,He())})}addRelation(e,r,n){if(typeof e=="object"&&typeof r=="object")this.addRelationObjs(e,r,n);else if(typeof e=="string"&&typeof r=="string"){const i=this.startIdIfNeeded(e.trim()),a=this.startTypeIfNeeded(e),s=this.endIdIfNeeded(r.trim()),o=this.endTypeIfNeeded(r);this.addState(i,a),this.addState(s,o),this.currentDocument.relations.push({id1:i,id2:s,relationTitle:n?jt.sanitizeText(n,He()):void 0})}}addDescription(e,r){var a;const n=this.currentDocument.states.get(e),i=r.startsWith(":")?r.replace(":","").trim():r;(a=n==null?void 0:n.descriptions)==null||a.push(jt.sanitizeText(i,He()))}cleanupLabel(e){return e.startsWith(":")?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,r=""){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});const n=this.classes.get(e);r&&n&&r.split(oh.STYLECLASS_SEP).forEach(i=>{const a=i.replace(/([^;]*);/,"$1").trim();if(RegExp(oh.COLOR_KEYWORD).exec(i)){const o=a.replace(oh.FILL_KEYWORD,oh.BG_FILL).replace(oh.COLOR_KEYWORD,oh.FILL_KEYWORD);n.textStyles.push(o)}n.styles.push(a)})}getClasses(){return this.classes}setupToolTips(e){const r=_ke();Ot(e).select("svg").selectAll("g.node, g.rough-node").on("mouseover",a=>{var u;const s=Ot(a.currentTarget),o=s.attr("title");if(o===null)return;const l=(u=a.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(Oy.sanitize(o)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),Ot(a.currentTarget).classed("hover",!1)})}setCssClass(e,r){e.split(",").forEach(n=>{var a;let i=this.getState(n);if(!i){const s=n.trim();this.addState(s),i=this.getState(s)}(a=i==null?void 0:i.classes)==null||a.push(r)})}setStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.styles)==null||i.push(r)}setTextStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.textStyles)==null||i.push(r)}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===wqt)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??VWn}setDirection(e){const r=this.getDirectionStatement();r?r.value=e:this.rootDoc.unshift({stmt:wqt,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=He();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:Iqt(this.getRootDocV2())}}getConfig(){return He().state}},C(JO,"StateDB"),JO.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},JO),fYn=C(t=>` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var V=this.next();return V||this.lex()},"lex"),begin:C(function(V){this.conditionStack.push(V)},"begin"),popState:C(function(){var V=this.conditionStack.length-1;return V>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(V){return V=this.conditionStack.length-1-Math.abs(V||0),V>=0?this.conditionStack[V]:"INITIAL"},"topState"),pushState:C(function(V){this.begin(V)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:C(function(V,z,U,Q){function G(){const X=z.yytext.indexOf("%%");if(X===0)return!1;if(X>0){const Y=z.yytext.slice(0,X),le=z.yytext.slice(X);le&&V.lexer.unput(le),z.yytext=Y}return!0}switch(C(G,"processId"),U){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 33:return this.pushState("SCALE"),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),z.yytext=z.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),z.yytext=z.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:return G()?(this.popState(),"ID"):void 0;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+z.yytext.trim()+'"');case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 57:break;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 63:break;case 64:return"NOTE_TEXT";case 65:return G()?(this.popState(),"ID"):void 0;case 66:return G()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 67:return this.popState(),z.yytext=z.yytext.substr(2).trim(),31;case 68:return this.popState(),z.yytext=z.yytext.slice(0,-8).trim(),31;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:return G()?24:void 0;case 74:return z.yytext=z.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}};return F}();M.lexer=P;function N(){this.yy={}}return C(N,"Parser"),N.prototype=M,M.Parser=N,new N}();qRe.parser=qRe;var bqt=qRe,VWn="TB",xqt="TB",wqt="dir",XR="state",KR="root",jRe="relation",QWn="classDef",GWn="style",HWn="applyClass",Cz="default",Aqt="divider",Sqt="fill:none",Tqt="fill: #333",Cqt="c",Oqt="markdown",kqt="normal",XRe="rect",KRe="rectWithTitle",WWn="stateStart",YWn="stateEnd",Eqt="divider",_qt="roundedWithTitle",qWn="note",jWn="noteGroup",Oz="statediagram",XWn="state",KWn=`${Oz}-${XWn}`,Rqt="transition",ZWn="note",JWn="note-edge",eYn=`${Rqt} ${JWn}`,tYn=`${Oz}-${ZWn}`,rYn="cluster",nYn=`${Oz}-${rYn}`,iYn="cluster-alt",aYn=`${Oz}-${iYn}`,Dqt="parent",Lqt="note",sYn="state",ZRe="----",oYn=`${ZRe}${Lqt}`,Mqt=`${ZRe}${Dqt}`,Iqt=C((t,e=xqt)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),lYn=C(function(t,e){return e.db.getClasses()},"getClasses"),cYn=C(async function(t,e,r,n){me.info("REF0:"),me.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:a,layout:s}=He();n.db.extract(n.db.getRootDocV2());const o=n.db.getData(),l=z3(e,i);o.type=n.type,o.layoutAlgorithm=s,o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,He().look==="neo"?o.markers=["barbNeo"]:o.markers=["barb"],o.diagramId=e,await e4(o,l);const h=8;try{(typeof n.db.getLinks=="function"?n.db.getLinks():new Map).forEach((f,p)=>{var A;const g=typeof p=="string"?p:typeof(p==null?void 0:p.id)=="string"?p.id:"",m=o.nodes.find(S=>S.id===g);if(!g){me.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(p));return}const v=(A=l.node())==null?void 0:A.querySelectorAll("g.node, g.rough-node");let y;if(v==null||v.forEach(S=>{var O;const T=(O=S.textContent)==null?void 0:O.trim();(S.id===(m==null?void 0:m.domId)||T===g)&&(y=S)}),!y){me.warn("⚠️ Could not find node matching text:",g);return}const b=y.parentNode;if(!b){me.warn("⚠️ Node has no parent, cannot wrap:",g);return}const x=document.createElementNS("http://www.w3.org/2000/svg","a"),w=f.url.replace(/^"+|"+$/g,"");if(x.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",w),x.setAttribute("target","_blank"),f.tooltip){const S=f.tooltip.replace(/^"+|"+$/g,"");x.setAttribute("title",S),y.setAttribute("title",S)}b.replaceChild(x,y),x.appendChild(y),me.info("🔗 Wrapped node in tag for:",g,f.url)})}catch(d){me.error("❌ Error injecting clickable links:",d)}ln.insertTitle(l,"statediagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),IC(l,h,Oz,(a==null?void 0:a.useMaxWidth)??!0)},"draw"),uYn={getClasses:lYn,draw:cYn,getDir:Iqt},Mne=new Map,mw=0;function Ine(t="",e=0,r="",n=ZRe){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${sYn}-${t}${i}-${e}`}C(Ine,"stateDomId");var hYn=C((t,e,r,n,i,a,s,o)=>{me.trace("items",e),e.forEach(l=>{switch(l.stmt){case XR:Ez(t,l,r,n,i,a,s,o);break;case Cz:Ez(t,l,r,n,i,a,s,o);break;case jRe:{Ez(t,l.state1,r,n,i,a,s,o),Ez(t,l.state2,r,n,i,a,s,o);const u=s==="neo",h={id:"edge"+mw,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:u?"arrow_barb_neo":"arrow_barb",style:Sqt,labelStyle:"",label:jt.sanitizeText(l.description??"",He()),arrowheadStyle:Tqt,labelpos:Cqt,labelType:Oqt,thickness:kqt,classes:Rqt,look:s};i.push(h),mw++}break}})},"setupDoc"),Pqt=C((t,e=xqt)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function kz(t,e,r){if(!e.id||e.id===""||e.id==="")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(i=>{const a=r.get(i);a&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...a.styles])}));const n=t.find(i=>i.id===e.id);n?Object.assign(n,e):t.push(e)}C(kz,"insertOrUpdateNode");function Nqt(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}C(Nqt,"getClassesFromDbInfo");function Bqt(t){return(t==null?void 0:t.styles)??[]}C(Bqt,"getStylesFromDbInfo");var Ez=C((t,e,r,n,i,a,s,o)=>{var p,g,m;const l=e.id,u=r.get(l),h=Nqt(u),d=Bqt(u),f=He();if(me.info("dataFetcher parsedItem",e,u,d),l!=="root"){let v=XRe;e.start===!0?v=WWn:e.start===!1&&(v=YWn),e.type!==Cz&&(v=e.type),Mne.get(l)||Mne.set(l,{id:l,shape:v,description:jt.sanitizeText(l,f),cssClasses:`${h} ${KWn}`,cssStyles:d});const y=Mne.get(l);e.description&&(Array.isArray(y.description)?(y.shape=KRe,y.description.push(e.description)):(p=y.description)!=null&&p.length&&y.description.length>0?(y.shape=KRe,y.description===l?y.description=[e.description]:y.description=[y.description,e.description]):(y.shape=XRe,y.description=e.description),y.description=jt.sanitizeTextOrArray(y.description,f)),((g=y.description)==null?void 0:g.length)===1&&y.shape===KRe&&(y.type==="group"?y.shape=_qt:y.shape=XRe),!y.type&&e.doc&&(me.info("Setting cluster for XCX",l,Pqt(e)),y.type="group",y.isGroup=!0,y.dir=Pqt(e),y.explicitDir=e.doc.some(x=>x.stmt==="dir"),y.shape=e.type===Aqt?Eqt:_qt,y.cssClasses=`${y.cssClasses} ${nYn} ${a?aYn:""}`);const b={labelStyle:"",shape:y.shape,label:y.description,cssClasses:y.cssClasses,cssCompiledStyles:[],cssStyles:y.cssStyles,id:l,dir:y.dir,domId:Ine(l,mw),type:y.type,isGroup:y.type==="group",padding:8,rx:10,ry:10,look:s,labelType:"markdown"};if(b.shape===Eqt&&(b.label=""),t&&t.id!=="root"&&(me.trace("Setting node ",l," to be child of its parent ",t.id),b.parentId=t.id),b.centerLabel=!0,e.note){const x={labelStyle:"",shape:qWn,label:e.note.text,labelType:"markdown",cssClasses:tYn,cssStyles:[],cssCompiledStyles:[],id:l+oYn+"-"+mw,domId:Ine(l,mw,Lqt),type:y.type,isGroup:y.type==="group",padding:(m=f.flowchart)==null?void 0:m.padding,look:s,position:e.note.position},w=l+Mqt,A={labelStyle:"",shape:jWn,label:e.note.text,cssClasses:y.cssClasses,cssStyles:[],id:l+Mqt,domId:Ine(l,mw,Dqt),type:"group",isGroup:!0,padding:16,look:s,position:e.note.position};mw++,A.id=w,x.parentId=w,kz(n,A,o),kz(n,x,o),kz(n,b,o);let S=l,T=x.id;e.note.position==="left of"&&(S=x.id,T=l),i.push({id:S+"-"+T,start:S,end:T,arrowhead:"none",arrowTypeEnd:"",style:Sqt,labelStyle:"",classes:eYn,arrowheadStyle:Tqt,labelpos:Cqt,labelType:Oqt,thickness:kqt,look:s})}else kz(n,b,o)}e.doc&&(me.trace("Adding nodes children "),hYn(e,e.doc,r,n,i,!a,s,o))},"dataFetcher"),dYn=C(()=>{Mne.clear(),mw=0},"reset"),oh={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},$qt=C(()=>new Map,"newClassesList"),Fqt=C(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),Pne=C(t=>JSON.parse(JSON.stringify(t)),"clone"),WO=(JO=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=$qt(),this.documents={root:Fqt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=Ja,this.setAccTitle=Da,this.getAccDescription=ts,this.setAccDescription=es,this.setDiagramTitle=rs,this.getDiagramTitle=La,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}extract(e){this.clear(!0);for(const i of Array.isArray(e)?e:e.doc)switch(i.stmt){case XR:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case jRe:this.addRelation(i.state1,i.state2,i.description);break;case QWn:this.addStyleClass(i.id.trim(),i.classes);break;case GWn:this.handleStyleDef(i);break;case HWn:this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip);break}const r=this.getStates(),n=He();dYn(),Ez(void 0,this.getRootDocV2(),r,this.nodes,this.edges,!0,n.look,this.classes);for(const i of this.nodes)if(Array.isArray(i.label)){if(i.description=i.label.slice(1),i.isGroup&&i.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${i.id}]`);i.label=i.label[0]}}handleStyleDef(e){const r=e.id.trim().split(","),n=e.styleClass.split(",");for(const i of r){let a=this.getState(i);if(!a){const s=i.trim();this.addState(s),a=this.getState(s)}a&&(a.styles=n.map(s=>{var o;return(o=s.replace(/;/g,""))==null?void 0:o.trim()}))}}setRootDoc(e){me.info("Setting root doc",e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,r,n){if(r.stmt===jRe){this.docTranslator(e,r.state1,!0),this.docTranslator(e,r.state2,!1);return}if(r.stmt===XR&&(r.id===oh.START_NODE?(r.id=e.id+(n?"_start":"_end"),r.start=n):r.id=r.id.trim()),r.stmt!==KR&&r.stmt!==XR||!r.doc)return;const i=[];let a=[];for(const s of r.doc)if(s.type===Aqt){const o=Pne(s);o.doc=Pne(a),i.push(o),a=[]}else a.push(s);if(i.length>0&&a.length>0){const s={stmt:XR,id:Kyt(),type:"divider",doc:Pne(a)};i.push(Pne(s)),r.doc=i}r.doc.forEach(s=>this.docTranslator(r,s,!0))}getRootDocV2(){return this.docTranslator({id:KR,stmt:KR},{id:KR,stmt:KR,doc:this.rootDoc},!0),{id:KR,doc:this.rootDoc}}addState(e,r=Cz,n=void 0,i=void 0,a=void 0,s=void 0,o=void 0,l=void 0){const u=e==null?void 0:e.trim();if(!this.currentDocument.states.has(u))me.info("Adding state ",u,i),this.currentDocument.states.set(u,{stmt:XR,id:u,descriptions:[],type:r,doc:n,note:a,classes:[],styles:[],textStyles:[]});else{const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.doc||(h.doc=n),h.type||(h.type=r)}if(i&&(me.info("Setting state description",u,i),(Array.isArray(i)?i:[i]).forEach(d=>this.addDescription(u,d.trim()))),a){const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.note=a,h.note.text=jt.sanitizeText(h.note.text,He())}s&&(me.info("Setting state classes",u,s),(Array.isArray(s)?s:[s]).forEach(d=>this.setCssClass(u,d.trim()))),o&&(me.info("Setting state styles",u,o),(Array.isArray(o)?o:[o]).forEach(d=>this.setStyle(u,d.trim()))),l&&(me.info("Setting state styles",u,o),(Array.isArray(l)?l:[l]).forEach(d=>this.setTextStyle(u,d.trim())))}clear(e){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:Fqt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=$qt(),e||(this.links=new Map,Aa())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){me.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,r,n){this.links.set(e,{url:r,tooltip:n}),me.warn("Adding link",e,r,n)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===oh.START_NODE?(this.startEndCount++,`${oh.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",r=Cz){return e===oh.START_NODE?oh.START_TYPE:r}endIdIfNeeded(e=""){return e===oh.END_NODE?(this.startEndCount++,`${oh.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",r=Cz){return e===oh.END_NODE?oh.END_TYPE:r}addRelationObjs(e,r,n=""){const i=this.startIdIfNeeded(e.id.trim()),a=this.startTypeIfNeeded(e.id.trim(),e.type),s=this.startIdIfNeeded(r.id.trim()),o=this.startTypeIfNeeded(r.id.trim(),r.type);this.addState(i,a,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(s,o,r.doc,r.description,r.note,r.classes,r.styles,r.textStyles),this.currentDocument.relations.push({id1:i,id2:s,relationTitle:jt.sanitizeText(n,He())})}addRelation(e,r,n){if(typeof e=="object"&&typeof r=="object")this.addRelationObjs(e,r,n);else if(typeof e=="string"&&typeof r=="string"){const i=this.startIdIfNeeded(e.trim()),a=this.startTypeIfNeeded(e),s=this.endIdIfNeeded(r.trim()),o=this.endTypeIfNeeded(r);this.addState(i,a),this.addState(s,o),this.currentDocument.relations.push({id1:i,id2:s,relationTitle:n?jt.sanitizeText(n,He()):void 0})}}addDescription(e,r){var a;const n=this.currentDocument.states.get(e),i=r.startsWith(":")?r.replace(":","").trim():r;(a=n==null?void 0:n.descriptions)==null||a.push(jt.sanitizeText(i,He()))}cleanupLabel(e){return e.startsWith(":")?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,r=""){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});const n=this.classes.get(e);r&&n&&r.split(oh.STYLECLASS_SEP).forEach(i=>{const a=i.replace(/([^;]*);/,"$1").trim();if(RegExp(oh.COLOR_KEYWORD).exec(i)){const o=a.replace(oh.FILL_KEYWORD,oh.BG_FILL).replace(oh.COLOR_KEYWORD,oh.FILL_KEYWORD);n.textStyles.push(o)}n.styles.push(a)})}getClasses(){return this.classes}setupToolTips(e){const r=_ke();Ot(e).select("svg").selectAll("g.node, g.rough-node").on("mouseover",a=>{var u;const s=Ot(a.currentTarget),o=s.attr("title");if(o===null)return;const l=(u=a.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(Oy.sanitize(o)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),Ot(a.currentTarget).classed("hover",!1)})}setCssClass(e,r){e.split(",").forEach(n=>{var a;let i=this.getState(n);if(!i){const s=n.trim();this.addState(s),i=this.getState(s)}(a=i==null?void 0:i.classes)==null||a.push(r)})}setStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.styles)==null||i.push(r)}setTextStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.textStyles)==null||i.push(r)}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===wqt)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??VWn}setDirection(e){const r=this.getDirectionStatement();r?r.value=e:this.rootDoc.unshift({stmt:wqt,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=He();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:Iqt(this.getRootDocV2())}}getConfig(){return He().state}},C(JO,"StateDB"),JO.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},JO),fYn=C(t=>` defs [id$="-barbEnd"] { fill: ${t.transitionColor}; stroke: ${t.transitionColor}; @@ -2874,9 +2874,9 @@ g.stateGroup line { ry: ${t.radius}px; filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"} } -`,"getStyles"),zqt=fYn,pYn=C(t=>t.append("circle").attr("class","start-state").attr("r",He().state.sizeUnit).attr("cx",He().state.padding+He().state.sizeUnit).attr("cy",He().state.padding+He().state.sizeUnit),"drawStartState"),gYn=C(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",He().state.textHeight).attr("class","divider").attr("x2",He().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),mYn=C((t,e)=>{const r=t.append("text").attr("x",2*He().state.padding).attr("y",He().state.textHeight+2*He().state.padding).attr("font-size",He().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",He().state.padding).attr("y",He().state.padding).attr("width",n.width+2*He().state.padding).attr("height",n.height+2*He().state.padding).attr("rx",He().state.radius),r},"drawSimpleState"),vYn=C((t,e)=>{const r=C(function(f,p,g){const m=f.append("tspan").attr("x",2*He().state.padding).text(p);g||m.attr("dy",He().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*He().state.padding).attr("y",He().state.textHeight+1.3*He().state.padding).attr("font-size",He().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),a=i.height,s=t.append("text").attr("x",He().state.padding).attr("y",a+He().state.padding*.4+He().state.dividerMargin+He().state.textHeight).attr("class","state-description");let o=!0,l=!0;e.descriptions.forEach(function(f){o||(r(s,f,l),l=!1),o=!1});const u=t.append("line").attr("x1",He().state.padding).attr("y1",He().state.padding+a+He().state.dividerMargin/2).attr("y2",He().state.padding+a+He().state.dividerMargin/2).attr("class","descr-divider"),h=s.node().getBBox(),d=Math.max(h.width,i.width);return u.attr("x2",d+3*He().state.padding),t.insert("rect",":first-child").attr("x",He().state.padding).attr("y",He().state.padding).attr("width",d+2*He().state.padding).attr("height",h.height+a+2*He().state.padding).attr("rx",He().state.radius),t},"drawDescrState"),yYn=C((t,e,r)=>{const n=He().state.padding,i=2*He().state.padding,a=t.node().getBBox(),s=a.width,o=a.x,l=t.append("text").attr("x",0).attr("y",He().state.titleShift).attr("font-size",He().state.fontSize).attr("class","state-title").text(e.id),h=l.node().getBBox().width+i;let d=Math.max(h,s);d===s&&(d=d+i);let f;const p=t.node().getBBox();e.doc,f=o-n,h>s&&(f=(s-d)/2+n),Math.abs(o-p.x)s&&(f=o-(h-s)/2);const g=1-He().state.textHeight;return t.insert("rect",":first-child").attr("x",f).attr("y",g).attr("class",r?"alt-composit":"composit").attr("width",d).attr("height",p.height+He().state.textHeight+He().state.titleShift+1).attr("rx","0"),l.attr("x",f+n),h<=s&&l.attr("x",o+(d-i)/2-h/2+n),t.insert("rect",":first-child").attr("x",f).attr("y",He().state.titleShift-He().state.textHeight-He().state.padding).attr("width",d).attr("height",He().state.textHeight*3).attr("rx",He().state.radius),t.insert("rect",":first-child").attr("x",f).attr("y",He().state.titleShift-He().state.textHeight-He().state.padding).attr("width",d).attr("height",p.height+3+2*He().state.textHeight).attr("rx",He().state.radius),t},"addTitleAndBox"),bYn=C(t=>(t.append("circle").attr("class","end-state-outer").attr("r",He().state.sizeUnit+He().state.miniPadding).attr("cx",He().state.padding+He().state.sizeUnit+He().state.miniPadding).attr("cy",He().state.padding+He().state.sizeUnit+He().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",He().state.sizeUnit).attr("cx",He().state.padding+He().state.sizeUnit+2).attr("cy",He().state.padding+He().state.sizeUnit+2)),"drawEndState"),xYn=C((t,e)=>{let r=He().state.forkWidth,n=He().state.forkHeight;if(e.parentId){let i=r;r=n,n=i}return t.append("rect").style("stroke","black").style("fill","black").attr("width",r).attr("height",n).attr("x",He().state.padding).attr("y",He().state.padding)},"drawForkJoinState"),wYn=C((t,e,r,n)=>{let i=0;const a=n.append("text");a.style("text-anchor","start"),a.attr("class","noteText");let s=t.replace(/\r\n/g,"
");s=s.replace(/\n/g,"
");const o=s.split(jt.lineBreakRegex);let l=1.25*He().state.noteMargin;for(const u of o){const h=u.trim();if(h.length>0){const d=a.append("tspan");if(d.text(h),l===0){const f=d.node().getBBox();l+=f.height}i+=l,d.attr("x",e+He().state.noteMargin),d.attr("y",r+i+1.25*He().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},"_drawLongText"),AYn=C((t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",He().state.padding),n=e.append("g"),{textWidth:i,textHeight:a}=wYn(t,0,0,n);return r.attr("height",a+2*He().state.noteMargin),r.attr("width",i+He().state.noteMargin*2),r},"drawNote"),Uqt=C(function(t,e){const r=e.id,n={id:r,label:e.id,width:0,height:0},i=t.append("g").attr("id",r).attr("class","stateGroup");e.type==="start"&&pYn(i),e.type==="end"&&bYn(i),(e.type==="fork"||e.type==="join")&&xYn(i,e),e.type==="note"&&AYn(e.note.text,i),e.type==="divider"&&gYn(i),e.type==="default"&&e.descriptions.length===0&&mYn(i,e),e.type==="default"&&e.descriptions.length>0&&vYn(i,e);const a=i.node().getBBox();return n.width=a.width+2*He().state.padding,n.height=a.height+2*He().state.padding,n},"drawState"),Vqt=0,TYn=C(function(t,e,r){const n=C(function(l){switch(l){case WO.relationType.AGGREGATION:return"aggregation";case WO.relationType.EXTENSION:return"extension";case WO.relationType.COMPOSITION:return"composition";case WO.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(l=>!Number.isNaN(l.y));const i=e.points,a=r7().x(function(l){return l.x}).y(function(l){return l.y}).curve(n7),s=t.append("path").attr("d",a(i)).attr("id","edge"+Vqt).attr("class","transition");let o="";if(He().state.arrowMarkerAbsolute&&(o=Eq(!0)),s.attr("marker-end","url("+o+"#"+n(WO.relationType.DEPENDENCY)+"End)"),r.title!==void 0){const l=t.append("g").attr("class","stateLabel"),{x:u,y:h}=ln.calcLabelPosition(e.points),d=jt.getRows(r.title);let f=0;const p=[];let g=0,m=0;for(let b=0;b<=d.length;b++){const x=l.append("text").attr("text-anchor","middle").text(d[b]).attr("x",u).attr("y",h+f),w=x.node().getBBox();g=Math.max(g,w.width),m=Math.min(m,w.x),me.info(w.x,u,h+f),f===0&&(f=x.node().getBBox().height,me.info("Title height",f,h)),p.push(x)}let v=f*d.length;if(d.length>1){const b=(d.length-1)*f*.5;p.forEach((x,w)=>x.attr("y",h+w*f-b)),v=f*d.length}const y=l.node().getBBox();l.insert("rect",":first-child").attr("class","box").attr("x",u-g/2-He().state.padding/2).attr("y",h-v/2-He().state.padding/2-3.5).attr("width",g+He().state.padding).attr("height",v+He().state.padding),me.info(y)}Vqt++},"drawEdge"),uf,JRe={},SYn=C(function(){},"setConf"),CYn=C(function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),OYn=C(function(t,e,r,n){uf=He().state;const i=He().securityLevel;let a;i==="sandbox"&&(a=Ot("#i"+e));const s=Ot(i==="sandbox"?a.nodes()[0].contentDocument.body:"body"),o=i==="sandbox"?a.nodes()[0].contentDocument:document;me.debug("Rendering diagram "+t);const l=s.select(`[id='${e}']`);CYn(l);const u=n.db.getRootDoc(),h=l.append("g").attr("id",e+"-root");Qqt(u,h,void 0,!1,s,o,n);const d=uf.padding,f=l.node().getBBox(),p=f.width+d*2,g=f.height+d*2,m=p*1.75;zs(l,g,m,uf.useMaxWidth),l.attr("viewBox",`${f.x-uf.padding} ${f.y-uf.padding} `+p+" "+g)},"draw"),kYn=C(t=>t?t.length*uf.fontSizeFactor:1,"getLabelWidth"),Qqt=C((t,e,r,n,i,a,s)=>{const o=new ru({compound:!0,multigraph:!0});let l,u=!0;for(l=0;l{const w=x.parentElement;let A=0,T=0;w&&(w.parentElement&&(A=w.parentElement.getBBox().width),T=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(T)&&(T=0)),x.setAttribute("x1",0-T+8),x.setAttribute("x2",A-T-8)})):me.debug("No Node "+y+": "+JSON.stringify(o.node(y)))});let m=g.getBBox();o.edges().forEach(function(y){y!==void 0&&o.edge(y)!==void 0&&(me.debug("Edge "+y.v+" -> "+y.w+": "+JSON.stringify(o.edge(y))),TYn(e,o.edge(y),o.edge(y).relation))}),m=g.getBBox();const v={id:r||"root",label:r||"root",width:0,height:0};return v.width=m.width+2*uf.padding,v.height=m.height+2*uf.padding,me.debug("Doc rendered",v,o),v},"renderDoc"),EYn={setConf:SYn,draw:OYn},_Yn={parser:bqt,get db(){return new WO(1)},renderer:EYn,styles:zqt,init:C(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const RYn=Object.freeze(Object.defineProperty({__proto__:null,diagram:_Yn},Symbol.toStringTag,{value:"Module"}));var DYn={parser:bqt,get db(){return new WO(2)},renderer:uYn,styles:zqt,init:C(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const LYn=Object.freeze(Object.defineProperty({__proto__:null,diagram:DYn},Symbol.toStringTag,{value:"Module"}));var eDe=function(){var t=C(function(d,f,p,g){for(p=p||{},g=d.length;g--;p[d[g]]=f);return p},"o"),e=[6,8,10,11,12,14,16,17,18],r=[1,9],n=[1,10],i=[1,11],a=[1,12],s=[1,13],o=[1,14],l={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:C(function(f,p,g,m,v,y,b){var x=y.length-1;switch(v){case 1:return y[x-1];case 2:this.$=[];break;case 3:y[x-1].push(y[x]),this.$=y[x-1];break;case 4:case 5:this.$=y[x];break;case 6:case 7:this.$=[];break;case 8:m.setDiagramTitle(y[x].substr(6)),this.$=y[x].substr(6);break;case 9:this.$=y[x].trim(),m.setAccTitle(this.$);break;case 10:case 11:this.$=y[x].trim(),m.setAccDescription(this.$);break;case 12:m.addSection(y[x].substr(8)),this.$=y[x].substr(8);break;case 13:m.addTask(y[x-1],y[x]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:C(function(f,p){if(p.recoverable)this.trace(f);else{var g=new Error(f);throw g.hash=p,g}},"parseError"),parse:C(function(f){var p=this,g=[0],m=[],v=[null],y=[],b=this.table,x="",w=0,A=0,T=2,S=1,O=y.slice.call(arguments,1),k=Object.create(this.lexer),E={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(E.yy[_]=this.yy[_]);k.setInput(f,E.yy),E.yy.lexer=k,E.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var I=k.yylloc;y.push(I);var L=k.options&&k.options.ranges;typeof E.yy.parseError=="function"?this.parseError=E.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function R(X){g.length=g.length-2*X,v.length=v.length-X,y.length=y.length-X}C(R,"popStack");function D(){var X;return X=m.pop()||k.lex()||S,typeof X!="number"&&(X instanceof Array&&(m=X,X=m.pop()),X=p.symbols_[X]||X),X}C(D,"lex");for(var M,P,N,F,B={},V,z,U,Q;;){if(P=g[g.length-1],this.defaultActions[P]?N=this.defaultActions[P]:((M===null||typeof M>"u")&&(M=D()),N=b[P]&&b[P][M]),typeof N>"u"||!N.length||!N[0]){var G="";Q=[];for(V in b[P])this.terminals_[V]&&V>T&&Q.push("'"+this.terminals_[V]+"'");k.showPosition?G="Parse error on line "+(w+1)+`: +`,"getStyles"),zqt=fYn,pYn=C(t=>t.append("circle").attr("class","start-state").attr("r",He().state.sizeUnit).attr("cx",He().state.padding+He().state.sizeUnit).attr("cy",He().state.padding+He().state.sizeUnit),"drawStartState"),gYn=C(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",He().state.textHeight).attr("class","divider").attr("x2",He().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),mYn=C((t,e)=>{const r=t.append("text").attr("x",2*He().state.padding).attr("y",He().state.textHeight+2*He().state.padding).attr("font-size",He().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",He().state.padding).attr("y",He().state.padding).attr("width",n.width+2*He().state.padding).attr("height",n.height+2*He().state.padding).attr("rx",He().state.radius),r},"drawSimpleState"),vYn=C((t,e)=>{const r=C(function(f,p,g){const m=f.append("tspan").attr("x",2*He().state.padding).text(p);g||m.attr("dy",He().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*He().state.padding).attr("y",He().state.textHeight+1.3*He().state.padding).attr("font-size",He().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),a=i.height,s=t.append("text").attr("x",He().state.padding).attr("y",a+He().state.padding*.4+He().state.dividerMargin+He().state.textHeight).attr("class","state-description");let o=!0,l=!0;e.descriptions.forEach(function(f){o||(r(s,f,l),l=!1),o=!1});const u=t.append("line").attr("x1",He().state.padding).attr("y1",He().state.padding+a+He().state.dividerMargin/2).attr("y2",He().state.padding+a+He().state.dividerMargin/2).attr("class","descr-divider"),h=s.node().getBBox(),d=Math.max(h.width,i.width);return u.attr("x2",d+3*He().state.padding),t.insert("rect",":first-child").attr("x",He().state.padding).attr("y",He().state.padding).attr("width",d+2*He().state.padding).attr("height",h.height+a+2*He().state.padding).attr("rx",He().state.radius),t},"drawDescrState"),yYn=C((t,e,r)=>{const n=He().state.padding,i=2*He().state.padding,a=t.node().getBBox(),s=a.width,o=a.x,l=t.append("text").attr("x",0).attr("y",He().state.titleShift).attr("font-size",He().state.fontSize).attr("class","state-title").text(e.id),h=l.node().getBBox().width+i;let d=Math.max(h,s);d===s&&(d=d+i);let f;const p=t.node().getBBox();e.doc,f=o-n,h>s&&(f=(s-d)/2+n),Math.abs(o-p.x)s&&(f=o-(h-s)/2);const g=1-He().state.textHeight;return t.insert("rect",":first-child").attr("x",f).attr("y",g).attr("class",r?"alt-composit":"composit").attr("width",d).attr("height",p.height+He().state.textHeight+He().state.titleShift+1).attr("rx","0"),l.attr("x",f+n),h<=s&&l.attr("x",o+(d-i)/2-h/2+n),t.insert("rect",":first-child").attr("x",f).attr("y",He().state.titleShift-He().state.textHeight-He().state.padding).attr("width",d).attr("height",He().state.textHeight*3).attr("rx",He().state.radius),t.insert("rect",":first-child").attr("x",f).attr("y",He().state.titleShift-He().state.textHeight-He().state.padding).attr("width",d).attr("height",p.height+3+2*He().state.textHeight).attr("rx",He().state.radius),t},"addTitleAndBox"),bYn=C(t=>(t.append("circle").attr("class","end-state-outer").attr("r",He().state.sizeUnit+He().state.miniPadding).attr("cx",He().state.padding+He().state.sizeUnit+He().state.miniPadding).attr("cy",He().state.padding+He().state.sizeUnit+He().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",He().state.sizeUnit).attr("cx",He().state.padding+He().state.sizeUnit+2).attr("cy",He().state.padding+He().state.sizeUnit+2)),"drawEndState"),xYn=C((t,e)=>{let r=He().state.forkWidth,n=He().state.forkHeight;if(e.parentId){let i=r;r=n,n=i}return t.append("rect").style("stroke","black").style("fill","black").attr("width",r).attr("height",n).attr("x",He().state.padding).attr("y",He().state.padding)},"drawForkJoinState"),wYn=C((t,e,r,n)=>{let i=0;const a=n.append("text");a.style("text-anchor","start"),a.attr("class","noteText");let s=t.replace(/\r\n/g,"
");s=s.replace(/\n/g,"
");const o=s.split(jt.lineBreakRegex);let l=1.25*He().state.noteMargin;for(const u of o){const h=u.trim();if(h.length>0){const d=a.append("tspan");if(d.text(h),l===0){const f=d.node().getBBox();l+=f.height}i+=l,d.attr("x",e+He().state.noteMargin),d.attr("y",r+i+1.25*He().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},"_drawLongText"),AYn=C((t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",He().state.padding),n=e.append("g"),{textWidth:i,textHeight:a}=wYn(t,0,0,n);return r.attr("height",a+2*He().state.noteMargin),r.attr("width",i+He().state.noteMargin*2),r},"drawNote"),Uqt=C(function(t,e){const r=e.id,n={id:r,label:e.id,width:0,height:0},i=t.append("g").attr("id",r).attr("class","stateGroup");e.type==="start"&&pYn(i),e.type==="end"&&bYn(i),(e.type==="fork"||e.type==="join")&&xYn(i,e),e.type==="note"&&AYn(e.note.text,i),e.type==="divider"&&gYn(i),e.type==="default"&&e.descriptions.length===0&&mYn(i,e),e.type==="default"&&e.descriptions.length>0&&vYn(i,e);const a=i.node().getBBox();return n.width=a.width+2*He().state.padding,n.height=a.height+2*He().state.padding,n},"drawState"),Vqt=0,SYn=C(function(t,e,r){const n=C(function(l){switch(l){case WO.relationType.AGGREGATION:return"aggregation";case WO.relationType.EXTENSION:return"extension";case WO.relationType.COMPOSITION:return"composition";case WO.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(l=>!Number.isNaN(l.y));const i=e.points,a=r7().x(function(l){return l.x}).y(function(l){return l.y}).curve(n7),s=t.append("path").attr("d",a(i)).attr("id","edge"+Vqt).attr("class","transition");let o="";if(He().state.arrowMarkerAbsolute&&(o=Eq(!0)),s.attr("marker-end","url("+o+"#"+n(WO.relationType.DEPENDENCY)+"End)"),r.title!==void 0){const l=t.append("g").attr("class","stateLabel"),{x:u,y:h}=ln.calcLabelPosition(e.points),d=jt.getRows(r.title);let f=0;const p=[];let g=0,m=0;for(let b=0;b<=d.length;b++){const x=l.append("text").attr("text-anchor","middle").text(d[b]).attr("x",u).attr("y",h+f),w=x.node().getBBox();g=Math.max(g,w.width),m=Math.min(m,w.x),me.info(w.x,u,h+f),f===0&&(f=x.node().getBBox().height,me.info("Title height",f,h)),p.push(x)}let v=f*d.length;if(d.length>1){const b=(d.length-1)*f*.5;p.forEach((x,w)=>x.attr("y",h+w*f-b)),v=f*d.length}const y=l.node().getBBox();l.insert("rect",":first-child").attr("class","box").attr("x",u-g/2-He().state.padding/2).attr("y",h-v/2-He().state.padding/2-3.5).attr("width",g+He().state.padding).attr("height",v+He().state.padding),me.info(y)}Vqt++},"drawEdge"),uf,JRe={},TYn=C(function(){},"setConf"),CYn=C(function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),OYn=C(function(t,e,r,n){uf=He().state;const i=He().securityLevel;let a;i==="sandbox"&&(a=Ot("#i"+e));const s=Ot(i==="sandbox"?a.nodes()[0].contentDocument.body:"body"),o=i==="sandbox"?a.nodes()[0].contentDocument:document;me.debug("Rendering diagram "+t);const l=s.select(`[id='${e}']`);CYn(l);const u=n.db.getRootDoc(),h=l.append("g").attr("id",e+"-root");Qqt(u,h,void 0,!1,s,o,n);const d=uf.padding,f=l.node().getBBox(),p=f.width+d*2,g=f.height+d*2,m=p*1.75;zs(l,g,m,uf.useMaxWidth),l.attr("viewBox",`${f.x-uf.padding} ${f.y-uf.padding} `+p+" "+g)},"draw"),kYn=C(t=>t?t.length*uf.fontSizeFactor:1,"getLabelWidth"),Qqt=C((t,e,r,n,i,a,s)=>{const o=new ru({compound:!0,multigraph:!0});let l,u=!0;for(l=0;l{const w=x.parentElement;let A=0,S=0;w&&(w.parentElement&&(A=w.parentElement.getBBox().width),S=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(S)&&(S=0)),x.setAttribute("x1",0-S+8),x.setAttribute("x2",A-S-8)})):me.debug("No Node "+y+": "+JSON.stringify(o.node(y)))});let m=g.getBBox();o.edges().forEach(function(y){y!==void 0&&o.edge(y)!==void 0&&(me.debug("Edge "+y.v+" -> "+y.w+": "+JSON.stringify(o.edge(y))),SYn(e,o.edge(y),o.edge(y).relation))}),m=g.getBBox();const v={id:r||"root",label:r||"root",width:0,height:0};return v.width=m.width+2*uf.padding,v.height=m.height+2*uf.padding,me.debug("Doc rendered",v,o),v},"renderDoc"),EYn={setConf:TYn,draw:OYn},_Yn={parser:bqt,get db(){return new WO(1)},renderer:EYn,styles:zqt,init:C(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const RYn=Object.freeze(Object.defineProperty({__proto__:null,diagram:_Yn},Symbol.toStringTag,{value:"Module"}));var DYn={parser:bqt,get db(){return new WO(2)},renderer:uYn,styles:zqt,init:C(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const LYn=Object.freeze(Object.defineProperty({__proto__:null,diagram:DYn},Symbol.toStringTag,{value:"Module"}));var eDe=function(){var t=C(function(d,f,p,g){for(p=p||{},g=d.length;g--;p[d[g]]=f);return p},"o"),e=[6,8,10,11,12,14,16,17,18],r=[1,9],n=[1,10],i=[1,11],a=[1,12],s=[1,13],o=[1,14],l={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:C(function(f,p,g,m,v,y,b){var x=y.length-1;switch(v){case 1:return y[x-1];case 2:this.$=[];break;case 3:y[x-1].push(y[x]),this.$=y[x-1];break;case 4:case 5:this.$=y[x];break;case 6:case 7:this.$=[];break;case 8:m.setDiagramTitle(y[x].substr(6)),this.$=y[x].substr(6);break;case 9:this.$=y[x].trim(),m.setAccTitle(this.$);break;case 10:case 11:this.$=y[x].trim(),m.setAccDescription(this.$);break;case 12:m.addSection(y[x].substr(8)),this.$=y[x].substr(8);break;case 13:m.addTask(y[x-1],y[x]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:C(function(f,p){if(p.recoverable)this.trace(f);else{var g=new Error(f);throw g.hash=p,g}},"parseError"),parse:C(function(f){var p=this,g=[0],m=[],v=[null],y=[],b=this.table,x="",w=0,A=0,S=2,T=1,O=y.slice.call(arguments,1),k=Object.create(this.lexer),E={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(E.yy[_]=this.yy[_]);k.setInput(f,E.yy),E.yy.lexer=k,E.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var I=k.yylloc;y.push(I);var L=k.options&&k.options.ranges;typeof E.yy.parseError=="function"?this.parseError=E.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function R(X){g.length=g.length-2*X,v.length=v.length-X,y.length=y.length-X}C(R,"popStack");function D(){var X;return X=m.pop()||k.lex()||T,typeof X!="number"&&(X instanceof Array&&(m=X,X=m.pop()),X=p.symbols_[X]||X),X}C(D,"lex");for(var M,P,N,F,B={},V,z,U,Q;;){if(P=g[g.length-1],this.defaultActions[P]?N=this.defaultActions[P]:((M===null||typeof M>"u")&&(M=D()),N=b[P]&&b[P][M]),typeof N>"u"||!N.length||!N[0]){var G="";Q=[];for(V in b[P])this.terminals_[V]&&V>S&&Q.push("'"+this.terminals_[V]+"'");k.showPosition?G="Parse error on line "+(w+1)+`: `+k.showPosition()+` -Expecting `+Q.join(", ")+", got '"+(this.terminals_[M]||M)+"'":G="Parse error on line "+(w+1)+": Unexpected "+(M==S?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(G,{text:k.match,token:this.terminals_[M]||M,line:k.yylineno,loc:I,expected:Q})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+M);switch(N[0]){case 1:g.push(M),v.push(k.yytext),y.push(k.yylloc),g.push(N[1]),M=null,A=k.yyleng,x=k.yytext,w=k.yylineno,I=k.yylloc;break;case 2:if(z=this.productions_[N[1]][1],B.$=v[v.length-z],B._$={first_line:y[y.length-(z||1)].first_line,last_line:y[y.length-1].last_line,first_column:y[y.length-(z||1)].first_column,last_column:y[y.length-1].last_column},L&&(B._$.range=[y[y.length-(z||1)].range[0],y[y.length-1].range[1]]),F=this.performAction.apply(B,[x,A,w,E.yy,N[1],v,y].concat(O)),typeof F<"u")return F;z&&(g=g.slice(0,-1*z*2),v=v.slice(0,-1*z),y=y.slice(0,-1*z)),g.push(this.productions_[N[1]][0]),v.push(B.$),y.push(B._$),U=b[g[g.length-2]][g[g.length-1]],g.push(U);break;case 3:return!0}}return!0},"parse")},u=function(){var d={EOF:1,parseError:C(function(p,g){if(this.yy.parser)this.yy.parser.parseError(p,g);else throw new Error(p)},"parseError"),setInput:C(function(f,p){return this.yy=p||this.yy||{},this._input=f,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var f=this._input[0];this.yytext+=f,this.yyleng++,this.offset++,this.match+=f,this.matched+=f;var p=f.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),f},"input"),unput:C(function(f){var p=f.length,g=f.split(/(?:\r\n?|\n)/g);this._input=f+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var v=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===m.length?this.yylloc.first_column:0)+m[m.length-g.length].length-g[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[v[0],v[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +Expecting `+Q.join(", ")+", got '"+(this.terminals_[M]||M)+"'":G="Parse error on line "+(w+1)+": Unexpected "+(M==T?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(G,{text:k.match,token:this.terminals_[M]||M,line:k.yylineno,loc:I,expected:Q})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+M);switch(N[0]){case 1:g.push(M),v.push(k.yytext),y.push(k.yylloc),g.push(N[1]),M=null,A=k.yyleng,x=k.yytext,w=k.yylineno,I=k.yylloc;break;case 2:if(z=this.productions_[N[1]][1],B.$=v[v.length-z],B._$={first_line:y[y.length-(z||1)].first_line,last_line:y[y.length-1].last_line,first_column:y[y.length-(z||1)].first_column,last_column:y[y.length-1].last_column},L&&(B._$.range=[y[y.length-(z||1)].range[0],y[y.length-1].range[1]]),F=this.performAction.apply(B,[x,A,w,E.yy,N[1],v,y].concat(O)),typeof F<"u")return F;z&&(g=g.slice(0,-1*z*2),v=v.slice(0,-1*z),y=y.slice(0,-1*z)),g.push(this.productions_[N[1]][0]),v.push(B.$),y.push(B._$),U=b[g[g.length-2]][g[g.length-1]],g.push(U);break;case 3:return!0}}return!0},"parse")},u=function(){var d={EOF:1,parseError:C(function(p,g){if(this.yy.parser)this.yy.parser.parseError(p,g);else throw new Error(p)},"parseError"),setInput:C(function(f,p){return this.yy=p||this.yy||{},this._input=f,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var f=this._input[0];this.yytext+=f,this.yyleng++,this.offset++,this.match+=f,this.matched+=f;var p=f.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),f},"input"),unput:C(function(f){var p=f.length,g=f.split(/(?:\r\n?|\n)/g);this._input=f+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var v=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===m.length?this.yylloc.first_column:0)+m[m.length-g.length].length-g[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[v[0],v[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:C(function(f){this.unput(this.match.slice(f))},"less"),pastInput:C(function(){var f=this.matched.substr(0,this.matched.length-this.match.length);return(f.length>20?"...":"")+f.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:C(function(){var f=this.match;return f.length<20&&(f+=this._input.substr(0,20-f.length)),(f.substr(0,20)+(f.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:C(function(){var f=this.pastInput(),p=new Array(f.length+1).join("-");return f+this.upcomingInput()+` `+p+"^"},"showPosition"),test_match:C(function(f,p){var g,m,v;if(this.options.backtrack_lexer&&(v={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(v.yylloc.range=this.yylloc.range.slice(0))),m=f[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+f[0].length},this.yytext+=f[0],this.match+=f[0],this.matches=f,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(f[0].length),this.matched+=f[0],g=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var y in v)this[y]=v[y];return!1}return!1},"test_match"),next:C(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var f,p,g,m;this._more||(this.yytext="",this.match="");for(var v=this._currentRules(),y=0;yp[0].length)){if(p=g,m=y,this.options.backtrack_lexer){if(f=this.test_match(g,v[y]),f!==!1)return f;if(this._backtrack){p=!1;continue}else return!1}else if(!this.options.flex)break}return p?(f=this.test_match(p,v[m]),f!==!1?f:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var p=this.next();return p||this.lex()},"lex"),begin:C(function(p){this.conditionStack.push(p)},"begin"),popState:C(function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:C(function(p){this.begin(p)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:C(function(p,g,m,v){switch(m){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return d}();l.lexer=u;function h(){this.yy={}}return C(h,"Parser"),h.prototype=l,l.Parser=h,new h}();eDe.parser=eDe;var MYn=eDe,ZR="",tDe=[],_z=[],Rz=[],IYn=C(function(){tDe.length=0,_z.length=0,ZR="",Rz.length=0,Aa()},"clear"),PYn=C(function(t){ZR=t,tDe.push(t)},"addSection"),NYn=C(function(){return tDe},"getSections"),BYn=C(function(){let t=Gqt();const e=100;let r=0;for(;!t&&r{r.people&&t.push(...r.people)}),[...new Set(t)].sort()},"updateActors"),FYn=C(function(t,e){const r=e.substr(1).split(":");let n=0,i=[];r.length===1?(n=Number(r[0]),i=[]):(n=Number(r[0]),i=r[1].split(","));const a=i.map(o=>o.trim()),s={section:ZR,type:ZR,people:a,task:t,score:n};Rz.push(s)},"addTask"),zYn=C(function(t){const e={section:ZR,type:ZR,description:t,task:t,classes:[]};_z.push(e)},"addTaskOrg"),Gqt=C(function(){const t=C(function(r){return Rz[r].processed},"compileTask");let e=!0;for(const[r,n]of Rz.entries())t(r),e=e&&n.processed;return e},"compileTasks"),UYn=C(function(){return $Yn()},"getActors"),Hqt={getConfig:C(()=>He().journey,"getConfig"),clear:IYn,setDiagramTitle:rs,getDiagramTitle:La,setAccTitle:Da,getAccTitle:Ja,setAccDescription:es,getAccDescription:ts,addSection:PYn,getSections:NYn,getTasks:BYn,addTask:FYn,addTaskOrg:zYn,getActors:UYn},VYn=C(t=>`.label { @@ -3012,12 +3012,12 @@ Expecting `+Q.join(", ")+", got '"+(this.terminals_[M]||M)+"'":G="Parse error on ${t.actor5?`fill: ${t.actor5}`:""}; } ${G9()} -`,"getStyles"),QYn=VYn,rDe=C(function(t,e){return Aee(t,e)},"drawRect"),GYn=C(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){const u=z5().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}C(a,"smile");function s(l){const u=z5().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}C(s,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return C(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),Wqt=C(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),Yqt=C(function(t,e){return mDn(t,e)},"drawText"),HYn=C(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}C(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,Yqt(t,e)},"drawLabel"),WYn=C(function(t,e,r){const n=t.append("g"),i=tf();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width*e.taskCount+r.diagramMarginX*(e.taskCount-1),i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,rDe(n,i),qqt(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),nDe=-1,YYn=C(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");nDe++;const s=300+5*30;a.append("line").attr("id",n+"-task"+nDe).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",s).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),GYn(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=tf();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,rDe(a,o);let l=e.x+14;e.people.forEach(u=>{const h=e.actors[u].color,d={cx:l,cy:e.y,r:7,fill:h,stroke:"#000",title:u,pos:e.actors[u].position};Wqt(a,d),l+=10}),qqt(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),qYn=C(function(t,e){O6t(t,e)},"drawBackgroundRect"),qqt=function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}C(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let v=0;v{const a=tb[i].color,s={cx:20,cy:n,r:7,fill:a,stroke:"#000",pos:tb[i].position};Dz.drawCircle(t,s);let o=t.append("text").attr("visibility","hidden").text(i);const l=o.node().getBoundingClientRect().width;o.remove();let u=[];if(l<=r)u=[i];else{const h=i.split(" ");let d="";o=t.append("text").attr("visibility","hidden"),h.forEach(f=>{const p=d?`${d} ${f}`:f;if(o.text(p),o.node().getBoundingClientRect().width>r){if(d&&u.push(d),d=f,o.text(f),o.node().getBoundingClientRect().width>r){let m="";for(const v of f)m+=v,o.text(m+"-"),o.node().getBoundingClientRect().width>r&&(u.push(m.slice(0,-1)+"-"),m=v);d=m}}else d=p}),d&&u.push(d),o.remove()}u.forEach((h,d)=>{const f={x:40,y:n+7+d*20,fill:"#666",text:h,textMargin:e.boxTextMargin??5},g=Dz.drawText(t,f).node().getBoundingClientRect().width;g>Nne&&g>e.leftMargin-g&&(Nne=g)}),n+=Math.max(20,u.length*20)})}C(jqt,"drawActorLegend");var Ng=He().journey,vw=0,KYn=C(function(t,e,r,n){const i=He(),a=i.journey.titleColor,s=i.journey.titleFontSize,o=i.journey.titleFontFamily,l=i.securityLevel;let u;l==="sandbox"&&(u=Ot("#i"+e));const h=Ot(l==="sandbox"?u.nodes()[0].contentDocument.body:"body");kp.init();const d=h.select("#"+e);Dz.initGraphics(d,e);const f=n.db.getTasks(),p=n.db.getDiagramTitle(),g=n.db.getActors();for(const w in tb)delete tb[w];let m=0;g.forEach(w=>{tb[w]={color:Ng.actorColours[m%Ng.actorColours.length],position:m},m++}),jqt(d),vw=Ng.leftMargin+Nne,kp.insert(0,0,vw,Object.keys(tb).length*50),ZYn(d,f,0,e);const v=kp.getBounds();p&&d.append("text").text(p).attr("x",vw).attr("font-size",s).attr("font-weight","bold").attr("y",25).attr("fill",a).attr("font-family",o);const y=v.stopy-v.starty+2*Ng.diagramMarginY,b=vw+v.stopx+2*Ng.diagramMarginX;zs(d,y,b,Ng.useMaxWidth),d.append("line").attr("x1",vw).attr("y1",Ng.height*4).attr("x2",b-vw-4).attr("y2",Ng.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+e+"-arrowhead)");const x=p?70:0;d.attr("viewBox",`${v.startx} -25 ${b} ${y+x}`),d.attr("preserveAspectRatio","xMinYMin meet"),d.attr("height",y+x+25)},"draw"),kp={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:C(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:C(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:C(function(t,e,r,n){const i=He().journey,a=this;let s=0;function o(l){return C(function(h){s++;const d=a.sequenceItems.length-s+1;a.updateVal(h,"starty",e-d*i.boxMargin,Math.min),a.updateVal(h,"stopy",n+d*i.boxMargin,Math.max),a.updateVal(kp.data,"startx",t-d*i.boxMargin,Math.min),a.updateVal(kp.data,"stopx",r+d*i.boxMargin,Math.max),l!=="activation"&&(a.updateVal(h,"startx",t-d*i.boxMargin,Math.min),a.updateVal(h,"stopx",r+d*i.boxMargin,Math.max),a.updateVal(kp.data,"starty",e-d*i.boxMargin,Math.min),a.updateVal(kp.data,"stopy",n+d*i.boxMargin,Math.max))},"updateItemBounds")}C(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:C(function(t,e,r,n){const i=Math.min(t,r),a=Math.max(t,r),s=Math.min(e,n),o=Math.max(e,n);this.updateVal(kp.data,"startx",i,Math.min),this.updateVal(kp.data,"starty",s,Math.min),this.updateVal(kp.data,"stopx",a,Math.max),this.updateVal(kp.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),bumpVerticalPos:C(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:C(function(){return this.verticalPos},"getVerticalPos"),getBounds:C(function(){return this.data},"getBounds")},iDe=Ng.sectionFills,Xqt=Ng.sectionColours,ZYn=C(function(t,e,r,n){const i=He().journey;let a="";const s=i.height*2+i.diagramMarginY,o=r+s;let l=0,u="#CCC",h="black",d=0;for(const[f,p]of e.entries()){if(a!==p.section){u=iDe[l%iDe.length],d=l%iDe.length,h=Xqt[l%Xqt.length];let m=0;const v=p.section;for(let b=f;b(tb[v]&&(m[v]=tb[v]),m),{});p.x=f*i.taskMargin+f*i.width+vw,p.y=o,p.width=i.diagramMarginX,p.height=i.diagramMarginY,p.colour=h,p.fill=u,p.num=d,p.actors=g,Dz.drawTask(t,p,i,n),kp.insert(p.x,p.y,p.x+p.width+i.taskMargin,300+5*30)}},"drawTasks"),Kqt={setConf:XYn,draw:KYn},JYn={parser:MYn,db:Hqt,renderer:Kqt,styles:QYn,init:C(t=>{Kqt.setConf(t.journey),Hqt.clear()},"init")};const eqn=Object.freeze(Object.defineProperty({__proto__:null,diagram:JYn},Symbol.toStringTag,{value:"Module"}));var aDe=function(){var t=C(function(f,p,g,m){for(g=g||{},m=f.length;m--;g[f[m]]=p);return g},"o"),e=[6,11,13,14,15,17,19,20,23,24],r=[1,12],n=[1,13],i=[1,14],a=[1,15],s=[1,16],o=[1,19],l=[1,20],u={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:C(function(p,g,m,v,y,b,x){var w=b.length-1;switch(y){case 1:return b[w-1];case 3:v.setDirection("LR");break;case 4:v.setDirection("TD");break;case 5:this.$=[];break;case 6:b[w-1].push(b[w]),this.$=b[w-1];break;case 7:case 8:this.$=b[w];break;case 9:case 10:this.$=[];break;case 11:v.getCommonDb().setDiagramTitle(b[w].substr(6)),this.$=b[w].substr(6);break;case 12:this.$=b[w].trim(),v.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=b[w].trim(),v.getCommonDb().setAccDescription(this.$);break;case 15:v.addSection(b[w].substr(8)),this.$=b[w].substr(8);break;case 18:v.addTask(b[w],0,""),this.$=b[w];break;case 19:v.addEvent(b[w].substr(2)),this.$=b[w];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},t(e,[2,5],{5:6}),t(e,[2,2]),t(e,[2,3]),t(e,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:r,15:n,17:i,19:a,20:s,21:17,22:18,23:o,24:l},t(e,[2,10],{1:[2,1]}),t(e,[2,6]),{12:21,14:r,15:n,17:i,19:a,20:s,21:17,22:18,23:o,24:l},t(e,[2,8]),t(e,[2,9]),t(e,[2,11]),{16:[1,22]},{18:[1,23]},t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,7]),t(e,[2,12]),t(e,[2,13])],defaultActions:{},parseError:C(function(p,g){if(g.recoverable)this.trace(p);else{var m=new Error(p);throw m.hash=g,m}},"parseError"),parse:C(function(p){var g=this,m=[0],v=[],y=[null],b=[],x=this.table,w="",A=0,T=0,S=2,O=1,k=b.slice.call(arguments,1),E=Object.create(this.lexer),_={yy:{}};for(var I in this.yy)Object.prototype.hasOwnProperty.call(this.yy,I)&&(_.yy[I]=this.yy[I]);E.setInput(p,_.yy),_.yy.lexer=E,_.yy.parser=this,typeof E.yylloc>"u"&&(E.yylloc={});var L=E.yylloc;b.push(L);var R=E.options&&E.options.ranges;typeof _.yy.parseError=="function"?this.parseError=_.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function D(Y){m.length=m.length-2*Y,y.length=y.length-Y,b.length=b.length-Y}C(D,"popStack");function M(){var Y;return Y=v.pop()||E.lex()||O,typeof Y!="number"&&(Y instanceof Array&&(v=Y,Y=v.pop()),Y=g.symbols_[Y]||Y),Y}C(M,"lex");for(var P,N,F,B,V={},z,U,Q,G;;){if(N=m[m.length-1],this.defaultActions[N]?F=this.defaultActions[N]:((P===null||typeof P>"u")&&(P=M()),F=x[N]&&x[N][P]),typeof F>"u"||!F.length||!F[0]){var X="";G=[];for(z in x[N])this.terminals_[z]&&z>S&&G.push("'"+this.terminals_[z]+"'");E.showPosition?X="Parse error on line "+(A+1)+`: +`,"getStyles"),QYn=VYn,rDe=C(function(t,e){return Aee(t,e)},"drawRect"),GYn=C(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){const u=z5().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}C(a,"smile");function s(l){const u=z5().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}C(s,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return C(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),Wqt=C(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),Yqt=C(function(t,e){return mDn(t,e)},"drawText"),HYn=C(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}C(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,Yqt(t,e)},"drawLabel"),WYn=C(function(t,e,r){const n=t.append("g"),i=tf();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width*e.taskCount+r.diagramMarginX*(e.taskCount-1),i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,rDe(n,i),qqt(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),nDe=-1,YYn=C(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");nDe++;const s=300+5*30;a.append("line").attr("id",n+"-task"+nDe).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",s).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),GYn(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=tf();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,rDe(a,o);let l=e.x+14;e.people.forEach(u=>{const h=e.actors[u].color,d={cx:l,cy:e.y,r:7,fill:h,stroke:"#000",title:u,pos:e.actors[u].position};Wqt(a,d),l+=10}),qqt(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),qYn=C(function(t,e){O6t(t,e)},"drawBackgroundRect"),qqt=function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}C(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let v=0;v{const a=tb[i].color,s={cx:20,cy:n,r:7,fill:a,stroke:"#000",pos:tb[i].position};Dz.drawCircle(t,s);let o=t.append("text").attr("visibility","hidden").text(i);const l=o.node().getBoundingClientRect().width;o.remove();let u=[];if(l<=r)u=[i];else{const h=i.split(" ");let d="";o=t.append("text").attr("visibility","hidden"),h.forEach(f=>{const p=d?`${d} ${f}`:f;if(o.text(p),o.node().getBoundingClientRect().width>r){if(d&&u.push(d),d=f,o.text(f),o.node().getBoundingClientRect().width>r){let m="";for(const v of f)m+=v,o.text(m+"-"),o.node().getBoundingClientRect().width>r&&(u.push(m.slice(0,-1)+"-"),m=v);d=m}}else d=p}),d&&u.push(d),o.remove()}u.forEach((h,d)=>{const f={x:40,y:n+7+d*20,fill:"#666",text:h,textMargin:e.boxTextMargin??5},g=Dz.drawText(t,f).node().getBoundingClientRect().width;g>Nne&&g>e.leftMargin-g&&(Nne=g)}),n+=Math.max(20,u.length*20)})}C(jqt,"drawActorLegend");var Ng=He().journey,vw=0,KYn=C(function(t,e,r,n){const i=He(),a=i.journey.titleColor,s=i.journey.titleFontSize,o=i.journey.titleFontFamily,l=i.securityLevel;let u;l==="sandbox"&&(u=Ot("#i"+e));const h=Ot(l==="sandbox"?u.nodes()[0].contentDocument.body:"body");kp.init();const d=h.select("#"+e);Dz.initGraphics(d,e);const f=n.db.getTasks(),p=n.db.getDiagramTitle(),g=n.db.getActors();for(const w in tb)delete tb[w];let m=0;g.forEach(w=>{tb[w]={color:Ng.actorColours[m%Ng.actorColours.length],position:m},m++}),jqt(d),vw=Ng.leftMargin+Nne,kp.insert(0,0,vw,Object.keys(tb).length*50),ZYn(d,f,0,e);const v=kp.getBounds();p&&d.append("text").text(p).attr("x",vw).attr("font-size",s).attr("font-weight","bold").attr("y",25).attr("fill",a).attr("font-family",o);const y=v.stopy-v.starty+2*Ng.diagramMarginY,b=vw+v.stopx+2*Ng.diagramMarginX;zs(d,y,b,Ng.useMaxWidth),d.append("line").attr("x1",vw).attr("y1",Ng.height*4).attr("x2",b-vw-4).attr("y2",Ng.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+e+"-arrowhead)");const x=p?70:0;d.attr("viewBox",`${v.startx} -25 ${b} ${y+x}`),d.attr("preserveAspectRatio","xMinYMin meet"),d.attr("height",y+x+25)},"draw"),kp={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:C(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:C(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:C(function(t,e,r,n){const i=He().journey,a=this;let s=0;function o(l){return C(function(h){s++;const d=a.sequenceItems.length-s+1;a.updateVal(h,"starty",e-d*i.boxMargin,Math.min),a.updateVal(h,"stopy",n+d*i.boxMargin,Math.max),a.updateVal(kp.data,"startx",t-d*i.boxMargin,Math.min),a.updateVal(kp.data,"stopx",r+d*i.boxMargin,Math.max),l!=="activation"&&(a.updateVal(h,"startx",t-d*i.boxMargin,Math.min),a.updateVal(h,"stopx",r+d*i.boxMargin,Math.max),a.updateVal(kp.data,"starty",e-d*i.boxMargin,Math.min),a.updateVal(kp.data,"stopy",n+d*i.boxMargin,Math.max))},"updateItemBounds")}C(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:C(function(t,e,r,n){const i=Math.min(t,r),a=Math.max(t,r),s=Math.min(e,n),o=Math.max(e,n);this.updateVal(kp.data,"startx",i,Math.min),this.updateVal(kp.data,"starty",s,Math.min),this.updateVal(kp.data,"stopx",a,Math.max),this.updateVal(kp.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),bumpVerticalPos:C(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:C(function(){return this.verticalPos},"getVerticalPos"),getBounds:C(function(){return this.data},"getBounds")},iDe=Ng.sectionFills,Xqt=Ng.sectionColours,ZYn=C(function(t,e,r,n){const i=He().journey;let a="";const s=i.height*2+i.diagramMarginY,o=r+s;let l=0,u="#CCC",h="black",d=0;for(const[f,p]of e.entries()){if(a!==p.section){u=iDe[l%iDe.length],d=l%iDe.length,h=Xqt[l%Xqt.length];let m=0;const v=p.section;for(let b=f;b(tb[v]&&(m[v]=tb[v]),m),{});p.x=f*i.taskMargin+f*i.width+vw,p.y=o,p.width=i.diagramMarginX,p.height=i.diagramMarginY,p.colour=h,p.fill=u,p.num=d,p.actors=g,Dz.drawTask(t,p,i,n),kp.insert(p.x,p.y,p.x+p.width+i.taskMargin,300+5*30)}},"drawTasks"),Kqt={setConf:XYn,draw:KYn},JYn={parser:MYn,db:Hqt,renderer:Kqt,styles:QYn,init:C(t=>{Kqt.setConf(t.journey),Hqt.clear()},"init")};const eqn=Object.freeze(Object.defineProperty({__proto__:null,diagram:JYn},Symbol.toStringTag,{value:"Module"}));var aDe=function(){var t=C(function(f,p,g,m){for(g=g||{},m=f.length;m--;g[f[m]]=p);return g},"o"),e=[6,11,13,14,15,17,19,20,23,24],r=[1,12],n=[1,13],i=[1,14],a=[1,15],s=[1,16],o=[1,19],l=[1,20],u={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:C(function(p,g,m,v,y,b,x){var w=b.length-1;switch(y){case 1:return b[w-1];case 3:v.setDirection("LR");break;case 4:v.setDirection("TD");break;case 5:this.$=[];break;case 6:b[w-1].push(b[w]),this.$=b[w-1];break;case 7:case 8:this.$=b[w];break;case 9:case 10:this.$=[];break;case 11:v.getCommonDb().setDiagramTitle(b[w].substr(6)),this.$=b[w].substr(6);break;case 12:this.$=b[w].trim(),v.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=b[w].trim(),v.getCommonDb().setAccDescription(this.$);break;case 15:v.addSection(b[w].substr(8)),this.$=b[w].substr(8);break;case 18:v.addTask(b[w],0,""),this.$=b[w];break;case 19:v.addEvent(b[w].substr(2)),this.$=b[w];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},t(e,[2,5],{5:6}),t(e,[2,2]),t(e,[2,3]),t(e,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:r,15:n,17:i,19:a,20:s,21:17,22:18,23:o,24:l},t(e,[2,10],{1:[2,1]}),t(e,[2,6]),{12:21,14:r,15:n,17:i,19:a,20:s,21:17,22:18,23:o,24:l},t(e,[2,8]),t(e,[2,9]),t(e,[2,11]),{16:[1,22]},{18:[1,23]},t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,7]),t(e,[2,12]),t(e,[2,13])],defaultActions:{},parseError:C(function(p,g){if(g.recoverable)this.trace(p);else{var m=new Error(p);throw m.hash=g,m}},"parseError"),parse:C(function(p){var g=this,m=[0],v=[],y=[null],b=[],x=this.table,w="",A=0,S=0,T=2,O=1,k=b.slice.call(arguments,1),E=Object.create(this.lexer),_={yy:{}};for(var I in this.yy)Object.prototype.hasOwnProperty.call(this.yy,I)&&(_.yy[I]=this.yy[I]);E.setInput(p,_.yy),_.yy.lexer=E,_.yy.parser=this,typeof E.yylloc>"u"&&(E.yylloc={});var L=E.yylloc;b.push(L);var R=E.options&&E.options.ranges;typeof _.yy.parseError=="function"?this.parseError=_.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function D(Y){m.length=m.length-2*Y,y.length=y.length-Y,b.length=b.length-Y}C(D,"popStack");function M(){var Y;return Y=v.pop()||E.lex()||O,typeof Y!="number"&&(Y instanceof Array&&(v=Y,Y=v.pop()),Y=g.symbols_[Y]||Y),Y}C(M,"lex");for(var P,N,F,B,V={},z,U,Q,G;;){if(N=m[m.length-1],this.defaultActions[N]?F=this.defaultActions[N]:((P===null||typeof P>"u")&&(P=M()),F=x[N]&&x[N][P]),typeof F>"u"||!F.length||!F[0]){var X="";G=[];for(z in x[N])this.terminals_[z]&&z>T&&G.push("'"+this.terminals_[z]+"'");E.showPosition?X="Parse error on line "+(A+1)+`: `+E.showPosition()+` -Expecting `+G.join(", ")+", got '"+(this.terminals_[P]||P)+"'":X="Parse error on line "+(A+1)+": Unexpected "+(P==O?"end of input":"'"+(this.terminals_[P]||P)+"'"),this.parseError(X,{text:E.match,token:this.terminals_[P]||P,line:E.yylineno,loc:L,expected:G})}if(F[0]instanceof Array&&F.length>1)throw new Error("Parse Error: multiple actions possible at state: "+N+", token: "+P);switch(F[0]){case 1:m.push(P),y.push(E.yytext),b.push(E.yylloc),m.push(F[1]),P=null,T=E.yyleng,w=E.yytext,A=E.yylineno,L=E.yylloc;break;case 2:if(U=this.productions_[F[1]][1],V.$=y[y.length-U],V._$={first_line:b[b.length-(U||1)].first_line,last_line:b[b.length-1].last_line,first_column:b[b.length-(U||1)].first_column,last_column:b[b.length-1].last_column},R&&(V._$.range=[b[b.length-(U||1)].range[0],b[b.length-1].range[1]]),B=this.performAction.apply(V,[w,T,A,_.yy,F[1],y,b].concat(k)),typeof B<"u")return B;U&&(m=m.slice(0,-1*U*2),y=y.slice(0,-1*U),b=b.slice(0,-1*U)),m.push(this.productions_[F[1]][0]),y.push(V.$),b.push(V._$),Q=x[m[m.length-2]][m[m.length-1]],m.push(Q);break;case 3:return!0}}return!0},"parse")},h=function(){var f={EOF:1,parseError:C(function(g,m){if(this.yy.parser)this.yy.parser.parseError(g,m);else throw new Error(g)},"parseError"),setInput:C(function(p,g){return this.yy=g||this.yy||{},this._input=p,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var p=this._input[0];this.yytext+=p,this.yyleng++,this.offset++,this.match+=p,this.matched+=p;var g=p.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),p},"input"),unput:C(function(p){var g=p.length,m=p.split(/(?:\r\n?|\n)/g);this._input=p+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var v=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),m.length-1&&(this.yylineno-=m.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:m?(m.length===v.length?this.yylloc.first_column:0)+v[v.length-m.length].length-m[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +Expecting `+G.join(", ")+", got '"+(this.terminals_[P]||P)+"'":X="Parse error on line "+(A+1)+": Unexpected "+(P==O?"end of input":"'"+(this.terminals_[P]||P)+"'"),this.parseError(X,{text:E.match,token:this.terminals_[P]||P,line:E.yylineno,loc:L,expected:G})}if(F[0]instanceof Array&&F.length>1)throw new Error("Parse Error: multiple actions possible at state: "+N+", token: "+P);switch(F[0]){case 1:m.push(P),y.push(E.yytext),b.push(E.yylloc),m.push(F[1]),P=null,S=E.yyleng,w=E.yytext,A=E.yylineno,L=E.yylloc;break;case 2:if(U=this.productions_[F[1]][1],V.$=y[y.length-U],V._$={first_line:b[b.length-(U||1)].first_line,last_line:b[b.length-1].last_line,first_column:b[b.length-(U||1)].first_column,last_column:b[b.length-1].last_column},R&&(V._$.range=[b[b.length-(U||1)].range[0],b[b.length-1].range[1]]),B=this.performAction.apply(V,[w,S,A,_.yy,F[1],y,b].concat(k)),typeof B<"u")return B;U&&(m=m.slice(0,-1*U*2),y=y.slice(0,-1*U),b=b.slice(0,-1*U)),m.push(this.productions_[F[1]][0]),y.push(V.$),b.push(V._$),Q=x[m[m.length-2]][m[m.length-1]],m.push(Q);break;case 3:return!0}}return!0},"parse")},h=function(){var f={EOF:1,parseError:C(function(g,m){if(this.yy.parser)this.yy.parser.parseError(g,m);else throw new Error(g)},"parseError"),setInput:C(function(p,g){return this.yy=g||this.yy||{},this._input=p,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var p=this._input[0];this.yytext+=p,this.yyleng++,this.offset++,this.match+=p,this.matched+=p;var g=p.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),p},"input"),unput:C(function(p){var g=p.length,m=p.split(/(?:\r\n?|\n)/g);this._input=p+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var v=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),m.length-1&&(this.yylineno-=m.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:m?(m.length===v.length?this.yylloc.first_column:0)+v[v.length-m.length].length-m[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:C(function(p){this.unput(this.match.slice(p))},"less"),pastInput:C(function(){var p=this.matched.substr(0,this.matched.length-this.match.length);return(p.length>20?"...":"")+p.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:C(function(){var p=this.match;return p.length<20&&(p+=this._input.substr(0,20-p.length)),(p.substr(0,20)+(p.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:C(function(){var p=this.pastInput(),g=new Array(p.length+1).join("-");return p+this.upcomingInput()+` `+g+"^"},"showPosition"),test_match:C(function(p,g){var m,v,y;if(this.options.backtrack_lexer&&(y={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(y.yylloc.range=this.yylloc.range.slice(0))),v=p[0].match(/(?:\r\n?|\n).*/g),v&&(this.yylineno+=v.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:v?v[v.length-1].length-v[v.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+p[0].length},this.yytext+=p[0],this.match+=p[0],this.matches=p,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(p[0].length),this.matched+=p[0],m=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),m)return m;if(this._backtrack){for(var b in y)this[b]=y[b];return!1}return!1},"test_match"),next:C(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var p,g,m,v;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),b=0;bg[0].length)){if(g=m,v=b,this.options.backtrack_lexer){if(p=this.test_match(m,y[b]),p!==!1)return p;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(p=this.test_match(g,y[v]),p!==!1?p:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var g=this.next();return g||this.lex()},"lex"),begin:C(function(g){this.conditionStack.push(g)},"begin"),popState:C(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:C(function(g){this.begin(g)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:C(function(g,m,v,y){switch(v){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return f}();u.lexer=h;function d(){this.yy={}}return C(d,"Parser"),d.prototype=u,u.Parser=d,new d}();aDe.parser=aDe;var tqn=aDe,Zqt={};wq(Zqt,{addEvent:()=>ljt,addSection:()=>ijt,addTask:()=>ojt,addTaskOrg:()=>cjt,clear:()=>tjt,default:()=>rqn,getCommonDb:()=>ejt,getDirection:()=>njt,getSections:()=>ajt,getTasks:()=>sjt,setDirection:()=>rjt});var JR="",Jqt=0,sDe="LR",oDe=[],Bne=[],eD=[],ejt=C(()=>pye,"getCommonDb"),tjt=C(function(){oDe.length=0,Bne.length=0,JR="",eD.length=0,sDe="LR",Aa()},"clear"),rjt=C(function(t){sDe=t},"setDirection"),njt=C(function(){return sDe},"getDirection"),ijt=C(function(t){JR=t,oDe.push(t)},"addSection"),ajt=C(function(){return oDe},"getSections"),sjt=C(function(){let t=ujt();const e=100;let r=0;for(;!t&&rr.id===Jqt-1).events.push(t)},"addEvent"),cjt=C(function(t){const e={section:JR,type:JR,description:t,task:t,classes:[]};Bne.push(e)},"addTaskOrg"),ujt=C(function(){const t=C(function(r){return eD[r].processed},"compileTask");let e=!0;for(const[r,n]of eD.entries())t(r),e=e&&n.processed;return e},"compileTasks"),rqn={clear:tjt,getCommonDb:ejt,getDirection:njt,setDirection:rjt,addSection:ijt,getSections:ajt,getTasks:sjt,addTask:ojt,addTaskOrg:cjt,addEvent:ljt},hjt=0,$ne=C(function(t,e){const r=t.append("rect");return r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),r.attr("rx",e.rx),r.attr("ry",e.ry),e.class!==void 0&&r.attr("class",e.class),r},"drawRect"),nqn=C(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){const u=z5().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}C(a,"smile");function s(l){const u=z5().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}C(s,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return C(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),iqn=C(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),djt=C(function(t,e){const r=e.text.replace(//gi," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class!==void 0&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),aqn=C(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}C(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,djt(t,e)},"drawLabel"),sqn=C(function(t,e,r){const n=t.append("g"),i=cDe();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width,i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,$ne(n,i),fjt(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),lDe=-1,oqn=C(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");lDe++;const s=300+5*30;a.append("line").attr("id",n+"-task"+lDe).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",s).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),nqn(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=cDe();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,$ne(a,o),fjt(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),lqn=C(function(t,e){$ne(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),cqn=C(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),cDe=C(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),fjt=function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}C(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let v=0;v)/).reverse(),i,a=[],s=1.1,o=r.attr("y"),l=parseFloat(r.attr("dy")),u=r.text(null).append("tspan").attr("x",0).attr("y",o).attr("dy",l+"em");for(let h=0;he||i==="
")&&(a.pop(),u.text(a.join(" ").trim()),i==="
"?a=[""]:a=[i],u=r.append("tspan").attr("x",0).attr("y",o).attr("dy",s+"em").text(i))})}C(uDe,"wrap");var hqn=C(function(t,e,r,n,i,a=!1){var y,b,x;const{theme:s,look:o}=n,l=s==null?void 0:s.includes("redux"),u=((y=n==null?void 0:n.themeVariables)==null?void 0:y.THEME_COLOR_LIMIT)??12,h=r%u-1,d=t.append("g");e.section=h,d.attr("class",(e.class?e.class+" ":"")+"timeline-node "+("section-"+h));const f=d.append("g"),p=d.append("g"),m=p.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(uDe,e.width).node().getBBox(),v=(b=n.fontSize)!=null&&b.replace?n.fontSize.replace("px",""):n.fontSize;if(e.height=m.height+v*1.1*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,p.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),l&&p.attr("transform",`translate(${e.width/2}, ${a?e.padding/2+3:e.padding})`),fqn(f,e,h,i,n),o==="neo"&&(d.attr("data-look","neo"),l)){const w=s.includes("dark"),A=((x=t.node())==null?void 0:x.ownerSVGElement)??t.node(),T=Ot(A),S=T.attr("id")??"",O=S?`${S}-drop-shadow`:"drop-shadow";if(T.select(`#${O}`).empty()){const k=T.select("defs");(k.empty()?T.append("defs"):k).append("filter").attr("id",O).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",w?"0.2":"0.06").attr("flood-color",w?"#FFFFFF":"#000000")}}return e},"drawNode"),dqn=C(function(t,e,r){var o;const n=t.append("g"),a=n.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(uDe,e.width).node().getBBox(),s=(o=r.fontSize)!=null&&o.replace?r.fontSize.replace("px",""):r.fontSize;return n.remove(),a.height+s*1.1*.5+e.padding},"getVirtualNodeHeight"),fqn=C(function(t,e,r,n,i){const{theme:a}=i,s=a!=null&&a.includes("redux")?0:5,o=5,l=s>0?`M0 ${e.height-o} v${-e.height+2*o} q0,-${s},${s},-${s} h${e.width-2*o} q${s},0,${s},${s} v${e.height-o} H0 Z`:`M0 ${e.height-o} v${-(e.height-o)} h${e.width} v${e.height} H0 Z`;t.append("path").attr("id",n+"-node-"+hjt++).attr("class","node-bkg node-"+e.type).attr("d",l),a!=null&&a.includes("redux")||t.append("line").attr("class","node-line-"+r).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},"defaultBkg"),ed={drawRect:$ne,drawCircle:iqn,drawSection:sqn,drawText:djt,drawLabel:aqn,drawTask:oqn,drawBackgroundRect:lqn,getTextObj:cqn,getNoteRect:cDe,initGraphics:uqn,drawNode:hqn,getVirtualNodeHeight:dqn},pqn=C(function(t,e,r,n){var D,M,P;const i=He(),{look:a,theme:s,themeVariables:o}=i,{useGradient:l,gradientStart:u,gradientStop:h}=o,d=((D=i.timeline)==null?void 0:D.leftMargin)??50;me.debug("timeline",n.db);const f=i.securityLevel;let p;f==="sandbox"&&(p=Ot("#i"+e));const m=Ot(f==="sandbox"?p.nodes()[0].contentDocument.body:"body").select("#"+e);m.append("g");const v=n.db.getTasks(),y=n.db.getCommonDb().getDiagramTitle();me.debug("task",v),ed.initGraphics(m,e);const b=n.db.getSections();me.debug("sections",b);let x=0,w=0,A=0,T=0,S=50+d,O=50;T=50;let k=0,E=!0;b.forEach(function(N){const F={number:k,descr:N,section:k,width:150,padding:20,maxHeight:x},B=ed.getVirtualNodeHeight(m,F,i);me.debug("sectionHeight before draw",B),x=Math.max(x,B+20)});let _=0,I=0;me.debug("tasks.length",v.length);for(const[N,F]of v.entries()){const B={number:N,descr:F,section:F.section,width:150,padding:20,maxHeight:w},V=ed.getVirtualNodeHeight(m,B,i);me.debug("taskHeight before draw",V),w=Math.max(w,V+20),_=Math.max(_,F.events.length);let z=0;for(const U of F.events){const Q={descr:U,section:F.section,number:F.section,width:150,padding:20,maxHeight:50};z+=ed.getVirtualNodeHeight(m,Q,i)}F.events.length>0&&(z+=(F.events.length-1)*10),I=Math.max(I,z)}me.debug("maxSectionHeight before draw",x),me.debug("maxTaskHeight before draw",w),b&&b.length>0?b.forEach(N=>{const F=v.filter(U=>U.section===N),B={number:k,descr:N,section:k,width:200*Math.max(F.length,1)-50,padding:20,maxHeight:x};me.debug("sectionNode",B);const V=m.append("g"),z=ed.drawNode(V,B,k,i,e);me.debug("sectionNode output",z),V.attr("transform",`translate(${S}, ${T})`),O+=x+50,F.length>0&&pjt(m,F,k,S,O,w,i,_,I,x,!1,e),S+=200*Math.max(F.length,1),O=T,k++}):(E=!1,pjt(m,v,k,S,O,w,i,_,I,x,!0,e));const L=m.node().getBBox();if(me.debug("bounds",L),y&&m.append("text").text(y).attr("x",a==="neo"?L.x*2+d:L.width/2-d).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),A=E?x+w+150:w+100,m.append("g").attr("class","lineWrapper").append("line").attr("x1",d).attr("y1",A).attr("x2",L.width+3*d).attr("y2",A).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${e}-arrowhead)`),a==="neo"&&l&&s!=="neutral"){const N=m.select("defs"),B=(N.empty()?m.append("defs"):N).append("linearGradient").attr("id",m.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");B.append("stop").attr("offset","0%").attr("stop-color",u).attr("stop-opacity",1),B.append("stop").attr("offset","100%").attr("stop-color",h).attr("stop-opacity",1)}E5(void 0,m,((M=i.timeline)==null?void 0:M.padding)??50,((P=i.timeline)==null?void 0:P.useMaxWidth)??!1)},"draw"),pjt=C(function(t,e,r,n,i,a,s,o,l,u,h,d){var f;for(const p of e){const g={descr:p.task,section:r,number:r,width:150,padding:20,maxHeight:a};me.debug("taskNode",g);const m=t.append("g").attr("class","taskWrapper"),y=ed.drawNode(m,g,r,s,d).height;if(me.debug("taskHeight after draw",y),m.attr("transform",`translate(${n}, ${i})`),a=Math.max(a,y),p.events){const b=t.append("g").attr("class","lineWrapper");let x=a;i+=100,x=x+gqn(t,p.events,r,n,i,s,d),i-=100,b.append("line").attr("x1",n+190/2).attr("y1",i+a).attr("x2",n+190/2).attr("y2",i+a+100+l+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${d}-arrowhead)`).attr("stroke-dasharray","5,5")}n=n+200,h&&!((f=s.timeline)!=null&&f.disableMulticolor)&&r++}i=i-10},"drawTasks"),gqn=C(function(t,e,r,n,i,a,s){let o=0;const l=i;i=i+100;for(const u of e){const h={descr:u,section:r,number:r,width:150,padding:20,maxHeight:50};me.debug("eventNode",h);const d=t.append("g").attr("class","eventWrapper"),p=ed.drawNode(d,h,r,a,s,!0).height;o=o+p,d.attr("transform",`translate(${n}, ${i})`),i=i+10+p}return i=l,o},"drawEvents"),mqn={setConf:C(()=>{},"setConf"),draw:pqn},Fne=200,rb=5,vqn=Fne+rb*2,hDe=Fne+100,yqn=hDe+rb*2,gjt=10,bqn=0,mjt=20,vjt=20,yjt=30,bjt=50,xqn=C(function(t,e,r,n){var D,M,P,N,F;const i=He(),a=((D=i.timeline)==null?void 0:D.leftMargin)??50;me.debug("timeline",n.db);const s=qc(e);s.append("g");const o=n.db.getTasks(),l=n.db.getCommonDb().getDiagramTitle();me.debug("task",o),ed.initGraphics(s);const u=n.db.getSections();me.debug("sections",u);let h=0,d=0;const f=50+a;let p=50;const g=p,m=f,v=vqn+vjt,y=yqn+bjt,b=m+v;let x=0;const w=u&&u.length>0,A=w?b:f+v,T=Math.max(50,v+y-rb*2);u.forEach(function(B){const V={number:x,descr:B,section:x,width:T,padding:rb,maxHeight:h},z=ed.getVirtualNodeHeight(s,V,i);me.debug("sectionHeight before draw",z),h=Math.max(h,z)});let S=0;me.debug("tasks.length",o.length);for(const[B,V]of o.entries()){const z={number:B,descr:V,section:V.section,width:Fne,padding:rb,maxHeight:d},U=ed.getVirtualNodeHeight(s,z,i);me.debug("taskHeight before draw",U),d=Math.max(d,U);let Q=0;for(const G of V.events){const X={descr:G,section:V.section,number:V.section,width:hDe,padding:rb,maxHeight:50};Q+=ed.getVirtualNodeHeight(s,X,i)}V.events.length>0&&(Q+=(V.events.length-1)*gjt),S=Math.max(S,Q)+bqn}me.debug("maxSectionHeight before draw",h),me.debug("maxTaskHeight before draw",d);const k=Math.max(d,S)+yjt;w?u.forEach(B=>{const V=o.filter(q=>q.section===B),z={number:x,descr:B,section:x,width:T,padding:rb,maxHeight:h};me.debug("sectionNode",z);const U=s.append("g"),Q=ed.drawNode(U,z,x,i);me.debug("sectionNode output",Q);const G=A-v;U.attr("transform",`translate(${G}, ${p})`);const X=p+Q.height+mjt;V.length>0&&xjt(s,V,x,A,X,d,i,k,!1);const Y=V.length,le=Q.height+mjt+k*Math.max(Y,1)-(Y>0?yjt*2:0);p+=le,x++}):xjt(s,o,x,A,p,d,i,k,!0);let E=(M=s.node())==null?void 0:M.getBBox();if(!E)throw new Error("bbox not found");if(me.debug("bounds",E),l){if(s.append("text").text(l).attr("x",E.width/2-a).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),E=(P=s.node())==null?void 0:P.getBBox(),!E)throw new Error("bbox not found");me.debug("bounds after title",E)}const[_]=By(i.fontSize),I=(_??16)*2,L=(_??16)*.5+20,R=s.append("g").attr("class","lineWrapper");R.append("line").attr("x1",A).attr("y1",g-I).attr("x2",A).attr("y2",E.y+E.height+L).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),R.lower(),E5(void 0,s,((N=i.timeline)==null?void 0:N.padding)??50,((F=i.timeline)==null?void 0:F.useMaxWidth)??!1)},"draw"),xjt=C(function(t,e,r,n,i,a,s,o,l){var u;for(const h of e){const d={descr:h.task,section:r,number:r,width:Fne,padding:rb,maxHeight:a};me.debug("taskNode",d);const f=t.append("g").attr("class","taskWrapper"),p=ed.drawNode(f,d,r,s),g=p.height;me.debug("taskHeight after draw",g);const m=n-vjt-p.width;if(f.attr("transform",`translate(${m}, ${i})`),a=Math.max(a,g),h.events&&h.events.length>0){const v=i,y=n+bjt;wqn(t,h.events,r,n,y,v,s)}i=i+o,l&&!((u=s.timeline)!=null&&u.disableMulticolor)&&r++}},"drawTasks"),wqn=C(function(t,e,r,n,i,a,s){let o=a;for(const l of e){const u={descr:l,section:r,number:r,width:hDe,padding:rb,maxHeight:0};me.debug("eventNode",u);const h=t.append("g").attr("class","eventWrapper"),f=ed.drawNode(h,u,r,s).height;h.attr("transform",`translate(${i}, ${o})`);const p=t.append("g").attr("class","lineWrapper"),g=o+f/2;p.append("line").attr("x1",n).attr("y1",g).attr("x2",i).attr("y2",g).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),o=o+f+gjt}return o-a},"drawEvents"),Aqn={setConf:C(()=>{},"setConf"),draw:xqn},Tqn=C(t=>{var o;const{theme:e}=Dr(),r=e==null?void 0:e.includes("dark"),n=e==null?void 0:e.includes("color"),i=((o=t.svgId)==null?void 0:o.replace(/^#/,""))??"",a=i?`url(#${i}-drop-shadow)`:t.dropShadow??"none";let s="";for(let l=0;l0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:C(function(g){this.begin(g)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:C(function(g,m,v,y){switch(v){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return f}();u.lexer=h;function d(){this.yy={}}return C(d,"Parser"),d.prototype=u,u.Parser=d,new d}();aDe.parser=aDe;var tqn=aDe,Zqt={};wq(Zqt,{addEvent:()=>ljt,addSection:()=>ijt,addTask:()=>ojt,addTaskOrg:()=>cjt,clear:()=>tjt,default:()=>rqn,getCommonDb:()=>ejt,getDirection:()=>njt,getSections:()=>ajt,getTasks:()=>sjt,setDirection:()=>rjt});var JR="",Jqt=0,sDe="LR",oDe=[],Bne=[],eD=[],ejt=C(()=>pye,"getCommonDb"),tjt=C(function(){oDe.length=0,Bne.length=0,JR="",eD.length=0,sDe="LR",Aa()},"clear"),rjt=C(function(t){sDe=t},"setDirection"),njt=C(function(){return sDe},"getDirection"),ijt=C(function(t){JR=t,oDe.push(t)},"addSection"),ajt=C(function(){return oDe},"getSections"),sjt=C(function(){let t=ujt();const e=100;let r=0;for(;!t&&rr.id===Jqt-1).events.push(t)},"addEvent"),cjt=C(function(t){const e={section:JR,type:JR,description:t,task:t,classes:[]};Bne.push(e)},"addTaskOrg"),ujt=C(function(){const t=C(function(r){return eD[r].processed},"compileTask");let e=!0;for(const[r,n]of eD.entries())t(r),e=e&&n.processed;return e},"compileTasks"),rqn={clear:tjt,getCommonDb:ejt,getDirection:njt,setDirection:rjt,addSection:ijt,getSections:ajt,getTasks:sjt,addTask:ojt,addTaskOrg:cjt,addEvent:ljt},hjt=0,$ne=C(function(t,e){const r=t.append("rect");return r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),r.attr("rx",e.rx),r.attr("ry",e.ry),e.class!==void 0&&r.attr("class",e.class),r},"drawRect"),nqn=C(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){const u=z5().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}C(a,"smile");function s(l){const u=z5().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}C(s,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return C(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),iqn=C(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),djt=C(function(t,e){const r=e.text.replace(//gi," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class!==void 0&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),aqn=C(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}C(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,djt(t,e)},"drawLabel"),sqn=C(function(t,e,r){const n=t.append("g"),i=cDe();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width,i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,$ne(n,i),fjt(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),lDe=-1,oqn=C(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");lDe++;const s=300+5*30;a.append("line").attr("id",n+"-task"+lDe).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",s).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),nqn(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=cDe();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,$ne(a,o),fjt(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),lqn=C(function(t,e){$ne(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),cqn=C(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),cDe=C(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),fjt=function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}C(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let v=0;v)/).reverse(),i,a=[],s=1.1,o=r.attr("y"),l=parseFloat(r.attr("dy")),u=r.text(null).append("tspan").attr("x",0).attr("y",o).attr("dy",l+"em");for(let h=0;he||i==="
")&&(a.pop(),u.text(a.join(" ").trim()),i==="
"?a=[""]:a=[i],u=r.append("tspan").attr("x",0).attr("y",o).attr("dy",s+"em").text(i))})}C(uDe,"wrap");var hqn=C(function(t,e,r,n,i,a=!1){var y,b,x;const{theme:s,look:o}=n,l=s==null?void 0:s.includes("redux"),u=((y=n==null?void 0:n.themeVariables)==null?void 0:y.THEME_COLOR_LIMIT)??12,h=r%u-1,d=t.append("g");e.section=h,d.attr("class",(e.class?e.class+" ":"")+"timeline-node "+("section-"+h));const f=d.append("g"),p=d.append("g"),m=p.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(uDe,e.width).node().getBBox(),v=(b=n.fontSize)!=null&&b.replace?n.fontSize.replace("px",""):n.fontSize;if(e.height=m.height+v*1.1*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,p.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),l&&p.attr("transform",`translate(${e.width/2}, ${a?e.padding/2+3:e.padding})`),fqn(f,e,h,i,n),o==="neo"&&(d.attr("data-look","neo"),l)){const w=s.includes("dark"),A=((x=t.node())==null?void 0:x.ownerSVGElement)??t.node(),S=Ot(A),T=S.attr("id")??"",O=T?`${T}-drop-shadow`:"drop-shadow";if(S.select(`#${O}`).empty()){const k=S.select("defs");(k.empty()?S.append("defs"):k).append("filter").attr("id",O).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",w?"0.2":"0.06").attr("flood-color",w?"#FFFFFF":"#000000")}}return e},"drawNode"),dqn=C(function(t,e,r){var o;const n=t.append("g"),a=n.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(uDe,e.width).node().getBBox(),s=(o=r.fontSize)!=null&&o.replace?r.fontSize.replace("px",""):r.fontSize;return n.remove(),a.height+s*1.1*.5+e.padding},"getVirtualNodeHeight"),fqn=C(function(t,e,r,n,i){const{theme:a}=i,s=a!=null&&a.includes("redux")?0:5,o=5,l=s>0?`M0 ${e.height-o} v${-e.height+2*o} q0,-${s},${s},-${s} h${e.width-2*o} q${s},0,${s},${s} v${e.height-o} H0 Z`:`M0 ${e.height-o} v${-(e.height-o)} h${e.width} v${e.height} H0 Z`;t.append("path").attr("id",n+"-node-"+hjt++).attr("class","node-bkg node-"+e.type).attr("d",l),a!=null&&a.includes("redux")||t.append("line").attr("class","node-line-"+r).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},"defaultBkg"),ed={drawRect:$ne,drawCircle:iqn,drawSection:sqn,drawText:djt,drawLabel:aqn,drawTask:oqn,drawBackgroundRect:lqn,getTextObj:cqn,getNoteRect:cDe,initGraphics:uqn,drawNode:hqn,getVirtualNodeHeight:dqn},pqn=C(function(t,e,r,n){var D,M,P;const i=He(),{look:a,theme:s,themeVariables:o}=i,{useGradient:l,gradientStart:u,gradientStop:h}=o,d=((D=i.timeline)==null?void 0:D.leftMargin)??50;me.debug("timeline",n.db);const f=i.securityLevel;let p;f==="sandbox"&&(p=Ot("#i"+e));const m=Ot(f==="sandbox"?p.nodes()[0].contentDocument.body:"body").select("#"+e);m.append("g");const v=n.db.getTasks(),y=n.db.getCommonDb().getDiagramTitle();me.debug("task",v),ed.initGraphics(m,e);const b=n.db.getSections();me.debug("sections",b);let x=0,w=0,A=0,S=0,T=50+d,O=50;S=50;let k=0,E=!0;b.forEach(function(N){const F={number:k,descr:N,section:k,width:150,padding:20,maxHeight:x},B=ed.getVirtualNodeHeight(m,F,i);me.debug("sectionHeight before draw",B),x=Math.max(x,B+20)});let _=0,I=0;me.debug("tasks.length",v.length);for(const[N,F]of v.entries()){const B={number:N,descr:F,section:F.section,width:150,padding:20,maxHeight:w},V=ed.getVirtualNodeHeight(m,B,i);me.debug("taskHeight before draw",V),w=Math.max(w,V+20),_=Math.max(_,F.events.length);let z=0;for(const U of F.events){const Q={descr:U,section:F.section,number:F.section,width:150,padding:20,maxHeight:50};z+=ed.getVirtualNodeHeight(m,Q,i)}F.events.length>0&&(z+=(F.events.length-1)*10),I=Math.max(I,z)}me.debug("maxSectionHeight before draw",x),me.debug("maxTaskHeight before draw",w),b&&b.length>0?b.forEach(N=>{const F=v.filter(U=>U.section===N),B={number:k,descr:N,section:k,width:200*Math.max(F.length,1)-50,padding:20,maxHeight:x};me.debug("sectionNode",B);const V=m.append("g"),z=ed.drawNode(V,B,k,i,e);me.debug("sectionNode output",z),V.attr("transform",`translate(${T}, ${S})`),O+=x+50,F.length>0&&pjt(m,F,k,T,O,w,i,_,I,x,!1,e),T+=200*Math.max(F.length,1),O=S,k++}):(E=!1,pjt(m,v,k,T,O,w,i,_,I,x,!0,e));const L=m.node().getBBox();if(me.debug("bounds",L),y&&m.append("text").text(y).attr("x",a==="neo"?L.x*2+d:L.width/2-d).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),A=E?x+w+150:w+100,m.append("g").attr("class","lineWrapper").append("line").attr("x1",d).attr("y1",A).attr("x2",L.width+3*d).attr("y2",A).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${e}-arrowhead)`),a==="neo"&&l&&s!=="neutral"){const N=m.select("defs"),B=(N.empty()?m.append("defs"):N).append("linearGradient").attr("id",m.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");B.append("stop").attr("offset","0%").attr("stop-color",u).attr("stop-opacity",1),B.append("stop").attr("offset","100%").attr("stop-color",h).attr("stop-opacity",1)}E5(void 0,m,((M=i.timeline)==null?void 0:M.padding)??50,((P=i.timeline)==null?void 0:P.useMaxWidth)??!1)},"draw"),pjt=C(function(t,e,r,n,i,a,s,o,l,u,h,d){var f;for(const p of e){const g={descr:p.task,section:r,number:r,width:150,padding:20,maxHeight:a};me.debug("taskNode",g);const m=t.append("g").attr("class","taskWrapper"),y=ed.drawNode(m,g,r,s,d).height;if(me.debug("taskHeight after draw",y),m.attr("transform",`translate(${n}, ${i})`),a=Math.max(a,y),p.events){const b=t.append("g").attr("class","lineWrapper");let x=a;i+=100,x=x+gqn(t,p.events,r,n,i,s,d),i-=100,b.append("line").attr("x1",n+190/2).attr("y1",i+a).attr("x2",n+190/2).attr("y2",i+a+100+l+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${d}-arrowhead)`).attr("stroke-dasharray","5,5")}n=n+200,h&&!((f=s.timeline)!=null&&f.disableMulticolor)&&r++}i=i-10},"drawTasks"),gqn=C(function(t,e,r,n,i,a,s){let o=0;const l=i;i=i+100;for(const u of e){const h={descr:u,section:r,number:r,width:150,padding:20,maxHeight:50};me.debug("eventNode",h);const d=t.append("g").attr("class","eventWrapper"),p=ed.drawNode(d,h,r,a,s,!0).height;o=o+p,d.attr("transform",`translate(${n}, ${i})`),i=i+10+p}return i=l,o},"drawEvents"),mqn={setConf:C(()=>{},"setConf"),draw:pqn},Fne=200,rb=5,vqn=Fne+rb*2,hDe=Fne+100,yqn=hDe+rb*2,gjt=10,bqn=0,mjt=20,vjt=20,yjt=30,bjt=50,xqn=C(function(t,e,r,n){var D,M,P,N,F;const i=He(),a=((D=i.timeline)==null?void 0:D.leftMargin)??50;me.debug("timeline",n.db);const s=qc(e);s.append("g");const o=n.db.getTasks(),l=n.db.getCommonDb().getDiagramTitle();me.debug("task",o),ed.initGraphics(s);const u=n.db.getSections();me.debug("sections",u);let h=0,d=0;const f=50+a;let p=50;const g=p,m=f,v=vqn+vjt,y=yqn+bjt,b=m+v;let x=0;const w=u&&u.length>0,A=w?b:f+v,S=Math.max(50,v+y-rb*2);u.forEach(function(B){const V={number:x,descr:B,section:x,width:S,padding:rb,maxHeight:h},z=ed.getVirtualNodeHeight(s,V,i);me.debug("sectionHeight before draw",z),h=Math.max(h,z)});let T=0;me.debug("tasks.length",o.length);for(const[B,V]of o.entries()){const z={number:B,descr:V,section:V.section,width:Fne,padding:rb,maxHeight:d},U=ed.getVirtualNodeHeight(s,z,i);me.debug("taskHeight before draw",U),d=Math.max(d,U);let Q=0;for(const G of V.events){const X={descr:G,section:V.section,number:V.section,width:hDe,padding:rb,maxHeight:50};Q+=ed.getVirtualNodeHeight(s,X,i)}V.events.length>0&&(Q+=(V.events.length-1)*gjt),T=Math.max(T,Q)+bqn}me.debug("maxSectionHeight before draw",h),me.debug("maxTaskHeight before draw",d);const k=Math.max(d,T)+yjt;w?u.forEach(B=>{const V=o.filter(q=>q.section===B),z={number:x,descr:B,section:x,width:S,padding:rb,maxHeight:h};me.debug("sectionNode",z);const U=s.append("g"),Q=ed.drawNode(U,z,x,i);me.debug("sectionNode output",Q);const G=A-v;U.attr("transform",`translate(${G}, ${p})`);const X=p+Q.height+mjt;V.length>0&&xjt(s,V,x,A,X,d,i,k,!1);const Y=V.length,le=Q.height+mjt+k*Math.max(Y,1)-(Y>0?yjt*2:0);p+=le,x++}):xjt(s,o,x,A,p,d,i,k,!0);let E=(M=s.node())==null?void 0:M.getBBox();if(!E)throw new Error("bbox not found");if(me.debug("bounds",E),l){if(s.append("text").text(l).attr("x",E.width/2-a).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),E=(P=s.node())==null?void 0:P.getBBox(),!E)throw new Error("bbox not found");me.debug("bounds after title",E)}const[_]=By(i.fontSize),I=(_??16)*2,L=(_??16)*.5+20,R=s.append("g").attr("class","lineWrapper");R.append("line").attr("x1",A).attr("y1",g-I).attr("x2",A).attr("y2",E.y+E.height+L).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),R.lower(),E5(void 0,s,((N=i.timeline)==null?void 0:N.padding)??50,((F=i.timeline)==null?void 0:F.useMaxWidth)??!1)},"draw"),xjt=C(function(t,e,r,n,i,a,s,o,l){var u;for(const h of e){const d={descr:h.task,section:r,number:r,width:Fne,padding:rb,maxHeight:a};me.debug("taskNode",d);const f=t.append("g").attr("class","taskWrapper"),p=ed.drawNode(f,d,r,s),g=p.height;me.debug("taskHeight after draw",g);const m=n-vjt-p.width;if(f.attr("transform",`translate(${m}, ${i})`),a=Math.max(a,g),h.events&&h.events.length>0){const v=i,y=n+bjt;wqn(t,h.events,r,n,y,v,s)}i=i+o,l&&!((u=s.timeline)!=null&&u.disableMulticolor)&&r++}},"drawTasks"),wqn=C(function(t,e,r,n,i,a,s){let o=a;for(const l of e){const u={descr:l,section:r,number:r,width:hDe,padding:rb,maxHeight:0};me.debug("eventNode",u);const h=t.append("g").attr("class","eventWrapper"),f=ed.drawNode(h,u,r,s).height;h.attr("transform",`translate(${i}, ${o})`);const p=t.append("g").attr("class","lineWrapper"),g=o+f/2;p.append("line").attr("x1",n).attr("y1",g).attr("x2",i).attr("y2",g).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),o=o+f+gjt}return o-a},"drawEvents"),Aqn={setConf:C(()=>{},"setConf"),draw:xqn},Sqn=C(t=>{var o;const{theme:e}=Dr(),r=e==null?void 0:e.includes("dark"),n=e==null?void 0:e.includes("color"),i=((o=t.svgId)==null?void 0:o.replace(/^#/,""))??"",a=i?`url(#${i}-drop-shadow)`:t.dropShadow??"none";let s="";for(let l=0;l{let e="";for(let r=0;r{let e="";for(let r=0;r{},"setConf"),draw:C((t,e,r,n)=>{var a,s;return(((s=(a=n==null?void 0:n.db)==null?void 0:a.getDirection)==null?void 0:s.call(a))??"LR")==="TD"?Aqn.draw(t,e,r,n):mqn.draw(t,e,r,n)},"draw")},Eqn={db:Zqt,renderer:kqn,parser:tqn,styles:Oqn};const _qn=Object.freeze(Object.defineProperty({__proto__:null,diagram:Eqn},Symbol.toStringTag,{value:"Module"})),Oc=[];for(let t=0;t<256;++t)Oc.push((t+256).toString(16).slice(1));function Rqn(t,e=0){return(Oc[t[e+0]]+Oc[t[e+1]]+Oc[t[e+2]]+Oc[t[e+3]]+"-"+Oc[t[e+4]]+Oc[t[e+5]]+"-"+Oc[t[e+6]]+Oc[t[e+7]]+"-"+Oc[t[e+8]]+Oc[t[e+9]]+"-"+Oc[t[e+10]]+Oc[t[e+11]]+Oc[t[e+12]]+Oc[t[e+13]]+Oc[t[e+14]]+Oc[t[e+15]]).toLowerCase()}const Dqn=new Uint8Array(16);function Lqn(){return crypto.getRandomValues(Dqn)}function Mqn(t,e,r){return crypto.randomUUID?crypto.randomUUID():Iqn(t)}function Iqn(t,e,r){var i;t=t||{};const n=t.random??((i=t.rng)==null?void 0:i.call(t))??Lqn();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Rqn(n)}var dDe=function(){var t=C(function(w,A,T,S){for(T=T||{},S=w.length;S--;T[w[S]]=A);return T},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,6,13,15,16,19,22],g=[1,33],m=[1,34],v=[1,6,7,11,13,15,16,19,22],y={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:C(function(A,T,S,O,k,E,_){var I=E.length-1;switch(k){case 6:case 7:return O;case 8:O.getLogger().trace("Stop NL ");break;case 9:O.getLogger().trace("Stop EOF ");break;case 11:O.getLogger().trace("Stop NL2 ");break;case 12:O.getLogger().trace("Stop EOF2 ");break;case 15:O.getLogger().info("Node: ",E[I].id),O.addNode(E[I-1].length,E[I].id,E[I].descr,E[I].type);break;case 16:O.getLogger().trace("Icon: ",E[I]),O.decorateNode({icon:E[I]});break;case 17:case 21:O.decorateNode({class:E[I]});break;case 18:O.getLogger().trace("SPACELIST");break;case 19:O.getLogger().trace("Node: ",E[I].id),O.addNode(0,E[I].id,E[I].descr,E[I].type);break;case 20:O.decorateNode({icon:E[I]});break;case 25:O.getLogger().trace("node found ..",E[I-2]),this.$={id:E[I-1],descr:E[I-1],type:O.getType(E[I-2],E[I])};break;case 26:this.$={id:E[I],descr:E[I],type:O.nodeType.DEFAULT};break;case 27:O.getLogger().trace("node found ..",E[I-3]),this.$={id:E[I-3],descr:E[I-1],type:O.getType(E[I-2],E[I])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},{6:r,9:22,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},{6:u,7:h,10:23,11:d},t(f,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:s,22:o}),t(f,[2,18]),t(f,[2,19]),t(f,[2,20]),t(f,[2,21]),t(f,[2,23]),t(f,[2,24]),t(f,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:h,10:32,11:d},{1:[2,7],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},t(p,[2,14],{7:g,11:m}),t(v,[2,8]),t(v,[2,9]),t(v,[2,10]),t(f,[2,15]),t(f,[2,16]),t(f,[2,17]),{20:[1,35]},{21:[1,36]},t(p,[2,13],{7:g,11:m}),t(v,[2,11]),t(v,[2,12]),{21:[1,37]},t(f,[2,25]),t(f,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:C(function(A,T){if(T.recoverable)this.trace(A);else{var S=new Error(A);throw S.hash=T,S}},"parseError"),parse:C(function(A){var T=this,S=[0],O=[],k=[null],E=[],_=this.table,I="",L=0,R=0,D=2,M=1,P=E.slice.call(arguments,1),N=Object.create(this.lexer),F={yy:{}};for(var B in this.yy)Object.prototype.hasOwnProperty.call(this.yy,B)&&(F.yy[B]=this.yy[B]);N.setInput(A,F.yy),F.yy.lexer=N,F.yy.parser=this,typeof N.yylloc>"u"&&(N.yylloc={});var V=N.yylloc;E.push(V);var z=N.options&&N.options.ranges;typeof F.yy.parseError=="function"?this.parseError=F.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function U(Ce){S.length=S.length-2*Ce,k.length=k.length-Ce,E.length=E.length-Ce}C(U,"popStack");function Q(){var Ce;return Ce=O.pop()||N.lex()||M,typeof Ce!="number"&&(Ce instanceof Array&&(O=Ce,Ce=O.pop()),Ce=T.symbols_[Ce]||Ce),Ce}C(Q,"lex");for(var G,X,Y,le,q={},Z,ee,re,ve;;){if(X=S[S.length-1],this.defaultActions[X]?Y=this.defaultActions[X]:((G===null||typeof G>"u")&&(G=Q()),Y=_[X]&&_[X][G]),typeof Y>"u"||!Y.length||!Y[0]){var ae="";ve=[];for(Z in _[X])this.terminals_[Z]&&Z>D&&ve.push("'"+this.terminals_[Z]+"'");N.showPosition?ae="Parse error on line "+(L+1)+`: +`},"getStyles"),Oqn=Cqn,kqn={setConf:C(()=>{},"setConf"),draw:C((t,e,r,n)=>{var a,s;return(((s=(a=n==null?void 0:n.db)==null?void 0:a.getDirection)==null?void 0:s.call(a))??"LR")==="TD"?Aqn.draw(t,e,r,n):mqn.draw(t,e,r,n)},"draw")},Eqn={db:Zqt,renderer:kqn,parser:tqn,styles:Oqn};const _qn=Object.freeze(Object.defineProperty({__proto__:null,diagram:Eqn},Symbol.toStringTag,{value:"Module"})),Oc=[];for(let t=0;t<256;++t)Oc.push((t+256).toString(16).slice(1));function Rqn(t,e=0){return(Oc[t[e+0]]+Oc[t[e+1]]+Oc[t[e+2]]+Oc[t[e+3]]+"-"+Oc[t[e+4]]+Oc[t[e+5]]+"-"+Oc[t[e+6]]+Oc[t[e+7]]+"-"+Oc[t[e+8]]+Oc[t[e+9]]+"-"+Oc[t[e+10]]+Oc[t[e+11]]+Oc[t[e+12]]+Oc[t[e+13]]+Oc[t[e+14]]+Oc[t[e+15]]).toLowerCase()}const Dqn=new Uint8Array(16);function Lqn(){return crypto.getRandomValues(Dqn)}function Mqn(t,e,r){return crypto.randomUUID?crypto.randomUUID():Iqn(t)}function Iqn(t,e,r){var i;t=t||{};const n=t.random??((i=t.rng)==null?void 0:i.call(t))??Lqn();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Rqn(n)}var dDe=function(){var t=C(function(w,A,S,T){for(S=S||{},T=w.length;T--;S[w[T]]=A);return S},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,6,13,15,16,19,22],g=[1,33],m=[1,34],v=[1,6,7,11,13,15,16,19,22],y={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:C(function(A,S,T,O,k,E,_){var I=E.length-1;switch(k){case 6:case 7:return O;case 8:O.getLogger().trace("Stop NL ");break;case 9:O.getLogger().trace("Stop EOF ");break;case 11:O.getLogger().trace("Stop NL2 ");break;case 12:O.getLogger().trace("Stop EOF2 ");break;case 15:O.getLogger().info("Node: ",E[I].id),O.addNode(E[I-1].length,E[I].id,E[I].descr,E[I].type);break;case 16:O.getLogger().trace("Icon: ",E[I]),O.decorateNode({icon:E[I]});break;case 17:case 21:O.decorateNode({class:E[I]});break;case 18:O.getLogger().trace("SPACELIST");break;case 19:O.getLogger().trace("Node: ",E[I].id),O.addNode(0,E[I].id,E[I].descr,E[I].type);break;case 20:O.decorateNode({icon:E[I]});break;case 25:O.getLogger().trace("node found ..",E[I-2]),this.$={id:E[I-1],descr:E[I-1],type:O.getType(E[I-2],E[I])};break;case 26:this.$={id:E[I],descr:E[I],type:O.nodeType.DEFAULT};break;case 27:O.getLogger().trace("node found ..",E[I-3]),this.$={id:E[I-3],descr:E[I-1],type:O.getType(E[I-2],E[I])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},{6:r,9:22,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},{6:u,7:h,10:23,11:d},t(f,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:s,22:o}),t(f,[2,18]),t(f,[2,19]),t(f,[2,20]),t(f,[2,21]),t(f,[2,23]),t(f,[2,24]),t(f,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:h,10:32,11:d},{1:[2,7],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},t(p,[2,14],{7:g,11:m}),t(v,[2,8]),t(v,[2,9]),t(v,[2,10]),t(f,[2,15]),t(f,[2,16]),t(f,[2,17]),{20:[1,35]},{21:[1,36]},t(p,[2,13],{7:g,11:m}),t(v,[2,11]),t(v,[2,12]),{21:[1,37]},t(f,[2,25]),t(f,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:C(function(A,S){if(S.recoverable)this.trace(A);else{var T=new Error(A);throw T.hash=S,T}},"parseError"),parse:C(function(A){var S=this,T=[0],O=[],k=[null],E=[],_=this.table,I="",L=0,R=0,D=2,M=1,P=E.slice.call(arguments,1),N=Object.create(this.lexer),F={yy:{}};for(var B in this.yy)Object.prototype.hasOwnProperty.call(this.yy,B)&&(F.yy[B]=this.yy[B]);N.setInput(A,F.yy),F.yy.lexer=N,F.yy.parser=this,typeof N.yylloc>"u"&&(N.yylloc={});var V=N.yylloc;E.push(V);var z=N.options&&N.options.ranges;typeof F.yy.parseError=="function"?this.parseError=F.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function U(Ce){T.length=T.length-2*Ce,k.length=k.length-Ce,E.length=E.length-Ce}C(U,"popStack");function Q(){var Ce;return Ce=O.pop()||N.lex()||M,typeof Ce!="number"&&(Ce instanceof Array&&(O=Ce,Ce=O.pop()),Ce=S.symbols_[Ce]||Ce),Ce}C(Q,"lex");for(var G,X,Y,le,q={},Z,ee,re,ve;;){if(X=T[T.length-1],this.defaultActions[X]?Y=this.defaultActions[X]:((G===null||typeof G>"u")&&(G=Q()),Y=_[X]&&_[X][G]),typeof Y>"u"||!Y.length||!Y[0]){var ae="";ve=[];for(Z in _[X])this.terminals_[Z]&&Z>D&&ve.push("'"+this.terminals_[Z]+"'");N.showPosition?ae="Parse error on line "+(L+1)+`: `+N.showPosition()+` -Expecting `+ve.join(", ")+", got '"+(this.terminals_[G]||G)+"'":ae="Parse error on line "+(L+1)+": Unexpected "+(G==M?"end of input":"'"+(this.terminals_[G]||G)+"'"),this.parseError(ae,{text:N.match,token:this.terminals_[G]||G,line:N.yylineno,loc:V,expected:ve})}if(Y[0]instanceof Array&&Y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+X+", token: "+G);switch(Y[0]){case 1:S.push(G),k.push(N.yytext),E.push(N.yylloc),S.push(Y[1]),G=null,R=N.yyleng,I=N.yytext,L=N.yylineno,V=N.yylloc;break;case 2:if(ee=this.productions_[Y[1]][1],q.$=k[k.length-ee],q._$={first_line:E[E.length-(ee||1)].first_line,last_line:E[E.length-1].last_line,first_column:E[E.length-(ee||1)].first_column,last_column:E[E.length-1].last_column},z&&(q._$.range=[E[E.length-(ee||1)].range[0],E[E.length-1].range[1]]),le=this.performAction.apply(q,[I,R,L,F.yy,Y[1],k,E].concat(P)),typeof le<"u")return le;ee&&(S=S.slice(0,-1*ee*2),k=k.slice(0,-1*ee),E=E.slice(0,-1*ee)),S.push(this.productions_[Y[1]][0]),k.push(q.$),E.push(q._$),re=_[S[S.length-2]][S[S.length-1]],S.push(re);break;case 3:return!0}}return!0},"parse")},b=function(){var w={EOF:1,parseError:C(function(T,S){if(this.yy.parser)this.yy.parser.parseError(T,S);else throw new Error(T)},"parseError"),setInput:C(function(A,T){return this.yy=T||this.yy||{},this._input=A,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var A=this._input[0];this.yytext+=A,this.yyleng++,this.offset++,this.match+=A,this.matched+=A;var T=A.match(/(?:\r\n?|\n).*/g);return T?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),A},"input"),unput:C(function(A){var T=A.length,S=A.split(/(?:\r\n?|\n)/g);this._input=A+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-T),this.offset-=T;var O=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),S.length-1&&(this.yylineno-=S.length-1);var k=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:S?(S.length===O.length?this.yylloc.first_column:0)+O[O.length-S.length].length-S[0].length:this.yylloc.first_column-T},this.options.ranges&&(this.yylloc.range=[k[0],k[0]+this.yyleng-T]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:C(function(A){this.unput(this.match.slice(A))},"less"),pastInput:C(function(){var A=this.matched.substr(0,this.matched.length-this.match.length);return(A.length>20?"...":"")+A.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:C(function(){var A=this.match;return A.length<20&&(A+=this._input.substr(0,20-A.length)),(A.substr(0,20)+(A.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:C(function(){var A=this.pastInput(),T=new Array(A.length+1).join("-");return A+this.upcomingInput()+` -`+T+"^"},"showPosition"),test_match:C(function(A,T){var S,O,k;if(this.options.backtrack_lexer&&(k={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(k.yylloc.range=this.yylloc.range.slice(0))),O=A[0].match(/(?:\r\n?|\n).*/g),O&&(this.yylineno+=O.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:O?O[O.length-1].length-O[O.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+A[0].length},this.yytext+=A[0],this.match+=A[0],this.matches=A,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(A[0].length),this.matched+=A[0],S=this.performAction.call(this,this.yy,this,T,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),S)return S;if(this._backtrack){for(var E in k)this[E]=k[E];return!1}return!1},"test_match"),next:C(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var A,T,S,O;this._more||(this.yytext="",this.match="");for(var k=this._currentRules(),E=0;ET[0].length)){if(T=S,O=E,this.options.backtrack_lexer){if(A=this.test_match(S,k[E]),A!==!1)return A;if(this._backtrack){T=!1;continue}else return!1}else if(!this.options.flex)break}return T?(A=this.test_match(T,k[O]),A!==!1?A:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var T=this.next();return T||this.lex()},"lex"),begin:C(function(T){this.conditionStack.push(T)},"begin"),popState:C(function(){var T=this.conditionStack.length-1;return T>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(T){return T=this.conditionStack.length-1-Math.abs(T||0),T>=0?this.conditionStack[T]:"INITIAL"},"topState"),pushState:C(function(T){this.begin(T)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:C(function(T,S,O,k){switch(O){case 0:return T.getLogger().trace("Found comment",S.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:T.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return T.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:T.getLogger().trace("end icon"),this.popState();break;case 10:return T.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return T.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return T.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return T.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:T.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return T.getLogger().trace("description:",S.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),T.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),T.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),T.getLogger().trace("node end ...",S.yytext),"NODE_DEND";case 30:return this.popState(),T.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),T.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),T.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),T.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),T.getLogger().trace("node end (("),"NODE_DEND";case 35:return T.getLogger().trace("Long description:",S.yytext),20;case 36:return T.getLogger().trace("Long description:",S.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return w}();y.lexer=b;function x(){this.yy={}}return C(x,"Parser"),x.prototype=y,y.Parser=x,new x}();dDe.parser=dDe;var Pqn=dDe,Nqn=12,nb={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Bqn=($I=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=nb,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let r=this.nodes.length-1;r>=0;r--)if(this.nodes[r].level0?this.nodes[0]:null}addNode(e,r,n,i){var h,d;me.info("addNode",e,r,n,i);let a=!1;this.nodes.length===0?(this.baseLevel=e,e=0,a=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,a=!1);const s=He();let o=((h=s.mindmap)==null?void 0:h.padding)??Xn.mindmap.padding;switch(i){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:o*=2;break}const l={id:this.count++,nodeId:ai(r,s),level:e,descr:ai(n,s),type:i,children:[],width:((d=s.mindmap)==null?void 0:d.maxNodeWidth)??Xn.mindmap.maxNodeWidth,padding:o,isRoot:a},u=this.getParent(e);if(u)u.children.push(l),this.nodes.push(l);else if(a)this.nodes.push(l);else throw new Error(`There can be only one root. No parent could be found for ("${l.descr}")`)}getType(e,r){switch(me.debug("In get type",e,r),e){case"[":return this.nodeType.RECT;case"(":return r===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,r){this.elements[e]=r}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;const r=He(),n=this.nodes[this.nodes.length-1];e.icon&&(n.icon=ai(e.icon,r)),e.class&&(n.class=ai(e.class,r))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,r){if(e.level===0?e.section=void 0:e.section=r,e.children)for(const[n,i]of e.children.entries()){const a=e.level===0?n%(Nqn-1):r;this.assignSections(i,a)}}flattenNodes(e,r){const n=He(),i=["mindmap-node"];e.isRoot===!0?i.push("section-root","section--1"):e.section!==void 0&&i.push(`section-${e.section}`),e.class&&i.push(e.class);const a=i.join(" "),s=C(l=>{var d;const h=(((d=n.theme)==null?void 0:d.toLowerCase())??"").includes("redux");switch(l){case nb.CIRCLE:return"mindmapCircle";case nb.RECT:return"rect";case nb.ROUNDED_RECT:return"rounded";case nb.CLOUD:return"cloud";case nb.BANG:return"bang";case nb.HEXAGON:return"hexagon";case nb.DEFAULT:return h?"rounded":"defaultMindmapNode";case nb.NO_BORDER:default:return"rect"}},"getShapeFromType"),o={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:s(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:a,cssStyles:[],look:n.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(r.push(o),e.children)for(const l of e.children)this.flattenNodes(l,r)}generateEdges(e,r){if(!e.children)return;const n=He();for(const i of e.children){let a="edge";i.section!==void 0&&(a+=` section-edge-${i.section}`);const s=e.level+1;a+=` edge-depth-${s}`;const o={id:`edge_${e.id}_${i.id}`,start:e.id.toString(),end:i.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:n.look,classes:a,depth:e.level,section:i.section};r.push(o),this.generateEdges(i,r)}}getData(){const e=this.getMindmap(),r=He(),i=ygt().layout!==void 0,a=r;if(i||(a.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:a};me.debug("getData: mindmapRoot",e,r),this.assignSections(e);const s=[],o=[];this.flattenNodes(e,s),this.generateEdges(e,o),me.debug(`getData: processed ${s.length} nodes and ${o.length} edges`);const l=new Map;for(const u of s)l.set(u.id,{shape:u.shape,width:u.width,height:u.height,padding:u.padding});return{nodes:s,edges:o,config:a,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(l),type:"mindmap",diagramId:"mindmap-"+Mqn()}}getLogger(){return me}},C($I,"MindmapDB"),$I),$qn=C(async(t,e,r,n)=>{var f,p;me.debug(`Rendering mindmap diagram +Expecting `+ve.join(", ")+", got '"+(this.terminals_[G]||G)+"'":ae="Parse error on line "+(L+1)+": Unexpected "+(G==M?"end of input":"'"+(this.terminals_[G]||G)+"'"),this.parseError(ae,{text:N.match,token:this.terminals_[G]||G,line:N.yylineno,loc:V,expected:ve})}if(Y[0]instanceof Array&&Y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+X+", token: "+G);switch(Y[0]){case 1:T.push(G),k.push(N.yytext),E.push(N.yylloc),T.push(Y[1]),G=null,R=N.yyleng,I=N.yytext,L=N.yylineno,V=N.yylloc;break;case 2:if(ee=this.productions_[Y[1]][1],q.$=k[k.length-ee],q._$={first_line:E[E.length-(ee||1)].first_line,last_line:E[E.length-1].last_line,first_column:E[E.length-(ee||1)].first_column,last_column:E[E.length-1].last_column},z&&(q._$.range=[E[E.length-(ee||1)].range[0],E[E.length-1].range[1]]),le=this.performAction.apply(q,[I,R,L,F.yy,Y[1],k,E].concat(P)),typeof le<"u")return le;ee&&(T=T.slice(0,-1*ee*2),k=k.slice(0,-1*ee),E=E.slice(0,-1*ee)),T.push(this.productions_[Y[1]][0]),k.push(q.$),E.push(q._$),re=_[T[T.length-2]][T[T.length-1]],T.push(re);break;case 3:return!0}}return!0},"parse")},b=function(){var w={EOF:1,parseError:C(function(S,T){if(this.yy.parser)this.yy.parser.parseError(S,T);else throw new Error(S)},"parseError"),setInput:C(function(A,S){return this.yy=S||this.yy||{},this._input=A,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var A=this._input[0];this.yytext+=A,this.yyleng++,this.offset++,this.match+=A,this.matched+=A;var S=A.match(/(?:\r\n?|\n).*/g);return S?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),A},"input"),unput:C(function(A){var S=A.length,T=A.split(/(?:\r\n?|\n)/g);this._input=A+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-S),this.offset-=S;var O=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),T.length-1&&(this.yylineno-=T.length-1);var k=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:T?(T.length===O.length?this.yylloc.first_column:0)+O[O.length-T.length].length-T[0].length:this.yylloc.first_column-S},this.options.ranges&&(this.yylloc.range=[k[0],k[0]+this.yyleng-S]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:C(function(A){this.unput(this.match.slice(A))},"less"),pastInput:C(function(){var A=this.matched.substr(0,this.matched.length-this.match.length);return(A.length>20?"...":"")+A.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:C(function(){var A=this.match;return A.length<20&&(A+=this._input.substr(0,20-A.length)),(A.substr(0,20)+(A.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:C(function(){var A=this.pastInput(),S=new Array(A.length+1).join("-");return A+this.upcomingInput()+` +`+S+"^"},"showPosition"),test_match:C(function(A,S){var T,O,k;if(this.options.backtrack_lexer&&(k={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(k.yylloc.range=this.yylloc.range.slice(0))),O=A[0].match(/(?:\r\n?|\n).*/g),O&&(this.yylineno+=O.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:O?O[O.length-1].length-O[O.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+A[0].length},this.yytext+=A[0],this.match+=A[0],this.matches=A,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(A[0].length),this.matched+=A[0],T=this.performAction.call(this,this.yy,this,S,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),T)return T;if(this._backtrack){for(var E in k)this[E]=k[E];return!1}return!1},"test_match"),next:C(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var A,S,T,O;this._more||(this.yytext="",this.match="");for(var k=this._currentRules(),E=0;ES[0].length)){if(S=T,O=E,this.options.backtrack_lexer){if(A=this.test_match(T,k[E]),A!==!1)return A;if(this._backtrack){S=!1;continue}else return!1}else if(!this.options.flex)break}return S?(A=this.test_match(S,k[O]),A!==!1?A:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var S=this.next();return S||this.lex()},"lex"),begin:C(function(S){this.conditionStack.push(S)},"begin"),popState:C(function(){var S=this.conditionStack.length-1;return S>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(S){return S=this.conditionStack.length-1-Math.abs(S||0),S>=0?this.conditionStack[S]:"INITIAL"},"topState"),pushState:C(function(S){this.begin(S)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:C(function(S,T,O,k){switch(O){case 0:return S.getLogger().trace("Found comment",T.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:S.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return S.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:S.getLogger().trace("end icon"),this.popState();break;case 10:return S.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return S.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return S.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return S.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:S.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return S.getLogger().trace("description:",T.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),S.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),S.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),S.getLogger().trace("node end ...",T.yytext),"NODE_DEND";case 30:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),S.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),S.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 35:return S.getLogger().trace("Long description:",T.yytext),20;case 36:return S.getLogger().trace("Long description:",T.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return w}();y.lexer=b;function x(){this.yy={}}return C(x,"Parser"),x.prototype=y,y.Parser=x,new x}();dDe.parser=dDe;var Pqn=dDe,Nqn=12,nb={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Bqn=($I=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=nb,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let r=this.nodes.length-1;r>=0;r--)if(this.nodes[r].level0?this.nodes[0]:null}addNode(e,r,n,i){var h,d;me.info("addNode",e,r,n,i);let a=!1;this.nodes.length===0?(this.baseLevel=e,e=0,a=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,a=!1);const s=He();let o=((h=s.mindmap)==null?void 0:h.padding)??Xn.mindmap.padding;switch(i){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:o*=2;break}const l={id:this.count++,nodeId:ai(r,s),level:e,descr:ai(n,s),type:i,children:[],width:((d=s.mindmap)==null?void 0:d.maxNodeWidth)??Xn.mindmap.maxNodeWidth,padding:o,isRoot:a},u=this.getParent(e);if(u)u.children.push(l),this.nodes.push(l);else if(a)this.nodes.push(l);else throw new Error(`There can be only one root. No parent could be found for ("${l.descr}")`)}getType(e,r){switch(me.debug("In get type",e,r),e){case"[":return this.nodeType.RECT;case"(":return r===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,r){this.elements[e]=r}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;const r=He(),n=this.nodes[this.nodes.length-1];e.icon&&(n.icon=ai(e.icon,r)),e.class&&(n.class=ai(e.class,r))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,r){if(e.level===0?e.section=void 0:e.section=r,e.children)for(const[n,i]of e.children.entries()){const a=e.level===0?n%(Nqn-1):r;this.assignSections(i,a)}}flattenNodes(e,r){const n=He(),i=["mindmap-node"];e.isRoot===!0?i.push("section-root","section--1"):e.section!==void 0&&i.push(`section-${e.section}`),e.class&&i.push(e.class);const a=i.join(" "),s=C(l=>{var d;const h=(((d=n.theme)==null?void 0:d.toLowerCase())??"").includes("redux");switch(l){case nb.CIRCLE:return"mindmapCircle";case nb.RECT:return"rect";case nb.ROUNDED_RECT:return"rounded";case nb.CLOUD:return"cloud";case nb.BANG:return"bang";case nb.HEXAGON:return"hexagon";case nb.DEFAULT:return h?"rounded":"defaultMindmapNode";case nb.NO_BORDER:default:return"rect"}},"getShapeFromType"),o={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:s(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:a,cssStyles:[],look:n.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(r.push(o),e.children)for(const l of e.children)this.flattenNodes(l,r)}generateEdges(e,r){if(!e.children)return;const n=He();for(const i of e.children){let a="edge";i.section!==void 0&&(a+=` section-edge-${i.section}`);const s=e.level+1;a+=` edge-depth-${s}`;const o={id:`edge_${e.id}_${i.id}`,start:e.id.toString(),end:i.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:n.look,classes:a,depth:e.level,section:i.section};r.push(o),this.generateEdges(i,r)}}getData(){const e=this.getMindmap(),r=He(),i=ygt().layout!==void 0,a=r;if(i||(a.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:a};me.debug("getData: mindmapRoot",e,r),this.assignSections(e);const s=[],o=[];this.flattenNodes(e,s),this.generateEdges(e,o),me.debug(`getData: processed ${s.length} nodes and ${o.length} edges`);const l=new Map;for(const u of s)l.set(u.id,{shape:u.shape,width:u.width,height:u.height,padding:u.padding});return{nodes:s,edges:o,config:a,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(l),type:"mindmap",diagramId:"mindmap-"+Mqn()}}getLogger(){return me}},C($I,"MindmapDB"),$I),$qn=C(async(t,e,r,n)=>{var f,p;me.debug(`Rendering mindmap diagram `+t);const i=n.db,a=i.getData(),s=z3(e,a.config.securityLevel);if(a.type=n.type,a.layoutAlgorithm=R7(a.config.layout,{fallback:"cose-bilkent"}),a.diagramId=e,!i.getMindmap())return;a.nodes.forEach(g=>{g.shape==="rounded"?(g.radius=15,g.taper=15,g.stroke="none",g.width=0,g.padding=15):g.shape==="circle"?g.padding=10:g.shape==="rect"?(g.width=0,g.padding=10):g.shape==="hexagon"&&(g.width=0,g.height=0)}),await e4(a,s);const{themeVariables:l}=Dr(),{useGradient:u,gradientStart:h,gradientStop:d}=l;if(u&&h&&d){const g=s.attr("id"),m=s.append("defs").append("linearGradient").attr("id",`${g}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");m.append("stop").attr("offset","0%").attr("stop-color",h).attr("stop-opacity",1),m.append("stop").attr("offset","100%").attr("stop-color",d).attr("stop-opacity",1)}IC(s,((f=a.config.mindmap)==null?void 0:f.padding)??Xn.mindmap.padding,"mindmapDiagram",((p=a.config.mindmap)==null?void 0:p.useMaxWidth)??Xn.mindmap.useMaxWidth)},"draw"),Fqn={draw:$qn},zqn=C(t=>{const{theme:e,look:r}=t;let n="";for(let i=0;i"u"&&(V.yylloc={});var Q=V.yylloc;L.push(Q);var G=V.options&&V.options.ranges;typeof z.yy.parseError=="function"?this.parseError=z.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function X(he){E.length=E.length-2*he,I.length=I.length-he,L.length=L.length-he}C(X,"popStack");function Y(){var he;return he=_.pop()||V.lex()||F,typeof he!="number"&&(he instanceof Array&&(_=he,he=_.pop()),he=k.symbols_[he]||he),he}C(Y,"lex");for(var le,q,Z,ee,re={},ve,ae,Ce,Oe;;){if(q=E[E.length-1],this.defaultActions[q]?Z=this.defaultActions[q]:((le===null||typeof le>"u")&&(le=Y()),Z=R[q]&&R[q][le]),typeof Z>"u"||!Z.length||!Z[0]){var $e="";Oe=[];for(ve in R[q])this.terminals_[ve]&&ve>N&&Oe.push("'"+this.terminals_[ve]+"'");V.showPosition?$e="Parse error on line "+(M+1)+`: +`},"getStyles"),Qqn=Vqn,Gqn={get db(){return new Bqn},renderer:Fqn,parser:Pqn,styles:Qqn};const Hqn=Object.freeze(Object.defineProperty({__proto__:null,diagram:Gqn},Symbol.toStringTag,{value:"Module"}));var fDe=function(){var t=C(function(T,O,k,E){for(k=k||{},E=T.length;E--;k[T[E]]=O);return k},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,31],g=[6,7,11,24],m=[1,6,13,16,17,20,23],v=[1,35],y=[1,36],b=[1,6,7,11,13,16,17,20,23],x=[1,38],w={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:C(function(O,k,E,_,I,L,R){var D=L.length-1;switch(I){case 6:case 7:return _;case 8:_.getLogger().trace("Stop NL ");break;case 9:_.getLogger().trace("Stop EOF ");break;case 11:_.getLogger().trace("Stop NL2 ");break;case 12:_.getLogger().trace("Stop EOF2 ");break;case 15:_.getLogger().info("Node: ",L[D-1].id),_.addNode(L[D-2].length,L[D-1].id,L[D-1].descr,L[D-1].type,L[D]);break;case 16:_.getLogger().info("Node: ",L[D].id),_.addNode(L[D-1].length,L[D].id,L[D].descr,L[D].type);break;case 17:_.getLogger().trace("Icon: ",L[D]),_.decorateNode({icon:L[D]});break;case 18:case 23:_.decorateNode({class:L[D]});break;case 19:_.getLogger().trace("SPACELIST");break;case 20:_.getLogger().trace("Node: ",L[D-1].id),_.addNode(0,L[D-1].id,L[D-1].descr,L[D-1].type,L[D]);break;case 21:_.getLogger().trace("Node: ",L[D].id),_.addNode(0,L[D].id,L[D].descr,L[D].type);break;case 22:_.decorateNode({icon:L[D]});break;case 27:_.getLogger().trace("node found ..",L[D-2]),this.$={id:L[D-1],descr:L[D-1],type:_.getType(L[D-2],L[D])};break;case 28:this.$={id:L[D],descr:L[D],type:0};break;case 29:_.getLogger().trace("node found ..",L[D-3]),this.$={id:L[D-3],descr:L[D-1],type:_.getType(L[D-2],L[D])};break;case 30:this.$=L[D-1]+L[D];break;case 31:this.$=L[D];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},{6:r,9:22,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},{6:u,7:h,10:23,11:d},t(f,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:s,23:o}),t(f,[2,19]),t(f,[2,21],{15:30,24:p}),t(f,[2,22]),t(f,[2,23]),t(g,[2,25]),t(g,[2,26]),t(g,[2,28],{20:[1,32]}),{21:[1,33]},{6:u,7:h,10:34,11:d},{1:[2,7],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},t(m,[2,14],{7:v,11:y}),t(b,[2,8]),t(b,[2,9]),t(b,[2,10]),t(f,[2,16],{15:37,24:p}),t(f,[2,17]),t(f,[2,18]),t(f,[2,20],{24:x}),t(g,[2,31]),{21:[1,39]},{22:[1,40]},t(m,[2,13],{7:v,11:y}),t(b,[2,11]),t(b,[2,12]),t(f,[2,15],{24:x}),t(g,[2,30]),{22:[1,41]},t(g,[2,27]),t(g,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:C(function(O,k){if(k.recoverable)this.trace(O);else{var E=new Error(O);throw E.hash=k,E}},"parseError"),parse:C(function(O){var k=this,E=[0],_=[],I=[null],L=[],R=this.table,D="",M=0,P=0,N=2,F=1,B=L.slice.call(arguments,1),V=Object.create(this.lexer),z={yy:{}};for(var U in this.yy)Object.prototype.hasOwnProperty.call(this.yy,U)&&(z.yy[U]=this.yy[U]);V.setInput(O,z.yy),z.yy.lexer=V,z.yy.parser=this,typeof V.yylloc>"u"&&(V.yylloc={});var Q=V.yylloc;L.push(Q);var G=V.options&&V.options.ranges;typeof z.yy.parseError=="function"?this.parseError=z.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function X(he){E.length=E.length-2*he,I.length=I.length-he,L.length=L.length-he}C(X,"popStack");function Y(){var he;return he=_.pop()||V.lex()||F,typeof he!="number"&&(he instanceof Array&&(_=he,he=_.pop()),he=k.symbols_[he]||he),he}C(Y,"lex");for(var le,q,Z,ee,re={},ve,ae,Ce,Oe;;){if(q=E[E.length-1],this.defaultActions[q]?Z=this.defaultActions[q]:((le===null||typeof le>"u")&&(le=Y()),Z=R[q]&&R[q][le]),typeof Z>"u"||!Z.length||!Z[0]){var $e="";Oe=[];for(ve in R[q])this.terminals_[ve]&&ve>N&&Oe.push("'"+this.terminals_[ve]+"'");V.showPosition?$e="Parse error on line "+(M+1)+`: `+V.showPosition()+` -Expecting `+Oe.join(", ")+", got '"+(this.terminals_[le]||le)+"'":$e="Parse error on line "+(M+1)+": Unexpected "+(le==F?"end of input":"'"+(this.terminals_[le]||le)+"'"),this.parseError($e,{text:V.match,token:this.terminals_[le]||le,line:V.yylineno,loc:Q,expected:Oe})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+le);switch(Z[0]){case 1:E.push(le),I.push(V.yytext),L.push(V.yylloc),E.push(Z[1]),le=null,P=V.yyleng,D=V.yytext,M=V.yylineno,Q=V.yylloc;break;case 2:if(ae=this.productions_[Z[1]][1],re.$=I[I.length-ae],re._$={first_line:L[L.length-(ae||1)].first_line,last_line:L[L.length-1].last_line,first_column:L[L.length-(ae||1)].first_column,last_column:L[L.length-1].last_column},G&&(re._$.range=[L[L.length-(ae||1)].range[0],L[L.length-1].range[1]]),ee=this.performAction.apply(re,[D,P,M,z.yy,Z[1],I,L].concat(B)),typeof ee<"u")return ee;ae&&(E=E.slice(0,-1*ae*2),I=I.slice(0,-1*ae),L=L.slice(0,-1*ae)),E.push(this.productions_[Z[1]][0]),I.push(re.$),L.push(re._$),Ce=R[E[E.length-2]][E[E.length-1]],E.push(Ce);break;case 3:return!0}}return!0},"parse")},A=function(){var S={EOF:1,parseError:C(function(k,E){if(this.yy.parser)this.yy.parser.parseError(k,E);else throw new Error(k)},"parseError"),setInput:C(function(O,k){return this.yy=k||this.yy||{},this._input=O,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var O=this._input[0];this.yytext+=O,this.yyleng++,this.offset++,this.match+=O,this.matched+=O;var k=O.match(/(?:\r\n?|\n).*/g);return k?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),O},"input"),unput:C(function(O){var k=O.length,E=O.split(/(?:\r\n?|\n)/g);this._input=O+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-k),this.offset-=k;var _=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),E.length-1&&(this.yylineno-=E.length-1);var I=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:E?(E.length===_.length?this.yylloc.first_column:0)+_[_.length-E.length].length-E[0].length:this.yylloc.first_column-k},this.options.ranges&&(this.yylloc.range=[I[0],I[0]+this.yyleng-k]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +Expecting `+Oe.join(", ")+", got '"+(this.terminals_[le]||le)+"'":$e="Parse error on line "+(M+1)+": Unexpected "+(le==F?"end of input":"'"+(this.terminals_[le]||le)+"'"),this.parseError($e,{text:V.match,token:this.terminals_[le]||le,line:V.yylineno,loc:Q,expected:Oe})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+le);switch(Z[0]){case 1:E.push(le),I.push(V.yytext),L.push(V.yylloc),E.push(Z[1]),le=null,P=V.yyleng,D=V.yytext,M=V.yylineno,Q=V.yylloc;break;case 2:if(ae=this.productions_[Z[1]][1],re.$=I[I.length-ae],re._$={first_line:L[L.length-(ae||1)].first_line,last_line:L[L.length-1].last_line,first_column:L[L.length-(ae||1)].first_column,last_column:L[L.length-1].last_column},G&&(re._$.range=[L[L.length-(ae||1)].range[0],L[L.length-1].range[1]]),ee=this.performAction.apply(re,[D,P,M,z.yy,Z[1],I,L].concat(B)),typeof ee<"u")return ee;ae&&(E=E.slice(0,-1*ae*2),I=I.slice(0,-1*ae),L=L.slice(0,-1*ae)),E.push(this.productions_[Z[1]][0]),I.push(re.$),L.push(re._$),Ce=R[E[E.length-2]][E[E.length-1]],E.push(Ce);break;case 3:return!0}}return!0},"parse")},A=function(){var T={EOF:1,parseError:C(function(k,E){if(this.yy.parser)this.yy.parser.parseError(k,E);else throw new Error(k)},"parseError"),setInput:C(function(O,k){return this.yy=k||this.yy||{},this._input=O,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var O=this._input[0];this.yytext+=O,this.yyleng++,this.offset++,this.match+=O,this.matched+=O;var k=O.match(/(?:\r\n?|\n).*/g);return k?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),O},"input"),unput:C(function(O){var k=O.length,E=O.split(/(?:\r\n?|\n)/g);this._input=O+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-k),this.offset-=k;var _=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),E.length-1&&(this.yylineno-=E.length-1);var I=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:E?(E.length===_.length?this.yylloc.first_column:0)+_[_.length-E.length].length-E[0].length:this.yylloc.first_column-k},this.options.ranges&&(this.yylloc.range=[I[0],I[0]+this.yyleng-k]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:C(function(O){this.unput(this.match.slice(O))},"less"),pastInput:C(function(){var O=this.matched.substr(0,this.matched.length-this.match.length);return(O.length>20?"...":"")+O.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:C(function(){var O=this.match;return O.length<20&&(O+=this._input.substr(0,20-O.length)),(O.substr(0,20)+(O.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:C(function(){var O=this.pastInput(),k=new Array(O.length+1).join("-");return O+this.upcomingInput()+` `+k+"^"},"showPosition"),test_match:C(function(O,k){var E,_,I;if(this.options.backtrack_lexer&&(I={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(I.yylloc.range=this.yylloc.range.slice(0))),_=O[0].match(/(?:\r\n?|\n).*/g),_&&(this.yylineno+=_.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:_?_[_.length-1].length-_[_.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+O[0].length},this.yytext+=O[0],this.match+=O[0],this.matches=O,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(O[0].length),this.matched+=O[0],E=this.performAction.call(this,this.yy,this,k,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),E)return E;if(this._backtrack){for(var L in I)this[L]=I[L];return!1}return!1},"test_match"),next:C(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var O,k,E,_;this._more||(this.yytext="",this.match="");for(var I=this._currentRules(),L=0;Lk[0].length)){if(k=E,_=L,this.options.backtrack_lexer){if(O=this.test_match(E,I[L]),O!==!1)return O;if(this._backtrack){k=!1;continue}else return!1}else if(!this.options.flex)break}return k?(O=this.test_match(k,I[_]),O!==!1?O:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var k=this.next();return k||this.lex()},"lex"),begin:C(function(k){this.conditionStack.push(k)},"begin"),popState:C(function(){var k=this.conditionStack.length-1;return k>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(k){return k=this.conditionStack.length-1-Math.abs(k||0),k>=0?this.conditionStack[k]:"INITIAL"},"topState"),pushState:C(function(k){this.begin(k)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:C(function(k,E,_,I){switch(_){case 0:return this.pushState("shapeData"),E.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const L=/\n\s*/g;return E.yytext=E.yytext.replace(L,"
"),24;case 4:return 24;case 5:this.popState();break;case 6:return k.getLogger().trace("Found comment",E.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:k.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return k.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:k.getLogger().trace("end icon"),this.popState();break;case 16:return k.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return k.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return k.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return k.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:return this.begin("NODE"),20;case 21:return this.begin("NODE"),20;case 22:return this.begin("NODE"),20;case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:k.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return k.getLogger().trace("description:",E.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),k.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),k.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),k.getLogger().trace("node end ...",E.yytext),"NODE_DEND";case 36:return this.popState(),k.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),k.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),k.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),k.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),k.getLogger().trace("node end (("),"NODE_DEND";case 41:return k.getLogger().trace("Long description:",E.yytext),21;case 42:return k.getLogger().trace("Long description:",E.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}};return S}();w.lexer=A;function T(){this.yy={}}return C(T,"Parser"),T.prototype=w,w.Parser=T,new T}();fDe.parser=fDe;var Wqn=fDe,Ep=[],pDe=[],gDe=0,mDe={},Yqn=C(()=>{Ep=[],pDe=[],gDe=0,mDe={}},"clear"),qqn=C(t=>{if(Ep.length===0)return null;const e=Ep[0].level;let r=null;for(let n=Ep.length-1;n>=0;n--)if(Ep[n].level===e&&!r&&(r=Ep[n]),Ep[n].levelo.parentId===i.id);for(const o of s){const l={id:o.id,parentId:i.id,label:ai(o.label??"",n),labelType:"markdown",isGroup:!1,ticket:o==null?void 0:o.ticket,priority:o==null?void 0:o.priority,assigned:o==null?void 0:o.assigned,icon:o==null?void 0:o.icon,shape:"kanbanItem",level:o.level,rx:5,ry:5,cssStyles:["text-align: left"]};e.push(l)}}return{nodes:e,edges:t,other:{},config:He()}},"getData"),Xqn=C((t,e,r,n,i)=>{var u,h;const a=He();let s=((u=a.mindmap)==null?void 0:u.padding)??Xn.mindmap.padding;switch(n){case cl.ROUNDED_RECT:case cl.RECT:case cl.HEXAGON:s*=2}const o={id:ai(e,a)||"kbn"+gDe++,level:t,label:ai(r,a),width:((h=a.mindmap)==null?void 0:h.maxNodeWidth)??Xn.mindmap.maxNodeWidth,padding:s,isGroup:!1};if(i!==void 0){let d;i.includes(` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var k=this.next();return k||this.lex()},"lex"),begin:C(function(k){this.conditionStack.push(k)},"begin"),popState:C(function(){var k=this.conditionStack.length-1;return k>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(k){return k=this.conditionStack.length-1-Math.abs(k||0),k>=0?this.conditionStack[k]:"INITIAL"},"topState"),pushState:C(function(k){this.begin(k)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:C(function(k,E,_,I){switch(_){case 0:return this.pushState("shapeData"),E.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const L=/\n\s*/g;return E.yytext=E.yytext.replace(L,"
"),24;case 4:return 24;case 5:this.popState();break;case 6:return k.getLogger().trace("Found comment",E.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:k.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return k.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:k.getLogger().trace("end icon"),this.popState();break;case 16:return k.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return k.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return k.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return k.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:return this.begin("NODE"),20;case 21:return this.begin("NODE"),20;case 22:return this.begin("NODE"),20;case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:k.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return k.getLogger().trace("description:",E.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),k.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),k.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),k.getLogger().trace("node end ...",E.yytext),"NODE_DEND";case 36:return this.popState(),k.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),k.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),k.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),k.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),k.getLogger().trace("node end (("),"NODE_DEND";case 41:return k.getLogger().trace("Long description:",E.yytext),21;case 42:return k.getLogger().trace("Long description:",E.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}};return T}();w.lexer=A;function S(){this.yy={}}return C(S,"Parser"),S.prototype=w,w.Parser=S,new S}();fDe.parser=fDe;var Wqn=fDe,Ep=[],pDe=[],gDe=0,mDe={},Yqn=C(()=>{Ep=[],pDe=[],gDe=0,mDe={}},"clear"),qqn=C(t=>{if(Ep.length===0)return null;const e=Ep[0].level;let r=null;for(let n=Ep.length-1;n>=0;n--)if(Ep[n].level===e&&!r&&(r=Ep[n]),Ep[n].levelo.parentId===i.id);for(const o of s){const l={id:o.id,parentId:i.id,label:ai(o.label??"",n),labelType:"markdown",isGroup:!1,ticket:o==null?void 0:o.ticket,priority:o==null?void 0:o.priority,assigned:o==null?void 0:o.assigned,icon:o==null?void 0:o.icon,shape:"kanbanItem",level:o.level,rx:5,ry:5,cssStyles:["text-align: left"]};e.push(l)}}return{nodes:e,edges:t,other:{},config:He()}},"getData"),Xqn=C((t,e,r,n,i)=>{var u,h;const a=He();let s=((u=a.mindmap)==null?void 0:u.padding)??Xn.mindmap.padding;switch(n){case cl.ROUNDED_RECT:case cl.RECT:case cl.HEXAGON:s*=2}const o={id:ai(e,a)||"kbn"+gDe++,level:t,label:ai(r,a),width:((h=a.mindmap)==null?void 0:h.maxNodeWidth)??Xn.mindmap.maxNodeWidth,padding:s,isGroup:!1};if(i!==void 0){let d;i.includes(` `)?d=i+` `:d=`{ `+i+` }`;const f=_j(d,{schema:Ej});if(f.shape&&(f.shape!==f.shape.toLowerCase()||f.shape.includes("_")))throw new Error(`No such shape: ${f.shape}. Shape names should be lowercase.`);f!=null&&f.shape&&f.shape==="kanbanItem"&&(o.shape=f==null?void 0:f.shape),f!=null&&f.label&&(o.label=f==null?void 0:f.label),f!=null&&f.icon&&(o.icon=f==null?void 0:f.icon.toString()),f!=null&&f.assigned&&(o.assigned=f==null?void 0:f.assigned.toString()),f!=null&&f.ticket&&(o.ticket=f==null?void 0:f.ticket.toString()),f!=null&&f.priority&&(o.priority=f==null?void 0:f.priority)}const l=qqn(t);l?o.parentId=l.id||"kbn"+gDe++:pDe.push(o),Ep.push(o)},"addNode"),cl={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Kqn=C((t,e)=>{switch(me.debug("In get type",t,e),t){case"[":return cl.RECT;case"(":return e===")"?cl.ROUNDED_RECT:cl.CLOUD;case"((":return cl.CIRCLE;case")":return cl.CLOUD;case"))":return cl.BANG;case"{{":return cl.HEXAGON;default:return cl.DEFAULT}},"getType"),Zqn=C((t,e)=>{mDe[t]=e},"setElementForId"),Jqn=C(t=>{if(!t)return;const e=He(),r=Ep[Ep.length-1];t.icon&&(r.icon=ai(t.icon,e)),t.class&&(r.cssClasses=ai(t.class,e))},"decorateNode"),ejn=C(t=>{switch(t){case cl.DEFAULT:return"no-border";case cl.RECT:return"rect";case cl.ROUNDED_RECT:return"rounded-rect";case cl.CIRCLE:return"circle";case cl.CLOUD:return"cloud";case cl.BANG:return"bang";case cl.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),tjn=C(()=>me,"getLogger"),rjn=C(t=>mDe[t],"getElementById"),njn={clear:Yqn,addNode:Xqn,getSections:wjt,getData:jqn,nodeType:cl,getType:Kqn,setElementForId:Zqn,decorateNode:Jqn,type2Str:ejn,getLogger:tjn,getElementById:rjn},ijn=njn,ajn=C(async(t,e,r,n)=>{var v,y,b,x,w;me.debug(`Rendering kanban diagram -`+t);const a=n.db.getData(),s=He();s.htmlLabels=!1;const o=qc(e);for(const A of a.nodes)A.domId=`${e}-${A.id}`;const l=o.append("g");l.attr("class","sections");const u=o.append("g");u.attr("class","items");const h=a.nodes.filter(A=>A.isGroup);let d=0;const f=10,p=[];let g=25;for(const A of h){const T=((v=s==null?void 0:s.kanban)==null?void 0:v.sectionWidth)||200;d=d+1,A.x=T*d+(d-1)*f/2,A.width=T,A.y=0,A.height=T*3,A.rx=5,A.ry=5,A.cssClasses=A.cssClasses+" section-"+d;const S=await tX(l,A);g=Math.max(g,(y=S==null?void 0:S.labelBBox)==null?void 0:y.height),p.push(S)}let m=0;for(const A of h){const T=p[m];m=m+1;const S=((b=s==null?void 0:s.kanban)==null?void 0:b.sectionWidth)||200,O=-S*3/2+g;let k=O;const E=a.nodes.filter(L=>L.parentId===A.id);for(const L of E){if(L.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");L.x=A.x,L.width=S-1.5*f;const D=(await S7(u,L,{config:s})).node().getBBox();L.y=k+D.height/2,await iX(L),k=L.y+D.height/2+f/2}const _=T.cluster.select("rect"),I=Math.max(k-O+3*f,50)+(g-25);_.attr("height",I)}E5(void 0,o,((x=s.mindmap)==null?void 0:x.padding)??Xn.kanban.padding,((w=s.mindmap)==null?void 0:w.useMaxWidth)??Xn.kanban.useMaxWidth)},"draw"),sjn={draw:ajn},ojn=C(t=>{let e="";for(let n=0;nt.darkMode?dt(n,i):ht(n,i),"adjuster");for(let n=0;nA.isGroup);let d=0;const f=10,p=[];let g=25;for(const A of h){const S=((v=s==null?void 0:s.kanban)==null?void 0:v.sectionWidth)||200;d=d+1,A.x=S*d+(d-1)*f/2,A.width=S,A.y=0,A.height=S*3,A.rx=5,A.ry=5,A.cssClasses=A.cssClasses+" section-"+d;const T=await tX(l,A);g=Math.max(g,(y=T==null?void 0:T.labelBBox)==null?void 0:y.height),p.push(T)}let m=0;for(const A of h){const S=p[m];m=m+1;const T=((b=s==null?void 0:s.kanban)==null?void 0:b.sectionWidth)||200,O=-T*3/2+g;let k=O;const E=a.nodes.filter(L=>L.parentId===A.id);for(const L of E){if(L.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");L.x=A.x,L.width=T-1.5*f;const D=(await T7(u,L,{config:s})).node().getBBox();L.y=k+D.height/2,await iX(L),k=L.y+D.height/2+f/2}const _=S.cluster.select("rect"),I=Math.max(k-O+3*f,50)+(g-25);_.attr("height",I)}E5(void 0,o,((x=s.mindmap)==null?void 0:x.padding)??Xn.kanban.padding,((w=s.mindmap)==null?void 0:w.useMaxWidth)??Xn.kanban.useMaxWidth)},"draw"),sjn={draw:ajn},ojn=C(t=>{let e="";for(let n=0;nt.darkMode?dt(n,i):ht(n,i),"adjuster");for(let n=0;n=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}function Tjt(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function vDe(t,e){let r=0;if(e===void 0)for(let n of t)(n=+n)&&(r+=n);else{let n=-1;for(let i of t)(i=+e(i,++n,t))&&(r+=i)}return r}function djn(t){return t.target.depth}function fjn(t){return t.depth}function pjn(t,e){return e-1-t.height}function Sjt(t,e){return t.sourceLinks.length?t.depth:e-1}function gjn(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?Tjt(t.sourceLinks,djn)-1:0}function zne(t){return function(){return t}}function Cjt(t,e){return Une(t.source,e.source)||t.index-e.index}function Ojt(t,e){return Une(t.target,e.target)||t.index-e.index}function Une(t,e){return t.y0-e.y0}function yDe(t){return t.value}function mjn(t){return t.index}function vjn(t){return t.nodes}function yjn(t){return t.links}function kjt(t,e){const r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function Ejt({nodes:t}){for(const e of t){let r=e.y0,n=r;for(const i of e.sourceLinks)i.y0=r+i.width/2,r+=i.width;for(const i of e.targetLinks)i.y1=n+i.width/2,n+=i.width}}function bjn(){let t=0,e=0,r=1,n=1,i=24,a=8,s,o=mjn,l=Sjt,u,h,d=vjn,f=yjn,p=6;function g(){const D={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return m(D),v(D),y(D),b(D),A(D),Ejt(D),D}g.update=function(D){return Ejt(D),D},g.nodeId=function(D){return arguments.length?(o=typeof D=="function"?D:zne(D),g):o},g.nodeAlign=function(D){return arguments.length?(l=typeof D=="function"?D:zne(D),g):l},g.nodeSort=function(D){return arguments.length?(u=D,g):u},g.nodeWidth=function(D){return arguments.length?(i=+D,g):i},g.nodePadding=function(D){return arguments.length?(a=s=+D,g):a},g.nodes=function(D){return arguments.length?(d=typeof D=="function"?D:zne(D),g):d},g.links=function(D){return arguments.length?(f=typeof D=="function"?D:zne(D),g):f},g.linkSort=function(D){return arguments.length?(h=D,g):h},g.size=function(D){return arguments.length?(t=e=0,r=+D[0],n=+D[1],g):[r-t,n-e]},g.extent=function(D){return arguments.length?(t=+D[0][0],r=+D[1][0],e=+D[0][1],n=+D[1][1],g):[[t,e],[r,n]]},g.iterations=function(D){return arguments.length?(p=+D,g):p};function m({nodes:D,links:M}){for(const[N,F]of D.entries())F.index=N,F.sourceLinks=[],F.targetLinks=[];const P=new Map(D.map((N,F)=>[o(N,F,D),N]));for(const[N,F]of M.entries()){F.index=N;let{source:B,target:V}=F;typeof B!="object"&&(B=F.source=kjt(P,B)),typeof V!="object"&&(V=F.target=kjt(P,V)),B.sourceLinks.push(F),V.targetLinks.push(F)}if(h!=null)for(const{sourceLinks:N,targetLinks:F}of D)N.sort(h),F.sort(h)}function v({nodes:D}){for(const M of D)M.value=M.fixedValue===void 0?Math.max(vDe(M.sourceLinks,yDe),vDe(M.targetLinks,yDe)):M.fixedValue}function y({nodes:D}){const M=D.length;let P=new Set(D),N=new Set,F=0;for(;P.size;){for(const B of P){B.depth=F;for(const{target:V}of B.sourceLinks)N.add(V)}if(++F>M)throw new Error("circular link");P=N,N=new Set}}function b({nodes:D}){const M=D.length;let P=new Set(D),N=new Set,F=0;for(;P.size;){for(const B of P){B.height=F;for(const{source:V}of B.targetLinks)N.add(V)}if(++F>M)throw new Error("circular link");P=N,N=new Set}}function x({nodes:D}){const M=Ajt(D,F=>F.depth)+1,P=(r-t-i)/(M-1),N=new Array(M);for(const F of D){const B=Math.max(0,Math.min(M-1,Math.floor(l.call(null,F,M))));F.layer=B,F.x0=t+B*P,F.x1=F.x0+i,N[B]?N[B].push(F):N[B]=[F]}if(u)for(const F of N)F.sort(u);return N}function w(D){const M=Tjt(D,P=>(n-e-(P.length-1)*s)/vDe(P,yDe));for(const P of D){let N=e;for(const F of P){F.y0=N,F.y1=N+F.value*M,N=F.y1+s;for(const B of F.sourceLinks)B.width=B.value*M}N=(n-N+s)/(P.length+1);for(let F=0;FP.length)-1)),w(M);for(let P=0;P0))continue;let Q=(z/U-V.y0)*M;V.y0+=Q,V.y1+=Q,_(V)}u===void 0&&B.sort(Une),O(B,P)}}function S(D,M,P){for(let N=D.length,F=N-2;F>=0;--F){const B=D[F];for(const V of B){let z=0,U=0;for(const{target:G,value:X}of V.sourceLinks){let Y=X*(G.layer-V.layer);z+=R(V,G)*Y,U+=Y}if(!(U>0))continue;let Q=(z/U-V.y0)*M;V.y0+=Q,V.y1+=Q,_(V)}u===void 0&&B.sort(Une),O(B,P)}}function O(D,M){const P=D.length>>1,N=D[P];E(D,N.y0-s,P-1,M),k(D,N.y1+s,P+1,M),E(D,n,D.length-1,M),k(D,e,0,M)}function k(D,M,P,N){for(;P1e-6&&(F.y0+=B,F.y1+=B),M=F.y1+s}}function E(D,M,P,N){for(;P>=0;--P){const F=D[P],B=(F.y1-M)*N;B>1e-6&&(F.y0-=B,F.y1-=B),M=F.y0-s}}function _({sourceLinks:D,targetLinks:M}){if(h===void 0){for(const{source:{sourceLinks:P}}of M)P.sort(Ojt);for(const{target:{targetLinks:P}}of D)P.sort(Cjt)}}function I(D){if(h===void 0)for(const{sourceLinks:M,targetLinks:P}of D)M.sort(Ojt),P.sort(Cjt)}function L(D,M){let P=D.y0-(D.sourceLinks.length-1)*s/2;for(const{target:N,width:F}of D.sourceLinks){if(N===M)break;P+=F+s}for(const{source:N,width:F}of M.targetLinks){if(N===D)break;P-=F}return P}function R(D,M){let P=M.y0-(M.targetLinks.length-1)*s/2;for(const{source:N,width:F}of M.targetLinks){if(N===D)break;P+=F+s}for(const{target:N,width:F}of D.sourceLinks){if(N===M)break;P-=F}return P}return g}var bDe=Math.PI,xDe=2*bDe,YO=1e-6,xjn=xDe-YO;function wDe(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function _jt(){return new wDe}wDe.prototype=_jt.prototype={constructor:wDe,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,r,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(t,e,r,n,i,a){this._+="C"+ +t+","+ +e+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(t,e,r,n,i){t=+t,e=+e,r=+r,n=+n,i=+i;var a=this._x1,s=this._y1,o=r-t,l=n-e,u=a-t,h=s-e,d=u*u+h*h;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(d>YO)if(!(Math.abs(h*o-l*u)>YO)||!i)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var f=r-a,p=n-s,g=o*o+l*l,m=f*f+p*p,v=Math.sqrt(g),y=Math.sqrt(d),b=i*Math.tan((bDe-Math.acos((g+d-m)/(2*v*y)))/2),x=b/y,w=b/v;Math.abs(x-1)>YO&&(this._+="L"+(t+x*u)+","+(e+x*h)),this._+="A"+i+","+i+",0,0,"+ +(h*f>u*p)+","+(this._x1=t+w*o)+","+(this._y1=e+w*l)}},arc:function(t,e,r,n,i,a){t=+t,e=+e,r=+r,a=!!a;var s=r*Math.cos(n),o=r*Math.sin(n),l=t+s,u=e+o,h=1^a,d=a?n-i:i-n;if(r<0)throw new Error("negative radius: "+r);this._x1===null?this._+="M"+l+","+u:(Math.abs(this._x1-l)>YO||Math.abs(this._y1-u)>YO)&&(this._+="L"+l+","+u),r&&(d<0&&(d=d%xDe+xDe),d>xjn?this._+="A"+r+","+r+",0,1,"+h+","+(t-s)+","+(e-o)+"A"+r+","+r+",0,1,"+h+","+(this._x1=l)+","+(this._y1=u):d>YO&&(this._+="A"+r+","+r+",0,"+ +(d>=bDe)+","+h+","+(this._x1=t+r*Math.cos(i))+","+(this._y1=e+r*Math.sin(i))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};function Rjt(t){return function(){return t}}function wjn(t){return t[0]}function Ajn(t){return t[1]}var Tjn=Array.prototype.slice;function Sjn(t){return t.source}function Cjn(t){return t.target}function Ojn(t){var e=Sjn,r=Cjn,n=wjn,i=Ajn,a=null;function s(){var o,l=Tjn.call(arguments),u=e.apply(this,l),h=r.apply(this,l);if(a||(a=o=_jt()),t(a,+n.apply(this,(l[0]=u,l)),+i.apply(this,l),+n.apply(this,(l[0]=h,l)),+i.apply(this,l)),o)return a=null,o+""||null}return s.source=function(o){return arguments.length?(e=o,s):e},s.target=function(o){return arguments.length?(r=o,s):r},s.x=function(o){return arguments.length?(n=typeof o=="function"?o:Rjt(+o),s):n},s.y=function(o){return arguments.length?(i=typeof o=="function"?o:Rjt(+o),s):i},s.context=function(o){return arguments.length?(a=o??null,s):a},s}function kjn(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function Ejn(){return Ojn(kjn)}function _jn(t){return[t.source.x1,t.y0]}function Rjn(t){return[t.target.x0,t.y1]}function Djn(){return Ejn().source(_jn).target(Rjn)}var ADe=function(){var t=C(function(o,l,u,h){for(u=u||{},h=o.length;h--;u[o[h]]=l);return u},"o"),e=[1,9],r=[1,10],n=[1,5,10,12],i={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:C(function(l,u,h,d,f,p,g){var m=p.length-1;switch(f){case 7:const v=d.findOrCreateNode(p[m-4].trim().replaceAll('""','"')),y=d.findOrCreateNode(p[m-2].trim().replaceAll('""','"')),b=parseFloat(p[m].trim());d.addLink(v,y,b);break;case 8:case 9:case 11:this.$=p[m];break;case 10:this.$=p[m-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(n,[2,8]),t(n,[2,9]),{19:[1,16]},t(n,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:r},{15:18,16:7,17:8,18:e,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(n,[2,10]),{15:21,16:7,17:8,18:e,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:C(function(l,u){if(u.recoverable)this.trace(l);else{var h=new Error(l);throw h.hash=u,h}},"parseError"),parse:C(function(l){var u=this,h=[0],d=[],f=[null],p=[],g=this.table,m="",v=0,y=0,b=2,x=1,w=p.slice.call(arguments,1),A=Object.create(this.lexer),T={yy:{}};for(var S in this.yy)Object.prototype.hasOwnProperty.call(this.yy,S)&&(T.yy[S]=this.yy[S]);A.setInput(l,T.yy),T.yy.lexer=A,T.yy.parser=this,typeof A.yylloc>"u"&&(A.yylloc={});var O=A.yylloc;p.push(O);var k=A.options&&A.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function E(z){h.length=h.length-2*z,f.length=f.length-z,p.length=p.length-z}C(E,"popStack");function _(){var z;return z=d.pop()||A.lex()||x,typeof z!="number"&&(z instanceof Array&&(d=z,z=d.pop()),z=u.symbols_[z]||z),z}C(_,"lex");for(var I,L,R,D,M={},P,N,F,B;;){if(L=h[h.length-1],this.defaultActions[L]?R=this.defaultActions[L]:((I===null||typeof I>"u")&&(I=_()),R=g[L]&&g[L][I]),typeof R>"u"||!R.length||!R[0]){var V="";B=[];for(P in g[L])this.terminals_[P]&&P>b&&B.push("'"+this.terminals_[P]+"'");A.showPosition?V="Parse error on line "+(v+1)+`: +`,"getStyles"),cjn=ljn,ujn={db:ijn,renderer:sjn,parser:Wqn,styles:cjn};const hjn=Object.freeze(Object.defineProperty({__proto__:null,diagram:ujn},Symbol.toStringTag,{value:"Module"}));function Ajt(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r=i)&&(r=i)}return r}function Sjt(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function vDe(t,e){let r=0;if(e===void 0)for(let n of t)(n=+n)&&(r+=n);else{let n=-1;for(let i of t)(i=+e(i,++n,t))&&(r+=i)}return r}function djn(t){return t.target.depth}function fjn(t){return t.depth}function pjn(t,e){return e-1-t.height}function Tjt(t,e){return t.sourceLinks.length?t.depth:e-1}function gjn(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?Sjt(t.sourceLinks,djn)-1:0}function zne(t){return function(){return t}}function Cjt(t,e){return Une(t.source,e.source)||t.index-e.index}function Ojt(t,e){return Une(t.target,e.target)||t.index-e.index}function Une(t,e){return t.y0-e.y0}function yDe(t){return t.value}function mjn(t){return t.index}function vjn(t){return t.nodes}function yjn(t){return t.links}function kjt(t,e){const r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function Ejt({nodes:t}){for(const e of t){let r=e.y0,n=r;for(const i of e.sourceLinks)i.y0=r+i.width/2,r+=i.width;for(const i of e.targetLinks)i.y1=n+i.width/2,n+=i.width}}function bjn(){let t=0,e=0,r=1,n=1,i=24,a=8,s,o=mjn,l=Tjt,u,h,d=vjn,f=yjn,p=6;function g(){const D={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return m(D),v(D),y(D),b(D),A(D),Ejt(D),D}g.update=function(D){return Ejt(D),D},g.nodeId=function(D){return arguments.length?(o=typeof D=="function"?D:zne(D),g):o},g.nodeAlign=function(D){return arguments.length?(l=typeof D=="function"?D:zne(D),g):l},g.nodeSort=function(D){return arguments.length?(u=D,g):u},g.nodeWidth=function(D){return arguments.length?(i=+D,g):i},g.nodePadding=function(D){return arguments.length?(a=s=+D,g):a},g.nodes=function(D){return arguments.length?(d=typeof D=="function"?D:zne(D),g):d},g.links=function(D){return arguments.length?(f=typeof D=="function"?D:zne(D),g):f},g.linkSort=function(D){return arguments.length?(h=D,g):h},g.size=function(D){return arguments.length?(t=e=0,r=+D[0],n=+D[1],g):[r-t,n-e]},g.extent=function(D){return arguments.length?(t=+D[0][0],r=+D[1][0],e=+D[0][1],n=+D[1][1],g):[[t,e],[r,n]]},g.iterations=function(D){return arguments.length?(p=+D,g):p};function m({nodes:D,links:M}){for(const[N,F]of D.entries())F.index=N,F.sourceLinks=[],F.targetLinks=[];const P=new Map(D.map((N,F)=>[o(N,F,D),N]));for(const[N,F]of M.entries()){F.index=N;let{source:B,target:V}=F;typeof B!="object"&&(B=F.source=kjt(P,B)),typeof V!="object"&&(V=F.target=kjt(P,V)),B.sourceLinks.push(F),V.targetLinks.push(F)}if(h!=null)for(const{sourceLinks:N,targetLinks:F}of D)N.sort(h),F.sort(h)}function v({nodes:D}){for(const M of D)M.value=M.fixedValue===void 0?Math.max(vDe(M.sourceLinks,yDe),vDe(M.targetLinks,yDe)):M.fixedValue}function y({nodes:D}){const M=D.length;let P=new Set(D),N=new Set,F=0;for(;P.size;){for(const B of P){B.depth=F;for(const{target:V}of B.sourceLinks)N.add(V)}if(++F>M)throw new Error("circular link");P=N,N=new Set}}function b({nodes:D}){const M=D.length;let P=new Set(D),N=new Set,F=0;for(;P.size;){for(const B of P){B.height=F;for(const{source:V}of B.targetLinks)N.add(V)}if(++F>M)throw new Error("circular link");P=N,N=new Set}}function x({nodes:D}){const M=Ajt(D,F=>F.depth)+1,P=(r-t-i)/(M-1),N=new Array(M);for(const F of D){const B=Math.max(0,Math.min(M-1,Math.floor(l.call(null,F,M))));F.layer=B,F.x0=t+B*P,F.x1=F.x0+i,N[B]?N[B].push(F):N[B]=[F]}if(u)for(const F of N)F.sort(u);return N}function w(D){const M=Sjt(D,P=>(n-e-(P.length-1)*s)/vDe(P,yDe));for(const P of D){let N=e;for(const F of P){F.y0=N,F.y1=N+F.value*M,N=F.y1+s;for(const B of F.sourceLinks)B.width=B.value*M}N=(n-N+s)/(P.length+1);for(let F=0;FP.length)-1)),w(M);for(let P=0;P0))continue;let Q=(z/U-V.y0)*M;V.y0+=Q,V.y1+=Q,_(V)}u===void 0&&B.sort(Une),O(B,P)}}function T(D,M,P){for(let N=D.length,F=N-2;F>=0;--F){const B=D[F];for(const V of B){let z=0,U=0;for(const{target:G,value:X}of V.sourceLinks){let Y=X*(G.layer-V.layer);z+=R(V,G)*Y,U+=Y}if(!(U>0))continue;let Q=(z/U-V.y0)*M;V.y0+=Q,V.y1+=Q,_(V)}u===void 0&&B.sort(Une),O(B,P)}}function O(D,M){const P=D.length>>1,N=D[P];E(D,N.y0-s,P-1,M),k(D,N.y1+s,P+1,M),E(D,n,D.length-1,M),k(D,e,0,M)}function k(D,M,P,N){for(;P1e-6&&(F.y0+=B,F.y1+=B),M=F.y1+s}}function E(D,M,P,N){for(;P>=0;--P){const F=D[P],B=(F.y1-M)*N;B>1e-6&&(F.y0-=B,F.y1-=B),M=F.y0-s}}function _({sourceLinks:D,targetLinks:M}){if(h===void 0){for(const{source:{sourceLinks:P}}of M)P.sort(Ojt);for(const{target:{targetLinks:P}}of D)P.sort(Cjt)}}function I(D){if(h===void 0)for(const{sourceLinks:M,targetLinks:P}of D)M.sort(Ojt),P.sort(Cjt)}function L(D,M){let P=D.y0-(D.sourceLinks.length-1)*s/2;for(const{target:N,width:F}of D.sourceLinks){if(N===M)break;P+=F+s}for(const{source:N,width:F}of M.targetLinks){if(N===D)break;P-=F}return P}function R(D,M){let P=M.y0-(M.targetLinks.length-1)*s/2;for(const{source:N,width:F}of M.targetLinks){if(N===D)break;P+=F+s}for(const{target:N,width:F}of D.sourceLinks){if(N===M)break;P-=F}return P}return g}var bDe=Math.PI,xDe=2*bDe,YO=1e-6,xjn=xDe-YO;function wDe(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function _jt(){return new wDe}wDe.prototype=_jt.prototype={constructor:wDe,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,r,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(t,e,r,n,i,a){this._+="C"+ +t+","+ +e+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(t,e,r,n,i){t=+t,e=+e,r=+r,n=+n,i=+i;var a=this._x1,s=this._y1,o=r-t,l=n-e,u=a-t,h=s-e,d=u*u+h*h;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(d>YO)if(!(Math.abs(h*o-l*u)>YO)||!i)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var f=r-a,p=n-s,g=o*o+l*l,m=f*f+p*p,v=Math.sqrt(g),y=Math.sqrt(d),b=i*Math.tan((bDe-Math.acos((g+d-m)/(2*v*y)))/2),x=b/y,w=b/v;Math.abs(x-1)>YO&&(this._+="L"+(t+x*u)+","+(e+x*h)),this._+="A"+i+","+i+",0,0,"+ +(h*f>u*p)+","+(this._x1=t+w*o)+","+(this._y1=e+w*l)}},arc:function(t,e,r,n,i,a){t=+t,e=+e,r=+r,a=!!a;var s=r*Math.cos(n),o=r*Math.sin(n),l=t+s,u=e+o,h=1^a,d=a?n-i:i-n;if(r<0)throw new Error("negative radius: "+r);this._x1===null?this._+="M"+l+","+u:(Math.abs(this._x1-l)>YO||Math.abs(this._y1-u)>YO)&&(this._+="L"+l+","+u),r&&(d<0&&(d=d%xDe+xDe),d>xjn?this._+="A"+r+","+r+",0,1,"+h+","+(t-s)+","+(e-o)+"A"+r+","+r+",0,1,"+h+","+(this._x1=l)+","+(this._y1=u):d>YO&&(this._+="A"+r+","+r+",0,"+ +(d>=bDe)+","+h+","+(this._x1=t+r*Math.cos(i))+","+(this._y1=e+r*Math.sin(i))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};function Rjt(t){return function(){return t}}function wjn(t){return t[0]}function Ajn(t){return t[1]}var Sjn=Array.prototype.slice;function Tjn(t){return t.source}function Cjn(t){return t.target}function Ojn(t){var e=Tjn,r=Cjn,n=wjn,i=Ajn,a=null;function s(){var o,l=Sjn.call(arguments),u=e.apply(this,l),h=r.apply(this,l);if(a||(a=o=_jt()),t(a,+n.apply(this,(l[0]=u,l)),+i.apply(this,l),+n.apply(this,(l[0]=h,l)),+i.apply(this,l)),o)return a=null,o+""||null}return s.source=function(o){return arguments.length?(e=o,s):e},s.target=function(o){return arguments.length?(r=o,s):r},s.x=function(o){return arguments.length?(n=typeof o=="function"?o:Rjt(+o),s):n},s.y=function(o){return arguments.length?(i=typeof o=="function"?o:Rjt(+o),s):i},s.context=function(o){return arguments.length?(a=o??null,s):a},s}function kjn(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function Ejn(){return Ojn(kjn)}function _jn(t){return[t.source.x1,t.y0]}function Rjn(t){return[t.target.x0,t.y1]}function Djn(){return Ejn().source(_jn).target(Rjn)}var ADe=function(){var t=C(function(o,l,u,h){for(u=u||{},h=o.length;h--;u[o[h]]=l);return u},"o"),e=[1,9],r=[1,10],n=[1,5,10,12],i={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:C(function(l,u,h,d,f,p,g){var m=p.length-1;switch(f){case 7:const v=d.findOrCreateNode(p[m-4].trim().replaceAll('""','"')),y=d.findOrCreateNode(p[m-2].trim().replaceAll('""','"')),b=parseFloat(p[m].trim());d.addLink(v,y,b);break;case 8:case 9:case 11:this.$=p[m];break;case 10:this.$=p[m-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(n,[2,8]),t(n,[2,9]),{19:[1,16]},t(n,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:r},{15:18,16:7,17:8,18:e,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(n,[2,10]),{15:21,16:7,17:8,18:e,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:C(function(l,u){if(u.recoverable)this.trace(l);else{var h=new Error(l);throw h.hash=u,h}},"parseError"),parse:C(function(l){var u=this,h=[0],d=[],f=[null],p=[],g=this.table,m="",v=0,y=0,b=2,x=1,w=p.slice.call(arguments,1),A=Object.create(this.lexer),S={yy:{}};for(var T in this.yy)Object.prototype.hasOwnProperty.call(this.yy,T)&&(S.yy[T]=this.yy[T]);A.setInput(l,S.yy),S.yy.lexer=A,S.yy.parser=this,typeof A.yylloc>"u"&&(A.yylloc={});var O=A.yylloc;p.push(O);var k=A.options&&A.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function E(z){h.length=h.length-2*z,f.length=f.length-z,p.length=p.length-z}C(E,"popStack");function _(){var z;return z=d.pop()||A.lex()||x,typeof z!="number"&&(z instanceof Array&&(d=z,z=d.pop()),z=u.symbols_[z]||z),z}C(_,"lex");for(var I,L,R,D,M={},P,N,F,B;;){if(L=h[h.length-1],this.defaultActions[L]?R=this.defaultActions[L]:((I===null||typeof I>"u")&&(I=_()),R=g[L]&&g[L][I]),typeof R>"u"||!R.length||!R[0]){var V="";B=[];for(P in g[L])this.terminals_[P]&&P>b&&B.push("'"+this.terminals_[P]+"'");A.showPosition?V="Parse error on line "+(v+1)+`: `+A.showPosition()+` -Expecting `+B.join(", ")+", got '"+(this.terminals_[I]||I)+"'":V="Parse error on line "+(v+1)+": Unexpected "+(I==x?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(V,{text:A.match,token:this.terminals_[I]||I,line:A.yylineno,loc:O,expected:B})}if(R[0]instanceof Array&&R.length>1)throw new Error("Parse Error: multiple actions possible at state: "+L+", token: "+I);switch(R[0]){case 1:h.push(I),f.push(A.yytext),p.push(A.yylloc),h.push(R[1]),I=null,y=A.yyleng,m=A.yytext,v=A.yylineno,O=A.yylloc;break;case 2:if(N=this.productions_[R[1]][1],M.$=f[f.length-N],M._$={first_line:p[p.length-(N||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-(N||1)].first_column,last_column:p[p.length-1].last_column},k&&(M._$.range=[p[p.length-(N||1)].range[0],p[p.length-1].range[1]]),D=this.performAction.apply(M,[m,y,v,T.yy,R[1],f,p].concat(w)),typeof D<"u")return D;N&&(h=h.slice(0,-1*N*2),f=f.slice(0,-1*N),p=p.slice(0,-1*N)),h.push(this.productions_[R[1]][0]),f.push(M.$),p.push(M._$),F=g[h[h.length-2]][h[h.length-1]],h.push(F);break;case 3:return!0}}return!0},"parse")},a=function(){var o={EOF:1,parseError:C(function(u,h){if(this.yy.parser)this.yy.parser.parseError(u,h);else throw new Error(u)},"parseError"),setInput:C(function(l,u){return this.yy=u||this.yy||{},this._input=l,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var u=l.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),l},"input"),unput:C(function(l){var u=l.length,h=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===d.length?this.yylloc.first_column:0)+d[d.length-h.length].length-h[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +Expecting `+B.join(", ")+", got '"+(this.terminals_[I]||I)+"'":V="Parse error on line "+(v+1)+": Unexpected "+(I==x?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(V,{text:A.match,token:this.terminals_[I]||I,line:A.yylineno,loc:O,expected:B})}if(R[0]instanceof Array&&R.length>1)throw new Error("Parse Error: multiple actions possible at state: "+L+", token: "+I);switch(R[0]){case 1:h.push(I),f.push(A.yytext),p.push(A.yylloc),h.push(R[1]),I=null,y=A.yyleng,m=A.yytext,v=A.yylineno,O=A.yylloc;break;case 2:if(N=this.productions_[R[1]][1],M.$=f[f.length-N],M._$={first_line:p[p.length-(N||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-(N||1)].first_column,last_column:p[p.length-1].last_column},k&&(M._$.range=[p[p.length-(N||1)].range[0],p[p.length-1].range[1]]),D=this.performAction.apply(M,[m,y,v,S.yy,R[1],f,p].concat(w)),typeof D<"u")return D;N&&(h=h.slice(0,-1*N*2),f=f.slice(0,-1*N),p=p.slice(0,-1*N)),h.push(this.productions_[R[1]][0]),f.push(M.$),p.push(M._$),F=g[h[h.length-2]][h[h.length-1]],h.push(F);break;case 3:return!0}}return!0},"parse")},a=function(){var o={EOF:1,parseError:C(function(u,h){if(this.yy.parser)this.yy.parser.parseError(u,h);else throw new Error(u)},"parseError"),setInput:C(function(l,u){return this.yy=u||this.yy||{},this._input=l,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var u=l.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),l},"input"),unput:C(function(l){var u=l.length,h=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===d.length?this.yylloc.first_column:0)+d[d.length-h.length].length-h[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:C(function(l){this.unput(this.match.slice(l))},"less"),pastInput:C(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:C(function(){var l=this.match;return l.length<20&&(l+=this._input.substr(0,20-l.length)),(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:C(function(){var l=this.pastInput(),u=new Array(l.length+1).join("-");return l+this.upcomingInput()+` `+u+"^"},"showPosition"),test_match:C(function(l,u){var h,d,f;if(this.options.backtrack_lexer&&(f={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(f.yylloc.range=this.yylloc.range.slice(0))),d=l[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+l[0].length},this.yytext+=l[0],this.match+=l[0],this.matches=l,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(l[0].length),this.matched+=l[0],h=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var p in f)this[p]=f[p];return!1}return!1},"test_match"),next:C(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var l,u,h,d;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),p=0;pu[0].length)){if(u=h,d=p,this.options.backtrack_lexer){if(l=this.test_match(h,f[p]),l!==!1)return l;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(l=this.test_match(u,f[d]),l!==!1?l:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var u=this.next();return u||this.lex()},"lex"),begin:C(function(u){this.conditionStack.push(u)},"begin"),popState:C(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:C(function(u){this.begin(u)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:C(function(u,h,d,f){switch(d){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return o}();i.lexer=a;function s(){this.yy={}}return C(s,"Parser"),s.prototype=i,i.Parser=s,new s}();ADe.parser=ADe;var Vne=ADe,Qne=[],Gne=[],Hne=new Map,Ljn=C(()=>{Qne=[],Gne=[],Hne=new Map,Aa()},"clear"),Mjn=(FI=class{constructor(e,r,n=0){this.source=e,this.target=r,this.value=n}},C(FI,"SankeyLink"),FI),Ijn=C((t,e,r)=>{Qne.push(new Mjn(t,e,r))},"addLink"),Pjn=(zI=class{constructor(e){this.ID=e}},C(zI,"SankeyNode"),zI),Njn=C(t=>{t=jt.sanitizeText(t,He());let e=Hne.get(t);return e===void 0&&(e=new Pjn(t),Hne.set(t,e),Gne.push(e)),e},"findOrCreateNode"),Bjn=C(()=>Gne,"getNodes"),$jn=C(()=>Qne,"getLinks"),Fjn=C(()=>({nodes:Gne.map(t=>({id:t.ID})),links:Qne.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),zjn={nodesMap:Hne,getConfig:C(()=>He().sankey,"getConfig"),getNodes:Bjn,getLinks:$jn,getGraph:Fjn,addLink:Ijn,findOrCreateNode:Njn,getAccTitle:Ja,setAccTitle:Da,getAccDescription:ts,setAccDescription:es,getDiagramTitle:La,setDiagramTitle:rs,clear:Ljn},Djt=(ab=class{static next(e){return new ab(e+ ++ab.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}},C(ab,"Uid"),ab.count=0,ab),Ujn={left:fjn,right:pjn,center:gjn,justify:Sjt},Vjn=C(t=>{let e=0,r=0;for(const n of t){const i=n.value??0;i>e&&(e=i,r=n.layer??0)}return r},"findCentralNodeLayer"),Qjn=C(function(t,e,r,n){const{securityLevel:i,sankey:a}=He(),s=Egt.sankey;let o;i==="sandbox"&&(o=Ot("#i"+e));const l=Ot(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):Ot(`[id="${e}"]`),h=(a==null?void 0:a.width)??s.width,d=(a==null?void 0:a.height)??s.width,f=(a==null?void 0:a.useMaxWidth)??s.useMaxWidth,p=(a==null?void 0:a.nodeAlignment)??s.nodeAlignment,g=(a==null?void 0:a.prefix)??s.prefix,m=(a==null?void 0:a.suffix)??s.suffix,v=(a==null?void 0:a.showValues)??s.showValues,y=(a==null?void 0:a.nodeWidth)??s.nodeWidth??10,b=(a==null?void 0:a.nodePadding)??s.nodePadding??12,x=(a==null?void 0:a.labelStyle)??s.labelStyle??"legacy",w=(a==null?void 0:a.nodeColors)??{},A=n.db.getGraph(),T=Ujn[p];bjn().nodeId(N=>N.id).nodeWidth(y).nodePadding(b+(v?15:0)).nodeAlign(T).extent([[0,0],[h,d]])(A);const O=Vjn(A.nodes),k=yS(zZr),E=C(N=>w[N]??k(N),"getNodeColor");u.append("g").attr("class","nodes").selectAll(".node").data(A.nodes).join("g").attr("class","node").attr("id",N=>(N.uid=Djt.next("node-")).id).attr("transform",function(N){return"translate("+N.x0+","+N.y0+")"}).attr("x",N=>N.x0).attr("y",N=>N.y0).append("rect").attr("height",N=>N.y1-N.y0).attr("width",N=>N.x1-N.x0).attr("fill",N=>E(N.id));const _=C(({id:N,value:F})=>v?`${N} +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var u=this.next();return u||this.lex()},"lex"),begin:C(function(u){this.conditionStack.push(u)},"begin"),popState:C(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:C(function(u){this.begin(u)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:C(function(u,h,d,f){switch(d){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return o}();i.lexer=a;function s(){this.yy={}}return C(s,"Parser"),s.prototype=i,i.Parser=s,new s}();ADe.parser=ADe;var Vne=ADe,Qne=[],Gne=[],Hne=new Map,Ljn=C(()=>{Qne=[],Gne=[],Hne=new Map,Aa()},"clear"),Mjn=(FI=class{constructor(e,r,n=0){this.source=e,this.target=r,this.value=n}},C(FI,"SankeyLink"),FI),Ijn=C((t,e,r)=>{Qne.push(new Mjn(t,e,r))},"addLink"),Pjn=(zI=class{constructor(e){this.ID=e}},C(zI,"SankeyNode"),zI),Njn=C(t=>{t=jt.sanitizeText(t,He());let e=Hne.get(t);return e===void 0&&(e=new Pjn(t),Hne.set(t,e),Gne.push(e)),e},"findOrCreateNode"),Bjn=C(()=>Gne,"getNodes"),$jn=C(()=>Qne,"getLinks"),Fjn=C(()=>({nodes:Gne.map(t=>({id:t.ID})),links:Qne.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),zjn={nodesMap:Hne,getConfig:C(()=>He().sankey,"getConfig"),getNodes:Bjn,getLinks:$jn,getGraph:Fjn,addLink:Ijn,findOrCreateNode:Njn,getAccTitle:Ja,setAccTitle:Da,getAccDescription:ts,setAccDescription:es,getDiagramTitle:La,setDiagramTitle:rs,clear:Ljn},Djt=(ab=class{static next(e){return new ab(e+ ++ab.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}},C(ab,"Uid"),ab.count=0,ab),Ujn={left:fjn,right:pjn,center:gjn,justify:Tjt},Vjn=C(t=>{let e=0,r=0;for(const n of t){const i=n.value??0;i>e&&(e=i,r=n.layer??0)}return r},"findCentralNodeLayer"),Qjn=C(function(t,e,r,n){const{securityLevel:i,sankey:a}=He(),s=Egt.sankey;let o;i==="sandbox"&&(o=Ot("#i"+e));const l=Ot(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):Ot(`[id="${e}"]`),h=(a==null?void 0:a.width)??s.width,d=(a==null?void 0:a.height)??s.width,f=(a==null?void 0:a.useMaxWidth)??s.useMaxWidth,p=(a==null?void 0:a.nodeAlignment)??s.nodeAlignment,g=(a==null?void 0:a.prefix)??s.prefix,m=(a==null?void 0:a.suffix)??s.suffix,v=(a==null?void 0:a.showValues)??s.showValues,y=(a==null?void 0:a.nodeWidth)??s.nodeWidth??10,b=(a==null?void 0:a.nodePadding)??s.nodePadding??12,x=(a==null?void 0:a.labelStyle)??s.labelStyle??"legacy",w=(a==null?void 0:a.nodeColors)??{},A=n.db.getGraph(),S=Ujn[p];bjn().nodeId(N=>N.id).nodeWidth(y).nodePadding(b+(v?15:0)).nodeAlign(S).extent([[0,0],[h,d]])(A);const O=Vjn(A.nodes),k=yT(zZr),E=C(N=>w[N]??k(N),"getNodeColor");u.append("g").attr("class","nodes").selectAll(".node").data(A.nodes).join("g").attr("class","node").attr("id",N=>(N.uid=Djt.next("node-")).id).attr("transform",function(N){return"translate("+N.x0+","+N.y0+")"}).attr("x",N=>N.x0).attr("y",N=>N.y0).append("rect").attr("height",N=>N.y1-N.y0).attr("width",N=>N.x1-N.x0).attr("fill",N=>E(N.id));const _=C(({id:N,value:F})=>v?`${N} ${g}${Math.round(F*100)/100}${m}`:N,"getText"),I=C(N=>x==="outlined"?(N.layer??0)L.selectAll(N?`.${N}`:"text").data(A.nodes).join("text").attr("class",N??null).attr("x",F=>I(F).x).attr("y",F=>(F.y1+F.y0)/2).attr("dy",`${v?"0":"0.35"}em`).attr("text-anchor",F=>I(F).anchor).text(_),"appendLabel");x==="outlined"?(R("sankey-label-bg"),R("sankey-label-fg")):R();const D=u.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(A.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),M=(a==null?void 0:a.linkColor)??"gradient";if(M==="gradient"){const N=D.append("linearGradient").attr("id",F=>(F.uid=Djt.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",F=>F.source.x1).attr("x2",F=>F.target.x0);N.append("stop").attr("offset","0%").attr("stop-color",F=>E(F.source.id)),N.append("stop").attr("offset","100%").attr("stop-color",F=>E(F.target.id))}let P;switch(M){case"gradient":P=C(N=>N.uid,"coloring");break;case"source":P=C(N=>E(N.source.id),"coloring");break;case"target":P=C(N=>E(N.target.id),"coloring");break;default:P=M}D.append("path").attr("d",Djn()).attr("stroke",P).attr("stroke-width",N=>Math.max(1,N.width)),E5(void 0,u,0,f)},"draw"),Gjn={draw:Qjn},Hjn=C(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` `).trim(),"prepareTextForParsing"),Wjn=C(t=>`.label { font-family: ${t.fontFamily}; @@ -3376,7 +3376,7 @@ ${g}${Math.round(F*100)/100}${m}`:N,"getText"),I=C(N=>x==="outlined"?(N.layer??0 stroke-width: ${e.blockStrokeWidth}; fill: ${e.blockFillColor}; } - `},"styles"),sXn={parser:Mjt,get db(){return new Ljt},renderer:nXn,styles:aXn};const oXn=Object.freeze(Object.defineProperty({__proto__:null,diagram:sXn},Symbol.toStringTag,{value:"Module"}));var tD={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},Wne=32,Ijt={axes:[],curves:[],options:tD},sv=structuredClone(Ijt),lXn=Xn.radar,cXn=C(()=>ns({...lXn,...Dr().radar}),"getConfig"),Pjt=C(()=>sv.axes,"getAxes"),uXn=C(()=>sv.curves,"getCurves"),hXn=C(()=>sv.options,"getOptions"),dXn=C(t=>{sv.axes=t.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),fXn=C(t=>{sv.curves=t.map(e=>({name:e.name,label:e.label??e.name,entries:pXn(e.entries)}))},"setCurves"),pXn=C(t=>{if(t[0].axis==null)return t.map(r=>r.value);const e=Pjt();if(e.length===0)throw new Error("Axes must be populated before curves for reference entries");return e.map(r=>{const n=t.find(i=>{var a;return((a=i.axis)==null?void 0:a.$refText)===r.name});if(n===void 0)throw new Error("Missing entry for axis "+r.label);return n.value})},"computeCurveEntries"),gXn=C(t=>{var r,n,i,a,s;const e=t.reduce((o,l)=>(o[l.name]=l,o),{});sv.options={showLegend:((r=e.showLegend)==null?void 0:r.value)??tD.showLegend,ticks:((n=e.ticks)==null?void 0:n.value)??tD.ticks,max:((i=e.max)==null?void 0:i.value)??tD.max,min:((a=e.min)==null?void 0:a.value)??tD.min,graticule:((s=e.graticule)==null?void 0:s.value)??tD.graticule},sv.options.ticks>Wne&&(me.warn(`Radar diagram ticks (${sv.options.ticks}) exceeds maximum allowed (${Wne}). Using ${Wne} instead.`),sv.options.ticks=Wne)},"setOptions"),mXn=C(()=>{Aa(),sv=structuredClone(Ijt)},"clear"),Lz={getAxes:Pjt,getCurves:uXn,getOptions:hXn,setAxes:dXn,setCurves:fXn,setOptions:gXn,getConfig:cXn,clear:mXn,setAccTitle:Da,getAccTitle:Ja,setDiagramTitle:rs,getDiagramTitle:La,getAccDescription:ts,setAccDescription:es},vXn=C(t=>{qu(t,Lz);const{axes:e,curves:r,options:n}=t;Lz.setAxes(e),Lz.setCurves(r),Lz.setOptions(n)},"populate"),yXn={parse:C(async t=>{const e=await Op("radar",t);me.debug(e),vXn(e)},"parse")},bXn=C((t,e,r,n)=>{const i=n.db,a=i.getAxes(),s=i.getCurves(),o=i.getOptions(),l=i.getConfig(),u=i.getDiagramTitle(),h=qc(e),d=xXn(h,l),f=o.max??Math.max(...s.map(m=>Math.max(...m.entries))),p=o.min,g=Math.min(l.width,l.height)/2;wXn(d,a,g,o.ticks,o.graticule),AXn(d,a,g,l),Njt(d,a,s,p,f,o.graticule,l),Fjt(d,s,o.showLegend,l),d.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),xXn=C((t,e)=>{const r=e.width+e.marginLeft+e.marginRight,n=e.height+e.marginTop+e.marginBottom,i={x:e.marginLeft+e.width/2,y:e.marginTop+e.height/2};return zs(t,n,r,e.useMaxWidth??!0),t.attr("viewBox",`0 0 ${r} ${n}`).attr("overflow","visible"),t.append("g").attr("transform",`translate(${i.x}, ${i.y})`)},"drawFrame"),wXn=C((t,e,r,n,i)=>{if(i==="circle")for(let a=0;a{const d=2*h*Math.PI/a-Math.PI/2,f=o*Math.cos(d),p=o*Math.sin(d);return`${f},${p}`}).join(" ");t.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule"),AXn=C((t,e,r,n)=>{const i=e.length;for(let a=0;a.01?"start":l<-.01?"end":"middle",d=u>.01?"hanging":u<-.01?"auto":"central",f=4;t.append("text").text(s).attr("x",r*n.axisLabelFactor*l+f*l).attr("y",r*n.axisLabelFactor*u+f*u).attr("text-anchor",h).attr("dominant-baseline",d).attr("class","radarAxisLabel")}},"drawAxes");function Njt(t,e,r,n,i,a,s){const o=e.length,l=Math.min(s.width,s.height)/2;r.forEach((u,h)=>{if(u.entries.length!==o)return;const d=u.entries.map((f,p)=>{const g=2*Math.PI*p/o-Math.PI/2,m=Bjt(f,n,i,l),v=m*Math.cos(g),y=m*Math.sin(g);return{x:v,y}});a==="circle"?t.append("path").attr("d",$jt(d,s.curveTension)).attr("class",`radarCurve-${h}`):a==="polygon"&&t.append("polygon").attr("points",d.map(f=>`${f.x},${f.y}`).join(" ")).attr("class",`radarCurve-${h}`)})}C(Njt,"drawCurves");function Bjt(t,e,r,n){const i=Math.min(Math.max(t,e),r);return n*(i-e)/(r-e)}C(Bjt,"relativeRadius");function $jt(t,e){const r=t.length;let n=`M${t[0].x},${t[0].y}`;for(let i=0;i{const u=t.append("g").attr("transform",`translate(${i}, ${a+l*s})`);u.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${l}`),u.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(o.label)})}C(Fjt,"drawLegend");var TXn={draw:bXn},SXn=C((t,e)=>{let r="";for(let n=0;nns({...lXn,...Dr().radar}),"getConfig"),Pjt=C(()=>sv.axes,"getAxes"),uXn=C(()=>sv.curves,"getCurves"),hXn=C(()=>sv.options,"getOptions"),dXn=C(t=>{sv.axes=t.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),fXn=C(t=>{sv.curves=t.map(e=>({name:e.name,label:e.label??e.name,entries:pXn(e.entries)}))},"setCurves"),pXn=C(t=>{if(t[0].axis==null)return t.map(r=>r.value);const e=Pjt();if(e.length===0)throw new Error("Axes must be populated before curves for reference entries");return e.map(r=>{const n=t.find(i=>{var a;return((a=i.axis)==null?void 0:a.$refText)===r.name});if(n===void 0)throw new Error("Missing entry for axis "+r.label);return n.value})},"computeCurveEntries"),gXn=C(t=>{var r,n,i,a,s;const e=t.reduce((o,l)=>(o[l.name]=l,o),{});sv.options={showLegend:((r=e.showLegend)==null?void 0:r.value)??tD.showLegend,ticks:((n=e.ticks)==null?void 0:n.value)??tD.ticks,max:((i=e.max)==null?void 0:i.value)??tD.max,min:((a=e.min)==null?void 0:a.value)??tD.min,graticule:((s=e.graticule)==null?void 0:s.value)??tD.graticule},sv.options.ticks>Wne&&(me.warn(`Radar diagram ticks (${sv.options.ticks}) exceeds maximum allowed (${Wne}). Using ${Wne} instead.`),sv.options.ticks=Wne)},"setOptions"),mXn=C(()=>{Aa(),sv=structuredClone(Ijt)},"clear"),Lz={getAxes:Pjt,getCurves:uXn,getOptions:hXn,setAxes:dXn,setCurves:fXn,setOptions:gXn,getConfig:cXn,clear:mXn,setAccTitle:Da,getAccTitle:Ja,setDiagramTitle:rs,getDiagramTitle:La,getAccDescription:ts,setAccDescription:es},vXn=C(t=>{qu(t,Lz);const{axes:e,curves:r,options:n}=t;Lz.setAxes(e),Lz.setCurves(r),Lz.setOptions(n)},"populate"),yXn={parse:C(async t=>{const e=await Op("radar",t);me.debug(e),vXn(e)},"parse")},bXn=C((t,e,r,n)=>{const i=n.db,a=i.getAxes(),s=i.getCurves(),o=i.getOptions(),l=i.getConfig(),u=i.getDiagramTitle(),h=qc(e),d=xXn(h,l),f=o.max??Math.max(...s.map(m=>Math.max(...m.entries))),p=o.min,g=Math.min(l.width,l.height)/2;wXn(d,a,g,o.ticks,o.graticule),AXn(d,a,g,l),Njt(d,a,s,p,f,o.graticule,l),Fjt(d,s,o.showLegend,l),d.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),xXn=C((t,e)=>{const r=e.width+e.marginLeft+e.marginRight,n=e.height+e.marginTop+e.marginBottom,i={x:e.marginLeft+e.width/2,y:e.marginTop+e.height/2};return zs(t,n,r,e.useMaxWidth??!0),t.attr("viewBox",`0 0 ${r} ${n}`).attr("overflow","visible"),t.append("g").attr("transform",`translate(${i.x}, ${i.y})`)},"drawFrame"),wXn=C((t,e,r,n,i)=>{if(i==="circle")for(let a=0;a{const d=2*h*Math.PI/a-Math.PI/2,f=o*Math.cos(d),p=o*Math.sin(d);return`${f},${p}`}).join(" ");t.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule"),AXn=C((t,e,r,n)=>{const i=e.length;for(let a=0;a.01?"start":l<-.01?"end":"middle",d=u>.01?"hanging":u<-.01?"auto":"central",f=4;t.append("text").text(s).attr("x",r*n.axisLabelFactor*l+f*l).attr("y",r*n.axisLabelFactor*u+f*u).attr("text-anchor",h).attr("dominant-baseline",d).attr("class","radarAxisLabel")}},"drawAxes");function Njt(t,e,r,n,i,a,s){const o=e.length,l=Math.min(s.width,s.height)/2;r.forEach((u,h)=>{if(u.entries.length!==o)return;const d=u.entries.map((f,p)=>{const g=2*Math.PI*p/o-Math.PI/2,m=Bjt(f,n,i,l),v=m*Math.cos(g),y=m*Math.sin(g);return{x:v,y}});a==="circle"?t.append("path").attr("d",$jt(d,s.curveTension)).attr("class",`radarCurve-${h}`):a==="polygon"&&t.append("polygon").attr("points",d.map(f=>`${f.x},${f.y}`).join(" ")).attr("class",`radarCurve-${h}`)})}C(Njt,"drawCurves");function Bjt(t,e,r,n){const i=Math.min(Math.max(t,e),r);return n*(i-e)/(r-e)}C(Bjt,"relativeRadius");function $jt(t,e){const r=t.length;let n=`M${t[0].x},${t[0].y}`;for(let i=0;i{const u=t.append("g").attr("transform",`translate(${i}, ${a+l*s})`);u.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${l}`),u.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(o.label)})}C(Fjt,"drawLegend");var SXn={draw:bXn},TXn=C((t,e)=>{let r="";for(let n=0;nx==="outlined"?(N.layer??0 font-size: ${r.legendFontSize}px; dominant-baseline: hanging; } - ${SXn(e,r)} - `},"styles"),kXn={parser:yXn,db:Lz,renderer:TXn,styles:OXn};const EXn=Object.freeze(Object.defineProperty({__proto__:null,diagram:kXn},Symbol.toStringTag,{value:"Module"}));var TDe=function(){var t=C(function(x,w,A,T){for(A=A||{},T=x.length;T--;A[x[T]]=w);return A},"o"),e=[1,15],r=[1,7],n=[1,13],i=[1,14],a=[1,19],s=[1,16],o=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],f=[1,24],p=[8,10,15,16,21,28,29,30,31,39,43,46],g=[8,10,15,16,21,27,28,29,30,31,39,43,46],m=[1,49],v={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:C(function(w,A,T,S,O,k,E){var _=k.length-1;switch(O){case 4:S.getLogger().debug("Rule: separator (NL) ");break;case 5:S.getLogger().debug("Rule: separator (Space) ");break;case 6:S.getLogger().debug("Rule: separator (EOF) ");break;case 7:S.getLogger().debug("Rule: hierarchy: ",k[_-1]),S.setHierarchy(k[_-1]);break;case 8:S.getLogger().debug("Stop NL ");break;case 9:S.getLogger().debug("Stop EOF ");break;case 10:S.getLogger().debug("Stop NL2 ");break;case 11:S.getLogger().debug("Stop EOF2 ");break;case 12:S.getLogger().debug("Rule: statement: ",k[_]),typeof k[_].length=="number"?this.$=k[_]:this.$=[k[_]];break;case 13:S.getLogger().debug("Rule: statement #2: ",k[_-1]),this.$=[k[_-1]].concat(k[_]);break;case 14:S.getLogger().debug("Rule: link: ",k[_],w),this.$={edgeTypeStr:k[_],label:""};break;case 15:S.getLogger().debug("Rule: LABEL link: ",k[_-3],k[_-1],k[_]),this.$={edgeTypeStr:k[_],label:k[_-1]};break;case 18:const I=parseInt(k[_]),L=S.generateId();this.$={id:L,type:"space",label:"",width:I,children:[]};break;case 23:S.getLogger().debug("Rule: (nodeStatement link node) ",k[_-2],k[_-1],k[_]," typestr: ",k[_-1].edgeTypeStr);const R=S.edgeStrToEdgeData(k[_-1].edgeTypeStr),D=S.edgeStrToEdgeStartData(k[_-1].edgeTypeStr),M=S.edgeStrToThickness(k[_-1].edgeTypeStr),P=S.edgeStrToPattern(k[_-1].edgeTypeStr);this.$=[{id:k[_-2].id,label:k[_-2].label,type:k[_-2].type,directions:k[_-2].directions},{id:k[_-2].id+"-"+k[_].id,start:k[_-2].id,end:k[_].id,label:k[_-1].label,type:"edge",thickness:M,pattern:P,directions:k[_].directions,arrowTypeEnd:R,arrowTypeStart:D},{id:k[_].id,label:k[_].label,type:S.typeStr2Type(k[_].typeStr),directions:k[_].directions}];break;case 24:S.getLogger().debug("Rule: nodeStatement (abc88 node size) ",k[_-1],k[_]),this.$={id:k[_-1].id,label:k[_-1].label,type:S.typeStr2Type(k[_-1].typeStr),directions:k[_-1].directions,widthInColumns:parseInt(k[_],10)};break;case 25:S.getLogger().debug("Rule: nodeStatement (node) ",k[_]),this.$={id:k[_].id,label:k[_].label,type:S.typeStr2Type(k[_].typeStr),directions:k[_].directions,widthInColumns:1};break;case 26:S.getLogger().debug("APA123",this?this:"na"),S.getLogger().debug("COLUMNS: ",k[_]),this.$={type:"column-setting",columns:k[_]==="auto"?-1:parseInt(k[_])};break;case 27:S.getLogger().debug("Rule: id-block statement : ",k[_-2],k[_-1]),S.generateId(),this.$={...k[_-2],type:"composite",children:k[_-1]};break;case 28:S.getLogger().debug("Rule: blockStatement : ",k[_-2],k[_-1],k[_]);const N=S.generateId();this.$={id:N,type:"composite",label:"",children:k[_-1]};break;case 29:S.getLogger().debug("Rule: node (NODE_ID separator): ",k[_]),this.$={id:k[_]};break;case 30:S.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",k[_-1],k[_]),this.$={id:k[_-1],label:k[_].label,typeStr:k[_].typeStr,directions:k[_].directions};break;case 31:S.getLogger().debug("Rule: dirList: ",k[_]),this.$=[k[_]];break;case 32:S.getLogger().debug("Rule: dirList: ",k[_-1],k[_]),this.$=[k[_-1]].concat(k[_]);break;case 33:S.getLogger().debug("Rule: nodeShapeNLabel: ",k[_-2],k[_-1],k[_]),this.$={typeStr:k[_-2]+k[_],label:k[_-1]};break;case 34:S.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",k[_-3],k[_-2]," #3:",k[_-1],k[_]),this.$={typeStr:k[_-3]+k[_],label:k[_-2],directions:k[_-1]};break;case 35:case 36:this.$={type:"classDef",id:k[_-1].trim(),css:k[_].trim()};break;case 37:this.$={type:"applyClass",id:k[_-1].trim(),styleClass:k[_].trim()};break;case 38:this.$={type:"applyStyles",id:k[_-1].trim(),stylesStr:k[_].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:e,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:e,21:r,28:n,29:i,31:a,39:s,43:o,46:l}),t(h,[2,16],{14:22,15:d,16:f}),t(h,[2,17]),t(h,[2,18]),t(h,[2,19]),t(h,[2,20]),t(h,[2,21]),t(h,[2,22]),t(p,[2,25],{27:[1,25]}),t(h,[2,26]),{19:26,26:12,31:a},{10:e,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(g,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:a},{31:[2,14]},{17:[1,36]},t(p,[2,24]),{10:e,11:37,13:4,14:22,15:d,16:f,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(g,[2,30]),{18:[1,43]},{18:[1,44]},t(p,[2,23]),{18:[1,45]},{30:[1,46]},t(h,[2,28]),t(h,[2,35]),t(h,[2,36]),t(h,[2,37]),t(h,[2,38]),{36:[1,47]},{33:48,34:m},{15:[1,50]},t(h,[2,27]),t(g,[2,33]),{38:[1,51]},{33:52,34:m,38:[2,31]},{31:[2,15]},t(g,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:C(function(w,A){if(A.recoverable)this.trace(w);else{var T=new Error(w);throw T.hash=A,T}},"parseError"),parse:C(function(w){var A=this,T=[0],S=[],O=[null],k=[],E=this.table,_="",I=0,L=0,R=2,D=1,M=k.slice.call(arguments,1),P=Object.create(this.lexer),N={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(N.yy[F]=this.yy[F]);P.setInput(w,N.yy),N.yy.lexer=P,N.yy.parser=this,typeof P.yylloc>"u"&&(P.yylloc={});var B=P.yylloc;k.push(B);var V=P.options&&P.options.ranges;typeof N.yy.parseError=="function"?this.parseError=N.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function z(ae){T.length=T.length-2*ae,O.length=O.length-ae,k.length=k.length-ae}C(z,"popStack");function U(){var ae;return ae=S.pop()||P.lex()||D,typeof ae!="number"&&(ae instanceof Array&&(S=ae,ae=S.pop()),ae=A.symbols_[ae]||ae),ae}C(U,"lex");for(var Q,G,X,Y,le={},q,Z,ee,re;;){if(G=T[T.length-1],this.defaultActions[G]?X=this.defaultActions[G]:((Q===null||typeof Q>"u")&&(Q=U()),X=E[G]&&E[G][Q]),typeof X>"u"||!X.length||!X[0]){var ve="";re=[];for(q in E[G])this.terminals_[q]&&q>R&&re.push("'"+this.terminals_[q]+"'");P.showPosition?ve="Parse error on line "+(I+1)+`: + ${TXn(e,r)} + `},"styles"),kXn={parser:yXn,db:Lz,renderer:SXn,styles:OXn};const EXn=Object.freeze(Object.defineProperty({__proto__:null,diagram:kXn},Symbol.toStringTag,{value:"Module"}));var SDe=function(){var t=C(function(x,w,A,S){for(A=A||{},S=x.length;S--;A[x[S]]=w);return A},"o"),e=[1,15],r=[1,7],n=[1,13],i=[1,14],a=[1,19],s=[1,16],o=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],f=[1,24],p=[8,10,15,16,21,28,29,30,31,39,43,46],g=[8,10,15,16,21,27,28,29,30,31,39,43,46],m=[1,49],v={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:C(function(w,A,S,T,O,k,E){var _=k.length-1;switch(O){case 4:T.getLogger().debug("Rule: separator (NL) ");break;case 5:T.getLogger().debug("Rule: separator (Space) ");break;case 6:T.getLogger().debug("Rule: separator (EOF) ");break;case 7:T.getLogger().debug("Rule: hierarchy: ",k[_-1]),T.setHierarchy(k[_-1]);break;case 8:T.getLogger().debug("Stop NL ");break;case 9:T.getLogger().debug("Stop EOF ");break;case 10:T.getLogger().debug("Stop NL2 ");break;case 11:T.getLogger().debug("Stop EOF2 ");break;case 12:T.getLogger().debug("Rule: statement: ",k[_]),typeof k[_].length=="number"?this.$=k[_]:this.$=[k[_]];break;case 13:T.getLogger().debug("Rule: statement #2: ",k[_-1]),this.$=[k[_-1]].concat(k[_]);break;case 14:T.getLogger().debug("Rule: link: ",k[_],w),this.$={edgeTypeStr:k[_],label:""};break;case 15:T.getLogger().debug("Rule: LABEL link: ",k[_-3],k[_-1],k[_]),this.$={edgeTypeStr:k[_],label:k[_-1]};break;case 18:const I=parseInt(k[_]),L=T.generateId();this.$={id:L,type:"space",label:"",width:I,children:[]};break;case 23:T.getLogger().debug("Rule: (nodeStatement link node) ",k[_-2],k[_-1],k[_]," typestr: ",k[_-1].edgeTypeStr);const R=T.edgeStrToEdgeData(k[_-1].edgeTypeStr),D=T.edgeStrToEdgeStartData(k[_-1].edgeTypeStr),M=T.edgeStrToThickness(k[_-1].edgeTypeStr),P=T.edgeStrToPattern(k[_-1].edgeTypeStr);this.$=[{id:k[_-2].id,label:k[_-2].label,type:k[_-2].type,directions:k[_-2].directions},{id:k[_-2].id+"-"+k[_].id,start:k[_-2].id,end:k[_].id,label:k[_-1].label,type:"edge",thickness:M,pattern:P,directions:k[_].directions,arrowTypeEnd:R,arrowTypeStart:D},{id:k[_].id,label:k[_].label,type:T.typeStr2Type(k[_].typeStr),directions:k[_].directions}];break;case 24:T.getLogger().debug("Rule: nodeStatement (abc88 node size) ",k[_-1],k[_]),this.$={id:k[_-1].id,label:k[_-1].label,type:T.typeStr2Type(k[_-1].typeStr),directions:k[_-1].directions,widthInColumns:parseInt(k[_],10)};break;case 25:T.getLogger().debug("Rule: nodeStatement (node) ",k[_]),this.$={id:k[_].id,label:k[_].label,type:T.typeStr2Type(k[_].typeStr),directions:k[_].directions,widthInColumns:1};break;case 26:T.getLogger().debug("APA123",this?this:"na"),T.getLogger().debug("COLUMNS: ",k[_]),this.$={type:"column-setting",columns:k[_]==="auto"?-1:parseInt(k[_])};break;case 27:T.getLogger().debug("Rule: id-block statement : ",k[_-2],k[_-1]),T.generateId(),this.$={...k[_-2],type:"composite",children:k[_-1]};break;case 28:T.getLogger().debug("Rule: blockStatement : ",k[_-2],k[_-1],k[_]);const N=T.generateId();this.$={id:N,type:"composite",label:"",children:k[_-1]};break;case 29:T.getLogger().debug("Rule: node (NODE_ID separator): ",k[_]),this.$={id:k[_]};break;case 30:T.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",k[_-1],k[_]),this.$={id:k[_-1],label:k[_].label,typeStr:k[_].typeStr,directions:k[_].directions};break;case 31:T.getLogger().debug("Rule: dirList: ",k[_]),this.$=[k[_]];break;case 32:T.getLogger().debug("Rule: dirList: ",k[_-1],k[_]),this.$=[k[_-1]].concat(k[_]);break;case 33:T.getLogger().debug("Rule: nodeShapeNLabel: ",k[_-2],k[_-1],k[_]),this.$={typeStr:k[_-2]+k[_],label:k[_-1]};break;case 34:T.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",k[_-3],k[_-2]," #3:",k[_-1],k[_]),this.$={typeStr:k[_-3]+k[_],label:k[_-2],directions:k[_-1]};break;case 35:case 36:this.$={type:"classDef",id:k[_-1].trim(),css:k[_].trim()};break;case 37:this.$={type:"applyClass",id:k[_-1].trim(),styleClass:k[_].trim()};break;case 38:this.$={type:"applyStyles",id:k[_-1].trim(),stylesStr:k[_].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:e,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:e,21:r,28:n,29:i,31:a,39:s,43:o,46:l}),t(h,[2,16],{14:22,15:d,16:f}),t(h,[2,17]),t(h,[2,18]),t(h,[2,19]),t(h,[2,20]),t(h,[2,21]),t(h,[2,22]),t(p,[2,25],{27:[1,25]}),t(h,[2,26]),{19:26,26:12,31:a},{10:e,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(g,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:a},{31:[2,14]},{17:[1,36]},t(p,[2,24]),{10:e,11:37,13:4,14:22,15:d,16:f,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(g,[2,30]),{18:[1,43]},{18:[1,44]},t(p,[2,23]),{18:[1,45]},{30:[1,46]},t(h,[2,28]),t(h,[2,35]),t(h,[2,36]),t(h,[2,37]),t(h,[2,38]),{36:[1,47]},{33:48,34:m},{15:[1,50]},t(h,[2,27]),t(g,[2,33]),{38:[1,51]},{33:52,34:m,38:[2,31]},{31:[2,15]},t(g,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:C(function(w,A){if(A.recoverable)this.trace(w);else{var S=new Error(w);throw S.hash=A,S}},"parseError"),parse:C(function(w){var A=this,S=[0],T=[],O=[null],k=[],E=this.table,_="",I=0,L=0,R=2,D=1,M=k.slice.call(arguments,1),P=Object.create(this.lexer),N={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(N.yy[F]=this.yy[F]);P.setInput(w,N.yy),N.yy.lexer=P,N.yy.parser=this,typeof P.yylloc>"u"&&(P.yylloc={});var B=P.yylloc;k.push(B);var V=P.options&&P.options.ranges;typeof N.yy.parseError=="function"?this.parseError=N.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function z(ae){S.length=S.length-2*ae,O.length=O.length-ae,k.length=k.length-ae}C(z,"popStack");function U(){var ae;return ae=T.pop()||P.lex()||D,typeof ae!="number"&&(ae instanceof Array&&(T=ae,ae=T.pop()),ae=A.symbols_[ae]||ae),ae}C(U,"lex");for(var Q,G,X,Y,le={},q,Z,ee,re;;){if(G=S[S.length-1],this.defaultActions[G]?X=this.defaultActions[G]:((Q===null||typeof Q>"u")&&(Q=U()),X=E[G]&&E[G][Q]),typeof X>"u"||!X.length||!X[0]){var ve="";re=[];for(q in E[G])this.terminals_[q]&&q>R&&re.push("'"+this.terminals_[q]+"'");P.showPosition?ve="Parse error on line "+(I+1)+`: `+P.showPosition()+` -Expecting `+re.join(", ")+", got '"+(this.terminals_[Q]||Q)+"'":ve="Parse error on line "+(I+1)+": Unexpected "+(Q==D?"end of input":"'"+(this.terminals_[Q]||Q)+"'"),this.parseError(ve,{text:P.match,token:this.terminals_[Q]||Q,line:P.yylineno,loc:B,expected:re})}if(X[0]instanceof Array&&X.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+Q);switch(X[0]){case 1:T.push(Q),O.push(P.yytext),k.push(P.yylloc),T.push(X[1]),Q=null,L=P.yyleng,_=P.yytext,I=P.yylineno,B=P.yylloc;break;case 2:if(Z=this.productions_[X[1]][1],le.$=O[O.length-Z],le._$={first_line:k[k.length-(Z||1)].first_line,last_line:k[k.length-1].last_line,first_column:k[k.length-(Z||1)].first_column,last_column:k[k.length-1].last_column},V&&(le._$.range=[k[k.length-(Z||1)].range[0],k[k.length-1].range[1]]),Y=this.performAction.apply(le,[_,L,I,N.yy,X[1],O,k].concat(M)),typeof Y<"u")return Y;Z&&(T=T.slice(0,-1*Z*2),O=O.slice(0,-1*Z),k=k.slice(0,-1*Z)),T.push(this.productions_[X[1]][0]),O.push(le.$),k.push(le._$),ee=E[T[T.length-2]][T[T.length-1]],T.push(ee);break;case 3:return!0}}return!0},"parse")},y=function(){var x={EOF:1,parseError:C(function(A,T){if(this.yy.parser)this.yy.parser.parseError(A,T);else throw new Error(A)},"parseError"),setInput:C(function(w,A){return this.yy=A||this.yy||{},this._input=w,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var w=this._input[0];this.yytext+=w,this.yyleng++,this.offset++,this.match+=w,this.matched+=w;var A=w.match(/(?:\r\n?|\n).*/g);return A?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),w},"input"),unput:C(function(w){var A=w.length,T=w.split(/(?:\r\n?|\n)/g);this._input=w+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-A),this.offset-=A;var S=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),T.length-1&&(this.yylineno-=T.length-1);var O=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:T?(T.length===S.length?this.yylloc.first_column:0)+S[S.length-T.length].length-T[0].length:this.yylloc.first_column-A},this.options.ranges&&(this.yylloc.range=[O[0],O[0]+this.yyleng-A]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +Expecting `+re.join(", ")+", got '"+(this.terminals_[Q]||Q)+"'":ve="Parse error on line "+(I+1)+": Unexpected "+(Q==D?"end of input":"'"+(this.terminals_[Q]||Q)+"'"),this.parseError(ve,{text:P.match,token:this.terminals_[Q]||Q,line:P.yylineno,loc:B,expected:re})}if(X[0]instanceof Array&&X.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+Q);switch(X[0]){case 1:S.push(Q),O.push(P.yytext),k.push(P.yylloc),S.push(X[1]),Q=null,L=P.yyleng,_=P.yytext,I=P.yylineno,B=P.yylloc;break;case 2:if(Z=this.productions_[X[1]][1],le.$=O[O.length-Z],le._$={first_line:k[k.length-(Z||1)].first_line,last_line:k[k.length-1].last_line,first_column:k[k.length-(Z||1)].first_column,last_column:k[k.length-1].last_column},V&&(le._$.range=[k[k.length-(Z||1)].range[0],k[k.length-1].range[1]]),Y=this.performAction.apply(le,[_,L,I,N.yy,X[1],O,k].concat(M)),typeof Y<"u")return Y;Z&&(S=S.slice(0,-1*Z*2),O=O.slice(0,-1*Z),k=k.slice(0,-1*Z)),S.push(this.productions_[X[1]][0]),O.push(le.$),k.push(le._$),ee=E[S[S.length-2]][S[S.length-1]],S.push(ee);break;case 3:return!0}}return!0},"parse")},y=function(){var x={EOF:1,parseError:C(function(A,S){if(this.yy.parser)this.yy.parser.parseError(A,S);else throw new Error(A)},"parseError"),setInput:C(function(w,A){return this.yy=A||this.yy||{},this._input=w,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var w=this._input[0];this.yytext+=w,this.yyleng++,this.offset++,this.match+=w,this.matched+=w;var A=w.match(/(?:\r\n?|\n).*/g);return A?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),w},"input"),unput:C(function(w){var A=w.length,S=w.split(/(?:\r\n?|\n)/g);this._input=w+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-A),this.offset-=A;var T=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),S.length-1&&(this.yylineno-=S.length-1);var O=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:S?(S.length===T.length?this.yylloc.first_column:0)+T[T.length-S.length].length-S[0].length:this.yylloc.first_column-A},this.options.ranges&&(this.yylloc.range=[O[0],O[0]+this.yyleng-A]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:C(function(w){this.unput(this.match.slice(w))},"less"),pastInput:C(function(){var w=this.matched.substr(0,this.matched.length-this.match.length);return(w.length>20?"...":"")+w.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:C(function(){var w=this.match;return w.length<20&&(w+=this._input.substr(0,20-w.length)),(w.substr(0,20)+(w.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:C(function(){var w=this.pastInput(),A=new Array(w.length+1).join("-");return w+this.upcomingInput()+` -`+A+"^"},"showPosition"),test_match:C(function(w,A){var T,S,O;if(this.options.backtrack_lexer&&(O={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(O.yylloc.range=this.yylloc.range.slice(0))),S=w[0].match(/(?:\r\n?|\n).*/g),S&&(this.yylineno+=S.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:S?S[S.length-1].length-S[S.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+w[0].length},this.yytext+=w[0],this.match+=w[0],this.matches=w,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(w[0].length),this.matched+=w[0],T=this.performAction.call(this,this.yy,this,A,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),T)return T;if(this._backtrack){for(var k in O)this[k]=O[k];return!1}return!1},"test_match"),next:C(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var w,A,T,S;this._more||(this.yytext="",this.match="");for(var O=this._currentRules(),k=0;kA[0].length)){if(A=T,S=k,this.options.backtrack_lexer){if(w=this.test_match(T,O[k]),w!==!1)return w;if(this._backtrack){A=!1;continue}else return!1}else if(!this.options.flex)break}return A?(w=this.test_match(A,O[S]),w!==!1?w:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var A=this.next();return A||this.lex()},"lex"),begin:C(function(A){this.conditionStack.push(A)},"begin"),popState:C(function(){var A=this.conditionStack.length-1;return A>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(A){return A=this.conditionStack.length-1-Math.abs(A||0),A>=0?this.conditionStack[A]:"INITIAL"},"topState"),pushState:C(function(A){this.begin(A)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:C(function(A,T,S,O){switch(S){case 0:return A.getLogger().debug("Found block-beta"),10;case 1:return A.getLogger().debug("Found id-block"),29;case 2:return A.getLogger().debug("Found block"),10;case 3:A.getLogger().debug(".",T.yytext);break;case 4:A.getLogger().debug("_",T.yytext);break;case 5:return 5;case 6:return T.yytext=-1,28;case 7:return T.yytext=T.yytext.replace(/columns\s+/,""),A.getLogger().debug("COLUMNS (LEX)",T.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:A.getLogger().debug("LEX: POPPING STR:",T.yytext),this.popState();break;case 13:return A.getLogger().debug("LEX: STR end:",T.yytext),"STR";case 14:return T.yytext=T.yytext.replace(/space\:/,""),A.getLogger().debug("SPACE NUM (LEX)",T.yytext),21;case 15:return T.yytext="1",A.getLogger().debug("COLUMNS (LEX)",T.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),A.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),A.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),A.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),A.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),A.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),A.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),A.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),A.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),A.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),A.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),A.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),A.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),A.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),A.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),A.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),A.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),A.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return A.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return A.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return A.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return A.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return A.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return A.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return A.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return A.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return A.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return A.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return A.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return A.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),A.getLogger().debug("LEX ARR START"),37;case 74:return A.getLogger().debug("Lex: NODE_ID",T.yytext),31;case 75:return A.getLogger().debug("Lex: EOF",T.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:A.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:A.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return A.getLogger().debug("LEX: NODE_DESCR:",T.yytext),"NODE_DESCR";case 83:A.getLogger().debug("LEX POPPING"),this.popState();break;case 84:A.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return T.yytext=T.yytext.replace(/^,\s*/,""),A.getLogger().debug("Lex (right): dir:",T.yytext),"DIR";case 86:return T.yytext=T.yytext.replace(/^,\s*/,""),A.getLogger().debug("Lex (left):",T.yytext),"DIR";case 87:return T.yytext=T.yytext.replace(/^,\s*/,""),A.getLogger().debug("Lex (x):",T.yytext),"DIR";case 88:return T.yytext=T.yytext.replace(/^,\s*/,""),A.getLogger().debug("Lex (y):",T.yytext),"DIR";case 89:return T.yytext=T.yytext.replace(/^,\s*/,""),A.getLogger().debug("Lex (up):",T.yytext),"DIR";case 90:return T.yytext=T.yytext.replace(/^,\s*/,""),A.getLogger().debug("Lex (down):",T.yytext),"DIR";case 91:return T.yytext="]>",A.getLogger().debug("Lex (ARROW_DIR end):",T.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return A.getLogger().debug("Lex: LINK","#"+T.yytext+"#"),15;case 93:return A.getLogger().debug("Lex: LINK",T.yytext),15;case 94:return A.getLogger().debug("Lex: LINK",T.yytext),15;case 95:return A.getLogger().debug("Lex: LINK",T.yytext),15;case 96:return A.getLogger().debug("Lex: START_LINK",T.yytext),this.pushState("LLABEL"),16;case 97:return A.getLogger().debug("Lex: START_LINK",T.yytext),this.pushState("LLABEL"),16;case 98:return A.getLogger().debug("Lex: START_LINK",T.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return A.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),A.getLogger().debug("Lex: LINK","#"+T.yytext+"#"),15;case 102:return this.popState(),A.getLogger().debug("Lex: LINK",T.yytext),15;case 103:return this.popState(),A.getLogger().debug("Lex: LINK",T.yytext),15;case 104:return A.getLogger().debug("Lex: COLON",T.yytext),T.yytext=T.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return x}();v.lexer=y;function b(){this.yy={}}return C(b,"Parser"),b.prototype=v,v.Parser=b,new b}();TDe.parser=TDe;var _Xn=TDe,Bg=new Map,SDe=[],CDe=new Map,zjt="color",Ujt="fill",RXn="bgFill",Vjt=",",Yne=new Map,ODe="",DXn=C(t=>jt.sanitizeText(t,He()),"sanitizeText"),LXn=C(function(t,e=""){let r=Yne.get(t);r||(r={id:t,styles:[],textStyles:[]},Yne.set(t,r)),e!=null&&e.split(Vjt).forEach(n=>{const i=n.replace(/([^;]*);/,"$1").trim();if(RegExp(zjt).exec(n)){const s=i.replace(Ujt,RXn).replace(zjt,Ujt);r.textStyles.push(s)}r.styles.push(i)})},"addStyleClass"),MXn=C(function(t,e=""){const r=Bg.get(t);e!=null&&(r.styles=e.split(Vjt))},"addStyle2Node"),IXn=C(function(t,e){t.split(",").forEach(function(r){let n=Bg.get(r);if(n===void 0){const i=r.trim();n={id:i,type:"na",children:[]},Bg.set(i,n)}n.classes||(n.classes=[]),n.classes.push(e)})},"setCssClass"),Qjt=C((t,e)=>{const r=t.flat(),n=[],i=r.find(s=>(s==null?void 0:s.type)==="column-setting"),a=(i==null?void 0:i.columns)??-1;for(const s of r){if(typeof a=="number"&&a>0&&s.type!=="column-setting"&&typeof s.widthInColumns=="number"&&s.widthInColumns>a&&me.warn(`Block ${s.id} width ${s.widthInColumns} exceeds configured column width ${a}`),s.label&&(s.label=DXn(s.label)),s.type==="classDef"){LXn(s.id,s.css);continue}if(s.type==="applyClass"){IXn(s.id,(s==null?void 0:s.styleClass)??"");continue}if(s.type==="applyStyles"){s!=null&&s.stylesStr&&MXn(s.id,s==null?void 0:s.stylesStr);continue}if(s.type==="column-setting")e.columns=s.columns??-1;else if(s.type==="edge"){const o=(CDe.get(s.id)??0)+1;CDe.set(s.id,o),s.id=o+"-"+s.id,SDe.push(s)}else{s.label||(s.type==="composite"?s.label="":s.label=s.id);const o=Bg.get(s.id);if(o===void 0?Bg.set(s.id,s):(s.type!=="na"&&(o.type=s.type),s.label!==s.id&&(o.label=s.label)),s.children&&Qjt(s.children,s),s.type==="space"){const l=s.width??1;for(let u=0;u{me.debug("Clear called"),Aa(),Mz={id:"root",type:"composite",children:[],columns:-1},Bg=new Map([["root",Mz]]),kDe=[],Yne=new Map,SDe=[],CDe=new Map,ODe=""},"clear");function Gjt(t){switch(me.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return me.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}C(Gjt,"typeStr2Type");function Hjt(t){switch(me.debug("typeStr2Type",t),t){case"==":return"thick";default:return"normal"}}C(Hjt,"edgeTypeStr2Type");function Wjt(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}C(Wjt,"edgeStrToEdgeData");function Yjt(t){switch(t.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}C(Yjt,"edgeStrToEdgeStartData");function qjt(t){return t.includes("==")?"thick":"normal"}C(qjt,"edgeStrToThickness");function jjt(t){return t.includes(".-")?"dotted":"solid"}C(jjt,"edgeStrToPattern");var Xjt=0,NXn=C(()=>(Xjt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Xjt),"generateId"),BXn=C(t=>{Mz.children=t,Qjt(t,Mz),kDe=Mz.children},"setHierarchy"),$Xn=C(t=>{const e=Bg.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),FXn=C(()=>[...Bg.values()],"getBlocksFlat"),zXn=C(()=>kDe||[],"getBlocks"),UXn=C(()=>SDe,"getEdges"),VXn=C(t=>Bg.get(t),"getBlock"),QXn=C(t=>{Bg.set(t.id,t)},"setBlock"),GXn=C(t=>{ODe=t},"setDiagramId"),HXn=C(()=>ODe,"getDiagramId"),WXn=C(()=>me,"getLogger"),YXn=C(function(){return Yne},"getClasses"),qXn={getConfig:C(()=>Dr().block,"getConfig"),typeStr2Type:Gjt,edgeTypeStr2Type:Hjt,edgeStrToEdgeData:Wjt,edgeStrToEdgeStartData:Yjt,edgeStrToThickness:qjt,edgeStrToPattern:jjt,getLogger:WXn,getBlocksFlat:FXn,getBlocks:zXn,getEdges:UXn,setHierarchy:BXn,getBlock:VXn,setBlock:QXn,getColumns:$Xn,getClasses:YXn,clear:PXn,generateId:NXn,setDiagramId:GXn,getDiagramId:HXn},jXn=qXn,EDe=C((t,e)=>{const r=Zve,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return tg(n,i,a,e)},"fade"),XXn=C(t=>`.label { +`+A+"^"},"showPosition"),test_match:C(function(w,A){var S,T,O;if(this.options.backtrack_lexer&&(O={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(O.yylloc.range=this.yylloc.range.slice(0))),T=w[0].match(/(?:\r\n?|\n).*/g),T&&(this.yylineno+=T.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:T?T[T.length-1].length-T[T.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+w[0].length},this.yytext+=w[0],this.match+=w[0],this.matches=w,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(w[0].length),this.matched+=w[0],S=this.performAction.call(this,this.yy,this,A,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),S)return S;if(this._backtrack){for(var k in O)this[k]=O[k];return!1}return!1},"test_match"),next:C(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var w,A,S,T;this._more||(this.yytext="",this.match="");for(var O=this._currentRules(),k=0;kA[0].length)){if(A=S,T=k,this.options.backtrack_lexer){if(w=this.test_match(S,O[k]),w!==!1)return w;if(this._backtrack){A=!1;continue}else return!1}else if(!this.options.flex)break}return A?(w=this.test_match(A,O[T]),w!==!1?w:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var A=this.next();return A||this.lex()},"lex"),begin:C(function(A){this.conditionStack.push(A)},"begin"),popState:C(function(){var A=this.conditionStack.length-1;return A>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(A){return A=this.conditionStack.length-1-Math.abs(A||0),A>=0?this.conditionStack[A]:"INITIAL"},"topState"),pushState:C(function(A){this.begin(A)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:C(function(A,S,T,O){switch(T){case 0:return A.getLogger().debug("Found block-beta"),10;case 1:return A.getLogger().debug("Found id-block"),29;case 2:return A.getLogger().debug("Found block"),10;case 3:A.getLogger().debug(".",S.yytext);break;case 4:A.getLogger().debug("_",S.yytext);break;case 5:return 5;case 6:return S.yytext=-1,28;case 7:return S.yytext=S.yytext.replace(/columns\s+/,""),A.getLogger().debug("COLUMNS (LEX)",S.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:A.getLogger().debug("LEX: POPPING STR:",S.yytext),this.popState();break;case 13:return A.getLogger().debug("LEX: STR end:",S.yytext),"STR";case 14:return S.yytext=S.yytext.replace(/space\:/,""),A.getLogger().debug("SPACE NUM (LEX)",S.yytext),21;case 15:return S.yytext="1",A.getLogger().debug("COLUMNS (LEX)",S.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),A.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),A.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),A.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),A.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),A.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),A.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),A.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),A.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),A.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),A.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),A.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),A.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),A.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),A.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),A.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),A.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),A.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return A.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return A.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return A.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return A.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return A.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return A.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return A.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return A.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return A.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return A.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return A.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return A.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),A.getLogger().debug("LEX ARR START"),37;case 74:return A.getLogger().debug("Lex: NODE_ID",S.yytext),31;case 75:return A.getLogger().debug("Lex: EOF",S.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:A.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:A.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return A.getLogger().debug("LEX: NODE_DESCR:",S.yytext),"NODE_DESCR";case 83:A.getLogger().debug("LEX POPPING"),this.popState();break;case 84:A.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return S.yytext=S.yytext.replace(/^,\s*/,""),A.getLogger().debug("Lex (right): dir:",S.yytext),"DIR";case 86:return S.yytext=S.yytext.replace(/^,\s*/,""),A.getLogger().debug("Lex (left):",S.yytext),"DIR";case 87:return S.yytext=S.yytext.replace(/^,\s*/,""),A.getLogger().debug("Lex (x):",S.yytext),"DIR";case 88:return S.yytext=S.yytext.replace(/^,\s*/,""),A.getLogger().debug("Lex (y):",S.yytext),"DIR";case 89:return S.yytext=S.yytext.replace(/^,\s*/,""),A.getLogger().debug("Lex (up):",S.yytext),"DIR";case 90:return S.yytext=S.yytext.replace(/^,\s*/,""),A.getLogger().debug("Lex (down):",S.yytext),"DIR";case 91:return S.yytext="]>",A.getLogger().debug("Lex (ARROW_DIR end):",S.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return A.getLogger().debug("Lex: LINK","#"+S.yytext+"#"),15;case 93:return A.getLogger().debug("Lex: LINK",S.yytext),15;case 94:return A.getLogger().debug("Lex: LINK",S.yytext),15;case 95:return A.getLogger().debug("Lex: LINK",S.yytext),15;case 96:return A.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 97:return A.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 98:return A.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return A.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),A.getLogger().debug("Lex: LINK","#"+S.yytext+"#"),15;case 102:return this.popState(),A.getLogger().debug("Lex: LINK",S.yytext),15;case 103:return this.popState(),A.getLogger().debug("Lex: LINK",S.yytext),15;case 104:return A.getLogger().debug("Lex: COLON",S.yytext),S.yytext=S.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return x}();v.lexer=y;function b(){this.yy={}}return C(b,"Parser"),b.prototype=v,v.Parser=b,new b}();SDe.parser=SDe;var _Xn=SDe,Bg=new Map,TDe=[],CDe=new Map,zjt="color",Ujt="fill",RXn="bgFill",Vjt=",",Yne=new Map,ODe="",DXn=C(t=>jt.sanitizeText(t,He()),"sanitizeText"),LXn=C(function(t,e=""){let r=Yne.get(t);r||(r={id:t,styles:[],textStyles:[]},Yne.set(t,r)),e!=null&&e.split(Vjt).forEach(n=>{const i=n.replace(/([^;]*);/,"$1").trim();if(RegExp(zjt).exec(n)){const s=i.replace(Ujt,RXn).replace(zjt,Ujt);r.textStyles.push(s)}r.styles.push(i)})},"addStyleClass"),MXn=C(function(t,e=""){const r=Bg.get(t);e!=null&&(r.styles=e.split(Vjt))},"addStyle2Node"),IXn=C(function(t,e){t.split(",").forEach(function(r){let n=Bg.get(r);if(n===void 0){const i=r.trim();n={id:i,type:"na",children:[]},Bg.set(i,n)}n.classes||(n.classes=[]),n.classes.push(e)})},"setCssClass"),Qjt=C((t,e)=>{const r=t.flat(),n=[],i=r.find(s=>(s==null?void 0:s.type)==="column-setting"),a=(i==null?void 0:i.columns)??-1;for(const s of r){if(typeof a=="number"&&a>0&&s.type!=="column-setting"&&typeof s.widthInColumns=="number"&&s.widthInColumns>a&&me.warn(`Block ${s.id} width ${s.widthInColumns} exceeds configured column width ${a}`),s.label&&(s.label=DXn(s.label)),s.type==="classDef"){LXn(s.id,s.css);continue}if(s.type==="applyClass"){IXn(s.id,(s==null?void 0:s.styleClass)??"");continue}if(s.type==="applyStyles"){s!=null&&s.stylesStr&&MXn(s.id,s==null?void 0:s.stylesStr);continue}if(s.type==="column-setting")e.columns=s.columns??-1;else if(s.type==="edge"){const o=(CDe.get(s.id)??0)+1;CDe.set(s.id,o),s.id=o+"-"+s.id,TDe.push(s)}else{s.label||(s.type==="composite"?s.label="":s.label=s.id);const o=Bg.get(s.id);if(o===void 0?Bg.set(s.id,s):(s.type!=="na"&&(o.type=s.type),s.label!==s.id&&(o.label=s.label)),s.children&&Qjt(s.children,s),s.type==="space"){const l=s.width??1;for(let u=0;u{me.debug("Clear called"),Aa(),Mz={id:"root",type:"composite",children:[],columns:-1},Bg=new Map([["root",Mz]]),kDe=[],Yne=new Map,TDe=[],CDe=new Map,ODe=""},"clear");function Gjt(t){switch(me.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return me.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}C(Gjt,"typeStr2Type");function Hjt(t){switch(me.debug("typeStr2Type",t),t){case"==":return"thick";default:return"normal"}}C(Hjt,"edgeTypeStr2Type");function Wjt(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}C(Wjt,"edgeStrToEdgeData");function Yjt(t){switch(t.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}C(Yjt,"edgeStrToEdgeStartData");function qjt(t){return t.includes("==")?"thick":"normal"}C(qjt,"edgeStrToThickness");function jjt(t){return t.includes(".-")?"dotted":"solid"}C(jjt,"edgeStrToPattern");var Xjt=0,NXn=C(()=>(Xjt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Xjt),"generateId"),BXn=C(t=>{Mz.children=t,Qjt(t,Mz),kDe=Mz.children},"setHierarchy"),$Xn=C(t=>{const e=Bg.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),FXn=C(()=>[...Bg.values()],"getBlocksFlat"),zXn=C(()=>kDe||[],"getBlocks"),UXn=C(()=>TDe,"getEdges"),VXn=C(t=>Bg.get(t),"getBlock"),QXn=C(t=>{Bg.set(t.id,t)},"setBlock"),GXn=C(t=>{ODe=t},"setDiagramId"),HXn=C(()=>ODe,"getDiagramId"),WXn=C(()=>me,"getLogger"),YXn=C(function(){return Yne},"getClasses"),qXn={getConfig:C(()=>Dr().block,"getConfig"),typeStr2Type:Gjt,edgeTypeStr2Type:Hjt,edgeStrToEdgeData:Wjt,edgeStrToEdgeStartData:Yjt,edgeStrToThickness:qjt,edgeStrToPattern:jjt,getLogger:WXn,getBlocksFlat:FXn,getBlocks:zXn,getEdges:UXn,setHierarchy:BXn,getBlock:VXn,setBlock:QXn,getColumns:$Xn,getClasses:YXn,clear:PXn,generateId:NXn,setDiagramId:GXn,getDiagramId:HXn},jXn=qXn,EDe=C((t,e)=>{const r=Zve,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return tg(n,i,a,e)},"fade"),XXn=C(t=>`.label { font-family: ${t.fontFamily}; color: ${t.nodeTextColor||t.textColor}; } @@ -3544,12 +3544,12 @@ Expecting `+re.join(", ")+", got '"+(this.terminals_[Q]||Q)+"'":ve="Parse error fill: ${t.textColor}; } ${G9()} -`,"getStyles"),KXn=XXn,ZXn=C((t,e,r,n)=>{e.forEach(i=>{lKn[i](t,r,n)})},"insertMarkers"),JXn=C((t,e,r)=>{me.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),eKn=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),tKn=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),rKn=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),nKn=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),iKn=C((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),aKn=C((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),sKn=C((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),oKn=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),lKn={extension:JXn,composition:eKn,aggregation:tKn,dependency:rKn,lollipop:nKn,point:iKn,circle:aKn,cross:sKn,barb:oKn},cKn=ZXn;function _De(t,e){if(t===0||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(t===1)return{px:0,py:e};const r=e%t,n=Math.floor(e/t);return{px:r,py:n}}C(_De,"calculateBlockPosition");var uKn=C(t=>{let e=0,r=0;for(const n of t.children){const{width:i,height:a,x:s,y:o}=n.size??{width:0,height:0,x:0,y:0};if(me.debug("getMaxChildSize abc95 child:",n.id,"width:",i,"height:",a,"x:",s,"y:",o,n.type),n.type==="space")continue;const l=i/(n.widthInColumns??1);l>e&&(e=l),a>r&&(r=a)}return{width:e,height:r}},"getMaxChildSize");function qne(t,e,r=0,n=0,i=8){var o,l,u,h,d,f,p,g,m,v,y;me.debug("setBlockSizes abc95 (start)",t.id,(o=t==null?void 0:t.size)==null?void 0:o.x,"block width =",t==null?void 0:t.size,"siblingWidth",r),(l=t==null?void 0:t.size)!=null&&l.width||(t.size={width:r,height:n,x:0,y:0});let a=0,s=0;if(((u=t.children)==null?void 0:u.length)>0){for(const k of t.children)qne(k,e,0,0,i);const b=uKn(t);a=b.width,s=b.height,me.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",a,s);for(const k of t.children)k.size&&(me.debug(`abc95 Setting size of children of ${t.id} id=${k.id} ${a} ${s} ${JSON.stringify(k.size)}`),k.size.width=a*(k.widthInColumns??1)+i*((k.widthInColumns??1)-1),k.size.height=s,k.size.x=0,k.size.y=0,me.debug(`abc95 updating size of ${t.id} children child:${k.id} maxWidth:${a} maxHeight:${s}`));for(const k of t.children)qne(k,e,a,s,i);const x=t.columns??-1;let w=0;for(const k of t.children)w+=k.widthInColumns??1;let A=t.children.length;x>0&&x0?Math.min(t.children.length,x):t.children.length;if(k>0){const E=(S-k*i-i)/k;me.debug("abc95 (growing to fit) width",t.id,S,(p=t.size)==null?void 0:p.width,E);for(const _ of t.children)_.size&&(_.size.width=E)}}t.size={width:S,height:O,x:0,y:0}}me.debug("setBlockSizes abc94 (done)",t.id,(g=t==null?void 0:t.size)==null?void 0:g.x,(m=t==null?void 0:t.size)==null?void 0:m.width,(v=t==null?void 0:t.size)==null?void 0:v.y,(y=t==null?void 0:t.size)==null?void 0:y.height)}C(qne,"setBlockSizes");function RDe(t,e,r=8){var i,a,s,o,l,u,h,d,f,p,g,m,v,y,b,x,w;me.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${(i=t==null?void 0:t.size)==null?void 0:i.x} y: ${(a=t==null?void 0:t.size)==null?void 0:a.y} width: ${(s=t==null?void 0:t.size)==null?void 0:s.width}`);const n=t.columns??-1;if(me.debug("layoutBlocks columns abc95",t.id,"=>",n,t),t.children&&t.children.length>0){const A=((l=(o=t==null?void 0:t.children[0])==null?void 0:o.size)==null?void 0:l.width)??0,T=t.children.length*A+(t.children.length-1)*r;me.debug("widthOfChildren 88",T,"posX");const S=new Map;{let I=0;for(const L of t.children){if(!L.size)continue;const{py:R}=_De(n,I),D=S.get(R)??0;L.size.height>D&&S.set(R,L.size.height);let M=(L==null?void 0:L.widthInColumns)??1;n>0&&(M=Math.min(M,n-I%n)),I+=M}}const O=new Map;{let I=0;const L=[...S.keys()].sort((R,D)=>R-D);for(const R of L)O.set(R,I),I+=(S.get(R)??0)+r}let k=0;me.debug("abc91 block?.size?.x",t.id,(u=t==null?void 0:t.size)==null?void 0:u.x);let E=(h=t==null?void 0:t.size)!=null&&h.x?((d=t==null?void 0:t.size)==null?void 0:d.x)+(-((f=t==null?void 0:t.size)==null?void 0:f.width)/2||0):-r,_=0;for(const I of t.children){const L=t;if(!I.size)continue;const{width:R,height:D}=I.size,{px:M,py:P}=_De(n,k);if(P!=_&&(_=P,E=(p=t==null?void 0:t.size)!=null&&p.x?((g=t==null?void 0:t.size)==null?void 0:g.x)+(-((m=t==null?void 0:t.size)==null?void 0:m.width)/2||0):-r,me.debug("New row in layout for block",t.id," and child ",I.id,_)),me.debug(`abc89 layout blocks (child) id: ${I.id} Pos: ${k} (px, py) ${M},${P} (${(v=L==null?void 0:L.size)==null?void 0:v.x},${(y=L==null?void 0:L.size)==null?void 0:y.y}) parent: ${L.id} width: ${R}${r}`),L.size){const F=R/2;I.size.x=E+r+F,me.debug(`abc91 layout blocks (calc) px, pyid:${I.id} startingPos=X${E} new startingPosX${I.size.x} ${F} padding=${r} width=${R} halfWidth=${F} => x:${I.size.x} y:${I.size.y} ${I.widthInColumns} (width * (child?.w || 1)) / 2 ${R*((I==null?void 0:I.widthInColumns)??1)/2}`),E=I.size.x+F;const B=O.get(P)??0,V=S.get(P)??D;I.size.y=L.size.y-L.size.height/2+B+V/2+r,me.debug(`abc88 layout blocks (calc) px, pyid:${I.id}startingPosX${E}${r}${F}=>x:${I.size.x}y:${I.size.y}${I.widthInColumns}(width * (child?.w || 1)) / 2${R*((I==null?void 0:I.widthInColumns)??1)/2}`)}I.children&&RDe(I,e,r);let N=(I==null?void 0:I.widthInColumns)??1;n>0&&(N=Math.min(N,n-k%n)),k+=N,me.debug("abc88 columnsPos",I,k)}}me.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${(b=t==null?void 0:t.size)==null?void 0:b.x} y: ${(x=t==null?void 0:t.size)==null?void 0:x.y} width: ${(w=t==null?void 0:t.size)==null?void 0:w.width}`)}C(RDe,"layoutBlocks");function DDe(t,{minX:e,minY:r,maxX:n,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&t.id!=="root"){const{x:a,y:s,width:o,height:l}=t.size;a-o/2n&&(n=a+o/2),s+l/2>i&&(i=s+l/2)}if(t.children)for(const a of t.children)({minX:e,minY:r,maxX:n,maxY:i}=DDe(a,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}C(DDe,"findBounds");function Kjt(t){var u,h;const e=t.getBlock("root");if(!e)return;const r=((h=(u=He())==null?void 0:u.block)==null?void 0:h.padding)??8;qne(e,t,0,0,r),RDe(e,t,r),me.debug("getBlocks",JSON.stringify(e,null,2));const{minX:n,minY:i,maxX:a,maxY:s}=DDe(e),o=s-i,l=a-n;return{x:n,y:i,width:l,height:o}}C(Kjt,"layout");var hKn=C(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=He(),o=Zi(s);return await Zc(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),$g=hKn,dKn=C((t,e,r,n,i)=>{e.arrowTypeStart&&Zjt(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&Zjt(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),fKn={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Zjt=C((t,e,r,n,i,a)=>{const s=fKn[r];if(!s){me.warn(`Unknown arrow type: ${r}`);return}const o=e==="start"?"Start":"End";t.attr(`marker-${e}`,`url(${n}#${i}_${a}-${s}${o})`)},"addEdgeMarker"),LDe={},su={},pKn=C(async(t,e)=>{const r=He(),n=Zi(r),i=t.insert("g").attr("class","edgeLabel"),a=i.insert("g").attr("class","label"),s=e.labelType==="markdown",o=await Zc(t,e.label,{style:e.labelStyle,useHtmlLabels:n,addSvgBackground:s,isNode:!1,markdown:s,width:s?void 0:Number.POSITIVE_INFINITY},r);a.node().appendChild(o);let l=o.getBBox(),u=l;if(n){const d=o.children[0],f=Ot(o);l=d.getBoundingClientRect(),u=l,f.attr("width",l.width),f.attr("height",l.height)}else{const d=Ot(o).select("text").node();d&&typeof d.getBBox=="function"&&(u=d.getBBox())}a.attr("transform",i0(u,n)),LDe[e.id]=i,e.width=l.width,e.height=l.height;let h;if(e.startLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await $g(f,e.startLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],v=Ot(p);g=m.getBoundingClientRect(),v.attr("width",g.width),v.attr("height",g.height)}f.attr("transform",i0(g,n)),su[e.id]||(su[e.id]={}),su[e.id].startLeft=d,Iz(h,e.startLabelLeft)}if(e.startLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await $g(f,e.startLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],v=Ot(p);g=m.getBoundingClientRect(),v.attr("width",g.width),v.attr("height",g.height)}f.attr("transform",i0(g,n)),su[e.id]||(su[e.id]={}),su[e.id].startRight=d,Iz(h,e.startLabelRight)}if(e.endLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await $g(d,e.endLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],v=Ot(p);g=m.getBoundingClientRect(),v.attr("width",g.width),v.attr("height",g.height)}f.attr("transform",i0(g,n)),su[e.id]||(su[e.id]={}),su[e.id].endLeft=d,Iz(h,e.endLabelLeft)}if(e.endLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await $g(d,e.endLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],v=Ot(p);g=m.getBoundingClientRect(),v.attr("width",g.width),v.attr("height",g.height)}f.attr("transform",i0(g,n)),su[e.id]||(su[e.id]={}),su[e.id].endRight=d,Iz(h,e.endLabelRight)}return o},"insertEdgeLabel");function Iz(t,e){Zi(He())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}C(Iz,"setTerminalWidth");var gKn=C((t,e)=>{me.debug("Moving label abc88 ",t.id,t.label,LDe[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=He(),{subGraphTitleTotalMargin:i}=q5(n);if(t.label){const a=LDe[t.id];let s=t.x,o=t.y;if(r){const l=ln.calcLabelPosition(r);me.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t.startLabelLeft){const a=su[t.id].startLeft;let s=t.x,o=t.y;if(r){const l=ln.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=su[t.id].startRight;let s=t.x,o=t.y;if(r){const l=ln.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=su[t.id].endLeft;let s=t.x,o=t.y;if(r){const l=ln.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=su[t.id].endRight;let s=t.x,o=t.y;if(r){const l=ln.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),mKn=C((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),vKn=C((t,e,r)=>{me.debug(`intersection calc abc89: +`,"getStyles"),KXn=XXn,ZXn=C((t,e,r,n)=>{e.forEach(i=>{lKn[i](t,r,n)})},"insertMarkers"),JXn=C((t,e,r)=>{me.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),eKn=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),tKn=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),rKn=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),nKn=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),iKn=C((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),aKn=C((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),sKn=C((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),oKn=C((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),lKn={extension:JXn,composition:eKn,aggregation:tKn,dependency:rKn,lollipop:nKn,point:iKn,circle:aKn,cross:sKn,barb:oKn},cKn=ZXn;function _De(t,e){if(t===0||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(t===1)return{px:0,py:e};const r=e%t,n=Math.floor(e/t);return{px:r,py:n}}C(_De,"calculateBlockPosition");var uKn=C(t=>{let e=0,r=0;for(const n of t.children){const{width:i,height:a,x:s,y:o}=n.size??{width:0,height:0,x:0,y:0};if(me.debug("getMaxChildSize abc95 child:",n.id,"width:",i,"height:",a,"x:",s,"y:",o,n.type),n.type==="space")continue;const l=i/(n.widthInColumns??1);l>e&&(e=l),a>r&&(r=a)}return{width:e,height:r}},"getMaxChildSize");function qne(t,e,r=0,n=0,i=8){var o,l,u,h,d,f,p,g,m,v,y;me.debug("setBlockSizes abc95 (start)",t.id,(o=t==null?void 0:t.size)==null?void 0:o.x,"block width =",t==null?void 0:t.size,"siblingWidth",r),(l=t==null?void 0:t.size)!=null&&l.width||(t.size={width:r,height:n,x:0,y:0});let a=0,s=0;if(((u=t.children)==null?void 0:u.length)>0){for(const k of t.children)qne(k,e,0,0,i);const b=uKn(t);a=b.width,s=b.height,me.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",a,s);for(const k of t.children)k.size&&(me.debug(`abc95 Setting size of children of ${t.id} id=${k.id} ${a} ${s} ${JSON.stringify(k.size)}`),k.size.width=a*(k.widthInColumns??1)+i*((k.widthInColumns??1)-1),k.size.height=s,k.size.x=0,k.size.y=0,me.debug(`abc95 updating size of ${t.id} children child:${k.id} maxWidth:${a} maxHeight:${s}`));for(const k of t.children)qne(k,e,a,s,i);const x=t.columns??-1;let w=0;for(const k of t.children)w+=k.widthInColumns??1;let A=t.children.length;x>0&&x0?Math.min(t.children.length,x):t.children.length;if(k>0){const E=(T-k*i-i)/k;me.debug("abc95 (growing to fit) width",t.id,T,(p=t.size)==null?void 0:p.width,E);for(const _ of t.children)_.size&&(_.size.width=E)}}t.size={width:T,height:O,x:0,y:0}}me.debug("setBlockSizes abc94 (done)",t.id,(g=t==null?void 0:t.size)==null?void 0:g.x,(m=t==null?void 0:t.size)==null?void 0:m.width,(v=t==null?void 0:t.size)==null?void 0:v.y,(y=t==null?void 0:t.size)==null?void 0:y.height)}C(qne,"setBlockSizes");function RDe(t,e,r=8){var i,a,s,o,l,u,h,d,f,p,g,m,v,y,b,x,w;me.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${(i=t==null?void 0:t.size)==null?void 0:i.x} y: ${(a=t==null?void 0:t.size)==null?void 0:a.y} width: ${(s=t==null?void 0:t.size)==null?void 0:s.width}`);const n=t.columns??-1;if(me.debug("layoutBlocks columns abc95",t.id,"=>",n,t),t.children&&t.children.length>0){const A=((l=(o=t==null?void 0:t.children[0])==null?void 0:o.size)==null?void 0:l.width)??0,S=t.children.length*A+(t.children.length-1)*r;me.debug("widthOfChildren 88",S,"posX");const T=new Map;{let I=0;for(const L of t.children){if(!L.size)continue;const{py:R}=_De(n,I),D=T.get(R)??0;L.size.height>D&&T.set(R,L.size.height);let M=(L==null?void 0:L.widthInColumns)??1;n>0&&(M=Math.min(M,n-I%n)),I+=M}}const O=new Map;{let I=0;const L=[...T.keys()].sort((R,D)=>R-D);for(const R of L)O.set(R,I),I+=(T.get(R)??0)+r}let k=0;me.debug("abc91 block?.size?.x",t.id,(u=t==null?void 0:t.size)==null?void 0:u.x);let E=(h=t==null?void 0:t.size)!=null&&h.x?((d=t==null?void 0:t.size)==null?void 0:d.x)+(-((f=t==null?void 0:t.size)==null?void 0:f.width)/2||0):-r,_=0;for(const I of t.children){const L=t;if(!I.size)continue;const{width:R,height:D}=I.size,{px:M,py:P}=_De(n,k);if(P!=_&&(_=P,E=(p=t==null?void 0:t.size)!=null&&p.x?((g=t==null?void 0:t.size)==null?void 0:g.x)+(-((m=t==null?void 0:t.size)==null?void 0:m.width)/2||0):-r,me.debug("New row in layout for block",t.id," and child ",I.id,_)),me.debug(`abc89 layout blocks (child) id: ${I.id} Pos: ${k} (px, py) ${M},${P} (${(v=L==null?void 0:L.size)==null?void 0:v.x},${(y=L==null?void 0:L.size)==null?void 0:y.y}) parent: ${L.id} width: ${R}${r}`),L.size){const F=R/2;I.size.x=E+r+F,me.debug(`abc91 layout blocks (calc) px, pyid:${I.id} startingPos=X${E} new startingPosX${I.size.x} ${F} padding=${r} width=${R} halfWidth=${F} => x:${I.size.x} y:${I.size.y} ${I.widthInColumns} (width * (child?.w || 1)) / 2 ${R*((I==null?void 0:I.widthInColumns)??1)/2}`),E=I.size.x+F;const B=O.get(P)??0,V=T.get(P)??D;I.size.y=L.size.y-L.size.height/2+B+V/2+r,me.debug(`abc88 layout blocks (calc) px, pyid:${I.id}startingPosX${E}${r}${F}=>x:${I.size.x}y:${I.size.y}${I.widthInColumns}(width * (child?.w || 1)) / 2${R*((I==null?void 0:I.widthInColumns)??1)/2}`)}I.children&&RDe(I,e,r);let N=(I==null?void 0:I.widthInColumns)??1;n>0&&(N=Math.min(N,n-k%n)),k+=N,me.debug("abc88 columnsPos",I,k)}}me.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${(b=t==null?void 0:t.size)==null?void 0:b.x} y: ${(x=t==null?void 0:t.size)==null?void 0:x.y} width: ${(w=t==null?void 0:t.size)==null?void 0:w.width}`)}C(RDe,"layoutBlocks");function DDe(t,{minX:e,minY:r,maxX:n,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&t.id!=="root"){const{x:a,y:s,width:o,height:l}=t.size;a-o/2n&&(n=a+o/2),s+l/2>i&&(i=s+l/2)}if(t.children)for(const a of t.children)({minX:e,minY:r,maxX:n,maxY:i}=DDe(a,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}C(DDe,"findBounds");function Kjt(t){var u,h;const e=t.getBlock("root");if(!e)return;const r=((h=(u=He())==null?void 0:u.block)==null?void 0:h.padding)??8;qne(e,t,0,0,r),RDe(e,t,r),me.debug("getBlocks",JSON.stringify(e,null,2));const{minX:n,minY:i,maxX:a,maxY:s}=DDe(e),o=s-i,l=a-n;return{x:n,y:i,width:l,height:o}}C(Kjt,"layout");var hKn=C(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=He(),o=Zi(s);return await Zc(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),$g=hKn,dKn=C((t,e,r,n,i)=>{e.arrowTypeStart&&Zjt(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&Zjt(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),fKn={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Zjt=C((t,e,r,n,i,a)=>{const s=fKn[r];if(!s){me.warn(`Unknown arrow type: ${r}`);return}const o=e==="start"?"Start":"End";t.attr(`marker-${e}`,`url(${n}#${i}_${a}-${s}${o})`)},"addEdgeMarker"),LDe={},su={},pKn=C(async(t,e)=>{const r=He(),n=Zi(r),i=t.insert("g").attr("class","edgeLabel"),a=i.insert("g").attr("class","label"),s=e.labelType==="markdown",o=await Zc(t,e.label,{style:e.labelStyle,useHtmlLabels:n,addSvgBackground:s,isNode:!1,markdown:s,width:s?void 0:Number.POSITIVE_INFINITY},r);a.node().appendChild(o);let l=o.getBBox(),u=l;if(n){const d=o.children[0],f=Ot(o);l=d.getBoundingClientRect(),u=l,f.attr("width",l.width),f.attr("height",l.height)}else{const d=Ot(o).select("text").node();d&&typeof d.getBBox=="function"&&(u=d.getBBox())}a.attr("transform",i0(u,n)),LDe[e.id]=i,e.width=l.width,e.height=l.height;let h;if(e.startLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await $g(f,e.startLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],v=Ot(p);g=m.getBoundingClientRect(),v.attr("width",g.width),v.attr("height",g.height)}f.attr("transform",i0(g,n)),su[e.id]||(su[e.id]={}),su[e.id].startLeft=d,Iz(h,e.startLabelLeft)}if(e.startLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await $g(f,e.startLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],v=Ot(p);g=m.getBoundingClientRect(),v.attr("width",g.width),v.attr("height",g.height)}f.attr("transform",i0(g,n)),su[e.id]||(su[e.id]={}),su[e.id].startRight=d,Iz(h,e.startLabelRight)}if(e.endLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await $g(d,e.endLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],v=Ot(p);g=m.getBoundingClientRect(),v.attr("width",g.width),v.attr("height",g.height)}f.attr("transform",i0(g,n)),su[e.id]||(su[e.id]={}),su[e.id].endLeft=d,Iz(h,e.endLabelLeft)}if(e.endLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await $g(d,e.endLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],v=Ot(p);g=m.getBoundingClientRect(),v.attr("width",g.width),v.attr("height",g.height)}f.attr("transform",i0(g,n)),su[e.id]||(su[e.id]={}),su[e.id].endRight=d,Iz(h,e.endLabelRight)}return o},"insertEdgeLabel");function Iz(t,e){Zi(He())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}C(Iz,"setTerminalWidth");var gKn=C((t,e)=>{me.debug("Moving label abc88 ",t.id,t.label,LDe[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=He(),{subGraphTitleTotalMargin:i}=q5(n);if(t.label){const a=LDe[t.id];let s=t.x,o=t.y;if(r){const l=ln.calcLabelPosition(r);me.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t.startLabelLeft){const a=su[t.id].startLeft;let s=t.x,o=t.y;if(r){const l=ln.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=su[t.id].startRight;let s=t.x,o=t.y;if(r){const l=ln.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=su[t.id].endLeft;let s=t.x,o=t.y;if(r){const l=ln.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=su[t.id].endRight;let s=t.x,o=t.y;if(r){const l=ln.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),mKn=C((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),vKn=C((t,e,r)=>{me.debug(`intersection calc abc89: outsidePoint: ${JSON.stringify(e)} insidePoint : ${JSON.stringify(r)} - node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{me.debug("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(!mKn(e,a)&&!i){const s=vKn(e,n,a);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)||r.push(s),i=!0}else n=a,i||r.push(a)}),r},"cutPathAtIntersect"),yKn=C(function(t,e,r,n,i,a,s){let o=r.points;me.debug("abc88 InsertEdge: edge=",r,"e=",e);let l=!1;const u=a.node(e.v);var h=a.node(e.w);h!=null&&h.intersect&&(u!=null&&u.intersect)&&(o=o.slice(1,r.points.length-1),o.unshift(u.intersect(o[0])),o.push(h.intersect(o[o.length-1]))),r.toCluster&&(me.debug("to cluster abc88",n[r.toCluster]),o=Jjt(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(me.debug("from cluster abc88",n[r.fromCluster]),o=Jjt(o.reverse(),n[r.fromCluster].node).reverse(),l=!0);const d=o.filter(w=>!Number.isNaN(w.y));let f=n7;r.curve&&(i==="graph"||i==="flowchart")&&(f=r.curve);const{x:p,y:g}=Bxt(r),m=r7().x(p).y(g).curve(f);let v;switch(r.thickness){case"normal":v="edge-thickness-normal";break;case"thick":v="edge-thickness-thick";break;case"invisible":v="edge-thickness-thick";break;default:v=""}switch(r.pattern){case"solid":v+=" edge-pattern-solid";break;case"dotted":v+=" edge-pattern-dotted";break;case"dashed":v+=" edge-pattern-dashed";break}const y=t.append("path").attr("d",m(d)).attr("id",r.id).attr("class"," "+v+(r.classes?" "+r.classes:"")).attr("style",r.style);let b="";(He().flowchart.arrowMarkerAbsolute||He().state.arrowMarkerAbsolute)&&(b=Eq(!0)),dKn(y,r,b,s,i);let x={};return l&&(x.updatedPath=o),x.originalPath=r.points,x},"insertEdge"),bKn=C(t=>{const e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r);break}return e},"expandAndDeduplicateDirections"),xKn=C((t,e,r,n)=>{const i=bKn(t),a=2,s=e.height+2*r.padding,o=s/a,l=n??e.width+2*o+r.padding,u=r.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:o,y:0},{x:l/2,y:2*u},{x:l-o,y:0},{x:l,y:0},{x:l,y:-s/3},{x:l+2*u,y:-s/2},{x:l,y:-2*s/3},{x:l,y:-s},{x:l-o,y:-s},{x:l/2,y:-s-2*u},{x:o,y:-s},{x:0,y:-s},{x:0,y:-2*s/3},{x:-2*u,y:-s/2},{x:0,y:-s/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:o,y:0},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:o,y:-s},{x:0,y:-s/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:o,y:-s},{x:l-o,y:-s},{x:l,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:l,y:-o},{x:l,y:-s+o},{x:0,y:-s}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:l,y:0},{x:0,y:-o},{x:0,y:-s+o},{x:l,y:-s}]:i.has("right")&&i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s},{x:0,y:-s/2}]:i.has("up")&&i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-s+u},{x:0,y:-s+u},{x:l/2,y:-s},{x:l,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u},{x:l,y:-u}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:l,y:-o},{x:0,y:-s}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-s}]:i.has("left")&&i.has("up")?[{x:l,y:0},{x:0,y:-o},{x:l,y:-s}]:i.has("left")&&i.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-s}]:i.has("right")?[{x:o,y:-u},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s+u}]:i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s},{x:0,y:-s/2}]:i.has("up")?[{x:o,y:-u},{x:o,y:-s+u},{x:0,y:-s+u},{x:l/2,y:-s},{x:l,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u}]:i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u},{x:l,y:-u}]:[{x:0,y:0}]},"getArrowPoints");function eXt(t,e){return t.intersect(e)}C(eXt,"intersectNode");var wKn=eXt;function tXt(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x0}C(MDe,"sameSign");var TKn=iXt,SKn=aXt;function aXt(t,e,r){var n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(g){s=Math.min(s,g.x),o=Math.min(o,g.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));for(var l=n-t.width/2-s,u=i-t.height/2-o,h=0;h1&&a.sort(function(g,m){var v=g.x-r.x,y=g.y-r.y,b=Math.sqrt(v*v+y*y),x=m.x-r.x,w=m.y-r.y,A=Math.sqrt(x*x+w*w);return b{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),OKn=CKn,ys={node:wKn,circle:AKn,ellipse:rXt,polygon:SKn,rect:OKn},Ql=C(async(t,e,r,n)=>{const i=He();let a;const s=e.useHtmlLabels||Zi(i);r?a=r:a="node default";const o=t.insert("g").attr("class",a).attr("id",e.domId||e.id),l=o.insert("g").attr("class","label").attr("style",e.labelStyle);let u;e.labelText===void 0?u="":u=typeof e.labelText=="string"?e.labelText:e.labelText[0];let h;e.labelType==="markdown"?h=Zc(l,ai($y(u),i),{useHtmlLabels:s,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):h=await $g(l,ai($y(u),i),e.labelStyle,!1,n);let d=h.getBBox();const f=e.padding/2;if(Zi(i)){const p=h.children[0],g=Ot(h);await J1e(p,u),d=p.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}return s?l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):l.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:o,bbox:d,halfPadding:f,label:l}},"labelHelper"),Xs=C((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function Fg(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}C(Fg,"insertPolygonShape");var kKn=C(async(t,e)=>{e.useHtmlLabels||Zi(He())||(e.centerLabel=!0);const{shapeSvg:n,bbox:i,halfPadding:a}=await Ql(t,e,"node "+e.classes,!0);me.info("Classes = ",e.classes);const s=n.insert("rect",":first-child");return s.attr("rx",e.rx).attr("ry",e.ry).attr("x",-i.width/2-a).attr("y",-i.height/2-a).attr("width",i.width+e.padding).attr("height",i.height+e.padding),Xs(e,s),e.intersect=function(o){return ys.rect(e,o)},n},"note"),EKn=kKn,sXt=C(t=>t?" "+t:"","formatClass"),hf=C((t,e)=>`${e||"node default"}${sXt(t.classes)} ${sXt(t.class)}`,"getClassesFromNode"),oXt=C(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ql(t,e,hf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=i+a,o=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}];me.info("Question main (Circle)");const l=Fg(r,s,s,o);return l.attr("style",e.style),Xs(e,l),e.intersect=function(u){return me.warn("Intersect called"),ys.polygon(e,o,u)},r},"question"),_Kn=C((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=28,i=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}];return r.insert("polygon",":first-child").attr("points",i.map(function(s){return s.x+","+s.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(s){return ys.circle(e,14,s)},r},"choice"),RKn=C(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ql(t,e,hf(e,void 0),!0),i=4,a=e.positioned?e.height:n.height+e.padding,s=a/i,o=e.positioned?e.width:n.width+2*s+e.padding,l=[{x:s,y:0},{x:o-s,y:0},{x:o,y:-a/2},{x:o-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}],u=Fg(r,o,a,l);return u.attr("style",e.style),Xs(e,u),e.intersect=function(h){return ys.polygon(e,l,h)},r},"hexagon"),DKn=C(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ql(t,e,void 0,!0),i=2,a=n.height+2*e.padding,s=a/i,o=n.width+2*s+e.padding,u=e.positioned&&(e.widthInColumns??1)>1&&e.width>o?e.width:o,h=xKn(e.directions,n,e,u),d=Fg(r,u,a,h);return d.attr("style",e.style),Xs(e,d),e.intersect=function(f){return ys.polygon(e,h,f)},r},"block_arrow"),LKn=C(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ql(t,e,hf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-a/2,y:0},{x:i,y:0},{x:i,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}];return Fg(r,i,a,s).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(l){return ys.polygon(e,s,l)},r},"rect_left_inv_arrow"),MKn=C(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ql(t,e,hf(e),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:a/6,y:-a}],o=Fg(r,i,a,s);return o.attr("style",e.style),Xs(e,o),e.intersect=function(l){return ys.polygon(e,s,l)},r},"lean_right"),IKn=C(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ql(t,e,hf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:2*a/6,y:0},{x:i+a/6,y:0},{x:i-2*a/6,y:-a},{x:-a/6,y:-a}],o=Fg(r,i,a,s);return o.attr("style",e.style),Xs(e,o),e.intersect=function(l){return ys.polygon(e,s,l)},r},"lean_left"),PKn=C(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ql(t,e,hf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i+2*a/6,y:0},{x:i-a/6,y:-a},{x:a/6,y:-a}],o=Fg(r,i,a,s);return o.attr("style",e.style),Xs(e,o),e.intersect=function(l){return ys.polygon(e,s,l)},r},"trapezoid"),NKn=C(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ql(t,e,hf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:-2*a/6,y:-a}],o=Fg(r,i,a,s);return o.attr("style",e.style),Xs(e,o),e.intersect=function(l){return ys.polygon(e,s,l)},r},"inv_trapezoid"),BKn=C(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ql(t,e,hf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i+a/2,y:0},{x:i,y:-a/2},{x:i+a/2,y:-a},{x:0,y:-a}],o=Fg(r,i,a,s);return o.attr("style",e.style),Xs(e,o),e.intersect=function(l){return ys.polygon(e,s,l)},r},"rect_right_inv_arrow"),$Kn=C(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ql(t,e,hf(e,void 0),!0),i=n.width+e.padding,a=i/2,s=a/(2.5+i/50),o=n.height+s+e.padding,l="M 0,"+s+" a "+a+","+s+" 0,0,0 "+i+" 0 a "+a+","+s+" 0,0,0 "+-i+" 0 l 0,"+o+" a "+a+","+s+" 0,0,0 "+i+" 0 l 0,"+-o,u=r.attr("label-offset-y",s).insert("path",":first-child").attr("style",e.style).attr("d",l).attr("transform","translate("+-i/2+","+-(o/2+s)+")");return Xs(e,u),e.intersect=function(h){const d=ys.rect(e,h),f=d.x-e.x;if(a!=0&&(Math.abs(f)e.height/2-s)){let p=s*s*(1-f*f/(a*a));p!=0&&(p=Math.sqrt(p)),p=s-p,h.y-e.y>0&&(p=-p),d.y+=p}return d},r},"cylinder"),FKn=C(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Ql(t,e,"node "+e.classes+" "+e.class,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(a.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(jne(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{me.warn(`Unknown node property ${d}`)})}return Xs(e,a),e.intersect=function(h){return ys.rect(e,h)},r},"rect"),zKn=C(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Ql(t,e,"node "+e.classes,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(a.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(jne(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{me.warn(`Unknown node property ${d}`)})}return Xs(e,a),e.intersect=function(h){return ys.rect(e,h)},r},"composite"),UKn=C(async(t,e)=>{const{shapeSvg:r}=await Ql(t,e,"label",!0);me.trace("Classes = ",e.class);const n=r.insert("rect",":first-child"),i=0,a=0;if(n.attr("width",i).attr("height",a),r.attr("class","label edgeLabel"),e.props){const s=new Set(Object.keys(e.props));e.props.borders&&(jne(n,e.props.borders,i,a),s.delete("borders")),s.forEach(o=>{me.warn(`Unknown node property ${o}`)})}return Xs(e,n),e.intersect=function(s){return ys.rect(e,s)},r},"labelRect");function jne(t,e,r,n){const i=[],a=C(o=>{i.push(o,0)},"addBorder"),s=C(o=>{i.push(0,o)},"skipBorder");e.includes("t")?(me.debug("add top border"),a(r)):s(r),e.includes("r")?(me.debug("add right border"),a(n)):s(n),e.includes("b")?(me.debug("add bottom border"),a(r)):s(r),e.includes("l")?(me.debug("add left border"),a(n)):s(n),t.attr("stroke-dasharray",i.join(" "))}C(jne,"applyNodePropertyBorders");var VKn=C(async(t,e)=>{let r;e.classes?r="node "+e.classes:r="node default";const n=t.insert("g").attr("class",r).attr("id",e.domId||e.id),i=n.insert("rect",":first-child"),a=n.insert("line"),s=n.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let l="";typeof o=="object"?l=o[0]:l=o,me.info("Label text abc79",l,o,typeof o=="object");const u=await $g(s,l,e.labelStyle,!0,!0);let h={width:0,height:0};if(Zi(He())){const m=u.children[0],v=Ot(u);h=m.getBoundingClientRect(),v.attr("width",h.width),v.attr("height",h.height)}me.info("Text 2",o);const d=o.slice(1,o.length);let f=u.getBBox();const p=await $g(s,d.join?d.join("
"):d,e.labelStyle,!0,!0);if(Zi(He())){const m=p.children[0],v=Ot(p);h=m.getBoundingClientRect(),v.attr("width",h.width),v.attr("height",h.height)}const g=e.padding/2;return Ot(p).attr("transform","translate( "+(h.width>f.width?0:(f.width-h.width)/2)+", "+(f.height+g+5)+")"),Ot(u).attr("transform","translate( "+(h.width{const{shapeSvg:r,bbox:n}=await Ql(t,e,hf(e,void 0),!0),i=n.height+e.padding,a=n.width+i/4+e.padding,s=r.insert("rect",":first-child").attr("style",e.style).attr("rx",i/2).attr("ry",i/2).attr("x",-a/2).attr("y",-i/2).attr("width",a).attr("height",i);return Xs(e,s),e.intersect=function(o){return ys.rect(e,o)},r},"stadium"),GKn=C(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Ql(t,e,hf(e,void 0),!0),a=r.insert("circle",":first-child");return a.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),me.info("Circle main"),Xs(e,a),e.intersect=function(s){return me.info("Circle intersect",e,n.width/2+i,s),ys.circle(e,n.width/2+i,s)},r},"circle"),HKn=C(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Ql(t,e,hf(e,void 0),!0),a=5,s=r.insert("g",":first-child"),o=s.insert("circle"),l=s.insert("circle");return s.attr("class",e.class),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i+a).attr("width",n.width+e.padding+a*2).attr("height",n.height+e.padding+a*2),l.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),me.info("DoubleCircle main"),Xs(e,o),e.intersect=function(u){return me.info("DoubleCircle intersect",e,n.width/2+i+a,u),ys.circle(e,n.width/2+i+a,u)},r},"doublecircle"),WKn=C(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ql(t,e,hf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i,y:0},{x:i,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],o=Fg(r,i,a,s);return o.attr("style",e.style),Xs(e,o),e.intersect=function(l){return ys.polygon(e,s,l)},r},"subroutine"),YKn=C((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),Xs(e,n),e.intersect=function(i){return ys.circle(e,7,i)},r},"start"),lXt=C((t,e,r)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let i=70,a=10;r==="LR"&&(i=10,a=70);const s=n.append("rect").attr("x",-1*i/2).attr("y",-1*a/2).attr("width",i).attr("height",a).attr("class","fork-join");return Xs(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(o){return ys.rect(e,o)},n},"forkJoin"),qKn=C((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child"),i=r.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),n.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),Xs(e,i),e.intersect=function(a){return ys.circle(e,7,a)},r},"end"),jKn=C(async(t,e)=>{var O;const r=e.padding/2,n=4,i=8;let a;e.classes?a="node "+e.classes:a="node default";const s=t.insert("g").attr("class",a).attr("id",e.domId||e.id),o=s.insert("rect",":first-child"),l=s.insert("line"),u=s.insert("line");let h=0,d=n;const f=s.insert("g").attr("class","label");let p=0;const g=(O=e.classData.annotations)==null?void 0:O[0],m=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",v=await $g(f,m,e.labelStyle,!0,!0);let y=v.getBBox();if(Zi(He())){const k=v.children[0],E=Ot(v);y=k.getBoundingClientRect(),E.attr("width",y.width),E.attr("height",y.height)}e.classData.annotations[0]&&(d+=y.height+n,h+=y.width);let b=e.classData.label;e.classData.type!==void 0&&e.classData.type!==""&&(Zi(He())?b+="<"+e.classData.type+">":b+="<"+e.classData.type+">");const x=await $g(f,b,e.labelStyle,!0,!0);Ot(x).attr("class","classTitle");let w=x.getBBox();if(Zi(He())){const k=x.children[0],E=Ot(x);w=k.getBoundingClientRect(),E.attr("width",w.width),E.attr("height",w.height)}d+=w.height+n,w.width>h&&(h=w.width);const A=[];e.classData.members.forEach(async k=>{const E=k.getDisplayDetails();let _=E.displayText;Zi(He())&&(_=_.replace(//g,">"));const I=await $g(f,_,E.cssStyle?E.cssStyle:e.labelStyle,!0,!0);let L=I.getBBox();if(Zi(He())){const R=I.children[0],D=Ot(I);L=R.getBoundingClientRect(),D.attr("width",L.width),D.attr("height",L.height)}L.width>h&&(h=L.width),d+=L.height+n,A.push(I)}),d+=i;const T=[];if(e.classData.methods.forEach(async k=>{const E=k.getDisplayDetails();let _=E.displayText;Zi(He())&&(_=_.replace(//g,">"));const I=await $g(f,_,E.cssStyle?E.cssStyle:e.labelStyle,!0,!0);let L=I.getBBox();if(Zi(He())){const R=I.children[0],D=Ot(I);L=R.getBoundingClientRect(),D.attr("width",L.width),D.attr("height",L.height)}L.width>h&&(h=L.width),d+=L.height+n,T.push(I)}),d+=i,g){let k=(h-y.width)/2;Ot(v).attr("transform","translate( "+(-1*h/2+k)+", "+-1*d/2+")"),p=y.height+n}let S=(h-w.width)/2;return Ot(x).attr("transform","translate( "+(-1*h/2+S)+", "+(-1*d/2+p)+")"),p+=w.height+n,l.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,A.forEach(k=>{Ot(k).attr("transform","translate( "+-h/2+", "+(-1*d/2+p+i/2)+")");const E=k==null?void 0:k.getBBox();p+=((E==null?void 0:E.height)??0)+n}),p+=i,u.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,T.forEach(k=>{Ot(k).attr("transform","translate( "+-h/2+", "+(-1*d/2+p)+")");const E=k==null?void 0:k.getBBox();p+=((E==null?void 0:E.height)??0)+n}),o.attr("style",e.style).attr("class","outer title-state").attr("x",-h/2-r).attr("y",-(d/2)-r).attr("width",h+e.padding).attr("height",d+e.padding),Xs(e,o),e.intersect=function(k){return ys.rect(e,k)},s},"class_box"),cXt={rhombus:oXt,composite:zKn,question:oXt,rect:FKn,labelRect:UKn,rectWithTitle:VKn,choice:_Kn,circle:GKn,doublecircle:HKn,stadium:QKn,hexagon:RKn,block_arrow:DKn,rect_left_inv_arrow:LKn,lean_right:MKn,lean_left:IKn,trapezoid:PKn,inv_trapezoid:NKn,rect_right_inv_arrow:BKn,cylinder:$Kn,start:YKn,end:qKn,note:EKn,subroutine:WKn,fork:lXt,join:lXt,class_box:jKn},Xne={},uXt=C(async(t,e,r)=>{let n,i;if(e.link){let a;He().securityLevel==="sandbox"?a="_top":e.linkTarget&&(a=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",a),i=await cXt[e.shape](n,e,r)}else i=await cXt[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),Xne[e.id]=n,e.haveCallback&&Xne[e.id].attr("class",Xne[e.id].attr("class")+" clickable"),n},"insertNode"),XKn=C(t=>{const e=Xne[t.id];me.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode");function IDe(t,e,r=!1){var p,g,m;const n=t;let i="default";(((p=n==null?void 0:n.classes)==null?void 0:p.length)||0)>0&&(i=((n==null?void 0:n.classes)??[]).join(" ")),i=i+" flowchart-label";let a=0,s="",o;switch(n.type){case"round":a=5,s="rect";break;case"composite":a=0,s="composite",o=0;break;case"square":s="rect";break;case"diamond":s="question";break;case"hexagon":s="hexagon";break;case"block_arrow":s="block_arrow";break;case"odd":s="rect_left_inv_arrow";break;case"lean_right":s="lean_right";break;case"lean_left":s="lean_left";break;case"trapezoid":s="trapezoid";break;case"inv_trapezoid":s="inv_trapezoid";break;case"rect_left_inv_arrow":s="rect_left_inv_arrow";break;case"circle":s="circle";break;case"ellipse":s="ellipse";break;case"stadium":s="stadium";break;case"subroutine":s="subroutine";break;case"cylinder":s="cylinder";break;case"group":s="rect";break;case"doublecircle":s="doublecircle";break;default:s="rect"}const l=K1e((n==null?void 0:n.styles)??[]),u=n.label,h=n.size??{width:0,height:0,x:0,y:0},d=e.getDiagramId();return{labelStyle:l.labelStyle,shape:s,labelText:u,rx:a,ry:a,class:i,style:l.style,id:n.id,domId:d?`${d}-${n.id}`:n.id,directions:n.directions,width:h.width,height:h.height,x:h.x,y:h.y,positioned:r,intersect:void 0,type:n.type,padding:o??((m=(g=Dr())==null?void 0:g.block)==null?void 0:m.padding)??0,widthInColumns:n.widthInColumns??1}}C(IDe,"getNodeFromBlock");async function hXt(t,e,r){const n=IDe(e,r,!1);if(n.type==="group")return;const i=Dr(),a=await uXt(t,n,{config:i}),s=a.node().getBBox(),o=r.getBlock(n.id);o.size={width:s.width,height:s.height,x:0,y:0,node:a},r.setBlock(o),a.remove()}C(hXt,"calculateBlockSize");async function dXt(t,e,r){const n=IDe(e,r,!0);if(r.getBlock(n.id).type!=="space"){const a=Dr();await uXt(t,n,{config:a}),e.intersect=n==null?void 0:n.intersect,XKn(n)}}C(dXt,"insertBlockPositioned");async function Kne(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await Kne(t,i.children,r,n)}C(Kne,"performOperations");async function fXt(t,e,r){await Kne(t,e,r,hXt)}C(fXt,"calculateBlockSizes");async function pXt(t,e,r){await Kne(t,e,r,dXt)}C(pXt,"insertBlocks");async function gXt(t,e,r,n,i){const a=new ru({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const s of r)s.size&&a.setNode(s.id,{width:s.size.width,height:s.size.height,intersect:s.intersect});for(const s of e)if(s.start&&s.end){const o=n.getBlock(s.start),l=n.getBlock(s.end);if(o!=null&&o.size&&(l!=null&&l.size)){const u=o.size,h=l.size,d=[{x:u.x,y:u.y},{x:u.x+(h.x-u.x)/2,y:u.y+(h.y-u.y)/2},{x:h.x,y:h.y}],f=i?`${i}-${s.id}`:s.id,p=s.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",g=s.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",m=`${p} ${g} flowchart-link LS-a1 LE-b1`;yKn(t,{v:s.start,w:s.end,name:f},{...s,id:f,arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m},void 0,"block",a,i),s.label&&(await pKn(t,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m}),gKn({...s,x:d[1].x,y:d[1].y},{originalPath:d}))}}}C(gXt,"insertEdges");var KKn=C(function(t,e){return e.db.getClasses()},"getClasses"),ZKn=C(async function(t,e,r,n){const{securityLevel:i,block:a}=Dr(),s=n.db;s.setDiagramId(e);let o;i==="sandbox"&&(o=Ot("#i"+e));const l=Ot(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):Ot(`[id="${e}"]`);cKn(u,["point","circle","cross"],n.type,e);const d=s.getBlocks(),f=s.getBlocksFlat(),p=s.getEdges(),g=u.insert("g").attr("class","block");await fXt(g,d,s);const m=Kjt(s);if(await pXt(g,d,s),await gXt(g,p,f,s,e),m){const v=m,y=Math.max(1,Math.round(.125*(v.width/v.height))),b=v.height+y+10,x=v.width+10,{useMaxWidth:w}=a;zs(u,b,x,!!w),me.debug("Here Bounds",m,v),u.attr("viewBox",`${v.x-5} ${v.y-5} ${v.width+10} ${v.height+10}`)}},"draw"),JKn={draw:ZKn,getClasses:KKn},eZn={parser:_Xn,db:jXn,renderer:JKn,styles:KXn};const tZn=Object.freeze(Object.defineProperty({__proto__:null,diagram:eZn},Symbol.toStringTag,{value:"Module"}));var mXt=/[─━│┃└┗├┣]/,vXt=/[└┗├┣]/,rZn=/[─━]/,yXt=/^[\s│┃]+$/,bXt=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,xXt=/^\s*%%/,nZn=" ";function wXt(t){return t.some(e=>mXt.test(e))}C(wXt,"isBoxDrawingFormat");function AXt(t){for(const e of t){const r=vXt.exec(e);if(r!=null&&r.index&&r.index>0)return r.index}return 4}C(AXt,"inferSegmentWidth");function TXt(t,e){return t.replace(/\bline\s+(\d+)\b/gi,(r,n)=>{const i=parseInt(n,10),a=e.get(i);return a?`line ${a}`:r})}C(TXt,"remapErrorLines");function SXt(t){const e=t.split(` + node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{me.debug("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(!mKn(e,a)&&!i){const s=vKn(e,n,a);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)||r.push(s),i=!0}else n=a,i||r.push(a)}),r},"cutPathAtIntersect"),yKn=C(function(t,e,r,n,i,a,s){let o=r.points;me.debug("abc88 InsertEdge: edge=",r,"e=",e);let l=!1;const u=a.node(e.v);var h=a.node(e.w);h!=null&&h.intersect&&(u!=null&&u.intersect)&&(o=o.slice(1,r.points.length-1),o.unshift(u.intersect(o[0])),o.push(h.intersect(o[o.length-1]))),r.toCluster&&(me.debug("to cluster abc88",n[r.toCluster]),o=Jjt(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(me.debug("from cluster abc88",n[r.fromCluster]),o=Jjt(o.reverse(),n[r.fromCluster].node).reverse(),l=!0);const d=o.filter(w=>!Number.isNaN(w.y));let f=n7;r.curve&&(i==="graph"||i==="flowchart")&&(f=r.curve);const{x:p,y:g}=Bxt(r),m=r7().x(p).y(g).curve(f);let v;switch(r.thickness){case"normal":v="edge-thickness-normal";break;case"thick":v="edge-thickness-thick";break;case"invisible":v="edge-thickness-thick";break;default:v=""}switch(r.pattern){case"solid":v+=" edge-pattern-solid";break;case"dotted":v+=" edge-pattern-dotted";break;case"dashed":v+=" edge-pattern-dashed";break}const y=t.append("path").attr("d",m(d)).attr("id",r.id).attr("class"," "+v+(r.classes?" "+r.classes:"")).attr("style",r.style);let b="";(He().flowchart.arrowMarkerAbsolute||He().state.arrowMarkerAbsolute)&&(b=Eq(!0)),dKn(y,r,b,s,i);let x={};return l&&(x.updatedPath=o),x.originalPath=r.points,x},"insertEdge"),bKn=C(t=>{const e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r);break}return e},"expandAndDeduplicateDirections"),xKn=C((t,e,r,n)=>{const i=bKn(t),a=2,s=e.height+2*r.padding,o=s/a,l=n??e.width+2*o+r.padding,u=r.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:o,y:0},{x:l/2,y:2*u},{x:l-o,y:0},{x:l,y:0},{x:l,y:-s/3},{x:l+2*u,y:-s/2},{x:l,y:-2*s/3},{x:l,y:-s},{x:l-o,y:-s},{x:l/2,y:-s-2*u},{x:o,y:-s},{x:0,y:-s},{x:0,y:-2*s/3},{x:-2*u,y:-s/2},{x:0,y:-s/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:o,y:0},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:o,y:-s},{x:0,y:-s/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:o,y:-s},{x:l-o,y:-s},{x:l,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:l,y:-o},{x:l,y:-s+o},{x:0,y:-s}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:l,y:0},{x:0,y:-o},{x:0,y:-s+o},{x:l,y:-s}]:i.has("right")&&i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s},{x:0,y:-s/2}]:i.has("up")&&i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-s+u},{x:0,y:-s+u},{x:l/2,y:-s},{x:l,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u},{x:l,y:-u}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:l,y:-o},{x:0,y:-s}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-s}]:i.has("left")&&i.has("up")?[{x:l,y:0},{x:0,y:-o},{x:l,y:-s}]:i.has("left")&&i.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-s}]:i.has("right")?[{x:o,y:-u},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s+u}]:i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s},{x:0,y:-s/2}]:i.has("up")?[{x:o,y:-u},{x:o,y:-s+u},{x:0,y:-s+u},{x:l/2,y:-s},{x:l,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u}]:i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u},{x:l,y:-u}]:[{x:0,y:0}]},"getArrowPoints");function eXt(t,e){return t.intersect(e)}C(eXt,"intersectNode");var wKn=eXt;function tXt(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x0}C(MDe,"sameSign");var SKn=iXt,TKn=aXt;function aXt(t,e,r){var n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(g){s=Math.min(s,g.x),o=Math.min(o,g.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));for(var l=n-t.width/2-s,u=i-t.height/2-o,h=0;h1&&a.sort(function(g,m){var v=g.x-r.x,y=g.y-r.y,b=Math.sqrt(v*v+y*y),x=m.x-r.x,w=m.y-r.y,A=Math.sqrt(x*x+w*w);return b{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),OKn=CKn,ys={node:wKn,circle:AKn,ellipse:rXt,polygon:TKn,rect:OKn},Ql=C(async(t,e,r,n)=>{const i=He();let a;const s=e.useHtmlLabels||Zi(i);r?a=r:a="node default";const o=t.insert("g").attr("class",a).attr("id",e.domId||e.id),l=o.insert("g").attr("class","label").attr("style",e.labelStyle);let u;e.labelText===void 0?u="":u=typeof e.labelText=="string"?e.labelText:e.labelText[0];let h;e.labelType==="markdown"?h=Zc(l,ai($y(u),i),{useHtmlLabels:s,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):h=await $g(l,ai($y(u),i),e.labelStyle,!1,n);let d=h.getBBox();const f=e.padding/2;if(Zi(i)){const p=h.children[0],g=Ot(h);await J1e(p,u),d=p.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}return s?l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):l.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:o,bbox:d,halfPadding:f,label:l}},"labelHelper"),Xs=C((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function Fg(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}C(Fg,"insertPolygonShape");var kKn=C(async(t,e)=>{e.useHtmlLabels||Zi(He())||(e.centerLabel=!0);const{shapeSvg:n,bbox:i,halfPadding:a}=await Ql(t,e,"node "+e.classes,!0);me.info("Classes = ",e.classes);const s=n.insert("rect",":first-child");return s.attr("rx",e.rx).attr("ry",e.ry).attr("x",-i.width/2-a).attr("y",-i.height/2-a).attr("width",i.width+e.padding).attr("height",i.height+e.padding),Xs(e,s),e.intersect=function(o){return ys.rect(e,o)},n},"note"),EKn=kKn,sXt=C(t=>t?" "+t:"","formatClass"),hf=C((t,e)=>`${e||"node default"}${sXt(t.classes)} ${sXt(t.class)}`,"getClassesFromNode"),oXt=C(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ql(t,e,hf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=i+a,o=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}];me.info("Question main (Circle)");const l=Fg(r,s,s,o);return l.attr("style",e.style),Xs(e,l),e.intersect=function(u){return me.warn("Intersect called"),ys.polygon(e,o,u)},r},"question"),_Kn=C((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=28,i=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}];return r.insert("polygon",":first-child").attr("points",i.map(function(s){return s.x+","+s.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(s){return ys.circle(e,14,s)},r},"choice"),RKn=C(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ql(t,e,hf(e,void 0),!0),i=4,a=e.positioned?e.height:n.height+e.padding,s=a/i,o=e.positioned?e.width:n.width+2*s+e.padding,l=[{x:s,y:0},{x:o-s,y:0},{x:o,y:-a/2},{x:o-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}],u=Fg(r,o,a,l);return u.attr("style",e.style),Xs(e,u),e.intersect=function(h){return ys.polygon(e,l,h)},r},"hexagon"),DKn=C(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ql(t,e,void 0,!0),i=2,a=n.height+2*e.padding,s=a/i,o=n.width+2*s+e.padding,u=e.positioned&&(e.widthInColumns??1)>1&&e.width>o?e.width:o,h=xKn(e.directions,n,e,u),d=Fg(r,u,a,h);return d.attr("style",e.style),Xs(e,d),e.intersect=function(f){return ys.polygon(e,h,f)},r},"block_arrow"),LKn=C(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ql(t,e,hf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-a/2,y:0},{x:i,y:0},{x:i,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}];return Fg(r,i,a,s).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(l){return ys.polygon(e,s,l)},r},"rect_left_inv_arrow"),MKn=C(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ql(t,e,hf(e),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:a/6,y:-a}],o=Fg(r,i,a,s);return o.attr("style",e.style),Xs(e,o),e.intersect=function(l){return ys.polygon(e,s,l)},r},"lean_right"),IKn=C(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ql(t,e,hf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:2*a/6,y:0},{x:i+a/6,y:0},{x:i-2*a/6,y:-a},{x:-a/6,y:-a}],o=Fg(r,i,a,s);return o.attr("style",e.style),Xs(e,o),e.intersect=function(l){return ys.polygon(e,s,l)},r},"lean_left"),PKn=C(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ql(t,e,hf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i+2*a/6,y:0},{x:i-a/6,y:-a},{x:a/6,y:-a}],o=Fg(r,i,a,s);return o.attr("style",e.style),Xs(e,o),e.intersect=function(l){return ys.polygon(e,s,l)},r},"trapezoid"),NKn=C(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ql(t,e,hf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:-2*a/6,y:-a}],o=Fg(r,i,a,s);return o.attr("style",e.style),Xs(e,o),e.intersect=function(l){return ys.polygon(e,s,l)},r},"inv_trapezoid"),BKn=C(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ql(t,e,hf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i+a/2,y:0},{x:i,y:-a/2},{x:i+a/2,y:-a},{x:0,y:-a}],o=Fg(r,i,a,s);return o.attr("style",e.style),Xs(e,o),e.intersect=function(l){return ys.polygon(e,s,l)},r},"rect_right_inv_arrow"),$Kn=C(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ql(t,e,hf(e,void 0),!0),i=n.width+e.padding,a=i/2,s=a/(2.5+i/50),o=n.height+s+e.padding,l="M 0,"+s+" a "+a+","+s+" 0,0,0 "+i+" 0 a "+a+","+s+" 0,0,0 "+-i+" 0 l 0,"+o+" a "+a+","+s+" 0,0,0 "+i+" 0 l 0,"+-o,u=r.attr("label-offset-y",s).insert("path",":first-child").attr("style",e.style).attr("d",l).attr("transform","translate("+-i/2+","+-(o/2+s)+")");return Xs(e,u),e.intersect=function(h){const d=ys.rect(e,h),f=d.x-e.x;if(a!=0&&(Math.abs(f)e.height/2-s)){let p=s*s*(1-f*f/(a*a));p!=0&&(p=Math.sqrt(p)),p=s-p,h.y-e.y>0&&(p=-p),d.y+=p}return d},r},"cylinder"),FKn=C(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Ql(t,e,"node "+e.classes+" "+e.class,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(a.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(jne(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{me.warn(`Unknown node property ${d}`)})}return Xs(e,a),e.intersect=function(h){return ys.rect(e,h)},r},"rect"),zKn=C(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Ql(t,e,"node "+e.classes,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(a.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(jne(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{me.warn(`Unknown node property ${d}`)})}return Xs(e,a),e.intersect=function(h){return ys.rect(e,h)},r},"composite"),UKn=C(async(t,e)=>{const{shapeSvg:r}=await Ql(t,e,"label",!0);me.trace("Classes = ",e.class);const n=r.insert("rect",":first-child"),i=0,a=0;if(n.attr("width",i).attr("height",a),r.attr("class","label edgeLabel"),e.props){const s=new Set(Object.keys(e.props));e.props.borders&&(jne(n,e.props.borders,i,a),s.delete("borders")),s.forEach(o=>{me.warn(`Unknown node property ${o}`)})}return Xs(e,n),e.intersect=function(s){return ys.rect(e,s)},r},"labelRect");function jne(t,e,r,n){const i=[],a=C(o=>{i.push(o,0)},"addBorder"),s=C(o=>{i.push(0,o)},"skipBorder");e.includes("t")?(me.debug("add top border"),a(r)):s(r),e.includes("r")?(me.debug("add right border"),a(n)):s(n),e.includes("b")?(me.debug("add bottom border"),a(r)):s(r),e.includes("l")?(me.debug("add left border"),a(n)):s(n),t.attr("stroke-dasharray",i.join(" "))}C(jne,"applyNodePropertyBorders");var VKn=C(async(t,e)=>{let r;e.classes?r="node "+e.classes:r="node default";const n=t.insert("g").attr("class",r).attr("id",e.domId||e.id),i=n.insert("rect",":first-child"),a=n.insert("line"),s=n.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let l="";typeof o=="object"?l=o[0]:l=o,me.info("Label text abc79",l,o,typeof o=="object");const u=await $g(s,l,e.labelStyle,!0,!0);let h={width:0,height:0};if(Zi(He())){const m=u.children[0],v=Ot(u);h=m.getBoundingClientRect(),v.attr("width",h.width),v.attr("height",h.height)}me.info("Text 2",o);const d=o.slice(1,o.length);let f=u.getBBox();const p=await $g(s,d.join?d.join("
"):d,e.labelStyle,!0,!0);if(Zi(He())){const m=p.children[0],v=Ot(p);h=m.getBoundingClientRect(),v.attr("width",h.width),v.attr("height",h.height)}const g=e.padding/2;return Ot(p).attr("transform","translate( "+(h.width>f.width?0:(f.width-h.width)/2)+", "+(f.height+g+5)+")"),Ot(u).attr("transform","translate( "+(h.width{const{shapeSvg:r,bbox:n}=await Ql(t,e,hf(e,void 0),!0),i=n.height+e.padding,a=n.width+i/4+e.padding,s=r.insert("rect",":first-child").attr("style",e.style).attr("rx",i/2).attr("ry",i/2).attr("x",-a/2).attr("y",-i/2).attr("width",a).attr("height",i);return Xs(e,s),e.intersect=function(o){return ys.rect(e,o)},r},"stadium"),GKn=C(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Ql(t,e,hf(e,void 0),!0),a=r.insert("circle",":first-child");return a.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),me.info("Circle main"),Xs(e,a),e.intersect=function(s){return me.info("Circle intersect",e,n.width/2+i,s),ys.circle(e,n.width/2+i,s)},r},"circle"),HKn=C(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Ql(t,e,hf(e,void 0),!0),a=5,s=r.insert("g",":first-child"),o=s.insert("circle"),l=s.insert("circle");return s.attr("class",e.class),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i+a).attr("width",n.width+e.padding+a*2).attr("height",n.height+e.padding+a*2),l.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),me.info("DoubleCircle main"),Xs(e,o),e.intersect=function(u){return me.info("DoubleCircle intersect",e,n.width/2+i+a,u),ys.circle(e,n.width/2+i+a,u)},r},"doublecircle"),WKn=C(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ql(t,e,hf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i,y:0},{x:i,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],o=Fg(r,i,a,s);return o.attr("style",e.style),Xs(e,o),e.intersect=function(l){return ys.polygon(e,s,l)},r},"subroutine"),YKn=C((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),Xs(e,n),e.intersect=function(i){return ys.circle(e,7,i)},r},"start"),lXt=C((t,e,r)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let i=70,a=10;r==="LR"&&(i=10,a=70);const s=n.append("rect").attr("x",-1*i/2).attr("y",-1*a/2).attr("width",i).attr("height",a).attr("class","fork-join");return Xs(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(o){return ys.rect(e,o)},n},"forkJoin"),qKn=C((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child"),i=r.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),n.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),Xs(e,i),e.intersect=function(a){return ys.circle(e,7,a)},r},"end"),jKn=C(async(t,e)=>{var O;const r=e.padding/2,n=4,i=8;let a;e.classes?a="node "+e.classes:a="node default";const s=t.insert("g").attr("class",a).attr("id",e.domId||e.id),o=s.insert("rect",":first-child"),l=s.insert("line"),u=s.insert("line");let h=0,d=n;const f=s.insert("g").attr("class","label");let p=0;const g=(O=e.classData.annotations)==null?void 0:O[0],m=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",v=await $g(f,m,e.labelStyle,!0,!0);let y=v.getBBox();if(Zi(He())){const k=v.children[0],E=Ot(v);y=k.getBoundingClientRect(),E.attr("width",y.width),E.attr("height",y.height)}e.classData.annotations[0]&&(d+=y.height+n,h+=y.width);let b=e.classData.label;e.classData.type!==void 0&&e.classData.type!==""&&(Zi(He())?b+="<"+e.classData.type+">":b+="<"+e.classData.type+">");const x=await $g(f,b,e.labelStyle,!0,!0);Ot(x).attr("class","classTitle");let w=x.getBBox();if(Zi(He())){const k=x.children[0],E=Ot(x);w=k.getBoundingClientRect(),E.attr("width",w.width),E.attr("height",w.height)}d+=w.height+n,w.width>h&&(h=w.width);const A=[];e.classData.members.forEach(async k=>{const E=k.getDisplayDetails();let _=E.displayText;Zi(He())&&(_=_.replace(//g,">"));const I=await $g(f,_,E.cssStyle?E.cssStyle:e.labelStyle,!0,!0);let L=I.getBBox();if(Zi(He())){const R=I.children[0],D=Ot(I);L=R.getBoundingClientRect(),D.attr("width",L.width),D.attr("height",L.height)}L.width>h&&(h=L.width),d+=L.height+n,A.push(I)}),d+=i;const S=[];if(e.classData.methods.forEach(async k=>{const E=k.getDisplayDetails();let _=E.displayText;Zi(He())&&(_=_.replace(//g,">"));const I=await $g(f,_,E.cssStyle?E.cssStyle:e.labelStyle,!0,!0);let L=I.getBBox();if(Zi(He())){const R=I.children[0],D=Ot(I);L=R.getBoundingClientRect(),D.attr("width",L.width),D.attr("height",L.height)}L.width>h&&(h=L.width),d+=L.height+n,S.push(I)}),d+=i,g){let k=(h-y.width)/2;Ot(v).attr("transform","translate( "+(-1*h/2+k)+", "+-1*d/2+")"),p=y.height+n}let T=(h-w.width)/2;return Ot(x).attr("transform","translate( "+(-1*h/2+T)+", "+(-1*d/2+p)+")"),p+=w.height+n,l.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,A.forEach(k=>{Ot(k).attr("transform","translate( "+-h/2+", "+(-1*d/2+p+i/2)+")");const E=k==null?void 0:k.getBBox();p+=((E==null?void 0:E.height)??0)+n}),p+=i,u.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,S.forEach(k=>{Ot(k).attr("transform","translate( "+-h/2+", "+(-1*d/2+p)+")");const E=k==null?void 0:k.getBBox();p+=((E==null?void 0:E.height)??0)+n}),o.attr("style",e.style).attr("class","outer title-state").attr("x",-h/2-r).attr("y",-(d/2)-r).attr("width",h+e.padding).attr("height",d+e.padding),Xs(e,o),e.intersect=function(k){return ys.rect(e,k)},s},"class_box"),cXt={rhombus:oXt,composite:zKn,question:oXt,rect:FKn,labelRect:UKn,rectWithTitle:VKn,choice:_Kn,circle:GKn,doublecircle:HKn,stadium:QKn,hexagon:RKn,block_arrow:DKn,rect_left_inv_arrow:LKn,lean_right:MKn,lean_left:IKn,trapezoid:PKn,inv_trapezoid:NKn,rect_right_inv_arrow:BKn,cylinder:$Kn,start:YKn,end:qKn,note:EKn,subroutine:WKn,fork:lXt,join:lXt,class_box:jKn},Xne={},uXt=C(async(t,e,r)=>{let n,i;if(e.link){let a;He().securityLevel==="sandbox"?a="_top":e.linkTarget&&(a=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",a),i=await cXt[e.shape](n,e,r)}else i=await cXt[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),Xne[e.id]=n,e.haveCallback&&Xne[e.id].attr("class",Xne[e.id].attr("class")+" clickable"),n},"insertNode"),XKn=C(t=>{const e=Xne[t.id];me.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode");function IDe(t,e,r=!1){var p,g,m;const n=t;let i="default";(((p=n==null?void 0:n.classes)==null?void 0:p.length)||0)>0&&(i=((n==null?void 0:n.classes)??[]).join(" ")),i=i+" flowchart-label";let a=0,s="",o;switch(n.type){case"round":a=5,s="rect";break;case"composite":a=0,s="composite",o=0;break;case"square":s="rect";break;case"diamond":s="question";break;case"hexagon":s="hexagon";break;case"block_arrow":s="block_arrow";break;case"odd":s="rect_left_inv_arrow";break;case"lean_right":s="lean_right";break;case"lean_left":s="lean_left";break;case"trapezoid":s="trapezoid";break;case"inv_trapezoid":s="inv_trapezoid";break;case"rect_left_inv_arrow":s="rect_left_inv_arrow";break;case"circle":s="circle";break;case"ellipse":s="ellipse";break;case"stadium":s="stadium";break;case"subroutine":s="subroutine";break;case"cylinder":s="cylinder";break;case"group":s="rect";break;case"doublecircle":s="doublecircle";break;default:s="rect"}const l=K1e((n==null?void 0:n.styles)??[]),u=n.label,h=n.size??{width:0,height:0,x:0,y:0},d=e.getDiagramId();return{labelStyle:l.labelStyle,shape:s,labelText:u,rx:a,ry:a,class:i,style:l.style,id:n.id,domId:d?`${d}-${n.id}`:n.id,directions:n.directions,width:h.width,height:h.height,x:h.x,y:h.y,positioned:r,intersect:void 0,type:n.type,padding:o??((m=(g=Dr())==null?void 0:g.block)==null?void 0:m.padding)??0,widthInColumns:n.widthInColumns??1}}C(IDe,"getNodeFromBlock");async function hXt(t,e,r){const n=IDe(e,r,!1);if(n.type==="group")return;const i=Dr(),a=await uXt(t,n,{config:i}),s=a.node().getBBox(),o=r.getBlock(n.id);o.size={width:s.width,height:s.height,x:0,y:0,node:a},r.setBlock(o),a.remove()}C(hXt,"calculateBlockSize");async function dXt(t,e,r){const n=IDe(e,r,!0);if(r.getBlock(n.id).type!=="space"){const a=Dr();await uXt(t,n,{config:a}),e.intersect=n==null?void 0:n.intersect,XKn(n)}}C(dXt,"insertBlockPositioned");async function Kne(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await Kne(t,i.children,r,n)}C(Kne,"performOperations");async function fXt(t,e,r){await Kne(t,e,r,hXt)}C(fXt,"calculateBlockSizes");async function pXt(t,e,r){await Kne(t,e,r,dXt)}C(pXt,"insertBlocks");async function gXt(t,e,r,n,i){const a=new ru({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const s of r)s.size&&a.setNode(s.id,{width:s.size.width,height:s.size.height,intersect:s.intersect});for(const s of e)if(s.start&&s.end){const o=n.getBlock(s.start),l=n.getBlock(s.end);if(o!=null&&o.size&&(l!=null&&l.size)){const u=o.size,h=l.size,d=[{x:u.x,y:u.y},{x:u.x+(h.x-u.x)/2,y:u.y+(h.y-u.y)/2},{x:h.x,y:h.y}],f=i?`${i}-${s.id}`:s.id,p=s.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",g=s.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",m=`${p} ${g} flowchart-link LS-a1 LE-b1`;yKn(t,{v:s.start,w:s.end,name:f},{...s,id:f,arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m},void 0,"block",a,i),s.label&&(await pKn(t,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m}),gKn({...s,x:d[1].x,y:d[1].y},{originalPath:d}))}}}C(gXt,"insertEdges");var KKn=C(function(t,e){return e.db.getClasses()},"getClasses"),ZKn=C(async function(t,e,r,n){const{securityLevel:i,block:a}=Dr(),s=n.db;s.setDiagramId(e);let o;i==="sandbox"&&(o=Ot("#i"+e));const l=Ot(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):Ot(`[id="${e}"]`);cKn(u,["point","circle","cross"],n.type,e);const d=s.getBlocks(),f=s.getBlocksFlat(),p=s.getEdges(),g=u.insert("g").attr("class","block");await fXt(g,d,s);const m=Kjt(s);if(await pXt(g,d,s),await gXt(g,p,f,s,e),m){const v=m,y=Math.max(1,Math.round(.125*(v.width/v.height))),b=v.height+y+10,x=v.width+10,{useMaxWidth:w}=a;zs(u,b,x,!!w),me.debug("Here Bounds",m,v),u.attr("viewBox",`${v.x-5} ${v.y-5} ${v.width+10} ${v.height+10}`)}},"draw"),JKn={draw:ZKn,getClasses:KKn},eZn={parser:_Xn,db:jXn,renderer:JKn,styles:KXn};const tZn=Object.freeze(Object.defineProperty({__proto__:null,diagram:eZn},Symbol.toStringTag,{value:"Module"}));var mXt=/[─━│┃└┗├┣]/,vXt=/[└┗├┣]/,rZn=/[─━]/,yXt=/^[\s│┃]+$/,bXt=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,xXt=/^\s*%%/,nZn=" ";function wXt(t){return t.some(e=>mXt.test(e))}C(wXt,"isBoxDrawingFormat");function AXt(t){for(const e of t){const r=vXt.exec(e);if(r!=null&&r.index&&r.index>0)return r.index}return 4}C(AXt,"inferSegmentWidth");function SXt(t,e){return t.replace(/\bline\s+(\d+)\b/gi,(r,n)=>{const i=parseInt(n,10),a=e.get(i);return a?`line ${a}`:r})}C(SXt,"remapErrorLines");function TXt(t){const e=t.split(` `),r=new Map;let n=-1;for(const[l,u]of e.entries())if(u.trim()==="treeView-beta"){n=l;break}if(n===-1)return{text:t,lineMap:r};const i=[];for(let l=n+1;l({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),iZn=C(()=>{ov.reset(),Aa()},"clear"),aZn=C(()=>ov.records.stack[0],"getRoot"),sZn=C(()=>ov.records.cnt,"getCount"),oZn=Xn.treeView,lZn=C(()=>ns(oZn,Dr().treeView),"getConfig"),cZn=C((t,e,r,n,i,a)=>{for(;t<=ov.records.stack[ov.records.stack.length-1].level;)ov.records.stack.pop();const s={id:ov.records.cnt++,level:t,name:e,nodeType:r,icon:i,cssClass:n,description:a,children:[]};ov.records.stack[ov.records.stack.length-1].children.push(s),ov.records.stack.push(s)},"addNode"),uZn={clear:iZn,addNode:cZn,getRoot:aZn,getCount:sZn,getConfig:lZn,getAccTitle:Ja,getAccDescription:ts,getDiagramTitle:La,setAccDescription:es,setAccTitle:Da,setDiagramTitle:rs},PDe=uZn,hZn=C(t=>{qu(t,PDe);for(const e of t.nodes){const r=typeof e.indent=="number"?e.indent:0;let n=e.name;const i=n.endsWith("/");i&&(n=n.slice(0,-1));const a=i?"directory":"file",s=e.classAnnotation||void 0,o=e.iconAnnotation,l=o!==void 0?o||"none":void 0,u=e.descAnnotation||void 0,h=u?ai(u,Dr()):void 0;PDe.addNode(r,n,a,s,l,h)}},"populate"),dZn={parse:C(async t=>{const{text:e,lineMap:r}=SXt(t);try{const n=await Op("treeView",e);me.debug(n),hZn(n)}catch(n){throw r.size>0&&n instanceof Error&&(n.message=TXt(n.message,r)),n}},"parse")},Pz={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function CXt(t,e){var i;const r=(i=e==null?void 0:e.filenameIcons)==null?void 0:i[t];if(r)return r;const n=t.lastIndexOf(".");if(n>0){const a=t.substring(n).toLowerCase(),s=e==null?void 0:e.extensionIcons;return(s==null?void 0:s[a])??(s==null?void 0:s[a.slice(1)])}}C(CXt,"detectIcon");function NDe(t,e){return t.includes(":")?t:t in Pz.icons||!e?`${Pz.prefix}:${t}`:`${e}:${t}`}C(NDe,"qualifyIcon");function BDe(t,e){if(t.icon!=="none"){if(t.icon)return NDe(t.icon,e.defaultIconPack);if(e.showIcons){if(t.nodeType==="file"){const r=CXt(t.name,e);if(r==="none")return;if(r)return NDe(r,e.defaultIconPack)}return`${Pz.prefix}:${t.nodeType==="directory"?"folder":"file"}`}}}C(BDe,"getNodeIcon"),rbe([{name:Pz.prefix,icons:Pz}]);var $De=14,fZn=4,pZn=16,OXt=C((t,e)=>`tv-icon-${t}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),gZn=C(async(t,e,r,n)=>{const i=new Set,a=C(l=>{const u=BDe(l,r);u&&i.add(u),l.children.forEach(a)},"collect");if(a(e),i.size===0)return;const s=await Promise.all([...i].map(async l=>({icon:l,svg:await Fy(l,{height:$De,width:$De})}))),o=t.append("defs");for(const{icon:l,svg:u}of s)o.append("g").attr("id",OXt(n,l)).html(u)},"injectIconDefs"),mZn=C((t,e,r,n,i,a)=>{var b;const s=n.append("g");let o="treeView-node-label";r.nodeType==="directory"&&(o+=" treeView-node-dir"),r.cssClass&&(o+=` ${r.cssClass}`);const l=$De+fZn,u=BDe(r,i),h=u!==void 0;u&&s.append("use").attr("xlink:href",`#${OXt(a,u)}`).attr("x",t+i.paddingX).attr("y",e+i.paddingY).attr("class","treeView-node-icon");const d=s.append("text").text(r.name).attr("dominant-baseline","middle").attr("class",o),{height:f,width:p}=d.node().getBBox(),g=f+i.paddingY*2,m=t+i.paddingX+(h?l:0);d.attr("x",m),d.attr("y",e+g/2);const v=m+p,y=p+i.paddingX*2+(h?l:0);return r.BBox={x:t,y:e,width:y,height:g},(b=r.cssClass)!=null&&b.split(/\s+/).includes("highlight")&&s.insert("rect",":first-child").attr("x",t).attr("y",e+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:r,nodeGroup:s,labelRightEdge:v,centerY:e+g/2}},"positionLabel"),kXt=C((t,e,r,n,i,a)=>t.append("line").attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i).attr("stroke-width",a).attr("class","treeView-node-line"),"positionLine"),vZn=C((t,e,r,n)=>{var h;let i=0,a=0;const s=[],o=C((d,f,p,g)=>{const m=g*(p.rowIndent+p.paddingX),v=mZn(m,i,f,d,p,n);s.push(v);const{height:y,width:b}=f.BBox;kXt(d,m-p.rowIndent,i+y/2,m,i+y/2,p.lineThickness),a=Math.max(a,m+b),i+=y},"drawNode"),l=C((d,f=0)=>{o(t,d,r,f),d.children.forEach(v=>{l(v,f+1)});const{x:p,y:g,height:m}=d.BBox;if(d.children.length){const{y:v,height:y}=d.children[d.children.length-1].BBox;kXt(t,p+r.paddingX,g+m,p+r.paddingX,v+y/2+r.lineThickness/2,r.lineThickness)}},"processNode");l(e);const u=s.filter(d=>d.node.description);if(u.length>0){const f=Math.max(...s.map(p=>p.labelRightEdge))+pZn;for(const p of u){const m=p.nodeGroup.append("text").text(p.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",f).attr("y",p.centerY).node().getBBox();a=Math.max(a,f+m.width+r.paddingX)}}for(const d of s)if((h=d.node.cssClass)!=null&&h.split(/\s+/).includes("highlight")){const f=d.nodeGroup.select(".treeView-highlight-bg");if(!f.empty()){const p=a-d.node.BBox.x+8;f.attr("width",p),a=Math.max(a,d.node.BBox.x+p+2)}}return{totalHeight:i,totalWidth:a}},"drawTree"),yZn=C(async(t,e,r,n)=>{me.debug(`Rendering treeView diagram +`),lineMap:r}}C(TXt,"preprocessBoxDrawing");var ov=new Uke(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),iZn=C(()=>{ov.reset(),Aa()},"clear"),aZn=C(()=>ov.records.stack[0],"getRoot"),sZn=C(()=>ov.records.cnt,"getCount"),oZn=Xn.treeView,lZn=C(()=>ns(oZn,Dr().treeView),"getConfig"),cZn=C((t,e,r,n,i,a)=>{for(;t<=ov.records.stack[ov.records.stack.length-1].level;)ov.records.stack.pop();const s={id:ov.records.cnt++,level:t,name:e,nodeType:r,icon:i,cssClass:n,description:a,children:[]};ov.records.stack[ov.records.stack.length-1].children.push(s),ov.records.stack.push(s)},"addNode"),uZn={clear:iZn,addNode:cZn,getRoot:aZn,getCount:sZn,getConfig:lZn,getAccTitle:Ja,getAccDescription:ts,getDiagramTitle:La,setAccDescription:es,setAccTitle:Da,setDiagramTitle:rs},PDe=uZn,hZn=C(t=>{qu(t,PDe);for(const e of t.nodes){const r=typeof e.indent=="number"?e.indent:0;let n=e.name;const i=n.endsWith("/");i&&(n=n.slice(0,-1));const a=i?"directory":"file",s=e.classAnnotation||void 0,o=e.iconAnnotation,l=o!==void 0?o||"none":void 0,u=e.descAnnotation||void 0,h=u?ai(u,Dr()):void 0;PDe.addNode(r,n,a,s,l,h)}},"populate"),dZn={parse:C(async t=>{const{text:e,lineMap:r}=TXt(t);try{const n=await Op("treeView",e);me.debug(n),hZn(n)}catch(n){throw r.size>0&&n instanceof Error&&(n.message=SXt(n.message,r)),n}},"parse")},Pz={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function CXt(t,e){var i;const r=(i=e==null?void 0:e.filenameIcons)==null?void 0:i[t];if(r)return r;const n=t.lastIndexOf(".");if(n>0){const a=t.substring(n).toLowerCase(),s=e==null?void 0:e.extensionIcons;return(s==null?void 0:s[a])??(s==null?void 0:s[a.slice(1)])}}C(CXt,"detectIcon");function NDe(t,e){return t.includes(":")?t:t in Pz.icons||!e?`${Pz.prefix}:${t}`:`${e}:${t}`}C(NDe,"qualifyIcon");function BDe(t,e){if(t.icon!=="none"){if(t.icon)return NDe(t.icon,e.defaultIconPack);if(e.showIcons){if(t.nodeType==="file"){const r=CXt(t.name,e);if(r==="none")return;if(r)return NDe(r,e.defaultIconPack)}return`${Pz.prefix}:${t.nodeType==="directory"?"folder":"file"}`}}}C(BDe,"getNodeIcon"),rbe([{name:Pz.prefix,icons:Pz}]);var $De=14,fZn=4,pZn=16,OXt=C((t,e)=>`tv-icon-${t}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),gZn=C(async(t,e,r,n)=>{const i=new Set,a=C(l=>{const u=BDe(l,r);u&&i.add(u),l.children.forEach(a)},"collect");if(a(e),i.size===0)return;const s=await Promise.all([...i].map(async l=>({icon:l,svg:await Fy(l,{height:$De,width:$De})}))),o=t.append("defs");for(const{icon:l,svg:u}of s)o.append("g").attr("id",OXt(n,l)).html(u)},"injectIconDefs"),mZn=C((t,e,r,n,i,a)=>{var b;const s=n.append("g");let o="treeView-node-label";r.nodeType==="directory"&&(o+=" treeView-node-dir"),r.cssClass&&(o+=` ${r.cssClass}`);const l=$De+fZn,u=BDe(r,i),h=u!==void 0;u&&s.append("use").attr("xlink:href",`#${OXt(a,u)}`).attr("x",t+i.paddingX).attr("y",e+i.paddingY).attr("class","treeView-node-icon");const d=s.append("text").text(r.name).attr("dominant-baseline","middle").attr("class",o),{height:f,width:p}=d.node().getBBox(),g=f+i.paddingY*2,m=t+i.paddingX+(h?l:0);d.attr("x",m),d.attr("y",e+g/2);const v=m+p,y=p+i.paddingX*2+(h?l:0);return r.BBox={x:t,y:e,width:y,height:g},(b=r.cssClass)!=null&&b.split(/\s+/).includes("highlight")&&s.insert("rect",":first-child").attr("x",t).attr("y",e+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:r,nodeGroup:s,labelRightEdge:v,centerY:e+g/2}},"positionLabel"),kXt=C((t,e,r,n,i,a)=>t.append("line").attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i).attr("stroke-width",a).attr("class","treeView-node-line"),"positionLine"),vZn=C((t,e,r,n)=>{var h;let i=0,a=0;const s=[],o=C((d,f,p,g)=>{const m=g*(p.rowIndent+p.paddingX),v=mZn(m,i,f,d,p,n);s.push(v);const{height:y,width:b}=f.BBox;kXt(d,m-p.rowIndent,i+y/2,m,i+y/2,p.lineThickness),a=Math.max(a,m+b),i+=y},"drawNode"),l=C((d,f=0)=>{o(t,d,r,f),d.children.forEach(v=>{l(v,f+1)});const{x:p,y:g,height:m}=d.BBox;if(d.children.length){const{y:v,height:y}=d.children[d.children.length-1].BBox;kXt(t,p+r.paddingX,g+m,p+r.paddingX,v+y/2+r.lineThickness/2,r.lineThickness)}},"processNode");l(e);const u=s.filter(d=>d.node.description);if(u.length>0){const f=Math.max(...s.map(p=>p.labelRightEdge))+pZn;for(const p of u){const m=p.nodeGroup.append("text").text(p.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",f).attr("y",p.centerY).node().getBBox();a=Math.max(a,f+m.width+r.paddingX)}}for(const d of s)if((h=d.node.cssClass)!=null&&h.split(/\s+/).includes("highlight")){const f=d.nodeGroup.select(".treeView-highlight-bg");if(!f.empty()){const p=a-d.node.BBox.x+8;f.attr("width",p),a=Math.max(a,d.node.BBox.x+p+2)}}return{totalHeight:i,totalWidth:a}},"drawTree"),yZn=C(async(t,e,r,n)=>{me.debug(`Rendering treeView diagram `+t);const i=n.db,a=i.getRoot(),s=i.getConfig(),o=qc(e);await gZn(o,a,s,e);const l=o.append("g");l.attr("class","tree-view");const{totalHeight:u,totalWidth:h}=vZn(l,a,s,e);o.attr("viewBox",`-${s.lineThickness/2} 0 ${h} ${u}`),zs(o,u,h,s.useMaxWidth)},"draw"),bZn={draw:yZn},xZn=bZn,wZn={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},AZn=C(({treeView:t})=>{const{labelFontSize:e,labelColor:r,lineColor:n,iconColor:i,descriptionColor:a,highlightBg:s,highlightStroke:o}=ns(wZn,t);return` .treeView-node-label { font-size: ${e}; @@ -3576,7 +3576,7 @@ Expecting `+re.join(", ")+", got '"+(this.terminals_[Q]||Q)+"'":ve="Parse error stroke: ${o}; stroke-width: 1; } - `},"styles"),TZn=AZn,SZn={db:PDe,renderer:xZn,parser:dZn,styles:TZn};const CZn=Object.freeze(Object.defineProperty({__proto__:null,diagram:SZn},Symbol.toStringTag,{value:"Module"}));var EXt={exports:{}},FDe={exports:{}},zDe={exports:{}},_Xt;function OZn(){return _Xt||(_Xt=1,function(t,e){(function(n,i){t.exports=i()})(xi,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var s=n[a]={i:a,l:!1,exports:{}};return r[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=r,i.c=n,i.i=function(a){return a},i.d=function(a,s,o){i.o(a,s)||Object.defineProperty(a,s,{configurable:!1,enumerable:!0,get:o})},i.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(s,"a",s),s},i.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},i.p="",i(i.s=28)}([function(r,n,i){function a(){}a.QUALITY=1,a.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,a.DEFAULT_INCREMENTAL=!1,a.DEFAULT_ANIMATION_ON_LAYOUT=!0,a.DEFAULT_ANIMATION_DURING_LAYOUT=!1,a.DEFAULT_ANIMATION_PERIOD=50,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,a.DEFAULT_GRAPH_MARGIN=15,a.NODE_DIMENSIONS_INCLUDE_LABELS=!1,a.SIMPLE_NODE_SIZE=40,a.SIMPLE_NODE_HALF_SIZE=a.SIMPLE_NODE_SIZE/2,a.EMPTY_COMPOUND_NODE_SIZE=40,a.MIN_EDGE_LENGTH=1,a.WORLD_BOUNDARY=1e6,a.INITIAL_WORLD_BOUNDARY=a.WORLD_BOUNDARY/1e3,a.WORLD_CENTER_X=1200,a.WORLD_CENTER_Y=900,r.exports=a},function(r,n,i){var a=i(2),s=i(8),o=i(9);function l(h,d,f){a.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=h,this.target=d}l.prototype=Object.create(a.prototype);for(var u in a)l[u]=a[u];l.prototype.getSource=function(){return this.source},l.prototype.getTarget=function(){return this.target},l.prototype.isInterGraph=function(){return this.isInterGraph},l.prototype.getLength=function(){return this.length},l.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},l.prototype.getBendpoints=function(){return this.bendpoints},l.prototype.getLca=function(){return this.lca},l.prototype.getSourceInLca=function(){return this.sourceInLca},l.prototype.getTargetInLca=function(){return this.targetInLca},l.prototype.getOtherEnd=function(h){if(this.source===h)return this.target;if(this.target===h)return this.source;throw"Node is not incident with this edge"},l.prototype.getOtherEndInGraph=function(h,d){for(var f=this.getOtherEnd(h),p=d.getGraphManager().getRoot();;){if(f.getOwner()==d)return f;if(f.getOwner()==p)break;f=f.getOwner().getParent()}return null},l.prototype.updateLength=function(){var h=new Array(4);this.isOverlapingSourceAndTarget=s.getIntersection(this.target.getRect(),this.source.getRect(),h),this.isOverlapingSourceAndTarget||(this.lengthX=h[0]-h[2],this.lengthY=h[1]-h[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},l.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=l},function(r,n,i){function a(s){this.vGraphObject=s}r.exports=a},function(r,n,i){var a=i(2),s=i(10),o=i(13),l=i(0),u=i(16),h=i(5);function d(p,g,m,v){m==null&&v==null&&(v=g),a.call(this,v),p.graphManager!=null&&(p=p.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=v,this.edges=[],this.graphManager=p,m!=null&&g!=null?this.rect=new o(g.x,g.y,m.width,m.height):this.rect=new o}d.prototype=Object.create(a.prototype);for(var f in a)d[f]=a[f];d.prototype.getEdges=function(){return this.edges},d.prototype.getChild=function(){return this.child},d.prototype.getOwner=function(){return this.owner},d.prototype.getWidth=function(){return this.rect.width},d.prototype.setWidth=function(p){this.rect.width=p},d.prototype.getHeight=function(){return this.rect.height},d.prototype.setHeight=function(p){this.rect.height=p},d.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},d.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},d.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},d.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)},d.prototype.getRect=function(){return this.rect},d.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},d.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},d.prototype.setRect=function(p,g){this.rect.x=p.x,this.rect.y=p.y,this.rect.width=g.width,this.rect.height=g.height},d.prototype.setCenter=function(p,g){this.rect.x=p-this.rect.width/2,this.rect.y=g-this.rect.height/2},d.prototype.setLocation=function(p,g){this.rect.x=p,this.rect.y=g},d.prototype.moveBy=function(p,g){this.rect.x+=p,this.rect.y+=g},d.prototype.getEdgeListToNode=function(p){var g=[],m=this;return m.edges.forEach(function(v){if(v.target==p){if(v.source!=m)throw"Incorrect edge source!";g.push(v)}}),g},d.prototype.getEdgesBetween=function(p){var g=[],m=this;return m.edges.forEach(function(v){if(!(v.source==m||v.target==m))throw"Incorrect edge source and/or target";(v.target==p||v.source==p)&&g.push(v)}),g},d.prototype.getNeighborsList=function(){var p=new Set,g=this;return g.edges.forEach(function(m){if(m.source==g)p.add(m.target);else{if(m.target!=g)throw"Incorrect incidency!";p.add(m.source)}}),p},d.prototype.withChildren=function(){var p=new Set,g,m;if(p.add(this),this.child!=null)for(var v=this.child.getNodes(),y=0;yg?(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(g+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(m+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>m?(this.rect.y-=(this.labelHeight-m)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(m+this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var v=new h(g,m),y=p.inverseTransformPoint(v);this.setLocation(y.x,y.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d},function(r,n,i){var a=i(0);function s(){}for(var o in a)s[o]=a[o];s.MAX_ITERATIONS=2500,s.DEFAULT_EDGE_LENGTH=50,s.DEFAULT_SPRING_STRENGTH=.45,s.DEFAULT_REPULSION_STRENGTH=4500,s.DEFAULT_GRAVITY_STRENGTH=.4,s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,s.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,s.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,s.COOLING_ADAPTATION_FACTOR=.33,s.ADAPTATION_LOWER_NODE_LIMIT=1e3,s.ADAPTATION_UPPER_NODE_LIMIT=5e3,s.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,s.MAX_NODE_DISPLACEMENT=s.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,s.MIN_REPULSION_DIST=s.DEFAULT_EDGE_LENGTH/10,s.CONVERGENCE_CHECK_PERIOD=100,s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,s.MIN_EDGE_LENGTH=1,s.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=s},function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a},function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(7),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(v,y,b){a.call(this,b),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=v,y!=null&&y instanceof l?this.graphManager=y:y!=null&&y instanceof Layout&&(this.graphManager=y.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(v,y,b){if(y==null&&b==null){var x=v;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(x)>-1)throw"Node already in graph!";return x.owner=this,this.getNodes().push(x),x}else{var w=v;if(!(this.getNodes().indexOf(y)>-1&&this.getNodes().indexOf(b)>-1))throw"Source or target not in graph!";if(!(y.owner==b.owner&&y.owner==this))throw"Both owners must be this graph!";return y.owner!=b.owner?null:(w.source=y,w.target=b,w.isInterGraph=!1,this.getEdges().push(w),y.edges.push(w),b!=y&&b.edges.push(w),w)}},g.prototype.remove=function(v){var y=v;if(v instanceof u){if(y==null)throw"Node is null!";if(!(y.owner!=null&&y.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var b=y.edges.slice(),x,w=b.length,A=0;A-1&&O>-1))throw"Source and/or target doesn't know this edge!";x.source.edges.splice(S,1),x.target!=x.source&&x.target.edges.splice(O,1);var T=x.source.owner.getEdges().indexOf(x);if(T==-1)throw"Not in owner's edge list!";x.source.owner.getEdges().splice(T,1)}},g.prototype.updateLeftTop=function(){for(var v=s.MAX_VALUE,y=s.MAX_VALUE,b,x,w,A=this.getNodes(),T=A.length,S=0;Sb&&(v=b),y>x&&(y=x)}return v==s.MAX_VALUE?null:(A[0].getParent().paddingLeft!=null?w=A[0].getParent().paddingLeft:w=this.margin,this.left=y-w,this.top=v-w,new f(this.left,this.top))},g.prototype.updateBounds=function(v){for(var y=s.MAX_VALUE,b=-s.MAX_VALUE,x=s.MAX_VALUE,w=-s.MAX_VALUE,A,T,S,O,k,E=this.nodes,_=E.length,I=0;I<_;I++){var L=E[I];v&&L.child!=null&&L.updateBounds(),A=L.getLeft(),T=L.getRight(),S=L.getTop(),O=L.getBottom(),y>A&&(y=A),bS&&(x=S),wA&&(y=A),bS&&(x=S),w=this.nodes.length){var _=0;b.forEach(function(I){I.owner==v&&_++}),_==this.nodes.length&&(this.isConnected=!0)}},r.exports=g},function(r,n,i){var a,s=i(1);function o(l){a=i(6),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]p)return u[0]=h,u[1]=m,u[2]=f,u[3]=E,!1;if(df)return u[0]=g,u[1]=d,u[2]=O,u[3]=p,!1;if(hf?(u[0]=y,u[1]=b,R=!0):(u[0]=v,u[1]=m,R=!0):M===N&&(h>f?(u[0]=g,u[1]=m,R=!0):(u[0]=x,u[1]=b,R=!0)),-P===N?f>h?(u[2]=k,u[3]=E,D=!0):(u[2]=O,u[3]=S,D=!0):P===N&&(f>h?(u[2]=T,u[3]=S,D=!0):(u[2]=_,u[3]=E,D=!0)),R&&D)return!1;if(h>f?d>p?(F=this.getCardinalDirection(M,N,4),B=this.getCardinalDirection(P,N,2)):(F=this.getCardinalDirection(-M,N,3),B=this.getCardinalDirection(-P,N,1)):d>p?(F=this.getCardinalDirection(-M,N,1),B=this.getCardinalDirection(-P,N,3)):(F=this.getCardinalDirection(M,N,2),B=this.getCardinalDirection(P,N,4)),!R)switch(F){case 1:z=m,V=h+-A/N,u[0]=V,u[1]=z;break;case 2:V=x,z=d+w*N,u[0]=V,u[1]=z;break;case 3:z=b,V=h+A/N,u[0]=V,u[1]=z;break;case 4:V=y,z=d+-w*N,u[0]=V,u[1]=z;break}if(!D)switch(B){case 1:Q=S,U=f+-L/N,u[2]=U,u[3]=Q;break;case 2:U=_,Q=p+I*N,u[2]=U,u[3]=Q;break;case 3:Q=E,U=f+L/N,u[2]=U,u[3]=Q;break;case 4:U=k,Q=p+-I*N,u[2]=U,u[3]=Q;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,v=u.y,y=h.x,b=h.y,x=void 0,w=void 0,A=void 0,T=void 0,S=void 0,O=void 0,k=void 0,E=void 0,_=void 0;return A=g-f,S=d-p,k=p*f-d*g,T=b-v,O=m-y,E=y*v-m*b,_=A*O-T*S,_===0?null:(x=(S*E-O*k)/_,w=(T*k-A*E)/_,new a(x,w))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u=0){var b=(-m+Math.sqrt(m*m-4*g*v))/(2*g),x=(-m-Math.sqrt(m*m-4*g*v))/(2*g),w=null;return b>=0&&b<=1?[b]:x>=0&&x<=1?[x]:w}else return null},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,r.exports=s},function(r,n,i){function a(){}a.sign=function(s){return s>0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a},function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a},function(r,n,i){var a=function(){function d(f,p){for(var g=0;g"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s},function(r,n,i){function a(m){if(Array.isArray(m)){for(var v=0,y=Array(m.length);v0&&v;){for(A.push(S[0]);A.length>0&&v;){var O=A[0];A.splice(0,1),w.add(O);for(var k=O.getEdges(),x=0;x-1&&S.splice(L,1)}w=new Set,T=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var v=[],y=m.source,b=this.graphManager.calcLowestCommonAncestor(m.source,m.target),x=0;x0){for(var b=this.edgeToDummyNodes.get(y),x=0;x=0&&v.splice(E,1);var _=T.getNeighborsList();_.forEach(function(R){if(y.indexOf(R)<0){var D=b.get(R),M=D-1;M==1&&O.push(R),b.set(R,M)}})}y=y.concat(O),(v.length==1||v.length==2)&&(x=!0,w=v[0])}return w},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g},function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a},function(r,n,i){var a=i(5);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s},function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,v,y,b,x=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),w=new Set,m=0;mA||w>A)&&(p.gravitationForceX=-this.gravityConstant*y,p.gravitationForceY=-this.gravityConstant*b)):(A=g.getEstimatedSize()*this.compoundGravityRangeFactor,(x>A||w>A)&&(p.gravitationForceX=-this.gravityConstant*y*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*b*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement=x.length||A>=x[0].length)){for(var T=0;Td}}]),u}();r.exports=l},function(r,n,i){function a(){}a.svd=function(s){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=s.length,this.n=s[0].length;var o=Math.min(this.m,this.n);this.s=function(Ft){for(var gt=[];Ft-- >0;)gt.push(0);return gt}(Math.min(this.m+1,this.n)),this.U=function(Ft){var gt=function Ae(zt){if(zt.length==0)return 0;for(var kt=[],At=0;At0;)gt.push(0);return gt}(this.n),u=function(Ft){for(var gt=[];Ft-- >0;)gt.push(0);return gt}(this.m),h=!0,d=Math.min(this.m-1,this.n),f=Math.max(0,Math.min(this.n-2,this.m)),p=0;p=0;P--)if(this.s[P]!==0){for(var N=P+1;N=0;G--){if(function(Ft,gt){return Ft&>}(G0;){var ae=void 0,Ce=void 0;for(ae=R-2;ae>=-1&&ae!==-1;ae--)if(Math.abs(l[ae])<=ve+re*(Math.abs(this.s[ae])+Math.abs(this.s[ae+1]))){l[ae]=0;break}if(ae===R-2)Ce=4;else{var Oe=void 0;for(Oe=R-1;Oe>=ae&&Oe!==ae;Oe--){var $e=(Oe!==R?Math.abs(l[Oe]):0)+(Oe!==ae+1?Math.abs(l[Oe-1]):0);if(Math.abs(this.s[Oe])<=ve+re*$e){this.s[Oe]=0;break}}Oe===ae?Ce=3:Oe===R-1?Ce=1:(Ce=2,ae=Oe)}switch(ae++,Ce){case 1:{var he=l[R-2];l[R-2]=0;for(var fe=R-2;fe>=ae;fe--){var Te=a.hypot(this.s[fe],he),ge=this.s[fe]/Te,Qe=he/Te;this.s[fe]=Te,fe!==ae&&(he=-Qe*l[fe-1],l[fe-1]=ge*l[fe-1]);for(var Se=0;Se=this.s[ae+1]);){var Rt=this.s[ae];if(this.s[ae]=this.s[ae+1],this.s[ae+1]=Rt,aeMath.abs(o)?(l=o/s,l=Math.abs(s)*Math.sqrt(1+l*l)):o!=0?(l=s/o,l=Math.abs(o)*Math.sqrt(1+l*l)):l=0,l},r.exports=a},function(r,n,i){var a=function(){function l(u,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;u{var n={45:(o,l,u)=>{var h={};h.layoutBase=u(551),h.CoSEConstants=u(806),h.CoSEEdge=u(767),h.CoSEGraph=u(880),h.CoSEGraphManager=u(578),h.CoSELayout=u(765),h.CoSENode=u(991),h.ConstraintHandler=u(902),o.exports=h},806:(o,l,u)=>{var h=u(551).FDLayoutConstants;function d(){}for(var f in h)d[f]=h[f];d.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,d.DEFAULT_RADIAL_SEPARATION=h.DEFAULT_EDGE_LENGTH,d.DEFAULT_COMPONENT_SEPERATION=60,d.TILE=!0,d.TILING_PADDING_VERTICAL=10,d.TILING_PADDING_HORIZONTAL=10,d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0,d.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,d.TREE_REDUCTION_ON_INCREMENTAL=!0,d.PURE_INCREMENTAL=d.DEFAULT_INCREMENTAL,o.exports=d},767:(o,l,u)=>{var h=u(551).FDLayoutEdge;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d},880:(o,l,u)=>{var h=u(551).LGraph;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d},578:(o,l,u)=>{var h=u(551).LGraphManager;function d(p){h.call(this,p)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d},765:(o,l,u)=>{var h=u(551).FDLayout,d=u(578),f=u(880),p=u(991),g=u(767),m=u(806),v=u(902),y=u(551).FDLayoutConstants,b=u(551).LayoutConstants,x=u(551).Point,w=u(551).PointD,A=u(551).DimensionD,T=u(551).Layout,S=u(551).Integer,O=u(551).IGeometry,k=u(551).LGraph,E=u(551).Transform,_=u(551).LinkedList;function I(){h.call(this),this.toBeTiled={},this.constraints={}}I.prototype=Object.create(h.prototype);for(var L in h)I[L]=h[L];I.prototype.newGraphManager=function(){var R=new d(this);return this.graphManager=R,R},I.prototype.newGraph=function(R){return new f(null,this.graphManager,R)},I.prototype.newNode=function(R){return new p(this.graphManager,R)},I.prototype.newEdge=function(R){return new g(null,null,R)},I.prototype.initParameters=function(){h.prototype.initParameters.call(this,arguments),this.isSubLayout||(m.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=m.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=m.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=y.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=y.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},I.prototype.initSpringEmbedder=function(){h.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/y.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},I.prototype.layout=function(){var R=b.DEFAULT_CREATE_BENDS_AS_NEEDED;return R&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},I.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(m.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var D=new Set(this.getAllNodes()),M=this.nodesWithGravity.filter(function(F){return D.has(F)});this.graphManager.setAllNodesToApplyGravitation(M)}}else{var R=this.getFlatForest();if(R.length>0)this.positionNodesRadially(R);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var D=new Set(this.getAllNodes()),M=this.nodesWithGravity.filter(function(P){return D.has(P)});this.graphManager.setAllNodesToApplyGravitation(M),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(v.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),m.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},I.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%y.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var R=new Set(this.getAllNodes()),D=this.nodesWithGravity.filter(function(N){return R.has(N)});this.graphManager.setAllNodesToApplyGravitation(D),this.graphManager.updateBounds(),this.updateGrid(),m.PURE_INCREMENTAL?this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),m.PURE_INCREMENTAL?this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var M=!this.isTreeGrowing&&!this.isGrowthFinished,P=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(M,P),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},I.prototype.getPositionsData=function(){for(var R=this.graphManager.getAllNodes(),D={},M=0;M0&&this.updateDisplacements();for(var M=0;M0&&(P.fixedNodeWeight=F)}}if(this.constraints.relativePlacementConstraint){var B=new Map,V=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(q){R.fixedNodesOnHorizontal.add(q),R.fixedNodesOnVertical.add(q)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var z=this.constraints.alignmentConstraint.vertical,M=0;M=2*q.length/3;re--)Z=Math.floor(Math.random()*(re+1)),ee=q[re],q[re]=q[Z],q[Z]=ee;return q},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(q){if(q.left){var Z=B.has(q.left)?B.get(q.left):q.left,ee=B.has(q.right)?B.get(q.right):q.right;R.nodesInRelativeHorizontal.includes(Z)||(R.nodesInRelativeHorizontal.push(Z),R.nodeToRelativeConstraintMapHorizontal.set(Z,[]),R.dummyToNodeForVerticalAlignment.has(Z)?R.nodeToTempPositionMapHorizontal.set(Z,R.idToNodeMap.get(R.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX()):R.nodeToTempPositionMapHorizontal.set(Z,R.idToNodeMap.get(Z).getCenterX())),R.nodesInRelativeHorizontal.includes(ee)||(R.nodesInRelativeHorizontal.push(ee),R.nodeToRelativeConstraintMapHorizontal.set(ee,[]),R.dummyToNodeForVerticalAlignment.has(ee)?R.nodeToTempPositionMapHorizontal.set(ee,R.idToNodeMap.get(R.dummyToNodeForVerticalAlignment.get(ee)[0]).getCenterX()):R.nodeToTempPositionMapHorizontal.set(ee,R.idToNodeMap.get(ee).getCenterX())),R.nodeToRelativeConstraintMapHorizontal.get(Z).push({right:ee,gap:q.gap}),R.nodeToRelativeConstraintMapHorizontal.get(ee).push({left:Z,gap:q.gap})}else{var re=V.has(q.top)?V.get(q.top):q.top,ve=V.has(q.bottom)?V.get(q.bottom):q.bottom;R.nodesInRelativeVertical.includes(re)||(R.nodesInRelativeVertical.push(re),R.nodeToRelativeConstraintMapVertical.set(re,[]),R.dummyToNodeForHorizontalAlignment.has(re)?R.nodeToTempPositionMapVertical.set(re,R.idToNodeMap.get(R.dummyToNodeForHorizontalAlignment.get(re)[0]).getCenterY()):R.nodeToTempPositionMapVertical.set(re,R.idToNodeMap.get(re).getCenterY())),R.nodesInRelativeVertical.includes(ve)||(R.nodesInRelativeVertical.push(ve),R.nodeToRelativeConstraintMapVertical.set(ve,[]),R.dummyToNodeForHorizontalAlignment.has(ve)?R.nodeToTempPositionMapVertical.set(ve,R.idToNodeMap.get(R.dummyToNodeForHorizontalAlignment.get(ve)[0]).getCenterY()):R.nodeToTempPositionMapVertical.set(ve,R.idToNodeMap.get(ve).getCenterY())),R.nodeToRelativeConstraintMapVertical.get(re).push({bottom:ve,gap:q.gap}),R.nodeToRelativeConstraintMapVertical.get(ve).push({top:re,gap:q.gap})}});else{var Q=new Map,G=new Map;this.constraints.relativePlacementConstraint.forEach(function(q){if(q.left){var Z=B.has(q.left)?B.get(q.left):q.left,ee=B.has(q.right)?B.get(q.right):q.right;Q.has(Z)?Q.get(Z).push(ee):Q.set(Z,[ee]),Q.has(ee)?Q.get(ee).push(Z):Q.set(ee,[Z])}else{var re=V.has(q.top)?V.get(q.top):q.top,ve=V.has(q.bottom)?V.get(q.bottom):q.bottom;G.has(re)?G.get(re).push(ve):G.set(re,[ve]),G.has(ve)?G.get(ve).push(re):G.set(ve,[re])}});var X=function(Z,ee){var re=[],ve=[],ae=new _,Ce=new Set,Oe=0;return Z.forEach(function($e,he){if(!Ce.has(he)){re[Oe]=[],ve[Oe]=!1;var fe=he;for(ae.push(fe),Ce.add(fe),re[Oe].push(fe);ae.length!=0;){fe=ae.shift(),ee.has(fe)&&(ve[Oe]=!0);var Te=Z.get(fe);Te.forEach(function(ge){Ce.has(ge)||(ae.push(ge),Ce.add(ge),re[Oe].push(ge))})}Oe++}}),{components:re,isFixed:ve}},Y=X(Q,R.fixedNodesOnHorizontal);this.componentsOnHorizontal=Y.components,this.fixedComponentsOnHorizontal=Y.isFixed;var le=X(G,R.fixedNodesOnVertical);this.componentsOnVertical=le.components,this.fixedComponentsOnVertical=le.isFixed}}},I.prototype.updateDisplacements=function(){var R=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(le){var q=R.idToNodeMap.get(le.nodeId);q.displacementX=0,q.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var D=this.constraints.alignmentConstraint.vertical,M=0;M1){var V;for(V=0;VP&&(P=Math.floor(B.y)),F=Math.floor(B.x+m.DEFAULT_COMPONENT_SEPERATION)}this.transform(new w(b.WORLD_CENTER_X-B.x/2,b.WORLD_CENTER_Y-B.y/2))},I.radialLayout=function(R,D,M){var P=Math.max(this.maxDiagonalInTree(R),m.DEFAULT_RADIAL_SEPARATION);I.branchRadialLayout(D,null,0,359,0,P);var N=k.calculateBounds(R),F=new E;F.setDeviceOrgX(N.getMinX()),F.setDeviceOrgY(N.getMinY()),F.setWorldOrgX(M.x),F.setWorldOrgY(M.y);for(var B=0;B1;){var ee=Z[0];Z.splice(0,1);var re=G.indexOf(ee);re>=0&&G.splice(re,1),le--,X--}D!=null?q=(G.indexOf(Z[0])+1)%le:q=0;for(var ve=Math.abs(P-M)/X,ae=q;Y!=X;ae=++ae%le){var Ce=G[ae].getOtherEnd(R);if(Ce!=D){var Oe=(M+Y*ve)%360,$e=(Oe+ve)%360;I.branchRadialLayout(Ce,R,Oe,$e,N+F,F),Y++}}},I.maxDiagonalInTree=function(R){for(var D=S.MIN_VALUE,M=0;MD&&(D=N)}return D},I.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},I.prototype.groupZeroDegreeMembers=function(){var R=this,D={};this.memberGroups={},this.idToDummyNode={};for(var M=[],P=this.graphManager.getAllNodes(),N=0;N"u"&&(D[V]=[]),D[V]=D[V].concat(F)}Object.keys(D).forEach(function(z){if(D[z].length>1){var U="DummyCompound_"+z;R.memberGroups[U]=D[z];var Q=D[z][0].getParent(),G=new p(R.graphManager);G.id=U,G.paddingLeft=Q.paddingLeft||0,G.paddingRight=Q.paddingRight||0,G.paddingBottom=Q.paddingBottom||0,G.paddingTop=Q.paddingTop||0,R.idToDummyNode[U]=G;var X=R.getGraphManager().add(R.newGraph(),G),Y=Q.getChild();Y.add(G);for(var le=0;leN?(P.rect.x-=(P.labelWidth-N)/2,P.setWidth(P.labelWidth),P.labelMarginLeft=(P.labelWidth-N)/2):P.labelPosHorizontal=="right"&&P.setWidth(N+P.labelWidth)),P.labelHeight&&(P.labelPosVertical=="top"?(P.rect.y-=P.labelHeight,P.setHeight(F+P.labelHeight),P.labelMarginTop=P.labelHeight):P.labelPosVertical=="center"&&P.labelHeight>F?(P.rect.y-=(P.labelHeight-F)/2,P.setHeight(P.labelHeight),P.labelMarginTop=(P.labelHeight-F)/2):P.labelPosVertical=="bottom"&&P.setHeight(F+P.labelHeight))}})},I.prototype.repopulateCompounds=function(){for(var R=this.compoundOrder.length-1;R>=0;R--){var D=this.compoundOrder[R],M=D.id,P=D.paddingLeft,N=D.paddingTop,F=D.labelMarginLeft,B=D.labelMarginTop;this.adjustLocations(this.tiledMemberPack[M],D.rect.x,D.rect.y,P,N,F,B)}},I.prototype.repopulateZeroDegreeMembers=function(){var R=this,D=this.tiledZeroDegreePack;Object.keys(D).forEach(function(M){var P=R.idToDummyNode[M],N=P.paddingLeft,F=P.paddingTop,B=P.labelMarginLeft,V=P.labelMarginTop;R.adjustLocations(D[M],P.rect.x,P.rect.y,N,F,B,V)})},I.prototype.getToBeTiled=function(R){var D=R.id;if(this.toBeTiled[D]!=null)return this.toBeTiled[D];var M=R.getChild();if(M==null)return this.toBeTiled[D]=!1,!1;for(var P=M.getNodes(),N=0;N0)return this.toBeTiled[D]=!1,!1;if(F.getChild()==null){this.toBeTiled[F.id]=!1;continue}if(!this.getToBeTiled(F))return this.toBeTiled[D]=!1,!1}return this.toBeTiled[D]=!0,!0},I.prototype.getNodeDegree=function(R){R.id;for(var D=R.getEdges(),M=0,P=0;PQ&&(Q=X.rect.height)}M+=Q+R.verticalPadding}},I.prototype.tileCompoundMembers=function(R,D){var M=this;this.tiledMemberPack=[],Object.keys(R).forEach(function(P){var N=D[P];if(M.tiledMemberPack[P]=M.tileNodes(R[P],N.paddingLeft+N.paddingRight),N.rect.width=M.tiledMemberPack[P].width,N.rect.height=M.tiledMemberPack[P].height,N.setCenter(M.tiledMemberPack[P].centerX,M.tiledMemberPack[P].centerY),N.labelMarginLeft=0,N.labelMarginTop=0,m.NODE_DIMENSIONS_INCLUDE_LABELS){var F=N.rect.width,B=N.rect.height;N.labelWidth&&(N.labelPosHorizontal=="left"?(N.rect.x-=N.labelWidth,N.setWidth(F+N.labelWidth),N.labelMarginLeft=N.labelWidth):N.labelPosHorizontal=="center"&&N.labelWidth>F?(N.rect.x-=(N.labelWidth-F)/2,N.setWidth(N.labelWidth),N.labelMarginLeft=(N.labelWidth-F)/2):N.labelPosHorizontal=="right"&&N.setWidth(F+N.labelWidth)),N.labelHeight&&(N.labelPosVertical=="top"?(N.rect.y-=N.labelHeight,N.setHeight(B+N.labelHeight),N.labelMarginTop=N.labelHeight):N.labelPosVertical=="center"&&N.labelHeight>B?(N.rect.y-=(N.labelHeight-B)/2,N.setHeight(N.labelHeight),N.labelMarginTop=(N.labelHeight-B)/2):N.labelPosVertical=="bottom"&&N.setHeight(B+N.labelHeight))}})},I.prototype.tileNodes=function(R,D){var M=this.tileNodesByFavoringDim(R,D,!0),P=this.tileNodesByFavoringDim(R,D,!1),N=this.getOrgRatio(M),F=this.getOrgRatio(P),B;return FV&&(V=le.getWidth())});var z=F/N,U=B/N,Q=Math.pow(M-P,2)+4*(z+P)*(U+M)*N,G=(P-M+Math.sqrt(Q))/(2*(z+P)),X;D?(X=Math.ceil(G),X==G&&X++):X=Math.floor(G);var Y=X*(z+P)-P;return V>Y&&(Y=V),Y+=P*2,Y},I.prototype.tileNodesByFavoringDim=function(R,D,M){var P=m.TILING_PADDING_VERTICAL,N=m.TILING_PADDING_HORIZONTAL,F=m.TILING_COMPARE_BY,B={rows:[],rowWidth:[],rowHeight:[],width:0,height:D,verticalPadding:P,horizontalPadding:N,centerX:0,centerY:0};F&&(B.idealRowWidth=this.calcIdealRowWidth(R,M));var V=function(q){return q.rect.width*q.rect.height},z=function(q,Z){return V(Z)-V(q)};R.sort(function(le,q){var Z=z;return B.idealRowWidth?(Z=F,Z(le.id,q.id)):Z(le,q)});for(var U=0,Q=0,G=0;G0&&(B+=R.horizontalPadding),R.rowWidth[M]=B,R.width0&&(V+=R.verticalPadding);var z=0;V>R.rowHeight[M]&&(z=R.rowHeight[M],R.rowHeight[M]=V,z=R.rowHeight[M]-z),R.height+=z,R.rows[M].push(D)},I.prototype.getShortestRowIndex=function(R){for(var D=-1,M=Number.MAX_VALUE,P=0;PM&&(D=P,M=R.rowWidth[P]);return D},I.prototype.canAddHorizontal=function(R,D,M){if(R.idealRowWidth){var P=R.rows.length-1,N=R.rowWidth[P];return N+D+R.horizontalPadding<=R.idealRowWidth}var F=this.getShortestRowIndex(R);if(F<0)return!0;var B=R.rowWidth[F];if(B+R.horizontalPadding+D<=R.width)return!0;var V=0;R.rowHeight[F]0&&(V=M+R.verticalPadding-R.rowHeight[F]);var z;R.width-B>=D+R.horizontalPadding?z=(R.height+V)/(B+D+R.horizontalPadding):z=(R.height+V)/R.width,V=M+R.verticalPadding;var U;return R.widthF&&D!=M){P.splice(-1,1),R.rows[M].push(N),R.rowWidth[D]=R.rowWidth[D]-F,R.rowWidth[M]=R.rowWidth[M]+F,R.width=R.rowWidth[instance.getLongestRowIndex(R)];for(var B=Number.MIN_VALUE,V=0;VB&&(B=P[V].height);D>0&&(B+=R.verticalPadding);var z=R.rowHeight[D]+R.rowHeight[M];R.rowHeight[D]=B,R.rowHeight[M]0)for(var Y=N;Y<=F;Y++)X[0]+=this.grid[Y][B-1].length+this.grid[Y][B].length-1;if(F0)for(var Y=B;Y<=V;Y++)X[3]+=this.grid[N-1][Y].length+this.grid[N][Y].length-1;for(var le=S.MAX_VALUE,q,Z,ee=0;ee{var h=u(551).FDLayoutNode,d=u(551).IMath;function f(g,m,v,y){h.call(this,g,m,v,y)}f.prototype=Object.create(h.prototype);for(var p in h)f[p]=h[p];f.prototype.calculateDisplacement=function(){var g=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(g,m){for(var v=this.getChild().getNodes(),y,b=0;b{function h(v){if(Array.isArray(v)){for(var y=0,b=Array(v.length);y0){var Rt=0;Me.forEach(function(ut){ye=="horizontal"?(Xe.set(ut,x.has(ut)?w[x.get(ut)]:_e.get(ut)),Rt+=Xe.get(ut)):(Xe.set(ut,x.has(ut)?A[x.get(ut)]:_e.get(ut)),Rt+=Xe.get(ut))}),Rt=Rt/Me.length,wt.forEach(function(ut){oe.has(ut)||Xe.set(ut,Rt)})}else{var Lt=0;wt.forEach(function(ut){ye=="horizontal"?Lt+=x.has(ut)?w[x.get(ut)]:_e.get(ut):Lt+=x.has(ut)?A[x.get(ut)]:_e.get(ut)}),Lt=Lt/wt.length,wt.forEach(function(ut){Xe.set(ut,Lt)})}});for(var Ge=function(){var Me=Ze.shift(),Rt=te.get(Me);Rt.forEach(function(Lt){if(Xe.get(Lt.id)ut&&(ut=Mt),jrXt&&(Xt=jr)}}catch(un){gt=!0,Ae=un}finally{try{!Ft&&zt.return&&zt.return()}finally{if(gt)throw Ae}}var Re=(Rt+ut)/2-(Lt+Xt)/2,at=!0,xt=!1,Ct=void 0;try{for(var gr=wt[Symbol.iterator](),Xr;!(at=(Xr=gr.next()).done);at=!0){var $r=Xr.value;Xe.set($r,Xe.get($r)+Re)}}catch(un){xt=!0,Ct=un}finally{try{!at&&gr.return&&gr.return()}finally{if(xt)throw Ct}}})}return Xe},L=function(te){var ye=0,oe=0,_e=0,Le=0;if(te.forEach(function(Ne){Ne.left?w[x.get(Ne.left)]-w[x.get(Ne.right)]>=0?ye++:oe++:A[x.get(Ne.top)]-A[x.get(Ne.bottom)]>=0?_e++:Le++}),ye>oe&&_e>Le)for(var Ye=0;Yeoe)for(var Pe=0;PeLe)for(var Xe=0;Xe1)y.fixedNodeConstraint.forEach(function(pe,te){P[te]=[pe.position.x,pe.position.y],N[te]=[w[x.get(pe.nodeId)],A[x.get(pe.nodeId)]]}),F=!0;else if(y.alignmentConstraint)(function(){var pe=0;if(y.alignmentConstraint.vertical){for(var te=y.alignmentConstraint.vertical,ye=function(Xe){var Ne=new Set;te[Xe].forEach(function(lt){Ne.add(lt)});var Ze=new Set([].concat(h(Ne)).filter(function(lt){return V.has(lt)})),Ge=void 0;Ze.size>0?Ge=w[x.get(Ze.values().next().value)]:Ge=_(Ne).x,te[Xe].forEach(function(lt){P[pe]=[Ge,A[x.get(lt)]],N[pe]=[w[x.get(lt)],A[x.get(lt)]],pe++})},oe=0;oe0?Ge=w[x.get(Ze.values().next().value)]:Ge=_(Ne).y,_e[Xe].forEach(function(lt){P[pe]=[w[x.get(lt)],Ge],N[pe]=[w[x.get(lt)],A[x.get(lt)]],pe++})},Ye=0;Ye<_e.length;Ye++)Le(Ye);F=!0}y.relativePlacementConstraint&&(B=!0)})();else if(y.relativePlacementConstraint){for(var G=0,X=0,Y=0;YG&&(G=Q[Y].length,X=Y);if(G0){var Se={x:0,y:0};y.fixedNodeConstraint.forEach(function(pe,te){var ye={x:w[x.get(pe.nodeId)],y:A[x.get(pe.nodeId)]},oe=pe.position,_e=E(oe,ye);Se.x+=_e.x,Se.y+=_e.y}),Se.x/=y.fixedNodeConstraint.length,Se.y/=y.fixedNodeConstraint.length,w.forEach(function(pe,te){w[te]+=Se.x}),A.forEach(function(pe,te){A[te]+=Se.y}),y.fixedNodeConstraint.forEach(function(pe){w[x.get(pe.nodeId)]=pe.position.x,A[x.get(pe.nodeId)]=pe.position.y})}if(y.alignmentConstraint){if(y.alignmentConstraint.vertical)for(var De=y.alignmentConstraint.vertical,qe=function(te){var ye=new Set;De[te].forEach(function(Le){ye.add(Le)});var oe=new Set([].concat(h(ye)).filter(function(Le){return V.has(Le)})),_e=void 0;oe.size>0?_e=w[x.get(oe.values().next().value)]:_e=_(ye).x,ye.forEach(function(Le){V.has(Le)||(w[x.get(Le)]=_e)})},K=0;K0?_e=A[x.get(oe.values().next().value)]:_e=_(ye).y,ye.forEach(function(Le){V.has(Le)||(A[x.get(Le)]=_e)})},ne=0;ne{o.exports=r}},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(45);return s})()})}(FDe)),FDe.exports}(function(t,e){(function(n,i){t.exports=i(kZn())})(xi,function(r){return(()=>{var n={658:o=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(l){for(var u=arguments.length,h=Array(u>1?u-1:0),d=1;d{var h=function(){function p(g,m){var v=[],y=!0,b=!1,x=void 0;try{for(var w=g[Symbol.iterator](),A;!(y=(A=w.next()).done)&&(v.push(A.value),!(m&&v.length===m));y=!0);}catch(T){b=!0,x=T}finally{try{!y&&w.return&&w.return()}finally{if(b)throw x}}return v}return function(g,m){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return p(g,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),d=u(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(p){for(var g={},m=0;m0&&F.merge(U)});for(var B=0;B1){A=x[0],T=A.connectedEdges().length,x.forEach(function(N){N.connectedEdges().length0&&v.set("dummy"+(v.size+1),k),E},f.relocateComponent=function(p,g,m){if(!m.fixedNodeConstraint){var v=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,b=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY;if(m.quality=="draft"){var w=!0,A=!1,T=void 0;try{for(var S=g.nodeIndexes[Symbol.iterator](),O;!(w=(O=S.next()).done);w=!0){var k=O.value,E=h(k,2),_=E[0],I=E[1],L=m.cy.getElementById(_);if(L){var R=L.boundingBox(),D=g.xCoords[I]-R.w/2,M=g.xCoords[I]+R.w/2,P=g.yCoords[I]-R.h/2,N=g.yCoords[I]+R.h/2;Dy&&(y=M),Px&&(x=N)}}}catch(U){A=!0,T=U}finally{try{!w&&S.return&&S.return()}finally{if(A)throw T}}var F=p.x-(y+v)/2,B=p.y-(x+b)/2;g.xCoords=g.xCoords.map(function(U){return U+F}),g.yCoords=g.yCoords.map(function(U){return U+B})}else{Object.keys(g).forEach(function(U){var Q=g[U],G=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,Y=Q.getRect().y,le=Q.getRect().y+Q.getRect().height;Gy&&(y=X),Yx&&(x=le)});var V=p.x-(y+v)/2,z=p.y-(x+b)/2;Object.keys(g).forEach(function(U){var Q=g[U];Q.setCenter(Q.getCenterX()+V,Q.getCenterY()+z)})}}},f.calcBoundingBox=function(p,g,m,v){for(var y=Number.MAX_SAFE_INTEGER,b=Number.MIN_SAFE_INTEGER,x=Number.MAX_SAFE_INTEGER,w=Number.MIN_SAFE_INTEGER,A=void 0,T=void 0,S=void 0,O=void 0,k=p.descendants().not(":parent"),E=k.length,_=0;_A&&(y=A),bS&&(x=S),w{var h=u(548),d=u(140).CoSELayout,f=u(140).CoSENode,p=u(140).layoutBase.PointD,g=u(140).layoutBase.DimensionD,m=u(140).layoutBase.LayoutConstants,v=u(140).layoutBase.FDLayoutConstants,y=u(140).CoSEConstants,b=function(w,A){var T=w.cy,S=w.eles,O=S.nodes(),k=S.edges(),E=void 0,_=void 0,I=void 0,L={};w.randomize&&(E=A.nodeIndexes,_=A.xCoords,I=A.yCoords);var R=function(U){return typeof U=="function"},D=function(U,Q){return R(U)?U(Q):U},M=h.calcParentsWithoutChildren(T,S),P=function z(U,Q,G,X){for(var Y=Q.length,le=0;le0){var ae=void 0;ae=G.getGraphManager().add(G.newGraph(),ee),z(ae,Z,G,X)}}},N=function(U,Q,G){for(var X=0,Y=0,le=0;le0?y.DEFAULT_EDGE_LENGTH=v.DEFAULT_EDGE_LENGTH=X/Y:R(w.idealEdgeLength)?y.DEFAULT_EDGE_LENGTH=v.DEFAULT_EDGE_LENGTH=50:y.DEFAULT_EDGE_LENGTH=v.DEFAULT_EDGE_LENGTH=w.idealEdgeLength,y.MIN_REPULSION_DIST=v.MIN_REPULSION_DIST=v.DEFAULT_EDGE_LENGTH/10,y.DEFAULT_RADIAL_SEPARATION=v.DEFAULT_EDGE_LENGTH)},F=function(U,Q){Q.fixedNodeConstraint&&(U.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(U.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(U.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};w.nestingFactor!=null&&(y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=v.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=w.nestingFactor),w.gravity!=null&&(y.DEFAULT_GRAVITY_STRENGTH=v.DEFAULT_GRAVITY_STRENGTH=w.gravity),w.numIter!=null&&(y.MAX_ITERATIONS=v.MAX_ITERATIONS=w.numIter),w.gravityRange!=null&&(y.DEFAULT_GRAVITY_RANGE_FACTOR=v.DEFAULT_GRAVITY_RANGE_FACTOR=w.gravityRange),w.gravityCompound!=null&&(y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=v.DEFAULT_COMPOUND_GRAVITY_STRENGTH=w.gravityCompound),w.gravityRangeCompound!=null&&(y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=w.gravityRangeCompound),w.initialEnergyOnIncremental!=null&&(y.DEFAULT_COOLING_FACTOR_INCREMENTAL=v.DEFAULT_COOLING_FACTOR_INCREMENTAL=w.initialEnergyOnIncremental),w.tilingCompareBy!=null&&(y.TILING_COMPARE_BY=w.tilingCompareBy),w.quality=="proof"?m.QUALITY=2:m.QUALITY=0,y.NODE_DIMENSIONS_INCLUDE_LABELS=v.NODE_DIMENSIONS_INCLUDE_LABELS=m.NODE_DIMENSIONS_INCLUDE_LABELS=w.nodeDimensionsIncludeLabels,y.DEFAULT_INCREMENTAL=v.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!w.randomize,y.ANIMATE=v.ANIMATE=m.ANIMATE=w.animate,y.TILE=w.tile,y.TILING_PADDING_VERTICAL=typeof w.tilingPaddingVertical=="function"?w.tilingPaddingVertical.call():w.tilingPaddingVertical,y.TILING_PADDING_HORIZONTAL=typeof w.tilingPaddingHorizontal=="function"?w.tilingPaddingHorizontal.call():w.tilingPaddingHorizontal,y.DEFAULT_INCREMENTAL=v.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!0,y.PURE_INCREMENTAL=!w.randomize,m.DEFAULT_UNIFORM_LEAF_NODE_SIZES=w.uniformNodeDimensions,w.step=="transformed"&&(y.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,y.ENFORCE_CONSTRAINTS=!1,y.APPLY_LAYOUT=!1),w.step=="enforced"&&(y.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,y.ENFORCE_CONSTRAINTS=!0,y.APPLY_LAYOUT=!1),w.step=="cose"&&(y.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,y.ENFORCE_CONSTRAINTS=!1,y.APPLY_LAYOUT=!0),w.step=="all"&&(w.randomize?y.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:y.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,y.ENFORCE_CONSTRAINTS=!0,y.APPLY_LAYOUT=!0),w.fixedNodeConstraint||w.alignmentConstraint||w.relativePlacementConstraint?y.TREE_REDUCTION_ON_INCREMENTAL=!1:y.TREE_REDUCTION_ON_INCREMENTAL=!0;var B=new d,V=B.newGraphManager();return P(V.addRoot(),h.getTopMostNodes(O),B,w),N(B,V,k),F(B,w),B.runLayout(),L};o.exports={coseLayout:b}},212:(o,l,u)=>{var h=function(){function w(A,T){for(var S=0;S0)if(M){var F=p.getTopMostNodes(S.eles.nodes());if(I=p.connectComponents(O,S.eles,F),I.forEach(function($e){var he=$e.boundingBox();L.push({x:he.x1+he.w/2,y:he.y1+he.h/2})}),S.randomize&&I.forEach(function($e){S.eles=$e,E.push(m(S))}),S.quality=="default"||S.quality=="proof"){var B=O.collection();if(S.tile){var V=new Map,z=[],U=[],Q=0,G={nodeIndexes:V,xCoords:z,yCoords:U},X=[];if(I.forEach(function($e,he){$e.edges().length==0&&($e.nodes().forEach(function(fe,Te){B.merge($e.nodes()[Te]),fe.isParent()||(G.nodeIndexes.set($e.nodes()[Te].id(),Q++),G.xCoords.push($e.nodes()[0].position().x),G.yCoords.push($e.nodes()[0].position().y))}),X.push(he))}),B.length>1){var Y=B.boundingBox();L.push({x:Y.x1+Y.w/2,y:Y.y1+Y.h/2}),I.push(B),E.push(G);for(var le=X.length-1;le>=0;le--)I.splice(X[le],1),E.splice(X[le],1),L.splice(X[le],1)}}I.forEach(function($e,he){S.eles=$e,_.push(y(S,E[he])),p.relocateComponent(L[he],_[he],S)})}else I.forEach(function($e,he){p.relocateComponent(L[he],E[he],S)});var q=new Set;if(I.length>1){var Z=[],ee=k.filter(function($e){return $e.css("display")=="none"});I.forEach(function($e,he){var fe=void 0;if(S.quality=="draft"&&(fe=E[he].nodeIndexes),$e.nodes().not(ee).length>0){var Te={};Te.edges=[],Te.nodes=[];var ge=void 0;$e.nodes().not(ee).forEach(function(Qe){if(S.quality=="draft")if(!Qe.isParent())ge=fe.get(Qe.id()),Te.nodes.push({x:E[he].xCoords[ge]-Qe.boundingbox().w/2,y:E[he].yCoords[ge]-Qe.boundingbox().h/2,width:Qe.boundingbox().w,height:Qe.boundingbox().h});else{var Se=p.calcBoundingBox(Qe,E[he].xCoords,E[he].yCoords,fe);Te.nodes.push({x:Se.topLeftX,y:Se.topLeftY,width:Se.width,height:Se.height})}else _[he][Qe.id()]&&Te.nodes.push({x:_[he][Qe.id()].getLeft(),y:_[he][Qe.id()].getTop(),width:_[he][Qe.id()].getWidth(),height:_[he][Qe.id()].getHeight()})}),$e.edges().forEach(function(Qe){var Se=Qe.source(),De=Qe.target();if(Se.css("display")!="none"&&De.css("display")!="none")if(S.quality=="draft"){var qe=fe.get(Se.id()),K=fe.get(De.id()),ce=[],be=[];if(Se.isParent()){var ne=p.calcBoundingBox(Se,E[he].xCoords,E[he].yCoords,fe);ce.push(ne.topLeftX+ne.width/2),ce.push(ne.topLeftY+ne.height/2)}else ce.push(E[he].xCoords[qe]),ce.push(E[he].yCoords[qe]);if(De.isParent()){var j=p.calcBoundingBox(De,E[he].xCoords,E[he].yCoords,fe);be.push(j.topLeftX+j.width/2),be.push(j.topLeftY+j.height/2)}else be.push(E[he].xCoords[K]),be.push(E[he].yCoords[K]);Te.edges.push({startX:ce[0],startY:ce[1],endX:be[0],endY:be[1]})}else _[he][Se.id()]&&_[he][De.id()]&&Te.edges.push({startX:_[he][Se.id()].getCenterX(),startY:_[he][Se.id()].getCenterY(),endX:_[he][De.id()].getCenterX(),endY:_[he][De.id()].getCenterY()})}),Te.nodes.length>0&&(Z.push(Te),q.add(he))}});var re=D.packComponents(Z,S.randomize).shifts;if(S.quality=="draft")E.forEach(function($e,he){var fe=$e.xCoords.map(function(ge){return ge+re[he].dx}),Te=$e.yCoords.map(function(ge){return ge+re[he].dy});$e.xCoords=fe,$e.yCoords=Te});else{var ve=0;q.forEach(function($e){Object.keys(_[$e]).forEach(function(he){var fe=_[$e][he];fe.setCenter(fe.getCenterX()+re[ve].dx,fe.getCenterY()+re[ve].dy)}),ve++})}}}else{var P=S.eles.boundingBox();if(L.push({x:P.x1+P.w/2,y:P.y1+P.h/2}),S.randomize){var N=m(S);E.push(N)}S.quality=="default"||S.quality=="proof"?(_.push(y(S,E[0])),p.relocateComponent(L[0],_[0],S)):p.relocateComponent(L[0],E[0],S)}var ae=function(he,fe){if(S.quality=="default"||S.quality=="proof"){typeof he=="number"&&(he=fe);var Te=void 0,ge=void 0,Qe=he.data("id");return _.forEach(function(De){Qe in De&&(Te={x:De[Qe].getRect().getCenterX(),y:De[Qe].getRect().getCenterY()},ge=De[Qe])}),S.nodeDimensionsIncludeLabels&&(ge.labelWidth&&(ge.labelPosHorizontal=="left"?Te.x+=ge.labelWidth/2:ge.labelPosHorizontal=="right"&&(Te.x-=ge.labelWidth/2)),ge.labelHeight&&(ge.labelPosVertical=="top"?Te.y+=ge.labelHeight/2:ge.labelPosVertical=="bottom"&&(Te.y-=ge.labelHeight/2))),Te==null&&(Te={x:he.position("x"),y:he.position("y")}),{x:Te.x,y:Te.y}}else{var Se=void 0;return E.forEach(function(De){var qe=De.nodeIndexes.get(he.id());qe!=null&&(Se={x:De.xCoords[qe],y:De.yCoords[qe]})}),Se==null&&(Se={x:he.position("x"),y:he.position("y")}),{x:Se.x,y:Se.y}}};if(S.quality=="default"||S.quality=="proof"||S.randomize){var Ce=p.calcParentsWithoutChildren(O,k),Oe=k.filter(function($e){return $e.css("display")=="none"});S.eles=k.not(Oe),k.nodes().not(":parent").not(Oe).layoutPositions(T,S,ae),Ce.length>0&&Ce.forEach(function($e){$e.position(ae($e))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),w}();o.exports=x},657:(o,l,u)=>{var h=u(548),d=u(140).layoutBase.Matrix,f=u(140).layoutBase.SVD,p=function(m){var v=m.cy,y=m.eles,b=y.nodes(),x=y.nodes(":parent"),w=new Map,A=new Map,T=new Map,S=[],O=[],k=[],E=[],_=[],I=[],L=[],R=[],D=void 0,M=1e8,P=1e-9,N=m.piTol,F=m.samplingType,B=m.nodeSeparation,V=void 0,z=function(){for(var te=0,ye=0,oe=!1;ye=Le;){Pe=_e[Le++];for(var Fe=S[Pe],wt=0;wtZe&&(Ze=_[Rt],Ge=Rt)}return Ge},Q=function(te){var ye=void 0;if(te){ye=Math.floor(Math.random()*D);for(var _e=0;_e=1)break;Ne=Xe}for(var lt=0;lt=1)break;Ne=Xe}for(var wt=0;wt0&&(ye.isParent()?S[te].push(T.get(ye.id())):S[te].push(ye.id()))})});var Oe=function(te){var ye=A.get(te),oe=void 0;w.get(te).forEach(function(_e){v.getElementById(_e).isParent()?oe=T.get(_e):oe=_e,S[ye].push(oe),S[A.get(oe)].push(te)})},$e=!0,he=!1,fe=void 0;try{for(var Te=w.keys()[Symbol.iterator](),ge;!($e=(ge=Te.next()).done);$e=!0){var Qe=ge.value;Oe(Qe)}}catch(pe){he=!0,fe=pe}finally{try{!$e&&Te.return&&Te.return()}finally{if(he)throw fe}}D=A.size;var Se=void 0;if(D>2){V=D{var h=u(212),d=function(p){p&&p("layout","fcose",h)};typeof cytoscape<"u"&&d(cytoscape),o.exports=d},140:o=>{o.exports=r}},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(579);return s})()})})(EXt);var EZn=EXt.exports;const _Zn=uh(EZn);var DXt={L:"left",R:"right",T:"top",B:"bottom"},LXt={L:C(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:C(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:C(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:C(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},Zne={L:C((t,e)=>t-e+2,"L"),R:C((t,e)=>t-2,"R"),T:C((t,e)=>t-e+2,"T"),B:C((t,e)=>t-2,"B")},RZn=C(function(t){return lh(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),MXt=C(function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),lh=C(function(t){const e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),yw=C(function(t){const e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),UDe=C(function(t,e){const r=lh(t)&&yw(e),n=yw(t)&&lh(e);return r||n},"isArchitectureDirectionXY"),DZn=C(function(t){const e=t[0],r=t[1],n=lh(e)&&yw(r),i=yw(e)&&lh(r);return n||i},"isArchitecturePairXY"),LZn=C(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),VDe=C(function(t,e){const r=`${t}${e}`;return LZn(r)?r:void 0},"getArchitectureDirectionPair"),MZn=C(function([t,e],r){const n=r[0],i=r[1];return lh(n)?yw(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:lh(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),IZn=C(function(t){return t==="LT"||t==="TL"?[1,1]:t==="BL"||t==="LB"?[1,-1]:t==="BR"||t==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),PZn=C(function(t,e){return UDe(t,e)?"bend":lh(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),NZn=C(function(t){return t.type==="service"},"isArchitectureService"),BZn=C(function(t){return t.type==="junction"},"isArchitectureJunction"),IXt=C((t,e)=>{const[r,n]=[t,e].sort();return`${JSON.stringify(r)}-${JSON.stringify(n)}`},"architectureGroupAlignmentKey"),PXt=C(t=>t.data(),"edgeData"),rD=C(t=>t.data(),"nodeData"),$Zn=Xn.architecture,NXt=(VI=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=Da,this.getAccTitle=Ja,this.setDiagramTitle=rs,this.getDiagramTitle=La,this.getAccDescription=ts,this.setAccDescription=es,this.clear()}setDiagramId(e){this.diagramId=e}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",Aa()}addService({id:e,icon:r,in:n,title:i,iconText:a}){if(this.registeredIds.has(e))throw new Error(`The service id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(n!==void 0){if(e===n)throw new Error(`The service [${e}] cannot be placed within itself`);if(!this.registeredIds.has(n))throw new Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(n)==="node")throw new Error(`The service [${e}]'s parent is not a group`)}this.registeredIds.set(e,"node"),this.nodes.set(e,{id:e,type:"service",icon:r,iconText:a,title:i,edges:[],in:n})}getServices(){return[...this.nodes.values()].filter(NZn)}addJunction({id:e,in:r}){if(this.registeredIds.has(e))throw new Error(`The junction id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(r!==void 0){if(e===r)throw new Error(`The junction [${e}] cannot be placed within itself`);if(!this.registeredIds.has(r))throw new Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(r)==="node")throw new Error(`The junction [${e}]'s parent is not a group`)}this.registeredIds.set(e,"node"),this.nodes.set(e,{id:e,type:"junction",edges:[],in:r})}getJunctions(){return[...this.nodes.values()].filter(BZn)}getNodes(){return[...this.nodes.values()]}getNode(e){return this.nodes.get(e)??null}addGroup({id:e,icon:r,in:n,title:i}){if(this.registeredIds.has(e))throw new Error(`The group id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(n!==void 0){if(e===n)throw new Error(`The group [${e}] cannot be placed within itself`);if(!this.registeredIds.has(n))throw new Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(n)==="node")throw new Error(`The group [${e}]'s parent is not a group`)}this.registeredIds.set(e,"group"),this.groups.set(e,{id:e,icon:r,title:i,in:n})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:e,rhsId:r,lhsDir:n,rhsDir:i,lhsInto:a,rhsInto:s,lhsGroup:o,rhsGroup:l,title:u}){if(!MXt(n))throw new Error(`Invalid direction given for left hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(n)}`);if(!MXt(i))throw new Error(`Invalid direction given for right hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(i)}`);if(!this.nodes.has(e)&&!this.groups.has(e))throw new Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(r)&&!this.groups.has(r))throw new Error(`The right-hand id [${r}] does not yet exist. Please create the service/group before declaring an edge to it.`);const h=this.nodes.get(e).in,d=this.nodes.get(r).in;if(o&&h&&d&&h==d)throw new Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(l&&h&&d&&h==d)throw new Error(`The right-hand id [${r}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const f={lhsId:e,lhsDir:n,lhsInto:a,lhsGroup:o,rhsId:r,rhsDir:i,rhsInto:s,rhsGroup:l,title:u};this.edges.push(f);const p=this.nodes.get(e),g=this.nodes.get(r);p&&g&&(p.edges.push(this.edges[this.edges.length-1]),g.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(e){if(e.members.length<2)throw new Error(`An align directive requires at least two members; got ${e.members.length}`);const r=new Set;e.members.forEach(n=>{if(this.registeredIds.get(n)!=="node")throw new Error(`align ${e.direction} references [${n}], which is not a service or junction`);if(r.has(n))throw new Error(`align ${e.direction} lists [${n}] more than once`);r.add(n)}),this.layoutHints.push(e)}getLayoutHints(){return this.layoutHints}getDataStructures(){var e,r;if(this.dataStructures===void 0){const n=new Map,i=new Map;for(const[u,h]of this.nodes.entries()){const d=new Map;for(const f of h.edges){const p=(e=this.getNode(f.lhsId))==null?void 0:e.in,g=(r=this.getNode(f.rhsId))==null?void 0:r.in;if(p&&g&&p!==g){const m=PZn(f.lhsDir,f.rhsDir);m!=="bend"&&n.set(IXt(p,g),m)}if(f.lhsId===u){const m=VDe(f.lhsDir,f.rhsDir);m&&d.set(m,f.rhsId)}else{const m=VDe(f.rhsDir,f.lhsDir);m&&d.set(m,f.lhsId)}}i.set(u,d)}const a=new Set,s=new Set(i.keys()),o=C(u=>{const h=new Map([[u,[0,0]]]),d=[u];for(;d.length>0;){const f=d.shift();if(f){a.add(f),s.delete(f);const p=i.get(f);if(!p)throw new Error(`BFS error: adjacency list for id ${f} not found. Please report this as a bug.`);const g=h.get(f);if(!g)throw new Error(`BFS error: position for id ${f} not found in spatial map. Please report this as a bug.`);const[m,v]=g;p.forEach((y,b)=>{a.has(y)||(h.set(y,MZn([m,v],b)),d.push(y))})}}return h},"BFS"),l=[];for(;s.size>0;){const u=s.values().next().value;l.push(o(u))}this.dataStructures={adjList:i,spatialMaps:l,groupAlignments:n}}return this.dataStructures}setElementForId(e,r){this.elements.set(e,r)}getElementById(e){return this.elements.get(e)}getConfig(){return ns({...$Zn,...Dr().architecture})}getConfigField(e){return this.getConfig()[e]}},C(VI,"ArchitectureDB"),VI),FZn=C((t,e)=>{var r;qu(t,e),t.groups.map(n=>e.addGroup(n)),t.services.map(n=>e.addService({...n,type:"service"})),t.junctions.map(n=>e.addJunction({...n,type:"junction"})),t.edges.map(n=>e.addEdge(n)),(r=t.alignments)==null||r.map(n=>e.addLayoutHint({direction:n.direction,members:[...n.members]}))},"populateDb"),BXt={parser:{yy:void 0},parse:C(async t=>{var n;const e=await Op("architecture",t);me.debug(e);const r=(n=BXt.parser)==null?void 0:n.yy;if(!(r instanceof NXt))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");FZn(e,r)},"parse")},zZn=C(t=>` + `},"styles"),SZn=AZn,TZn={db:PDe,renderer:xZn,parser:dZn,styles:SZn};const CZn=Object.freeze(Object.defineProperty({__proto__:null,diagram:TZn},Symbol.toStringTag,{value:"Module"}));var EXt={exports:{}},FDe={exports:{}},zDe={exports:{}},_Xt;function OZn(){return _Xt||(_Xt=1,function(t,e){(function(n,i){t.exports=i()})(xi,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var s=n[a]={i:a,l:!1,exports:{}};return r[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=r,i.c=n,i.i=function(a){return a},i.d=function(a,s,o){i.o(a,s)||Object.defineProperty(a,s,{configurable:!1,enumerable:!0,get:o})},i.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(s,"a",s),s},i.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},i.p="",i(i.s=28)}([function(r,n,i){function a(){}a.QUALITY=1,a.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,a.DEFAULT_INCREMENTAL=!1,a.DEFAULT_ANIMATION_ON_LAYOUT=!0,a.DEFAULT_ANIMATION_DURING_LAYOUT=!1,a.DEFAULT_ANIMATION_PERIOD=50,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,a.DEFAULT_GRAPH_MARGIN=15,a.NODE_DIMENSIONS_INCLUDE_LABELS=!1,a.SIMPLE_NODE_SIZE=40,a.SIMPLE_NODE_HALF_SIZE=a.SIMPLE_NODE_SIZE/2,a.EMPTY_COMPOUND_NODE_SIZE=40,a.MIN_EDGE_LENGTH=1,a.WORLD_BOUNDARY=1e6,a.INITIAL_WORLD_BOUNDARY=a.WORLD_BOUNDARY/1e3,a.WORLD_CENTER_X=1200,a.WORLD_CENTER_Y=900,r.exports=a},function(r,n,i){var a=i(2),s=i(8),o=i(9);function l(h,d,f){a.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=h,this.target=d}l.prototype=Object.create(a.prototype);for(var u in a)l[u]=a[u];l.prototype.getSource=function(){return this.source},l.prototype.getTarget=function(){return this.target},l.prototype.isInterGraph=function(){return this.isInterGraph},l.prototype.getLength=function(){return this.length},l.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},l.prototype.getBendpoints=function(){return this.bendpoints},l.prototype.getLca=function(){return this.lca},l.prototype.getSourceInLca=function(){return this.sourceInLca},l.prototype.getTargetInLca=function(){return this.targetInLca},l.prototype.getOtherEnd=function(h){if(this.source===h)return this.target;if(this.target===h)return this.source;throw"Node is not incident with this edge"},l.prototype.getOtherEndInGraph=function(h,d){for(var f=this.getOtherEnd(h),p=d.getGraphManager().getRoot();;){if(f.getOwner()==d)return f;if(f.getOwner()==p)break;f=f.getOwner().getParent()}return null},l.prototype.updateLength=function(){var h=new Array(4);this.isOverlapingSourceAndTarget=s.getIntersection(this.target.getRect(),this.source.getRect(),h),this.isOverlapingSourceAndTarget||(this.lengthX=h[0]-h[2],this.lengthY=h[1]-h[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},l.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=l},function(r,n,i){function a(s){this.vGraphObject=s}r.exports=a},function(r,n,i){var a=i(2),s=i(10),o=i(13),l=i(0),u=i(16),h=i(5);function d(p,g,m,v){m==null&&v==null&&(v=g),a.call(this,v),p.graphManager!=null&&(p=p.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=v,this.edges=[],this.graphManager=p,m!=null&&g!=null?this.rect=new o(g.x,g.y,m.width,m.height):this.rect=new o}d.prototype=Object.create(a.prototype);for(var f in a)d[f]=a[f];d.prototype.getEdges=function(){return this.edges},d.prototype.getChild=function(){return this.child},d.prototype.getOwner=function(){return this.owner},d.prototype.getWidth=function(){return this.rect.width},d.prototype.setWidth=function(p){this.rect.width=p},d.prototype.getHeight=function(){return this.rect.height},d.prototype.setHeight=function(p){this.rect.height=p},d.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},d.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},d.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},d.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)},d.prototype.getRect=function(){return this.rect},d.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},d.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},d.prototype.setRect=function(p,g){this.rect.x=p.x,this.rect.y=p.y,this.rect.width=g.width,this.rect.height=g.height},d.prototype.setCenter=function(p,g){this.rect.x=p-this.rect.width/2,this.rect.y=g-this.rect.height/2},d.prototype.setLocation=function(p,g){this.rect.x=p,this.rect.y=g},d.prototype.moveBy=function(p,g){this.rect.x+=p,this.rect.y+=g},d.prototype.getEdgeListToNode=function(p){var g=[],m=this;return m.edges.forEach(function(v){if(v.target==p){if(v.source!=m)throw"Incorrect edge source!";g.push(v)}}),g},d.prototype.getEdgesBetween=function(p){var g=[],m=this;return m.edges.forEach(function(v){if(!(v.source==m||v.target==m))throw"Incorrect edge source and/or target";(v.target==p||v.source==p)&&g.push(v)}),g},d.prototype.getNeighborsList=function(){var p=new Set,g=this;return g.edges.forEach(function(m){if(m.source==g)p.add(m.target);else{if(m.target!=g)throw"Incorrect incidency!";p.add(m.source)}}),p},d.prototype.withChildren=function(){var p=new Set,g,m;if(p.add(this),this.child!=null)for(var v=this.child.getNodes(),y=0;yg?(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(g+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(m+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>m?(this.rect.y-=(this.labelHeight-m)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(m+this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var v=new h(g,m),y=p.inverseTransformPoint(v);this.setLocation(y.x,y.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d},function(r,n,i){var a=i(0);function s(){}for(var o in a)s[o]=a[o];s.MAX_ITERATIONS=2500,s.DEFAULT_EDGE_LENGTH=50,s.DEFAULT_SPRING_STRENGTH=.45,s.DEFAULT_REPULSION_STRENGTH=4500,s.DEFAULT_GRAVITY_STRENGTH=.4,s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,s.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,s.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,s.COOLING_ADAPTATION_FACTOR=.33,s.ADAPTATION_LOWER_NODE_LIMIT=1e3,s.ADAPTATION_UPPER_NODE_LIMIT=5e3,s.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,s.MAX_NODE_DISPLACEMENT=s.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,s.MIN_REPULSION_DIST=s.DEFAULT_EDGE_LENGTH/10,s.CONVERGENCE_CHECK_PERIOD=100,s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,s.MIN_EDGE_LENGTH=1,s.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=s},function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a},function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(7),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(v,y,b){a.call(this,b),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=v,y!=null&&y instanceof l?this.graphManager=y:y!=null&&y instanceof Layout&&(this.graphManager=y.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(v,y,b){if(y==null&&b==null){var x=v;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(x)>-1)throw"Node already in graph!";return x.owner=this,this.getNodes().push(x),x}else{var w=v;if(!(this.getNodes().indexOf(y)>-1&&this.getNodes().indexOf(b)>-1))throw"Source or target not in graph!";if(!(y.owner==b.owner&&y.owner==this))throw"Both owners must be this graph!";return y.owner!=b.owner?null:(w.source=y,w.target=b,w.isInterGraph=!1,this.getEdges().push(w),y.edges.push(w),b!=y&&b.edges.push(w),w)}},g.prototype.remove=function(v){var y=v;if(v instanceof u){if(y==null)throw"Node is null!";if(!(y.owner!=null&&y.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var b=y.edges.slice(),x,w=b.length,A=0;A-1&&O>-1))throw"Source and/or target doesn't know this edge!";x.source.edges.splice(T,1),x.target!=x.source&&x.target.edges.splice(O,1);var S=x.source.owner.getEdges().indexOf(x);if(S==-1)throw"Not in owner's edge list!";x.source.owner.getEdges().splice(S,1)}},g.prototype.updateLeftTop=function(){for(var v=s.MAX_VALUE,y=s.MAX_VALUE,b,x,w,A=this.getNodes(),S=A.length,T=0;Tb&&(v=b),y>x&&(y=x)}return v==s.MAX_VALUE?null:(A[0].getParent().paddingLeft!=null?w=A[0].getParent().paddingLeft:w=this.margin,this.left=y-w,this.top=v-w,new f(this.left,this.top))},g.prototype.updateBounds=function(v){for(var y=s.MAX_VALUE,b=-s.MAX_VALUE,x=s.MAX_VALUE,w=-s.MAX_VALUE,A,S,T,O,k,E=this.nodes,_=E.length,I=0;I<_;I++){var L=E[I];v&&L.child!=null&&L.updateBounds(),A=L.getLeft(),S=L.getRight(),T=L.getTop(),O=L.getBottom(),y>A&&(y=A),bT&&(x=T),wA&&(y=A),bT&&(x=T),w=this.nodes.length){var _=0;b.forEach(function(I){I.owner==v&&_++}),_==this.nodes.length&&(this.isConnected=!0)}},r.exports=g},function(r,n,i){var a,s=i(1);function o(l){a=i(6),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]p)return u[0]=h,u[1]=m,u[2]=f,u[3]=E,!1;if(df)return u[0]=g,u[1]=d,u[2]=O,u[3]=p,!1;if(hf?(u[0]=y,u[1]=b,R=!0):(u[0]=v,u[1]=m,R=!0):M===N&&(h>f?(u[0]=g,u[1]=m,R=!0):(u[0]=x,u[1]=b,R=!0)),-P===N?f>h?(u[2]=k,u[3]=E,D=!0):(u[2]=O,u[3]=T,D=!0):P===N&&(f>h?(u[2]=S,u[3]=T,D=!0):(u[2]=_,u[3]=E,D=!0)),R&&D)return!1;if(h>f?d>p?(F=this.getCardinalDirection(M,N,4),B=this.getCardinalDirection(P,N,2)):(F=this.getCardinalDirection(-M,N,3),B=this.getCardinalDirection(-P,N,1)):d>p?(F=this.getCardinalDirection(-M,N,1),B=this.getCardinalDirection(-P,N,3)):(F=this.getCardinalDirection(M,N,2),B=this.getCardinalDirection(P,N,4)),!R)switch(F){case 1:z=m,V=h+-A/N,u[0]=V,u[1]=z;break;case 2:V=x,z=d+w*N,u[0]=V,u[1]=z;break;case 3:z=b,V=h+A/N,u[0]=V,u[1]=z;break;case 4:V=y,z=d+-w*N,u[0]=V,u[1]=z;break}if(!D)switch(B){case 1:Q=T,U=f+-L/N,u[2]=U,u[3]=Q;break;case 2:U=_,Q=p+I*N,u[2]=U,u[3]=Q;break;case 3:Q=E,U=f+L/N,u[2]=U,u[3]=Q;break;case 4:U=k,Q=p+-I*N,u[2]=U,u[3]=Q;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,v=u.y,y=h.x,b=h.y,x=void 0,w=void 0,A=void 0,S=void 0,T=void 0,O=void 0,k=void 0,E=void 0,_=void 0;return A=g-f,T=d-p,k=p*f-d*g,S=b-v,O=m-y,E=y*v-m*b,_=A*O-S*T,_===0?null:(x=(T*E-O*k)/_,w=(S*k-A*E)/_,new a(x,w))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u=0){var b=(-m+Math.sqrt(m*m-4*g*v))/(2*g),x=(-m-Math.sqrt(m*m-4*g*v))/(2*g),w=null;return b>=0&&b<=1?[b]:x>=0&&x<=1?[x]:w}else return null},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,r.exports=s},function(r,n,i){function a(){}a.sign=function(s){return s>0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a},function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a},function(r,n,i){var a=function(){function d(f,p){for(var g=0;g"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s},function(r,n,i){function a(m){if(Array.isArray(m)){for(var v=0,y=Array(m.length);v0&&v;){for(A.push(T[0]);A.length>0&&v;){var O=A[0];A.splice(0,1),w.add(O);for(var k=O.getEdges(),x=0;x-1&&T.splice(L,1)}w=new Set,S=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var v=[],y=m.source,b=this.graphManager.calcLowestCommonAncestor(m.source,m.target),x=0;x0){for(var b=this.edgeToDummyNodes.get(y),x=0;x=0&&v.splice(E,1);var _=S.getNeighborsList();_.forEach(function(R){if(y.indexOf(R)<0){var D=b.get(R),M=D-1;M==1&&O.push(R),b.set(R,M)}})}y=y.concat(O),(v.length==1||v.length==2)&&(x=!0,w=v[0])}return w},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g},function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a},function(r,n,i){var a=i(5);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s},function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,v,y,b,x=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),w=new Set,m=0;mA||w>A)&&(p.gravitationForceX=-this.gravityConstant*y,p.gravitationForceY=-this.gravityConstant*b)):(A=g.getEstimatedSize()*this.compoundGravityRangeFactor,(x>A||w>A)&&(p.gravitationForceX=-this.gravityConstant*y*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*b*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement=x.length||A>=x[0].length)){for(var S=0;Sd}}]),u}();r.exports=l},function(r,n,i){function a(){}a.svd=function(s){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=s.length,this.n=s[0].length;var o=Math.min(this.m,this.n);this.s=function(Ft){for(var gt=[];Ft-- >0;)gt.push(0);return gt}(Math.min(this.m+1,this.n)),this.U=function(Ft){var gt=function Ae(zt){if(zt.length==0)return 0;for(var kt=[],At=0;At0;)gt.push(0);return gt}(this.n),u=function(Ft){for(var gt=[];Ft-- >0;)gt.push(0);return gt}(this.m),h=!0,d=Math.min(this.m-1,this.n),f=Math.max(0,Math.min(this.n-2,this.m)),p=0;p=0;P--)if(this.s[P]!==0){for(var N=P+1;N=0;G--){if(function(Ft,gt){return Ft&>}(G0;){var ae=void 0,Ce=void 0;for(ae=R-2;ae>=-1&&ae!==-1;ae--)if(Math.abs(l[ae])<=ve+re*(Math.abs(this.s[ae])+Math.abs(this.s[ae+1]))){l[ae]=0;break}if(ae===R-2)Ce=4;else{var Oe=void 0;for(Oe=R-1;Oe>=ae&&Oe!==ae;Oe--){var $e=(Oe!==R?Math.abs(l[Oe]):0)+(Oe!==ae+1?Math.abs(l[Oe-1]):0);if(Math.abs(this.s[Oe])<=ve+re*$e){this.s[Oe]=0;break}}Oe===ae?Ce=3:Oe===R-1?Ce=1:(Ce=2,ae=Oe)}switch(ae++,Ce){case 1:{var he=l[R-2];l[R-2]=0;for(var fe=R-2;fe>=ae;fe--){var Se=a.hypot(this.s[fe],he),ge=this.s[fe]/Se,Qe=he/Se;this.s[fe]=Se,fe!==ae&&(he=-Qe*l[fe-1],l[fe-1]=ge*l[fe-1]);for(var Te=0;Te=this.s[ae+1]);){var Rt=this.s[ae];if(this.s[ae]=this.s[ae+1],this.s[ae+1]=Rt,aeMath.abs(o)?(l=o/s,l=Math.abs(s)*Math.sqrt(1+l*l)):o!=0?(l=s/o,l=Math.abs(o)*Math.sqrt(1+l*l)):l=0,l},r.exports=a},function(r,n,i){var a=function(){function l(u,h){for(var d=0;d2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;u{var n={45:(o,l,u)=>{var h={};h.layoutBase=u(551),h.CoSEConstants=u(806),h.CoSEEdge=u(767),h.CoSEGraph=u(880),h.CoSEGraphManager=u(578),h.CoSELayout=u(765),h.CoSENode=u(991),h.ConstraintHandler=u(902),o.exports=h},806:(o,l,u)=>{var h=u(551).FDLayoutConstants;function d(){}for(var f in h)d[f]=h[f];d.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,d.DEFAULT_RADIAL_SEPARATION=h.DEFAULT_EDGE_LENGTH,d.DEFAULT_COMPONENT_SEPERATION=60,d.TILE=!0,d.TILING_PADDING_VERTICAL=10,d.TILING_PADDING_HORIZONTAL=10,d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0,d.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,d.TREE_REDUCTION_ON_INCREMENTAL=!0,d.PURE_INCREMENTAL=d.DEFAULT_INCREMENTAL,o.exports=d},767:(o,l,u)=>{var h=u(551).FDLayoutEdge;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d},880:(o,l,u)=>{var h=u(551).LGraph;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d},578:(o,l,u)=>{var h=u(551).LGraphManager;function d(p){h.call(this,p)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d},765:(o,l,u)=>{var h=u(551).FDLayout,d=u(578),f=u(880),p=u(991),g=u(767),m=u(806),v=u(902),y=u(551).FDLayoutConstants,b=u(551).LayoutConstants,x=u(551).Point,w=u(551).PointD,A=u(551).DimensionD,S=u(551).Layout,T=u(551).Integer,O=u(551).IGeometry,k=u(551).LGraph,E=u(551).Transform,_=u(551).LinkedList;function I(){h.call(this),this.toBeTiled={},this.constraints={}}I.prototype=Object.create(h.prototype);for(var L in h)I[L]=h[L];I.prototype.newGraphManager=function(){var R=new d(this);return this.graphManager=R,R},I.prototype.newGraph=function(R){return new f(null,this.graphManager,R)},I.prototype.newNode=function(R){return new p(this.graphManager,R)},I.prototype.newEdge=function(R){return new g(null,null,R)},I.prototype.initParameters=function(){h.prototype.initParameters.call(this,arguments),this.isSubLayout||(m.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=m.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=m.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=y.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=y.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},I.prototype.initSpringEmbedder=function(){h.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/y.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},I.prototype.layout=function(){var R=b.DEFAULT_CREATE_BENDS_AS_NEEDED;return R&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},I.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(m.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var D=new Set(this.getAllNodes()),M=this.nodesWithGravity.filter(function(F){return D.has(F)});this.graphManager.setAllNodesToApplyGravitation(M)}}else{var R=this.getFlatForest();if(R.length>0)this.positionNodesRadially(R);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var D=new Set(this.getAllNodes()),M=this.nodesWithGravity.filter(function(P){return D.has(P)});this.graphManager.setAllNodesToApplyGravitation(M),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(v.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),m.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},I.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%y.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var R=new Set(this.getAllNodes()),D=this.nodesWithGravity.filter(function(N){return R.has(N)});this.graphManager.setAllNodesToApplyGravitation(D),this.graphManager.updateBounds(),this.updateGrid(),m.PURE_INCREMENTAL?this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),m.PURE_INCREMENTAL?this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var M=!this.isTreeGrowing&&!this.isGrowthFinished,P=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(M,P),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},I.prototype.getPositionsData=function(){for(var R=this.graphManager.getAllNodes(),D={},M=0;M0&&this.updateDisplacements();for(var M=0;M0&&(P.fixedNodeWeight=F)}}if(this.constraints.relativePlacementConstraint){var B=new Map,V=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(q){R.fixedNodesOnHorizontal.add(q),R.fixedNodesOnVertical.add(q)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var z=this.constraints.alignmentConstraint.vertical,M=0;M=2*q.length/3;re--)Z=Math.floor(Math.random()*(re+1)),ee=q[re],q[re]=q[Z],q[Z]=ee;return q},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(q){if(q.left){var Z=B.has(q.left)?B.get(q.left):q.left,ee=B.has(q.right)?B.get(q.right):q.right;R.nodesInRelativeHorizontal.includes(Z)||(R.nodesInRelativeHorizontal.push(Z),R.nodeToRelativeConstraintMapHorizontal.set(Z,[]),R.dummyToNodeForVerticalAlignment.has(Z)?R.nodeToTempPositionMapHorizontal.set(Z,R.idToNodeMap.get(R.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX()):R.nodeToTempPositionMapHorizontal.set(Z,R.idToNodeMap.get(Z).getCenterX())),R.nodesInRelativeHorizontal.includes(ee)||(R.nodesInRelativeHorizontal.push(ee),R.nodeToRelativeConstraintMapHorizontal.set(ee,[]),R.dummyToNodeForVerticalAlignment.has(ee)?R.nodeToTempPositionMapHorizontal.set(ee,R.idToNodeMap.get(R.dummyToNodeForVerticalAlignment.get(ee)[0]).getCenterX()):R.nodeToTempPositionMapHorizontal.set(ee,R.idToNodeMap.get(ee).getCenterX())),R.nodeToRelativeConstraintMapHorizontal.get(Z).push({right:ee,gap:q.gap}),R.nodeToRelativeConstraintMapHorizontal.get(ee).push({left:Z,gap:q.gap})}else{var re=V.has(q.top)?V.get(q.top):q.top,ve=V.has(q.bottom)?V.get(q.bottom):q.bottom;R.nodesInRelativeVertical.includes(re)||(R.nodesInRelativeVertical.push(re),R.nodeToRelativeConstraintMapVertical.set(re,[]),R.dummyToNodeForHorizontalAlignment.has(re)?R.nodeToTempPositionMapVertical.set(re,R.idToNodeMap.get(R.dummyToNodeForHorizontalAlignment.get(re)[0]).getCenterY()):R.nodeToTempPositionMapVertical.set(re,R.idToNodeMap.get(re).getCenterY())),R.nodesInRelativeVertical.includes(ve)||(R.nodesInRelativeVertical.push(ve),R.nodeToRelativeConstraintMapVertical.set(ve,[]),R.dummyToNodeForHorizontalAlignment.has(ve)?R.nodeToTempPositionMapVertical.set(ve,R.idToNodeMap.get(R.dummyToNodeForHorizontalAlignment.get(ve)[0]).getCenterY()):R.nodeToTempPositionMapVertical.set(ve,R.idToNodeMap.get(ve).getCenterY())),R.nodeToRelativeConstraintMapVertical.get(re).push({bottom:ve,gap:q.gap}),R.nodeToRelativeConstraintMapVertical.get(ve).push({top:re,gap:q.gap})}});else{var Q=new Map,G=new Map;this.constraints.relativePlacementConstraint.forEach(function(q){if(q.left){var Z=B.has(q.left)?B.get(q.left):q.left,ee=B.has(q.right)?B.get(q.right):q.right;Q.has(Z)?Q.get(Z).push(ee):Q.set(Z,[ee]),Q.has(ee)?Q.get(ee).push(Z):Q.set(ee,[Z])}else{var re=V.has(q.top)?V.get(q.top):q.top,ve=V.has(q.bottom)?V.get(q.bottom):q.bottom;G.has(re)?G.get(re).push(ve):G.set(re,[ve]),G.has(ve)?G.get(ve).push(re):G.set(ve,[re])}});var X=function(Z,ee){var re=[],ve=[],ae=new _,Ce=new Set,Oe=0;return Z.forEach(function($e,he){if(!Ce.has(he)){re[Oe]=[],ve[Oe]=!1;var fe=he;for(ae.push(fe),Ce.add(fe),re[Oe].push(fe);ae.length!=0;){fe=ae.shift(),ee.has(fe)&&(ve[Oe]=!0);var Se=Z.get(fe);Se.forEach(function(ge){Ce.has(ge)||(ae.push(ge),Ce.add(ge),re[Oe].push(ge))})}Oe++}}),{components:re,isFixed:ve}},Y=X(Q,R.fixedNodesOnHorizontal);this.componentsOnHorizontal=Y.components,this.fixedComponentsOnHorizontal=Y.isFixed;var le=X(G,R.fixedNodesOnVertical);this.componentsOnVertical=le.components,this.fixedComponentsOnVertical=le.isFixed}}},I.prototype.updateDisplacements=function(){var R=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(le){var q=R.idToNodeMap.get(le.nodeId);q.displacementX=0,q.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var D=this.constraints.alignmentConstraint.vertical,M=0;M1){var V;for(V=0;VP&&(P=Math.floor(B.y)),F=Math.floor(B.x+m.DEFAULT_COMPONENT_SEPERATION)}this.transform(new w(b.WORLD_CENTER_X-B.x/2,b.WORLD_CENTER_Y-B.y/2))},I.radialLayout=function(R,D,M){var P=Math.max(this.maxDiagonalInTree(R),m.DEFAULT_RADIAL_SEPARATION);I.branchRadialLayout(D,null,0,359,0,P);var N=k.calculateBounds(R),F=new E;F.setDeviceOrgX(N.getMinX()),F.setDeviceOrgY(N.getMinY()),F.setWorldOrgX(M.x),F.setWorldOrgY(M.y);for(var B=0;B1;){var ee=Z[0];Z.splice(0,1);var re=G.indexOf(ee);re>=0&&G.splice(re,1),le--,X--}D!=null?q=(G.indexOf(Z[0])+1)%le:q=0;for(var ve=Math.abs(P-M)/X,ae=q;Y!=X;ae=++ae%le){var Ce=G[ae].getOtherEnd(R);if(Ce!=D){var Oe=(M+Y*ve)%360,$e=(Oe+ve)%360;I.branchRadialLayout(Ce,R,Oe,$e,N+F,F),Y++}}},I.maxDiagonalInTree=function(R){for(var D=T.MIN_VALUE,M=0;MD&&(D=N)}return D},I.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},I.prototype.groupZeroDegreeMembers=function(){var R=this,D={};this.memberGroups={},this.idToDummyNode={};for(var M=[],P=this.graphManager.getAllNodes(),N=0;N"u"&&(D[V]=[]),D[V]=D[V].concat(F)}Object.keys(D).forEach(function(z){if(D[z].length>1){var U="DummyCompound_"+z;R.memberGroups[U]=D[z];var Q=D[z][0].getParent(),G=new p(R.graphManager);G.id=U,G.paddingLeft=Q.paddingLeft||0,G.paddingRight=Q.paddingRight||0,G.paddingBottom=Q.paddingBottom||0,G.paddingTop=Q.paddingTop||0,R.idToDummyNode[U]=G;var X=R.getGraphManager().add(R.newGraph(),G),Y=Q.getChild();Y.add(G);for(var le=0;leN?(P.rect.x-=(P.labelWidth-N)/2,P.setWidth(P.labelWidth),P.labelMarginLeft=(P.labelWidth-N)/2):P.labelPosHorizontal=="right"&&P.setWidth(N+P.labelWidth)),P.labelHeight&&(P.labelPosVertical=="top"?(P.rect.y-=P.labelHeight,P.setHeight(F+P.labelHeight),P.labelMarginTop=P.labelHeight):P.labelPosVertical=="center"&&P.labelHeight>F?(P.rect.y-=(P.labelHeight-F)/2,P.setHeight(P.labelHeight),P.labelMarginTop=(P.labelHeight-F)/2):P.labelPosVertical=="bottom"&&P.setHeight(F+P.labelHeight))}})},I.prototype.repopulateCompounds=function(){for(var R=this.compoundOrder.length-1;R>=0;R--){var D=this.compoundOrder[R],M=D.id,P=D.paddingLeft,N=D.paddingTop,F=D.labelMarginLeft,B=D.labelMarginTop;this.adjustLocations(this.tiledMemberPack[M],D.rect.x,D.rect.y,P,N,F,B)}},I.prototype.repopulateZeroDegreeMembers=function(){var R=this,D=this.tiledZeroDegreePack;Object.keys(D).forEach(function(M){var P=R.idToDummyNode[M],N=P.paddingLeft,F=P.paddingTop,B=P.labelMarginLeft,V=P.labelMarginTop;R.adjustLocations(D[M],P.rect.x,P.rect.y,N,F,B,V)})},I.prototype.getToBeTiled=function(R){var D=R.id;if(this.toBeTiled[D]!=null)return this.toBeTiled[D];var M=R.getChild();if(M==null)return this.toBeTiled[D]=!1,!1;for(var P=M.getNodes(),N=0;N0)return this.toBeTiled[D]=!1,!1;if(F.getChild()==null){this.toBeTiled[F.id]=!1;continue}if(!this.getToBeTiled(F))return this.toBeTiled[D]=!1,!1}return this.toBeTiled[D]=!0,!0},I.prototype.getNodeDegree=function(R){R.id;for(var D=R.getEdges(),M=0,P=0;PQ&&(Q=X.rect.height)}M+=Q+R.verticalPadding}},I.prototype.tileCompoundMembers=function(R,D){var M=this;this.tiledMemberPack=[],Object.keys(R).forEach(function(P){var N=D[P];if(M.tiledMemberPack[P]=M.tileNodes(R[P],N.paddingLeft+N.paddingRight),N.rect.width=M.tiledMemberPack[P].width,N.rect.height=M.tiledMemberPack[P].height,N.setCenter(M.tiledMemberPack[P].centerX,M.tiledMemberPack[P].centerY),N.labelMarginLeft=0,N.labelMarginTop=0,m.NODE_DIMENSIONS_INCLUDE_LABELS){var F=N.rect.width,B=N.rect.height;N.labelWidth&&(N.labelPosHorizontal=="left"?(N.rect.x-=N.labelWidth,N.setWidth(F+N.labelWidth),N.labelMarginLeft=N.labelWidth):N.labelPosHorizontal=="center"&&N.labelWidth>F?(N.rect.x-=(N.labelWidth-F)/2,N.setWidth(N.labelWidth),N.labelMarginLeft=(N.labelWidth-F)/2):N.labelPosHorizontal=="right"&&N.setWidth(F+N.labelWidth)),N.labelHeight&&(N.labelPosVertical=="top"?(N.rect.y-=N.labelHeight,N.setHeight(B+N.labelHeight),N.labelMarginTop=N.labelHeight):N.labelPosVertical=="center"&&N.labelHeight>B?(N.rect.y-=(N.labelHeight-B)/2,N.setHeight(N.labelHeight),N.labelMarginTop=(N.labelHeight-B)/2):N.labelPosVertical=="bottom"&&N.setHeight(B+N.labelHeight))}})},I.prototype.tileNodes=function(R,D){var M=this.tileNodesByFavoringDim(R,D,!0),P=this.tileNodesByFavoringDim(R,D,!1),N=this.getOrgRatio(M),F=this.getOrgRatio(P),B;return FV&&(V=le.getWidth())});var z=F/N,U=B/N,Q=Math.pow(M-P,2)+4*(z+P)*(U+M)*N,G=(P-M+Math.sqrt(Q))/(2*(z+P)),X;D?(X=Math.ceil(G),X==G&&X++):X=Math.floor(G);var Y=X*(z+P)-P;return V>Y&&(Y=V),Y+=P*2,Y},I.prototype.tileNodesByFavoringDim=function(R,D,M){var P=m.TILING_PADDING_VERTICAL,N=m.TILING_PADDING_HORIZONTAL,F=m.TILING_COMPARE_BY,B={rows:[],rowWidth:[],rowHeight:[],width:0,height:D,verticalPadding:P,horizontalPadding:N,centerX:0,centerY:0};F&&(B.idealRowWidth=this.calcIdealRowWidth(R,M));var V=function(q){return q.rect.width*q.rect.height},z=function(q,Z){return V(Z)-V(q)};R.sort(function(le,q){var Z=z;return B.idealRowWidth?(Z=F,Z(le.id,q.id)):Z(le,q)});for(var U=0,Q=0,G=0;G0&&(B+=R.horizontalPadding),R.rowWidth[M]=B,R.width0&&(V+=R.verticalPadding);var z=0;V>R.rowHeight[M]&&(z=R.rowHeight[M],R.rowHeight[M]=V,z=R.rowHeight[M]-z),R.height+=z,R.rows[M].push(D)},I.prototype.getShortestRowIndex=function(R){for(var D=-1,M=Number.MAX_VALUE,P=0;PM&&(D=P,M=R.rowWidth[P]);return D},I.prototype.canAddHorizontal=function(R,D,M){if(R.idealRowWidth){var P=R.rows.length-1,N=R.rowWidth[P];return N+D+R.horizontalPadding<=R.idealRowWidth}var F=this.getShortestRowIndex(R);if(F<0)return!0;var B=R.rowWidth[F];if(B+R.horizontalPadding+D<=R.width)return!0;var V=0;R.rowHeight[F]0&&(V=M+R.verticalPadding-R.rowHeight[F]);var z;R.width-B>=D+R.horizontalPadding?z=(R.height+V)/(B+D+R.horizontalPadding):z=(R.height+V)/R.width,V=M+R.verticalPadding;var U;return R.widthF&&D!=M){P.splice(-1,1),R.rows[M].push(N),R.rowWidth[D]=R.rowWidth[D]-F,R.rowWidth[M]=R.rowWidth[M]+F,R.width=R.rowWidth[instance.getLongestRowIndex(R)];for(var B=Number.MIN_VALUE,V=0;VB&&(B=P[V].height);D>0&&(B+=R.verticalPadding);var z=R.rowHeight[D]+R.rowHeight[M];R.rowHeight[D]=B,R.rowHeight[M]0)for(var Y=N;Y<=F;Y++)X[0]+=this.grid[Y][B-1].length+this.grid[Y][B].length-1;if(F0)for(var Y=B;Y<=V;Y++)X[3]+=this.grid[N-1][Y].length+this.grid[N][Y].length-1;for(var le=T.MAX_VALUE,q,Z,ee=0;ee{var h=u(551).FDLayoutNode,d=u(551).IMath;function f(g,m,v,y){h.call(this,g,m,v,y)}f.prototype=Object.create(h.prototype);for(var p in h)f[p]=h[p];f.prototype.calculateDisplacement=function(){var g=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(g,m){for(var v=this.getChild().getNodes(),y,b=0;b{function h(v){if(Array.isArray(v)){for(var y=0,b=Array(v.length);y0){var Rt=0;Me.forEach(function(ut){ye=="horizontal"?(Xe.set(ut,x.has(ut)?w[x.get(ut)]:_e.get(ut)),Rt+=Xe.get(ut)):(Xe.set(ut,x.has(ut)?A[x.get(ut)]:_e.get(ut)),Rt+=Xe.get(ut))}),Rt=Rt/Me.length,wt.forEach(function(ut){oe.has(ut)||Xe.set(ut,Rt)})}else{var Lt=0;wt.forEach(function(ut){ye=="horizontal"?Lt+=x.has(ut)?w[x.get(ut)]:_e.get(ut):Lt+=x.has(ut)?A[x.get(ut)]:_e.get(ut)}),Lt=Lt/wt.length,wt.forEach(function(ut){Xe.set(ut,Lt)})}});for(var Ge=function(){var Me=Ze.shift(),Rt=te.get(Me);Rt.forEach(function(Lt){if(Xe.get(Lt.id)ut&&(ut=Mt),jrXt&&(Xt=jr)}}catch(un){gt=!0,Ae=un}finally{try{!Ft&&zt.return&&zt.return()}finally{if(gt)throw Ae}}var Re=(Rt+ut)/2-(Lt+Xt)/2,at=!0,xt=!1,Ct=void 0;try{for(var gr=wt[Symbol.iterator](),Xr;!(at=(Xr=gr.next()).done);at=!0){var $r=Xr.value;Xe.set($r,Xe.get($r)+Re)}}catch(un){xt=!0,Ct=un}finally{try{!at&&gr.return&&gr.return()}finally{if(xt)throw Ct}}})}return Xe},L=function(te){var ye=0,oe=0,_e=0,Le=0;if(te.forEach(function(Ne){Ne.left?w[x.get(Ne.left)]-w[x.get(Ne.right)]>=0?ye++:oe++:A[x.get(Ne.top)]-A[x.get(Ne.bottom)]>=0?_e++:Le++}),ye>oe&&_e>Le)for(var Ye=0;Yeoe)for(var Pe=0;PeLe)for(var Xe=0;Xe1)y.fixedNodeConstraint.forEach(function(pe,te){P[te]=[pe.position.x,pe.position.y],N[te]=[w[x.get(pe.nodeId)],A[x.get(pe.nodeId)]]}),F=!0;else if(y.alignmentConstraint)(function(){var pe=0;if(y.alignmentConstraint.vertical){for(var te=y.alignmentConstraint.vertical,ye=function(Xe){var Ne=new Set;te[Xe].forEach(function(lt){Ne.add(lt)});var Ze=new Set([].concat(h(Ne)).filter(function(lt){return V.has(lt)})),Ge=void 0;Ze.size>0?Ge=w[x.get(Ze.values().next().value)]:Ge=_(Ne).x,te[Xe].forEach(function(lt){P[pe]=[Ge,A[x.get(lt)]],N[pe]=[w[x.get(lt)],A[x.get(lt)]],pe++})},oe=0;oe0?Ge=w[x.get(Ze.values().next().value)]:Ge=_(Ne).y,_e[Xe].forEach(function(lt){P[pe]=[w[x.get(lt)],Ge],N[pe]=[w[x.get(lt)],A[x.get(lt)]],pe++})},Ye=0;Ye<_e.length;Ye++)Le(Ye);F=!0}y.relativePlacementConstraint&&(B=!0)})();else if(y.relativePlacementConstraint){for(var G=0,X=0,Y=0;YG&&(G=Q[Y].length,X=Y);if(G0){var Te={x:0,y:0};y.fixedNodeConstraint.forEach(function(pe,te){var ye={x:w[x.get(pe.nodeId)],y:A[x.get(pe.nodeId)]},oe=pe.position,_e=E(oe,ye);Te.x+=_e.x,Te.y+=_e.y}),Te.x/=y.fixedNodeConstraint.length,Te.y/=y.fixedNodeConstraint.length,w.forEach(function(pe,te){w[te]+=Te.x}),A.forEach(function(pe,te){A[te]+=Te.y}),y.fixedNodeConstraint.forEach(function(pe){w[x.get(pe.nodeId)]=pe.position.x,A[x.get(pe.nodeId)]=pe.position.y})}if(y.alignmentConstraint){if(y.alignmentConstraint.vertical)for(var De=y.alignmentConstraint.vertical,qe=function(te){var ye=new Set;De[te].forEach(function(Le){ye.add(Le)});var oe=new Set([].concat(h(ye)).filter(function(Le){return V.has(Le)})),_e=void 0;oe.size>0?_e=w[x.get(oe.values().next().value)]:_e=_(ye).x,ye.forEach(function(Le){V.has(Le)||(w[x.get(Le)]=_e)})},K=0;K0?_e=A[x.get(oe.values().next().value)]:_e=_(ye).y,ye.forEach(function(Le){V.has(Le)||(A[x.get(Le)]=_e)})},ne=0;ne{o.exports=r}},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(45);return s})()})}(FDe)),FDe.exports}(function(t,e){(function(n,i){t.exports=i(kZn())})(xi,function(r){return(()=>{var n={658:o=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(l){for(var u=arguments.length,h=Array(u>1?u-1:0),d=1;d{var h=function(){function p(g,m){var v=[],y=!0,b=!1,x=void 0;try{for(var w=g[Symbol.iterator](),A;!(y=(A=w.next()).done)&&(v.push(A.value),!(m&&v.length===m));y=!0);}catch(S){b=!0,x=S}finally{try{!y&&w.return&&w.return()}finally{if(b)throw x}}return v}return function(g,m){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return p(g,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),d=u(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(p){for(var g={},m=0;m0&&F.merge(U)});for(var B=0;B1){A=x[0],S=A.connectedEdges().length,x.forEach(function(N){N.connectedEdges().length0&&v.set("dummy"+(v.size+1),k),E},f.relocateComponent=function(p,g,m){if(!m.fixedNodeConstraint){var v=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,b=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY;if(m.quality=="draft"){var w=!0,A=!1,S=void 0;try{for(var T=g.nodeIndexes[Symbol.iterator](),O;!(w=(O=T.next()).done);w=!0){var k=O.value,E=h(k,2),_=E[0],I=E[1],L=m.cy.getElementById(_);if(L){var R=L.boundingBox(),D=g.xCoords[I]-R.w/2,M=g.xCoords[I]+R.w/2,P=g.yCoords[I]-R.h/2,N=g.yCoords[I]+R.h/2;Dy&&(y=M),Px&&(x=N)}}}catch(U){A=!0,S=U}finally{try{!w&&T.return&&T.return()}finally{if(A)throw S}}var F=p.x-(y+v)/2,B=p.y-(x+b)/2;g.xCoords=g.xCoords.map(function(U){return U+F}),g.yCoords=g.yCoords.map(function(U){return U+B})}else{Object.keys(g).forEach(function(U){var Q=g[U],G=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,Y=Q.getRect().y,le=Q.getRect().y+Q.getRect().height;Gy&&(y=X),Yx&&(x=le)});var V=p.x-(y+v)/2,z=p.y-(x+b)/2;Object.keys(g).forEach(function(U){var Q=g[U];Q.setCenter(Q.getCenterX()+V,Q.getCenterY()+z)})}}},f.calcBoundingBox=function(p,g,m,v){for(var y=Number.MAX_SAFE_INTEGER,b=Number.MIN_SAFE_INTEGER,x=Number.MAX_SAFE_INTEGER,w=Number.MIN_SAFE_INTEGER,A=void 0,S=void 0,T=void 0,O=void 0,k=p.descendants().not(":parent"),E=k.length,_=0;_A&&(y=A),bT&&(x=T),w{var h=u(548),d=u(140).CoSELayout,f=u(140).CoSENode,p=u(140).layoutBase.PointD,g=u(140).layoutBase.DimensionD,m=u(140).layoutBase.LayoutConstants,v=u(140).layoutBase.FDLayoutConstants,y=u(140).CoSEConstants,b=function(w,A){var S=w.cy,T=w.eles,O=T.nodes(),k=T.edges(),E=void 0,_=void 0,I=void 0,L={};w.randomize&&(E=A.nodeIndexes,_=A.xCoords,I=A.yCoords);var R=function(U){return typeof U=="function"},D=function(U,Q){return R(U)?U(Q):U},M=h.calcParentsWithoutChildren(S,T),P=function z(U,Q,G,X){for(var Y=Q.length,le=0;le0){var ae=void 0;ae=G.getGraphManager().add(G.newGraph(),ee),z(ae,Z,G,X)}}},N=function(U,Q,G){for(var X=0,Y=0,le=0;le0?y.DEFAULT_EDGE_LENGTH=v.DEFAULT_EDGE_LENGTH=X/Y:R(w.idealEdgeLength)?y.DEFAULT_EDGE_LENGTH=v.DEFAULT_EDGE_LENGTH=50:y.DEFAULT_EDGE_LENGTH=v.DEFAULT_EDGE_LENGTH=w.idealEdgeLength,y.MIN_REPULSION_DIST=v.MIN_REPULSION_DIST=v.DEFAULT_EDGE_LENGTH/10,y.DEFAULT_RADIAL_SEPARATION=v.DEFAULT_EDGE_LENGTH)},F=function(U,Q){Q.fixedNodeConstraint&&(U.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(U.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(U.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};w.nestingFactor!=null&&(y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=v.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=w.nestingFactor),w.gravity!=null&&(y.DEFAULT_GRAVITY_STRENGTH=v.DEFAULT_GRAVITY_STRENGTH=w.gravity),w.numIter!=null&&(y.MAX_ITERATIONS=v.MAX_ITERATIONS=w.numIter),w.gravityRange!=null&&(y.DEFAULT_GRAVITY_RANGE_FACTOR=v.DEFAULT_GRAVITY_RANGE_FACTOR=w.gravityRange),w.gravityCompound!=null&&(y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=v.DEFAULT_COMPOUND_GRAVITY_STRENGTH=w.gravityCompound),w.gravityRangeCompound!=null&&(y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=w.gravityRangeCompound),w.initialEnergyOnIncremental!=null&&(y.DEFAULT_COOLING_FACTOR_INCREMENTAL=v.DEFAULT_COOLING_FACTOR_INCREMENTAL=w.initialEnergyOnIncremental),w.tilingCompareBy!=null&&(y.TILING_COMPARE_BY=w.tilingCompareBy),w.quality=="proof"?m.QUALITY=2:m.QUALITY=0,y.NODE_DIMENSIONS_INCLUDE_LABELS=v.NODE_DIMENSIONS_INCLUDE_LABELS=m.NODE_DIMENSIONS_INCLUDE_LABELS=w.nodeDimensionsIncludeLabels,y.DEFAULT_INCREMENTAL=v.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!w.randomize,y.ANIMATE=v.ANIMATE=m.ANIMATE=w.animate,y.TILE=w.tile,y.TILING_PADDING_VERTICAL=typeof w.tilingPaddingVertical=="function"?w.tilingPaddingVertical.call():w.tilingPaddingVertical,y.TILING_PADDING_HORIZONTAL=typeof w.tilingPaddingHorizontal=="function"?w.tilingPaddingHorizontal.call():w.tilingPaddingHorizontal,y.DEFAULT_INCREMENTAL=v.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!0,y.PURE_INCREMENTAL=!w.randomize,m.DEFAULT_UNIFORM_LEAF_NODE_SIZES=w.uniformNodeDimensions,w.step=="transformed"&&(y.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,y.ENFORCE_CONSTRAINTS=!1,y.APPLY_LAYOUT=!1),w.step=="enforced"&&(y.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,y.ENFORCE_CONSTRAINTS=!0,y.APPLY_LAYOUT=!1),w.step=="cose"&&(y.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,y.ENFORCE_CONSTRAINTS=!1,y.APPLY_LAYOUT=!0),w.step=="all"&&(w.randomize?y.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:y.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,y.ENFORCE_CONSTRAINTS=!0,y.APPLY_LAYOUT=!0),w.fixedNodeConstraint||w.alignmentConstraint||w.relativePlacementConstraint?y.TREE_REDUCTION_ON_INCREMENTAL=!1:y.TREE_REDUCTION_ON_INCREMENTAL=!0;var B=new d,V=B.newGraphManager();return P(V.addRoot(),h.getTopMostNodes(O),B,w),N(B,V,k),F(B,w),B.runLayout(),L};o.exports={coseLayout:b}},212:(o,l,u)=>{var h=function(){function w(A,S){for(var T=0;T0)if(M){var F=p.getTopMostNodes(T.eles.nodes());if(I=p.connectComponents(O,T.eles,F),I.forEach(function($e){var he=$e.boundingBox();L.push({x:he.x1+he.w/2,y:he.y1+he.h/2})}),T.randomize&&I.forEach(function($e){T.eles=$e,E.push(m(T))}),T.quality=="default"||T.quality=="proof"){var B=O.collection();if(T.tile){var V=new Map,z=[],U=[],Q=0,G={nodeIndexes:V,xCoords:z,yCoords:U},X=[];if(I.forEach(function($e,he){$e.edges().length==0&&($e.nodes().forEach(function(fe,Se){B.merge($e.nodes()[Se]),fe.isParent()||(G.nodeIndexes.set($e.nodes()[Se].id(),Q++),G.xCoords.push($e.nodes()[0].position().x),G.yCoords.push($e.nodes()[0].position().y))}),X.push(he))}),B.length>1){var Y=B.boundingBox();L.push({x:Y.x1+Y.w/2,y:Y.y1+Y.h/2}),I.push(B),E.push(G);for(var le=X.length-1;le>=0;le--)I.splice(X[le],1),E.splice(X[le],1),L.splice(X[le],1)}}I.forEach(function($e,he){T.eles=$e,_.push(y(T,E[he])),p.relocateComponent(L[he],_[he],T)})}else I.forEach(function($e,he){p.relocateComponent(L[he],E[he],T)});var q=new Set;if(I.length>1){var Z=[],ee=k.filter(function($e){return $e.css("display")=="none"});I.forEach(function($e,he){var fe=void 0;if(T.quality=="draft"&&(fe=E[he].nodeIndexes),$e.nodes().not(ee).length>0){var Se={};Se.edges=[],Se.nodes=[];var ge=void 0;$e.nodes().not(ee).forEach(function(Qe){if(T.quality=="draft")if(!Qe.isParent())ge=fe.get(Qe.id()),Se.nodes.push({x:E[he].xCoords[ge]-Qe.boundingbox().w/2,y:E[he].yCoords[ge]-Qe.boundingbox().h/2,width:Qe.boundingbox().w,height:Qe.boundingbox().h});else{var Te=p.calcBoundingBox(Qe,E[he].xCoords,E[he].yCoords,fe);Se.nodes.push({x:Te.topLeftX,y:Te.topLeftY,width:Te.width,height:Te.height})}else _[he][Qe.id()]&&Se.nodes.push({x:_[he][Qe.id()].getLeft(),y:_[he][Qe.id()].getTop(),width:_[he][Qe.id()].getWidth(),height:_[he][Qe.id()].getHeight()})}),$e.edges().forEach(function(Qe){var Te=Qe.source(),De=Qe.target();if(Te.css("display")!="none"&&De.css("display")!="none")if(T.quality=="draft"){var qe=fe.get(Te.id()),K=fe.get(De.id()),ce=[],be=[];if(Te.isParent()){var ne=p.calcBoundingBox(Te,E[he].xCoords,E[he].yCoords,fe);ce.push(ne.topLeftX+ne.width/2),ce.push(ne.topLeftY+ne.height/2)}else ce.push(E[he].xCoords[qe]),ce.push(E[he].yCoords[qe]);if(De.isParent()){var j=p.calcBoundingBox(De,E[he].xCoords,E[he].yCoords,fe);be.push(j.topLeftX+j.width/2),be.push(j.topLeftY+j.height/2)}else be.push(E[he].xCoords[K]),be.push(E[he].yCoords[K]);Se.edges.push({startX:ce[0],startY:ce[1],endX:be[0],endY:be[1]})}else _[he][Te.id()]&&_[he][De.id()]&&Se.edges.push({startX:_[he][Te.id()].getCenterX(),startY:_[he][Te.id()].getCenterY(),endX:_[he][De.id()].getCenterX(),endY:_[he][De.id()].getCenterY()})}),Se.nodes.length>0&&(Z.push(Se),q.add(he))}});var re=D.packComponents(Z,T.randomize).shifts;if(T.quality=="draft")E.forEach(function($e,he){var fe=$e.xCoords.map(function(ge){return ge+re[he].dx}),Se=$e.yCoords.map(function(ge){return ge+re[he].dy});$e.xCoords=fe,$e.yCoords=Se});else{var ve=0;q.forEach(function($e){Object.keys(_[$e]).forEach(function(he){var fe=_[$e][he];fe.setCenter(fe.getCenterX()+re[ve].dx,fe.getCenterY()+re[ve].dy)}),ve++})}}}else{var P=T.eles.boundingBox();if(L.push({x:P.x1+P.w/2,y:P.y1+P.h/2}),T.randomize){var N=m(T);E.push(N)}T.quality=="default"||T.quality=="proof"?(_.push(y(T,E[0])),p.relocateComponent(L[0],_[0],T)):p.relocateComponent(L[0],E[0],T)}var ae=function(he,fe){if(T.quality=="default"||T.quality=="proof"){typeof he=="number"&&(he=fe);var Se=void 0,ge=void 0,Qe=he.data("id");return _.forEach(function(De){Qe in De&&(Se={x:De[Qe].getRect().getCenterX(),y:De[Qe].getRect().getCenterY()},ge=De[Qe])}),T.nodeDimensionsIncludeLabels&&(ge.labelWidth&&(ge.labelPosHorizontal=="left"?Se.x+=ge.labelWidth/2:ge.labelPosHorizontal=="right"&&(Se.x-=ge.labelWidth/2)),ge.labelHeight&&(ge.labelPosVertical=="top"?Se.y+=ge.labelHeight/2:ge.labelPosVertical=="bottom"&&(Se.y-=ge.labelHeight/2))),Se==null&&(Se={x:he.position("x"),y:he.position("y")}),{x:Se.x,y:Se.y}}else{var Te=void 0;return E.forEach(function(De){var qe=De.nodeIndexes.get(he.id());qe!=null&&(Te={x:De.xCoords[qe],y:De.yCoords[qe]})}),Te==null&&(Te={x:he.position("x"),y:he.position("y")}),{x:Te.x,y:Te.y}}};if(T.quality=="default"||T.quality=="proof"||T.randomize){var Ce=p.calcParentsWithoutChildren(O,k),Oe=k.filter(function($e){return $e.css("display")=="none"});T.eles=k.not(Oe),k.nodes().not(":parent").not(Oe).layoutPositions(S,T,ae),Ce.length>0&&Ce.forEach(function($e){$e.position(ae($e))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),w}();o.exports=x},657:(o,l,u)=>{var h=u(548),d=u(140).layoutBase.Matrix,f=u(140).layoutBase.SVD,p=function(m){var v=m.cy,y=m.eles,b=y.nodes(),x=y.nodes(":parent"),w=new Map,A=new Map,S=new Map,T=[],O=[],k=[],E=[],_=[],I=[],L=[],R=[],D=void 0,M=1e8,P=1e-9,N=m.piTol,F=m.samplingType,B=m.nodeSeparation,V=void 0,z=function(){for(var te=0,ye=0,oe=!1;ye=Le;){Pe=_e[Le++];for(var Fe=T[Pe],wt=0;wtZe&&(Ze=_[Rt],Ge=Rt)}return Ge},Q=function(te){var ye=void 0;if(te){ye=Math.floor(Math.random()*D);for(var _e=0;_e=1)break;Ne=Xe}for(var lt=0;lt=1)break;Ne=Xe}for(var wt=0;wt0&&(ye.isParent()?T[te].push(S.get(ye.id())):T[te].push(ye.id()))})});var Oe=function(te){var ye=A.get(te),oe=void 0;w.get(te).forEach(function(_e){v.getElementById(_e).isParent()?oe=S.get(_e):oe=_e,T[ye].push(oe),T[A.get(oe)].push(te)})},$e=!0,he=!1,fe=void 0;try{for(var Se=w.keys()[Symbol.iterator](),ge;!($e=(ge=Se.next()).done);$e=!0){var Qe=ge.value;Oe(Qe)}}catch(pe){he=!0,fe=pe}finally{try{!$e&&Se.return&&Se.return()}finally{if(he)throw fe}}D=A.size;var Te=void 0;if(D>2){V=D{var h=u(212),d=function(p){p&&p("layout","fcose",h)};typeof cytoscape<"u"&&d(cytoscape),o.exports=d},140:o=>{o.exports=r}},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(579);return s})()})})(EXt);var EZn=EXt.exports;const _Zn=uh(EZn);var DXt={L:"left",R:"right",T:"top",B:"bottom"},LXt={L:C(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:C(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:C(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:C(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},Zne={L:C((t,e)=>t-e+2,"L"),R:C((t,e)=>t-2,"R"),T:C((t,e)=>t-e+2,"T"),B:C((t,e)=>t-2,"B")},RZn=C(function(t){return lh(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),MXt=C(function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),lh=C(function(t){const e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),yw=C(function(t){const e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),UDe=C(function(t,e){const r=lh(t)&&yw(e),n=yw(t)&&lh(e);return r||n},"isArchitectureDirectionXY"),DZn=C(function(t){const e=t[0],r=t[1],n=lh(e)&&yw(r),i=yw(e)&&lh(r);return n||i},"isArchitecturePairXY"),LZn=C(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),VDe=C(function(t,e){const r=`${t}${e}`;return LZn(r)?r:void 0},"getArchitectureDirectionPair"),MZn=C(function([t,e],r){const n=r[0],i=r[1];return lh(n)?yw(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:lh(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),IZn=C(function(t){return t==="LT"||t==="TL"?[1,1]:t==="BL"||t==="LB"?[1,-1]:t==="BR"||t==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),PZn=C(function(t,e){return UDe(t,e)?"bend":lh(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),NZn=C(function(t){return t.type==="service"},"isArchitectureService"),BZn=C(function(t){return t.type==="junction"},"isArchitectureJunction"),IXt=C((t,e)=>{const[r,n]=[t,e].sort();return`${JSON.stringify(r)}-${JSON.stringify(n)}`},"architectureGroupAlignmentKey"),PXt=C(t=>t.data(),"edgeData"),rD=C(t=>t.data(),"nodeData"),$Zn=Xn.architecture,NXt=(VI=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=Da,this.getAccTitle=Ja,this.setDiagramTitle=rs,this.getDiagramTitle=La,this.getAccDescription=ts,this.setAccDescription=es,this.clear()}setDiagramId(e){this.diagramId=e}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",Aa()}addService({id:e,icon:r,in:n,title:i,iconText:a}){if(this.registeredIds.has(e))throw new Error(`The service id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(n!==void 0){if(e===n)throw new Error(`The service [${e}] cannot be placed within itself`);if(!this.registeredIds.has(n))throw new Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(n)==="node")throw new Error(`The service [${e}]'s parent is not a group`)}this.registeredIds.set(e,"node"),this.nodes.set(e,{id:e,type:"service",icon:r,iconText:a,title:i,edges:[],in:n})}getServices(){return[...this.nodes.values()].filter(NZn)}addJunction({id:e,in:r}){if(this.registeredIds.has(e))throw new Error(`The junction id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(r!==void 0){if(e===r)throw new Error(`The junction [${e}] cannot be placed within itself`);if(!this.registeredIds.has(r))throw new Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(r)==="node")throw new Error(`The junction [${e}]'s parent is not a group`)}this.registeredIds.set(e,"node"),this.nodes.set(e,{id:e,type:"junction",edges:[],in:r})}getJunctions(){return[...this.nodes.values()].filter(BZn)}getNodes(){return[...this.nodes.values()]}getNode(e){return this.nodes.get(e)??null}addGroup({id:e,icon:r,in:n,title:i}){if(this.registeredIds.has(e))throw new Error(`The group id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(n!==void 0){if(e===n)throw new Error(`The group [${e}] cannot be placed within itself`);if(!this.registeredIds.has(n))throw new Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(n)==="node")throw new Error(`The group [${e}]'s parent is not a group`)}this.registeredIds.set(e,"group"),this.groups.set(e,{id:e,icon:r,title:i,in:n})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:e,rhsId:r,lhsDir:n,rhsDir:i,lhsInto:a,rhsInto:s,lhsGroup:o,rhsGroup:l,title:u}){if(!MXt(n))throw new Error(`Invalid direction given for left hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(n)}`);if(!MXt(i))throw new Error(`Invalid direction given for right hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(i)}`);if(!this.nodes.has(e)&&!this.groups.has(e))throw new Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(r)&&!this.groups.has(r))throw new Error(`The right-hand id [${r}] does not yet exist. Please create the service/group before declaring an edge to it.`);const h=this.nodes.get(e).in,d=this.nodes.get(r).in;if(o&&h&&d&&h==d)throw new Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(l&&h&&d&&h==d)throw new Error(`The right-hand id [${r}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const f={lhsId:e,lhsDir:n,lhsInto:a,lhsGroup:o,rhsId:r,rhsDir:i,rhsInto:s,rhsGroup:l,title:u};this.edges.push(f);const p=this.nodes.get(e),g=this.nodes.get(r);p&&g&&(p.edges.push(this.edges[this.edges.length-1]),g.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(e){if(e.members.length<2)throw new Error(`An align directive requires at least two members; got ${e.members.length}`);const r=new Set;e.members.forEach(n=>{if(this.registeredIds.get(n)!=="node")throw new Error(`align ${e.direction} references [${n}], which is not a service or junction`);if(r.has(n))throw new Error(`align ${e.direction} lists [${n}] more than once`);r.add(n)}),this.layoutHints.push(e)}getLayoutHints(){return this.layoutHints}getDataStructures(){var e,r;if(this.dataStructures===void 0){const n=new Map,i=new Map;for(const[u,h]of this.nodes.entries()){const d=new Map;for(const f of h.edges){const p=(e=this.getNode(f.lhsId))==null?void 0:e.in,g=(r=this.getNode(f.rhsId))==null?void 0:r.in;if(p&&g&&p!==g){const m=PZn(f.lhsDir,f.rhsDir);m!=="bend"&&n.set(IXt(p,g),m)}if(f.lhsId===u){const m=VDe(f.lhsDir,f.rhsDir);m&&d.set(m,f.rhsId)}else{const m=VDe(f.rhsDir,f.lhsDir);m&&d.set(m,f.lhsId)}}i.set(u,d)}const a=new Set,s=new Set(i.keys()),o=C(u=>{const h=new Map([[u,[0,0]]]),d=[u];for(;d.length>0;){const f=d.shift();if(f){a.add(f),s.delete(f);const p=i.get(f);if(!p)throw new Error(`BFS error: adjacency list for id ${f} not found. Please report this as a bug.`);const g=h.get(f);if(!g)throw new Error(`BFS error: position for id ${f} not found in spatial map. Please report this as a bug.`);const[m,v]=g;p.forEach((y,b)=>{a.has(y)||(h.set(y,MZn([m,v],b)),d.push(y))})}}return h},"BFS"),l=[];for(;s.size>0;){const u=s.values().next().value;l.push(o(u))}this.dataStructures={adjList:i,spatialMaps:l,groupAlignments:n}}return this.dataStructures}setElementForId(e,r){this.elements.set(e,r)}getElementById(e){return this.elements.get(e)}getConfig(){return ns({...$Zn,...Dr().architecture})}getConfigField(e){return this.getConfig()[e]}},C(VI,"ArchitectureDB"),VI),FZn=C((t,e)=>{var r;qu(t,e),t.groups.map(n=>e.addGroup(n)),t.services.map(n=>e.addService({...n,type:"service"})),t.junctions.map(n=>e.addJunction({...n,type:"junction"})),t.edges.map(n=>e.addEdge(n)),(r=t.alignments)==null||r.map(n=>e.addLayoutHint({direction:n.direction,members:[...n.members]}))},"populateDb"),BXt={parser:{yy:void 0},parse:C(async t=>{var n;const e=await Op("architecture",t);me.debug(e);const r=(n=BXt.parser)==null?void 0:n.yy;if(!(r instanceof NXt))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");FZn(e,r)},"parse")},zZn=C(t=>` .edge { stroke-width: ${t.archEdgeWidth}; stroke: ${t.archEdgeColor}; @@ -3594,10 +3594,10 @@ Expecting `+re.join(", ")+", got '"+(this.terminals_[Q]||Q)+"'":ve="Parse error stroke-dasharray: 8; } .node-icon-text { - display: flex; + display: flex; align-items: center; } - + .node-icon-text > div { color: #fff; margin: 1px; @@ -3607,19 +3607,19 @@ Expecting `+re.join(", ")+", got '"+(this.terminals_[Q]||Q)+"'":ve="Parse error display: -webkit-box; -webkit-box-orient: vertical; } -`,"getStyles"),UZn=zZn;function QDe(t,e){if(t===0)return e();const r=Math.random;let n=t>>>0;Math.random=function(){n=n+1831565813>>>0;let i=n;return i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61),((i^i>>>14)>>>0)/4294967296};try{return e()}finally{Math.random=r}}C(QDe,"withSeededRandom");var nD=C(t=>`${t}`,"wrapIcon"),Nz={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:nD('')},server:{body:nD('')},disk:{body:nD('')},internet:{body:nD('')},cloud:{body:nD('')},unknown:s1t,blank:{body:nD("")}}},VZn=C(async function(t,e,r,n){const i=r.getConfigField("padding"),a=r.getConfigField("iconSize"),s=a/2,o=a/6,l=o/2;await Promise.all(e.edges().map(async u=>{var E,_;const{source:h,sourceDir:d,sourceArrow:f,sourceGroup:p,target:g,targetDir:m,targetArrow:v,targetGroup:y,label:b}=PXt(u);let{x,y:w}=u[0].sourceEndpoint();const{x:A,y:T}=u[0].midpoint();let{x:S,y:O}=u[0].targetEndpoint();const k=i+4;if(p&&(lh(d)?x+=d==="L"?-k:k:w+=d==="T"?-k:k+18),y&&(lh(m)?S+=m==="L"?-k:k:O+=m==="T"?-k:k+18),!p&&((E=r.getNode(h))==null?void 0:E.type)==="junction"&&(lh(d)?x+=d==="L"?s:-s:w+=d==="T"?s:-s),!y&&((_=r.getNode(g))==null?void 0:_.type)==="junction"&&(lh(m)?S+=m==="L"?s:-s:O+=m==="T"?s:-s),u[0]._private.rscratch){const I=t.insert("g");if(I.insert("path").attr("d",`M ${x},${w} L ${A},${T} L${S},${O} `).attr("class","edge").attr("id",`${n}-${Y5(h,g,{prefix:"L"})}`),f){const L=lh(d)?Zne[d](x,o):x-l,R=yw(d)?Zne[d](w,o):w-l;I.insert("polygon").attr("points",LXt[d](o)).attr("transform",`translate(${L},${R})`).attr("class","arrow")}if(v){const L=lh(m)?Zne[m](S,o):S-l,R=yw(m)?Zne[m](O,o):O-l;I.insert("polygon").attr("points",LXt[m](o)).attr("transform",`translate(${L},${R})`).attr("class","arrow")}if(b){const L=UDe(d,m)?"XY":lh(d)?"X":"Y";let R=0;L==="X"?R=Math.abs(x-S):L==="Y"?R=Math.abs(w-O)/1.5:R=Math.abs(x-S)/2;const D=I.append("g");if(await Zc(D,b,{useHtmlLabels:!1,width:R,classes:"architecture-service-label"},He()),D.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),L==="X")D.attr("transform","translate("+A+", "+T+")");else if(L==="Y")D.attr("transform","translate("+A+", "+T+") rotate(-90)");else if(L==="XY"){const M=VDe(d,m);if(M&&DZn(M)){const P=D.node().getBoundingClientRect(),[N,F]=IZn(M);D.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*N*F*45})`);const B=D.node().getBoundingClientRect();D.attr("transform",` - translate(${A}, ${T-P.height/2}) +`,"getStyles"),UZn=zZn;function QDe(t,e){if(t===0)return e();const r=Math.random;let n=t>>>0;Math.random=function(){n=n+1831565813>>>0;let i=n;return i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61),((i^i>>>14)>>>0)/4294967296};try{return e()}finally{Math.random=r}}C(QDe,"withSeededRandom");var nD=C(t=>`${t}`,"wrapIcon"),Nz={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:nD('')},server:{body:nD('')},disk:{body:nD('')},internet:{body:nD('')},cloud:{body:nD('')},unknown:s1t,blank:{body:nD("")}}},VZn=C(async function(t,e,r,n){const i=r.getConfigField("padding"),a=r.getConfigField("iconSize"),s=a/2,o=a/6,l=o/2;await Promise.all(e.edges().map(async u=>{var E,_;const{source:h,sourceDir:d,sourceArrow:f,sourceGroup:p,target:g,targetDir:m,targetArrow:v,targetGroup:y,label:b}=PXt(u);let{x,y:w}=u[0].sourceEndpoint();const{x:A,y:S}=u[0].midpoint();let{x:T,y:O}=u[0].targetEndpoint();const k=i+4;if(p&&(lh(d)?x+=d==="L"?-k:k:w+=d==="T"?-k:k+18),y&&(lh(m)?T+=m==="L"?-k:k:O+=m==="T"?-k:k+18),!p&&((E=r.getNode(h))==null?void 0:E.type)==="junction"&&(lh(d)?x+=d==="L"?s:-s:w+=d==="T"?s:-s),!y&&((_=r.getNode(g))==null?void 0:_.type)==="junction"&&(lh(m)?T+=m==="L"?s:-s:O+=m==="T"?s:-s),u[0]._private.rscratch){const I=t.insert("g");if(I.insert("path").attr("d",`M ${x},${w} L ${A},${S} L${T},${O} `).attr("class","edge").attr("id",`${n}-${Y5(h,g,{prefix:"L"})}`),f){const L=lh(d)?Zne[d](x,o):x-l,R=yw(d)?Zne[d](w,o):w-l;I.insert("polygon").attr("points",LXt[d](o)).attr("transform",`translate(${L},${R})`).attr("class","arrow")}if(v){const L=lh(m)?Zne[m](T,o):T-l,R=yw(m)?Zne[m](O,o):O-l;I.insert("polygon").attr("points",LXt[m](o)).attr("transform",`translate(${L},${R})`).attr("class","arrow")}if(b){const L=UDe(d,m)?"XY":lh(d)?"X":"Y";let R=0;L==="X"?R=Math.abs(x-T):L==="Y"?R=Math.abs(w-O)/1.5:R=Math.abs(x-T)/2;const D=I.append("g");if(await Zc(D,b,{useHtmlLabels:!1,width:R,classes:"architecture-service-label"},He()),D.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),L==="X")D.attr("transform","translate("+A+", "+S+")");else if(L==="Y")D.attr("transform","translate("+A+", "+S+") rotate(-90)");else if(L==="XY"){const M=VDe(d,m);if(M&&DZn(M)){const P=D.node().getBoundingClientRect(),[N,F]=IZn(M);D.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*N*F*45})`);const B=D.node().getBoundingClientRect();D.attr("transform",` + translate(${A}, ${S-P.height/2}) translate(${N*B.width/2}, ${F*B.height/2}) rotate(${-1*N*F*45}, 0, ${P.height/2}) - `)}}}}}))},"drawEdges"),QZn=C(async function(t,e,r,n){const a=r.getConfigField("padding")*.75,s=r.getConfigField("fontSize"),l=r.getConfigField("iconSize")/2;await Promise.all(e.nodes().map(async u=>{const h=rD(u);if(h.type==="group"){const{h:d,w:f,x1:p,y1:g}=u.boundingBox(),m=t.append("rect");m.attr("id",`${n}-group-${h.id}`).attr("x",p+l).attr("y",g+l).attr("width",f).attr("height",d).attr("class","node-bkg");const v=t.append("g");let y=p,b=g;if(h.icon){const x=v.append("g");x.html(`${await Fy(h.icon,{height:a,width:a,fallbackPrefix:Nz.prefix})}`),x.attr("transform","translate("+(y+l+1)+", "+(b+l+1)+")"),y+=a,b+=s/2-1-2}if(h.label){const x=v.append("g");await Zc(x,h.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},He()),x.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),x.attr("transform","translate("+(y+l+4)+", "+(b+l+2)+")")}r.setElementForId(h.id,m)}}))},"drawGroups"),GZn=C(async function(t,e,r,n){const i=He();for(const a of r){const s=e.append("g"),o=t.getConfigField("iconSize");if(a.title){const d=s.append("g");await Zc(d,a.title,{useHtmlLabels:!1,width:o*1.5,classes:"architecture-service-label"},i),d.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),d.attr("transform","translate("+o/2+", "+o+")")}const l=s.append("g");if(a.icon)l.html(`${await Fy(a.icon,{height:o,width:o,fallbackPrefix:Nz.prefix})}`);else if(a.iconText){l.html(`${await Fy("blank",{height:o,width:o,fallbackPrefix:Nz.prefix})}`);const p=l.append("g").append("foreignObject").attr("width",o).attr("height",o).append("div").attr("class","node-icon-text").attr("style",`height: ${o}px;`).append("div").html(ai(a.iconText,i)),g=parseInt(window.getComputedStyle(p.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;p.attr("style",`-webkit-line-clamp: ${Math.floor((o-2)/g)};`)}else l.append("path").attr("class","node-bkg").attr("id",`${n}-node-${a.id}`).attr("d",`M0,${o} V5 Q0,0 5,0 H${o-5} Q${o},0 ${o},5 V${o} Z`);s.attr("id",`${n}-service-${a.id}`).attr("class","architecture-service");const{width:u,height:h}=s.node().getBBox();a.width=u,a.height=h,t.setElementForId(a.id,s)}return 0},"drawServices"),HZn=C(function(t,e,r,n){r.forEach(i=>{const a=e.append("g"),s=t.getConfigField("iconSize");a.append("g").append("rect").attr("id",`${n}-node-${i.id}`).attr("fill-opacity","0").attr("width",s).attr("height",s),a.attr("class","architecture-junction");const{width:l,height:u}=a._groups[0][0].getBBox();a.width=l,a.height=u,t.setElementForId(i.id,a)})},"drawJunctions");rbe([{name:Nz.prefix,icons:Nz}]),$0.use(_Zn);function $Xt(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"service",id:n.id,icon:n.icon,label:n.title,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-service"})})}C($Xt,"addServices");function FXt(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"junction",id:n.id,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-junction"})})}C(FXt,"addJunctions");function zXt(t,e){e.nodes().map(r=>{const n=rD(r);if(n.type==="group")return;n.x=r.position().x,n.y=r.position().y,t.getElementById(n.id).attr("transform","translate("+(n.x||0)+","+(n.y||0)+")")})}C(zXt,"positionNodes");function UXt(t,e){t.forEach(r=>{e.add({group:"nodes",data:{type:"group",id:r.id,icon:r.icon,label:r.title,parent:r.in},classes:"node-group"})})}C(UXt,"addGroups");function VXt(t,e){t.forEach(r=>{const{lhsId:n,rhsId:i,lhsInto:a,lhsGroup:s,rhsInto:o,lhsDir:l,rhsDir:u,rhsGroup:h,title:d}=r,f=UDe(r.lhsDir,r.rhsDir)?"segments":"straight",p={id:`${n}-${i}`,label:d,source:n,sourceDir:l,sourceArrow:a,sourceGroup:s,sourceEndpoint:l==="L"?"0 50%":l==="R"?"100% 50%":l==="T"?"50% 0":"50% 100%",target:i,targetDir:u,targetArrow:o,targetGroup:h,targetEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%"};e.add({group:"edges",data:p,classes:f})})}C(VXt,"addEdges");function QXt(t,e,r,n=[]){const i=C((f,p)=>{const g=new Map;for(const[m,v]of f.entries()){const y=`${m}`;let b=0;const x=[...v.entries()];if(x.length===1){g.set(y,x[0][1]);continue}for(let w=0;w{const p=new Map,g=new Map;return f.forEach(([m,v],y)=>{var A;const b=((A=t.getNode(y))==null?void 0:A.in)??"default",x=p.get(v)??new Map;p.has(v)||p.set(v,x);const w=g.get(m)??new Map;g.has(m)||g.set(m,w);for(const T of[x,w]){const S=T.get(b)??[];T.has(b)||T.set(b,S),S.push(y)}}),{horiz:[...i(p,"horizontal").values()].filter(m=>m.length>1),vert:[...i(g,"vertical").values()].filter(m=>m.length>1)}}),[s,o]=a.reduce(([f,p],{horiz:g,vert:m})=>[[...f,...g],[...p,...m]],[[],[]]),l=new Set;n.forEach(f=>f.members.forEach(p=>l.add(p)));const u=C(f=>f.filter(p=>!p.some(g=>l.has(g))),"dropOverlapping"),h=u(s),d=u(o);return n.forEach(f=>{f.members.length<2||(f.direction==="row"?h.push([...f.members]):d.push([...f.members]))}),{horizontal:h,vertical:d}}C(QXt,"getAlignments");function GXt(t,e,r=[]){const n=[],i=e.getConfigField("iconSize"),a=e.getConfigField("idealEdgeLengthMultiplier"),s=a*i,o=new Set;r.forEach(h=>{for(let d=0;d`${h[0]},${h[1]}`,"posToStr"),u=C(h=>h.split(",").map(d=>parseInt(d)),"strToPos");return t.forEach(h=>{const d=new Map([...h.entries()].map(([m,v])=>[l(v),m])),f=[l([0,0])],p={},g={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;f.length>0;){const m=f.shift();if(m){p[m]=1;const v=d.get(m);if(v){const y=u(m);Object.entries(g).forEach(([b,x])=>{const w=l([y[0]+x[0],y[1]+x[1]]),A=d.get(w);if(A&&!p[w]){if(f.push(w),o.has(`${v}|${A}`))return;n.push({[DXt[b]]:A,[DXt[RZn(b)]]:v,gap:a*i})}})}}}}),n}C(GXt,"getRelativeConstraints");function HXt(t,e,r,n,i,{spatialMaps:a,groupAlignments:s}){return new Promise(o=>{const l=Ot("body").append("div").attr("id","cy").attr("style","display:none"),u=$0({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${i.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${i.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});l.remove(),UXt(r,u),$Xt(t,u,i),FXt(e,u,i),VXt(n,u);const h=i.getLayoutHints(),d=QXt(i,a,s,h),f=GXt(a,i,h),p=i.getConfigField("iconSize"),g=i.getConfigField("idealEdgeLengthMultiplier")*p,m=.5*p,v=i.getConfigField("edgeElasticity"),y=i.getConfigField("seed"),b=u.layout({name:"fcose",quality:"proof",randomize:i.getConfigField("randomize"),nodeSeparation:i.getConfigField("nodeSeparation"),numIter:i.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(x){const[w,A]=x.connectedNodes(),{parent:T}=rD(w),{parent:S}=rD(A);return T===S?g:m},edgeElasticity(x){const[w,A]=x.connectedNodes(),{parent:T}=rD(w),{parent:S}=rD(A);return T===S?v:.001},alignmentConstraint:d,relativePlacementConstraint:f});b.one("layoutstop",()=>{var w;function x(A,T,S,O){let k,E;const{x:_,y:I}=A,{x:L,y:R}=T;E=(O-I+(_-S)*(I-R)/(_-L))/Math.sqrt(1+Math.pow((I-R)/(_-L),2)),k=Math.sqrt(Math.pow(O-I,2)+Math.pow(S-_,2)-Math.pow(E,2));const D=Math.sqrt(Math.pow(L-_,2)+Math.pow(R-I,2));k=k/D;let M=(L-_)*(O-I)-(R-I)*(S-_);switch(!0){case M>=0:M=1;break;case M<0:M=-1;break}let P=(L-_)*(S-_)+(R-I)*(O-I);switch(!0){case P>=0:P=1;break;case P<0:P=-1;break}return E=Math.abs(E)*M,k=k*P,{distances:E,weights:k}}C(x,"getSegmentWeights"),u.startBatch();for(const A of Object.values(u.edges()))if((w=A.data)!=null&&w.call(A)){const{x:T,y:S}=A.source().position(),{x:O,y:k}=A.target().position();if(T!==O&&S!==k){const E=A.sourceEndpoint(),_=A.targetEndpoint(),{sourceDir:I}=PXt(A),[L,R]=yw(I)?[E.x,_.y]:[_.x,E.y],{weights:D,distances:M}=x(E,_,L,R);A.style("segment-distances",M),A.style("segment-weights",D)}}u.endBatch(),QDe(y,()=>b.run())});try{QDe(y,()=>b.run())}catch(x){throw x instanceof RangeError&&x.message.includes("Invalid array length")?new Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis."):x}u.ready(x=>{me.info("Ready",x),o(u)})})}C(HXt,"layoutArchitecture");var WZn=C(async(t,e,r,n)=>{const i=n.db;i.setDiagramId(e);const a=i.getServices(),s=i.getJunctions(),o=i.getGroups(),l=i.getEdges(),u=i.getDataStructures(),h=qc(e),d=h.append("g");d.attr("class","architecture-edges");const f=h.append("g");f.attr("class","architecture-services");const p=h.append("g");p.attr("class","architecture-groups"),await GZn(i,f,a,e),HZn(i,f,s,e);const g=await HXt(a,s,o,l,i,u);await VZn(d,g,i,e),await QZn(p,g,i,e),zXt(i,g),E5(void 0,h,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw"),YZn={draw:WZn},qZn={parser:BXt,get db(){return new NXt},renderer:YZn,styles:UZn};const jZn=Object.freeze(Object.defineProperty({__proto__:null,diagram:qZn},Symbol.toStringTag,{value:"Module"}));var WXt="position frame",YXt="frame positioned",GDe="position relation",qXt="relation positioned",XZn=C(function(t){me.debug("options str",t)},"setOptions"),KZn=C(function(){return{}},"getOptions"),ZZn=C(function(){jXt(),Aa()},"clear");function jXt(){HDe={}}C(jXt,"reset");var JZn=Xn.eventmodeling,eJn=C(()=>ns({...JZn,...Dr().eventmodeling}),"getConfig"),HDe={};function XXt(){let t=tJn;const{ast:e}=HDe,r=WDe();if(!e)throw new Error("No data for EventModel");return e.frames.forEach((n,i)=>{const a=nKt(n,e.dataEntities,r);t=eie(t,{$kind:WXt,index:i,frame:n,textProps:a});let s;cKt(n)?(me.debug("source frame",n.sourceFrames),s=e.frames.filter(o=>n.sourceFrames.some(l=>l.$refText===o.name)),s.forEach(o=>{t=eie(t,{$kind:GDe,index:i,frame:n,sourceFrame:o})})):t=eie(t,{$kind:GDe,index:i,frame:n})}),t={...t,sortedSwimlanesArray:YDe(t.swimlanes)},t}C(XXt,"getState");function KXt(t){HDe.ast=t}C(KXt,"setAst");var zi={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:450-2*10,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function WDe(){return zi}C(WDe,"getDiagramProps");var tJn={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function ZXt(t){const e=t.split(".");if(e.length===2)return e[0]}C(ZXt,"extractNamespace");function JXt(t){const e=t.split(".");return e.length===2?e[1]:t}C(JXt,"extractName");function eKt(t,e){if(!(!e||e.length===0))return Object.values(t).find(r=>r.namespace===e)}C(eKt,"findSwimlaneByNamespace");function Jne(t,e,r){return Math.max(e,...Object.keys(t).filter(n=>{const i=Number.parseInt(n);return i>e&&iNumber.parseInt(n)))+1}C(Jne,"findNextAvailableIndex");function tKt(t,e){const r=ZXt(t.entityIdentifier),n=eKt(e,r);switch(t.modelEntityType){case"ui":case"pcr":case"processor":return n?{index:n.index,label:n.namespace||zi.labelUiAutomation}:r?{index:Jne(e,0,100),label:zi.labelUiAutomationPrefix+r}:{index:0,label:zi.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return n?{index:n.index,label:n.namespace||zi.labelCommandReadModel}:r?{index:Jne(e,100,200),label:zi.labelCommandReadModelPrefix+r}:{index:100,label:zi.labelCommandReadModel};case"evt":case"event":default:return n?{index:n.index,label:n.namespace||zi.labelEvents}:r?{index:Jne(e,200,300),label:zi.labelEventsPrefix+r}:{index:200,label:zi.labelEvents}}}C(tKt,"calculateSwimlaneProps");function rKt(t){const{themeVariables:e}=Dr();switch(t.modelEntityType){case"ui":return{fill:e.emUiFill??"white",stroke:e.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:e.emProcessorFill??"#edb3f6",stroke:e.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:e.emReadModelFill??"#d3f1a2",stroke:e.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:e.emCommandFill??"#bcd6fe",stroke:e.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:e.emEventFill??"#ffb778",stroke:e.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}C(rKt,"calculateEntityVisualProps");function nKt(t,e,r){const n=Dr(),i=ai(JXt(t.entityIdentifier)??"",n);let a;const s={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let l=`${f7(i,r.textMaxWidth,s)}`;if(t.dataInlineValue&&(a=t.dataInlineValue,a=a.substring(a.indexOf("{")+1),a=a.substring(0,a.lastIndexOf("}")-1),a=ai(a,n),a=f7(a,r.textMaxWidth,s),a=a.replaceAll(" "," ")),t.dataReference){const g=e.find(m=>{var v;return m.name===((v=t.dataReference)==null?void 0:v.$refText)});g&&(a=g.dataBlockValue,a=a.substring(a.indexOf(`{ + `)}}}}}))},"drawEdges"),QZn=C(async function(t,e,r,n){const a=r.getConfigField("padding")*.75,s=r.getConfigField("fontSize"),l=r.getConfigField("iconSize")/2;await Promise.all(e.nodes().map(async u=>{const h=rD(u);if(h.type==="group"){const{h:d,w:f,x1:p,y1:g}=u.boundingBox(),m=t.append("rect");m.attr("id",`${n}-group-${h.id}`).attr("x",p+l).attr("y",g+l).attr("width",f).attr("height",d).attr("class","node-bkg");const v=t.append("g");let y=p,b=g;if(h.icon){const x=v.append("g");x.html(`${await Fy(h.icon,{height:a,width:a,fallbackPrefix:Nz.prefix})}`),x.attr("transform","translate("+(y+l+1)+", "+(b+l+1)+")"),y+=a,b+=s/2-1-2}if(h.label){const x=v.append("g");await Zc(x,h.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},He()),x.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),x.attr("transform","translate("+(y+l+4)+", "+(b+l+2)+")")}r.setElementForId(h.id,m)}}))},"drawGroups"),GZn=C(async function(t,e,r,n){const i=He();for(const a of r){const s=e.append("g"),o=t.getConfigField("iconSize");if(a.title){const d=s.append("g");await Zc(d,a.title,{useHtmlLabels:!1,width:o*1.5,classes:"architecture-service-label"},i),d.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),d.attr("transform","translate("+o/2+", "+o+")")}const l=s.append("g");if(a.icon)l.html(`${await Fy(a.icon,{height:o,width:o,fallbackPrefix:Nz.prefix})}`);else if(a.iconText){l.html(`${await Fy("blank",{height:o,width:o,fallbackPrefix:Nz.prefix})}`);const p=l.append("g").append("foreignObject").attr("width",o).attr("height",o).append("div").attr("class","node-icon-text").attr("style",`height: ${o}px;`).append("div").html(ai(a.iconText,i)),g=parseInt(window.getComputedStyle(p.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;p.attr("style",`-webkit-line-clamp: ${Math.floor((o-2)/g)};`)}else l.append("path").attr("class","node-bkg").attr("id",`${n}-node-${a.id}`).attr("d",`M0,${o} V5 Q0,0 5,0 H${o-5} Q${o},0 ${o},5 V${o} Z`);s.attr("id",`${n}-service-${a.id}`).attr("class","architecture-service");const{width:u,height:h}=s.node().getBBox();a.width=u,a.height=h,t.setElementForId(a.id,s)}return 0},"drawServices"),HZn=C(function(t,e,r,n){r.forEach(i=>{const a=e.append("g"),s=t.getConfigField("iconSize");a.append("g").append("rect").attr("id",`${n}-node-${i.id}`).attr("fill-opacity","0").attr("width",s).attr("height",s),a.attr("class","architecture-junction");const{width:l,height:u}=a._groups[0][0].getBBox();a.width=l,a.height=u,t.setElementForId(i.id,a)})},"drawJunctions");rbe([{name:Nz.prefix,icons:Nz}]),$0.use(_Zn);function $Xt(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"service",id:n.id,icon:n.icon,label:n.title,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-service"})})}C($Xt,"addServices");function FXt(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"junction",id:n.id,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-junction"})})}C(FXt,"addJunctions");function zXt(t,e){e.nodes().map(r=>{const n=rD(r);if(n.type==="group")return;n.x=r.position().x,n.y=r.position().y,t.getElementById(n.id).attr("transform","translate("+(n.x||0)+","+(n.y||0)+")")})}C(zXt,"positionNodes");function UXt(t,e){t.forEach(r=>{e.add({group:"nodes",data:{type:"group",id:r.id,icon:r.icon,label:r.title,parent:r.in},classes:"node-group"})})}C(UXt,"addGroups");function VXt(t,e){t.forEach(r=>{const{lhsId:n,rhsId:i,lhsInto:a,lhsGroup:s,rhsInto:o,lhsDir:l,rhsDir:u,rhsGroup:h,title:d}=r,f=UDe(r.lhsDir,r.rhsDir)?"segments":"straight",p={id:`${n}-${i}`,label:d,source:n,sourceDir:l,sourceArrow:a,sourceGroup:s,sourceEndpoint:l==="L"?"0 50%":l==="R"?"100% 50%":l==="T"?"50% 0":"50% 100%",target:i,targetDir:u,targetArrow:o,targetGroup:h,targetEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%"};e.add({group:"edges",data:p,classes:f})})}C(VXt,"addEdges");function QXt(t,e,r,n=[]){const i=C((f,p)=>{const g=new Map;for(const[m,v]of f.entries()){const y=`${m}`;let b=0;const x=[...v.entries()];if(x.length===1){g.set(y,x[0][1]);continue}for(let w=0;w{const p=new Map,g=new Map;return f.forEach(([m,v],y)=>{var A;const b=((A=t.getNode(y))==null?void 0:A.in)??"default",x=p.get(v)??new Map;p.has(v)||p.set(v,x);const w=g.get(m)??new Map;g.has(m)||g.set(m,w);for(const S of[x,w]){const T=S.get(b)??[];S.has(b)||S.set(b,T),T.push(y)}}),{horiz:[...i(p,"horizontal").values()].filter(m=>m.length>1),vert:[...i(g,"vertical").values()].filter(m=>m.length>1)}}),[s,o]=a.reduce(([f,p],{horiz:g,vert:m})=>[[...f,...g],[...p,...m]],[[],[]]),l=new Set;n.forEach(f=>f.members.forEach(p=>l.add(p)));const u=C(f=>f.filter(p=>!p.some(g=>l.has(g))),"dropOverlapping"),h=u(s),d=u(o);return n.forEach(f=>{f.members.length<2||(f.direction==="row"?h.push([...f.members]):d.push([...f.members]))}),{horizontal:h,vertical:d}}C(QXt,"getAlignments");function GXt(t,e,r=[]){const n=[],i=e.getConfigField("iconSize"),a=e.getConfigField("idealEdgeLengthMultiplier"),s=a*i,o=new Set;r.forEach(h=>{for(let d=0;d`${h[0]},${h[1]}`,"posToStr"),u=C(h=>h.split(",").map(d=>parseInt(d)),"strToPos");return t.forEach(h=>{const d=new Map([...h.entries()].map(([m,v])=>[l(v),m])),f=[l([0,0])],p={},g={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;f.length>0;){const m=f.shift();if(m){p[m]=1;const v=d.get(m);if(v){const y=u(m);Object.entries(g).forEach(([b,x])=>{const w=l([y[0]+x[0],y[1]+x[1]]),A=d.get(w);if(A&&!p[w]){if(f.push(w),o.has(`${v}|${A}`))return;n.push({[DXt[b]]:A,[DXt[RZn(b)]]:v,gap:a*i})}})}}}}),n}C(GXt,"getRelativeConstraints");function HXt(t,e,r,n,i,{spatialMaps:a,groupAlignments:s}){return new Promise(o=>{const l=Ot("body").append("div").attr("id","cy").attr("style","display:none"),u=$0({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${i.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${i.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});l.remove(),UXt(r,u),$Xt(t,u,i),FXt(e,u,i),VXt(n,u);const h=i.getLayoutHints(),d=QXt(i,a,s,h),f=GXt(a,i,h),p=i.getConfigField("iconSize"),g=i.getConfigField("idealEdgeLengthMultiplier")*p,m=.5*p,v=i.getConfigField("edgeElasticity"),y=i.getConfigField("seed"),b=u.layout({name:"fcose",quality:"proof",randomize:i.getConfigField("randomize"),nodeSeparation:i.getConfigField("nodeSeparation"),numIter:i.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(x){const[w,A]=x.connectedNodes(),{parent:S}=rD(w),{parent:T}=rD(A);return S===T?g:m},edgeElasticity(x){const[w,A]=x.connectedNodes(),{parent:S}=rD(w),{parent:T}=rD(A);return S===T?v:.001},alignmentConstraint:d,relativePlacementConstraint:f});b.one("layoutstop",()=>{var w;function x(A,S,T,O){let k,E;const{x:_,y:I}=A,{x:L,y:R}=S;E=(O-I+(_-T)*(I-R)/(_-L))/Math.sqrt(1+Math.pow((I-R)/(_-L),2)),k=Math.sqrt(Math.pow(O-I,2)+Math.pow(T-_,2)-Math.pow(E,2));const D=Math.sqrt(Math.pow(L-_,2)+Math.pow(R-I,2));k=k/D;let M=(L-_)*(O-I)-(R-I)*(T-_);switch(!0){case M>=0:M=1;break;case M<0:M=-1;break}let P=(L-_)*(T-_)+(R-I)*(O-I);switch(!0){case P>=0:P=1;break;case P<0:P=-1;break}return E=Math.abs(E)*M,k=k*P,{distances:E,weights:k}}C(x,"getSegmentWeights"),u.startBatch();for(const A of Object.values(u.edges()))if((w=A.data)!=null&&w.call(A)){const{x:S,y:T}=A.source().position(),{x:O,y:k}=A.target().position();if(S!==O&&T!==k){const E=A.sourceEndpoint(),_=A.targetEndpoint(),{sourceDir:I}=PXt(A),[L,R]=yw(I)?[E.x,_.y]:[_.x,E.y],{weights:D,distances:M}=x(E,_,L,R);A.style("segment-distances",M),A.style("segment-weights",D)}}u.endBatch(),QDe(y,()=>b.run())});try{QDe(y,()=>b.run())}catch(x){throw x instanceof RangeError&&x.message.includes("Invalid array length")?new Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis."):x}u.ready(x=>{me.info("Ready",x),o(u)})})}C(HXt,"layoutArchitecture");var WZn=C(async(t,e,r,n)=>{const i=n.db;i.setDiagramId(e);const a=i.getServices(),s=i.getJunctions(),o=i.getGroups(),l=i.getEdges(),u=i.getDataStructures(),h=qc(e),d=h.append("g");d.attr("class","architecture-edges");const f=h.append("g");f.attr("class","architecture-services");const p=h.append("g");p.attr("class","architecture-groups"),await GZn(i,f,a,e),HZn(i,f,s,e);const g=await HXt(a,s,o,l,i,u);await VZn(d,g,i,e),await QZn(p,g,i,e),zXt(i,g),E5(void 0,h,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw"),YZn={draw:WZn},qZn={parser:BXt,get db(){return new NXt},renderer:YZn,styles:UZn};const jZn=Object.freeze(Object.defineProperty({__proto__:null,diagram:qZn},Symbol.toStringTag,{value:"Module"}));var WXt="position frame",YXt="frame positioned",GDe="position relation",qXt="relation positioned",XZn=C(function(t){me.debug("options str",t)},"setOptions"),KZn=C(function(){return{}},"getOptions"),ZZn=C(function(){jXt(),Aa()},"clear");function jXt(){HDe={}}C(jXt,"reset");var JZn=Xn.eventmodeling,eJn=C(()=>ns({...JZn,...Dr().eventmodeling}),"getConfig"),HDe={};function XXt(){let t=tJn;const{ast:e}=HDe,r=WDe();if(!e)throw new Error("No data for EventModel");return e.frames.forEach((n,i)=>{const a=nKt(n,e.dataEntities,r);t=eie(t,{$kind:WXt,index:i,frame:n,textProps:a});let s;cKt(n)?(me.debug("source frame",n.sourceFrames),s=e.frames.filter(o=>n.sourceFrames.some(l=>l.$refText===o.name)),s.forEach(o=>{t=eie(t,{$kind:GDe,index:i,frame:n,sourceFrame:o})})):t=eie(t,{$kind:GDe,index:i,frame:n})}),t={...t,sortedSwimlanesArray:YDe(t.swimlanes)},t}C(XXt,"getState");function KXt(t){HDe.ast=t}C(KXt,"setAst");var zi={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:450-2*10,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function WDe(){return zi}C(WDe,"getDiagramProps");var tJn={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function ZXt(t){const e=t.split(".");if(e.length===2)return e[0]}C(ZXt,"extractNamespace");function JXt(t){const e=t.split(".");return e.length===2?e[1]:t}C(JXt,"extractName");function eKt(t,e){if(!(!e||e.length===0))return Object.values(t).find(r=>r.namespace===e)}C(eKt,"findSwimlaneByNamespace");function Jne(t,e,r){return Math.max(e,...Object.keys(t).filter(n=>{const i=Number.parseInt(n);return i>e&&iNumber.parseInt(n)))+1}C(Jne,"findNextAvailableIndex");function tKt(t,e){const r=ZXt(t.entityIdentifier),n=eKt(e,r);switch(t.modelEntityType){case"ui":case"pcr":case"processor":return n?{index:n.index,label:n.namespace||zi.labelUiAutomation}:r?{index:Jne(e,0,100),label:zi.labelUiAutomationPrefix+r}:{index:0,label:zi.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return n?{index:n.index,label:n.namespace||zi.labelCommandReadModel}:r?{index:Jne(e,100,200),label:zi.labelCommandReadModelPrefix+r}:{index:100,label:zi.labelCommandReadModel};case"evt":case"event":default:return n?{index:n.index,label:n.namespace||zi.labelEvents}:r?{index:Jne(e,200,300),label:zi.labelEventsPrefix+r}:{index:200,label:zi.labelEvents}}}C(tKt,"calculateSwimlaneProps");function rKt(t){const{themeVariables:e}=Dr();switch(t.modelEntityType){case"ui":return{fill:e.emUiFill??"white",stroke:e.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:e.emProcessorFill??"#edb3f6",stroke:e.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:e.emReadModelFill??"#d3f1a2",stroke:e.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:e.emCommandFill??"#bcd6fe",stroke:e.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:e.emEventFill??"#ffb778",stroke:e.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}C(rKt,"calculateEntityVisualProps");function nKt(t,e,r){const n=Dr(),i=ai(JXt(t.entityIdentifier)??"",n);let a;const s={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let l=`${f7(i,r.textMaxWidth,s)}`;if(t.dataInlineValue&&(a=t.dataInlineValue,a=a.substring(a.indexOf("{")+1),a=a.substring(0,a.lastIndexOf("}")-1),a=ai(a,n),a=f7(a,r.textMaxWidth,s),a=a.replaceAll(" "," ")),t.dataReference){const g=e.find(m=>{var v;return m.name===((v=t.dataReference)==null?void 0:v.$refText)});g&&(a=g.dataBlockValue,a=a.substring(a.indexOf(`{ `)+2),a=a.substring(0,a.lastIndexOf("}")-1),a=ai(a,n),a=f7(a,r.textMaxWidth,s),a=a.replaceAll(" "," "),a+="
")}const u=a!==void 0;u&&(l+=`

${a}`);const h={fontSize:s.fontSize,fontWeight:s.fontWeight,fontFamily:s.fontFamily},d=Mj(l,h),f=u?d.width/3:d.width,p={content:l,width:f,height:d.height};return me.debug(`[${t.name}] ${t.entityIdentifier} text`,p),p}C(nKt,"calculateTextProps");function iKt(t,e){const r=e,n=rKt(r.frame),i={width:r.textProps.width+2*zi.boxTextPadding,height:r.textProps.height+2*zi.boxTextPadding};return[{$kind:YXt,frame:r.frame,index:r.index,visual:n,dimension:i,textProps:r.textProps}]}C(iKt,"decidePositionFrame");function aKt(t,e,r){return e===void 0?zi.contentStartX:e.index===t.index&&t.r?t.r+zi.boxPadding:r===void 0?zi.contentStartX:r.r-zi.boxOverlap+zi.boxPadding}C(aKt,"calculateX");function sKt(t,e){const r=[...t.map(n=>n.r),e];return Math.max(...r)}C(sKt,"calculateMaxRight");function YDe(t){return Object.values(t).sort((e,r)=>e.index-r.index)}C(YDe,"sortedSwimlanesArray");function oKt(t,e){const r=e,n=tKt(r.frame,t.swimlanes);let i;n.index in t.swimlanes?i=t.swimlanes[n.index]:i={index:n.index,label:n.label,r:0,y:n.index*zi.swimlaneMinHeight+zi.swimlaneGap,height:zi.swimlaneMinHeight,maxHeight:zi.swimlaneMinHeight};const a=t.boxes.length>0?t.boxes[t.boxes.length-1]:void 0,s=t.previousSwimlaneNumber!==void 0?t.swimlanes[t.previousSwimlaneNumber]:void 0,o={width:Math.max(zi.boxMinWidth,Math.min(zi.boxMaxWidth,r.dimension.width))+2*zi.boxPadding,height:Math.max(zi.boxMinHeight,Math.min(zi.boxMaxHeight,r.dimension.height))+2*zi.boxPadding},l=aKt(i,s,a),u=l+o.width+zi.boxPadding,h=sKt(Object.values(t.swimlanes),u);i.r=l+o.width,i.maxHeight=Math.max(i.maxHeight,o.height),i.height=Math.max(zi.swimlaneMinHeight,i.maxHeight)+2*zi.swimlanePadding;const d={x:l,y:zi.swimlanePadding+i.y,r:u,dimension:o,leftSibling:!1,swimlane:i,visual:r.visual,text:r.textProps.content,frame:r.frame,index:r.index},f={...t,boxes:[...t.boxes,d],swimlanes:{...t.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:n.index,previousFrame:r.frame,maxR:h},p=YDe(f.swimlanes);p.length>0&&(p[0].y=0);for(let g=1;g0}C(cKt,"hasSourceFrame");function qDe(t,e){if(e!=null)return t.find(r=>r.frame.name===e.name)}C(qDe,"findBoxByFrame");function uKt(t,e,r){if(!(r<0))for(let n=r;n>=0;n--){const i=t[n];if(i.swimlane.index!==e)return i}}C(uKt,"findBoxByLineIndex");function hKt(t,e){const r=e;if(LHt(r.frame)||lKt(r.index,r.frame))return[];const n=qDe(t.boxes,r.frame);if(n===void 0)throw new Error(`Target box not found for frame ${r.frame.name}`);let i;return r.sourceFrame?i=qDe(t.boxes,r.sourceFrame):i=uKt(t.boxes,n.swimlane.index,r.index-1),i===void 0?[]:[{$kind:qXt,frame:r.frame,index:r.index,sourceBox:i,targetBox:n}]}C(hKt,"decidePositionRelation");function dKt(t,e){const r=e,n={visual:{fill:"none",stroke:"#000"},source:{x:r.sourceBox.x,y:r.sourceBox.y},target:{x:r.targetBox.x,y:r.targetBox.y},sourceBox:r.sourceBox,targetBox:r.targetBox};return{...t,relations:[...t.relations,n]}}C(dKt,"evolveRelationPositioned");var rJn={[WXt]:iKt,[GDe]:hKt},nJn={[YXt]:oKt,[qXt]:dKt};function fKt(t,e){const r=rJn[e.$kind];if(r==null)return[];const n=r(t,e);return me.debug("decided events",n),n}C(fKt,"decide");function pKt(t,e){const r=e.reduce((n,i)=>{const a=nJn[i.$kind];return a==null?n:a(n,i)},t);return me.debug("evolve events",{state:t,newState:r,events:e}),r}C(pKt,"evolve");function eie(t,e){const r=fKt(t,e);return pKt(t,r)}C(eie,"dispatch");var jDe={getConfig:eJn,setOptions:XZn,getOptions:KZn,clear:ZZn,setAccTitle:Da,getAccTitle:Ja,getAccDescription:ts,setAccDescription:es,setDiagramTitle:rs,getDiagramTitle:La,setAst:KXt,getDiagramProps:WDe,getState:XXt},iJn={parse:C(async t=>{const e=await Op("eventmodeling",t);me.debug(e),jDe.setAst(e),qu(e,jDe)},"parse")},XDe=He(),aJn=XDe==null?void 0:XDe.eventmodeling;function gKt(t,e){return r=>{const n=r.swimlane.y+e.swimlanePadding,i=t.append("g").attr("class","em-box");i.append("rect").attr("x",r.x).attr("y",n).attr("rx","3").attr("width",r.dimension.width).attr("height",r.dimension.height).attr("stroke",r.visual.stroke).attr("fill",r.visual.fill),i.append("foreignObject").attr("x",r.x+e.boxPadding).attr("y",n+10).attr("width",r.dimension.width-2*e.boxPadding).attr("height",r.dimension.height-2*e.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(r.text)}}C(gKt,"renderD3Box");function mKt(t,e){return t>e}C(mKt,"dirUpwards");function vKt(t,e,r,n){return i=>{const a=i.sourceBox.swimlane.y+e.swimlanePadding,s=i.targetBox.swimlane.y+e.swimlanePadding,o=mKt(a,s),l=i.sourceBox.x+i.sourceBox.dimension.width*2/3,u=i.targetBox.x+i.targetBox.dimension.width/3;let h,d;me.debug(`rendering relation up=${o} for `,{sourceBox:i.sourceBox,targetBox:i.targetBox}),o?(h=a,d=s+i.targetBox.dimension.height):(h=a+i.sourceBox.dimension.height,d=s);const f=n.emRelationStroke??i.visual.stroke;t.append("path").attr("class","em-relation").attr("fill",i.visual.fill).attr("stroke",f).attr("stroke-width","1").attr("marker-end",`url(#${r})`).attr("d",`M${l} ${h} L${u} ${d}`)}}C(vKt,"renderD3Relation");function yKt(t,e,r,n){return i=>{const a=t.append("g").attr("class","em-swimlane"),s=n.emSwimlaneBackgroundOdd??"rgb(250,250,250)",o=n.emSwimlaneBackgroundStroke??"rgb(240,240,240)";a.append("rect").attr("x",0).attr("y",i.y).attr("rx","3").attr("width",e+r.swimlanePadding).attr("height",i.height).attr("fill",s).attr("stroke",o),a.append("text").attr("font-weight",r.swimlaneTextFontWeight).attr("x",30).attr("y",i.y+30).text(i.label)}}C(yKt,"renderD3Swimlane");var sJn=C(function(t,e,r,n){if(me.debug("in eventmodeling renderer",t+` -`,"id:",e,r),!aJn)throw new Error("EventModeling config not found");const i=n.db,{themeVariables:a,eventmodeling:s}=He(),o=Ot(`[id="${e}"]`),l=i.getDiagramProps(),u=i.getState(),h=`em-arrowhead-${e}`,d=a.emArrowhead??"#000000";u.sortedSwimlanesArray.forEach(yKt(o,u.maxR,l,a)),u.boxes.forEach(gKt(o,l)),u.relations.forEach(vKt(o,l,h,a)),o.append("defs").append("marker").attr("id",h).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",d),wye(void 0,o,(s==null?void 0:s.padding)??30,s==null?void 0:s.useMaxWidth)},"draw"),oJn={draw:sJn},lJn=C(t=>"","getStyles"),cJn=lJn,uJn={parser:iJn,db:jDe,renderer:oJn,styles:cJn};const hJn=Object.freeze(Object.defineProperty({__proto__:null,diagram:uJn},Symbol.toStringTag,{value:"Module"}));var KDe=function(){var t=C(function(y,b,x,w){for(x=x||{},w=y.length;w--;x[y[w]]=b);return x},"o"),e=[1,4],r=[1,14],n=[1,12],i=[1,13],a=[6,7,8],s=[1,20],o=[1,18],l=[1,19],u=[6,7,11],h=[1,6,13,14],d=[1,23],f=[1,24],p=[1,6,7,11,13,14],g={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:C(function(b,x,w,A,T,S,O){var k=S.length-1;switch(T){case 6:case 7:return A;case 15:A.addNode(S[k-1].length,S[k].trim());break;case 16:A.addNode(0,S[k].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:i},t(a,[2,3]),{1:[2,2]},t(a,[2,4]),t(a,[2,5]),{1:[2,6],6:r,12:15,13:n,14:i},{6:r,9:16,12:11,13:n,14:i},{6:s,7:o,10:17,11:l},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:s,7:o,10:22,11:l},{1:[2,7],6:r,12:15,13:n,14:i},t(h,[2,14],{7:d,11:f}),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(u,[2,15]),t(h,[2,13],{7:d,11:f}),t(p,[2,11]),t(p,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:C(function(b,x){if(x.recoverable)this.trace(b);else{var w=new Error(b);throw w.hash=x,w}},"parseError"),parse:C(function(b){var x=this,w=[0],A=[],T=[null],S=[],O=this.table,k="",E=0,_=0,I=2,L=1,R=S.slice.call(arguments,1),D=Object.create(this.lexer),M={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&(M.yy[P]=this.yy[P]);D.setInput(b,M.yy),M.yy.lexer=D,M.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var N=D.yylloc;S.push(N);var F=D.options&&D.options.ranges;typeof M.yy.parseError=="function"?this.parseError=M.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function B(re){w.length=w.length-2*re,T.length=T.length-re,S.length=S.length-re}C(B,"popStack");function V(){var re;return re=A.pop()||D.lex()||L,typeof re!="number"&&(re instanceof Array&&(A=re,re=A.pop()),re=x.symbols_[re]||re),re}C(V,"lex");for(var z,U,Q,G,X={},Y,le,q,Z;;){if(U=w[w.length-1],this.defaultActions[U]?Q=this.defaultActions[U]:((z===null||typeof z>"u")&&(z=V()),Q=O[U]&&O[U][z]),typeof Q>"u"||!Q.length||!Q[0]){var ee="";Z=[];for(Y in O[U])this.terminals_[Y]&&Y>I&&Z.push("'"+this.terminals_[Y]+"'");D.showPosition?ee="Parse error on line "+(E+1)+`: +`,"id:",e,r),!aJn)throw new Error("EventModeling config not found");const i=n.db,{themeVariables:a,eventmodeling:s}=He(),o=Ot(`[id="${e}"]`),l=i.getDiagramProps(),u=i.getState(),h=`em-arrowhead-${e}`,d=a.emArrowhead??"#000000";u.sortedSwimlanesArray.forEach(yKt(o,u.maxR,l,a)),u.boxes.forEach(gKt(o,l)),u.relations.forEach(vKt(o,l,h,a)),o.append("defs").append("marker").attr("id",h).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",d),wye(void 0,o,(s==null?void 0:s.padding)??30,s==null?void 0:s.useMaxWidth)},"draw"),oJn={draw:sJn},lJn=C(t=>"","getStyles"),cJn=lJn,uJn={parser:iJn,db:jDe,renderer:oJn,styles:cJn};const hJn=Object.freeze(Object.defineProperty({__proto__:null,diagram:uJn},Symbol.toStringTag,{value:"Module"}));var KDe=function(){var t=C(function(y,b,x,w){for(x=x||{},w=y.length;w--;x[y[w]]=b);return x},"o"),e=[1,4],r=[1,14],n=[1,12],i=[1,13],a=[6,7,8],s=[1,20],o=[1,18],l=[1,19],u=[6,7,11],h=[1,6,13,14],d=[1,23],f=[1,24],p=[1,6,7,11,13,14],g={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:C(function(b,x,w,A,S,T,O){var k=T.length-1;switch(S){case 6:case 7:return A;case 15:A.addNode(T[k-1].length,T[k].trim());break;case 16:A.addNode(0,T[k].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:i},t(a,[2,3]),{1:[2,2]},t(a,[2,4]),t(a,[2,5]),{1:[2,6],6:r,12:15,13:n,14:i},{6:r,9:16,12:11,13:n,14:i},{6:s,7:o,10:17,11:l},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:s,7:o,10:22,11:l},{1:[2,7],6:r,12:15,13:n,14:i},t(h,[2,14],{7:d,11:f}),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(u,[2,15]),t(h,[2,13],{7:d,11:f}),t(p,[2,11]),t(p,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:C(function(b,x){if(x.recoverable)this.trace(b);else{var w=new Error(b);throw w.hash=x,w}},"parseError"),parse:C(function(b){var x=this,w=[0],A=[],S=[null],T=[],O=this.table,k="",E=0,_=0,I=2,L=1,R=T.slice.call(arguments,1),D=Object.create(this.lexer),M={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&(M.yy[P]=this.yy[P]);D.setInput(b,M.yy),M.yy.lexer=D,M.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var N=D.yylloc;T.push(N);var F=D.options&&D.options.ranges;typeof M.yy.parseError=="function"?this.parseError=M.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function B(re){w.length=w.length-2*re,S.length=S.length-re,T.length=T.length-re}C(B,"popStack");function V(){var re;return re=A.pop()||D.lex()||L,typeof re!="number"&&(re instanceof Array&&(A=re,re=A.pop()),re=x.symbols_[re]||re),re}C(V,"lex");for(var z,U,Q,G,X={},Y,le,q,Z;;){if(U=w[w.length-1],this.defaultActions[U]?Q=this.defaultActions[U]:((z===null||typeof z>"u")&&(z=V()),Q=O[U]&&O[U][z]),typeof Q>"u"||!Q.length||!Q[0]){var ee="";Z=[];for(Y in O[U])this.terminals_[Y]&&Y>I&&Z.push("'"+this.terminals_[Y]+"'");D.showPosition?ee="Parse error on line "+(E+1)+`: `+D.showPosition()+` -Expecting `+Z.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ee="Parse error on line "+(E+1)+": Unexpected "+(z==L?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(ee,{text:D.match,token:this.terminals_[z]||z,line:D.yylineno,loc:N,expected:Z})}if(Q[0]instanceof Array&&Q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+U+", token: "+z);switch(Q[0]){case 1:w.push(z),T.push(D.yytext),S.push(D.yylloc),w.push(Q[1]),z=null,_=D.yyleng,k=D.yytext,E=D.yylineno,N=D.yylloc;break;case 2:if(le=this.productions_[Q[1]][1],X.$=T[T.length-le],X._$={first_line:S[S.length-(le||1)].first_line,last_line:S[S.length-1].last_line,first_column:S[S.length-(le||1)].first_column,last_column:S[S.length-1].last_column},F&&(X._$.range=[S[S.length-(le||1)].range[0],S[S.length-1].range[1]]),G=this.performAction.apply(X,[k,_,E,M.yy,Q[1],T,S].concat(R)),typeof G<"u")return G;le&&(w=w.slice(0,-1*le*2),T=T.slice(0,-1*le),S=S.slice(0,-1*le)),w.push(this.productions_[Q[1]][0]),T.push(X.$),S.push(X._$),q=O[w[w.length-2]][w[w.length-1]],w.push(q);break;case 3:return!0}}return!0},"parse")},m=function(){var y={EOF:1,parseError:C(function(x,w){if(this.yy.parser)this.yy.parser.parseError(x,w);else throw new Error(x)},"parseError"),setInput:C(function(b,x){return this.yy=x||this.yy||{},this._input=b,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var x=b.match(/(?:\r\n?|\n).*/g);return x?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),b},"input"),unput:C(function(b){var x=b.length,w=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-x),this.offset-=x;var A=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),w.length-1&&(this.yylineno-=w.length-1);var T=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:w?(w.length===A.length?this.yylloc.first_column:0)+A[A.length-w.length].length-w[0].length:this.yylloc.first_column-x},this.options.ranges&&(this.yylloc.range=[T[0],T[0]+this.yyleng-x]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +Expecting `+Z.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ee="Parse error on line "+(E+1)+": Unexpected "+(z==L?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(ee,{text:D.match,token:this.terminals_[z]||z,line:D.yylineno,loc:N,expected:Z})}if(Q[0]instanceof Array&&Q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+U+", token: "+z);switch(Q[0]){case 1:w.push(z),S.push(D.yytext),T.push(D.yylloc),w.push(Q[1]),z=null,_=D.yyleng,k=D.yytext,E=D.yylineno,N=D.yylloc;break;case 2:if(le=this.productions_[Q[1]][1],X.$=S[S.length-le],X._$={first_line:T[T.length-(le||1)].first_line,last_line:T[T.length-1].last_line,first_column:T[T.length-(le||1)].first_column,last_column:T[T.length-1].last_column},F&&(X._$.range=[T[T.length-(le||1)].range[0],T[T.length-1].range[1]]),G=this.performAction.apply(X,[k,_,E,M.yy,Q[1],S,T].concat(R)),typeof G<"u")return G;le&&(w=w.slice(0,-1*le*2),S=S.slice(0,-1*le),T=T.slice(0,-1*le)),w.push(this.productions_[Q[1]][0]),S.push(X.$),T.push(X._$),q=O[w[w.length-2]][w[w.length-1]],w.push(q);break;case 3:return!0}}return!0},"parse")},m=function(){var y={EOF:1,parseError:C(function(x,w){if(this.yy.parser)this.yy.parser.parseError(x,w);else throw new Error(x)},"parseError"),setInput:C(function(b,x){return this.yy=x||this.yy||{},this._input=b,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var x=b.match(/(?:\r\n?|\n).*/g);return x?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),b},"input"),unput:C(function(b){var x=b.length,w=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-x),this.offset-=x;var A=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),w.length-1&&(this.yylineno-=w.length-1);var S=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:w?(w.length===A.length?this.yylloc.first_column:0)+A[A.length-w.length].length-w[0].length:this.yylloc.first_column-x},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-x]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:C(function(b){this.unput(this.match.slice(b))},"less"),pastInput:C(function(){var b=this.matched.substr(0,this.matched.length-this.match.length);return(b.length>20?"...":"")+b.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:C(function(){var b=this.match;return b.length<20&&(b+=this._input.substr(0,20-b.length)),(b.substr(0,20)+(b.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:C(function(){var b=this.pastInput(),x=new Array(b.length+1).join("-");return b+this.upcomingInput()+` -`+x+"^"},"showPosition"),test_match:C(function(b,x){var w,A,T;if(this.options.backtrack_lexer&&(T={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(T.yylloc.range=this.yylloc.range.slice(0))),A=b[0].match(/(?:\r\n?|\n).*/g),A&&(this.yylineno+=A.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:A?A[A.length-1].length-A[A.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],w=this.performAction.call(this,this.yy,this,x,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),w)return w;if(this._backtrack){for(var S in T)this[S]=T[S];return!1}return!1},"test_match"),next:C(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var b,x,w,A;this._more||(this.yytext="",this.match="");for(var T=this._currentRules(),S=0;Sx[0].length)){if(x=w,A=S,this.options.backtrack_lexer){if(b=this.test_match(w,T[S]),b!==!1)return b;if(this._backtrack){x=!1;continue}else return!1}else if(!this.options.flex)break}return x?(b=this.test_match(x,T[A]),b!==!1?b:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var x=this.next();return x||this.lex()},"lex"),begin:C(function(x){this.conditionStack.push(x)},"begin"),popState:C(function(){var x=this.conditionStack.length-1;return x>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(x){return x=this.conditionStack.length-1-Math.abs(x||0),x>=0?this.conditionStack[x]:"INITIAL"},"topState"),pushState:C(function(x){this.begin(x)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:C(function(x,w,A,T){switch(A){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return y}();g.lexer=m;function v(){this.yy={}}return C(v,"Parser"),v.prototype=g,g.Parser=v,new v}();KDe.parser=KDe;var dJn=KDe,fJn=(QI=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,Aa()}getRoot(){return this.root}addNode(e,r){const n=jt.sanitizeText(r,He());if(!this.root){this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],rs(n);return}this.baseLevel??(this.baseLevel=e);let i=e-this.baseLevel+1;for(i<=0&&(i=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=i;)this.stack.pop();const a=this.stack[this.stack.length-1].node,s={text:n,children:[]};a.children.push(s),this.stack.push({level:i,node:s})}getAccTitle(){return Ja()}setAccTitle(e){Da(e)}getAccDescription(){return ts()}setAccDescription(e){es(e)}getDiagramTitle(){return La()}setDiagramTitle(e){rs(e)}},C(QI,"IshikawaDB"),QI),pJn=14,iD=250,gJn=30,mJn=60,vJn=5,bKt=82*Math.PI/180,xKt=Math.cos(bKt),wKt=Math.sin(bKt),AKt=C((t,e,r)=>{const n=t.node().getBBox(),i=n.width+e*2,a=n.height+e*2;zs(t,a,i,r),t.attr("viewBox",`${n.x-e} ${n.y-e} ${i} ${a}`)},"applyPaddedViewBox"),yJn=C((t,e,r,n)=>{var M,P;const a=n.db.getRoot();if(!a)return;const s=He(),{look:o,handDrawnSeed:l,themeVariables:u}=s,h=By(s.fontSize)[0]??pJn,d=o==="handDrawn",f=a.children??[],p=((M=s.ishikawa)==null?void 0:M.diagramPadding)??20,g=((P=s.ishikawa)==null?void 0:P.useMaxWidth)??!1,m=qc(e),v=m.append("g").attr("class","ishikawa"),y=d?Er.svg(m.node()):void 0,b=y?{roughSvg:y,seed:l??0,lineColor:(u==null?void 0:u.lineColor)??"#333",fillColor:(u==null?void 0:u.mainBkg)??"#fff"}:void 0,x=`ishikawa-arrow-${e}`;d||v.append("defs").append("marker").attr("id",x).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let w=0,A=iD;const T=d?void 0:aD(v,w,A,w,A,"ishikawa-spine");if(bJn(v,w,A,a.text,h,b),!f.length){d&&aD(v,w,A,w,A,"ishikawa-spine",b),AKt(m,p,g);return}w-=20;const S=f.filter((N,F)=>F%2===0),O=f.filter((N,F)=>F%2===1),k=TKt(S),E=TKt(O),_=k.total+E.total;let I=iD,L=iD;if(_>0){const N=iD*2,F=iD*.3;I=Math.max(F,N*(k.total/_)),L=Math.max(F,N*(E.total/_))}const R=h*2;I=Math.max(I,k.max*R),L=Math.max(L,E.max*R),A=Math.max(I,iD),T&&T.attr("y1",A).attr("y2",A),v.select(".ishikawa-head-group").attr("transform",`translate(0,${A})`);const D=Math.ceil(f.length/2);for(let N=0;NMath.min(B,V.getBBox().x),1/0)}if(d)aD(v,w,A,0,A,"ishikawa-spine",b);else{T.attr("x1",w);const N=`url(#${x})`;v.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",N)}AKt(m,p,g)},"draw"),TKt=C(t=>{const e=C(r=>r.children.reduce((n,i)=>n+1+e(i),0),"countDescendants");return t.reduce((r,n)=>{const i=e(n);return r.total+=i,r.max=Math.max(r.max,i),r},{total:0,max:0})},"sideStats"),bJn=C((t,e,r,n,i,a)=>{const s=Math.max(6,Math.floor(110/(i*.6))),o=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${e},${r})`),l=tie(o,SKt(n,s),0,0,"ishikawa-head-label","start",i),u=l.node().getBBox(),h=Math.max(60,u.width+6),d=Math.max(40,u.height*2+40),f=`M 0 ${-d/2} L 0 ${d/2} Q ${h*2.4} 0 0 ${-d/2} Z`;if(a){const p=a.roughSvg.path(f,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});o.insert(()=>p,":first-child").attr("class","ishikawa-head")}else o.insert("path",":first-child").attr("class","ishikawa-head").attr("d",f);l.attr("transform",`translate(${(h-u.width)/2-u.x+3},${-u.y-u.height/2})`)},"drawHead"),xJn=C((t,e)=>{const r=[],n=[],i=C((a,s,o)=>{const l=e===-1?[...a].reverse():a;for(const u of l){const h=r.length,d=u.children??[];r.push({depth:o,text:SKt(u.text,15),parentIndex:s,childCount:d.length}),o%2===0?(n.push(h),d.length&&i(d,h,o+1)):(d.length&&i(d,h,o+1),n.push(h))}},"walk");return i(t,-1,2),{entries:r,yOrder:n}},"flattenTree"),wJn=C((t,e,r,n,i,a,s)=>{const o=t.append("g").attr("class","ishikawa-label-group"),u=tie(o,e,r,n+11*i,"ishikawa-label cause","middle",a).node().getBBox();if(s){const h=s.roughSvg.rectangle(u.x-20,u.y-2,u.width+40,u.height+4,{roughness:1.5,seed:s.seed,fill:s.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:s.lineColor,strokeWidth:2});o.insert(()=>h,":first-child").attr("class","ishikawa-label-box")}else o.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",u.x-20).attr("y",u.y-2).attr("width",u.width+40).attr("height",u.height+4)},"drawCauseLabel"),ZDe=C((t,e,r,n,i,a)=>{const s=Math.sqrt(n*n+i*i);if(s===0)return;const o=n/s,l=i/s,u=6,h=-l*u,d=o*u,f=e,p=r,g=`M ${f} ${p} L ${f-o*u*2+h} ${p-l*u*2+d} L ${f-o*u*2-h} ${p-l*u*2-d} Z`,m=a.roughSvg.path(g,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:"solid",stroke:a.lineColor,strokeWidth:1});t.append(()=>m)},"drawArrowMarker"),AJn=C((t,e,r,n,i,a,s,o)=>{const l=e.children??[],u=a*(l.length?1:.2),h=-xKt*u,d=wKt*u*i,f=r+h,p=n+d;if(aD(t,r,n,f,p,"ishikawa-branch",o),o&&ZDe(t,r,n,r-f,n-p,o),wJn(t,e.text,f,p,i,s,o),!l.length)return;const{entries:g,yOrder:m}=xJn(l,i),v=g.length,y=new Array(v);for(const[T,S]of m.entries())y[S]=n+d*((T+1)/(v+1));const b=new Map;b.set(-1,{x0:r,y0:n,x1:f,y1:p,childCount:l.length,childrenDrawn:0});const x=-xKt,w=wKt*i,A=i<0?"ishikawa-label up":"ishikawa-label down";for(const[T,S]of g.entries()){const O=y[T],k=b.get(S.parentIndex),E=t.append("g").attr("class","ishikawa-sub-group");let _=0,I=0,L=0;if(S.depth%2===0){const R=k.y1-k.y0;_=CKt(k.x0,k.x1,R?(O-k.y0)/R:.5),I=O,L=_-(S.childCount>0?mJn+S.childCount*vJn:gJn),aD(E,_,O,L,O,"ishikawa-sub-branch",o),o&&ZDe(E,_,O,1,0,o),tie(E,S.text,L,O,"ishikawa-label align","end",s)}else{const R=k.childrenDrawn++;_=CKt(k.x0,k.x1,(k.childCount-R)/(k.childCount+1)),I=k.y0,L=_+x*((O-I)/w),aD(E,_,I,L,O,"ishikawa-sub-branch",o),o&&ZDe(E,_,I,_-L,I-O,o),tie(E,S.text,L,O,A,"end",s)}S.childCount>0&&b.set(T,{x0:_,y0:I,x1:L,y1:O,childCount:S.childCount,childrenDrawn:0})}},"drawBranch"),TJn=C(t=>t.split(/|\n/),"splitLines"),SKt=C((t,e)=>{if(t.length<=e)return t;const r=[];for(const n of t.split(/\s+/)){const i=r.length-1;i>=0&&r[i].length+1+n.length<=e?r[i]+=" "+n:r.push(n)}return r.join(` -`)},"wrapText"),tie=C((t,e,r,n,i,a,s)=>{const o=TJn(e),l=s*1.05,u=t.append("text").attr("class",i).attr("text-anchor",a).attr("x",r).attr("y",n-(o.length-1)*l/2);for(const[h,d]of o.entries())u.append("tspan").attr("x",r).attr("dy",h===0?0:l).text(d);return u},"drawMultilineText"),CKt=C((t,e,r)=>t+(e-t)*r,"lerp"),aD=C((t,e,r,n,i,a,s)=>{if(s){const o=s.roughSvg.line(e,r,n,i,{roughness:1.5,seed:s.seed,stroke:s.lineColor,strokeWidth:2});t.append(()=>o).attr("class",a);return}return t.append("line").attr("class",a).attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i)},"drawLine"),SJn={draw:yJn},CJn=C(t=>` +`+x+"^"},"showPosition"),test_match:C(function(b,x){var w,A,S;if(this.options.backtrack_lexer&&(S={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(S.yylloc.range=this.yylloc.range.slice(0))),A=b[0].match(/(?:\r\n?|\n).*/g),A&&(this.yylineno+=A.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:A?A[A.length-1].length-A[A.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],w=this.performAction.call(this,this.yy,this,x,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),w)return w;if(this._backtrack){for(var T in S)this[T]=S[T];return!1}return!1},"test_match"),next:C(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var b,x,w,A;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),T=0;Tx[0].length)){if(x=w,A=T,this.options.backtrack_lexer){if(b=this.test_match(w,S[T]),b!==!1)return b;if(this._backtrack){x=!1;continue}else return!1}else if(!this.options.flex)break}return x?(b=this.test_match(x,S[A]),b!==!1?b:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var x=this.next();return x||this.lex()},"lex"),begin:C(function(x){this.conditionStack.push(x)},"begin"),popState:C(function(){var x=this.conditionStack.length-1;return x>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(x){return x=this.conditionStack.length-1-Math.abs(x||0),x>=0?this.conditionStack[x]:"INITIAL"},"topState"),pushState:C(function(x){this.begin(x)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:C(function(x,w,A,S){switch(A){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return y}();g.lexer=m;function v(){this.yy={}}return C(v,"Parser"),v.prototype=g,g.Parser=v,new v}();KDe.parser=KDe;var dJn=KDe,fJn=(QI=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,Aa()}getRoot(){return this.root}addNode(e,r){const n=jt.sanitizeText(r,He());if(!this.root){this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],rs(n);return}this.baseLevel??(this.baseLevel=e);let i=e-this.baseLevel+1;for(i<=0&&(i=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=i;)this.stack.pop();const a=this.stack[this.stack.length-1].node,s={text:n,children:[]};a.children.push(s),this.stack.push({level:i,node:s})}getAccTitle(){return Ja()}setAccTitle(e){Da(e)}getAccDescription(){return ts()}setAccDescription(e){es(e)}getDiagramTitle(){return La()}setDiagramTitle(e){rs(e)}},C(QI,"IshikawaDB"),QI),pJn=14,iD=250,gJn=30,mJn=60,vJn=5,bKt=82*Math.PI/180,xKt=Math.cos(bKt),wKt=Math.sin(bKt),AKt=C((t,e,r)=>{const n=t.node().getBBox(),i=n.width+e*2,a=n.height+e*2;zs(t,a,i,r),t.attr("viewBox",`${n.x-e} ${n.y-e} ${i} ${a}`)},"applyPaddedViewBox"),yJn=C((t,e,r,n)=>{var M,P;const a=n.db.getRoot();if(!a)return;const s=He(),{look:o,handDrawnSeed:l,themeVariables:u}=s,h=By(s.fontSize)[0]??pJn,d=o==="handDrawn",f=a.children??[],p=((M=s.ishikawa)==null?void 0:M.diagramPadding)??20,g=((P=s.ishikawa)==null?void 0:P.useMaxWidth)??!1,m=qc(e),v=m.append("g").attr("class","ishikawa"),y=d?Er.svg(m.node()):void 0,b=y?{roughSvg:y,seed:l??0,lineColor:(u==null?void 0:u.lineColor)??"#333",fillColor:(u==null?void 0:u.mainBkg)??"#fff"}:void 0,x=`ishikawa-arrow-${e}`;d||v.append("defs").append("marker").attr("id",x).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let w=0,A=iD;const S=d?void 0:aD(v,w,A,w,A,"ishikawa-spine");if(bJn(v,w,A,a.text,h,b),!f.length){d&&aD(v,w,A,w,A,"ishikawa-spine",b),AKt(m,p,g);return}w-=20;const T=f.filter((N,F)=>F%2===0),O=f.filter((N,F)=>F%2===1),k=SKt(T),E=SKt(O),_=k.total+E.total;let I=iD,L=iD;if(_>0){const N=iD*2,F=iD*.3;I=Math.max(F,N*(k.total/_)),L=Math.max(F,N*(E.total/_))}const R=h*2;I=Math.max(I,k.max*R),L=Math.max(L,E.max*R),A=Math.max(I,iD),S&&S.attr("y1",A).attr("y2",A),v.select(".ishikawa-head-group").attr("transform",`translate(0,${A})`);const D=Math.ceil(f.length/2);for(let N=0;NMath.min(B,V.getBBox().x),1/0)}if(d)aD(v,w,A,0,A,"ishikawa-spine",b);else{S.attr("x1",w);const N=`url(#${x})`;v.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",N)}AKt(m,p,g)},"draw"),SKt=C(t=>{const e=C(r=>r.children.reduce((n,i)=>n+1+e(i),0),"countDescendants");return t.reduce((r,n)=>{const i=e(n);return r.total+=i,r.max=Math.max(r.max,i),r},{total:0,max:0})},"sideStats"),bJn=C((t,e,r,n,i,a)=>{const s=Math.max(6,Math.floor(110/(i*.6))),o=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${e},${r})`),l=tie(o,TKt(n,s),0,0,"ishikawa-head-label","start",i),u=l.node().getBBox(),h=Math.max(60,u.width+6),d=Math.max(40,u.height*2+40),f=`M 0 ${-d/2} L 0 ${d/2} Q ${h*2.4} 0 0 ${-d/2} Z`;if(a){const p=a.roughSvg.path(f,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});o.insert(()=>p,":first-child").attr("class","ishikawa-head")}else o.insert("path",":first-child").attr("class","ishikawa-head").attr("d",f);l.attr("transform",`translate(${(h-u.width)/2-u.x+3},${-u.y-u.height/2})`)},"drawHead"),xJn=C((t,e)=>{const r=[],n=[],i=C((a,s,o)=>{const l=e===-1?[...a].reverse():a;for(const u of l){const h=r.length,d=u.children??[];r.push({depth:o,text:TKt(u.text,15),parentIndex:s,childCount:d.length}),o%2===0?(n.push(h),d.length&&i(d,h,o+1)):(d.length&&i(d,h,o+1),n.push(h))}},"walk");return i(t,-1,2),{entries:r,yOrder:n}},"flattenTree"),wJn=C((t,e,r,n,i,a,s)=>{const o=t.append("g").attr("class","ishikawa-label-group"),u=tie(o,e,r,n+11*i,"ishikawa-label cause","middle",a).node().getBBox();if(s){const h=s.roughSvg.rectangle(u.x-20,u.y-2,u.width+40,u.height+4,{roughness:1.5,seed:s.seed,fill:s.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:s.lineColor,strokeWidth:2});o.insert(()=>h,":first-child").attr("class","ishikawa-label-box")}else o.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",u.x-20).attr("y",u.y-2).attr("width",u.width+40).attr("height",u.height+4)},"drawCauseLabel"),ZDe=C((t,e,r,n,i,a)=>{const s=Math.sqrt(n*n+i*i);if(s===0)return;const o=n/s,l=i/s,u=6,h=-l*u,d=o*u,f=e,p=r,g=`M ${f} ${p} L ${f-o*u*2+h} ${p-l*u*2+d} L ${f-o*u*2-h} ${p-l*u*2-d} Z`,m=a.roughSvg.path(g,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:"solid",stroke:a.lineColor,strokeWidth:1});t.append(()=>m)},"drawArrowMarker"),AJn=C((t,e,r,n,i,a,s,o)=>{const l=e.children??[],u=a*(l.length?1:.2),h=-xKt*u,d=wKt*u*i,f=r+h,p=n+d;if(aD(t,r,n,f,p,"ishikawa-branch",o),o&&ZDe(t,r,n,r-f,n-p,o),wJn(t,e.text,f,p,i,s,o),!l.length)return;const{entries:g,yOrder:m}=xJn(l,i),v=g.length,y=new Array(v);for(const[S,T]of m.entries())y[T]=n+d*((S+1)/(v+1));const b=new Map;b.set(-1,{x0:r,y0:n,x1:f,y1:p,childCount:l.length,childrenDrawn:0});const x=-xKt,w=wKt*i,A=i<0?"ishikawa-label up":"ishikawa-label down";for(const[S,T]of g.entries()){const O=y[S],k=b.get(T.parentIndex),E=t.append("g").attr("class","ishikawa-sub-group");let _=0,I=0,L=0;if(T.depth%2===0){const R=k.y1-k.y0;_=CKt(k.x0,k.x1,R?(O-k.y0)/R:.5),I=O,L=_-(T.childCount>0?mJn+T.childCount*vJn:gJn),aD(E,_,O,L,O,"ishikawa-sub-branch",o),o&&ZDe(E,_,O,1,0,o),tie(E,T.text,L,O,"ishikawa-label align","end",s)}else{const R=k.childrenDrawn++;_=CKt(k.x0,k.x1,(k.childCount-R)/(k.childCount+1)),I=k.y0,L=_+x*((O-I)/w),aD(E,_,I,L,O,"ishikawa-sub-branch",o),o&&ZDe(E,_,I,_-L,I-O,o),tie(E,T.text,L,O,A,"end",s)}T.childCount>0&&b.set(S,{x0:_,y0:I,x1:L,y1:O,childCount:T.childCount,childrenDrawn:0})}},"drawBranch"),SJn=C(t=>t.split(/|\n/),"splitLines"),TKt=C((t,e)=>{if(t.length<=e)return t;const r=[];for(const n of t.split(/\s+/)){const i=r.length-1;i>=0&&r[i].length+1+n.length<=e?r[i]+=" "+n:r.push(n)}return r.join(` +`)},"wrapText"),tie=C((t,e,r,n,i,a,s)=>{const o=SJn(e),l=s*1.05,u=t.append("text").attr("class",i).attr("text-anchor",a).attr("x",r).attr("y",n-(o.length-1)*l/2);for(const[h,d]of o.entries())u.append("tspan").attr("x",r).attr("dy",h===0?0:l).text(d);return u},"drawMultilineText"),CKt=C((t,e,r)=>t+(e-t)*r,"lerp"),aD=C((t,e,r,n,i,a,s)=>{if(s){const o=s.roughSvg.line(e,r,n,i,{roughness:1.5,seed:s.seed,stroke:s.lineColor,strokeWidth:2});t.append(()=>o).attr("class",a);return}return t.append("line").attr("class",a).attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i)},"drawLine"),TJn={draw:yJn},CJn=C(t=>` .ishikawa .ishikawa-spine, .ishikawa .ishikawa-branch, .ishikawa .ishikawa-sub-branch { @@ -3682,18 +3682,18 @@ Expecting `+Z.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ee="Parse error o .ishikawa .ishikawa-label.down { dominant-baseline: hanging; } -`,"getStyles"),OJn=CJn,kJn={parser:dJn,get db(){return new fJn},renderer:SJn,styles:OJn};const EJn=Object.freeze(Object.defineProperty({__proto__:null,diagram:kJn},Symbol.toStringTag,{value:"Module"})),OKt=1e-10;function rie(t,e){const r=RJn(t),n=r.filter(o=>_Jn(o,t));let i=0,a=0;const s=[];if(n.length>1){const o=EKt(n);for(let u=0;uh.angle-u.angle);let l=n[n.length-1];for(let u=0;ug.radius*2&&(x=g.radius*2),(f==null||f.width>x)&&(f={circle:g,width:x,p1:h,p2:l,large:x>g.radius,sweep:!0})}f!=null&&(s.push(f),i+=JDe(f.circle.radius,f.width),l=h)}}else{let o=t[0];for(let u=1;uMath.abs(o.radius-t[u].radius)){l=!0;break}l?i=a=0:(i=o.radius*o.radius*Math.PI,s.push({circle:o,p1:{x:o.x,y:o.y+o.radius},p2:{x:o.x-OKt,y:o.y+o.radius},width:o.radius*2,large:!0,sweep:!0}))}return a/=2,e&&(e.area=i+a,e.arcArea=i,e.polygonArea=a,e.arcs=s,e.innerPoints=n,e.intersectionPoints=r),i+a}function _Jn(t,e){return e.every(r=>td(t,r)=t+e)return 0;if(r<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const n=t-(r*r-e*e+t*t)/(2*r),i=e-(r*r-t*t+e*e)/(2*r);return JDe(t,n)+JDe(e,i)}function kKt(t,e){const r=td(t,e),n=t.radius,i=e.radius;if(r>=n+i||r<=Math.abs(n-i))return[];const a=(n*n-i*i+r*r)/(2*r),s=Math.sqrt(n*n-a*a),o=t.x+a*(e.x-t.x)/r,l=t.y+a*(e.y-t.y)/r,u=-(e.y-t.y)*(s/r),h=-(e.x-t.x)*(s/r);return[{x:o+u,y:l-h},{x:o-u,y:l+h}]}function EKt(t){const e={x:0,y:0};for(const r of t)e.x+=r.x,e.y+=r.y;return e.x/=t.length,e.y/=t.length,e}function DJn(t,e,r,n){n=n||{};const i=n.maxIterations||100,a=n.tolerance||1e-10,s=t(e),o=t(r);let l=r-e;if(s*o>0)throw"Initial bisect points must have opposite signs";if(s===0)return e;if(o===0)return r;for(let u=0;u=0&&(e=h),Math.abs(l)tLe(e))}function sD(t,e){let r=0;for(let n=0;nA.fx-T.fx,y=e.slice(),b=e.slice(),x=e.slice(),w=e.slice();for(let A=0;A{const k=O.slice();return k.fx=O.fx,k.id=O.id,k});S.sort((O,k)=>O.id-k.id),r.history.push({x:g[0].slice(),fx:g[0].fx,simplex:S})}f=0;for(let S=0;S=g[p-1].fx){let S=!1;if(b.fx>T.fx?(ib(x,1+h,y,-h,T),x.fx=t(x),x.fx=1)break;for(let O=1;Oo+a*i*l||u>=v)m=i;else{if(Math.abs(d)<=-s*l)return i;d*(m-g)>=0&&(m=g),g=i,v=u}return 0}for(let g=0;g<10;++g){if(ib(n.x,1,r.x,i,e),u=n.fx=t(n.x,n.fxprime),d=sD(n.fxprime,e),u>o+a*i*l||g&&u>=h)return p(f,i,h);if(Math.abs(d)<=-s*l)return i;if(d>=0)return p(i,f,u);h=u,f=i,i*=2}return i}function MJn(t,e,r){let n={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const a=e.slice();let s,o,l=1,u;r=r||{},u=r.maxIterations||e.length*20,n.fx=t(n.x,n.fxprime),s=n.fxprime.slice(),nLe(s,n.fxprime,-1);for(let h=0;h{const d={};for(let f=0;feLe(t,e,n)-r,0,t+e)}function IJn(t,e={}){const r=e.distinct,n=t.map(o=>Object.assign({},o));function i(o){return o.join(";")}if(r){const o=new Map;for(const l of n)for(let u=0;uo===l?0:oa.sets.length===2).forEach(a=>{const s=r[a.sets[0]],o=r[a.sets[1]],l=Math.sqrt(e[s].size/Math.PI),u=Math.sqrt(e[o].size/Math.PI),h=iLe(l,u,a.size);n[s][o]=n[o][s]=h;let d=0;a.size+1e-10>=Math.min(e[s].size,e[o].size)?d=1:a.size<=1e-10&&(d=-1),i[s][o]=i[o][s]=d}),{distances:n,constraints:i}}function NJn(t,e,r,n){for(let a=0;a0&&g<=d||f<0&&g>=d||(i+=2*m*m,e[2*a]+=4*m*(s-u),e[2*a+1]+=4*m*(o-h),e[2*l]+=4*m*(u-s),e[2*l+1]+=4*m*(h-o))}}return i}function BJn(t,e={}){let r=FJn(t,e);const n=e.lossFunction||oD;if(t.length>=8){const i=$Jn(t,e),a=n(i,t),s=n(r,t);a+1e-8f.map(p=>p/o));const l=(f,p)=>NJn(f,p,a,s);let u=null;for(let f=0;fd.sets.length===2);for(const d of t){let f=d.weight!=null?d.weight:1;const p=d.sets[0],g=d.sets[1];d.size+LKt>=Math.min(n[p].size,n[g].size)&&(f=0),i[p].push({set:g,size:d.size,weight:f}),i[g].push({set:p,size:d.size,weight:f})}const a=[];Object.keys(i).forEach(d=>{let f=0;for(let p=0;pt[s]));const a=n.weight!=null?n.weight:1;r+=a*(i-n.size)*(i-n.size)}return r}function MKt(t,e){let r=0;for(const n of e){if(n.sets.length===1)continue;let i;if(n.sets.length===2){const o=t[n.sets[0]],l=t[n.sets[1]];i=eLe(o.radius,l.radius,td(o,l))}else i=rie(n.sets.map(o=>t[o]));const a=n.weight!=null?n.weight:1,s=Math.log((i+1)/(n.size+1));r+=a*s*s}return r}function zJn(t,e,r){if(r==null?t.sort((i,a)=>a.radius-i.radius):t.sort(r),t.length>0){const i=t[0].x,a=t[0].y;for(const s of t)s.x-=i,s.y-=a}if(t.length===2&&td(t[0],t[1])1){const i=Math.atan2(t[1].x,t[1].y)-e,a=Math.cos(i),s=Math.sin(i);for(const o of t){const l=o.x,u=o.y;o.x=a*l-s*u,o.y=s*l+a*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-e;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const a=t[1].y/(1e-10+t[1].x);for(const s of t){var n=(s.x+a*s.y)/(1+a*a);s.x=2*n-s.x,s.y=2*n*a-s.y}}}}function UJn(t){t.forEach(i=>{i.parent=i});function e(i){return i.parent!==i&&(i.parent=e(i.parent)),i.parent}function r(i,a){const s=e(i),o=e(a);s.parent=o}for(let i=0;i{delete i.parent}),Array.from(n.values())}function aLe(t){const e=r=>{const n=t.reduce((a,s)=>Math.max(a,s[r]+s.radius),Number.NEGATIVE_INFINITY),i=t.reduce((a,s)=>Math.min(a,s[r]-s.radius),Number.POSITIVE_INFINITY);return{max:n,min:i}};return{xRange:e("x"),yRange:e("y")}}function IKt(t,e,r){e==null&&(e=Math.PI/2);let n=BKt(t).map(u=>Object.assign({},u));const i=UJn(n);for(const u of i){zJn(u,e,r);const h=aLe(u);u.size=(h.xRange.max-h.xRange.min)*(h.yRange.max-h.yRange.min),u.bounds=h}i.sort((u,h)=>h.size-u.size),n=i[0];let a=n.bounds;const s=(a.xRange.max-a.xRange.min)/50;function o(u,h,d){if(!u)return;const f=u.bounds;let p,g;if(h)p=a.xRange.max-f.xRange.min+s;else{p=a.xRange.max-f.xRange.max;const m=(f.xRange.max-f.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;m<0&&(p+=m)}if(d)g=a.yRange.max-f.yRange.min+s;else{g=a.yRange.max-f.yRange.max;const m=(f.yRange.max-f.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;m<0&&(g+=m)}for(const m of u)m.x+=p,m.y+=g,n.push(m)}let l=1;for(;l({radius:h*p.radius,x:n+d+(p.x-s.min)*h,y:n+f+(p.y-o.min)*h,setid:p.setid})))}function NKt(t){const e={};for(const r of t)e[r.setid]=r;return e}function BKt(t){return Object.keys(t).map(r=>Object.assign(t[r],{setid:r}))}function VJn(t={}){let e=!1,r=600,n=350,i=15,a=1e3,s=Math.PI/2,o=!0,l=null,u=!0,h=!0,d=null,f=null,p=!1,g=null,m=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,v={},y=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],b=0,x=function(S){if(S in v)return v[S];var O=v[S]=y[b];return b+=1,b>=y.length&&(b=0),O},w=DKt,A=oD;function T(S){let O=S.datum();const k=new Set;O.forEach(Y=>{Y.size==0&&Y.sets.length==1&&k.add(Y.sets[0])}),O=O.filter(Y=>!Y.sets.some(le=>k.has(le)));let E={},_={};if(O.length>0){let Y=w(O,{lossFunction:A,distinct:p});o&&(Y=IKt(Y,s,f)),E=PKt(Y,r,n,i,l),_=FKt(E,O,m)}const I={};O.forEach(Y=>{Y.label&&(I[Y.sets]=Y.label)});function L(Y){if(Y.sets in I)return I[Y.sets];if(Y.sets.length==1)return""+Y.sets[0]}S.selectAll("svg").data([E]).enter().append("svg");const R=S.select("svg");e?R.attr("viewBox",`0 0 ${r} ${n}`):R.attr("width",r).attr("height",n);const D={};let M=!1;R.selectAll(".venn-area path").each(function(Y){const le=this.getAttribute("d");Y.sets.length==1&&le&&!p&&(M=!0,D[Y.sets[0]]=HJn(le))});function P(Y){return le=>{const q=Y.sets.map(Z=>{let ee=D[Z],re=E[Z];return ee||(ee={x:r/2,y:n/2,radius:1}),re||(re={x:r/2,y:n/2,radius:1}),{x:ee.x*(1-le)+re.x*le,y:ee.y*(1-le)+re.y*le,radius:ee.radius*(1-le)+re.radius*le}});return VKt(q,g)}}const N=R.selectAll(".venn-area").data(O,Y=>Y.sets),F=N.enter().append("g").attr("class",Y=>`venn-area venn-${Y.sets.length==1?"circle":"intersection"}${Y.colour||Y.color?" venn-coloured":""}`).attr("data-venn-sets",Y=>Y.sets.join("_")),B=F.append("path"),V=F.append("text").attr("class","label").text(Y=>L(Y)).attr("text-anchor","middle").attr("dy",".35em").attr("x",r/2).attr("y",n/2);h&&(B.style("fill-opacity","0").filter(Y=>Y.sets.length==1).style("fill",Y=>Y.colour?Y.colour:Y.color?Y.color:x(Y.sets)).style("fill-opacity",".25"),V.style("fill",Y=>Y.colour||Y.color?"#FFF":t.textFill?t.textFill:Y.sets.length==1?x(Y.sets):"#444"));function z(Y){return typeof Y.transition=="function"?Y.transition("venn").duration(a):Y}let U=S;M&&typeof U.transition=="function"?(U=z(S),U.selectAll("path").attrTween("d",P)):U.selectAll("path").attr("d",Y=>VKt(Y.sets.map(le=>E[le])),g);const Q=U.selectAll("text").filter(Y=>Y.sets in _).text(Y=>L(Y)).attr("x",Y=>Math.floor(_[Y.sets].x)).attr("y",Y=>Math.floor(_[Y.sets].y));u&&(M?"on"in Q?Q.on("end",sLe(E,L)):Q.each("end",sLe(E,L)):Q.each(sLe(E,L)));const G=z(N.exit()).remove();typeof N.transition=="function"&&G.selectAll("path").attrTween("d",P);const X=G.selectAll("text").attr("x",r/2).attr("y",n/2);return d!==null&&(V.style("font-size","0px"),Q.style("font-size",d),X.style("font-size","0px")),{circles:E,textCentres:_,nodes:N,enter:F,update:U,exit:G}}return T.wrap=function(S){return arguments.length?(u=S,T):u},T.useViewBox=function(){return e=!0,T},T.width=function(S){return arguments.length?(r=S,T):r},T.height=function(S){return arguments.length?(n=S,T):n},T.padding=function(S){return arguments.length?(i=S,T):i},T.distinct=function(S){return arguments.length?(p=S,T):p},T.colours=function(S){return arguments.length?(x=S,T):x},T.colors=function(S){return arguments.length?(x=S,T):x},T.fontSize=function(S){return arguments.length?(d=S,T):d},T.round=function(S){return arguments.length?(g=S,T):g},T.duration=function(S){return arguments.length?(a=S,T):a},T.layoutFunction=function(S){return arguments.length?(w=S,T):w},T.normalize=function(S){return arguments.length?(o=S,T):o},T.scaleToFit=function(S){return arguments.length?(l=S,T):l},T.styled=function(S){return arguments.length?(h=S,T):h},T.orientation=function(S){return arguments.length?(s=S,T):s},T.orientationOrder=function(S){return arguments.length?(f=S,T):f},T.lossFunction=function(S){return arguments.length?(A=S==="default"?oD:S==="logRatio"?MKt:S,T):A},T}function sLe(t,e){return function(r){const n=this,i=t[r.sets[0]].radius||50,a=e(r)||"",s=a.split(/\s+/).reverse(),l=(a.length+s.length)/3;let u=s.pop(),h=[u],d=0;const f=1.1;n.textContent=null;const p=[];function g(x){const w=n.ownerDocument.createElementNS(n.namespaceURI,"tspan");return w.textContent=x,p.push(w),n.append(w),w}let m=g(u);for(;u=s.pop(),!!u;){h.push(u);const x=h.join(" ");m.textContent=x,x.length>l&&m.getComputedTextLength()>i&&(h.pop(),m.textContent=h.join(" "),h=[u],m=g(u),d++)}const v=.35-d*f/2,y=n.getAttribute("x"),b=n.getAttribute("y");p.forEach((x,w)=>{x.setAttribute("x",y),x.setAttribute("y",b),x.setAttribute("dy",`${v+w*f}em`)})}}function oLe(t,e,r){let n=e[0].radius-td(e[0],t);for(let i=1;i=a&&(i=n[h],a=d)}const s=RKt(h=>-1*oLe({x:h[0],y:h[1]},t,e),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,o={x:r?0:s[0],y:s[1]};let l=!0;for(const h of t)if(td(o,h)>h.radius){l=!1;break}for(const h of e)if(td(o,h)h.p1))}function QJn(t){const e={},r=Object.keys(t);for(const n of r)e[n]=[];for(let n=0;n0&&console.log("WARNING: area "+s+" not represented on screen")}return n}function GJn(t,e,r){const n=[];return n.push(` +`,"getStyles"),OJn=CJn,kJn={parser:dJn,get db(){return new fJn},renderer:TJn,styles:OJn};const EJn=Object.freeze(Object.defineProperty({__proto__:null,diagram:kJn},Symbol.toStringTag,{value:"Module"})),OKt=1e-10;function rie(t,e){const r=RJn(t),n=r.filter(o=>_Jn(o,t));let i=0,a=0;const s=[];if(n.length>1){const o=EKt(n);for(let u=0;uh.angle-u.angle);let l=n[n.length-1];for(let u=0;ug.radius*2&&(x=g.radius*2),(f==null||f.width>x)&&(f={circle:g,width:x,p1:h,p2:l,large:x>g.radius,sweep:!0})}f!=null&&(s.push(f),i+=JDe(f.circle.radius,f.width),l=h)}}else{let o=t[0];for(let u=1;uMath.abs(o.radius-t[u].radius)){l=!0;break}l?i=a=0:(i=o.radius*o.radius*Math.PI,s.push({circle:o,p1:{x:o.x,y:o.y+o.radius},p2:{x:o.x-OKt,y:o.y+o.radius},width:o.radius*2,large:!0,sweep:!0}))}return a/=2,e&&(e.area=i+a,e.arcArea=i,e.polygonArea=a,e.arcs=s,e.innerPoints=n,e.intersectionPoints=r),i+a}function _Jn(t,e){return e.every(r=>td(t,r)=t+e)return 0;if(r<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const n=t-(r*r-e*e+t*t)/(2*r),i=e-(r*r-t*t+e*e)/(2*r);return JDe(t,n)+JDe(e,i)}function kKt(t,e){const r=td(t,e),n=t.radius,i=e.radius;if(r>=n+i||r<=Math.abs(n-i))return[];const a=(n*n-i*i+r*r)/(2*r),s=Math.sqrt(n*n-a*a),o=t.x+a*(e.x-t.x)/r,l=t.y+a*(e.y-t.y)/r,u=-(e.y-t.y)*(s/r),h=-(e.x-t.x)*(s/r);return[{x:o+u,y:l-h},{x:o-u,y:l+h}]}function EKt(t){const e={x:0,y:0};for(const r of t)e.x+=r.x,e.y+=r.y;return e.x/=t.length,e.y/=t.length,e}function DJn(t,e,r,n){n=n||{};const i=n.maxIterations||100,a=n.tolerance||1e-10,s=t(e),o=t(r);let l=r-e;if(s*o>0)throw"Initial bisect points must have opposite signs";if(s===0)return e;if(o===0)return r;for(let u=0;u=0&&(e=h),Math.abs(l)tLe(e))}function sD(t,e){let r=0;for(let n=0;nA.fx-S.fx,y=e.slice(),b=e.slice(),x=e.slice(),w=e.slice();for(let A=0;A{const k=O.slice();return k.fx=O.fx,k.id=O.id,k});T.sort((O,k)=>O.id-k.id),r.history.push({x:g[0].slice(),fx:g[0].fx,simplex:T})}f=0;for(let T=0;T=g[p-1].fx){let T=!1;if(b.fx>S.fx?(ib(x,1+h,y,-h,S),x.fx=t(x),x.fx=1)break;for(let O=1;Oo+a*i*l||u>=v)m=i;else{if(Math.abs(d)<=-s*l)return i;d*(m-g)>=0&&(m=g),g=i,v=u}return 0}for(let g=0;g<10;++g){if(ib(n.x,1,r.x,i,e),u=n.fx=t(n.x,n.fxprime),d=sD(n.fxprime,e),u>o+a*i*l||g&&u>=h)return p(f,i,h);if(Math.abs(d)<=-s*l)return i;if(d>=0)return p(i,f,u);h=u,f=i,i*=2}return i}function MJn(t,e,r){let n={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const a=e.slice();let s,o,l=1,u;r=r||{},u=r.maxIterations||e.length*20,n.fx=t(n.x,n.fxprime),s=n.fxprime.slice(),nLe(s,n.fxprime,-1);for(let h=0;h{const d={};for(let f=0;feLe(t,e,n)-r,0,t+e)}function IJn(t,e={}){const r=e.distinct,n=t.map(o=>Object.assign({},o));function i(o){return o.join(";")}if(r){const o=new Map;for(const l of n)for(let u=0;uo===l?0:oa.sets.length===2).forEach(a=>{const s=r[a.sets[0]],o=r[a.sets[1]],l=Math.sqrt(e[s].size/Math.PI),u=Math.sqrt(e[o].size/Math.PI),h=iLe(l,u,a.size);n[s][o]=n[o][s]=h;let d=0;a.size+1e-10>=Math.min(e[s].size,e[o].size)?d=1:a.size<=1e-10&&(d=-1),i[s][o]=i[o][s]=d}),{distances:n,constraints:i}}function NJn(t,e,r,n){for(let a=0;a0&&g<=d||f<0&&g>=d||(i+=2*m*m,e[2*a]+=4*m*(s-u),e[2*a+1]+=4*m*(o-h),e[2*l]+=4*m*(u-s),e[2*l+1]+=4*m*(h-o))}}return i}function BJn(t,e={}){let r=FJn(t,e);const n=e.lossFunction||oD;if(t.length>=8){const i=$Jn(t,e),a=n(i,t),s=n(r,t);a+1e-8f.map(p=>p/o));const l=(f,p)=>NJn(f,p,a,s);let u=null;for(let f=0;fd.sets.length===2);for(const d of t){let f=d.weight!=null?d.weight:1;const p=d.sets[0],g=d.sets[1];d.size+LKt>=Math.min(n[p].size,n[g].size)&&(f=0),i[p].push({set:g,size:d.size,weight:f}),i[g].push({set:p,size:d.size,weight:f})}const a=[];Object.keys(i).forEach(d=>{let f=0;for(let p=0;pt[s]));const a=n.weight!=null?n.weight:1;r+=a*(i-n.size)*(i-n.size)}return r}function MKt(t,e){let r=0;for(const n of e){if(n.sets.length===1)continue;let i;if(n.sets.length===2){const o=t[n.sets[0]],l=t[n.sets[1]];i=eLe(o.radius,l.radius,td(o,l))}else i=rie(n.sets.map(o=>t[o]));const a=n.weight!=null?n.weight:1,s=Math.log((i+1)/(n.size+1));r+=a*s*s}return r}function zJn(t,e,r){if(r==null?t.sort((i,a)=>a.radius-i.radius):t.sort(r),t.length>0){const i=t[0].x,a=t[0].y;for(const s of t)s.x-=i,s.y-=a}if(t.length===2&&td(t[0],t[1])1){const i=Math.atan2(t[1].x,t[1].y)-e,a=Math.cos(i),s=Math.sin(i);for(const o of t){const l=o.x,u=o.y;o.x=a*l-s*u,o.y=s*l+a*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-e;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const a=t[1].y/(1e-10+t[1].x);for(const s of t){var n=(s.x+a*s.y)/(1+a*a);s.x=2*n-s.x,s.y=2*n*a-s.y}}}}function UJn(t){t.forEach(i=>{i.parent=i});function e(i){return i.parent!==i&&(i.parent=e(i.parent)),i.parent}function r(i,a){const s=e(i),o=e(a);s.parent=o}for(let i=0;i{delete i.parent}),Array.from(n.values())}function aLe(t){const e=r=>{const n=t.reduce((a,s)=>Math.max(a,s[r]+s.radius),Number.NEGATIVE_INFINITY),i=t.reduce((a,s)=>Math.min(a,s[r]-s.radius),Number.POSITIVE_INFINITY);return{max:n,min:i}};return{xRange:e("x"),yRange:e("y")}}function IKt(t,e,r){e==null&&(e=Math.PI/2);let n=BKt(t).map(u=>Object.assign({},u));const i=UJn(n);for(const u of i){zJn(u,e,r);const h=aLe(u);u.size=(h.xRange.max-h.xRange.min)*(h.yRange.max-h.yRange.min),u.bounds=h}i.sort((u,h)=>h.size-u.size),n=i[0];let a=n.bounds;const s=(a.xRange.max-a.xRange.min)/50;function o(u,h,d){if(!u)return;const f=u.bounds;let p,g;if(h)p=a.xRange.max-f.xRange.min+s;else{p=a.xRange.max-f.xRange.max;const m=(f.xRange.max-f.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;m<0&&(p+=m)}if(d)g=a.yRange.max-f.yRange.min+s;else{g=a.yRange.max-f.yRange.max;const m=(f.yRange.max-f.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;m<0&&(g+=m)}for(const m of u)m.x+=p,m.y+=g,n.push(m)}let l=1;for(;l({radius:h*p.radius,x:n+d+(p.x-s.min)*h,y:n+f+(p.y-o.min)*h,setid:p.setid})))}function NKt(t){const e={};for(const r of t)e[r.setid]=r;return e}function BKt(t){return Object.keys(t).map(r=>Object.assign(t[r],{setid:r}))}function VJn(t={}){let e=!1,r=600,n=350,i=15,a=1e3,s=Math.PI/2,o=!0,l=null,u=!0,h=!0,d=null,f=null,p=!1,g=null,m=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,v={},y=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],b=0,x=function(T){if(T in v)return v[T];var O=v[T]=y[b];return b+=1,b>=y.length&&(b=0),O},w=DKt,A=oD;function S(T){let O=T.datum();const k=new Set;O.forEach(Y=>{Y.size==0&&Y.sets.length==1&&k.add(Y.sets[0])}),O=O.filter(Y=>!Y.sets.some(le=>k.has(le)));let E={},_={};if(O.length>0){let Y=w(O,{lossFunction:A,distinct:p});o&&(Y=IKt(Y,s,f)),E=PKt(Y,r,n,i,l),_=FKt(E,O,m)}const I={};O.forEach(Y=>{Y.label&&(I[Y.sets]=Y.label)});function L(Y){if(Y.sets in I)return I[Y.sets];if(Y.sets.length==1)return""+Y.sets[0]}T.selectAll("svg").data([E]).enter().append("svg");const R=T.select("svg");e?R.attr("viewBox",`0 0 ${r} ${n}`):R.attr("width",r).attr("height",n);const D={};let M=!1;R.selectAll(".venn-area path").each(function(Y){const le=this.getAttribute("d");Y.sets.length==1&&le&&!p&&(M=!0,D[Y.sets[0]]=HJn(le))});function P(Y){return le=>{const q=Y.sets.map(Z=>{let ee=D[Z],re=E[Z];return ee||(ee={x:r/2,y:n/2,radius:1}),re||(re={x:r/2,y:n/2,radius:1}),{x:ee.x*(1-le)+re.x*le,y:ee.y*(1-le)+re.y*le,radius:ee.radius*(1-le)+re.radius*le}});return VKt(q,g)}}const N=R.selectAll(".venn-area").data(O,Y=>Y.sets),F=N.enter().append("g").attr("class",Y=>`venn-area venn-${Y.sets.length==1?"circle":"intersection"}${Y.colour||Y.color?" venn-coloured":""}`).attr("data-venn-sets",Y=>Y.sets.join("_")),B=F.append("path"),V=F.append("text").attr("class","label").text(Y=>L(Y)).attr("text-anchor","middle").attr("dy",".35em").attr("x",r/2).attr("y",n/2);h&&(B.style("fill-opacity","0").filter(Y=>Y.sets.length==1).style("fill",Y=>Y.colour?Y.colour:Y.color?Y.color:x(Y.sets)).style("fill-opacity",".25"),V.style("fill",Y=>Y.colour||Y.color?"#FFF":t.textFill?t.textFill:Y.sets.length==1?x(Y.sets):"#444"));function z(Y){return typeof Y.transition=="function"?Y.transition("venn").duration(a):Y}let U=T;M&&typeof U.transition=="function"?(U=z(T),U.selectAll("path").attrTween("d",P)):U.selectAll("path").attr("d",Y=>VKt(Y.sets.map(le=>E[le])),g);const Q=U.selectAll("text").filter(Y=>Y.sets in _).text(Y=>L(Y)).attr("x",Y=>Math.floor(_[Y.sets].x)).attr("y",Y=>Math.floor(_[Y.sets].y));u&&(M?"on"in Q?Q.on("end",sLe(E,L)):Q.each("end",sLe(E,L)):Q.each(sLe(E,L)));const G=z(N.exit()).remove();typeof N.transition=="function"&&G.selectAll("path").attrTween("d",P);const X=G.selectAll("text").attr("x",r/2).attr("y",n/2);return d!==null&&(V.style("font-size","0px"),Q.style("font-size",d),X.style("font-size","0px")),{circles:E,textCentres:_,nodes:N,enter:F,update:U,exit:G}}return S.wrap=function(T){return arguments.length?(u=T,S):u},S.useViewBox=function(){return e=!0,S},S.width=function(T){return arguments.length?(r=T,S):r},S.height=function(T){return arguments.length?(n=T,S):n},S.padding=function(T){return arguments.length?(i=T,S):i},S.distinct=function(T){return arguments.length?(p=T,S):p},S.colours=function(T){return arguments.length?(x=T,S):x},S.colors=function(T){return arguments.length?(x=T,S):x},S.fontSize=function(T){return arguments.length?(d=T,S):d},S.round=function(T){return arguments.length?(g=T,S):g},S.duration=function(T){return arguments.length?(a=T,S):a},S.layoutFunction=function(T){return arguments.length?(w=T,S):w},S.normalize=function(T){return arguments.length?(o=T,S):o},S.scaleToFit=function(T){return arguments.length?(l=T,S):l},S.styled=function(T){return arguments.length?(h=T,S):h},S.orientation=function(T){return arguments.length?(s=T,S):s},S.orientationOrder=function(T){return arguments.length?(f=T,S):f},S.lossFunction=function(T){return arguments.length?(A=T==="default"?oD:T==="logRatio"?MKt:T,S):A},S}function sLe(t,e){return function(r){const n=this,i=t[r.sets[0]].radius||50,a=e(r)||"",s=a.split(/\s+/).reverse(),l=(a.length+s.length)/3;let u=s.pop(),h=[u],d=0;const f=1.1;n.textContent=null;const p=[];function g(x){const w=n.ownerDocument.createElementNS(n.namespaceURI,"tspan");return w.textContent=x,p.push(w),n.append(w),w}let m=g(u);for(;u=s.pop(),!!u;){h.push(u);const x=h.join(" ");m.textContent=x,x.length>l&&m.getComputedTextLength()>i&&(h.pop(),m.textContent=h.join(" "),h=[u],m=g(u),d++)}const v=.35-d*f/2,y=n.getAttribute("x"),b=n.getAttribute("y");p.forEach((x,w)=>{x.setAttribute("x",y),x.setAttribute("y",b),x.setAttribute("dy",`${v+w*f}em`)})}}function oLe(t,e,r){let n=e[0].radius-td(e[0],t);for(let i=1;i=a&&(i=n[h],a=d)}const s=RKt(h=>-1*oLe({x:h[0],y:h[1]},t,e),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,o={x:r?0:s[0],y:s[1]};let l=!0;for(const h of t)if(td(o,h)>h.radius){l=!1;break}for(const h of e)if(td(o,h)h.p1))}function QJn(t){const e={},r=Object.keys(t);for(const n of r)e[n]=[];for(let n=0;n0&&console.log("WARNING: area "+s+" not represented on screen")}return n}function GJn(t,e,r){const n=[];return n.push(` M`,t,e),n.push(` m`,-r,0),n.push(` a`,r,r,0,1,0,r*2,0),n.push(` a`,r,r,0,1,0,-r*2,0),n.join(" ")}function HJn(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}function zKt(t){if(t.length===0)return[];const e={};return rie(t,e),e.arcs}function UKt(t,e){if(t.length===0)return"M 0 0";const r=Math.pow(10,e||0),n=e!=null?a=>Math.round(a*r)/r:a=>a;if(t.length==1){const a=t[0].circle;return GJn(n(a.x),n(a.y),n(a.radius))}const i=[` M`,n(t[0].p2.x),n(t[0].p2.y)];for(const a of t){const s=n(a.circle.radius);i.push(` -A`,s,s,0,a.large?1:0,a.sweep?1:0,n(a.p1.x),n(a.p1.y))}return i.join(" ")}function VKt(t,e){return UKt(zKt(t),e)}function WJn(t,e={}){const{lossFunction:r,layoutFunction:n=DKt,normalize:i=!0,orientation:a=Math.PI/2,orientationOrder:s,width:o=600,height:l=350,padding:u=15,scaleToFit:h=!1,symmetricalTextCentre:d=!1,distinct:f,round:p=2}=e;let g=n(t,{lossFunction:r==="default"||!r?oD:r==="logRatio"?MKt:r,distinct:f});i&&(g=IKt(g,a,s));const m=PKt(g,o,l,u,h),v=FKt(m,t,d),y=new Map(Object.keys(m).map(w=>[w,{set:w,x:m[w].x,y:m[w].y,radius:m[w].radius}])),b=t.map(w=>{const A=w.sets.map(O=>y.get(O)),T=zKt(A),S=UKt(T,p);return{circles:A,arcs:T,path:S,area:w,has:new Set(w.sets)}});function x(w){let A="";for(const T of b)T.has.size>w.length&&w.every(S=>T.has.has(S))&&(A+=" "+T.path);return A}return b.map(({circles:w,arcs:A,path:T,area:S})=>({data:S,text:v[S.sets],circles:w,arcs:A,path:T,distinctPath:T+x(S.sets)}))}var lLe=function(){var t=C(function(b,x,w,A){for(w=w||{},A=b.length;A--;w[b[A]]=x);return w},"o"),e=[5,8],r=[7,8,11,12,17,19,22,24],n=[1,17],i=[1,18],a=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],s=[1,31],o=[1,39],l=[7,8,11,12,17,19,22,24,27],u=[1,57],h=[1,56],d=[1,58],f=[1,59],p=[1,60],g=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],m={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:C(function(x,w,A,T,S,O,k){var E=O.length-1;switch(S){case 1:return O[E-1];case 2:case 3:case 4:this.$=[];break;case 5:O[E-1].push(O[E]),this.$=O[E-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=O[E];break;case 8:T.setDiagramTitle(O[E].substr(6)),this.$=O[E].substr(6);break;case 9:T.addSubsetData([O[E]],void 0,void 0),T.setIndentMode&&T.setIndentMode(!0);break;case 10:T.addSubsetData([O[E-1]],O[E],void 0),T.setIndentMode&&T.setIndentMode(!0);break;case 11:T.addSubsetData([O[E-2]],void 0,parseFloat(O[E])),T.setIndentMode&&T.setIndentMode(!0);break;case 12:T.addSubsetData([O[E-3]],O[E-2],parseFloat(O[E])),T.setIndentMode&&T.setIndentMode(!0);break;case 13:if(O[E].length<2)throw new Error("union requires multiple identifiers");T.validateUnionIdentifiers&&T.validateUnionIdentifiers(O[E]),T.addSubsetData(O[E],void 0,void 0),T.setIndentMode&&T.setIndentMode(!0);break;case 14:if(O[E-1].length<2)throw new Error("union requires multiple identifiers");T.validateUnionIdentifiers&&T.validateUnionIdentifiers(O[E-1]),T.addSubsetData(O[E-1],O[E],void 0),T.setIndentMode&&T.setIndentMode(!0);break;case 15:if(O[E-2].length<2)throw new Error("union requires multiple identifiers");T.validateUnionIdentifiers&&T.validateUnionIdentifiers(O[E-2]),T.addSubsetData(O[E-2],void 0,parseFloat(O[E])),T.setIndentMode&&T.setIndentMode(!0);break;case 16:if(O[E-3].length<2)throw new Error("union requires multiple identifiers");T.validateUnionIdentifiers&&T.validateUnionIdentifiers(O[E-3]),T.addSubsetData(O[E-3],O[E-2],parseFloat(O[E])),T.setIndentMode&&T.setIndentMode(!0);break;case 17:case 18:case 19:T.addTextData(O[E-1],O[E],void 0);break;case 20:case 21:T.addTextData(O[E-2],O[E-1],O[E]);break;case 23:T.addStyleData(O[E-1],O[E]);break;case 24:case 25:case 26:var _=T.getCurrentSets();if(!_)throw new Error("text requires set");T.addTextData(_,O[E],void 0);break;case 27:case 28:var _=T.getCurrentSets();if(!_)throw new Error("text requires set");T.addTextData(_,O[E-1],O[E]);break;case 29:case 41:this.$=[O[E]];break;case 30:case 42:this.$=[...O[E-2],O[E]];break;case 31:this.$=[O[E-2],O[E]];break;case 33:this.$=O[E].join(" ");break;case 34:this.$=[O[E]];break;case 35:O[E-1].push(O[E]),this.$=O[E-1];break;case 43:case 44:this.$=O[E];break}},"anonymous"),table:[t(e,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(r,[2,4],{6:5}),t(e,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(r,[2,5]),t(r,[2,6]),t(r,[2,7]),t(r,[2,8]),{13:16,20:n,21:i},{13:20,18:19,20:n,21:i},{13:20,18:21,20:n,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:n,21:i},t(r,[2,9],{14:[1,27],15:[1,28]}),t(a,[2,43]),t(a,[2,44]),t(r,[2,13],{14:[1,29],15:[1,30],27:s}),t(a,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:s},t(r,[2,22]),t(r,[2,24],{14:[1,35]}),t(r,[2,25],{14:[1,36]}),t(r,[2,26]),{20:o,25:37,26:38,27:s},t(r,[2,10],{15:[1,40]}),{16:[1,41]},t(r,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:n,21:i},t(r,[2,17],{14:[1,45]}),t(r,[2,18],{14:[1,46]}),t(r,[2,19]),t(r,[2,27]),t(r,[2,28]),t(r,[2,23],{27:[1,47]}),t(l,[2,29]),{15:[1,48]},{16:[1,49]},t(r,[2,11]),{16:[1,50]},t(r,[2,15]),t(a,[2,42]),t(r,[2,20]),t(r,[2,21]),{20:o,26:51},{16:u,20:h,21:[1,53],28:52,29:54,30:55,31:d,32:f,33:p},t(r,[2,12]),t(r,[2,16]),t(l,[2,30]),t(l,[2,31]),t(l,[2,32]),t(l,[2,33],{30:61,16:u,20:h,31:d,32:f,33:p}),t(g,[2,34]),t(g,[2,36]),t(g,[2,37]),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,35])],defaultActions:{6:[2,1]},parseError:C(function(x,w){if(w.recoverable)this.trace(x);else{var A=new Error(x);throw A.hash=w,A}},"parseError"),parse:C(function(x){var w=this,A=[0],T=[],S=[null],O=[],k=this.table,E="",_=0,I=0,L=2,R=1,D=O.slice.call(arguments,1),M=Object.create(this.lexer),P={yy:{}};for(var N in this.yy)Object.prototype.hasOwnProperty.call(this.yy,N)&&(P.yy[N]=this.yy[N]);M.setInput(x,P.yy),P.yy.lexer=M,P.yy.parser=this,typeof M.yylloc>"u"&&(M.yylloc={});var F=M.yylloc;O.push(F);var B=M.options&&M.options.ranges;typeof P.yy.parseError=="function"?this.parseError=P.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function V(ve){A.length=A.length-2*ve,S.length=S.length-ve,O.length=O.length-ve}C(V,"popStack");function z(){var ve;return ve=T.pop()||M.lex()||R,typeof ve!="number"&&(ve instanceof Array&&(T=ve,ve=T.pop()),ve=w.symbols_[ve]||ve),ve}C(z,"lex");for(var U,Q,G,X,Y={},le,q,Z,ee;;){if(Q=A[A.length-1],this.defaultActions[Q]?G=this.defaultActions[Q]:((U===null||typeof U>"u")&&(U=z()),G=k[Q]&&k[Q][U]),typeof G>"u"||!G.length||!G[0]){var re="";ee=[];for(le in k[Q])this.terminals_[le]&&le>L&&ee.push("'"+this.terminals_[le]+"'");M.showPosition?re="Parse error on line "+(_+1)+`: +A`,s,s,0,a.large?1:0,a.sweep?1:0,n(a.p1.x),n(a.p1.y))}return i.join(" ")}function VKt(t,e){return UKt(zKt(t),e)}function WJn(t,e={}){const{lossFunction:r,layoutFunction:n=DKt,normalize:i=!0,orientation:a=Math.PI/2,orientationOrder:s,width:o=600,height:l=350,padding:u=15,scaleToFit:h=!1,symmetricalTextCentre:d=!1,distinct:f,round:p=2}=e;let g=n(t,{lossFunction:r==="default"||!r?oD:r==="logRatio"?MKt:r,distinct:f});i&&(g=IKt(g,a,s));const m=PKt(g,o,l,u,h),v=FKt(m,t,d),y=new Map(Object.keys(m).map(w=>[w,{set:w,x:m[w].x,y:m[w].y,radius:m[w].radius}])),b=t.map(w=>{const A=w.sets.map(O=>y.get(O)),S=zKt(A),T=UKt(S,p);return{circles:A,arcs:S,path:T,area:w,has:new Set(w.sets)}});function x(w){let A="";for(const S of b)S.has.size>w.length&&w.every(T=>S.has.has(T))&&(A+=" "+S.path);return A}return b.map(({circles:w,arcs:A,path:S,area:T})=>({data:T,text:v[T.sets],circles:w,arcs:A,path:S,distinctPath:S+x(T.sets)}))}var lLe=function(){var t=C(function(b,x,w,A){for(w=w||{},A=b.length;A--;w[b[A]]=x);return w},"o"),e=[5,8],r=[7,8,11,12,17,19,22,24],n=[1,17],i=[1,18],a=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],s=[1,31],o=[1,39],l=[7,8,11,12,17,19,22,24,27],u=[1,57],h=[1,56],d=[1,58],f=[1,59],p=[1,60],g=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],m={trace:C(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:C(function(x,w,A,S,T,O,k){var E=O.length-1;switch(T){case 1:return O[E-1];case 2:case 3:case 4:this.$=[];break;case 5:O[E-1].push(O[E]),this.$=O[E-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=O[E];break;case 8:S.setDiagramTitle(O[E].substr(6)),this.$=O[E].substr(6);break;case 9:S.addSubsetData([O[E]],void 0,void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 10:S.addSubsetData([O[E-1]],O[E],void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 11:S.addSubsetData([O[E-2]],void 0,parseFloat(O[E])),S.setIndentMode&&S.setIndentMode(!0);break;case 12:S.addSubsetData([O[E-3]],O[E-2],parseFloat(O[E])),S.setIndentMode&&S.setIndentMode(!0);break;case 13:if(O[E].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(O[E]),S.addSubsetData(O[E],void 0,void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 14:if(O[E-1].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(O[E-1]),S.addSubsetData(O[E-1],O[E],void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 15:if(O[E-2].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(O[E-2]),S.addSubsetData(O[E-2],void 0,parseFloat(O[E])),S.setIndentMode&&S.setIndentMode(!0);break;case 16:if(O[E-3].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(O[E-3]),S.addSubsetData(O[E-3],O[E-2],parseFloat(O[E])),S.setIndentMode&&S.setIndentMode(!0);break;case 17:case 18:case 19:S.addTextData(O[E-1],O[E],void 0);break;case 20:case 21:S.addTextData(O[E-2],O[E-1],O[E]);break;case 23:S.addStyleData(O[E-1],O[E]);break;case 24:case 25:case 26:var _=S.getCurrentSets();if(!_)throw new Error("text requires set");S.addTextData(_,O[E],void 0);break;case 27:case 28:var _=S.getCurrentSets();if(!_)throw new Error("text requires set");S.addTextData(_,O[E-1],O[E]);break;case 29:case 41:this.$=[O[E]];break;case 30:case 42:this.$=[...O[E-2],O[E]];break;case 31:this.$=[O[E-2],O[E]];break;case 33:this.$=O[E].join(" ");break;case 34:this.$=[O[E]];break;case 35:O[E-1].push(O[E]),this.$=O[E-1];break;case 43:case 44:this.$=O[E];break}},"anonymous"),table:[t(e,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(r,[2,4],{6:5}),t(e,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(r,[2,5]),t(r,[2,6]),t(r,[2,7]),t(r,[2,8]),{13:16,20:n,21:i},{13:20,18:19,20:n,21:i},{13:20,18:21,20:n,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:n,21:i},t(r,[2,9],{14:[1,27],15:[1,28]}),t(a,[2,43]),t(a,[2,44]),t(r,[2,13],{14:[1,29],15:[1,30],27:s}),t(a,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:s},t(r,[2,22]),t(r,[2,24],{14:[1,35]}),t(r,[2,25],{14:[1,36]}),t(r,[2,26]),{20:o,25:37,26:38,27:s},t(r,[2,10],{15:[1,40]}),{16:[1,41]},t(r,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:n,21:i},t(r,[2,17],{14:[1,45]}),t(r,[2,18],{14:[1,46]}),t(r,[2,19]),t(r,[2,27]),t(r,[2,28]),t(r,[2,23],{27:[1,47]}),t(l,[2,29]),{15:[1,48]},{16:[1,49]},t(r,[2,11]),{16:[1,50]},t(r,[2,15]),t(a,[2,42]),t(r,[2,20]),t(r,[2,21]),{20:o,26:51},{16:u,20:h,21:[1,53],28:52,29:54,30:55,31:d,32:f,33:p},t(r,[2,12]),t(r,[2,16]),t(l,[2,30]),t(l,[2,31]),t(l,[2,32]),t(l,[2,33],{30:61,16:u,20:h,31:d,32:f,33:p}),t(g,[2,34]),t(g,[2,36]),t(g,[2,37]),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,35])],defaultActions:{6:[2,1]},parseError:C(function(x,w){if(w.recoverable)this.trace(x);else{var A=new Error(x);throw A.hash=w,A}},"parseError"),parse:C(function(x){var w=this,A=[0],S=[],T=[null],O=[],k=this.table,E="",_=0,I=0,L=2,R=1,D=O.slice.call(arguments,1),M=Object.create(this.lexer),P={yy:{}};for(var N in this.yy)Object.prototype.hasOwnProperty.call(this.yy,N)&&(P.yy[N]=this.yy[N]);M.setInput(x,P.yy),P.yy.lexer=M,P.yy.parser=this,typeof M.yylloc>"u"&&(M.yylloc={});var F=M.yylloc;O.push(F);var B=M.options&&M.options.ranges;typeof P.yy.parseError=="function"?this.parseError=P.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function V(ve){A.length=A.length-2*ve,T.length=T.length-ve,O.length=O.length-ve}C(V,"popStack");function z(){var ve;return ve=S.pop()||M.lex()||R,typeof ve!="number"&&(ve instanceof Array&&(S=ve,ve=S.pop()),ve=w.symbols_[ve]||ve),ve}C(z,"lex");for(var U,Q,G,X,Y={},le,q,Z,ee;;){if(Q=A[A.length-1],this.defaultActions[Q]?G=this.defaultActions[Q]:((U===null||typeof U>"u")&&(U=z()),G=k[Q]&&k[Q][U]),typeof G>"u"||!G.length||!G[0]){var re="";ee=[];for(le in k[Q])this.terminals_[le]&&le>L&&ee.push("'"+this.terminals_[le]+"'");M.showPosition?re="Parse error on line "+(_+1)+`: `+M.showPosition()+` -Expecting `+ee.join(", ")+", got '"+(this.terminals_[U]||U)+"'":re="Parse error on line "+(_+1)+": Unexpected "+(U==R?"end of input":"'"+(this.terminals_[U]||U)+"'"),this.parseError(re,{text:M.match,token:this.terminals_[U]||U,line:M.yylineno,loc:F,expected:ee})}if(G[0]instanceof Array&&G.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+U);switch(G[0]){case 1:A.push(U),S.push(M.yytext),O.push(M.yylloc),A.push(G[1]),U=null,I=M.yyleng,E=M.yytext,_=M.yylineno,F=M.yylloc;break;case 2:if(q=this.productions_[G[1]][1],Y.$=S[S.length-q],Y._$={first_line:O[O.length-(q||1)].first_line,last_line:O[O.length-1].last_line,first_column:O[O.length-(q||1)].first_column,last_column:O[O.length-1].last_column},B&&(Y._$.range=[O[O.length-(q||1)].range[0],O[O.length-1].range[1]]),X=this.performAction.apply(Y,[E,I,_,P.yy,G[1],S,O].concat(D)),typeof X<"u")return X;q&&(A=A.slice(0,-1*q*2),S=S.slice(0,-1*q),O=O.slice(0,-1*q)),A.push(this.productions_[G[1]][0]),S.push(Y.$),O.push(Y._$),Z=k[A[A.length-2]][A[A.length-1]],A.push(Z);break;case 3:return!0}}return!0},"parse")},v=function(){var b={EOF:1,parseError:C(function(w,A){if(this.yy.parser)this.yy.parser.parseError(w,A);else throw new Error(w)},"parseError"),setInput:C(function(x,w){return this.yy=w||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var w=x.match(/(?:\r\n?|\n).*/g);return w?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:C(function(x){var w=x.length,A=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-w),this.offset-=w;var T=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),A.length-1&&(this.yylineno-=A.length-1);var S=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:A?(A.length===T.length?this.yylloc.first_column:0)+T[T.length-A.length].length-A[0].length:this.yylloc.first_column-w},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-w]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +Expecting `+ee.join(", ")+", got '"+(this.terminals_[U]||U)+"'":re="Parse error on line "+(_+1)+": Unexpected "+(U==R?"end of input":"'"+(this.terminals_[U]||U)+"'"),this.parseError(re,{text:M.match,token:this.terminals_[U]||U,line:M.yylineno,loc:F,expected:ee})}if(G[0]instanceof Array&&G.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+U);switch(G[0]){case 1:A.push(U),T.push(M.yytext),O.push(M.yylloc),A.push(G[1]),U=null,I=M.yyleng,E=M.yytext,_=M.yylineno,F=M.yylloc;break;case 2:if(q=this.productions_[G[1]][1],Y.$=T[T.length-q],Y._$={first_line:O[O.length-(q||1)].first_line,last_line:O[O.length-1].last_line,first_column:O[O.length-(q||1)].first_column,last_column:O[O.length-1].last_column},B&&(Y._$.range=[O[O.length-(q||1)].range[0],O[O.length-1].range[1]]),X=this.performAction.apply(Y,[E,I,_,P.yy,G[1],T,O].concat(D)),typeof X<"u")return X;q&&(A=A.slice(0,-1*q*2),T=T.slice(0,-1*q),O=O.slice(0,-1*q)),A.push(this.productions_[G[1]][0]),T.push(Y.$),O.push(Y._$),Z=k[A[A.length-2]][A[A.length-1]],A.push(Z);break;case 3:return!0}}return!0},"parse")},v=function(){var b={EOF:1,parseError:C(function(w,A){if(this.yy.parser)this.yy.parser.parseError(w,A);else throw new Error(w)},"parseError"),setInput:C(function(x,w){return this.yy=w||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:C(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var w=x.match(/(?:\r\n?|\n).*/g);return w?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:C(function(x){var w=x.length,A=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-w),this.offset-=w;var S=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),A.length-1&&(this.yylineno-=A.length-1);var T=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:A?(A.length===S.length?this.yylloc.first_column:0)+S[S.length-A.length].length-A[0].length:this.yylloc.first_column-w},this.options.ranges&&(this.yylloc.range=[T[0],T[0]+this.yyleng-w]),this.yyleng=this.yytext.length,this},"unput"),more:C(function(){return this._more=!0,this},"more"),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:C(function(x){this.unput(this.match.slice(x))},"less"),pastInput:C(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:C(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:C(function(){var x=this.pastInput(),w=new Array(x.length+1).join("-");return x+this.upcomingInput()+` -`+w+"^"},"showPosition"),test_match:C(function(x,w){var A,T,S;if(this.options.backtrack_lexer&&(S={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(S.yylloc.range=this.yylloc.range.slice(0))),T=x[0].match(/(?:\r\n?|\n).*/g),T&&(this.yylineno+=T.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:T?T[T.length-1].length-T[T.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+x[0].length},this.yytext+=x[0],this.match+=x[0],this.matches=x,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(x[0].length),this.matched+=x[0],A=this.performAction.call(this,this.yy,this,w,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),A)return A;if(this._backtrack){for(var O in S)this[O]=S[O];return!1}return!1},"test_match"),next:C(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var x,w,A,T;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),O=0;Ow[0].length)){if(w=A,T=O,this.options.backtrack_lexer){if(x=this.test_match(A,S[O]),x!==!1)return x;if(this._backtrack){w=!1;continue}else return!1}else if(!this.options.flex)break}return w?(x=this.test_match(w,S[T]),x!==!1?x:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var w=this.next();return w||this.lex()},"lex"),begin:C(function(w){this.conditionStack.push(w)},"begin"),popState:C(function(){var w=this.conditionStack.length-1;return w>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(w){return w=this.conditionStack.length-1-Math.abs(w||0),w>=0?this.conditionStack[w]:"INITIAL"},"topState"),pushState:C(function(w){this.begin(w)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:C(function(w,A,T,S){switch(T){case 0:break;case 1:break;case 2:break;case 3:if(w.getIndentMode&&w.getIndentMode())return w.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:w.setIndentMode&&w.setIndentMode(!1),this.begin("INITIAL"),this.unput(A.yytext);break;case 6:return this.begin("bol"),8;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(w.consumeIndentText)w.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return A.yytext=A.yytext.slice(2,-2),14;case 17:return A.yytext=A.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return b}();m.lexer=v;function y(){this.yy={}}return C(y,"Parser"),y.prototype=m,m.Parser=y,new y}();lLe.parser=lLe;var YJn=lLe,cLe=[],uLe=[],hLe=[],dLe=new Set,fLe,pLe=!1,qJn=C((t,e,r)=>{const n=nie(t).sort(),i=r??10/Math.pow(t.length,2);fLe=n,n.length===1&&dLe.add(n[0]),cLe.push({sets:n,size:i,label:e?Bz(e):void 0})},"addSubsetData"),jJn=C(()=>cLe,"getSubsetData"),Bz=C(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),XJn=C(t=>t&&Bz(t),"normalizeStyleValue"),KJn=C((t,e,r)=>{const n=Bz(e);uLe.push({sets:nie(t).sort(),id:n,label:r?Bz(r):void 0})},"addTextData"),ZJn=C((t,e)=>{const r=nie(t).sort(),n={};for(const[i,a]of e)n[i]=XJn(a)??a;hLe.push({targets:r,styles:n})},"addStyleData"),JJn=C(()=>hLe,"getStyleData"),nie=C(t=>t.map(e=>Bz(e)),"normalizeIdentifierList"),eei=C(t=>{const r=nie(t).filter(n=>!dLe.has(n));if(r.length>0)throw new Error(`unknown set identifier: ${r.join(", ")}`)},"validateUnionIdentifiers"),tei=C(()=>uLe,"getTextData"),rei=C(()=>fLe,"getCurrentSets"),nei=C(()=>pLe,"getIndentMode"),iei=C(t=>{pLe=t},"setIndentMode"),aei=Xn.venn;function QKt(){return ns(aei,Dr().venn)}C(QKt,"getConfig");var sei=C(()=>{Aa(),cLe.length=0,uLe.length=0,hLe.length=0,dLe.clear(),fLe=void 0,pLe=!1},"customClear"),oei={getConfig:QKt,clear:sei,setAccTitle:Da,getAccTitle:Ja,setDiagramTitle:rs,getDiagramTitle:La,getAccDescription:ts,setAccDescription:es,addSubsetData:qJn,getSubsetData:jJn,addTextData:KJn,addStyleData:ZJn,validateUnionIdentifiers:eei,getTextData:tei,getStyleData:JJn,getCurrentSets:rei,getIndentMode:nei,setIndentMode:iei},lei=C(t=>` +`+w+"^"},"showPosition"),test_match:C(function(x,w){var A,S,T;if(this.options.backtrack_lexer&&(T={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(T.yylloc.range=this.yylloc.range.slice(0))),S=x[0].match(/(?:\r\n?|\n).*/g),S&&(this.yylineno+=S.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:S?S[S.length-1].length-S[S.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+x[0].length},this.yytext+=x[0],this.match+=x[0],this.matches=x,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(x[0].length),this.matched+=x[0],A=this.performAction.call(this,this.yy,this,w,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),A)return A;if(this._backtrack){for(var O in T)this[O]=T[O];return!1}return!1},"test_match"),next:C(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var x,w,A,S;this._more||(this.yytext="",this.match="");for(var T=this._currentRules(),O=0;Ow[0].length)){if(w=A,S=O,this.options.backtrack_lexer){if(x=this.test_match(A,T[O]),x!==!1)return x;if(this._backtrack){w=!1;continue}else return!1}else if(!this.options.flex)break}return w?(x=this.test_match(w,T[S]),x!==!1?x:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:C(function(){var w=this.next();return w||this.lex()},"lex"),begin:C(function(w){this.conditionStack.push(w)},"begin"),popState:C(function(){var w=this.conditionStack.length-1;return w>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:C(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:C(function(w){return w=this.conditionStack.length-1-Math.abs(w||0),w>=0?this.conditionStack[w]:"INITIAL"},"topState"),pushState:C(function(w){this.begin(w)},"pushState"),stateStackSize:C(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:C(function(w,A,S,T){switch(S){case 0:break;case 1:break;case 2:break;case 3:if(w.getIndentMode&&w.getIndentMode())return w.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:w.setIndentMode&&w.setIndentMode(!1),this.begin("INITIAL"),this.unput(A.yytext);break;case 6:return this.begin("bol"),8;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(w.consumeIndentText)w.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return A.yytext=A.yytext.slice(2,-2),14;case 17:return A.yytext=A.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return b}();m.lexer=v;function y(){this.yy={}}return C(y,"Parser"),y.prototype=m,m.Parser=y,new y}();lLe.parser=lLe;var YJn=lLe,cLe=[],uLe=[],hLe=[],dLe=new Set,fLe,pLe=!1,qJn=C((t,e,r)=>{const n=nie(t).sort(),i=r??10/Math.pow(t.length,2);fLe=n,n.length===1&&dLe.add(n[0]),cLe.push({sets:n,size:i,label:e?Bz(e):void 0})},"addSubsetData"),jJn=C(()=>cLe,"getSubsetData"),Bz=C(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),XJn=C(t=>t&&Bz(t),"normalizeStyleValue"),KJn=C((t,e,r)=>{const n=Bz(e);uLe.push({sets:nie(t).sort(),id:n,label:r?Bz(r):void 0})},"addTextData"),ZJn=C((t,e)=>{const r=nie(t).sort(),n={};for(const[i,a]of e)n[i]=XJn(a)??a;hLe.push({targets:r,styles:n})},"addStyleData"),JJn=C(()=>hLe,"getStyleData"),nie=C(t=>t.map(e=>Bz(e)),"normalizeIdentifierList"),eei=C(t=>{const r=nie(t).filter(n=>!dLe.has(n));if(r.length>0)throw new Error(`unknown set identifier: ${r.join(", ")}`)},"validateUnionIdentifiers"),tei=C(()=>uLe,"getTextData"),rei=C(()=>fLe,"getCurrentSets"),nei=C(()=>pLe,"getIndentMode"),iei=C(t=>{pLe=t},"setIndentMode"),aei=Xn.venn;function QKt(){return ns(aei,Dr().venn)}C(QKt,"getConfig");var sei=C(()=>{Aa(),cLe.length=0,uLe.length=0,hLe.length=0,dLe.clear(),fLe=void 0,pLe=!1},"customClear"),oei={getConfig:QKt,clear:sei,setAccTitle:Da,getAccTitle:Ja,setDiagramTitle:rs,getDiagramTitle:La,getAccDescription:ts,setAccDescription:es,addSubsetData:qJn,getSubsetData:jJn,addTextData:KJn,addStyleData:ZJn,validateUnionIdentifiers:eei,getTextData:tei,getStyleData:JJn,getCurrentSets:rei,getIndentMode:nei,setIndentMode:iei},lei=C(t=>` .venn-title { font-size: 32px; fill: ${t.vennTitleTextColor}; @@ -3715,7 +3715,7 @@ Expecting `+ee.join(", ")+", got '"+(this.terminals_[U]||U)+"'":re="Parse error font-family: ${t.fontFamily}; color: ${t.vennSetTextColor}; } -`,"getStyles"),cei=lei;function GKt(t){const e=new Map;for(const r of t){const n=r.targets.join("|"),i=e.get(n);i?Object.assign(i,r.styles):e.set(n,{...r.styles})}return e}C(GKt,"buildStyleByKey");var uei=C((t,e,r,n)=>{var D,M,P;const i=n.db,a=(D=i.getConfig)==null?void 0:D.call(i),{themeVariables:s,look:o,handDrawnSeed:l}=Dr(),u=o==="handDrawn",h=[s.venn1,s.venn2,s.venn3,s.venn4,s.venn5,s.venn6,s.venn7,s.venn8].filter(Boolean),d=(M=i.getDiagramTitle)==null?void 0:M.call(i),f=i.getSubsetData(),p=i.getTextData(),g=GKt(i.getStyleData()),m=WKt(f),v=(a==null?void 0:a.width)??800,y=(a==null?void 0:a.height)??450,x=v/1600,w=d?48*x:0,A=s.primaryTextColor??s.textColor,T=qc(e);T.attr("viewBox",`0 0 ${v} ${y}`),d&&T.append("text").text(d).attr("class","venn-title").attr("font-size",`${32*x}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*x).style("fill",s.vennTitleTextColor||s.titleColor);const S=Ot(document.createElement("div")),O=VJn().width(v).height(y-w);S.datum(m).call(O);const k=u?Er.svg(S.select("svg").node()):void 0,E=WJn(m,{width:v,height:y-w,padding:(a==null?void 0:a.padding)??15}),_=new Map;for(const N of E){const F=bw([...N.data.sets].sort());_.set(F,N)}p.length>0&&HKt(a,_,S,p,x,g);const I=Eu(s.background||"#f4f4f4");S.selectAll(".venn-circle").each(function(N,F){var q;const B=Ot(this),z=bw([...N.sets].sort()),U=g.get(z),Q=(U==null?void 0:U.fill)||h[F%h.length]||s.primaryColor;B.classed(`venn-set-${F%8}`,!0);const G=(U==null?void 0:U["fill-opacity"])??.1,X=(U==null?void 0:U.stroke)||Q,Y=(U==null?void 0:U["stroke-width"])||`${5*x}`;if(u&&k){const Z=_.get(z);if(Z&&Z.circles.length>0){const ee=Z.circles[0],re=k.circle(ee.x,ee.y,ee.radius*2,{roughness:.7,seed:l,fill:Gpt(Q,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+F*60,stroke:X,strokeWidth:parseFloat(String(Y))});B.select("path").remove(),(q=B.node())==null||q.insertBefore(re,B.select("text").node())}}else B.select("path").style("fill",Q).style("fill-opacity",G).style("stroke",X).style("stroke-width",Y).style("stroke-opacity",.95);const le=(U==null?void 0:U.color)||(I?ht(Q,30):dt(Q,30));B.select("text").style("font-size",`${48*x}px`).style("fill",le)}),u&&k?S.selectAll(".venn-intersection").each(function(N){var Q;const F=Ot(this),V=bw([...N.sets].sort()),z=g.get(V),U=z==null?void 0:z.fill;if(U){const G=F.select("path"),X=G.attr("d");if(X){const Y=k.path(X,{roughness:.7,seed:l,fill:Gpt(U,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),le=G.node();(Q=le==null?void 0:le.parentNode)==null||Q.insertBefore(Y,le),G.remove()}}else F.select("path").style("fill-opacity",0);F.select("text").style("font-size",`${48*x}px`).style("fill",(z==null?void 0:z.color)??s.vennSetTextColor??A)}):(S.selectAll(".venn-intersection text").style("font-size",`${48*x}px`).style("fill",N=>{var V;const B=bw([...N.sets].sort());return((V=g.get(B))==null?void 0:V.color)??s.vennSetTextColor??A}),S.selectAll(".venn-intersection path").style("fill-opacity",N=>{var V;const B=bw([...N.sets].sort());return(V=g.get(B))!=null&&V.fill?1:0}).style("fill",N=>{var V;const B=bw([...N.sets].sort());return((V=g.get(B))==null?void 0:V.fill)??"transparent"}));const L=T.append("g").attr("transform",`translate(0, ${w})`),R=S.select("svg").node();if(R&&"childNodes"in R)for(const N of[...R.childNodes])(P=L.node())==null||P.appendChild(N);zs(T,y,v,(a==null?void 0:a.useMaxWidth)??!0)},"draw");function bw(t){return t.join("|")}C(bw,"stableSetsKey");function HKt(t,e,r,n,i,a){var h;const s=(t==null?void 0:t.useDebugLayout)??!1,l=r.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const d of n){const f=bw(d.sets),p=u.get(f);p?p.push(d):u.set(f,[d])}for(const[d,f]of u.entries()){const p=e.get(d);if(!(p!=null&&p.text))continue;const g=p.text.x,m=p.text.y,v=Math.min(...p.circles.map(D=>D.radius)),y=Math.min(...p.circles.map(D=>D.radius-Math.hypot(g-D.x,m-D.y)));let b=Number.isFinite(y)?Math.max(0,y):0;b===0&&Number.isFinite(v)&&(b=v*.6);const x=l.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);s&&x.append("circle").attr("class","venn-text-debug-circle").attr("cx",g).attr("cy",m).attr("r",b).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const w=Math.max(80*i,b*2*.95),A=Math.max(60*i,b*2*.95),O=(p.data.label&&p.data.label.length>0?Math.min(32*i,b*.25):0)+(f.length<=2?30*i:0),k=g-w/2,E=m-A/2+O,_=Math.max(1,Math.ceil(Math.sqrt(f.length))),I=Math.max(1,Math.ceil(f.length/_)),L=w/_,R=A/I;for(const[D,M]of f.entries()){const P=D%_,N=Math.floor(D/_),F=k+L*(P+.5),B=E+R*(N+.5);s&&x.append("rect").attr("class","venn-text-debug-cell").attr("x",k+L*P).attr("y",E+R*N).attr("width",L).attr("height",R).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const V=L*.9,z=R*.9,U=x.append("foreignObject").attr("class","venn-text-node-fo").attr("width",V).attr("height",z).attr("x",F-V/2).attr("y",B-z/2).attr("overflow","visible"),Q=(h=a.get(M.id))==null?void 0:h.color,G=U.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(M.label??M.id);Q&&G.style("color",Q)}}}C(HKt,"renderTextNodes");function WKt(t){const e=new Set(t.map(i=>[...i.sets].sort().join("|"))),r=new Map(t.filter(i=>i.sets.length===1&&i.size!==void 0).map(i=>[i.sets[0],i.size])),n=[];for(const i of t){if(i.sets.length<3)continue;const a=[...i.sets].sort();for(let s=0;s0?[...t,...n]:t}C(WKt,"ensurePairwiseSubsets");var hei={draw:uei},dei={parser:YJn,db:oei,renderer:hei,styles:cei};const fei=Object.freeze(Object.defineProperty({__proto__:null,diagram:dei},Symbol.toStringTag,{value:"Module"}));var YKt=(GI=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=Da,this.getAccTitle=Ja,this.setDiagramTitle=rs,this.getDiagramTitle=La,this.getAccDescription=ts,this.setAccDescription=es}getNodes(){return this.nodes}getConfig(){const e=Xn,r=Dr();return ns({...e.treemap,...r.treemap??{}})}addNode(e,r){this.nodes.push(e),this.levels.set(e,r),r===0&&(this.outerNodes.push(e),this.root??(this.root=e))}getRoot(){return{name:"",children:this.outerNodes}}addClass(e,r){const n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},i=r.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");i&&i.forEach(a=>{B1e(a)&&(n!=null&&n.textStyles?n.textStyles.push(a):n.textStyles=[a]),n!=null&&n.styles?n.styles.push(a):n.styles=[a]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){var r;return((r=this.classes.get(e))==null?void 0:r.styles)??[]}clear(){Aa(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},C(GI,"TreeMapDB"),GI);function qKt(t){if(!t.length)return[];const e=[],r=[];return t.forEach(n=>{const i={name:n.name,children:n.type==="Leaf"?void 0:[]};for(i.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(i.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(i.value=n.value);r.length>0&&r[r.length-1].level>=n.level;)r.pop();if(r.length===0)e.push(i);else{const a=r[r.length-1].node;a.children?a.children.push(i):a.children=[i]}n.type!=="Leaf"&&r.push({node:i,level:n.level})}),e}C(qKt,"buildHierarchy");var pei=C((t,e)=>{qu(t,e);const r=[];for(const a of t.TreemapRows??[])a.$type==="ClassDefStatement"&&e.addClass(a.className??"",a.styleText??"");for(const a of t.TreemapRows??[]){const s=a.item;if(!s)continue;const o=a.indent?parseInt(a.indent):0,l=gei(s),u=s.classSelector?e.getStylesForClass(s.classSelector):[],h=u.length>0?u:void 0,d={level:o,name:l,type:s.$type,value:s.value,classSelector:s.classSelector,cssCompiledStyles:h};r.push(d)}const n=qKt(r),i=C((a,s)=>{for(const o of a)e.addNode(o,s),o.children&&o.children.length>0&&i(o.children,s+1)},"addNodesRecursively");i(n,0)},"populate"),gei=C(t=>t.name?String(t.name):"","getItemName"),jKt={parser:{yy:void 0},parse:C(async t=>{var e;try{const n=await Op("treemap",t);me.debug("Treemap AST:",n);const i=(e=jKt.parser)==null?void 0:e.yy;if(!(i instanceof YKt))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");pei(n,i)}catch(r){throw me.error("Error parsing treemap:",r),r}},"parse")},mei=10,lD=10,$z=25,vei=C((t,e,r,n)=>{const i=n.db,a=i.getConfig(),s=a.padding??mei,o=i.getDiagramTitle(),l=i.getRoot(),{themeVariables:u}=Dr();if(!l)return;const h=o?30:0,d=qc(e),f=a.nodeWidth?a.nodeWidth*lD:960,p=a.nodeHeight?a.nodeHeight*lD:500,g=f,m=p+h;d.attr("viewBox",`0 0 ${g} ${m}`),zs(d,m,g,a.useMaxWidth);let v;try{const z=a.valueFormat||",";if(z==="$0,0")v=C(U=>"$"+vS(",")(U),"valueFormat");else if(z.startsWith("$")&&z.includes(",")){const U=/\.\d+/.exec(z),Q=U?U[0]:"";v=C(G=>"$"+vS(","+Q)(G),"valueFormat")}else if(z.startsWith("$")){const U=z.substring(1);v=C(Q=>"$"+vS(U||"")(Q),"valueFormat")}else v=vS(z)}catch(z){me.error("Error creating format function:",z),v=vS(",")}const y=yS().range(["transparent",u.cScale0,u.cScale1,u.cScale2,u.cScale3,u.cScale4,u.cScale5,u.cScale6,u.cScale7,u.cScale8,u.cScale9,u.cScale10,u.cScale11]),b=yS().range(["transparent",u.cScalePeer0,u.cScalePeer1,u.cScalePeer2,u.cScalePeer3,u.cScalePeer4,u.cScalePeer5,u.cScalePeer6,u.cScalePeer7,u.cScalePeer8,u.cScalePeer9,u.cScalePeer10,u.cScalePeer11]),x=yS().range([u.cScaleLabel0,u.cScaleLabel1,u.cScaleLabel2,u.cScaleLabel3,u.cScaleLabel4,u.cScaleLabel5,u.cScaleLabel6,u.cScaleLabel7,u.cScaleLabel8,u.cScaleLabel9,u.cScaleLabel10,u.cScaleLabel11]);o&&d.append("text").attr("x",g/2).attr("y",h/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(o);const w=d.append("g").attr("transform",`translate(0, ${h})`).attr("class","treemapContainer"),A=Kye(l).sum(z=>z.value??0).sort((z,U)=>(U.value??0)-(z.value??0)),S=yKr().size([f,p]).paddingTop(z=>z.children&&z.children.length>0?$z+lD:0).paddingInner(s).paddingLeft(z=>z.children&&z.children.length>0?lD:0).paddingRight(z=>z.children&&z.children.length>0?lD:0).paddingBottom(z=>z.children&&z.children.length>0?lD:0).round(!0)(A),O=S.descendants().filter(z=>z.children&&z.children.length>0),k=w.selectAll(".treemapSection").data(O).enter().append("g").attr("class","treemapSection").attr("transform",z=>`translate(${z.x0},${z.y0})`);k.append("rect").attr("width",z=>z.x1-z.x0).attr("height",$z).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",z=>z.depth===0?"display: none;":""),k.append("clipPath").attr("id",(z,U)=>`clip-section-${e}-${U}`).append("rect").attr("width",z=>Math.max(0,z.x1-z.x0-12)).attr("height",$z),k.append("rect").attr("width",z=>z.x1-z.x0).attr("height",z=>z.y1-z.y0).attr("class",(z,U)=>`treemapSection section${U}`).attr("fill",z=>y(z.data.name)).attr("fill-opacity",.6).attr("stroke",z=>b(z.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",z=>{if(z.depth===0)return"display: none;";const U=Or({cssCompiledStyles:z.data.cssCompiledStyles});return U.nodeStyles+";"+U.borderStyles.join(";")}),k.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",$z/2).attr("dominant-baseline","middle").text(z=>z.depth===0?"":z.data.name).attr("font-weight","bold").attr("clip-path",(z,U)=>`url(#clip-section-${e}-${U})`).attr("style",z=>{if(z.depth===0)return"display: none;";const U="dominant-baseline: middle; font-size: 12px; fill:"+x(z.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",Q=Or({cssCompiledStyles:z.data.cssCompiledStyles});return U+Q.labelStyles.replace("color:","fill:")}).each(function(z){if(z.depth===0)return;const U=Ot(this),Q=z.data.name;U.text(Q);const G=z.x1-z.x0,X=6;let Y;a.showValues!==!1&&z.value?Y=G-10-30-10-X:Y=G-X-6;const q=Math.max(15,Y),Z=U.node();if(Z.getComputedTextLength()>q){const re="...";let ve=Q;for(;ve.length>0;){if(ve=Q.substring(0,ve.length-1),ve.length===0){U.text(re),Z.getComputedTextLength()>q&&U.text("");break}if(U.text(ve+re),Z.getComputedTextLength()<=q)break}}}),a.showValues!==!1&&k.append("text").attr("class","treemapSectionValue").attr("x",z=>z.x1-z.x0-10).attr("y",$z/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(z=>z.value?v(z.value):"").attr("font-style","italic").attr("style",z=>{if(z.depth===0)return"display: none;";const U="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+x(z.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",Q=Or({cssCompiledStyles:z.data.cssCompiledStyles});return U+Q.labelStyles.replace("color:","fill:")});const E=S.leaves(),_=E.length>20,I=_?16:38,L=_?14:28,R=_?4:8,D=_?4:6,M=_?2:4,P=_?8:10,N=_?1:2,F=w.selectAll(".treemapLeafGroup").data(E).enter().append("g").attr("class",(z,U)=>`treemapNode treemapLeafGroup leaf${U}${z.data.classSelector?` ${z.data.classSelector}`:""}x`).attr("transform",z=>`translate(${z.x0},${z.y0})`);F.append("rect").attr("width",z=>z.x1-z.x0).attr("height",z=>z.y1-z.y0).attr("class","treemapLeaf").attr("fill",z=>z.parent?y(z.parent.data.name):y(z.data.name)).attr("style",z=>Or({cssCompiledStyles:z.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",z=>z.parent?y(z.parent.data.name):y(z.data.name)).attr("stroke-width",3),F.append("clipPath").attr("id",(z,U)=>`clip-${e}-${U}`).append("rect").attr("width",z=>Math.max(0,z.x1-z.x0-4)).attr("height",z=>Math.max(0,z.y1-z.y0-4)),F.append("text").attr("class","treemapLabel").attr("x",z=>(z.x1-z.x0)/2).attr("y",z=>(z.y1-z.y0)/2).attr("style",z=>{const U=`text-anchor: middle; dominant-baseline: middle; font-size: ${I}px;fill:`+x(z.data.name)+";",Q=Or({cssCompiledStyles:z.data.cssCompiledStyles});return U+Q.labelStyles.replace("color:","fill:")}).attr("clip-path",(z,U)=>`url(#clip-${e}-${U})`).text(z=>z.data.name).each(function(z){const U=Ot(this),Q=z.x1-z.x0,G=z.y1-z.y0,X=U.node(),Y=Q-2*M,le=G-2*M;if(YY&&q>R;)q--,U.style("font-size",`${q}px`);let ee=Math.max(D,Math.min(L,Math.round(q*Z))),re=q+N+ee;for(;re>le&&q>R&&(q--,ee=Math.max(D,Math.min(L,Math.round(q*Z))),!(eeY||q(U.x1-U.x0)/2).attr("y",function(U){return(U.y1-U.y0)/2}).attr("style",U=>{const Q=`text-anchor: middle; dominant-baseline: hanging; font-size: ${L}px;fill:`+x(U.data.name)+";",G=Or({cssCompiledStyles:U.data.cssCompiledStyles});return Q+G.labelStyles.replace("color:","fill:")}).attr("clip-path",(U,Q)=>`url(#clip-${e}-${Q})`).text(U=>U.value?v(U.value):"").each(function(U){const Q=Ot(this),G=this.parentNode;if(!G){Q.style("display","none");return}const X=Ot(G).select(".treemapLabel");if(X.empty()||X.style("display")==="none"){Q.style("display","none");return}const Y=parseFloat(X.style("font-size")),q=Math.max(D,Math.min(L,Math.round(Y*.6)));Q.style("font-size",`${q}px`);const ee=(U.y1-U.y0)/2+Y/2+N;Q.attr("y",ee);const re=U.x1-U.x0,Ce=U.y1-U.y0-4,Oe=re-2*M;Q.node().getComputedTextLength()>Oe||ee+q>Ce||q{const e=ky(),r=Dr(),n=ns(e,r.themeVariables),i=ns(xei,t),a=i.titleColor??n.titleColor,s=i.labelColor??n.textColor,o=i.valueColor??n.textColor;return` +`,"getStyles"),cei=lei;function GKt(t){const e=new Map;for(const r of t){const n=r.targets.join("|"),i=e.get(n);i?Object.assign(i,r.styles):e.set(n,{...r.styles})}return e}C(GKt,"buildStyleByKey");var uei=C((t,e,r,n)=>{var D,M,P;const i=n.db,a=(D=i.getConfig)==null?void 0:D.call(i),{themeVariables:s,look:o,handDrawnSeed:l}=Dr(),u=o==="handDrawn",h=[s.venn1,s.venn2,s.venn3,s.venn4,s.venn5,s.venn6,s.venn7,s.venn8].filter(Boolean),d=(M=i.getDiagramTitle)==null?void 0:M.call(i),f=i.getSubsetData(),p=i.getTextData(),g=GKt(i.getStyleData()),m=WKt(f),v=(a==null?void 0:a.width)??800,y=(a==null?void 0:a.height)??450,x=v/1600,w=d?48*x:0,A=s.primaryTextColor??s.textColor,S=qc(e);S.attr("viewBox",`0 0 ${v} ${y}`),d&&S.append("text").text(d).attr("class","venn-title").attr("font-size",`${32*x}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*x).style("fill",s.vennTitleTextColor||s.titleColor);const T=Ot(document.createElement("div")),O=VJn().width(v).height(y-w);T.datum(m).call(O);const k=u?Er.svg(T.select("svg").node()):void 0,E=WJn(m,{width:v,height:y-w,padding:(a==null?void 0:a.padding)??15}),_=new Map;for(const N of E){const F=bw([...N.data.sets].sort());_.set(F,N)}p.length>0&&HKt(a,_,T,p,x,g);const I=Eu(s.background||"#f4f4f4");T.selectAll(".venn-circle").each(function(N,F){var q;const B=Ot(this),z=bw([...N.sets].sort()),U=g.get(z),Q=(U==null?void 0:U.fill)||h[F%h.length]||s.primaryColor;B.classed(`venn-set-${F%8}`,!0);const G=(U==null?void 0:U["fill-opacity"])??.1,X=(U==null?void 0:U.stroke)||Q,Y=(U==null?void 0:U["stroke-width"])||`${5*x}`;if(u&&k){const Z=_.get(z);if(Z&&Z.circles.length>0){const ee=Z.circles[0],re=k.circle(ee.x,ee.y,ee.radius*2,{roughness:.7,seed:l,fill:Gpt(Q,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+F*60,stroke:X,strokeWidth:parseFloat(String(Y))});B.select("path").remove(),(q=B.node())==null||q.insertBefore(re,B.select("text").node())}}else B.select("path").style("fill",Q).style("fill-opacity",G).style("stroke",X).style("stroke-width",Y).style("stroke-opacity",.95);const le=(U==null?void 0:U.color)||(I?ht(Q,30):dt(Q,30));B.select("text").style("font-size",`${48*x}px`).style("fill",le)}),u&&k?T.selectAll(".venn-intersection").each(function(N){var Q;const F=Ot(this),V=bw([...N.sets].sort()),z=g.get(V),U=z==null?void 0:z.fill;if(U){const G=F.select("path"),X=G.attr("d");if(X){const Y=k.path(X,{roughness:.7,seed:l,fill:Gpt(U,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),le=G.node();(Q=le==null?void 0:le.parentNode)==null||Q.insertBefore(Y,le),G.remove()}}else F.select("path").style("fill-opacity",0);F.select("text").style("font-size",`${48*x}px`).style("fill",(z==null?void 0:z.color)??s.vennSetTextColor??A)}):(T.selectAll(".venn-intersection text").style("font-size",`${48*x}px`).style("fill",N=>{var V;const B=bw([...N.sets].sort());return((V=g.get(B))==null?void 0:V.color)??s.vennSetTextColor??A}),T.selectAll(".venn-intersection path").style("fill-opacity",N=>{var V;const B=bw([...N.sets].sort());return(V=g.get(B))!=null&&V.fill?1:0}).style("fill",N=>{var V;const B=bw([...N.sets].sort());return((V=g.get(B))==null?void 0:V.fill)??"transparent"}));const L=S.append("g").attr("transform",`translate(0, ${w})`),R=T.select("svg").node();if(R&&"childNodes"in R)for(const N of[...R.childNodes])(P=L.node())==null||P.appendChild(N);zs(S,y,v,(a==null?void 0:a.useMaxWidth)??!0)},"draw");function bw(t){return t.join("|")}C(bw,"stableSetsKey");function HKt(t,e,r,n,i,a){var h;const s=(t==null?void 0:t.useDebugLayout)??!1,l=r.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const d of n){const f=bw(d.sets),p=u.get(f);p?p.push(d):u.set(f,[d])}for(const[d,f]of u.entries()){const p=e.get(d);if(!(p!=null&&p.text))continue;const g=p.text.x,m=p.text.y,v=Math.min(...p.circles.map(D=>D.radius)),y=Math.min(...p.circles.map(D=>D.radius-Math.hypot(g-D.x,m-D.y)));let b=Number.isFinite(y)?Math.max(0,y):0;b===0&&Number.isFinite(v)&&(b=v*.6);const x=l.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);s&&x.append("circle").attr("class","venn-text-debug-circle").attr("cx",g).attr("cy",m).attr("r",b).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const w=Math.max(80*i,b*2*.95),A=Math.max(60*i,b*2*.95),O=(p.data.label&&p.data.label.length>0?Math.min(32*i,b*.25):0)+(f.length<=2?30*i:0),k=g-w/2,E=m-A/2+O,_=Math.max(1,Math.ceil(Math.sqrt(f.length))),I=Math.max(1,Math.ceil(f.length/_)),L=w/_,R=A/I;for(const[D,M]of f.entries()){const P=D%_,N=Math.floor(D/_),F=k+L*(P+.5),B=E+R*(N+.5);s&&x.append("rect").attr("class","venn-text-debug-cell").attr("x",k+L*P).attr("y",E+R*N).attr("width",L).attr("height",R).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const V=L*.9,z=R*.9,U=x.append("foreignObject").attr("class","venn-text-node-fo").attr("width",V).attr("height",z).attr("x",F-V/2).attr("y",B-z/2).attr("overflow","visible"),Q=(h=a.get(M.id))==null?void 0:h.color,G=U.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(M.label??M.id);Q&&G.style("color",Q)}}}C(HKt,"renderTextNodes");function WKt(t){const e=new Set(t.map(i=>[...i.sets].sort().join("|"))),r=new Map(t.filter(i=>i.sets.length===1&&i.size!==void 0).map(i=>[i.sets[0],i.size])),n=[];for(const i of t){if(i.sets.length<3)continue;const a=[...i.sets].sort();for(let s=0;s0?[...t,...n]:t}C(WKt,"ensurePairwiseSubsets");var hei={draw:uei},dei={parser:YJn,db:oei,renderer:hei,styles:cei};const fei=Object.freeze(Object.defineProperty({__proto__:null,diagram:dei},Symbol.toStringTag,{value:"Module"}));var YKt=(GI=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=Da,this.getAccTitle=Ja,this.setDiagramTitle=rs,this.getDiagramTitle=La,this.getAccDescription=ts,this.setAccDescription=es}getNodes(){return this.nodes}getConfig(){const e=Xn,r=Dr();return ns({...e.treemap,...r.treemap??{}})}addNode(e,r){this.nodes.push(e),this.levels.set(e,r),r===0&&(this.outerNodes.push(e),this.root??(this.root=e))}getRoot(){return{name:"",children:this.outerNodes}}addClass(e,r){const n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},i=r.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");i&&i.forEach(a=>{B1e(a)&&(n!=null&&n.textStyles?n.textStyles.push(a):n.textStyles=[a]),n!=null&&n.styles?n.styles.push(a):n.styles=[a]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){var r;return((r=this.classes.get(e))==null?void 0:r.styles)??[]}clear(){Aa(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},C(GI,"TreeMapDB"),GI);function qKt(t){if(!t.length)return[];const e=[],r=[];return t.forEach(n=>{const i={name:n.name,children:n.type==="Leaf"?void 0:[]};for(i.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(i.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(i.value=n.value);r.length>0&&r[r.length-1].level>=n.level;)r.pop();if(r.length===0)e.push(i);else{const a=r[r.length-1].node;a.children?a.children.push(i):a.children=[i]}n.type!=="Leaf"&&r.push({node:i,level:n.level})}),e}C(qKt,"buildHierarchy");var pei=C((t,e)=>{qu(t,e);const r=[];for(const a of t.TreemapRows??[])a.$type==="ClassDefStatement"&&e.addClass(a.className??"",a.styleText??"");for(const a of t.TreemapRows??[]){const s=a.item;if(!s)continue;const o=a.indent?parseInt(a.indent):0,l=gei(s),u=s.classSelector?e.getStylesForClass(s.classSelector):[],h=u.length>0?u:void 0,d={level:o,name:l,type:s.$type,value:s.value,classSelector:s.classSelector,cssCompiledStyles:h};r.push(d)}const n=qKt(r),i=C((a,s)=>{for(const o of a)e.addNode(o,s),o.children&&o.children.length>0&&i(o.children,s+1)},"addNodesRecursively");i(n,0)},"populate"),gei=C(t=>t.name?String(t.name):"","getItemName"),jKt={parser:{yy:void 0},parse:C(async t=>{var e;try{const n=await Op("treemap",t);me.debug("Treemap AST:",n);const i=(e=jKt.parser)==null?void 0:e.yy;if(!(i instanceof YKt))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");pei(n,i)}catch(r){throw me.error("Error parsing treemap:",r),r}},"parse")},mei=10,lD=10,$z=25,vei=C((t,e,r,n)=>{const i=n.db,a=i.getConfig(),s=a.padding??mei,o=i.getDiagramTitle(),l=i.getRoot(),{themeVariables:u}=Dr();if(!l)return;const h=o?30:0,d=qc(e),f=a.nodeWidth?a.nodeWidth*lD:960,p=a.nodeHeight?a.nodeHeight*lD:500,g=f,m=p+h;d.attr("viewBox",`0 0 ${g} ${m}`),zs(d,m,g,a.useMaxWidth);let v;try{const z=a.valueFormat||",";if(z==="$0,0")v=C(U=>"$"+vT(",")(U),"valueFormat");else if(z.startsWith("$")&&z.includes(",")){const U=/\.\d+/.exec(z),Q=U?U[0]:"";v=C(G=>"$"+vT(","+Q)(G),"valueFormat")}else if(z.startsWith("$")){const U=z.substring(1);v=C(Q=>"$"+vT(U||"")(Q),"valueFormat")}else v=vT(z)}catch(z){me.error("Error creating format function:",z),v=vT(",")}const y=yT().range(["transparent",u.cScale0,u.cScale1,u.cScale2,u.cScale3,u.cScale4,u.cScale5,u.cScale6,u.cScale7,u.cScale8,u.cScale9,u.cScale10,u.cScale11]),b=yT().range(["transparent",u.cScalePeer0,u.cScalePeer1,u.cScalePeer2,u.cScalePeer3,u.cScalePeer4,u.cScalePeer5,u.cScalePeer6,u.cScalePeer7,u.cScalePeer8,u.cScalePeer9,u.cScalePeer10,u.cScalePeer11]),x=yT().range([u.cScaleLabel0,u.cScaleLabel1,u.cScaleLabel2,u.cScaleLabel3,u.cScaleLabel4,u.cScaleLabel5,u.cScaleLabel6,u.cScaleLabel7,u.cScaleLabel8,u.cScaleLabel9,u.cScaleLabel10,u.cScaleLabel11]);o&&d.append("text").attr("x",g/2).attr("y",h/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(o);const w=d.append("g").attr("transform",`translate(0, ${h})`).attr("class","treemapContainer"),A=Kye(l).sum(z=>z.value??0).sort((z,U)=>(U.value??0)-(z.value??0)),T=yKr().size([f,p]).paddingTop(z=>z.children&&z.children.length>0?$z+lD:0).paddingInner(s).paddingLeft(z=>z.children&&z.children.length>0?lD:0).paddingRight(z=>z.children&&z.children.length>0?lD:0).paddingBottom(z=>z.children&&z.children.length>0?lD:0).round(!0)(A),O=T.descendants().filter(z=>z.children&&z.children.length>0),k=w.selectAll(".treemapSection").data(O).enter().append("g").attr("class","treemapSection").attr("transform",z=>`translate(${z.x0},${z.y0})`);k.append("rect").attr("width",z=>z.x1-z.x0).attr("height",$z).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",z=>z.depth===0?"display: none;":""),k.append("clipPath").attr("id",(z,U)=>`clip-section-${e}-${U}`).append("rect").attr("width",z=>Math.max(0,z.x1-z.x0-12)).attr("height",$z),k.append("rect").attr("width",z=>z.x1-z.x0).attr("height",z=>z.y1-z.y0).attr("class",(z,U)=>`treemapSection section${U}`).attr("fill",z=>y(z.data.name)).attr("fill-opacity",.6).attr("stroke",z=>b(z.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",z=>{if(z.depth===0)return"display: none;";const U=Or({cssCompiledStyles:z.data.cssCompiledStyles});return U.nodeStyles+";"+U.borderStyles.join(";")}),k.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",$z/2).attr("dominant-baseline","middle").text(z=>z.depth===0?"":z.data.name).attr("font-weight","bold").attr("clip-path",(z,U)=>`url(#clip-section-${e}-${U})`).attr("style",z=>{if(z.depth===0)return"display: none;";const U="dominant-baseline: middle; font-size: 12px; fill:"+x(z.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",Q=Or({cssCompiledStyles:z.data.cssCompiledStyles});return U+Q.labelStyles.replace("color:","fill:")}).each(function(z){if(z.depth===0)return;const U=Ot(this),Q=z.data.name;U.text(Q);const G=z.x1-z.x0,X=6;let Y;a.showValues!==!1&&z.value?Y=G-10-30-10-X:Y=G-X-6;const q=Math.max(15,Y),Z=U.node();if(Z.getComputedTextLength()>q){const re="...";let ve=Q;for(;ve.length>0;){if(ve=Q.substring(0,ve.length-1),ve.length===0){U.text(re),Z.getComputedTextLength()>q&&U.text("");break}if(U.text(ve+re),Z.getComputedTextLength()<=q)break}}}),a.showValues!==!1&&k.append("text").attr("class","treemapSectionValue").attr("x",z=>z.x1-z.x0-10).attr("y",$z/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(z=>z.value?v(z.value):"").attr("font-style","italic").attr("style",z=>{if(z.depth===0)return"display: none;";const U="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+x(z.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",Q=Or({cssCompiledStyles:z.data.cssCompiledStyles});return U+Q.labelStyles.replace("color:","fill:")});const E=T.leaves(),_=E.length>20,I=_?16:38,L=_?14:28,R=_?4:8,D=_?4:6,M=_?2:4,P=_?8:10,N=_?1:2,F=w.selectAll(".treemapLeafGroup").data(E).enter().append("g").attr("class",(z,U)=>`treemapNode treemapLeafGroup leaf${U}${z.data.classSelector?` ${z.data.classSelector}`:""}x`).attr("transform",z=>`translate(${z.x0},${z.y0})`);F.append("rect").attr("width",z=>z.x1-z.x0).attr("height",z=>z.y1-z.y0).attr("class","treemapLeaf").attr("fill",z=>z.parent?y(z.parent.data.name):y(z.data.name)).attr("style",z=>Or({cssCompiledStyles:z.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",z=>z.parent?y(z.parent.data.name):y(z.data.name)).attr("stroke-width",3),F.append("clipPath").attr("id",(z,U)=>`clip-${e}-${U}`).append("rect").attr("width",z=>Math.max(0,z.x1-z.x0-4)).attr("height",z=>Math.max(0,z.y1-z.y0-4)),F.append("text").attr("class","treemapLabel").attr("x",z=>(z.x1-z.x0)/2).attr("y",z=>(z.y1-z.y0)/2).attr("style",z=>{const U=`text-anchor: middle; dominant-baseline: middle; font-size: ${I}px;fill:`+x(z.data.name)+";",Q=Or({cssCompiledStyles:z.data.cssCompiledStyles});return U+Q.labelStyles.replace("color:","fill:")}).attr("clip-path",(z,U)=>`url(#clip-${e}-${U})`).text(z=>z.data.name).each(function(z){const U=Ot(this),Q=z.x1-z.x0,G=z.y1-z.y0,X=U.node(),Y=Q-2*M,le=G-2*M;if(YY&&q>R;)q--,U.style("font-size",`${q}px`);let ee=Math.max(D,Math.min(L,Math.round(q*Z))),re=q+N+ee;for(;re>le&&q>R&&(q--,ee=Math.max(D,Math.min(L,Math.round(q*Z))),!(eeY||q(U.x1-U.x0)/2).attr("y",function(U){return(U.y1-U.y0)/2}).attr("style",U=>{const Q=`text-anchor: middle; dominant-baseline: hanging; font-size: ${L}px;fill:`+x(U.data.name)+";",G=Or({cssCompiledStyles:U.data.cssCompiledStyles});return Q+G.labelStyles.replace("color:","fill:")}).attr("clip-path",(U,Q)=>`url(#clip-${e}-${Q})`).text(U=>U.value?v(U.value):"").each(function(U){const Q=Ot(this),G=this.parentNode;if(!G){Q.style("display","none");return}const X=Ot(G).select(".treemapLabel");if(X.empty()||X.style("display")==="none"){Q.style("display","none");return}const Y=parseFloat(X.style("font-size")),q=Math.max(D,Math.min(L,Math.round(Y*.6)));Q.style("font-size",`${q}px`);const ee=(U.y1-U.y0)/2+Y/2+N;Q.attr("y",ee);const re=U.x1-U.x0,Ce=U.y1-U.y0-4,Oe=re-2*M;Q.node().getComputedTextLength()>Oe||ee+q>Ce||q{const e=ky(),r=Dr(),n=ns(e,r.themeVariables),i=ns(xei,t),a=i.titleColor??n.titleColor,s=i.labelColor??n.textColor,o=i.valueColor??n.textColor;return` .treemapNode.section { stroke: ${i.sectionStrokeColor}; stroke-width: ${i.sectionStrokeWidth}; @@ -3738,8 +3738,8 @@ Expecting `+ee.join(", ")+", got '"+(this.terminals_[U]||U)+"'":re="Parse error fill: ${a}; font-size: ${i.titleFontSize}; } - `},"getStyles"),Aei=wei,Tei={parser:jKt,get db(){return new YKt},renderer:bei,styles:Aei};const Sei=Object.freeze(Object.defineProperty({__proto__:null,diagram:Tei},Symbol.toStringTag,{value:"Module"}));var iie=C((t,e)=>{const r=t<=1?t*100:t;if(r<0||r>100)throw new Error(`${e} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${t}`);return r},"toPercent"),qO=C((t,e,r)=>({x:iie(e,`${r} evolution`),y:iie(t,`${r} visibility`)}),"toCoordinates"),XKt=C(t=>{if(t){if(t==="+<>")return"bidirectional";if(t==="+<")return"backward";if(t==="+>")return"forward"}},"getFlowFromPort"),Cei=C(t=>{if(!(t!=null&&t.startsWith("+")))return{};const e=/^\+'([^']*)'/.exec(t),r=e==null?void 0:e[1];return t.includes("<>")?{flow:"bidirectional",label:r}:t.includes("<")?{flow:"backward",label:r}:t.includes(">")?{flow:"forward",label:r}:{label:r}},"extractFlowFromArrow"),Oei=C((t,e)=>{if(qu(t,e),t.size&&e.setSize(t.size.width,t.size.height),t.evolution){const r=t.evolution.stages.map(i=>i.secondName?`${i.name.trim()} / ${i.secondName.trim()}`:i.name.trim()),n=t.evolution.stages.filter(i=>i.boundary!==void 0).map(i=>i.boundary);e.updateAxes({stages:r,stageBoundaries:n})}if(t.anchors.forEach(r=>{const n=qO(r.visibility,r.evolution,`Anchor "${r.name}"`);e.addNode(r.name,r.name,n.x,n.y,"anchor")}),t.components.forEach(r=>{var o;const n=qO(r.visibility,r.evolution,`Component "${r.name}"`),i=r.label?(r.label.negX?-1:1)*r.label.offsetX:void 0,a=r.label?(r.label.negY?-1:1)*r.label.offsetY:void 0,s=(o=r.decorator)==null?void 0:o.strategy;e.addNode(r.name,r.name,n.x,n.y,"component",i,a,r.inertia,s)}),t.notes.forEach(r=>{const n=qO(r.visibility,r.evolution,`Note "${r.text}"`);e.addNote(r.text,n.x,n.y)}),t.pipelines.forEach(r=>{const n=e.getNode(r.parent);if(!n||typeof n.y!="number")throw new Error(`Pipeline "${r.parent}" must reference an existing component with coordinates.`);const i=n.y;e.startPipeline(r.parent),r.components.forEach(a=>{const s=`${r.parent}_${a.name}`,o=a.label?(a.label.negX?-1:1)*a.label.offsetX:void 0,l=a.label?(a.label.negY?-1:1)*a.label.offsetY:void 0,u=iie(a.evolution,`Pipeline component "${a.name}" evolution`);e.addNode(s,a.name,u,i,"pipeline-component",o,l),e.addPipelineComponent(r.parent,s)})}),t.links.forEach(r=>{const n=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-."));let i=XKt(r.fromPort)??XKt(r.toPort);const{flow:a,label:s}=Cei(r.arrow);!i&&a&&(i=a);const o=r.linkLabel,l=s??o;e.addLink(e.resolveNodeId(r.from),e.resolveNodeId(r.to),n,l,i)}),t.evolves.forEach(r=>{const n=e.getNode(r.component);if((n==null?void 0:n.y)!==void 0){const i=iie(r.target,`Evolve target for "${r.component}"`);e.addTrend(r.component,i,n.y)}}),t.annotations.length>0){const r=t.annotations[0],n=qO(r.x,r.y,"Annotations box");e.setAnnotationsBox(n.x,n.y)}t.annotation.forEach(r=>{const n=qO(r.x,r.y,`Annotation ${r.number}`);e.addAnnotation(r.number,[{x:n.x,y:n.y}],r.text)}),t.accelerators.forEach(r=>{const n=qO(r.x,r.y,`Accelerator "${r.name}"`);e.addAccelerator(r.name,n.x,n.y)}),t.deaccelerators.forEach(r=>{const n=qO(r.x,r.y,`Deaccelerator "${r.name}"`);e.addDeaccelerator(r.name,n.x,n.y)})},"populateDb"),KKt={parser:{yy:void 0},parse:C(async t=>{var n;const e=await Op("wardley",t);me.debug(e);const r=(n=KKt.parser)==null?void 0:n.yy;if(!r||typeof r.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Oei(e,r)},"parse")},kei=(HI=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(e){const r=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...r,...e,className:e.className??r.className,labelOffsetX:e.labelOffsetX??r.labelOffsetX,labelOffsetY:e.labelOffsetY??r.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});const r=this.nodes.get(e);r&&(r.isPipelineParent=!0)}addPipelineComponent(e,r){const n=this.pipelines.get(e);n&&n.componentIds.push(r);const i=this.nodes.get(r);i&&(i.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,r){this.annotationsBox={x:e,y:r}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,r){this.size={width:e,height:r}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(const[r,n]of this.nodes)if(n.label===e)return r;return e}build(){const e=[];for(const r of this.nodes.values()){if(typeof r.x!="number"||typeof r.y!="number")throw new Error(`Node "${r.label}" is missing coordinates`);e.push(r)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},C(HI,"WardleyBuilder"),HI),ou=new kei;function ZKt(){return He()["wardley-beta"]}C(ZKt,"getConfig");function JKt(t,e,r,n,i,a,s,o,l){ou.addNode({id:t,label:e,x:r,y:n,className:i,labelOffsetX:a,labelOffsetY:s,inertia:o,sourceStrategy:l})}C(JKt,"addNode");function eZt(t,e,r=!1,n,i){ou.addLink({source:t,target:e,dashed:r,label:n,flow:i})}C(eZt,"addLink");function tZt(t,e,r){ou.addTrend({nodeId:t,targetX:e,targetY:r})}C(tZt,"addTrend");function rZt(t,e,r){ou.addAnnotation({number:t,coordinates:e,text:r})}C(rZt,"addAnnotation");function nZt(t,e,r){ou.addNote({text:t,x:e,y:r})}C(nZt,"addNote");function iZt(t,e,r){ou.addAccelerator({name:t,x:e,y:r})}C(iZt,"addAccelerator");function aZt(t,e,r){ou.addDeaccelerator({name:t,x:e,y:r})}C(aZt,"addDeaccelerator");function sZt(t,e){ou.setAnnotationsBox(t,e)}C(sZt,"setAnnotationsBox");function oZt(t,e){ou.setSize(t,e)}C(oZt,"setSize");function lZt(t){ou.startPipeline(t)}C(lZt,"startPipeline");function cZt(t,e){ou.addPipelineComponent(t,e)}C(cZt,"addPipelineComponent");function uZt(t){ou.setAxes(t)}C(uZt,"updateAxes");function hZt(t){return ou.getNode(t)}C(hZt,"getNode");function dZt(t){return ou.resolveNodeId(t)}C(dZt,"resolveNodeId");function fZt(){return ou.build()}C(fZt,"getWardleyData");function pZt(){ou.clear(),Aa()}C(pZt,"clear");var Eei={getConfig:ZKt,addNode:JKt,addLink:eZt,addTrend:tZt,addAnnotation:rZt,addNote:nZt,addAccelerator:iZt,addDeaccelerator:aZt,setAnnotationsBox:sZt,setSize:oZt,startPipeline:lZt,addPipelineComponent:cZt,updateAxes:uZt,getNode:hZt,resolveNodeId:dZt,getWardleyData:fZt,clear:pZt,setAccTitle:Da,getAccTitle:Ja,setDiagramTitle:rs,getDiagramTitle:La,getAccDescription:ts,setAccDescription:es},_ei=["Genesis","Custom Built","Product","Commodity"],Rei=C(()=>{var e,r,n,i,a,s,o,l,u,h,d,f;const{themeVariables:t}=He();return{backgroundColor:((e=t.wardley)==null?void 0:e.backgroundColor)??t.background??"#fff",axisColor:((r=t.wardley)==null?void 0:r.axisColor)??"#000",axisTextColor:((n=t.wardley)==null?void 0:n.axisTextColor)??t.primaryTextColor??"#222",gridColor:((i=t.wardley)==null?void 0:i.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((a=t.wardley)==null?void 0:a.componentFill)??"#fff",componentStroke:((s=t.wardley)==null?void 0:s.componentStroke)??"#000",componentLabelColor:((o=t.wardley)==null?void 0:o.componentLabelColor)??t.primaryTextColor??"#222",linkStroke:((l=t.wardley)==null?void 0:l.linkStroke)??"#000",evolutionStroke:((u=t.wardley)==null?void 0:u.evolutionStroke)??"#dc3545",annotationStroke:((h=t.wardley)==null?void 0:h.annotationStroke)??"#000",annotationTextColor:((d=t.wardley)==null?void 0:d.annotationTextColor)??t.primaryTextColor??"#222",annotationFill:((f=t.wardley)==null?void 0:f.annotationFill)??t.background??"#fff"}},"getTheme"),Dei=C(()=>{const t=He()["wardley-beta"];return{width:(t==null?void 0:t.width)??900,height:(t==null?void 0:t.height)??600,padding:(t==null?void 0:t.padding)??48,nodeRadius:(t==null?void 0:t.nodeRadius)??6,nodeLabelOffset:(t==null?void 0:t.nodeLabelOffset)??8,axisFontSize:(t==null?void 0:t.axisFontSize)??12,labelFontSize:(t==null?void 0:t.labelFontSize)??10,showGrid:(t==null?void 0:t.showGrid)??!1,useMaxWidth:(t==null?void 0:t.useMaxWidth)??!0}},"getConfigValues"),Lei=C((t,e,r,n)=>{var N,F;me.debug(`Rendering Wardley map -`+t);const i=Dei(),a=Rei(),s=i.nodeRadius*1.6,o=n.db,l=o.getWardleyData(),u=o.getDiagramTitle(),h=((N=l.size)==null?void 0:N.width)??i.width,d=((F=l.size)==null?void 0:F.height)??i.height,f=qc(e);f.selectAll("*").remove(),zs(f,d,h,i.useMaxWidth),f.attr("viewBox",`0 0 ${h} ${d}`);const p=f.append("g").attr("class","wardley-map"),g=f.append("defs");g.append("marker").attr("id",`arrow-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",a.evolutionStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-end-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",a.linkStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-start-${e}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",a.linkStroke).attr("stroke","none"),p.append("rect").attr("class","wardley-background").attr("width",h).attr("height",d).attr("fill",a.backgroundColor);const m=h-i.padding*2,v=d-i.padding*2;u&&p.append("text").attr("class","wardley-title").attr("x",h/2).attr("y",i.padding/2).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(u);const y=C(B=>i.padding+B/100*m,"projectX"),b=C(B=>d-i.padding-B/100*v,"projectY"),x=p.append("g").attr("class","wardley-axes");x.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding).attr("y2",d-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1),x.append("line").attr("x1",i.padding).attr("x2",i.padding).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1);const w=l.axes.xLabel??"Evolution",A=l.axes.yLabel??"Visibility";x.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",i.padding+m/2).attr("y",d-i.padding/4).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(w),x.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",i.padding/3).attr("y",i.padding+v/2).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${i.padding/3} ${i.padding+v/2})`).text(A);const T=l.axes.stages&&l.axes.stages.length>0?l.axes.stages:_ei;if(T.length>0){const B=p.append("g").attr("class","wardley-stages"),V=l.axes.stageBoundaries,z=[];if(V&&V.length===T.length){let U=0;V.forEach(Q=>{z.push({start:U,end:Q}),U=Q})}else{const U=1/T.length;T.forEach((Q,G)=>{z.push({start:G*U,end:(G+1)*U})})}T.forEach((U,Q)=>{const G=z[Q],X=i.padding+G.start*m,Y=i.padding+G.end*m,le=(X+Y)/2;Q>0&&B.append("line").attr("x1",X).attr("x2",X).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),B.append("text").attr("class","wardley-stage-label").attr("x",le).attr("y",d-i.padding/1.5).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize-2).attr("text-anchor","middle").text(U)})}if(i.showGrid){const B=p.append("g").attr("class","wardley-grid");for(let V=1;V<4;V++){const z=V/4,U=i.padding+m*z;B.append("line").attr("x1",U).attr("x2",U).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6"),B.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding-v*z).attr("y2",d-i.padding-v*z).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6")}}const S=new Map;if(l.nodes.forEach(B=>{S.set(B.id,{x:y(B.x),y:b(B.y),node:B})}),l.pipelines.length>0){const B=p.append("g").attr("class","wardley-pipelines"),V=p.append("g").attr("class","wardley-pipeline-links");l.pipelines.forEach(z=>{if(z.componentIds.length===0)return;const U=z.componentIds.map(Y=>({id:Y,pos:S.get(Y),node:l.nodes.find(le=>le.id===Y)})).filter(Y=>Y.pos&&Y.node).sort((Y,le)=>Y.node.x-le.node.x);for(let Y=0;Y{const le=S.get(Y);le&&(Q=Math.min(Q,le.x),G=Math.max(G,le.x),X=le.y)}),Q!==1/0&&G!==-1/0){const le=i.nodeRadius*4,q=X-le/2,Z=S.get(z.nodeId);if(Z){const ee=(Q+G)/2;Z.x=ee,Z.y=q-s/6}B.append("rect").attr("class","wardley-pipeline-box").attr("x",Q-15).attr("y",q).attr("width",G-Q+15*2).attr("height",le).attr("fill","none").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const O=p.append("g").attr("class","wardley-links"),k=new Map;l.pipelines.forEach(B=>{k.set(B.nodeId,new Set(B.componentIds))});const E=l.links.filter(B=>{if(!S.has(B.source)||!S.has(B.target))return!1;const V=k.get(B.target);return!(V!=null&&V.has(B.source))});O.selectAll("line").data(E).enter().append("line").attr("class",B=>`wardley-link${B.dashed?" wardley-link--dashed":""}`).attr("x1",B=>{const V=S.get(B.source),z=S.get(B.target),Q=l.nodes.find(le=>le.id===B.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,G=z.x-V.x,X=z.y-V.y,Y=Math.sqrt(G*G+X*X);return V.x+G/Y*Q}).attr("y1",B=>{const V=S.get(B.source),z=S.get(B.target),Q=l.nodes.find(le=>le.id===B.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,G=z.x-V.x,X=z.y-V.y,Y=Math.sqrt(G*G+X*X);return V.y+X/Y*Q}).attr("x2",B=>{const V=S.get(B.source),z=S.get(B.target),Q=l.nodes.find(le=>le.id===B.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,G=V.x-z.x,X=V.y-z.y,Y=Math.sqrt(G*G+X*X);return z.x+G/Y*Q}).attr("y2",B=>{const V=S.get(B.source),z=S.get(B.target),Q=l.nodes.find(le=>le.id===B.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,G=V.x-z.x,X=V.y-z.y,Y=Math.sqrt(G*G+X*X);return z.y+X/Y*Q}).attr("stroke",a.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",B=>B.dashed?"6 6":null).attr("marker-end",B=>B.flow==="forward"||B.flow==="bidirectional"?`url(#link-arrow-end-${e})`:null).attr("marker-start",B=>B.flow==="backward"||B.flow==="bidirectional"?`url(#link-arrow-start-${e})`:null),O.selectAll("text").data(E.filter(B=>B.label)).enter().append("text").attr("class","wardley-link-label").attr("x",B=>{const V=S.get(B.source),z=S.get(B.target),U=(V.x+z.x)/2,Q=z.y-V.y,G=z.x-V.x,X=Math.sqrt(G*G+Q*Q),Y=8,le=Q/X;return U+le*Y}).attr("y",B=>{const V=S.get(B.source),z=S.get(B.target),U=(V.y+z.y)/2,Q=z.x-V.x,G=z.y-V.y,X=Math.sqrt(Q*Q+G*G),Y=8,le=-Q/X;return U+le*Y}).attr("fill",a.axisTextColor).attr("font-size",i.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",B=>{const V=S.get(B.source),z=S.get(B.target),U=(V.x+z.x)/2,Q=(V.y+z.y)/2,G=z.x-V.x,X=z.y-V.y,Y=Math.sqrt(G*G+X*X),le=8,q=X/Y,Z=-G/Y,ee=U+q*le,re=Q+Z*le;let ve=Math.atan2(X,G)*180/Math.PI;return(ve>90||ve<-90)&&(ve+=180),`rotate(${ve} ${ee} ${re})`}).text(B=>B.label);const _=p.append("g").attr("class","wardley-trends"),I=l.trends.map(B=>{const V=S.get(B.nodeId);if(!V)return null;const z=y(B.targetX),U=b(B.targetY),Q=z-V.x,G=U-V.y,X=Math.sqrt(Q*Q+G*G),Y=i.nodeRadius+2,le=X>Y?z-Q/X*Y:z,q=X>Y?U-G/X*Y:U;return{origin:V,targetX:z,targetY:U,adjustedX2:le,adjustedY2:q}}).filter(B=>B!==null);_.selectAll("line").data(I).enter().append("line").attr("class","wardley-trend").attr("x1",B=>B.origin.x).attr("y1",B=>B.origin.y).attr("x2",B=>B.adjustedX2).attr("y2",B=>B.adjustedY2).attr("stroke",a.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${e})`);const R=p.append("g").attr("class","wardley-nodes").selectAll("g").data(l.nodes).enter().append("g").attr("class",B=>["wardley-node",B.className?`wardley-node--${B.className}`:""].filter(Boolean).join(" "));R.filter(B=>B.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",B=>S.get(B.id).x).attr("cy",B=>S.get(B.id).y).attr("r",i.nodeRadius*2).attr("fill","#666").attr("stroke",a.componentStroke).attr("stroke-width",1),R.filter(B=>B.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",B=>S.get(B.id).x).attr("cy",B=>S.get(B.id).y).attr("r",i.nodeRadius*2).attr("fill","#ccc").attr("stroke",a.componentStroke).attr("stroke-width",1),R.filter(B=>B.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",B=>S.get(B.id).x).attr("cy",B=>S.get(B.id).y).attr("r",i.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const D=R.filter(B=>B.sourceStrategy==="market");D.append("circle").attr("class","wardley-market-overlay").attr("cx",B=>S.get(B.id).x).attr("cy",B=>S.get(B.id).y).attr("r",i.nodeRadius*2).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),R.filter(B=>!B.isPipelineParent&&B.sourceStrategy!=="market"&&B.className!=="anchor").append("circle").attr("cx",B=>S.get(B.id).x).attr("cy",B=>S.get(B.id).y).attr("r",i.nodeRadius).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1);const M=i.nodeRadius*.7,P=i.nodeRadius*1.2;if(D.append("line").attr("class","wardley-market-line").attr("x1",B=>S.get(B.id).x).attr("y1",B=>S.get(B.id).y-P).attr("x2",B=>S.get(B.id).x-P*Math.cos(Math.PI/6)).attr("y2",B=>S.get(B.id).y+P*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),D.append("line").attr("class","wardley-market-line").attr("x1",B=>S.get(B.id).x-P*Math.cos(Math.PI/6)).attr("y1",B=>S.get(B.id).y+P*Math.sin(Math.PI/6)).attr("x2",B=>S.get(B.id).x+P*Math.cos(Math.PI/6)).attr("y2",B=>S.get(B.id).y+P*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),D.append("line").attr("class","wardley-market-line").attr("x1",B=>S.get(B.id).x+P*Math.cos(Math.PI/6)).attr("y1",B=>S.get(B.id).y+P*Math.sin(Math.PI/6)).attr("x2",B=>S.get(B.id).x).attr("y2",B=>S.get(B.id).y-P).attr("stroke",a.componentStroke).attr("stroke-width",1),D.append("circle").attr("class","wardley-market-dot").attr("cx",B=>S.get(B.id).x).attr("cy",B=>S.get(B.id).y-P).attr("r",M).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),D.append("circle").attr("class","wardley-market-dot").attr("cx",B=>S.get(B.id).x-P*Math.cos(Math.PI/6)).attr("cy",B=>S.get(B.id).y+P*Math.sin(Math.PI/6)).attr("r",M).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),D.append("circle").attr("class","wardley-market-dot").attr("cx",B=>S.get(B.id).x+P*Math.cos(Math.PI/6)).attr("cy",B=>S.get(B.id).y+P*Math.sin(Math.PI/6)).attr("r",M).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),R.filter(B=>B.isPipelineParent===!0).append("rect").attr("x",B=>S.get(B.id).x-s/2).attr("y",B=>S.get(B.id).y-s/2).attr("width",s).attr("height",s).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1),R.filter(B=>B.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",B=>{const V=S.get(B.id);let z=B.isPipelineParent?s/2+15:i.nodeRadius+15;return B.sourceStrategy&&(z+=i.nodeRadius+10),V.x+z}).attr("y1",B=>{const V=S.get(B.id),z=B.isPipelineParent?s:i.nodeRadius*2;return V.y-z/2}).attr("x2",B=>{const V=S.get(B.id);let z=B.isPipelineParent?s/2+15:i.nodeRadius+15;return B.sourceStrategy&&(z+=i.nodeRadius+10),V.x+z}).attr("y2",B=>{const V=S.get(B.id),z=B.isPipelineParent?s:i.nodeRadius*2;return V.y+z/2}).attr("stroke",a.componentStroke).attr("stroke-width",6),R.append("text").attr("x",B=>{const V=S.get(B.id);if(B.className==="anchor")return B.labelOffsetX!==void 0?V.x+B.labelOffsetX:V.x;let z=i.nodeLabelOffset;B.sourceStrategy&&B.labelOffsetX===void 0&&(z+=10);const U=B.labelOffsetX??z;return V.x+U}).attr("y",B=>{const V=S.get(B.id);if(B.className==="anchor")return B.labelOffsetY!==void 0?V.y+B.labelOffsetY:V.y-3;let z=-i.nodeLabelOffset;B.sourceStrategy&&B.labelOffsetY===void 0&&(z-=10);const U=B.labelOffsetY??z;return V.y+U}).attr("class","wardley-node-label").attr("fill",B=>B.className==="evolved"?a.evolutionStroke:B.className==="anchor"?"#000":a.componentLabelColor).attr("font-size",i.labelFontSize).attr("font-weight",B=>B.className==="anchor"?"bold":"normal").attr("text-anchor",B=>B.className==="anchor"?"middle":"start").attr("dominant-baseline",B=>B.className==="anchor"?"middle":"auto").text(B=>B.label),l.annotations.length>0){const B=p.append("g").attr("class","wardley-annotations");if(l.annotations.forEach(V=>{const z=V.coordinates.map(U=>({x:y(U.x),y:b(U.y)}));if(z.length>1)for(let U=0;U{const Q=B.append("g").attr("class","wardley-annotation");Q.append("circle").attr("cx",U.x).attr("cy",U.y).attr("r",10).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5),Q.append("text").attr("x",U.x).attr("y",U.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(V.number)})}),l.annotationsBox){let V=y(l.annotationsBox.x),z=b(l.annotationsBox.y);const U=10,Q=16,G=11,X=B.append("g").attr("class","wardley-annotations-box"),Y=[...l.annotations].filter(q=>q.text).sort((q,Z)=>q.number-Z.number),le=[];if(Y.forEach((q,Z)=>{const ee=X.append("text").attr("x",V+U).attr("y",z+U+(Z+1)*Q).attr("font-size",G).attr("fill",a.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${q.number}. ${q.text}`);le.push(ee)}),le.length>0){let q=0,Z=0;le.forEach($e=>{const he=$e.node(),fe=he.getComputedTextLength();q=Math.max(q,fe);const Te=he.getBBox();Z=Math.max(Z,Te.height)});const ee=q+U*2+105,re=Y.length*Q+U*2+Z/2,ve=i.padding,ae=h-i.padding-ee,Ce=i.padding,Oe=d-i.padding-re;V=Math.max(ve,Math.min(V,ae)),z=Math.max(Ce,Math.min(z,Oe)),le.forEach(($e,he)=>{$e.attr("x",V+U).attr("y",z+U+(he+1)*Q)}),X.insert("rect","text").attr("x",V).attr("y",z).attr("width",ee).attr("height",re).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(l.notes.length>0){const B=p.append("g").attr("class","wardley-notes");l.notes.forEach(V=>{const z=y(V.x),U=b(V.y);B.append("text").attr("x",z).attr("y",U).attr("text-anchor","start").attr("font-size",11).attr("fill",a.axisTextColor).attr("font-weight","bold").text(V.text)})}if(l.accelerators.length>0){const B=p.append("g").attr("class","wardley-accelerators");l.accelerators.forEach(V=>{const z=y(V.x),U=b(V.y),Q=60,G=30,X=20,Y=` + `},"getStyles"),Aei=wei,Sei={parser:jKt,get db(){return new YKt},renderer:bei,styles:Aei};const Tei=Object.freeze(Object.defineProperty({__proto__:null,diagram:Sei},Symbol.toStringTag,{value:"Module"}));var iie=C((t,e)=>{const r=t<=1?t*100:t;if(r<0||r>100)throw new Error(`${e} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${t}`);return r},"toPercent"),qO=C((t,e,r)=>({x:iie(e,`${r} evolution`),y:iie(t,`${r} visibility`)}),"toCoordinates"),XKt=C(t=>{if(t){if(t==="+<>")return"bidirectional";if(t==="+<")return"backward";if(t==="+>")return"forward"}},"getFlowFromPort"),Cei=C(t=>{if(!(t!=null&&t.startsWith("+")))return{};const e=/^\+'([^']*)'/.exec(t),r=e==null?void 0:e[1];return t.includes("<>")?{flow:"bidirectional",label:r}:t.includes("<")?{flow:"backward",label:r}:t.includes(">")?{flow:"forward",label:r}:{label:r}},"extractFlowFromArrow"),Oei=C((t,e)=>{if(qu(t,e),t.size&&e.setSize(t.size.width,t.size.height),t.evolution){const r=t.evolution.stages.map(i=>i.secondName?`${i.name.trim()} / ${i.secondName.trim()}`:i.name.trim()),n=t.evolution.stages.filter(i=>i.boundary!==void 0).map(i=>i.boundary);e.updateAxes({stages:r,stageBoundaries:n})}if(t.anchors.forEach(r=>{const n=qO(r.visibility,r.evolution,`Anchor "${r.name}"`);e.addNode(r.name,r.name,n.x,n.y,"anchor")}),t.components.forEach(r=>{var o;const n=qO(r.visibility,r.evolution,`Component "${r.name}"`),i=r.label?(r.label.negX?-1:1)*r.label.offsetX:void 0,a=r.label?(r.label.negY?-1:1)*r.label.offsetY:void 0,s=(o=r.decorator)==null?void 0:o.strategy;e.addNode(r.name,r.name,n.x,n.y,"component",i,a,r.inertia,s)}),t.notes.forEach(r=>{const n=qO(r.visibility,r.evolution,`Note "${r.text}"`);e.addNote(r.text,n.x,n.y)}),t.pipelines.forEach(r=>{const n=e.getNode(r.parent);if(!n||typeof n.y!="number")throw new Error(`Pipeline "${r.parent}" must reference an existing component with coordinates.`);const i=n.y;e.startPipeline(r.parent),r.components.forEach(a=>{const s=`${r.parent}_${a.name}`,o=a.label?(a.label.negX?-1:1)*a.label.offsetX:void 0,l=a.label?(a.label.negY?-1:1)*a.label.offsetY:void 0,u=iie(a.evolution,`Pipeline component "${a.name}" evolution`);e.addNode(s,a.name,u,i,"pipeline-component",o,l),e.addPipelineComponent(r.parent,s)})}),t.links.forEach(r=>{const n=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-."));let i=XKt(r.fromPort)??XKt(r.toPort);const{flow:a,label:s}=Cei(r.arrow);!i&&a&&(i=a);const o=r.linkLabel,l=s??o;e.addLink(e.resolveNodeId(r.from),e.resolveNodeId(r.to),n,l,i)}),t.evolves.forEach(r=>{const n=e.getNode(r.component);if((n==null?void 0:n.y)!==void 0){const i=iie(r.target,`Evolve target for "${r.component}"`);e.addTrend(r.component,i,n.y)}}),t.annotations.length>0){const r=t.annotations[0],n=qO(r.x,r.y,"Annotations box");e.setAnnotationsBox(n.x,n.y)}t.annotation.forEach(r=>{const n=qO(r.x,r.y,`Annotation ${r.number}`);e.addAnnotation(r.number,[{x:n.x,y:n.y}],r.text)}),t.accelerators.forEach(r=>{const n=qO(r.x,r.y,`Accelerator "${r.name}"`);e.addAccelerator(r.name,n.x,n.y)}),t.deaccelerators.forEach(r=>{const n=qO(r.x,r.y,`Deaccelerator "${r.name}"`);e.addDeaccelerator(r.name,n.x,n.y)})},"populateDb"),KKt={parser:{yy:void 0},parse:C(async t=>{var n;const e=await Op("wardley",t);me.debug(e);const r=(n=KKt.parser)==null?void 0:n.yy;if(!r||typeof r.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Oei(e,r)},"parse")},kei=(HI=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(e){const r=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...r,...e,className:e.className??r.className,labelOffsetX:e.labelOffsetX??r.labelOffsetX,labelOffsetY:e.labelOffsetY??r.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});const r=this.nodes.get(e);r&&(r.isPipelineParent=!0)}addPipelineComponent(e,r){const n=this.pipelines.get(e);n&&n.componentIds.push(r);const i=this.nodes.get(r);i&&(i.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,r){this.annotationsBox={x:e,y:r}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,r){this.size={width:e,height:r}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(const[r,n]of this.nodes)if(n.label===e)return r;return e}build(){const e=[];for(const r of this.nodes.values()){if(typeof r.x!="number"||typeof r.y!="number")throw new Error(`Node "${r.label}" is missing coordinates`);e.push(r)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},C(HI,"WardleyBuilder"),HI),ou=new kei;function ZKt(){return He()["wardley-beta"]}C(ZKt,"getConfig");function JKt(t,e,r,n,i,a,s,o,l){ou.addNode({id:t,label:e,x:r,y:n,className:i,labelOffsetX:a,labelOffsetY:s,inertia:o,sourceStrategy:l})}C(JKt,"addNode");function eZt(t,e,r=!1,n,i){ou.addLink({source:t,target:e,dashed:r,label:n,flow:i})}C(eZt,"addLink");function tZt(t,e,r){ou.addTrend({nodeId:t,targetX:e,targetY:r})}C(tZt,"addTrend");function rZt(t,e,r){ou.addAnnotation({number:t,coordinates:e,text:r})}C(rZt,"addAnnotation");function nZt(t,e,r){ou.addNote({text:t,x:e,y:r})}C(nZt,"addNote");function iZt(t,e,r){ou.addAccelerator({name:t,x:e,y:r})}C(iZt,"addAccelerator");function aZt(t,e,r){ou.addDeaccelerator({name:t,x:e,y:r})}C(aZt,"addDeaccelerator");function sZt(t,e){ou.setAnnotationsBox(t,e)}C(sZt,"setAnnotationsBox");function oZt(t,e){ou.setSize(t,e)}C(oZt,"setSize");function lZt(t){ou.startPipeline(t)}C(lZt,"startPipeline");function cZt(t,e){ou.addPipelineComponent(t,e)}C(cZt,"addPipelineComponent");function uZt(t){ou.setAxes(t)}C(uZt,"updateAxes");function hZt(t){return ou.getNode(t)}C(hZt,"getNode");function dZt(t){return ou.resolveNodeId(t)}C(dZt,"resolveNodeId");function fZt(){return ou.build()}C(fZt,"getWardleyData");function pZt(){ou.clear(),Aa()}C(pZt,"clear");var Eei={getConfig:ZKt,addNode:JKt,addLink:eZt,addTrend:tZt,addAnnotation:rZt,addNote:nZt,addAccelerator:iZt,addDeaccelerator:aZt,setAnnotationsBox:sZt,setSize:oZt,startPipeline:lZt,addPipelineComponent:cZt,updateAxes:uZt,getNode:hZt,resolveNodeId:dZt,getWardleyData:fZt,clear:pZt,setAccTitle:Da,getAccTitle:Ja,setDiagramTitle:rs,getDiagramTitle:La,getAccDescription:ts,setAccDescription:es},_ei=["Genesis","Custom Built","Product","Commodity"],Rei=C(()=>{var e,r,n,i,a,s,o,l,u,h,d,f;const{themeVariables:t}=He();return{backgroundColor:((e=t.wardley)==null?void 0:e.backgroundColor)??t.background??"#fff",axisColor:((r=t.wardley)==null?void 0:r.axisColor)??"#000",axisTextColor:((n=t.wardley)==null?void 0:n.axisTextColor)??t.primaryTextColor??"#222",gridColor:((i=t.wardley)==null?void 0:i.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((a=t.wardley)==null?void 0:a.componentFill)??"#fff",componentStroke:((s=t.wardley)==null?void 0:s.componentStroke)??"#000",componentLabelColor:((o=t.wardley)==null?void 0:o.componentLabelColor)??t.primaryTextColor??"#222",linkStroke:((l=t.wardley)==null?void 0:l.linkStroke)??"#000",evolutionStroke:((u=t.wardley)==null?void 0:u.evolutionStroke)??"#dc3545",annotationStroke:((h=t.wardley)==null?void 0:h.annotationStroke)??"#000",annotationTextColor:((d=t.wardley)==null?void 0:d.annotationTextColor)??t.primaryTextColor??"#222",annotationFill:((f=t.wardley)==null?void 0:f.annotationFill)??t.background??"#fff"}},"getTheme"),Dei=C(()=>{const t=He()["wardley-beta"];return{width:(t==null?void 0:t.width)??900,height:(t==null?void 0:t.height)??600,padding:(t==null?void 0:t.padding)??48,nodeRadius:(t==null?void 0:t.nodeRadius)??6,nodeLabelOffset:(t==null?void 0:t.nodeLabelOffset)??8,axisFontSize:(t==null?void 0:t.axisFontSize)??12,labelFontSize:(t==null?void 0:t.labelFontSize)??10,showGrid:(t==null?void 0:t.showGrid)??!1,useMaxWidth:(t==null?void 0:t.useMaxWidth)??!0}},"getConfigValues"),Lei=C((t,e,r,n)=>{var N,F;me.debug(`Rendering Wardley map +`+t);const i=Dei(),a=Rei(),s=i.nodeRadius*1.6,o=n.db,l=o.getWardleyData(),u=o.getDiagramTitle(),h=((N=l.size)==null?void 0:N.width)??i.width,d=((F=l.size)==null?void 0:F.height)??i.height,f=qc(e);f.selectAll("*").remove(),zs(f,d,h,i.useMaxWidth),f.attr("viewBox",`0 0 ${h} ${d}`);const p=f.append("g").attr("class","wardley-map"),g=f.append("defs");g.append("marker").attr("id",`arrow-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",a.evolutionStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-end-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",a.linkStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-start-${e}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",a.linkStroke).attr("stroke","none"),p.append("rect").attr("class","wardley-background").attr("width",h).attr("height",d).attr("fill",a.backgroundColor);const m=h-i.padding*2,v=d-i.padding*2;u&&p.append("text").attr("class","wardley-title").attr("x",h/2).attr("y",i.padding/2).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(u);const y=C(B=>i.padding+B/100*m,"projectX"),b=C(B=>d-i.padding-B/100*v,"projectY"),x=p.append("g").attr("class","wardley-axes");x.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding).attr("y2",d-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1),x.append("line").attr("x1",i.padding).attr("x2",i.padding).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1);const w=l.axes.xLabel??"Evolution",A=l.axes.yLabel??"Visibility";x.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",i.padding+m/2).attr("y",d-i.padding/4).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(w),x.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",i.padding/3).attr("y",i.padding+v/2).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${i.padding/3} ${i.padding+v/2})`).text(A);const S=l.axes.stages&&l.axes.stages.length>0?l.axes.stages:_ei;if(S.length>0){const B=p.append("g").attr("class","wardley-stages"),V=l.axes.stageBoundaries,z=[];if(V&&V.length===S.length){let U=0;V.forEach(Q=>{z.push({start:U,end:Q}),U=Q})}else{const U=1/S.length;S.forEach((Q,G)=>{z.push({start:G*U,end:(G+1)*U})})}S.forEach((U,Q)=>{const G=z[Q],X=i.padding+G.start*m,Y=i.padding+G.end*m,le=(X+Y)/2;Q>0&&B.append("line").attr("x1",X).attr("x2",X).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),B.append("text").attr("class","wardley-stage-label").attr("x",le).attr("y",d-i.padding/1.5).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize-2).attr("text-anchor","middle").text(U)})}if(i.showGrid){const B=p.append("g").attr("class","wardley-grid");for(let V=1;V<4;V++){const z=V/4,U=i.padding+m*z;B.append("line").attr("x1",U).attr("x2",U).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6"),B.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding-v*z).attr("y2",d-i.padding-v*z).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6")}}const T=new Map;if(l.nodes.forEach(B=>{T.set(B.id,{x:y(B.x),y:b(B.y),node:B})}),l.pipelines.length>0){const B=p.append("g").attr("class","wardley-pipelines"),V=p.append("g").attr("class","wardley-pipeline-links");l.pipelines.forEach(z=>{if(z.componentIds.length===0)return;const U=z.componentIds.map(Y=>({id:Y,pos:T.get(Y),node:l.nodes.find(le=>le.id===Y)})).filter(Y=>Y.pos&&Y.node).sort((Y,le)=>Y.node.x-le.node.x);for(let Y=0;Y{const le=T.get(Y);le&&(Q=Math.min(Q,le.x),G=Math.max(G,le.x),X=le.y)}),Q!==1/0&&G!==-1/0){const le=i.nodeRadius*4,q=X-le/2,Z=T.get(z.nodeId);if(Z){const ee=(Q+G)/2;Z.x=ee,Z.y=q-s/6}B.append("rect").attr("class","wardley-pipeline-box").attr("x",Q-15).attr("y",q).attr("width",G-Q+15*2).attr("height",le).attr("fill","none").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const O=p.append("g").attr("class","wardley-links"),k=new Map;l.pipelines.forEach(B=>{k.set(B.nodeId,new Set(B.componentIds))});const E=l.links.filter(B=>{if(!T.has(B.source)||!T.has(B.target))return!1;const V=k.get(B.target);return!(V!=null&&V.has(B.source))});O.selectAll("line").data(E).enter().append("line").attr("class",B=>`wardley-link${B.dashed?" wardley-link--dashed":""}`).attr("x1",B=>{const V=T.get(B.source),z=T.get(B.target),Q=l.nodes.find(le=>le.id===B.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,G=z.x-V.x,X=z.y-V.y,Y=Math.sqrt(G*G+X*X);return V.x+G/Y*Q}).attr("y1",B=>{const V=T.get(B.source),z=T.get(B.target),Q=l.nodes.find(le=>le.id===B.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,G=z.x-V.x,X=z.y-V.y,Y=Math.sqrt(G*G+X*X);return V.y+X/Y*Q}).attr("x2",B=>{const V=T.get(B.source),z=T.get(B.target),Q=l.nodes.find(le=>le.id===B.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,G=V.x-z.x,X=V.y-z.y,Y=Math.sqrt(G*G+X*X);return z.x+G/Y*Q}).attr("y2",B=>{const V=T.get(B.source),z=T.get(B.target),Q=l.nodes.find(le=>le.id===B.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,G=V.x-z.x,X=V.y-z.y,Y=Math.sqrt(G*G+X*X);return z.y+X/Y*Q}).attr("stroke",a.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",B=>B.dashed?"6 6":null).attr("marker-end",B=>B.flow==="forward"||B.flow==="bidirectional"?`url(#link-arrow-end-${e})`:null).attr("marker-start",B=>B.flow==="backward"||B.flow==="bidirectional"?`url(#link-arrow-start-${e})`:null),O.selectAll("text").data(E.filter(B=>B.label)).enter().append("text").attr("class","wardley-link-label").attr("x",B=>{const V=T.get(B.source),z=T.get(B.target),U=(V.x+z.x)/2,Q=z.y-V.y,G=z.x-V.x,X=Math.sqrt(G*G+Q*Q),Y=8,le=Q/X;return U+le*Y}).attr("y",B=>{const V=T.get(B.source),z=T.get(B.target),U=(V.y+z.y)/2,Q=z.x-V.x,G=z.y-V.y,X=Math.sqrt(Q*Q+G*G),Y=8,le=-Q/X;return U+le*Y}).attr("fill",a.axisTextColor).attr("font-size",i.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",B=>{const V=T.get(B.source),z=T.get(B.target),U=(V.x+z.x)/2,Q=(V.y+z.y)/2,G=z.x-V.x,X=z.y-V.y,Y=Math.sqrt(G*G+X*X),le=8,q=X/Y,Z=-G/Y,ee=U+q*le,re=Q+Z*le;let ve=Math.atan2(X,G)*180/Math.PI;return(ve>90||ve<-90)&&(ve+=180),`rotate(${ve} ${ee} ${re})`}).text(B=>B.label);const _=p.append("g").attr("class","wardley-trends"),I=l.trends.map(B=>{const V=T.get(B.nodeId);if(!V)return null;const z=y(B.targetX),U=b(B.targetY),Q=z-V.x,G=U-V.y,X=Math.sqrt(Q*Q+G*G),Y=i.nodeRadius+2,le=X>Y?z-Q/X*Y:z,q=X>Y?U-G/X*Y:U;return{origin:V,targetX:z,targetY:U,adjustedX2:le,adjustedY2:q}}).filter(B=>B!==null);_.selectAll("line").data(I).enter().append("line").attr("class","wardley-trend").attr("x1",B=>B.origin.x).attr("y1",B=>B.origin.y).attr("x2",B=>B.adjustedX2).attr("y2",B=>B.adjustedY2).attr("stroke",a.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${e})`);const R=p.append("g").attr("class","wardley-nodes").selectAll("g").data(l.nodes).enter().append("g").attr("class",B=>["wardley-node",B.className?`wardley-node--${B.className}`:""].filter(Boolean).join(" "));R.filter(B=>B.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",B=>T.get(B.id).x).attr("cy",B=>T.get(B.id).y).attr("r",i.nodeRadius*2).attr("fill","#666").attr("stroke",a.componentStroke).attr("stroke-width",1),R.filter(B=>B.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",B=>T.get(B.id).x).attr("cy",B=>T.get(B.id).y).attr("r",i.nodeRadius*2).attr("fill","#ccc").attr("stroke",a.componentStroke).attr("stroke-width",1),R.filter(B=>B.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",B=>T.get(B.id).x).attr("cy",B=>T.get(B.id).y).attr("r",i.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const D=R.filter(B=>B.sourceStrategy==="market");D.append("circle").attr("class","wardley-market-overlay").attr("cx",B=>T.get(B.id).x).attr("cy",B=>T.get(B.id).y).attr("r",i.nodeRadius*2).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),R.filter(B=>!B.isPipelineParent&&B.sourceStrategy!=="market"&&B.className!=="anchor").append("circle").attr("cx",B=>T.get(B.id).x).attr("cy",B=>T.get(B.id).y).attr("r",i.nodeRadius).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1);const M=i.nodeRadius*.7,P=i.nodeRadius*1.2;if(D.append("line").attr("class","wardley-market-line").attr("x1",B=>T.get(B.id).x).attr("y1",B=>T.get(B.id).y-P).attr("x2",B=>T.get(B.id).x-P*Math.cos(Math.PI/6)).attr("y2",B=>T.get(B.id).y+P*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),D.append("line").attr("class","wardley-market-line").attr("x1",B=>T.get(B.id).x-P*Math.cos(Math.PI/6)).attr("y1",B=>T.get(B.id).y+P*Math.sin(Math.PI/6)).attr("x2",B=>T.get(B.id).x+P*Math.cos(Math.PI/6)).attr("y2",B=>T.get(B.id).y+P*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),D.append("line").attr("class","wardley-market-line").attr("x1",B=>T.get(B.id).x+P*Math.cos(Math.PI/6)).attr("y1",B=>T.get(B.id).y+P*Math.sin(Math.PI/6)).attr("x2",B=>T.get(B.id).x).attr("y2",B=>T.get(B.id).y-P).attr("stroke",a.componentStroke).attr("stroke-width",1),D.append("circle").attr("class","wardley-market-dot").attr("cx",B=>T.get(B.id).x).attr("cy",B=>T.get(B.id).y-P).attr("r",M).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),D.append("circle").attr("class","wardley-market-dot").attr("cx",B=>T.get(B.id).x-P*Math.cos(Math.PI/6)).attr("cy",B=>T.get(B.id).y+P*Math.sin(Math.PI/6)).attr("r",M).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),D.append("circle").attr("class","wardley-market-dot").attr("cx",B=>T.get(B.id).x+P*Math.cos(Math.PI/6)).attr("cy",B=>T.get(B.id).y+P*Math.sin(Math.PI/6)).attr("r",M).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),R.filter(B=>B.isPipelineParent===!0).append("rect").attr("x",B=>T.get(B.id).x-s/2).attr("y",B=>T.get(B.id).y-s/2).attr("width",s).attr("height",s).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1),R.filter(B=>B.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",B=>{const V=T.get(B.id);let z=B.isPipelineParent?s/2+15:i.nodeRadius+15;return B.sourceStrategy&&(z+=i.nodeRadius+10),V.x+z}).attr("y1",B=>{const V=T.get(B.id),z=B.isPipelineParent?s:i.nodeRadius*2;return V.y-z/2}).attr("x2",B=>{const V=T.get(B.id);let z=B.isPipelineParent?s/2+15:i.nodeRadius+15;return B.sourceStrategy&&(z+=i.nodeRadius+10),V.x+z}).attr("y2",B=>{const V=T.get(B.id),z=B.isPipelineParent?s:i.nodeRadius*2;return V.y+z/2}).attr("stroke",a.componentStroke).attr("stroke-width",6),R.append("text").attr("x",B=>{const V=T.get(B.id);if(B.className==="anchor")return B.labelOffsetX!==void 0?V.x+B.labelOffsetX:V.x;let z=i.nodeLabelOffset;B.sourceStrategy&&B.labelOffsetX===void 0&&(z+=10);const U=B.labelOffsetX??z;return V.x+U}).attr("y",B=>{const V=T.get(B.id);if(B.className==="anchor")return B.labelOffsetY!==void 0?V.y+B.labelOffsetY:V.y-3;let z=-i.nodeLabelOffset;B.sourceStrategy&&B.labelOffsetY===void 0&&(z-=10);const U=B.labelOffsetY??z;return V.y+U}).attr("class","wardley-node-label").attr("fill",B=>B.className==="evolved"?a.evolutionStroke:B.className==="anchor"?"#000":a.componentLabelColor).attr("font-size",i.labelFontSize).attr("font-weight",B=>B.className==="anchor"?"bold":"normal").attr("text-anchor",B=>B.className==="anchor"?"middle":"start").attr("dominant-baseline",B=>B.className==="anchor"?"middle":"auto").text(B=>B.label),l.annotations.length>0){const B=p.append("g").attr("class","wardley-annotations");if(l.annotations.forEach(V=>{const z=V.coordinates.map(U=>({x:y(U.x),y:b(U.y)}));if(z.length>1)for(let U=0;U{const Q=B.append("g").attr("class","wardley-annotation");Q.append("circle").attr("cx",U.x).attr("cy",U.y).attr("r",10).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5),Q.append("text").attr("x",U.x).attr("y",U.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(V.number)})}),l.annotationsBox){let V=y(l.annotationsBox.x),z=b(l.annotationsBox.y);const U=10,Q=16,G=11,X=B.append("g").attr("class","wardley-annotations-box"),Y=[...l.annotations].filter(q=>q.text).sort((q,Z)=>q.number-Z.number),le=[];if(Y.forEach((q,Z)=>{const ee=X.append("text").attr("x",V+U).attr("y",z+U+(Z+1)*Q).attr("font-size",G).attr("fill",a.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${q.number}. ${q.text}`);le.push(ee)}),le.length>0){let q=0,Z=0;le.forEach($e=>{const he=$e.node(),fe=he.getComputedTextLength();q=Math.max(q,fe);const Se=he.getBBox();Z=Math.max(Z,Se.height)});const ee=q+U*2+105,re=Y.length*Q+U*2+Z/2,ve=i.padding,ae=h-i.padding-ee,Ce=i.padding,Oe=d-i.padding-re;V=Math.max(ve,Math.min(V,ae)),z=Math.max(Ce,Math.min(z,Oe)),le.forEach(($e,he)=>{$e.attr("x",V+U).attr("y",z+U+(he+1)*Q)}),X.insert("rect","text").attr("x",V).attr("y",z).attr("width",ee).attr("height",re).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(l.notes.length>0){const B=p.append("g").attr("class","wardley-notes");l.notes.forEach(V=>{const z=y(V.x),U=b(V.y);B.append("text").attr("x",z).attr("y",U).attr("text-anchor","start").attr("font-size",11).attr("fill",a.axisTextColor).attr("font-weight","bold").text(V.text)})}if(l.accelerators.length>0){const B=p.append("g").attr("class","wardley-accelerators");l.accelerators.forEach(V=>{const z=y(V.x),U=b(V.y),Q=60,G=30,X=20,Y=` M ${z} ${U-G/2} L ${z+Q-X} ${U-G/2} L ${z+Q-X} ${U-G/2-8} @@ -3815,7 +3815,7 @@ Expecting `+ee.join(", ")+", got '"+(this.terminals_[U]||U)+"'":re="Parse error .wardley-notes text { fill: ${i.axisTextColor}; } - `},"styles"),Pei={parser:KKt,db:Eei,renderer:Mei,styles:Iei};const Nei=Object.freeze(Object.defineProperty({__proto__:null,diagram:Pei},Symbol.toStringTag,{value:"Module"}));var gZt=C(()=>({domains:new Map,transitions:[]}),"createDefaultData"),Fz=gZt(),Bei=C(()=>Fz.domains,"getDomains"),$ei=C(()=>Fz.transitions,"getTransitions"),Fei=C(t=>{if(t)for(const e of t){const r=e.domain,n=(e.items??[]).map(i=>({label:i.label}));Fz.domains.set(r,{name:r,items:n})}},"setDomains"),zei=C(t=>{t&&(Fz.transitions=t.filter(e=>e.from===e.to?(me.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Uei=C(()=>ns({...Xn.cynefin,...Dr().cynefin}),"getConfig"),Vei=C(()=>{Aa(),Fz=gZt()},"clear"),aie={getDomains:Bei,getTransitions:$ei,setDomains:Fei,setTransitions:zei,getConfig:Uei,clear:Vei,setAccTitle:Da,getAccTitle:Ja,setDiagramTitle:rs,getDiagramTitle:La,getAccDescription:ts,setAccDescription:es},Qei=C(t=>{qu(t,aie),aie.setDomains(t.domains),aie.setTransitions(t.transitions)},"populate"),Gei={parse:C(async t=>{const e=await Op("cynefin",t);me.debug(e),Qei(e)},"parse")};function zz(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}C(zz,"seededRandom");function mZt(t){let e=0;for(let r=0;r{const r=t/2,n=e/2;return{complex:{cx:r/2,cy:n/2,x:0,y:0,w:r,h:n},complicated:{cx:r+r/2,cy:n/2,x:r,y:0,w:r,h:n},chaotic:{cx:r/2,cy:n+n/2,x:0,y:n,w:r,h:n},clear:{cx:r+r/2,cy:n+n/2,x:r,y:n,w:r,h:n},confusion:{cx:r,cy:n,x:r*.7,y:n*.7,w:r*.6,h:n*.6}}},"getDomainLayouts"),Wei=C(()=>{const t=ky(),e=Dr();return ns(t,e.themeVariables).cynefin},"getCynefinDomainColors"),gLe=3,Yei=C((t,e,r,n)=>{const i=n.db,a=i.getDomains(),s=i.getTransitions(),o=i.getDiagramTitle(),l=i.getAccTitle(),u=i.getAccDescription(),h=i.getConfig(),d=Wei();me.debug("Rendering Cynefin diagram");const f=h.width,p=h.height,g=h.padding,m=h.showDomainDescriptions,v=h.boundaryAmplitude,y=f+g*2,b=p+g*2,x={complex:d.complexBg,complicated:d.complicatedBg,clear:d.clearBg,chaotic:d.chaoticBg,confusion:d.confusionBg},w=qc(e);zs(w,b,y,h.useMaxWidth??!0),w.attr("viewBox",`0 0 ${y} ${b}`),l&&w.append("title").text(l),u&&w.append("desc").text(u);const A=w.append("g").attr("transform",`translate(${g}, ${g})`),T=Hei(f,p),S=vZt(h.seed,e),O=A.append("g").attr("class","cynefin-backgrounds"),k=["complex","complicated","chaotic","clear"];for(const N of k){const F=T[N];O.append("rect").attr("class","cynefinDomain").attr("x",F.x).attr("y",F.y).attr("width",F.w).attr("height",F.h).attr("fill",x[N]).attr("fill-opacity",.4).attr("stroke","none")}const E=A.append("g").attr("class","cynefin-boundaries");E.append("path").attr("class","cynefinBoundary").attr("d",yZt(f,p,S,v)).attr("fill","none"),E.append("path").attr("class","cynefinBoundary").attr("d",bZt(f,p,S+100,v)).attr("fill","none"),E.append("path").attr("class","cynefinCliff").attr("d",xZt(f,p)).attr("fill","none");const _=f*.15,I=p*.15;A.append("path").attr("class","cynefinConfusion").attr("d",wZt(f/2,p/2,_,I)).attr("fill",x.confusion).attr("fill-opacity",.5);const L=A.append("g").attr("class","cynefin-labels");for(const N of k){const F=T[N];L.append("text").attr("class","cynefinDomainLabel").attr("x",F.cx).attr("y",m?F.cy-30:F.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(N.charAt(0).toUpperCase()+N.slice(1))}if(L.append("text").attr("class","cynefinDomainLabel").attr("x",f/2).attr("y",m?p/2-10:p/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),m){const N=A.append("g").attr("class","cynefin-subtitles");for(const F of k){const B=T[F],V=AZt[F];N.append("text").attr("class","cynefinSubtitle").attr("x",B.cx).attr("y",B.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(V.model),N.append("text").attr("class","cynefinSubtitle").attr("x",B.cx).attr("y",B.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(V.practice)}N.append("text").attr("class","cynefinSubtitle").attr("x",f/2).attr("y",p/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(AZt.confusion.practice)}const R=A.append("g").attr("class","cynefin-items"),D=26,M=10,P=["complex","complicated","chaotic","clear","confusion"];for(const N of P){const F=a.get(N);if(!F||F.items.length===0)continue;const B=T[N],V=N==="confusion";let z=F.items,U=0;V&&F.items.length>gLe&&(U=F.items.length-gLe,z=F.items.slice(0,gLe));let Q;if(V){const G=m?22:14;Q=B.cy+G}else Q=B.cy+(m?25:15);if([...z].forEach((G,X)=>{const Y=Q+X*(D+4),le=R.append("g"),q=le.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",D/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(G.label);let Z=G.label.length*7;const ee=q.node();if(ee&&typeof ee.getBBox=="function"){const ae=ee.getBBox();ae.width>0&&(Z=ae.width)}const re=Z+M*2,ve=B.cx-re/2;le.attr("transform",`translate(${ve}, ${Y})`),le.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",re).attr("height",D).attr("rx",4).attr("ry",4).attr("fill",x[N]).attr("fill-opacity",.95),q.attr("x",re/2).attr("y",D/2)}),U>0){const G=Q+z.length*(D+4),X=`+${U} more`,Y=R.append("g"),le=Y.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",D/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(X);let q=X.length*7;const Z=le.node();if(Z&&typeof Z.getBBox=="function"){const ve=Z.getBBox();ve.width>0&&(q=ve.width)}const ee=q+M*2,re=B.cx-ee/2;Y.attr("transform",`translate(${re}, ${G})`),Y.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",ee).attr("height",D).attr("rx",4).attr("ry",4).attr("fill",x[N]).attr("fill-opacity",.6),le.attr("x",ee/2).attr("y",D/2)}}if(s.length>0){const N=w.select("defs").empty()?w.append("defs"):w.select("defs"),F=`cynefin-arrow-${e}`;N.append("marker").attr("id",F).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const B=A.append("g").attr("class","cynefin-arrows");s.forEach(V=>{const z=T[V.from],U=T[V.to];if(!z||!U)return;if(V.from===V.to){me.warn(`Cynefin renderer: skipping self-loop on domain "${V.from}"`);return}const Q=z.cx,G=z.cy,X=U.cx,Y=U.cy,le=(Q+X)/2,q=(G+Y)/2,Z=X-Q,ee=Y-G,re=Math.sqrt(Z*Z+ee*ee),ve=re*.15,ae=-ee/re,Ce=Z/re,Oe=le+ae*ve,$e=q+Ce*ve;B.append("path").attr("class","cynefinArrowLine").attr("d",`M${Q},${G} Q${Oe},${$e} ${X},${Y}`).attr("fill","none").attr("marker-end",`url(#${F})`),V.label&&B.append("text").attr("class","cynefinArrowLabel").attr("x",Oe).attr("y",$e-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(V.label)})}o&&A.append("text").attr("class","cynefinTitle").attr("x",f/2).attr("y",-g/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(o)},"draw"),qei={draw:Yei},jei=C(()=>{const t=ky(),e=Dr();return ns(t,e.themeVariables).cynefin},"getCynefinTheme"),Xei=C(()=>{const t=jei();return` + `},"styles"),Pei={parser:KKt,db:Eei,renderer:Mei,styles:Iei};const Nei=Object.freeze(Object.defineProperty({__proto__:null,diagram:Pei},Symbol.toStringTag,{value:"Module"}));var gZt=C(()=>({domains:new Map,transitions:[]}),"createDefaultData"),Fz=gZt(),Bei=C(()=>Fz.domains,"getDomains"),$ei=C(()=>Fz.transitions,"getTransitions"),Fei=C(t=>{if(t)for(const e of t){const r=e.domain,n=(e.items??[]).map(i=>({label:i.label}));Fz.domains.set(r,{name:r,items:n})}},"setDomains"),zei=C(t=>{t&&(Fz.transitions=t.filter(e=>e.from===e.to?(me.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Uei=C(()=>ns({...Xn.cynefin,...Dr().cynefin}),"getConfig"),Vei=C(()=>{Aa(),Fz=gZt()},"clear"),aie={getDomains:Bei,getTransitions:$ei,setDomains:Fei,setTransitions:zei,getConfig:Uei,clear:Vei,setAccTitle:Da,getAccTitle:Ja,setDiagramTitle:rs,getDiagramTitle:La,getAccDescription:ts,setAccDescription:es},Qei=C(t=>{qu(t,aie),aie.setDomains(t.domains),aie.setTransitions(t.transitions)},"populate"),Gei={parse:C(async t=>{const e=await Op("cynefin",t);me.debug(e),Qei(e)},"parse")};function zz(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}C(zz,"seededRandom");function mZt(t){let e=0;for(let r=0;r{const r=t/2,n=e/2;return{complex:{cx:r/2,cy:n/2,x:0,y:0,w:r,h:n},complicated:{cx:r+r/2,cy:n/2,x:r,y:0,w:r,h:n},chaotic:{cx:r/2,cy:n+n/2,x:0,y:n,w:r,h:n},clear:{cx:r+r/2,cy:n+n/2,x:r,y:n,w:r,h:n},confusion:{cx:r,cy:n,x:r*.7,y:n*.7,w:r*.6,h:n*.6}}},"getDomainLayouts"),Wei=C(()=>{const t=ky(),e=Dr();return ns(t,e.themeVariables).cynefin},"getCynefinDomainColors"),gLe=3,Yei=C((t,e,r,n)=>{const i=n.db,a=i.getDomains(),s=i.getTransitions(),o=i.getDiagramTitle(),l=i.getAccTitle(),u=i.getAccDescription(),h=i.getConfig(),d=Wei();me.debug("Rendering Cynefin diagram");const f=h.width,p=h.height,g=h.padding,m=h.showDomainDescriptions,v=h.boundaryAmplitude,y=f+g*2,b=p+g*2,x={complex:d.complexBg,complicated:d.complicatedBg,clear:d.clearBg,chaotic:d.chaoticBg,confusion:d.confusionBg},w=qc(e);zs(w,b,y,h.useMaxWidth??!0),w.attr("viewBox",`0 0 ${y} ${b}`),l&&w.append("title").text(l),u&&w.append("desc").text(u);const A=w.append("g").attr("transform",`translate(${g}, ${g})`),S=Hei(f,p),T=vZt(h.seed,e),O=A.append("g").attr("class","cynefin-backgrounds"),k=["complex","complicated","chaotic","clear"];for(const N of k){const F=S[N];O.append("rect").attr("class","cynefinDomain").attr("x",F.x).attr("y",F.y).attr("width",F.w).attr("height",F.h).attr("fill",x[N]).attr("fill-opacity",.4).attr("stroke","none")}const E=A.append("g").attr("class","cynefin-boundaries");E.append("path").attr("class","cynefinBoundary").attr("d",yZt(f,p,T,v)).attr("fill","none"),E.append("path").attr("class","cynefinBoundary").attr("d",bZt(f,p,T+100,v)).attr("fill","none"),E.append("path").attr("class","cynefinCliff").attr("d",xZt(f,p)).attr("fill","none");const _=f*.15,I=p*.15;A.append("path").attr("class","cynefinConfusion").attr("d",wZt(f/2,p/2,_,I)).attr("fill",x.confusion).attr("fill-opacity",.5);const L=A.append("g").attr("class","cynefin-labels");for(const N of k){const F=S[N];L.append("text").attr("class","cynefinDomainLabel").attr("x",F.cx).attr("y",m?F.cy-30:F.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(N.charAt(0).toUpperCase()+N.slice(1))}if(L.append("text").attr("class","cynefinDomainLabel").attr("x",f/2).attr("y",m?p/2-10:p/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),m){const N=A.append("g").attr("class","cynefin-subtitles");for(const F of k){const B=S[F],V=AZt[F];N.append("text").attr("class","cynefinSubtitle").attr("x",B.cx).attr("y",B.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(V.model),N.append("text").attr("class","cynefinSubtitle").attr("x",B.cx).attr("y",B.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(V.practice)}N.append("text").attr("class","cynefinSubtitle").attr("x",f/2).attr("y",p/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(AZt.confusion.practice)}const R=A.append("g").attr("class","cynefin-items"),D=26,M=10,P=["complex","complicated","chaotic","clear","confusion"];for(const N of P){const F=a.get(N);if(!F||F.items.length===0)continue;const B=S[N],V=N==="confusion";let z=F.items,U=0;V&&F.items.length>gLe&&(U=F.items.length-gLe,z=F.items.slice(0,gLe));let Q;if(V){const G=m?22:14;Q=B.cy+G}else Q=B.cy+(m?25:15);if([...z].forEach((G,X)=>{const Y=Q+X*(D+4),le=R.append("g"),q=le.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",D/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(G.label);let Z=G.label.length*7;const ee=q.node();if(ee&&typeof ee.getBBox=="function"){const ae=ee.getBBox();ae.width>0&&(Z=ae.width)}const re=Z+M*2,ve=B.cx-re/2;le.attr("transform",`translate(${ve}, ${Y})`),le.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",re).attr("height",D).attr("rx",4).attr("ry",4).attr("fill",x[N]).attr("fill-opacity",.95),q.attr("x",re/2).attr("y",D/2)}),U>0){const G=Q+z.length*(D+4),X=`+${U} more`,Y=R.append("g"),le=Y.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",D/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(X);let q=X.length*7;const Z=le.node();if(Z&&typeof Z.getBBox=="function"){const ve=Z.getBBox();ve.width>0&&(q=ve.width)}const ee=q+M*2,re=B.cx-ee/2;Y.attr("transform",`translate(${re}, ${G})`),Y.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",ee).attr("height",D).attr("rx",4).attr("ry",4).attr("fill",x[N]).attr("fill-opacity",.6),le.attr("x",ee/2).attr("y",D/2)}}if(s.length>0){const N=w.select("defs").empty()?w.append("defs"):w.select("defs"),F=`cynefin-arrow-${e}`;N.append("marker").attr("id",F).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const B=A.append("g").attr("class","cynefin-arrows");s.forEach(V=>{const z=S[V.from],U=S[V.to];if(!z||!U)return;if(V.from===V.to){me.warn(`Cynefin renderer: skipping self-loop on domain "${V.from}"`);return}const Q=z.cx,G=z.cy,X=U.cx,Y=U.cy,le=(Q+X)/2,q=(G+Y)/2,Z=X-Q,ee=Y-G,re=Math.sqrt(Z*Z+ee*ee),ve=re*.15,ae=-ee/re,Ce=Z/re,Oe=le+ae*ve,$e=q+Ce*ve;B.append("path").attr("class","cynefinArrowLine").attr("d",`M${Q},${G} Q${Oe},${$e} ${X},${Y}`).attr("fill","none").attr("marker-end",`url(#${F})`),V.label&&B.append("text").attr("class","cynefinArrowLabel").attr("x",Oe).attr("y",$e-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(V.label)})}o&&A.append("text").attr("class","cynefinTitle").attr("x",f/2).attr("y",-g/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(o)},"draw"),qei={draw:Yei},jei=C(()=>{const t=ky(),e=Dr();return ns(t,e.themeVariables).cynefin},"getCynefinTheme"),Xei=C(()=>{const t=jei();return` .cynefinDomain { stroke: none; } @@ -3876,8 +3876,8 @@ Expecting `+ee.join(", ")+", got '"+(this.terminals_[U]||U)+"'":re="Parse error font-weight: bold; fill: ${t.labelColor}; } - `},"styles"),Kei=Xei,Zei={parser:Gei,db:aie,renderer:qei,styles:Kei};const Jei=Object.freeze(Object.defineProperty({__proto__:null,diagram:Zei},Symbol.toStringTag,{value:"Module"}));var mLe="",vLe="",yLe="",bLe=[],sie=new Map,xw=C(t=>ai(t,He()),"sanitizeText"),cD=C(t=>{switch(t.type){case"terminal":return{...t,value:xw(t.value)};case"nonterminal":return{...t,name:xw(t.name)};case"sequence":return{...t,elements:t.elements.map(cD)};case"choice":return{...t,alternatives:t.alternatives.map(cD)};case"optional":return{...t,element:cD(t.element)};case"repetition":return{...t,element:cD(t.element),separator:t.separator?cD(t.separator):void 0};case"special":return{...t,text:xw(t.text)}}},"sanitizeAstNode"),eti=C(()=>{mLe="",vLe="",yLe="",bLe.length=0,sie.clear(),Aa(),me.debug("[Railroad] Database cleared")},"clear"),TZt=C(t=>{mLe=xw(t),me.debug("[Railroad] Title set:",t)},"setTitle"),SZt=C(()=>mLe,"getTitle"),tti=C(t=>{const e={...t,name:xw(t.name),definition:cD(t.definition),comment:t.comment?xw(t.comment):void 0};me.debug("[Railroad] Adding rule:",e.name),sie.has(e.name)&&me.warn(`[Railroad] Rule '${e.name}' is already defined. Overwriting.`),bLe.push(e),sie.set(e.name,e)},"addRule"),rti=C(()=>bLe,"getRules"),nti=C(t=>sie.get(t),"getRule"),iti=C(t=>{vLe=xw(t).replace(/^\s+/g,""),me.debug("[Railroad] Accessibility title set:",t)},"setAccTitle"),ati=C(()=>vLe,"getAccTitle"),sti=C(t=>{yLe=xw(t).replace(/\n\s+/g,` -`),me.debug("[Railroad] Accessibility description set:",t)},"setAccDescription"),oti=C(()=>yLe,"getAccDescription"),lti=TZt,cti=SZt,cs={clear:eti,setTitle:TZt,getTitle:SZt,addRule:tti,getRules:rti,getRule:nti,setAccTitle:iti,getAccTitle:ati,setAccDescription:sti,getAccDescription:oti,setDiagramTitle:lti,getDiagramTitle:cti},kc={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},uti=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,hti=/^[\w "',.-]+$/,dti=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),CZt=C(t=>t?Object.keys(t).every(e=>e==="railroad"||dti.has(e)):!1,"isRailroadStyleOptions"),fti=C(t=>t?"railroad"in t&&t.railroad?t.railroad:CZt(t)?t:{}:{},"extractRailroadOverrides"),pti=C(t=>{if(!t||CZt(t))return{};const{railroad:e,svgId:r,theme:n,look:i,...a}=t;return a},"extractThemeOverrides"),va=C((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return uti.test(r)?r:e},"sanitizeColorValue"),OZt=C((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return hti.test(r)?r:e},"sanitizeFontFamilyValue"),jO=C((t,e)=>{const r=typeof t=="number"?t:typeof t=="string"?Number.parseFloat(t):Number.NaN;return Number.isFinite(r)&&r>=0?r:e},"sanitizeNumberValue"),gti=C(t=>{const e=typeof t=="number"?t:typeof t=="string"?Number.parseFloat(t):Number.NaN;return Number.isFinite(e)&&e>0?e:void 0},"parseThemeFontSize"),mti=C(t=>{const e=OZt(t.fontFamily,kc.fontFamily),r=gti(t.fontSize)??kc.fontSize;return{...kc,fontFamily:e,fontSize:r,terminalFill:va(t.secondBkg??t.secondaryColor,kc.terminalFill),terminalStroke:va(t.secondaryBorderColor??t.lineColor,kc.terminalStroke),terminalTextColor:va(t.secondaryTextColor??t.textColor,kc.terminalTextColor),nonTerminalFill:va(t.mainBkg??t.background,kc.nonTerminalFill),nonTerminalStroke:va(t.primaryBorderColor??t.lineColor,kc.nonTerminalStroke),nonTerminalTextColor:va(t.primaryTextColor??t.textColor,kc.nonTerminalTextColor),lineColor:va(t.lineColor,kc.lineColor),markerFill:va(t.lineColor,kc.markerFill),commentFill:va(t.labelBackground??t.tertiaryColor,kc.commentFill),commentStroke:va(t.tertiaryBorderColor??t.lineColor,kc.commentStroke),commentTextColor:va(t.tertiaryTextColor??t.textColor,kc.commentTextColor),specialFill:va(t.tertiaryColor??t.secondaryColor,kc.specialFill),specialStroke:va(t.tertiaryBorderColor??t.secondaryBorderColor,kc.specialStroke),ruleNameColor:va(t.titleColor??t.textColor,kc.ruleNameColor)}},"buildThemeDefaults"),xLe=C(t=>{const e=Dr(),r={...ky(),...e.themeVariables??{},...pti(t)},n=mti(r),i={...e.railroad??{},...fti(t)};return{compactMode:i.compactMode??n.compactMode,padding:jO(i.padding,n.padding),verticalSeparation:jO(i.verticalSeparation,n.verticalSeparation),horizontalSeparation:jO(i.horizontalSeparation,n.horizontalSeparation),arcRadius:jO(i.arcRadius,n.arcRadius),fontSize:jO(i.fontSize,n.fontSize),fontFamily:OZt(i.fontFamily,n.fontFamily),terminalFill:va(i.terminalFill,n.terminalFill),terminalStroke:va(i.terminalStroke,n.terminalStroke),terminalTextColor:va(i.terminalTextColor,n.terminalTextColor),nonTerminalFill:va(i.nonTerminalFill,n.nonTerminalFill),nonTerminalStroke:va(i.nonTerminalStroke,n.nonTerminalStroke),nonTerminalTextColor:va(i.nonTerminalTextColor,n.nonTerminalTextColor),lineColor:va(i.lineColor,n.lineColor),strokeWidth:jO(i.strokeWidth,n.strokeWidth),markerFill:va(i.markerFill,n.markerFill),commentFill:va(i.commentFill,n.commentFill),commentStroke:va(i.commentStroke,n.commentStroke),commentTextColor:va(i.commentTextColor,n.commentTextColor),specialFill:va(i.specialFill,n.specialFill),specialStroke:va(i.specialStroke,n.specialStroke),ruleNameColor:va(i.ruleNameColor,n.ruleNameColor),showMarkers:i.showMarkers??n.showMarkers,markerRadius:jO(i.markerRadius,n.markerRadius)}},"buildRailroadStyleOptions"),oie=C(t=>{const{fontFamily:e,fontSize:r,terminalFill:n,terminalStroke:i,terminalTextColor:a,nonTerminalFill:s,nonTerminalStroke:o,nonTerminalTextColor:l,lineColor:u,strokeWidth:h,markerFill:d,commentFill:f,commentStroke:p,commentTextColor:g,specialFill:m,specialStroke:v,ruleNameColor:y}=xLe(t);return` + `},"styles"),Kei=Xei,Zei={parser:Gei,db:aie,renderer:qei,styles:Kei};const Jei=Object.freeze(Object.defineProperty({__proto__:null,diagram:Zei},Symbol.toStringTag,{value:"Module"}));var mLe="",vLe="",yLe="",bLe=[],sie=new Map,xw=C(t=>ai(t,He()),"sanitizeText"),cD=C(t=>{switch(t.type){case"terminal":return{...t,value:xw(t.value)};case"nonterminal":return{...t,name:xw(t.name)};case"sequence":return{...t,elements:t.elements.map(cD)};case"choice":return{...t,alternatives:t.alternatives.map(cD)};case"optional":return{...t,element:cD(t.element)};case"repetition":return{...t,element:cD(t.element),separator:t.separator?cD(t.separator):void 0};case"special":return{...t,text:xw(t.text)}}},"sanitizeAstNode"),eti=C(()=>{mLe="",vLe="",yLe="",bLe.length=0,sie.clear(),Aa(),me.debug("[Railroad] Database cleared")},"clear"),SZt=C(t=>{mLe=xw(t),me.debug("[Railroad] Title set:",t)},"setTitle"),TZt=C(()=>mLe,"getTitle"),tti=C(t=>{const e={...t,name:xw(t.name),definition:cD(t.definition),comment:t.comment?xw(t.comment):void 0};me.debug("[Railroad] Adding rule:",e.name),sie.has(e.name)&&me.warn(`[Railroad] Rule '${e.name}' is already defined. Overwriting.`),bLe.push(e),sie.set(e.name,e)},"addRule"),rti=C(()=>bLe,"getRules"),nti=C(t=>sie.get(t),"getRule"),iti=C(t=>{vLe=xw(t).replace(/^\s+/g,""),me.debug("[Railroad] Accessibility title set:",t)},"setAccTitle"),ati=C(()=>vLe,"getAccTitle"),sti=C(t=>{yLe=xw(t).replace(/\n\s+/g,` +`),me.debug("[Railroad] Accessibility description set:",t)},"setAccDescription"),oti=C(()=>yLe,"getAccDescription"),lti=SZt,cti=TZt,cs={clear:eti,setTitle:SZt,getTitle:TZt,addRule:tti,getRules:rti,getRule:nti,setAccTitle:iti,getAccTitle:ati,setAccDescription:sti,getAccDescription:oti,setDiagramTitle:lti,getDiagramTitle:cti},kc={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},uti=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,hti=/^[\w "',.-]+$/,dti=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),CZt=C(t=>t?Object.keys(t).every(e=>e==="railroad"||dti.has(e)):!1,"isRailroadStyleOptions"),fti=C(t=>t?"railroad"in t&&t.railroad?t.railroad:CZt(t)?t:{}:{},"extractRailroadOverrides"),pti=C(t=>{if(!t||CZt(t))return{};const{railroad:e,svgId:r,theme:n,look:i,...a}=t;return a},"extractThemeOverrides"),va=C((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return uti.test(r)?r:e},"sanitizeColorValue"),OZt=C((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return hti.test(r)?r:e},"sanitizeFontFamilyValue"),jO=C((t,e)=>{const r=typeof t=="number"?t:typeof t=="string"?Number.parseFloat(t):Number.NaN;return Number.isFinite(r)&&r>=0?r:e},"sanitizeNumberValue"),gti=C(t=>{const e=typeof t=="number"?t:typeof t=="string"?Number.parseFloat(t):Number.NaN;return Number.isFinite(e)&&e>0?e:void 0},"parseThemeFontSize"),mti=C(t=>{const e=OZt(t.fontFamily,kc.fontFamily),r=gti(t.fontSize)??kc.fontSize;return{...kc,fontFamily:e,fontSize:r,terminalFill:va(t.secondBkg??t.secondaryColor,kc.terminalFill),terminalStroke:va(t.secondaryBorderColor??t.lineColor,kc.terminalStroke),terminalTextColor:va(t.secondaryTextColor??t.textColor,kc.terminalTextColor),nonTerminalFill:va(t.mainBkg??t.background,kc.nonTerminalFill),nonTerminalStroke:va(t.primaryBorderColor??t.lineColor,kc.nonTerminalStroke),nonTerminalTextColor:va(t.primaryTextColor??t.textColor,kc.nonTerminalTextColor),lineColor:va(t.lineColor,kc.lineColor),markerFill:va(t.lineColor,kc.markerFill),commentFill:va(t.labelBackground??t.tertiaryColor,kc.commentFill),commentStroke:va(t.tertiaryBorderColor??t.lineColor,kc.commentStroke),commentTextColor:va(t.tertiaryTextColor??t.textColor,kc.commentTextColor),specialFill:va(t.tertiaryColor??t.secondaryColor,kc.specialFill),specialStroke:va(t.tertiaryBorderColor??t.secondaryBorderColor,kc.specialStroke),ruleNameColor:va(t.titleColor??t.textColor,kc.ruleNameColor)}},"buildThemeDefaults"),xLe=C(t=>{const e=Dr(),r={...ky(),...e.themeVariables??{},...pti(t)},n=mti(r),i={...e.railroad??{},...fti(t)};return{compactMode:i.compactMode??n.compactMode,padding:jO(i.padding,n.padding),verticalSeparation:jO(i.verticalSeparation,n.verticalSeparation),horizontalSeparation:jO(i.horizontalSeparation,n.horizontalSeparation),arcRadius:jO(i.arcRadius,n.arcRadius),fontSize:jO(i.fontSize,n.fontSize),fontFamily:OZt(i.fontFamily,n.fontFamily),terminalFill:va(i.terminalFill,n.terminalFill),terminalStroke:va(i.terminalStroke,n.terminalStroke),terminalTextColor:va(i.terminalTextColor,n.terminalTextColor),nonTerminalFill:va(i.nonTerminalFill,n.nonTerminalFill),nonTerminalStroke:va(i.nonTerminalStroke,n.nonTerminalStroke),nonTerminalTextColor:va(i.nonTerminalTextColor,n.nonTerminalTextColor),lineColor:va(i.lineColor,n.lineColor),strokeWidth:jO(i.strokeWidth,n.strokeWidth),markerFill:va(i.markerFill,n.markerFill),commentFill:va(i.commentFill,n.commentFill),commentStroke:va(i.commentStroke,n.commentStroke),commentTextColor:va(i.commentTextColor,n.commentTextColor),specialFill:va(i.specialFill,n.specialFill),specialStroke:va(i.specialStroke,n.specialStroke),ruleNameColor:va(i.ruleNameColor,n.ruleNameColor),showMarkers:i.showMarkers??n.showMarkers,markerRadius:jO(i.markerRadius,n.markerRadius)}},"buildRailroadStyleOptions"),oie=C(t=>{const{fontFamily:e,fontSize:r,terminalFill:n,terminalStroke:i,terminalTextColor:a,nonTerminalFill:s,nonTerminalStroke:o,nonTerminalTextColor:l,lineColor:u,strokeWidth:h,markerFill:d,commentFill:f,commentStroke:p,commentTextColor:g,specialFill:m,specialStroke:v,ruleNameColor:y}=xLe(t);return` .railroad-diagram { font-family: ${e}; font-size: ${r}px; @@ -3963,4 +3963,4 @@ Expecting `+ee.join(", ")+", got '"+(this.terminals_[U]||U)+"'":re="Parse error /* Grouping container, no specific styles */ } `},"getStyles"),_p=(WI=class{constructor(){this.d=""}moveTo(e,r){return this.d+=`M ${e} ${r} `,this}lineTo(e,r){return this.d+=`L ${e} ${r} `,this}horizontalTo(e){return this.d+=`H ${e} `,this}verticalTo(e){return this.d+=`V ${e} `,this}arcTo(e,r,n,i,a,s,o){return this.d+=`A ${e} ${r} ${n} ${i?1:0} ${a?1:0} ${s} ${o} `,this}build(){return this.d.trim()}},C(WI,"PathBuilder"),WI),vti=(YI=class{constructor(e,r=xLe()){this.textCache=new Map,this.svg=e,this.config=r}measureText(e){if(this.textCache.has(e))return this.textCache.get(e);const r=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(e),n=r.node().getBBox(),i={width:n.width,height:n.height};return r.remove(),this.textCache.set(e,i),i}renderTerminal(e,r){const n=this.measureText(r),i=n.width+this.config.padding*2,a=n.height+this.config.padding*2,s=e.append("g").attr("class","railroad-terminal");return s.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a).attr("rx",10).attr("ry",10),s.append("text").attr("x",i/2).attr("y",a/2).text(r),{element:s.node(),dimensions:{width:i,height:a,up:a/2,down:a/2}}}renderNonTerminal(e,r){const n=this.measureText(r),i=n.width+this.config.padding*2,a=n.height+this.config.padding*2,s=e.append("g").attr("class","railroad-nonterminal");return s.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a),s.append("text").attr("x",i/2).attr("y",a/2).text(r),{element:s.node(),dimensions:{width:i,height:a,up:a/2,down:a/2}}}renderSequence(e,r){const n=r.map(u=>this.renderExpression(e,u));let i=0,a=0,s=0;for(const u of n)i+=u.dimensions.width,a=Math.max(a,u.dimensions.up),s=Math.max(s,u.dimensions.down);i+=(n.length-1)*this.config.horizontalSeparation;const o=e.append("g").attr("class","railroad-sequence");let l=0;for(let u=0;uthis.renderExpression(e,f));let i=0,a=0;for(const f of n)i=Math.max(i,f.dimensions.width),a+=f.dimensions.height;a+=(n.length-1)*this.config.verticalSeparation;const s=this.config.arcRadius,o=s*4,l=i+o,u=e.append("g").attr("class","railroad-choice");let h=0;const d=a/2;for(const f of n){const p=h,g=p+f.dimensions.up,m=s*2+(i-f.dimensions.width)/2;u.node().appendChild(f.element).setAttribute("transform",`translate(${m}, ${p})`);const y=new _p,b=g>d;g===d?y.moveTo(0,d).lineTo(m,g):y.moveTo(0,d).arcTo(s,s,0,!1,b,s,d+(b?s:-s)).lineTo(s,g-(b?s:-s)).arcTo(s,s,0,!1,!b,s*2,g).lineTo(m,g),u.append("path").attr("class","railroad-line").attr("d",y.build());const x=new _p,w=m+f.dimensions.width,A=l-s*2;g===d?x.moveTo(w,g).lineTo(l,d):x.moveTo(w,g).lineTo(A,g).arcTo(s,s,0,!1,!b,l-s,g+(b?-s:s)).lineTo(l-s,d+(b?s:-s)).arcTo(s,s,0,!1,b,l,d),u.append("path").attr("class","railroad-line").attr("d",x.build()),h+=f.dimensions.height+this.config.verticalSeparation}return{element:u.node(),dimensions:{width:l,height:a,up:d,down:a-d}}}renderOptional(e,r){const n=this.renderExpression(e,r),i=this.config.arcRadius,a=i*2,s=n.dimensions.width+i*4,o=n.dimensions.height+a,l=e.append("g").attr("class","railroad-optional"),u=i*2,h=a;l.node().appendChild(n.element).setAttribute("transform",`translate(${u}, ${h})`);const f=h+n.dimensions.up,p=new _p().moveTo(0,f).lineTo(i*2,f);l.append("path").attr("class","railroad-line").attr("d",p.build());const g=new _p().moveTo(u+n.dimensions.width,f).lineTo(s,f);l.append("path").attr("class","railroad-line").attr("d",g.build());const m=new _p().moveTo(0,f).arcTo(i,i,0,!1,!1,i,f-i).lineTo(i,i).arcTo(i,i,0,!1,!0,i*2,0).lineTo(s-i*2,0).arcTo(i,i,0,!1,!0,s-i,i).lineTo(s-i,f-i).arcTo(i,i,0,!1,!1,s,f);return l.append("path").attr("class","railroad-line").attr("d",m.build()),{element:l.node(),dimensions:{width:s,height:o,up:f,down:o-f}}}renderRepetition(e,r,n){const i=this.renderExpression(e,r),a=this.config.arcRadius,s=a*2,o=i.dimensions.width+a*4,l=n===0,u=i.dimensions.height+s+(l?s:0),h=e.append("g").attr("class","railroad-repetition"),d=a*2,f=l?s:0;h.node().appendChild(i.element).setAttribute("transform",`translate(${d}, ${f})`);const g=f+i.dimensions.up;h.append("path").attr("class","railroad-line").attr("d",new _p().moveTo(0,g).lineTo(a*2,g).build()),h.append("path").attr("class","railroad-line").attr("d",new _p().moveTo(d+i.dimensions.width,g).lineTo(o,g).build());const m=f+i.dimensions.height+a,v=new _p().moveTo(d+i.dimensions.width,g).arcTo(a,a,0,!1,!0,d+i.dimensions.width+a,g+a).lineTo(d+i.dimensions.width+a,m).arcTo(a,a,0,!1,!0,d+i.dimensions.width,m+a).lineTo(a*2,m+a).arcTo(a,a,0,!1,!0,a,m).lineTo(a,g+a).arcTo(a,a,0,!1,!0,a*2,g);if(h.append("path").attr("class","railroad-line").attr("d",v.build()),l){const y=new _p().moveTo(0,g).arcTo(a,a,0,!1,!1,a,g-a).lineTo(a,a).arcTo(a,a,0,!1,!0,a*2,0).lineTo(o-a*2,0).arcTo(a,a,0,!1,!0,o-a,a).lineTo(o-a,g-a).arcTo(a,a,0,!1,!1,o,g);h.append("path").attr("class","railroad-line").attr("d",y.build())}return{element:h.node(),dimensions:{width:o,height:u,up:g,down:u-g}}}renderSpecial(e,r){const n=this.measureText("? "+r+" ?"),i=n.width+this.config.padding*2,a=n.height+this.config.padding*2,s=e.append("g").attr("class","railroad-special");return s.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a),s.append("text").attr("x",i/2).attr("y",a/2).text("? "+r+" ?"),{element:s.node(),dimensions:{width:i,height:a,up:a/2,down:a/2}}}renderExpression(e,r){switch(r.type){case"terminal":return this.renderTerminal(e,r.value);case"nonterminal":return this.renderNonTerminal(e,r.name);case"sequence":return this.renderSequence(e,r.elements);case"choice":return this.renderChoice(e,r.alternatives);case"optional":return this.renderOptional(e,r.element);case"repetition":return this.renderRepetition(e,r.element,r.min);case"special":return this.renderSpecial(e,r.text);default:throw new Error(`Unknown node type: ${r.type}`)}}renderRule(e,r){const n=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${r})`),i=e.name+" =",a=this.measureText(i).width+20,s=a+20,o=n.append("g"),l=this.renderExpression(o,e.definition),u=Math.max(20,l.dimensions.up),h=u-l.dimensions.up;return o.attr("transform",`translate(${s}, ${h})`),n.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",u).text(i),n.append("g").attr("class","railroad-start").append("circle").attr("cx",a).attr("cy",u).attr("r",this.config.markerRadius),n.append("g").attr("class","railroad-end").append("circle").attr("cx",s+l.dimensions.width+10).attr("cy",u).attr("r",this.config.markerRadius),n.append("path").attr("class","railroad-line").attr("d",new _p().moveTo(a+this.config.markerRadius,u).lineTo(s,u).build()),n.append("path").attr("class","railroad-line").attr("d",new _p().moveTo(s+l.dimensions.width,u).lineTo(s+l.dimensions.width+10-this.config.markerRadius,u).build()),{height:Math.max(40,h+l.dimensions.height+this.config.padding*2),width:s+l.dimensions.width+10+this.config.markerRadius}}renderDiagram(e){let r=this.config.padding,n=0;for(const i of e){const a=this.renderRule(i,r);r+=a.height+this.config.verticalSeparation,n=Math.max(n,a.width)}return{width:n+this.config.padding*2,height:r+this.config.padding}}},C(YI,"RailroadRenderer"),YI),kZt=C((t,e,r)=>{zs(t,e.height,e.width,r),t.attr("viewBox",`0 0 ${e.width} ${e.height}`)},"configureRailroadSvgSize"),yti=C((t,e,r)=>{me.debug(`[Railroad] Rendering diagram -`+t);try{const n=qc(e);n.attr("class","railroad-diagram");const i=Dr().railroad,a=(i==null?void 0:i.useMaxWidth)??!0,s=cs.getRules();if(me.debug(`[Railroad] Rendering ${s.length} rules`),s.length===0){me.warn("[Railroad] No rules to render"),kZt(n,{height:100,width:200},a);return}const l=new vti(n,xLe()).renderDiagram(s);kZt(n,l,a),me.debug("[Railroad] Render complete")}catch(n){throw me.error("[Railroad] Render error:",n),n}},"draw"),lie={draw:yti},bti=nRe().Railroad.parser.LangiumParser,uD=C(t=>{switch(t.$type){case"RailroadTerminalExpr":return{type:"terminal",value:t.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:t.name};case"RailroadSpecialExpr":return{type:"special",text:t.text};case"RailroadSequenceExpr":{const e=t.elements.map(uD);return e.length===1?e[0]:{type:"sequence",elements:e}}case"RailroadChoiceExpr":{const e=t.alternatives.map(uD);return e.length===1?e[0]:{type:"choice",alternatives:e}}case"RailroadOptionalExpr":return{type:"optional",element:uD(t.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:uD(t.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:uD(t.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${t.$type}`)}},"transformExpression"),xti=C(t=>({name:t.name,definition:uD(t.definition)}),"transformRule"),wti=C(t=>{qu(t,cs),t.title&&cs.setTitle(t.title),t.rules.map(e=>cs.addRule(xti(e)))},"populateDb"),Ati={parse:C(t=>{cs.clear(),me.debug("[Railroad Parser] Starting Langium parse");const e=bti.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new mz(e);const r=e.value;me.debug("[Railroad Parser] Parsed rules:",r.rules.length),wti(r),me.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:cs}},Tti={parser:Ati,db:cs,renderer:lie,styles:oie};const Sti=Object.freeze(Object.defineProperty({__proto__:null,diagram:Tti},Symbol.toStringTag,{value:"Module"}));var Cti=iRe().RailroadEbnf.parser.LangiumParser,cie=C(t=>{const e=t.alternatives.map(Oti);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformChoice"),Oti=C(t=>{const e=t.elements.map(Eti);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),EZt=C(t=>{switch(t.$type){case"EbnfTerminal":return{type:"terminal",value:t.value};case"EbnfNonTerminal":return{type:"nonterminal",name:t.name};case"EbnfSpecial":return{type:"special",text:t.text};case"EbnfGroup":return cie(t.element);case"EbnfOptional":return{type:"optional",element:cie(t.element)};case"EbnfRepetition":return{type:"repetition",element:cie(t.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${t.$type}`)}},"transformPrimary"),kti=C((t,e)=>{switch(e.$type){case"EbnfOptionalPostfix":return{type:"optional",element:t};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:t,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:t,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[t,{type:"terminal",value:"-"},EZt(e.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${e.$type}`)}},"transformPostfix"),Eti=C(t=>t.postfixes.reduce((e,r)=>kti(e,r),EZt(t.base)),"transformTerm"),_ti=C(t=>({name:t.name,definition:cie(t.definition)}),"transformRule"),Rti=C(t=>{qu(t,cs),t.title&&cs.setTitle(t.title),t.rules.map(e=>cs.addRule(_ti(e)))},"populateDb"),Dti={parse:C(t=>{cs.clear(),me.debug("[EBNF Parser] Starting Langium parse");const e=Cti.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new mz(e);const r=e.value;me.debug("[EBNF Parser] Parsed rules:",r.rules.length),Rti(r),me.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:cs}},Lti={parser:Dti,db:cs,renderer:lie,styles:oie};const Mti=Object.freeze(Object.defineProperty({__proto__:null,diagram:Lti},Symbol.toStringTag,{value:"Module"}));var Iti=aRe().RailroadAbnf.parser.LangiumParser,wLe=C(t=>{const e=t.alternatives.map(Pti);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformAlternation"),Pti=C(t=>{const e=t.elements.map(Bti);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformConcatenation"),Nti=C(t=>{if(t.includes("*")){const[r,n]=t.split("*"),i=r?parseInt(r,10):0,a=n?parseInt(n,10):1/0;return{min:i,max:a}}const e=parseInt(t,10);return{min:e,max:e}},"parseRepeat"),Bti=C(t=>{const e=$ti(t.primary);if(!t.repeat)return e;const{min:r,max:n}=Nti(t.repeat);return r===0&&n===1?{type:"optional",element:e}:{type:"repetition",element:e,min:r,max:n}},"transformElement"),$ti=C(t=>{switch(t.$type){case"AbnfStringLiteral":return{type:"terminal",value:t.value};case"AbnfNumVal":return{type:"terminal",value:t.value};case"AbnfRuleName":return{type:"nonterminal",name:t.name};case"AbnfGroup":return wLe(t.element);case"AbnfOptionalGroup":return{type:"optional",element:wLe(t.element)};default:throw new Error(`Unsupported ABNF primary node: ${t.$type}`)}},"transformPrimary"),Fti=C(t=>({name:t.name,definition:wLe(t.definition)}),"transformRule"),zti=C(t=>{qu(t,cs),t.title&&cs.setTitle(t.title),t.rules.map(e=>cs.addRule(Fti(e)))},"populateDb"),Uti={parse:C(t=>{cs.clear(),me.debug("[ABNF Parser] Starting Langium parse");const e=Iti.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new mz(e);const r=e.value;me.debug("[ABNF Parser] Parsed rules:",r.rules.length),zti(r),me.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:cs}},Vti={parser:Uti,db:cs,renderer:lie,styles:oie};const Qti=Object.freeze(Object.defineProperty({__proto__:null,diagram:Vti},Symbol.toStringTag,{value:"Module"}));var Gti=sRe().RailroadPeg.parser.LangiumParser,_Zt=C(t=>{const e=t.alternatives.map(Hti);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformOrderedChoice"),Hti=C(t=>{const e=t.elements.map(Wti);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),Wti=C(t=>{const e=Yti(t.suffix);return t.operator?{type:"special",text:t.operator==="&"?`&${RZt(e)}`:`!${RZt(e)}`}:e},"transformPrefix"),RZt=C(t=>{switch(t.type){case"terminal":return`"${t.value}"`;case"nonterminal":return t.name;case"special":return t.text;default:return"(...)"}},"nodeToLabel"),Yti=C(t=>{const e=qti(t.primary);if(!t.operator)return e;switch(t.operator){case"?":return{type:"optional",element:e};case"*":return{type:"repetition",element:e,min:0,max:1/0};case"+":return{type:"repetition",element:e,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${t.operator}`)}},"transformSuffix"),qti=C(t=>{switch(t.$type){case"PegLiteral":return{type:"terminal",value:t.value};case"PegIdentifier":return{type:"nonterminal",name:t.name};case"PegGroup":return _Zt(t.element);case"PegAny":return{type:"special",text:t.dot};default:throw new Error(`Unsupported PEG primary node: ${t.$type}`)}},"transformPrimary"),jti=C(t=>({name:t.name,definition:_Zt(t.definition)}),"transformRule"),Xti=C(t=>{qu(t,cs),t.title&&cs.setTitle(t.title),t.rules.map(e=>cs.addRule(jti(e)))},"populateDb"),Kti={parse:C(t=>{cs.clear(),me.debug("[PEG Parser] Starting Langium parse");const e=Gti.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new mz(e);const r=e.value;me.debug("[PEG Parser] Parsed rules:",r.rules.length),Xti(r),me.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:cs}},Zti={parser:Kti,db:cs,renderer:lie,styles:oie};const Jti=Object.freeze(Object.defineProperty({__proto__:null,diagram:Zti},Symbol.toStringTag,{value:"Module"}));var eri=1;function ALe(){if(!(typeof globalThis>"u"))return globalThis}C(ALe,"getCaptureGlobal");function DZt(){var t;return!!((t=ALe())!=null&&t.mermaidCaptureSizes)}C(DZt,"shouldCaptureSizes");function LZt(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}C(LZt,"capturedFromLocation");function MZt(t,e){const r=ALe();if(!r)return;const n=e.node(),i=(n&&"ownerSVGElement"in n?n.ownerSVGElement:null)??n,a=(i==null?void 0:i.id)??"(unknown)";r.mermaidCapturedSizes??(r.mermaidCapturedSizes=[]);const s={svgId:a,sizes:t};r.mermaidCapturedSizes.push(s),r.mermaidLastCapturedSizes=s}C(MZt,"emitCapturedSizes");function IZt(t,e){const r=[];for(const n of e.nodes)n.isGroup||r.push({id:n.id,width:n.width??0,height:n.height??0});r.length!==0&&MZt({metadata:{captureVersion:eri,capturedAt:new Date().toISOString(),capturedFrom:LZt()},nodes:r},t)}C(IZt,"captureNodeSizes");const tri=Object.freeze(Object.defineProperty({__proto__:null,captureNodeSizes:IZt,shouldCaptureSizes:DZt},Symbol.toStringTag,{value:"Module"})),rri=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:EWt,createInfoServices:_Wt},Symbol.toStringTag,{value:"Module"})),nri=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:RWt,createPacketServices:DWt},Symbol.toStringTag,{value:"Module"})),iri=Object.freeze(Object.defineProperty({__proto__:null,PieModule:LWt,createPieServices:MWt},Symbol.toStringTag,{value:"Module"})),ari=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:IWt,createTreeViewServices:PWt},Symbol.toStringTag,{value:"Module"})),sri=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:NWt,createArchitectureServices:BWt},Symbol.toStringTag,{value:"Module"})),ori=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:OWt,createGitGraphServices:kWt},Symbol.toStringTag,{value:"Module"})),lri=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:QWt,createEventModelingServices:GWt},Symbol.toStringTag,{value:"Module"})),cri=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:uWt,createRadarServices:hWt},Symbol.toStringTag,{value:"Module"})),uri=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:fWt,createRailroadServices:nRe},Symbol.toStringTag,{value:"Module"})),hri=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:gWt,createRailroadEbnfServices:iRe},Symbol.toStringTag,{value:"Module"})),dri=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:mWt,createRailroadAbnfServices:aRe},Symbol.toStringTag,{value:"Module"})),fri=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:yWt,createRailroadPegServices:sRe},Symbol.toStringTag,{value:"Module"})),pri=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:xWt,createTreemapServices:wWt},Symbol.toStringTag,{value:"Module"})),gri=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:AWt,createWardleyServices:TWt},Symbol.toStringTag,{value:"Module"})),mri=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:SWt,createCynefinServices:CWt},Symbol.toStringTag,{value:"Module"}))})(); +`+t);try{const n=qc(e);n.attr("class","railroad-diagram");const i=Dr().railroad,a=(i==null?void 0:i.useMaxWidth)??!0,s=cs.getRules();if(me.debug(`[Railroad] Rendering ${s.length} rules`),s.length===0){me.warn("[Railroad] No rules to render"),kZt(n,{height:100,width:200},a);return}const l=new vti(n,xLe()).renderDiagram(s);kZt(n,l,a),me.debug("[Railroad] Render complete")}catch(n){throw me.error("[Railroad] Render error:",n),n}},"draw"),lie={draw:yti},bti=nRe().Railroad.parser.LangiumParser,uD=C(t=>{switch(t.$type){case"RailroadTerminalExpr":return{type:"terminal",value:t.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:t.name};case"RailroadSpecialExpr":return{type:"special",text:t.text};case"RailroadSequenceExpr":{const e=t.elements.map(uD);return e.length===1?e[0]:{type:"sequence",elements:e}}case"RailroadChoiceExpr":{const e=t.alternatives.map(uD);return e.length===1?e[0]:{type:"choice",alternatives:e}}case"RailroadOptionalExpr":return{type:"optional",element:uD(t.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:uD(t.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:uD(t.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${t.$type}`)}},"transformExpression"),xti=C(t=>({name:t.name,definition:uD(t.definition)}),"transformRule"),wti=C(t=>{qu(t,cs),t.title&&cs.setTitle(t.title),t.rules.map(e=>cs.addRule(xti(e)))},"populateDb"),Ati={parse:C(t=>{cs.clear(),me.debug("[Railroad Parser] Starting Langium parse");const e=bti.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new mz(e);const r=e.value;me.debug("[Railroad Parser] Parsed rules:",r.rules.length),wti(r),me.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:cs}},Sti={parser:Ati,db:cs,renderer:lie,styles:oie};const Tti=Object.freeze(Object.defineProperty({__proto__:null,diagram:Sti},Symbol.toStringTag,{value:"Module"}));var Cti=iRe().RailroadEbnf.parser.LangiumParser,cie=C(t=>{const e=t.alternatives.map(Oti);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformChoice"),Oti=C(t=>{const e=t.elements.map(Eti);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),EZt=C(t=>{switch(t.$type){case"EbnfTerminal":return{type:"terminal",value:t.value};case"EbnfNonTerminal":return{type:"nonterminal",name:t.name};case"EbnfSpecial":return{type:"special",text:t.text};case"EbnfGroup":return cie(t.element);case"EbnfOptional":return{type:"optional",element:cie(t.element)};case"EbnfRepetition":return{type:"repetition",element:cie(t.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${t.$type}`)}},"transformPrimary"),kti=C((t,e)=>{switch(e.$type){case"EbnfOptionalPostfix":return{type:"optional",element:t};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:t,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:t,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[t,{type:"terminal",value:"-"},EZt(e.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${e.$type}`)}},"transformPostfix"),Eti=C(t=>t.postfixes.reduce((e,r)=>kti(e,r),EZt(t.base)),"transformTerm"),_ti=C(t=>({name:t.name,definition:cie(t.definition)}),"transformRule"),Rti=C(t=>{qu(t,cs),t.title&&cs.setTitle(t.title),t.rules.map(e=>cs.addRule(_ti(e)))},"populateDb"),Dti={parse:C(t=>{cs.clear(),me.debug("[EBNF Parser] Starting Langium parse");const e=Cti.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new mz(e);const r=e.value;me.debug("[EBNF Parser] Parsed rules:",r.rules.length),Rti(r),me.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:cs}},Lti={parser:Dti,db:cs,renderer:lie,styles:oie};const Mti=Object.freeze(Object.defineProperty({__proto__:null,diagram:Lti},Symbol.toStringTag,{value:"Module"}));var Iti=aRe().RailroadAbnf.parser.LangiumParser,wLe=C(t=>{const e=t.alternatives.map(Pti);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformAlternation"),Pti=C(t=>{const e=t.elements.map(Bti);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformConcatenation"),Nti=C(t=>{if(t.includes("*")){const[r,n]=t.split("*"),i=r?parseInt(r,10):0,a=n?parseInt(n,10):1/0;return{min:i,max:a}}const e=parseInt(t,10);return{min:e,max:e}},"parseRepeat"),Bti=C(t=>{const e=$ti(t.primary);if(!t.repeat)return e;const{min:r,max:n}=Nti(t.repeat);return r===0&&n===1?{type:"optional",element:e}:{type:"repetition",element:e,min:r,max:n}},"transformElement"),$ti=C(t=>{switch(t.$type){case"AbnfStringLiteral":return{type:"terminal",value:t.value};case"AbnfNumVal":return{type:"terminal",value:t.value};case"AbnfRuleName":return{type:"nonterminal",name:t.name};case"AbnfGroup":return wLe(t.element);case"AbnfOptionalGroup":return{type:"optional",element:wLe(t.element)};default:throw new Error(`Unsupported ABNF primary node: ${t.$type}`)}},"transformPrimary"),Fti=C(t=>({name:t.name,definition:wLe(t.definition)}),"transformRule"),zti=C(t=>{qu(t,cs),t.title&&cs.setTitle(t.title),t.rules.map(e=>cs.addRule(Fti(e)))},"populateDb"),Uti={parse:C(t=>{cs.clear(),me.debug("[ABNF Parser] Starting Langium parse");const e=Iti.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new mz(e);const r=e.value;me.debug("[ABNF Parser] Parsed rules:",r.rules.length),zti(r),me.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:cs}},Vti={parser:Uti,db:cs,renderer:lie,styles:oie};const Qti=Object.freeze(Object.defineProperty({__proto__:null,diagram:Vti},Symbol.toStringTag,{value:"Module"}));var Gti=sRe().RailroadPeg.parser.LangiumParser,_Zt=C(t=>{const e=t.alternatives.map(Hti);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformOrderedChoice"),Hti=C(t=>{const e=t.elements.map(Wti);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),Wti=C(t=>{const e=Yti(t.suffix);return t.operator?{type:"special",text:t.operator==="&"?`&${RZt(e)}`:`!${RZt(e)}`}:e},"transformPrefix"),RZt=C(t=>{switch(t.type){case"terminal":return`"${t.value}"`;case"nonterminal":return t.name;case"special":return t.text;default:return"(...)"}},"nodeToLabel"),Yti=C(t=>{const e=qti(t.primary);if(!t.operator)return e;switch(t.operator){case"?":return{type:"optional",element:e};case"*":return{type:"repetition",element:e,min:0,max:1/0};case"+":return{type:"repetition",element:e,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${t.operator}`)}},"transformSuffix"),qti=C(t=>{switch(t.$type){case"PegLiteral":return{type:"terminal",value:t.value};case"PegIdentifier":return{type:"nonterminal",name:t.name};case"PegGroup":return _Zt(t.element);case"PegAny":return{type:"special",text:t.dot};default:throw new Error(`Unsupported PEG primary node: ${t.$type}`)}},"transformPrimary"),jti=C(t=>({name:t.name,definition:_Zt(t.definition)}),"transformRule"),Xti=C(t=>{qu(t,cs),t.title&&cs.setTitle(t.title),t.rules.map(e=>cs.addRule(jti(e)))},"populateDb"),Kti={parse:C(t=>{cs.clear(),me.debug("[PEG Parser] Starting Langium parse");const e=Gti.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new mz(e);const r=e.value;me.debug("[PEG Parser] Parsed rules:",r.rules.length),Xti(r),me.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:cs}},Zti={parser:Kti,db:cs,renderer:lie,styles:oie};const Jti=Object.freeze(Object.defineProperty({__proto__:null,diagram:Zti},Symbol.toStringTag,{value:"Module"}));var eri=1;function ALe(){if(!(typeof globalThis>"u"))return globalThis}C(ALe,"getCaptureGlobal");function DZt(){var t;return!!((t=ALe())!=null&&t.mermaidCaptureSizes)}C(DZt,"shouldCaptureSizes");function LZt(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}C(LZt,"capturedFromLocation");function MZt(t,e){const r=ALe();if(!r)return;const n=e.node(),i=(n&&"ownerSVGElement"in n?n.ownerSVGElement:null)??n,a=(i==null?void 0:i.id)??"(unknown)";r.mermaidCapturedSizes??(r.mermaidCapturedSizes=[]);const s={svgId:a,sizes:t};r.mermaidCapturedSizes.push(s),r.mermaidLastCapturedSizes=s}C(MZt,"emitCapturedSizes");function IZt(t,e){const r=[];for(const n of e.nodes)n.isGroup||r.push({id:n.id,width:n.width??0,height:n.height??0});r.length!==0&&MZt({metadata:{captureVersion:eri,capturedAt:new Date().toISOString(),capturedFrom:LZt()},nodes:r},t)}C(IZt,"captureNodeSizes");const tri=Object.freeze(Object.defineProperty({__proto__:null,captureNodeSizes:IZt,shouldCaptureSizes:DZt},Symbol.toStringTag,{value:"Module"})),rri=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:EWt,createInfoServices:_Wt},Symbol.toStringTag,{value:"Module"})),nri=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:RWt,createPacketServices:DWt},Symbol.toStringTag,{value:"Module"})),iri=Object.freeze(Object.defineProperty({__proto__:null,PieModule:LWt,createPieServices:MWt},Symbol.toStringTag,{value:"Module"})),ari=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:IWt,createTreeViewServices:PWt},Symbol.toStringTag,{value:"Module"})),sri=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:NWt,createArchitectureServices:BWt},Symbol.toStringTag,{value:"Module"})),ori=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:OWt,createGitGraphServices:kWt},Symbol.toStringTag,{value:"Module"})),lri=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:QWt,createEventModelingServices:GWt},Symbol.toStringTag,{value:"Module"})),cri=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:uWt,createRadarServices:hWt},Symbol.toStringTag,{value:"Module"})),uri=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:fWt,createRailroadServices:nRe},Symbol.toStringTag,{value:"Module"})),hri=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:gWt,createRailroadEbnfServices:iRe},Symbol.toStringTag,{value:"Module"})),dri=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:mWt,createRailroadAbnfServices:aRe},Symbol.toStringTag,{value:"Module"})),fri=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:yWt,createRailroadPegServices:sRe},Symbol.toStringTag,{value:"Module"})),pri=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:xWt,createTreemapServices:wWt},Symbol.toStringTag,{value:"Module"})),gri=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:AWt,createWardleyServices:SWt},Symbol.toStringTag,{value:"Module"})),mri=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:TWt,createCynefinServices:CWt},Symbol.toStringTag,{value:"Module"}))})();